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/devices/bus/a1bus/a1bus.cpp | 12 +- src/devices/bus/a1bus/a1bus.h | 12 +- src/devices/bus/a1bus/a1cassette.cpp | 4 +- src/devices/bus/a1bus/a1cassette.h | 6 +- src/devices/bus/a1bus/a1cffa.cpp | 4 +- src/devices/bus/a1bus/a1cffa.h | 8 +- src/devices/bus/a2bus/a2alfam2.cpp | 10 +- src/devices/bus/a2bus/a2alfam2.h | 12 +- src/devices/bus/a2bus/a2applicard.cpp | 10 +- src/devices/bus/a2bus/a2applicard.h | 14 +- src/devices/bus/a2bus/a2arcadebd.cpp | 8 +- src/devices/bus/a2bus/a2arcadebd.h | 8 +- src/devices/bus/a2bus/a2bus.cpp | 20 +- src/devices/bus/a2bus/a2bus.h | 56 +- src/devices/bus/a2bus/a2cffa.cpp | 16 +- src/devices/bus/a2bus/a2cffa.h | 22 +- src/devices/bus/a2bus/a2corvus.cpp | 12 +- src/devices/bus/a2bus/a2corvus.h | 14 +- src/devices/bus/a2bus/a2diskii.cpp | 12 +- src/devices/bus/a2bus/a2diskii.h | 14 +- src/devices/bus/a2bus/a2diskiing.cpp | 8 +- src/devices/bus/a2bus/a2diskiing.h | 10 +- src/devices/bus/a2bus/a2dx1.cpp | 8 +- src/devices/bus/a2bus/a2dx1.h | 8 +- src/devices/bus/a2bus/a2eauxslot.cpp | 8 +- src/devices/bus/a2bus/a2eauxslot.h | 18 +- src/devices/bus/a2bus/a2echoii.cpp | 8 +- src/devices/bus/a2bus/a2echoii.h | 8 +- src/devices/bus/a2bus/a2eext80col.cpp | 12 +- src/devices/bus/a2bus/a2eext80col.h | 14 +- src/devices/bus/a2bus/a2eramworks3.cpp | 14 +- src/devices/bus/a2bus/a2eramworks3.h | 16 +- src/devices/bus/a2bus/a2estd80col.cpp | 12 +- src/devices/bus/a2bus/a2estd80col.h | 14 +- src/devices/bus/a2bus/a2hsscsi.cpp | 16 +- src/devices/bus/a2bus/a2hsscsi.h | 26 +- src/devices/bus/a2bus/a2lang.cpp | 10 +- src/devices/bus/a2bus/a2lang.h | 8 +- src/devices/bus/a2bus/a2mcms.cpp | 28 +- src/devices/bus/a2bus/a2mcms.h | 36 +- src/devices/bus/a2bus/a2memexp.cpp | 20 +- src/devices/bus/a2bus/a2memexp.h | 22 +- src/devices/bus/a2bus/a2midi.cpp | 10 +- src/devices/bus/a2bus/a2midi.h | 8 +- src/devices/bus/a2bus/a2mockingboard.cpp | 22 +- src/devices/bus/a2bus/a2mockingboard.h | 22 +- src/devices/bus/a2bus/a2pic.cpp | 14 +- src/devices/bus/a2bus/a2pic.h | 14 +- src/devices/bus/a2bus/a2sam.cpp | 4 +- src/devices/bus/a2bus/a2sam.h | 4 +- src/devices/bus/a2bus/a2scsi.cpp | 16 +- src/devices/bus/a2bus/a2scsi.h | 24 +- src/devices/bus/a2bus/a2softcard.cpp | 6 +- src/devices/bus/a2bus/a2softcard.h | 6 +- src/devices/bus/a2bus/a2ssc.cpp | 12 +- src/devices/bus/a2bus/a2ssc.h | 14 +- src/devices/bus/a2bus/a2swyft.cpp | 10 +- src/devices/bus/a2bus/a2swyft.h | 16 +- src/devices/bus/a2bus/a2themill.cpp | 8 +- src/devices/bus/a2bus/a2themill.h | 10 +- src/devices/bus/a2bus/a2thunderclock.cpp | 12 +- src/devices/bus/a2bus/a2thunderclock.h | 14 +- src/devices/bus/a2bus/a2ultraterm.cpp | 34 +- src/devices/bus/a2bus/a2ultraterm.h | 24 +- src/devices/bus/a2bus/a2videoterm.cpp | 44 +- src/devices/bus/a2bus/a2videoterm.h | 34 +- src/devices/bus/a2bus/a2vulcan.cpp | 16 +- src/devices/bus/a2bus/a2vulcan.h | 22 +- src/devices/bus/a2bus/a2zipdrive.cpp | 12 +- src/devices/bus/a2bus/a2zipdrive.h | 16 +- src/devices/bus/a2bus/corvfdc01.cpp | 10 +- src/devices/bus/a2bus/corvfdc01.h | 14 +- src/devices/bus/a2bus/corvfdc02.cpp | 10 +- src/devices/bus/a2bus/corvfdc02.h | 18 +- src/devices/bus/a2bus/ezcgi.cpp | 24 +- src/devices/bus/a2bus/ezcgi.h | 24 +- src/devices/bus/a2bus/laser128.cpp | 14 +- src/devices/bus/a2bus/laser128.h | 18 +- src/devices/bus/a2bus/mouse.cpp | 14 +- src/devices/bus/a2bus/mouse.h | 36 +- src/devices/bus/a2bus/pc_xporter.cpp | 18 +- src/devices/bus/a2bus/pc_xporter.h | 40 +- src/devices/bus/a2bus/ramcard128k.cpp | 12 +- src/devices/bus/a2bus/ramcard128k.h | 18 +- src/devices/bus/a2bus/ramcard16k.cpp | 12 +- src/devices/bus/a2bus/ramcard16k.h | 18 +- src/devices/bus/a2bus/timemasterho.cpp | 14 +- src/devices/bus/a2bus/timemasterho.h | 14 +- src/devices/bus/a7800/a78_slot.cpp | 26 +- src/devices/bus/a7800/a78_slot.h | 32 +- src/devices/bus/a7800/cpuwiz.cpp | 8 +- src/devices/bus/a7800/cpuwiz.h | 8 +- src/devices/bus/a7800/hiscore.cpp | 2 +- src/devices/bus/a7800/hiscore.h | 2 +- src/devices/bus/a7800/rom.cpp | 38 +- src/devices/bus/a7800/rom.h | 34 +- src/devices/bus/a7800/xboard.cpp | 6 +- src/devices/bus/a7800/xboard.h | 6 +- src/devices/bus/a800/a800_slot.cpp | 32 +- src/devices/bus/a800/a800_slot.h | 36 +- src/devices/bus/a800/a8sio.cpp | 8 +- src/devices/bus/a800/a8sio.h | 8 +- src/devices/bus/a800/cassette.cpp | 6 +- src/devices/bus/a800/cassette.h | 8 +- src/devices/bus/a800/oss.cpp | 8 +- src/devices/bus/a800/oss.h | 8 +- src/devices/bus/a800/rom.cpp | 26 +- src/devices/bus/a800/rom.h | 24 +- src/devices/bus/a800/sparta.cpp | 2 +- src/devices/bus/a800/sparta.h | 2 +- src/devices/bus/abcbus/abc890.cpp | 40 +- src/devices/bus/abcbus/abc890.h | 34 +- src/devices/bus/abcbus/abcbus.cpp | 2 +- src/devices/bus/abcbus/abcbus.h | 52 +- src/devices/bus/abcbus/fd2.cpp | 24 +- src/devices/bus/abcbus/fd2.h | 20 +- src/devices/bus/abcbus/hdc.cpp | 4 +- src/devices/bus/abcbus/hdc.h | 4 +- src/devices/bus/abcbus/lux10828.cpp | 26 +- src/devices/bus/abcbus/lux10828.h | 18 +- src/devices/bus/abcbus/lux21046.cpp | 36 +- src/devices/bus/abcbus/lux21046.h | 34 +- src/devices/bus/abcbus/lux21056.cpp | 24 +- src/devices/bus/abcbus/lux21056.h | 22 +- src/devices/bus/abcbus/lux4105.cpp | 20 +- src/devices/bus/abcbus/lux4105.h | 20 +- src/devices/bus/abcbus/memcard.cpp | 6 +- src/devices/bus/abcbus/memcard.h | 6 +- src/devices/bus/abcbus/ram.cpp | 8 +- src/devices/bus/abcbus/ram.h | 10 +- src/devices/bus/abcbus/sio.cpp | 8 +- src/devices/bus/abcbus/sio.h | 6 +- src/devices/bus/abcbus/slutprov.cpp | 4 +- src/devices/bus/abcbus/slutprov.h | 4 +- src/devices/bus/abcbus/turbo.cpp | 4 +- src/devices/bus/abcbus/turbo.h | 4 +- src/devices/bus/abcbus/uni800.cpp | 4 +- src/devices/bus/abcbus/uni800.h | 4 +- src/devices/bus/abckb/abc77.cpp | 8 +- src/devices/bus/abckb/abc77.h | 8 +- src/devices/bus/abckb/abc800kb.cpp | 4 +- src/devices/bus/abckb/abc800kb.h | 2 +- src/devices/bus/abckb/abc99.cpp | 6 +- src/devices/bus/abckb/abc99.h | 2 +- src/devices/bus/abckb/abckb.cpp | 2 +- src/devices/bus/abckb/abckb.h | 2 +- src/devices/bus/adam/adamlink.cpp | 6 +- src/devices/bus/adam/adamlink.h | 6 +- src/devices/bus/adam/exp.cpp | 6 +- src/devices/bus/adam/exp.h | 12 +- src/devices/bus/adam/ide.cpp | 6 +- src/devices/bus/adam/ide.h | 8 +- src/devices/bus/adam/ram.cpp | 6 +- src/devices/bus/adam/ram.h | 8 +- src/devices/bus/adamnet/adamnet.cpp | 4 +- src/devices/bus/adamnet/adamnet.h | 4 +- src/devices/bus/adamnet/ddp.cpp | 6 +- src/devices/bus/adamnet/ddp.h | 2 +- src/devices/bus/adamnet/fdc.cpp | 8 +- src/devices/bus/adamnet/fdc.h | 4 +- src/devices/bus/adamnet/kb.cpp | 6 +- src/devices/bus/adamnet/kb.h | 4 +- src/devices/bus/adamnet/printer.cpp | 4 +- src/devices/bus/adamnet/printer.h | 2 +- src/devices/bus/adamnet/spi.cpp | 4 +- src/devices/bus/adamnet/spi.h | 2 +- src/devices/bus/amiga/zorro/a2052.cpp | 2 +- src/devices/bus/amiga/zorro/a2052.h | 4 +- src/devices/bus/amiga/zorro/a2232.cpp | 6 +- src/devices/bus/amiga/zorro/a2232.h | 8 +- src/devices/bus/amiga/zorro/a590.cpp | 6 +- src/devices/bus/amiga/zorro/a590.h | 8 +- src/devices/bus/amiga/zorro/action_replay.cpp | 8 +- src/devices/bus/amiga/zorro/action_replay.h | 8 +- src/devices/bus/amiga/zorro/buddha.cpp | 16 +- src/devices/bus/amiga/zorro/buddha.h | 2 +- src/devices/bus/amiga/zorro/zorro.cpp | 14 +- src/devices/bus/amiga/zorro/zorro.h | 14 +- src/devices/bus/apf/rom.cpp | 8 +- src/devices/bus/apf/rom.h | 8 +- src/devices/bus/apf/slot.cpp | 10 +- src/devices/bus/apf/slot.h | 20 +- src/devices/bus/apricot/expansion/expansion.cpp | 6 +- src/devices/bus/apricot/expansion/expansion.h | 6 +- src/devices/bus/apricot/expansion/ram.cpp | 6 +- src/devices/bus/apricot/expansion/ram.h | 12 +- src/devices/bus/apricot/keyboard/hle.cpp | 8 +- src/devices/bus/apricot/keyboard/hle.h | 8 +- src/devices/bus/apricot/keyboard/keyboard.cpp | 2 +- src/devices/bus/apricot/keyboard/keyboard.h | 2 +- src/devices/bus/arcadia/rom.cpp | 6 +- src/devices/bus/arcadia/rom.h | 6 +- src/devices/bus/arcadia/slot.cpp | 6 +- src/devices/bus/arcadia/slot.h | 12 +- src/devices/bus/astrocde/exp.cpp | 2 +- src/devices/bus/astrocde/exp.h | 2 +- src/devices/bus/astrocde/ram.cpp | 14 +- src/devices/bus/astrocde/ram.h | 22 +- src/devices/bus/astrocde/rom.cpp | 8 +- src/devices/bus/astrocde/rom.h | 12 +- src/devices/bus/astrocde/slot.cpp | 8 +- src/devices/bus/astrocde/slot.h | 12 +- src/devices/bus/bbc/1mhzbus/1mhzbus.cpp | 2 +- src/devices/bus/bbc/1mhzbus/1mhzbus.h | 2 +- src/devices/bus/bbc/1mhzbus/opus3.cpp | 2 +- src/devices/bus/bbc/1mhzbus/opus3.h | 4 +- src/devices/bus/bbc/analogue/analogue.cpp | 6 +- src/devices/bus/bbc/analogue/analogue.h | 10 +- src/devices/bus/bbc/analogue/joystick.cpp | 10 +- src/devices/bus/bbc/analogue/joystick.h | 10 +- src/devices/bus/bbc/fdc/acorn.cpp | 4 +- src/devices/bus/bbc/fdc/acorn.h | 4 +- src/devices/bus/bbc/fdc/cumana.cpp | 6 +- src/devices/bus/bbc/fdc/cumana.h | 6 +- src/devices/bus/bbc/fdc/fdc.cpp | 2 +- src/devices/bus/bbc/fdc/fdc.h | 2 +- src/devices/bus/bbc/fdc/opus.cpp | 8 +- src/devices/bus/bbc/fdc/opus.h | 8 +- src/devices/bus/bbc/fdc/watford.cpp | 6 +- src/devices/bus/bbc/fdc/watford.h | 6 +- src/devices/bus/bbc/joyport/joyport.cpp | 6 +- src/devices/bus/bbc/joyport/joyport.h | 10 +- src/devices/bus/bbc/joyport/joystick.cpp | 6 +- src/devices/bus/bbc/joyport/joystick.h | 6 +- src/devices/bus/bbc/tube/tube.cpp | 2 +- src/devices/bus/bbc/tube/tube.h | 2 +- src/devices/bus/bbc/userport/userport.cpp | 6 +- src/devices/bus/bbc/userport/userport.h | 14 +- src/devices/bus/bml3/bml3bus.cpp | 8 +- src/devices/bus/bml3/bml3bus.h | 8 +- src/devices/bus/bml3/bml3kanji.cpp | 4 +- src/devices/bus/bml3/bml3kanji.h | 6 +- src/devices/bus/bml3/bml3mp1802.cpp | 4 +- src/devices/bus/bml3/bml3mp1802.h | 4 +- src/devices/bus/bml3/bml3mp1805.cpp | 4 +- src/devices/bus/bml3/bml3mp1805.h | 4 +- src/devices/bus/bw2/exp.cpp | 10 +- src/devices/bus/bw2/exp.h | 18 +- src/devices/bus/bw2/ramcard.cpp | 8 +- src/devices/bus/bw2/ramcard.h | 12 +- src/devices/bus/c64/16kb.cpp | 6 +- src/devices/bus/c64/16kb.h | 4 +- src/devices/bus/c64/4dxh.cpp | 2 +- src/devices/bus/c64/4dxh.h | 2 +- src/devices/bus/c64/4ksa.cpp | 2 +- src/devices/bus/c64/4ksa.h | 2 +- src/devices/bus/c64/4tba.cpp | 2 +- src/devices/bus/c64/4tba.h | 2 +- src/devices/bus/c64/bn1541.cpp | 4 +- src/devices/bus/c64/bn1541.h | 10 +- src/devices/bus/c64/c128_comal80.cpp | 6 +- src/devices/bus/c64/c128_comal80.h | 8 +- src/devices/bus/c64/c128_partner.cpp | 8 +- src/devices/bus/c64/c128_partner.h | 10 +- src/devices/bus/c64/comal80.cpp | 6 +- src/devices/bus/c64/comal80.h | 8 +- src/devices/bus/c64/cpm.cpp | 6 +- src/devices/bus/c64/cpm.h | 4 +- src/devices/bus/c64/currah_speech.cpp | 6 +- src/devices/bus/c64/currah_speech.h | 6 +- src/devices/bus/c64/dela_ep256.cpp | 6 +- src/devices/bus/c64/dela_ep256.h | 8 +- src/devices/bus/c64/dela_ep64.cpp | 6 +- src/devices/bus/c64/dela_ep64.h | 8 +- src/devices/bus/c64/dela_ep7x8.cpp | 6 +- src/devices/bus/c64/dela_ep7x8.h | 8 +- src/devices/bus/c64/dinamic.cpp | 4 +- src/devices/bus/c64/dinamic.h | 6 +- src/devices/bus/c64/dqbb.cpp | 6 +- src/devices/bus/c64/dqbb.h | 6 +- src/devices/bus/c64/easy_calc_result.cpp | 6 +- src/devices/bus/c64/easy_calc_result.h | 6 +- src/devices/bus/c64/easyflash.cpp | 6 +- src/devices/bus/c64/easyflash.h | 12 +- src/devices/bus/c64/epyx_fast_load.cpp | 6 +- src/devices/bus/c64/epyx_fast_load.h | 6 +- src/devices/bus/c64/exos.cpp | 4 +- src/devices/bus/c64/exos.h | 4 +- src/devices/bus/c64/exp.cpp | 10 +- src/devices/bus/c64/exp.h | 16 +- src/devices/bus/c64/fcc.cpp | 6 +- src/devices/bus/c64/fcc.h | 8 +- src/devices/bus/c64/final.cpp | 6 +- src/devices/bus/c64/final.h | 6 +- src/devices/bus/c64/final3.cpp | 6 +- src/devices/bus/c64/final3.h | 8 +- src/devices/bus/c64/fun_play.cpp | 6 +- src/devices/bus/c64/fun_play.h | 8 +- src/devices/bus/c64/geocable.cpp | 2 +- src/devices/bus/c64/geocable.h | 2 +- src/devices/bus/c64/georam.cpp | 6 +- src/devices/bus/c64/georam.h | 10 +- src/devices/bus/c64/ide64.cpp | 10 +- src/devices/bus/c64/ide64.h | 12 +- src/devices/bus/c64/ieee488.cpp | 10 +- src/devices/bus/c64/ieee488.h | 6 +- src/devices/bus/c64/kingsoft.cpp | 6 +- src/devices/bus/c64/kingsoft.h | 6 +- src/devices/bus/c64/mach5.cpp | 6 +- src/devices/bus/c64/mach5.h | 6 +- src/devices/bus/c64/magic_desk.cpp | 6 +- src/devices/bus/c64/magic_desk.h | 8 +- src/devices/bus/c64/magic_formel.cpp | 8 +- src/devices/bus/c64/magic_formel.h | 12 +- src/devices/bus/c64/magic_voice.cpp | 10 +- src/devices/bus/c64/magic_voice.h | 12 +- src/devices/bus/c64/midi_maplin.cpp | 6 +- src/devices/bus/c64/midi_maplin.h | 6 +- src/devices/bus/c64/midi_namesoft.cpp | 6 +- src/devices/bus/c64/midi_namesoft.h | 6 +- src/devices/bus/c64/midi_passport.cpp | 6 +- src/devices/bus/c64/midi_passport.h | 6 +- src/devices/bus/c64/midi_sci.cpp | 6 +- src/devices/bus/c64/midi_sci.h | 6 +- src/devices/bus/c64/midi_siel.cpp | 6 +- src/devices/bus/c64/midi_siel.h | 6 +- src/devices/bus/c64/mikro_assembler.cpp | 4 +- src/devices/bus/c64/mikro_assembler.h | 4 +- src/devices/bus/c64/multiscreen.cpp | 6 +- src/devices/bus/c64/multiscreen.h | 8 +- src/devices/bus/c64/music64.cpp | 6 +- src/devices/bus/c64/music64.h | 6 +- src/devices/bus/c64/neoram.cpp | 6 +- src/devices/bus/c64/neoram.h | 8 +- src/devices/bus/c64/ocean.cpp | 6 +- src/devices/bus/c64/ocean.h | 8 +- src/devices/bus/c64/pagefox.cpp | 6 +- src/devices/bus/c64/pagefox.h | 10 +- src/devices/bus/c64/partner.cpp | 6 +- src/devices/bus/c64/partner.h | 8 +- src/devices/bus/c64/prophet64.cpp | 6 +- src/devices/bus/c64/prophet64.h | 8 +- src/devices/bus/c64/ps64.cpp | 6 +- src/devices/bus/c64/ps64.h | 6 +- src/devices/bus/c64/reu.cpp | 12 +- src/devices/bus/c64/reu.h | 14 +- src/devices/bus/c64/rex.cpp | 4 +- src/devices/bus/c64/rex.h | 4 +- src/devices/bus/c64/rex_ep256.cpp | 6 +- src/devices/bus/c64/rex_ep256.h | 8 +- src/devices/bus/c64/ross.cpp | 6 +- src/devices/bus/c64/ross.h | 8 +- src/devices/bus/c64/sfx_sound_expander.cpp | 6 +- src/devices/bus/c64/sfx_sound_expander.h | 6 +- src/devices/bus/c64/silverrock.cpp | 6 +- src/devices/bus/c64/silverrock.h | 8 +- src/devices/bus/c64/simons_basic.cpp | 6 +- src/devices/bus/c64/simons_basic.h | 6 +- src/devices/bus/c64/stardos.cpp | 6 +- src/devices/bus/c64/stardos.h | 6 +- src/devices/bus/c64/std.cpp | 4 +- src/devices/bus/c64/std.h | 4 +- src/devices/bus/c64/structured_basic.cpp | 6 +- src/devices/bus/c64/structured_basic.h | 8 +- src/devices/bus/c64/super_explode.cpp | 6 +- src/devices/bus/c64/super_explode.h | 8 +- src/devices/bus/c64/super_games.cpp | 6 +- src/devices/bus/c64/super_games.h | 8 +- src/devices/bus/c64/supercpu.cpp | 6 +- src/devices/bus/c64/supercpu.h | 10 +- src/devices/bus/c64/sw8k.cpp | 4 +- src/devices/bus/c64/sw8k.h | 4 +- src/devices/bus/c64/swiftlink.cpp | 6 +- src/devices/bus/c64/swiftlink.h | 6 +- src/devices/bus/c64/system3.cpp | 6 +- src/devices/bus/c64/system3.h | 8 +- src/devices/bus/c64/tdos.cpp | 6 +- src/devices/bus/c64/tdos.h | 6 +- src/devices/bus/c64/turbo232.cpp | 6 +- src/devices/bus/c64/turbo232.h | 8 +- src/devices/bus/c64/vizastar.cpp | 4 +- src/devices/bus/c64/vizastar.h | 4 +- src/devices/bus/c64/vw64.cpp | 4 +- src/devices/bus/c64/vw64.h | 4 +- src/devices/bus/c64/warp_speed.cpp | 6 +- src/devices/bus/c64/warp_speed.h | 6 +- src/devices/bus/c64/westermann.cpp | 4 +- src/devices/bus/c64/westermann.h | 4 +- src/devices/bus/c64/xl80.cpp | 12 +- src/devices/bus/c64/xl80.h | 8 +- src/devices/bus/c64/zaxxon.cpp | 4 +- src/devices/bus/c64/zaxxon.h | 4 +- src/devices/bus/cbm2/24k.cpp | 6 +- src/devices/bus/cbm2/24k.h | 8 +- src/devices/bus/cbm2/exp.cpp | 6 +- src/devices/bus/cbm2/exp.h | 16 +- src/devices/bus/cbm2/hrg.cpp | 10 +- src/devices/bus/cbm2/hrg.h | 10 +- src/devices/bus/cbm2/std.cpp | 4 +- src/devices/bus/cbm2/std.h | 4 +- src/devices/bus/cbm2/user.cpp | 2 +- src/devices/bus/cbm2/user.h | 14 +- src/devices/bus/cbmiec/c1526.cpp | 6 +- src/devices/bus/cbmiec/c1526.h | 6 +- src/devices/bus/cbmiec/c1541.cpp | 36 +- src/devices/bus/cbmiec/c1541.h | 28 +- src/devices/bus/cbmiec/c1571.cpp | 24 +- src/devices/bus/cbmiec/c1571.h | 12 +- src/devices/bus/cbmiec/c1581.cpp | 10 +- src/devices/bus/cbmiec/c1581.h | 6 +- src/devices/bus/cbmiec/c64_nl10.cpp | 2 +- src/devices/bus/cbmiec/c64_nl10.h | 2 +- src/devices/bus/cbmiec/cbmiec.cpp | 4 +- src/devices/bus/cbmiec/cbmiec.h | 4 +- src/devices/bus/cbmiec/cmdhd.cpp | 2 +- src/devices/bus/cbmiec/cmdhd.h | 2 +- src/devices/bus/cbmiec/diag264_lb_iec.cpp | 2 +- src/devices/bus/cbmiec/diag264_lb_iec.h | 2 +- src/devices/bus/cbmiec/fd2000.cpp | 8 +- src/devices/bus/cbmiec/fd2000.h | 6 +- src/devices/bus/cbmiec/interpod.cpp | 2 +- src/devices/bus/cbmiec/interpod.h | 2 +- src/devices/bus/cbmiec/serialbox.cpp | 2 +- src/devices/bus/cbmiec/serialbox.h | 2 +- src/devices/bus/cbmiec/vic1515.cpp | 2 +- src/devices/bus/cbmiec/vic1515.h | 2 +- src/devices/bus/cbmiec/vic1520.cpp | 2 +- src/devices/bus/cbmiec/vic1520.h | 2 +- src/devices/bus/centronics/comxpl80.cpp | 2 +- src/devices/bus/centronics/comxpl80.h | 14 +- src/devices/bus/centronics/covox.cpp | 4 +- src/devices/bus/centronics/covox.h | 8 +- src/devices/bus/centronics/ctronics.cpp | 2 +- src/devices/bus/centronics/ctronics.h | 2 +- src/devices/bus/centronics/digiblst.cpp | 2 +- src/devices/bus/centronics/digiblst.h | 4 +- src/devices/bus/centronics/dsjoy.cpp | 2 +- src/devices/bus/centronics/dsjoy.h | 4 +- src/devices/bus/centronics/epson_ex800.cpp | 2 +- src/devices/bus/centronics/epson_ex800.h | 2 +- src/devices/bus/centronics/epson_lx800.cpp | 8 +- src/devices/bus/centronics/epson_lx800.h | 4 +- src/devices/bus/centronics/epson_lx810l.cpp | 32 +- src/devices/bus/centronics/epson_lx810l.h | 12 +- src/devices/bus/centronics/nec_p72.cpp | 4 +- src/devices/bus/centronics/nec_p72.h | 4 +- src/devices/bus/centronics/printer.cpp | 2 +- src/devices/bus/centronics/printer.h | 4 +- src/devices/bus/cgenie/expansion/expansion.cpp | 2 +- src/devices/bus/cgenie/expansion/expansion.h | 2 +- src/devices/bus/cgenie/expansion/floppy.cpp | 6 +- src/devices/bus/cgenie/expansion/floppy.h | 4 +- src/devices/bus/cgenie/parallel/joystick.cpp | 8 +- src/devices/bus/cgenie/parallel/joystick.h | 8 +- src/devices/bus/cgenie/parallel/parallel.cpp | 2 +- src/devices/bus/cgenie/parallel/parallel.h | 10 +- src/devices/bus/cgenie/parallel/printer.cpp | 10 +- src/devices/bus/cgenie/parallel/printer.h | 8 +- src/devices/bus/chanf/rom.cpp | 24 +- src/devices/bus/chanf/rom.h | 26 +- src/devices/bus/chanf/slot.cpp | 10 +- src/devices/bus/chanf/slot.h | 20 +- src/devices/bus/coco/coco_232.cpp | 4 +- src/devices/bus/coco/coco_232.h | 2 +- src/devices/bus/coco/coco_dwsock.cpp | 4 +- src/devices/bus/coco/coco_dwsock.h | 2 +- src/devices/bus/coco/coco_fdc.cpp | 24 +- src/devices/bus/coco/coco_fdc.h | 10 +- src/devices/bus/coco/coco_multi.cpp | 8 +- src/devices/bus/coco/coco_multi.h | 8 +- src/devices/bus/coco/coco_orch90.cpp | 2 +- src/devices/bus/coco/coco_orch90.h | 2 +- src/devices/bus/coco/coco_pak.cpp | 18 +- src/devices/bus/coco/coco_pak.h | 10 +- src/devices/bus/coco/cococart.cpp | 8 +- src/devices/bus/coco/cococart.h | 8 +- src/devices/bus/coco/dragon_fdc.cpp | 14 +- src/devices/bus/coleco/ctrl.cpp | 2 +- src/devices/bus/coleco/ctrl.h | 6 +- src/devices/bus/coleco/exp.cpp | 6 +- src/devices/bus/coleco/exp.h | 8 +- src/devices/bus/coleco/hand.cpp | 10 +- src/devices/bus/coleco/hand.h | 4 +- src/devices/bus/coleco/sac.cpp | 10 +- src/devices/bus/coleco/sac.h | 4 +- src/devices/bus/coleco/std.cpp | 4 +- src/devices/bus/coleco/std.h | 4 +- src/devices/bus/coleco/xin1.cpp | 4 +- src/devices/bus/coleco/xin1.h | 6 +- src/devices/bus/compis/graphics.cpp | 2 +- src/devices/bus/compis/graphics.h | 22 +- src/devices/bus/compis/hrg.cpp | 16 +- src/devices/bus/compis/hrg.h | 14 +- src/devices/bus/compucolor/floppy.cpp | 8 +- src/devices/bus/compucolor/floppy.h | 12 +- src/devices/bus/comx35/clm.cpp | 14 +- src/devices/bus/comx35/clm.h | 8 +- src/devices/bus/comx35/eprom.cpp | 8 +- src/devices/bus/comx35/eprom.h | 8 +- src/devices/bus/comx35/exp.cpp | 14 +- src/devices/bus/comx35/exp.h | 18 +- src/devices/bus/comx35/expbox.cpp | 14 +- src/devices/bus/comx35/expbox.h | 12 +- src/devices/bus/comx35/fdc.cpp | 12 +- src/devices/bus/comx35/fdc.h | 8 +- src/devices/bus/comx35/joycard.cpp | 6 +- src/devices/bus/comx35/joycard.h | 4 +- src/devices/bus/comx35/printer.cpp | 10 +- src/devices/bus/comx35/printer.h | 8 +- src/devices/bus/comx35/ram.cpp | 10 +- src/devices/bus/comx35/ram.h | 10 +- src/devices/bus/comx35/thermal.cpp | 10 +- src/devices/bus/comx35/thermal.h | 8 +- src/devices/bus/cpc/amdrum.cpp | 2 +- src/devices/bus/cpc/amdrum.h | 2 +- src/devices/bus/cpc/brunword4.cpp | 8 +- src/devices/bus/cpc/brunword4.h | 6 +- src/devices/bus/cpc/cpc_pds.cpp | 2 +- src/devices/bus/cpc/cpc_pds.h | 2 +- src/devices/bus/cpc/cpc_rom.cpp | 8 +- src/devices/bus/cpc/cpc_rom.h | 10 +- src/devices/bus/cpc/cpc_rs232.cpp | 6 +- src/devices/bus/cpc/cpc_rs232.h | 6 +- src/devices/bus/cpc/cpc_ssa1.cpp | 8 +- src/devices/bus/cpc/cpc_ssa1.h | 32 +- src/devices/bus/cpc/cpcexp.cpp | 2 +- src/devices/bus/cpc/cpcexp.h | 14 +- src/devices/bus/cpc/ddi1.cpp | 8 +- src/devices/bus/cpc/ddi1.h | 4 +- src/devices/bus/cpc/doubler.cpp | 4 +- src/devices/bus/cpc/doubler.h | 2 +- src/devices/bus/cpc/hd20.cpp | 4 +- src/devices/bus/cpc/hd20.h | 2 +- src/devices/bus/cpc/magicsound.cpp | 10 +- src/devices/bus/cpc/magicsound.h | 12 +- src/devices/bus/cpc/mface2.cpp | 6 +- src/devices/bus/cpc/mface2.h | 8 +- src/devices/bus/cpc/playcity.cpp | 6 +- src/devices/bus/cpc/playcity.h | 2 +- src/devices/bus/cpc/smartwatch.cpp | 6 +- src/devices/bus/cpc/smartwatch.h | 2 +- src/devices/bus/cpc/symbfac2.cpp | 14 +- src/devices/bus/cpc/symbfac2.h | 20 +- src/devices/bus/cpc/transtape.cpp | 8 +- src/devices/bus/cpc/transtape.h | 8 +- src/devices/bus/crvision/rom.cpp | 16 +- src/devices/bus/crvision/rom.h | 16 +- src/devices/bus/crvision/slot.cpp | 8 +- src/devices/bus/crvision/slot.h | 12 +- src/devices/bus/dmv/dmvbus.cpp | 14 +- src/devices/bus/dmv/dmvbus.h | 26 +- src/devices/bus/dmv/k210.cpp | 6 +- src/devices/bus/dmv/k210.h | 10 +- src/devices/bus/dmv/k220.cpp | 8 +- src/devices/bus/dmv/k220.h | 8 +- src/devices/bus/dmv/k230.cpp | 10 +- src/devices/bus/dmv/k230.h | 10 +- src/devices/bus/dmv/k233.cpp | 8 +- src/devices/bus/dmv/k233.h | 10 +- src/devices/bus/dmv/k801.cpp | 28 +- src/devices/bus/dmv/k801.h | 20 +- src/devices/bus/dmv/k803.cpp | 10 +- src/devices/bus/dmv/k803.h | 8 +- src/devices/bus/dmv/k806.cpp | 12 +- src/devices/bus/dmv/k806.h | 6 +- src/devices/bus/dmv/ram.cpp | 12 +- src/devices/bus/dmv/ram.h | 16 +- src/devices/bus/ecbbus/ecbbus.cpp | 8 +- src/devices/bus/ecbbus/ecbbus.h | 12 +- src/devices/bus/ecbbus/grip.cpp | 22 +- src/devices/bus/ecbbus/grip.h | 16 +- src/devices/bus/econet/e01.cpp | 10 +- src/devices/bus/econet/e01.h | 6 +- src/devices/bus/econet/econet.cpp | 4 +- src/devices/bus/econet/econet.h | 8 +- src/devices/bus/electron/exp.cpp | 2 +- src/devices/bus/electron/exp.h | 2 +- src/devices/bus/electron/m2105.cpp | 2 +- src/devices/bus/electron/m2105.h | 2 +- src/devices/bus/electron/plus3.cpp | 2 +- src/devices/bus/electron/plus3.h | 2 +- src/devices/bus/ep64/exdos.cpp | 4 +- src/devices/bus/ep64/exdos.h | 2 +- src/devices/bus/ep64/exp.cpp | 2 +- src/devices/bus/ep64/exp.h | 2 +- src/devices/bus/epson_sio/epson_sio.cpp | 2 +- src/devices/bus/epson_sio/epson_sio.h | 2 +- src/devices/bus/epson_sio/pf10.cpp | 2 +- src/devices/bus/epson_sio/pf10.h | 6 +- src/devices/bus/epson_sio/tf20.cpp | 2 +- src/devices/bus/epson_sio/tf20.h | 2 +- src/devices/bus/gameboy/gb_slot.cpp | 40 +- src/devices/bus/gameboy/gb_slot.h | 46 +- src/devices/bus/gameboy/mbc.cpp | 64 +- src/devices/bus/gameboy/mbc.h | 90 +- src/devices/bus/gameboy/rom.cpp | 18 +- src/devices/bus/gameboy/rom.h | 24 +- src/devices/bus/gamegear/ggext.cpp | 10 +- src/devices/bus/gamegear/ggext.h | 12 +- src/devices/bus/gamegear/smsctrladp.cpp | 6 +- src/devices/bus/gamegear/smsctrladp.h | 6 +- src/devices/bus/gba/gba_slot.cpp | 36 +- src/devices/bus/gba/gba_slot.h | 38 +- src/devices/bus/gba/rom.cpp | 80 +- src/devices/bus/gba/rom.h | 100 +- src/devices/bus/generic/ram.cpp | 16 +- src/devices/bus/generic/ram.h | 20 +- src/devices/bus/generic/rom.cpp | 18 +- src/devices/bus/generic/rom.h | 10 +- src/devices/bus/generic/slot.cpp | 10 +- src/devices/bus/generic/slot.h | 34 +- src/devices/bus/hp9845_io/98035.cpp | 32 +- src/devices/bus/hp9845_io/98035.h | 44 +- src/devices/bus/hp9845_io/hp9845_io.cpp | 4 +- src/devices/bus/hp9845_io/hp9845_io.h | 6 +- src/devices/bus/hp_optroms/hp_optrom.cpp | 8 +- src/devices/bus/hp_optroms/hp_optrom.h | 8 +- src/devices/bus/ieee488/c2031.cpp | 6 +- src/devices/bus/ieee488/c2031.h | 2 +- src/devices/bus/ieee488/c2040.cpp | 12 +- src/devices/bus/ieee488/c2040.h | 8 +- src/devices/bus/ieee488/c2040fdc.cpp | 6 +- src/devices/bus/ieee488/c2040fdc.h | 12 +- src/devices/bus/ieee488/c8050.cpp | 14 +- src/devices/bus/ieee488/c8050.h | 10 +- src/devices/bus/ieee488/c8050fdc.cpp | 4 +- src/devices/bus/ieee488/c8050fdc.h | 12 +- src/devices/bus/ieee488/c8280.cpp | 8 +- src/devices/bus/ieee488/c8280.h | 4 +- src/devices/bus/ieee488/d9060.cpp | 10 +- src/devices/bus/ieee488/d9060.h | 8 +- src/devices/bus/ieee488/hardbox.cpp | 10 +- src/devices/bus/ieee488/hardbox.h | 2 +- src/devices/bus/ieee488/ieee488.cpp | 10 +- src/devices/bus/ieee488/ieee488.h | 18 +- src/devices/bus/ieee488/shark.cpp | 2 +- src/devices/bus/ieee488/shark.h | 2 +- src/devices/bus/ieee488/softbox.cpp | 8 +- src/devices/bus/ieee488/softbox.h | 2 +- src/devices/bus/imi7000/imi5000h.cpp | 2 +- src/devices/bus/imi7000/imi5000h.h | 2 +- src/devices/bus/imi7000/imi7000.cpp | 4 +- src/devices/bus/imi7000/imi7000.h | 4 +- src/devices/bus/intv/ecs.cpp | 2 +- src/devices/bus/intv/ecs.h | 2 +- src/devices/bus/intv/rom.cpp | 10 +- src/devices/bus/intv/rom.h | 10 +- src/devices/bus/intv/slot.cpp | 40 +- src/devices/bus/intv/slot.h | 22 +- src/devices/bus/intv/voice.cpp | 2 +- src/devices/bus/intv/voice.h | 2 +- src/devices/bus/intv_ctrl/ctrl.cpp | 6 +- src/devices/bus/intv_ctrl/ctrl.h | 6 +- src/devices/bus/intv_ctrl/ecs_ctrl.cpp | 34 +- src/devices/bus/intv_ctrl/ecs_ctrl.h | 36 +- src/devices/bus/intv_ctrl/handctrl.cpp | 12 +- src/devices/bus/intv_ctrl/handctrl.h | 4 +- src/devices/bus/iq151/disc2.cpp | 10 +- src/devices/bus/iq151/disc2.h | 10 +- src/devices/bus/iq151/grafik.cpp | 6 +- src/devices/bus/iq151/grafik.h | 24 +- src/devices/bus/iq151/iq151.cpp | 12 +- src/devices/bus/iq151/iq151.h | 20 +- src/devices/bus/iq151/minigraf.cpp | 20 +- src/devices/bus/iq151/minigraf.h | 20 +- src/devices/bus/iq151/ms151a.cpp | 14 +- src/devices/bus/iq151/ms151a.h | 20 +- src/devices/bus/iq151/rom.cpp | 32 +- src/devices/bus/iq151/rom.h | 32 +- src/devices/bus/iq151/staper.cpp | 6 +- src/devices/bus/iq151/staper.h | 8 +- src/devices/bus/iq151/video32.cpp | 18 +- src/devices/bus/iq151/video32.h | 10 +- src/devices/bus/iq151/video64.cpp | 20 +- src/devices/bus/iq151/video64.h | 12 +- src/devices/bus/isa/3c503.cpp | 12 +- src/devices/bus/isa/3c503.h | 44 +- src/devices/bus/isa/3c505.cpp | 70 +- src/devices/bus/isa/3c505.h | 116 +- src/devices/bus/isa/adlib.cpp | 4 +- src/devices/bus/isa/adlib.h | 2 +- src/devices/bus/isa/aga.cpp | 152 +- src/devices/bus/isa/aga.h | 34 +- src/devices/bus/isa/aha1542.cpp | 2 +- src/devices/bus/isa/aha1542.h | 2 +- src/devices/bus/isa/cga.cpp | 226 +- src/devices/bus/isa/cga.h | 76 +- src/devices/bus/isa/com.cpp | 6 +- src/devices/bus/isa/com.h | 6 +- src/devices/bus/isa/dectalk.cpp | 2 +- src/devices/bus/isa/dectalk.h | 6 +- src/devices/bus/isa/ega.cpp | 76 +- src/devices/bus/isa/ega.h | 44 +- src/devices/bus/isa/fdc.cpp | 16 +- src/devices/bus/isa/fdc.h | 16 +- src/devices/bus/isa/finalchs.cpp | 2 +- src/devices/bus/isa/finalchs.h | 4 +- src/devices/bus/isa/gblaster.cpp | 2 +- src/devices/bus/isa/gblaster.h | 4 +- src/devices/bus/isa/gus.cpp | 52 +- src/devices/bus/isa/gus.h | 152 +- src/devices/bus/isa/hdc.cpp | 32 +- src/devices/bus/isa/hdc.h | 40 +- src/devices/bus/isa/ibm_mfc.cpp | 4 +- src/devices/bus/isa/ibm_mfc.h | 12 +- src/devices/bus/isa/ide.cpp | 2 +- src/devices/bus/isa/ide.h | 2 +- src/devices/bus/isa/isa.cpp | 40 +- src/devices/bus/isa/isa.h | 34 +- src/devices/bus/isa/lpt.cpp | 2 +- src/devices/bus/isa/lpt.h | 2 +- src/devices/bus/isa/mach32.cpp | 16 +- src/devices/bus/isa/mach32.h | 20 +- src/devices/bus/isa/mc1502_fdc.cpp | 16 +- src/devices/bus/isa/mc1502_fdc.h | 10 +- src/devices/bus/isa/mc1502_rom.cpp | 2 +- src/devices/bus/isa/mc1502_rom.h | 2 +- src/devices/bus/isa/mcd.cpp | 18 +- src/devices/bus/isa/mcd.h | 26 +- src/devices/bus/isa/mda.cpp | 80 +- src/devices/bus/isa/mda.h | 24 +- src/devices/bus/isa/mpu401.cpp | 2 +- src/devices/bus/isa/mpu401.h | 2 +- src/devices/bus/isa/mufdc.cpp | 10 +- src/devices/bus/isa/mufdc.h | 10 +- src/devices/bus/isa/ne1000.cpp | 4 +- src/devices/bus/isa/ne1000.h | 8 +- src/devices/bus/isa/ne2000.cpp | 4 +- src/devices/bus/isa/ne2000.h | 8 +- src/devices/bus/isa/num9rev.cpp | 18 +- src/devices/bus/isa/num9rev.h | 12 +- src/devices/bus/isa/omti8621.cpp | 122 +- src/devices/bus/isa/omti8621.h | 74 +- src/devices/bus/isa/p1_fdc.cpp | 8 +- src/devices/bus/isa/p1_fdc.h | 6 +- src/devices/bus/isa/p1_hdc.cpp | 4 +- src/devices/bus/isa/p1_hdc.h | 4 +- src/devices/bus/isa/p1_rom.cpp | 2 +- src/devices/bus/isa/p1_rom.h | 2 +- src/devices/bus/isa/p1_sound.cpp | 2 +- src/devices/bus/isa/p1_sound.h | 4 +- src/devices/bus/isa/pc1640_iga.cpp | 16 +- src/devices/bus/isa/pc1640_iga.h | 2 +- src/devices/bus/isa/pds.cpp | 2 +- src/devices/bus/isa/pds.h | 2 +- src/devices/bus/isa/pgc.cpp | 20 +- src/devices/bus/isa/pgc.h | 16 +- src/devices/bus/isa/s3virge.cpp | 24 +- src/devices/bus/isa/s3virge.h | 14 +- src/devices/bus/isa/sb16.cpp | 26 +- src/devices/bus/isa/sb16.h | 24 +- src/devices/bus/isa/sblaster.cpp | 64 +- src/devices/bus/isa/sblaster.h | 140 +- src/devices/bus/isa/sc499.cpp | 50 +- src/devices/bus/isa/sc499.h | 74 +- src/devices/bus/isa/side116.cpp | 10 +- src/devices/bus/isa/side116.h | 4 +- src/devices/bus/isa/ssi2001.cpp | 2 +- src/devices/bus/isa/ssi2001.h | 2 +- src/devices/bus/isa/stereo_fx.cpp | 8 +- src/devices/bus/isa/stereo_fx.h | 18 +- src/devices/bus/isa/svga_cirrus.cpp | 4 +- src/devices/bus/isa/svga_cirrus.h | 4 +- src/devices/bus/isa/svga_s3.cpp | 8 +- src/devices/bus/isa/svga_s3.h | 8 +- src/devices/bus/isa/svga_trident.cpp | 2 +- src/devices/bus/isa/svga_trident.h | 2 +- src/devices/bus/isa/svga_tseng.cpp | 2 +- src/devices/bus/isa/svga_tseng.h | 2 +- src/devices/bus/isa/trident.cpp | 102 +- src/devices/bus/isa/trident.h | 172 +- src/devices/bus/isa/vga.cpp | 2 +- src/devices/bus/isa/vga.h | 2 +- src/devices/bus/isa/vga_ati.cpp | 6 +- src/devices/bus/isa/vga_ati.h | 6 +- src/devices/bus/isa/wd1002a_wx1.cpp | 2 +- src/devices/bus/isa/wd1002a_wx1.h | 2 +- src/devices/bus/isa/wdxt_gen.cpp | 10 +- src/devices/bus/isa/wdxt_gen.h | 10 +- src/devices/bus/isa/xtide.cpp | 8 +- src/devices/bus/isa/xtide.h | 6 +- src/devices/bus/isbx/compis_fdc.cpp | 12 +- src/devices/bus/isbx/compis_fdc.h | 10 +- src/devices/bus/isbx/isbc_218a.cpp | 18 +- src/devices/bus/isbx/isbc_218a.h | 14 +- src/devices/bus/isbx/isbx.cpp | 2 +- src/devices/bus/isbx/isbx.h | 14 +- src/devices/bus/kc/d002.cpp | 14 +- src/devices/bus/kc/d002.h | 10 +- src/devices/bus/kc/d004.cpp | 30 +- src/devices/bus/kc/d004.h | 30 +- src/devices/bus/kc/kc.cpp | 22 +- src/devices/bus/kc/kc.h | 32 +- src/devices/bus/kc/ram.cpp | 52 +- src/devices/bus/kc/ram.h | 82 +- src/devices/bus/kc/rom.cpp | 22 +- src/devices/bus/kc/rom.h | 36 +- src/devices/bus/lpci/cirrus.cpp | 8 +- src/devices/bus/lpci/cirrus.h | 6 +- src/devices/bus/lpci/i82371ab.cpp | 40 +- src/devices/bus/lpci/i82371ab.h | 24 +- src/devices/bus/lpci/i82371sb.cpp | 24 +- src/devices/bus/lpci/i82371sb.h | 20 +- src/devices/bus/lpci/i82439tx.cpp | 10 +- src/devices/bus/lpci/i82439tx.h | 14 +- src/devices/bus/lpci/mpc105.cpp | 12 +- src/devices/bus/lpci/mpc105.h | 10 +- src/devices/bus/lpci/northbridge.cpp | 2 +- src/devices/bus/lpci/northbridge.h | 2 +- src/devices/bus/lpci/pci.cpp | 12 +- src/devices/bus/lpci/pci.h | 16 +- src/devices/bus/lpci/southbridge.cpp | 20 +- src/devices/bus/lpci/southbridge.h | 20 +- src/devices/bus/lpci/vt82c505.cpp | 8 +- src/devices/bus/lpci/vt82c505.h | 10 +- src/devices/bus/m5/rom.cpp | 6 +- src/devices/bus/m5/rom.h | 6 +- src/devices/bus/m5/slot.cpp | 10 +- src/devices/bus/m5/slot.h | 20 +- src/devices/bus/macpds/macpds.cpp | 22 +- src/devices/bus/macpds/macpds.h | 18 +- src/devices/bus/macpds/pds_tpdfpd.cpp | 12 +- src/devices/bus/macpds/pds_tpdfpd.h | 12 +- src/devices/bus/megadrive/eeprom.cpp | 30 +- src/devices/bus/megadrive/eeprom.h | 48 +- src/devices/bus/megadrive/ggenie.cpp | 2 +- src/devices/bus/megadrive/ggenie.h | 8 +- src/devices/bus/megadrive/jcart.cpp | 14 +- src/devices/bus/megadrive/jcart.h | 16 +- src/devices/bus/megadrive/md_slot.cpp | 50 +- src/devices/bus/megadrive/md_slot.h | 34 +- src/devices/bus/megadrive/rom.cpp | 80 +- src/devices/bus/megadrive/rom.h | 108 +- src/devices/bus/megadrive/sk.cpp | 4 +- src/devices/bus/megadrive/sk.h | 4 +- src/devices/bus/megadrive/stm95.cpp | 12 +- src/devices/bus/megadrive/stm95.h | 10 +- src/devices/bus/megadrive/svp.cpp | 64 +- src/devices/bus/megadrive/svp.h | 22 +- src/devices/bus/midi/midi.cpp | 2 +- src/devices/bus/midi/midi.h | 2 +- src/devices/bus/midi/midiinport.cpp | 2 +- src/devices/bus/midi/midiinport.h | 2 +- src/devices/bus/midi/midioutport.cpp | 2 +- src/devices/bus/midi/midioutport.h | 2 +- src/devices/bus/msx_cart/arc.cpp | 2 +- src/devices/bus/msx_cart/arc.h | 4 +- src/devices/bus/msx_cart/ascii.cpp | 44 +- src/devices/bus/msx_cart/ascii.h | 48 +- src/devices/bus/msx_cart/bm_012.cpp | 2 +- src/devices/bus/msx_cart/bm_012.h | 2 +- src/devices/bus/msx_cart/cartridge.cpp | 8 +- src/devices/bus/msx_cart/cartridge.h | 34 +- src/devices/bus/msx_cart/crossblaim.cpp | 4 +- src/devices/bus/msx_cart/crossblaim.h | 6 +- src/devices/bus/msx_cart/disk.cpp | 32 +- src/devices/bus/msx_cart/disk.h | 30 +- src/devices/bus/msx_cart/dooly.cpp | 4 +- src/devices/bus/msx_cart/dooly.h | 4 +- src/devices/bus/msx_cart/fmpac.cpp | 2 +- src/devices/bus/msx_cart/fmpac.h | 12 +- src/devices/bus/msx_cart/fs_sr022.cpp | 2 +- src/devices/bus/msx_cart/fs_sr022.h | 6 +- src/devices/bus/msx_cart/halnote.cpp | 4 +- src/devices/bus/msx_cart/halnote.h | 6 +- src/devices/bus/msx_cart/hfox.cpp | 2 +- src/devices/bus/msx_cart/hfox.h | 6 +- src/devices/bus/msx_cart/holy_quran.cpp | 4 +- src/devices/bus/msx_cart/holy_quran.h | 8 +- src/devices/bus/msx_cart/konami.cpp | 32 +- src/devices/bus/msx_cart/konami.h | 46 +- src/devices/bus/msx_cart/korean.cpp | 28 +- src/devices/bus/msx_cart/korean.h | 28 +- src/devices/bus/msx_cart/majutsushi.cpp | 2 +- src/devices/bus/msx_cart/majutsushi.h | 6 +- src/devices/bus/msx_cart/moonsound.cpp | 2 +- src/devices/bus/msx_cart/moonsound.h | 2 +- src/devices/bus/msx_cart/msx_audio.cpp | 6 +- src/devices/bus/msx_cart/msx_audio.h | 10 +- src/devices/bus/msx_cart/msx_audio_kb.cpp | 14 +- src/devices/bus/msx_cart/msx_audio_kb.h | 2 +- src/devices/bus/msx_cart/msxdos2.cpp | 2 +- src/devices/bus/msx_cart/msxdos2.h | 6 +- src/devices/bus/msx_cart/nomapper.cpp | 12 +- src/devices/bus/msx_cart/nomapper.h | 6 +- src/devices/bus/msx_cart/rtype.cpp | 2 +- src/devices/bus/msx_cart/rtype.h | 6 +- src/devices/bus/msx_cart/super_swangi.cpp | 2 +- src/devices/bus/msx_cart/super_swangi.h | 6 +- src/devices/bus/msx_cart/superloderunner.cpp | 2 +- src/devices/bus/msx_cart/superloderunner.h | 6 +- src/devices/bus/msx_cart/yamaha.cpp | 6 +- src/devices/bus/msx_cart/yamaha.h | 8 +- src/devices/bus/msx_slot/bunsetsu.cpp | 2 +- src/devices/bus/msx_slot/bunsetsu.h | 6 +- src/devices/bus/msx_slot/cartridge.cpp | 22 +- src/devices/bus/msx_slot/cartridge.h | 8 +- src/devices/bus/msx_slot/disk.cpp | 34 +- src/devices/bus/msx_slot/disk.h | 40 +- src/devices/bus/msx_slot/fs4600.cpp | 4 +- src/devices/bus/msx_slot/fs4600.h | 18 +- src/devices/bus/msx_slot/music.cpp | 2 +- src/devices/bus/msx_slot/music.h | 2 +- src/devices/bus/msx_slot/panasonic08.cpp | 6 +- src/devices/bus/msx_slot/panasonic08.h | 16 +- src/devices/bus/msx_slot/ram.cpp | 2 +- src/devices/bus/msx_slot/ram.h | 6 +- src/devices/bus/msx_slot/ram_mm.cpp | 2 +- src/devices/bus/msx_slot/ram_mm.h | 18 +- src/devices/bus/msx_slot/rom.cpp | 6 +- src/devices/bus/msx_slot/rom.h | 10 +- src/devices/bus/msx_slot/slot.cpp | 4 +- src/devices/bus/msx_slot/slot.h | 10 +- src/devices/bus/msx_slot/sony08.cpp | 6 +- src/devices/bus/msx_slot/sony08.h | 14 +- src/devices/bus/nasbus/avc.cpp | 2 +- src/devices/bus/nasbus/avc.h | 10 +- src/devices/bus/nasbus/floppy.cpp | 4 +- src/devices/bus/nasbus/floppy.h | 4 +- src/devices/bus/nasbus/nasbus.cpp | 6 +- src/devices/bus/nasbus/nasbus.h | 6 +- src/devices/bus/neogeo/boot_cthd.cpp | 10 +- src/devices/bus/neogeo/boot_cthd.h | 12 +- src/devices/bus/neogeo/boot_kof10th.cpp | 12 +- src/devices/bus/neogeo/boot_kof10th.h | 16 +- src/devices/bus/neogeo/boot_kof2k2.cpp | 6 +- src/devices/bus/neogeo/boot_kof2k2.h | 6 +- src/devices/bus/neogeo/boot_kof2k3.cpp | 6 +- src/devices/bus/neogeo/boot_kof2k3.h | 12 +- src/devices/bus/neogeo/boot_misc.cpp | 24 +- src/devices/bus/neogeo/boot_misc.h | 26 +- src/devices/bus/neogeo/boot_svc.cpp | 8 +- src/devices/bus/neogeo/boot_svc.h | 12 +- src/devices/bus/neogeo/cmc.cpp | 28 +- src/devices/bus/neogeo/cmc.h | 30 +- src/devices/bus/neogeo/fatfury2.cpp | 2 +- src/devices/bus/neogeo/fatfury2.h | 2 +- src/devices/bus/neogeo/kof2k2.cpp | 14 +- src/devices/bus/neogeo/kof2k2.h | 14 +- src/devices/bus/neogeo/kof98.cpp | 2 +- src/devices/bus/neogeo/kof98.h | 2 +- src/devices/bus/neogeo/mslugx.cpp | 2 +- src/devices/bus/neogeo/mslugx.h | 2 +- src/devices/bus/neogeo/pcm2.cpp | 12 +- src/devices/bus/neogeo/pcm2.h | 12 +- src/devices/bus/neogeo/prot_cmc.cpp | 90 +- src/devices/bus/neogeo/prot_cmc.h | 48 +- src/devices/bus/neogeo/prot_cthd.cpp | 52 +- src/devices/bus/neogeo/prot_cthd.h | 24 +- src/devices/bus/neogeo/prot_fatfury2.cpp | 4 +- src/devices/bus/neogeo/prot_fatfury2.h | 4 +- src/devices/bus/neogeo/prot_kof2k2.cpp | 26 +- src/devices/bus/neogeo/prot_kof2k2.h | 10 +- src/devices/bus/neogeo/prot_kof2k3bl.cpp | 38 +- src/devices/bus/neogeo/prot_kof2k3bl.h | 16 +- src/devices/bus/neogeo/prot_kof98.cpp | 14 +- src/devices/bus/neogeo/prot_kof98.h | 6 +- src/devices/bus/neogeo/prot_misc.cpp | 156 +- src/devices/bus/neogeo/prot_misc.h | 52 +- src/devices/bus/neogeo/prot_mslugx.cpp | 6 +- src/devices/bus/neogeo/prot_mslugx.h | 6 +- src/devices/bus/neogeo/prot_pcm2.cpp | 18 +- src/devices/bus/neogeo/prot_pcm2.h | 6 +- src/devices/bus/neogeo/prot_pvc.cpp | 70 +- src/devices/bus/neogeo/prot_pvc.h | 16 +- src/devices/bus/neogeo/prot_sma.cpp | 62 +- src/devices/bus/neogeo/prot_sma.h | 24 +- src/devices/bus/neogeo/pvc.cpp | 12 +- src/devices/bus/neogeo/pvc.h | 14 +- src/devices/bus/neogeo/rom.cpp | 8 +- src/devices/bus/neogeo/rom.h | 8 +- src/devices/bus/neogeo/sbp.cpp | 12 +- src/devices/bus/neogeo/sbp.h | 4 +- src/devices/bus/neogeo/slot.cpp | 26 +- src/devices/bus/neogeo/slot.h | 154 +- src/devices/bus/neogeo/sma.cpp | 14 +- src/devices/bus/neogeo/sma.h | 26 +- src/devices/bus/neogeo_ctrl/ctrl.cpp | 24 +- src/devices/bus/neogeo_ctrl/ctrl.h | 24 +- src/devices/bus/neogeo_ctrl/dial.cpp | 8 +- src/devices/bus/neogeo_ctrl/dial.h | 6 +- src/devices/bus/neogeo_ctrl/irrmaze.cpp | 6 +- src/devices/bus/neogeo_ctrl/irrmaze.h | 6 +- src/devices/bus/neogeo_ctrl/joystick.cpp | 8 +- src/devices/bus/neogeo_ctrl/joystick.h | 8 +- src/devices/bus/neogeo_ctrl/kizuna4p.cpp | 10 +- src/devices/bus/neogeo_ctrl/kizuna4p.h | 8 +- src/devices/bus/neogeo_ctrl/mahjong.cpp | 14 +- src/devices/bus/neogeo_ctrl/mahjong.h | 14 +- src/devices/bus/nes/2a03pur.cpp | 2 +- src/devices/bus/nes/2a03pur.h | 4 +- src/devices/bus/nes/act53.cpp | 10 +- src/devices/bus/nes/act53.h | 6 +- src/devices/bus/nes/aladdin.cpp | 34 +- src/devices/bus/nes/aladdin.h | 32 +- src/devices/bus/nes/ave.cpp | 6 +- src/devices/bus/nes/ave.h | 8 +- src/devices/bus/nes/bandai.cpp | 20 +- src/devices/bus/nes/bandai.h | 26 +- src/devices/bus/nes/benshieng.cpp | 4 +- src/devices/bus/nes/benshieng.h | 8 +- src/devices/bus/nes/bootleg.cpp | 50 +- src/devices/bus/nes/bootleg.h | 88 +- src/devices/bus/nes/camerica.cpp | 6 +- src/devices/bus/nes/camerica.h | 10 +- src/devices/bus/nes/cne.cpp | 6 +- src/devices/bus/nes/cne.h | 6 +- src/devices/bus/nes/cony.cpp | 6 +- src/devices/bus/nes/cony.h | 18 +- src/devices/bus/nes/datach.cpp | 22 +- src/devices/bus/nes/datach.h | 28 +- src/devices/bus/nes/discrete.cpp | 8 +- src/devices/bus/nes/discrete.h | 8 +- src/devices/bus/nes/disksys.cpp | 8 +- src/devices/bus/nes/disksys.h | 24 +- src/devices/bus/nes/event.cpp | 4 +- src/devices/bus/nes/event.h | 4 +- src/devices/bus/nes/ggenie.cpp | 6 +- src/devices/bus/nes/ggenie.h | 10 +- src/devices/bus/nes/henggedianzi.cpp | 12 +- src/devices/bus/nes/henggedianzi.h | 14 +- src/devices/bus/nes/hes.cpp | 2 +- src/devices/bus/nes/hes.h | 2 +- src/devices/bus/nes/hosenkan.cpp | 2 +- src/devices/bus/nes/hosenkan.h | 8 +- src/devices/bus/nes/irem.cpp | 10 +- src/devices/bus/nes/irem.h | 14 +- src/devices/bus/nes/jaleco.cpp | 36 +- src/devices/bus/nes/jaleco.h | 46 +- src/devices/bus/nes/jy.cpp | 22 +- src/devices/bus/nes/jy.h | 42 +- src/devices/bus/nes/kaiser.cpp | 24 +- src/devices/bus/nes/kaiser.h | 44 +- src/devices/bus/nes/karastudio.cpp | 12 +- src/devices/bus/nes/karastudio.h | 18 +- src/devices/bus/nes/konami.cpp | 28 +- src/devices/bus/nes/konami.h | 28 +- src/devices/bus/nes/legacy.cpp | 8 +- src/devices/bus/nes/legacy.h | 14 +- src/devices/bus/nes/mmc1.cpp | 30 +- src/devices/bus/nes/mmc1.h | 12 +- src/devices/bus/nes/mmc2.cpp | 6 +- src/devices/bus/nes/mmc2.h | 8 +- src/devices/bus/nes/mmc3.cpp | 34 +- src/devices/bus/nes/mmc3.h | 30 +- src/devices/bus/nes/mmc3_clones.cpp | 124 +- src/devices/bus/nes/mmc3_clones.h | 130 +- src/devices/bus/nes/mmc5.cpp | 14 +- src/devices/bus/nes/mmc5.h | 42 +- src/devices/bus/nes/multigame.cpp | 124 +- src/devices/bus/nes/multigame.h | 140 +- src/devices/bus/nes/namcot.cpp | 20 +- src/devices/bus/nes/namcot.h | 34 +- src/devices/bus/nes/nanjing.cpp | 6 +- src/devices/bus/nes/nanjing.h | 8 +- src/devices/bus/nes/nes_ines.hxx | 16 +- src/devices/bus/nes/nes_pcb.hxx | 12 +- src/devices/bus/nes/nes_slot.cpp | 32 +- src/devices/bus/nes/nes_slot.h | 82 +- src/devices/bus/nes/nes_unif.hxx | 24 +- src/devices/bus/nes/ntdec.cpp | 4 +- src/devices/bus/nes/ntdec.h | 6 +- src/devices/bus/nes/nxrom.cpp | 28 +- src/devices/bus/nes/nxrom.h | 30 +- src/devices/bus/nes/pirate.cpp | 42 +- src/devices/bus/nes/pirate.h | 84 +- src/devices/bus/nes/pt554.cpp | 2 +- src/devices/bus/nes/pt554.h | 2 +- src/devices/bus/nes/racermate.cpp | 2 +- src/devices/bus/nes/racermate.h | 4 +- src/devices/bus/nes/rcm.cpp | 10 +- src/devices/bus/nes/rcm.h | 14 +- src/devices/bus/nes/rexsoft.cpp | 18 +- src/devices/bus/nes/rexsoft.h | 12 +- src/devices/bus/nes/sachen.cpp | 46 +- src/devices/bus/nes/sachen.h | 40 +- src/devices/bus/nes/somari.cpp | 12 +- src/devices/bus/nes/somari.h | 18 +- src/devices/bus/nes/sunsoft.cpp | 22 +- src/devices/bus/nes/sunsoft.h | 24 +- src/devices/bus/nes/sunsoft_dcs.cpp | 12 +- src/devices/bus/nes/sunsoft_dcs.h | 12 +- src/devices/bus/nes/taito.cpp | 10 +- src/devices/bus/nes/taito.h | 24 +- src/devices/bus/nes/tengen.cpp | 14 +- src/devices/bus/nes/tengen.h | 18 +- src/devices/bus/nes/txc.cpp | 12 +- src/devices/bus/nes/txc.h | 14 +- src/devices/bus/nes/waixing.cpp | 76 +- src/devices/bus/nes/waixing.h | 68 +- src/devices/bus/nes_ctrl/4score.cpp | 14 +- src/devices/bus/nes_ctrl/4score.h | 14 +- src/devices/bus/nes_ctrl/arkpaddle.cpp | 18 +- src/devices/bus/nes_ctrl/arkpaddle.h | 18 +- src/devices/bus/nes_ctrl/bcbattle.cpp | 6 +- src/devices/bus/nes_ctrl/bcbattle.h | 6 +- src/devices/bus/nes_ctrl/ctrl.cpp | 16 +- src/devices/bus/nes_ctrl/ctrl.h | 18 +- src/devices/bus/nes_ctrl/fckeybrd.cpp | 10 +- src/devices/bus/nes_ctrl/fckeybrd.h | 8 +- src/devices/bus/nes_ctrl/ftrainer.cpp | 8 +- src/devices/bus/nes_ctrl/ftrainer.h | 8 +- src/devices/bus/nes_ctrl/hori.cpp | 16 +- src/devices/bus/nes_ctrl/hori.h | 12 +- src/devices/bus/nes_ctrl/joypad.cpp | 30 +- src/devices/bus/nes_ctrl/joypad.h | 28 +- src/devices/bus/nes_ctrl/konamihs.cpp | 8 +- src/devices/bus/nes_ctrl/konamihs.h | 8 +- src/devices/bus/nes_ctrl/miracle.cpp | 14 +- src/devices/bus/nes_ctrl/miracle.h | 14 +- src/devices/bus/nes_ctrl/mjpanel.cpp | 8 +- src/devices/bus/nes_ctrl/mjpanel.h | 8 +- src/devices/bus/nes_ctrl/pachinko.cpp | 8 +- src/devices/bus/nes_ctrl/pachinko.h | 8 +- src/devices/bus/nes_ctrl/partytap.cpp | 8 +- src/devices/bus/nes_ctrl/partytap.h | 10 +- src/devices/bus/nes_ctrl/powerpad.cpp | 8 +- src/devices/bus/nes_ctrl/powerpad.h | 8 +- src/devices/bus/nes_ctrl/suborkey.cpp | 10 +- src/devices/bus/nes_ctrl/suborkey.h | 8 +- src/devices/bus/nes_ctrl/zapper.cpp | 10 +- src/devices/bus/nes_ctrl/zapper.h | 6 +- src/devices/bus/newbrain/eim.cpp | 10 +- src/devices/bus/newbrain/eim.h | 12 +- src/devices/bus/newbrain/exp.cpp | 10 +- src/devices/bus/newbrain/exp.h | 18 +- src/devices/bus/newbrain/fdc.cpp | 10 +- src/devices/bus/newbrain/fdc.h | 10 +- src/devices/bus/nubus/nubus.cpp | 48 +- src/devices/bus/nubus/nubus.h | 28 +- src/devices/bus/nubus/nubus_48gc.cpp | 18 +- src/devices/bus/nubus/nubus_48gc.h | 16 +- src/devices/bus/nubus/nubus_asntmc3b.cpp | 12 +- src/devices/bus/nubus/nubus_asntmc3b.h | 10 +- src/devices/bus/nubus/nubus_cb264.cpp | 14 +- src/devices/bus/nubus/nubus_cb264.h | 12 +- src/devices/bus/nubus/nubus_image.cpp | 44 +- src/devices/bus/nubus/nubus_image.h | 14 +- src/devices/bus/nubus/nubus_m2hires.cpp | 14 +- src/devices/bus/nubus/nubus_m2hires.h | 14 +- src/devices/bus/nubus/nubus_m2video.cpp | 14 +- src/devices/bus/nubus/nubus_m2video.h | 14 +- src/devices/bus/nubus/nubus_radiustpd.cpp | 14 +- src/devices/bus/nubus/nubus_radiustpd.h | 14 +- src/devices/bus/nubus/nubus_spec8.cpp | 14 +- src/devices/bus/nubus/nubus_spec8.h | 20 +- src/devices/bus/nubus/nubus_specpdq.cpp | 20 +- src/devices/bus/nubus/nubus_specpdq.h | 20 +- src/devices/bus/nubus/nubus_vikbw.cpp | 12 +- src/devices/bus/nubus/nubus_vikbw.h | 10 +- src/devices/bus/nubus/nubus_wsportrait.cpp | 14 +- src/devices/bus/nubus/nubus_wsportrait.h | 14 +- src/devices/bus/nubus/pds30_30hr.cpp | 14 +- src/devices/bus/nubus/pds30_30hr.h | 14 +- src/devices/bus/nubus/pds30_cb264.cpp | 18 +- src/devices/bus/nubus/pds30_cb264.h | 14 +- src/devices/bus/nubus/pds30_mc30.cpp | 18 +- src/devices/bus/nubus/pds30_mc30.h | 14 +- src/devices/bus/nubus/pds30_procolor816.cpp | 18 +- src/devices/bus/nubus/pds30_procolor816.h | 14 +- src/devices/bus/nubus/pds30_sigmalview.cpp | 16 +- src/devices/bus/nubus/pds30_sigmalview.h | 14 +- src/devices/bus/odyssey2/chess.cpp | 2 +- src/devices/bus/odyssey2/chess.h | 2 +- src/devices/bus/odyssey2/rom.cpp | 8 +- src/devices/bus/odyssey2/rom.h | 8 +- src/devices/bus/odyssey2/slot.cpp | 10 +- src/devices/bus/odyssey2/slot.h | 20 +- src/devices/bus/odyssey2/voice.cpp | 2 +- src/devices/bus/odyssey2/voice.h | 2 +- src/devices/bus/oricext/jasmin.cpp | 2 +- src/devices/bus/oricext/jasmin.h | 4 +- src/devices/bus/oricext/microdisc.cpp | 2 +- src/devices/bus/oricext/microdisc.h | 6 +- src/devices/bus/oricext/oricext.cpp | 8 +- src/devices/bus/oricext/oricext.h | 8 +- src/devices/bus/pc1512/mouse.cpp | 4 +- src/devices/bus/pc1512/mouse.h | 8 +- src/devices/bus/pc_joy/pc_joy.cpp | 4 +- src/devices/bus/pc_joy/pc_joy.h | 24 +- src/devices/bus/pc_joy/pc_joy_sw.cpp | 6 +- src/devices/bus/pc_joy/pc_joy_sw.h | 6 +- src/devices/bus/pc_kbd/ec1841.cpp | 6 +- src/devices/bus/pc_kbd/ec1841.h | 8 +- src/devices/bus/pc_kbd/iskr1030.cpp | 8 +- src/devices/bus/pc_kbd/iskr1030.h | 10 +- src/devices/bus/pc_kbd/keytro.cpp | 4 +- src/devices/bus/pc_kbd/keytro.h | 14 +- src/devices/bus/pc_kbd/msnat.cpp | 6 +- src/devices/bus/pc_kbd/msnat.h | 10 +- src/devices/bus/pc_kbd/pc83.cpp | 6 +- src/devices/bus/pc_kbd/pc83.h | 4 +- src/devices/bus/pc_kbd/pc_kbdc.cpp | 4 +- src/devices/bus/pc_kbd/pc_kbdc.h | 4 +- src/devices/bus/pc_kbd/pcat84.cpp | 12 +- src/devices/bus/pc_kbd/pcat84.h | 8 +- src/devices/bus/pc_kbd/pcxt83.cpp | 4 +- src/devices/bus/pc_kbd/pcxt83.h | 8 +- src/devices/bus/pce/pce_rom.cpp | 10 +- src/devices/bus/pce/pce_rom.h | 12 +- src/devices/bus/pce/pce_slot.cpp | 24 +- src/devices/bus/pce/pce_slot.h | 28 +- src/devices/bus/pet/2joysnd.cpp | 2 +- src/devices/bus/pet/2joysnd.h | 2 +- src/devices/bus/pet/64k.cpp | 12 +- src/devices/bus/pet/64k.h | 14 +- src/devices/bus/pet/c2n.cpp | 8 +- src/devices/bus/pet/c2n.h | 8 +- src/devices/bus/pet/cass.cpp | 2 +- src/devices/bus/pet/cass.h | 2 +- src/devices/bus/pet/cb2snd.cpp | 2 +- src/devices/bus/pet/cb2snd.h | 2 +- src/devices/bus/pet/diag.cpp | 2 +- src/devices/bus/pet/diag.h | 2 +- src/devices/bus/pet/diag264_lb_tape.cpp | 2 +- src/devices/bus/pet/diag264_lb_tape.h | 2 +- src/devices/bus/pet/exp.cpp | 10 +- src/devices/bus/pet/exp.h | 14 +- src/devices/bus/pet/hsg.cpp | 10 +- src/devices/bus/pet/hsg.h | 10 +- src/devices/bus/pet/petuja.cpp | 2 +- src/devices/bus/pet/petuja.h | 2 +- src/devices/bus/pet/superpet.cpp | 6 +- src/devices/bus/pet/superpet.h | 16 +- src/devices/bus/pet/user.cpp | 2 +- src/devices/bus/pet/user.h | 2 +- src/devices/bus/plus4/c1551.cpp | 18 +- src/devices/bus/plus4/c1551.h | 8 +- src/devices/bus/plus4/diag264_lb_user.cpp | 2 +- src/devices/bus/plus4/diag264_lb_user.h | 2 +- src/devices/bus/plus4/exp.cpp | 6 +- src/devices/bus/plus4/exp.h | 18 +- src/devices/bus/plus4/sid.cpp | 6 +- src/devices/bus/plus4/sid.h | 6 +- src/devices/bus/plus4/std.cpp | 4 +- src/devices/bus/plus4/std.h | 4 +- src/devices/bus/pofo/ccm.cpp | 2 +- src/devices/bus/pofo/ccm.h | 10 +- src/devices/bus/pofo/exp.cpp | 2 +- src/devices/bus/pofo/exp.h | 18 +- src/devices/bus/pofo/hpc101.cpp | 6 +- src/devices/bus/pofo/hpc101.h | 6 +- src/devices/bus/pofo/hpc102.cpp | 8 +- src/devices/bus/pofo/hpc102.h | 10 +- src/devices/bus/pofo/hpc104.cpp | 10 +- src/devices/bus/pofo/hpc104.h | 12 +- src/devices/bus/pofo/ram.cpp | 6 +- src/devices/bus/pofo/ram.h | 6 +- src/devices/bus/pofo/rom.cpp | 4 +- src/devices/bus/pofo/rom.h | 4 +- src/devices/bus/psx/analogue.cpp | 18 +- src/devices/bus/psx/analogue.h | 14 +- src/devices/bus/psx/ctlrport.cpp | 8 +- src/devices/bus/psx/ctlrport.h | 14 +- src/devices/bus/psx/memcard.cpp | 6 +- src/devices/bus/psx/memcard.h | 8 +- src/devices/bus/psx/multitap.cpp | 4 +- src/devices/bus/psx/multitap.h | 6 +- src/devices/bus/ql/cst_q_plus4.cpp | 6 +- src/devices/bus/ql/cst_q_plus4.h | 6 +- src/devices/bus/ql/cst_qdisc.cpp | 6 +- src/devices/bus/ql/cst_qdisc.h | 6 +- src/devices/bus/ql/cumana_fdi.cpp | 6 +- src/devices/bus/ql/cumana_fdi.h | 6 +- src/devices/bus/ql/exp.cpp | 2 +- src/devices/bus/ql/exp.h | 10 +- src/devices/bus/ql/kempston_di.cpp | 6 +- src/devices/bus/ql/kempston_di.h | 6 +- src/devices/bus/ql/miracle_gold_card.cpp | 6 +- src/devices/bus/ql/miracle_gold_card.h | 6 +- src/devices/bus/ql/miracle_hd.cpp | 6 +- src/devices/bus/ql/miracle_hd.h | 6 +- src/devices/bus/ql/mp_fdi.cpp | 6 +- src/devices/bus/ql/mp_fdi.h | 6 +- src/devices/bus/ql/opd_basic_master.cpp | 6 +- src/devices/bus/ql/opd_basic_master.h | 6 +- src/devices/bus/ql/pcml_qdisk.cpp | 6 +- src/devices/bus/ql/pcml_qdisk.h | 6 +- src/devices/bus/ql/qubide.cpp | 6 +- src/devices/bus/ql/qubide.h | 8 +- src/devices/bus/ql/rom.cpp | 2 +- src/devices/bus/ql/rom.h | 12 +- src/devices/bus/ql/sandy_superdisk.cpp | 6 +- src/devices/bus/ql/sandy_superdisk.h | 6 +- src/devices/bus/ql/sandy_superqboard.cpp | 14 +- src/devices/bus/ql/sandy_superqboard.h | 18 +- src/devices/bus/ql/std.cpp | 4 +- src/devices/bus/ql/std.h | 4 +- src/devices/bus/ql/trumpcard.cpp | 14 +- src/devices/bus/ql/trumpcard.h | 16 +- src/devices/bus/rs232/keyboard.cpp | 8 +- src/devices/bus/rs232/keyboard.h | 8 +- src/devices/bus/rs232/loopback.cpp | 2 +- src/devices/bus/rs232/loopback.h | 2 +- src/devices/bus/rs232/null_modem.cpp | 2 +- src/devices/bus/rs232/null_modem.h | 8 +- src/devices/bus/rs232/printer.cpp | 2 +- src/devices/bus/rs232/printer.h | 2 +- src/devices/bus/rs232/pty.cpp | 2 +- src/devices/bus/rs232/pty.h | 8 +- src/devices/bus/rs232/rs232.cpp | 4 +- src/devices/bus/rs232/rs232.h | 18 +- src/devices/bus/rs232/ser_mouse.cpp | 8 +- src/devices/bus/rs232/ser_mouse.h | 14 +- src/devices/bus/rs232/sun_kbd.cpp | 2 +- src/devices/bus/rs232/sun_kbd.h | 2 +- src/devices/bus/rs232/terminal.cpp | 6 +- src/devices/bus/rs232/terminal.h | 6 +- src/devices/bus/rs232/xvd701.cpp | 2 +- src/devices/bus/rs232/xvd701.h | 2 +- src/devices/bus/s100/dj2db.cpp | 12 +- src/devices/bus/s100/dj2db.h | 12 +- src/devices/bus/s100/djdma.cpp | 2 +- src/devices/bus/s100/djdma.h | 2 +- src/devices/bus/s100/mm65k16s.cpp | 8 +- src/devices/bus/s100/mm65k16s.h | 8 +- src/devices/bus/s100/nsmdsa.cpp | 4 +- src/devices/bus/s100/nsmdsa.h | 4 +- src/devices/bus/s100/nsmdsad.cpp | 4 +- src/devices/bus/s100/nsmdsad.h | 4 +- src/devices/bus/s100/s100.cpp | 8 +- src/devices/bus/s100/s100.h | 14 +- src/devices/bus/s100/wunderbus.cpp | 12 +- src/devices/bus/s100/wunderbus.h | 8 +- src/devices/bus/sat_ctrl/analog.cpp | 6 +- src/devices/bus/sat_ctrl/analog.h | 8 +- src/devices/bus/sat_ctrl/ctrl.cpp | 18 +- src/devices/bus/sat_ctrl/ctrl.h | 20 +- src/devices/bus/sat_ctrl/joy.cpp | 8 +- src/devices/bus/sat_ctrl/joy.h | 10 +- src/devices/bus/sat_ctrl/joy_md.cpp | 12 +- src/devices/bus/sat_ctrl/joy_md.h | 16 +- src/devices/bus/sat_ctrl/keybd.cpp | 12 +- src/devices/bus/sat_ctrl/keybd.h | 18 +- src/devices/bus/sat_ctrl/mouse.cpp | 12 +- src/devices/bus/sat_ctrl/mouse.h | 8 +- src/devices/bus/sat_ctrl/multitap.cpp | 8 +- src/devices/bus/sat_ctrl/multitap.h | 8 +- src/devices/bus/sat_ctrl/pointer.cpp | 12 +- src/devices/bus/sat_ctrl/pointer.h | 8 +- src/devices/bus/sat_ctrl/racing.cpp | 6 +- src/devices/bus/sat_ctrl/racing.h | 8 +- src/devices/bus/sat_ctrl/segatap.cpp | 8 +- src/devices/bus/sat_ctrl/segatap.h | 8 +- src/devices/bus/saturn/bram.cpp | 12 +- src/devices/bus/saturn/bram.h | 10 +- src/devices/bus/saturn/dram.cpp | 6 +- src/devices/bus/saturn/dram.h | 6 +- src/devices/bus/saturn/rom.cpp | 4 +- src/devices/bus/saturn/rom.h | 4 +- src/devices/bus/saturn/sat_slot.cpp | 24 +- src/devices/bus/saturn/sat_slot.h | 36 +- src/devices/bus/scsi/acb4070.cpp | 4 +- src/devices/bus/scsi/acb4070.h | 32 +- src/devices/bus/scsi/cdu76s.cpp | 4 +- src/devices/bus/scsi/cdu76s.h | 4 +- src/devices/bus/scsi/d9060hd.cpp | 2 +- src/devices/bus/scsi/d9060hd.h | 2 +- src/devices/bus/scsi/omti5100.cpp | 8 +- src/devices/bus/scsi/omti5100.h | 6 +- src/devices/bus/scsi/pc9801_sasi.cpp | 2 +- src/devices/bus/scsi/pc9801_sasi.h | 2 +- src/devices/bus/scsi/s1410.cpp | 14 +- src/devices/bus/scsi/s1410.h | 6 +- src/devices/bus/scsi/sa1403d.cpp | 4 +- src/devices/bus/scsi/sa1403d.h | 4 +- src/devices/bus/scsi/scsi.cpp | 4 +- src/devices/bus/scsi/scsi.h | 4 +- src/devices/bus/scsi/scsicd.cpp | 4 +- src/devices/bus/scsi/scsicd.h | 4 +- src/devices/bus/scsi/scsihd.cpp | 4 +- src/devices/bus/scsi/scsihd.h | 4 +- src/devices/bus/scsi/scsihle.cpp | 12 +- src/devices/bus/scsi/scsihle.h | 22 +- src/devices/bus/scv/rom.cpp | 16 +- src/devices/bus/scv/rom.h | 24 +- src/devices/bus/scv/slot.cpp | 16 +- src/devices/bus/scv/slot.h | 22 +- src/devices/bus/sega8/ccatch.cpp | 2 +- src/devices/bus/sega8/ccatch.h | 2 +- src/devices/bus/sega8/mgear.cpp | 2 +- src/devices/bus/sega8/mgear.h | 2 +- src/devices/bus/sega8/rom.cpp | 40 +- src/devices/bus/sega8/rom.h | 62 +- src/devices/bus/sega8/sega8_slot.cpp | 50 +- src/devices/bus/sega8/sega8_slot.h | 32 +- src/devices/bus/sg1000_exp/fm_unit.cpp | 6 +- src/devices/bus/sg1000_exp/fm_unit.h | 8 +- src/devices/bus/sg1000_exp/sg1000exp.cpp | 8 +- src/devices/bus/sg1000_exp/sg1000exp.h | 10 +- src/devices/bus/sg1000_exp/sk1100.cpp | 6 +- src/devices/bus/sg1000_exp/sk1100.h | 6 +- src/devices/bus/sms_ctrl/graphic.cpp | 6 +- src/devices/bus/sms_ctrl/graphic.h | 10 +- src/devices/bus/sms_ctrl/joypad.cpp | 4 +- src/devices/bus/sms_ctrl/joypad.h | 4 +- src/devices/bus/sms_ctrl/lphaser.cpp | 16 +- src/devices/bus/sms_ctrl/lphaser.h | 8 +- src/devices/bus/sms_ctrl/multitap.cpp | 10 +- src/devices/bus/sms_ctrl/multitap.h | 10 +- src/devices/bus/sms_ctrl/paddle.cpp | 6 +- src/devices/bus/sms_ctrl/paddle.h | 6 +- src/devices/bus/sms_ctrl/rfu.cpp | 8 +- src/devices/bus/sms_ctrl/rfu.h | 8 +- src/devices/bus/sms_ctrl/smsctrl.cpp | 10 +- src/devices/bus/sms_ctrl/smsctrl.h | 12 +- src/devices/bus/sms_ctrl/sports.cpp | 8 +- src/devices/bus/sms_ctrl/sports.h | 14 +- src/devices/bus/sms_ctrl/sportsjp.cpp | 4 +- src/devices/bus/sms_ctrl/sportsjp.h | 10 +- src/devices/bus/sms_exp/gender.cpp | 2 +- src/devices/bus/sms_exp/gender.h | 2 +- src/devices/bus/sms_exp/smsexp.cpp | 2 +- src/devices/bus/sms_exp/smsexp.h | 2 +- src/devices/bus/snes/bsx.cpp | 20 +- src/devices/bus/snes/bsx.h | 42 +- src/devices/bus/snes/event.cpp | 10 +- src/devices/bus/snes/event.h | 14 +- src/devices/bus/snes/rom.cpp | 34 +- src/devices/bus/snes/rom.h | 40 +- src/devices/bus/snes/rom21.cpp | 28 +- src/devices/bus/snes/rom21.h | 14 +- src/devices/bus/snes/sa1.cpp | 64 +- src/devices/bus/snes/sa1.h | 60 +- src/devices/bus/snes/sdd1.cpp | 72 +- src/devices/bus/snes/sdd1.h | 76 +- src/devices/bus/snes/sfx.cpp | 4 +- src/devices/bus/snes/sfx.h | 4 +- src/devices/bus/snes/sgb.cpp | 22 +- src/devices/bus/snes/sgb.h | 34 +- src/devices/bus/snes/snes_slot.cpp | 88 +- src/devices/bus/snes/snes_slot.h | 54 +- src/devices/bus/snes/spc7110.cpp | 222 +- src/devices/bus/snes/spc7110.h | 196 +- src/devices/bus/snes/sufami.cpp | 4 +- src/devices/bus/snes/sufami.h | 4 +- src/devices/bus/snes/upd.cpp | 54 +- src/devices/bus/snes/upd.h | 42 +- src/devices/bus/snes_ctrl/bcbattle.cpp | 8 +- src/devices/bus/snes_ctrl/bcbattle.h | 8 +- src/devices/bus/snes_ctrl/ctrl.cpp | 14 +- src/devices/bus/snes_ctrl/ctrl.h | 26 +- src/devices/bus/snes_ctrl/joypad.cpp | 10 +- src/devices/bus/snes_ctrl/joypad.h | 8 +- src/devices/bus/snes_ctrl/miracle.cpp | 16 +- src/devices/bus/snes_ctrl/miracle.h | 16 +- src/devices/bus/snes_ctrl/mouse.cpp | 10 +- src/devices/bus/snes_ctrl/mouse.h | 12 +- src/devices/bus/snes_ctrl/multitap.cpp | 14 +- src/devices/bus/snes_ctrl/multitap.h | 10 +- src/devices/bus/snes_ctrl/pachinko.cpp | 10 +- src/devices/bus/snes_ctrl/pachinko.h | 8 +- src/devices/bus/snes_ctrl/sscope.cpp | 10 +- src/devices/bus/snes_ctrl/sscope.h | 10 +- src/devices/bus/snes_ctrl/twintap.cpp | 8 +- src/devices/bus/snes_ctrl/twintap.h | 8 +- src/devices/bus/spc1000/exp.cpp | 2 +- src/devices/bus/spc1000/exp.h | 2 +- src/devices/bus/spc1000/fdd.cpp | 4 +- src/devices/bus/spc1000/fdd.h | 8 +- src/devices/bus/spc1000/vdp.cpp | 2 +- src/devices/bus/spc1000/vdp.h | 2 +- src/devices/bus/sunkbd/hlekbd.cpp | 38 +- src/devices/bus/sunkbd/hlekbd.h | 42 +- src/devices/bus/sunkbd/sunkbd.cpp | 4 +- src/devices/bus/sunkbd/sunkbd.h | 4 +- src/devices/bus/svi3x8/expander/expander.cpp | 2 +- src/devices/bus/svi3x8/expander/expander.h | 2 +- src/devices/bus/svi3x8/expander/sv601.cpp | 2 +- src/devices/bus/svi3x8/expander/sv601.h | 2 +- src/devices/bus/svi3x8/expander/sv602.cpp | 2 +- src/devices/bus/svi3x8/expander/sv602.h | 2 +- src/devices/bus/svi3x8/expander/sv603.cpp | 4 +- src/devices/bus/svi3x8/expander/sv603.h | 2 +- src/devices/bus/svi3x8/slot/slot.cpp | 8 +- src/devices/bus/svi3x8/slot/slot.h | 4 +- src/devices/bus/svi3x8/slot/sv801.cpp | 2 +- src/devices/bus/svi3x8/slot/sv801.h | 2 +- src/devices/bus/svi3x8/slot/sv802.cpp | 2 +- src/devices/bus/svi3x8/slot/sv802.h | 2 +- src/devices/bus/svi3x8/slot/sv803.cpp | 4 +- src/devices/bus/svi3x8/slot/sv803.h | 4 +- src/devices/bus/svi3x8/slot/sv805.cpp | 2 +- src/devices/bus/svi3x8/slot/sv805.h | 2 +- src/devices/bus/svi3x8/slot/sv806.cpp | 6 +- src/devices/bus/svi3x8/slot/sv806.h | 4 +- src/devices/bus/svi3x8/slot/sv807.cpp | 6 +- src/devices/bus/svi3x8/slot/sv807.h | 6 +- src/devices/bus/ti99_peb/bwg.cpp | 8 +- src/devices/bus/ti99_peb/bwg.h | 10 +- src/devices/bus/ti99_peb/evpc.cpp | 4 +- src/devices/bus/ti99_peb/evpc.h | 10 +- src/devices/bus/ti99_peb/hfdc.cpp | 14 +- src/devices/bus/ti99_peb/hfdc.h | 20 +- src/devices/bus/ti99_peb/horizon.cpp | 6 +- src/devices/bus/ti99_peb/horizon.h | 2 +- src/devices/bus/ti99_peb/hsgpl.cpp | 12 +- src/devices/bus/ti99_peb/hsgpl.h | 12 +- src/devices/bus/ti99_peb/memex.cpp | 2 +- src/devices/bus/ti99_peb/memex.h | 4 +- src/devices/bus/ti99_peb/myarcmem.cpp | 2 +- src/devices/bus/ti99_peb/myarcmem.h | 4 +- src/devices/bus/ti99_peb/pcode.cpp | 4 +- src/devices/bus/ti99_peb/pcode.h | 6 +- src/devices/bus/ti99_peb/peribox.cpp | 14 +- src/devices/bus/ti99_peb/peribox.h | 16 +- src/devices/bus/ti99_peb/samsmem.cpp | 2 +- src/devices/bus/ti99_peb/samsmem.h | 2 +- src/devices/bus/ti99_peb/spchsyn.cpp | 2 +- src/devices/bus/ti99_peb/spchsyn.h | 2 +- src/devices/bus/ti99_peb/ti_32kmem.cpp | 4 +- src/devices/bus/ti99_peb/ti_32kmem.h | 2 +- src/devices/bus/ti99_peb/ti_fdc.cpp | 8 +- src/devices/bus/ti99_peb/ti_fdc.h | 8 +- src/devices/bus/ti99_peb/ti_rs232.cpp | 48 +- src/devices/bus/ti99_peb/ti_rs232.h | 26 +- src/devices/bus/ti99_peb/tn_ide.cpp | 6 +- src/devices/bus/ti99_peb/tn_ide.h | 6 +- src/devices/bus/ti99_peb/tn_usbsm.cpp | 4 +- src/devices/bus/ti99_peb/tn_usbsm.h | 6 +- src/devices/bus/ti99x/990_dk.cpp | 6 +- src/devices/bus/ti99x/990_dk.h | 12 +- src/devices/bus/ti99x/990_hd.cpp | 24 +- src/devices/bus/ti99x/990_hd.h | 4 +- src/devices/bus/ti99x/990_tap.cpp | 16 +- src/devices/bus/ti99x/990_tap.h | 4 +- src/devices/bus/ti99x/998board.cpp | 14 +- src/devices/bus/ti99x/998board.h | 38 +- src/devices/bus/ti99x/datamux.cpp | 28 +- src/devices/bus/ti99x/datamux.h | 20 +- src/devices/bus/ti99x/genboard.cpp | 24 +- src/devices/bus/ti99x/genboard.h | 14 +- src/devices/bus/ti99x/gromport.cpp | 58 +- src/devices/bus/ti99x/gromport.h | 40 +- src/devices/bus/ti99x/handset.cpp | 20 +- src/devices/bus/ti99x/handset.h | 16 +- src/devices/bus/ti99x/joyport.cpp | 4 +- src/devices/bus/ti99x/joyport.h | 10 +- src/devices/bus/ti99x/mecmouse.cpp | 6 +- src/devices/bus/ti99x/mecmouse.h | 6 +- src/devices/bus/ti99x/ti99defs.h | 14 +- src/devices/bus/tiki100/8088.cpp | 6 +- src/devices/bus/tiki100/8088.h | 8 +- src/devices/bus/tiki100/exp.cpp | 8 +- src/devices/bus/tiki100/exp.h | 16 +- src/devices/bus/tiki100/hdc.cpp | 6 +- src/devices/bus/tiki100/hdc.h | 6 +- src/devices/bus/tvc/hbf.cpp | 2 +- src/devices/bus/tvc/hbf.h | 10 +- src/devices/bus/tvc/tvc.cpp | 10 +- src/devices/bus/tvc/tvc.h | 10 +- src/devices/bus/vboy/rom.cpp | 6 +- src/devices/bus/vboy/rom.h | 6 +- src/devices/bus/vboy/slot.cpp | 16 +- src/devices/bus/vboy/slot.h | 22 +- src/devices/bus/vc4000/rom.cpp | 10 +- src/devices/bus/vc4000/rom.h | 10 +- src/devices/bus/vc4000/slot.cpp | 12 +- src/devices/bus/vc4000/slot.h | 22 +- src/devices/bus/vcs/compumat.cpp | 2 +- src/devices/bus/vcs/compumat.h | 2 +- src/devices/bus/vcs/dpc.cpp | 22 +- src/devices/bus/vcs/dpc.h | 38 +- src/devices/bus/vcs/harmony_melody.cpp | 4 +- src/devices/bus/vcs/harmony_melody.h | 2 +- src/devices/bus/vcs/rom.cpp | 52 +- src/devices/bus/vcs/rom.h | 48 +- src/devices/bus/vcs/scharger.cpp | 4 +- src/devices/bus/vcs/scharger.h | 14 +- src/devices/bus/vcs/vcs_slot.cpp | 48 +- src/devices/bus/vcs/vcs_slot.h | 54 +- src/devices/bus/vcs_ctrl/ctrl.cpp | 2 +- src/devices/bus/vcs_ctrl/ctrl.h | 18 +- src/devices/bus/vcs_ctrl/joybooster.cpp | 8 +- src/devices/bus/vcs_ctrl/joybooster.h | 8 +- src/devices/bus/vcs_ctrl/joystick.cpp | 4 +- src/devices/bus/vcs_ctrl/joystick.h | 4 +- src/devices/bus/vcs_ctrl/keypad.cpp | 10 +- src/devices/bus/vcs_ctrl/keypad.h | 12 +- src/devices/bus/vcs_ctrl/lightpen.cpp | 4 +- src/devices/bus/vcs_ctrl/lightpen.h | 4 +- src/devices/bus/vcs_ctrl/paddles.cpp | 8 +- src/devices/bus/vcs_ctrl/paddles.h | 8 +- src/devices/bus/vcs_ctrl/wheel.cpp | 6 +- src/devices/bus/vcs_ctrl/wheel.h | 4 +- src/devices/bus/vectrex/rom.cpp | 8 +- src/devices/bus/vectrex/rom.h | 8 +- src/devices/bus/vectrex/slot.cpp | 12 +- src/devices/bus/vectrex/slot.h | 12 +- src/devices/bus/vic10/exp.cpp | 10 +- src/devices/bus/vic10/exp.h | 16 +- src/devices/bus/vic10/std.cpp | 6 +- src/devices/bus/vic10/std.h | 6 +- src/devices/bus/vic20/4cga.cpp | 4 +- src/devices/bus/vic20/4cga.h | 6 +- src/devices/bus/vic20/exp.cpp | 10 +- src/devices/bus/vic20/exp.h | 20 +- src/devices/bus/vic20/fe3.cpp | 12 +- src/devices/bus/vic20/fe3.h | 16 +- src/devices/bus/vic20/megacart.cpp | 6 +- src/devices/bus/vic20/megacart.h | 6 +- src/devices/bus/vic20/std.cpp | 4 +- src/devices/bus/vic20/std.h | 4 +- src/devices/bus/vic20/vic1010.cpp | 8 +- src/devices/bus/vic20/vic1010.h | 6 +- src/devices/bus/vic20/vic1011.cpp | 2 +- src/devices/bus/vic20/vic1011.h | 2 +- src/devices/bus/vic20/vic1110.cpp | 10 +- src/devices/bus/vic20/vic1110.h | 8 +- src/devices/bus/vic20/vic1111.cpp | 6 +- src/devices/bus/vic20/vic1111.h | 8 +- src/devices/bus/vic20/vic1112.cpp | 8 +- src/devices/bus/vic20/vic1112.h | 8 +- src/devices/bus/vic20/vic1210.cpp | 6 +- src/devices/bus/vic20/vic1210.h | 8 +- src/devices/bus/vidbrain/exp.cpp | 12 +- src/devices/bus/vidbrain/exp.h | 18 +- src/devices/bus/vidbrain/money_minder.cpp | 8 +- src/devices/bus/vidbrain/money_minder.h | 6 +- src/devices/bus/vidbrain/std.cpp | 6 +- src/devices/bus/vidbrain/std.h | 4 +- src/devices/bus/vidbrain/timeshare.cpp | 8 +- src/devices/bus/vidbrain/timeshare.h | 6 +- src/devices/bus/vip/byteio.cpp | 6 +- src/devices/bus/vip/byteio.h | 10 +- src/devices/bus/vip/exp.cpp | 22 +- src/devices/bus/vip/exp.h | 30 +- src/devices/bus/vip/vp550.cpp | 4 +- src/devices/bus/vip/vp550.h | 4 +- src/devices/bus/vip/vp570.cpp | 8 +- src/devices/bus/vip/vp570.h | 8 +- src/devices/bus/vip/vp575.cpp | 24 +- src/devices/bus/vip/vp575.h | 16 +- src/devices/bus/vip/vp585.cpp | 4 +- src/devices/bus/vip/vp585.h | 6 +- src/devices/bus/vip/vp590.cpp | 14 +- src/devices/bus/vip/vp590.h | 16 +- src/devices/bus/vip/vp595.cpp | 4 +- src/devices/bus/vip/vp595.h | 4 +- src/devices/bus/vip/vp620.cpp | 4 +- src/devices/bus/vip/vp620.h | 6 +- src/devices/bus/vip/vp700.cpp | 6 +- src/devices/bus/vip/vp700.h | 4 +- src/devices/bus/vtech/ioexp/ioexp.cpp | 2 +- src/devices/bus/vtech/ioexp/ioexp.h | 2 +- src/devices/bus/vtech/ioexp/joystick.cpp | 4 +- src/devices/bus/vtech/ioexp/joystick.h | 2 +- src/devices/bus/vtech/ioexp/printer.cpp | 2 +- src/devices/bus/vtech/ioexp/printer.h | 2 +- src/devices/bus/vtech/memexp/floppy.cpp | 6 +- src/devices/bus/vtech/memexp/floppy.h | 4 +- src/devices/bus/vtech/memexp/memexp.cpp | 2 +- src/devices/bus/vtech/memexp/memexp.h | 2 +- src/devices/bus/vtech/memexp/memory.cpp | 8 +- src/devices/bus/vtech/memexp/memory.h | 16 +- src/devices/bus/vtech/memexp/rs232.cpp | 2 +- src/devices/bus/vtech/memexp/rs232.h | 2 +- src/devices/bus/vtech/memexp/rtty.cpp | 2 +- src/devices/bus/vtech/memexp/rtty.h | 2 +- src/devices/bus/vtech/memexp/wordpro.cpp | 2 +- src/devices/bus/vtech/memexp/wordpro.h | 2 +- src/devices/bus/wangpc/emb.cpp | 14 +- src/devices/bus/wangpc/emb.h | 14 +- src/devices/bus/wangpc/lic.cpp | 14 +- src/devices/bus/wangpc/lic.h | 10 +- src/devices/bus/wangpc/lvc.cpp | 18 +- src/devices/bus/wangpc/lvc.h | 16 +- src/devices/bus/wangpc/mcc.cpp | 8 +- src/devices/bus/wangpc/mcc.h | 8 +- src/devices/bus/wangpc/mvc.cpp | 24 +- src/devices/bus/wangpc/mvc.h | 18 +- src/devices/bus/wangpc/rtc.cpp | 14 +- src/devices/bus/wangpc/rtc.h | 12 +- src/devices/bus/wangpc/tig.cpp | 16 +- src/devices/bus/wangpc/tig.h | 18 +- src/devices/bus/wangpc/wangpc.cpp | 14 +- src/devices/bus/wangpc/wangpc.h | 20 +- src/devices/bus/wangpc/wdc.cpp | 18 +- src/devices/bus/wangpc/wdc.h | 18 +- src/devices/bus/wswan/rom.cpp | 12 +- src/devices/bus/wswan/rom.h | 42 +- src/devices/bus/wswan/slot.cpp | 24 +- src/devices/bus/wswan/slot.h | 24 +- src/devices/bus/x68k/x68k_neptunex.cpp | 6 +- src/devices/bus/x68k/x68k_neptunex.h | 6 +- src/devices/bus/x68k/x68k_scsiext.cpp | 4 +- src/devices/bus/x68k/x68k_scsiext.h | 2 +- src/devices/bus/x68k/x68kexp.cpp | 2 +- src/devices/bus/x68k/x68kexp.h | 2 +- src/devices/bus/z88/flash.cpp | 4 +- src/devices/bus/z88/flash.h | 6 +- src/devices/bus/z88/ram.cpp | 12 +- src/devices/bus/z88/ram.h | 22 +- src/devices/bus/z88/rom.cpp | 10 +- src/devices/bus/z88/rom.h | 18 +- src/devices/bus/z88/z88.cpp | 4 +- src/devices/bus/z88/z88.h | 6 +- src/devices/cpu/8x300/8x300.cpp | 20 +- src/devices/cpu/8x300/8x300.h | 64 +- src/devices/cpu/8x300/8x300dasm.cpp | 8 +- src/devices/cpu/adsp2100/2100ops.hxx | 418 +-- src/devices/cpu/adsp2100/adsp2100.cpp | 84 +- src/devices/cpu/adsp2100/adsp2100.h | 204 +- src/devices/cpu/alph8201/8201dasm.cpp | 2 +- src/devices/cpu/alph8201/alph8201.cpp | 34 +- src/devices/cpu/alph8201/alph8201.h | 116 +- src/devices/cpu/alto2/a2dht.cpp | 2 +- src/devices/cpu/alto2/a2disk.cpp | 52 +- src/devices/cpu/alto2/a2disk.h | 58 +- src/devices/cpu/alto2/a2disp.cpp | 40 +- src/devices/cpu/alto2/a2disp.h | 36 +- src/devices/cpu/alto2/a2dwt.cpp | 2 +- src/devices/cpu/alto2/a2emu.cpp | 44 +- src/devices/cpu/alto2/a2emu.h | 6 +- src/devices/cpu/alto2/a2ether.cpp | 82 +- src/devices/cpu/alto2/a2ether.h | 28 +- src/devices/cpu/alto2/a2hw.cpp | 22 +- src/devices/cpu/alto2/a2hw.h | 8 +- src/devices/cpu/alto2/a2jkff.h | 4 +- src/devices/cpu/alto2/a2kbd.cpp | 4 +- src/devices/cpu/alto2/a2kbd.h | 6 +- src/devices/cpu/alto2/a2mem.cpp | 76 +- src/devices/cpu/alto2/a2mem.h | 40 +- src/devices/cpu/alto2/a2mouse.cpp | 14 +- src/devices/cpu/alto2/a2mouse.h | 8 +- src/devices/cpu/alto2/a2ram.cpp | 34 +- src/devices/cpu/alto2/a2roms.cpp | 64 +- src/devices/cpu/alto2/a2roms.h | 16 +- src/devices/cpu/alto2/alto2cpu.cpp | 144 +- src/devices/cpu/alto2/alto2cpu.h | 160 +- src/devices/cpu/alto2/alto2dsm.cpp | 26 +- src/devices/cpu/am29000/am29000.cpp | 20 +- src/devices/cpu/am29000/am29000.h | 102 +- src/devices/cpu/am29000/am29dasm.cpp | 18 +- src/devices/cpu/am29000/am29ops.h | 374 +-- src/devices/cpu/amis2000/amis2000.cpp | 8 +- src/devices/cpu/amis2000/amis2000.h | 76 +- src/devices/cpu/amis2000/amis2000d.cpp | 12 +- src/devices/cpu/amis2000/amis2000op.cpp | 50 +- src/devices/cpu/apexc/apexc.cpp | 26 +- src/devices/cpu/apexc/apexc.h | 44 +- src/devices/cpu/apexc/apexcdsm.cpp | 2 +- src/devices/cpu/arc/arc.cpp | 14 +- src/devices/cpu/arc/arc.h | 26 +- src/devices/cpu/arc/arcdasm.cpp | 4 +- src/devices/cpu/arcompact/arcompact.cpp | 6 +- src/devices/cpu/arcompact/arcompact.h | 60 +- src/devices/cpu/arcompact/arcompact_execute.cpp | 186 +- src/devices/cpu/arcompact/arcompact_make.py | 96 +- src/devices/cpu/arcompact/arcompactdasm.cpp | 4 +- .../cpu/arcompact/arcompactdasm_dispatch.cpp | 56 +- src/devices/cpu/arcompact/arcompactdasm_dispatch.h | 4 +- src/devices/cpu/arcompact/arcompactdasm_ops.cpp | 40 +- src/devices/cpu/arcompact/arcompactdasm_ops.h | 4 +- src/devices/cpu/arm/arm.cpp | 192 +- src/devices/cpu/arm/arm.h | 76 +- src/devices/cpu/arm/armdasm.cpp | 18 +- src/devices/cpu/arm7/arm7.cpp | 108 +- src/devices/cpu/arm7/arm7.h | 402 +-- src/devices/cpu/arm7/arm7core.h | 198 +- src/devices/cpu/arm7/arm7core.hxx | 8 +- src/devices/cpu/arm7/arm7dasm.cpp | 46 +- src/devices/cpu/arm7/arm7drc.hxx | 130 +- src/devices/cpu/arm7/arm7help.h | 2 +- src/devices/cpu/arm7/arm7ops.cpp | 258 +- src/devices/cpu/arm7/arm7tdrc.hxx | 592 ++-- src/devices/cpu/arm7/arm7thmb.cpp | 642 ++-- src/devices/cpu/arm7/lpc210x.cpp | 8 +- src/devices/cpu/arm7/lpc210x.h | 10 +- src/devices/cpu/asap/asap.cpp | 316 +- src/devices/cpu/asap/asap.h | 52 +- src/devices/cpu/asap/asapdasm.cpp | 16 +- src/devices/cpu/avr8/avr8.cpp | 320 +- src/devices/cpu/avr8/avr8.h | 130 +- src/devices/cpu/avr8/avr8dasm.cpp | 6 +- src/devices/cpu/ccpu/ccpu.cpp | 44 +- src/devices/cpu/ccpu/ccpu.h | 52 +- src/devices/cpu/ccpu/ccpudasm.cpp | 4 +- src/devices/cpu/cop400/cop400.cpp | 66 +- src/devices/cpu/cop400/cop400.h | 246 +- src/devices/cpu/cop400/cop400op.hxx | 58 +- src/devices/cpu/cop400/cop410ds.cpp | 16 +- src/devices/cpu/cop400/cop420ds.cpp | 18 +- src/devices/cpu/cop400/cop440ds.cpp | 18 +- src/devices/cpu/cosmac/cosdasm.cpp | 16 +- src/devices/cpu/cosmac/cosmac.cpp | 36 +- src/devices/cpu/cosmac/cosmac.h | 58 +- src/devices/cpu/cp1610/1610dasm.cpp | 6 +- src/devices/cpu/cp1610/cp1610.cpp | 220 +- src/devices/cpu/cp1610/cp1610.h | 32 +- src/devices/cpu/cubeqcpu/cubedasm.cpp | 18 +- src/devices/cpu/cubeqcpu/cubeqcpu.cpp | 120 +- src/devices/cpu/cubeqcpu/cubeqcpu.h | 198 +- src/devices/cpu/drcbec.cpp | 324 +- src/devices/cpu/drcbec.h | 18 +- src/devices/cpu/drcbeut.cpp | 46 +- src/devices/cpu/drcbeut.h | 48 +- src/devices/cpu/drcbex64.cpp | 276 +- src/devices/cpu/drcbex64.h | 128 +- src/devices/cpu/drcbex86.cpp | 354 +- src/devices/cpu/drcbex86.h | 132 +- src/devices/cpu/drccache.cpp | 2 +- src/devices/cpu/drccache.h | 4 +- src/devices/cpu/drcfe.cpp | 14 +- src/devices/cpu/drcfe.h | 86 +- src/devices/cpu/drcuml.cpp | 88 +- src/devices/cpu/drcuml.h | 44 +- src/devices/cpu/dsp16/dsp16.cpp | 34 +- src/devices/cpu/dsp16/dsp16.h | 114 +- src/devices/cpu/dsp16/dsp16dis.cpp | 180 +- src/devices/cpu/dsp16/dsp16ops.hxx | 260 +- src/devices/cpu/dsp32/dsp32.cpp | 50 +- src/devices/cpu/dsp32/dsp32.h | 464 +-- src/devices/cpu/dsp32/dsp32dis.cpp | 74 +- src/devices/cpu/dsp32/dsp32ops.hxx | 534 +-- src/devices/cpu/dsp56k/dsp56dsm.cpp | 4 +- src/devices/cpu/dsp56k/dsp56k.cpp | 12 +- src/devices/cpu/dsp56k/dsp56k.h | 116 +- src/devices/cpu/dsp56k/dsp56mem.cpp | 156 +- src/devices/cpu/dsp56k/dsp56mem.h | 218 +- src/devices/cpu/dsp56k/dsp56ops.hxx | 1378 ++++---- src/devices/cpu/dsp56k/dsp56pcu.cpp | 106 +- src/devices/cpu/dsp56k/dsp56pcu.h | 90 +- src/devices/cpu/dsp56k/inst.cpp | 8 +- src/devices/cpu/dsp56k/inst.h | 624 ++-- src/devices/cpu/dsp56k/opcode.cpp | 2 +- src/devices/cpu/dsp56k/opcode.h | 6 +- src/devices/cpu/dsp56k/pmove.cpp | 6 +- src/devices/cpu/dsp56k/pmove.h | 34 +- src/devices/cpu/dsp56k/tables.cpp | 118 +- src/devices/cpu/dsp56k/tables.h | 90 +- src/devices/cpu/e0c6200/e0c6200.cpp | 2 +- src/devices/cpu/e0c6200/e0c6200.h | 84 +- src/devices/cpu/e0c6200/e0c6200d.cpp | 12 +- src/devices/cpu/e0c6200/e0c6200op.cpp | 52 +- src/devices/cpu/e0c6200/e0c6s46.cpp | 26 +- src/devices/cpu/e0c6200/e0c6s46.h | 66 +- src/devices/cpu/e132xs/32xsdasm.cpp | 178 +- src/devices/cpu/e132xs/e132xs.cpp | 448 +-- src/devices/cpu/e132xs/e132xs.h | 134 +- src/devices/cpu/es5510/es5510.cpp | 194 +- src/devices/cpu/es5510/es5510.h | 126 +- src/devices/cpu/esrip/esrip.cpp | 202 +- src/devices/cpu/esrip/esrip.h | 176 +- src/devices/cpu/esrip/esripdsm.cpp | 20 +- src/devices/cpu/f8/f8.cpp | 72 +- src/devices/cpu/f8/f8.h | 40 +- src/devices/cpu/f8/f8dasm.cpp | 32 +- src/devices/cpu/g65816/g65816.cpp | 10 +- src/devices/cpu/g65816/g65816.h | 32 +- src/devices/cpu/g65816/g65816ds.cpp | 8 +- src/devices/cpu/g65816/g65816ds.h | 2 +- src/devices/cpu/g65816/g65816op.h | 8 +- src/devices/cpu/h6280/6280dasm.cpp | 2 +- src/devices/cpu/h6280/h6280.cpp | 242 +- src/devices/cpu/h6280/h6280.h | 202 +- src/devices/cpu/h8/h8.cpp | 358 +- src/devices/cpu/h8/h8.h | 208 +- src/devices/cpu/h8/h8.lst | 124 +- src/devices/cpu/h8/h83002.cpp | 6 +- src/devices/cpu/h8/h83002.h | 6 +- src/devices/cpu/h8/h83006.cpp | 10 +- src/devices/cpu/h8/h83006.h | 12 +- src/devices/cpu/h8/h83008.cpp | 6 +- src/devices/cpu/h8/h83008.h | 6 +- src/devices/cpu/h8/h83048.cpp | 14 +- src/devices/cpu/h8/h83048.h | 16 +- src/devices/cpu/h8/h83337.cpp | 12 +- src/devices/cpu/h8/h83337.h | 14 +- src/devices/cpu/h8/h8_adc.cpp | 22 +- src/devices/cpu/h8/h8_adc.h | 26 +- src/devices/cpu/h8/h8_dma.cpp | 8 +- src/devices/cpu/h8/h8_dma.h | 22 +- src/devices/cpu/h8/h8_dtc.cpp | 12 +- src/devices/cpu/h8/h8_dtc.h | 12 +- src/devices/cpu/h8/h8_intc.cpp | 10 +- src/devices/cpu/h8/h8_intc.h | 24 +- src/devices/cpu/h8/h8_port.cpp | 12 +- src/devices/cpu/h8/h8_port.h | 12 +- src/devices/cpu/h8/h8_sci.cpp | 32 +- src/devices/cpu/h8/h8_sci.h | 8 +- src/devices/cpu/h8/h8_timer16.cpp | 50 +- src/devices/cpu/h8/h8_timer16.h | 52 +- src/devices/cpu/h8/h8_timer8.cpp | 24 +- src/devices/cpu/h8/h8_timer8.h | 18 +- src/devices/cpu/h8/h8_watchdog.cpp | 12 +- src/devices/cpu/h8/h8_watchdog.h | 10 +- src/devices/cpu/h8/h8h.cpp | 4 +- src/devices/cpu/h8/h8h.h | 8 +- src/devices/cpu/h8/h8s2000.cpp | 4 +- src/devices/cpu/h8/h8s2000.h | 4 +- src/devices/cpu/h8/h8s2245.cpp | 16 +- src/devices/cpu/h8/h8s2245.h | 18 +- src/devices/cpu/h8/h8s2320.cpp | 24 +- src/devices/cpu/h8/h8s2320.h | 26 +- src/devices/cpu/h8/h8s2357.cpp | 18 +- src/devices/cpu/h8/h8s2357.h | 18 +- src/devices/cpu/h8/h8s2600.cpp | 4 +- src/devices/cpu/h8/h8s2600.h | 4 +- src/devices/cpu/h8/h8s2655.cpp | 10 +- src/devices/cpu/h8/h8s2655.h | 10 +- src/devices/cpu/hcd62121/hcd62121.cpp | 40 +- src/devices/cpu/hcd62121/hcd62121.h | 60 +- src/devices/cpu/hcd62121/hcd62121_ops.h | 160 +- src/devices/cpu/hcd62121/hcd62121d.cpp | 10 +- src/devices/cpu/hd61700/hd61700.cpp | 652 ++-- src/devices/cpu/hd61700/hd61700.h | 68 +- src/devices/cpu/hd61700/hd61700d.cpp | 26 +- src/devices/cpu/hmcs40/hmcs40.cpp | 54 +- src/devices/cpu/hmcs40/hmcs40.h | 120 +- src/devices/cpu/hmcs40/hmcs40d.cpp | 16 +- src/devices/cpu/hmcs40/hmcs40op.cpp | 28 +- src/devices/cpu/hphybrid/hphybrid.cpp | 208 +- src/devices/cpu/hphybrid/hphybrid.h | 142 +- src/devices/cpu/hphybrid/hphybrid_dasm.cpp | 38 +- src/devices/cpu/i386/cycles.h | 2 +- src/devices/cpu/i386/i386.cpp | 288 +- src/devices/cpu/i386/i386.h | 702 ++-- src/devices/cpu/i386/i386dasm.cpp | 122 +- src/devices/cpu/i386/i386op16.hxx | 860 ++--- src/devices/cpu/i386/i386op32.hxx | 872 ++--- src/devices/cpu/i386/i386ops.hxx | 574 ++-- src/devices/cpu/i386/i386priv.h | 346 +- src/devices/cpu/i386/i486ops.hxx | 94 +- src/devices/cpu/i386/pentops.hxx | 1706 +++++----- src/devices/cpu/i386/x87ops.hxx | 514 +-- src/devices/cpu/i4004/4004dasm.cpp | 6 +- src/devices/cpu/i4004/i4004.cpp | 70 +- src/devices/cpu/i4004/i4004.h | 48 +- src/devices/cpu/i8008/8008dasm.cpp | 4 +- src/devices/cpu/i8008/i8008.cpp | 46 +- src/devices/cpu/i8008/i8008.h | 46 +- src/devices/cpu/i8085/8085dasm.cpp | 4 +- src/devices/cpu/i8085/i8085.cpp | 36 +- src/devices/cpu/i8085/i8085.h | 80 +- src/devices/cpu/i8085/i8085cpu.h | 8 +- src/devices/cpu/i8089/i8089.cpp | 24 +- src/devices/cpu/i8089/i8089.h | 24 +- src/devices/cpu/i8089/i8089_channel.cpp | 52 +- src/devices/cpu/i8089/i8089_channel.h | 74 +- src/devices/cpu/i8089/i8089_dasm.cpp | 62 +- src/devices/cpu/i8089/i8089_ops.cpp | 86 +- src/devices/cpu/i86/i186.cpp | 86 +- src/devices/cpu/i86/i186.h | 80 +- src/devices/cpu/i86/i286.cpp | 218 +- src/devices/cpu/i86/i286.h | 70 +- src/devices/cpu/i86/i86.cpp | 174 +- src/devices/cpu/i86/i86.h | 206 +- src/devices/cpu/i86/i86inline.h | 196 +- src/devices/cpu/i860/i860.cpp | 4 +- src/devices/cpu/i860/i860.h | 186 +- src/devices/cpu/i860/i860dasm.cpp | 148 +- src/devices/cpu/i860/i860dec.hxx | 920 ++--- src/devices/cpu/i860/i860dis.cpp | 74 +- src/devices/cpu/i960/i960.cpp | 182 +- src/devices/cpu/i960/i960.h | 100 +- src/devices/cpu/i960/i960dis.h | 4 +- src/devices/cpu/ie15/ie15.cpp | 44 +- src/devices/cpu/ie15/ie15.h | 42 +- src/devices/cpu/ie15/ie15dasm.cpp | 4 +- src/devices/cpu/jaguar/jagdasm.cpp | 12 +- src/devices/cpu/jaguar/jaguar.cpp | 466 +-- src/devices/cpu/jaguar/jaguar.h | 190 +- src/devices/cpu/lc8670/lc8670.cpp | 204 +- src/devices/cpu/lc8670/lc8670.h | 86 +- src/devices/cpu/lc8670/lc8670dsm.cpp | 6 +- src/devices/cpu/lh5801/5801dasm.cpp | 2 +- src/devices/cpu/lh5801/5801tbl.hxx | 60 +- src/devices/cpu/lh5801/lh5801.cpp | 4 +- src/devices/cpu/lh5801/lh5801.h | 64 +- src/devices/cpu/lr35902/lr35902.cpp | 26 +- src/devices/cpu/lr35902/lr35902.h | 68 +- src/devices/cpu/lr35902/lr35902d.cpp | 12 +- src/devices/cpu/lr35902/opc_cb.hxx | 94 +- src/devices/cpu/lr35902/opc_main.hxx | 152 +- src/devices/cpu/m37710/m37710.cpp | 28 +- src/devices/cpu/m37710/m37710.h | 242 +- src/devices/cpu/m37710/m37710il.h | 96 +- src/devices/cpu/m37710/m37710op.h | 16 +- src/devices/cpu/m37710/m7700ds.cpp | 10 +- src/devices/cpu/m37710/m7700ds.h | 2 +- src/devices/cpu/m6502/deco16.cpp | 4 +- src/devices/cpu/m6502/deco16.h | 4 +- src/devices/cpu/m6502/m3745x.cpp | 16 +- src/devices/cpu/m6502/m3745x.h | 20 +- src/devices/cpu/m6502/m4510.cpp | 16 +- src/devices/cpu/m6502/m4510.h | 22 +- src/devices/cpu/m6502/m5074x.cpp | 18 +- src/devices/cpu/m6502/m5074x.h | 26 +- src/devices/cpu/m6502/m6502.cpp | 128 +- src/devices/cpu/m6502/m6502.h | 112 +- src/devices/cpu/m6502/m6504.cpp | 14 +- src/devices/cpu/m6502/m6504.h | 14 +- src/devices/cpu/m6502/m6507.cpp | 14 +- src/devices/cpu/m6502/m6507.h | 14 +- src/devices/cpu/m6502/m6509.cpp | 32 +- src/devices/cpu/m6502/m6509.h | 36 +- src/devices/cpu/m6502/m6510.cpp | 40 +- src/devices/cpu/m6502/m6510.h | 32 +- src/devices/cpu/m6502/m6510t.cpp | 2 +- src/devices/cpu/m6502/m6510t.h | 2 +- src/devices/cpu/m6502/m65c02.cpp | 6 +- src/devices/cpu/m6502/m65c02.h | 6 +- src/devices/cpu/m6502/m65ce02.cpp | 6 +- src/devices/cpu/m6502/m65ce02.h | 12 +- src/devices/cpu/m6502/m65sc02.cpp | 2 +- src/devices/cpu/m6502/m65sc02.h | 2 +- src/devices/cpu/m6502/m740.cpp | 60 +- src/devices/cpu/m6502/m740.h | 28 +- src/devices/cpu/m6502/m7501.cpp | 2 +- src/devices/cpu/m6502/m7501.h | 2 +- src/devices/cpu/m6502/m8502.cpp | 2 +- src/devices/cpu/m6502/m8502.h | 2 +- src/devices/cpu/m6502/n2a03.cpp | 20 +- src/devices/cpu/m6502/n2a03.h | 20 +- src/devices/cpu/m6502/om6502.lst | 102 +- src/devices/cpu/m6502/om65c02.lst | 18 +- src/devices/cpu/m6502/om65ce02.lst | 64 +- src/devices/cpu/m6502/om740.lst | 28 +- src/devices/cpu/m6502/on2a03.lst | 8 +- src/devices/cpu/m6502/r65c02.cpp | 6 +- src/devices/cpu/m6502/r65c02.h | 6 +- src/devices/cpu/m6800/6800dasm.cpp | 10 +- src/devices/cpu/m6800/6800ops.hxx | 304 +- src/devices/cpu/m6800/m6800.cpp | 94 +- src/devices/cpu/m6800/m6800.h | 128 +- src/devices/cpu/m68000/m68000.h | 498 +-- src/devices/cpu/m68000/m68k_in.cpp | 2634 +++++++-------- src/devices/cpu/m68000/m68kcpu.cpp | 208 +- src/devices/cpu/m68000/m68kcpu.h | 402 +-- src/devices/cpu/m68000/m68kdasm.cpp | 272 +- src/devices/cpu/m68000/m68kfpu.hxx | 376 +-- src/devices/cpu/m68000/m68kmmu.h | 110 +- src/devices/cpu/m6805/6805dasm.cpp | 8 +- src/devices/cpu/m6805/6805ops.hxx | 222 +- src/devices/cpu/m6805/m6805.cpp | 46 +- src/devices/cpu/m6805/m6805.h | 58 +- src/devices/cpu/m6809/6309dasm.cpp | 28 +- src/devices/cpu/m6809/6809dasm.cpp | 24 +- src/devices/cpu/m6809/base6x09.ops | 56 +- src/devices/cpu/m6809/hd6309.cpp | 92 +- src/devices/cpu/m6809/hd6309.h | 32 +- src/devices/cpu/m6809/hd6309.ops | 44 +- src/devices/cpu/m6809/konami.cpp | 44 +- src/devices/cpu/m6809/konami.h | 26 +- src/devices/cpu/m6809/konami.ops | 32 +- src/devices/cpu/m6809/m6809.cpp | 40 +- src/devices/cpu/m6809/m6809.h | 120 +- src/devices/cpu/m6809/m6809.ops | 16 +- src/devices/cpu/m6809/m6809inl.h | 32 +- src/devices/cpu/mb86233/mb86233.cpp | 158 +- src/devices/cpu/mb86233/mb86233.h | 64 +- src/devices/cpu/mb86233/mb86233d.cpp | 62 +- src/devices/cpu/mb86235/mb86235.cpp | 6 +- src/devices/cpu/mb86235/mb86235.h | 18 +- src/devices/cpu/mb86235/mb86235d.cpp | 38 +- src/devices/cpu/mb88xx/mb88dasm.cpp | 4 +- src/devices/cpu/mb88xx/mb88xx.cpp | 22 +- src/devices/cpu/mb88xx/mb88xx.h | 84 +- src/devices/cpu/mc68hc11/hc11dasm.cpp | 24 +- src/devices/cpu/mc68hc11/hc11ops.hxx | 1044 +++--- src/devices/cpu/mc68hc11/mc68hc11.cpp | 34 +- src/devices/cpu/mc68hc11/mc68hc11.h | 86 +- src/devices/cpu/mcs48/mcs48.cpp | 124 +- src/devices/cpu/mcs48/mcs48.h | 148 +- src/devices/cpu/mcs48/mcs48dsm.cpp | 6 +- src/devices/cpu/mcs51/mcs51.cpp | 190 +- src/devices/cpu/mcs51/mcs51.h | 382 +-- src/devices/cpu/mcs51/mcs51dasm.cpp | 18 +- src/devices/cpu/mcs51/mcs51ops.hxx | 302 +- src/devices/cpu/mcs96/i8x9x.cpp | 52 +- src/devices/cpu/mcs96/i8x9x.h | 48 +- src/devices/cpu/mcs96/i8xc196.cpp | 16 +- src/devices/cpu/mcs96/i8xc196.h | 12 +- src/devices/cpu/mcs96/mcs96.cpp | 128 +- src/devices/cpu/mcs96/mcs96.h | 78 +- src/devices/cpu/mcs96/mcs96ops.lst | 164 +- src/devices/cpu/melps4/m58846.cpp | 6 +- src/devices/cpu/melps4/m58846.h | 6 +- src/devices/cpu/melps4/melps4.cpp | 6 +- src/devices/cpu/melps4/melps4.h | 98 +- src/devices/cpu/melps4/melps4d.cpp | 18 +- src/devices/cpu/melps4/melps4op.cpp | 28 +- src/devices/cpu/minx/minx.cpp | 16 +- src/devices/cpu/minx/minx.h | 122 +- src/devices/cpu/minx/minxd.cpp | 14 +- src/devices/cpu/minx/minxfunc.h | 158 +- src/devices/cpu/minx/minxopce.h | 66 +- src/devices/cpu/minx/minxopcf.h | 18 +- src/devices/cpu/minx/minxops.h | 76 +- src/devices/cpu/mips/mips3.cpp | 522 +-- src/devices/cpu/mips/mips3.h | 304 +- src/devices/cpu/mips/mips3com.cpp | 60 +- src/devices/cpu/mips/mips3com.h | 6 +- src/devices/cpu/mips/mips3drc.cpp | 178 +- src/devices/cpu/mips/mips3dsm.cpp | 84 +- src/devices/cpu/mips/mips3fe.cpp | 18 +- src/devices/cpu/mips/r3000.cpp | 184 +- src/devices/cpu/mips/r3000.h | 134 +- src/devices/cpu/mips/r3kdasm.cpp | 56 +- src/devices/cpu/mn10200/mn10200.cpp | 136 +- src/devices/cpu/mn10200/mn10200.h | 114 +- src/devices/cpu/mn10200/mn102dis.cpp | 112 +- src/devices/cpu/nec/nec.cpp | 36 +- src/devices/cpu/nec/nec.h | 142 +- src/devices/cpu/nec/necdasm.cpp | 78 +- src/devices/cpu/nec/necea.h | 48 +- src/devices/cpu/nec/necinstr.hxx | 132 +- src/devices/cpu/nec/necmacro.h | 42 +- src/devices/cpu/nec/necmodrm.h | 16 +- src/devices/cpu/nec/necpriv.h | 10 +- src/devices/cpu/nec/v25.cpp | 36 +- src/devices/cpu/nec/v25.h | 172 +- src/devices/cpu/nec/v25instr.hxx | 2 +- src/devices/cpu/nec/v25priv.h | 10 +- src/devices/cpu/nec/v25sfr.cpp | 24 +- src/devices/cpu/nec/v53.cpp | 14 +- src/devices/cpu/nec/v53.h | 22 +- src/devices/cpu/patinhofeio/patinho_feio.cpp | 16 +- src/devices/cpu/patinhofeio/patinhofeio_cpu.h | 26 +- src/devices/cpu/pdp1/pdp1.cpp | 6 +- src/devices/cpu/pdp1/pdp1.h | 28 +- src/devices/cpu/pdp1/tx0.cpp | 10 +- src/devices/cpu/pdp1/tx0.h | 22 +- src/devices/cpu/pdp8/pdp8.cpp | 16 +- src/devices/cpu/pdp8/pdp8.h | 28 +- src/devices/cpu/pdp8/pdp8dasm.cpp | 14 +- src/devices/cpu/pic16c5x/16c5xdsm.cpp | 8 +- src/devices/cpu/pic16c5x/pic16c5x.cpp | 80 +- src/devices/cpu/pic16c5x/pic16c5x.h | 80 +- src/devices/cpu/pic16c62x/16c62xdsm.cpp | 8 +- src/devices/cpu/pic16c62x/pic16c62x.cpp | 76 +- src/devices/cpu/pic16c62x/pic16c62x.h | 82 +- src/devices/cpu/powerpc/ppc.h | 420 +-- src/devices/cpu/powerpc/ppc_dasm.cpp | 30 +- src/devices/cpu/powerpc/ppccom.cpp | 222 +- src/devices/cpu/powerpc/ppccom.h | 10 +- src/devices/cpu/powerpc/ppcdrc.cpp | 154 +- src/devices/cpu/powerpc/ppcfe.cpp | 24 +- src/devices/cpu/powerpc/ppcfe.h | 12 +- src/devices/cpu/pps4/pps4.cpp | 50 +- src/devices/cpu/pps4/pps4.h | 52 +- src/devices/cpu/pps4/pps4dasm.cpp | 26 +- src/devices/cpu/psx/dismips.cpp | 86 +- src/devices/cpu/psx/dma.cpp | 24 +- src/devices/cpu/psx/dma.h | 24 +- src/devices/cpu/psx/gte.cpp | 262 +- src/devices/cpu/psx/gte.h | 66 +- src/devices/cpu/psx/irq.cpp | 4 +- src/devices/cpu/psx/irq.h | 8 +- src/devices/cpu/psx/mdec.cpp | 138 +- src/devices/cpu/psx/mdec.h | 66 +- src/devices/cpu/psx/psx.cpp | 202 +- src/devices/cpu/psx/psx.h | 158 +- src/devices/cpu/psx/psxdasm.cpp | 30 +- src/devices/cpu/psx/rcnt.cpp | 10 +- src/devices/cpu/psx/rcnt.h | 14 +- src/devices/cpu/psx/sio.cpp | 8 +- src/devices/cpu/psx/sio.h | 26 +- src/devices/cpu/rsp/rsp.cpp | 138 +- src/devices/cpu/rsp/rsp.h | 112 +- src/devices/cpu/rsp/rsp_dasm.cpp | 42 +- src/devices/cpu/rsp/rspcp2.cpp | 656 ++-- src/devices/cpu/rsp/rspcp2.h | 124 +- src/devices/cpu/rsp/rspcp2d.cpp | 484 +-- src/devices/cpu/rsp/rspdiv.h | 2 +- src/devices/cpu/rsp/rspdrc.cpp | 42 +- src/devices/cpu/rsp/rspfe.cpp | 12 +- src/devices/cpu/rsp/rspfe.h | 10 +- src/devices/cpu/rsp/vand.h | 2 +- src/devices/cpu/rsp/vcmp.h | 2 +- src/devices/cpu/rsp/vdivh.h | 2 +- src/devices/cpu/rsp/vldst.h | 26 +- src/devices/cpu/rsp/vmac.h | 2 +- src/devices/cpu/rsp/vmov.h | 2 +- src/devices/cpu/rsp/vmul.h | 2 +- src/devices/cpu/rsp/vmulh.h | 2 +- src/devices/cpu/rsp/vmull.h | 2 +- src/devices/cpu/rsp/vmulm.h | 2 +- src/devices/cpu/rsp/vmuln.h | 2 +- src/devices/cpu/rsp/vor.h | 2 +- src/devices/cpu/rsp/vrcpsq.h | 20 +- src/devices/cpu/rsp/vrsq.h | 24 +- src/devices/cpu/rsp/vxor.h | 2 +- src/devices/cpu/s2650/2650dasm.cpp | 4 +- src/devices/cpu/s2650/s2650.cpp | 72 +- src/devices/cpu/s2650/s2650.h | 52 +- src/devices/cpu/saturn/satops.hxx | 36 +- src/devices/cpu/saturn/saturn.cpp | 12 +- src/devices/cpu/saturn/saturn.h | 68 +- src/devices/cpu/saturn/saturnds.cpp | 4 +- src/devices/cpu/sc61860/sc61860.cpp | 6 +- src/devices/cpu/sc61860/sc61860.h | 70 +- src/devices/cpu/sc61860/scdasm.cpp | 4 +- src/devices/cpu/sc61860/scops.hxx | 88 +- src/devices/cpu/scmp/scmp.cpp | 72 +- src/devices/cpu/scmp/scmp.h | 46 +- src/devices/cpu/scmp/scmpdasm.cpp | 6 +- src/devices/cpu/score/score.cpp | 192 +- src/devices/cpu/score/score.h | 56 +- src/devices/cpu/score/scoredsm.cpp | 22 +- src/devices/cpu/score/scorem.h | 6 +- src/devices/cpu/scudsp/scudsp.cpp | 98 +- src/devices/cpu/scudsp/scudsp.h | 82 +- src/devices/cpu/scudsp/scudspdasm.cpp | 6 +- src/devices/cpu/se3208/se3208.cpp | 424 +-- src/devices/cpu/se3208/se3208.h | 226 +- src/devices/cpu/se3208/se3208dis.cpp | 356 +- src/devices/cpu/sh2/sh2.cpp | 544 +-- src/devices/cpu/sh2/sh2.h | 500 +-- src/devices/cpu/sh2/sh2comn.cpp | 42 +- src/devices/cpu/sh2/sh2dasm.cpp | 46 +- src/devices/cpu/sh2/sh2drc.cpp | 186 +- src/devices/cpu/sh2/sh2fe.cpp | 26 +- src/devices/cpu/sh2/sh7604_bus.cpp | 2 +- src/devices/cpu/sh2/sh7604_bus.h | 14 +- src/devices/cpu/sh2/sh7604_sci.cpp | 2 +- src/devices/cpu/sh2/sh7604_sci.h | 10 +- src/devices/cpu/sh2/sh7604_wdt.cpp | 4 +- src/devices/cpu/sh2/sh7604_wdt.h | 2 +- src/devices/cpu/sh4/sh3comn.cpp | 4 +- src/devices/cpu/sh4/sh4.cpp | 868 ++--- src/devices/cpu/sh4/sh4.h | 758 ++--- src/devices/cpu/sh4/sh4comn.cpp | 40 +- src/devices/cpu/sh4/sh4comn.h | 36 +- src/devices/cpu/sh4/sh4dasm.cpp | 50 +- src/devices/cpu/sh4/sh4dmac.cpp | 96 +- src/devices/cpu/sh4/sh4dmac.h | 68 +- src/devices/cpu/sh4/sh4tmu.cpp | 66 +- src/devices/cpu/sharc/compute.hxx | 162 +- src/devices/cpu/sharc/sharc.cpp | 60 +- src/devices/cpu/sharc/sharc.h | 306 +- src/devices/cpu/sharc/sharcdma.hxx | 50 +- src/devices/cpu/sharc/sharcdrc.cpp | 64 +- src/devices/cpu/sharc/sharcdsm.cpp | 92 +- src/devices/cpu/sharc/sharcdsm.h | 6 +- src/devices/cpu/sharc/sharcfe.cpp | 58 +- src/devices/cpu/sharc/sharcfe.h | 26 +- src/devices/cpu/sharc/sharcmem.hxx | 106 +- src/devices/cpu/sharc/sharcops.hxx | 172 +- src/devices/cpu/sm510/kb1013vk1-2.h | 4 +- src/devices/cpu/sm510/kb1013vk1-2core.cpp | 4 +- src/devices/cpu/sm510/sm500.h | 6 +- src/devices/cpu/sm510/sm500core.cpp | 6 +- src/devices/cpu/sm510/sm510.cpp | 16 +- src/devices/cpu/sm510/sm510.h | 78 +- src/devices/cpu/sm510/sm510core.cpp | 4 +- src/devices/cpu/sm510/sm510d.cpp | 38 +- src/devices/cpu/sm510/sm510op.cpp | 22 +- src/devices/cpu/sm510/sm511core.cpp | 8 +- src/devices/cpu/sm8500/sm8500.cpp | 24 +- src/devices/cpu/sm8500/sm8500.h | 70 +- src/devices/cpu/sm8500/sm8500d.cpp | 24 +- src/devices/cpu/sm8500/sm85ops.h | 10 +- src/devices/cpu/sparc/mb86901.cpp | 198 +- src/devices/cpu/sparc/sparc.h | 148 +- src/devices/cpu/sparc/sparcdasm.cpp | 58 +- src/devices/cpu/sparc/sparcdasm.h | 70 +- src/devices/cpu/sparc/sparcdefs.h | 18 +- src/devices/cpu/sparc/sparcv8ops.ipp | 46 +- src/devices/cpu/sparc/ss1fcode.ipp | 194 +- src/devices/cpu/spc700/spc700.cpp | 86 +- src/devices/cpu/spc700/spc700.h | 132 +- src/devices/cpu/spc700/spc700ds.cpp | 4 +- src/devices/cpu/ssem/ssem.cpp | 32 +- src/devices/cpu/ssem/ssem.h | 26 +- src/devices/cpu/ssem/ssemdasm.cpp | 16 +- src/devices/cpu/ssp1601/ssp1601.cpp | 42 +- src/devices/cpu/ssp1601/ssp1601.h | 52 +- src/devices/cpu/ssp1601/ssp1601d.cpp | 6 +- src/devices/cpu/superfx/sfx_dasm.cpp | 26 +- src/devices/cpu/superfx/superfx.cpp | 176 +- src/devices/cpu/superfx/superfx.h | 134 +- src/devices/cpu/t11/t11.cpp | 16 +- src/devices/cpu/t11/t11.h | 2110 ++++++------ src/devices/cpu/t11/t11dasm.cpp | 38 +- src/devices/cpu/t11/t11ops.hxx | 2164 ++++++------ src/devices/cpu/tlcs90/tlcs90.cpp | 156 +- src/devices/cpu/tlcs90/tlcs90.h | 104 +- src/devices/cpu/tlcs900/900tbl.hxx | 374 +-- src/devices/cpu/tlcs900/dasm900.cpp | 20 +- src/devices/cpu/tlcs900/tlcs900.cpp | 36 +- src/devices/cpu/tlcs900/tlcs900.h | 186 +- src/devices/cpu/tms1000/tms0270.cpp | 6 +- src/devices/cpu/tms1000/tms0270.h | 20 +- src/devices/cpu/tms1000/tms0970.cpp | 24 +- src/devices/cpu/tms1000/tms0970.h | 10 +- src/devices/cpu/tms1000/tms0980.cpp | 40 +- src/devices/cpu/tms1000/tms0980.h | 24 +- src/devices/cpu/tms1000/tms1000.cpp | 24 +- src/devices/cpu/tms1000/tms1000.h | 16 +- src/devices/cpu/tms1000/tms1100.cpp | 12 +- src/devices/cpu/tms1000/tms1100.h | 12 +- src/devices/cpu/tms1000/tms1400.cpp | 12 +- src/devices/cpu/tms1000/tms1400.h | 12 +- src/devices/cpu/tms1000/tms1k_base.cpp | 6 +- src/devices/cpu/tms1000/tms1k_base.h | 118 +- src/devices/cpu/tms1000/tms1k_dasm.cpp | 24 +- src/devices/cpu/tms1000/tp0320.cpp | 12 +- src/devices/cpu/tms1000/tp0320.h | 8 +- src/devices/cpu/tms32010/32010dsm.cpp | 4 +- src/devices/cpu/tms32010/tms32010.cpp | 70 +- src/devices/cpu/tms32010/tms32010.h | 60 +- src/devices/cpu/tms32025/32025dsm.cpp | 4 +- src/devices/cpu/tms32025/tms32025.cpp | 176 +- src/devices/cpu/tms32025/tms32025.h | 86 +- src/devices/cpu/tms32031/32031ops.hxx | 2436 +++++++------- src/devices/cpu/tms32031/dis32031.cpp | 48 +- src/devices/cpu/tms32031/tms32031.cpp | 66 +- src/devices/cpu/tms32031/tms32031.h | 1130 +++---- src/devices/cpu/tms32051/32051ops.hxx | 370 +-- src/devices/cpu/tms32051/dis32051.cpp | 14 +- src/devices/cpu/tms32051/tms32051.cpp | 32 +- src/devices/cpu/tms32051/tms32051.h | 166 +- src/devices/cpu/tms32082/dis_mp.cpp | 22 +- src/devices/cpu/tms32082/dis_pp.cpp | 22 +- src/devices/cpu/tms32082/mp_ops.cpp | 362 +- src/devices/cpu/tms32082/tms32082.cpp | 66 +- src/devices/cpu/tms32082/tms32082.h | 78 +- src/devices/cpu/tms34010/34010dsm.cpp | 74 +- src/devices/cpu/tms34010/34010fld.hxx | 376 +-- src/devices/cpu/tms34010/34010gfx.hxx | 144 +- src/devices/cpu/tms34010/34010ops.h | 48 +- src/devices/cpu/tms34010/34010ops.hxx | 1110 +++---- src/devices/cpu/tms34010/dis34010.cpp | 8 +- src/devices/cpu/tms34010/tms34010.cpp | 220 +- src/devices/cpu/tms34010/tms34010.h | 1240 +++---- src/devices/cpu/tms57002/57002dsm.cpp | 6 +- src/devices/cpu/tms57002/tms57002.cpp | 150 +- src/devices/cpu/tms57002/tms57002.h | 104 +- src/devices/cpu/tms57002/tms57kdec.cpp | 30 +- src/devices/cpu/tms57002/tmsinstr.lst | 46 +- src/devices/cpu/tms57002/tmsmake.py | 2 +- src/devices/cpu/tms7000/7000dasm.cpp | 24 +- src/devices/cpu/tms7000/tms7000.cpp | 32 +- src/devices/cpu/tms7000/tms7000.h | 164 +- src/devices/cpu/tms7000/tms7000op.cpp | 202 +- src/devices/cpu/tms9900/9900dasm.cpp | 8 +- src/devices/cpu/tms9900/99xxcore.h | 328 +- src/devices/cpu/tms9900/ti990_10.cpp | 14 +- src/devices/cpu/tms9900/ti990_10.h | 22 +- src/devices/cpu/tms9900/tms9900.cpp | 110 +- src/devices/cpu/tms9900/tms9900.h | 66 +- src/devices/cpu/tms9900/tms9980a.cpp | 22 +- src/devices/cpu/tms9900/tms9980a.h | 18 +- src/devices/cpu/tms9900/tms9995.cpp | 124 +- src/devices/cpu/tms9900/tms9995.h | 82 +- src/devices/cpu/ucom4/ucom4.cpp | 20 +- src/devices/cpu/ucom4/ucom4.h | 76 +- src/devices/cpu/ucom4/ucom4d.cpp | 14 +- src/devices/cpu/ucom4/ucom4op.cpp | 34 +- src/devices/cpu/uml.cpp | 90 +- src/devices/cpu/uml.h | 88 +- src/devices/cpu/unsp/unsp.cpp | 62 +- src/devices/cpu/unsp/unsp.h | 44 +- src/devices/cpu/unsp/unspdasm.cpp | 4 +- src/devices/cpu/upd7725/dasm7725.cpp | 28 +- src/devices/cpu/upd7725/upd7725.cpp | 66 +- src/devices/cpu/upd7725/upd7725.h | 70 +- src/devices/cpu/upd7810/upd7810.cpp | 34 +- src/devices/cpu/upd7810/upd7810.h | 172 +- src/devices/cpu/upd7810/upd7810_dasm.cpp | 16 +- src/devices/cpu/upd7810/upd7810_opcodes.cpp | 1340 ++++---- src/devices/cpu/v30mz/v30mz.cpp | 374 +-- src/devices/cpu/v30mz/v30mz.h | 174 +- src/devices/cpu/v60/am.hxx | 10 +- src/devices/cpu/v60/am1.hxx | 348 +- src/devices/cpu/v60/am2.hxx | 328 +- src/devices/cpu/v60/am3.hxx | 218 +- src/devices/cpu/v60/op12.hxx | 612 ++-- src/devices/cpu/v60/op2.hxx | 56 +- src/devices/cpu/v60/op3.hxx | 178 +- src/devices/cpu/v60/op4.hxx | 124 +- src/devices/cpu/v60/op5.hxx | 20 +- src/devices/cpu/v60/op6.hxx | 72 +- src/devices/cpu/v60/op7a.hxx | 278 +- src/devices/cpu/v60/v60.cpp | 54 +- src/devices/cpu/v60/v60.h | 1208 +++---- src/devices/cpu/v60/v60d.cpp | 2 +- src/devices/cpu/v810/v810.cpp | 330 +- src/devices/cpu/v810/v810.h | 162 +- src/devices/cpu/v810/v810dasm.cpp | 4 +- src/devices/cpu/x86emit.h | 3504 ++++++++++---------- src/devices/cpu/x86log.cpp | 8 +- src/devices/cpu/z180/z180.cpp | 40 +- src/devices/cpu/z180/z180.h | 106 +- src/devices/cpu/z180/z180dasm.cpp | 22 +- src/devices/cpu/z180/z180ed.hxx | 2 +- src/devices/cpu/z180/z180ops.h | 112 +- src/devices/cpu/z180/z180tbl.h | 22 +- src/devices/cpu/z8/z8.cpp | 64 +- src/devices/cpu/z8/z8.h | 128 +- src/devices/cpu/z8/z8dasm.cpp | 8 +- src/devices/cpu/z8/z8ops.hxx | 246 +- src/devices/cpu/z80/kl5c80a12.cpp | 2 +- src/devices/cpu/z80/kl5c80a12.h | 2 +- src/devices/cpu/z80/tmpz84c011.cpp | 2 +- src/devices/cpu/z80/tmpz84c011.h | 6 +- src/devices/cpu/z80/tmpz84c015.cpp | 4 +- src/devices/cpu/z80/tmpz84c015.h | 4 +- src/devices/cpu/z80/z80.cpp | 210 +- src/devices/cpu/z80/z80.h | 138 +- src/devices/cpu/z80/z80daisy.h | 4 +- src/devices/cpu/z80/z80dasm.cpp | 22 +- src/devices/cpu/z8000/8000dasm.cpp | 12 +- src/devices/cpu/z8000/makedab.cpp | 2 +- src/devices/cpu/z8000/z8000.cpp | 92 +- src/devices/cpu/z8000/z8000.h | 260 +- src/devices/cpu/z8000/z8000cpu.h | 44 +- src/devices/cpu/z8000/z8000dab.h | 2 +- src/devices/cpu/z8000/z8000ops.hxx | 506 +-- src/devices/imagedev/bitbngr.cpp | 6 +- src/devices/imagedev/bitbngr.h | 6 +- src/devices/imagedev/cassette.cpp | 6 +- src/devices/imagedev/cassette.h | 4 +- src/devices/imagedev/chd_cd.cpp | 4 +- src/devices/imagedev/chd_cd.h | 4 +- src/devices/imagedev/diablo.cpp | 10 +- src/devices/imagedev/diablo.h | 2 +- src/devices/imagedev/flopdrv.cpp | 10 +- src/devices/imagedev/flopdrv.h | 14 +- src/devices/imagedev/floppy.cpp | 176 +- src/devices/imagedev/floppy.h | 30 +- src/devices/imagedev/harddriv.cpp | 10 +- src/devices/imagedev/harddriv.h | 4 +- src/devices/imagedev/mfmhd.cpp | 34 +- src/devices/imagedev/mfmhd.h | 24 +- src/devices/imagedev/midiin.cpp | 6 +- src/devices/imagedev/midiin.h | 6 +- src/devices/imagedev/midiout.cpp | 4 +- src/devices/imagedev/midiout.h | 4 +- src/devices/imagedev/printer.cpp | 4 +- src/devices/imagedev/printer.h | 4 +- src/devices/imagedev/snapquik.cpp | 6 +- src/devices/imagedev/snapquik.h | 6 +- src/devices/machine/40105.cpp | 8 +- src/devices/machine/40105.h | 12 +- src/devices/machine/53c7xx.cpp | 20 +- src/devices/machine/53c7xx.h | 58 +- src/devices/machine/53c810.cpp | 52 +- src/devices/machine/53c810.h | 80 +- src/devices/machine/64h156.cpp | 2 +- src/devices/machine/64h156.h | 12 +- src/devices/machine/6522via.cpp | 18 +- src/devices/machine/6522via.h | 60 +- src/devices/machine/6525tpi.cpp | 18 +- src/devices/machine/6525tpi.h | 24 +- src/devices/machine/6532riot.cpp | 30 +- src/devices/machine/6532riot.h | 40 +- src/devices/machine/6821pia.cpp | 76 +- src/devices/machine/6821pia.h | 98 +- src/devices/machine/68230pit.cpp | 110 +- src/devices/machine/68230pit.h | 128 +- src/devices/machine/68307.cpp | 18 +- src/devices/machine/68307.h | 40 +- src/devices/machine/68307bus.cpp | 2 +- src/devices/machine/68307bus.h | 2 +- src/devices/machine/68307sim.cpp | 46 +- src/devices/machine/68307sim.h | 48 +- src/devices/machine/68307tmu.cpp | 8 +- src/devices/machine/68307tmu.h | 10 +- src/devices/machine/68340.cpp | 4 +- src/devices/machine/68340.h | 12 +- src/devices/machine/68340sim.h | 4 +- src/devices/machine/6840ptm.cpp | 6 +- src/devices/machine/6840ptm.h | 42 +- src/devices/machine/6850acia.cpp | 6 +- src/devices/machine/6850acia.h | 10 +- src/devices/machine/68561mpcc.cpp | 14 +- src/devices/machine/68561mpcc.h | 16 +- src/devices/machine/7200fifo.cpp | 8 +- src/devices/machine/7200fifo.h | 12 +- src/devices/machine/74123.cpp | 2 +- src/devices/machine/74123.h | 2 +- src/devices/machine/74145.cpp | 8 +- src/devices/machine/74145.h | 8 +- src/devices/machine/74148.cpp | 2 +- src/devices/machine/74148.h | 2 +- src/devices/machine/74153.cpp | 2 +- src/devices/machine/74153.h | 2 +- src/devices/machine/74181.cpp | 8 +- src/devices/machine/74181.h | 18 +- src/devices/machine/7474.cpp | 2 +- src/devices/machine/7474.h | 20 +- src/devices/machine/8042kbdc.cpp | 10 +- src/devices/machine/8042kbdc.h | 8 +- src/devices/machine/8530scc.cpp | 26 +- src/devices/machine/8530scc.h | 26 +- src/devices/machine/aakart.cpp | 6 +- src/devices/machine/aakart.h | 26 +- src/devices/machine/adc0808.cpp | 2 +- src/devices/machine/adc0808.h | 4 +- src/devices/machine/adc083x.cpp | 12 +- src/devices/machine/adc083x.h | 44 +- src/devices/machine/adc1038.cpp | 2 +- src/devices/machine/adc1038.h | 2 +- src/devices/machine/adc1213x.cpp | 8 +- src/devices/machine/adc1213x.h | 12 +- src/devices/machine/aicartc.cpp | 6 +- src/devices/machine/aicartc.h | 8 +- src/devices/machine/akiko.cpp | 72 +- src/devices/machine/akiko.h | 56 +- src/devices/machine/am53cf96.cpp | 6 +- src/devices/machine/am53cf96.h | 16 +- src/devices/machine/am9517a.cpp | 14 +- src/devices/machine/am9517a.h | 32 +- src/devices/machine/amigafdc.cpp | 46 +- src/devices/machine/amigafdc.h | 48 +- src/devices/machine/appldriv.cpp | 16 +- src/devices/machine/appldriv.h | 10 +- src/devices/machine/applefdc.cpp | 28 +- src/devices/machine/applefdc.h | 44 +- src/devices/machine/at28c16.cpp | 12 +- src/devices/machine/at28c16.h | 4 +- src/devices/machine/at29x.cpp | 12 +- src/devices/machine/at29x.h | 12 +- src/devices/machine/at45dbxx.cpp | 40 +- src/devices/machine/at45dbxx.h | 62 +- src/devices/machine/at_keybc.cpp | 2 +- src/devices/machine/at_keybc.h | 6 +- src/devices/machine/atadev.h | 4 +- src/devices/machine/ataflash.cpp | 8 +- src/devices/machine/ataflash.h | 8 +- src/devices/machine/atahle.cpp | 24 +- src/devices/machine/atahle.h | 44 +- src/devices/machine/ataintf.cpp | 16 +- src/devices/machine/ataintf.h | 10 +- src/devices/machine/atapicdr.cpp | 6 +- src/devices/machine/atapicdr.h | 8 +- src/devices/machine/atapihle.cpp | 2 +- src/devices/machine/atapihle.h | 2 +- src/devices/machine/autoconfig.cpp | 10 +- src/devices/machine/autoconfig.h | 10 +- src/devices/machine/ay31015.cpp | 22 +- src/devices/machine/ay31015.h | 42 +- src/devices/machine/bankdev.cpp | 2 +- src/devices/machine/bankdev.h | 14 +- src/devices/machine/bcreader.cpp | 14 +- src/devices/machine/bcreader.h | 8 +- src/devices/machine/buffer.cpp | 2 +- src/devices/machine/buffer.h | 6 +- src/devices/machine/cdp1852.cpp | 2 +- src/devices/machine/cdp1852.h | 6 +- src/devices/machine/cdp1871.cpp | 6 +- src/devices/machine/cdp1871.h | 4 +- src/devices/machine/clock.cpp | 2 +- src/devices/machine/clock.h | 2 +- src/devices/machine/com8116.cpp | 6 +- src/devices/machine/com8116.h | 6 +- src/devices/machine/corvushd.cpp | 96 +- src/devices/machine/corvushd.h | 254 +- src/devices/machine/cr511b.cpp | 2 +- src/devices/machine/cr511b.h | 4 +- src/devices/machine/cr589.cpp | 6 +- src/devices/machine/cr589.h | 8 +- src/devices/machine/cs4031.cpp | 12 +- src/devices/machine/cs4031.h | 24 +- src/devices/machine/cs8221.cpp | 4 +- src/devices/machine/cs8221.h | 12 +- src/devices/machine/diablo_hd.cpp | 64 +- src/devices/machine/diablo_hd.h | 30 +- src/devices/machine/dmac.cpp | 8 +- src/devices/machine/dmac.h | 18 +- src/devices/machine/dp8390.cpp | 26 +- src/devices/machine/dp8390.h | 90 +- src/devices/machine/ds1204.cpp | 8 +- src/devices/machine/ds1204.h | 18 +- src/devices/machine/ds128x.cpp | 2 +- src/devices/machine/ds128x.h | 2 +- src/devices/machine/ds1302.cpp | 2 +- src/devices/machine/ds1302.h | 12 +- src/devices/machine/ds1315.cpp | 8 +- src/devices/machine/ds1315.h | 4 +- src/devices/machine/ds1386.cpp | 38 +- src/devices/machine/ds1386.h | 34 +- src/devices/machine/ds2401.cpp | 4 +- src/devices/machine/ds2401.h | 8 +- src/devices/machine/ds2404.cpp | 18 +- src/devices/machine/ds2404.h | 40 +- src/devices/machine/ds75160a.cpp | 4 +- src/devices/machine/ds75160a.h | 4 +- src/devices/machine/ds75161a.cpp | 2 +- src/devices/machine/ds75161a.h | 2 +- src/devices/machine/e0516.cpp | 2 +- src/devices/machine/e0516.h | 2 +- src/devices/machine/e05a03.cpp | 4 +- src/devices/machine/e05a03.h | 10 +- src/devices/machine/e05a30.cpp | 14 +- src/devices/machine/e05a30.h | 22 +- src/devices/machine/eeprom.cpp | 38 +- src/devices/machine/eeprom.h | 28 +- src/devices/machine/eeprompar.cpp | 2 +- src/devices/machine/eeprompar.h | 2 +- src/devices/machine/eepromser.cpp | 10 +- src/devices/machine/eepromser.h | 28 +- src/devices/machine/er2055.cpp | 12 +- src/devices/machine/er2055.h | 26 +- src/devices/machine/f3853.cpp | 18 +- src/devices/machine/f3853.h | 24 +- src/devices/machine/fdc37c665gt.cpp | 4 +- src/devices/machine/fdc37c665gt.h | 2 +- src/devices/machine/fga002.cpp | 114 +- src/devices/machine/fga002.h | 110 +- src/devices/machine/gayle.cpp | 8 +- src/devices/machine/gayle.h | 8 +- src/devices/machine/gen_latch.cpp | 12 +- src/devices/machine/gen_latch.h | 18 +- src/devices/machine/genpc.cpp | 8 +- src/devices/machine/genpc.h | 34 +- src/devices/machine/gt64xxx.cpp | 48 +- src/devices/machine/gt64xxx.h | 34 +- src/devices/machine/hd63450.cpp | 2 +- src/devices/machine/hd63450.h | 2 +- src/devices/machine/hd64610.cpp | 8 +- src/devices/machine/hd64610.h | 8 +- src/devices/machine/hdc92x4.cpp | 54 +- src/devices/machine/hdc92x4.h | 52 +- src/devices/machine/hp_taco.cpp | 30 +- src/devices/machine/hp_taco.h | 26 +- src/devices/machine/i2cmem.cpp | 4 +- src/devices/machine/i2cmem.h | 6 +- src/devices/machine/i6300esb.cpp | 26 +- src/devices/machine/i6300esb.h | 24 +- src/devices/machine/i80130.cpp | 4 +- src/devices/machine/i80130.h | 4 +- src/devices/machine/i8155.cpp | 16 +- src/devices/machine/i8155.h | 22 +- src/devices/machine/i8212.cpp | 2 +- src/devices/machine/i8212.h | 4 +- src/devices/machine/i8214.cpp | 8 +- src/devices/machine/i8214.h | 8 +- src/devices/machine/i82371sb.cpp | 24 +- src/devices/machine/i82371sb.h | 16 +- src/devices/machine/i8243.cpp | 2 +- src/devices/machine/i8243.h | 12 +- src/devices/machine/i82439hx.cpp | 6 +- src/devices/machine/i82439hx.h | 14 +- src/devices/machine/i8251.cpp | 12 +- src/devices/machine/i8251.h | 26 +- src/devices/machine/i82541.cpp | 2 +- src/devices/machine/i82541.h | 2 +- src/devices/machine/i8255.cpp | 46 +- src/devices/machine/i8255.h | 28 +- src/devices/machine/i8257.cpp | 6 +- src/devices/machine/i8257.h | 16 +- src/devices/machine/i8271.cpp | 22 +- src/devices/machine/i8271.h | 30 +- src/devices/machine/i8279.cpp | 40 +- src/devices/machine/i8279.h | 26 +- src/devices/machine/i82875p.cpp | 12 +- src/devices/machine/i82875p.h | 24 +- src/devices/machine/i8355.cpp | 10 +- src/devices/machine/i8355.h | 10 +- src/devices/machine/idectrl.cpp | 26 +- src/devices/machine/idectrl.h | 26 +- src/devices/machine/idehd.cpp | 20 +- src/devices/machine/idehd.h | 46 +- src/devices/machine/im6402.cpp | 2 +- src/devices/machine/im6402.h | 6 +- src/devices/machine/input_merger.cpp | 6 +- src/devices/machine/input_merger.h | 6 +- src/devices/machine/ins8154.cpp | 4 +- src/devices/machine/ins8154.h | 16 +- src/devices/machine/ins8250.cpp | 20 +- src/devices/machine/ins8250.h | 50 +- src/devices/machine/intelfsh.cpp | 84 +- src/devices/machine/intelfsh.h | 112 +- src/devices/machine/jvsdev.cpp | 36 +- src/devices/machine/jvsdev.h | 34 +- src/devices/machine/jvshost.cpp | 30 +- src/devices/machine/jvshost.h | 18 +- src/devices/machine/k033906.cpp | 6 +- src/devices/machine/k033906.h | 10 +- src/devices/machine/k053252.cpp | 2 +- src/devices/machine/k053252.h | 10 +- src/devices/machine/k056230.cpp | 2 +- src/devices/machine/k056230.h | 4 +- src/devices/machine/kb3600.cpp | 8 +- src/devices/machine/kb3600.h | 4 +- src/devices/machine/keyboard.cpp | 28 +- src/devices/machine/keyboard.h | 40 +- src/devices/machine/keyboard.ipp | 48 +- src/devices/machine/kr2376.cpp | 4 +- src/devices/machine/kr2376.h | 2 +- src/devices/machine/laserdsc.cpp | 78 +- src/devices/machine/laserdsc.h | 70 +- src/devices/machine/latch.cpp | 4 +- src/devices/machine/latch.h | 4 +- src/devices/machine/latch8.cpp | 22 +- src/devices/machine/latch8.h | 64 +- src/devices/machine/lc89510.cpp | 2 +- src/devices/machine/lc89510.h | 2 +- src/devices/machine/ldp1000.cpp | 14 +- src/devices/machine/ldp1000.h | 14 +- src/devices/machine/ldp1450.cpp | 16 +- src/devices/machine/ldp1450.h | 30 +- src/devices/machine/ldpr8210.cpp | 84 +- src/devices/machine/ldpr8210.h | 58 +- src/devices/machine/ldstub.h | 24 +- src/devices/machine/ldv1000.cpp | 28 +- src/devices/machine/ldv1000.h | 38 +- src/devices/machine/ldvp931.cpp | 18 +- src/devices/machine/ldvp931.h | 42 +- src/devices/machine/legscsi.cpp | 10 +- src/devices/machine/legscsi.h | 10 +- src/devices/machine/lh5810.cpp | 2 +- src/devices/machine/lh5810.h | 6 +- src/devices/machine/linflash.cpp | 10 +- src/devices/machine/linflash.h | 8 +- src/devices/machine/lpc-acpi.cpp | 6 +- src/devices/machine/lpc-acpi.h | 16 +- src/devices/machine/lpc-pit.cpp | 6 +- src/devices/machine/lpc-pit.h | 6 +- src/devices/machine/lpc-rtc.cpp | 10 +- src/devices/machine/lpc-rtc.h | 14 +- src/devices/machine/lpc.cpp | 2 +- src/devices/machine/lpc.h | 6 +- src/devices/machine/lpci.cpp | 10 +- src/devices/machine/lpci.h | 14 +- src/devices/machine/m6m80011ap.cpp | 2 +- src/devices/machine/m6m80011ap.h | 18 +- src/devices/machine/mb14241.cpp | 4 +- src/devices/machine/mb14241.h | 6 +- src/devices/machine/mb3773.cpp | 2 +- src/devices/machine/mb3773.h | 2 +- src/devices/machine/mb8421.cpp | 2 +- src/devices/machine/mb8421.h | 6 +- src/devices/machine/mb87078.cpp | 2 +- src/devices/machine/mb87078.h | 6 +- src/devices/machine/mb8795.cpp | 8 +- src/devices/machine/mb8795.h | 16 +- src/devices/machine/mb89352.cpp | 6 +- src/devices/machine/mb89352.h | 48 +- src/devices/machine/mb89363b.cpp | 2 +- src/devices/machine/mb89363b.h | 2 +- src/devices/machine/mb89371.cpp | 2 +- src/devices/machine/mb89371.h | 2 +- src/devices/machine/mc146818.cpp | 8 +- src/devices/machine/mc146818.h | 8 +- src/devices/machine/mc2661.cpp | 10 +- src/devices/machine/mc2661.h | 14 +- src/devices/machine/mc68328.cpp | 60 +- src/devices/machine/mc68328.h | 346 +- src/devices/machine/mc6843.cpp | 14 +- src/devices/machine/mc6843.h | 38 +- src/devices/machine/mc6846.cpp | 14 +- src/devices/machine/mc6846.h | 44 +- src/devices/machine/mc6852.cpp | 8 +- src/devices/machine/mc6852.h | 20 +- src/devices/machine/mc6854.cpp | 16 +- src/devices/machine/mc6854.h | 42 +- src/devices/machine/mc68681.cpp | 50 +- src/devices/machine/mc68681.h | 70 +- src/devices/machine/mc68901.cpp | 10 +- src/devices/machine/mc68901.h | 56 +- src/devices/machine/mccs1850.cpp | 14 +- src/devices/machine/mccs1850.h | 14 +- src/devices/machine/mcf5206e.cpp | 18 +- src/devices/machine/mcf5206e.h | 52 +- src/devices/machine/microtch.cpp | 6 +- src/devices/machine/microtch.h | 16 +- src/devices/machine/mm58167.cpp | 4 +- src/devices/machine/mm58167.h | 2 +- src/devices/machine/mm58274c.cpp | 2 +- src/devices/machine/mm58274c.h | 2 +- src/devices/machine/mm74c922.cpp | 6 +- src/devices/machine/mm74c922.h | 6 +- src/devices/machine/mos6526.cpp | 44 +- src/devices/machine/mos6526.h | 66 +- src/devices/machine/mos6529.cpp | 2 +- src/devices/machine/mos6529.h | 4 +- src/devices/machine/mos6530.cpp | 28 +- src/devices/machine/mos6530.h | 32 +- src/devices/machine/mos6530n.cpp | 68 +- src/devices/machine/mos6530n.h | 34 +- src/devices/machine/mos6551.cpp | 22 +- src/devices/machine/mos6551.h | 36 +- src/devices/machine/mos6702.cpp | 2 +- src/devices/machine/mos6702.h | 2 +- src/devices/machine/mos8706.cpp | 2 +- src/devices/machine/mos8706.h | 2 +- src/devices/machine/mos8722.cpp | 4 +- src/devices/machine/mos8722.h | 10 +- src/devices/machine/mos8726.cpp | 4 +- src/devices/machine/mos8726.h | 2 +- src/devices/machine/mpu401.cpp | 2 +- src/devices/machine/mpu401.h | 10 +- src/devices/machine/msm5832.cpp | 6 +- src/devices/machine/msm5832.h | 6 +- src/devices/machine/msm58321.cpp | 8 +- src/devices/machine/msm58321.h | 6 +- src/devices/machine/msm6242.cpp | 36 +- src/devices/machine/msm6242.h | 30 +- src/devices/machine/ncr5380.cpp | 8 +- src/devices/machine/ncr5380.h | 16 +- src/devices/machine/ncr5380n.cpp | 24 +- src/devices/machine/ncr5380n.h | 14 +- src/devices/machine/ncr5390.cpp | 36 +- src/devices/machine/ncr5390.h | 22 +- src/devices/machine/ncr539x.cpp | 12 +- src/devices/machine/ncr539x.h | 36 +- src/devices/machine/netlist.cpp | 50 +- src/devices/machine/netlist.h | 52 +- src/devices/machine/nmc9306.cpp | 6 +- src/devices/machine/nmc9306.h | 14 +- src/devices/machine/nsc810.cpp | 6 +- src/devices/machine/nsc810.h | 36 +- src/devices/machine/nscsi_bus.cpp | 40 +- src/devices/machine/nscsi_bus.h | 38 +- src/devices/machine/nscsi_cb.cpp | 2 +- src/devices/machine/nscsi_cb.h | 8 +- src/devices/machine/nscsi_cd.cpp | 8 +- src/devices/machine/nscsi_cd.h | 6 +- src/devices/machine/nscsi_hd.cpp | 16 +- src/devices/machine/nscsi_hd.h | 10 +- src/devices/machine/nscsi_s1410.cpp | 8 +- src/devices/machine/nscsi_s1410.h | 8 +- src/devices/machine/nvram.cpp | 4 +- src/devices/machine/nvram.h | 2 +- src/devices/machine/pc_fdc.cpp | 14 +- src/devices/machine/pc_fdc.h | 14 +- src/devices/machine/pc_lpt.cpp | 2 +- src/devices/machine/pc_lpt.h | 6 +- src/devices/machine/pccard.cpp | 2 +- src/devices/machine/pccard.h | 2 +- src/devices/machine/pcf8593.cpp | 4 +- src/devices/machine/pcf8593.h | 12 +- src/devices/machine/pci-apic.cpp | 2 +- src/devices/machine/pci-apic.h | 2 +- src/devices/machine/pci-ide.cpp | 6 +- src/devices/machine/pci-ide.h | 4 +- src/devices/machine/pci-sata.cpp | 2 +- src/devices/machine/pci-sata.h | 2 +- src/devices/machine/pci-smbus.cpp | 4 +- src/devices/machine/pci-smbus.h | 10 +- src/devices/machine/pci-usb.cpp | 4 +- src/devices/machine/pci-usb.h | 4 +- src/devices/machine/pci.cpp | 76 +- src/devices/machine/pci.h | 90 +- src/devices/machine/pci9050.cpp | 10 +- src/devices/machine/pci9050.h | 6 +- src/devices/machine/pckeybrd.cpp | 18 +- src/devices/machine/pckeybrd.h | 24 +- src/devices/machine/pdc.cpp | 16 +- src/devices/machine/pdc.h | 28 +- src/devices/machine/pic8259.cpp | 14 +- src/devices/machine/pic8259.h | 44 +- src/devices/machine/pit8253.cpp | 40 +- src/devices/machine/pit8253.h | 34 +- src/devices/machine/pla.cpp | 20 +- src/devices/machine/pla.h | 36 +- src/devices/machine/r10696.cpp | 12 +- src/devices/machine/r10696.h | 8 +- src/devices/machine/r10788.cpp | 6 +- src/devices/machine/r10788.h | 18 +- src/devices/machine/ra17xx.cpp | 2 +- src/devices/machine/ra17xx.h | 6 +- src/devices/machine/ram.cpp | 12 +- src/devices/machine/ram.h | 24 +- src/devices/machine/rf5c296.cpp | 8 +- src/devices/machine/rf5c296.h | 6 +- src/devices/machine/roc10937.cpp | 16 +- src/devices/machine/roc10937.h | 22 +- src/devices/machine/rp5c01.cpp | 4 +- src/devices/machine/rp5c01.h | 10 +- src/devices/machine/rp5c15.cpp | 4 +- src/devices/machine/rp5c15.h | 10 +- src/devices/machine/rp5h01.cpp | 4 +- src/devices/machine/rp5h01.h | 8 +- src/devices/machine/rtc4543.cpp | 6 +- src/devices/machine/rtc4543.h | 6 +- src/devices/machine/rtc65271.cpp | 28 +- src/devices/machine/rtc65271.h | 16 +- src/devices/machine/rtc9701.cpp | 10 +- src/devices/machine/rtc9701.h | 12 +- src/devices/machine/s2636.cpp | 22 +- src/devices/machine/s2636.h | 12 +- src/devices/machine/s3520cf.cpp | 10 +- src/devices/machine/s3520cf.h | 16 +- src/devices/machine/s3c2400.cpp | 6 +- src/devices/machine/s3c2400.h | 346 +- src/devices/machine/s3c2410.cpp | 10 +- src/devices/machine/s3c2410.h | 468 +-- src/devices/machine/s3c2440.cpp | 10 +- src/devices/machine/s3c2440.h | 514 +-- src/devices/machine/s3c24xx.hxx | 388 +-- src/devices/machine/s3c44b0.cpp | 202 +- src/devices/machine/s3c44b0.h | 334 +- src/devices/machine/scnxx562.cpp | 186 +- src/devices/machine/scnxx562.h | 274 +- src/devices/machine/serflash.cpp | 12 +- src/devices/machine/serflash.h | 26 +- src/devices/machine/smartmed.cpp | 56 +- src/devices/machine/smartmed.h | 26 +- src/devices/machine/smc91c9x.cpp | 22 +- src/devices/machine/smc91c9x.h | 26 +- src/devices/machine/smpc.cpp | 32 +- src/devices/machine/sonydriv.cpp | 16 +- src/devices/machine/sonydriv.h | 8 +- src/devices/machine/spchrom.cpp | 2 +- src/devices/machine/spchrom.h | 4 +- src/devices/machine/steppers.cpp | 4 +- src/devices/machine/steppers.h | 42 +- src/devices/machine/strata.cpp | 32 +- src/devices/machine/strata.h | 14 +- src/devices/machine/stvcd.cpp | 148 +- src/devices/machine/t10mmc.cpp | 14 +- src/devices/machine/t10mmc.h | 14 +- src/devices/machine/t10sbc.cpp | 6 +- src/devices/machine/t10sbc.h | 8 +- src/devices/machine/t10spc.cpp | 6 +- src/devices/machine/t10spc.h | 20 +- src/devices/machine/tc009xlvc.cpp | 18 +- src/devices/machine/tc009xlvc.h | 32 +- src/devices/machine/terminal.cpp | 26 +- src/devices/machine/terminal.h | 20 +- src/devices/machine/timehelp.h | 6 +- src/devices/machine/timekpr.cpp | 28 +- src/devices/machine/timekpr.h | 38 +- src/devices/machine/tmc0430.cpp | 6 +- src/devices/machine/tmc0430.h | 12 +- src/devices/machine/tmp68301.cpp | 24 +- src/devices/machine/tmp68301.h | 22 +- src/devices/machine/tms1024.cpp | 6 +- src/devices/machine/tms1024.h | 12 +- src/devices/machine/tms5501.cpp | 14 +- src/devices/machine/tms5501.h | 22 +- src/devices/machine/tms6100.cpp | 14 +- src/devices/machine/tms6100.h | 26 +- src/devices/machine/tms9901.cpp | 6 +- src/devices/machine/tms9901.h | 2 +- src/devices/machine/tms9902.cpp | 12 +- src/devices/machine/tms9902.h | 20 +- src/devices/machine/upd1990a.cpp | 6 +- src/devices/machine/upd1990a.h | 10 +- src/devices/machine/upd4701.cpp | 8 +- src/devices/machine/upd4701.h | 8 +- src/devices/machine/upd4992.cpp | 2 +- src/devices/machine/upd4992.h | 4 +- src/devices/machine/upd7002.cpp | 2 +- src/devices/machine/upd7002.h | 2 +- src/devices/machine/upd71071.cpp | 6 +- src/devices/machine/upd71071.h | 28 +- src/devices/machine/upd765.cpp | 64 +- src/devices/machine/upd765.h | 78 +- src/devices/machine/v3021.cpp | 6 +- src/devices/machine/v3021.h | 6 +- src/devices/machine/vrc4373.cpp | 32 +- src/devices/machine/vrc4373.h | 16 +- src/devices/machine/vt82c496.cpp | 8 +- src/devices/machine/vt82c496.h | 14 +- src/devices/machine/vt83c461.cpp | 4 +- src/devices/machine/vt83c461.h | 8 +- src/devices/machine/watchdog.cpp | 4 +- src/devices/machine/watchdog.h | 10 +- src/devices/machine/wd11c00_17.cpp | 16 +- src/devices/machine/wd11c00_17.h | 14 +- src/devices/machine/wd2010.cpp | 50 +- src/devices/machine/wd2010.h | 36 +- src/devices/machine/wd33c93.cpp | 22 +- src/devices/machine/wd33c93.h | 22 +- src/devices/machine/wd7600.cpp | 10 +- src/devices/machine/wd7600.h | 32 +- src/devices/machine/wd_fdc.cpp | 120 +- src/devices/machine/wd_fdc.h | 120 +- src/devices/machine/wozfdc.cpp | 26 +- src/devices/machine/wozfdc.h | 20 +- src/devices/machine/x2212.cpp | 10 +- src/devices/machine/x2212.h | 8 +- src/devices/machine/x76f041.cpp | 6 +- src/devices/machine/x76f041.h | 18 +- src/devices/machine/x76f100.cpp | 6 +- src/devices/machine/x76f100.h | 14 +- src/devices/machine/ym2148.cpp | 6 +- src/devices/machine/ym2148.h | 16 +- src/devices/machine/z80ctc.cpp | 8 +- src/devices/machine/z80ctc.h | 22 +- src/devices/machine/z80dart.cpp | 36 +- src/devices/machine/z80dart.h | 46 +- src/devices/machine/z80dma.cpp | 18 +- src/devices/machine/z80dma.h | 38 +- src/devices/machine/z80pio.cpp | 22 +- src/devices/machine/z80pio.h | 56 +- src/devices/machine/z80scc.cpp | 134 +- src/devices/machine/z80scc.h | 210 +- src/devices/machine/z80sio.cpp | 52 +- src/devices/machine/z80sio.h | 74 +- src/devices/machine/z80sti.cpp | 8 +- src/devices/machine/z80sti.h | 38 +- src/devices/machine/z8536.cpp | 28 +- src/devices/machine/z8536.h | 24 +- src/devices/sound/2203intf.cpp | 2 +- src/devices/sound/2203intf.h | 2 +- src/devices/sound/2608intf.cpp | 2 +- src/devices/sound/2608intf.h | 2 +- src/devices/sound/2610intf.cpp | 6 +- src/devices/sound/2610intf.h | 6 +- src/devices/sound/2612intf.cpp | 6 +- src/devices/sound/2612intf.h | 6 +- src/devices/sound/262intf.cpp | 2 +- src/devices/sound/262intf.h | 2 +- src/devices/sound/315-5641.cpp | 6 +- src/devices/sound/315-5641.h | 10 +- src/devices/sound/3526intf.cpp | 2 +- src/devices/sound/3526intf.h | 2 +- src/devices/sound/3812intf.cpp | 2 +- src/devices/sound/3812intf.h | 2 +- src/devices/sound/8950intf.cpp | 2 +- src/devices/sound/8950intf.h | 2 +- src/devices/sound/ad1848.cpp | 2 +- src/devices/sound/ad1848.h | 46 +- src/devices/sound/aica.cpp | 90 +- src/devices/sound/aica.h | 74 +- src/devices/sound/aicadsp.cpp | 102 +- src/devices/sound/aicadsp.h | 28 +- src/devices/sound/amiga.cpp | 4 +- src/devices/sound/amiga.h | 14 +- src/devices/sound/asc.cpp | 20 +- src/devices/sound/asc.h | 12 +- src/devices/sound/astrocde.cpp | 12 +- src/devices/sound/astrocde.h | 26 +- src/devices/sound/awacs.cpp | 8 +- src/devices/sound/awacs.h | 4 +- src/devices/sound/ay8910.cpp | 38 +- src/devices/sound/ay8910.h | 56 +- src/devices/sound/beep.cpp | 6 +- src/devices/sound/beep.h | 6 +- src/devices/sound/bsmt2000.cpp | 10 +- src/devices/sound/bsmt2000.h | 20 +- src/devices/sound/c140.cpp | 68 +- src/devices/sound/c140.h | 44 +- src/devices/sound/c352.cpp | 60 +- src/devices/sound/c352.h | 32 +- src/devices/sound/c6280.cpp | 26 +- src/devices/sound/c6280.h | 34 +- src/devices/sound/cdda.cpp | 22 +- src/devices/sound/cdda.h | 22 +- src/devices/sound/cdp1863.cpp | 6 +- src/devices/sound/cdp1863.h | 6 +- src/devices/sound/cdp1864.cpp | 8 +- src/devices/sound/cdp1864.h | 6 +- src/devices/sound/cdp1869.cpp | 52 +- src/devices/sound/cdp1869.h | 54 +- src/devices/sound/cem3394.cpp | 44 +- src/devices/sound/cem3394.h | 30 +- src/devices/sound/dac.h | 10 +- src/devices/sound/digitalk.cpp | 54 +- src/devices/sound/digitalk.h | 54 +- src/devices/sound/disc_cls.h | 30 +- src/devices/sound/disc_dev.hxx | 8 +- src/devices/sound/disc_flt.h | 8 +- src/devices/sound/disc_inp.hxx | 22 +- src/devices/sound/disc_mth.h | 22 +- src/devices/sound/disc_sys.hxx | 6 +- src/devices/sound/disc_wav.h | 28 +- src/devices/sound/disc_wav.hxx | 12 +- src/devices/sound/discrete.cpp | 24 +- src/devices/sound/discrete.h | 18 +- src/devices/sound/dmadac.cpp | 26 +- src/devices/sound/dmadac.h | 26 +- src/devices/sound/es1373.cpp | 24 +- src/devices/sound/es1373.h | 36 +- src/devices/sound/es5503.cpp | 40 +- src/devices/sound/es5503.h | 34 +- src/devices/sound/es5506.cpp | 228 +- src/devices/sound/es5506.h | 118 +- src/devices/sound/es8712.cpp | 4 +- src/devices/sound/es8712.h | 24 +- src/devices/sound/esqpump.cpp | 18 +- src/devices/sound/esqpump.h | 4 +- src/devices/sound/flt_rc.cpp | 2 +- src/devices/sound/flt_rc.h | 2 +- src/devices/sound/flt_vol.cpp | 2 +- src/devices/sound/flt_vol.h | 2 +- src/devices/sound/fm.cpp | 384 +-- src/devices/sound/fm.h | 2 +- src/devices/sound/fm2612.cpp | 328 +- src/devices/sound/fmopl.cpp | 214 +- src/devices/sound/fmopl.h | 26 +- src/devices/sound/gaelco.cpp | 6 +- src/devices/sound/gaelco.h | 12 +- src/devices/sound/gb.cpp | 38 +- src/devices/sound/gb.h | 94 +- src/devices/sound/hc55516.cpp | 20 +- src/devices/sound/hc55516.h | 26 +- src/devices/sound/i5000.cpp | 20 +- src/devices/sound/i5000.h | 20 +- src/devices/sound/ics2115.cpp | 66 +- src/devices/sound/ics2115.h | 96 +- src/devices/sound/iremga20.cpp | 6 +- src/devices/sound/iremga20.h | 26 +- src/devices/sound/k005289.cpp | 6 +- src/devices/sound/k005289.h | 18 +- src/devices/sound/k007232.cpp | 2 +- src/devices/sound/k007232.h | 20 +- src/devices/sound/k051649.cpp | 6 +- src/devices/sound/k051649.h | 8 +- src/devices/sound/k053260.cpp | 22 +- src/devices/sound/k053260.h | 34 +- src/devices/sound/k054539.cpp | 36 +- src/devices/sound/k054539.h | 22 +- src/devices/sound/k056800.cpp | 14 +- src/devices/sound/k056800.h | 6 +- src/devices/sound/l7a1045_l6028_dsp_a.cpp | 22 +- src/devices/sound/l7a1045_l6028_dsp_a.h | 28 +- src/devices/sound/lmc1992.cpp | 8 +- src/devices/sound/lmc1992.h | 4 +- src/devices/sound/mas3507d.cpp | 16 +- src/devices/sound/mas3507d.h | 16 +- src/devices/sound/mea8000.cpp | 6 +- src/devices/sound/mea8000.h | 36 +- src/devices/sound/mos6560.cpp | 26 +- src/devices/sound/mos6560.h | 32 +- src/devices/sound/mos6581.cpp | 8 +- src/devices/sound/mos6581.h | 6 +- src/devices/sound/mos7360.cpp | 20 +- src/devices/sound/mos7360.h | 24 +- src/devices/sound/mpeg_audio.cpp | 2 +- src/devices/sound/mpeg_audio.h | 2 +- src/devices/sound/msm5205.cpp | 8 +- src/devices/sound/msm5205.h | 24 +- src/devices/sound/msm5232.cpp | 6 +- src/devices/sound/msm5232.h | 28 +- src/devices/sound/multipcm.cpp | 122 +- src/devices/sound/multipcm.h | 124 +- src/devices/sound/n63701x.cpp | 4 +- src/devices/sound/n63701x.h | 4 +- src/devices/sound/namco.cpp | 46 +- src/devices/sound/namco.h | 42 +- src/devices/sound/nes_apu.cpp | 2 +- src/devices/sound/nes_apu.h | 2 +- src/devices/sound/nes_defs.h | 14 +- src/devices/sound/nile.cpp | 18 +- src/devices/sound/nile.h | 8 +- src/devices/sound/okiadpcm.cpp | 12 +- src/devices/sound/okiadpcm.h | 16 +- src/devices/sound/okim6258.cpp | 10 +- src/devices/sound/okim6258.h | 26 +- src/devices/sound/okim6295.cpp | 10 +- src/devices/sound/okim6295.h | 18 +- src/devices/sound/okim6376.cpp | 10 +- src/devices/sound/okim6376.h | 48 +- src/devices/sound/okim9810.cpp | 74 +- src/devices/sound/okim9810.h | 56 +- src/devices/sound/pcd3311.cpp | 2 +- src/devices/sound/pcd3311.h | 4 +- src/devices/sound/pci-ac97.cpp | 2 +- src/devices/sound/pci-ac97.h | 2 +- src/devices/sound/pokey.cpp | 34 +- src/devices/sound/pokey.h | 88 +- src/devices/sound/qs1000.cpp | 50 +- src/devices/sound/qs1000.h | 30 +- src/devices/sound/qsound.cpp | 6 +- src/devices/sound/qsound.h | 24 +- src/devices/sound/rf5c400.cpp | 28 +- src/devices/sound/rf5c400.h | 54 +- src/devices/sound/rf5c68.cpp | 6 +- src/devices/sound/rf5c68.h | 24 +- src/devices/sound/s14001a.cpp | 24 +- src/devices/sound/s14001a.h | 60 +- src/devices/sound/saa1099.cpp | 4 +- src/devices/sound/saa1099.h | 2 +- src/devices/sound/samples.cpp | 68 +- src/devices/sound/samples.h | 48 +- src/devices/sound/sb0400.cpp | 2 +- src/devices/sound/sb0400.h | 2 +- src/devices/sound/scsp.cpp | 78 +- src/devices/sound/scsp.h | 96 +- src/devices/sound/scspdsp.cpp | 102 +- src/devices/sound/scspdsp.h | 28 +- src/devices/sound/segapcm.cpp | 16 +- src/devices/sound/segapcm.h | 6 +- src/devices/sound/sid.cpp | 26 +- src/devices/sound/sid.h | 24 +- src/devices/sound/side6581.h | 2 +- src/devices/sound/sidenvel.cpp | 128 +- src/devices/sound/sidenvel.h | 4 +- src/devices/sound/sidvoice.cpp | 86 +- src/devices/sound/sidvoice.h | 68 +- src/devices/sound/sidw6581.h | 8 +- src/devices/sound/sidw8580.h | 8 +- src/devices/sound/sn76477.cpp | 20 +- src/devices/sound/sn76477.h | 64 +- src/devices/sound/sn76496.cpp | 28 +- src/devices/sound/sn76496.h | 54 +- src/devices/sound/snkwave.cpp | 6 +- src/devices/sound/snkwave.h | 10 +- src/devices/sound/sp0250.cpp | 14 +- src/devices/sound/sp0250.h | 18 +- src/devices/sound/sp0256.cpp | 38 +- src/devices/sound/sp0256.h | 36 +- src/devices/sound/speaker.cpp | 4 +- src/devices/sound/speaker.h | 6 +- src/devices/sound/spu.cpp | 40 +- src/devices/sound/spu.h | 10 +- src/devices/sound/st0016.cpp | 10 +- src/devices/sound/st0016.h | 4 +- src/devices/sound/t6721a.cpp | 2 +- src/devices/sound/t6721a.h | 2 +- src/devices/sound/t6w28.cpp | 2 +- src/devices/sound/t6w28.h | 24 +- src/devices/sound/tc8830f.cpp | 8 +- src/devices/sound/tc8830f.h | 20 +- src/devices/sound/tiaintf.cpp | 2 +- src/devices/sound/tiaintf.h | 2 +- src/devices/sound/tiasound.cpp | 52 +- src/devices/sound/tiasound.h | 2 +- src/devices/sound/tms3615.cpp | 2 +- src/devices/sound/tms3615.h | 2 +- src/devices/sound/tms36xx.cpp | 2 +- src/devices/sound/tms36xx.h | 2 +- src/devices/sound/tms5110.cpp | 54 +- src/devices/sound/tms5110.h | 172 +- src/devices/sound/tms5110r.hxx | 4 +- src/devices/sound/tms5220.cpp | 50 +- src/devices/sound/tms5220.h | 148 +- src/devices/sound/upd1771.cpp | 10 +- src/devices/sound/upd1771.h | 42 +- src/devices/sound/upd7752.cpp | 8 +- src/devices/sound/upd7752.h | 14 +- src/devices/sound/upd7759.cpp | 30 +- src/devices/sound/upd7759.h | 62 +- src/devices/sound/vlm5030.cpp | 8 +- src/devices/sound/vlm5030.h | 50 +- src/devices/sound/volt_reg.cpp | 2 +- src/devices/sound/volt_reg.h | 2 +- src/devices/sound/votrax.cpp | 100 +- src/devices/sound/votrax.h | 98 +- src/devices/sound/vrc6.cpp | 6 +- src/devices/sound/vrc6.h | 12 +- src/devices/sound/vrender0.cpp | 36 +- src/devices/sound/vrender0.h | 12 +- src/devices/sound/wave.cpp | 6 +- src/devices/sound/wave.h | 2 +- src/devices/sound/x1_010.cpp | 20 +- src/devices/sound/x1_010.h | 14 +- src/devices/sound/ym2151.cpp | 64 +- src/devices/sound/ym2151.h | 168 +- src/devices/sound/ym2413.cpp | 66 +- src/devices/sound/ym2413.h | 134 +- src/devices/sound/ymdeltat.cpp | 22 +- src/devices/sound/ymdeltat.h | 64 +- src/devices/sound/ymf262.cpp | 192 +- src/devices/sound/ymf262.h | 16 +- src/devices/sound/ymf271.cpp | 78 +- src/devices/sound/ymf271.h | 134 +- src/devices/sound/ymf278b.cpp | 32 +- src/devices/sound/ymf278b.h | 110 +- src/devices/sound/ymz280b.cpp | 44 +- src/devices/sound/ymz280b.h | 94 +- src/devices/sound/ymz770.cpp | 20 +- src/devices/sound/ymz770.h | 36 +- src/devices/sound/zsg2.cpp | 32 +- src/devices/sound/zsg2.h | 50 +- src/devices/video/315_5124.cpp | 106 +- src/devices/video/315_5124.h | 56 +- src/devices/video/315_5313.cpp | 192 +- src/devices/video/315_5313.h | 76 +- src/devices/video/bufsprite.h | 30 +- src/devices/video/cdp1861.cpp | 4 +- src/devices/video/cdp1861.h | 4 +- src/devices/video/cdp1862.cpp | 4 +- src/devices/video/cdp1862.h | 4 +- src/devices/video/clgd542x.cpp | 108 +- src/devices/video/clgd542x.h | 104 +- src/devices/video/crt9007.cpp | 6 +- src/devices/video/crt9007.h | 8 +- src/devices/video/crt9021.cpp | 4 +- src/devices/video/crt9021.h | 14 +- src/devices/video/crt9212.cpp | 2 +- src/devices/video/crt9212.h | 8 +- src/devices/video/crtc_ega.cpp | 30 +- src/devices/video/crtc_ega.h | 122 +- src/devices/video/dl1416.cpp | 10 +- src/devices/video/dl1416.h | 10 +- src/devices/video/dm9368.cpp | 8 +- src/devices/video/dm9368.h | 6 +- src/devices/video/ef9340_1.cpp | 36 +- src/devices/video/ef9340_1.h | 32 +- src/devices/video/ef9341_chargen.h | 2 +- src/devices/video/ef9345.cpp | 122 +- src/devices/video/ef9345.h | 76 +- src/devices/video/ef9364.cpp | 16 +- src/devices/video/ef9364.h | 26 +- src/devices/video/ef9365.cpp | 18 +- src/devices/video/ef9365.h | 44 +- src/devices/video/epic12.cpp | 70 +- src/devices/video/epic12.h | 60 +- src/devices/video/epic12in.hxx | 22 +- src/devices/video/fixfreq.cpp | 6 +- src/devices/video/fixfreq.h | 10 +- src/devices/video/gb_lcd.cpp | 152 +- src/devices/video/gb_lcd.h | 168 +- src/devices/video/gba_lcd.cpp | 324 +- src/devices/video/gba_lcd.h | 90 +- src/devices/video/gf4500.cpp | 22 +- src/devices/video/gf4500.h | 8 +- src/devices/video/gf7600gs.cpp | 2 +- src/devices/video/gf7600gs.h | 2 +- src/devices/video/hd44102.cpp | 10 +- src/devices/video/hd44102.h | 10 +- src/devices/video/hd44352.cpp | 26 +- src/devices/video/hd44352.h | 54 +- src/devices/video/hd44780.cpp | 32 +- src/devices/video/hd44780.h | 44 +- src/devices/video/hd61830.cpp | 36 +- src/devices/video/hd61830.h | 24 +- src/devices/video/hd63484.cpp | 278 +- src/devices/video/hd63484.h | 154 +- src/devices/video/hd66421.cpp | 14 +- src/devices/video/hd66421.h | 12 +- src/devices/video/huc6202.cpp | 16 +- src/devices/video/huc6202.h | 14 +- src/devices/video/huc6260.cpp | 8 +- src/devices/video/huc6260.h | 16 +- src/devices/video/huc6261.cpp | 26 +- src/devices/video/huc6261.h | 24 +- src/devices/video/huc6270.cpp | 26 +- src/devices/video/huc6270.h | 76 +- src/devices/video/huc6272.cpp | 8 +- src/devices/video/huc6272.h | 24 +- src/devices/video/i8244.cpp | 64 +- src/devices/video/i8244.h | 58 +- src/devices/video/i82730.cpp | 44 +- src/devices/video/i82730.h | 36 +- src/devices/video/i8275.cpp | 10 +- src/devices/video/i8275.h | 18 +- src/devices/video/jangou_blitter.cpp | 14 +- src/devices/video/jangou_blitter.h | 16 +- src/devices/video/m50458.cpp | 32 +- src/devices/video/m50458.h | 28 +- src/devices/video/mb90082.cpp | 22 +- src/devices/video/mb90082.h | 22 +- src/devices/video/mb_vcu.cpp | 28 +- src/devices/video/mb_vcu.h | 36 +- src/devices/video/mc6845.cpp | 108 +- src/devices/video/mc6845.h | 162 +- src/devices/video/mc6847.cpp | 104 +- src/devices/video/mc6847.h | 184 +- src/devices/video/mga2064w.cpp | 2 +- src/devices/video/mga2064w.h | 2 +- src/devices/video/mos6566.cpp | 92 +- src/devices/video/mos6566.h | 130 +- src/devices/video/msm6222b.cpp | 18 +- src/devices/video/msm6222b.h | 24 +- src/devices/video/msm6255.cpp | 40 +- src/devices/video/msm6255.h | 28 +- src/devices/video/pc_vga.cpp | 272 +- src/devices/video/pc_vga.h | 458 +-- src/devices/video/pcd8544.cpp | 8 +- src/devices/video/pcd8544.h | 30 +- src/devices/video/poly.h | 186 +- src/devices/video/polylgcy.cpp | 178 +- src/devices/video/polylgcy.h | 20 +- src/devices/video/psx.cpp | 830 ++--- src/devices/video/psx.h | 158 +- src/devices/video/ramdac.cpp | 16 +- src/devices/video/ramdac.h | 22 +- src/devices/video/saa5050.cpp | 38 +- src/devices/video/saa5050.h | 46 +- src/devices/video/scn2674.cpp | 18 +- src/devices/video/scn2674.h | 128 +- src/devices/video/sed1200.cpp | 20 +- src/devices/video/sed1200.h | 28 +- src/devices/video/sed1330.cpp | 24 +- src/devices/video/sed1330.h | 30 +- src/devices/video/sed1520.cpp | 8 +- src/devices/video/sed1520.h | 26 +- src/devices/video/snes_ppu.cpp | 254 +- src/devices/video/snes_ppu.h | 278 +- src/devices/video/sprite.cpp | 6 +- src/devices/video/sprite.h | 40 +- src/devices/video/stvvdp1.cpp | 126 +- src/devices/video/stvvdp2.cpp | 306 +- src/devices/video/t6a04.cpp | 26 +- src/devices/video/t6a04.h | 36 +- src/devices/video/tea1002.cpp | 2 +- src/devices/video/tea1002.h | 2 +- src/devices/video/tlc34076.cpp | 6 +- src/devices/video/tlc34076.h | 14 +- src/devices/video/tms34061.cpp | 20 +- src/devices/video/tms34061.h | 46 +- src/devices/video/tms3556.cpp | 32 +- src/devices/video/tms3556.h | 28 +- src/devices/video/tms9927.cpp | 16 +- src/devices/video/tms9927.h | 26 +- src/devices/video/tms9928a.cpp | 98 +- src/devices/video/tms9928a.h | 48 +- src/devices/video/upd3301.cpp | 8 +- src/devices/video/upd3301.h | 14 +- src/devices/video/upd7220.cpp | 72 +- src/devices/video/upd7220.h | 78 +- src/devices/video/upd7227.cpp | 4 +- src/devices/video/upd7227.h | 4 +- src/devices/video/v9938.cpp | 178 +- src/devices/video/v9938.h | 132 +- src/devices/video/vector.cpp | 6 +- src/devices/video/vector.h | 4 +- src/devices/video/vic4567.cpp | 10 +- src/devices/video/vic4567.h | 30 +- src/devices/video/vooddefs.h | 320 +- src/devices/video/voodoo.cpp | 482 +-- src/devices/video/voodoo.h | 466 +-- src/devices/video/voodoo_pci.cpp | 20 +- src/devices/video/voodoo_pci.h | 10 +- src/devices/video/zeus2.cpp | 266 +- src/devices/video/zeus2.h | 130 +- src/emu/addrmap.cpp | 50 +- src/emu/addrmap.h | 78 +- src/emu/attotime.cpp | 32 +- src/emu/attotime.h | 38 +- src/emu/bookkeeping.h | 8 +- src/emu/crsshair.cpp | 14 +- src/emu/crsshair.h | 22 +- src/emu/debug/debugcmd.cpp | 270 +- src/emu/debug/debugcmd.h | 46 +- src/emu/debug/debugcon.cpp | 14 +- src/emu/debug/debugcon.h | 6 +- src/emu/debug/debugcpu.cpp | 190 +- src/emu/debug/debugcpu.h | 162 +- src/emu/debug/debughlp.cpp | 2 +- src/emu/debug/debugvw.cpp | 2 +- src/emu/debug/debugvw.h | 34 +- src/emu/debug/dvbpoints.cpp | 6 +- src/emu/debug/dvdisasm.cpp | 36 +- src/emu/debug/dvdisasm.h | 18 +- src/emu/debug/dvmemory.cpp | 60 +- src/emu/debug/dvmemory.h | 32 +- src/emu/debug/dvstate.cpp | 22 +- src/emu/debug/dvstate.h | 16 +- src/emu/debug/dvtext.cpp | 8 +- src/emu/debug/dvtext.h | 2 +- src/emu/debug/dvwpoints.cpp | 4 +- src/emu/debug/express.cpp | 92 +- src/emu/debug/express.h | 56 +- src/emu/debug/textbuf.cpp | 48 +- src/emu/debug/textbuf.h | 10 +- src/emu/devcb.cpp | 46 +- src/emu/devcb.h | 114 +- src/emu/devcpu.cpp | 2 +- src/emu/devcpu.h | 6 +- src/emu/devfind.cpp | 108 +- src/emu/devfind.h | 124 +- src/emu/device.cpp | 18 +- src/emu/device.h | 42 +- src/emu/didisasm.cpp | 2 +- src/emu/didisasm.h | 26 +- src/emu/diexec.cpp | 26 +- src/emu/diexec.h | 86 +- src/emu/digfx.cpp | 32 +- src/emu/digfx.h | 44 +- src/emu/diimage.cpp | 40 +- src/emu/diimage.h | 32 +- src/emu/dimemory.cpp | 14 +- src/emu/dimemory.h | 12 +- src/emu/dinetwork.cpp | 4 +- src/emu/dinetwork.h | 4 +- src/emu/dipty.cpp | 4 +- src/emu/dipty.h | 4 +- src/emu/dirom.cpp | 12 +- src/emu/dirom.h | 12 +- src/emu/dirtc.cpp | 4 +- src/emu/dirtc.h | 4 +- src/emu/diserial.cpp | 6 +- src/emu/diserial.h | 54 +- src/emu/dislot.h | 6 +- src/emu/disound.cpp | 6 +- src/emu/disound.h | 14 +- src/emu/dispatch.cpp | 10 +- src/emu/dispatch.h | 2 +- src/emu/distate.cpp | 30 +- src/emu/distate.h | 42 +- src/emu/divtlb.cpp | 2 +- src/emu/divtlb.h | 4 +- src/emu/drawgfx.cpp | 522 +-- src/emu/drawgfx.h | 252 +- src/emu/drawgfxm.h | 184 +- src/emu/drivenum.cpp | 2 +- src/emu/driver.cpp | 10 +- src/emu/driver.h | 22 +- src/emu/drivers/empty.cpp | 2 +- src/emu/drivers/testcpu.cpp | 18 +- src/emu/emualloc.cpp | 14 +- src/emu/emualloc.h | 6 +- src/emu/emucore.h | 98 +- src/emu/emumem.cpp | 758 ++--- src/emu/emumem.h | 312 +- src/emu/emupal.cpp | 52 +- src/emu/emupal.h | 70 +- src/emu/fileio.cpp | 28 +- src/emu/fileio.h | 36 +- src/emu/gamedrv.h | 68 +- src/emu/input.cpp | 96 +- src/emu/input.h | 58 +- src/emu/ioport.cpp | 68 +- src/emu/ioport.h | 142 +- src/emu/machine.cpp | 6 +- src/emu/machine.h | 28 +- src/emu/mconfig.cpp | 4 +- src/emu/mconfig.h | 8 +- src/emu/memarray.cpp | 88 +- src/emu/memarray.h | 78 +- src/emu/natkeyboard.h | 4 +- src/emu/network.cpp | 2 +- src/emu/output.cpp | 14 +- src/emu/output.h | 28 +- src/emu/profiler.cpp | 6 +- src/emu/render.cpp | 94 +- src/emu/render.h | 132 +- src/emu/rendersw.hxx | 1028 +++--- src/emu/rendfont.cpp | 56 +- src/emu/rendfont.h | 18 +- src/emu/rendlay.cpp | 160 +- src/emu/rendutil.cpp | 92 +- src/emu/rendutil.h | 4 +- src/emu/romentry.cpp | 2 +- src/emu/romentry.h | 22 +- src/emu/romload.cpp | 60 +- src/emu/romload.h | 16 +- src/emu/save.cpp | 50 +- src/emu/save.h | 36 +- src/emu/schedule.cpp | 10 +- src/emu/schedule.h | 8 +- src/emu/screen.cpp | 118 +- src/emu/screen.h | 54 +- src/emu/softlist.cpp | 12 +- src/emu/softlist.h | 6 +- src/emu/softlist_dev.cpp | 4 +- src/emu/softlist_dev.h | 2 +- src/emu/sound.cpp | 54 +- src/emu/sound.h | 54 +- src/emu/speaker.cpp | 4 +- src/emu/speaker.h | 10 +- src/emu/tilemap.cpp | 210 +- src/emu/tilemap.h | 260 +- src/emu/timer.cpp | 2 +- src/emu/timer.h | 14 +- src/emu/ui/cmdrender.h | 22 +- src/emu/uiinput.cpp | 16 +- src/emu/uiinput.h | 26 +- src/emu/validity.cpp | 504 +-- src/emu/validity.h | 10 +- src/emu/video.cpp | 20 +- src/emu/video.h | 28 +- src/emu/video/resnet.cpp | 8 +- src/emu/video/resnet.h | 14 +- src/emu/video/rgbgen.cpp | 50 +- src/emu/video/rgbgen.h | 156 +- src/emu/video/rgbsse.cpp | 4 +- src/emu/video/rgbsse.h | 130 +- src/emu/video/rgbvmx.cpp | 4 +- src/emu/video/rgbvmx.h | 138 +- src/frontend/mame/audit.cpp | 4 +- src/frontend/mame/audit.h | 14 +- src/frontend/mame/cheat.cpp | 68 +- src/frontend/mame/cheat.h | 38 +- src/frontend/mame/clifront.cpp | 4 +- src/frontend/mame/info.cpp | 18 +- src/frontend/mame/language.cpp | 24 +- src/frontend/mame/luaengine.cpp | 216 +- src/frontend/mame/luaengine.h | 12 +- src/frontend/mame/mameopts.h | 2 +- src/frontend/mame/media_ident.cpp | 8 +- src/frontend/mame/media_ident.h | 2 +- src/frontend/mame/ui/cheatopt.cpp | 2 +- src/frontend/mame/ui/custmenu.cpp | 22 +- src/frontend/mame/ui/custmenu.h | 10 +- src/frontend/mame/ui/custui.cpp | 26 +- src/frontend/mame/ui/custui.h | 2 +- src/frontend/mame/ui/datmenu.cpp | 2 +- src/frontend/mame/ui/datmenu.h | 2 +- src/frontend/mame/ui/defimg.ipp | 2 +- src/frontend/mame/ui/devctrl.h | 6 +- src/frontend/mame/ui/icorender.h | 78 +- src/frontend/mame/ui/info.cpp | 2 +- src/frontend/mame/ui/inifile.cpp | 4 +- src/frontend/mame/ui/inifile.h | 6 +- src/frontend/mame/ui/inputmap.cpp | 18 +- src/frontend/mame/ui/inputmap.h | 14 +- src/frontend/mame/ui/menu.cpp | 26 +- src/frontend/mame/ui/menu.h | 26 +- src/frontend/mame/ui/menuitem.h | 2 +- src/frontend/mame/ui/miscmenu.cpp | 6 +- src/frontend/mame/ui/miscmenu.h | 10 +- src/frontend/mame/ui/optsmenu.cpp | 10 +- src/frontend/mame/ui/optsmenu.h | 2 +- src/frontend/mame/ui/pluginopt.cpp | 2 +- src/frontend/mame/ui/selector.cpp | 4 +- src/frontend/mame/ui/selector.h | 6 +- src/frontend/mame/ui/selgame.cpp | 8 +- src/frontend/mame/ui/selmenu.cpp | 18 +- src/frontend/mame/ui/selmenu.h | 6 +- src/frontend/mame/ui/selsoft.cpp | 2 +- src/frontend/mame/ui/simpleselgame.cpp | 2 +- src/frontend/mame/ui/simpleselgame.h | 2 +- src/frontend/mame/ui/slider.h | 10 +- src/frontend/mame/ui/sliderchangednotifier.h | 4 +- src/frontend/mame/ui/sliders.cpp | 20 +- src/frontend/mame/ui/sliders.h | 2 +- src/frontend/mame/ui/sndmenu.cpp | 2 +- src/frontend/mame/ui/sndmenu.h | 2 +- src/frontend/mame/ui/starimg.ipp | 2 +- src/frontend/mame/ui/submenu.cpp | 2 +- src/frontend/mame/ui/tapectrl.cpp | 2 +- src/frontend/mame/ui/toolbar.ipp | 2 +- src/frontend/mame/ui/ui.cpp | 102 +- src/frontend/mame/ui/ui.h | 74 +- src/frontend/mame/ui/utils.cpp | 50 +- src/frontend/mame/ui/utils.h | 48 +- src/frontend/mame/ui/viewgfx.cpp | 62 +- src/frontend/mame/ui/viewgfx.h | 2 +- src/frontend/mame/ui/widgets.cpp | 2 +- src/ldplayer/ldplayer.cpp | 18 +- src/lib/formats/a26_cas.cpp | 30 +- src/lib/formats/ace_tap.cpp | 14 +- src/lib/formats/ace_tap.h | 16 +- src/lib/formats/acorn_dsk.cpp | 80 +- src/lib/formats/acorn_dsk.h | 28 +- src/lib/formats/adam_cas.cpp | 6 +- src/lib/formats/afs_dsk.cpp | 2 +- src/lib/formats/afs_dsk.h | 2 +- src/lib/formats/ami_dsk.cpp | 28 +- src/lib/formats/ami_dsk.h | 8 +- src/lib/formats/ap2_dsk.cpp | 266 +- src/lib/formats/ap2_dsk.h | 22 +- src/lib/formats/ap_dsk35.cpp | 324 +- src/lib/formats/ap_dsk35.h | 12 +- src/lib/formats/apf_apt.cpp | 34 +- src/lib/formats/apollo_dsk.cpp | 6 +- src/lib/formats/apollo_dsk.h | 2 +- src/lib/formats/apridisk.cpp | 34 +- src/lib/formats/apridisk.h | 4 +- src/lib/formats/atom_tap.cpp | 10 +- src/lib/formats/basicdsk.cpp | 22 +- src/lib/formats/basicdsk.h | 8 +- src/lib/formats/c3040_dsk.cpp | 2 +- src/lib/formats/c3040_dsk.h | 2 +- src/lib/formats/c4040_dsk.cpp | 2 +- src/lib/formats/c4040_dsk.h | 2 +- src/lib/formats/camplynx_cas.cpp | 20 +- src/lib/formats/cassimg.cpp | 122 +- src/lib/formats/cassimg.h | 38 +- src/lib/formats/cbm_crt.cpp | 20 +- src/lib/formats/cbm_crt.h | 30 +- src/lib/formats/cbm_tap.cpp | 18 +- src/lib/formats/ccvf_dsk.cpp | 16 +- src/lib/formats/ccvf_dsk.h | 8 +- src/lib/formats/cgen_cas.cpp | 8 +- src/lib/formats/coco_cas.cpp | 24 +- src/lib/formats/concept_dsk.cpp | 18 +- src/lib/formats/concept_dsk.h | 6 +- src/lib/formats/coupedsk.cpp | 12 +- src/lib/formats/coupedsk.h | 4 +- src/lib/formats/cqm_dsk.cpp | 44 +- src/lib/formats/cqm_dsk.h | 4 +- src/lib/formats/csw_cas.cpp | 52 +- src/lib/formats/d64_dsk.cpp | 40 +- src/lib/formats/d64_dsk.h | 34 +- src/lib/formats/d80_dsk.cpp | 6 +- src/lib/formats/d80_dsk.h | 6 +- src/lib/formats/d88_dsk.cpp | 90 +- src/lib/formats/d88_dsk.h | 4 +- src/lib/formats/dcp_dsk.cpp | 14 +- src/lib/formats/dcp_dsk.h | 4 +- src/lib/formats/dfi_dsk.cpp | 36 +- src/lib/formats/dfi_dsk.h | 4 +- src/lib/formats/dim_dsk.cpp | 20 +- src/lib/formats/dim_dsk.h | 4 +- src/lib/formats/dip_dsk.cpp | 8 +- src/lib/formats/dip_dsk.h | 4 +- src/lib/formats/dmk_dsk.cpp | 18 +- src/lib/formats/dmk_dsk.h | 4 +- src/lib/formats/dsk_dsk.cpp | 86 +- src/lib/formats/dsk_dsk.h | 4 +- src/lib/formats/esq16_dsk.cpp | 18 +- src/lib/formats/esq16_dsk.h | 6 +- src/lib/formats/esq8_dsk.cpp | 10 +- src/lib/formats/esq8_dsk.h | 4 +- src/lib/formats/fc100_cas.cpp | 20 +- src/lib/formats/fdd_dsk.cpp | 26 +- src/lib/formats/fdd_dsk.h | 4 +- src/lib/formats/fdi_dsk.cpp | 64 +- src/lib/formats/flex_dsk.cpp | 6 +- src/lib/formats/flex_dsk.h | 34 +- src/lib/formats/flopimg.cpp | 294 +- src/lib/formats/flopimg.h | 160 +- src/lib/formats/fm7_cas.cpp | 10 +- src/lib/formats/fmsx_cas.cpp | 6 +- src/lib/formats/fsd_dsk.cpp | 22 +- src/lib/formats/fsd_dsk.h | 4 +- src/lib/formats/g64_dsk.cpp | 38 +- src/lib/formats/g64_dsk.h | 8 +- src/lib/formats/gtp_cas.cpp | 20 +- src/lib/formats/hect_tap.cpp | 22 +- src/lib/formats/hxchfe_dsk.cpp | 76 +- src/lib/formats/hxchfe_dsk.h | 8 +- src/lib/formats/hxcmfm_dsk.cpp | 32 +- src/lib/formats/hxcmfm_dsk.h | 4 +- src/lib/formats/imageutl.h | 108 +- src/lib/formats/imd_dsk.cpp | 86 +- src/lib/formats/imd_dsk.h | 4 +- src/lib/formats/ioprocs.cpp | 32 +- src/lib/formats/ioprocs.h | 14 +- src/lib/formats/ipf_dsk.cpp | 174 +- src/lib/formats/ipf_dsk.h | 88 +- src/lib/formats/jvc_dsk.cpp | 18 +- src/lib/formats/jvc_dsk.h | 14 +- src/lib/formats/kc_cas.cpp | 32 +- src/lib/formats/kim1_cas.cpp | 16 +- src/lib/formats/lviv_lvt.cpp | 12 +- src/lib/formats/m20_dsk.cpp | 6 +- src/lib/formats/m20_dsk.h | 4 +- src/lib/formats/mbee_cas.cpp | 24 +- src/lib/formats/mfi_dsk.cpp | 18 +- src/lib/formats/mfi_dsk.h | 4 +- src/lib/formats/mfm_hd.cpp | 30 +- src/lib/formats/mfm_hd.h | 20 +- src/lib/formats/mz_cas.cpp | 24 +- src/lib/formats/naslite_dsk.cpp | 2 +- src/lib/formats/naslite_dsk.h | 2 +- src/lib/formats/nes_dsk.cpp | 4 +- src/lib/formats/nfd_dsk.cpp | 42 +- src/lib/formats/nfd_dsk.h | 4 +- src/lib/formats/orao_cas.cpp | 12 +- src/lib/formats/oric_dsk.cpp | 12 +- src/lib/formats/oric_dsk.h | 4 +- src/lib/formats/oric_tap.cpp | 42 +- src/lib/formats/p6001_cas.cpp | 8 +- src/lib/formats/pasti_dsk.cpp | 74 +- src/lib/formats/pasti_dsk.h | 30 +- src/lib/formats/pc98fdi_dsk.cpp | 34 +- src/lib/formats/pc98fdi_dsk.h | 4 +- src/lib/formats/pc_dsk.cpp | 8 +- src/lib/formats/phc25_cas.cpp | 20 +- src/lib/formats/pmd_cas.cpp | 22 +- src/lib/formats/primoptp.cpp | 36 +- src/lib/formats/rk_cas.cpp | 30 +- src/lib/formats/rx50_dsk.cpp | 18 +- src/lib/formats/rx50_dsk.h | 6 +- src/lib/formats/sc3000_bit.cpp | 6 +- src/lib/formats/sol_cas.cpp | 46 +- src/lib/formats/sorc_cas.cpp | 18 +- src/lib/formats/sorc_dsk.cpp | 14 +- src/lib/formats/sord_cas.cpp | 16 +- src/lib/formats/spc1000_cas.cpp | 24 +- src/lib/formats/st_dsk.cpp | 50 +- src/lib/formats/st_dsk.h | 16 +- src/lib/formats/svi_cas.cpp | 6 +- src/lib/formats/svi_dsk.cpp | 16 +- src/lib/formats/svi_dsk.h | 4 +- src/lib/formats/td0_dsk.cpp | 128 +- src/lib/formats/td0_dsk.h | 4 +- src/lib/formats/thom_cas.cpp | 30 +- src/lib/formats/thom_dsk.cpp | 40 +- src/lib/formats/ti99_dsk.cpp | 50 +- src/lib/formats/ti99_dsk.h | 50 +- src/lib/formats/trs_cas.cpp | 10 +- src/lib/formats/tvc_cas.cpp | 22 +- src/lib/formats/tzx_cas.cpp | 98 +- src/lib/formats/uef_cas.cpp | 32 +- src/lib/formats/upd765_dsk.cpp | 26 +- src/lib/formats/upd765_dsk.h | 14 +- src/lib/formats/vdk_dsk.cpp | 18 +- src/lib/formats/vdk_dsk.h | 4 +- src/lib/formats/vg5k_cas.cpp | 18 +- src/lib/formats/victor9k_dsk.cpp | 28 +- src/lib/formats/victor9k_dsk.h | 24 +- src/lib/formats/vt_cas.cpp | 16 +- src/lib/formats/wavfile.cpp | 68 +- src/lib/formats/wd177x_dsk.cpp | 26 +- src/lib/formats/wd177x_dsk.h | 14 +- src/lib/formats/x07_cas.cpp | 12 +- src/lib/formats/x1_tap.cpp | 10 +- src/lib/formats/zx81_p.cpp | 36 +- src/lib/util/avhuff.cpp | 194 +- src/lib/util/avhuff.h | 46 +- src/lib/util/bitmap.cpp | 74 +- src/lib/util/bitmap.h | 150 +- src/lib/util/bitstream.h | 56 +- src/lib/util/cdrom.cpp | 124 +- src/lib/util/cdrom.h | 68 +- src/lib/util/chd.cpp | 430 +-- src/lib/util/chd.h | 322 +- src/lib/util/chdcd.cpp | 72 +- src/lib/util/chdcd.h | 6 +- src/lib/util/chdcodec.cpp | 266 +- src/lib/util/chdcodec.h | 32 +- src/lib/util/corefile.cpp | 4 +- src/lib/util/corefile.h | 2 +- src/lib/util/corestr.cpp | 12 +- src/lib/util/coreutil.cpp | 18 +- src/lib/util/coreutil.h | 6 +- src/lib/util/flac.cpp | 54 +- src/lib/util/flac.h | 68 +- src/lib/util/harddisk.cpp | 12 +- src/lib/util/harddisk.h | 12 +- src/lib/util/hash.cpp | 2 +- src/lib/util/hash.h | 8 +- src/lib/util/hashing.cpp | 12 +- src/lib/util/hashing.h | 36 +- src/lib/util/huffman.cpp | 52 +- src/lib/util/huffman.h | 42 +- src/lib/util/jedparse.cpp | 42 +- src/lib/util/jedparse.h | 8 +- src/lib/util/options.cpp | 14 +- src/lib/util/options.h | 24 +- src/lib/util/palette.cpp | 82 +- src/lib/util/palette.h | 130 +- src/lib/util/plaparse.cpp | 30 +- src/lib/util/png.cpp | 110 +- src/lib/util/png.h | 30 +- src/lib/util/pool.cpp | 2 +- src/lib/util/pool.h | 2 +- src/lib/util/sha1.cpp | 36 +- src/lib/util/sha1.h | 10 +- src/lib/util/vbiparse.cpp | 36 +- src/lib/util/vbiparse.h | 20 +- src/lib/util/wavwrite.cpp | 26 +- src/lib/util/wavwrite.h | 8 +- src/lib/util/xmlfile.cpp | 14 +- src/lib/util/xmlfile.h | 2 +- src/lib/util/zippath.cpp | 4 +- src/lib/util/zippath.h | 2 +- src/mame/audio/8080bw.cpp | 42 +- src/mame/audio/alesis.cpp | 4 +- src/mame/audio/arcadia.cpp | 2 +- src/mame/audio/arcadia.h | 4 +- src/mame/audio/astrof.cpp | 4 +- src/mame/audio/atarijsa.cpp | 20 +- src/mame/audio/atarijsa.h | 18 +- src/mame/audio/beezer.cpp | 10 +- src/mame/audio/cage.cpp | 38 +- src/mame/audio/cage.h | 34 +- src/mame/audio/cchasm.cpp | 2 +- src/mame/audio/cclimber.cpp | 4 +- src/mame/audio/cclimber.h | 6 +- src/mame/audio/channelf.cpp | 4 +- src/mame/audio/channelf.h | 4 +- src/mame/audio/cinemat.cpp | 36 +- src/mame/audio/copsnrob.cpp | 14 +- src/mame/audio/cps3.cpp | 22 +- src/mame/audio/cps3.h | 16 +- src/mame/audio/dai_snd.cpp | 14 +- src/mame/audio/dai_snd.h | 10 +- src/mame/audio/dave.cpp | 8 +- src/mame/audio/dave.h | 10 +- src/mame/audio/dcs.cpp | 88 +- src/mame/audio/dcs.h | 136 +- src/mame/audio/decobsmt.cpp | 4 +- src/mame/audio/decobsmt.h | 8 +- src/mame/audio/dkong.cpp | 2 +- src/mame/audio/dsbz80.cpp | 4 +- src/mame/audio/dsbz80.h | 8 +- src/mame/audio/exidy.cpp | 24 +- src/mame/audio/exidy.h | 62 +- src/mame/audio/exidy440.cpp | 56 +- src/mame/audio/exidy440.h | 44 +- src/mame/audio/galaxian.cpp | 4 +- src/mame/audio/galaxian.h | 4 +- src/mame/audio/gamate.cpp | 8 +- src/mame/audio/geebee.cpp | 6 +- src/mame/audio/geebee.h | 4 +- src/mame/audio/gomoku.cpp | 8 +- src/mame/audio/gorf.cpp | 2 +- src/mame/audio/gottlieb.cpp | 24 +- src/mame/audio/gottlieb.h | 44 +- src/mame/audio/gridlee.cpp | 6 +- src/mame/audio/harddriv.cpp | 6 +- src/mame/audio/hng64.cpp | 14 +- src/mame/audio/hyprolyb.cpp | 4 +- src/mame/audio/hyprolyb.h | 8 +- src/mame/audio/irem.cpp | 8 +- src/mame/audio/irem.h | 12 +- src/mame/audio/jaguar.cpp | 2 +- src/mame/audio/leland.cpp | 12 +- src/mame/audio/lynx.cpp | 14 +- src/mame/audio/lynx.h | 32 +- src/mame/audio/m72.cpp | 2 +- src/mame/audio/m72.h | 10 +- src/mame/audio/mario.cpp | 8 +- src/mame/audio/meadows.cpp | 2 +- src/mame/audio/micro3d.cpp | 6 +- src/mame/audio/midway.cpp | 22 +- src/mame/audio/midway.h | 48 +- src/mame/audio/mw8080bw.cpp | 16 +- src/mame/audio/n8080.cpp | 10 +- src/mame/audio/namco52.cpp | 2 +- src/mame/audio/namco52.h | 6 +- src/mame/audio/namco54.cpp | 6 +- src/mame/audio/namco54.h | 4 +- src/mame/audio/phoenix.cpp | 8 +- src/mame/audio/pleiads.cpp | 14 +- src/mame/audio/pleiads.h | 10 +- src/mame/audio/polepos.cpp | 6 +- src/mame/audio/redbaron.cpp | 8 +- src/mame/audio/redbaron.h | 6 +- src/mame/audio/s11c_bg.cpp | 10 +- src/mame/audio/s11c_bg.h | 6 +- src/mame/audio/segag80r.cpp | 18 +- src/mame/audio/segam1audio.cpp | 6 +- src/mame/audio/segam1audio.h | 4 +- src/mame/audio/segasnd.cpp | 18 +- src/mame/audio/segasnd.h | 70 +- src/mame/audio/seibu.cpp | 16 +- src/mame/audio/seibu.h | 30 +- src/mame/audio/snes_snd.cpp | 26 +- src/mame/audio/snes_snd.h | 30 +- src/mame/audio/snk6502.cpp | 18 +- src/mame/audio/socrates.cpp | 4 +- src/mame/audio/socrates.h | 18 +- src/mame/audio/special.cpp | 8 +- src/mame/audio/special.h | 2 +- src/mame/audio/starwars.cpp | 2 +- src/mame/audio/suna8.cpp | 6 +- src/mame/audio/svis_snd.cpp | 14 +- src/mame/audio/svis_snd.h | 14 +- src/mame/audio/t5182.cpp | 2 +- src/mame/audio/t5182.h | 4 +- src/mame/audio/taito_en.cpp | 10 +- src/mame/audio/taito_en.h | 20 +- src/mame/audio/taito_zm.cpp | 4 +- src/mame/audio/taito_zm.h | 8 +- src/mame/audio/taitosnd.cpp | 16 +- src/mame/audio/taitosnd.h | 14 +- src/mame/audio/targ.cpp | 6 +- src/mame/audio/tiamc1.cpp | 6 +- src/mame/audio/timeplt.cpp | 2 +- src/mame/audio/timeplt.h | 4 +- src/mame/audio/trackfld.cpp | 6 +- src/mame/audio/trackfld.h | 2 +- src/mame/audio/turbo.cpp | 14 +- src/mame/audio/turrett.cpp | 14 +- src/mame/audio/tvc.cpp | 4 +- src/mame/audio/tvc.h | 4 +- src/mame/audio/tx1.cpp | 10 +- src/mame/audio/vboy.cpp | 54 +- src/mame/audio/vboy.h | 40 +- src/mame/audio/vc4000.cpp | 4 +- src/mame/audio/vc4000.h | 4 +- src/mame/audio/warpwarp.cpp | 6 +- src/mame/audio/warpwarp.h | 4 +- src/mame/audio/williams.cpp | 12 +- src/mame/audio/williams.h | 24 +- src/mame/audio/wiping.cpp | 8 +- src/mame/audio/wiping.h | 14 +- src/mame/audio/wow.cpp | 2 +- src/mame/audio/wpcsnd.cpp | 14 +- src/mame/audio/wpcsnd.h | 14 +- src/mame/audio/wswan.cpp | 8 +- src/mame/audio/wswan.h | 52 +- src/mame/audio/zaccaria.cpp | 12 +- src/mame/audio/zaccaria.h | 10 +- src/mame/audio/zaxxon.cpp | 10 +- src/mame/drivers/1942.cpp | 2 +- src/mame/drivers/1943.cpp | 2 +- src/mame/drivers/1945kiii.cpp | 16 +- src/mame/drivers/24cdjuke.cpp | 8 +- src/mame/drivers/2mindril.cpp | 14 +- src/mame/drivers/30test.cpp | 8 +- src/mame/drivers/39in1.cpp | 58 +- src/mame/drivers/3x3puzzl.cpp | 24 +- src/mame/drivers/4004clk.cpp | 8 +- src/mame/drivers/40love.cpp | 12 +- src/mame/drivers/4dpi.cpp | 16 +- src/mame/drivers/4enlinea.cpp | 12 +- src/mame/drivers/4enraya.cpp | 8 +- src/mame/drivers/5clown.cpp | 26 +- src/mame/drivers/8080bw.cpp | 50 +- src/mame/drivers/88games.cpp | 2 +- src/mame/drivers/a2600.cpp | 16 +- src/mame/drivers/a310.cpp | 8 +- src/mame/drivers/a5105.cpp | 26 +- src/mame/drivers/a51xx.cpp | 8 +- src/mame/drivers/a6809.cpp | 18 +- src/mame/drivers/a7150.cpp | 4 +- src/mame/drivers/a7800.cpp | 4 +- src/mame/drivers/abc1600.cpp | 12 +- src/mame/drivers/abc80.cpp | 14 +- src/mame/drivers/abc80x.cpp | 36 +- src/mame/drivers/ace.cpp | 10 +- src/mame/drivers/acefruit.cpp | 18 +- src/mame/drivers/acesp.cpp | 4 +- src/mame/drivers/acommand.cpp | 32 +- src/mame/drivers/acrnsys1.cpp | 10 +- src/mame/drivers/actfancr.cpp | 2 +- src/mame/drivers/adam.cpp | 6 +- src/mame/drivers/adp.cpp | 6 +- src/mame/drivers/aeroboto.cpp | 2 +- src/mame/drivers/aerofgt.cpp | 2 +- src/mame/drivers/aim65.cpp | 2 +- src/mame/drivers/airraid.cpp | 6 +- src/mame/drivers/albazc.cpp | 16 +- src/mame/drivers/albazg.cpp | 16 +- src/mame/drivers/aleck64.cpp | 22 +- src/mame/drivers/alesis.cpp | 10 +- src/mame/drivers/alg.cpp | 40 +- src/mame/drivers/alien.cpp | 4 +- src/mame/drivers/alinvade.cpp | 14 +- src/mame/drivers/allied.cpp | 24 +- src/mame/drivers/alpha68k.cpp | 22 +- src/mame/drivers/alphasma.cpp | 28 +- src/mame/drivers/alphatro.cpp | 24 +- src/mame/drivers/altair.cpp | 2 +- src/mame/drivers/altos486.cpp | 8 +- src/mame/drivers/altos5.cpp | 24 +- src/mame/drivers/amaticmg.cpp | 40 +- src/mame/drivers/amazonlf.cpp | 4 +- src/mame/drivers/amico2k.cpp | 2 +- src/mame/drivers/amiga.cpp | 54 +- src/mame/drivers/ampoker2.cpp | 6 +- src/mame/drivers/ampro.cpp | 2 +- src/mame/drivers/amspdwy.cpp | 4 +- src/mame/drivers/amstr_pc.cpp | 16 +- src/mame/drivers/amusco.cpp | 8 +- src/mame/drivers/amust.cpp | 26 +- src/mame/drivers/angelkds.cpp | 2 +- src/mame/drivers/anzterm.cpp | 2 +- src/mame/drivers/apc.cpp | 46 +- src/mame/drivers/apexc.cpp | 34 +- src/mame/drivers/apf.cpp | 26 +- src/mame/drivers/apogee.cpp | 12 +- src/mame/drivers/apollo.cpp | 68 +- src/mame/drivers/apple1.cpp | 42 +- src/mame/drivers/apple2.cpp | 22 +- src/mame/drivers/apple2e.cpp | 46 +- src/mame/drivers/apple2gs.cpp | 2 +- src/mame/drivers/applix.cpp | 64 +- src/mame/drivers/appoooh.cpp | 2 +- src/mame/drivers/apricot.cpp | 14 +- src/mame/drivers/apricotf.cpp | 12 +- src/mame/drivers/apricotp.cpp | 16 +- src/mame/drivers/aquarium.cpp | 10 +- src/mame/drivers/aquarius.cpp | 4 +- src/mame/drivers/arabian.cpp | 12 +- src/mame/drivers/arachnid.cpp | 18 +- src/mame/drivers/arcadia.cpp | 6 +- src/mame/drivers/argo.cpp | 34 +- src/mame/drivers/aristmk4.cpp | 32 +- src/mame/drivers/aristmk5.cpp | 18 +- src/mame/drivers/aristmk6.cpp | 14 +- src/mame/drivers/arkanoid.cpp | 10 +- src/mame/drivers/armedf.cpp | 6 +- src/mame/drivers/arsystems.cpp | 8 +- src/mame/drivers/artmagic.cpp | 68 +- src/mame/drivers/ashnojoe.cpp | 2 +- src/mame/drivers/asst128.cpp | 2 +- src/mame/drivers/asterix.cpp | 16 +- src/mame/drivers/astinvad.cpp | 44 +- src/mame/drivers/astrafr.cpp | 38 +- src/mame/drivers/astrcorp.cpp | 28 +- src/mame/drivers/astrocde.cpp | 12 +- src/mame/drivers/astrof.cpp | 68 +- src/mame/drivers/at.cpp | 10 +- src/mame/drivers/atari400.cpp | 14 +- src/mame/drivers/atari_s1.cpp | 24 +- src/mame/drivers/atari_s2.cpp | 18 +- src/mame/drivers/atarig1.cpp | 4 +- src/mame/drivers/atarig42.cpp | 8 +- src/mame/drivers/atarigt.cpp | 24 +- src/mame/drivers/atarigx2.cpp | 10 +- src/mame/drivers/atarist.cpp | 32 +- src/mame/drivers/atarisy1.cpp | 10 +- src/mame/drivers/atarisy2.cpp | 12 +- src/mame/drivers/atarisy4.cpp | 188 +- src/mame/drivers/atetris.cpp | 2 +- src/mame/drivers/atlantis.cpp | 56 +- src/mame/drivers/atm.cpp | 8 +- src/mame/drivers/atom.cpp | 16 +- src/mame/drivers/atronic.cpp | 4 +- src/mame/drivers/attache.cpp | 90 +- src/mame/drivers/atvtrack.cpp | 44 +- src/mame/drivers/aussiebyte.cpp | 18 +- src/mame/drivers/avalnche.cpp | 6 +- src/mame/drivers/avigo.cpp | 8 +- src/mame/drivers/avt.cpp | 16 +- src/mame/drivers/ax20.cpp | 8 +- src/mame/drivers/b16.cpp | 12 +- src/mame/drivers/babbage.cpp | 10 +- src/mame/drivers/backfire.cpp | 42 +- src/mame/drivers/bagman.cpp | 4 +- src/mame/drivers/balsente.cpp | 24 +- src/mame/drivers/banctec.cpp | 4 +- src/mame/drivers/baraduke.cpp | 2 +- src/mame/drivers/barata.cpp | 4 +- src/mame/drivers/basic52.cpp | 2 +- src/mame/drivers/battlera.cpp | 2 +- src/mame/drivers/battlex.cpp | 8 +- src/mame/drivers/battlnts.cpp | 2 +- src/mame/drivers/bbcbc.cpp | 2 +- src/mame/drivers/bbusters.cpp | 2 +- src/mame/drivers/bcs3.cpp | 36 +- src/mame/drivers/beaminv.cpp | 14 +- src/mame/drivers/beathead.cpp | 6 +- src/mame/drivers/bebox.cpp | 2 +- src/mame/drivers/beehive.cpp | 24 +- src/mame/drivers/berzerk.cpp | 82 +- src/mame/drivers/besta.cpp | 12 +- src/mame/drivers/bestleag.cpp | 20 +- src/mame/drivers/beta.cpp | 16 +- src/mame/drivers/bfcobra.cpp | 172 +- src/mame/drivers/bfm_ad5.cpp | 2 +- src/mame/drivers/bfm_sc1.cpp | 16 +- src/mame/drivers/bfm_sc2.cpp | 28 +- src/mame/drivers/bfm_sc4.cpp | 46 +- src/mame/drivers/bfm_sc5sw.hxx | 2 +- src/mame/drivers/bfm_swp.cpp | 10 +- src/mame/drivers/bfmsys83.cpp | 2 +- src/mame/drivers/bfmsys85.cpp | 14 +- src/mame/drivers/big10.cpp | 4 +- src/mame/drivers/bigbord2.cpp | 32 +- src/mame/drivers/bigevglf.cpp | 4 +- src/mame/drivers/binbug.cpp | 32 +- src/mame/drivers/bingoc.cpp | 8 +- src/mame/drivers/bingoman.cpp | 4 +- src/mame/drivers/bingor.cpp | 8 +- src/mame/drivers/bishi.cpp | 2 +- src/mame/drivers/bitgraph.cpp | 24 +- src/mame/drivers/bking.cpp | 2 +- src/mame/drivers/blackt96.cpp | 10 +- src/mame/drivers/blitz.cpp | 10 +- src/mame/drivers/blitz68k.cpp | 120 +- src/mame/drivers/blktiger.cpp | 4 +- src/mame/drivers/blmbycar.cpp | 4 +- src/mame/drivers/blockade.cpp | 2 +- src/mame/drivers/blockhl.cpp | 4 +- src/mame/drivers/bmcbowl.cpp | 20 +- src/mame/drivers/bmcpokr.cpp | 50 +- src/mame/drivers/bmjr.cpp | 20 +- src/mame/drivers/bml3.cpp | 48 +- src/mame/drivers/bnstars.cpp | 44 +- src/mame/drivers/bntyhunt.cpp | 4 +- src/mame/drivers/bob85.cpp | 12 +- src/mame/drivers/boogwing.cpp | 12 +- src/mame/drivers/bottom9.cpp | 2 +- src/mame/drivers/bowltry.cpp | 6 +- src/mame/drivers/boxer.cpp | 24 +- src/mame/drivers/br8641.cpp | 6 +- src/mame/drivers/brkthru.cpp | 2 +- src/mame/drivers/btime.cpp | 6 +- src/mame/drivers/bublbobl.cpp | 4 +- src/mame/drivers/buggychl.cpp | 2 +- src/mame/drivers/bullet.cpp | 16 +- src/mame/drivers/busicom.cpp | 10 +- src/mame/drivers/buster.cpp | 6 +- src/mame/drivers/bw12.cpp | 10 +- src/mame/drivers/bw2.cpp | 6 +- src/mame/drivers/bwing.cpp | 2 +- src/mame/drivers/by17.cpp | 30 +- src/mame/drivers/by35.cpp | 36 +- src/mame/drivers/by6803.cpp | 16 +- src/mame/drivers/byvid.cpp | 22 +- src/mame/drivers/c10.cpp | 18 +- src/mame/drivers/c128.cpp | 40 +- src/mame/drivers/c64.cpp | 54 +- src/mame/drivers/c64dtv.cpp | 2 +- src/mame/drivers/c65.cpp | 68 +- src/mame/drivers/c80.cpp | 2 +- src/mame/drivers/c900.cpp | 4 +- src/mame/drivers/cabal.cpp | 2 +- src/mame/drivers/cabaret.cpp | 16 +- src/mame/drivers/calchase.cpp | 38 +- src/mame/drivers/calomega.cpp | 4 +- src/mame/drivers/calorie.cpp | 16 +- src/mame/drivers/camplynx.cpp | 30 +- src/mame/drivers/canyon.cpp | 2 +- src/mame/drivers/capbowl.cpp | 2 +- src/mame/drivers/cardline.cpp | 16 +- src/mame/drivers/carjmbre.cpp | 12 +- src/mame/drivers/carpolo.cpp | 2 +- src/mame/drivers/carrera.cpp | 8 +- src/mame/drivers/casloopy.cpp | 40 +- src/mame/drivers/caswin.cpp | 10 +- src/mame/drivers/cat.cpp | 34 +- src/mame/drivers/cave.cpp | 86 +- src/mame/drivers/cavepc.cpp | 4 +- src/mame/drivers/cb2001.cpp | 16 +- src/mame/drivers/cball.cpp | 8 +- src/mame/drivers/cbasebal.cpp | 4 +- src/mame/drivers/cbm2.cpp | 84 +- src/mame/drivers/cbuster.cpp | 4 +- src/mame/drivers/cc40.cpp | 36 +- src/mame/drivers/cchance.cpp | 4 +- src/mame/drivers/cclimber.cpp | 6 +- src/mame/drivers/ccs2810.cpp | 20 +- src/mame/drivers/ccs300.cpp | 6 +- src/mame/drivers/cd2650.cpp | 22 +- src/mame/drivers/cdc721.cpp | 14 +- src/mame/drivers/cdi.cpp | 30 +- src/mame/drivers/cedar_magnet.cpp | 14 +- src/mame/drivers/cedar_magnet.h | 20 +- src/mame/drivers/cedar_magnet_board.cpp | 6 +- src/mame/drivers/cedar_magnet_board.h | 8 +- src/mame/drivers/cedar_magnet_flop.cpp | 12 +- src/mame/drivers/cedar_magnet_flop.h | 14 +- src/mame/drivers/cedar_magnet_plane.cpp | 10 +- src/mame/drivers/cedar_magnet_plane.h | 18 +- src/mame/drivers/cedar_magnet_sound.cpp | 8 +- src/mame/drivers/cedar_magnet_sound.h | 6 +- src/mame/drivers/cedar_magnet_sprite.cpp | 14 +- src/mame/drivers/cedar_magnet_sprite.h | 22 +- src/mame/drivers/centiped.cpp | 10 +- src/mame/drivers/cesclass.cpp | 8 +- src/mame/drivers/cfx9850.cpp | 18 +- src/mame/drivers/cgenie.cpp | 16 +- src/mame/drivers/chaknpop.cpp | 2 +- src/mame/drivers/cham24.cpp | 36 +- src/mame/drivers/champbas.cpp | 14 +- src/mame/drivers/champbwl.cpp | 22 +- src/mame/drivers/chanbara.cpp | 26 +- src/mame/drivers/chance32.cpp | 12 +- src/mame/drivers/changela.cpp | 2 +- src/mame/drivers/channelf.cpp | 6 +- src/mame/drivers/chaos.cpp | 10 +- src/mame/drivers/chessmst.cpp | 14 +- src/mame/drivers/chesstrv.cpp | 12 +- src/mame/drivers/chexx.cpp | 32 +- src/mame/drivers/chihiro.cpp | 154 +- src/mame/drivers/chinagat.cpp | 6 +- src/mame/drivers/chinsan.cpp | 24 +- src/mame/drivers/chsuper.cpp | 30 +- src/mame/drivers/cinemat.cpp | 10 +- src/mame/drivers/cischeat.cpp | 18 +- src/mame/drivers/citycon.cpp | 2 +- src/mame/drivers/clayshoo.cpp | 26 +- src/mame/drivers/clcd.cpp | 22 +- src/mame/drivers/cliffhgr.cpp | 2 +- src/mame/drivers/clshroad.cpp | 2 +- src/mame/drivers/cm1800.cpp | 4 +- src/mame/drivers/cmi.cpp | 166 +- src/mame/drivers/cmmb.cpp | 18 +- src/mame/drivers/cninja.cpp | 30 +- src/mame/drivers/cntsteer.cpp | 32 +- src/mame/drivers/cobra.cpp | 486 +-- src/mame/drivers/cocoloco.cpp | 12 +- src/mame/drivers/codata.cpp | 8 +- src/mame/drivers/coinmstr.cpp | 30 +- src/mame/drivers/coinmvga.cpp | 6 +- src/mame/drivers/coleco.cpp | 18 +- src/mame/drivers/combatsc.cpp | 4 +- src/mame/drivers/comebaby.cpp | 4 +- src/mame/drivers/commando.cpp | 8 +- src/mame/drivers/compgolf.cpp | 4 +- src/mame/drivers/compis.cpp | 2 +- src/mame/drivers/compucolor.cpp | 16 +- src/mame/drivers/comquest.cpp | 4 +- src/mame/drivers/comx35.cpp | 16 +- src/mame/drivers/contra.cpp | 2 +- src/mame/drivers/coolpool.cpp | 42 +- src/mame/drivers/coolridr.cpp | 356 +- src/mame/drivers/cop01.cpp | 2 +- src/mame/drivers/cops.cpp | 138 +- src/mame/drivers/corona.cpp | 26 +- src/mame/drivers/cortex.cpp | 4 +- src/mame/drivers/cosmic.cpp | 6 +- src/mame/drivers/cosmicos.cpp | 20 +- src/mame/drivers/cp1.cpp | 14 +- src/mame/drivers/cps1.cpp | 16 +- src/mame/drivers/cps2.cpp | 14 +- src/mame/drivers/cps3.cpp | 224 +- src/mame/drivers/craft.cpp | 46 +- src/mame/drivers/crbaloon.cpp | 8 +- src/mame/drivers/crgolf.cpp | 4 +- src/mame/drivers/crimfght.cpp | 2 +- src/mame/drivers/crospang.cpp | 2 +- src/mame/drivers/crshrace.cpp | 4 +- src/mame/drivers/crvision.cpp | 12 +- src/mame/drivers/crystal.cpp | 140 +- src/mame/drivers/csplayh5.cpp | 6 +- src/mame/drivers/cswat.cpp | 10 +- src/mame/drivers/cubeqst.cpp | 24 +- src/mame/drivers/cubo.cpp | 68 +- src/mame/drivers/cultures.cpp | 22 +- src/mame/drivers/cupidon.cpp | 10 +- src/mame/drivers/cv1k.cpp | 18 +- src/mame/drivers/cvicny.cpp | 6 +- src/mame/drivers/cvs.cpp | 20 +- src/mame/drivers/cxhumax.cpp | 128 +- src/mame/drivers/cybertnk.cpp | 50 +- src/mame/drivers/cyclemb.cpp | 46 +- src/mame/drivers/czk80.cpp | 6 +- src/mame/drivers/d6800.cpp | 24 +- src/mame/drivers/d6809.cpp | 4 +- src/mame/drivers/d9final.cpp | 10 +- src/mame/drivers/dacholer.cpp | 22 +- src/mame/drivers/dai3wksi.cpp | 26 +- src/mame/drivers/dambustr.cpp | 6 +- src/mame/drivers/darkmist.cpp | 16 +- src/mame/drivers/darkseal.cpp | 2 +- src/mame/drivers/dassault.cpp | 12 +- src/mame/drivers/dblcrown.cpp | 42 +- src/mame/drivers/dblewing.cpp | 28 +- src/mame/drivers/dbz.cpp | 12 +- src/mame/drivers/dccons.cpp | 6 +- src/mame/drivers/dcheese.cpp | 2 +- src/mame/drivers/dcon.cpp | 2 +- src/mame/drivers/dct11em.cpp | 4 +- src/mame/drivers/ddayjlc.cpp | 62 +- src/mame/drivers/ddealer.cpp | 48 +- src/mame/drivers/ddenlovr.cpp | 128 +- src/mame/drivers/ddragon.cpp | 8 +- src/mame/drivers/de_2.cpp | 28 +- src/mame/drivers/de_3.cpp | 18 +- src/mame/drivers/de_3b.cpp | 10 +- src/mame/drivers/dec8.cpp | 24 +- src/mame/drivers/deco156.cpp | 22 +- src/mame/drivers/deco32.cpp | 60 +- src/mame/drivers/deco_ld.cpp | 18 +- src/mame/drivers/deco_mlc.cpp | 22 +- src/mame/drivers/decocass.cpp | 6 +- src/mame/drivers/dectalk.cpp | 60 +- src/mame/drivers/decwritr.cpp | 12 +- src/mame/drivers/deshoros.cpp | 6 +- src/mame/drivers/destroyr.cpp | 16 +- src/mame/drivers/dfruit.cpp | 22 +- src/mame/drivers/dgpix.cpp | 34 +- src/mame/drivers/didact.cpp | 56 +- src/mame/drivers/dietgo.cpp | 8 +- src/mame/drivers/digel804.cpp | 26 +- src/mame/drivers/dim68k.cpp | 22 +- src/mame/drivers/discoboy.cpp | 38 +- src/mame/drivers/divebomb.cpp | 4 +- src/mame/drivers/diverboy.cpp | 12 +- src/mame/drivers/djboy.cpp | 12 +- src/mame/drivers/djmain.cpp | 34 +- src/mame/drivers/dkong.cpp | 34 +- src/mame/drivers/dlair.cpp | 34 +- src/mame/drivers/dlair2.cpp | 4 +- src/mame/drivers/dm7000.cpp | 14 +- src/mame/drivers/dmax8000.cpp | 2 +- src/mame/drivers/dmndrby.cpp | 20 +- src/mame/drivers/dms5000.cpp | 4 +- src/mame/drivers/dms86.cpp | 6 +- src/mame/drivers/dmv.cpp | 46 +- src/mame/drivers/dolphunk.cpp | 6 +- src/mame/drivers/dominob.cpp | 14 +- src/mame/drivers/dorachan.cpp | 22 +- src/mame/drivers/dotrikun.cpp | 10 +- src/mame/drivers/dps1.cpp | 8 +- src/mame/drivers/dragrace.cpp | 8 +- src/mame/drivers/dreambal.cpp | 12 +- src/mame/drivers/dreamwld.cpp | 44 +- src/mame/drivers/drgnmst.cpp | 16 +- src/mame/drivers/drmicro.cpp | 2 +- src/mame/drivers/drtomy.cpp | 10 +- src/mame/drivers/drw80pkr.cpp | 36 +- src/mame/drivers/dsb46.cpp | 6 +- src/mame/drivers/dual68.cpp | 8 +- src/mame/drivers/dunhuang.cpp | 54 +- src/mame/drivers/dvk_kcgd.cpp | 28 +- src/mame/drivers/dvk_ksm.cpp | 24 +- src/mame/drivers/dwarfd.cpp | 28 +- src/mame/drivers/dynadice.cpp | 16 +- src/mame/drivers/dynax.cpp | 36 +- src/mame/drivers/eacc.cpp | 8 +- src/mame/drivers/ec184x.cpp | 6 +- src/mame/drivers/ec65.cpp | 10 +- src/mame/drivers/ecoinf2.cpp | 6 +- src/mame/drivers/ecoinf3.cpp | 16 +- src/mame/drivers/ecoinfr.cpp | 26 +- src/mame/drivers/egghunt.cpp | 16 +- src/mame/drivers/einstein.cpp | 18 +- src/mame/drivers/elekscmp.cpp | 8 +- src/mame/drivers/elwro800.cpp | 28 +- src/mame/drivers/embargo.cpp | 28 +- src/mame/drivers/enigma2.cpp | 66 +- src/mame/drivers/enmirage.cpp | 8 +- src/mame/drivers/eolith.cpp | 6 +- src/mame/drivers/eolith16.cpp | 8 +- src/mame/drivers/ep64.cpp | 6 +- src/mame/drivers/epos.cpp | 4 +- src/mame/drivers/equites.cpp | 4 +- src/mame/drivers/esd16.cpp | 2 +- src/mame/drivers/esh.cpp | 14 +- src/mame/drivers/esq1.cpp | 38 +- src/mame/drivers/esq5505.cpp | 30 +- src/mame/drivers/esqkt.cpp | 2 +- src/mame/drivers/esripsys.cpp | 22 +- src/mame/drivers/et3400.cpp | 10 +- src/mame/drivers/eti660.cpp | 12 +- src/mame/drivers/ettrivia.cpp | 16 +- src/mame/drivers/europc.cpp | 10 +- src/mame/drivers/evmbug.cpp | 8 +- src/mame/drivers/excali64.cpp | 38 +- src/mame/drivers/exelv.cpp | 22 +- src/mame/drivers/exerion.cpp | 8 +- src/mame/drivers/exidy.cpp | 2 +- src/mame/drivers/exidy440.cpp | 16 +- src/mame/drivers/expro02.cpp | 34 +- src/mame/drivers/exprraid.cpp | 4 +- src/mame/drivers/exterm.cpp | 8 +- src/mame/drivers/exzisus.cpp | 2 +- src/mame/drivers/f-32.cpp | 6 +- src/mame/drivers/f1gp.cpp | 4 +- src/mame/drivers/famibox.cpp | 38 +- src/mame/drivers/fantland.cpp | 10 +- src/mame/drivers/fanucspmg.cpp | 48 +- src/mame/drivers/fastfred.cpp | 4 +- src/mame/drivers/fastinvaders.cpp | 64 +- src/mame/drivers/fastlane.cpp | 2 +- src/mame/drivers/fc100.cpp | 36 +- src/mame/drivers/fccpu30.cpp | 46 +- src/mame/drivers/fcisio.cpp | 8 +- src/mame/drivers/fcombat.cpp | 6 +- src/mame/drivers/fcrash.cpp | 44 +- src/mame/drivers/fcscsi.cpp | 14 +- src/mame/drivers/feversoc.cpp | 20 +- src/mame/drivers/fgoal.cpp | 14 +- src/mame/drivers/fidel6502.cpp | 26 +- src/mame/drivers/fidel68k.cpp | 4 +- src/mame/drivers/fidelz80.cpp | 28 +- src/mame/drivers/fireball.cpp | 28 +- src/mame/drivers/firebeat.cpp | 60 +- src/mame/drivers/firefox.cpp | 14 +- src/mame/drivers/firetrap.cpp | 12 +- src/mame/drivers/firetrk.cpp | 22 +- src/mame/drivers/fitfight.cpp | 10 +- src/mame/drivers/fk1.cpp | 16 +- src/mame/drivers/flicker.cpp | 8 +- src/mame/drivers/flipjack.cpp | 26 +- src/mame/drivers/flkatck.cpp | 2 +- src/mame/drivers/flower.cpp | 20 +- src/mame/drivers/flstory.cpp | 2 +- src/mame/drivers/flyball.cpp | 26 +- src/mame/drivers/fm7.cpp | 74 +- src/mame/drivers/fmtowns.cpp | 84 +- src/mame/drivers/force68k.cpp | 22 +- src/mame/drivers/forte2.cpp | 6 +- src/mame/drivers/fortecar.cpp | 8 +- src/mame/drivers/fp1100.cpp | 46 +- src/mame/drivers/fp200.cpp | 74 +- src/mame/drivers/fp6000.cpp | 18 +- src/mame/drivers/freekick.cpp | 4 +- src/mame/drivers/fresh.cpp | 14 +- src/mame/drivers/fromanc2.cpp | 4 +- src/mame/drivers/fromance.cpp | 2 +- src/mame/drivers/ft68m.cpp | 8 +- src/mame/drivers/funkball.cpp | 46 +- src/mame/drivers/funkyjet.cpp | 8 +- src/mame/drivers/funtech.cpp | 22 +- src/mame/drivers/funworld.cpp | 80 +- src/mame/drivers/funybubl.cpp | 2 +- src/mame/drivers/fuukifg2.cpp | 6 +- src/mame/drivers/fuukifg3.cpp | 6 +- src/mame/drivers/g627.cpp | 10 +- src/mame/drivers/gaelco3d.cpp | 18 +- src/mame/drivers/gaiden.cpp | 12 +- src/mame/drivers/gal3.cpp | 26 +- src/mame/drivers/galaga.cpp | 8 +- src/mame/drivers/galaxi.cpp | 32 +- src/mame/drivers/galaxian.cpp | 130 +- src/mame/drivers/galaxold.cpp | 12 +- src/mame/drivers/galgame.cpp | 50 +- src/mame/drivers/galivan.cpp | 4 +- src/mame/drivers/galpani2.cpp | 8 +- src/mame/drivers/galpani3.cpp | 54 +- src/mame/drivers/gamate.cpp | 32 +- src/mame/drivers/gambl186.cpp | 8 +- src/mame/drivers/gamecom.cpp | 2 +- src/mame/drivers/gamecstl.cpp | 42 +- src/mame/drivers/gameking.cpp | 34 +- src/mame/drivers/gaplus.cpp | 2 +- src/mame/drivers/gauntlet.cpp | 10 +- src/mame/drivers/gb.cpp | 6 +- src/mame/drivers/gba.cpp | 40 +- src/mame/drivers/gberet.cpp | 6 +- src/mame/drivers/gcpinbal.cpp | 2 +- src/mame/drivers/gei.cpp | 14 +- src/mame/drivers/geneve.cpp | 6 +- src/mame/drivers/geniusiq.cpp | 74 +- src/mame/drivers/ghosteo.cpp | 24 +- src/mame/drivers/gijoe.cpp | 2 +- src/mame/drivers/gimix.cpp | 26 +- src/mame/drivers/ginganin.cpp | 4 +- src/mame/drivers/gizmondo.cpp | 8 +- src/mame/drivers/gkigt.cpp | 4 +- src/mame/drivers/gladiatr.cpp | 6 +- src/mame/drivers/glasgow.cpp | 68 +- src/mame/drivers/glass.cpp | 6 +- src/mame/drivers/gluck2.cpp | 10 +- src/mame/drivers/gmaster.cpp | 22 +- src/mame/drivers/gng.cpp | 2 +- src/mame/drivers/go2000.cpp | 10 +- src/mame/drivers/goal92.cpp | 2 +- src/mame/drivers/goindol.cpp | 4 +- src/mame/drivers/goldngam.cpp | 8 +- src/mame/drivers/goldnpkr.cpp | 66 +- src/mame/drivers/goldstar.cpp | 152 +- src/mame/drivers/good.cpp | 10 +- src/mame/drivers/goodejan.cpp | 28 +- src/mame/drivers/gottlieb.cpp | 16 +- src/mame/drivers/goupil.cpp | 16 +- src/mame/drivers/gp2x.cpp | 32 +- src/mame/drivers/gp32.cpp | 148 +- src/mame/drivers/gp_1.cpp | 8 +- src/mame/drivers/gp_2.cpp | 8 +- src/mame/drivers/gpworld.cpp | 30 +- src/mame/drivers/grchamp.cpp | 8 +- src/mame/drivers/grfd2301.cpp | 14 +- src/mame/drivers/gridlee.cpp | 10 +- src/mame/drivers/groundfx.cpp | 4 +- src/mame/drivers/gstream.cpp | 106 +- src/mame/drivers/gsword.cpp | 6 +- src/mame/drivers/gticlub.cpp | 40 +- src/mame/drivers/gts1.cpp | 44 +- src/mame/drivers/gts3.cpp | 10 +- src/mame/drivers/gts3a.cpp | 20 +- src/mame/drivers/gts80.cpp | 18 +- src/mame/drivers/gts80a.cpp | 26 +- src/mame/drivers/gts80b.cpp | 22 +- src/mame/drivers/guab.cpp | 26 +- src/mame/drivers/gundealr.cpp | 8 +- src/mame/drivers/gunpey.cpp | 112 +- src/mame/drivers/gunsmoke.cpp | 4 +- src/mame/drivers/h19.cpp | 18 +- src/mame/drivers/h8.cpp | 12 +- src/mame/drivers/h89.cpp | 2 +- src/mame/drivers/halleys.cpp | 204 +- src/mame/drivers/hanaawas.cpp | 2 +- src/mame/drivers/hankin.cpp | 28 +- src/mame/drivers/harddriv.cpp | 74 +- src/mame/drivers/harriet.cpp | 10 +- src/mame/drivers/hcastle.cpp | 2 +- src/mame/drivers/headonb.cpp | 8 +- src/mame/drivers/hec2hrp.cpp | 4 +- src/mame/drivers/hh_amis2k.cpp | 18 +- src/mame/drivers/hh_cop400.cpp | 46 +- src/mame/drivers/hh_hmcs40.cpp | 166 +- src/mame/drivers/hh_melps4.cpp | 38 +- src/mame/drivers/hh_pic16.cpp | 24 +- src/mame/drivers/hh_sm510.cpp | 12 +- src/mame/drivers/hh_tms1k.cpp | 72 +- src/mame/drivers/hh_ucom4.cpp | 68 +- src/mame/drivers/hideseek.cpp | 4 +- src/mame/drivers/highvdeo.cpp | 52 +- src/mame/drivers/hikaru.cpp | 4 +- src/mame/drivers/himesiki.cpp | 2 +- src/mame/drivers/hitme.cpp | 18 +- src/mame/drivers/hitpoker.cpp | 34 +- src/mame/drivers/hk68v10.cpp | 12 +- src/mame/drivers/hnayayoi.cpp | 4 +- src/mame/drivers/hng64.cpp | 40 +- src/mame/drivers/homedata.cpp | 4 +- src/mame/drivers/homelab.cpp | 42 +- src/mame/drivers/homerun.cpp | 2 +- src/mame/drivers/homez80.cpp | 14 +- src/mame/drivers/hornet.cpp | 60 +- src/mame/drivers/hotblock.cpp | 8 +- src/mame/drivers/hotstuff.cpp | 12 +- src/mame/drivers/hp16500.cpp | 20 +- src/mame/drivers/hp49gp.cpp | 10 +- src/mame/drivers/hp64k.cpp | 68 +- src/mame/drivers/hp9845.cpp | 44 +- src/mame/drivers/hp9k.cpp | 38 +- src/mame/drivers/hp9k_3xx.cpp | 30 +- src/mame/drivers/hp_ipc.cpp | 10 +- src/mame/drivers/hprot1.cpp | 8 +- src/mame/drivers/hpz80unk.cpp | 12 +- src/mame/drivers/hshavoc.cpp | 4 +- src/mame/drivers/ht68k.cpp | 6 +- src/mame/drivers/huebler.cpp | 16 +- src/mame/drivers/hunter2.cpp | 14 +- src/mame/drivers/hvyunit.cpp | 32 +- src/mame/drivers/hx20.cpp | 18 +- src/mame/drivers/hyperscan.cpp | 142 +- src/mame/drivers/hyprduel.cpp | 18 +- src/mame/drivers/i7000.cpp | 14 +- src/mame/drivers/ibm3153.cpp | 6 +- src/mame/drivers/ibm6580.cpp | 6 +- src/mame/drivers/ibmpcjr.cpp | 42 +- src/mame/drivers/icecold.cpp | 10 +- src/mame/drivers/ichiban.cpp | 6 +- src/mame/drivers/idsa.cpp | 6 +- src/mame/drivers/ie15.cpp | 62 +- src/mame/drivers/if800.cpp | 4 +- src/mame/drivers/igs009.cpp | 32 +- src/mame/drivers/igs011.cpp | 224 +- src/mame/drivers/igs017.cpp | 170 +- src/mame/drivers/igs_fear.cpp | 6 +- src/mame/drivers/igs_m027.cpp | 14 +- src/mame/drivers/igs_m036.cpp | 6 +- src/mame/drivers/igspoker.cpp | 42 +- src/mame/drivers/imds.cpp | 4 +- src/mame/drivers/imds2.cpp | 16 +- src/mame/drivers/imolagp.cpp | 32 +- src/mame/drivers/imsai.cpp | 4 +- src/mame/drivers/inder.cpp | 26 +- src/mame/drivers/indigo.cpp | 24 +- src/mame/drivers/indy_indigo2.cpp | 148 +- src/mame/drivers/instruct.cpp | 22 +- src/mame/drivers/interact.cpp | 8 +- src/mame/drivers/intrscti.cpp | 8 +- src/mame/drivers/intv.cpp | 2 +- src/mame/drivers/inufuku.cpp | 4 +- src/mame/drivers/invqix.cpp | 12 +- src/mame/drivers/ipc.cpp | 6 +- src/mame/drivers/ipds.cpp | 8 +- src/mame/drivers/iq151.cpp | 22 +- src/mame/drivers/iqblock.cpp | 4 +- src/mame/drivers/iris3130.cpp | 30 +- src/mame/drivers/irisha.cpp | 22 +- src/mame/drivers/isbc8010.cpp | 12 +- src/mame/drivers/isbc8030.cpp | 8 +- src/mame/drivers/istellar.cpp | 22 +- src/mame/drivers/istrebiteli.cpp | 30 +- src/mame/drivers/itech32.cpp | 14 +- src/mame/drivers/itgambl2.cpp | 8 +- src/mame/drivers/itgambl3.cpp | 8 +- src/mame/drivers/itgamble.cpp | 4 +- src/mame/drivers/itt3030.cpp | 14 +- src/mame/drivers/jack.cpp | 12 +- src/mame/drivers/jackal.cpp | 6 +- src/mame/drivers/jackie.cpp | 34 +- src/mame/drivers/jackpool.cpp | 12 +- src/mame/drivers/jade.cpp | 4 +- src/mame/drivers/jaguar.cpp | 34 +- src/mame/drivers/jalmah.cpp | 114 +- src/mame/drivers/jangou.cpp | 28 +- src/mame/drivers/jankenmn.cpp | 2 +- src/mame/drivers/jantotsu.cpp | 30 +- src/mame/drivers/jchan.cpp | 42 +- src/mame/drivers/jclub2.cpp | 48 +- src/mame/drivers/jedi.cpp | 2 +- src/mame/drivers/jeutel.cpp | 6 +- src/mame/drivers/jokrwild.cpp | 10 +- src/mame/drivers/jollyjgr.cpp | 40 +- src/mame/drivers/jongkyo.cpp | 30 +- src/mame/drivers/jonos.cpp | 14 +- src/mame/drivers/joystand.cpp | 34 +- src/mame/drivers/jp.cpp | 8 +- src/mame/drivers/jpmimpct.cpp | 8 +- src/mame/drivers/jpmmps.cpp | 4 +- src/mame/drivers/jpmsys5.cpp | 12 +- src/mame/drivers/jr100.cpp | 46 +- src/mame/drivers/jr200.cpp | 36 +- src/mame/drivers/jrpacman.cpp | 2 +- src/mame/drivers/jtc.cpp | 44 +- src/mame/drivers/jubilee.cpp | 12 +- src/mame/drivers/juicebox.cpp | 16 +- src/mame/drivers/jungleyo.cpp | 4 +- src/mame/drivers/junior.cpp | 12 +- src/mame/drivers/junofrst.cpp | 6 +- src/mame/drivers/jupace.cpp | 18 +- src/mame/drivers/jupiter.cpp | 20 +- src/mame/drivers/k1003.cpp | 8 +- src/mame/drivers/k28.cpp | 36 +- src/mame/drivers/k8915.cpp | 22 +- src/mame/drivers/kaneko16.cpp | 20 +- src/mame/drivers/karnov.cpp | 8 +- src/mame/drivers/kas89.cpp | 18 +- src/mame/drivers/kaypro.cpp | 4 +- src/mame/drivers/kchamp.cpp | 4 +- src/mame/drivers/kenseim.cpp | 12 +- src/mame/drivers/kickgoal.cpp | 6 +- src/mame/drivers/kim1.cpp | 8 +- src/mame/drivers/kingdrby.cpp | 34 +- src/mame/drivers/kingobox.cpp | 6 +- src/mame/drivers/kinst.cpp | 32 +- src/mame/drivers/koftball.cpp | 14 +- src/mame/drivers/koikoi.cpp | 10 +- src/mame/drivers/konamigq.cpp | 20 +- src/mame/drivers/konamigv.cpp | 28 +- src/mame/drivers/konamigx.cpp | 82 +- src/mame/drivers/konamim2.cpp | 96 +- src/mame/drivers/konendev.cpp | 28 +- src/mame/drivers/kontest.cpp | 18 +- src/mame/drivers/ksayakyu.cpp | 2 +- src/mame/drivers/ksys573.cpp | 48 +- src/mame/drivers/kungfur.cpp | 18 +- src/mame/drivers/kurukuru.cpp | 10 +- src/mame/drivers/kyocera.cpp | 22 +- src/mame/drivers/labyrunr.cpp | 2 +- src/mame/drivers/ladybug.cpp | 6 +- src/mame/drivers/laser3k.cpp | 80 +- src/mame/drivers/laserbas.cpp | 26 +- src/mame/drivers/lasso.cpp | 2 +- src/mame/drivers/lastbank.cpp | 26 +- src/mame/drivers/lastduel.cpp | 2 +- src/mame/drivers/lastfght.cpp | 16 +- src/mame/drivers/lazercmd.cpp | 12 +- src/mame/drivers/lbeach.cpp | 22 +- src/mame/drivers/lc80.cpp | 4 +- src/mame/drivers/lcmate2.cpp | 4 +- src/mame/drivers/leapster.cpp | 6 +- src/mame/drivers/legionna.cpp | 10 +- src/mame/drivers/leland.cpp | 2 +- src/mame/drivers/lemmings.cpp | 8 +- src/mame/drivers/lft.cpp | 4 +- src/mame/drivers/lgp.cpp | 10 +- src/mame/drivers/liberate.cpp | 14 +- src/mame/drivers/liberatr.cpp | 6 +- src/mame/drivers/limenko.cpp | 54 +- src/mame/drivers/littlerb.cpp | 12 +- src/mame/drivers/llc.cpp | 6 +- src/mame/drivers/lola8a.cpp | 6 +- src/mame/drivers/looping.cpp | 20 +- src/mame/drivers/lordgun.cpp | 8 +- src/mame/drivers/lsasquad.cpp | 2 +- src/mame/drivers/ltcasino.cpp | 10 +- src/mame/drivers/ltd.cpp | 20 +- src/mame/drivers/luckgrln.cpp | 56 +- src/mame/drivers/lucky74.cpp | 2 +- src/mame/drivers/lwings.cpp | 6 +- src/mame/drivers/lynx.cpp | 10 +- src/mame/drivers/m107.cpp | 4 +- src/mame/drivers/m14.cpp | 12 +- src/mame/drivers/m20.cpp | 16 +- src/mame/drivers/m24.cpp | 2 +- src/mame/drivers/m5.cpp | 2 +- src/mame/drivers/m52.cpp | 4 +- src/mame/drivers/m63.cpp | 28 +- src/mame/drivers/m72.cpp | 54 +- src/mame/drivers/m79152pc.cpp | 16 +- src/mame/drivers/m79amb.cpp | 18 +- src/mame/drivers/m90.cpp | 2 +- src/mame/drivers/m92.cpp | 12 +- src/mame/drivers/mac.cpp | 14 +- src/mame/drivers/macpci.cpp | 4 +- src/mame/drivers/macrossp.cpp | 2 +- src/mame/drivers/macs.cpp | 28 +- src/mame/drivers/madalien.cpp | 10 +- src/mame/drivers/madmotor.cpp | 2 +- src/mame/drivers/magic10.cpp | 16 +- src/mame/drivers/magicard.cpp | 38 +- src/mame/drivers/magicfly.cpp | 8 +- src/mame/drivers/magictg.cpp | 98 +- src/mame/drivers/majorpkr.cpp | 10 +- src/mame/drivers/mappy.cpp | 2 +- src/mame/drivers/marywu.cpp | 2 +- src/mame/drivers/mastboy.cpp | 20 +- src/mame/drivers/maxaflex.cpp | 32 +- src/mame/drivers/maygay1b.cpp | 10 +- src/mame/drivers/maygayep.cpp | 4 +- src/mame/drivers/maygayv1.cpp | 52 +- src/mame/drivers/mayumi.cpp | 14 +- src/mame/drivers/mazerbla.cpp | 94 +- src/mame/drivers/mbc200.cpp | 20 +- src/mame/drivers/mc10.cpp | 22 +- src/mame/drivers/mc1000.cpp | 10 +- src/mame/drivers/mc1502.cpp | 4 +- src/mame/drivers/mc80.cpp | 2 +- src/mame/drivers/mcatadv.cpp | 2 +- src/mame/drivers/mcb216.cpp | 4 +- src/mame/drivers/mccpm.cpp | 8 +- src/mame/drivers/mcr.cpp | 12 +- src/mame/drivers/mcr3.cpp | 10 +- src/mame/drivers/mcr68.cpp | 6 +- src/mame/drivers/meadows.cpp | 18 +- src/mame/drivers/mediagx.cpp | 110 +- src/mame/drivers/megadriv.cpp | 24 +- src/mame/drivers/megadrvb.cpp | 8 +- src/mame/drivers/megaphx.cpp | 10 +- src/mame/drivers/megaplay.cpp | 52 +- src/mame/drivers/megasys1.cpp | 18 +- src/mame/drivers/megatech.cpp | 42 +- src/mame/drivers/meijinsn.cpp | 24 +- src/mame/drivers/mekd2.cpp | 18 +- src/mame/drivers/mephisto.cpp | 16 +- src/mame/drivers/merit.cpp | 28 +- src/mame/drivers/meritm.cpp | 18 +- src/mame/drivers/mermaid.cpp | 2 +- src/mame/drivers/mes.cpp | 16 +- src/mame/drivers/metalmx.cpp | 20 +- src/mame/drivers/metlfrzr.cpp | 32 +- src/mame/drivers/metro.cpp | 52 +- src/mame/drivers/mexico86.cpp | 4 +- src/mame/drivers/meyc8080.cpp | 26 +- src/mame/drivers/meyc8088.cpp | 20 +- src/mame/drivers/mgames.cpp | 12 +- src/mame/drivers/mgavegas.cpp | 114 +- src/mame/drivers/mgolf.cpp | 18 +- src/mame/drivers/mice.cpp | 4 +- src/mame/drivers/micral.cpp | 12 +- src/mame/drivers/microdec.cpp | 10 +- src/mame/drivers/microkit.cpp | 4 +- src/mame/drivers/micronic.cpp | 6 +- src/mame/drivers/micropin.cpp | 18 +- src/mame/drivers/microvsn.cpp | 68 +- src/mame/drivers/midas.cpp | 10 +- src/mame/drivers/midqslvr.cpp | 56 +- src/mame/drivers/midvunit.cpp | 24 +- src/mame/drivers/midzeus.cpp | 30 +- src/mame/drivers/mikromik.cpp | 6 +- src/mame/drivers/mikrosha.cpp | 4 +- src/mame/drivers/mil4000.cpp | 30 +- src/mame/drivers/mini2440.cpp | 6 +- src/mame/drivers/miniboy7.cpp | 34 +- src/mame/drivers/minicom.cpp | 12 +- src/mame/drivers/minivadr.cpp | 10 +- src/mame/drivers/mirage.cpp | 12 +- src/mame/drivers/mirax.cpp | 28 +- src/mame/drivers/missb2.cpp | 24 +- src/mame/drivers/missile.cpp | 60 +- src/mame/drivers/mitchell.cpp | 10 +- src/mame/drivers/mits680b.cpp | 4 +- src/mame/drivers/mjkjidai.cpp | 2 +- src/mame/drivers/mjsenpu.cpp | 22 +- src/mame/drivers/mjsister.cpp | 30 +- src/mame/drivers/mk1.cpp | 6 +- src/mame/drivers/mk2.cpp | 4 +- src/mame/drivers/mk85.cpp | 4 +- src/mame/drivers/mk90.cpp | 4 +- src/mame/drivers/mkit09.cpp | 2 +- src/mame/drivers/mlanding.cpp | 136 +- src/mame/drivers/mmagic.cpp | 24 +- src/mame/drivers/mmd1.cpp | 16 +- src/mame/drivers/mmodular.cpp | 78 +- src/mame/drivers/mod8.cpp | 6 +- src/mame/drivers/model1.cpp | 2 +- src/mame/drivers/model2.cpp | 84 +- src/mame/drivers/model3.cpp | 186 +- src/mame/drivers/modellot.cpp | 18 +- src/mame/drivers/mogura.cpp | 10 +- src/mame/drivers/mole.cpp | 8 +- src/mame/drivers/molecular.cpp | 20 +- src/mame/drivers/momoko.cpp | 2 +- src/mame/drivers/monty.cpp | 14 +- src/mame/drivers/monzagp.cpp | 60 +- src/mame/drivers/moo.cpp | 4 +- src/mame/drivers/mouser.cpp | 4 +- src/mame/drivers/mpf1.cpp | 6 +- src/mame/drivers/mpu12wbk.cpp | 8 +- src/mame/drivers/mpu3.cpp | 8 +- src/mame/drivers/mpu4.cpp | 16 +- src/mame/drivers/mpu4dealem.cpp | 8 +- src/mame/drivers/mpu4mod2sw.hxx | 2 +- src/mame/drivers/mpu4mod4yam.hxx | 2 +- src/mame/drivers/mpu4plasma.cpp | 14 +- src/mame/drivers/mpu4sw.hxx | 10 +- src/mame/drivers/mpu4vid.cpp | 46 +- src/mame/drivers/mpu5.cpp | 28 +- src/mame/drivers/mpz80.cpp | 12 +- src/mame/drivers/mquake.cpp | 2 +- src/mame/drivers/mrdo.cpp | 2 +- src/mame/drivers/mrgame.cpp | 36 +- src/mame/drivers/ms0515.cpp | 24 +- src/mame/drivers/ms32.cpp | 6 +- src/mame/drivers/ms9540.cpp | 6 +- src/mame/drivers/msbc1.cpp | 2 +- src/mame/drivers/msisaac.cpp | 4 +- src/mame/drivers/mstation.cpp | 34 +- src/mame/drivers/mugsmash.cpp | 2 +- src/mame/drivers/multfish.cpp | 36 +- src/mame/drivers/multi16.cpp | 8 +- src/mame/drivers/multi8.cpp | 46 +- src/mame/drivers/multigam.cpp | 96 +- src/mame/drivers/murogem.cpp | 6 +- src/mame/drivers/murogmbl.cpp | 8 +- src/mame/drivers/mustache.cpp | 10 +- src/mame/drivers/mvme147.cpp | 22 +- src/mame/drivers/mvme350.cpp | 4 +- src/mame/drivers/mw18w.cpp | 2 +- src/mame/drivers/mw8080bw.cpp | 40 +- src/mame/drivers/mwarr.cpp | 30 +- src/mame/drivers/mwsub.cpp | 2 +- src/mame/drivers/mx2178.cpp | 14 +- src/mame/drivers/myb3k.cpp | 10 +- src/mame/drivers/mycom.cpp | 42 +- src/mame/drivers/myvision.cpp | 6 +- src/mame/drivers/mz2000.cpp | 58 +- src/mame/drivers/mz2500.cpp | 264 +- src/mame/drivers/mz3500.cpp | 38 +- src/mame/drivers/mz6500.cpp | 4 +- src/mame/drivers/mzr8105.cpp | 12 +- src/mame/drivers/n64.cpp | 34 +- src/mame/drivers/nakajies.cpp | 40 +- src/mame/drivers/namcofl.cpp | 4 +- src/mame/drivers/namcona1.cpp | 22 +- src/mame/drivers/namconb1.cpp | 12 +- src/mame/drivers/namcops2.cpp | 4 +- src/mame/drivers/namcos10.cpp | 50 +- src/mame/drivers/namcos11.cpp | 10 +- src/mame/drivers/namcos12.cpp | 48 +- src/mame/drivers/namcos2.cpp | 6 +- src/mame/drivers/namcos21.cpp | 108 +- src/mame/drivers/namcos22.cpp | 80 +- src/mame/drivers/namcos23.cpp | 324 +- src/mame/drivers/namcos86.cpp | 26 +- src/mame/drivers/nanos.cpp | 34 +- src/mame/drivers/naomi.cpp | 42 +- src/mame/drivers/nascom1.cpp | 34 +- src/mame/drivers/naughtyb.cpp | 2 +- src/mame/drivers/nbmj8688.cpp | 16 +- src/mame/drivers/nbmj8891.cpp | 24 +- src/mame/drivers/nbmj8900.cpp | 4 +- src/mame/drivers/nbmj8991.cpp | 8 +- src/mame/drivers/nbmj9195.cpp | 2 +- src/mame/drivers/nc.cpp | 4 +- src/mame/drivers/nemesis.cpp | 4 +- src/mame/drivers/neogeo.cpp | 78 +- src/mame/drivers/neogeocd.cpp | 72 +- src/mame/drivers/neopcb.cpp | 32 +- src/mame/drivers/neoprint.cpp | 46 +- src/mame/drivers/neptunp2.cpp | 4 +- src/mame/drivers/nes.cpp | 2 +- src/mame/drivers/newbrain.cpp | 12 +- src/mame/drivers/next.cpp | 52 +- src/mame/drivers/nexus3d.cpp | 6 +- src/mame/drivers/ngen.cpp | 56 +- src/mame/drivers/ngp.cpp | 32 +- src/mame/drivers/nibble.cpp | 8 +- src/mame/drivers/nightgal.cpp | 28 +- src/mame/drivers/ninjakd2.cpp | 16 +- src/mame/drivers/ninjaw.cpp | 4 +- src/mame/drivers/niyanpai.cpp | 6 +- src/mame/drivers/nmg5.cpp | 24 +- src/mame/drivers/nmk16.cpp | 54 +- src/mame/drivers/nokia_3310.cpp | 62 +- src/mame/drivers/norautp.cpp | 26 +- src/mame/drivers/notetaker.cpp | 112 +- src/mame/drivers/nova2001.cpp | 4 +- src/mame/drivers/novag6502.cpp | 34 +- src/mame/drivers/nsm.cpp | 6 +- src/mame/drivers/nsmpoker.cpp | 8 +- src/mame/drivers/nss.cpp | 18 +- src/mame/drivers/nwk-tr.cpp | 36 +- src/mame/drivers/nycaptor.cpp | 4 +- src/mame/drivers/nyny.cpp | 28 +- src/mame/drivers/ob68k1a.cpp | 2 +- src/mame/drivers/octopus.cpp | 38 +- src/mame/drivers/odyssey2.cpp | 46 +- src/mame/drivers/offtwall.cpp | 10 +- src/mame/drivers/ojankohs.cpp | 6 +- src/mame/drivers/okean240.cpp | 26 +- src/mame/drivers/olibochu.cpp | 20 +- src/mame/drivers/omegrace.cpp | 4 +- src/mame/drivers/onetwo.cpp | 12 +- src/mame/drivers/onyx.cpp | 2 +- src/mame/drivers/opwolf.cpp | 8 +- src/mame/drivers/orbit.cpp | 4 +- src/mame/drivers/oric.cpp | 36 +- src/mame/drivers/osbexec.cpp | 40 +- src/mame/drivers/osi.cpp | 2 +- src/mame/drivers/othello.cpp | 12 +- src/mame/drivers/overdriv.cpp | 4 +- src/mame/drivers/p112.cpp | 4 +- src/mame/drivers/p8k.cpp | 14 +- src/mame/drivers/pachifev.cpp | 12 +- src/mame/drivers/pacman.cpp | 44 +- src/mame/drivers/palm.cpp | 16 +- src/mame/drivers/palm_dbg.hxx | 12 +- src/mame/drivers/palmz22.cpp | 10 +- src/mame/drivers/panicr.cpp | 40 +- src/mame/drivers/pasha2.cpp | 12 +- src/mame/drivers/paso1600.cpp | 18 +- src/mame/drivers/pasogo.cpp | 30 +- src/mame/drivers/pasopia.cpp | 30 +- src/mame/drivers/pasopia7.cpp | 96 +- src/mame/drivers/pastelg.cpp | 2 +- src/mame/drivers/patinho_feio.cpp | 16 +- src/mame/drivers/pb1000.cpp | 16 +- src/mame/drivers/pbaction.cpp | 2 +- src/mame/drivers/pc100.cpp | 28 +- src/mame/drivers/pc1500.cpp | 14 +- src/mame/drivers/pc1512.cpp | 12 +- src/mame/drivers/pc2000.cpp | 42 +- src/mame/drivers/pc4.cpp | 4 +- src/mame/drivers/pc6001.cpp | 190 +- src/mame/drivers/pc8001.cpp | 6 +- src/mame/drivers/pc8401a.cpp | 6 +- src/mame/drivers/pc8801.cpp | 216 +- src/mame/drivers/pc88va.cpp | 144 +- src/mame/drivers/pc9801.cpp | 230 +- src/mame/drivers/pcat_dyn.cpp | 2 +- src/mame/drivers/pcat_nit.cpp | 4 +- src/mame/drivers/pcd.cpp | 20 +- src/mame/drivers/pce.cpp | 2 +- src/mame/drivers/pce220.cpp | 72 +- src/mame/drivers/pcfx.cpp | 26 +- src/mame/drivers/pcipc.cpp | 2 +- src/mame/drivers/pcktgal.cpp | 2 +- src/mame/drivers/pcm.cpp | 18 +- src/mame/drivers/pcw.cpp | 24 +- src/mame/drivers/pcw16.cpp | 8 +- src/mame/drivers/pcxt.cpp | 28 +- src/mame/drivers/pda600.cpp | 8 +- src/mame/drivers/pdp1.cpp | 56 +- src/mame/drivers/pdp11.cpp | 46 +- src/mame/drivers/pegasus.cpp | 44 +- src/mame/drivers/pengadvb.cpp | 8 +- src/mame/drivers/pengo.cpp | 10 +- src/mame/drivers/pentagon.cpp | 12 +- src/mame/drivers/peoplepc.cpp | 14 +- src/mame/drivers/peplus.cpp | 106 +- src/mame/drivers/pes.cpp | 6 +- src/mame/drivers/pet.cpp | 60 +- src/mame/drivers/peyper.cpp | 10 +- src/mame/drivers/pg685.cpp | 4 +- src/mame/drivers/pgm.cpp | 8 +- src/mame/drivers/pgm2.cpp | 22 +- src/mame/drivers/phantom.cpp | 2 +- src/mame/drivers/phc25.cpp | 2 +- src/mame/drivers/phoenix.cpp | 2 +- src/mame/drivers/photon.cpp | 20 +- src/mame/drivers/photon2.cpp | 14 +- src/mame/drivers/photoply.cpp | 2 +- src/mame/drivers/phunsy.cpp | 34 +- src/mame/drivers/piggypas.cpp | 4 +- src/mame/drivers/pimps.cpp | 4 +- src/mame/drivers/pinball2k.cpp | 76 +- src/mame/drivers/pingpong.cpp | 6 +- src/mame/drivers/pinkiri8.cpp | 38 +- src/mame/drivers/pipbug.cpp | 2 +- src/mame/drivers/pipedrm.cpp | 2 +- src/mame/drivers/pipeline.cpp | 24 +- src/mame/drivers/pirates.cpp | 20 +- src/mame/drivers/pitagjr.cpp | 4 +- src/mame/drivers/pk8000.cpp | 26 +- src/mame/drivers/pkscram.cpp | 14 +- src/mame/drivers/pktgaldx.cpp | 8 +- src/mame/drivers/plan80.cpp | 20 +- src/mame/drivers/play_1.cpp | 22 +- src/mame/drivers/play_2.cpp | 22 +- src/mame/drivers/play_3.cpp | 28 +- src/mame/drivers/playch10.cpp | 8 +- src/mame/drivers/playmark.cpp | 14 +- src/mame/drivers/plus4.cpp | 26 +- src/mame/drivers/pluto5.cpp | 16 +- src/mame/drivers/plygonet.cpp | 84 +- src/mame/drivers/pm68k.cpp | 8 +- src/mame/drivers/pmd85.cpp | 4 +- src/mame/drivers/pmi80.cpp | 2 +- src/mame/drivers/pntnpuzl.cpp | 14 +- src/mame/drivers/pockchal.cpp | 6 +- src/mame/drivers/pockstat.cpp | 70 +- src/mame/drivers/pofo.cpp | 32 +- src/mame/drivers/poisk1.cpp | 68 +- src/mame/drivers/pokechmp.cpp | 4 +- src/mame/drivers/pokemini.cpp | 54 +- src/mame/drivers/poker72.cpp | 12 +- src/mame/drivers/polepos.cpp | 8 +- src/mame/drivers/policetr.cpp | 4 +- src/mame/drivers/poly.cpp | 6 +- src/mame/drivers/poly880.cpp | 2 +- src/mame/drivers/poolshrk.cpp | 8 +- src/mame/drivers/popeye.cpp | 8 +- src/mame/drivers/popobear.cpp | 30 +- src/mame/drivers/powerbal.cpp | 6 +- src/mame/drivers/ppmast93.cpp | 8 +- src/mame/drivers/prestige.cpp | 54 +- src/mame/drivers/pro80.cpp | 10 +- src/mame/drivers/prof180x.cpp | 4 +- src/mame/drivers/prof80.cpp | 4 +- src/mame/drivers/progolf.cpp | 28 +- src/mame/drivers/prophet600.cpp | 8 +- src/mame/drivers/proteus3.cpp | 26 +- src/mame/drivers/psikyo.cpp | 16 +- src/mame/drivers/psikyo4.cpp | 4 +- src/mame/drivers/psikyosh.cpp | 12 +- src/mame/drivers/psion.cpp | 16 +- src/mame/drivers/psx.cpp | 20 +- src/mame/drivers/pt68k4.cpp | 16 +- src/mame/drivers/ptcsol.cpp | 46 +- src/mame/drivers/pturn.cpp | 10 +- src/mame/drivers/puckpkmn.cpp | 2 +- src/mame/drivers/pulsar.cpp | 2 +- src/mame/drivers/punchout.cpp | 2 +- src/mame/drivers/pv1000.cpp | 40 +- src/mame/drivers/pv2000.cpp | 14 +- src/mame/drivers/pv9234.cpp | 8 +- src/mame/drivers/pve500.cpp | 2 +- src/mame/drivers/px4.cpp | 58 +- src/mame/drivers/px8.cpp | 12 +- src/mame/drivers/pyl601.cpp | 60 +- src/mame/drivers/pyson.cpp | 4 +- src/mame/drivers/pzletime.cpp | 18 +- src/mame/drivers/qdrmfgp.cpp | 2 +- src/mame/drivers/qix.cpp | 14 +- src/mame/drivers/ql.cpp | 8 +- src/mame/drivers/qtsbc.cpp | 8 +- src/mame/drivers/quakeat.cpp | 4 +- src/mame/drivers/quasar.cpp | 2 +- src/mame/drivers/queen.cpp | 32 +- src/mame/drivers/quizo.cpp | 16 +- src/mame/drivers/quizpun2.cpp | 22 +- src/mame/drivers/quizshow.cpp | 18 +- src/mame/drivers/qx10.cpp | 30 +- src/mame/drivers/r2dtank.cpp | 24 +- src/mame/drivers/r2dx_v33.cpp | 26 +- src/mame/drivers/r9751.cpp | 54 +- src/mame/drivers/rabbit.cpp | 58 +- src/mame/drivers/raiden.cpp | 12 +- src/mame/drivers/raiden2.cpp | 54 +- src/mame/drivers/rainbow.cpp | 124 +- src/mame/drivers/rambo.cpp | 26 +- src/mame/drivers/rampart.cpp | 2 +- src/mame/drivers/rastersp.cpp | 78 +- src/mame/drivers/ravens.cpp | 10 +- src/mame/drivers/rbisland.cpp | 4 +- src/mame/drivers/rbmk.cpp | 12 +- src/mame/drivers/rc702.cpp | 10 +- src/mame/drivers/rc759.cpp | 16 +- src/mame/drivers/rcorsair.cpp | 4 +- src/mame/drivers/rd100.cpp | 10 +- src/mame/drivers/rd110.cpp | 16 +- src/mame/drivers/re900.cpp | 18 +- src/mame/drivers/realbrk.cpp | 4 +- src/mame/drivers/redclash.cpp | 4 +- src/mame/drivers/renegade.cpp | 14 +- src/mame/drivers/replicator.cpp | 72 +- src/mame/drivers/rex6000.cpp | 80 +- src/mame/drivers/rgum.cpp | 10 +- src/mame/drivers/riscpc.cpp | 52 +- src/mame/drivers/rm380z.cpp | 2 +- src/mame/drivers/rmhaihai.cpp | 10 +- src/mame/drivers/rmnimbus.cpp | 2 +- src/mame/drivers/rmt32.cpp | 16 +- src/mame/drivers/rockrage.cpp | 2 +- src/mame/drivers/rocnrope.cpp | 2 +- src/mame/drivers/rohga.cpp | 18 +- src/mame/drivers/rollerg.cpp | 2 +- src/mame/drivers/rollext.cpp | 80 +- src/mame/drivers/rotaryf.cpp | 14 +- src/mame/drivers/roul.cpp | 14 +- src/mame/drivers/route16.cpp | 8 +- src/mame/drivers/rowamet.cpp | 16 +- src/mame/drivers/royalmah.cpp | 94 +- src/mame/drivers/rpunch.cpp | 4 +- src/mame/drivers/rt1715.cpp | 2 +- src/mame/drivers/runaway.cpp | 2 +- src/mame/drivers/rungun.cpp | 18 +- src/mame/drivers/rvoice.cpp | 88 +- src/mame/drivers/rx78.cpp | 26 +- src/mame/drivers/s11.cpp | 6 +- src/mame/drivers/s11a.cpp | 2 +- src/mame/drivers/s11b.cpp | 8 +- src/mame/drivers/s11c.cpp | 4 +- src/mame/drivers/s3.cpp | 12 +- src/mame/drivers/s4.cpp | 12 +- src/mame/drivers/s6.cpp | 10 +- src/mame/drivers/s6a.cpp | 10 +- src/mame/drivers/s7.cpp | 14 +- src/mame/drivers/s8.cpp | 10 +- src/mame/drivers/s8a.cpp | 10 +- src/mame/drivers/s9.cpp | 10 +- src/mame/drivers/sacstate.cpp | 8 +- src/mame/drivers/safarir.cpp | 28 +- src/mame/drivers/sage2.cpp | 4 +- src/mame/drivers/samcoupe.cpp | 14 +- src/mame/drivers/sandscrp.cpp | 14 +- src/mame/drivers/sangho.cpp | 18 +- src/mame/drivers/sanremmg.cpp | 4 +- src/mame/drivers/sanremo.cpp | 8 +- src/mame/drivers/sapi1.cpp | 44 +- src/mame/drivers/saturn.cpp | 8 +- src/mame/drivers/sauro.cpp | 2 +- src/mame/drivers/savia84.cpp | 8 +- src/mame/drivers/savquest.cpp | 64 +- src/mame/drivers/sbc6510.cpp | 8 +- src/mame/drivers/sbowling.cpp | 18 +- src/mame/drivers/sbrain.cpp | 28 +- src/mame/drivers/sbrkout.cpp | 28 +- src/mame/drivers/sc1.cpp | 6 +- src/mame/drivers/sc2.cpp | 14 +- src/mame/drivers/scobra.cpp | 2 +- src/mame/drivers/scorpion.cpp | 8 +- src/mame/drivers/scregg.cpp | 2 +- src/mame/drivers/scv.cpp | 86 +- src/mame/drivers/sdk80.cpp | 8 +- src/mame/drivers/sdk85.cpp | 4 +- src/mame/drivers/sdk86.cpp | 4 +- src/mame/drivers/seabattl.cpp | 12 +- src/mame/drivers/sealy.cpp | 4 +- src/mame/drivers/seattle.cpp | 144 +- src/mame/drivers/seattlecmp.cpp | 4 +- src/mame/drivers/segac2.cpp | 26 +- src/mame/drivers/segae.cpp | 30 +- src/mame/drivers/segag80r.cpp | 32 +- src/mame/drivers/segag80v.cpp | 18 +- src/mame/drivers/segahang.cpp | 12 +- src/mame/drivers/segajw.cpp | 16 +- src/mame/drivers/segald.cpp | 44 +- src/mame/drivers/segam1.cpp | 4 +- src/mame/drivers/segaorun.cpp | 36 +- src/mame/drivers/segapico.cpp | 12 +- src/mame/drivers/segapm.cpp | 4 +- src/mame/drivers/segas16a.cpp | 28 +- src/mame/drivers/segas16b.cpp | 54 +- src/mame/drivers/segas18.cpp | 12 +- src/mame/drivers/segas24.cpp | 38 +- src/mame/drivers/segas32.cpp | 68 +- src/mame/drivers/segasp.cpp | 4 +- src/mame/drivers/segaufo.cpp | 22 +- src/mame/drivers/segaxbd.cpp | 56 +- src/mame/drivers/segaybd.cpp | 22 +- src/mame/drivers/seibuspi.cpp | 12 +- src/mame/drivers/seicross.cpp | 4 +- src/mame/drivers/seicupbl.cpp | 20 +- src/mame/drivers/selz80.cpp | 10 +- src/mame/drivers/sengokmj.cpp | 24 +- src/mame/drivers/seta.cpp | 36 +- src/mame/drivers/seta2.cpp | 50 +- src/mame/drivers/sf.cpp | 2 +- src/mame/drivers/sfbonus.cpp | 100 +- src/mame/drivers/sfcbox.cpp | 6 +- src/mame/drivers/sfkick.cpp | 28 +- src/mame/drivers/sg1000.cpp | 2 +- src/mame/drivers/sg1000a.cpp | 2 +- src/mame/drivers/shadfrce.cpp | 2 +- src/mame/drivers/shougi.cpp | 12 +- src/mame/drivers/shtzone.cpp | 4 +- src/mame/drivers/shuuz.cpp | 4 +- src/mame/drivers/sidepckt.cpp | 12 +- src/mame/drivers/sigmab52.cpp | 12 +- src/mame/drivers/sigmab98.cpp | 92 +- src/mame/drivers/silvmil.cpp | 12 +- src/mame/drivers/simpl156.cpp | 8 +- src/mame/drivers/simple_st0016.cpp | 4 +- src/mame/drivers/simpsons.cpp | 2 +- src/mame/drivers/skeetsht.cpp | 16 +- src/mame/drivers/skimaxx.cpp | 72 +- src/mame/drivers/skyarmy.cpp | 14 +- src/mame/drivers/skyfox.cpp | 6 +- src/mame/drivers/skykid.cpp | 2 +- src/mame/drivers/skylncr.cpp | 46 +- src/mame/drivers/skyraid.cpp | 2 +- src/mame/drivers/slapfght.cpp | 4 +- src/mame/drivers/slapshot.cpp | 4 +- src/mame/drivers/slc1.cpp | 10 +- src/mame/drivers/sliver.cpp | 34 +- src/mame/drivers/slotcarn.cpp | 18 +- src/mame/drivers/sm1800.cpp | 6 +- src/mame/drivers/sm7238.cpp | 26 +- src/mame/drivers/smc777.cpp | 98 +- src/mame/drivers/sms_bootleg.cpp | 2 +- src/mame/drivers/smsmcorp.cpp | 10 +- src/mame/drivers/snes.cpp | 80 +- src/mame/drivers/snesb.cpp | 52 +- src/mame/drivers/snk.cpp | 6 +- src/mame/drivers/snowbros.cpp | 26 +- src/mame/drivers/socrates.cpp | 90 +- src/mame/drivers/softbox.cpp | 6 +- src/mame/drivers/sorcerer.cpp | 10 +- src/mame/drivers/spacefb.cpp | 2 +- src/mame/drivers/spaceg.cpp | 20 +- src/mame/drivers/spartanxtec.cpp | 14 +- src/mame/drivers/spc1000.cpp | 20 +- src/mame/drivers/spc1500.cpp | 86 +- src/mame/drivers/spdodgeb.cpp | 6 +- src/mame/drivers/spec128.cpp | 4 +- src/mame/drivers/specpls3.cpp | 4 +- src/mame/drivers/spectra.cpp | 22 +- src/mame/drivers/spectrum.cpp | 2 +- src/mame/drivers/speedatk.cpp | 6 +- src/mame/drivers/speedbal.cpp | 8 +- src/mame/drivers/speedspn.cpp | 2 +- src/mame/drivers/speglsht.cpp | 20 +- src/mame/drivers/spiders.cpp | 14 +- src/mame/drivers/spinb.cpp | 52 +- src/mame/drivers/splash.cpp | 6 +- src/mame/drivers/splus.cpp | 66 +- src/mame/drivers/spoker.cpp | 30 +- src/mame/drivers/spool99.cpp | 18 +- src/mame/drivers/sprcros2.cpp | 32 +- src/mame/drivers/sprint2.cpp | 8 +- src/mame/drivers/sprint4.cpp | 24 +- src/mame/drivers/sprint8.cpp | 4 +- src/mame/drivers/spy.cpp | 2 +- src/mame/drivers/spyhuntertec.cpp | 38 +- src/mame/drivers/squale.cpp | 36 +- src/mame/drivers/srmp2.cpp | 12 +- src/mame/drivers/srmp5.cpp | 64 +- src/mame/drivers/srmp6.cpp | 68 +- src/mame/drivers/srumbler.cpp | 4 +- src/mame/drivers/ssem.cpp | 56 +- src/mame/drivers/ssfindo.cpp | 26 +- src/mame/drivers/sshangha.cpp | 16 +- src/mame/drivers/sshot.cpp | 8 +- src/mame/drivers/ssingles.cpp | 30 +- src/mame/drivers/sslam.cpp | 6 +- src/mame/drivers/sspeedr.cpp | 2 +- src/mame/drivers/ssrj.cpp | 2 +- src/mame/drivers/sstrangr.cpp | 28 +- src/mame/drivers/ssv.cpp | 24 +- src/mame/drivers/ssystem3.cpp | 6 +- src/mame/drivers/st17xx.cpp | 4 +- src/mame/drivers/st_mp100.cpp | 18 +- src/mame/drivers/st_mp200.cpp | 20 +- src/mame/drivers/starfire.cpp | 12 +- src/mame/drivers/starshp1.cpp | 2 +- src/mame/drivers/starwars.cpp | 2 +- src/mame/drivers/statriv2.cpp | 40 +- src/mame/drivers/stratos.cpp | 16 +- src/mame/drivers/studio2.cpp | 32 +- src/mame/drivers/stuntair.cpp | 24 +- src/mame/drivers/stv.cpp | 58 +- src/mame/drivers/sub.cpp | 40 +- src/mame/drivers/subhuntr.cpp | 4 +- src/mame/drivers/subsino.cpp | 112 +- src/mame/drivers/subsino2.cpp | 80 +- src/mame/drivers/summit.cpp | 8 +- src/mame/drivers/sun1.cpp | 10 +- src/mame/drivers/sun2.cpp | 56 +- src/mame/drivers/sun3.cpp | 86 +- src/mame/drivers/sun3x.cpp | 30 +- src/mame/drivers/sun4.cpp | 150 +- src/mame/drivers/suna16.cpp | 2 +- src/mame/drivers/suna8.cpp | 68 +- src/mame/drivers/supdrapo.cpp | 14 +- src/mame/drivers/supduck.cpp | 16 +- src/mame/drivers/super6.cpp | 4 +- src/mame/drivers/superchs.cpp | 8 +- src/mame/drivers/supercrd.cpp | 10 +- src/mame/drivers/superdq.cpp | 14 +- src/mame/drivers/superqix.cpp | 22 +- src/mame/drivers/superslave.cpp | 4 +- src/mame/drivers/supertnk.cpp | 36 +- src/mame/drivers/superwng.cpp | 22 +- src/mame/drivers/supracan.cpp | 192 +- src/mame/drivers/suprgolf.cpp | 48 +- src/mame/drivers/suprloco.cpp | 2 +- src/mame/drivers/suprnova.cpp | 24 +- src/mame/drivers/suprridr.cpp | 2 +- src/mame/drivers/sv8000.cpp | 30 +- src/mame/drivers/svi318.cpp | 8 +- src/mame/drivers/svision.cpp | 20 +- src/mame/drivers/svmu.cpp | 12 +- src/mame/drivers/swtpc.cpp | 6 +- src/mame/drivers/swyft.cpp | 18 +- src/mame/drivers/sym1.cpp | 14 +- src/mame/drivers/symbolics.cpp | 6 +- src/mame/drivers/sys2900.cpp | 6 +- src/mame/drivers/systec.cpp | 8 +- src/mame/drivers/system1.cpp | 40 +- src/mame/drivers/system16.cpp | 36 +- src/mame/drivers/tail2nos.cpp | 2 +- src/mame/drivers/taito.cpp | 16 +- src/mame/drivers/taito_b.cpp | 4 +- src/mame/drivers/taito_f2.cpp | 8 +- src/mame/drivers/taito_f3.cpp | 22 +- src/mame/drivers/taito_h.cpp | 2 +- src/mame/drivers/taito_l.cpp | 20 +- src/mame/drivers/taito_z.cpp | 16 +- src/mame/drivers/taitoair.cpp | 4 +- src/mame/drivers/taitogn.cpp | 10 +- src/mame/drivers/taitojc.cpp | 2 +- src/mame/drivers/taitopjc.cpp | 112 +- src/mame/drivers/taitotx.cpp | 4 +- src/mame/drivers/taitotz.cpp | 282 +- src/mame/drivers/taitowlf.cpp | 36 +- src/mame/drivers/tandy1t.cpp | 26 +- src/mame/drivers/tandy2k.cpp | 20 +- src/mame/drivers/tank8.cpp | 6 +- src/mame/drivers/tankbust.cpp | 2 +- src/mame/drivers/tapatune.cpp | 36 +- src/mame/drivers/tasman.cpp | 18 +- src/mame/drivers/tatsumi.cpp | 18 +- src/mame/drivers/tattack.cpp | 10 +- src/mame/drivers/tavernie.cpp | 18 +- src/mame/drivers/taxidriv.cpp | 2 +- src/mame/drivers/tb303.cpp | 6 +- src/mame/drivers/tbowl.cpp | 2 +- src/mame/drivers/tceptor.cpp | 8 +- src/mame/drivers/tcl.cpp | 8 +- src/mame/drivers/tdv2324.cpp | 2 +- src/mame/drivers/tec1.cpp | 20 +- src/mame/drivers/techno.cpp | 6 +- src/mame/drivers/tecmo.cpp | 10 +- src/mame/drivers/tecmosys.cpp | 12 +- src/mame/drivers/tehkanwc.cpp | 4 +- src/mame/drivers/tek405x.cpp | 14 +- src/mame/drivers/tek410x.cpp | 4 +- src/mame/drivers/tek440x.cpp | 18 +- src/mame/drivers/tekxp33x.cpp | 4 +- src/mame/drivers/tempest.cpp | 4 +- src/mame/drivers/terak.cpp | 10 +- src/mame/drivers/terracre.cpp | 8 +- src/mame/drivers/tetrisp2.cpp | 6 +- src/mame/drivers/tgtpanic.cpp | 16 +- src/mame/drivers/thayers.cpp | 28 +- src/mame/drivers/thedealr.cpp | 12 +- src/mame/drivers/thedeep.cpp | 4 +- src/mame/drivers/thepit.cpp | 2 +- src/mame/drivers/thief.cpp | 4 +- src/mame/drivers/thunderx.cpp | 6 +- src/mame/drivers/ti630.cpp | 4 +- src/mame/drivers/ti74.cpp | 12 +- src/mame/drivers/ti89.cpp | 24 +- src/mame/drivers/ti990_10.cpp | 2 +- src/mame/drivers/ti99_2.cpp | 8 +- src/mame/drivers/ti99_4p.cpp | 26 +- src/mame/drivers/ti99_4x.cpp | 2 +- src/mame/drivers/ti99_8.cpp | 6 +- src/mame/drivers/ticalc1x.cpp | 10 +- src/mame/drivers/tickee.cpp | 20 +- src/mame/drivers/tiki100.cpp | 24 +- src/mame/drivers/tim011.cpp | 6 +- src/mame/drivers/tim100.cpp | 10 +- src/mame/drivers/timetrv.cpp | 8 +- src/mame/drivers/timex.cpp | 16 +- src/mame/drivers/tispeak.cpp | 18 +- src/mame/drivers/tispellb.cpp | 8 +- src/mame/drivers/tk2000.cpp | 12 +- src/mame/drivers/tk80.cpp | 14 +- src/mame/drivers/tk80bs.cpp | 10 +- src/mame/drivers/tm990189.cpp | 24 +- src/mame/drivers/tmaster.cpp | 58 +- src/mame/drivers/tmc1800.cpp | 16 +- src/mame/drivers/tmc2000e.cpp | 2 +- src/mame/drivers/tmc600.cpp | 2 +- src/mame/drivers/tmmjprd.cpp | 60 +- src/mame/drivers/tmnt.cpp | 58 +- src/mame/drivers/tmspoker.cpp | 12 +- src/mame/drivers/tnzs.cpp | 8 +- src/mame/drivers/toaplan2.cpp | 18 +- src/mame/drivers/toki.cpp | 24 +- src/mame/drivers/tokyocop.cpp | 4 +- src/mame/drivers/tomcat.cpp | 14 +- src/mame/drivers/topspeed.cpp | 10 +- src/mame/drivers/toratora.cpp | 14 +- src/mame/drivers/tourvis.cpp | 6 +- src/mame/drivers/toypop.cpp | 54 +- src/mame/drivers/trackfld.cpp | 8 +- src/mame/drivers/tranz330.cpp | 2 +- src/mame/drivers/travrusa.cpp | 6 +- src/mame/drivers/tricep.cpp | 6 +- src/mame/drivers/triforce.cpp | 22 +- src/mame/drivers/triplhnt.cpp | 8 +- src/mame/drivers/trs80m2.cpp | 12 +- src/mame/drivers/trucocl.cpp | 2 +- src/mame/drivers/trvmadns.cpp | 12 +- src/mame/drivers/ts802.cpp | 6 +- src/mame/drivers/ts803.cpp | 24 +- src/mame/drivers/ts816.cpp | 6 +- src/mame/drivers/tsispch.cpp | 18 +- src/mame/drivers/ttchamp.cpp | 54 +- src/mame/drivers/tugboat.cpp | 12 +- src/mame/drivers/tumbleb.cpp | 32 +- src/mame/drivers/tumblep.cpp | 4 +- src/mame/drivers/turbo.cpp | 8 +- src/mame/drivers/turrett.cpp | 20 +- src/mame/drivers/tutor.cpp | 2 +- src/mame/drivers/tv950.cpp | 2 +- src/mame/drivers/tv990.cpp | 32 +- src/mame/drivers/tvc.cpp | 44 +- src/mame/drivers/tvcapcom.cpp | 4 +- src/mame/drivers/tvgame.cpp | 12 +- src/mame/drivers/twin16.cpp | 2 +- src/mame/drivers/twinkle.cpp | 24 +- src/mame/drivers/twins.cpp | 46 +- src/mame/drivers/tx0.cpp | 54 +- src/mame/drivers/tx1.cpp | 2 +- src/mame/drivers/uapce.cpp | 10 +- src/mame/drivers/uknc.cpp | 4 +- src/mame/drivers/ultratnk.cpp | 6 +- src/mame/drivers/ultrsprt.cpp | 26 +- src/mame/drivers/umipoker.cpp | 16 +- src/mame/drivers/undrfire.cpp | 8 +- src/mame/drivers/unichamp.cpp | 12 +- src/mame/drivers/unico.cpp | 8 +- src/mame/drivers/unior.cpp | 12 +- src/mame/drivers/unistar.cpp | 6 +- src/mame/drivers/univac.cpp | 18 +- src/mame/drivers/unixpc.cpp | 20 +- src/mame/drivers/unkhorse.cpp | 16 +- src/mame/drivers/upscope.cpp | 10 +- src/mame/drivers/uzebox.cpp | 28 +- src/mame/drivers/v1050.cpp | 14 +- src/mame/drivers/v6809.cpp | 22 +- src/mame/drivers/vamphalf.cpp | 44 +- src/mame/drivers/vaportra.cpp | 2 +- src/mame/drivers/vax11.cpp | 4 +- src/mame/drivers/vboy.cpp | 240 +- src/mame/drivers/vc4000.cpp | 4 +- src/mame/drivers/vcombat.cpp | 56 +- src/mame/drivers/vcs80.cpp | 4 +- src/mame/drivers/vd.cpp | 4 +- src/mame/drivers/vector4.cpp | 4 +- src/mame/drivers/vega.cpp | 16 +- src/mame/drivers/vegaeo.cpp | 10 +- src/mame/drivers/vegas.cpp | 84 +- src/mame/drivers/vg5k.cpp | 10 +- src/mame/drivers/vgmplay.cpp | 156 +- src/mame/drivers/vic10.cpp | 26 +- src/mame/drivers/vic20.cpp | 24 +- src/mame/drivers/vicdual.cpp | 20 +- src/mame/drivers/victor9k.cpp | 6 +- src/mame/drivers/vidbrain.cpp | 6 +- src/mame/drivers/videopin.cpp | 4 +- src/mame/drivers/videopkr.cpp | 82 +- src/mame/drivers/vii.cpp | 210 +- src/mame/drivers/vip.cpp | 14 +- src/mame/drivers/viper.cpp | 134 +- src/mame/drivers/vis.cpp | 32 +- src/mame/drivers/vixen.cpp | 18 +- src/mame/drivers/vk100.cpp | 118 +- src/mame/drivers/vlc.cpp | 22 +- src/mame/drivers/votrpss.cpp | 12 +- src/mame/drivers/voyager.cpp | 30 +- src/mame/drivers/vp101.cpp | 4 +- src/mame/drivers/vpoker.cpp | 14 +- src/mame/drivers/vroulet.cpp | 12 +- src/mame/drivers/vt100.cpp | 18 +- src/mame/drivers/vt220.cpp | 4 +- src/mame/drivers/vt240.cpp | 36 +- src/mame/drivers/vt320.cpp | 4 +- src/mame/drivers/vt520.cpp | 6 +- src/mame/drivers/vta2000.cpp | 16 +- src/mame/drivers/vtech1.cpp | 24 +- src/mame/drivers/wacky_gator.cpp | 18 +- src/mame/drivers/wallc.cpp | 26 +- src/mame/drivers/wangpc.cpp | 12 +- src/mame/drivers/warpsped.cpp | 24 +- src/mame/drivers/wecleman.cpp | 36 +- src/mame/drivers/welltris.cpp | 2 +- src/mame/drivers/wgp.cpp | 6 +- src/mame/drivers/wheelfir.cpp | 50 +- src/mame/drivers/whitestar.cpp | 8 +- src/mame/drivers/wicat.cpp | 44 +- src/mame/drivers/wico.cpp | 10 +- src/mame/drivers/wildpkr.cpp | 4 +- src/mame/drivers/williams.cpp | 2 +- src/mame/drivers/wink.cpp | 20 +- src/mame/drivers/witch.cpp | 18 +- src/mame/drivers/wiz.cpp | 8 +- src/mame/drivers/wmg.cpp | 18 +- src/mame/drivers/wms.cpp | 4 +- src/mame/drivers/wolfpack.cpp | 6 +- src/mame/drivers/wpc_95.cpp | 26 +- src/mame/drivers/wpc_an.cpp | 14 +- src/mame/drivers/wpc_dcs.cpp | 18 +- src/mame/drivers/wpc_dot.cpp | 14 +- src/mame/drivers/wpc_s.cpp | 16 +- src/mame/drivers/wrally.cpp | 4 +- src/mame/drivers/wswan.cpp | 2 +- src/mame/drivers/wyvernf0.cpp | 26 +- src/mame/drivers/x07.cpp | 158 +- src/mame/drivers/x1.cpp | 128 +- src/mame/drivers/x1twin.cpp | 4 +- src/mame/drivers/x68k.cpp | 50 +- src/mame/drivers/xain.cpp | 2 +- src/mame/drivers/xavix.cpp | 4 +- src/mame/drivers/xbox.cpp | 2 +- src/mame/drivers/xerox820.cpp | 14 +- src/mame/drivers/xexex.cpp | 6 +- src/mame/drivers/xor100.cpp | 6 +- src/mame/drivers/xorworld.cpp | 2 +- src/mame/drivers/xtheball.cpp | 24 +- src/mame/drivers/xtom3d.cpp | 52 +- src/mame/drivers/ymmu100.cpp | 26 +- src/mame/drivers/z100.cpp | 32 +- src/mame/drivers/z1013.cpp | 22 +- src/mame/drivers/z80dev.cpp | 2 +- src/mame/drivers/z80ne.cpp | 2 +- src/mame/drivers/z88.cpp | 6 +- src/mame/drivers/z9001.cpp | 18 +- src/mame/drivers/zac_1.cpp | 18 +- src/mame/drivers/zac_2.cpp | 14 +- src/mame/drivers/zac_proto.cpp | 6 +- src/mame/drivers/zapcomputer.cpp | 12 +- src/mame/drivers/zaurus.cpp | 12 +- src/mame/drivers/zaxxon.cpp | 8 +- src/mame/drivers/zexall.cpp | 14 +- src/mame/drivers/zn.cpp | 46 +- src/mame/drivers/zorba.cpp | 12 +- src/mame/drivers/zr107.cpp | 28 +- src/mame/drivers/zrt80.cpp | 16 +- src/mame/drivers/zsbc3.cpp | 4 +- src/mame/etc/fd1094dp.cpp | 4 +- src/mame/etc/jrcrypt.cpp | 12 +- src/mame/etc/korgm1.cpp | 4 +- src/mame/etc/template_cpu.cpp | 6 +- src/mame/etc/template_cpu.h | 18 +- src/mame/etc/template_device.cpp | 2 +- src/mame/etc/template_device.h | 2 +- src/mame/etc/template_driver.cpp | 4 +- src/mame/includes/1942.h | 14 +- src/mame/includes/1943.h | 16 +- src/mame/includes/20pacgal.h | 28 +- src/mame/includes/3do.h | 196 +- src/mame/includes/40love.h | 46 +- src/mame/includes/4enraya.h | 12 +- src/mame/includes/8080bw.h | 46 +- src/mame/includes/88games.h | 4 +- src/mame/includes/abc1600.h | 4 +- src/mame/includes/abc80.h | 6 +- src/mame/includes/abc80x.h | 32 +- src/mame/includes/ac1.h | 4 +- src/mame/includes/actfancr.h | 6 +- src/mame/includes/adam.h | 10 +- src/mame/includes/advision.h | 8 +- src/mame/includes/aeroboto.h | 26 +- src/mame/includes/aerofgt.h | 56 +- src/mame/includes/aim65.h | 8 +- src/mame/includes/airbustr.h | 12 +- src/mame/includes/ajax.h | 4 +- src/mame/includes/alesis.h | 16 +- src/mame/includes/aliens.h | 2 +- src/mame/includes/alpha68k.h | 22 +- src/mame/includes/ambush.h | 12 +- src/mame/includes/amiga.h | 80 +- src/mame/includes/ampoker2.h | 4 +- src/mame/includes/amspdwy.h | 14 +- src/mame/includes/amstrad.h | 98 +- src/mame/includes/angelkds.h | 18 +- src/mame/includes/apollo.h | 188 +- src/mame/includes/apple2.h | 64 +- src/mame/includes/apple2gs.h | 130 +- src/mame/includes/apple3.h | 38 +- src/mame/includes/appoooh.h | 28 +- src/mame/includes/aquarium.h | 12 +- src/mame/includes/aquarius.h | 8 +- src/mame/includes/arabian.h | 22 +- src/mame/includes/arcadecl.h | 4 +- src/mame/includes/arcadia.h | 48 +- src/mame/includes/archimds.h | 36 +- src/mame/includes/argus.h | 52 +- src/mame/includes/arkanoid.h | 42 +- src/mame/includes/armedf.h | 32 +- src/mame/includes/artmagic.h | 34 +- src/mame/includes/ashnojoe.h | 22 +- src/mame/includes/asterix.h | 8 +- src/mame/includes/astrocde.h | 96 +- src/mame/includes/astrof.h | 40 +- src/mame/includes/asuka.h | 16 +- src/mame/includes/atarifb.h | 18 +- src/mame/includes/atarig1.h | 20 +- src/mame/includes/atarig42.h | 22 +- src/mame/includes/atarigt.h | 42 +- src/mame/includes/atarigx2.h | 22 +- src/mame/includes/atarist.h | 110 +- src/mame/includes/atarisy1.h | 30 +- src/mame/includes/atarisy2.h | 28 +- src/mame/includes/atetris.h | 14 +- src/mame/includes/atom.h | 2 +- src/mame/includes/aussiebyte.h | 30 +- src/mame/includes/avalnche.h | 6 +- src/mame/includes/avigo.h | 28 +- src/mame/includes/aztarac.h | 6 +- src/mame/includes/b2m.h | 24 +- src/mame/includes/badlands.h | 6 +- src/mame/includes/bagman.h | 30 +- src/mame/includes/balsente.h | 106 +- src/mame/includes/banctec.h | 4 +- src/mame/includes/bankp.h | 12 +- src/mame/includes/baraduke.h | 8 +- src/mame/includes/batman.h | 6 +- src/mame/includes/battlane.h | 6 +- src/mame/includes/battlera.h | 2 +- src/mame/includes/battlex.h | 14 +- src/mame/includes/battlnts.h | 2 +- src/mame/includes/bbc.h | 14 +- src/mame/includes/bbusters.h | 28 +- src/mame/includes/beathead.h | 30 +- src/mame/includes/bebox.h | 16 +- src/mame/includes/beezer.h | 50 +- src/mame/includes/bfm_sc4.h | 24 +- src/mame/includes/bigevglf.h | 48 +- src/mame/includes/bigstrkb.h | 14 +- src/mame/includes/bionicc.h | 14 +- src/mame/includes/bishi.h | 8 +- src/mame/includes/bk.h | 16 +- src/mame/includes/bking.h | 28 +- src/mame/includes/bladestl.h | 2 +- src/mame/includes/blktiger.h | 24 +- src/mame/includes/blmbycar.h | 14 +- src/mame/includes/blockade.h | 8 +- src/mame/includes/blockout.h | 10 +- src/mame/includes/bloodbro.h | 18 +- src/mame/includes/blstroid.h | 4 +- src/mame/includes/blueprnt.h | 10 +- src/mame/includes/bogeyman.h | 12 +- src/mame/includes/bombjack.h | 14 +- src/mame/includes/boogwing.h | 12 +- src/mame/includes/bosco.h | 18 +- src/mame/includes/bottom9.h | 2 +- src/mame/includes/brkthru.h | 12 +- src/mame/includes/bsktball.h | 8 +- src/mame/includes/btime.h | 58 +- src/mame/includes/btoads.h | 48 +- src/mame/includes/bublbobl.h | 44 +- src/mame/includes/buggychl.h | 14 +- src/mame/includes/bullet.h | 6 +- src/mame/includes/busicom.h | 16 +- src/mame/includes/bw12.h | 2 +- src/mame/includes/bw2.h | 6 +- src/mame/includes/bwing.h | 16 +- src/mame/includes/bzone.h | 4 +- src/mame/includes/cabal.h | 8 +- src/mame/includes/calomega.h | 8 +- src/mame/includes/canyon.h | 4 +- src/mame/includes/capbowl.h | 8 +- src/mame/includes/carpolo.h | 30 +- src/mame/includes/cave.h | 62 +- src/mame/includes/cbasebal.h | 16 +- src/mame/includes/cbuster.h | 18 +- src/mame/includes/ccastles.h | 26 +- src/mame/includes/cchasm.h | 2 +- src/mame/includes/cclimber.h | 46 +- src/mame/includes/cdi.h | 14 +- src/mame/includes/centiped.h | 38 +- src/mame/includes/cgc7900.h | 32 +- src/mame/includes/chaknpop.h | 32 +- src/mame/includes/champbas.h | 18 +- src/mame/includes/changela.h | 64 +- src/mame/includes/channelf.h | 14 +- src/mame/includes/cheekyms.h | 10 +- src/mame/includes/chihiro.h | 110 +- src/mame/includes/chqflag.h | 2 +- src/mame/includes/cidelsa.h | 6 +- src/mame/includes/cinemat.h | 70 +- src/mame/includes/circus.h | 10 +- src/mame/includes/circusc.h | 18 +- src/mame/includes/cischeat.h | 38 +- src/mame/includes/citycon.h | 10 +- src/mame/includes/cloak.h | 22 +- src/mame/includes/cloud9.h | 22 +- src/mame/includes/clshroad.h | 10 +- src/mame/includes/cninja.h | 22 +- src/mame/includes/coco.h | 34 +- src/mame/includes/coco12.h | 4 +- src/mame/includes/coco3.h | 6 +- src/mame/includes/coleco.h | 10 +- src/mame/includes/combatsc.h | 26 +- src/mame/includes/commando.h | 16 +- src/mame/includes/compgolf.h | 8 +- src/mame/includes/comquest.h | 4 +- src/mame/includes/comx35.h | 4 +- src/mame/includes/concept.h | 8 +- src/mame/includes/contra.h | 20 +- src/mame/includes/coolpool.h | 30 +- src/mame/includes/cop01.h | 10 +- src/mame/includes/copsnrob.h | 18 +- src/mame/includes/cosmic.h | 28 +- src/mame/includes/cosmicos.h | 6 +- src/mame/includes/cps1.h | 64 +- src/mame/includes/cps3.h | 98 +- src/mame/includes/crbaloon.h | 18 +- src/mame/includes/crgolf.h | 24 +- src/mame/includes/crimfght.h | 2 +- src/mame/includes/crospang.h | 8 +- src/mame/includes/crshrace.h | 8 +- src/mame/includes/crvision.h | 6 +- src/mame/includes/cvs.h | 28 +- src/mame/includes/cxhumax.h | 66 +- src/mame/includes/cyberbal.h | 28 +- src/mame/includes/dai.h | 10 +- src/mame/includes/darius.h | 26 +- src/mame/includes/darkmist.h | 16 +- src/mame/includes/darkseal.h | 16 +- src/mame/includes/dassault.h | 14 +- src/mame/includes/dbz.h | 6 +- src/mame/includes/dc.h | 40 +- src/mame/includes/dccons.h | 2 +- src/mame/includes/dcheese.h | 18 +- src/mame/includes/dcon.h | 18 +- src/mame/includes/dday.h | 10 +- src/mame/includes/ddragon.h | 42 +- src/mame/includes/ddragon3.h | 38 +- src/mame/includes/ddribble.h | 16 +- src/mame/includes/deadang.h | 10 +- src/mame/includes/dec0.h | 38 +- src/mame/includes/dec8.h | 26 +- src/mame/includes/deco32.h | 70 +- src/mame/includes/deco_mlc.h | 32 +- src/mame/includes/decocass.h | 98 +- src/mame/includes/deniam.h | 12 +- src/mame/includes/dgn_beta.h | 8 +- src/mame/includes/dgnalpha.h | 6 +- src/mame/includes/dietgo.h | 10 +- src/mame/includes/digdug.h | 16 +- src/mame/includes/divebomb.h | 18 +- src/mame/includes/djboy.h | 32 +- src/mame/includes/djmain.h | 20 +- src/mame/includes/dkong.h | 70 +- src/mame/includes/dm7000.h | 12 +- src/mame/includes/docastle.h | 14 +- src/mame/includes/dogfgt.h | 10 +- src/mame/includes/dooyong.h | 52 +- src/mame/includes/dragon.h | 4 +- src/mame/includes/dragrace.h | 6 +- src/mame/includes/drgnmst.h | 32 +- src/mame/includes/dribling.h | 18 +- src/mame/includes/drmicro.h | 4 +- src/mame/includes/dynax.h | 76 +- src/mame/includes/dynduke.h | 10 +- src/mame/includes/ec184x.h | 2 +- src/mame/includes/einstein.h | 16 +- src/mame/includes/electron.h | 24 +- src/mame/includes/elf.h | 2 +- src/mame/includes/eolith.h | 6 +- src/mame/includes/epos.h | 6 +- src/mame/includes/eprom.h | 6 +- src/mame/includes/equites.h | 34 +- src/mame/includes/esd16.h | 18 +- src/mame/includes/espial.h | 20 +- src/mame/includes/esripsys.h | 56 +- src/mame/includes/eti660.h | 10 +- src/mame/includes/exedexes.h | 12 +- src/mame/includes/exerion.h | 26 +- src/mame/includes/exidy.h | 44 +- src/mame/includes/exidy440.h | 40 +- src/mame/includes/exprraid.h | 12 +- src/mame/includes/exterm.h | 18 +- src/mame/includes/exzisus.h | 14 +- src/mame/includes/f1gp.h | 38 +- src/mame/includes/fantland.h | 14 +- src/mame/includes/fastfred.h | 28 +- src/mame/includes/fastlane.h | 10 +- src/mame/includes/fcombat.h | 14 +- src/mame/includes/fgoal.h | 12 +- src/mame/includes/fidelz80.h | 28 +- src/mame/includes/finalizr.h | 20 +- src/mame/includes/firetrap.h | 20 +- src/mame/includes/firetrk.h | 48 +- src/mame/includes/fitfight.h | 24 +- src/mame/includes/flkatck.h | 4 +- src/mame/includes/flstory.h | 76 +- src/mame/includes/fm7.h | 182 +- src/mame/includes/fmtowns.h | 210 +- src/mame/includes/foodf.h | 8 +- src/mame/includes/freekick.h | 10 +- src/mame/includes/fromanc2.h | 26 +- src/mame/includes/fromance.h | 50 +- src/mame/includes/funkybee.h | 6 +- src/mame/includes/funkyjet.h | 8 +- src/mame/includes/funworld.h | 6 +- src/mame/includes/funybubl.h | 6 +- src/mame/includes/fuukifg2.h | 12 +- src/mame/includes/fuukifg3.h | 20 +- src/mame/includes/gaelco.h | 12 +- src/mame/includes/gaelco2.h | 22 +- src/mame/includes/gaelco3d.h | 48 +- src/mame/includes/gaelcrpt.h | 2 +- src/mame/includes/gaiden.h | 36 +- src/mame/includes/galaga.h | 30 +- src/mame/includes/galastrm.h | 16 +- src/mame/includes/galaxia.h | 4 +- src/mame/includes/galaxian.h | 108 +- src/mame/includes/galaxold.h | 100 +- src/mame/includes/galaxy.h | 14 +- src/mame/includes/galeb.h | 4 +- src/mame/includes/galivan.h | 22 +- src/mame/includes/galpani2.h | 24 +- src/mame/includes/galpanic.h | 6 +- src/mame/includes/galspnbl.h | 12 +- src/mame/includes/gamate.h | 4 +- src/mame/includes/gamecom.h | 54 +- src/mame/includes/gameplan.h | 18 +- src/mame/includes/gamepock.h | 18 +- src/mame/includes/gaplus.h | 16 +- src/mame/includes/gatron.h | 4 +- src/mame/includes/gauntlet.h | 10 +- src/mame/includes/gb.h | 38 +- src/mame/includes/gba.h | 20 +- src/mame/includes/gberet.h | 22 +- src/mame/includes/gcpinbal.h | 32 +- src/mame/includes/gijoe.h | 8 +- src/mame/includes/ginganin.h | 10 +- src/mame/includes/gladiatr.h | 18 +- src/mame/includes/glass.h | 10 +- src/mame/includes/gng.h | 10 +- src/mame/includes/goal92.h | 16 +- src/mame/includes/goindol.h | 20 +- src/mame/includes/goldstar.h | 72 +- src/mame/includes/gomoku.h | 20 +- src/mame/includes/gotcha.h | 12 +- src/mame/includes/gottlieb.h | 48 +- src/mame/includes/gotya.h | 12 +- src/mame/includes/gp32.h | 90 +- src/mame/includes/gradius3.h | 6 +- src/mame/includes/grchamp.h | 36 +- src/mame/includes/gridlee.h | 30 +- src/mame/includes/groundfx.h | 14 +- src/mame/includes/gstriker.h | 16 +- src/mame/includes/gsword.h | 12 +- src/mame/includes/gumbo.h | 6 +- src/mame/includes/gunbustr.h | 10 +- src/mame/includes/gundealr.h | 12 +- src/mame/includes/gunsmoke.h | 20 +- src/mame/includes/gyruss.h | 14 +- src/mame/includes/hanaawas.h | 6 +- src/mame/includes/harddriv.h | 252 +- src/mame/includes/hcastle.h | 8 +- src/mame/includes/hec2hrp.h | 60 +- src/mame/includes/hexion.h | 8 +- src/mame/includes/hh_tms1k.h | 26 +- src/mame/includes/hh_ucom4.h | 22 +- src/mame/includes/higemaru.h | 8 +- src/mame/includes/himesiki.h | 8 +- src/mame/includes/hitme.h | 10 +- src/mame/includes/hnayayoi.h | 10 +- src/mame/includes/hng64.h | 166 +- src/mame/includes/holeland.h | 10 +- src/mame/includes/homedata.h | 22 +- src/mame/includes/homerun.h | 12 +- src/mame/includes/hp48.h | 50 +- src/mame/includes/hp9845.h | 54 +- src/mame/includes/huebler.h | 4 +- src/mame/includes/hx20.h | 6 +- src/mame/includes/hyhoo.h | 4 +- src/mame/includes/hyperspt.h | 18 +- src/mame/includes/hyprduel.h | 54 +- src/mame/includes/ikki.h | 12 +- src/mame/includes/imds2.h | 24 +- src/mame/includes/intv.h | 24 +- src/mame/includes/inufuku.h | 18 +- src/mame/includes/iqblock.h | 8 +- src/mame/includes/irobot.h | 72 +- src/mame/includes/ironhors.h | 16 +- src/mame/includes/itech32.h | 82 +- src/mame/includes/itech8.h | 90 +- src/mame/includes/jack.h | 20 +- src/mame/includes/jackal.h | 12 +- src/mame/includes/jaguar.h | 182 +- src/mame/includes/jailbrek.h | 16 +- src/mame/includes/jedi.h | 36 +- src/mame/includes/jpmimpct.h | 60 +- src/mame/includes/jpmsys5.h | 10 +- src/mame/includes/jupiter.h | 10 +- src/mame/includes/kaneko16.h | 18 +- src/mame/includes/kangaroo.h | 10 +- src/mame/includes/karnov.h | 18 +- src/mame/includes/kaypro.h | 32 +- src/mame/includes/kc.h | 22 +- src/mame/includes/kchamp.h | 12 +- src/mame/includes/kickgoal.h | 14 +- src/mame/includes/kim1.h | 8 +- src/mame/includes/kingobox.h | 22 +- src/mame/includes/klax.h | 2 +- src/mame/includes/kncljoe.h | 12 +- src/mame/includes/konamigx.h | 66 +- src/mame/includes/kopunch.h | 10 +- src/mame/includes/kramermc.h | 4 +- src/mame/includes/ksayakyu.h | 6 +- src/mame/includes/kyocera.h | 18 +- src/mame/includes/kyugo.h | 24 +- src/mame/includes/labyrunr.h | 10 +- src/mame/includes/ladybug.h | 32 +- src/mame/includes/ladyfrog.h | 14 +- src/mame/includes/laserbat.h | 10 +- src/mame/includes/lasso.h | 26 +- src/mame/includes/lastduel.h | 14 +- src/mame/includes/lazercmd.h | 12 +- src/mame/includes/lc80.h | 4 +- src/mame/includes/legionna.h | 38 +- src/mame/includes/leland.h | 112 +- src/mame/includes/lemmings.h | 18 +- src/mame/includes/lethal.h | 4 +- src/mame/includes/lethalj.h | 14 +- src/mame/includes/liberate.h | 28 +- src/mame/includes/liberatr.h | 40 +- src/mame/includes/lisa.h | 26 +- src/mame/includes/lkage.h | 40 +- src/mame/includes/llc.h | 16 +- src/mame/includes/lockon.h | 46 +- src/mame/includes/lordgun.h | 28 +- src/mame/includes/lsasquad.h | 28 +- src/mame/includes/lucky74.h | 20 +- src/mame/includes/lvcards.h | 12 +- src/mame/includes/lviv.h | 12 +- src/mame/includes/lwings.h | 26 +- src/mame/includes/lynx.h | 94 +- src/mame/includes/m10.h | 20 +- src/mame/includes/m107.h | 20 +- src/mame/includes/m5.h | 14 +- src/mame/includes/m52.h | 18 +- src/mame/includes/m57.h | 8 +- src/mame/includes/m58.h | 14 +- src/mame/includes/m62.h | 44 +- src/mame/includes/m72.h | 58 +- src/mame/includes/m79amb.h | 10 +- src/mame/includes/m90.h | 16 +- src/mame/includes/m92.h | 30 +- src/mame/includes/mac.h | 88 +- src/mame/includes/macpci.h | 22 +- src/mame/includes/macrossp.h | 34 +- src/mame/includes/madalien.h | 24 +- src/mame/includes/madmotor.h | 4 +- src/mame/includes/magmax.h | 22 +- src/mame/includes/mainevt.h | 6 +- src/mame/includes/mainsnk.h | 10 +- src/mame/includes/malzak.h | 4 +- src/mame/includes/mappy.h | 24 +- src/mame/includes/marineb.h | 28 +- src/mame/includes/mario.h | 24 +- src/mame/includes/markham.h | 8 +- src/mame/includes/matmania.h | 46 +- src/mame/includes/maygay1b.h | 8 +- src/mame/includes/mbc55x.h | 12 +- src/mame/includes/mbee.h | 42 +- src/mame/includes/mc1502.h | 10 +- src/mame/includes/mc80.h | 6 +- src/mame/includes/mcatadv.h | 20 +- src/mame/includes/mcr.h | 18 +- src/mame/includes/mcr3.h | 30 +- src/mame/includes/mcr68.h | 48 +- src/mame/includes/meadows.h | 24 +- src/mame/includes/megadriv.h | 36 +- src/mame/includes/megasys1.h | 40 +- src/mame/includes/megazone.h | 18 +- src/mame/includes/mermaid.h | 32 +- src/mame/includes/metalmx.h | 8 +- src/mame/includes/metlclsh.h | 16 +- src/mame/includes/metro.h | 52 +- src/mame/includes/mexico86.h | 26 +- src/mame/includes/mhavoc.h | 28 +- src/mame/includes/micro3d.h | 96 +- src/mame/includes/micronic.h | 10 +- src/mame/includes/microtan.h | 26 +- src/mame/includes/midtunit.h | 26 +- src/mame/includes/midvunit.h | 70 +- src/mame/includes/midwunit.h | 16 +- src/mame/includes/midxunit.h | 14 +- src/mame/includes/midyunit.h | 60 +- src/mame/includes/midzeus.h | 26 +- src/mame/includes/midzeus2.h | 14 +- src/mame/includes/mikie.h | 10 +- src/mame/includes/mikro80.h | 6 +- src/mame/includes/mikromik.h | 4 +- src/mame/includes/mitchell.h | 16 +- src/mame/includes/mjkjidai.h | 6 +- src/mame/includes/model1.h | 90 +- src/mame/includes/model2.h | 124 +- src/mame/includes/model3.h | 138 +- src/mame/includes/momoko.h | 30 +- src/mame/includes/moo.h | 12 +- src/mame/includes/mosaic.h | 6 +- src/mame/includes/mouser.h | 14 +- src/mame/includes/mpf1.h | 2 +- src/mame/includes/mpu4.h | 28 +- src/mame/includes/mpz80.h | 16 +- src/mame/includes/mrdo.h | 8 +- src/mame/includes/mrflea.h | 6 +- src/mame/includes/mrjong.h | 6 +- src/mame/includes/ms32.h | 40 +- src/mame/includes/msisaac.h | 22 +- src/mame/includes/msx.h | 12 +- src/mame/includes/mtx.h | 10 +- src/mame/includes/mugsmash.h | 12 +- src/mame/includes/multfish.h | 10 +- src/mame/includes/munchmo.h | 14 +- src/mame/includes/mustache.h | 8 +- src/mame/includes/mw8080bw.h | 64 +- src/mame/includes/mystston.h | 18 +- src/mame/includes/mystwarr.h | 22 +- src/mame/includes/mz700.h | 22 +- src/mame/includes/mz80.h | 18 +- src/mame/includes/n64.h | 200 +- src/mame/includes/n8080.h | 18 +- src/mame/includes/namcofl.h | 10 +- src/mame/includes/namcona1.h | 48 +- src/mame/includes/namconb1.h | 22 +- src/mame/includes/namcond1.h | 4 +- src/mame/includes/namcos1.h | 20 +- src/mame/includes/namcos2.h | 70 +- src/mame/includes/namcos21.h | 66 +- src/mame/includes/namcos22.h | 156 +- src/mame/includes/namcos86.h | 16 +- src/mame/includes/naomi.h | 14 +- src/mame/includes/naughtyb.h | 12 +- src/mame/includes/nb1413m3.h | 2 +- src/mame/includes/nb1414m4.h | 22 +- src/mame/includes/nbmj8688.h | 6 +- src/mame/includes/nbmj8891.h | 12 +- src/mame/includes/nbmj8900.h | 10 +- src/mame/includes/nbmj8991.h | 10 +- src/mame/includes/nbmj9195.h | 10 +- src/mame/includes/nc.h | 8 +- src/mame/includes/nemesis.h | 36 +- src/mame/includes/neogeo.h | 54 +- src/mame/includes/nes.h | 6 +- src/mame/includes/newbrain.h | 8 +- src/mame/includes/news.h | 6 +- src/mame/includes/next.h | 38 +- src/mame/includes/ninjakd2.h | 44 +- src/mame/includes/ninjaw.h | 12 +- src/mame/includes/nitedrvr.h | 24 +- src/mame/includes/niyanpai.h | 18 +- src/mame/includes/nmk16.h | 84 +- src/mame/includes/norautp.h | 6 +- src/mame/includes/nova2001.h | 16 +- src/mame/includes/nycaptor.h | 44 +- src/mame/includes/offtwall.h | 14 +- src/mame/includes/ohmygod.h | 10 +- src/mame/includes/ojankohs.h | 10 +- src/mame/includes/ondra.h | 8 +- src/mame/includes/oneshot.h | 14 +- src/mame/includes/opwolf.h | 60 +- src/mame/includes/orao.h | 8 +- src/mame/includes/orbit.h | 10 +- src/mame/includes/orion.h | 38 +- src/mame/includes/osborne1.h | 38 +- src/mame/includes/osi.h | 12 +- src/mame/includes/othunder.h | 4 +- src/mame/includes/overdriv.h | 4 +- src/mame/includes/p2000t.h | 14 +- src/mame/includes/pacland.h | 22 +- src/mame/includes/pacman.h | 50 +- src/mame/includes/pandoras.h | 10 +- src/mame/includes/paradise.h | 24 +- src/mame/includes/parodius.h | 2 +- src/mame/includes/partner.h | 10 +- src/mame/includes/pass.h | 6 +- src/mame/includes/pastelg.h | 8 +- src/mame/includes/patinhofeio.h | 22 +- src/mame/includes/pbaction.h | 18 +- src/mame/includes/pc1251.h | 8 +- src/mame/includes/pc1350.h | 8 +- src/mame/includes/pc1401.h | 10 +- src/mame/includes/pc1403.h | 10 +- src/mame/includes/pc1512.h | 42 +- src/mame/includes/pc4.h | 32 +- src/mame/includes/pc8401a.h | 12 +- src/mame/includes/pce.h | 14 +- src/mame/includes/pcktgal.h | 6 +- src/mame/includes/pcw.h | 56 +- src/mame/includes/pcw16.h | 12 +- src/mame/includes/pdp1.h | 14 +- src/mame/includes/pecom.h | 2 +- src/mame/includes/pes.h | 12 +- src/mame/includes/pgm.h | 46 +- src/mame/includes/phc25.h | 6 +- src/mame/includes/phoenix.h | 38 +- src/mame/includes/pingpong.h | 8 +- src/mame/includes/pirates.h | 12 +- src/mame/includes/pitnrun.h | 16 +- src/mame/includes/pk8000.h | 18 +- src/mame/includes/pk8020.h | 26 +- src/mame/includes/pktgaldx.h | 16 +- src/mame/includes/playch10.h | 26 +- src/mame/includes/playmark.h | 36 +- src/mame/includes/plygonet.h | 40 +- src/mame/includes/pmd85.h | 12 +- src/mame/includes/pokechmp.h | 6 +- src/mame/includes/polepos.h | 38 +- src/mame/includes/policetr.h | 38 +- src/mame/includes/poly88.h | 14 +- src/mame/includes/poly880.h | 4 +- src/mame/includes/polyplay.h | 8 +- src/mame/includes/poolshrk.h | 8 +- src/mame/includes/pooyan.h | 12 +- src/mame/includes/popeye.h | 34 +- src/mame/includes/portrait.h | 10 +- src/mame/includes/powerins.h | 10 +- src/mame/includes/pp01.h | 14 +- src/mame/includes/prehisle.h | 12 +- src/mame/includes/primo.h | 10 +- src/mame/includes/prof180x.h | 2 +- src/mame/includes/psikyo.h | 40 +- src/mame/includes/psikyo4.h | 20 +- src/mame/includes/psikyosh.h | 34 +- src/mame/includes/psion.h | 38 +- src/mame/includes/psychic5.h | 32 +- src/mame/includes/punchout.h | 26 +- src/mame/includes/px8.h | 22 +- src/mame/includes/qdrmfgp.h | 14 +- src/mame/includes/qix.h | 26 +- src/mame/includes/quasar.h | 10 +- src/mame/includes/quizdna.h | 12 +- src/mame/includes/quizpani.h | 8 +- src/mame/includes/radio86.h | 14 +- src/mame/includes/raiden.h | 28 +- src/mame/includes/raiden2.h | 38 +- src/mame/includes/rallyx.h | 22 +- src/mame/includes/rampart.h | 4 +- src/mame/includes/rastan.h | 6 +- src/mame/includes/rbisland.h | 16 +- src/mame/includes/realbrk.h | 22 +- src/mame/includes/redalert.h | 22 +- src/mame/includes/redclash.h | 14 +- src/mame/includes/relief.h | 8 +- src/mame/includes/renegade.h | 44 +- src/mame/includes/retofinv.h | 36 +- src/mame/includes/rltennis.h | 24 +- src/mame/includes/rm380z.h | 26 +- src/mame/includes/rmnimbus.h | 76 +- src/mame/includes/rockrage.h | 2 +- src/mame/includes/rocnrope.h | 12 +- src/mame/includes/rohga.h | 16 +- src/mame/includes/rollerg.h | 2 +- src/mame/includes/rollrace.h | 12 +- src/mame/includes/route16.h | 18 +- src/mame/includes/rpunch.h | 24 +- src/mame/includes/runaway.h | 8 +- src/mame/includes/rungun.h | 30 +- src/mame/includes/s11.h | 28 +- src/mame/includes/sage2.h | 2 +- src/mame/includes/samcoupe.h | 32 +- src/mame/includes/saturn.h | 526 +-- src/mame/includes/sauro.h | 16 +- src/mame/includes/sbasketb.h | 18 +- src/mame/includes/sbugger.h | 6 +- src/mame/includes/scotrsht.h | 10 +- src/mame/includes/scramble.h | 16 +- src/mame/includes/sderby.h | 14 +- src/mame/includes/segag80r.h | 66 +- src/mame/includes/segag80v.h | 18 +- src/mame/includes/segahang.h | 8 +- src/mame/includes/segaorun.h | 20 +- src/mame/includes/segas16a.h | 26 +- src/mame/includes/segas16b.h | 62 +- src/mame/includes/segas18.h | 24 +- src/mame/includes/segas24.h | 58 +- src/mame/includes/segas32.h | 144 +- src/mame/includes/segasp.h | 2 +- src/mame/includes/segaxbd.h | 64 +- src/mame/includes/segaybd.h | 30 +- src/mame/includes/seibuspi.h | 54 +- src/mame/includes/seicross.h | 18 +- src/mame/includes/senjyo.h | 36 +- src/mame/includes/seta.h | 56 +- src/mame/includes/seta2.h | 26 +- src/mame/includes/sf.h | 12 +- src/mame/includes/shadfrce.h | 12 +- src/mame/includes/shangha3.h | 8 +- src/mame/includes/shangkid.h | 16 +- src/mame/includes/shaolins.h | 10 +- src/mame/includes/shisen.h | 6 +- src/mame/includes/shootout.h | 10 +- src/mame/includes/shuuz.h | 2 +- src/mame/includes/sidearms.h | 20 +- src/mame/includes/sidepckt.h | 20 +- src/mame/includes/silkroad.h | 14 +- src/mame/includes/simpl156.h | 12 +- src/mame/includes/simple_st0016.h | 4 +- src/mame/includes/simpsons.h | 4 +- src/mame/includes/skullxbo.h | 2 +- src/mame/includes/skydiver.h | 4 +- src/mame/includes/skyfox.h | 4 +- src/mame/includes/skykid.h | 20 +- src/mame/includes/skyraid.h | 8 +- src/mame/includes/slapfght.h | 52 +- src/mame/includes/slapshot.h | 18 +- src/mame/includes/slapstic.h | 14 +- src/mame/includes/sms.h | 80 +- src/mame/includes/snes.h | 92 +- src/mame/includes/snk.h | 34 +- src/mame/includes/snk6502.h | 36 +- src/mame/includes/snk68.h | 10 +- src/mame/includes/snookr10.h | 6 +- src/mame/includes/snowbros.h | 16 +- src/mame/includes/solomon.h | 14 +- src/mame/includes/sonson.h | 8 +- src/mame/includes/sorcerer.h | 8 +- src/mame/includes/spacefb.h | 14 +- src/mame/includes/spbactn.h | 14 +- src/mame/includes/spcforce.h | 10 +- src/mame/includes/spdodgeb.h | 12 +- src/mame/includes/special.h | 26 +- src/mame/includes/spectrum.h | 16 +- src/mame/includes/speedatk.h | 22 +- src/mame/includes/speedbal.h | 10 +- src/mame/includes/speedspn.h | 8 +- src/mame/includes/spiders.h | 12 +- src/mame/includes/splash.h | 22 +- src/mame/includes/sprint2.h | 14 +- src/mame/includes/sprint4.h | 6 +- src/mame/includes/sprint8.h | 14 +- src/mame/includes/spy.h | 8 +- src/mame/includes/srmp2.h | 18 +- src/mame/includes/srumbler.h | 6 +- src/mame/includes/sshangha.h | 24 +- src/mame/includes/sslam.h | 20 +- src/mame/includes/ssozumo.h | 16 +- src/mame/includes/sspeedr.h | 6 +- src/mame/includes/ssrj.h | 14 +- src/mame/includes/ssv.h | 36 +- src/mame/includes/ssystem3.h | 20 +- src/mame/includes/stactics.h | 38 +- src/mame/includes/stadhero.h | 6 +- src/mame/includes/starcrus.h | 2 +- src/mame/includes/starfire.h | 18 +- src/mame/includes/starshp1.h | 12 +- src/mame/includes/starwars.h | 38 +- src/mame/includes/stfight.h | 26 +- src/mame/includes/stlforce.h | 20 +- src/mame/includes/strnskil.h | 12 +- src/mame/includes/stv.h | 22 +- src/mame/includes/subs.h | 8 +- src/mame/includes/suna16.h | 14 +- src/mame/includes/suna8.h | 46 +- src/mame/includes/supbtime.h | 8 +- src/mame/includes/super6.h | 8 +- src/mame/includes/super80.h | 46 +- src/mame/includes/superchs.h | 12 +- src/mame/includes/superqix.h | 52 +- src/mame/includes/superslave.h | 4 +- src/mame/includes/suprloco.h | 10 +- src/mame/includes/suprnova.h | 76 +- src/mame/includes/suprridr.h | 16 +- src/mame/includes/suprslam.h | 20 +- src/mame/includes/surpratk.h | 2 +- src/mame/includes/svision.h | 12 +- src/mame/includes/swtpc09.h | 32 +- src/mame/includes/system1.h | 56 +- src/mame/includes/system16.h | 42 +- src/mame/includes/tagteam.h | 8 +- src/mame/includes/tail2nos.h | 8 +- src/mame/includes/taito_b.h | 16 +- src/mame/includes/taito_f2.h | 68 +- src/mame/includes/taito_f3.h | 306 +- src/mame/includes/taito_h.h | 8 +- src/mame/includes/taito_l.h | 18 +- src/mame/includes/taito_o.h | 2 +- src/mame/includes/taito_x.h | 4 +- src/mame/includes/taito_z.h | 26 +- src/mame/includes/taitoair.h | 36 +- src/mame/includes/taitojc.h | 44 +- src/mame/includes/taitosj.h | 60 +- src/mame/includes/tandy2k.h | 22 +- src/mame/includes/tank8.h | 12 +- src/mame/includes/tankbatt.h | 6 +- src/mame/includes/tankbust.h | 20 +- src/mame/includes/taotaido.h | 24 +- src/mame/includes/targeth.h | 8 +- src/mame/includes/tatsumi.h | 82 +- src/mame/includes/taxidriv.h | 20 +- src/mame/includes/tbowl.h | 20 +- src/mame/includes/tceptor.h | 40 +- src/mame/includes/tdv2324.h | 8 +- src/mame/includes/tecmo.h | 14 +- src/mame/includes/tecmo16.h | 26 +- src/mame/includes/tecmosys.h | 42 +- src/mame/includes/tehkanwc.h | 18 +- src/mame/includes/tek405x.h | 2 +- src/mame/includes/terracre.h | 16 +- src/mame/includes/tetrisp2.h | 68 +- src/mame/includes/thedeep.h | 18 +- src/mame/includes/thepit.h | 22 +- src/mame/includes/thief.h | 22 +- src/mame/includes/thomson.h | 234 +- src/mame/includes/thoop2.h | 8 +- src/mame/includes/thunderj.h | 4 +- src/mame/includes/thunderx.h | 6 +- src/mame/includes/ti85.h | 80 +- src/mame/includes/ti89.h | 36 +- src/mame/includes/tiamc1.h | 52 +- src/mame/includes/tigeroad.h | 14 +- src/mame/includes/tiki100.h | 10 +- src/mame/includes/timelimt.h | 8 +- src/mame/includes/timeplt.h | 12 +- src/mame/includes/tmc1800.h | 6 +- src/mame/includes/tmc2000e.h | 4 +- src/mame/includes/tmc600.h | 8 +- src/mame/includes/tmnt.h | 32 +- src/mame/includes/tnzs.h | 12 +- src/mame/includes/toaplan1.h | 76 +- src/mame/includes/toaplan2.h | 38 +- src/mame/includes/toki.h | 12 +- src/mame/includes/toobin.h | 4 +- src/mame/includes/topspeed.h | 28 +- src/mame/includes/tp84.h | 24 +- src/mame/includes/trackfld.h | 20 +- src/mame/includes/tranz330.h | 2 +- src/mame/includes/travrusa.h | 6 +- src/mame/includes/triplhnt.h | 22 +- src/mame/includes/trs80.h | 50 +- src/mame/includes/trs80m2.h | 14 +- src/mame/includes/truco.h | 6 +- src/mame/includes/trucocl.h | 8 +- src/mame/includes/tryout.h | 16 +- src/mame/includes/tsamurai.h | 12 +- src/mame/includes/tsispch.h | 2 +- src/mame/includes/tubep.h | 64 +- src/mame/includes/tumbleb.h | 46 +- src/mame/includes/tumblep.h | 8 +- src/mame/includes/tunhunt.h | 12 +- src/mame/includes/turbo.h | 120 +- src/mame/includes/turrett.h | 68 +- src/mame/includes/tutankhm.h | 14 +- src/mame/includes/twin16.h | 34 +- src/mame/includes/twincobr.h | 38 +- src/mame/includes/tx0.h | 10 +- src/mame/includes/tx1.h | 168 +- src/mame/includes/ultraman.h | 2 +- src/mame/includes/ultratnk.h | 4 +- src/mame/includes/undrfire.h | 18 +- src/mame/includes/unico.h | 12 +- src/mame/includes/usgames.h | 6 +- src/mame/includes/ut88.h | 4 +- src/mame/includes/v1050.h | 22 +- src/mame/includes/vaportra.h | 8 +- src/mame/includes/vastar.h | 24 +- src/mame/includes/vball.h | 10 +- src/mame/includes/vc4000.h | 64 +- src/mame/includes/vector06.h | 18 +- src/mame/includes/vectrex.h | 16 +- src/mame/includes/vendetta.h | 2 +- src/mame/includes/vertigo.h | 96 +- src/mame/includes/vicdual.h | 16 +- src/mame/includes/victory.h | 52 +- src/mame/includes/vidbrain.h | 4 +- src/mame/includes/videopin.h | 8 +- src/mame/includes/vigilant.h | 10 +- src/mame/includes/vindictr.h | 8 +- src/mame/includes/vip.h | 4 +- src/mame/includes/vixen.h | 12 +- src/mame/includes/volfied.h | 18 +- src/mame/includes/vsnes.h | 24 +- src/mame/includes/vtech2.h | 12 +- src/mame/includes/vulgus.h | 12 +- src/mame/includes/warpwarp.h | 6 +- src/mame/includes/warriorb.h | 8 +- src/mame/includes/wc90.h | 34 +- src/mame/includes/wc90b.h | 20 +- src/mame/includes/wecleman.h | 26 +- src/mame/includes/welltris.h | 16 +- src/mame/includes/wgp.h | 28 +- src/mame/includes/williams.h | 56 +- src/mame/includes/wiping.h | 14 +- src/mame/includes/wiz.h | 40 +- src/mame/includes/wolfpack.h | 30 +- src/mame/includes/wpc_dot.h | 12 +- src/mame/includes/wrally.h | 10 +- src/mame/includes/wswan.h | 50 +- src/mame/includes/wwfsstar.h | 8 +- src/mame/includes/x07.h | 86 +- src/mame/includes/x1.h | 150 +- src/mame/includes/x68k.h | 42 +- src/mame/includes/xain.h | 38 +- src/mame/includes/xbox.h | 34 +- src/mame/includes/xbox_usb.h | 170 +- src/mame/includes/xerox820.h | 8 +- src/mame/includes/xevious.h | 20 +- src/mame/includes/xexex.h | 10 +- src/mame/includes/xmen.h | 18 +- src/mame/includes/xorworld.h | 6 +- src/mame/includes/xxmissio.h | 16 +- src/mame/includes/xybots.h | 4 +- src/mame/includes/xyonix.h | 4 +- src/mame/includes/yiear.h | 14 +- src/mame/includes/yunsun16.h | 14 +- src/mame/includes/yunsung8.h | 8 +- src/mame/includes/z80ne.h | 12 +- src/mame/includes/z88.h | 18 +- src/mame/includes/zac2650.h | 6 +- src/mame/includes/zaccaria.h | 14 +- src/mame/includes/zaxxon.h | 50 +- src/mame/includes/zerozone.h | 6 +- src/mame/includes/zodiack.h | 16 +- src/mame/includes/zx.h | 12 +- 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 +- src/mame/video/1942.cpp | 10 +- src/mame/video/1943.cpp | 16 +- src/mame/video/20pacgal.cpp | 30 +- src/mame/video/40love.cpp | 12 +- src/mame/video/4enraya.cpp | 2 +- src/mame/video/733_asr.cpp | 14 +- src/mame/video/733_asr.h | 18 +- src/mame/video/8080bw.cpp | 156 +- src/mame/video/88games.cpp | 2 +- src/mame/video/911_chr.h | 2 +- src/mame/video/911_vdt.cpp | 16 +- src/mame/video/911_vdt.h | 12 +- src/mame/video/abc1600.cpp | 90 +- src/mame/video/abc1600.h | 54 +- src/mame/video/abc80.cpp | 20 +- src/mame/video/abc800.cpp | 22 +- src/mame/video/abc802.cpp | 10 +- src/mame/video/abc806.cpp | 24 +- src/mame/video/ac1.cpp | 4 +- src/mame/video/actfancr.cpp | 2 +- src/mame/video/advision.cpp | 8 +- src/mame/video/aeroboto.cpp | 8 +- src/mame/video/aerofgt.cpp | 46 +- src/mame/video/airbustr.cpp | 2 +- src/mame/video/airraid_dev.cpp | 22 +- src/mame/video/airraid_dev.h | 28 +- src/mame/video/ajax.cpp | 2 +- src/mame/video/alesis.cpp | 2 +- src/mame/video/aliens.cpp | 2 +- src/mame/video/alpha68k.cpp | 36 +- src/mame/video/ambush.cpp | 6 +- src/mame/video/amiga.cpp | 38 +- src/mame/video/amigaaga.cpp | 44 +- src/mame/video/amigaaga.h | 2 +- src/mame/video/ampoker2.cpp | 10 +- src/mame/video/amspdwy.cpp | 8 +- src/mame/video/angelkds.cpp | 24 +- src/mame/video/antic.cpp | 116 +- src/mame/video/antic.h | 194 +- src/mame/video/apollo.cpp | 168 +- src/mame/video/apple2.cpp | 198 +- src/mame/video/apple2.h | 16 +- src/mame/video/apple2gs.cpp | 12 +- src/mame/video/apple3.cpp | 68 +- src/mame/video/appoooh.cpp | 16 +- src/mame/video/aquarium.cpp | 8 +- src/mame/video/aquarius.cpp | 6 +- src/mame/video/arabian.cpp | 28 +- src/mame/video/arcadecl.cpp | 10 +- src/mame/video/arcadia.cpp | 12 +- src/mame/video/archimds.cpp | 10 +- src/mame/video/argus.cpp | 44 +- src/mame/video/arkanoid.cpp | 4 +- src/mame/video/armedf.cpp | 16 +- src/mame/video/artmagic.cpp | 24 +- src/mame/video/ashnojoe.cpp | 2 +- src/mame/video/asterix.cpp | 2 +- src/mame/video/astrocde.cpp | 68 +- src/mame/video/asuka.cpp | 8 +- src/mame/video/atari400.cpp | 2 +- src/mame/video/atarifb.cpp | 8 +- src/mame/video/atarig1.cpp | 8 +- src/mame/video/atarig42.cpp | 14 +- src/mame/video/atarigt.cpp | 52 +- src/mame/video/atarigx2.cpp | 14 +- src/mame/video/atarimo.cpp | 40 +- src/mame/video/atarimo.h | 84 +- src/mame/video/atarirle.cpp | 54 +- src/mame/video/atarirle.h | 56 +- src/mame/video/atarist.cpp | 24 +- src/mame/video/atarisy1.cpp | 50 +- src/mame/video/atarisy2.cpp | 26 +- src/mame/video/atetris.cpp | 6 +- src/mame/video/aussiebyte.cpp | 12 +- src/mame/video/avgdvg.cpp | 64 +- src/mame/video/avgdvg.h | 92 +- src/mame/video/avigo.cpp | 6 +- src/mame/video/aztarac.cpp | 2 +- src/mame/video/b2m.cpp | 10 +- src/mame/video/badlands.cpp | 8 +- src/mame/video/bagman.cpp | 4 +- src/mame/video/balsente.cpp | 8 +- src/mame/video/bankp.cpp | 4 +- src/mame/video/baraduke.cpp | 14 +- src/mame/video/batman.cpp | 22 +- src/mame/video/battlane.cpp | 2 +- src/mame/video/battlex.cpp | 6 +- src/mame/video/battlnts.cpp | 2 +- src/mame/video/bbusters.cpp | 30 +- src/mame/video/beathead.cpp | 10 +- src/mame/video/beezer.cpp | 4 +- src/mame/video/bfm_adr2.cpp | 16 +- src/mame/video/bfm_adr2.h | 16 +- src/mame/video/bfm_dm01.cpp | 12 +- src/mame/video/bfm_dm01.h | 10 +- src/mame/video/bigevglf.cpp | 6 +- src/mame/video/bigstrkb.cpp | 6 +- src/mame/video/bionicc.cpp | 10 +- src/mame/video/bishi.cpp | 2 +- src/mame/video/bk.cpp | 4 +- src/mame/video/bking.cpp | 18 +- src/mame/video/bladestl.cpp | 6 +- src/mame/video/blktiger.cpp | 12 +- src/mame/video/blmbycar.cpp | 12 +- src/mame/video/blockade.cpp | 2 +- src/mame/video/blockout.cpp | 4 +- src/mame/video/bloodbro.cpp | 14 +- src/mame/video/blstroid.cpp | 8 +- src/mame/video/blueprnt.cpp | 4 +- src/mame/video/bogeyman.cpp | 4 +- src/mame/video/bombjack.cpp | 4 +- src/mame/video/boogwing.cpp | 22 +- src/mame/video/bosco.cpp | 10 +- src/mame/video/bottom9.cpp | 2 +- src/mame/video/brkthru.cpp | 10 +- src/mame/video/bsktball.cpp | 2 +- src/mame/video/btime.cpp | 38 +- src/mame/video/btoads.cpp | 48 +- src/mame/video/bublbobl.cpp | 10 +- src/mame/video/buggychl.cpp | 10 +- src/mame/video/busicom.cpp | 12 +- src/mame/video/bwing.cpp | 4 +- src/mame/video/c116.cpp | 6 +- src/mame/video/c116.h | 12 +- src/mame/video/c45.cpp | 8 +- src/mame/video/c45.h | 10 +- src/mame/video/cabal.cpp | 2 +- src/mame/video/calomega.cpp | 4 +- src/mame/video/canyon.cpp | 4 +- src/mame/video/capbowl.cpp | 14 +- src/mame/video/carpolo.cpp | 26 +- src/mame/video/cave.cpp | 96 +- src/mame/video/cbasebal.cpp | 12 +- src/mame/video/cbuster.cpp | 4 +- src/mame/video/ccastles.cpp | 30 +- src/mame/video/cclimber.cpp | 26 +- src/mame/video/centiped.cpp | 34 +- src/mame/video/cgc7900.cpp | 18 +- src/mame/video/chaknpop.cpp | 6 +- src/mame/video/champbas.cpp | 16 +- src/mame/video/changela.cpp | 86 +- src/mame/video/channelf.cpp | 10 +- src/mame/video/cheekyms.cpp | 4 +- src/mame/video/chihiro.cpp | 362 +- src/mame/video/chqflag.cpp | 2 +- src/mame/video/cidelsa.cpp | 26 +- src/mame/video/cinemat.cpp | 6 +- src/mame/video/circus.cpp | 10 +- src/mame/video/circusc.cpp | 12 +- src/mame/video/cischeat.cpp | 20 +- src/mame/video/citycon.cpp | 4 +- src/mame/video/cloak.cpp | 18 +- src/mame/video/cloud9.cpp | 32 +- src/mame/video/clshroad.cpp | 20 +- src/mame/video/cninja.cpp | 28 +- src/mame/video/combatsc.cpp | 46 +- src/mame/video/commando.cpp | 4 +- src/mame/video/compgolf.cpp | 4 +- src/mame/video/comquest.cpp | 2 +- src/mame/video/comx35.cpp | 10 +- src/mame/video/contra.cpp | 46 +- src/mame/video/cop01.cpp | 8 +- src/mame/video/copsnrob.cpp | 2 +- src/mame/video/cosmic.cpp | 82 +- src/mame/video/cps1.cpp | 32 +- src/mame/video/crbaloon.cpp | 18 +- src/mame/video/crgolf.cpp | 26 +- src/mame/video/crimfght.cpp | 2 +- src/mame/video/crospang.cpp | 2 +- src/mame/video/crshrace.cpp | 4 +- src/mame/video/crt.cpp | 4 +- src/mame/video/crt.h | 2 +- src/mame/video/cvs.cpp | 18 +- src/mame/video/cyberbal.cpp | 18 +- src/mame/video/dai.cpp | 28 +- src/mame/video/darius.cpp | 18 +- src/mame/video/darkmist.cpp | 12 +- src/mame/video/darkseal.cpp | 4 +- src/mame/video/dassault.cpp | 18 +- src/mame/video/dbz.cpp | 2 +- src/mame/video/dcheese.cpp | 34 +- src/mame/video/dcon.cpp | 6 +- src/mame/video/dday.cpp | 8 +- src/mame/video/ddragon.cpp | 14 +- src/mame/video/ddragon3.cpp | 18 +- src/mame/video/ddribble.cpp | 14 +- src/mame/video/deadang.cpp | 6 +- src/mame/video/dec0.cpp | 20 +- src/mame/video/dec8.cpp | 20 +- src/mame/video/decbac06.cpp | 30 +- src/mame/video/decbac06.h | 36 +- src/mame/video/deckarn.cpp | 4 +- src/mame/video/deckarn.h | 6 +- src/mame/video/decmxc06.cpp | 6 +- src/mame/video/decmxc06.h | 8 +- src/mame/video/deco16ic.cpp | 76 +- src/mame/video/deco16ic.h | 40 +- src/mame/video/deco32.cpp | 64 +- src/mame/video/deco_mlc.cpp | 44 +- src/mame/video/deco_zoomspr.cpp | 34 +- src/mame/video/deco_zoomspr.h | 8 +- src/mame/video/decocass.cpp | 18 +- src/mame/video/decocomn.cpp | 4 +- src/mame/video/decocomn.h | 8 +- src/mame/video/decodmd1.cpp | 26 +- src/mame/video/decodmd1.h | 40 +- src/mame/video/decodmd2.cpp | 14 +- src/mame/video/decodmd2.h | 16 +- src/mame/video/decodmd3.cpp | 14 +- src/mame/video/decodmd3.h | 16 +- src/mame/video/decospr.cpp | 22 +- src/mame/video/decospr.h | 28 +- src/mame/video/deniam.cpp | 12 +- src/mame/video/dgn_beta.cpp | 26 +- src/mame/video/dietgo.cpp | 4 +- src/mame/video/digdug.cpp | 16 +- src/mame/video/divebomb.cpp | 38 +- src/mame/video/djboy.cpp | 4 +- src/mame/video/djmain.cpp | 6 +- src/mame/video/dkong.cpp | 30 +- src/mame/video/docastle.cpp | 6 +- src/mame/video/dogfgt.cpp | 6 +- src/mame/video/dooyong.cpp | 66 +- src/mame/video/dragrace.cpp | 4 +- src/mame/video/drgnmst.cpp | 6 +- src/mame/video/dribling.cpp | 10 +- src/mame/video/drmicro.cpp | 8 +- src/mame/video/dvi.cpp | 218 +- src/mame/video/dynax.cpp | 130 +- src/mame/video/dynduke.cpp | 10 +- src/mame/video/electron.cpp | 22 +- src/mame/video/eolith.cpp | 10 +- src/mame/video/epos.cpp | 8 +- src/mame/video/eprom.cpp | 32 +- src/mame/video/equites.cpp | 34 +- src/mame/video/esd16.cpp | 10 +- src/mame/video/espial.cpp | 10 +- src/mame/video/esripsys.cpp | 64 +- src/mame/video/excellent_spr.cpp | 14 +- src/mame/video/excellent_spr.h | 4 +- src/mame/video/exedexes.cpp | 16 +- src/mame/video/exerion.cpp | 50 +- src/mame/video/exidy.cpp | 24 +- src/mame/video/exidy440.cpp | 20 +- src/mame/video/exprraid.cpp | 4 +- src/mame/video/exterm.cpp | 16 +- src/mame/video/exzisus.cpp | 6 +- src/mame/video/f1gp.cpp | 28 +- src/mame/video/fantland.cpp | 6 +- src/mame/video/fastfred.cpp | 28 +- src/mame/video/fastlane.cpp | 20 +- src/mame/video/fcombat.cpp | 8 +- src/mame/video/fgoal.cpp | 12 +- src/mame/video/finalizr.cpp | 10 +- src/mame/video/firetrap.cpp | 6 +- src/mame/video/firetrk.cpp | 26 +- src/mame/video/fitfight.cpp | 6 +- src/mame/video/flkatck.cpp | 14 +- src/mame/video/flstory.cpp | 6 +- src/mame/video/fm7.cpp | 112 +- src/mame/video/fmtowns.cpp | 92 +- src/mame/video/foodf.cpp | 6 +- src/mame/video/freekick.cpp | 6 +- src/mame/video/fromanc2.cpp | 16 +- src/mame/video/fromance.cpp | 16 +- src/mame/video/funkybee.cpp | 4 +- src/mame/video/funkyjet.cpp | 4 +- src/mame/video/funworld.cpp | 4 +- src/mame/video/funybubl.cpp | 8 +- src/mame/video/fuukifg.cpp | 12 +- src/mame/video/fuukifg.h | 10 +- src/mame/video/fuukifg2.cpp | 18 +- src/mame/video/fuukifg3.cpp | 24 +- src/mame/video/gaelco.cpp | 4 +- src/mame/video/gaelco2.cpp | 16 +- src/mame/video/gaelco3d.cpp | 84 +- src/mame/video/gaiden.cpp | 24 +- src/mame/video/galaga.cpp | 10 +- src/mame/video/galastrm.cpp | 28 +- src/mame/video/galaxia.cpp | 14 +- src/mame/video/galaxian.cpp | 108 +- src/mame/video/galaxold.cpp | 108 +- src/mame/video/galaxy.cpp | 10 +- src/mame/video/galeb.cpp | 2 +- src/mame/video/galivan.cpp | 18 +- src/mame/video/galpani2.cpp | 14 +- src/mame/video/galpanic.cpp | 2 +- src/mame/video/galspnbl.cpp | 14 +- src/mame/video/gamecom.cpp | 4 +- src/mame/video/gameplan.cpp | 22 +- src/mame/video/gaplus.cpp | 12 +- src/mame/video/gatron.cpp | 6 +- src/mame/video/gauntlet.cpp | 16 +- src/mame/video/gberet.cpp | 14 +- src/mame/video/gcpinbal.cpp | 16 +- src/mame/video/gic.cpp | 44 +- src/mame/video/gic.h | 16 +- src/mame/video/gijoe.cpp | 2 +- src/mame/video/gime.cpp | 114 +- src/mame/video/gime.h | 116 +- src/mame/video/ginganin.cpp | 10 +- src/mame/video/gladiatr.cpp | 10 +- src/mame/video/glass.cpp | 4 +- src/mame/video/gng.cpp | 10 +- src/mame/video/goal92.cpp | 8 +- src/mame/video/goindol.cpp | 4 +- src/mame/video/goldstar.cpp | 22 +- src/mame/video/gomoku.cpp | 16 +- src/mame/video/gotcha.cpp | 6 +- src/mame/video/gottlieb.cpp | 10 +- src/mame/video/gotya.cpp | 8 +- src/mame/video/gp9001.cpp | 56 +- src/mame/video/gp9001.h | 38 +- src/mame/video/gradius3.cpp | 2 +- src/mame/video/grchamp.cpp | 30 +- src/mame/video/gridlee.cpp | 18 +- src/mame/video/groundfx.cpp | 12 +- src/mame/video/gstriker.cpp | 2 +- src/mame/video/gsword.cpp | 10 +- src/mame/video/gtia.cpp | 26 +- src/mame/video/gtia.h | 198 +- src/mame/video/gumbo.cpp | 2 +- src/mame/video/gunbustr.cpp | 10 +- src/mame/video/gundealr.cpp | 6 +- src/mame/video/gunsmoke.cpp | 14 +- src/mame/video/gyruss.cpp | 8 +- src/mame/video/hanaawas.cpp | 6 +- src/mame/video/harddriv.cpp | 26 +- src/mame/video/hcastle.cpp | 34 +- src/mame/video/hec2hrp.cpp | 26 +- src/mame/video/hexion.cpp | 4 +- src/mame/video/higemaru.cpp | 10 +- src/mame/video/himesiki.cpp | 4 +- src/mame/video/hnayayoi.cpp | 14 +- src/mame/video/hng64.cpp | 136 +- src/mame/video/hng64_3d.hxx | 76 +- src/mame/video/hng64_sprite.hxx | 16 +- src/mame/video/holeland.cpp | 8 +- src/mame/video/homedata.cpp | 26 +- src/mame/video/homerun.cpp | 4 +- src/mame/video/hp48.cpp | 4 +- src/mame/video/hyhoo.cpp | 6 +- src/mame/video/hyperspt.cpp | 10 +- src/mame/video/hyprduel.cpp | 72 +- src/mame/video/igs017_igs031.cpp | 22 +- src/mame/video/igs017_igs031.h | 24 +- src/mame/video/ikki.cpp | 14 +- src/mame/video/intv.cpp | 8 +- src/mame/video/inufuku.cpp | 6 +- src/mame/video/iqblock.cpp | 2 +- src/mame/video/irobot.cpp | 38 +- src/mame/video/ironhors.cpp | 14 +- src/mame/video/itech32.cpp | 100 +- src/mame/video/itech8.cpp | 64 +- src/mame/video/jack.cpp | 12 +- src/mame/video/jackal.cpp | 20 +- src/mame/video/jagblit.hxx | 168 +- src/mame/video/jagobj.hxx | 330 +- src/mame/video/jaguar.cpp | 50 +- src/mame/video/jailbrek.cpp | 10 +- src/mame/video/jalblend.cpp | 20 +- src/mame/video/jalblend.h | 14 +- src/mame/video/jedi.cpp | 34 +- src/mame/video/jpmimpct.cpp | 14 +- src/mame/video/k001005.cpp | 76 +- src/mame/video/k001005.h | 48 +- src/mame/video/k001006.cpp | 34 +- src/mame/video/k001006.h | 18 +- src/mame/video/k001604.cpp | 42 +- src/mame/video/k001604.h | 8 +- src/mame/video/k007121.cpp | 4 +- src/mame/video/k007121.h | 6 +- src/mame/video/k007342.cpp | 10 +- src/mame/video/k007342.h | 24 +- src/mame/video/k007420.cpp | 4 +- src/mame/video/k007420.h | 6 +- src/mame/video/k037122.cpp | 20 +- src/mame/video/k037122.h | 10 +- src/mame/video/k051316.cpp | 18 +- src/mame/video/k051316.h | 10 +- src/mame/video/k051733.cpp | 8 +- src/mame/video/k051733.h | 6 +- src/mame/video/k051960.cpp | 8 +- src/mame/video/k051960.h | 8 +- src/mame/video/k052109.cpp | 24 +- src/mame/video/k052109.h | 40 +- src/mame/video/k053244_k053245.cpp | 8 +- src/mame/video/k053244_k053245.h | 10 +- src/mame/video/k053246_k053247_k055673.cpp | 68 +- src/mame/video/k053246_k053247_k055673.h | 30 +- src/mame/video/k053250.cpp | 24 +- src/mame/video/k053250.h | 20 +- src/mame/video/k053251.cpp | 2 +- src/mame/video/k053251.h | 4 +- src/mame/video/k053936.cpp | 106 +- src/mame/video/k053936.h | 12 +- src/mame/video/k054000.cpp | 2 +- src/mame/video/k054000.h | 4 +- src/mame/video/k054156_k054157_k056832.cpp | 110 +- src/mame/video/k054156_k054157_k056832.h | 40 +- src/mame/video/k054338.cpp | 12 +- src/mame/video/k054338.h | 4 +- src/mame/video/k055555.cpp | 8 +- src/mame/video/k055555.h | 6 +- src/mame/video/k057714.cpp | 78 +- src/mame/video/k057714.h | 50 +- src/mame/video/k1ge.cpp | 148 +- src/mame/video/k1ge.h | 22 +- src/mame/video/kan_pand.cpp | 4 +- src/mame/video/kan_pand.h | 6 +- src/mame/video/kaneko16.cpp | 14 +- src/mame/video/kaneko_grap2.cpp | 22 +- src/mame/video/kaneko_grap2.h | 28 +- src/mame/video/kaneko_spr.cpp | 44 +- src/mame/video/kaneko_spr.h | 36 +- src/mame/video/kaneko_tmap.cpp | 24 +- src/mame/video/kaneko_tmap.h | 12 +- src/mame/video/kangaroo.cpp | 62 +- src/mame/video/karnov.cpp | 4 +- src/mame/video/kaypro.cpp | 42 +- src/mame/video/kc.cpp | 26 +- src/mame/video/kchamp.cpp | 10 +- src/mame/video/kickgoal.cpp | 4 +- src/mame/video/kingobox.cpp | 20 +- src/mame/video/klax.cpp | 10 +- src/mame/video/kncljoe.cpp | 8 +- src/mame/video/konami_helper.cpp | 2 +- src/mame/video/konami_helper.h | 2 +- src/mame/video/konamigx.cpp | 50 +- src/mame/video/kopunch.cpp | 4 +- src/mame/video/kramermc.cpp | 2 +- src/mame/video/ksayakyu.cpp | 8 +- src/mame/video/kyocera.cpp | 4 +- src/mame/video/kyugo.cpp | 8 +- src/mame/video/labyrunr.cpp | 24 +- src/mame/video/ladybug.cpp | 12 +- src/mame/video/ladyfrog.cpp | 4 +- src/mame/video/laserbat.cpp | 62 +- src/mame/video/lasso.cpp | 26 +- src/mame/video/lastduel.cpp | 6 +- src/mame/video/lazercmd.cpp | 2 +- src/mame/video/legionna.cpp | 28 +- src/mame/video/leland.cpp | 38 +- src/mame/video/lemmings.cpp | 8 +- src/mame/video/lethal.cpp | 2 +- src/mame/video/lethalj.cpp | 26 +- src/mame/video/liberate.cpp | 30 +- src/mame/video/liberatr.cpp | 62 +- src/mame/video/lkage.cpp | 6 +- src/mame/video/llc.cpp | 16 +- src/mame/video/lockon.cpp | 288 +- src/mame/video/lordgun.cpp | 16 +- src/mame/video/lsasquad.cpp | 8 +- src/mame/video/lucky74.cpp | 4 +- src/mame/video/lvcards.cpp | 6 +- src/mame/video/lviv.cpp | 6 +- src/mame/video/lwings.cpp | 12 +- src/mame/video/m10.cpp | 6 +- src/mame/video/m107.cpp | 14 +- src/mame/video/m52.cpp | 24 +- src/mame/video/m57.cpp | 12 +- src/mame/video/m58.cpp | 24 +- src/mame/video/m62.cpp | 36 +- src/mame/video/m72.cpp | 20 +- src/mame/video/m90.cpp | 16 +- src/mame/video/m92.cpp | 12 +- src/mame/video/mac.cpp | 162 +- src/mame/video/macrossp.cpp | 24 +- src/mame/video/madalien.cpp | 22 +- src/mame/video/madmotor.cpp | 2 +- src/mame/video/magmax.cpp | 40 +- src/mame/video/mainevt.cpp | 4 +- src/mame/video/mainsnk.cpp | 6 +- src/mame/video/malzak.cpp | 2 +- src/mame/video/mappy.cpp | 52 +- src/mame/video/maria.cpp | 14 +- src/mame/video/maria.h | 6 +- src/mame/video/marineb.cpp | 20 +- src/mame/video/mario.cpp | 8 +- src/mame/video/markham.cpp | 8 +- src/mame/video/matmania.cpp | 10 +- src/mame/video/mb60553.cpp | 20 +- src/mame/video/mb60553.h | 16 +- src/mame/video/mbc55x.cpp | 20 +- src/mame/video/mbee.cpp | 38 +- src/mame/video/mc80.cpp | 18 +- src/mame/video/mcatadv.cpp | 20 +- src/mame/video/mcd212.cpp | 230 +- src/mame/video/mcd212.h | 98 +- src/mame/video/mcr.cpp | 38 +- src/mame/video/mcr3.cpp | 16 +- src/mame/video/mcr68.cpp | 38 +- src/mame/video/meadows.cpp | 8 +- src/mame/video/megasys1.cpp | 86 +- src/mame/video/megazone.cpp | 10 +- src/mame/video/mermaid.cpp | 18 +- src/mame/video/metlclsh.cpp | 10 +- src/mame/video/metro.cpp | 68 +- src/mame/video/mexico86.cpp | 10 +- src/mame/video/micro3d.cpp | 46 +- src/mame/video/microtan.cpp | 8 +- src/mame/video/midtunit.cpp | 98 +- src/mame/video/midvunit.cpp | 92 +- src/mame/video/midyunit.cpp | 40 +- src/mame/video/midzeus.cpp | 350 +- src/mame/video/midzeus2.cpp | 230 +- src/mame/video/mikie.cpp | 8 +- src/mame/video/mikro80.cpp | 10 +- src/mame/video/mikromik.cpp | 8 +- src/mame/video/mitchell.cpp | 4 +- src/mame/video/mjkjidai.cpp | 8 +- src/mame/video/model1.cpp | 54 +- src/mame/video/model2.cpp | 238 +- src/mame/video/model2rd.hxx | 62 +- src/mame/video/model3.cpp | 402 +-- src/mame/video/momoko.cpp | 18 +- src/mame/video/moo.cpp | 2 +- src/mame/video/mosaic.cpp | 2 +- src/mame/video/mouser.cpp | 6 +- src/mame/video/mrdo.cpp | 12 +- src/mame/video/mrflea.cpp | 8 +- src/mame/video/mrjong.cpp | 6 +- src/mame/video/ms1_tmap.cpp | 12 +- src/mame/video/ms1_tmap.h | 18 +- src/mame/video/ms32.cpp | 32 +- src/mame/video/msisaac.cpp | 6 +- src/mame/video/mugsmash.cpp | 6 +- src/mame/video/munchmo.cpp | 8 +- src/mame/video/mustache.cpp | 4 +- src/mame/video/mw8080bw.cpp | 64 +- src/mame/video/mystston.cpp | 6 +- src/mame/video/mystwarr.cpp | 38 +- src/mame/video/mz700.cpp | 10 +- src/mame/video/mz80.cpp | 24 +- src/mame/video/n64.cpp | 1578 ++++----- src/mame/video/n64.h | 264 +- src/mame/video/n64types.h | 228 +- src/mame/video/n8080.cpp | 34 +- src/mame/video/namcofl.cpp | 14 +- src/mame/video/namcona1.cpp | 54 +- src/mame/video/namconb1.cpp | 18 +- src/mame/video/namcos1.cpp | 14 +- src/mame/video/namcos2.cpp | 50 +- src/mame/video/namcos21.cpp | 38 +- src/mame/video/namcos22.cpp | 212 +- src/mame/video/namcos86.cpp | 10 +- src/mame/video/naughtyb.cpp | 4 +- src/mame/video/nbmj8688.cpp | 12 +- src/mame/video/nbmj8891.cpp | 32 +- src/mame/video/nbmj8900.cpp | 18 +- src/mame/video/nbmj8991.cpp | 18 +- src/mame/video/nbmj9195.cpp | 28 +- src/mame/video/nc.cpp | 2 +- src/mame/video/nemesis.cpp | 14 +- src/mame/video/neogeo.cpp | 12 +- src/mame/video/neogeo_spr.cpp | 136 +- src/mame/video/neogeo_spr.h | 92 +- src/mame/video/nes.cpp | 2 +- src/mame/video/newbrain.cpp | 14 +- src/mame/video/newport.cpp | 42 +- src/mame/video/newport.h | 170 +- src/mame/video/news.cpp | 2 +- src/mame/video/nick.cpp | 68 +- src/mame/video/nick.h | 52 +- src/mame/video/ninjakd2.cpp | 40 +- src/mame/video/ninjaw.cpp | 10 +- src/mame/video/nitedrvr.cpp | 2 +- src/mame/video/niyanpai.cpp | 42 +- src/mame/video/nmk16.cpp | 58 +- src/mame/video/nova2001.cpp | 22 +- src/mame/video/nycaptor.cpp | 2 +- src/mame/video/offtwall.cpp | 10 +- src/mame/video/ohmygod.cpp | 10 +- src/mame/video/ojankohs.cpp | 22 +- src/mame/video/ondra.cpp | 4 +- src/mame/video/oneshot.cpp | 8 +- src/mame/video/opwolf.cpp | 2 +- src/mame/video/orao.cpp | 4 +- src/mame/video/orbit.cpp | 6 +- src/mame/video/orion.cpp | 6 +- src/mame/video/osi.cpp | 34 +- src/mame/video/othunder.cpp | 8 +- src/mame/video/overdriv.cpp | 2 +- src/mame/video/p2000t.cpp | 4 +- src/mame/video/pacland.cpp | 30 +- src/mame/video/pacman.cpp | 20 +- src/mame/video/pandoras.cpp | 12 +- src/mame/video/paradise.cpp | 6 +- src/mame/video/parodius.cpp | 2 +- src/mame/video/pass.cpp | 2 +- src/mame/video/pastelg.cpp | 14 +- src/mame/video/pbaction.cpp | 4 +- src/mame/video/pc080sn.cpp | 32 +- src/mame/video/pc080sn.h | 22 +- src/mame/video/pc090oj.cpp | 8 +- src/mame/video/pc090oj.h | 12 +- src/mame/video/pc1251.cpp | 4 +- src/mame/video/pc1350.cpp | 4 +- src/mame/video/pc1401.cpp | 2 +- src/mame/video/pc1403.cpp | 2 +- src/mame/video/pc1512.cpp | 32 +- src/mame/video/pc4.cpp | 10 +- src/mame/video/pc8401a.cpp | 2 +- src/mame/video/pc_t1t.cpp | 100 +- src/mame/video/pc_t1t.h | 34 +- src/mame/video/pcd.cpp | 14 +- src/mame/video/pcd.h | 18 +- src/mame/video/pcktgal.cpp | 6 +- src/mame/video/pcw.cpp | 10 +- src/mame/video/pcw16.cpp | 8 +- src/mame/video/pdp1.cpp | 6 +- src/mame/video/pecom.cpp | 12 +- src/mame/video/pgm.cpp | 46 +- src/mame/video/phoenix.cpp | 20 +- src/mame/video/pingpong.cpp | 10 +- src/mame/video/pirates.cpp | 6 +- src/mame/video/pitnrun.cpp | 14 +- src/mame/video/pk8000.cpp | 30 +- src/mame/video/pk8020.cpp | 22 +- src/mame/video/pktgaldx.cpp | 6 +- src/mame/video/playch10.cpp | 16 +- src/mame/video/playmark.cpp | 36 +- src/mame/video/plygonet.cpp | 10 +- src/mame/video/pocketc.cpp | 4 +- src/mame/video/pokechmp.cpp | 8 +- src/mame/video/polepos.cpp | 32 +- src/mame/video/policetr.cpp | 30 +- src/mame/video/poly88.cpp | 10 +- src/mame/video/polyplay.cpp | 6 +- src/mame/video/poolshrk.cpp | 2 +- src/mame/video/pooyan.cpp | 8 +- src/mame/video/popeye.cpp | 16 +- src/mame/video/portrait.cpp | 14 +- src/mame/video/powerins.cpp | 10 +- src/mame/video/powervr2.cpp | 628 ++-- src/mame/video/powervr2.h | 332 +- src/mame/video/pp01.cpp | 8 +- src/mame/video/ppu2c0x.cpp | 68 +- src/mame/video/ppu2c0x.h | 32 +- src/mame/video/prehisle.cpp | 4 +- src/mame/video/primo.cpp | 8 +- src/mame/video/psikyo.cpp | 68 +- src/mame/video/psikyo4.cpp | 16 +- src/mame/video/psikyosh.cpp | 152 +- src/mame/video/psychic5.cpp | 22 +- src/mame/video/punchout.cpp | 16 +- src/mame/video/qdrmfgp.cpp | 2 +- src/mame/video/qix.cpp | 14 +- src/mame/video/quasar.cpp | 12 +- src/mame/video/quizdna.cpp | 12 +- src/mame/video/quizpani.cpp | 2 +- src/mame/video/raiden.cpp | 10 +- src/mame/video/rallyx.cpp | 26 +- src/mame/video/rampart.cpp | 10 +- src/mame/video/rastan.cpp | 2 +- src/mame/video/rbisland.cpp | 6 +- src/mame/video/rdpblend.cpp | 68 +- src/mame/video/rdpblend.h | 12 +- src/mame/video/rdpfiltr.hxx | 104 +- src/mame/video/rdptpipe.cpp | 410 +-- src/mame/video/rdptpipe.h | 102 +- src/mame/video/realbrk.cpp | 34 +- src/mame/video/redalert.cpp | 106 +- src/mame/video/redclash.cpp | 28 +- src/mame/video/relief.cpp | 16 +- src/mame/video/renegade.cpp | 14 +- src/mame/video/retofinv.cpp | 14 +- src/mame/video/rltennis.cpp | 2 +- src/mame/video/rm380z.cpp | 38 +- src/mame/video/rmnimbus.cpp | 34 +- src/mame/video/rockrage.cpp | 8 +- src/mame/video/rocnrope.cpp | 10 +- src/mame/video/rohga.cpp | 28 +- src/mame/video/rollerg.cpp | 2 +- src/mame/video/rollrace.cpp | 8 +- src/mame/video/route16.cpp | 40 +- src/mame/video/rpunch.cpp | 10 +- src/mame/video/runaway.cpp | 8 +- src/mame/video/rungun.cpp | 20 +- src/mame/video/samcoupe.cpp | 24 +- src/mame/video/sauro.cpp | 8 +- src/mame/video/sbasketb.cpp | 10 +- src/mame/video/sbugger.cpp | 2 +- src/mame/video/scotrsht.cpp | 6 +- src/mame/video/sderby.cpp | 6 +- src/mame/video/sega16sp.cpp | 182 +- src/mame/video/sega16sp.h | 38 +- src/mame/video/segag80r.cpp | 32 +- src/mame/video/segag80v.cpp | 20 +- src/mame/video/segahang.cpp | 12 +- src/mame/video/segaic16.cpp | 78 +- src/mame/video/segaic16.h | 60 +- src/mame/video/segaic16_road.cpp | 44 +- src/mame/video/segaic16_road.h | 24 +- src/mame/video/segaic24.cpp | 120 +- src/mame/video/segaic24.h | 28 +- src/mame/video/segaorun.cpp | 20 +- src/mame/video/segas16a.cpp | 10 +- src/mame/video/segas16b.cpp | 10 +- src/mame/video/segas18.cpp | 20 +- src/mame/video/segas24.cpp | 2 +- src/mame/video/segas32.cpp | 190 +- src/mame/video/segaxbd.cpp | 10 +- src/mame/video/segaybd.cpp | 10 +- src/mame/video/seibu_crtc.cpp | 6 +- src/mame/video/seibu_crtc.h | 8 +- src/mame/video/seibuspi.cpp | 88 +- src/mame/video/seicross.cpp | 4 +- src/mame/video/senjyo.cpp | 24 +- src/mame/video/seta.cpp | 42 +- src/mame/video/seta001.cpp | 18 +- src/mame/video/seta001.h | 16 +- src/mame/video/seta2.cpp | 30 +- src/mame/video/sf.cpp | 6 +- src/mame/video/shadfrce.cpp | 8 +- src/mame/video/shangha3.cpp | 6 +- src/mame/video/shangkid.cpp | 16 +- src/mame/video/shaolins.cpp | 6 +- src/mame/video/shisen.cpp | 2 +- src/mame/video/shootout.cpp | 8 +- src/mame/video/shuuz.cpp | 10 +- src/mame/video/sidearms.cpp | 16 +- src/mame/video/sidepckt.cpp | 6 +- src/mame/video/silkroad.cpp | 6 +- src/mame/video/simpl156.cpp | 8 +- src/mame/video/simpsons.cpp | 2 +- src/mame/video/sknsspr.cpp | 40 +- src/mame/video/sknsspr.h | 8 +- src/mame/video/skullxbo.cpp | 30 +- src/mame/video/skydiver.cpp | 4 +- src/mame/video/skyfox.cpp | 6 +- src/mame/video/skykid.cpp | 12 +- src/mame/video/skyraid.cpp | 14 +- src/mame/video/slapfght.cpp | 8 +- src/mame/video/slapshot.cpp | 16 +- src/mame/video/snk.cpp | 22 +- src/mame/video/snk6502.cpp | 6 +- src/mame/video/snk68.cpp | 2 +- src/mame/video/snk68_spr.cpp | 6 +- src/mame/video/snk68_spr.h | 4 +- src/mame/video/snookr10.cpp | 8 +- src/mame/video/snowbros.cpp | 16 +- src/mame/video/solomon.cpp | 4 +- src/mame/video/sonson.cpp | 10 +- src/mame/video/spacefb.cpp | 86 +- src/mame/video/spbactn.cpp | 4 +- src/mame/video/spcforce.cpp | 2 +- src/mame/video/spdodgeb.cpp | 8 +- src/mame/video/special.cpp | 20 +- src/mame/video/spectrum.cpp | 24 +- src/mame/video/speedatk.cpp | 10 +- src/mame/video/speedbal.cpp | 2 +- src/mame/video/speedspn.cpp | 6 +- src/mame/video/splash.cpp | 4 +- src/mame/video/sprint2.cpp | 20 +- src/mame/video/sprint4.cpp | 26 +- src/mame/video/sprint8.cpp | 12 +- src/mame/video/spy.cpp | 2 +- src/mame/video/srmp2.cpp | 10 +- src/mame/video/srumbler.cpp | 8 +- src/mame/video/sshangha.cpp | 4 +- src/mame/video/sslam.cpp | 8 +- src/mame/video/ssozumo.cpp | 4 +- src/mame/video/sspeedr.cpp | 6 +- src/mame/video/ssrj.cpp | 6 +- src/mame/video/ssv.cpp | 40 +- src/mame/video/ssystem3.cpp | 6 +- src/mame/video/st0020.cpp | 30 +- src/mame/video/st0020.h | 10 +- src/mame/video/stactics.cpp | 16 +- src/mame/video/stadhero.cpp | 2 +- src/mame/video/starcrus.cpp | 2 +- src/mame/video/starfire.cpp | 8 +- src/mame/video/starshp1.cpp | 22 +- src/mame/video/stfight_dev.cpp | 16 +- src/mame/video/stfight_dev.h | 24 +- src/mame/video/stic.cpp | 72 +- src/mame/video/stic.h | 26 +- src/mame/video/stlforce.cpp | 6 +- src/mame/video/strnskil.cpp | 8 +- src/mame/video/subs.cpp | 4 +- src/mame/video/suna16.cpp | 8 +- src/mame/video/suna8.cpp | 20 +- src/mame/video/supbtime.cpp | 4 +- src/mame/video/super80.cpp | 48 +- src/mame/video/superchs.cpp | 10 +- src/mame/video/superqix.cpp | 16 +- src/mame/video/suprloco.cpp | 16 +- src/mame/video/suprnova.cpp | 50 +- src/mame/video/suprridr.cpp | 8 +- src/mame/video/suprslam.cpp | 6 +- src/mame/video/surpratk.cpp | 2 +- src/mame/video/system1.cpp | 92 +- src/mame/video/system16.cpp | 56 +- src/mame/video/tagteam.cpp | 4 +- src/mame/video/tail2nos.cpp | 6 +- src/mame/video/taito_b.cpp | 44 +- src/mame/video/taito_f2.cpp | 56 +- src/mame/video/taito_f3.cpp | 310 +- src/mame/video/taito_h.cpp | 6 +- src/mame/video/taito_helper.cpp | 8 +- src/mame/video/taito_helper.h | 2 +- src/mame/video/taito_l.cpp | 4 +- src/mame/video/taito_o.cpp | 2 +- src/mame/video/taito_z.cpp | 60 +- src/mame/video/taitoair.cpp | 34 +- src/mame/video/taitojc.cpp | 58 +- src/mame/video/taitosj.cpp | 24 +- src/mame/video/tank8.cpp | 14 +- src/mame/video/tankbatt.cpp | 4 +- src/mame/video/tankbust.cpp | 2 +- src/mame/video/taotaido.cpp | 12 +- src/mame/video/targeth.cpp | 2 +- src/mame/video/tatsumi.cpp | 92 +- src/mame/video/taxidriv.cpp | 2 +- src/mame/video/tbowl.cpp | 4 +- src/mame/video/tc0080vco.cpp | 44 +- src/mame/video/tc0080vco.h | 44 +- src/mame/video/tc0100scn.cpp | 18 +- src/mame/video/tc0100scn.h | 30 +- src/mame/video/tc0110pcr.cpp | 4 +- src/mame/video/tc0110pcr.h | 4 +- src/mame/video/tc0150rod.cpp | 24 +- src/mame/video/tc0150rod.h | 8 +- src/mame/video/tc0180vcu.cpp | 10 +- src/mame/video/tc0180vcu.h | 16 +- src/mame/video/tc0280grd.cpp | 20 +- src/mame/video/tc0280grd.h | 12 +- src/mame/video/tc0360pri.cpp | 2 +- src/mame/video/tc0360pri.h | 4 +- src/mame/video/tc0480scp.cpp | 44 +- src/mame/video/tc0480scp.h | 32 +- src/mame/video/tc0780fpa.cpp | 72 +- src/mame/video/tc0780fpa.h | 22 +- src/mame/video/tceptor.cpp | 32 +- src/mame/video/tecmo.cpp | 12 +- src/mame/video/tecmo16.cpp | 2 +- src/mame/video/tecmo_mix.cpp | 24 +- src/mame/video/tecmo_mix.h | 2 +- src/mame/video/tecmo_spr.cpp | 28 +- src/mame/video/tecmo_spr.h | 12 +- src/mame/video/tecmosys.cpp | 34 +- src/mame/video/tehkanwc.cpp | 4 +- src/mame/video/terracre.cpp | 12 +- src/mame/video/tetrisp2.cpp | 58 +- src/mame/video/thedeep.cpp | 14 +- src/mame/video/thepit.cpp | 24 +- src/mame/video/thief.cpp | 44 +- src/mame/video/thomson.cpp | 46 +- src/mame/video/thoop2.cpp | 2 +- src/mame/video/thunderj.cpp | 22 +- src/mame/video/thunderx.cpp | 2 +- src/mame/video/ti85.cpp | 8 +- src/mame/video/tia.cpp | 98 +- src/mame/video/tia.h | 136 +- src/mame/video/tiamc1.cpp | 10 +- src/mame/video/tigeroad.cpp | 8 +- src/mame/video/tigeroad_spr.cpp | 8 +- src/mame/video/tigeroad_spr.h | 4 +- src/mame/video/timelimt.cpp | 4 +- src/mame/video/timeplt.cpp | 4 +- src/mame/video/timex.cpp | 8 +- src/mame/video/tmc1800.cpp | 2 +- src/mame/video/tmc600.cpp | 20 +- src/mame/video/tmnt.cpp | 22 +- src/mame/video/tnzs.cpp | 4 +- src/mame/video/toaplan1.cpp | 52 +- src/mame/video/toaplan2.cpp | 26 +- src/mame/video/toaplan_scu.cpp | 10 +- src/mame/video/toaplan_scu.h | 4 +- src/mame/video/toki.cpp | 12 +- src/mame/video/toobin.cpp | 28 +- src/mame/video/topspeed.cpp | 14 +- src/mame/video/tp84.cpp | 6 +- src/mame/video/trackfld.cpp | 12 +- src/mame/video/travrusa.cpp | 12 +- src/mame/video/triplhnt.cpp | 2 +- src/mame/video/trs80.cpp | 86 +- src/mame/video/truco.cpp | 6 +- src/mame/video/trucocl.cpp | 4 +- src/mame/video/tryout.cpp | 10 +- src/mame/video/tsamurai.cpp | 10 +- src/mame/video/tubep.cpp | 142 +- src/mame/video/tumbleb.cpp | 28 +- src/mame/video/tumblep.cpp | 4 +- src/mame/video/tunhunt.cpp | 6 +- src/mame/video/turbo.cpp | 144 +- src/mame/video/turrett.cpp | 70 +- src/mame/video/tutankhm.cpp | 14 +- src/mame/video/twin16.cpp | 52 +- src/mame/video/twincobr.cpp | 18 +- src/mame/video/tx0.cpp | 6 +- src/mame/video/tx1.cpp | 970 +++--- src/mame/video/ultraman.cpp | 2 +- src/mame/video/ultratnk.cpp | 30 +- src/mame/video/undrfire.cpp | 26 +- src/mame/video/unico.cpp | 22 +- src/mame/video/usgames.cpp | 2 +- src/mame/video/ut88.cpp | 2 +- src/mame/video/uv201.cpp | 38 +- src/mame/video/uv201.h | 18 +- src/mame/video/v1050.cpp | 6 +- src/mame/video/vaportra.cpp | 6 +- src/mame/video/vastar.cpp | 2 +- src/mame/video/vball.cpp | 12 +- src/mame/video/vc4000.cpp | 16 +- src/mame/video/vector06.cpp | 10 +- src/mame/video/vectrex.cpp | 4 +- src/mame/video/vendetta.cpp | 2 +- src/mame/video/vertigo.cpp | 6 +- src/mame/video/vicdual.cpp | 24 +- src/mame/video/victory.cpp | 46 +- src/mame/video/videopin.cpp | 6 +- src/mame/video/vigilant.cpp | 4 +- src/mame/video/vindictr.cpp | 16 +- src/mame/video/volfied.cpp | 6 +- src/mame/video/vrender0.cpp | 142 +- src/mame/video/vrender0.h | 48 +- src/mame/video/vs920a.cpp | 4 +- src/mame/video/vs920a.h | 8 +- src/mame/video/vsnes.cpp | 4 +- src/mame/video/vsystem_spr.cpp | 8 +- src/mame/video/vsystem_spr.h | 20 +- src/mame/video/vsystem_spr2.cpp | 14 +- src/mame/video/vsystem_spr2.h | 16 +- src/mame/video/vtech2.cpp | 4 +- src/mame/video/vtvideo.cpp | 44 +- src/mame/video/vtvideo.h | 34 +- src/mame/video/vulgus.cpp | 4 +- src/mame/video/warpwarp.cpp | 2 +- src/mame/video/warriorb.cpp | 8 +- src/mame/video/wc90.cpp | 2 +- src/mame/video/wc90b.cpp | 4 +- src/mame/video/wecleman.cpp | 60 +- src/mame/video/welltris.cpp | 4 +- src/mame/video/wgp.cpp | 52 +- src/mame/video/williams.cpp | 30 +- src/mame/video/wiping.cpp | 10 +- src/mame/video/wiz.cpp | 16 +- src/mame/video/wolfpack.cpp | 12 +- src/mame/video/wpc_dmd.cpp | 34 +- src/mame/video/wpc_dmd.h | 8 +- src/mame/video/wrally.cpp | 8 +- src/mame/video/wswan.cpp | 40 +- src/mame/video/wswan.h | 102 +- src/mame/video/wwfsstar.cpp | 10 +- src/mame/video/x68k.cpp | 44 +- src/mame/video/xain.cpp | 2 +- src/mame/video/xevious.cpp | 28 +- src/mame/video/xexex.cpp | 2 +- src/mame/video/xmen.cpp | 14 +- src/mame/video/xorworld.cpp | 4 +- src/mame/video/xxmissio.cpp | 10 +- src/mame/video/xybots.cpp | 10 +- src/mame/video/xyonix.cpp | 4 +- src/mame/video/ygv608.cpp | 66 +- src/mame/video/ygv608.h | 162 +- src/mame/video/yiear.cpp | 8 +- src/mame/video/yunsun16.cpp | 10 +- src/mame/video/yunsung8.cpp | 4 +- src/mame/video/z88.cpp | 28 +- src/mame/video/zac2650.cpp | 2 +- src/mame/video/zaccaria.cpp | 8 +- src/mame/video/zaxxon.cpp | 30 +- src/mame/video/zerozone.cpp | 2 +- src/mame/video/zodiack.cpp | 4 +- src/mame/video/zx.cpp | 22 +- src/mame/video/zx8301.cpp | 22 +- src/mame/video/zx8301.h | 12 +- src/osd/eigccppc.h | 36 +- src/osd/eigccx86.h | 106 +- src/osd/eivc.h | 8 +- src/osd/eivcx86.h | 88 +- src/osd/eminline.h | 70 +- src/osd/modules/debugger/debugimgui.cpp | 16 +- src/osd/modules/debugger/osx/debugview.h | 2 +- src/osd/modules/debugger/osx/debugview.mm | 16 +- src/osd/modules/debugger/osx/disassemblyviewer.mm | 6 +- src/osd/modules/debugger/qt/dasmwindow.cpp | 4 +- src/osd/modules/debugger/qt/mainwindow.cpp | 4 +- src/osd/modules/debugger/qt/memorywindow.cpp | 2 +- src/osd/modules/debugger/win/consolewininfo.cpp | 8 +- src/osd/modules/debugger/win/debugviewinfo.cpp | 20 +- src/osd/modules/debugger/win/debugviewinfo.h | 6 +- src/osd/modules/debugger/win/debugwininfo.h | 14 +- src/osd/modules/debugger/win/disasmbasewininfo.cpp | 6 +- src/osd/modules/debugger/win/memoryviewinfo.cpp | 8 +- src/osd/modules/debugger/win/memoryviewinfo.h | 8 +- src/osd/modules/debugger/win/uimetrics.h | 20 +- src/osd/modules/diagnostics/diagnostics_win32.cpp | 20 +- src/osd/modules/file/posixfile.cpp | 2 +- src/osd/modules/file/stdfile.cpp | 4 +- src/osd/modules/file/winfile.cpp | 8 +- src/osd/modules/font/font_dwrite.cpp | 36 +- src/osd/modules/font/font_windows.cpp | 10 +- src/osd/modules/input/input_common.h | 12 +- src/osd/modules/input/input_dinput.cpp | 14 +- src/osd/modules/input/input_rawinput.cpp | 6 +- src/osd/modules/input/input_sdl.cpp | 8 +- src/osd/modules/input/input_sdlcommon.h | 18 +- src/osd/modules/input/input_win32.cpp | 2 +- src/osd/modules/input/input_windows.h | 6 +- src/osd/modules/input/input_winhybrid.cpp | 2 +- src/osd/modules/input/input_x11.cpp | 8 +- src/osd/modules/input/input_xinput.h | 2 +- src/osd/modules/lib/osdlib_win32.cpp | 16 +- src/osd/modules/lib/osdobj_common.cpp | 6 +- src/osd/modules/lib/osdobj_common.h | 6 +- src/osd/modules/midi/none.cpp | 8 +- src/osd/modules/midi/portmidi.cpp | 18 +- src/osd/modules/netdev/pcap.cpp | 14 +- src/osd/modules/netdev/taptun.cpp | 10 +- src/osd/modules/osdwindow.h | 2 +- src/osd/modules/output/console.cpp | 2 +- src/osd/modules/output/network.cpp | 2 +- src/osd/modules/output/none.cpp | 2 +- src/osd/modules/output/output_module.h | 2 +- src/osd/modules/output/win32_output.cpp | 8 +- src/osd/modules/output/win32_output.h | 2 +- src/osd/modules/render/aviwrite.cpp | 2 +- src/osd/modules/render/aviwrite.h | 2 +- src/osd/modules/render/bgfx/chainentryreader.cpp | 6 +- src/osd/modules/render/bgfx/chainmanager.cpp | 4 +- src/osd/modules/render/bgfx/chainmanager.h | 2 +- src/osd/modules/render/bgfx/chainreader.cpp | 8 +- src/osd/modules/render/bgfx/effectreader.cpp | 2 +- src/osd/modules/render/bgfx/inputpair.cpp | 4 +- src/osd/modules/render/bgfx/inputpair.h | 2 +- src/osd/modules/render/bgfx/slider.cpp | 4 +- src/osd/modules/render/bgfx/slider.h | 2 +- src/osd/modules/render/bgfx/sliderreader.cpp | 4 +- src/osd/modules/render/bgfx/statereader.h | 2 +- src/osd/modules/render/bgfx/suppressorreader.cpp | 2 +- src/osd/modules/render/bgfx/texturemanager.cpp | 4 +- src/osd/modules/render/bgfx/vertex.h | 2 +- src/osd/modules/render/bgfxutil.cpp | 16 +- src/osd/modules/render/bgfxutil.h | 4 +- src/osd/modules/render/binpacker.h | 24 +- src/osd/modules/render/blit13.h | 122 +- src/osd/modules/render/copyutil.h | 28 +- src/osd/modules/render/d3d/d3dcomm.h | 32 +- src/osd/modules/render/d3d/d3dhlsl.cpp | 42 +- src/osd/modules/render/d3d/d3dhlsl.h | 16 +- src/osd/modules/render/draw13.cpp | 28 +- src/osd/modules/render/draw13.h | 26 +- src/osd/modules/render/drawbgfx.cpp | 48 +- src/osd/modules/render/drawbgfx.h | 16 +- src/osd/modules/render/drawd3d.cpp | 190 +- src/osd/modules/render/drawd3d.h | 8 +- src/osd/modules/render/drawgdi.cpp | 4 +- src/osd/modules/render/drawgdi.h | 2 +- src/osd/modules/render/drawogl.cpp | 120 +- src/osd/modules/render/drawogl.h | 50 +- src/osd/modules/render/drawsdl.cpp | 98 +- src/osd/modules/render/drawsdl.h | 8 +- src/osd/modules/sound/coreaudio_sound.cpp | 56 +- src/osd/modules/sound/direct_sound.cpp | 12 +- src/osd/modules/sound/js_sound.cpp | 2 +- src/osd/modules/sound/js_sound.js | 2 +- src/osd/modules/sound/none.cpp | 2 +- src/osd/modules/sound/sdl_sound.cpp | 32 +- src/osd/modules/sound/sound_module.h | 2 +- src/osd/modules/sound/xaudio2_sound.cpp | 26 +- src/osd/osdcomm.h | 58 +- src/osd/osdcore.h | 28 +- src/osd/osdepend.h | 4 +- src/osd/osdnet.cpp | 6 +- src/osd/osdnet.h | 4 +- src/osd/osdsync.cpp | 38 +- src/osd/osdsync.h | 6 +- src/osd/sdl/window.cpp | 20 +- src/osd/sdl/window.h | 2 +- src/osd/windows/ledutil.cpp | 16 +- src/osd/windows/window.cpp | 20 +- src/osd/windows/winmain.h | 6 +- src/tools/chdman.cpp | 302 +- src/tools/imgtool/filtbas.cpp | 42 +- src/tools/imgtool/filteoln.cpp | 2 +- src/tools/imgtool/filter.cpp | 8 +- src/tools/imgtool/filter.h | 32 +- src/tools/imgtool/formats/coco_dsk.cpp | 170 +- src/tools/imgtool/formats/vt_dsk.cpp | 2 +- src/tools/imgtool/iflopimg.cpp | 14 +- src/tools/imgtool/imghd.cpp | 18 +- src/tools/imgtool/imghd.h | 6 +- src/tools/imgtool/imgtool.cpp | 106 +- src/tools/imgtool/imgtool.h | 70 +- src/tools/imgtool/library.cpp | 10 +- src/tools/imgtool/library.h | 76 +- src/tools/imgtool/main.cpp | 12 +- src/tools/imgtool/modules.cpp | 4 +- src/tools/imgtool/modules/amiga.cpp | 342 +- src/tools/imgtool/modules/bml3.cpp | 120 +- src/tools/imgtool/modules/concept.cpp | 14 +- src/tools/imgtool/modules/cybiko.cpp | 104 +- src/tools/imgtool/modules/cybikoxt.cpp | 104 +- src/tools/imgtool/modules/fat.cpp | 294 +- src/tools/imgtool/modules/fat.h | 2 +- src/tools/imgtool/modules/hp48.cpp | 56 +- src/tools/imgtool/modules/hp9845_tape.cpp | 90 +- src/tools/imgtool/modules/mac.cpp | 542 +-- src/tools/imgtool/modules/macbin.cpp | 60 +- src/tools/imgtool/modules/macutil.cpp | 6 +- src/tools/imgtool/modules/macutil.h | 6 +- src/tools/imgtool/modules/os9.cpp | 196 +- src/tools/imgtool/modules/pc_flop.cpp | 40 +- src/tools/imgtool/modules/pc_hard.cpp | 70 +- src/tools/imgtool/modules/prodos.cpp | 278 +- src/tools/imgtool/modules/psion.cpp | 108 +- src/tools/imgtool/modules/rsdos.cpp | 54 +- src/tools/imgtool/modules/thomson.cpp | 124 +- src/tools/imgtool/modules/ti99.cpp | 176 +- src/tools/imgtool/modules/ti990hd.cpp | 90 +- src/tools/imgtool/modules/vzdos.cpp | 64 +- src/tools/imgtool/stream.cpp | 54 +- src/tools/imgtool/stream.h | 22 +- src/tools/jedutil.cpp | 428 +-- src/tools/ldresample.cpp | 130 +- src/tools/ldverify.cpp | 32 +- src/tools/pngcmp.cpp | 14 +- src/tools/regrep.cpp | 28 +- src/tools/romcmp.cpp | 6 +- src/tools/split.cpp | 18 +- src/tools/src2html.cpp | 26 +- src/tools/unidasm.cpp | 62 +- src/zexall/zexall.cpp | 10 +- 8116 files changed, 135825 insertions(+), 135825 deletions(-) (limited to 'src') diff --git a/src/devices/bus/a1bus/a1bus.cpp b/src/devices/bus/a1bus/a1bus.cpp index 273452fd2c1..8e0d024ebf1 100644 --- a/src/devices/bus/a1bus/a1bus.cpp +++ b/src/devices/bus/a1bus/a1bus.cpp @@ -23,7 +23,7 @@ const device_type A1BUS_SLOT = &device_creator; //------------------------------------------------- // a1bus_slot_device - constructor //------------------------------------------------- -a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A1BUS_SLOT, "Apple I Slot", tag, owner, clock, "a1bus_slot", __FILE__), device_slot_interface(mconfig, *this), m_a1bus_tag(nullptr), @@ -31,7 +31,7 @@ a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, const char * { } -a1bus_slot_device::a1bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a1bus_slot_device::a1bus_slot_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_slot_interface(mconfig, *this), m_a1bus_tag(nullptr), m_a1bus_slottag(nullptr) { @@ -75,14 +75,14 @@ void a1bus_device::static_set_cputag(device_t &device, const char *tag) // a1bus_device - constructor //------------------------------------------------- -a1bus_device::a1bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a1bus_device::a1bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A1BUS, "Apple I Bus", tag, owner, clock, "a1bus", __FILE__), m_maincpu(nullptr), m_out_irq_cb(*this), m_out_nmi_cb(*this), m_device(nullptr), m_cputag(nullptr) { } -a1bus_device::a1bus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a1bus_device::a1bus_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_maincpu(nullptr), m_out_irq_cb(*this), m_out_nmi_cb(*this), m_device(nullptr), m_cputag(nullptr) @@ -139,7 +139,7 @@ void a1bus_device::install_device(offs_t start, offs_t end, read8_delegate rhand m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler); } -void a1bus_device::install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data) +void a1bus_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data) { // printf("install_bank: %s @ %x->%x\n", tag, start, end); m_maincpu = machine().device(m_cputag); @@ -199,7 +199,7 @@ void device_a1bus_card_interface::install_device(offs_t start, offs_t end, read8 m_a1bus->install_device(start, end, rhandler, whandler); } -void device_a1bus_card_interface::install_bank(offs_t start, offs_t end, char *tag, UINT8 *data) +void device_a1bus_card_interface::install_bank(offs_t start, offs_t end, char *tag, uint8_t *data) { m_a1bus->install_bank(start, end, tag, data); } diff --git a/src/devices/bus/a1bus/a1bus.h b/src/devices/bus/a1bus/a1bus.h index 5bfe4b632a5..f2d7763a879 100644 --- a/src/devices/bus/a1bus/a1bus.h +++ b/src/devices/bus/a1bus/a1bus.h @@ -49,8 +49,8 @@ class a1bus_slot_device : public device_t, { public: // construction/destruction - a1bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a1bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a1bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a1bus_slot_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-level overrides virtual void device_start() override; @@ -72,8 +72,8 @@ class a1bus_device : public device_t { public: // construction/destruction - a1bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a1bus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a1bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a1bus_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); // inline configuration static void static_set_cputag(device_t &device, const char *tag); @@ -87,7 +87,7 @@ public: void set_nmi_line(int state); void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler); - void install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data); + void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data); DECLARE_WRITE_LINE_MEMBER( irq_w ); DECLARE_WRITE_LINE_MEMBER( nmi_w ); @@ -132,7 +132,7 @@ public: void lower_slot_nmi() { m_a1bus->set_nmi_line(CLEAR_LINE); } void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler); - void install_bank(offs_t start, offs_t end, char *tag, UINT8 *data); + void install_bank(offs_t start, offs_t end, char *tag, uint8_t *data); // inline configuration static void static_set_a1bus_tag(device_t &device, const char *tag, const char *slottag); diff --git a/src/devices/bus/a1bus/a1cassette.cpp b/src/devices/bus/a1bus/a1cassette.cpp index 9a33b667fa9..2e322c688a1 100644 --- a/src/devices/bus/a1bus/a1cassette.cpp +++ b/src/devices/bus/a1bus/a1cassette.cpp @@ -56,14 +56,14 @@ const tiny_rom_entry *a1bus_cassette_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a1bus_cassette_device::a1bus_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a1bus_cassette_device::a1bus_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A1BUS_CASSETTE, "Apple I cassette board", tag, owner, clock, "a1cass", __FILE__), device_a1bus_card_interface(mconfig, *this), m_cassette(*this, "cassette"), m_rom(nullptr), m_cassette_output_flipflop(0) { } -a1bus_cassette_device::a1bus_cassette_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a1bus_cassette_device::a1bus_cassette_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_a1bus_card_interface(mconfig, *this), m_cassette(*this, "cassette"), m_rom(nullptr), m_cassette_output_flipflop(0) diff --git a/src/devices/bus/a1bus/a1cassette.h b/src/devices/bus/a1bus/a1cassette.h index b5391e680ff..408ae5fe4cf 100644 --- a/src/devices/bus/a1bus/a1cassette.h +++ b/src/devices/bus/a1bus/a1cassette.h @@ -24,8 +24,8 @@ class a1bus_cassette_device: { public: // construction/destruction - a1bus_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a1bus_cassette_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a1bus_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a1bus_cassette_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -43,7 +43,7 @@ protected: void cassette_toggle_output(); private: - UINT8 *m_rom; + uint8_t *m_rom; int m_cassette_output_flipflop; }; diff --git a/src/devices/bus/a1bus/a1cffa.cpp b/src/devices/bus/a1bus/a1cffa.cpp index 4edaf39c5d0..c553d63a2af 100644 --- a/src/devices/bus/a1bus/a1cffa.cpp +++ b/src/devices/bus/a1bus/a1cffa.cpp @@ -51,14 +51,14 @@ const tiny_rom_entry *a1bus_cffa_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a1bus_cffa_device::a1bus_cffa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a1bus_cffa_device::a1bus_cffa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A1BUS_CFFA, "CFFA Compact Flash for Apple I", tag, owner, clock, "cffa1", __FILE__), device_a1bus_card_interface(mconfig, *this), m_ata(*this, CFFA_ATA_TAG), m_rom(nullptr), m_lastdata(0), m_writeprotect(false) { } -a1bus_cffa_device::a1bus_cffa_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a1bus_cffa_device::a1bus_cffa_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_a1bus_card_interface(mconfig, *this), m_ata(*this, CFFA_ATA_TAG), m_rom(nullptr), m_lastdata(0), m_writeprotect(false) diff --git a/src/devices/bus/a1bus/a1cffa.h b/src/devices/bus/a1bus/a1cffa.h index 1a342c34b33..30b55fea2d9 100644 --- a/src/devices/bus/a1bus/a1cffa.h +++ b/src/devices/bus/a1bus/a1cffa.h @@ -25,8 +25,8 @@ class a1bus_cffa_device: { public: // construction/destruction - a1bus_cffa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a1bus_cffa_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a1bus_cffa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a1bus_cffa_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -42,8 +42,8 @@ protected: virtual void device_reset() override; private: - UINT8 *m_rom; - UINT16 m_lastdata; + uint8_t *m_rom; + uint16_t m_lastdata; bool m_writeprotect; }; diff --git a/src/devices/bus/a2bus/a2alfam2.cpp b/src/devices/bus/a2bus/a2alfam2.cpp index 3e701a636fd..0bee8380532 100644 --- a/src/devices/bus/a2bus/a2alfam2.cpp +++ b/src/devices/bus/a2bus/a2alfam2.cpp @@ -82,7 +82,7 @@ machine_config_constructor a2bus_aesms_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -a2bus_sn76489_device::a2bus_sn76489_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_sn76489_device::a2bus_sn76489_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_a2bus_card_interface(mconfig, *this), m_sn1(*this, SN1_TAG), @@ -92,13 +92,13 @@ a2bus_sn76489_device::a2bus_sn76489_device(const machine_config &mconfig, device { } -a2bus_alfam2_device::a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_alfam2_device::a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_sn76489_device(mconfig, A2BUS_ALFAM2, "ALF MC1 / Apple Music II", tag, owner, clock, "a2alfam2", __FILE__) { m_has4thsn = false; } -a2bus_aesms_device::a2bus_aesms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_aesms_device::a2bus_aesms_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_sn76489_device(mconfig, A2BUS_ALFAM2, "Applied Engineering Super Music Synthesizer", tag, owner, clock, "a2aesms", __FILE__) { m_has4thsn = true; @@ -125,7 +125,7 @@ void a2bus_sn76489_device::device_reset() m_latch0 = m_latch1 = m_latch2 = m_latch3 = 0; } -UINT8 a2bus_sn76489_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_sn76489_device::read_c0nx(address_space &space, uint8_t offset) { // SN76489 can't be read, it appears from the schematics this is what happens switch (offset) @@ -146,7 +146,7 @@ UINT8 a2bus_sn76489_device::read_c0nx(address_space &space, UINT8 offset) return 0xff; } -void a2bus_sn76489_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_sn76489_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/a2bus/a2alfam2.h b/src/devices/bus/a2bus/a2alfam2.h index b02792afe9a..7aa17be0263 100644 --- a/src/devices/bus/a2bus/a2alfam2.h +++ b/src/devices/bus/a2bus/a2alfam2.h @@ -25,7 +25,7 @@ class a2bus_sn76489_device: { public: // construction/destruction - a2bus_sn76489_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_sn76489_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -40,12 +40,12 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; virtual bool take_c800() override; private: - UINT8 m_latch0, m_latch1, m_latch2, m_latch3; + uint8_t m_latch0, m_latch1, m_latch2, m_latch3; protected: bool m_has4thsn; @@ -54,13 +54,13 @@ protected: class a2bus_alfam2_device : public a2bus_sn76489_device { public: - a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_alfam2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class a2bus_aesms_device : public a2bus_sn76489_device { public: - a2bus_aesms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_aesms_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; diff --git a/src/devices/bus/a2bus/a2applicard.cpp b/src/devices/bus/a2bus/a2applicard.cpp index 3075bd12ede..1e4f71e3e33 100644 --- a/src/devices/bus/a2bus/a2applicard.cpp +++ b/src/devices/bus/a2bus/a2applicard.cpp @@ -75,14 +75,14 @@ const tiny_rom_entry *a2bus_applicard_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_applicard_device::a2bus_applicard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_applicard_device::a2bus_applicard_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_a2bus_card_interface(mconfig, *this), m_z80(*this, Z80_TAG), m_bROMAtZ80Zero(false), m_z80stat(false), m_6502stat(false), m_toz80(0), m_to6502(0), m_z80rom(nullptr) { } -a2bus_applicard_device::a2bus_applicard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_applicard_device::a2bus_applicard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_APPLICARD, "PCPI Applicard", tag, owner, clock, "a2aplcrd", __FILE__), device_a2bus_card_interface(mconfig, *this), m_z80(*this, Z80_TAG), m_bROMAtZ80Zero(false), m_z80stat(false), m_6502stat(false), m_toz80(0), m_to6502(0), m_z80rom(nullptr) @@ -117,7 +117,7 @@ void a2bus_applicard_device::device_reset() m_z80stat = false; } -UINT8 a2bus_applicard_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_applicard_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset & 0xf) { @@ -160,7 +160,7 @@ UINT8 a2bus_applicard_device::read_c0nx(address_space &space, UINT8 offset) return 0xff; } -void a2bus_applicard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_applicard_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset & 0xf) { @@ -184,7 +184,7 @@ void a2bus_applicard_device::write_c0nx(address_space &space, UINT8 offset, UINT READ8_MEMBER( a2bus_applicard_device::z80_io_r ) { - UINT8 tmp = 0; + uint8_t tmp = 0; switch (offset) { diff --git a/src/devices/bus/a2bus/a2applicard.h b/src/devices/bus/a2bus/a2applicard.h index fa0b11be8bf..610353c71b2 100644 --- a/src/devices/bus/a2bus/a2applicard.h +++ b/src/devices/bus/a2bus/a2applicard.h @@ -24,8 +24,8 @@ class a2bus_applicard_device: { public: // construction/destruction - a2bus_applicard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_applicard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_applicard_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); + a2bus_applicard_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; @@ -41,8 +41,8 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; virtual bool take_c800() override; required_device m_z80; @@ -50,9 +50,9 @@ protected: private: bool m_bROMAtZ80Zero; bool m_z80stat, m_6502stat; - UINT8 m_toz80, m_to6502; - UINT8 m_z80ram[64*1024]; - UINT8 *m_z80rom; + uint8_t m_toz80, m_to6502; + uint8_t m_z80ram[64*1024]; + uint8_t *m_z80rom; }; // device type definition diff --git a/src/devices/bus/a2bus/a2arcadebd.cpp b/src/devices/bus/a2bus/a2arcadebd.cpp index dcad400f8b1..31d86d7bddc 100644 --- a/src/devices/bus/a2bus/a2arcadebd.cpp +++ b/src/devices/bus/a2bus/a2arcadebd.cpp @@ -57,7 +57,7 @@ machine_config_constructor a2bus_arcboard_device::device_mconfig_additions() con // LIVE DEVICE //************************************************************************** -a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_ARCADEBOARD, "Third Millenium Engineering Arcade Board", tag, owner, clock, "a2arcbd", __FILE__), device_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG), @@ -65,7 +65,7 @@ a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, cons { } -a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_arcboard_device::a2bus_arcboard_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_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG), @@ -97,7 +97,7 @@ void a2bus_arcboard_device::device_reset() 6 - AY data */ -UINT8 a2bus_arcboard_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_arcboard_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -114,7 +114,7 @@ UINT8 a2bus_arcboard_device::read_c0nx(address_space &space, UINT8 offset) return 0xff; } -void a2bus_arcboard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_arcboard_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/a2bus/a2arcadebd.h b/src/devices/bus/a2bus/a2arcadebd.h index 1268244ca9f..38fa21902a5 100644 --- a/src/devices/bus/a2bus/a2arcadebd.h +++ b/src/devices/bus/a2bus/a2arcadebd.h @@ -26,8 +26,8 @@ class a2bus_arcboard_device: { public: // construction/destruction - a2bus_arcboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_arcboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_arcboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_arcboard_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -39,8 +39,8 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; required_device m_tms; required_device m_ay; diff --git a/src/devices/bus/a2bus/a2bus.cpp b/src/devices/bus/a2bus/a2bus.cpp index 2083a607690..b1c97c08693 100644 --- a/src/devices/bus/a2bus/a2bus.cpp +++ b/src/devices/bus/a2bus/a2bus.cpp @@ -87,13 +87,13 @@ const device_type A2BUS_SLOT = &device_creator; //------------------------------------------------- // a2bus_slot_device - constructor //------------------------------------------------- -a2bus_slot_device::a2bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_slot_device::a2bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_SLOT, "Apple II Slot", tag, owner, clock, "a2bus_slot", __FILE__), device_slot_interface(mconfig, *this), m_a2bus_tag(nullptr), m_a2bus_slottag(nullptr) { } -a2bus_slot_device::a2bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_slot_device::a2bus_slot_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_slot_interface(mconfig, *this), m_a2bus_tag(nullptr), m_a2bus_slottag(nullptr) { @@ -137,7 +137,7 @@ void a2bus_device::static_set_cputag(device_t &device, const char *tag) // a2bus_device - constructor //------------------------------------------------- -a2bus_device::a2bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_device::a2bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS, "Apple II Bus", tag, owner, clock, "a2bus", __FILE__), m_maincpu(nullptr), m_maincpu_space(nullptr), m_out_irq_cb(*this), m_out_nmi_cb(*this), @@ -145,7 +145,7 @@ a2bus_device::a2bus_device(const machine_config &mconfig, const char *tag, devic { } -a2bus_device::a2bus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_device::a2bus_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_maincpu(nullptr), m_maincpu_space(nullptr), m_out_irq_cb(*this), m_out_nmi_cb(*this), @@ -203,12 +203,12 @@ void a2bus_device::add_a2bus_card(int slot, device_a2bus_card_interface *card) m_device_list[slot] = card; } -UINT8 a2bus_device::get_a2bus_irq_mask() +uint8_t a2bus_device::get_a2bus_irq_mask() { return m_slot_irq_mask; } -UINT8 a2bus_device::get_a2bus_nmi_mask() +uint8_t a2bus_device::get_a2bus_nmi_mask() { return m_slot_nmi_mask; } @@ -246,26 +246,26 @@ void a2bus_device::set_maincpu_halt(int state) m_maincpu->set_input_line(INPUT_LINE_HALT, state); } -UINT8 a2bus_device::dma_r(address_space &space, UINT16 offset) +uint8_t a2bus_device::dma_r(address_space &space, uint16_t offset) { m_maincpu_space->set_debugger_access(space.debugger_access()); return m_maincpu_space->read_byte(offset); } -void a2bus_device::dma_w(address_space &space, UINT16 offset, UINT8 data) +void a2bus_device::dma_w(address_space &space, uint16_t offset, uint8_t data) { m_maincpu_space->set_debugger_access(space.debugger_access()); m_maincpu_space->write_byte(offset, data); } -UINT8 a2bus_device::dma_nospace_r(UINT16 offset) +uint8_t a2bus_device::dma_nospace_r(uint16_t offset) { return m_maincpu_space->read_byte(offset); } -void a2bus_device::dma_nospace_w(UINT16 offset, UINT8 data) +void a2bus_device::dma_nospace_w(uint16_t offset, uint8_t data) { m_maincpu_space->write_byte(offset, data); } diff --git a/src/devices/bus/a2bus/a2bus.h b/src/devices/bus/a2bus/a2bus.h index 07d4e57781d..72706946730 100644 --- a/src/devices/bus/a2bus/a2bus.h +++ b/src/devices/bus/a2bus/a2bus.h @@ -63,8 +63,8 @@ class a2bus_slot_device : public device_t, { public: // construction/destruction - a2bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_slot_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-level overrides virtual void device_start() override; @@ -88,8 +88,8 @@ class a2bus_device : public device_t friend class a2bus_mcms2_device; public: // construction/destruction - a2bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_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); // inline configuration static void static_set_cputag(device_t &device, const char *tag); @@ -99,17 +99,17 @@ public: void add_a2bus_card(int slot, device_a2bus_card_interface *card); device_a2bus_card_interface *get_a2bus_card(int slot); - UINT8 get_a2bus_irq_mask(); - UINT8 get_a2bus_nmi_mask(); + uint8_t get_a2bus_irq_mask(); + uint8_t get_a2bus_nmi_mask(); void set_irq_line(int state, int slot); void set_nmi_line(int state, int slot); void set_maincpu_halt(int state); void recalc_inh(int slot); - UINT8 dma_r(address_space &space, UINT16 offset); - void dma_w(address_space &space, UINT16 offset, UINT8 data); - UINT8 dma_nospace_r(UINT16 offset); - void dma_nospace_w(UINT16 offset, UINT8 data); + uint8_t dma_r(address_space &space, uint16_t offset); + void dma_w(address_space &space, uint16_t offset, uint8_t data); + uint8_t dma_nospace_r(uint16_t offset); + void dma_nospace_w(uint16_t offset, uint8_t data); DECLARE_WRITE_LINE_MEMBER( irq_w ); DECLARE_WRITE_LINE_MEMBER( nmi_w ); @@ -130,8 +130,8 @@ protected: device_a2bus_card_interface *m_device_list[8]; const char *m_cputag; - UINT8 m_slot_irq_mask; - UINT8 m_slot_nmi_mask; + uint8_t m_slot_irq_mask; + uint8_t m_slot_nmi_mask; }; @@ -149,25 +149,25 @@ public: device_a2bus_card_interface(const machine_config &mconfig, device_t &device); virtual ~device_a2bus_card_interface(); - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) { m_device.logerror("a2bus: unhandled read at C0n%x\n", offset); return 0; } // C0nX - /DEVSEL - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) { m_device.logerror("a2bus: unhandled write %02x to C0n%x\n", data, offset); } - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) { return 0; } // CnXX - /IOSEL - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) { m_device.logerror("a2bus: unhandled write %02x to Cn%02x\n", data, offset); } - virtual UINT8 read_c800(address_space &space, UINT16 offset) { return 0; } // C800 - /IOSTB - virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) {m_device.logerror("a2bus: unhandled write %02x to %04x\n", data, offset + 0xc800); } + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) { m_device.logerror("a2bus: unhandled read at C0n%x\n", offset); return 0; } // C0nX - /DEVSEL + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) { m_device.logerror("a2bus: unhandled write %02x to C0n%x\n", data, offset); } + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) { return 0; } // CnXX - /IOSEL + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) { m_device.logerror("a2bus: unhandled write %02x to Cn%02x\n", data, offset); } + virtual uint8_t read_c800(address_space &space, uint16_t offset) { return 0; } // C800 - /IOSTB + virtual void write_c800(address_space &space, uint16_t offset, uint8_t data) {m_device.logerror("a2bus: unhandled write %02x to %04x\n", data, offset + 0xc800); } virtual bool take_c800() { return true; } // override and return false if your card doesn't take over the c800 space - virtual UINT8 read_inh_rom(address_space &space, UINT16 offset) { return 0; } - virtual void write_inh_rom(address_space &space, UINT16 offset, UINT8 data) { } - virtual UINT16 inh_start() { return INH_START_INVALID; } - virtual UINT16 inh_end() { return INH_END_INVALID; } + virtual uint8_t read_inh_rom(address_space &space, uint16_t offset) { return 0; } + virtual void write_inh_rom(address_space &space, uint16_t offset, uint8_t data) { } + virtual uint16_t inh_start() { return INH_START_INVALID; } + virtual uint16_t inh_end() { return INH_END_INVALID; } virtual int inh_type() { return INH_NONE; } device_a2bus_card_interface *next() const { return m_next; } void set_a2bus_device(); - UINT32 get_slotromspace() { return 0xc000 | (m_slot<<8); } // return Cn00 address for this slot - UINT32 get_slotiospace() { return 0xc080 + (m_slot<<4); } // return C0n0 address for this slot + uint32_t get_slotromspace() { return 0xc000 | (m_slot<<8); } // return Cn00 address for this slot + uint32_t get_slotiospace() { return 0xc080 + (m_slot<<4); } // return C0n0 address for this slot void raise_slot_irq() { m_a2bus->set_irq_line(ASSERT_LINE, m_slot); } void lower_slot_irq() { m_a2bus->set_irq_line(CLEAR_LINE, m_slot); } @@ -178,12 +178,12 @@ public: // pass through the original address space if any for debugger protection // when debugging e.g. coprocessor cards (Z80 SoftCard etc). - UINT8 slot_dma_read(address_space &space, UINT16 offset) { return m_a2bus->dma_r(space, offset); } - void slot_dma_write(address_space &space, UINT16 offset, UINT8 data) { m_a2bus->dma_w(space, offset, data); } + uint8_t slot_dma_read(address_space &space, uint16_t offset) { return m_a2bus->dma_r(space, offset); } + void slot_dma_write(address_space &space, uint16_t offset, uint8_t data) { m_a2bus->dma_w(space, offset, data); } // these versions forego that protection for when the DMA isn't coming from a debuggable CPU device - UINT8 slot_dma_read_no_space(UINT16 offset) { return m_a2bus->dma_nospace_r(offset); } - void slot_dma_write_no_space(UINT16 offset, UINT8 data) { m_a2bus->dma_nospace_w(offset, data); } + uint8_t slot_dma_read_no_space(uint16_t offset) { return m_a2bus->dma_nospace_r(offset); } + void slot_dma_write_no_space(uint16_t offset, uint8_t data) { m_a2bus->dma_nospace_w(offset, data); } // inline configuration static void static_set_a2bus_tag(device_t &device, const char *tag, const char *slottag); diff --git a/src/devices/bus/a2bus/a2cffa.cpp b/src/devices/bus/a2bus/a2cffa.cpp index 85eef339230..e046b2e120e 100644 --- a/src/devices/bus/a2bus/a2cffa.cpp +++ b/src/devices/bus/a2bus/a2cffa.cpp @@ -83,20 +83,20 @@ const tiny_rom_entry *a2bus_cffa2_6502_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_cffa2000_device::a2bus_cffa2000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_cffa2000_device::a2bus_cffa2000_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_a2bus_card_interface(mconfig, *this), m_ata(*this, CFFA2_ATA_TAG), m_rom(nullptr), m_lastdata(0), m_lastreaddata(0), m_writeprotect(false), m_inwritecycle(false) { } -a2bus_cffa2_device::a2bus_cffa2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_cffa2_device::a2bus_cffa2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_cffa2000_device(mconfig, A2BUS_CFFA2, "CFFA2000 Compact Flash (65C02 firmware, www.dreher.net)", tag, owner, clock, "a2cffa2", __FILE__), device_nvram_interface(mconfig, *this) { } -a2bus_cffa2_6502_device::a2bus_cffa2_6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_cffa2_6502_device::a2bus_cffa2_6502_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_cffa2000_device(mconfig, A2BUS_CFFA2, "CFFA2000 Compact Flash (6502 firmware, www.dreher.net)", tag, owner, clock, "a2cffa02", __FILE__), device_nvram_interface(mconfig, *this) { @@ -135,7 +135,7 @@ void a2bus_cffa2000_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_cffa2000_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_cffa2000_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -176,7 +176,7 @@ UINT8 a2bus_cffa2000_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_cffa2000_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_cffa2000_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { m_inwritecycle = false; @@ -220,7 +220,7 @@ void a2bus_cffa2000_device::write_c0nx(address_space &space, UINT8 offset, UINT8 read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_cffa2000_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_cffa2000_device::read_cnxx(address_space &space, uint8_t offset) { int slotimg = m_slot * 0x100; @@ -232,12 +232,12 @@ UINT8 a2bus_cffa2000_device::read_cnxx(address_space &space, UINT8 offset) read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_cffa2000_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_cffa2000_device::read_c800(address_space &space, uint16_t offset) { return m_eeprom[offset+0x800]; } -void a2bus_cffa2000_device::write_c800(address_space &space, UINT16 offset, UINT8 data) +void a2bus_cffa2000_device::write_c800(address_space &space, uint16_t offset, uint8_t data) { if (!m_writeprotect) { diff --git a/src/devices/bus/a2bus/a2cffa.h b/src/devices/bus/a2bus/a2cffa.h index b628fb16d1a..d5713ff254f 100644 --- a/src/devices/bus/a2bus/a2cffa.h +++ b/src/devices/bus/a2bus/a2cffa.h @@ -26,7 +26,7 @@ class a2bus_cffa2000_device: { public: // construction/destruction - a2bus_cffa2000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_cffa2000_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -37,19 +37,19 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; - virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; + virtual void write_c800(address_space &space, uint16_t offset, uint8_t data) override; required_device m_ata; - UINT8 *m_rom; - UINT8 m_eeprom[0x1000]; + uint8_t *m_rom; + uint8_t m_eeprom[0x1000]; private: - UINT16 m_lastdata, m_lastreaddata; + uint16_t m_lastdata, m_lastreaddata; bool m_writeprotect; bool m_inwritecycle; }; @@ -57,7 +57,7 @@ private: class a2bus_cffa2_device : public a2bus_cffa2000_device, public device_nvram_interface { public: - a2bus_cffa2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_cffa2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device_config_nvram_interface overrides @@ -69,7 +69,7 @@ protected: class a2bus_cffa2_6502_device : public a2bus_cffa2000_device, public device_nvram_interface { public: - a2bus_cffa2_6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_cffa2_6502_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; protected: diff --git a/src/devices/bus/a2bus/a2corvus.cpp b/src/devices/bus/a2bus/a2corvus.cpp index cc95c3919cb..9ee553b17d8 100644 --- a/src/devices/bus/a2bus/a2corvus.cpp +++ b/src/devices/bus/a2bus/a2corvus.cpp @@ -101,14 +101,14 @@ const tiny_rom_entry *a2bus_corvus_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_corvus_device::a2bus_corvus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_corvus_device::a2bus_corvus_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_a2bus_card_interface(mconfig, *this), m_corvushd(*this, CORVUS_HD_TAG), m_rom(nullptr) { } -a2bus_corvus_device::a2bus_corvus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_corvus_device::a2bus_corvus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_CORVUS, "Corvus Flat Cable interface", tag, owner, clock, "a2corvus", __FILE__), device_a2bus_card_interface(mconfig, *this), m_corvushd(*this, CORVUS_HD_TAG), m_rom(nullptr) @@ -136,7 +136,7 @@ void a2bus_corvus_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_corvus_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_corvus_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -159,7 +159,7 @@ UINT8 a2bus_corvus_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_corvus_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_corvus_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { if (offset == 0) { @@ -171,7 +171,7 @@ void a2bus_corvus_device::write_c0nx(address_space &space, UINT8 offset, UINT8 d read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_corvus_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_corvus_device::read_cnxx(address_space &space, uint8_t offset) { // one slot image at the end of the ROM, it appears return m_rom[offset+0x700]; @@ -181,7 +181,7 @@ UINT8 a2bus_corvus_device::read_cnxx(address_space &space, UINT8 offset) read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_corvus_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_corvus_device::read_c800(address_space &space, uint16_t offset) { return m_rom[offset & 0x7ff]; } diff --git a/src/devices/bus/a2bus/a2corvus.h b/src/devices/bus/a2bus/a2corvus.h index 2e64d8b9cdc..2d6a0042637 100644 --- a/src/devices/bus/a2bus/a2corvus.h +++ b/src/devices/bus/a2bus/a2corvus.h @@ -26,8 +26,8 @@ class a2bus_corvus_device: { public: // construction/destruction - a2bus_corvus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_corvus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_corvus_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); + a2bus_corvus_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; @@ -40,13 +40,13 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; private: - UINT8 *m_rom; + uint8_t *m_rom; }; // device type definition diff --git a/src/devices/bus/a2bus/a2diskii.cpp b/src/devices/bus/a2bus/a2diskii.cpp index cfda06bbdcb..50243e2f596 100644 --- a/src/devices/bus/a2bus/a2diskii.cpp +++ b/src/devices/bus/a2bus/a2diskii.cpp @@ -90,19 +90,19 @@ const tiny_rom_entry *a2bus_floppy_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_floppy_device::a2bus_floppy_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_floppy_device::a2bus_floppy_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_a2bus_card_interface(mconfig, *this), m_fdc(*this, FDC_TAG), m_rom(nullptr) { } -a2bus_diskii_device::a2bus_diskii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_diskii_device::a2bus_diskii_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_floppy_device(mconfig, A2BUS_DISKII, "Apple Disk II controller", tag, owner, clock, "a2diskii", __FILE__) { } -a2bus_iwmflop_device::a2bus_iwmflop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_iwmflop_device::a2bus_iwmflop_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_floppy_device(mconfig, A2BUS_IWM_FDC, "Apple IWM floppy card", tag, owner, clock, "a2iwm_flop", __FILE__) { } @@ -128,7 +128,7 @@ void a2bus_floppy_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_floppy_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_floppy_device::read_c0nx(address_space &space, uint8_t offset) { return m_fdc->read(offset); } @@ -138,7 +138,7 @@ UINT8 a2bus_floppy_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_floppy_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_floppy_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { m_fdc->write(offset, data); } @@ -147,7 +147,7 @@ void a2bus_floppy_device::write_c0nx(address_space &space, UINT8 offset, UINT8 d read_cnxx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_floppy_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_floppy_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset]; } diff --git a/src/devices/bus/a2bus/a2diskii.h b/src/devices/bus/a2bus/a2diskii.h index 75363e244ed..622369e25fc 100644 --- a/src/devices/bus/a2bus/a2diskii.h +++ b/src/devices/bus/a2bus/a2diskii.h @@ -25,7 +25,7 @@ class a2bus_floppy_device: { public: // construction/destruction - a2bus_floppy_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_floppy_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -36,26 +36,26 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; required_device m_fdc; private: - UINT8 *m_rom; + uint8_t *m_rom; }; class a2bus_diskii_device: public a2bus_floppy_device { public: - a2bus_diskii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_diskii_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class a2bus_iwmflop_device: public a2bus_floppy_device { public: - a2bus_iwmflop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_iwmflop_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; diff --git a/src/devices/bus/a2bus/a2diskiing.cpp b/src/devices/bus/a2bus/a2diskiing.cpp index cf83f6d16df..749bd0000c0 100644 --- a/src/devices/bus/a2bus/a2diskiing.cpp +++ b/src/devices/bus/a2bus/a2diskiing.cpp @@ -68,7 +68,7 @@ const tiny_rom_entry *a2bus_diskiing_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_diskiing_device::a2bus_diskiing_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_diskiing_device::a2bus_diskiing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_DISKIING, "Apple Disk II NG controller", tag, owner, clock, "a2diskiing", __FILE__), device_a2bus_card_interface(mconfig, *this), m_wozfdc(*this, WOZFDC_TAG), @@ -98,7 +98,7 @@ void a2bus_diskiing_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_diskiing_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_diskiing_device::read_c0nx(address_space &space, uint8_t offset) { return m_wozfdc->read(space, offset); } @@ -108,7 +108,7 @@ UINT8 a2bus_diskiing_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_diskiing_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_diskiing_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { m_wozfdc->write(space, offset, data); } @@ -117,7 +117,7 @@ void a2bus_diskiing_device::write_c0nx(address_space &space, UINT8 offset, UINT8 read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_diskiing_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_diskiing_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset]; } diff --git a/src/devices/bus/a2bus/a2diskiing.h b/src/devices/bus/a2bus/a2diskiing.h index f1ac98cc8c0..164476fe381 100644 --- a/src/devices/bus/a2bus/a2diskiing.h +++ b/src/devices/bus/a2bus/a2diskiing.h @@ -28,7 +28,7 @@ class a2bus_diskiing_device: { public: // construction/destruction - a2bus_diskiing_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_diskiing_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; @@ -41,16 +41,16 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; private: required_device m_wozfdc; required_device floppy0; required_device floppy1; - const UINT8 *m_rom; + const uint8_t *m_rom; }; // device type definition diff --git a/src/devices/bus/a2bus/a2dx1.cpp b/src/devices/bus/a2bus/a2dx1.cpp index aa2281eff1e..158403ee10c 100644 --- a/src/devices/bus/a2bus/a2dx1.cpp +++ b/src/devices/bus/a2bus/a2dx1.cpp @@ -49,7 +49,7 @@ machine_config_constructor a2bus_dx1_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -a2bus_dx1_device::a2bus_dx1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_dx1_device::a2bus_dx1_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_a2bus_card_interface(mconfig, *this), m_dac(*this, "dac"), @@ -57,7 +57,7 @@ a2bus_dx1_device::a2bus_dx1_device(const machine_config &mconfig, device_type ty { } -a2bus_dx1_device::a2bus_dx1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_dx1_device::a2bus_dx1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_DX1, "Decillonix DX-1", tag, owner, clock, "a2dx1", __FILE__), device_a2bus_card_interface(mconfig, *this), m_dac(*this, "dac"), @@ -75,7 +75,7 @@ void a2bus_dx1_device::device_start() set_a2bus_device(); } -UINT8 a2bus_dx1_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_dx1_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -92,7 +92,7 @@ UINT8 a2bus_dx1_device::read_c0nx(address_space &space, UINT8 offset) return 0xff; } -void a2bus_dx1_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_dx1_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/a2bus/a2dx1.h b/src/devices/bus/a2bus/a2dx1.h index 3dcf59e81e3..1f68489ce52 100644 --- a/src/devices/bus/a2bus/a2dx1.h +++ b/src/devices/bus/a2bus/a2dx1.h @@ -25,8 +25,8 @@ class a2bus_dx1_device: { public: // construction/destruction - a2bus_dx1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_dx1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_dx1_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); + a2bus_dx1_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; @@ -38,8 +38,8 @@ protected: virtual void device_start() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; virtual bool take_c800() override; }; diff --git a/src/devices/bus/a2bus/a2eauxslot.cpp b/src/devices/bus/a2bus/a2eauxslot.cpp index c362c23abe5..e8588f31260 100644 --- a/src/devices/bus/a2bus/a2eauxslot.cpp +++ b/src/devices/bus/a2bus/a2eauxslot.cpp @@ -25,7 +25,7 @@ const device_type A2EAUXSLOT_SLOT = &device_creator; //------------------------------------------------- // a2eauxslot_slot_device - constructor //------------------------------------------------- -a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2EAUXSLOT_SLOT, "Apple IIe AUX Slot", tag, owner, clock, "a2eauxslot_slot", __FILE__), device_slot_interface(mconfig, *this), m_a2eauxslot_tag(nullptr), @@ -33,7 +33,7 @@ a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, co { } -a2eauxslot_slot_device::a2eauxslot_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2eauxslot_slot_device::a2eauxslot_slot_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_slot_interface(mconfig, *this), m_a2eauxslot_tag(nullptr), m_a2eauxslot_slottag(nullptr) { @@ -77,14 +77,14 @@ void a2eauxslot_device::static_set_cputag(device_t &device, const char *tag) // a2eauxslot_device - constructor //------------------------------------------------- -a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2EAUXSLOT, "Apple IIe AUX Bus", tag, owner, clock, "a2eauxslot", __FILE__), m_maincpu(nullptr), m_out_irq_cb(*this), m_out_nmi_cb(*this), m_device(nullptr), m_cputag(nullptr) { } -a2eauxslot_device::a2eauxslot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2eauxslot_device::a2eauxslot_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_maincpu(nullptr), m_out_irq_cb(*this), m_out_nmi_cb(*this), m_device(nullptr), m_cputag(nullptr) diff --git a/src/devices/bus/a2bus/a2eauxslot.h b/src/devices/bus/a2bus/a2eauxslot.h index 06d83a9435d..f040ea56fa6 100644 --- a/src/devices/bus/a2bus/a2eauxslot.h +++ b/src/devices/bus/a2bus/a2eauxslot.h @@ -47,8 +47,8 @@ class a2eauxslot_slot_device : public device_t, { public: // construction/destruction - a2eauxslot_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2eauxslot_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2eauxslot_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2eauxslot_slot_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-level overrides virtual void device_start() override; @@ -71,8 +71,8 @@ class a2eauxslot_device : public device_t { public: // construction/destruction - a2eauxslot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2eauxslot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2eauxslot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2eauxslot_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); // inline configuration static void static_set_cputag(device_t &device, const char *tag); @@ -118,11 +118,11 @@ public: device_a2eauxslot_card_interface(const machine_config &mconfig, device_t &device); virtual ~device_a2eauxslot_card_interface(); - virtual UINT8 read_auxram(UINT16 offset) { printf("a2eauxslot: unhandled auxram read @ %04x\n", offset); return 0xff; } - virtual void write_auxram(UINT16 offset, UINT8 data) { printf("a2eauxslot: unhandled auxram write %02x @ %04x\n", data, offset); } - virtual void write_c07x(address_space &space, UINT8 offset, UINT8 data) {} - virtual UINT8 *get_vram_ptr() = 0; - virtual UINT8 *get_auxbank_ptr() = 0; + virtual uint8_t read_auxram(uint16_t offset) { printf("a2eauxslot: unhandled auxram read @ %04x\n", offset); return 0xff; } + virtual void write_auxram(uint16_t offset, uint8_t data) { printf("a2eauxslot: unhandled auxram write %02x @ %04x\n", data, offset); } + virtual void write_c07x(address_space &space, uint8_t offset, uint8_t data) {} + virtual uint8_t *get_vram_ptr() = 0; + virtual uint8_t *get_auxbank_ptr() = 0; virtual bool allow_dhr() { return true; } device_a2eauxslot_card_interface *next() const { return m_next; } diff --git a/src/devices/bus/a2bus/a2echoii.cpp b/src/devices/bus/a2bus/a2echoii.cpp index e6be96b5d85..ee8e318da31 100644 --- a/src/devices/bus/a2bus/a2echoii.cpp +++ b/src/devices/bus/a2bus/a2echoii.cpp @@ -48,14 +48,14 @@ machine_config_constructor a2bus_echoii_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -a2bus_echoii_device::a2bus_echoii_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_echoii_device::a2bus_echoii_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_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG) { } -a2bus_echoii_device::a2bus_echoii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_echoii_device::a2bus_echoii_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_ECHOII, "Street Electronics Echo II", tag, owner, clock, "a2echoii", __FILE__), device_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG) @@ -76,7 +76,7 @@ void a2bus_echoii_device::device_reset() { } -UINT8 a2bus_echoii_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_echoii_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -87,7 +87,7 @@ UINT8 a2bus_echoii_device::read_c0nx(address_space &space, UINT8 offset) return 0; } -void a2bus_echoii_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_echoii_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/a2bus/a2echoii.h b/src/devices/bus/a2bus/a2echoii.h index 70a83b5fd8b..a148bded238 100644 --- a/src/devices/bus/a2bus/a2echoii.h +++ b/src/devices/bus/a2bus/a2echoii.h @@ -25,8 +25,8 @@ class a2bus_echoii_device: { public: // construction/destruction - a2bus_echoii_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_echoii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_echoii_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); + a2bus_echoii_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; @@ -38,8 +38,8 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; virtual bool take_c800() override; }; diff --git a/src/devices/bus/a2bus/a2eext80col.cpp b/src/devices/bus/a2bus/a2eext80col.cpp index c3e9af48cac..1d2f6ae4e74 100644 --- a/src/devices/bus/a2bus/a2eext80col.cpp +++ b/src/devices/bus/a2bus/a2eext80col.cpp @@ -27,13 +27,13 @@ const device_type A2EAUX_EXT80COL = &device_creator; // LIVE DEVICE //************************************************************************** -a2eaux_ext80col_device::a2eaux_ext80col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2eaux_ext80col_device::a2eaux_ext80col_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2EAUX_EXT80COL, "Apple IIe Extended 80-Column Card", tag, owner, clock, "a2eext80", __FILE__), device_a2eauxslot_card_interface(mconfig, *this) { } -a2eaux_ext80col_device::a2eaux_ext80col_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2eaux_ext80col_device::a2eaux_ext80col_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_a2eauxslot_card_interface(mconfig, *this) { @@ -54,22 +54,22 @@ void a2eaux_ext80col_device::device_reset() { } -UINT8 a2eaux_ext80col_device::read_auxram(UINT16 offset) +uint8_t a2eaux_ext80col_device::read_auxram(uint16_t offset) { return m_ram[offset]; } -void a2eaux_ext80col_device::write_auxram(UINT16 offset, UINT8 data) +void a2eaux_ext80col_device::write_auxram(uint16_t offset, uint8_t data) { m_ram[offset] = data; } -UINT8 *a2eaux_ext80col_device::get_vram_ptr() +uint8_t *a2eaux_ext80col_device::get_vram_ptr() { return &m_ram[0]; } -UINT8 *a2eaux_ext80col_device::get_auxbank_ptr() +uint8_t *a2eaux_ext80col_device::get_auxbank_ptr() { return &m_ram[0]; } diff --git a/src/devices/bus/a2bus/a2eext80col.h b/src/devices/bus/a2bus/a2eext80col.h index 01c56a7a714..2d6958c3639 100644 --- a/src/devices/bus/a2bus/a2eext80col.h +++ b/src/devices/bus/a2bus/a2eext80col.h @@ -24,21 +24,21 @@ class a2eaux_ext80col_device: { public: // construction/destruction - a2eaux_ext80col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2eaux_ext80col_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2eaux_ext80col_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2eaux_ext80col_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: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_auxram(UINT16 offset) override; - virtual void write_auxram(UINT16 offset, UINT8 data) override; - virtual UINT8 *get_vram_ptr() override; - virtual UINT8 *get_auxbank_ptr() override; + virtual uint8_t read_auxram(uint16_t offset) override; + virtual void write_auxram(uint16_t offset, uint8_t data) override; + virtual uint8_t *get_vram_ptr() override; + virtual uint8_t *get_auxbank_ptr() override; virtual bool allow_dhr() override { return true; } private: - UINT8 m_ram[64*1024]; + uint8_t m_ram[64*1024]; }; // device type definition diff --git a/src/devices/bus/a2bus/a2eramworks3.cpp b/src/devices/bus/a2bus/a2eramworks3.cpp index b7d6897b82d..c0a0e2c016d 100644 --- a/src/devices/bus/a2bus/a2eramworks3.cpp +++ b/src/devices/bus/a2bus/a2eramworks3.cpp @@ -28,14 +28,14 @@ const device_type A2EAUX_RAMWORKS3 = &device_creator; // LIVE DEVICE //************************************************************************** -a2eaux_ramworks3_device::a2eaux_ramworks3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2eaux_ramworks3_device::a2eaux_ramworks3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2EAUX_RAMWORKS3, "Applied Engineering RamWorks III", tag, owner, clock, "a2erwks3", __FILE__), device_a2eauxslot_card_interface(mconfig, *this), m_bank(0) { } -a2eaux_ramworks3_device::a2eaux_ramworks3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2eaux_ramworks3_device::a2eaux_ramworks3_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_a2eauxslot_card_interface(mconfig, *this), m_bank(0) { @@ -57,22 +57,22 @@ void a2eaux_ramworks3_device::device_reset() m_bank = 0; } -UINT8 a2eaux_ramworks3_device::read_auxram(UINT16 offset) +uint8_t a2eaux_ramworks3_device::read_auxram(uint16_t offset) { return m_ram[offset+m_bank]; } -void a2eaux_ramworks3_device::write_auxram(UINT16 offset, UINT8 data) +void a2eaux_ramworks3_device::write_auxram(uint16_t offset, uint8_t data) { m_ram[offset+m_bank] = data; } -UINT8 *a2eaux_ramworks3_device::get_vram_ptr() +uint8_t *a2eaux_ramworks3_device::get_vram_ptr() { return &m_ram[0]; } -UINT8 *a2eaux_ramworks3_device::get_auxbank_ptr() +uint8_t *a2eaux_ramworks3_device::get_auxbank_ptr() { return &m_ram[m_bank]; } @@ -90,7 +90,7 @@ UINT8 *a2eaux_ramworks3_device::get_auxbank_ptr() However, the software will recognize and correctly use a configuration in which all of banks 00-7F are populated for a total of 8 megabytes. So that's what we do. */ -void a2eaux_ramworks3_device::write_c07x(address_space &space, UINT8 offset, UINT8 data) +void a2eaux_ramworks3_device::write_c07x(address_space &space, uint8_t offset, uint8_t data) { // write to C073? if (offset == 3) diff --git a/src/devices/bus/a2bus/a2eramworks3.h b/src/devices/bus/a2bus/a2eramworks3.h index 7978a405512..c5b2a7e04f1 100644 --- a/src/devices/bus/a2bus/a2eramworks3.h +++ b/src/devices/bus/a2bus/a2eramworks3.h @@ -24,22 +24,22 @@ class a2eaux_ramworks3_device: { public: // construction/destruction - a2eaux_ramworks3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2eaux_ramworks3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2eaux_ramworks3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2eaux_ramworks3_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: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_auxram(UINT16 offset) override; - virtual void write_auxram(UINT16 offset, UINT8 data) override; - virtual UINT8 *get_vram_ptr() override; - virtual UINT8 *get_auxbank_ptr() override; + virtual uint8_t read_auxram(uint16_t offset) override; + virtual void write_auxram(uint16_t offset, uint8_t data) override; + virtual uint8_t *get_vram_ptr() override; + virtual uint8_t *get_auxbank_ptr() override; virtual bool allow_dhr() override { return true; } - virtual void write_c07x(address_space &space, UINT8 offset, UINT8 data) override; + virtual void write_c07x(address_space &space, uint8_t offset, uint8_t data) override; private: - UINT8 m_ram[8*1024*1024]; + uint8_t m_ram[8*1024*1024]; int m_bank; }; diff --git a/src/devices/bus/a2bus/a2estd80col.cpp b/src/devices/bus/a2bus/a2estd80col.cpp index 706f32d6a55..c6982aafa83 100644 --- a/src/devices/bus/a2bus/a2estd80col.cpp +++ b/src/devices/bus/a2bus/a2estd80col.cpp @@ -27,13 +27,13 @@ const device_type A2EAUX_STD80COL = &device_creator; // LIVE DEVICE //************************************************************************** -a2eaux_std80col_device::a2eaux_std80col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2eaux_std80col_device::a2eaux_std80col_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2EAUX_STD80COL, "Apple IIe Standard 80-Column Card", tag, owner, clock, "a2estd80", __FILE__), device_a2eauxslot_card_interface(mconfig, *this) { } -a2eaux_std80col_device::a2eaux_std80col_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2eaux_std80col_device::a2eaux_std80col_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_a2eauxslot_card_interface(mconfig, *this) { @@ -53,7 +53,7 @@ void a2eaux_std80col_device::device_reset() { } -UINT8 a2eaux_std80col_device::read_auxram(UINT16 offset) +uint8_t a2eaux_std80col_device::read_auxram(uint16_t offset) { if (offset < 0x800) { @@ -63,7 +63,7 @@ UINT8 a2eaux_std80col_device::read_auxram(UINT16 offset) return 0xff; } -void a2eaux_std80col_device::write_auxram(UINT16 offset, UINT8 data) +void a2eaux_std80col_device::write_auxram(uint16_t offset, uint8_t data) { if (offset < 0x800) { @@ -71,12 +71,12 @@ void a2eaux_std80col_device::write_auxram(UINT16 offset, UINT8 data) } } -UINT8 *a2eaux_std80col_device::get_vram_ptr() +uint8_t *a2eaux_std80col_device::get_vram_ptr() { return &m_ram[0]; } -UINT8 *a2eaux_std80col_device::get_auxbank_ptr() +uint8_t *a2eaux_std80col_device::get_auxbank_ptr() { return &m_ram[0]; } diff --git a/src/devices/bus/a2bus/a2estd80col.h b/src/devices/bus/a2bus/a2estd80col.h index 3c76459e951..420b7334a4f 100644 --- a/src/devices/bus/a2bus/a2estd80col.h +++ b/src/devices/bus/a2bus/a2estd80col.h @@ -24,21 +24,21 @@ class a2eaux_std80col_device: { public: // construction/destruction - a2eaux_std80col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2eaux_std80col_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2eaux_std80col_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2eaux_std80col_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: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_auxram(UINT16 offset) override; - virtual void write_auxram(UINT16 offset, UINT8 data) override; - virtual UINT8 *get_vram_ptr() override; - virtual UINT8 *get_auxbank_ptr() override; + virtual uint8_t read_auxram(uint16_t offset) override; + virtual void write_auxram(uint16_t offset, uint8_t data) override; + virtual uint8_t *get_vram_ptr() override; + virtual uint8_t *get_auxbank_ptr() override; virtual bool allow_dhr() override { return false; } // we don't allow DHR private: - UINT8 m_ram[2*1024]; + uint8_t m_ram[2*1024]; }; // device type definition diff --git a/src/devices/bus/a2bus/a2hsscsi.cpp b/src/devices/bus/a2bus/a2hsscsi.cpp index a9869d57f4d..e8e5f4b98e4 100644 --- a/src/devices/bus/a2bus/a2hsscsi.cpp +++ b/src/devices/bus/a2bus/a2hsscsi.cpp @@ -113,7 +113,7 @@ const tiny_rom_entry *a2bus_hsscsi_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_hsscsi_device::a2bus_hsscsi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_hsscsi_device::a2bus_hsscsi_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_a2bus_card_interface(mconfig, *this), m_ncr5380(*this, SCSI_5380_TAG), @@ -121,7 +121,7 @@ a2bus_hsscsi_device::a2bus_hsscsi_device(const machine_config &mconfig, device_t { } -a2bus_hsscsi_device::a2bus_hsscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_hsscsi_device::a2bus_hsscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_HSSCSI, "Apple II High-Speed SCSI Card", tag, owner, clock, "a2hsscsi", __FILE__), device_a2bus_card_interface(mconfig, *this), m_ncr5380(*this, SCSI_5380_TAG), @@ -163,7 +163,7 @@ void a2bus_hsscsi_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_hsscsi_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_hsscsi_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -200,7 +200,7 @@ UINT8 a2bus_hsscsi_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_hsscsi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_hsscsi_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -263,13 +263,13 @@ void a2bus_hsscsi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 d read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_hsscsi_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_hsscsi_device::read_cnxx(address_space &space, uint8_t offset) { // one slot image at the start of the ROM, it appears return m_rom[offset]; } -void a2bus_hsscsi_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_hsscsi_device::write_cnxx(address_space &space, uint8_t offset, uint8_t data) { // printf("Write %02x to cn%02x (PC=%x)\n", data, offset, space.device().safe_pc()); } @@ -278,7 +278,7 @@ void a2bus_hsscsi_device::write_cnxx(address_space &space, UINT8 offset, UINT8 d read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_hsscsi_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_hsscsi_device::read_c800(address_space &space, uint16_t offset) { // bankswitched RAM at c800-cbff // bankswitched ROM at cc00-cfff @@ -301,7 +301,7 @@ UINT8 a2bus_hsscsi_device::read_c800(address_space &space, UINT16 offset) /*------------------------------------------------- write_c800 - called for writes to this card's c800 space -------------------------------------------------*/ -void a2bus_hsscsi_device::write_c800(address_space &space, UINT16 offset, UINT8 data) +void a2bus_hsscsi_device::write_c800(address_space &space, uint16_t offset, uint8_t data) { if (offset < 0x400) { diff --git a/src/devices/bus/a2bus/a2hsscsi.h b/src/devices/bus/a2bus/a2hsscsi.h index 11f2ae7a48a..4689c997c86 100644 --- a/src/devices/bus/a2bus/a2hsscsi.h +++ b/src/devices/bus/a2bus/a2hsscsi.h @@ -25,8 +25,8 @@ class a2bus_hsscsi_device: { public: // construction/destruction - a2bus_hsscsi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_hsscsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_hsscsi_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); + a2bus_hsscsi_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; @@ -42,21 +42,21 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; - virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; + virtual void write_c800(address_space &space, uint16_t offset, uint8_t data) override; private: - UINT8 *m_rom; - UINT8 m_ram[8192]; // 8 banks of 1024 bytes + uint8_t *m_rom; + uint8_t m_ram[8192]; // 8 banks of 1024 bytes int m_rambank, m_rombank; - UINT8 m_drq; - UINT8 m_bank; + uint8_t m_drq; + uint8_t m_bank; bool m_816block; - UINT8 m_c0ne, m_c0nf; + uint8_t m_c0ne, m_c0nf; }; // device type definition diff --git a/src/devices/bus/a2bus/a2lang.cpp b/src/devices/bus/a2bus/a2lang.cpp index 9a0b21dca36..3c156fd4c90 100644 --- a/src/devices/bus/a2bus/a2lang.cpp +++ b/src/devices/bus/a2bus/a2lang.cpp @@ -34,14 +34,14 @@ const device_type A2BUS_LANG = &device_creator; // LIVE DEVICE //************************************************************************** -a2bus_lang_device::a2bus_lang_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_lang_device::a2bus_lang_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_LANG, "Apple II Language Card", tag, owner, clock, "a2lang", __FILE__), device_a2bus_card_interface(mconfig, *this) { last_offset = -1; } -a2bus_lang_device::a2bus_lang_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_lang_device::a2bus_lang_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_a2bus_card_interface(mconfig, *this) { @@ -70,7 +70,7 @@ void a2bus_lang_device::device_reset() void a2bus_lang_device::langcard_touch(offs_t offset) { - UINT32 val, mask; + uint32_t val, mask; if (LOG_LANGCARD) logerror("language card bankswitch read, offset: $c08%0x\n", offset); @@ -104,7 +104,7 @@ void a2bus_lang_device::langcard_touch(offs_t offset) read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_lang_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_lang_device::read_c0nx(address_space &space, uint8_t offset) { apple2_state *state = machine().driver_data(); @@ -138,7 +138,7 @@ UINT8 a2bus_lang_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_lang_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_lang_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { langcard_touch(offset); last_offset = -1; diff --git a/src/devices/bus/a2bus/a2lang.h b/src/devices/bus/a2bus/a2lang.h index 2fd14b5bd86..4d4bdc4aa81 100644 --- a/src/devices/bus/a2bus/a2lang.h +++ b/src/devices/bus/a2bus/a2lang.h @@ -24,15 +24,15 @@ class a2bus_lang_device: { public: // construction/destruction - a2bus_lang_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_lang_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_lang_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_lang_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: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; private: void langcard_touch(offs_t offset); diff --git a/src/devices/bus/a2bus/a2mcms.cpp b/src/devices/bus/a2bus/a2mcms.cpp index ad7f621d6c8..57abe911fd0 100644 --- a/src/devices/bus/a2bus/a2mcms.cpp +++ b/src/devices/bus/a2bus/a2mcms.cpp @@ -68,14 +68,14 @@ machine_config_constructor a2bus_mcms1_device::device_mconfig_additions() const // LIVE DEVICE - Card 1 //************************************************************************** -a2bus_mcms1_device::a2bus_mcms1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_mcms1_device::a2bus_mcms1_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_a2bus_card_interface(mconfig, *this), m_mcms(*this, ENGINE_TAG) { } -a2bus_mcms1_device::a2bus_mcms1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_mcms1_device::a2bus_mcms1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_MCMS1, "Mountain Computer Music System (card 1)", tag, owner, clock, "a2mcms1", __FILE__), device_a2bus_card_interface(mconfig, *this), m_mcms(*this, ENGINE_TAG) @@ -99,7 +99,7 @@ void a2bus_mcms1_device::device_reset() // read once at c0n0 to disable 125 Hz IRQs // read once at c0n1 to enable 125 Hz IRQs -UINT8 a2bus_mcms1_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_mcms1_device::read_c0nx(address_space &space, uint8_t offset) { if (offset == 0) { @@ -114,13 +114,13 @@ UINT8 a2bus_mcms1_device::read_c0nx(address_space &space, UINT8 offset) } // read at Cn00: light gun in bit 7, bits 0-5 = 'random' number -UINT8 a2bus_mcms1_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_mcms1_device::read_cnxx(address_space &space, uint8_t offset) { return m_mcms->get_pen_rand(); } // write 0-255 to Cn00 to set the master volume -void a2bus_mcms1_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_mcms1_device::write_cnxx(address_space &space, uint8_t offset, uint8_t data) { if (offset == 0) { @@ -149,13 +149,13 @@ WRITE_LINE_MEMBER(a2bus_mcms1_device::irq_w) // LIVE DEVICE - Card 2 //************************************************************************** -a2bus_mcms2_device::a2bus_mcms2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_mcms2_device::a2bus_mcms2_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_a2bus_card_interface(mconfig, *this), m_card1(nullptr), m_engine(nullptr) { } -a2bus_mcms2_device::a2bus_mcms2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_mcms2_device::a2bus_mcms2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_MCMS2, "Mountain Computer Music System (card 2)", tag, owner, clock, "a2mcms2", __FILE__), device_a2bus_card_interface(mconfig, *this), m_card1(nullptr), m_engine(nullptr) { @@ -183,14 +183,14 @@ void a2bus_mcms2_device::device_reset() } // here to soak up false reads from indexed accesses -UINT8 a2bus_mcms2_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_mcms2_device::read_c0nx(address_space &space, uint8_t offset) { return 0xff; } // write once to c0n0 to disable the card (reset also disables) // write twice to c0n1 to enable the card (value doesn't matter) -void a2bus_mcms2_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_mcms2_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { if (offset == 0) { @@ -202,7 +202,7 @@ void a2bus_mcms2_device::write_c0nx(address_space &space, UINT8 offset, UINT8 da } } -void a2bus_mcms2_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_mcms2_device::write_cnxx(address_space &space, uint8_t offset, uint8_t data) { m_engine->voiceregs_w(space, offset, data); } @@ -212,7 +212,7 @@ void a2bus_mcms2_device::write_cnxx(address_space &space, UINT8 offset, UINT8 da Sound device implementation */ -mcms_device::mcms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mcms_device::mcms_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MCMS, "Mountain Computer Music System engine", tag, owner, clock, "msmseng", __FILE__), device_sound_interface(mconfig, *this), m_write_irq(*this), m_stream(nullptr), m_timer(nullptr), m_clrtimer(nullptr), m_pBusDevice(nullptr), m_enabled(false), m_mastervol(0), m_rand(0) @@ -272,9 +272,9 @@ void mcms_device::sound_stream_update(sound_stream &stream, stream_sample_t **in { stream_sample_t *outL, *outR; int i, v; - UINT16 wptr; - INT8 sample; - INT32 mixL, mixR; + uint16_t wptr; + int8_t sample; + int32_t mixL, mixR; outL = outputs[1]; outR = outputs[0]; diff --git a/src/devices/bus/a2bus/a2mcms.h b/src/devices/bus/a2bus/a2mcms.h index 5f48b165a12..ff40cd9cf0f 100644 --- a/src/devices/bus/a2bus/a2mcms.h +++ b/src/devices/bus/a2bus/a2mcms.h @@ -26,11 +26,11 @@ class mcms_device : public device_t, public device_sound_interface { public: // construction/destruction - mcms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mcms_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER(voiceregs_w); DECLARE_WRITE8_MEMBER(control_w); - UINT8 get_pen_rand(void) { m_stream->update(); return m_rand; } + uint8_t get_pen_rand(void) { m_stream->update(); return m_rand; } void set_bus_device(a2bus_mcms1_device *pDev) { m_pBusDevice = pDev; } @@ -50,12 +50,12 @@ private: emu_timer *m_timer, *m_clrtimer; a2bus_mcms1_device *m_pBusDevice; bool m_enabled; - UINT8 m_vols[16]; - UINT8 m_table[16]; - UINT16 m_freq[16]; - UINT16 m_acc[16]; - UINT8 m_mastervol; - UINT8 m_rand; + uint8_t m_vols[16]; + uint8_t m_table[16]; + uint16_t m_freq[16]; + uint16_t m_acc[16]; + uint8_t m_mastervol; + uint8_t m_rand; }; // card 1 @@ -65,8 +65,8 @@ class a2bus_mcms1_device: { public: // construction/destruction - a2bus_mcms1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_mcms1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_mcms1_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); + a2bus_mcms1_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; @@ -83,9 +83,9 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) override; virtual bool take_c800() override { return false; } }; @@ -96,17 +96,17 @@ class a2bus_mcms2_device: { public: // construction/destruction - a2bus_mcms2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_mcms2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_mcms2_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); + a2bus_mcms2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) override; virtual bool take_c800() override { return false; } private: diff --git a/src/devices/bus/a2bus/a2memexp.cpp b/src/devices/bus/a2bus/a2memexp.cpp index d7177d645d1..f34b71e435d 100644 --- a/src/devices/bus/a2bus/a2memexp.cpp +++ b/src/devices/bus/a2bus/a2memexp.cpp @@ -73,13 +73,13 @@ const tiny_rom_entry *a2bus_ramfactor_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_memexp_device::a2bus_memexp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_memexp_device::a2bus_memexp_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_a2bus_card_interface(mconfig, *this), m_isramfactor(false), m_bankhior(0), m_addrmask(0), m_rom(nullptr), m_wptr(0), m_liveptr(0) { } -a2bus_memexpapple_device::a2bus_memexpapple_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_memexpapple_device::a2bus_memexpapple_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_memexp_device(mconfig, A2BUS_MEMEXP, "Apple II Memory Expansion Card", tag, owner, clock, "a2memexp", __FILE__) { m_isramfactor = false; @@ -87,7 +87,7 @@ a2bus_memexpapple_device::a2bus_memexpapple_device(const machine_config &mconfig m_addrmask = 0xfffff; } -a2bus_ramfactor_device::a2bus_ramfactor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ramfactor_device::a2bus_ramfactor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_memexp_device(mconfig, A2BUS_RAMFACTOR, "Applied Engineering RamFactor", tag, owner, clock, "a2ramfac", __FILE__) { m_isramfactor = true; @@ -106,7 +106,7 @@ void a2bus_memexp_device::device_start() m_rom = device().machine().root_device().memregion(this->subtag(MEMEXP_ROM_REGION).c_str())->base(); - memset(m_ram, 0xff, 1024*1024*sizeof(UINT8)); + memset(m_ram, 0xff, 1024*1024*sizeof(uint8_t)); save_item(NAME(m_regs)); save_item(NAME(m_ram)); @@ -116,7 +116,7 @@ void a2bus_memexp_device::device_start() void a2bus_memexp_device::device_reset() { - memset(m_regs, 0, sizeof(UINT8) * 0x10); + memset(m_regs, 0, sizeof(uint8_t) * 0x10); m_wptr = m_liveptr = 0; } @@ -125,9 +125,9 @@ void a2bus_memexp_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_memexp_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_memexp_device::read_c0nx(address_space &space, uint8_t offset) { - UINT8 retval = m_regs[offset]; + uint8_t retval = m_regs[offset]; if (offset == 3) { @@ -149,7 +149,7 @@ UINT8 a2bus_memexp_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_memexp_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_memexp_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { // printf("Write %02x to c0n%x (PC=%x)\n", data, offset, space.device().safe_pc()); @@ -201,7 +201,7 @@ void a2bus_memexp_device::write_c0nx(address_space &space, UINT8 offset, UINT8 d read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_memexp_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_memexp_device::read_cnxx(address_space &space, uint8_t offset) { int slotimg = m_slot * 0x100; @@ -218,7 +218,7 @@ UINT8 a2bus_memexp_device::read_cnxx(address_space &space, UINT8 offset) read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_memexp_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_memexp_device::read_c800(address_space &space, uint16_t offset) { // c70a diags confirm: bit 1 of cn0F banks in the second half of the ROM if ((m_isramfactor) && (m_regs[0xf] & 0x01)) diff --git a/src/devices/bus/a2bus/a2memexp.h b/src/devices/bus/a2bus/a2memexp.h index c953e0f7bf8..dc6448323c5 100644 --- a/src/devices/bus/a2bus/a2memexp.h +++ b/src/devices/bus/a2bus/a2memexp.h @@ -24,14 +24,14 @@ class a2bus_memexp_device: { public: // construction/destruction - a2bus_memexp_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_memexp_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; bool m_isramfactor; - UINT8 m_bankhior; + uint8_t m_bankhior; int m_addrmask; protected: @@ -39,28 +39,28 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; private: - UINT8 *m_rom; - UINT8 m_regs[0x10]; - UINT8 m_ram[8*1024*1024]; + uint8_t *m_rom; + uint8_t m_regs[0x10]; + uint8_t m_ram[8*1024*1024]; int m_wptr, m_liveptr; }; class a2bus_memexpapple_device : public a2bus_memexp_device { public: - a2bus_memexpapple_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_memexpapple_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class a2bus_ramfactor_device : public a2bus_memexp_device { public: - a2bus_ramfactor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_ramfactor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/devices/bus/a2bus/a2midi.cpp b/src/devices/bus/a2bus/a2midi.cpp index 79281f85ee2..b7262560fb3 100644 --- a/src/devices/bus/a2bus/a2midi.cpp +++ b/src/devices/bus/a2bus/a2midi.cpp @@ -59,7 +59,7 @@ machine_config_constructor a2bus_midi_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -a2bus_midi_device::a2bus_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_midi_device::a2bus_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_MIDI, "6850 MIDI card", tag, owner, clock, "a2midi", __FILE__), device_a2bus_card_interface(mconfig, *this), m_ptm(*this, MIDI_PTM_TAG), @@ -68,7 +68,7 @@ a2bus_midi_device::a2bus_midi_device(const machine_config &mconfig, const char * { } -a2bus_midi_device::a2bus_midi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_midi_device::a2bus_midi_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_a2bus_card_interface(mconfig, *this), m_ptm(*this, MIDI_PTM_TAG), @@ -96,7 +96,7 @@ void a2bus_midi_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_midi_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_midi_device::read_c0nx(address_space &space, uint8_t offset) { // PTM at C0n0-C0n7, ACIA at C0n8-C0n9, drum sync (?) at C0nA-C0nB @@ -110,7 +110,7 @@ UINT8 a2bus_midi_device::read_c0nx(address_space &space, UINT8 offset) } else if (offset == 9) { - UINT8 ret = m_acia->data_r(space, 0); + uint8_t ret = m_acia->data_r(space, 0); return ret; } @@ -121,7 +121,7 @@ UINT8 a2bus_midi_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_midi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_midi_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { if (offset < 8) { diff --git a/src/devices/bus/a2bus/a2midi.h b/src/devices/bus/a2bus/a2midi.h index 9f3abfe0f7f..3442805ed49 100644 --- a/src/devices/bus/a2bus/a2midi.h +++ b/src/devices/bus/a2bus/a2midi.h @@ -25,8 +25,8 @@ class a2bus_midi_device: { public: // construction/destruction - a2bus_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_midi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_midi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_midi_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -39,8 +39,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; required_device m_ptm; required_device m_acia; diff --git a/src/devices/bus/a2bus/a2mockingboard.cpp b/src/devices/bus/a2bus/a2mockingboard.cpp index 749c14621fa..565f1a472f7 100644 --- a/src/devices/bus/a2bus/a2mockingboard.cpp +++ b/src/devices/bus/a2bus/a2mockingboard.cpp @@ -120,7 +120,7 @@ machine_config_constructor a2bus_echoplus_device::device_mconfig_additions() con // LIVE DEVICE //************************************************************************** -a2bus_ayboard_device::a2bus_ayboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_ayboard_device::a2bus_ayboard_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_a2bus_card_interface(mconfig, *this), m_via1(*this, VIA1_TAG), @@ -132,21 +132,21 @@ a2bus_ayboard_device::a2bus_ayboard_device(const machine_config &mconfig, device { } -a2bus_mockingboard_device::a2bus_mockingboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_mockingboard_device::a2bus_mockingboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_ayboard_device(mconfig, A2BUS_MOCKINGBOARD, "Sweet Micro Systems Mockingboard", tag, owner, clock, "a2mockbd", __FILE__) { m_isPhasor = false; m_PhasorNative = false; } -a2bus_phasor_device::a2bus_phasor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_phasor_device::a2bus_phasor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_ayboard_device(mconfig, A2BUS_PHASOR, "Applied Engineering Phasor", tag, owner, clock, "a2phasor", __FILE__) { m_isPhasor = true; m_PhasorNative = false; } -a2bus_echoplus_device::a2bus_echoplus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_echoplus_device::a2bus_echoplus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_ayboard_device(mconfig, A2BUS_ECHOPLUS, "Street Electronics Echo Plus", tag, owner, clock, "a2echop", __FILE__), m_tms(*this, E2P_TMS_TAG) { @@ -176,12 +176,12 @@ void a2bus_ayboard_device::device_reset() read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_ayboard_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_ayboard_device::read_cnxx(address_space &space, uint8_t offset) { // printf("Mockingboard(%d): read @ Cn%02X (PC=%x)\n", m_slot, offset, space.device().safe_pc()); if (m_isPhasor) { - UINT8 retVal = 0; + uint8_t retVal = 0; int viaSel; if (m_PhasorNative) @@ -227,7 +227,7 @@ UINT8 a2bus_ayboard_device::read_cnxx(address_space &space, UINT8 offset) write_cnxx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_ayboard_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_ayboard_device::write_cnxx(address_space &space, uint8_t offset, uint8_t data) { if (m_isPhasor) { @@ -488,7 +488,7 @@ WRITE8_MEMBER( a2bus_ayboard_device::via2_out_b ) } } -UINT8 a2bus_ayboard_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_ayboard_device::read_c0nx(address_space &space, uint8_t offset) { if (m_isPhasor) { @@ -498,7 +498,7 @@ UINT8 a2bus_ayboard_device::read_c0nx(address_space &space, UINT8 offset) return 0xff; } -void a2bus_ayboard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_ayboard_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { if (m_isPhasor) { @@ -506,7 +506,7 @@ void a2bus_ayboard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 } } -UINT8 a2bus_echoplus_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_echoplus_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -517,7 +517,7 @@ UINT8 a2bus_echoplus_device::read_c0nx(address_space &space, UINT8 offset) return 0; } -void a2bus_echoplus_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_echoplus_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/a2bus/a2mockingboard.h b/src/devices/bus/a2bus/a2mockingboard.h index 4e7025bbe59..58fc7ac2d96 100644 --- a/src/devices/bus/a2bus/a2mockingboard.h +++ b/src/devices/bus/a2bus/a2mockingboard.h @@ -27,7 +27,7 @@ class a2bus_ayboard_device: { public: // construction/destruction - a2bus_ayboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_ayboard_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -44,10 +44,10 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) override; required_device m_via1; required_device m_via2; @@ -59,19 +59,19 @@ protected: bool m_isPhasor, m_PhasorNative; private: - UINT8 m_porta1, m_porta2; + uint8_t m_porta1, m_porta2; }; class a2bus_mockingboard_device : public a2bus_ayboard_device { public: - a2bus_mockingboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_mockingboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class a2bus_phasor_device : public a2bus_ayboard_device { public: - a2bus_phasor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_phasor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; @@ -79,10 +79,10 @@ public: class a2bus_echoplus_device : public a2bus_ayboard_device { public: - a2bus_echoplus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_echoplus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; required_device m_tms; diff --git a/src/devices/bus/a2bus/a2pic.cpp b/src/devices/bus/a2bus/a2pic.cpp index 3592b2d582c..4a765febabc 100644 --- a/src/devices/bus/a2bus/a2pic.cpp +++ b/src/devices/bus/a2bus/a2pic.cpp @@ -98,7 +98,7 @@ const tiny_rom_entry *a2bus_pic_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_pic_device::a2bus_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_pic_device::a2bus_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_PIC, "Apple Parallel Interface Card", tag, owner, clock, "a2pic", __FILE__), device_a2bus_card_interface(mconfig, *this), m_dsw1(*this, "DSW1"), @@ -109,7 +109,7 @@ a2bus_pic_device::a2bus_pic_device(const machine_config &mconfig, const char *ta { } -a2bus_pic_device::a2bus_pic_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_pic_device::a2bus_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), device_a2bus_card_interface(mconfig, *this), m_dsw1(*this, "DSW1"), @@ -163,7 +163,7 @@ void a2bus_pic_device::device_timer(emu_timer &timer, device_timer_id tid, int p read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_pic_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_pic_device::read_cnxx(address_space &space, uint8_t offset) { m_autostrobe = true; @@ -179,9 +179,9 @@ UINT8 a2bus_pic_device::read_cnxx(address_space &space, UINT8 offset) read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_pic_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_pic_device::read_c0nx(address_space &space, uint8_t offset) { - UINT8 rv = 0; + uint8_t rv = 0; switch (offset) { @@ -222,7 +222,7 @@ UINT8 a2bus_pic_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_pic_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_pic_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -255,7 +255,7 @@ WRITE_LINE_MEMBER( a2bus_pic_device::ack_w ) { if (m_started) { - UINT8 dsw1 = m_dsw1->read(); + uint8_t dsw1 = m_dsw1->read(); if (dsw1 & 0x10) // negative polarity { diff --git a/src/devices/bus/a2bus/a2pic.h b/src/devices/bus/a2bus/a2pic.h index 9e5df928f9b..83ff5bd2fa4 100644 --- a/src/devices/bus/a2bus/a2pic.h +++ b/src/devices/bus/a2bus/a2pic.h @@ -24,8 +24,8 @@ class a2bus_pic_device: { public: // construction/destruction - a2bus_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_pic_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_pic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -41,9 +41,9 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; required_device m_ctx; required_device m_ctx_data_in; @@ -53,9 +53,9 @@ protected: void clear_strobe(); private: - UINT8 *m_rom; + uint8_t *m_rom; bool m_started; - UINT8 m_ack; + uint8_t m_ack; bool m_irqenable; bool m_autostrobe; emu_timer *m_timer; diff --git a/src/devices/bus/a2bus/a2sam.cpp b/src/devices/bus/a2bus/a2sam.cpp index 4d106f99d98..e8b6f811754 100644 --- a/src/devices/bus/a2bus/a2sam.cpp +++ b/src/devices/bus/a2bus/a2sam.cpp @@ -47,7 +47,7 @@ machine_config_constructor a2bus_sam_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -a2bus_sam_device::a2bus_sam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_sam_device::a2bus_sam_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_SAM, "Don't Ask Software SAM", tag, owner, clock, "a2sam", __FILE__), device_a2bus_card_interface(mconfig, *this), m_dac(*this, "dac") @@ -68,7 +68,7 @@ void a2bus_sam_device::device_reset() { } -void a2bus_sam_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_sam_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { m_dac->write(data); } diff --git a/src/devices/bus/a2bus/a2sam.h b/src/devices/bus/a2bus/a2sam.h index cbf328454bd..2f0d898fb34 100644 --- a/src/devices/bus/a2bus/a2sam.h +++ b/src/devices/bus/a2bus/a2sam.h @@ -25,7 +25,7 @@ class a2bus_sam_device: { public: // construction/destruction - a2bus_sam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_sam_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; @@ -37,7 +37,7 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; virtual bool take_c800() override; }; diff --git a/src/devices/bus/a2bus/a2scsi.cpp b/src/devices/bus/a2bus/a2scsi.cpp index 7b154901ec5..f1da850482d 100644 --- a/src/devices/bus/a2bus/a2scsi.cpp +++ b/src/devices/bus/a2bus/a2scsi.cpp @@ -106,7 +106,7 @@ const tiny_rom_entry *a2bus_scsi_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_scsi_device::a2bus_scsi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_scsi_device::a2bus_scsi_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_a2bus_card_interface(mconfig, *this), m_ncr5380(*this, SCSI_5380_TAG), @@ -114,7 +114,7 @@ a2bus_scsi_device::a2bus_scsi_device(const machine_config &mconfig, device_type { } -a2bus_scsi_device::a2bus_scsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_scsi_device::a2bus_scsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_SCSI, "Apple II SCSI Card", tag, owner, clock, "a2scsi", __FILE__), device_a2bus_card_interface(mconfig, *this), m_ncr5380(*this, SCSI_5380_TAG), @@ -154,7 +154,7 @@ void a2bus_scsi_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_scsi_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_scsi_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -194,7 +194,7 @@ UINT8 a2bus_scsi_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_scsi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_scsi_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -262,13 +262,13 @@ void a2bus_scsi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 dat read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_scsi_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_scsi_device::read_cnxx(address_space &space, uint8_t offset) { // one slot image at the start of the ROM, it appears return m_rom[offset]; } -void a2bus_scsi_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_scsi_device::write_cnxx(address_space &space, uint8_t offset, uint8_t data) { // there are writes to cn0A, possibly misguided C0nA (bank select?) writes? // printf("Write %02x to cn%02x (PC=%x)\n", data, offset, space.device().safe_pc()); @@ -278,7 +278,7 @@ void a2bus_scsi_device::write_cnxx(address_space &space, UINT8 offset, UINT8 dat read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_scsi_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_scsi_device::read_c800(address_space &space, uint16_t offset) { // bankswitched RAM at c800-cbff // bankswitched ROM at cc00-cfff @@ -301,7 +301,7 @@ UINT8 a2bus_scsi_device::read_c800(address_space &space, UINT16 offset) /*------------------------------------------------- write_c800 - called for writes to this card's c800 space -------------------------------------------------*/ -void a2bus_scsi_device::write_c800(address_space &space, UINT16 offset, UINT8 data) +void a2bus_scsi_device::write_c800(address_space &space, uint16_t offset, uint8_t data) { if (offset < 0x400) { diff --git a/src/devices/bus/a2bus/a2scsi.h b/src/devices/bus/a2bus/a2scsi.h index 09b4ad18fe2..c506dfd94fa 100644 --- a/src/devices/bus/a2bus/a2scsi.h +++ b/src/devices/bus/a2bus/a2scsi.h @@ -25,8 +25,8 @@ class a2bus_scsi_device: { public: // construction/destruction - a2bus_scsi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_scsi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_scsi_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); + a2bus_scsi_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; @@ -42,19 +42,19 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; - virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; + virtual void write_c800(address_space &space, uint16_t offset, uint8_t data) override; private: - UINT8 *m_rom; - UINT8 m_ram[8192]; // 8 banks of 1024 bytes + uint8_t *m_rom; + uint8_t m_ram[8192]; // 8 banks of 1024 bytes int m_rambank, m_rombank; - UINT8 m_drq; - UINT8 m_bank; + uint8_t m_drq; + uint8_t m_bank; bool m_816block; }; diff --git a/src/devices/bus/a2bus/a2softcard.cpp b/src/devices/bus/a2bus/a2softcard.cpp index e7477c468c6..df509e7e079 100644 --- a/src/devices/bus/a2bus/a2softcard.cpp +++ b/src/devices/bus/a2bus/a2softcard.cpp @@ -51,14 +51,14 @@ machine_config_constructor a2bus_softcard_device::device_mconfig_additions() con // LIVE DEVICE //************************************************************************** -a2bus_softcard_device::a2bus_softcard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_softcard_device::a2bus_softcard_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_a2bus_card_interface(mconfig, *this), m_z80(*this, Z80_TAG), m_bEnabled(false), m_FirstZ80Boot(false) { } -a2bus_softcard_device::a2bus_softcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_softcard_device::a2bus_softcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_SOFTCARD, "Microsoft SoftCard", tag, owner, clock, "a2softcard", __FILE__), device_a2bus_card_interface(mconfig, *this), m_z80(*this, Z80_TAG), m_bEnabled(false), m_FirstZ80Boot(false) @@ -86,7 +86,7 @@ void a2bus_softcard_device::device_reset() m_z80->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); } -void a2bus_softcard_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_softcard_device::write_cnxx(address_space &space, uint8_t offset, uint8_t data) { if (!m_bEnabled) { diff --git a/src/devices/bus/a2bus/a2softcard.h b/src/devices/bus/a2bus/a2softcard.h index 906d8e14c12..7df711601a4 100644 --- a/src/devices/bus/a2bus/a2softcard.h +++ b/src/devices/bus/a2bus/a2softcard.h @@ -24,8 +24,8 @@ class a2bus_softcard_device: { public: // construction/destruction - a2bus_softcard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_softcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_softcard_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); + a2bus_softcard_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; @@ -38,7 +38,7 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) override; virtual bool take_c800() override; required_device m_z80; diff --git a/src/devices/bus/a2bus/a2ssc.cpp b/src/devices/bus/a2bus/a2ssc.cpp index b7189b77992..59001032362 100644 --- a/src/devices/bus/a2bus/a2ssc.cpp +++ b/src/devices/bus/a2bus/a2ssc.cpp @@ -127,7 +127,7 @@ const tiny_rom_entry *a2bus_ssc_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_ssc_device::a2bus_ssc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ssc_device::a2bus_ssc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_SSC, "Apple Super Serial Card", tag, owner, clock, "a2ssc", __FILE__), device_a2bus_card_interface(mconfig, *this), m_dsw1(*this, "DSW1"), @@ -137,7 +137,7 @@ a2bus_ssc_device::a2bus_ssc_device(const machine_config &mconfig, const char *ta { } -a2bus_ssc_device::a2bus_ssc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_ssc_device::a2bus_ssc_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_a2bus_card_interface(mconfig, *this), m_dsw1(*this, "DSW1"), @@ -168,7 +168,7 @@ void a2bus_ssc_device::device_reset() read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_ssc_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_ssc_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[(offset&0xff)+0x700]; } @@ -177,7 +177,7 @@ UINT8 a2bus_ssc_device::read_cnxx(address_space &space, UINT8 offset) read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_ssc_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_ssc_device::read_c800(address_space &space, uint16_t offset) { return m_rom[offset]; } @@ -186,7 +186,7 @@ UINT8 a2bus_ssc_device::read_c800(address_space &space, UINT16 offset) read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_ssc_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_ssc_device::read_c0nx(address_space &space, uint8_t offset) { // dips at C0n1/C0n2, ACIA at C0n8/9/A/B @@ -212,7 +212,7 @@ UINT8 a2bus_ssc_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_ssc_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_ssc_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/a2bus/a2ssc.h b/src/devices/bus/a2bus/a2ssc.h index bdcaca2e900..b130012c52f 100644 --- a/src/devices/bus/a2bus/a2ssc.h +++ b/src/devices/bus/a2bus/a2ssc.h @@ -24,8 +24,8 @@ class a2bus_ssc_device: { public: // construction/destruction - a2bus_ssc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_ssc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_ssc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_ssc_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -40,15 +40,15 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; required_device m_acia; private: - UINT8 *m_rom; + uint8_t *m_rom; bool m_started; }; diff --git a/src/devices/bus/a2bus/a2swyft.cpp b/src/devices/bus/a2bus/a2swyft.cpp index b5f0d65c60d..975974b849b 100644 --- a/src/devices/bus/a2bus/a2swyft.cpp +++ b/src/devices/bus/a2bus/a2swyft.cpp @@ -45,13 +45,13 @@ const tiny_rom_entry *a2bus_swyft_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_swyft_device::a2bus_swyft_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_swyft_device::a2bus_swyft_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_SWYFT, "IAI SwyftCard", tag, owner, clock, "a2swyft", __FILE__), device_a2bus_card_interface(mconfig, *this), m_rom(nullptr), m_rombank(0), m_inh_state(0) { } -a2bus_swyft_device::a2bus_swyft_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_swyft_device::a2bus_swyft_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_a2bus_card_interface(mconfig, *this), m_rom(nullptr), m_rombank(0), m_inh_state(0) { @@ -79,7 +79,7 @@ void a2bus_swyft_device::device_reset() recalc_slot_inh(); } -UINT8 a2bus_swyft_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_swyft_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -105,7 +105,7 @@ UINT8 a2bus_swyft_device::read_c0nx(address_space &space, UINT8 offset) return 0xff; } -void a2bus_swyft_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_swyft_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -129,7 +129,7 @@ void a2bus_swyft_device::write_c0nx(address_space &space, UINT8 offset, UINT8 da } } -UINT8 a2bus_swyft_device::read_inh_rom(address_space &space, UINT16 offset) +uint8_t a2bus_swyft_device::read_inh_rom(address_space &space, uint16_t offset) { offset -= 0xd000; diff --git a/src/devices/bus/a2bus/a2swyft.h b/src/devices/bus/a2bus/a2swyft.h index a490d266ac9..7e297ffff8e 100644 --- a/src/devices/bus/a2bus/a2swyft.h +++ b/src/devices/bus/a2bus/a2swyft.h @@ -24,8 +24,8 @@ class a2bus_swyft_device: { public: // construction/destruction - a2bus_swyft_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_swyft_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_swyft_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_swyft_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 const tiny_rom_entry *device_rom_region() const override; @@ -33,15 +33,15 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_inh_rom(address_space &space, UINT16 offset) override; - virtual UINT16 inh_start() override { return 0xd000; } - virtual UINT16 inh_end() override { return 0xffff; } + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_inh_rom(address_space &space, uint16_t offset) override; + virtual uint16_t inh_start() override { return 0xd000; } + virtual uint16_t inh_end() override { return 0xffff; } virtual int inh_type() override; private: - UINT8 *m_rom; + uint8_t *m_rom; int m_rombank; int m_inh_state; }; diff --git a/src/devices/bus/a2bus/a2themill.cpp b/src/devices/bus/a2bus/a2themill.cpp index e8cc3d338c9..71aed47ace9 100644 --- a/src/devices/bus/a2bus/a2themill.cpp +++ b/src/devices/bus/a2bus/a2themill.cpp @@ -67,14 +67,14 @@ machine_config_constructor a2bus_themill_device::device_mconfig_additions() cons // LIVE DEVICE //************************************************************************** -a2bus_themill_device::a2bus_themill_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_themill_device::a2bus_themill_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_a2bus_card_interface(mconfig, *this), m_6809(*this, M6809_TAG), m_bEnabled(false), m_flipAddrSpace(false), m_6809Mode(false), m_status(0) { } -a2bus_themill_device::a2bus_themill_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_themill_device::a2bus_themill_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_THEMILL, "Stellation Two The Mill", tag, owner, clock, "a2themill", __FILE__), device_a2bus_card_interface(mconfig, *this), m_6809(*this, M6809_TAG), m_bEnabled(false), m_flipAddrSpace(false), m_6809Mode(false), m_status(0) @@ -106,12 +106,12 @@ void a2bus_themill_device::device_reset() m_6809->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } -UINT8 a2bus_themill_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_themill_device::read_c0nx(address_space &space, uint8_t offset) { return m_status; } -void a2bus_themill_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_themill_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/a2bus/a2themill.h b/src/devices/bus/a2bus/a2themill.h index 763aec5f9df..b37cbbbb25c 100644 --- a/src/devices/bus/a2bus/a2themill.h +++ b/src/devices/bus/a2bus/a2themill.h @@ -24,8 +24,8 @@ class a2bus_themill_device: { public: // construction/destruction - a2bus_themill_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_themill_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_themill_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); + a2bus_themill_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; @@ -38,8 +38,8 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; virtual bool take_c800() override; required_device m_6809; @@ -48,7 +48,7 @@ private: bool m_bEnabled; bool m_flipAddrSpace; bool m_6809Mode; - UINT8 m_status; + uint8_t m_status; }; // device type definition diff --git a/src/devices/bus/a2bus/a2thunderclock.cpp b/src/devices/bus/a2bus/a2thunderclock.cpp index e789b364a51..a2fd9739748 100644 --- a/src/devices/bus/a2bus/a2thunderclock.cpp +++ b/src/devices/bus/a2bus/a2thunderclock.cpp @@ -76,14 +76,14 @@ const tiny_rom_entry *a2bus_thunderclock_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_thunderclock_device::a2bus_thunderclock_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_thunderclock_device::a2bus_thunderclock_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_a2bus_card_interface(mconfig, *this), m_upd1990ac(*this, THUNDERCLOCK_UPD1990_TAG), m_rom(nullptr), m_dataout(0) { } -a2bus_thunderclock_device::a2bus_thunderclock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_thunderclock_device::a2bus_thunderclock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_THUNDERCLOCK, "ThunderWare ThunderClock Plus", tag, owner, clock, "a2thunpl", __FILE__), device_a2bus_card_interface(mconfig, *this), m_upd1990ac(*this, THUNDERCLOCK_UPD1990_TAG), m_rom(nullptr), m_dataout(0) @@ -114,7 +114,7 @@ void a2bus_thunderclock_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_thunderclock_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_thunderclock_device::read_c0nx(address_space &space, uint8_t offset) { return (m_dataout << 7); } @@ -124,7 +124,7 @@ UINT8 a2bus_thunderclock_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_thunderclock_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_thunderclock_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { // uPD1990AC hookup: // bit 0 = DATA IN? @@ -151,7 +151,7 @@ void a2bus_thunderclock_device::write_c0nx(address_space &space, UINT8 offset, U read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_thunderclock_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_thunderclock_device::read_cnxx(address_space &space, uint8_t offset) { // ROM is primarily a c800 image, but the first page is also the CnXX ROM return m_rom[offset]; @@ -161,7 +161,7 @@ UINT8 a2bus_thunderclock_device::read_cnxx(address_space &space, UINT8 offset) read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_thunderclock_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_thunderclock_device::read_c800(address_space &space, uint16_t offset) { return m_rom[offset]; } diff --git a/src/devices/bus/a2bus/a2thunderclock.h b/src/devices/bus/a2bus/a2thunderclock.h index 324b6a30ea0..2f06608534f 100644 --- a/src/devices/bus/a2bus/a2thunderclock.h +++ b/src/devices/bus/a2bus/a2thunderclock.h @@ -25,8 +25,8 @@ class a2bus_thunderclock_device: { public: // construction/destruction - a2bus_thunderclock_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_thunderclock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_thunderclock_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); + a2bus_thunderclock_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; @@ -39,15 +39,15 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; required_device m_upd1990ac; private: - UINT8 *m_rom; + uint8_t *m_rom; int m_dataout; }; diff --git a/src/devices/bus/a2bus/a2ultraterm.cpp b/src/devices/bus/a2bus/a2ultraterm.cpp index 3898e4be0c3..5526515ab1d 100644 --- a/src/devices/bus/a2bus/a2ultraterm.cpp +++ b/src/devices/bus/a2bus/a2ultraterm.cpp @@ -138,19 +138,19 @@ const tiny_rom_entry *a2bus_ultratermenh_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_videx160_device::a2bus_videx160_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_videx160_device::a2bus_videx160_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_a2bus_card_interface(mconfig, *this), m_rom(nullptr), m_chrrom(nullptr), m_framecnt(0), m_ctrl1(0), m_ctrl2(0), m_crtc(*this, ULTRATERM_MC6845_NAME), m_rambank(0) { } -a2bus_ultraterm_device::a2bus_ultraterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ultraterm_device::a2bus_ultraterm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_videx160_device(mconfig, A2BUS_ULTRATERM, "Videx UltraTerm (original)", tag, owner, clock, "a2ulttrm", __FILE__) { } -a2bus_ultratermenh_device::a2bus_ultratermenh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ultratermenh_device::a2bus_ultratermenh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_videx160_device(mconfig, A2BUS_ULTRATERMENH, "Videx UltraTerm (enhanced //e)", tag, owner, clock, "a2ultrme", __FILE__) { } @@ -188,7 +188,7 @@ void a2bus_videx160_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_videx160_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_videx160_device::read_c0nx(address_space &space, uint8_t offset) { // printf("Read c0n%x (PC=%x)\n", offset, space.device().safe_pc()); @@ -217,7 +217,7 @@ UINT8 a2bus_videx160_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_videx160_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_videx160_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { // printf("Write %02x to c0n%x (PC=%x)\n", data, offset, space.device().safe_pc()); @@ -258,7 +258,7 @@ void a2bus_videx160_device::write_c0nx(address_space &space, UINT8 offset, UINT8 read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_videx160_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_videx160_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset+(m_slot * 0x100)]; } @@ -267,7 +267,7 @@ UINT8 a2bus_videx160_device::read_cnxx(address_space &space, UINT8 offset) write_cnxx - called for writes to this card's cnxx space the firmware writes here to switch in our $C800 a lot -------------------------------------------------*/ -void a2bus_videx160_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_videx160_device::write_cnxx(address_space &space, uint8_t offset, uint8_t data) { } @@ -275,7 +275,7 @@ void a2bus_videx160_device::write_cnxx(address_space &space, UINT8 offset, UINT8 read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_videx160_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_videx160_device::read_c800(address_space &space, uint16_t offset) { // ROM at c800-cbff // bankswitched RAM at cc00-cdff @@ -298,7 +298,7 @@ UINT8 a2bus_videx160_device::read_c800(address_space &space, UINT16 offset) /*------------------------------------------------- write_c800 - called for writes to this card's c800 space -------------------------------------------------*/ -void a2bus_videx160_device::write_c800(address_space &space, UINT16 offset, UINT8 data) +void a2bus_videx160_device::write_c800(address_space &space, uint16_t offset, uint8_t data) { if (offset >= 0x400) { @@ -309,18 +309,18 @@ void a2bus_videx160_device::write_c800(address_space &space, UINT16 offset, UINT MC6845_UPDATE_ROW( a2bus_videx160_device::crtc_update_row ) { - UINT32 *p = &bitmap.pix32(y); - UINT16 chr_base = ra; + uint32_t *p = &bitmap.pix32(y); + uint16_t chr_base = ra; int i; for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ma + i ); - UINT8 chr = m_ram[ offset ]; - UINT8 data = m_chrrom[ chr_base + (chr * 16) ]; - UINT8 fg = 2; - UINT8 bg = 0; - UINT8 tmp; + uint16_t offset = ( ma + i ); + uint8_t chr = m_ram[ offset ]; + uint8_t data = m_chrrom[ chr_base + (chr * 16) ]; + uint8_t fg = 2; + uint8_t bg = 0; + uint8_t tmp; // apply attributes if (!(m_ctrl2 & CT2_USEDIPS)) diff --git a/src/devices/bus/a2bus/a2ultraterm.h b/src/devices/bus/a2bus/a2ultraterm.h index 3eadec62422..1f473526071 100644 --- a/src/devices/bus/a2bus/a2ultraterm.h +++ b/src/devices/bus/a2bus/a2ultraterm.h @@ -25,7 +25,7 @@ class a2bus_videx160_device: { public: // construction/destruction - a2bus_videx160_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_videx160_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -33,22 +33,22 @@ public: DECLARE_WRITE_LINE_MEMBER(vsync_changed); MC6845_UPDATE_ROW(crtc_update_row); - UINT8 *m_rom, *m_chrrom; - UINT8 m_ram[256*16]; + uint8_t *m_rom, *m_chrrom; + uint8_t m_ram[256*16]; int m_framecnt; - UINT8 m_ctrl1, m_ctrl2; + uint8_t m_ctrl1, m_ctrl2; protected: virtual void device_start() override; virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; - virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; + virtual void write_c800(address_space &space, uint16_t offset, uint8_t data) override; required_device m_crtc; @@ -59,7 +59,7 @@ private: class a2bus_ultraterm_device : public a2bus_videx160_device { public: - a2bus_ultraterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_ultraterm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -67,7 +67,7 @@ public: class a2bus_ultratermenh_device : public a2bus_videx160_device { public: - a2bus_ultratermenh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_ultratermenh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/devices/bus/a2bus/a2videoterm.cpp b/src/devices/bus/a2bus/a2videoterm.cpp index f6d00066321..53eb6d5d20a 100644 --- a/src/devices/bus/a2bus/a2videoterm.cpp +++ b/src/devices/bus/a2bus/a2videoterm.cpp @@ -172,7 +172,7 @@ const tiny_rom_entry *a2bus_aevm80_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_videx80_device::a2bus_videx80_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_videx80_device::a2bus_videx80_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_a2bus_card_interface(mconfig, *this), m_rom(nullptr), m_chrrom(nullptr), m_framecnt(0), m_crtc(*this, VIDEOTERM_MC6845_NAME), m_rambank(0), @@ -180,32 +180,32 @@ a2bus_videx80_device::a2bus_videx80_device(const machine_config &mconfig, device { } -a2bus_videoterm_device::a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_videoterm_device::a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_videx80_device(mconfig, A2BUS_VIDEOTERM, "Videx VideoTerm", tag, owner, clock, "a2vidtrm", __FILE__) { } -a2bus_ap16_device::a2bus_ap16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ap16_device::a2bus_ap16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_videx80_device(mconfig, A2BUS_IBSAP16, "IBS AP-16 80 column card", tag, owner, clock, "a2ap16", __FILE__) { } -a2bus_ap16alt_device::a2bus_ap16alt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ap16alt_device::a2bus_ap16alt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_videx80_device(mconfig, A2BUS_IBSAP16ALT, "IBS AP-16 80 column card (alt. version)", tag, owner, clock, "a2ap16a", __FILE__) { } -a2bus_vtc1_device::a2bus_vtc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_vtc1_device::a2bus_vtc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_videx80_device(mconfig, A2BUS_VTC1, "Unknown VideoTerm clone #1", tag, owner, clock, "a2vtc1", __FILE__) { } -a2bus_vtc2_device::a2bus_vtc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_vtc2_device::a2bus_vtc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_videx80_device(mconfig, A2BUS_VTC2, "Unknown VideoTerm clone #2", tag, owner, clock, "a2vtc2", __FILE__) { } -a2bus_aevm80_device::a2bus_aevm80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_aevm80_device::a2bus_aevm80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_videx80_device(mconfig, A2BUS_AEVIEWMASTER80, "Applied Engineering Viewmaster 80", tag, owner, clock, "a2aevm80", __FILE__) { } @@ -241,7 +241,7 @@ void a2bus_videx80_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_videx80_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_videx80_device::read_c0nx(address_space &space, uint8_t offset) { // printf("Read c0n%x (PC=%x)\n", offset, space.device().safe_pc()); @@ -260,7 +260,7 @@ UINT8 a2bus_videx80_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_videx80_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_videx80_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { // printf("Write %02x to c0n%x (PC=%x)\n", data, offset, space.device().safe_pc()); @@ -280,17 +280,17 @@ void a2bus_videx80_device::write_c0nx(address_space &space, UINT8 offset, UINT8 read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_videx80_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_videx80_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset+0x300]; } -UINT8 a2bus_ap16_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_ap16_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset+0x1f00]; } -UINT8 a2bus_ap16alt_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_ap16alt_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset+0xb00]; } @@ -299,7 +299,7 @@ UINT8 a2bus_ap16alt_device::read_cnxx(address_space &space, UINT8 offset) write_cnxx - called for writes to this card's cnxx space the firmware writes here to switch in our $C800 a lot -------------------------------------------------*/ -void a2bus_videx80_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_videx80_device::write_cnxx(address_space &space, uint8_t offset, uint8_t data) { } @@ -307,7 +307,7 @@ void a2bus_videx80_device::write_cnxx(address_space &space, UINT8 offset, UINT8 read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_videx80_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_videx80_device::read_c800(address_space &space, uint16_t offset) { // ROM at c800-cbff // bankswitched RAM at cc00-cdff @@ -325,7 +325,7 @@ UINT8 a2bus_videx80_device::read_c800(address_space &space, UINT16 offset) /*------------------------------------------------- write_c800 - called for writes to this card's c800 space -------------------------------------------------*/ -void a2bus_videx80_device::write_c800(address_space &space, UINT16 offset, UINT8 data) +void a2bus_videx80_device::write_c800(address_space &space, uint16_t offset, uint8_t data) { if (offset >= 0x400) { @@ -337,17 +337,17 @@ void a2bus_videx80_device::write_c800(address_space &space, UINT16 offset, UINT8 MC6845_UPDATE_ROW( a2bus_videx80_device::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); - UINT16 chr_base = ra; //( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; + uint32_t *p = &bitmap.pix32(y); + uint16_t chr_base = ra; //( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; int i; for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ma + i ) & 0x7ff; - UINT8 chr = m_ram[ offset ]; - UINT8 data = m_chrrom[ chr_base + chr * 16 ]; - UINT8 fg = 15; - UINT8 bg = 0; + uint16_t offset = ( ma + i ) & 0x7ff; + uint8_t chr = m_ram[ offset ]; + uint8_t data = m_chrrom[ chr_base + chr * 16 ]; + uint8_t fg = 15; + uint8_t bg = 0; if ( i == cursor_x ) { diff --git a/src/devices/bus/a2bus/a2videoterm.h b/src/devices/bus/a2bus/a2videoterm.h index 23b29ca86d4..751939cee9b 100644 --- a/src/devices/bus/a2bus/a2videoterm.h +++ b/src/devices/bus/a2bus/a2videoterm.h @@ -25,7 +25,7 @@ class a2bus_videx80_device: { public: // construction/destruction - a2bus_videx80_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_videx80_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -33,8 +33,8 @@ public: DECLARE_WRITE_LINE_MEMBER(vsync_changed); MC6845_UPDATE_ROW(crtc_update_row); - UINT8 *m_rom, *m_chrrom; - UINT8 m_ram[512*4]; + uint8_t *m_rom, *m_chrrom; + uint8_t m_ram[512*4]; int m_framecnt; protected: @@ -42,12 +42,12 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; - virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; + virtual void write_c800(address_space &space, uint16_t offset, uint8_t data) override; required_device m_crtc; @@ -60,7 +60,7 @@ public: class a2bus_videoterm_device : public a2bus_videx80_device { public: - a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -68,28 +68,28 @@ public: class a2bus_ap16_device : public a2bus_videx80_device { public: - a2bus_ap16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_ap16_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 UINT8 read_cnxx(address_space &space, UINT8 offset) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; }; class a2bus_ap16alt_device : public a2bus_videx80_device { public: - a2bus_ap16alt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_ap16alt_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 UINT8 read_cnxx(address_space &space, UINT8 offset) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; }; class a2bus_vtc1_device : public a2bus_videx80_device { public: - a2bus_vtc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_vtc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -97,7 +97,7 @@ public: class a2bus_vtc2_device : public a2bus_videx80_device { public: - a2bus_vtc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_vtc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -105,7 +105,7 @@ public: class a2bus_aevm80_device : public a2bus_videx80_device { public: - a2bus_aevm80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_aevm80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/devices/bus/a2bus/a2vulcan.cpp b/src/devices/bus/a2bus/a2vulcan.cpp index c17631287c6..216ccc7d043 100644 --- a/src/devices/bus/a2bus/a2vulcan.cpp +++ b/src/devices/bus/a2bus/a2vulcan.cpp @@ -114,19 +114,19 @@ const tiny_rom_entry *a2bus_vulcangold_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_vulcanbase_device::a2bus_vulcanbase_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_vulcanbase_device::a2bus_vulcanbase_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_a2bus_card_interface(mconfig, *this), m_ata(*this, VULCAN_ATA_TAG), m_rom(nullptr), m_lastdata(0), m_rombank(0), m_rambank(0), m_last_read_was_0(false) { } -a2bus_vulcan_device::a2bus_vulcan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_vulcan_device::a2bus_vulcan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_vulcanbase_device(mconfig, A2BUS_VULCAN, "Applied Engineering Vulcan IDE controller", tag, owner, clock, "a2vulcan", __FILE__) { } -a2bus_vulcangold_device::a2bus_vulcangold_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_vulcangold_device::a2bus_vulcangold_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_vulcanbase_device(mconfig, A2BUS_VULCAN, "Applied Engineering Vulcan Gold IDE controller", tag, owner, clock, "a2vulgld", __FILE__) { } @@ -169,7 +169,7 @@ void a2bus_vulcanbase_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_vulcanbase_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_vulcanbase_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -212,7 +212,7 @@ UINT8 a2bus_vulcanbase_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_vulcanbase_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_vulcanbase_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -266,7 +266,7 @@ void a2bus_vulcanbase_device::write_c0nx(address_space &space, UINT8 offset, UIN read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_vulcanbase_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_vulcanbase_device::read_cnxx(address_space &space, uint8_t offset) { int slotimg = m_slot * 0x100; @@ -278,7 +278,7 @@ UINT8 a2bus_vulcanbase_device::read_cnxx(address_space &space, UINT8 offset) read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_vulcanbase_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_vulcanbase_device::read_c800(address_space &space, uint16_t offset) { offset &= 0x7ff; if (offset < 0x400) // c800-cbff is banked RAM window, cc00-cfff is banked ROM window @@ -291,7 +291,7 @@ UINT8 a2bus_vulcanbase_device::read_c800(address_space &space, UINT16 offset) return m_rom[offset+m_rombank]; } -void a2bus_vulcanbase_device::write_c800(address_space &space, UINT16 offset, UINT8 data) +void a2bus_vulcanbase_device::write_c800(address_space &space, uint16_t offset, uint8_t data) { offset &= 0x7ff; if (offset < 0x400) diff --git a/src/devices/bus/a2bus/a2vulcan.h b/src/devices/bus/a2bus/a2vulcan.h index 03facf5dcbf..1b0e0149833 100644 --- a/src/devices/bus/a2bus/a2vulcan.h +++ b/src/devices/bus/a2bus/a2vulcan.h @@ -25,7 +25,7 @@ class a2bus_vulcanbase_device: { public: // construction/destruction - a2bus_vulcanbase_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_vulcanbase_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -35,19 +35,19 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; - virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; + virtual void write_c800(address_space &space, uint16_t offset, uint8_t data) override; required_device m_ata; - UINT8 *m_rom; - UINT8 m_ram[8*1024]; + uint8_t *m_rom; + uint8_t m_ram[8*1024]; private: - UINT16 m_lastdata; + uint16_t m_lastdata; int m_rombank, m_rambank; bool m_last_read_was_0; }; @@ -55,7 +55,7 @@ private: class a2bus_vulcan_device : public a2bus_vulcanbase_device { public: - a2bus_vulcan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_vulcan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; protected: @@ -67,7 +67,7 @@ protected: class a2bus_vulcangold_device : public a2bus_vulcanbase_device { public: - a2bus_vulcangold_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_vulcangold_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/devices/bus/a2bus/a2zipdrive.cpp b/src/devices/bus/a2bus/a2zipdrive.cpp index f7a78aa4223..369aec79a4d 100644 --- a/src/devices/bus/a2bus/a2zipdrive.cpp +++ b/src/devices/bus/a2bus/a2zipdrive.cpp @@ -69,14 +69,14 @@ const tiny_rom_entry *a2bus_zipdrivebase_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_zipdrivebase_device::a2bus_zipdrivebase_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_zipdrivebase_device::a2bus_zipdrivebase_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_a2bus_card_interface(mconfig, *this), m_ata(*this, ZIPDRIVE_ATA_TAG), m_rom(nullptr), m_lastdata(0) { } -a2bus_zipdrive_device::a2bus_zipdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_zipdrive_device::a2bus_zipdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a2bus_zipdrivebase_device(mconfig, A2BUS_ZIPDRIVE, "Zip Technologies ZipDrive", tag, owner, clock, "a2zipdrv", __FILE__) { } @@ -105,7 +105,7 @@ void a2bus_zipdrivebase_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_zipdrivebase_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_zipdrivebase_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -140,7 +140,7 @@ UINT8 a2bus_zipdrivebase_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_zipdrivebase_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_zipdrivebase_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -178,7 +178,7 @@ void a2bus_zipdrivebase_device::write_c0nx(address_space &space, UINT8 offset, U read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_zipdrivebase_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_zipdrivebase_device::read_cnxx(address_space &space, uint8_t offset) { int slotimg = m_slot * 0x100; @@ -190,7 +190,7 @@ UINT8 a2bus_zipdrivebase_device::read_cnxx(address_space &space, UINT8 offset) read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_zipdrivebase_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_zipdrivebase_device::read_c800(address_space &space, uint16_t offset) { offset &= 0x7ff; diff --git a/src/devices/bus/a2bus/a2zipdrive.h b/src/devices/bus/a2bus/a2zipdrive.h index cdc4a15bca6..39f5f8bae19 100644 --- a/src/devices/bus/a2bus/a2zipdrive.h +++ b/src/devices/bus/a2bus/a2zipdrive.h @@ -27,7 +27,7 @@ class a2bus_zipdrivebase_device: { public: // construction/destruction - a2bus_zipdrivebase_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_zipdrivebase_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -38,23 +38,23 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; required_device m_ata; - UINT8 *m_rom; + uint8_t *m_rom; private: - UINT16 m_lastdata; + uint16_t m_lastdata; }; class a2bus_zipdrive_device : public a2bus_zipdrivebase_device { public: - a2bus_zipdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_zipdrive_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // device type definition diff --git a/src/devices/bus/a2bus/corvfdc01.cpp b/src/devices/bus/a2bus/corvfdc01.cpp index 335315e0022..f9f2f05f945 100644 --- a/src/devices/bus/a2bus/corvfdc01.cpp +++ b/src/devices/bus/a2bus/corvfdc01.cpp @@ -110,7 +110,7 @@ const tiny_rom_entry *a2bus_corvfdc01_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_corvfdc01_device::a2bus_corvfdc01_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_corvfdc01_device::a2bus_corvfdc01_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_a2bus_card_interface(mconfig, *this), m_wdfdc(*this, FDC01_FDC_TAG), @@ -121,7 +121,7 @@ a2bus_corvfdc01_device::a2bus_corvfdc01_device(const machine_config &mconfig, de { } -a2bus_corvfdc01_device::a2bus_corvfdc01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_corvfdc01_device::a2bus_corvfdc01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_CORVFDC01, "Corvus Systems Floppy Controller", tag, owner, clock, "crvfdc01", __FILE__), device_a2bus_card_interface(mconfig, *this), m_wdfdc(*this, FDC01_FDC_TAG), @@ -158,7 +158,7 @@ void a2bus_corvfdc01_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_corvfdc01_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_corvfdc01_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -191,7 +191,7 @@ UINT8 a2bus_corvfdc01_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_corvfdc01_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_corvfdc01_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { int current_drive; floppy_image_device *floppy = nullptr; @@ -259,7 +259,7 @@ void a2bus_corvfdc01_device::write_c0nx(address_space &space, UINT8 offset, UINT read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_corvfdc01_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_corvfdc01_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset & 0x1f]; } diff --git a/src/devices/bus/a2bus/corvfdc01.h b/src/devices/bus/a2bus/corvfdc01.h index 626a2ca145d..c21f0839709 100644 --- a/src/devices/bus/a2bus/corvfdc01.h +++ b/src/devices/bus/a2bus/corvfdc01.h @@ -26,8 +26,8 @@ class a2bus_corvfdc01_device: { public: // construction/destruction - a2bus_corvfdc01_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_corvfdc01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_corvfdc01_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); + a2bus_corvfdc01_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; @@ -43,9 +43,9 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; required_device m_wdfdc; required_device m_con1; @@ -54,8 +54,8 @@ protected: required_device m_con4; private: - UINT8 *m_rom; - UINT8 m_fdc_local_status, m_fdc_local_command; + uint8_t *m_rom; + uint8_t m_fdc_local_status, m_fdc_local_command; floppy_image_device *m_curfloppy; }; diff --git a/src/devices/bus/a2bus/corvfdc02.cpp b/src/devices/bus/a2bus/corvfdc02.cpp index 89201538f6a..66375cc5580 100644 --- a/src/devices/bus/a2bus/corvfdc02.cpp +++ b/src/devices/bus/a2bus/corvfdc02.cpp @@ -80,7 +80,7 @@ const tiny_rom_entry *a2bus_corvfdc02_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_corvfdc02_device::a2bus_corvfdc02_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_corvfdc02_device::a2bus_corvfdc02_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_a2bus_card_interface(mconfig, *this), m_fdc(*this, FDC02_FDC_TAG), @@ -91,7 +91,7 @@ a2bus_corvfdc02_device::a2bus_corvfdc02_device(const machine_config &mconfig, de { } -a2bus_corvfdc02_device::a2bus_corvfdc02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_corvfdc02_device::a2bus_corvfdc02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_CORVFDC02, "Corvus Systems Buffered Floppy Controller", tag, owner, clock, "crvfdc02", __FILE__), device_a2bus_card_interface(mconfig, *this), m_fdc(*this, FDC02_FDC_TAG), @@ -140,7 +140,7 @@ void a2bus_corvfdc02_device::device_timer(emu_timer &timer, device_timer_id id, read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_corvfdc02_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_corvfdc02_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -176,7 +176,7 @@ UINT8 a2bus_corvfdc02_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_corvfdc02_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_corvfdc02_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { floppy_image_device *floppy = nullptr; @@ -250,7 +250,7 @@ void a2bus_corvfdc02_device::write_c0nx(address_space &space, UINT8 offset, UINT read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_corvfdc02_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_corvfdc02_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset & 0x1f]; } diff --git a/src/devices/bus/a2bus/corvfdc02.h b/src/devices/bus/a2bus/corvfdc02.h index d7a1d6a2a1e..5ff6402372e 100644 --- a/src/devices/bus/a2bus/corvfdc02.h +++ b/src/devices/bus/a2bus/corvfdc02.h @@ -26,8 +26,8 @@ class a2bus_corvfdc02_device: { public: // construction/destruction - a2bus_corvfdc02_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_corvfdc02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_corvfdc02_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); + a2bus_corvfdc02_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; @@ -44,9 +44,9 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; required_device m_fdc; required_device m_con1; @@ -55,10 +55,10 @@ protected: required_device m_con4; private: - UINT8 *m_rom; - UINT8 m_fdc_local_status, m_fdc_local_command; - UINT16 m_bufptr; - UINT8 m_buffer[2048]; // 1x6116 SRAM + uint8_t *m_rom; + uint8_t m_fdc_local_status, m_fdc_local_command; + uint16_t m_bufptr; + uint8_t m_buffer[2048]; // 1x6116 SRAM floppy_image_device *m_curfloppy; bool m_in_drq; emu_timer *m_timer; diff --git a/src/devices/bus/a2bus/ezcgi.cpp b/src/devices/bus/a2bus/ezcgi.cpp index e85db228ad2..e8dc74df028 100644 --- a/src/devices/bus/a2bus/ezcgi.cpp +++ b/src/devices/bus/a2bus/ezcgi.cpp @@ -96,42 +96,42 @@ machine_config_constructor a2bus_ezcgi_9958_device::device_mconfig_additions() c // LIVE DEVICE //************************************************************************** -a2bus_ezcgi_device::a2bus_ezcgi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ezcgi_device::a2bus_ezcgi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_EZCGI, "E-Z Color Graphics Interface", tag, owner, clock, "a2ezcgi", __FILE__), device_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG) { } -a2bus_ezcgi_device::a2bus_ezcgi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_ezcgi_device::a2bus_ezcgi_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_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG) { } -a2bus_ezcgi_9938_device::a2bus_ezcgi_9938_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ezcgi_9938_device::a2bus_ezcgi_9938_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_EZCGI_9938, "E-Z Color Graphics Interface (TMS9938)", tag, owner, clock, "a2ezcgi3", __FILE__), device_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG) { } -a2bus_ezcgi_9938_device::a2bus_ezcgi_9938_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_ezcgi_9938_device::a2bus_ezcgi_9938_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_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG) { } -a2bus_ezcgi_9958_device::a2bus_ezcgi_9958_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ezcgi_9958_device::a2bus_ezcgi_9958_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_EZCGI_9958, "E-Z Color Graphics Interface (TMS9958)", tag, owner, clock, "a2ezcgi5", __FILE__), device_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG) { } -a2bus_ezcgi_9958_device::a2bus_ezcgi_9958_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_ezcgi_9958_device::a2bus_ezcgi_9958_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_a2bus_card_interface(mconfig, *this), m_tms(*this, TMS_TAG) @@ -178,7 +178,7 @@ void a2bus_ezcgi_9958_device::device_reset() 1 - TMS write */ -UINT8 a2bus_ezcgi_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_ezcgi_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -192,7 +192,7 @@ UINT8 a2bus_ezcgi_device::read_c0nx(address_space &space, UINT8 offset) return 0xff; } -void a2bus_ezcgi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_ezcgi_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -206,7 +206,7 @@ void a2bus_ezcgi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 da } } -UINT8 a2bus_ezcgi_9938_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_ezcgi_9938_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -220,7 +220,7 @@ UINT8 a2bus_ezcgi_9938_device::read_c0nx(address_space &space, UINT8 offset) return 0xff; } -void a2bus_ezcgi_9938_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_ezcgi_9938_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -242,7 +242,7 @@ void a2bus_ezcgi_9938_device::write_c0nx(address_space &space, UINT8 offset, UIN } } -UINT8 a2bus_ezcgi_9958_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_ezcgi_9958_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -256,7 +256,7 @@ UINT8 a2bus_ezcgi_9958_device::read_c0nx(address_space &space, UINT8 offset) return 0xff; } -void a2bus_ezcgi_9958_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_ezcgi_9958_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/a2bus/ezcgi.h b/src/devices/bus/a2bus/ezcgi.h index 275ec0fd77e..8d01f3ac029 100644 --- a/src/devices/bus/a2bus/ezcgi.h +++ b/src/devices/bus/a2bus/ezcgi.h @@ -28,8 +28,8 @@ class a2bus_ezcgi_device: { public: // construction/destruction - a2bus_ezcgi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_ezcgi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_ezcgi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_ezcgi_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; required_device m_tms; }; @@ -53,8 +53,8 @@ class a2bus_ezcgi_9938_device: { public: // construction/destruction - a2bus_ezcgi_9938_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_ezcgi_9938_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_ezcgi_9938_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_ezcgi_9938_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -66,8 +66,8 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; required_device m_tms; }; @@ -78,8 +78,8 @@ class a2bus_ezcgi_9958_device: { public: // construction/destruction - a2bus_ezcgi_9958_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a2bus_ezcgi_9958_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a2bus_ezcgi_9958_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a2bus_ezcgi_9958_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -91,8 +91,8 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; required_device m_tms; }; diff --git a/src/devices/bus/a2bus/laser128.cpp b/src/devices/bus/a2bus/laser128.cpp index 5357f3cc31d..3ba434abfa4 100644 --- a/src/devices/bus/a2bus/laser128.cpp +++ b/src/devices/bus/a2bus/laser128.cpp @@ -42,14 +42,14 @@ machine_config_constructor a2bus_laser128_device::device_mconfig_additions() con // LIVE DEVICE //************************************************************************** -a2bus_laser128_device::a2bus_laser128_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_laser128_device::a2bus_laser128_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_a2bus_card_interface(mconfig, *this), m_rom(nullptr), m_slot7_bank(0), m_slot7_ram_bank(0) { } -a2bus_laser128_device::a2bus_laser128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_laser128_device::a2bus_laser128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_LASER128, "VTech Laser 128 Internal Device", tag, owner, clock, "a2laser128", __FILE__), device_a2bus_card_interface(mconfig, *this), m_rom(nullptr), m_slot7_bank(0), m_slot7_ram_bank(0) { @@ -75,21 +75,21 @@ void a2bus_laser128_device::device_reset() m_slot7_ram_bank = 0; } -UINT8 a2bus_laser128_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_laser128_device::read_c0nx(address_space &space, uint8_t offset) { return 0x00; } -void a2bus_laser128_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_laser128_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { } -UINT8 a2bus_laser128_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_laser128_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset + (m_slot * 0x100) + 0x4000]; } -UINT8 a2bus_laser128_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_laser128_device::read_c800(address_space &space, uint16_t offset) { switch (m_slot) { @@ -116,7 +116,7 @@ UINT8 a2bus_laser128_device::read_c800(address_space &space, UINT16 offset) return 0xff; } -void a2bus_laser128_device::write_c800(address_space &space, UINT16 offset, UINT8 data) +void a2bus_laser128_device::write_c800(address_space &space, uint16_t offset, uint8_t data) { if ((m_slot == 7) && (offset < 0x400)) { diff --git a/src/devices/bus/a2bus/laser128.h b/src/devices/bus/a2bus/laser128.h index 55c46f63730..2cd7def413b 100644 --- a/src/devices/bus/a2bus/laser128.h +++ b/src/devices/bus/a2bus/laser128.h @@ -24,8 +24,8 @@ class a2bus_laser128_device: { public: // construction/destruction - a2bus_laser128_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_laser128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_laser128_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); + a2bus_laser128_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; @@ -35,16 +35,16 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; - virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; + virtual void write_c800(address_space &space, uint16_t offset, uint8_t data) override; virtual bool take_c800() override; private: - UINT8 *m_rom; - UINT8 m_slot7_ram[0x800]; + uint8_t *m_rom; + uint8_t m_slot7_ram[0x800]; int m_slot7_bank, m_slot7_ram_bank; }; diff --git a/src/devices/bus/a2bus/mouse.cpp b/src/devices/bus/a2bus/mouse.cpp index 02eec429329..fa0f8377007 100644 --- a/src/devices/bus/a2bus/mouse.cpp +++ b/src/devices/bus/a2bus/mouse.cpp @@ -172,7 +172,7 @@ const tiny_rom_entry *a2bus_mouse_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_mouse_device::a2bus_mouse_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_mouse_device::a2bus_mouse_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_a2bus_card_interface(mconfig, *this), m_pia(*this, MOUSE_PIA_TAG), @@ -186,7 +186,7 @@ a2bus_mouse_device::a2bus_mouse_device(const machine_config &mconfig, device_typ m_rom_bank = 0; } -a2bus_mouse_device::a2bus_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_mouse_device::a2bus_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_MOUSE, "Apple II Mouse Card", tag, owner, clock, "a2mouse", __FILE__), device_a2bus_card_interface(mconfig, *this), m_pia(*this, MOUSE_PIA_TAG), @@ -261,7 +261,7 @@ void a2bus_mouse_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_mouse_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_mouse_device::read_c0nx(address_space &space, uint8_t offset) { return m_pia->read(space, offset & 3); } @@ -271,7 +271,7 @@ UINT8 a2bus_mouse_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_mouse_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_mouse_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { m_pia->write(space, offset & 3, data); } @@ -280,7 +280,7 @@ void a2bus_mouse_device::write_c0nx(address_space &space, UINT8 offset, UINT8 da read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_mouse_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_mouse_device::read_cnxx(address_space &space, uint8_t offset) { return m_rom[offset+m_rom_bank]; } @@ -333,7 +333,7 @@ WRITE8_MEMBER(a2bus_mouse_device::mcu_ddr_a_w) READ8_MEMBER(a2bus_mouse_device::mcu_port_b_r) { - UINT8 b_in = m_port_b_in; + uint8_t b_in = m_port_b_in; // clear the gates, leave everything else alone between pulses m_port_b_in &= 0x85; @@ -435,7 +435,7 @@ WRITE8_MEMBER(a2bus_mouse_device::mcu_timer_w) if (recalc) { // recalculate the timer now - UINT32 m_ticks = 2043600 / 4; + uint32_t m_ticks = 2043600 / 4; m_ticks /= prescale[m_timer_ctl & 7]; m_ticks /= (int)(m_timer_cnt + 1); m_timer->adjust(attotime::from_hz((double)m_ticks), TIMER_68705, attotime::from_hz((double)m_ticks)); diff --git a/src/devices/bus/a2bus/mouse.h b/src/devices/bus/a2bus/mouse.h index a5bf3a5c831..1592cdab850 100644 --- a/src/devices/bus/a2bus/mouse.h +++ b/src/devices/bus/a2bus/mouse.h @@ -26,8 +26,8 @@ class a2bus_mouse_device: { public: // construction/destruction - a2bus_mouse_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_mouse_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); + a2bus_mouse_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; @@ -59,30 +59,30 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; required_device m_pia; required_device m_mcu; required_ioport m_mouseb, m_mousex, m_mousey; private: - UINT8 *m_rom; + uint8_t *m_rom; bool m_started; int m_rom_bank; - UINT8 m_ddr_a; - UINT8 m_ddr_b; - UINT8 m_ddr_c; - UINT8 m_port_a_out; - UINT8 m_port_b_out; - UINT8 m_port_c_out; - UINT8 m_port_a_in; - UINT8 m_port_b_in; - UINT8 m_port_c_in; - UINT8 m_timer_cnt; - UINT8 m_timer_ctl; - UINT8 m_mask_option; + uint8_t m_ddr_a; + uint8_t m_ddr_b; + uint8_t m_ddr_c; + uint8_t m_port_a_out; + uint8_t m_port_b_out; + uint8_t m_port_c_out; + uint8_t m_port_a_in; + uint8_t m_port_b_in; + uint8_t m_port_c_in; + uint8_t m_timer_cnt; + uint8_t m_timer_ctl; + uint8_t m_mask_option; int last_mx, last_my, count_x, count_y; emu_timer *m_timer, *m_read_timer; }; diff --git a/src/devices/bus/a2bus/pc_xporter.cpp b/src/devices/bus/a2bus/pc_xporter.cpp index ec40e08a1aa..08533d22f60 100644 --- a/src/devices/bus/a2bus/pc_xporter.cpp +++ b/src/devices/bus/a2bus/pc_xporter.cpp @@ -181,7 +181,7 @@ machine_config_constructor a2bus_pcxporter_device::device_mconfig_additions() co // LIVE DEVICE //************************************************************************** -a2bus_pcxporter_device::a2bus_pcxporter_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_pcxporter_device::a2bus_pcxporter_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_a2bus_card_interface(mconfig, *this), m_v30(*this, "v30"), @@ -194,7 +194,7 @@ a2bus_pcxporter_device::a2bus_pcxporter_device(const machine_config &mconfig, de { } -a2bus_pcxporter_device::a2bus_pcxporter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_pcxporter_device::a2bus_pcxporter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_PCXPORTER, "Applied Engineering PC Transporter", tag, owner, clock, "a2pcxport", __FILE__), device_a2bus_card_interface(mconfig, *this), m_v30(*this, "v30"), @@ -243,7 +243,7 @@ void a2bus_pcxporter_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_pcxporter_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_pcxporter_device::read_c0nx(address_space &space, uint8_t offset) { switch (offset) { @@ -260,7 +260,7 @@ UINT8 a2bus_pcxporter_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_pcxporter_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_pcxporter_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -274,13 +274,13 @@ void a2bus_pcxporter_device::write_c0nx(address_space &space, UINT8 offset, UINT read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_pcxporter_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_pcxporter_device::read_cnxx(address_space &space, uint8_t offset) { // read only to trigger C800? return 0xff; } -void a2bus_pcxporter_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_pcxporter_device::write_cnxx(address_space &space, uint8_t offset, uint8_t data) { printf("Write %02x to cn%02x (PC=%x)\n", data, offset, space.device().safe_pc()); } @@ -289,7 +289,7 @@ void a2bus_pcxporter_device::write_cnxx(address_space &space, UINT8 offset, UINT read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_pcxporter_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_pcxporter_device::read_c800(address_space &space, uint16_t offset) { // printf("Read C800 at %x\n", offset + 0xc800); @@ -299,7 +299,7 @@ UINT8 a2bus_pcxporter_device::read_c800(address_space &space, UINT16 offset) } else { - UINT8 rv; + uint8_t rv; switch (offset) { @@ -337,7 +337,7 @@ UINT8 a2bus_pcxporter_device::read_c800(address_space &space, UINT16 offset) /*------------------------------------------------- write_c800 - called for writes to this card's c800 space -------------------------------------------------*/ -void a2bus_pcxporter_device::write_c800(address_space &space, UINT16 offset, UINT8 data) +void a2bus_pcxporter_device::write_c800(address_space &space, uint16_t offset, uint8_t data) { if (offset < 0x400) { diff --git a/src/devices/bus/a2bus/pc_xporter.h b/src/devices/bus/a2bus/pc_xporter.h index cb008a3ec76..048dd210de4 100644 --- a/src/devices/bus/a2bus/pc_xporter.h +++ b/src/devices/bus/a2bus/pc_xporter.h @@ -34,8 +34,8 @@ class a2bus_pcxporter_device: { public: // construction/destruction - a2bus_pcxporter_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_pcxporter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_pcxporter_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); + a2bus_pcxporter_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,22 +51,22 @@ public: optional_device m_pc_kbdc; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual void write_cnxx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; - virtual void write_c800(address_space &space, UINT16 offset, UINT8 data) override; - - UINT8 m_u73_q2; - UINT8 m_out1; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual void write_cnxx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; + virtual void write_c800(address_space &space, uint16_t offset, uint8_t data) override; + + uint8_t m_u73_q2; + uint8_t m_out1; int m_dma_channel; - UINT8 m_dma_offset[4]; - UINT8 m_pc_spkrdata; - UINT8 m_pit_out2; + uint8_t m_dma_offset[4]; + uint8_t m_pc_spkrdata; + uint8_t m_pit_out2; bool m_cur_eop; - UINT8 m_nmi_enabled; + uint8_t m_nmi_enabled; // interface to the keyboard DECLARE_WRITE_LINE_MEMBER( keyboard_clock_w ); @@ -103,14 +103,14 @@ protected: virtual void device_reset() override; private: - UINT8 m_ram[768*1024]; - UINT8 m_c800_ram[0x400]; - UINT8 m_regs[0x400]; - UINT32 m_offset; + uint8_t m_ram[768*1024]; + uint8_t m_c800_ram[0x400]; + uint8_t m_regs[0x400]; + uint32_t m_offset; address_space *m_pcmem_space, *m_pcio_space; bool m_reset_during_halt; - UINT8 m_6845_reg; + uint8_t m_6845_reg; void pc_select_dma_channel(int channel, bool state); }; diff --git a/src/devices/bus/a2bus/ramcard128k.cpp b/src/devices/bus/a2bus/ramcard128k.cpp index 4616bf54ecf..27dc0e62b64 100644 --- a/src/devices/bus/a2bus/ramcard128k.cpp +++ b/src/devices/bus/a2bus/ramcard128k.cpp @@ -28,13 +28,13 @@ const device_type A2BUS_RAMCARD128K = &device_creator; // LIVE DEVICE //************************************************************************** -a2bus_ssramcard_device::a2bus_ssramcard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_ssramcard_device::a2bus_ssramcard_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_a2bus_card_interface(mconfig, *this), m_inh_state(0), m_last_offset(0), m_dxxx_bank(0), m_main_bank(0) { } -a2bus_ssramcard_device::a2bus_ssramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ssramcard_device::a2bus_ssramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_RAMCARD128K, "Saturn Systems 128K Extended Language Card", tag, owner, clock, "ssram128", __FILE__), device_a2bus_card_interface(mconfig, *this), m_inh_state(0), m_last_offset(0), m_dxxx_bank(0), m_main_bank(0) { @@ -139,7 +139,7 @@ void a2bus_ssramcard_device::do_io(int offset) read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_ssramcard_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_ssramcard_device::read_c0nx(address_space &space, uint8_t offset) { do_io(offset & 0xf); return 0xff; @@ -150,12 +150,12 @@ UINT8 a2bus_ssramcard_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_ssramcard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_ssramcard_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { do_io(offset & 0xf); } -UINT8 a2bus_ssramcard_device::read_inh_rom(address_space &space, UINT16 offset) +uint8_t a2bus_ssramcard_device::read_inh_rom(address_space &space, uint16_t offset) { assert(m_inh_state & INH_READ); // this should never happen @@ -167,7 +167,7 @@ UINT8 a2bus_ssramcard_device::read_inh_rom(address_space &space, UINT16 offset) return m_ram[(offset & 0x1fff) + 0x2000 + m_main_bank]; } -void a2bus_ssramcard_device::write_inh_rom(address_space &space, UINT16 offset, UINT8 data) +void a2bus_ssramcard_device::write_inh_rom(address_space &space, uint16_t offset, uint8_t data) { // are writes enabled? if (!(m_inh_state & INH_WRITE)) diff --git a/src/devices/bus/a2bus/ramcard128k.h b/src/devices/bus/a2bus/ramcard128k.h index c70f188c955..d8dbf33b5bf 100644 --- a/src/devices/bus/a2bus/ramcard128k.h +++ b/src/devices/bus/a2bus/ramcard128k.h @@ -24,20 +24,20 @@ class a2bus_ssramcard_device: { public: // construction/destruction - a2bus_ssramcard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_ssramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_ssramcard_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); + a2bus_ssramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_inh_rom(address_space &space, UINT16 offset) override; - virtual void write_inh_rom(address_space &space, UINT16 offset, UINT8 data) override; - virtual UINT16 inh_start() override { return 0xd000; } - virtual UINT16 inh_end() override { return 0xffff; } + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_inh_rom(address_space &space, uint16_t offset) override; + virtual void write_inh_rom(address_space &space, uint16_t offset, uint8_t data) override; + virtual uint16_t inh_start() override { return 0xd000; } + virtual uint16_t inh_end() override { return 0xffff; } virtual int inh_type() override; private: @@ -47,7 +47,7 @@ private: int m_last_offset; int m_dxxx_bank; int m_main_bank; - UINT8 m_ram[128*1024]; + uint8_t m_ram[128*1024]; }; // device type definition diff --git a/src/devices/bus/a2bus/ramcard16k.cpp b/src/devices/bus/a2bus/ramcard16k.cpp index 1d679b2be8c..d0d682deeaa 100644 --- a/src/devices/bus/a2bus/ramcard16k.cpp +++ b/src/devices/bus/a2bus/ramcard16k.cpp @@ -28,13 +28,13 @@ const device_type A2BUS_RAMCARD16K = &device_creator; // LIVE DEVICE //************************************************************************** -a2bus_ramcard_device::a2bus_ramcard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_ramcard_device::a2bus_ramcard_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_a2bus_card_interface(mconfig, *this), m_inh_state(0), m_last_offset(0), m_dxxx_bank(0) { } -a2bus_ramcard_device::a2bus_ramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_ramcard_device::a2bus_ramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_RAMCARD16K, "Apple II 16K Language Card", tag, owner, clock, "a2ram16k", __FILE__), device_a2bus_card_interface(mconfig, *this), m_inh_state(0), m_last_offset(0), m_dxxx_bank(0) { @@ -119,7 +119,7 @@ void a2bus_ramcard_device::do_io(int offset) read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_ramcard_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_ramcard_device::read_c0nx(address_space &space, uint8_t offset) { do_io(offset & 0xf); return 0xff; @@ -130,12 +130,12 @@ UINT8 a2bus_ramcard_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_ramcard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_ramcard_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { do_io(offset & 0xf); } -UINT8 a2bus_ramcard_device::read_inh_rom(address_space &space, UINT16 offset) +uint8_t a2bus_ramcard_device::read_inh_rom(address_space &space, uint16_t offset) { assert(m_inh_state & INH_READ); // this should never happen @@ -147,7 +147,7 @@ UINT8 a2bus_ramcard_device::read_inh_rom(address_space &space, UINT16 offset) return m_ram[(offset & 0x1fff) + 0x2000]; } -void a2bus_ramcard_device::write_inh_rom(address_space &space, UINT16 offset, UINT8 data) +void a2bus_ramcard_device::write_inh_rom(address_space &space, uint16_t offset, uint8_t data) { // are writes enabled? if (!(m_inh_state & INH_WRITE)) diff --git a/src/devices/bus/a2bus/ramcard16k.h b/src/devices/bus/a2bus/ramcard16k.h index b604801a362..f01b6347d81 100644 --- a/src/devices/bus/a2bus/ramcard16k.h +++ b/src/devices/bus/a2bus/ramcard16k.h @@ -24,20 +24,20 @@ class a2bus_ramcard_device: { public: // construction/destruction - a2bus_ramcard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_ramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_ramcard_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); + a2bus_ramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_inh_rom(address_space &space, UINT16 offset) override; - virtual void write_inh_rom(address_space &space, UINT16 offset, UINT8 data) override; - virtual UINT16 inh_start() override { return 0xd000; } - virtual UINT16 inh_end() override { return 0xffff; } + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_inh_rom(address_space &space, uint16_t offset) override; + virtual void write_inh_rom(address_space &space, uint16_t offset, uint8_t data) override; + virtual uint16_t inh_start() override { return 0xd000; } + virtual uint16_t inh_end() override { return 0xffff; } virtual int inh_type() override; private: @@ -46,7 +46,7 @@ private: int m_inh_state; int m_last_offset; int m_dxxx_bank; - UINT8 m_ram[16*1024]; + uint8_t m_ram[16*1024]; }; // device type definition diff --git a/src/devices/bus/a2bus/timemasterho.cpp b/src/devices/bus/a2bus/timemasterho.cpp index 647dc774116..e83aa4f0999 100644 --- a/src/devices/bus/a2bus/timemasterho.cpp +++ b/src/devices/bus/a2bus/timemasterho.cpp @@ -121,7 +121,7 @@ const tiny_rom_entry *a2bus_timemasterho_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -a2bus_timemasterho_device::a2bus_timemasterho_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a2bus_timemasterho_device::a2bus_timemasterho_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_a2bus_card_interface(mconfig, *this), m_pia(*this, TIMEMASTER_PIA_TAG), @@ -131,7 +131,7 @@ a2bus_timemasterho_device::a2bus_timemasterho_device(const machine_config &mconf m_started = false; } -a2bus_timemasterho_device::a2bus_timemasterho_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2bus_timemasterho_device::a2bus_timemasterho_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2BUS_TIMEMASTERHO, "Applied Engineering TimeMaster H.O.", tag, owner, clock, "a2tmstho", __FILE__), device_a2bus_card_interface(mconfig, *this), m_pia(*this, TIMEMASTER_PIA_TAG), @@ -164,7 +164,7 @@ void a2bus_timemasterho_device::device_reset() read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ -UINT8 a2bus_timemasterho_device::read_c0nx(address_space &space, UINT8 offset) +uint8_t a2bus_timemasterho_device::read_c0nx(address_space &space, uint8_t offset) { if (offset <= 3) { @@ -179,7 +179,7 @@ UINT8 a2bus_timemasterho_device::read_c0nx(address_space &space, UINT8 offset) write_c0nx - called for writes to this card's c0nx space -------------------------------------------------*/ -void a2bus_timemasterho_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data) +void a2bus_timemasterho_device::write_c0nx(address_space &space, uint8_t offset, uint8_t data) { if (offset <= 3) { @@ -191,7 +191,7 @@ void a2bus_timemasterho_device::write_c0nx(address_space &space, UINT8 offset, U read_cnxx - called for reads from this card's cnxx space -------------------------------------------------*/ -UINT8 a2bus_timemasterho_device::read_cnxx(address_space &space, UINT8 offset) +uint8_t a2bus_timemasterho_device::read_cnxx(address_space &space, uint8_t offset) { if (m_started) { @@ -209,7 +209,7 @@ UINT8 a2bus_timemasterho_device::read_cnxx(address_space &space, UINT8 offset) read_c800 - called for reads from this card's c800 space -------------------------------------------------*/ -UINT8 a2bus_timemasterho_device::read_c800(address_space &space, UINT16 offset) +uint8_t a2bus_timemasterho_device::read_c800(address_space &space, uint16_t offset) { return m_rom[offset+0xc00]; } @@ -242,7 +242,7 @@ WRITE8_MEMBER(a2bus_timemasterho_device::pia_out_b) void a2bus_timemasterho_device::update_irqs() { - UINT8 dip = 0; + uint8_t dip = 0; if (m_started) { diff --git a/src/devices/bus/a2bus/timemasterho.h b/src/devices/bus/a2bus/timemasterho.h index 87fa840bc8f..f366ee838bc 100644 --- a/src/devices/bus/a2bus/timemasterho.h +++ b/src/devices/bus/a2bus/timemasterho.h @@ -26,8 +26,8 @@ class a2bus_timemasterho_device: { public: // construction/destruction - a2bus_timemasterho_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a2bus_timemasterho_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2bus_timemasterho_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); + a2bus_timemasterho_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; @@ -44,10 +44,10 @@ protected: virtual void device_reset() override; // overrides of standard a2bus slot functions - virtual UINT8 read_c0nx(address_space &space, UINT8 offset) override; - virtual void write_c0nx(address_space &space, UINT8 offset, UINT8 data) override; - virtual UINT8 read_cnxx(address_space &space, UINT8 offset) override; - virtual UINT8 read_c800(address_space &space, UINT16 offset) override; + virtual uint8_t read_c0nx(address_space &space, uint8_t offset) override; + virtual void write_c0nx(address_space &space, uint8_t offset, uint8_t data) override; + virtual uint8_t read_cnxx(address_space &space, uint8_t offset) override; + virtual uint8_t read_c800(address_space &space, uint16_t offset) override; required_device m_pia; required_device m_msm5832; @@ -56,7 +56,7 @@ protected: private: void update_irqs(); - UINT8 *m_rom; + uint8_t *m_rom; bool m_irqa, m_irqb; bool m_started; }; diff --git a/src/devices/bus/a7800/a78_slot.cpp b/src/devices/bus/a7800/a78_slot.cpp index 93997f3fecd..31c0cf7c514 100644 --- a/src/devices/bus/a7800/a78_slot.cpp +++ b/src/devices/bus/a7800/a78_slot.cpp @@ -62,7 +62,7 @@ device_a78_cart_interface::~device_a78_cart_interface () // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_a78_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_a78_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -86,7 +86,7 @@ void device_a78_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the on-cart RAM //------------------------------------------------- -void device_a78_cart_interface::ram_alloc(UINT32 size) +void device_a78_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); device().save_item(NAME(m_ram)); @@ -97,7 +97,7 @@ void device_a78_cart_interface::ram_alloc(UINT32 size) // ram_alloc - alloc the space for the on-cart RAM //------------------------------------------------- -void device_a78_cart_interface::nvram_alloc(UINT32 size) +void device_a78_cart_interface::nvram_alloc(uint32_t size) { m_nvram.resize(size); device().save_item(NAME(m_nvram)); @@ -112,7 +112,7 @@ void device_a78_cart_interface::nvram_alloc(UINT32 size) //------------------------------------------------- // a78_cart_slot_device - constructor //------------------------------------------------- -a78_cart_slot_device::a78_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a78_cart_slot_device::a78_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A78_CART_SLOT, "Atari 7800 Cartridge Slot", tag, owner, clock, "a78_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_cart(nullptr), m_type(0) @@ -346,7 +346,7 @@ image_init_result a78_cart_slot_device::call_load() { if (m_cart) { - UINT32 len; + uint32_t len; if (software_entry() != nullptr) { @@ -449,7 +449,7 @@ image_init_result a78_cart_slot_device::call_load() osd_printf_info("Run it through the expansion to exploit this feature.\n"); } - internal_header_logging((UINT8 *)head, length()); + internal_header_logging((uint8_t *)head, length()); m_cart->rom_alloc(len, tag()); fread(m_cart->get_rom_base(), len); @@ -523,7 +523,7 @@ std::string a78_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - std::vector head(128); + std::vector head(128); int type = A78_TYPE0, mapper; // Load and check the header @@ -714,14 +714,14 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx) -------------------------------------------------*/ -void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len) +void a78_cart_slot_device::internal_header_logging(uint8_t *header, uint32_t len) { char head_title[35]; - UINT32 head_length = (header[49] << 24) | (header[50] << 16) | (header[51] << 8) | header[52]; - UINT16 head_mapper = (header[53] << 8) | header[54]; - UINT8 head_ctrl1 = header[55]; - UINT8 head_ctrl2 = header[56]; - UINT8 head_ispal = header[57]; + uint32_t head_length = (header[49] << 24) | (header[50] << 16) | (header[51] << 8) | header[52]; + uint16_t head_mapper = (header[53] << 8) | header[54]; + uint8_t head_ctrl1 = header[55]; + uint8_t head_ctrl2 = header[56]; + uint8_t head_ispal = header[57]; std::string cart_mapper, ctrl1, ctrl2; memcpy(head_title, header + 0x11, 0x20); diff --git a/src/devices/bus/a7800/a78_slot.h b/src/devices/bus/a7800/a78_slot.h index 7267bce373a..bb9f9645651 100644 --- a/src/devices/bus/a7800/a78_slot.h +++ b/src/devices/bus/a7800/a78_slot.h @@ -55,24 +55,24 @@ public: virtual DECLARE_WRITE8_MEMBER(write_30xx) {} virtual DECLARE_WRITE8_MEMBER(write_40xx) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - void nvram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT8* get_nvram_base() { return &m_nvram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } - UINT32 get_nvram_size() { return m_nvram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + void nvram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint8_t* get_nvram_base() { return &m_nvram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } + uint32_t get_nvram_size() { return m_nvram.size(); } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; - std::vector m_nvram; // HiScore cart can save scores! + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; + std::vector m_nvram; // HiScore cart can save scores! // helpers - UINT32 m_base_rom; + uint32_t m_base_rom; int m_bank_mask; }; @@ -88,7 +88,7 @@ class a78_cart_slot_device : public device_t, { public: // construction/destruction - a78_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~a78_cart_slot_device(); // device-level overrides @@ -132,7 +132,7 @@ private: image_verify_result verify_header(char *header); int validate_header(int head, bool log); - void internal_header_logging(UINT8 *header, UINT32 len); + void internal_header_logging(uint8_t *header, uint32_t len); }; diff --git a/src/devices/bus/a7800/cpuwiz.cpp b/src/devices/bus/a7800/cpuwiz.cpp index 2ec5b34e0e9..6d044bcc13c 100644 --- a/src/devices/bus/a7800/cpuwiz.cpp +++ b/src/devices/bus/a7800/cpuwiz.cpp @@ -40,24 +40,24 @@ const device_type A78_ROM_MEGACART = &device_creator; const device_type A78_ROM_P450_VB = &device_creator; -a78_versaboard_device::a78_versaboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a78_versaboard_device::a78_versaboard_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) : a78_rom_sg_device(mconfig, type, name, tag, owner, clock, shortname, source), m_ram_bank(0) { } -a78_versaboard_device::a78_versaboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_versaboard_device::a78_versaboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_sg_device(mconfig, A78_ROM_VERSABOARD, "Atari 7800 VersaBoard Cart", tag, owner, clock, "a78_versaboard", __FILE__), m_ram_bank(0) { } -a78_megacart_device::a78_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_megacart_device::a78_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_versaboard_device(mconfig, A78_ROM_MEGACART, "Atari 7800 MegaCart+", tag, owner, clock, "a78_megacart", __FILE__) { } -a78_rom_p450_vb_device::a78_rom_p450_vb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_p450_vb_device::a78_rom_p450_vb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_versaboard_device(mconfig, A78_ROM_P450_VB, "Atari 7800 VersaBoard + POKEY @ 0x0450 Cart", tag, owner, clock, "a78_versapokey", __FILE__), m_pokey450(*this, "pokey450") { diff --git a/src/devices/bus/a7800/cpuwiz.h b/src/devices/bus/a7800/cpuwiz.h index 1decc581446..7d288055aaa 100644 --- a/src/devices/bus/a7800/cpuwiz.h +++ b/src/devices/bus/a7800/cpuwiz.h @@ -13,8 +13,8 @@ class a78_versaboard_device : public a78_rom_sg_device { public: // construction/destruction - a78_versaboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a78_versaboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_versaboard_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); + a78_versaboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -35,7 +35,7 @@ class a78_megacart_device : public a78_versaboard_device { public: // construction/destruction - a78_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_WRITE8_MEMBER(write_40xx) override; @@ -50,7 +50,7 @@ class a78_rom_p450_vb_device : public a78_versaboard_device { public: // construction/destruction - a78_rom_p450_vb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_p450_vb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/a7800/hiscore.cpp b/src/devices/bus/a7800/hiscore.cpp index 3448fb85808..381e6475d30 100644 --- a/src/devices/bus/a7800/hiscore.cpp +++ b/src/devices/bus/a7800/hiscore.cpp @@ -20,7 +20,7 @@ const device_type A78_HISCORE = &device_creator; -a78_hiscore_device::a78_hiscore_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_hiscore_device::a78_hiscore_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_device(mconfig, A78_HISCORE, "Atari 7800 High Score Cart", tag, owner, clock, "a78_highscore", __FILE__), m_hscslot(*this, "hsc_slot") { diff --git a/src/devices/bus/a7800/hiscore.h b/src/devices/bus/a7800/hiscore.h index 3f8d7422d8b..2ce16b319c6 100644 --- a/src/devices/bus/a7800/hiscore.h +++ b/src/devices/bus/a7800/hiscore.h @@ -13,7 +13,7 @@ class a78_hiscore_device : public a78_rom_device { public: // construction/destruction - a78_hiscore_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_hiscore_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/a7800/rom.cpp b/src/devices/bus/a7800/rom.cpp index d7f2f41b7fd..3b230e79e56 100644 --- a/src/devices/bus/a7800/rom.cpp +++ b/src/devices/bus/a7800/rom.cpp @@ -42,102 +42,102 @@ const device_type A78_ROM_P450_SG_RAM = &device_creator; -a78_rom_device::a78_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a78_rom_device::a78_rom_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_a78_cart_interface( mconfig, *this ) { } -a78_rom_device::a78_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_device::a78_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A78_ROM, "Atari 7800 ROM Carts w/no Bankswitch", tag, owner, clock, "a78_rom", __FILE__), device_a78_cart_interface( mconfig, *this ) { } -a78_rom_pokey_device::a78_rom_pokey_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a78_rom_pokey_device::a78_rom_pokey_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) : a78_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_pokey(*this, "pokey") { } -a78_rom_pokey_device::a78_rom_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_pokey_device::a78_rom_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_device(mconfig, A78_ROM_POKEY, "Atari 7800 ROM Carts w/no Bankswitch + POKEY", tag, owner, clock, "a78_rom_pok", __FILE__), m_pokey(*this, "pokey") { } -a78_rom_sg_device::a78_rom_sg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a78_rom_sg_device::a78_rom_sg_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) : a78_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_bank(0) { } -a78_rom_sg_device::a78_rom_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_sg_device::a78_rom_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_device(mconfig, A78_ROM_SG, "Atari 7800 ROM Carts w/SuperGame Bankswitch", tag, owner, clock, "a78_rom_sg", __FILE__), m_bank(0) { } -a78_rom_sg_pokey_device::a78_rom_sg_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_sg_pokey_device::a78_rom_sg_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_sg_device(mconfig, A78_ROM_SG_POKEY, "Atari 7800 ROM Carts w/SuperGame Bankswitch + POKEY", tag, owner, clock, "a78_rom_sgp", __FILE__), m_pokey(*this, "pokey") { } -a78_rom_sg_ram_device::a78_rom_sg_ram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a78_rom_sg_ram_device::a78_rom_sg_ram_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) : a78_rom_sg_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -a78_rom_sg_ram_device::a78_rom_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_sg_ram_device::a78_rom_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_sg_device(mconfig, A78_ROM_SG_RAM, "Atari 7800 ROM Carts w/SuperGame Bankswitch + RAM", tag, owner, clock, "a78_rom_sgr", __FILE__) { } -a78_rom_sg9_device::a78_rom_sg9_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a78_rom_sg9_device::a78_rom_sg9_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) : a78_rom_sg_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -a78_rom_sg9_device::a78_rom_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_sg9_device::a78_rom_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_sg_device(mconfig, A78_ROM_SG9, "Atari 7800 ROM Carts w/SuperGame 9Banks", tag, owner, clock, "a78_rom_sg9", __FILE__) { } -a78_rom_abs_device::a78_rom_abs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_abs_device::a78_rom_abs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_device(mconfig, A78_ROM_ABSOLUTE, "Atari 7800 ROM Carts w/Absolute Bankswitch", tag, owner, clock, "a78_rom_abs", __FILE__), m_bank(0) { } -a78_rom_act_device::a78_rom_act_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_act_device::a78_rom_act_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_device(mconfig, A78_ROM_ACTIVISION, "Atari 7800 ROM Carts w/Activision Bankswitch", tag, owner, clock, "a78_rom_act", __FILE__), m_bank(0) { } -a78_rom_p450_device::a78_rom_p450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_p450_device::a78_rom_p450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_device(mconfig, A78_ROM_P450, "Atari 7800 ROM Carts w/POKEY @ 0x0450", tag, owner, clock, "a78_p450_t0", __FILE__), m_pokey450(*this, "pokey450") { } -a78_rom_p450_pokey_device::a78_rom_p450_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_p450_pokey_device::a78_rom_p450_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_pokey_device(mconfig, A78_ROM_P450_POKEY, "Atari 7800 ROM Carts w/no Bankswitch + POKEY + POKEY @ 0x0450", tag, owner, clock, "a78_p450_t1", __FILE__), m_pokey450(*this, "pokey450") { } -a78_rom_p450_sg_ram_device::a78_rom_p450_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_p450_sg_ram_device::a78_rom_p450_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_sg_ram_device(mconfig, A78_ROM_P450_SG_RAM, "Atari 7800 ROM Carts w/SuperGame Bankswitch + RAM + POKEY @ 0x0450", tag, owner, clock, "a78_p450_t6", __FILE__), m_pokey450(*this, "pokey450") { } -a78_rom_p450_sg9_device::a78_rom_p450_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_rom_p450_sg9_device::a78_rom_p450_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_sg9_device(mconfig, A78_ROM_P450_SG9, "Atari 7800 ROM Carts w/SuperGame 9Banks + POKEY @ 0x0450", tag, owner, clock, "a78_p450_ta", __FILE__), m_pokey450(*this, "pokey450") { @@ -438,8 +438,8 @@ WRITE8_MEMBER(a78_rom_abs_device::write_40xx) READ8_MEMBER(a78_rom_act_device::read_40xx) { - UINT8 data = 0xff; - UINT16 addr = offset & 0x1fff; + uint8_t data = 0xff; + uint16_t addr = offset & 0x1fff; // offset goes from 0 to 0xc000 switch (offset & 0xe000) diff --git a/src/devices/bus/a7800/rom.h b/src/devices/bus/a7800/rom.h index 7c7f6507e38..3e64f653e8f 100644 --- a/src/devices/bus/a7800/rom.h +++ b/src/devices/bus/a7800/rom.h @@ -14,8 +14,8 @@ class a78_rom_device : public device_t, { public: // construction/destruction - a78_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a78_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_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); + a78_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -32,8 +32,8 @@ class a78_rom_pokey_device : public a78_rom_device { public: // construction/destruction - a78_rom_pokey_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a78_rom_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_pokey_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); + a78_rom_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -53,8 +53,8 @@ class a78_rom_sg_device : public a78_rom_device { public: // construction/destruction - a78_rom_sg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a78_rom_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_sg_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); + a78_rom_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -75,7 +75,7 @@ class a78_rom_sg_pokey_device : public a78_rom_sg_device { public: // construction/destruction - a78_rom_sg_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_sg_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -95,8 +95,8 @@ class a78_rom_sg_ram_device : public a78_rom_sg_device { public: // construction/destruction - a78_rom_sg_ram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a78_rom_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_sg_ram_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); + a78_rom_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_40xx) override; @@ -110,8 +110,8 @@ class a78_rom_sg9_device : public a78_rom_sg_device { public: // construction/destruction - a78_rom_sg9_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a78_rom_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_sg9_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); + a78_rom_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_40xx) override; @@ -125,7 +125,7 @@ class a78_rom_abs_device : public a78_rom_device { public: // construction/destruction - a78_rom_abs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_abs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -146,7 +146,7 @@ class a78_rom_act_device : public a78_rom_device { public: // construction/destruction - a78_rom_act_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_act_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -169,7 +169,7 @@ class a78_rom_p450_device : public a78_rom_device { public: // construction/destruction - a78_rom_p450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_p450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; @@ -188,7 +188,7 @@ class a78_rom_p450_pokey_device : public a78_rom_pokey_device { public: // construction/destruction - a78_rom_p450_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_p450_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; @@ -207,7 +207,7 @@ class a78_rom_p450_sg_ram_device : public a78_rom_sg_ram_device { public: // construction/destruction - a78_rom_p450_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_p450_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; @@ -226,7 +226,7 @@ class a78_rom_p450_sg9_device : public a78_rom_sg9_device { public: // construction/destruction - a78_rom_p450_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_rom_p450_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/a7800/xboard.cpp b/src/devices/bus/a7800/xboard.cpp index af05c663440..422cd0a740e 100644 --- a/src/devices/bus/a7800/xboard.cpp +++ b/src/devices/bus/a7800/xboard.cpp @@ -56,7 +56,7 @@ const device_type A78_XBOARD = &device_creator; const device_type A78_XM = &device_creator; -a78_xboard_device::a78_xboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a78_xboard_device::a78_xboard_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) : a78_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_xbslot(*this, "xb_slot"), m_pokey(*this, "xb_pokey"), m_reg(0), m_ram_bank(0) @@ -64,7 +64,7 @@ a78_xboard_device::a78_xboard_device(const machine_config &mconfig, device_type } -a78_xboard_device::a78_xboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_xboard_device::a78_xboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_rom_device(mconfig, A78_XBOARD, "Atari 7800 XBoarD expansion", tag, owner, clock, "a78_xboard", __FILE__), m_xbslot(*this, "xb_slot"), m_pokey(*this, "xb_pokey"), m_reg(0), m_ram_bank(0) @@ -72,7 +72,7 @@ a78_xboard_device::a78_xboard_device(const machine_config &mconfig, const char * } -a78_xm_device::a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a78_xm_device::a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a78_xboard_device(mconfig, A78_XM, "Atari 7800 XM expansion module", tag, owner, clock, "a78_xm", __FILE__), m_ym(*this, "xm_ym2151"), m_ym_enabled(0) { diff --git a/src/devices/bus/a7800/xboard.h b/src/devices/bus/a7800/xboard.h index b9cf77d6adb..0ab9884a957 100644 --- a/src/devices/bus/a7800/xboard.h +++ b/src/devices/bus/a7800/xboard.h @@ -15,8 +15,8 @@ class a78_xboard_device : public a78_rom_device { public: // construction/destruction - a78_xboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a78_xboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_xboard_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); + a78_xboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -42,7 +42,7 @@ class a78_xm_device : public a78_xboard_device { public: // construction/destruction - a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a78_xm_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/devices/bus/a800/a800_slot.cpp b/src/devices/bus/a800/a800_slot.cpp index 4aafc77f1d3..d5d5d4d9555 100644 --- a/src/devices/bus/a800/a800_slot.cpp +++ b/src/devices/bus/a800/a800_slot.cpp @@ -59,7 +59,7 @@ device_a800_cart_interface::~device_a800_cart_interface () // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_a800_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_a800_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -75,7 +75,7 @@ void device_a800_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the on-cart RAM //------------------------------------------------- -void device_a800_cart_interface::ram_alloc(UINT32 size) +void device_a800_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); device().save_item(NAME(m_ram)); @@ -86,7 +86,7 @@ void device_a800_cart_interface::ram_alloc(UINT32 size) // ram_alloc - alloc the space for the on-cart RAM //------------------------------------------------- -void device_a800_cart_interface::nvram_alloc(UINT32 size) +void device_a800_cart_interface::nvram_alloc(uint32_t size) { m_nvram.resize(size); device().save_item(NAME(m_nvram)); @@ -101,14 +101,14 @@ void device_a800_cart_interface::nvram_alloc(UINT32 size) //------------------------------------------------- // ****_cart_slot_device - constructor //------------------------------------------------- -a800_cart_slot_device::a800_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a800_cart_slot_device::a800_cart_slot_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, __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_cart(nullptr), m_type(0) { } -a800_cart_slot_device::a800_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a800_cart_slot_device::a800_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A800_CART_SLOT, "Atari 8bit Cartridge Slot", tag, owner, clock, "a800_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_cart(nullptr), m_type(0) @@ -116,13 +116,13 @@ a800_cart_slot_device::a800_cart_slot_device(const machine_config &mconfig, cons } -a5200_cart_slot_device::a5200_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a5200_cart_slot_device::a5200_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_cart_slot_device(mconfig, A5200_CART_SLOT, "Atari 5200 Cartridge Slot", tag, owner, clock, "a5200_cart_slot", __FILE__) { } -xegs_cart_slot_device::xegs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +xegs_cart_slot_device::xegs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_cart_slot_device(mconfig, XEGS_CART_SLOT, "Atari XEGS Cartridge Slot", tag, owner, clock, "xegs_cart_slot", __FILE__) { } @@ -240,7 +240,7 @@ image_init_result a800_cart_slot_device::call_load() { if (m_cart) { - UINT32 len; + uint32_t len; if (software_entry() != nullptr) { @@ -262,7 +262,7 @@ image_init_result a800_cart_slot_device::call_load() // check whether there is an header, to identify the cart type if ((len % 0x1000) == 0x10) { - UINT8 header[16]; + uint8_t header[16]; fread(header, 0x10); m_type = identify_cart_type(header); len -= 0x10; // in identify_cart_type the first 0x10 bytes are read, so we need to adjust here @@ -308,7 +308,7 @@ void a800_cart_slot_device::call_unload() fullpath -------------------------------------------------*/ -int a800_cart_slot_device::identify_cart_type(UINT8 *header) +int a800_cart_slot_device::identify_cart_type(uint8_t *header) { int type = A800_8K; @@ -405,8 +405,8 @@ std::string a800_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - std::vector head(0x10); - UINT32 len = m_file->size(); + std::vector head(0x10); + uint32_t len = m_file->size(); int type = A800_8K; // check whether there is an header, to identify the cart type @@ -442,8 +442,8 @@ std::string a5200_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - std::vector head(0x10); - UINT32 len = m_file->size(); + std::vector head(0x10); + uint32_t len = m_file->size(); int type = A5200_8K; // check whether there is an header, to identify the cart type @@ -477,8 +477,8 @@ std::string xegs_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - std::vector head(0x10); - UINT32 len = m_file->size(); + std::vector head(0x10); + uint32_t len = m_file->size(); int type = A800_8K; // check whether there is an header, to identify the cart type diff --git a/src/devices/bus/a800/a800_slot.h b/src/devices/bus/a800/a800_slot.h index cc1b6ba275c..5bf4ceeebc2 100644 --- a/src/devices/bus/a800/a800_slot.h +++ b/src/devices/bus/a800/a800_slot.h @@ -58,22 +58,22 @@ public: virtual DECLARE_WRITE8_MEMBER(write_80xx) {} virtual DECLARE_WRITE8_MEMBER(write_d5xx) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - void nvram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT8* get_nvram_base() { return &m_nvram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } - UINT32 get_nvram_size() { return m_nvram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + void nvram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint8_t* get_nvram_base() { return &m_nvram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } + uint32_t get_nvram_size() { return m_nvram.size(); } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; - std::vector m_nvram; // HiScore cart can save scores! + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; + std::vector m_nvram; // HiScore cart can save scores! // helpers int m_bank_mask; }; @@ -87,8 +87,8 @@ class a800_cart_slot_device : public device_t, { public: // construction/destruction - a800_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a800_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_cart_slot_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); + a800_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~a800_cart_slot_device(); // device-level overrides @@ -101,7 +101,7 @@ public: virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_cart_type() { return m_type; }; - int identify_cart_type(UINT8 *header); + int identify_cart_type(uint8_t *header); bool has_cart() { return m_cart != nullptr; } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } @@ -137,7 +137,7 @@ class a5200_cart_slot_device : public a800_cart_slot_device { public: // construction/destruction - a5200_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a5200_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~a5200_cart_slot_device(); virtual const char *file_extensions() const override { return "bin,rom,car,a52"; } @@ -152,7 +152,7 @@ class xegs_cart_slot_device : public a800_cart_slot_device { public: // construction/destruction - xegs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + xegs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~xegs_cart_slot_device(); virtual const char *file_extensions() const override { return "bin,rom,car"; } diff --git a/src/devices/bus/a800/a8sio.cpp b/src/devices/bus/a800/a8sio.cpp index 54f45ecb208..d6c8dbe7e3f 100644 --- a/src/devices/bus/a800/a8sio.cpp +++ b/src/devices/bus/a800/a8sio.cpp @@ -48,13 +48,13 @@ const device_type A8SIO_SLOT = &device_creator; //------------------------------------------------- // a8sio_slot_device - constructor //------------------------------------------------- -a8sio_slot_device::a8sio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a8sio_slot_device::a8sio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A8SIO_SLOT, "Atari 8 bit SIO Slot", tag, owner, clock, "a8sio_slot", __FILE__) , device_slot_interface(mconfig, *this), m_a8sio_tag(nullptr), m_a8sio_slottag(nullptr) { } -a8sio_slot_device::a8sio_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +a8sio_slot_device::a8sio_slot_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_slot_interface(mconfig, *this), m_a8sio_tag(nullptr), m_a8sio_slottag(nullptr) { @@ -98,7 +98,7 @@ const device_type A8SIO = &device_creator; // a8sio_device - constructor //------------------------------------------------- -a8sio_device::a8sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a8sio_device::a8sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A8SIO, "Atari 8 biot SIO", tag, owner, clock, "a8sio", __FILE__) , m_out_clock_in_cb(*this) , m_out_data_in_cb(*this) @@ -106,7 +106,7 @@ a8sio_device::a8sio_device(const machine_config &mconfig, const char *tag, devic { } -a8sio_device::a8sio_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) +a8sio_device::a8sio_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_out_clock_in_cb(*this) , m_out_data_in_cb(*this) diff --git a/src/devices/bus/a800/a8sio.h b/src/devices/bus/a800/a8sio.h index 0a06c0c93b8..2684a3d3c28 100644 --- a/src/devices/bus/a800/a8sio.h +++ b/src/devices/bus/a800/a8sio.h @@ -54,8 +54,8 @@ class a8sio_slot_device : public device_t, { public: // construction/destruction - a8sio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a8sio_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a8sio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a8sio_slot_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-level overrides virtual void device_start() override; @@ -80,8 +80,8 @@ class a8sio_device : public device_t { public: // construction/destruction - a8sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a8sio_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); + a8sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a8sio_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); // inline configuration template static devcb_base &set_clock_in_callback(device_t &device, _Object object) { return downcast(device).m_out_clock_in_cb.set_callback(object); } diff --git a/src/devices/bus/a800/cassette.cpp b/src/devices/bus/a800/cassette.cpp index 3a6406d44a1..7ff511bd0d7 100644 --- a/src/devices/bus/a800/cassette.cpp +++ b/src/devices/bus/a800/cassette.cpp @@ -44,7 +44,7 @@ machine_config_constructor a8sio_cassette_device::device_mconfig_additions() con // LIVE DEVICE //************************************************************************** -a8sio_cassette_device::a8sio_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a8sio_cassette_device::a8sio_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A8SIO_CASSETTE, "Atari 8 bit cassette", tag, owner, clock, "a8sio_cass", __FILE__) , device_a8sio_card_interface(mconfig, *this) , m_cassette(*this, "cassette"), m_read_timer(nullptr) @@ -53,7 +53,7 @@ a8sio_cassette_device::a8sio_cassette_device(const machine_config &mconfig, cons { } -a8sio_cassette_device::a8sio_cassette_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a8sio_cassette_device::a8sio_cassette_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_a8sio_card_interface(mconfig, *this) , m_cassette(*this, "cassette"), m_read_timer(nullptr) @@ -96,7 +96,7 @@ void a8sio_cassette_device::device_timer(emu_timer &timer, device_timer_id id, i switch (id) { case TIMER_CASSETTE_READ: - UINT8 cass_signal = m_cassette->input() < 0 ? 0 : 1; + uint8_t cass_signal = m_cassette->input() < 0 ? 0 : 1; if (m_signal_count < 20) { diff --git a/src/devices/bus/a800/cassette.h b/src/devices/bus/a800/cassette.h index d3bb24bbc4f..72d0f749ccc 100644 --- a/src/devices/bus/a800/cassette.h +++ b/src/devices/bus/a800/cassette.h @@ -27,8 +27,8 @@ class a8sio_cassette_device { public: // construction/destruction - a8sio_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - a8sio_cassette_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + a8sio_cassette_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + a8sio_cassette_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -43,8 +43,8 @@ protected: required_device m_cassette; emu_timer *m_read_timer; - UINT8 m_old_cass_signal; - UINT8 m_signal_count; + uint8_t m_old_cass_signal; + uint8_t m_signal_count; }; // device type definition diff --git a/src/devices/bus/a800/oss.cpp b/src/devices/bus/a800/oss.cpp index 5cdc7e72126..2e2af58c0f0 100644 --- a/src/devices/bus/a800/oss.cpp +++ b/src/devices/bus/a800/oss.cpp @@ -21,26 +21,26 @@ const device_type A800_ROM_OSS43 = &device_creator; const device_type A800_ROM_OSS91 = &device_creator; -a800_rom_oss8k_device::a800_rom_oss8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_oss8k_device::a800_rom_oss8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_OSS8K, "Atari 800 ROM Carts OSS 8K", tag, owner, clock, "a800_oss8k", __FILE__), m_bank(0) { } -a800_rom_oss34_device::a800_rom_oss34_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_oss34_device::a800_rom_oss34_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_OSS34, "Atari 800 ROM Carts OSS-034M", tag, owner, clock, "a800_034m", __FILE__), m_bank(0) { } -a800_rom_oss43_device::a800_rom_oss43_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_oss43_device::a800_rom_oss43_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_OSS43, "Atari 800 ROM Carts OSS-043M", tag, owner, clock, "a800_043m", __FILE__), m_bank(0) { } -a800_rom_oss91_device::a800_rom_oss91_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_oss91_device::a800_rom_oss91_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_OSS91, "Atari 800 ROM Carts OSS-M091", tag, owner, clock, "a800_m091", __FILE__), m_bank(0) { } diff --git a/src/devices/bus/a800/oss.h b/src/devices/bus/a800/oss.h index 20524eedd64..fef9ab5d939 100644 --- a/src/devices/bus/a800/oss.h +++ b/src/devices/bus/a800/oss.h @@ -12,7 +12,7 @@ class a800_rom_oss8k_device : public a800_rom_device { public: // construction/destruction - a800_rom_oss8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_oss8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -32,7 +32,7 @@ class a800_rom_oss34_device : public a800_rom_device { public: // construction/destruction - a800_rom_oss34_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_oss34_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -52,7 +52,7 @@ class a800_rom_oss43_device : public a800_rom_device { public: // construction/destruction - a800_rom_oss43_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_oss43_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -72,7 +72,7 @@ class a800_rom_oss91_device : public a800_rom_device { public: // construction/destruction - a800_rom_oss91_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_oss91_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/devices/bus/a800/rom.cpp b/src/devices/bus/a800/rom.cpp index 1a21ab92039..a3625fa754c 100644 --- a/src/devices/bus/a800/rom.cpp +++ b/src/devices/bus/a800/rom.cpp @@ -30,69 +30,69 @@ const device_type A5200_ROM_2CHIPS = &device_creator; const device_type A5200_ROM_BBSB = &device_creator; -a800_rom_device::a800_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a800_rom_device::a800_rom_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_a800_cart_interface( mconfig, *this ) { } -a800_rom_device::a800_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_device::a800_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A800_ROM, "Atari 800 ROM Carts", tag, owner, clock, "a800_rom", __FILE__), device_a800_cart_interface( mconfig, *this ) { } -a800_rom_bbsb_device::a800_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_bbsb_device::a800_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_BBSB, "Atari 800 ROM Cart BBSB", tag, owner, clock, "a800_bbsb", __FILE__) { } -xegs_rom_device::xegs_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +xegs_rom_device::xegs_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, XEGS_ROM, "Atari XEGS 64K ROM Carts", tag, owner, clock, "a800_xegs", __FILE__), m_bank(0) { } -a800_rom_williams_device::a800_rom_williams_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_williams_device::a800_rom_williams_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_WILLIAMS, "Atari 800 64K ROM Carts Williams", tag, owner, clock, "a800_williams", __FILE__), m_bank(0) { } -a800_rom_express_device::a800_rom_express_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_express_device::a800_rom_express_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_EXPRESS, "Atari 800 64K ROM Carts Express/Diamond", tag, owner, clock, "a800_express", __FILE__), m_bank(0) { } -a800_rom_turbo_device::a800_rom_turbo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_turbo_device::a800_rom_turbo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_TURBO, "Atari 800 64K ROM Carts Turbosoft", tag, owner, clock, "a800_turbo", __FILE__), m_bank(0) { } -a800_rom_telelink2_device::a800_rom_telelink2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_telelink2_device::a800_rom_telelink2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_TELELINK2, "Atari 800 64K ROM Cart Telelink II", tag, owner, clock, "a800_tlink2", __FILE__) { } -a800_rom_microcalc_device::a800_rom_microcalc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_microcalc_device::a800_rom_microcalc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_MICROCALC, "Atari 800 64K ROM Cart SITSA MicroCalc", tag, owner, clock, "a800_sitsa", __FILE__), m_bank(0) { } -a5200_rom_2chips_device::a5200_rom_2chips_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a5200_rom_2chips_device::a5200_rom_2chips_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A5200_ROM_2CHIPS, "Atari 5200 ROM Cart 16K in 2 Chips", tag, owner, clock, "a5200_16k2c", __FILE__) { } -a5200_rom_bbsb_device::a5200_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a5200_rom_bbsb_device::a5200_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A5200_ROM_BBSB, "Atari 5200 ROM Cart BBSB", tag, owner, clock, "a5200_bbsb", __FILE__) { } @@ -234,7 +234,7 @@ READ8_MEMBER(a800_rom_bbsb_device::read_80xx) WRITE8_MEMBER(a800_rom_bbsb_device::write_80xx) { - UINT16 addr = offset & 0xfff; + uint16_t addr = offset & 0xfff; if (addr >= 0xff6 && addr <= 0xff9) m_banks[BIT(offset, 12)] = (addr - 0xff6); } @@ -441,7 +441,7 @@ READ8_MEMBER(a5200_rom_bbsb_device::read_80xx) WRITE8_MEMBER(a5200_rom_bbsb_device::write_80xx) { - UINT16 addr = offset & 0xfff; + uint16_t addr = offset & 0xfff; if (addr >= 0xff6 && addr <= 0xff9) m_banks[BIT(offset, 12)] = (addr - 0xff6); } diff --git a/src/devices/bus/a800/rom.h b/src/devices/bus/a800/rom.h index f02b5be43ef..e15d5e29a0a 100644 --- a/src/devices/bus/a800/rom.h +++ b/src/devices/bus/a800/rom.h @@ -13,8 +13,8 @@ class a800_rom_device : public device_t, { public: // construction/destruction - a800_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a800_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_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); + a800_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -30,7 +30,7 @@ class a800_rom_bbsb_device : public a800_rom_device { public: // construction/destruction - a800_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -50,7 +50,7 @@ class a800_rom_williams_device : public a800_rom_device { public: // construction/destruction - a800_rom_williams_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_williams_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -70,7 +70,7 @@ class a800_rom_express_device : public a800_rom_device { public: // construction/destruction - a800_rom_express_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_express_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -90,7 +90,7 @@ class a800_rom_blizzard_device : public a800_rom_device { public: // construction/destruction - a800_rom_blizzard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_blizzard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -106,7 +106,7 @@ class a800_rom_turbo_device : public a800_rom_device { public: // construction/destruction - a800_rom_turbo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_turbo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -126,7 +126,7 @@ class a800_rom_telelink2_device : public a800_rom_device { public: // construction/destruction - a800_rom_telelink2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_telelink2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(read_80xx) override; virtual DECLARE_WRITE8_MEMBER(write_80xx) override; @@ -141,7 +141,7 @@ class a800_rom_microcalc_device : public a800_rom_device { public: // construction/destruction - a800_rom_microcalc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_microcalc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -161,7 +161,7 @@ class xegs_rom_device : public a800_rom_device { public: // construction/destruction - xegs_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + xegs_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -181,7 +181,7 @@ class a5200_rom_2chips_device : public a800_rom_device { public: // construction/destruction - a5200_rom_2chips_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a5200_rom_2chips_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(read_80xx) override; }; @@ -193,7 +193,7 @@ class a5200_rom_bbsb_device : public a800_rom_device { public: // construction/destruction - a5200_rom_bbsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a5200_rom_bbsb_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/devices/bus/a800/sparta.cpp b/src/devices/bus/a800/sparta.cpp index 44204cd7fa7..55639200485 100644 --- a/src/devices/bus/a800/sparta.cpp +++ b/src/devices/bus/a800/sparta.cpp @@ -18,7 +18,7 @@ const device_type A800_ROM_SPARTADOS = &device_creator; -a800_rom_spartados_device::a800_rom_spartados_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a800_rom_spartados_device::a800_rom_spartados_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a800_rom_device(mconfig, A800_ROM_SPARTADOS, "Atari 800 SpartaDOS ROM Carts", tag, owner, clock, "a800_sparta", __FILE__), m_bank(0), m_subslot_enabled(0) diff --git a/src/devices/bus/a800/sparta.h b/src/devices/bus/a800/sparta.h index 5588cb464fd..f39aa515cde 100644 --- a/src/devices/bus/a800/sparta.h +++ b/src/devices/bus/a800/sparta.h @@ -12,7 +12,7 @@ class a800_rom_spartados_device : public a800_rom_device { public: // construction/destruction - a800_rom_spartados_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a800_rom_spartados_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/devices/bus/abcbus/abc890.cpp b/src/devices/bus/abcbus/abc890.cpp index b9e7902dfd2..192b113e245 100644 --- a/src/devices/bus/abcbus/abc890.cpp +++ b/src/devices/bus/abcbus/abc890.cpp @@ -186,39 +186,39 @@ machine_config_constructor abc856_t::device_mconfig_additions() const // abc890_t - constructor //------------------------------------------------- -abc890_t::abc890_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) : +abc890_t::abc890_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), device_abcbus_card_interface(mconfig, *this) { } -abc890_t::abc890_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc890_t::abc890_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC890, "ABC 890", tag, owner, clock, "abc890", __FILE__), device_abcbus_card_interface(mconfig, *this) { } -abc_expansion_unit_t::abc_expansion_unit_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc_expansion_unit_t::abc_expansion_unit_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : abc890_t(mconfig, ABC_EXPANSION_UNIT, "ABC Expansion Unit", tag, owner, clock, "abcexp", __FILE__) { } -abc894_t::abc894_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc894_t::abc894_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : abc890_t(mconfig, ABC894, "ABC 894", tag, owner, clock, "abc894", __FILE__) { } -abc850_t::abc850_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc850_t::abc850_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : abc890_t(mconfig, ABC850, "ABC 850", tag, owner, clock, "abc850", __FILE__) { } -abc852_t::abc852_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc852_t::abc852_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : abc890_t(mconfig, ABC852, "ABC 852", tag, owner, clock, "abc852", __FILE__) { } -abc856_t::abc856_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc856_t::abc856_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : abc890_t(mconfig, ABC856, "ABC 856", tag, owner, clock, "abc856", __FILE__) { } @@ -250,7 +250,7 @@ void abc890_t::device_reset() // abcbus_cs - card select //------------------------------------------------- -void abc890_t::abcbus_cs(UINT8 data) +void abc890_t::abcbus_cs(uint8_t data) { for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { @@ -263,9 +263,9 @@ void abc890_t::abcbus_cs(UINT8 data) // abcbus_inp - input //------------------------------------------------- -UINT8 abc890_t::abcbus_inp() +uint8_t abc890_t::abcbus_inp() { - UINT8 data = 0xff; + uint8_t data = 0xff; for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { @@ -280,7 +280,7 @@ UINT8 abc890_t::abcbus_inp() // abcbus_out - output //------------------------------------------------- -void abc890_t::abcbus_out(UINT8 data) +void abc890_t::abcbus_out(uint8_t data) { for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { @@ -293,9 +293,9 @@ void abc890_t::abcbus_out(UINT8 data) // abcbus_stat - status //------------------------------------------------- -UINT8 abc890_t::abcbus_stat() +uint8_t abc890_t::abcbus_stat() { - UINT8 data = 0xff; + uint8_t data = 0xff; for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { @@ -310,7 +310,7 @@ UINT8 abc890_t::abcbus_stat() // abcbus_c1 - command 1 //------------------------------------------------- -void abc890_t::abcbus_c1(UINT8 data) +void abc890_t::abcbus_c1(uint8_t data) { for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { @@ -323,7 +323,7 @@ void abc890_t::abcbus_c1(UINT8 data) // abcbus_c2 - command 2 //------------------------------------------------- -void abc890_t::abcbus_c2(UINT8 data) +void abc890_t::abcbus_c2(uint8_t data) { for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { @@ -336,7 +336,7 @@ void abc890_t::abcbus_c2(UINT8 data) // abcbus_c3 - command 3 //------------------------------------------------- -void abc890_t::abcbus_c3(UINT8 data) +void abc890_t::abcbus_c3(uint8_t data) { for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { @@ -349,7 +349,7 @@ void abc890_t::abcbus_c3(UINT8 data) // abcbus_c4 - command 4 //------------------------------------------------- -void abc890_t::abcbus_c4(UINT8 data) +void abc890_t::abcbus_c4(uint8_t data) { for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { @@ -362,9 +362,9 @@ void abc890_t::abcbus_c4(UINT8 data) // abcbus_xmemfl - extended memory read //------------------------------------------------- -UINT8 abc890_t::abcbus_xmemfl(offs_t offset) +uint8_t abc890_t::abcbus_xmemfl(offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { @@ -379,7 +379,7 @@ UINT8 abc890_t::abcbus_xmemfl(offs_t offset) // abcbus_xmemw - extended memory write //------------------------------------------------- -void abc890_t::abcbus_xmemw(offs_t offset, UINT8 data) +void abc890_t::abcbus_xmemw(offs_t offset, uint8_t data) { for (abcbus_slot_t &slot : abcbus_slot_device_iterator(*this)) { diff --git a/src/devices/bus/abcbus/abc890.h b/src/devices/bus/abcbus/abc890.h index 0cedef00e45..27481a6ca2c 100644 --- a/src/devices/bus/abcbus/abc890.h +++ b/src/devices/bus/abcbus/abc890.h @@ -27,8 +27,8 @@ class abc890_t : public device_t, { public: // construction/destruction - abc890_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); - abc890_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc890_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); + abc890_t(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; @@ -39,16 +39,16 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; - virtual UINT8 abcbus_inp() override; - virtual void abcbus_out(UINT8 data) override; - virtual UINT8 abcbus_stat() override; - virtual void abcbus_c1(UINT8 data) override; - virtual void abcbus_c2(UINT8 data) override; - virtual void abcbus_c3(UINT8 data) override; - virtual void abcbus_c4(UINT8 data) override; - virtual UINT8 abcbus_xmemfl(offs_t offset) override; - virtual void abcbus_xmemw(offs_t offset, UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override; + virtual uint8_t abcbus_inp() override; + virtual void abcbus_out(uint8_t data) override; + virtual uint8_t abcbus_stat() override; + virtual void abcbus_c1(uint8_t data) override; + virtual void abcbus_c2(uint8_t data) override; + virtual void abcbus_c3(uint8_t data) override; + virtual void abcbus_c4(uint8_t data) override; + virtual uint8_t abcbus_xmemfl(offs_t offset) override; + virtual void abcbus_xmemw(offs_t offset, uint8_t data) override; }; @@ -58,7 +58,7 @@ class abc_expansion_unit_t : public abc890_t { public: // construction/destruction - abc_expansion_unit_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc_expansion_unit_t(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; @@ -71,7 +71,7 @@ class abc894_t : public abc890_t { public: // construction/destruction - abc894_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc894_t(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; @@ -84,7 +84,7 @@ class abc850_t : public abc890_t { public: // construction/destruction - abc850_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc850_t(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; @@ -97,7 +97,7 @@ class abc852_t : public abc890_t { public: // construction/destruction - abc852_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc852_t(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; @@ -110,7 +110,7 @@ class abc856_t : public abc890_t { public: // construction/destruction - abc856_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc856_t(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; diff --git a/src/devices/bus/abcbus/abcbus.cpp b/src/devices/bus/abcbus/abcbus.cpp index 4bec92bc417..e0335d610f5 100644 --- a/src/devices/bus/abcbus/abcbus.cpp +++ b/src/devices/bus/abcbus/abcbus.cpp @@ -37,7 +37,7 @@ device_abcbus_card_interface::device_abcbus_card_interface(const machine_config // abcbus_slot_t - constructor //------------------------------------------------- -abcbus_slot_t::abcbus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abcbus_slot_t::abcbus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABCBUS_SLOT, "ABCBUS slot", tag, owner, clock, "abcbus_slot", __FILE__), device_slot_interface(mconfig, *this), m_write_irq(*this), diff --git a/src/devices/bus/abcbus/abcbus.h b/src/devices/bus/abcbus/abcbus.h index 24ecb23b7ff..906d3d1b3d2 100644 --- a/src/devices/bus/abcbus/abcbus.h +++ b/src/devices/bus/abcbus/abcbus.h @@ -167,27 +167,27 @@ public: device_abcbus_card_interface(const machine_config &mconfig, device_t &device); // required operation overrides - virtual void abcbus_cs(UINT8 data) = 0; + virtual void abcbus_cs(uint8_t data) = 0; // optional operation overrides - virtual UINT8 abcbus_inp() { return 0xff; }; - virtual void abcbus_out(UINT8 data) { }; - virtual UINT8 abcbus_stat() { return 0xff; }; - virtual void abcbus_c1(UINT8 data) { }; - virtual void abcbus_c2(UINT8 data) { }; - virtual void abcbus_c3(UINT8 data) { }; - virtual void abcbus_c4(UINT8 data) { }; + virtual uint8_t abcbus_inp() { return 0xff; }; + virtual void abcbus_out(uint8_t data) { }; + virtual uint8_t abcbus_stat() { return 0xff; }; + virtual void abcbus_c1(uint8_t data) { }; + virtual void abcbus_c2(uint8_t data) { }; + virtual void abcbus_c3(uint8_t data) { }; + virtual void abcbus_c4(uint8_t data) { }; // optional operation overrides for ABC 80 - virtual UINT8 abcbus_xmemfl(offs_t offset) { return 0xff; }; - virtual void abcbus_xmemw(offs_t offset, UINT8 data) { }; + virtual uint8_t abcbus_xmemfl(offs_t offset) { return 0xff; }; + virtual void abcbus_xmemw(offs_t offset, uint8_t data) { }; // optional operation overrides for ABC 1600 virtual int abcbus_csb() { return 1; } - virtual UINT8 abcbus_ops() { return 0xff; }; + virtual uint8_t abcbus_ops() { return 0xff; }; virtual void abcbus_tren(int state) { }; virtual void abcbus_prac(int state) { }; - virtual UINT8 abcbus_exp() { return 0xff; }; + virtual uint8_t abcbus_exp() { return 0xff; }; virtual int abcbus_xcsb2() { return 1; }; virtual int abcbus_xcsb3() { return 1; }; virtual int abcbus_xcsb4() { return 1; }; @@ -205,7 +205,7 @@ class abcbus_slot_t : public device_t, { public: // construction/destruction - abcbus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abcbus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_irq_callback(_irq irq) { m_write_irq.set_callback(irq); } template void set_nmi_callback(_nmi nmi) { m_write_nmi.set_callback(nmi); } @@ -219,20 +219,20 @@ public: template void set_xint5_callback(_xint5 xint5) { m_write_xint5.set_callback(xint5); } // computer interface - void cs_w(UINT8 data) { if (m_card) m_card->abcbus_cs(data); } - UINT8 rst_r() { device_reset(); return 0xff; } - UINT8 inp_r() { return m_card ? m_card->abcbus_inp() : 0xff; } - void out_w(UINT8 data) { if (m_card) m_card->abcbus_out(data); } - UINT8 stat_r() { return m_card ? m_card->abcbus_stat() : 0xff; } - void c1_w(UINT8 data) { if (m_card) m_card->abcbus_c1(data); } - void c2_w(UINT8 data) { if (m_card) m_card->abcbus_c2(data); } - void c3_w(UINT8 data) { if (m_card) m_card->abcbus_c3(data); } - void c4_w(UINT8 data) { if (m_card) m_card->abcbus_c4(data); } - UINT8 xmemfl_r(offs_t offset) { return m_card ? m_card->abcbus_xmemfl(offset) : 0xff; } - void xmemw_w(offs_t offset, UINT8 data) { if (m_card) m_card->abcbus_xmemw(offset, data); } + void cs_w(uint8_t data) { if (m_card) m_card->abcbus_cs(data); } + uint8_t rst_r() { device_reset(); return 0xff; } + uint8_t inp_r() { return m_card ? m_card->abcbus_inp() : 0xff; } + void out_w(uint8_t data) { if (m_card) m_card->abcbus_out(data); } + uint8_t stat_r() { return m_card ? m_card->abcbus_stat() : 0xff; } + void c1_w(uint8_t data) { if (m_card) m_card->abcbus_c1(data); } + void c2_w(uint8_t data) { if (m_card) m_card->abcbus_c2(data); } + void c3_w(uint8_t data) { if (m_card) m_card->abcbus_c3(data); } + void c4_w(uint8_t data) { if (m_card) m_card->abcbus_c4(data); } + uint8_t xmemfl_r(offs_t offset) { return m_card ? m_card->abcbus_xmemfl(offset) : 0xff; } + void xmemw_w(offs_t offset, uint8_t data) { if (m_card) m_card->abcbus_xmemw(offset, data); } DECLARE_READ_LINE_MEMBER( csb_r ) { return m_card ? m_card->abcbus_csb() : 1; } - UINT8 ops_r() { return m_card ? m_card->abcbus_ops() : 0xff; } - UINT8 exp_r() { return m_card ? m_card->abcbus_exp() : 0xff; } + uint8_t ops_r() { return m_card ? m_card->abcbus_ops() : 0xff; } + uint8_t exp_r() { return m_card ? m_card->abcbus_exp() : 0xff; } DECLARE_READ_LINE_MEMBER( xcsb2_r ) { return m_card ? m_card->abcbus_xcsb2() : 1; } DECLARE_READ_LINE_MEMBER( xcsb3_r ) { return m_card ? m_card->abcbus_xcsb3() : 1; } DECLARE_READ_LINE_MEMBER( xcsb4_r ) { return m_card ? m_card->abcbus_xcsb4() : 1; } diff --git a/src/devices/bus/abcbus/fd2.cpp b/src/devices/bus/abcbus/fd2.cpp index cc906c3e925..eef4ead003d 100644 --- a/src/devices/bus/abcbus/fd2.cpp +++ b/src/devices/bus/abcbus/fd2.cpp @@ -162,7 +162,7 @@ READ8_MEMBER( abc_fd2_t::pio_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_fdc->drq_r() << 5; data |= m_fdc->hld_r() << 6; @@ -276,7 +276,7 @@ machine_config_constructor abc_fd2_t::device_mconfig_additions() const // abc_fd2_t - constructor //------------------------------------------------- -abc_fd2_t::abc_fd2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc_fd2_t::abc_fd2_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC_FD2, "ABC FD2", tag, owner, clock, "abc_fd2", __FILE__), device_abcbus_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), @@ -324,7 +324,7 @@ void abc_fd2_t::device_reset() // abcbus_cs - //------------------------------------------------- -void abc_fd2_t::abcbus_cs(UINT8 data) +void abc_fd2_t::abcbus_cs(uint8_t data) { m_cs = (data == 0x2d); } @@ -334,9 +334,9 @@ void abc_fd2_t::abcbus_cs(UINT8 data) // abcbus_stat - //------------------------------------------------- -UINT8 abc_fd2_t::abcbus_stat() +uint8_t abc_fd2_t::abcbus_stat() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cs) { @@ -351,9 +351,9 @@ UINT8 abc_fd2_t::abcbus_stat() // abcbus_inp - //------------------------------------------------- -UINT8 abc_fd2_t::abcbus_inp() +uint8_t abc_fd2_t::abcbus_inp() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cs) { @@ -374,7 +374,7 @@ UINT8 abc_fd2_t::abcbus_inp() // abcbus_out - //------------------------------------------------- -void abc_fd2_t::abcbus_out(UINT8 data) +void abc_fd2_t::abcbus_out(uint8_t data) { if (!m_cs) return; @@ -392,7 +392,7 @@ void abc_fd2_t::abcbus_out(UINT8 data) // abcbus_c1 - //------------------------------------------------- -void abc_fd2_t::abcbus_c1(UINT8 data) +void abc_fd2_t::abcbus_c1(uint8_t data) { if (m_cs) { @@ -406,7 +406,7 @@ void abc_fd2_t::abcbus_c1(UINT8 data) // abcbus_c3 - //------------------------------------------------- -void abc_fd2_t::abcbus_c3(UINT8 data) +void abc_fd2_t::abcbus_c3(uint8_t data) { if (m_cs) { @@ -419,9 +419,9 @@ void abc_fd2_t::abcbus_c3(UINT8 data) // abcbus_xmemfl - //------------------------------------------------- -UINT8 abc_fd2_t::abcbus_xmemfl(offs_t offset) +uint8_t abc_fd2_t::abcbus_xmemfl(offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; if ((offset & 0xf000) == 0x6000) { diff --git a/src/devices/bus/abcbus/fd2.h b/src/devices/bus/abcbus/fd2.h index 78d5bc0c767..7ec28c10451 100644 --- a/src/devices/bus/abcbus/fd2.h +++ b/src/devices/bus/abcbus/fd2.h @@ -32,7 +32,7 @@ class abc_fd2_t : public device_t, { public: // construction/destruction - abc_fd2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc_fd2_t(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; @@ -53,13 +53,13 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; - virtual UINT8 abcbus_inp() override; - virtual void abcbus_out(UINT8 data) override; - virtual UINT8 abcbus_stat() override; - virtual void abcbus_c1(UINT8 data) override; - virtual void abcbus_c3(UINT8 data) override; - virtual UINT8 abcbus_xmemfl(offs_t offset) override; + virtual void abcbus_cs(uint8_t data) override; + virtual uint8_t abcbus_inp() override; + virtual void abcbus_out(uint8_t data) override; + virtual uint8_t abcbus_stat() override; + virtual void abcbus_c1(uint8_t data) override; + virtual void abcbus_c3(uint8_t data) override; + virtual uint8_t abcbus_xmemfl(offs_t offset) override; private: required_device m_maincpu; @@ -70,8 +70,8 @@ private: required_memory_region m_dos_rom; bool m_cs; - UINT8 m_status; - UINT8 m_data; + uint8_t m_status; + uint8_t m_data; }; diff --git a/src/devices/bus/abcbus/hdc.cpp b/src/devices/bus/abcbus/hdc.cpp index 28636376d3e..296948b59ab 100644 --- a/src/devices/bus/abcbus/hdc.cpp +++ b/src/devices/bus/abcbus/hdc.cpp @@ -111,7 +111,7 @@ machine_config_constructor abc_hdc_device::device_mconfig_additions() const // abc_hdc_device - constructor //------------------------------------------------- -abc_hdc_device::abc_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc_hdc_device::abc_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC_HDC, "ABC HDC", tag, owner, clock, "abc_hdc", __FILE__), device_abcbus_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG) @@ -146,6 +146,6 @@ void abc_hdc_device::device_reset() // abcbus_cs - //------------------------------------------------- -void abc_hdc_device::abcbus_cs(UINT8 data) +void abc_hdc_device::abcbus_cs(uint8_t data) { } diff --git a/src/devices/bus/abcbus/hdc.h b/src/devices/bus/abcbus/hdc.h index d0417be0a31..668f19a5625 100644 --- a/src/devices/bus/abcbus/hdc.h +++ b/src/devices/bus/abcbus/hdc.h @@ -30,7 +30,7 @@ class abc_hdc_device : public device_t, { public: // construction/destruction - abc_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc_hdc_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; @@ -42,7 +42,7 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override; private: required_device m_maincpu; diff --git a/src/devices/bus/abcbus/lux10828.cpp b/src/devices/bus/abcbus/lux10828.cpp index 7955b3135fd..69300ce8cf9 100644 --- a/src/devices/bus/abcbus/lux10828.cpp +++ b/src/devices/bus/abcbus/lux10828.cpp @@ -233,10 +233,10 @@ READ8_MEMBER( luxor_55_10828_device::pio_pb_r ) */ - UINT8 data = 0x04; + uint8_t data = 0x04; // single/double sided drive - UINT8 sw1 = m_sw1->read() & 0x0f; + uint8_t sw1 = m_sw1->read() & 0x0f; int ds0 = m_sel0 ? BIT(sw1, 0) : 1; int ds1 = m_sel1 ? BIT(sw1, 1) : 1; data |= !(ds0 & ds1); @@ -403,7 +403,7 @@ ioport_constructor luxor_55_10828_device::device_input_ports() const // luxor_55_10828_device - constructor //------------------------------------------------- -luxor_55_10828_device::luxor_55_10828_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +luxor_55_10828_device::luxor_55_10828_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LUXOR_55_10828, "Luxor 55 10828", tag, owner, clock, "lux10828", __FILE__), device_abcbus_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), @@ -440,7 +440,7 @@ void luxor_55_10828_device::device_start() save_item(NAME(m_sel1)); // patch out protection checks - UINT8 *rom = memregion(Z80_TAG)->base(); + uint8_t *rom = memregion(Z80_TAG)->base(); rom[0x00fa] = 0xff; rom[0x0336] = 0xff; rom[0x0718] = 0xff; @@ -469,9 +469,9 @@ void luxor_55_10828_device::device_reset() // abcbus_cs - //------------------------------------------------- -void luxor_55_10828_device::abcbus_cs(UINT8 data) +void luxor_55_10828_device::abcbus_cs(uint8_t data) { - UINT8 address = 0x2c | BIT(m_s1->read(), 0); + uint8_t address = 0x2c | BIT(m_s1->read(), 0); m_cs = (data == address); } @@ -481,9 +481,9 @@ void luxor_55_10828_device::abcbus_cs(UINT8 data) // abcbus_stat - //------------------------------------------------- -UINT8 luxor_55_10828_device::abcbus_stat() +uint8_t luxor_55_10828_device::abcbus_stat() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cs) { @@ -498,9 +498,9 @@ UINT8 luxor_55_10828_device::abcbus_stat() // abcbus_inp - //------------------------------------------------- -UINT8 luxor_55_10828_device::abcbus_inp() +uint8_t luxor_55_10828_device::abcbus_inp() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cs) { @@ -521,7 +521,7 @@ UINT8 luxor_55_10828_device::abcbus_inp() // abcbus_out - //------------------------------------------------- -void luxor_55_10828_device::abcbus_out(UINT8 data) +void luxor_55_10828_device::abcbus_out(uint8_t data) { if (!m_cs) return; @@ -539,7 +539,7 @@ void luxor_55_10828_device::abcbus_out(UINT8 data) // abcbus_c1 - //------------------------------------------------- -void luxor_55_10828_device::abcbus_c1(UINT8 data) +void luxor_55_10828_device::abcbus_c1(uint8_t data) { if (m_cs) { @@ -553,7 +553,7 @@ void luxor_55_10828_device::abcbus_c1(UINT8 data) // abcbus_c3 - //------------------------------------------------- -void luxor_55_10828_device::abcbus_c3(UINT8 data) +void luxor_55_10828_device::abcbus_c3(uint8_t data) { if (m_cs) { diff --git a/src/devices/bus/abcbus/lux10828.h b/src/devices/bus/abcbus/lux10828.h index 4be7801b873..fb90ef914c2 100644 --- a/src/devices/bus/abcbus/lux10828.h +++ b/src/devices/bus/abcbus/lux10828.h @@ -54,7 +54,7 @@ class luxor_55_10828_device : public device_t, { public: // construction/destruction - luxor_55_10828_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + luxor_55_10828_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( ctrl_w ); DECLARE_WRITE8_MEMBER( status_w ); @@ -82,12 +82,12 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; - virtual UINT8 abcbus_inp() override; - virtual void abcbus_out(UINT8 data) override; - virtual UINT8 abcbus_stat() override; - virtual void abcbus_c1(UINT8 data) override; - virtual void abcbus_c3(UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override; + virtual uint8_t abcbus_inp() override; + virtual void abcbus_out(uint8_t data) override; + virtual uint8_t abcbus_stat() override; + virtual void abcbus_c1(uint8_t data) override; + virtual void abcbus_c3(uint8_t data) override; private: required_device m_maincpu; @@ -99,8 +99,8 @@ private: required_ioport m_s1; bool m_cs; // card selected - UINT8 m_status; // ABC BUS status - UINT8 m_data; // ABC BUS data + uint8_t m_status; // ABC BUS status + uint8_t m_data; // ABC BUS data bool m_fdc_irq; // floppy interrupt bool m_fdc_drq; // floppy data request int m_wait_enable; // wait enable diff --git a/src/devices/bus/abcbus/lux21046.cpp b/src/devices/bus/abcbus/lux21046.cpp index a6187c278ed..6286f071487 100644 --- a/src/devices/bus/abcbus/lux21046.cpp +++ b/src/devices/bus/abcbus/lux21046.cpp @@ -742,7 +742,7 @@ ioport_constructor abc850_floppy_device::device_input_ports() const // luxor_55_21046_device - constructor //------------------------------------------------- -luxor_55_21046_device::luxor_55_21046_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +luxor_55_21046_device::luxor_55_21046_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LUXOR_55_21046, "Luxor 55 21046", tag, owner, clock, "lux21046", __FILE__), device_abcbus_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), @@ -762,7 +762,7 @@ luxor_55_21046_device::luxor_55_21046_device(const machine_config &mconfig, cons { } -luxor_55_21046_device::luxor_55_21046_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) +luxor_55_21046_device::luxor_55_21046_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_abcbus_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), @@ -782,27 +782,27 @@ luxor_55_21046_device::luxor_55_21046_device(const machine_config &mconfig, devi { } -abc830_device::abc830_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc830_device::abc830_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : luxor_55_21046_device(mconfig, ABC830, "ABC 830", tag, owner, clock, "abc830", __FILE__) { } -abc832_device::abc832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc832_device::abc832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : luxor_55_21046_device(mconfig, ABC832, "ABC 832", tag, owner, clock, "abc832", __FILE__) { } -abc834_device::abc834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc834_device::abc834_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : luxor_55_21046_device(mconfig, ABC834, "ABC 834", tag, owner, clock, "abc834", __FILE__) { } -abc838_device::abc838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc838_device::abc838_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : luxor_55_21046_device(mconfig, ABC838, "ABC 838", tag, owner, clock, "abc838", __FILE__) { } -abc850_floppy_device::abc850_floppy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc850_floppy_device::abc850_floppy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : luxor_55_21046_device(mconfig, ABC850_FLOPPY, "ABC 850 floppy", tag, owner, clock, "lux21046", __FILE__) { } @@ -853,7 +853,7 @@ void luxor_55_21046_device::device_reset() // abcbus_cs - //------------------------------------------------- -void luxor_55_21046_device::abcbus_cs(UINT8 data) +void luxor_55_21046_device::abcbus_cs(uint8_t data) { m_cs = (data == m_sw3->read()); } @@ -873,7 +873,7 @@ int luxor_55_21046_device::abcbus_csb() // abcbus_stat - //------------------------------------------------- -UINT8 luxor_55_21046_device::abcbus_stat() +uint8_t luxor_55_21046_device::abcbus_stat() { /* @@ -890,7 +890,7 @@ UINT8 luxor_55_21046_device::abcbus_stat() */ - UINT8 data = 0; + uint8_t data = 0; if (m_cs) { @@ -906,9 +906,9 @@ UINT8 luxor_55_21046_device::abcbus_stat() // abcbus_inp - //------------------------------------------------- -UINT8 luxor_55_21046_device::abcbus_inp() +uint8_t luxor_55_21046_device::abcbus_inp() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cs) { @@ -924,7 +924,7 @@ UINT8 luxor_55_21046_device::abcbus_inp() // abcbus_out - //------------------------------------------------- -void luxor_55_21046_device::abcbus_out(UINT8 data) +void luxor_55_21046_device::abcbus_out(uint8_t data) { if (m_cs) { @@ -938,7 +938,7 @@ void luxor_55_21046_device::abcbus_out(UINT8 data) // abcbus_c1 - //------------------------------------------------- -void luxor_55_21046_device::abcbus_c1(UINT8 data) +void luxor_55_21046_device::abcbus_c1(uint8_t data) { if (m_cs) { @@ -952,7 +952,7 @@ void luxor_55_21046_device::abcbus_c1(UINT8 data) // abcbus_c3 - //------------------------------------------------- -void luxor_55_21046_device::abcbus_c3(UINT8 data) +void luxor_55_21046_device::abcbus_c3(uint8_t data) { if (m_cs) { @@ -965,7 +965,7 @@ void luxor_55_21046_device::abcbus_c3(UINT8 data) // abcbus_c4 - //------------------------------------------------- -void luxor_55_21046_device::abcbus_c4(UINT8 data) +void luxor_55_21046_device::abcbus_c4(uint8_t data) { // TODO connected to PAL16R4 pin 2 } @@ -1138,7 +1138,7 @@ READ8_MEMBER( luxor_55_21046_device::_9a_r ) */ - UINT8 data = 0; + uint8_t data = 0; // busy data |= m_busy; @@ -1148,7 +1148,7 @@ READ8_MEMBER( luxor_55_21046_device::_9a_r ) //data |= (m_floppy ? m_floppy->dskchg_r() : 1) << 4; // SW2 - UINT8 sw2 = m_sw2->read() & 0x0f; + uint8_t sw2 = m_sw2->read() & 0x0f; int sw2_1 = BIT(sw2, 0) ? 1 : BIT(offset, 8); int sw2_2 = BIT(sw2, 1) ? 1 : BIT(offset, 9); diff --git a/src/devices/bus/abcbus/lux21046.h b/src/devices/bus/abcbus/lux21046.h index d63d02d8ebb..aabd9cb5404 100644 --- a/src/devices/bus/abcbus/lux21046.h +++ b/src/devices/bus/abcbus/lux21046.h @@ -53,8 +53,8 @@ class luxor_55_21046_device : public device_t, { public: // construction/destruction - luxor_55_21046_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); - luxor_55_21046_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + luxor_55_21046_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); + luxor_55_21046_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; @@ -86,14 +86,14 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override; virtual int abcbus_csb() override; - virtual UINT8 abcbus_inp() override; - virtual void abcbus_out(UINT8 data) override; - virtual UINT8 abcbus_stat() override; - virtual void abcbus_c1(UINT8 data) override; - virtual void abcbus_c3(UINT8 data) override; - virtual void abcbus_c4(UINT8 data) override; + virtual uint8_t abcbus_inp() override; + virtual void abcbus_out(uint8_t data) override; + virtual uint8_t abcbus_stat() override; + virtual void abcbus_c1(uint8_t data) override; + virtual void abcbus_c3(uint8_t data) override; + virtual void abcbus_c4(uint8_t data) override; private: required_device m_maincpu; @@ -107,9 +107,9 @@ private: required_ioport m_sw3; bool m_cs; // card selected - UINT8 m_status; // ABC BUS status - UINT8 m_out; // ABC BUS data in - UINT8 m_inp; // ABC BUS data out + uint8_t m_status; // ABC BUS status + uint8_t m_out; // ABC BUS data in + uint8_t m_inp; // ABC BUS data out bool m_fdc_irq; // FDC interrupt int m_dma_irq; // DMA interrupt int m_busy; // busy bit @@ -123,7 +123,7 @@ class abc830_device : public luxor_55_21046_device { public: // construction/destruction - abc830_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc830_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; @@ -137,7 +137,7 @@ class abc832_device : public luxor_55_21046_device { public: // construction/destruction - abc832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc832_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; @@ -151,7 +151,7 @@ class abc834_device : public luxor_55_21046_device { public: // construction/destruction - abc834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc834_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; @@ -165,7 +165,7 @@ class abc838_device : public luxor_55_21046_device { public: // construction/destruction - abc838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc838_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; @@ -179,7 +179,7 @@ class abc850_floppy_device : public luxor_55_21046_device { public: // construction/destruction - abc850_floppy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc850_floppy_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; diff --git a/src/devices/bus/abcbus/lux21056.cpp b/src/devices/bus/abcbus/lux21056.cpp index f84d5b18414..7b05cbdfff8 100644 --- a/src/devices/bus/abcbus/lux21056.cpp +++ b/src/devices/bus/abcbus/lux21056.cpp @@ -337,7 +337,7 @@ ioport_constructor luxor_55_21056_device::device_input_ports() const // luxor_55_21056_device - constructor //------------------------------------------------- -luxor_55_21056_device::luxor_55_21056_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +luxor_55_21056_device::luxor_55_21056_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LUXOR_55_21056, "Luxor 55 21056", tag, owner, clock, "lux21056", __FILE__), device_abcbus_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), @@ -405,7 +405,7 @@ void luxor_55_21056_device::device_reset() // abcbus_cs - //------------------------------------------------- -void luxor_55_21056_device::abcbus_cs(UINT8 data) +void luxor_55_21056_device::abcbus_cs(uint8_t data) { m_cs = (data == m_s1->read()); } @@ -415,9 +415,9 @@ void luxor_55_21056_device::abcbus_cs(UINT8 data) // abcbus_stat - //------------------------------------------------- -UINT8 luxor_55_21056_device::abcbus_stat() +uint8_t luxor_55_21056_device::abcbus_stat() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cs) { @@ -433,9 +433,9 @@ UINT8 luxor_55_21056_device::abcbus_stat() // abcbus_inp - //------------------------------------------------- -UINT8 luxor_55_21056_device::abcbus_inp() +uint8_t luxor_55_21056_device::abcbus_inp() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cs && !STAT_DIR) { @@ -452,7 +452,7 @@ UINT8 luxor_55_21056_device::abcbus_inp() // abcbus_out - //------------------------------------------------- -void luxor_55_21056_device::abcbus_out(UINT8 data) +void luxor_55_21056_device::abcbus_out(uint8_t data) { if (m_cs) { @@ -467,7 +467,7 @@ void luxor_55_21056_device::abcbus_out(UINT8 data) // abcbus_c1 - //------------------------------------------------- -void luxor_55_21056_device::abcbus_c1(UINT8 data) +void luxor_55_21056_device::abcbus_c1(uint8_t data) { if (m_cs) { @@ -481,7 +481,7 @@ void luxor_55_21056_device::abcbus_c1(UINT8 data) // abcbus_c3 - //------------------------------------------------- -void luxor_55_21056_device::abcbus_c3(UINT8 data) +void luxor_55_21056_device::abcbus_c3(uint8_t data) { if (m_cs) { @@ -511,7 +511,7 @@ READ8_MEMBER( luxor_55_21056_device::sasi_status_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_rdy ^ STAT_DIR; @@ -543,7 +543,7 @@ WRITE8_MEMBER( luxor_55_21056_device::stat_w ) READ8_MEMBER( luxor_55_21056_device::out_r ) { - UINT8 data = m_out; + uint8_t data = m_out; if (STAT_DIR && m_rdy) set_rdy(!m_rdy); @@ -569,7 +569,7 @@ WRITE8_MEMBER( luxor_55_21056_device::inp_w ) READ8_MEMBER( luxor_55_21056_device::sasi_data_r ) { - UINT8 data = m_sasi_data_in->read(); + uint8_t data = m_sasi_data_in->read(); m_sasibus->write_ack(!m_sasi_req); diff --git a/src/devices/bus/abcbus/lux21056.h b/src/devices/bus/abcbus/lux21056.h index 769bc9ad93e..0e1d04073b3 100644 --- a/src/devices/bus/abcbus/lux21056.h +++ b/src/devices/bus/abcbus/lux21056.h @@ -31,7 +31,7 @@ class luxor_55_21056_device : public device_t, { public: // construction/destruction - luxor_55_21056_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + luxor_55_21056_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; @@ -68,12 +68,12 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; - virtual UINT8 abcbus_inp() override; - virtual void abcbus_out(UINT8 data) override; - virtual UINT8 abcbus_stat() override; - virtual void abcbus_c1(UINT8 data) override; - virtual void abcbus_c3(UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override; + virtual uint8_t abcbus_inp() override; + virtual void abcbus_out(uint8_t data) override; + virtual uint8_t abcbus_stat() override; + virtual void abcbus_c1(uint8_t data) override; + virtual void abcbus_c3(uint8_t data) override; private: void set_rdy(int state); @@ -93,10 +93,10 @@ private: int m_sasi_msg; int m_sasi_bsy; - UINT8 m_inp; - UINT8 m_out; - UINT8 m_stat; - UINT8 m_sasi_data; + uint8_t m_inp; + uint8_t m_out; + uint8_t m_stat; + uint8_t m_sasi_data; }; diff --git a/src/devices/bus/abcbus/lux4105.cpp b/src/devices/bus/abcbus/lux4105.cpp index 3f5c5ea76f5..8cc4ffb193d 100644 --- a/src/devices/bus/abcbus/lux4105.cpp +++ b/src/devices/bus/abcbus/lux4105.cpp @@ -174,7 +174,7 @@ inline void luxor_4105_device::update_trrq_int() // luxor_4105_device - constructor //------------------------------------------------- -luxor_4105_device::luxor_4105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +luxor_4105_device::luxor_4105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LUXOR_4105, "Luxor 4105", tag, owner, clock, "lux4105", __FILE__), device_abcbus_card_interface(mconfig, *this), m_sasibus(*this, SASIBUS_TAG), @@ -227,7 +227,7 @@ void luxor_4105_device::device_reset() // abcbus_cs - //------------------------------------------------- -void luxor_4105_device::abcbus_cs(UINT8 data) +void luxor_4105_device::abcbus_cs(uint8_t data) { m_cs = (data == m_5e->read()); } @@ -247,9 +247,9 @@ int luxor_4105_device::abcbus_csb() // abcbus_stat - //------------------------------------------------- -UINT8 luxor_4105_device::abcbus_stat() +uint8_t luxor_4105_device::abcbus_stat() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cs) { @@ -282,9 +282,9 @@ UINT8 luxor_4105_device::abcbus_stat() // abcbus_inp - //------------------------------------------------- -UINT8 luxor_4105_device::abcbus_inp() +uint8_t luxor_4105_device::abcbus_inp() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cs) { @@ -314,7 +314,7 @@ UINT8 luxor_4105_device::abcbus_inp() // abcbus_utp - //------------------------------------------------- -void luxor_4105_device::abcbus_out(UINT8 data) +void luxor_4105_device::abcbus_out(uint8_t data) { if (m_cs) { @@ -337,7 +337,7 @@ void luxor_4105_device::abcbus_out(UINT8 data) // abcbus_c1 - //------------------------------------------------- -void luxor_4105_device::abcbus_c1(UINT8 data) +void luxor_4105_device::abcbus_c1(uint8_t data) { if (m_cs) { @@ -350,7 +350,7 @@ void luxor_4105_device::abcbus_c1(UINT8 data) // abcbus_c3 - //------------------------------------------------- -void luxor_4105_device::abcbus_c3(UINT8 data) +void luxor_4105_device::abcbus_c3(uint8_t data) { if (m_cs) { @@ -367,7 +367,7 @@ void luxor_4105_device::abcbus_c3(UINT8 data) // abcbus_c4 - //------------------------------------------------- -void luxor_4105_device::abcbus_c4(UINT8 data) +void luxor_4105_device::abcbus_c4(uint8_t data) { if (m_cs) { diff --git a/src/devices/bus/abcbus/lux4105.h b/src/devices/bus/abcbus/lux4105.h index b1c2731db8d..657f756d74c 100644 --- a/src/devices/bus/abcbus/lux4105.h +++ b/src/devices/bus/abcbus/lux4105.h @@ -37,7 +37,7 @@ class luxor_4105_device : public device_t, { public: // construction/destruction - luxor_4105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + luxor_4105_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; @@ -55,14 +55,14 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override; virtual int abcbus_csb() override; - virtual UINT8 abcbus_inp() override; - virtual void abcbus_out(UINT8 data) override; - virtual UINT8 abcbus_stat() override; - virtual void abcbus_c1(UINT8 data) override; - virtual void abcbus_c3(UINT8 data) override; - virtual void abcbus_c4(UINT8 data) override; + virtual uint8_t abcbus_inp() override; + virtual void abcbus_out(uint8_t data) override; + virtual uint8_t abcbus_stat() override; + virtual void abcbus_c1(uint8_t data) override; + virtual void abcbus_c3(uint8_t data) override; + virtual void abcbus_c4(uint8_t data) override; private: inline void update_trrq_int(); @@ -74,8 +74,8 @@ private: required_ioport m_5e; bool m_cs; - UINT8 m_data; - UINT8 m_dma; + uint8_t m_data; + uint8_t m_dma; int m_sasi_bsy; bool m_sasi_req; diff --git a/src/devices/bus/abcbus/memcard.cpp b/src/devices/bus/abcbus/memcard.cpp index 9195f3b135b..945dd5382c6 100644 --- a/src/devices/bus/abcbus/memcard.cpp +++ b/src/devices/bus/abcbus/memcard.cpp @@ -109,7 +109,7 @@ const tiny_rom_entry *abc_memory_card_t::device_rom_region() const // abc_memory_card_t - constructor //------------------------------------------------- -abc_memory_card_t::abc_memory_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc_memory_card_t::abc_memory_card_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC_MEMORY_CARD, "ABC Memory Card", tag, owner, clock, "abc_mem", __FILE__), device_abcbus_card_interface(mconfig, *this), m_dos_rom(*this, "dos"), @@ -138,9 +138,9 @@ void abc_memory_card_t::device_start() // abcbus_xmemfl - //------------------------------------------------- -UINT8 abc_memory_card_t::abcbus_xmemfl(offs_t offset) +uint8_t abc_memory_card_t::abcbus_xmemfl(offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset >= 0x6000 && offset < 0x7000) { diff --git a/src/devices/bus/abcbus/memcard.h b/src/devices/bus/abcbus/memcard.h index a9e0e349ca7..f94f484b350 100644 --- a/src/devices/bus/abcbus/memcard.h +++ b/src/devices/bus/abcbus/memcard.h @@ -27,7 +27,7 @@ class abc_memory_card_t : public device_t, { public: // construction/destruction - abc_memory_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc_memory_card_t(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; @@ -37,8 +37,8 @@ protected: virtual void device_start() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override { }; - virtual UINT8 abcbus_xmemfl(offs_t offset) override; + virtual void abcbus_cs(uint8_t data) override { }; + virtual uint8_t abcbus_xmemfl(offs_t offset) override; private: required_memory_region m_dos_rom; diff --git a/src/devices/bus/abcbus/ram.cpp b/src/devices/bus/abcbus/ram.cpp index a91e29bd9c7..6ff3935b4f7 100644 --- a/src/devices/bus/abcbus/ram.cpp +++ b/src/devices/bus/abcbus/ram.cpp @@ -26,7 +26,7 @@ const device_type ABC80_16KB_RAM_CARD = &device_creator; // abc80_16kb_ram_card_t - constructor //------------------------------------------------- -abc80_16kb_ram_card_t::abc80_16kb_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc80_16kb_ram_card_t::abc80_16kb_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC80_16KB_RAM_CARD, "ABC 80 16KB RAM card", tag, owner, clock, "abc80_16kb", __FILE__), device_abcbus_card_interface(mconfig, *this), m_ram(*this, "ram") @@ -53,9 +53,9 @@ void abc80_16kb_ram_card_t::device_start() // abcbus_xmemfl - //------------------------------------------------- -UINT8 abc80_16kb_ram_card_t::abcbus_xmemfl(offs_t offset) +uint8_t abc80_16kb_ram_card_t::abcbus_xmemfl(offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset >= 0x8000 && offset < 0xc000) { @@ -70,7 +70,7 @@ UINT8 abc80_16kb_ram_card_t::abcbus_xmemfl(offs_t offset) // abcbus_xmemw - //------------------------------------------------- -void abc80_16kb_ram_card_t::abcbus_xmemw(offs_t offset, UINT8 data) +void abc80_16kb_ram_card_t::abcbus_xmemw(offs_t offset, uint8_t data) { if (offset >= 0x8000 && offset < 0xc000) { diff --git a/src/devices/bus/abcbus/ram.h b/src/devices/bus/abcbus/ram.h index 1be225d3008..fa53f5e1e3e 100644 --- a/src/devices/bus/abcbus/ram.h +++ b/src/devices/bus/abcbus/ram.h @@ -27,19 +27,19 @@ class abc80_16kb_ram_card_t : public device_t, { public: // construction/destruction - abc80_16kb_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc80_16kb_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override { }; - virtual UINT8 abcbus_xmemfl(offs_t offset) override; - virtual void abcbus_xmemw(offs_t offset, UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override { }; + virtual uint8_t abcbus_xmemfl(offs_t offset) override; + virtual void abcbus_xmemw(offs_t offset, uint8_t data) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; }; diff --git a/src/devices/bus/abcbus/sio.cpp b/src/devices/bus/abcbus/sio.cpp index bf1c733281d..90f543b7e6a 100644 --- a/src/devices/bus/abcbus/sio.cpp +++ b/src/devices/bus/abcbus/sio.cpp @@ -101,7 +101,7 @@ machine_config_constructor abc_sio_device::device_mconfig_additions() const // abc_sio_device - constructor //------------------------------------------------- -abc_sio_device::abc_sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc_sio_device::abc_sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC_SIO, "ABC SIO", tag, owner, clock, "abcsio", __FILE__), device_abcbus_card_interface(mconfig, *this), m_ctc(*this, Z80CTC_TAG), @@ -138,7 +138,7 @@ void abc_sio_device::device_reset() // abcbus_cs - //------------------------------------------------- -void abc_sio_device::abcbus_cs(UINT8 data) +void abc_sio_device::abcbus_cs(uint8_t data) { } @@ -147,9 +147,9 @@ void abc_sio_device::abcbus_cs(UINT8 data) // abcbus_xmemfl - //------------------------------------------------- -UINT8 abc_sio_device::abcbus_xmemfl(offs_t offset) +uint8_t abc_sio_device::abcbus_xmemfl(offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset >= 0x4000 && offset < 0x5000) // TODO where is this mapped? { diff --git a/src/devices/bus/abcbus/sio.h b/src/devices/bus/abcbus/sio.h index 991de18f0ed..52f18c4be73 100644 --- a/src/devices/bus/abcbus/sio.h +++ b/src/devices/bus/abcbus/sio.h @@ -23,7 +23,7 @@ class abc_sio_device : public device_t, { public: // construction/destruction - abc_sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc_sio_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; @@ -35,8 +35,8 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; - virtual UINT8 abcbus_xmemfl(offs_t offset) override; + virtual void abcbus_cs(uint8_t data) override; + virtual uint8_t abcbus_xmemfl(offs_t offset) override; private: required_device m_ctc; diff --git a/src/devices/bus/abcbus/slutprov.cpp b/src/devices/bus/abcbus/slutprov.cpp index b10415badca..4497c8827ff 100644 --- a/src/devices/bus/abcbus/slutprov.cpp +++ b/src/devices/bus/abcbus/slutprov.cpp @@ -40,7 +40,7 @@ const tiny_rom_entry *abc_slutprov_device::device_rom_region() const // abc_slutprov_device - constructor //------------------------------------------------- -abc_slutprov_device::abc_slutprov_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc_slutprov_device::abc_slutprov_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC_SLUTPROV, "Slutprov", tag, owner, clock, "slutprov", __FILE__), device_abcbus_card_interface(mconfig, *this) { @@ -74,6 +74,6 @@ void abc_slutprov_device::device_reset() // abcbus_cs - //------------------------------------------------- -void abc_slutprov_device::abcbus_cs(UINT8 data) +void abc_slutprov_device::abcbus_cs(uint8_t data) { } diff --git a/src/devices/bus/abcbus/slutprov.h b/src/devices/bus/abcbus/slutprov.h index bb4c6262c43..710fc730f0c 100644 --- a/src/devices/bus/abcbus/slutprov.h +++ b/src/devices/bus/abcbus/slutprov.h @@ -21,7 +21,7 @@ class abc_slutprov_device : public device_t, { public: // construction/destruction - abc_slutprov_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc_slutprov_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; @@ -32,7 +32,7 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override; }; diff --git a/src/devices/bus/abcbus/turbo.cpp b/src/devices/bus/abcbus/turbo.cpp index ecf035d432f..8377b8e9b04 100644 --- a/src/devices/bus/abcbus/turbo.cpp +++ b/src/devices/bus/abcbus/turbo.cpp @@ -109,7 +109,7 @@ machine_config_constructor turbo_kontroller_device::device_mconfig_additions() c // turbo_kontroller_device - constructor //------------------------------------------------- -turbo_kontroller_device::turbo_kontroller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +turbo_kontroller_device::turbo_kontroller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TURBO_KONTROLLER, "Turbo-Kontroller", tag, owner, clock, "unidisk", __FILE__), device_abcbus_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG) @@ -144,6 +144,6 @@ void turbo_kontroller_device::device_reset() // abcbus_cs - //------------------------------------------------- -void turbo_kontroller_device::abcbus_cs(UINT8 data) +void turbo_kontroller_device::abcbus_cs(uint8_t data) { } diff --git a/src/devices/bus/abcbus/turbo.h b/src/devices/bus/abcbus/turbo.h index 9423f095f9f..192094ac0b9 100644 --- a/src/devices/bus/abcbus/turbo.h +++ b/src/devices/bus/abcbus/turbo.h @@ -29,7 +29,7 @@ class turbo_kontroller_device : public device_t, { public: // construction/destruction - turbo_kontroller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + turbo_kontroller_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; @@ -41,7 +41,7 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override; private: required_device m_maincpu; diff --git a/src/devices/bus/abcbus/uni800.cpp b/src/devices/bus/abcbus/uni800.cpp index d3657841e90..90dd6dfdb78 100644 --- a/src/devices/bus/abcbus/uni800.cpp +++ b/src/devices/bus/abcbus/uni800.cpp @@ -71,7 +71,7 @@ const tiny_rom_entry *abc_uni800_device::device_rom_region() const // abc_uni800_device - constructor //------------------------------------------------- -abc_uni800_device::abc_uni800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +abc_uni800_device::abc_uni800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC_UNI800, "UNI-800", tag, owner, clock, "uni800", __FILE__), device_abcbus_card_interface(mconfig, *this) { @@ -105,6 +105,6 @@ void abc_uni800_device::device_reset() // abcbus_cs - //------------------------------------------------- -void abc_uni800_device::abcbus_cs(UINT8 data) +void abc_uni800_device::abcbus_cs(uint8_t data) { } diff --git a/src/devices/bus/abcbus/uni800.h b/src/devices/bus/abcbus/uni800.h index bc298f6d6c0..1c4b0354f69 100644 --- a/src/devices/bus/abcbus/uni800.h +++ b/src/devices/bus/abcbus/uni800.h @@ -21,7 +21,7 @@ class abc_uni800_device : public device_t, { public: // construction/destruction - abc_uni800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc_uni800_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; @@ -32,7 +32,7 @@ protected: virtual void device_reset() override; // device_abcbus_interface overrides - virtual void abcbus_cs(UINT8 data) override; + virtual void abcbus_cs(uint8_t data) override; }; diff --git a/src/devices/bus/abckb/abc77.cpp b/src/devices/bus/abckb/abc77.cpp index 1b62094f18e..bb02fb07f9c 100644 --- a/src/devices/bus/abckb/abc77.cpp +++ b/src/devices/bus/abckb/abc77.cpp @@ -422,7 +422,7 @@ inline void abc77_device::key_down(int state) // abc77_device - constructor //------------------------------------------------- -abc77_device::abc77_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) : +abc77_device::abc77_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), abc_keyboard_interface(mconfig, *this), m_maincpu(*this, I8035_TAG), @@ -437,10 +437,10 @@ abc77_device::abc77_device(const machine_config &mconfig, device_type type, cons { } -abc55_device::abc55_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc55_device::abc55_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : abc77_device(mconfig, ABC55, "Luxor ABC 55", tag, owner, clock, "abc55", __FILE__) { } -abc77_device::abc77_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc77_device::abc77_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : abc77_device(mconfig, ABC77, "Luxor ABC 77", tag, owner, clock, "abc77", __FILE__) { } @@ -527,7 +527,7 @@ READ8_MEMBER( abc77_device::p1_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_stb) { diff --git a/src/devices/bus/abckb/abc77.h b/src/devices/bus/abckb/abc77.h index b3d40b36ac7..63d72fd382b 100644 --- a/src/devices/bus/abckb/abc77.h +++ b/src/devices/bus/abckb/abc77.h @@ -31,8 +31,8 @@ class abc77_device : public device_t, { public: // construction/destruction - abc77_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); - abc77_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc77_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); + abc77_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; @@ -79,7 +79,7 @@ protected: int m_hys; // hysteresis int m_reset; // reset int m_stb; // strobe - UINT8 m_j3; + uint8_t m_j3; // timers emu_timer *m_serial_timer; @@ -91,7 +91,7 @@ class abc55_device : public abc77_device { public: // construction/destruction - abc55_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc55_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/abckb/abc800kb.cpp b/src/devices/bus/abckb/abc800kb.cpp index 123843efd05..bf0c3aa4b78 100644 --- a/src/devices/bus/abckb/abc800kb.cpp +++ b/src/devices/bus/abckb/abc800kb.cpp @@ -332,7 +332,7 @@ inline void abc800_keyboard_device::key_down(int state) // abc800_keyboard_device - constructor //------------------------------------------------- -abc800_keyboard_device::abc800_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, ABC800_KEYBOARD, "ABC-800 Keyboard", tag, owner, clock, "abc800kb", __FILE__), +abc800_keyboard_device::abc800_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC800_KEYBOARD, "ABC-800 Keyboard", tag, owner, clock, "abc800kb", __FILE__), abc_keyboard_interface(mconfig, *this), m_maincpu(*this, I8048_TAG), m_x(*this, "X%u", 0), @@ -400,7 +400,7 @@ void abc800_keyboard_device::txd_w(int state) READ8_MEMBER( abc800_keyboard_device::kb_p1_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_stb) { diff --git a/src/devices/bus/abckb/abc800kb.h b/src/devices/bus/abckb/abc800kb.h index 10332c96a6e..b6290037e4d 100644 --- a/src/devices/bus/abckb/abc800kb.h +++ b/src/devices/bus/abckb/abc800kb.h @@ -30,7 +30,7 @@ class abc800_keyboard_device : public device_t, { public: // construction/destruction - abc800_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc800_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; diff --git a/src/devices/bus/abckb/abc99.cpp b/src/devices/bus/abckb/abc99.cpp index eb3ed258968..d932adce646 100644 --- a/src/devices/bus/abckb/abc99.cpp +++ b/src/devices/bus/abckb/abc99.cpp @@ -485,7 +485,7 @@ inline void abc99_device::scan_mouse() // abc99_device - constructor //------------------------------------------------- -abc99_device::abc99_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc99_device::abc99_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC99, "Luxor ABC 99", tag, owner, clock, "abc99", __FILE__), abc_keyboard_interface(mconfig, *this), m_serial_timer(nullptr), m_mouse_timer(nullptr), m_maincpu(*this, I8035_Z2_TAG), @@ -664,7 +664,7 @@ READ8_MEMBER( abc99_device::z2_p2_r ) */ - UINT8 data = m_z14->read() << 5; + uint8_t data = m_z14->read() << 5; return data; } @@ -711,7 +711,7 @@ READ8_MEMBER( abc99_device::z5_p1_r ) */ - UINT8 data = 0; + uint8_t data = 0; // mouse buttons data |= (m_mouseb->read() & 0x07) << 4; diff --git a/src/devices/bus/abckb/abc99.h b/src/devices/bus/abckb/abc99.h index 5002039cf93..d6eaf6a43b4 100644 --- a/src/devices/bus/abckb/abc99.h +++ b/src/devices/bus/abckb/abc99.h @@ -29,7 +29,7 @@ class abc99_device : public device_t, { public: // construction/destruction - abc99_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc99_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; diff --git a/src/devices/bus/abckb/abckb.cpp b/src/devices/bus/abckb/abckb.cpp index 6eeab0fdc67..c489206024a 100644 --- a/src/devices/bus/abckb/abckb.cpp +++ b/src/devices/bus/abckb/abckb.cpp @@ -42,7 +42,7 @@ abc_keyboard_interface::abc_keyboard_interface(const machine_config &mconfig, de // abc_keyboard_port_device - constructor //------------------------------------------------- -abc_keyboard_port_device::abc_keyboard_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc_keyboard_port_device::abc_keyboard_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC_KEYBOARD_PORT, "Luxor ABC keyboard port", tag, owner, clock, "abc_keyboard_port", __FILE__), device_slot_interface(mconfig, *this), m_out_rx_handler(*this), diff --git a/src/devices/bus/abckb/abckb.h b/src/devices/bus/abckb/abckb.h index 513350acc53..b45131da73d 100644 --- a/src/devices/bus/abckb/abckb.h +++ b/src/devices/bus/abckb/abckb.h @@ -45,7 +45,7 @@ class abc_keyboard_port_device : public device_t, { public: // construction/destruction - abc_keyboard_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc_keyboard_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_rx_handler(device_t &device, _Object object) { return downcast(device).m_out_rx_handler.set_callback(object); } template static devcb_base &set_out_trxc_handler(device_t &device, _Object object) { return downcast(device).m_out_trxc_handler.set_callback(object); } diff --git a/src/devices/bus/adam/adamlink.cpp b/src/devices/bus/adam/adamlink.cpp index 1ae12b1156f..b6e0895a806 100644 --- a/src/devices/bus/adam/adamlink.cpp +++ b/src/devices/bus/adam/adamlink.cpp @@ -26,7 +26,7 @@ const device_type ADAMLINK = &device_creator; // adamlink_device - constructor //------------------------------------------------- -adamlink_device::adamlink_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adamlink_device::adamlink_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAMLINK, "AdamLink modem", tag, owner, clock, "adamlink", __FILE__), device_adam_expansion_slot_card_interface(mconfig, *this) { @@ -46,7 +46,7 @@ void adamlink_device::device_start() // adam_bd_r - buffered data read //------------------------------------------------- -UINT8 adamlink_device::adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +uint8_t adamlink_device::adam_bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { if (!biorq) { @@ -68,7 +68,7 @@ UINT8 adamlink_device::adam_bd_r(address_space &space, offs_t offset, UINT8 data // adam_bd_w - buffered data write //------------------------------------------------- -void adamlink_device::adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +void adamlink_device::adam_bd_w(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { if (!biorq) { diff --git a/src/devices/bus/adam/adamlink.h b/src/devices/bus/adam/adamlink.h index 25818966ef6..978d68d0717 100644 --- a/src/devices/bus/adam/adamlink.h +++ b/src/devices/bus/adam/adamlink.h @@ -27,15 +27,15 @@ class adamlink_device : public device_t, { public: // construction/destruction - adamlink_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adamlink_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_adam_expansion_slot_card_interface overrides - virtual UINT8 adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; - virtual void adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; + virtual uint8_t adam_bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; + virtual void adam_bd_w(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; }; diff --git a/src/devices/bus/adam/exp.cpp b/src/devices/bus/adam/exp.cpp index f82d9b4555f..11879534b55 100644 --- a/src/devices/bus/adam/exp.cpp +++ b/src/devices/bus/adam/exp.cpp @@ -51,7 +51,7 @@ device_adam_expansion_slot_card_interface::device_adam_expansion_slot_card_inter // adam_expansion_slot_device - constructor //------------------------------------------------- -adam_expansion_slot_device::adam_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +adam_expansion_slot_device::adam_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAM_EXPANSION_SLOT, "ADAM expansion slot", tag, owner, clock, "adam_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), @@ -122,7 +122,7 @@ std::string adam_expansion_slot_device::get_default_card_software() // bd_r - buffered data read //------------------------------------------------- -UINT8 adam_expansion_slot_device::bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +uint8_t adam_expansion_slot_device::bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { if (m_card != nullptr) { @@ -137,7 +137,7 @@ UINT8 adam_expansion_slot_device::bd_r(address_space &space, offs_t offset, UINT // cd_w - cartridge data write //------------------------------------------------- -void adam_expansion_slot_device::bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +void adam_expansion_slot_device::bd_w(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { if (m_card != nullptr) { diff --git a/src/devices/bus/adam/exp.h b/src/devices/bus/adam/exp.h index f1b004d67a8..63a17d2c23a 100644 --- a/src/devices/bus/adam/exp.h +++ b/src/devices/bus/adam/exp.h @@ -53,14 +53,14 @@ class adam_expansion_slot_device : public device_t, { public: // construction/destruction - adam_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adam_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~adam_expansion_slot_device() { } template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } // computer interface - UINT8 bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2); - void bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2); + uint8_t bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2); + void bd_w(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2); // cartridge interface DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_write_irq(state); } @@ -107,12 +107,12 @@ public: protected: // runtime - virtual UINT8 adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { return data; } - virtual void adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { } + virtual uint8_t adam_bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { return data; } + virtual void adam_bd_w(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { } adam_expansion_slot_device *m_slot; - optional_shared_ptr m_rom; + optional_shared_ptr m_rom; }; diff --git a/src/devices/bus/adam/ide.cpp b/src/devices/bus/adam/ide.cpp index ad3f56159e3..a20a7ec59bd 100644 --- a/src/devices/bus/adam/ide.cpp +++ b/src/devices/bus/adam/ide.cpp @@ -88,7 +88,7 @@ machine_config_constructor powermate_ide_device::device_mconfig_additions() cons // powermate_ide_device - constructor //------------------------------------------------- -powermate_ide_device::powermate_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +powermate_ide_device::powermate_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAM_IDE, "Powermate HP IDE", tag, owner, clock, "adam_ide", __FILE__), device_adam_expansion_slot_card_interface(mconfig, *this), m_ata(*this, ATA_TAG), @@ -110,7 +110,7 @@ void powermate_ide_device::device_start() // adam_bd_r - buffered data read //------------------------------------------------- -UINT8 powermate_ide_device::adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +uint8_t powermate_ide_device::adam_bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { if (!biorq) { @@ -171,7 +171,7 @@ UINT8 powermate_ide_device::adam_bd_r(address_space &space, offs_t offset, UINT8 // adam_bd_w - buffered data write //------------------------------------------------- -void powermate_ide_device::adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +void powermate_ide_device::adam_bd_w(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { if (!biorq) { diff --git a/src/devices/bus/adam/ide.h b/src/devices/bus/adam/ide.h index 4f29001b8d9..53eb653380e 100644 --- a/src/devices/bus/adam/ide.h +++ b/src/devices/bus/adam/ide.h @@ -29,7 +29,7 @@ class powermate_ide_device : public device_t, { public: // construction/destruction - powermate_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + powermate_ide_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; @@ -40,14 +40,14 @@ protected: virtual void device_start() override; // device_adam_expansion_slot_card_interface overrides - virtual UINT8 adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; - virtual void adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; + virtual uint8_t adam_bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; + virtual void adam_bd_w(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; private: required_device m_ata; required_device m_cent_data_out; - UINT16 m_ata_data; + uint16_t m_ata_data; }; diff --git a/src/devices/bus/adam/ram.cpp b/src/devices/bus/adam/ram.cpp index 6852de8959a..544273ee737 100644 --- a/src/devices/bus/adam/ram.cpp +++ b/src/devices/bus/adam/ram.cpp @@ -26,7 +26,7 @@ const device_type ADAM_RAM = &device_creator; // adam_ram_expansion_device - constructor //------------------------------------------------- -adam_ram_expansion_device::adam_ram_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +adam_ram_expansion_device::adam_ram_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAM_RAM, "Adam 64KB RAM expansion", tag, owner, clock, "adam_ram", __FILE__), device_adam_expansion_slot_card_interface(mconfig, *this), m_ram(*this, "ram") @@ -48,7 +48,7 @@ void adam_ram_expansion_device::device_start() // adam_bd_r - buffered data read //------------------------------------------------- -UINT8 adam_ram_expansion_device::adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +uint8_t adam_ram_expansion_device::adam_bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { if (!cas2) { @@ -63,7 +63,7 @@ UINT8 adam_ram_expansion_device::adam_bd_r(address_space &space, offs_t offset, // adam_bd_w - buffered data write //------------------------------------------------- -void adam_ram_expansion_device::adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +void adam_ram_expansion_device::adam_bd_w(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) { if (!cas2) { diff --git a/src/devices/bus/adam/ram.h b/src/devices/bus/adam/ram.h index 5fabdd7e602..7f535ba80b4 100644 --- a/src/devices/bus/adam/ram.h +++ b/src/devices/bus/adam/ram.h @@ -27,18 +27,18 @@ class adam_ram_expansion_device : public device_t, { public: // construction/destruction - adam_ram_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adam_ram_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_adam_expansion_slot_card_interface overrides - virtual UINT8 adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; - virtual void adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; + virtual uint8_t adam_bd_r(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; + virtual void adam_bd_w(address_space &space, offs_t offset, uint8_t data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; }; diff --git a/src/devices/bus/adamnet/adamnet.cpp b/src/devices/bus/adamnet/adamnet.cpp index 487ce1b22d9..ac81e1ca614 100644 --- a/src/devices/bus/adamnet/adamnet.cpp +++ b/src/devices/bus/adamnet/adamnet.cpp @@ -51,7 +51,7 @@ device_adamnet_card_interface::~device_adamnet_card_interface() //------------------------------------------------- // adamnet_slot_device - constructor //------------------------------------------------- -adamnet_slot_device::adamnet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +adamnet_slot_device::adamnet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAMNET_SLOT, "ADAMnet slot", tag, owner, clock, "adamnet_slot", __FILE__), device_slot_interface(mconfig, *this), m_bus(nullptr) { @@ -79,7 +79,7 @@ void adamnet_slot_device::device_start() // adamnet_device - constructor //------------------------------------------------- -adamnet_device::adamnet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +adamnet_device::adamnet_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAMNET, "ADAMnet bus", tag, owner, clock, "adamnet", __FILE__), m_txd(1), m_reset(CLEAR_LINE) diff --git a/src/devices/bus/adamnet/adamnet.h b/src/devices/bus/adamnet/adamnet.h index 5ce906d270d..ae9e58abdb9 100644 --- a/src/devices/bus/adamnet/adamnet.h +++ b/src/devices/bus/adamnet/adamnet.h @@ -48,7 +48,7 @@ class adamnet_device : public device_t { public: // construction/destruction - adamnet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adamnet_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void add_device(device_t *target); @@ -93,7 +93,7 @@ class adamnet_slot_device : public device_t, { public: // construction/destruction - adamnet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adamnet_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/devices/bus/adamnet/ddp.cpp b/src/devices/bus/adamnet/ddp.cpp index 6e82af0b985..f4b2d84c743 100644 --- a/src/devices/bus/adamnet/ddp.cpp +++ b/src/devices/bus/adamnet/ddp.cpp @@ -118,7 +118,7 @@ machine_config_constructor adam_digital_data_pack_device::device_mconfig_additio // adam_digital_data_pack_device - constructor //------------------------------------------------- -adam_digital_data_pack_device::adam_digital_data_pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adam_digital_data_pack_device::adam_digital_data_pack_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAM_DDP, "Adam DDP", tag, owner, clock, "adam_ddp", __FILE__), device_adamnet_card_interface(mconfig, *this), m_maincpu(*this, M6801_TAG), @@ -214,7 +214,7 @@ READ8_MEMBER( adam_digital_data_pack_device::p2_r ) */ - UINT8 data = 0; + uint8_t data = 0; if (m_bus->reset_r()) data |= M6801_MODE_6; @@ -284,7 +284,7 @@ READ8_MEMBER( adam_digital_data_pack_device::p4_r ) */ - UINT8 data = 0; + uint8_t data = 0; // drive 0 if (m_ddp0->exists()) diff --git a/src/devices/bus/adamnet/ddp.h b/src/devices/bus/adamnet/ddp.h index f5255317d6d..7528658f205 100644 --- a/src/devices/bus/adamnet/ddp.h +++ b/src/devices/bus/adamnet/ddp.h @@ -30,7 +30,7 @@ class adam_digital_data_pack_device : public device_t, { public: // construction/destruction - adam_digital_data_pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adam_digital_data_pack_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; diff --git a/src/devices/bus/adamnet/fdc.cpp b/src/devices/bus/adamnet/fdc.cpp index cf99e564b78..f04c7af3302 100644 --- a/src/devices/bus/adamnet/fdc.cpp +++ b/src/devices/bus/adamnet/fdc.cpp @@ -177,7 +177,7 @@ ioport_constructor adam_fdc_device::device_input_ports() const // adam_fdc_device - constructor //------------------------------------------------- -adam_fdc_device::adam_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adam_fdc_device::adam_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAM_FDC, "Adam FDC", tag, owner, clock, "adam_fdc", __FILE__), device_adamnet_card_interface(mconfig, *this), m_maincpu(*this, M6801_TAG), @@ -217,7 +217,7 @@ void adam_fdc_device::adamnet_reset_w(int state) READ8_MEMBER( adam_fdc_device::data_r ) { - UINT8 data = m_fdc->data_r(); + uint8_t data = m_fdc->data_r(); m_ram[offset & 0x3ff] = data; @@ -246,7 +246,7 @@ READ8_MEMBER( adam_fdc_device::p1_r ) */ - UINT8 data = 0x00; + uint8_t data = 0x00; // disk in place data |= m_floppy0->exists() ? 0x00 : 0x01; @@ -321,7 +321,7 @@ READ8_MEMBER( adam_fdc_device::p2_r ) */ - UINT8 data = M6801_MODE_2; + uint8_t data = M6801_MODE_2; // NET RXD data |= m_bus->rxd_r(this) << 3; diff --git a/src/devices/bus/adamnet/fdc.h b/src/devices/bus/adamnet/fdc.h index 72838e385a7..e380528ab08 100644 --- a/src/devices/bus/adamnet/fdc.h +++ b/src/devices/bus/adamnet/fdc.h @@ -30,7 +30,7 @@ class adam_fdc_device : public device_t, { public: // construction/destruction - adam_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adam_fdc_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; @@ -57,7 +57,7 @@ protected: required_device m_fdc; required_device m_floppy0; floppy_image_device *m_floppy; - required_shared_ptr m_ram; + required_shared_ptr m_ram; required_ioport m_sw3; }; diff --git a/src/devices/bus/adamnet/kb.cpp b/src/devices/bus/adamnet/kb.cpp index 3249680e608..9266757c096 100644 --- a/src/devices/bus/adamnet/kb.cpp +++ b/src/devices/bus/adamnet/kb.cpp @@ -222,7 +222,7 @@ ioport_constructor adam_keyboard_device::device_input_ports() const // adam_keyboard_device - constructor //------------------------------------------------- -adam_keyboard_device::adam_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +adam_keyboard_device::adam_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAM_KB, "Adam keyboard", tag, owner, clock, "adam_kb", __FILE__), device_adamnet_card_interface(mconfig, *this), m_maincpu(*this, M6801_TAG), @@ -274,7 +274,7 @@ READ8_MEMBER( adam_keyboard_device::p1_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 13; i++) { @@ -303,7 +303,7 @@ READ8_MEMBER( adam_keyboard_device::p2_r ) */ - UINT8 data = M6801_MODE_7; + uint8_t data = M6801_MODE_7; // NET RXD data |= m_bus->rxd_r(this) << 3; diff --git a/src/devices/bus/adamnet/kb.h b/src/devices/bus/adamnet/kb.h index 9d8e198ef3a..418fdabdcbd 100644 --- a/src/devices/bus/adamnet/kb.h +++ b/src/devices/bus/adamnet/kb.h @@ -28,7 +28,7 @@ class adam_keyboard_device : public device_t, { public: // construction/destruction - adam_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adam_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; @@ -54,7 +54,7 @@ protected: required_device m_maincpu; required_ioport_array<13> m_y; - UINT16 m_key_y; + uint16_t m_key_y; }; diff --git a/src/devices/bus/adamnet/printer.cpp b/src/devices/bus/adamnet/printer.cpp index 9062b7aec52..7a2c7578102 100644 --- a/src/devices/bus/adamnet/printer.cpp +++ b/src/devices/bus/adamnet/printer.cpp @@ -100,7 +100,7 @@ machine_config_constructor adam_printer_device::device_mconfig_additions() const // adam_printer_device - constructor //------------------------------------------------- -adam_printer_device::adam_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adam_printer_device::adam_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAM_PRN, "Adam printer", tag, owner, clock, "adam_prn", __FILE__), device_adamnet_card_interface(mconfig, *this), m_maincpu(*this, M6801_TAG) @@ -168,7 +168,7 @@ READ8_MEMBER( adam_printer_device::p2_r ) */ - UINT8 data = M6801_MODE_7; + uint8_t data = M6801_MODE_7; // NET RXD data |= m_bus->rxd_r(this) << 3; diff --git a/src/devices/bus/adamnet/printer.h b/src/devices/bus/adamnet/printer.h index 1bb657e3d91..0b35091612f 100644 --- a/src/devices/bus/adamnet/printer.h +++ b/src/devices/bus/adamnet/printer.h @@ -28,7 +28,7 @@ class adam_printer_device : public device_t, { public: // construction/destruction - adam_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adam_printer_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; diff --git a/src/devices/bus/adamnet/spi.cpp b/src/devices/bus/adamnet/spi.cpp index e15e7dd0d9f..15d8a6157a5 100644 --- a/src/devices/bus/adamnet/spi.cpp +++ b/src/devices/bus/adamnet/spi.cpp @@ -109,7 +109,7 @@ machine_config_constructor adam_spi_device::device_mconfig_additions() const // adam_spi_device - constructor //------------------------------------------------- -adam_spi_device::adam_spi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adam_spi_device::adam_spi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADAM_SPI, "Adam SPI", tag, owner, clock, "adam_spi", __FILE__), device_adamnet_card_interface(mconfig, *this), m_maincpu(*this, M6801_TAG) @@ -154,7 +154,7 @@ READ8_MEMBER( adam_spi_device::p2_r ) */ - UINT8 data = M6801_MODE_7; + uint8_t data = M6801_MODE_7; // NET RXD data |= m_bus->rxd_r(this) << 3; diff --git a/src/devices/bus/adamnet/spi.h b/src/devices/bus/adamnet/spi.h index 47a26511a38..185aeaf657a 100644 --- a/src/devices/bus/adamnet/spi.h +++ b/src/devices/bus/adamnet/spi.h @@ -31,7 +31,7 @@ class adam_spi_device : public device_t, { public: // construction/destruction - adam_spi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adam_spi_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; diff --git a/src/devices/bus/amiga/zorro/a2052.cpp b/src/devices/bus/amiga/zorro/a2052.cpp index dc2727d2117..ced832c9f3a 100644 --- a/src/devices/bus/amiga/zorro/a2052.cpp +++ b/src/devices/bus/amiga/zorro/a2052.cpp @@ -50,7 +50,7 @@ ioport_constructor a2052_device::device_input_ports() const // a2052_device - constructor //------------------------------------------------- -a2052_device::a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2052_device::a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2052, "CBM A2052 Fast Memory", tag, owner, clock, "a2052", __FILE__), device_zorro2_card_interface(mconfig, *this), m_config(*this, "config") diff --git a/src/devices/bus/amiga/zorro/a2052.h b/src/devices/bus/amiga/zorro/a2052.h index 0c06bac9395..02af377bdf3 100644 --- a/src/devices/bus/amiga/zorro/a2052.h +++ b/src/devices/bus/amiga/zorro/a2052.h @@ -28,7 +28,7 @@ class a2052_device : public device_t, public device_zorro2_card_interface, publi { public: // construction/destruction - a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual ioport_constructor device_input_ports() const override; @@ -42,7 +42,7 @@ protected: private: required_ioport m_config; - std::vector m_ram; + std::vector m_ram; }; // device type definition diff --git a/src/devices/bus/amiga/zorro/a2232.cpp b/src/devices/bus/amiga/zorro/a2232.cpp index 4cf44853c46..f7a0d5f4312 100644 --- a/src/devices/bus/amiga/zorro/a2232.cpp +++ b/src/devices/bus/amiga/zorro/a2232.cpp @@ -151,7 +151,7 @@ machine_config_constructor a2232_device::device_mconfig_additions() const // a2232_device - constructor //------------------------------------------------- -a2232_device::a2232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2232_device::a2232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A2232, "CBM A2232 Serial Card", tag, owner, clock, "a2232", __FILE__), device_zorro2_card_interface(mconfig, *this), m_iocpu(*this, "iocpu"), @@ -311,7 +311,7 @@ WRITE_LINE_MEMBER( a2232_device::cfgin_w ) READ16_MEMBER( a2232_device::shared_ram_r ) { - UINT16 data = 0; + uint16_t data = 0; if (ACCESSING_BITS_0_7) data |= m_shared_ram[(offset << 1) + 1]; @@ -381,7 +381,7 @@ WRITE16_MEMBER( a2232_device::irq_w ) READ16_MEMBER( a2232_device::reset_high_r ) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (VERBOSE) logerror("%s('%s'): reset_high_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); diff --git a/src/devices/bus/amiga/zorro/a2232.h b/src/devices/bus/amiga/zorro/a2232.h index 2611d243bdb..4132ce5178d 100644 --- a/src/devices/bus/amiga/zorro/a2232.h +++ b/src/devices/bus/amiga/zorro/a2232.h @@ -34,7 +34,7 @@ class a2232_device : public device_t, public device_zorro2_card_interface, publi { public: // construction/destruction - a2232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // cpu WRITE8_MEMBER( int2_w ); @@ -137,12 +137,12 @@ private: required_device m_acia_5; required_device m_acia_6; required_device m_cia; - required_shared_ptr m_shared_ram; + required_shared_ptr m_shared_ram; int m_irqs[IRQ_SOURCE_COUNT]; - UINT8 m_cia_port_a; - UINT8 m_cia_port_b; + uint8_t m_cia_port_a; + uint8_t m_cia_port_b; }; // device type definition diff --git a/src/devices/bus/amiga/zorro/a590.cpp b/src/devices/bus/amiga/zorro/a590.cpp index 5cd5c0c9f6b..2a9eeb0c10d 100644 --- a/src/devices/bus/amiga/zorro/a590.cpp +++ b/src/devices/bus/amiga/zorro/a590.cpp @@ -192,7 +192,7 @@ const tiny_rom_entry *dmac_hdc_device::device_rom_region() const //------------------------------------------------- dmac_hdc_device::dmac_hdc_device(const machine_config &mconfig, device_type type, const char *tag, - device_t *owner, UINT32 clock, const char *name, const char *shortname) : + device_t *owner, uint32_t clock, const char *name, const char *shortname) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), m_int6(false), m_dmac(*this, "dmac"), @@ -200,7 +200,7 @@ dmac_hdc_device::dmac_hdc_device(const machine_config &mconfig, device_type type { } -a590_device::a590_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a590_device::a590_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmac_hdc_device(mconfig, A590, tag, owner, clock, "CBM A590 HD Controller", "a590"), device_exp_card_interface(mconfig, *this), m_dips(*this, "dips"), @@ -210,7 +210,7 @@ a590_device::a590_device(const machine_config &mconfig, const char *tag, device_ { } -a2091_device::a2091_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +a2091_device::a2091_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmac_hdc_device(mconfig, A2091, tag, owner, clock, "CBM A2091 HD Controller", "a2091"), device_zorro2_card_interface(mconfig, *this), m_jp1(*this, "jp1"), diff --git a/src/devices/bus/amiga/zorro/a590.h b/src/devices/bus/amiga/zorro/a590.h index 90dc2cd589e..591ca08063c 100644 --- a/src/devices/bus/amiga/zorro/a590.h +++ b/src/devices/bus/amiga/zorro/a590.h @@ -30,7 +30,7 @@ class dmac_hdc_device : public device_t public: // construction/destruction dmac_hdc_device(const machine_config &mconfig, device_type type, const char *tag, - device_t *owner, UINT32 clock, const char *name, const char *shortname); + device_t *owner, uint32_t clock, const char *name, const char *shortname); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -62,7 +62,7 @@ protected: required_device m_dmac; required_device m_wdc; - std::vector m_ram; + std::vector m_ram; }; // ======================> a590_device @@ -71,7 +71,7 @@ class a590_device : public dmac_hdc_device, public device_exp_card_interface { public: // construction/destruction - a590_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a590_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -102,7 +102,7 @@ class a2091_device : public dmac_hdc_device, public device_zorro2_card_interface { public: // construction/destruction - a2091_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a2091_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/devices/bus/amiga/zorro/action_replay.cpp b/src/devices/bus/amiga/zorro/action_replay.cpp index 8fd4f7b0eeb..423ce88f99c 100644 --- a/src/devices/bus/amiga/zorro/action_replay.cpp +++ b/src/devices/bus/amiga/zorro/action_replay.cpp @@ -98,24 +98,24 @@ const tiny_rom_entry *action_replay_mk3_device::device_rom_region() const //------------------------------------------------- action_replay_device::action_replay_device(const machine_config &mconfig, device_type type, const char *tag, - device_t *owner, UINT32 clock, const char *name, const char *shortname) : + device_t *owner, uint32_t clock, const char *name, const char *shortname) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), device_exp_card_interface(mconfig, *this), m_button(*this, "freeze") { } -action_replay_mk1_device::action_replay_mk1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +action_replay_mk1_device::action_replay_mk1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : action_replay_device(mconfig, ACTION_REPLAY_MK1, tag, owner, clock, "Datel Action Replay MK-I", "amiga_ar1") { } -action_replay_mk2_device::action_replay_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +action_replay_mk2_device::action_replay_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : action_replay_device(mconfig, ACTION_REPLAY_MK1, tag, owner, clock, "Datel Action Replay MK-II", "amiga_ar2") { } -action_replay_mk3_device::action_replay_mk3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +action_replay_mk3_device::action_replay_mk3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : action_replay_device(mconfig, ACTION_REPLAY_MK1, tag, owner, clock, "Datel Action Replay MK-III", "amiga_ar3") { } diff --git a/src/devices/bus/amiga/zorro/action_replay.h b/src/devices/bus/amiga/zorro/action_replay.h index cf73b5c602b..4bb5d6dd242 100644 --- a/src/devices/bus/amiga/zorro/action_replay.h +++ b/src/devices/bus/amiga/zorro/action_replay.h @@ -28,7 +28,7 @@ class action_replay_device : public device_t, public device_exp_card_interface public: // construction/destruction action_replay_device(const machine_config &mconfig, device_type type, const char *tag, - device_t *owner, UINT32 clock, const char *name, const char *shortname); + device_t *owner, uint32_t clock, const char *name, const char *shortname); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -48,7 +48,7 @@ class action_replay_mk1_device : public action_replay_device { public: // construction/destruction - action_replay_mk1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + action_replay_mk1_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 @@ class action_replay_mk2_device : public action_replay_device { public: // construction/destruction - action_replay_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + action_replay_mk2_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; @@ -68,7 +68,7 @@ class action_replay_mk3_device : public action_replay_device { public: // construction/destruction - action_replay_mk3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + action_replay_mk3_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; diff --git a/src/devices/bus/amiga/zorro/buddha.cpp b/src/devices/bus/amiga/zorro/buddha.cpp index 512802f39fc..98a15a11bcd 100644 --- a/src/devices/bus/amiga/zorro/buddha.cpp +++ b/src/devices/bus/amiga/zorro/buddha.cpp @@ -67,7 +67,7 @@ const tiny_rom_entry *buddha_device::device_rom_region() const // buddha_device - constructor //------------------------------------------------- -buddha_device::buddha_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +buddha_device::buddha_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BUDDHA, "Buddha IDE controller", tag, owner, clock, "buddha", __FILE__), device_zorro2_card_interface(mconfig, *this), m_ata_0(*this, "ata_0"), @@ -182,7 +182,7 @@ WRITE_LINE_MEMBER( buddha_device::cfgin_w ) READ16_MEMBER( buddha_device::speed_r ) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (VERBOSE) logerror("%s('%s'): ide_0_interrupt_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); @@ -220,7 +220,7 @@ WRITE_LINE_MEMBER( buddha_device::ide_1_interrupt_w) READ16_MEMBER( buddha_device::ide_0_interrupt_r ) { - UINT16 data; + uint16_t data; data = m_ide_0_interrupt << 15; @@ -234,7 +234,7 @@ READ16_MEMBER( buddha_device::ide_0_interrupt_r ) READ16_MEMBER( buddha_device::ide_1_interrupt_r ) { - UINT16 data; + uint16_t data; data = m_ide_1_interrupt << 15; @@ -255,7 +255,7 @@ WRITE16_MEMBER( buddha_device::ide_interrupt_enable_w ) READ16_MEMBER( buddha_device::ide_0_cs0_r ) { - UINT16 data; + uint16_t data; mem_mask = (mem_mask << 8) | (mem_mask >> 8); data = m_ata_0->read_cs0(space, (offset >> 1) & 0x07, mem_mask); @@ -279,7 +279,7 @@ WRITE16_MEMBER( buddha_device::ide_0_cs0_w ) READ16_MEMBER( buddha_device::ide_0_cs1_r ) { - UINT16 data; + uint16_t data; mem_mask = (mem_mask << 8) | (mem_mask >> 8); data = m_ata_0->read_cs1(space, (offset >> 1) & 0x07, mem_mask); @@ -303,7 +303,7 @@ WRITE16_MEMBER( buddha_device::ide_0_cs1_w ) READ16_MEMBER( buddha_device::ide_1_cs0_r ) { - UINT16 data; + uint16_t data; mem_mask = (mem_mask << 8) | (mem_mask >> 8); data = m_ata_1->read_cs0(space, (offset >> 1) & 0x07, mem_mask); @@ -327,7 +327,7 @@ WRITE16_MEMBER( buddha_device::ide_1_cs0_w ) READ16_MEMBER( buddha_device::ide_1_cs1_r ) { - UINT16 data; + uint16_t data; mem_mask = (mem_mask << 8) | (mem_mask >> 8); data = m_ata_1->read_cs1(space, (offset >> 1) & 0x07, mem_mask); diff --git a/src/devices/bus/amiga/zorro/buddha.h b/src/devices/bus/amiga/zorro/buddha.h index be2d569c5de..712cf690cdd 100644 --- a/src/devices/bus/amiga/zorro/buddha.h +++ b/src/devices/bus/amiga/zorro/buddha.h @@ -29,7 +29,7 @@ class buddha_device : public device_t, public device_zorro2_card_interface, publ { public: // construction/destruction - buddha_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + buddha_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // speed register DECLARE_READ16_MEMBER( speed_r ); diff --git a/src/devices/bus/amiga/zorro/zorro.cpp b/src/devices/bus/amiga/zorro/zorro.cpp index 72f4eaed43d..15c5fa770c3 100644 --- a/src/devices/bus/amiga/zorro/zorro.cpp +++ b/src/devices/bus/amiga/zorro/zorro.cpp @@ -21,7 +21,7 @@ const device_type ZORRO_SLOT = &device_creator; // zorro_slot_device - constructor //------------------------------------------------- -zorro_slot_device::zorro_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +zorro_slot_device::zorro_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ZORRO_SLOT, "Zorro slot", tag, owner, clock, "zorro_slot", __FILE__), device_slot_interface(mconfig, *this), m_zorro_tag(nullptr) @@ -29,7 +29,7 @@ zorro_slot_device::zorro_slot_device(const machine_config &mconfig, const char * } zorro_slot_device::zorro_slot_device(const machine_config &mconfig, device_type type, const char *name, - const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : + 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_slot_interface(mconfig, *this), m_zorro_tag(nullptr) @@ -68,7 +68,7 @@ void zorro_slot_device::device_start() //------------------------------------------------- zorro_device::zorro_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) : + 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_space(nullptr), m_cputag(nullptr), @@ -120,7 +120,7 @@ const device_type EXP_SLOT = &device_creator; // exp_slot_device - constructor //------------------------------------------------- -exp_slot_device::exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +exp_slot_device::exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : zorro_device(mconfig, EXP_SLOT, "86-pin expansion slot", tag, owner, clock, "exp_slot", __FILE__), m_ipl_handler(*this), m_dev(nullptr) @@ -128,7 +128,7 @@ exp_slot_device::exp_slot_device(const machine_config &mconfig, const char *tag, } exp_slot_device::exp_slot_device(const machine_config &mconfig, device_type type, const char *name, - const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : + const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : zorro_device(mconfig, type, name, tag, owner, clock, shortname, source), m_ipl_handler(*this), m_dev(nullptr) @@ -186,7 +186,7 @@ const device_type ZORRO2 = &device_creator; // zorro2_device - constructor //------------------------------------------------- -zorro2_device::zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +zorro2_device::zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : zorro_device(mconfig, ZORRO2, "Zorro-II bus", tag, owner, clock, "zorro2", __FILE__), m_eint1_handler(*this), m_eint4_handler(*this), @@ -197,7 +197,7 @@ zorro2_device::zorro2_device(const machine_config &mconfig, const char *tag, dev } zorro2_device::zorro2_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) : + const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : zorro_device(mconfig, type, name, tag, owner, clock, shortname, source), m_eint1_handler(*this), m_eint4_handler(*this), diff --git a/src/devices/bus/amiga/zorro/zorro.h b/src/devices/bus/amiga/zorro/zorro.h index 7a37e334ada..9d641d66cc9 100644 --- a/src/devices/bus/amiga/zorro/zorro.h +++ b/src/devices/bus/amiga/zorro/zorro.h @@ -230,9 +230,9 @@ class zorro_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - zorro_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + zorro_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); zorro_slot_device(const machine_config &mconfig, device_type type, const char *name, - const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); // device-level overrides virtual void device_start() override; @@ -255,7 +255,7 @@ class zorro_device : public device_t public: // construction/destruction zorro_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); + const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); // static configuration helpers static void set_cputag(device_t &device, const char *tag); @@ -300,9 +300,9 @@ class exp_slot_device : public zorro_device { public: // construction/destruction - exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); exp_slot_device(const machine_config &mconfig, device_type type, const char *name, - const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); template static devcb_base &set_ipl_handler(device_t &device, _Object object) { return downcast(device).m_ipl_handler.set_callback(object); } @@ -336,9 +336,9 @@ class zorro2_device : public zorro_device { public: // construction/destruction - zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); zorro2_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); + const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); ~zorro2_device(); template static devcb_base &set_eint1_handler(device_t &device, _Object object) diff --git a/src/devices/bus/apf/rom.cpp b/src/devices/bus/apf/rom.cpp index 9eb83e4f12c..041bdad74b3 100644 --- a/src/devices/bus/apf/rom.cpp +++ b/src/devices/bus/apf/rom.cpp @@ -22,24 +22,24 @@ const device_type APF_ROM_BASIC = &device_creator; const device_type APF_ROM_SPACEDST = &device_creator; -apf_rom_device::apf_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +apf_rom_device::apf_rom_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_apf_cart_interface( mconfig, *this ) { } -apf_rom_device::apf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apf_rom_device::apf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APF_ROM_STD, "APF Standard Carts", tag, owner, clock, "apf_rom", __FILE__), device_apf_cart_interface( mconfig, *this ) { } -apf_basic_device::apf_basic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apf_basic_device::apf_basic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : apf_rom_device(mconfig, APF_ROM_BASIC, "APF BASIC Carts", tag, owner, clock, "apf_basic", __FILE__) { } -apf_spacedst_device::apf_spacedst_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apf_spacedst_device::apf_spacedst_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : apf_rom_device(mconfig, APF_ROM_SPACEDST, "APF Space Destroyer Cart", tag, owner, clock, "apf_spacedst", __FILE__) { } diff --git a/src/devices/bus/apf/rom.h b/src/devices/bus/apf/rom.h index d7c3b748014..68b9c3bdbd3 100644 --- a/src/devices/bus/apf/rom.h +++ b/src/devices/bus/apf/rom.h @@ -13,8 +13,8 @@ class apf_rom_device : public device_t, { public: // construction/destruction - apf_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - apf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apf_rom_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); + apf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -30,7 +30,7 @@ class apf_basic_device : public apf_rom_device { public: // construction/destruction - apf_basic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apf_basic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(extra_rom) override; @@ -42,7 +42,7 @@ class apf_spacedst_device : public apf_rom_device { public: // construction/destruction - apf_spacedst_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apf_spacedst_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_ram) override; diff --git a/src/devices/bus/apf/slot.cpp b/src/devices/bus/apf/slot.cpp index bcfe2f825b6..8999c523649 100644 --- a/src/devices/bus/apf/slot.cpp +++ b/src/devices/bus/apf/slot.cpp @@ -45,7 +45,7 @@ device_apf_cart_interface::~device_apf_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_apf_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_apf_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -59,7 +59,7 @@ void device_apf_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_apf_cart_interface::ram_alloc(UINT32 size) +void device_apf_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -72,7 +72,7 @@ void device_apf_cart_interface::ram_alloc(UINT32 size) //------------------------------------------------- // apf_cart_slot_device - constructor //------------------------------------------------- -apf_cart_slot_device::apf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +apf_cart_slot_device::apf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APF_CART_SLOT, "APF Cartridge Slot", tag, owner, clock, "apf_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -160,7 +160,7 @@ image_init_result apf_cart_slot_device::call_load() { if (m_cart) { - UINT32 size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); if (size > 0x3800) { @@ -215,7 +215,7 @@ std::string apf_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 size = m_file->size(); + uint32_t size = m_file->size(); int type = APF_STD; // attempt to identify Space Destroyer, which needs 1K of additional RAM diff --git a/src/devices/bus/apf/slot.h b/src/devices/bus/apf/slot.h index 709d2f396a0..d50080de59c 100644 --- a/src/devices/bus/apf/slot.h +++ b/src/devices/bus/apf/slot.h @@ -34,20 +34,20 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_ram) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } void save_ram() { device().save_item(NAME(m_ram)); } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; }; @@ -59,7 +59,7 @@ class apf_cart_slot_device : public device_t, { public: // construction/destruction - apf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~apf_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/apricot/expansion/expansion.cpp b/src/devices/bus/apricot/expansion/expansion.cpp index 5dd7eb5ae58..cf1152c7ac3 100644 --- a/src/devices/bus/apricot/expansion/expansion.cpp +++ b/src/devices/bus/apricot/expansion/expansion.cpp @@ -19,14 +19,14 @@ const device_type APRICOT_EXPANSION_SLOT = &device_creator static devcb_base &set_dma1_handler(device_t &device, _Object object) diff --git a/src/devices/bus/apricot/expansion/ram.cpp b/src/devices/bus/apricot/expansion/ram.cpp index 2221ae37227..59711b127cd 100644 --- a/src/devices/bus/apricot/expansion/ram.cpp +++ b/src/devices/bus/apricot/expansion/ram.cpp @@ -42,7 +42,7 @@ ioport_constructor apricot_256k_ram_device::device_input_ports() const // apricot_256k_ram_device - constructor //------------------------------------------------- -apricot_256k_ram_device::apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +apricot_256k_ram_device::apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APRICOT_256K_RAM, "Apricot 256K RAM Expansion Board", tag, owner, clock, "apricot_256k_ram", __FILE__), device_apricot_expansion_card_interface(mconfig, *this), m_sw(*this, "sw") @@ -96,7 +96,7 @@ ioport_constructor apricot_128k_ram_device::device_input_ports() const // apricot_128_512k_ram_device - constructor //------------------------------------------------- -apricot_128k_ram_device::apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +apricot_128k_ram_device::apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APRICOT_128K_RAM, "Apricot 128/512K RAM Expansion Board (128K)", tag, owner, clock, "apricot_128k_ram", __FILE__), device_apricot_expansion_card_interface(mconfig, *this), m_strap(*this, "strap") @@ -150,7 +150,7 @@ ioport_constructor apricot_512k_ram_device::device_input_ports() const // apricot_128_512k_ram_device - constructor //------------------------------------------------- -apricot_512k_ram_device::apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +apricot_512k_ram_device::apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APRICOT_512K_RAM, "Apricot 128/512K RAM Expansion Board (512K)", tag, owner, clock, "apricot_512k_ram", __FILE__), device_apricot_expansion_card_interface(mconfig, *this), m_strap(*this, "strap") diff --git a/src/devices/bus/apricot/expansion/ram.h b/src/devices/bus/apricot/expansion/ram.h index c2b2f771953..719a51cbc4f 100644 --- a/src/devices/bus/apricot/expansion/ram.h +++ b/src/devices/bus/apricot/expansion/ram.h @@ -26,7 +26,7 @@ class apricot_256k_ram_device : public device_t, public device_apricot_expansion { public: // construction/destruction - apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual ioport_constructor device_input_ports() const override; @@ -36,7 +36,7 @@ protected: private: required_ioport m_sw; - std::vector m_ram; + std::vector m_ram; }; @@ -46,7 +46,7 @@ class apricot_128k_ram_device : public device_t, public device_apricot_expansion { public: // construction/destruction - apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual ioport_constructor device_input_ports() const override; @@ -56,7 +56,7 @@ protected: private: required_ioport m_strap; - std::vector m_ram; + std::vector m_ram; }; @@ -66,7 +66,7 @@ class apricot_512k_ram_device : public device_t, public device_apricot_expansion { public: // construction/destruction - apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual ioport_constructor device_input_ports() const override; @@ -76,7 +76,7 @@ protected: private: required_ioport m_strap; - std::vector m_ram; + std::vector m_ram; }; diff --git a/src/devices/bus/apricot/keyboard/hle.cpp b/src/devices/bus/apricot/keyboard/hle.cpp index 5315cb6e31a..8fbbb796ef1 100644 --- a/src/devices/bus/apricot/keyboard/hle.cpp +++ b/src/devices/bus/apricot/keyboard/hle.cpp @@ -207,7 +207,7 @@ machine_config_constructor apricot_keyboard_hle_device::device_mconfig_additions // apricot_keyboard_hle_device - constructor //------------------------------------------------- -apricot_keyboard_hle_device::apricot_keyboard_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +apricot_keyboard_hle_device::apricot_keyboard_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APRICOT_KEYBOARD_HLE, "Apricot Keyboard (HLE)", tag, owner, clock, "apricotkb_hle", __FILE__), device_apricot_keyboard_interface(mconfig, *this), device_buffered_serial_interface(mconfig, *this), @@ -258,7 +258,7 @@ void apricot_keyboard_hle_device::tra_callback() // received_byte - handle received byte //------------------------------------------------- -void apricot_keyboard_hle_device::received_byte(UINT8 byte) +void apricot_keyboard_hle_device::received_byte(uint8_t byte) { if ((byte & 0xf0) == 0xf0) { @@ -317,7 +317,7 @@ void apricot_keyboard_hle_device::received_byte(UINT8 byte) // key_make - handle a key being pressed //------------------------------------------------- -void apricot_keyboard_hle_device::key_make(UINT8 row, UINT8 column) +void apricot_keyboard_hle_device::key_make(uint8_t row, uint8_t column) { // send the make code transmit_byte((row << 3) | column); @@ -327,7 +327,7 @@ void apricot_keyboard_hle_device::key_make(UINT8 row, UINT8 column) // key_break - handle a key being released //------------------------------------------------- -void apricot_keyboard_hle_device::key_break(UINT8 row, UINT8 column) +void apricot_keyboard_hle_device::key_break(uint8_t row, uint8_t column) { // send the break code transmit_byte(0x80 | (row << 3) | column); diff --git a/src/devices/bus/apricot/keyboard/hle.h b/src/devices/bus/apricot/keyboard/hle.h index 8ef520824a8..e1cef569472 100644 --- a/src/devices/bus/apricot/keyboard/hle.h +++ b/src/devices/bus/apricot/keyboard/hle.h @@ -30,7 +30,7 @@ class apricot_keyboard_hle_device : public device_t, { public: // construction/destruction - apricot_keyboard_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apricot_keyboard_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // from host virtual void out_w(int state) override; @@ -44,11 +44,11 @@ protected: // device_buffered_serial_interface overrides virtual void tra_callback() override; - virtual void received_byte(UINT8 byte) override; + virtual void received_byte(uint8_t byte) override; // device_matrix_keyboard_interface overrides - 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; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/devices/bus/apricot/keyboard/keyboard.cpp b/src/devices/bus/apricot/keyboard/keyboard.cpp index e045b319e4f..8d53eac72b5 100644 --- a/src/devices/bus/apricot/keyboard/keyboard.cpp +++ b/src/devices/bus/apricot/keyboard/keyboard.cpp @@ -25,7 +25,7 @@ const device_type APRICOT_KEYBOARD_INTERFACE = &device_creator; const device_type ARCADIA_ROM_GOLF = &device_creator; -arcadia_rom_device::arcadia_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +arcadia_rom_device::arcadia_rom_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_arcadia_cart_interface( mconfig, *this ) { } -arcadia_rom_device::arcadia_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arcadia_rom_device::arcadia_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ARCADIA_ROM_STD, "Emerson Arcadia Standard Carts", tag, owner, clock, "arcadia_rom", __FILE__), device_arcadia_cart_interface( mconfig, *this ) { } -arcadia_golf_device::arcadia_golf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arcadia_golf_device::arcadia_golf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arcadia_rom_device(mconfig, ARCADIA_ROM_GOLF, "Emerson Arcadia Golf Cart", tag, owner, clock, "arcadia_golf", __FILE__) { } diff --git a/src/devices/bus/arcadia/rom.h b/src/devices/bus/arcadia/rom.h index 3e1c55e60c0..ad77caa1bc3 100644 --- a/src/devices/bus/arcadia/rom.h +++ b/src/devices/bus/arcadia/rom.h @@ -13,8 +13,8 @@ class arcadia_rom_device : public device_t, { public: // construction/destruction - arcadia_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - arcadia_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arcadia_rom_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); + arcadia_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -31,7 +31,7 @@ class arcadia_golf_device : public arcadia_rom_device { public: // construction/destruction - arcadia_golf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arcadia_golf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/arcadia/slot.cpp b/src/devices/bus/arcadia/slot.cpp index 2c9a55fff91..a2d3eed9b5c 100644 --- a/src/devices/bus/arcadia/slot.cpp +++ b/src/devices/bus/arcadia/slot.cpp @@ -45,7 +45,7 @@ device_arcadia_cart_interface::~device_arcadia_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_arcadia_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_arcadia_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -62,7 +62,7 @@ void device_arcadia_cart_interface::rom_alloc(UINT32 size, const char *tag) //------------------------------------------------- // arcadia_cart_slot_device - constructor //------------------------------------------------- -arcadia_cart_slot_device::arcadia_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +arcadia_cart_slot_device::arcadia_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EA2001_CART_SLOT, "Emerson Arcadia Cartridge Slot", tag, owner, clock, "arcadia_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -150,7 +150,7 @@ image_init_result arcadia_cart_slot_device::call_load() { if (m_cart) { - UINT32 len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); m_cart->rom_alloc(len, tag()); diff --git a/src/devices/bus/arcadia/slot.h b/src/devices/bus/arcadia/slot.h index 2f7f2dbc67a..e052f1ff1f5 100644 --- a/src/devices/bus/arcadia/slot.h +++ b/src/devices/bus/arcadia/slot.h @@ -32,14 +32,14 @@ public: virtual DECLARE_READ8_MEMBER(read_rom) { return 0xff; } virtual DECLARE_READ8_MEMBER(extra_rom) { return 0xff; } - void rom_alloc(UINT32 size, const char *tag); - UINT8* get_rom_base() { return m_rom; } - UINT32 get_rom_size() { return m_rom_size; } + void rom_alloc(uint32_t size, const char *tag); + uint8_t* get_rom_base() { return m_rom; } + uint32_t get_rom_size() { return m_rom_size; } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; + uint8_t *m_rom; + uint32_t m_rom_size; }; @@ -51,7 +51,7 @@ class arcadia_cart_slot_device : public device_t, { public: // construction/destruction - arcadia_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arcadia_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~arcadia_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/astrocde/exp.cpp b/src/devices/bus/astrocde/exp.cpp index 2d6e7eb51b3..cf57dcee23d 100644 --- a/src/devices/bus/astrocde/exp.cpp +++ b/src/devices/bus/astrocde/exp.cpp @@ -35,7 +35,7 @@ device_astrocade_card_interface::~device_astrocade_card_interface() //------------------------------------------------- // astrocade_exp_device - constructor //------------------------------------------------- -astrocade_exp_device::astrocade_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +astrocade_exp_device::astrocade_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASTROCADE_EXP_SLOT, "Bally Astrocade expansion", tag, owner, clock, "astrocde_exp", __FILE__), device_slot_interface(mconfig, *this), m_card_mounted(false), m_card(nullptr) diff --git a/src/devices/bus/astrocde/exp.h b/src/devices/bus/astrocde/exp.h index b2d6e3643ea..110bdaf0367 100644 --- a/src/devices/bus/astrocde/exp.h +++ b/src/devices/bus/astrocde/exp.h @@ -25,7 +25,7 @@ class astrocade_exp_device : public device_t, { public: // construction/destruction - astrocade_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~astrocade_exp_device(); // device-level overrides diff --git a/src/devices/bus/astrocde/ram.cpp b/src/devices/bus/astrocde/ram.cpp index 95ebb6816aa..d10b006c224 100644 --- a/src/devices/bus/astrocde/ram.cpp +++ b/src/devices/bus/astrocde/ram.cpp @@ -68,45 +68,45 @@ const device_type ASTROCADE_WHITERAM = &device_creator; -astrocade_blueram_4k_device::astrocade_blueram_4k_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) +astrocade_blueram_4k_device::astrocade_blueram_4k_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_astrocade_card_interface(mconfig, *this), m_write_prot(*this, "RAM_PROTECT") { } -astrocade_blueram_4k_device::astrocade_blueram_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_blueram_4k_device::astrocade_blueram_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASTROCADE_BLUERAM_4K, "Bally Astrocade Blue RAM 4K", tag, owner, clock, "astrocade_br4", __FILE__), device_astrocade_card_interface(mconfig, *this), m_write_prot(*this, "RAM_PROTECT") { } -astrocade_blueram_16k_device::astrocade_blueram_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_blueram_16k_device::astrocade_blueram_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : astrocade_blueram_4k_device(mconfig, ASTROCADE_BLUERAM_16K, "Bally Astrocade Blue RAM 16K", tag, owner, clock, "astrocade_br16", __FILE__) { } -astrocade_blueram_32k_device::astrocade_blueram_32k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_blueram_32k_device::astrocade_blueram_32k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : astrocade_blueram_4k_device(mconfig, ASTROCADE_BLUERAM_32K, "Bally Astrocade Blue RAM 32K", tag, owner, clock, "astrocade_br32", __FILE__) { } -astrocade_viper_sys1_device::astrocade_viper_sys1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_viper_sys1_device::astrocade_viper_sys1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASTROCADE_VIPER_SYS1, "Bally Astrocade Viper System 1", tag, owner, clock, "astrocade_vs1", __FILE__), device_astrocade_card_interface(mconfig, *this), m_write_prot(*this, "RAM_PROTECT") { } -astrocade_whiteram_device::astrocade_whiteram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_whiteram_device::astrocade_whiteram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASTROCADE_WHITERAM, "Bally Astrocade Lil' White RAM 32K", tag, owner, clock, "astrocade_lwr", __FILE__), device_astrocade_card_interface(mconfig, *this), m_write_prot(*this, "RAM_PROTECT") { } -astrocade_rl64ram_device::astrocade_rl64ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_rl64ram_device::astrocade_rl64ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASTROCADE_RL64RAM, "Bally Astrocade R&L RAM 64K", tag, owner, clock, "astrocade_rl64", __FILE__), device_astrocade_card_interface(mconfig, *this), m_write_prot(*this, "RAM_PROTECT") diff --git a/src/devices/bus/astrocde/ram.h b/src/devices/bus/astrocde/ram.h index 39d854827ac..d714c14e3b3 100644 --- a/src/devices/bus/astrocde/ram.h +++ b/src/devices/bus/astrocde/ram.h @@ -13,8 +13,8 @@ class astrocade_blueram_4k_device : public device_t, { public: // construction/destruction - astrocade_blueram_4k_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); - astrocade_blueram_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_blueram_4k_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); + astrocade_blueram_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { m_ram.resize(0x1000); save_item(NAME(m_ram)); } @@ -26,7 +26,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write) override; protected: - std::vector m_ram; + std::vector m_ram; required_ioport m_write_prot; }; @@ -36,7 +36,7 @@ class astrocade_blueram_16k_device : public astrocade_blueram_4k_device { public: // construction/destruction - astrocade_blueram_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_blueram_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override { m_ram.resize(0x4000); save_item(NAME(m_ram)); } }; @@ -47,7 +47,7 @@ class astrocade_blueram_32k_device : public astrocade_blueram_4k_device { public: // construction/destruction - astrocade_blueram_32k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_blueram_32k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override { m_ram.resize(0x8000); save_item(NAME(m_ram)); } }; @@ -59,7 +59,7 @@ class astrocade_viper_sys1_device : public device_t, { public: // construction/destruction - astrocade_viper_sys1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_viper_sys1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { m_ram.resize(0x4000); save_item(NAME(m_ram)); } @@ -71,7 +71,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write) override; private: - std::vector m_ram; + std::vector m_ram; required_ioport m_write_prot; }; @@ -82,7 +82,7 @@ class astrocade_whiteram_device : public device_t, { public: // construction/destruction - astrocade_whiteram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_whiteram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { m_ram.resize(0x8000); save_item(NAME(m_ram)); } @@ -94,7 +94,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write) override; private: - std::vector m_ram; + std::vector m_ram; required_ioport m_write_prot; }; @@ -105,7 +105,7 @@ class astrocade_rl64ram_device : public device_t, { public: // construction/destruction - astrocade_rl64ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_rl64ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { m_ram.resize(0xb000); save_item(NAME(m_ram)); } @@ -117,7 +117,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write) override; private: - std::vector m_ram; + std::vector m_ram; required_ioport m_write_prot; }; diff --git a/src/devices/bus/astrocde/rom.cpp b/src/devices/bus/astrocde/rom.cpp index 201a4d1afe6..335b45338ea 100644 --- a/src/devices/bus/astrocde/rom.cpp +++ b/src/devices/bus/astrocde/rom.cpp @@ -22,24 +22,24 @@ const device_type ASTROCADE_ROM_256K = &device_creator; -astrocade_rom_device::astrocade_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +astrocade_rom_device::astrocade_rom_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_astrocade_cart_interface(mconfig, *this) { } -astrocade_rom_device::astrocade_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_rom_device::astrocade_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASTROCADE_ROM_STD, "Bally Astrocade Standard Carts", tag, owner, clock, "astrocade_rom", __FILE__), device_astrocade_cart_interface(mconfig, *this) { } -astrocade_rom_256k_device::astrocade_rom_256k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_rom_256k_device::astrocade_rom_256k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : astrocade_rom_device(mconfig, ASTROCADE_ROM_256K, "Bally Astrocade 256K Carts", tag, owner, clock, "astrocade_256k", __FILE__), m_base_bank(0) { } -astrocade_rom_512k_device::astrocade_rom_512k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_rom_512k_device::astrocade_rom_512k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : astrocade_rom_device(mconfig, ASTROCADE_ROM_512K, "Bally Astrocade 512K Carts", tag, owner, clock, "astrocade_512k", __FILE__), m_base_bank(0) { } diff --git a/src/devices/bus/astrocde/rom.h b/src/devices/bus/astrocde/rom.h index 28fcb0d43bb..9fa0b20e5fe 100644 --- a/src/devices/bus/astrocde/rom.h +++ b/src/devices/bus/astrocde/rom.h @@ -13,8 +13,8 @@ class astrocade_rom_device : public device_t, { public: // construction/destruction - astrocade_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - astrocade_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_rom_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); + astrocade_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -30,7 +30,7 @@ class astrocade_rom_256k_device : public astrocade_rom_device { public: // construction/destruction - astrocade_rom_256k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_rom_256k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; @@ -39,7 +39,7 @@ public: virtual DECLARE_READ8_MEMBER(read_rom) override; private: - UINT8 m_base_bank; + uint8_t m_base_bank; }; // ======================> astrocade_rom_512k_device @@ -48,7 +48,7 @@ class astrocade_rom_512k_device : public astrocade_rom_device { public: // construction/destruction - astrocade_rom_512k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_rom_512k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; @@ -57,7 +57,7 @@ public: virtual DECLARE_READ8_MEMBER(read_rom) override; private: - UINT8 m_base_bank; + uint8_t m_base_bank; }; diff --git a/src/devices/bus/astrocde/slot.cpp b/src/devices/bus/astrocde/slot.cpp index 477caa61029..09cbf27e2e6 100644 --- a/src/devices/bus/astrocde/slot.cpp +++ b/src/devices/bus/astrocde/slot.cpp @@ -45,7 +45,7 @@ device_astrocade_cart_interface::~device_astrocade_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_astrocade_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_astrocade_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -62,7 +62,7 @@ void device_astrocade_cart_interface::rom_alloc(UINT32 size, const char *tag) //------------------------------------------------- // astrocade_cart_slot_device - constructor //------------------------------------------------- -astrocade_cart_slot_device::astrocade_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +astrocade_cart_slot_device::astrocade_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASTROCADE_CART_SLOT, "Bally Astrocade Cartridge Slot", tag, owner, clock, "astrocade_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -150,7 +150,7 @@ image_init_result astrocade_cart_slot_device::call_load() { if (m_cart) { - UINT32 size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); m_cart->rom_alloc(size, tag()); if (software_entry() == nullptr) @@ -192,7 +192,7 @@ std::string astrocade_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 size = m_file->size(); + uint32_t size = m_file->size(); int type = ASTROCADE_STD; if (size == 0x40000) diff --git a/src/devices/bus/astrocde/slot.h b/src/devices/bus/astrocde/slot.h index edd94af5ca1..b18a896a3a1 100644 --- a/src/devices/bus/astrocde/slot.h +++ b/src/devices/bus/astrocde/slot.h @@ -32,14 +32,14 @@ public: // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) { return 0xff; } - void rom_alloc(UINT32 size, const char *tag); - UINT8* get_rom_base() { return m_rom; } - UINT32 get_rom_size() { return m_rom_size; } + void rom_alloc(uint32_t size, const char *tag); + uint8_t* get_rom_base() { return m_rom; } + uint32_t get_rom_size() { return m_rom_size; } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; + uint8_t *m_rom; + uint32_t m_rom_size; }; @@ -51,7 +51,7 @@ class astrocade_cart_slot_device : public device_t, { public: // construction/destruction - astrocade_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~astrocade_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp index bec28f963ea..72fbe7f04c3 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.cpp @@ -50,7 +50,7 @@ device_bbc_1mhzbus_interface::~device_bbc_1mhzbus_interface() // bbc_1mhzbus_slot_device - constructor //------------------------------------------------- -bbc_1mhzbus_slot_device::bbc_1mhzbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_1mhzbus_slot_device::bbc_1mhzbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_1MHZBUS_SLOT, "BBC Micro 1MHz Bus port", tag, owner, clock, "bbc_1mhzbus_slot", __FILE__), device_slot_interface(mconfig, *this), m_card(nullptr), diff --git a/src/devices/bus/bbc/1mhzbus/1mhzbus.h b/src/devices/bus/bbc/1mhzbus/1mhzbus.h index 827447656a4..e2f96580c1c 100644 --- a/src/devices/bus/bbc/1mhzbus/1mhzbus.h +++ b/src/devices/bus/bbc/1mhzbus/1mhzbus.h @@ -119,7 +119,7 @@ class bbc_1mhzbus_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - bbc_1mhzbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_1mhzbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~bbc_1mhzbus_slot_device(); // callbacks diff --git a/src/devices/bus/bbc/1mhzbus/opus3.cpp b/src/devices/bus/bbc/1mhzbus/opus3.cpp index b5d4e992940..75bb8700cfd 100644 --- a/src/devices/bus/bbc/1mhzbus/opus3.cpp +++ b/src/devices/bus/bbc/1mhzbus/opus3.cpp @@ -114,7 +114,7 @@ const tiny_rom_entry *bbc_opus3_device::device_rom_region() const // bbc_opus3_device - constructor //------------------------------------------------- -bbc_opus3_device::bbc_opus3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bbc_opus3_device::bbc_opus3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_OPUS3, "Opus Challenger 3-in-1", tag, owner, clock, "bbc_opus3", __FILE__), device_bbc_1mhzbus_interface(mconfig, *this), m_dfs_rom(*this, "dfs_rom"), diff --git a/src/devices/bus/bbc/1mhzbus/opus3.h b/src/devices/bus/bbc/1mhzbus/opus3.h index a1e1451ac69..0e08608d42e 100644 --- a/src/devices/bus/bbc/1mhzbus/opus3.h +++ b/src/devices/bus/bbc/1mhzbus/opus3.h @@ -27,7 +27,7 @@ class bbc_opus3_device: { public: // construction/destruction - bbc_opus3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_opus3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -55,7 +55,7 @@ private: int m_fdc_ie; int m_fdc_drq; - UINT16 m_ramdisk_page; + uint16_t m_ramdisk_page; }; diff --git a/src/devices/bus/bbc/analogue/analogue.cpp b/src/devices/bus/bbc/analogue/analogue.cpp index d0e01ce34cb..2b8fcd110b4 100644 --- a/src/devices/bus/bbc/analogue/analogue.cpp +++ b/src/devices/bus/bbc/analogue/analogue.cpp @@ -49,7 +49,7 @@ device_bbc_analogue_interface::~device_bbc_analogue_interface() // bbc_analogue_slot_device - constructor //------------------------------------------------- -bbc_analogue_slot_device::bbc_analogue_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_analogue_slot_device::bbc_analogue_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_ANALOGUE_SLOT, "BBC Micro Analogue port", tag, owner, clock, "bbc_analogue_slot", __FILE__), device_slot_interface(mconfig, *this) { @@ -65,7 +65,7 @@ void bbc_analogue_slot_device::device_start() m_card = dynamic_cast(get_card_device()); } -UINT8 bbc_analogue_slot_device::ch_r(int channel) +uint8_t bbc_analogue_slot_device::ch_r(int channel) { if (m_card) return m_card->ch_r(channel); @@ -73,7 +73,7 @@ UINT8 bbc_analogue_slot_device::ch_r(int channel) return 0x00; } -UINT8 bbc_analogue_slot_device::pb_r() +uint8_t bbc_analogue_slot_device::pb_r() { if (m_card) return m_card->pb_r(); diff --git a/src/devices/bus/bbc/analogue/analogue.h b/src/devices/bus/bbc/analogue/analogue.h index 36ac229c21f..3558f20fdf1 100644 --- a/src/devices/bus/bbc/analogue/analogue.h +++ b/src/devices/bus/bbc/analogue/analogue.h @@ -61,11 +61,11 @@ class bbc_analogue_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - bbc_analogue_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_analogue_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~bbc_analogue_slot_device() {} - UINT8 ch_r(int channel); - UINT8 pb_r(); + uint8_t ch_r(int channel); + uint8_t pb_r(); protected: // device-level overrides @@ -85,8 +85,8 @@ public: device_bbc_analogue_interface(const machine_config &mconfig, device_t &device); virtual ~device_bbc_analogue_interface(); - virtual UINT8 ch_r(int channel) { return 0x00; }; - virtual UINT8 pb_r() { return 0x30; }; + virtual uint8_t ch_r(int channel) { return 0x00; }; + virtual uint8_t pb_r() { return 0x30; }; protected: bbc_analogue_slot_device *m_slot; diff --git a/src/devices/bus/bbc/analogue/joystick.cpp b/src/devices/bus/bbc/analogue/joystick.cpp index 6dfd56c111b..b72a46c5b60 100644 --- a/src/devices/bus/bbc/analogue/joystick.cpp +++ b/src/devices/bus/bbc/analogue/joystick.cpp @@ -81,7 +81,7 @@ ioport_constructor bbc_voltmace3b_device::device_input_ports() const // bbc_joystick_device - constructor //------------------------------------------------- -bbc_joystick_device::bbc_joystick_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) : +bbc_joystick_device::bbc_joystick_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_bbc_analogue_interface(mconfig, *this), m_joy(*this, "JOY%u", 0), @@ -89,12 +89,12 @@ bbc_joystick_device::bbc_joystick_device(const machine_config &mconfig, device_t { } -bbc_acornjoy_device::bbc_acornjoy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_acornjoy_device::bbc_acornjoy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bbc_joystick_device(mconfig, BBC_ACORNJOY, "Acorn Analogue Joysticks", tag, owner, clock, "bbc_acornjoy", __FILE__) { } -bbc_voltmace3b_device::bbc_voltmace3b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_voltmace3b_device::bbc_voltmace3b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bbc_joystick_device(mconfig, BBC_VOLTMACE3B, "Voltmace Delta 3b Twin Joysticks", tag, owner, clock, "bbc_voltmace3b", __FILE__) { } @@ -122,12 +122,12 @@ void bbc_joystick_device::device_reset() // IMPLEMENTATION //************************************************************************** -UINT8 bbc_joystick_device::ch_r(int channel) +uint8_t bbc_joystick_device::ch_r(int channel) { return m_joy[channel]->read(); } -UINT8 bbc_joystick_device::pb_r() +uint8_t bbc_joystick_device::pb_r() { return m_buttons->read(); } diff --git a/src/devices/bus/bbc/analogue/joystick.h b/src/devices/bus/bbc/analogue/joystick.h index c5812105c4c..3222c3f8565 100644 --- a/src/devices/bus/bbc/analogue/joystick.h +++ b/src/devices/bus/bbc/analogue/joystick.h @@ -27,15 +27,15 @@ class bbc_joystick_device : { public: // construction/destruction - bbc_joystick_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); + bbc_joystick_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: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 ch_r(int channel) override; - virtual UINT8 pb_r() override; + virtual uint8_t ch_r(int channel) override; + virtual uint8_t pb_r() override; private: required_ioport_array<4> m_joy; @@ -45,7 +45,7 @@ private: class bbc_acornjoy_device : public bbc_joystick_device { public: - bbc_acornjoy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_acornjoy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; }; @@ -53,7 +53,7 @@ public: class bbc_voltmace3b_device : public bbc_joystick_device { public: - bbc_voltmace3b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_voltmace3b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; }; diff --git a/src/devices/bus/bbc/fdc/acorn.cpp b/src/devices/bus/bbc/fdc/acorn.cpp index 3f86b2d0a37..b0a159470a0 100644 --- a/src/devices/bus/bbc/fdc/acorn.cpp +++ b/src/devices/bus/bbc/fdc/acorn.cpp @@ -155,7 +155,7 @@ const tiny_rom_entry *bbc_acorn1770_device::device_rom_region() const // bbc_acornfdc_device - constructor //------------------------------------------------- -bbc_acorn8271_device::bbc_acorn8271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bbc_acorn8271_device::bbc_acorn8271_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_ACORN8271, "Acorn 8271 FDC", tag, owner, clock, "bbc_acorn8271", __FILE__), device_bbc_fdc_interface(mconfig, *this), m_dfs_rom(*this, "dfs_rom"), @@ -165,7 +165,7 @@ bbc_acorn8271_device::bbc_acorn8271_device(const machine_config &mconfig, const { } -bbc_acorn1770_device::bbc_acorn1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bbc_acorn1770_device::bbc_acorn1770_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_ACORN1770, "Acorn 1770 FDC", tag, owner, clock, "bbc_acorn1770", __FILE__), device_bbc_fdc_interface(mconfig, *this), m_dfs_rom(*this, "dfs_rom"), diff --git a/src/devices/bus/bbc/fdc/acorn.h b/src/devices/bus/bbc/fdc/acorn.h index 19054de50dd..6d3cdcd5260 100644 --- a/src/devices/bus/bbc/fdc/acorn.h +++ b/src/devices/bus/bbc/fdc/acorn.h @@ -28,7 +28,7 @@ class bbc_acorn8271_device : { public: // construction/destruction - bbc_acorn8271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_acorn8271_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -59,7 +59,7 @@ class bbc_acorn1770_device : { public: // construction/destruction - bbc_acorn1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_acorn1770_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_FLOPPY_FORMATS(floppy_formats); diff --git a/src/devices/bus/bbc/fdc/cumana.cpp b/src/devices/bus/bbc/fdc/cumana.cpp index a41fdf694f0..2d615ce9fb4 100644 --- a/src/devices/bus/bbc/fdc/cumana.cpp +++ b/src/devices/bus/bbc/fdc/cumana.cpp @@ -98,7 +98,7 @@ const tiny_rom_entry *bbc_cumana2_device::device_rom_region() const // bbc_cumanafdc_device - constructor //------------------------------------------------- -bbc_cumanafdc_device::bbc_cumanafdc_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) : +bbc_cumanafdc_device::bbc_cumanafdc_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_bbc_fdc_interface(mconfig, *this), m_dfs_rom(*this, "dfs_rom"), @@ -108,13 +108,13 @@ bbc_cumanafdc_device::bbc_cumanafdc_device(const machine_config &mconfig, device { } -bbc_cumana1_device::bbc_cumana1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_cumana1_device::bbc_cumana1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bbc_cumanafdc_device(mconfig, BBC_CUMANA1, "Cumana QFS 8877A FDC", tag, owner, clock, "bbc_cumana1", __FILE__) { m_invert = true; } -bbc_cumana2_device::bbc_cumana2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_cumana2_device::bbc_cumana2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bbc_cumanafdc_device(mconfig, BBC_CUMANA2, "Cumana QFS Issue 2 8877A FDC", tag, owner, clock, "bbc_cumana2", __FILE__) { m_invert = false; diff --git a/src/devices/bus/bbc/fdc/cumana.h b/src/devices/bus/bbc/fdc/cumana.h index 9c3dab2b3c8..c721966d670 100644 --- a/src/devices/bus/bbc/fdc/cumana.h +++ b/src/devices/bus/bbc/fdc/cumana.h @@ -27,7 +27,7 @@ class bbc_cumanafdc_device : { public: // construction/destruction - bbc_cumanafdc_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); + bbc_cumanafdc_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); DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -57,7 +57,7 @@ private: class bbc_cumana1_device : public bbc_cumanafdc_device { public: - bbc_cumana1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_cumana1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; @@ -66,7 +66,7 @@ public: class bbc_cumana2_device : public bbc_cumanafdc_device { public: - bbc_cumana2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_cumana2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/bbc/fdc/fdc.cpp b/src/devices/bus/bbc/fdc/fdc.cpp index b7f108ef01b..7452047b148 100644 --- a/src/devices/bus/bbc/fdc/fdc.cpp +++ b/src/devices/bus/bbc/fdc/fdc.cpp @@ -48,7 +48,7 @@ device_bbc_fdc_interface::~device_bbc_fdc_interface() // bbc_fdc_slot_device - constructor //------------------------------------------------- -bbc_fdc_slot_device::bbc_fdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_fdc_slot_device::bbc_fdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_FDC_SLOT, "BBC Micro FDC slot", tag, owner, clock, "bbc_fdc_slot", __FILE__), device_slot_interface(mconfig, *this), m_card(nullptr), diff --git a/src/devices/bus/bbc/fdc/fdc.h b/src/devices/bus/bbc/fdc/fdc.h index c161ce84624..7a6006c6a74 100644 --- a/src/devices/bus/bbc/fdc/fdc.h +++ b/src/devices/bus/bbc/fdc/fdc.h @@ -41,7 +41,7 @@ class bbc_fdc_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - bbc_fdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_fdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~bbc_fdc_slot_device(); // callbacks diff --git a/src/devices/bus/bbc/fdc/opus.cpp b/src/devices/bus/bbc/fdc/opus.cpp index c2d1b7321c3..32edee27527 100644 --- a/src/devices/bus/bbc/fdc/opus.cpp +++ b/src/devices/bus/bbc/fdc/opus.cpp @@ -143,7 +143,7 @@ const tiny_rom_entry *bbc_opus1770_device::device_rom_region() const // bbc_opusfdc_device - constructor //------------------------------------------------- -bbc_opusfdc_device::bbc_opusfdc_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) : +bbc_opusfdc_device::bbc_opusfdc_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_bbc_fdc_interface(mconfig, *this), m_dfs_rom(*this, "dfs_rom"), @@ -153,17 +153,17 @@ bbc_opusfdc_device::bbc_opusfdc_device(const machine_config &mconfig, device_typ { } -bbc_opus2791_device::bbc_opus2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bbc_opus2791_device::bbc_opus2791_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bbc_opusfdc_device(mconfig, BBC_OPUS2791, "Opus 2791 FDC", tag, owner, clock, "bbc_opus2791", __FILE__) { } -bbc_opus2793_device::bbc_opus2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bbc_opus2793_device::bbc_opus2793_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bbc_opusfdc_device(mconfig, BBC_OPUS2793, "Opus 2793 FDC", tag, owner, clock, "bbc_opus2793", __FILE__) { } -bbc_opus1770_device::bbc_opus1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bbc_opus1770_device::bbc_opus1770_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bbc_opusfdc_device(mconfig, BBC_OPUS1770, "Opus D-DOS(B) 1770 FDC", tag, owner, clock, "bbc_opus1770", __FILE__) { } diff --git a/src/devices/bus/bbc/fdc/opus.h b/src/devices/bus/bbc/fdc/opus.h index 93cedaa8954..f134a649a6c 100644 --- a/src/devices/bus/bbc/fdc/opus.h +++ b/src/devices/bus/bbc/fdc/opus.h @@ -27,7 +27,7 @@ class bbc_opusfdc_device: { public: // construction/destruction - bbc_opusfdc_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); + bbc_opusfdc_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); DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -54,7 +54,7 @@ private: class bbc_opus2791_device : public bbc_opusfdc_device { public: - bbc_opus2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_opus2791_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; @@ -63,7 +63,7 @@ public: class bbc_opus2793_device : public bbc_opusfdc_device { public: - bbc_opus2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_opus2793_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; @@ -72,7 +72,7 @@ public: class bbc_opus1770_device : public bbc_opusfdc_device { public: - bbc_opus1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_opus1770_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/bbc/fdc/watford.cpp b/src/devices/bus/bbc/fdc/watford.cpp index 0cbd2ee16a0..8a5a95551d7 100644 --- a/src/devices/bus/bbc/fdc/watford.cpp +++ b/src/devices/bus/bbc/fdc/watford.cpp @@ -113,13 +113,13 @@ const tiny_rom_entry *bbc_weddb3_device::device_rom_region() const // bbc_watfordfdc_device - constructor //------------------------------------------------- -bbc_watfordfdc_device::bbc_watfordfdc_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) : +bbc_watfordfdc_device::bbc_watfordfdc_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_bbc_fdc_interface(mconfig, *this) { } -bbc_weddb2_device::bbc_weddb2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bbc_weddb2_device::bbc_weddb2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bbc_watfordfdc_device(mconfig, BBC_WEDDB2, "Watford Electronics DDB2 1772 FDC", tag, owner, clock, "bbc_weddb2", __FILE__), m_dfs_rom(*this, "dfs_rom"), m_fdc(*this, "wd1772"), @@ -128,7 +128,7 @@ bbc_weddb2_device::bbc_weddb2_device(const machine_config &mconfig, const char * { } -bbc_weddb3_device::bbc_weddb3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bbc_weddb3_device::bbc_weddb3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bbc_watfordfdc_device(mconfig, BBC_WEDDB3, "Watford Electronics DDB3 1770 FDC", tag, owner, clock, "bbc_weddb3", __FILE__), m_dfs_rom(*this, "dfs_rom"), m_fdc(*this, "wd1770"), diff --git a/src/devices/bus/bbc/fdc/watford.h b/src/devices/bus/bbc/fdc/watford.h index 9b5dd1e947b..aea965dca6d 100644 --- a/src/devices/bus/bbc/fdc/watford.h +++ b/src/devices/bus/bbc/fdc/watford.h @@ -27,7 +27,7 @@ class bbc_watfordfdc_device : { public: // construction/destruction - bbc_watfordfdc_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); + bbc_watfordfdc_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); DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -38,7 +38,7 @@ public: class bbc_weddb2_device : public bbc_watfordfdc_device { public: - bbc_weddb2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_weddb2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; @@ -63,7 +63,7 @@ private: class bbc_weddb3_device : public bbc_watfordfdc_device { public: - bbc_weddb3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_weddb3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/bbc/joyport/joyport.cpp b/src/devices/bus/bbc/joyport/joyport.cpp index 4d1dcbb017f..4c6f1aefe2f 100644 --- a/src/devices/bus/bbc/joyport/joyport.cpp +++ b/src/devices/bus/bbc/joyport/joyport.cpp @@ -48,7 +48,7 @@ device_bbc_joyport_interface::~device_bbc_joyport_interface() // bbcmc_joyport_slot_device - constructor //------------------------------------------------- -bbc_joyport_slot_device::bbc_joyport_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_joyport_slot_device::bbc_joyport_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_JOYPORT_SLOT, "BBC Master Compact Joystick/Mouse port", tag, owner, clock, "bbc_joyport_slot", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) @@ -65,7 +65,7 @@ void bbc_joyport_slot_device::device_start() m_device = dynamic_cast(get_card_device()); } -UINT8 bbc_joyport_slot_device::cb_r() +uint8_t bbc_joyport_slot_device::cb_r() { if (m_device) return m_device->cb_r(); @@ -73,7 +73,7 @@ UINT8 bbc_joyport_slot_device::cb_r() return 0xff; } -UINT8 bbc_joyport_slot_device::pb_r() +uint8_t bbc_joyport_slot_device::pb_r() { if (m_device) return m_device->pb_r(); diff --git a/src/devices/bus/bbc/joyport/joyport.h b/src/devices/bus/bbc/joyport/joyport.h index 10251235993..cd37d4b7937 100644 --- a/src/devices/bus/bbc/joyport/joyport.h +++ b/src/devices/bus/bbc/joyport/joyport.h @@ -54,11 +54,11 @@ class bbc_joyport_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - bbc_joyport_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_joyport_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~bbc_joyport_slot_device() {} - UINT8 cb_r(); - UINT8 pb_r(); + uint8_t cb_r(); + uint8_t pb_r(); protected: // device-level overrides @@ -78,8 +78,8 @@ public: device_bbc_joyport_interface(const machine_config &mconfig, device_t &device); virtual ~device_bbc_joyport_interface(); - virtual UINT8 cb_r() { return 0xff; } - virtual UINT8 pb_r() { return 0x1f; } + virtual uint8_t cb_r() { return 0xff; } + virtual uint8_t pb_r() { return 0x1f; } protected: bbc_joyport_slot_device *m_slot; diff --git a/src/devices/bus/bbc/joyport/joystick.cpp b/src/devices/bus/bbc/joyport/joystick.cpp index 70f1820049a..74eb3a67d29 100644 --- a/src/devices/bus/bbc/joyport/joystick.cpp +++ b/src/devices/bus/bbc/joyport/joystick.cpp @@ -43,7 +43,7 @@ ioport_constructor bbcmc_joystick_device::device_input_ports() const // bbcmc_joystick_device - constructor //------------------------------------------------- -bbcmc_joystick_device::bbcmc_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bbcmc_joystick_device::bbcmc_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBCMC_JOYSTICK, "Master Compact Joystick", tag, owner, clock, "bbcmc_joystick", __FILE__), device_bbc_joyport_interface(mconfig, *this), m_joy(*this, "JOY") @@ -73,12 +73,12 @@ void bbcmc_joystick_device::device_reset() // IMPLEMENTATION //************************************************************************** -UINT8 bbcmc_joystick_device::cb_r() +uint8_t bbcmc_joystick_device::cb_r() { return 0xff; } -UINT8 bbcmc_joystick_device::pb_r() +uint8_t bbcmc_joystick_device::pb_r() { return m_joy->read(); } diff --git a/src/devices/bus/bbc/joyport/joystick.h b/src/devices/bus/bbc/joyport/joystick.h index c94ce632e75..d5b1a163301 100644 --- a/src/devices/bus/bbc/joyport/joystick.h +++ b/src/devices/bus/bbc/joyport/joystick.h @@ -27,7 +27,7 @@ class bbcmc_joystick_device : { public: // construction/destruction - bbcmc_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbcmc_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,8 +37,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 cb_r() override; - virtual UINT8 pb_r() override; + virtual uint8_t cb_r() override; + virtual uint8_t pb_r() override; private: required_ioport m_joy; diff --git a/src/devices/bus/bbc/tube/tube.cpp b/src/devices/bus/bbc/tube/tube.cpp index 8ce07531fcc..c67b8dd96e9 100644 --- a/src/devices/bus/bbc/tube/tube.cpp +++ b/src/devices/bus/bbc/tube/tube.cpp @@ -51,7 +51,7 @@ device_bbc_tube_interface::~device_bbc_tube_interface() // bbc_tube_slot_device - constructor //------------------------------------------------- -bbc_tube_slot_device::bbc_tube_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_tube_slot_device::bbc_tube_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_TUBE_SLOT, "BBC Micro Tube port", tag, owner, clock, "bbc_tube_slot", __FILE__), device_slot_interface(mconfig, *this) { diff --git a/src/devices/bus/bbc/tube/tube.h b/src/devices/bus/bbc/tube/tube.h index 16314bee603..707bfba5fab 100644 --- a/src/devices/bus/bbc/tube/tube.h +++ b/src/devices/bus/bbc/tube/tube.h @@ -72,7 +72,7 @@ class bbc_tube_slot_device : public device_t, { public: // construction/destruction - bbc_tube_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_tube_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~bbc_tube_slot_device() {} diff --git a/src/devices/bus/bbc/userport/userport.cpp b/src/devices/bus/bbc/userport/userport.cpp index e044e0177d4..5a08fc836ed 100644 --- a/src/devices/bus/bbc/userport/userport.cpp +++ b/src/devices/bus/bbc/userport/userport.cpp @@ -50,7 +50,7 @@ device_bbc_userport_interface::~device_bbc_userport_interface() // bbc_userport_slot_device - constructor //------------------------------------------------- -bbc_userport_device::bbc_userport_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bbc_userport_device::bbc_userport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BBC_USERPORT_SLOT, "BBC Micro User port", tag, owner, clock, "bbc_userport_slot", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) { @@ -76,9 +76,9 @@ void bbc_userport_device::device_start() } -UINT8 bbc_userport_device::read_portb() +uint8_t bbc_userport_device::read_portb() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_device) data |= m_device->read_portb(); return data; diff --git a/src/devices/bus/bbc/userport/userport.h b/src/devices/bus/bbc/userport/userport.h index 0a9de358dda..89593d125f9 100644 --- a/src/devices/bus/bbc/userport/userport.h +++ b/src/devices/bus/bbc/userport/userport.h @@ -47,9 +47,9 @@ public: device_bbc_userport_interface(const machine_config &mconfig, device_t &device); virtual ~device_bbc_userport_interface(); - virtual UINT8 read_portb() { return 0xff; }; - virtual UINT8 read_cb1() { return 0xff; }; - virtual UINT8 read_cb2() { return 0xff; }; + virtual uint8_t read_portb() { return 0xff; }; + virtual uint8_t read_cb1() { return 0xff; }; + virtual uint8_t read_cb2() { return 0xff; }; protected: bbc_userport_device *m_slot; @@ -62,12 +62,12 @@ class bbc_userport_device : public device_t, { public: // construction/destruction - bbc_userport_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bbc_userport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~bbc_userport_device() {} - UINT8 read_portb(); - UINT8 read_cb1(); - UINT8 read_cb2(); + uint8_t read_portb(); + uint8_t read_cb1(); + uint8_t read_cb2(); // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/bml3/bml3bus.cpp b/src/devices/bus/bml3/bml3bus.cpp index 620743dbe68..200d1fc63b5 100644 --- a/src/devices/bus/bml3/bml3bus.cpp +++ b/src/devices/bus/bml3/bml3bus.cpp @@ -59,13 +59,13 @@ const device_type BML3BUS_SLOT = &device_creator; //------------------------------------------------- // bml3bus_slot_device - constructor //------------------------------------------------- -bml3bus_slot_device::bml3bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bml3bus_slot_device::bml3bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BML3BUS_SLOT, "Hitachi MB-6890 Slot", tag, owner, clock, "bml3bus_slot", __FILE__), device_slot_interface(mconfig, *this), m_bml3bus_tag(nullptr), m_bml3bus_slottag(nullptr) { } -bml3bus_slot_device::bml3bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +bml3bus_slot_device::bml3bus_slot_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_slot_interface(mconfig, *this), m_bml3bus_tag(nullptr), m_bml3bus_slottag(nullptr) { @@ -109,7 +109,7 @@ void bml3bus_device::static_set_cputag(device_t &device, const char *tag) // bml3bus_device - constructor //------------------------------------------------- -bml3bus_device::bml3bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bml3bus_device::bml3bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BML3BUS, "Hitachi MB-6890 Bus", tag, owner, clock, "bml3bus", __FILE__), m_maincpu(nullptr), m_out_nmi_cb(*this), m_out_irq_cb(*this), @@ -117,7 +117,7 @@ bml3bus_device::bml3bus_device(const machine_config &mconfig, const char *tag, d { } -bml3bus_device::bml3bus_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) : +bml3bus_device::bml3bus_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_maincpu(nullptr), m_out_nmi_cb(*this), m_out_irq_cb(*this), diff --git a/src/devices/bus/bml3/bml3bus.h b/src/devices/bus/bml3/bml3bus.h index 36c20f4159e..c244b329539 100644 --- a/src/devices/bus/bml3/bml3bus.h +++ b/src/devices/bus/bml3/bml3bus.h @@ -56,8 +56,8 @@ class bml3bus_slot_device : public device_t, { public: // construction/destruction - bml3bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - bml3bus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + bml3bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + bml3bus_slot_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-level overrides virtual void device_start() override; @@ -79,8 +79,8 @@ class bml3bus_device : public device_t { public: // construction/destruction - bml3bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - bml3bus_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); + bml3bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + bml3bus_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); // inline configuration static void static_set_cputag(device_t &device, const char *tag); diff --git a/src/devices/bus/bml3/bml3kanji.cpp b/src/devices/bus/bml3/bml3kanji.cpp index c2af2911e65..b426dc664da 100644 --- a/src/devices/bus/bml3/bml3kanji.cpp +++ b/src/devices/bus/bml3/bml3kanji.cpp @@ -58,7 +58,7 @@ const tiny_rom_entry *bml3bus_kanji_device::device_rom_region() const READ8_MEMBER( bml3bus_kanji_device::bml3_kanji_r ) { - return m_rom[((UINT32)m_kanji_addr << 1) + offset]; + return m_rom[((uint32_t)m_kanji_addr << 1) + offset]; } WRITE8_MEMBER( bml3bus_kanji_device::bml3_kanji_w ) @@ -72,7 +72,7 @@ WRITE8_MEMBER( bml3bus_kanji_device::bml3_kanji_w ) // LIVE DEVICE //************************************************************************** -bml3bus_kanji_device::bml3bus_kanji_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bml3bus_kanji_device::bml3bus_kanji_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BML3BUS_KANJI, "Hitachi MP-9740 Kanji Character ROM Card", tag, owner, clock, "bml3kanji", __FILE__), device_bml3bus_card_interface(mconfig, *this), m_kanji_addr(0), m_rom(nullptr) { diff --git a/src/devices/bus/bml3/bml3kanji.h b/src/devices/bus/bml3/bml3kanji.h index c91ba3cca2e..cf04c6a8fc2 100644 --- a/src/devices/bus/bml3/bml3kanji.h +++ b/src/devices/bus/bml3/bml3kanji.h @@ -24,7 +24,7 @@ class bml3bus_kanji_device: { public: // construction/destruction - bml3bus_kanji_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bml3bus_kanji_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; @@ -37,10 +37,10 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT16 m_kanji_addr; + uint16_t m_kanji_addr; private: - UINT8 *m_rom; + uint8_t *m_rom; }; // device type definition diff --git a/src/devices/bus/bml3/bml3mp1802.cpp b/src/devices/bus/bml3/bml3mp1802.cpp index d8d22c1467b..595d3b97a9f 100644 --- a/src/devices/bus/bml3/bml3mp1802.cpp +++ b/src/devices/bus/bml3/bml3mp1802.cpp @@ -106,7 +106,7 @@ WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w) // LIVE DEVICE //************************************************************************** -bml3bus_mp1802_device::bml3bus_mp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bml3bus_mp1802_device::bml3bus_mp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BML3BUS_MP1802, "Hitachi MP-1802 Floppy Controller Card", tag, owner, clock, "bml3mp1802", __FILE__), device_bml3bus_card_interface(mconfig, *this), m_fdc(*this, "fdc"), @@ -134,7 +134,7 @@ void bml3bus_mp1802_device::device_start() space_prg.install_readwrite_handler(0xff00, 0xff03, read8_delegate(FUNC(mb8866_t::read),(mb8866_t*)m_fdc), write8_delegate(FUNC(mb8866_t::write),(mb8866_t*)m_fdc)); space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this)); // overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work... - UINT8 *mainrom = device().machine().root_device().memregion("maincpu")->base(); + uint8_t *mainrom = device().machine().root_device().memregion("maincpu")->base(); memcpy(mainrom + 0xf800, m_rom + 0xf800, 0x800); } diff --git a/src/devices/bus/bml3/bml3mp1802.h b/src/devices/bus/bml3/bml3mp1802.h index 60191295d36..2047e3146d2 100644 --- a/src/devices/bus/bml3/bml3mp1802.h +++ b/src/devices/bus/bml3/bml3mp1802.h @@ -28,7 +28,7 @@ class bml3bus_mp1802_device: { public: // construction/destruction - bml3bus_mp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bml3bus_mp1802_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; @@ -49,7 +49,7 @@ private: required_device m_floppy2; required_device m_floppy3; - UINT8 *m_rom; + uint8_t *m_rom; }; // device type definition diff --git a/src/devices/bus/bml3/bml3mp1805.cpp b/src/devices/bus/bml3/bml3mp1805.cpp index 23027eeffd0..b4358c60fe7 100644 --- a/src/devices/bus/bml3/bml3mp1805.cpp +++ b/src/devices/bus/bml3/bml3mp1805.cpp @@ -137,7 +137,7 @@ WRITE8_MEMBER( bml3bus_mp1805_device::bml3_mp1805_w) // LIVE DEVICE //************************************************************************** -bml3bus_mp1805_device::bml3bus_mp1805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bml3bus_mp1805_device::bml3bus_mp1805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BML3BUS_MP1805, "Hitachi MP-1805 Floppy Controller Card", tag, owner, clock, "bml3mp1805", __FILE__), device_bml3bus_card_interface(mconfig, *this), m_mc6843(*this, "mc6843"), m_rom(nullptr) @@ -161,7 +161,7 @@ void bml3bus_mp1805_device::device_start() space_prg.install_readwrite_handler(0xff18, 0xff1f, read8_delegate( FUNC(mc6843_device::read), (mc6843_device*)m_mc6843), write8_delegate(FUNC(mc6843_device::write), (mc6843_device*)m_mc6843) ); space_prg.install_readwrite_handler(0xff20, 0xff20, read8_delegate( FUNC(bml3bus_mp1805_device::bml3_mp1805_r), this), write8_delegate(FUNC(bml3bus_mp1805_device::bml3_mp1805_w), this) ); // overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work... - UINT8 *mainrom = device().machine().root_device().memregion("maincpu")->base(); + uint8_t *mainrom = device().machine().root_device().memregion("maincpu")->base(); memcpy(mainrom + 0xf800, m_rom + 0xf800, 0x800); } diff --git a/src/devices/bus/bml3/bml3mp1805.h b/src/devices/bus/bml3/bml3mp1805.h index 662eecfff6a..98b22f0c790 100644 --- a/src/devices/bus/bml3/bml3mp1805.h +++ b/src/devices/bus/bml3/bml3mp1805.h @@ -27,7 +27,7 @@ class bml3bus_mp1805_device: { public: // construction/destruction - bml3bus_mp1805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bml3bus_mp1805_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; @@ -45,7 +45,7 @@ protected: required_device m_mc6843; private: - UINT8 *m_rom; + uint8_t *m_rom; }; // device type definition diff --git a/src/devices/bus/bw2/exp.cpp b/src/devices/bus/bw2/exp.cpp index c79e85fa90a..9ece8a6f071 100644 --- a/src/devices/bus/bw2/exp.cpp +++ b/src/devices/bus/bw2/exp.cpp @@ -51,7 +51,7 @@ device_bw2_expansion_slot_interface::~device_bw2_expansion_slot_interface() // bw2_expansion_slot_device - constructor //------------------------------------------------- -bw2_expansion_slot_device::bw2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bw2_expansion_slot_device::bw2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BW2_EXPANSION_SLOT, "Bondwell 2 expansion port", tag, owner, clock, "bw2_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_cart(nullptr) { @@ -94,7 +94,7 @@ void bw2_expansion_slot_device::device_reset() // cd_r - cartridge data read //------------------------------------------------- -UINT8 bw2_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6) +uint8_t bw2_expansion_slot_device::cd_r(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6) { if (m_cart != nullptr) { @@ -109,7 +109,7 @@ UINT8 bw2_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 // cd_w - cartridge data write //------------------------------------------------- -void bw2_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6) +void bw2_expansion_slot_device::cd_w(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6) { if (m_cart != nullptr) { @@ -124,7 +124,7 @@ void bw2_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 READ8_MEMBER( bw2_expansion_slot_device::slot_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cart != nullptr) { @@ -154,7 +154,7 @@ WRITE8_MEMBER( bw2_expansion_slot_device::slot_w ) READ8_MEMBER( bw2_expansion_slot_device::modsel_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_cart != nullptr) { diff --git a/src/devices/bus/bw2/exp.h b/src/devices/bus/bw2/exp.h index b9d4fbcc0d8..c91c828c6d2 100644 --- a/src/devices/bus/bw2/exp.h +++ b/src/devices/bus/bw2/exp.h @@ -74,12 +74,12 @@ class bw2_expansion_slot_device : public device_t, { public: // construction/destruction - bw2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bw2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~bw2_expansion_slot_device(); // computer interface - UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6); - void cd_w(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6); + uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6); + void cd_w(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6); DECLARE_READ8_MEMBER( slot_r ); DECLARE_WRITE8_MEMBER( slot_w ); @@ -106,14 +106,14 @@ public: device_bw2_expansion_slot_interface(const machine_config &mconfig, device_t &device); virtual ~device_bw2_expansion_slot_interface(); - virtual UINT8 bw2_cd_r(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6) { return data; }; - virtual void bw2_cd_w(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6) { }; + virtual uint8_t bw2_cd_r(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6) { return data; }; + virtual void bw2_cd_w(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6) { }; - virtual UINT8 bw2_slot_r(address_space &space, offs_t offset) { return 0xff; } - virtual void bw2_slot_w(address_space &space, offs_t offset, UINT8 data) { } + virtual uint8_t bw2_slot_r(address_space &space, offs_t offset) { return 0xff; } + virtual void bw2_slot_w(address_space &space, offs_t offset, uint8_t data) { } - virtual UINT8 bw2_modsel_r(address_space &space, offs_t offset) { return 0xff; } - virtual void bw2_modsel_w(address_space &space, offs_t offset, UINT8 data) { } + virtual uint8_t bw2_modsel_r(address_space &space, offs_t offset) { return 0xff; } + virtual void bw2_modsel_w(address_space &space, offs_t offset, uint8_t data) { } protected: bw2_expansion_slot_device *m_slot; diff --git a/src/devices/bus/bw2/ramcard.cpp b/src/devices/bus/bw2/ramcard.cpp index bd8e6e76261..17ed1397a4b 100644 --- a/src/devices/bus/bw2/ramcard.cpp +++ b/src/devices/bus/bw2/ramcard.cpp @@ -46,7 +46,7 @@ const tiny_rom_entry *bw2_ramcard_device::device_rom_region() const // bw2_ramcard_device - constructor //------------------------------------------------- -bw2_ramcard_device::bw2_ramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bw2_ramcard_device::bw2_ramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BW2_RAMCARD, "RAMCARD", tag, owner, clock, "bw2_ramcard", __FILE__), device_bw2_expansion_slot_interface(mconfig, *this), m_rom(*this, "ramcard"), @@ -87,7 +87,7 @@ void bw2_ramcard_device::device_reset() // bw2_cd_r - cartridge data read //------------------------------------------------- -UINT8 bw2_ramcard_device::bw2_cd_r(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6) +uint8_t bw2_ramcard_device::bw2_cd_r(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6) { if (!ram2) { @@ -106,7 +106,7 @@ UINT8 bw2_ramcard_device::bw2_cd_r(address_space &space, offs_t offset, UINT8 da // bw2_cd_r - cartridge data write //------------------------------------------------- -void bw2_ramcard_device::bw2_cd_w(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6) +void bw2_ramcard_device::bw2_cd_w(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6) { if (m_en && !ram5) { @@ -119,7 +119,7 @@ void bw2_ramcard_device::bw2_cd_w(address_space &space, offs_t offset, UINT8 dat // bw2_slot_w - slot write //------------------------------------------------- -void bw2_ramcard_device::bw2_slot_w(address_space &space, offs_t offset, UINT8 data) +void bw2_ramcard_device::bw2_slot_w(address_space &space, offs_t offset, uint8_t data) { m_en = 1; m_bank = data & 0x0f; diff --git a/src/devices/bus/bw2/ramcard.h b/src/devices/bus/bw2/ramcard.h index de510eddb96..2e9707a69c6 100644 --- a/src/devices/bus/bw2/ramcard.h +++ b/src/devices/bus/bw2/ramcard.h @@ -27,7 +27,7 @@ class bw2_ramcard_device : public device_t, { public: // construction/destruction - bw2_ramcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bw2_ramcard_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; @@ -38,16 +38,16 @@ protected: virtual void device_reset() override; // device_bw2_expansion_slot_interface overrides - virtual UINT8 bw2_cd_r(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6) override; - virtual void bw2_cd_w(address_space &space, offs_t offset, UINT8 data, int ram2, int ram3, int ram4, int ram5, int ram6) override; - virtual void bw2_slot_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t bw2_cd_r(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6) override; + virtual void bw2_cd_w(address_space &space, offs_t offset, uint8_t data, int ram2, int ram3, int ram4, int ram5, int ram6) override; + virtual void bw2_slot_w(address_space &space, offs_t offset, uint8_t data) override; private: required_memory_region m_rom; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; int m_en; - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/16kb.cpp b/src/devices/bus/c64/16kb.cpp index 2964073aa1a..b261b6bd2af 100644 --- a/src/devices/bus/c64/16kb.cpp +++ b/src/devices/bus/c64/16kb.cpp @@ -73,7 +73,7 @@ ioport_constructor c64_16kb_cartridge_device::device_input_ports() const // c64_16kb_cartridge_device - constructor //------------------------------------------------- -c64_16kb_cartridge_device::c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_16kb_cartridge_device::c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_16KB, "C64 16KB EPROM cartridge", tag, owner, clock, "c64_16kb", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_sw1(*this, "SW1"), @@ -98,7 +98,7 @@ void c64_16kb_cartridge_device::device_start() void c64_16kb_cartridge_device::device_reset() { - UINT8 mode = m_sw1->read(); + uint8_t mode = m_sw1->read(); m_exrom = BIT(mode, 0); m_game = BIT(mode, 1); @@ -109,7 +109,7 @@ void c64_16kb_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { diff --git a/src/devices/bus/c64/16kb.h b/src/devices/bus/c64/16kb.h index fd4b7a50fcb..3b3a72db8d8 100644 --- a/src/devices/bus/c64/16kb.h +++ b/src/devices/bus/c64/16kb.h @@ -30,7 +30,7 @@ class c64_16kb_cartridge_device : public device_t, { public: // construction/destruction - c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_16kb_cartridge_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; @@ -42,7 +42,7 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_ioport m_sw1; diff --git a/src/devices/bus/c64/4dxh.cpp b/src/devices/bus/c64/4dxh.cpp index 2dd54543203..af86120b97f 100644 --- a/src/devices/bus/c64/4dxh.cpp +++ b/src/devices/bus/c64/4dxh.cpp @@ -61,7 +61,7 @@ ioport_constructor c64_4dxh_device::device_input_ports() const // c64_4dxh_device - constructor //------------------------------------------------- -c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_4DXH, "C64 DXH 4-Player Adapter", tag, owner, clock, "c64_4dxh", __FILE__), device_pet_user_port_interface(mconfig, *this) { diff --git a/src/devices/bus/c64/4dxh.h b/src/devices/bus/c64/4dxh.h index a8a0a684fe5..25558b6ac3c 100644 --- a/src/devices/bus/c64/4dxh.h +++ b/src/devices/bus/c64/4dxh.h @@ -28,7 +28,7 @@ class c64_4dxh_device : public device_t, { public: // construction/destruction - c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/c64/4ksa.cpp b/src/devices/bus/c64/4ksa.cpp index 749053fde32..78c98279fd0 100644 --- a/src/devices/bus/c64/4ksa.cpp +++ b/src/devices/bus/c64/4ksa.cpp @@ -61,7 +61,7 @@ ioport_constructor c64_4ksa_device::device_input_ports() const // c64_4ksa_device - constructor //------------------------------------------------- -c64_4ksa_device::c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_4ksa_device::c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_4KSA, "C64 Kingsoft 4-Player Adapter", tag, owner, clock, "c64_4ksa", __FILE__), device_pet_user_port_interface(mconfig, *this) { diff --git a/src/devices/bus/c64/4ksa.h b/src/devices/bus/c64/4ksa.h index bbb61e0bf73..96ce1c1e704 100644 --- a/src/devices/bus/c64/4ksa.h +++ b/src/devices/bus/c64/4ksa.h @@ -28,7 +28,7 @@ class c64_4ksa_device : public device_t, { public: // construction/destruction - c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/c64/4tba.cpp b/src/devices/bus/c64/4tba.cpp index 56266f5d916..b68672871d3 100644 --- a/src/devices/bus/c64/4tba.cpp +++ b/src/devices/bus/c64/4tba.cpp @@ -61,7 +61,7 @@ ioport_constructor c64_4tba_device::device_input_ports() const // c64_4tba_device - constructor //------------------------------------------------- -c64_4tba_device::c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_4tba_device::c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_4TBA, "C64 Tie Break Adapter", tag, owner, clock, "c64_4tba", __FILE__), device_pet_user_port_interface(mconfig, *this) { diff --git a/src/devices/bus/c64/4tba.h b/src/devices/bus/c64/4tba.h index c7505d0d49a..ec28657c06e 100644 --- a/src/devices/bus/c64/4tba.h +++ b/src/devices/bus/c64/4tba.h @@ -28,7 +28,7 @@ class c64_4tba_device : public device_t, { public: // construction/destruction - c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/c64/bn1541.cpp b/src/devices/bus/c64/bn1541.cpp index fb24b459d1b..7b88d78f4f1 100644 --- a/src/devices/bus/c64/bn1541.cpp +++ b/src/devices/bus/c64/bn1541.cpp @@ -60,7 +60,7 @@ device_c64_floppy_parallel_interface::~device_c64_floppy_parallel_interface() // c64_bn1541_device - constructor //------------------------------------------------- -c64_bn1541_device::c64_bn1541_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_bn1541_device::c64_bn1541_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_BN1541, "C64 Burst Nibbler 1541/1571 Parallel Cable", tag, owner, clock, "c64_bn1541", __FILE__), device_pet_user_port_interface(mconfig, *this), device_c64_floppy_parallel_interface(mconfig, *this), m_parallel_output(0) @@ -95,7 +95,7 @@ void c64_bn1541_device::device_start() // parallel_data_w - //------------------------------------------------- -void c64_bn1541_device::parallel_data_w(UINT8 data) +void c64_bn1541_device::parallel_data_w(uint8_t data) { if (LOG) logerror("1541 parallel data %02x\n", data); diff --git a/src/devices/bus/c64/bn1541.h b/src/devices/bus/c64/bn1541.h index a3f0a1834b6..7578145fc67 100644 --- a/src/devices/bus/c64/bn1541.h +++ b/src/devices/bus/c64/bn1541.h @@ -30,13 +30,13 @@ public: device_c64_floppy_parallel_interface(const machine_config &mconfig, device_t &device); virtual ~device_c64_floppy_parallel_interface(); - virtual void parallel_data_w(UINT8 data) = 0; + virtual void parallel_data_w(uint8_t data) = 0; virtual void parallel_strobe_w(int state) = 0; device_c64_floppy_parallel_interface *m_other; protected: - UINT8 m_parallel_data; + uint8_t m_parallel_data; }; @@ -48,14 +48,14 @@ class c64_bn1541_device : public device_t, { public: // construction/destruction - c64_bn1541_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_bn1541_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_c64_floppy_parallel_interface overrides - virtual void parallel_data_w(UINT8 data) override; + virtual void parallel_data_w(uint8_t data) override; virtual void parallel_strobe_w(int state) override; // device_pet_user_port_interface overrides @@ -71,7 +71,7 @@ protected: private: void update_output(); - UINT8 m_parallel_output; + uint8_t m_parallel_output; }; diff --git a/src/devices/bus/c64/c128_comal80.cpp b/src/devices/bus/c64/c128_comal80.cpp index 25accd52fa0..b092a996cbb 100644 --- a/src/devices/bus/c64/c128_comal80.cpp +++ b/src/devices/bus/c64/c128_comal80.cpp @@ -26,7 +26,7 @@ const device_type C128_COMAL80 = &device_creator; // c128_comal80_cartridge_device - constructor //------------------------------------------------- -c128_comal80_cartridge_device::c128_comal80_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c128_comal80_cartridge_device::c128_comal80_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C128_COMAL80, "C128 COMAL 80 cartridge", tag, owner, clock, "c128_comal80", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_bank(0) @@ -59,7 +59,7 @@ void c128_comal80_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!romh) { @@ -79,7 +79,7 @@ UINT8 c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offse // c64_cd_w - cartridge data write //------------------------------------------------- -void c128_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c128_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/c128_comal80.h b/src/devices/bus/c64/c128_comal80.h index e403cd8b10f..42709121173 100644 --- a/src/devices/bus/c64/c128_comal80.h +++ b/src/devices/bus/c64/c128_comal80.h @@ -28,7 +28,7 @@ class c128_comal80_cartridge_device : public device_t, { public: // construction/destruction - c128_comal80_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c128_comal80_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,11 +36,11 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/c128_partner.cpp b/src/devices/bus/c64/c128_partner.cpp index fe751585099..3002a6e6edd 100644 --- a/src/devices/bus/c64/c128_partner.cpp +++ b/src/devices/bus/c64/c128_partner.cpp @@ -76,7 +76,7 @@ ioport_constructor partner128_t::device_input_ports() const // partner128_t - constructor //------------------------------------------------- -partner128_t::partner128_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +partner128_t::partner128_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C128_PARTNER, "PARTNER 128", tag, owner, clock, "c128_partner", __FILE__), device_c64_expansion_card_interface(mconfig, *this), //device_vcs_control_port_interface(mconfig, *this), @@ -147,7 +147,7 @@ void partner128_t::device_timer(emu_timer &timer, device_timer_id id, int param, // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 partner128_t::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t partner128_t::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { @@ -185,7 +185,7 @@ UINT8 partner128_t::c64_cd_r(address_space &space, offs_t offset, UINT8 data, in // c64_cd_w - cartridge data write //------------------------------------------------- -void partner128_t::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void partner128_t::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { @@ -235,7 +235,7 @@ void partner128_t::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int // vcs_joy_w - joystick write //------------------------------------------------- -void partner128_t::vcs_joy_w(UINT8 data) +void partner128_t::vcs_joy_w(uint8_t data) { int joyb2 = BIT(data, 2); diff --git a/src/devices/bus/c64/c128_partner.h b/src/devices/bus/c64/c128_partner.h index 1ba872ca121..cc70bc459fa 100644 --- a/src/devices/bus/c64/c128_partner.h +++ b/src/devices/bus/c64/c128_partner.h @@ -29,7 +29,7 @@ class partner128_t : public device_t, { public: // construction/destruction - partner128_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + partner128_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -43,14 +43,14 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; // device_vcs_control_port_interface overrides - virtual void vcs_joy_w(UINT8 data); + virtual void vcs_joy_w(uint8_t data); private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; emu_timer *t_joyb2; int m_ram_a12_a7; diff --git a/src/devices/bus/c64/comal80.cpp b/src/devices/bus/c64/comal80.cpp index b72c9182b7c..cab19fe118f 100644 --- a/src/devices/bus/c64/comal80.cpp +++ b/src/devices/bus/c64/comal80.cpp @@ -26,7 +26,7 @@ const device_type C64_COMAL80 = &device_creator; // c64_comal80_cartridge_device - constructor //------------------------------------------------- -c64_comal80_cartridge_device::c64_comal80_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_comal80_cartridge_device::c64_comal80_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_COMAL80, "C64 COMAL 80 cartridge", tag, owner, clock, "c64_comal80", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_bank(0) @@ -59,7 +59,7 @@ void c64_comal80_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml || !romh) { @@ -75,7 +75,7 @@ UINT8 c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/comal80.h b/src/devices/bus/c64/comal80.h index b77adf1a8bd..3c38c774e1d 100644 --- a/src/devices/bus/c64/comal80.h +++ b/src/devices/bus/c64/comal80.h @@ -28,7 +28,7 @@ class c64_comal80_cartridge_device : public device_t, { public: // construction/destruction - c64_comal80_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_comal80_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,11 +36,11 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/cpm.cpp b/src/devices/bus/c64/cpm.cpp index 33659b4e977..926eda0a15e 100644 --- a/src/devices/bus/c64/cpm.cpp +++ b/src/devices/bus/c64/cpm.cpp @@ -129,7 +129,7 @@ inline void c64_cpm_cartridge_device::update_signals() // c64_cpm_cartridge_device - constructor //------------------------------------------------- -c64_cpm_cartridge_device::c64_cpm_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_cpm_cartridge_device::c64_cpm_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_CPM, "C64 CP/M cartridge", tag, owner, clock, "c64_cpm", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), @@ -168,7 +168,7 @@ void c64_cpm_cartridge_device::device_reset() // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_cpm_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_cpm_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { @@ -202,7 +202,7 @@ int c64_cpm_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int r READ8_MEMBER( c64_cpm_cartridge_device::dma_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_enabled) { diff --git a/src/devices/bus/c64/cpm.h b/src/devices/bus/c64/cpm.h index 1e10bc810ce..95ba8e9ea57 100644 --- a/src/devices/bus/c64/cpm.h +++ b/src/devices/bus/c64/cpm.h @@ -28,7 +28,7 @@ class c64_cpm_cartridge_device : public device_t, { public: // construction/destruction - c64_cpm_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_cpm_cartridge_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; @@ -43,7 +43,7 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; private: diff --git a/src/devices/bus/c64/currah_speech.cpp b/src/devices/bus/c64/currah_speech.cpp index 1285730416c..ffee35fc9c0 100644 --- a/src/devices/bus/c64/currah_speech.cpp +++ b/src/devices/bus/c64/currah_speech.cpp @@ -154,7 +154,7 @@ void c64_currah_speech_cartridge_device::set_osc1(int voice, int intonation) // c64_currah_speech_cartridge_device - constructor //------------------------------------------------- -c64_currah_speech_cartridge_device::c64_currah_speech_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_currah_speech_cartridge_device::c64_currah_speech_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_CURRAH_SPEECH, "C64 Currah Speech", tag, owner, clock, "c64_cs", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_nsp(*this, SP0256_TAG) @@ -186,7 +186,7 @@ void c64_currah_speech_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_currah_speech_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_currah_speech_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!romh) { @@ -226,7 +226,7 @@ UINT8 c64_currah_speech_cartridge_device::c64_cd_r(address_space &space, offs_t // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_currah_speech_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_currah_speech_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/currah_speech.h b/src/devices/bus/c64/currah_speech.h index 03f684275d2..2dfd9d519eb 100644 --- a/src/devices/bus/c64/currah_speech.h +++ b/src/devices/bus/c64/currah_speech.h @@ -29,7 +29,7 @@ class c64_currah_speech_cartridge_device : public device_t, { public: // construction/destruction - c64_currah_speech_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_currah_speech_cartridge_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; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: inline void set_osc1(int voice, int intonation); diff --git a/src/devices/bus/c64/dela_ep256.cpp b/src/devices/bus/c64/dela_ep256.cpp index f4c86f20db5..3706c16deff 100644 --- a/src/devices/bus/c64/dela_ep256.cpp +++ b/src/devices/bus/c64/dela_ep256.cpp @@ -61,7 +61,7 @@ machine_config_constructor c64_dela_ep256_cartridge_device::device_mconfig_addit // c64_dela_ep256_cartridge_device - constructor //------------------------------------------------- -c64_dela_ep256_cartridge_device::c64_dela_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_dela_ep256_cartridge_device::c64_dela_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_DELA_EP256, "C64 Dela 256KB EPROM cartridge", tag, owner, clock, "delep256", __FILE__), device_c64_expansion_card_interface(mconfig, *this) { @@ -104,7 +104,7 @@ void c64_dela_ep256_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { @@ -127,7 +127,7 @@ UINT8 c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t off // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_dela_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_dela_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2 && ((offset & 0xf0) == 0xa0)) { diff --git a/src/devices/bus/c64/dela_ep256.h b/src/devices/bus/c64/dela_ep256.h index df5ce8580e5..d2822633000 100644 --- a/src/devices/bus/c64/dela_ep256.h +++ b/src/devices/bus/c64/dela_ep256.h @@ -30,7 +30,7 @@ class c64_dela_ep256_cartridge_device : public device_t, { public: // construction/destruction - c64_dela_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_dela_ep256_cartridge_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; @@ -41,13 +41,13 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: generic_slot_device *m_eproms[8]; - UINT8 m_bank, m_socket; + uint8_t m_bank, m_socket; int m_reset; }; diff --git a/src/devices/bus/c64/dela_ep64.cpp b/src/devices/bus/c64/dela_ep64.cpp index 25aeb844deb..9acdf42969c 100644 --- a/src/devices/bus/c64/dela_ep64.cpp +++ b/src/devices/bus/c64/dela_ep64.cpp @@ -48,7 +48,7 @@ machine_config_constructor c64_dela_ep64_cartridge_device::device_mconfig_additi // c64_dela_ep64_cartridge_device - constructor //------------------------------------------------- -c64_dela_ep64_cartridge_device::c64_dela_ep64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_dela_ep64_cartridge_device::c64_dela_ep64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_DELA_EP64, "C64 Rex 64KB EPROM cartridge", tag, owner, clock, "c64_dela_ep64", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_eprom1(*this, "eprom1"), @@ -88,7 +88,7 @@ void c64_dela_ep64_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { @@ -114,7 +114,7 @@ UINT8 c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offs // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_dela_ep64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_dela_ep64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/dela_ep64.h b/src/devices/bus/c64/dela_ep64.h index db1da8feca0..edda0ad2824 100644 --- a/src/devices/bus/c64/dela_ep64.h +++ b/src/devices/bus/c64/dela_ep64.h @@ -30,7 +30,7 @@ class c64_dela_ep64_cartridge_device : public device_t, { public: // construction/destruction - c64_dela_ep64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_dela_ep64_cartridge_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; @@ -41,14 +41,14 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_eprom1; required_device m_eprom2; - UINT8 m_bank; + uint8_t m_bank; int m_reset; int m_rom0_ce; int m_rom1_ce; diff --git a/src/devices/bus/c64/dela_ep7x8.cpp b/src/devices/bus/c64/dela_ep7x8.cpp index dc3a036cb14..3100d048436 100644 --- a/src/devices/bus/c64/dela_ep7x8.cpp +++ b/src/devices/bus/c64/dela_ep7x8.cpp @@ -58,7 +58,7 @@ machine_config_constructor c64_dela_ep7x8_cartridge_device::device_mconfig_addit // c64_dela_ep7x8_cartridge_device - constructor //------------------------------------------------- -c64_dela_ep7x8_cartridge_device::c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_dela_ep7x8_cartridge_device::c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_DELA_EP7X8, "C64 Dela 7x8KB EPROM cartridge", tag, owner, clock, "ep7x8", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_eprom1(*this, "rom1"), @@ -98,7 +98,7 @@ void c64_dela_ep7x8_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { @@ -122,7 +122,7 @@ UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t off // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_dela_ep7x8_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_dela_ep7x8_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/dela_ep7x8.h b/src/devices/bus/c64/dela_ep7x8.h index 904eda891e2..56b8e12f62c 100644 --- a/src/devices/bus/c64/dela_ep7x8.h +++ b/src/devices/bus/c64/dela_ep7x8.h @@ -30,7 +30,7 @@ class c64_dela_ep7x8_cartridge_device : public device_t, { public: // construction/destruction - c64_dela_ep7x8_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_dela_ep7x8_cartridge_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; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_eprom1; @@ -53,7 +53,7 @@ private: required_device m_eprom6; required_device m_eprom7; - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/dinamic.cpp b/src/devices/bus/c64/dinamic.cpp index d52af7ba74e..78aa8f2fbc7 100644 --- a/src/devices/bus/c64/dinamic.cpp +++ b/src/devices/bus/c64/dinamic.cpp @@ -26,7 +26,7 @@ const device_type C64_DINAMIC = &device_creator; // c64_dinamic_cartridge_device - constructor //------------------------------------------------- -c64_dinamic_cartridge_device::c64_dinamic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_dinamic_cartridge_device::c64_dinamic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_DINAMIC, "C64 Dinamic cartridge", tag, owner, clock, "c64_dinamic", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_bank(0) @@ -59,7 +59,7 @@ void c64_dinamic_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dinamic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_dinamic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { diff --git a/src/devices/bus/c64/dinamic.h b/src/devices/bus/c64/dinamic.h index 234f14c43eb..c2f592c48ae 100644 --- a/src/devices/bus/c64/dinamic.h +++ b/src/devices/bus/c64/dinamic.h @@ -28,7 +28,7 @@ class c64_dinamic_cartridge_device : public device_t, { public: // construction/destruction - c64_dinamic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_dinamic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,10 +36,10 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/dqbb.cpp b/src/devices/bus/c64/dqbb.cpp index 6e98707587a..c145e8660ad 100644 --- a/src/devices/bus/c64/dqbb.cpp +++ b/src/devices/bus/c64/dqbb.cpp @@ -35,7 +35,7 @@ const device_type C64_DQBB = &device_creator; // c64_dqbb_cartridge_device - constructor //------------------------------------------------- -c64_dqbb_cartridge_device::c64_dqbb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_dqbb_cartridge_device::c64_dqbb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_DQBB, "C64 Double Quick Brown Box cartridge", tag, owner, clock, "c64_dqbb", __FILE__), device_c64_expansion_card_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -77,7 +77,7 @@ void c64_dqbb_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!m_cs && (!roml || !romh)) { @@ -92,7 +92,7 @@ UINT8 c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, U // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_dqbb_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_dqbb_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!m_cs && m_we && (offset >= 0x8000 && offset < 0xc000)) { diff --git a/src/devices/bus/c64/dqbb.h b/src/devices/bus/c64/dqbb.h index f826cf5e165..56fa57ccb4d 100644 --- a/src/devices/bus/c64/dqbb.h +++ b/src/devices/bus/c64/dqbb.h @@ -30,7 +30,7 @@ class c64_dqbb_cartridge_device : public device_t, { public: // construction/destruction - c64_dqbb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_dqbb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -43,8 +43,8 @@ protected: virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } } // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: int m_cs; diff --git a/src/devices/bus/c64/easy_calc_result.cpp b/src/devices/bus/c64/easy_calc_result.cpp index db7e35b3067..edb0510f1e9 100644 --- a/src/devices/bus/c64/easy_calc_result.cpp +++ b/src/devices/bus/c64/easy_calc_result.cpp @@ -47,7 +47,7 @@ const device_type C64_EASY_CALC_RESULT = &device_creator m_flash_roml; required_device m_flash_romh; required_ioport m_jp1; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; - UINT8 m_bank; - UINT8 m_mode; + uint8_t m_bank; + uint8_t m_mode; }; diff --git a/src/devices/bus/c64/epyx_fast_load.cpp b/src/devices/bus/c64/epyx_fast_load.cpp index ebe3863088c..57ad6f45bf3 100644 --- a/src/devices/bus/c64/epyx_fast_load.cpp +++ b/src/devices/bus/c64/epyx_fast_load.cpp @@ -36,7 +36,7 @@ const device_type C64_EPYX_FAST_LOAD = &device_creator; // c64_exos_cartridge_device - constructor //------------------------------------------------- -c64_exos_cartridge_device::c64_exos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_exos_cartridge_device::c64_exos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_EXOS, "C64 ExOS cartridge", tag, owner, clock, "c64_exos", __FILE__), device_c64_expansion_card_interface(mconfig, *this) { @@ -46,7 +46,7 @@ void c64_exos_cartridge_device::device_start() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_exos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_exos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!romh) { diff --git a/src/devices/bus/c64/exos.h b/src/devices/bus/c64/exos.h index 7f4785098f4..7aa210fa27b 100644 --- a/src/devices/bus/c64/exos.h +++ b/src/devices/bus/c64/exos.h @@ -28,14 +28,14 @@ class c64_exos_cartridge_device : public device_t, { public: // construction/destruction - c64_exos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_exos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; }; diff --git a/src/devices/bus/c64/exp.cpp b/src/devices/bus/c64/exp.cpp index 80f7b13639e..92c7eb64e5d 100644 --- a/src/devices/bus/c64/exp.cpp +++ b/src/devices/bus/c64/exp.cpp @@ -56,7 +56,7 @@ device_c64_expansion_card_interface::~device_c64_expansion_card_interface() // c64_expansion_slot_device - constructor //------------------------------------------------- -c64_expansion_slot_device::c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_expansion_slot_device::c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_EXPANSION_SLOT, "C64 expansion port", tag, owner, clock, "c64_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), @@ -155,8 +155,8 @@ image_init_result c64_expansion_slot_device::call_load() if (cbm_crt_read_header(*m_file, &roml_size, &romh_size, &exrom, &game)) { - UINT8 *roml = nullptr; - UINT8 *romh = nullptr; + uint8_t *roml = nullptr; + uint8_t *romh = nullptr; m_card->m_roml.allocate(roml_size); m_card->m_romh.allocate(romh_size); @@ -223,7 +223,7 @@ std::string c64_expansion_slot_device::get_default_card_software() // cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (m_card != nullptr) { @@ -238,7 +238,7 @@ UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 // cd_w - cartridge data write //------------------------------------------------- -void c64_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_expansion_slot_device::cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (m_card != nullptr) { diff --git a/src/devices/bus/c64/exp.h b/src/devices/bus/c64/exp.h index 4e4555173fa..67cdd7bd235 100644 --- a/src/devices/bus/c64/exp.h +++ b/src/devices/bus/c64/exp.h @@ -102,7 +102,7 @@ class c64_expansion_slot_device : public device_t, { public: // construction/destruction - c64_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_expansion_slot_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); } template static devcb_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_nmi.set_callback(object); } @@ -112,8 +112,8 @@ public: template static devcb_base &set_dma_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_dma.set_callback(object); } // computer interface - UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); - void cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); + uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2); + void cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2); int game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); int exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram); @@ -175,15 +175,15 @@ public: device_c64_expansion_card_interface(const machine_config &mconfig, device_t &device); virtual ~device_c64_expansion_card_interface(); - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) { return data; }; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) { }; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { return data; }; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { }; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) { return m_game; } virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) { return m_exrom; } protected: - optional_shared_ptr m_roml; - optional_shared_ptr m_romh; - optional_shared_ptr m_nvram; + optional_shared_ptr m_roml; + optional_shared_ptr m_romh; + optional_shared_ptr m_nvram; int m_game; int m_exrom; diff --git a/src/devices/bus/c64/fcc.cpp b/src/devices/bus/c64/fcc.cpp index 93e5fe4ccc4..7ee25067e60 100644 --- a/src/devices/bus/c64/fcc.cpp +++ b/src/devices/bus/c64/fcc.cpp @@ -118,7 +118,7 @@ ioport_constructor c64_final_chesscard_device::device_input_ports() const // c64_final_chesscard_device - constructor //------------------------------------------------- -c64_final_chesscard_device::c64_final_chesscard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_final_chesscard_device::c64_final_chesscard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_FCC, "Final ChessCard", tag, owner, clock, "c64_fcc", __FILE__), device_c64_expansion_card_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -156,7 +156,7 @@ void c64_final_chesscard_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_final_chesscard_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_final_chesscard_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { @@ -182,7 +182,7 @@ UINT8 c64_final_chesscard_device::c64_cd_r(address_space &space, offs_t offset, // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_final_chesscard_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_final_chesscard_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { diff --git a/src/devices/bus/c64/fcc.h b/src/devices/bus/c64/fcc.h index 29d22dde05c..5a6960bd8a8 100644 --- a/src/devices/bus/c64/fcc.h +++ b/src/devices/bus/c64/fcc.h @@ -29,7 +29,7 @@ class c64_final_chesscard_device : public device_t, { public: // construction/destruction - c64_final_chesscard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_final_chesscard_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; @@ -50,13 +50,13 @@ protected: virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } } // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_maincpu; - UINT8 m_bank; + uint8_t m_bank; int m_ramen; }; diff --git a/src/devices/bus/c64/final.cpp b/src/devices/bus/c64/final.cpp index 4087201c5cb..a1d34e170aa 100644 --- a/src/devices/bus/c64/final.cpp +++ b/src/devices/bus/c64/final.cpp @@ -62,7 +62,7 @@ ioport_constructor c64_final_cartridge_device::device_input_ports() const // c64_final_cartridge_device - constructor //------------------------------------------------- -c64_final_cartridge_device::c64_final_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_final_cartridge_device::c64_final_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_FINAL, "C64 Final cartridge", tag, owner, clock, "c64_final", __FILE__), device_c64_expansion_card_interface(mconfig, *this) { @@ -93,7 +93,7 @@ void c64_final_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml || !romh || !io1 || !io2) { @@ -119,7 +119,7 @@ UINT8 c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_final_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_final_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/final.h b/src/devices/bus/c64/final.h index cbf7fab0b73..85deee27964 100644 --- a/src/devices/bus/c64/final.h +++ b/src/devices/bus/c64/final.h @@ -28,7 +28,7 @@ class c64_final_cartridge_device : public device_t, { public: // construction/destruction - c64_final_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_final_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; }; diff --git a/src/devices/bus/c64/final3.cpp b/src/devices/bus/c64/final3.cpp index a72963123ba..7815ec1d5dc 100644 --- a/src/devices/bus/c64/final3.cpp +++ b/src/devices/bus/c64/final3.cpp @@ -63,7 +63,7 @@ ioport_constructor c64_final3_cartridge_device::device_input_ports() const // c64_final3_cartridge_device - constructor //------------------------------------------------- -c64_final3_cartridge_device::c64_final3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_final3_cartridge_device::c64_final3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_FINAL3, "C64 Final Cartridge III", tag, owner, clock, "c64_final3", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_bank(0), m_hidden(0) { @@ -103,7 +103,7 @@ void c64_final3_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml || !romh || !io1 || !io2) { @@ -119,7 +119,7 @@ UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_final3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_final3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!m_hidden && !io2 && ((offset & 0xff) == 0xff)) { diff --git a/src/devices/bus/c64/final3.h b/src/devices/bus/c64/final3.h index 42c1e1aa9f8..92c12da282a 100644 --- a/src/devices/bus/c64/final3.h +++ b/src/devices/bus/c64/final3.h @@ -28,7 +28,7 @@ class c64_final3_cartridge_device : public device_t, { public: // construction/destruction - c64_final3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_final3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -41,11 +41,11 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT8 m_bank; + uint8_t m_bank; int m_hidden; }; diff --git a/src/devices/bus/c64/fun_play.cpp b/src/devices/bus/c64/fun_play.cpp index 971521773a7..e265bf05442 100644 --- a/src/devices/bus/c64/fun_play.cpp +++ b/src/devices/bus/c64/fun_play.cpp @@ -26,7 +26,7 @@ const device_type C64_FUN_PLAY = &device_creator; // c64_fun_play_cartridge_device - constructor //------------------------------------------------- -c64_fun_play_cartridge_device::c64_fun_play_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_fun_play_cartridge_device::c64_fun_play_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_FUN_PLAY, "C64 Fun Play cartridge", tag, owner, clock, "c64_fun_play", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_bank(0) @@ -59,7 +59,7 @@ void c64_fun_play_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_fun_play_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_fun_play_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { @@ -75,7 +75,7 @@ UINT8 c64_fun_play_cartridge_device::c64_cd_r(address_space &space, offs_t offse // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_fun_play_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_fun_play_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/fun_play.h b/src/devices/bus/c64/fun_play.h index 8e4e7528eb7..3a7c5bee76f 100644 --- a/src/devices/bus/c64/fun_play.h +++ b/src/devices/bus/c64/fun_play.h @@ -28,7 +28,7 @@ class c64_fun_play_cartridge_device : public device_t, { public: // construction/destruction - c64_fun_play_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_fun_play_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,11 +36,11 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/geocable.cpp b/src/devices/bus/c64/geocable.cpp index 3b6acc54d2a..0c884418ce5 100644 --- a/src/devices/bus/c64/geocable.cpp +++ b/src/devices/bus/c64/geocable.cpp @@ -55,7 +55,7 @@ machine_config_constructor c64_geocable_device::device_mconfig_additions() const // c64_geocable_device - constructor //------------------------------------------------- -c64_geocable_device::c64_geocable_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_geocable_device::c64_geocable_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_GEOCABLE, "C64 geoCable", tag, owner, clock, "c64_geocable", __FILE__), device_pet_user_port_interface(mconfig, *this), m_centronics(*this, CENTRONICS_TAG) diff --git a/src/devices/bus/c64/geocable.h b/src/devices/bus/c64/geocable.h index 6b823b9a668..e7faad2553c 100644 --- a/src/devices/bus/c64/geocable.h +++ b/src/devices/bus/c64/geocable.h @@ -29,7 +29,7 @@ class c64_geocable_device : public device_t, { public: // construction/destruction - c64_geocable_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_geocable_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; diff --git a/src/devices/bus/c64/georam.cpp b/src/devices/bus/c64/georam.cpp index ccdcebedc40..fe147565f79 100644 --- a/src/devices/bus/c64/georam.cpp +++ b/src/devices/bus/c64/georam.cpp @@ -26,7 +26,7 @@ const device_type C64_GEORAM = &device_creator; // c64_georam_cartridge_device - constructor //------------------------------------------------- -c64_georam_cartridge_device::c64_georam_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_georam_cartridge_device::c64_georam_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_GEORAM, "C64 GeoRAM cartridge", tag, owner, clock, "c64_georam", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_ram(*this, "ram"), @@ -63,7 +63,7 @@ void c64_georam_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { @@ -79,7 +79,7 @@ UINT8 c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_georam_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_georam_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/georam.h b/src/devices/bus/c64/georam.h index bf1a431244d..1d570f51e71 100644 --- a/src/devices/bus/c64/georam.h +++ b/src/devices/bus/c64/georam.h @@ -28,7 +28,7 @@ class c64_georam_cartridge_device : public device_t, { public: // construction/destruction - c64_georam_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_georam_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,13 +36,13 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; - UINT16 m_bank; + uint16_t m_bank; }; diff --git a/src/devices/bus/c64/ide64.cpp b/src/devices/bus/c64/ide64.cpp index 01def305dd5..f96b7885699 100644 --- a/src/devices/bus/c64/ide64.cpp +++ b/src/devices/bus/c64/ide64.cpp @@ -94,7 +94,7 @@ ioport_constructor c64_ide64_cartridge_device::device_input_ports() const // c64_ide64_cartridge_device - constructor //------------------------------------------------- -c64_ide64_cartridge_device::c64_ide64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_ide64_cartridge_device::c64_ide64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_IDE64, "C64 IDE64 cartridge", tag, owner, clock, "c64_ide64", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_flash_rom(*this, AT29C010A_TAG), @@ -142,7 +142,7 @@ void c64_ide64_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!m_enable) return data; @@ -177,7 +177,7 @@ UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, // 0x5f-0x5f DS1302 // 0x60-0xff ROM - UINT8 io1_offset = offset & 0xff; + uint8_t io1_offset = offset & 0xff; if (io1_offset >= 0x20 && io1_offset < 0x28) { @@ -248,7 +248,7 @@ UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_ide64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_ide64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!m_enable) return; @@ -278,7 +278,7 @@ void c64_ide64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, U // 0x5f-0x5f DS1302 // 0x60-0xff ROM - UINT8 io1_offset = offset & 0xff; + uint8_t io1_offset = offset & 0xff; if (io1_offset >= 0x20 && io1_offset < 0x28) { diff --git a/src/devices/bus/c64/ide64.h b/src/devices/bus/c64/ide64.h index cfe6e1cd27f..2a7294066e7 100644 --- a/src/devices/bus/c64/ide64.h +++ b/src/devices/bus/c64/ide64.h @@ -32,7 +32,7 @@ class c64_ide64_cartridge_device : public device_t, { public: // construction/destruction - c64_ide64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_ide64_cartridge_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; @@ -44,8 +44,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override; @@ -54,10 +54,10 @@ private: required_device m_rtc; required_device m_ata; required_ioport m_jp1; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; - UINT8 m_bank; - UINT16 m_ata_data; + uint8_t m_bank; + uint16_t m_ata_data; int m_wp; int m_enable; }; diff --git a/src/devices/bus/c64/ieee488.cpp b/src/devices/bus/c64/ieee488.cpp index 974c9df0cb5..e1156336d39 100644 --- a/src/devices/bus/c64/ieee488.cpp +++ b/src/devices/bus/c64/ieee488.cpp @@ -46,7 +46,7 @@ READ8_MEMBER( c64_ieee488_device::tpi_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_bus->ren_r() << 2; data |= m_bus->atn_r() << 3; @@ -100,7 +100,7 @@ READ8_MEMBER( c64_ieee488_device::tpi_pc_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_bus->ifc_r(); data |= m_bus->srq_r() << 1; @@ -173,7 +173,7 @@ machine_config_constructor c64_ieee488_device::device_mconfig_additions() const // c64_ieee488_device - constructor //------------------------------------------------- -c64_ieee488_device::c64_ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_ieee488_device::c64_ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_IEEE488, "IEEE-488", tag, owner, clock, "c64_ieee488", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_tpi(*this, MOS6525_TAG), @@ -207,7 +207,7 @@ void c64_ieee488_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); @@ -228,7 +228,7 @@ UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, UINT8 da // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_ieee488_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_ieee488_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2) { diff --git a/src/devices/bus/c64/ieee488.h b/src/devices/bus/c64/ieee488.h index ca11ff7f5dc..6fac297f40b 100644 --- a/src/devices/bus/c64/ieee488.h +++ b/src/devices/bus/c64/ieee488.h @@ -29,7 +29,7 @@ class c64_ieee488_device : public device_t, { public: // construction/destruction - c64_ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_ieee488_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,8 +46,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; private: diff --git a/src/devices/bus/c64/kingsoft.cpp b/src/devices/bus/c64/kingsoft.cpp index 2826920320f..4da97e0496b 100644 --- a/src/devices/bus/c64/kingsoft.cpp +++ b/src/devices/bus/c64/kingsoft.cpp @@ -26,7 +26,7 @@ const device_type C64_KINGSOFT = &device_creator; // c64_kingsoft_cartridge_device - constructor //------------------------------------------------- -c64_kingsoft_cartridge_device::c64_kingsoft_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_kingsoft_cartridge_device::c64_kingsoft_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_KINGSOFT, "C64 Kingsoft cartridge", tag, owner, clock, "c64_kingsoft", __FILE__), device_c64_expansion_card_interface(mconfig, *this) { @@ -56,7 +56,7 @@ void c64_kingsoft_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { @@ -79,7 +79,7 @@ UINT8 c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offse // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_kingsoft_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_kingsoft_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/kingsoft.h b/src/devices/bus/c64/kingsoft.h index ab9dea5d935..30d828dff64 100644 --- a/src/devices/bus/c64/kingsoft.h +++ b/src/devices/bus/c64/kingsoft.h @@ -28,7 +28,7 @@ class c64_kingsoft_cartridge_device : public device_t, { public: // construction/destruction - c64_kingsoft_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_kingsoft_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,8 +36,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; }; diff --git a/src/devices/bus/c64/mach5.cpp b/src/devices/bus/c64/mach5.cpp index b285d35b221..e8ba7f2a094 100644 --- a/src/devices/bus/c64/mach5.cpp +++ b/src/devices/bus/c64/mach5.cpp @@ -51,7 +51,7 @@ ioport_constructor c64_mach5_cartridge_device::device_input_ports() const // c64_mach5_cartridge_device - constructor //------------------------------------------------- -c64_mach5_cartridge_device::c64_mach5_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_mach5_cartridge_device::c64_mach5_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_MACH5, "C64 MACH5 cartridge", tag, owner, clock, "c64_mach5", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_s1(*this, "S1"), m_c128(false) @@ -87,7 +87,7 @@ void c64_mach5_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml || !romh || !io1 || !io2) { @@ -102,7 +102,7 @@ UINT8 c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_mach5_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_mach5_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!m_c128) { diff --git a/src/devices/bus/c64/mach5.h b/src/devices/bus/c64/mach5.h index a41114ccffe..128b7d232a0 100644 --- a/src/devices/bus/c64/mach5.h +++ b/src/devices/bus/c64/mach5.h @@ -27,7 +27,7 @@ class c64_mach5_cartridge_device : public device_t, { public: // construction/destruction - c64_mach5_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_mach5_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -38,8 +38,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_ioport m_s1; diff --git a/src/devices/bus/c64/magic_desk.cpp b/src/devices/bus/c64/magic_desk.cpp index e315b4eeba0..401f51956ee 100644 --- a/src/devices/bus/c64/magic_desk.cpp +++ b/src/devices/bus/c64/magic_desk.cpp @@ -26,7 +26,7 @@ const device_type C64_MAGIC_DESK = &device_creator> 6) & 0x03; - UINT8 new_data = (BIT(data, 1) << 7) | (offset & 0x3f); + uint8_t new_data = (BIT(data, 1) << 7) | (offset & 0x3f); m_pia->write(space, addr, new_data); } diff --git a/src/devices/bus/c64/magic_formel.h b/src/devices/bus/c64/magic_formel.h index ecf439e5606..ffc90c1db0c 100644 --- a/src/devices/bus/c64/magic_formel.h +++ b/src/devices/bus/c64/magic_formel.h @@ -28,7 +28,7 @@ class c64_magic_formel_cartridge_device : public device_t, { public: // construction/destruction - c64_magic_formel_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_magic_formel_cartridge_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; @@ -47,16 +47,16 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; private: required_device m_pia; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; - UINT8 m_rom_bank; - UINT8 m_ram_bank; + uint8_t m_rom_bank; + uint8_t m_ram_bank; int m_ram_oe; int m_pb7; int m_u9a; diff --git a/src/devices/bus/c64/magic_voice.cpp b/src/devices/bus/c64/magic_voice.cpp index cc0b2da9453..078ca95e804 100644 --- a/src/devices/bus/c64/magic_voice.cpp +++ b/src/devices/bus/c64/magic_voice.cpp @@ -93,7 +93,7 @@ READ8_MEMBER( c64_magic_voice_cartridge_device::tpi_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_exp->game_r(get_offset(m_ca), 1, 1, 1, 0) << 5; data |= m_vslsi->eos_r() << 6; @@ -140,7 +140,7 @@ READ8_MEMBER( c64_magic_voice_cartridge_device::tpi_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_exp->exrom_r(get_offset(m_ca), 1, 1, 1, 0) << 7; @@ -260,7 +260,7 @@ machine_config_constructor c64_magic_voice_cartridge_device::device_mconfig_addi // c64_magic_voice_cartridge_device - constructor //------------------------------------------------- -c64_magic_voice_cartridge_device::c64_magic_voice_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_magic_voice_cartridge_device::c64_magic_voice_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_MAGIC_VOICE, "C64 Magic Voice cartridge", tag, owner, clock, "c64_magic_voice", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_vslsi(*this, T6721A_TAG), @@ -307,7 +307,7 @@ void c64_magic_voice_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_magic_voice_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_magic_voice_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2 && sphi2) { @@ -333,7 +333,7 @@ UINT8 c64_magic_voice_cartridge_device::c64_cd_r(address_space &space, offs_t of // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_magic_voice_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_magic_voice_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2 && sphi2) { diff --git a/src/devices/bus/c64/magic_voice.h b/src/devices/bus/c64/magic_voice.h index f5e8af19e59..c8b11a851aa 100644 --- a/src/devices/bus/c64/magic_voice.h +++ b/src/devices/bus/c64/magic_voice.h @@ -30,7 +30,7 @@ class c64_magic_voice_cartridge_device : public device_t, { public: // construction/destruction - c64_magic_voice_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_magic_voice_cartridge_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; @@ -53,8 +53,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; private: @@ -65,10 +65,10 @@ private: required_device m_fifo; required_device m_exp; - UINT16 m_ca; - UINT8 m_tpi_pb; + uint16_t m_ca; + uint8_t m_tpi_pb; int m_tpi_pc6; - UINT8 m_pd; + uint8_t m_pd; }; diff --git a/src/devices/bus/c64/midi_maplin.cpp b/src/devices/bus/c64/midi_maplin.cpp index 7a143391129..2c389a259a9 100644 --- a/src/devices/bus/c64/midi_maplin.cpp +++ b/src/devices/bus/c64/midi_maplin.cpp @@ -78,7 +78,7 @@ machine_config_constructor c64_maplin_midi_cartridge_device::device_mconfig_addi // c64_maplin_midi_cartridge_device - constructor //------------------------------------------------- -c64_maplin_midi_cartridge_device::c64_maplin_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_maplin_midi_cartridge_device::c64_maplin_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_MIDI_MAPLIN, "C64 Maplin MIDI", tag, owner, clock, "c64_midimap", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_acia(*this, MC6850_TAG) @@ -110,7 +110,7 @@ void c64_maplin_midi_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_maplin_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_maplin_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2) { @@ -134,7 +134,7 @@ UINT8 c64_maplin_midi_cartridge_device::c64_cd_r(address_space &space, offs_t of // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_maplin_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_maplin_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2) { diff --git a/src/devices/bus/c64/midi_maplin.h b/src/devices/bus/c64/midi_maplin.h index ac088c2f631..5608f506989 100644 --- a/src/devices/bus/c64/midi_maplin.h +++ b/src/devices/bus/c64/midi_maplin.h @@ -27,7 +27,7 @@ class c64_maplin_midi_cartridge_device : public device_t, { public: // construction/destruction - c64_maplin_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_maplin_midi_cartridge_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; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_acia; diff --git a/src/devices/bus/c64/midi_namesoft.cpp b/src/devices/bus/c64/midi_namesoft.cpp index cd1553b6187..cefff6e8297 100644 --- a/src/devices/bus/c64/midi_namesoft.cpp +++ b/src/devices/bus/c64/midi_namesoft.cpp @@ -78,7 +78,7 @@ machine_config_constructor c64_namesoft_midi_cartridge_device::device_mconfig_ad // c64_namesoft_midi_cartridge_device - constructor //------------------------------------------------- -c64_namesoft_midi_cartridge_device::c64_namesoft_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_namesoft_midi_cartridge_device::c64_namesoft_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_MIDI_NAMESOFT, "C64 Namesoft MIDI", tag, owner, clock, "c64_midins", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_acia(*this, MC6850_TAG) @@ -108,7 +108,7 @@ void c64_namesoft_midi_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_namesoft_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_namesoft_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { @@ -132,7 +132,7 @@ UINT8 c64_namesoft_midi_cartridge_device::c64_cd_r(address_space &space, offs_t // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_namesoft_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_namesoft_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/midi_namesoft.h b/src/devices/bus/c64/midi_namesoft.h index 048ea6b123f..d9321d9f217 100644 --- a/src/devices/bus/c64/midi_namesoft.h +++ b/src/devices/bus/c64/midi_namesoft.h @@ -27,7 +27,7 @@ class c64_namesoft_midi_cartridge_device : public device_t, { public: // construction/destruction - c64_namesoft_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_namesoft_midi_cartridge_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; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_acia; diff --git a/src/devices/bus/c64/midi_passport.cpp b/src/devices/bus/c64/midi_passport.cpp index 2948503f675..408b7a835e3 100644 --- a/src/devices/bus/c64/midi_passport.cpp +++ b/src/devices/bus/c64/midi_passport.cpp @@ -97,7 +97,7 @@ machine_config_constructor c64_passport_midi_cartridge_device::device_mconfig_ad // c64_passport_midi_cartridge_device - constructor //------------------------------------------------- -c64_passport_midi_cartridge_device::c64_passport_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_passport_midi_cartridge_device::c64_passport_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_MIDI_PASSPORT, "C64 Passport MIDI", tag, owner, clock, "c64_midipp", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_acia(*this, MC6850_TAG), @@ -135,7 +135,7 @@ void c64_passport_midi_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_passport_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_passport_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { @@ -164,7 +164,7 @@ UINT8 c64_passport_midi_cartridge_device::c64_cd_r(address_space &space, offs_t // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_passport_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_passport_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/midi_passport.h b/src/devices/bus/c64/midi_passport.h index ff7be2185a1..995c5b1d6ee 100644 --- a/src/devices/bus/c64/midi_passport.h +++ b/src/devices/bus/c64/midi_passport.h @@ -28,7 +28,7 @@ class c64_passport_midi_cartridge_device : public device_t, { public: // construction/destruction - c64_passport_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_passport_midi_cartridge_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; @@ -43,8 +43,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_acia; diff --git a/src/devices/bus/c64/midi_sci.cpp b/src/devices/bus/c64/midi_sci.cpp index 40e2c56cbfc..ae8caad26dd 100644 --- a/src/devices/bus/c64/midi_sci.cpp +++ b/src/devices/bus/c64/midi_sci.cpp @@ -78,7 +78,7 @@ machine_config_constructor c64_sequential_midi_cartridge_device::device_mconfig_ // c64_sequential_midi_cartridge_device - constructor //------------------------------------------------- -c64_sequential_midi_cartridge_device::c64_sequential_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_sequential_midi_cartridge_device::c64_sequential_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_MIDI_SCI, "C64 Sequential Circuits MIDI", tag, owner, clock, "c64_midisci", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_acia(*this, MC6850_TAG) @@ -109,7 +109,7 @@ void c64_sequential_midi_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_sequential_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_sequential_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { @@ -133,7 +133,7 @@ UINT8 c64_sequential_midi_cartridge_device::c64_cd_r(address_space &space, offs_ // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_sequential_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_sequential_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/midi_sci.h b/src/devices/bus/c64/midi_sci.h index 6ab277b3ef1..c4f49bb092c 100644 --- a/src/devices/bus/c64/midi_sci.h +++ b/src/devices/bus/c64/midi_sci.h @@ -27,7 +27,7 @@ class c64_sequential_midi_cartridge_device : public device_t, { public: // construction/destruction - c64_sequential_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_sequential_midi_cartridge_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; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_acia; diff --git a/src/devices/bus/c64/midi_siel.cpp b/src/devices/bus/c64/midi_siel.cpp index cce956a1427..913405cfb06 100644 --- a/src/devices/bus/c64/midi_siel.cpp +++ b/src/devices/bus/c64/midi_siel.cpp @@ -78,7 +78,7 @@ machine_config_constructor c64_siel_midi_cartridge_device::device_mconfig_additi // c64_siel_midi_cartridge_device - constructor //------------------------------------------------- -c64_siel_midi_cartridge_device::c64_siel_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_siel_midi_cartridge_device::c64_siel_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_MIDI_SIEL, "C64 Siel MIDI", tag, owner, clock, "c64_midisiel", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_acia(*this, MC6850_TAG) @@ -110,7 +110,7 @@ void c64_siel_midi_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_siel_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_siel_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { @@ -134,7 +134,7 @@ UINT8 c64_siel_midi_cartridge_device::c64_cd_r(address_space &space, offs_t offs // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_siel_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_siel_midi_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/midi_siel.h b/src/devices/bus/c64/midi_siel.h index 12787d4999c..35373dda012 100644 --- a/src/devices/bus/c64/midi_siel.h +++ b/src/devices/bus/c64/midi_siel.h @@ -27,7 +27,7 @@ class c64_siel_midi_cartridge_device : public device_t, { public: // construction/destruction - c64_siel_midi_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_siel_midi_cartridge_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; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_acia; diff --git a/src/devices/bus/c64/mikro_assembler.cpp b/src/devices/bus/c64/mikro_assembler.cpp index 2578d4ae5b4..28f15a5efef 100644 --- a/src/devices/bus/c64/mikro_assembler.cpp +++ b/src/devices/bus/c64/mikro_assembler.cpp @@ -26,7 +26,7 @@ const device_type C64_MIKRO_ASSEMBLER = &device_creator= 0x8000 && offset < 0xa000) { diff --git a/src/devices/bus/c64/multiscreen.h b/src/devices/bus/c64/multiscreen.h index f68024d2267..7a457a53ba5 100644 --- a/src/devices/bus/c64/multiscreen.h +++ b/src/devices/bus/c64/multiscreen.h @@ -30,7 +30,7 @@ class c64_multiscreen_cartridge_device : public device_t, { public: // construction/destruction - c64_multiscreen_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_multiscreen_cartridge_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; @@ -42,11 +42,11 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/music64.cpp b/src/devices/bus/c64/music64.cpp index 1b8fd6a695b..8f5de837cbf 100644 --- a/src/devices/bus/c64/music64.cpp +++ b/src/devices/bus/c64/music64.cpp @@ -149,7 +149,7 @@ ioport_constructor c64_music64_cartridge_device::device_input_ports() const // c64_music64_cartridge_device - constructor //------------------------------------------------- -c64_music64_cartridge_device::c64_music64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_music64_cartridge_device::c64_music64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_MUSIC64, "C64 Music 64 cartridge", tag, owner, clock, "c64_music64", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_exp(*this, C64_EXPANSION_SLOT_TAG), @@ -180,7 +180,7 @@ void c64_music64_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_music64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_music64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); @@ -202,7 +202,7 @@ UINT8 c64_music64_cartridge_device::c64_cd_r(address_space &space, offs_t offset // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_music64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_music64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2); } diff --git a/src/devices/bus/c64/music64.h b/src/devices/bus/c64/music64.h index 5af70da1744..34f102b99a9 100644 --- a/src/devices/bus/c64/music64.h +++ b/src/devices/bus/c64/music64.h @@ -27,7 +27,7 @@ class c64_music64_cartridge_device : public device_t, { public: // construction/destruction - c64_music64_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_music64_cartridge_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; @@ -39,8 +39,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override; diff --git a/src/devices/bus/c64/neoram.cpp b/src/devices/bus/c64/neoram.cpp index 91019bdb9aa..2e33ee69729 100644 --- a/src/devices/bus/c64/neoram.cpp +++ b/src/devices/bus/c64/neoram.cpp @@ -26,7 +26,7 @@ const device_type C64_NEORAM = &device_creator; // c64_neoram_cartridge_device - constructor //------------------------------------------------- -c64_neoram_cartridge_device::c64_neoram_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_neoram_cartridge_device::c64_neoram_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_NEORAM, "C64 NeoRAM cartridge", tag, owner, clock, "c64_neoram", __FILE__), device_c64_expansion_card_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -63,7 +63,7 @@ void c64_neoram_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { @@ -79,7 +79,7 @@ UINT8 c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_neoram_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_neoram_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/neoram.h b/src/devices/bus/c64/neoram.h index f9e28d23c0a..0bd98158776 100644 --- a/src/devices/bus/c64/neoram.h +++ b/src/devices/bus/c64/neoram.h @@ -29,7 +29,7 @@ class c64_neoram_cartridge_device : public device_t, { public: // construction/destruction - c64_neoram_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_neoram_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -42,11 +42,11 @@ protected: virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } } // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT16 m_bank; + uint16_t m_bank; }; diff --git a/src/devices/bus/c64/ocean.cpp b/src/devices/bus/c64/ocean.cpp index 496651a1b25..7961111e606 100644 --- a/src/devices/bus/c64/ocean.cpp +++ b/src/devices/bus/c64/ocean.cpp @@ -48,7 +48,7 @@ const device_type C64_OCEAN = &device_creator; // c64_ocean_cartridge_device - constructor //------------------------------------------------- -c64_ocean_cartridge_device::c64_ocean_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_ocean_cartridge_device::c64_ocean_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_OCEAN, "C64 Ocean cartridge", tag, owner, clock, "c64_ocean", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_bank(0) @@ -81,7 +81,7 @@ void c64_ocean_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml && m_roml.bytes()) { @@ -106,7 +106,7 @@ UINT8 c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_ocean_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_ocean_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/ocean.h b/src/devices/bus/c64/ocean.h index 49697d758e7..c5508a6c9ac 100644 --- a/src/devices/bus/c64/ocean.h +++ b/src/devices/bus/c64/ocean.h @@ -28,7 +28,7 @@ class c64_ocean_cartridge_device : public device_t, { public: // construction/destruction - c64_ocean_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_ocean_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,11 +36,11 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/pagefox.cpp b/src/devices/bus/c64/pagefox.cpp index b6df18e03c1..c1ee255b670 100644 --- a/src/devices/bus/c64/pagefox.cpp +++ b/src/devices/bus/c64/pagefox.cpp @@ -48,7 +48,7 @@ const device_type C64_PAGEFOX = &device_creator; // c64_pagefox_cartridge_device - constructor //------------------------------------------------- -c64_pagefox_cartridge_device::c64_pagefox_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_pagefox_cartridge_device::c64_pagefox_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_PAGEFOX, "C64 Pagefox cartridge", tag, owner, clock, "c64_pagefox", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_ram(*this, "ram"), m_bank(0) @@ -84,7 +84,7 @@ void c64_pagefox_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml || !romh) { @@ -109,7 +109,7 @@ UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_pagefox_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_pagefox_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (offset >= 0x8000 && offset < 0xc000) { diff --git a/src/devices/bus/c64/pagefox.h b/src/devices/bus/c64/pagefox.h index 7b68ce54c07..70dec864689 100644 --- a/src/devices/bus/c64/pagefox.h +++ b/src/devices/bus/c64/pagefox.h @@ -28,7 +28,7 @@ class c64_pagefox_cartridge_device : public device_t, { public: // construction/destruction - c64_pagefox_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_pagefox_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,13 +36,13 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/partner.cpp b/src/devices/bus/c64/partner.cpp index 4feb8022b08..3f33ae0aaa2 100644 --- a/src/devices/bus/c64/partner.cpp +++ b/src/devices/bus/c64/partner.cpp @@ -76,7 +76,7 @@ ioport_constructor c64_partner_cartridge_device::device_input_ports() const // c64_partner_cartridge_device - constructor //------------------------------------------------- -c64_partner_cartridge_device::c64_partner_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_partner_cartridge_device::c64_partner_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_PARTNER, "C64 PARTNER 64 cartridge", tag, owner, clock, "c64_partner", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_ram(*this, "ram"), @@ -119,7 +119,7 @@ void c64_partner_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_partner_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_partner_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { @@ -153,7 +153,7 @@ UINT8 c64_partner_cartridge_device::c64_cd_r(address_space &space, offs_t offset // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_partner_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_partner_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/partner.h b/src/devices/bus/c64/partner.h index 640cb7daab5..28a1f7c59a4 100644 --- a/src/devices/bus/c64/partner.h +++ b/src/devices/bus/c64/partner.h @@ -27,7 +27,7 @@ class c64_partner_cartridge_device : public device_t, { public: // construction/destruction - c64_partner_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_partner_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -40,12 +40,12 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; int m_a0; int m_a6; diff --git a/src/devices/bus/c64/prophet64.cpp b/src/devices/bus/c64/prophet64.cpp index bd61247eed3..3cd575e93cb 100644 --- a/src/devices/bus/c64/prophet64.cpp +++ b/src/devices/bus/c64/prophet64.cpp @@ -26,7 +26,7 @@ const device_type C64_PROPHET64 = &device_creatorromsel_r(roml, romh)) { @@ -128,7 +128,7 @@ UINT8 c64_reu_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UI // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_reu_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_reu_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2) { diff --git a/src/devices/bus/c64/reu.h b/src/devices/bus/c64/reu.h index c0fb6252ac3..adda61566ad 100644 --- a/src/devices/bus/c64/reu.h +++ b/src/devices/bus/c64/reu.h @@ -31,7 +31,7 @@ class c64_reu_cartridge_device : public device_t, { public: // construction/destruction - c64_reu_cartridge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, int jp1, size_t ram_size, const char *shortname, const char *source); + c64_reu_cartridge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, int jp1, size_t ram_size, const char *shortname, const char *source); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -49,12 +49,12 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; required_device m_dmac; required_device m_eprom; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; int m_variant; int m_jp1; @@ -68,7 +68,7 @@ class c64_reu1700_cartridge_device : public c64_reu_cartridge_device { public: // construction/destruction - c64_reu1700_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_reu1700_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -78,7 +78,7 @@ class c64_reu1750_cartridge_device : public c64_reu_cartridge_device { public: // construction/destruction - c64_reu1750_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_reu1750_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // ======================> c64_reu1700_cartridge_device @@ -87,7 +87,7 @@ class c64_reu1764_cartridge_device : public c64_reu_cartridge_device { public: // construction/destruction - c64_reu1764_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_reu1764_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/c64/rex.cpp b/src/devices/bus/c64/rex.cpp index 5a4a0abaf78..84b883c40c9 100644 --- a/src/devices/bus/c64/rex.cpp +++ b/src/devices/bus/c64/rex.cpp @@ -26,7 +26,7 @@ const device_type C64_REX = &device_creator; // c64_rex_cartridge_device - constructor //------------------------------------------------- -c64_rex_cartridge_device::c64_rex_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_rex_cartridge_device::c64_rex_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_REX, "C64 Rex cartridge", tag, owner, clock, "c64_rex", __FILE__), device_c64_expansion_card_interface(mconfig, *this) { @@ -56,7 +56,7 @@ void c64_rex_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_rex_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_rex_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { diff --git a/src/devices/bus/c64/rex.h b/src/devices/bus/c64/rex.h index d5f17dfdd5b..d12e771124e 100644 --- a/src/devices/bus/c64/rex.h +++ b/src/devices/bus/c64/rex.h @@ -28,7 +28,7 @@ class c64_rex_cartridge_device : public device_t, { public: // construction/destruction - c64_rex_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_rex_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,7 +36,7 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; }; diff --git a/src/devices/bus/c64/rex_ep256.cpp b/src/devices/bus/c64/rex_ep256.cpp index ecb5e3983e4..772840706c0 100644 --- a/src/devices/bus/c64/rex_ep256.cpp +++ b/src/devices/bus/c64/rex_ep256.cpp @@ -61,7 +61,7 @@ machine_config_constructor c64_rex_ep256_cartridge_device::device_mconfig_additi // c64_rex_ep256_cartridge_device - constructor //------------------------------------------------- -c64_rex_ep256_cartridge_device::c64_rex_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_rex_ep256_cartridge_device::c64_rex_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_REX_EP256, "C64 Rex 256KB EPROM cartridge", tag, owner, clock, "rexep256", __FILE__), device_c64_expansion_card_interface(mconfig, *this) { @@ -104,7 +104,7 @@ void c64_rex_ep256_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { @@ -138,7 +138,7 @@ UINT8 c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offs // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_rex_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_rex_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2 && ((offset & 0xf0) == 0xa0)) { diff --git a/src/devices/bus/c64/rex_ep256.h b/src/devices/bus/c64/rex_ep256.h index abd5f53618b..6c12bb69922 100644 --- a/src/devices/bus/c64/rex_ep256.h +++ b/src/devices/bus/c64/rex_ep256.h @@ -30,7 +30,7 @@ class c64_rex_ep256_cartridge_device : public device_t, { public: // construction/destruction - c64_rex_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_rex_ep256_cartridge_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; @@ -41,13 +41,13 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: generic_slot_device *m_eproms[8]; - UINT8 m_bank, m_socket; + uint8_t m_bank, m_socket; int m_reset; }; diff --git a/src/devices/bus/c64/ross.cpp b/src/devices/bus/c64/ross.cpp index 1a074958aa0..84e94c8e1ef 100644 --- a/src/devices/bus/c64/ross.cpp +++ b/src/devices/bus/c64/ross.cpp @@ -26,7 +26,7 @@ const device_type C64_ROSS = &device_creator; // c64_ross_cartridge_device - constructor //------------------------------------------------- -c64_ross_cartridge_device::c64_ross_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_ross_cartridge_device::c64_ross_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_ROSS, "C64 Ross cartridge", tag, owner, clock, "c64_ross", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_bank(0) { @@ -61,7 +61,7 @@ void c64_ross_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml || !romh) { @@ -78,7 +78,7 @@ UINT8 c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, U // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_ross_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_ross_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/ross.h b/src/devices/bus/c64/ross.h index 6f88948927b..f644521fef9 100644 --- a/src/devices/bus/c64/ross.h +++ b/src/devices/bus/c64/ross.h @@ -28,7 +28,7 @@ class c64_ross_cartridge_device : public device_t, { public: // construction/destruction - c64_ross_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_ross_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,11 +36,11 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/sfx_sound_expander.cpp b/src/devices/bus/c64/sfx_sound_expander.cpp index 71649a4a86b..48d93789dcf 100644 --- a/src/devices/bus/c64/sfx_sound_expander.cpp +++ b/src/devices/bus/c64/sfx_sound_expander.cpp @@ -180,7 +180,7 @@ inline offs_t c64_sfx_sound_expander_cartridge_device::get_offset(offs_t offset, // c64_sfx_sound_expander_cartridge_device - constructor //------------------------------------------------- -c64_sfx_sound_expander_cartridge_device::c64_sfx_sound_expander_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_sfx_sound_expander_cartridge_device::c64_sfx_sound_expander_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_SFX_SOUND_EXPANDER, "C64 SFX Sound Expander cartridge", tag, owner, clock, "c64_sfxse", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_opl(*this, YM3526_TAG), @@ -213,7 +213,7 @@ void c64_sfx_sound_expander_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { data = m_exp->cd_r(space, get_offset(offset, 1), data, sphi2, ba, roml, romh, io1, io2); @@ -238,7 +238,7 @@ UINT8 c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, of // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_sfx_sound_expander_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_sfx_sound_expander_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2 && sphi2) { diff --git a/src/devices/bus/c64/sfx_sound_expander.h b/src/devices/bus/c64/sfx_sound_expander.h index a422c4df784..7e8df5ce2dd 100644 --- a/src/devices/bus/c64/sfx_sound_expander.h +++ b/src/devices/bus/c64/sfx_sound_expander.h @@ -28,7 +28,7 @@ class c64_sfx_sound_expander_cartridge_device : public device_t, { public: // construction/destruction - c64_sfx_sound_expander_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_sfx_sound_expander_cartridge_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; @@ -42,8 +42,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override; diff --git a/src/devices/bus/c64/silverrock.cpp b/src/devices/bus/c64/silverrock.cpp index 4ae1dd4ab75..e9a7dcf11eb 100644 --- a/src/devices/bus/c64/silverrock.cpp +++ b/src/devices/bus/c64/silverrock.cpp @@ -59,7 +59,7 @@ const device_type C64_SILVERROCK = &device_creator; // c64_standard_cartridge_device - constructor //------------------------------------------------- -c64_standard_cartridge_device::c64_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_standard_cartridge_device::c64_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_STD, "C64 standard cartridge", tag, owner, clock, "c64_standard", __FILE__), device_c64_expansion_card_interface(mconfig, *this) { @@ -46,7 +46,7 @@ void c64_standard_cartridge_device::device_start() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_standard_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_standard_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml && m_roml.bytes()) { diff --git a/src/devices/bus/c64/std.h b/src/devices/bus/c64/std.h index 16bbdb9f4ff..43d640bfdf4 100644 --- a/src/devices/bus/c64/std.h +++ b/src/devices/bus/c64/std.h @@ -28,14 +28,14 @@ class c64_standard_cartridge_device : public device_t, { public: // construction/destruction - c64_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; }; diff --git a/src/devices/bus/c64/structured_basic.cpp b/src/devices/bus/c64/structured_basic.cpp index f299246e118..8cc7a439561 100644 --- a/src/devices/bus/c64/structured_basic.cpp +++ b/src/devices/bus/c64/structured_basic.cpp @@ -26,7 +26,7 @@ const device_type C64_STRUCTURED_BASIC = &device_creatorcd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); @@ -205,7 +205,7 @@ UINT8 c64_supercpu_device::c64_cd_r(address_space &space, offs_t offset, UINT8 d // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_supercpu_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_supercpu_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { switch (offset) { diff --git a/src/devices/bus/c64/supercpu.h b/src/devices/bus/c64/supercpu.h index ea3618fe6de..8843d55b5cd 100644 --- a/src/devices/bus/c64/supercpu.h +++ b/src/devices/bus/c64/supercpu.h @@ -28,7 +28,7 @@ class c64_supercpu_device : public device_t, { public: // construction/destruction - c64_supercpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_supercpu_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; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override; @@ -50,8 +50,8 @@ private: required_device m_maincpu; required_device m_exp; - required_shared_ptr m_sram; - required_shared_ptr m_dimm; + required_shared_ptr m_sram; + required_shared_ptr m_dimm; }; diff --git a/src/devices/bus/c64/sw8k.cpp b/src/devices/bus/c64/sw8k.cpp index d8864e5ceb9..9febecdf202 100644 --- a/src/devices/bus/c64/sw8k.cpp +++ b/src/devices/bus/c64/sw8k.cpp @@ -71,7 +71,7 @@ ioport_constructor c64_switchable_8k_cartridge_device::device_input_ports() cons // c64_switchable_8k_cartridge_device - constructor //------------------------------------------------- -c64_switchable_8k_cartridge_device::c64_switchable_8k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_switchable_8k_cartridge_device::c64_switchable_8k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_SW8K, "C64 Switchable 8K cartridge", tag, owner, clock, "c64_sw8k", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_sw(*this, "SW"), m_bank(0) @@ -102,7 +102,7 @@ void c64_switchable_8k_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_switchable_8k_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_switchable_8k_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { diff --git a/src/devices/bus/c64/sw8k.h b/src/devices/bus/c64/sw8k.h index d6a753e1f1b..9947010c5be 100644 --- a/src/devices/bus/c64/sw8k.h +++ b/src/devices/bus/c64/sw8k.h @@ -28,7 +28,7 @@ class c64_switchable_8k_cartridge_device : public device_t, { public: // construction/destruction - c64_switchable_8k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_switchable_8k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -39,7 +39,7 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_ioport m_sw; diff --git a/src/devices/bus/c64/swiftlink.cpp b/src/devices/bus/c64/swiftlink.cpp index 14e0b224da5..f2b118d7d5d 100644 --- a/src/devices/bus/c64/swiftlink.cpp +++ b/src/devices/bus/c64/swiftlink.cpp @@ -99,7 +99,7 @@ ioport_constructor c64_swiftlink_cartridge_device::device_input_ports() const // c64_swiftlink_cartridge_device - constructor //------------------------------------------------- -c64_swiftlink_cartridge_device::c64_swiftlink_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_swiftlink_cartridge_device::c64_swiftlink_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_SWIFTLINK, "C64 SwiftLink cartridge", tag, owner, clock, "c64_swiftlink", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_acia(*this, MOS6551_TAG), @@ -135,7 +135,7 @@ void c64_swiftlink_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_swiftlink_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_swiftlink_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) || ((m_cs == D700) && ((offset & 0xff00) == 0xd700))) @@ -151,7 +151,7 @@ UINT8 c64_swiftlink_cartridge_device::c64_cd_r(address_space &space, offs_t offs // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_swiftlink_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_swiftlink_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) || ((m_cs == D700) && ((offset & 0xff00) == 0xd700))) diff --git a/src/devices/bus/c64/swiftlink.h b/src/devices/bus/c64/swiftlink.h index 9a364845094..3cc2ed17165 100644 --- a/src/devices/bus/c64/swiftlink.h +++ b/src/devices/bus/c64/swiftlink.h @@ -29,7 +29,7 @@ class c64_swiftlink_cartridge_device : public device_t, { public: // construction/destruction - c64_swiftlink_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_swiftlink_cartridge_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; @@ -43,8 +43,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_acia; diff --git a/src/devices/bus/c64/system3.cpp b/src/devices/bus/c64/system3.cpp index 9bc4a33f7dd..25463f1e9c1 100644 --- a/src/devices/bus/c64/system3.cpp +++ b/src/devices/bus/c64/system3.cpp @@ -26,7 +26,7 @@ const device_type C64_SYSTEM3 = &device_creator; // c64_system3_cartridge_device - constructor //------------------------------------------------- -c64_system3_cartridge_device::c64_system3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_system3_cartridge_device::c64_system3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_SYSTEM3, "C64 System 3 cartridge", tag, owner, clock, "c64_system3", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_bank(0) @@ -59,7 +59,7 @@ void c64_system3_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { @@ -81,7 +81,7 @@ UINT8 c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_system3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_system3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/system3.h b/src/devices/bus/c64/system3.h index fef5c100217..d2c3dd7f17e 100644 --- a/src/devices/bus/c64/system3.h +++ b/src/devices/bus/c64/system3.h @@ -28,7 +28,7 @@ class c64_system3_cartridge_device : public device_t, { public: // construction/destruction - c64_system3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_system3_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,11 +36,11 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - UINT8 m_bank; + uint8_t m_bank; }; diff --git a/src/devices/bus/c64/tdos.cpp b/src/devices/bus/c64/tdos.cpp index 9ce8c14f22a..45c5d203e8c 100644 --- a/src/devices/bus/c64/tdos.cpp +++ b/src/devices/bus/c64/tdos.cpp @@ -201,7 +201,7 @@ ioport_constructor c64_tdos_cartridge_device::device_input_ports() const // c64_tdos_cartridge_device - constructor //------------------------------------------------- -c64_tdos_cartridge_device::c64_tdos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_tdos_cartridge_device::c64_tdos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_TDOS, "C64 TDOS cartridge", tag, owner, clock, "c64_tdos", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_ssda(*this, MC68A52P_TAG), @@ -238,7 +238,7 @@ void c64_tdos_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); @@ -285,7 +285,7 @@ UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, U // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_tdos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_tdos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2); diff --git a/src/devices/bus/c64/tdos.h b/src/devices/bus/c64/tdos.h index 42c08cbd1c8..e7c8b7945f6 100644 --- a/src/devices/bus/c64/tdos.h +++ b/src/devices/bus/c64/tdos.h @@ -28,7 +28,7 @@ class c64_tdos_cartridge_device : public device_t, { public: // construction/destruction - c64_tdos_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_tdos_cartridge_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; @@ -40,8 +40,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override; virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override; diff --git a/src/devices/bus/c64/turbo232.cpp b/src/devices/bus/c64/turbo232.cpp index 1dd43b2011d..aac81a90584 100644 --- a/src/devices/bus/c64/turbo232.cpp +++ b/src/devices/bus/c64/turbo232.cpp @@ -98,7 +98,7 @@ ioport_constructor c64_turbo232_cartridge_device::device_input_ports() const // c64_turbo232_cartridge_device - constructor //------------------------------------------------- -c64_turbo232_cartridge_device::c64_turbo232_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_turbo232_cartridge_device::c64_turbo232_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_TURBO232, "C64 Turbo232 cartridge", tag, owner, clock, "c64_turbo232", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_acia(*this, MOS6551_TAG), @@ -137,7 +137,7 @@ void c64_turbo232_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_turbo232_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_turbo232_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) || ((m_cs == D700) && ((offset & 0xff00) == 0xd700))) @@ -164,7 +164,7 @@ UINT8 c64_turbo232_cartridge_device::c64_cd_r(address_space &space, offs_t offse // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_turbo232_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_turbo232_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) || ((m_cs == D700) && ((offset & 0xff00) == 0xd700))) diff --git a/src/devices/bus/c64/turbo232.h b/src/devices/bus/c64/turbo232.h index 4f80cec374f..c98d9cc10eb 100644 --- a/src/devices/bus/c64/turbo232.h +++ b/src/devices/bus/c64/turbo232.h @@ -29,7 +29,7 @@ class c64_turbo232_cartridge_device : public device_t, { public: // construction/destruction - c64_turbo232_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_turbo232_cartridge_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; @@ -43,8 +43,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: required_device m_acia; @@ -78,7 +78,7 @@ private: int m_cs; int m_irq; - UINT8 m_es; + uint8_t m_es; }; diff --git a/src/devices/bus/c64/vizastar.cpp b/src/devices/bus/c64/vizastar.cpp index d635ffec656..6c589d2864f 100644 --- a/src/devices/bus/c64/vizastar.cpp +++ b/src/devices/bus/c64/vizastar.cpp @@ -58,7 +58,7 @@ const device_type C64_VIZASTAR = &device_creator; // c64_vizastar_cartridge_device - constructor //------------------------------------------------- -c64_vizastar_cartridge_device::c64_vizastar_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_vizastar_cartridge_device::c64_vizastar_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_VIZASTAR, "VizaStar 64 XL4", tag, owner, clock, "c64_vizastar", __FILE__), device_c64_expansion_card_interface(mconfig, *this) { @@ -78,7 +78,7 @@ void c64_vizastar_cartridge_device::device_start() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_vizastar_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_vizastar_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { diff --git a/src/devices/bus/c64/vizastar.h b/src/devices/bus/c64/vizastar.h index 4c24f9705be..44606be0d21 100644 --- a/src/devices/bus/c64/vizastar.h +++ b/src/devices/bus/c64/vizastar.h @@ -28,14 +28,14 @@ class c64_vizastar_cartridge_device : public device_t, { public: // construction/destruction - c64_vizastar_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_vizastar_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; }; diff --git a/src/devices/bus/c64/vw64.cpp b/src/devices/bus/c64/vw64.cpp index 3288e492a43..2a57b2b80cc 100644 --- a/src/devices/bus/c64/vw64.cpp +++ b/src/devices/bus/c64/vw64.cpp @@ -66,7 +66,7 @@ const device_type C64_VW64 = &device_creator; // c64_vizawrite_cartridge_device - constructor //------------------------------------------------- -c64_vizawrite_cartridge_device::c64_vizawrite_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_vizawrite_cartridge_device::c64_vizawrite_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_VW64, "VizaWrite 64", tag, owner, clock, "c64_vizawrite", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_game_timer(nullptr) { @@ -110,7 +110,7 @@ void c64_vizawrite_cartridge_device::device_timer(emu_timer &timer, device_timer // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_vizawrite_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_vizawrite_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { diff --git a/src/devices/bus/c64/vw64.h b/src/devices/bus/c64/vw64.h index 906ca3b0b27..e531ec1c260 100644 --- a/src/devices/bus/c64/vw64.h +++ b/src/devices/bus/c64/vw64.h @@ -28,7 +28,7 @@ class c64_vizawrite_cartridge_device : public device_t, { public: // construction/destruction - c64_vizawrite_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_vizawrite_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -37,7 +37,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override { return 0; } private: diff --git a/src/devices/bus/c64/warp_speed.cpp b/src/devices/bus/c64/warp_speed.cpp index d625fa5ea7d..c1c0188e19f 100644 --- a/src/devices/bus/c64/warp_speed.cpp +++ b/src/devices/bus/c64/warp_speed.cpp @@ -85,7 +85,7 @@ ioport_constructor c64_warp_speed_cartridge_device::device_input_ports() const // c64_warp_speed_cartridge_device - constructor //------------------------------------------------- -c64_warp_speed_cartridge_device::c64_warp_speed_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_warp_speed_cartridge_device::c64_warp_speed_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_WARP_SPEED, "C64 Warp Speed cartridge", tag, owner, clock, "c64_warp_speed", __FILE__), device_c64_expansion_card_interface(mconfig, *this) { @@ -116,7 +116,7 @@ void c64_warp_speed_cartridge_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml || !romh || !io1 || !io2) { @@ -132,7 +132,7 @@ UINT8 c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t off // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_warp_speed_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_warp_speed_cartridge_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io1) { diff --git a/src/devices/bus/c64/warp_speed.h b/src/devices/bus/c64/warp_speed.h index b3eeca48809..d2ad01ae902 100644 --- a/src/devices/bus/c64/warp_speed.h +++ b/src/devices/bus/c64/warp_speed.h @@ -28,7 +28,7 @@ class c64_warp_speed_cartridge_device : public device_t, { public: // construction/destruction - c64_warp_speed_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_warp_speed_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -39,8 +39,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; }; diff --git a/src/devices/bus/c64/westermann.cpp b/src/devices/bus/c64/westermann.cpp index 6a758428a1f..68f288c710f 100644 --- a/src/devices/bus/c64/westermann.cpp +++ b/src/devices/bus/c64/westermann.cpp @@ -26,7 +26,7 @@ const device_type C64_WESTERMANN = &device_creatorbase()[addr & 0x7ff]; + uint8_t code = m_ram[((ma + column) & 0x7ff)]; + uint16_t addr = (code << 3) | (ra & 0x07); + uint8_t data = m_char_rom->base()[addr & 0x7ff]; if (column == cursor_x) { @@ -158,7 +158,7 @@ machine_config_constructor c64_xl80_device::device_mconfig_additions() const // c64_xl80_device - constructor //------------------------------------------------- -c64_xl80_device::c64_xl80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_xl80_device::c64_xl80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_XL80, "XL 80", tag, owner, clock, "c64_xl80", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_crtc(*this, HD46505SP_TAG), @@ -193,7 +193,7 @@ void c64_xl80_device::device_reset() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!io2 && BIT(offset, 2)) { @@ -219,7 +219,7 @@ UINT8 c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, // c64_cd_w - cartridge data write //------------------------------------------------- -void c64_xl80_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +void c64_xl80_device::c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (offset >= 0x9800 && offset < 0xa000) { diff --git a/src/devices/bus/c64/xl80.h b/src/devices/bus/c64/xl80.h index 22caa7a5042..9a80928718e 100644 --- a/src/devices/bus/c64/xl80.h +++ b/src/devices/bus/c64/xl80.h @@ -29,7 +29,7 @@ class c64_xl80_device : public device_t, { public: // construction/destruction - c64_xl80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_xl80_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; @@ -44,8 +44,8 @@ protected: virtual void device_reset() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; - virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual void c64_cd_w(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) override { return 1; } virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override { return 0; } @@ -53,7 +53,7 @@ private: required_device m_crtc; required_device m_palette; required_memory_region m_char_rom; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; }; diff --git a/src/devices/bus/c64/zaxxon.cpp b/src/devices/bus/c64/zaxxon.cpp index 5406c584876..af3be3f9daa 100644 --- a/src/devices/bus/c64/zaxxon.cpp +++ b/src/devices/bus/c64/zaxxon.cpp @@ -26,7 +26,7 @@ const device_type C64_ZAXXON = &device_creator; // c64_zaxxon_cartridge_device - constructor //------------------------------------------------- -c64_zaxxon_cartridge_device::c64_zaxxon_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_zaxxon_cartridge_device::c64_zaxxon_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_ZAXXON, "C64 Zaxxon cartridge", tag, owner, clock, "c64_zaxxon", __FILE__), device_c64_expansion_card_interface(mconfig, *this), m_bank(0) @@ -49,7 +49,7 @@ void c64_zaxxon_cartridge_device::device_start() // c64_cd_r - cartridge data read //------------------------------------------------- -UINT8 c64_zaxxon_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) +uint8_t c64_zaxxon_cartridge_device::c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) { if (!roml) { diff --git a/src/devices/bus/c64/zaxxon.h b/src/devices/bus/c64/zaxxon.h index 28b8eecc911..78bb7e8b0b6 100644 --- a/src/devices/bus/c64/zaxxon.h +++ b/src/devices/bus/c64/zaxxon.h @@ -28,14 +28,14 @@ class c64_zaxxon_cartridge_device : public device_t, { public: // construction/destruction - c64_zaxxon_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_zaxxon_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_c64_expansion_card_interface overrides - virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; + virtual uint8_t c64_cd_r(address_space &space, offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: int m_bank; diff --git a/src/devices/bus/cbm2/24k.cpp b/src/devices/bus/cbm2/24k.cpp index a31c58a7aaf..586e24b8564 100644 --- a/src/devices/bus/cbm2/24k.cpp +++ b/src/devices/bus/cbm2/24k.cpp @@ -26,7 +26,7 @@ const device_type CBM2_24K = &device_creator; // cbm2_24k_cartridge_device - constructor //------------------------------------------------- -cbm2_24k_cartridge_device::cbm2_24k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cbm2_24k_cartridge_device::cbm2_24k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CBM2_24K, "24K RAM/ROM cartridge", tag, owner, clock, "cbm2_24k", __FILE__), device_cbm2_expansion_card_interface(mconfig, *this), m_ram(*this, "ram") @@ -48,7 +48,7 @@ void cbm2_24k_cartridge_device::device_start() // cbm2_bd_r - cartridge data read //------------------------------------------------- -UINT8 cbm2_24k_cartridge_device::cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) +uint8_t cbm2_24k_cartridge_device::cbm2_bd_r(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) { if (!csbank1) { @@ -71,7 +71,7 @@ UINT8 cbm2_24k_cartridge_device::cbm2_bd_r(address_space &space, offs_t offset, // cbm2_bd_w - cartridge data write //------------------------------------------------- -void cbm2_24k_cartridge_device::cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) +void cbm2_24k_cartridge_device::cbm2_bd_w(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) { if (!csbank1) { diff --git a/src/devices/bus/cbm2/24k.h b/src/devices/bus/cbm2/24k.h index 6d39d0dd5d5..aef9190849e 100644 --- a/src/devices/bus/cbm2/24k.h +++ b/src/devices/bus/cbm2/24k.h @@ -27,17 +27,17 @@ class cbm2_24k_cartridge_device : public device_t, { public: // construction/destruction - cbm2_24k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm2_24k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_cbm2_expansion_card_interface overrides - virtual UINT8 cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) override; - virtual void cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) override; + virtual uint8_t cbm2_bd_r(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) override; + virtual void cbm2_bd_w(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) override; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; }; diff --git a/src/devices/bus/cbm2/exp.cpp b/src/devices/bus/cbm2/exp.cpp index e3cbd5e2bee..aff76dee622 100644 --- a/src/devices/bus/cbm2/exp.cpp +++ b/src/devices/bus/cbm2/exp.cpp @@ -62,7 +62,7 @@ device_cbm2_expansion_card_interface::~device_cbm2_expansion_card_interface() // cbm2_expansion_slot_device - constructor //------------------------------------------------- -cbm2_expansion_slot_device::cbm2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cbm2_expansion_slot_device::cbm2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CBM2_EXPANSION_SLOT, "CBM-II expansion port", tag, owner, clock, "cbm2_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), m_card(nullptr) @@ -153,7 +153,7 @@ std::string cbm2_expansion_slot_device::get_default_card_software() // read - cartridge data read //------------------------------------------------- -UINT8 cbm2_expansion_slot_device::read(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) +uint8_t cbm2_expansion_slot_device::read(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) { if (m_card != nullptr) { @@ -168,7 +168,7 @@ UINT8 cbm2_expansion_slot_device::read(address_space &space, offs_t offset, UINT // write - cartridge data write //------------------------------------------------- -void cbm2_expansion_slot_device::write(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) +void cbm2_expansion_slot_device::write(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) { if (m_card != nullptr) { diff --git a/src/devices/bus/cbm2/exp.h b/src/devices/bus/cbm2/exp.h index ad66454a746..acba3dcf25e 100644 --- a/src/devices/bus/cbm2/exp.h +++ b/src/devices/bus/cbm2/exp.h @@ -66,11 +66,11 @@ class cbm2_expansion_slot_device : public device_t, { public: // construction/destruction - cbm2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm2_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // computer interface - UINT8 read(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3); - void write(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3); + uint8_t read(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3); + void write(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3); // cartridge interface int phi2() { return clock(); } @@ -113,13 +113,13 @@ public: device_cbm2_expansion_card_interface(const machine_config &mconfig, device_t &device); virtual ~device_cbm2_expansion_card_interface(); - virtual UINT8 cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) { return data; }; - virtual void cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) { }; + virtual uint8_t cbm2_bd_r(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) { return data; }; + virtual void cbm2_bd_w(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) { }; protected: - optional_shared_ptr m_bank1; - optional_shared_ptr m_bank2; - optional_shared_ptr m_bank3; + optional_shared_ptr m_bank1; + optional_shared_ptr m_bank2; + optional_shared_ptr m_bank3; cbm2_expansion_slot_device *m_slot; }; diff --git a/src/devices/bus/cbm2/hrg.cpp b/src/devices/bus/cbm2/hrg.cpp index ecc42220d80..81a27fa2ce2 100644 --- a/src/devices/bus/cbm2/hrg.cpp +++ b/src/devices/bus/cbm2/hrg.cpp @@ -147,7 +147,7 @@ machine_config_constructor cbm2_hrg_b_t::device_mconfig_additions() const // cbm2_hrg_t - constructor //------------------------------------------------- -cbm2_hrg_t::cbm2_hrg_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) : +cbm2_hrg_t::cbm2_hrg_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), device_cbm2_expansion_card_interface(mconfig, *this), m_gdc(*this, EF9366_TAG), @@ -155,12 +155,12 @@ cbm2_hrg_t::cbm2_hrg_t(const machine_config &mconfig, device_type type, const ch { } -cbm2_hrg_a_t::cbm2_hrg_a_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cbm2_hrg_a_t::cbm2_hrg_a_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cbm2_hrg_t(mconfig, CBM2_HRG_A, "CBM 500/600/700 High Resolution Graphics (A)", tag, owner, clock, "cbm2_hrga", __FILE__) { } -cbm2_hrg_b_t::cbm2_hrg_b_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cbm2_hrg_b_t::cbm2_hrg_b_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cbm2_hrg_t(mconfig, CBM2_HRG_B, "CBM 500/600/700 High Resolution Graphics (B)", tag, owner, clock, "cbm2_hrgb", __FILE__) { } @@ -189,7 +189,7 @@ void cbm2_hrg_t::device_reset() // cbm2_bd_r - cartridge data read //------------------------------------------------- -UINT8 cbm2_hrg_t::cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) +uint8_t cbm2_hrg_t::cbm2_bd_r(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) { if (!csbank3) { @@ -232,7 +232,7 @@ UINT8 cbm2_hrg_t::cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int // cbm2_bd_w - cartridge data write //------------------------------------------------- -void cbm2_hrg_t::cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) +void cbm2_hrg_t::cbm2_bd_w(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) { if (!csbank3) { diff --git a/src/devices/bus/cbm2/hrg.h b/src/devices/bus/cbm2/hrg.h index d4c813a6d48..d7b181c1c81 100644 --- a/src/devices/bus/cbm2/hrg.h +++ b/src/devices/bus/cbm2/hrg.h @@ -28,7 +28,7 @@ class cbm2_hrg_t : public device_t, { public: // construction/destruction - cbm2_hrg_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); + cbm2_hrg_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); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; @@ -39,8 +39,8 @@ protected: virtual void device_reset() override; // device_cbm2_expansion_card_interface overrides - virtual UINT8 cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) override; - virtual void cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) override; + virtual uint8_t cbm2_bd_r(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) override; + virtual void cbm2_bd_w(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) override; private: required_device m_gdc; @@ -54,7 +54,7 @@ class cbm2_hrg_a_t : public cbm2_hrg_t { public: // construction/destruction - cbm2_hrg_a_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm2_hrg_a_t(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; @@ -67,7 +67,7 @@ class cbm2_hrg_b_t : public cbm2_hrg_t { public: // construction/destruction - cbm2_hrg_b_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm2_hrg_b_t(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; diff --git a/src/devices/bus/cbm2/std.cpp b/src/devices/bus/cbm2/std.cpp index e6e697927dc..4b1e74e8c27 100644 --- a/src/devices/bus/cbm2/std.cpp +++ b/src/devices/bus/cbm2/std.cpp @@ -26,7 +26,7 @@ const device_type CBM2_STD = &device_creator; // cbm2_standard_cartridge_device - constructor //------------------------------------------------- -cbm2_standard_cartridge_device::cbm2_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cbm2_standard_cartridge_device::cbm2_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CBM2_STD, "CBM-II standard cartridge", tag, owner, clock, "cbm2_standard", __FILE__), device_cbm2_expansion_card_interface(mconfig, *this) { @@ -46,7 +46,7 @@ void cbm2_standard_cartridge_device::device_start() // cbm2_bd_r - cartridge data read //------------------------------------------------- -UINT8 cbm2_standard_cartridge_device::cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) +uint8_t cbm2_standard_cartridge_device::cbm2_bd_r(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) { if (!csbank1 && m_bank1.bytes()) { diff --git a/src/devices/bus/cbm2/std.h b/src/devices/bus/cbm2/std.h index 1645958e40b..e5c8498d387 100644 --- a/src/devices/bus/cbm2/std.h +++ b/src/devices/bus/cbm2/std.h @@ -27,14 +27,14 @@ class cbm2_standard_cartridge_device : public device_t, { public: // construction/destruction - cbm2_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm2_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_cbm2_expansion_card_interface overrides - virtual UINT8 cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3) override; + virtual uint8_t cbm2_bd_r(address_space &space, offs_t offset, uint8_t data, int csbank1, int csbank2, int csbank3) override; }; diff --git a/src/devices/bus/cbm2/user.cpp b/src/devices/bus/cbm2/user.cpp index b6271071a9b..c19adfce06a 100644 --- a/src/devices/bus/cbm2/user.cpp +++ b/src/devices/bus/cbm2/user.cpp @@ -42,7 +42,7 @@ device_cbm2_user_port_interface::device_cbm2_user_port_interface(const machine_c // cbm2_user_port_device - constructor //------------------------------------------------- -cbm2_user_port_device::cbm2_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cbm2_user_port_device::cbm2_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CBM2_USER_PORT, "CBM2 user port", tag, owner, clock, "cbm2_user_port", __FILE__), device_slot_interface(mconfig, *this), m_write_irq(*this), diff --git a/src/devices/bus/cbm2/user.h b/src/devices/bus/cbm2/user.h index 58810f02f3f..a6246c40fa1 100644 --- a/src/devices/bus/cbm2/user.h +++ b/src/devices/bus/cbm2/user.h @@ -78,11 +78,11 @@ public: device_cbm2_user_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_cbm2_user_port_interface() { } - virtual UINT8 cbm2_d1_r(address_space &space, offs_t offset) { return 0xff; }; - virtual void cbm2_d1_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t cbm2_d1_r(address_space &space, offs_t offset) { return 0xff; }; + virtual void cbm2_d1_w(address_space &space, offs_t offset, uint8_t data) { }; - virtual UINT8 cbm2_d2_r(address_space &space, offs_t offset) { return 0xff; }; - virtual void cbm2_d2_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t cbm2_d2_r(address_space &space, offs_t offset) { return 0xff; }; + virtual void cbm2_d2_w(address_space &space, offs_t offset, uint8_t data) { }; virtual int cbm2_pb2_r() { return 1; } virtual void cbm2_pb2_w(int state) { }; @@ -105,7 +105,7 @@ class cbm2_user_port_device : public device_t, { public: // construction/destruction - cbm2_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm2_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~cbm2_user_port_device() { } template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } @@ -114,9 +114,9 @@ public: template static devcb_base &set_flag_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_flag.set_callback(object); } // computer interface - DECLARE_READ8_MEMBER( d1_r ) { UINT8 data = 0xff; if (m_card != nullptr) data = m_card->cbm2_d1_r(space, offset); return data; } + DECLARE_READ8_MEMBER( d1_r ) { uint8_t data = 0xff; if (m_card != nullptr) data = m_card->cbm2_d1_r(space, offset); return data; } DECLARE_WRITE8_MEMBER( d1_w ) { if (m_card != nullptr) m_card->cbm2_d1_w(space, offset, data); } - DECLARE_READ8_MEMBER( d2_r ) { UINT8 data = 0xff; if (m_card != nullptr) data = m_card->cbm2_d2_r(space, offset); return data; } + DECLARE_READ8_MEMBER( d2_r ) { uint8_t data = 0xff; if (m_card != nullptr) data = m_card->cbm2_d2_r(space, offset); return data; } DECLARE_WRITE8_MEMBER( d2_w ) { if (m_card != nullptr) m_card->cbm2_d2_w(space, offset, data); } DECLARE_READ_LINE_MEMBER( pb2_r ) { return m_card ? m_card->cbm2_pb2_r() : 1; } DECLARE_WRITE_LINE_MEMBER( pb2_w ) { if (m_card != nullptr) m_card->cbm2_pb2_w(state); } diff --git a/src/devices/bus/cbmiec/c1526.cpp b/src/devices/bus/cbmiec/c1526.cpp index b9f240fde45..d33b9d026c2 100644 --- a/src/devices/bus/cbmiec/c1526.cpp +++ b/src/devices/bus/cbmiec/c1526.cpp @@ -170,7 +170,7 @@ ioport_constructor c4023_t::device_input_ports() const // c1526_base_t - constructor //------------------------------------------------- -c1526_base_t:: c1526_base_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) : +c1526_base_t:: c1526_base_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) { } @@ -180,7 +180,7 @@ c1526_base_t:: c1526_base_t(const machine_config &mconfig, device_type type, con // c1526_t - constructor //------------------------------------------------- -c1526_t::c1526_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c1526_t::c1526_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1526_base_t(mconfig, C1526, "MPS802/C1526 Printer", tag, owner, clock, "c1526", __FILE__), device_cbm_iec_interface(mconfig, *this) { @@ -191,7 +191,7 @@ c1526_t::c1526_t(const machine_config &mconfig, const char *tag, device_t *owner // c4023_t - constructor //------------------------------------------------- -c4023_t::c4023_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c4023_t::c4023_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1526_base_t(mconfig, C4023, "C4023 Printer", tag, owner, clock, "c4023", __FILE__), device_ieee488_interface(mconfig, *this) { diff --git a/src/devices/bus/cbmiec/c1526.h b/src/devices/bus/cbmiec/c1526.h index d8ab0567905..c3a127c4580 100644 --- a/src/devices/bus/cbmiec/c1526.h +++ b/src/devices/bus/cbmiec/c1526.h @@ -28,7 +28,7 @@ class c1526_base_t : public device_t { public: // construction/destruction - c1526_base_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); + c1526_base_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); protected: // device-level overrides @@ -44,7 +44,7 @@ class c1526_t : public c1526_base_t, { public: // construction/destruction - c1526_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1526_t(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,7 +66,7 @@ class c4023_t : public c1526_base_t, { public: // construction/destruction - c4023_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c4023_t(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; diff --git a/src/devices/bus/cbmiec/c1541.cpp b/src/devices/bus/cbmiec/c1541.cpp index 3a763c1f53e..c5c2aaa2741 100644 --- a/src/devices/bus/cbmiec/c1541.cpp +++ b/src/devices/bus/cbmiec/c1541.cpp @@ -590,7 +590,7 @@ READ8_MEMBER( c1541_base_t::via0_pb_r ) */ - UINT8 data; + uint8_t data; // data in data = !m_bus->data_r() && !m_ga->atn_r(); @@ -687,7 +687,7 @@ READ8_MEMBER( c1541_base_t::via1_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // write protect sense data |= !m_floppy->wpt_r() << 4; @@ -999,7 +999,7 @@ inline void c1541_base_t::set_iec_data() // c1541_base_t - constructor //------------------------------------------------- -c1541_base_t:: c1541_base_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) : +c1541_base_t:: c1541_base_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), device_cbm_iec_interface(mconfig, *this), device_c64_floppy_parallel_interface(mconfig, *this), @@ -1020,7 +1020,7 @@ c1541_base_t:: c1541_base_t(const machine_config &mconfig, device_type type, con // c1540_t - constructor //------------------------------------------------- -c1540_t::c1540_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1540_t::c1540_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, C1540, "C1540", tag, owner, clock, "c1540", __FILE__) { } @@ -1028,7 +1028,7 @@ c1540_t::c1540_t(const machine_config &mconfig, const char *tag, device_t *owner // c1541_t - constructor //------------------------------------------------- -c1541_t::c1541_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1541_t::c1541_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, C1541, "C1541", tag, owner, clock, "c1541", __FILE__) { } @@ -1036,7 +1036,7 @@ c1541_t::c1541_t(const machine_config &mconfig, const char *tag, device_t *owner // c1541c_t - constructor //------------------------------------------------- -c1541c_t::c1541c_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1541c_t::c1541c_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, C1541C, "C1541C", tag, owner, clock, "c1541c", __FILE__) { } @@ -1044,7 +1044,7 @@ c1541c_t::c1541c_t(const machine_config &mconfig, const char *tag, device_t *own // c1541ii_t - constructor //------------------------------------------------- -c1541ii_t::c1541ii_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1541ii_t::c1541ii_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, C1541II, "C1541-II", tag, owner, clock, "c1541ii", __FILE__) { } @@ -1052,7 +1052,7 @@ c1541ii_t::c1541ii_t(const machine_config &mconfig, const char *tag, device_t *o // sx1541_t - constructor //------------------------------------------------- -sx1541_t::sx1541_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sx1541_t::sx1541_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, SX1541, "SX1541", tag, owner, clock, "sx1541", __FILE__) { } @@ -1060,7 +1060,7 @@ sx1541_t::sx1541_t(const machine_config &mconfig, const char *tag, device_t *own // fsd1_t - constructor //------------------------------------------------- -fsd1_t::fsd1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fsd1_t::fsd1_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, FSD1, "FSD-1", tag, owner, clock, "fsd1", __FILE__) { } @@ -1068,7 +1068,7 @@ fsd1_t::fsd1_t(const machine_config &mconfig, const char *tag, device_t *owner, // fsd2_t - constructor //------------------------------------------------- -fsd2_t::fsd2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fsd2_t::fsd2_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, FSD2, "FSD-2", tag, owner, clock, "fsd2", __FILE__) { } @@ -1076,7 +1076,7 @@ fsd2_t::fsd2_t(const machine_config &mconfig, const char *tag, device_t *owner, // csd1_t - constructor //------------------------------------------------- -csd1_t::csd1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +csd1_t::csd1_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, CSD1, "CSD-1", tag, owner, clock, "csd1", __FILE__) { } @@ -1084,7 +1084,7 @@ csd1_t::csd1_t(const machine_config &mconfig, const char *tag, device_t *owner, // c1541_dolphin_dos_t - constructor //------------------------------------------------- -c1541_dolphin_dos_t::c1541_dolphin_dos_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1541_dolphin_dos_t::c1541_dolphin_dos_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, C1541_DOLPHIN_DOS, "C1541 Dolphin-DOS 2.0", tag, owner, clock, "c1541dd", __FILE__) { } @@ -1092,7 +1092,7 @@ c1541_dolphin_dos_t::c1541_dolphin_dos_t(const machine_config &mconfig, const ch // c1541_professional_dos_v1_t - constructor //------------------------------------------------- -c1541_professional_dos_v1_t::c1541_professional_dos_v1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1541_professional_dos_v1_t::c1541_professional_dos_v1_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, C1541_PROFESSIONAL_DOS_V1, "C1541 Professional-DOS v1", tag, owner, clock, "c1541pd", __FILE__) { } @@ -1100,7 +1100,7 @@ c1541_professional_dos_v1_t::c1541_professional_dos_v1_t(const machine_config &m // c1541_prologic_dos_classic_t - constructor //------------------------------------------------- -c1541_prologic_dos_classic_t::c1541_prologic_dos_classic_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1541_prologic_dos_classic_t::c1541_prologic_dos_classic_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, C1541_PROLOGIC_DOS_CLASSIC, "C1541 ProLogic-DOS Classic", tag, owner, clock, "c1541pdc", __FILE__), m_pia(*this, MC6821_TAG), m_cent_data_out(*this, "cent_data_out"), @@ -1113,7 +1113,7 @@ c1541_prologic_dos_classic_t::c1541_prologic_dos_classic_t(const machine_config // indus_gt_t - constructor //------------------------------------------------- -indus_gt_t::indus_gt_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +indus_gt_t::indus_gt_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1541_base_t(mconfig, INDUS_GT, "Indus GT", tag, owner, clock, "indusgt", __FILE__) { } @@ -1137,11 +1137,11 @@ void fsd2_t::device_start() c1541_base_t::device_start(); // decrypt ROM - UINT8 *rom = memregion(M6502_TAG)->base(); + uint8_t *rom = memregion(M6502_TAG)->base(); for (offs_t offset = 0; offset < 0x4000; offset++) { - UINT8 data = BITSWAP8(rom[offset], 7, 6, 5, 3, 4, 2, 1, 0); + uint8_t data = BITSWAP8(rom[offset], 7, 6, 5, 3, 4, 2, 1, 0); rom[offset] = data; } @@ -1195,7 +1195,7 @@ void c1541_base_t::cbm_iec_reset(int state) // parallel_data_w - //------------------------------------------------- -void c1541_base_t::parallel_data_w(UINT8 data) +void c1541_base_t::parallel_data_w(uint8_t data) { m_parallel_data = data; } diff --git a/src/devices/bus/cbmiec/c1541.h b/src/devices/bus/cbmiec/c1541.h index 7192089e65a..a2ca5a9fed5 100644 --- a/src/devices/bus/cbmiec/c1541.h +++ b/src/devices/bus/cbmiec/c1541.h @@ -42,7 +42,7 @@ class c1541_base_t : public device_t, { public: // construction/destruction - c1541_base_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); + c1541_base_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -72,7 +72,7 @@ protected: virtual void cbm_iec_reset(int state) override; // device_c64_floppy_parallel_interface overrides - virtual void parallel_data_w(UINT8 data) override; + virtual void parallel_data_w(uint8_t data) override; virtual void parallel_strobe_w(int state) override; enum @@ -105,7 +105,7 @@ class c1540_t : public c1541_base_t { public: // construction/destruction - c1540_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1540_t(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; @@ -118,7 +118,7 @@ class c1541_t : public c1541_base_t { public: // construction/destruction - c1541_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1541_t(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; @@ -131,7 +131,7 @@ class c1541c_t : public c1541_base_t { public: // construction/destruction - c1541c_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1541c_t(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; @@ -148,7 +148,7 @@ class c1541ii_t : public c1541_base_t { public: // construction/destruction - c1541ii_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1541ii_t(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; @@ -161,7 +161,7 @@ class sx1541_t : public c1541_base_t { public: // construction/destruction - sx1541_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sx1541_t(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; @@ -174,7 +174,7 @@ class fsd1_t : public c1541_base_t { public: // construction/destruction - fsd1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fsd1_t(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; @@ -187,7 +187,7 @@ class fsd2_t : public c1541_base_t { public: // construction/destruction - fsd2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fsd2_t(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; @@ -203,7 +203,7 @@ class csd1_t : public c1541_base_t { public: // construction/destruction - csd1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + csd1_t(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; @@ -216,7 +216,7 @@ class c1541_dolphin_dos_t : public c1541_base_t { public: // construction/destruction - c1541_dolphin_dos_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1541_dolphin_dos_t(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; @@ -230,7 +230,7 @@ class c1541_professional_dos_v1_t : public c1541_base_t { public: // construction/destruction - c1541_professional_dos_v1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1541_professional_dos_v1_t(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; @@ -244,7 +244,7 @@ class c1541_prologic_dos_classic_t : public c1541_base_t { public: // construction/destruction - c1541_prologic_dos_classic_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1541_prologic_dos_classic_t(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; @@ -274,7 +274,7 @@ class indus_gt_t : public c1541_base_t { public: // construction/destruction - indus_gt_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + indus_gt_t(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; diff --git a/src/devices/bus/cbmiec/c1571.cpp b/src/devices/bus/cbmiec/c1571.cpp index b7d98b8b15d..e0118b1b868 100644 --- a/src/devices/bus/cbmiec/c1571.cpp +++ b/src/devices/bus/cbmiec/c1571.cpp @@ -193,7 +193,7 @@ READ8_MEMBER( c1571_t::via0_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // track 0 sense data |= (m_floppy->trk00_r() ? 0x01 : 0x00); @@ -232,7 +232,7 @@ WRITE8_MEMBER( c1571_t::via0_pa_w ) if (m_1_2mhz != clock_1_2) { - UINT32 clock = clock_1_2 ? XTAL_16MHz/8 : XTAL_16MHz/16; + uint32_t clock = clock_1_2 ? XTAL_16MHz/8 : XTAL_16MHz/16; m_maincpu->set_unscaled_clock(clock); m_cia->set_unscaled_clock(clock); @@ -274,7 +274,7 @@ WRITE8_MEMBER( c1571cr_t::via0_pa_w ) if (m_1_2mhz != clock_1_2) { - UINT32 clock = clock_1_2 ? XTAL_16MHz/8 : XTAL_16MHz/16; + uint32_t clock = clock_1_2 ? XTAL_16MHz/8 : XTAL_16MHz/16; m_maincpu->set_unscaled_clock(clock); m_cia->set_unscaled_clock(clock); @@ -303,7 +303,7 @@ READ8_MEMBER( c1571_t::via0_pb_r ) */ - UINT8 data; + uint8_t data; // data in data = !m_bus->data_r(); @@ -381,7 +381,7 @@ WRITE8_MEMBER( c1571cr_t::via0_pb_w ) READ8_MEMBER( c1571_t::via1_r ) { - UINT8 data = m_via1->read(space, offset); + uint8_t data = m_via1->read(space, offset); m_ga->ted_w(!m_1_2mhz); m_ga->ted_w(1); @@ -421,7 +421,7 @@ READ8_MEMBER( c1571_t::via1_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // write protect sense data |= !m_floppy->wpt_r() << 4; @@ -830,7 +830,7 @@ ioport_constructor c1571_t::device_input_ports() const // c1571_t - constructor //------------------------------------------------- -c1571_t::c1571_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) +c1571_t::c1571_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), device_cbm_iec_interface(mconfig, *this), device_c64_floppy_parallel_interface(mconfig, *this), @@ -853,7 +853,7 @@ c1571_t::c1571_t(const machine_config &mconfig, device_type type, const char *na { } -c1571_t::c1571_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1571_t::c1571_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C1571, "C1571", tag, owner, clock, "c1571", __FILE__), device_cbm_iec_interface(mconfig, *this), device_c64_floppy_parallel_interface(mconfig, *this), @@ -881,7 +881,7 @@ c1571_t::c1571_t(const machine_config &mconfig, const char *tag, device_t *owner // c1570_t - constructor //------------------------------------------------- -c1570_t::c1570_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1570_t::c1570_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1571_t(mconfig, C1570, "C1570", tag, owner, clock, "c1570", __FILE__) { } @@ -891,7 +891,7 @@ c1570_t::c1570_t(const machine_config &mconfig, const char *tag, device_t *owner // c1571cr_t - constructor //------------------------------------------------- -c1571cr_t::c1571cr_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1571cr_t::c1571cr_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1571_t(mconfig, C1571CR, "C1571CR", tag, owner, clock, "c1571cr", __FILE__) { } @@ -901,7 +901,7 @@ c1571cr_t::c1571cr_t(const machine_config &mconfig, const char *tag, device_t *o // mini_chief_t - constructor //------------------------------------------------- -mini_chief_t::mini_chief_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mini_chief_t::mini_chief_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1571_t(mconfig, MINI_CHIEF, "ICT Mini Chief", tag, owner, clock, "minichif", __FILE__) { } @@ -999,7 +999,7 @@ void c1571_t::cbm_iec_reset(int state) // parallel_data_w - //------------------------------------------------- -void c1571_t::parallel_data_w(UINT8 data) +void c1571_t::parallel_data_w(uint8_t data) { m_parallel_data = data; } diff --git a/src/devices/bus/cbmiec/c1571.h b/src/devices/bus/cbmiec/c1571.h index 74d90080615..64635542f4d 100644 --- a/src/devices/bus/cbmiec/c1571.h +++ b/src/devices/bus/cbmiec/c1571.h @@ -44,8 +44,8 @@ class c1571_t : public device_t, { public: // construction/destruction - c1571_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); - c1571_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1571_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); + c1571_t(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; @@ -89,7 +89,7 @@ protected: virtual void cbm_iec_reset(int state) override; // device_c64_floppy_parallel_interface overrides - virtual void parallel_data_w(UINT8 data) override; + virtual void parallel_data_w(uint8_t data) override; virtual void parallel_strobe_w(int state) override; enum @@ -131,7 +131,7 @@ class c1570_t : public c1571_t { public: // construction/destruction - c1570_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1570_t(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; @@ -145,7 +145,7 @@ class c1571cr_t : public c1571_t { public: // construction/destruction - c1571cr_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1571cr_t(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; @@ -162,7 +162,7 @@ class mini_chief_t : public c1571_t { public: // construction/destruction - mini_chief_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mini_chief_t(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; diff --git a/src/devices/bus/cbmiec/c1581.cpp b/src/devices/bus/cbmiec/c1581.cpp index 1bfcad12218..005370fa3d8 100644 --- a/src/devices/bus/cbmiec/c1581.cpp +++ b/src/devices/bus/cbmiec/c1581.cpp @@ -131,7 +131,7 @@ READ8_MEMBER( c1581_t::cia_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // ready //data |= !m_floppy->ready_r() << 1; @@ -192,7 +192,7 @@ READ8_MEMBER( c1581_t::cia_pb_r ) */ - UINT8 data; + uint8_t data; // data in data = !m_bus->data_r(); @@ -326,7 +326,7 @@ ioport_constructor c1581_t::device_input_ports() const // c1581_t - constructor //------------------------------------------------- -c1581_t::c1581_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) +c1581_t::c1581_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), device_cbm_iec_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), @@ -342,7 +342,7 @@ c1581_t::c1581_t(const machine_config &mconfig, device_type type, const char *na { } -c1581_t::c1581_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1581_t::c1581_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C1581, "C1581", tag, owner, clock, "c1581", __FILE__), device_cbm_iec_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), @@ -363,7 +363,7 @@ c1581_t::c1581_t(const machine_config &mconfig, const char *tag, device_t *owner // c1563_t - constructor //------------------------------------------------- -c1563_t::c1563_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1563_t::c1563_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c1581_t(mconfig, C1563, "C1563", tag, owner, clock, "c1563", __FILE__) { } diff --git a/src/devices/bus/cbmiec/c1581.h b/src/devices/bus/cbmiec/c1581.h index 0694bc77ab8..e09d0579ebf 100644 --- a/src/devices/bus/cbmiec/c1581.h +++ b/src/devices/bus/cbmiec/c1581.h @@ -39,8 +39,8 @@ class c1581_t : public device_t, { public: // construction/destruction - c1581_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); - c1581_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1581_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); + c1581_t(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; @@ -96,7 +96,7 @@ class c1563_t : public c1581_t { public: // construction/destruction - c1563_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1563_t(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; diff --git a/src/devices/bus/cbmiec/c64_nl10.cpp b/src/devices/bus/cbmiec/c64_nl10.cpp index 9ee058adf80..4b9e2afa033 100644 --- a/src/devices/bus/cbmiec/c64_nl10.cpp +++ b/src/devices/bus/cbmiec/c64_nl10.cpp @@ -46,7 +46,7 @@ const tiny_rom_entry *c64_nl10_interface_device::device_rom_region() const // c64_nl10_interface_device - constructor //------------------------------------------------- -c64_nl10_interface_device::c64_nl10_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c64_nl10_interface_device::c64_nl10_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_NL10_INTERFACE, "Star NL-10 C64 Interface Cartridge", tag, owner, clock, "c64_nl10", __FILE__), device_cbm_iec_interface(mconfig, *this) { diff --git a/src/devices/bus/cbmiec/c64_nl10.h b/src/devices/bus/cbmiec/c64_nl10.h index 99da4a2c141..556cb01d12d 100644 --- a/src/devices/bus/cbmiec/c64_nl10.h +++ b/src/devices/bus/cbmiec/c64_nl10.h @@ -27,7 +27,7 @@ class c64_nl10_interface_device : public device_t, { public: // construction/destruction - c64_nl10_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_nl10_interface_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; diff --git a/src/devices/bus/cbmiec/cbmiec.cpp b/src/devices/bus/cbmiec/cbmiec.cpp index 7e893614f3f..a9f47da877f 100644 --- a/src/devices/bus/cbmiec/cbmiec.cpp +++ b/src/devices/bus/cbmiec/cbmiec.cpp @@ -245,7 +245,7 @@ device_cbm_iec_interface::~device_cbm_iec_interface() // cbm_iec_slot_device - constructor //------------------------------------------------- -cbm_iec_slot_device::cbm_iec_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cbm_iec_slot_device::cbm_iec_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CBM_IEC_SLOT, "CBM IEC slot", tag, owner, clock, "cbm_iec_slot", __FILE__), device_slot_interface(mconfig, *this), m_address(0) { @@ -282,7 +282,7 @@ void cbm_iec_slot_device::device_start() // cbm_iec_device - constructor //------------------------------------------------- -cbm_iec_device::cbm_iec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cbm_iec_device::cbm_iec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CBM_IEC, "CBM IEC bus", tag, owner, clock, "cbm_iec", __FILE__), m_write_srq(*this), m_write_atn(*this), diff --git a/src/devices/bus/cbmiec/cbmiec.h b/src/devices/bus/cbmiec/cbmiec.h index 5be1ff5f818..8ba9b8b2f02 100644 --- a/src/devices/bus/cbmiec/cbmiec.h +++ b/src/devices/bus/cbmiec/cbmiec.h @@ -76,7 +76,7 @@ class cbm_iec_device : public device_t { public: // construction/destruction - cbm_iec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm_iec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_srq_callback(_write wr) { m_write_srq.set_callback(wr); } template void set_atn_callback(_write wr) { m_write_atn.set_callback(wr); } @@ -159,7 +159,7 @@ class cbm_iec_slot_device : public device_t, { public: // construction/destruction - cbm_iec_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm_iec_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_address(int address) { m_address = address; } int get_address() { return m_address; } diff --git a/src/devices/bus/cbmiec/cmdhd.cpp b/src/devices/bus/cbmiec/cmdhd.cpp index ef26f7be706..5300b9ef859 100644 --- a/src/devices/bus/cbmiec/cmdhd.cpp +++ b/src/devices/bus/cbmiec/cmdhd.cpp @@ -108,7 +108,7 @@ machine_config_constructor cmd_hd_device::device_mconfig_additions() const // cmd_hd_device - constructor //------------------------------------------------- -cmd_hd_device::cmd_hd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cmd_hd_device::cmd_hd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CMD_HD, "HD", tag, owner, clock, "cmdhd", __FILE__), device_cbm_iec_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), diff --git a/src/devices/bus/cbmiec/cmdhd.h b/src/devices/bus/cbmiec/cmdhd.h index 9869531b05d..40a08021f12 100644 --- a/src/devices/bus/cbmiec/cmdhd.h +++ b/src/devices/bus/cbmiec/cmdhd.h @@ -40,7 +40,7 @@ class cmd_hd_device : public device_t, { public: // construction/destruction - cmd_hd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cmd_hd_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; diff --git a/src/devices/bus/cbmiec/diag264_lb_iec.cpp b/src/devices/bus/cbmiec/diag264_lb_iec.cpp index d9c2e5ed303..2fc5544dd7b 100644 --- a/src/devices/bus/cbmiec/diag264_lb_iec.cpp +++ b/src/devices/bus/cbmiec/diag264_lb_iec.cpp @@ -26,7 +26,7 @@ const device_type DIAG264_SERIAL_LOOPBACK = &device_creatorget_irq() << 7; @@ -274,7 +274,7 @@ machine_config_constructor fd2000_device::device_mconfig_additions() const // fd2000_device - constructor //------------------------------------------------- -fd2000_device::fd2000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fd2000_device::fd2000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FD2000, "FD-2000", tag, owner, clock, "fd2000", __FILE__), device_cbm_iec_interface(mconfig, *this), m_maincpu(*this, G65SC02PI2_TAG), @@ -284,7 +284,7 @@ fd2000_device::fd2000_device(const machine_config &mconfig, const char *tag, dev { } -fd2000_device::fd2000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +fd2000_device::fd2000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_cbm_iec_interface(mconfig, *this), m_maincpu(*this, R65C02P4_TAG), @@ -299,7 +299,7 @@ fd2000_device::fd2000_device(const machine_config &mconfig, device_type type, co // fd4000_device - constructor //------------------------------------------------- -fd4000_device::fd4000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fd4000_device::fd4000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : fd2000_device(mconfig, FD4000, "FD-4000", tag, owner, clock, TYPE_FD4000, "fd4000", __FILE__ ) { } diff --git a/src/devices/bus/cbmiec/fd2000.h b/src/devices/bus/cbmiec/fd2000.h index 4a660cd218d..f5c0218ae62 100644 --- a/src/devices/bus/cbmiec/fd2000.h +++ b/src/devices/bus/cbmiec/fd2000.h @@ -39,8 +39,8 @@ class fd2000_device : public device_t, { public: // construction/destruction - fd2000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - fd2000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); + fd2000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + fd2000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); enum { @@ -84,7 +84,7 @@ class fd4000_device : public fd2000_device { public: // construction/destruction - fd4000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd4000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/cbmiec/interpod.cpp b/src/devices/bus/cbmiec/interpod.cpp index ebf1a6b3776..b109773722b 100644 --- a/src/devices/bus/cbmiec/interpod.cpp +++ b/src/devices/bus/cbmiec/interpod.cpp @@ -153,7 +153,7 @@ machine_config_constructor interpod_device::device_mconfig_additions() const // interpod_device - constructor //------------------------------------------------- -interpod_device::interpod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +interpod_device::interpod_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INTERPOD, "Interpod", tag, owner, clock, "interpod", __FILE__), device_cbm_iec_interface(mconfig, *this), m_maincpu(*this, R6502_TAG), diff --git a/src/devices/bus/cbmiec/interpod.h b/src/devices/bus/cbmiec/interpod.h index 833bcd94a35..28fb987eac8 100644 --- a/src/devices/bus/cbmiec/interpod.h +++ b/src/devices/bus/cbmiec/interpod.h @@ -49,7 +49,7 @@ class interpod_device : public device_t, { public: // construction/destruction - interpod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + interpod_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; diff --git a/src/devices/bus/cbmiec/serialbox.cpp b/src/devices/bus/cbmiec/serialbox.cpp index 617a4c3eded..8642eb5dbd9 100644 --- a/src/devices/bus/cbmiec/serialbox.cpp +++ b/src/devices/bus/cbmiec/serialbox.cpp @@ -93,7 +93,7 @@ machine_config_constructor serial_box_device::device_mconfig_additions() const // serial_box_device - constructor //------------------------------------------------- -serial_box_device::serial_box_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +serial_box_device::serial_box_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SERIAL_BOX, "Serial Box", tag, owner, clock, "serbox", __FILE__), device_cbm_iec_interface(mconfig, *this), m_maincpu(*this, M6502_TAG) diff --git a/src/devices/bus/cbmiec/serialbox.h b/src/devices/bus/cbmiec/serialbox.h index 090ebdfb091..550a501a2a7 100644 --- a/src/devices/bus/cbmiec/serialbox.h +++ b/src/devices/bus/cbmiec/serialbox.h @@ -36,7 +36,7 @@ class serial_box_device : public device_t, { public: // construction/destruction - serial_box_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + serial_box_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; diff --git a/src/devices/bus/cbmiec/vic1515.cpp b/src/devices/bus/cbmiec/vic1515.cpp index c1ab23f427a..e831ad7f8c3 100644 --- a/src/devices/bus/cbmiec/vic1515.cpp +++ b/src/devices/bus/cbmiec/vic1515.cpp @@ -108,7 +108,7 @@ ioport_constructor vic1515_t::device_input_ports() const // vic1515_t - constructor //------------------------------------------------- -vic1515_t::vic1515_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vic1515_t::vic1515_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC1515, "VIC-1515", tag, owner, clock, "vic1515", __FILE__), device_cbm_iec_interface(mconfig, *this) { diff --git a/src/devices/bus/cbmiec/vic1515.h b/src/devices/bus/cbmiec/vic1515.h index 9cf6a53b3d1..998bb1de4f4 100644 --- a/src/devices/bus/cbmiec/vic1515.h +++ b/src/devices/bus/cbmiec/vic1515.h @@ -28,7 +28,7 @@ class vic1515_t : public device_t, { public: // construction/destruction - vic1515_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic1515_t(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; diff --git a/src/devices/bus/cbmiec/vic1520.cpp b/src/devices/bus/cbmiec/vic1520.cpp index 9d62de41bb6..8122887bd5f 100644 --- a/src/devices/bus/cbmiec/vic1520.cpp +++ b/src/devices/bus/cbmiec/vic1520.cpp @@ -136,7 +136,7 @@ ioport_constructor vic1520_t::device_input_ports() const // vic1520_t - constructor //------------------------------------------------- -vic1520_t::vic1520_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vic1520_t::vic1520_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC1520, "VIC-1520", tag, owner, clock, "vic1520", __FILE__), device_cbm_iec_interface(mconfig, *this) { diff --git a/src/devices/bus/cbmiec/vic1520.h b/src/devices/bus/cbmiec/vic1520.h index 9f893766bf8..4405f0da327 100644 --- a/src/devices/bus/cbmiec/vic1520.h +++ b/src/devices/bus/cbmiec/vic1520.h @@ -28,7 +28,7 @@ class vic1520_t : public device_t, { public: // construction/destruction - vic1520_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic1520_t(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; diff --git a/src/devices/bus/centronics/comxpl80.cpp b/src/devices/bus/centronics/comxpl80.cpp index 2db0e42694a..6192563759d 100644 --- a/src/devices/bus/centronics/comxpl80.cpp +++ b/src/devices/bus/centronics/comxpl80.cpp @@ -158,7 +158,7 @@ ioport_constructor comx_pl80_device::device_input_ports() const // comx_pl80_device - constructor //------------------------------------------------- -comx_pl80_device::comx_pl80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +comx_pl80_device::comx_pl80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_PL80, "COMX PL-80", tag, owner, clock, "comx_pl80", __FILE__), device_centronics_peripheral_interface(mconfig, *this), m_plotter(*this, "gfx1"), diff --git a/src/devices/bus/centronics/comxpl80.h b/src/devices/bus/centronics/comxpl80.h index 9301fcc5ef3..094453a4c97 100644 --- a/src/devices/bus/centronics/comxpl80.h +++ b/src/devices/bus/centronics/comxpl80.h @@ -28,7 +28,7 @@ class comx_pl80_device : public device_t, { public: // construction/destruction - comx_pl80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_pl80_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; @@ -61,15 +61,15 @@ private: required_ioport m_sw; // PL-80 plotter state - UINT16 m_font_addr; // font ROM pack address latch - UINT8 m_x_motor_phase; // X motor phase - UINT8 m_y_motor_phase; // Y motor phase - UINT8 m_z_motor_phase; // Z motor phase - UINT8 m_plotter_data; // plotter data bus + uint16_t m_font_addr; // font ROM pack address latch + uint8_t m_x_motor_phase; // X motor phase + uint8_t m_y_motor_phase; // Y motor phase + uint8_t m_z_motor_phase; // Z motor phase + uint8_t m_plotter_data; // plotter data bus int m_plotter_ack; // plotter acknowledge int m_plotter_online; // online LED - UINT8 m_data; + uint8_t m_data; }; diff --git a/src/devices/bus/centronics/covox.cpp b/src/devices/bus/centronics/covox.cpp index f8d4da11a6b..b6f5b45fe69 100644 --- a/src/devices/bus/centronics/covox.cpp +++ b/src/devices/bus/centronics/covox.cpp @@ -33,7 +33,7 @@ MACHINE_CONFIG_END // centronics_covox_device - constructor //------------------------------------------------- -centronics_covox_device::centronics_covox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +centronics_covox_device::centronics_covox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CENTRONICS_COVOX, "Covox Speech Thing", tag, owner, clock, "covox", __FILE__), device_centronics_peripheral_interface( mconfig, *this ), m_dac(*this, "dac"), @@ -87,7 +87,7 @@ MACHINE_CONFIG_END // centronics_covox_stereo_device - constructor //------------------------------------------------- -centronics_covox_stereo_device::centronics_covox_stereo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +centronics_covox_stereo_device::centronics_covox_stereo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CENTRONICS_COVOX_STEREO, "Covox (Stereo-in-1)", tag, owner, clock, "covox_stereo", __FILE__), device_centronics_peripheral_interface( mconfig, *this ), m_ldac(*this, "ldac"), diff --git a/src/devices/bus/centronics/covox.h b/src/devices/bus/centronics/covox.h index 527c8d8e398..48036c05487 100644 --- a/src/devices/bus/centronics/covox.h +++ b/src/devices/bus/centronics/covox.h @@ -21,7 +21,7 @@ class centronics_covox_device : public device_t, { public: // construction/destruction - centronics_covox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + centronics_covox_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; @@ -44,7 +44,7 @@ private: void update_dac(); - UINT8 m_data; + uint8_t m_data; }; // device type definition @@ -57,7 +57,7 @@ class centronics_covox_stereo_device : public device_t, { public: // construction/destruction - centronics_covox_stereo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + centronics_covox_stereo_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; @@ -84,7 +84,7 @@ private: void update_dac(); int m_strobe; - UINT8 m_data; + uint8_t m_data; int m_autofd; }; diff --git a/src/devices/bus/centronics/ctronics.cpp b/src/devices/bus/centronics/ctronics.cpp index 34d2e21f022..852c789d22d 100644 --- a/src/devices/bus/centronics/ctronics.cpp +++ b/src/devices/bus/centronics/ctronics.cpp @@ -12,7 +12,7 @@ const device_type CENTRONICS = &device_creator; -centronics_device::centronics_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +centronics_device::centronics_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CENTRONICS, "Centronics", tag, owner, clock, "centronics", __FILE__), device_slot_interface(mconfig, *this), m_strobe_handler(*this), diff --git a/src/devices/bus/centronics/ctronics.h b/src/devices/bus/centronics/ctronics.h index 51f13348051..1cadbd0f992 100644 --- a/src/devices/bus/centronics/ctronics.h +++ b/src/devices/bus/centronics/ctronics.h @@ -102,7 +102,7 @@ class centronics_device : public device_t, friend class device_centronics_peripheral_interface; public: - centronics_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + centronics_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_strobe_handler(device_t &device, _Object object) { return downcast(device).m_strobe_handler.set_callback(object); } template static devcb_base &set_data0_handler(device_t &device, _Object object) { return downcast(device).m_data0_handler.set_callback(object); } diff --git a/src/devices/bus/centronics/digiblst.cpp b/src/devices/bus/centronics/digiblst.cpp index 1b7ed87ce2f..cea44838ecc 100644 --- a/src/devices/bus/centronics/digiblst.cpp +++ b/src/devices/bus/centronics/digiblst.cpp @@ -33,7 +33,7 @@ MACHINE_CONFIG_END // centronics_covox_device - constructor //------------------------------------------------- -centronics_digiblaster_device::centronics_digiblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +centronics_digiblaster_device::centronics_digiblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CENTRONICS_DIGIBLASTER, "Digiblaster (DIY)", tag, owner, clock, "digiblst", __FILE__), device_centronics_peripheral_interface( mconfig, *this ), m_dac(*this, "dac"), diff --git a/src/devices/bus/centronics/digiblst.h b/src/devices/bus/centronics/digiblst.h index 6bf4956ee47..4b5924b9f55 100644 --- a/src/devices/bus/centronics/digiblst.h +++ b/src/devices/bus/centronics/digiblst.h @@ -27,7 +27,7 @@ class centronics_digiblaster_device : public device_t, { public: // construction/destruction - centronics_digiblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + centronics_digiblaster_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; @@ -50,7 +50,7 @@ private: void update_dac(); - UINT8 m_data; + uint8_t m_data; }; // device type definition diff --git a/src/devices/bus/centronics/dsjoy.cpp b/src/devices/bus/centronics/dsjoy.cpp index de9b1138ec8..2f358ceae3a 100644 --- a/src/devices/bus/centronics/dsjoy.cpp +++ b/src/devices/bus/centronics/dsjoy.cpp @@ -5,7 +5,7 @@ const device_type DEMPA_SHINBUNSHA_JOYSTICK = &device_creator; -dempa_shinbunsha_joystick_device::dempa_shinbunsha_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dempa_shinbunsha_joystick_device::dempa_shinbunsha_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DEMPA_SHINBUNSHA_JOYSTICK, "Dempa Shinbunsha Joystick", tag, owner, clock, "dempa_shinbunsha_joystick", __FILE__), device_centronics_peripheral_interface( mconfig, *this ), m_lptjoy(*this, "lptjoy"), diff --git a/src/devices/bus/centronics/dsjoy.h b/src/devices/bus/centronics/dsjoy.h index c23ddf87e11..5db48e615fb 100644 --- a/src/devices/bus/centronics/dsjoy.h +++ b/src/devices/bus/centronics/dsjoy.h @@ -18,7 +18,7 @@ class dempa_shinbunsha_joystick_device : public device_t, { public: // construction/destruction - dempa_shinbunsha_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dempa_shinbunsha_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -37,7 +37,7 @@ private: void update_perror(); - UINT8 m_data; + uint8_t m_data; int m_perror; }; diff --git a/src/devices/bus/centronics/epson_ex800.cpp b/src/devices/bus/centronics/epson_ex800.cpp index 3e50493f6aa..4305744fcb1 100644 --- a/src/devices/bus/centronics/epson_ex800.cpp +++ b/src/devices/bus/centronics/epson_ex800.cpp @@ -357,7 +357,7 @@ ioport_constructor epson_ex800_t::device_input_ports() const // epson_ex800_t - constructor //------------------------------------------------- -epson_ex800_t::epson_ex800_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +epson_ex800_t::epson_ex800_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EPSON_EX800, "Epson EX-800", tag, owner, clock, "ex800", __FILE__), device_centronics_peripheral_interface(mconfig, *this), m_maincpu(*this, "maincpu"), diff --git a/src/devices/bus/centronics/epson_ex800.h b/src/devices/bus/centronics/epson_ex800.h index e5dabd1cc42..b1892cc969b 100644 --- a/src/devices/bus/centronics/epson_ex800.h +++ b/src/devices/bus/centronics/epson_ex800.h @@ -29,7 +29,7 @@ class epson_ex800_t : public device_t, { public: // construction/destruction - epson_ex800_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + epson_ex800_t(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; diff --git a/src/devices/bus/centronics/epson_lx800.cpp b/src/devices/bus/centronics/epson_lx800.cpp index 3eb784999ba..0367206cd78 100644 --- a/src/devices/bus/centronics/epson_lx800.cpp +++ b/src/devices/bus/centronics/epson_lx800.cpp @@ -199,7 +199,7 @@ ioport_constructor epson_lx800_t::device_input_ports() const // epson_lx800_t - constructor //------------------------------------------------- -epson_lx800_t::epson_lx800_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +epson_lx800_t::epson_lx800_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EPSON_LX800, "Epson LX-800", tag, owner, clock, "lx800", __FILE__), device_centronics_peripheral_interface(mconfig, *this), m_maincpu(*this, "maincpu"), @@ -207,7 +207,7 @@ epson_lx800_t::epson_lx800_t(const machine_config &mconfig, const char *tag, dev { } -epson_lx800_t::epson_lx800_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) : +epson_lx800_t::epson_lx800_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, __FILE__), device_centronics_peripheral_interface(mconfig, *this), m_maincpu(*this, "maincpu"), @@ -250,7 +250,7 @@ void epson_lx800_t::device_reset() */ READ8_MEMBER( epson_lx800_t::porta_r ) { - UINT8 result = 0; + uint8_t result = 0; logerror("%s: lx800_porta_r(%02x)\n", machine().describe_context(), offset); @@ -280,7 +280,7 @@ WRITE8_MEMBER( epson_lx800_t::porta_w ) */ READ8_MEMBER( epson_lx800_t::portc_r ) { - UINT8 result = 0; + uint8_t result = 0; logerror("%s: lx800_portc_r(%02x)\n", machine().describe_context(), offset); diff --git a/src/devices/bus/centronics/epson_lx800.h b/src/devices/bus/centronics/epson_lx800.h index a8cd3113749..f960d3f168f 100644 --- a/src/devices/bus/centronics/epson_lx800.h +++ b/src/devices/bus/centronics/epson_lx800.h @@ -30,8 +30,8 @@ class epson_lx800_t : public device_t, { public: // construction/destruction - epson_lx800_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - epson_lx800_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); + epson_lx800_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + epson_lx800_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); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/centronics/epson_lx810l.cpp b/src/devices/bus/centronics/epson_lx810l.cpp index a4578a312d8..d5cebfe8e2e 100644 --- a/src/devices/bus/centronics/epson_lx810l.cpp +++ b/src/devices/bus/centronics/epson_lx810l.cpp @@ -288,7 +288,7 @@ INPUT_CHANGED_MEMBER(epson_lx810l_t::online_sw) // epson_lx810l_t - constructor //------------------------------------------------- -epson_lx810l_t::epson_lx810l_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +epson_lx810l_t::epson_lx810l_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EPSON_LX810L, "Epson LX-810L", tag, owner, clock, "lx810l", __FILE__), device_centronics_peripheral_interface(mconfig, *this), m_maincpu(*this, "maincpu"), @@ -308,7 +308,7 @@ epson_lx810l_t::epson_lx810l_t(const machine_config &mconfig, const char *tag, d { } -epson_lx810l_t::epson_lx810l_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) : +epson_lx810l_t::epson_lx810l_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, __FILE__), device_centronics_peripheral_interface(mconfig, *this), m_maincpu(*this, "maincpu"), @@ -328,7 +328,7 @@ epson_lx810l_t::epson_lx810l_t(const machine_config &mconfig, device_type type, { } -epson_ap2000_t::epson_ap2000_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +epson_ap2000_t::epson_ap2000_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : epson_lx810l_t(mconfig, EPSON_AP2000, "Epson ActionPrinter 2000", tag, owner, clock, "ap2000", __FILE__) { } @@ -410,9 +410,9 @@ WRITE8_MEMBER(epson_lx810l_t::fakemem_w) */ READ8_MEMBER( epson_lx810l_t::porta_r ) { - UINT8 result = 0; - UINT8 hp_sensor = m_cr_pos_abs <= 0 ? 0 : 1; - UINT8 pe_sensor = m_pf_pos_abs <= 0 ? 1 : 0; + uint8_t result = 0; + uint8_t hp_sensor = m_cr_pos_abs <= 0 ? 0 : 1; + uint8_t pe_sensor = m_pf_pos_abs <= 0 ? 1 : 0; result |= hp_sensor; /* home position */ result |= pe_sensor << 1; /* paper end */ @@ -441,11 +441,11 @@ WRITE8_MEMBER( epson_lx810l_t::porta_w ) */ READ8_MEMBER( epson_lx810l_t::portb_r ) { - UINT8 result = ~ioport("DIPSW1")->read(); + uint8_t result = ~ioport("DIPSW1")->read(); /* if 93C06 is selected */ if (m_93c06_cs) { - UINT8 do_r = m_eeprom->do_read(); + uint8_t do_r = m_eeprom->do_read(); result &= 0xfe; result |= do_r; } @@ -457,7 +457,7 @@ READ8_MEMBER( epson_lx810l_t::portb_r ) WRITE8_MEMBER( epson_lx810l_t::portb_w ) { - UINT8 data_in = BIT(data, 1); + uint8_t data_in = BIT(data, 1); /* if 93C06 is selected */ if (m_93c06_cs) @@ -478,7 +478,7 @@ WRITE8_MEMBER( epson_lx810l_t::portb_w ) */ READ8_MEMBER( epson_lx810l_t::portc_r ) { - UINT8 result = 0; + uint8_t result = 0; /* result |= ioport("serial")->read() << 1; */ result |= !ioport("ONLINE")->read() << 3; @@ -561,7 +561,7 @@ WRITE_LINE_MEMBER( epson_lx810l_t::e05a30_ready ) Video hardware (simulates paper) ***************************************************************************/ -UINT32 epson_lx810l_t::screen_update_lx810l(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t epson_lx810l_t::screen_update_lx810l(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int scrolly = -bitmap_line(9); copyscrollbitmap(bitmap, m_bitmap, 0, nullptr, 1, &scrolly, cliprect); @@ -609,25 +609,25 @@ WRITE_LINE_MEMBER( epson_lx810l_t::co0_w ) READ8_MEMBER(epson_lx810l_t::an0_r) { - UINT8 res = !!(ioport("DIPSW2")->read() & 0x01); + uint8_t res = !!(ioport("DIPSW2")->read() & 0x01); return res - 1; /* DIPSW2.1 */ } READ8_MEMBER(epson_lx810l_t::an1_r) { - UINT8 res = !!(ioport("DIPSW2")->read() & 0x02); + uint8_t res = !!(ioport("DIPSW2")->read() & 0x02); return res - 1; /* DIPSW2.2 */ } READ8_MEMBER(epson_lx810l_t::an2_r) { - UINT8 res = !!(ioport("DIPSW2")->read() & 0x04); + uint8_t res = !!(ioport("DIPSW2")->read() & 0x04); return res - 1; /* DIPSW2.3 */ } READ8_MEMBER(epson_lx810l_t::an3_r) { - UINT8 res = !!(ioport("DIPSW2")->read() & 0x08); + uint8_t res = !!(ioport("DIPSW2")->read() & 0x08); return res - 1; /* DIPSW2.4 */ } @@ -643,7 +643,7 @@ READ8_MEMBER(epson_lx810l_t::an5_r) READ8_MEMBER(epson_lx810l_t::an6_r) { - UINT8 res = !ioport("LOADEJECT")->read(); + uint8_t res = !ioport("LOADEJECT")->read(); return res - 1; } diff --git a/src/devices/bus/centronics/epson_lx810l.h b/src/devices/bus/centronics/epson_lx810l.h index aa3fb556d2a..11da3cf8305 100644 --- a/src/devices/bus/centronics/epson_lx810l.h +++ b/src/devices/bus/centronics/epson_lx810l.h @@ -41,10 +41,10 @@ class epson_lx810l_t : public device_t, public: // construction/destruction epson_lx810l_t(const machine_config &mconfig, const char *tag, - device_t *owner, UINT32 clock); + device_t *owner, uint32_t clock); epson_lx810l_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); + uint32_t clock, const char *shortname, const char *source); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; @@ -101,7 +101,7 @@ public: DECLARE_INPUT_CHANGED_MEMBER(online_sw); /* Video hardware (simulates paper) */ - UINT32 screen_update_lx810l(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lx810l(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); #define uabs(x) ((x) > 0 ? (x) : -(x)) unsigned int bitmap_line(int i) { return ((uabs(m_pf_pos_abs) / 6) + i) % m_bitmap.height(); } @@ -121,13 +121,13 @@ private: int m_93c06_clk; int m_93c06_cs; - UINT16 m_printhead; + uint16_t m_printhead; int m_pf_pos_abs; int m_cr_pos_abs; int m_real_cr_pos; int m_real_cr_steps; int m_real_cr_dir; /* 1 is going right, -1 is going left */ - UINT8 m_fakemem; + uint8_t m_fakemem; bitmap_rgb32 m_bitmap; enum { @@ -142,7 +142,7 @@ class epson_ap2000_t : public epson_lx810l_t public: // construction/destruction epson_ap2000_t(const machine_config &mconfig, const char *tag, - device_t *owner, UINT32 clock); + device_t *owner, uint32_t clock); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/centronics/nec_p72.cpp b/src/devices/bus/centronics/nec_p72.cpp index 0baceec3313..2e2533ccc06 100644 --- a/src/devices/bus/centronics/nec_p72.cpp +++ b/src/devices/bus/centronics/nec_p72.cpp @@ -81,14 +81,14 @@ void nec_p72_t::device_start() // nec_p72_t - constructor //------------------------------------------------- -nec_p72_t::nec_p72_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nec_p72_t::nec_p72_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEC_P72, "NEC PinWrite P72", tag, owner, clock, "p72", __FILE__), device_centronics_peripheral_interface(mconfig, *this), m_maincpu(*this, "maincpu") { } -nec_p72_t::nec_p72_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) : +nec_p72_t::nec_p72_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, __FILE__), device_centronics_peripheral_interface(mconfig, *this), m_maincpu(*this, "maincpu") diff --git a/src/devices/bus/centronics/nec_p72.h b/src/devices/bus/centronics/nec_p72.h index 3638170d4b5..58c8f0a61f4 100644 --- a/src/devices/bus/centronics/nec_p72.h +++ b/src/devices/bus/centronics/nec_p72.h @@ -22,10 +22,10 @@ class nec_p72_t : public device_t, public: // construction/destruction nec_p72_t(const machine_config &mconfig, const char *tag, - device_t *owner, UINT32 clock); + device_t *owner, uint32_t clock); nec_p72_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); + uint32_t clock, const char *shortname, const char *source); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/centronics/printer.cpp b/src/devices/bus/centronics/printer.cpp index 50ca485c094..3a09169ddee 100644 --- a/src/devices/bus/centronics/printer.cpp +++ b/src/devices/bus/centronics/printer.cpp @@ -24,7 +24,7 @@ MACHINE_CONFIG_END // centronics_printer_device - constructor //------------------------------------------------- -centronics_printer_device::centronics_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +centronics_printer_device::centronics_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CENTRONICS_PRINTER, "Centronics Printer", tag, owner, clock, "centronics_printer", __FILE__), device_centronics_peripheral_interface( mconfig, *this ), m_strobe(0), diff --git a/src/devices/bus/centronics/printer.h b/src/devices/bus/centronics/printer.h index 7e0ce223e7f..4c3cfa30393 100644 --- a/src/devices/bus/centronics/printer.h +++ b/src/devices/bus/centronics/printer.h @@ -15,7 +15,7 @@ class centronics_printer_device : public device_t, { public: // construction/destruction - centronics_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + centronics_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_WRITE_LINE_MEMBER( input_strobe ) override; virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) override { if (state) m_data |= 0x01; else m_data &= ~0x01; } @@ -46,7 +46,7 @@ private: }; int m_strobe; - UINT8 m_data; + uint8_t m_data; int m_busy; required_device m_printer; diff --git a/src/devices/bus/cgenie/expansion/expansion.cpp b/src/devices/bus/cgenie/expansion/expansion.cpp index 632d921ef9c..085c8f73ca2 100644 --- a/src/devices/bus/cgenie/expansion/expansion.cpp +++ b/src/devices/bus/cgenie/expansion/expansion.cpp @@ -26,7 +26,7 @@ const device_type EXPANSION_SLOT = &device_creator; // expansion_slot_device - constructor //------------------------------------------------- -expansion_slot_device::expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +expansion_slot_device::expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EXPANSION_SLOT, "Expansion Slot", tag, owner, clock, "expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_program(nullptr), diff --git a/src/devices/bus/cgenie/expansion/expansion.h b/src/devices/bus/cgenie/expansion/expansion.h index a78829ad37b..e73abe6cb5e 100644 --- a/src/devices/bus/cgenie/expansion/expansion.h +++ b/src/devices/bus/cgenie/expansion/expansion.h @@ -70,7 +70,7 @@ class expansion_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~expansion_slot_device(); void set_program_space(address_space *program); diff --git a/src/devices/bus/cgenie/expansion/floppy.cpp b/src/devices/bus/cgenie/expansion/floppy.cpp index 676d73a0659..f82d38d3485 100644 --- a/src/devices/bus/cgenie/expansion/floppy.cpp +++ b/src/devices/bus/cgenie/expansion/floppy.cpp @@ -103,7 +103,7 @@ machine_config_constructor cgenie_fdc_device::device_mconfig_additions() const // cgenie_fdc_device - constructor //------------------------------------------------- -cgenie_fdc_device::cgenie_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cgenie_fdc_device::cgenie_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CGENIE_FDC, "Floppy Disc Controller", tag, owner, clock, "cgenie_fdc", __FILE__), device_expansion_interface(mconfig, *this), m_fdc(*this, "fd1793"), @@ -151,7 +151,7 @@ void cgenie_fdc_device::device_reset() READ8_MEMBER( cgenie_fdc_device::irq_r ) { - UINT8 data = m_irq_status; + uint8_t data = m_irq_status; m_irq_status &= ~IRQ_TIMER; m_slot->int_w(m_irq_status ? ASSERT_LINE : CLEAR_LINE); @@ -167,7 +167,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( cgenie_fdc_device::timer_callback ) DEVICE_IMAGE_LOAD_MEMBER( cgenie_fdc_device, socket_load ) { - UINT32 size = m_socket->common_get_size("rom"); + uint32_t size = m_socket->common_get_size("rom"); if (size > 0x1000) { diff --git a/src/devices/bus/cgenie/expansion/floppy.h b/src/devices/bus/cgenie/expansion/floppy.h index 8717371fc89..218b8a94bd1 100644 --- a/src/devices/bus/cgenie/expansion/floppy.h +++ b/src/devices/bus/cgenie/expansion/floppy.h @@ -27,7 +27,7 @@ class cgenie_fdc_device : public device_t, public device_expansion_interface { public: // construction/destruction - cgenie_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cgenie_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_ADDRESS_MAP(mmio, 8); @@ -65,7 +65,7 @@ private: floppy_image_device *m_floppy; - UINT8 m_irq_status; + uint8_t m_irq_status; }; // device type definition diff --git a/src/devices/bus/cgenie/parallel/joystick.cpp b/src/devices/bus/cgenie/parallel/joystick.cpp index 0971226d8e0..caeeee8cfe0 100644 --- a/src/devices/bus/cgenie/parallel/joystick.cpp +++ b/src/devices/bus/cgenie/parallel/joystick.cpp @@ -92,7 +92,7 @@ ioport_constructor cgenie_joystick_device::device_input_ports() const // cgenie_joystick_device - constructor //------------------------------------------------- -cgenie_joystick_device::cgenie_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cgenie_joystick_device::cgenie_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CGENIE_JOYSTICK, "Joystick Interface EG2013", tag, owner, clock, "cgenie_joystick", __FILE__), device_parallel_interface(mconfig, *this), m_joy(*this, "JOY.%u", 0), @@ -122,7 +122,7 @@ void cgenie_joystick_device::device_reset() // IMPLEMENTATION //************************************************************************** -void cgenie_joystick_device::pa_w(UINT8 data) +void cgenie_joystick_device::pa_w(uint8_t data) { if (VERBOSE) logerror("%s: pa_w %02x\n", tag(), data); @@ -131,9 +131,9 @@ void cgenie_joystick_device::pa_w(UINT8 data) m_select = data & 0x3f; } -UINT8 cgenie_joystick_device::pb_r() +uint8_t cgenie_joystick_device::pb_r() { - UINT8 data = 0x0f; + uint8_t data = 0x0f; // read button state for (int i = 0; i < 4; i++) diff --git a/src/devices/bus/cgenie/parallel/joystick.h b/src/devices/bus/cgenie/parallel/joystick.h index bbdb32e5444..61ce928d673 100644 --- a/src/devices/bus/cgenie/parallel/joystick.h +++ b/src/devices/bus/cgenie/parallel/joystick.h @@ -25,21 +25,21 @@ class cgenie_joystick_device : public device_t, public device_parallel_interface { public: // construction/destruction - cgenie_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cgenie_joystick_device(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 ioport_constructor device_input_ports() const override; - virtual void pa_w(UINT8 data) override; - virtual UINT8 pb_r() override; + virtual void pa_w(uint8_t data) override; + virtual uint8_t pb_r() override; private: required_ioport_array<4> m_joy; required_ioport_array<6> m_keypad; - UINT8 m_select; + uint8_t m_select; }; // device type definition diff --git a/src/devices/bus/cgenie/parallel/parallel.cpp b/src/devices/bus/cgenie/parallel/parallel.cpp index d147a550135..ca3681ec715 100644 --- a/src/devices/bus/cgenie/parallel/parallel.cpp +++ b/src/devices/bus/cgenie/parallel/parallel.cpp @@ -26,7 +26,7 @@ const device_type PARALLEL_SLOT = &device_creator; // parallel_slot_device - constructor //------------------------------------------------- -parallel_slot_device::parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +parallel_slot_device::parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PARALLEL_SLOT, "Parallel Slot", tag, owner, clock, "parallel_slot", __FILE__), device_slot_interface(mconfig, *this), m_cart(nullptr) diff --git a/src/devices/bus/cgenie/parallel/parallel.h b/src/devices/bus/cgenie/parallel/parallel.h index 2c52f54bd2c..b12a0c3709b 100644 --- a/src/devices/bus/cgenie/parallel/parallel.h +++ b/src/devices/bus/cgenie/parallel/parallel.h @@ -46,7 +46,7 @@ class parallel_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~parallel_slot_device(); // IOA @@ -73,11 +73,11 @@ public: device_parallel_interface(const machine_config &mconfig, device_t &device); virtual ~device_parallel_interface(); - virtual UINT8 pa_r() { return 0xff; }; - virtual void pa_w(UINT8 data) {}; + virtual uint8_t pa_r() { return 0xff; }; + virtual void pa_w(uint8_t data) {}; - virtual UINT8 pb_r() { return 0xff; }; - virtual void pb_w(UINT8 data) {}; + virtual uint8_t pb_r() { return 0xff; }; + virtual void pb_w(uint8_t data) {}; protected: parallel_slot_device *m_slot; diff --git a/src/devices/bus/cgenie/parallel/printer.cpp b/src/devices/bus/cgenie/parallel/printer.cpp index f9963844dd5..7d2a0ac8978 100644 --- a/src/devices/bus/cgenie/parallel/printer.cpp +++ b/src/devices/bus/cgenie/parallel/printer.cpp @@ -50,7 +50,7 @@ machine_config_constructor cgenie_printer_device::device_mconfig_additions() con // cgenie_printer_device - constructor //------------------------------------------------- -cgenie_printer_device::cgenie_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cgenie_printer_device::cgenie_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CGENIE_PRINTER, "Printer Interface EG2012", tag, owner, clock, "cgenie_printer", __FILE__), device_parallel_interface(mconfig, *this), m_centronics(*this, "centronics"), @@ -103,7 +103,7 @@ WRITE_LINE_MEMBER( cgenie_printer_device::fault_w ) m_centronics_ready = state; } -void cgenie_printer_device::pa_w(UINT8 data) +void cgenie_printer_device::pa_w(uint8_t data) { if (VERBOSE) logerror("%s: pa_w %02x\n", tag(), data); @@ -111,9 +111,9 @@ void cgenie_printer_device::pa_w(UINT8 data) m_latch->write(data); } -UINT8 cgenie_printer_device::pb_r() +uint8_t cgenie_printer_device::pb_r() { - UINT8 data = 0x0f; + uint8_t data = 0x0f; data |= m_centronics_ready << 4; data |= m_centronics_unit_sel << 5; @@ -123,7 +123,7 @@ UINT8 cgenie_printer_device::pb_r() return data; } -void cgenie_printer_device::pb_w(UINT8 data) +void cgenie_printer_device::pb_w(uint8_t data) { if (VERBOSE) logerror("%s: pa_w %02x\n", tag(), data); diff --git a/src/devices/bus/cgenie/parallel/printer.h b/src/devices/bus/cgenie/parallel/printer.h index 6faec62f308..e4addaef23a 100644 --- a/src/devices/bus/cgenie/parallel/printer.h +++ b/src/devices/bus/cgenie/parallel/printer.h @@ -26,7 +26,7 @@ class cgenie_printer_device : public device_t, public device_parallel_interface { public: // construction/destruction - cgenie_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cgenie_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER(busy_w); DECLARE_WRITE_LINE_MEMBER(perror_w); @@ -38,9 +38,9 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void pa_w(UINT8 data) override; - virtual UINT8 pb_r() override; - virtual void pb_w(UINT8 data) override; + virtual void pa_w(uint8_t data) override; + virtual uint8_t pb_r() override; + virtual void pb_w(uint8_t data) override; private: required_device m_centronics; diff --git a/src/devices/bus/chanf/rom.cpp b/src/devices/bus/chanf/rom.cpp index 858e52ad2e3..9e2e0479e89 100644 --- a/src/devices/bus/chanf/rom.cpp +++ b/src/devices/bus/chanf/rom.cpp @@ -31,39 +31,39 @@ const device_type CHANF_ROM_MULTI_OLD = &device_creator; const device_type CHANF_ROM_MULTI_FINAL = &device_creator; -chanf_rom_device::chanf_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +chanf_rom_device::chanf_rom_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_channelf_cart_interface( mconfig, *this ), m_addr_latch(0), m_addr(0), m_read_write(0), m_data0(0) { } -chanf_rom_device::chanf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +chanf_rom_device::chanf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CHANF_ROM_STD, "Channel F Standard Carts", tag, owner, clock, "chanf_rom", __FILE__), device_channelf_cart_interface( mconfig, *this ), m_addr_latch(0), m_addr(0), m_read_write(0), m_data0(0) { } -chanf_maze_device::chanf_maze_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +chanf_maze_device::chanf_maze_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : chanf_rom_device(mconfig, CHANF_ROM_MAZE, "Channel F Maze Cart", tag, owner, clock, "chanf_maze", __FILE__) { } -chanf_hangman_device::chanf_hangman_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +chanf_hangman_device::chanf_hangman_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : chanf_rom_device(mconfig, CHANF_ROM_HANGMAN, "Channel F Hangman Cart", tag, owner, clock, "chanf_hang", __FILE__) { } -chanf_chess_device::chanf_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +chanf_chess_device::chanf_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : chanf_rom_device(mconfig, CHANF_ROM_CHESS, "Channel F Chess Cart", tag, owner, clock, "chanf_chess", __FILE__) { } -chanf_multi_old_device::chanf_multi_old_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +chanf_multi_old_device::chanf_multi_old_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : chanf_rom_device(mconfig, CHANF_ROM_MULTI_OLD, "Channel F Multigame (Earlier Version) Cart", tag, owner, clock, "chanf_multi_old", __FILE__), m_base_bank(0) { } -chanf_multi_final_device::chanf_multi_final_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +chanf_multi_final_device::chanf_multi_final_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : chanf_rom_device(mconfig, CHANF_ROM_MULTI_FINAL, "Channel F Multigame (Final Version) Cart", tag, owner, clock, "chanf_multi_fin", __FILE__), m_base_bank(0), m_half_bank(0) { } @@ -154,7 +154,7 @@ READ8_MEMBER(chanf_rom_device::read_rom) } // These are shared among Maze & Hangman cart types (not directly used by base chanf_rom_device) -UINT8 chanf_rom_device::common_read_2102(UINT32 offset) +uint8_t chanf_rom_device::common_read_2102(uint32_t offset) { if (offset == 0) { @@ -171,7 +171,7 @@ UINT8 chanf_rom_device::common_read_2102(UINT32 offset) return m_latch[1]; } -void chanf_rom_device::common_write_2102(UINT32 offset, UINT8 data) +void chanf_rom_device::common_write_2102(uint32_t offset, uint8_t data) { if (offset == 0) { @@ -192,13 +192,13 @@ void chanf_rom_device::common_write_2102(UINT32 offset, UINT8 data) m_latch[1] = data; // all bits but 2,3 come from this write, but they are shuffled // notice that data is 8bits, so when swapping bit8 & bit9 are always 0! - m_addr_latch = (m_addr_latch & 0x0c) | (BITSWAP16((UINT16) data, 15, 14, 13, 12, 11, 10, 7, 6, 5, 3, 2, 1, 9, 8, 4, 0)); + m_addr_latch = (m_addr_latch & 0x0c) | (BITSWAP16((uint16_t) data, 15, 14, 13, 12, 11, 10, 7, 6, 5, 3, 2, 1, 9, 8, 4, 0)); } } // These are shared among Schach & Multigame cart types (not directly used by base chanf_rom_device) -UINT8 chanf_rom_device::common_read_3853(UINT32 offset) +uint8_t chanf_rom_device::common_read_3853(uint32_t offset) { if (offset < m_ram.size()) return m_ram[offset]; @@ -206,7 +206,7 @@ UINT8 chanf_rom_device::common_read_3853(UINT32 offset) return 0xff; } -void chanf_rom_device::common_write_3853(UINT32 offset, UINT8 data) +void chanf_rom_device::common_write_3853(uint32_t offset, uint8_t data) { if (offset < m_ram.size()) m_ram[offset] = data; diff --git a/src/devices/bus/chanf/rom.h b/src/devices/bus/chanf/rom.h index 4591865ec05..7fd8944ba99 100644 --- a/src/devices/bus/chanf/rom.h +++ b/src/devices/bus/chanf/rom.h @@ -13,17 +13,17 @@ class chanf_rom_device : public device_t, { public: // construction/destruction - chanf_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - chanf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + chanf_rom_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); + chanf_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} virtual void device_reset() override {} - UINT8 common_read_2102(UINT32 offset); - UINT8 common_read_3853(UINT32 offset); - void common_write_2102(UINT32 offset, UINT8 data); - void common_write_3853(UINT32 offset, UINT8 data); + uint8_t common_read_2102(uint32_t offset); + uint8_t common_read_3853(uint32_t offset); + void common_write_2102(uint32_t offset, uint8_t data); + void common_write_3853(uint32_t offset, uint8_t data); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; @@ -31,8 +31,8 @@ public: protected: // used for RAM chip in Hangman & Maze - UINT8 m_latch[2]; // PORT A & PORT B - UINT16 m_addr_latch, m_addr; + uint8_t m_latch[2]; // PORT A & PORT B + uint16_t m_addr_latch, m_addr; int m_read_write, m_data0; }; @@ -42,7 +42,7 @@ class chanf_maze_device : public chanf_rom_device { public: // construction/destruction - chanf_maze_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + chanf_maze_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -60,7 +60,7 @@ class chanf_hangman_device : public chanf_rom_device { public: // construction/destruction - chanf_hangman_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + chanf_hangman_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -78,7 +78,7 @@ class chanf_chess_device : public chanf_rom_device { public: // construction/destruction - chanf_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + chanf_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_ram) override { return common_read_3853(offset); } @@ -92,7 +92,7 @@ class chanf_multi_old_device : public chanf_rom_device { public: // construction/destruction - chanf_multi_old_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + chanf_multi_old_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -115,7 +115,7 @@ class chanf_multi_final_device : public chanf_rom_device { public: // construction/destruction - chanf_multi_final_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + chanf_multi_final_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/devices/bus/chanf/slot.cpp b/src/devices/bus/chanf/slot.cpp index 3aa7e43146d..ba0fbb622a8 100644 --- a/src/devices/bus/chanf/slot.cpp +++ b/src/devices/bus/chanf/slot.cpp @@ -45,7 +45,7 @@ device_channelf_cart_interface::~device_channelf_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_channelf_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_channelf_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -59,7 +59,7 @@ void device_channelf_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_channelf_cart_interface::ram_alloc(UINT32 size) +void device_channelf_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -72,7 +72,7 @@ void device_channelf_cart_interface::ram_alloc(UINT32 size) //------------------------------------------------- // channelf_cart_slot_device - constructor //------------------------------------------------- -channelf_cart_slot_device::channelf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +channelf_cart_slot_device::channelf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CHANF_CART_SLOT, "Fairchild Channel F Cartridge Slot", tag, owner, clock, "cf_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -163,7 +163,7 @@ image_init_result channelf_cart_slot_device::call_load() { if (m_cart) { - UINT32 len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); m_cart->rom_alloc(len, tag()); if (software_entry() == nullptr) @@ -210,7 +210,7 @@ std::string channelf_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 len = m_file->size(); + uint32_t len = m_file->size(); int type; if (len == 0x40000) diff --git a/src/devices/bus/chanf/slot.h b/src/devices/bus/chanf/slot.h index d34b57fdb04..2c802b8e7c0 100644 --- a/src/devices/bus/chanf/slot.h +++ b/src/devices/bus/chanf/slot.h @@ -38,20 +38,20 @@ public: virtual DECLARE_WRITE8_MEMBER(write_ram) {} virtual DECLARE_WRITE8_MEMBER(write_bank) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } void save_ram() { device().save_item(NAME(m_ram)); } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; }; @@ -63,7 +63,7 @@ class channelf_cart_slot_device : public device_t, { public: // construction/destruction - channelf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + channelf_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~channelf_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/coco/coco_232.cpp b/src/devices/bus/coco/coco_232.cpp index a1b9c673c4b..e6b005756bf 100644 --- a/src/devices/bus/coco/coco_232.cpp +++ b/src/devices/bus/coco/coco_232.cpp @@ -41,7 +41,7 @@ const device_type COCO_232 = &device_creator; // coco_232_device - constructor //------------------------------------------------- -coco_232_device::coco_232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +coco_232_device::coco_232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COCO_232, "CoCo RS-232 PAK", tag, owner, clock, "coco_232", __FILE__), device_cococart_interface( mconfig, *this ), m_uart(*this, UART_TAG) @@ -72,7 +72,7 @@ machine_config_constructor coco_232_device::device_mconfig_additions() const READ8_MEMBER(coco_232_device::read) { - UINT8 result = 0x00; + uint8_t result = 0x00; if ((offset >= 0x28) && (offset <= 0x2F)) result = m_uart->read(space, offset - 0x28); diff --git a/src/devices/bus/coco/coco_232.h b/src/devices/bus/coco/coco_232.h index 708d89cccf4..65bf44f6e61 100644 --- a/src/devices/bus/coco/coco_232.h +++ b/src/devices/bus/coco/coco_232.h @@ -21,7 +21,7 @@ class coco_232_device : { public: // construction/destruction - coco_232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + coco_232_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; diff --git a/src/devices/bus/coco/coco_dwsock.cpp b/src/devices/bus/coco/coco_dwsock.cpp index 6525cbaa97b..afd8e4dad5f 100644 --- a/src/devices/bus/coco/coco_dwsock.cpp +++ b/src/devices/bus/coco/coco_dwsock.cpp @@ -64,7 +64,7 @@ INPUT_CHANGED_MEMBER(beckerport_device::drivewire_port_changed) // beckerport_device - constructor / destructor //------------------------------------------------- -beckerport_device::beckerport_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +beckerport_device::beckerport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COCO_DWSOCK, "Virtual Becker Port", tag, owner, clock, "coco_dwsock", __FILE__), m_hostname(nullptr), m_dwconfigport(*this, DRIVEWIRE_PORT_TAG), m_dwtcpport(0) { @@ -91,7 +91,7 @@ void beckerport_device::device_start(void) osd_printf_verbose("Connecting to Drivewire server on %s:%d... ", m_hostname, m_dwtcpport); - UINT64 filesize; // unused + uint64_t filesize; // unused osd_file::error filerr = osd_file::open(chAddress, 0, m_pSocket, filesize); if (filerr != osd_file::error::NONE) { diff --git a/src/devices/bus/coco/coco_dwsock.h b/src/devices/bus/coco/coco_dwsock.h index d3af3fbb525..b8b2e1d3cc4 100644 --- a/src/devices/bus/coco/coco_dwsock.h +++ b/src/devices/bus/coco/coco_dwsock.h @@ -25,7 +25,7 @@ class beckerport_device : public device_t { public: - beckerport_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + beckerport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~beckerport_device(); // optional information overrides diff --git a/src/devices/bus/coco/coco_fdc.cpp b/src/devices/bus/coco/coco_fdc.cpp index 8e19f273ee0..c80ebc61391 100644 --- a/src/devices/bus/coco/coco_fdc.cpp +++ b/src/devices/bus/coco/coco_fdc.cpp @@ -74,7 +74,7 @@ class coco_fdc_device_base : public coco_family_fdc_device_base { public: // construction/destruction - coco_fdc_device_base(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + coco_fdc_device_base(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: enum class rtc_type @@ -91,7 +91,7 @@ protected: // methods virtual void update_lines() override; - void dskreg_w(UINT8 data); + void dskreg_w(uint8_t data); rtc_type real_time_clock(); // devices @@ -168,7 +168,7 @@ void coco_family_fdc_device_base::device_reset() // coco_family_fdc_device_base::get_cart_base //------------------------------------------------- -UINT8* coco_family_fdc_device_base::get_cart_base() +uint8_t* coco_family_fdc_device_base::get_cart_base() { return memregion("eprom")->base(); } @@ -182,7 +182,7 @@ UINT8* coco_family_fdc_device_base::get_cart_base() // coco_fdc_device_base - constructor //------------------------------------------------- -coco_fdc_device_base::coco_fdc_device_base(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +coco_fdc_device_base::coco_fdc_device_base(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) : coco_family_fdc_device_base(mconfig, type, name, tag, owner, clock, shortname, source) , m_wd17xx(*this, WD_TAG) , m_ds1315(*this, CLOUD9_TAG) @@ -246,10 +246,10 @@ void coco_fdc_device_base::update_lines() // dskreg_w - function to write to CoCo dskreg //------------------------------------------------- -void coco_fdc_device_base::dskreg_w(UINT8 data) +void coco_fdc_device_base::dskreg_w(uint8_t data) { - UINT8 drive = 0; - UINT8 head; + uint8_t drive = 0; + uint8_t head; if (LOG_FDC) { @@ -310,7 +310,7 @@ void coco_fdc_device_base::dskreg_w(UINT8 data) READ8_MEMBER(coco_fdc_device_base::read) { - UINT8 result = 0; + uint8_t result = 0; switch(offset & 0xEF) { @@ -414,7 +414,7 @@ namespace { public: // construction/destruction - coco_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + coco_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : coco_fdc_device_base(mconfig, COCO_FDC, "CoCo FDC", tag, owner, clock, "coco_fdc", __FILE__) { } @@ -450,7 +450,7 @@ namespace { public: // construction/destruction - coco_fdc_v11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + coco_fdc_v11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : coco_fdc_device_base(mconfig, COCO_FDC_V11, "CoCo FDC v1.1", tag, owner, clock, "coco_fdc_v11", __FILE__) { } @@ -485,7 +485,7 @@ namespace { public: // construction/destruction - coco3_hdb1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + coco3_hdb1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : coco_fdc_device_base(mconfig, COCO3_HDB1, "CoCo3 HDB-DOS", tag, owner, clock, "coco3_hdb1", __FILE__) { } @@ -516,7 +516,7 @@ namespace { public: // construction/destruction - cp400_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + cp400_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : coco_fdc_device_base(mconfig, CP400_FDC, "CP400 FDC", tag, owner, clock, "cp400_fdc", __FILE__) { } diff --git a/src/devices/bus/coco/coco_fdc.h b/src/devices/bus/coco/coco_fdc.h index 90366b7e3ef..b6a3d7e0834 100644 --- a/src/devices/bus/coco/coco_fdc.h +++ b/src/devices/bus/coco/coco_fdc.h @@ -28,7 +28,7 @@ class coco_family_fdc_device_base : { public: // construction/destruction - coco_family_fdc_device_base(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) + coco_family_fdc_device_base(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_cococart_interface(mconfig, *this) { @@ -47,7 +47,7 @@ protected: // FDC overrides virtual void update_lines() = 0; - virtual UINT8* get_cart_base() override; + virtual uint8_t* get_cart_base() override; // wrapper for setting the cart line void cart_set_line(cococart_slot_device::line which, cococart_slot_device::line_value value) @@ -60,17 +60,17 @@ protected: } // accessors - UINT8 dskreg() const { return m_dskreg; } + uint8_t dskreg() const { return m_dskreg; } bool intrq() const { return m_intrq; } bool drq() const { return m_drq; } - void set_dskreg(UINT8 data) { m_dskreg = data; } + void set_dskreg(uint8_t data) { m_dskreg = data; } private: // internal state cococart_slot_device *m_owner; // registers - UINT8 m_dskreg; + uint8_t m_dskreg; bool m_intrq; bool m_drq; }; diff --git a/src/devices/bus/coco/coco_multi.cpp b/src/devices/bus/coco/coco_multi.cpp index 18033158c45..fcfd764a169 100644 --- a/src/devices/bus/coco/coco_multi.cpp +++ b/src/devices/bus/coco/coco_multi.cpp @@ -138,7 +138,7 @@ const device_type COCO_MULTIPAK = &device_creator; // coco_multipak_device - constructor //------------------------------------------------- -coco_multipak_device::coco_multipak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +coco_multipak_device::coco_multipak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COCO_MULTIPAK, "CoCo Multi-Pak Interface", tag, owner, clock, "coco_multipak", __FILE__), device_cococart_interface( mconfig, *this ), m_owner(nullptr), m_select(0) { @@ -199,7 +199,7 @@ machine_config_constructor coco_multipak_device::device_mconfig_additions() cons // get_cart_base //------------------------------------------------- -UINT8* coco_multipak_device::get_cart_base() +uint8_t* coco_multipak_device::get_cart_base() { return active_cts_slot()->get_cart_base(); } @@ -243,9 +243,9 @@ WRITE8_MEMBER(coco_multipak_device::ff7f_write) // set_select //------------------------------------------------- -void coco_multipak_device::set_select(UINT8 new_select) +void coco_multipak_device::set_select(uint8_t new_select) { - UINT8 xorval = m_select ^ new_select; + uint8_t xorval = m_select ^ new_select; m_select = new_select; if (xorval & 0x30) cart_base_changed(); diff --git a/src/devices/bus/coco/coco_multi.h b/src/devices/bus/coco/coco_multi.h index 3ffb91413eb..d2bdb996f5a 100644 --- a/src/devices/bus/coco/coco_multi.h +++ b/src/devices/bus/coco/coco_multi.h @@ -30,12 +30,12 @@ class coco_multipak_device : { public: // construction/destruction - coco_multipak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + coco_multipak_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 UINT8* get_cart_base() override; + virtual uint8_t* get_cart_base() override; DECLARE_WRITE_LINE_MEMBER(multi_cart_w); DECLARE_WRITE_LINE_MEMBER(multi_nmi_w); @@ -53,13 +53,13 @@ private: cococart_slot_device *m_slots[4]; // internal state - UINT8 m_select; + uint8_t m_select; // methods DECLARE_WRITE8_MEMBER(ff7f_write); cococart_slot_device *active_scs_slot(void); cococart_slot_device *active_cts_slot(void); - void set_select(UINT8 new_select); + void set_select(uint8_t new_select); }; diff --git a/src/devices/bus/coco/coco_orch90.cpp b/src/devices/bus/coco/coco_orch90.cpp index e81b585dfc2..50503d592fa 100644 --- a/src/devices/bus/coco/coco_orch90.cpp +++ b/src/devices/bus/coco/coco_orch90.cpp @@ -39,7 +39,7 @@ const device_type COCO_ORCH90 = &device_creator; // coco_orch90_device - constructor //------------------------------------------------- -coco_orch90_device::coco_orch90_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +coco_orch90_device::coco_orch90_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COCO_ORCH90, "CoCo Orch-90 PAK", tag, owner, clock, "coco_orch90", __FILE__), device_cococart_interface(mconfig, *this ), m_ldac(*this, "ldac"), diff --git a/src/devices/bus/coco/coco_orch90.h b/src/devices/bus/coco/coco_orch90.h index a3554d63868..387395777d0 100644 --- a/src/devices/bus/coco/coco_orch90.h +++ b/src/devices/bus/coco/coco_orch90.h @@ -21,7 +21,7 @@ class coco_orch90_device : { public: // construction/destruction - coco_orch90_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + coco_orch90_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; diff --git a/src/devices/bus/coco/coco_pak.cpp b/src/devices/bus/coco/coco_pak.cpp index 40c250dd4ac..1cc9e4f5e05 100644 --- a/src/devices/bus/coco/coco_pak.cpp +++ b/src/devices/bus/coco/coco_pak.cpp @@ -39,14 +39,14 @@ const device_type COCO_PAK = &device_creator; //------------------------------------------------- // coco_pak_device - constructor //------------------------------------------------- -coco_pak_device::coco_pak_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) +coco_pak_device::coco_pak_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_cococart_interface( mconfig, *this ), m_cart(nullptr), m_owner(nullptr), m_autostart(*this, ":" CART_AUTOSTART_TAG) { } -coco_pak_device::coco_pak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +coco_pak_device::coco_pak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COCO_PAK, "CoCo Program PAK", tag, owner, clock, "cocopak", __FILE__), device_cococart_interface( mconfig, *this ), m_cart(nullptr), m_owner(nullptr), m_autostart(*this, ":" CART_AUTOSTART_TAG) @@ -103,7 +103,7 @@ void coco_pak_device::device_reset() get_cart_base -------------------------------------------------*/ -UINT8* coco_pak_device::get_cart_base() +uint8_t* coco_pak_device::get_cart_base() { return memregion(CARTSLOT_TAG)->base(); } @@ -126,7 +126,7 @@ const device_type COCO_PAK_BANKED = &device_creator; // coco_pak_device - constructor //------------------------------------------------- -coco_pak_banked_device::coco_pak_banked_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +coco_pak_banked_device::coco_pak_banked_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : coco_pak_device(mconfig, COCO_PAK_BANKED, "CoCo Program PAK (Banked)", tag, owner, clock, "cocopak_banked", __FILE__) { } @@ -146,12 +146,12 @@ void coco_pak_banked_device::device_reset() banked_pak_set_bank - function to set the bank -------------------------------------------------*/ -void coco_pak_banked_device::banked_pak_set_bank(UINT32 bank) +void coco_pak_banked_device::banked_pak_set_bank(uint32_t bank) { - UINT64 pos; - UINT32 i; - UINT8 *rom = memregion(CARTSLOT_TAG)->base(); - UINT32 rom_length = memregion(CARTSLOT_TAG)->bytes(); + uint64_t pos; + uint32_t i; + uint8_t *rom = memregion(CARTSLOT_TAG)->base(); + uint32_t rom_length = memregion(CARTSLOT_TAG)->bytes(); if (m_cart->exists()) { pos = (bank * 0x4000) % m_cart->length(); diff --git a/src/devices/bus/coco/coco_pak.h b/src/devices/bus/coco/coco_pak.h index f75b48721ec..f6a93ec459f 100644 --- a/src/devices/bus/coco/coco_pak.h +++ b/src/devices/bus/coco/coco_pak.h @@ -20,14 +20,14 @@ class coco_pak_device : { public: // construction/destruction - coco_pak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - coco_pak_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); + coco_pak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + coco_pak_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - virtual UINT8* get_cart_base() override; + virtual uint8_t* get_cart_base() override; protected: // device-level overrides virtual void device_start() override; @@ -51,14 +51,14 @@ class coco_pak_banked_device : { public: // construction/destruction - coco_pak_banked_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + coco_pak_banked_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_reset() override; virtual DECLARE_WRITE8_MEMBER(write) override; private: - void banked_pak_set_bank(UINT32 bank); + void banked_pak_set_bank(uint32_t bank); }; diff --git a/src/devices/bus/coco/cococart.cpp b/src/devices/bus/coco/cococart.cpp index 0024992c2de..646a9d9d623 100644 --- a/src/devices/bus/coco/cococart.cpp +++ b/src/devices/bus/coco/cococart.cpp @@ -34,7 +34,7 @@ const device_type COCOCART_SLOT = &device_creator; //------------------------------------------------- // cococart_slot_device - constructor //------------------------------------------------- -cococart_slot_device::cococart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cococart_slot_device::cococart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COCOCART_SLOT, "CoCo Cartridge Slot", tag, owner, clock, "cococart_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), @@ -134,7 +134,7 @@ void cococart_slot_device::device_timer(emu_timer &timer, device_timer_id id, in READ8_MEMBER(cococart_slot_device::read) { - UINT8 result = 0x00; + uint8_t result = 0x00; if (m_cart) result = m_cart->read(space, offset); return result; @@ -297,7 +297,7 @@ void cococart_slot_device::cart_set_line(cococart_slot_device::line which, cococ // get_cart_base //------------------------------------------------- -UINT8* cococart_slot_device::get_cart_base() +uint8_t* cococart_slot_device::get_cart_base() { if (m_cart != nullptr) return m_cart->get_cart_base(); @@ -410,7 +410,7 @@ WRITE8_MEMBER(device_cococart_interface::write) // get_cart_base //------------------------------------------------- -UINT8* device_cococart_interface::get_cart_base() +uint8_t* device_cococart_interface::get_cart_base() { return nullptr; } diff --git a/src/devices/bus/coco/cococart.h b/src/devices/bus/coco/cococart.h index 759bfdf9e85..a82c212132d 100644 --- a/src/devices/bus/coco/cococart.h +++ b/src/devices/bus/coco/cococart.h @@ -21,7 +21,7 @@ // ======================> cococart_base_update_delegate // direct region update handler -typedef delegate cococart_base_update_delegate; +typedef delegate cococart_base_update_delegate; #define MCFG_COCO_CARTRIDGE_CART_CB(_devcb) \ devcb = &cococart_slot_device::static_set_cart_callback(*device, DEVCB_##_devcb); @@ -59,7 +59,7 @@ public: }; // construction/destruction - cococart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cococart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &static_set_cart_callback(device_t &device, _Object object) { return downcast(device).m_cart_callback.set_callback(object); } template static devcb_base &static_set_nmi_callback(device_t &device, _Object object) { return downcast(device).m_nmi_callback.set_callback(object); } @@ -98,7 +98,7 @@ public: void twiddle_q_lines(); // cart base - UINT8* get_cart_base(); + uint8_t* get_cart_base(); void set_cart_base_update(cococart_base_update_delegate update); private: @@ -157,7 +157,7 @@ public: virtual DECLARE_READ8_MEMBER(read); virtual DECLARE_WRITE8_MEMBER(write); - virtual UINT8* get_cart_base(); + virtual uint8_t* get_cart_base(); void set_cart_base_update(cococart_base_update_delegate update); protected: diff --git a/src/devices/bus/coco/dragon_fdc.cpp b/src/devices/bus/coco/dragon_fdc.cpp index c5247ff59bd..e32bab843e9 100644 --- a/src/devices/bus/coco/dragon_fdc.cpp +++ b/src/devices/bus/coco/dragon_fdc.cpp @@ -94,7 +94,7 @@ namespace { public: // construction/destruction - dragon_fdc_device_base(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + dragon_fdc_device_base(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: // device-level overrides @@ -109,7 +109,7 @@ namespace required_device_array m_floppies; // methods - void dskreg_w(UINT8 data); + void dskreg_w(uint8_t data); }; }; @@ -141,7 +141,7 @@ MACHINE_CONFIG_END //------------------------------------------------- // dragon_fdc_device_base - constructor //------------------------------------------------- -dragon_fdc_device_base::dragon_fdc_device_base(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +dragon_fdc_device_base::dragon_fdc_device_base(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) : coco_family_fdc_device_base(mconfig, type, name, tag, owner, clock, shortname, source) , m_wd2797(*this, WD2797_TAG) , m_floppies(*this, WD2797_TAG ":%u", 0) @@ -180,7 +180,7 @@ void dragon_fdc_device_base::update_lines() // Dragon dskreg //------------------------------------------------- -void dragon_fdc_device_base::dskreg_w(UINT8 data) +void dragon_fdc_device_base::dskreg_w(uint8_t data) { if (LOG_FDC) { @@ -218,7 +218,7 @@ void dragon_fdc_device_base::dskreg_w(UINT8 data) READ8_MEMBER(dragon_fdc_device_base::read) { - UINT8 result = 0; + uint8_t result = 0; switch (offset & 0xEF) { case 0: @@ -284,7 +284,7 @@ namespace { public: // construction/destruction - dragon_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + dragon_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dragon_fdc_device_base(mconfig, DRAGON_FDC, "Dragon FDC", tag, owner, clock, "dragon_fdc", __FILE__) { } @@ -316,7 +316,7 @@ namespace { public: // construction/destruction - sdtandy_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + sdtandy_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dragon_fdc_device_base(mconfig, SDTANDY_FDC, "SDTANDY FDC", tag, owner, clock, "sdtandy_fdc", __FILE__) { } diff --git a/src/devices/bus/coleco/ctrl.cpp b/src/devices/bus/coleco/ctrl.cpp index 5b53be7c3cf..33359141805 100644 --- a/src/devices/bus/coleco/ctrl.cpp +++ b/src/devices/bus/coleco/ctrl.cpp @@ -44,7 +44,7 @@ device_colecovision_control_port_interface::device_colecovision_control_port_int // colecovision_control_port_device - constructor //------------------------------------------------- -colecovision_control_port_device::colecovision_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +colecovision_control_port_device::colecovision_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COLECOVISION_CONTROL_PORT, "ColecoVision control port", tag, owner, clock, "colecovision_control_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr), m_write_irq(*this) diff --git a/src/devices/bus/coleco/ctrl.h b/src/devices/bus/coleco/ctrl.h index a8c82ee23c4..6acabc2b8a1 100644 --- a/src/devices/bus/coleco/ctrl.h +++ b/src/devices/bus/coleco/ctrl.h @@ -48,7 +48,7 @@ public: device_colecovision_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_colecovision_control_port_interface() { } - virtual UINT8 joy_r() { return 0xff; }; + virtual uint8_t joy_r() { return 0xff; }; virtual void common0_w(int state) { m_common0 = state; }; virtual void common1_w(int state) { m_common1 = state; }; @@ -67,14 +67,14 @@ class colecovision_control_port_device : public device_t, { public: // construction/destruction - colecovision_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + colecovision_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~colecovision_control_port_device() { } // static configuration helpers template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } // computer interface - UINT8 read() { UINT8 data = 0xff; if (exists()) data = m_device->joy_r(); return data; } + uint8_t read() { uint8_t data = 0xff; if (exists()) data = m_device->joy_r(); return data; } DECLARE_READ8_MEMBER( read ) { return read(); } DECLARE_WRITE_LINE_MEMBER( common0_w ) { if (exists()) m_device->common0_w(state); } diff --git a/src/devices/bus/coleco/exp.cpp b/src/devices/bus/coleco/exp.cpp index c80af2f879d..3d93ae777b1 100644 --- a/src/devices/bus/coleco/exp.cpp +++ b/src/devices/bus/coleco/exp.cpp @@ -52,7 +52,7 @@ void device_colecovision_cartridge_interface::rom_alloc(size_t size) // colecovision_cartridge_slot_device - constructor //------------------------------------------------- -colecovision_cartridge_slot_device::colecovision_cartridge_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +colecovision_cartridge_slot_device::colecovision_cartridge_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COLECOVISION_CARTRIDGE_SLOT, "ColecoVision cartridge port", tag, owner, clock, "coleco_cartridge_port", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), m_card(nullptr) @@ -104,7 +104,7 @@ std::string colecovision_cartridge_slot_device::get_default_card_software() { if (open_image_file(mconfig().options())) { - UINT32 length = m_file->size(); + uint32_t length = m_file->size(); if (length == 0x100000 || length == 0x200000) return software_get_default_slot("xin1"); } @@ -116,7 +116,7 @@ std::string colecovision_cartridge_slot_device::get_default_card_software() // bd_r - cartridge data read //------------------------------------------------- -UINT8 colecovision_cartridge_slot_device::bd_r(address_space &space, offs_t offset, UINT8 data, int _8000, int _a000, int _c000, int _e000) +uint8_t colecovision_cartridge_slot_device::bd_r(address_space &space, offs_t offset, uint8_t data, int _8000, int _a000, int _c000, int _e000) { if (m_card != nullptr) { diff --git a/src/devices/bus/coleco/exp.h b/src/devices/bus/coleco/exp.h index 19fa5b5e69c..58e75252dfd 100644 --- a/src/devices/bus/coleco/exp.h +++ b/src/devices/bus/coleco/exp.h @@ -66,11 +66,11 @@ class colecovision_cartridge_slot_device : public device_t, { public: // construction/destruction - colecovision_cartridge_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + colecovision_cartridge_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~colecovision_cartridge_slot_device() { } // computer interface - UINT8 bd_r(address_space &space, offs_t offset, UINT8 data, int _8000, int _a000, int _c000, int _e000); + uint8_t bd_r(address_space &space, offs_t offset, uint8_t data, int _8000, int _a000, int _c000, int _e000); protected: // device-level overrides @@ -109,12 +109,12 @@ public: device_colecovision_cartridge_interface(const machine_config &mconfig, device_t &device); virtual ~device_colecovision_cartridge_interface() { } - virtual UINT8 bd_r(address_space &space, offs_t offset, UINT8 data, int _8000, int _a000, int _c000, int _e000) { return 0xff; } + virtual uint8_t bd_r(address_space &space, offs_t offset, uint8_t data, int _8000, int _a000, int _c000, int _e000) { return 0xff; } void rom_alloc(size_t size); protected: - UINT8 *m_rom; + uint8_t *m_rom; size_t m_rom_size; colecovision_cartridge_slot_device *m_slot; diff --git a/src/devices/bus/coleco/hand.cpp b/src/devices/bus/coleco/hand.cpp index a00a1d89f4c..ce53e4246c2 100644 --- a/src/devices/bus/coleco/hand.cpp +++ b/src/devices/bus/coleco/hand.cpp @@ -19,8 +19,8 @@ const device_type COLECO_HAND_CONTROLLER = &device_creatorread(); + uint8_t data = 0xf; + uint16_t keypad = m_io_keypad->read(); if (!BIT(keypad, 0)) data &= 0x0a; if (!BIT(keypad, 1)) data &= 0x0d; @@ -89,7 +89,7 @@ ioport_constructor coleco_hand_controller_t::device_input_ports() const // coleco_hand_controller_t - constructor //------------------------------------------------- -coleco_hand_controller_t::coleco_hand_controller_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +coleco_hand_controller_t::coleco_hand_controller_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COLECO_HAND_CONTROLLER, "ColecoVision Hand Controller", tag, owner, clock, "coleco_hand", __FILE__), device_colecovision_control_port_interface(mconfig, *this), m_io_common0(*this, "COMMON0"), @@ -115,9 +115,9 @@ void coleco_hand_controller_t::device_start() // joy_r - joystick read //------------------------------------------------- -UINT8 coleco_hand_controller_t::joy_r() +uint8_t coleco_hand_controller_t::joy_r() { - UINT8 data = 0x7f; + uint8_t data = 0x7f; if (!m_common0) data &= m_io_common0->read(); if (!m_common1) data &= m_io_common1->read(); diff --git a/src/devices/bus/coleco/hand.h b/src/devices/bus/coleco/hand.h index a43632e66db..e51296ce499 100644 --- a/src/devices/bus/coleco/hand.h +++ b/src/devices/bus/coleco/hand.h @@ -27,7 +27,7 @@ class coleco_hand_controller_t : public device_t, { public: // construction/destruction - coleco_hand_controller_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + coleco_hand_controller_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -39,7 +39,7 @@ protected: virtual void device_start() override; // device_vcs_control_port_interface overrides - virtual UINT8 joy_r() override; + virtual uint8_t joy_r() override; private: required_ioport m_io_common0; diff --git a/src/devices/bus/coleco/sac.cpp b/src/devices/bus/coleco/sac.cpp index 01a62b49323..ba05d15683e 100644 --- a/src/devices/bus/coleco/sac.cpp +++ b/src/devices/bus/coleco/sac.cpp @@ -19,8 +19,8 @@ const device_type COLECO_SUPER_ACTION_CONTROLLER = &device_creatorread(); + uint8_t data = 0xf; + uint16_t keypad = m_io_keypad->read(); if (!BIT(keypad, 0)) data &= 0x0a; if (!BIT(keypad, 1)) data &= 0x0d; @@ -101,7 +101,7 @@ ioport_constructor coleco_super_action_controller_t::device_input_ports() const // coleco_super_action_controller_t - constructor //------------------------------------------------- -coleco_super_action_controller_t::coleco_super_action_controller_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +coleco_super_action_controller_t::coleco_super_action_controller_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COLECO_SUPER_ACTION_CONTROLLER, "ColecoVision Super Action Controller", tag, owner, clock, "coleco_sac", __FILE__), device_colecovision_control_port_interface(mconfig, *this), m_io_common0(*this, "COMMON0"), @@ -127,9 +127,9 @@ void coleco_super_action_controller_t::device_start() // joy_r - joystick read //------------------------------------------------- -UINT8 coleco_super_action_controller_t::joy_r() +uint8_t coleco_super_action_controller_t::joy_r() { - UINT8 data = 0x7f; + uint8_t data = 0x7f; if (!m_common0) data &= m_io_common0->read(); if (!m_common1) data &= m_io_common1->read(); diff --git a/src/devices/bus/coleco/sac.h b/src/devices/bus/coleco/sac.h index 51dcfae357f..4f90e225374 100644 --- a/src/devices/bus/coleco/sac.h +++ b/src/devices/bus/coleco/sac.h @@ -27,7 +27,7 @@ class coleco_super_action_controller_t : public device_t, { public: // construction/destruction - coleco_super_action_controller_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + coleco_super_action_controller_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -40,7 +40,7 @@ protected: virtual void device_start() override; // device_vcs_control_port_interface overrides - virtual UINT8 joy_r() override; + virtual uint8_t joy_r() override; private: required_ioport m_io_common0; diff --git a/src/devices/bus/coleco/std.cpp b/src/devices/bus/coleco/std.cpp index f66a0463eae..f8842a4aa9e 100644 --- a/src/devices/bus/coleco/std.cpp +++ b/src/devices/bus/coleco/std.cpp @@ -26,7 +26,7 @@ const device_type COLECOVISION_STANDARD = &device_creator void set_dma_request_callback(_dma_request dma_request) { m_write_dma_request.set_callback(dma_request); } diff --git a/src/devices/bus/compis/hrg.cpp b/src/devices/bus/compis/hrg.cpp index 0f77a04caf6..839ee7e53e2 100644 --- a/src/devices/bus/compis/hrg.cpp +++ b/src/devices/bus/compis/hrg.cpp @@ -47,7 +47,7 @@ ADDRESS_MAP_END UPD7220_DISPLAY_PIXELS_MEMBER( compis_hrg_t::display_pixels ) { - UINT16 i,gfx = m_video_ram[(address & 0x7fff) >> 1]; + uint16_t i,gfx = m_video_ram[(address & 0x7fff) >> 1]; const pen_t *pen = m_palette->pens(); for(i=0; i<16; i++) @@ -61,7 +61,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( compis_hrg_t::display_pixels ) UPD7220_DISPLAY_PIXELS_MEMBER( compis_uhrg_t::display_pixels ) { - UINT16 i,gfx = m_video_ram[(address & 0x1ffff) >> 1]; + uint16_t i,gfx = m_video_ram[(address & 0x1ffff) >> 1]; const pen_t *pen = m_palette->pens(); for(i=0; i<16; i++) @@ -144,7 +144,7 @@ machine_config_constructor compis_uhrg_t::device_mconfig_additions() const // compis_hrg_t - constructor //------------------------------------------------- -compis_hrg_t::compis_hrg_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) : +compis_hrg_t::compis_hrg_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), device_compis_graphics_card_interface(mconfig, *this), m_crtc(*this, UPD7220_TAG), @@ -153,12 +153,12 @@ compis_hrg_t::compis_hrg_t(const machine_config &mconfig, device_type type, cons { } -compis_hrg_t::compis_hrg_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +compis_hrg_t::compis_hrg_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : compis_hrg_t(mconfig, COMPIS_HRG, "Compis HRG", tag, owner, clock, "compis_hrg", __FILE__) { } -compis_uhrg_t::compis_uhrg_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +compis_uhrg_t::compis_uhrg_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : compis_hrg_t(mconfig, COMPIS_UHRG, "Compis UHRG", tag, owner, clock, "compis_uhrg", __FILE__) { } @@ -186,9 +186,9 @@ void compis_hrg_t::device_reset() // pcs6_6_r - //------------------------------------------------- -UINT8 compis_hrg_t::pcs6_6_r(address_space &space, offs_t offset) +uint8_t compis_hrg_t::pcs6_6_r(address_space &space, offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset < 2) data = m_crtc->read(space, offset & 0x01); @@ -223,7 +223,7 @@ UINT8 compis_hrg_t::pcs6_6_r(address_space &space, offs_t offset) // pcs6_6_w - //------------------------------------------------- -void compis_hrg_t::pcs6_6_w(address_space &space, offs_t offset, UINT8 data) +void compis_hrg_t::pcs6_6_w(address_space &space, offs_t offset, uint8_t data) { //logerror("%s PCS 6:6 write %04x : %02x\n", machine().describe_context(), offset, data); diff --git a/src/devices/bus/compis/hrg.h b/src/devices/bus/compis/hrg.h index c5443d2df1e..ad2e8998570 100644 --- a/src/devices/bus/compis/hrg.h +++ b/src/devices/bus/compis/hrg.h @@ -28,8 +28,8 @@ class compis_hrg_t : public device_t, { public: // construction/destruction - compis_hrg_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); - compis_hrg_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + compis_hrg_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); + compis_hrg_t(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; @@ -42,14 +42,14 @@ protected: virtual void device_reset() override; // device_compis_graphics_card_interface overrides - virtual UINT8 pcs6_6_r(address_space &space, offs_t offset) override; - virtual void pcs6_6_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t pcs6_6_r(address_space &space, offs_t offset) override; + virtual void pcs6_6_w(address_space &space, offs_t offset, uint8_t data) override; required_device m_crtc; required_device m_palette; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; - UINT8 m_unk_video; + uint8_t m_unk_video; }; @@ -59,7 +59,7 @@ class compis_uhrg_t : public compis_hrg_t { public: // construction/destruction - compis_uhrg_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + compis_uhrg_t(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; diff --git a/src/devices/bus/compucolor/floppy.cpp b/src/devices/bus/compucolor/floppy.cpp index b69bbe014b0..6c817f6ef67 100644 --- a/src/devices/bus/compucolor/floppy.cpp +++ b/src/devices/bus/compucolor/floppy.cpp @@ -84,7 +84,7 @@ device_compucolor_floppy_port_interface::device_compucolor_floppy_port_interface // compucolor_floppy_port_device - constructor //------------------------------------------------- -compucolor_floppy_port_device::compucolor_floppy_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +compucolor_floppy_port_device::compucolor_floppy_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : rs232_port_device(mconfig, COMPUCOLOR_FLOPPY_PORT, "Compucolor Floppy Port", tag, owner, clock, "compclr_flp_port", __FILE__), m_dev(nullptr) { } @@ -94,7 +94,7 @@ compucolor_floppy_port_device::compucolor_floppy_port_device(const machine_confi // compucolor_floppy_device - constructor //------------------------------------------------- -compucolor_floppy_device::compucolor_floppy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +compucolor_floppy_device::compucolor_floppy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMPUCOLOR_FLOPPY, "Compucolor floppy", tag, owner, clock, "compclr_flp", __FILE__), device_compucolor_floppy_port_interface(mconfig, *this), m_floppy(*this, "floppy:525sssd"), @@ -159,7 +159,7 @@ void compucolor_floppy_device::device_timer(emu_timer &timer, device_timer_id id // tx_w - //------------------------------------------------- -void compucolor_floppy_device::tx(UINT8 state) +void compucolor_floppy_device::tx(uint8_t state) { if (!m_sel && m_rw) { @@ -187,7 +187,7 @@ void compucolor_floppy_device::rw_w(int state) // stepper_w - //------------------------------------------------- -void compucolor_floppy_device::stepper_w(UINT8 data) +void compucolor_floppy_device::stepper_w(uint8_t data) { if (!m_sel) { diff --git a/src/devices/bus/compucolor/floppy.h b/src/devices/bus/compucolor/floppy.h index f17772c88fe..22a716457f3 100644 --- a/src/devices/bus/compucolor/floppy.h +++ b/src/devices/bus/compucolor/floppy.h @@ -40,7 +40,7 @@ public: virtual ~device_compucolor_floppy_port_interface() { } virtual void rw_w(int state) = 0; - virtual void stepper_w(UINT8 data) = 0; + virtual void stepper_w(uint8_t data) = 0; virtual void select_w(int state) = 0; }; @@ -50,11 +50,11 @@ public: class compucolor_floppy_port_device : public rs232_port_device { public: - compucolor_floppy_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + compucolor_floppy_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~compucolor_floppy_port_device() { } DECLARE_WRITE_LINE_MEMBER( rw_w ) { if (m_dev) m_dev->rw_w(state); } - void stepper_w(UINT8 data) { if (m_dev) m_dev->stepper_w(data); } + void stepper_w(uint8_t data) { if (m_dev) m_dev->stepper_w(data); } DECLARE_WRITE_LINE_MEMBER( select_w ) { if (m_dev) m_dev->select_w(state); } protected: @@ -74,7 +74,7 @@ class compucolor_floppy_device : public device_t, { public: // construction/destruction - compucolor_floppy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + compucolor_floppy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_FLOPPY_FORMATS( floppy_formats ); @@ -87,11 +87,11 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_serial_port_interface overrides - virtual void tx(UINT8 state); + virtual void tx(uint8_t state); // device_compucolor_floppy_port_interface overrides virtual void rw_w(int state) override; - virtual void stepper_w(UINT8 data) override; + virtual void stepper_w(uint8_t data) override; virtual void select_w(int state) override; private: diff --git a/src/devices/bus/comx35/clm.cpp b/src/devices/bus/comx35/clm.cpp index 513a123086a..294c9042ece 100644 --- a/src/devices/bus/comx35/clm.cpp +++ b/src/devices/bus/comx35/clm.cpp @@ -101,9 +101,9 @@ MC6845_UPDATE_ROW( comx_clm_device::crtc_update_row ) { for (int column = 0; column < x_count; column++) { - UINT8 code = m_video_ram[((ma + column) & 0x7ff)]; - UINT16 addr = (code << 3) | (ra & 0x07); - UINT8 data = m_char_rom->base()[addr & 0x7ff]; + uint8_t code = m_video_ram[((ma + column) & 0x7ff)]; + uint16_t addr = (code << 3) | (ra & 0x07); + uint8_t data = m_char_rom->base()[addr & 0x7ff]; if (BIT(ra, 3) && column == cursor_x) { @@ -172,7 +172,7 @@ machine_config_constructor comx_clm_device::device_mconfig_additions() const // comx_clm_device - constructor //------------------------------------------------- -comx_clm_device::comx_clm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +comx_clm_device::comx_clm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_CLM, "COMX 80 Column Card", tag, owner, clock, "comx_clm", __FILE__), device_comx_expansion_card_interface(mconfig, *this), device_gfx_interface(mconfig, *this, nullptr, "palette"), @@ -222,9 +222,9 @@ int comx_clm_device::comx_ef4_r() // comx_mrd_r - memory read //------------------------------------------------- -UINT8 comx_clm_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) +uint8_t comx_clm_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset >= 0xc000 && offset < 0xc800) { @@ -247,7 +247,7 @@ UINT8 comx_clm_device::comx_mrd_r(address_space &space, offs_t offset, int *extr // comx_mwr_w - memory write //------------------------------------------------- -void comx_clm_device::comx_mwr_w(address_space &space, offs_t offset, UINT8 data) +void comx_clm_device::comx_mwr_w(address_space &space, offs_t offset, uint8_t data) { if (offset >= 0xd000 && offset < 0xd800) { diff --git a/src/devices/bus/comx35/clm.h b/src/devices/bus/comx35/clm.h index 0a71c1afb21..0890c307391 100644 --- a/src/devices/bus/comx35/clm.h +++ b/src/devices/bus/comx35/clm.h @@ -29,7 +29,7 @@ class comx_clm_device : public device_t, { public: // construction/destruction - comx_clm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_clm_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; @@ -45,15 +45,15 @@ protected: // device_comx_expansion_card_interface overrides virtual int comx_ef4_r() override; - virtual UINT8 comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; - virtual void comx_mwr_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; + virtual void comx_mwr_w(address_space &space, offs_t offset, uint8_t data) override; private: required_device m_crtc; required_device m_palette; required_memory_region m_rom; required_memory_region m_char_rom; - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; }; diff --git a/src/devices/bus/comx35/eprom.cpp b/src/devices/bus/comx35/eprom.cpp index 505b81ebb29..9261e27b970 100644 --- a/src/devices/bus/comx35/eprom.cpp +++ b/src/devices/bus/comx35/eprom.cpp @@ -56,7 +56,7 @@ const tiny_rom_entry *comx_epr_device::device_rom_region() const // comx_epr_device - constructor //------------------------------------------------- -comx_epr_device::comx_epr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +comx_epr_device::comx_epr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_EPR, "COMX-35 F&M EPROM Switchboard", tag, owner, clock, "comx_epr", __FILE__), device_comx_expansion_card_interface(mconfig, *this), m_rom(*this, "f800"), @@ -90,9 +90,9 @@ void comx_epr_device::device_reset() // comx_mrd_r - memory read //------------------------------------------------- -UINT8 comx_epr_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) +uint8_t comx_epr_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) { - UINT8 data = 0; + uint8_t data = 0; if (offset >= 0xc000 && offset < 0xe000) { @@ -112,7 +112,7 @@ UINT8 comx_epr_device::comx_mrd_r(address_space &space, offs_t offset, int *extr // comx_io_w - I/O write //------------------------------------------------- -void comx_epr_device::comx_io_w(address_space &space, offs_t offset, UINT8 data) +void comx_epr_device::comx_io_w(address_space &space, offs_t offset, uint8_t data) { if (offset == 1) { diff --git a/src/devices/bus/comx35/eprom.h b/src/devices/bus/comx35/eprom.h index db6823f7ac3..ae9b4ce474b 100644 --- a/src/devices/bus/comx35/eprom.h +++ b/src/devices/bus/comx35/eprom.h @@ -27,7 +27,7 @@ class comx_epr_device : public device_t, { public: // construction/destruction - comx_epr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_epr_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; @@ -38,14 +38,14 @@ protected: virtual void device_reset() override; // device_comx_expansion_card_interface overrides - virtual UINT8 comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; - virtual void comx_io_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; + virtual void comx_io_w(address_space &space, offs_t offset, uint8_t data) override; private: required_memory_region m_rom; required_memory_region m_eprom; - UINT8 m_select; + uint8_t m_select; }; diff --git a/src/devices/bus/comx35/exp.cpp b/src/devices/bus/comx35/exp.cpp index cd64a1b49a8..a8495681f21 100644 --- a/src/devices/bus/comx35/exp.cpp +++ b/src/devices/bus/comx35/exp.cpp @@ -42,7 +42,7 @@ device_comx_expansion_card_interface::device_comx_expansion_card_interface(const // comx_expansion_slot_device - constructor //------------------------------------------------- -comx_expansion_slot_device::comx_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +comx_expansion_slot_device::comx_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_EXPANSION_SLOT, "COMX-35 expansion slot", tag, owner, clock, "comx_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_write_irq(*this), m_card(nullptr) @@ -67,9 +67,9 @@ void comx_expansion_slot_device::device_start() // mrd_r - memory read //------------------------------------------------- -UINT8 comx_expansion_slot_device::mrd_r(address_space &space, offs_t offset, int *extrom) +uint8_t comx_expansion_slot_device::mrd_r(address_space &space, offs_t offset, int *extrom) { - UINT8 data = 0; + uint8_t data = 0; if (m_card != nullptr) { @@ -84,7 +84,7 @@ UINT8 comx_expansion_slot_device::mrd_r(address_space &space, offs_t offset, int // mwr_w - memory write //------------------------------------------------- -void comx_expansion_slot_device::mwr_w(address_space &space, offs_t offset, UINT8 data) +void comx_expansion_slot_device::mwr_w(address_space &space, offs_t offset, uint8_t data) { if (m_card != nullptr) { @@ -97,9 +97,9 @@ void comx_expansion_slot_device::mwr_w(address_space &space, offs_t offset, UINT // io_r - I/O read //------------------------------------------------- -UINT8 comx_expansion_slot_device::io_r(address_space &space, offs_t offset) +uint8_t comx_expansion_slot_device::io_r(address_space &space, offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; if (m_card != nullptr) { @@ -114,7 +114,7 @@ UINT8 comx_expansion_slot_device::io_r(address_space &space, offs_t offset) // sout_w - I/O write //------------------------------------------------- -void comx_expansion_slot_device::io_w(address_space &space, offs_t offset, UINT8 data) +void comx_expansion_slot_device::io_w(address_space &space, offs_t offset, uint8_t data) { if (m_card != nullptr) { diff --git a/src/devices/bus/comx35/exp.h b/src/devices/bus/comx35/exp.h index 02325753396..ec1ccb673e9 100644 --- a/src/devices/bus/comx35/exp.h +++ b/src/devices/bus/comx35/exp.h @@ -75,16 +75,16 @@ class comx_expansion_slot_device : public device_t, { public: // construction/destruction - comx_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~comx_expansion_slot_device() { } template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } - UINT8 mrd_r(address_space &space, offs_t offset, int *extrom); - void mwr_w(address_space &space, offs_t offset, UINT8 data); + uint8_t mrd_r(address_space &space, offs_t offset, int *extrom); + void mwr_w(address_space &space, offs_t offset, uint8_t data); - UINT8 io_r(address_space &space, offs_t offset); - void io_w(address_space &space, offs_t offset, UINT8 data); + uint8_t io_r(address_space &space, offs_t offset); + void io_w(address_space &space, offs_t offset, uint8_t data); DECLARE_READ_LINE_MEMBER( ef4_r ); @@ -122,12 +122,12 @@ protected: virtual void comx_q_w(int state) { }; // memory access - virtual UINT8 comx_mrd_r(address_space &space, offs_t offset, int *extrom) { return 0; }; - virtual void comx_mwr_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) { return 0; }; + virtual void comx_mwr_w(address_space &space, offs_t offset, uint8_t data) { }; // I/O access - virtual UINT8 comx_io_r(address_space &space, offs_t offset) { return 0; }; - virtual void comx_io_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t comx_io_r(address_space &space, offs_t offset) { return 0; }; + virtual void comx_io_w(address_space &space, offs_t offset, uint8_t data) { }; comx_expansion_slot_device *m_slot; diff --git a/src/devices/bus/comx35/expbox.cpp b/src/devices/bus/comx35/expbox.cpp index dac3ffc95c3..cc38f7f81a7 100644 --- a/src/devices/bus/comx35/expbox.cpp +++ b/src/devices/bus/comx35/expbox.cpp @@ -129,7 +129,7 @@ machine_config_constructor comx_eb_device::device_mconfig_additions() const // comx_eb_device - constructor //------------------------------------------------- -comx_eb_device::comx_eb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +comx_eb_device::comx_eb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_EB, "COMX-35E Expansion Box", tag, owner, clock, "comx_eb", __FILE__), device_comx_expansion_card_interface(mconfig, *this), m_rom(*this, "e000"), @@ -213,9 +213,9 @@ void comx_eb_device::comx_q_w(int state) // comx_mrd_r - memory read //------------------------------------------------- -UINT8 comx_eb_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) +uint8_t comx_eb_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) { - UINT8 data = 0; + uint8_t data = 0; if (offset >= 0x1000 && offset < 0x1800) { @@ -245,7 +245,7 @@ UINT8 comx_eb_device::comx_mrd_r(address_space &space, offs_t offset, int *extro // comx_mwr_w - memory write //------------------------------------------------- -void comx_eb_device::comx_mwr_w(address_space &space, offs_t offset, UINT8 data) +void comx_eb_device::comx_mwr_w(address_space &space, offs_t offset, uint8_t data) { for (int slot = 0; slot < MAX_EB_SLOTS; slot++) { @@ -261,9 +261,9 @@ void comx_eb_device::comx_mwr_w(address_space &space, offs_t offset, UINT8 data) // comx_io_r - I/O read //------------------------------------------------- -UINT8 comx_eb_device::comx_io_r(address_space &space, offs_t offset) +uint8_t comx_eb_device::comx_io_r(address_space &space, offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; for (int slot = 0; slot < MAX_EB_SLOTS; slot++) { @@ -281,7 +281,7 @@ UINT8 comx_eb_device::comx_io_r(address_space &space, offs_t offset) // comx_io_w - I/O write //------------------------------------------------- -void comx_eb_device::comx_io_w(address_space &space, offs_t offset, UINT8 data) +void comx_eb_device::comx_io_w(address_space &space, offs_t offset, uint8_t data) { if (offset == 1 && !(BIT(data, 0))) { diff --git a/src/devices/bus/comx35/expbox.h b/src/devices/bus/comx35/expbox.h index 72bc7fc5a59..00febcb6188 100644 --- a/src/devices/bus/comx35/expbox.h +++ b/src/devices/bus/comx35/expbox.h @@ -34,7 +34,7 @@ class comx_eb_device : public device_t, { public: // construction/destruction - comx_eb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_eb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( slot1_irq_w ) { m_irq[0] = state; set_irq(); } DECLARE_WRITE_LINE_MEMBER( slot2_irq_w ) { m_irq[1] = state; set_irq(); } @@ -53,10 +53,10 @@ protected: // device_comx_expansion_card_interface overrides virtual int comx_ef4_r() override; virtual void comx_q_w(int state) override; - virtual UINT8 comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; - virtual void comx_mwr_w(address_space &space, offs_t offset, UINT8 data) override; - virtual UINT8 comx_io_r(address_space &space, offs_t offset) override; - virtual void comx_io_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; + virtual void comx_mwr_w(address_space &space, offs_t offset, uint8_t data) override; + virtual uint8_t comx_io_r(address_space &space, offs_t offset) override; + virtual void comx_io_w(address_space &space, offs_t offset, uint8_t data) override; void set_irq() { m_slot->irq_w(m_irq[0] || m_irq[1] || m_irq[2] || m_irq[3]); } @@ -66,7 +66,7 @@ private: comx_expansion_slot_device *m_expansion_slot[MAX_EB_SLOTS]; int m_irq[MAX_EB_SLOTS]; - UINT8 m_select; + uint8_t m_select; }; diff --git a/src/devices/bus/comx35/fdc.cpp b/src/devices/bus/comx35/fdc.cpp index 30693eb3738..b5003e194fc 100644 --- a/src/devices/bus/comx35/fdc.cpp +++ b/src/devices/bus/comx35/fdc.cpp @@ -122,7 +122,7 @@ machine_config_constructor comx_fd_device::device_mconfig_additions() const // comx_fd_device - constructor //------------------------------------------------- -comx_fd_device::comx_fd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +comx_fd_device::comx_fd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_FD, "COMX FD", tag, owner, clock, "comx_fd", __FILE__), device_comx_expansion_card_interface(mconfig, *this), m_fdc(*this, WD1770_TAG), @@ -196,9 +196,9 @@ void comx_fd_device::comx_q_w(int state) // comx_mrd_r - memory read //------------------------------------------------- -UINT8 comx_fd_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) +uint8_t comx_fd_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset >= 0x0dd0 && offset < 0x0de0) { @@ -218,9 +218,9 @@ UINT8 comx_fd_device::comx_mrd_r(address_space &space, offs_t offset, int *extro // comx_io_r - I/O read //------------------------------------------------- -UINT8 comx_fd_device::comx_io_r(address_space &space, offs_t offset) +uint8_t comx_fd_device::comx_io_r(address_space &space, offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset == 2) { @@ -243,7 +243,7 @@ UINT8 comx_fd_device::comx_io_r(address_space &space, offs_t offset) // comx_io_w - I/O write //------------------------------------------------- -void comx_fd_device::comx_io_w(address_space &space, offs_t offset, UINT8 data) +void comx_fd_device::comx_io_w(address_space &space, offs_t offset, uint8_t data) { if (offset == 2) { diff --git a/src/devices/bus/comx35/fdc.h b/src/devices/bus/comx35/fdc.h index 0d8cddd7e60..70ce499a2f3 100644 --- a/src/devices/bus/comx35/fdc.h +++ b/src/devices/bus/comx35/fdc.h @@ -29,7 +29,7 @@ class comx_fd_device : public device_t, { public: // construction/destruction - comx_fd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_fd_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; @@ -45,9 +45,9 @@ protected: // device_comx_expansion_card_interface overrides virtual int comx_ef4_r() override; virtual void comx_q_w(int state) override; - virtual UINT8 comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; - virtual UINT8 comx_io_r(address_space &space, offs_t offset) override; - virtual void comx_io_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; + virtual uint8_t comx_io_r(address_space &space, offs_t offset) override; + virtual void comx_io_w(address_space &space, offs_t offset, uint8_t data) override; private: // internal state diff --git a/src/devices/bus/comx35/joycard.cpp b/src/devices/bus/comx35/joycard.cpp index 2408693f1b8..243dccc2885 100644 --- a/src/devices/bus/comx35/joycard.cpp +++ b/src/devices/bus/comx35/joycard.cpp @@ -66,7 +66,7 @@ ioport_constructor comx_joy_device::device_input_ports() const // comx_joy_device - constructor //------------------------------------------------- -comx_joy_device::comx_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +comx_joy_device::comx_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_JOY, "COMX JoyCard", tag, owner, clock, "comx_joy", __FILE__), device_comx_expansion_card_interface(mconfig, *this), m_joy1(*this, "JOY1"), @@ -97,9 +97,9 @@ void comx_joy_device::device_reset() // comx_mrd_r - I/O read //------------------------------------------------- -UINT8 comx_joy_device::comx_io_r(address_space &space, offs_t offset) +uint8_t comx_joy_device::comx_io_r(address_space &space, offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; if (offset == 2) { diff --git a/src/devices/bus/comx35/joycard.h b/src/devices/bus/comx35/joycard.h index 318c5265069..b171890e70e 100644 --- a/src/devices/bus/comx35/joycard.h +++ b/src/devices/bus/comx35/joycard.h @@ -27,7 +27,7 @@ class comx_joy_device : public device_t, { public: // construction/destruction - comx_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -38,7 +38,7 @@ protected: virtual void device_reset() override; // device_comx_expansion_card_interface overrides - virtual UINT8 comx_io_r(address_space &space, offs_t offset) override; + virtual uint8_t comx_io_r(address_space &space, offs_t offset) override; private: required_ioport m_joy1; diff --git a/src/devices/bus/comx35/printer.cpp b/src/devices/bus/comx35/printer.cpp index 5d0cb050f70..1625c5b4580 100644 --- a/src/devices/bus/comx35/printer.cpp +++ b/src/devices/bus/comx35/printer.cpp @@ -86,7 +86,7 @@ machine_config_constructor comx_prn_device::device_mconfig_additions() const // comx_prn_device - constructor //------------------------------------------------- -comx_prn_device::comx_prn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +comx_prn_device::comx_prn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_PRN, "COMX-35 Printer Card", tag, owner, clock, "comx_prn", __FILE__), device_comx_expansion_card_interface(mconfig, *this), m_centronics(*this, CENTRONICS_TAG), @@ -119,9 +119,9 @@ void comx_prn_device::device_reset() // comx_mrd_r - memory read //------------------------------------------------- -UINT8 comx_prn_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) +uint8_t comx_prn_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) { - UINT8 data = 0; + uint8_t data = 0; if (offset >= 0xc000 && offset < 0xe000) { @@ -136,7 +136,7 @@ UINT8 comx_prn_device::comx_mrd_r(address_space &space, offs_t offset, int *extr // comx_io_r - I/O read //------------------------------------------------- -UINT8 comx_prn_device::comx_io_r(address_space &space, offs_t offset) +uint8_t comx_prn_device::comx_io_r(address_space &space, offs_t offset) { /* Parallel: @@ -175,7 +175,7 @@ UINT8 comx_prn_device::comx_io_r(address_space &space, offs_t offset) // comx_io_w - I/O write //------------------------------------------------- -void comx_prn_device::comx_io_w(address_space &space, offs_t offset, UINT8 data) +void comx_prn_device::comx_io_w(address_space &space, offs_t offset, uint8_t data) { /* Parallel: diff --git a/src/devices/bus/comx35/printer.h b/src/devices/bus/comx35/printer.h index f5b4d86b5a0..63cd21f3ae5 100644 --- a/src/devices/bus/comx35/printer.h +++ b/src/devices/bus/comx35/printer.h @@ -29,7 +29,7 @@ class comx_prn_device : public device_t, { public: // construction/destruction - comx_prn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_prn_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; @@ -41,9 +41,9 @@ protected: virtual void device_reset() override; // device_comx_expansion_card_interface overrides - virtual UINT8 comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; - virtual UINT8 comx_io_r(address_space &space, offs_t offset) override; - virtual void comx_io_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; + virtual uint8_t comx_io_r(address_space &space, offs_t offset) override; + virtual void comx_io_w(address_space &space, offs_t offset, uint8_t data) override; private: required_device m_centronics; diff --git a/src/devices/bus/comx35/ram.cpp b/src/devices/bus/comx35/ram.cpp index 0e096c5dc15..395dfb1e1c0 100644 --- a/src/devices/bus/comx35/ram.cpp +++ b/src/devices/bus/comx35/ram.cpp @@ -33,7 +33,7 @@ const device_type COMX_RAM = &device_creator; // comx_ram_device - constructor //------------------------------------------------- -comx_ram_device::comx_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +comx_ram_device::comx_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_RAM, "COMX-35 RAM Card", tag, owner, clock, "comx_ram", __FILE__), device_comx_expansion_card_interface(mconfig, *this), m_ram(*this, "ram"), @@ -65,9 +65,9 @@ void comx_ram_device::device_reset() // comx_mrd_r - memory read //------------------------------------------------- -UINT8 comx_ram_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) +uint8_t comx_ram_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) { - UINT8 data = 0; + uint8_t data = 0; if (offset >= 0xc000 && offset < 0xd000) { @@ -82,7 +82,7 @@ UINT8 comx_ram_device::comx_mrd_r(address_space &space, offs_t offset, int *extr // comx_mwr_w - memory write //------------------------------------------------- -void comx_ram_device::comx_mwr_w(address_space &space, offs_t offset, UINT8 data) +void comx_ram_device::comx_mwr_w(address_space &space, offs_t offset, uint8_t data) { if (offset >= 0xc000 && offset < 0xd000) { @@ -95,7 +95,7 @@ void comx_ram_device::comx_mwr_w(address_space &space, offs_t offset, UINT8 data // comx_io_w - I/O write //------------------------------------------------- -void comx_ram_device::comx_io_w(address_space &space, offs_t offset, UINT8 data) +void comx_ram_device::comx_io_w(address_space &space, offs_t offset, uint8_t data) { if (offset == 1) { diff --git a/src/devices/bus/comx35/ram.h b/src/devices/bus/comx35/ram.h index c74a54066f4..848b38ccfdf 100644 --- a/src/devices/bus/comx35/ram.h +++ b/src/devices/bus/comx35/ram.h @@ -27,7 +27,7 @@ class comx_ram_device : public device_t, { public: // construction/destruction - comx_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -35,12 +35,12 @@ protected: virtual void device_reset() override; // device_comx_expansion_card_interface overrides - virtual UINT8 comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; - virtual void comx_mwr_w(address_space &space, offs_t offset, UINT8 data) override; - virtual void comx_io_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; + virtual void comx_mwr_w(address_space &space, offs_t offset, uint8_t data) override; + virtual void comx_io_w(address_space &space, offs_t offset, uint8_t data) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; int m_bank; }; diff --git a/src/devices/bus/comx35/thermal.cpp b/src/devices/bus/comx35/thermal.cpp index 87945343580..82d4ab51fb2 100644 --- a/src/devices/bus/comx35/thermal.cpp +++ b/src/devices/bus/comx35/thermal.cpp @@ -51,7 +51,7 @@ const tiny_rom_entry *comx_thm_device::device_rom_region() const // comx_thm_device - constructor //------------------------------------------------- -comx_thm_device::comx_thm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +comx_thm_device::comx_thm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMX_THM, "COMX-35 Thermal Printer Card", tag, owner, clock, "comx_thm", __FILE__), device_comx_expansion_card_interface(mconfig, *this), m_rom(*this, "c000") @@ -81,9 +81,9 @@ void comx_thm_device::device_reset() // comx_mrd_r - memory read //------------------------------------------------- -UINT8 comx_thm_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) +uint8_t comx_thm_device::comx_mrd_r(address_space &space, offs_t offset, int *extrom) { - UINT8 data = 0; + uint8_t data = 0; if (offset >= 0xc000 && offset < 0xd000) { @@ -98,7 +98,7 @@ UINT8 comx_thm_device::comx_mrd_r(address_space &space, offs_t offset, int *extr // comx_io_r - I/O read //------------------------------------------------- -UINT8 comx_thm_device::comx_io_r(address_space &space, offs_t offset) +uint8_t comx_thm_device::comx_io_r(address_space &space, offs_t offset) { /* INP 2 is used for the printer status, where: @@ -115,7 +115,7 @@ UINT8 comx_thm_device::comx_io_r(address_space &space, offs_t offset) // comx_io_w - I/O write //------------------------------------------------- -void comx_thm_device::comx_io_w(address_space &space, offs_t offset, UINT8 data) +void comx_thm_device::comx_io_w(address_space &space, offs_t offset, uint8_t data) { /* OUT 2 is used to control the thermal printer where: diff --git a/src/devices/bus/comx35/thermal.h b/src/devices/bus/comx35/thermal.h index e2cadb511a8..111a6a64848 100644 --- a/src/devices/bus/comx35/thermal.h +++ b/src/devices/bus/comx35/thermal.h @@ -27,7 +27,7 @@ class comx_thm_device : public device_t, { public: // construction/destruction - comx_thm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + comx_thm_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; @@ -38,9 +38,9 @@ protected: virtual void device_reset() override; // device_comx_expansion_card_interface overrides - virtual UINT8 comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; - virtual UINT8 comx_io_r(address_space &space, offs_t offset) override; - virtual void comx_io_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t comx_mrd_r(address_space &space, offs_t offset, int *extrom) override; + virtual uint8_t comx_io_r(address_space &space, offs_t offset) override; + virtual void comx_io_w(address_space &space, offs_t offset, uint8_t data) override; private: required_memory_region m_rom; diff --git a/src/devices/bus/cpc/amdrum.cpp b/src/devices/bus/cpc/amdrum.cpp index 072e7e117c4..3ed2f019655 100644 --- a/src/devices/bus/cpc/amdrum.cpp +++ b/src/devices/bus/cpc/amdrum.cpp @@ -36,7 +36,7 @@ machine_config_constructor cpc_amdrum_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -cpc_amdrum_device::cpc_amdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_amdrum_device::cpc_amdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_AMDRUM, "Amdrum", tag, owner, clock, "cpc_amdrum", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), diff --git a/src/devices/bus/cpc/amdrum.h b/src/devices/bus/cpc/amdrum.h index 9f0b753f763..ce9643011fa 100644 --- a/src/devices/bus/cpc/amdrum.h +++ b/src/devices/bus/cpc/amdrum.h @@ -24,7 +24,7 @@ class cpc_amdrum_device : public device_t, { public: // construction/destruction - cpc_amdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_amdrum_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; diff --git a/src/devices/bus/cpc/brunword4.cpp b/src/devices/bus/cpc/brunword4.cpp index a6ee0d9540c..134f3171460 100644 --- a/src/devices/bus/cpc/brunword4.cpp +++ b/src/devices/bus/cpc/brunword4.cpp @@ -62,7 +62,7 @@ const tiny_rom_entry *cpc_brunword4_device::device_rom_region() const return ROM_NAME( cpc_brunword4 ); } -cpc_brunword4_device::cpc_brunword4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_brunword4_device::cpc_brunword4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_BRUNWORD_MK4, "Brunword Elite MK4", tag, owner, clock, "cpc_brunword4", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_rombank_active(false), m_bank_sel(0) { @@ -98,14 +98,14 @@ WRITE8_MEMBER(cpc_brunword4_device::rombank_w) m_slot->rom_select(space,0,data & 0x3f); // repeats every 64 ROMs, this breaks upper cart ROM selection on the Plus } -void cpc_brunword4_device::set_mapping(UINT8 type) +void cpc_brunword4_device::set_mapping(uint8_t type) { if(type != MAP_OTHER) return; if(m_rombank_active) { - UINT8* ROM = memregion("mk4_roms")->base(); - UINT8 bank = ((m_bank_sel & 0x38) >> 1) | (m_bank_sel & 0x03); + uint8_t* ROM = memregion("mk4_roms")->base(); + uint8_t bank = ((m_bank_sel & 0x38) >> 1) | (m_bank_sel & 0x03); membank(":bank3")->set_base(ROM+(bank*0x4000)); membank(":bank4")->set_base(ROM+((bank*0x4000) + 0x2000)); } diff --git a/src/devices/bus/cpc/brunword4.h b/src/devices/bus/cpc/brunword4.h index 009de694767..995fc698f4e 100644 --- a/src/devices/bus/cpc/brunword4.h +++ b/src/devices/bus/cpc/brunword4.h @@ -14,13 +14,13 @@ class cpc_brunword4_device : public device_t, { public: // construction/destruction - cpc_brunword4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_brunword4_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; DECLARE_WRITE8_MEMBER(rombank_w); - virtual void set_mapping(UINT8 type) override; + virtual void set_mapping(uint8_t type) override; protected: // device-level overrides @@ -31,7 +31,7 @@ private: cpc_expansion_slot_device *m_slot; bool m_rombank_active; - UINT8 m_bank_sel; + uint8_t m_bank_sel; }; // device type definition diff --git a/src/devices/bus/cpc/cpc_pds.cpp b/src/devices/bus/cpc/cpc_pds.cpp index 292efd3f7cf..311bca693cb 100644 --- a/src/devices/bus/cpc/cpc_pds.cpp +++ b/src/devices/bus/cpc/cpc_pds.cpp @@ -35,7 +35,7 @@ machine_config_constructor cpc_pds_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -cpc_pds_device::cpc_pds_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_pds_device::cpc_pds_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_PDS, "Programmers Development System (CPC Target)", tag, owner, clock, "cpc_pds", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_pio(*this,"pio") diff --git a/src/devices/bus/cpc/cpc_pds.h b/src/devices/bus/cpc/cpc_pds.h index 54d68e431fd..9111889cfcc 100644 --- a/src/devices/bus/cpc/cpc_pds.h +++ b/src/devices/bus/cpc/cpc_pds.h @@ -33,7 +33,7 @@ class cpc_pds_device : public device_t, { public: // construction/destruction - cpc_pds_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_pds_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; diff --git a/src/devices/bus/cpc/cpc_rom.cpp b/src/devices/bus/cpc/cpc_rom.cpp index 9b68acbe422..766c6b8277e 100644 --- a/src/devices/bus/cpc/cpc_rom.cpp +++ b/src/devices/bus/cpc/cpc_rom.cpp @@ -47,7 +47,7 @@ machine_config_constructor cpc_rom_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -cpc_rom_device::cpc_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_rom_device::cpc_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_ROM, "ROM Box", tag, owner, clock, "cpc_rom", __FILE__), device_cpc_expansion_card_interface(mconfig, *this) { @@ -79,7 +79,7 @@ const device_type ROMSLOT = &device_creator; // rom_image_device - constructor //------------------------------------------------- -rom_image_device::rom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rom_image_device::rom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ROMSLOT, "ROM image", tag, owner, clock, "rom_image", __FILE__), device_image_interface(mconfig, *this), m_base(nullptr) { @@ -108,9 +108,9 @@ void rom_image_device::device_start() image_init_result rom_image_device::call_load() { device_image_interface* image = this; - UINT64 size = image->length(); + uint64_t size = image->length(); - m_base = std::make_unique(16384); + m_base = std::make_unique(16384); if(size <= 16384) { image->fread(m_base.get(),size); diff --git a/src/devices/bus/cpc/cpc_rom.h b/src/devices/bus/cpc/cpc_rom.h index 86cd429cbcd..f20cbd2dbb7 100644 --- a/src/devices/bus/cpc/cpc_rom.h +++ b/src/devices/bus/cpc/cpc_rom.h @@ -21,7 +21,7 @@ class rom_image_device : public device_t, { public: // construction/destruction - rom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~rom_image_device(); // image-level overrides @@ -38,7 +38,7 @@ public: virtual const char *image_interface() const override { return "cpc_rom"; } virtual const char *file_extensions() const override { return "rom,bin"; } - UINT8* base() { return m_base.get(); } + uint8_t* base() { return m_base.get(); } protected: // device-level overrides @@ -46,7 +46,7 @@ protected: virtual void device_start() override; private: - std::unique_ptr m_base; + std::unique_ptr m_base; }; @@ -64,12 +64,12 @@ class cpc_rom_device : public device_t, { public: // construction/destruction - cpc_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_rom_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; - UINT8* base(UINT8 slot) { if(slot >=1 && slot <= 8) return m_rom[slot]->base(); else return nullptr; } + uint8_t* base(uint8_t slot) { if(slot >=1 && slot <= 8) return m_rom[slot]->base(); else return nullptr; } protected: // device-level overrides diff --git a/src/devices/bus/cpc/cpc_rs232.cpp b/src/devices/bus/cpc/cpc_rs232.cpp index 225c83c79d1..00090ace9aa 100644 --- a/src/devices/bus/cpc/cpc_rs232.cpp +++ b/src/devices/bus/cpc/cpc_rs232.cpp @@ -80,7 +80,7 @@ const tiny_rom_entry *cpc_ams_rs232_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -cpc_rs232_device::cpc_rs232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_rs232_device::cpc_rs232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_RS232, "Pace RS232C interface", tag, owner, clock, "cpc_ser", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_pit(*this,"pit"), @@ -89,7 +89,7 @@ cpc_rs232_device::cpc_rs232_device(const machine_config &mconfig, const char *ta { } -cpc_rs232_device::cpc_rs232_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) : +cpc_rs232_device::cpc_rs232_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_cpc_expansion_card_interface(mconfig, *this), m_pit(*this,"pit"), @@ -98,7 +98,7 @@ cpc_rs232_device::cpc_rs232_device(const machine_config &mconfig, device_type ty { } -cpc_ams_rs232_device::cpc_ams_rs232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_ams_rs232_device::cpc_ams_rs232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpc_rs232_device(mconfig, CPC_RS232_AMS, "Amstrad RS232C interface", tag, owner, clock, "cpc_serams", __FILE__) { } diff --git a/src/devices/bus/cpc/cpc_rs232.h b/src/devices/bus/cpc/cpc_rs232.h index e21d6357d88..816e8315f0a 100644 --- a/src/devices/bus/cpc/cpc_rs232.h +++ b/src/devices/bus/cpc/cpc_rs232.h @@ -20,8 +20,8 @@ class cpc_rs232_device : public device_t, { public: // construction/destruction - cpc_rs232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - cpc_rs232_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); + cpc_rs232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + cpc_rs232_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -52,7 +52,7 @@ class cpc_ams_rs232_device : public cpc_rs232_device { public: // construction/destruction - cpc_ams_rs232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_ams_rs232_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/devices/bus/cpc/cpc_ssa1.cpp b/src/devices/bus/cpc/cpc_ssa1.cpp index f2f0f61cb56..9779f4b96da 100644 --- a/src/devices/bus/cpc/cpc_ssa1.cpp +++ b/src/devices/bus/cpc/cpc_ssa1.cpp @@ -25,7 +25,7 @@ const device_type CPC_DKSPEECH = &device_creator; READ8_MEMBER(cpc_ssa1_device::ssa1_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; if(get_sby() == 0) ret &= ~0x80; @@ -43,7 +43,7 @@ WRITE8_MEMBER(cpc_ssa1_device::ssa1_w) READ8_MEMBER(cpc_dkspeech_device::dkspeech_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; // SBY is not connected @@ -158,7 +158,7 @@ machine_config_constructor cpc_dkspeech_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -cpc_ssa1_device::cpc_ssa1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_ssa1_device::cpc_ssa1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_SSA1, "SSA-1", tag, owner, clock, "cpc_ssa1", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_rom(nullptr), m_lrq(1), m_sby(0), @@ -166,7 +166,7 @@ cpc_ssa1_device::cpc_ssa1_device(const machine_config &mconfig, const char *tag, { } -cpc_dkspeech_device::cpc_dkspeech_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_dkspeech_device::cpc_dkspeech_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_DKSPEECH, "DK'Tronics Speech Synthesiser", tag, owner, clock, "cpc_dkspeech", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_rom(nullptr), m_lrq(1), m_sby(0), diff --git a/src/devices/bus/cpc/cpc_ssa1.h b/src/devices/bus/cpc/cpc_ssa1.h index 813d304a9e4..d437091006a 100644 --- a/src/devices/bus/cpc/cpc_ssa1.h +++ b/src/devices/bus/cpc/cpc_ssa1.h @@ -53,16 +53,16 @@ class cpc_ssa1_device : public device_t, { public: // construction/destruction - cpc_ssa1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_ssa1_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; virtual machine_config_constructor device_mconfig_additions() const override; - void set_lrq(UINT8 state) { m_lrq = state; } - UINT8 get_lrq() { return m_lrq; } - void set_sby(UINT8 state) { m_sby = state; } - UINT8 get_sby() { return m_sby; } + void set_lrq(uint8_t state) { m_lrq = state; } + uint8_t get_lrq() { return m_lrq; } + void set_sby(uint8_t state) { m_sby = state; } + uint8_t get_sby() { return m_sby; } DECLARE_READ8_MEMBER(ssa1_r); DECLARE_WRITE8_MEMBER(ssa1_w); @@ -77,9 +77,9 @@ protected: private: cpc_expansion_slot_device *m_slot; - UINT8 *m_rom; - UINT8 m_lrq; - UINT8 m_sby; + uint8_t *m_rom; + uint8_t m_lrq; + uint8_t m_sby; required_device m_sp0256_device; }; @@ -89,16 +89,16 @@ class cpc_dkspeech_device : public device_t, { public: // construction/destruction - cpc_dkspeech_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_dkspeech_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; virtual machine_config_constructor device_mconfig_additions() const override; - void set_lrq(UINT8 state) { m_lrq = state; } - UINT8 get_lrq() { return m_lrq; } - void set_sby(UINT8 state) { m_sby = state; } - UINT8 get_sby() { return m_sby; } + void set_lrq(uint8_t state) { m_lrq = state; } + uint8_t get_lrq() { return m_lrq; } + void set_sby(uint8_t state) { m_sby = state; } + uint8_t get_sby() { return m_sby; } DECLARE_READ8_MEMBER(dkspeech_r); DECLARE_WRITE8_MEMBER(dkspeech_w); @@ -113,9 +113,9 @@ protected: private: cpc_expansion_slot_device *m_slot; - UINT8 *m_rom; - UINT8 m_lrq; - UINT8 m_sby; + uint8_t *m_rom; + uint8_t m_lrq; + uint8_t m_sby; required_device m_sp0256_device; }; diff --git a/src/devices/bus/cpc/cpcexp.cpp b/src/devices/bus/cpc/cpcexp.cpp index 43b35ac57f2..2e4f0c558a3 100644 --- a/src/devices/bus/cpc/cpcexp.cpp +++ b/src/devices/bus/cpc/cpcexp.cpp @@ -41,7 +41,7 @@ device_cpc_expansion_card_interface::~device_cpc_expansion_card_interface() // LIVE DEVICE //************************************************************************** -cpc_expansion_slot_device::cpc_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_expansion_slot_device::cpc_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_EXPANSION_SLOT, "Amstrad CPC expansion port", tag, owner, clock, "cpc_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_out_irq_cb(*this), diff --git a/src/devices/bus/cpc/cpcexp.h b/src/devices/bus/cpc/cpcexp.h index ffde80ef655..7825dfefbca 100644 --- a/src/devices/bus/cpc/cpcexp.h +++ b/src/devices/bus/cpc/cpcexp.h @@ -101,12 +101,12 @@ public: virtual WRITE_LINE_MEMBER( cursor_w ) { }; virtual WRITE_LINE_MEMBER( romen_w ) { }; - void set_rom_bank(UINT8 sel) { m_rom_sel = sel; } // tell device the currently selected ROM - UINT8 get_rom_bank() { return m_rom_sel; } - virtual void set_mapping(UINT8 type) { }; + void set_rom_bank(uint8_t sel) { m_rom_sel = sel; } // tell device the currently selected ROM + uint8_t get_rom_bank() { return m_rom_sel; } + virtual void set_mapping(uint8_t type) { }; private: - UINT8 m_rom_sel; // currently selected ROM + uint8_t m_rom_sel; // currently selected ROM }; @@ -117,7 +117,7 @@ class cpc_expansion_slot_device : public device_t, { public: // construction/destruction - cpc_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~cpc_expansion_slot_device(); template static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_cb.set_callback(object); } @@ -132,8 +132,8 @@ public: DECLARE_WRITE_LINE_MEMBER( romdis_w ); DECLARE_WRITE8_MEMBER( rom_select ); - void set_rom_bank(UINT8 sel) { if(m_card) m_card->set_rom_bank(sel); } // tell device the currently selected ROM - void set_mapping(UINT8 type) { if(m_card) m_card->set_mapping(type); } // tell device to enable any ROM or RAM mapping + void set_rom_bank(uint8_t sel) { if(m_card) m_card->set_rom_bank(sel); } // tell device the currently selected ROM + void set_mapping(uint8_t type) { if(m_card) m_card->set_mapping(type); } // tell device to enable any ROM or RAM mapping DECLARE_WRITE_LINE_MEMBER( cursor_w ) { if(m_card) m_card->cursor_w(state); } // pass on CRTC Cursor signal DECLARE_WRITE_LINE_MEMBER( romen_w ) { if(m_card) m_card->romen_w(state); } // pass on /ROMEN signal diff --git a/src/devices/bus/cpc/ddi1.cpp b/src/devices/bus/cpc/ddi1.cpp index f0bf519a2e5..ef21cb9f319 100644 --- a/src/devices/bus/cpc/ddi1.cpp +++ b/src/devices/bus/cpc/ddi1.cpp @@ -61,7 +61,7 @@ machine_config_constructor cpc_ddi1_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -cpc_ddi1_device::cpc_ddi1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_ddi1_device::cpc_ddi1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_DDI1, "DDI-1", tag, owner, clock, "cpc_ddi1", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_fdc(*this,"upd765"), @@ -127,7 +127,7 @@ WRITE8_MEMBER(cpc_ddi1_device::fdc_w) READ8_MEMBER(cpc_ddi1_device::fdc_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch(offset) { @@ -150,13 +150,13 @@ WRITE8_MEMBER(cpc_ddi1_device::rombank_w) m_slot->rom_select(space,0,data); } -void cpc_ddi1_device::set_mapping(UINT8 type) +void cpc_ddi1_device::set_mapping(uint8_t type) { if(type != MAP_UPPER) return; if(m_rom_active) { - UINT8* ROM = memregion("disc_rom")->base(); + uint8_t* ROM = memregion("disc_rom")->base(); membank(":bank7")->set_base(ROM); membank(":bank8")->set_base(ROM+0x2000); } diff --git a/src/devices/bus/cpc/ddi1.h b/src/devices/bus/cpc/ddi1.h index 776bb833b7f..fbe6de3605e 100644 --- a/src/devices/bus/cpc/ddi1.h +++ b/src/devices/bus/cpc/ddi1.h @@ -20,12 +20,12 @@ class cpc_ddi1_device : public device_t, { public: // construction/destruction - cpc_ddi1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_ddi1_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; virtual machine_config_constructor device_mconfig_additions() const override; - virtual void set_mapping(UINT8 type) override; + virtual void set_mapping(uint8_t type) override; virtual WRITE_LINE_MEMBER( romen_w ) override { m_romen = state; } DECLARE_WRITE8_MEMBER(motor_w); diff --git a/src/devices/bus/cpc/doubler.cpp b/src/devices/bus/cpc/doubler.cpp index 632130dc08f..79d47383b6c 100644 --- a/src/devices/bus/cpc/doubler.cpp +++ b/src/devices/bus/cpc/doubler.cpp @@ -36,7 +36,7 @@ machine_config_constructor cpc_doubler_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -cpc_doubler_device::cpc_doubler_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_doubler_device::cpc_doubler_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_DOUBLER, "Draysoft Doubler", tag, owner, clock, "cpc_doubler", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_tape(*this,"doubler_tape") @@ -67,7 +67,7 @@ void cpc_doubler_device::device_reset() READ8_MEMBER(cpc_doubler_device::ext_tape_r) { - UINT8 data = 0; + uint8_t data = 0; if(m_tape->input() > 0.03) data |= 0x20; return data; diff --git a/src/devices/bus/cpc/doubler.h b/src/devices/bus/cpc/doubler.h index 6c429618789..6685698f4a6 100644 --- a/src/devices/bus/cpc/doubler.h +++ b/src/devices/bus/cpc/doubler.h @@ -21,7 +21,7 @@ class cpc_doubler_device : public device_t, { public: // construction/destruction - cpc_doubler_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_doubler_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; diff --git a/src/devices/bus/cpc/hd20.cpp b/src/devices/bus/cpc/hd20.cpp index 58ce8a8658b..163687d41c7 100644 --- a/src/devices/bus/cpc/hd20.cpp +++ b/src/devices/bus/cpc/hd20.cpp @@ -48,7 +48,7 @@ const tiny_rom_entry *cpc_hd20_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -cpc_hd20_device::cpc_hd20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_hd20_device::cpc_hd20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_HD20, "Dobbertin HD20", tag, owner, clock, "cpc_hd20", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_hdc(*this,"hdc") @@ -80,7 +80,7 @@ void cpc_hd20_device::device_reset() READ8_MEMBER(cpc_hd20_device::hdc_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; switch(offset) { diff --git a/src/devices/bus/cpc/hd20.h b/src/devices/bus/cpc/hd20.h index 69a3afdb5ff..467a28646dc 100644 --- a/src/devices/bus/cpc/hd20.h +++ b/src/devices/bus/cpc/hd20.h @@ -23,7 +23,7 @@ class cpc_hd20_device : public device_t, { public: // construction/destruction - cpc_hd20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_hd20_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; diff --git a/src/devices/bus/cpc/magicsound.cpp b/src/devices/bus/cpc/magicsound.cpp index 711c7978aa3..b80b9218884 100644 --- a/src/devices/bus/cpc/magicsound.cpp +++ b/src/devices/bus/cpc/magicsound.cpp @@ -72,7 +72,7 @@ machine_config_constructor al_magicsound_device::device_mconfig_additions() cons // LIVE DEVICE //************************************************************************** -al_magicsound_device::al_magicsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +al_magicsound_device::al_magicsound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AL_MAGICSOUND, "Magic Sound Board", tag, owner, clock, "al_magicsound", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_dac(*this,"dac"), @@ -142,8 +142,8 @@ WRITE8_MEMBER(al_magicsound_device::volume_w) WRITE8_MEMBER(al_magicsound_device::mapper_w) { - UINT8 channel = (offset & 0x0c) >> 2; - UINT8 page = offset & 0x03; + uint8_t channel = (offset & 0x0c) >> 2; + uint8_t page = offset & 0x03; m_page[channel][page] = (~(data) & 0x3f) * 0x4000; set_timer_gate(true); } @@ -167,8 +167,8 @@ WRITE_LINE_MEMBER(al_magicsound_device::sam3_w) { m_current_channel = 3; if(m_da READ8_MEMBER(al_magicsound_device::dma_read_byte) { - UINT8 ret = 0xff; - UINT8 page = (offset & 0xc000) >> 14; + uint8_t ret = 0xff; + uint8_t page = (offset & 0xc000) >> 14; if(m_current_channel != -1) ret = m_ramptr->read(m_page[m_current_channel][page] + (offset & 0x3fff)); diff --git a/src/devices/bus/cpc/magicsound.h b/src/devices/bus/cpc/magicsound.h index 1c52a186f54..22ab6e2c055 100644 --- a/src/devices/bus/cpc/magicsound.h +++ b/src/devices/bus/cpc/magicsound.h @@ -38,7 +38,7 @@ class al_magicsound_device : public device_t, { public: // construction/destruction - al_magicsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + al_magicsound_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; @@ -75,13 +75,13 @@ private: void set_timer_gate(bool state); - UINT8 m_volume[4]; - UINT32 m_page[4][4]; - UINT8 m_output[4]; + uint8_t m_volume[4]; + uint32_t m_page[4][4]; + uint8_t m_output[4]; bool m_dack[4]; - INT8 m_current_channel; + int8_t m_current_channel; ram_device* m_ramptr; - UINT8 m_current_output; + uint8_t m_current_output; }; // device type definition diff --git a/src/devices/bus/cpc/mface2.cpp b/src/devices/bus/cpc/mface2.cpp index 6d9f9e6324f..769b2c82fa2 100644 --- a/src/devices/bus/cpc/mface2.cpp +++ b/src/devices/bus/cpc/mface2.cpp @@ -163,7 +163,7 @@ void cpc_multiface2_device::multiface_stop() } /* any io writes are passed through here */ -int cpc_multiface2_device::multiface_io_write(UINT16 offset, UINT8 data) +int cpc_multiface2_device::multiface_io_write(uint16_t offset, uint8_t data) { int ret = 0; @@ -308,7 +308,7 @@ ioport_constructor cpc_multiface2_device::device_input_ports() const // LIVE DEVICE //************************************************************************** -cpc_multiface2_device::cpc_multiface2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_multiface2_device::cpc_multiface2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_MFACE2, "Multiface II", tag, owner, clock, "cpc_mf2", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_multiface_ram(nullptr), m_multiface_flags(0), m_romdis(0) { @@ -326,7 +326,7 @@ void cpc_multiface2_device::device_start() m_multiface_flags = MULTIFACE_VISIBLE; /* allocate ram */ - m_multiface_ram = std::make_unique(8192); + m_multiface_ram = std::make_unique(8192); } //------------------------------------------------- diff --git a/src/devices/bus/cpc/mface2.h b/src/devices/bus/cpc/mface2.h index 8ed2724034d..513af2ee3c5 100644 --- a/src/devices/bus/cpc/mface2.h +++ b/src/devices/bus/cpc/mface2.h @@ -36,7 +36,7 @@ class cpc_multiface2_device : public device_t, { public: // construction/destruction - cpc_multiface2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_multiface2_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; @@ -46,7 +46,7 @@ public: int multiface_hardware_enabled(); void multiface_rethink_memory(); void multiface_stop(); - int multiface_io_write(UINT16 offset, UINT8 data); + int multiface_io_write(uint16_t offset, uint8_t data); void check_button_state(); protected: // device-level overrides @@ -59,10 +59,10 @@ private: DIRECT_UPDATE_MEMBER( amstrad_default ); DIRECT_UPDATE_MEMBER( amstrad_multiface_directoverride ); - std::unique_ptr m_multiface_ram; + std::unique_ptr m_multiface_ram; unsigned long m_multiface_flags; - UINT8 m_romdis; + uint8_t m_romdis; }; // device type definition diff --git a/src/devices/bus/cpc/playcity.cpp b/src/devices/bus/cpc/playcity.cpp index 181a8fb3b0b..eece3a9c2d7 100644 --- a/src/devices/bus/cpc/playcity.cpp +++ b/src/devices/bus/cpc/playcity.cpp @@ -52,7 +52,7 @@ machine_config_constructor cpc_playcity_device::device_mconfig_additions() const // LIVE DEVICE //************************************************************************** -cpc_playcity_device::cpc_playcity_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_playcity_device::cpc_playcity_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_PLAYCITY, "PlayCity", tag, owner, clock, "cpc_playcity", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_ctc(*this,"ctc"), @@ -132,8 +132,8 @@ READ8_MEMBER(cpc_playcity_device::ymz2_data_r) void cpc_playcity_device::update_ymz_clock() { // Bit of a hack job here, since there is no way currently to connect the CTC channel output directly to the YMZ clocks. - UINT8 rate = m_ctc->get_channel_constant(0); - UINT32 clk = XTAL_4MHz; + uint8_t rate = m_ctc->get_channel_constant(0); + uint32_t clk = XTAL_4MHz; switch(rate) { diff --git a/src/devices/bus/cpc/playcity.h b/src/devices/bus/cpc/playcity.h index 757ffb23c45..dbf4f9f09fa 100644 --- a/src/devices/bus/cpc/playcity.h +++ b/src/devices/bus/cpc/playcity.h @@ -28,7 +28,7 @@ class cpc_playcity_device : public device_t, { public: // construction/destruction - cpc_playcity_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_playcity_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; diff --git a/src/devices/bus/cpc/smartwatch.cpp b/src/devices/bus/cpc/smartwatch.cpp index dfd0ad2a3cf..f7ae8148037 100644 --- a/src/devices/bus/cpc/smartwatch.cpp +++ b/src/devices/bus/cpc/smartwatch.cpp @@ -45,7 +45,7 @@ const tiny_rom_entry *cpc_smartwatch_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -cpc_smartwatch_device::cpc_smartwatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_smartwatch_device::cpc_smartwatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_SMARTWATCH, "Dobbertin Smartwatch", tag, owner, clock, "cpc_smartwatch", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_rtc(*this,"rtc"), m_bank(nullptr) @@ -76,7 +76,7 @@ void cpc_smartwatch_device::device_reset() READ8_MEMBER(cpc_smartwatch_device::rtc_w) { - UINT8* bank = (UINT8*)m_bank->base(); + uint8_t* bank = (uint8_t*)m_bank->base(); if(offset & 1) m_rtc->read_1(space,0); else @@ -86,6 +86,6 @@ READ8_MEMBER(cpc_smartwatch_device::rtc_w) READ8_MEMBER(cpc_smartwatch_device::rtc_r) { - UINT8* bank = (UINT8*)m_bank->base(); + uint8_t* bank = (uint8_t*)m_bank->base(); return ((bank[(offset & 1)+4]) & 0xfe) | (m_rtc->read_data(space,0) & 0x01); } diff --git a/src/devices/bus/cpc/smartwatch.h b/src/devices/bus/cpc/smartwatch.h index 3842819cb94..bf62d040c8a 100644 --- a/src/devices/bus/cpc/smartwatch.h +++ b/src/devices/bus/cpc/smartwatch.h @@ -21,7 +21,7 @@ class cpc_smartwatch_device : public device_t, { public: // construction/destruction - cpc_smartwatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_smartwatch_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; diff --git a/src/devices/bus/cpc/symbfac2.cpp b/src/devices/bus/cpc/symbfac2.cpp index a1df95d48fd..9d466f41a85 100644 --- a/src/devices/bus/cpc/symbfac2.cpp +++ b/src/devices/bus/cpc/symbfac2.cpp @@ -71,7 +71,7 @@ ioport_constructor cpc_symbiface2_device::device_input_ports() const // LIVE DEVICE //************************************************************************** -cpc_symbiface2_device::cpc_symbiface2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_symbiface2_device::cpc_symbiface2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_SYMBIFACE2, "SYMBiFACE II", tag, owner, clock, "cpc_symf2", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_ide(*this,"ide"), @@ -214,7 +214,7 @@ WRITE8_MEMBER(cpc_symbiface2_device::rtc_w) */ READ8_MEMBER(cpc_symbiface2_device::mouse_r) { - UINT8 ret = 0; + uint8_t ret = 0; int input; int input_diff; @@ -268,15 +268,15 @@ INPUT_CHANGED_MEMBER(cpc_symbiface2_device::mouse_change_buttons) // #FD17 (read) - map currently selected ROM to 0x4000 for read/write READ8_MEMBER(cpc_symbiface2_device::rom_rewrite_r) { - UINT8 bank = get_rom_bank(); + uint8_t bank = get_rom_bank(); if(bank >= 32) return 0xff; - m_4xxx_ptr_r = (UINT8*)machine().root_device().membank("bank3")->base(); - m_4xxx_ptr_w = (UINT8*)machine().root_device().membank("bank11")->base(); - m_6xxx_ptr_r = (UINT8*)machine().root_device().membank("bank4")->base(); - m_6xxx_ptr_w = (UINT8*)machine().root_device().membank("bank12")->base(); + m_4xxx_ptr_r = (uint8_t*)machine().root_device().membank("bank3")->base(); + m_4xxx_ptr_w = (uint8_t*)machine().root_device().membank("bank11")->base(); + m_6xxx_ptr_r = (uint8_t*)machine().root_device().membank("bank4")->base(); + m_6xxx_ptr_w = (uint8_t*)machine().root_device().membank("bank12")->base(); machine().root_device().membank("bank3")->set_base(&m_rom_space[bank*16384]); machine().root_device().membank("bank4")->set_base(&m_rom_space[bank*16384+8192]); machine().root_device().membank("bank11")->set_base(&m_rom_space[bank*16384]); diff --git a/src/devices/bus/cpc/symbfac2.h b/src/devices/bus/cpc/symbfac2.h index 5f5671485aa..fba811b40b2 100644 --- a/src/devices/bus/cpc/symbfac2.h +++ b/src/devices/bus/cpc/symbfac2.h @@ -20,7 +20,7 @@ class cpc_symbiface2_device : public device_t, { public: // construction/destruction - cpc_symbiface2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_symbiface2_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; @@ -62,20 +62,20 @@ private: required_ioport m_mouse_y; required_ioport m_mouse_buttons; - std::vector m_rom_space; + std::vector m_rom_space; bool m_iohigh; - UINT16 m_ide_data; + uint16_t m_ide_data; - UINT8 m_mouse_state; - UINT8 m_input_x; - UINT8 m_input_y; + uint8_t m_mouse_state; + uint8_t m_input_x; + uint8_t m_input_y; // stores backup pointers so that mapping can be restored - UINT8* m_4xxx_ptr_r; - UINT8* m_4xxx_ptr_w; - UINT8* m_6xxx_ptr_r; - UINT8* m_6xxx_ptr_w; + uint8_t* m_4xxx_ptr_r; + uint8_t* m_4xxx_ptr_w; + uint8_t* m_6xxx_ptr_r; + uint8_t* m_6xxx_ptr_w; }; // device type definition diff --git a/src/devices/bus/cpc/transtape.cpp b/src/devices/bus/cpc/transtape.cpp index 2735536f95f..1b3056d12c9 100644 --- a/src/devices/bus/cpc/transtape.cpp +++ b/src/devices/bus/cpc/transtape.cpp @@ -42,7 +42,7 @@ ioport_constructor cpc_transtape_device::device_input_ports() const // LIVE DEVICE //************************************************************************** -cpc_transtape_device::cpc_transtape_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cpc_transtape_device::cpc_transtape_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPC_TRANSTAPE, "HM Transtape", tag, owner, clock, "cpc_transtape", __FILE__), device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_cpu(nullptr), m_space(nullptr), m_ram(nullptr), m_rom_active(false), @@ -61,7 +61,7 @@ void cpc_transtape_device::device_start() m_cpu = static_cast(machine().device("maincpu")); m_space = &m_cpu->space(AS_IO); - m_ram = make_unique_clear(0x2000); + m_ram = make_unique_clear(0x2000); m_space->install_write_handler(0xfbf0,0xfbf0,write8_delegate(FUNC(cpc_transtape_device::output_w),this)); m_space->install_read_handler(0xfbff,0xfbff,read8_delegate(FUNC(cpc_transtape_device::input_r),this)); @@ -80,7 +80,7 @@ void cpc_transtape_device::device_reset() void cpc_transtape_device::map_enable() { - UINT8* ROM = memregion("tt_rom")->base(); + uint8_t* ROM = memregion("tt_rom")->base(); if(m_output & 0x02) // ROM enable { membank(":bank1")->set_base(ROM); @@ -130,7 +130,7 @@ WRITE8_MEMBER(cpc_transtape_device::output_w) m_slot->rom_select(space,0,get_rom_bank()); // trigger rethink } -void cpc_transtape_device::set_mapping(UINT8 type) +void cpc_transtape_device::set_mapping(uint8_t type) { if(type != MAP_OTHER) return; diff --git a/src/devices/bus/cpc/transtape.h b/src/devices/bus/cpc/transtape.h index 75fb06b03ca..bc73b843e96 100644 --- a/src/devices/bus/cpc/transtape.h +++ b/src/devices/bus/cpc/transtape.h @@ -18,13 +18,13 @@ class cpc_transtape_device : public device_t, { public: // construction/destruction - cpc_transtape_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cpc_transtape_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; virtual ioport_constructor device_input_ports() const override; - virtual void set_mapping(UINT8 type) override; + virtual void set_mapping(uint8_t type) override; virtual WRITE_LINE_MEMBER( romen_w ) override { m_romen = state; } DECLARE_READ8_MEMBER(input_r); @@ -41,10 +41,10 @@ private: cpc_expansion_slot_device *m_slot; cpu_device* m_cpu; address_space* m_space; - std::unique_ptr m_ram; // 8kB internal RAM + std::unique_ptr m_ram; // 8kB internal RAM bool m_rom_active; bool m_romen; - UINT8 m_output; + uint8_t m_output; void map_enable(); }; diff --git a/src/devices/bus/crvision/rom.cpp b/src/devices/bus/crvision/rom.cpp index 875a2b40fbc..0f54308df9c 100644 --- a/src/devices/bus/crvision/rom.cpp +++ b/src/devices/bus/crvision/rom.cpp @@ -26,44 +26,44 @@ const device_type CRVISION_ROM_16K = &device_creator; const device_type CRVISION_ROM_18K = &device_creator; -crvision_rom_device::crvision_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +crvision_rom_device::crvision_rom_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_crvision_cart_interface(mconfig, *this) { } -crvision_rom_device::crvision_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crvision_rom_device::crvision_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CRVISION_ROM_4K, "CreatiVision 4K Carts", tag, owner, clock, "crvision_4k", __FILE__), device_crvision_cart_interface(mconfig, *this) { } -crvision_rom6k_device::crvision_rom6k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crvision_rom6k_device::crvision_rom6k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : crvision_rom_device(mconfig, CRVISION_ROM_6K, "CreatiVision 6K Carts", tag, owner, clock, "crvision_6k", __FILE__) { } -crvision_rom8k_device::crvision_rom8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crvision_rom8k_device::crvision_rom8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : crvision_rom_device(mconfig, CRVISION_ROM_8K, "CreatiVision 8K Carts", tag, owner, clock, "crvision_8k", __FILE__) { } -crvision_rom10k_device::crvision_rom10k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crvision_rom10k_device::crvision_rom10k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : crvision_rom_device(mconfig, CRVISION_ROM_10K, "CreatiVision 10K Carts", tag, owner, clock, "crvision_10k", __FILE__) { } -crvision_rom12k_device::crvision_rom12k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crvision_rom12k_device::crvision_rom12k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : crvision_rom_device(mconfig, CRVISION_ROM_12K, "CreatiVision 12K Carts", tag, owner, clock, "crvision_12k", __FILE__) { } -crvision_rom16k_device::crvision_rom16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crvision_rom16k_device::crvision_rom16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : crvision_rom_device(mconfig, CRVISION_ROM_16K, "CreatiVision 16K Carts", tag, owner, clock, "crvision_16k", __FILE__) { } -crvision_rom18k_device::crvision_rom18k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crvision_rom18k_device::crvision_rom18k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : crvision_rom_device(mconfig, CRVISION_ROM_18K, "CreatiVision 18K Carts", tag, owner, clock, "crvision_18k", __FILE__) { } diff --git a/src/devices/bus/crvision/rom.h b/src/devices/bus/crvision/rom.h index 8a025d6c5d1..c557389ec97 100644 --- a/src/devices/bus/crvision/rom.h +++ b/src/devices/bus/crvision/rom.h @@ -13,8 +13,8 @@ class crvision_rom_device : public device_t, { public: // construction/destruction - crvision_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - crvision_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crvision_rom_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); + crvision_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -30,7 +30,7 @@ class crvision_rom6k_device : public crvision_rom_device { public: // construction/destruction - crvision_rom6k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crvision_rom6k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom80) override; @@ -42,7 +42,7 @@ class crvision_rom8k_device : public crvision_rom_device { public: // construction/destruction - crvision_rom8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crvision_rom8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom80) override; @@ -54,7 +54,7 @@ class crvision_rom10k_device : public crvision_rom_device { public: // construction/destruction - crvision_rom10k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crvision_rom10k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom40) override; @@ -67,7 +67,7 @@ class crvision_rom12k_device : public crvision_rom_device { public: // construction/destruction - crvision_rom12k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crvision_rom12k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom40) override; @@ -80,7 +80,7 @@ class crvision_rom16k_device : public crvision_rom_device { public: // construction/destruction - crvision_rom16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crvision_rom16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom80) override; @@ -92,7 +92,7 @@ class crvision_rom18k_device : public crvision_rom_device { public: // construction/destruction - crvision_rom18k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crvision_rom18k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom40) override; diff --git a/src/devices/bus/crvision/slot.cpp b/src/devices/bus/crvision/slot.cpp index 7f12a9cf5af..1177bb40cd7 100644 --- a/src/devices/bus/crvision/slot.cpp +++ b/src/devices/bus/crvision/slot.cpp @@ -45,7 +45,7 @@ device_crvision_cart_interface::~device_crvision_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_crvision_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_crvision_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -62,7 +62,7 @@ void device_crvision_cart_interface::rom_alloc(UINT32 size, const char *tag) //------------------------------------------------- // crvision_cart_slot_device - constructor //------------------------------------------------- -crvision_cart_slot_device::crvision_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +crvision_cart_slot_device::crvision_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CRVISION_CART_SLOT, "CreatiVision Cartridge Slot", tag, owner, clock, "crvision_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -154,7 +154,7 @@ image_init_result crvision_cart_slot_device::call_load() { if (m_cart) { - UINT32 size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); if (size > 0x4800) { @@ -223,7 +223,7 @@ std::string crvision_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 size = m_file->size(); + uint32_t size = m_file->size(); int type = CRV_4K; switch (size) diff --git a/src/devices/bus/crvision/slot.h b/src/devices/bus/crvision/slot.h index 7643ca7fb1b..814a20e7579 100644 --- a/src/devices/bus/crvision/slot.h +++ b/src/devices/bus/crvision/slot.h @@ -37,14 +37,14 @@ public: virtual DECLARE_READ8_MEMBER(read_rom40) { return 0xff; } virtual DECLARE_READ8_MEMBER(read_rom80) { return 0xff; } - void rom_alloc(UINT32 size, const char *tag); - UINT8* get_rom_base() { return m_rom; } - UINT32 get_rom_size() { return m_rom_size; } + void rom_alloc(uint32_t size, const char *tag); + uint8_t* get_rom_base() { return m_rom; } + uint32_t get_rom_size() { return m_rom_size; } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; + uint8_t *m_rom; + uint32_t m_rom_size; }; @@ -56,7 +56,7 @@ class crvision_cart_slot_device : public device_t, { public: // construction/destruction - crvision_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crvision_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~crvision_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/dmv/dmvbus.cpp b/src/devices/bus/dmv/dmvbus.cpp index ab1b079405d..121eeafaafa 100644 --- a/src/devices/bus/dmv/dmvbus.cpp +++ b/src/devices/bus/dmv/dmvbus.cpp @@ -194,7 +194,7 @@ device_dmvslot_interface::~device_dmvslot_interface() //------------------------------------------------- // dmvcart_slot_device - constructor //------------------------------------------------- -dmvcart_slot_device::dmvcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dmvcart_slot_device::dmvcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMVCART_SLOT, "Decision Mate V cartridge slot", tag, owner, clock, "dmvcart_slot", __FILE__), device_slot_interface(mconfig, *this), m_prog_read_cb(*this), @@ -234,7 +234,7 @@ void dmvcart_slot_device::device_start() read -------------------------------------------------*/ -bool dmvcart_slot_device::read(offs_t offset, UINT8 &data) +bool dmvcart_slot_device::read(offs_t offset, uint8_t &data) { if (m_cart) return m_cart->read(offset, data); @@ -245,7 +245,7 @@ bool dmvcart_slot_device::read(offs_t offset, UINT8 &data) write -------------------------------------------------*/ -bool dmvcart_slot_device::write(offs_t offset, UINT8 data) +bool dmvcart_slot_device::write(offs_t offset, uint8_t data) { if (m_cart) return m_cart->write(offset, data); @@ -256,7 +256,7 @@ bool dmvcart_slot_device::write(offs_t offset, UINT8 data) read -------------------------------------------------*/ -void dmvcart_slot_device::ram_read(UINT8 cas, offs_t offset, UINT8 &data) +void dmvcart_slot_device::ram_read(uint8_t cas, offs_t offset, uint8_t &data) { if (m_cart) m_cart->ram_read(cas, offset, data); @@ -266,7 +266,7 @@ void dmvcart_slot_device::ram_read(UINT8 cas, offs_t offset, UINT8 &data) write -------------------------------------------------*/ -void dmvcart_slot_device::ram_write(UINT8 cas, offs_t offset, UINT8 data) +void dmvcart_slot_device::ram_write(uint8_t cas, offs_t offset, uint8_t data) { if (m_cart) return m_cart->ram_write(cas, offset, data); @@ -276,7 +276,7 @@ void dmvcart_slot_device::ram_write(UINT8 cas, offs_t offset, UINT8 data) IO read -------------------------------------------------*/ -void dmvcart_slot_device::io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) +void dmvcart_slot_device::io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) { if (m_cart) m_cart->io_read(space, ifsel, offset, data); @@ -287,7 +287,7 @@ void dmvcart_slot_device::io_read(address_space &space, int ifsel, offs_t offset IO write -------------------------------------------------*/ -void dmvcart_slot_device::io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) +void dmvcart_slot_device::io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) { if (m_cart) m_cart->io_write(space, ifsel, offset, data); diff --git a/src/devices/bus/dmv/dmvbus.h b/src/devices/bus/dmv/dmvbus.h index da7f8f68d35..ab5d152515c 100644 --- a/src/devices/bus/dmv/dmvbus.h +++ b/src/devices/bus/dmv/dmvbus.h @@ -22,14 +22,14 @@ public: device_dmvslot_interface(const machine_config &mconfig, device_t &device); virtual ~device_dmvslot_interface(); - virtual bool read(offs_t offset, UINT8 &data) { return false; } - virtual bool write(offs_t offset, UINT8 data) { return false; } - virtual void io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) { } - virtual void io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) { } + virtual bool read(offs_t offset, uint8_t &data) { return false; } + virtual bool write(offs_t offset, uint8_t data) { return false; } + virtual void io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) { } + virtual void io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) { } // slot 1 - virtual void ram_read(UINT8 cas, offs_t offset, UINT8 &data) { } - virtual void ram_write(UINT8 cas, offs_t offset, UINT8 data) { } + virtual void ram_read(uint8_t cas, offs_t offset, uint8_t &data) { } + virtual void ram_write(uint8_t cas, offs_t offset, uint8_t data) { } // slot 7 and 7A virtual bool av16bit() { return false; } @@ -55,7 +55,7 @@ class dmvcart_slot_device : public device_t, { public: // construction/destruction - dmvcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmvcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~dmvcart_slot_device(); template static devcb_base &set_prog_read_callback(device_t &device, _Object object) { return downcast(device).m_prog_read_cb.set_callback(object); } @@ -68,12 +68,12 @@ public: virtual void device_start() override; // reading and writing - virtual bool read(offs_t offset, UINT8 &data); - virtual bool write(offs_t offset, UINT8 data); - virtual void ram_read(UINT8 cas, offs_t offset, UINT8 &data); - virtual void ram_write(UINT8 cas, offs_t offset, UINT8 data); - virtual void io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data); - virtual void io_write(address_space &space, int ifsel, offs_t offset, UINT8 data); + virtual bool read(offs_t offset, uint8_t &data); + virtual bool write(offs_t offset, uint8_t data); + virtual void ram_read(uint8_t cas, offs_t offset, uint8_t &data); + virtual void ram_write(uint8_t cas, offs_t offset, uint8_t data); + virtual void io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data); + virtual void io_write(address_space &space, int ifsel, offs_t offset, uint8_t data); virtual void hold_w(int state); virtual void switch16_w(int state); virtual void timint_w(int state); diff --git a/src/devices/bus/dmv/k210.cpp b/src/devices/bus/dmv/k210.cpp index 0a49a824df0..00cb4004f51 100644 --- a/src/devices/bus/dmv/k210.cpp +++ b/src/devices/bus/dmv/k210.cpp @@ -51,7 +51,7 @@ const device_type DMV_K210 = &device_creator; // dmv_k210_device - constructor //------------------------------------------------- -dmv_k210_device::dmv_k210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k210_device::dmv_k210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMV_K210, "K210 Centronics", tag, owner, clock, "dmv_k210", __FILE__), device_dmvslot_interface( mconfig, *this ), m_ppi(*this, "ppi8255"), @@ -101,13 +101,13 @@ machine_config_constructor dmv_k210_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( dmv_k210 ); } -void dmv_k210_device::io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) +void dmv_k210_device::io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) { if (ifsel == 0) data = m_ppi->read(space, offset & 0x03); } -void dmv_k210_device::io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) +void dmv_k210_device::io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) { if (ifsel == 0) m_ppi->write(space, offset & 0x03, data); diff --git a/src/devices/bus/dmv/k210.h b/src/devices/bus/dmv/k210.h index 1939c5c051e..d3aaf7e1863 100644 --- a/src/devices/bus/dmv/k210.h +++ b/src/devices/bus/dmv/k210.h @@ -22,7 +22,7 @@ class dmv_k210_device : { public: // construction/destruction - dmv_k210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k210_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; @@ -49,8 +49,8 @@ protected: void device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) override; // dmvcart_interface overrides - virtual void io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) override; - virtual void io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) override; + virtual void io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) override; + virtual void io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) override; private: required_device m_ppi; @@ -60,8 +60,8 @@ private: dmvcart_slot_device * m_bus; emu_timer * m_clk1_timer; - UINT8 m_portb; - UINT8 m_portc; + uint8_t m_portb; + uint8_t m_portc; }; diff --git a/src/devices/bus/dmv/k220.cpp b/src/devices/bus/dmv/k220.cpp index b48a118f01c..f6ec770df19 100644 --- a/src/devices/bus/dmv/k220.cpp +++ b/src/devices/bus/dmv/k220.cpp @@ -132,7 +132,7 @@ const device_type DMV_K220 = &device_creator; // dmv_k220_device - constructor //------------------------------------------------- -dmv_k220_device::dmv_k220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k220_device::dmv_k220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMV_K220, "K220 diagnostic", tag, owner, clock, "dmv_k220", __FILE__), device_dmvslot_interface( mconfig, *this ), m_pit(*this, "pit8253"), @@ -195,7 +195,7 @@ const tiny_rom_entry *dmv_k220_device::device_rom_region() const // read //------------------------------------------------- -bool dmv_k220_device::read(offs_t offset, UINT8 &data) +bool dmv_k220_device::read(offs_t offset, uint8_t &data) { if ((m_portc & 0x01) && offset >= 0x2000 && offset < 0x6000) { @@ -215,7 +215,7 @@ bool dmv_k220_device::read(offs_t offset, UINT8 &data) // write //------------------------------------------------- -bool dmv_k220_device::write(offs_t offset, UINT8 data) +bool dmv_k220_device::write(offs_t offset, uint8_t data) { if ((m_portc & 0x01) && offset >= 0x2000 && offset < 0x4000) { @@ -234,7 +234,7 @@ bool dmv_k220_device::write(offs_t offset, UINT8 data) WRITE8_MEMBER( dmv_k220_device::porta_w ) { // 74LS247 BCD-to-Seven-Segment Decoder - static UINT8 bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x58, 0x4c, 0x62, 0x69, 0x78, 0x00 }; + static uint8_t bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x58, 0x4c, 0x62, 0x69, 0x78, 0x00 }; machine().output().set_digit_value(0, bcd2hex[(data >> 4) & 0x0f]); machine().output().set_digit_value(1, bcd2hex[data & 0x0f]); diff --git a/src/devices/bus/dmv/k220.h b/src/devices/bus/dmv/k220.h index 78efdf085d7..5977be0dd61 100644 --- a/src/devices/bus/dmv/k220.h +++ b/src/devices/bus/dmv/k220.h @@ -22,7 +22,7 @@ class dmv_k220_device : { public: // construction/destruction - dmv_k220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k220_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; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // dmvcart_interface overrides - virtual bool read(offs_t offset, UINT8 &data) override; - virtual bool write(offs_t offset, UINT8 data) override; + virtual bool read(offs_t offset, uint8_t &data) override; + virtual bool write(offs_t offset, uint8_t data) override; private: required_device m_pit; @@ -50,7 +50,7 @@ private: required_memory_region m_ram; required_memory_region m_rom; - UINT8 m_portc; + uint8_t m_portc; }; diff --git a/src/devices/bus/dmv/k230.cpp b/src/devices/bus/dmv/k230.cpp index 8e859827304..f3e04adf0fe 100644 --- a/src/devices/bus/dmv/k230.cpp +++ b/src/devices/bus/dmv/k230.cpp @@ -106,7 +106,7 @@ const device_type DMV_K235 = &device_creator; // dmv_k230_device - constructor //------------------------------------------------- -dmv_k230_device::dmv_k230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k230_device::dmv_k230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMV_K230, "K230 8088 without interrupt controller", tag, owner, clock, "dmv_k230", __FILE__), device_dmvslot_interface( mconfig, *this ), m_maincpu(*this, "maincpu"), @@ -114,7 +114,7 @@ dmv_k230_device::dmv_k230_device(const machine_config &mconfig, const char *tag, { } -dmv_k230_device::dmv_k230_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) +dmv_k230_device::dmv_k230_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_dmvslot_interface( mconfig, *this ), m_maincpu(*this, "maincpu"), @@ -126,7 +126,7 @@ dmv_k230_device::dmv_k230_device(const machine_config &mconfig, device_type type // dmv_k231_device - constructor //------------------------------------------------- -dmv_k231_device::dmv_k231_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k231_device::dmv_k231_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmv_k230_device(mconfig, DMV_K231, "K231 8088 without interrupt controller", tag, owner, clock, "dmv_k231", __FILE__) { } @@ -135,7 +135,7 @@ dmv_k231_device::dmv_k231_device(const machine_config &mconfig, const char *tag, // dmv_k234_device - constructor //------------------------------------------------- -dmv_k234_device::dmv_k234_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k234_device::dmv_k234_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmv_k230_device(mconfig, DMV_K234, "K234 68008", tag, owner, clock, "dmv_k234", __FILE__), m_snr(0) { } @@ -144,7 +144,7 @@ dmv_k234_device::dmv_k234_device(const machine_config &mconfig, const char *tag, // dmv_k235_device - constructor //------------------------------------------------- -dmv_k235_device::dmv_k235_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k235_device::dmv_k235_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmv_k230_device(mconfig, DMV_K235, "K235 8088 with interrupt controller", tag, owner, clock, "dmv_k235", __FILE__), m_pic(*this, "pic8259"), m_dsw(*this, "DSW") diff --git a/src/devices/bus/dmv/k230.h b/src/devices/bus/dmv/k230.h index d6565f461ab..27b2397986f 100644 --- a/src/devices/bus/dmv/k230.h +++ b/src/devices/bus/dmv/k230.h @@ -29,8 +29,8 @@ class dmv_k230_device : { public: // construction/destruction - dmv_k230_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); - dmv_k230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k230_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); + dmv_k230_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; @@ -69,7 +69,7 @@ class dmv_k231_device : { public: // construction/destruction - dmv_k231_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k231_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; @@ -83,7 +83,7 @@ class dmv_k234_device : { public: // construction/destruction - dmv_k234_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k234_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(snr_r); DECLARE_WRITE8_MEMBER(snr_w); @@ -113,7 +113,7 @@ class dmv_k235_device : { public: // construction/destruction - dmv_k235_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k235_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // optional information overrides diff --git a/src/devices/bus/dmv/k233.cpp b/src/devices/bus/dmv/k233.cpp index 8668f7ab81f..11e31431e9b 100644 --- a/src/devices/bus/dmv/k233.cpp +++ b/src/devices/bus/dmv/k233.cpp @@ -28,7 +28,7 @@ const device_type DMV_K233 = &device_creator; // dmv_k233_device - constructor //------------------------------------------------- -dmv_k233_device::dmv_k233_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k233_device::dmv_k233_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMV_K233, "K233 16K Shared RAM", tag, owner, clock, "dmv_k233", __FILE__), device_dmvslot_interface( mconfig, *this ), m_enabled(false), @@ -54,7 +54,7 @@ void dmv_k233_device::device_reset() m_enabled = false; } -void dmv_k233_device::io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) +void dmv_k233_device::io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) { if (ifsel == 1) m_enabled = !m_enabled; @@ -64,7 +64,7 @@ void dmv_k233_device::io_write(address_space &space, int ifsel, offs_t offset, U // read //------------------------------------------------- -bool dmv_k233_device::read(offs_t offset, UINT8 &data) +bool dmv_k233_device::read(offs_t offset, uint8_t &data) { if (m_enabled && offset >= 0xc000 && offset < 0x10000) { @@ -79,7 +79,7 @@ bool dmv_k233_device::read(offs_t offset, UINT8 &data) // write //------------------------------------------------- -bool dmv_k233_device::write(offs_t offset, UINT8 data) +bool dmv_k233_device::write(offs_t offset, uint8_t data) { if (m_enabled && offset >= 0xc000 && offset < 0x10000) { diff --git a/src/devices/bus/dmv/k233.h b/src/devices/bus/dmv/k233.h index f736dee2d4a..eb7411ec42c 100644 --- a/src/devices/bus/dmv/k233.h +++ b/src/devices/bus/dmv/k233.h @@ -20,7 +20,7 @@ class dmv_k233_device : { public: // construction/destruction - dmv_k233_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k233_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -28,13 +28,13 @@ protected: virtual void device_reset() override; // dmvcart_interface overrides - virtual void io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) override; - virtual bool read(offs_t offset, UINT8 &data) override; - virtual bool write(offs_t offset, UINT8 data) override; + virtual void io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) override; + virtual bool read(offs_t offset, uint8_t &data) override; + virtual bool write(offs_t offset, uint8_t data) override; private: bool m_enabled; - UINT8 * m_ram; + uint8_t * m_ram; }; diff --git a/src/devices/bus/dmv/k801.cpp b/src/devices/bus/dmv/k801.cpp index 5bc586c09b5..211c678392b 100644 --- a/src/devices/bus/dmv/k801.cpp +++ b/src/devices/bus/dmv/k801.cpp @@ -111,7 +111,7 @@ const device_type DMV_K213 = &device_creator; // dmv_k801_device - constructor //------------------------------------------------- -dmv_k801_device::dmv_k801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k801_device::dmv_k801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMV_K801, "K801 RS-232 Switchable Interface", tag, owner, clock, "dmv_k801", __FILE__), device_dmvslot_interface( mconfig, *this ), m_epci(*this, "epci"), @@ -119,7 +119,7 @@ dmv_k801_device::dmv_k801_device(const machine_config &mconfig, const char *tag, { } -dmv_k801_device::dmv_k801_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) +dmv_k801_device::dmv_k801_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_dmvslot_interface( mconfig, *this ), m_epci(*this, "epci"), @@ -131,13 +131,13 @@ dmv_k801_device::dmv_k801_device(const machine_config &mconfig, device_type type // dmv_k211_device - constructor //------------------------------------------------- -dmv_k211_device::dmv_k211_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k211_device::dmv_k211_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmv_k801_device(mconfig, DMV_K211, "K211 RS-232 Communications Interface", tag, owner, clock, "dmv_k211", __FILE__) { } -dmv_k211_device::dmv_k211_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) +dmv_k211_device::dmv_k211_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) : dmv_k801_device(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -146,7 +146,7 @@ dmv_k211_device::dmv_k211_device(const machine_config &mconfig, device_type type // dmv_k212_device - constructor //------------------------------------------------- -dmv_k212_device::dmv_k212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k212_device::dmv_k212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmv_k211_device(mconfig, DMV_K212, "K212 RS-232 Printer Interface", tag, owner, clock, "dmv_k212", __FILE__) { } @@ -155,7 +155,7 @@ dmv_k212_device::dmv_k212_device(const machine_config &mconfig, const char *tag, // dmv_k213_device - constructor //------------------------------------------------- -dmv_k213_device::dmv_k213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k213_device::dmv_k213_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmv_k211_device(mconfig, DMV_K213, "K213 RS-232 Plotter Interface", tag, owner, clock, "dmv_k213", __FILE__) { } @@ -231,9 +231,9 @@ WRITE_LINE_MEMBER(dmv_k801_device::epci_irq_w) m_bus->m_out_irq_cb(state); } -void dmv_k801_device::io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) +void dmv_k801_device::io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) { - UINT8 dsw = m_dsw->read() & 0x0f; + uint8_t dsw = m_dsw->read() & 0x0f; if ((dsw >> 1) == ifsel && BIT(offset, 3) == BIT(dsw, 0)) { if (offset & 0x04) @@ -243,9 +243,9 @@ void dmv_k801_device::io_read(address_space &space, int ifsel, offs_t offset, UI } } -void dmv_k801_device::io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) +void dmv_k801_device::io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) { - UINT8 dsw = m_dsw->read() & 0x0f; + uint8_t dsw = m_dsw->read() & 0x0f; if ((dsw >> 1) == ifsel && BIT(offset, 3) == BIT(dsw, 0)) { if (offset & 0x04) @@ -255,9 +255,9 @@ void dmv_k801_device::io_write(address_space &space, int ifsel, offs_t offset, U } } -void dmv_k211_device::io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) +void dmv_k211_device::io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) { - UINT8 jumpers = m_dsw->read() & 0x03; + uint8_t jumpers = m_dsw->read() & 0x03; if ((BIT(jumpers, 0) && ifsel == 0) || (BIT(jumpers, 1) && ifsel == 1)) { if (offset & 0x04) @@ -267,9 +267,9 @@ void dmv_k211_device::io_read(address_space &space, int ifsel, offs_t offset, UI } } -void dmv_k211_device::io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) +void dmv_k211_device::io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) { - UINT8 jumpers = m_dsw->read() & 0x03; + uint8_t jumpers = m_dsw->read() & 0x03; if ((BIT(jumpers, 0) && ifsel == 0) || (BIT(jumpers, 1) && ifsel == 1)) { if (offset & 0x04) diff --git a/src/devices/bus/dmv/k801.h b/src/devices/bus/dmv/k801.h index 0b67b6c5d71..3d0732513e9 100644 --- a/src/devices/bus/dmv/k801.h +++ b/src/devices/bus/dmv/k801.h @@ -23,8 +23,8 @@ class dmv_k801_device : { public: // construction/destruction - dmv_k801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - dmv_k801_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); + dmv_k801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + dmv_k801_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); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -38,8 +38,8 @@ protected: virtual void device_reset() override; // dmvcart_interface overrides - virtual void io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) override; - virtual void io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) override; + virtual void io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) override; + virtual void io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) override; protected: required_device m_epci; @@ -55,8 +55,8 @@ class dmv_k211_device : { public: // construction/destruction - dmv_k211_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - dmv_k211_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); + dmv_k211_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + dmv_k211_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); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -64,8 +64,8 @@ public: protected: // dmvcart_interface overrides - virtual void io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) override; - virtual void io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) override; + virtual void io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) override; + virtual void io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) override; }; // ======================> dmv_k212_device @@ -75,7 +75,7 @@ class dmv_k212_device : { public: // construction/destruction - dmv_k212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -89,7 +89,7 @@ class dmv_k213_device : { public: // construction/destruction - dmv_k213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k213_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/dmv/k803.cpp b/src/devices/bus/dmv/k803.cpp index 00de36c9c24..b57e01c3b19 100644 --- a/src/devices/bus/dmv/k803.cpp +++ b/src/devices/bus/dmv/k803.cpp @@ -49,7 +49,7 @@ const device_type DMV_K803 = &device_creator; // dmv_k803_device - constructor //------------------------------------------------- -dmv_k803_device::dmv_k803_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k803_device::dmv_k803_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMV_K803, "K803 RTC", tag, owner, clock, "dmv_k803", __FILE__), device_dmvslot_interface( mconfig, *this ), m_rtc(*this, "rtc"), @@ -95,9 +95,9 @@ ioport_constructor dmv_k803_device::device_input_ports() const return INPUT_PORTS_NAME( dmv_k803 ); } -void dmv_k803_device::io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) +void dmv_k803_device::io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) { - UINT8 dsw = m_dsw->read() & 0x0f; + uint8_t dsw = m_dsw->read() & 0x0f; if ((dsw >> 1) == ifsel && BIT(offset, 3) == BIT(dsw, 0)) { if (offset & 0x04) @@ -105,9 +105,9 @@ void dmv_k803_device::io_read(address_space &space, int ifsel, offs_t offset, UI } } -void dmv_k803_device::io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) +void dmv_k803_device::io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) { - UINT8 dsw = m_dsw->read() & 0x0f; + uint8_t dsw = m_dsw->read() & 0x0f; if ((dsw >> 1) == ifsel && BIT(offset, 3) == BIT(dsw, 0)) { if (offset & 0x04) diff --git a/src/devices/bus/dmv/k803.h b/src/devices/bus/dmv/k803.h index c6a7d70af4d..820ec746455 100644 --- a/src/devices/bus/dmv/k803.h +++ b/src/devices/bus/dmv/k803.h @@ -21,7 +21,7 @@ class dmv_k803_device : { public: // construction/destruction - dmv_k803_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k803_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -34,8 +34,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) override; - virtual void io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) override; + virtual void io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) override; + virtual void io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) override; void update_int(); @@ -43,7 +43,7 @@ private: required_device m_rtc; required_ioport m_dsw; dmvcart_slot_device * m_bus; - UINT8 m_latch; + uint8_t m_latch; int m_rtc_int; }; diff --git a/src/devices/bus/dmv/k806.cpp b/src/devices/bus/dmv/k806.cpp index 8cd13beb467..6667d267899 100644 --- a/src/devices/bus/dmv/k806.cpp +++ b/src/devices/bus/dmv/k806.cpp @@ -75,7 +75,7 @@ const device_type DMV_K806 = &device_creator; // dmv_k806_device - constructor //------------------------------------------------- -dmv_k806_device::dmv_k806_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k806_device::dmv_k806_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMV_K806, "K806 mouse", tag, owner, clock, "dmv_k806", __FILE__), device_dmvslot_interface( mconfig, *this ), m_mcu(*this, "mcu"), @@ -136,16 +136,16 @@ const tiny_rom_entry *dmv_k806_device::device_rom_region() const return ROM_NAME( dmv_k806 ); } -void dmv_k806_device::io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) +void dmv_k806_device::io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) { - UINT8 jumpers = m_jumpers->read(); + uint8_t jumpers = m_jumpers->read(); if (BIT(jumpers, ifsel) && ((!BIT(offset, 3) && BIT(jumpers, 5)) || (BIT(offset, 3) && BIT(jumpers, 6)))) data = m_mcu->upi41_master_r(space, offset & 1); } -void dmv_k806_device::io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) +void dmv_k806_device::io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) { - UINT8 jumpers = m_jumpers->read(); + uint8_t jumpers = m_jumpers->read(); if (BIT(jumpers, ifsel) && ((!BIT(offset, 3) && BIT(jumpers, 5)) || (BIT(offset, 3) && BIT(jumpers, 6)))) { m_mcu->upi41_master_w(space, offset & 1, data); @@ -164,7 +164,7 @@ READ8_MEMBER( dmv_k806_device::port1_r ) // -x-- ---- YB / X1 // x--- ---- not used - UINT8 data = m_mouse_buttons->read() & 0x07; + uint8_t data = m_mouse_buttons->read() & 0x07; data |= (m_mouse.xa != CLEAR_LINE ? 0 : 0x08); data |= (m_mouse.xb != CLEAR_LINE ? 0 : 0x10); diff --git a/src/devices/bus/dmv/k806.h b/src/devices/bus/dmv/k806.h index 6ad48448e15..9df9381fa70 100644 --- a/src/devices/bus/dmv/k806.h +++ b/src/devices/bus/dmv/k806.h @@ -22,7 +22,7 @@ class dmv_k806_device : { public: // construction/destruction - dmv_k806_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k806_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; @@ -40,8 +40,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void io_read(address_space &space, int ifsel, offs_t offset, UINT8 &data) override; - virtual void io_write(address_space &space, int ifsel, offs_t offset, UINT8 data) override; + virtual void io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data) override; + virtual void io_write(address_space &space, int ifsel, offs_t offset, uint8_t data) override; private: required_device m_mcu; diff --git a/src/devices/bus/dmv/ram.cpp b/src/devices/bus/dmv/ram.cpp index b53bc26a63c..1f2d5e2df2a 100644 --- a/src/devices/bus/dmv/ram.cpp +++ b/src/devices/bus/dmv/ram.cpp @@ -32,7 +32,7 @@ const device_type DMV_K208 = &device_creator; // dmv_ram_device - constructor //------------------------------------------------- -dmv_ram_device::dmv_ram_device(const machine_config &mconfig, device_type type, UINT32 size, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +dmv_ram_device::dmv_ram_device(const machine_config &mconfig, device_type type, uint32_t size, 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_dmvslot_interface( mconfig, *this ), m_ram(nullptr), m_size(size) @@ -43,7 +43,7 @@ dmv_ram_device::dmv_ram_device(const machine_config &mconfig, device_type type, // dmv_k200_device - constructor //------------------------------------------------- -dmv_k200_device::dmv_k200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k200_device::dmv_k200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmv_ram_device(mconfig, DMV_K200, 1, "K200 64K RAM expansion", tag, owner, clock, "dmv_k200", __FILE__) { } @@ -52,7 +52,7 @@ dmv_k200_device::dmv_k200_device(const machine_config &mconfig, const char *tag, // dmv_k202_device - constructor //------------------------------------------------- -dmv_k202_device::dmv_k202_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k202_device::dmv_k202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmv_ram_device(mconfig, DMV_K202, 3, "K202 192K RAM expansion", tag, owner, clock, "dmv_k202", __FILE__) { } @@ -61,7 +61,7 @@ dmv_k202_device::dmv_k202_device(const machine_config &mconfig, const char *tag, // dmv_k208_device - constructor //------------------------------------------------- -dmv_k208_device::dmv_k208_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmv_k208_device::dmv_k208_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmv_ram_device(mconfig, DMV_K208, 7 , "K208 448K RAM expansion", tag, owner, clock, "dmv_k208", __FILE__) { } @@ -79,7 +79,7 @@ void dmv_ram_device::device_start() // read //------------------------------------------------- -void dmv_ram_device::ram_read(UINT8 cas, offs_t offset, UINT8 &data) +void dmv_ram_device::ram_read(uint8_t cas, offs_t offset, uint8_t &data) { if (cas && cas <= m_size) data = m_ram[((cas - 1) << 16) | (offset & 0xffff)]; @@ -89,7 +89,7 @@ void dmv_ram_device::ram_read(UINT8 cas, offs_t offset, UINT8 &data) // write //------------------------------------------------- -void dmv_ram_device::ram_write(UINT8 cas, offs_t offset, UINT8 data) +void dmv_ram_device::ram_write(uint8_t cas, offs_t offset, uint8_t data) { if (cas && cas <= m_size) m_ram[((cas - 1) << 16) | (offset & 0xffff)] = data; diff --git a/src/devices/bus/dmv/ram.h b/src/devices/bus/dmv/ram.h index 3aceebe9165..ea8417fa720 100644 --- a/src/devices/bus/dmv/ram.h +++ b/src/devices/bus/dmv/ram.h @@ -20,19 +20,19 @@ class dmv_ram_device : { public: // construction/destruction - dmv_ram_device(const machine_config &mconfig, device_type type, UINT32 size, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + dmv_ram_device(const machine_config &mconfig, device_type type, uint32_t size, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); protected: // device-level overrides virtual void device_start() override; // dmvcart_interface overrides - virtual void ram_read(UINT8 cas, offs_t offset, UINT8 &data) override; - virtual void ram_write(UINT8 cas, offs_t offset, UINT8 data) override; + virtual void ram_read(uint8_t cas, offs_t offset, uint8_t &data) override; + virtual void ram_write(uint8_t cas, offs_t offset, uint8_t data) override; private: - UINT8 * m_ram; - UINT8 m_size; + uint8_t * m_ram; + uint8_t m_size; }; @@ -41,7 +41,7 @@ class dmv_k200_device : { public: // construction/destruction - dmv_k200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -50,7 +50,7 @@ class dmv_k202_device : { public: // construction/destruction - dmv_k202_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -59,7 +59,7 @@ class dmv_k208_device : { public: // construction/destruction - dmv_k208_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmv_k208_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/ecbbus/ecbbus.cpp b/src/devices/bus/ecbbus/ecbbus.cpp index c96d49da103..102309dcdcf 100644 --- a/src/devices/bus/ecbbus/ecbbus.cpp +++ b/src/devices/bus/ecbbus/ecbbus.cpp @@ -26,7 +26,7 @@ const device_type ECBBUS_SLOT = &device_creator; // ecbbus_slot_device - constructor //------------------------------------------------- -ecbbus_slot_device::ecbbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ecbbus_slot_device::ecbbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ECBBUS_SLOT, "ECB bus slot", tag, owner, clock, "ecbbus_slot", __FILE__), device_slot_interface(mconfig, *this), m_bus_tag(nullptr), m_bus_num(0), m_bus(nullptr) { @@ -90,7 +90,7 @@ device_ecbbus_card_interface::device_ecbbus_card_interface(const machine_config // ecbbus_device - constructor //------------------------------------------------- -ecbbus_device::ecbbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ecbbus_device::ecbbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ECBBUS, "ECB bus", tag, owner, clock, "ecbbus", __FILE__), m_write_irq(*this), m_write_nmi(*this) @@ -128,7 +128,7 @@ void ecbbus_device::add_card(device_ecbbus_card_interface *card, int pos) READ8_MEMBER( ecbbus_device::mem_r ) { - UINT8 data = 0; + uint8_t data = 0; for (auto & elem : m_ecbbus_device) { @@ -164,7 +164,7 @@ WRITE8_MEMBER( ecbbus_device::mem_w ) READ8_MEMBER( ecbbus_device::io_r ) { - UINT8 data = 0; + uint8_t data = 0; for (auto & elem : m_ecbbus_device) { diff --git a/src/devices/bus/ecbbus/ecbbus.h b/src/devices/bus/ecbbus/ecbbus.h index 90bb67bced9..6c6e09ec123 100644 --- a/src/devices/bus/ecbbus/ecbbus.h +++ b/src/devices/bus/ecbbus/ecbbus.h @@ -94,7 +94,7 @@ class ecbbus_slot_device : public device_t, { public: // construction/destruction - ecbbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ecbbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -125,7 +125,7 @@ class ecbbus_device : public device_t { public: // construction/destruction - ecbbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ecbbus_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); } template static devcb_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_nmi.set_callback(object); } @@ -170,10 +170,10 @@ public: virtual ~device_ecbbus_card_interface() { } // optional operation overrides - virtual UINT8 ecbbus_mem_r(offs_t offset) { return 0; }; - virtual void ecbbus_mem_w(offs_t offset, UINT8 data) { }; - virtual UINT8 ecbbus_io_r(offs_t offset) { return 0; }; - virtual void ecbbus_io_w(offs_t offset, UINT8 data) { }; + virtual uint8_t ecbbus_mem_r(offs_t offset) { return 0; }; + virtual void ecbbus_mem_w(offs_t offset, uint8_t data) { }; + virtual uint8_t ecbbus_io_r(offs_t offset) { return 0; }; + virtual void ecbbus_io_w(offs_t offset, uint8_t data) { }; public: ecbbus_slot_device *m_slot; diff --git a/src/devices/bus/ecbbus/grip.cpp b/src/devices/bus/ecbbus/grip.cpp index 225214043cd..72dfc9a6ec6 100644 --- a/src/devices/bus/ecbbus/grip.cpp +++ b/src/devices/bus/ecbbus/grip.cpp @@ -227,8 +227,8 @@ MC6845_UPDATE_ROW( grip_device::crtc_update_row ) { for (int column = 0; column < x_count; column++) { - UINT16 address = (m_page << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07); - UINT8 data = m_video_ram[address]; + uint16_t address = (m_page << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07); + uint8_t data = m_video_ram[address]; for (int bit = 0; bit < 8; bit++) { @@ -247,8 +247,8 @@ MC6845_UPDATE_ROW( grip_device::grip5_update_row ) for (column = 0; column < x_count; column++) { - UINT16 address = (m_dpage << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07); - UINT8 data = m_video_ram[address]; + uint16_t address = (m_dpage << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07); + uint8_t data = m_video_ram[address]; for (bit = 0; bit < 8; bit++) { @@ -265,7 +265,7 @@ MC6845_ON_UPDATE_ADDR_CHANGED( grip_device::grip5_addr_changed ) } */ -static const INT16 speaker_levels[] = { -32768, 0, 32767, 0 }; +static const int16_t speaker_levels[] = { -32768, 0, 32767, 0 }; //------------------------------------------------- // I8255A interface @@ -389,7 +389,7 @@ READ8_MEMBER( grip_device::sti_gpio_r ) */ - UINT8 data = 0x20; + uint8_t data = 0x20; // display enable data |= m_crtc->de_r() << 1; @@ -613,7 +613,7 @@ ioport_constructor grip_device::device_input_ports() const // grip_device - constructor //------------------------------------------------- -grip_device::grip_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +grip_device::grip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ECB_GRIP21, "GRIP-2.1", tag, owner, clock, "grip", __FILE__), device_ecbbus_card_interface(mconfig, *this), m_ppi(*this, I8255A_TAG), @@ -750,7 +750,7 @@ READ8_MEMBER( grip_device::stat_r ) */ - UINT8 data = 0; + uint8_t data = 0; int js0 = 0, js1 = 0; // JS0 @@ -858,9 +858,9 @@ WRITE8_MEMBER( grip5_state::dpage_w ) // ecbbus_io_r - I/O read //------------------------------------------------- -UINT8 grip_device::ecbbus_io_r(offs_t offset) +uint8_t grip_device::ecbbus_io_r(offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; if ((offset & 0xfe) == m_base) { @@ -886,7 +886,7 @@ UINT8 grip_device::ecbbus_io_r(offs_t offset) // ecbbus_io_w - I/O write //------------------------------------------------- -void grip_device::ecbbus_io_w(offs_t offset, UINT8 data) +void grip_device::ecbbus_io_w(offs_t offset, uint8_t data) { if ((offset & 0xfe) == m_base) { diff --git a/src/devices/bus/ecbbus/grip.h b/src/devices/bus/ecbbus/grip.h index da4e83ed46a..3f26f392b1f 100644 --- a/src/devices/bus/ecbbus/grip.h +++ b/src/devices/bus/ecbbus/grip.h @@ -35,7 +35,7 @@ class grip_device : public device_t, { public: // construction/destruction - grip_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + grip_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; @@ -71,8 +71,8 @@ protected: virtual void device_reset() override; // device_ecbbus_card_interface overrides - virtual UINT8 ecbbus_io_r(offs_t offset) override; - virtual void ecbbus_io_w(offs_t offset, UINT8 data) override; + virtual uint8_t ecbbus_io_r(offs_t offset) override; + virtual void ecbbus_io_w(offs_t offset, uint8_t data) override; private: required_device m_ppi; @@ -81,7 +81,7 @@ private: required_device m_centronics; required_device m_palette; required_device m_speaker; - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; required_ioport m_j3a; required_ioport m_j3b; required_ioport m_j7; @@ -96,7 +96,7 @@ private: // keyboard state int m_ia; // PPI port A interrupt int m_ib; // PPI port B interrupt - UINT8 m_keydata; // keyboard data + uint8_t m_keydata; // keyboard data int m_kbf; // keyboard buffer full // video state @@ -105,9 +105,9 @@ private: int m_flash; // flash // ECB bus state - UINT8 m_base; // ECB base address - UINT8 m_ppi_pa; // PPI port A data - UINT8 m_ppi_pc; // PPI port C data + uint8_t m_base; // ECB base address + uint8_t m_ppi_pa; // PPI port A data + uint8_t m_ppi_pc; // PPI port C data // timers emu_timer *m_kb_timer; diff --git a/src/devices/bus/econet/e01.cpp b/src/devices/bus/econet/e01.cpp index 3d7eb0e5a9b..0b66a916299 100644 --- a/src/devices/bus/econet/e01.cpp +++ b/src/devices/bus/econet/e01.cpp @@ -77,7 +77,7 @@ const device_type E01 = &device_creator; const device_type E01S = &device_creator; -e01s_device::e01s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e01s_device::e01s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :e01_device(mconfig, E01S, "Acorn FileStore E01S", tag, owner, clock, "e01s", __FILE__) { m_variant = TYPE_E01S; } @@ -377,7 +377,7 @@ inline void e01_device::hdc_irq_enable(int enabled) // e01_device - constructor //------------------------------------------------- -e01_device::e01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e01_device::e01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, E01, "Acorn FileStore E01", tag, owner, clock, "e01" , __FILE__), device_econet_interface(mconfig, *this), m_maincpu(*this, R65C102_TAG), @@ -407,7 +407,7 @@ e01_device::e01_device(const machine_config &mconfig, const char *tag, device_t } -e01_device::e01_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) +e01_device::e01_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_econet_interface(mconfig, *this), m_maincpu(*this, R65C102_TAG), @@ -487,7 +487,7 @@ void e01_device::device_timer(emu_timer &timer, device_timer_id id, int param, v READ8_MEMBER( e01_device::read ) { - UINT8 data; + uint8_t data; if (m_ram_en) { @@ -622,7 +622,7 @@ WRITE8_MEMBER( e01_device::network_irq_enable_w ) READ8_MEMBER( e01_device::hdc_data_r ) { - UINT8 data = m_scsi_data_in->read(); + uint8_t data = m_scsi_data_in->read(); m_scsibus->write_ack(1); diff --git a/src/devices/bus/econet/e01.h b/src/devices/bus/econet/e01.h index 6e123a7a84c..4cf86c6cabd 100644 --- a/src/devices/bus/econet/e01.h +++ b/src/devices/bus/econet/e01.h @@ -29,8 +29,8 @@ class e01_device : public device_t, { public: // construction/destruction - e01_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); - e01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e01_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); + e01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); enum { @@ -124,7 +124,7 @@ class e01s_device : public e01_device { public: // construction/destruction - e01s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e01s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/econet/econet.cpp b/src/devices/bus/econet/econet.cpp index e56d843db32..acd22f218ab 100644 --- a/src/devices/bus/econet/econet.cpp +++ b/src/devices/bus/econet/econet.cpp @@ -53,7 +53,7 @@ device_econet_interface::device_econet_interface(const machine_config &mconfig, // econet_slot_device - constructor //------------------------------------------------- -econet_slot_device::econet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +econet_slot_device::econet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ECONET_SLOT, "Econet station", tag, owner, clock, "econet_slot", __FILE__), device_slot_interface(mconfig, *this), m_address(0), m_econet(nullptr) { @@ -193,7 +193,7 @@ inline int econet_device::get_signal(int signal) // econet_device - constructor //------------------------------------------------- -econet_device::econet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +econet_device::econet_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ECONET, "Econet", tag, owner, clock, "econet", __FILE__), m_write_clk(*this), m_write_data(*this) diff --git a/src/devices/bus/econet/econet.h b/src/devices/bus/econet/econet.h index e37cf989696..55acd438994 100644 --- a/src/devices/bus/econet/econet.h +++ b/src/devices/bus/econet/econet.h @@ -56,7 +56,7 @@ class econet_device : public device_t { public: // construction/destruction - econet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + econet_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_clk_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_clk.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); } @@ -116,7 +116,7 @@ class econet_slot_device : public device_t, { public: // construction/destruction - econet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + econet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -126,7 +126,7 @@ public: private: // configuration - UINT8 m_address; + uint8_t m_address; econet_device *m_econet; }; @@ -149,7 +149,7 @@ public: virtual void econet_data(int state) = 0; econet_device *m_econet; - UINT8 m_address; + uint8_t m_address; }; diff --git a/src/devices/bus/electron/exp.cpp b/src/devices/bus/electron/exp.cpp index c8c892058c6..bff51964e99 100644 --- a/src/devices/bus/electron/exp.cpp +++ b/src/devices/bus/electron/exp.cpp @@ -48,7 +48,7 @@ device_electron_expansion_interface::~device_electron_expansion_interface() // electron_expansion_slot_device - constructor //------------------------------------------------- -electron_expansion_slot_device::electron_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +electron_expansion_slot_device::electron_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ELECTRON_EXPANSION_SLOT, "Acorn Electron Expansion port", tag, owner, clock, "electron_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_card(nullptr), diff --git a/src/devices/bus/electron/exp.h b/src/devices/bus/electron/exp.h index b89f795060b..e4cd4c96008 100644 --- a/src/devices/bus/electron/exp.h +++ b/src/devices/bus/electron/exp.h @@ -130,7 +130,7 @@ class electron_expansion_slot_device : public device_t, public device_slot_inter { public: // construction/destruction - electron_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + electron_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~electron_expansion_slot_device(); // callbacks diff --git a/src/devices/bus/electron/m2105.cpp b/src/devices/bus/electron/m2105.cpp index 1815c8bfe14..4228f02395f 100644 --- a/src/devices/bus/electron/m2105.cpp +++ b/src/devices/bus/electron/m2105.cpp @@ -120,7 +120,7 @@ const tiny_rom_entry *electron_m2105_device::device_rom_region() const // electron_m2105_device - constructor //------------------------------------------------- -electron_m2105_device::electron_m2105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +electron_m2105_device::electron_m2105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ELECTRON_M2105, "Acorn M2105 Expansion", tag, owner, clock, "electron_m2105", __FILE__), device_electron_expansion_interface(mconfig, *this), m_exp_rom(*this, "exp_rom"), diff --git a/src/devices/bus/electron/m2105.h b/src/devices/bus/electron/m2105.h index 9a97622fd93..511bbe766d4 100644 --- a/src/devices/bus/electron/m2105.h +++ b/src/devices/bus/electron/m2105.h @@ -30,7 +30,7 @@ class electron_m2105_device: { public: // construction/destruction - electron_m2105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + electron_m2105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER(intrq_w); diff --git a/src/devices/bus/electron/plus3.cpp b/src/devices/bus/electron/plus3.cpp index ce1e859ac59..d24cdaa014b 100644 --- a/src/devices/bus/electron/plus3.cpp +++ b/src/devices/bus/electron/plus3.cpp @@ -96,7 +96,7 @@ const tiny_rom_entry *electron_plus3_device::device_rom_region() const // electron_plus3_device - constructor //------------------------------------------------- -electron_plus3_device::electron_plus3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +electron_plus3_device::electron_plus3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ELECTRON_PLUS3, "Acorn Plus 3 Disc Expansion", tag, owner, clock, "electron_plus3", __FILE__), device_electron_expansion_interface(mconfig, *this), m_exp_rom(*this, "exp_rom"), diff --git a/src/devices/bus/electron/plus3.h b/src/devices/bus/electron/plus3.h index d2690c6864b..f5a07585635 100644 --- a/src/devices/bus/electron/plus3.h +++ b/src/devices/bus/electron/plus3.h @@ -25,7 +25,7 @@ class electron_plus3_device: { public: // construction/destruction - electron_plus3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + electron_plus3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_FLOPPY_FORMATS(floppy_formats); diff --git a/src/devices/bus/ep64/exdos.cpp b/src/devices/bus/ep64/exdos.cpp index 67c6df6646c..2afb8f83312 100644 --- a/src/devices/bus/ep64/exdos.cpp +++ b/src/devices/bus/ep64/exdos.cpp @@ -131,7 +131,7 @@ machine_config_constructor ep64_exdos_device::device_mconfig_additions() const // ep64_exdos_device - constructor //------------------------------------------------- -ep64_exdos_device::ep64_exdos_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ep64_exdos_device::ep64_exdos_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EP64_EXDOS, "EXDOS", tag, owner, clock, "ep64_exdos", __FILE__), device_ep64_expansion_bus_card_interface(mconfig, *this), m_fdc(*this, WD1770_TAG), @@ -193,7 +193,7 @@ READ8_MEMBER( ep64_exdos_device::read ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_fdc->intrq_r() << 1; data |= m_fdc->drq_r() << 7; diff --git a/src/devices/bus/ep64/exdos.h b/src/devices/bus/ep64/exdos.h index 6259440b751..6139d8a03de 100644 --- a/src/devices/bus/ep64/exdos.h +++ b/src/devices/bus/ep64/exdos.h @@ -29,7 +29,7 @@ class ep64_exdos_device : public device_t, { public: // construction/destruction - ep64_exdos_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ep64_exdos_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; diff --git a/src/devices/bus/ep64/exp.cpp b/src/devices/bus/ep64/exp.cpp index 092dcf59995..784d13fa63b 100644 --- a/src/devices/bus/ep64/exp.cpp +++ b/src/devices/bus/ep64/exp.cpp @@ -42,7 +42,7 @@ device_ep64_expansion_bus_card_interface::device_ep64_expansion_bus_card_interfa // ep64_expansion_bus_slot_device - constructor //------------------------------------------------- -ep64_expansion_bus_slot_device::ep64_expansion_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ep64_expansion_bus_slot_device::ep64_expansion_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EP64_EXPANSION_BUS_SLOT, "Enterprise Sixty Four expansion bus slot", tag, owner, clock, "ep64_expansion_bus_slot", __FILE__) , device_slot_interface(mconfig, *this) , m_write_irq(*this) diff --git a/src/devices/bus/ep64/exp.h b/src/devices/bus/ep64/exp.h index a80f05b76f9..153afb0abc6 100644 --- a/src/devices/bus/ep64/exp.h +++ b/src/devices/bus/ep64/exp.h @@ -97,7 +97,7 @@ class ep64_expansion_bus_slot_device : public device_t, public: // construction/destruction - ep64_expansion_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ep64_expansion_bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_dave_tag(device_t &device, const char* tag) { downcast(device).m_dave.set_tag(tag); } template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } diff --git a/src/devices/bus/epson_sio/epson_sio.cpp b/src/devices/bus/epson_sio/epson_sio.cpp index 88e50bb9cdc..f70e15006d7 100644 --- a/src/devices/bus/epson_sio/epson_sio.cpp +++ b/src/devices/bus/epson_sio/epson_sio.cpp @@ -52,7 +52,7 @@ device_epson_sio_interface::~device_epson_sio_interface() // epson_sio_device - constructor //------------------------------------------------- -epson_sio_device::epson_sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +epson_sio_device::epson_sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EPSON_SIO, "EPSON SIO port", tag, owner, clock, "epson_sio", __FILE__), device_slot_interface(mconfig, *this), m_cart(nullptr), m_write_rx(*this), diff --git a/src/devices/bus/epson_sio/epson_sio.h b/src/devices/bus/epson_sio/epson_sio.h index c59b3d6ddc1..c52ebcc11d9 100644 --- a/src/devices/bus/epson_sio/epson_sio.h +++ b/src/devices/bus/epson_sio/epson_sio.h @@ -41,7 +41,7 @@ class epson_sio_device : public device_t, { public: // construction/destruction - epson_sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + epson_sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~epson_sio_device(); // callbacks diff --git a/src/devices/bus/epson_sio/pf10.cpp b/src/devices/bus/epson_sio/pf10.cpp index 4f93c542340..5e8463ef6a6 100644 --- a/src/devices/bus/epson_sio/pf10.cpp +++ b/src/devices/bus/epson_sio/pf10.cpp @@ -91,7 +91,7 @@ machine_config_constructor epson_pf10_device::device_mconfig_additions() const // epson_pf10_device - constructor //------------------------------------------------- -epson_pf10_device::epson_pf10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +epson_pf10_device::epson_pf10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EPSON_PF10, "EPSON PF-10 Portable Floppy Unit", tag, owner, clock, "epson_pf10", __FILE__), device_epson_sio_interface(mconfig, *this), m_cpu(*this, "maincpu"), diff --git a/src/devices/bus/epson_sio/pf10.h b/src/devices/bus/epson_sio/pf10.h index 3d1d3d60131..16e1b1cb170 100644 --- a/src/devices/bus/epson_sio/pf10.h +++ b/src/devices/bus/epson_sio/pf10.h @@ -28,7 +28,7 @@ class epson_pf10_device : public device_t, { public: // construction/destruction - epson_pf10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + epson_pf10_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; @@ -72,8 +72,8 @@ private: emu_timer *m_timer; - UINT8 m_port1; - UINT8 m_port2; + uint8_t m_port1; + uint8_t m_port2; int m_rxc; int m_hd6303_tx; diff --git a/src/devices/bus/epson_sio/tf20.cpp b/src/devices/bus/epson_sio/tf20.cpp index 83c65755501..c920d2324ee 100644 --- a/src/devices/bus/epson_sio/tf20.cpp +++ b/src/devices/bus/epson_sio/tf20.cpp @@ -126,7 +126,7 @@ machine_config_constructor epson_tf20_device::device_mconfig_additions() const // epson_tf20_device - constructor //------------------------------------------------- -epson_tf20_device::epson_tf20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +epson_tf20_device::epson_tf20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EPSON_TF20, "EPSON TF-20 Dual Floppy Disk Drive", tag, owner, clock, "epson_tf20", __FILE__), device_epson_sio_interface(mconfig, *this), m_cpu(*this, "19b"), diff --git a/src/devices/bus/epson_sio/tf20.h b/src/devices/bus/epson_sio/tf20.h index 252e99ed4c8..8fc66e2917f 100644 --- a/src/devices/bus/epson_sio/tf20.h +++ b/src/devices/bus/epson_sio/tf20.h @@ -30,7 +30,7 @@ class epson_tf20_device : public device_t, { public: // construction/destruction - epson_tf20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + epson_tf20_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; diff --git a/src/devices/bus/gameboy/gb_slot.cpp b/src/devices/bus/gameboy/gb_slot.cpp index c6182053665..158d9b98be9 100644 --- a/src/devices/bus/gameboy/gb_slot.cpp +++ b/src/devices/bus/gameboy/gb_slot.cpp @@ -59,7 +59,7 @@ device_gb_cart_interface::~device_gb_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_gb_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_gb_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -73,7 +73,7 @@ void device_gb_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_gb_cart_interface::ram_alloc(UINT32 size) +void device_gb_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -84,7 +84,7 @@ void device_gb_cart_interface::ram_alloc(UINT32 size) // blocks, so to simplify ROM access //------------------------------------------------- -void device_gb_cart_interface::rom_map_setup(UINT32 size) +void device_gb_cart_interface::rom_map_setup(uint32_t size) { int i; // setup the rom_bank_map array to faster ROM read @@ -117,7 +117,7 @@ void device_gb_cart_interface::rom_map_setup(UINT32 size) // blocks, so to simplify ROM access //------------------------------------------------- -void device_gb_cart_interface::ram_map_setup(UINT8 banks) +void device_gb_cart_interface::ram_map_setup(uint8_t banks) { int mask = banks - 1; @@ -137,7 +137,7 @@ void device_gb_cart_interface::ram_map_setup(UINT8 banks) //------------------------------------------------- // base_gb_cart_slot_device - constructor //------------------------------------------------- -base_gb_cart_slot_device::base_gb_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +base_gb_cart_slot_device::base_gb_cart_slot_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_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -146,12 +146,12 @@ base_gb_cart_slot_device::base_gb_cart_slot_device(const machine_config &mconfig { } -gb_cart_slot_device::gb_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +gb_cart_slot_device::gb_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : base_gb_cart_slot_device(mconfig, GB_CART_SLOT, "Game Boy Cartridge Slot", tag, owner, clock, "gb_cart_slot", __FILE__) { } -megaduck_cart_slot_device::megaduck_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +megaduck_cart_slot_device::megaduck_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : base_gb_cart_slot_device(mconfig, MEGADUCK_CART_SLOT, "Megaduck Cartridge Slot", tag, owner, clock, "megaduck_cart_slot", __FILE__) { } @@ -262,9 +262,9 @@ image_init_result base_gb_cart_slot_device::call_load() { if (m_cart) { - UINT32 offset; - UINT32 len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); - UINT8 *ROM; + uint32_t offset; + uint32_t len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint8_t *ROM; int rambanks = 0; // From fullpath, check for presence of a header and skip it + check filesize is valid @@ -413,7 +413,7 @@ image_init_result megaduck_cart_slot_device::call_load() { if (m_cart) { - UINT32 len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); m_cart->rom_alloc(len, tag()); @@ -442,7 +442,7 @@ void base_gb_cart_slot_device::call_unload() battery_save(m_cart->get_ram_base(), m_cart->get_ram_size()); } -void base_gb_cart_slot_device::setup_ram(UINT8 banks) +void base_gb_cart_slot_device::setup_ram(uint8_t banks) { m_cart->ram_alloc(banks * 0x2000); memset(m_cart->get_ram_base(), 0xff, m_cart->get_ram_size()); @@ -452,12 +452,12 @@ void base_gb_cart_slot_device::setup_ram(UINT8 banks) // This fails to catch Mani 4-in-1 carts... even when they match this, then they have MBC1/3 in the internal header instead of MMM01... -bool base_gb_cart_slot_device::get_mmm01_candidate(UINT8 *ROM, UINT32 len) +bool base_gb_cart_slot_device::get_mmm01_candidate(uint8_t *ROM, uint32_t len) { if (len < 0x8147) return false; - static const UINT8 nintendo_logo[0x18] = { + static const uint8_t nintendo_logo[0x18] = { 0xCE, 0xED, 0x66, 0x66, 0xCC, 0x0D, 0x00, 0x0B, 0x03, 0x73, 0x00, 0x83, 0x00, 0x0C, 0x00, 0x0D, 0x00, 0x08, 0x11, 0x1F, 0x88, 0x89, 0x00, 0x0E @@ -475,7 +475,7 @@ bool base_gb_cart_slot_device::get_mmm01_candidate(UINT8 *ROM, UINT32 len) return false; } -int base_gb_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) +int base_gb_cart_slot_device::get_cart_type(uint8_t *ROM, uint32_t len) { int type = GB_MBC_NONE; @@ -596,8 +596,8 @@ std::string base_gb_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 len = m_file->size(), offset = 0; - std::vector rom(len); + uint32_t len = m_file->size(), offset = 0; + std::vector rom(len); int type; m_file->read(&rom[0], len); @@ -673,7 +673,7 @@ WRITE8_MEMBER(base_gb_cart_slot_device::write_ram) Internal header logging -------------------------------------------------*/ -void base_gb_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) +void base_gb_cart_slot_device::internal_header_logging(uint8_t *ROM, uint32_t len) { static const char *const cart_types[] = { @@ -695,7 +695,7 @@ void base_gb_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) // some company codes static const struct { - UINT16 code; + uint16_t code; const char *name; } companies[] = @@ -779,7 +779,7 @@ void base_gb_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) static const int ramsize[8] = { 0, 2, 8, 32, 128, 64, 0, 0 }; char soft[17]; - UINT32 tmp; + uint32_t tmp; int csum = 0, i = 0; int rom_banks; diff --git a/src/devices/bus/gameboy/gb_slot.h b/src/devices/bus/gameboy/gb_slot.h index d333c524b07..ff202fe0507 100644 --- a/src/devices/bus/gameboy/gb_slot.h +++ b/src/devices/bus/gameboy/gb_slot.h @@ -64,17 +64,17 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_ram) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } - void rom_map_setup(UINT32 size); - void ram_map_setup(UINT8 banks); + void rom_map_setup(uint32_t size); + void ram_map_setup(uint8_t banks); - virtual void set_additional_wirings(UINT8 mask, int shift) { } // MBC-1 will then overwrite this! + virtual void set_additional_wirings(uint8_t mask, int shift) { } // MBC-1 will then overwrite this! void set_has_timer(bool val) { has_timer = val; } void set_has_rumble(bool val) { has_rumble = val; } void set_has_battery(bool val) { has_battery = val; } @@ -83,9 +83,9 @@ public: void save_ram() { device().save_item(NAME(m_ram)); } // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; // bankswitch variables // we access ROM/RAM banks through these bank maps @@ -94,10 +94,10 @@ public: // 0x4000-0x7fff = rom_bank_map[m_latch_bank2] (generally defaults to m_latch_bank2 = 1) // 0xa000-0xbfff = ram_bank_map[m_ram_bank] (generally defaults to m_ram_bank = 0) // suitable writes to 0x0000-0x7fff can then modify m_latch_bank/m_latch_bank2 - UINT8 rom_bank_map[512]; // 16K chunks of ROM - UINT8 ram_bank_map[256]; // 16K chunks of RAM - UINT8 m_ram_bank; - UINT16 m_latch_bank, m_latch_bank2; + uint8_t rom_bank_map[512]; // 16K chunks of ROM + uint8_t ram_bank_map[256]; // 16K chunks of RAM + uint8_t m_ram_bank; + uint16_t m_latch_bank, m_latch_bank2; bool has_rumble, has_timer, has_battery; }; @@ -111,7 +111,7 @@ class base_gb_cart_slot_device : public device_t, { public: // construction/destruction - base_gb_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + base_gb_cart_slot_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 ~base_gb_cart_slot_device(); // device-level overrides @@ -124,13 +124,13 @@ public: virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } - int get_cart_type(UINT8 *ROM, UINT32 len); - bool get_mmm01_candidate(UINT8 *ROM, UINT32 len); + int get_cart_type(uint8_t *ROM, uint32_t len); + bool get_mmm01_candidate(uint8_t *ROM, uint32_t len); // remove me when SGB is properly emulated int get_sgb_hack() { return m_sgb_hack; } - void setup_ram(UINT8 banks); - void internal_header_logging(UINT8 *ROM, UINT32 len); + void setup_ram(uint8_t banks); + void internal_header_logging(uint8_t *ROM, uint32_t len); void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } @@ -166,7 +166,7 @@ class gb_cart_slot_device : public base_gb_cart_slot_device { public: // construction/destruction - gb_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -176,7 +176,7 @@ class megaduck_cart_slot_device : public base_gb_cart_slot_device { public: // construction/destruction - megaduck_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + megaduck_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // image-level overrides virtual image_init_result call_load() override; diff --git a/src/devices/bus/gameboy/mbc.cpp b/src/devices/bus/gameboy/mbc.cpp index cf5a6f44a98..6d131f7aea2 100644 --- a/src/devices/bus/gameboy/mbc.cpp +++ b/src/devices/bus/gameboy/mbc.cpp @@ -37,112 +37,112 @@ const device_type GB_ROM_ROCKMAN8 = &device_creator; const device_type GB_ROM_SM3SP = &device_creator; -gb_rom_mbc_device::gb_rom_mbc_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) +gb_rom_mbc_device::gb_rom_mbc_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_gb_cart_interface( mconfig, *this ), m_ram_enable(0) { } -gb_rom_mbc1_device::gb_rom_mbc1_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) +gb_rom_mbc1_device::gb_rom_mbc1_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) : gb_rom_mbc_device(mconfig, type, name, tag, owner, clock, shortname, source), m_mode(MODE_16M_64k), m_mask(0x1f), m_shift(0) { } -gb_rom_mbc1_device::gb_rom_mbc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_mbc1_device::gb_rom_mbc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_MBC1, "GB MBC1 Carts", tag, owner, clock, "gb_rom_mbc1", __FILE__), m_mode(MODE_16M_64k), m_mask(0x1f), m_shift(0) { } -gb_rom_mbc2_device::gb_rom_mbc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_mbc2_device::gb_rom_mbc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_MBC2, "GB MBC2 Carts", tag, owner, clock, "gb_rom_mbc2", __FILE__) { } -gb_rom_mbc3_device::gb_rom_mbc3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_mbc3_device::gb_rom_mbc3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_MBC3, "GB MBC3 Carts", tag, owner, clock, "gb_rom_mbc3", __FILE__) { } -gb_rom_mbc5_device::gb_rom_mbc5_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) +gb_rom_mbc5_device::gb_rom_mbc5_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) : gb_rom_mbc_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -gb_rom_mbc5_device::gb_rom_mbc5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_mbc5_device::gb_rom_mbc5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_MBC5, "GB MBC5 Carts", tag, owner, clock, "gb_rom_mbc5", __FILE__) { } -gb_rom_mbc6_device::gb_rom_mbc6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_mbc6_device::gb_rom_mbc6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_MBC6, "GB MBC6 Carts", tag, owner, clock, "gb_rom_mbc6", __FILE__), m_latch1(0), m_latch2(0), m_bank_4000(0), m_bank_6000(0) { } -gb_rom_mbc7_device::gb_rom_mbc7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_mbc7_device::gb_rom_mbc7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_MBC7, "GB MBC7 Carts", tag, owner, clock, "gb_rom_mbc7", __FILE__) { } -gb_rom_m161_device::gb_rom_m161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_m161_device::gb_rom_m161_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_M161, "GB M161 Carts", tag, owner, clock, "gb_rom_m161", __FILE__), m_base_bank(0), m_load_disable(0) { } -gb_rom_mmm01_device::gb_rom_mmm01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_mmm01_device::gb_rom_mmm01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_MMM01, "GB MMM01 Carts", tag, owner, clock, "gb_rom_mmm01", __FILE__), m_romb(0), m_romb_nwe(0), m_ramb(0), m_ramb_nwe(0), m_mode(0), m_mode_nwe(0), m_map(0), m_mux(0) { } -gb_rom_sachen_mmc1_device::gb_rom_sachen_mmc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_sachen_mmc1_device::gb_rom_sachen_mmc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_SACHEN1, "GB Sachen MMC1 Carts", tag, owner, clock, "gb_rom_sachen1", __FILE__), m_base_bank(0), m_mask(0), m_mode(0), m_unlock_cnt(0) { } -gb_rom_sachen_mmc1_device::gb_rom_sachen_mmc1_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) +gb_rom_sachen_mmc1_device::gb_rom_sachen_mmc1_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) : gb_rom_mbc_device(mconfig, type, name, tag, owner, clock, shortname, source), m_base_bank(0), m_mask(0), m_mode(0), m_unlock_cnt(0) { } -gb_rom_sachen_mmc2_device::gb_rom_sachen_mmc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_sachen_mmc2_device::gb_rom_sachen_mmc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_sachen_mmc1_device(mconfig, GB_ROM_SACHEN2, "GB Sachen MMC2 Carts", tag, owner, clock, "gb_rom_sachen2", __FILE__) { } -gb_rom_188in1_device::gb_rom_188in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_188in1_device::gb_rom_188in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc1_device(mconfig, GB_ROM_188IN1, "GB 188in1", tag, owner, clock, "gb_rom_188in1", __FILE__), m_game_base(0) { } -gb_rom_sintax_device::gb_rom_sintax_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_sintax_device::gb_rom_sintax_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_SINTAX, "GB MBC5 Sintax Carts", tag, owner, clock, "gb_rom_sintax", __FILE__), m_bank_mask(0), m_bank(0), m_reg(0), m_currentxor(0), m_xor2(0), m_xor3(0), m_xor4(0), m_xor5(0), m_sintax_mode(0) { } -gb_rom_chongwu_device::gb_rom_chongwu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_chongwu_device::gb_rom_chongwu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc5_device(mconfig, GB_ROM_CHONGWU, "GB Chong Wu Xiao Jing Ling", tag, owner, clock, "gb_rom_chongwu", __FILE__), m_protection_checked(0) { } -gb_rom_licheng_device::gb_rom_licheng_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_licheng_device::gb_rom_licheng_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc5_device(mconfig, GB_ROM_LICHENG, "GB MBC5 Li Cheng Carts", tag, owner, clock, "gb_rom_licheng", __FILE__) { } -gb_rom_digimon_device::gb_rom_digimon_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_digimon_device::gb_rom_digimon_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc5_device(mconfig, GB_ROM_DIGIMON, "GB Digimon", tag, owner, clock, "gb_rom_digimon", __FILE__) { } -gb_rom_rockman8_device::gb_rom_rockman8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_rockman8_device::gb_rom_rockman8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_ROCKMAN8, "GB MBC1 Rockman 8", tag, owner, clock, "gb_rom_rockman8", __FILE__), m_bank_mask(0), m_bank(0), m_reg(0) { } -gb_rom_sm3sp_device::gb_rom_sm3sp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_sm3sp_device::gb_rom_sm3sp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_mbc_device(mconfig, GB_ROM_SM3SP, "GB MBC1 Super Mario 3 Special", tag, owner, clock, "gb_rom_sm3sp", __FILE__), m_bank_mask(0), m_bank(0), m_reg(0), m_mode(0) { } @@ -719,9 +719,9 @@ WRITE8_MEMBER(gb_rom_m161_device::write_bank) READ8_MEMBER(gb_rom_mmm01_device::read_rom) { - UINT16 romb = m_romb & ~m_romb_nwe; - UINT16 romb_base = m_romb & (0x1e0 | m_romb_nwe); - UINT8 ramb_masked = ((offset & 0x4000) | m_mode ? m_ramb : m_ramb & ~0x03); + uint16_t romb = m_romb & ~m_romb_nwe; + uint16_t romb_base = m_romb & (0x1e0 | m_romb_nwe); + uint8_t ramb_masked = ((offset & 0x4000) | m_mode ? m_ramb : m_ramb & ~0x03); // zero-adjust RA18..RA14 romb = (romb ? romb : 0x01); @@ -793,8 +793,8 @@ WRITE8_MEMBER(gb_rom_mmm01_device::write_bank) READ8_MEMBER(gb_rom_mmm01_device::read_ram) { - UINT8 ramb_masked = ((offset & 0x4000) | m_mode ? m_ramb : m_ramb & ~0x03); - UINT8 ramb = ramb_masked; + uint8_t ramb_masked = ((offset & 0x4000) | m_mode ? m_ramb : m_ramb & ~0x03); + uint8_t ramb = ramb_masked; // multiplex with RA20..RA19 if (m_mux) @@ -810,8 +810,8 @@ READ8_MEMBER(gb_rom_mmm01_device::read_ram) WRITE8_MEMBER(gb_rom_mmm01_device::write_ram) { - UINT8 ramb_masked = ((offset & 0x4000) | m_mode ? m_ramb : m_ramb & ~0x03); - UINT8 ramb = ramb_masked; + uint8_t ramb_masked = ((offset & 0x4000) | m_mode ? m_ramb : m_ramb & ~0x03); + uint8_t ramb = ramb_masked; // multiplex with RA20..RA19 if (m_mux) @@ -827,7 +827,7 @@ WRITE8_MEMBER(gb_rom_mmm01_device::write_ram) READ8_MEMBER(gb_rom_sachen_mmc1_device::read_rom) { - UINT16 off_edit = offset; + uint16_t off_edit = offset; /* Wait for 0x31 transitions of A15 (hi -> lo), i.e. ROM accesses; A15 = HI while in bootstrap */ /* This is 0x31 transitions, because we increment counter _after_ checking it */ @@ -899,7 +899,7 @@ WRITE8_MEMBER(gb_rom_sachen_mmc1_device::write_bank) READ8_MEMBER(gb_rom_sachen_mmc2_device::read_rom) { - UINT16 off_edit = offset; + uint16_t off_edit = offset; /* Wait for 0x30 transitions of A15 (lo -> hi), i.e. ROM accesses; A15 = HI while in bootstrap */ /* This is 0x30 transitions, because we increment counter _after_ checking it, but A15 lo -> hi*/ @@ -1018,7 +1018,7 @@ READ8_MEMBER(gb_rom_chongwu_device::read_rom) // MBC5 variant used by Sintax games -void gb_rom_sintax_device::set_xor_for_bank(UINT8 bank) +void gb_rom_sintax_device::set_xor_for_bank(uint8_t bank) { switch (bank & 0x0f) { @@ -1259,7 +1259,7 @@ WRITE8_MEMBER(gb_rom_rockman8_device::write_ram) // writing data to 0x2000-0x2fff switches bank according to the table below // (the value values corresponding to table[0x0f] is not confirmed, choices // 0,1,2,3,8,c,f freeze the game, while 4,5,6,7,b,d,0x13 work with glitches) -static UINT8 smb3_table1[0x20] = +static uint8_t smb3_table1[0x20] = { 0x00,0x04,0x01,0x05, 0x02,0x06,0x03,0x05, 0x08,0x0c,0x03,0x0d, 0x03,0x0b,0x0b,0x08 /* original doc here put 0x0f (i.e. 11th unique bank) */, 0x05,0x06,0x0b,0x0d, 0x08,0x06,0x13,0x0b, 0x08,0x05,0x05,0x08, 0x0b,0x0d,0x06,0x05 diff --git a/src/devices/bus/gameboy/mbc.h b/src/devices/bus/gameboy/mbc.h index 827d42c392d..4a9b49bd52e 100644 --- a/src/devices/bus/gameboy/mbc.h +++ b/src/devices/bus/gameboy/mbc.h @@ -13,7 +13,7 @@ class gb_rom_mbc_device : public device_t, { public: // construction/destruction - gb_rom_mbc_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); + gb_rom_mbc_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-level overrides virtual void device_start() override { shared_start(); }; @@ -27,7 +27,7 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) override; virtual DECLARE_WRITE8_MEMBER(write_ram) override; - UINT8 m_ram_enable; + uint8_t m_ram_enable; }; // ======================> gb_rom_mbc1_device @@ -42,20 +42,20 @@ public: }; // construction/destruction - gb_rom_mbc1_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); - gb_rom_mbc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_mbc1_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); + gb_rom_mbc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); save_item(NAME(m_mode)); }; virtual void device_reset() override { shared_reset(); m_mode = MODE_16M_64k; }; - virtual void set_additional_wirings(UINT8 mask, int shift) override { m_mask = mask; m_shift = shift; } // these get set at cart loading + virtual void set_additional_wirings(uint8_t mask, int shift) override { m_mask = mask; m_shift = shift; } // these get set at cart loading virtual DECLARE_READ8_MEMBER(read_rom) override; virtual DECLARE_WRITE8_MEMBER(write_bank) override; virtual DECLARE_READ8_MEMBER(read_ram) override; virtual DECLARE_WRITE8_MEMBER(write_ram) override; - UINT8 m_mode, m_mask; + uint8_t m_mode, m_mask; int m_shift; }; @@ -65,7 +65,7 @@ class gb_rom_mbc2_device : public gb_rom_mbc_device { public: // construction/destruction - gb_rom_mbc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_mbc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -83,7 +83,7 @@ class gb_rom_mbc3_device : public gb_rom_mbc_device { public: // construction/destruction - gb_rom_mbc3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_mbc3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -96,7 +96,7 @@ public: private: void update_rtc(); - UINT8 m_rtc_regs[5]; + uint8_t m_rtc_regs[5]; int m_rtc_ready; }; @@ -106,8 +106,8 @@ class gb_rom_mbc5_device : public gb_rom_mbc_device { public: // construction/destruction - gb_rom_mbc5_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); - gb_rom_mbc5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_mbc5_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); + gb_rom_mbc5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -125,7 +125,7 @@ class gb_rom_mbc6_device : public gb_rom_mbc_device { public: // construction/destruction - gb_rom_mbc6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_mbc6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -135,8 +135,8 @@ public: virtual DECLARE_WRITE8_MEMBER(write_bank) override; virtual DECLARE_READ8_MEMBER(read_ram) override; virtual DECLARE_WRITE8_MEMBER(write_ram) override; - UINT16 m_latch1, m_latch2; - UINT8 m_bank_4000, m_bank_6000; + uint16_t m_latch1, m_latch2; + uint8_t m_bank_4000, m_bank_6000; }; // ======================> gb_rom_mbc7_device @@ -145,7 +145,7 @@ class gb_rom_mbc7_device : public gb_rom_mbc_device { public: // construction/destruction - gb_rom_mbc7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_mbc7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -164,7 +164,7 @@ class gb_rom_m161_device : public gb_rom_mbc_device public: // construction/destruction - gb_rom_m161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_m161_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -175,8 +175,8 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) override { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_ram) override { } - UINT8 m_base_bank; - UINT8 m_load_disable; + uint8_t m_base_bank; + uint8_t m_load_disable; }; // ======================> gb_rom_mmm01_device @@ -184,7 +184,7 @@ class gb_rom_mmm01_device : public gb_rom_mbc_device { public: // construction/destruction - gb_rom_mmm01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_mmm01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -196,14 +196,14 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) override; virtual DECLARE_WRITE8_MEMBER(write_ram) override; - UINT16 m_romb; - UINT8 m_romb_nwe; - UINT8 m_ramb; - UINT8 m_ramb_nwe; - UINT8 m_mode; - UINT8 m_mode_nwe; - UINT8 m_map; - UINT8 m_mux; + uint16_t m_romb; + uint8_t m_romb_nwe; + uint8_t m_ramb; + uint8_t m_ramb_nwe; + uint8_t m_mode; + uint8_t m_mode_nwe; + uint8_t m_map; + uint8_t m_mux; }; // ======================> gb_rom_sachen_mmc1_device @@ -218,8 +218,8 @@ public: }; // construction/destruction - gb_rom_sachen_mmc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - gb_rom_sachen_mmc1_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); + gb_rom_sachen_mmc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + gb_rom_sachen_mmc1_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-level overrides virtual void device_start() override; @@ -230,7 +230,7 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) override { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_ram) override { } - UINT8 m_base_bank, m_mask, m_mode, m_unlock_cnt; + uint8_t m_base_bank, m_mask, m_mode, m_unlock_cnt; }; // ======================> gb_rom_sachen_mmc2_device @@ -246,7 +246,7 @@ public: }; // construction/destruction - gb_rom_sachen_mmc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_sachen_mmc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -263,7 +263,7 @@ class gb_rom_188in1_device : public gb_rom_mbc1_device { public: // construction/destruction - gb_rom_188in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_188in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); save_item(NAME(m_game_base)); }; @@ -274,7 +274,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_bank) override; private: - UINT32 m_game_base; + uint32_t m_game_base; }; // ======================> gb_rom_sintax_device @@ -282,21 +282,21 @@ class gb_rom_sintax_device : public gb_rom_mbc_device { public: // construction/destruction - gb_rom_sintax_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_sintax_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; virtual void device_reset() override; - void set_xor_for_bank(UINT8 bank); + void set_xor_for_bank(uint8_t bank); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; virtual DECLARE_WRITE8_MEMBER(write_bank) override; virtual DECLARE_READ8_MEMBER(read_ram) override; virtual DECLARE_WRITE8_MEMBER(write_ram) override; - UINT8 m_bank_mask, m_bank, m_reg; + uint8_t m_bank_mask, m_bank, m_reg; - UINT8 m_currentxor, m_xor2, m_xor3, m_xor4, m_xor5, m_sintax_mode; + uint8_t m_currentxor, m_xor2, m_xor3, m_xor4, m_xor5, m_sintax_mode; }; // ======================> gb_rom_chongwu_device @@ -305,14 +305,14 @@ class gb_rom_chongwu_device : public gb_rom_mbc5_device { public: // construction/destruction - gb_rom_chongwu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_chongwu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; virtual void device_reset() override; virtual DECLARE_READ8_MEMBER(read_rom) override; - UINT8 m_protection_checked; + uint8_t m_protection_checked; }; // ======================> gb_rom_licheng_device @@ -321,7 +321,7 @@ class gb_rom_licheng_device : public gb_rom_mbc5_device { public: // construction/destruction - gb_rom_licheng_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_licheng_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_WRITE8_MEMBER(write_bank) override; }; @@ -332,7 +332,7 @@ class gb_rom_digimon_device : public gb_rom_mbc5_device { public: // construction/destruction - gb_rom_digimon_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_digimon_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -349,7 +349,7 @@ class gb_rom_rockman8_device : public gb_rom_mbc_device { public: // construction/destruction - gb_rom_rockman8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_rockman8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -360,7 +360,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_bank) override; virtual DECLARE_READ8_MEMBER(read_ram) override; virtual DECLARE_WRITE8_MEMBER(write_ram) override; - UINT8 m_bank_mask, m_bank, m_reg; + uint8_t m_bank_mask, m_bank, m_reg; }; // ======================> gb_rom_sm3sp_device @@ -368,7 +368,7 @@ class gb_rom_sm3sp_device : public gb_rom_mbc_device { public: // construction/destruction - gb_rom_sm3sp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_sm3sp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -379,7 +379,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_bank) override; virtual DECLARE_READ8_MEMBER(read_ram) override; virtual DECLARE_WRITE8_MEMBER(write_ram) override; - UINT8 m_bank_mask, m_bank, m_reg, m_mode; + uint8_t m_bank_mask, m_bank, m_reg, m_mode; }; diff --git a/src/devices/bus/gameboy/rom.cpp b/src/devices/bus/gameboy/rom.cpp index ff10094c3d0..609f30b8e52 100644 --- a/src/devices/bus/gameboy/rom.cpp +++ b/src/devices/bus/gameboy/rom.cpp @@ -29,51 +29,51 @@ const device_type GB_ROM_LASAMA = &device_creator; const device_type MEGADUCK_ROM = &device_creator; -gb_rom_device::gb_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +gb_rom_device::gb_rom_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_gb_cart_interface( mconfig, *this ) { } -gb_rom_device::gb_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_device::gb_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GB_STD_ROM, "GB Carts", tag, owner, clock, "gb_rom", __FILE__), device_gb_cart_interface( mconfig, *this ) { } -gb_rom_tama5_device::gb_rom_tama5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_tama5_device::gb_rom_tama5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_device(mconfig, GB_ROM_TAMA5, "GB Tamagotchi", tag, owner, clock, "gb_rom_tama5", __FILE__), m_tama5_data(0), m_tama5_addr(0), m_tama5_cmd(0), m_rtc_reg(0) { } -gb_rom_wisdom_device::gb_rom_wisdom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_wisdom_device::gb_rom_wisdom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_device(mconfig, GB_ROM_WISDOM, "GB Wisdom Tree Carts", tag, owner, clock, "gb_rom_wisdom", __FILE__) { } -gb_rom_yong_device::gb_rom_yong_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_yong_device::gb_rom_yong_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_device(mconfig, GB_ROM_YONG, "GB Yong Yong Carts", tag, owner, clock, "gb_rom_yong", __FILE__) { } -gb_rom_atvrac_device::gb_rom_atvrac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_atvrac_device::gb_rom_atvrac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_device(mconfig, GB_ROM_ATVRAC, "GB ATV Racin'", tag, owner, clock, "gb_rom_atvrac", __FILE__) { } -gb_rom_lasama_device::gb_rom_lasama_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gb_rom_lasama_device::gb_rom_lasama_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gb_rom_device(mconfig, GB_ROM_LASAMA, "GB LaSaMa", tag, owner, clock, "gb_rom_lasama", __FILE__) { } -megaduck_rom_device::megaduck_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +megaduck_rom_device::megaduck_rom_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_gb_cart_interface( mconfig, *this ) { } -megaduck_rom_device::megaduck_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +megaduck_rom_device::megaduck_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MEGADUCK_ROM, "MegaDuck Carts", tag, owner, clock, "megaduck_rom", __FILE__), device_gb_cart_interface( mconfig, *this ) { diff --git a/src/devices/bus/gameboy/rom.h b/src/devices/bus/gameboy/rom.h index 343d30195b0..99a1602efa9 100644 --- a/src/devices/bus/gameboy/rom.h +++ b/src/devices/bus/gameboy/rom.h @@ -13,8 +13,8 @@ class gb_rom_device : public device_t, { public: // construction/destruction - gb_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - gb_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_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); + gb_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -34,7 +34,7 @@ class gb_rom_tama5_device : public gb_rom_device { public: // construction/destruction - gb_rom_tama5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_tama5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -45,9 +45,9 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) override; virtual DECLARE_WRITE8_MEMBER(write_ram) override; - UINT16 m_tama5_data, m_tama5_addr, m_tama5_cmd; - UINT8 m_regs[32]; - UINT8 m_rtc_reg; + uint16_t m_tama5_data, m_tama5_addr, m_tama5_cmd; + uint8_t m_regs[32]; + uint8_t m_rtc_reg; }; // ======================> gb_rom_wisdom_device @@ -55,7 +55,7 @@ class gb_rom_wisdom_device : public gb_rom_device { public: // construction/destruction - gb_rom_wisdom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_wisdom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -71,7 +71,7 @@ class gb_rom_yong_device : public gb_rom_device { public: // construction/destruction - gb_rom_yong_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_yong_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -87,7 +87,7 @@ class gb_rom_atvrac_device : public gb_rom_device { public: // construction/destruction - gb_rom_atvrac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_atvrac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -103,7 +103,7 @@ class gb_rom_lasama_device : public gb_rom_device { public: // construction/destruction - gb_rom_lasama_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gb_rom_lasama_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { shared_start(); }; @@ -121,8 +121,8 @@ class megaduck_rom_device :public device_t, { public: // construction/destruction - megaduck_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - megaduck_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + megaduck_rom_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); + megaduck_rom_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/devices/bus/gamegear/ggext.cpp b/src/devices/bus/gamegear/ggext.cpp index fa09f4272a1..5aad987a7a7 100644 --- a/src/devices/bus/gamegear/ggext.cpp +++ b/src/devices/bus/gamegear/ggext.cpp @@ -54,7 +54,7 @@ device_gg_ext_port_interface::~device_gg_ext_port_interface() // gg_ext_port_device - constructor //------------------------------------------------- -gg_ext_port_device::gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +gg_ext_port_device::gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GG_EXT_PORT, "EXT Port", tag, owner, clock, "gg_ext_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr), m_th_pin_handler(*this), @@ -85,15 +85,15 @@ void gg_ext_port_device::device_start() } -UINT8 gg_ext_port_device::port_r() +uint8_t gg_ext_port_device::port_r() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_device) data = m_device->peripheral_r(); return data; } -void gg_ext_port_device::port_w( UINT8 data ) +void gg_ext_port_device::port_w( uint8_t data ) { if (m_device) m_device->peripheral_w(data); @@ -105,7 +105,7 @@ void gg_ext_port_device::th_pin_w(int state) m_th_pin_handler(state); } -UINT32 gg_ext_port_device::pixel_r() +uint32_t gg_ext_port_device::pixel_r() { return m_pixel_handler(); } diff --git a/src/devices/bus/gamegear/ggext.h b/src/devices/bus/gamegear/ggext.h index 0388838daaa..322de4812a4 100644 --- a/src/devices/bus/gamegear/ggext.h +++ b/src/devices/bus/gamegear/ggext.h @@ -52,7 +52,7 @@ class gg_ext_port_device : public device_t, { public: // construction/destruction - gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~gg_ext_port_device(); // static configuration helpers @@ -76,11 +76,11 @@ public: // bit 7 - pin 9 - TR (Button 2) // pin 10 - Not connected // - UINT8 port_r(); - void port_w( UINT8 data ); + uint8_t port_r(); + void port_w( uint8_t data ); void th_pin_w(int state); - UINT32 pixel_r(); + uint32_t pixel_r(); //protected: // device-level overrides @@ -104,8 +104,8 @@ public: device_gg_ext_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_gg_ext_port_interface(); - virtual UINT8 peripheral_r() { return 0xff; }; - virtual void peripheral_w(UINT8 data) { }; + virtual uint8_t peripheral_r() { return 0xff; }; + virtual void peripheral_w(uint8_t data) { }; protected: gg_ext_port_device *m_port; diff --git a/src/devices/bus/gamegear/smsctrladp.cpp b/src/devices/bus/gamegear/smsctrladp.cpp index 2aec892b279..065c9d7ca24 100644 --- a/src/devices/bus/gamegear/smsctrladp.cpp +++ b/src/devices/bus/gamegear/smsctrladp.cpp @@ -26,7 +26,7 @@ const device_type SMS_CTRL_ADAPTOR = &device_creator; // sms_ctrl_adaptor_device - constructor //------------------------------------------------- -sms_ctrl_adaptor_device::sms_ctrl_adaptor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sms_ctrl_adaptor_device::sms_ctrl_adaptor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_CTRL_ADAPTOR, "SMS Controller Adaptor", tag, owner, clock, "sms_ctrl_adaptor", __FILE__), device_gg_ext_port_interface(mconfig, *this), m_subctrl_port(*this, "ctrl") @@ -48,7 +48,7 @@ void sms_ctrl_adaptor_device::device_start() // sms_peripheral_r - sms_ctrl_adaptor read //------------------------------------------------- -UINT8 sms_ctrl_adaptor_device::peripheral_r() +uint8_t sms_ctrl_adaptor_device::peripheral_r() { return m_subctrl_port->port_r(); } @@ -58,7 +58,7 @@ UINT8 sms_ctrl_adaptor_device::peripheral_r() // sms_peripheral_w - sms_ctrl_adaptor write //------------------------------------------------- -void sms_ctrl_adaptor_device::peripheral_w(UINT8 data) +void sms_ctrl_adaptor_device::peripheral_w(uint8_t data) { m_subctrl_port->port_w(data); } diff --git a/src/devices/bus/gamegear/smsctrladp.h b/src/devices/bus/gamegear/smsctrladp.h index e06dc76163f..a4e85b4d50c 100644 --- a/src/devices/bus/gamegear/smsctrladp.h +++ b/src/devices/bus/gamegear/smsctrladp.h @@ -30,7 +30,7 @@ class sms_ctrl_adaptor_device : public device_t, { public: // construction/destruction - sms_ctrl_adaptor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_ctrl_adaptor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER(th_pin_w); DECLARE_READ32_MEMBER(pixel_r); @@ -41,8 +41,8 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; // device_gg_ext_port_interface overrides - virtual UINT8 peripheral_r() override; - virtual void peripheral_w(UINT8 data) override; + virtual uint8_t peripheral_r() override; + virtual void peripheral_w(uint8_t data) override; private: required_device m_subctrl_port; diff --git a/src/devices/bus/gba/gba_slot.cpp b/src/devices/bus/gba/gba_slot.cpp index ad03df06299..bfedecb9d0a 100644 --- a/src/devices/bus/gba/gba_slot.cpp +++ b/src/devices/bus/gba/gba_slot.cpp @@ -46,17 +46,17 @@ device_gba_cart_interface::~device_gba_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_gba_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_gba_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { if (size < 0x4000000) // we always alloc 32MB of rom region! - m_rom = (UINT32 *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); else { - m_rom = (UINT32 *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x4000000, 4, ENDIANNESS_LITTLE)->base(); - m_romhlp = (UINT32 *)device().machine().memory().region_alloc(std::string(tag).append(GBAHELP_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBASLOT_ROM_REGION_TAG).c_str(), 0x4000000, 4, ENDIANNESS_LITTLE)->base(); + m_romhlp = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(GBAHELP_ROM_REGION_TAG).c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); } m_rom_size = size; } @@ -67,9 +67,9 @@ void device_gba_cart_interface::rom_alloc(UINT32 size, const char *tag) // nvram_alloc - alloc the space for the ram //------------------------------------------------- -void device_gba_cart_interface::nvram_alloc(UINT32 size) +void device_gba_cart_interface::nvram_alloc(uint32_t size) { - m_nvram.resize(size/sizeof(UINT32)); + m_nvram.resize(size/sizeof(uint32_t)); } @@ -80,7 +80,7 @@ void device_gba_cart_interface::nvram_alloc(UINT32 size) //------------------------------------------------- // gba_cart_slot_device - constructor //------------------------------------------------- -gba_cart_slot_device::gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +gba_cart_slot_device::gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GBA_CART_SLOT, "Game Boy Advance Cartridge Slot", tag, owner, clock, "gba_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -180,8 +180,8 @@ image_init_result gba_cart_slot_device::call_load() { if (m_cart) { - UINT8 *ROM; - UINT32 size = (software_entry() != nullptr) ? get_software_region_length("rom") : length(); + uint8_t *ROM; + uint32_t size = (software_entry() != nullptr) ? get_software_region_length("rom") : length(); if (size > 0x4000000) { seterror(IMAGE_ERROR_UNSPECIFIED, "Attempted loading a cart larger than 64MB"); @@ -189,7 +189,7 @@ image_init_result gba_cart_slot_device::call_load() } m_cart->rom_alloc(size, tag()); - ROM = (UINT8 *)m_cart->get_rom_base(); + ROM = (uint8_t *)m_cart->get_rom_base(); if (software_entry() == nullptr) { @@ -230,7 +230,7 @@ image_init_result gba_cart_slot_device::call_load() break; } if (size == 0x4000000) - memcpy((UINT8 *)m_cart->get_romhlp_base(), ROM, 0x2000000); + memcpy((uint8_t *)m_cart->get_romhlp_base(), ROM, 0x2000000); if (m_cart->get_nvram_size()) battery_load(m_cart->get_nvram_base(), m_cart->get_nvram_size(), 0x00); @@ -259,7 +259,7 @@ void gba_cart_slot_device::call_unload() fullpath -------------------------------------------------*/ -static inline std::string gba_chip_string( UINT32 chip ) +static inline std::string gba_chip_string( uint32_t chip ) { std::string str; if (chip == 0) str += "NONE "; @@ -276,7 +276,7 @@ static inline std::string gba_chip_string( UINT32 chip ) } -static inline int gba_chip_has_conflict( UINT32 chip ) +static inline int gba_chip_has_conflict( uint32_t chip ) { int count1 = 0, count2 = 0; if (chip & GBA_CHIP_EEPROM) count1++; @@ -290,9 +290,9 @@ static inline int gba_chip_has_conflict( UINT32 chip ) } -int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) +int gba_cart_slot_device::get_cart_type(uint8_t *ROM, uint32_t len) { - UINT32 chip = 0; + uint32_t chip = 0; int type = GBA_STD; bool has_rtc = false; bool has_rumble = false; @@ -432,8 +432,8 @@ std::string gba_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 len = m_file->size(); - std::vector rom(len); + uint32_t len = m_file->size(); + std::vector rom(len); int type; m_file->read(&rom[0], len); @@ -500,6 +500,6 @@ WRITE32_MEMBER(gba_cart_slot_device::write_gpio) Internal header logging -------------------------------------------------*/ -void gba_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) +void gba_cart_slot_device::internal_header_logging(uint8_t *ROM, uint32_t len) { } diff --git a/src/devices/bus/gba/gba_slot.h b/src/devices/bus/gba/gba_slot.h index f9918744d97..b78e29b6a7a 100644 --- a/src/devices/bus/gba/gba_slot.h +++ b/src/devices/bus/gba/gba_slot.h @@ -51,24 +51,24 @@ public: virtual DECLARE_WRITE32_MEMBER(write_tilt) {}; virtual DECLARE_WRITE32_MEMBER(write_mapper) {}; - void rom_alloc(UINT32 size, const char *tag); - void nvram_alloc(UINT32 size); - UINT32* get_rom_base() { return m_rom; } - UINT32* get_romhlp_base() { return m_romhlp; } - UINT32* get_nvram_base() { return &m_nvram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_romhlp_size() { return m_romhlp_size; } - UINT32 get_nvram_size() { return m_nvram.size()*sizeof(UINT32); } - void set_rom_size(UINT32 val) { m_rom_size = val; } + void rom_alloc(uint32_t size, const char *tag); + void nvram_alloc(uint32_t size); + uint32_t* get_rom_base() { return m_rom; } + uint32_t* get_romhlp_base() { return m_romhlp; } + uint32_t* get_nvram_base() { return &m_nvram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_romhlp_size() { return m_romhlp_size; } + uint32_t get_nvram_size() { return m_nvram.size()*sizeof(uint32_t); } + void set_rom_size(uint32_t val) { m_rom_size = val; } void save_nvram() { device().save_item(NAME(m_nvram)); } // internal state - UINT32 *m_rom; // this points to the cart rom region - UINT32 m_rom_size; // this is the actual game size, not the rom region size! - UINT32 *m_romhlp; - UINT32 m_romhlp_size; - std::vector m_nvram; + uint32_t *m_rom; // this points to the cart rom region + uint32_t m_rom_size; // this is the actual game size, not the rom region size! + uint32_t *m_romhlp; + uint32_t m_romhlp_size; + std::vector m_nvram; }; @@ -80,7 +80,7 @@ class gba_cart_slot_device : public device_t, { public: // construction/destruction - gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~gba_cart_slot_device(); // device-level overrides @@ -93,12 +93,12 @@ public: virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } - int get_cart_type(UINT8 *ROM, UINT32 len); + int get_cart_type(uint8_t *ROM, uint32_t len); - void internal_header_logging(UINT8 *ROM, UINT32 len); + void internal_header_logging(uint8_t *ROM, uint32_t len); void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); } - UINT32 get_rom_size() { if (m_cart) return m_cart->get_rom_size(); return 0; } + uint32_t get_rom_size() { if (m_cart) return m_cart->get_rom_size(); return 0; } virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } @@ -168,7 +168,7 @@ extern const device_type GBA_CART_SLOT; struct gba_chip_fix_conflict_item { char game_code[5]; - UINT32 chip; + uint32_t chip; }; static const gba_chip_fix_conflict_item gba_chip_fix_conflict_list[] = diff --git a/src/devices/bus/gba/rom.cpp b/src/devices/bus/gba/rom.cpp index 4f10bbb0733..7080a60dc01 100644 --- a/src/devices/bus/gba/rom.cpp +++ b/src/devices/bus/gba/rom.cpp @@ -36,111 +36,111 @@ const device_type GBA_ROM_FLASH1M_RTC = &device_creator; -gba_rom_device::gba_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +gba_rom_device::gba_rom_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_gba_cart_interface( mconfig, *this ) { } -gba_rom_device::gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_device::gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GBA_ROM_STD, "GBA Carts", tag, owner, clock, "gba_rom", __FILE__), device_gba_cart_interface( mconfig, *this ) { } -gba_rom_sram_device::gba_rom_sram_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) +gba_rom_sram_device::gba_rom_sram_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) : gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -gba_rom_sram_device::gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_sram_device::gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_device(mconfig, GBA_ROM_SRAM, "GBA Carts + SRAM", tag, owner, clock, "gba_sram", __FILE__) { } -gba_rom_drilldoz_device::gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_drilldoz_device::gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_sram_device(mconfig, GBA_ROM_DRILLDOZ, "GBA Carts + SRAM + Rumble", tag, owner, clock, "gba_drilldoz", __FILE__) { } -gba_rom_wariotws_device::gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_wariotws_device::gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_sram_device(mconfig, GBA_ROM_WARIOTWS, "GBA Carts + SRAM + Rumble + Gyroscope", tag, owner, clock, "gba_wariotws", __FILE__), m_gyro_z(*this, "GYROZ") { } -gba_rom_eeprom_device::gba_rom_eeprom_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) +gba_rom_eeprom_device::gba_rom_eeprom_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) : gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -gba_rom_eeprom_device::gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_eeprom_device::gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_device(mconfig, GBA_ROM_EEPROM, "GBA Carts + EEPROM", tag, owner, clock, "gba_eeprom", __FILE__) { } -gba_rom_yoshiug_device::gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_yoshiug_device::gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_eeprom_device(mconfig, GBA_ROM_YOSHIUG, "GBA Carts + EEPROM + Tilt Sensor", tag, owner, clock, "gba_yoshiug", __FILE__), m_tilt_x(*this, "TILTX"), m_tilt_y(*this, "TILTY") { } -gba_rom_eeprom64_device::gba_rom_eeprom64_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) +gba_rom_eeprom64_device::gba_rom_eeprom64_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) : gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -gba_rom_eeprom64_device::gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_eeprom64_device::gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_device(mconfig, GBA_ROM_EEPROM64, "GBA Carts + EEPROM 64K", tag, owner, clock, "gba_eeprom64", __FILE__) { } -gba_rom_boktai_device::gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_boktai_device::gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_eeprom64_device(mconfig, GBA_ROM_BOKTAI, "GBA Carts + EEPROM 64K + RTC", tag, owner, clock, "gba_boktai", __FILE__), m_sensor(*this, "LIGHTSENSE") { } -gba_rom_flash_device::gba_rom_flash_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) +gba_rom_flash_device::gba_rom_flash_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) : gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_flash_mask(0), m_flash(*this, "flash") { } -gba_rom_flash_device::gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_flash_device::gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_device(mconfig, GBA_ROM_FLASH, "GBA Carts + Panasonic Flash", tag, owner, clock, "gba_flash", __FILE__), m_flash_mask(0), m_flash(*this, "flash") { } -gba_rom_flash_rtc_device::gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_flash_rtc_device::gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_flash_device(mconfig, GBA_ROM_FLASH_RTC, "GBA Carts + Panasonic Flash + RTC", tag, owner, clock, "gba_flash_rtc", __FILE__) { } -gba_rom_flash1m_device::gba_rom_flash1m_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) +gba_rom_flash1m_device::gba_rom_flash1m_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) : gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_flash_mask(0), m_flash(*this, "flash") { } -gba_rom_flash1m_device::gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_flash1m_device::gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_device(mconfig, GBA_ROM_FLASH1M, "GBA Carts + Sanyo Flash", tag, owner, clock, "gba_flash1m", __FILE__), m_flash_mask(0), m_flash(*this, "flash") { } -gba_rom_flash1m_rtc_device::gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_flash1m_rtc_device::gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_flash1m_device(mconfig, GBA_ROM_FLASH1M_RTC, "GBA Carts + Sanyo Flash + RTC", tag, owner, clock, "gba_flash1m_rtc", __FILE__) { } -gba_rom_3dmatrix_device::gba_rom_3dmatrix_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_rom_3dmatrix_device::gba_rom_3dmatrix_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gba_rom_device(mconfig, GBA_ROM_3DMATRIX, "GBA Carts + 3D Matrix Memory Mapper", tag, owner, clock, "gba_3dmatrix", __FILE__) { } @@ -194,7 +194,7 @@ void gba_rom_eeprom_device::device_start() { // for the moment we use a custom eeprom implementation, so we alloc/save it as nvram nvram_alloc(0x200); - m_eeprom = std::make_unique(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 6); + m_eeprom = std::make_unique(machine(), (uint8_t*)get_nvram_base(), get_nvram_size(), 6); } void gba_rom_yoshiug_device::device_start() @@ -217,7 +217,7 @@ void gba_rom_eeprom64_device::device_start() { // for the moment we use a custom eeprom implementation, so we alloc/save it as nvram nvram_alloc(0x2000); - m_eeprom = std::make_unique(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 14); + m_eeprom = std::make_unique(machine(), (uint8_t*)get_nvram_base(), get_nvram_size(), 14); } void gba_rom_boktai_device::device_start() @@ -287,7 +287,7 @@ READ32_MEMBER(gba_rom_device::read_gpio) default: if (ACCESSING_BITS_0_15) { - UINT16 ret = gpio_dev_read(m_gpio_dirs); + uint16_t ret = gpio_dev_read(m_gpio_dirs); return ret; } if (ACCESSING_BITS_16_31) @@ -355,7 +355,7 @@ WRITE32_MEMBER(gba_rom_sram_device::write_ram) // SRAM cart variant with additional Rumble motor (used by Drill Dozer) -void gba_rom_drilldoz_device::gpio_dev_write(UINT16 data, int gpio_dirs) +void gba_rom_drilldoz_device::gpio_dev_write(uint16_t data, int gpio_dirs) { if ((gpio_dirs & 0x08)) { @@ -377,7 +377,7 @@ ioport_constructor gba_rom_wariotws_device::device_input_ports() const return INPUT_PORTS_NAME( wariotws_gyroscope ); } -UINT16 gba_rom_wariotws_device::gpio_dev_read(int gpio_dirs) +uint16_t gba_rom_wariotws_device::gpio_dev_read(int gpio_dirs) { int gyro = 0; if (gpio_dirs == 0x0b) @@ -385,7 +385,7 @@ UINT16 gba_rom_wariotws_device::gpio_dev_read(int gpio_dirs) return (gyro << 2); } -void gba_rom_wariotws_device::gpio_dev_write(UINT16 data, int gpio_dirs) +void gba_rom_wariotws_device::gpio_dev_write(uint16_t data, int gpio_dirs) { if ((gpio_dirs & 0x08)) { @@ -423,7 +423,7 @@ machine_config_constructor gba_rom_flash_device::device_mconfig_additions() cons READ32_MEMBER(gba_rom_flash_device::read_ram) { - UINT32 rv = 0; + uint32_t rv = 0; offset &= m_flash_mask; @@ -474,7 +474,7 @@ machine_config_constructor gba_rom_flash1m_device::device_mconfig_additions() co READ32_MEMBER(gba_rom_flash1m_device::read_ram) { - UINT32 rv = 0; + uint32_t rv = 0; offset &= m_flash_mask; @@ -515,23 +515,23 @@ WRITE32_MEMBER(gba_rom_flash1m_device::write_ram) // cart variants with additional S3511 RTC -UINT16 gba_rom_flash_rtc_device::gpio_dev_read(int gpio_dirs) +uint16_t gba_rom_flash_rtc_device::gpio_dev_read(int gpio_dirs) { return 5 | (m_rtc->read_line() << 1); } -void gba_rom_flash_rtc_device::gpio_dev_write(UINT16 data, int gpio_dirs) +void gba_rom_flash_rtc_device::gpio_dev_write(uint16_t data, int gpio_dirs) { m_rtc->write(data, gpio_dirs); } -UINT16 gba_rom_flash1m_rtc_device::gpio_dev_read(int gpio_dirs) +uint16_t gba_rom_flash1m_rtc_device::gpio_dev_read(int gpio_dirs) { return 5 | (m_rtc->read_line() << 1); } -void gba_rom_flash1m_rtc_device::gpio_dev_write(UINT16 data, int gpio_dirs) +void gba_rom_flash1m_rtc_device::gpio_dev_write(uint16_t data, int gpio_dirs) { m_rtc->write(data, gpio_dirs); } @@ -687,13 +687,13 @@ ioport_constructor gba_rom_boktai_device::device_input_ports() const return INPUT_PORTS_NAME( boktai_sensor ); } -UINT16 gba_rom_boktai_device::gpio_dev_read(int gpio_dirs) +uint16_t gba_rom_boktai_device::gpio_dev_read(int gpio_dirs) { int light = (gpio_dirs == 7 && m_counter >= m_sensor->read()) ? 1 : 0; return 5 | (m_rtc->read_line() << 1) | (light << 3); } -void gba_rom_boktai_device::gpio_dev_write(UINT16 data, int gpio_dirs) +void gba_rom_boktai_device::gpio_dev_write(uint16_t data, int gpio_dirs) { m_rtc->write(data, gpio_dirs); if (gpio_dirs == 7) @@ -750,7 +750,7 @@ WRITE32_MEMBER(gba_rom_3dmatrix_device::write_mapper) { case 0: if (data == 0x1) // transfer data - memcpy((UINT8 *)m_romhlp + m_dst, (UINT8 *)m_rom + m_src, m_nblock * 0x200); + memcpy((uint8_t *)m_romhlp + m_dst, (uint8_t *)m_rom + m_src, m_nblock * 0x200); else printf("Unknown mapper command 0x%X\n", data); break; @@ -799,7 +799,7 @@ gba_s3511_device::gba_s3511_device(running_machine &machine) : } -UINT8 gba_s3511_device::convert_to_bcd(int val) +uint8_t gba_s3511_device::convert_to_bcd(int val) { return (((val % 100) / 10) << 4) | (val % 10); } @@ -850,7 +850,7 @@ int gba_s3511_device::read_line() } -void gba_s3511_device::write(UINT16 data, int gpio_dirs) +void gba_s3511_device::write(uint16_t data, int gpio_dirs) { // printf("gpio_dev_write data %X\n", data); if (m_phase == S3511_RTC_IDLE && (m_last_val & 5) == 1 && (data & 5) == 5) @@ -947,7 +947,7 @@ void gba_s3511_device::write(UINT16 data, int gpio_dirs) // -gba_eeprom_device::gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UINT32 size, int addr_bits) : +gba_eeprom_device::gba_eeprom_device(running_machine &machine, uint8_t *eeprom, uint32_t size, int addr_bits) : m_state(EEP_IDLE), m_machine(machine) { @@ -963,9 +963,9 @@ gba_eeprom_device::gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UI m_machine.save().save_item(m_eep_data, "GBA_EEPROM/m_eep_data"); } -UINT32 gba_eeprom_device::read() +uint32_t gba_eeprom_device::read() { - UINT32 out; + uint32_t out; switch (m_state) { @@ -1017,7 +1017,7 @@ UINT32 gba_eeprom_device::read() return 0; } -void gba_eeprom_device::write(UINT32 data) +void gba_eeprom_device::write(uint32_t data) { // printf("eeprom_w: %x @ %x (state %d) (PC=%x)\n", data, offset, m_state, space.device().safe_pc()); switch (m_state) diff --git a/src/devices/bus/gba/rom.h b/src/devices/bus/gba/rom.h index 13a69c44a65..a7886c79c59 100644 --- a/src/devices/bus/gba/rom.h +++ b/src/devices/bus/gba/rom.h @@ -22,16 +22,16 @@ public: running_machine &machine() const { return m_machine; } void update_time(int len); - UINT8 convert_to_bcd(int val); + uint8_t convert_to_bcd(int val); int read_line(); - void write(UINT16 data, int gpio_dirs); + void write(uint16_t data, int gpio_dirs); protected: int m_phase; - UINT8 m_last_val, m_bits, m_command; + uint8_t m_last_val, m_bits, m_command; int m_data_len; - UINT8 m_data[7]; + uint8_t m_data[7]; running_machine& m_machine; }; @@ -56,22 +56,22 @@ enum class gba_eeprom_device { public: - gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UINT32 size, int addr_bits); + gba_eeprom_device(running_machine &machine, uint8_t *eeprom, uint32_t size, int addr_bits); running_machine &machine() const { return m_machine; } - UINT32 read(); - void write(UINT32 data); + uint32_t read(); + void write(uint32_t data); protected: - UINT8 *m_data; - UINT32 m_data_size; + uint8_t *m_data; + uint32_t m_data_size; int m_state; int m_command; int m_count; int m_addr; int m_bits; int m_addr_bits; - UINT8 m_eep_data; + uint8_t m_eep_data; running_machine& m_machine; }; @@ -85,8 +85,8 @@ class gba_rom_device : public device_t, { public: // construction/destruction - gba_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_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); + gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -98,12 +98,12 @@ public: virtual DECLARE_READ32_MEMBER(read_gpio) override; virtual DECLARE_WRITE32_MEMBER(write_gpio) override; - virtual UINT16 gpio_dev_read(int gpio_dirs) { return 0; } - virtual void gpio_dev_write(UINT16 data, int gpio_dirs) {} + virtual uint16_t gpio_dev_read(int gpio_dirs) { return 0; } + virtual void gpio_dev_write(uint16_t data, int gpio_dirs) {} private: - UINT16 m_gpio_regs[4]; - UINT8 m_gpio_write_only, m_gpio_dirs; + uint16_t m_gpio_regs[4]; + uint8_t m_gpio_write_only, m_gpio_dirs; }; @@ -113,8 +113,8 @@ class gba_rom_sram_device : public gba_rom_device { public: // construction/destruction - gba_rom_sram_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); - gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_sram_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); + gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ32_MEMBER(read_ram) override; @@ -128,10 +128,10 @@ class gba_rom_drilldoz_device : public gba_rom_sram_device { public: // construction/destruction - gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides - virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override; + virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override; }; @@ -141,7 +141,7 @@ class gba_rom_wariotws_device : public gba_rom_sram_device { public: // construction/destruction - gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -149,11 +149,11 @@ public: virtual void device_start() override; virtual void device_reset() override; - virtual UINT16 gpio_dev_read(int gpio_dirs) override; - virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override; + virtual uint16_t gpio_dev_read(int gpio_dirs) override; + virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override; private: - UINT8 m_last_val; + uint8_t m_last_val; int m_counter; required_ioport m_gyro_z; }; @@ -165,8 +165,8 @@ class gba_rom_flash_device : public gba_rom_device { public: // construction/destruction - gba_rom_flash_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); - gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_flash_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); + gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -177,8 +177,8 @@ public: virtual DECLARE_WRITE32_MEMBER(write_ram) override; protected: - //UINT32 m_flash_size; - UINT32 m_flash_mask; + //uint32_t m_flash_size; + uint32_t m_flash_mask; required_device m_flash; }; @@ -189,12 +189,12 @@ class gba_rom_flash_rtc_device : public gba_rom_flash_device { public: // construction/destruction - gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; - virtual UINT16 gpio_dev_read(int gpio_dirs) override; - virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override; + virtual uint16_t gpio_dev_read(int gpio_dirs) override; + virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override; private: std::unique_ptr m_rtc; @@ -207,8 +207,8 @@ class gba_rom_flash1m_device : public gba_rom_device { public: // construction/destruction - gba_rom_flash1m_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); - gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_flash1m_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); + gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -219,8 +219,8 @@ public: virtual DECLARE_WRITE32_MEMBER(write_ram) override; protected: - //UINT32 m_flash_size; - UINT32 m_flash_mask; + //uint32_t m_flash_size; + uint32_t m_flash_mask; required_device m_flash; }; @@ -231,12 +231,12 @@ class gba_rom_flash1m_rtc_device : public gba_rom_flash1m_device { public: // construction/destruction - gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; - virtual UINT16 gpio_dev_read(int gpio_dirs) override; - virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override; + virtual uint16_t gpio_dev_read(int gpio_dirs) override; + virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override; private: std::unique_ptr m_rtc; @@ -249,8 +249,8 @@ class gba_rom_eeprom_device : public gba_rom_device { public: // construction/destruction - gba_rom_eeprom_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); - gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_eeprom_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); + gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -270,7 +270,7 @@ class gba_rom_yoshiug_device : public gba_rom_eeprom_device { public: // construction/destruction - gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -283,7 +283,7 @@ public: private: int m_tilt_ready; - UINT16 m_xpos, m_ypos; + uint16_t m_xpos, m_ypos; required_ioport m_tilt_x; required_ioport m_tilt_y; }; @@ -295,8 +295,8 @@ class gba_rom_eeprom64_device : public gba_rom_device { public: // construction/destruction - gba_rom_eeprom64_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); - gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_eeprom64_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); + gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -316,20 +316,20 @@ class gba_rom_boktai_device : public gba_rom_eeprom64_device { public: // construction/destruction - gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; virtual void device_reset() override; virtual ioport_constructor device_input_ports() const override; - virtual UINT16 gpio_dev_read(int gpio_dirs) override; - virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override; + virtual uint16_t gpio_dev_read(int gpio_dirs) override; + virtual void gpio_dev_write(uint16_t data, int gpio_dirs) override; private: std::unique_ptr m_rtc; required_ioport m_sensor; - UINT8 m_last_val; + uint8_t m_last_val; int m_counter; }; @@ -340,7 +340,7 @@ class gba_rom_3dmatrix_device : public gba_rom_device { public: // construction/destruction - gba_rom_3dmatrix_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_rom_3dmatrix_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -350,7 +350,7 @@ public: virtual DECLARE_WRITE32_MEMBER(write_mapper) override; private: - UINT32 m_src, m_dst, m_nblock; + uint32_t m_src, m_dst, m_nblock; }; diff --git a/src/devices/bus/generic/ram.cpp b/src/devices/bus/generic/ram.cpp index 3767ddae724..a27e0ddafcd 100644 --- a/src/devices/bus/generic/ram.cpp +++ b/src/devices/bus/generic/ram.cpp @@ -34,14 +34,14 @@ const device_type GENERIC_RAM_64K_LINEAR = &device_creator; -generic_ram_plain_device::generic_ram_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source) +generic_ram_plain_device::generic_ram_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t size, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_generic_cart_interface(mconfig, *this), m_size(size) { } -generic_ram_linear_device::generic_ram_linear_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source) +generic_ram_linear_device::generic_ram_linear_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t size, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_generic_cart_interface(mconfig, *this), m_size(size) @@ -49,32 +49,32 @@ generic_ram_linear_device::generic_ram_linear_device(const machine_config &mconf } -generic_ram_32k_plain_device::generic_ram_32k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_ram_32k_plain_device::generic_ram_32k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_ram_plain_device(mconfig, GENERIC_RAM_32K_PLAIN, "Generic RAM 32K (plain mapping)", tag, owner, clock, 0x8000, "generic_ram32p", __FILE__) { } -generic_ram_64k_plain_device::generic_ram_64k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_ram_64k_plain_device::generic_ram_64k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_ram_plain_device(mconfig, GENERIC_RAM_64K_PLAIN, "Generic RAM 64K (plain mapping)", tag, owner, clock, 0x10000, "generic_ram64p", __FILE__) { } -generic_ram_128k_plain_device::generic_ram_128k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_ram_128k_plain_device::generic_ram_128k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_ram_plain_device(mconfig, GENERIC_RAM_128K_PLAIN, "Generic RAM 128K (plain mapping)", tag, owner, clock, 0x20000, "generic_ram128p", __FILE__) { } -generic_ram_32k_linear_device::generic_ram_32k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_ram_32k_linear_device::generic_ram_32k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_ram_linear_device(mconfig, GENERIC_RAM_32K_LINEAR, "Generic RAM 32K (linear mapping)", tag, owner, clock, 0x8000, "generic_ram32l", __FILE__) { } -generic_ram_64k_linear_device::generic_ram_64k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_ram_64k_linear_device::generic_ram_64k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_ram_linear_device(mconfig, GENERIC_RAM_64K_LINEAR, "Generic RAM 64K (linear mapping)", tag, owner, clock, 0x10000, "generic_ram64l", __FILE__) { } -generic_ram_128k_linear_device::generic_ram_128k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_ram_128k_linear_device::generic_ram_128k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_ram_linear_device(mconfig, GENERIC_RAM_128K_LINEAR, "Generic RAM 128K (linear mapping)", tag, owner, clock, 0x20000, "generic_ram128l", __FILE__) { } diff --git a/src/devices/bus/generic/ram.h b/src/devices/bus/generic/ram.h index 487aa5aae1b..213ed8178db 100644 --- a/src/devices/bus/generic/ram.h +++ b/src/devices/bus/generic/ram.h @@ -13,7 +13,7 @@ class generic_ram_plain_device : public device_t, { public: // construction/destruction - generic_ram_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source); + generic_ram_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t size, const char *shortname, const char *source); // device-level overrides virtual void device_start() override; @@ -23,7 +23,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_ram) override; private: - UINT32 m_size; + uint32_t m_size; }; @@ -34,7 +34,7 @@ class generic_ram_linear_device : public device_t, { public: // construction/destruction - generic_ram_linear_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source); + generic_ram_linear_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t size, const char *shortname, const char *source); // device-level overrides virtual void device_start() override; @@ -44,7 +44,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_ram) override; private: - UINT32 m_size; + uint32_t m_size; }; @@ -54,21 +54,21 @@ class generic_ram_32k_plain_device : public generic_ram_plain_device { public: // construction/destruction - generic_ram_32k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_ram_32k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class generic_ram_64k_plain_device : public generic_ram_plain_device { public: // construction/destruction - generic_ram_64k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_ram_64k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class generic_ram_128k_plain_device : public generic_ram_plain_device { public: // construction/destruction - generic_ram_128k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_ram_128k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -78,21 +78,21 @@ class generic_ram_32k_linear_device : public generic_ram_linear_device { public: // construction/destruction - generic_ram_32k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_ram_32k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class generic_ram_64k_linear_device : public generic_ram_linear_device { public: // construction/destruction - generic_ram_64k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_ram_64k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class generic_ram_128k_linear_device : public generic_ram_linear_device { public: // construction/destruction - generic_ram_128k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_ram_128k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/generic/rom.cpp b/src/devices/bus/generic/rom.cpp index a816040e229..41a35c8be2b 100644 --- a/src/devices/bus/generic/rom.cpp +++ b/src/devices/bus/generic/rom.cpp @@ -31,28 +31,28 @@ const device_type GENERIC_ROM_LINEAR = &device_creator; -generic_rom_device::generic_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +generic_rom_device::generic_rom_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_generic_cart_interface(mconfig, *this) { } -generic_rom_plain_device::generic_rom_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +generic_rom_plain_device::generic_rom_plain_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) : generic_rom_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -generic_rom_plain_device::generic_rom_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_rom_plain_device::generic_rom_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_rom_device(mconfig, GENERIC_ROM_PLAIN, "Generic ROM (plain mapping)", tag, owner, clock, "generic_rom_plain", __FILE__) { } -generic_rom_linear_device::generic_rom_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_rom_linear_device::generic_rom_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_rom_device(mconfig, GENERIC_ROM_LINEAR, "Generic ROM (linear mapping)", tag, owner, clock, "generic_rom_linear", __FILE__) { } -generic_romram_plain_device::generic_romram_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_romram_plain_device::generic_romram_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_rom_plain_device(mconfig, GENERIC_ROMRAM_PLAIN, "Generic ROM + RAM (plain mapping)", tag, owner, clock, "generic_romram_plain", __FILE__) { } @@ -72,7 +72,7 @@ READ8_MEMBER(generic_rom_plain_device::read_rom) READ16_MEMBER(generic_rom_plain_device::read16_rom) { - UINT16 *ROM = (UINT16 *)m_rom; + uint16_t *ROM = (uint16_t *)m_rom; if (offset < m_rom_size/2) return ROM[offset]; else @@ -81,7 +81,7 @@ READ16_MEMBER(generic_rom_plain_device::read16_rom) READ32_MEMBER(generic_rom_plain_device::read32_rom) { - UINT32 *ROM = (UINT32 *)m_rom; + uint32_t *ROM = (uint32_t *)m_rom; if (offset < m_rom_size/4) return ROM[offset]; else @@ -96,13 +96,13 @@ READ8_MEMBER(generic_rom_linear_device::read_rom) READ16_MEMBER(generic_rom_linear_device::read16_rom) { - UINT16 *ROM = (UINT16 *)m_rom; + uint16_t *ROM = (uint16_t *)m_rom; return ROM[offset % (m_rom_size/2)]; } READ32_MEMBER(generic_rom_linear_device::read32_rom) { - UINT32 *ROM = (UINT32 *)m_rom; + uint32_t *ROM = (uint32_t *)m_rom; return ROM[offset % (m_rom_size/4)]; } diff --git a/src/devices/bus/generic/rom.h b/src/devices/bus/generic/rom.h index 73489ab0932..1cf583c0858 100644 --- a/src/devices/bus/generic/rom.h +++ b/src/devices/bus/generic/rom.h @@ -13,7 +13,7 @@ class generic_rom_device : public device_t, { public: // construction/destruction - generic_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + generic_rom_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-level overrides virtual void device_start() override {} @@ -26,8 +26,8 @@ class generic_rom_plain_device : public generic_rom_device { public: // construction/destruction - generic_rom_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - generic_rom_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_rom_plain_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); + generic_rom_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; @@ -42,7 +42,7 @@ class generic_romram_plain_device : public generic_rom_plain_device { public: // construction/destruction - generic_romram_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_romram_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_ram) override; @@ -56,7 +56,7 @@ class generic_rom_linear_device : public generic_rom_device { public: // construction/destruction - generic_rom_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_rom_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; diff --git a/src/devices/bus/generic/slot.cpp b/src/devices/bus/generic/slot.cpp index 71a5d0f1b0e..9b5ddc4e2c8 100644 --- a/src/devices/bus/generic/slot.cpp +++ b/src/devices/bus/generic/slot.cpp @@ -70,7 +70,7 @@ void device_generic_cart_interface::rom_alloc(size_t size, int width, endianness // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_generic_cart_interface::ram_alloc(UINT32 size) +void device_generic_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -84,7 +84,7 @@ void device_generic_cart_interface::ram_alloc(UINT32 size) //------------------------------------------------- // generic_slot_device - constructor //------------------------------------------------- -generic_slot_device::generic_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +generic_slot_device::generic_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GENERIC_SOCKET, "Generic ROM Socket / RAM Socket / Cartridge Slot", tag, owner, clock, "generic_socket", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -140,7 +140,7 @@ image_init_result generic_slot_device::call_load() return m_device_image_load(*this); else { - UINT32 len = common_get_size("rom"); + uint32_t len = common_get_size("rom"); rom_alloc(len, m_width, m_endianness); common_load_rom(get_rom_base(), len, "rom"); @@ -186,7 +186,7 @@ std::string generic_slot_device::get_default_card_software() for fullpath and for softlist -------------------------------------------------*/ -UINT32 generic_slot_device::common_get_size(const char *region) +uint32_t generic_slot_device::common_get_size(const char *region) { // if we are loading from softlist, you have to specify a region assert((software_entry() == nullptr) || (region != nullptr)); @@ -199,7 +199,7 @@ UINT32 generic_slot_device::common_get_size(const char *region) for fullpath and for softlist -------------------------------------------------*/ -void generic_slot_device::common_load_rom(UINT8 *ROM, UINT32 len, const char *region) +void generic_slot_device::common_load_rom(uint8_t *ROM, uint32_t len, const char *region) { // basic sanity check assert((ROM != nullptr) && (len > 0)); diff --git a/src/devices/bus/generic/slot.h b/src/devices/bus/generic/slot.h index 429441b3663..4bf58ff4a3d 100644 --- a/src/devices/bus/generic/slot.h +++ b/src/devices/bus/generic/slot.h @@ -29,23 +29,23 @@ public: virtual DECLARE_WRITE8_MEMBER(write_ram) {}; virtual void rom_alloc(size_t size, int width, endianness_t end, const char *tag); - virtual void ram_alloc(UINT32 size); + virtual void ram_alloc(uint32_t size); - UINT8* get_rom_base() { return m_rom; } - UINT32 get_rom_size() { return m_rom_size; } + uint8_t* get_rom_base() { return m_rom; } + uint32_t get_rom_size() { return m_rom_size; } - UINT8* get_region_base() { if (m_region.found()) return m_region->base(); return nullptr; } - UINT32 get_region_size() { if (m_region.found()) return m_region->bytes(); return 0; } + uint8_t* get_region_base() { if (m_region.found()) return m_region->base(); return nullptr; } + uint32_t get_region_size() { if (m_region.found()) return m_region->bytes(); return 0; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_ram_size() { return m_ram.size(); } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_ram_size() { return m_ram.size(); } void save_ram() { device().save_item(NAME(m_ram)); } // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; // this replaces m_rom for non-user configurable carts! optional_memory_region m_region; @@ -97,7 +97,7 @@ class generic_slot_device : public device_t, { public: // construction/destruction - generic_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~generic_slot_device(); static void static_set_device_load(device_t &device, device_image_load_delegate callback) { downcast(device).m_device_image_load = callback; } @@ -119,8 +119,8 @@ public: virtual void call_unload() override; virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - UINT32 common_get_size(const char *region); - void common_load_rom(UINT8 *ROM, UINT32 len, const char *region); + uint32_t common_get_size(const char *region); + void common_load_rom(uint8_t *ROM, uint32_t len, const char *region); virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } @@ -143,9 +143,9 @@ public: virtual DECLARE_WRITE8_MEMBER(write_ram); virtual void rom_alloc(size_t size, int width, endianness_t end) { if (m_cart) m_cart->rom_alloc(size, width, end, tag()); } - virtual void ram_alloc(UINT32 size) { if (m_cart) m_cart->ram_alloc(size); } + virtual void ram_alloc(uint32_t size) { if (m_cart) m_cart->ram_alloc(size); } - UINT8* get_rom_base() { + uint8_t* get_rom_base() { if (m_cart) { if (!user_loadable()) @@ -155,7 +155,7 @@ public: } return nullptr; } - UINT32 get_rom_size() { + uint32_t get_rom_size() { if (m_cart) { if (!user_loadable()) @@ -165,7 +165,7 @@ public: } return 0; } - UINT8* get_ram_base() { if (m_cart) return m_cart->get_ram_base(); return nullptr; } + uint8_t* get_ram_base() { if (m_cart) return m_cart->get_ram_base(); return nullptr; } void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); } diff --git a/src/devices/bus/hp9845_io/98035.cpp b/src/devices/bus/hp9845_io/98035.cpp index 5e06d4433c5..81dd6e33876 100644 --- a/src/devices/bus/hp9845_io/98035.cpp +++ b/src/devices/bus/hp9845_io/98035.cpp @@ -76,7 +76,7 @@ enum { MSEC_TMR_ID }; -hp98035_io_card::hp98035_io_card(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hp98035_io_card::hp98035_io_card(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hp9845_io_card_device(mconfig , HP98035_IO_CARD , "HP98035 card" , tag , owner , clock , "hp98035" , __FILE__) { } @@ -177,7 +177,7 @@ void hp98035_io_card::device_timer(emu_timer &timer, device_timer_id id, int par } // Every ms: advance active units - UINT8 triggered = 0; + uint8_t triggered = 0; for (timer_unit_t& unit : m_units) { if (unit.m_state != UNIT_IDLE) { if (unit.m_input && unit.m_state == UNIT_ACTIVE) { @@ -218,7 +218,7 @@ void hp98035_io_card::device_timer(emu_timer &timer, device_timer_id id, int par READ16_MEMBER(hp98035_io_card::reg_r) { - UINT16 res; + uint16_t res; switch (offset) { case 0: @@ -256,7 +256,7 @@ WRITE16_MEMBER(hp98035_io_card::reg_w) switch (offset) { case 0: // R4: IDR - m_idr = (UINT8)data; + m_idr = (uint8_t)data; m_idr_full = true; update_ibuffer(); break; @@ -337,7 +337,7 @@ void hp98035_io_card::update_ibuffer(void) void hp98035_io_card::process_ibuffer(void) { m_ibuffer[ m_ibuffer_ptr ] = '\0'; - const UINT8 *p = &m_ibuffer[ 0 ]; + const uint8_t *p = &m_ibuffer[ 0 ]; clear_obuffer(); @@ -345,7 +345,7 @@ void hp98035_io_card::process_ibuffer(void) while (*p != '\0' && !get_out) { std::ostringstream out; - UINT8 datetime[ 5 ]; + uint8_t datetime[ 5 ]; unsigned unit_no; switch (*p++) { @@ -447,7 +447,7 @@ void hp98035_io_card::process_ibuffer(void) m_ibuffer_ptr = 0; } -bool hp98035_io_card::assign_unit(timer_unit_t& unit , const UINT8*& p , bool input) +bool hp98035_io_card::assign_unit(timer_unit_t& unit , const uint8_t*& p , bool input) { unsigned port_no; @@ -473,13 +473,13 @@ bool hp98035_io_card::assign_unit(timer_unit_t& unit , const UINT8*& p , bool in } } -bool hp98035_io_card::parse_unit_command(const UINT8*& p, unsigned unit_no) +bool hp98035_io_card::parse_unit_command(const uint8_t*& p, unsigned unit_no) { unit_no--; timer_unit_t& unit = m_units[ unit_no ]; bool get_out = false; unsigned msec; - UINT8 to_match[ 5 ]; + uint8_t to_match[ 5 ]; std::ostringstream out; LOG(("U %c %u %p\n" , *p , unit_no , &unit)); @@ -607,7 +607,7 @@ void hp98035_io_card::clear_obuffer(void) m_obuffer_ptr = 0; } -void hp98035_io_card::set_obuffer(UINT8 b) +void hp98035_io_card::set_obuffer(uint8_t b) { m_obuffer[ 0 ] = b; m_obuffer_len = 1; @@ -632,12 +632,12 @@ void hp98035_io_card::update_obuffer(void) } } -void hp98035_io_card::set_error(UINT8 mask) +void hp98035_io_card::set_error(uint8_t mask) { m_error |= mask; } -bool hp98035_io_card::parse_datetime(const UINT8*& p, UINT8 *out) const +bool hp98035_io_card::parse_datetime(const uint8_t*& p, uint8_t *out) const { unsigned n_fields = 0; @@ -655,7 +655,7 @@ bool hp98035_io_card::parse_datetime(const UINT8*& p, UINT8 *out) const // Shift all fields one position to the left memmove(&out[ 0 ] , &out[ 1 ] , 4 * sizeof(out[ 0 ])); // Put the new field in the last position - out[ 4 ] = (UINT8)(tmp * 10 + *p - '0'); + out[ 4 ] = (uint8_t)(tmp * 10 + *p - '0'); n_fields++; p++; } @@ -686,7 +686,7 @@ bool hp98035_io_card::parse_datetime(const UINT8*& p, UINT8 *out) const return true; } // Month - UINT8 month; + uint8_t month; if (n_fields == 4) { month = m_mon; } else { @@ -703,7 +703,7 @@ bool hp98035_io_card::parse_datetime(const UINT8*& p, UINT8 *out) const return true; } -bool hp98035_io_card::parse_unit_no(const UINT8*& p, unsigned& unit) const +bool hp98035_io_card::parse_unit_no(const uint8_t*& p, unsigned& unit) const { if (*p < '1' || *p > '0' + HP98035_UNIT_COUNT) { return false; @@ -717,7 +717,7 @@ bool hp98035_io_card::parse_unit_no(const UINT8*& p, unsigned& unit) const return true; } -bool hp98035_io_card::parse_msec(const UINT8*& p, unsigned& msec) const +bool hp98035_io_card::parse_msec(const uint8_t*& p, unsigned& msec) const { msec = 0; diff --git a/src/devices/bus/hp9845_io/98035.h b/src/devices/bus/hp9845_io/98035.h index f3e9a21f7ac..c624e39e780 100644 --- a/src/devices/bus/hp9845_io/98035.h +++ b/src/devices/bus/hp9845_io/98035.h @@ -23,7 +23,7 @@ class hp98035_io_card : public hp9845_io_card_device { public: // construction/destruction - hp98035_io_card(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hp98035_io_card(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~hp98035_io_card(); // device-level overrides @@ -42,24 +42,24 @@ private: bool m_intflag; bool m_irq; bool m_idr_full; - UINT8 m_idr; // Input Data Register - UINT8 m_odr; // Output Data Register - UINT8 m_error; - UINT8 m_triggered; - UINT8 m_lost_irq; - UINT8 m_ibuffer[ HP98035_IBUFFER_LEN + 1 ]; + uint8_t m_idr; // Input Data Register + uint8_t m_odr; // Output Data Register + uint8_t m_error; + uint8_t m_triggered; + uint8_t m_lost_irq; + uint8_t m_ibuffer[ HP98035_IBUFFER_LEN + 1 ]; unsigned m_ibuffer_ptr; - UINT8 m_obuffer[ HP98035_OBUFFER_LEN ]; + uint8_t m_obuffer[ HP98035_OBUFFER_LEN ]; unsigned m_obuffer_len; unsigned m_obuffer_ptr; // Clock/timer state unsigned m_msec; // Milliseconds - UINT8 m_sec; // Seconds - UINT8 m_min; // Minutes - UINT8 m_hrs; // Hours - UINT8 m_dom; // Day of month - UINT8 m_mon; // Month + uint8_t m_sec; // Seconds + uint8_t m_min; // Minutes + uint8_t m_hrs; // Hours + uint8_t m_dom; // Day of month + uint8_t m_mon; // Month // Strangely enough this RTC has no notion of current year emu_timer *m_msec_timer; @@ -73,8 +73,8 @@ private: typedef struct { unit_state_t m_state; // State bool m_input; // Input or output - UINT8 m_port; // Assigned port # (0 if not assigned) - UINT8 m_match_datetime[ 4 ]; // Date&time to match (month is not included) + uint8_t m_port; // Assigned port # (0 if not assigned) + uint8_t m_match_datetime[ 4 ]; // Date&time to match (month is not included) unsigned m_delay; // Timer delay unsigned m_period; // Timer period (when != 0) unsigned m_value; // Current counter value @@ -91,16 +91,16 @@ private: void update_irq(void); void update_ibuffer(void); void process_ibuffer(void); - bool assign_unit(timer_unit_t& unit , const UINT8*& p , bool input); - bool parse_unit_command(const UINT8*& p, unsigned unit_no); + bool assign_unit(timer_unit_t& unit , const uint8_t*& p , bool input); + bool parse_unit_command(const uint8_t*& p, unsigned unit_no); void clear_obuffer(void); - void set_obuffer(UINT8 b); + void set_obuffer(uint8_t b); void set_obuffer(const char* s); void update_obuffer(void); - void set_error(UINT8 mask); - bool parse_datetime(const UINT8*& p, UINT8 *out) const; - bool parse_unit_no(const UINT8*& p, unsigned& unit) const; - bool parse_msec(const UINT8*& p, unsigned& msec) const; + void set_error(uint8_t mask); + bool parse_datetime(const uint8_t*& p, uint8_t *out) const; + bool parse_unit_no(const uint8_t*& p, unsigned& unit) const; + bool parse_msec(const uint8_t*& p, unsigned& msec) const; }; // device type definition diff --git a/src/devices/bus/hp9845_io/hp9845_io.cpp b/src/devices/bus/hp9845_io/hp9845_io.cpp index 7ea48639b15..7d34b8bb41d 100644 --- a/src/devices/bus/hp9845_io/hp9845_io.cpp +++ b/src/devices/bus/hp9845_io/hp9845_io.cpp @@ -17,7 +17,7 @@ const device_type HP9845_IO_SLOT = &device_creator; // +---------------------+ // |hp9845_io_slot_device| // +---------------------+ -hp9845_io_slot_device::hp9845_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +hp9845_io_slot_device::hp9845_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP9845_IO_SLOT, "HP9845 I/O Slot", tag, owner, clock, "hp9845_io_slot", __FILE__), device_slot_interface(mconfig, *this) { @@ -36,7 +36,7 @@ void hp9845_io_slot_device::device_start() // +---------------------+ // |hp9845_io_card_device| // +---------------------+ -hp9845_io_card_device::hp9845_io_card_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) : +hp9845_io_card_device::hp9845_io_card_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_slot_card_interface(mconfig, *this), m_sys(nullptr), diff --git a/src/devices/bus/hp9845_io/hp9845_io.h b/src/devices/bus/hp9845_io/hp9845_io.h index 61f8b57575e..b7446cae096 100644 --- a/src/devices/bus/hp9845_io/hp9845_io.h +++ b/src/devices/bus/hp9845_io/hp9845_io.h @@ -42,7 +42,7 @@ class hp9845_io_slot_device : public device_t, { public: // construction/destruction - hp9845_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hp9845_io_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~hp9845_io_slot_device(); // device-level overrides @@ -56,7 +56,7 @@ class hp9845_io_card_device : public device_t, { protected: // construction/destruction - hp9845_io_card_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); + hp9845_io_card_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 ~hp9845_io_card_device(); // device-level overrides @@ -64,7 +64,7 @@ protected: hp9845b_state *m_sys; required_ioport m_select_code_port; - UINT8 m_my_sc; + uint8_t m_my_sc; // card device handling void irq_w(int state); diff --git a/src/devices/bus/hp_optroms/hp_optrom.cpp b/src/devices/bus/hp_optroms/hp_optrom.cpp index 7d2de33fcf3..c741d8355d4 100644 --- a/src/devices/bus/hp_optroms/hp_optrom.cpp +++ b/src/devices/bus/hp_optroms/hp_optrom.cpp @@ -18,13 +18,13 @@ const device_type HP_OPTROM_SLOT = &device_creator; // +---------------------+ // |hp_optrom_cart_device| // +---------------------+ -hp_optrom_cart_device::hp_optrom_cart_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) : +hp_optrom_cart_device::hp_optrom_cart_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_slot_card_interface(mconfig, *this) { } -hp_optrom_cart_device::hp_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +hp_optrom_cart_device::hp_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP_OPTROM_CART, "HP9845 optional ROM cartridge", tag, owner, clock, "hp_optrom_cart", __FILE__), device_slot_card_interface(mconfig, *this) { @@ -33,7 +33,7 @@ hp_optrom_cart_device::hp_optrom_cart_device(const machine_config &mconfig, cons // +---------------------+ // |hp_optrom_slot_device| // +---------------------+ -hp_optrom_slot_device::hp_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +hp_optrom_slot_device::hp_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP_OPTROM_SLOT, "HP9845 optional ROM Slot", tag, owner, clock, "hp_optrom_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -98,7 +98,7 @@ image_init_result hp_optrom_slot_device::call_load() logerror("hp_optrom: base_addr = %06x end_addr = %06x\n" , base_addr , end_addr); m_content.resize(length * 2); - UINT8 *buffer = m_content.data(); + uint8_t *buffer = m_content.data(); memcpy(buffer , get_software_region("rom") , length * 2); // Install ROM in address space of every CPU diff --git a/src/devices/bus/hp_optroms/hp_optrom.h b/src/devices/bus/hp_optroms/hp_optrom.h index 0ddd24b26c9..9d95ab76fe1 100644 --- a/src/devices/bus/hp_optroms/hp_optrom.h +++ b/src/devices/bus/hp_optroms/hp_optrom.h @@ -22,8 +22,8 @@ class hp_optrom_cart_device : public device_t, { public: // construction/destruction - hp_optrom_cart_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); - hp_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hp_optrom_cart_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); + hp_optrom_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -35,7 +35,7 @@ class hp_optrom_slot_device : public device_t, { public: // construction/destruction - hp_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hp_optrom_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~hp_optrom_slot_device(); // device-level overrides @@ -61,7 +61,7 @@ public: protected: hp_optrom_cart_device *m_cart; - std::vector m_content; + std::vector m_content; offs_t m_base_addr; offs_t m_end_addr; }; diff --git a/src/devices/bus/ieee488/c2031.cpp b/src/devices/bus/ieee488/c2031.cpp index 3fbd46e520f..93b184cb7da 100644 --- a/src/devices/bus/ieee488/c2031.cpp +++ b/src/devices/bus/ieee488/c2031.cpp @@ -132,7 +132,7 @@ READ8_MEMBER( c2031_device::via0_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // not ready for data data |= m_bus->nrfd_r() << 1; @@ -224,7 +224,7 @@ READ8_MEMBER( c2031_device::via1_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // write protect sense data |= !m_floppy->wpt_r() << 4; @@ -397,7 +397,7 @@ inline int c2031_device::get_device_number() // c2031_device - constructor //------------------------------------------------- -c2031_device::c2031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c2031_device::c2031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C2031, "C2031", tag, owner, clock, "c2031", __FILE__), device_ieee488_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), diff --git a/src/devices/bus/ieee488/c2031.h b/src/devices/bus/ieee488/c2031.h index 3a23feee2b7..3d64c7c4485 100644 --- a/src/devices/bus/ieee488/c2031.h +++ b/src/devices/bus/ieee488/c2031.h @@ -30,7 +30,7 @@ class c2031_device : public device_t, { public: // construction/destruction - c2031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c2031_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; diff --git a/src/devices/bus/ieee488/c2040.cpp b/src/devices/bus/ieee488/c2040.cpp index 2c6e82b1ce3..717f8feba30 100644 --- a/src/devices/bus/ieee488/c2040.cpp +++ b/src/devices/bus/ieee488/c2040.cpp @@ -265,7 +265,7 @@ READ8_MEMBER( c2040_t::riot1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // end or identify in data |= m_bus->eoi_r() << 5; @@ -331,7 +331,7 @@ READ8_MEMBER( c2040_t::riot1_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // device number selection data |= m_slot->get_address() - 8; @@ -674,7 +674,7 @@ inline void c2040_t::update_ieee_signals() // c2040_t - constructor //------------------------------------------------- -c2040_t::c2040_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) : +c2040_t::c2040_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), device_ieee488_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), @@ -694,7 +694,7 @@ c2040_t::c2040_t(const machine_config &mconfig, device_type type, const char *na { } -c2040_t::c2040_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c2040_t::c2040_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C2040, "C2040", tag, owner, clock, "c2040", __FILE__), device_ieee488_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), @@ -719,7 +719,7 @@ c2040_t::c2040_t(const machine_config &mconfig, const char *tag, device_t *owner // c3040_t - constructor //------------------------------------------------- -c3040_t::c3040_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c3040_t::c3040_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c2040_t(mconfig, C3040, "C3040", tag, owner, clock, "c3040", __FILE__) { } @@ -727,7 +727,7 @@ c3040_t::c3040_t(const machine_config &mconfig, const char *tag, device_t *owner // c4040_t - constructor //------------------------------------------------- -c4040_t::c4040_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c4040_t::c4040_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c2040_t(mconfig, C4040, "C4040", tag, owner, clock, "c4040", __FILE__) { } diff --git a/src/devices/bus/ieee488/c2040.h b/src/devices/bus/ieee488/c2040.h index bac0a52ec07..252b0956906 100644 --- a/src/devices/bus/ieee488/c2040.h +++ b/src/devices/bus/ieee488/c2040.h @@ -32,8 +32,8 @@ class c2040_t : public device_t, { public: // construction/destruction - c2040_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); - c2040_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c2040_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); + c2040_t(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; @@ -95,7 +95,7 @@ class c3040_t : public c2040_t { public: // construction/destruction - c3040_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c3040_t(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; @@ -111,7 +111,7 @@ class c4040_t : public c2040_t { public: // construction/destruction - c4040_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c4040_t(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; diff --git a/src/devices/bus/ieee488/c2040fdc.cpp b/src/devices/bus/ieee488/c2040fdc.cpp index 5cc70c7f571..3569a59f8b5 100644 --- a/src/devices/bus/ieee488/c2040fdc.cpp +++ b/src/devices/bus/ieee488/c2040fdc.cpp @@ -69,7 +69,7 @@ const tiny_rom_entry *c2040_fdc_t::device_rom_region() const // c2040_fdc_t - constructor //------------------------------------------------- -c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C2040_FDC, "C2040 FDC", tag, owner, clock, "c2040fdc", __FILE__), m_write_sync(*this), m_write_ready(*this), @@ -433,10 +433,10 @@ int c2040_fdc_t::get_next_bit(attotime &tm, const attotime &limit) READ8_MEMBER( c2040_fdc_t::read ) { - UINT8 e = checkpoint_live.e; + uint8_t e = checkpoint_live.e; offs_t i = checkpoint_live.i; - UINT8 data = GCR_DECODE(e, i); + uint8_t data = GCR_DECODE(e, i); if (LOG) logerror("%s %s VIA reads data %02x (%03x)\n", machine().time().as_string(), machine().describe_context(), data, checkpoint_live.shift_reg); diff --git a/src/devices/bus/ieee488/c2040fdc.h b/src/devices/bus/ieee488/c2040fdc.h index 3ff0856181b..348ff5e0469 100644 --- a/src/devices/bus/ieee488/c2040fdc.h +++ b/src/devices/bus/ieee488/c2040fdc.h @@ -45,7 +45,7 @@ class c2040_fdc_t : public device_t { public: // construction/destruction - c2040_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c2040_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_sync_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_sync.set_callback(object); } template static devcb_base &set_ready_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_ready.set_callback(object); } @@ -101,15 +101,15 @@ protected: int odd_hd; attotime edge; - UINT16 shift_reg; + uint16_t shift_reg; int cycle_counter; int cell_counter; int bit_counter; - UINT8 e; + uint8_t e; offs_t i; - UINT8 pi; - UINT16 shift_reg_write; + uint8_t pi; + uint16_t shift_reg_write; attotime write_start_time; attotime write_buffer[32]; int write_position; @@ -135,7 +135,7 @@ protected: int m_mode_sel; int m_rw_sel; int m_odd_hd; - UINT8 m_pi; + uint8_t m_pi; attotime m_period; diff --git a/src/devices/bus/ieee488/c8050.cpp b/src/devices/bus/ieee488/c8050.cpp index bdc1b848e3f..2532e90dcd3 100644 --- a/src/devices/bus/ieee488/c8050.cpp +++ b/src/devices/bus/ieee488/c8050.cpp @@ -312,7 +312,7 @@ READ8_MEMBER( c8050_t::riot1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // end or identify in data |= m_bus->eoi_r() << 5; @@ -378,7 +378,7 @@ READ8_MEMBER( c8050_t::riot1_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // device number selection data |= m_slot->get_address() - 8; @@ -817,7 +817,7 @@ inline void c8050_t::update_ieee_signals() // c8050_t - constructor //------------------------------------------------- -c8050_t::c8050_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) : +c8050_t::c8050_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), device_ieee488_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), @@ -836,7 +836,7 @@ c8050_t::c8050_t(const machine_config &mconfig, device_type type, const char *na { } -c8050_t::c8050_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c8050_t::c8050_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C8050, "C8050", tag, owner, clock, "c8050", __FILE__), device_ieee488_interface(mconfig, *this), m_maincpu(*this, M6502_TAG), @@ -860,7 +860,7 @@ c8050_t::c8050_t(const machine_config &mconfig, const char *tag, device_t *owner // c8250_t - constructor //------------------------------------------------- -c8250_t::c8250_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c8250_t::c8250_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c8050_t(mconfig, C8250, "C8250", tag, owner, clock, "c8250", __FILE__) { } @@ -868,7 +868,7 @@ c8250_t::c8250_t(const machine_config &mconfig, const char *tag, device_t *owner // c8250lp_t - constructor //------------------------------------------------- -c8250lp_t::c8250lp_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c8250lp_t::c8250lp_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c8050_t(mconfig, C8250LP, "C8250LP", tag, owner, clock, "c8250lp", __FILE__) { } @@ -876,7 +876,7 @@ c8250lp_t::c8250lp_t(const machine_config &mconfig, const char *tag, device_t *o // sfd1001_t - constructor //------------------------------------------------- -sfd1001_t::sfd1001_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sfd1001_t::sfd1001_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c8050_t(mconfig, SFD1001, "SFD1001", tag, owner, clock, "sfd1001", __FILE__) { } diff --git a/src/devices/bus/ieee488/c8050.h b/src/devices/bus/ieee488/c8050.h index e983ad06353..ab2c38c3b54 100644 --- a/src/devices/bus/ieee488/c8050.h +++ b/src/devices/bus/ieee488/c8050.h @@ -32,8 +32,8 @@ class c8050_t : public device_t, { public: // construction/destruction - c8050_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); - c8050_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c8050_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); + c8050_t(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; @@ -86,7 +86,7 @@ class c8250_t : public c8050_t { public: // construction/destruction - c8250_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c8250_t(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,7 +101,7 @@ class c8250lp_t : public c8050_t { public: // construction/destruction - c8250lp_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c8250lp_t(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; @@ -117,7 +117,7 @@ class sfd1001_t : public c8050_t { public: // construction/destruction - sfd1001_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sfd1001_t(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; diff --git a/src/devices/bus/ieee488/c8050fdc.cpp b/src/devices/bus/ieee488/c8050fdc.cpp index ce16035f6e1..7bde9374b74 100644 --- a/src/devices/bus/ieee488/c8050fdc.cpp +++ b/src/devices/bus/ieee488/c8050fdc.cpp @@ -71,7 +71,7 @@ const tiny_rom_entry *c8050_fdc_t::device_rom_region() const // c8050_fdc_t - constructor //------------------------------------------------- -c8050_fdc_t::c8050_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c8050_fdc_t::c8050_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C8050_FDC, "Commodore 8050 FDC", tag, owner, clock, "c8050fdc", __FILE__), m_write_sync(*this), m_write_ready(*this), @@ -498,7 +498,7 @@ void c8050_fdc_t::live_run(const attotime &limit) READ8_MEMBER( c8050_fdc_t::read ) { - UINT8 e = checkpoint_live.e; + uint8_t e = checkpoint_live.e; offs_t i = checkpoint_live.i; return GCR_DECODE(e, i); diff --git a/src/devices/bus/ieee488/c8050fdc.h b/src/devices/bus/ieee488/c8050fdc.h index 83cb6dde238..e77b92b17f5 100644 --- a/src/devices/bus/ieee488/c8050fdc.h +++ b/src/devices/bus/ieee488/c8050fdc.h @@ -47,7 +47,7 @@ class c8050_fdc_t : public device_t { public: // construction/destruction - c8050_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c8050_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_sync_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_sync.set_callback(object); } template static devcb_base &set_ready_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_ready.set_callback(object); } @@ -106,13 +106,13 @@ protected: int odd_hd; attotime edge; - UINT16 shift_reg; + uint16_t shift_reg; int bit_counter; - UINT8 e; + uint8_t e; offs_t i; - UINT8 pi; - UINT16 shift_reg_write; + uint8_t pi; + uint16_t shift_reg_write; }; devcb_write_line m_write_sync; @@ -136,7 +136,7 @@ protected: int m_mode_sel; int m_rw_sel; int m_odd_hd; - UINT8 m_pi; + uint8_t m_pi; live_info cur_live, checkpoint_live; fdc_pll_t cur_pll, checkpoint_pll; diff --git a/src/devices/bus/ieee488/c8280.cpp b/src/devices/bus/ieee488/c8280.cpp index da51423e394..faac9c5efeb 100644 --- a/src/devices/bus/ieee488/c8280.cpp +++ b/src/devices/bus/ieee488/c8280.cpp @@ -168,7 +168,7 @@ READ8_MEMBER( c8280_t::riot1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // end or identify in data |= m_bus->eoi_r() << 5; @@ -234,7 +234,7 @@ READ8_MEMBER( c8280_t::riot1_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // device number selection data |= m_slot->get_address() - 8; @@ -382,7 +382,7 @@ inline void c8280_t::update_ieee_signals() // c8280_t - constructor //------------------------------------------------- -c8280_t::c8280_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c8280_t::c8280_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C8280, "C8280", tag, owner, clock, "c8280", __FILE__), device_ieee488_interface(mconfig, *this), m_maincpu(*this, M6502_DOS_TAG), @@ -485,7 +485,7 @@ READ8_MEMBER( c8280_t::fk5_r ) */ - UINT8 data = m_fk5; + uint8_t data = m_fk5; data |= (m_floppy ? m_floppy->dskchg_r() : 1) << 3; data |= (m_floppy ? m_floppy->twosid_r() : 1) << 4; diff --git a/src/devices/bus/ieee488/c8280.h b/src/devices/bus/ieee488/c8280.h index a6c36b88489..1ca86cd8533 100644 --- a/src/devices/bus/ieee488/c8280.h +++ b/src/devices/bus/ieee488/c8280.h @@ -31,7 +31,7 @@ class c8280_t : public device_t, { public: // construction/destruction - c8280_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c8280_t(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; @@ -78,7 +78,7 @@ private: int m_atna; // attention acknowledge int m_ifc; - UINT8 m_fk5; + uint8_t m_fk5; }; diff --git a/src/devices/bus/ieee488/d9060.cpp b/src/devices/bus/ieee488/d9060.cpp index dbd7aba6fd7..01a9961b3d4 100644 --- a/src/devices/bus/ieee488/d9060.cpp +++ b/src/devices/bus/ieee488/d9060.cpp @@ -204,7 +204,7 @@ READ8_MEMBER( d9060_base_t::riot1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // end or identify in data |= m_bus->eoi_r() << 5; @@ -270,7 +270,7 @@ READ8_MEMBER( d9060_base_t::riot1_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // device number selection data |= m_slot->get_address() - 8; @@ -483,7 +483,7 @@ inline void d9060_base_t::update_ieee_signals() // d9060_base_t - constructor //------------------------------------------------- -d9060_base_t::d9060_base_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +d9060_base_t::d9060_base_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_ieee488_interface(mconfig, *this), m_maincpu(*this, M6502_DOS_TAG), @@ -507,7 +507,7 @@ d9060_base_t::d9060_base_t(const machine_config &mconfig, device_type type, cons // d9060_t - constructor //------------------------------------------------- -d9060_t::d9060_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +d9060_t::d9060_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : d9060_base_t(mconfig, D9060, "D9060", tag, owner, clock, TYPE_9060, "d9060", __FILE__) { } @@ -515,7 +515,7 @@ d9060_t::d9060_t(const machine_config &mconfig, const char *tag, device_t *owner // d9090_t - constructor //------------------------------------------------- -d9090_t::d9090_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +d9090_t::d9090_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : d9060_base_t(mconfig, D9090, "D9090", tag, owner, clock, TYPE_9090, "d9090", __FILE__) { } diff --git a/src/devices/bus/ieee488/d9060.h b/src/devices/bus/ieee488/d9060.h index 4dd5c6cb5b4..7dce8217344 100644 --- a/src/devices/bus/ieee488/d9060.h +++ b/src/devices/bus/ieee488/d9060.h @@ -38,7 +38,7 @@ public: }; // construction/destruction - d9060_base_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); + d9060_base_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; @@ -86,7 +86,7 @@ private: // SASI bus int m_enable; - UINT8 m_data; + uint8_t m_data; int m_variant; }; @@ -98,7 +98,7 @@ class d9060_t : public d9060_base_t { public: // construction/destruction - d9060_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + d9060_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -108,7 +108,7 @@ class d9090_t : public d9060_base_t { public: // construction/destruction - d9090_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + d9090_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/ieee488/hardbox.cpp b/src/devices/bus/ieee488/hardbox.cpp index 355f5dba2b8..aa19fe840de 100644 --- a/src/devices/bus/ieee488/hardbox.cpp +++ b/src/devices/bus/ieee488/hardbox.cpp @@ -138,7 +138,7 @@ WRITE8_MEMBER( hardbox_device::ppi0_pb_w ) READ8_MEMBER( hardbox_device::ppi0_pc_r ) { - UINT8 data = ioport("SW1")->read(); + uint8_t data = ioport("SW1")->read(); /* DIP switches on PC1,PC2,PC3 configure the IEEE-488 primary address. We get the address from the slot instead. */ @@ -168,7 +168,7 @@ READ8_MEMBER( hardbox_device::ppi1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= !m_bus->atn_r(); data |= !m_bus->dav_r() << 1; @@ -228,8 +228,8 @@ READ8_MEMBER( hardbox_device::ppi1_pc_r ) */ - UINT8 status = m_hdc->status_r(space, 0); - UINT8 data = 0; + uint8_t status = m_hdc->status_r(space, 0); + uint8_t data = 0; data |= (status & CONTROLLER_BUSY) ? 0 : 0x10; data |= (status & CONTROLLER_DIRECTION) ? 0 : 0x20; @@ -346,7 +346,7 @@ ioport_constructor hardbox_device::device_input_ports() const // hardbox_device - constructor //------------------------------------------------- -hardbox_device::hardbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hardbox_device::hardbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HARDBOX, "HardBox", tag, owner, clock, "hardbox", __FILE__), device_ieee488_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), diff --git a/src/devices/bus/ieee488/hardbox.h b/src/devices/bus/ieee488/hardbox.h index 2d5c382f4b6..8ea1acc5445 100644 --- a/src/devices/bus/ieee488/hardbox.h +++ b/src/devices/bus/ieee488/hardbox.h @@ -31,7 +31,7 @@ class hardbox_device : public device_t, { public: // construction/destruction - hardbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hardbox_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; diff --git a/src/devices/bus/ieee488/ieee488.cpp b/src/devices/bus/ieee488/ieee488.cpp index 38a1f538404..1b2f71c3f6a 100644 --- a/src/devices/bus/ieee488/ieee488.cpp +++ b/src/devices/bus/ieee488/ieee488.cpp @@ -63,7 +63,7 @@ device_ieee488_interface::~device_ieee488_interface() // ieee488_slot_device - constructor //------------------------------------------------- -ieee488_slot_device::ieee488_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ieee488_slot_device::ieee488_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IEEE488_SLOT, "IEEE-488 slot", tag, owner, clock, "ieee488_slot", __FILE__), device_slot_interface(mconfig, *this), m_address(0) { @@ -100,7 +100,7 @@ void ieee488_slot_device::device_start() // ieee488_device - constructor //------------------------------------------------- -ieee488_device::ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ieee488_device::ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IEEE488, "IEEE-488 bus", tag, owner, clock, "ieee488", __FILE__), m_write_eoi(*this), m_write_dav(*this), @@ -313,7 +313,7 @@ int ieee488_device::get_signal(int signal) // set_data - //------------------------------------------------- -void ieee488_device::set_data(device_t *device, UINT8 data) +void ieee488_device::set_data(device_t *device, uint8_t data) { if (device == this) { @@ -346,9 +346,9 @@ void ieee488_device::set_data(device_t *device, UINT8 data) // get_data - //------------------------------------------------- -UINT8 ieee488_device::get_data() +uint8_t ieee488_device::get_data() { - UINT8 data = m_dio; + uint8_t data = m_dio; daisy_entry *entry = m_device_list.first(); diff --git a/src/devices/bus/ieee488/ieee488.h b/src/devices/bus/ieee488/ieee488.h index 61018600ceb..13e6b88d61d 100644 --- a/src/devices/bus/ieee488/ieee488.h +++ b/src/devices/bus/ieee488/ieee488.h @@ -90,7 +90,7 @@ class ieee488_device : public device_t { public: // construction/destruction - ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_eoi_callback(_write wr) { m_write_eoi.set_callback(wr); } template void set_dav_callback(_write wr) { m_write_dav.set_callback(wr); } @@ -104,7 +104,7 @@ public: void add_device(ieee488_slot_device *slot, device_t *target); // reads for both host and peripherals - UINT8 dio_r() { return get_data(); } + uint8_t dio_r() { return get_data(); } DECLARE_READ8_MEMBER( dio_r ) { return get_data(); } DECLARE_READ_LINE_MEMBER( eoi_r ) { return get_signal(EOI); } DECLARE_READ_LINE_MEMBER( dav_r ) { return get_signal(DAV); } @@ -116,7 +116,7 @@ public: DECLARE_READ_LINE_MEMBER( ren_r ) { return get_signal(REN); } // writes for host (driver_device) - void dio_w(UINT8 data) { return set_data(this, data); } + void dio_w(uint8_t data) { return set_data(this, data); } DECLARE_WRITE8_MEMBER( dio_w ) { set_data(this, data); } DECLARE_WRITE_LINE_MEMBER( eoi_w ) { set_signal(this, EOI, state); } DECLARE_WRITE_LINE_MEMBER( dav_w ) { set_signal(this, DAV, state); } @@ -128,7 +128,7 @@ public: DECLARE_WRITE_LINE_MEMBER( ren_w ) { set_signal(this, REN, state); } // writes for peripherals (device_t) - void dio_w(device_t *device, UINT8 data) { set_data(device, data); } + void dio_w(device_t *device, uint8_t data) { set_data(device, data); } void eoi_w(device_t *device, int state) { set_signal(device, EOI, state); } void dav_w(device_t *device, int state) { set_signal(device, DAV, state); } void nrfd_w(device_t *device, int state) { set_signal(device, NRFD, state); } @@ -167,7 +167,7 @@ protected: device_ieee488_interface * m_interface; // associated device's daisy interface int m_line[SIGNAL_COUNT]; - UINT8 m_dio; + uint8_t m_dio; }; simple_list m_device_list; @@ -184,11 +184,11 @@ private: void set_signal(device_t *device, int signal, int state); int get_signal(int signal); - void set_data(device_t *device, UINT8 data); - UINT8 get_data(); + void set_data(device_t *device, uint8_t data); + uint8_t get_data(); int m_line[SIGNAL_COUNT]; - UINT8 m_dio; + uint8_t m_dio; }; @@ -199,7 +199,7 @@ class ieee488_slot_device : public device_t, { public: // construction/destruction - ieee488_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ieee488_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_address(int address) { m_address = address; } int get_address() { return m_address; } diff --git a/src/devices/bus/ieee488/shark.cpp b/src/devices/bus/ieee488/shark.cpp index 83a270f8894..7d6e81e6844 100644 --- a/src/devices/bus/ieee488/shark.cpp +++ b/src/devices/bus/ieee488/shark.cpp @@ -127,7 +127,7 @@ ioport_constructor mshark_device::device_input_ports() const // mshark_device - constructor //------------------------------------------------- -mshark_device::mshark_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mshark_device::mshark_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SHARK, "Mator SHARK", tag, owner, clock, "mshark", __FILE__), device_ieee488_interface(mconfig, *this), m_maincpu(*this, I8085_TAG) diff --git a/src/devices/bus/ieee488/shark.h b/src/devices/bus/ieee488/shark.h index 2be61a610c8..e7d92a5da4c 100644 --- a/src/devices/bus/ieee488/shark.h +++ b/src/devices/bus/ieee488/shark.h @@ -28,7 +28,7 @@ class mshark_device : public device_t, { public: // construction/destruction - mshark_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mshark_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; diff --git a/src/devices/bus/ieee488/softbox.cpp b/src/devices/bus/ieee488/softbox.cpp index 7d6dbce4651..7d586566e9a 100644 --- a/src/devices/bus/ieee488/softbox.cpp +++ b/src/devices/bus/ieee488/softbox.cpp @@ -128,7 +128,7 @@ READ8_MEMBER( softbox_device::ppi1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= !m_bus->atn_r(); data |= !m_bus->dav_r() << 1; @@ -186,8 +186,8 @@ READ8_MEMBER( softbox_device::ppi1_pc_r ) */ - UINT8 status = m_hdc->status_r(space, 0); - UINT8 data = 0; + uint8_t status = m_hdc->status_r(space, 0); + uint8_t data = 0; data |= (status & CONTROLLER_BUSY) ? 0 : 0x10; data |= (status & CONTROLLER_DIRECTION) ? 0 : 0x20; @@ -326,7 +326,7 @@ ioport_constructor softbox_device::device_input_ports() const // softbox_device - constructor //------------------------------------------------- -softbox_device::softbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +softbox_device::softbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SOFTBOX, "PET SoftBox", tag, owner, clock, "pet_softbox", __FILE__), device_ieee488_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), diff --git a/src/devices/bus/ieee488/softbox.h b/src/devices/bus/ieee488/softbox.h index 0b812e0a0c1..9b0d5611c1a 100644 --- a/src/devices/bus/ieee488/softbox.h +++ b/src/devices/bus/ieee488/softbox.h @@ -33,7 +33,7 @@ class softbox_device : public device_t, { public: // construction/destruction - softbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + softbox_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; diff --git a/src/devices/bus/imi7000/imi5000h.cpp b/src/devices/bus/imi7000/imi5000h.cpp index 6268e7875c6..73596f8505c 100644 --- a/src/devices/bus/imi7000/imi5000h.cpp +++ b/src/devices/bus/imi7000/imi5000h.cpp @@ -445,7 +445,7 @@ ioport_constructor imi5000h_device::device_input_ports() const // imi5000h_device - constructor //------------------------------------------------- -imi5000h_device::imi5000h_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +imi5000h_device::imi5000h_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IMI5000H, "IMI 5000H", tag, owner, clock, "imi5000h", __FILE__), device_imi7000_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), diff --git a/src/devices/bus/imi7000/imi5000h.h b/src/devices/bus/imi7000/imi5000h.h index 201142fb413..c8ac2492dc0 100644 --- a/src/devices/bus/imi7000/imi5000h.h +++ b/src/devices/bus/imi7000/imi5000h.h @@ -33,7 +33,7 @@ class imi5000h_device : public device_t, { public: // construction/destruction - imi5000h_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + imi5000h_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; diff --git a/src/devices/bus/imi7000/imi7000.cpp b/src/devices/bus/imi7000/imi7000.cpp index 8d6baaf0ef1..fa73e98b10b 100644 --- a/src/devices/bus/imi7000/imi7000.cpp +++ b/src/devices/bus/imi7000/imi7000.cpp @@ -50,7 +50,7 @@ device_imi7000_interface::device_imi7000_interface(const machine_config &mconfig // imi7000_slot_device - constructor //------------------------------------------------- -imi7000_slot_device::imi7000_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +imi7000_slot_device::imi7000_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IMI7000_SLOT, "IMI 7000 slot", tag, owner, clock, "imi7000_slot", __FILE__), device_slot_interface(mconfig, *this), m_card(nullptr) { @@ -75,7 +75,7 @@ void imi7000_slot_device::device_start() // imi7000_bus_device - constructor //------------------------------------------------- -imi7000_bus_device::imi7000_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +imi7000_bus_device::imi7000_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IMI7000_BUS, "IMI 7000 bus", tag, owner, clock, "imi7000", __FILE__) { } diff --git a/src/devices/bus/imi7000/imi7000.h b/src/devices/bus/imi7000/imi7000.h index e374fedb6d9..314b86c4302 100644 --- a/src/devices/bus/imi7000/imi7000.h +++ b/src/devices/bus/imi7000/imi7000.h @@ -74,7 +74,7 @@ class imi7000_bus_device : public device_t { public: // construction/destruction - imi7000_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + imi7000_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -91,7 +91,7 @@ class imi7000_slot_device : public device_t, { public: // construction/destruction - imi7000_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + imi7000_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides diff --git a/src/devices/bus/intv/ecs.cpp b/src/devices/bus/intv/ecs.cpp index 5585aa93650..f0e8540996e 100644 --- a/src/devices/bus/intv/ecs.cpp +++ b/src/devices/bus/intv/ecs.cpp @@ -27,7 +27,7 @@ const device_type INTV_ROM_ECS = &device_creator; -intv_ecs_device::intv_ecs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intv_ecs_device::intv_ecs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intv_rom_device(mconfig, INTV_ROM_ECS, "Intellivision ECS Expansion", tag, owner, clock, "intv_ecs", __FILE__), m_snd(*this, "ay8914"), m_subslot(*this, "subslot"), diff --git a/src/devices/bus/intv/ecs.h b/src/devices/bus/intv/ecs.h index 97d0c1e380c..e4d6867996e 100644 --- a/src/devices/bus/intv/ecs.h +++ b/src/devices/bus/intv/ecs.h @@ -15,7 +15,7 @@ class intv_ecs_device : public intv_rom_device { public: // construction/destruction - intv_ecs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intv_ecs_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/devices/bus/intv/rom.cpp b/src/devices/bus/intv/rom.cpp index 74b5664a6fc..a9f2d2cde82 100644 --- a/src/devices/bus/intv/rom.cpp +++ b/src/devices/bus/intv/rom.cpp @@ -23,29 +23,29 @@ const device_type INTV_ROM_GFACT = &device_creator; const device_type INTV_ROM_WSMLB = &device_creator; -intv_rom_device::intv_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +intv_rom_device::intv_rom_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_intv_cart_interface( mconfig, *this ) { } -intv_rom_device::intv_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intv_rom_device::intv_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INTV_ROM_STD, "Intellivision Standard Carts", tag, owner, clock, "intv_rom", __FILE__), device_intv_cart_interface( mconfig, *this ) { } -intv_ram_device::intv_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intv_ram_device::intv_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intv_rom_device(mconfig, INTV_ROM_RAM, "Intellivision Carts w/RAM", tag, owner, clock, "intv_ram", __FILE__) { } -intv_gfact_device::intv_gfact_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intv_gfact_device::intv_gfact_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intv_rom_device(mconfig, INTV_ROM_GFACT, "Intellivision Game Factory Cart", tag, owner, clock, "intv_gfact", __FILE__) { } -intv_wsmlb_device::intv_wsmlb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intv_wsmlb_device::intv_wsmlb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intv_rom_device(mconfig, INTV_ROM_WSMLB, "Intellivision World Series Baseball Cart", tag, owner, clock, "intv_wsmlb", __FILE__) { } diff --git a/src/devices/bus/intv/rom.h b/src/devices/bus/intv/rom.h index ec1b153071d..1db545b2678 100644 --- a/src/devices/bus/intv/rom.h +++ b/src/devices/bus/intv/rom.h @@ -13,8 +13,8 @@ class intv_rom_device : public device_t, { public: // construction/destruction - intv_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - intv_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intv_rom_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); + intv_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read_rom04) override { return INTV_ROM16_READ(offset + 0x0400); } @@ -44,7 +44,7 @@ class intv_ram_device : public intv_rom_device { public: // construction/destruction - intv_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intv_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read_ram) override { return (int)m_ram[offset & (m_ram.size() - 1)]; } @@ -57,7 +57,7 @@ class intv_gfact_device : public intv_rom_device { public: // construction/destruction - intv_gfact_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intv_gfact_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read_ram) override { return (int)m_ram[offset & (m_ram.size() - 1)]; } @@ -70,7 +70,7 @@ class intv_wsmlb_device : public intv_rom_device { public: // construction/destruction - intv_wsmlb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intv_wsmlb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/intv/slot.cpp b/src/devices/bus/intv/slot.cpp index eb60f1af14b..63bc7da4944 100644 --- a/src/devices/bus/intv/slot.cpp +++ b/src/devices/bus/intv/slot.cpp @@ -116,7 +116,7 @@ device_intv_cart_interface::~device_intv_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_intv_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_intv_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -131,7 +131,7 @@ void device_intv_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_intv_cart_interface::ram_alloc(UINT32 size) +void device_intv_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -144,7 +144,7 @@ void device_intv_cart_interface::ram_alloc(UINT32 size) //------------------------------------------------- // intv_cart_slot_device - constructor //------------------------------------------------- -intv_cart_slot_device::intv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +intv_cart_slot_device::intv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INTV_CART_SLOT, "Intellivision Cartridge Slot", tag, owner, clock, "intv_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -235,18 +235,18 @@ static const char *intv_get_slot(int type) image_init_result intv_cart_slot_device::load_fullpath() { - UINT8 temp; - UINT8 num_segments; - UINT8 start_seg; - UINT8 end_seg; + uint8_t temp; + uint8_t num_segments; + uint8_t start_seg; + uint8_t end_seg; - UINT32 current_address; - UINT32 end_address; + uint32_t current_address; + uint32_t end_address; - UINT8 high_byte; - UINT8 low_byte; + uint8_t high_byte; + uint8_t low_byte; - UINT8 *ROM; + uint8_t *ROM; /* if it is in .rom format, we enter here */ if (is_filetype("rom")) @@ -263,7 +263,7 @@ image_init_result intv_cart_slot_device::load_fullpath() return image_init_result::FAIL; m_cart->rom_alloc(0x20000, tag()); - ROM = (UINT8 *)m_cart->get_rom_base(); + ROM = (uint8_t *)m_cart->get_rom_base(); for (int i = 0; i < num_segments; i++) { @@ -312,7 +312,7 @@ image_init_result intv_cart_slot_device::load_fullpath() std::string extrainfo; m_cart->rom_alloc(0x20000, tag()); - ROM = (UINT8 *)m_cart->get_rom_base(); + ROM = (uint8_t *)m_cart->get_rom_base(); if (!hashfile_extrainfo(*this, extrainfo)) { @@ -395,7 +395,7 @@ image_init_result intv_cart_slot_device::call_load() return load_fullpath(); else { - UINT16 offset[] = { 0x400, 0x2000, 0x4000, 0x4800, 0x5000, 0x6000, 0x7000, 0x8000, 0x8800, 0x9000, 0xa000, 0xb000, 0xc000, 0xd000, 0xe000, 0xf000}; + uint16_t offset[] = { 0x400, 0x2000, 0x4000, 0x4800, 0x5000, 0x6000, 0x7000, 0x8000, 0x8800, 0x9000, 0xa000, 0xb000, 0xc000, 0xd000, 0xe000, 0xf000}; const char* region_name[] = {"0400", "2000", "4000", "4800", "5000", "6000", "7000", "8000", "8800", "9000", "A000", "B000", "C000", "D000", "E000", "F000"}; const char *pcb_name = get_feature("slot"); bool extra_bank = false; @@ -408,9 +408,9 @@ image_init_result intv_cart_slot_device::call_load() if (m_type == INTV_WSMLB) extra_bank = true; - UINT32 size; - UINT16 address; - UINT8 *ROM, *region; + uint32_t size; + uint16_t address; + uint8_t *ROM, *region; m_cart->rom_alloc(extra_bank ? 0x22000 : 0x20000, tag()); ROM = m_cart->get_rom_base(); @@ -452,8 +452,8 @@ std::string intv_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 len = m_file->size(); - std::vector rom(len); + uint32_t len = m_file->size(); + std::vector rom(len); int type = INTV_STD; m_file->read(&rom[0], len); diff --git a/src/devices/bus/intv/slot.h b/src/devices/bus/intv/slot.h index 37434b4e83d..2c70ae88534 100644 --- a/src/devices/bus/intv/slot.h +++ b/src/devices/bus/intv/slot.h @@ -25,7 +25,7 @@ enum #define INTV_ROM16_READ(addr) \ - (UINT16) (m_rom[(addr) << 1] | (m_rom[((addr) << 1) + 1] << 8)) + (uint16_t) (m_rom[(addr) << 1] | (m_rom[((addr) << 1) + 1] << 8)) // ======================> device_intv_cart_interface @@ -69,21 +69,21 @@ public: virtual DECLARE_WRITE16_MEMBER(write_rome0) {} virtual DECLARE_WRITE16_MEMBER(write_romf0) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } void save_ram() { device().save_item(NAME(m_ram)); } virtual void late_subslot_setup() {} protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; }; @@ -95,7 +95,7 @@ class intv_cart_slot_device : public device_t, { public: // construction/destruction - intv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~intv_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/intv/voice.cpp b/src/devices/bus/intv/voice.cpp index 08d0f7c8b10..9470e1314cf 100644 --- a/src/devices/bus/intv/voice.cpp +++ b/src/devices/bus/intv/voice.cpp @@ -21,7 +21,7 @@ const device_type INTV_ROM_VOICE = &device_creator; -intv_voice_device::intv_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intv_voice_device::intv_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intv_rom_device(mconfig, INTV_ROM_VOICE, "Intellivision Intellivoice Expansion", tag, owner, clock, "intv_voice", __FILE__), m_speech(*this, "sp0256_speech"), m_subslot(*this, "subslot"), diff --git a/src/devices/bus/intv/voice.h b/src/devices/bus/intv/voice.h index 379a286ad12..133f16c62a6 100644 --- a/src/devices/bus/intv/voice.h +++ b/src/devices/bus/intv/voice.h @@ -14,7 +14,7 @@ class intv_voice_device : public intv_rom_device { public: // construction/destruction - intv_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intv_voice_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/devices/bus/intv_ctrl/ctrl.cpp b/src/devices/bus/intv_ctrl/ctrl.cpp index d322a22cb46..2c55e2093c0 100644 --- a/src/devices/bus/intv_ctrl/ctrl.cpp +++ b/src/devices/bus/intv_ctrl/ctrl.cpp @@ -50,7 +50,7 @@ device_intv_control_port_interface::~device_intv_control_port_interface() // intv_control_port_device - constructor //------------------------------------------------- -intv_control_port_device::intv_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +intv_control_port_device::intv_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INTV_CONTROL_PORT, "Mattel Intellivision control port", tag, owner, clock, "intv_control_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) { @@ -76,9 +76,9 @@ void intv_control_port_device::device_start() } -UINT8 intv_control_port_device::read_ctrl() +uint8_t intv_control_port_device::read_ctrl() { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data |= m_device->read_ctrl(); return data; diff --git a/src/devices/bus/intv_ctrl/ctrl.h b/src/devices/bus/intv_ctrl/ctrl.h index 8188d1e0b60..d22be155f62 100644 --- a/src/devices/bus/intv_ctrl/ctrl.h +++ b/src/devices/bus/intv_ctrl/ctrl.h @@ -29,7 +29,7 @@ public: device_intv_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_intv_control_port_interface(); - virtual UINT8 read_ctrl() { return 0; }; + virtual uint8_t read_ctrl() { return 0; }; protected: intv_control_port_device *m_port; @@ -42,11 +42,11 @@ class intv_control_port_device : public device_t, { public: // construction/destruction - intv_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intv_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~intv_control_port_device(); DECLARE_READ8_MEMBER( ctrl_r ) { return read_ctrl(); } - UINT8 read_ctrl(); + uint8_t read_ctrl(); protected: // device-level overrides diff --git a/src/devices/bus/intv_ctrl/ecs_ctrl.cpp b/src/devices/bus/intv_ctrl/ecs_ctrl.cpp index dddd93093b8..0aa50e20e89 100644 --- a/src/devices/bus/intv_ctrl/ecs_ctrl.cpp +++ b/src/devices/bus/intv_ctrl/ecs_ctrl.cpp @@ -64,7 +64,7 @@ device_intvecs_control_port_interface::~device_intvecs_control_port_interface() // intvecs_control_port_device - constructor //------------------------------------------------- -intvecs_control_port_device::intvecs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +intvecs_control_port_device::intvecs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INTVECS_CONTROL_PORT, "Mattel Intellivision ECS control port (HACK)", tag, owner, clock, "intvecs_control_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) { @@ -90,23 +90,23 @@ void intvecs_control_port_device::device_start() } -UINT8 intvecs_control_port_device::read_portA() +uint8_t intvecs_control_port_device::read_portA() { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data |= m_device->read_portA(); return data; } -UINT8 intvecs_control_port_device::read_portB() +uint8_t intvecs_control_port_device::read_portB() { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data |= m_device->read_portB(); return data; } -void intvecs_control_port_device::write_portA(UINT8 data) +void intvecs_control_port_device::write_portA(uint8_t data) { if (m_device) m_device->write_portA(data); @@ -153,7 +153,7 @@ machine_config_constructor intvecs_ctrls_device::device_mconfig_additions() cons return MACHINE_CONFIG_NAME( intvecs_ctrls ); } -intvecs_ctrls_device::intvecs_ctrls_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +intvecs_ctrls_device::intvecs_ctrls_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ECS_CTRLS, "Mattel Intellivision ECS Hand Controller x2 (HACK)", tag, owner, clock, "intvecs_ctrls", __FILE__), device_intvecs_control_port_interface(mconfig, *this), m_hand1(*this, "port1"), @@ -169,12 +169,12 @@ void intvecs_ctrls_device::device_reset() { } -UINT8 intvecs_ctrls_device::read_portA() +uint8_t intvecs_ctrls_device::read_portA() { return m_hand1->read_ctrl(); } -UINT8 intvecs_ctrls_device::read_portB() +uint8_t intvecs_ctrls_device::read_portB() { return m_hand2->read_ctrl(); } @@ -279,7 +279,7 @@ ioport_constructor intvecs_keybd_device::device_input_ports() const return INPUT_PORTS_NAME( intvecs_keybd ); } -intvecs_keybd_device::intvecs_keybd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intvecs_keybd_device::intvecs_keybd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ECS_KEYBD, "Mattel Intellivision ECS Keyboard", tag, owner, clock, "intvecs_keybd", __FILE__) , device_intvecs_control_port_interface(mconfig, *this) , m_keybd(*this, "ROW.%u", 0) @@ -296,9 +296,9 @@ void intvecs_keybd_device::device_reset() m_psg_portA = 0; } -UINT8 intvecs_keybd_device::read_portB() +uint8_t intvecs_keybd_device::read_portB() { - UINT8 val = 0xff; + uint8_t val = 0xff; // return correct result if more than one bit of 0xFE is set for (int i = 0; i < 7; i++) { @@ -308,7 +308,7 @@ UINT8 intvecs_keybd_device::read_portB() return val; } -void intvecs_keybd_device::write_portA(UINT8 data) +void intvecs_keybd_device::write_portA(uint8_t data) { m_psg_portA = (~data) & 0xff; } @@ -412,7 +412,7 @@ ioport_constructor intvecs_synth_device::device_input_ports() const } -intvecs_synth_device::intvecs_synth_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +intvecs_synth_device::intvecs_synth_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ECS_SYNTH, "Mattel Intellivision ECS Synthetizer", tag, owner, clock, "intvecs_synth", __FILE__), device_intvecs_control_port_interface(mconfig, *this), m_synth(*this, "SYNTH.%u", 0) @@ -429,9 +429,9 @@ void intvecs_synth_device::device_reset() m_psg_portA = 0; } -UINT8 intvecs_synth_device::read_portB() +uint8_t intvecs_synth_device::read_portB() { - UINT8 val = 0xff; + uint8_t val = 0xff; // return correct result if more than one bit of 0xFE is set for (int i = 0; i < 7; i++) { @@ -441,7 +441,7 @@ UINT8 intvecs_synth_device::read_portB() return val; } -void intvecs_synth_device::write_portA(UINT8 data) +void intvecs_synth_device::write_portA(uint8_t data) { m_psg_portA = (~data) & 0xff; } diff --git a/src/devices/bus/intv_ctrl/ecs_ctrl.h b/src/devices/bus/intv_ctrl/ecs_ctrl.h index 136c7bfa9d9..61c70a529bd 100644 --- a/src/devices/bus/intv_ctrl/ecs_ctrl.h +++ b/src/devices/bus/intv_ctrl/ecs_ctrl.h @@ -31,9 +31,9 @@ public: device_intvecs_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_intvecs_control_port_interface(); - virtual UINT8 read_portA() { return 0xff; }; - virtual UINT8 read_portB() { return 0xff; }; - virtual void write_portA(UINT8 data) { }; + virtual uint8_t read_portA() { return 0xff; }; + virtual uint8_t read_portB() { return 0xff; }; + virtual void write_portA(uint8_t data) { }; protected: intvecs_control_port_device *m_port; @@ -46,7 +46,7 @@ class intvecs_control_port_device : public device_t, { public: // construction/destruction - intvecs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intvecs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~intvecs_control_port_device(); DECLARE_READ8_MEMBER( portA_r ) { return read_portA(); } @@ -56,9 +56,9 @@ public: protected: // device-level overrides virtual void device_start() override; - UINT8 read_portA(); - UINT8 read_portB(); - void write_portA(UINT8 data); + uint8_t read_portA(); + uint8_t read_portB(); + void write_portA(uint8_t data); device_intvecs_control_port_interface *m_device; }; @@ -92,7 +92,7 @@ class intvecs_ctrls_device : public device_t, { public: // construction/destruction - intvecs_ctrls_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intvecs_ctrls_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; @@ -102,8 +102,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_portA() override; - virtual UINT8 read_portB() override; + virtual uint8_t read_portA() override; + virtual uint8_t read_portB() override; private: required_device m_hand1; @@ -117,7 +117,7 @@ class intvecs_keybd_device : public device_t, { public: // construction/destruction - intvecs_keybd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intvecs_keybd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -127,11 +127,11 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_portB() override; - virtual void write_portA(UINT8 data) override; + virtual uint8_t read_portB() override; + virtual void write_portA(uint8_t data) override; private: - UINT8 m_psg_portA; + uint8_t m_psg_portA; required_ioport_array<7> m_keybd; }; @@ -142,7 +142,7 @@ class intvecs_synth_device : public device_t, { public: // construction/destruction - intvecs_synth_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intvecs_synth_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -152,11 +152,11 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_portB() override; - virtual void write_portA(UINT8 data) override; + virtual uint8_t read_portB() override; + virtual void write_portA(uint8_t data) override; private: - UINT8 m_psg_portA; + uint8_t m_psg_portA; required_ioport_array<7> m_synth; }; diff --git a/src/devices/bus/intv_ctrl/handctrl.cpp b/src/devices/bus/intv_ctrl/handctrl.cpp index 07154829d51..b1ccafdca4f 100644 --- a/src/devices/bus/intv_ctrl/handctrl.cpp +++ b/src/devices/bus/intv_ctrl/handctrl.cpp @@ -85,7 +85,7 @@ ioport_constructor intv_handctrl_device::device_input_ports() const // intv_handctrl_device - constructor //------------------------------------------------- -intv_handctrl_device::intv_handctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +intv_handctrl_device::intv_handctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INTV_HANDCTRL, "Mattel Intellivision Hand Controller", tag, owner, clock, "intv_hand", __FILE__), device_intv_control_port_interface(mconfig, *this), m_cfg(*this, "OPTIONS"), @@ -119,21 +119,21 @@ void intv_handctrl_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 intv_handctrl_device::read_ctrl() +uint8_t intv_handctrl_device::read_ctrl() { - static const UINT8 keypad_table[] = + static const uint8_t keypad_table[] = { 0xff, 0x3f, 0x9f, 0x5f, 0xd7, 0xb7, 0x77, 0xdb, 0xbb, 0x7b, 0xdd, 0xbd, 0x7d, 0xde, 0xbe, 0x7e }; - static const UINT8 disc_table[] = + static const uint8_t disc_table[] = { 0xf3, 0xe3, 0xe7, 0xf7, 0xf6, 0xe6, 0xee, 0xfe, 0xfc, 0xec, 0xed, 0xfd, 0xf9, 0xe9, 0xeb, 0xfb }; - static const UINT8 discyx_table[5][5] = + static const uint8_t discyx_table[5][5] = { { 0xe3, 0xf3, 0xfb, 0xeb, 0xe9 }, { 0xe7, 0xe3, 0xfb, 0xe9, 0xf9 }, @@ -143,7 +143,7 @@ UINT8 intv_handctrl_device::read_ctrl() }; int x, y; - UINT8 res = 0xff; + uint8_t res = 0xff; /* keypad */ x = m_keypad->read(); diff --git a/src/devices/bus/intv_ctrl/handctrl.h b/src/devices/bus/intv_ctrl/handctrl.h index 90c02d74793..e19921acb85 100644 --- a/src/devices/bus/intv_ctrl/handctrl.h +++ b/src/devices/bus/intv_ctrl/handctrl.h @@ -26,7 +26,7 @@ class intv_handctrl_device : public device_t, { public: // construction/destruction - intv_handctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intv_handctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,7 +37,7 @@ protected: virtual void device_reset() override; // device_intv_control_port_interface overrides - virtual UINT8 read_ctrl() override; + virtual uint8_t read_ctrl() override; private: required_ioport m_cfg; diff --git a/src/devices/bus/iq151/disc2.cpp b/src/devices/bus/iq151/disc2.cpp index 73690188954..d4eb9cb2139 100644 --- a/src/devices/bus/iq151/disc2.cpp +++ b/src/devices/bus/iq151/disc2.cpp @@ -48,7 +48,7 @@ const device_type IQ151_DISC2 = &device_creator; // iq151_disc2_device - constructor //------------------------------------------------- -iq151_disc2_device::iq151_disc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_disc2_device::iq151_disc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IQ151_DISC2, "IQ151 Disc2", tag, owner, clock, "iq151_disc2", __FILE__), device_iq151cart_interface( mconfig, *this ), m_fdc(*this, "fdc"), m_rom(nullptr), m_rom_enabled(false) @@ -61,7 +61,7 @@ iq151_disc2_device::iq151_disc2_device(const machine_config &mconfig, const char void iq151_disc2_device::device_start() { - m_rom = (UINT8*)memregion("disc2")->base(); + m_rom = (uint8_t*)memregion("disc2")->base(); } //------------------------------------------------- @@ -96,7 +96,7 @@ const tiny_rom_entry *iq151_disc2_device::device_rom_region() const // read //------------------------------------------------- -void iq151_disc2_device::read(offs_t offset, UINT8 &data) +void iq151_disc2_device::read(offs_t offset, uint8_t &data) { // interal ROM is mapped at 0xe000-0xe7ff if (offset >= 0xe000 && offset < 0xe800 && m_rom_enabled) @@ -108,7 +108,7 @@ void iq151_disc2_device::read(offs_t offset, UINT8 &data) // IO read //------------------------------------------------- -void iq151_disc2_device::io_read(offs_t offset, UINT8 &data) +void iq151_disc2_device::io_read(offs_t offset, uint8_t &data) { /* This is gross */ address_space *space = nullptr; @@ -122,7 +122,7 @@ void iq151_disc2_device::io_read(offs_t offset, UINT8 &data) // IO write //------------------------------------------------- -void iq151_disc2_device::io_write(offs_t offset, UINT8 data) +void iq151_disc2_device::io_write(offs_t offset, uint8_t data) { address_space *space = nullptr; if (offset == 0xab) diff --git a/src/devices/bus/iq151/disc2.h b/src/devices/bus/iq151/disc2.h index c4bffaa4333..f5f97698571 100644 --- a/src/devices/bus/iq151/disc2.h +++ b/src/devices/bus/iq151/disc2.h @@ -21,7 +21,7 @@ class iq151_disc2_device : { public: // construction/destruction - iq151_disc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_disc2_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; @@ -35,14 +35,14 @@ protected: virtual void device_reset() override; // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; - virtual void io_read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void io_read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; private: required_device m_fdc; - UINT8 * m_rom; + uint8_t * m_rom; bool m_rom_enabled; }; diff --git a/src/devices/bus/iq151/grafik.cpp b/src/devices/bus/iq151/grafik.cpp index 4d4a5f93bef..5e8793bb432 100644 --- a/src/devices/bus/iq151/grafik.cpp +++ b/src/devices/bus/iq151/grafik.cpp @@ -37,7 +37,7 @@ const device_type IQ151_GRAFIK = &device_creator; // iq151_grafik_device - constructor //------------------------------------------------- -iq151_grafik_device::iq151_grafik_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_grafik_device::iq151_grafik_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IQ151_GRAFIK, "IQ151 grafik", tag, owner, clock, "iq151_grafik", __FILE__), device_iq151cart_interface( mconfig, *this ), m_ppi8255(*this, "ppi8255"), m_posx(0), m_posy(0), m_all(0), m_pen(0), m_fast(0), m_ev(0), m_ex(0), m_sel(0) @@ -119,7 +119,7 @@ WRITE8_MEMBER(iq151_grafik_device::control_w) // IO read //------------------------------------------------- -void iq151_grafik_device::io_read(offs_t offset, UINT8 &data) +void iq151_grafik_device::io_read(offs_t offset, uint8_t &data) { if (offset >= 0xd0 && offset < 0xd4) { @@ -139,7 +139,7 @@ void iq151_grafik_device::io_read(offs_t offset, UINT8 &data) // IO write //------------------------------------------------- -void iq151_grafik_device::io_write(offs_t offset, UINT8 data) +void iq151_grafik_device::io_write(offs_t offset, uint8_t data) { if (offset >= 0xd0 && offset < 0xd4) { diff --git a/src/devices/bus/iq151/grafik.h b/src/devices/bus/iq151/grafik.h index 47a6287ec91..7f1ab66a5ef 100644 --- a/src/devices/bus/iq151/grafik.h +++ b/src/devices/bus/iq151/grafik.h @@ -21,7 +21,7 @@ class iq151_grafik_device : { public: // construction/destruction - iq151_grafik_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_grafik_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; @@ -37,23 +37,23 @@ protected: virtual void device_reset() override; // iq151cart_interface overrides - virtual void io_read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual void io_read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect) override; private: required_device m_ppi8255; - UINT8 m_posx; // horizontal position - UINT8 m_posy; // vertical position - UINT8 m_all; // 0: bit mode 1: byte mode - UINT8 m_pen; - UINT8 m_fast; - UINT8 m_ev; // enable video out - UINT8 m_ex; - UINT8 m_sel; // enable vram access - UINT8 m_videoram[0x4000]; + uint8_t m_posx; // horizontal position + uint8_t m_posy; // vertical position + uint8_t m_all; // 0: bit mode 1: byte mode + uint8_t m_pen; + uint8_t m_fast; + uint8_t m_ev; // enable video out + uint8_t m_ex; + uint8_t m_sel; // enable vram access + uint8_t m_videoram[0x4000]; }; diff --git a/src/devices/bus/iq151/iq151.cpp b/src/devices/bus/iq151/iq151.cpp index 9b4e4f0b107..2c478eeb8cf 100644 --- a/src/devices/bus/iq151/iq151.cpp +++ b/src/devices/bus/iq151/iq151.cpp @@ -52,7 +52,7 @@ device_iq151cart_interface::~device_iq151cart_interface() //------------------------------------------------- // iq151cart_slot_device - constructor //------------------------------------------------- -iq151cart_slot_device::iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +iq151cart_slot_device::iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IQ151CART_SLOT, "IQ151 cartridge slot", tag, owner, clock, "iq151cart_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), @@ -109,7 +109,7 @@ void iq151cart_slot_device::device_config_complete() read -------------------------------------------------*/ -void iq151cart_slot_device::read(offs_t offset, UINT8 &data) +void iq151cart_slot_device::read(offs_t offset, uint8_t &data) { if (m_cart) m_cart->read(offset, data); @@ -119,7 +119,7 @@ void iq151cart_slot_device::read(offs_t offset, UINT8 &data) write -------------------------------------------------*/ -void iq151cart_slot_device::write(offs_t offset, UINT8 data) +void iq151cart_slot_device::write(offs_t offset, uint8_t data) { if (m_cart) m_cart->write(offset, data); @@ -129,7 +129,7 @@ void iq151cart_slot_device::write(offs_t offset, UINT8 data) IO read -------------------------------------------------*/ -void iq151cart_slot_device::io_read(offs_t offset, UINT8 &data) +void iq151cart_slot_device::io_read(offs_t offset, uint8_t &data) { if (m_cart) m_cart->io_read(offset, data); @@ -140,7 +140,7 @@ void iq151cart_slot_device::io_read(offs_t offset, UINT8 &data) IO write -------------------------------------------------*/ -void iq151cart_slot_device::io_write(offs_t offset, UINT8 data) +void iq151cart_slot_device::io_write(offs_t offset, uint8_t data) { if (m_cart) m_cart->io_write(offset, data); @@ -167,7 +167,7 @@ image_init_result iq151cart_slot_device::call_load() if (m_cart) { offs_t read_length; - UINT8 *cart_base = m_cart->get_cart_base(); + uint8_t *cart_base = m_cart->get_cart_base(); if (cart_base != nullptr) { diff --git a/src/devices/bus/iq151/iq151.h b/src/devices/bus/iq151/iq151.h index 684aa00b8fd..851263f30f8 100644 --- a/src/devices/bus/iq151/iq151.h +++ b/src/devices/bus/iq151/iq151.h @@ -61,11 +61,11 @@ public: virtual ~device_iq151cart_interface(); // reading and writing - virtual void read(offs_t offset, UINT8 &data) { } - virtual void write(offs_t offset, UINT8 data) { } - virtual void io_read(offs_t offset, UINT8 &data) { } - virtual void io_write(offs_t offset, UINT8 data) { } - virtual UINT8* get_cart_base() { return nullptr; } + virtual void read(offs_t offset, uint8_t &data) { } + virtual void write(offs_t offset, uint8_t data) { } + virtual void io_read(offs_t offset, uint8_t &data) { } + virtual void io_write(offs_t offset, uint8_t data) { } + virtual uint8_t* get_cart_base() { return nullptr; } // video update virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect) { } @@ -79,7 +79,7 @@ class iq151cart_slot_device : public device_t, { public: // construction/destruction - iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~iq151cart_slot_device(); template static devcb_base &set_out_irq0_callback(device_t &device, _Object object) { return downcast(device).m_out_irq0_cb.set_callback(object); } @@ -110,10 +110,10 @@ public: virtual std::string get_default_card_software() override; // reading and writing - virtual void read(offs_t offset, UINT8 &data); - virtual void write(offs_t offset, UINT8 data); - virtual void io_read(offs_t offset, UINT8 &data); - virtual void io_write(offs_t offset, UINT8 data); + virtual void read(offs_t offset, uint8_t &data); + virtual void write(offs_t offset, uint8_t data); + virtual void io_read(offs_t offset, uint8_t &data); + virtual void io_write(offs_t offset, uint8_t data); virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect); devcb_write_line m_out_irq0_cb; diff --git a/src/devices/bus/iq151/minigraf.cpp b/src/devices/bus/iq151/minigraf.cpp index 82fc74ad523..be89a612a75 100644 --- a/src/devices/bus/iq151/minigraf.cpp +++ b/src/devices/bus/iq151/minigraf.cpp @@ -47,7 +47,7 @@ const device_type IQ151_MINIGRAF = &device_creator; // iq151_minigraf_device - constructor //------------------------------------------------- -iq151_minigraf_device::iq151_minigraf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_minigraf_device::iq151_minigraf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IQ151_MINIGRAF, "IQ151 Minigraf", tag, owner, clock, "iq151_minigraf", __FILE__), device_iq151cart_interface( mconfig, *this ), m_rom(nullptr), m_posx(0), m_posy(0), m_pen(0), m_control(0), m_paper(nullptr) { @@ -59,7 +59,7 @@ iq151_minigraf_device::iq151_minigraf_device(const machine_config &mconfig, cons void iq151_minigraf_device::device_start() { - m_rom = (UINT8*)memregion("minigraf")->base(); + m_rom = (uint8_t*)memregion("minigraf")->base(); // allocate a bitmap for represent the paper m_paper = std::make_unique(PAPER_WIDTH, PAPER_HEIGHT); @@ -103,7 +103,7 @@ const tiny_rom_entry *iq151_minigraf_device::device_rom_region() const // read //------------------------------------------------- -void iq151_minigraf_device::read(offs_t offset, UINT8 &data) +void iq151_minigraf_device::read(offs_t offset, uint8_t &data) { // interal ROM is mapped at 0xc000-0xc7ff if (offset >= 0xc000 && offset < 0xc800) @@ -114,7 +114,7 @@ void iq151_minigraf_device::read(offs_t offset, UINT8 &data) // IO write //------------------------------------------------- -void iq151_minigraf_device::io_write(offs_t offset, UINT8 data) +void iq151_minigraf_device::io_write(offs_t offset, uint8_t data) { if (offset >= 0xf0 && offset < 0xf4) { @@ -136,7 +136,7 @@ void iq151_minigraf_device::io_write(offs_t offset, UINT8 data) // Aritma MINIGRAF 0507 //************************************************************************** -inline int iq151_minigraf_device::get_direction(UINT8 old_val, UINT8 new_val) +inline int iq151_minigraf_device::get_direction(uint8_t old_val, uint8_t new_val) { if (new_val == 0 && old_val == 7) return +1; if (new_val == 7 && old_val == 0) return -1; @@ -144,7 +144,7 @@ inline int iq151_minigraf_device::get_direction(UINT8 old_val, UINT8 new_val) return (new_val - old_val); } -void iq151_minigraf_device::plotter_update(UINT8 control) +void iq151_minigraf_device::plotter_update(uint8_t control) { // update pen and paper positions m_posy += get_direction(m_control & 7, control & 7); @@ -154,10 +154,10 @@ void iq151_minigraf_device::plotter_update(UINT8 control) m_pen = BIT(control, 7); // clamp within range - m_posx = std::max(m_posx, 0); - m_posx = std::min(m_posx, PAPER_MAX_X); - m_posy = std::max(m_posy, 0); - m_posy = std::min(m_posy, PAPER_MAX_Y); + m_posx = std::max(m_posx, 0); + m_posx = std::min(m_posx, PAPER_MAX_X); + m_posy = std::max(m_posy, 0); + m_posy = std::min(m_posy, PAPER_MAX_Y); // if pen is down draws a point if (m_pen) diff --git a/src/devices/bus/iq151/minigraf.h b/src/devices/bus/iq151/minigraf.h index a4e382b8b43..ab70a07ad3c 100644 --- a/src/devices/bus/iq151/minigraf.h +++ b/src/devices/bus/iq151/minigraf.h @@ -20,7 +20,7 @@ class iq151_minigraf_device : { public: // construction/destruction - iq151_minigraf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_minigraf_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; @@ -31,20 +31,20 @@ protected: virtual void device_stop() override; // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; // Aritma MINIGRAF 0507 - void plotter_update(UINT8 control); - int get_direction(UINT8 old_val, UINT8 new_val); + void plotter_update(uint8_t control); + int get_direction(uint8_t old_val, uint8_t new_val); private: - UINT8 * m_rom; - INT16 m_posx; - INT16 m_posy; - UINT8 m_pen; - UINT8 m_control; + uint8_t * m_rom; + int16_t m_posx; + int16_t m_posy; + uint8_t m_pen; + uint8_t m_control; std::unique_ptr m_paper; }; diff --git a/src/devices/bus/iq151/ms151a.cpp b/src/devices/bus/iq151/ms151a.cpp index 4961fd61335..f9a35fc7a51 100644 --- a/src/devices/bus/iq151/ms151a.cpp +++ b/src/devices/bus/iq151/ms151a.cpp @@ -46,7 +46,7 @@ const device_type IQ151_MS151A = &device_creator; // iq151_ms151a_device - constructor //------------------------------------------------- -iq151_ms151a_device::iq151_ms151a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_ms151a_device::iq151_ms151a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IQ151_MS151A, "IQ151 MS151A", tag, owner, clock, "iq151_ms151a", __FILE__), device_iq151cart_interface( mconfig, *this ), m_rom(nullptr), m_posx(0), m_posy(0), m_pen(0), m_paper(nullptr) { @@ -58,7 +58,7 @@ iq151_ms151a_device::iq151_ms151a_device(const machine_config &mconfig, const ch void iq151_ms151a_device::device_start() { - m_rom = (UINT8*)memregion("ms151a")->base(); + m_rom = (uint8_t*)memregion("ms151a")->base(); // allocate a bitmap for represent the paper m_paper = std::make_unique(PAPER_WIDTH, PAPER_HEIGHT); @@ -102,7 +102,7 @@ const tiny_rom_entry *iq151_ms151a_device::device_rom_region() const // read //------------------------------------------------- -void iq151_ms151a_device::read(offs_t offset, UINT8 &data) +void iq151_ms151a_device::read(offs_t offset, uint8_t &data) { // interal ROM is mapped at 0xc000-0xc7ff if (offset >= 0xc000 && offset < 0xc800) @@ -113,7 +113,7 @@ void iq151_ms151a_device::read(offs_t offset, UINT8 &data) // IO read //------------------------------------------------- -void iq151_ms151a_device::io_read(offs_t offset, UINT8 &data) +void iq151_ms151a_device::io_read(offs_t offset, uint8_t &data) { if (offset == 0xc4) data = plotter_status(); @@ -123,7 +123,7 @@ void iq151_ms151a_device::io_read(offs_t offset, UINT8 &data) // IO write //------------------------------------------------- -void iq151_ms151a_device::io_write(offs_t offset, UINT8 data) +void iq151_ms151a_device::io_write(offs_t offset, uint8_t data) { if (offset >= 0xc0 && offset <= 0xc4) plotter_update(offset - 0xc0, data); @@ -134,7 +134,7 @@ void iq151_ms151a_device::io_write(offs_t offset, UINT8 data) // XY 4130/4131 //************************************************************************** -UINT8 iq151_ms151a_device::plotter_status() +uint8_t iq151_ms151a_device::plotter_status() { /* bit 7 - plotter READY line @@ -143,7 +143,7 @@ UINT8 iq151_ms151a_device::plotter_status() return 0x80; } -void iq151_ms151a_device::plotter_update(UINT8 offset, UINT8 data) +void iq151_ms151a_device::plotter_update(uint8_t offset, uint8_t data) { // update pen and paper positions switch (offset) diff --git a/src/devices/bus/iq151/ms151a.h b/src/devices/bus/iq151/ms151a.h index 56a6f39f0ef..1b090f5c093 100644 --- a/src/devices/bus/iq151/ms151a.h +++ b/src/devices/bus/iq151/ms151a.h @@ -20,7 +20,7 @@ class iq151_ms151a_device : { public: // construction/destruction - iq151_ms151a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_ms151a_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; @@ -31,20 +31,20 @@ protected: virtual void device_stop() override; // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; - virtual void io_read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void io_read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; // XY 4130/4131 - UINT8 plotter_status(); - void plotter_update(UINT8 offset, UINT8 data); + uint8_t plotter_status(); + void plotter_update(uint8_t offset, uint8_t data); private: - UINT8 * m_rom; - INT32 m_posx; - INT32 m_posy; - UINT8 m_pen; + uint8_t * m_rom; + int32_t m_posx; + int32_t m_posy; + uint8_t m_pen; std::unique_ptr m_paper; }; diff --git a/src/devices/bus/iq151/rom.cpp b/src/devices/bus/iq151/rom.cpp index 3079b731820..8a2f1816433 100644 --- a/src/devices/bus/iq151/rom.cpp +++ b/src/devices/bus/iq151/rom.cpp @@ -41,7 +41,7 @@ const device_type IQ151_AMOS3 = &device_creator; // iq151_rom_device - constructor //------------------------------------------------- -iq151_rom_device::iq151_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +iq151_rom_device::iq151_rom_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_iq151cart_interface(mconfig, *this), m_rom(nullptr) { @@ -53,7 +53,7 @@ iq151_rom_device::iq151_rom_device(const machine_config &mconfig, device_type ty void iq151_rom_device::device_start() { - m_rom = (UINT8*)memregion("rom")->base(); + m_rom = (uint8_t*)memregion("rom")->base(); } //------------------------------------------------- @@ -69,7 +69,7 @@ const tiny_rom_entry *iq151_rom_device::device_rom_region() const get_cart_base -------------------------------------------------*/ -UINT8* iq151_rom_device::get_cart_base() +uint8_t* iq151_rom_device::get_cart_base() { return m_rom; } @@ -83,7 +83,7 @@ UINT8* iq151_rom_device::get_cart_base() // iq151_basic6_device - constructor //------------------------------------------------- -iq151_basic6_device::iq151_basic6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_basic6_device::iq151_basic6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : iq151_rom_device(mconfig, IQ151_BASIC6, "IQ151 BASIC6", tag, owner, clock, "iq151_basic6", __FILE__) { } @@ -93,7 +93,7 @@ iq151_basic6_device::iq151_basic6_device(const machine_config &mconfig, const ch // read //------------------------------------------------- -void iq151_basic6_device::read(offs_t offset, UINT8 &data) +void iq151_basic6_device::read(offs_t offset, uint8_t &data) { if (offset >= 0xc800 && offset < 0xe800) data = m_rom[offset - 0xc800]; @@ -108,7 +108,7 @@ void iq151_basic6_device::read(offs_t offset, UINT8 &data) // iq151_basicg_device - constructor //------------------------------------------------- -iq151_basicg_device::iq151_basicg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_basicg_device::iq151_basicg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : iq151_rom_device(mconfig, IQ151_BASICG, "IQ151 BASICG", tag, owner, clock, "iq151_basicg", __FILE__) { } @@ -117,7 +117,7 @@ iq151_basicg_device::iq151_basicg_device(const machine_config &mconfig, const ch read -------------------------------------------------*/ -void iq151_basicg_device::read(offs_t offset, UINT8 &data) +void iq151_basicg_device::read(offs_t offset, uint8_t &data) { if (offset >= 0xb000 && offset < 0xc000) data = m_rom[offset & 0x0fff]; @@ -134,7 +134,7 @@ void iq151_basicg_device::read(offs_t offset, UINT8 &data) // iq151_amos1_device - constructor //------------------------------------------------- -iq151_amos1_device::iq151_amos1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_amos1_device::iq151_amos1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : iq151_rom_device(mconfig, IQ151_AMOS1, "IQ151 AMOS cart 1", tag, owner, clock, "iq151_amos1", __FILE__), m_active(true) { @@ -144,7 +144,7 @@ iq151_amos1_device::iq151_amos1_device(const machine_config &mconfig, const char read -------------------------------------------------*/ -void iq151_amos1_device::read(offs_t offset, UINT8 &data) +void iq151_amos1_device::read(offs_t offset, uint8_t &data) { if (offset >= 0x8000 && offset < 0xc000 && m_active) data = m_rom[offset & 0x3fff]; @@ -154,7 +154,7 @@ void iq151_amos1_device::read(offs_t offset, UINT8 &data) IO write -------------------------------------------------*/ -void iq151_amos1_device::io_write(offs_t offset, UINT8 data) +void iq151_amos1_device::io_write(offs_t offset, uint8_t data) { if (offset >= 0xec && offset < 0xf0) m_active = data == 0x00; @@ -168,7 +168,7 @@ void iq151_amos1_device::io_write(offs_t offset, UINT8 data) // iq151_amos2_device - constructor //------------------------------------------------- -iq151_amos2_device::iq151_amos2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_amos2_device::iq151_amos2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : iq151_rom_device(mconfig, IQ151_AMOS2, "IQ151 AMOS cart 2", tag, owner, clock, "iq151_amos2", __FILE__), m_active(false) { @@ -178,7 +178,7 @@ iq151_amos2_device::iq151_amos2_device(const machine_config &mconfig, const char read -------------------------------------------------*/ -void iq151_amos2_device::read(offs_t offset, UINT8 &data) +void iq151_amos2_device::read(offs_t offset, uint8_t &data) { if (offset >= 0x8000 && offset < 0xc000 && m_active) data = m_rom[offset & 0x3fff]; @@ -188,7 +188,7 @@ void iq151_amos2_device::read(offs_t offset, UINT8 &data) IO write -------------------------------------------------*/ -void iq151_amos2_device::io_write(offs_t offset, UINT8 data) +void iq151_amos2_device::io_write(offs_t offset, uint8_t data) { if (offset >= 0xec && offset < 0xf0) m_active = data == 0x01; @@ -202,7 +202,7 @@ void iq151_amos2_device::io_write(offs_t offset, UINT8 data) // iq151_amos3_device - constructor //------------------------------------------------- -iq151_amos3_device::iq151_amos3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_amos3_device::iq151_amos3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : iq151_rom_device(mconfig, IQ151_AMOS3, "IQ151 AMOS cart 3", tag, owner, clock, "iq151_amos3", __FILE__), m_active(true) { @@ -212,7 +212,7 @@ iq151_amos3_device::iq151_amos3_device(const machine_config &mconfig, const char read -------------------------------------------------*/ -void iq151_amos3_device::read(offs_t offset, UINT8 &data) +void iq151_amos3_device::read(offs_t offset, uint8_t &data) { if (offset >= 0x8000 && offset < 0xc000 && m_active) data = m_rom[offset & 0x3fff]; @@ -222,7 +222,7 @@ void iq151_amos3_device::read(offs_t offset, UINT8 &data) IO write -------------------------------------------------*/ -void iq151_amos3_device::io_write(offs_t offset, UINT8 data) +void iq151_amos3_device::io_write(offs_t offset, uint8_t data) { if (offset >= 0xec && offset < 0xf0) m_active = data == 0x02; diff --git a/src/devices/bus/iq151/rom.h b/src/devices/bus/iq151/rom.h index 0c8b52fc136..bb9aac2676c 100644 --- a/src/devices/bus/iq151/rom.h +++ b/src/devices/bus/iq151/rom.h @@ -21,7 +21,7 @@ class iq151_rom_device : { public: // construction/destruction - iq151_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + iq151_rom_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); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; @@ -31,9 +31,9 @@ protected: virtual void device_start() override; // iq151cart_interface overrides - virtual UINT8* get_cart_base() override; + virtual uint8_t* get_cart_base() override; - UINT8 * m_rom; + uint8_t * m_rom; }; @@ -44,11 +44,11 @@ class iq151_basic6_device : { public: // construction/destruction - iq151_basic6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_basic6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; + virtual void read(offs_t offset, uint8_t &data) override; }; // ======================> iq151_basicg_device @@ -58,11 +58,11 @@ class iq151_basicg_device : { public: // construction/destruction - iq151_basicg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_basicg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; + virtual void read(offs_t offset, uint8_t &data) override; }; @@ -73,12 +73,12 @@ class iq151_amos1_device : { public: // construction/destruction - iq151_amos1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_amos1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; bool m_active; }; @@ -91,12 +91,12 @@ class iq151_amos2_device : { public: // construction/destruction - iq151_amos2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_amos2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; bool m_active; }; @@ -109,12 +109,12 @@ class iq151_amos3_device : { public: // construction/destruction - iq151_amos3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_amos3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; bool m_active; }; diff --git a/src/devices/bus/iq151/staper.cpp b/src/devices/bus/iq151/staper.cpp index 9bd55c4d986..7e9225e4297 100644 --- a/src/devices/bus/iq151/staper.cpp +++ b/src/devices/bus/iq151/staper.cpp @@ -44,7 +44,7 @@ const device_type IQ151_STAPER = &device_creator; // iq151_staper_device - constructor //------------------------------------------------- -iq151_staper_device::iq151_staper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_staper_device::iq151_staper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IQ151_STAPER, "IQ151 STAPER", tag, owner, clock, "iq151_staper", __FILE__), device_iq151cart_interface( mconfig, *this ), m_ppi(*this, "ppi8255"), @@ -86,7 +86,7 @@ void iq151_staper_device::device_timer(emu_timer &timer, device_timer_id id, int // IO read //------------------------------------------------- -void iq151_staper_device::io_read(offs_t offset, UINT8 &data) +void iq151_staper_device::io_read(offs_t offset, uint8_t &data) { address_space& space = machine().device("maincpu")->memory().space(AS_IO); @@ -98,7 +98,7 @@ void iq151_staper_device::io_read(offs_t offset, UINT8 &data) // IO write //------------------------------------------------- -void iq151_staper_device::io_write(offs_t offset, UINT8 data) +void iq151_staper_device::io_write(offs_t offset, uint8_t data) { address_space& space = machine().device("maincpu")->memory().space(AS_IO); diff --git a/src/devices/bus/iq151/staper.h b/src/devices/bus/iq151/staper.h index 426f87116f0..0579f075c3f 100644 --- a/src/devices/bus/iq151/staper.h +++ b/src/devices/bus/iq151/staper.h @@ -22,7 +22,7 @@ class iq151_staper_device : { public: // construction/destruction - iq151_staper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_staper_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; @@ -38,8 +38,8 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // iq151cart_interface overrides - virtual void io_read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual void io_read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; private: @@ -49,7 +49,7 @@ private: required_device m_printer; emu_timer* m_printer_timer; - UINT8 m_ppi_portc; + uint8_t m_ppi_portc; }; diff --git a/src/devices/bus/iq151/video32.cpp b/src/devices/bus/iq151/video32.cpp index f3d2657c520..09b245d1336 100644 --- a/src/devices/bus/iq151/video32.cpp +++ b/src/devices/bus/iq151/video32.cpp @@ -50,7 +50,7 @@ const device_type IQ151_VIDEO32 = &device_creator; // iq151_video32_device - constructor //------------------------------------------------- -iq151_video32_device::iq151_video32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_video32_device::iq151_video32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IQ151_VIDEO32, "IQ151 video32", tag, owner, clock, "iq151_video32", __FILE__), device_gfx_interface(mconfig, *this, nullptr, "^^palette"), device_iq151cart_interface( mconfig, *this ), m_videoram(nullptr), m_chargen(nullptr) @@ -64,8 +64,8 @@ iq151_video32_device::iq151_video32_device(const machine_config &mconfig, const void iq151_video32_device::device_start() { - m_videoram = (UINT8*)memregion("videoram")->base(); - m_chargen = (UINT8*)memregion("chargen")->base(); + m_videoram = (uint8_t*)memregion("videoram")->base(); + m_chargen = (uint8_t*)memregion("chargen")->base(); set_gfx(0, std::make_unique(palette(), iq151_video32_charlayout, m_chargen, 0, 1, 0)); } @@ -96,7 +96,7 @@ const tiny_rom_entry *iq151_video32_device::device_rom_region() const // read //------------------------------------------------- -void iq151_video32_device::read(offs_t offset, UINT8 &data) +void iq151_video32_device::read(offs_t offset, uint8_t &data) { // videoram is mapped at 0xec00-0xefff if (offset >= 0xec00 && offset < 0xf000) @@ -107,7 +107,7 @@ void iq151_video32_device::read(offs_t offset, UINT8 &data) // write //------------------------------------------------- -void iq151_video32_device::write(offs_t offset, UINT8 data) +void iq151_video32_device::write(offs_t offset, uint8_t data) { if (offset >= 0xec00 && offset < 0xf000) m_videoram[offset & 0x3ff] = data; @@ -119,18 +119,18 @@ void iq151_video32_device::write(offs_t offset, UINT8 data) void iq151_video32_device::video_update(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 ma = 0, sy = 0; + uint16_t ma = 0, sy = 0; for (int y = 0; y < 32; y++) { for (int ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (int x = ma; x < ma + 32; x++) { - UINT8 chr = m_videoram[x] & 0x7f; // rom only has 128 characters - UINT8 gfx = m_chargen[(chr<<3) | ra ]; + uint8_t chr = m_videoram[x] & 0x7f; // rom only has 128 characters + uint8_t gfx = m_chargen[(chr<<3) | ra ]; // chars above 0x7f have colors inverted if (m_videoram[x] > 0x7f) diff --git a/src/devices/bus/iq151/video32.h b/src/devices/bus/iq151/video32.h index 08833e21e9b..43b778c5f0e 100644 --- a/src/devices/bus/iq151/video32.h +++ b/src/devices/bus/iq151/video32.h @@ -21,7 +21,7 @@ class iq151_video32_device : { public: // construction/destruction - iq151_video32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_video32_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; @@ -32,13 +32,13 @@ protected: virtual void device_reset() override; // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; - virtual void write(offs_t offset, UINT8 data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void write(offs_t offset, uint8_t data) override; virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect) override; private: - UINT8 * m_videoram; - UINT8 * m_chargen; + uint8_t * m_videoram; + uint8_t * m_chargen; }; diff --git a/src/devices/bus/iq151/video64.cpp b/src/devices/bus/iq151/video64.cpp index b46d7b4257e..cfa70c7d469 100644 --- a/src/devices/bus/iq151/video64.cpp +++ b/src/devices/bus/iq151/video64.cpp @@ -50,7 +50,7 @@ const device_type IQ151_VIDEO64 = &device_creator; // iq151_video64_device - constructor //------------------------------------------------- -iq151_video64_device::iq151_video64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iq151_video64_device::iq151_video64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IQ151_VIDEO64, "IQ151 video64", tag, owner, clock, "iq151_video64", __FILE__), device_gfx_interface(mconfig, *this, nullptr, "^^palette"), device_iq151cart_interface( mconfig, *this ), m_videoram(nullptr), m_chargen(nullptr) @@ -63,8 +63,8 @@ iq151_video64_device::iq151_video64_device(const machine_config &mconfig, const void iq151_video64_device::device_start() { - m_videoram = (UINT8*)memregion("videoram")->base(); - m_chargen = (UINT8*)memregion("chargen")->base(); + m_videoram = (uint8_t*)memregion("videoram")->base(); + m_chargen = (uint8_t*)memregion("chargen")->base(); set_gfx(0,std::make_unique(palette(), iq151_video64_charlayout, m_chargen, 0, 1, 0)); } @@ -95,7 +95,7 @@ const tiny_rom_entry *iq151_video64_device::device_rom_region() const // read //------------------------------------------------- -void iq151_video64_device::read(offs_t offset, UINT8 &data) +void iq151_video64_device::read(offs_t offset, uint8_t &data) { // videoram is mapped at 0xe800-0xefff if (offset >= 0xe800 && offset < 0xf000) @@ -106,7 +106,7 @@ void iq151_video64_device::read(offs_t offset, UINT8 &data) // write //------------------------------------------------- -void iq151_video64_device::write(offs_t offset, UINT8 data) +void iq151_video64_device::write(offs_t offset, uint8_t data) { if (offset >= 0xe800 && offset < 0xf000) m_videoram[offset & 0x7ff] = data; @@ -116,7 +116,7 @@ void iq151_video64_device::write(offs_t offset, UINT8 data) // IO read //------------------------------------------------- -void iq151_video64_device::io_read(offs_t offset, UINT8 &data) +void iq151_video64_device::io_read(offs_t offset, uint8_t &data) { if (offset >= 0xfc && offset < 0x100) { @@ -132,18 +132,18 @@ void iq151_video64_device::io_read(offs_t offset, UINT8 &data) void iq151_video64_device::video_update(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 ma = 0, sy = 0; + uint16_t ma = 0, sy = 0; for (int y = 0; y < 32; y++) { for (int ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (int x = ma; x < ma + 64; x++) { - UINT8 chr = m_videoram[x]; - UINT8 gfx = m_chargen[(chr<<3) | ra ]; + uint8_t chr = m_videoram[x]; + uint8_t gfx = m_chargen[(chr<<3) | ra ]; /* Display a scanline of a character */ *p++ |= BIT(gfx, 5); diff --git a/src/devices/bus/iq151/video64.h b/src/devices/bus/iq151/video64.h index c1cc0f8f343..e9f0b2428ff 100644 --- a/src/devices/bus/iq151/video64.h +++ b/src/devices/bus/iq151/video64.h @@ -21,7 +21,7 @@ class iq151_video64_device : { public: // construction/destruction - iq151_video64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iq151_video64_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; @@ -32,14 +32,14 @@ protected: virtual void device_reset() override; // iq151cart_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; - virtual void write(offs_t offset, UINT8 data) override; - virtual void io_read(offs_t offset, UINT8 &data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void write(offs_t offset, uint8_t data) override; + virtual void io_read(offs_t offset, uint8_t &data) override; virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect) override; private: - UINT8 * m_videoram; - UINT8 * m_chargen; + uint8_t * m_videoram; + uint8_t * m_chargen; }; diff --git a/src/devices/bus/isa/3c503.cpp b/src/devices/bus/isa/3c503.cpp index e1f44cbe4d5..3bc90516cde 100644 --- a/src/devices/bus/isa/3c503.cpp +++ b/src/devices/bus/isa/3c503.cpp @@ -18,7 +18,7 @@ machine_config_constructor el2_3c503_device::device_mconfig_additions() const { return MACHINE_CONFIG_NAME(el2_3c503_config); } -el2_3c503_device::el2_3c503_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) +el2_3c503_device::el2_3c503_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : device_t(mconfig, EL2_3C503, "3C503 Network Adapter", tag, owner, clock, "el2_3c503", __FILE__), device_isa8_card_interface(mconfig, *this), m_dp8390(*this, "dp8390d"), @@ -28,7 +28,7 @@ el2_3c503_device::el2_3c503_device(const machine_config& mconfig, const char* ta void el2_3c503_device::device_start() { char mac[7]; - UINT32 num = rand(); + uint32_t num = rand(); memset(m_prom, 0x57, 16); sprintf(mac, "\x02\x60\x8c%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); memcpy(m_prom, mac, 6); @@ -100,12 +100,12 @@ void el2_3c503_device::eop_w(int state) { } } -UINT8 el2_3c503_device::dack_r(int line) { +uint8_t el2_3c503_device::dack_r(int line) { set_drq(CLEAR_LINE); return el2_3c503_mem_read(m_regs.da++); } -void el2_3c503_device::dack_w(int line, UINT8 data) { +void el2_3c503_device::dack_w(int line, uint8_t data) { set_drq(CLEAR_LINE); el2_3c503_mem_write(m_regs.da++, data); } @@ -295,12 +295,12 @@ WRITE8_MEMBER(el2_3c503_device::el2_3c503_mem_write) { el2_3c503_mem_write(offset, data); } -UINT8 el2_3c503_device::el2_3c503_mem_read(offs_t offset) { +uint8_t el2_3c503_device::el2_3c503_mem_read(offs_t offset) { if((offset < 8*1024) || (offset >= 16*1024)) return 0xff; return m_board_ram[offset - (8*1024)]; } -void el2_3c503_device::el2_3c503_mem_write(offs_t offset, UINT8 data) { +void el2_3c503_device::el2_3c503_mem_write(offs_t offset, uint8_t data) { if((offset < 8*1024) || (offset >= 16*1024)) return; m_board_ram[offset - (8*1024)] = data; } diff --git a/src/devices/bus/isa/3c503.h b/src/devices/bus/isa/3c503.h index 5a31c2948fe..0db8d3da809 100644 --- a/src/devices/bus/isa/3c503.h +++ b/src/devices/bus/isa/3c503.h @@ -13,7 +13,7 @@ class el2_3c503_device: public device_t, public device_isa8_card_interface { public: - el2_3c503_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + el2_3c503_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; void el2_3c503_irq_w(int state); @@ -24,38 +24,38 @@ public: DECLARE_READ8_MEMBER(el2_3c503_hiport_r); DECLARE_WRITE8_MEMBER(el2_3c503_hiport_w); void eop_w(int state) override; - UINT8 dack_r(int line) override; - void dack_w(int line, UINT8 data) override; + uint8_t dack_r(int line) override; + void dack_w(int line, uint8_t data) override; protected: virtual void device_start() override; virtual void device_reset() override; private: required_device m_dp8390; - UINT8 m_board_ram[8*1024]; - UINT8 m_rom[8*1024]; - UINT8 m_prom[32]; - UINT8 m_irq_state; + uint8_t m_board_ram[8*1024]; + uint8_t m_rom[8*1024]; + uint8_t m_prom[32]; + uint8_t m_irq_state; - UINT8 el2_3c503_mem_read(offs_t offset); - void el2_3c503_mem_write(offs_t offset, UINT8 data); + uint8_t el2_3c503_mem_read(offs_t offset); + void el2_3c503_mem_write(offs_t offset, uint8_t data); void set_irq(int state); void set_drq(int state); struct { - UINT8 pstr; - UINT8 pspr; - UINT8 dqtr; - UINT8 bcfr; - UINT8 pcfr; - UINT8 gacfr; - UINT8 ctrl; - UINT8 streg; - UINT8 idcfr; - UINT16 da; - UINT32 vptr; - UINT8 rfmsb; - UINT8 rflsb; + uint8_t pstr; + uint8_t pspr; + uint8_t dqtr; + uint8_t bcfr; + uint8_t pcfr; + uint8_t gacfr; + uint8_t ctrl; + uint8_t streg; + uint8_t idcfr; + uint16_t da; + uint32_t vptr; + uint8_t rfmsb; + uint8_t rflsb; } m_regs; }; diff --git a/src/devices/bus/isa/3c505.cpp b/src/devices/bus/isa/3c505.cpp index c878a540315..b50b341d82d 100644 --- a/src/devices/bus/isa/3c505.cpp +++ b/src/devices/bus/isa/3c505.cpp @@ -27,22 +27,22 @@ static int verbose = VERBOSE; #define LOG2(d,x) { if (verbose > 1) LOG(d,x)} #ifdef LSB_FIRST -static UINT16 uint16_to_le(UINT16 value) +static uint16_t uint16_to_le(uint16_t value) { return value; } -static UINT16 uint16_from_le(UINT16 value) +static uint16_t uint16_from_le(uint16_t value) { return value; } #else -static UINT16 uint16_to_le(UINT16 value) +static uint16_t uint16_to_le(uint16_t value) { return ((value&0x00ff)<<8)|((value&0xff00)>>8); } -static UINT16 uint16_from_le(UINT16 value) +static uint16_t uint16_from_le(uint16_t value) { return ((value&0x00ff)<<8)|((value&0xff00)>>8); } @@ -301,7 +301,7 @@ const device_type ISA16_3C505 = &device_creator ; // threecom3c505_device - constructor //------------------------------------------------- -threecom3c505_device::threecom3c505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +threecom3c505_device::threecom3c505_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_3C505, "3Com 3C505 Network Adaptor", tag, owner, clock, "3c505", __FILE__), device_network_interface(mconfig, *this, 10.0f), device_isa16_card_interface(mconfig, *this), @@ -311,7 +311,7 @@ threecom3c505_device::threecom3c505_device(const machine_config &mconfig, const { } -threecom3c505_device::threecom3c505_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock) +threecom3c505_device::threecom3c505_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, "3Com 3C505 Network Adaptor", tag, owner, clock, "3c505", __FILE__), device_network_interface(mconfig, *this, 10.0f), device_isa16_card_interface(mconfig, *this), @@ -459,7 +459,7 @@ threecom3c505_device::data_buffer::data_buffer() : { } -void threecom3c505_device::data_buffer::start(threecom3c505_device *device, INT32 size) +void threecom3c505_device::data_buffer::start(threecom3c505_device *device, int32_t size) { m_device = device; LOG2(device,("start threecom3c505_device::data_buffer with size %0x", size)); @@ -479,7 +479,7 @@ void threecom3c505_device::data_buffer::copy(data_buffer *db) const memcpy(&db->m_data[0], &m_data[0], m_data.size()); } -int threecom3c505_device::data_buffer::append(UINT8 data) +int threecom3c505_device::data_buffer::append(uint8_t data) { if (m_length >= m_data.size()) { @@ -522,7 +522,7 @@ threecom3c505_device::data_buffer_fifo::data_buffer_fifo() : } void threecom3c505_device::data_buffer_fifo::start( - threecom3c505_device *device, INT32 size, INT32 db_size) + threecom3c505_device *device, int32_t size, int32_t db_size) { m_device = device; LOG2(m_device,("start threecom3c505_device::data_buffer_fifo")); @@ -552,9 +552,9 @@ threecom3c505_device::data_buffer_fifo::~data_buffer_fifo() } } -int threecom3c505_device::data_buffer_fifo::put(const UINT8 data[], const int length) +int threecom3c505_device::data_buffer_fifo::put(const uint8_t data[], const int length) { - UINT16 next_index = (m_put_index + 1) % m_size; + uint16_t next_index = (m_put_index + 1) % m_size; LOG2(m_device,("threecom3c505_device::data_buffer_fifo::put %d", m_count)); @@ -832,7 +832,7 @@ void threecom3c505_device::do_receive_command() m_response.data.rcv_resp.timetag = 0; // TODO: time tag // compute and check no of bytes to be DMA'ed (must be even) - UINT16 buf_len = uint16_from_le(m_response.data.rcv_resp.buf_len) & ~1; + uint16_t buf_len = uint16_from_le(m_response.data.rcv_resp.buf_len) & ~1; if (m_rx_data_buffer.get_length() > buf_len) { LOG1(this,("do_receive_command !!! buffer size too small (%d < %d)", buf_len, m_rx_data_buffer.get_length())); @@ -1027,7 +1027,7 @@ void threecom3c505_device::do_command() break; case CMD_DOWNLOAD_PROGRAM: // 0x0d - UINT16 mc_version = m_program_buffer.get_word(1); + uint16_t mc_version = m_program_buffer.get_word(1); switch (mc_version) { case APOLLO_MC_VERSION_SR10_2: @@ -1060,13 +1060,13 @@ void threecom3c505_device::do_command() ethernet_packet_is_for_me - check if ethernet address is for me ***************************************************************************/ -int threecom3c505_device::ethernet_packet_is_for_me(const UINT8 mac_address[]) +int threecom3c505_device::ethernet_packet_is_for_me(const uint8_t mac_address[]) { // tcpdump -i eth0 -q ether host 08:00:1e:01:ae:a5 or ether broadcast or ether dst 09:00:1e:00:00:00 or ether dst 09:00:1e:00:00:01 // wireshark filter: eth.addr eq 08:00:1e:01:ae:a5 or eth.dst eq ff:ff:ff:ff:ff:ff or eth.dst eq 09:00:1e:00:00:00 or eth.dst eq 09:00:1e:00:00:01 int i; - static const UINT8 broadcast_address[ETHERNET_ADDR_SIZE] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + static const uint8_t broadcast_address[ETHERNET_ADDR_SIZE] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; // accept all packets if RECV_PROMISC is set if (m_i82586_config & RECV_PROMISC) @@ -1108,7 +1108,7 @@ int threecom3c505_device::ethernet_packet_is_for_me(const UINT8 mac_address[]) recv_cb - receive callback - receive and process an ethernet packet ***************************************************************************/ -void threecom3c505_device::recv_cb(UINT8 *data, int length) +void threecom3c505_device::recv_cb(uint8_t *data, int length) { if (length < ETHERNET_ADDR_SIZE || !ethernet_packet_is_for_me(data)) { @@ -1135,7 +1135,7 @@ void threecom3c505_device::recv_cb(UINT8 *data, int length) write_command_port ***************************************************************************/ -void threecom3c505_device::write_command_port(UINT8 data) +void threecom3c505_device::write_command_port(uint8_t data) { LOG2(this,("writing 3C505 command port %02x - m_status=%02x m_control=%02x m_command_index=%02x", data, m_status, m_control, m_command_index)); @@ -1217,9 +1217,9 @@ void threecom3c505_device::write_command_port(UINT8 data) read_command_port ***************************************************************************/ -UINT8 threecom3c505_device::read_command_port() +uint8_t threecom3c505_device::read_command_port() { - UINT8 data; + uint8_t data; // the interrupt request is cleared when the Command Register is read set_interrupt(CLEAR_LINE); @@ -1292,15 +1292,15 @@ UINT8 threecom3c505_device::read_command_port() // see also http://www.edaboard.com/thread120700.html { // compute the Ethernet Frame Check Sequence - static const UINT32 crc_table[] = + static const uint32_t crc_table[] = { 0x4DBDF21C, 0x500AE278, 0x76D3D2D4, 0x6B64C2B0, 0x3B61B38C, 0x26D6A3E8, 0x000F9344, 0x1DB88320, 0xA005713C, 0xBDB26158, 0x9B6B51F4, 0x86DC4190, 0xD6D930AC, 0xCB6E20C8, 0xEDB71064, 0xF0000000 }; - UINT32 n, crc = 0; + uint32_t n, crc = 0; for (n = 0; n < m_tx_data_buffer.get_length(); n++) { - UINT8 data = m_tx_data_buffer.get(n); + uint8_t data = m_tx_data_buffer.get(n); crc = (crc >> 4) ^ crc_table[(crc ^ (data >> 0)) & 0x0f]; /* lower nibble */ crc = (crc >> 4) ^ crc_table[(crc ^ (data >> 4)) & 0x0f]; /* upper nibble */ } @@ -1350,7 +1350,7 @@ UINT8 threecom3c505_device::read_command_port() write_data_port ***************************************************************************/ -void threecom3c505_device::write_data_port(UINT8 data) +void threecom3c505_device::write_data_port(uint8_t data) { if (m_control & FLSH) { @@ -1460,12 +1460,12 @@ void threecom3c505_device::write_data_port(UINT8 data) read_data_port ***************************************************************************/ -UINT8 threecom3c505_device::read_data_port() +uint8_t threecom3c505_device::read_data_port() { - UINT8 data; - UINT16 data_length = m_rx_data_buffer.get_length(); + uint8_t data; + uint16_t data_length = m_rx_data_buffer.get_length(); // DomainOS will read words (i.e. even number of bytes); must handle packets with odd byte length - UINT16 even_data_length = (data_length + 1) & ~1; + uint16_t even_data_length = (data_length + 1) & ~1; if (m_rx_data_index < even_data_length) { @@ -1497,7 +1497,7 @@ UINT8 threecom3c505_device::read_data_port() write_control_port ***************************************************************************/ -void threecom3c505_device::write_control_port(UINT8 data) +void threecom3c505_device::write_control_port(uint8_t data) { switch (data & (ATTN | FLSH)) { @@ -1587,9 +1587,9 @@ void threecom3c505_device::write_control_port(UINT8 data) read_status_port ***************************************************************************/ -UINT8 threecom3c505_device::read_status_port() +uint8_t threecom3c505_device::read_status_port() { - UINT8 data = m_status; + uint8_t data = m_status; m_status &= ~ASF_PCB_MASK; switch (data & ASF_PCB_MASK) @@ -1640,13 +1640,13 @@ WRITE16_MEMBER(threecom3c505_device::write) READ16_MEMBER(threecom3c505_device::read) { // data to omit excessive logging - static UINT16 last_data = 0xff; - static UINT32 last_pc = 0; + static uint16_t last_data = 0xff; + static uint32_t last_pc = 0; // make byte offset offset *= 2; - UINT16 data = m_reg[offset & 0x0f]; + uint16_t data = m_reg[offset & 0x0f]; switch (offset) { case PORT_COMMAND: /* 0x00 read/write, 8-bit */ @@ -1658,7 +1658,7 @@ READ16_MEMBER(threecom3c505_device::read) // omit excessive logging if (data == last_data) { - UINT32 pc = space.device().safe_pcbase(); + uint32_t pc = space.device().safe_pcbase(); if (pc == last_pc) { return data; @@ -1688,7 +1688,7 @@ void threecom3c505_device::set_verbose(int on_off) verbose = on_off == 0 ? 0 : VERBOSE > 1 ? VERBOSE : 1; } -int threecom3c505_device::tx_data(device_t *device, const UINT8 data[], int length) +int threecom3c505_device::tx_data(device_t *device, const uint8_t data[], int length) { LOG1(this,("threecom3c505_device::tx_data length=%d", length)); return 1; diff --git a/src/devices/bus/isa/3c505.h b/src/devices/bus/isa/3c505.h index 127dc41afb6..459db446bb5 100644 --- a/src/devices/bus/isa/3c505.h +++ b/src/devices/bus/isa/3c505.h @@ -30,59 +30,59 @@ struct Memconf { - UINT16 cmd_q, rcv_q, mcast, frame, rcv_b, progs; + uint16_t cmd_q, rcv_q, mcast, frame, rcv_b, progs; }; struct Rcv_pkt { - UINT16 buf_ofs, buf_seg, buf_len, timeout; + uint16_t buf_ofs, buf_seg, buf_len, timeout; }; struct Xmit_pkt { - UINT16 buf_ofs, buf_seg, pkt_len; + uint16_t buf_ofs, buf_seg, pkt_len; }; struct Rcv_resp { - UINT16 buf_ofs, buf_seg, buf_len, pkt_len, timeout, status; - UINT32 timetag; + uint16_t buf_ofs, buf_seg, buf_len, pkt_len, timeout, status; + uint32_t timetag; }; struct Xmit_resp { - UINT16 buf_ofs, buf_seg, c_stat, status; + uint16_t buf_ofs, buf_seg, c_stat, status; }; struct Netstat { - UINT32 tot_recv, tot_xmit; - UINT16 err_CRC, err_align, err_res, err_ovrrun; + uint32_t tot_recv, tot_xmit; + uint16_t err_CRC, err_align, err_res, err_ovrrun; }; struct Selftest { - UINT16 error; + uint16_t error; union { - UINT16 ROM_cksum; + uint16_t ROM_cksum; struct { - UINT16 ofs, seg; + uint16_t ofs, seg; } RAM; - UINT16 i82586; + uint16_t i82586; } failure; }; struct Info { - UINT8 minor_vers, major_vers; - UINT16 ROM_cksum, RAM_sz, free_ofs, free_seg; + uint8_t minor_vers, major_vers; + uint16_t ROM_cksum, RAM_sz, free_ofs, free_seg; }; struct Memdump { - UINT16 size, off, seg; + uint16_t size, off, seg; }; /* @@ -92,24 +92,24 @@ struct Memdump */ struct pcb_struct { - UINT8 command; - UINT8 length; + uint8_t command; + uint8_t length; union { struct Memconf memconf; - UINT16 configure; + uint16_t configure; struct Rcv_pkt rcv_pkt; struct Xmit_pkt xmit_pkt; - UINT8 multicast[10][6]; - UINT8 eth_addr[6]; - INT16 failed; + uint8_t multicast[10][6]; + uint8_t eth_addr[6]; + int16_t failed; struct Rcv_resp rcv_resp; struct Xmit_resp xmit_resp; struct Netstat netstat; struct Selftest selftest; struct Info info; struct Memdump memdump; - UINT8 raw[62]; + uint8_t raw[62]; } data; }; @@ -123,8 +123,8 @@ class threecom3c505_device: public device_t, { public: // construction/destruction - threecom3c505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - threecom3c505_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock); + threecom3c505_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + threecom3c505_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); // device register I/O virtual DECLARE_READ16_MEMBER(read); @@ -136,10 +136,10 @@ public: required_ioport m_irqdrq; required_ioport m_romopts; - virtual void recv_cb(UINT8 *data, int length) override; + virtual void recv_cb(uint8_t *data, int length) override; protected: - virtual int tx_data(device_t *, const UINT8 *, int); + virtual int tx_data(device_t *, const uint8_t *, int); virtual int setfilter(device_t *, int); const char *cpu_context(); @@ -164,16 +164,16 @@ private: public: data_buffer(); - void start(threecom3c505_device *device, INT32 size); + void start(threecom3c505_device *device, int32_t size); void reset(); - int append(UINT8 data); - UINT8 get(int i) { return m_data[i]; }; - UINT16 get_word(int i) { return (m_data[i*2+1] << 8) + m_data[i*2]; }; + int append(uint8_t data); + uint8_t get(int i) { return m_data[i]; }; + uint16_t get_word(int i) { return (m_data[i*2+1] << 8) + m_data[i*2]; }; int is_empty() {return m_length == 0; }; int is_full() {return m_length >= m_data.size(); }; - UINT16 get_length() { return m_length; }; - UINT16 get_size() { return m_data.size(); }; - UINT8 *get_data() { return &m_data[0]; }; + uint16_t get_length() { return m_length; }; + uint16_t get_size() { return m_data.size(); }; + uint8_t *get_data() { return &m_data[0]; }; void copy(data_buffer *db) const; void log(const char *title) const; @@ -181,8 +181,8 @@ private: const char *cpu_context() { return m_device->cpu_context(); } threecom3c505_device *m_device; // pointer back to our device - UINT16 m_length; - std::vector m_data; + uint16_t m_length; + std::vector m_data; }; /* data_buffer fifo (used to buffer the received data) */ @@ -191,9 +191,9 @@ private: public: data_buffer_fifo(); ~data_buffer_fifo(); - void start(threecom3c505_device *device, INT32 size, INT32 db_size); + void start(threecom3c505_device *device, int32_t size, int32_t db_size); void reset(); - int put(const UINT8 data[], const int length); + int put(const uint8_t data[], const int length); int get(data_buffer *db); int is_empty () { return m_get_index == m_put_index; } int is_full () { return ((m_put_index + 1) % m_size) == m_get_index; } @@ -201,10 +201,10 @@ private: const char *cpu_context() { return m_device->cpu_context(); } threecom3c505_device *m_device; // pointer back to our device - UINT16 m_size; - UINT16 m_count; - UINT16 m_get_index; - UINT16 m_put_index; + uint16_t m_size; + uint16_t m_count; + uint16_t m_get_index; + uint16_t m_put_index; data_buffer *m_db[RX_FIFO_SIZE]; }; @@ -217,23 +217,23 @@ private: void do_receive_command(); void set_command_pending(int onoff); - int ethernet_packet_is_for_me(const UINT8 mac_address[]); + int ethernet_packet_is_for_me(const uint8_t mac_address[]); - void write_command_port( UINT8 data); - UINT8 read_command_port(); - void write_data_port( UINT8 data); - UINT8 read_data_port(); - void write_control_port( UINT8 data); - UINT8 read_status_port(); + void write_command_port( uint8_t data); + uint8_t read_command_port(); + void write_data_port( uint8_t data); + uint8_t read_data_port(); + void write_control_port( uint8_t data); + uint8_t read_status_port(); void do_command(); - UINT8 m_reg[16]; + uint8_t m_reg[16]; - UINT8 m_status; - UINT8 m_control; + uint8_t m_status; + uint8_t m_control; - UINT8 m_command_buffer[CMD_BUFFER_SIZE]; + uint8_t m_command_buffer[CMD_BUFFER_SIZE]; int m_command_index; int m_command_pending; int m_wait_for_ack; @@ -257,16 +257,16 @@ private: pcb_struct m_rcv_response; - UINT16 m_microcode_version; - UINT16 m_microcode_running; + uint16_t m_microcode_version; + uint16_t m_microcode_running; - UINT16 m_i82586_config; + uint16_t m_i82586_config; struct Netstat m_netstat; - UINT8 m_station_address[ETHERNET_ADDR_SIZE]; - UINT8 m_multicast_list[ETHERNET_ADDR_SIZE*2]; - UINT8 m_filter_list[ETHERNET_ADDR_SIZE*4]; + uint8_t m_station_address[ETHERNET_ADDR_SIZE]; + uint8_t m_multicast_list[ETHERNET_ADDR_SIZE*2]; + uint8_t m_filter_list[ETHERNET_ADDR_SIZE*4]; enum line_state irq_state; diff --git a/src/devices/bus/isa/adlib.cpp b/src/devices/bus/isa/adlib.cpp index 66e7bc29ca3..206ffe878cb 100644 --- a/src/devices/bus/isa/adlib.cpp +++ b/src/devices/bus/isa/adlib.cpp @@ -20,7 +20,7 @@ MACHINE_CONFIG_END READ8_MEMBER( isa8_adlib_device::ym3812_16_r ) { - UINT8 retVal = 0xff; + uint8_t retVal = 0xff; switch(offset) { case 0 : retVal = m_ym3812->status_port_r( space, offset ); break; @@ -61,7 +61,7 @@ machine_config_constructor isa8_adlib_device::device_mconfig_additions() const // isa8_adlib_device - constructor //------------------------------------------------- -isa8_adlib_device::isa8_adlib_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +isa8_adlib_device::isa8_adlib_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_ADLIB, "Ad Lib Sound Card", tag, owner, clock, "isa_adlib", __FILE__), device_isa8_card_interface( mconfig, *this ), m_ym3812(*this, "ym3812") diff --git a/src/devices/bus/isa/adlib.h b/src/devices/bus/isa/adlib.h index da22516fd72..27549f4ae23 100644 --- a/src/devices/bus/isa/adlib.h +++ b/src/devices/bus/isa/adlib.h @@ -21,7 +21,7 @@ class isa8_adlib_device : { public: // construction/destruction - isa8_adlib_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_adlib_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; diff --git a/src/devices/bus/isa/aga.cpp b/src/devices/bus/isa/aga.cpp index 0499fa40022..38a1afbfae5 100644 --- a/src/devices/bus/isa/aga.cpp +++ b/src/devices/bus/isa/aga.cpp @@ -56,7 +56,7 @@ const device_type ISA8_AGA = &device_creator; // isa8_aga_device - constructor //------------------------------------------------- -isa8_aga_device::isa8_aga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_aga_device::isa8_aga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t( mconfig, ISA8_AGA, "AGA", tag, owner, clock, "aga", __FILE__), device_isa8_card_interface(mconfig, *this), m_palette(*this, "palette"), @@ -78,7 +78,7 @@ isa8_aga_device::isa8_aga_device(const machine_config &mconfig, const char *tag, { } -isa8_aga_device::isa8_aga_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) : +isa8_aga_device::isa8_aga_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_isa8_card_interface(mconfig, *this), m_palette(*this, "palette"), @@ -107,7 +107,7 @@ void isa8_aga_device::device_start() m_mode = AGA_COLOR; m_mda_chr_gen = memregion("gfx1")->base() + 0x1000; m_cga_chr_gen = memregion("gfx1")->base(); - m_videoram = std::make_unique(0x10000); + m_videoram = std::make_unique(0x10000); set_isa_device(); m_isa->install_memory(0xb0000, 0xbffff, read8_delegate(FUNC(isa8_aga_device::pc_aga_videoram_r),this), write8_delegate(FUNC(isa8_aga_device::pc_aga_videoram_w),this)); @@ -135,7 +135,7 @@ void isa8_aga_device::device_start() } } - UINT8 *gfx = &memregion("gfx1")->base()[0x8000]; + uint8_t *gfx = &memregion("gfx1")->base()[0x8000]; /* just a plain bit pattern for graphics data generation */ for (i = 0; i < 256; i++) gfx[i] = i; @@ -164,7 +164,7 @@ const device_type ISA8_AGA_PC200 = &device_creator; // isa8_aga_pc200_device - constructor //------------------------------------------------- -isa8_aga_pc200_device::isa8_aga_pc200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_aga_pc200_device::isa8_aga_pc200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_aga_device( mconfig, ISA8_AGA_PC200, "AGA PC200", tag, owner, clock, "aga_pc200", __FILE__), m_port8(0), m_portd(0), @@ -194,7 +194,7 @@ void isa8_aga_pc200_device::device_start() m_mode = AGA_COLOR; m_mda_chr_gen = memregion("gfx1")->base(); m_cga_chr_gen = memregion("gfx1")->base() + 0x1000; - m_videoram = std::make_unique(0x10000); + m_videoram = std::make_unique(0x10000); set_isa_device(); m_isa->install_memory(0xb0000, 0xbffff, read8_delegate(FUNC(isa8_aga_pc200_device::pc200_videoram_r),this), write8_delegate(FUNC(isa8_aga_pc200_device::pc200_videoram_w),this)); @@ -222,7 +222,7 @@ void isa8_aga_pc200_device::device_start() } } - UINT8 *gfx = &memregion("gfx1")->base()[0x8000]; + uint8_t *gfx = &memregion("gfx1")->base()[0x8000]; /* just a plain bit pattern for graphics data generation */ for (i = 0; i < 256; i++) gfx[i] = i; @@ -315,19 +315,19 @@ machine_config_constructor isa8_aga_device::device_mconfig_additions() const MC6845_UPDATE_ROW( isa8_aga_device::mda_text_inten_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *videoram = m_videoram.get(); - UINT32 *p = &bitmap.pix32(y); - UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; + uint8_t *videoram = m_videoram.get(); + uint32_t *p = &bitmap.pix32(y); + uint16_t chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; int i; if ( y == 0 ) logerror("mda_text_inten_update_row\n"); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset + 1 ]; - UINT8 data = m_mda_chr_gen[ chr_base + chr * 8 ]; - UINT8 fg = ( attr & 0x08 ) ? 3 : 2; - UINT8 bg = 0; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset + 1 ]; + uint8_t data = m_mda_chr_gen[ chr_base + chr * 8 ]; + uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint8_t bg = 0; if ( ( attr & ~0x88 ) == 0 ) { data = 0x00; @@ -375,20 +375,20 @@ MC6845_UPDATE_ROW( isa8_aga_device::mda_text_inten_update_row ) MC6845_UPDATE_ROW( isa8_aga_device::mda_text_blink_update_row ) { - UINT8 *videoram = m_videoram.get(); + uint8_t *videoram = m_videoram.get(); const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); - UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; + uint32_t *p = &bitmap.pix32(y); + uint16_t chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; int i; if ( y == 0 ) logerror("mda_text_blink_update_row\n"); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset + 1 ]; - UINT8 data = m_mda_chr_gen[ chr_base + chr * 8 ]; - UINT8 fg = ( attr & 0x08 ) ? 3 : 2; - UINT8 bg = 0; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset + 1 ]; + uint8_t data = m_mda_chr_gen[ chr_base + chr * 8 ]; + uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint8_t bg = 0; if ( ( attr & ~0x88 ) == 0 ) { data = 0x00; @@ -437,19 +437,19 @@ MC6845_UPDATE_ROW( isa8_aga_device::mda_text_blink_update_row ) MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_update_row ) { - UINT8 *videoram = m_videoram.get(); + uint8_t *videoram = m_videoram.get(); const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); int i; if ( y == 0 ) logerror("cga_text_inten_update_row\n"); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_cga_chr_gen[ chr * 16 + ra ]; - UINT16 fg = attr & 0x0F; - UINT16 bg = ( attr >> 4 ) & 0x07; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_cga_chr_gen[ chr * 16 + ra ]; + uint16_t fg = attr & 0x0F; + uint16_t bg = ( attr >> 4 ) & 0x07; if ( i == cursor_x ) { data = 0xFF; @@ -469,17 +469,17 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_update_row ) MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_alt_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *videoram = m_videoram.get(); - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = m_videoram.get(); + uint32_t *p = &bitmap.pix32(y); int i; if ( y == 0 ) logerror("cga_text_inten_alt_update_row\n"); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_cga_chr_gen[ chr * 16 + ra ]; - UINT16 fg = attr & 0x0F; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_cga_chr_gen[ chr * 16 + ra ]; + uint16_t fg = attr & 0x0F; if ( i == cursor_x ) { data = 0xFF; @@ -499,17 +499,17 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_alt_update_row ) MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *videoram = m_videoram.get(); - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = m_videoram.get(); + uint32_t *p = &bitmap.pix32(y); int i; for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_cga_chr_gen[ chr * 16 + ra ]; - UINT16 fg = attr & 0x0F; - UINT16 bg = (attr >> 4) & 0x07; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_cga_chr_gen[ chr * 16 + ra ]; + uint16_t fg = attr & 0x0F; + uint16_t bg = (attr >> 4) & 0x07; if ( i == cursor_x ) { data = 0xFF; @@ -533,18 +533,18 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_update_row ) MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_alt_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *videoram = m_videoram.get(); - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = m_videoram.get(); + uint32_t *p = &bitmap.pix32(y); int i; if ( y == 0 ) logerror("cga_text_blink_alt_update_row\n"); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_cga_chr_gen[ chr * 16 + ra ]; - UINT16 fg = attr & 0x07; - UINT16 bg = 0; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_cga_chr_gen[ chr * 16 + ra ]; + uint16_t fg = attr & 0x07; + uint16_t bg = 0; if ( i == cursor_x ) { data = 0xFF; @@ -569,14 +569,14 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_alt_update_row ) MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bppl_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *videoram = m_videoram.get(); - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = m_videoram.get(); + uint32_t *p = &bitmap.pix32(y); int i; if ( y == 0 ) logerror("cga_gfx_4bppl_update_row\n"); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); - UINT8 data = videoram[ offset ]; + uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); + uint8_t data = videoram[ offset ]; *p = palette[data >> 4]; p++; *p = palette[data >> 4]; p++; @@ -594,15 +594,15 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bppl_update_row ) MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bpph_update_row ) { - UINT8 *videoram = m_videoram.get(); + uint8_t *videoram = m_videoram.get(); const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); int i; if ( y == 0 ) logerror("cga_gfx_4bpph_update_row\n"); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); - UINT8 data = videoram[ offset ]; + uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); + uint8_t data = videoram[ offset ]; *p = palette[data >> 4]; p++; *p = palette[data >> 4]; p++; @@ -628,15 +628,15 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bpph_update_row ) MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_2bpp_update_row ) { - UINT8 *videoram = m_videoram.get(); + uint8_t *videoram = m_videoram.get(); const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); int i; // if ( y == 0 ) logerror("cga_gfx_2bpp_update_row\n"); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); - UINT8 data = videoram[ offset ]; + uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); + uint8_t data = videoram[ offset ]; *p = palette[m_cga_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++; *p = palette[m_cga_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++; @@ -654,16 +654,16 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_2bpp_update_row ) MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_1bpp_update_row ) { - UINT8 *videoram = m_videoram.get(); + uint8_t *videoram = m_videoram.get(); const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); - UINT8 fg = m_cga_color_select & 0x0F; + uint32_t *p = &bitmap.pix32(y); + uint8_t fg = m_cga_color_select & 0x0F; int i; if ( y == 0 ) logerror("cga_gfx_1bpp_update_row\n"); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 ); - UINT8 data = videoram[ offset ]; + uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 ); + uint8_t data = videoram[ offset ]; *p = palette[( data & 0x80 ) ? fg : 0]; p++; *p = palette[( data & 0x40 ) ? fg : 0]; p++; @@ -695,7 +695,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_1bpp_update_row ) READ8_MEMBER ( isa8_aga_device::pc_aga_mda_r ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; if ( m_mode == AGA_MONO ) { switch( offset ) @@ -747,7 +747,7 @@ WRITE8_MEMBER ( isa8_aga_device::pc_aga_mda_w ) READ8_MEMBER ( isa8_aga_device::pc_aga_cga_r ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; if ( m_mode == AGA_COLOR ) { switch( offset ) { @@ -985,7 +985,7 @@ WRITE8_MEMBER( isa8_aga_pc200_device::pc200_cga_w ) READ8_MEMBER ( isa8_aga_pc200_device::pc200_cga_r ) { - UINT8 result; + uint8_t result; switch(offset) { case 8: diff --git a/src/devices/bus/isa/aga.h b/src/devices/bus/isa/aga.h index f9ec0d19afe..54871eee91d 100644 --- a/src/devices/bus/isa/aga.h +++ b/src/devices/bus/isa/aga.h @@ -37,8 +37,8 @@ class isa8_aga_device : { public: // construction/destruction - isa8_aga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_aga_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); + isa8_aga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_aga_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-level overrides virtual void device_start() override; // optional information overrides @@ -77,23 +77,23 @@ public: int m_update_row_type; AGA_MODE m_mode; - UINT8 m_mda_mode_control; - UINT8 m_mda_status; - UINT8 *m_mda_chr_gen; + uint8_t m_mda_mode_control; + uint8_t m_mda_status; + uint8_t *m_mda_chr_gen; - UINT8 m_cga_mode_control; - UINT8 m_cga_color_select; - UINT8 m_cga_status; - UINT8 *m_cga_chr_gen; + uint8_t m_cga_mode_control; + uint8_t m_cga_color_select; + uint8_t m_cga_status; + uint8_t *m_cga_chr_gen; int m_framecnt; - UINT8 m_vsync; - UINT8 m_hsync; + uint8_t m_vsync; + uint8_t m_hsync; - UINT8 m_cga_palette_lut_2bpp[4]; + uint8_t m_cga_palette_lut_2bpp[4]; - std::unique_ptr m_videoram; + std::unique_ptr m_videoram; }; // device type definition @@ -106,15 +106,15 @@ class isa8_aga_pc200_device : { public: // construction/destruction - isa8_aga_pc200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_aga_pc200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; - UINT8 m_port8; - UINT8 m_portd; - UINT8 m_porte; + uint8_t m_port8; + uint8_t m_portd; + uint8_t m_porte; DECLARE_READ8_MEMBER( pc200_videoram_r ); DECLARE_WRITE8_MEMBER( pc200_videoram_w ); diff --git a/src/devices/bus/isa/aha1542.cpp b/src/devices/bus/isa/aha1542.cpp index 51a296e2e62..4ea36e2671e 100644 --- a/src/devices/bus/isa/aha1542.cpp +++ b/src/devices/bus/isa/aha1542.cpp @@ -183,7 +183,7 @@ machine_config_constructor aha1542_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( aha1542 ); } -aha1542_device::aha1542_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +aha1542_device::aha1542_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AHA1542, "AHA1542 SCSI Controller", tag, owner, clock, "aha1542", __FILE__ ), device_isa16_card_interface(mconfig, *this) { diff --git a/src/devices/bus/isa/aha1542.h b/src/devices/bus/isa/aha1542.h index 57229a99d04..710ce36b6df 100644 --- a/src/devices/bus/isa/aha1542.h +++ b/src/devices/bus/isa/aha1542.h @@ -30,7 +30,7 @@ class aha1542_device : public device_t, { public: // construction/destruction - aha1542_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + aha1542_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; diff --git a/src/devices/bus/isa/cga.cpp b/src/devices/bus/isa/cga.cpp index 6a379459336..99f446b7524 100644 --- a/src/devices/bus/isa/cga.cpp +++ b/src/devices/bus/isa/cga.cpp @@ -304,7 +304,7 @@ const tiny_rom_entry *isa8_cga_device::device_rom_region() const // isa8_cga_device - constructor //------------------------------------------------- -isa8_cga_device::isa8_cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_cga_device::isa8_cga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_CGA, "IBM Color/Graphics Monitor Adapter", tag, owner, clock, "cga", __FILE__), device_isa8_card_interface(mconfig, *this), m_cga_config(*this, "cga_config"), m_framecnt(0), m_mode_control(0), m_color_select(0), @@ -320,7 +320,7 @@ isa8_cga_device::isa8_cga_device(const machine_config &mconfig, const char *tag, m_superimpose = false; } -isa8_cga_device::isa8_cga_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) : +isa8_cga_device::isa8_cga_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_isa8_card_interface(mconfig, *this), m_cga_config(*this, "cga_config"), m_framecnt(0), m_mode_control(0), m_color_select(0), @@ -413,7 +413,7 @@ void isa8_cga_device::device_reset() ***************************************************************************/ -UINT32 isa8_cga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t isa8_cga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { mc6845_device *mc6845 = subdevice(CGA_MC6845_NAME); @@ -445,7 +445,7 @@ const device_type ISA8_CGA_POISK2 = &device_creator; // isa8_cga_poisk2_device - constructor //------------------------------------------------- -isa8_cga_poisk2_device::isa8_cga_poisk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_cga_poisk2_device::isa8_cga_poisk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_cga_device( mconfig, ISA8_CGA_POISK2, "ISA8_CGA_POISK2", tag, owner, clock, "cga_poisk2", __FILE__) { m_chr_gen_offset[0] = 0x0000; @@ -474,13 +474,13 @@ const device_type ISA8_CGA_SUPERIMPOSE = &device_creatorpalette()->entry_list_raw(); int i; if ( y == 0 ) CGA_LOG(1,"cga_text_inten_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_chr_gen[ chr * 8 + ra ]; - UINT16 fg = attr & 0x0F; - UINT16 bg = attr >> 4; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_chr_gen[ chr * 8 + ra ]; + uint16_t fg = attr & 0x0F; + uint16_t bg = attr >> 4; if ( i == cursor_x && ( m_framecnt & 0x08 ) ) { @@ -532,20 +532,20 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_text_inten_update_row ) MC6845_UPDATE_ROW( isa8_cga_device::cga_text_inten_comp_grey_update_row ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); int i; if ( y == 0 ) CGA_LOG(1,"cga_text_inten_comp_grey_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_chr_gen[ chr * 8 + ra ]; - UINT16 fg = 0x10 + ( attr & 0x0F ); - UINT16 bg = 0x10 + ( ( attr >> 4 ) & 0x07 ); + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_chr_gen[ chr * 8 + ra ]; + uint16_t fg = 0x10 + ( attr & 0x0F ); + uint16_t bg = 0x10 + ( ( attr >> 4 ) & 0x07 ); if ( i == cursor_x && ( m_framecnt & 0x08 ) ) { @@ -570,19 +570,19 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_text_inten_comp_grey_update_row ) MC6845_UPDATE_ROW( isa8_cga_device::cga_text_inten_alt_update_row ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); int i; if ( y == 0 ) CGA_LOG(1,"cga_text_inten_alt_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_chr_gen[ chr * 8 + ra ]; - UINT16 fg = attr & 0x0F; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_chr_gen[ chr * 8 + ra ]; + uint16_t fg = attr & 0x0F; if ( i == cursor_x && ( m_framecnt & 0x08 ) ) { @@ -608,20 +608,20 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_text_inten_alt_update_row ) MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_update_row ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); int i; if ( y == 0 ) CGA_LOG(1,"cga_text_blink_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_chr_gen[ chr * 8 + ra ]; - UINT16 fg = attr & 0x0F; - UINT16 bg = (attr >> 4) & 0x07; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_chr_gen[ chr * 8 + ra ]; + uint16_t fg = attr & 0x0F; + uint16_t bg = (attr >> 4) & 0x07; if ( i == cursor_x ) { @@ -651,21 +651,21 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_update_row ) MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_update_row_si ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); int i; if ( y == 0 ) CGA_LOG(1,"cga_text_blink_update_row_si",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_chr_gen[ chr * 8 + ra ]; - UINT16 fg = attr & 0x0F; - UINT16 bg = (attr >> 4) & 0x07; - UINT8 xi; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_chr_gen[ chr * 8 + ra ]; + uint16_t fg = attr & 0x0F; + uint16_t bg = (attr >> 4) & 0x07; + uint8_t xi; if ( i == cursor_x ) { @@ -684,7 +684,7 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_update_row_si ) for(xi=0;xi<8;xi++) { - UINT8 pen_data, dot; + uint8_t pen_data, dot; dot = (data & (1 << (7-xi))); pen_data = dot ? fg : bg; @@ -702,20 +702,20 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_update_row_si ) MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_alt_update_row ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); int i; if ( y == 0 ) CGA_LOG(1,"cga_text_blink_alt_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; - UINT8 chr = videoram[ offset ]; - UINT8 attr = videoram[ offset +1 ]; - UINT8 data = m_chr_gen[ chr * 8 + ra ]; - UINT16 fg = attr & 0x07; - UINT16 bg = 0; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; + uint8_t chr = videoram[ offset ]; + uint8_t attr = videoram[ offset +1 ]; + uint8_t data = m_chr_gen[ chr * 8 + ra ]; + uint16_t fg = attr & 0x07; + uint16_t bg = 0; if ( i == cursor_x ) { @@ -749,16 +749,16 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_text_blink_alt_update_row ) MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bppl_update_row ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); int i; if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bppl_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); - UINT8 data = videoram[ offset ]; + uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); + uint8_t data = videoram[ offset ]; *p = palette[data >> 4]; p++; *p = palette[data >> 4]; p++; @@ -782,9 +782,9 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bppl_update_row ) * are the same size as the normal colour ones. */ -static const UINT8 yc_lut2[4] = { 0, 182, 71, 255 }; +static const uint8_t yc_lut2[4] = { 0, 182, 71, 255 }; -static const UINT8 yc_lut[16][8] = +static const uint8_t yc_lut[16][8] = { { 0, 0, 0, 0, 0, 0, 0, 0 }, /* black */ { 0, 0, 0, 0, 1, 1, 1, 1 }, /* blue */ @@ -808,8 +808,8 @@ static const UINT8 yc_lut[16][8] = MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bpph_update_row ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); int i; @@ -817,8 +817,8 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bpph_update_row ) for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); - UINT8 data = videoram[ offset ]; + uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); + uint8_t data = videoram[ offset ]; *p = palette[data >> 4]; p++; *p = palette[data >> 4]; p++; @@ -851,16 +851,16 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bpph_update_row ) MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_2bpp_update_row ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); int i; if ( y == 0 ) CGA_LOG(1,"cga_gfx_2bpp_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 ); - UINT8 data = videoram[ offset ]; + uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 ); + uint8_t data = videoram[ offset ]; *p = palette[m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++; *p = palette[m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++; @@ -886,17 +886,17 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_2bpp_update_row ) MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_1bpp_update_row ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 fg = m_color_select & 0x0F; + uint8_t fg = m_color_select & 0x0F; int i; if ( y == 0 ) CGA_LOG(1,"cga_gfx_1bpp_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 ); - UINT8 data = videoram[ offset ]; + uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 ); + uint8_t data = videoram[ offset ]; *p = palette[( data & 0x80 ) ? fg : 0]; p++; *p = palette[( data & 0x40 ) ? fg : 0]; p++; @@ -1007,10 +1007,10 @@ void isa8_cga_device::set_palette_luts(void) * x x x 1 1 1 1 0 - 640x200 graphics. Colour on black on RGB monitor, monochrome on composite monitor. * x x x 1 1 1 1 1 - unknown/invalid. */ -void isa8_cga_device::mode_control_w(UINT8 data) +void isa8_cga_device::mode_control_w(uint8_t data) { mc6845_device *mc6845 = subdevice(CGA_MC6845_NAME); - UINT8 monitor = CGA_MONITOR; + uint8_t monitor = CGA_MONITOR; m_mode_control = data; @@ -1114,7 +1114,7 @@ void isa8_cga_device::mode_control_w(UINT8 data) /* * Select Plantronics modes */ -void isa8_cga_device::plantronics_w(UINT8 data) +void isa8_cga_device::plantronics_w(uint8_t data) { if ( ( CGA_CHIPSET ) != CGA_CHIPSET_ATI) return; @@ -1135,7 +1135,7 @@ void isa8_cga_device::plantronics_w(UINT8 data) READ8_MEMBER( isa8_cga_device::io_read ) { mc6845_device *mc6845 = subdevice(CGA_MC6845_NAME); - UINT8 data = 0xff; + uint8_t data = 0xff; switch( offset ) { @@ -1262,11 +1262,11 @@ WRITE8_MEMBER( isa8_cga_device::io_write ) // // //static inline void pgfx_plot_unit_2bpp(bitmap_ind16 &bitmap, -// int x, int y, const UINT16 *palette, int offs) +// int x, int y, const uint16_t *palette, int offs) //{ // int i; -// UINT8 bmap[2], values[2]; -// UINT16 *dest; +// uint8_t bmap[2], values[2]; +// uint16_t *dest; // // if (cga.plantronics & 0x40) // { @@ -1316,7 +1316,7 @@ WRITE8_MEMBER( isa8_cga_device::io_write ) // int height = mscrtc6845_get_char_height(crtc); // int columns = mscrtc6845_get_char_columns(crtc)*2; // int colorset = cga.color_select & 0x3F; -// const UINT16 *palette; +// const uint16_t *palette; // // /* Most chipsets use bit 2 of the mode control register to // * access a third palette. But not consistently. */ @@ -1369,20 +1369,20 @@ WRITE8_MEMBER( isa8_cga_device::io_write ) MC6845_UPDATE_ROW( isa8_cga_pc1512_device::pc1512_gfx_4bpp_update_row ) { - UINT8 *videoram = &m_vram[m_start_offset]; - UINT32 *p = &bitmap.pix32(y); + uint8_t *videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT16 offset_base = ra << 13; + uint16_t offset_base = ra << 13; int j; if ( y == 0 ) CGA_LOG(1,"pc1512_gfx_4bpp_update_row",("\n")); for ( j = 0; j < x_count; j++ ) { - UINT16 offset = offset_base | ( ( ma + j ) & 0x1FFF ); - UINT16 i = ( m_color_select & 8 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[3] | offset ] << 3 : 0; - UINT16 r = ( m_color_select & 4 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[2] | offset ] << 2 : 0; - UINT16 g = ( m_color_select & 2 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[1] | offset ] << 1 : 0; - UINT16 b = ( m_color_select & 1 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[0] | offset ] : 0; + uint16_t offset = offset_base | ( ( ma + j ) & 0x1FFF ); + uint16_t i = ( m_color_select & 8 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[3] | offset ] << 3 : 0; + uint16_t r = ( m_color_select & 4 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[2] | offset ] << 2 : 0; + uint16_t g = ( m_color_select & 2 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[1] | offset ] << 1 : 0; + uint16_t b = ( m_color_select & 1 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[0] | offset ] : 0; *p = palette[( ( i & 0x400 ) | ( r & 0x200 ) | ( g & 0x100 ) | ( b & 0x80 ) ) >> 7]; p++; *p = palette[( ( i & 0x200 ) | ( r & 0x100 ) | ( g & 0x080 ) | ( b & 0x40 ) ) >> 6]; p++; @@ -1498,7 +1498,7 @@ WRITE8_MEMBER( isa8_cga_pc1512_device::io_write ) READ8_MEMBER( isa8_cga_pc1512_device::io_read ) { - UINT8 data; + uint8_t data; switch (offset) { @@ -1541,7 +1541,7 @@ WRITE8_MEMBER( isa8_cga_pc1512_device::vram_w ) const device_type ISA8_CGA_PC1512 = &device_creator; const offs_t isa8_cga_pc1512_device::vram_offset[4]= { 0x0000, 0x4000, 0x8000, 0xC000 }; -const UINT8 isa8_cga_pc1512_device::mc6845_writeonce_register[31] = +const uint8_t isa8_cga_pc1512_device::mc6845_writeonce_register[31] = { 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -1550,7 +1550,7 @@ const UINT8 isa8_cga_pc1512_device::mc6845_writeonce_register[31] = // isa8_cga_pc1512_device - constructor //------------------------------------------------- -isa8_cga_pc1512_device::isa8_cga_pc1512_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_cga_pc1512_device::isa8_cga_pc1512_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_cga_device( mconfig, ISA8_CGA_PC1512, "ISA8_CGA_PC1512", tag, owner, clock, "cga_pc1512", __FILE__), m_write(0), m_read(0), m_mc6845_address(0) { m_vram_size = 0x10000; @@ -1604,7 +1604,7 @@ void isa8_cga_pc1512_device::device_reset() membank("bank1")->set_base(&m_vram[isa8_cga_pc1512_device::vram_offset[0]]); } -void isa8_wyse700_device::change_resolution(UINT8 mode) +void isa8_wyse700_device::change_resolution(uint8_t mode) { int width = 0, height = 0; if (mode & 2) { @@ -1650,7 +1650,7 @@ WRITE8_MEMBER( isa8_wyse700_device::io_write ) READ8_MEMBER( isa8_wyse700_device::io_read ) { - UINT8 data; + uint8_t data; switch (offset) { @@ -1680,7 +1680,7 @@ const device_type ISA8_WYSE700 = &device_creator; // isa8_wyse700_device - constructor //------------------------------------------------- -isa8_wyse700_device::isa8_wyse700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_wyse700_device::isa8_wyse700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_cga_device( mconfig, ISA8_WYSE700, "Wyse 700", tag, owner, clock, "wyse700", __FILE__), m_bank_offset(0), m_bank_base(0), m_control(0) { m_vram_size = 0x20000; @@ -1732,14 +1732,14 @@ void isa8_wyse700_device::device_reset() m_bank_base = 0; } -UINT32 isa8_wyse700_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t isa8_wyse700_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_control & 0x08) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 fg = m_color_select & 0x0F; - UINT32 addr = 0; + uint8_t fg = m_color_select & 0x0F; + uint32_t addr = 0; for (int y = 0; y < 800; y++) { - UINT8 *src = &m_vram[addr]; + uint8_t *src = &m_vram[addr]; if (y & 1) { src += 0x10000; @@ -1747,7 +1747,7 @@ UINT32 isa8_wyse700_device::screen_update(screen_device &screen, bitmap_rgb32 &b } for (int x = 0; x < (1280 / 8); x++) { - UINT8 val = src[x]; + uint8_t val = src[x]; for (int i = 0; i < 8; i++) { bitmap.pix32(y,x*8+i) = (val & 0x80) ? palette[fg] : palette[0x00]; @@ -1768,7 +1768,7 @@ const device_type ISA8_EC1841_0002 = &device_creator; // isa8_ec1841_0002_device - constructor //------------------------------------------------- -isa8_ec1841_0002_device::isa8_ec1841_0002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_ec1841_0002_device::isa8_ec1841_0002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_cga_device( mconfig, ISA8_EC1841_0002, "EC 1841.0002 (CGA)", tag, owner, clock, "ec1841_0002", __FILE__), m_p3df(0) { } @@ -1834,7 +1834,7 @@ WRITE8_MEMBER( isa8_ec1841_0002_device::io_write ) READ8_MEMBER( isa8_ec1841_0002_device::io_read ) { - UINT8 data; + uint8_t data; switch (offset) { @@ -1854,7 +1854,7 @@ const device_type ISA8_CGA_MC1502 = &device_creator; // isa8_cga_mc1502_device - constructor //------------------------------------------------- -isa8_cga_mc1502_device::isa8_cga_mc1502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_cga_mc1502_device::isa8_cga_mc1502_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_cga_device( mconfig, ISA8_CGA_MC1502, "MC1502 CGA", tag, owner, clock, "cga_mc1502", __FILE__) { m_vram_size = 0x8000; @@ -1883,7 +1883,7 @@ const device_type ISA8_CGA_ISKR1031 = &device_creator; // isa8_cga_iskr1031_device - constructor //------------------------------------------------- -isa8_cga_iskr1031_device::isa8_cga_iskr1031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_cga_iskr1031_device::isa8_cga_iskr1031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_cga_device( mconfig, ISA8_CGA_ISKR1031, "Iskra-1031 CGA", tag, owner, clock, "cga_iskr1031", __FILE__) { } @@ -1908,7 +1908,7 @@ const device_type ISA8_CGA_ISKR1030M = &device_creatorpalette()->entry_list_raw(); - UINT8 fg = m_color_select & 0x0F; + uint8_t fg = m_color_select & 0x0F; int i; if ( y == 0 ) CGA_LOG(1,"m24_gfx_1bpp_m24_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 3 ) << 13 ); - UINT8 data = videoram[ offset ]; + uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 3 ) << 13 ); + uint8_t data = videoram[ offset ]; *p = palette[( data & 0x80 ) ? fg : 0]; p++; *p = palette[( data & 0x40 ) ? fg : 0]; p++; diff --git a/src/devices/bus/isa/cga.h b/src/devices/bus/isa/cga.h index 8fdabd41ebb..54db66e4e10 100644 --- a/src/devices/bus/isa/cga.h +++ b/src/devices/bus/isa/cga.h @@ -26,8 +26,8 @@ class isa8_cga_device : public: // construction/destruction - isa8_cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_cga_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); + isa8_cga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_cga_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 MC6845_UPDATE_ROW( crtc_update_row ); MC6845_UPDATE_ROW( cga_text_inten_update_row ); @@ -53,34 +53,34 @@ protected: virtual void device_start() override; virtual void device_reset() override; public: - void mode_control_w(UINT8 data); + void mode_control_w(uint8_t data); void set_palette_luts(); - void plantronics_w(UINT8 data); + void plantronics_w(uint8_t data); virtual DECLARE_READ8_MEMBER( io_read ); virtual DECLARE_WRITE8_MEMBER( io_write ); DECLARE_WRITE_LINE_MEMBER( hsync_changed ); DECLARE_WRITE_LINE_MEMBER( vsync_changed ); - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); MC6845_RECONFIGURE(reconfigure); public: int m_framecnt; - UINT8 m_mode_control; /* wo 0x3d8 */ - UINT8 m_color_select; /* wo 0x3d9 */ - //UINT8 m_status; //unused? /* ro 0x3da */ + uint8_t m_mode_control; /* wo 0x3d8 */ + uint8_t m_color_select; /* wo 0x3d9 */ + //uint8_t m_status; //unused? /* ro 0x3da */ int m_update_row_type, m_y; - UINT8 m_palette_lut_2bpp[4]; + uint8_t m_palette_lut_2bpp[4]; offs_t m_chr_gen_offset[4]; - UINT8 m_font_selection_mask; - UINT8 *m_chr_gen_base; - UINT8 *m_chr_gen; - UINT8 m_vsync; - UINT8 m_hsync; + uint8_t m_font_selection_mask; + uint8_t *m_chr_gen_base; + uint8_t *m_chr_gen; + uint8_t m_vsync; + uint8_t m_hsync; size_t m_vram_size; - std::vector m_vram; + std::vector m_vram; bool m_superimpose; - UINT8 m_plantronics; /* This should be moved into the appropriate subclass */ + uint8_t m_plantronics; /* This should be moved into the appropriate subclass */ offs_t m_start_offset; required_device m_palette; required_device m_screen; @@ -97,8 +97,8 @@ class isa8_cga_superimpose_device : { public: // construction/destruction - isa8_cga_superimpose_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_cga_superimpose_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); + isa8_cga_superimpose_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_cga_superimpose_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 type definition @@ -112,7 +112,7 @@ class isa8_cga_poisk2_device : { public: // construction/destruction - isa8_cga_poisk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_cga_poisk2_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; }; @@ -128,7 +128,7 @@ class isa8_cga_pc1512_device : { public: // construction/destruction - isa8_cga_pc1512_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_cga_pc1512_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; virtual const tiny_rom_entry *device_rom_region() const override; @@ -142,17 +142,17 @@ protected: virtual void device_reset() override; public: - UINT8 m_write; - UINT8 m_read; - UINT8 m_mc6845_address; - UINT8 m_mc6845_locked_register[31]; + uint8_t m_write; + uint8_t m_read; + uint8_t m_mc6845_address; + uint8_t m_mc6845_locked_register[31]; public: // Static information // mapping of the 4 planes into videoram // (text data should be readable at videoram+0) static const offs_t vram_offset[4]; - static const UINT8 mc6845_writeonce_register[31]; + static const uint8_t mc6845_writeonce_register[31]; virtual DECLARE_READ8_MEMBER( io_read ) override; virtual DECLARE_WRITE8_MEMBER( io_write ) override; @@ -170,7 +170,7 @@ class isa8_wyse700_device : { public: // construction/destruction - isa8_wyse700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_wyse700_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; @@ -182,12 +182,12 @@ protected: public: virtual DECLARE_READ8_MEMBER( io_read ) override; virtual DECLARE_WRITE8_MEMBER( io_write ) override; - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; - void change_resolution(UINT8 mode); + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + void change_resolution(uint8_t mode); - UINT8 m_bank_offset; - UINT8 m_bank_base; - UINT8 m_control; + uint8_t m_bank_offset; + uint8_t m_bank_base; + uint8_t m_control; }; // device type definition @@ -200,7 +200,7 @@ class isa8_ec1841_0002_device : { public: // construction/destruction - isa8_ec1841_0002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_ec1841_0002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -211,7 +211,7 @@ public: virtual DECLARE_READ8_MEMBER( io_read ) override; virtual DECLARE_WRITE8_MEMBER( io_write ) override; - UINT8 m_p3df; + uint8_t m_p3df; DECLARE_READ8_MEMBER( char_ram_read ); DECLARE_WRITE8_MEMBER( char_ram_write ); }; @@ -226,7 +226,7 @@ class isa8_cga_iskr1030m_device : { public: // construction/destruction - isa8_cga_iskr1030m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_cga_iskr1030m_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -240,7 +240,7 @@ class isa8_cga_iskr1031_device : { public: // construction/destruction - isa8_cga_iskr1031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_cga_iskr1031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -254,7 +254,7 @@ class isa8_cga_mc1502_device : { public: // construction/destruction - isa8_cga_mc1502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_cga_mc1502_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; }; @@ -268,7 +268,7 @@ class isa8_cga_m24_device : { public: // construction/destruction - isa8_cga_m24_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_cga_m24_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; // optional information overrides //virtual const rom_entry *device_rom_region() const; @@ -280,7 +280,7 @@ public: protected: virtual void device_reset() override; private: - UINT8 m_mode2, m_index; + uint8_t m_mode2, m_index; }; // device type definition diff --git a/src/devices/bus/isa/com.cpp b/src/devices/bus/isa/com.cpp index cd374756229..6e346bcc13e 100644 --- a/src/devices/bus/isa/com.cpp +++ b/src/devices/bus/isa/com.cpp @@ -95,13 +95,13 @@ machine_config_constructor isa8_com_device::device_mconfig_additions() const // isa8_com_device - constructor //------------------------------------------------- -isa8_com_device::isa8_com_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_com_device::isa8_com_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_COM, "Communications Adapter PC/XT", tag, owner, clock, "isa_com", __FILE__), device_isa8_card_interface(mconfig, *this) { } -isa8_com_device::isa8_com_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) : +isa8_com_device::isa8_com_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_isa8_card_interface(mconfig, *this) { @@ -188,7 +188,7 @@ machine_config_constructor isa8_com_at_device::device_mconfig_additions() const // isa8_com_device - constructor //------------------------------------------------- -isa8_com_at_device::isa8_com_at_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_com_at_device::isa8_com_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_com_device(mconfig, ISA8_COM_AT, "Communications Adapter", tag, owner, clock, "isa_com_at", __FILE__) { } diff --git a/src/devices/bus/isa/com.h b/src/devices/bus/isa/com.h index 807d390ef83..3574bac9cfb 100644 --- a/src/devices/bus/isa/com.h +++ b/src/devices/bus/isa/com.h @@ -21,8 +21,8 @@ class isa8_com_device : { public: // construction/destruction - isa8_com_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_com_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); + isa8_com_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_com_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -45,7 +45,7 @@ class isa8_com_at_device : { public: // construction/destruction - isa8_com_at_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_com_at_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; diff --git a/src/devices/bus/isa/dectalk.cpp b/src/devices/bus/isa/dectalk.cpp index 10f8bdb58f4..36e8f78accd 100644 --- a/src/devices/bus/isa/dectalk.cpp +++ b/src/devices/bus/isa/dectalk.cpp @@ -5,7 +5,7 @@ const device_type ISA8_DECTALK = &device_creator; -dectalk_isa_device::dectalk_isa_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) : +dectalk_isa_device::dectalk_isa_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : device_t(mconfig, ISA8_DECTALK, "DECTalk-PC", tag, owner, clock, "dectalk_isa", __FILE__), device_isa8_card_interface(mconfig, *this), m_cmd(0), diff --git a/src/devices/bus/isa/dectalk.h b/src/devices/bus/isa/dectalk.h index 971d8915e96..448124815fd 100644 --- a/src/devices/bus/isa/dectalk.h +++ b/src/devices/bus/isa/dectalk.h @@ -13,7 +13,7 @@ class dectalk_isa_device : public device_t, public device_isa8_card_interface { public: - dectalk_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dectalk_isa_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; @@ -43,8 +43,8 @@ protected: virtual void device_reset() override; private: - UINT16 m_cmd, m_stat, m_data, m_dsp_dma, m_ctl; - UINT8 m_dma, m_vol, m_bio; + uint16_t m_cmd, m_stat, m_data, m_dsp_dma, m_ctl; + uint8_t m_dma, m_vol, m_bio; required_device m_cpu; required_device m_dac; diff --git a/src/devices/bus/isa/ega.cpp b/src/devices/bus/isa/ega.cpp index 1c0a4e78be9..e782c18573b 100644 --- a/src/devices/bus/isa/ega.cpp +++ b/src/devices/bus/isa/ega.cpp @@ -570,7 +570,7 @@ ioport_constructor isa8_ega_device::device_input_ports() const // isa8_ega_device - constructor //------------------------------------------------- -isa8_ega_device::isa8_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_ega_device::isa8_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_EGA, "IBM Enhanced Graphics Adapter", tag, owner, clock, "ega", __FILE__), device_isa8_card_interface(mconfig, *this), m_crtc_ega(nullptr), m_vram(nullptr), m_videoram(nullptr), m_charA(nullptr), m_charB(nullptr), m_misc_output(0), m_feature_control(0), m_frame_cnt(0), m_hsync(0), m_vsync(0), m_vblank(0), m_display_enable(0), m_video_mode(0), @@ -578,7 +578,7 @@ isa8_ega_device::isa8_ega_device(const machine_config &mconfig, const char *tag, { } -isa8_ega_device::isa8_ega_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) : +isa8_ega_device::isa8_ega_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_isa8_card_interface(mconfig, *this), m_crtc_ega(nullptr), m_vram(nullptr), m_videoram(nullptr), m_charA(nullptr), m_charB(nullptr), m_misc_output(0), m_feature_control(0), m_frame_cnt(0), m_hsync(0), m_vsync(0), m_vblank(0), m_display_enable(0), m_video_mode(0), @@ -599,17 +599,17 @@ void isa8_ega_device::device_start() for (int i = 0; i < 64; i++ ) { - UINT8 r = ( ( i & 0x04 ) ? 0xAA : 0x00 ) + ( ( i & 0x20 ) ? 0x55 : 0x00 ); - UINT8 g = ( ( i & 0x02 ) ? 0xAA : 0x00 ) + ( ( i & 0x10 ) ? 0x55 : 0x00 ); - UINT8 b = ( ( i & 0x01 ) ? 0xAA : 0x00 ) + ( ( i & 0x08 ) ? 0x55 : 0x00 ); + uint8_t r = ( ( i & 0x04 ) ? 0xAA : 0x00 ) + ( ( i & 0x20 ) ? 0x55 : 0x00 ); + uint8_t g = ( ( i & 0x02 ) ? 0xAA : 0x00 ) + ( ( i & 0x10 ) ? 0x55 : 0x00 ); + uint8_t b = ( ( i & 0x01 ) ? 0xAA : 0x00 ) + ( ( i & 0x08 ) ? 0x55 : 0x00 ); m_palette->set_pen_color( i, r, g, b ); } if(m_default_bios_tag != "iskr3104") { - UINT8 *dst = memregion(subtag("user2").c_str())->base() + 0x0000; - UINT8 *src = memregion(subtag("user1").c_str())->base() + 0x3fff; + uint8_t *dst = memregion(subtag("user2").c_str())->base() + 0x0000; + uint8_t *src = memregion(subtag("user1").c_str())->base() + 0x3fff; int i; /* Perform the EGA bios address line swaps */ @@ -626,13 +626,13 @@ void isa8_ega_device::device_start() m_videoram = m_vram->base(); m_plane[0] = m_videoram + 0x00000; - memset(m_plane[0], 0, sizeof(UINT8) * 0x10000); + memset(m_plane[0], 0, sizeof(uint8_t) * 0x10000); m_plane[1] = m_videoram + 0x10000; - memset(m_plane[1], 0, sizeof(UINT8) * 0x10000); + memset(m_plane[1], 0, sizeof(uint8_t) * 0x10000); m_plane[2] = m_videoram + 0x20000; - memset(m_plane[2], 0, sizeof(UINT8) * 0x10000); + memset(m_plane[2], 0, sizeof(uint8_t) * 0x10000); m_plane[3] = m_videoram + 0x30000; - memset(m_plane[3], 0, sizeof(UINT8) * 0x10000); + memset(m_plane[3], 0, sizeof(uint8_t) * 0x10000); m_crtc_ega = subdevice(EGA_CRTC_NAME); @@ -783,7 +783,7 @@ WRITE_LINE_MEMBER( isa8_ega_device::vblank_changed ) CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics ) { - UINT16 *p = &bitmap.pix16(y); + uint16_t *p = &bitmap.pix16(y); // logerror( "pc_ega_graphics: y = %d, x_count = %d, ma = %d, ra = %d\n", y, x_count, ma, ra ); @@ -793,8 +793,8 @@ CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics ) for ( int i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) & 0x1fff ) | ( ( y & 1 ) << 12 ); - UINT8 data = m_plane[0][offset]; + uint16_t offset = ( ( ma + i ) & 0x1fff ) | ( ( y & 1 ) << 12 ); + uint8_t data = m_plane[0][offset]; *p = m_attribute.data[ ( data >> 6 ) ]; p++; *p = m_attribute.data[ ( data >> 4 ) & 0x03 ]; p++; @@ -813,19 +813,19 @@ CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics ) { // EGA mode - UINT8 mask = m_attribute.data[0x12] & 0x0f; + uint8_t mask = m_attribute.data[0x12] & 0x0f; for ( int i = 0; i < x_count; i++ ) { - UINT16 offset = ma + i; - UINT16 data0 = m_plane[0][offset]; - UINT16 data1 = m_plane[1][offset] << 1; - UINT16 data2 = m_plane[2][offset] << 2; - UINT16 data3 = m_plane[3][offset] << 3; + uint16_t offset = ma + i; + uint16_t data0 = m_plane[0][offset]; + uint16_t data1 = m_plane[1][offset] << 1; + uint16_t data2 = m_plane[2][offset] << 2; + uint16_t data3 = m_plane[3][offset] << 3; for ( int j = 7; j >= 0; j-- ) { - UINT16 col = ( data0 & 0x01 ) | ( data1 & 0x02 ) | ( data2 & 0x04 ) | ( data3 & 0x08 ); + uint16_t col = ( data0 & 0x01 ) | ( data1 & 0x02 ) | ( data2 & 0x04 ) | ( data3 & 0x08 ); col &= mask; @@ -844,19 +844,19 @@ CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics ) CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_text ) { - UINT16 *p = &bitmap.pix16(y); + uint16_t *p = &bitmap.pix16(y); int i; // logerror( "pc_ega_text: y = %d, x_count = %d, ma = %d, ra = %d\n", y, x_count, ma, ra ); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ma + i; - UINT8 chr = m_plane[0][ offset ]; - UINT8 attr = m_plane[1][ offset ]; - UINT8 data; - UINT16 fg = m_attribute.data[ attr & 0x07 ]; - UINT16 bg = m_attribute.data[ ( attr >> 4 ) & 0x07 ]; + uint16_t offset = ma + i; + uint8_t chr = m_plane[0][ offset ]; + uint8_t attr = m_plane[1][ offset ]; + uint8_t data; + uint16_t fg = m_attribute.data[ attr & 0x07 ]; + uint16_t bg = m_attribute.data[ ( attr >> 4 ) & 0x07 ]; /* If character set A and B are equal attribute bit 3 is used as intensity */ if ( m_charA == m_charB ) @@ -961,7 +961,7 @@ void isa8_ega_device::change_mode() READ8_MEMBER( isa8_ega_device::read ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; if ( !space.debugger_access() && ! ( m_sequencer.data[4] & 0x04 ) ) { @@ -997,9 +997,9 @@ READ8_MEMBER( isa8_ega_device::read ) } -UINT8 isa8_ega_device::alu_op( UINT8 data, UINT8 latch_data ) +uint8_t isa8_ega_device::alu_op( uint8_t data, uint8_t latch_data ) { - UINT8 mask = m_graphics_controller.data[8]; + uint8_t mask = m_graphics_controller.data[8]; switch( m_graphics_controller.data[3] & 0x18 ) { @@ -1021,9 +1021,9 @@ UINT8 isa8_ega_device::alu_op( UINT8 data, UINT8 latch_data ) WRITE8_MEMBER( isa8_ega_device::write ) { - UINT8 d[4]; - UINT8 alu[4]; - UINT8 target_mask = m_graphics_controller.data[8]; + uint8_t d[4]; + uint8_t alu[4]; + uint8_t target_mask = m_graphics_controller.data[8]; alu[0] =alu[1] = alu[2] = alu[3] = 0; @@ -1286,7 +1286,7 @@ READ8_MEMBER(isa8_ega_device::pc_ega8_3c0_r ) /* Feature Read */ case 2: { - UINT8 dips = ioport("config")->read(); + uint8_t dips = ioport("config")->read(); data = ( data & 0x0f ); data |= ( ( m_feature_control & 0x03 ) << 5 ); @@ -1313,18 +1313,18 @@ READ8_MEMBER(isa8_ega_device::pc_ega8_3c0_r ) WRITE8_MEMBER(isa8_ega_device::pc_ega8_3c0_w ) { - static const UINT8 ar_reg_mask[0x20] = + static const uint8_t ar_reg_mask[0x20] = { 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x7F, 0x3F, 0x3F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - static const UINT8 sr_reg_mask[0x08] = + static const uint8_t sr_reg_mask[0x08] = { 0x03, 0x0F, 0x0F, 0x0F, 0x07, 0x00, 0x00, 0x00 }; - static const UINT8 gr_reg_mask[0x10] = + static const uint8_t gr_reg_mask[0x10] = { 0x0F, 0x0F, 0x0F, 0x1F, 0x07, 0x3F, 0x0F, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 diff --git a/src/devices/bus/isa/ega.h b/src/devices/bus/isa/ega.h index 6c09f34214c..9f40b1c577e 100644 --- a/src/devices/bus/isa/ega.h +++ b/src/devices/bus/isa/ega.h @@ -21,8 +21,8 @@ class isa8_ega_device : { public: // construction/destruction - isa8_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_ega_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); + isa8_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_ega_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -51,7 +51,7 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT8 alu_op( UINT8 data, UINT8 latch_data ); + uint8_t alu_op( uint8_t data, uint8_t latch_data ); public: crtc_ega_device *m_crtc_ega; @@ -63,43 +63,43 @@ public: /* Video memory and related variables */ memory_region *m_vram; - UINT8 *m_plane[4]; - UINT8 m_read_latch[4]; - UINT8 *m_videoram; - UINT8 *m_charA; - UINT8 *m_charB; + uint8_t *m_plane[4]; + uint8_t m_read_latch[4]; + uint8_t *m_videoram; + uint8_t *m_charA; + uint8_t *m_charB; /* Registers */ - UINT8 m_misc_output; - UINT8 m_feature_control; + uint8_t m_misc_output; + uint8_t m_feature_control; /* Attribute registers AR00 - AR14 */ struct { - UINT8 index; - UINT8 data[32]; - UINT8 index_write; + uint8_t index; + uint8_t data[32]; + uint8_t index_write; } m_attribute; /* Sequencer registers SR00 - SR04 */ struct { - UINT8 index; - UINT8 data[8]; + uint8_t index; + uint8_t data[8]; } m_sequencer; /* Graphics controller registers GR00 - GR08 */ struct { - UINT8 index; - UINT8 data[16]; + uint8_t index; + uint8_t data[16]; } m_graphics_controller; - UINT8 m_frame_cnt; - UINT8 m_hsync; - UINT8 m_vsync; - UINT8 m_vblank; - UINT8 m_display_enable; + uint8_t m_frame_cnt; + uint8_t m_hsync; + uint8_t m_vsync; + uint8_t m_vblank; + uint8_t m_display_enable; int m_video_mode; required_device m_palette; }; diff --git a/src/devices/bus/isa/fdc.cpp b/src/devices/bus/isa/fdc.cpp index a7698784a26..c3b1d18eb69 100644 --- a/src/devices/bus/isa/fdc.cpp +++ b/src/devices/bus/isa/fdc.cpp @@ -72,7 +72,7 @@ static MACHINE_CONFIG_FRAGMENT( cfg_superio ) MACHINE_CONFIG_END -isa8_fdc_device::isa8_fdc_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) : +isa8_fdc_device::isa8_fdc_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_isa8_card_interface(mconfig, *this), fdc(*this, "fdc") @@ -100,12 +100,12 @@ WRITE_LINE_MEMBER( isa8_fdc_device::drq_w ) m_isa->drq2_w(state ? ASSERT_LINE : CLEAR_LINE); } -UINT8 isa8_fdc_device::dack_r(int line) +uint8_t isa8_fdc_device::dack_r(int line) { return fdc->dma_r(); } -void isa8_fdc_device::dack_w(int line, UINT8 data) +void isa8_fdc_device::dack_w(int line, uint8_t data) { return fdc->dma_w(data); } @@ -115,7 +115,7 @@ void isa8_fdc_device::eop_w(int state) fdc->tc_w(state == ASSERT_LINE); } -isa8_fdc_xt_device::isa8_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : isa8_fdc_device(mconfig, ISA8_FDC_XT, "ISA 8bits XT FDC hookup", tag, owner, clock, "isa8_fdc_xt", __FILE__) +isa8_fdc_xt_device::isa8_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_XT, "ISA 8bits XT FDC hookup", tag, owner, clock, "isa8_fdc_xt", __FILE__) { } @@ -124,7 +124,7 @@ machine_config_constructor isa8_fdc_xt_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME(cfg_xt); } -isa8_fdc_at_device::isa8_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : isa8_fdc_device(mconfig, ISA8_FDC_AT, "ISA 8bits AT FDC hookup", tag, owner, clock, "isa8_fdc_at", __FILE__) +isa8_fdc_at_device::isa8_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_AT, "ISA 8bits AT FDC hookup", tag, owner, clock, "isa8_fdc_at", __FILE__) { } @@ -133,7 +133,7 @@ machine_config_constructor isa8_fdc_at_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME(cfg_at); } -isa8_fdc_smc_device::isa8_fdc_smc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : isa8_fdc_device(mconfig, ISA8_FDC_XT, "ISA 8bits SMC FDC hookup", tag, owner, clock, "isa8_fdc_smc", __FILE__) +isa8_fdc_smc_device::isa8_fdc_smc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_XT, "ISA 8bits SMC FDC hookup", tag, owner, clock, "isa8_fdc_smc", __FILE__) { } @@ -142,7 +142,7 @@ machine_config_constructor isa8_fdc_smc_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME(cfg_smc); } -isa8_fdc_ps2_device::isa8_fdc_ps2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : isa8_fdc_device(mconfig, ISA8_FDC_PS2, "ISA 8bits PS/2 FDC hookup", tag, owner, clock, "isa8_fdc_ps2", __FILE__) +isa8_fdc_ps2_device::isa8_fdc_ps2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_PS2, "ISA 8bits PS/2 FDC hookup", tag, owner, clock, "isa8_fdc_ps2", __FILE__) { } @@ -151,7 +151,7 @@ machine_config_constructor isa8_fdc_ps2_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME(cfg_ps2); } -isa8_fdc_superio_device::isa8_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : isa8_fdc_device(mconfig, ISA8_FDC_SUPERIO, "ISA 8bits SUPERIO FDC hookup", tag, owner, clock, "isa8_fdc_superio", __FILE__) +isa8_fdc_superio_device::isa8_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_fdc_device(mconfig, ISA8_FDC_SUPERIO, "ISA 8bits SUPERIO FDC hookup", tag, owner, clock, "isa8_fdc_superio", __FILE__) { } diff --git a/src/devices/bus/isa/fdc.h b/src/devices/bus/isa/fdc.h index 1848df8cd0a..bed6389036c 100644 --- a/src/devices/bus/isa/fdc.h +++ b/src/devices/bus/isa/fdc.h @@ -26,7 +26,7 @@ class isa8_fdc_device : { public: // construction/destruction - isa8_fdc_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); + isa8_fdc_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 fdc; @@ -39,38 +39,38 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 dack_r(int line) override; - virtual void dack_w(int line, UINT8 data) override; + virtual uint8_t dack_r(int line) override; + virtual void dack_w(int line, uint8_t data) override; virtual void eop_w(int state) override; }; class isa8_fdc_xt_device : public isa8_fdc_device { public: - isa8_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; class isa8_fdc_at_device : public isa8_fdc_device { public: - isa8_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; class isa8_fdc_smc_device : public isa8_fdc_device { public: - isa8_fdc_smc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_fdc_smc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; class isa8_fdc_ps2_device : public isa8_fdc_device { public: - isa8_fdc_ps2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_fdc_ps2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; class isa8_fdc_superio_device : public isa8_fdc_device { public: - isa8_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; diff --git a/src/devices/bus/isa/finalchs.cpp b/src/devices/bus/isa/finalchs.cpp index 6a41348ad78..53001ee026b 100644 --- a/src/devices/bus/isa/finalchs.cpp +++ b/src/devices/bus/isa/finalchs.cpp @@ -89,7 +89,7 @@ machine_config_constructor isa8_finalchs_device::device_mconfig_additions() cons // isa8_finalchs_device - constructor //------------------------------------------------- -isa8_finalchs_device::isa8_finalchs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +isa8_finalchs_device::isa8_finalchs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_FINALCHS, "Final Chess Card", tag, owner, clock, "finalchs", __FILE__), device_isa8_card_interface( mconfig, *this ), m_FCH_latch_data(0) { diff --git a/src/devices/bus/isa/finalchs.h b/src/devices/bus/isa/finalchs.h index b21af6000f0..a7dfa9b71d7 100644 --- a/src/devices/bus/isa/finalchs.h +++ b/src/devices/bus/isa/finalchs.h @@ -20,7 +20,7 @@ class isa8_finalchs_device : { public: // construction/destruction - isa8_finalchs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_finalchs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(finalchs_r); DECLARE_WRITE8_MEMBER(finalchs_w); @@ -40,7 +40,7 @@ protected: private: // internal state - UINT8 m_FCH_latch_data; + uint8_t m_FCH_latch_data; }; diff --git a/src/devices/bus/isa/gblaster.cpp b/src/devices/bus/isa/gblaster.cpp index 3f36f791c69..59bd7086b85 100644 --- a/src/devices/bus/isa/gblaster.cpp +++ b/src/devices/bus/isa/gblaster.cpp @@ -96,7 +96,7 @@ machine_config_constructor isa8_gblaster_device::device_mconfig_additions() cons // isa8_gblaster_device - constructor //------------------------------------------------- -isa8_gblaster_device::isa8_gblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_gblaster_device::isa8_gblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_GAME_BLASTER, "Game Blaster Sound Card", tag, owner, clock, "isa_gblaster", __FILE__), device_isa8_card_interface(mconfig, *this), m_saa1099_1(*this, "saa1099.1"), diff --git a/src/devices/bus/isa/gblaster.h b/src/devices/bus/isa/gblaster.h index 7dad823033a..69a580fbdee 100644 --- a/src/devices/bus/isa/gblaster.h +++ b/src/devices/bus/isa/gblaster.h @@ -21,7 +21,7 @@ class isa8_gblaster_device : { public: // construction/destruction - isa8_gblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_gblaster_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; @@ -39,7 +39,7 @@ private: // internal state required_device m_saa1099_1; required_device m_saa1099_2; - UINT8 detect_reg; + uint8_t detect_reg; }; diff --git a/src/devices/bus/isa/gus.cpp b/src/devices/bus/isa/gus.cpp index b4294d306ce..165937ea771 100644 --- a/src/devices/bus/isa/gus.cpp +++ b/src/devices/bus/isa/gus.cpp @@ -20,7 +20,7 @@ //#define SAVE_WAVE_RAM 1 //#define LOG_SOUND 1 -static const UINT16 rate_table[33] = +static const uint16_t rate_table[33] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44100, 41160, 38587, 36317, 34300, 32494, 30870, 29400, @@ -28,7 +28,7 @@ static const UINT16 rate_table[33] = 20580, 19916, 19293 }; -static const UINT16 volume_ramp_table[4] = +static const uint16_t volume_ramp_table[4] = { 1, 8, 64, 512 }; @@ -62,7 +62,7 @@ void gf1_device::update_irq() /* only the Adlib timers are implemented in hardware */ READ8_MEMBER( gf1_device::adlib_r ) { - UINT8 retVal = 0xff; + uint8_t retVal = 0xff; switch(offset) { case 0: @@ -241,7 +241,7 @@ void gf1_device::device_timer(emu_timer &timer, device_timer_id id, int param, v void gf1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { int x,y; - //UINT32 count; + //uint32_t count; stream_sample_t* outputl = outputs[0]; stream_sample_t* outputr = outputs[1]; @@ -252,10 +252,10 @@ void gf1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp { stream_sample_t* left = outputl; stream_sample_t* right = outputr; - UINT16 vol = (m_volume_table[(m_voice[x].current_vol & 0xfff0) >> 4]); + uint16_t vol = (m_volume_table[(m_voice[x].current_vol & 0xfff0) >> 4]); for(y=samples-1; y>=0; y--) { - UINT32 current = m_voice[x].current_addr >> 9; + uint32_t current = m_voice[x].current_addr >> 9; // TODO: implement proper panning (*left) += ((m_voice[x].sample) * (vol/8192.0)); (*right) += ((m_voice[x].sample) * (vol/8192.0)); @@ -323,11 +323,11 @@ void gf1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp if(m_voice[x].voice_ctrl & 0x04) { // 16-bit PCM current = ((m_voice[x].current_addr >> 9) & 0xc0000) + (((m_voice[x].current_addr >> 9) & 0x1ffff) << 1); - m_voice[x].sample = (INT16)((m_wave_ram[current & 0xffffe]) | ((m_wave_ram[(current & 0xffffe)+1])<<8)); + m_voice[x].sample = (int16_t)((m_wave_ram[current & 0xffffe]) | ((m_wave_ram[(current & 0xffffe)+1])<<8)); } else { // 8-bit PCM - m_voice[x].sample = (INT16)(m_wave_ram[current & 0xfffff] << 8); + m_voice[x].sample = (int16_t)(m_wave_ram[current & 0xfffff] << 8); } if(m_voice[x].voice_ctrl & 0x40) // voice direction m_voice[x].current_addr -= (m_voice[x].freq_ctrl >> 1); @@ -335,7 +335,7 @@ void gf1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp m_voice[x].current_addr += (m_voice[x].freq_ctrl >> 1); } #ifdef LOG_SOUND - INT16 smp = (m_voice[x].sample) * (vol / 8192.0); + int16_t smp = (m_voice[x].sample) * (vol / 8192.0); fwrite(&smp,4,1,f); #endif } @@ -350,7 +350,7 @@ void gf1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp // gf1_device - constructor //------------------------------------------------- -gf1_device::gf1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +gf1_device::gf1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : acia6850_device(mconfig, GGF1, "Gravis GF1", tag, owner, clock, "gf1", __FILE__), device_sound_interface( mconfig, *this ), m_dma_dram_ctrl(0), m_dma_start_addr(0), m_dram_addr(0), m_timer_ctrl(0), m_timer1_count(0), m_timer2_count(0), m_timer1_value(0), m_timer2_value(0), m_sampling_freq(0), m_sampling_ctrl(0), m_joy_trim_dac(0), m_reset(0), m_active_voices(0), m_irq_source(0), m_stream(nullptr), m_timer1(nullptr), m_timer2(nullptr), m_dmatimer(nullptr), m_voltimer(nullptr), m_current_voice(0), m_current_reg(0), m_adlib_cmd(0), m_mix_ctrl(0), m_gf1_irq(0), m_midi_irq(0), m_dma_channel1(0), m_dma_channel2(0), m_irq_combine(0), m_dma_combine(0), m_adlib_timer_cmd(0), m_adlib_timer1_enable(0), m_adlib_timer2_enable(0), m_adlib_status(0), m_adlib_data(0), m_voice_irq_ptr(0), m_voice_irq_current(0), m_dma_16bit(0), m_statread(0), m_sb_data_2xc(0), m_sb_data_2xe(0), m_reg_ctrl(0), m_fake_adlib_status(0), m_dma_current(0), m_txirq(0), m_rxirq(0), m_txirq_handler(*this), @@ -413,7 +413,7 @@ void gf1_device::device_start() for (i=4095;i>=0;i--) { - m_volume_table[i] = (INT16)out; + m_volume_table[i] = (int16_t)out; out /= 1.002709201; /* 0.0235 dB Steps */ } @@ -479,7 +479,7 @@ WRITE8_MEMBER(gf1_device::global_reg_select_w) READ8_MEMBER(gf1_device::global_reg_data_r) { - UINT16 ret; + uint16_t ret; switch(m_current_reg) { @@ -1068,7 +1068,7 @@ WRITE8_MEMBER(gf1_device::mix_ctrl_w) READ8_MEMBER(gf1_device::sb_r) { - UINT8 val; + uint8_t val; switch(offset) { @@ -1125,7 +1125,7 @@ WRITE8_MEMBER(gf1_device::sb2x6_w) READ8_MEMBER(gf1_device::stat_r) { - UINT8 val = m_statread & 0xf9; + uint8_t val = m_statread & 0xf9; if(m_mix_ctrl & 0x08) val |= 0x02; return val; @@ -1136,7 +1136,7 @@ WRITE8_MEMBER(gf1_device::stat_w) m_reg_ctrl = data; } -void gf1_device::set_irq(UINT8 source, UINT8 voice) +void gf1_device::set_irq(uint8_t source, uint8_t voice) { if(source & IRQ_WAVETABLE) { @@ -1157,7 +1157,7 @@ void gf1_device::set_irq(UINT8 source, UINT8 voice) } } -void gf1_device::reset_irq(UINT8 source) +void gf1_device::reset_irq(uint8_t source) { if(source & IRQ_WAVETABLE) { @@ -1172,12 +1172,12 @@ void gf1_device::reset_irq(UINT8 source) } // TODO: support 16-bit transfers -UINT8 gf1_device::dack_r(int line) +uint8_t gf1_device::dack_r(int line) { return m_wave_ram[m_dma_current++ & 0xfffff]; } -void gf1_device::dack_w(int line,UINT8 data) +void gf1_device::dack_w(int line,uint8_t data) { if(m_dma_dram_ctrl & 0x80) // flip data MSB { @@ -1273,7 +1273,7 @@ ioport_constructor isa16_gus_device::device_input_ports() const } -isa16_gus_device::isa16_gus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_gus_device::isa16_gus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_GUS, "Gravis Ultrasound", tag, owner, clock, "isa_gus", __FILE__), device_isa16_card_interface( mconfig, *this ), m_gf1(*this, "gf1"), m_irq_status(0) @@ -1430,7 +1430,7 @@ READ8_MEMBER(isa16_gus_device::joy_r) { if(offset == 1) { - UINT8 data; + uint8_t data; int delta; attotime new_time = machine().time(); @@ -1552,7 +1552,7 @@ WRITE_LINE_MEMBER(isa16_gus_device::drq2_w) } } -void isa16_gus_device::set_irq(UINT8 source) +void isa16_gus_device::set_irq(uint8_t source) { m_irq_status |= source; @@ -1583,7 +1583,7 @@ void isa16_gus_device::set_irq(UINT8 source) logerror("GUS: Set IRQ %02x\n",source); } -void isa16_gus_device::reset_irq(UINT8 source) +void isa16_gus_device::reset_irq(uint8_t source) { m_irq_status &= ~source; @@ -1614,7 +1614,7 @@ void isa16_gus_device::reset_irq(UINT8 source) logerror("GUS: Reset IRQ %02x\n",source); } -void isa16_gus_device::set_midi_irq(UINT8 source) +void isa16_gus_device::set_midi_irq(uint8_t source) { m_irq_status |= source; @@ -1645,7 +1645,7 @@ void isa16_gus_device::set_midi_irq(UINT8 source) logerror("GUS: Set MIDI IRQ %02x\n",source); } -void isa16_gus_device::reset_midi_irq(UINT8 source) +void isa16_gus_device::reset_midi_irq(uint8_t source) { m_irq_status &= ~source; @@ -1704,7 +1704,7 @@ WRITE_LINE_MEMBER( isa16_gus_device::nmi_w) m_isa->nmi(); } -UINT8 isa16_gus_device::dack_r(int line) +uint8_t isa16_gus_device::dack_r(int line) { if(line == m_gf1->dma_channel1()) return m_gf1->dack_r(line); @@ -1712,7 +1712,7 @@ UINT8 isa16_gus_device::dack_r(int line) return 0; } -void isa16_gus_device::dack_w(int line,UINT8 data) +void isa16_gus_device::dack_w(int line,uint8_t data) { if(line == m_gf1->dma_channel1()) m_gf1->dack_w(line,data); diff --git a/src/devices/bus/isa/gus.h b/src/devices/bus/isa/gus.h index 0370fd6ed80..cac3c7241a5 100644 --- a/src/devices/bus/isa/gus.h +++ b/src/devices/bus/isa/gus.h @@ -99,20 +99,20 @@ struct gus_voice { - UINT8 voice_ctrl; - UINT16 freq_ctrl; - UINT32 start_addr; - UINT32 end_addr; - UINT8 vol_ramp_rate; - UINT8 vol_ramp_start; - UINT8 vol_ramp_end; - UINT16 current_vol; - UINT32 current_addr; - UINT8 pan_position; - UINT8 vol_ramp_ctrl; - UINT32 vol_count; + uint8_t voice_ctrl; + uint16_t freq_ctrl; + uint32_t start_addr; + uint32_t end_addr; + uint8_t vol_ramp_rate; + uint8_t vol_ramp_start; + uint8_t vol_ramp_end; + uint16_t current_vol; + uint32_t current_addr; + uint8_t pan_position; + uint8_t vol_ramp_ctrl; + uint32_t vol_count; bool rollover; - INT16 sample; // current sample data + int16_t sample; // current sample data }; class gf1_device : @@ -121,7 +121,7 @@ class gf1_device : { public: // construction/destruction - gf1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gf1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_txirq_handler(device_t &device, _Object object) { return downcast(device).m_txirq_handler.set_callback(object); } template static devcb_base &set_rxirq_handler(device_t &device, _Object object) { return downcast(device).m_rxirq_handler.set_callback(object); } @@ -136,10 +136,10 @@ public: template static devcb_base &set_nmi_handler(device_t &device, _Object object) { return downcast(device).m_nmi_handler.set_callback(object); } // current IRQ/DMA channel getters - UINT8 gf1_irq() { if(m_gf1_irq != 0) return m_gf1_irq; else return m_midi_irq; } // workaround for win95 loading dumb values - UINT8 midi_irq() { if(m_irq_combine == 0) return m_midi_irq; else return m_gf1_irq; } - UINT8 dma_channel1() { return m_dma_channel1; } - UINT8 dma_channel2() { if(m_dma_combine == 0) return m_dma_channel2; else return m_dma_channel1; } + uint8_t gf1_irq() { if(m_gf1_irq != 0) return m_gf1_irq; else return m_midi_irq; } // workaround for win95 loading dumb values + uint8_t midi_irq() { if(m_irq_combine == 0) return m_midi_irq; else return m_gf1_irq; } + uint8_t dma_channel1() { return m_dma_channel1; } + uint8_t dma_channel2() { if(m_dma_combine == 0) return m_dma_channel2; else return m_dma_channel1; } DECLARE_READ8_MEMBER(global_reg_select_r); DECLARE_WRITE8_MEMBER(global_reg_select_w); @@ -160,8 +160,8 @@ public: DECLARE_WRITE8_MEMBER(sb2x6_w); // DMA signals - UINT8 dack_r(int line); - void dack_w(int line,UINT8 data); + uint8_t dack_r(int line); + void dack_w(int line,uint8_t data); void eop_w(int state); // optional information overrides @@ -172,26 +172,26 @@ public: gus_voice m_voice[32]; // global registers (not voice-specific) - UINT8 m_dma_dram_ctrl; - UINT16 m_dma_start_addr; - UINT32 m_dram_addr; - UINT8 m_timer_ctrl; - UINT8 m_timer1_count; - UINT8 m_timer2_count; - UINT8 m_timer1_value; - UINT8 m_timer2_value; - UINT16 m_sampling_freq; - UINT8 m_sampling_ctrl; - UINT8 m_joy_trim_dac; - UINT8 m_reset; - UINT8 m_active_voices; - UINT8 m_irq_source; - - void set_irq(UINT8 source, UINT8 voice); - void reset_irq(UINT8 source); + uint8_t m_dma_dram_ctrl; + uint16_t m_dma_start_addr; + uint32_t m_dram_addr; + uint8_t m_timer_ctrl; + uint8_t m_timer1_count; + uint8_t m_timer2_count; + uint8_t m_timer1_value; + uint8_t m_timer2_value; + uint16_t m_sampling_freq; + uint8_t m_sampling_ctrl; + uint8_t m_joy_trim_dac; + uint8_t m_reset; + uint8_t m_active_voices; + uint8_t m_irq_source; + + void set_irq(uint8_t source, uint8_t voice); + void reset_irq(uint8_t source); void update_volume_ramps(); - std::vector m_wave_ram; + std::vector m_wave_ram; protected: // device-level overrides @@ -210,36 +210,36 @@ private: emu_timer* m_dmatimer; emu_timer* m_voltimer; - UINT8 m_current_voice; - UINT8 m_current_reg; - //UINT8 m_port; - //UINT8 m_irq; - //UINT8 m_dma; - - UINT8 m_adlib_cmd; - UINT8 m_mix_ctrl; - UINT8 m_gf1_irq; - UINT8 m_midi_irq; - UINT8 m_dma_channel1; - UINT8 m_dma_channel2; - UINT8 m_irq_combine; - UINT8 m_dma_combine; - UINT8 m_adlib_timer_cmd; - UINT8 m_adlib_timer1_enable; - UINT8 m_adlib_timer2_enable; - UINT8 m_adlib_status; - UINT8 m_adlib_data; - UINT8 m_voice_irq_fifo[32]; - UINT8 m_voice_irq_ptr; - UINT8 m_voice_irq_current; - UINT8 m_dma_16bit; // set by bit 6 of the DMA DRAM control reg - UINT8 m_statread; - UINT8 m_sb_data_2xc; - UINT8 m_sb_data_2xe; - UINT8 m_reg_ctrl; - UINT8 m_fake_adlib_status; - UINT32 m_dma_current; - UINT16 m_volume_table[4096]; + uint8_t m_current_voice; + uint8_t m_current_reg; + //uint8_t m_port; + //uint8_t m_irq; + //uint8_t m_dma; + + uint8_t m_adlib_cmd; + uint8_t m_mix_ctrl; + uint8_t m_gf1_irq; + uint8_t m_midi_irq; + uint8_t m_dma_channel1; + uint8_t m_dma_channel2; + uint8_t m_irq_combine; + uint8_t m_dma_combine; + uint8_t m_adlib_timer_cmd; + uint8_t m_adlib_timer1_enable; + uint8_t m_adlib_timer2_enable; + uint8_t m_adlib_status; + uint8_t m_adlib_data; + uint8_t m_voice_irq_fifo[32]; + uint8_t m_voice_irq_ptr; + uint8_t m_voice_irq_current; + uint8_t m_dma_16bit; // set by bit 6 of the DMA DRAM control reg + uint8_t m_statread; + uint8_t m_sb_data_2xc; + uint8_t m_sb_data_2xe; + uint8_t m_reg_ctrl; + uint8_t m_fake_adlib_status; + uint32_t m_dma_current; + uint16_t m_volume_table[4096]; static const device_timer_id ADLIB_TIMER1 = 0; static const device_timer_id ADLIB_TIMER2 = 1; @@ -267,11 +267,11 @@ class isa16_gus_device : public device_isa16_card_interface { public: - isa16_gus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - void set_irq(UINT8 source); - void reset_irq(UINT8 source); - void set_midi_irq(UINT8 source); - void reset_midi_irq(UINT8 source); + isa16_gus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void set_irq(uint8_t source); + void reset_irq(uint8_t source); + void set_midi_irq(uint8_t source); + void reset_midi_irq(uint8_t source); DECLARE_READ8_MEMBER(board_r); DECLARE_READ8_MEMBER(synth_r); @@ -295,8 +295,8 @@ public: DECLARE_WRITE_LINE_MEMBER(write_acia_clock); // DMA overrides - virtual UINT8 dack_r(int line) override; - virtual void dack_w(int line,UINT8 data) override; + virtual uint8_t dack_r(int line) override; + virtual void dack_w(int line,uint8_t data) override; virtual void eop_w(int state) override; // optional information overrides @@ -312,7 +312,7 @@ protected: private: required_device m_gf1; - UINT8 m_irq_status; + uint8_t m_irq_status; attotime m_joy_time; }; diff --git a/src/devices/bus/isa/hdc.cpp b/src/devices/bus/isa/hdc.cpp index 5ab75da6644..50859730064 100644 --- a/src/devices/bus/isa/hdc.cpp +++ b/src/devices/bus/isa/hdc.cpp @@ -161,7 +161,7 @@ const device_type XT_HDC = &device_creator; const device_type EC1841_HDC = &device_creator; const device_type ST11M_HDC = &device_creator; -xt_hdc_device::xt_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +xt_hdc_device::xt_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, XT_HDC, "Generic PC-XT Fixed Disk Controller", tag, owner, clock, "xt_hdc", __FILE__), buffer_ptr(nullptr), csb(0), status(0), error(0), m_current_cmd(0), m_irq_handler(*this), m_drq_handler(*this), drv(0), timer(nullptr), data_cnt(0), hdc_control(0), hdcdma_src(nullptr), hdcdma_dst(nullptr), hdcdma_read(0), hdcdma_write(0), hdcdma_size(0) @@ -169,14 +169,14 @@ xt_hdc_device::xt_hdc_device(const machine_config &mconfig, const char *tag, dev m_type = STANDARD; } -xt_hdc_device::xt_hdc_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) : +xt_hdc_device::xt_hdc_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), buffer_ptr(nullptr), csb(0), status(0), error(0), m_type(0), m_current_cmd(0), m_irq_handler(*this), m_drq_handler(*this), drv(0), timer(nullptr), data_cnt(0), hdc_control(0), hdcdma_src(nullptr), hdcdma_dst(nullptr), hdcdma_read(0), hdcdma_write(0), hdcdma_size(0) { } -ec1841_device::ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ec1841_device::ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : xt_hdc_device(mconfig, EC1841_HDC, "EC1841 Fixed Disk Controller", tag, owner, clock, "ec1481", __FILE__), m_irq_handler(*this), m_drq_handler(*this) @@ -184,7 +184,7 @@ ec1841_device::ec1841_device(const machine_config &mconfig, const char *tag, dev m_type = EC1841; } -st11m_device::st11m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +st11m_device::st11m_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : xt_hdc_device(mconfig, EC1841_HDC, "Seagate ST11M Fixed Disk Controller", tag, owner, clock, "st11m", __FILE__), m_irq_handler(*this), m_drq_handler(*this) @@ -323,7 +323,7 @@ int xt_hdc_device::get_lbasector() int xt_hdc_device::dack_r() { - UINT8 result; + uint8_t result; hard_disk_info *info; hard_disk_file *file; @@ -368,7 +368,7 @@ int xt_hdc_device::dack_r() int xt_hdc_device::dack_rs() { - UINT8 result; + uint8_t result; logerror("%s dack_rs(%d %d)\n", machine().describe_context(), hdcdma_read, hdcdma_size); @@ -866,9 +866,9 @@ void xt_hdc_device::control_w(int data) -UINT8 xt_hdc_device::data_r() +uint8_t xt_hdc_device::data_r() { - UINT8 data = 0xff; + uint8_t data = 0xff; if(!(status & STA_COMMAND) && (m_current_cmd == CMD_READ || m_current_cmd == CMD_READLONG || m_current_cmd == CMD_READSBUFF)) { @@ -914,7 +914,7 @@ UINT8 xt_hdc_device::data_r() -UINT8 xt_hdc_device::status_r() +uint8_t xt_hdc_device::status_r() { return status; } @@ -972,21 +972,21 @@ ioport_constructor isa8_hdc_device::device_input_ports() const // isa8_hdc_device - constructor //------------------------------------------------- -isa8_hdc_device::isa8_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_hdc_device::isa8_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_HDC, "Fixed Disk Controller Card", tag, owner, clock, "hdc", __FILE__), device_isa8_card_interface(mconfig, *this), m_hdc(*this,"hdc"), dip(0) { } -isa8_hdc_device::isa8_hdc_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) : +isa8_hdc_device::isa8_hdc_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_isa8_card_interface(mconfig, *this), m_hdc(*this,"hdc"), dip(0) { } -isa8_hdc_ec1841_device::isa8_hdc_ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_hdc_ec1841_device::isa8_hdc_ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_hdc_device( mconfig, ISA8_HDC_EC1841, "EC1841 HDC", tag, owner, clock, "hdc_ec1841", __FILE__), m_hdc(*this,"hdc") { @@ -1023,7 +1023,7 @@ void isa8_hdc_device::device_reset() *************************************************************************/ READ8_MEMBER( isa8_hdc_device::pc_hdc_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch( offset ) { @@ -1054,7 +1054,7 @@ WRITE8_MEMBER( isa8_hdc_device::pc_hdc_w ) } -UINT8 isa8_hdc_device::dack_r(int line) +uint8_t isa8_hdc_device::dack_r(int line) { if (m_hdc->get_command() == CMD_READSBUFF) return m_hdc->dack_rs(); @@ -1062,7 +1062,7 @@ UINT8 isa8_hdc_device::dack_r(int line) return m_hdc->dack_r(); } -void isa8_hdc_device::dack_w(int line,UINT8 data) +void isa8_hdc_device::dack_w(int line,uint8_t data) { if (m_hdc->get_command() == CMD_WRITESBUFF) m_hdc->dack_ws(data); @@ -1085,7 +1085,7 @@ void isa8_hdc_device::dack_w(int line,UINT8 data) */ -UINT8 isa8_hdc_device::pc_hdc_dipswitch_r() +uint8_t isa8_hdc_device::pc_hdc_dipswitch_r() { m_hdc->set_ready(); if (LOG_HDC_STATUS) diff --git a/src/devices/bus/isa/hdc.h b/src/devices/bus/isa/hdc.h index 9c43fb50d4a..94b84606a6f 100644 --- a/src/devices/bus/isa/hdc.h +++ b/src/devices/bus/isa/hdc.h @@ -31,8 +31,8 @@ class xt_hdc_device : { public: // construction/destruction - xt_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - xt_hdc_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); + xt_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + xt_hdc_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_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); } @@ -47,10 +47,10 @@ public: void reset_w(int data); void select_w(int data); void control_w(int data); - UINT8 data_r(); - UINT8 status_r(); + uint8_t data_r(); + uint8_t status_r(); void set_ready(); - UINT8 get_command() { return buffer[0]; } + uint8_t get_command() { return buffer[0]; } bool install_rom() { return (m_type != EC1841); } protected: @@ -70,8 +70,8 @@ protected: void get_chsn(); int test_ready(); - std::vector buffer; /* data buffer */ - UINT8 *buffer_ptr; /* data pointer */ + std::vector buffer; /* data buffer */ + uint8_t *buffer_ptr; /* data pointer */ int csb; /* command status byte */ int status; /* drive status */ int error; /* error code */ @@ -82,7 +82,7 @@ protected: ST11M }; int m_type; - UINT8 m_current_cmd; + uint8_t m_current_cmd; devcb_write_line m_irq_handler; devcb_write_line m_drq_handler; @@ -104,11 +104,11 @@ private: emu_timer *timer; int data_cnt; /* data count */ - UINT8 hdc_control; + uint8_t hdc_control; - UINT8 hdcdma_data[512]; - UINT8 *hdcdma_src; - UINT8 *hdcdma_dst; + uint8_t hdcdma_data[512]; + uint8_t *hdcdma_src; + uint8_t *hdcdma_dst; int hdcdma_read; int hdcdma_write; int hdcdma_size; @@ -117,7 +117,7 @@ private: class ec1841_device : public xt_hdc_device { public: - ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: devcb_write_line m_irq_handler; devcb_write_line m_drq_handler; @@ -126,7 +126,7 @@ protected: class st11m_device : public xt_hdc_device { public: - st11m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + st11m_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: devcb_write_line m_irq_handler; @@ -145,8 +145,8 @@ class isa8_hdc_device : { public: // construction/destruction - isa8_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_hdc_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); + isa8_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_hdc_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); DECLARE_READ8_MEMBER(pc_hdc_r); DECLARE_WRITE8_MEMBER(pc_hdc_w); @@ -163,9 +163,9 @@ protected: virtual void device_start() override; virtual void device_reset() override; public: - virtual UINT8 dack_r(int line) override; - virtual void dack_w(int line,UINT8 data) override; - UINT8 pc_hdc_dipswitch_r(); + virtual uint8_t dack_r(int line) override; + virtual void dack_w(int line,uint8_t data) override; + uint8_t pc_hdc_dipswitch_r(); int dip; /* dip switches */ }; @@ -174,7 +174,7 @@ public: class isa8_hdc_ec1841_device : public isa8_hdc_device { public: - isa8_hdc_ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_hdc_ec1841_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; diff --git a/src/devices/bus/isa/ibm_mfc.cpp b/src/devices/bus/isa/ibm_mfc.cpp index 1163023a219..223af4ed0dd 100644 --- a/src/devices/bus/isa/ibm_mfc.cpp +++ b/src/devices/bus/isa/ibm_mfc.cpp @@ -313,7 +313,7 @@ MACHINE_CONFIG_END READ8_MEMBER( isa8_ibm_mfc_device::ibm_mfc_r ) { - UINT8 val; + uint8_t val; switch (offset) { @@ -447,7 +447,7 @@ const tiny_rom_entry *isa8_ibm_mfc_device::device_rom_region() const // isa8_ibm_mfc_device - constructor //------------------------------------------------- -isa8_ibm_mfc_device::isa8_ibm_mfc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_ibm_mfc_device::isa8_ibm_mfc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_IBM_MFC, "IBM PC Music Feature Card", tag, owner, clock, "ibm_mfc", __FILE__), device_isa8_card_interface(mconfig, *this), m_tcr(0), m_pc_ppi_c(0), m_z80_ppi_c(0), m_pc_irq_state(0), m_z80_irq_state(0), m_cpu(*this, "ibm_mfc"), diff --git a/src/devices/bus/isa/ibm_mfc.h b/src/devices/bus/isa/ibm_mfc.h index d3942365db1..192d14d5f3a 100644 --- a/src/devices/bus/isa/ibm_mfc.h +++ b/src/devices/bus/isa/ibm_mfc.h @@ -30,7 +30,7 @@ class isa8_ibm_mfc_device : public device_t, { public: // Construction/destruction - isa8_ibm_mfc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_ibm_mfc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( ppi0_i_a ); DECLARE_WRITE8_MEMBER( ppi0_o_b ); @@ -68,12 +68,12 @@ private: void update_pc_interrupts(void); void update_z80_interrupts(void); - UINT8 m_tcr; - UINT8 m_pc_ppi_c; - UINT8 m_z80_ppi_c; + uint8_t m_tcr; + uint8_t m_pc_ppi_c; + uint8_t m_z80_ppi_c; - UINT8 m_pc_irq_state; - UINT8 m_z80_irq_state; + uint8_t m_pc_irq_state; + uint8_t m_z80_irq_state; required_device m_cpu; required_device m_ym2151; diff --git a/src/devices/bus/isa/ide.cpp b/src/devices/bus/isa/ide.cpp index 6508aaa94cd..9d32d017496 100644 --- a/src/devices/bus/isa/ide.cpp +++ b/src/devices/bus/isa/ide.cpp @@ -99,7 +99,7 @@ ioport_constructor isa16_ide_device::device_input_ports() const // isa16_ide_device - constructor //------------------------------------------------- -isa16_ide_device::isa16_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +isa16_ide_device::isa16_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_IDE, "IDE Fixed Drive Adapter", tag, owner, clock, "isa_ide", __FILE__), device_isa16_card_interface( mconfig, *this ), m_is_primary(true), diff --git a/src/devices/bus/isa/ide.h b/src/devices/bus/isa/ide.h index 7a59e15da20..84088fd2783 100644 --- a/src/devices/bus/isa/ide.h +++ b/src/devices/bus/isa/ide.h @@ -20,7 +20,7 @@ class isa16_ide_device : public device_t, { public: // construction/destruction - isa16_ide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_ide_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; diff --git a/src/devices/bus/isa/isa.cpp b/src/devices/bus/isa/isa.cpp index 94f6b7bf9b9..86c6a4f9687 100644 --- a/src/devices/bus/isa/isa.cpp +++ b/src/devices/bus/isa/isa.cpp @@ -23,7 +23,7 @@ const device_type ISA8_SLOT = &device_creator; //------------------------------------------------- // isa8_slot_device - constructor //------------------------------------------------- -isa8_slot_device::isa8_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_slot_device::isa8_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_SLOT, "ISA8_SLOT", tag, owner, clock, "isa8_slot", __FILE__), device_slot_interface(mconfig, *this), m_owner(nullptr), @@ -31,7 +31,7 @@ isa8_slot_device::isa8_slot_device(const machine_config &mconfig, const char *ta { } -isa8_slot_device::isa8_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +isa8_slot_device::isa8_slot_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_slot_interface(mconfig, *this), m_owner(nullptr), m_isa_tag(nullptr) { @@ -73,7 +73,7 @@ const device_type ISA16_SLOT = &device_creator; //------------------------------------------------- // isa16_slot_device - constructor //------------------------------------------------- -isa16_slot_device::isa16_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_slot_device::isa16_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_slot_device(mconfig, ISA16_SLOT, "ISA16_SLOT", tag, owner, clock, "isa16_slot", __FILE__) { } @@ -134,7 +134,7 @@ void isa8_device::device_config_complete() // isa8_device - constructor //------------------------------------------------- -isa8_device::isa8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_device::isa8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8, "ISA8", tag, owner, clock, "isa8", __FILE__), device_memory_interface(mconfig, *this), m_program_config("ISA 8-bit program", ENDIANNESS_LITTLE, 8, 24, 0, nullptr), @@ -162,7 +162,7 @@ isa8_device::isa8_device(const machine_config &mconfig, const char *tag, device_ m_allocspaces = false; } -isa8_device::isa8_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) : +isa8_device::isa8_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_memory_interface(mconfig, *this), m_program_config("ISA 8-bit program", ENDIANNESS_LITTLE, 8, 24, 0, nullptr), @@ -210,7 +210,7 @@ WRITE8_MEMBER(isa8_device::io_w) m_iospace->write_byte(offset, data); } -void isa8_device::set_dma_channel(UINT8 channel, device_isa8_card_interface *dev, bool do_eop) +void isa8_device::set_dma_channel(uint8_t channel, device_isa8_card_interface *dev, bool do_eop) { m_dma_device[channel] = dev; m_dma_eop[channel] = do_eop; @@ -319,7 +319,7 @@ void isa8_device::install_device(offs_t start, offs_t end, read8_delegate rhandl } -void isa8_device::install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data) +void isa8_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data) { m_prgspace->install_readwrite_bank(start, end, 0, tag ); machine().root_device().membank(m_prgspace->device().siblingtag(tag).c_str())->set_base(data); @@ -333,8 +333,8 @@ void isa8_device::unmap_bank(offs_t start, offs_t end) void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, const char *tag, const char *region) { if (machine().root_device().memregion("isa")) { - UINT8 *src = dev->memregion(region)->base(); - UINT8 *dest = machine().root_device().memregion("isa")->base() + start - 0xc0000; + uint8_t *src = dev->memregion(region)->base(); + uint8_t *dest = machine().root_device().memregion("isa")->base() + start - 0xc0000; memcpy(dest,src, end - start + 1); } else { m_prgspace->install_read_bank(start, end, 0, tag); @@ -369,14 +369,14 @@ WRITE_LINE_MEMBER( isa8_device::drq1_w ) { m_out_drq1_cb(state); } WRITE_LINE_MEMBER( isa8_device::drq2_w ) { m_out_drq2_cb(state); } WRITE_LINE_MEMBER( isa8_device::drq3_w ) { m_out_drq3_cb(state); } -UINT8 isa8_device::dack_r(int line) +uint8_t isa8_device::dack_r(int line) { if (m_dma_device[line]) return m_dma_device[line]->dack_r(line); return 0xff; } -void isa8_device::dack_w(int line,UINT8 data) +void isa8_device::dack_w(int line,uint8_t data) { if (m_dma_device[line]) return m_dma_device[line]->dack_w(line,data); @@ -432,11 +432,11 @@ device_isa8_card_interface::~device_isa8_card_interface() { } -UINT8 device_isa8_card_interface::dack_r(int line) +uint8_t device_isa8_card_interface::dack_r(int line) { return 0; } -void device_isa8_card_interface::dack_w(int line,UINT8 data) +void device_isa8_card_interface::dack_w(int line,uint8_t data) { } void device_isa8_card_interface::eop_w(int state) @@ -461,7 +461,7 @@ const device_type ISA16 = &device_creator; // isa16_device - constructor //------------------------------------------------- -isa16_device::isa16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_device::isa16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_device(mconfig, ISA16, "ISA16", tag, owner, clock, "isa16", __FILE__), m_out_irq10_cb(*this), m_out_irq11_cb(*this), @@ -556,7 +556,7 @@ WRITE16_MEMBER(isa16_device::io16_w) READ16_MEMBER(isa16_device::prog16_swap_r) { - UINT16 rv; + uint16_t rv; mem_mask = (mem_mask<<8) | (mem_mask>>8); rv = m_prgspace->read_word(offset<<1, mem_mask); @@ -573,7 +573,7 @@ WRITE16_MEMBER(isa16_device::prog16_swap_w) READ16_MEMBER(isa16_device::io16_swap_r) { - UINT16 rv; + uint16_t rv; mem_mask = (mem_mask<<8) | (mem_mask>>8); rv = m_iospace->read_word(offset<<1, mem_mask); @@ -601,14 +601,14 @@ WRITE_LINE_MEMBER( isa16_device::drq5_w ) { m_out_drq5_cb(state); } WRITE_LINE_MEMBER( isa16_device::drq6_w ) { m_out_drq6_cb(state); } WRITE_LINE_MEMBER( isa16_device::drq7_w ) { m_out_drq7_cb(state); } -UINT16 isa16_device::dack16_r(int line) +uint16_t isa16_device::dack16_r(int line) { if (m_dma_device[line]) return dynamic_cast(m_dma_device[line])->dack16_r(line); return 0xffff; } -void isa16_device::dack16_w(int line,UINT16 data) +void isa16_device::dack16_w(int line,uint16_t data) { if (m_dma_device[line]) return dynamic_cast(m_dma_device[line])->dack16_w(line,data); @@ -637,11 +637,11 @@ void device_isa16_card_interface::set_isa_device() m_isa = dynamic_cast(m_isa_dev); } -UINT16 device_isa16_card_interface::dack16_r(int line) +uint16_t device_isa16_card_interface::dack16_r(int line) { return 0; } -void device_isa16_card_interface::dack16_w(int line,UINT16 data) +void device_isa16_card_interface::dack16_w(int line,uint16_t data) { } diff --git a/src/devices/bus/isa/isa.h b/src/devices/bus/isa/isa.h index 3552b72dab0..cd389f4b365 100644 --- a/src/devices/bus/isa/isa.h +++ b/src/devices/bus/isa/isa.h @@ -162,8 +162,8 @@ class isa8_slot_device : public device_t, { public: // construction/destruction - isa8_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + isa8_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_slot_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-level overrides virtual void device_start() override; @@ -186,8 +186,8 @@ class isa8_device : public device_t, { public: // construction/destruction - isa8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_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); + isa8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_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); // inline configuration static void static_set_cputag(device_t &device, const char *tag); static void static_set_custom_spaces(device_t &device); @@ -216,11 +216,11 @@ public: } void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler); - template void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(class address_map &map, device_t &device), int bits = 8, UINT64 unitmask = U64(0xffffffffffffffff)) + template void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(class address_map &map, device_t &device), int bits = 8, uint64_t unitmask = U64(0xffffffffffffffff)) { m_iospace->install_device(addrstart, addrend, device, map, bits, unitmask); } - void install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data); + void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data); void install_rom(device_t *dev, offs_t start, offs_t end, const char *tag, const char *region); void install_memory(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler); @@ -245,14 +245,14 @@ public: DECLARE_READ8_MEMBER(io_r); DECLARE_WRITE8_MEMBER(io_w); - UINT8 dack_r(int line); - void dack_w(int line,UINT8 data); + uint8_t dack_r(int line); + void dack_w(int line,uint8_t data); void eop_w(int channels, int state); void nmi(); void set_nmi_state(bool enabled) { m_nmi_enabled = enabled; } - virtual void set_dma_channel(UINT8 channel, device_isa8_card_interface *dev, bool do_eop); + virtual void set_dma_channel(uint8_t channel, device_isa8_card_interface *dev, bool do_eop); const address_space_config m_program_config, m_io_config, m_program16_config, m_io16_config; @@ -310,8 +310,8 @@ public: void set_isa_device(); // configuration access - virtual UINT8 dack_r(int line); - virtual void dack_w(int line,UINT8 data); + virtual uint8_t dack_r(int line); + virtual void dack_w(int line,uint8_t data); virtual void eop_w(int state); // inline configuration @@ -328,7 +328,7 @@ class isa16_slot_device : public isa8_slot_device { public: // construction/destruction - isa16_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -345,7 +345,7 @@ class isa16_device : public isa8_device { public: // construction/destruction - isa16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_irq10_callback(device_t &device, _Object object) { return downcast(device).m_out_irq10_cb.set_callback(object); } template static devcb_base &set_out_irq11_callback(device_t &device, _Object object) { return downcast(device).m_out_irq11_cb.set_callback(object); } @@ -383,8 +383,8 @@ public: DECLARE_WRITE_LINE_MEMBER( drq6_w ); DECLARE_WRITE_LINE_MEMBER( drq7_w ); - UINT16 dack16_r(int line); - void dack16_w(int line,UINT16 data); + uint16_t dack16_r(int line); + void dack16_w(int line,uint16_t data); // 16 bit accessors for ISA-defined address spaces DECLARE_READ16_MEMBER(prog16_r); @@ -429,8 +429,8 @@ public: // construction/destruction device_isa16_card_interface(const machine_config &mconfig, device_t &device); virtual ~device_isa16_card_interface(); - virtual UINT16 dack16_r(int line); - virtual void dack16_w(int line,UINT16 data); + virtual uint16_t dack16_r(int line); + virtual void dack16_w(int line,uint16_t data); void set_isa_device(); isa16_device *m_isa; diff --git a/src/devices/bus/isa/lpt.cpp b/src/devices/bus/isa/lpt.cpp index e6d2cea232e..6d43df86307 100644 --- a/src/devices/bus/isa/lpt.cpp +++ b/src/devices/bus/isa/lpt.cpp @@ -12,7 +12,7 @@ const device_type ISA8_LPT = &device_creator; -isa8_lpt_device::isa8_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_lpt_device::isa8_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_LPT, "Printer Adapter", tag, owner, clock, "isa_lpt", __FILE__), device_isa8_card_interface(mconfig, *this), m_is_primary(false) diff --git a/src/devices/bus/isa/lpt.h b/src/devices/bus/isa/lpt.h index 6626198b430..c559c4df162 100644 --- a/src/devices/bus/isa/lpt.h +++ b/src/devices/bus/isa/lpt.h @@ -23,7 +23,7 @@ class isa8_lpt_device : public device_t, { public: // construction/destruction - isa8_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_lpt_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; diff --git a/src/devices/bus/isa/mach32.cpp b/src/devices/bus/isa/mach32.cpp index f041455a9ad..0ebcaac07ef 100644 --- a/src/devices/bus/isa/mach32.cpp +++ b/src/devices/bus/isa/mach32.cpp @@ -22,14 +22,14 @@ const device_type ATIMACH64_8514A = &device_creator; */ // 8514/A device -mach32_8514a_device::mach32_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mach32_8514a_device::mach32_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mach8_device(mconfig, ATIMACH32_8514A, "ATi mach32 (2D acceleration module)", tag, owner, clock, "mach32_8514a", __FILE__), m_chip_ID(0), m_membounds(0) { } -mach32_8514a_device::mach32_8514a_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) +mach32_8514a_device::mach32_8514a_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) : mach8_device(mconfig, type, name, tag, owner, clock, shortname, source), m_chip_ID(0), m_membounds(0) @@ -38,13 +38,13 @@ mach32_8514a_device::mach32_8514a_device(const machine_config &mconfig, device_t // SVGA device -mach32_device::mach32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mach32_device::mach32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ati_vga_device(mconfig, ATIMACH32, "ATi mach32", tag, owner, clock, "mach32", __FILE__), m_8514a(*this,"8514a") { } -mach32_device::mach32_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) +mach32_device::mach32_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) : ati_vga_device(mconfig, type, name, tag, owner, clock, shortname, source), m_8514a(*this,"8514a") { @@ -95,25 +95,25 @@ void mach32_device::device_reset() */ // 8514/A device -mach64_8514a_device::mach64_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mach64_8514a_device::mach64_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mach32_8514a_device(mconfig, ATIMACH64_8514A, "ATi mach64 (2D acceleration module)", tag, owner, clock, "mach64_8514a", __FILE__) { } -mach64_8514a_device::mach64_8514a_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) +mach64_8514a_device::mach64_8514a_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) : mach32_8514a_device(mconfig, type, name, tag, owner, clock, shortname, source) { } // SVGA device -mach64_device::mach64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mach64_device::mach64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mach32_device(mconfig, ATIMACH64, "ATi mach64", tag, owner, clock, "mach64", __FILE__), m_8514a(*this,"8514a") { } -mach64_device::mach64_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) +mach64_device::mach64_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) : mach32_device(mconfig, type, name, tag, owner, clock, shortname, source), m_8514a(*this,"8514a") { diff --git a/src/devices/bus/isa/mach32.h b/src/devices/bus/isa/mach32.h index 4f57f55faf9..cc3e2ebdf3a 100644 --- a/src/devices/bus/isa/mach32.h +++ b/src/devices/bus/isa/mach32.h @@ -18,8 +18,8 @@ class mach32_8514a_device : public mach8_device { public: // construction/destruction - mach32_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - mach32_8514a_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); + mach32_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mach32_8514a_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); DECLARE_READ16_MEMBER(mach32_chipid_r) { return m_chip_ID; } DECLARE_WRITE16_MEMBER(mach32_clksel_w) { mach8.clksel = data; } // read only on the mach8 @@ -31,8 +31,8 @@ protected: virtual void device_reset() override; virtual void device_config_complete() override; - UINT16 m_chip_ID; - UINT16 m_membounds; + uint16_t m_chip_ID; + uint16_t m_membounds; }; // main SVGA device @@ -40,8 +40,8 @@ class mach32_device : public ati_vga_device { public: // construction/destruction - mach32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - mach32_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); + mach32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mach32_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_8514a; // provides accelerated 2D drawing, derived from the Mach8 device @@ -137,8 +137,8 @@ class mach64_8514a_device : public mach32_8514a_device { public: // construction/destruction - mach64_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - mach64_8514a_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); + mach64_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mach64_8514a_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: virtual void device_start() override; @@ -151,8 +151,8 @@ class mach64_device : public mach32_device { public: // construction/destruction - mach64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - mach64_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); + mach64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mach64_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_8514a; // provides accelerated 2D drawing, derived from the Mach8 device diff --git a/src/devices/bus/isa/mc1502_fdc.cpp b/src/devices/bus/isa/mc1502_fdc.cpp index 73f8d5bd568..38217bb9978 100644 --- a/src/devices/bus/isa/mc1502_fdc.cpp +++ b/src/devices/bus/isa/mc1502_fdc.cpp @@ -85,16 +85,16 @@ TIMER_CALLBACK_MEMBER(mc1502_fdc_device::motor_callback) motor_on = 0; } -UINT8 mc1502_fdc_device::mc1502_wd17xx_aux_r() +uint8_t mc1502_fdc_device::mc1502_wd17xx_aux_r() { - UINT8 data; + uint8_t data; data = 0; return data; } -void mc1502_fdc_device::mc1502_wd17xx_aux_w(UINT8 data) +void mc1502_fdc_device::mc1502_wd17xx_aux_w(uint8_t data) { floppy_image_device *floppy0 = m_fdc->subdevice("0")->get_device(); floppy_image_device *floppy1 = m_fdc->subdevice("1")->get_device(); @@ -123,7 +123,7 @@ void mc1502_fdc_device::mc1502_wd17xx_aux_w(UINT8 data) /* * Accesses to this port block (halt the CPU until DRQ, INTRQ or MOTOR ON) */ -UINT8 mc1502_fdc_device::mc1502_wd17xx_drq_r() +uint8_t mc1502_fdc_device::mc1502_wd17xx_drq_r() { cpu_device *maincpu = machine().device("maincpu"); @@ -136,7 +136,7 @@ UINT8 mc1502_fdc_device::mc1502_wd17xx_drq_r() return m_fdc->drq_r(); } -UINT8 mc1502_fdc_device::mc1502_wd17xx_motor_r() +uint8_t mc1502_fdc_device::mc1502_wd17xx_motor_r() { return motor_on; } @@ -151,7 +151,7 @@ WRITE_LINE_MEMBER( mc1502_fdc_device::mc1502_fdc_irq_drq ) READ8_MEMBER( mc1502_fdc_device::mc1502_fdc_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch( offset ) { @@ -165,7 +165,7 @@ READ8_MEMBER( mc1502_fdc_device::mc1502_fdc_r ) READ8_MEMBER( mc1502_fdc_device::mc1502_fdcv2_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch( offset ) { @@ -189,7 +189,7 @@ WRITE8_MEMBER( mc1502_fdc_device::mc1502_fdc_w ) // mc1502_fdc_device - constructor //------------------------------------------------- -mc1502_fdc_device::mc1502_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mc1502_fdc_device::mc1502_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC1502_FDC, "MC-1502 floppy", tag, owner, clock, "mc1502_fdc", __FILE__), device_isa8_card_interface( mconfig, *this ), m_fdc(*this, "fdc"), motor_on(0), motor_timer(nullptr) diff --git a/src/devices/bus/isa/mc1502_fdc.h b/src/devices/bus/isa/mc1502_fdc.h index c01316ec1ef..af53b9c8984 100644 --- a/src/devices/bus/isa/mc1502_fdc.h +++ b/src/devices/bus/isa/mc1502_fdc.h @@ -26,7 +26,7 @@ class mc1502_fdc_device : public device_t, { public: // construction/destruction - mc1502_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc1502_fdc_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; @@ -50,10 +50,10 @@ private: emu_timer *motor_timer; public: - void mc1502_wd17xx_aux_w(UINT8 data); - UINT8 mc1502_wd17xx_aux_r(); - UINT8 mc1502_wd17xx_drq_r(); - UINT8 mc1502_wd17xx_motor_r(); + void mc1502_wd17xx_aux_w(uint8_t data); + uint8_t mc1502_wd17xx_aux_r(); + uint8_t mc1502_wd17xx_drq_r(); + uint8_t mc1502_wd17xx_motor_r(); }; diff --git a/src/devices/bus/isa/mc1502_rom.cpp b/src/devices/bus/isa/mc1502_rom.cpp index e61e2410a7e..877fa1bb389 100644 --- a/src/devices/bus/isa/mc1502_rom.cpp +++ b/src/devices/bus/isa/mc1502_rom.cpp @@ -44,7 +44,7 @@ const tiny_rom_entry *mc1502_rom_device::device_rom_region() const // mc1502_rom_device - constructor //------------------------------------------------- -mc1502_rom_device::mc1502_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mc1502_rom_device::mc1502_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC1502_ROM, "MC-1502 ROM cart", tag, owner, clock, "mc1502_rom", __FILE__), device_isa8_card_interface( mconfig, *this ) { diff --git a/src/devices/bus/isa/mc1502_rom.h b/src/devices/bus/isa/mc1502_rom.h index f55911d485f..e4b4a89c2f8 100644 --- a/src/devices/bus/isa/mc1502_rom.h +++ b/src/devices/bus/isa/mc1502_rom.h @@ -23,7 +23,7 @@ class mc1502_rom_device : public device_t, { public: // construction/destruction - mc1502_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc1502_rom_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; diff --git a/src/devices/bus/isa/mcd.cpp b/src/devices/bus/isa/mcd.cpp index d2cb19356e8..e525039e3fd 100644 --- a/src/devices/bus/isa/mcd.cpp +++ b/src/devices/bus/isa/mcd.cpp @@ -35,7 +35,7 @@ ioport_constructor mcd_isa_device::device_input_ports() const // mcd_isa_device - constructor //------------------------------------------------- -mcd_isa_device::mcd_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mcd_isa_device::mcd_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cdrom_image_device(mconfig, ISA16_MCD, "Mitsumi ISA CDROM Adapter", tag, owner, clock, "mcd_isa", __FILE__), device_isa16_card_interface( mconfig, *this ) { @@ -84,7 +84,7 @@ bool mcd_isa_device::read_sector(bool first) m_data = false; return false; } - UINT32 lba = msf_to_lba(m_readmsf); + uint32_t lba = msf_to_lba(m_readmsf); cdrom_read_data(m_cdrom_handle, lba - 150, m_buf, m_mode & 0x40 ? CD_TRACK_MODE1_RAW : CD_TRACK_MODE1); if(m_mode & 0x40) { @@ -106,7 +106,7 @@ bool mcd_isa_device::read_sector(bool first) READ8_MEMBER(mcd_isa_device::flag_r) { - UINT8 ret = 0; + uint8_t ret = 0; m_isa->irq5_w(CLEAR_LINE); if(!m_buf_count || !m_data || m_dma) // if dma enabled the cpu will never not see that flag as it will be halted ret |= FLAG_NODATA; @@ -124,7 +124,7 @@ READ8_MEMBER(mcd_isa_device::data_r) } else if(m_buf_count) { - UINT8 ret = m_buf_idx < 2352 ? m_buf[m_buf_idx++] : 0; + uint8_t ret = m_buf_idx < 2352 ? m_buf[m_buf_idx++] : 0; m_buf_count--; if(!m_buf_count) read_sector(); @@ -133,11 +133,11 @@ READ8_MEMBER(mcd_isa_device::data_r) return m_stat; } -UINT16 mcd_isa_device::dack16_r(int line) +uint16_t mcd_isa_device::dack16_r(int line) { if(m_buf_count & ~1) { - UINT16 ret = 0; + uint16_t ret = 0; if(m_buf_idx < 2351) { ret = m_buf[m_buf_idx++]; @@ -246,7 +246,7 @@ WRITE8_MEMBER(mcd_isa_device::cmd_w) case CMD_GET_INFO: if(m_cdrom_handle) { - UINT32 first = lba_to_msf(150), last = lba_to_msf(cdrom_get_track_start(m_cdrom_handle, 0xaa)); + uint32_t first = lba_to_msf(150), last = lba_to_msf(cdrom_get_track_start(m_cdrom_handle, 0xaa)); m_cmdbuf[1] = 1; m_cmdbuf[2] = dec_2_bcd(cdrom_get_last_track(m_cdrom_handle)); m_cmdbuf[3] = dec_2_bcd((last >> 16) & 0xff); @@ -269,8 +269,8 @@ WRITE8_MEMBER(mcd_isa_device::cmd_w) if(m_cdrom_handle) { int tracks = cdrom_get_last_track(m_cdrom_handle); - UINT32 start = lba_to_msf(cdrom_get_track_start(m_cdrom_handle, m_curtoctrk)); - UINT32 end = lba_to_msf(cdrom_get_track_start(m_cdrom_handle, m_curtoctrk < tracks ? m_curtoctrk + 1 : 0xaa)); + uint32_t start = lba_to_msf(cdrom_get_track_start(m_cdrom_handle, m_curtoctrk)); + uint32_t end = lba_to_msf(cdrom_get_track_start(m_cdrom_handle, m_curtoctrk < tracks ? m_curtoctrk + 1 : 0xaa)); m_cmdbuf[1] = (cdrom_get_adr_control(m_cdrom_handle, m_curtoctrk) << 4) & 0xf0; m_cmdbuf[2] = 0; // track num except when reading toc m_cmdbuf[3] = dec_2_bcd(m_curtoctrk); // index diff --git a/src/devices/bus/isa/mcd.h b/src/devices/bus/isa/mcd.h index 3d8d529ce35..127721b3065 100644 --- a/src/devices/bus/isa/mcd.h +++ b/src/devices/bus/isa/mcd.h @@ -20,7 +20,7 @@ class mcd_isa_device : public cdrom_image_device, { public: // construction/destruction - mcd_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mcd_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -31,7 +31,7 @@ public: DECLARE_READ8_MEMBER(flag_r); DECLARE_WRITE8_MEMBER(cmd_w); DECLARE_WRITE8_MEMBER(reset_w); - virtual UINT16 dack16_r(int line) override; + virtual uint16_t dack16_r(int line) override; protected: // device-level overrides virtual void device_start() override; @@ -42,22 +42,22 @@ private: bool m_change; bool m_newstat; bool m_data; - UINT8 m_stat; - UINT8 m_buf[2352]; + uint8_t m_stat; + uint8_t m_buf[2352]; int m_buf_count; int m_buf_idx; - UINT8 m_cmdbuf[16]; + uint8_t m_cmdbuf[16]; int m_cmdbuf_count; int m_cmdrd_count; int m_cmdbuf_idx; - UINT8 m_mode; - UINT8 m_cmd; - UINT8 m_conf; - UINT8 m_irq; - UINT8 m_dma; - UINT16 m_dmalen; - UINT32 m_readmsf; - UINT32 m_readcount; + uint8_t m_mode; + uint8_t m_cmd; + uint8_t m_conf; + uint8_t m_irq; + uint8_t m_dma; + uint16_t m_dmalen; + uint32_t m_readmsf; + uint32_t m_readcount; bool m_locked; int m_drvmode; int m_curtoctrk; diff --git a/src/devices/bus/isa/mda.cpp b/src/devices/bus/isa/mda.cpp index aece6b1f740..764cb361aeb 100644 --- a/src/devices/bus/isa/mda.cpp +++ b/src/devices/bus/isa/mda.cpp @@ -150,7 +150,7 @@ const tiny_rom_entry *isa8_mda_device::device_rom_region() const // isa8_mda_device - constructor //------------------------------------------------- -isa8_mda_device::isa8_mda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_mda_device::isa8_mda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_MDA, "IBM Monochrome Display and Printer Adapter", tag, owner, clock, "isa_ibm_mda", __FILE__), device_isa8_card_interface(mconfig, *this), m_framecnt(0), m_mode_control(0), m_update_row_type(-1), m_chr_gen(nullptr), m_vsync(0), m_hsync(0), m_pixel(0), @@ -158,7 +158,7 @@ isa8_mda_device::isa8_mda_device(const machine_config &mconfig, const char *tag, { } -isa8_mda_device::isa8_mda_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) : +isa8_mda_device::isa8_mda_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_isa8_card_interface(mconfig, *this), m_framecnt(0), m_mode_control(0), m_update_row_type(-1), m_chr_gen(nullptr), m_vsync(0), m_hsync(0), m_pixel(0), @@ -222,19 +222,19 @@ void isa8_mda_device::device_reset() MC6845_UPDATE_ROW( isa8_mda_device::mda_text_inten_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); - UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; + uint32_t *p = &bitmap.pix32(y); + uint16_t chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; int i; if ( y == 0 ) MDA_LOG(1,"mda_text_inten_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF; - UINT8 chr = m_videoram[ offset ]; - UINT8 attr = m_videoram[ offset + 1 ]; - UINT8 data = m_chr_gen[ chr_base + chr * 8 ]; - UINT8 fg = ( attr & 0x08 ) ? 3 : 2; - UINT8 bg = 0; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; + uint8_t chr = m_videoram[ offset ]; + uint8_t attr = m_videoram[ offset + 1 ]; + uint8_t data = m_chr_gen[ chr_base + chr * 8 ]; + uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint8_t bg = 0; if ( ( attr & ~0x88 ) == 0 ) { @@ -295,19 +295,19 @@ MC6845_UPDATE_ROW( isa8_mda_device::mda_text_inten_update_row ) MC6845_UPDATE_ROW( isa8_mda_device::mda_text_blink_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); - UINT16 chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; + uint32_t *p = &bitmap.pix32(y); + uint16_t chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; int i; if ( y == 0 ) MDA_LOG(1,"mda_text_blink_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF; - UINT8 chr = m_videoram[ offset ]; - UINT8 attr = m_videoram[ offset + 1 ]; - UINT8 data = m_chr_gen[ chr_base + chr * 8 ]; - UINT8 fg = ( attr & 0x08 ) ? 3 : 2; - UINT8 bg = 0; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; + uint8_t chr = m_videoram[ offset ]; + uint8_t attr = m_videoram[ offset + 1 ]; + uint8_t data = m_chr_gen[ chr_base + chr * 8 ]; + uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint8_t bg = 0; if ( ( attr & ~0x88 ) == 0 ) { @@ -587,7 +587,7 @@ const tiny_rom_entry *isa8_hercules_device::device_rom_region() const // isa8_hercules_device - constructor //------------------------------------------------- -isa8_hercules_device::isa8_hercules_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_hercules_device::isa8_hercules_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_mda_device(mconfig, ISA8_HERCULES, "Hercules Graphics Card", tag, owner, clock, "isa_hercules", __FILE__), m_configuration_switch(0) { } @@ -633,13 +633,13 @@ void isa8_hercules_device::device_reset() MC6845_UPDATE_ROW( isa8_hercules_device::hercules_gfx_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); - UINT16 gfx_base = ( ( m_mode_control & 0x80 ) ? 0x8000 : 0x0000 ) | ( ( ra & 0x03 ) << 13 ); + uint32_t *p = &bitmap.pix32(y); + uint16_t gfx_base = ( ( m_mode_control & 0x80 ) ? 0x8000 : 0x0000 ) | ( ( ra & 0x03 ) << 13 ); int i; if ( y == 0 ) MDA_LOG(1,"hercules_gfx_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT8 data = m_videoram[ gfx_base + ( ( ma + i ) << 1 ) ]; + uint8_t data = m_videoram[ gfx_base + ( ( ma + i ) << 1 ) ]; *p = palette[( data & 0x80 ) ? 2 : 0]; p++; *p = palette[( data & 0x40 ) ? 2 : 0]; p++; @@ -793,7 +793,7 @@ machine_config_constructor isa8_ec1840_0002_device::device_mconfig_additions() c // isa8_ec1840_0002_device - constructor //------------------------------------------------- -isa8_ec1840_0002_device::isa8_ec1840_0002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_ec1840_0002_device::isa8_ec1840_0002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_mda_device( mconfig, ISA8_EC1840_0002, "EC 1840.0002 (MDA)", tag, owner, clock, "ec1840_0002", __FILE__), m_soft_chr_gen(nullptr) { } @@ -806,7 +806,7 @@ void isa8_ec1840_0002_device::device_start() { isa8_mda_device::device_start(); - m_soft_chr_gen = std::make_unique(0x2000); + m_soft_chr_gen = std::make_unique(0x2000); m_isa->install_bank(0xdc000, 0xddfff, "bank_chargen", m_soft_chr_gen.get()); m_isa->install_bank(0xde000, 0xdffff, "bank_chargen", m_soft_chr_gen.get()); } @@ -827,19 +827,19 @@ void isa8_ec1840_0002_device::device_reset() MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_inten_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); - UINT16 chr_base = ra; + uint32_t *p = &bitmap.pix32(y); + uint16_t chr_base = ra; int i; if ( y == 0 ) MDA_LOG(1,"mda_lowres_text_inten_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF; - UINT8 chr = m_videoram[ offset ]; - UINT8 attr = m_videoram[ offset + 1 ]; - UINT8 data = m_chr_gen[ (chr_base + chr * 16) << 1 ]; - UINT8 fg = ( attr & 0x08 ) ? 3 : 2; - UINT8 bg = 0; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; + uint8_t chr = m_videoram[ offset ]; + uint8_t attr = m_videoram[ offset + 1 ]; + uint8_t data = m_chr_gen[ (chr_base + chr * 16) << 1 ]; + uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint8_t bg = 0; if ( ( attr & ~0x88 ) == 0 ) { @@ -891,19 +891,19 @@ MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_inten_update_row ) MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_blink_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); - UINT16 chr_base = ra; + uint32_t *p = &bitmap.pix32(y); + uint16_t chr_base = ra; int i; if ( y == 0 ) MDA_LOG(1,"mda_lowres_text_blink_update_row",("\n")); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF; - UINT8 chr = m_videoram[ offset ]; - UINT8 attr = m_videoram[ offset + 1 ]; - UINT8 data = m_chr_gen[ (chr_base + chr * 16) << 1 ]; - UINT8 fg = ( attr & 0x08 ) ? 3 : 2; - UINT8 bg = 0; + uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; + uint8_t chr = m_videoram[ offset ]; + uint8_t attr = m_videoram[ offset + 1 ]; + uint8_t data = m_chr_gen[ (chr_base + chr * 16) << 1 ]; + uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint8_t bg = 0; if ( ( attr & ~0x88 ) == 0 ) { diff --git a/src/devices/bus/isa/mda.h b/src/devices/bus/isa/mda.h index fc761ead19b..0b214c8c496 100644 --- a/src/devices/bus/isa/mda.h +++ b/src/devices/bus/isa/mda.h @@ -22,8 +22,8 @@ public: friend class isa8_hercules_device; // construction/destruction - isa8_mda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_mda_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); + isa8_mda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_mda_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -49,14 +49,14 @@ protected: public: int m_framecnt; - UINT8 m_mode_control; + uint8_t m_mode_control; int m_update_row_type; - UINT8 *m_chr_gen; - UINT8 m_vsync; - UINT8 m_hsync; - std::vector m_videoram; - UINT8 m_pixel; + uint8_t *m_chr_gen; + uint8_t m_vsync; + uint8_t m_hsync; + std::vector m_videoram; + uint8_t m_pixel; required_device m_palette; }; @@ -71,7 +71,7 @@ class isa8_hercules_device : { public: // construction/destruction - isa8_hercules_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_hercules_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 const tiny_rom_entry *device_rom_region() const override; @@ -90,7 +90,7 @@ protected: virtual void device_reset() override; public: - UINT8 m_configuration_switch; //hercules + uint8_t m_configuration_switch; //hercules }; @@ -104,7 +104,7 @@ class isa8_ec1840_0002_device : { public: // construction/destruction - isa8_ec1840_0002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_ec1840_0002_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; @@ -120,7 +120,7 @@ protected: virtual void device_reset() override; public: - std::unique_ptr m_soft_chr_gen; + std::unique_ptr m_soft_chr_gen; }; diff --git a/src/devices/bus/isa/mpu401.cpp b/src/devices/bus/isa/mpu401.cpp index df78f73b5c2..bb80e14d7e1 100644 --- a/src/devices/bus/isa/mpu401.cpp +++ b/src/devices/bus/isa/mpu401.cpp @@ -66,7 +66,7 @@ machine_config_constructor isa8_mpu401_device::device_mconfig_additions() const // isa8_adlib_device - constructor //------------------------------------------------- -isa8_mpu401_device::isa8_mpu401_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +isa8_mpu401_device::isa8_mpu401_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_MPU401, "Roland MPU-401 MIDI Interface", tag, owner, clock, "isa_mpu401", __FILE__), device_isa8_card_interface( mconfig, *this ), m_mpu401(*this, MPU_CORE_TAG) diff --git a/src/devices/bus/isa/mpu401.h b/src/devices/bus/isa/mpu401.h index cdf70fe2acf..c5dca814718 100644 --- a/src/devices/bus/isa/mpu401.h +++ b/src/devices/bus/isa/mpu401.h @@ -21,7 +21,7 @@ class isa8_mpu401_device : { public: // construction/destruction - isa8_mpu401_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_mpu401_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_mpu401; diff --git a/src/devices/bus/isa/mufdc.cpp b/src/devices/bus/isa/mufdc.cpp index 49425585e62..e85ced13377 100644 --- a/src/devices/bus/isa/mufdc.cpp +++ b/src/devices/bus/isa/mufdc.cpp @@ -129,7 +129,7 @@ const tiny_rom_entry *fdcmag_device::device_rom_region() const // mufdc_device - constructor //------------------------------------------------- -mufdc_device::mufdc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname) : +mufdc_device::mufdc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), device_isa8_card_interface( mconfig, *this ), m_fdc(*this, "fdc"), @@ -137,12 +137,12 @@ mufdc_device::mufdc_device(const machine_config &mconfig, device_type type, cons { } -fdc344_device::fdc344_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +fdc344_device::fdc344_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mufdc_device(mconfig, ISA8_FDC344, tag, owner, clock, "Ably-Tech FDC-344", "fdc344") { } -fdcmag_device::fdcmag_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +fdcmag_device::fdcmag_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mufdc_device(mconfig, ISA8_FDCMAG, tag, owner, clock, "Magitronic Multi Floppy Controller Card", "fdcmag") { } @@ -187,12 +187,12 @@ WRITE_LINE_MEMBER( mufdc_device::fdc_drq_w ) m_isa->drq2_w(state ? ASSERT_LINE : CLEAR_LINE); } -UINT8 mufdc_device::dack_r(int line) +uint8_t mufdc_device::dack_r(int line) { return m_fdc->dma_r(); } -void mufdc_device::dack_w(int line, UINT8 data) +void mufdc_device::dack_w(int line, uint8_t data) { return m_fdc->dma_w(data); } diff --git a/src/devices/bus/isa/mufdc.h b/src/devices/bus/isa/mufdc.h index abfd8965c94..bd5040a3841 100644 --- a/src/devices/bus/isa/mufdc.h +++ b/src/devices/bus/isa/mufdc.h @@ -36,7 +36,7 @@ class mufdc_device : public device_t, { public: // construction/destruction - mufdc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname); + mufdc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -54,8 +54,8 @@ protected: virtual void device_reset() override; // device_isa8_card_interface - virtual UINT8 dack_r(int line) override; - virtual void dack_w(int line, UINT8 data) override; + virtual uint8_t dack_r(int line) override; + virtual void dack_w(int line, uint8_t data) override; virtual void eop_w(int state) override; private: @@ -67,7 +67,7 @@ class fdc344_device : public mufdc_device { public: // construction/destruction - fdc344_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fdc344_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; @@ -79,7 +79,7 @@ class fdcmag_device : public mufdc_device { public: // construction/destruction - fdcmag_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fdcmag_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/isa/ne1000.cpp b/src/devices/bus/isa/ne1000.cpp index 24b37985225..ed4b46df88e 100644 --- a/src/devices/bus/isa/ne1000.cpp +++ b/src/devices/bus/isa/ne1000.cpp @@ -16,7 +16,7 @@ machine_config_constructor ne1000_device::device_mconfig_additions() const { return MACHINE_CONFIG_NAME(ne1000_config); } -ne1000_device::ne1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ne1000_device::ne1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NE1000, "NE1000 Network Adapter", tag, owner, clock, "ne1000", __FILE__), device_isa8_card_interface(mconfig, *this), m_dp8390(*this, "dp8390d"), @@ -26,7 +26,7 @@ ne1000_device::ne1000_device(const machine_config &mconfig, const char *tag, dev void ne1000_device::device_start() { char mac[7]; - UINT32 num = rand(); + uint32_t num = rand(); memset(m_prom, 0x57, 16); sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); mac[0] = 0; mac[1] = 0; // avoid gcc warning diff --git a/src/devices/bus/isa/ne1000.h b/src/devices/bus/isa/ne1000.h index 96f98673477..8a609cac4ac 100644 --- a/src/devices/bus/isa/ne1000.h +++ b/src/devices/bus/isa/ne1000.h @@ -13,7 +13,7 @@ class ne1000_device: public device_t, public device_isa8_card_interface { public: - ne1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ne1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual ioport_constructor device_input_ports() const override; @@ -27,9 +27,9 @@ protected: virtual void device_reset() override; private: required_device m_dp8390; - UINT8 m_irq; - UINT8 m_board_ram[8*1024]; - UINT8 m_prom[16]; + uint8_t m_irq; + uint8_t m_board_ram[8*1024]; + uint8_t m_prom[16]; }; extern const device_type NE1000; diff --git a/src/devices/bus/isa/ne2000.cpp b/src/devices/bus/isa/ne2000.cpp index 347ab280d7d..8a6e44b8ced 100644 --- a/src/devices/bus/isa/ne2000.cpp +++ b/src/devices/bus/isa/ne2000.cpp @@ -17,7 +17,7 @@ machine_config_constructor ne2000_device::device_mconfig_additions() const { return MACHINE_CONFIG_NAME(ne2000_config); } -ne2000_device::ne2000_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) +ne2000_device::ne2000_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : device_t(mconfig, NE2000, "NE2000 Network Adapter", tag, owner, clock, "ne2000", __FILE__), device_isa16_card_interface(mconfig, *this), m_dp8390(*this, "dp8390d"), @@ -27,7 +27,7 @@ ne2000_device::ne2000_device(const machine_config& mconfig, const char* tag, dev void ne2000_device::device_start() { char mac[7]; - UINT32 num = rand(); + uint32_t num = rand(); memset(m_prom, 0x57, 16); sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); mac[0] = 0; mac[1] = 0; // avoid gcc warning diff --git a/src/devices/bus/isa/ne2000.h b/src/devices/bus/isa/ne2000.h index ac7d56772a7..f0fbe2057bf 100644 --- a/src/devices/bus/isa/ne2000.h +++ b/src/devices/bus/isa/ne2000.h @@ -11,7 +11,7 @@ class ne2000_device: public device_t, public device_isa16_card_interface { public: - ne2000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ne2000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual ioport_constructor device_input_ports() const override; @@ -25,9 +25,9 @@ protected: virtual void device_reset() override; private: required_device m_dp8390; - UINT8 m_irq; - UINT8 m_board_ram[16*1024]; - UINT8 m_prom[16]; + uint8_t m_irq; + uint8_t m_board_ram[16*1024]; + uint8_t m_prom[16]; }; extern const device_type NE2000; diff --git a/src/devices/bus/isa/num9rev.cpp b/src/devices/bus/isa/num9rev.cpp index b37db708490..69a4641206b 100644 --- a/src/devices/bus/isa/num9rev.cpp +++ b/src/devices/bus/isa/num9rev.cpp @@ -22,12 +22,12 @@ UPD7220_DISPLAY_PIXELS_MEMBER( isa8_number_9_rev_device::hgdc_display_pixels ) if(!m_1024) { rgb_t color(0); - UINT16 overlay; + uint16_t overlay; if(((address << 3) + 0xc0016) > (1024*1024)) return; for(int i = 0; i < 16; i++) { - UINT32 addr = (address << 3) + i; + uint32_t addr = (address << 3) + i; overlay = m_ram[addr + 0xc0000] << 1; overlay = m_overlay[overlay + ((m_mode & 8) ? 512 : 0)] | (m_overlay[overlay + 1 + ((m_mode & 8) ? 512 : 0)] << 8); color.set_r(pal->entry_color(m_ram[addr] | ((overlay & 0xf) << 8)).r()); @@ -77,7 +77,7 @@ machine_config_constructor isa8_number_9_rev_device::device_mconfig_additions() // isa16_vga_device - constructor //------------------------------------------------- -isa8_number_9_rev_device::isa8_number_9_rev_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_number_9_rev_device::isa8_number_9_rev_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_NUM_9_REV, "Number Nine Revolution 512x32/1024x8", tag, owner, clock, "number_9_rev", __FILE__), device_isa8_card_interface(mconfig, *this), m_upd7220(*this, "upd7220"), @@ -121,7 +121,7 @@ READ8_MEMBER(isa8_number_9_rev_device::read8) return m_ram[offset + ((m_mode & 0xc) << 14)]; else if((m_mode & 4) && !m_1024) { - UINT32 newoff = ((offset & 3) << 18) | (m_bank << 14) | ((offset >> 2) & 0x3fff); + uint32_t newoff = ((offset & 3) << 18) | (m_bank << 14) | ((offset >> 2) & 0x3fff); return m_ram[newoff]; } else @@ -134,7 +134,7 @@ WRITE8_MEMBER(isa8_number_9_rev_device::write8) m_ram[offset + (m_bank << 16)] = data; else if((m_mode & 1) || ((m_mode & 6) == 2)) { - UINT8 bank = m_bank; + uint8_t bank = m_bank; if(m_mode & 1) bank = (m_mode & 0xc) >> 2; else @@ -153,7 +153,7 @@ WRITE8_MEMBER(isa8_number_9_rev_device::write8) } else if(m_mode & 4) { - UINT32 newoff = ((offset & 3) << 18) | (m_bank << 14) | ((offset >> 2) & 0x3fff); + uint32_t newoff = ((offset & 3) << 18) | (m_bank << 14) | ((offset >> 2) & 0x3fff); if((newoff >= 0xc0000) && ((m_mode & 6) == 6)) return; m_ram[newoff] = data; @@ -198,7 +198,7 @@ WRITE8_MEMBER(isa8_number_9_rev_device::pal8_w) READ8_MEMBER(isa8_number_9_rev_device::pal12_r) { - UINT16 color = offset & 0xfff; + uint16_t color = offset & 0xfff; palette_t *pal = m_palette->palette(); switch(offset & 0xf000) { @@ -214,7 +214,7 @@ READ8_MEMBER(isa8_number_9_rev_device::pal12_r) WRITE8_MEMBER(isa8_number_9_rev_device::pal12_w) { - UINT16 color = offset & 0xfff; + uint16_t color = offset & 0xfff; palette_t *pal = m_palette->palette(); rgb_t pen = pal->entry_color(color); switch(offset & 0xf000) @@ -310,7 +310,7 @@ WRITE8_MEMBER(isa8_number_9_rev_device::ctrl_w) } } -UINT32 isa8_number_9_rev_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t isa8_number_9_rev_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { rectangle visarea = screen.visible_area(); // try to support the 1024x8 or at least don't crash as there's no way to detect it diff --git a/src/devices/bus/isa/num9rev.h b/src/devices/bus/isa/num9rev.h index 4fe64e19019..51f8efbd8f0 100644 --- a/src/devices/bus/isa/num9rev.h +++ b/src/devices/bus/isa/num9rev.h @@ -22,7 +22,7 @@ class isa8_number_9_rev_device : { public: // construction/destruction - isa8_number_9_rev_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_number_9_rev_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; @@ -41,7 +41,7 @@ public: DECLARE_READ8_MEMBER(read8); DECLARE_WRITE8_MEMBER(write8); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -49,11 +49,11 @@ protected: private: required_device m_upd7220; required_device m_palette; - std::vector m_ram; - std::vector m_overlay; + std::vector m_ram; + std::vector m_overlay; - UINT8 m_bank; - UINT8 m_mode; + uint8_t m_bank; + uint8_t m_mode; bool m_1024; }; diff --git a/src/devices/bus/isa/omti8621.cpp b/src/devices/bus/isa/omti8621.cpp index fdcfb956146..7b334a24f4c 100644 --- a/src/devices/bus/isa/omti8621.cpp +++ b/src/devices/bus/isa/omti8621.cpp @@ -51,7 +51,7 @@ class omti_disk_image_device : public device_t, { public: // construction/destruction - omti_disk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + omti_disk_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; } @@ -70,26 +70,26 @@ protected: virtual void device_start() override; virtual void device_reset() override; - void omti_disk_config(UINT16 disk_type); + void omti_disk_config(uint16_t disk_type); private: template void logerror(Format &&fmt, Params &&... args) const; public: - UINT16 m_type; - UINT16 m_cylinders; - UINT16 m_heads; - UINT16 m_sectors; - UINT32 m_sectorbytes; - UINT32 m_sector_count; + uint16_t m_type; + uint16_t m_cylinders; + uint16_t m_heads; + uint16_t m_sectors; + uint32_t m_sectorbytes; + uint32_t m_sector_count; device_image_interface *m_image; // configuration data - UINT8 m_config_data[10]; + uint8_t m_config_data[10]; // ESDI defect list data - UINT8 m_esdi_defect_list[256]; + uint8_t m_esdi_defect_list[256]; }; /* @@ -375,19 +375,19 @@ void omti8621_device::device_reset() const device_type ISA16_OMTI8621 = &device_creator; -omti8621_pc_device::omti8621_pc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +omti8621_pc_device::omti8621_pc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : omti8621_device(mconfig, ISA16_OMTI8621, tag, owner, clock) { } const device_type ISA16_OMTI8621_APOLLO = &device_creator; -omti8621_apollo_device::omti8621_apollo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +omti8621_apollo_device::omti8621_apollo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : omti8621_device(mconfig, ISA16_OMTI8621_APOLLO, tag, owner, clock) { } -omti8621_device::omti8621_device(const machine_config &mconfig, device_type type,const char *tag, device_t *owner, UINT32 clock) +omti8621_device::omti8621_device(const machine_config &mconfig, device_type type,const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, "OMTI 8621 ESDI/floppy controller", tag, owner, clock, "omti8621", __FILE__), device_isa16_card_interface(mconfig, *this), m_fdc(*this, OMTI_FDC_TAG), @@ -435,7 +435,7 @@ void omti8621_device::clear_sense_data() { set_sense_data - set the sense data from code and command descriptor block ***************************************************************************/ -void omti8621_device::set_sense_data(UINT8 code, const UINT8 * cdb) { +void omti8621_device::set_sense_data(uint8_t code, const uint8_t * cdb) { LOG2(("set_sense_data code=%x", code)); sense_data[0]=code; sense_data[1]=cdb[1]; @@ -447,7 +447,7 @@ void omti8621_device::set_sense_data(UINT8 code, const UINT8 * cdb) { set_configuration_data - set the configuration data for drive lun ***************************************************************************/ -void omti8621_device::set_configuration_data(UINT8 lun) { +void omti8621_device::set_configuration_data(uint8_t lun) { LOG2(("set_configuration_data lun=%x", lun)); // initialize the configuration data @@ -469,7 +469,7 @@ void omti8621_device::set_configuration_data(UINT8 lun) { get_lun - get logical unit number from a command descriptor block (in bit 5) ***************************************************************************/ -UINT8 omti8621_device::get_lun(const UINT8 * cdb) +uint8_t omti8621_device::get_lun(const uint8_t * cdb) { return (cdb[1] & 0x20) >> 5; } @@ -478,18 +478,18 @@ UINT8 omti8621_device::get_lun(const UINT8 * cdb) check_disk_address - check disk address, set sense data and return true for no error ***************************************************************************/ -UINT8 omti8621_device::check_disk_address(const UINT8 *cdb) +uint8_t omti8621_device::check_disk_address(const uint8_t *cdb) { - UINT8 sense_code = OMTI_SENSE_CODE_NO_ERROR; - UINT8 lun = get_lun(cdb); - UINT16 head = cdb[1] & 0x1f; - UINT16 sector = cdb[2] & 0x3f; - UINT32 cylinder = cdb[3] + ((cdb[2] & 0xc0) << 2) + ((cdb[1] & 0x80) << 3); - UINT8 block_count = cdb[4]; + uint8_t sense_code = OMTI_SENSE_CODE_NO_ERROR; + uint8_t lun = get_lun(cdb); + uint16_t head = cdb[1] & 0x1f; + uint16_t sector = cdb[2] & 0x3f; + uint32_t cylinder = cdb[3] + ((cdb[2] & 0xc0) << 2) + ((cdb[1] & 0x80) << 3); + uint8_t block_count = cdb[4]; omti_disk_image_device *disk = our_disks[lun]; - UINT32 disk_track = cylinder * disk->m_heads + head; - UINT32 disk_addr = (disk_track * disk->m_sectors) + sector; + uint32_t disk_track = cylinder * disk->m_heads + head; + uint32_t disk_addr = (disk_track * disk->m_sectors) + sector; if (block_count > OMTI_MAX_BLOCK_COUNT) { LOG(("########### check_disk_address: unexpected block count %x", block_count)); @@ -527,10 +527,10 @@ UINT8 omti8621_device::check_disk_address(const UINT8 *cdb) get_disk_track - get disk track from a command descriptor block ***************************************************************************/ -UINT32 omti8621_device::get_disk_track(const UINT8 * cdb) { - UINT8 lun = get_lun(cdb); - UINT16 head = cdb[1] & 0x1f; - UINT32 cylinder = cdb[3] + ((cdb[2] & 0xc0) << 2) + ((cdb[1] & 0x80) << 3); +uint32_t omti8621_device::get_disk_track(const uint8_t * cdb) { + uint8_t lun = get_lun(cdb); + uint16_t head = cdb[1] & 0x1f; + uint32_t cylinder = cdb[3] + ((cdb[2] & 0xc0) << 2) + ((cdb[1] & 0x80) << 3); return cylinder * our_disks[lun]->m_heads + head; } @@ -538,9 +538,9 @@ UINT32 omti8621_device::get_disk_track(const UINT8 * cdb) { get_disk_address - get disk address from a command descriptor block ***************************************************************************/ -UINT32 omti8621_device::get_disk_address(const UINT8 * cdb) { - UINT8 lun = get_lun(cdb); - UINT16 sector = cdb[2] & 0x3f; +uint32_t omti8621_device::get_disk_address(const uint8_t * cdb) { + uint8_t lun = get_lun(cdb); + uint16_t sector = cdb[2] & 0x3f; return get_disk_track(cdb) * our_disks[lun]->m_sectors + sector; } @@ -548,7 +548,7 @@ UINT32 omti8621_device::get_disk_address(const UINT8 * cdb) { set_data_transfer - setup for data transfer from/to data ***************************************************************************/ -void omti8621_device::set_data_transfer(UINT8 *data, UINT16 length) +void omti8621_device::set_data_transfer(uint8_t *data, uint16_t length) { // set controller for read data transfer omti_state = OMTI_STATE_DATA; @@ -564,9 +564,9 @@ void omti8621_device::set_data_transfer(UINT8 *data, UINT16 length) read_sectors_from_disk - read sectors starting at diskaddr into sector_buffer ***************************************************************************/ -void omti8621_device::read_sectors_from_disk(INT32 diskaddr, UINT8 count, UINT8 lun) +void omti8621_device::read_sectors_from_disk(int32_t diskaddr, uint8_t count, uint8_t lun) { - UINT8 *data_buffer = §or_buffer[0]; + uint8_t *data_buffer = §or_buffer[0]; device_image_interface *image = our_disks[lun]->m_image; while (count-- > 0) { @@ -584,9 +584,9 @@ void omti8621_device::read_sectors_from_disk(INT32 diskaddr, UINT8 count, UINT8 write_sectors_to_disk - write sectors starting at diskaddr from sector_buffer ***************************************************************************/ -void omti8621_device::write_sectors_to_disk(INT32 diskaddr, UINT8 count, UINT8 lun) +void omti8621_device::write_sectors_to_disk(int32_t diskaddr, uint8_t count, uint8_t lun) { - UINT8 *data_buffer = §or_buffer[0]; + uint8_t *data_buffer = §or_buffer[0]; device_image_interface *image = our_disks[lun]->m_image; while (count-- > 0) { @@ -609,7 +609,7 @@ void omti8621_device::write_sectors_to_disk(INT32 diskaddr, UINT8 count, UINT8 l copy_sectors - copy sectors ***************************************************************************/ -void omti8621_device::copy_sectors(INT32 dst_addr, INT32 src_addr, UINT8 count, UINT8 lun) +void omti8621_device::copy_sectors(int32_t dst_addr, int32_t src_addr, uint8_t count, uint8_t lun) { device_image_interface *image = our_disks[lun]->m_image; @@ -636,11 +636,11 @@ void omti8621_device::copy_sectors(INT32 dst_addr, INT32 src_addr, UINT8 count, format track - format a track ***************************************************************************/ -void omti8621_device::format_track(const UINT8 * cdb) +void omti8621_device::format_track(const uint8_t * cdb) { - UINT8 lun = get_lun(cdb); - UINT32 disk_addr = get_disk_address(cdb); - UINT32 disk_track = get_disk_track(cdb); + uint8_t lun = get_lun(cdb); + uint32_t disk_addr = get_disk_address(cdb); + uint32_t disk_track = get_disk_track(cdb); if (diskaddr_ecc_error == disk_addr) { // reset previous ECC error @@ -675,7 +675,7 @@ void omti8621_device::format_track(const UINT8 * cdb) set_esdi_defect_list - setup the (empty) ESDI defect list ***************************************************************************/ -void omti8621_device::set_esdi_defect_list(UINT8 lun, UINT8 head) +void omti8621_device::set_esdi_defect_list(uint8_t lun, uint8_t head) { omti_disk_image_device *disk = our_disks[lun]; @@ -701,7 +701,7 @@ void omti8621_device::logerror(Format &&fmt, Params &&... args) const log_command - log command from a command descriptor block ***************************************************************************/ -void omti8621_device::log_command(const UINT8 cdb[], const UINT16 cdb_length) +void omti8621_device::log_command(const uint8_t cdb[], const uint16_t cdb_length) { if (verbose > 0) { int i; @@ -821,9 +821,9 @@ void omti8621_device::log_data() do_command ***************************************************************************/ -void omti8621_device::do_command(const UINT8 cdb[], const UINT16 cdb_length) +void omti8621_device::do_command(const uint8_t cdb[], const uint16_t cdb_length) { - UINT8 lun = get_lun(cdb); + uint8_t lun = get_lun(cdb); omti_disk_image_device *disk = our_disks[lun]; int command_duration = 0; // ms @@ -949,7 +949,7 @@ void omti8621_device::do_command(const UINT8 cdb[], const UINT16 cdb_length) case OMTI_CMD_WRITE_LONG: // 0xE6 log_data(); if (check_disk_address(cdb)) { - UINT32 diskaddr = get_disk_address(cdb); + uint32_t diskaddr = get_disk_address(cdb); write_sectors_to_disk(diskaddr, cdb[4], lun); // this will spoil the ECC code diskaddr_ecc_error = diskaddr; @@ -994,7 +994,7 @@ void omti8621_device::do_command(const UINT8 cdb[], const UINT16 cdb_length) get_command_length ***************************************************************************/ -UINT8 omti8621_device::get_command_length(UINT8 command_byte) +uint8_t omti8621_device::get_command_length(uint8_t command_byte) { return command_byte == OMTI_CMD_COPY ? 10 : 6; } @@ -1003,9 +1003,9 @@ UINT8 omti8621_device::get_command_length(UINT8 command_byte) get_data ***************************************************************************/ -UINT16 omti8621_device::get_data() +uint16_t omti8621_device::get_data() { - UINT16 data = 0xff; + uint16_t data = 0xff; if (data_index < data_length) { data = data_buffer[data_index++]; data |= data_buffer[data_index++] << 8; @@ -1024,7 +1024,7 @@ UINT16 omti8621_device::get_data() set_data ***************************************************************************/ -void omti8621_device::set_data(UINT16 data) +void omti8621_device::set_data(uint16_t data) { if (data_index < data_length) { data_buffer[data_index++] = data & 0xff; @@ -1168,8 +1168,8 @@ READ16_MEMBER(omti8621_device::read) READ8_MEMBER(omti8621_device::read8) { - UINT8 data = 0xff; - static UINT8 last_data = 0xff; + uint8_t data = 0xff; + static uint8_t last_data = 0xff; switch (offset) { case OMTI_PORT_DATA_IN: // 0x00 @@ -1235,7 +1235,7 @@ void omti8621_device::set_verbose(int on_off) get_sector - get sector diskaddr of logical unit lun into data_buffer ***************************************************************************/ -UINT32 omti8621_apollo_device::get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 length, UINT8 lun) +uint32_t omti8621_apollo_device::get_sector(int32_t diskaddr, uint8_t *data_buffer, uint32_t length, uint8_t lun) { omti_disk_image_device *disk = our_disks[lun]; @@ -1261,7 +1261,7 @@ UINT32 omti8621_apollo_device::get_sector(INT32 diskaddr, UINT8 *data_buffer, UI omti_set_jumper - set OMTI jumpers ***************************************************************************/ -void omti8621_device::set_jumper(UINT16 disk_type) +void omti8621_device::set_jumper(uint16_t disk_type) { LOG1(("set_jumper: disk type=%x", disk_type)); @@ -1289,12 +1289,12 @@ WRITE_LINE_MEMBER( omti8621_device::fdc_drq_w ) m_isa->drq2_w(state ? ASSERT_LINE : CLEAR_LINE); } -UINT8 omti8621_device::dack_r(int line) +uint8_t omti8621_device::dack_r(int line) { return m_fdc->dma_r(); } -void omti8621_device::dack_w(int line, UINT8 data) +void omti8621_device::dack_w(int line, uint8_t data) { return m_fdc->dma_w(data); } @@ -1309,7 +1309,7 @@ void omti8621_device::eop_w(int state) // device type definition const device_type OMTI_DISK = &device_creator; -omti_disk_image_device::omti_disk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +omti_disk_image_device::omti_disk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OMTI_DISK, "OMTI8621 ESDI disk", tag, owner, clock, "omti_disk_image", __FILE__), device_image_interface(mconfig, *this), m_type(0), m_cylinders(0), m_heads(0), m_sectors(0), m_sectorbytes(0), m_sector_count(0), m_image(nullptr) { @@ -1325,7 +1325,7 @@ void omti_disk_image_device::device_config_complete() omti_disk_config - configure disk parameters ***************************************************************************/ -void omti_disk_image_device::omti_disk_config(UINT16 disk_type) +void omti_disk_image_device::omti_disk_config(uint16_t disk_type) { LOG1(("omti_disk_config: configuring disk with type %x", disk_type)); @@ -1391,8 +1391,8 @@ void omti_disk_image_device::device_reset() if (exists() && fseek(0, SEEK_END) == 0) { - UINT32 disk_size = (UINT32)(ftell() / OMTI_DISK_SECTOR_SIZE); - UINT16 disk_type = disk_size >= 300000 ? OMTI_DISK_TYPE_348_MB : OMTI_DISK_TYPE_155_MB; + uint32_t disk_size = (uint32_t)(ftell() / OMTI_DISK_SECTOR_SIZE); + uint16_t disk_type = disk_size >= 300000 ? OMTI_DISK_TYPE_348_MB : OMTI_DISK_TYPE_155_MB; if (disk_type != m_type) { LOG1(("device_reset_omti_disk: disk size=%d blocks, disk type=%x", disk_size, disk_type )); omti_disk_config(disk_type); diff --git a/src/devices/bus/isa/omti8621.h b/src/devices/bus/isa/omti8621.h index 7a81751bbe7..10f3bb6588b 100644 --- a/src/devices/bus/isa/omti8621.h +++ b/src/devices/bus/isa/omti8621.h @@ -33,7 +33,7 @@ class omti_disk_image_device; class omti8621_device : public device_t, public device_isa16_card_interface { public: - omti8621_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock); + omti8621_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); ~omti8621_device() {} DECLARE_READ16_MEMBER(read); @@ -59,8 +59,8 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; virtual ioport_constructor device_input_ports() const override; - virtual UINT8 dack_r(int line) override; - virtual void dack_w(int line, UINT8 data) override; + virtual uint8_t dack_r(int line) override; + virtual void dack_w(int line, uint8_t data) override; virtual void eop_w(int state) override; void set_interrupt(enum line_state line_state); @@ -68,62 +68,62 @@ protected: omti_disk_image_device *our_disks[OMTI_MAX_LUN+1]; private: - UINT16 jumper; + uint16_t jumper; - UINT8 omti_state; + uint8_t omti_state; - UINT8 status_port; - UINT8 config_port; - UINT8 mask_port; + uint8_t status_port; + uint8_t config_port; + uint8_t mask_port; // command descriptor block - UINT8 command_buffer[CDB_SIZE]; + uint8_t command_buffer[CDB_SIZE]; int command_length; int command_index; int command_status; // data buffer - std::vector sector_buffer; - UINT8 *data_buffer; + std::vector sector_buffer; + uint8_t *data_buffer; int data_length; int data_index; // sense data - UINT8 sense_data[4]; + uint8_t sense_data[4]; // these are used only to satisfy dex - UINT32 diskaddr_ecc_error; - UINT32 diskaddr_format_bad_track; - UINT8 alternate_track_buffer[4]; - UINT32 alternate_track_address[2]; + uint32_t diskaddr_ecc_error; + uint32_t diskaddr_format_bad_track; + uint8_t alternate_track_buffer[4]; + uint32_t alternate_track_address[2]; emu_timer *m_timer; bool m_installed; void clear_sense_data(); - void set_sense_data(UINT8 code, const UINT8 * cdb); - void set_configuration_data(UINT8 lun); - UINT8 get_lun(const UINT8 * cdb); - UINT8 check_disk_address(const UINT8 *cdb); - UINT32 get_disk_track(const UINT8 * cdb); - UINT32 get_disk_address(const UINT8 * cdb); - void set_data_transfer(UINT8 *data, UINT16 length); - void read_sectors_from_disk(INT32 diskaddr, UINT8 count, UINT8 lun); - void write_sectors_to_disk(INT32 diskaddr, UINT8 count, UINT8 lun); - void copy_sectors(INT32 dst_addr, INT32 src_addr, UINT8 count, UINT8 lun); - void format_track(const UINT8 * cdb); - void set_esdi_defect_list(UINT8 lun, UINT8 head); + void set_sense_data(uint8_t code, const uint8_t * cdb); + void set_configuration_data(uint8_t lun); + uint8_t get_lun(const uint8_t * cdb); + uint8_t check_disk_address(const uint8_t *cdb); + uint32_t get_disk_track(const uint8_t * cdb); + uint32_t get_disk_address(const uint8_t * cdb); + void set_data_transfer(uint8_t *data, uint16_t length); + void read_sectors_from_disk(int32_t diskaddr, uint8_t count, uint8_t lun); + void write_sectors_to_disk(int32_t diskaddr, uint8_t count, uint8_t lun); + void copy_sectors(int32_t dst_addr, int32_t src_addr, uint8_t count, uint8_t lun); + void format_track(const uint8_t * cdb); + void set_esdi_defect_list(uint8_t lun, uint8_t head); template void logerror(Format &&fmt, Params &&... args) const; - void log_command(const UINT8 cdb[], const UINT16 cdb_length); + void log_command(const uint8_t cdb[], const uint16_t cdb_length); void log_data(); - void do_command(const UINT8 cdb[], const UINT16 cdb_length); - UINT8 get_command_length(UINT8 command_byte); - UINT16 get_data(); - void set_data(UINT16 data); - void set_jumper(UINT16 disk_type); + void do_command(const uint8_t cdb[], const uint16_t cdb_length); + uint8_t get_command_length(uint8_t command_byte); + uint16_t get_data(); + void set_data(uint16_t data); + void set_jumper(uint16_t disk_type); DECLARE_READ8_MEMBER(read8); DECLARE_WRITE8_MEMBER(write8); }; @@ -133,7 +133,7 @@ private: class omti8621_pc_device : public omti8621_device { public: - omti8621_pc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + omti8621_pc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type ISA16_OMTI8621; @@ -143,10 +143,10 @@ extern const device_type ISA16_OMTI8621; class omti8621_apollo_device : public omti8621_device { public: - omti8621_apollo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + omti8621_apollo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // get sector diskaddr of logical unit lun into data_buffer - UINT32 get_sector(INT32 diskaddr, UINT8 *data_buffer, UINT32 length, UINT8 lun); + uint32_t get_sector(int32_t diskaddr, uint8_t *data_buffer, uint32_t length, uint8_t lun); protected: virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/devices/bus/isa/p1_fdc.cpp b/src/devices/bus/isa/p1_fdc.cpp index 6f6ed6b3cc0..36961e7bf98 100644 --- a/src/devices/bus/isa/p1_fdc.cpp +++ b/src/devices/bus/isa/p1_fdc.cpp @@ -88,14 +88,14 @@ const tiny_rom_entry *p1_fdc_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -UINT8 p1_fdc_device::p1_wd17xx_motor_r() +uint8_t p1_fdc_device::p1_wd17xx_motor_r() { DBG_LOG(1,"p1_fdc_motor_r",("R = $%02x\n", 0)); // XXX always on for now return 0; } -UINT8 p1_fdc_device::p1_wd17xx_aux_r() +uint8_t p1_fdc_device::p1_wd17xx_aux_r() { cpu_device *maincpu = machine().device("maincpu"); @@ -148,7 +148,7 @@ WRITE_LINE_MEMBER( p1_fdc_device::p1_fdc_irq_drq ) READ8_MEMBER( p1_fdc_device::p1_fdc_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch( offset ) { @@ -171,7 +171,7 @@ WRITE8_MEMBER( p1_fdc_device::p1_fdc_w ) // p1_fdc_device - constructor //------------------------------------------------- -p1_fdc_device::p1_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +p1_fdc_device::p1_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, P1_FDC, "Poisk-1 floppy B504", tag, owner, clock, "p1_fdc", __FILE__), device_isa8_card_interface( mconfig, *this ), m_fdc(*this, "fdc") diff --git a/src/devices/bus/isa/p1_fdc.h b/src/devices/bus/isa/p1_fdc.h index 495f9f559d7..19fd04e3163 100644 --- a/src/devices/bus/isa/p1_fdc.h +++ b/src/devices/bus/isa/p1_fdc.h @@ -26,7 +26,7 @@ class p1_fdc_device : public device_t, { public: // construction/destruction - p1_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + p1_fdc_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,8 +46,8 @@ private: public: void p1_wd17xx_aux_w(int data); - UINT8 p1_wd17xx_aux_r(); - UINT8 p1_wd17xx_motor_r(); + uint8_t p1_wd17xx_aux_r(); + uint8_t p1_wd17xx_motor_r(); }; diff --git a/src/devices/bus/isa/p1_hdc.cpp b/src/devices/bus/isa/p1_hdc.cpp index a8bd565479a..b0377ef37fa 100644 --- a/src/devices/bus/isa/p1_hdc.cpp +++ b/src/devices/bus/isa/p1_hdc.cpp @@ -93,7 +93,7 @@ const tiny_rom_entry *p1_hdc_device::device_rom_region() const READ8_MEMBER(p1_hdc_device::p1_HDC_r) { - UINT8 data = 0x00; + uint8_t data = 0x00; switch (offset >> 8) { case 8: data = m_hdc->read(space, offset & 255); @@ -115,7 +115,7 @@ WRITE8_MEMBER(p1_hdc_device::p1_HDC_w) // p1_hdc_device - constructor //------------------------------------------------- -p1_hdc_device::p1_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +p1_hdc_device::p1_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, P1_HDC, "Poisk-1 MFM disk B942", tag, owner, clock, "p1_hdc", __FILE__), device_isa8_card_interface( mconfig, *this ), m_hdc(*this, KM1809VG7_TAG) diff --git a/src/devices/bus/isa/p1_hdc.h b/src/devices/bus/isa/p1_hdc.h index a009fdcebaf..ec8842e8062 100644 --- a/src/devices/bus/isa/p1_hdc.h +++ b/src/devices/bus/isa/p1_hdc.h @@ -26,7 +26,7 @@ class p1_hdc_device : public device_t, { public: // construction/destruction - p1_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + p1_hdc_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; @@ -40,7 +40,7 @@ protected: private: required_device m_hdc; - //UINT8 m_ram[0x800]; + //uint8_t m_ram[0x800]; public: DECLARE_READ8_MEMBER(p1_HDC_r); diff --git a/src/devices/bus/isa/p1_rom.cpp b/src/devices/bus/isa/p1_rom.cpp index 4ace5c48e41..8225b3586d2 100644 --- a/src/devices/bus/isa/p1_rom.cpp +++ b/src/devices/bus/isa/p1_rom.cpp @@ -49,7 +49,7 @@ const tiny_rom_entry *p1_rom_device::device_rom_region() const // p1_rom_device - constructor //------------------------------------------------- -p1_rom_device::p1_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +p1_rom_device::p1_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, P1_ROM, "Poisk-1 ROM cart", tag, owner, clock, "p1_rom", __FILE__), device_isa8_card_interface( mconfig, *this ) { diff --git a/src/devices/bus/isa/p1_rom.h b/src/devices/bus/isa/p1_rom.h index 6ee2a63e755..3320628c1b7 100644 --- a/src/devices/bus/isa/p1_rom.h +++ b/src/devices/bus/isa/p1_rom.h @@ -23,7 +23,7 @@ class p1_rom_device : public device_t, { public: // construction/destruction - p1_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + p1_rom_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; diff --git a/src/devices/bus/isa/p1_sound.cpp b/src/devices/bus/isa/p1_sound.cpp index e77312a3fd9..fe7492d31e0 100644 --- a/src/devices/bus/isa/p1_sound.cpp +++ b/src/devices/bus/isa/p1_sound.cpp @@ -88,7 +88,7 @@ machine_config_constructor p1_sound_device::device_mconfig_additions() const // p1_sound_device - constructor //------------------------------------------------- -p1_sound_device::p1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +p1_sound_device::p1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, P1_SOUND, "Poisk-1 sound card (B623)", tag, owner, clock, "p1_sound", __FILE__), device_isa8_card_interface( mconfig, *this ), m_dac(*this, "dac"), diff --git a/src/devices/bus/isa/p1_sound.h b/src/devices/bus/isa/p1_sound.h index 2dfae20f67c..ae2965e203b 100644 --- a/src/devices/bus/isa/p1_sound.h +++ b/src/devices/bus/isa/p1_sound.h @@ -32,7 +32,7 @@ class p1_sound_device : public device_t, { public: // construction/destruction - p1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + p1_sound_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; @@ -54,7 +54,7 @@ protected: virtual void device_reset() override; private: - UINT8 m_dac_data[16]; + uint8_t m_dac_data[16]; int m_dac_ptr; required_device m_dac; diff --git a/src/devices/bus/isa/pc1640_iga.cpp b/src/devices/bus/isa/pc1640_iga.cpp index e38ed4d09d0..3b423ed3a74 100644 --- a/src/devices/bus/isa/pc1640_iga.cpp +++ b/src/devices/bus/isa/pc1640_iga.cpp @@ -67,7 +67,7 @@ const tiny_rom_entry *isa8_pc1640_iga_device::device_rom_region() const // isa8_pc1640_iga_device - constructor //------------------------------------------------- -isa8_pc1640_iga_device::isa8_pc1640_iga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +isa8_pc1640_iga_device::isa8_pc1640_iga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_ega_device(mconfig, ISA8_PC1640_IGA, "Amstrad PC1640 IGA", tag, owner, clock, "pc1640_iga", __FILE__) { } @@ -86,9 +86,9 @@ void isa8_pc1640_iga_device::device_start() for (int i = 0; i < 64; i++ ) { - UINT8 r = ( ( i & 0x04 ) ? 0xAA : 0x00 ) + ( ( i & 0x20 ) ? 0x55 : 0x00 ); - UINT8 g = ( ( i & 0x02 ) ? 0xAA : 0x00 ) + ( ( i & 0x10 ) ? 0x55 : 0x00 ); - UINT8 b = ( ( i & 0x01 ) ? 0xAA : 0x00 ) + ( ( i & 0x08 ) ? 0x55 : 0x00 ); + uint8_t r = ( ( i & 0x04 ) ? 0xAA : 0x00 ) + ( ( i & 0x20 ) ? 0x55 : 0x00 ); + uint8_t g = ( ( i & 0x02 ) ? 0xAA : 0x00 ) + ( ( i & 0x10 ) ? 0x55 : 0x00 ); + uint8_t b = ( ( i & 0x01 ) ? 0xAA : 0x00 ) + ( ( i & 0x08 ) ? 0x55 : 0x00 ); m_palette->set_pen_color( i, r, g, b ); } @@ -98,13 +98,13 @@ void isa8_pc1640_iga_device::device_start() m_videoram = m_vram->base(); m_plane[0] = m_videoram + 0x00000; - memset(m_plane[0], 0, sizeof(UINT8) * 0x10000); + memset(m_plane[0], 0, sizeof(uint8_t) * 0x10000); m_plane[1] = m_videoram + 0x10000; - memset(m_plane[1], 0, sizeof(UINT8) * 0x10000); + memset(m_plane[1], 0, sizeof(uint8_t) * 0x10000); m_plane[2] = m_videoram + 0x20000; - memset(m_plane[2], 0, sizeof(UINT8) * 0x10000); + memset(m_plane[2], 0, sizeof(uint8_t) * 0x10000); m_plane[3] = m_videoram + 0x30000; - memset(m_plane[3], 0, sizeof(UINT8) * 0x10000); + memset(m_plane[3], 0, sizeof(uint8_t) * 0x10000); m_crtc_ega = subdevice(EGA_CRTC_NAME); diff --git a/src/devices/bus/isa/pc1640_iga.h b/src/devices/bus/isa/pc1640_iga.h index 225b31cfdae..50db6388004 100644 --- a/src/devices/bus/isa/pc1640_iga.h +++ b/src/devices/bus/isa/pc1640_iga.h @@ -27,7 +27,7 @@ class isa8_pc1640_iga_device : public isa8_ega_device { public: // construction/destruction - isa8_pc1640_iga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_pc1640_iga_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; diff --git a/src/devices/bus/isa/pds.cpp b/src/devices/bus/isa/pds.cpp index f832de418de..39c9165f8c9 100644 --- a/src/devices/bus/isa/pds.cpp +++ b/src/devices/bus/isa/pds.cpp @@ -20,7 +20,7 @@ const device_type ISA8_PDS = &device_creator; -isa8_pds_device::isa8_pds_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +isa8_pds_device::isa8_pds_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_PDS, "Programmers Development System", tag, owner, clock, "isa_pds", __FILE__), device_isa8_card_interface( mconfig, *this ), m_ppi(*this,"pds_ppi") diff --git a/src/devices/bus/isa/pds.h b/src/devices/bus/isa/pds.h index eb98c3abb83..9a1f0314eae 100644 --- a/src/devices/bus/isa/pds.h +++ b/src/devices/bus/isa/pds.h @@ -18,7 +18,7 @@ class isa8_pds_device : public device_isa8_card_interface { public: - isa8_pds_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_pds_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(ppi_r); DECLARE_WRITE8_MEMBER(ppi_w); diff --git a/src/devices/bus/isa/pgc.cpp b/src/devices/bus/isa/pgc.cpp index b211765ba95..6238e218592 100644 --- a/src/devices/bus/isa/pgc.cpp +++ b/src/devices/bus/isa/pgc.cpp @@ -203,7 +203,7 @@ ioport_constructor isa8_pgc_device::device_input_ports() const // isa8_pgc_device - constructor //------------------------------------------------- -isa8_pgc_device::isa8_pgc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_pgc_device::isa8_pgc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_PGC, "IBM Professional Graphics Controller", tag, owner, clock, "isa_ibm_pgc", __FILE__), device_isa8_card_interface(mconfig, *this), m_cpu(*this, "maincpu"), @@ -212,7 +212,7 @@ isa8_pgc_device::isa8_pgc_device(const machine_config &mconfig, const char *tag, { } -isa8_pgc_device::isa8_pgc_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) : +isa8_pgc_device::isa8_pgc_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_isa8_card_interface(mconfig, *this), m_cpu(*this, "maincpu"), @@ -240,11 +240,11 @@ void isa8_pgc_device::device_start() m_bitmap = std::make_unique(width, height); m_bitmap->fill(0); - m_vram = std::make_unique(0x78000); + m_vram = std::make_unique(0x78000); space.install_readwrite_bank(0x80000, 0xf7fff, "vram"); membank("vram")->set_base(m_vram.get()); - m_eram = std::make_unique(0x8000); + m_eram = std::make_unique(0x8000); machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(isa8_pgc_device::reset_common), this)); } @@ -287,7 +287,7 @@ IRQ_CALLBACK_MEMBER(isa8_pgc_device::irq_callback) // memory handlers READ8_MEMBER( isa8_pgc_device::stateparam_r ) { - UINT8 ret; + uint8_t ret; ret = m_stateparam[offset >> 1]; if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) @@ -306,7 +306,7 @@ WRITE8_MEMBER( isa8_pgc_device::stateparam_w ) { } WRITE8_MEMBER( isa8_pgc_device::lut_w ) { - UINT8 o = (offset >> 1) * 3; + uint8_t o = (offset >> 1) * 3; if (offset & 1) { m_lut[o + 2] = (data & 15) << 4; @@ -336,9 +336,9 @@ READ8_MEMBER( isa8_pgc_device::init_r ) { TIMER_DEVICE_CALLBACK_MEMBER(isa8_pgc_device::scanline_callback) { - UINT16 x, y = m_screen->vpos(); - UINT16 *p; - UINT8 *v; + uint16_t x, y = m_screen->vpos(); + uint16_t *p; + uint8_t *v; // XXX hpos shifts every frame -- fix if (y == 0) DBG_LOG(2,"scanline_cb", @@ -358,7 +358,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(isa8_pgc_device::scanline_callback) } } -UINT32 isa8_pgc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t isa8_pgc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, *m_bitmap, 0, 0, PGC_HORZ_START, PGC_VERT_START, cliprect); return 0; diff --git a/src/devices/bus/isa/pgc.h b/src/devices/bus/isa/pgc.h index b06e87478f8..e59348a5bb6 100644 --- a/src/devices/bus/isa/pgc.h +++ b/src/devices/bus/isa/pgc.h @@ -23,15 +23,15 @@ class isa8_pgc_device : { public: // construction/destruction - isa8_pgc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - isa8_pgc_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); + isa8_pgc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + isa8_pgc_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; virtual ioport_constructor device_input_ports() const override; - 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); TIMER_DEVICE_CALLBACK_MEMBER( scanline_callback ); INTERRUPT_GEN_MEMBER(vblank_irq); @@ -54,11 +54,11 @@ private: required_device m_screen; required_device m_palette; - UINT8 *m_commarea; - std::unique_ptr m_vram; - std::unique_ptr m_eram; - UINT8 m_stateparam[16]; - UINT8 m_lut[256*3]; + uint8_t *m_commarea; + std::unique_ptr m_vram; + std::unique_ptr m_eram; + uint8_t m_stateparam[16]; + uint8_t m_lut[256*3]; std::unique_ptr m_bitmap; }; diff --git a/src/devices/bus/isa/s3virge.cpp b/src/devices/bus/isa/s3virge.cpp index 1e2ccc27458..cf05045005e 100644 --- a/src/devices/bus/isa/s3virge.cpp +++ b/src/devices/bus/isa/s3virge.cpp @@ -20,27 +20,27 @@ const device_type S3VIRGE = &device_creator; const device_type S3VIRGEDX = &device_creator; const device_type S3VIRGEDX1 = &device_creator; -s3virge_vga_device::s3virge_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s3virge_vga_device::s3virge_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : s3_vga_device(mconfig, S3VIRGE, "S3 86C325", tag, owner, clock, "virge_vga", __FILE__) { } -s3virge_vga_device::s3virge_vga_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) +s3virge_vga_device::s3virge_vga_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) : s3_vga_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -s3virgedx_vga_device::s3virgedx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s3virgedx_vga_device::s3virgedx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : s3virge_vga_device(mconfig, S3VIRGEDX, "S3 86C375", tag, owner, clock, "virgedx_vga", __FILE__) { } -s3virgedx_vga_device::s3virgedx_vga_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) +s3virgedx_vga_device::s3virgedx_vga_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) : s3virge_vga_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -s3virgedx_rev1_vga_device::s3virgedx_rev1_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s3virgedx_rev1_vga_device::s3virgedx_rev1_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : s3virgedx_vga_device(mconfig, S3VIRGEDX1, "S3 86C375 (rev 1)", tag, owner, clock, "virgedx_r1", __FILE__) { } @@ -132,9 +132,9 @@ void s3virgedx_rev1_vga_device::device_reset() s3.strapping = 0x0aff0912; } -UINT8 s3virge_vga_device::s3_crtc_reg_read(UINT8 index) +uint8_t s3virge_vga_device::s3_crtc_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; if(index <= 0x18) res = crtc_reg_read(index); @@ -295,7 +295,7 @@ void s3virge_vga_device::s3_define_video_mode() recompute_params_clock(divisor, xtal); } -void s3virge_vga_device::s3_crtc_reg_write(UINT8 index, UINT8 data) +void s3virge_vga_device::s3_crtc_reg_write(uint8_t index, uint8_t data) { if(index <= 0x18) { @@ -608,7 +608,7 @@ bit 0 Vertical Total bit 10. Bit 10 of the Vertical Total register (3d4h READ8_MEMBER(s3virge_vga_device::port_03b0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3b0) { @@ -645,7 +645,7 @@ WRITE8_MEMBER(s3virge_vga_device::port_03b0_w) READ8_MEMBER(s3virge_vga_device::port_03c0_r) { - UINT8 res; + uint8_t res; switch(offset) { @@ -669,7 +669,7 @@ WRITE8_MEMBER(s3virge_vga_device::port_03c0_w) READ8_MEMBER(s3virge_vga_device::port_03d0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3d0) { @@ -708,7 +708,7 @@ READ8_MEMBER(s3virge_vga_device::mem_r) { if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb32_en) { - UINT8 data; + uint8_t data; if(offset & 0x10000) return 0; data = 0xff; diff --git a/src/devices/bus/isa/s3virge.h b/src/devices/bus/isa/s3virge.h index 1b7f6796e95..5c33393f8c3 100644 --- a/src/devices/bus/isa/s3virge.h +++ b/src/devices/bus/isa/s3virge.h @@ -19,8 +19,8 @@ class s3virge_vga_device : public s3_vga_device { public: // construction/destruction - s3virge_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - s3virge_vga_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); + s3virge_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + s3virge_vga_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 READ8_MEMBER(port_03b0_r) override; virtual WRITE8_MEMBER(port_03b0_w) override; @@ -38,9 +38,9 @@ protected: virtual void device_reset() override; private: - virtual UINT8 s3_crtc_reg_read(UINT8 index); + virtual uint8_t s3_crtc_reg_read(uint8_t index); virtual void s3_define_video_mode(void); - virtual void s3_crtc_reg_write(UINT8 index, UINT8 data); + virtual void s3_crtc_reg_write(uint8_t index, uint8_t data); // has no 8514/A device }; @@ -51,8 +51,8 @@ class s3virgedx_vga_device : public s3virge_vga_device { public: // construction/destruction - s3virgedx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - s3virgedx_vga_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); + s3virgedx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + s3virgedx_vga_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: // device-level overrides @@ -66,7 +66,7 @@ class s3virgedx_rev1_vga_device : public s3virgedx_vga_device { public: // construction/destruction - s3virgedx_rev1_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s3virgedx_rev1_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides diff --git a/src/devices/bus/isa/sb16.cpp b/src/devices/bus/isa/sb16.cpp index 3b65ef23894..abf4ea3a513 100644 --- a/src/devices/bus/isa/sb16.cpp +++ b/src/devices/bus/isa/sb16.cpp @@ -61,7 +61,7 @@ WRITE8_MEMBER( sb16_lle_device::dac_data_w ) READ8_MEMBER( sb16_lle_device::p1_r ) { - UINT8 ret = 0; + uint8_t ret = 0; ret |= m_data_out << 0; ret |= m_data_in << 1; return ret; @@ -141,7 +141,7 @@ READ8_MEMBER( sb16_lle_device::dma_stat_r ) * bit6 - * bit7 - */ - UINT8 ret = (m_dma16_done << 1) | m_dma8_done; + uint8_t ret = (m_dma16_done << 1) | m_dma8_done; return ret; } @@ -440,9 +440,9 @@ WRITE8_MEMBER( sb16_lle_device::host_cmd_w ) m_in_byte = data; } -UINT8 sb16_lle_device::dack_r(int line) +uint8_t sb16_lle_device::dack_r(int line) { - UINT8 ret = m_adc_fifo[m_adc_fifo_tail].b[m_adc_h + (m_adc_r * 2)]; + uint8_t ret = m_adc_fifo[m_adc_fifo_tail].b[m_adc_h + (m_adc_r * 2)]; if(m_ctrl8 & 2) return 0; @@ -483,7 +483,7 @@ UINT8 sb16_lle_device::dack_r(int line) return ret; } -void sb16_lle_device::dack_w(int line, UINT8 data) +void sb16_lle_device::dack_w(int line, uint8_t data) { if(m_ctrl8 & 2) return; @@ -525,9 +525,9 @@ void sb16_lle_device::dack_w(int line, UINT8 data) m_isa->drq1_w(0); } -UINT16 sb16_lle_device::dack16_r(int line) +uint16_t sb16_lle_device::dack16_r(int line) { - UINT16 ret = m_adc_fifo[m_adc_fifo_tail].h[m_adc_r]; + uint16_t ret = m_adc_fifo[m_adc_fifo_tail].h[m_adc_r]; if(m_ctrl16 & 2) return 0; @@ -560,7 +560,7 @@ UINT16 sb16_lle_device::dack16_r(int line) return ret; } -void sb16_lle_device::dack16_w(int line, UINT16 data) +void sb16_lle_device::dack16_w(int line, uint16_t data) { if(m_ctrl16 & 2) return; @@ -637,7 +637,7 @@ READ8_MEMBER( sb16_lle_device::invalid_r ) // just using the old dummy mpu401 for now READ8_MEMBER( sb16_lle_device::mpu401_r ) { - UINT8 res; + uint8_t res; m_irq_midi = false; m_isa->irq5_w((m_irq8 || m_irq16 || m_irq_midi) ? ASSERT_LINE : CLEAR_LINE); @@ -676,7 +676,7 @@ WRITE8_MEMBER( sb16_lle_device::mpu401_w ) } -sb16_lle_device::sb16_lle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sb16_lle_device::sb16_lle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_SB16, "SoundBlaster 16 Audio Adapter LLE", tag, owner, clock, "sb16", __FILE__), device_isa16_card_interface(mconfig, *this), m_ldac(*this, "ldac"), @@ -691,8 +691,8 @@ sb16_lle_device::sb16_lle_device(const machine_config &mconfig, const char *tag, void sb16_lle_device::device_start() { //address_space &space = m_cpu->space(AS_PROGRAM); - UINT8 *rom = memregion("sb16_cpu")->base(); - UINT8 *xor_table = memregion("xor_table")->base(); + uint8_t *rom = memregion("sb16_cpu")->base(); + uint8_t *xor_table = memregion("xor_table")->base(); for(int i = 0; i < 0x2000; i++) rom[i] = rom[i] ^ xor_table[i & 0x3f]; @@ -739,7 +739,7 @@ void sb16_lle_device::device_reset() void sb16_lle_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) { - UINT16 dacl = 0, dacr = 0, adcl = 0, adcr = 0; + uint16_t dacl = 0, dacr = 0, adcl = 0, adcr = 0; if(m_mode & 2) { // it might be possible to run the adc though dma simultaneously but the rom doesn't appear to permit it diff --git a/src/devices/bus/isa/sb16.h b/src/devices/bus/isa/sb16.h index 44ac336e673..e1c51625bcb 100644 --- a/src/devices/bus/isa/sb16.h +++ b/src/devices/bus/isa/sb16.h @@ -22,7 +22,7 @@ class sb16_lle_device : public device_t, { public: // construction/destruction - sb16_lle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sb16_lle_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; @@ -85,25 +85,25 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - UINT8 dack_r(int line) override; - void dack_w(int line, UINT8 data) override; - UINT16 dack16_r(int line) override; - void dack16_w(int line, UINT16 data) override; + uint8_t dack_r(int line) override; + void dack_w(int line, uint8_t data) override; + uint16_t dack16_r(int line) override; + void dack16_w(int line, uint16_t data) override; private: void control_timer(bool start); // internal state bool m_data_in; - UINT8 m_in_byte; + uint8_t m_in_byte; bool m_data_out; - UINT8 m_out_byte; + uint8_t m_out_byte; - UINT8 m_freq, m_mode, m_dac_fifo_ctrl, m_adc_fifo_ctrl, m_ctrl8, m_ctrl16, m_mpu_byte; - UINT16 m_dma8_len, m_dma16_len, m_dma8_cnt, m_dma16_cnt; + uint8_t m_freq, m_mode, m_dac_fifo_ctrl, m_adc_fifo_ctrl, m_ctrl8, m_ctrl16, m_mpu_byte; + uint16_t m_dma8_len, m_dma16_len, m_dma8_cnt, m_dma16_cnt; typedef union { - UINT32 w; - UINT16 h[2]; - UINT8 b[4]; + uint32_t w; + uint16_t h[2]; + uint8_t b[4]; } samples; samples m_adc_fifo[16], m_dac_fifo[16]; int m_adc_fifo_head, m_adc_fifo_tail, m_dac_fifo_head, m_dac_fifo_tail; diff --git a/src/devices/bus/isa/sblaster.cpp b/src/devices/bus/isa/sblaster.cpp index 9f1c8382af9..a26bb27502d 100644 --- a/src/devices/bus/isa/sblaster.cpp +++ b/src/devices/bus/isa/sblaster.cpp @@ -129,7 +129,7 @@ MACHINE_CONFIG_END READ8_MEMBER( sb8_device::ym3812_16_r ) { - UINT8 retVal = 0xff; + uint8_t retVal = 0xff; switch(offset) { case 0 : retVal = m_ym3812->status_port_r( space, offset ); break; @@ -169,7 +169,7 @@ WRITE8_MEMBER( isa8_sblaster1_0_device::saa1099_2_16_w ) } } -void sb_device::queue(UINT8 data) +void sb_device::queue(uint8_t data) { if (m_dsp.fifo_ptr < 15) { @@ -184,7 +184,7 @@ void sb_device::queue(UINT8 data) } } -void sb_device::queue_r(UINT8 data) +void sb_device::queue_r(uint8_t data) { m_dsp.rbuf_status |= 0x80; @@ -201,9 +201,9 @@ void sb_device::queue_r(UINT8 data) } } -UINT8 sb_device::dequeue_r() +uint8_t sb_device::dequeue_r() { - UINT8 data = m_dsp.fifo_r[0]; + uint8_t data = m_dsp.fifo_r[0]; if (m_dsp.fifo_r_ptr > 0) { @@ -285,7 +285,7 @@ READ8_MEMBER( sb_device::dsp_data_r ) if (m_uart_midi) { - UINT8 rv = m_recvring[m_recv_read++]; + uint8_t rv = m_recvring[m_recv_read++]; if (m_recv_read >= MIDI_RING_SIZE) { m_recv_read = 0; @@ -370,7 +370,7 @@ WRITE8_MEMBER(sb_device::dsp_rbuf_status_w) logerror("Soundblaster DSP Read Buffer status undocumented write\n"); } -void sb_device::process_fifo(UINT8 cmd) +void sb_device::process_fifo(uint8_t cmd) { if (m_cmd_fifo_length[cmd] == -1) { @@ -523,7 +523,7 @@ void sb_device::process_fifo(UINT8 cmd) m_dsp.adc_length = 1; m_dsp.wbuf_status = 0x80; m_dsp.dma_no_irq = true; - m_dack_out = (UINT8)(m_dsp.prot_value & 0xff); + m_dack_out = (uint8_t)(m_dsp.prot_value & 0xff); drq_w(1); break; @@ -712,29 +712,29 @@ WRITE8_MEMBER(sb_device::dsp_cmd_w) process_fifo(m_dsp.fifo[0]); } -void sb_device::adpcm_decode(UINT8 sample, int size) +void sb_device::adpcm_decode(uint8_t sample, int size) { - const UINT8 adpcm_2_table[] = {0, 1, 1, 3, 2, 6, 4, 12, 8, 24, 16, 48}; - const UINT8 step_2_table[] = {0, 2, 0, 4, 2, 6, 4, 8, 6, 10, 8, 10}; + const uint8_t adpcm_2_table[] = {0, 1, 1, 3, 2, 6, 4, 12, 8, 24, 16, 48}; + const uint8_t step_2_table[] = {0, 2, 0, 4, 2, 6, 4, 8, 6, 10, 8, 10}; - const UINT8 adpcm_3_table[] = {0, 1, 2, 3, 1, 3, 5, 7, + const uint8_t adpcm_3_table[] = {0, 1, 2, 3, 1, 3, 5, 7, 2, 6, 10, 14, 4, 12, 20, 28, 8, 24, 40, 56}; - const UINT8 step_3_table[] = {0, 0, 0, 4, 0, 4, 4, 8, + const uint8_t step_3_table[] = {0, 0, 0, 4, 0, 4, 4, 8, 4, 8, 8, 12, 8, 12, 12, 16, 12, 16, 16, 16}; - const UINT8 adpcm_4_table[] = {0, 1, 2, 3, 4, 5, 6, 7, + const uint8_t adpcm_4_table[] = {0, 1, 2, 3, 4, 5, 6, 7, 1, 3, 5, 7, 9, 11, 13, 15, 2, 6, 10, 14, 18, 22, 26, 30, 4, 12, 20, 28, 36, 44, 52, 60}; - const UINT8 step_4_table[] = {0, 0, 0, 0, 0, 8, 8, 8, + const uint8_t step_4_table[] = {0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 8, 16, 16, 16, 8, 16, 16, 16, 16, 24, 24, 24, 16, 24, 24, 24, 24, 24, 24, 24}; - INT16 dec_sample = m_dsp.adpcm_ref; - UINT8 index; + int16_t dec_sample = m_dsp.adpcm_ref; + uint8_t index; switch(size) { case 2: @@ -765,7 +765,7 @@ void sb_device::adpcm_decode(UINT8 sample, int size) READ8_MEMBER( sb16_device::mpu401_r ) { - UINT8 res; + uint8_t res; irq_w(0, IRQ_MPU); if(offset == 0) // data @@ -1217,7 +1217,7 @@ machine_config_constructor isa16_sblaster16_device::device_mconfig_additions() c // LIVE DEVICE //************************************************************************** -sb_device::sb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source) : +sb_device::sb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_serial_interface(mconfig, *this), m_ldac(*this, "ldac"), @@ -1228,14 +1228,14 @@ sb_device::sb_device(const machine_config &mconfig, device_type type, const char { } -sb8_device::sb8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source) : +sb8_device::sb8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname, const char *source) : sb_device(mconfig, type, tag, owner, clock, name, shortname, source), device_isa8_card_interface(mconfig, *this), m_ym3812(*this, "ym3812") { } -sb16_device::sb16_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source) : +sb16_device::sb16_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname, const char *source) : sb_device(mconfig, type, tag, owner, clock, name, shortname, source), device_isa16_card_interface(mconfig, *this) { @@ -1245,19 +1245,19 @@ sb16_device::sb16_device(const machine_config &mconfig, device_type type, const // isa8_sblaster_device - constructor //------------------------------------------------- -isa8_sblaster1_0_device::isa8_sblaster1_0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_sblaster1_0_device::isa8_sblaster1_0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sb8_device(mconfig, ISA8_SOUND_BLASTER_1_0, tag, owner, clock, "Sound Blaster 1.0", "isa_sblaster1_0", __FILE__), m_saa1099_1(*this, "saa1099.1"), m_saa1099_2(*this, "saa1099.2") { } -isa8_sblaster1_5_device::isa8_sblaster1_5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_sblaster1_5_device::isa8_sblaster1_5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sb8_device(mconfig, ISA8_SOUND_BLASTER_1_5, tag, owner, clock, "Sound Blaster 1.5", "isa_sblaster1_5", __FILE__) { } -isa16_sblaster16_device::isa16_sblaster16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_sblaster16_device::isa16_sblaster16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sb16_device(mconfig, ISA16_SOUND_BLASTER_16, tag, owner, clock, "Sound Blaster 16", "isa_sblaster_16", __FILE__) { } @@ -1401,7 +1401,7 @@ void sb_device::device_reset() set_rate(31250); } -UINT8 sb_device::dack_r(int line) +uint8_t sb_device::dack_r(int line) { m_dsp.adc_transferred++; if(m_dsp.adc_transferred >= m_dsp.adc_length) @@ -1425,7 +1425,7 @@ UINT8 sb_device::dack_r(int line) return m_dack_out; } -UINT16 sb16_device::dack16_r(int line) +uint16_t sb16_device::dack16_r(int line) { m_dsp.adc_transferred += 2; if (m_dsp.adc_transferred >= m_dsp.adc_length) @@ -1444,7 +1444,7 @@ UINT16 sb16_device::dack16_r(int line) return m_dack_out; } -void sb16_device::dack16_w(int line, UINT16 data) +void sb16_device::dack16_w(int line, uint16_t data) { // set the transfer timer on the 1st byte if (!m_dsp.dma_timer_started) @@ -1487,7 +1487,7 @@ void sb16_device::dack16_w(int line, UINT16 data) } /* TODO: this mustn't be instant! */ -void sb_device::dack_w(int line, UINT8 data) +void sb_device::dack_w(int line, uint8_t data) { // printf("dack_w: line %x data %02x\n", line, data); // if(data != 0x80) @@ -1541,7 +1541,7 @@ void sb_device::device_timer(emu_timer &timer, device_timer_id tid, int param, v return; } - UINT16 lsample, rsample; + uint16_t lsample, rsample; switch (m_dsp.flags) { case 0: // 8-bit unsigned mono m_ldac->write(m_dsp.data[m_dsp.d_rptr] << 8); @@ -1698,7 +1698,7 @@ void sb_device::device_timer(emu_timer &timer, device_timer_id tid, int param, v void sb_device::rcv_complete() // Rx completed receiving byte { receive_register_extract(); - UINT8 data = get_received_char(); + uint8_t data = get_received_char(); // in UART MIDI mode, we set the DMA8 IRQ on receiving a character if (m_uart_midi) @@ -1723,7 +1723,7 @@ void sb_device::rcv_complete() // Rx completed receiving byte void sb16_device::rcv_complete() // Rx completed receiving byte { receive_register_extract(); - UINT8 data = get_received_char(); + uint8_t data = get_received_char(); // for UART or MPU, add character to the receive queue if (m_uart_midi || m_mpu_midi) @@ -1776,7 +1776,7 @@ void sb_device::tra_callback() // Tx send bit m_mdout->write_txd(bit); } -void sb_device::xmit_char(UINT8 data) +void sb_device::xmit_char(uint8_t data) { // printf("SB: xmit %02x\n", data); diff --git a/src/devices/bus/isa/sblaster.h b/src/devices/bus/isa/sblaster.h index 47868b51579..63604b618ba 100644 --- a/src/devices/bus/isa/sblaster.h +++ b/src/devices/bus/isa/sblaster.h @@ -30,64 +30,64 @@ struct sb8_dsp_state { - UINT8 reset_latch; - UINT8 rbuf_status; - UINT8 wbuf_status; - UINT8 fifo[16],fifo_ptr; - UINT8 fifo_r[52],fifo_r_ptr; - UINT16 version; - UINT8 test_reg; - UINT8 speaker_on; + uint8_t reset_latch; + uint8_t rbuf_status; + uint8_t wbuf_status; + uint8_t fifo[16],fifo_ptr; + uint8_t fifo_r[52],fifo_r_ptr; + uint16_t version; + uint8_t test_reg; + uint8_t speaker_on; bool dma_no_irq; - UINT32 prot_count; - INT32 prot_value; - UINT32 frequency; - UINT32 adc_freq; - UINT32 dma_length, dma_transferred; - UINT32 adc_length, adc_transferred; - UINT8 dma_autoinit; - UINT8 data[128], d_wptr, d_rptr; + uint32_t prot_count; + int32_t prot_value; + uint32_t frequency; + uint32_t adc_freq; + uint32_t dma_length, dma_transferred; + uint32_t adc_length, adc_transferred; + uint8_t dma_autoinit; + uint8_t data[128], d_wptr, d_rptr; bool dma_timer_started; bool dma_throttled; - UINT8 flags; - UINT8 irq_active; + uint8_t flags; + uint8_t irq_active; bool adpcm_new_ref; - UINT8 adpcm_ref; - UINT8 adpcm_step; - UINT8 adpcm_count; + uint8_t adpcm_ref; + uint8_t adpcm_step; + uint8_t adpcm_count; }; struct sb8_mixer { - UINT8 status; - UINT8 main_vol; - UINT8 dac_vol; - UINT8 fm_vol; - UINT8 mic_vol; - UINT8 in_filter; - UINT8 stereo_sel; - UINT8 cd_vol; - UINT8 line_vol; + uint8_t status; + uint8_t main_vol; + uint8_t dac_vol; + uint8_t fm_vol; + uint8_t mic_vol; + uint8_t in_filter; + uint8_t stereo_sel; + uint8_t cd_vol; + uint8_t line_vol; }; struct sb16_mixer { - UINT8 data; - UINT8 status; - UINT8 main_vol[2]; - UINT8 dac_vol[2]; - UINT8 fm_vol[2]; - UINT8 cd_vol[2]; - UINT8 line_vol[2]; - UINT8 mic_vol; - UINT8 pc_speaker_vol; - UINT8 output_ctl; - UINT8 input_ctl[2]; - UINT8 input_gain[2]; - UINT8 output_gain[2]; - UINT8 agc; - UINT8 treble[2]; - UINT8 bass[2]; + uint8_t data; + uint8_t status; + uint8_t main_vol[2]; + uint8_t dac_vol[2]; + uint8_t fm_vol[2]; + uint8_t cd_vol[2]; + uint8_t line_vol[2]; + uint8_t mic_vol; + uint8_t pc_speaker_vol; + uint8_t output_ctl; + uint8_t input_ctl[2]; + uint8_t input_gain[2]; + uint8_t output_gain[2]; + uint8_t agc; + uint8_t treble[2]; + uint8_t bass[2]; }; // ======================> sb_device (parent) @@ -97,7 +97,7 @@ class sb_device : { public: // construction/destruction - sb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source); + sb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname, const char *source); required_device m_ldac; required_device m_rdac; @@ -105,10 +105,10 @@ public: required_device m_mdout; required_ioport m_config; - void process_fifo(UINT8 cmd); - void queue(UINT8 data); - void queue_r(UINT8 data); - UINT8 dequeue_r(); + void process_fifo(uint8_t cmd); + void queue(uint8_t data); + void queue_r(uint8_t data); + uint8_t dequeue_r(); DECLARE_READ8_MEMBER(dsp_reset_r); DECLARE_WRITE8_MEMBER(dsp_reset_w); @@ -119,19 +119,19 @@ public: DECLARE_WRITE8_MEMBER(dsp_rbuf_status_w); DECLARE_WRITE8_MEMBER(dsp_cmd_w); - DECLARE_WRITE_LINE_MEMBER( midi_rx_w ) { device_serial_interface::rx_w((UINT8)state); } + DECLARE_WRITE_LINE_MEMBER( midi_rx_w ) { device_serial_interface::rx_w((uint8_t)state); } protected: // device-level overrides virtual void device_reset() override; - UINT8 dack_r(int line); - void dack_w(int line, UINT8 data); + uint8_t dack_r(int line); + void dack_w(int line, uint8_t data); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual void drq16_w(int state) { } virtual void drq_w(int state) { } virtual void irq_w(int state, int source) { } virtual void mixer_reset() {} - void adpcm_decode(UINT8 sample, int size); + void adpcm_decode(uint8_t sample, int size); // serial overrides virtual void rcv_complete() override; // Rx completed receiving byte @@ -141,12 +141,12 @@ protected: static const int MIDI_RING_SIZE = 2048; struct sb8_dsp_state m_dsp; - UINT8 m_dack_out; - void xmit_char(UINT8 data); + uint8_t m_dack_out; + void xmit_char(uint8_t data); bool m_onebyte_midi, m_uart_midi, m_uart_irq, m_mpu_midi; int m_rx_waiting, m_tx_waiting; - UINT8 m_recvring[MIDI_RING_SIZE]; - UINT8 m_xmitring[MIDI_RING_SIZE]; + uint8_t m_recvring[MIDI_RING_SIZE]; + uint8_t m_xmitring[MIDI_RING_SIZE]; int m_xmit_read, m_xmit_write; int m_recv_read, m_recv_write; bool m_tx_busy; @@ -159,7 +159,7 @@ class sb8_device : public sb_device, { public: // construction/destruction - sb8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source); + sb8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname, const char *source); DECLARE_READ8_MEMBER(ym3812_16_r); DECLARE_WRITE8_MEMBER(ym3812_16_w); @@ -168,8 +168,8 @@ protected: virtual void device_start() override; virtual void drq_w(int state) override; virtual void irq_w(int state, int source) override; - virtual UINT8 dack_r(int line) override { return sb_device::dack_r(line); } - virtual void dack_w(int line, UINT8 data) override { sb_device::dack_w(line, data); } + virtual uint8_t dack_r(int line) override { return sb_device::dack_r(line); } + virtual void dack_w(int line, uint8_t data) override { sb_device::dack_w(line, data); } private: required_device m_ym3812; }; @@ -178,7 +178,7 @@ class isa8_sblaster1_0_device : public sb8_device { public: // construction/destruction - isa8_sblaster1_0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_sblaster1_0_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; @@ -200,7 +200,7 @@ class isa8_sblaster1_5_device : public sb8_device { public: // construction/destruction - isa8_sblaster1_5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_sblaster1_5_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; @@ -214,7 +214,7 @@ class sb16_device : public sb_device, { public: // construction/destruction - sb16_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source); + sb16_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname, const char *source); DECLARE_READ8_MEMBER(mpu401_r); DECLARE_WRITE8_MEMBER(mpu401_w); DECLARE_READ8_MEMBER(mixer_r); @@ -222,10 +222,10 @@ public: virtual ioport_constructor device_input_ports() const override; protected: virtual void device_start() override; - virtual UINT16 dack16_r(int line) override; - virtual UINT8 dack_r(int line) override { return sb_device::dack_r(line); } - virtual void dack_w(int line, UINT8 data) override { sb_device::dack_w(line, data); } - virtual void dack16_w(int line, UINT16 data) override; + virtual uint16_t dack16_r(int line) override; + virtual uint8_t dack_r(int line) override { return sb_device::dack_r(line); } + virtual void dack_w(int line, uint8_t data) override { sb_device::dack_w(line, data); } + virtual void dack16_w(int line, uint16_t data) override; virtual void drq16_w(int state) override; virtual void drq_w(int state) override; virtual void irq_w(int state, int source) override; @@ -240,7 +240,7 @@ class isa16_sblaster16_device : public sb16_device { public: // construction/destruction - isa16_sblaster16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_sblaster16_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; diff --git a/src/devices/bus/isa/sc499.cpp b/src/devices/bus/isa/sc499.cpp index aaf0d719d67..3d1e60f873d 100644 --- a/src/devices/bus/isa/sc499.cpp +++ b/src/devices/bus/isa/sc499.cpp @@ -314,7 +314,7 @@ const device_type SC499 = &device_creator; // sc499_device - constructor //------------------------------------------------- -sc499_device::sc499_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sc499_device::sc499_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SC499, "Archive SC-499", tag, owner, clock, "sc499", __FILE__), device_isa8_card_interface(mconfig, *this), m_iobase(*this, "IO_BASE"), @@ -441,7 +441,7 @@ void sc499_device::logerror(Format &&fmt, Params &&... args) const tape_status_clear - clear bits in tape status -------------------------------------------------*/ -void sc499_device::tape_status_clear(UINT16 value) +void sc499_device::tape_status_clear(uint16_t value) { m_tape_status &= ~value; tape_status_set(0); @@ -451,7 +451,7 @@ void sc499_device::tape_status_clear(UINT16 value) tape_status_set - set bits in tape status -------------------------------------------------*/ -void sc499_device::tape_status_set(UINT16 value) +void sc499_device::tape_status_set(uint16_t value) { m_tape_status |= value; m_tape_status &= ~(SC499_ST0 | SC499_ST1); @@ -487,7 +487,7 @@ void sc499_device::check_tape() { // tape has changed, get new size m_image_length = m_image->tapelen(); - m_ctape_block_count = (UINT32)((m_image_length + SC499_CTAPE_BLOCK_SIZE - 1) / SC499_CTAPE_BLOCK_SIZE); + m_ctape_block_count = (uint32_t)((m_image_length + SC499_CTAPE_BLOCK_SIZE - 1) / SC499_CTAPE_BLOCK_SIZE); } LOG1(("check_tape: tape image is %s with %d blocks", m_image->filename(), m_ctape_block_count)); @@ -695,7 +695,7 @@ void sc499_device::set_dma_drq(enum line_state state) // ------------------------------------- -void sc499_device::log_command(UINT8 data) +void sc499_device::log_command(uint8_t data) { switch (data) { @@ -738,7 +738,7 @@ void sc499_device::log_command(UINT8 data) } } -void sc499_device::do_command(UINT8 data) +void sc499_device::do_command(uint8_t data) { m_status |= SC499_STAT_RDY; m_status &= ~SC499_STAT_DON; @@ -866,15 +866,15 @@ void sc499_device::do_reset() // ------------------------------------- -void sc499_device::write_command_port(UINT8 data) +void sc499_device::write_command_port(uint8_t data) { m_command = data; log_command(data); } -UINT8 sc499_device::read_data_port() +uint8_t sc499_device::read_data_port() { - static UINT8 m_last_data = 0xff; + static uint8_t m_last_data = 0xff; // omit excessive logging if (m_last_data != m_data) @@ -892,7 +892,7 @@ UINT8 sc499_device::read_data_port() return m_data; } -void sc499_device::write_control_port( UINT8 data) +void sc499_device::write_control_port( uint8_t data) { LOG2(("write_control_port: %02x", data)); @@ -959,9 +959,9 @@ void sc499_device::write_control_port( UINT8 data) m_control = data; } -UINT8 sc499_device::read_status_port() +uint8_t sc499_device::read_status_port() { - static UINT8 m_last_status = 0xff; + static uint8_t m_last_status = 0xff; // omit excessive logging if (m_last_status != m_status) @@ -979,7 +979,7 @@ UINT8 sc499_device::read_status_port() // Start DMA (DMAGO). Any write to this register will cause DMAGO to be active. -void sc499_device::write_dma_go( UINT8 data) +void sc499_device::write_dma_go( uint8_t data) { LOG2(("write_dma_go: %02x", data)); @@ -1024,7 +1024,7 @@ void sc499_device::write_dma_go( UINT8 data) // Reset DMA (RSTDMA). Any write to this register will cause RSTDMA to be active. -void sc499_device::write_dma_reset( UINT8 data) +void sc499_device::write_dma_reset( uint8_t data) { LOG2(("write_dma_reset: %02x", data)); @@ -1056,7 +1056,7 @@ WRITE8_MEMBER(sc499_device::write) READ8_MEMBER(sc499_device::read) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (offset) { @@ -1101,9 +1101,9 @@ void sc499_device::eop_w(int state) } } -UINT8 sc499_device::dack_r(int line) +uint8_t sc499_device::dack_r(int line) { - UINT8 data; + uint8_t data; // set_dma_drq(CLEAR_LINE); @@ -1135,7 +1135,7 @@ UINT8 sc499_device::dack_r(int line) return data; } -void sc499_device::dack_w(int line, UINT8 data) +void sc499_device::dack_w(int line, uint8_t data) { LOG3(("dack_write: data=%x", data)); @@ -1185,7 +1185,7 @@ void sc499_device::log_block(const char *text) void sc499_device::read_block() { - UINT8 *tape; + uint8_t *tape; if (m_tape_pos == 0) { @@ -1272,7 +1272,7 @@ void sc499_device::write_block() int sc499_device::block_is_filemark() { - static const UINT8 fm_pattern[] = {0xDE, 0xAF, 0xFA, 0xED}; + static const uint8_t fm_pattern[] = {0xDE, 0xAF, 0xFA, 0xED}; int is_filemark = memcmp(&m_ctape_block_buffer[0], fm_pattern, 4) == 0 && memcmp(&m_ctape_block_buffer[0], &m_ctape_block_buffer[4], SC499_CTAPE_BLOCK_SIZE-4) == 0; @@ -1287,7 +1287,7 @@ int sc499_device::block_is_filemark() void sc499_device::block_set_filemark() { - static const UINT8 fm_pattern[] = {0xDE, 0xAF, 0xFA, 0xED}; + static const uint8_t fm_pattern[] = {0xDE, 0xAF, 0xFA, 0xED}; for (int i = 0; i < SC499_CTAPE_BLOCK_SIZE; i += 4) { memcpy(&m_ctape_block_buffer[i], fm_pattern, 4); @@ -1298,7 +1298,7 @@ void sc499_device::block_set_filemark() const device_type SC499_CTAPE = &device_creator; -sc499_ctape_image_device::sc499_ctape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sc499_ctape_image_device::sc499_ctape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SC499_CTAPE, "Cartridge Tape", tag, owner, clock, "sc499_ctape", __FILE__), device_image_interface(mconfig, *this) { @@ -1310,7 +1310,7 @@ void sc499_ctape_image_device::device_config_complete() } -UINT8 *sc499_ctape_image_device::read_block(int block_num) +uint8_t *sc499_ctape_image_device::read_block(int block_num) { // access beyond end of tape cart if (m_ctape_data.size() <= (block_num + 1) * SC499_CTAPE_BLOCK_SIZE) @@ -1319,7 +1319,7 @@ UINT8 *sc499_ctape_image_device::read_block(int block_num) return &m_ctape_data[block_num * SC499_CTAPE_BLOCK_SIZE]; } -void sc499_ctape_image_device::write_block(int block_num, UINT8 *ptr) +void sc499_ctape_image_device::write_block(int block_num, uint8_t *ptr) { if (!(m_ctape_data.size() <= (block_num + 1) * SC499_CTAPE_BLOCK_SIZE)) memcpy(&m_ctape_data[block_num * SC499_CTAPE_BLOCK_SIZE], ptr, SC499_CTAPE_BLOCK_SIZE); @@ -1327,7 +1327,7 @@ void sc499_ctape_image_device::write_block(int block_num, UINT8 *ptr) image_init_result sc499_ctape_image_device::call_load() { - UINT32 size; + uint32_t size; io_generic io; io.file = (device_image_interface *)this; io.procs = &image_ioprocs; diff --git a/src/devices/bus/isa/sc499.h b/src/devices/bus/isa/sc499.h index 7a832b53be2..a681c3b00bb 100644 --- a/src/devices/bus/isa/sc499.h +++ b/src/devices/bus/isa/sc499.h @@ -28,7 +28,7 @@ class sc499_ctape_image_device : public device_t, public device_image_interface { public: // construction/destruction - sc499_ctape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sc499_ctape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // image-level overrides virtual image_init_result call_load() override; @@ -44,16 +44,16 @@ public: virtual const char *image_interface() const override { return "sc499_cass"; } virtual const char *file_extensions() const override { return "act,ct"; } - UINT8 *read_block(int block_num); - void write_block(int block_num, UINT8 *ptr); - UINT64 tapelen() { return m_ctape_data.size(); } + uint8_t *read_block(int block_num); + void write_block(int block_num, uint8_t *ptr); + uint64_t tapelen() { return m_ctape_data.size(); } protected: // device-level overrides virtual void device_config_complete() override; virtual void device_start() override { }; - std::vector m_ctape_data; + std::vector m_ctape_data; }; // ======================> sc499_device @@ -62,7 +62,7 @@ class sc499_device: public device_t, public device_isa8_card_interface { public: // construction/destruction - sc499_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sc499_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_ioport m_iobase; required_ioport m_irqdrq; @@ -76,15 +76,15 @@ private: virtual ioport_constructor device_input_ports() const override; // ISA overrides - virtual UINT8 dack_r(int line) override; - virtual void dack_w(int line,UINT8 data) override; + virtual uint8_t dack_r(int line) override; + virtual void dack_w(int line,uint8_t data) override; virtual void eop_w(int state) override; const char *cpu_context(); template void logerror(Format &&fmt, Params &&... args) const; - void tape_status_clear(UINT16 value); - void tape_status_set(UINT16 value); + void tape_status_clear(uint16_t value); + void tape_status_set(uint16_t value); // device register I/O DECLARE_READ8_MEMBER(read); @@ -94,18 +94,18 @@ private: void set_interrupt(enum line_state state); - void log_command(UINT8 data); - void do_command(UINT8 data); + void log_command(uint8_t data); + void do_command(uint8_t data); void do_reset(); void set_dma_drq(enum line_state state); - void write_command_port( UINT8 data); - UINT8 read_data_port(); - void write_control_port( UINT8 data); - UINT8 read_status_port(); - void write_dma_go( UINT8 data); - void write_dma_reset( UINT8 data); + void write_command_port( uint8_t data); + uint8_t read_data_port(); + void write_control_port( uint8_t data); + uint8_t read_status_port(); + void write_dma_go( uint8_t data); + void write_dma_reset( uint8_t data); void log_block(const char * text); void read_block(); @@ -113,32 +113,32 @@ private: int block_is_filemark(); void block_set_filemark(); - UINT8 m_data; - UINT8 m_command; - UINT8 m_status; - UINT8 m_control; + uint8_t m_data; + uint8_t m_command; + uint8_t m_status; + uint8_t m_control; - UINT8 m_has_cartridge; - UINT8 m_is_writable; + uint8_t m_has_cartridge; + uint8_t m_is_writable; - UINT8 m_current_command; + uint8_t m_current_command; - UINT8 m_first_block_hack; - UINT8 m_nasty_readahead; - UINT8 m_read_block_pending; + uint8_t m_first_block_hack; + uint8_t m_nasty_readahead; + uint8_t m_read_block_pending; - UINT16 m_data_index; + uint16_t m_data_index; - UINT16 m_tape_status; /* Drive exception flags */ - UINT16 m_data_error_counter; /* data error count: nr of blocks rewritten/soft read errors */ - UINT16 m_underrun_counter; /* underrun count: nr of times streaming was interrupted */ + uint16_t m_tape_status; /* Drive exception flags */ + uint16_t m_data_error_counter; /* data error count: nr of blocks rewritten/soft read errors */ + uint16_t m_underrun_counter; /* underrun count: nr of times streaming was interrupted */ - UINT32 m_tape_pos; - UINT32 m_ctape_block_count; - UINT32 m_ctape_block_index; - UINT64 m_image_length; + uint32_t m_tape_pos; + uint32_t m_ctape_block_count; + uint32_t m_ctape_block_index; + uint64_t m_image_length; - std::vector m_ctape_block_buffer; + std::vector m_ctape_block_buffer; required_device m_image; enum line_state irq_state; diff --git a/src/devices/bus/isa/side116.cpp b/src/devices/bus/isa/side116.cpp index 2212ac3844d..5c120fe878b 100644 --- a/src/devices/bus/isa/side116.cpp +++ b/src/devices/bus/isa/side116.cpp @@ -86,7 +86,7 @@ const tiny_rom_entry *side116_device::device_rom_region() const // side116_device - constructor //------------------------------------------------- -side116_device::side116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +side116_device::side116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_SIDE116, "Acculogic sIDE-1/16 IDE Disk Controller", tag, owner, clock, "side116", __FILE__), device_isa8_card_interface( mconfig, *this ), m_ata(*this, "ata"), @@ -134,11 +134,11 @@ void side116_device::device_reset() READ8_MEMBER( side116_device::read ) { - UINT8 data; + uint8_t data; if (offset == 0) { - UINT16 ide_data = m_ata->read_cs0(space, 0, 0xffff); + uint16_t ide_data = m_ata->read_cs0(space, 0, 0xffff); data = ide_data & 0xff; m_latch = ide_data >> 8; } @@ -162,7 +162,7 @@ WRITE8_MEMBER( side116_device::write ) { if (offset == 0) { - UINT16 ide_data = (m_latch << 8) | data; + uint16_t ide_data = (m_latch << 8) | data; m_ata->write_cs0(space, 0, ide_data, 0xffff); } else if (offset < 8) @@ -181,7 +181,7 @@ WRITE8_MEMBER( side116_device::write ) WRITE_LINE_MEMBER( side116_device::ide_interrupt ) { - UINT8 level = m_config->read() & 0x18; + uint8_t level = m_config->read() & 0x18; if (level == 0x08) m_isa->irq2_w(state); diff --git a/src/devices/bus/isa/side116.h b/src/devices/bus/isa/side116.h index 2d7d2e19a1a..a3b775abc09 100644 --- a/src/devices/bus/isa/side116.h +++ b/src/devices/bus/isa/side116.h @@ -29,7 +29,7 @@ class side116_device : public device_t, { public: // construction/destruction - side116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + side116_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; @@ -49,7 +49,7 @@ protected: private: required_device m_ata; required_ioport m_config; - UINT8 m_latch; + uint8_t m_latch; }; diff --git a/src/devices/bus/isa/ssi2001.cpp b/src/devices/bus/isa/ssi2001.cpp index dec6751f887..5643464b8a0 100644 --- a/src/devices/bus/isa/ssi2001.cpp +++ b/src/devices/bus/isa/ssi2001.cpp @@ -18,7 +18,7 @@ machine_config_constructor ssi2001_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( ssi2001 ); } -ssi2001_device::ssi2001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ssi2001_device::ssi2001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_SSI2001, "Innovation SSI-2001 Audio Adapter", tag, owner, clock, "ssi2001", __FILE__), device_isa8_card_interface(mconfig, *this), m_joy(*this, "pc_joy"), diff --git a/src/devices/bus/isa/ssi2001.h b/src/devices/bus/isa/ssi2001.h index 8a58cbb8bf8..afdfc1f5175 100644 --- a/src/devices/bus/isa/ssi2001.h +++ b/src/devices/bus/isa/ssi2001.h @@ -19,7 +19,7 @@ class ssi2001_device : public device_t, { public: // construction/destruction - ssi2001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ssi2001_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; diff --git a/src/devices/bus/isa/stereo_fx.cpp b/src/devices/bus/isa/stereo_fx.cpp index b3877e423a0..1119f09e2eb 100644 --- a/src/devices/bus/isa/stereo_fx.cpp +++ b/src/devices/bus/isa/stereo_fx.cpp @@ -30,7 +30,7 @@ READ8_MEMBER( stereo_fx_device::p1_r ) READ8_MEMBER( stereo_fx_device::p3_r ) { - UINT8 ret = 0; + uint8_t ret = 0; ret |= m_data_out << 2; // INT0 ret |= m_data_in << 3; // INT1 @@ -147,14 +147,14 @@ WRITE8_MEMBER( stereo_fx_device::dsp_cmd_w ) m_in_byte = data; } -UINT8 stereo_fx_device::dack_r(int line) +uint8_t stereo_fx_device::dack_r(int line) { m_data_out = false; m_isa->drq1_w(0); return m_out_byte; } -void stereo_fx_device::dack_w(int line, UINT8 data) +void stereo_fx_device::dack_w(int line, uint8_t data) { m_data_in = true; m_isa->drq1_w(0); @@ -189,7 +189,7 @@ READ8_MEMBER( stereo_fx_device::invalid_r ) return 0xff; } -stereo_fx_device::stereo_fx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +stereo_fx_device::stereo_fx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_STEREO_FX, "ATI Stereo F/X Audio Adapter", tag, owner, clock, "stereo_fx", __FILE__), device_isa8_card_interface(mconfig, *this), m_joy(*this, "pc_joy"), diff --git a/src/devices/bus/isa/stereo_fx.h b/src/devices/bus/isa/stereo_fx.h index 56ac6d1f74b..1be1fa0ddb0 100644 --- a/src/devices/bus/isa/stereo_fx.h +++ b/src/devices/bus/isa/stereo_fx.h @@ -20,7 +20,7 @@ class stereo_fx_device : public device_t, { public: // construction/destruction - stereo_fx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + stereo_fx_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; @@ -55,20 +55,20 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - UINT8 dack_r(int line) override; - void dack_w(int line, UINT8 data) override; + uint8_t dack_r(int line) override; + void dack_w(int line, uint8_t data) override; private: // internal state bool m_data_in; - UINT8 m_in_byte; + uint8_t m_in_byte; bool m_data_out; - UINT8 m_out_byte; + uint8_t m_out_byte; - UINT8 m_port20; - UINT8 m_port00; + uint8_t m_port20; + uint8_t m_port00; emu_timer *m_timer; - UINT8 m_t0; - UINT8 m_t1; + uint8_t m_t0; + uint8_t m_t1; }; // device type definition diff --git a/src/devices/bus/isa/svga_cirrus.cpp b/src/devices/bus/isa/svga_cirrus.cpp index de3ecaa8bd9..1343d08e612 100644 --- a/src/devices/bus/isa/svga_cirrus.cpp +++ b/src/devices/bus/isa/svga_cirrus.cpp @@ -59,7 +59,7 @@ const tiny_rom_entry *isa16_svga_cirrus_device::device_rom_region() const // isa16_vga_device - constructor //------------------------------------------------- -isa16_svga_cirrus_device::isa16_svga_cirrus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_svga_cirrus_device::isa16_svga_cirrus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_SVGA_CIRRUS, "Diamond Speedstar Pro SE ISA Graphics Card (BIOS v1.00)", tag, owner, clock, "dm_clgd5430", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr) { @@ -145,7 +145,7 @@ const tiny_rom_entry *isa16_svga_cirrus_gd542x_device::device_rom_region() const // isa16_vga_device - constructor //------------------------------------------------- -isa16_svga_cirrus_gd542x_device::isa16_svga_cirrus_gd542x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_svga_cirrus_gd542x_device::isa16_svga_cirrus_gd542x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_SVGA_CIRRUS_GD542X, "Generic Cirrus Logic GD542x Graphics Card (BIOS v1.20)", tag, owner, clock, "clgd542x", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr) { diff --git a/src/devices/bus/isa/svga_cirrus.h b/src/devices/bus/isa/svga_cirrus.h index c46d7630285..1f89bd1ed22 100644 --- a/src/devices/bus/isa/svga_cirrus.h +++ b/src/devices/bus/isa/svga_cirrus.h @@ -19,7 +19,7 @@ class isa16_svga_cirrus_device : { public: // construction/destruction - isa16_svga_cirrus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_svga_cirrus_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; @@ -40,7 +40,7 @@ class isa16_svga_cirrus_gd542x_device : { public: // construction/destruction - isa16_svga_cirrus_gd542x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_svga_cirrus_gd542x_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; diff --git a/src/devices/bus/isa/svga_s3.cpp b/src/devices/bus/isa/svga_s3.cpp index 9e37a29f55c..cf539a0b8e3 100644 --- a/src/devices/bus/isa/svga_s3.cpp +++ b/src/devices/bus/isa/svga_s3.cpp @@ -70,7 +70,7 @@ const tiny_rom_entry *isa16_svga_s3_device::device_rom_region() const // isa16_vga_device - constructor //------------------------------------------------- -isa16_svga_s3_device::isa16_svga_s3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_svga_s3_device::isa16_svga_s3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_SVGA_S3, "Number Nine 9FX Vision 330 (S3 764) Graphics Card", tag, owner, clock, "s3_764", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr), m_8514(nullptr) { @@ -182,7 +182,7 @@ const tiny_rom_entry *isa16_s3virge_device::device_rom_region() const // isa16_vga_device - constructor //------------------------------------------------- -isa16_s3virge_device::isa16_s3virge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_s3virge_device::isa16_s3virge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_S3VIRGE, "S3 ViRGE Graphics Card", tag, owner, clock, "s3virge", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr) { @@ -269,7 +269,7 @@ const tiny_rom_entry *isa16_s3virgedx_device::device_rom_region() const // isa16_vga_device - constructor //------------------------------------------------- -isa16_s3virgedx_device::isa16_s3virgedx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_s3virgedx_device::isa16_s3virgedx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_S3VIRGEDX, "S3 ViRGE/DX Graphics Card", tag, owner, clock, "s3virgedx", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr) { @@ -357,7 +357,7 @@ const tiny_rom_entry *isa16_stealth3d2kpro_device::device_rom_region() const // isa16_vga_device - constructor //------------------------------------------------- -isa16_stealth3d2kpro_device::isa16_stealth3d2kpro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_stealth3d2kpro_device::isa16_stealth3d2kpro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_DMS3D2KPRO, "Diamond Stealth 3D 2000 Pro", tag, owner, clock, "dms3d2kp", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr) { diff --git a/src/devices/bus/isa/svga_s3.h b/src/devices/bus/isa/svga_s3.h index 92c824e0339..4b940dfb2d7 100644 --- a/src/devices/bus/isa/svga_s3.h +++ b/src/devices/bus/isa/svga_s3.h @@ -22,7 +22,7 @@ class isa16_svga_s3_device : { public: // construction/destruction - isa16_svga_s3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_svga_s3_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; @@ -44,7 +44,7 @@ class isa16_s3virge_device : { public: // construction/destruction - isa16_s3virge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_s3virge_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; @@ -65,7 +65,7 @@ class isa16_s3virgedx_device : { public: // construction/destruction - isa16_s3virgedx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_s3virgedx_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; @@ -86,7 +86,7 @@ class isa16_stealth3d2kpro_device : { public: // construction/destruction - isa16_stealth3d2kpro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_stealth3d2kpro_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; diff --git a/src/devices/bus/isa/svga_trident.cpp b/src/devices/bus/isa/svga_trident.cpp index e4dd7005d37..e12eb1153c8 100644 --- a/src/devices/bus/isa/svga_trident.cpp +++ b/src/devices/bus/isa/svga_trident.cpp @@ -61,7 +61,7 @@ const tiny_rom_entry *isa16_svga_tgui9680_device::device_rom_region() const // isa8_vga_device - constructor //------------------------------------------------- -isa16_svga_tgui9680_device::isa16_svga_tgui9680_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_svga_tgui9680_device::isa16_svga_tgui9680_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_SVGA_TGUI9680, "Trident TGUI9680 Graphics Card (BIOS X5.5 (02) 02/13/96)", tag, owner, clock, "tgui9680", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr) { diff --git a/src/devices/bus/isa/svga_trident.h b/src/devices/bus/isa/svga_trident.h index 3ee4a192d27..b50134af3a1 100644 --- a/src/devices/bus/isa/svga_trident.h +++ b/src/devices/bus/isa/svga_trident.h @@ -26,7 +26,7 @@ class isa16_svga_tgui9680_device : { public: // construction/destruction - isa16_svga_tgui9680_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_svga_tgui9680_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; diff --git a/src/devices/bus/isa/svga_tseng.cpp b/src/devices/bus/isa/svga_tseng.cpp index ad5acfe9243..c71a6f9a82c 100644 --- a/src/devices/bus/isa/svga_tseng.cpp +++ b/src/devices/bus/isa/svga_tseng.cpp @@ -59,7 +59,7 @@ const tiny_rom_entry *isa8_svga_et4k_device::device_rom_region() const // isa8_vga_device - constructor //------------------------------------------------- -isa8_svga_et4k_device::isa8_svga_et4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_svga_et4k_device::isa8_svga_et4k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_SVGA_ET4K, "SVGA Tseng ET4000 Graphics Card", tag, owner, clock, "et4000", __FILE__), device_isa8_card_interface(mconfig, *this), m_vga(nullptr) { diff --git a/src/devices/bus/isa/svga_tseng.h b/src/devices/bus/isa/svga_tseng.h index 32093785de6..7bba5348e71 100644 --- a/src/devices/bus/isa/svga_tseng.h +++ b/src/devices/bus/isa/svga_tseng.h @@ -21,7 +21,7 @@ class isa8_svga_et4k_device : { public: // construction/destruction - isa8_svga_et4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_svga_et4k_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; diff --git a/src/devices/bus/isa/trident.cpp b/src/devices/bus/isa/trident.cpp index b97f35abc78..5f97774ceba 100644 --- a/src/devices/bus/isa/trident.cpp +++ b/src/devices/bus/isa/trident.cpp @@ -20,41 +20,41 @@ const device_type TVGA9000_VGA = &device_creator; #define LOG (1) #define LOG_ACCEL (1) -trident_vga_device::trident_vga_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) +trident_vga_device::trident_vga_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) : svga_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -tgui9860_device::tgui9860_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tgui9860_device::tgui9860_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : trident_vga_device(mconfig, TRIDENT_VGA, "Trident TGUI9680", tag, owner, clock, "trident_vga", __FILE__) { m_version = 0xd3; // 0xd3 identifies at TGUI9660XGi (set to 0xe3 to identify at TGUI9440AGi) } -tvga9000_device::tvga9000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tvga9000_device::tvga9000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : trident_vga_device(mconfig, TVGA9000_VGA, "Trident TVGA9000", tag, owner, clock, "tvga9000_vga", __FILE__) { m_version = 0x43; } -UINT8 trident_vga_device::READPIXEL8(INT16 x, INT16 y) +uint8_t trident_vga_device::READPIXEL8(int16_t x, int16_t y) { return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)) % vga.svga_intf.vram_size]); } -UINT16 trident_vga_device::READPIXEL15(INT16 x, INT16 y) +uint16_t trident_vga_device::READPIXEL15(int16_t x, int16_t y) { return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*2) % vga.svga_intf.vram_size] | (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8)); } -UINT16 trident_vga_device::READPIXEL16(INT16 x, INT16 y) +uint16_t trident_vga_device::READPIXEL16(int16_t x, int16_t y) { return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*2) % vga.svga_intf.vram_size] | (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8)); } -UINT32 trident_vga_device::READPIXEL32(INT16 x, INT16 y) +uint32_t trident_vga_device::READPIXEL32(int16_t x, int16_t y) { return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*4) % vga.svga_intf.vram_size] | (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+1) % vga.svga_intf.vram_size] << 8) | @@ -62,7 +62,7 @@ UINT32 trident_vga_device::READPIXEL32(INT16 x, INT16 y) (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+3) % vga.svga_intf.vram_size] << 24)); } -void trident_vga_device::WRITEPIXEL8(INT16 x, INT16 y, UINT8 data) +void trident_vga_device::WRITEPIXEL8(int16_t x, int16_t y, uint8_t data) { if((x & 0xfff)> 8) & 0xff) | (data & 0xff))); // XFree86 3.3 sets bits 0-7 to 0 when using mono patterns, does it OR each byte? @@ -207,9 +207,9 @@ void trident_vga_device::device_reset() tri.pixel_depth = 0x10; //disable 8bpp mode by default } -UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 cur_mode; + uint8_t cur_mode; svga_device::screen_update(screen,bitmap,cliprect); cur_mode = pc_vga_choosevideomode(); @@ -217,15 +217,15 @@ UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bi // draw hardware graphics cursor if(tri.cursor_ctrl & 0x80) // if cursor is enabled { - UINT32 src; - UINT32* dst; - UINT8 val; + uint32_t src; + uint32_t* dst; + uint8_t val; int x,y; - UINT16 cx = tri.cursor_x & 0x0fff; - UINT16 cy = tri.cursor_y & 0x0fff; - UINT32 bg_col; - UINT32 fg_col; - UINT8 cursor_size = (tri.cursor_ctrl & 0x01) ? 64 : 32; + uint16_t cx = tri.cursor_x & 0x0fff; + uint16_t cy = tri.cursor_y & 0x0fff; + uint32_t bg_col; + uint32_t fg_col; + uint8_t cursor_size = (tri.cursor_ctrl & 0x01) ? 64 : 32; if(cur_mode == SCREEN_OFF || cur_mode == TEXT_MODE || cur_mode == MONO_MODE || cur_mode == CGA_MODE || cur_mode == EGA_MODE) return 0; // cursor only works in VGA or SVGA modes @@ -245,15 +245,15 @@ UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bi for(y=0;y> 7; @@ -401,9 +401,9 @@ void trident_vga_device::trident_define_video_mode() recompute_params_clock(divisor, xtal); } -UINT8 trident_vga_device::trident_seq_reg_read(UINT8 index) +uint8_t trident_vga_device::trident_seq_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; res = 0xff; @@ -450,7 +450,7 @@ UINT8 trident_vga_device::trident_seq_reg_read(UINT8 index) return res; } -void trident_vga_device::trident_seq_reg_write(UINT8 index, UINT8 data) +void trident_vga_device::trident_seq_reg_write(uint8_t index, uint8_t data) { vga.sequencer.data[vga.sequencer.index] = data; if(index <= 0x04) @@ -509,9 +509,9 @@ void trident_vga_device::trident_seq_reg_write(UINT8 index, UINT8 data) if(LOG) logerror("Trident SR%02X: %s mode write %02x\n",index,tri.new_mode ? "new" : "old",data); } -UINT8 trident_vga_device::trident_crtc_reg_read(UINT8 index) +uint8_t trident_vga_device::trident_crtc_reg_read(uint8_t index) { - UINT8 res = 0; + uint8_t res = 0; if(index <= 0x18) res = crtc_reg_read(index); @@ -613,7 +613,7 @@ UINT8 trident_vga_device::trident_crtc_reg_read(UINT8 index) if(LOG) logerror("Trident CR%02X: read %02x\n",index,res); return res; } -void trident_vga_device::trident_crtc_reg_write(UINT8 index, UINT8 data) +void trident_vga_device::trident_crtc_reg_write(uint8_t index, uint8_t data) { if(index <= 0x18) { @@ -723,9 +723,9 @@ void trident_vga_device::trident_crtc_reg_write(UINT8 index, UINT8 data) if(LOG) logerror("Trident CR%02X: write %02x\n",index,data); } -UINT8 trident_vga_device::trident_gc_reg_read(UINT8 index) +uint8_t trident_vga_device::trident_gc_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; if(index <= 0x0d) res = gc_reg_read(index); @@ -752,7 +752,7 @@ UINT8 trident_vga_device::trident_gc_reg_read(UINT8 index) return res; } -void trident_vga_device::trident_gc_reg_write(UINT8 index, UINT8 data) +void trident_vga_device::trident_gc_reg_write(uint8_t index, uint8_t data) { if(index <= 0x0d) gc_reg_write(index,data); @@ -786,7 +786,7 @@ void trident_vga_device::trident_gc_reg_write(UINT8 index, UINT8 data) READ8_MEMBER(trident_vga_device::port_03c0_r) { - UINT8 res; + uint8_t res; switch(offset) { @@ -857,7 +857,7 @@ WRITE8_MEMBER(trident_vga_device::port_03c0_w) READ8_MEMBER(trident_vga_device::port_03d0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3d0) { @@ -939,7 +939,7 @@ WRITE8_MEMBER(trident_vga_device::port_03d0_w) READ8_MEMBER(trident_vga_device::port_43c6_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; switch(offset) { case 2: @@ -997,7 +997,7 @@ WRITE8_MEMBER(trident_vga_device::port_43c6_w) // Not much else is known. XFree86 uses register 4 for something related to DPMS READ8_MEMBER(trident_vga_device::port_83c6_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; switch(offset) { case 2: @@ -1110,13 +1110,13 @@ WRITE8_MEMBER(trident_vga_device::mem_w) } // Old style MMIO (maps to 0xbff00) -void trident_vga_device::old_mmio_w(address_space& space, UINT32 offset, UINT8 data) +void trident_vga_device::old_mmio_w(address_space& space, uint32_t offset, uint8_t data) { if(offset >= 0x20) accel_w(space,offset-0x20,data); } -UINT8 trident_vga_device::old_mmio_r(address_space& space, UINT32 offset) +uint8_t trident_vga_device::old_mmio_r(address_space& space, uint32_t offset) { if(offset == 0x20) { @@ -1194,7 +1194,7 @@ Graphics Engine for 9440/9660/9680 READ8_MEMBER(trident_vga_device::accel_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if(offset >= 0x60) return tri.accel_pattern[(offset-0x60) % 0x80]; @@ -1561,13 +1561,13 @@ void trident_vga_device::accel_bitblt() void trident_vga_device::accel_line() { - UINT32 col = tri.accel_fgcolour; + uint32_t col = tri.accel_fgcolour; // TGUI_SRC_XY(dmin-dmaj,dmin); // TGUI_DEST_XY(x,y); // TGUI_DIM_XY(dmin+e,len); - INT16 dx = tri.accel_source_y - tri.accel_source_x; - INT16 dy = tri.accel_source_y; - INT16 err = tri.accel_dim_x + tri.accel_source_y; + int16_t dx = tri.accel_source_y - tri.accel_source_x; + int16_t dy = tri.accel_source_y; + int16_t err = tri.accel_dim_x + tri.accel_source_y; int sx = (tri.accel_drawflags & 0x0200) ? -1 : 1; int sy = (tri.accel_drawflags & 0x0100) ? -1 : 1; int x,y,z; @@ -1600,7 +1600,7 @@ void trident_vga_device::accel_line() } // feed data written to VRAM to an active BitBLT command -void trident_vga_device::accel_data_write(UINT32 data) +void trident_vga_device::accel_data_write(uint32_t data) { int xdir = 1,ydir = 1; diff --git a/src/devices/bus/isa/trident.h b/src/devices/bus/isa/trident.h index 47ba8d3f8e4..63ef51aa36a 100644 --- a/src/devices/bus/isa/trident.h +++ b/src/devices/bus/isa/trident.h @@ -16,7 +16,7 @@ class trident_vga_device : public svga_device { public: // construction/destruction - trident_vga_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); + trident_vga_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 READ8_MEMBER(port_03c0_r) override; virtual WRITE8_MEMBER(port_03c0_w) override; @@ -30,12 +30,12 @@ public: DECLARE_WRITE8_MEMBER(vram_w); virtual READ8_MEMBER(mem_r) override; virtual WRITE8_MEMBER(mem_w) override; - virtual UINT16 offset() override; + virtual uint16_t offset() override; DECLARE_READ8_MEMBER(accel_r); DECLARE_WRITE8_MEMBER(accel_w); - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; protected: virtual void device_start() override; @@ -43,120 +43,120 @@ protected: struct { - UINT8 sr0c; - UINT8 sr0d_old; - UINT8 sr0d_new; - UINT8 sr0e_old; - UINT8 sr0e_new; - UINT8 sr0f; - UINT8 gc0e; - UINT8 gc0f; - UINT8 gc2f; - UINT8 cr1e; - UINT8 cr1f; - UINT8 cr20; - UINT8 cr21; - UINT8 cr29; - UINT8 cr2a; - UINT8 cr39; - UINT8 dac; - UINT8 lutdac_reg[0x100]; - UINT8 lutdac_index; + uint8_t sr0c; + uint8_t sr0d_old; + uint8_t sr0d_new; + uint8_t sr0e_old; + uint8_t sr0e_new; + uint8_t sr0f; + uint8_t gc0e; + uint8_t gc0f; + uint8_t gc2f; + uint8_t cr1e; + uint8_t cr1f; + uint8_t cr20; + uint8_t cr21; + uint8_t cr29; + uint8_t cr2a; + uint8_t cr39; + uint8_t dac; + uint8_t lutdac_reg[0x100]; + uint8_t lutdac_index; bool new_mode; bool port_3c3; - UINT8 port_3db; - UINT8 clock; - UINT8 pixel_depth; - UINT8 revision; + uint8_t port_3db; + uint8_t clock; + uint8_t pixel_depth; + uint8_t revision; bool dac_active; - UINT8 dac_count; - UINT32 linear_address; + uint8_t dac_count; + uint32_t linear_address; bool linear_active; bool mmio_active; - UINT16 mem_clock; // I/O 0x43c6 - UINT16 vid_clock; // I/O 0x43c8 - UINT16 cursor_x; - UINT16 cursor_y; - UINT16 cursor_loc; - UINT8 cursor_x_off; - UINT8 cursor_y_off; - UINT32 cursor_fg; // colour - UINT32 cursor_bg; // colour - UINT8 cursor_ctrl; + uint16_t mem_clock; // I/O 0x43c6 + uint16_t vid_clock; // I/O 0x43c8 + uint16_t cursor_x; + uint16_t cursor_y; + uint16_t cursor_loc; + uint8_t cursor_x_off; + uint8_t cursor_y_off; + uint32_t cursor_fg; // colour + uint32_t cursor_bg; // colour + uint8_t cursor_ctrl; // 2D acceleration - UINT16 accel_opermode; - UINT8 accel_command; - UINT8 accel_fmix; - UINT32 accel_drawflags; - UINT32 accel_fgcolour; - UINT32 accel_bgcolour; - UINT16 accel_pattern_loc; - INT16 accel_source_x; - INT16 accel_source_y; - INT16 accel_dest_x; - INT16 accel_dest_y; - INT16 accel_dim_x; - INT16 accel_dim_y; - UINT32 accel_style; - UINT32 accel_ckey; - INT16 accel_source_x_clip; - INT16 accel_source_y_clip; - INT16 accel_dest_x_clip; - INT16 accel_dest_y_clip; - UINT32 accel_fg_pattern_colour; - UINT32 accel_bg_pattern_colour; - UINT8 accel_pattern[0x80]; + uint16_t accel_opermode; + uint8_t accel_command; + uint8_t accel_fmix; + uint32_t accel_drawflags; + uint32_t accel_fgcolour; + uint32_t accel_bgcolour; + uint16_t accel_pattern_loc; + int16_t accel_source_x; + int16_t accel_source_y; + int16_t accel_dest_x; + int16_t accel_dest_y; + int16_t accel_dim_x; + int16_t accel_dim_y; + uint32_t accel_style; + uint32_t accel_ckey; + int16_t accel_source_x_clip; + int16_t accel_source_y_clip; + int16_t accel_dest_x_clip; + int16_t accel_dest_y_clip; + uint32_t accel_fg_pattern_colour; + uint32_t accel_bg_pattern_colour; + uint8_t accel_pattern[0x80]; bool accel_busy; bool accel_memwrite_active; // true when writing to VRAM will push data to an ongoing command (SRCMONO/PATMONO) - INT16 accel_mem_x; - INT16 accel_mem_y; - UINT32 accel_transfer; + int16_t accel_mem_x; + int16_t accel_mem_y; + uint32_t accel_transfer; } tri; - UINT8 m_version; + uint8_t m_version; private: - UINT8 trident_seq_reg_read(UINT8 index); - void trident_seq_reg_write(UINT8 index, UINT8 data); + uint8_t trident_seq_reg_read(uint8_t index); + void trident_seq_reg_write(uint8_t index, uint8_t data); void trident_define_video_mode(); - UINT8 trident_crtc_reg_read(UINT8 index); - void trident_crtc_reg_write(UINT8 index, UINT8 data); - UINT8 trident_gc_reg_read(UINT8 index); - void trident_gc_reg_write(UINT8 index, UINT8 data); + uint8_t trident_crtc_reg_read(uint8_t index); + void trident_crtc_reg_write(uint8_t index, uint8_t data); + uint8_t trident_gc_reg_read(uint8_t index); + void trident_gc_reg_write(uint8_t index, uint8_t data); int calculate_clock(); // old style MMIO (0xBFF00) - void old_mmio_w(address_space& space, UINT32 offset, UINT8 data); - UINT8 old_mmio_r(address_space& space, UINT32 offset); + void old_mmio_w(address_space& space, uint32_t offset, uint8_t data); + uint8_t old_mmio_r(address_space& space, uint32_t offset); // 2D acceleration void accel_command(); void accel_bitblt(); void accel_line(); - void accel_data_write(UINT32 data); - UINT8 READPIXEL8(INT16 x, INT16 y); - UINT16 READPIXEL15(INT16 x, INT16 y); - UINT16 READPIXEL16(INT16 x, INT16 y); - UINT32 READPIXEL32(INT16 x, INT16 y); - void WRITEPIXEL8(INT16 x, INT16 y, UINT8 data); - void WRITEPIXEL15(INT16 x, INT16 y, UINT16 data); - void WRITEPIXEL16(INT16 x, INT16 y, UINT16 data); - void WRITEPIXEL32(INT16 x, INT16 y, UINT32 data); - UINT32 READPIXEL(INT16 x,INT16 y); - void WRITEPIXEL(INT16 x,INT16 y, UINT32 data); - UINT32 handle_rop(UINT32 src, UINT32 dst); + void accel_data_write(uint32_t data); + uint8_t READPIXEL8(int16_t x, int16_t y); + uint16_t READPIXEL15(int16_t x, int16_t y); + uint16_t READPIXEL16(int16_t x, int16_t y); + uint32_t READPIXEL32(int16_t x, int16_t y); + void WRITEPIXEL8(int16_t x, int16_t y, uint8_t data); + void WRITEPIXEL15(int16_t x, int16_t y, uint16_t data); + void WRITEPIXEL16(int16_t x, int16_t y, uint16_t data); + void WRITEPIXEL32(int16_t x, int16_t y, uint32_t data); + uint32_t READPIXEL(int16_t x,int16_t y); + void WRITEPIXEL(int16_t x,int16_t y, uint32_t data); + uint32_t handle_rop(uint32_t src, uint32_t dst); }; class tgui9860_device : public trident_vga_device { public: - tgui9860_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tgui9860_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tvga9000_device : public trident_vga_device { public: - tvga9000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tvga9000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // device type definition diff --git a/src/devices/bus/isa/vga.cpp b/src/devices/bus/isa/vga.cpp index c47b7c516fd..371ec5d899c 100644 --- a/src/devices/bus/isa/vga.cpp +++ b/src/devices/bus/isa/vga.cpp @@ -49,7 +49,7 @@ const tiny_rom_entry *isa8_vga_device::device_rom_region() const // isa8_vga_device - constructor //------------------------------------------------- -isa8_vga_device::isa8_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_vga_device::isa8_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_VGA, "IBM VGA Graphics Card", tag, owner, clock, "ibm_vga", __FILE__), device_isa8_card_interface(mconfig, *this), m_vga(nullptr) { diff --git a/src/devices/bus/isa/vga.h b/src/devices/bus/isa/vga.h index e850e0e4929..6a9b785d5ec 100644 --- a/src/devices/bus/isa/vga.h +++ b/src/devices/bus/isa/vga.h @@ -21,7 +21,7 @@ class isa8_vga_device : { public: // construction/destruction - isa8_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_vga_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; diff --git a/src/devices/bus/isa/vga_ati.cpp b/src/devices/bus/isa/vga_ati.cpp index 0a9867964c5..57be162e365 100644 --- a/src/devices/bus/isa/vga_ati.cpp +++ b/src/devices/bus/isa/vga_ati.cpp @@ -146,19 +146,19 @@ const tiny_rom_entry *isa16_vga_mach64_device::device_rom_region() const // isa8_vga_device - constructor //------------------------------------------------- -isa16_vga_gfxultra_device::isa16_vga_gfxultra_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_vga_gfxultra_device::isa16_vga_gfxultra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_VGA_GFXULTRA, "ATi Graphics Ultra Card", tag, owner, clock, "gfxultra", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr), m_8514(nullptr) { } -isa16_vga_gfxultrapro_device::isa16_vga_gfxultrapro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_vga_gfxultrapro_device::isa16_vga_gfxultrapro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_SVGA_GFXULTRAPRO, "ATi Graphics Ultra Pro Card", tag, owner, clock, "gfxultrp", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr) { } -isa16_vga_mach64_device::isa16_vga_mach64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa16_vga_mach64_device::isa16_vga_mach64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA16_SVGA_MACH64, "ATi mach64 Card", tag, owner, clock, "mach64", __FILE__), device_isa16_card_interface(mconfig, *this), m_vga(nullptr) { diff --git a/src/devices/bus/isa/vga_ati.h b/src/devices/bus/isa/vga_ati.h index 5a400e11c24..45b2696b75a 100644 --- a/src/devices/bus/isa/vga_ati.h +++ b/src/devices/bus/isa/vga_ati.h @@ -29,7 +29,7 @@ class isa16_vga_gfxultra_device : { public: // construction/destruction - isa16_vga_gfxultra_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_vga_gfxultra_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,7 +51,7 @@ class isa16_vga_gfxultrapro_device : { public: // construction/destruction - isa16_vga_gfxultrapro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_vga_gfxultrapro_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; @@ -72,7 +72,7 @@ class isa16_vga_mach64_device : { public: // construction/destruction - isa16_vga_mach64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa16_vga_mach64_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; diff --git a/src/devices/bus/isa/wd1002a_wx1.cpp b/src/devices/bus/isa/wd1002a_wx1.cpp index 151418882db..53fc146898c 100644 --- a/src/devices/bus/isa/wd1002a_wx1.cpp +++ b/src/devices/bus/isa/wd1002a_wx1.cpp @@ -45,7 +45,7 @@ const tiny_rom_entry *isa8_wd1002a_wx1_device::device_rom_region() const // isa8_wd1002a_wx1_device - constructor //------------------------------------------------- -isa8_wd1002a_wx1_device::isa8_wd1002a_wx1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +isa8_wd1002a_wx1_device::isa8_wd1002a_wx1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_WD1002A_WX1, "WD1002A-WX1", tag, owner, clock, "wd1002a_wx1", __FILE__), device_isa8_card_interface( mconfig, *this ) { diff --git a/src/devices/bus/isa/wd1002a_wx1.h b/src/devices/bus/isa/wd1002a_wx1.h index 3bb361849d3..e6ca7cbf438 100644 --- a/src/devices/bus/isa/wd1002a_wx1.h +++ b/src/devices/bus/isa/wd1002a_wx1.h @@ -27,7 +27,7 @@ class isa8_wd1002a_wx1_device : public device_t, { public: // construction/destruction - isa8_wd1002a_wx1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_wd1002a_wx1_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; diff --git a/src/devices/bus/isa/wdxt_gen.cpp b/src/devices/bus/isa/wdxt_gen.cpp index f7d0523a036..518e081f6ab 100644 --- a/src/devices/bus/isa/wdxt_gen.cpp +++ b/src/devices/bus/isa/wdxt_gen.cpp @@ -189,7 +189,7 @@ machine_config_constructor wdxt_gen_device::device_mconfig_additions() const // wdxt_gen_device - constructor //------------------------------------------------- -wdxt_gen_device::wdxt_gen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +wdxt_gen_device::wdxt_gen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_WDXT_GEN, "Western Digital WDXT-GEN (Amstrad PC1512/1640)", tag, owner, clock, "wdxt_gen", __FILE__), device_isa8_card_interface(mconfig, *this), m_maincpu(*this, WD1015_TAG), @@ -227,7 +227,7 @@ void wdxt_gen_device::device_reset() // dack_r - //------------------------------------------------- -UINT8 wdxt_gen_device::dack_r(int line) +uint8_t wdxt_gen_device::dack_r(int line) { return m_host->dack_r(); } @@ -237,7 +237,7 @@ UINT8 wdxt_gen_device::dack_r(int line) // dack_w - //------------------------------------------------- -void wdxt_gen_device::dack_w(int line, UINT8 data) +void wdxt_gen_device::dack_w(int line, uint8_t data) { m_host->dack_w(data); } @@ -283,7 +283,7 @@ READ8_MEMBER( wdxt_gen_device::wd1015_p1_r ) */ - UINT8 data = 0; + uint8_t data = 0; logerror("%s P1 read %02x\n", machine().describe_context(), data); @@ -339,7 +339,7 @@ READ8_MEMBER( wdxt_gen_device::wd1015_p2_r ) */ - UINT8 data = 0x40; + uint8_t data = 0x40; data |= m_host->ecc_not_0_r() << 7; diff --git a/src/devices/bus/isa/wdxt_gen.h b/src/devices/bus/isa/wdxt_gen.h index e1beb34267a..9f3fcdeaa5d 100644 --- a/src/devices/bus/isa/wdxt_gen.h +++ b/src/devices/bus/isa/wdxt_gen.h @@ -39,7 +39,7 @@ class wdxt_gen_device : public device_t, { public: // construction/destruction - wdxt_gen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wdxt_gen_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; @@ -65,17 +65,17 @@ protected: virtual void device_reset() override; // device_isa8_card_interface - virtual UINT8 dack_r(int line) override; - virtual void dack_w(int line, UINT8 data) override; + virtual uint8_t dack_r(int line) override; + virtual void dack_w(int line, uint8_t data) override; private: required_device m_maincpu; required_device m_host; required_device m_hdc; - UINT8 m_ram[0x800]; + uint8_t m_ram[0x800]; - //UINT8 m_hdc_addr; + //uint8_t m_hdc_addr; }; diff --git a/src/devices/bus/isa/xtide.cpp b/src/devices/bus/isa/xtide.cpp index 2861484d8a1..f28b23e24b0 100644 --- a/src/devices/bus/isa/xtide.cpp +++ b/src/devices/bus/isa/xtide.cpp @@ -58,11 +58,11 @@ Device Control (out) 14 7 READ8_MEMBER( xtide_device::read ) { - UINT8 result; + uint8_t result; if (offset == 0) { - UINT16 data16 = m_ata->read_cs0(space, offset & 7, 0xffff); + uint16_t data16 = m_ata->read_cs0(space, offset & 7, 0xffff); result = data16 & 0xff; m_d8_d15_latch = data16 >> 8; } @@ -91,7 +91,7 @@ WRITE8_MEMBER( xtide_device::write ) if (offset == 0) { // Data register transfer low byte and latched high - UINT16 data16 = (m_d8_d15_latch << 8) | data; + uint16_t data16 = (m_d8_d15_latch << 8) | data; m_ata->write_cs0(space, offset & 7, data16, 0xffff); } else if (offset < 8) @@ -299,7 +299,7 @@ const tiny_rom_entry *xtide_device::device_rom_region() const // xtide_device - constructor //------------------------------------------------- -xtide_device::xtide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +xtide_device::xtide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISA8_XTIDE, "XT-IDE Fixed Drive Adapter", tag, owner, clock, "isa8_xtide", __FILE__), device_isa8_card_interface( mconfig, *this ), m_ata(*this, "ata"), diff --git a/src/devices/bus/isa/xtide.h b/src/devices/bus/isa/xtide.h index 9b5775a26c3..b8a05f25ae2 100644 --- a/src/devices/bus/isa/xtide.h +++ b/src/devices/bus/isa/xtide.h @@ -19,7 +19,7 @@ class xtide_device : public device_t, { public: // construction/destruction - xtide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + xtide_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; @@ -40,8 +40,8 @@ private: required_device m_ata; required_device m_eeprom; - UINT8 m_irq_number; - UINT8 m_d8_d15_latch; + uint8_t m_irq_number; + uint8_t m_d8_d15_latch; }; diff --git a/src/devices/bus/isbx/compis_fdc.cpp b/src/devices/bus/isbx/compis_fdc.cpp index 19a0f0bf231..2282734e2c3 100644 --- a/src/devices/bus/isbx/compis_fdc.cpp +++ b/src/devices/bus/isbx/compis_fdc.cpp @@ -81,7 +81,7 @@ machine_config_constructor compis_fdc_device::device_mconfig_additions() const // compis_fdc_device - constructor //------------------------------------------------- -compis_fdc_device::compis_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +compis_fdc_device::compis_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COMPIS_FDC, "Compis FDC", tag, owner, clock, "compis_fdc", __FILE__), device_isbx_card_interface(mconfig, *this), m_fdc(*this, I8272_TAG), @@ -114,9 +114,9 @@ void compis_fdc_device::device_reset() // mcs0_r - chip select 0 read //------------------------------------------------- -UINT8 compis_fdc_device::mcs0_r(address_space &space, offs_t offset) +uint8_t compis_fdc_device::mcs0_r(address_space &space, offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (BIT(offset, 0)) { @@ -132,7 +132,7 @@ UINT8 compis_fdc_device::mcs0_r(address_space &space, offs_t offset) // mcs0_w - chip select 0 write //------------------------------------------------- -void compis_fdc_device::mcs0_w(address_space &space, offs_t offset, UINT8 data) +void compis_fdc_device::mcs0_w(address_space &space, offs_t offset, uint8_t data) { switch (BIT(offset, 0)) { @@ -145,7 +145,7 @@ void compis_fdc_device::mcs0_w(address_space &space, offs_t offset, UINT8 data) // mdack_r - DMA acknowledge read //------------------------------------------------- -UINT8 compis_fdc_device::mdack_r(address_space &space, offs_t offset) +uint8_t compis_fdc_device::mdack_r(address_space &space, offs_t offset) { return m_fdc->dma_r(); } @@ -155,7 +155,7 @@ UINT8 compis_fdc_device::mdack_r(address_space &space, offs_t offset) // mdack_w - DMA acknowledge write //------------------------------------------------- -void compis_fdc_device::mdack_w(address_space &space, offs_t offset, UINT8 data) +void compis_fdc_device::mdack_w(address_space &space, offs_t offset, uint8_t data) { m_fdc->dma_w(data); } diff --git a/src/devices/bus/isbx/compis_fdc.h b/src/devices/bus/isbx/compis_fdc.h index d97bc4eb468..e36a342f864 100644 --- a/src/devices/bus/isbx/compis_fdc.h +++ b/src/devices/bus/isbx/compis_fdc.h @@ -29,7 +29,7 @@ class compis_fdc_device : public device_t, { public: // construction/destruction - compis_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + compis_fdc_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; @@ -44,10 +44,10 @@ protected: virtual void device_reset() override; // device_isbx_card_interface overrides - virtual UINT8 mcs0_r(address_space &space, offs_t offset) override; - virtual void mcs0_w(address_space &space, offs_t offset, UINT8 data) override; - virtual UINT8 mdack_r(address_space &space, offs_t offset) override; - virtual void mdack_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t mcs0_r(address_space &space, offs_t offset) override; + virtual void mcs0_w(address_space &space, offs_t offset, uint8_t data) override; + virtual uint8_t mdack_r(address_space &space, offs_t offset) override; + virtual void mdack_w(address_space &space, offs_t offset, uint8_t data) override; virtual void opt0_w(int state) override; virtual void opt1_w(int state) override; diff --git a/src/devices/bus/isbx/isbc_218a.cpp b/src/devices/bus/isbx/isbc_218a.cpp index bb1eea2b194..7af071f0217 100644 --- a/src/devices/bus/isbx/isbc_218a.cpp +++ b/src/devices/bus/isbx/isbc_218a.cpp @@ -79,7 +79,7 @@ machine_config_constructor isbc_218a_device::device_mconfig_additions() const // isbc_218a_device - constructor //------------------------------------------------- -isbc_218a_device::isbc_218a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isbc_218a_device::isbc_218a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISBC_218A, "ISBX 218a for ISBC", tag, owner, clock, "isbc_218a", __FILE__), device_isbx_card_interface(mconfig, *this), m_fdc(*this, I8272_TAG), @@ -112,9 +112,9 @@ void isbc_218a_device::device_reset() // mcs0_r - chip select 0 read //------------------------------------------------- -UINT8 isbc_218a_device::mcs0_r(address_space &space, offs_t offset) +uint8_t isbc_218a_device::mcs0_r(address_space &space, offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (BIT(offset, 0)) { @@ -130,7 +130,7 @@ UINT8 isbc_218a_device::mcs0_r(address_space &space, offs_t offset) // mcs0_w - chip select 0 write //------------------------------------------------- -void isbc_218a_device::mcs0_w(address_space &space, offs_t offset, UINT8 data) +void isbc_218a_device::mcs0_w(address_space &space, offs_t offset, uint8_t data) { switch (BIT(offset, 0)) { @@ -143,9 +143,9 @@ void isbc_218a_device::mcs0_w(address_space &space, offs_t offset, UINT8 data) // mcs1_r - chip select 1 read //------------------------------------------------- -UINT8 isbc_218a_device::mcs1_r(address_space &space, offs_t offset) +uint8_t isbc_218a_device::mcs1_r(address_space &space, offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (offset) { @@ -160,7 +160,7 @@ UINT8 isbc_218a_device::mcs1_r(address_space &space, offs_t offset) // mcs1_w - chip select 1 write //------------------------------------------------- -void isbc_218a_device::mcs1_w(address_space &space, offs_t offset, UINT8 data) +void isbc_218a_device::mcs1_w(address_space &space, offs_t offset, uint8_t data) { switch (offset) { @@ -182,7 +182,7 @@ void isbc_218a_device::mcs1_w(address_space &space, offs_t offset, UINT8 data) // mdack_r - DMA acknowledge read //------------------------------------------------- -UINT8 isbc_218a_device::mdack_r(address_space &space, offs_t offset) +uint8_t isbc_218a_device::mdack_r(address_space &space, offs_t offset) { return m_fdc->dma_r(); } @@ -192,7 +192,7 @@ UINT8 isbc_218a_device::mdack_r(address_space &space, offs_t offset) // mdack_w - DMA acknowledge write //------------------------------------------------- -void isbc_218a_device::mdack_w(address_space &space, offs_t offset, UINT8 data) +void isbc_218a_device::mdack_w(address_space &space, offs_t offset, uint8_t data) { m_fdc->dma_w(data); } diff --git a/src/devices/bus/isbx/isbc_218a.h b/src/devices/bus/isbx/isbc_218a.h index 5fc354a725f..d83d61249dd 100644 --- a/src/devices/bus/isbx/isbc_218a.h +++ b/src/devices/bus/isbx/isbc_218a.h @@ -29,7 +29,7 @@ class isbc_218a_device : public device_t, { public: // construction/destruction - isbc_218a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isbc_218a_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; @@ -44,12 +44,12 @@ protected: virtual void device_reset() override; // device_isbx_card_interface overrides - virtual UINT8 mcs0_r(address_space &space, offs_t offset) override; - virtual void mcs0_w(address_space &space, offs_t offset, UINT8 data) override; - virtual UINT8 mcs1_r(address_space &space, offs_t offset) override; - virtual void mcs1_w(address_space &space, offs_t offset, UINT8 data) override; - virtual UINT8 mdack_r(address_space &space, offs_t offset) override; - virtual void mdack_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t mcs0_r(address_space &space, offs_t offset) override; + virtual void mcs0_w(address_space &space, offs_t offset, uint8_t data) override; + virtual uint8_t mcs1_r(address_space &space, offs_t offset) override; + virtual void mcs1_w(address_space &space, offs_t offset, uint8_t data) override; + virtual uint8_t mdack_r(address_space &space, offs_t offset) override; + virtual void mdack_w(address_space &space, offs_t offset, uint8_t data) override; virtual void opt0_w(int state) override; private: diff --git a/src/devices/bus/isbx/isbx.cpp b/src/devices/bus/isbx/isbx.cpp index e71aa5e5454..b6031278fb2 100644 --- a/src/devices/bus/isbx/isbx.cpp +++ b/src/devices/bus/isbx/isbx.cpp @@ -37,7 +37,7 @@ device_isbx_card_interface::device_isbx_card_interface(const machine_config &mco // isbx_slot_device - constructor //------------------------------------------------- -isbx_slot_device::isbx_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isbx_slot_device::isbx_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISBX_SLOT, "iSBX bus slot", tag, owner, clock, "isbx_slot", __FILE__), device_slot_interface(mconfig, *this), m_write_mintr0(*this), diff --git a/src/devices/bus/isbx/isbx.h b/src/devices/bus/isbx/isbx.h index cb90fbd27b1..6522eeb6617 100644 --- a/src/devices/bus/isbx/isbx.h +++ b/src/devices/bus/isbx/isbx.h @@ -77,12 +77,12 @@ public: // construction/destruction device_isbx_card_interface(const machine_config &mconfig, device_t &device); - virtual UINT8 mcs0_r(address_space &space, offs_t offset) { return 0xff; } - virtual void mcs0_w(address_space &space, offs_t offset, UINT8 data) { } - virtual UINT8 mcs1_r(address_space &space, offs_t offset) { return 0xff; } - virtual void mcs1_w(address_space &space, offs_t offset, UINT8 data) { } - virtual UINT8 mdack_r(address_space &space, offs_t offset) { return 0xff; } - virtual void mdack_w(address_space &space, offs_t offset, UINT8 data) { } + virtual uint8_t mcs0_r(address_space &space, offs_t offset) { return 0xff; } + virtual void mcs0_w(address_space &space, offs_t offset, uint8_t data) { } + virtual uint8_t mcs1_r(address_space &space, offs_t offset) { return 0xff; } + virtual void mcs1_w(address_space &space, offs_t offset, uint8_t data) { } + virtual uint8_t mdack_r(address_space &space, offs_t offset) { return 0xff; } + virtual void mdack_w(address_space &space, offs_t offset, uint8_t data) { } virtual int opt0_r() { return 1; } virtual void opt0_w(int state) { } virtual int opt1_r() { return 1; } @@ -102,7 +102,7 @@ class isbx_slot_device : public device_t, { public: // construction/destruction - isbx_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isbx_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_mintr0_callback(_mintr0 mintr0) { m_write_mintr0.set_callback(mintr0); } template void set_mintr1_callback(_mintr1 mintr1) { m_write_mintr1.set_callback(mintr1); } diff --git a/src/devices/bus/kc/d002.cpp b/src/devices/bus/kc/d002.cpp index fdb36a8c34d..10d2290344f 100644 --- a/src/devices/bus/kc/d002.cpp +++ b/src/devices/bus/kc/d002.cpp @@ -108,7 +108,7 @@ const device_type KC_D002 = &device_creator; // kc_d002_device - constructor //------------------------------------------------- -kc_d002_device::kc_d002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_d002_device::kc_d002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KC_D002, "D002 Bus Driver", tag, owner, clock, "kc_d002", __FILE__), device_kcexp_interface( mconfig, *this ), m_slot(nullptr) { @@ -159,7 +159,7 @@ ioport_constructor kc_d002_device::device_input_ports() const // read //------------------------------------------------- -void kc_d002_device::read(offs_t offset, UINT8 &data) +void kc_d002_device::read(offs_t offset, uint8_t &data) { for (auto & elem : m_expansions) elem->read(offset, data); @@ -169,7 +169,7 @@ void kc_d002_device::read(offs_t offset, UINT8 &data) // write //------------------------------------------------- -void kc_d002_device::write(offs_t offset, UINT8 data) +void kc_d002_device::write(offs_t offset, uint8_t data) { for (auto & elem : m_expansions) elem->write(offset, data); @@ -179,11 +179,11 @@ void kc_d002_device::write(offs_t offset, UINT8 data) // IO read //------------------------------------------------- -void kc_d002_device::io_read(offs_t offset, UINT8 &data) +void kc_d002_device::io_read(offs_t offset, uint8_t &data) { if ((offset & 0xff) == 0x80) { - UINT8 slot_id = (offset>>8) & 0xff; + uint8_t slot_id = (offset>>8) & 0xff; if ((slot_id & 0xf0) == ioport("ID")->read() && !(slot_id & 0x03)) data = m_expansions[(slot_id>>2) & 3]->module_id_r(); @@ -201,11 +201,11 @@ void kc_d002_device::io_read(offs_t offset, UINT8 &data) // IO write //------------------------------------------------- -void kc_d002_device::io_write(offs_t offset, UINT8 data) +void kc_d002_device::io_write(offs_t offset, uint8_t data) { if ((offset & 0xff) == 0x80) { - UINT8 slot_id = (offset>>8) & 0xff; + uint8_t slot_id = (offset>>8) & 0xff; if ((slot_id & 0xf0) == ioport("ID")->read() && !(slot_id & 0x03)) m_expansions[(slot_id>>2) & 3]->control_w(data); diff --git a/src/devices/bus/kc/d002.h b/src/devices/bus/kc/d002.h index 00c85448643..22454791f36 100644 --- a/src/devices/bus/kc/d002.h +++ b/src/devices/bus/kc/d002.h @@ -23,7 +23,7 @@ class kc_d002_device : { public: // construction/destruction - kc_d002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_d002_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; @@ -40,10 +40,10 @@ protected: virtual void device_reset() override; // kcexp_interface overrides - virtual void read(offs_t offset, UINT8 &data) override; - virtual void write(offs_t offset, UINT8 data) override; - virtual void io_read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void write(offs_t offset, uint8_t data) override; + virtual void io_read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; virtual DECLARE_WRITE_LINE_MEMBER( mei_w ) override; private: diff --git a/src/devices/bus/kc/d004.cpp b/src/devices/bus/kc/d004.cpp index cab28b21297..d698ec9b970 100644 --- a/src/devices/bus/kc/d004.cpp +++ b/src/devices/bus/kc/d004.cpp @@ -128,7 +128,7 @@ const device_type KC_D004_GIDE = &device_creator; // kc_d004_device - constructor //------------------------------------------------- -kc_d004_device::kc_d004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_d004_device::kc_d004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KC_D004, "D004 Floppy Disk Interface", tag, owner, clock, "kc_d004", __FILE__), device_kcexp_interface( mconfig, *this ), m_cpu(*this, Z80_TAG), @@ -141,7 +141,7 @@ kc_d004_device::kc_d004_device(const machine_config &mconfig, const char *tag, d { } -kc_d004_device::kc_d004_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) +kc_d004_device::kc_d004_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_kcexp_interface( mconfig, *this ), m_cpu(*this, Z80_TAG), @@ -215,7 +215,7 @@ void kc_d004_device::device_timer(emu_timer &timer, device_timer_id id, int para set module status -------------------------------------------------*/ -void kc_d004_device::control_w(UINT8 data) +void kc_d004_device::control_w(uint8_t data) { m_enabled = BIT(data, 0); m_connected = BIT(data, 2); @@ -226,7 +226,7 @@ void kc_d004_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kc_d004_device::read(offs_t offset, UINT8 &data) +void kc_d004_device::read(offs_t offset, uint8_t &data) { if (offset >= m_rom_base && offset < (m_rom_base + 0x2000) && m_enabled) data = m_rom[offset & 0x1fff]; @@ -236,11 +236,11 @@ void kc_d004_device::read(offs_t offset, UINT8 &data) // IO read //------------------------------------------------- -void kc_d004_device::io_read(offs_t offset, UINT8 &data) +void kc_d004_device::io_read(offs_t offset, uint8_t &data) { if ((offset & 0xff) == 0x80) { - UINT8 slot_id = (offset>>8) & 0xff; + uint8_t slot_id = (offset>>8) & 0xff; if (slot_id == 0xfc) data = module_id_r(); @@ -266,11 +266,11 @@ void kc_d004_device::io_read(offs_t offset, UINT8 &data) // IO write //------------------------------------------------- -void kc_d004_device::io_write(offs_t offset, UINT8 data) +void kc_d004_device::io_write(offs_t offset, uint8_t data) { if ((offset & 0xff) == 0x80) { - UINT8 slot_id = (offset>>8) & 0xff; + uint8_t slot_id = (offset>>8) & 0xff; if (slot_id == 0xfc) control_w(data); @@ -325,7 +325,7 @@ READ8_MEMBER(kc_d004_device::hw_input_gate_r) bit 4: Index pulse from disc */ - UINT8 hw_input_gate = 0x0f; + uint8_t hw_input_gate = 0x0f; if (m_floppy && !m_floppy->idx_r()) hw_input_gate |= 0x10; @@ -382,7 +382,7 @@ WRITE_LINE_MEMBER(kc_d004_device::fdc_irq) // kc_d004_gide_device - constructor //------------------------------------------------- -kc_d004_gide_device::kc_d004_gide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_d004_gide_device::kc_d004_gide_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kc_d004_device(mconfig, KC_D004, "D004 Floppy Disk + GIDE Interface", tag, owner, clock, "kc_d004gide", __FILE__), m_ata(*this, ATA_TAG), m_ata_data(0), m_lh(0) { @@ -425,12 +425,12 @@ void kc_d004_gide_device::device_reset() READ8_MEMBER(kc_d004_gide_device::gide_r) { - UINT8 data = 0xff; - UINT8 io_addr = offset & 0x0f; + uint8_t data = 0xff; + uint8_t io_addr = offset & 0x0f; if (io_addr == 0x05) { - UINT8 rtc_addr = (offset >> 8) & 0x0f; + uint8_t rtc_addr = (offset >> 8) & 0x0f; // TODO RTC-72421 logerror("GIDE %s read RTC 0x%02x\n", tag(), rtc_addr); @@ -474,11 +474,11 @@ READ8_MEMBER(kc_d004_gide_device::gide_r) WRITE8_MEMBER(kc_d004_gide_device::gide_w) { - UINT8 io_addr = offset & 0x0f; + uint8_t io_addr = offset & 0x0f; if (io_addr == 0x05) { - UINT8 rtc_addr = (offset >> 8) & 0x0f; + uint8_t rtc_addr = (offset >> 8) & 0x0f; // TODO RTC-72421 logerror("GIDE %s wrire RTC 0x%02x 0x%02x\n", tag(), rtc_addr, data); diff --git a/src/devices/bus/kc/d004.h b/src/devices/bus/kc/d004.h index d8eb1d4fad0..cbdd5eb8426 100644 --- a/src/devices/bus/kc/d004.h +++ b/src/devices/bus/kc/d004.h @@ -26,8 +26,8 @@ class kc_d004_device : { public: // construction/destruction - kc_d004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - kc_d004_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); + kc_d004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + kc_d004_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -42,11 +42,11 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0xa7; } - virtual void control_w(UINT8 data) override; - virtual void read(offs_t offset, UINT8 &data) override; - virtual void io_read(offs_t offset, UINT8 &data) override; - virtual void io_write(offs_t offset, UINT8 data) override; + virtual uint8_t module_id_r() override { return 0xa7; } + virtual void control_w(uint8_t data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void io_read(offs_t offset, uint8_t &data) override; + virtual void io_write(offs_t offset, uint8_t data) override; public: DECLARE_READ8_MEMBER(hw_input_gate_r); @@ -64,16 +64,16 @@ private: required_device m_floppy1; required_device m_floppy2; required_device m_floppy3; - required_shared_ptr m_koppel_ram; + required_shared_ptr m_koppel_ram; // internal state emu_timer * m_reset_timer; - UINT8 * m_rom; - //UINT8 m_hw_input_gate; - UINT16 m_rom_base; - UINT8 m_enabled; - UINT8 m_connected; + uint8_t * m_rom; + //uint8_t m_hw_input_gate; + uint16_t m_rom_base; + uint8_t m_enabled; + uint8_t m_connected; floppy_image_device *m_floppy; }; @@ -86,7 +86,7 @@ class kc_d004_gide_device : { public: // construction/destruction - kc_d004_gide_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_d004_gide_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; @@ -103,7 +103,7 @@ public: private: required_device m_ata; - UINT16 m_ata_data; + uint16_t m_ata_data; int m_lh; }; diff --git a/src/devices/bus/kc/kc.cpp b/src/devices/bus/kc/kc.cpp index bd379fd064e..ea0f9d36e36 100644 --- a/src/devices/bus/kc/kc.cpp +++ b/src/devices/bus/kc/kc.cpp @@ -152,7 +152,7 @@ device_kcexp_interface::~device_kcexp_interface() //------------------------------------------------- // kcexp_slot_device - constructor //------------------------------------------------- -kcexp_slot_device::kcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +kcexp_slot_device::kcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KCEXP_SLOT, "KC85 Expansion Slot", tag, owner, clock, "kcexp_slot", __FILE__), device_slot_interface(mconfig, *this), m_out_irq_cb(*this), @@ -161,7 +161,7 @@ kcexp_slot_device::kcexp_slot_device(const machine_config &mconfig, const char * { } -kcexp_slot_device::kcexp_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +kcexp_slot_device::kcexp_slot_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_slot_interface(mconfig, *this), m_out_irq_cb(*this), @@ -205,9 +205,9 @@ void kcexp_slot_device::device_start() module id read -------------------------------------------------*/ -UINT8 kcexp_slot_device::module_id_r() +uint8_t kcexp_slot_device::module_id_r() { - UINT8 result = 0xff; + uint8_t result = 0xff; if (m_cart) result = m_cart->module_id_r(); @@ -218,7 +218,7 @@ UINT8 kcexp_slot_device::module_id_r() /*------------------------------------------------- module control write -------------------------------------------------*/ -void kcexp_slot_device::control_w(UINT8 data) +void kcexp_slot_device::control_w(uint8_t data) { if (m_cart) m_cart->control_w(data); @@ -228,7 +228,7 @@ void kcexp_slot_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kcexp_slot_device::read(offs_t offset, UINT8 &data) +void kcexp_slot_device::read(offs_t offset, uint8_t &data) { if (m_cart) m_cart->read(offset, data); @@ -239,7 +239,7 @@ void kcexp_slot_device::read(offs_t offset, UINT8 &data) write -------------------------------------------------*/ -void kcexp_slot_device::write(offs_t offset, UINT8 data) +void kcexp_slot_device::write(offs_t offset, uint8_t data) { if (m_cart) m_cart->write(offset, data); @@ -249,7 +249,7 @@ void kcexp_slot_device::write(offs_t offset, UINT8 data) IO read -------------------------------------------------*/ -void kcexp_slot_device::io_read(offs_t offset, UINT8 &data) +void kcexp_slot_device::io_read(offs_t offset, uint8_t &data) { if (m_cart) m_cart->io_read(offset, data); @@ -260,7 +260,7 @@ void kcexp_slot_device::io_read(offs_t offset, UINT8 &data) IO write -------------------------------------------------*/ -void kcexp_slot_device::io_write(offs_t offset, UINT8 data) +void kcexp_slot_device::io_write(offs_t offset, uint8_t data) { if (m_cart) m_cart->io_write(offset, data); @@ -298,7 +298,7 @@ WRITE_LINE_MEMBER( kcexp_slot_device::meo_w ) //------------------------------------------------- // kccart_slot_device - constructor //------------------------------------------------- -kccart_slot_device::kccart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +kccart_slot_device::kccart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kcexp_slot_device(mconfig, KCCART_SLOT, "KC85 Cartridge Slot", tag, owner, clock, "kccart_slot", __FILE__), device_image_interface(mconfig, *this) { @@ -333,7 +333,7 @@ image_init_result kccart_slot_device::call_load() if (m_cart) { offs_t read_length; - UINT8 *cart_base = m_cart->get_cart_base(); + uint8_t *cart_base = m_cart->get_cart_base(); if (cart_base != nullptr) { diff --git a/src/devices/bus/kc/kc.h b/src/devices/bus/kc/kc.h index 6f5e30f4943..5084c2a13d2 100644 --- a/src/devices/bus/kc/kc.h +++ b/src/devices/bus/kc/kc.h @@ -27,13 +27,13 @@ public: virtual ~device_kcexp_interface(); // reading and writing - virtual UINT8 module_id_r() { return 0xff; } - virtual void control_w(UINT8 data) { } - virtual void read(offs_t offset, UINT8 &data) { } - virtual void write(offs_t offset, UINT8 data) { } - virtual void io_read(offs_t offset, UINT8 &data) { } - virtual void io_write(offs_t offset, UINT8 data) { } - virtual UINT8* get_cart_base() { return nullptr; } + virtual uint8_t module_id_r() { return 0xff; } + virtual void control_w(uint8_t data) { } + virtual void read(offs_t offset, uint8_t &data) { } + virtual void write(offs_t offset, uint8_t data) { } + virtual void io_read(offs_t offset, uint8_t &data) { } + virtual void io_write(offs_t offset, uint8_t data) { } + virtual uint8_t* get_cart_base() { return nullptr; } virtual DECLARE_WRITE_LINE_MEMBER( mei_w ) { }; }; @@ -44,8 +44,8 @@ class kcexp_slot_device : public device_t, { public: // construction/destruction - kcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - kcexp_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + kcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + kcexp_slot_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 ~kcexp_slot_device(); template static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_cb.set_callback(object); } @@ -59,12 +59,12 @@ public: static void static_set_next_slot(device_t &device, const char *next_module_tag); // reading and writing - virtual UINT8 module_id_r(); - virtual void control_w(UINT8 data); - virtual void read(offs_t offset, UINT8 &data); - virtual void write(offs_t offset, UINT8 data); - virtual void io_read(offs_t offset, UINT8 &data); - virtual void io_write(offs_t offset, UINT8 data); + virtual uint8_t module_id_r(); + virtual void control_w(uint8_t data); + virtual void read(offs_t offset, uint8_t &data); + virtual void write(offs_t offset, uint8_t data); + virtual void io_read(offs_t offset, uint8_t &data); + virtual void io_write(offs_t offset, uint8_t data); virtual DECLARE_WRITE_LINE_MEMBER( mei_w ); virtual DECLARE_WRITE_LINE_MEMBER( meo_w ); @@ -85,7 +85,7 @@ class kccart_slot_device : public kcexp_slot_device, { public: // construction/destruction - kccart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kccart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~kccart_slot_device(); // device-level overrides diff --git a/src/devices/bus/kc/ram.cpp b/src/devices/bus/kc/ram.cpp index c10b99d0d70..577d0c0a194 100644 --- a/src/devices/bus/kc/ram.cpp +++ b/src/devices/bus/kc/ram.cpp @@ -42,13 +42,13 @@ const device_type KC_M036 = &device_creator; // kc_m011_device - constructor //------------------------------------------------- -kc_m011_device::kc_m011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_m011_device::kc_m011_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KC_M011, "M011 64KB RAM", tag, owner, clock, "kc_m011", __FILE__), device_kcexp_interface( mconfig, *this ), m_slot(nullptr), m_mei(0), m_ram(nullptr), m_enabled(0), m_write_enabled(0), m_base(0), m_segment(0) { } -kc_m011_device::kc_m011_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) +kc_m011_device::kc_m011_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_kcexp_interface( mconfig, *this ), m_slot(nullptr), m_mei(0), m_ram(nullptr), m_enabled(0), m_write_enabled(0), m_base(0), m_segment(0) { @@ -82,7 +82,7 @@ void kc_m011_device::device_reset() /*------------------------------------------------- module control write -------------------------------------------------*/ -void kc_m011_device::control_w(UINT8 data) +void kc_m011_device::control_w(uint8_t data) { if (m_mei) { @@ -96,9 +96,9 @@ void kc_m011_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kc_m011_device::read(offs_t offset, UINT8 &data) +void kc_m011_device::read(offs_t offset, uint8_t &data) { - UINT32 addr = offset ^ m_base; + uint32_t addr = offset ^ m_base; if (addr < 0x10000 && m_enabled && m_mei) { @@ -113,9 +113,9 @@ void kc_m011_device::read(offs_t offset, UINT8 &data) write -------------------------------------------------*/ -void kc_m011_device::write(offs_t offset, UINT8 data) +void kc_m011_device::write(offs_t offset, uint8_t data) { - UINT32 addr = offset ^ m_base; + uint32_t addr = offset ^ m_base; if (addr < 0x10000 && m_enabled && m_mei) { @@ -147,7 +147,7 @@ WRITE_LINE_MEMBER( kc_m011_device::mei_w ) // kc_m022_device - constructor //------------------------------------------------- -kc_m022_device::kc_m022_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_m022_device::kc_m022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kc_m011_device(mconfig, KC_M022, "M022 16KB RAM", tag, owner, clock, "kc_m022", __FILE__) { } @@ -156,7 +156,7 @@ kc_m022_device::kc_m022_device(const machine_config &mconfig, const char *tag, d read -------------------------------------------------*/ -void kc_m022_device::read(offs_t offset, UINT8 &data) +void kc_m022_device::read(offs_t offset, uint8_t &data) { if (offset >= m_base && offset < (m_base + 0x4000) && m_enabled && m_mei) { @@ -171,7 +171,7 @@ void kc_m022_device::read(offs_t offset, UINT8 &data) write -------------------------------------------------*/ -void kc_m022_device::write(offs_t offset, UINT8 data) +void kc_m022_device::write(offs_t offset, uint8_t data) { if (offset >= m_base && offset < (m_base + 0x4000) && m_enabled && m_mei) { @@ -192,7 +192,7 @@ void kc_m022_device::write(offs_t offset, UINT8 data) // kc_m032_device - constructor //------------------------------------------------- -kc_m032_device::kc_m032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_m032_device::kc_m032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kc_m011_device(mconfig, KC_M032, "M032 256KB segmented RAM", tag, owner, clock, "kc_m032", __FILE__) { } @@ -210,7 +210,7 @@ void kc_m032_device::device_reset() /*------------------------------------------------- module control write -------------------------------------------------*/ -void kc_m032_device::control_w(UINT8 data) +void kc_m032_device::control_w(uint8_t data) { if (m_mei) { @@ -225,7 +225,7 @@ void kc_m032_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kc_m032_device::read(offs_t offset, UINT8 &data) +void kc_m032_device::read(offs_t offset, uint8_t &data) { if (offset >= m_base && offset < (m_base + 0x4000) && m_enabled && m_mei) { @@ -240,7 +240,7 @@ void kc_m032_device::read(offs_t offset, UINT8 &data) write -------------------------------------------------*/ -void kc_m032_device::write(offs_t offset, UINT8 data) +void kc_m032_device::write(offs_t offset, uint8_t data) { if (offset >= m_base && offset < (m_base + 0x4000) && m_enabled && m_mei) { @@ -261,7 +261,7 @@ void kc_m032_device::write(offs_t offset, UINT8 data) // kc_m034_device - constructor //------------------------------------------------- -kc_m034_device::kc_m034_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_m034_device::kc_m034_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kc_m011_device(mconfig, KC_M034, "M034 512KB segmented RAM", tag, owner, clock, "kc_m034", __FILE__) { } @@ -279,7 +279,7 @@ void kc_m034_device::device_reset() /*------------------------------------------------- module control write -------------------------------------------------*/ -void kc_m034_device::control_w(UINT8 data) +void kc_m034_device::control_w(uint8_t data) { if (m_mei) { @@ -294,7 +294,7 @@ void kc_m034_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kc_m034_device::read(offs_t offset, UINT8 &data) +void kc_m034_device::read(offs_t offset, uint8_t &data) { if (offset >= m_base && offset < (m_base + 0x4000) && m_enabled && m_mei) { @@ -309,7 +309,7 @@ void kc_m034_device::read(offs_t offset, UINT8 &data) write -------------------------------------------------*/ -void kc_m034_device::write(offs_t offset, UINT8 data) +void kc_m034_device::write(offs_t offset, uint8_t data) { if (offset >= m_base && offset < (m_base + 0x4000) && m_enabled && m_mei) { @@ -330,7 +330,7 @@ void kc_m034_device::write(offs_t offset, UINT8 data) // kc_m035_device - constructor //------------------------------------------------- -kc_m035_device::kc_m035_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_m035_device::kc_m035_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kc_m011_device(mconfig, KC_M035, "M035 1MB segmented RAM", tag, owner, clock, "kc_m035", __FILE__) { } @@ -338,7 +338,7 @@ kc_m035_device::kc_m035_device(const machine_config &mconfig, const char *tag, d /*------------------------------------------------- module control write -------------------------------------------------*/ -void kc_m035_device::control_w(UINT8 data) +void kc_m035_device::control_w(uint8_t data) { if (m_mei) { @@ -352,7 +352,7 @@ void kc_m035_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kc_m035_device::read(offs_t offset, UINT8 &data) +void kc_m035_device::read(offs_t offset, uint8_t &data) { if (offset >= 0x8000 && offset < 0xc000 && m_enabled & m_mei) { @@ -367,7 +367,7 @@ void kc_m035_device::read(offs_t offset, UINT8 &data) write -------------------------------------------------*/ -void kc_m035_device::write(offs_t offset, UINT8 data) +void kc_m035_device::write(offs_t offset, uint8_t data) { if (offset >= 0x8000 && offset < 0xc000 && m_enabled && m_mei) { @@ -388,7 +388,7 @@ void kc_m035_device::write(offs_t offset, UINT8 data) // kc_m036_device - constructor //------------------------------------------------- -kc_m036_device::kc_m036_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_m036_device::kc_m036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kc_m011_device(mconfig, KC_M036, "M036 128KB segmented RAM", tag, owner, clock, "kc_m036", __FILE__) { } @@ -406,7 +406,7 @@ void kc_m036_device::device_reset() /*------------------------------------------------- module control write -------------------------------------------------*/ -void kc_m036_device::control_w(UINT8 data) +void kc_m036_device::control_w(uint8_t data) { if (m_mei) { @@ -421,7 +421,7 @@ void kc_m036_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kc_m036_device::read(offs_t offset, UINT8 &data) +void kc_m036_device::read(offs_t offset, uint8_t &data) { if (offset >= m_base && offset < (m_base + 0x4000) && m_enabled && m_mei) { @@ -436,7 +436,7 @@ void kc_m036_device::read(offs_t offset, UINT8 &data) write -------------------------------------------------*/ -void kc_m036_device::write(offs_t offset, UINT8 data) +void kc_m036_device::write(offs_t offset, uint8_t data) { if (offset >= m_base && offset < (m_base + 0x4000) && m_enabled && m_mei) { diff --git a/src/devices/bus/kc/ram.h b/src/devices/bus/kc/ram.h index 0cc441a5fa0..856d26b8016 100644 --- a/src/devices/bus/kc/ram.h +++ b/src/devices/bus/kc/ram.h @@ -20,8 +20,8 @@ class kc_m011_device : { public: // construction/destruction - kc_m011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - kc_m011_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); + kc_m011_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + kc_m011_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: // device-level overrides @@ -29,10 +29,10 @@ protected: virtual void device_reset() override; // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0xf6; } - virtual void control_w(UINT8 data) override; - virtual void read(offs_t offset, UINT8 &data) override; - virtual void write(offs_t offset, UINT8 data) override; + virtual uint8_t module_id_r() override { return 0xf6; } + virtual void control_w(uint8_t data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void write(offs_t offset, uint8_t data) override; virtual DECLARE_WRITE_LINE_MEMBER( mei_w ) override; protected: @@ -40,15 +40,15 @@ protected: // internal state int m_mei; // module enable line - UINT8 * m_ram; - UINT8 m_enabled; - UINT8 m_write_enabled; - UINT16 m_base; - UINT8 m_segment; + uint8_t * m_ram; + uint8_t m_enabled; + uint8_t m_write_enabled; + uint16_t m_base; + uint8_t m_segment; private: // internal helpers - virtual UINT32 get_ram_size() const { return 0x10000; } + virtual uint32_t get_ram_size() const { return 0x10000; } }; @@ -59,17 +59,17 @@ class kc_m022_device : { public: // construction/destruction - kc_m022_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_m022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0xf4; } - virtual void read(offs_t offset, UINT8 &ata) override; - virtual void write(offs_t offset, UINT8 data) override; + virtual uint8_t module_id_r() override { return 0xf4; } + virtual void read(offs_t offset, uint8_t &ata) override; + virtual void write(offs_t offset, uint8_t data) override; private: // internal helpers - virtual UINT32 get_ram_size() const override { return 0x4000; } + virtual uint32_t get_ram_size() const override { return 0x4000; } }; @@ -80,21 +80,21 @@ class kc_m032_device : { public: // construction/destruction - kc_m032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_m032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_reset() override; // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0x79; } - virtual void control_w(UINT8 data) override; - virtual void read(offs_t offset, UINT8 &data) override; - virtual void write(offs_t offset, UINT8 data) override; + virtual uint8_t module_id_r() override { return 0x79; } + virtual void control_w(uint8_t data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void write(offs_t offset, uint8_t data) override; private: // internal helpers - virtual UINT32 get_ram_size() const override { return 0x40000; } + virtual uint32_t get_ram_size() const override { return 0x40000; } }; @@ -105,21 +105,21 @@ class kc_m034_device : { public: // construction/destruction - kc_m034_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_m034_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_reset() override; // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0x7a; } - virtual void control_w(UINT8 data) override; - virtual void read(offs_t offset, UINT8 &data) override; - virtual void write(offs_t offset, UINT8 data) override; + virtual uint8_t module_id_r() override { return 0x7a; } + virtual void control_w(uint8_t data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void write(offs_t offset, uint8_t data) override; private: // internal helpers - virtual UINT32 get_ram_size() const override { return 0x80000; } + virtual uint32_t get_ram_size() const override { return 0x80000; } }; @@ -130,18 +130,18 @@ class kc_m035_device : { public: // construction/destruction - kc_m035_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_m035_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0x7b; } - virtual void control_w(UINT8 data) override; - virtual void read(offs_t offset, UINT8 &data) override; - virtual void write(offs_t offset, UINT8 data) override; + virtual uint8_t module_id_r() override { return 0x7b; } + virtual void control_w(uint8_t data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void write(offs_t offset, uint8_t data) override; private: // internal helpers - virtual UINT32 get_ram_size() const override { return 0x100000; } + virtual uint32_t get_ram_size() const override { return 0x100000; } }; @@ -152,21 +152,21 @@ class kc_m036_device : { public: // construction/destruction - kc_m036_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_m036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_reset() override; // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0x78; } - virtual void control_w(UINT8 data) override; - virtual void read(offs_t offset, UINT8 &data) override; - virtual void write(offs_t offset, UINT8 data) override; + virtual uint8_t module_id_r() override { return 0x78; } + virtual void control_w(uint8_t data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual void write(offs_t offset, uint8_t data) override; private: // internal helpers - virtual UINT32 get_ram_size() const override { return 0x20000; } + virtual uint32_t get_ram_size() const override { return 0x20000; } }; // device type definition diff --git a/src/devices/bus/kc/rom.cpp b/src/devices/bus/kc/rom.cpp index 8906f1cbe18..6c2c4b85292 100644 --- a/src/devices/bus/kc/rom.cpp +++ b/src/devices/bus/kc/rom.cpp @@ -42,13 +42,13 @@ const device_type KC_M033 = &device_creator; // kc_8k_device - constructor //------------------------------------------------- -kc_8k_device::kc_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_8k_device::kc_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KC_STANDARD, "Standard 8K ROM module", tag, owner, clock, "kc_8k", __FILE__), device_kcexp_interface( mconfig, *this ), m_slot(nullptr), m_mei(0), m_rom(nullptr), m_enabled(0), m_base(0) { } -kc_8k_device::kc_8k_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) +kc_8k_device::kc_8k_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_kcexp_interface( mconfig, *this ), m_slot(nullptr), m_mei(0), m_rom(nullptr), m_enabled(0), m_base(0) { @@ -89,7 +89,7 @@ const tiny_rom_entry *kc_8k_device::device_rom_region() const get_cart_base -------------------------------------------------*/ -UINT8* kc_8k_device::get_cart_base() +uint8_t* kc_8k_device::get_cart_base() { return m_rom; } @@ -98,7 +98,7 @@ UINT8* kc_8k_device::get_cart_base() module control write -------------------------------------------------*/ -void kc_8k_device::control_w(UINT8 data) +void kc_8k_device::control_w(uint8_t data) { if (m_mei) { @@ -111,7 +111,7 @@ void kc_8k_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kc_8k_device::read(offs_t offset, UINT8 &data) +void kc_8k_device::read(offs_t offset, uint8_t &data) { if (offset >= m_base && offset < (m_base + 0x2000) && m_enabled && m_mei) { @@ -142,7 +142,7 @@ WRITE_LINE_MEMBER( kc_8k_device::mei_w ) // kc_m006_device - constructor //------------------------------------------------- -kc_m006_device::kc_m006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_m006_device::kc_m006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kc_8k_device(mconfig, KC_M006, "M006 BASIC", tag, owner, clock, "kc_m006", __FILE__) { } @@ -151,7 +151,7 @@ kc_m006_device::kc_m006_device(const machine_config &mconfig, const char *tag, d module control write -------------------------------------------------*/ -void kc_m006_device::control_w(UINT8 data) +void kc_m006_device::control_w(uint8_t data) { if (m_mei) { @@ -164,7 +164,7 @@ void kc_m006_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kc_m006_device::read(offs_t offset, UINT8 &data) +void kc_m006_device::read(offs_t offset, uint8_t &data) { if (offset >= m_base && offset < (m_base + 0x4000) && m_enabled) { @@ -184,7 +184,7 @@ void kc_m006_device::read(offs_t offset, UINT8 &data) // kc_m033_device - constructor //------------------------------------------------- -kc_m033_device::kc_m033_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kc_m033_device::kc_m033_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : kc_8k_device(mconfig, KC_M033, "M033 TypeStar", tag, owner, clock, "kc_m033", __FILE__), m_bank(0) { } @@ -204,7 +204,7 @@ void kc_m033_device::device_reset() module control write -------------------------------------------------*/ -void kc_m033_device::control_w(UINT8 data) +void kc_m033_device::control_w(uint8_t data) { if (m_mei) { @@ -218,7 +218,7 @@ void kc_m033_device::control_w(UINT8 data) read -------------------------------------------------*/ -void kc_m033_device::read(offs_t offset, UINT8 &data) +void kc_m033_device::read(offs_t offset, uint8_t &data) { if (offset >= m_base && offset < (m_base + 0x2000) && m_enabled && m_mei) { diff --git a/src/devices/bus/kc/rom.h b/src/devices/bus/kc/rom.h index e5e1673058c..5e9e94473b6 100644 --- a/src/devices/bus/kc/rom.h +++ b/src/devices/bus/kc/rom.h @@ -20,8 +20,8 @@ class kc_8k_device : { public: // construction/destruction - kc_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - kc_8k_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); + kc_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + kc_8k_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); // optional information overrides @@ -32,10 +32,10 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0xfb; } - virtual void control_w(UINT8 data) override; - virtual void read(offs_t offset, UINT8 &data) override; - virtual UINT8* get_cart_base() override; + virtual uint8_t module_id_r() override { return 0xfb; } + virtual void control_w(uint8_t data) override; + virtual void read(offs_t offset, uint8_t &data) override; + virtual uint8_t* get_cart_base() override; virtual DECLARE_WRITE_LINE_MEMBER( mei_w ) override; protected: @@ -43,9 +43,9 @@ protected: // internal state int m_mei; // module enable line - UINT8 * m_rom; - UINT8 m_enabled; - UINT16 m_base; + uint8_t * m_rom; + uint8_t m_enabled; + uint16_t m_base; }; @@ -56,13 +56,13 @@ class kc_m006_device : { public: // construction/destruction - kc_m006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_m006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0xfc; } - virtual void control_w(UINT8 data) override; - virtual void read(offs_t offset, UINT8 &data) override; + virtual uint8_t module_id_r() override { return 0xfc; } + virtual void control_w(uint8_t data) override; + virtual void read(offs_t offset, uint8_t &data) override; }; @@ -73,20 +73,20 @@ class kc_m033_device : { public: // construction/destruction - kc_m033_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kc_m033_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_reset() override; // kcexp_interface overrides - virtual UINT8 module_id_r() override { return 0x01; } - virtual void control_w(UINT8 data) override; - virtual void read(offs_t offset, UINT8 &data) override; + virtual uint8_t module_id_r() override { return 0x01; } + virtual void control_w(uint8_t data) override; + virtual void read(offs_t offset, uint8_t &data) override; private: // internal state - UINT16 m_bank; + uint16_t m_bank; }; diff --git a/src/devices/bus/lpci/cirrus.cpp b/src/devices/bus/lpci/cirrus.cpp index 61cea36a3e9..49d216845b7 100644 --- a/src/devices/bus/lpci/cirrus.cpp +++ b/src/devices/bus/lpci/cirrus.cpp @@ -83,7 +83,7 @@ const device_type CIRRUS = &device_creator; // cirrus_device - constructor //------------------------------------------------- -cirrus_device::cirrus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cirrus_device::cirrus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CIRRUS, "CIRRUS", tag, owner, clock, "cirrus", __FILE__), pci_device_interface( mconfig, *this ) { @@ -109,9 +109,9 @@ void cirrus_device::device_reset() // pci_read - implementation of PCI read //------------------------------------------------- -UINT32 cirrus_device::pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) +uint32_t cirrus_device::pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) { - UINT32 result = 0; + uint32_t result = 0; if (function == 0) { @@ -145,7 +145,7 @@ UINT32 cirrus_device::pci_read(pci_bus_device *pcibus, int function, int offset, // pci_write - implementation of PCI write //------------------------------------------------- -void cirrus_device::pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) +void cirrus_device::pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) { if (LOG_PCIACCESS) logerror("cirrus5430_pci_write(): function=%d offset=0x%02X data=0x%04X\n", function, offset, data); diff --git a/src/devices/bus/lpci/cirrus.h b/src/devices/bus/lpci/cirrus.h index 9b06a0c7878..e9c4aeeccd3 100644 --- a/src/devices/bus/lpci/cirrus.h +++ b/src/devices/bus/lpci/cirrus.h @@ -20,10 +20,10 @@ class cirrus_device : public device_t, { public: // construction/destruction - cirrus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cirrus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) override; - virtual void pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) override; + virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override; + virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override; DECLARE_WRITE8_MEMBER( cirrus_42E8_w ); diff --git a/src/devices/bus/lpci/i82371ab.cpp b/src/devices/bus/lpci/i82371ab.cpp index 9f5a9de2edd..23b3b81121d 100644 --- a/src/devices/bus/lpci/i82371ab.cpp +++ b/src/devices/bus/lpci/i82371ab.cpp @@ -22,15 +22,15 @@ const device_type I82371AB = &device_creator; -i82371ab_device::i82371ab_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i82371ab_device::i82371ab_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : southbridge_device(mconfig, I82371AB, "Intel 82371AB", tag, owner, clock, "i82371ab", __FILE__), pci_device_interface( mconfig, *this ) { } -UINT32 i82371ab_device::pci_isa_r(device_t *busdevice, int offset, UINT32 mem_mask) +uint32_t i82371ab_device::pci_isa_r(device_t *busdevice, int offset, uint32_t mem_mask) { - UINT32 result = m_regs[0][offset] | + uint32_t result = m_regs[0][offset] | m_regs[0][offset+1] << 8 | m_regs[0][offset+2] << 16| m_regs[0][offset+3] << 24; @@ -40,9 +40,9 @@ UINT32 i82371ab_device::pci_isa_r(device_t *busdevice, int offset, UINT32 mem_ma return result; } -void i82371ab_device::pci_isa_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask) +void i82371ab_device::pci_isa_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask) { - UINT32 cdata = 0; + uint32_t cdata = 0; int i; COMBINE_DATA(&cdata); @@ -67,9 +67,9 @@ void i82371ab_device::pci_isa_w(device_t *busdevice, int offset, UINT32 data, UI } } -UINT32 i82371ab_device::pci_ide_r(device_t *busdevice, int offset, UINT32 mem_mask) +uint32_t i82371ab_device::pci_ide_r(device_t *busdevice, int offset, uint32_t mem_mask) { - UINT32 result = m_regs[1][offset] | + uint32_t result = m_regs[1][offset] | m_regs[1][offset+1] << 8 | m_regs[1][offset+2] << 16| m_regs[1][offset+3] << 24; @@ -79,9 +79,9 @@ UINT32 i82371ab_device::pci_ide_r(device_t *busdevice, int offset, UINT32 mem_ma return result; } -void i82371ab_device::pci_ide_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask) +void i82371ab_device::pci_ide_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask) { - UINT32 cdata = 0; + uint32_t cdata = 0; int i; COMBINE_DATA(&cdata); @@ -106,9 +106,9 @@ void i82371ab_device::pci_ide_w(device_t *busdevice, int offset, UINT32 data, UI } } -UINT32 i82371ab_device::pci_usb_r(device_t *busdevice, int offset, UINT32 mem_mask) +uint32_t i82371ab_device::pci_usb_r(device_t *busdevice, int offset, uint32_t mem_mask) { - UINT32 result = m_regs[2][offset] | + uint32_t result = m_regs[2][offset] | m_regs[2][offset+1] << 8 | m_regs[2][offset+2] << 16| m_regs[2][offset+3] << 24; @@ -118,9 +118,9 @@ UINT32 i82371ab_device::pci_usb_r(device_t *busdevice, int offset, UINT32 mem_ma return result; } -void i82371ab_device::pci_usb_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask) +void i82371ab_device::pci_usb_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask) { - UINT32 cdata = 0; + uint32_t cdata = 0; int i; COMBINE_DATA(&cdata); @@ -145,9 +145,9 @@ void i82371ab_device::pci_usb_w(device_t *busdevice, int offset, UINT32 data, UI } } -UINT32 i82371ab_device::pci_acpi_r(device_t *busdevice, int offset, UINT32 mem_mask) +uint32_t i82371ab_device::pci_acpi_r(device_t *busdevice, int offset, uint32_t mem_mask) { - UINT32 result = m_regs[3][offset] | + uint32_t result = m_regs[3][offset] | m_regs[3][offset+1] << 8 | m_regs[3][offset+2] << 16| m_regs[3][offset+3] << 24; @@ -157,9 +157,9 @@ UINT32 i82371ab_device::pci_acpi_r(device_t *busdevice, int offset, UINT32 mem_m return result; } -void i82371ab_device::pci_acpi_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask) +void i82371ab_device::pci_acpi_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask) { - UINT32 cdata = 0; + uint32_t cdata = 0; int i; COMBINE_DATA(&cdata); @@ -184,7 +184,7 @@ void i82371ab_device::pci_acpi_w(device_t *busdevice, int offset, UINT32 data, U } } -UINT32 i82371ab_device::pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) +uint32_t i82371ab_device::pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) { switch (function) { @@ -199,7 +199,7 @@ UINT32 i82371ab_device::pci_read(pci_bus_device *pcibus, int function, int offse return 0; } -void i82371ab_device::pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) +void i82371ab_device::pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) { switch (function) { @@ -229,7 +229,7 @@ void i82371ab_device::device_reset() { southbridge_device::device_reset(); memset(m_regs, 0, sizeof(m_regs)); - UINT32 (*regs32)[64] = (UINT32 (*)[64])(m_regs); + uint32_t (*regs32)[64] = (uint32_t (*)[64])(m_regs); /* isa */ regs32[0][0x00] = 0x71108086; diff --git a/src/devices/bus/lpci/i82371ab.h b/src/devices/bus/lpci/i82371ab.h index ec5ec8b3be2..637819d9694 100644 --- a/src/devices/bus/lpci/i82371ab.h +++ b/src/devices/bus/lpci/i82371ab.h @@ -21,30 +21,30 @@ class i82371ab_device : public southbridge_device, { public: // construction/destruction - i82371ab_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82371ab_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) override; - virtual void pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) override; + virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override; + virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override; protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - UINT32 pci_isa_r(device_t *busdevice, int offset, UINT32 mem_mask); - void pci_isa_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask); + uint32_t pci_isa_r(device_t *busdevice, int offset, uint32_t mem_mask); + void pci_isa_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask); - UINT32 pci_ide_r(device_t *busdevice, int offset, UINT32 mem_mask); - void pci_ide_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask); + uint32_t pci_ide_r(device_t *busdevice, int offset, uint32_t mem_mask); + void pci_ide_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask); - UINT32 pci_usb_r(device_t *busdevice, int offset, UINT32 mem_mask); - void pci_usb_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask); + uint32_t pci_usb_r(device_t *busdevice, int offset, uint32_t mem_mask); + void pci_usb_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask); - UINT32 pci_acpi_r(device_t *busdevice, int offset, UINT32 mem_mask); - void pci_acpi_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask); + uint32_t pci_acpi_r(device_t *busdevice, int offset, uint32_t mem_mask); + void pci_acpi_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask); private: - UINT8 m_regs[4][0x100]; + uint8_t m_regs[4][0x100]; }; // device type definition diff --git a/src/devices/bus/lpci/i82371sb.cpp b/src/devices/bus/lpci/i82371sb.cpp index de9cbc365e7..b57cea2bbd0 100644 --- a/src/devices/bus/lpci/i82371sb.cpp +++ b/src/devices/bus/lpci/i82371sb.cpp @@ -27,22 +27,22 @@ const device_type I82371SB = &device_creator; -i82371sb_device::i82371sb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i82371sb_device::i82371sb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : southbridge_device(mconfig, I82371SB, "Intel 82371SB", tag, owner, clock, "i82371sb", __FILE__), pci_device_interface( mconfig, *this ) { } -UINT32 i82371sb_device::pci_isa_r(device_t *busdevice,int offset, UINT32 mem_mask) +uint32_t i82371sb_device::pci_isa_r(device_t *busdevice,int offset, uint32_t mem_mask) { - UINT32 result = m_regs[0][offset]; + uint32_t result = m_regs[0][offset]; //logerror("i82371sb_pci_isa_r, offset = %02x, mem_mask = %08x\n", offset, mem_mask); return result; } -void i82371sb_device::pci_isa_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask) +void i82371sb_device::pci_isa_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask) { //logerror("i82371sb_pci_isa_w, offset = %02x, data = %08x, mem_mask = %08x\n", offset, data, mem_mask); @@ -61,14 +61,14 @@ void i82371sb_device::pci_isa_w(device_t *busdevice, int offset, UINT32 data, UI } } -UINT32 i82371sb_device::pci_ide_r(device_t *busdevice, int offset, UINT32 mem_mask) +uint32_t i82371sb_device::pci_ide_r(device_t *busdevice, int offset, uint32_t mem_mask) { //logerror("i82371sb_pci_ide_r, offset = %02x, mem_mask = %08x\n", offset, mem_mask); - UINT32 result = m_regs[1][offset]; + uint32_t result = m_regs[1][offset]; return result; } -void i82371sb_device::pci_ide_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask) +void i82371sb_device::pci_ide_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask) { //logerror("i82371sb_pci_ide_w, offset = %02x, data = %08x, mem_mask = %08x\n", offset, data, mem_mask); @@ -87,16 +87,16 @@ void i82371sb_device::pci_ide_w(device_t *busdevice, int offset, UINT32 data, UI } } -UINT32 i82371sb_device::pci_usb_r(device_t *busdevice, int offset, UINT32 mem_mask) +uint32_t i82371sb_device::pci_usb_r(device_t *busdevice, int offset, uint32_t mem_mask) { - UINT32 result = m_regs[2][offset]; + uint32_t result = m_regs[2][offset]; //logerror("i82371sb_pci_usb_r, offset = %02x, mem_mask = %08x\n", offset, mem_mask); return result; } -void i82371sb_device::pci_usb_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask) +void i82371sb_device::pci_usb_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask) { //logerror("i82371sb_pci_usb_w, offset = %02x, data = %08x, mem_mask = %08x\n", offset, data, mem_mask); @@ -115,7 +115,7 @@ void i82371sb_device::pci_usb_w(device_t *busdevice, int offset, UINT32 data, UI } } -UINT32 i82371sb_device::pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) +uint32_t i82371sb_device::pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) { switch (function) { @@ -129,7 +129,7 @@ UINT32 i82371sb_device::pci_read(pci_bus_device *pcibus, int function, int offse return 0; } -void i82371sb_device::pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) +void i82371sb_device::pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) { switch (function) { diff --git a/src/devices/bus/lpci/i82371sb.h b/src/devices/bus/lpci/i82371sb.h index 9e5b3c14b2a..9627e82f8cf 100644 --- a/src/devices/bus/lpci/i82371sb.h +++ b/src/devices/bus/lpci/i82371sb.h @@ -21,26 +21,26 @@ class i82371sb_device : public southbridge_device, { public: // construction/destruction - i82371sb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82371sb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) override; - virtual void pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) override; + virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override; + virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override; protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - UINT32 pci_isa_r(device_t *busdevice, int offset, UINT32 mem_mask); - void pci_isa_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask); + uint32_t pci_isa_r(device_t *busdevice, int offset, uint32_t mem_mask); + void pci_isa_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask); - UINT32 pci_ide_r(device_t *busdevice, int offset, UINT32 mem_mask); - void pci_ide_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask); + uint32_t pci_ide_r(device_t *busdevice, int offset, uint32_t mem_mask); + void pci_ide_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask); - UINT32 pci_usb_r(device_t *busdevice, int offset, UINT32 mem_mask); - void pci_usb_w(device_t *busdevice, int offset, UINT32 data, UINT32 mem_mask); + uint32_t pci_usb_r(device_t *busdevice, int offset, uint32_t mem_mask); + void pci_usb_w(device_t *busdevice, int offset, uint32_t data, uint32_t mem_mask); private: - UINT32 m_regs[3][0x400/4]; + uint32_t m_regs[3][0x400/4]; }; // device type definition diff --git a/src/devices/bus/lpci/i82439tx.cpp b/src/devices/bus/lpci/i82439tx.cpp index e2c64f49473..03abcef7b2c 100644 --- a/src/devices/bus/lpci/i82439tx.cpp +++ b/src/devices/bus/lpci/i82439tx.cpp @@ -16,7 +16,7 @@ const device_type I82439TX = &device_creator; -i82439tx_device::i82439tx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i82439tx_device::i82439tx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : northbridge_device(mconfig, I82439TX, "Intel 82439TX", tag, owner, clock, "i82439tx", __FILE__), pci_device_interface( mconfig, *this ), m_cpu_tag( nullptr ), @@ -26,7 +26,7 @@ i82439tx_device::i82439tx_device(const machine_config &mconfig, const char *tag, { } -void i82439tx_device::i82439tx_configure_memory(UINT8 val, offs_t begin, offs_t end) +void i82439tx_device::i82439tx_configure_memory(uint8_t val, offs_t begin, offs_t end) { switch (val & 0x03) { @@ -53,9 +53,9 @@ void i82439tx_device::i82439tx_configure_memory(UINT8 val, offs_t begin, offs_t PCI INTERFACE ***************************************************************************/ -UINT32 i82439tx_device::pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) +uint32_t i82439tx_device::pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) { - UINT32 result; + uint32_t result; if (function != 0) return 0; @@ -142,7 +142,7 @@ UINT32 i82439tx_device::pci_read(pci_bus_device *pcibus, int function, int offse return result; } -void i82439tx_device::pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) +void i82439tx_device::pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) { if (function != 0) return; diff --git a/src/devices/bus/lpci/i82439tx.h b/src/devices/bus/lpci/i82439tx.h index a0179af8265..41626c7f627 100644 --- a/src/devices/bus/lpci/i82439tx.h +++ b/src/devices/bus/lpci/i82439tx.h @@ -27,30 +27,30 @@ class i82439tx_device : public northbridge_device, { public: // construction/destruction - i82439tx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82439tx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_cpu(device_t &device, const char *tag) { dynamic_cast(device).m_cpu_tag = tag; } static void static_set_region(device_t &device, const char *tag) { dynamic_cast(device).m_region_tag = tag; } - virtual UINT32 pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) override; - virtual void pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) override; + virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override; + virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override; protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - void i82439tx_configure_memory(UINT8 val, offs_t begin, offs_t end); + void i82439tx_configure_memory(uint8_t val, offs_t begin, offs_t end); private: const char *m_cpu_tag; const char *m_region_tag; address_space *m_space; - UINT8 *m_rom; + uint8_t *m_rom; - UINT32 m_regs[8]; - UINT32 m_bios_ram[0x40000 / 4]; + uint32_t m_regs[8]; + uint32_t m_bios_ram[0x40000 / 4]; }; // device type definition diff --git a/src/devices/bus/lpci/mpc105.cpp b/src/devices/bus/lpci/mpc105.cpp index 2fcde258b93..cbe94911a6b 100644 --- a/src/devices/bus/lpci/mpc105.cpp +++ b/src/devices/bus/lpci/mpc105.cpp @@ -29,7 +29,7 @@ const device_type MPC105 = &device_creator; // mpc105_device - constructor //------------------------------------------------- -mpc105_device::mpc105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mpc105_device::mpc105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MPC105, "MPC105", tag, owner, clock, "mpc105", __FILE__), pci_device_interface( mconfig, *this ), m_cpu_tag(nullptr), @@ -114,9 +114,9 @@ void mpc105_device::update_memory() // pci_read - implementation of PCI read //------------------------------------------------- -UINT32 mpc105_device::pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) +uint32_t mpc105_device::pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) { - UINT32 result; + uint32_t result; if (function != 0) return 0; @@ -191,7 +191,7 @@ UINT32 mpc105_device::pci_read(pci_bus_device *pcibus, int function, int offset, // pci_write - implementation of PCI write //------------------------------------------------- -void mpc105_device::pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) +void mpc105_device::pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) { int i; if (function != 0) @@ -216,9 +216,9 @@ void mpc105_device::pci_write(pci_bus_device *pcibus, int function, int offset, break; case 0xA0: /* memory enable */ - if (m_bank_enable != (UINT8) data) + if (m_bank_enable != (uint8_t) data) { - m_bank_enable = (UINT8) data; + m_bank_enable = (uint8_t) data; update_memory(); } break; diff --git a/src/devices/bus/lpci/mpc105.h b/src/devices/bus/lpci/mpc105.h index f890432dca4..abd71070b57 100644 --- a/src/devices/bus/lpci/mpc105.h +++ b/src/devices/bus/lpci/mpc105.h @@ -28,13 +28,13 @@ class mpc105_device : public device_t, { public: // construction/destruction - mpc105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mpc105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_cpu(device_t &device, const char *tag) { dynamic_cast(device).m_cpu_tag = tag; } static void static_set_bank_base_default(device_t &device, int bank_base_default) { dynamic_cast(device).m_bank_base_default = bank_base_default; } - virtual UINT32 pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) override; - virtual void pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) override; + virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override; + virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override; protected: // device-level overrides @@ -47,8 +47,8 @@ private: const char *m_cpu_tag; int m_bank_base_default; int m_bank_base; - UINT8 m_bank_enable; - UINT32 m_bank_registers[8]; + uint8_t m_bank_enable; + uint32_t m_bank_registers[8]; cpu_device* m_maincpu; }; diff --git a/src/devices/bus/lpci/northbridge.cpp b/src/devices/bus/lpci/northbridge.cpp index ec5a0a8582a..7b69334b688 100644 --- a/src/devices/bus/lpci/northbridge.cpp +++ b/src/devices/bus/lpci/northbridge.cpp @@ -13,7 +13,7 @@ // GLOBAL VARIABLES //************************************************************************** -northbridge_device::northbridge_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) +northbridge_device::northbridge_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_maincpu(*this, ":maincpu"), m_ram(*this, ":" RAM_TAG) diff --git a/src/devices/bus/lpci/northbridge.h b/src/devices/bus/lpci/northbridge.h index 73c21086b8f..2d2ba918f2b 100644 --- a/src/devices/bus/lpci/northbridge.h +++ b/src/devices/bus/lpci/northbridge.h @@ -20,7 +20,7 @@ class northbridge_device : { public: // construction/destruction - northbridge_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); + northbridge_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: // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/lpci/pci.cpp b/src/devices/bus/lpci/pci.cpp index 84f94a5569d..710d04c35af 100644 --- a/src/devices/bus/lpci/pci.cpp +++ b/src/devices/bus/lpci/pci.cpp @@ -89,7 +89,7 @@ const device_type PCI_BUS = &device_creator; //------------------------------------------------- // pci_bus_device - constructor //------------------------------------------------- -pci_bus_device::pci_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pci_bus_device::pci_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCI_BUS, "PCI Bus", tag, owner, clock, "pci_bus", __FILE__), m_busnum(0), m_father(nullptr), m_address(0), m_devicenum(0), m_busnumber(0), m_busnumaddr(nullptr) { @@ -105,7 +105,7 @@ pci_bus_device::pci_bus_device(const machine_config &mconfig, const char *tag, d READ32_MEMBER( pci_bus_device::read ) { - UINT32 result = 0xffffffff; + uint32_t result = 0xffffffff; int function, reg; offset %= 2; @@ -207,12 +207,12 @@ WRITE32_MEMBER( pci_bus_device::write ) READ64_MEMBER(pci_bus_device::read_64be) { - UINT64 result = 0; + uint64_t result = 0; mem_mask = flipendian_int64(mem_mask); if (ACCESSING_BITS_0_31) - result |= (UINT64)read(space, offset * 2 + 0, mem_mask >> 0) << 0; + result |= (uint64_t)read(space, offset * 2 + 0, mem_mask >> 0) << 0; if (ACCESSING_BITS_32_63) - result |= (UINT64)read(space, offset * 2 + 1, mem_mask >> 32) << 32; + result |= (uint64_t)read(space, offset * 2 + 1, mem_mask >> 32) << 32; return flipendian_int64(result); } @@ -314,7 +314,7 @@ pci_device_interface::~pci_device_interface() const device_type PCI_CONNECTOR = &device_creator; -pci_connector::pci_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pci_connector::pci_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCI_CONNECTOR, "PCI device connector abstraction", tag, owner, clock, "pci_connector", __FILE__), device_slot_interface(mconfig, *this) { diff --git a/src/devices/bus/lpci/pci.h b/src/devices/bus/lpci/pci.h index fbf37faa83a..4b2ee41e748 100644 --- a/src/devices/bus/lpci/pci.h +++ b/src/devices/bus/lpci/pci.h @@ -25,15 +25,15 @@ public: pci_device_interface(const machine_config &mconfig, device_t &device); virtual ~pci_device_interface(); - virtual UINT32 pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) = 0; - virtual void pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) = 0; + virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) = 0; + virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) = 0; }; class pci_connector: public device_t, public device_slot_interface { public: - pci_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pci_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~pci_connector(); pci_device_interface *get_device(); @@ -50,7 +50,7 @@ class pci_bus_device : public device_t { public: // construction/destruction - pci_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pci_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ32_MEMBER( read ); DECLARE_WRITE32_MEMBER( write ); @@ -73,19 +73,19 @@ protected: virtual void device_post_load() override; private: - UINT8 m_busnum; + uint8_t m_busnum; const char * m_devtag[32]; pci_device_interface *m_device[32]; const char * m_father; pci_bus_device * m_siblings[8]; - UINT8 m_siblings_busnum[8]; + uint8_t m_siblings_busnum[8]; int m_siblings_count; offs_t m_address; - INT8 m_devicenum; // device number we are addressing - INT8 m_busnumber; // pci bus number we are addressing + int8_t m_devicenum; // device number we are addressing + int8_t m_busnumber; // pci bus number we are addressing pci_bus_device * m_busnumaddr; // pci bus we are addressing }; diff --git a/src/devices/bus/lpci/southbridge.cpp b/src/devices/bus/lpci/southbridge.cpp index 7e8c8dcec37..1bc7de119e1 100644 --- a/src/devices/bus/lpci/southbridge.cpp +++ b/src/devices/bus/lpci/southbridge.cpp @@ -127,7 +127,7 @@ machine_config_constructor southbridge_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( southbridge ); } -southbridge_device::southbridge_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) +southbridge_device::southbridge_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_maincpu(*this, ":maincpu"), m_pic8259_master(*this, "pic8259_master"), @@ -153,22 +153,22 @@ southbridge_device::southbridge_device(const machine_config &mconfig, device_typ /// HACK: the memory system cannot cope with mixing the 8 bit device map from the fdc with a 32 bit handler READ8_MEMBER(southbridge_device::ide_read_cs1_r) { - return m_ide->read_cs1(space, 1, (UINT32) 0xff0000) >> 16; + return m_ide->read_cs1(space, 1, (uint32_t) 0xff0000) >> 16; } WRITE8_MEMBER(southbridge_device::ide_write_cs1_w) { - m_ide->write_cs1(space, 1, (UINT32) data << 16, (UINT32) 0xff0000); + m_ide->write_cs1(space, 1, (uint32_t) data << 16, (uint32_t) 0xff0000); } READ8_MEMBER(southbridge_device::ide2_read_cs1_r) { - return m_ide2->read_cs1(space, 1, (UINT32) 0xff0000) >> 16; + return m_ide2->read_cs1(space, 1, (uint32_t) 0xff0000) >> 16; } WRITE8_MEMBER(southbridge_device::ide2_write_cs1_w) { - m_ide2->write_cs1(space, 1, (UINT32) data << 16, (UINT32) 0xff0000); + m_ide2->write_cs1(space, 1, (uint32_t) data << 16, (uint32_t) 0xff0000); } //------------------------------------------------- @@ -232,7 +232,7 @@ READ8_MEMBER( southbridge_device::get_slave_ack ) * *************************************************************************/ -void southbridge_device::at_speaker_set_spkrdata(UINT8 data) +void southbridge_device::at_speaker_set_spkrdata(uint8_t data) { m_at_spkrdata = data ? 1 : 0; m_speaker->level_w(m_at_spkrdata & m_pit_out2); @@ -272,7 +272,7 @@ WRITE_LINE_MEMBER( southbridge_device::at_pit8254_out2_changed ) READ8_MEMBER( southbridge_device::at_page8_r ) { - UINT8 data = m_at_pages[offset % 0x10]; + uint8_t data = m_at_pages[offset % 0x10]; switch(offset % 8) { @@ -328,7 +328,7 @@ READ8_MEMBER(southbridge_device::pc_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); @@ -352,7 +352,7 @@ READ8_MEMBER(southbridge_device::pc_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)); @@ -423,7 +423,7 @@ WRITE_LINE_MEMBER( southbridge_device::pc_dack7_w ) { pc_select_dma_channel(7, s READ8_MEMBER( southbridge_device::at_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 on the 5170, just a timer here, 15.085us. */ diff --git a/src/devices/bus/lpci/southbridge.h b/src/devices/bus/lpci/southbridge.h index d2591646d3e..91cee4dca99 100644 --- a/src/devices/bus/lpci/southbridge.h +++ b/src/devices/bus/lpci/southbridge.h @@ -40,7 +40,7 @@ class southbridge_device : { public: // construction/destruction - southbridge_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); + southbridge_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -110,19 +110,19 @@ public: DECLARE_READ8_MEMBER(pc_dma_read_word); DECLARE_WRITE8_MEMBER(pc_dma_write_word); protected: - 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_t m_dma_offset[2][4]; + uint8_t m_at_pages[0x10]; + uint16_t m_dma_high_byte; + uint8_t m_at_speaker; bool m_refresh; - void at_speaker_set_spkrdata(UINT8 data); + void at_speaker_set_spkrdata(uint8_t data); - UINT8 m_channel_check; - UINT8 m_nmi_enabled; + uint8_t m_channel_check; + uint8_t m_nmi_enabled; void pc_select_dma_channel(int channel, bool state); }; diff --git a/src/devices/bus/lpci/vt82c505.cpp b/src/devices/bus/lpci/vt82c505.cpp index 15ba12b403b..a5adef41f5b 100644 --- a/src/devices/bus/lpci/vt82c505.cpp +++ b/src/devices/bus/lpci/vt82c505.cpp @@ -17,16 +17,16 @@ const device_type VT82C505 = &device_creator; -vt82c505_device::vt82c505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vt82c505_device::vt82c505_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VT82C505, "VIA VT82C505 PCI bridge", tag, owner, clock, "vt82c505", __FILE__), pci_device_interface( mconfig, *this ) { } -UINT32 vt82c505_device::pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) +uint32_t vt82c505_device::pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) { - UINT32 result = 0; + uint32_t result = 0; if (function != 0) return result; @@ -48,7 +48,7 @@ UINT32 vt82c505_device::pci_read(pci_bus_device *pcibus, int function, int offse return result; } -void vt82c505_device::pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) +void vt82c505_device::pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) { if (function != 0) return; diff --git a/src/devices/bus/lpci/vt82c505.h b/src/devices/bus/lpci/vt82c505.h index 68bb3358b00..7bd37b568b5 100644 --- a/src/devices/bus/lpci/vt82c505.h +++ b/src/devices/bus/lpci/vt82c505.h @@ -16,10 +16,10 @@ class vt82c505_device : public device_t, { public: // construction/destruction - vt82c505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vt82c505_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 pci_read(pci_bus_device *pcibus, int function, int offset, UINT32 mem_mask) override; - virtual void pci_write(pci_bus_device *pcibus, int function, int offset, UINT32 data, UINT32 mem_mask) override; + virtual uint32_t pci_read(pci_bus_device *pcibus, int function, int offset, uint32_t mem_mask) override; + virtual void pci_write(pci_bus_device *pcibus, int function, int offset, uint32_t data, uint32_t mem_mask) override; protected: // device-level overrides @@ -27,8 +27,8 @@ protected: virtual void device_reset() override; private: - UINT16 m_window_addr[3]; - UINT8 m_window_attr[3]; + uint16_t m_window_addr[3]; + uint8_t m_window_attr[3]; }; // device type definition diff --git a/src/devices/bus/m5/rom.cpp b/src/devices/bus/m5/rom.cpp index bffd33df541..8d326e05d8b 100644 --- a/src/devices/bus/m5/rom.cpp +++ b/src/devices/bus/m5/rom.cpp @@ -21,20 +21,20 @@ const device_type M5_ROM_STD = &device_creator; const device_type M5_ROM_RAM = &device_creator; -m5_rom_device::m5_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +m5_rom_device::m5_rom_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_m5_cart_interface( mconfig, *this ) { } -m5_rom_device::m5_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m5_rom_device::m5_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M5_ROM_STD, "M5 Standard ROM Carts", tag, owner, clock, "m5_rom", __FILE__), device_m5_cart_interface( mconfig, *this ) { } -m5_ram_device::m5_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m5_ram_device::m5_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m5_rom_device(mconfig, M5_ROM_RAM, "M5 Expansion memory cart", tag, owner, clock, "m5_ram", __FILE__) { } diff --git a/src/devices/bus/m5/rom.h b/src/devices/bus/m5/rom.h index dedd7555f1c..bfa40ee08ed 100644 --- a/src/devices/bus/m5/rom.h +++ b/src/devices/bus/m5/rom.h @@ -13,8 +13,8 @@ class m5_rom_device : public device_t, { public: // construction/destruction - m5_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - m5_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m5_rom_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); + m5_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -30,7 +30,7 @@ class m5_ram_device : public m5_rom_device { public: // construction/destruction - m5_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m5_ram_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/devices/bus/m5/slot.cpp b/src/devices/bus/m5/slot.cpp index 2b5c563f54e..356cf79a5ac 100644 --- a/src/devices/bus/m5/slot.cpp +++ b/src/devices/bus/m5/slot.cpp @@ -45,7 +45,7 @@ device_m5_cart_interface::~device_m5_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_m5_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_m5_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -59,7 +59,7 @@ void device_m5_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_m5_cart_interface::ram_alloc(UINT32 size) +void device_m5_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -72,7 +72,7 @@ void device_m5_cart_interface::ram_alloc(UINT32 size) //------------------------------------------------- // m5_cart_slot_device - constructor //------------------------------------------------- -m5_cart_slot_device::m5_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m5_cart_slot_device::m5_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M5_CART_SLOT, "M5 Cartridge Slot", tag, owner, clock, "m5_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -175,7 +175,7 @@ image_init_result m5_cart_slot_device::call_load() if (m_type == M5_STD || m_type>2) //carts with roms { - UINT32 size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); if (size > 0x5000 && m_type == M5_STD) { @@ -213,7 +213,7 @@ std::string m5_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string = "std"; - //UINT32 size = core_fsize(m_file); + //uint32_t size = core_fsize(m_file); int type = M5_STD; diff --git a/src/devices/bus/m5/slot.h b/src/devices/bus/m5/slot.h index a31f89f0a49..7f0a84ecbd4 100644 --- a/src/devices/bus/m5/slot.h +++ b/src/devices/bus/m5/slot.h @@ -38,20 +38,20 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_ram) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } void save_ram() { device().save_item(NAME(m_ram)); } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; }; @@ -63,7 +63,7 @@ class m5_cart_slot_device : public device_t, { public: // construction/destruction - m5_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m5_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~m5_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/macpds/macpds.cpp b/src/devices/bus/macpds/macpds.cpp index 956a0bb95ed..7757c622cbb 100644 --- a/src/devices/bus/macpds/macpds.cpp +++ b/src/devices/bus/macpds/macpds.cpp @@ -25,7 +25,7 @@ const device_type MACPDS_SLOT = &device_creator; //------------------------------------------------- // macpds_slot_device - constructor //------------------------------------------------- -macpds_slot_device::macpds_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +macpds_slot_device::macpds_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MACPDS_SLOT, "Mac 68000 Processor-Direct Slot", tag, owner, clock, "macpds_slot", __FILE__), device_slot_interface(mconfig, *this), m_macpds_tag(nullptr), @@ -33,7 +33,7 @@ macpds_slot_device::macpds_slot_device(const machine_config &mconfig, const char { } -macpds_slot_device::macpds_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +macpds_slot_device::macpds_slot_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_slot_interface(mconfig, *this), m_macpds_tag(nullptr), m_macpds_slottag(nullptr) { @@ -77,12 +77,12 @@ void macpds_device::static_set_cputag(device_t &device, const char *tag) // macpds_device - constructor //------------------------------------------------- -macpds_device::macpds_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +macpds_device::macpds_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MACPDS, "MACPDS", tag, owner, clock, "macpds", __FILE__), m_maincpu(nullptr), m_cputag(nullptr) { } -macpds_device::macpds_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) : +macpds_device::macpds_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_maincpu(nullptr), m_cputag(nullptr) { } @@ -108,19 +108,19 @@ void macpds_device::add_macpds_card(device_macpds_card_interface *card) m_device_list.append(*card); } -void macpds_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, UINT32 mask) +void macpds_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask) { m_maincpu = machine().device(m_cputag); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); } -void macpds_device::install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, UINT32 mask) +void macpds_device::install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, uint32_t mask) { m_maincpu = machine().device(m_cputag); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); } -void macpds_device::install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data) +void macpds_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data) { // printf("install_bank: %s @ %x->%x\n", tag, start, end); m_maincpu = machine().device(m_cputag); @@ -176,7 +176,7 @@ void device_macpds_card_interface::set_macpds_device() m_macpds->add_macpds_card(this); } -void device_macpds_card_interface::install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data) +void device_macpds_card_interface::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data) { char bank[256]; @@ -188,10 +188,10 @@ void device_macpds_card_interface::install_bank(offs_t start, offs_t end, const m_macpds->install_bank(start, end, bank, data); } -void device_macpds_card_interface::install_rom(device_t *dev, const char *romregion, UINT32 addr) +void device_macpds_card_interface::install_rom(device_t *dev, const char *romregion, uint32_t addr) { - UINT8 *rom = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->base(); - UINT32 romlen = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->bytes(); + uint8_t *rom = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->base(); + uint32_t romlen = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->bytes(); char bankname[128]; sprintf(bankname, "rom_%x", addr); diff --git a/src/devices/bus/macpds/macpds.h b/src/devices/bus/macpds/macpds.h index 95a1a1e0b50..0dcaa529a9b 100644 --- a/src/devices/bus/macpds/macpds.h +++ b/src/devices/bus/macpds/macpds.h @@ -51,8 +51,8 @@ class macpds_slot_device : public device_t, { public: // construction/destruction - macpds_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - macpds_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + macpds_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + macpds_slot_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-level overrides virtual void device_start() override; @@ -75,16 +75,16 @@ class macpds_device : public device_t { public: // construction/destruction - macpds_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - macpds_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); + macpds_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + macpds_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); ~macpds_device() { m_device_list.detach_all(); } // inline configuration static void static_set_cputag(device_t &device, const char *tag); void add_macpds_card(device_macpds_card_interface *card); - void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, UINT32 mask=0xffffffff); - void install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, UINT32 mask=0xffffffff); - void install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data); + void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask=0xffffffff); + void install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, uint32_t mask=0xffffffff); + void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data); void set_irq_line(int line, int state); protected: @@ -119,8 +119,8 @@ public: void set_macpds_device(); // helper functions for card devices - void install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data); - void install_rom(device_t *dev, const char *romregion, UINT32 addr); + void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data); + void install_rom(device_t *dev, const char *romregion, uint32_t addr); // inline configuration static void static_set_macpds_tag(device_t &device, const char *tag, const char *slottag); diff --git a/src/devices/bus/macpds/pds_tpdfpd.cpp b/src/devices/bus/macpds/pds_tpdfpd.cpp index 6ba0b413722..ed4d2259821 100644 --- a/src/devices/bus/macpds/pds_tpdfpd.cpp +++ b/src/devices/bus/macpds/pds_tpdfpd.cpp @@ -86,7 +86,7 @@ const tiny_rom_entry *macpds_sedisplay_device::device_rom_region() const // macpds_sedisplay_device - constructor //------------------------------------------------- -macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDS_SEDISPLAY, "Radius SE Full Page Display", tag, owner, clock, "pds_sefp", __FILE__), device_video_interface(mconfig, *this), device_macpds_card_interface(mconfig, *this), m_vram(nullptr), m_vbl_disable(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -95,7 +95,7 @@ macpds_sedisplay_device::macpds_sedisplay_device(const machine_config &mconfig, m_screen_tag = m_assembled_tag.c_str(); } -macpds_sedisplay_device::macpds_sedisplay_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) : +macpds_sedisplay_device::macpds_sedisplay_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_video_interface(mconfig, *this), device_macpds_card_interface(mconfig, *this), m_vram(nullptr), m_vbl_disable(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -115,7 +115,7 @@ void macpds_sedisplay_device::device_start() install_rom(this, SEDISPLAY_ROM_REGION, 0xc00000); install_rom(this, SEDISPLAY_ROM_REGION, 0xf80000); - m_vram = std::make_unique(VRAM_SIZE); + m_vram = std::make_unique(VRAM_SIZE); static const char bankname[] = { "radpds_ram" }; m_macpds->install_bank(0xc40000, 0xc40000+VRAM_SIZE-1, bankname, m_vram.get()); @@ -160,11 +160,11 @@ void macpds_sedisplay_device::device_timer(emu_timer &timer, device_timer_id tid ***************************************************************************/ -UINT32 macpds_sedisplay_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t macpds_sedisplay_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = m_vram.get(); diff --git a/src/devices/bus/macpds/pds_tpdfpd.h b/src/devices/bus/macpds/pds_tpdfpd.h index 44878aa8e82..c697305c845 100644 --- a/src/devices/bus/macpds/pds_tpdfpd.h +++ b/src/devices/bus/macpds/pds_tpdfpd.h @@ -21,14 +21,14 @@ class macpds_sedisplay_device : { public: // construction/destruction - macpds_sedisplay_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - macpds_sedisplay_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); + macpds_sedisplay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + macpds_sedisplay_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,9 +41,9 @@ protected: DECLARE_WRITE16_MEMBER(ramdac_w); public: - std::unique_ptr m_vram; - UINT32 m_vbl_disable; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::unique_ptr m_vram; + uint32_t m_vbl_disable; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; }; diff --git a/src/devices/bus/megadrive/eeprom.cpp b/src/devices/bus/megadrive/eeprom.cpp index 016a17507eb..49132e537e4 100644 --- a/src/devices/bus/megadrive/eeprom.cpp +++ b/src/devices/bus/megadrive/eeprom.cpp @@ -60,46 +60,46 @@ const device_type MD_EEPROM_NHLPA = &device_creator; const device_type MD_EEPROM_BLARA = &device_creator; -md_std_eeprom_device::md_std_eeprom_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) +md_std_eeprom_device::md_std_eeprom_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_md_cart_interface( mconfig, *this ), m_i2cmem(*this, "i2cmem"), m_i2c_mem(0), m_i2c_clk(0) { } -md_std_eeprom_device::md_std_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_std_eeprom_device::md_std_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MD_STD_EEPROM, "MD Standard cart + EEPROM", tag, owner, clock, "md_std_eeprom", __FILE__), device_md_cart_interface( mconfig, *this ), m_i2cmem(*this, "i2cmem"), m_i2c_mem(0), m_i2c_clk(0) { } -md_eeprom_nbajam_device::md_eeprom_nbajam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_eeprom_nbajam_device::md_eeprom_nbajam_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_eeprom_device(mconfig, MD_EEPROM_NBAJAM, "MD NBA Jam", tag, owner, clock, "md_eeprom_nbajam", __FILE__) { } -md_eeprom_nbajamte_device::md_eeprom_nbajamte_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_eeprom_nbajamte_device::md_eeprom_nbajamte_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_eeprom_device(mconfig, MD_EEPROM_NBAJAMTE, "MD NBA Jam TE (and a few more)", tag, owner, clock, "md_eeprom_nbajamte", __FILE__) { } -md_eeprom_cslam_device::md_eeprom_cslam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_eeprom_cslam_device::md_eeprom_cslam_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_eeprom_device(mconfig, MD_EEPROM_CSLAM, "MD College Slam", tag, owner, clock, "md_eeprom_cslam", __FILE__) { } -md_eeprom_nflqb_device::md_eeprom_nflqb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_eeprom_nflqb_device::md_eeprom_nflqb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_eeprom_device(mconfig, MD_EEPROM_NFLQB, "MD NFL Quarterback 96", tag, owner, clock, "md_eeprom_nflqb", __FILE__) { } -md_eeprom_nhlpa_device::md_eeprom_nhlpa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_eeprom_nhlpa_device::md_eeprom_nhlpa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_eeprom_device(mconfig, MD_EEPROM_NHLPA, "MD NHLPA 93", tag, owner, clock, "md_eeprom_nhlpa", __FILE__) { } -md_eeprom_blara_device::md_eeprom_blara_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_eeprom_blara_device::md_eeprom_blara_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_eeprom_device(mconfig, MD_EEPROM_BLARA, "MD Brian Lara", tag, owner, clock, "md_eeprom_blara", __FILE__) { } @@ -380,7 +380,7 @@ WRITE16_MEMBER(md_eeprom_blara_device::write) const device_type MD_EEPROM_NBAJAM_ALT = &device_creator; -md_eeprom_nbajam_device_alt::md_eeprom_nbajam_device_alt(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_eeprom_nbajam_device_alt::md_eeprom_nbajam_device_alt(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_eeprom_device(mconfig, MD_EEPROM_NBAJAM_ALT, "MD NBA Jam (Alt)", tag, owner, clock, "md_eeprom_nbajama", __FILE__) { } @@ -555,8 +555,8 @@ void md_eeprom_nbajam_device_alt::eeprom_i2c_update(void) m_eeprom_byte = ((m_eeprom_byte << 1) | m_eeprom_sda) & 0xff; else { - UINT8 *nvram = (UINT8 *)&m_nvram[0]; - UINT16 sram_address = m_eeprom_slave_mask | (m_eeprom_devsel * 0x100) | m_eeprom_word_address; + uint8_t *nvram = (uint8_t *)&m_nvram[0]; + uint16_t sram_address = m_eeprom_slave_mask | (m_eeprom_devsel * 0x100) | m_eeprom_word_address; nvram[sram_address & 0xffff] = m_eeprom_byte; m_eeprom_byte = 0; @@ -574,17 +574,17 @@ void md_eeprom_nbajam_device_alt::eeprom_i2c_update(void) //printf("Write line : status %d SDA %x SCL %x (count %d)\n", m_eeprom_cur_state, m_eeprom_sda, m_eeprom_scl, m_eeprom_cnt); } -UINT8 md_eeprom_nbajam_device_alt::eeprom_i2c_out() +uint8_t md_eeprom_nbajam_device_alt::eeprom_i2c_out() { - UINT8 res = m_eeprom_sda; + uint8_t res = m_eeprom_sda; switch (m_eeprom_cur_state) { case STATE_I2C_READ_DATA: if (m_eeprom_cnt < 9) { - UINT8 *nvram = (UINT8 *)&m_nvram[0]; - UINT16 sram_address = m_eeprom_slave_mask | (m_eeprom_devsel * 0x100) | m_eeprom_word_address; + uint8_t *nvram = (uint8_t *)&m_nvram[0]; + uint16_t sram_address = m_eeprom_slave_mask | (m_eeprom_devsel * 0x100) | m_eeprom_word_address; sram_address &= 0xffff; res = (nvram[sram_address] >> (8 - m_eeprom_cnt)) & 1; diff --git a/src/devices/bus/megadrive/eeprom.h b/src/devices/bus/megadrive/eeprom.h index f3582a49cba..a99766a8681 100644 --- a/src/devices/bus/megadrive/eeprom.h +++ b/src/devices/bus/megadrive/eeprom.h @@ -18,8 +18,8 @@ class md_std_eeprom_device : public device_t, { public: // construction/destruction - md_std_eeprom_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); - md_std_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_std_eeprom_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); + md_std_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -31,7 +31,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write) override; required_device m_i2cmem; - UINT8 m_i2c_mem, m_i2c_clk; + uint8_t m_i2c_mem, m_i2c_clk; }; // ======================> md_eeprom_nbajam_device @@ -40,7 +40,7 @@ class md_eeprom_nbajam_device : public md_std_eeprom_device { public: // construction/destruction - md_eeprom_nbajam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_eeprom_nbajam_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -56,7 +56,7 @@ class md_eeprom_nbajamte_device : public md_std_eeprom_device { public: // construction/destruction - md_eeprom_nbajamte_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_eeprom_nbajamte_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -72,7 +72,7 @@ class md_eeprom_cslam_device : public md_std_eeprom_device { public: // construction/destruction - md_eeprom_cslam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_eeprom_cslam_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -88,7 +88,7 @@ class md_eeprom_nflqb_device : public md_std_eeprom_device { public: // construction/destruction - md_eeprom_nflqb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_eeprom_nflqb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -104,7 +104,7 @@ class md_eeprom_nhlpa_device : public md_std_eeprom_device { public: // construction/destruction - md_eeprom_nhlpa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_eeprom_nhlpa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -120,7 +120,7 @@ class md_eeprom_blara_device : public md_std_eeprom_device { public: // construction/destruction - md_eeprom_blara_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_eeprom_blara_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -161,7 +161,7 @@ class md_eeprom_nbajam_device_alt : public md_std_eeprom_device { public: // construction/destruction - md_eeprom_nbajam_device_alt(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_eeprom_nbajam_device_alt(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides // virtual machine_config_constructor device_mconfig_additions() const override; @@ -171,29 +171,29 @@ public: virtual DECLARE_READ16_MEMBER(read) override; virtual DECLARE_WRITE16_MEMBER(write) override; - std::vector m_sram; + std::vector m_sram; void eeprom_i2c_init(); void idle_devsel_check(); void eeprom_i2c_update(); - UINT8 eeprom_i2c_out(); + uint8_t eeprom_i2c_out(); private: // EEPROM runtime vars - UINT8 m_eeprom_sda; // current SDA - UINT8 m_eeprom_prev_sda; // previous SDA - UINT8 m_eeprom_scl; // current SCL - UINT8 m_eeprom_prev_scl; // previous SCL - UINT8 m_eeprom_cnt; // operation count in 0-9 - UINT8 m_eeprom_readwrite; // read/write bit - UINT16 m_eeprom_slave_mask; // dev addr - UINT16 m_eeprom_word_address; // memory addr - UINT16 m_eeprom_devsel; // selected device - UINT16 m_eeprom_byte; // byte to be written + uint8_t m_eeprom_sda; // current SDA + uint8_t m_eeprom_prev_sda; // previous SDA + uint8_t m_eeprom_scl; // current SCL + uint8_t m_eeprom_prev_scl; // previous SCL + uint8_t m_eeprom_cnt; // operation count in 0-9 + uint8_t m_eeprom_readwrite; // read/write bit + uint16_t m_eeprom_slave_mask; // dev addr + uint16_t m_eeprom_word_address; // memory addr + uint16_t m_eeprom_devsel; // selected device + uint16_t m_eeprom_byte; // byte to be written int m_eeprom_cur_state; // current state // EEPROM physical characteristics (configured at init) - UINT16 m_eeprom_mask; // size of the memory - 1 - UINT16 m_eeprom_pagewrite_mask; // max number of bytes that can be written in a single write cycle + uint16_t m_eeprom_mask; // size of the memory - 1 + uint16_t m_eeprom_pagewrite_mask; // max number of bytes that can be written in a single write cycle }; diff --git a/src/devices/bus/megadrive/ggenie.cpp b/src/devices/bus/megadrive/ggenie.cpp index 65097208567..a8586e087eb 100644 --- a/src/devices/bus/megadrive/ggenie.cpp +++ b/src/devices/bus/megadrive/ggenie.cpp @@ -32,7 +32,7 @@ const device_type MD_ROM_GAMEGENIE = &device_creator; -md_rom_ggenie_device::md_rom_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_ggenie_device::md_rom_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MD_ROM_GAMEGENIE, "MD Game Genie", tag, owner, clock, "md_ggenie", __FILE__), device_md_cart_interface( mconfig, *this ), m_exp(*this, "subslot"), m_gg_bypass(0), m_reg_enable(0) diff --git a/src/devices/bus/megadrive/ggenie.h b/src/devices/bus/megadrive/ggenie.h index 75b943abb4e..5970ca1d172 100644 --- a/src/devices/bus/megadrive/ggenie.h +++ b/src/devices/bus/megadrive/ggenie.h @@ -13,7 +13,7 @@ class md_rom_ggenie_device : public device_t, { public: // construction/destruction - md_rom_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -26,11 +26,11 @@ public: private: required_device m_exp; - UINT16 m_gg_regs[0x20]; + uint16_t m_gg_regs[0x20]; int m_gg_bypass; int m_reg_enable; - UINT16 m_gg_addr[6]; - UINT16 m_gg_data[6]; + uint16_t m_gg_addr[6]; + uint16_t m_gg_data[6]; }; diff --git a/src/devices/bus/megadrive/jcart.cpp b/src/devices/bus/megadrive/jcart.cpp index e3182fca414..43d38e50a60 100644 --- a/src/devices/bus/megadrive/jcart.cpp +++ b/src/devices/bus/megadrive/jcart.cpp @@ -40,7 +40,7 @@ const device_type MD_SEPROM_CODEMAST = &device_creator; // Sampras, Super Skidmarks? -md_jcart_device::md_jcart_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) +md_jcart_device::md_jcart_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_md_cart_interface( mconfig, *this ), m_jcart3(*this, "JCART3"), @@ -48,7 +48,7 @@ md_jcart_device::md_jcart_device(const machine_config &mconfig, device_type type { } -md_jcart_device::md_jcart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_jcart_device::md_jcart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MD_JCART, "MD J-Cart games", tag, owner, clock, "md_jcart", __FILE__), device_md_cart_interface( mconfig, *this ), m_jcart3(*this, "JCART3"), @@ -57,20 +57,20 @@ md_jcart_device::md_jcart_device(const machine_config &mconfig, const char *tag, } // Micro Machines 2, Micro Machines Military -md_seprom_codemast_device::md_seprom_codemast_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) +md_seprom_codemast_device::md_seprom_codemast_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) : md_jcart_device(mconfig, type, name, tag, owner, clock, shortname, source), m_i2cmem(*this, "i2cmem"), m_i2c_mem(0), m_i2c_clk(0) { } -md_seprom_codemast_device::md_seprom_codemast_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_seprom_codemast_device::md_seprom_codemast_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_jcart_device(mconfig, MD_SEPROM_CODEMAST, "MD J-Cart games + SEPROM", tag, owner, clock, "md_seprom_codemast", __FILE__), m_i2cmem(*this, "i2cmem"), m_i2c_mem(0), m_i2c_clk(0) { } // Micro Machines 96 -md_seprom_mm96_device::md_seprom_mm96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_seprom_mm96_device::md_seprom_mm96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_seprom_codemast_device(mconfig, MD_SEPROM_MM96, "MD Micro Machine 96", tag, owner, clock, "md_seprom_mm96", __FILE__) { } @@ -176,7 +176,7 @@ READ16_MEMBER(md_jcart_device::read) { if (offset == 0x38fffe/2) { - UINT8 joy[2]; + uint8_t joy[2]; if (m_jcart_io_data[0] & 0x40) { @@ -219,7 +219,7 @@ READ16_MEMBER(md_seprom_codemast_device::read) } if (offset == 0x38fffe/2) { - UINT8 joy[2]; + uint8_t joy[2]; if (m_jcart_io_data[0] & 0x40) { diff --git a/src/devices/bus/megadrive/jcart.h b/src/devices/bus/megadrive/jcart.h index 7af02447ede..3d2a6c10bd7 100644 --- a/src/devices/bus/megadrive/jcart.h +++ b/src/devices/bus/megadrive/jcart.h @@ -18,8 +18,8 @@ class md_jcart_device : public device_t, { public: // construction/destruction - md_jcart_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); - md_jcart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_jcart_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); + md_jcart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -34,7 +34,7 @@ public: required_ioport m_jcart4; private: - UINT8 m_jcart_io_data[2]; + uint8_t m_jcart_io_data[2]; }; // ======================> md_seprom_codemast_device @@ -43,8 +43,8 @@ class md_seprom_codemast_device : public md_jcart_device { public: // construction/destruction - md_seprom_codemast_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); - md_seprom_codemast_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_seprom_codemast_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); + md_seprom_codemast_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -58,8 +58,8 @@ public: required_device m_i2cmem; private: - UINT8 m_jcart_io_data[2]; - UINT8 m_i2c_mem, m_i2c_clk; + uint8_t m_jcart_io_data[2]; + uint8_t m_i2c_mem, m_i2c_clk; }; // ======================> md_seprom_mm96_device (same read/write as codemast, but different I2C type) @@ -68,7 +68,7 @@ class md_seprom_mm96_device : public md_seprom_codemast_device { public: // construction/destruction - md_seprom_mm96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_seprom_mm96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/megadrive/md_slot.cpp b/src/devices/bus/megadrive/md_slot.cpp index 246dc43cab8..0886d204e98 100644 --- a/src/devices/bus/megadrive/md_slot.cpp +++ b/src/devices/bus/megadrive/md_slot.cpp @@ -87,7 +87,7 @@ void device_md_cart_interface::rom_alloc(size_t size, const char *tag) { if (m_rom == nullptr) { - m_rom = (UINT16 *)device().machine().memory().region_alloc(std::string(tag).append(MDSLOT_ROM_REGION_TAG).c_str(), size, 2, ENDIANNESS_BIG)->base(); + m_rom = (uint16_t *)device().machine().memory().region_alloc(std::string(tag).append(MDSLOT_ROM_REGION_TAG).c_str(), size, 2, ENDIANNESS_BIG)->base(); m_rom_size = size; } } @@ -99,7 +99,7 @@ void device_md_cart_interface::rom_alloc(size_t size, const char *tag) void device_md_cart_interface::nvram_alloc(size_t size) { - m_nvram.resize(size/sizeof(UINT16)); + m_nvram.resize(size/sizeof(uint16_t)); } //------------------------------------------------- @@ -107,7 +107,7 @@ void device_md_cart_interface::nvram_alloc(size_t size) // blocks, so to simplify ROM mirroring //------------------------------------------------- -void device_md_cart_interface::rom_map_setup(UINT32 size) +void device_md_cart_interface::rom_map_setup(uint32_t size) { int i; // setup the rom_bank_map array to faster ROM read @@ -139,9 +139,9 @@ void device_md_cart_interface::rom_map_setup(UINT32 size) // get_padded_size //------------------------------------------------- -UINT32 device_md_cart_interface::get_padded_size(UINT32 size) +uint32_t device_md_cart_interface::get_padded_size(uint32_t size) { - UINT32 pad_size = 0x10000; + uint32_t pad_size = 0x10000; while (size > pad_size) pad_size <<= 1; @@ -160,7 +160,7 @@ UINT32 device_md_cart_interface::get_padded_size(UINT32 size) //------------------------------------------------- // base_md_cart_slot_device - constructor //------------------------------------------------- -base_md_cart_slot_device::base_md_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +base_md_cart_slot_device::base_md_cart_slot_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_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -169,17 +169,17 @@ base_md_cart_slot_device::base_md_cart_slot_device(const machine_config &mconfig { } -md_cart_slot_device::md_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +md_cart_slot_device::md_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : base_md_cart_slot_device(mconfig, MD_CART_SLOT, "MD Cartridge Slot", tag, owner, clock, "md_cart_slot", __FILE__) { } -pico_cart_slot_device::pico_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pico_cart_slot_device::pico_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : base_md_cart_slot_device(mconfig, PICO_CART_SLOT, "Pico Cartridge Slot", tag, owner, clock, "pico_cart_slot", __FILE__) { } -copera_cart_slot_device::copera_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +copera_cart_slot_device::copera_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : base_md_cart_slot_device(mconfig, COPERA_CART_SLOT, "Copera Cartridge Slot", tag, owner, clock, "copera_cart_slot", __FILE__) { } @@ -354,7 +354,7 @@ image_init_result base_md_cart_slot_device::call_load() if (m_cart->get_nvram_size()) battery_load(m_cart->get_nvram_base(), m_cart->get_nvram_size(), 0xff); - file_logging((UINT8 *)m_cart->get_rom_base(), m_cart->get_rom_size(), m_cart->get_nvram_size()); + file_logging((uint8_t *)m_cart->get_rom_base(), m_cart->get_rom_size(), m_cart->get_nvram_size()); } return res; @@ -366,8 +366,8 @@ image_init_result base_md_cart_slot_device::call_load() image_init_result base_md_cart_slot_device::load_list() { - UINT16 *ROM; - UINT32 length = get_software_region_length("rom"); + uint16_t *ROM; + uint32_t length = get_software_region_length("rom"); const char *slot_name; // if cart size is not (2^n * 64K), the system will see anyway that size so we need to alloc a bit more space @@ -375,7 +375,7 @@ image_init_result base_md_cart_slot_device::load_list() m_cart->rom_alloc(length, tag()); ROM = m_cart->get_rom_base(); - memcpy((UINT8 *)ROM, get_software_region("rom"), get_software_region_length("rom")); + memcpy((uint8_t *)ROM, get_software_region("rom"), get_software_region_length("rom")); // if we allocated a ROM larger that the file (e.g. due to uneven cart size), set remaining space to 0xff if (length > get_software_region_length("rom")) @@ -470,8 +470,8 @@ image_init_result base_md_cart_slot_device::load_nonlist() { unsigned char *ROM; bool is_smd, is_md; - UINT32 tmplen = length(), offset, len; - std::vector tmpROM(tmplen); + uint32_t tmplen = length(), offset, len; + std::vector tmpROM(tmplen); // STEP 1: store a (possibly headered) copy of the file and determine its type (SMD? MD? BIN?) fread(&tmpROM[0], tmplen); @@ -562,7 +562,7 @@ void base_md_cart_slot_device::call_unload() void base_md_cart_slot_device::setup_custom_mappers() { - UINT16 *ROM16 = m_cart->get_rom_base(); + uint16_t *ROM16 = m_cart->get_rom_base(); switch (m_type) { @@ -583,7 +583,7 @@ void base_md_cart_slot_device::setup_custom_mappers() void base_md_cart_slot_device::setup_nvram() { - UINT8 *ROM = (UINT8 *)m_cart->get_rom_base(); + uint8_t *ROM = (uint8_t *)m_cart->get_rom_base(); m_cart->m_nvram_readonly = 0; m_cart->m_nvram_active = 0; m_cart->m_nvram_handlers_installed = 0; @@ -683,7 +683,7 @@ void base_md_cart_slot_device::setup_nvram() -int base_md_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) +int base_md_cart_slot_device::get_cart_type(uint8_t *ROM, uint32_t len) { int type = SEGA_STD; @@ -889,8 +889,8 @@ int base_md_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) // If the cart is not of a special type, we check the header for SRAM. if (ROM[0x1b1] == 'A' && ROM[0x1b0] == 'R') { - UINT32 start = (ROM[0x1b4] << 24 | ROM[0x1b5] << 16 | ROM[0x1b6] << 8 | ROM[0x1b7]); - UINT32 end = (ROM[0x1b8] << 24 | ROM[0x1b9] << 16 | ROM[0x1ba] << 8 | ROM[0x1bb]); + uint32_t start = (ROM[0x1b4] << 24 | ROM[0x1b5] << 16 | ROM[0x1b6] << 8 | ROM[0x1b7]); + uint32_t end = (ROM[0x1b8] << 24 | ROM[0x1b9] << 16 | ROM[0x1ba] << 8 | ROM[0x1bb]); // For some games using serial EEPROM, difference between SRAM end to start is 0 or 1. // Carts with EEPROM should have been already detected above, but better safe than sorry if (end - start < 2) @@ -918,8 +918,8 @@ std::string base_md_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 len = m_file->size(), offset = 0; - std::vector rom(len); + uint32_t len = m_file->size(), offset = 0; + std::vector rom(len); int type; m_file->read(&rom[0], len); @@ -995,12 +995,12 @@ WRITE16_MEMBER(base_md_cart_slot_device::write_a15) Image loading logging -------------------------------------------------*/ -void base_md_cart_slot_device::file_logging(UINT8 *ROM8, UINT32 rom_len, UINT32 nvram_len) +void base_md_cart_slot_device::file_logging(uint8_t *ROM8, uint32_t rom_len, uint32_t nvram_len) { char console[16], copyright[16], domestic_name[48], overseas_name[48]; char serial[14], io[16], modem[12], memo[40], country[16]; - UINT32 rom_start, rom_end, ram_start, ram_end, sram_start = 0, sram_end = 0; - UINT16 checksum, csum = 0; + uint32_t rom_start, rom_end, ram_start, ram_end, sram_start = 0, sram_end = 0; + uint16_t checksum, csum = 0; bool valid_sram = FALSE, is_pico = FALSE; std::string ctrl(""), reg(""); diff --git a/src/devices/bus/megadrive/md_slot.h b/src/devices/bus/megadrive/md_slot.h index 008ae917fb5..4953ac046cd 100644 --- a/src/devices/bus/megadrive/md_slot.h +++ b/src/devices/bus/megadrive/md_slot.h @@ -109,16 +109,16 @@ public: virtual void rom_alloc(size_t size, const char *tag); virtual void nvram_alloc(size_t size); - virtual UINT16* get_rom_base() { return m_rom; }; - virtual UINT16* get_nvram_base() { return &m_nvram[0]; }; - virtual UINT32 get_rom_size() { return m_rom_size; }; - virtual UINT32 get_nvram_size() { return m_nvram.size()*sizeof(UINT16); }; - virtual void set_bank_to_rom(const char *banktag, UINT32 offset) {}; + virtual uint16_t* get_rom_base() { return m_rom; }; + virtual uint16_t* get_nvram_base() { return &m_nvram[0]; }; + virtual uint32_t get_rom_size() { return m_rom_size; }; + virtual uint32_t get_nvram_size() { return m_nvram.size()*sizeof(uint16_t); }; + virtual void set_bank_to_rom(const char *banktag, uint32_t offset) {}; void save_nvram() { device().save_item(NAME(m_nvram)); } - void rom_map_setup(UINT32 size); - UINT32 get_padded_size(UINT32 size); + void rom_map_setup(uint32_t size); + uint32_t get_padded_size(uint32_t size); int m_nvram_start, m_nvram_end; int m_nvram_active, m_nvram_readonly; @@ -129,11 +129,11 @@ public: int m_nvram_handlers_installed; // internal state - UINT16 *m_rom; - UINT32 m_rom_size; - std::vector m_nvram; + uint16_t *m_rom; + uint32_t m_rom_size; + std::vector m_nvram; - UINT8 rom_bank_map[128]; // 64K chunks of rom + uint8_t rom_bank_map[128]; // 64K chunks of rom }; @@ -145,7 +145,7 @@ class base_md_cart_slot_device : public device_t, { public: // construction/destruction - base_md_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + base_md_cart_slot_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 ~base_md_cart_slot_device(); // device-level overrides @@ -171,12 +171,12 @@ public: image_init_result load_list(); image_init_result load_nonlist(); - int get_cart_type(UINT8 *ROM, UINT32 len); + int get_cart_type(uint8_t *ROM, uint32_t len); void setup_custom_mappers(); void setup_nvram(); void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; } - void file_logging(UINT8 *ROM, UINT32 rom_len, UINT32 nvram_len); + void file_logging(uint8_t *ROM, uint32_t rom_len, uint32_t nvram_len); void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); } @@ -205,7 +205,7 @@ class md_cart_slot_device : public base_md_cart_slot_device { public: // construction/destruction - md_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const char *image_interface() const override { return "megadriv_cart"; } virtual const char *file_extensions() const override { return "smd,bin,md,gen"; } }; @@ -216,7 +216,7 @@ class pico_cart_slot_device : public base_md_cart_slot_device { public: // construction/destruction - pico_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pico_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const char *image_interface() const override { return "pico_cart"; } virtual const char *file_extensions() const override { return "bin,md"; } }; @@ -227,7 +227,7 @@ class copera_cart_slot_device : public base_md_cart_slot_device { public: // construction/destruction - copera_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + copera_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const char *image_interface() const override { return "copera_cart"; } virtual const char *file_extensions() const override { return "bin,md"; } }; diff --git a/src/devices/bus/megadrive/rom.cpp b/src/devices/bus/megadrive/rom.cpp index 039574487ca..772a777d965 100644 --- a/src/devices/bus/megadrive/rom.cpp +++ b/src/devices/bus/megadrive/rom.cpp @@ -65,184 +65,184 @@ const device_type MD_ROM_WUKONG = &device_creator; const device_type MD_ROM_STARODYS = &device_creator; -md_std_rom_device::md_std_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +md_std_rom_device::md_std_rom_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_md_cart_interface( mconfig, *this ) { } -md_std_rom_device::md_std_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_std_rom_device::md_std_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MD_STD_ROM, "MD Standard cart", tag, owner, clock, "md_std_rom", __FILE__), device_md_cart_interface( mconfig, *this ) { } -md_rom_sram_device::md_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_sram_device::md_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_SRAM, "MD Standard cart + SRAM", tag, owner, clock, "md_rom_sram", __FILE__) { } -md_rom_fram_device::md_rom_fram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_fram_device::md_rom_fram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_FRAM, "MD Standard cart + FRAM", tag, owner, clock, "md_rom_fram", __FILE__) { } -md_rom_ssf2_device::md_rom_ssf2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_ssf2_device::md_rom_ssf2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_SSF2, "MD Super SF2", tag, owner, clock, "md_rom_ssf2", __FILE__), m_lastoff(0), m_lastdata(0) { } -md_rom_cm2in1_device::md_rom_cm2in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_cm2in1_device::md_rom_cm2in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_CM2IN1, "MD Codemasters 2in1", tag, owner, clock, "md_rom_cm2in1", __FILE__), m_base(0) { } -md_rom_mcpirate_device::md_rom_mcpirate_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_mcpirate_device::md_rom_mcpirate_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_MCPIR, "MD Pirate Multicarts (Various)", tag, owner, clock, "md_rom_mcpirate", __FILE__), m_bank(0) { } -md_rom_bugslife_device::md_rom_bugslife_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_bugslife_device::md_rom_bugslife_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_BUGSLIFE, "MD A Bug's Life", tag, owner, clock, "md_rom_bugslife", __FILE__) { } -md_rom_smouse_device::md_rom_smouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_smouse_device::md_rom_smouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_SMOUSE, "MD Huan Le Tao Qi Shu / Smart Mouse", tag, owner, clock, "md_rom_smouse", __FILE__) { } -md_rom_smb_device::md_rom_smb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_smb_device::md_rom_smb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_SMB, "MD Super Mario Bros.", tag, owner, clock, "md_rom_smb", __FILE__) { } -md_rom_smb2_device::md_rom_smb2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_smb2_device::md_rom_smb2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_SMB2, "MD Super Mario Bros. 2", tag, owner, clock, "md_rom_smb2", __FILE__) { } -md_rom_smw64_device::md_rom_smw64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_smw64_device::md_rom_smw64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_SMW64, "MD Super Mario World 64", tag, owner, clock, "md_rom_smw64", __FILE__), m_latch0(0), m_latch1(0) { } -md_rom_sbubl_device::md_rom_sbubl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_sbubl_device::md_rom_sbubl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_SBUBL, "MD Super Bubble Bobble", tag, owner, clock, "md_rom_sbubl", __FILE__) { } -md_rom_rx3_device::md_rom_rx3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_rx3_device::md_rom_rx3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_RX3, "MD Rockman X3", tag, owner, clock, "md_rom_rx3", __FILE__) { } -md_rom_mjlov_device::md_rom_mjlov_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_mjlov_device::md_rom_mjlov_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_MJLOV, "MD Ma Jiang Qing Ren / Mahjong Lover", tag, owner, clock, "md_rom_mjlov", __FILE__) { } -md_rom_cjmjclub_device::md_rom_cjmjclub_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_cjmjclub_device::md_rom_cjmjclub_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_CJMJCLUB, "MD Chaoji Majiang Club / Super Mahjong Club", tag, owner, clock, "md_rom_cjmjclub", __FILE__) { } -md_rom_kof98_device::md_rom_kof98_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_kof98_device::md_rom_kof98_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_KOF98, "MD KOF 98", tag, owner, clock, "md_rom_kof98", __FILE__) { } -md_rom_kof99_device::md_rom_kof99_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_kof99_device::md_rom_kof99_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_KOF99, "MD KOF 99 (and others)", tag, owner, clock, "md_rom_kof99", __FILE__) { } -md_rom_soulb_device::md_rom_soulb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_soulb_device::md_rom_soulb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_SOULB, "MD Soul Blade", tag, owner, clock, "md_rom_soulb", __FILE__) { } -md_rom_chinf3_device::md_rom_chinf3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_chinf3_device::md_rom_chinf3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_CHINF3, "MD Chinese Fighter 3", tag, owner, clock, "md_rom_chinf3", __FILE__), m_bank(0) { } -md_rom_16mj2_device::md_rom_16mj2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_16mj2_device::md_rom_16mj2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_16MJ2, "MD 16 Mahjong Tiles II", tag, owner, clock, "md_rom_16mj2", __FILE__) { } -md_rom_elfwor_device::md_rom_elfwor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_elfwor_device::md_rom_elfwor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_ELFWOR, "MD Linghuan Daoshi Super Magician / Elf Wor", tag, owner, clock, "md_rom_elfwor", __FILE__) { } -md_rom_yasech_device::md_rom_yasech_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_yasech_device::md_rom_yasech_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_YASECH, "MD Ya Se Chuan Shuo", tag, owner, clock, "md_rom_yasech", __FILE__) { } -md_rom_lion2_device::md_rom_lion2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_lion2_device::md_rom_lion2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_LION2, "MD Lion King 2", tag, owner, clock, "md_rom_lion2", __FILE__), m_prot1_data(0), m_prot2_data(0) { } -md_rom_lion3_device::md_rom_lion3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_lion3_device::md_rom_lion3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_LION3, "MD Lion King 3", tag, owner, clock, "md_rom_lion3", __FILE__), m_bank(0) { } -md_rom_pokea_device::md_rom_pokea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_pokea_device::md_rom_pokea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_POKEA, "MD Pokemon (Alt Protection)", tag, owner, clock, "md_rom_pokea", __FILE__) { } -md_rom_pokestad_device::md_rom_pokestad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_pokestad_device::md_rom_pokestad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_POKESTAD, "MD Pokemon Stadium", tag, owner, clock, "md_rom_pokestad", __FILE__), m_bank(0) { } -md_rom_realtec_device::md_rom_realtec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_realtec_device::md_rom_realtec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_REALTEC, "MD Realtec", tag, owner, clock, "md_rom_realtec", __FILE__), m_bank_addr(0), m_bank_size(0), m_old_bank_addr(0) { } -md_rom_redcl_device::md_rom_redcl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_redcl_device::md_rom_redcl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_REDCL, "MD Redcliff", tag, owner, clock, "md_rom_redcl", __FILE__) { } -md_rom_squir_device::md_rom_squir_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_squir_device::md_rom_squir_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_SQUIR, "MD Squirrel King", tag, owner, clock, "md_rom_squir", __FILE__), m_latch(0) { } -md_rom_tekkensp_device::md_rom_tekkensp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_tekkensp_device::md_rom_tekkensp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_TEKKENSP, "MD Tekken Special", tag, owner, clock, "md_rom_tekkensp", __FILE__), m_reg(0) { } -md_rom_topf_device::md_rom_topf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_topf_device::md_rom_topf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_TOPF, "MD Top Fighter", tag, owner, clock, "md_rom_topf", __FILE__), m_latch(0) { } -md_rom_radica_device::md_rom_radica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_radica_device::md_rom_radica_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_RADICA, "MD Radica TV games", tag, owner, clock, "md_rom_radica", __FILE__), m_bank(0) { } -md_rom_beggarp_device::md_rom_beggarp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_beggarp_device::md_rom_beggarp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_BEGGARP, "MD Beggar Prince", tag, owner, clock, "md_rom_beggarp", __FILE__), m_mode(0), m_lock(0) { } -md_rom_wukong_device::md_rom_wukong_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_wukong_device::md_rom_wukong_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_WUKONG, "MD Legend of Wukong", tag, owner, clock, "md_rom_wukong", __FILE__), m_mode(0) { } -md_rom_starodys_device::md_rom_starodys_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_starodys_device::md_rom_starodys_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : md_std_rom_device(mconfig, MD_ROM_STARODYS, "MD Star Odyssey", tag, owner, clock, "md_rom_starodys", __FILE__), m_mode(0), m_lock(0), m_ram_enable(0), m_base(0) { } @@ -552,7 +552,7 @@ WRITE16_MEMBER(md_rom_ssf2_device::write_a13) m_lastdata = data; if (offset) // bank 0 is not modified { - UINT16 *ROM = get_rom_base(); + uint16_t *ROM = get_rom_base(); m_bank[offset] = data & 0xf; memcpy(ROM + offset * 0x080000/2, ROM + 0x400000/2 + (m_bank[offset] * 0x080000)/2, 0x080000); } @@ -625,7 +625,7 @@ READ16_MEMBER(md_rom_chinf3_device::read) and the writes made at the start of the game.. */ if (offset >= 0x400000/2 && offset < 0x500000/2) { - UINT32 retdat; + uint32_t retdat; /* 04dc10 chifi3, prot_r? 2800 04cefa chifi3, prot_r? 65262 @@ -1163,7 +1163,7 @@ READ16_MEMBER(md_rom_smw64_device::read) } if ((offset >= 0x670000/2) && (offset < 0x680000/2)) { - UINT16 data = (m_ctrl[1] & 0x80) ? ((m_ctrl[2] & 0x40) ? (m_reg[4] & m_reg[5]) : (m_reg[4] ^ 0xff)) : 0x0000; + uint16_t data = (m_ctrl[1] & 0x80) ? ((m_ctrl[2] & 0x40) ? (m_reg[4] & m_reg[5]) : (m_reg[4] ^ 0xff)) : 0x0000; if (offset & 0x1) // odd offset, return lower 7 bits of the above return data & 0x7f; else // even offset, return whole data above, but also update the regs if CTRL3 has 0x80 set @@ -1503,7 +1503,7 @@ WRITE16_MEMBER(md_rom_starodys_device::write) if (offset < 0x10000/2) { - UINT32 prot_offs = (offset * 2) & 0xf00; + uint32_t prot_offs = (offset * 2) & 0xf00; if (!m_lock) { if (prot_offs == 0xd00) diff --git a/src/devices/bus/megadrive/rom.h b/src/devices/bus/megadrive/rom.h index d640242ff3c..a75068c2ae2 100644 --- a/src/devices/bus/megadrive/rom.h +++ b/src/devices/bus/megadrive/rom.h @@ -16,8 +16,8 @@ class md_std_rom_device : public device_t, { public: // construction/destruction - md_std_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - md_std_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_std_rom_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); + md_std_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {}; @@ -33,7 +33,7 @@ class md_rom_sram_device : public md_std_rom_device { public: // construction/destruction - md_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -47,7 +47,7 @@ class md_rom_fram_device : public md_std_rom_device { public: // construction/destruction - md_rom_fram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_fram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -62,7 +62,7 @@ class md_rom_ssf2_device : public md_std_rom_device { public: // construction/destruction - md_rom_ssf2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_ssf2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -73,7 +73,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write_a13) override; private: - UINT8 m_bank[16]; + uint8_t m_bank[16]; int m_lastoff, m_lastdata; }; @@ -83,7 +83,7 @@ class md_rom_cm2in1_device : public md_std_rom_device { public: // construction/destruction - md_rom_cm2in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_cm2in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -103,7 +103,7 @@ class md_rom_mcpirate_device : public md_std_rom_device { public: // construction/destruction - md_rom_mcpirate_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_mcpirate_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -114,7 +114,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write_a13) override; private: - UINT8 m_bank; + uint8_t m_bank; }; @@ -124,7 +124,7 @@ class md_rom_bugslife_device : public md_std_rom_device { public: // construction/destruction - md_rom_bugslife_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_bugslife_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read_a13) override; @@ -136,7 +136,7 @@ class md_rom_chinf3_device : public md_std_rom_device { public: // construction/destruction - md_rom_chinf3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_chinf3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -156,7 +156,7 @@ class md_rom_16mj2_device : public md_std_rom_device { public: // construction/destruction - md_rom_16mj2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_16mj2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -168,7 +168,7 @@ class md_rom_elfwor_device : public md_std_rom_device { public: // construction/destruction - md_rom_elfwor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_elfwor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -180,7 +180,7 @@ class md_rom_yasech_device : public md_std_rom_device { public: // construction/destruction - md_rom_yasech_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_yasech_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -192,7 +192,7 @@ class md_rom_kof98_device : public md_std_rom_device { public: // construction/destruction - md_rom_kof98_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_kof98_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -204,7 +204,7 @@ class md_rom_kof99_device : public md_std_rom_device { public: // construction/destruction - md_rom_kof99_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_kof99_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read_a13) override; @@ -216,7 +216,7 @@ class md_rom_lion2_device : public md_std_rom_device { public: // construction/destruction - md_rom_lion2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_lion2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -227,7 +227,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write) override; private: - UINT16 m_prot1_data, m_prot2_data; + uint16_t m_prot1_data, m_prot2_data; }; // ======================> md_rom_lion3_device @@ -236,7 +236,7 @@ class md_rom_lion3_device : public md_std_rom_device { public: // construction/destruction - md_rom_lion3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_lion3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -247,8 +247,8 @@ public: virtual DECLARE_WRITE16_MEMBER(write) override; private: - UINT8 m_reg[3]; - UINT16 m_bank; + uint8_t m_reg[3]; + uint16_t m_bank; }; // ======================> md_rom_mjlov_device @@ -257,7 +257,7 @@ class md_rom_mjlov_device : public md_std_rom_device { public: // construction/destruction - md_rom_mjlov_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_mjlov_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -269,7 +269,7 @@ class md_rom_cjmjclub_device : public md_std_rom_device { public: // construction/destruction - md_rom_cjmjclub_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_cjmjclub_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -281,7 +281,7 @@ class md_rom_pokea_device : public md_std_rom_device { public: // construction/destruction - md_rom_pokea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_pokea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read_a13) override; @@ -293,7 +293,7 @@ class md_rom_pokestad_device : public md_std_rom_device { public: // construction/destruction - md_rom_pokestad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_pokestad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -304,7 +304,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write) override; private: - UINT8 m_bank; + uint8_t m_bank; }; // ======================> md_rom_realtec_device @@ -313,7 +313,7 @@ class md_rom_realtec_device : public md_std_rom_device { public: // construction/destruction - md_rom_realtec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_realtec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -324,7 +324,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write) override; private: - UINT16 m_bank_addr, m_bank_size, m_old_bank_addr; + uint16_t m_bank_addr, m_bank_size, m_old_bank_addr; }; // ======================> md_rom_redcl_device @@ -333,7 +333,7 @@ class md_rom_redcl_device : public md_std_rom_device { public: // construction/destruction - md_rom_redcl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_redcl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -345,7 +345,7 @@ class md_rom_rx3_device : public md_std_rom_device { public: // construction/destruction - md_rom_rx3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_rx3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read_a13) override; @@ -357,7 +357,7 @@ class md_rom_sbubl_device : public md_std_rom_device { public: // construction/destruction - md_rom_sbubl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_sbubl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -369,7 +369,7 @@ class md_rom_smb_device : public md_std_rom_device { public: // construction/destruction - md_rom_smb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_smb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read_a13) override; @@ -381,7 +381,7 @@ class md_rom_smb2_device : public md_std_rom_device { public: // construction/destruction - md_rom_smb2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_smb2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read_a13) override; @@ -393,7 +393,7 @@ class md_rom_smw64_device : public md_std_rom_device { public: // construction/destruction - md_rom_smw64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_smw64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -404,9 +404,9 @@ public: virtual DECLARE_WRITE16_MEMBER(write) override; private: - UINT32 m_latch0, m_latch1; - UINT16 m_reg[6]; - UINT16 m_ctrl[3]; + uint32_t m_latch0, m_latch1; + uint16_t m_reg[6]; + uint16_t m_ctrl[3]; }; // ======================> md_rom_smouse_device @@ -415,7 +415,7 @@ class md_rom_smouse_device : public md_std_rom_device { public: // construction/destruction - md_rom_smouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_smouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -428,7 +428,7 @@ class md_rom_soulb_device : public md_std_rom_device { public: // construction/destruction - md_rom_soulb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_soulb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ16_MEMBER(read) override; @@ -440,7 +440,7 @@ class md_rom_squir_device : public md_std_rom_device { public: // construction/destruction - md_rom_squir_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_squir_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -451,7 +451,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write) override; private: - UINT16 m_latch; + uint16_t m_latch; }; // ======================> md_rom_tekkensp_device @@ -460,7 +460,7 @@ class md_rom_tekkensp_device : public md_std_rom_device { public: // construction/destruction - md_rom_tekkensp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_tekkensp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -471,7 +471,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write) override; private: - UINT16 m_reg; + uint16_t m_reg; }; // ======================> md_rom_topf_device @@ -480,7 +480,7 @@ class md_rom_topf_device : public md_std_rom_device { public: // construction/destruction - md_rom_topf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_topf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -491,8 +491,8 @@ public: virtual DECLARE_WRITE16_MEMBER(write) override; private: - UINT16 m_latch; - UINT8 m_bank[3]; + uint16_t m_latch; + uint8_t m_bank[3]; }; // ======================> md_rom_radica_device @@ -501,7 +501,7 @@ class md_rom_radica_device : public md_std_rom_device { public: // construction/destruction - md_rom_radica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_radica_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -512,7 +512,7 @@ public: virtual DECLARE_READ16_MEMBER(read_a13) override; private: - UINT8 m_bank; + uint8_t m_bank; }; // ======================> md_rom_beggarp_device @@ -521,7 +521,7 @@ class md_rom_beggarp_device : public md_std_rom_device { public: // construction/destruction - md_rom_beggarp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_beggarp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -533,7 +533,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write_a13) override; private: - UINT8 m_mode, m_lock; + uint8_t m_mode, m_lock; }; // ======================> md_rom_wukong_device @@ -542,7 +542,7 @@ class md_rom_wukong_device : public md_std_rom_device { public: // construction/destruction - md_rom_wukong_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_wukong_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -554,7 +554,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write_a13) override; private: - UINT8 m_mode; + uint8_t m_mode; }; // ======================> md_rom_starodys_device @@ -563,7 +563,7 @@ class md_rom_starodys_device : public md_std_rom_device { public: // construction/destruction - md_rom_starodys_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_starodys_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -576,7 +576,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write_a13) override; private: - UINT8 m_mode, m_lock, m_ram_enable, m_base; + uint8_t m_mode, m_lock, m_ram_enable, m_base; }; diff --git a/src/devices/bus/megadrive/sk.cpp b/src/devices/bus/megadrive/sk.cpp index 4cee6dd90f4..5703a2a96ca 100644 --- a/src/devices/bus/megadrive/sk.cpp +++ b/src/devices/bus/megadrive/sk.cpp @@ -27,14 +27,14 @@ const device_type MD_ROM_SK = &device_creator; -md_rom_sk_device::md_rom_sk_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) +md_rom_sk_device::md_rom_sk_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_md_cart_interface( mconfig, *this ), m_exp(*this, "subslot") { } -md_rom_sk_device::md_rom_sk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_sk_device::md_rom_sk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MD_ROM_SK, "MD Sonic & Knuckles", tag, owner, clock, "md_rom_sk", __FILE__), device_md_cart_interface( mconfig, *this ), m_exp(*this, "subslot") diff --git a/src/devices/bus/megadrive/sk.h b/src/devices/bus/megadrive/sk.h index 606d928daae..526a2aa47ea 100644 --- a/src/devices/bus/megadrive/sk.h +++ b/src/devices/bus/megadrive/sk.h @@ -13,8 +13,8 @@ class md_rom_sk_device : public device_t, { public: // construction/destruction - md_rom_sk_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); - md_rom_sk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_sk_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); + md_rom_sk_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/devices/bus/megadrive/stm95.cpp b/src/devices/bus/megadrive/stm95.cpp index 2c7ddf89ad4..dded370bdba 100644 --- a/src/devices/bus/megadrive/stm95.cpp +++ b/src/devices/bus/megadrive/stm95.cpp @@ -15,7 +15,7 @@ #include "stm95.h" -stm95_eeprom_device::stm95_eeprom_device(running_machine &machine, UINT8 *eeprom) : +stm95_eeprom_device::stm95_eeprom_device(running_machine &machine, uint8_t *eeprom) : stm_state(IDLE), stream_pos(0), m_machine(machine) @@ -175,13 +175,13 @@ void stm95_eeprom_device::set_sck_line(int state) const device_type MD_EEPROM_STM95 = &device_creator; -md_eeprom_stm95_device::md_eeprom_stm95_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) +md_eeprom_stm95_device::md_eeprom_stm95_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_md_cart_interface( mconfig, *this ), m_rdcnt(0) { } -md_eeprom_stm95_device::md_eeprom_stm95_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_eeprom_stm95_device::md_eeprom_stm95_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MD_EEPROM_STM95, "MD Cart + EEPROM STM95", tag, owner, clock, "md_eeprom_stm95", __FILE__), device_md_cart_interface( mconfig, *this ), m_rdcnt(0) { @@ -191,7 +191,7 @@ md_eeprom_stm95_device::md_eeprom_stm95_device(const machine_config &mconfig, co void md_eeprom_stm95_device::device_start() { nvram_alloc(M95320_SIZE); - m_stm95 = std::make_unique(machine(), (UINT8*)get_nvram_base()); + m_stm95 = std::make_unique(machine(), (uint8_t*)get_nvram_base()); save_item(NAME(m_rdcnt)); save_item(NAME(m_bank)); @@ -215,7 +215,7 @@ READ16_MEMBER(md_eeprom_stm95_device::read) { // ugly hack until we don't know much about game protection // first 3 reads from 15e6 return 0x00000010, then normal 0x00018010 value for crc check - UINT16 res; + uint16_t res; offset -= 0x0015e6/2; logerror("read 0x15e6 %d\n", m_rdcnt); if (m_rdcnt < 6) @@ -231,7 +231,7 @@ READ16_MEMBER(md_eeprom_stm95_device::read) return m_rom[offset]; else // last 0x180000 are bankswitched { - UINT8 bank = (offset - 0x280000/2) >> 18; + uint8_t bank = (offset - 0x280000/2) >> 18; return m_rom[(offset & 0x7ffff/2) + (m_bank[bank] * 0x80000)/2]; } } diff --git a/src/devices/bus/megadrive/stm95.h b/src/devices/bus/megadrive/stm95.h index 09e61670c14..1e0561f3fae 100644 --- a/src/devices/bus/megadrive/stm95.h +++ b/src/devices/bus/megadrive/stm95.h @@ -28,10 +28,10 @@ enum STMSTATE class stm95_eeprom_device { public: - stm95_eeprom_device(running_machine &machine, UINT8 *eeprom); + stm95_eeprom_device(running_machine &machine, uint8_t *eeprom); running_machine &machine() const { return m_machine; } - UINT8 *eeprom_data; + uint8_t *eeprom_data; void set_cs_line(int); void set_halt_line(int state) {}; // not implemented void set_si_line(int); @@ -60,8 +60,8 @@ class md_eeprom_stm95_device : public device_t, { public: // construction/destruction - md_eeprom_stm95_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); - md_eeprom_stm95_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_eeprom_stm95_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); + md_eeprom_stm95_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -73,7 +73,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write_a13) override; private: - UINT8 m_bank[3]; + uint8_t m_bank[3]; int m_rdcnt; std::unique_ptr m_stm95; diff --git a/src/devices/bus/megadrive/svp.cpp b/src/devices/bus/megadrive/svp.cpp index 589a58138a6..8aa370164f2 100644 --- a/src/devices/bus/megadrive/svp.cpp +++ b/src/devices/bus/megadrive/svp.cpp @@ -36,7 +36,7 @@ const device_type MD_ROM_SVP = &device_creator; -md_rom_svp_device::md_rom_svp_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) +md_rom_svp_device::md_rom_svp_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_md_cart_interface( mconfig, *this ), m_svp(*this, "svp"), @@ -44,7 +44,7 @@ md_rom_svp_device::md_rom_svp_device(const machine_config &mconfig, device_type { } -md_rom_svp_device::md_rom_svp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +md_rom_svp_device::md_rom_svp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MD_ROM_SVP, "MD Virtua Racing", tag, owner, clock, "md_rom_svp", __FILE__), device_md_cart_interface( mconfig, *this ), m_svp(*this, "svp"), @@ -71,7 +71,7 @@ static inline int get_inc(int mode) return inc; } -static inline void overwrite_write(UINT16 *dst, UINT16 d) +static inline void overwrite_write(uint16_t *dst, uint16_t d) { if (d & 0xf000) { *dst &= ~0xf000; *dst |= d & 0xf000; } if (d & 0x0f00) { *dst &= ~0x0f00; *dst |= d & 0x0f00; } @@ -81,7 +81,7 @@ static inline void overwrite_write(UINT16 *dst, UINT16 d) -UINT32 md_rom_svp_device::pm_io(int reg, int write, UINT32 d) +uint32_t md_rom_svp_device::pm_io(int reg, int write, uint32_t d) { if (m_emu_status & SSP_PMC_SET) { @@ -101,7 +101,7 @@ UINT32 md_rom_svp_device::pm_io(int reg, int write, UINT32 d) if (reg == 4 || (m_svp->state().state_int(SSP_ST) & 0x60)) { #define CADDR ((((mode<<16)&0x7f0000)|addr)<<1) - UINT16 *dram = (UINT16 *)m_dram; + uint16_t *dram = (uint16_t *)m_dram; if (write) { int mode = m_pmac_write[reg] >> 16; @@ -127,7 +127,7 @@ UINT32 md_rom_svp_device::pm_io(int reg, int write, UINT32 d) else if ((mode & 0x47ff) == 0x001c) // IRAM { int inc = get_inc(mode); - ((UINT16 *)m_iram)[addr & 0x3ff] = d; + ((uint16_t *)m_iram)[addr & 0x3ff] = d; m_pmac_write[reg] += inc; } else @@ -142,7 +142,7 @@ UINT32 md_rom_svp_device::pm_io(int reg, int write, UINT32 d) int addr = m_pmac_read[reg] & 0xffff; if ((mode & 0xfff0) == 0x0800) // ROM, inc 1, verified to be correct { - UINT16 *ROM = (UINT16 *)get_rom_base(); + uint16_t *ROM = (uint16_t *)get_rom_base(); m_pmac_read[reg] += 1; d = ROM[addr | ((mode & 0xf) << 16)]; } @@ -169,13 +169,13 @@ UINT32 md_rom_svp_device::pm_io(int reg, int write, UINT32 d) return d; } - return (UINT32)-1; + return (uint32_t)-1; } READ16_MEMBER( md_rom_svp_device::read_pm0 ) { - UINT32 d = pm_io(0, 0, 0); - if (d != (UINT32)-1) + uint32_t d = pm_io(0, 0, 0); + if (d != (uint32_t)-1) return d; d = m_xst2; m_xst2 &= ~2; // ? @@ -184,16 +184,16 @@ READ16_MEMBER( md_rom_svp_device::read_pm0 ) WRITE16_MEMBER( md_rom_svp_device::write_pm0 ) { - UINT32 r = pm_io(0, 1, data); - if (r != (UINT32)-1) + uint32_t r = pm_io(0, 1, data); + if (r != (uint32_t)-1) return; m_xst2 = data; // ? } READ16_MEMBER( md_rom_svp_device::read_pm1 ) { - UINT32 r = pm_io(1, 0, 0); - if (r != (UINT32)-1) + uint32_t r = pm_io(1, 0, 0); + if (r != (uint32_t)-1) return r; logerror("svp: PM1 acces in non PM mode?\n"); return 0; @@ -201,16 +201,16 @@ READ16_MEMBER( md_rom_svp_device::read_pm1 ) WRITE16_MEMBER( md_rom_svp_device::write_pm1 ) { - UINT32 r = pm_io(1, 1, data); - if (r != (UINT32)-1) + uint32_t r = pm_io(1, 1, data); + if (r != (uint32_t)-1) return; logerror("svp: PM1 acces in non PM mode?\n"); } READ16_MEMBER( md_rom_svp_device::read_pm2 ) { - UINT32 r = pm_io(2, 0, 0); - if (r != (UINT32)-1) + uint32_t r = pm_io(2, 0, 0); + if (r != (uint32_t)-1) return r; logerror("svp: PM2 acces in non PM mode?\n"); return 0; @@ -218,24 +218,24 @@ READ16_MEMBER( md_rom_svp_device::read_pm2 ) WRITE16_MEMBER( md_rom_svp_device::write_pm2 ) { - UINT32 r = pm_io(2, 1, data); - if (r != (UINT32)-1) + uint32_t r = pm_io(2, 1, data); + if (r != (uint32_t)-1) return; logerror("svp: PM2 acces in non PM mode?\n"); } READ16_MEMBER( md_rom_svp_device::read_xst ) { - UINT32 d = pm_io(3, 0, 0); - if (d != (UINT32)-1) + uint32_t d = pm_io(3, 0, 0); + if (d != (uint32_t)-1) return d; return m_xst; } WRITE16_MEMBER( md_rom_svp_device::write_xst ) { - UINT32 r = pm_io(3, 1, data); - if (r != (UINT32)-1) + uint32_t r = pm_io(3, 1, data); + if (r != (uint32_t)-1) return; m_xst2 |= 1; m_xst = data; @@ -294,7 +294,7 @@ WRITE16_MEMBER( md_rom_svp_device::write_al ) READ16_MEMBER( md_rom_svp_device::rom_read1 ) { - UINT16 *IRAM = (UINT16 *)m_iram; + uint16_t *IRAM = (uint16_t *)m_iram; return IRAM[offset]; } @@ -368,7 +368,7 @@ ioport_constructor md_rom_svp_device::device_input_ports() const } -void md_rom_svp_device::set_bank_to_rom(const char *banktag, UINT32 offset) +void md_rom_svp_device::set_bank_to_rom(const char *banktag, uint32_t offset) { if (membank(banktag)) membank(banktag)->set_base(m_rom + offset); @@ -404,7 +404,7 @@ void md_rom_svp_device::device_start() READ16_MEMBER(md_rom_svp_device::read) { - UINT16 *DRAM = (UINT16 *)m_dram; + uint16_t *DRAM = (uint16_t *)m_dram; if (offset >= 0x300000/2 && offset < 0x320000/2) { @@ -413,14 +413,14 @@ READ16_MEMBER(md_rom_svp_device::read) else if (offset >= 0x390000/2 && offset < 0x3a0000/2) { // this is rewritten 68k test code - UINT32 a1 = offset - 0x390000/2; + uint32_t a1 = offset - 0x390000/2; a1 = (a1 & 0x7001) | ((a1 & 0x3e) << 6) | ((a1 & 0xfc0) >> 5); return DRAM[a1]; } else if (offset >= 0x3a0000/2 && offset < 0x3b0000/2) { // this is rewritten 68k test code - UINT32 a1 = offset - 0x3a0000/2; + uint32_t a1 = offset - 0x3a0000/2; a1 = (a1 & 0x7801) | ((a1 & 0x1e) << 6) | ((a1 & 0x7e0) >> 4); return DRAM[a1]; } @@ -437,15 +437,15 @@ WRITE16_MEMBER(md_rom_svp_device::write) { if (offset >= 0x300000/2 && offset < 0x320000/2) { - UINT32 a1 = offset - 0x300000/2; - UINT16 *DRAM = (UINT16 *)m_dram; + uint32_t a1 = offset - 0x300000/2; + uint16_t *DRAM = (uint16_t *)m_dram; DRAM[a1] = data; } } READ16_MEMBER(md_rom_svp_device::read_a15) { - UINT32 d; + uint32_t d; switch (offset) { // 0xa15000, 0xa15002 diff --git a/src/devices/bus/megadrive/svp.h b/src/devices/bus/megadrive/svp.h index 73c230c92a0..57aa7713b67 100644 --- a/src/devices/bus/megadrive/svp.h +++ b/src/devices/bus/megadrive/svp.h @@ -17,15 +17,15 @@ class md_rom_svp_device : public device_t, { public: // construction/destruction - md_rom_svp_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); - md_rom_svp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + md_rom_svp_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); + md_rom_svp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); //protected: // device-level overrides virtual void device_start() override; virtual machine_config_constructor device_mconfig_additions() const override; virtual ioport_constructor device_input_ports() const override; - virtual void set_bank_to_rom(const char *banktag, UINT32 offset) override; + virtual void set_bank_to_rom(const char *banktag, uint32_t offset) override; required_device m_svp; required_ioport m_test_ipt; @@ -56,16 +56,16 @@ public: virtual DECLARE_WRITE16_MEMBER(write_pmc); virtual DECLARE_WRITE16_MEMBER(write_al); - UINT32 pm_io(int reg, int write, UINT32 d); + uint32_t pm_io(int reg, int write, uint32_t d); - UINT32 m_pmac_read[6]; // read modes/addrs for PM0-PM5 - UINT32 m_pmac_write[6]; // write ... + uint32_t m_pmac_read[6]; // read modes/addrs for PM0-PM5 + uint32_t m_pmac_write[6]; // write ... PAIR m_pmc; - UINT32 m_emu_status; - UINT16 m_xst; // external status, mapped at a15000 and a15002 on 68k side. - UINT16 m_xst2; // status of XST (bit1 set when 68k writes to XST) - UINT8 m_iram[0x800]; // IRAM (0-0x7ff) - UINT8 m_dram[0x20000]; // [0x20000]; + uint32_t m_emu_status; + uint16_t m_xst; // external status, mapped at a15000 and a15002 on 68k side. + uint16_t m_xst2; // status of XST (bit1 set when 68k writes to XST) + uint8_t m_iram[0x800]; // IRAM (0-0x7ff) + uint8_t m_dram[0x20000]; // [0x20000]; }; diff --git a/src/devices/bus/midi/midi.cpp b/src/devices/bus/midi/midi.cpp index cc8a9166f4f..b636ecbcdc1 100644 --- a/src/devices/bus/midi/midi.cpp +++ b/src/devices/bus/midi/midi.cpp @@ -4,7 +4,7 @@ const device_type MIDI_PORT = &device_creator; -midi_port_device::midi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +midi_port_device::midi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDI_PORT, "Midi Port", tag, owner, clock, "midi_port", __FILE__), device_slot_interface(mconfig, *this), m_rxd(0), diff --git a/src/devices/bus/midi/midi.h b/src/devices/bus/midi/midi.h index fcd16932637..350d6cac33e 100644 --- a/src/devices/bus/midi/midi.h +++ b/src/devices/bus/midi/midi.h @@ -20,7 +20,7 @@ class midi_port_device : public device_t, friend class device_midi_port_interface; public: - midi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midi_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~midi_port_device(); // static configuration helpers diff --git a/src/devices/bus/midi/midiinport.cpp b/src/devices/bus/midi/midiinport.cpp index 13632219c03..bfb1b2b9ac9 100644 --- a/src/devices/bus/midi/midiinport.cpp +++ b/src/devices/bus/midi/midiinport.cpp @@ -12,7 +12,7 @@ const device_type MIDIIN_PORT = &device_creator; -midiin_port_device::midiin_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +midiin_port_device::midiin_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDIIN_PORT, "MIDI In port", tag, owner, clock, "midiin_port", __FILE__), device_midi_port_interface(mconfig, *this), m_midiin(*this, "midiinimg") diff --git a/src/devices/bus/midi/midiinport.h b/src/devices/bus/midi/midiinport.h index 1f938855d70..0f69cb11620 100644 --- a/src/devices/bus/midi/midiinport.h +++ b/src/devices/bus/midi/midiinport.h @@ -18,7 +18,7 @@ class midiin_port_device : public device_t, public device_midi_port_interface { public: - midiin_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midiin_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( read ) { output_rxd(state); } diff --git a/src/devices/bus/midi/midioutport.cpp b/src/devices/bus/midi/midioutport.cpp index 6ba39d6ee57..1bf5a46200c 100644 --- a/src/devices/bus/midi/midioutport.cpp +++ b/src/devices/bus/midi/midioutport.cpp @@ -12,7 +12,7 @@ const device_type MIDIOUT_PORT = &device_creator; -midiout_port_device::midiout_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +midiout_port_device::midiout_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDIOUT_PORT, "MIDI Out port", tag, owner, clock, "midiout_port", __FILE__), device_midi_port_interface(mconfig, *this), m_midiout(*this, "midioutimg") diff --git a/src/devices/bus/midi/midioutport.h b/src/devices/bus/midi/midioutport.h index 4cfabf9eeea..8fca565f82d 100644 --- a/src/devices/bus/midi/midioutport.h +++ b/src/devices/bus/midi/midioutport.h @@ -18,7 +18,7 @@ class midiout_port_device : public device_t, public device_midi_port_interface { public: - midiout_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midiout_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override { if (started()) m_midiout->tx(state); } diff --git a/src/devices/bus/msx_cart/arc.cpp b/src/devices/bus/msx_cart/arc.cpp index a64f321af14..3aa7e52dcdd 100644 --- a/src/devices/bus/msx_cart/arc.cpp +++ b/src/devices/bus/msx_cart/arc.cpp @@ -7,7 +7,7 @@ const device_type MSX_CART_ARC = &device_creator; -msx_cart_arc::msx_cart_arc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_arc::msx_cart_arc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_ARC, "MSX Cartridge - Arc", tag, owner, clock, "msx_cart_arc", __FILE__) , msx_cart_interface(mconfig, *this) , m_7f(0) diff --git a/src/devices/bus/msx_cart/arc.h b/src/devices/bus/msx_cart/arc.h index 29f24bc7e66..748b225935d 100644 --- a/src/devices/bus/msx_cart/arc.h +++ b/src/devices/bus/msx_cart/arc.h @@ -13,7 +13,7 @@ class msx_cart_arc : public device_t , public msx_cart_interface { public: - msx_cart_arc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_arc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -27,7 +27,7 @@ public: DECLARE_READ8_MEMBER(io_7f_r); private: - UINT8 m_7f; + uint8_t m_7f; }; diff --git a/src/devices/bus/msx_cart/ascii.cpp b/src/devices/bus/msx_cart/ascii.cpp index 04ef820e7d9..dadc92e6606 100644 --- a/src/devices/bus/msx_cart/ascii.cpp +++ b/src/devices/bus/msx_cart/ascii.cpp @@ -11,7 +11,7 @@ const device_type MSX_CART_ASCII16_SRAM = &device_creator const device_type MSX_CART_MSXWRITE = &device_creator; -msx_cart_ascii8::msx_cart_ascii8(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_ascii8::msx_cart_ascii8(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_ASCII8, "MSX Cartridge - ASCII8", tag, owner, clock, "msx_cart_ascii8", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_mask(0) @@ -52,14 +52,14 @@ void msx_cart_ascii8::device_reset() void msx_cart_ascii8::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( size > 256 * 0x2000 ) { fatalerror("ascii8: ROM is too big\n"); } - UINT16 banks = size / 0x2000; + uint16_t banks = size / 0x2000; if (size != banks * 0x2000 || (~(banks - 1) % banks)) { @@ -86,7 +86,7 @@ WRITE8_MEMBER(msx_cart_ascii8::write_cart) { if (offset >= 0x6000 && offset < 0x8000) { - UINT8 bank = (offset / 0x800) & 0x03; + uint8_t bank = (offset / 0x800) & 0x03; m_selected_bank[bank] = data; m_bank_base[bank] = get_rom_base() + (m_selected_bank[bank] & m_bank_mask ) * 0x2000; @@ -95,7 +95,7 @@ WRITE8_MEMBER(msx_cart_ascii8::write_cart) -msx_cart_ascii16::msx_cart_ascii16(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_ascii16::msx_cart_ascii16(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_ASCII16, "MSX Cartridge - ASCII16", tag, owner, clock, "msx_cart_ascii16", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_mask(0) @@ -136,14 +136,14 @@ void msx_cart_ascii16::device_reset() void msx_cart_ascii16::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( size > 256 * 0x4000 ) { fatalerror("ascii16: ROM is too big\n"); } - UINT16 banks = size / 0x4000; + uint16_t banks = size / 0x4000; if (size != banks * 0x4000 || (~(banks - 1) % banks)) { @@ -185,7 +185,7 @@ WRITE8_MEMBER(msx_cart_ascii16::write_cart) -msx_cart_ascii8_sram::msx_cart_ascii8_sram(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_ascii8_sram::msx_cart_ascii8_sram(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_ASCII8_SRAM, "MSX Cartridge - ASCII8 w/SRAM", tag, owner, clock, "msx_cart_ascii8_sram", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_mask(0) @@ -207,7 +207,7 @@ void msx_cart_ascii8_sram::device_start() } -void msx_cart_ascii8_sram::setup_bank(UINT8 bank) +void msx_cart_ascii8_sram::setup_bank(uint8_t bank) { if (m_selected_bank[bank] & ~(m_sram_select_mask | m_bank_mask)) { @@ -246,14 +246,14 @@ void msx_cart_ascii8_sram::device_reset() void msx_cart_ascii8_sram::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( size > 128 * 0x2000 ) { fatalerror("ascii8_sram: ROM is too big\n"); } - UINT16 banks = size / 0x2000; + uint16_t banks = size / 0x2000; if (size != banks * 0x2000 || (~(banks - 1) % banks)) { @@ -276,7 +276,7 @@ READ8_MEMBER(msx_cart_ascii8_sram::read_cart) { if ( offset >= 0x4000 && offset < 0xC000 ) { - UINT8 *bank_base = m_bank_base[(offset - 0x4000) >> 13]; + uint8_t *bank_base = m_bank_base[(offset - 0x4000) >> 13]; if (bank_base != nullptr) { @@ -291,14 +291,14 @@ WRITE8_MEMBER(msx_cart_ascii8_sram::write_cart) { if (offset >= 0x6000 && offset < 0x8000) { - UINT8 bank = (offset / 0x800) & 0x03; + uint8_t bank = (offset / 0x800) & 0x03; m_selected_bank[bank] = data; setup_bank(bank); } else if (offset >= 0x8000 && offset < 0xc000) { - UINT8 bank = (offset & 0x2000) ? 3 : 2; + uint8_t bank = (offset & 0x2000) ? 3 : 2; if ((m_selected_bank[bank] & m_sram_select_mask) && !(m_selected_bank[bank] & ~(m_sram_select_mask | m_bank_mask))) { @@ -310,7 +310,7 @@ WRITE8_MEMBER(msx_cart_ascii8_sram::write_cart) -msx_cart_ascii16_sram::msx_cart_ascii16_sram(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_ascii16_sram::msx_cart_ascii16_sram(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_ASCII16_SRAM, "MSX Cartridge - ASCII16 w/SRAM", tag, owner, clock, "msx_cart_ascii16_sram", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_mask(0) @@ -332,7 +332,7 @@ void msx_cart_ascii16_sram::device_start() } -void msx_cart_ascii16_sram::setup_bank(UINT8 bank) +void msx_cart_ascii16_sram::setup_bank(uint8_t bank) { if (m_selected_bank[bank] & ~(m_sram_select_mask | m_bank_mask)) { @@ -371,14 +371,14 @@ void msx_cart_ascii16_sram::device_reset() void msx_cart_ascii16_sram::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( size > 128 * 0x4000 ) { fatalerror("ascii16_sram: ROM is too big\n"); } - UINT16 banks = size / 0x4000; + uint16_t banks = size / 0x4000; if (size != banks * 0x4000 || (~(banks - 1) % banks)) { @@ -401,7 +401,7 @@ READ8_MEMBER(msx_cart_ascii16_sram::read_cart) { if ( offset >= 0x4000 && offset < 0xC000 ) { - UINT8 bank = offset >> 15; + uint8_t bank = offset >> 15; if (m_bank_base[bank] != nullptr) { @@ -445,7 +445,7 @@ WRITE8_MEMBER(msx_cart_ascii16_sram::write_cart) -msx_cart_msxwrite::msx_cart_msxwrite(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_msxwrite::msx_cart_msxwrite(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_MSXWRITE, "MSX Cartridge - MSXWRITE", tag, owner, clock, "msx_cart_msxwrite", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_mask(0) @@ -486,14 +486,14 @@ void msx_cart_msxwrite::device_reset() void msx_cart_msxwrite::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( size > 256 * 0x4000 ) { fatalerror("msxwrite: ROM is too big\n"); } - UINT16 banks = size / 0x4000; + uint16_t banks = size / 0x4000; if (size != banks * 0x4000 || (~(banks - 1) % banks)) { diff --git a/src/devices/bus/msx_cart/ascii.h b/src/devices/bus/msx_cart/ascii.h index d66cff8ff25..926560d1bea 100644 --- a/src/devices/bus/msx_cart/ascii.h +++ b/src/devices/bus/msx_cart/ascii.h @@ -17,7 +17,7 @@ class msx_cart_ascii8 : public device_t , public msx_cart_interface { public: - msx_cart_ascii8(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_ascii8(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -31,9 +31,9 @@ public: void restore_banks(); private: - UINT8 m_bank_mask; - UINT8 m_selected_bank[4]; - UINT8 *m_bank_base[4]; + uint8_t m_bank_mask; + uint8_t m_selected_bank[4]; + uint8_t *m_bank_base[4]; }; @@ -41,7 +41,7 @@ class msx_cart_ascii16 : public device_t , public msx_cart_interface { public: - msx_cart_ascii16(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_ascii16(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -55,9 +55,9 @@ public: void restore_banks(); private: - UINT8 m_bank_mask; - UINT8 m_selected_bank[2]; - UINT8 *m_bank_base[2]; + uint8_t m_bank_mask; + uint8_t m_selected_bank[2]; + uint8_t *m_bank_base[2]; }; @@ -65,7 +65,7 @@ class msx_cart_ascii8_sram : public device_t , public msx_cart_interface { public: - msx_cart_ascii8_sram(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_ascii8_sram(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -79,12 +79,12 @@ public: void restore_banks(); private: - UINT8 m_bank_mask; - UINT8 m_selected_bank[4]; - UINT8 *m_bank_base[4]; - UINT8 m_sram_select_mask; + uint8_t m_bank_mask; + uint8_t m_selected_bank[4]; + uint8_t *m_bank_base[4]; + uint8_t m_sram_select_mask; - void setup_bank(UINT8 bank); + void setup_bank(uint8_t bank); }; @@ -92,7 +92,7 @@ class msx_cart_ascii16_sram : public device_t , public msx_cart_interface { public: - msx_cart_ascii16_sram(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_ascii16_sram(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -106,12 +106,12 @@ public: void restore_banks(); private: - UINT8 m_bank_mask; - UINT8 m_selected_bank[2]; - UINT8 *m_bank_base[2]; - UINT8 m_sram_select_mask; + uint8_t m_bank_mask; + uint8_t m_selected_bank[2]; + uint8_t *m_bank_base[2]; + uint8_t m_sram_select_mask; - void setup_bank(UINT8 bank); + void setup_bank(uint8_t bank); }; @@ -119,7 +119,7 @@ class msx_cart_msxwrite : public device_t , public msx_cart_interface { public: - msx_cart_msxwrite(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_msxwrite(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -133,9 +133,9 @@ public: void restore_banks(); private: - UINT8 m_bank_mask; - UINT8 m_selected_bank[2]; - UINT8 *m_bank_base[2]; + uint8_t m_bank_mask; + uint8_t m_selected_bank[2]; + uint8_t *m_bank_base[2]; }; #endif diff --git a/src/devices/bus/msx_cart/bm_012.cpp b/src/devices/bus/msx_cart/bm_012.cpp index 4939d15e902..0ef22130923 100644 --- a/src/devices/bus/msx_cart/bm_012.cpp +++ b/src/devices/bus/msx_cart/bm_012.cpp @@ -22,7 +22,7 @@ TODO: const device_type MSX_CART_BM_012 = &device_creator; -msx_cart_bm_012::msx_cart_bm_012(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_bm_012::msx_cart_bm_012(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_BM_012, "MSX Cartridge - BM-012", tag, owner, clock, "msx_cart_bm_012", __FILE__) , msx_cart_interface(mconfig, *this) , m_tmpz84c015af(*this, "tmpz84c015af") diff --git a/src/devices/bus/msx_cart/bm_012.h b/src/devices/bus/msx_cart/bm_012.h index 8cab8e268e9..4c526f3ac49 100644 --- a/src/devices/bus/msx_cart/bm_012.h +++ b/src/devices/bus/msx_cart/bm_012.h @@ -15,7 +15,7 @@ class msx_cart_bm_012 : public device_t , public msx_cart_interface { public: - msx_cart_bm_012(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_bm_012(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/msx_cart/cartridge.cpp b/src/devices/bus/msx_cart/cartridge.cpp index 7f990101a08..4dae6ac0471 100644 --- a/src/devices/bus/msx_cart/cartridge.cpp +++ b/src/devices/bus/msx_cart/cartridge.cpp @@ -75,25 +75,25 @@ msx_cart_interface::msx_cart_interface(const machine_config &mconfig, device_t & { } -void msx_cart_interface::rom_alloc(UINT32 size) +void msx_cart_interface::rom_alloc(uint32_t size) { m_rom.resize(size); memset(&m_rom[0], 0xff, size); } -void msx_cart_interface::rom_vlm5030_alloc(UINT32 size) +void msx_cart_interface::rom_vlm5030_alloc(uint32_t size) { m_rom_vlm5030.resize(size); memset(&m_rom_vlm5030[0], 0xff, size); } -void msx_cart_interface::ram_alloc(UINT32 size) +void msx_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); memset(&m_ram[0], 0x00, size); } -void msx_cart_interface::sram_alloc(UINT32 size) +void msx_cart_interface::sram_alloc(uint32_t size) { m_sram.resize(size); memset(&m_sram[0], 0x00, size); diff --git a/src/devices/bus/msx_cart/cartridge.h b/src/devices/bus/msx_cart/cartridge.h index 6016d30202a..5025f6cfa2b 100644 --- a/src/devices/bus/msx_cart/cartridge.h +++ b/src/devices/bus/msx_cart/cartridge.h @@ -26,25 +26,25 @@ public: // ROM/RAM/SRAM management // Mainly used by the cartridge slot when loading images - void rom_alloc(UINT32 size); - void ram_alloc(UINT32 size); - void rom_vlm5030_alloc(UINT32 size); - void sram_alloc(UINT32 size); - - UINT8* get_rom_base() { return &m_rom[0]; } - UINT8* get_rom_vlm5030_base() { return &m_rom_vlm5030[0]; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT8* get_sram_base() { return &m_sram[0]; } - UINT32 get_rom_size() { return m_rom.size(); } - UINT32 get_rom_vlm5030_size() { return m_rom_vlm5030.size(); } - UINT32 get_ram_size() { return m_ram.size(); } - UINT32 get_sram_size() { return m_sram.size(); } + void rom_alloc(uint32_t size); + void ram_alloc(uint32_t size); + void rom_vlm5030_alloc(uint32_t size); + void sram_alloc(uint32_t size); + + uint8_t* get_rom_base() { return &m_rom[0]; } + uint8_t* get_rom_vlm5030_base() { return &m_rom_vlm5030[0]; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint8_t* get_sram_base() { return &m_sram[0]; } + uint32_t get_rom_size() { return m_rom.size(); } + uint32_t get_rom_vlm5030_size() { return m_rom_vlm5030.size(); } + uint32_t get_ram_size() { return m_ram.size(); } + uint32_t get_sram_size() { return m_sram.size(); } protected: - std::vector m_rom; - std::vector m_ram; - std::vector m_rom_vlm5030; - std::vector m_sram; + std::vector m_rom; + std::vector m_ram; + std::vector m_rom_vlm5030; + std::vector m_sram; devcb_write_line m_out_irq_cb; }; diff --git a/src/devices/bus/msx_cart/crossblaim.cpp b/src/devices/bus/msx_cart/crossblaim.cpp index f36f7b4b8cc..99f081e1eb0 100644 --- a/src/devices/bus/msx_cart/crossblaim.cpp +++ b/src/devices/bus/msx_cart/crossblaim.cpp @@ -6,7 +6,7 @@ const device_type MSX_CART_CROSSBLAIM = &device_creator; -msx_cart_crossblaim::msx_cart_crossblaim(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_crossblaim::msx_cart_crossblaim(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_CROSSBLAIM, "MSX Cartridge - Cross Blaim", tag, owner, clock, "msx_cart_crossblaim", __FILE__) , msx_cart_interface(mconfig, *this) , m_selected_bank(1) @@ -60,7 +60,7 @@ void msx_cart_crossblaim::initialize_cartridge() READ8_MEMBER(msx_cart_crossblaim::read_cart) { - UINT8 *bank_base = m_bank_base[offset >> 14]; + uint8_t *bank_base = m_bank_base[offset >> 14]; if (bank_base != nullptr) { diff --git a/src/devices/bus/msx_cart/crossblaim.h b/src/devices/bus/msx_cart/crossblaim.h index 85af99795fb..8ee0a0ad6a7 100644 --- a/src/devices/bus/msx_cart/crossblaim.h +++ b/src/devices/bus/msx_cart/crossblaim.h @@ -13,7 +13,7 @@ class msx_cart_crossblaim : public device_t , public msx_cart_interface { public: - msx_cart_crossblaim(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_crossblaim(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -27,8 +27,8 @@ public: void restore_banks(); private: - UINT8 m_selected_bank; - UINT8 *m_bank_base[4]; + uint8_t m_selected_bank; + uint8_t *m_bank_base[4]; void setup_bank(); }; diff --git a/src/devices/bus/msx_cart/disk.cpp b/src/devices/bus/msx_cart/disk.cpp index 11789e0a79f..e025ae73ce2 100644 --- a/src/devices/bus/msx_cart/disk.cpp +++ b/src/devices/bus/msx_cart/disk.cpp @@ -122,7 +122,7 @@ static SLOT_INTERFACE_START( msx_floppies ) SLOT_INTERFACE_END -msx_cart_disk::msx_cart_disk(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +msx_cart_disk::msx_cart_disk(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__) , msx_cart_interface(mconfig, *this) , m_floppy0(*this, "fdc:0") @@ -132,53 +132,53 @@ msx_cart_disk::msx_cart_disk(const machine_config &mconfig, device_type type, co } -msx_cart_disk_wd::msx_cart_disk_wd(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +msx_cart_disk_wd::msx_cart_disk_wd(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname) : msx_cart_disk(mconfig, type, name, tag, owner, clock, shortname) , m_fdc(*this, "fdc") { } -msx_cart_disk_type1::msx_cart_disk_type1(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +msx_cart_disk_type1::msx_cart_disk_type1(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname) : msx_cart_disk_wd(mconfig, type, name, tag, owner, clock, shortname), m_side_control(0) , m_control(0) { } -msx_cart_disk_type2::msx_cart_disk_type2(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +msx_cart_disk_type2::msx_cart_disk_type2(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname) : msx_cart_disk_wd(mconfig, type, name, tag, owner, clock, shortname) , m_control(0) { } -msx_cart_vy0010::msx_cart_vy0010(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_vy0010::msx_cart_vy0010(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_cart_disk_type1(mconfig, MSX_CART_VY0010, "MSX Cartridge - VY0010", tag, owner, clock, "msx_cart_vy0010") { } -msx_cart_fsfd1::msx_cart_fsfd1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_fsfd1::msx_cart_fsfd1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_cart_disk_type1(mconfig, MSX_CART_FSFD1, "MSX Cartridge - FS-FD1", tag, owner, clock, "msx_cart_fsfd1") { } -msx_cart_fscf351::msx_cart_fscf351(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_fscf351::msx_cart_fscf351(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_cart_disk_type2(mconfig, MSX_CART_FSCF351, "MSX Cartridge - FS-CF351", tag, owner, clock, "msx_cart_fscf351") { } -msx_cart_disk_tc8566::msx_cart_disk_tc8566(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +msx_cart_disk_tc8566::msx_cart_disk_tc8566(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname) : msx_cart_disk(mconfig, type, name, tag, owner, clock, shortname) , m_fdc(*this, "fdc") { } -msx_cart_fsfd1a::msx_cart_fsfd1a(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_fsfd1a::msx_cart_fsfd1a(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_cart_disk_tc8566(mconfig, MSX_CART_FSFD1A, "MSX Cartridge - FS-FD1A", tag, owner, clock, "msx_cart_fsfd1a") { } @@ -294,7 +294,7 @@ void msx_cart_disk_type1::device_start() void msx_cart_disk_type1::post_load() { - UINT8 data = m_control; + uint8_t data = m_control; // To make sure the FDD busy led status gets set correctly m_control ^= 0x40; @@ -303,9 +303,9 @@ void msx_cart_disk_type1::post_load() } -void msx_cart_disk_type1::set_control(UINT8 data) +void msx_cart_disk_type1::set_control(uint8_t data) { - UINT8 old_m_control = m_control; + uint8_t old_m_control = m_control; m_control = data; @@ -340,7 +340,7 @@ void msx_cart_disk_type1::set_control(UINT8 data) } -void msx_cart_disk_type1::set_side_control(UINT8 data) +void msx_cart_disk_type1::set_side_control(uint8_t data) { m_side_control = data; @@ -455,7 +455,7 @@ void msx_cart_disk_type2::device_reset() void msx_cart_disk_type2::post_load() { - UINT8 data = m_control; + uint8_t data = m_control; // To make sure the FDD busy led status gets set correctly m_control ^= 0x40; @@ -464,9 +464,9 @@ void msx_cart_disk_type2::post_load() } -void msx_cart_disk_type2::set_control(UINT8 data) +void msx_cart_disk_type2::set_control(uint8_t data) { - UINT8 old_m_control = m_control; + uint8_t old_m_control = m_control; m_control = data; diff --git a/src/devices/bus/msx_cart/disk.h b/src/devices/bus/msx_cart/disk.h index f941e7e5668..2724ef39d4e 100644 --- a/src/devices/bus/msx_cart/disk.h +++ b/src/devices/bus/msx_cart/disk.h @@ -20,7 +20,7 @@ class msx_cart_disk : public device_t , public msx_cart_interface { public: - msx_cart_disk(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + msx_cart_disk(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); virtual void initialize_cartridge() override; @@ -36,7 +36,7 @@ protected: class msx_cart_disk_wd : public msx_cart_disk { public: - msx_cart_disk_wd(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + msx_cart_disk_wd(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); protected: required_device m_fdc; @@ -46,7 +46,7 @@ protected: class msx_cart_disk_type1 : public msx_cart_disk_wd { public: - msx_cart_disk_type1(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + msx_cart_disk_type1(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); // device-level overrides virtual void device_start() override; @@ -58,18 +58,18 @@ public: void post_load(); protected: - UINT8 m_side_control; - UINT8 m_control; + uint8_t m_side_control; + uint8_t m_control; - void set_side_control(UINT8 data); - void set_control(UINT8 data); + void set_side_control(uint8_t data); + void set_control(uint8_t data); }; class msx_cart_disk_type2 : public msx_cart_disk_wd { public: - msx_cart_disk_type2(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + msx_cart_disk_type2(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); // device-level overrides virtual void device_start() override; @@ -81,16 +81,16 @@ public: void post_load(); protected: - UINT8 m_control; + uint8_t m_control; - void set_control(UINT8 data); + void set_control(uint8_t data); }; class msx_cart_vy0010 : public msx_cart_disk_type1 { public: - msx_cart_vy0010(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_vy0010(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; @@ -99,7 +99,7 @@ public: class msx_cart_fsfd1 : public msx_cart_disk_type1 { public: - msx_cart_fsfd1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_fsfd1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; @@ -108,7 +108,7 @@ public: class msx_cart_fscf351 : public msx_cart_disk_type2 { public: - msx_cart_fscf351(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_fscf351(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; @@ -117,7 +117,7 @@ public: class msx_cart_disk_tc8566 : public msx_cart_disk { public: - msx_cart_disk_tc8566(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + msx_cart_disk_tc8566(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); protected: required_device m_fdc; @@ -127,7 +127,7 @@ protected: class msx_cart_fsfd1a : public msx_cart_disk_tc8566 { public: - msx_cart_fsfd1a(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_fsfd1a(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/devices/bus/msx_cart/dooly.cpp b/src/devices/bus/msx_cart/dooly.cpp index 95f2748b04a..494e1bf7207 100644 --- a/src/devices/bus/msx_cart/dooly.cpp +++ b/src/devices/bus/msx_cart/dooly.cpp @@ -7,7 +7,7 @@ const device_type MSX_CART_DOOLY = &device_creator; -msx_cart_dooly::msx_cart_dooly(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_dooly::msx_cart_dooly(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_DOOLY, "MSX Cartridge - Dooly", tag, owner, clock, "msx_cart_dooly", __FILE__) , msx_cart_interface(mconfig, *this) , m_prot(0) @@ -40,7 +40,7 @@ READ8_MEMBER(msx_cart_dooly::read_cart) { if (offset >= 0x4000 && offset < 0xc000) { - UINT8 data = get_rom_base()[offset - 0x4000]; + uint8_t data = get_rom_base()[offset - 0x4000]; switch (m_prot) { diff --git a/src/devices/bus/msx_cart/dooly.h b/src/devices/bus/msx_cart/dooly.h index dca29881c5f..150d8ad452a 100644 --- a/src/devices/bus/msx_cart/dooly.h +++ b/src/devices/bus/msx_cart/dooly.h @@ -13,7 +13,7 @@ class msx_cart_dooly : public device_t , public msx_cart_interface { public: - msx_cart_dooly(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_dooly(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -25,7 +25,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_cart) override; private: - UINT8 m_prot; + uint8_t m_prot; }; diff --git a/src/devices/bus/msx_cart/fmpac.cpp b/src/devices/bus/msx_cart/fmpac.cpp index 44b934d17f5..0654c27b1fe 100644 --- a/src/devices/bus/msx_cart/fmpac.cpp +++ b/src/devices/bus/msx_cart/fmpac.cpp @@ -13,7 +13,7 @@ with: PAC2 BACKUP DATA. We only store the raw sram contents. const device_type MSX_CART_FMPAC = &device_creator; -msx_cart_fmpac::msx_cart_fmpac(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_fmpac::msx_cart_fmpac(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_FMPAC, "MSX Cartridge - FM-PAC", tag, owner, clock, "msx_cart_fmpac", __FILE__) , msx_cart_interface(mconfig, *this) , m_ym2413(*this, "ym2413") diff --git a/src/devices/bus/msx_cart/fmpac.h b/src/devices/bus/msx_cart/fmpac.h index 4fe13f8d084..ed75abdbe05 100644 --- a/src/devices/bus/msx_cart/fmpac.h +++ b/src/devices/bus/msx_cart/fmpac.h @@ -14,7 +14,7 @@ class msx_cart_fmpac : public device_t , public msx_cart_interface { public: - msx_cart_fmpac(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_fmpac(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -33,13 +33,13 @@ public: private: required_device m_ym2413; - UINT8 m_selected_bank; - UINT8 *m_bank_base; + uint8_t m_selected_bank; + uint8_t *m_bank_base; bool m_sram_active; bool m_opll_active; - UINT8 m_1ffe; - UINT8 m_1fff; - UINT8 m_7ff6; + uint8_t m_1ffe; + uint8_t m_1fff; + uint8_t m_7ff6; }; diff --git a/src/devices/bus/msx_cart/fs_sr022.cpp b/src/devices/bus/msx_cart/fs_sr022.cpp index df3819fc6b3..efea17e4153 100644 --- a/src/devices/bus/msx_cart/fs_sr022.cpp +++ b/src/devices/bus/msx_cart/fs_sr022.cpp @@ -7,7 +7,7 @@ const device_type MSX_CART_FS_SR022 = &device_creator; -msx_cart_fs_sr022::msx_cart_fs_sr022(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_fs_sr022::msx_cart_fs_sr022(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_FS_SR022, "MSX Cartridge - FS-SR022", tag, owner, clock, "msx_cart_fs_sr022", __FILE__) , msx_cart_interface(mconfig, *this) , m_bunsetsu_rom(nullptr) diff --git a/src/devices/bus/msx_cart/fs_sr022.h b/src/devices/bus/msx_cart/fs_sr022.h index 4555520f5b3..8318669d198 100644 --- a/src/devices/bus/msx_cart/fs_sr022.h +++ b/src/devices/bus/msx_cart/fs_sr022.h @@ -13,7 +13,7 @@ class msx_cart_fs_sr022 : public device_t , public msx_cart_interface { public: - msx_cart_fs_sr022(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_fs_sr022(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -25,8 +25,8 @@ public: virtual DECLARE_WRITE8_MEMBER(write_cart) override; private: - const UINT8 *m_bunsetsu_rom; - UINT32 m_bunsetsu_address; + const uint8_t *m_bunsetsu_rom; + uint32_t m_bunsetsu_address; }; diff --git a/src/devices/bus/msx_cart/halnote.cpp b/src/devices/bus/msx_cart/halnote.cpp index d37354dd0a5..13b85a3cf77 100644 --- a/src/devices/bus/msx_cart/halnote.cpp +++ b/src/devices/bus/msx_cart/halnote.cpp @@ -7,7 +7,7 @@ const device_type MSX_CART_HALNOTE = &device_creator; -msx_cart_halnote::msx_cart_halnote(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_halnote::msx_cart_halnote(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_HALNOTE, "MSX Cartridge - Halnote", tag, owner, clock, "msx_cart_halnote", __FILE__) , msx_cart_interface(mconfig, *this) { @@ -99,7 +99,7 @@ READ8_MEMBER(msx_cart_halnote::read_cart) return m_bank_base[6 + ((offset >> 11) & 0x01)][offset & 0x7ff]; } - const UINT8 *mem = m_bank_base[offset >> 13]; + const uint8_t *mem = m_bank_base[offset >> 13]; if (mem) { diff --git a/src/devices/bus/msx_cart/halnote.h b/src/devices/bus/msx_cart/halnote.h index 5d59ce7cd35..79002eca1bc 100644 --- a/src/devices/bus/msx_cart/halnote.h +++ b/src/devices/bus/msx_cart/halnote.h @@ -13,7 +13,7 @@ class msx_cart_halnote : public device_t , public msx_cart_interface { public: - msx_cart_halnote(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_halnote(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -27,8 +27,8 @@ public: void restore_banks(); private: - UINT8 m_selected_bank[8]; - UINT8 *m_bank_base[8]; + uint8_t m_selected_bank[8]; + uint8_t *m_bank_base[8]; void map_bank(int bank); }; diff --git a/src/devices/bus/msx_cart/hfox.cpp b/src/devices/bus/msx_cart/hfox.cpp index a0f2f7c4556..e5879cee778 100644 --- a/src/devices/bus/msx_cart/hfox.cpp +++ b/src/devices/bus/msx_cart/hfox.cpp @@ -7,7 +7,7 @@ const device_type MSX_CART_HFOX = &device_creator; -msx_cart_hfox::msx_cart_hfox(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_hfox::msx_cart_hfox(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_HFOX, "MSX Cartridge - Harry Fox", tag, owner, clock, "msx_cart_hfox", __FILE__) , msx_cart_interface(mconfig, *this) { diff --git a/src/devices/bus/msx_cart/hfox.h b/src/devices/bus/msx_cart/hfox.h index c51bd77cd2f..7e58a07b10f 100644 --- a/src/devices/bus/msx_cart/hfox.h +++ b/src/devices/bus/msx_cart/hfox.h @@ -13,7 +13,7 @@ class msx_cart_hfox : public device_t , public msx_cart_interface { public: - msx_cart_hfox(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_hfox(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -27,8 +27,8 @@ public: void restore_banks(); private: - UINT8 m_selected_bank[2]; - UINT8 *m_bank_base[2]; + uint8_t m_selected_bank[2]; + uint8_t *m_bank_base[2]; }; diff --git a/src/devices/bus/msx_cart/holy_quran.cpp b/src/devices/bus/msx_cart/holy_quran.cpp index 7671e8624de..3c5ae04dc0c 100644 --- a/src/devices/bus/msx_cart/holy_quran.cpp +++ b/src/devices/bus/msx_cart/holy_quran.cpp @@ -7,7 +7,7 @@ const device_type MSX_CART_HOLY_QURAN = &device_creator; -msx_cart_holy_quran::msx_cart_holy_quran(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_holy_quran::msx_cart_holy_quran(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_HOLY_QURAN, "MSX Cartridge - Holy Quran", tag, owner, clock, "msx_cart_holy_quran", __FILE__) , msx_cart_interface(mconfig, *this) , m_decrypt(false) @@ -72,7 +72,7 @@ READ8_MEMBER(msx_cart_holy_quran::read_cart) { if (offset >= 0x4000 && offset < 0xc000) { - UINT8 data = m_bank_base[(offset - 0x4000) >> 13][offset & 0x1fff]; + uint8_t data = m_bank_base[(offset - 0x4000) >> 13][offset & 0x1fff]; if (m_decrypt) { diff --git a/src/devices/bus/msx_cart/holy_quran.h b/src/devices/bus/msx_cart/holy_quran.h index 00ae6bc92f4..0b2bd1a06f8 100644 --- a/src/devices/bus/msx_cart/holy_quran.h +++ b/src/devices/bus/msx_cart/holy_quran.h @@ -13,7 +13,7 @@ class msx_cart_holy_quran : public device_t , public msx_cart_interface { public: - msx_cart_holy_quran(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_holy_quran(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -27,9 +27,9 @@ public: void restore_banks(); private: - UINT8 m_lookup_prot[256]; - UINT8 m_selected_bank[4]; - UINT8 *m_bank_base[4]; + uint8_t m_lookup_prot[256]; + uint8_t m_selected_bank[4]; + uint8_t *m_bank_base[4]; bool m_decrypt; }; diff --git a/src/devices/bus/msx_cart/konami.cpp b/src/devices/bus/msx_cart/konami.cpp index 659fdf054ea..f30685bf01f 100644 --- a/src/devices/bus/msx_cart/konami.cpp +++ b/src/devices/bus/msx_cart/konami.cpp @@ -13,7 +13,7 @@ const device_type MSX_CART_SOUND_SDSNATCHER = &device_creator; -msx_cart_konami::msx_cart_konami(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_konami::msx_cart_konami(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_KONAMI, "MSX Cartridge - KONAMI", tag, owner, clock, "msx_cart_konami", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_mask(0) @@ -61,14 +61,14 @@ void msx_cart_konami::device_reset() void msx_cart_konami::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( get_rom_size() > 256 * 0x2000 ) { fatalerror("konami: ROM is too big\n"); } - UINT16 banks = size / 0x2000; + uint16_t banks = size / 0x2000; if (size != banks * 0x2000 || (~(banks - 1) % banks)) { @@ -120,7 +120,7 @@ WRITE8_MEMBER(msx_cart_konami::write_cart) -msx_cart_konami_scc::msx_cart_konami_scc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_konami_scc::msx_cart_konami_scc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_KONAMI_SCC, "MSX Cartridge - KONAMI+SCC", tag, owner, clock, "msx_cart_konami_scc", __FILE__) , msx_cart_interface(mconfig, *this) , m_k051649(*this, "k051649") @@ -186,14 +186,14 @@ void msx_cart_konami_scc::device_reset() void msx_cart_konami_scc::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( get_rom_size() > 256 * 0x2000 ) { fatalerror("konami_scc: ROM is too big\n"); } - UINT16 banks = size / 0x2000; + uint16_t banks = size / 0x2000; if (size != banks * 0x2000 || (~(banks - 1) % banks)) { @@ -296,7 +296,7 @@ WRITE8_MEMBER(msx_cart_konami_scc::write_cart) -msx_cart_gamemaster2::msx_cart_gamemaster2(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_gamemaster2::msx_cart_gamemaster2(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_GAMEMASTER2, "MSX Cartridge - GAMEMASTER2", tag, owner, clock, "msx_cart_gamemaster2", __FILE__) , msx_cart_interface(mconfig, *this) { @@ -319,7 +319,7 @@ void msx_cart_gamemaster2::device_start() } -void msx_cart_gamemaster2::setup_bank(UINT8 bank) +void msx_cart_gamemaster2::setup_bank(uint8_t bank) { switch (bank) { @@ -402,7 +402,7 @@ void msx_cart_gamemaster2::initialize_cartridge() READ8_MEMBER(msx_cart_gamemaster2::read_cart) { - UINT8 bank = offset >> 13; + uint8_t bank = offset >> 13; switch (bank) { @@ -466,7 +466,7 @@ WRITE8_MEMBER(msx_cart_gamemaster2::write_cart) -msx_cart_synthesizer::msx_cart_synthesizer(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_synthesizer::msx_cart_synthesizer(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_SYNTHESIZER, "MSX Cartridge - Synthesizer", tag, owner, clock, "msx_cart_synthesizer", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_base(nullptr) @@ -527,7 +527,7 @@ WRITE8_MEMBER(msx_cart_synthesizer::write_cart) -msx_cart_konami_sound::msx_cart_konami_sound(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_cart_konami_sound::msx_cart_konami_sound(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) , msx_cart_interface(mconfig, *this) , m_k052539(*this, "k052539") @@ -588,7 +588,7 @@ void msx_cart_konami_sound::restore_banks() } -void msx_cart_konami_sound::setup_bank(UINT8 bank) +void msx_cart_konami_sound::setup_bank(uint8_t bank) { switch (bank) { @@ -671,7 +671,7 @@ READ8_MEMBER(msx_cart_konami_sound::read_cart) return 0xff; } - UINT8 *base = m_bank_base[offset >> 13]; + uint8_t *base = m_bank_base[offset >> 13]; if (base != nullptr) { @@ -823,7 +823,7 @@ WRITE8_MEMBER(msx_cart_konami_sound::write_cart) } -msx_cart_konami_sound_snatcher::msx_cart_konami_sound_snatcher(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_konami_sound_snatcher::msx_cart_konami_sound_snatcher(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_cart_konami_sound(mconfig, MSX_CART_SOUND_SNATCHER, "MSX Cartridge - Sound Snatcher", tag, owner, clock, "msx_cart_sound_snatcher", __FILE__) { } @@ -847,7 +847,7 @@ void msx_cart_konami_sound_snatcher::initialize_cartridge() } -msx_cart_konami_sound_sdsnatcher::msx_cart_konami_sound_sdsnatcher(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_konami_sound_sdsnatcher::msx_cart_konami_sound_sdsnatcher(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_cart_konami_sound(mconfig, MSX_CART_SOUND_SDSNATCHER, "MSX Cartridge - Sound SD Snatcher", tag, owner, clock, "msx_cart_sound_sdsnatcher", __FILE__) { } @@ -873,7 +873,7 @@ void msx_cart_konami_sound_sdsnatcher::initialize_cartridge() -msx_cart_keyboard_master::msx_cart_keyboard_master(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_keyboard_master::msx_cart_keyboard_master(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_KEYBOARD_MASTER, "MSX Cartridge - Keyboard Master", tag, owner, clock, "msx_cart_keyboard_master", __FILE__) , msx_cart_interface(mconfig, *this) , m_vlm5030(*this, "vlm5030") diff --git a/src/devices/bus/msx_cart/konami.h b/src/devices/bus/msx_cart/konami.h index f42057692b6..74400582420 100644 --- a/src/devices/bus/msx_cart/konami.h +++ b/src/devices/bus/msx_cart/konami.h @@ -22,7 +22,7 @@ class msx_cart_konami : public device_t , public msx_cart_interface { public: - msx_cart_konami(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_konami(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -36,9 +36,9 @@ public: void restore_banks(); private: - UINT8 m_bank_mask; - UINT8 m_selected_bank[4]; - UINT8 *m_bank_base[8]; + uint8_t m_bank_mask; + uint8_t m_selected_bank[4]; + uint8_t *m_bank_base[8]; }; @@ -46,7 +46,7 @@ class msx_cart_konami_scc : public device_t , public msx_cart_interface { public: - msx_cart_konami_scc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_konami_scc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -63,9 +63,9 @@ public: private: required_device m_k051649; - UINT8 m_bank_mask; - UINT8 m_selected_bank[4]; - UINT8 *m_bank_base[8]; + uint8_t m_bank_mask; + uint8_t m_selected_bank[4]; + uint8_t *m_bank_base[8]; bool m_scc_active; }; @@ -74,7 +74,7 @@ class msx_cart_gamemaster2 : public device_t , public msx_cart_interface { public: - msx_cart_gamemaster2(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_gamemaster2(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -88,10 +88,10 @@ public: void restore_banks(); private: - UINT8 m_selected_bank[3]; - UINT8 *m_bank_base[8]; + uint8_t m_selected_bank[3]; + uint8_t *m_bank_base[8]; - void setup_bank(UINT8 bank); + void setup_bank(uint8_t bank); }; @@ -99,7 +99,7 @@ class msx_cart_synthesizer : public device_t , public msx_cart_interface { public: - msx_cart_synthesizer(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_synthesizer(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -111,7 +111,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_cart) override; private: - UINT8 *m_bank_base; + uint8_t *m_bank_base; required_device m_dac; }; @@ -120,7 +120,7 @@ class msx_cart_konami_sound : public device_t , public msx_cart_interface { public: - msx_cart_konami_sound(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_cart_konami_sound(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-level overrides virtual void device_start() override; @@ -135,27 +135,27 @@ public: void restore_banks(); protected: - UINT8 *m_ram_bank[16]; + uint8_t *m_ram_bank[16]; private: // This is actually a K052539 required_device m_k052539; - UINT8 m_selected_bank[4]; - UINT8 *m_bank_base[8]; + uint8_t m_selected_bank[4]; + uint8_t *m_bank_base[8]; bool m_scc_active; bool m_sccplus_active; bool m_ram_enabled[4]; - UINT8 m_scc_mode; + uint8_t m_scc_mode; - void setup_bank(UINT8 bank); + void setup_bank(uint8_t bank); }; class msx_cart_konami_sound_snatcher : public msx_cart_konami_sound { public: - msx_cart_konami_sound_snatcher(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_konami_sound_snatcher(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void initialize_cartridge() override; }; @@ -164,7 +164,7 @@ public: class msx_cart_konami_sound_sdsnatcher : public msx_cart_konami_sound { public: - msx_cart_konami_sound_sdsnatcher(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_konami_sound_sdsnatcher(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void initialize_cartridge() override; }; @@ -175,7 +175,7 @@ class msx_cart_keyboard_master : public device_t , public msx_cart_interface { public: - msx_cart_keyboard_master(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_keyboard_master(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/msx_cart/korean.cpp b/src/devices/bus/msx_cart/korean.cpp index f1dedeb9874..7f97f4bb49f 100644 --- a/src/devices/bus/msx_cart/korean.cpp +++ b/src/devices/bus/msx_cart/korean.cpp @@ -8,7 +8,7 @@ const device_type MSX_CART_KOREAN_90IN1 = &device_creator const device_type MSX_CART_KOREAN_126IN1 = &device_creator; -msx_cart_korean_80in1::msx_cart_korean_80in1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_korean_80in1::msx_cart_korean_80in1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_KOREAN_80IN1, "MSX Cartridge - Korean 80-in-1", tag, owner, clock, "msx_cart_korean_80in1", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_mask(0) @@ -29,7 +29,7 @@ void msx_cart_korean_80in1::device_start() } -void msx_cart_korean_80in1::setup_bank(UINT8 bank) +void msx_cart_korean_80in1::setup_bank(uint8_t bank) { m_bank_base[bank] = get_rom_base() + ( m_selected_bank[bank] & m_bank_mask ) * 0x2000; } @@ -55,14 +55,14 @@ void msx_cart_korean_80in1::device_reset() void msx_cart_korean_80in1::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( size > 256 * 0x2000 ) { fatalerror("korean_80in1: ROM is too big\n"); } - UINT16 banks = size / 0x2000; + uint16_t banks = size / 0x2000; if (size != banks * 0x2000 || (~(banks - 1) % banks)) { @@ -90,7 +90,7 @@ WRITE8_MEMBER(msx_cart_korean_80in1::write_cart) { if (offset >= 0x4000 && offset < 0x4004) { - UINT8 bank = offset & 3; + uint8_t bank = offset & 3; m_selected_bank[bank] = data; setup_bank(bank); @@ -101,7 +101,7 @@ WRITE8_MEMBER(msx_cart_korean_80in1::write_cart) -msx_cart_korean_90in1::msx_cart_korean_90in1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_korean_90in1::msx_cart_korean_90in1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_KOREAN_90IN1, "MSX Cartridge - Korean 90-in-1", tag, owner, clock, "msx_cart_korean_90in1", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_mask(0) @@ -128,7 +128,7 @@ void msx_cart_korean_90in1::device_start() void msx_cart_korean_90in1::restore_banks() { - UINT8 *base = get_rom_base(); + uint8_t *base = get_rom_base(); switch (m_selected_bank & 0xc0) { @@ -167,14 +167,14 @@ void msx_cart_korean_90in1::device_reset() void msx_cart_korean_90in1::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( size > 64 * 0x4000 ) { fatalerror("korean_90in1: ROM is too big\n"); } - UINT16 banks = size / 0x4000; + uint16_t banks = size / 0x4000; if (size != banks * 0x4000 || (~(banks - 1) % banks)) { @@ -208,7 +208,7 @@ WRITE8_MEMBER(msx_cart_korean_90in1::banking) -msx_cart_korean_126in1::msx_cart_korean_126in1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_korean_126in1::msx_cart_korean_126in1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_KOREAN_126IN1, "MSX Cartridge - Korean 126-in-1", tag, owner, clock, "msx_cart_korean_126in1", __FILE__) , msx_cart_interface(mconfig, *this) , m_bank_mask(0) @@ -229,7 +229,7 @@ void msx_cart_korean_126in1::device_start() } -void msx_cart_korean_126in1::setup_bank(UINT8 bank) +void msx_cart_korean_126in1::setup_bank(uint8_t bank) { m_bank_base[bank] = get_rom_base() + ( m_selected_bank[bank] & m_bank_mask ) * 0x4000; } @@ -255,14 +255,14 @@ void msx_cart_korean_126in1::device_reset() void msx_cart_korean_126in1::initialize_cartridge() { - UINT32 size = get_rom_size(); + uint32_t size = get_rom_size(); if ( size > 256 * 0x4000 ) { fatalerror("korean_126in1: ROM is too big\n"); } - UINT16 banks = size / 0x4000; + uint16_t banks = size / 0x4000; if (size != banks * 0x4000 || (~(banks - 1) % banks)) { @@ -290,7 +290,7 @@ WRITE8_MEMBER(msx_cart_korean_126in1::write_cart) { if (offset >= 0x4000 && offset < 0x4002) { - UINT8 bank = offset & 1; + uint8_t bank = offset & 1; m_selected_bank[bank] = data; setup_bank(bank); diff --git a/src/devices/bus/msx_cart/korean.h b/src/devices/bus/msx_cart/korean.h index 7c332f486c3..9dd19addf15 100644 --- a/src/devices/bus/msx_cart/korean.h +++ b/src/devices/bus/msx_cart/korean.h @@ -15,7 +15,7 @@ class msx_cart_korean_80in1 : public device_t , public msx_cart_interface { public: - msx_cart_korean_80in1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_korean_80in1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -29,11 +29,11 @@ public: void restore_banks(); private: - UINT8 m_bank_mask; - UINT8 m_selected_bank[4]; - UINT8 *m_bank_base[4]; + uint8_t m_bank_mask; + uint8_t m_selected_bank[4]; + uint8_t *m_bank_base[4]; - void setup_bank(UINT8 bank); + void setup_bank(uint8_t bank); }; @@ -41,7 +41,7 @@ class msx_cart_korean_90in1 : public device_t , public msx_cart_interface { public: - msx_cart_korean_90in1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_korean_90in1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -56,9 +56,9 @@ public: void restore_banks(); private: - UINT8 m_bank_mask; - UINT8 m_selected_bank; - UINT8 *m_bank_base[4]; + uint8_t m_bank_mask; + uint8_t m_selected_bank; + uint8_t *m_bank_base[4]; }; @@ -66,7 +66,7 @@ class msx_cart_korean_126in1 : public device_t , public msx_cart_interface { public: - msx_cart_korean_126in1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_korean_126in1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -80,11 +80,11 @@ public: void restore_banks(); private: - UINT8 m_bank_mask; - UINT8 m_selected_bank[2]; - UINT8 *m_bank_base[2]; + uint8_t m_bank_mask; + uint8_t m_selected_bank[2]; + uint8_t *m_bank_base[2]; - void setup_bank(UINT8 bank); + void setup_bank(uint8_t bank); }; diff --git a/src/devices/bus/msx_cart/majutsushi.cpp b/src/devices/bus/msx_cart/majutsushi.cpp index 49dc7b25450..d81d79b95ec 100644 --- a/src/devices/bus/msx_cart/majutsushi.cpp +++ b/src/devices/bus/msx_cart/majutsushi.cpp @@ -7,7 +7,7 @@ const device_type MSX_CART_MAJUTSUSHI = &device_creator; -msx_cart_majutsushi::msx_cart_majutsushi(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_majutsushi::msx_cart_majutsushi(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_MAJUTSUSHI, "MSX Cartridge - Majutsushi", tag, owner, clock, "msx_cart_majutsushi", __FILE__) , msx_cart_interface(mconfig, *this) , m_dac(*this, "dac") diff --git a/src/devices/bus/msx_cart/majutsushi.h b/src/devices/bus/msx_cart/majutsushi.h index 82a454b785c..94be25040c3 100644 --- a/src/devices/bus/msx_cart/majutsushi.h +++ b/src/devices/bus/msx_cart/majutsushi.h @@ -14,7 +14,7 @@ class msx_cart_majutsushi : public device_t , public msx_cart_interface { public: - msx_cart_majutsushi(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_majutsushi(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -31,8 +31,8 @@ public: private: required_device m_dac; - UINT8 m_selected_bank[4]; - UINT8 *m_bank_base[8]; + uint8_t m_selected_bank[4]; + uint8_t *m_bank_base[8]; }; diff --git a/src/devices/bus/msx_cart/moonsound.cpp b/src/devices/bus/msx_cart/moonsound.cpp index 1d7371f1a9a..8596bfce530 100644 --- a/src/devices/bus/msx_cart/moonsound.cpp +++ b/src/devices/bus/msx_cart/moonsound.cpp @@ -19,7 +19,7 @@ TODO: const device_type MSX_CART_MOONSOUND = &device_creator; -msx_cart_moonsound::msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_moonsound::msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_MOONSOUND, "MSX Cartridge - MoonSound", tag, owner, clock, "msx_moonsound", __FILE__) , msx_cart_interface(mconfig, *this) , m_ymf278b(*this, "ymf278b") diff --git a/src/devices/bus/msx_cart/moonsound.h b/src/devices/bus/msx_cart/moonsound.h index 0428534cda0..94adfb6ee6a 100644 --- a/src/devices/bus/msx_cart/moonsound.h +++ b/src/devices/bus/msx_cart/moonsound.h @@ -14,7 +14,7 @@ class msx_cart_moonsound : public device_t , public msx_cart_interface { public: - msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_moonsound(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/devices/bus/msx_cart/msx_audio.cpp b/src/devices/bus/msx_cart/msx_audio.cpp index 200194e31e4..aa96a165f89 100644 --- a/src/devices/bus/msx_cart/msx_audio.cpp +++ b/src/devices/bus/msx_cart/msx_audio.cpp @@ -70,7 +70,7 @@ const device_type MSX_CART_MSX_AUDIO_NMS1205 = &device_creator; -msx_cart_msx_audio_hxmu900::msx_cart_msx_audio_hxmu900(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_msx_audio_hxmu900::msx_cart_msx_audio_hxmu900(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_MSX_AUDIO_HXMU900, "MSX Cartridge - MSX-AUDIO HX-MU900", tag, owner, clock, "msx_audio_hxmu900", __FILE__) , msx_cart_interface(mconfig, *this) , m_y8950(*this, "y8950") @@ -127,7 +127,7 @@ READ8_MEMBER(msx_cart_msx_audio_hxmu900::read_cart) -msx_cart_msx_audio_nms1205::msx_cart_msx_audio_nms1205(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_msx_audio_nms1205::msx_cart_msx_audio_nms1205(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_MSX_AUDIO_NMS1205, "MSX Cartridge - MSX-AUDIO NMS-1205", tag, owner, clock, "msx_audio_nms1205", __FILE__) , msx_cart_interface(mconfig, *this) , m_y8950(*this, "y8950") @@ -235,7 +235,7 @@ READ8_MEMBER(msx_cart_msx_audio_nms1205::read_cart) -msx_cart_msx_audio_fsca1::msx_cart_msx_audio_fsca1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_msx_audio_fsca1::msx_cart_msx_audio_fsca1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_MSX_AUDIO_FSCA1, "MSX Cartridge - MSX-AUDIO FS-CA1", tag, owner, clock, "msx_audio_fsca1", __FILE__) , msx_cart_interface(mconfig, *this) , m_y8950(*this, "y8950") diff --git a/src/devices/bus/msx_cart/msx_audio.h b/src/devices/bus/msx_cart/msx_audio.h index 7759a1b6908..9de471ce170 100644 --- a/src/devices/bus/msx_cart/msx_audio.h +++ b/src/devices/bus/msx_cart/msx_audio.h @@ -18,7 +18,7 @@ class msx_cart_msx_audio_hxmu900 : public device_t , public msx_cart_interface { public: - msx_cart_msx_audio_hxmu900(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_msx_audio_hxmu900(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -37,7 +37,7 @@ class msx_cart_msx_audio_nms1205 : public device_t , public msx_cart_interface { public: - msx_cart_msx_audio_nms1205(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_msx_audio_nms1205(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -63,7 +63,7 @@ class msx_cart_msx_audio_fsca1 : public device_t , public msx_cart_interface { public: - msx_cart_msx_audio_fsca1(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_msx_audio_fsca1(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -86,8 +86,8 @@ private: required_device m_y8950; required_ioport m_io_config; required_memory_region m_region_y8950; - UINT8 m_7ffe; - UINT8 m_7fff; + uint8_t m_7ffe; + uint8_t m_7fff; }; #endif diff --git a/src/devices/bus/msx_cart/msx_audio_kb.cpp b/src/devices/bus/msx_cart/msx_audio_kb.cpp index 23349c383db..2b0fd16f725 100644 --- a/src/devices/bus/msx_cart/msx_audio_kb.cpp +++ b/src/devices/bus/msx_cart/msx_audio_kb.cpp @@ -7,7 +7,7 @@ const device_type MSX_AUDIO_KBDC_PORT = &device_creator; -msx_audio_kbdc_port_device::msx_audio_kbdc_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_audio_kbdc_port_device::msx_audio_kbdc_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_AUDIO_KBDC_PORT, "MSX Audio keyboard connector port", tag, owner, clock, "msx_audio_kbdc_port", __FILE__), device_slot_interface(mconfig, *this), m_keyboard(nullptr) @@ -48,7 +48,7 @@ class msx_hxmu901 : public device_t , public msx_audio_kb_port_interface { public: - msx_hxmu901(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + msx_hxmu901(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_AUDIO_KB_HXMU901, "Toshiba HXMU901", tag, owner, clock, "hxmu901", __FILE__) , msx_audio_kb_port_interface(mconfig, *this) , m_row(0) @@ -60,7 +60,7 @@ public: virtual DECLARE_READ8_MEMBER(read) override { - UINT8 result = 0xff; + uint8_t result = 0xff; for (int i = 0; i < 8; i++) { @@ -81,7 +81,7 @@ protected: virtual void device_start() override { } private: - UINT8 m_row; + uint8_t m_row; required_ioport_array<8> m_keyboard; }; @@ -179,7 +179,7 @@ class msx_nms1160 : public device_t , public msx_audio_kb_port_interface { public: - msx_nms1160(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + msx_nms1160(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_AUDIO_KB_NMS1160, "Philips NMS-1160", tag, owner, clock, "nms1160", __FILE__) , msx_audio_kb_port_interface(mconfig, *this) , m_row(0) @@ -190,7 +190,7 @@ public: virtual DECLARE_READ8_MEMBER(read) override { - UINT8 result = 0xff; + uint8_t result = 0xff; for (int i = 0; i < 8; i++) { @@ -212,7 +212,7 @@ protected: virtual void device_start() override { } private: - UINT8 m_row; + uint8_t m_row; required_ioport_array<8> m_keyboard; }; diff --git a/src/devices/bus/msx_cart/msx_audio_kb.h b/src/devices/bus/msx_cart/msx_audio_kb.h index 6bdc1fe86fe..8759b9200e8 100644 --- a/src/devices/bus/msx_cart/msx_audio_kb.h +++ b/src/devices/bus/msx_cart/msx_audio_kb.h @@ -30,7 +30,7 @@ class msx_audio_kbdc_port_device : public device_t, { public: // construction/destruction - msx_audio_kbdc_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_audio_kbdc_port_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/devices/bus/msx_cart/msxdos2.cpp b/src/devices/bus/msx_cart/msxdos2.cpp index 96f0b99f119..3396ee67221 100644 --- a/src/devices/bus/msx_cart/msxdos2.cpp +++ b/src/devices/bus/msx_cart/msxdos2.cpp @@ -6,7 +6,7 @@ const device_type MSX_CART_MSXDOS2 = &device_creator; -msx_cart_msxdos2::msx_cart_msxdos2(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_msxdos2::msx_cart_msxdos2(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_MSXDOS2, "MSX Cartridge - MSXDOS2", tag, owner, clock, "msx_cart_msxdos2", __FILE__) , msx_cart_interface(mconfig, *this) , m_selected_bank(0) diff --git a/src/devices/bus/msx_cart/msxdos2.h b/src/devices/bus/msx_cart/msxdos2.h index a4171b41292..11f2026925b 100644 --- a/src/devices/bus/msx_cart/msxdos2.h +++ b/src/devices/bus/msx_cart/msxdos2.h @@ -13,7 +13,7 @@ class msx_cart_msxdos2 : public device_t , public msx_cart_interface { public: - msx_cart_msxdos2(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_msxdos2(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -27,8 +27,8 @@ public: void restore_banks(); private: - UINT8 m_selected_bank; - UINT8 *m_bank_base; + uint8_t m_selected_bank; + uint8_t *m_bank_base; }; diff --git a/src/devices/bus/msx_cart/nomapper.cpp b/src/devices/bus/msx_cart/nomapper.cpp index 175681e0227..2b9b756e628 100644 --- a/src/devices/bus/msx_cart/nomapper.cpp +++ b/src/devices/bus/msx_cart/nomapper.cpp @@ -7,7 +7,7 @@ const device_type MSX_CART_NOMAPPER = &device_creator; -msx_cart_nomapper::msx_cart_nomapper(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_nomapper::msx_cart_nomapper(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_NOMAPPER, "MSX Cartridge - ROM", tag, owner, clock, "msx_cart_nomapper", __FILE__) , msx_cart_interface(mconfig, *this) , m_start_address(0) @@ -21,8 +21,8 @@ void msx_cart_nomapper::device_start() void msx_cart_nomapper::initialize_cartridge() { - UINT32 size = get_rom_size(); - UINT8 *rom = get_rom_base(); + uint32_t size = get_rom_size(); + uint8_t *rom = get_rom_base(); // determine start address // default to $4000 @@ -33,7 +33,7 @@ void msx_cart_nomapper::initialize_cartridge() /* 8KB/16KB */ case 0x2000: case 0x4000: { - UINT16 start = rom[3] << 8 | rom[2]; + uint16_t start = rom[3] << 8 | rom[2]; // start address of $0000: call address in the $4000 region: $4000, else $8000 if (start == 0) @@ -56,7 +56,7 @@ void msx_cart_nomapper::initialize_cartridge() // take default, check when no "AB" at $0000, but "AB" at $4000 if (rom[0] != 'A' && rom[1] != 'B' && rom[0x4000] == 'A' && rom[0x4001] == 'B') { - UINT16 start = rom[0x4003] << 8 | rom[0x4002]; + uint16_t start = rom[0x4003] << 8 | rom[0x4002]; // start address of $0000 and call address in the $4000 region, or start address outside the $8000 region: $0000, else default if ((start == 0 && (rom[0x4005] & 0xc0) == 0x40) || start < 0x8000 || start >= 0xc000) @@ -81,7 +81,7 @@ void msx_cart_nomapper::initialize_cartridge() break; } - m_end_address = std::min(m_start_address + size, 0x10000); + m_end_address = std::min(m_start_address + size, 0x10000); } READ8_MEMBER(msx_cart_nomapper::read_cart) diff --git a/src/devices/bus/msx_cart/nomapper.h b/src/devices/bus/msx_cart/nomapper.h index f81c7bcdd50..9a47a2f6e30 100644 --- a/src/devices/bus/msx_cart/nomapper.h +++ b/src/devices/bus/msx_cart/nomapper.h @@ -13,7 +13,7 @@ class msx_cart_nomapper : public device_t , public msx_cart_interface { public: - msx_cart_nomapper(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_nomapper(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -23,8 +23,8 @@ public: virtual DECLARE_READ8_MEMBER(read_cart) override; private: - UINT32 m_start_address; - UINT32 m_end_address; + uint32_t m_start_address; + uint32_t m_end_address; }; #endif diff --git a/src/devices/bus/msx_cart/rtype.cpp b/src/devices/bus/msx_cart/rtype.cpp index ffe7d56cfba..d45dbac407b 100644 --- a/src/devices/bus/msx_cart/rtype.cpp +++ b/src/devices/bus/msx_cart/rtype.cpp @@ -6,7 +6,7 @@ const device_type MSX_CART_RTYPE = &device_creator; -msx_cart_rtype::msx_cart_rtype(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_rtype::msx_cart_rtype(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_RTYPE, "MSX Cartridge - R-Type", tag, owner, clock, "msx_cart_rtype", __FILE__) , msx_cart_interface(mconfig, *this) , m_selected_bank(0) diff --git a/src/devices/bus/msx_cart/rtype.h b/src/devices/bus/msx_cart/rtype.h index 811ccc5ad27..c89570f4cac 100644 --- a/src/devices/bus/msx_cart/rtype.h +++ b/src/devices/bus/msx_cart/rtype.h @@ -13,7 +13,7 @@ class msx_cart_rtype : public device_t , public msx_cart_interface { public: - msx_cart_rtype(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_rtype(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -27,8 +27,8 @@ public: void restore_banks(); private: - UINT8 m_selected_bank; - UINT8 *m_bank_base[2]; + uint8_t m_selected_bank; + uint8_t *m_bank_base[2]; }; diff --git a/src/devices/bus/msx_cart/super_swangi.cpp b/src/devices/bus/msx_cart/super_swangi.cpp index 65e4992afe3..c020e1f311f 100644 --- a/src/devices/bus/msx_cart/super_swangi.cpp +++ b/src/devices/bus/msx_cart/super_swangi.cpp @@ -7,7 +7,7 @@ const device_type MSX_CART_SUPER_SWANGI = &device_creator; -msx_cart_super_swangi::msx_cart_super_swangi(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_super_swangi::msx_cart_super_swangi(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_SUPER_SWANGI, "MSX Cartridge - Super Swangi", tag, owner, clock, "msx_cart_super_swangi", __FILE__) , msx_cart_interface(mconfig, *this) , m_selected_bank(0) diff --git a/src/devices/bus/msx_cart/super_swangi.h b/src/devices/bus/msx_cart/super_swangi.h index 19241869877..09619437379 100644 --- a/src/devices/bus/msx_cart/super_swangi.h +++ b/src/devices/bus/msx_cart/super_swangi.h @@ -13,7 +13,7 @@ class msx_cart_super_swangi : public device_t , public msx_cart_interface { public: - msx_cart_super_swangi(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_super_swangi(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -27,8 +27,8 @@ public: void restore_banks(); private: - UINT8 m_selected_bank; - UINT8 *m_bank_base[2]; + uint8_t m_selected_bank; + uint8_t *m_bank_base[2]; }; diff --git a/src/devices/bus/msx_cart/superloderunner.cpp b/src/devices/bus/msx_cart/superloderunner.cpp index f71a109a83b..c738d19ebbb 100644 --- a/src/devices/bus/msx_cart/superloderunner.cpp +++ b/src/devices/bus/msx_cart/superloderunner.cpp @@ -6,7 +6,7 @@ const device_type MSX_CART_SUPERLODERUNNER = &device_creator; -msx_cart_superloderunner::msx_cart_superloderunner(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_superloderunner::msx_cart_superloderunner(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_CART_SUPERLODERUNNER, "MSX Cartridge - Super Lode Runner", tag, owner, clock, "msx_cart_superloderunner", __FILE__) , msx_cart_interface(mconfig, *this) , m_selected_bank(0) diff --git a/src/devices/bus/msx_cart/superloderunner.h b/src/devices/bus/msx_cart/superloderunner.h index 22b1e47e368..9ca4e49bcd8 100644 --- a/src/devices/bus/msx_cart/superloderunner.h +++ b/src/devices/bus/msx_cart/superloderunner.h @@ -13,7 +13,7 @@ class msx_cart_superloderunner : public device_t , public msx_cart_interface { public: - msx_cart_superloderunner(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_superloderunner(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -27,8 +27,8 @@ public: void restore_banks(); private: - UINT8 m_selected_bank; - UINT8 *m_bank_base; + uint8_t m_selected_bank; + uint8_t *m_bank_base; }; diff --git a/src/devices/bus/msx_cart/yamaha.cpp b/src/devices/bus/msx_cart/yamaha.cpp index cec5bdd673b..b5841580917 100644 --- a/src/devices/bus/msx_cart/yamaha.cpp +++ b/src/devices/bus/msx_cart/yamaha.cpp @@ -18,7 +18,7 @@ const device_type MSX_CART_SFG01 = &device_creator; const device_type MSX_CART_SFG05 = &device_creator; -msx_cart_sfg::msx_cart_sfg(const machine_config &mconfig, const device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +msx_cart_sfg::msx_cart_sfg(const machine_config &mconfig, const 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__) , msx_cart_interface(mconfig, *this) , m_region_sfg(*this, "sfg") @@ -32,13 +32,13 @@ msx_cart_sfg::msx_cart_sfg(const machine_config &mconfig, const device_type type } -msx_cart_sfg01::msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_sfg01::msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_cart_sfg(mconfig, MSX_CART_SFG01, "MSX Cartridge - SFG01", tag, owner, clock, "msx_cart_sfg01") { } -msx_cart_sfg05::msx_cart_sfg05(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_cart_sfg05::msx_cart_sfg05(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_cart_sfg(mconfig, MSX_CART_SFG05, "MSX Cartridge - SFG05", tag, owner, clock, "msx_cart_sfg05") { } diff --git a/src/devices/bus/msx_cart/yamaha.h b/src/devices/bus/msx_cart/yamaha.h index f8897cc45be..60462dd7015 100644 --- a/src/devices/bus/msx_cart/yamaha.h +++ b/src/devices/bus/msx_cart/yamaha.h @@ -17,7 +17,7 @@ class msx_cart_sfg : public device_t , public msx_cart_interface { public: - msx_cart_sfg(const machine_config &mconfig, const device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + msx_cart_sfg(const machine_config &mconfig, const device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -38,7 +38,7 @@ private: required_device m_ym2148; int m_ym2151_irq_state; int m_ym2148_irq_state; - UINT32 m_rom_mask; + uint32_t m_rom_mask; void check_irq(); }; @@ -47,7 +47,7 @@ private: class msx_cart_sfg01 : public msx_cart_sfg { public: - msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_sfg01(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -56,7 +56,7 @@ public: class msx_cart_sfg05 : public msx_cart_sfg { public: - msx_cart_sfg05(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_cart_sfg05(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/devices/bus/msx_slot/bunsetsu.cpp b/src/devices/bus/msx_slot/bunsetsu.cpp index 0c5921cf677..ce144821213 100644 --- a/src/devices/bus/msx_slot/bunsetsu.cpp +++ b/src/devices/bus/msx_slot/bunsetsu.cpp @@ -11,7 +11,7 @@ const device_type MSX_SLOT_BUNSETSU = &device_creator; -msx_slot_bunsetsu_device::msx_slot_bunsetsu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_bunsetsu_device::msx_slot_bunsetsu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_rom_device(mconfig, MSX_SLOT_BUNSETSU, "MSX Internal BUNSETSU", tag, owner, clock, "msx_slot_bunsetsu", __FILE__) , m_bunsetsu_region(*this, finder_base::DUMMY_TAG, 0x20000) , m_bunsetsu_address(0) diff --git a/src/devices/bus/msx_slot/bunsetsu.h b/src/devices/bus/msx_slot/bunsetsu.h index 90e1cbd5bf5..eff00928a83 100644 --- a/src/devices/bus/msx_slot/bunsetsu.h +++ b/src/devices/bus/msx_slot/bunsetsu.h @@ -17,7 +17,7 @@ extern const device_type MSX_SLOT_BUNSETSU; class msx_slot_bunsetsu_device : public msx_slot_rom_device { public: - msx_slot_bunsetsu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_bunsetsu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers static void set_bunsetsu_region_tag(device_t &device, const char *tag) { dynamic_cast(device).m_bunsetsu_region.set_tag(tag); } @@ -28,8 +28,8 @@ public: virtual DECLARE_WRITE8_MEMBER(write) override; private: - required_region_ptr m_bunsetsu_region; - UINT32 m_bunsetsu_address; + required_region_ptr m_bunsetsu_region; + uint32_t m_bunsetsu_address; }; diff --git a/src/devices/bus/msx_slot/cartridge.cpp b/src/devices/bus/msx_slot/cartridge.cpp index 104f82b6bd5..d7742676d1d 100644 --- a/src/devices/bus/msx_slot/cartridge.cpp +++ b/src/devices/bus/msx_slot/cartridge.cpp @@ -33,7 +33,7 @@ const device_type MSX_SLOT_CARTRIDGE = &device_creator; -msx_slot_cartridge_device::msx_slot_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_cartridge_device::msx_slot_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_SLOT_CARTRIDGE, "MSX Cartridge slot", tag, owner, clock, "msx_slot_cartridge", __FILE__) , device_image_interface(mconfig, *this) , device_slot_interface(mconfig, *this) @@ -44,7 +44,7 @@ msx_slot_cartridge_device::msx_slot_cartridge_device(const machine_config &mconf } -msx_slot_cartridge_device::msx_slot_cartridge_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_slot_cartridge_device::msx_slot_cartridge_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_image_interface(mconfig, *this) , device_slot_interface(mconfig, *this) @@ -108,14 +108,14 @@ image_init_result msx_slot_cartridge_device::call_load() { if ( software_entry() ) { - UINT32 length; + uint32_t length; // Allocate and copy rom contents length = get_software_region_length("rom"); m_cartridge->rom_alloc( length ); if (length > 0) { - UINT8 *rom_base = m_cartridge->get_rom_base(); + uint8_t *rom_base = m_cartridge->get_rom_base(); memcpy(rom_base, get_software_region("rom"), length); } @@ -124,7 +124,7 @@ image_init_result msx_slot_cartridge_device::call_load() m_cartridge->rom_vlm5030_alloc(length); if (length > 0) { - UINT8 *rom_base = m_cartridge->get_rom_vlm5030_base(); + uint8_t *rom_base = m_cartridge->get_rom_vlm5030_base(); memcpy(rom_base, get_software_region("vlm5030"), length); } @@ -138,10 +138,10 @@ image_init_result msx_slot_cartridge_device::call_load() } else { - UINT32 length = this->length(); + uint32_t length = this->length(); // determine how much space to allocate - UINT32 length_aligned = 0x10000; + uint32_t length_aligned = 0x10000; if (length <= 0x2000) length_aligned = 0x2000; @@ -204,7 +204,7 @@ WRITE_LINE_MEMBER(msx_slot_cartridge_device::irq_out) } -int msx_slot_cartridge_device::get_cart_type(UINT8 *rom, UINT32 length) +int msx_slot_cartridge_device::get_cart_type(uint8_t *rom, uint32_t length) { if (length < 0x2000) { @@ -276,8 +276,8 @@ std::string msx_slot_cartridge_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string = "nomapper"; - UINT32 length = m_file->size(); - std::vector rom(length); + uint32_t length = m_file->size(); + std::vector rom(length); int type = NOMAPPER; // Check if there's some mapper related information in the hashfiles @@ -357,7 +357,7 @@ WRITE8_MEMBER(msx_slot_cartridge_device::write) -msx_slot_yamaha_expansion_device::msx_slot_yamaha_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_yamaha_expansion_device::msx_slot_yamaha_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_cartridge_device(mconfig, MSX_SLOT_YAMAHA_EXPANSION, "MSX Yamaha Expansion slot", tag, owner, clock, "msx_slot_yamaha_expansion", __FILE__) { } diff --git a/src/devices/bus/msx_slot/cartridge.h b/src/devices/bus/msx_slot/cartridge.h index 63530699b2b..b554eec833b 100644 --- a/src/devices/bus/msx_slot/cartridge.h +++ b/src/devices/bus/msx_slot/cartridge.h @@ -31,8 +31,8 @@ class msx_slot_cartridge_device : public device_t { public: // construction/destruction - msx_slot_cartridge_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_slot_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_cartridge_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); + msx_slot_cartridge_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); } @@ -67,7 +67,7 @@ protected: devcb_write_line m_irq_handler; msx_cart_interface *m_cartridge; - int get_cart_type(UINT8 *rom, UINT32 length); + int get_cart_type(uint8_t *rom, uint32_t length); }; @@ -75,7 +75,7 @@ class msx_slot_yamaha_expansion_device : public msx_slot_cartridge_device { public: // construction/destruction - msx_slot_yamaha_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_yamaha_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_config_complete() override { update_names(MSX_SLOT_YAMAHA_EXPANSION, "cartridge60pin", "cart60p"); } diff --git a/src/devices/bus/msx_slot/disk.cpp b/src/devices/bus/msx_slot/disk.cpp index ea4313f6ac5..f2110a16791 100644 --- a/src/devices/bus/msx_slot/disk.cpp +++ b/src/devices/bus/msx_slot/disk.cpp @@ -43,7 +43,7 @@ const device_type MSX_SLOT_DISK5 = &device_creator; const device_type MSX_SLOT_DISK6 = &device_creator; -msx_slot_disk_device::msx_slot_disk_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_slot_disk_device::msx_slot_disk_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) : msx_slot_rom_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_floppy0(nullptr) , m_floppy1(nullptr) @@ -80,7 +80,7 @@ void msx_slot_disk_device::device_start() } -msx_slot_wd_disk_device::msx_slot_wd_disk_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_slot_wd_disk_device::msx_slot_wd_disk_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) : msx_slot_disk_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_fdc(nullptr) { @@ -100,7 +100,7 @@ void msx_slot_wd_disk_device::device_start() } -msx_slot_tc8566_disk_device::msx_slot_tc8566_disk_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_slot_tc8566_disk_device::msx_slot_tc8566_disk_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) : msx_slot_disk_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_fdc(nullptr) { @@ -121,7 +121,7 @@ void msx_slot_tc8566_disk_device::device_start() -msx_slot_disk1_device::msx_slot_disk1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_disk1_device::msx_slot_disk1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_wd_disk_device(mconfig, MSX_SLOT_DISK1, "MSX Internal floppy type 1", tag, owner, clock, "msx_slot_disk1", __FILE__) , m_side_control(0) , m_control(0) @@ -148,7 +148,7 @@ void msx_slot_disk1_device::device_reset() void msx_slot_disk1_device::post_load() { - UINT8 data = m_control; + uint8_t data = m_control; // To make sure the FDD busy led status gets set correctly m_control ^= 0x40; @@ -157,7 +157,7 @@ void msx_slot_disk1_device::post_load() } -void msx_slot_disk1_device::set_side_control(UINT8 data) +void msx_slot_disk1_device::set_side_control(uint8_t data) { m_side_control = data; @@ -168,9 +168,9 @@ void msx_slot_disk1_device::set_side_control(UINT8 data) } -void msx_slot_disk1_device::set_control(UINT8 data) +void msx_slot_disk1_device::set_control(uint8_t data) { - UINT8 old_m_control = m_control; + uint8_t old_m_control = m_control; m_control = data; @@ -284,7 +284,7 @@ WRITE8_MEMBER(msx_slot_disk1_device::write) } -msx_slot_disk2_device::msx_slot_disk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_disk2_device::msx_slot_disk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_wd_disk_device(mconfig, MSX_SLOT_DISK2, "MSX Internal floppy type 2", tag, owner, clock, "msx_slot_disk2", __FILE__) , m_control(0) { @@ -309,7 +309,7 @@ void msx_slot_disk2_device::device_reset() void msx_slot_disk2_device::post_load() { - UINT8 data = m_control; + uint8_t data = m_control; // To make sure the FDD busy led status gets set correctly m_control ^= 0x40; @@ -318,9 +318,9 @@ void msx_slot_disk2_device::post_load() } -void msx_slot_disk2_device::set_control(UINT8 data) +void msx_slot_disk2_device::set_control(uint8_t data) { - UINT8 old_m_control = m_control; + uint8_t old_m_control = m_control; m_control = data; @@ -423,7 +423,7 @@ WRITE8_MEMBER(msx_slot_disk2_device::write) -msx_slot_disk3_device::msx_slot_disk3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_disk3_device::msx_slot_disk3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_tc8566_disk_device(mconfig, MSX_SLOT_DISK3, "MSX Internal floppy type 3", tag, owner, clock, "msx_slot_disk3", __FILE__) { } @@ -469,7 +469,7 @@ READ8_MEMBER(msx_slot_disk3_device::read) -msx_slot_disk4_device::msx_slot_disk4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_disk4_device::msx_slot_disk4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_tc8566_disk_device(mconfig, MSX_SLOT_DISK4, "MSX Internal floppy type 4", tag, owner, clock, "msx_slot_disk4", __FILE__) { } @@ -521,7 +521,7 @@ READ8_MEMBER(msx_slot_disk4_device::read) -msx_slot_disk5_device::msx_slot_disk5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_disk5_device::msx_slot_disk5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_wd_disk_device(mconfig, MSX_SLOT_DISK5, "MSX Internal floppy type 5", tag, owner, clock, "msx_slot_disk5", __FILE__) , m_control(0) { @@ -555,7 +555,7 @@ void msx_slot_disk5_device::post_load() } -void msx_slot_disk5_device::set_control(UINT8 control) +void msx_slot_disk5_device::set_control(uint8_t control) { m_control = control; @@ -644,7 +644,7 @@ WRITE8_MEMBER(msx_slot_disk5_device::io_write) -msx_slot_disk6_device::msx_slot_disk6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_disk6_device::msx_slot_disk6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_wd_disk_device(mconfig, MSX_SLOT_DISK6, "MSX Internal floppy type 6", tag, owner, clock, "msx_slot_disk6", __FILE__) , m_side_motor(0) , m_drive_select0(0) diff --git a/src/devices/bus/msx_slot/disk.h b/src/devices/bus/msx_slot/disk.h index d5ce0982f82..11dee498884 100644 --- a/src/devices/bus/msx_slot/disk.h +++ b/src/devices/bus/msx_slot/disk.h @@ -73,7 +73,7 @@ extern const device_type MSX_SLOT_DISK6; class msx_slot_disk_device : public msx_slot_rom_device { public: - msx_slot_disk_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_slot_disk_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; @@ -102,7 +102,7 @@ protected: class msx_slot_wd_disk_device : public msx_slot_disk_device { public: - msx_slot_wd_disk_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_slot_wd_disk_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; @@ -114,7 +114,7 @@ protected: class msx_slot_tc8566_disk_device : public msx_slot_disk_device { public: - msx_slot_tc8566_disk_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_slot_tc8566_disk_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; @@ -126,7 +126,7 @@ protected: class msx_slot_disk1_device : public msx_slot_wd_disk_device { public: - msx_slot_disk1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_disk1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; @@ -137,18 +137,18 @@ public: void post_load(); private: - UINT8 m_side_control; - UINT8 m_control; + uint8_t m_side_control; + uint8_t m_control; - void set_control(UINT8 data); - void set_side_control(UINT8 data); + void set_control(uint8_t data); + void set_side_control(uint8_t data); }; class msx_slot_disk2_device : public msx_slot_wd_disk_device { public: - msx_slot_disk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_disk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; @@ -159,16 +159,16 @@ public: void post_load(); private: - UINT8 m_control; + uint8_t m_control; - void set_control(UINT8 data); + void set_control(uint8_t data); }; class msx_slot_disk3_device : public msx_slot_tc8566_disk_device { public: - msx_slot_disk3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_disk3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(read) override; virtual DECLARE_WRITE8_MEMBER(write) override; @@ -178,7 +178,7 @@ public: class msx_slot_disk4_device : public msx_slot_tc8566_disk_device { public: - msx_slot_disk4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_disk4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(read) override; virtual DECLARE_WRITE8_MEMBER(write) override; @@ -188,7 +188,7 @@ public: class msx_slot_disk5_device : public msx_slot_wd_disk_device { public: - msx_slot_disk5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_disk5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; @@ -199,16 +199,16 @@ public: void post_load(); private: - UINT8 m_control; + uint8_t m_control; - void set_control(UINT8 control); + void set_control(uint8_t control); }; class msx_slot_disk6_device : public msx_slot_wd_disk_device { public: - msx_slot_disk6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_disk6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; @@ -219,9 +219,9 @@ public: void post_load(); private: - UINT8 m_side_motor; - UINT8 m_drive_select0; - UINT8 m_drive_select1; + uint8_t m_side_motor; + uint8_t m_drive_select0; + uint8_t m_drive_select1; void set_side_motor(); void select_drive(); diff --git a/src/devices/bus/msx_slot/fs4600.cpp b/src/devices/bus/msx_slot/fs4600.cpp index 493b6b93f15..0b452695bf5 100644 --- a/src/devices/bus/msx_slot/fs4600.cpp +++ b/src/devices/bus/msx_slot/fs4600.cpp @@ -11,7 +11,7 @@ const device_type MSX_SLOT_FS4600 = &device_creator; -msx_slot_fs4600_device::msx_slot_fs4600_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_fs4600_device::msx_slot_fs4600_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_SLOT_FS4600, "MSX Internal FS4600 Firmware", tag, owner, clock, "msx_slot_fs4600", __FILE__) , msx_internal_slot_interface() , m_nvram(*this, "nvram") @@ -41,7 +41,7 @@ machine_config_constructor msx_slot_fs4600_device::device_mconfig_additions() co } -void msx_slot_fs4600_device::set_rom_start(device_t &device, const char *region, UINT32 offset) +void msx_slot_fs4600_device::set_rom_start(device_t &device, const char *region, uint32_t offset) { msx_slot_fs4600_device &dev = downcast(device); diff --git a/src/devices/bus/msx_slot/fs4600.h b/src/devices/bus/msx_slot/fs4600.h index a1b0cdb4792..48f5e142c82 100644 --- a/src/devices/bus/msx_slot/fs4600.h +++ b/src/devices/bus/msx_slot/fs4600.h @@ -18,10 +18,10 @@ class msx_slot_fs4600_device : public device_t, public msx_internal_slot_interface { public: - msx_slot_fs4600_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_fs4600_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - static void set_rom_start(device_t &device, const char *region, UINT32 offset); + static void set_rom_start(device_t &device, const char *region, uint32_t offset); virtual void device_start() override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -34,13 +34,13 @@ public: private: required_device m_nvram; required_memory_region m_rom_region; - UINT32 m_region_offset; - const UINT8 *m_rom; - UINT8 m_selected_bank[4]; - const UINT8 *m_bank_base[4]; - UINT32 m_sram_address; - UINT8 m_sram[0x1000]; - UINT8 m_control; + uint32_t m_region_offset; + const uint8_t *m_rom; + uint8_t m_selected_bank[4]; + const uint8_t *m_bank_base[4]; + uint32_t m_sram_address; + uint8_t m_sram[0x1000]; + uint8_t m_control; }; diff --git a/src/devices/bus/msx_slot/music.cpp b/src/devices/bus/msx_slot/music.cpp index baa6bdf0175..26173425866 100644 --- a/src/devices/bus/msx_slot/music.cpp +++ b/src/devices/bus/msx_slot/music.cpp @@ -7,7 +7,7 @@ const device_type MSX_SLOT_MUSIC = &device_creator; -msx_slot_music_device::msx_slot_music_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_music_device::msx_slot_music_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_rom_device(mconfig, MSX_SLOT_MUSIC, "MSX Internal MSX-MUSIC", tag, owner, clock, "msx_slot_music", __FILE__) , m_ym2413(nullptr) , m_ym2413_tag(nullptr) diff --git a/src/devices/bus/msx_slot/music.h b/src/devices/bus/msx_slot/music.h index 8e442bc310c..d5587c9068c 100644 --- a/src/devices/bus/msx_slot/music.h +++ b/src/devices/bus/msx_slot/music.h @@ -19,7 +19,7 @@ extern const device_type MSX_SLOT_MUSIC; class msx_slot_music_device : public msx_slot_rom_device { public: - msx_slot_music_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_music_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers static void set_ym2413_tag(device_t &device, const char *tag) { dynamic_cast(device).m_ym2413_tag = tag; } diff --git a/src/devices/bus/msx_slot/panasonic08.cpp b/src/devices/bus/msx_slot/panasonic08.cpp index 70699caed18..ce861c3e7da 100644 --- a/src/devices/bus/msx_slot/panasonic08.cpp +++ b/src/devices/bus/msx_slot/panasonic08.cpp @@ -16,7 +16,7 @@ Todo: const device_type MSX_SLOT_PANASONIC08 = &device_creator; -msx_slot_panasonic08_device::msx_slot_panasonic08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_panasonic08_device::msx_slot_panasonic08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_SLOT_PANASONIC08, "MSX Internal Panasonic08", tag, owner, clock, "msx_slot_panasonic08", __FILE__) , msx_internal_slot_interface() , m_nvram(*this, "nvram") @@ -44,7 +44,7 @@ machine_config_constructor msx_slot_panasonic08_device::device_mconfig_additions } -void msx_slot_panasonic08_device::set_rom_start(device_t &device, const char *region, UINT32 offset) +void msx_slot_panasonic08_device::set_rom_start(device_t &device, const char *region, uint32_t offset) { msx_slot_panasonic08_device &dev = downcast(device); @@ -122,7 +122,7 @@ WRITE8_MEMBER(msx_slot_panasonic08_device::write) { if ((offset & 0xc000) == 0x8000 || (offset & 0xc000) == 0x0000) { - UINT8 bank = m_selected_bank[offset >> 13]; + uint8_t bank = m_selected_bank[offset >> 13]; if (bank >= 0x80 && bank < 0x84) // Are these banks were sram is present? Mirroring? { logerror("msx_slot_panasonic08: writing %02x to sram %04x, bank = %02x\n", data, offset & 0x1fff, bank); diff --git a/src/devices/bus/msx_slot/panasonic08.h b/src/devices/bus/msx_slot/panasonic08.h index b43d5646bba..eb7b058a71c 100644 --- a/src/devices/bus/msx_slot/panasonic08.h +++ b/src/devices/bus/msx_slot/panasonic08.h @@ -18,10 +18,10 @@ class msx_slot_panasonic08_device : public device_t, public msx_internal_slot_interface { public: - msx_slot_panasonic08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_panasonic08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - static void set_rom_start(device_t &device, const char *region, UINT32 offset); + static void set_rom_start(device_t &device, const char *region, uint32_t offset); virtual void device_start() override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -34,12 +34,12 @@ public: private: required_device m_nvram; required_memory_region m_rom_region; - UINT32 m_region_offset; - const UINT8 *m_rom; - UINT8 m_selected_bank[8]; - const UINT8 *m_bank_base[8]; - UINT8 m_control; - std::vector m_sram; + uint32_t m_region_offset; + const uint8_t *m_rom; + uint8_t m_selected_bank[8]; + const uint8_t *m_bank_base[8]; + uint8_t m_control; + std::vector m_sram; void map_bank(int bank); }; diff --git a/src/devices/bus/msx_slot/ram.cpp b/src/devices/bus/msx_slot/ram.cpp index cb07422358a..85b645b448d 100644 --- a/src/devices/bus/msx_slot/ram.cpp +++ b/src/devices/bus/msx_slot/ram.cpp @@ -6,7 +6,7 @@ const device_type MSX_SLOT_RAM = &device_creator; -msx_slot_ram_device::msx_slot_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_ram_device::msx_slot_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_SLOT_RAM, "MSX Internal RAM", tag, owner, clock, "msx_slot_ram", __FILE__) , msx_internal_slot_interface() { diff --git a/src/devices/bus/msx_slot/ram.h b/src/devices/bus/msx_slot/ram.h index da9ed2e61b0..7e05bb9d46c 100644 --- a/src/devices/bus/msx_slot/ram.h +++ b/src/devices/bus/msx_slot/ram.h @@ -16,9 +16,9 @@ class msx_slot_ram_device : public device_t, public msx_internal_slot_interface { public: - msx_slot_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void force_start_address(device_t &device, UINT16 start) { downcast(device).m_start_address = start; } + static void force_start_address(device_t &device, uint16_t start) { downcast(device).m_start_address = start; } virtual void device_start() override; @@ -26,7 +26,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write) override; private: - std::vector m_ram; + std::vector m_ram; }; diff --git a/src/devices/bus/msx_slot/ram_mm.cpp b/src/devices/bus/msx_slot/ram_mm.cpp index 4d70fff80bc..86078ca280f 100644 --- a/src/devices/bus/msx_slot/ram_mm.cpp +++ b/src/devices/bus/msx_slot/ram_mm.cpp @@ -5,7 +5,7 @@ const device_type MSX_SLOT_RAM_MM = &device_creator; -msx_slot_ram_mm_device::msx_slot_ram_mm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_ram_mm_device::msx_slot_ram_mm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_SLOT_RAM_MM, "MSX Internal Memory Mapped RAM", tag, owner, clock, "msx_slot_ram_mm", __FILE__) , msx_internal_slot_interface() , m_total_size(0) diff --git a/src/devices/bus/msx_slot/ram_mm.h b/src/devices/bus/msx_slot/ram_mm.h index b58532c2d57..1350d3c3158 100644 --- a/src/devices/bus/msx_slot/ram_mm.h +++ b/src/devices/bus/msx_slot/ram_mm.h @@ -16,10 +16,10 @@ class msx_slot_ram_mm_device : public device_t , public msx_internal_slot_interface { public: - msx_slot_ram_mm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_ram_mm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_total_size(device_t &device, UINT32 total_size) { dynamic_cast(device).m_total_size = total_size; } - static void set_ramio_set_bits(device_t &device, UINT8 ramio_set_bits) { dynamic_cast(device).m_ramio_set_bits = ramio_set_bits; } + static void set_total_size(device_t &device, uint32_t total_size) { dynamic_cast(device).m_total_size = total_size; } + static void set_ramio_set_bits(device_t &device, uint8_t ramio_set_bits) { dynamic_cast(device).m_ramio_set_bits = ramio_set_bits; } virtual void device_start() override; @@ -32,12 +32,12 @@ public: void restore_banks(); private: - std::vector m_ram; - UINT32 m_total_size; - UINT8 m_bank_mask; - UINT8 m_bank_selected[4]; - UINT8 *m_bank_base[4]; - UINT8 m_ramio_set_bits; + std::vector m_ram; + uint32_t m_total_size; + uint8_t m_bank_mask; + uint8_t m_bank_selected[4]; + uint8_t *m_bank_base[4]; + uint8_t m_ramio_set_bits; }; extern const device_type MSX_SLOT_RAM_MM; diff --git a/src/devices/bus/msx_slot/rom.cpp b/src/devices/bus/msx_slot/rom.cpp index cad0996a023..85c9930cfc7 100644 --- a/src/devices/bus/msx_slot/rom.cpp +++ b/src/devices/bus/msx_slot/rom.cpp @@ -7,13 +7,13 @@ const device_type MSX_SLOT_ROM = &device_creator; -msx_slot_rom_device::msx_slot_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_rom_device::msx_slot_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msx_slot_rom_device(mconfig, MSX_SLOT_ROM, "MSX Internal ROM", tag, owner, clock, "msx_slot_rom", __FILE__) { } -msx_slot_rom_device::msx_slot_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +msx_slot_rom_device::msx_slot_rom_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) , msx_internal_slot_interface() , m_rom_region(*this, finder_base::DUMMY_TAG) @@ -23,7 +23,7 @@ msx_slot_rom_device::msx_slot_rom_device(const machine_config &mconfig, device_t } -void msx_slot_rom_device::set_rom_start(device_t &device, const char *region, UINT32 offset) +void msx_slot_rom_device::set_rom_start(device_t &device, const char *region, uint32_t offset) { msx_slot_rom_device &dev = downcast(device); diff --git a/src/devices/bus/msx_slot/rom.h b/src/devices/bus/msx_slot/rom.h index 98679eaa452..09389b80eb4 100644 --- a/src/devices/bus/msx_slot/rom.h +++ b/src/devices/bus/msx_slot/rom.h @@ -13,11 +13,11 @@ class msx_slot_rom_device : public device_t, public msx_internal_slot_interface { public: - msx_slot_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - msx_slot_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_rom_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); + msx_slot_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - static void set_rom_start(device_t &device, const char *region, UINT32 offset); + static void set_rom_start(device_t &device, const char *region, uint32_t offset); virtual void device_start() override; @@ -25,8 +25,8 @@ public: private: required_memory_region m_rom_region; - UINT32 m_region_offset; - const UINT8 *m_rom; + uint32_t m_region_offset; + const uint8_t *m_rom; }; extern const device_type MSX_SLOT_ROM; diff --git a/src/devices/bus/msx_slot/slot.cpp b/src/devices/bus/msx_slot/slot.cpp index db8e8f89ae7..165edba37e0 100644 --- a/src/devices/bus/msx_slot/slot.cpp +++ b/src/devices/bus/msx_slot/slot.cpp @@ -20,14 +20,14 @@ msx_internal_slot_interface::msx_internal_slot_interface() { } -void msx_internal_slot_interface::set_start_address(device_t &device, UINT32 start_address) +void msx_internal_slot_interface::set_start_address(device_t &device, uint32_t start_address) { msx_internal_slot_interface &dev = dynamic_cast(device); dev.m_start_address = start_address; dev.m_end_address = dev.m_start_address + dev.m_size; } -void msx_internal_slot_interface::set_size(device_t &device, UINT32 size) +void msx_internal_slot_interface::set_size(device_t &device, uint32_t size) { msx_internal_slot_interface &dev = dynamic_cast(device); diff --git a/src/devices/bus/msx_slot/slot.h b/src/devices/bus/msx_slot/slot.h index 5208e421a95..b2349fadc30 100644 --- a/src/devices/bus/msx_slot/slot.h +++ b/src/devices/bus/msx_slot/slot.h @@ -25,16 +25,16 @@ public: virtual ~msx_internal_slot_interface() { } // static configuration helpers - static void set_start_address(device_t &device, UINT32 start_address); - static void set_size(device_t &device, UINT32 size); + static void set_start_address(device_t &device, uint32_t start_address); + static void set_size(device_t &device, uint32_t size); virtual DECLARE_READ8_MEMBER(read) { return 0xFF; } virtual DECLARE_WRITE8_MEMBER(write) { } protected: - UINT32 m_start_address; - UINT32 m_size; - UINT32 m_end_address; + uint32_t m_start_address; + uint32_t m_size; + uint32_t m_end_address; }; #endif diff --git a/src/devices/bus/msx_slot/sony08.cpp b/src/devices/bus/msx_slot/sony08.cpp index eb2f506dd36..61b6b836f13 100644 --- a/src/devices/bus/msx_slot/sony08.cpp +++ b/src/devices/bus/msx_slot/sony08.cpp @@ -13,7 +13,7 @@ const device_type MSX_SLOT_SONY08 = &device_creator; -msx_slot_sony08_device::msx_slot_sony08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msx_slot_sony08_device::msx_slot_sony08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSX_SLOT_SONY08, "MSX Internal SONY08", tag, owner, clock, "msx_slot_sony08", __FILE__) , msx_internal_slot_interface() , m_nvram(*this, "nvram") @@ -41,7 +41,7 @@ machine_config_constructor msx_slot_sony08_device::device_mconfig_additions() co } -void msx_slot_sony08_device::set_rom_start(device_t &device, const char *region, UINT32 offset) +void msx_slot_sony08_device::set_rom_start(device_t &device, const char *region, uint32_t offset) { msx_slot_sony08_device &dev = downcast(device); @@ -122,7 +122,7 @@ READ8_MEMBER(msx_slot_sony08_device::read) return m_bank_base[6 + ((offset >> 11) & 0x01)][offset & 0x7ff]; } - const UINT8 *mem = m_bank_base[offset >> 13]; + const uint8_t *mem = m_bank_base[offset >> 13]; if (mem) { diff --git a/src/devices/bus/msx_slot/sony08.h b/src/devices/bus/msx_slot/sony08.h index 87b10934511..e65c398f082 100644 --- a/src/devices/bus/msx_slot/sony08.h +++ b/src/devices/bus/msx_slot/sony08.h @@ -18,10 +18,10 @@ class msx_slot_sony08_device : public device_t, public msx_internal_slot_interface { public: - msx_slot_sony08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msx_slot_sony08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - static void set_rom_start(device_t &device, const char *region, UINT32 offset); + static void set_rom_start(device_t &device, const char *region, uint32_t offset); virtual void device_start() override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -34,11 +34,11 @@ public: private: required_device m_nvram; required_memory_region m_rom_region; - UINT32 m_region_offset; - const UINT8 *m_rom; - UINT8 m_selected_bank[8]; - const UINT8 *m_bank_base[8]; - UINT8 m_sram[0x4000]; + uint32_t m_region_offset; + const uint8_t *m_rom; + uint8_t m_selected_bank[8]; + const uint8_t *m_bank_base[8]; + uint8_t m_sram[0x4000]; void map_bank(int bank); }; diff --git a/src/devices/bus/nasbus/avc.cpp b/src/devices/bus/nasbus/avc.cpp index 8960a19573f..4ed0931150e 100644 --- a/src/devices/bus/nasbus/avc.cpp +++ b/src/devices/bus/nasbus/avc.cpp @@ -47,7 +47,7 @@ machine_config_constructor nascom_avc_device::device_mconfig_additions() const // nascom_avc_device - constructor //------------------------------------------------- -nascom_avc_device::nascom_avc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nascom_avc_device::nascom_avc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NASCOM_AVC, "Nascom Advanced Video Card", tag, owner, clock, "nascom_avc", __FILE__), device_nasbus_card_interface(mconfig, *this), m_crtc(*this, "mc6845"), diff --git a/src/devices/bus/nasbus/avc.h b/src/devices/bus/nasbus/avc.h index 08b43b82d8d..d576a6a6c1d 100644 --- a/src/devices/bus/nasbus/avc.h +++ b/src/devices/bus/nasbus/avc.h @@ -26,7 +26,7 @@ class nascom_avc_device : public device_t, public device_nasbus_card_interface { public: // construction/destruction - nascom_avc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nascom_avc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); MC6845_UPDATE_ROW(crtc_update_row); DECLARE_WRITE8_MEMBER(control_w); @@ -43,11 +43,11 @@ private: required_device m_crtc; required_device m_palette; - std::vector m_r_ram; - std::vector m_g_ram; - std::vector m_b_ram; + std::vector m_r_ram; + std::vector m_g_ram; + std::vector m_b_ram; - UINT8 m_control; + uint8_t m_control; }; // device type definition diff --git a/src/devices/bus/nasbus/floppy.cpp b/src/devices/bus/nasbus/floppy.cpp index 8c87bf55b35..f61bc5a537f 100644 --- a/src/devices/bus/nasbus/floppy.cpp +++ b/src/devices/bus/nasbus/floppy.cpp @@ -63,7 +63,7 @@ machine_config_constructor nascom_fdc_device::device_mconfig_additions() const // wordpro_device - constructor //------------------------------------------------- -nascom_fdc_device::nascom_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nascom_fdc_device::nascom_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NASCOM_FDC, "Nascom Floppy Disc Controller", tag, owner, clock, "nascom_fdc", __FILE__), device_nasbus_card_interface(mconfig, *this), m_fdc(*this, "fd1793"), @@ -190,7 +190,7 @@ WRITE8_MEMBER( nascom_fdc_device::select_w ) READ8_MEMBER( nascom_fdc_device::status_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= m_fdc->intrq_r() << 0; diff --git a/src/devices/bus/nasbus/floppy.h b/src/devices/bus/nasbus/floppy.h index ea27b266667..2343ea3e41e 100644 --- a/src/devices/bus/nasbus/floppy.h +++ b/src/devices/bus/nasbus/floppy.h @@ -26,7 +26,7 @@ class nascom_fdc_device : public device_t, public device_nasbus_card_interface { public: // construction/destruction - nascom_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nascom_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(select_r); DECLARE_WRITE8_MEMBER(select_w); @@ -52,7 +52,7 @@ private: floppy_image_device *m_floppy; emu_timer *m_motor; - UINT8 m_select; + uint8_t m_select; }; // device type definition diff --git a/src/devices/bus/nasbus/nasbus.cpp b/src/devices/bus/nasbus/nasbus.cpp index bd0f2d4dab4..f0e30be6039 100644 --- a/src/devices/bus/nasbus/nasbus.cpp +++ b/src/devices/bus/nasbus/nasbus.cpp @@ -21,7 +21,7 @@ const device_type NASBUS_SLOT = &device_creator; // nasbus_slot_device - constructor //------------------------------------------------- -nasbus_slot_device::nasbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nasbus_slot_device::nasbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NASBUS_SLOT, "NASBUS Slot", tag, owner, clock, "nasbus_slot", __FILE__), device_slot_interface(mconfig, *this), m_nasbus_tag(nullptr) @@ -29,7 +29,7 @@ nasbus_slot_device::nasbus_slot_device(const machine_config &mconfig, const char } nasbus_slot_device::nasbus_slot_device(const machine_config &mconfig, device_type type, const char *name, - const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : + 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_slot_interface(mconfig, *this), m_nasbus_tag(nullptr) @@ -69,7 +69,7 @@ const device_type NASBUS = &device_creator; // nasbus_device - constructor //------------------------------------------------- -nasbus_device::nasbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nasbus_device::nasbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NASBUS_SLOT, "NASBUS Backplane", tag, owner, clock, "nasbus", __FILE__), m_program(nullptr), m_io(nullptr), diff --git a/src/devices/bus/nasbus/nasbus.h b/src/devices/bus/nasbus/nasbus.h index 34e35de4886..73c0a9e3a3a 100644 --- a/src/devices/bus/nasbus/nasbus.h +++ b/src/devices/bus/nasbus/nasbus.h @@ -131,9 +131,9 @@ class nasbus_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - nasbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nasbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); nasbus_slot_device(const machine_config &mconfig, device_type type, const char *name, - const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); // device-level overrides virtual void device_start() override; @@ -155,7 +155,7 @@ class nasbus_device : public device_t { public: // construction/destruction - nasbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nasbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~nasbus_device(); template static devcb_base &set_ram_disable_handler(device_t &device, _Object object) diff --git a/src/devices/bus/neogeo/boot_cthd.cpp b/src/devices/bus/neogeo/boot_cthd.cpp index 1cb69ca1ecb..af8f38ec254 100644 --- a/src/devices/bus/neogeo/boot_cthd.cpp +++ b/src/devices/bus/neogeo/boot_cthd.cpp @@ -19,12 +19,12 @@ const device_type NEOGEO_CTHD2K3_CART = &device_creator; -neogeo_cthd2k3_cart::neogeo_cthd2k3_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source) : +neogeo_cthd2k3_cart::neogeo_cthd2k3_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source) : neogeo_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_prot(*this, "cthd_prot") {} -neogeo_cthd2k3_cart::neogeo_cthd2k3_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_cthd2k3_cart::neogeo_cthd2k3_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_CTHD2K3_CART, "Neo Geo CTHD 2003 Cart", tag, owner, clock, "neocart_ct2k3", __FILE__), m_prot(*this, "cthd_prot") {} @@ -76,7 +76,7 @@ void neogeo_cthd2k3_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CT2K3SP_CART = &device_creator; -neogeo_ct2k3sp_cart::neogeo_ct2k3sp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_ct2k3sp_cart::neogeo_ct2k3sp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cthd2k3_cart(mconfig, NEOGEO_CT2K3SP_CART, "Neo Geo CTHD 2003 Sp Cart", tag, owner, clock, "neocart_ct2k3sp", __FILE__) {} @@ -92,7 +92,7 @@ void neogeo_ct2k3sp_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CT2K3SA_CART = &device_creator; -neogeo_ct2k3sa_cart::neogeo_ct2k3sa_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_ct2k3sa_cart::neogeo_ct2k3sa_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cthd2k3_cart(mconfig, NEOGEO_CT2K3SA_CART, "Neo Geo CTHD 2003 Sp Alt Cart", tag, owner, clock, "neocart_ct2k3sa", __FILE__) {} @@ -109,7 +109,7 @@ void neogeo_ct2k3sa_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_MATRIMBL_CART = &device_creator; -neogeo_matrimbl_cart::neogeo_matrimbl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_matrimbl_cart::neogeo_matrimbl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cthd2k3_cart(mconfig, NEOGEO_MATRIMBL_CART, "Neo Geo Matrimelee Bootleg Cart", tag, owner, clock, "neocart_matrimbl", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_kof2k2_prot(*this, "kof2k2_prot") diff --git a/src/devices/bus/neogeo/boot_cthd.h b/src/devices/bus/neogeo/boot_cthd.h index 8793bdea046..7d3bb213b80 100644 --- a/src/devices/bus/neogeo/boot_cthd.h +++ b/src/devices/bus/neogeo/boot_cthd.h @@ -13,8 +13,8 @@ class neogeo_cthd2k3_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_cthd2k3_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source); - neogeo_cthd2k3_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_cthd2k3_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source); + neogeo_cthd2k3_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; @@ -22,7 +22,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const override; // reading and writing - virtual UINT32 get_bank_base(UINT16 sel) override { return m_prot->get_bank_base(sel); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_prot->get_bank_base(sel); } virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } @@ -42,7 +42,7 @@ extern const device_type NEOGEO_CTHD2K3_CART; class neogeo_ct2k3sp_cart : public neogeo_cthd2k3_cart { public: - neogeo_ct2k3sp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_ct2k3sp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -57,7 +57,7 @@ extern const device_type NEOGEO_CT2K3SP_CART; class neogeo_ct2k3sa_cart : public neogeo_cthd2k3_cart { public: - neogeo_ct2k3sa_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_ct2k3sa_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -75,7 +75,7 @@ extern const device_type NEOGEO_CT2K3SA_CART; class neogeo_matrimbl_cart : public neogeo_cthd2k3_cart { public: - neogeo_matrimbl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_matrimbl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 2; } diff --git a/src/devices/bus/neogeo/boot_kof10th.cpp b/src/devices/bus/neogeo/boot_kof10th.cpp index a86200967b7..5420fbd52a9 100644 --- a/src/devices/bus/neogeo/boot_kof10th.cpp +++ b/src/devices/bus/neogeo/boot_kof10th.cpp @@ -19,7 +19,7 @@ const device_type NEOGEO_KOF10TH_CART = &device_creator; -neogeo_kof10th_cart::neogeo_kof10th_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_kof10th_cart::neogeo_kof10th_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KOF10TH_CART, "Neo Geo KOF 10th Ann Bootleg Cart", tag, owner, clock, "neocart_kof10th", __FILE__) {} @@ -61,7 +61,7 @@ machine_config_constructor neogeo_kof10th_cart::device_mconfig_additions() const void neogeo_kof10th_cart::decrypt_all(DECRYPT_ALL_PARAMS) { m_prot->kof10th_decrypt(cpuregion, cpuregion_size); - memcpy(m_cart_ram2, (UINT8 *)cpuregion + 0xe0000, 0x20000); + memcpy(m_cart_ram2, (uint8_t *)cpuregion + 0xe0000, 0x20000); m_fixed = (get_fixed_size()) ? get_fixed_base() : get_region_fixed_base(); } @@ -70,20 +70,20 @@ void neogeo_kof10th_cart::decrypt_all(DECRYPT_ALL_PARAMS) is incomplete, at the moment the S data is copied from the program rom on start-up instead */ -UINT32 neogeo_kof10th_cart::get_bank_base(UINT16 sel) +uint32_t neogeo_kof10th_cart::get_bank_base(uint16_t sel) { - UINT32 bank = 0x100000 + ((sel & 7) << 20); + uint32_t bank = 0x100000 + ((sel & 7) << 20); if (bank >= 0x700000) bank = 0x100000; return bank; } -UINT16 neogeo_kof10th_cart::get_helper() +uint16_t neogeo_kof10th_cart::get_helper() { return m_cart_ram[0xffc]; } -UINT32 neogeo_kof10th_cart::get_special_bank() +uint32_t neogeo_kof10th_cart::get_special_bank() { return m_special_bank; } diff --git a/src/devices/bus/neogeo/boot_kof10th.h b/src/devices/bus/neogeo/boot_kof10th.h index 0303e4f35d8..0ba5c0ee2a1 100644 --- a/src/devices/bus/neogeo/boot_kof10th.h +++ b/src/devices/bus/neogeo/boot_kof10th.h @@ -13,7 +13,7 @@ class neogeo_kof10th_cart : public neogeo_bootleg_cart { public: // construction/destruction - neogeo_kof10th_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_kof10th_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; @@ -21,9 +21,9 @@ public: virtual machine_config_constructor device_mconfig_additions() const override; // reading and writing - virtual UINT16 get_helper() override; - virtual UINT32 get_bank_base(UINT16 sel) override; - virtual UINT32 get_special_bank() override; + virtual uint16_t get_helper() override; + virtual uint32_t get_bank_base(uint16_t sel) override; + virtual uint32_t get_special_bank() override; virtual DECLARE_READ16_MEMBER(addon_r) override; virtual DECLARE_READ16_MEMBER(protection_r) override; virtual DECLARE_WRITE16_MEMBER(protection_w) override; @@ -32,10 +32,10 @@ public: virtual int get_fixed_bank_type(void) override { return 0; } private: - UINT8* m_fixed; - UINT32 m_special_bank; - UINT16 m_cart_ram[0x1000]; - UINT16 m_cart_ram2[0x10000]; + uint8_t* m_fixed; + uint32_t m_special_bank; + uint16_t m_cart_ram[0x1000]; + uint16_t m_cart_ram2[0x10000]; }; // device type definition diff --git a/src/devices/bus/neogeo/boot_kof2k2.cpp b/src/devices/bus/neogeo/boot_kof2k2.cpp index f6d602491d6..eff560a3bc2 100644 --- a/src/devices/bus/neogeo/boot_kof2k2.cpp +++ b/src/devices/bus/neogeo/boot_kof2k2.cpp @@ -46,7 +46,7 @@ machine_config_constructor neogeo_kf2k2mp2_cart::device_mconfig_additions() cons const device_type NEOGEO_KOF2002B_CART = &device_creator; -neogeo_kof2002b_cart::neogeo_kof2002b_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kof2002b_cart::neogeo_kof2002b_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KOF2002B_CART, "Neo Geo KOF 2002 Bootleg Cart", tag, owner, clock, "neocart_kof2002b", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot"), @@ -69,7 +69,7 @@ void neogeo_kof2002b_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_KF2K2MP_CART = &device_creator; -neogeo_kf2k2mp_cart::neogeo_kf2k2mp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kf2k2mp_cart::neogeo_kf2k2mp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KF2K2MP_CART, "Neo Geo KOF 2002 MP Cart", tag, owner, clock, "neocart_kf2k2mp", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot") @@ -91,7 +91,7 @@ void neogeo_kf2k2mp_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_KF2K2MP2_CART = &device_creator; -neogeo_kf2k2mp2_cart::neogeo_kf2k2mp2_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kf2k2mp2_cart::neogeo_kf2k2mp2_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KF2K2MP2_CART, "Neo Geo KOF 2002 MP2 Cart", tag, owner, clock, "neocart_kf2k2mp2", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot") diff --git a/src/devices/bus/neogeo/boot_kof2k2.h b/src/devices/bus/neogeo/boot_kof2k2.h index 23a8ac53aaf..11539369d78 100644 --- a/src/devices/bus/neogeo/boot_kof2k2.h +++ b/src/devices/bus/neogeo/boot_kof2k2.h @@ -18,7 +18,7 @@ class neogeo_kof2002b_cart : public neogeo_bootleg_cart { public: - neogeo_kof2002b_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kof2002b_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } @@ -40,7 +40,7 @@ extern const device_type NEOGEO_KOF2002B_CART; class neogeo_kf2k2mp_cart : public neogeo_bootleg_cart { public: - neogeo_kf2k2mp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kf2k2mp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } @@ -61,7 +61,7 @@ extern const device_type NEOGEO_KF2K2MP_CART; class neogeo_kf2k2mp2_cart : public neogeo_bootleg_cart { public: - neogeo_kf2k2mp2_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kf2k2mp2_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } diff --git a/src/devices/bus/neogeo/boot_kof2k3.cpp b/src/devices/bus/neogeo/boot_kof2k3.cpp index 5426ebf9f5b..25b3560c45f 100644 --- a/src/devices/bus/neogeo/boot_kof2k3.cpp +++ b/src/devices/bus/neogeo/boot_kof2k3.cpp @@ -40,7 +40,7 @@ machine_config_constructor neogeo_kf2k3upl_cart::device_mconfig_additions() cons const device_type NEOGEO_KF2K3BL_CART = &device_creator; -neogeo_kf2k3bl_cart::neogeo_kf2k3bl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kf2k3bl_cart::neogeo_kf2k3bl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KF2K3BL_CART, "Neo Geo KOF 2003 Bootleg Cart", tag, owner, clock, "neocart_kf2k3bl", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot"), @@ -61,7 +61,7 @@ void neogeo_kf2k3bl_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_KF2K3PL_CART = &device_creator; -neogeo_kf2k3pl_cart::neogeo_kf2k3pl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kf2k3pl_cart::neogeo_kf2k3pl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KF2K3PL_CART, "Neo Geo KOF 2003 PL Cart", tag, owner, clock, "neocart_kf2k3pl", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot"), @@ -83,7 +83,7 @@ void neogeo_kf2k3pl_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_KF2K3UPL_CART = &device_creator; -neogeo_kf2k3upl_cart::neogeo_kf2k3upl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kf2k3upl_cart::neogeo_kf2k3upl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KF2K3UPL_CART, "Neo Geo KOF 2003 UPL Cart", tag, owner, clock, "neocart_kf2k3upl", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot"), diff --git a/src/devices/bus/neogeo/boot_kof2k3.h b/src/devices/bus/neogeo/boot_kof2k3.h index 848f5cd647e..4b7a0a9e911 100644 --- a/src/devices/bus/neogeo/boot_kof2k3.h +++ b/src/devices/bus/neogeo/boot_kof2k3.h @@ -15,13 +15,13 @@ class neogeo_kf2k3bl_cart : public neogeo_bootleg_cart { public: - neogeo_kf2k3bl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kf2k3bl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } virtual machine_config_constructor device_mconfig_additions() const override; - virtual UINT32 get_bank_base(UINT16 sel) override { return m_kof2k3bl_prot->get_bank_base(); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_kof2k3bl_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_kof2k3bl_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_kof2k3bl_prot->kof2003_w(space, offset, data, mem_mask); } virtual DECLARE_READ16_MEMBER(addon_r) override { return m_kof2k3bl_prot->overlay_r(space, offset, mem_mask); } @@ -42,13 +42,13 @@ extern const device_type NEOGEO_KF2K3BL_CART; class neogeo_kf2k3pl_cart : public neogeo_bootleg_cart { public: - neogeo_kf2k3pl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kf2k3pl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } virtual machine_config_constructor device_mconfig_additions() const override; - virtual UINT32 get_bank_base(UINT16 sel) override { return m_kof2k3bl_prot->get_bank_base(); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_kof2k3bl_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_kof2k3bl_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_kof2k3bl_prot->kof2003p_w(space, offset, data, mem_mask); } @@ -68,13 +68,13 @@ extern const device_type NEOGEO_KF2K3PL_CART; class neogeo_kf2k3upl_cart : public neogeo_bootleg_cart { public: - neogeo_kf2k3upl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kf2k3upl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } virtual machine_config_constructor device_mconfig_additions() const override; - virtual UINT32 get_bank_base(UINT16 sel) override { return m_kof2k3bl_prot->get_bank_base(); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_kof2k3bl_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_kof2k3bl_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_kof2k3bl_prot->kof2003_w(space, offset, data, mem_mask); } virtual DECLARE_READ16_MEMBER(addon_r) override { return m_kof2k3bl_prot->overlay_r(space, offset, mem_mask); } diff --git a/src/devices/bus/neogeo/boot_misc.cpp b/src/devices/bus/neogeo/boot_misc.cpp index 16fa78c12f6..082d011d9ac 100644 --- a/src/devices/bus/neogeo/boot_misc.cpp +++ b/src/devices/bus/neogeo/boot_misc.cpp @@ -19,12 +19,12 @@ const device_type NEOGEO_BOOTLEG_CART = &device_creator; -neogeo_bootleg_cart::neogeo_bootleg_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source) : +neogeo_bootleg_cart::neogeo_bootleg_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source) : neogeo_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_prot(*this, "bootleg_prot") {} -neogeo_bootleg_cart::neogeo_bootleg_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_bootleg_cart::neogeo_bootleg_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_BOOTLEG_CART, "Neo Geo Bootleg Protected Cart", tag, owner, clock, "neocart_boot", __FILE__), m_prot(*this, "bootleg_prot") {} @@ -64,7 +64,7 @@ machine_config_constructor neogeo_bootleg_cart::device_mconfig_additions() const const device_type NEOGEO_GAROUBL_CART = &device_creator; -neogeo_garoubl_cart::neogeo_garoubl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_garoubl_cart::neogeo_garoubl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_GAROUBL_CART, "Neo Geo Garou Bootleg Cart", tag, owner, clock, "neocart_garoubl", __FILE__) {} @@ -82,7 +82,7 @@ void neogeo_garoubl_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_KOF97ORO_CART = &device_creator; -neogeo_kof97oro_cart::neogeo_kof97oro_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kof97oro_cart::neogeo_kof97oro_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KOF97ORO_CART, "Neo Geo KOF 97 Orochi Bootleg Cart", tag, owner, clock, "neocart_kof97oro", __FILE__) {} @@ -101,7 +101,7 @@ void neogeo_kof97oro_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_KF10THEP_CART = &device_creator; -neogeo_kf10thep_cart::neogeo_kf10thep_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kf10thep_cart::neogeo_kf10thep_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KF10THEP_CART, "Neo Geo KOF 10th Ann. EP Bootleg Cart", tag, owner, clock, "neocart_kf10thep", __FILE__) {} @@ -119,7 +119,7 @@ void neogeo_kf10thep_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_KF2K5UNI_CART = &device_creator; -neogeo_kf2k5uni_cart::neogeo_kf2k5uni_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kf2k5uni_cart::neogeo_kf2k5uni_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KF2K5UNI_CART, "Neo Geo KOF 2005 Unique Bootleg Cart", tag, owner, clock, "neocart_kf2k5uni", __FILE__) {} @@ -138,7 +138,7 @@ void neogeo_kf2k5uni_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_KF2K4SE_CART = &device_creator; -neogeo_kf2k4se_cart::neogeo_kf2k4se_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kf2k4se_cart::neogeo_kf2k4se_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KF2K4SE_CART, "Neo Geo KOF 2004 SE Bootleg Cart", tag, owner, clock, "neocart_kf2k4se", __FILE__) {} @@ -155,7 +155,7 @@ void neogeo_kf2k4se_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_LANS2004_CART = &device_creator; -neogeo_lans2004_cart::neogeo_lans2004_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_lans2004_cart::neogeo_lans2004_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_LANS2004_CART, "Neo Geo Lansquenet 2004 Bootleg Cart", tag, owner, clock, "neocart_lans2004", __FILE__) {} @@ -174,7 +174,7 @@ void neogeo_lans2004_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_SAMSHO5B_CART = &device_creator; -neogeo_samsho5b_cart::neogeo_samsho5b_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_samsho5b_cart::neogeo_samsho5b_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_SAMSHO5B_CART, "Neo Geo Samurai Shodown 5 Bootleg Cart", tag, owner, clock, "neocart_samsho5b", __FILE__) {} @@ -193,7 +193,7 @@ void neogeo_samsho5b_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_MSLUG3B6_CART = &device_creator; -neogeo_mslug3b6_cart::neogeo_mslug3b6_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_mslug3b6_cart::neogeo_mslug3b6_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_MSLUG3B6_CART, "Neo Geo Metal Slug 6 Bootleg Cart", tag, owner, clock, "neocart_mslug3b6", __FILE__), m_cmc_prot(*this, "cmc_prot") {} @@ -221,7 +221,7 @@ machine_config_constructor neogeo_mslug3b6_cart::device_mconfig_additions() cons const device_type NEOGEO_MS5PLUS_CART = &device_creator; -neogeo_ms5plus_cart::neogeo_ms5plus_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_ms5plus_cart::neogeo_ms5plus_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_MS5PLUS_CART, "Neo Geo Metal Slug 5 Plus Bootleg Cart", tag, owner, clock, "neocart_ms5plus", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot") @@ -253,7 +253,7 @@ machine_config_constructor neogeo_ms5plus_cart::device_mconfig_additions() const const device_type NEOGEO_KOG_CART = &device_creator; -neogeo_kog_cart::neogeo_kog_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kog_cart::neogeo_kog_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_KOG_CART, "Neo Geo King of Gladiators Bootleg Cart", tag, owner, clock, "neocart_kog", __FILE__), m_jumper(*this, "JUMPER") {} diff --git a/src/devices/bus/neogeo/boot_misc.h b/src/devices/bus/neogeo/boot_misc.h index 6a62fab27f5..b42da3b4edb 100644 --- a/src/devices/bus/neogeo/boot_misc.h +++ b/src/devices/bus/neogeo/boot_misc.h @@ -15,8 +15,8 @@ class neogeo_bootleg_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_bootleg_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source); - neogeo_bootleg_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_bootleg_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source); + neogeo_bootleg_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; @@ -42,7 +42,7 @@ extern const device_type NEOGEO_BOOTLEG_CART; class neogeo_garoubl_cart : public neogeo_bootleg_cart { public: - neogeo_garoubl_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_garoubl_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -57,7 +57,7 @@ extern const device_type NEOGEO_GAROUBL_CART; class neogeo_kof97oro_cart : public neogeo_bootleg_cart { public: - neogeo_kof97oro_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kof97oro_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -72,7 +72,7 @@ extern const device_type NEOGEO_KOF97ORO_CART; class neogeo_kf10thep_cart : public neogeo_bootleg_cart { public: - neogeo_kf10thep_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kf10thep_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -87,7 +87,7 @@ extern const device_type NEOGEO_KF10THEP_CART; class neogeo_kf2k5uni_cart : public neogeo_bootleg_cart { public: - neogeo_kf2k5uni_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kf2k5uni_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -101,7 +101,7 @@ extern const device_type NEOGEO_KF2K5UNI_CART; class neogeo_kf2k4se_cart : public neogeo_bootleg_cart { public: - neogeo_kf2k4se_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kf2k4se_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -116,7 +116,7 @@ extern const device_type NEOGEO_KF2K4SE_CART; class neogeo_lans2004_cart : public neogeo_bootleg_cart { public: - neogeo_lans2004_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_lans2004_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -131,7 +131,7 @@ extern const device_type NEOGEO_LANS2004_CART; class neogeo_samsho5b_cart : public neogeo_bootleg_cart { public: - neogeo_samsho5b_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_samsho5b_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -146,7 +146,7 @@ extern const device_type NEOGEO_SAMSHO5B_CART; class neogeo_mslug3b6_cart : public neogeo_bootleg_cart { public: - neogeo_mslug3b6_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_mslug3b6_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } @@ -165,14 +165,14 @@ extern const device_type NEOGEO_MSLUG3B6_CART; class neogeo_ms5plus_cart : public neogeo_bootleg_cart { public: - neogeo_ms5plus_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_ms5plus_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_READ16_MEMBER(protection_r) override { return m_prot->mslug5p_prot_r(space, offset, mem_mask); } - virtual UINT32 get_bank_base(UINT16 sel) override { return m_prot->mslug5p_bank_base(sel); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_prot->mslug5p_bank_base(sel); } private: required_device m_cmc_prot; @@ -189,7 +189,7 @@ extern const device_type NEOGEO_MS5PLUS_CART; class neogeo_kog_cart : public neogeo_bootleg_cart { public: - neogeo_kog_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kog_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/neogeo/boot_svc.cpp b/src/devices/bus/neogeo/boot_svc.cpp index 3bec1518958..869bcea516d 100644 --- a/src/devices/bus/neogeo/boot_svc.cpp +++ b/src/devices/bus/neogeo/boot_svc.cpp @@ -18,7 +18,7 @@ const device_type NEOGEO_SVCBOOT_CART = &device_creator; -neogeo_svcboot_cart::neogeo_svcboot_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_svcboot_cart::neogeo_svcboot_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_SVCBOOT_CART, "Neo Geo SVC Bootleg Cart", tag, owner, clock, "neocart_svcboot", __FILE__), m_pvc_prot(*this, "pvc_prot") {} @@ -46,7 +46,7 @@ machine_config_constructor neogeo_svcboot_cart::device_mconfig_additions() const const device_type NEOGEO_SVCPLUS_CART = &device_creator; -neogeo_svcplus_cart::neogeo_svcplus_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_svcplus_cart::neogeo_svcplus_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_SVCPLUS_CART, "Neo Geo SVC Plus Bootleg Cart", tag, owner, clock, "neocart_svcplus", __FILE__) {} @@ -65,7 +65,7 @@ void neogeo_svcplus_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_SVCPLUSA_CART = &device_creator; -neogeo_svcplusa_cart::neogeo_svcplusa_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_svcplusa_cart::neogeo_svcplusa_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_SVCPLUSA_CART, "Neo Geo SVC Plus Alt Bootleg Cart", tag, owner, clock, "neocart_svcplusa", __FILE__) {} @@ -82,7 +82,7 @@ void neogeo_svcplusa_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_SVCSPLUS_CART = &device_creator; -neogeo_svcsplus_cart::neogeo_svcsplus_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_svcsplus_cart::neogeo_svcsplus_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_bootleg_cart(mconfig, NEOGEO_SVCSPLUS_CART, "Neo Geo SVC S.Plus Bootleg Cart", tag, owner, clock, "neocart_svcsplus", __FILE__), m_pvc_prot(*this, "pvc_prot") {} diff --git a/src/devices/bus/neogeo/boot_svc.h b/src/devices/bus/neogeo/boot_svc.h index e7a94b14da1..f0c676c8359 100644 --- a/src/devices/bus/neogeo/boot_svc.h +++ b/src/devices/bus/neogeo/boot_svc.h @@ -15,11 +15,11 @@ class neogeo_svcboot_cart : public neogeo_bootleg_cart { public: - neogeo_svcboot_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_svcboot_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; - virtual UINT32 get_bank_base(UINT16 sel) override { return m_pvc_prot->get_bank_base(); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_pvc_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_pvc_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_pvc_prot->protection_w(space, offset, data, mem_mask); } virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; @@ -38,7 +38,7 @@ extern const device_type NEOGEO_SVCBOOT_CART; class neogeo_svcplus_cart : public neogeo_bootleg_cart { public: - neogeo_svcplus_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_svcplus_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -53,7 +53,7 @@ extern const device_type NEOGEO_SVCPLUS_CART; class neogeo_svcplusa_cart : public neogeo_bootleg_cart { public: - neogeo_svcplusa_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_svcplusa_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -68,11 +68,11 @@ extern const device_type NEOGEO_SVCPLUSA_CART; class neogeo_svcsplus_cart : public neogeo_bootleg_cart { public: - neogeo_svcsplus_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_svcsplus_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; - virtual UINT32 get_bank_base(UINT16 sel) override { return m_pvc_prot->get_bank_base(); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_pvc_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_pvc_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_pvc_prot->protection_w(space, offset, data, mem_mask); } virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; diff --git a/src/devices/bus/neogeo/cmc.cpp b/src/devices/bus/neogeo/cmc.cpp index 4fac2c9eb72..687a1faad07 100644 --- a/src/devices/bus/neogeo/cmc.cpp +++ b/src/devices/bus/neogeo/cmc.cpp @@ -19,12 +19,12 @@ const device_type NEOGEO_CMC_CART = &device_creator; -neogeo_cmc_cart::neogeo_cmc_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source) : +neogeo_cmc_cart::neogeo_cmc_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source) : neogeo_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_prot(*this, "cmc_prot") {} -neogeo_cmc_cart::neogeo_cmc_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_cmc_cart::neogeo_cmc_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_CMC_CART, "Neo Geo CMC Cart", tag, owner, clock, "neocart_cmc", __FILE__), m_prot(*this, "cmc_prot") {} @@ -59,7 +59,7 @@ machine_config_constructor neogeo_cmc_cart::device_mconfig_additions() const const device_type NEOGEO_CMC_ZUPAPA_CART = &device_creator; -neogeo_cmc_zupapa_cart::neogeo_cmc_zupapa_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_zupapa_cart::neogeo_cmc_zupapa_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_ZUPAPA_CART, "Neo Geo Zupapa CMC42 Cart", tag, owner, clock, "neocart_zupapa", __FILE__) {} @@ -76,7 +76,7 @@ void neogeo_cmc_zupapa_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_MSLUG3H_CART = &device_creator; -neogeo_cmc_mslug3h_cart::neogeo_cmc_mslug3h_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_mslug3h_cart::neogeo_cmc_mslug3h_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_MSLUG3H_CART, "Neo Geo Metal Slug 3 AES CMC42 Cart", tag, owner, clock, "neocart_mslug3h", __FILE__) {} @@ -93,7 +93,7 @@ void neogeo_cmc_mslug3h_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_GANRYU_CART = &device_creator; -neogeo_cmc_ganryu_cart::neogeo_cmc_ganryu_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_ganryu_cart::neogeo_cmc_ganryu_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_GANRYU_CART, "Neo Geo Ganryu CMC42 Cart", tag, owner, clock, "neocart_ganryu", __FILE__) {} @@ -110,7 +110,7 @@ void neogeo_cmc_ganryu_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_S1945P_CART = &device_creator; -neogeo_cmc_s1945p_cart::neogeo_cmc_s1945p_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_s1945p_cart::neogeo_cmc_s1945p_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_S1945P_CART, "Neo Geo Strikers 1945 Plus CMC42 Cart", tag, owner, clock, "neocart_s1945p", __FILE__) {} @@ -126,7 +126,7 @@ void neogeo_cmc_s1945p_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_PREISLE2_CART = &device_creator; -neogeo_cmc_preisle2_cart::neogeo_cmc_preisle2_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_preisle2_cart::neogeo_cmc_preisle2_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_PREISLE2_CART, "Neo Geo Prehistorik Isle 2 CMC42 Cart", tag, owner, clock, "neocart_preisle2", __FILE__) {} @@ -142,7 +142,7 @@ void neogeo_cmc_preisle2_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_BANGBEAD_CART = &device_creator; -neogeo_cmc_bangbead_cart::neogeo_cmc_bangbead_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_bangbead_cart::neogeo_cmc_bangbead_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_BANGBEAD_CART, "Neo Geo Bangbead CMC42 Cart", tag, owner, clock, "neocart_bangbead", __FILE__) {} @@ -158,7 +158,7 @@ void neogeo_cmc_bangbead_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_NITD_CART = &device_creator; -neogeo_cmc_nitd_cart::neogeo_cmc_nitd_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_nitd_cart::neogeo_cmc_nitd_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_NITD_CART, "Neo Geo NITD CMC42 Cart", tag, owner, clock, "neocart_nitd", __FILE__) {} @@ -175,7 +175,7 @@ void neogeo_cmc_nitd_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_SENGOKU3_CART = &device_creator; -neogeo_cmc_sengoku3_cart::neogeo_cmc_sengoku3_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_sengoku3_cart::neogeo_cmc_sengoku3_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_SENGOKU3_CART, "Neo Geo Sengoku 3 CMC42 Cart", tag, owner, clock, "neocart_sengoku3", __FILE__) {} @@ -191,7 +191,7 @@ void neogeo_cmc_sengoku3_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_KOF99K_CART = &device_creator; -neogeo_cmc_kof99k_cart::neogeo_cmc_kof99k_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_kof99k_cart::neogeo_cmc_kof99k_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_KOF99K_CART, "Neo Geo KOF 99 Korea CMC42 Cart", tag, owner, clock, "neocart_kof99k", __FILE__) {} @@ -208,7 +208,7 @@ void neogeo_cmc_kof99k_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_KOF2001_CART = &device_creator; -neogeo_cmc_kof2001_cart::neogeo_cmc_kof2001_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_kof2001_cart::neogeo_cmc_kof2001_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_KOF2001_CART, "Neo Geo KOF 2001 CMC50 Cart", tag, owner, clock, "neocart_kof2001", __FILE__) {} @@ -225,7 +225,7 @@ void neogeo_cmc_kof2001_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_KOF2000N_CART = &device_creator; -neogeo_cmc_kof2000n_cart::neogeo_cmc_kof2000n_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_kof2000n_cart::neogeo_cmc_kof2000n_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_KOF2000N_CART, "Neo Geo KOF 2000 CMC50 Cart", tag, owner, clock, "neocart_kof2000n", __FILE__) {} @@ -243,7 +243,7 @@ void neogeo_cmc_kof2000n_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_CMC_JOCKEYGP_CART = &device_creator; -neogeo_cmc_jockeygp_cart::neogeo_cmc_jockeygp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_cmc_jockeygp_cart::neogeo_cmc_jockeygp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_cmc_cart(mconfig, NEOGEO_CMC_JOCKEYGP_CART, "Neo Geo Jockey GP CMC50 Cart", tag, owner, clock, "neocart_jockeygp", __FILE__) {} diff --git a/src/devices/bus/neogeo/cmc.h b/src/devices/bus/neogeo/cmc.h index 43ea32e097b..7ee808ad08c 100644 --- a/src/devices/bus/neogeo/cmc.h +++ b/src/devices/bus/neogeo/cmc.h @@ -13,8 +13,8 @@ class neogeo_cmc_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_cmc_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source); - neogeo_cmc_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_cmc_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source); + neogeo_cmc_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; @@ -41,7 +41,7 @@ extern const device_type NEOGEO_CMC_CART; class neogeo_cmc_zupapa_cart : public neogeo_cmc_cart { public: - neogeo_cmc_zupapa_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_zupapa_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -54,7 +54,7 @@ extern const device_type NEOGEO_CMC_ZUPAPA_CART; class neogeo_cmc_mslug3h_cart : public neogeo_cmc_cart { public: - neogeo_cmc_mslug3h_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_mslug3h_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -68,7 +68,7 @@ extern const device_type NEOGEO_CMC_MSLUG3H_CART; class neogeo_cmc_ganryu_cart : public neogeo_cmc_cart { public: - neogeo_cmc_ganryu_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_ganryu_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -81,7 +81,7 @@ extern const device_type NEOGEO_CMC_GANRYU_CART; class neogeo_cmc_s1945p_cart : public neogeo_cmc_cart { public: - neogeo_cmc_s1945p_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_s1945p_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -95,7 +95,7 @@ extern const device_type NEOGEO_CMC_S1945P_CART; class neogeo_cmc_preisle2_cart : public neogeo_cmc_cart { public: - neogeo_cmc_preisle2_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_preisle2_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -108,7 +108,7 @@ extern const device_type NEOGEO_CMC_PREISLE2_CART; class neogeo_cmc_bangbead_cart : public neogeo_cmc_cart { public: - neogeo_cmc_bangbead_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_bangbead_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -122,7 +122,7 @@ extern const device_type NEOGEO_CMC_BANGBEAD_CART; class neogeo_cmc_nitd_cart : public neogeo_cmc_cart { public: - neogeo_cmc_nitd_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_nitd_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -135,7 +135,7 @@ extern const device_type NEOGEO_CMC_NITD_CART; class neogeo_cmc_sengoku3_cart : public neogeo_cmc_cart { public: - neogeo_cmc_sengoku3_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_sengoku3_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -148,7 +148,7 @@ extern const device_type NEOGEO_CMC_SENGOKU3_CART; class neogeo_cmc_kof99k_cart : public neogeo_cmc_cart { public: - neogeo_cmc_kof99k_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_kof99k_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -161,7 +161,7 @@ extern const device_type NEOGEO_CMC_KOF99K_CART; class neogeo_cmc_kof2001_cart : public neogeo_cmc_cart { public: - neogeo_cmc_kof2001_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_kof2001_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -174,7 +174,7 @@ extern const device_type NEOGEO_CMC_KOF2001_CART; class neogeo_cmc_kof2000n_cart : public neogeo_cmc_cart { public: - neogeo_cmc_kof2000n_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_kof2000n_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 2; } }; @@ -188,7 +188,7 @@ extern const device_type NEOGEO_CMC_KOF2000N_CART; class neogeo_cmc_jockeygp_cart : public neogeo_cmc_cart { public: - neogeo_cmc_jockeygp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_cmc_jockeygp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } @@ -199,7 +199,7 @@ public: virtual void device_reset() override; private: - UINT16 m_ram[0x1000]; + uint16_t m_ram[0x1000]; }; extern const device_type NEOGEO_CMC_JOCKEYGP_CART; diff --git a/src/devices/bus/neogeo/fatfury2.cpp b/src/devices/bus/neogeo/fatfury2.cpp index 3236e2f7574..64a2f44c6b1 100644 --- a/src/devices/bus/neogeo/fatfury2.cpp +++ b/src/devices/bus/neogeo/fatfury2.cpp @@ -19,7 +19,7 @@ const device_type NEOGEO_FATFURY2_CART = &device_creator; -neogeo_fatfury2_cart::neogeo_fatfury2_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_fatfury2_cart::neogeo_fatfury2_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_FATFURY2_CART, "Neo Geo Fatal Fury 2 Cart", tag, owner, clock, "neocart_fatfury2", __FILE__), m_prot(*this, "fatfury2_prot") {} diff --git a/src/devices/bus/neogeo/fatfury2.h b/src/devices/bus/neogeo/fatfury2.h index 4870708ca0a..5579fe2b0bb 100644 --- a/src/devices/bus/neogeo/fatfury2.h +++ b/src/devices/bus/neogeo/fatfury2.h @@ -13,7 +13,7 @@ class neogeo_fatfury2_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_fatfury2_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_fatfury2_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/neogeo/kof2k2.cpp b/src/devices/bus/neogeo/kof2k2.cpp index ac8235c471f..8848e7e68e0 100644 --- a/src/devices/bus/neogeo/kof2k2.cpp +++ b/src/devices/bus/neogeo/kof2k2.cpp @@ -19,14 +19,14 @@ const device_type NEOGEO_K2K2_CART = &device_creator; -neogeo_kof2k2type_cart::neogeo_kof2k2type_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source) : +neogeo_kof2k2type_cart::neogeo_kof2k2type_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source) : neogeo_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot"), m_kof2k2_prot(*this, "kof2002_prot") {} -neogeo_kof2k2type_cart::neogeo_kof2k2type_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_kof2k2type_cart::neogeo_kof2k2type_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_K2K2_CART, "Neo Geo KOF2002-Type Cart", tag, owner, clock, "neocart_k2k2", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot"), @@ -69,7 +69,7 @@ machine_config_constructor neogeo_kof2k2type_cart::device_mconfig_additions() co const device_type NEOGEO_K2K2_KOF2002_CART = &device_creator; -neogeo_kof2002_cart::neogeo_kof2002_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kof2002_cart::neogeo_kof2002_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_kof2k2type_cart(mconfig, NEOGEO_K2K2_KOF2002_CART, "Neo Geo KOF2002 Cart", tag, owner, clock, "neocart_kof2002", __FILE__) {} @@ -89,7 +89,7 @@ const device_type NEOGEO_K2K2_KF2K2PLS_CART = &device_creator; -neogeo_matrim_cart::neogeo_matrim_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_matrim_cart::neogeo_matrim_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_kof2k2type_cart(mconfig, NEOGEO_K2K2_MATRIM_CART, "Neo Geo Matrimelee Cart", tag, owner, clock, "neocart_matrim", __FILE__) {} @@ -127,7 +127,7 @@ void neogeo_matrim_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_K2K2_SAMSHO5_CART = &device_creator; -neogeo_samsho5_cart::neogeo_samsho5_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_samsho5_cart::neogeo_samsho5_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_kof2k2type_cart(mconfig, NEOGEO_K2K2_SAMSHO5_CART, "Neo Geo Samurai Shodown 5 Cart", tag, owner, clock, "neocart_samsho5", __FILE__) {} @@ -146,7 +146,7 @@ void neogeo_samsho5_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_K2K2_SAMSHO5SP_CART = &device_creator; -neogeo_samsho5sp_cart::neogeo_samsho5sp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_samsho5sp_cart::neogeo_samsho5sp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_kof2k2type_cart(mconfig, NEOGEO_K2K2_SAMSHO5SP_CART, "Neo Geo Samurai Shodown 5 Special Cart", tag, owner, clock, "neocart_samsh5sp", __FILE__) {} diff --git a/src/devices/bus/neogeo/kof2k2.h b/src/devices/bus/neogeo/kof2k2.h index d1939db17c3..067ffcd38f9 100644 --- a/src/devices/bus/neogeo/kof2k2.h +++ b/src/devices/bus/neogeo/kof2k2.h @@ -15,8 +15,8 @@ class neogeo_kof2k2type_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_kof2k2type_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source); - neogeo_kof2k2type_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_kof2k2type_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source); + neogeo_kof2k2type_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; @@ -46,7 +46,7 @@ extern const device_type NEOGEO_K2K2_CART; class neogeo_kof2002_cart : public neogeo_kof2k2type_cart { public: - neogeo_kof2002_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kof2002_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -58,7 +58,7 @@ extern const device_type NEOGEO_K2K2_KOF2002_CART; class neogeo_kf2k2pls_cart : public neogeo_kof2k2type_cart { public: - neogeo_kf2k2pls_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kf2k2pls_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -73,7 +73,7 @@ extern const device_type NEOGEO_K2K2_KF2K2PLS_CART; class neogeo_matrim_cart : public neogeo_kof2k2type_cart { public: - neogeo_matrim_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_matrim_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 2; } }; @@ -88,7 +88,7 @@ extern const device_type NEOGEO_K2K2_MATRIM_CART; class neogeo_samsho5_cart : public neogeo_kof2k2type_cart { public: - neogeo_samsho5_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_samsho5_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -103,7 +103,7 @@ extern const device_type NEOGEO_K2K2_SAMSHO5_CART; class neogeo_samsho5sp_cart : public neogeo_kof2k2type_cart { public: - neogeo_samsho5sp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_samsho5sp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; diff --git a/src/devices/bus/neogeo/kof98.cpp b/src/devices/bus/neogeo/kof98.cpp index 38bd2445d96..1f7c5559ae0 100644 --- a/src/devices/bus/neogeo/kof98.cpp +++ b/src/devices/bus/neogeo/kof98.cpp @@ -19,7 +19,7 @@ const device_type NEOGEO_KOF98_CART = &device_creator; -neogeo_kof98_cart::neogeo_kof98_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_kof98_cart::neogeo_kof98_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_KOF98_CART, "Neo Geo KOF 98 Cart", tag, owner, clock, "neocart_kof98", __FILE__), m_prot(*this, "kof98_prot") {} diff --git a/src/devices/bus/neogeo/kof98.h b/src/devices/bus/neogeo/kof98.h index 2d51c77d9b3..fba3e40ff38 100644 --- a/src/devices/bus/neogeo/kof98.h +++ b/src/devices/bus/neogeo/kof98.h @@ -13,7 +13,7 @@ class neogeo_kof98_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_kof98_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_kof98_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/neogeo/mslugx.cpp b/src/devices/bus/neogeo/mslugx.cpp index b3b83fae1f7..85dcab3ddc9 100644 --- a/src/devices/bus/neogeo/mslugx.cpp +++ b/src/devices/bus/neogeo/mslugx.cpp @@ -19,7 +19,7 @@ const device_type NEOGEO_MSLUGX_CART = &device_creator; -neogeo_mslugx_cart::neogeo_mslugx_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_mslugx_cart::neogeo_mslugx_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_MSLUGX_CART, "Neo Geo Metal Slug X Cart", tag, owner, clock, "neocart_mslugx", __FILE__), m_prot(*this, "mslugx_prot") {} diff --git a/src/devices/bus/neogeo/mslugx.h b/src/devices/bus/neogeo/mslugx.h index bdde18f6972..20a144917d9 100644 --- a/src/devices/bus/neogeo/mslugx.h +++ b/src/devices/bus/neogeo/mslugx.h @@ -13,7 +13,7 @@ class neogeo_mslugx_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_mslugx_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_mslugx_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/neogeo/pcm2.cpp b/src/devices/bus/neogeo/pcm2.cpp index a83cd966cb8..e49ebd06261 100644 --- a/src/devices/bus/neogeo/pcm2.cpp +++ b/src/devices/bus/neogeo/pcm2.cpp @@ -19,13 +19,13 @@ const device_type NEOGEO_PCM2_CART = &device_creator; -neogeo_pcm2_cart::neogeo_pcm2_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source) : +neogeo_pcm2_cart::neogeo_pcm2_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source) : neogeo_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot") {} -neogeo_pcm2_cart::neogeo_pcm2_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_pcm2_cart::neogeo_pcm2_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_PCM2_CART, "Neo Geo PCM2 Cart", tag, owner, clock, "neocart_pcm2", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot") @@ -66,7 +66,7 @@ machine_config_constructor neogeo_pcm2_cart::device_mconfig_additions() const const device_type NEOGEO_PCM2_MSLUG4_CART = &device_creator; -neogeo_pcm2_mslug4_cart::neogeo_pcm2_mslug4_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_pcm2_mslug4_cart::neogeo_pcm2_mslug4_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_pcm2_cart(mconfig, NEOGEO_PCM2_MSLUG4_CART, "Neo Geo Metal Slug 4 PCM2 Cart", tag, owner, clock, "neocart_mslug4", __FILE__) {} @@ -85,7 +85,7 @@ void neogeo_pcm2_mslug4_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_PCM2_MS4PLUS_CART = &device_creator; -neogeo_pcm2_ms4plus_cart::neogeo_pcm2_ms4plus_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_pcm2_ms4plus_cart::neogeo_pcm2_ms4plus_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_pcm2_cart(mconfig, NEOGEO_PCM2_MS4PLUS_CART, "Neo Geo Metal Slug 4 Plus PCM2 Cart", tag, owner, clock, "neocart_ms4plus", __FILE__) {} @@ -103,7 +103,7 @@ void neogeo_pcm2_ms4plus_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_PCM2_ROTD_CART = &device_creator; -neogeo_pcm2_rotd_cart::neogeo_pcm2_rotd_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_pcm2_rotd_cart::neogeo_pcm2_rotd_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_pcm2_cart(mconfig, NEOGEO_PCM2_ROTD_CART, "Neo Geo Rage of the Dragon PCM2 Cart", tag, owner, clock, "neocart_rotd", __FILE__) {} @@ -121,7 +121,7 @@ void neogeo_pcm2_rotd_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_PCM2_PNYAA_CART = &device_creator; -neogeo_pcm2_pnyaa_cart::neogeo_pcm2_pnyaa_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_pcm2_pnyaa_cart::neogeo_pcm2_pnyaa_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_pcm2_cart(mconfig, NEOGEO_PCM2_PNYAA_CART, "Neo Geo Pnyaa PCM2 Cart", tag, owner, clock, "neocart_pnyaa", __FILE__) {} diff --git a/src/devices/bus/neogeo/pcm2.h b/src/devices/bus/neogeo/pcm2.h index fff3408eae3..30d5d627842 100644 --- a/src/devices/bus/neogeo/pcm2.h +++ b/src/devices/bus/neogeo/pcm2.h @@ -14,8 +14,8 @@ class neogeo_pcm2_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_pcm2_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source); - neogeo_pcm2_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_pcm2_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source); + neogeo_pcm2_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; @@ -44,7 +44,7 @@ extern const device_type NEOGEO_PCM2_CART; class neogeo_pcm2_mslug4_cart : public neogeo_pcm2_cart { public: - neogeo_pcm2_mslug4_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_pcm2_mslug4_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -59,7 +59,7 @@ extern const device_type NEOGEO_PCM2_MSLUG4_CART; class neogeo_pcm2_ms4plus_cart : public neogeo_pcm2_cart { public: - neogeo_pcm2_ms4plus_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_pcm2_ms4plus_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } }; @@ -74,7 +74,7 @@ extern const device_type NEOGEO_PCM2_MS4PLUS_CART; class neogeo_pcm2_rotd_cart : public neogeo_pcm2_cart { public: - neogeo_pcm2_rotd_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_pcm2_rotd_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -89,7 +89,7 @@ extern const device_type NEOGEO_PCM2_ROTD_CART; class neogeo_pcm2_pnyaa_cart : public neogeo_pcm2_cart { public: - neogeo_pcm2_pnyaa_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_pcm2_pnyaa_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; diff --git a/src/devices/bus/neogeo/prot_cmc.cpp b/src/devices/bus/neogeo/prot_cmc.cpp index 41aabd2447f..a08f9ede36b 100644 --- a/src/devices/bus/neogeo/prot_cmc.cpp +++ b/src/devices/bus/neogeo/prot_cmc.cpp @@ -7,7 +7,7 @@ extern const device_type CMC_PROT = &device_creator; -cmc_prot_device::cmc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cmc_prot_device::cmc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CMC_PROT, "Neo Geo CMC42 & CMC50 Protection", tag, owner, clock, "cmc_prot", __FILE__), type0_t03(nullptr), type0_t12(nullptr), @@ -89,7 +89,7 @@ analyzed, quickly leading to the algorithm. ***************************************************************************/ -static const UINT8 kof99_type0_t03[256] = +static const uint8_t kof99_type0_t03[256] = { 0xfb, 0x86, 0x9d, 0xf1, 0xbf, 0x80, 0xd5, 0x43, 0xab, 0xb3, 0x9f, 0x6a, 0x33, 0xd9, 0xdb, 0xb6, 0x66, 0x08, 0x69, 0x88, 0xcc, 0xb7, 0xde, 0x49, 0x97, 0x64, 0x1f, 0xa6, 0xc0, 0x2f, 0x52, 0x42, @@ -110,7 +110,7 @@ static const UINT8 kof99_type0_t03[256] = }; -static const UINT8 kof99_type0_t12[256] = +static const uint8_t kof99_type0_t12[256] = { 0x1f, 0xac, 0x4d, 0xcd, 0xca, 0x70, 0x02, 0x6b, 0x18, 0x40, 0x62, 0xb2, 0x3f, 0x9b, 0x5b, 0xef, 0x69, 0x68, 0x71, 0x3b, 0xcb, 0xd4, 0x30, 0xbc, 0x47, 0x72, 0x74, 0x5e, 0x84, 0x4c, 0x1b, 0xdb, @@ -131,7 +131,7 @@ static const UINT8 kof99_type0_t12[256] = }; -static const UINT8 kof99_type1_t03[256] = +static const uint8_t kof99_type1_t03[256] = { 0xa9, 0x17, 0xaf, 0x0d, 0x34, 0x6e, 0x53, 0xb6, 0x7f, 0x58, 0xe9, 0x14, 0x5f, 0x55, 0xdb, 0xd4, 0x42, 0x80, 0x99, 0x59, 0xa8, 0x3a, 0x57, 0x5d, 0xd5, 0x6f, 0x4c, 0x68, 0x35, 0x46, 0xa6, 0xe7, @@ -152,7 +152,7 @@ static const UINT8 kof99_type1_t03[256] = }; -static const UINT8 kof99_type1_t12[256] = +static const uint8_t kof99_type1_t12[256] = { 0xea, 0xe6, 0x5e, 0xa7, 0x8e, 0xac, 0x34, 0x03, 0x30, 0x97, 0x52, 0x53, 0x76, 0xf2, 0x62, 0x0b, 0x0a, 0xfc, 0x94, 0xb8, 0x67, 0x36, 0x11, 0xbc, 0xae, 0xca, 0xfa, 0x15, 0x04, 0x2b, 0x17, 0xc4, @@ -175,7 +175,7 @@ static const UINT8 kof99_type1_t12[256] = /* underlined values are wrong (not enough evidence, FF fill in kof99 and garou) */ /* they correspond to tiles 7d000-7efff */ -static const UINT8 kof99_address_8_15_xor1[256] = +static const uint8_t kof99_address_8_15_xor1[256] = { 0x00, 0xb1, 0x1e, 0xc5, 0x3d, 0x40, 0x45, 0x5e, 0xf2, 0xf8, 0x04, 0x63, 0x36, 0x87, 0x88, 0xbf, 0xab, 0xcc, 0x78, 0x08, 0xdd, 0x20, 0xd4, 0x35, 0x09, 0x8e, 0x44, 0xae, 0x33, 0xa9, 0x9e, 0xcd, @@ -197,7 +197,7 @@ static const UINT8 kof99_address_8_15_xor1[256] = }; -static const UINT8 kof99_address_8_15_xor2[256] = +static const uint8_t kof99_address_8_15_xor2[256] = { 0x9b, 0x9d, 0xc1, 0x3d, 0xa9, 0xb8, 0xf4, 0x6f, 0xf6, 0x25, 0xc7, 0x47, 0xd5, 0x97, 0xdf, 0x6b, 0xeb, 0x90, 0xa4, 0xb2, 0x5d, 0xf5, 0x66, 0xb0, 0xb9, 0x8b, 0x93, 0x64, 0xec, 0x7b, 0x65, 0x8c, @@ -218,7 +218,7 @@ static const UINT8 kof99_address_8_15_xor2[256] = }; -static const UINT8 kof99_address_16_23_xor1[256] = +static const uint8_t kof99_address_16_23_xor1[256] = { 0x00, 0x5f, 0x03, 0x52, 0xce, 0xe3, 0x7d, 0x8f, 0x6b, 0xf8, 0x20, 0xde, 0x7b, 0x7e, 0x39, 0xbe, 0xf5, 0x94, 0x18, 0x78, 0x80, 0xc9, 0x7f, 0x7a, 0x3e, 0x63, 0xf2, 0xe0, 0x4e, 0xf7, 0x87, 0x27, @@ -239,7 +239,7 @@ static const UINT8 kof99_address_16_23_xor1[256] = }; -static const UINT8 kof99_address_16_23_xor2[256] = +static const uint8_t kof99_address_16_23_xor2[256] = { 0x29, 0x97, 0x1a, 0x2c, 0x0b, 0x94, 0x3e, 0x75, 0x01, 0x0d, 0x1b, 0xe1, 0x4d, 0x38, 0x39, 0x8f, 0xe7, 0xd0, 0x60, 0x90, 0xb2, 0x0f, 0xbb, 0x70, 0x1f, 0xe6, 0x5b, 0x87, 0xb4, 0x43, 0xfd, 0xf5, @@ -260,7 +260,7 @@ static const UINT8 kof99_address_16_23_xor2[256] = }; -static const UINT8 kof99_address_0_7_xor[256] = +static const uint8_t kof99_address_0_7_xor[256] = { 0x74, 0xad, 0x5d, 0x1d, 0x9e, 0xc3, 0xfa, 0x4e, 0xf7, 0xdb, 0xca, 0xa2, 0x64, 0x36, 0x56, 0x0c, 0x4f, 0xcf, 0x43, 0x66, 0x1e, 0x91, 0xe3, 0xa5, 0x58, 0xc2, 0xc1, 0xd4, 0xb9, 0xdd, 0x76, 0x16, @@ -281,7 +281,7 @@ static const UINT8 kof99_address_0_7_xor[256] = }; -static const UINT8 kof2000_type0_t03[256] = +static const uint8_t kof2000_type0_t03[256] = { 0x10, 0x61, 0xf1, 0x78, 0x85, 0x52, 0x68, 0xe3, 0x12, 0x0d, 0xfa, 0xf0, 0xc9, 0x36, 0x5e, 0x3d, 0xf9, 0xa6, 0x01, 0x2e, 0xc7, 0x84, 0xea, 0x2b, 0x6d, 0x14, 0x38, 0x4f, 0x55, 0x1c, 0x9d, 0xa7, @@ -302,7 +302,7 @@ static const UINT8 kof2000_type0_t03[256] = }; -static const UINT8 kof2000_type0_t12[256] = +static const uint8_t kof2000_type0_t12[256] = { 0xf4, 0x28, 0xb4, 0x8f, 0xfa, 0xeb, 0x8e, 0x54, 0x2b, 0x49, 0xd1, 0x76, 0x71, 0x47, 0x8b, 0x57, 0x92, 0x85, 0x7c, 0xb8, 0x5c, 0x22, 0xf9, 0x26, 0xbc, 0x5b, 0x6d, 0x67, 0xae, 0x5f, 0x6f, 0xf5, @@ -323,7 +323,7 @@ static const UINT8 kof2000_type0_t12[256] = }; -static const UINT8 kof2000_type1_t03[256] = +static const uint8_t kof2000_type1_t03[256] = { 0x9a, 0x2f, 0xcc, 0x4e, 0x40, 0x69, 0xac, 0xca, 0xa5, 0x7b, 0x0a, 0x61, 0x91, 0x0d, 0x55, 0x74, 0xcd, 0x8b, 0x0b, 0x80, 0x09, 0x5e, 0x38, 0xc7, 0xda, 0xbf, 0xf5, 0x37, 0x23, 0x31, 0x33, 0xe9, @@ -344,7 +344,7 @@ static const UINT8 kof2000_type1_t03[256] = }; -static const UINT8 kof2000_type1_t12[256] = +static const uint8_t kof2000_type1_t12[256] = { 0xda, 0xa7, 0xd6, 0x6e, 0x2f, 0x5e, 0xf0, 0x3f, 0xa4, 0xce, 0xd3, 0xfd, 0x46, 0x2a, 0xac, 0xc9, 0xbe, 0xeb, 0x9f, 0xd5, 0x3c, 0x61, 0x96, 0x11, 0xd0, 0x38, 0xca, 0x06, 0xed, 0x1b, 0x65, 0xe7, @@ -365,7 +365,7 @@ static const UINT8 kof2000_type1_t12[256] = }; -static const UINT8 kof2000_address_8_15_xor1[256] = +static const uint8_t kof2000_address_8_15_xor1[256] = { 0xfc, 0x9b, 0x1c, 0x35, 0x72, 0x53, 0xd6, 0x7d, 0x84, 0xa4, 0xc5, 0x93, 0x7b, 0xe7, 0x47, 0xd5, 0x24, 0xa2, 0xfa, 0x19, 0x0c, 0xb1, 0x8c, 0xb9, 0x9d, 0xd8, 0x59, 0x4f, 0x3c, 0xb2, 0x78, 0x4a, @@ -386,7 +386,7 @@ static const UINT8 kof2000_address_8_15_xor1[256] = }; -static const UINT8 kof2000_address_8_15_xor2[256] = +static const uint8_t kof2000_address_8_15_xor2[256] = { 0x00, 0xbe, 0x06, 0x5a, 0xfa, 0x42, 0x15, 0xf2, 0x3f, 0x0a, 0x84, 0x93, 0x4e, 0x78, 0x3b, 0x89, 0x32, 0x98, 0xa2, 0x87, 0x73, 0xdd, 0x26, 0xe5, 0x05, 0x71, 0x08, 0x6e, 0x9b, 0xe0, 0xdf, 0x9e, @@ -407,7 +407,7 @@ static const UINT8 kof2000_address_8_15_xor2[256] = }; -static const UINT8 kof2000_address_16_23_xor1[256] = +static const uint8_t kof2000_address_16_23_xor1[256] = { 0x45, 0x9f, 0x6e, 0x2f, 0x28, 0xbc, 0x5e, 0x6d, 0xda, 0xb5, 0x0d, 0xb8, 0xc0, 0x8e, 0xa2, 0x32, 0xee, 0xcd, 0x8d, 0x48, 0x8c, 0x27, 0x14, 0xeb, 0x65, 0xd7, 0xf2, 0x93, 0x99, 0x90, 0x91, 0xfc, @@ -428,7 +428,7 @@ static const UINT8 kof2000_address_16_23_xor1[256] = }; -static const UINT8 kof2000_address_16_23_xor2[256] = +static const uint8_t kof2000_address_16_23_xor2[256] = { 0x00, 0xb8, 0xf0, 0x34, 0xca, 0x21, 0x3c, 0xf9, 0x01, 0x8e, 0x75, 0x70, 0xec, 0x13, 0x27, 0x96, 0xf4, 0x5b, 0x88, 0x1f, 0xeb, 0x4a, 0x7d, 0x9d, 0xbe, 0x02, 0x14, 0xaf, 0xa2, 0x06, 0xc6, 0xdb, @@ -449,7 +449,7 @@ static const UINT8 kof2000_address_16_23_xor2[256] = }; -static const UINT8 kof2000_address_0_7_xor[256] = +static const uint8_t kof2000_address_0_7_xor[256] = { 0x26, 0x48, 0x06, 0x9b, 0x21, 0xa9, 0x1b, 0x76, 0xc9, 0xf8, 0xb4, 0x67, 0xe4, 0xff, 0x99, 0xf7, 0x15, 0x9e, 0x62, 0x00, 0x72, 0x4d, 0xa0, 0x4f, 0x02, 0xf1, 0xea, 0xef, 0x0b, 0xf3, 0xeb, 0xa6, @@ -471,15 +471,15 @@ static const UINT8 kof2000_address_0_7_xor[256] = -void cmc_prot_device::decrypt(UINT8 *r0, UINT8 *r1, - UINT8 c0, UINT8 c1, - const UINT8 *table0hi, - const UINT8 *table0lo, - const UINT8 *table1, +void cmc_prot_device::decrypt(uint8_t *r0, uint8_t *r1, + uint8_t c0, uint8_t c1, + const uint8_t *table0hi, + const uint8_t *table0lo, + const uint8_t *table1, int base, int invert) { - UINT8 tmp, xor0, xor1; + uint8_t tmp, xor0, xor1; tmp = table1[(base & 0xff) ^ address_0_7_xor[(base >> 8) & 0xff]]; xor0 = (table0hi[(base >> 8) & 0xff] & 0xfe) | (tmp & 0x01); @@ -498,10 +498,10 @@ void cmc_prot_device::decrypt(UINT8 *r0, UINT8 *r1, } -void cmc_prot_device::gfx_decrypt(UINT8* rom, UINT32 rom_size, int extra_xor) +void cmc_prot_device::gfx_decrypt(uint8_t* rom, uint32_t rom_size, int extra_xor) { int rpos; - std::vector buf(rom_size); + std::vector buf(rom_size); // Data xor for (rpos = 0; rpos < rom_size/4; rpos++) @@ -552,7 +552,7 @@ void cmc_prot_device::gfx_decrypt(UINT8* rom, UINT32 rom_size, int extra_xor) /* CMC42 protection chip */ -void cmc_prot_device::cmc42_gfx_decrypt(UINT8* rom, UINT32 rom_size, int extra_xor) +void cmc_prot_device::cmc42_gfx_decrypt(uint8_t* rom, uint32_t rom_size, int extra_xor) { type0_t03 = kof99_type0_t03; type0_t12 = kof99_type0_t12; @@ -567,7 +567,7 @@ void cmc_prot_device::cmc42_gfx_decrypt(UINT8* rom, UINT32 rom_size, int extra_x } // REMOVE ME!!!! -void cmc_prot_device::kof99_neogeo_gfx_decrypt(UINT8* rom, UINT32 rom_size, UINT8* fixed, UINT32 fixed_size, int extra_xor) +void cmc_prot_device::kof99_neogeo_gfx_decrypt(uint8_t* rom, uint32_t rom_size, uint8_t* fixed, uint32_t fixed_size, int extra_xor) { cmc42_gfx_decrypt(rom, rom_size, extra_xor); sfix_decrypt(rom, rom_size, fixed, fixed_size); @@ -575,7 +575,7 @@ void cmc_prot_device::kof99_neogeo_gfx_decrypt(UINT8* rom, UINT32 rom_size, UINT /* CMC50 protection chip */ -void cmc_prot_device::cmc50_gfx_decrypt(UINT8* rom, UINT32 rom_size, int extra_xor) +void cmc_prot_device::cmc50_gfx_decrypt(uint8_t* rom, uint32_t rom_size, int extra_xor) { type0_t03 = kof2000_type0_t03; type0_t12 = kof2000_type0_t12; @@ -592,7 +592,7 @@ void cmc_prot_device::cmc50_gfx_decrypt(UINT8* rom, UINT32 rom_size, int extra_x // REMOVE ME!!!! -void cmc_prot_device::kof2000_neogeo_gfx_decrypt(UINT8* rom, UINT32 rom_size, UINT8* fixed, UINT32 fixed_size, int extra_xor) +void cmc_prot_device::kof2000_neogeo_gfx_decrypt(uint8_t* rom, uint32_t rom_size, uint8_t* fixed, uint32_t fixed_size, int extra_xor) { cmc50_gfx_decrypt(rom, rom_size, extra_xor); sfix_decrypt(rom, rom_size, fixed, fixed_size); @@ -601,11 +601,11 @@ void cmc_prot_device::kof2000_neogeo_gfx_decrypt(UINT8* rom, UINT32 rom_size, UI /* the S data comes from the end of the C data */ -void cmc_prot_device::sfix_decrypt(UINT8* rom, UINT32 rom_size, UINT8* fixed, UINT32 fixed_size) +void cmc_prot_device::sfix_decrypt(uint8_t* rom, uint32_t rom_size, uint8_t* fixed, uint32_t fixed_size) { int tx_size = fixed_size; - UINT8 *src = rom + rom_size - tx_size; - UINT8 *dst = fixed; + uint8_t *src = rom + rom_size - tx_size; + uint8_t *dst = fixed; for (int i = 0; i < tx_size; i++) dst[i] = src[(i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)]; @@ -620,7 +620,7 @@ NeoGeo 'M' ROM encryption ***************************************************************************/ -static const UINT8 m1_address_8_15_xor[256] = +static const uint8_t m1_address_8_15_xor[256] = { 0x0a, 0x72, 0xb7, 0xaf, 0x67, 0xde, 0x1d, 0xb1, 0x78, 0xc4, 0x4f, 0xb5, 0x4b, 0x18, 0x76, 0xdd, 0x11, 0xe2, 0x36, 0xa1, 0x82, 0x03, 0x98, 0xa0, 0x10, 0x5f, 0x3f, 0xd6, 0x1f, 0x90, 0x6a, 0x0b, @@ -640,7 +640,7 @@ static const UINT8 m1_address_8_15_xor[256] = 0x7d, 0x1a, 0x02, 0x65, 0x54, 0x5e, 0x19, 0xcc, 0xdc, 0xdb, 0x73, 0xed, 0xad, 0x59, 0x2f, 0xa3, }; -static const UINT8 m1_address_0_7_xor[256] = +static const uint8_t m1_address_0_7_xor[256] = { 0xf4, 0xbc, 0x02, 0xf7, 0x2c, 0x3d, 0xe8, 0xd9, 0x50, 0x62, 0xec, 0xbd, 0x53, 0x73, 0x79, 0x61, 0x00, 0x34, 0xcf, 0xa2, 0x63, 0x28, 0x90, 0xaf, 0x44, 0x3b, 0xc5, 0x8d, 0x3a, 0x46, 0x07, 0x70, @@ -663,9 +663,9 @@ static const UINT8 m1_address_0_7_xor[256] = /* The CMC50 hardware does a checksum of the first 64kb of the M1 rom, and uses this checksum as the basis of the key with which to decrypt the rom */ -UINT16 cmc_prot_device::generate_cs16(UINT8 *rom, int size) +uint16_t cmc_prot_device::generate_cs16(uint8_t *rom, int size) { - UINT16 cs16 = 0x0000; + uint16_t cs16 = 0x0000; for (int i = 0; i < size; i++) cs16 += rom[i]; @@ -673,7 +673,7 @@ UINT16 cmc_prot_device::generate_cs16(UINT8 *rom, int size) } -int cmc_prot_device::m1_address_scramble(int address, UINT16 key) +int cmc_prot_device::m1_address_scramble(int address, uint16_t key) { const int p1[8][16] = { {15,14,10,7,1,2,3,8,0,12,11,13,6,9,5,4}, @@ -703,19 +703,19 @@ int cmc_prot_device::m1_address_scramble(int address, UINT16 key) } -void cmc_prot_device::cmc50_m1_decrypt(UINT8* romcrypt, UINT32 romcrypt_size, UINT8* romaudio, UINT32 romaudio_size) +void cmc_prot_device::cmc50_m1_decrypt(uint8_t* romcrypt, uint32_t romcrypt_size, uint8_t* romaudio, uint32_t romaudio_size) { - UINT8* rom = romcrypt; + uint8_t* rom = romcrypt; size_t rom_size = 0x80000; - UINT8* rom2 = romaudio; + uint8_t* rom2 = romaudio; - std::vector buffer(rom_size); + std::vector buffer(rom_size); - UINT16 key = generate_cs16(rom, 0x10000); + uint16_t key = generate_cs16(rom, 0x10000); //printf("key %04x\n",key); - for (UINT32 i = 0; i < rom_size; i++) + for (uint32_t i = 0; i < rom_size; i++) buffer[i] = rom[m1_address_scramble(i,key)]; memcpy(rom, &buffer[0], rom_size); diff --git a/src/devices/bus/neogeo/prot_cmc.h b/src/devices/bus/neogeo/prot_cmc.h index 2b5a8e36b07..31e4262f70d 100644 --- a/src/devices/bus/neogeo/prot_cmc.h +++ b/src/devices/bus/neogeo/prot_cmc.h @@ -44,41 +44,41 @@ class cmc_prot_device : public device_t { public: // construction/destruction - cmc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cmc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void decrypt(UINT8 *r0, UINT8 *r1, - UINT8 c0, UINT8 c1, - const UINT8 *table0hi, - const UINT8 *table0lo, - const UINT8 *table1, + void decrypt(uint8_t *r0, uint8_t *r1, + uint8_t c0, uint8_t c1, + const uint8_t *table0hi, + const uint8_t *table0lo, + const uint8_t *table1, int base, int invert); - void gfx_decrypt(UINT8* rom, UINT32 rom_size, int extra_xor); - void kof99_neogeo_gfx_decrypt(UINT8* rom, UINT32 rom_size, UINT8* fixed, UINT32 fixed_size, int extra_xor); - void kof2000_neogeo_gfx_decrypt(UINT8* rom, UINT32 rom_size, UINT8* fixed, UINT32 fixed_size, int extra_xor); - void cmc42_gfx_decrypt(UINT8* rom, UINT32 rom_size, int extra_xor); - void cmc50_gfx_decrypt(UINT8* rom, UINT32 rom_size, int extra_xor); + void gfx_decrypt(uint8_t* rom, uint32_t rom_size, int extra_xor); + void kof99_neogeo_gfx_decrypt(uint8_t* rom, uint32_t rom_size, uint8_t* fixed, uint32_t fixed_size, int extra_xor); + void kof2000_neogeo_gfx_decrypt(uint8_t* rom, uint32_t rom_size, uint8_t* fixed, uint32_t fixed_size, int extra_xor); + void cmc42_gfx_decrypt(uint8_t* rom, uint32_t rom_size, int extra_xor); + void cmc50_gfx_decrypt(uint8_t* rom, uint32_t rom_size, int extra_xor); - void sfix_decrypt(UINT8* rom, UINT32 rom_size, UINT8* fixed, UINT32 fixed_size); + void sfix_decrypt(uint8_t* rom, uint32_t rom_size, uint8_t* fixed, uint32_t fixed_size); - UINT16 generate_cs16(UINT8 *rom, int size); - int m1_address_scramble(int address, UINT16 key); - void cmc50_m1_decrypt(UINT8* romcrypt, UINT32 romcrypt_size, UINT8* romaudio, UINT32 romaudio_size); + uint16_t generate_cs16(uint8_t *rom, int size); + int m1_address_scramble(int address, uint16_t key); + void cmc50_m1_decrypt(uint8_t* romcrypt, uint32_t romcrypt_size, uint8_t* romaudio, uint32_t romaudio_size); protected: virtual void device_start() override; virtual void device_reset() override; - const UINT8 *type0_t03; - const UINT8 *type0_t12; - const UINT8 *type1_t03; - const UINT8 *type1_t12; - const UINT8 *address_8_15_xor1; - const UINT8 *address_8_15_xor2; - const UINT8 *address_16_23_xor1; - const UINT8 *address_16_23_xor2; - const UINT8 *address_0_7_xor; + const uint8_t *type0_t03; + const uint8_t *type0_t12; + const uint8_t *type1_t03; + const uint8_t *type1_t12; + const uint8_t *address_8_15_xor1; + const uint8_t *address_8_15_xor2; + const uint8_t *address_16_23_xor1; + const uint8_t *address_16_23_xor2; + const uint8_t *address_0_7_xor; }; #endif diff --git a/src/devices/bus/neogeo/prot_cthd.cpp b/src/devices/bus/neogeo/prot_cthd.cpp index a6ccee1a56d..f94993d1228 100644 --- a/src/devices/bus/neogeo/prot_cthd.cpp +++ b/src/devices/bus/neogeo/prot_cthd.cpp @@ -7,7 +7,7 @@ extern const device_type CTHD_PROT = &device_creator; -cthd_prot_device::cthd_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cthd_prot_device::cthd_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CTHD_PROT, "Neo Geo CTHD Protection (Bootleg)", tag, owner, clock, "cthd_prot", __FILE__) {} @@ -31,12 +31,12 @@ void cthd_prot_device::device_reset() **************************/ // descrambling information from razoola -void cthd_prot_device::fix_do(UINT8* sprrom, UINT32 sprrom_size, int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift) +void cthd_prot_device::fix_do(uint8_t* sprrom, uint32_t sprrom_size, int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift) { int tilesize = 128; - std::vector rom(16 * tilesize); // 16 tiles buffer - UINT8* realrom = sprrom + start * tilesize; + std::vector rom(16 * tilesize); // 16 tiles buffer + uint8_t* realrom = sprrom + start * tilesize; for (int i = 0; i < (end-start)/16; i++) { @@ -53,7 +53,7 @@ void cthd_prot_device::fix_do(UINT8* sprrom, UINT32 sprrom_size, int start, int } } -void cthd_prot_device::gfx_address_fix(UINT8* sprrom, UINT32 sprrom_size, int start, int end) +void cthd_prot_device::gfx_address_fix(uint8_t* sprrom, uint32_t sprrom_size, int start, int end) { fix_do(sprrom, sprrom_size, start + 512 * 0, end + 512 * 0, 0,3,2,1); fix_do(sprrom, sprrom_size, start + 512 * 1, end + 512 * 1, 1,0,3,2); @@ -64,7 +64,7 @@ void cthd_prot_device::gfx_address_fix(UINT8* sprrom, UINT32 sprrom_size, int st fix_do(sprrom, sprrom_size, start + 512 * 7, end + 512 * 7, 0,2,3,1); } -void cthd_prot_device::cthd2003_c(UINT8* sprrom, UINT32 sprrom_size, int pow) +void cthd_prot_device::cthd2003_c(uint8_t* sprrom, uint32_t sprrom_size, int pow) { for (int i = 0; i <= 192; i += 8) gfx_address_fix(sprrom, sprrom_size, i * 512, i * 512 + 512); @@ -91,10 +91,10 @@ void cthd_prot_device::cthd2003_c(UINT8* sprrom, UINT32 sprrom_size, int pow) **************************/ -void cthd_prot_device::decrypt_cthd2003(UINT8* sprrom, UINT32 sprrom_size, UINT8* audiorom, UINT32 audiorom_size, UINT8* fixedrom, UINT32 fixedrom_size) +void cthd_prot_device::decrypt_cthd2003(uint8_t* sprrom, uint32_t sprrom_size, uint8_t* audiorom, uint32_t audiorom_size, uint8_t* fixedrom, uint32_t fixedrom_size) { - UINT8 *romdata = fixedrom; - std::vector tmp(8 * 128 * 128); + uint8_t *romdata = fixedrom; + std::vector tmp(8 * 128 * 128); memcpy(&tmp[8 * 0 * 128], romdata + 8 * 0 * 128, 8 * 32 * 128); memcpy(&tmp[8 * 32 * 128], romdata + 8 * 64 * 128, 8 * 32 * 128); @@ -132,17 +132,17 @@ WRITE16_MEMBER( ngbootleg_prot_device::cthd2003_bankswitch_w ) } */ -UINT32 cthd_prot_device::get_bank_base(UINT16 sel) +uint32_t cthd_prot_device::get_bank_base(uint16_t sel) { static const int cthd2003_banks[8] = { 1, 0, 1, 0, 1, 0, 3, 2 }; return (cthd2003_banks[sel & 7] + 1) * 0x100000; } -void cthd_prot_device::patch_cthd2003(UINT8* cpurom, UINT32 cpurom_size) +void cthd_prot_device::patch_cthd2003(uint8_t* cpurom, uint32_t cpurom_size) { // patches thanks to razoola - UINT16 *mem16 = (UINT16 *)cpurom; + uint16_t *mem16 = (uint16_t *)cpurom; // theres still a problem on the character select screen but it seems to be related to cpu core timing issues, // overclocking the 68k prevents it. @@ -178,11 +178,11 @@ void cthd_prot_device::patch_cthd2003(UINT8* cpurom, UINT32 cpurom_size) /* Crouching Tiger Hidden Dragon 2003 Super Plus (bootleg of King of Fighters 2001) */ -void cthd_prot_device::ct2k3sp_sx_decrypt( UINT8* fixedrom, UINT32 fixedrom_size ) +void cthd_prot_device::ct2k3sp_sx_decrypt( uint8_t* fixedrom, uint32_t fixedrom_size ) { int rom_size = fixedrom_size; - UINT8 *rom = fixedrom; - std::vector buf(rom_size); + uint8_t *rom = fixedrom; + std::vector buf(rom_size); memcpy(&buf[0], rom, rom_size); @@ -203,10 +203,10 @@ void cthd_prot_device::ct2k3sp_sx_decrypt( UINT8* fixedrom, UINT32 fixedrom_size memcpy(&rom[0x30000], &buf[0x28000], 0x8000); } -void cthd_prot_device::decrypt_ct2k3sp(UINT8* sprrom, UINT32 sprrom_size, UINT8* audiorom, UINT32 audiorom_size, UINT8* fixedrom, UINT32 fixedrom_size) +void cthd_prot_device::decrypt_ct2k3sp(uint8_t* sprrom, uint32_t sprrom_size, uint8_t* audiorom, uint32_t audiorom_size, uint8_t* fixedrom, uint32_t fixedrom_size) { - UINT8 *romdata = audiorom + 0x10000; - std::vector tmp(8 * 128 * 128); + uint8_t *romdata = audiorom + 0x10000; + std::vector tmp(8 * 128 * 128); memcpy(&tmp[8 * 0 * 128], romdata + 8 * 0 * 128, 8 * 32 * 128); memcpy(&tmp[8 * 32 * 128], romdata + 8 * 64 * 128, 8 * 32 * 128); memcpy(&tmp[8 * 64 * 128], romdata + 8 * 32 * 128, 8 * 32 * 128); @@ -222,10 +222,10 @@ void cthd_prot_device::decrypt_ct2k3sp(UINT8* sprrom, UINT32 sprrom_size, UINT8* /* Crouching Tiger Hidden Dragon 2003 Super Plus alternate (bootleg of King of Fighters 2001) */ -void cthd_prot_device::decrypt_ct2k3sa(UINT8* sprrom, UINT32 sprrom_size, UINT8* audiorom, UINT32 audiorom_size ) +void cthd_prot_device::decrypt_ct2k3sa(uint8_t* sprrom, uint32_t sprrom_size, uint8_t* audiorom, uint32_t audiorom_size ) { - UINT8 *romdata = audiorom + 0x10000; - std::vector tmp(8 * 128 * 128); + uint8_t *romdata = audiorom + 0x10000; + std::vector tmp(8 * 128 * 128); memcpy(&tmp[8 * 0 * 128], romdata + 8 * 0 * 128, 8 * 32 * 128); memcpy(&tmp[8 * 32 * 128], romdata + 8 * 64 * 128, 8 * 32 * 128); memcpy(&tmp[8 * 64 * 128], romdata + 8 * 32 * 128, 8 * 32 * 128); @@ -237,10 +237,10 @@ void cthd_prot_device::decrypt_ct2k3sa(UINT8* sprrom, UINT32 sprrom_size, UINT8* } -void cthd_prot_device::patch_ct2k3sa(UINT8* cpurom, UINT32 cpurom_size) +void cthd_prot_device::patch_ct2k3sa(uint8_t* cpurom, uint32_t cpurom_size) { /* patches thanks to razoola - same as for cthd2003*/ - UINT16 *mem16 = (UINT16 *)cpurom; + uint16_t *mem16 = (uint16_t *)cpurom; // theres still a problem on the character select screen but it seems to be related to cpu core timing issues, // overclocking the 68k prevents it. @@ -276,11 +276,11 @@ void cthd_prot_device::patch_ct2k3sa(UINT8* cpurom, UINT32 cpurom_size) /* Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg) */ #define MATRIMBLZ80(i) (i ^ (BITSWAP8(i & 0x3,4,3,1,2,0,7,6,5) << 8)) -void cthd_prot_device::matrimbl_decrypt(UINT8* sprrom, UINT32 sprrom_size, UINT8* audiorom, UINT32 audiorom_size) +void cthd_prot_device::matrimbl_decrypt(uint8_t* sprrom, uint32_t sprrom_size, uint8_t* audiorom, uint32_t audiorom_size) { // decrypt Z80 - UINT8 *rom = audiorom + 0x10000; - std::vector buf(0x20000); + uint8_t *rom = audiorom + 0x10000; + std::vector buf(0x20000); memcpy(&buf[0], rom, 0x20000); int j; diff --git a/src/devices/bus/neogeo/prot_cthd.h b/src/devices/bus/neogeo/prot_cthd.h index 8adc5fec705..69b4dbfa850 100644 --- a/src/devices/bus/neogeo/prot_cthd.h +++ b/src/devices/bus/neogeo/prot_cthd.h @@ -16,24 +16,24 @@ class cthd_prot_device : public device_t { public: // construction/destruction - cthd_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cthd_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void fix_do(UINT8* sprrom, UINT32 sprrom_size, int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift); - void gfx_address_fix(UINT8* sprrom, UINT32 sprrom_size, int start, int end); - void cthd2003_c(UINT8* sprrom, UINT32 sprrom_size, int pow); + void fix_do(uint8_t* sprrom, uint32_t sprrom_size, int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift); + void gfx_address_fix(uint8_t* sprrom, uint32_t sprrom_size, int start, int end); + void cthd2003_c(uint8_t* sprrom, uint32_t sprrom_size, int pow); - void decrypt_cthd2003(UINT8* sprrom, UINT32 sprrom_size, UINT8* audiorom, UINT32 audiorom_size, UINT8* fixedrom, UINT32 fixedrom_size); - void patch_cthd2003(UINT8* cpurom, UINT32 cpurom_size); + void decrypt_cthd2003(uint8_t* sprrom, uint32_t sprrom_size, uint8_t* audiorom, uint32_t audiorom_size, uint8_t* fixedrom, uint32_t fixedrom_size); + void patch_cthd2003(uint8_t* cpurom, uint32_t cpurom_size); //DECLARE_WRITE16_MEMBER(cthd2003_bankswitch_w); - UINT32 get_bank_base(UINT16 sel); + uint32_t get_bank_base(uint16_t sel); - void ct2k3sp_sx_decrypt(UINT8* fixedrom, UINT32 fixedrom_size); - void decrypt_ct2k3sp(UINT8* sprrom, UINT32 sprrom_size, UINT8* audiorom, UINT32 audiorom_size, UINT8* fixedrom, UINT32 fixedrom_size); + void ct2k3sp_sx_decrypt(uint8_t* fixedrom, uint32_t fixedrom_size); + void decrypt_ct2k3sp(uint8_t* sprrom, uint32_t sprrom_size, uint8_t* audiorom, uint32_t audiorom_size, uint8_t* fixedrom, uint32_t fixedrom_size); - void patch_ct2k3sa(UINT8* cpurom, UINT32 cpurom_size); - void decrypt_ct2k3sa(UINT8* sprrom, UINT32 sprrom_size, UINT8* audiorom, UINT32 audiorom_size); + void patch_ct2k3sa(uint8_t* cpurom, uint32_t cpurom_size); + void decrypt_ct2k3sa(uint8_t* sprrom, uint32_t sprrom_size, uint8_t* audiorom, uint32_t audiorom_size); - void matrimbl_decrypt(UINT8* sprrom, UINT32 sprrom_size, UINT8* audiorom, UINT32 audiorom_size); + void matrimbl_decrypt(uint8_t* sprrom, uint32_t sprrom_size, uint8_t* audiorom, uint32_t audiorom_size); protected: virtual void device_start() override; diff --git a/src/devices/bus/neogeo/prot_fatfury2.cpp b/src/devices/bus/neogeo/prot_fatfury2.cpp index 7a04e4cefe8..6398a0db2e5 100644 --- a/src/devices/bus/neogeo/prot_fatfury2.cpp +++ b/src/devices/bus/neogeo/prot_fatfury2.cpp @@ -9,7 +9,7 @@ extern const device_type FATFURY2_PROT = &device_creator; -fatfury2_prot_device::fatfury2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +fatfury2_prot_device::fatfury2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FATFURY2_PROT, "Neo Geo Fatal Fury 2 Protection", tag, owner, clock, "fatfury2_prot", __FILE__), m_prot_data(0) { @@ -33,7 +33,7 @@ void fatfury2_prot_device::device_reset() /* 0x2xxxxx range. There are several checks all around the code. */ READ16_MEMBER( fatfury2_prot_device::protection_r ) { - UINT16 res = m_prot_data >> 24; + uint16_t res = m_prot_data >> 24; switch (offset) { diff --git a/src/devices/bus/neogeo/prot_fatfury2.h b/src/devices/bus/neogeo/prot_fatfury2.h index d594f01e112..daa2d147faf 100644 --- a/src/devices/bus/neogeo/prot_fatfury2.h +++ b/src/devices/bus/neogeo/prot_fatfury2.h @@ -16,12 +16,12 @@ class fatfury2_prot_device : public device_t { public: // construction/destruction - fatfury2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fatfury2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER( protection_r ); DECLARE_WRITE16_MEMBER( protection_w ); - UINT32 m_prot_data; + uint32_t m_prot_data; protected: virtual void device_start() override; diff --git a/src/devices/bus/neogeo/prot_kof2k2.cpp b/src/devices/bus/neogeo/prot_kof2k2.cpp index 5ec8c31f979..4fc088adc53 100644 --- a/src/devices/bus/neogeo/prot_kof2k2.cpp +++ b/src/devices/bus/neogeo/prot_kof2k2.cpp @@ -7,7 +7,7 @@ extern const device_type KOF2002_PROT = &device_creator; -kof2002_prot_device::kof2002_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kof2002_prot_device::kof2002_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KOF2002_PROT, "Neo Geo KOF 2002 Protection", tag, owner, clock, "kof2002_prot", __FILE__) { } @@ -23,11 +23,11 @@ void kof2002_prot_device::device_reset() /* kof2002, matrim, samsho5, samsh5sp have some simple block swapping */ -void kof2002_prot_device::kof2002_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) +void kof2002_prot_device::kof2002_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size) { static const int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000}; - UINT8 *src = cpurom + 0x100000; - std::vector dst(0x400000); + uint8_t *src = cpurom + 0x100000; + std::vector dst(0x400000); memcpy(&dst[0], src, 0x400000); for (int i = 0; i < 8; ++i) @@ -35,11 +35,11 @@ void kof2002_prot_device::kof2002_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) } -void kof2002_prot_device::matrim_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) +void kof2002_prot_device::matrim_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size) { static const int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000}; - UINT8 *src = cpurom + 0x100000; - std::vector dst(0x400000); + uint8_t *src = cpurom + 0x100000; + std::vector dst(0x400000); memcpy(&dst[0], src, 0x400000); for (int i = 0; i < 8; ++i) @@ -47,22 +47,22 @@ void kof2002_prot_device::matrim_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) } -void kof2002_prot_device::samsho5_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) +void kof2002_prot_device::samsho5_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size) { static const int sec[]={0x000000,0x080000,0x700000,0x680000,0x500000,0x180000,0x200000,0x480000,0x300000,0x780000,0x600000,0x280000,0x100000,0x580000,0x400000,0x380000}; - UINT8 *src = cpurom; - std::vector dst(0x800000); + uint8_t *src = cpurom; + std::vector dst(0x800000); memcpy(&dst[0], src, 0x800000); for (int i = 0; i < 16; ++i) memcpy(src + i * 0x80000, &dst[sec[i]], 0x80000); } -void kof2002_prot_device::samsh5sp_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) +void kof2002_prot_device::samsh5sp_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size) { static const int sec[]={0x000000,0x080000,0x500000,0x480000,0x600000,0x580000,0x700000,0x280000,0x100000,0x680000,0x400000,0x780000,0x200000,0x380000,0x300000,0x180000}; - UINT8 *src = cpurom; - std::vector dst(0x800000); + uint8_t *src = cpurom; + std::vector dst(0x800000); memcpy(&dst[0], src, 0x800000); for (int i = 0; i < 16; ++i) diff --git a/src/devices/bus/neogeo/prot_kof2k2.h b/src/devices/bus/neogeo/prot_kof2k2.h index e6991f443ea..f732a1704c0 100644 --- a/src/devices/bus/neogeo/prot_kof2k2.h +++ b/src/devices/bus/neogeo/prot_kof2k2.h @@ -17,12 +17,12 @@ class kof2002_prot_device : public device_t { public: // construction/destruction - kof2002_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kof2002_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void kof2002_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size); - void matrim_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size); - void samsho5_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size); - void samsh5sp_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size); + void kof2002_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size); + void matrim_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size); + void samsho5_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size); + void samsh5sp_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size); protected: virtual void device_start() override; diff --git a/src/devices/bus/neogeo/prot_kof2k3bl.cpp b/src/devices/bus/neogeo/prot_kof2k3bl.cpp index 35c2272fb3d..2806af3a45b 100644 --- a/src/devices/bus/neogeo/prot_kof2k3bl.cpp +++ b/src/devices/bus/neogeo/prot_kof2k3bl.cpp @@ -7,7 +7,7 @@ extern const device_type KOF2K3BL_PROT = &device_creator; -kof2k3bl_prot_device::kof2k3bl_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +kof2k3bl_prot_device::kof2k3bl_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KOF2K3BL_PROT, "Neo Geo KOF 2003 Bootleg Protection", tag, owner, clock, "kof2k3bl_prot", __FILE__) {} @@ -45,10 +45,10 @@ WRITE16_MEMBER(kof2k3bl_prot_device::kof2003_w) data = COMBINE_DATA(&m_cartridge_ram[offset]); if (offset == 0x1ff0/2 || offset == 0x1ff2/2) { - UINT8* cr = (UINT8 *)m_cartridge_ram; - UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)]; + uint8_t* cr = (uint8_t *)m_cartridge_ram; + uint8_t prt = cr[BYTE_XOR_LE(0x1ff2)]; m_bank_base = 0x100000 + ((cr[BYTE_XOR_LE(0x1ff3)] << 16) | (cr[BYTE_XOR_LE(0x1ff2)] << 8) | cr[BYTE_XOR_LE(0x1ff1)]); - //UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)] << 16) | (cr[BYTE_XOR_LE(0x1ff2)] << 8) | cr[BYTE_XOR_LE(0x1ff1)]; + //uint32_t address = (cr[BYTE_XOR_LE(0x1ff3)] << 16) | (cr[BYTE_XOR_LE(0x1ff2)] << 8) | cr[BYTE_XOR_LE(0x1ff1)]; //m_bankdev->neogeo_set_main_cpu_bank_address(address+0x100000); cr[BYTE_XOR_LE(0x1ff0)] = 0xa0; @@ -64,10 +64,10 @@ WRITE16_MEMBER(kof2k3bl_prot_device::kof2003p_w) data = COMBINE_DATA(&m_cartridge_ram[offset]); if (offset == 0x1ff0/2 || offset == 0x1ff2/2) { - UINT8* cr = (UINT8 *)m_cartridge_ram; - UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)]; + uint8_t* cr = (uint8_t *)m_cartridge_ram; + uint8_t prt = cr[BYTE_XOR_LE(0x1ff2)]; m_bank_base = 0x100000 + ((cr[BYTE_XOR_LE(0x1ff3)] << 16) | (cr[BYTE_XOR_LE(0x1ff2)] << 8) | cr[BYTE_XOR_LE(0x1ff0)]); - //UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)] << 16) | (cr[BYTE_XOR_LE(0x1ff2)] << 8) | cr[BYTE_XOR_LE(0x1ff0)]; + //uint32_t address = (cr[BYTE_XOR_LE(0x1ff3)] << 16) | (cr[BYTE_XOR_LE(0x1ff2)] << 8) | cr[BYTE_XOR_LE(0x1ff0)]; //m_bankdev->neogeo_set_main_cpu_bank_address(address+0x100000); cr[BYTE_XOR_LE(0x1ff0)] &= 0xfe; @@ -77,12 +77,12 @@ WRITE16_MEMBER(kof2k3bl_prot_device::kof2003p_w) } } -void kof2k3bl_prot_device::bl_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void kof2k3bl_prot_device::bl_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { - static const UINT8 sec[] = { 0x07, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 }; + static const uint8_t sec[] = { 0x07, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 }; int rom_size = 0x800000; - UINT8 *rom = cpurom; - std::vector buf(rom_size); + uint8_t *rom = cpurom; + std::vector buf(rom_size); memcpy(&buf[0], rom, rom_size); for (int i = 0; i < rom_size / 0x100000; i++) @@ -92,10 +92,10 @@ void kof2k3bl_prot_device::bl_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) /* The King of Fighters 2004 Plus / Hero (The King of Fighters 2003 bootleg) */ -void kof2k3bl_prot_device::pl_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void kof2k3bl_prot_device::pl_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { - std::vector tmp(0x100000/2); - UINT16*rom16 = (UINT16*)cpurom; + std::vector tmp(0x100000/2); + uint16_t*rom16 = (uint16_t*)cpurom; for (int i = 0; i < 0x700000/2; i += 0x100000/2) { @@ -113,20 +113,20 @@ void kof2k3bl_prot_device::pl_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) /* The King of Fighters 2004 Ultra Plus (The King of Fighters 2003 bootleg) */ -void kof2k3bl_prot_device::upl_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void kof2k3bl_prot_device::upl_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { - UINT8 *src = cpurom; + uint8_t *src = cpurom; memmove(src + 0x100000, src, 0x600000); memmove(src, src + 0x700000, 0x100000); - UINT8 *rom = cpurom + 0xfe000; - UINT8 *buf = cpurom + 0xd0610; + uint8_t *rom = cpurom + 0xfe000; + uint8_t *buf = cpurom + 0xd0610; for (int i = 0; i < 0x2000 / 2; i++) { int ofst = (i & 0xff00) + BITSWAP8((i & 0x00ff), 7, 6, 0, 4, 3, 2, 1, 5); memcpy(&rom[i * 2], &buf[ofst * 2], 2); } - UINT16* rom16 = (UINT16*)cpurom; + uint16_t* rom16 = (uint16_t*)cpurom; m_overlay = rom16[0x58196 / 2]; } diff --git a/src/devices/bus/neogeo/prot_kof2k3bl.h b/src/devices/bus/neogeo/prot_kof2k3bl.h index 02debee0128..23bba22c89a 100644 --- a/src/devices/bus/neogeo/prot_kof2k3bl.h +++ b/src/devices/bus/neogeo/prot_kof2k3bl.h @@ -16,25 +16,25 @@ class kof2k3bl_prot_device : public device_t { public: // construction/destruction - kof2k3bl_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kof2k3bl_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER(protection_r); DECLARE_WRITE16_MEMBER(kof2003_w); DECLARE_WRITE16_MEMBER(kof2003p_w); DECLARE_READ16_MEMBER(overlay_r); - void bl_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); - void pl_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); - void upl_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); - UINT32 get_bank_base() {return m_bank_base; } + void bl_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + void pl_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + void upl_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + uint32_t get_bank_base() {return m_bank_base; } protected: virtual void device_start() override; virtual void device_reset() override; private: - UINT16 m_overlay; - UINT32 m_bank_base; - UINT16 m_cartridge_ram[0x1000]; // bootlegs + uint16_t m_overlay; + uint32_t m_bank_base; + uint16_t m_cartridge_ram[0x1000]; // bootlegs }; #endif diff --git a/src/devices/bus/neogeo/prot_kof98.cpp b/src/devices/bus/neogeo/prot_kof98.cpp index 86da8a1b7f4..ee72c203273 100644 --- a/src/devices/bus/neogeo/prot_kof98.cpp +++ b/src/devices/bus/neogeo/prot_kof98.cpp @@ -8,7 +8,7 @@ extern const device_type KOF98_PROT = &device_creator; -kof98_prot_device::kof98_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +kof98_prot_device::kof98_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KOF98_PROT, "Neo Geo KOF 98 Protection", tag, owner, clock, "kof98_prot", __FILE__), m_prot_state(0) {} @@ -25,13 +25,13 @@ void kof98_prot_device::device_reset() /* Kof98 uses an early encryption, quite different from the others */ -void kof98_prot_device::decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) +void kof98_prot_device::decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size) { - UINT8 *src = cpurom; - std::vector dst(0x200000); + uint8_t *src = cpurom; + std::vector dst(0x200000); int i, j, k; - static const UINT32 sec[]={ 0x000000, 0x100000, 0x000004, 0x100004, 0x10000a, 0x00000a, 0x10000e, 0x00000e }; - static const UINT32 pos[]={ 0x000, 0x004, 0x00a, 0x00e }; + static const uint32_t sec[]={ 0x000000, 0x100000, 0x000004, 0x100004, 0x10000a, 0x00000a, 0x10000e, 0x00000e }; + static const uint32_t pos[]={ 0x000, 0x004, 0x00a, 0x00e }; memcpy(&dst[0], src, 0x200000); for (i = 0x800; i < 0x100000; i += 0x200) @@ -67,7 +67,7 @@ void kof98_prot_device::decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) } memmove(&src[0x100000], &src[0x200000], 0x400000); - UINT16* mem16 = (UINT16*)cpurom; + uint16_t* mem16 = (uint16_t*)cpurom; m_default_rom[0] = mem16[0x100/2]; m_default_rom[1] = mem16[0x102/2]; } diff --git a/src/devices/bus/neogeo/prot_kof98.h b/src/devices/bus/neogeo/prot_kof98.h index 39263dd9cf4..76ed3386db9 100644 --- a/src/devices/bus/neogeo/prot_kof98.h +++ b/src/devices/bus/neogeo/prot_kof98.h @@ -17,13 +17,13 @@ class kof98_prot_device : public device_t { public: // construction/destruction - kof98_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kof98_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void decrypt_68k(UINT8* cpurom, UINT32 cpurom_size); + void decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size); DECLARE_WRITE16_MEMBER(protection_w); DECLARE_READ16_MEMBER(protection_r); int m_prot_state; - UINT16 m_default_rom[2]; + uint16_t m_default_rom[2]; protected: virtual void device_start() override; diff --git a/src/devices/bus/neogeo/prot_misc.cpp b/src/devices/bus/neogeo/prot_misc.cpp index 70ded6a0f7f..825d630e1d9 100644 --- a/src/devices/bus/neogeo/prot_misc.cpp +++ b/src/devices/bus/neogeo/prot_misc.cpp @@ -26,7 +26,7 @@ extern const device_type NEOBOOT_PROT = &device_creator; -neoboot_prot_device::neoboot_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neoboot_prot_device::neoboot_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEOBOOT_PROT, "Neo Geo Bootleg Protection(s)", tag, owner, clock, "ngboot_prot", __FILE__) {} @@ -44,11 +44,11 @@ void neoboot_prot_device::device_reset() /* General Bootleg Functions - used by more than 1 game */ -void neoboot_prot_device::cx_decrypt(UINT8*sprrom, UINT32 sprrom_size) +void neoboot_prot_device::cx_decrypt(uint8_t*sprrom, uint32_t sprrom_size) { int cx_size = sprrom_size; - UINT8 *rom = sprrom; - std::vector buf(cx_size); + uint8_t *rom = sprrom; + std::vector buf(cx_size); memcpy(&buf[0], rom, cx_size); @@ -57,14 +57,14 @@ void neoboot_prot_device::cx_decrypt(UINT8*sprrom, UINT32 sprrom_size) } -void neoboot_prot_device::sx_decrypt(UINT8* fixed, UINT32 fixed_size, int value) +void neoboot_prot_device::sx_decrypt(uint8_t* fixed, uint32_t fixed_size, int value) { int sx_size = fixed_size; - UINT8 *rom = fixed; + uint8_t *rom = fixed; if (value == 1) { - std::vector buf(sx_size); + std::vector buf(sx_size); memcpy(&buf[0], rom, sx_size); for (int i = 0; i < sx_size; i += 0x10) @@ -84,10 +84,10 @@ void neoboot_prot_device::sx_decrypt(UINT8* fixed, UINT32 fixed_size, int value) /* The King of Fighters '97 Oroshi Plus 2003 (bootleg) */ -void neoboot_prot_device::kof97oro_px_decode(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::kof97oro_px_decode(uint8_t* cpurom, uint32_t cpurom_size) { - std::vector tmp(0x500000); - UINT16 *src = (UINT16*)cpurom; + std::vector tmp(0x500000); + uint16_t *src = (uint16_t*)cpurom; for (int i = 0; i < 0x500000/2; i++) tmp[i] = src[i ^ 0x7ffef]; @@ -99,10 +99,10 @@ void neoboot_prot_device::kof97oro_px_decode(UINT8* cpurom, UINT32 cpurom_size) /* The King of Fighters 10th Anniversary Extra Plus (The King of Fighters 2002 bootleg) */ -void neoboot_prot_device::kf10thep_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::kf10thep_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { - UINT16 *rom = (UINT16*)cpurom; - std::vector buf(0x100000/2); + uint16_t *rom = (uint16_t*)cpurom; + std::vector buf(0x100000/2); memcpy(&buf[0x000000/2], &rom[0x060000/2], 0x20000); memcpy(&buf[0x020000/2], &rom[0x100000/2], 0x20000); @@ -129,10 +129,10 @@ void neoboot_prot_device::kf10thep_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) /* The King of Fighters 10th Anniversary 2005 Unique (The King of Fighters 2002 bootleg) */ -void neoboot_prot_device::kf2k5uni_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::kf2k5uni_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { - UINT8 *src = cpurom; - UINT8 dst[0x80]; + uint8_t *src = cpurom; + uint8_t dst[0x80]; for (int i = 0; i < 0x800000; i += 0x80) { @@ -148,17 +148,17 @@ void neoboot_prot_device::kf2k5uni_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) } -void neoboot_prot_device::kf2k5uni_sx_decrypt(UINT8* fixedrom, UINT32 fixedrom_size) +void neoboot_prot_device::kf2k5uni_sx_decrypt(uint8_t* fixedrom, uint32_t fixedrom_size) { - UINT8 *srom = fixedrom; + uint8_t *srom = fixedrom; for (int i = 0; i < 0x20000; i++) srom[i] = BITSWAP8(srom[i], 4, 5, 6, 7, 0, 1, 2, 3); } -void neoboot_prot_device::kf2k5uni_mx_decrypt(UINT8* audiorom, UINT32 audiorom_size) +void neoboot_prot_device::kf2k5uni_mx_decrypt(uint8_t* audiorom, uint32_t audiorom_size) { - UINT8 *mrom = audiorom; + uint8_t *mrom = audiorom; for (int i = 0; i < 0x30000; i++) mrom[i] = BITSWAP8(mrom[i], 4, 5, 6, 7, 0, 1, 2, 3); @@ -168,10 +168,10 @@ void neoboot_prot_device::kf2k5uni_mx_decrypt(UINT8* audiorom, UINT32 audiorom_s /* King of Fighters Special Edition 2004 (bootleg of King of Fighters 2002) */ -void neoboot_prot_device::decrypt_kof2k4se_68k(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::decrypt_kof2k4se_68k(uint8_t* cpurom, uint32_t cpurom_size) { - UINT8 *src = cpurom + 0x100000; - std::vector dst(0x400000); + uint8_t *src = cpurom + 0x100000; + std::vector dst(0x400000); static const int sec[] = {0x300000,0x200000,0x100000,0x000000}; memcpy(&dst[0], src, 0x400000); @@ -182,21 +182,21 @@ void neoboot_prot_device::decrypt_kof2k4se_68k(UINT8* cpurom, UINT32 cpurom_size /* Lansquenet 2004 (Shock Troopers - 2nd Squad bootleg) */ -void neoboot_prot_device::lans2004_vx_decrypt(UINT8* ymsndrom, UINT32 ymsndrom_size) +void neoboot_prot_device::lans2004_vx_decrypt(uint8_t* ymsndrom, uint32_t ymsndrom_size) { - UINT8 *rom = ymsndrom; + uint8_t *rom = ymsndrom; for (int i = 0; i < 0xA00000; i++) rom[i] = BITSWAP8(rom[i], 0, 1, 5, 4, 3, 2, 6, 7); } -void neoboot_prot_device::lans2004_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::lans2004_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size) { // Descrambling P ROMs - Thanks to Razoola for the info - UINT8 *src = cpurom; - UINT16 *rom = (UINT16*)cpurom; + uint8_t *src = cpurom; + uint16_t *rom = (uint16_t*)cpurom; static const int sec[] = { 0x3, 0x8, 0x7, 0xc, 0x1, 0xa, 0x6, 0xd }; - std::vector dst(0x600000); + std::vector dst(0x600000); for (int i = 0; i < 8; i++) memcpy (&dst[i * 0x20000], src + sec[i] * 0x20000, 0x20000); @@ -228,11 +228,11 @@ void neoboot_prot_device::lans2004_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size /* Samurai Shodown V / Samurai Spirits Zero (bootleg) */ -void neoboot_prot_device::samsho5b_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::samsho5b_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { int px_size = cpurom_size; - UINT8 *rom = cpurom; - std::vector buf(px_size); + uint8_t *rom = cpurom; + std::vector buf(px_size); memcpy(&buf[0], rom, px_size); @@ -252,10 +252,10 @@ void neoboot_prot_device::samsho5b_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) } -void neoboot_prot_device::samsho5b_vx_decrypt(UINT8* ymsndrom, UINT32 ymsndrom_size) +void neoboot_prot_device::samsho5b_vx_decrypt(uint8_t* ymsndrom, uint32_t ymsndrom_size) { int vx_size = ymsndrom_size; - UINT8 *rom = ymsndrom; + uint8_t *rom = ymsndrom; for (int i = 0; i < vx_size; i++) rom[i] = BITSWAP8(rom[i], 0, 1, 5, 4, 3, 2, 6, 7); @@ -295,7 +295,7 @@ WRITE16_MEMBER( neoboot_prot_device::ms5plus_bankswitch_w ) } */ -UINT32 neoboot_prot_device::mslug5p_bank_base(UINT16 sel) +uint32_t neoboot_prot_device::mslug5p_bank_base(uint16_t sel) { sel = sel >> 4; //sel = sel & 7; @@ -307,12 +307,12 @@ UINT32 neoboot_prot_device::mslug5p_bank_base(UINT16 sel) // The protection patching here may be incomplete - Thanks to Razoola for the info -void neoboot_prot_device::kog_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::kog_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { // the protection chip does some *very* strange things to the rom - UINT8 *src = cpurom; - std::vector dst(0x600000); - UINT16 *rom = (UINT16 *)cpurom; + uint8_t *src = cpurom; + std::vector dst(0x600000); + uint16_t *rom = (uint16_t *)cpurom; static const int sec[] = { 0x3, 0x8, 0x7, 0xc, 0x1, 0xa, 0x6, 0xd }; for (int i = 0; i < 8; i++) @@ -368,12 +368,12 @@ void neoboot_prot_device::kog_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) /* SNK vs. CAPCOM SVC CHAOS (bootleg) */ -void neoboot_prot_device::svcboot_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::svcboot_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { - static const UINT8 sec[] = { 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00 }; + static const uint8_t sec[] = { 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00 }; int size = cpurom_size; - UINT8 *src = cpurom; - std::vector dst(size); + uint8_t *src = cpurom; + std::vector dst(size); for (int i = 0; i < size / 0x100000; i++) memcpy(&dst[i * 0x100000], &src[sec[i] * 0x100000], 0x100000); @@ -386,10 +386,10 @@ void neoboot_prot_device::svcboot_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) } } -void neoboot_prot_device::svcboot_cx_decrypt(UINT8* sprrom, UINT32 sprrom_size) +void neoboot_prot_device::svcboot_cx_decrypt(uint8_t* sprrom, uint32_t sprrom_size) { - static const UINT8 idx_tbl[ 0x10 ] = { 0, 1, 0, 1, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, }; - static const UINT8 bitswap4_tbl[ 6 ][ 4 ] = { + static const uint8_t idx_tbl[ 0x10 ] = { 0, 1, 0, 1, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, }; + static const uint8_t bitswap4_tbl[ 6 ][ 4 ] = { { 3, 0, 1, 2 }, { 2, 3, 0, 1 }, { 1, 2, 3, 0 }, @@ -398,8 +398,8 @@ void neoboot_prot_device::svcboot_cx_decrypt(UINT8* sprrom, UINT32 sprrom_size) { 3, 0, 2, 1 }, }; int size = sprrom_size; - UINT8 *src = sprrom; - std::vector dst(size); + uint8_t *src = sprrom; + std::vector dst(size); memcpy(&dst[0], src, size); for (int i = 0; i < size / 0x80; i++) @@ -418,12 +418,12 @@ void neoboot_prot_device::svcboot_cx_decrypt(UINT8* sprrom, UINT32 sprrom_size) /* SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 1) */ -void neoboot_prot_device::svcplus_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::svcplus_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { static const int sec[] = { 0x00, 0x03, 0x02, 0x05, 0x04, 0x01 }; int size = cpurom_size; - UINT8 *src = cpurom; - std::vector dst(size); + uint8_t *src = cpurom; + std::vector dst(size); memcpy(&dst[0], src, size); for (int i = 0; i < size / 2; i++) @@ -442,22 +442,22 @@ void neoboot_prot_device::svcplus_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) } -void neoboot_prot_device::svcplus_px_hack(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::svcplus_px_hack(uint8_t* cpurom, uint32_t cpurom_size) { /* patched by the protection chip? */ - UINT16 *mem16 = (UINT16 *)cpurom; + uint16_t *mem16 = (uint16_t *)cpurom; mem16[0x0f8016/2] = 0x33c1; } /* SNK vs. CAPCOM SVC CHAOS Plus (bootleg set 2) */ -void neoboot_prot_device::svcplusa_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::svcplusa_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { static const int sec[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x00 }; int size = cpurom_size; - UINT8 *src = cpurom; - std::vector dst(size); + uint8_t *src = cpurom; + std::vector dst(size); memcpy(&dst[0], src, size); for (int i = 0; i < 6; i++) @@ -467,12 +467,12 @@ void neoboot_prot_device::svcplusa_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) /* SNK vs. CAPCOM SVC CHAOS Super Plus (bootleg) */ -void neoboot_prot_device::svcsplus_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::svcsplus_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { static const int sec[] = { 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00 }; int size = cpurom_size; - UINT8 *src = cpurom; - std::vector dst(size); + uint8_t *src = cpurom; + std::vector dst(size); memcpy(&dst[0], src, size); for (int i = 0; i < size / 2; i++) @@ -486,10 +486,10 @@ void neoboot_prot_device::svcsplus_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) } } -void neoboot_prot_device::svcsplus_px_hack(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::svcsplus_px_hack(uint8_t* cpurom, uint32_t cpurom_size) { /* patched by the protection chip? */ - UINT16 *mem16 = (UINT16 *)cpurom; + uint16_t *mem16 = (uint16_t *)cpurom; mem16[0x9e90/2] = 0x000f; mem16[0x9e92/2] = 0xc9c0; mem16[0xa10c/2] = 0x4eb9; @@ -500,9 +500,9 @@ void neoboot_prot_device::svcsplus_px_hack(UINT8* cpurom, UINT32 cpurom_size) /* The King of Fighters 2002 (bootleg) */ -void neoboot_prot_device::kof2002b_gfx_decrypt(UINT8 *src, int size) +void neoboot_prot_device::kof2002b_gfx_decrypt(uint8_t *src, int size) { - static const UINT8 t[8][6] = + static const uint8_t t[8][6] = { { 0, 8, 7, 6, 2, 1 }, { 1, 0, 8, 7, 6, 2 }, @@ -514,7 +514,7 @@ void neoboot_prot_device::kof2002b_gfx_decrypt(UINT8 *src, int size) { 8, 0, 7, 6, 2, 1 }, }; - std::vector dst(0x10000); + std::vector dst(0x10000); for (int i = 0; i < size; i += 0x10000) { @@ -532,10 +532,10 @@ void neoboot_prot_device::kof2002b_gfx_decrypt(UINT8 *src, int size) /* The King of Fighters 2002 Magic Plus (bootleg) */ -void neoboot_prot_device::kf2k2mp_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::kf2k2mp_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { - UINT8 *src = cpurom; - UINT8 dst[0x80]; + uint8_t *src = cpurom; + uint8_t dst[0x80]; memmove(src, src + 0x300000, 0x500000); @@ -553,10 +553,10 @@ void neoboot_prot_device::kf2k2mp_decrypt(UINT8* cpurom, UINT32 cpurom_size) /* The King of Fighters 2002 Magic Plus II (bootleg) */ -void neoboot_prot_device::kf2k2mp2_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::kf2k2mp2_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { - UINT8 *src = cpurom; - std::vector dst(0x600000); + uint8_t *src = cpurom; + std::vector dst(0x600000); memcpy(&dst[0x000000], &src[0x1C0000], 0x040000); memcpy(&dst[0x040000], &src[0x140000], 0x080000); @@ -569,10 +569,10 @@ void neoboot_prot_device::kf2k2mp2_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) /* The King of Fighters 10th Anniversary (The King of Fighters 2002 bootleg) */ -void neoboot_prot_device::kof10th_decrypt(UINT8* cpurom, UINT32 cpurom_size) +void neoboot_prot_device::kof10th_decrypt(uint8_t* cpurom, uint32_t cpurom_size) { - std::vector dst(0x900000); - UINT8 *src = cpurom; + std::vector dst(0x900000); + uint8_t *src = cpurom; memcpy(&dst[0x000000], src + 0x700000, 0x100000); // Correct (Verified in Uni-bios) memcpy(&dst[0x100000], src + 0x000000, 0x800000); @@ -584,10 +584,10 @@ void neoboot_prot_device::kof10th_decrypt(UINT8* cpurom, UINT32 cpurom_size) } // Altera protection chip patches these over P ROM - ((UINT16*)src)[0x0124/2] = 0x000d; // Enables XOR for RAM moves, forces SoftDIPs, and USA region - ((UINT16*)src)[0x0126/2] = 0xf7a8; + ((uint16_t*)src)[0x0124/2] = 0x000d; // Enables XOR for RAM moves, forces SoftDIPs, and USA region + ((uint16_t*)src)[0x0126/2] = 0xf7a8; - ((UINT16*)src)[0x8bf4/2] = 0x4ef9; // Run code to change "S" data - ((UINT16*)src)[0x8bf6/2] = 0x000d; - ((UINT16*)src)[0x8bf8/2] = 0xf980; + ((uint16_t*)src)[0x8bf4/2] = 0x4ef9; // Run code to change "S" data + ((uint16_t*)src)[0x8bf6/2] = 0x000d; + ((uint16_t*)src)[0x8bf8/2] = 0xf980; } diff --git a/src/devices/bus/neogeo/prot_misc.h b/src/devices/bus/neogeo/prot_misc.h index ba4681aa640..85a22fd638f 100644 --- a/src/devices/bus/neogeo/prot_misc.h +++ b/src/devices/bus/neogeo/prot_misc.h @@ -16,46 +16,46 @@ class neoboot_prot_device : public device_t { public: // construction/destruction - neoboot_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neoboot_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void cx_decrypt(UINT8* sprrom, UINT32 sprrom_size); - void sx_decrypt(UINT8* fixed, UINT32 fixed_size, int value); + void cx_decrypt(uint8_t* sprrom, uint32_t sprrom_size); + void sx_decrypt(uint8_t* fixed, uint32_t fixed_size, int value); - void kof97oro_px_decode(UINT8* cpurom, UINT32 cpurom_size); + void kof97oro_px_decode(uint8_t* cpurom, uint32_t cpurom_size); - void kf10thep_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); + void kf10thep_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); - void kf2k5uni_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); - void kf2k5uni_sx_decrypt(UINT8* fixedrom, UINT32 fixedrom_size); - void kf2k5uni_mx_decrypt(UINT8* audiorom, UINT32 audiorom_size); + void kf2k5uni_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + void kf2k5uni_sx_decrypt(uint8_t* fixedrom, uint32_t fixedrom_size); + void kf2k5uni_mx_decrypt(uint8_t* audiorom, uint32_t audiorom_size); - void decrypt_kof2k4se_68k(UINT8* cpurom, UINT32 cpurom_size); + void decrypt_kof2k4se_68k(uint8_t* cpurom, uint32_t cpurom_size); - void lans2004_vx_decrypt(UINT8* ymsndrom, UINT32 ymsndrom_size); - void lans2004_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size); + void lans2004_vx_decrypt(uint8_t* ymsndrom, uint32_t ymsndrom_size); + void lans2004_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size); - void samsho5b_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); - void samsho5b_vx_decrypt(UINT8* ymsndrom, UINT32 ymsndrom_size); + void samsho5b_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + void samsho5b_vx_decrypt(uint8_t* ymsndrom, uint32_t ymsndrom_size); DECLARE_READ16_MEMBER(mslug5p_prot_r); //DECLARE_WRITE16_MEMBER(ms5plus_bankswitch_w); - UINT32 mslug5p_bank_base(UINT16 sel); + uint32_t mslug5p_bank_base(uint16_t sel); - void kog_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); + void kog_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); - void svcboot_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); - void svcboot_cx_decrypt(UINT8*sprrom, UINT32 sprrom_size); - void svcplus_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); - void svcplus_px_hack(UINT8* cpurom, UINT32 cpurom_size); - void svcplusa_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); - void svcsplus_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); - void svcsplus_px_hack(UINT8* cpurom, UINT32 cpurom_size); + void svcboot_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + void svcboot_cx_decrypt(uint8_t*sprrom, uint32_t sprrom_size); + void svcplus_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + void svcplus_px_hack(uint8_t* cpurom, uint32_t cpurom_size); + void svcplusa_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + void svcsplus_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + void svcsplus_px_hack(uint8_t* cpurom, uint32_t cpurom_size); - void kof2002b_gfx_decrypt(UINT8 *src, int size); - void kf2k2mp_decrypt(UINT8* cpurom, UINT32 cpurom_size); - void kf2k2mp2_px_decrypt(UINT8* cpurom, UINT32 cpurom_size); + void kof2002b_gfx_decrypt(uint8_t *src, int size); + void kf2k2mp_decrypt(uint8_t* cpurom, uint32_t cpurom_size); + void kf2k2mp2_px_decrypt(uint8_t* cpurom, uint32_t cpurom_size); - void kof10th_decrypt(UINT8* cpurom, UINT32 cpurom_size); + void kof10th_decrypt(uint8_t* cpurom, uint32_t cpurom_size); protected: virtual void device_start() override; diff --git a/src/devices/bus/neogeo/prot_mslugx.cpp b/src/devices/bus/neogeo/prot_mslugx.cpp index e54007c4a2e..85321f8c92c 100644 --- a/src/devices/bus/neogeo/prot_mslugx.cpp +++ b/src/devices/bus/neogeo/prot_mslugx.cpp @@ -7,7 +7,7 @@ extern const device_type MSLUGX_PROT = &device_creator; -mslugx_prot_device::mslugx_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mslugx_prot_device::mslugx_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSLUGX_PROT, "Neo Geo Metal Slug X Protection", tag, owner, clock, "mslugx_prot", __FILE__), m_counter(0), m_command(0) @@ -61,7 +61,7 @@ WRITE16_MEMBER( mslugx_prot_device::protection_w ) READ16_MEMBER( mslugx_prot_device::protection_r ) { - UINT16 res = 0; + uint16_t res = 0; switch (m_command) { @@ -72,7 +72,7 @@ READ16_MEMBER( mslugx_prot_device::protection_r ) break; case 0x0fff: { // All other accesses (Register D2) - INT32 select = space.read_word(0x10f00a) - 1; // How should this be calculated? + int32_t select = space.read_word(0x10f00a) - 1; // How should this be calculated? res = (space.read_byte(0xdedd2 + ((select >> 3) & 0x0fff)) >> (~select & 0x07)) & 1; } break; diff --git a/src/devices/bus/neogeo/prot_mslugx.h b/src/devices/bus/neogeo/prot_mslugx.h index 3223f62bb68..a18a2777f5c 100644 --- a/src/devices/bus/neogeo/prot_mslugx.h +++ b/src/devices/bus/neogeo/prot_mslugx.h @@ -17,7 +17,7 @@ class mslugx_prot_device : public device_t { public: // construction/destruction - mslugx_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mslugx_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE16_MEMBER( protection_w ); DECLARE_READ16_MEMBER( protection_r ); @@ -27,8 +27,8 @@ protected: virtual void device_reset() override; private: - UINT16 m_counter; - UINT16 m_command; + uint16_t m_counter; + uint16_t m_command; }; #endif diff --git a/src/devices/bus/neogeo/prot_pcm2.cpp b/src/devices/bus/neogeo/prot_pcm2.cpp index 2417075509a..36d5557d817 100644 --- a/src/devices/bus/neogeo/prot_pcm2.cpp +++ b/src/devices/bus/neogeo/prot_pcm2.cpp @@ -9,7 +9,7 @@ extern const device_type PCM2_PROT = &device_creator; -pcm2_prot_device::pcm2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pcm2_prot_device::pcm2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCM2_PROT, "Neo Geo NEOPCM2 Protection", tag, owner, clock, "pcm2_prot", __FILE__) { } @@ -32,16 +32,16 @@ NeoGeo 'V' (PCM) ROM encryption ***************************************************************************/ // Neo-Pcm2 Drivers for Encrypted V Roms -void pcm2_prot_device::decrypt(UINT8* ymrom, UINT32 ymsize, int value) +void pcm2_prot_device::decrypt(uint8_t* ymrom, uint32_t ymsize, int value) { // thanks to Elsemi for the NEO-PCM2 info - UINT16 *rom = (UINT16 *)ymrom; + uint16_t *rom = (uint16_t *)ymrom; int size = ymsize; if (rom != nullptr) { // swap address lines on the whole ROMs - std::vector buffer(value / 2); + std::vector buffer(value / 2); for (int i = 0; i < size / 2; i += (value / 2)) { @@ -56,9 +56,9 @@ void pcm2_prot_device::decrypt(UINT8* ymrom, UINT32 ymsize, int value) // the later PCM2 games have additional scrambling -void pcm2_prot_device::swap(UINT8* ymrom, UINT32 ymsize, int value) +void pcm2_prot_device::swap(uint8_t* ymrom, uint32_t ymsize, int value) { - static const UINT32 addrs[7][2]={ + static const uint32_t addrs[7][2]={ {0x000000,0xa5000}, {0xffce20,0x01000}, {0xfe2cf6,0x4e001}, @@ -66,7 +66,7 @@ void pcm2_prot_device::swap(UINT8* ymrom, UINT32 ymsize, int value) {0xfeb2c0,0x0a000}, {0xff14ea,0xa7001}, {0xffb440,0x02000}}; - static const UINT8 xordata[7][8]={ + static const uint8_t xordata[7][8]={ {0xf9,0xe0,0x5d,0xf3,0xea,0x92,0xbe,0xef}, {0xc4,0x83,0xa8,0x5f,0x21,0x27,0x64,0xaf}, {0xc3,0xfd,0x81,0xac,0x6d,0xe7,0xbf,0x9e}, @@ -75,9 +75,9 @@ void pcm2_prot_device::swap(UINT8* ymrom, UINT32 ymsize, int value) {0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62}, {0x4b,0xa4,0x63,0x46,0xf0,0x91,0xea,0x62}}; - std::vector buf(0x1000000); + std::vector buf(0x1000000); int j, d; - UINT8* src = ymrom; + uint8_t* src = ymrom; memcpy(&buf[0], src, 0x1000000); for (int i = 0; i < 0x1000000; i++) diff --git a/src/devices/bus/neogeo/prot_pcm2.h b/src/devices/bus/neogeo/prot_pcm2.h index 01909d19ce2..cd06a3e06d8 100644 --- a/src/devices/bus/neogeo/prot_pcm2.h +++ b/src/devices/bus/neogeo/prot_pcm2.h @@ -17,10 +17,10 @@ class pcm2_prot_device : public device_t { public: // construction/destruction - pcm2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pcm2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void decrypt(UINT8* ymrom, UINT32 ymsize, int value); - void swap(UINT8* ymrom, UINT32 ymsize, int value); + void decrypt(uint8_t* ymrom, uint32_t ymsize, int value); + void swap(uint8_t* ymrom, uint32_t ymsize, int value); protected: virtual void device_start() override; diff --git a/src/devices/bus/neogeo/prot_pvc.cpp b/src/devices/bus/neogeo/prot_pvc.cpp index 8abdeb3ceb6..82ca811a111 100644 --- a/src/devices/bus/neogeo/prot_pvc.cpp +++ b/src/devices/bus/neogeo/prot_pvc.cpp @@ -10,7 +10,7 @@ extern const device_type PVC_PROT = &device_creator; -pvc_prot_device::pvc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pvc_prot_device::pvc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PVC_PROT, "Neo Geo PVC Protection", tag, owner, clock, "pvc_prot", __FILE__) {} @@ -30,12 +30,12 @@ void pvc_prot_device::device_reset() void pvc_prot_device::pvc_write_unpack_color() { - UINT16 pen = m_cart_ram[0xff0]; + uint16_t pen = m_cart_ram[0xff0]; - UINT8 b = ((pen & 0x000f) << 1) | ((pen & 0x1000) >> 12); - UINT8 g = ((pen & 0x00f0) >> 3) | ((pen & 0x2000) >> 13); - UINT8 r = ((pen & 0x0f00) >> 7) | ((pen & 0x4000) >> 14); - UINT8 s = (pen & 0x8000) >> 15; + uint8_t b = ((pen & 0x000f) << 1) | ((pen & 0x1000) >> 12); + uint8_t g = ((pen & 0x00f0) >> 3) | ((pen & 0x2000) >> 13); + uint8_t r = ((pen & 0x0f00) >> 7) | ((pen & 0x4000) >> 14); + uint8_t s = (pen & 0x8000) >> 15; m_cart_ram[0xff1] = (g << 8) | b; m_cart_ram[0xff2] = (s << 8) | r; @@ -44,8 +44,8 @@ void pvc_prot_device::pvc_write_unpack_color() void pvc_prot_device::pvc_write_pack_color() { - UINT16 gb = m_cart_ram[0xff4]; - UINT16 sr = m_cart_ram[0xff5]; + uint16_t gb = m_cart_ram[0xff4]; + uint16_t sr = m_cart_ram[0xff5]; m_cart_ram[0xff6] = ((gb & 0x001e) >> 1) | ((gb & 0x1e00) >> 5) | @@ -59,16 +59,16 @@ void pvc_prot_device::pvc_write_pack_color() /*void pvc_prot_device::pvc_write_bankswitch() { - UINT32 bankaddress = ((m_cart_ram[0xff8] >> 8)|(m_cart_ram[0xff9] << 8)); + uint32_t bankaddress = ((m_cart_ram[0xff8] >> 8)|(m_cart_ram[0xff9] << 8)); m_cart_ram[0xff8] = (m_cart_ram[0xff8] & 0xfe00) | 0x00a0; m_cart_ram[0xff9] &= 0x7fff; m_bankdev->neogeo_set_main_cpu_bank_address(bankaddress + 0x100000); } */ -UINT32 pvc_prot_device::get_bank_base() +uint32_t pvc_prot_device::get_bank_base() { - UINT32 bankaddress = ((m_cart_ram[0xff8] >> 8)|(m_cart_ram[0xff9] << 8)); + uint32_t bankaddress = ((m_cart_ram[0xff8] >> 8)|(m_cart_ram[0xff9] << 8)); m_cart_ram[0xff8] = (m_cart_ram[0xff8] & 0xfe00) | 0x00a0; m_cart_ram[0xff9] &= 0x7fff; return bankaddress + 0x100000; @@ -95,12 +95,12 @@ WRITE16_MEMBER( pvc_prot_device::protection_w ) /* kf2k3pcb, kof2003, kof2003h, mslug5 and svc have updated P rom scramble */ -void pvc_prot_device::mslug5_decrypt_68k(UINT8* rom, UINT32 size) +void pvc_prot_device::mslug5_decrypt_68k(uint8_t* rom, uint32_t size) { - static const UINT8 xor1[0x20] = { 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29, 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03 }; - static const UINT8 xor2[0x20] = { 0x36, 0x09, 0xb0, 0x64, 0x95, 0x0f, 0x90, 0x42, 0x6e, 0x0f, 0x30, 0xf6, 0xe5, 0x08, 0x30, 0x64, 0x08, 0x04, 0x00, 0x2f, 0x72, 0x09, 0xa0, 0x13, 0xc9, 0x0b, 0xa0, 0x3e, 0xc2, 0x00, 0x40, 0x2b }; + static const uint8_t xor1[0x20] = { 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29, 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03 }; + static const uint8_t xor2[0x20] = { 0x36, 0x09, 0xb0, 0x64, 0x95, 0x0f, 0x90, 0x42, 0x6e, 0x0f, 0x30, 0xf6, 0xe5, 0x08, 0x30, 0x64, 0x08, 0x04, 0x00, 0x2f, 0x72, 0x09, 0xa0, 0x13, 0xc9, 0x0b, 0xa0, 0x3e, 0xc2, 0x00, 0x40, 0x2b }; int rom_size = 0x800000; - std::vector buf(rom_size); + std::vector buf(rom_size); for (int i = 0; i < 0x100000; i++) rom[i] ^= xor1[(BYTE_XOR_LE(i) % 0x20)]; @@ -110,7 +110,7 @@ void pvc_prot_device::mslug5_decrypt_68k(UINT8* rom, UINT32 size) for (int i = 0x100000; i < 0x0800000; i += 4) { - UINT16 rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; + uint16_t rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; rom16 = BITSWAP16(rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0); rom[BYTE_XOR_LE(i+1)] = rom16 & 0xff; rom[BYTE_XOR_LE(i+2)] = rom16 >> 8; @@ -134,12 +134,12 @@ void pvc_prot_device::mslug5_decrypt_68k(UINT8* rom, UINT32 size) } -void pvc_prot_device::svc_px_decrypt(UINT8* rom, UINT32 size) +void pvc_prot_device::svc_px_decrypt(uint8_t* rom, uint32_t size) { - static const UINT8 xor1[0x20] = { 0x3b, 0x6a, 0xf7, 0xb7, 0xe8, 0xa9, 0x20, 0x99, 0x9f, 0x39, 0x34, 0x0c, 0xc3, 0x9a, 0xa5, 0xc8, 0xb8, 0x18, 0xce, 0x56, 0x94, 0x44, 0xe3, 0x7a, 0xf7, 0xdd, 0x42, 0xf0, 0x18, 0x60, 0x92, 0x9f }; - static const UINT8 xor2[0x20] = { 0x69, 0x0b, 0x60, 0xd6, 0x4f, 0x01, 0x40, 0x1a, 0x9f, 0x0b, 0xf0, 0x75, 0x58, 0x0e, 0x60, 0xb4, 0x14, 0x04, 0x20, 0xe4, 0xb9, 0x0d, 0x10, 0x89, 0xeb, 0x07, 0x30, 0x90, 0x50, 0x0e, 0x20, 0x26 }; + static const uint8_t xor1[0x20] = { 0x3b, 0x6a, 0xf7, 0xb7, 0xe8, 0xa9, 0x20, 0x99, 0x9f, 0x39, 0x34, 0x0c, 0xc3, 0x9a, 0xa5, 0xc8, 0xb8, 0x18, 0xce, 0x56, 0x94, 0x44, 0xe3, 0x7a, 0xf7, 0xdd, 0x42, 0xf0, 0x18, 0x60, 0x92, 0x9f }; + static const uint8_t xor2[0x20] = { 0x69, 0x0b, 0x60, 0xd6, 0x4f, 0x01, 0x40, 0x1a, 0x9f, 0x0b, 0xf0, 0x75, 0x58, 0x0e, 0x60, 0xb4, 0x14, 0x04, 0x20, 0xe4, 0xb9, 0x0d, 0x10, 0x89, 0xeb, 0x07, 0x30, 0x90, 0x50, 0x0e, 0x20, 0x26 }; int rom_size = 0x800000; - std::vector buf(rom_size); + std::vector buf(rom_size); for (int i = 0; i < 0x100000; i++) rom[i] ^= xor1[(BYTE_XOR_LE(i) % 0x20)]; @@ -149,7 +149,7 @@ void pvc_prot_device::svc_px_decrypt(UINT8* rom, UINT32 size) for (int i = 0x100000; i < 0x0800000; i += 4) { - UINT16 rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; + uint16_t rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; rom16 = BITSWAP16(rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0); rom[BYTE_XOR_LE(i+1)] = rom16 & 0xff; rom[BYTE_XOR_LE(i+2)] = rom16 >> 8; @@ -173,11 +173,11 @@ void pvc_prot_device::svc_px_decrypt(UINT8* rom, UINT32 size) } -void pvc_prot_device::kf2k3pcb_decrypt_68k(UINT8* rom, UINT32 size) +void pvc_prot_device::kf2k3pcb_decrypt_68k(uint8_t* rom, uint32_t size) { - static const UINT8 xor2[ 0x20 ] = { 0xb4, 0x0f, 0x40, 0x6c, 0x38, 0x07, 0xd0, 0x3f, 0x53, 0x08, 0x80, 0xaa, 0xbe, 0x07, 0xc0, 0xfa, 0xd0, 0x08, 0x10, 0xd2, 0xf1, 0x03, 0x70, 0x7e, 0x87, 0x0b, 0x40, 0xf6, 0x2a, 0x0a, 0xe0, 0xf9 }; + static const uint8_t xor2[ 0x20 ] = { 0xb4, 0x0f, 0x40, 0x6c, 0x38, 0x07, 0xd0, 0x3f, 0x53, 0x08, 0x80, 0xaa, 0xbe, 0x07, 0xc0, 0xfa, 0xd0, 0x08, 0x10, 0xd2, 0xf1, 0x03, 0x70, 0x7e, 0x87, 0x0b, 0x40, 0xf6, 0x2a, 0x0a, 0xe0, 0xf9 }; int rom_size = 0x900000; - std::vector buf(rom_size); + std::vector buf(rom_size); for (int i = 0; i < 0x100000; i++) rom[0x800000 + i] ^= rom[0x100002 | i]; @@ -187,7 +187,7 @@ void pvc_prot_device::kf2k3pcb_decrypt_68k(UINT8* rom, UINT32 size) for (int i = 0x100000; i < 0x800000; i += 4) { - UINT16 rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; + uint16_t rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; rom16 = BITSWAP16(rom16, 15, 14, 13, 12, 4, 5, 6, 7, 8, 9, 10, 11, 3, 2, 1, 0); rom[BYTE_XOR_LE(i+1)] = rom16 & 0xff; rom[BYTE_XOR_LE(i+2)] = rom16 >> 8; @@ -210,12 +210,12 @@ void pvc_prot_device::kf2k3pcb_decrypt_68k(UINT8* rom, UINT32 size) } -void pvc_prot_device::kof2003_decrypt_68k(UINT8* rom, UINT32 size) +void pvc_prot_device::kof2003_decrypt_68k(uint8_t* rom, uint32_t size) { - static const UINT8 xor1[0x20] = { 0x3b, 0x6a, 0xf7, 0xb7, 0xe8, 0xa9, 0x20, 0x99, 0x9f, 0x39, 0x34, 0x0c, 0xc3, 0x9a, 0xa5, 0xc8, 0xb8, 0x18, 0xce, 0x56, 0x94, 0x44, 0xe3, 0x7a, 0xf7, 0xdd, 0x42, 0xf0, 0x18, 0x60, 0x92, 0x9f }; - static const UINT8 xor2[0x20] = { 0x2f, 0x02, 0x60, 0xbb, 0x77, 0x01, 0x30, 0x08, 0xd8, 0x01, 0xa0, 0xdf, 0x37, 0x0a, 0xf0, 0x65, 0x28, 0x03, 0xd0, 0x23, 0xd3, 0x03, 0x70, 0x42, 0xbb, 0x06, 0xf0, 0x28, 0xba, 0x0f, 0xf0, 0x7a }; + static const uint8_t xor1[0x20] = { 0x3b, 0x6a, 0xf7, 0xb7, 0xe8, 0xa9, 0x20, 0x99, 0x9f, 0x39, 0x34, 0x0c, 0xc3, 0x9a, 0xa5, 0xc8, 0xb8, 0x18, 0xce, 0x56, 0x94, 0x44, 0xe3, 0x7a, 0xf7, 0xdd, 0x42, 0xf0, 0x18, 0x60, 0x92, 0x9f }; + static const uint8_t xor2[0x20] = { 0x2f, 0x02, 0x60, 0xbb, 0x77, 0x01, 0x30, 0x08, 0xd8, 0x01, 0xa0, 0xdf, 0x37, 0x0a, 0xf0, 0x65, 0x28, 0x03, 0xd0, 0x23, 0xd3, 0x03, 0x70, 0x42, 0xbb, 0x06, 0xf0, 0x28, 0xba, 0x0f, 0xf0, 0x7a }; int rom_size = 0x900000; - std::vector buf(rom_size); + std::vector buf(rom_size); for (int i = 0; i < 0x100000; i++) rom[0x800000 + i] ^= rom[0x100002 | i]; @@ -228,7 +228,7 @@ void pvc_prot_device::kof2003_decrypt_68k(UINT8* rom, UINT32 size) for (int i = 0x100000; i < 0x800000; i += 4) { - UINT16 rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; + uint16_t rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; rom16 = BITSWAP16(rom16, 15, 14, 13, 12, 5, 4, 7, 6, 9, 8, 11, 10, 3, 2, 1, 0); rom[BYTE_XOR_LE(i+1)] = rom16 & 0xff; rom[BYTE_XOR_LE(i+2)] = rom16 >> 8; @@ -251,12 +251,12 @@ void pvc_prot_device::kof2003_decrypt_68k(UINT8* rom, UINT32 size) } -void pvc_prot_device::kof2003h_decrypt_68k(UINT8* rom, UINT32 size) +void pvc_prot_device::kof2003h_decrypt_68k(uint8_t* rom, uint32_t size) { - static const UINT8 xor1[0x20] = { 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29, 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03 }; - static const UINT8 xor2[0x20] = { 0x2b, 0x09, 0xd0, 0x7f, 0x51, 0x0b, 0x10, 0x4c, 0x5b, 0x07, 0x70, 0x9d, 0x3e, 0x0b, 0xb0, 0xb6, 0x54, 0x09, 0xe0, 0xcc, 0x3d, 0x0d, 0x80, 0x99, 0x87, 0x03, 0x90, 0x82, 0xfe, 0x04, 0x20, 0x18 }; + static const uint8_t xor1[0x20] = { 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29, 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03 }; + static const uint8_t xor2[0x20] = { 0x2b, 0x09, 0xd0, 0x7f, 0x51, 0x0b, 0x10, 0x4c, 0x5b, 0x07, 0x70, 0x9d, 0x3e, 0x0b, 0xb0, 0xb6, 0x54, 0x09, 0xe0, 0xcc, 0x3d, 0x0d, 0x80, 0x99, 0x87, 0x03, 0x90, 0x82, 0xfe, 0x04, 0x20, 0x18 }; int rom_size = 0x900000; - std::vector buf(rom_size); + std::vector buf(rom_size); for (int i = 0; i < 0x100000; i++) rom[0x800000 + i] ^= rom[0x100002 | i]; @@ -269,7 +269,7 @@ void pvc_prot_device::kof2003h_decrypt_68k(UINT8* rom, UINT32 size) for (int i = 0x100000; i < 0x800000; i += 4) { - UINT16 rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; + uint16_t rom16 = rom[BYTE_XOR_LE(i+1)] | rom[BYTE_XOR_LE(i+2)] << 8; rom16 = BITSWAP16(rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0); rom[BYTE_XOR_LE(i+1)] = rom16 & 0xff; rom[BYTE_XOR_LE(i+2)] = rom16 >> 8; diff --git a/src/devices/bus/neogeo/prot_pvc.h b/src/devices/bus/neogeo/prot_pvc.h index e14983c197a..d5bfee9bf2f 100644 --- a/src/devices/bus/neogeo/prot_pvc.h +++ b/src/devices/bus/neogeo/prot_pvc.h @@ -16,22 +16,22 @@ class pvc_prot_device : public device_t { public: // construction/destruction - pvc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pvc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void pvc_write_unpack_color(); void pvc_write_pack_color(); // void pvc_write_bankswitch(address_space &space); - UINT32 get_bank_base(); + uint32_t get_bank_base(); DECLARE_READ16_MEMBER(protection_r); DECLARE_WRITE16_MEMBER(protection_w); - UINT16 m_cart_ram[0x1000]; + uint16_t m_cart_ram[0x1000]; - void mslug5_decrypt_68k(UINT8* rom, UINT32 size); - void svc_px_decrypt(UINT8* rom, UINT32 size); - void kf2k3pcb_decrypt_68k(UINT8* rom, UINT32 size); - void kof2003_decrypt_68k(UINT8* rom, UINT32 size); - void kof2003h_decrypt_68k(UINT8* rom, UINT32 size); + void mslug5_decrypt_68k(uint8_t* rom, uint32_t size); + void svc_px_decrypt(uint8_t* rom, uint32_t size); + void kf2k3pcb_decrypt_68k(uint8_t* rom, uint32_t size); + void kof2003_decrypt_68k(uint8_t* rom, uint32_t size); + void kof2003h_decrypt_68k(uint8_t* rom, uint32_t size); protected: virtual void device_start() override; diff --git a/src/devices/bus/neogeo/prot_sma.cpp b/src/devices/bus/neogeo/prot_sma.cpp index f18481d51be..9262178be4f 100644 --- a/src/devices/bus/neogeo/prot_sma.cpp +++ b/src/devices/bus/neogeo/prot_sma.cpp @@ -8,7 +8,7 @@ extern const device_type SMA_PROT = &device_creator; -sma_prot_device::sma_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sma_prot_device::sma_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMA_PROT, "Neo Geo SMA Protection", tag, owner, clock, "sma_prot", __FILE__), m_sma_rng(0) {} @@ -201,7 +201,7 @@ WRITE16_MEMBER( sma_prot_device::kof2000_bankswitch_w ) } #endif -UINT32 sma_prot_device::kof99_bank_base(UINT16 sel) +uint32_t sma_prot_device::kof99_bank_base(uint16_t sel) { static const int bankoffset[64] = { @@ -229,7 +229,7 @@ UINT32 sma_prot_device::kof99_bank_base(UINT16 sel) return bankaddress; } -UINT32 sma_prot_device::garou_bank_base(UINT16 sel) +uint32_t sma_prot_device::garou_bank_base(uint16_t sel) { // thanks to Razoola and Mr K for the info static const int bankoffset[64] = @@ -263,7 +263,7 @@ UINT32 sma_prot_device::garou_bank_base(UINT16 sel) return bankaddress; } -UINT32 sma_prot_device::garouh_bank_base(UINT16 sel) +uint32_t sma_prot_device::garouh_bank_base(uint16_t sel) { // thanks to Razoola and Mr K for the info static const int bankoffset[64] = @@ -299,7 +299,7 @@ UINT32 sma_prot_device::garouh_bank_base(UINT16 sel) return bankaddress; } -UINT32 sma_prot_device::mslug3_bank_base(UINT16 sel) +uint32_t sma_prot_device::mslug3_bank_base(uint16_t sel) { // thanks to Razoola and Mr K for the info static const int bankoffset[64] = @@ -332,7 +332,7 @@ UINT32 sma_prot_device::mslug3_bank_base(UINT16 sel) return bankaddress; } -UINT32 sma_prot_device::kof2000_bank_base(UINT16 sel) +uint32_t sma_prot_device::kof2000_bank_base(uint16_t sel) { // thanks to Razoola and Mr K for the info static const int bankoffset[64] = @@ -374,8 +374,8 @@ READ16_MEMBER( sma_prot_device::prot_9a37_r ) READ16_MEMBER( sma_prot_device::random_r ) { - UINT16 old = m_sma_rng; - UINT16 newbit = ((m_sma_rng >> 2) ^ + uint16_t old = m_sma_rng; + uint16_t newbit = ((m_sma_rng >> 2) ^ (m_sma_rng >> 3) ^ (m_sma_rng >> 5) ^ (m_sma_rng >> 6) ^ @@ -391,9 +391,9 @@ READ16_MEMBER( sma_prot_device::random_r ) // kof99, garou, garouh, mslug3 and kof2000 have an SMA chip which contains program code and decrypts the 68k roms -void sma_prot_device::kof99_decrypt_68k(UINT8* base) +void sma_prot_device::kof99_decrypt_68k(uint8_t* base) { - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) @@ -402,38 +402,38 @@ void sma_prot_device::kof99_decrypt_68k(UINT8* base) // swap address lines for the banked part for (int i = 0; i < 0x600000/2; i += 0x800/2) { - UINT16 buffer[0x800/2]; + uint16_t buffer[0x800/2]; memcpy(buffer, &rom[i], 0x800); for (int j = 0; j < 0x800/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,14,13,12,11,10,6,2,4,9,8,3,1,7,0,5)]; } // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int i = 0; i < 0x0c0000/2; i++) rom[i] = rom[0x700000/2 + BITSWAP24(i,23,22,21,20,19,18,11,6,14,17,16,5,8,10,12,0,4,3,2,7,9,15,13,1)]; } -void sma_prot_device::garou_decrypt_68k(UINT8* base) +void sma_prot_device::garou_decrypt_68k(uint8_t* base) { // thanks to Razoola and Mr K for the info - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) rom[i] = BITSWAP16(rom[i],13,12,14,10,8,2,3,1,5,9,11,4,15,0,6,7); // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int i = 0; i < 0x0c0000/2; i++) rom[i] = rom[0x710000/2 + BITSWAP24(i,23,22,21,20,19,18,4,5,16,14,7,9,6,13,17,15,3,1,2,12,11,8,10,0)]; // swap address lines for the banked part - rom = (UINT16 *)(base + 0x100000); + rom = (uint16_t *)(base + 0x100000); for (int i = 0; i < 0x800000/2; i += 0x8000/2) { - UINT16 buffer[0x8000/2]; + uint16_t buffer[0x8000/2]; memcpy(buffer, &rom[i], 0x8000); for (int j = 0; j < 0x8000/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,14,9,4,8,3,13,6,2,7,0,12,1,11,10,5)]; @@ -441,25 +441,25 @@ void sma_prot_device::garou_decrypt_68k(UINT8* base) } -void sma_prot_device::garouh_decrypt_68k(UINT8* base) +void sma_prot_device::garouh_decrypt_68k(uint8_t* base) { // thanks to Razoola and Mr K for the info - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) rom[i] = BITSWAP16(rom[i],14,5,1,11,7,4,10,15,3,12,8,13,0,2,9,6); // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int i = 0; i < 0x0c0000/2; i++) rom[i] = rom[0x7f8000/2 + BITSWAP24(i,23,22,21,20,19,18,5,16,11,2,6,7,17,3,12,8,14,4,0,9,1,10,15,13)]; // swap address lines for the banked part - rom = (UINT16 *)(base + 0x100000); + rom = (uint16_t *)(base + 0x100000); for (int i = 0; i < 0x800000/2; i += 0x8000/2) { - UINT16 buffer[0x8000/2]; + uint16_t buffer[0x8000/2]; memcpy(buffer, &rom[i], 0x8000); for (int j = 0; j < 0x8000/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,14,12,8,1,7,11,3,13,10,6,9,5,4,0,2)]; @@ -467,25 +467,25 @@ void sma_prot_device::garouh_decrypt_68k(UINT8* base) } -void sma_prot_device::mslug3_decrypt_68k(UINT8* base) +void sma_prot_device::mslug3_decrypt_68k(uint8_t* base) { // thanks to Razoola and Mr K for the info - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) rom[i] = BITSWAP16(rom[i],4,11,14,3,1,13,0,7,2,8,12,15,10,9,5,6); // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int i = 0; i < 0x0c0000/2; i++) rom[i] = rom[0x5d0000/2 + BITSWAP24(i,23,22,21,20,19,18,15,2,1,13,3,0,9,6,16,4,11,5,7,12,17,14,10,8)]; // swap address lines for the banked part - rom = (UINT16 *)(base + 0x100000); + rom = (uint16_t *)(base + 0x100000); for (int i = 0; i < 0x800000/2; i += 0x10000/2) { - UINT16 buffer[0x10000/2]; + uint16_t buffer[0x10000/2]; memcpy(buffer, &rom[i], 0x10000); for (int j = 0; j < 0x10000/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,2,11,0,14,6,4,13,8,9,3,10,7,5,12,1)]; @@ -493,10 +493,10 @@ void sma_prot_device::mslug3_decrypt_68k(UINT8* base) } -void sma_prot_device::kof2000_decrypt_68k(UINT8* base) +void sma_prot_device::kof2000_decrypt_68k(uint8_t* base) { // thanks to Razoola and Mr K for the info - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) @@ -505,14 +505,14 @@ void sma_prot_device::kof2000_decrypt_68k(UINT8* base) // swap address lines for the banked part for (int i = 0; i < 0x63a000/2; i += 0x800/2) { - UINT16 buffer[0x800/2]; + uint16_t buffer[0x800/2]; memcpy(buffer, &rom[i], 0x800); for (int j = 0; j < 0x800/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,14,13,12,11,10,4,1,3,8,6,2,7,0,9,5)]; } // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int i = 0; i < 0x0c0000/2; i++) rom[i] = rom[0x73a000/2 + BITSWAP24(i,23,22,21,20,19,18,8,4,15,13,3,14,16,2,6,17,7,12,10,0,5,11,1,9)]; } diff --git a/src/devices/bus/neogeo/prot_sma.h b/src/devices/bus/neogeo/prot_sma.h index 1e0053ede42..1cb7d7d9e4c 100644 --- a/src/devices/bus/neogeo/prot_sma.h +++ b/src/devices/bus/neogeo/prot_sma.h @@ -17,7 +17,7 @@ class sma_prot_device : public device_t { public: // construction/destruction - sma_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sma_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); //DECLARE_WRITE16_MEMBER( kof99_bankswitch_w ); //DECLARE_WRITE16_MEMBER( garou_bankswitch_w ); @@ -26,23 +26,23 @@ public: //DECLARE_WRITE16_MEMBER( kof2000_bankswitch_w ); DECLARE_READ16_MEMBER( prot_9a37_r ); DECLARE_READ16_MEMBER( random_r ); - UINT32 kof99_bank_base(UINT16 sel); - UINT32 garou_bank_base(UINT16 sel); - UINT32 garouh_bank_base(UINT16 sel); - UINT32 mslug3_bank_base(UINT16 sel); - UINT32 kof2000_bank_base(UINT16 sel); - void kof99_decrypt_68k(UINT8* base); - void garou_decrypt_68k(UINT8* base); - void garouh_decrypt_68k(UINT8* base); - void mslug3_decrypt_68k(UINT8* base); - void kof2000_decrypt_68k(UINT8* base); + uint32_t kof99_bank_base(uint16_t sel); + uint32_t garou_bank_base(uint16_t sel); + uint32_t garouh_bank_base(uint16_t sel); + uint32_t mslug3_bank_base(uint16_t sel); + uint32_t kof2000_bank_base(uint16_t sel); + void kof99_decrypt_68k(uint8_t* base); + void garou_decrypt_68k(uint8_t* base); + void garouh_decrypt_68k(uint8_t* base); + void mslug3_decrypt_68k(uint8_t* base); + void kof2000_decrypt_68k(uint8_t* base); protected: virtual void device_start() override; virtual void device_reset() override; private: - UINT16 m_sma_rng; + uint16_t m_sma_rng; }; #endif diff --git a/src/devices/bus/neogeo/pvc.cpp b/src/devices/bus/neogeo/pvc.cpp index fbf2cc9b2d8..4787aee080f 100644 --- a/src/devices/bus/neogeo/pvc.cpp +++ b/src/devices/bus/neogeo/pvc.cpp @@ -19,14 +19,14 @@ const device_type NEOGEO_PVC_CART = &device_creator; -neogeo_pvc_cart::neogeo_pvc_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source) : +neogeo_pvc_cart::neogeo_pvc_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source) : neogeo_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot"), m_pvc_prot(*this, "pvc_prot") {} -neogeo_pvc_cart::neogeo_pvc_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_pvc_cart::neogeo_pvc_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_PVC_CART, "Neo Geo PVC Cart", tag, owner, clock, "neocart_pvc", __FILE__), m_cmc_prot(*this, "cmc_prot"), m_pcm2_prot(*this, "pcm2_prot"), @@ -71,7 +71,7 @@ machine_config_constructor neogeo_pvc_cart::device_mconfig_additions() const const device_type NEOGEO_PVC_MSLUG5_CART = &device_creator; -neogeo_pvc_mslug5_cart::neogeo_pvc_mslug5_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_pvc_mslug5_cart::neogeo_pvc_mslug5_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_pvc_cart(mconfig, NEOGEO_PVC_MSLUG5_CART, "Neo Geo Metal Slug 5 PVC Cart", tag, owner, clock, "neocart_mslug5", __FILE__) {} void neogeo_pvc_mslug5_cart::decrypt_all(DECRYPT_ALL_PARAMS) @@ -89,7 +89,7 @@ void neogeo_pvc_mslug5_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_PVC_SVC_CART = &device_creator; -neogeo_pvc_svc_cart::neogeo_pvc_svc_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_pvc_svc_cart::neogeo_pvc_svc_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_pvc_cart(mconfig, NEOGEO_PVC_SVC_CART, "Neo Geo SNK vs Capcom PVC Cart", tag, owner, clock, "neocart_svc", __FILE__) {} @@ -109,7 +109,7 @@ void neogeo_pvc_svc_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_PVC_KOF2003_CART = &device_creator; -neogeo_pvc_kof2003_cart::neogeo_pvc_kof2003_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_pvc_kof2003_cart::neogeo_pvc_kof2003_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_pvc_cart(mconfig, NEOGEO_PVC_KOF2003_CART, "Neo Geo KOF 2003 PVC Cart", tag, owner, clock, "neocart_kof2003", __FILE__) {} @@ -128,7 +128,7 @@ void neogeo_pvc_kof2003_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_PVC_KOF2003H_CART = &device_creator; -neogeo_pvc_kof2003h_cart::neogeo_pvc_kof2003h_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_pvc_kof2003h_cart::neogeo_pvc_kof2003h_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_pvc_cart(mconfig, NEOGEO_PVC_KOF2003H_CART, "Neo Geo KOF 2003 AES PVC Cart", tag, owner, clock, "neocart_kof2003h", __FILE__) {} diff --git a/src/devices/bus/neogeo/pvc.h b/src/devices/bus/neogeo/pvc.h index 6dcf17479c4..064efef717a 100644 --- a/src/devices/bus/neogeo/pvc.h +++ b/src/devices/bus/neogeo/pvc.h @@ -15,8 +15,8 @@ class neogeo_pvc_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_pvc_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source); - neogeo_pvc_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_pvc_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source); + neogeo_pvc_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; @@ -24,7 +24,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const override; // reading and writing - virtual UINT32 get_bank_base(UINT16 sel) override { return m_pvc_prot->get_bank_base(); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_pvc_prot->get_bank_base(); } virtual DECLARE_READ16_MEMBER(protection_r) override { return m_pvc_prot->protection_r(space, offset, mem_mask); } virtual DECLARE_WRITE16_MEMBER(protection_w) override { m_pvc_prot->protection_w(space, offset, data, mem_mask); } @@ -48,7 +48,7 @@ extern const device_type NEOGEO_PVC_CART; class neogeo_pvc_mslug5_cart : public neogeo_pvc_cart { public: - neogeo_pvc_mslug5_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_pvc_mslug5_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } }; @@ -63,7 +63,7 @@ extern const device_type NEOGEO_PVC_MSLUG5_CART; class neogeo_pvc_svc_cart : public neogeo_pvc_cart { public: - neogeo_pvc_svc_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_pvc_svc_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 2; } }; @@ -78,7 +78,7 @@ extern const device_type NEOGEO_PVC_SVC_CART; class neogeo_pvc_kof2003_cart : public neogeo_pvc_cart { public: - neogeo_pvc_kof2003_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_pvc_kof2003_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 2; } }; @@ -93,7 +93,7 @@ extern const device_type NEOGEO_PVC_KOF2003_CART; class neogeo_pvc_kof2003h_cart : public neogeo_pvc_cart { public: - neogeo_pvc_kof2003h_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_pvc_kof2003h_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 2; } }; diff --git a/src/devices/bus/neogeo/rom.cpp b/src/devices/bus/neogeo/rom.cpp index 9804ba89e2c..ddfdb18213d 100644 --- a/src/devices/bus/neogeo/rom.cpp +++ b/src/devices/bus/neogeo/rom.cpp @@ -20,12 +20,12 @@ const device_type NEOGEO_ROM = &device_creator; -neogeo_rom_device::neogeo_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source) : +neogeo_rom_device::neogeo_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_neogeo_cart_interface(mconfig, *this) {} -neogeo_rom_device::neogeo_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_rom_device::neogeo_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : device_t(mconfig, NEOGEO_ROM, "Neo Geo Standard Carts", tag, owner, clock, "neocart_rom", __FILE__), device_neogeo_cart_interface(mconfig, *this) {} @@ -52,7 +52,7 @@ READ16_MEMBER(neogeo_rom_device::rom_r) { // to speed up access to ROM, the access to ROM are actually replaced in the driver // by accesses to the maincpu rom region, where we have anyway copied the rom content - UINT16* rom = (get_rom_size()) ? get_rom_base() : get_region_rom_base(); + uint16_t* rom = (get_rom_size()) ? get_rom_base() : get_region_rom_base(); return rom[offset]; } @@ -71,7 +71,7 @@ WRITE16_MEMBER(neogeo_rom_device::banksel_w) const device_type NEOGEO_VLINER_CART = &device_creator; -neogeo_vliner_cart::neogeo_vliner_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_vliner_cart::neogeo_vliner_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_rom_device(mconfig, NEOGEO_VLINER_CART, "Neo Geo V-Liner Cart", tag, owner, clock, "neocart_vliner", __FILE__) {} diff --git a/src/devices/bus/neogeo/rom.h b/src/devices/bus/neogeo/rom.h index 99609e2d198..600db5cc7fe 100644 --- a/src/devices/bus/neogeo/rom.h +++ b/src/devices/bus/neogeo/rom.h @@ -12,8 +12,8 @@ class neogeo_rom_device : public device_t, { public: // construction/destruction - neogeo_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source); - neogeo_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source); + neogeo_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; @@ -38,7 +38,7 @@ extern const device_type NEOGEO_ROM; class neogeo_vliner_cart : public neogeo_rom_device { public: - neogeo_vliner_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_vliner_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER(ram_r) override { return m_cart_ram[offset]; } virtual DECLARE_WRITE16_MEMBER(ram_w) override { COMBINE_DATA(&m_cart_ram[offset]); } @@ -49,7 +49,7 @@ public: virtual void device_reset() override; private: - UINT16 m_cart_ram[0x1000]; + uint16_t m_cart_ram[0x1000]; }; extern const device_type NEOGEO_VLINER_CART; diff --git a/src/devices/bus/neogeo/sbp.cpp b/src/devices/bus/neogeo/sbp.cpp index 805aeff1214..5947bab07da 100644 --- a/src/devices/bus/neogeo/sbp.cpp +++ b/src/devices/bus/neogeo/sbp.cpp @@ -16,7 +16,7 @@ extern const device_type NEOGEO_SBP_CART = &device_creator; -neogeo_sbp_cart::neogeo_sbp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_sbp_cart::neogeo_sbp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_rom_device(mconfig, NEOGEO_SBP_CART, "Neo Geo Super Bubble Pop Cart", tag, owner, clock, "neocart_sbp", __FILE__) {} @@ -33,9 +33,9 @@ void neogeo_sbp_cart::device_reset() READ16_MEMBER( neogeo_sbp_cart::protection_r ) { - UINT16* rom = (get_rom_size()) ? get_rom_base() : get_region_rom_base(); - UINT16 origdata = rom[offset + (0x200/2)]; - UINT16 data = BITSWAP16(origdata, 11,10,9,8,15,14,13,12,3,2,1,0,7,6,5,4); + uint16_t* rom = (get_rom_size()) ? get_rom_base() : get_region_rom_base(); + uint16_t origdata = rom[offset + (0x200/2)]; + uint16_t data = BITSWAP16(origdata, 11,10,9,8,15,14,13,12,3,2,1,0,7,6,5,4); int realoffset = 0x200 + (offset * 2); logerror("sbp_lowerrom_r offset %08x data %04x\n", realoffset, data); @@ -71,10 +71,10 @@ WRITE16_MEMBER( neogeo_sbp_cart::protection_w ) } -void neogeo_sbp_cart::patch(UINT8* cpurom, UINT32 cpurom_size) +void neogeo_sbp_cart::patch(uint8_t* cpurom, uint32_t cpurom_size) { /* the game code clears the text overlay used ingame immediately after writing it.. why? protection? sloppy code that the hw ignores? imperfect emulation? */ - UINT16* rom = (UINT16*)cpurom; + uint16_t* rom = (uint16_t*)cpurom; rom[0x2a6f8/2] = 0x4e71; rom[0x2a6fa/2] = 0x4e71; diff --git a/src/devices/bus/neogeo/sbp.h b/src/devices/bus/neogeo/sbp.h index a46fef86ecf..e6cf0e9aa77 100644 --- a/src/devices/bus/neogeo/sbp.h +++ b/src/devices/bus/neogeo/sbp.h @@ -15,7 +15,7 @@ class neogeo_sbp_cart : public neogeo_rom_device { public: - neogeo_sbp_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_sbp_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; @@ -26,7 +26,7 @@ public: virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 0; } - void patch(UINT8* cpurom, UINT32 cpurom_size); + void patch(uint8_t* cpurom, uint32_t cpurom_size); }; extern const device_type NEOGEO_SBP_CART; diff --git a/src/devices/bus/neogeo/slot.cpp b/src/devices/bus/neogeo/slot.cpp index f8664001112..6c1f1906039 100644 --- a/src/devices/bus/neogeo/slot.cpp +++ b/src/devices/bus/neogeo/slot.cpp @@ -39,13 +39,13 @@ device_neogeo_cart_interface::~device_neogeo_cart_interface() { } -UINT32 device_neogeo_cart_interface::get_region_mask(UINT8* rgn, UINT32 rgn_size) +uint32_t device_neogeo_cart_interface::get_region_mask(uint8_t* rgn, uint32_t rgn_size) { // get mask based on the length rounded up to the nearest power of 2 - UINT32 mask = 0xffffffff; - UINT32 len = rgn_size; + uint32_t mask = 0xffffffff; + uint32_t len = rgn_size; - for (UINT32 bit = 0x80000000; bit != 0; bit >>= 1) + for (uint32_t bit = 0x80000000; bit != 0; bit >>= 1) { if ((len * 2 - 1) & bit) break; @@ -56,14 +56,14 @@ UINT32 device_neogeo_cart_interface::get_region_mask(UINT8* rgn, UINT32 rgn_size return mask; } -void device_neogeo_cart_interface::optimize_sprites(UINT8* region_sprites, UINT32 region_sprites_size) +void device_neogeo_cart_interface::optimize_sprites(uint8_t* region_sprites, uint32_t region_sprites_size) { // convert the sprite graphics data into a format that allows faster blitting - UINT32 spritegfx_address_mask = get_region_mask(region_sprites, region_sprites_size); - UINT8 *src = region_sprites; + uint32_t spritegfx_address_mask = get_region_mask(region_sprites, region_sprites_size); + uint8_t *src = region_sprites; m_sprites_opt.resize(spritegfx_address_mask + 1); - UINT8 *dest = &m_sprites_opt[0]; + uint8_t *dest = &m_sprites_opt[0]; for (unsigned i = 0; i < region_sprites_size; i += 0x80, src += 0x80) { @@ -96,7 +96,7 @@ void device_neogeo_cart_interface::optimize_sprites(UINT8* region_sprites, UINT3 //------------------------------------------------- // neogeo_cart_slot_device - constructor //------------------------------------------------- -neogeo_cart_slot_device::neogeo_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_cart_slot_device::neogeo_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : device_t(mconfig, NEOGEO_CART_SLOT, "Neo Geo Cartridge Slot", tag, owner, clock, "neogeo_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -240,9 +240,9 @@ image_init_result neogeo_cart_slot_device::call_load() { if (software_entry() != nullptr) { - UINT16 *ROM16; - UINT8 *ROM8; - UINT32 len; + uint16_t *ROM16; + uint8_t *ROM8; + uint32_t len; const char *pcb_name = get_feature("slot"); if (pcb_name) @@ -302,7 +302,7 @@ image_init_result neogeo_cart_slot_device::call_load() } m_cart->decrypt_all( - (UINT8*)m_cart->get_rom_base(), m_cart->get_rom_size(), + (uint8_t*)m_cart->get_rom_base(), m_cart->get_rom_size(), m_cart->get_sprites_base(), m_cart->get_sprites_size(), m_cart->get_fixed_base(), m_cart->get_fixed_size(), m_cart->get_ym_base(), m_cart->get_ym_size(), diff --git a/src/devices/bus/neogeo/slot.h b/src/devices/bus/neogeo/slot.h index 83de22b0a4b..a2413d81589 100644 --- a/src/devices/bus/neogeo/slot.h +++ b/src/devices/bus/neogeo/slot.h @@ -81,7 +81,7 @@ enum // ======================> device_neogeo_cart_interface #define DECRYPT_ALL_PARAMS \ - UINT8* cpuregion, UINT32 cpuregion_size,UINT8* spr_region, UINT32 spr_region_size,UINT8* fix_region, UINT32 fix_region_size,UINT8* ym_region, UINT32 ym_region_size,UINT8* ymdelta_region, UINT32 ymdelta_region_size,UINT8* audiocpu_region, UINT32 audio_region_size, UINT8* audiocrypt_region, UINT32 audiocrypt_region_size + uint8_t* cpuregion, uint32_t cpuregion_size,uint8_t* spr_region, uint32_t spr_region_size,uint8_t* fix_region, uint32_t fix_region_size,uint8_t* ym_region, uint32_t ym_region_size,uint8_t* ymdelta_region, uint32_t ymdelta_region_size,uint8_t* audiocpu_region, uint32_t audio_region_size, uint8_t* audiocrypt_region, uint32_t audiocrypt_region_size class device_neogeo_cart_interface : public device_slot_card_interface { @@ -98,73 +98,73 @@ public: virtual DECLARE_READ16_MEMBER(protection_r) { return 0xffff; } virtual DECLARE_WRITE16_MEMBER(protection_w) { }; virtual DECLARE_READ16_MEMBER(addon_r) { return 0xffff; } - virtual UINT32 get_bank_base(UINT16 sel) { return 0; } - virtual UINT32 get_special_bank() { return 0; } - virtual UINT16 get_helper() { return 0; } + virtual uint32_t get_bank_base(uint16_t sel) { return 0; } + virtual uint32_t get_special_bank() { return 0; } + virtual uint16_t get_helper() { return 0; } virtual void decrypt_all(DECRYPT_ALL_PARAMS) { }; virtual int get_fixed_bank_type(void) { return 0; } - void rom_alloc(UINT32 size) { m_rom.resize(size/sizeof(UINT16)); } - UINT16* get_rom_base() { return &m_rom[0]; } - UINT32 get_rom_size() { return m_rom.size() * sizeof(UINT16); } - UINT16* get_region_rom_base() { if (m_region_rom.found()) return &m_region_rom->u16(0); return nullptr; } - UINT32 get_region_rom_size() { if (m_region_rom.found()) return m_region_rom->bytes(); return 0; } - - void fixed_alloc(UINT32 size) { m_fixed.resize(size); } - UINT8* get_fixed_base() { return &m_fixed[0]; } - UINT32 get_fixed_size() { return m_fixed.size(); } - UINT8* get_region_fixed_base() { if (m_region_fixed.found()) return m_region_fixed->base(); return nullptr; } - UINT32 get_region_fixed_size() { if (m_region_fixed.found()) return m_region_fixed->bytes(); return 0; } - - void audio_alloc(UINT32 size) { m_audio.resize(size); } - UINT8* get_audio_base() { return &m_audio[0]; } - UINT32 get_audio_size() { return m_audio.size(); } - UINT8* get_region_audio_base() { if (m_region_audio.found()) return m_region_audio->base(); return nullptr; } - UINT32 get_region_audio_size() { if (m_region_audio.found()) return m_region_audio->bytes(); return 0; } - - void audiocrypt_alloc(UINT32 size) { m_audiocrypt.resize(size); } - UINT8* get_audiocrypt_base() { if (m_audiocrypt.size() == 0) return nullptr; else return &m_audiocrypt[0]; } - UINT32 get_audiocrypt_size() { return m_audiocrypt.size(); } - UINT8* get_region_audiocrypt_base() { if (m_region_audiocrypt.found()) return m_region_audiocrypt->base(); return nullptr; } - UINT32 get_region_audiocrypt_size() { if (m_region_audiocrypt.found()) return m_region_audiocrypt->bytes(); return 0; } + void rom_alloc(uint32_t size) { m_rom.resize(size/sizeof(uint16_t)); } + uint16_t* get_rom_base() { return &m_rom[0]; } + uint32_t get_rom_size() { return m_rom.size() * sizeof(uint16_t); } + uint16_t* get_region_rom_base() { if (m_region_rom.found()) return &m_region_rom->u16(0); return nullptr; } + uint32_t get_region_rom_size() { if (m_region_rom.found()) return m_region_rom->bytes(); return 0; } + + void fixed_alloc(uint32_t size) { m_fixed.resize(size); } + uint8_t* get_fixed_base() { return &m_fixed[0]; } + uint32_t get_fixed_size() { return m_fixed.size(); } + uint8_t* get_region_fixed_base() { if (m_region_fixed.found()) return m_region_fixed->base(); return nullptr; } + uint32_t get_region_fixed_size() { if (m_region_fixed.found()) return m_region_fixed->bytes(); return 0; } + + void audio_alloc(uint32_t size) { m_audio.resize(size); } + uint8_t* get_audio_base() { return &m_audio[0]; } + uint32_t get_audio_size() { return m_audio.size(); } + uint8_t* get_region_audio_base() { if (m_region_audio.found()) return m_region_audio->base(); return nullptr; } + uint32_t get_region_audio_size() { if (m_region_audio.found()) return m_region_audio->bytes(); return 0; } + + void audiocrypt_alloc(uint32_t size) { m_audiocrypt.resize(size); } + uint8_t* get_audiocrypt_base() { if (m_audiocrypt.size() == 0) return nullptr; else return &m_audiocrypt[0]; } + uint32_t get_audiocrypt_size() { return m_audiocrypt.size(); } + uint8_t* get_region_audiocrypt_base() { if (m_region_audiocrypt.found()) return m_region_audiocrypt->base(); return nullptr; } + uint32_t get_region_audiocrypt_size() { if (m_region_audiocrypt.found()) return m_region_audiocrypt->bytes(); return 0; } // TODO: review sprite code later!! - void sprites_alloc(UINT32 size) { m_sprites.resize(size); } - UINT8* get_sprites_base() { return &m_sprites[0]; } - UINT32 get_sprites_size() { return m_sprites.size(); } - UINT8* get_region_sprites_base() { if (m_region_spr.found()) return m_region_spr->base(); return nullptr; } - UINT32 get_region_sprites_size() { if (m_region_spr.found()) return m_region_spr->bytes(); return 0; } - - void ym_alloc(UINT32 size) { m_ym.resize(size); } - UINT8* get_ym_base() { return &m_ym[0]; } - UINT32 get_ym_size() { return m_ym.size(); } - UINT8* get_region_ym_base() { if (m_region_ym.found()) return m_region_ym->base(); return nullptr; } - UINT32 get_region_ym_size() { if (m_region_ym.found()) return m_region_ym->bytes(); return 0; } - - void ymdelta_alloc(UINT32 size) { m_ymdelta.resize(size); } - UINT8* get_ymdelta_base() { return &m_ymdelta[0]; } - UINT32 get_ymdelta_size() { return m_ymdelta.size(); } - UINT8* get_region_ymdelta_base() { if (m_region_ymd.found()) return m_region_ymd->base(); return nullptr; } - UINT32 get_region_ymdelta_size() { if (m_region_ymd.found()) return m_region_ymd->bytes(); return 0; } + void sprites_alloc(uint32_t size) { m_sprites.resize(size); } + uint8_t* get_sprites_base() { return &m_sprites[0]; } + uint32_t get_sprites_size() { return m_sprites.size(); } + uint8_t* get_region_sprites_base() { if (m_region_spr.found()) return m_region_spr->base(); return nullptr; } + uint32_t get_region_sprites_size() { if (m_region_spr.found()) return m_region_spr->bytes(); return 0; } + + void ym_alloc(uint32_t size) { m_ym.resize(size); } + uint8_t* get_ym_base() { return &m_ym[0]; } + uint32_t get_ym_size() { return m_ym.size(); } + uint8_t* get_region_ym_base() { if (m_region_ym.found()) return m_region_ym->base(); return nullptr; } + uint32_t get_region_ym_size() { if (m_region_ym.found()) return m_region_ym->bytes(); return 0; } + + void ymdelta_alloc(uint32_t size) { m_ymdelta.resize(size); } + uint8_t* get_ymdelta_base() { return &m_ymdelta[0]; } + uint32_t get_ymdelta_size() { return m_ymdelta.size(); } + uint8_t* get_region_ymdelta_base() { if (m_region_ymd.found()) return m_region_ymd->base(); return nullptr; } + uint32_t get_region_ymdelta_size() { if (m_region_ymd.found()) return m_region_ymd->bytes(); return 0; } // this is only used to setup optimized sprites when loading on multi-slot drivers from softlist // therefore, we do not need a separate region accessor! - UINT8* get_sprites_opt_base() { return &m_sprites_opt[0]; } - UINT32 get_sprites_opt_size() { return m_sprites_opt.size(); } - void optimize_sprites(UINT8* region_sprites, UINT32 region_sprites_size); + uint8_t* get_sprites_opt_base() { return &m_sprites_opt[0]; } + uint32_t get_sprites_opt_size() { return m_sprites_opt.size(); } + void optimize_sprites(uint8_t* region_sprites, uint32_t region_sprites_size); protected: // these are allocated when loading from softlist - std::vector m_rom; - std::vector m_fixed; - std::vector m_audio; - std::vector m_sprites; - std::vector m_ym; - std::vector m_ymdelta; - std::vector m_audiocrypt; + std::vector m_rom; + std::vector m_fixed; + std::vector m_audio; + std::vector m_sprites; + std::vector m_ym; + std::vector m_ymdelta; + std::vector m_audiocrypt; - std::vector m_sprites_opt; + std::vector m_sprites_opt; // these replace m_rom, etc. above for non-user configurable carts! optional_memory_region m_region_rom; @@ -175,7 +175,7 @@ protected: optional_memory_region m_region_ym; optional_memory_region m_region_ymd; - UINT32 get_region_mask(UINT8* rgn, UINT32 rgn_size); + uint32_t get_region_mask(uint8_t* rgn, uint32_t rgn_size); }; @@ -187,7 +187,7 @@ class neogeo_cart_slot_device : public device_t, { public: // construction/destruction - neogeo_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); virtual ~neogeo_cart_slot_device(); // device-level overrides @@ -223,105 +223,105 @@ public: void set_cart_type(const char *slot); int get_type() { return m_type; } - UINT16* get_rom_base() { + uint16_t* get_rom_base() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_rom_base(); else return m_cart->get_rom_base(); } return nullptr; } - UINT32 get_rom_size() { + uint32_t get_rom_size() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_rom_size(); else return m_cart->get_rom_size(); } return 0; } - UINT8* get_fixed_base() { + uint8_t* get_fixed_base() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_fixed_base(); else return m_cart->get_fixed_base(); } return nullptr; } - UINT32 get_fixed_size() { + uint32_t get_fixed_size() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_fixed_size(); else return m_cart->get_fixed_size(); } return 0; } - UINT8* get_sprites_base() { + uint8_t* get_sprites_base() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_sprites_base(); else return m_cart->get_sprites_base(); } return nullptr; } - UINT32 get_sprites_size() { + uint32_t get_sprites_size() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_sprites_size(); else return m_cart->get_sprites_size(); } return 0; } - UINT8* get_audio_base() { + uint8_t* get_audio_base() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_audio_base(); else return m_cart->get_audio_base(); } return nullptr; } - UINT32 get_audio_size() { + uint32_t get_audio_size() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_audio_size(); else return m_cart->get_audio_size(); } return 0; } - UINT8* get_audiocrypt_base() { + uint8_t* get_audiocrypt_base() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_audiocrypt_base(); else return m_cart->get_audiocrypt_base(); } return nullptr; } - UINT32 get_audiocrypt_size() { + uint32_t get_audiocrypt_size() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_audiocrypt_size(); else return m_cart->get_audiocrypt_size(); } return 0; } - UINT8* get_ym_base() { + uint8_t* get_ym_base() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_ym_base(); else return m_cart->get_ym_base(); } return nullptr; } - UINT32 get_ym_size() { + uint32_t get_ym_size() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_ym_size(); else return m_cart->get_ym_size(); } return 0; } - UINT8* get_ymdelta_base() { + uint8_t* get_ymdelta_base() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_ymdelta_base(); else return m_cart->get_ymdelta_base(); } return nullptr; } - UINT32 get_ymdelta_size() { + uint32_t get_ymdelta_size() { if (m_cart) { if (!user_loadable()) return m_cart->get_region_ymdelta_size(); else return m_cart->get_ymdelta_size(); } return 0; } - UINT8* get_sprites_opt_base() { + uint8_t* get_sprites_opt_base() { if (m_cart) return m_cart->get_sprites_opt_base(); else return nullptr; } - UINT32 get_sprites_opt_size() { + uint32_t get_sprites_opt_size() { if (m_cart) return m_cart->get_sprites_opt_size(); else return 0; } int get_fixed_bank_type(void) { if (m_cart) return m_cart->get_fixed_bank_type(); return 0; } - UINT32 get_bank_base(UINT16 sel) { if (m_cart) return m_cart->get_bank_base(sel); return 0; } - UINT32 get_special_bank() { if (m_cart) return m_cart->get_special_bank(); return 0; } - UINT16 get_helper() { if (m_cart) return m_cart->get_helper(); return 0; } + uint32_t get_bank_base(uint16_t sel) { if (m_cart) return m_cart->get_bank_base(sel); return 0; } + uint32_t get_special_bank() { if (m_cart) return m_cart->get_special_bank(); return 0; } + uint16_t get_helper() { if (m_cart) return m_cart->get_helper(); return 0; } void late_decrypt_all() { if (m_cart) m_cart->decrypt_all( - (UINT8*)get_rom_base(), get_rom_size(), + (uint8_t*)get_rom_base(), get_rom_size(), get_sprites_base(), get_sprites_size(), get_fixed_base(), get_fixed_size(), get_ym_base(), get_ym_size(), diff --git a/src/devices/bus/neogeo/sma.cpp b/src/devices/bus/neogeo/sma.cpp index d63d3b2bfbf..f376297b24d 100644 --- a/src/devices/bus/neogeo/sma.cpp +++ b/src/devices/bus/neogeo/sma.cpp @@ -19,13 +19,13 @@ const device_type NEOGEO_SMA_CART = &device_creator; -neogeo_sma_cart::neogeo_sma_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source) : +neogeo_sma_cart::neogeo_sma_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source) : neogeo_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_sma_prot(*this, "sma_prot"), m_cmc_prot(*this, "cmc_prot") {} -neogeo_sma_cart::neogeo_sma_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) : +neogeo_sma_cart::neogeo_sma_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock) : neogeo_rom_device(mconfig, NEOGEO_SMA_CART, "Neo Geo SMA Cart", tag, owner, clock, "neocart_sma", __FILE__), m_sma_prot(*this, "sma_prot"), m_cmc_prot(*this, "cmc_prot") @@ -66,7 +66,7 @@ machine_config_constructor neogeo_sma_cart::device_mconfig_additions() const const device_type NEOGEO_SMA_KOF99_CART = &device_creator; -neogeo_sma_kof99_cart::neogeo_sma_kof99_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_sma_kof99_cart::neogeo_sma_kof99_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_sma_cart(mconfig, NEOGEO_SMA_KOF99_CART, "Neo Geo KOF 99 SMA Cart", tag, owner, clock, "neocart_kof99", __FILE__) {} @@ -84,7 +84,7 @@ void neogeo_sma_kof99_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_SMA_GAROU_CART = &device_creator; -neogeo_sma_garou_cart::neogeo_sma_garou_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_sma_garou_cart::neogeo_sma_garou_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_sma_cart(mconfig, NEOGEO_SMA_GAROU_CART, "Neo Geo Garou SMA Cart", tag, owner, clock, "neocart_garou", __FILE__) {} @@ -102,7 +102,7 @@ void neogeo_sma_garou_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_SMA_GAROUH_CART = &device_creator; -neogeo_sma_garouh_cart::neogeo_sma_garouh_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_sma_garouh_cart::neogeo_sma_garouh_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_sma_cart(mconfig, NEOGEO_SMA_GAROUH_CART, "Neo Geo Garou AES SMA Cart", tag, owner, clock, "neocart_garouh", __FILE__) {} @@ -120,7 +120,7 @@ void neogeo_sma_garouh_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_SMA_MSLUG3_CART = &device_creator; -neogeo_sma_mslug3_cart::neogeo_sma_mslug3_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_sma_mslug3_cart::neogeo_sma_mslug3_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_sma_cart(mconfig, NEOGEO_SMA_MSLUG3_CART, "Neo Geo Metal Slug 3 SMA Cart", tag, owner, clock, "neocart_mslug3", __FILE__) {} @@ -138,7 +138,7 @@ void neogeo_sma_mslug3_cart::decrypt_all(DECRYPT_ALL_PARAMS) const device_type NEOGEO_SMA_KOF2000_CART = &device_creator; -neogeo_sma_kof2000_cart::neogeo_sma_kof2000_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_sma_kof2000_cart::neogeo_sma_kof2000_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_sma_cart(mconfig, NEOGEO_SMA_KOF2000_CART, "Neo Geo KOF 2000 SMA Cart", tag, owner, clock, "neocart_kof2000", __FILE__) {} diff --git a/src/devices/bus/neogeo/sma.h b/src/devices/bus/neogeo/sma.h index 341b82bea48..6c1631b4cea 100644 --- a/src/devices/bus/neogeo/sma.h +++ b/src/devices/bus/neogeo/sma.h @@ -14,8 +14,8 @@ class neogeo_sma_cart : public neogeo_rom_device { public: // construction/destruction - neogeo_sma_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source); - neogeo_sma_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock); + neogeo_sma_cart(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint16_t clock, const char *shortname, const char *source); + neogeo_sma_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); // device-level overrides virtual void device_start() override; @@ -25,7 +25,7 @@ public: // reading and writing virtual DECLARE_READ16_MEMBER(protection_r) override { return m_sma_prot->prot_9a37_r(space, offset, mem_mask); } virtual DECLARE_READ16_MEMBER(addon_r) override { return m_sma_prot->random_r(space, offset, mem_mask); } - virtual UINT32 get_bank_base(UINT16 sel) override { return 0; } + virtual uint32_t get_bank_base(uint16_t sel) override { return 0; } virtual void decrypt_all(DECRYPT_ALL_PARAMS) override {} virtual int get_fixed_bank_type(void) override { return 0; } @@ -47,10 +47,10 @@ extern const device_type NEOGEO_SMA_CART; class neogeo_sma_kof99_cart : public neogeo_sma_cart { public: - neogeo_sma_kof99_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_sma_kof99_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } - virtual UINT32 get_bank_base(UINT16 sel) override { return m_sma_prot->kof99_bank_base(sel); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_sma_prot->kof99_bank_base(sel); } }; extern const device_type NEOGEO_SMA_KOF99_CART; @@ -63,10 +63,10 @@ extern const device_type NEOGEO_SMA_KOF99_CART; class neogeo_sma_garou_cart : public neogeo_sma_cart { public: - neogeo_sma_garou_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_sma_garou_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } - virtual UINT32 get_bank_base(UINT16 sel) override { return m_sma_prot->garou_bank_base(sel); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_sma_prot->garou_bank_base(sel); } }; extern const device_type NEOGEO_SMA_GAROU_CART; @@ -79,10 +79,10 @@ extern const device_type NEOGEO_SMA_GAROU_CART; class neogeo_sma_garouh_cart : public neogeo_sma_cart { public: - neogeo_sma_garouh_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_sma_garouh_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } - virtual UINT32 get_bank_base(UINT16 sel) override { return m_sma_prot->garouh_bank_base(sel); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_sma_prot->garouh_bank_base(sel); } }; extern const device_type NEOGEO_SMA_GAROUH_CART; @@ -95,10 +95,10 @@ extern const device_type NEOGEO_SMA_GAROUH_CART; class neogeo_sma_mslug3_cart : public neogeo_sma_cart { public: - neogeo_sma_mslug3_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_sma_mslug3_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 1; } - virtual UINT32 get_bank_base(UINT16 sel) override { return m_sma_prot->mslug3_bank_base(sel); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_sma_prot->mslug3_bank_base(sel); } }; extern const device_type NEOGEO_SMA_MSLUG3_CART; @@ -111,10 +111,10 @@ extern const device_type NEOGEO_SMA_MSLUG3_CART; class neogeo_sma_kof2000_cart : public neogeo_sma_cart { public: - neogeo_sma_kof2000_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_sma_kof2000_cart(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void decrypt_all(DECRYPT_ALL_PARAMS) override; virtual int get_fixed_bank_type(void) override { return 2; } - virtual UINT32 get_bank_base(UINT16 sel) override { return m_sma_prot->kof2000_bank_base(sel); } + virtual uint32_t get_bank_base(uint16_t sel) override { return m_sma_prot->kof2000_bank_base(sel); } }; extern const device_type NEOGEO_SMA_KOF2000_CART; diff --git a/src/devices/bus/neogeo_ctrl/ctrl.cpp b/src/devices/bus/neogeo_ctrl/ctrl.cpp index d79410c060b..6bca8e540b6 100644 --- a/src/devices/bus/neogeo_ctrl/ctrl.cpp +++ b/src/devices/bus/neogeo_ctrl/ctrl.cpp @@ -84,7 +84,7 @@ device_neogeo_ctrl_edge_interface::~device_neogeo_ctrl_edge_interface() // neogeo_control_port_device - constructor //------------------------------------------------- -neogeo_control_port_device::neogeo_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_control_port_device::neogeo_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEOGEO_CONTROL_PORT, "SNK Neo Geo control port", tag, owner, clock, "neogeo_control_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) { @@ -110,24 +110,24 @@ void neogeo_control_port_device::device_start() } -UINT8 neogeo_control_port_device::read_ctrl() +uint8_t neogeo_control_port_device::read_ctrl() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_device) data &= m_device->read_ctrl(); return data; } -UINT8 neogeo_control_port_device::read_start_sel() +uint8_t neogeo_control_port_device::read_start_sel() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_device) data &= m_device->read_start_sel(); return data; } -void neogeo_control_port_device::write_ctrlsel(UINT8 data) +void neogeo_control_port_device::write_ctrlsel(uint8_t data) { if (m_device) m_device->write_ctrlsel(data); @@ -138,7 +138,7 @@ void neogeo_control_port_device::write_ctrlsel(UINT8 data) // neogeo_ctrl_edge_port_device - constructor //------------------------------------------------- -neogeo_ctrl_edge_port_device::neogeo_ctrl_edge_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_ctrl_edge_port_device::neogeo_ctrl_edge_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEOGEO_CTRL_EDGE_CONNECTOR, "SNK Neo Geo Edge Connector (Controller)", tag, owner, clock, "neogeo_ctrl_edge", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) { @@ -166,7 +166,7 @@ void neogeo_ctrl_edge_port_device::device_start() READ8_MEMBER(neogeo_ctrl_edge_port_device::in0_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_device) data &= m_device->in0_r(space, offset, mem_mask); return data; @@ -174,21 +174,21 @@ READ8_MEMBER(neogeo_ctrl_edge_port_device::in0_r) READ8_MEMBER(neogeo_ctrl_edge_port_device::in1_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_device) data &= m_device->in1_r(space, offset, mem_mask); return data; } -UINT8 neogeo_ctrl_edge_port_device::read_start_sel() +uint8_t neogeo_ctrl_edge_port_device::read_start_sel() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_device) data &= m_device->read_start_sel(); return data; } -void neogeo_ctrl_edge_port_device::write_ctrlsel(UINT8 data) +void neogeo_ctrl_edge_port_device::write_ctrlsel(uint8_t data) { if (m_device) m_device->write_ctrlsel(data); diff --git a/src/devices/bus/neogeo_ctrl/ctrl.h b/src/devices/bus/neogeo_ctrl/ctrl.h index 1d61e6753d1..678e9871cfa 100644 --- a/src/devices/bus/neogeo_ctrl/ctrl.h +++ b/src/devices/bus/neogeo_ctrl/ctrl.h @@ -30,9 +30,9 @@ public: device_neogeo_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_neogeo_control_port_interface(); - virtual UINT8 read_ctrl() { return 0xff; }; - virtual UINT8 read_start_sel() { return 0xff; }; - virtual void write_ctrlsel(UINT8 data) { }; + virtual uint8_t read_ctrl() { return 0xff; }; + virtual uint8_t read_start_sel() { return 0xff; }; + virtual void write_ctrlsel(uint8_t data) { }; protected: neogeo_control_port_device *m_port; @@ -45,12 +45,12 @@ class neogeo_control_port_device : public device_t, { public: // construction/destruction - neogeo_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~neogeo_control_port_device(); - UINT8 read_ctrl(); - UINT8 read_start_sel(); - void write_ctrlsel(UINT8 data); + uint8_t read_ctrl(); + uint8_t read_start_sel(); + void write_ctrlsel(uint8_t data); DECLARE_READ8_MEMBER( ctrl_r ) { return read_ctrl(); } protected: @@ -70,10 +70,10 @@ public: device_neogeo_ctrl_edge_interface(const machine_config &mconfig, device_t &device); virtual ~device_neogeo_ctrl_edge_interface(); - virtual UINT8 read_start_sel() { return 0xff; } + virtual uint8_t read_start_sel() { return 0xff; } virtual DECLARE_READ8_MEMBER( in0_r ) { return 0xff; } virtual DECLARE_READ8_MEMBER( in1_r ) { return 0xff; } - virtual void write_ctrlsel(UINT8 data) { } + virtual void write_ctrlsel(uint8_t data) { } protected: neogeo_ctrl_edge_port_device *m_port; @@ -86,13 +86,13 @@ class neogeo_ctrl_edge_port_device : public device_t, { public: // construction/destruction - neogeo_ctrl_edge_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_ctrl_edge_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~neogeo_ctrl_edge_port_device(); - UINT8 read_start_sel(); + uint8_t read_start_sel(); DECLARE_READ8_MEMBER( in0_r ); DECLARE_READ8_MEMBER( in1_r ); - void write_ctrlsel(UINT8 data); + void write_ctrlsel(uint8_t data); protected: // device-level overrides diff --git a/src/devices/bus/neogeo_ctrl/dial.cpp b/src/devices/bus/neogeo_ctrl/dial.cpp index d73a7b6c8de..2885d9beb55 100644 --- a/src/devices/bus/neogeo_ctrl/dial.cpp +++ b/src/devices/bus/neogeo_ctrl/dial.cpp @@ -60,7 +60,7 @@ ioport_constructor neogeo_dial_device::device_input_ports() const // neogeo_dial_device - constructor //------------------------------------------------- -neogeo_dial_device::neogeo_dial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_dial_device::neogeo_dial_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEOGEO_DIAL, "SNK Neo Geo Dial Controller", tag, owner, clock, "neogeo_dial", __FILE__), device_neogeo_ctrl_edge_interface(mconfig, *this), m_joy1(*this, "JOY1"), @@ -97,7 +97,7 @@ void neogeo_dial_device::device_reset() READ8_MEMBER(neogeo_dial_device::in0_r) { - UINT8 res = 0; + uint8_t res = 0; if (m_ctrl_sel & 0x01) res = m_joy1->read(); else @@ -112,7 +112,7 @@ READ8_MEMBER(neogeo_dial_device::in0_r) READ8_MEMBER(neogeo_dial_device::in1_r) { - UINT8 res = 0; + uint8_t res = 0; if (m_ctrl_sel & 0x01) res = m_joy2->read(); else @@ -125,7 +125,7 @@ READ8_MEMBER(neogeo_dial_device::in1_r) // write_ctrlsel //------------------------------------------------- -void neogeo_dial_device::write_ctrlsel(UINT8 data) +void neogeo_dial_device::write_ctrlsel(uint8_t data) { m_ctrl_sel = data; } diff --git a/src/devices/bus/neogeo_ctrl/dial.h b/src/devices/bus/neogeo_ctrl/dial.h index 5727c540637..ff4d9d12dfe 100644 --- a/src/devices/bus/neogeo_ctrl/dial.h +++ b/src/devices/bus/neogeo_ctrl/dial.h @@ -26,7 +26,7 @@ class neogeo_dial_device : public device_t, { public: // construction/destruction - neogeo_dial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_dial_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -39,14 +39,14 @@ protected: // device_neogeo_control_port_interface overrides virtual DECLARE_READ8_MEMBER( in0_r ) override; virtual DECLARE_READ8_MEMBER( in1_r ) override; - virtual void write_ctrlsel(UINT8 data) override; + virtual void write_ctrlsel(uint8_t data) override; private: required_ioport m_joy1; required_ioport m_joy2; required_ioport m_dial1; required_ioport m_dial2; - UINT8 m_ctrl_sel; + uint8_t m_ctrl_sel; }; diff --git a/src/devices/bus/neogeo_ctrl/irrmaze.cpp b/src/devices/bus/neogeo_ctrl/irrmaze.cpp index e22941e5d09..3ada54927c8 100644 --- a/src/devices/bus/neogeo_ctrl/irrmaze.cpp +++ b/src/devices/bus/neogeo_ctrl/irrmaze.cpp @@ -49,7 +49,7 @@ ioport_constructor neogeo_irrmaze_device::device_input_ports() const // neogeo_irrmaze_device - constructor //------------------------------------------------- -neogeo_irrmaze_device::neogeo_irrmaze_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_irrmaze_device::neogeo_irrmaze_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEOGEO_IRRMAZE, "SNK Neo Geo Irritating Maze Analog Controller", tag, owner, clock, "neogeo_irrmaze", __FILE__), device_neogeo_ctrl_edge_interface(mconfig, *this), m_tx(*this, "TRACK_X"), @@ -85,7 +85,7 @@ void neogeo_irrmaze_device::device_reset() READ8_MEMBER(neogeo_irrmaze_device::in0_r) { - UINT8 res = 0; + uint8_t res = 0; if (m_ctrl_sel & 0x01) res = m_ty->read(); else @@ -107,7 +107,7 @@ READ8_MEMBER(neogeo_irrmaze_device::in1_r) // write_ctrlsel //------------------------------------------------- -void neogeo_irrmaze_device::write_ctrlsel(UINT8 data) +void neogeo_irrmaze_device::write_ctrlsel(uint8_t data) { m_ctrl_sel = data; } diff --git a/src/devices/bus/neogeo_ctrl/irrmaze.h b/src/devices/bus/neogeo_ctrl/irrmaze.h index 0eeecfb8a11..2ba9c17c13a 100644 --- a/src/devices/bus/neogeo_ctrl/irrmaze.h +++ b/src/devices/bus/neogeo_ctrl/irrmaze.h @@ -26,7 +26,7 @@ class neogeo_irrmaze_device : public device_t, { public: // construction/destruction - neogeo_irrmaze_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_irrmaze_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -39,13 +39,13 @@ protected: // device_neogeo_control_port_interface overrides virtual DECLARE_READ8_MEMBER( in0_r ) override; virtual DECLARE_READ8_MEMBER( in1_r ) override; - virtual void write_ctrlsel(UINT8 data) override; + virtual void write_ctrlsel(uint8_t data) override; private: required_ioport m_tx; required_ioport m_ty; required_ioport m_buttons; - UINT8 m_ctrl_sel; + uint8_t m_ctrl_sel; }; diff --git a/src/devices/bus/neogeo_ctrl/joystick.cpp b/src/devices/bus/neogeo_ctrl/joystick.cpp index 5dbb605434a..906a1cdc863 100644 --- a/src/devices/bus/neogeo_ctrl/joystick.cpp +++ b/src/devices/bus/neogeo_ctrl/joystick.cpp @@ -59,7 +59,7 @@ ioport_constructor neogeo_joystick_device::device_input_ports() const // neogeo_joystick_device - constructor //------------------------------------------------- -neogeo_joystick_device::neogeo_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_joystick_device::neogeo_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEOGEO_JOY, "SNK Neo Geo Joystick", tag, owner, clock, "neogeo_joy", __FILE__), device_neogeo_control_port_interface(mconfig, *this), m_joy(*this, "JOY"), @@ -90,7 +90,7 @@ void neogeo_joystick_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 neogeo_joystick_device::read_ctrl() +uint8_t neogeo_joystick_device::read_ctrl() { return m_joy->read(); } @@ -99,7 +99,7 @@ UINT8 neogeo_joystick_device::read_ctrl() // read_start_sel //------------------------------------------------- -UINT8 neogeo_joystick_device::read_start_sel() +uint8_t neogeo_joystick_device::read_start_sel() { return m_ss->read(); } @@ -160,7 +160,7 @@ ioport_constructor neogeo_joy_ac_device::device_input_ports() const // neogeo_joy_ac_device / neogeo_joystick_device - constructor //------------------------------------------------- -neogeo_joy_ac_device::neogeo_joy_ac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_joy_ac_device::neogeo_joy_ac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEOGEO_JOY_AC, "SNK Neo Geo Arcade Joystick", tag, owner, clock, "neogeo_joyac", __FILE__), device_neogeo_ctrl_edge_interface(mconfig, *this), m_joy1(*this, "JOY1"), diff --git a/src/devices/bus/neogeo_ctrl/joystick.h b/src/devices/bus/neogeo_ctrl/joystick.h index 86cccd6fef8..c7f571f6d36 100644 --- a/src/devices/bus/neogeo_ctrl/joystick.h +++ b/src/devices/bus/neogeo_ctrl/joystick.h @@ -26,7 +26,7 @@ class neogeo_joystick_device : public device_t, { public: // construction/destruction - neogeo_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,8 +37,8 @@ protected: virtual void device_reset() override; // device_neogeo_control_port_interface overrides - virtual UINT8 read_ctrl() override; - virtual UINT8 read_start_sel() override; + virtual uint8_t read_ctrl() override; + virtual uint8_t read_start_sel() override; private: required_ioport m_joy; @@ -53,7 +53,7 @@ class neogeo_joy_ac_device : public device_t, { public: // construction/destruction - neogeo_joy_ac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_joy_ac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/neogeo_ctrl/kizuna4p.cpp b/src/devices/bus/neogeo_ctrl/kizuna4p.cpp index b6b93089fe4..6a18ed07a92 100644 --- a/src/devices/bus/neogeo_ctrl/kizuna4p.cpp +++ b/src/devices/bus/neogeo_ctrl/kizuna4p.cpp @@ -84,7 +84,7 @@ ioport_constructor neogeo_kizuna4p_device::device_input_ports() const // neogeo_kizuna4p_device - constructor //------------------------------------------------- -neogeo_kizuna4p_device::neogeo_kizuna4p_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_kizuna4p_device::neogeo_kizuna4p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEOGEO_KIZ4P, "SNK Neo Geo Kizuna 4P Controller", tag, owner, clock, "neogeo_kiz4p", __FILE__), device_neogeo_ctrl_edge_interface(mconfig, *this), m_joy1(*this, "JOY1"), @@ -123,7 +123,7 @@ void neogeo_kizuna4p_device::device_reset() READ8_MEMBER(neogeo_kizuna4p_device::in0_r) { - UINT8 res = 0; + uint8_t res = 0; if (m_ctrl_sel & 0x01) res = m_joy3->read(); else @@ -140,7 +140,7 @@ READ8_MEMBER(neogeo_kizuna4p_device::in0_r) READ8_MEMBER(neogeo_kizuna4p_device::in1_r) { - UINT8 res = 0; + uint8_t res = 0; if (m_ctrl_sel & 0x01) res = m_joy4->read(); else @@ -155,7 +155,7 @@ READ8_MEMBER(neogeo_kizuna4p_device::in1_r) // read_start_sel //------------------------------------------------- -UINT8 neogeo_kizuna4p_device::read_start_sel() +uint8_t neogeo_kizuna4p_device::read_start_sel() { return (BIT(m_ss1->read(), m_ctrl_sel & 0x01)) | (BIT(m_ss2->read(), m_ctrl_sel & 0x01) << 2); } @@ -165,7 +165,7 @@ UINT8 neogeo_kizuna4p_device::read_start_sel() // write_ctrlsel //------------------------------------------------- -void neogeo_kizuna4p_device::write_ctrlsel(UINT8 data) +void neogeo_kizuna4p_device::write_ctrlsel(uint8_t data) { m_ctrl_sel = data; } diff --git a/src/devices/bus/neogeo_ctrl/kizuna4p.h b/src/devices/bus/neogeo_ctrl/kizuna4p.h index 7a3907f98db..d35b7d15ca2 100644 --- a/src/devices/bus/neogeo_ctrl/kizuna4p.h +++ b/src/devices/bus/neogeo_ctrl/kizuna4p.h @@ -26,7 +26,7 @@ class neogeo_kizuna4p_device : public device_t, { public: // construction/destruction - neogeo_kizuna4p_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_kizuna4p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -39,8 +39,8 @@ protected: // device_neogeo_control_port_interface overrides virtual DECLARE_READ8_MEMBER( in0_r ) override; virtual DECLARE_READ8_MEMBER( in1_r ) override; - virtual UINT8 read_start_sel() override; - virtual void write_ctrlsel(UINT8 data) override; + virtual uint8_t read_start_sel() override; + virtual void write_ctrlsel(uint8_t data) override; private: required_ioport m_joy1; @@ -49,7 +49,7 @@ private: required_ioport m_joy4; required_ioport m_ss1; required_ioport m_ss2; - UINT8 m_ctrl_sel; + uint8_t m_ctrl_sel; }; diff --git a/src/devices/bus/neogeo_ctrl/mahjong.cpp b/src/devices/bus/neogeo_ctrl/mahjong.cpp index ed55fefc1b0..d77403ed255 100644 --- a/src/devices/bus/neogeo_ctrl/mahjong.cpp +++ b/src/devices/bus/neogeo_ctrl/mahjong.cpp @@ -93,19 +93,19 @@ ioport_constructor neogeo_mjctrl_device::device_input_ports() const // neogeo_joystick_device - constructor //------------------------------------------------- -neogeo_mjctrl_ac_device::neogeo_mjctrl_ac_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) +neogeo_mjctrl_ac_device::neogeo_mjctrl_ac_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_neogeo_control_port_interface(mconfig, *this) , m_mjpanel(*this, "MJ.%u", 0) { } -neogeo_mjctrl_ac_device::neogeo_mjctrl_ac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +neogeo_mjctrl_ac_device::neogeo_mjctrl_ac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_mjctrl_ac_device(mconfig, NEOGEO_MJCTRL_AC, "SNK Neo Geo Arcade Mahjong panel", tag, owner, clock, "neogeo_mjac", __FILE__) { } -neogeo_mjctrl_device::neogeo_mjctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +neogeo_mjctrl_device::neogeo_mjctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : neogeo_mjctrl_ac_device(mconfig, NEOGEO_MJCTRL, "SNK Neo Geo Mahjong controller", tag, owner, clock, "neogeo_mjctrl", __FILE__), m_ss(*this, "START_SELECT") { @@ -136,9 +136,9 @@ void neogeo_mjctrl_ac_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 neogeo_mjctrl_ac_device::read_ctrl() +uint8_t neogeo_mjctrl_ac_device::read_ctrl() { - UINT8 res = 0; + uint8_t res = 0; switch (m_ctrl_sel) { default: @@ -156,7 +156,7 @@ UINT8 neogeo_mjctrl_ac_device::read_ctrl() // write_ctrlsel //------------------------------------------------- -void neogeo_mjctrl_ac_device::write_ctrlsel(UINT8 data) +void neogeo_mjctrl_ac_device::write_ctrlsel(uint8_t data) { m_ctrl_sel = data; } @@ -165,7 +165,7 @@ void neogeo_mjctrl_ac_device::write_ctrlsel(UINT8 data) // read_start_sel //------------------------------------------------- -UINT8 neogeo_mjctrl_device::read_start_sel() +uint8_t neogeo_mjctrl_device::read_start_sel() { return m_ss->read(); } diff --git a/src/devices/bus/neogeo_ctrl/mahjong.h b/src/devices/bus/neogeo_ctrl/mahjong.h index 52812a9917e..d92b974b213 100644 --- a/src/devices/bus/neogeo_ctrl/mahjong.h +++ b/src/devices/bus/neogeo_ctrl/mahjong.h @@ -26,8 +26,8 @@ class neogeo_mjctrl_ac_device : public device_t, { public: // construction/destruction - neogeo_mjctrl_ac_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); - neogeo_mjctrl_ac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_mjctrl_ac_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); + neogeo_mjctrl_ac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -38,12 +38,12 @@ protected: virtual void device_reset() override; // device_neogeo_control_port_interface overrides - virtual UINT8 read_ctrl() override; - virtual void write_ctrlsel(UINT8 data) override; + virtual uint8_t read_ctrl() override; + virtual void write_ctrlsel(uint8_t data) override; private: required_ioport_array<4> m_mjpanel; - UINT8 m_ctrl_sel; + uint8_t m_ctrl_sel; }; // ======================> neogeo_mjctrl_device @@ -52,7 +52,7 @@ class neogeo_mjctrl_device : public neogeo_mjctrl_ac_device { public: // construction/destruction - neogeo_mjctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + neogeo_mjctrl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -60,7 +60,7 @@ public: protected: // device_neogeo_control_port_interface overrides - virtual UINT8 read_start_sel() override; + virtual uint8_t read_start_sel() override; private: required_ioport m_ss; diff --git a/src/devices/bus/nes/2a03pur.cpp b/src/devices/bus/nes/2a03pur.cpp index d7c807b63f2..9fc9da33883 100644 --- a/src/devices/bus/nes/2a03pur.cpp +++ b/src/devices/bus/nes/2a03pur.cpp @@ -34,7 +34,7 @@ const device_type NES_2A03PURITANS = &device_creator; -nes_2a03pur_device::nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_2a03pur_device::nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_2A03PURITANS, "NES Cart 2A03 Puritans Album PCB", tag, owner, clock, "nes_2a03pur", __FILE__) { } diff --git a/src/devices/bus/nes/2a03pur.h b/src/devices/bus/nes/2a03pur.h index 6bcafadb7d5..755957c0f95 100644 --- a/src/devices/bus/nes/2a03pur.h +++ b/src/devices/bus/nes/2a03pur.h @@ -12,7 +12,7 @@ class nes_2a03pur_device : public nes_nrom_device { public: // construction/destruction - nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -22,7 +22,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[8]; + uint8_t m_reg[8]; }; diff --git a/src/devices/bus/nes/act53.cpp b/src/devices/bus/nes/act53.cpp index 225be65d449..98bc04539ef 100644 --- a/src/devices/bus/nes/act53.cpp +++ b/src/devices/bus/nes/act53.cpp @@ -32,7 +32,7 @@ const device_type NES_ACTION53 = &device_creator; -nes_action53_device::nes_action53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_action53_device::nes_action53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_ACTION53, "NES Cart Action 53 PCB", tag, owner, clock, "nes_action53", __FILE__), m_sel(0) { @@ -105,10 +105,10 @@ void nes_action53_device::pcb_reset() void nes_action53_device::update_prg() { - UINT8 prg_lo, prg_hi, helper; - UINT8 out = (m_reg[3] & 0x3f) << 1; // Outer PRG reg - UINT8 size = (m_reg[2] & 0x30) >> 4; // Game size - UINT8 mask = (1 << (size + 1)) - 1; // Bits to be taken from PRG reg + uint8_t prg_lo, prg_hi, helper; + uint8_t out = (m_reg[3] & 0x3f) << 1; // Outer PRG reg + uint8_t size = (m_reg[2] & 0x30) >> 4; // Game size + uint8_t mask = (1 << (size + 1)) - 1; // Bits to be taken from PRG reg if (!BIT(m_reg[2], 3)) { diff --git a/src/devices/bus/nes/act53.h b/src/devices/bus/nes/act53.h index e3b395ce1cd..3d9c8d53155 100644 --- a/src/devices/bus/nes/act53.h +++ b/src/devices/bus/nes/act53.h @@ -12,7 +12,7 @@ class nes_action53_device : public nes_nrom_device { public: // construction/destruction - nes_action53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_action53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -24,8 +24,8 @@ public: private: void update_prg(); void update_mirr(); - UINT8 m_sel; - UINT8 m_reg[4]; + uint8_t m_sel; + uint8_t m_reg[4]; }; diff --git a/src/devices/bus/nes/aladdin.cpp b/src/devices/bus/nes/aladdin.cpp index d0f1ba00426..dcdd4e5e4d9 100644 --- a/src/devices/bus/nes/aladdin.cpp +++ b/src/devices/bus/nes/aladdin.cpp @@ -66,7 +66,7 @@ READ8_MEMBER(aladdin_cart_interface::read) const device_type NES_ALADDIN_SLOT = &device_creator; -nes_aladdin_slot_device::nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_aladdin_slot_device::nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_ALADDIN_SLOT, "NES Aladdin Deck Enhancer Cartridge Slot", tag, owner, clock, "nes_ade_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_cart(nullptr) @@ -96,8 +96,8 @@ image_init_result nes_aladdin_slot_device::call_load() { if (m_cart) { - UINT8 *ROM = m_cart->get_cart_base(); - UINT32 size; + uint8_t *ROM = m_cart->get_cart_base(); + uint32_t size; if (!ROM) return image_init_result::FAIL; @@ -107,14 +107,14 @@ image_init_result nes_aladdin_slot_device::call_load() if (length() != 0x20010 && length() != 0x40010) return image_init_result::FAIL; - UINT8 temp[0x40010]; + uint8_t temp[0x40010]; size = length() - 0x10; fread(&temp, length()); memcpy(ROM, temp + 0x10, size); // double check that iNES files are really mapper 71 or 232 { - UINT8 mapper = (temp[6] & 0xf0) >> 4; + uint8_t mapper = (temp[6] & 0xf0) >> 4; mapper |= temp[7] & 0xf0; if (mapper != 71 && mapper != 232) return image_init_result::FAIL; @@ -141,9 +141,9 @@ std::string nes_aladdin_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string = "algn"; - UINT32 len = m_file->size(); - std::vector rom(len); - UINT8 mapper; + uint32_t len = m_file->size(); + std::vector rom(len); + uint8_t mapper; m_file->read(&rom[0], len); @@ -177,26 +177,26 @@ ROM_END const device_type NES_ALGN_ROM = &device_creator; const device_type NES_ALGQ_ROM = &device_creator; -nes_algn_rom_device::nes_algn_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +nes_algn_rom_device::nes_algn_rom_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), aladdin_cart_interface( mconfig, *this ) { } -nes_algn_rom_device::nes_algn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_algn_rom_device::nes_algn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_ALGN_ROM, "NES Aladdin Deck Enhancer ALGN ROM", tag, owner, clock, "nes_algn_rom", __FILE__), aladdin_cart_interface( mconfig, *this ) { } -nes_algq_rom_device::nes_algq_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_algq_rom_device::nes_algq_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_algn_rom_device(mconfig, NES_ALGQ_ROM, "NES Aladdin Deck Enhancer ALGQ ROM", tag, owner, clock, "nes_algq_rom", __FILE__), m_bank_base(0) { } void nes_algn_rom_device::device_start() { - m_rom = (UINT8*)memregion("aderom")->base(); + m_rom = (uint8_t*)memregion("aderom")->base(); save_item(NAME(m_lobank)); } @@ -208,7 +208,7 @@ void nes_algn_rom_device::device_reset() void nes_algq_rom_device::device_start() { - m_rom = (UINT8*)memregion("aderom")->base(); + m_rom = (uint8_t*)memregion("aderom")->base(); save_item(NAME(m_lobank)); save_item(NAME(m_hibank)); save_item(NAME(m_bank_base)); @@ -226,19 +226,19 @@ const tiny_rom_entry *nes_algn_rom_device::device_rom_region() const return ROM_NAME( ade_rom ); } -UINT8 *nes_algn_rom_device::get_cart_base() +uint8_t *nes_algn_rom_device::get_cart_base() { return m_rom; } -void nes_algn_rom_device::write_prg(UINT32 offset, UINT8 data) +void nes_algn_rom_device::write_prg(uint32_t offset, uint8_t data) { // m_hibank is fixed to the last available bank! if (offset >= 0x4000) m_lobank = data & m_rom_mask; } -void nes_algq_rom_device::write_prg(UINT32 offset, UINT8 data) +void nes_algq_rom_device::write_prg(uint32_t offset, uint8_t data) { // here hibank & lobank variables are used differently // m_bank_base = 64K block @@ -264,7 +264,7 @@ void nes_algq_rom_device::write_prg(UINT32 offset, UINT8 data) const device_type NES_ALADDIN = &device_creator; -nes_aladdin_device::nes_aladdin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_aladdin_device::nes_aladdin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_ALADDIN, "NES Cart Camerica Aladdin PCB", tag, owner, clock, "nes_aladdin", __FILE__), m_subslot(*this, "ade_slot") { diff --git a/src/devices/bus/nes/aladdin.h b/src/devices/bus/nes/aladdin.h index 589fc3d87ec..990f0242ac7 100644 --- a/src/devices/bus/nes/aladdin.h +++ b/src/devices/bus/nes/aladdin.h @@ -25,15 +25,15 @@ public: // reading and writing virtual DECLARE_READ8_MEMBER(read); - UINT8 *get_cart_base() { return m_rom; } - void set_cart_size(UINT32 size) { m_rom_size = size; m_rom_mask = (size / 0x4000) - 1; } - virtual void write_prg(UINT32 offset, UINT8 data) { } + uint8_t *get_cart_base() { return m_rom; } + void set_cart_size(uint32_t size) { m_rom_size = size; m_rom_mask = (size / 0x4000) - 1; } + virtual void write_prg(uint32_t offset, uint8_t data) { } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - UINT8 m_lobank, m_hibank, m_rom_mask; + uint8_t *m_rom; + uint32_t m_rom_size; + uint8_t m_lobank, m_hibank, m_rom_mask; }; // ======================> nes_aladdin_slot_device @@ -44,7 +44,7 @@ class nes_aladdin_slot_device : public device_t, { public: // construction/destruction - nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~nes_aladdin_slot_device(); // device-level overrides @@ -68,7 +68,7 @@ public: virtual std::string get_default_card_software() override; virtual DECLARE_READ8_MEMBER(read); - void write_prg(UINT32 offset, UINT8 data) { if (m_cart) m_cart->write_prg(offset, data); } + void write_prg(uint32_t offset, uint8_t data) { if (m_cart) m_cart->write_prg(offset, data); } aladdin_cart_interface* m_cart; }; @@ -95,13 +95,13 @@ class nes_algn_rom_device : public device_t, { public: // construction/destruction - nes_algn_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - nes_algn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_algn_rom_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); + nes_algn_rom_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; - virtual UINT8* get_cart_base(); - virtual void write_prg(UINT32 offset, UINT8 data) override; + virtual uint8_t* get_cart_base(); + virtual void write_prg(uint32_t offset, uint8_t data) override; protected: // device-level overrides @@ -116,17 +116,17 @@ class nes_algq_rom_device : public nes_algn_rom_device { public: // construction/destruction - nes_algq_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_algq_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides - virtual void write_prg(UINT32 offset, UINT8 data) override; + virtual void write_prg(uint32_t offset, uint8_t data) override; protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - UINT8 m_bank_base; + uint8_t m_bank_base; }; // device type definition @@ -146,7 +146,7 @@ class nes_aladdin_device : public nes_nrom_device { public: // construction/destruction - nes_aladdin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_aladdin_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/devices/bus/nes/ave.cpp b/src/devices/bus/nes/ave.cpp index c1103f228ac..9634f39e202 100644 --- a/src/devices/bus/nes/ave.cpp +++ b/src/devices/bus/nes/ave.cpp @@ -38,17 +38,17 @@ const device_type NES_NINA006 = &device_creator; const device_type NES_MAXI15 = &device_creator; -nes_nina001_device::nes_nina001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_nina001_device::nes_nina001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NINA001, "NES Cart AVE Nina-001 PCB", tag, owner, clock, "nes_nina001", __FILE__) { } -nes_nina006_device::nes_nina006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_nina006_device::nes_nina006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NINA006, "NES Cart AVE Nina-006 PCB", tag, owner, clock, "nes_nina006", __FILE__) { } -nes_maxi15_device::nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_maxi15_device::nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_MAXI15, "NES Cart AVE Maxi 15 PCB", tag, owner, clock, "nes_maxi15", __FILE__), m_reg(0), m_bank(0) { } diff --git a/src/devices/bus/nes/ave.h b/src/devices/bus/nes/ave.h index 936d93ce392..7648cc7ce46 100644 --- a/src/devices/bus/nes/ave.h +++ b/src/devices/bus/nes/ave.h @@ -12,7 +12,7 @@ class nes_nina001_device : public nes_nrom_device { public: // construction/destruction - nes_nina001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_nina001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_nina006_device : public nes_nrom_device { public: // construction/destruction - nes_nina006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_nina006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -44,7 +44,7 @@ class nes_maxi15_device : public nes_nrom_device { public: // construction/destruction - nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -54,7 +54,7 @@ public: private: void update_banks(); - UINT8 m_reg, m_bank; + uint8_t m_reg, m_bank; }; diff --git a/src/devices/bus/nes/bandai.cpp b/src/devices/bus/nes/bandai.cpp index 8a223a5d645..8a3af94a65f 100644 --- a/src/devices/bus/nes/bandai.cpp +++ b/src/devices/bus/nes/bandai.cpp @@ -58,49 +58,49 @@ const device_type NES_LZ93D50_24C02 = &device_creator; const device_type NES_FJUMP2 = &device_creator; -nes_oekakids_device::nes_oekakids_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_oekakids_device::nes_oekakids_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_OEKAKIDS, "NES Cart Bandai Oeka Kids PCB", tag, owner, clock, "nes_oeka", __FILE__), m_reg(0), m_latch(0) { } -nes_fcg_device::nes_fcg_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) +nes_fcg_device::nes_fcg_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_fcg_device::nes_fcg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_fcg_device::nes_fcg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_FCG, "NES Cart Bandai FCG PCB", tag, owner, clock, "nes_fcg", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_lz93d50_device::nes_lz93d50_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) +nes_lz93d50_device::nes_lz93d50_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) : nes_fcg_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -nes_lz93d50_device::nes_lz93d50_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_lz93d50_device::nes_lz93d50_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_fcg_device(mconfig, NES_LZ93D50, "NES Cart Bandai LZ93D50 PCB", tag, owner, clock, "nes_lz93d50", __FILE__) { } -nes_lz93d50_24c01_device::nes_lz93d50_24c01_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) +nes_lz93d50_24c01_device::nes_lz93d50_24c01_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) : nes_lz93d50_device(mconfig, type, name, tag, owner, clock, shortname, source), m_i2cmem(*this, "i2cmem"), m_i2c_dir(0) { } -nes_lz93d50_24c01_device::nes_lz93d50_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_lz93d50_24c01_device::nes_lz93d50_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_lz93d50_device(mconfig, NES_LZ93D50_24C01, "NES Cart Bandai LZ93D50 + 24C01 PCB", tag, owner, clock, "nes_lz93d50_ep1", __FILE__), m_i2cmem(*this, "i2cmem"), m_i2c_dir(0) { } -nes_lz93d50_24c02_device::nes_lz93d50_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_lz93d50_24c02_device::nes_lz93d50_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_lz93d50_24c01_device(mconfig, NES_LZ93D50_24C02, "NES Cart Bandai LZ93D50 + 24C02 PCB", tag, owner, clock, "nes_lz93d50_ep2", __FILE__) { } -nes_fjump2_device::nes_fjump2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_fjump2_device::nes_fjump2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_lz93d50_device(mconfig, NES_FJUMP2, "NES Cart Bandai Famicom Jump II PCB", tag, owner, clock, "nes_fjump2", __FILE__) { } @@ -434,7 +434,7 @@ machine_config_constructor nes_lz93d50_24c02_device::device_mconfig_additions() void nes_fjump2_device::set_prg() { - UINT8 prg_base = 0; + uint8_t prg_base = 0; for (int i = 0; i < 4; i++) prg_base |= (m_reg[i] << 4); diff --git a/src/devices/bus/nes/bandai.h b/src/devices/bus/nes/bandai.h index 13ee41f4823..108c6fb96cc 100644 --- a/src/devices/bus/nes/bandai.h +++ b/src/devices/bus/nes/bandai.h @@ -13,7 +13,7 @@ class nes_oekakids_device : public nes_nrom_device { public: // construction/destruction - nes_oekakids_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_oekakids_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ public: // TODO: add oeka kids controller emulation protected: void update_chr(); - UINT8 m_reg, m_latch; + uint8_t m_reg, m_latch; }; @@ -38,8 +38,8 @@ class nes_fcg_device : public nes_nrom_device { public: // construction/destruction - nes_fcg_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); - nes_fcg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fcg_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); + nes_fcg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -50,7 +50,7 @@ public: virtual void pcb_reset() override; protected: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; @@ -64,8 +64,8 @@ class nes_lz93d50_device : public nes_fcg_device { public: // construction/destruction - nes_lz93d50_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); - nes_lz93d50_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_lz93d50_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); + nes_lz93d50_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override { fcg_write(space, offset, data, mem_mask); } @@ -78,8 +78,8 @@ class nes_lz93d50_24c01_device : public nes_lz93d50_device { public: // construction/destruction - nes_lz93d50_24c01_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); - nes_lz93d50_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_lz93d50_24c01_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); + nes_lz93d50_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -91,7 +91,7 @@ public: // TODO: fix EEPROM I/O emulation required_device m_i2cmem; - UINT8 m_i2c_dir; + uint8_t m_i2c_dir; }; @@ -101,7 +101,7 @@ class nes_lz93d50_24c02_device : public nes_lz93d50_24c01_device { public: // construction/destruction - nes_lz93d50_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_lz93d50_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -114,7 +114,7 @@ class nes_fjump2_device : public nes_lz93d50_device { public: // construction/destruction - nes_fjump2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fjump2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -126,7 +126,7 @@ public: protected: void set_prg(); - UINT8 m_reg[5]; + uint8_t m_reg[5]; }; diff --git a/src/devices/bus/nes/benshieng.cpp b/src/devices/bus/nes/benshieng.cpp index cda8d66d94d..803b4413c54 100644 --- a/src/devices/bus/nes/benshieng.cpp +++ b/src/devices/bus/nes/benshieng.cpp @@ -31,7 +31,7 @@ const device_type NES_BENSHIENG = &device_creator; -nes_benshieng_device::nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_benshieng_device::nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BENSHIENG, "NES Cart Benshieng PCB", tag, owner, clock, "nes_benshieng", __FILE__), m_dipsetting(0) { @@ -88,7 +88,7 @@ void nes_benshieng_device::update_banks() WRITE8_MEMBER(nes_benshieng_device::write_h) { - UINT8 helper = (offset & 0xc00) >> 10; + uint8_t helper = (offset & 0xc00) >> 10; LOG_MMC(("benshieng write_h, offset: %04x, data: %02x\n", offset, data)); // m_mmc_dipsetting = ioport("CARTDIPS")->read(); diff --git a/src/devices/bus/nes/benshieng.h b/src/devices/bus/nes/benshieng.h index c87b016c6a3..1989c26ad15 100644 --- a/src/devices/bus/nes/benshieng.h +++ b/src/devices/bus/nes/benshieng.h @@ -12,7 +12,7 @@ class nes_benshieng_device : public nes_nrom_device { public: // construction/destruction - nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -22,9 +22,9 @@ public: private: void update_banks(); - UINT8 m_dipsetting; - UINT8 m_mmc_prg_bank[4]; - UINT8 m_mmc_vrom_bank[4]; + uint8_t m_dipsetting; + uint8_t m_mmc_prg_bank[4]; + uint8_t m_mmc_vrom_bank[4]; }; diff --git a/src/devices/bus/nes/bootleg.cpp b/src/devices/bus/nes/bootleg.cpp index f21db4454ff..094ec65dd22 100644 --- a/src/devices/bus/nes/bootleg.cpp +++ b/src/devices/bus/nes/bootleg.cpp @@ -61,107 +61,107 @@ const device_type NES_SHUIGUAN = &device_creator; const device_type NES_RT01 = &device_creator; -nes_ax5705_device::nes_ax5705_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ax5705_device::nes_ax5705_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_AX5705, "NES Cart AX5705 PCB", tag, owner, clock, "nes_ax5705", __FILE__) { } -nes_sc127_device::nes_sc127_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sc127_device::nes_sc127_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SC127, "NES Cart SC-127 PCB", tag, owner, clock, "nes_sc127", __FILE__), m_irq_count(0), m_irq_enable(0) { } -nes_mbaby_device::nes_mbaby_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_mbaby_device::nes_mbaby_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_MARIOBABY, "NES Cart Mario Baby Bootleg PCB", tag, owner, clock, "nes_mbaby", __FILE__), m_latch(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_asn_device::nes_asn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_asn_device::nes_asn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_ASN, "NES Cart Ai Senshi Nicol Bootleg PCB", tag, owner, clock, "nes_asn", __FILE__), m_latch(0) { } -nes_smb3p_device::nes_smb3p_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_smb3p_device::nes_smb3p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SMB3PIRATE, "NES Cart Super Mario Bros. 3 Pirate PCB", tag, owner, clock, "nes_smb3p", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_btl_dn_device::nes_btl_dn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_btl_dn_device::nes_btl_dn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BTL_DNINJA, "NES Cart DragonNinja Pirate PCB", tag, owner, clock, "nes_btl_dn", __FILE__), m_irq_count(0) { } -nes_whirl2706_device::nes_whirl2706_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_whirl2706_device::nes_whirl2706_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_WHIRLWIND_2706, "NES Cart Whirlwind 2706 PCB", tag, owner, clock, "nes_whirl2706", __FILE__), m_latch(0) { } -nes_smb2j_device::nes_smb2j_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_smb2j_device::nes_smb2j_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SMB2J, "NES Cart Super Mario Bros. 2 Jpn PCB", tag, owner, clock, "nes_smb2j", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_smb2ja_device::nes_smb2ja_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_smb2ja_device::nes_smb2ja_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SMB2JA, "NES Cart Super Mario Bros. 2 Jpn (Alt) PCB", tag, owner, clock, "nes_smb2ja", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_smb2jb_device::nes_smb2jb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_smb2jb_device::nes_smb2jb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SMB2JB, "NES Cart Super Mario Bros. 2 Jpn (Alt 2) PCB", tag, owner, clock, "nes_smb2jb", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_09034a_device::nes_09034a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_09034a_device::nes_09034a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_09034A, "NES Cart 09-034A PCB", tag, owner, clock, "nes_09034a", __FILE__), m_reg(0) { } -nes_tobidase_device::nes_tobidase_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tobidase_device::nes_tobidase_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TOBIDASE, "NES Cart Tobidase Daisakusen Pirate PCB", tag, owner, clock, "nes_tobidase", __FILE__), m_latch(0) { } -nes_lh32_device::nes_lh32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_lh32_device::nes_lh32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_LH32, "NES Cart LH-32 Pirate PCB", tag, owner, clock, "nes_lh32", __FILE__), m_latch(0) { } -nes_lh10_device::nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_lh10_device::nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_LH10, "NES Cart LH-10 Pirate PCB", tag, owner, clock, "nes_lh10", __FILE__), m_latch(0) { } -nes_lh53_device::nes_lh53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_lh53_device::nes_lh53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_LH53, "NES Cart LH-53 Pirate PCB", tag, owner, clock, "nes_lh53", __FILE__), m_irq_count(0), m_irq_enable(0), m_reg(0), irq_timer(nullptr) { } -nes_2708_device::nes_2708_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_2708_device::nes_2708_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_2708, "NES Cart BTL-2708 Pirate PCB", tag, owner, clock, "nes_2708", __FILE__) { } -nes_ac08_device::nes_ac08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ac08_device::nes_ac08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_AC08, "NES Cart AC08 Pirate PCB", tag, owner, clock, "nes_ac08", __FILE__), m_latch(0) { } -nes_unl_bb_device::nes_unl_bb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_unl_bb_device::nes_unl_bb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_UNL_BB, "NES Cart FDS+CHR Pirate PCB", tag, owner, clock, "nes_unl_bb", __FILE__) { } -nes_mmalee_device::nes_mmalee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_mmalee_device::nes_mmalee_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_MMALEE, "NES Cart Super Mario Bros. Malee 2 Pirate PCB", tag, owner, clock, "nes_mmalee", __FILE__) { } -nes_shuiguan_device::nes_shuiguan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_shuiguan_device::nes_shuiguan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SHUIGUAN, "NES Cart Shui Guan Pipe Pirate PCB", tag, owner, clock, "nes_shuiguan", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_rt01_device::nes_rt01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_rt01_device::nes_rt01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_RT01, "NES Cart RT-01 PCB", tag, owner, clock, "nes_rt01", __FILE__) { } @@ -572,7 +572,7 @@ void nes_ax5705_device::set_prg() WRITE8_MEMBER(nes_ax5705_device::write_h) { - UINT8 bank; + uint8_t bank; LOG_MMC(("ax5705 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x700f) @@ -882,7 +882,7 @@ void nes_btl_dn_device::hblank_irq(int scanline, int vblank, int blanked ) WRITE8_MEMBER(nes_btl_dn_device::write_h) { - UINT8 bank; + uint8_t bank; LOG_MMC(("btl_dn write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x7003) @@ -1117,7 +1117,7 @@ void nes_smb2jb_device::device_timer(emu_timer &timer, device_timer_id id, int p WRITE8_MEMBER(nes_smb2jb_device::write_l) { - UINT8 prg; + uint8_t prg; LOG_MMC(("smb2jb write_l, offset: %04x, data: %02x\n", offset, data)); offset += 0x100; @@ -1144,7 +1144,7 @@ READ8_MEMBER(nes_smb2jb_device::read_m) /* This goes to 0x4020-0x403f & 0x40a0-0x40bf */ WRITE8_MEMBER(nes_smb2jb_device::write_ex) { - UINT8 prg; + uint8_t prg; LOG_MMC(("smb2jb write_ex, offset: %04x, data: %02x\n", offset, data)); if ((offset < 0x20) || (offset >= 0x80 && offset < 0xa0)) diff --git a/src/devices/bus/nes/bootleg.h b/src/devices/bus/nes/bootleg.h index 59f02a476a5..5e2457d2fef 100644 --- a/src/devices/bus/nes/bootleg.h +++ b/src/devices/bus/nes/bootleg.h @@ -12,7 +12,7 @@ class nes_ax5705_device : public nes_nrom_device { public: // construction/destruction - nes_ax5705_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ax5705_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -22,8 +22,8 @@ public: private: void set_prg(); - UINT8 m_mmc_prg_bank[2]; - UINT8 m_mmc_vrom_bank[8]; + uint8_t m_mmc_prg_bank[2]; + uint8_t m_mmc_vrom_bank[8]; }; @@ -33,7 +33,7 @@ class nes_sc127_device : public nes_nrom_device { public: // construction/destruction - nes_sc127_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sc127_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -43,7 +43,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; }; @@ -54,7 +54,7 @@ class nes_mbaby_device : public nes_nrom_device { public: // construction/destruction - nes_mbaby_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_mbaby_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -65,7 +65,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; @@ -80,7 +80,7 @@ class nes_asn_device : public nes_nrom_device { public: // construction/destruction - nes_asn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_asn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -90,7 +90,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -100,7 +100,7 @@ class nes_smb3p_device : public nes_nrom_device { public: // construction/destruction - nes_smb3p_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_smb3p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -110,7 +110,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; @@ -124,7 +124,7 @@ class nes_btl_dn_device : public nes_nrom_device { public: // construction/destruction - nes_btl_dn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_btl_dn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -134,7 +134,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; }; @@ -144,7 +144,7 @@ class nes_whirl2706_device : public nes_nrom_device { public: // construction/destruction - nes_whirl2706_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_whirl2706_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -154,7 +154,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -164,7 +164,7 @@ class nes_smb2j_device : public nes_nrom_device { public: // construction/destruction - nes_smb2j_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_smb2j_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -178,7 +178,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; @@ -192,7 +192,7 @@ class nes_smb2ja_device : public nes_nrom_device { public: // construction/destruction - nes_smb2ja_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_smb2ja_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -203,7 +203,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; @@ -217,7 +217,7 @@ class nes_smb2jb_device : public nes_nrom_device { public: // construction/destruction - nes_smb2jb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_smb2jb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -229,7 +229,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; @@ -243,7 +243,7 @@ class nes_09034a_device : public nes_nrom_device { public: // construction/destruction - nes_09034a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_09034a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -253,7 +253,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg; + uint8_t m_reg; }; @@ -263,7 +263,7 @@ class nes_tobidase_device : public nes_nrom_device { public: // construction/destruction - nes_tobidase_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tobidase_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -273,7 +273,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -283,7 +283,7 @@ class nes_lh32_device : public nes_nrom_device { public: // construction/destruction - nes_lh32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_lh32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -295,7 +295,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -305,7 +305,7 @@ class nes_lh10_device : public nes_nrom_device { public: // construction/destruction - nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -317,8 +317,8 @@ public: private: void update_prg(); - UINT8 m_latch; - UINT8 m_reg[8]; + uint8_t m_latch; + uint8_t m_reg[8]; }; @@ -328,7 +328,7 @@ class nes_lh53_device : public nes_nrom_device { public: // construction/destruction - nes_lh53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_lh53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -341,9 +341,9 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; - UINT8 m_reg; + uint8_t m_reg; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; @@ -357,7 +357,7 @@ class nes_2708_device : public nes_nrom_device { public: // construction/destruction - nes_2708_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_2708_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -369,7 +369,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[2]; + uint8_t m_reg[2]; }; // ======================> nes_ac08_device @@ -378,7 +378,7 @@ class nes_ac08_device : public nes_nrom_device { public: // nes_ac08_device/destruction - nes_ac08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ac08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -389,7 +389,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; // ======================> nes_unl_bb_device @@ -398,7 +398,7 @@ class nes_unl_bb_device : public nes_nrom_device { public: // construction/destruction - nes_unl_bb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_unl_bb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -408,7 +408,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[2]; + uint8_t m_reg[2]; }; // ======================> nes_mmalee_device @@ -417,7 +417,7 @@ class nes_mmalee_device : public nes_nrom_device { public: // construction/destruction - nes_mmalee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_mmalee_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -433,7 +433,7 @@ class nes_shuiguan_device : public nes_nrom_device { public: // construction/destruction - nes_shuiguan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_shuiguan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -444,9 +444,9 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; - UINT8 m_mmc_vrom_bank[8]; + uint8_t m_mmc_vrom_bank[8]; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; @@ -459,7 +459,7 @@ class nes_rt01_device : public nes_nrom_device { public: // construction/destruction - nes_rt01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_rt01_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/devices/bus/nes/camerica.cpp b/src/devices/bus/nes/camerica.cpp index d1418c763f6..9d9a9a6f8ec 100644 --- a/src/devices/bus/nes/camerica.cpp +++ b/src/devices/bus/nes/camerica.cpp @@ -46,17 +46,17 @@ const device_type NES_BF9096 = &device_creator; const device_type NES_GOLDEN5 = &device_creator; -nes_bf9093_device::nes_bf9093_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bf9093_device::nes_bf9093_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BF9093, "NES Cart Camerica BF9093 PCB", tag, owner, clock, "nes_bf9093", __FILE__) { } -nes_bf9096_device::nes_bf9096_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bf9096_device::nes_bf9096_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BF9096, "NES Cart Camerica BF9096 PCB", tag, owner, clock, "nes_bf9096", __FILE__), m_bank_base(0), m_latch(0) { } -nes_golden5_device::nes_golden5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_golden5_device::nes_golden5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_GOLDEN5, "NES Cart Camerica Golden 5 PCB", tag, owner, clock, "nes_golden5", __FILE__), m_bank_base(0), m_latch(0) { } diff --git a/src/devices/bus/nes/camerica.h b/src/devices/bus/nes/camerica.h index f9adeacdca0..ba3b103b0d5 100644 --- a/src/devices/bus/nes/camerica.h +++ b/src/devices/bus/nes/camerica.h @@ -12,7 +12,7 @@ class nes_bf9093_device : public nes_nrom_device { public: // construction/destruction - nes_bf9093_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bf9093_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_bf9096_device : public nes_nrom_device { public: // construction/destruction - nes_bf9096_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bf9096_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -38,7 +38,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_bank_base, m_latch; + uint8_t m_bank_base, m_latch; }; @@ -48,7 +48,7 @@ class nes_golden5_device : public nes_nrom_device { public: // construction/destruction - nes_golden5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_golden5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -57,7 +57,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_bank_base, m_latch; + uint8_t m_bank_base, m_latch; }; diff --git a/src/devices/bus/nes/cne.cpp b/src/devices/bus/nes/cne.cpp index 76dc0a999f2..eb4a2c8d33a 100644 --- a/src/devices/bus/nes/cne.cpp +++ b/src/devices/bus/nes/cne.cpp @@ -37,17 +37,17 @@ const device_type NES_CNE_FSB = &device_creator; const device_type NES_CNE_SHLZ = &device_creator; -nes_cne_decathl_device::nes_cne_decathl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_cne_decathl_device::nes_cne_decathl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_CNE_DECATHL, "NES Cart C&E Decathlon PCB", tag, owner, clock, "nes_cne_deca", __FILE__) { } -nes_cne_fsb_device::nes_cne_fsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_cne_fsb_device::nes_cne_fsb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_CNE_FSB, "NES Cart C&E Feng Shen Bang PCB", tag, owner, clock, "nes_cne_fsb", __FILE__) { } -nes_cne_shlz_device::nes_cne_shlz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_cne_shlz_device::nes_cne_shlz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_CNE_SHLZ, "NES Cart C&E Sheng Huo Lie Zhuan PCB", tag, owner, clock, "nes_cne_shlz", __FILE__) { } diff --git a/src/devices/bus/nes/cne.h b/src/devices/bus/nes/cne.h index f64445aeb01..558067f2862 100644 --- a/src/devices/bus/nes/cne.h +++ b/src/devices/bus/nes/cne.h @@ -12,7 +12,7 @@ class nes_cne_decathl_device : public nes_nrom_device { public: // construction/destruction - nes_cne_decathl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_cne_decathl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_cne_fsb_device : public nes_nrom_device { public: // construction/destruction - nes_cne_fsb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_cne_fsb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -45,7 +45,7 @@ class nes_cne_shlz_device : public nes_nrom_device { public: // construction/destruction - nes_cne_shlz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_cne_shlz_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/devices/bus/nes/cony.cpp b/src/devices/bus/nes/cony.cpp index 2f4b29bfab3..0fbebcda02f 100644 --- a/src/devices/bus/nes/cony.cpp +++ b/src/devices/bus/nes/cony.cpp @@ -39,7 +39,7 @@ const device_type NES_CONY = &device_creator; const device_type NES_YOKO = &device_creator; -nes_cony_device::nes_cony_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) +nes_cony_device::nes_cony_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_enable(0), @@ -50,12 +50,12 @@ nes_cony_device::nes_cony_device(const machine_config &mconfig, device_type type { } -nes_cony_device::nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_cony_device::nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_CONY, "NES Cart Cony PCB", tag, owner, clock, "nes_cony", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch1(0), m_latch2(0), m_extra1(0) { } -nes_yoko_device::nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_yoko_device::nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_cony_device(mconfig, NES_YOKO, "NES Cart Yoko PCB", tag, owner, clock, "nes_yoko", __FILE__), m_extra2(0) { } diff --git a/src/devices/bus/nes/cony.h b/src/devices/bus/nes/cony.h index 625470da1e1..406952b69cb 100644 --- a/src/devices/bus/nes/cony.h +++ b/src/devices/bus/nes/cony.h @@ -12,8 +12,8 @@ class nes_cony_device : public nes_nrom_device { public: // construction/destruction - nes_cony_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); - nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_cony_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); + nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,16 +28,16 @@ protected: virtual void set_prg(); virtual void set_chr(); - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; - UINT8 m_latch1, m_latch2; - UINT8 m_low_reg[4]; - UINT8 m_reg[10]; - UINT8 m_extra1; + uint8_t m_latch1, m_latch2; + uint8_t m_low_reg[4]; + uint8_t m_reg[10]; + uint8_t m_extra1; }; @@ -47,7 +47,7 @@ class nes_yoko_device : public nes_cony_device { public: // construction/destruction - nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -61,7 +61,7 @@ private: virtual void set_prg() override; virtual void set_chr() override; - UINT8 m_extra2; + uint8_t m_extra2; }; diff --git a/src/devices/bus/nes/datach.cpp b/src/devices/bus/nes/datach.cpp index 6e4e619c286..20f9998bc30 100644 --- a/src/devices/bus/nes/datach.cpp +++ b/src/devices/bus/nes/datach.cpp @@ -67,7 +67,7 @@ READ8_MEMBER(datach_cart_interface::read) const device_type NES_DATACH_SLOT = &device_creator; -nes_datach_slot_device::nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_datach_slot_device::nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_DATACH_SLOT, "NES Datach Cartridge Slot", tag, owner, clock, "nes_datach_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_cart(nullptr) @@ -96,7 +96,7 @@ image_init_result nes_datach_slot_device::call_load() { if (m_cart) { - UINT8 *ROM = m_cart->get_cart_base(); + uint8_t *ROM = m_cart->get_cart_base(); if (!ROM) return image_init_result::FAIL; @@ -108,7 +108,7 @@ image_init_result nes_datach_slot_device::call_load() return image_init_result::FAIL; int shift = length() - 0x40000; - UINT8 temp[0x40010]; + uint8_t temp[0x40010]; fread(&temp, length()); memcpy(ROM, temp + shift, 0x40000); @@ -116,7 +116,7 @@ image_init_result nes_datach_slot_device::call_load() // (or 16, since some older .nes files marked Datach as mapper 16) if (length() == 0x40010) { - UINT8 mapper = (temp[6] & 0xf0) >> 4; + uint8_t mapper = (temp[6] & 0xf0) >> 4; mapper |= temp[7] & 0xf0; if (mapper != 157 && mapper != 16) { @@ -162,19 +162,19 @@ ROM_END const device_type NES_DATACH_ROM = &device_creator; const device_type NES_DATACH_24C01 = &device_creator; -nes_datach_rom_device::nes_datach_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +nes_datach_rom_device::nes_datach_rom_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), datach_cart_interface( mconfig, *this ) { } -nes_datach_rom_device::nes_datach_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_datach_rom_device::nes_datach_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_DATACH_ROM, "NES Datach ROM", tag, owner, clock, "nes_datach_rom", __FILE__), datach_cart_interface( mconfig, *this ) { } -nes_datach_24c01_device::nes_datach_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_datach_24c01_device::nes_datach_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_datach_rom_device(mconfig, NES_DATACH_24C01, "NES Datach + 24C01 PCB", tag, owner, clock, "nes_datach_ep1", __FILE__) { } @@ -182,7 +182,7 @@ nes_datach_24c01_device::nes_datach_24c01_device(const machine_config &mconfig, void nes_datach_rom_device::device_start() { - m_rom = (UINT8*)memregion("datachrom")->base(); + m_rom = (uint8_t*)memregion("datachrom")->base(); save_item(NAME(m_bank)); } @@ -196,7 +196,7 @@ const tiny_rom_entry *nes_datach_rom_device::device_rom_region() const return ROM_NAME( datach_rom ); } -UINT8 *nes_datach_rom_device::get_cart_base() +uint8_t *nes_datach_rom_device::get_cart_base() { return m_rom; } @@ -221,7 +221,7 @@ machine_config_constructor nes_datach_24c01_device::device_mconfig_additions() c const device_type NES_DATACH = &device_creator; -nes_datach_device::nes_datach_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_datach_device::nes_datach_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_lz93d50_device(mconfig, NES_DATACH, "NES Cart Bandai Datach PCB", tag, owner, clock, "nes_datach", __FILE__), m_datach_latch(0), m_i2cmem(*this, "i2cmem"), m_reader(*this, "datach"), @@ -289,7 +289,7 @@ void nes_datach_device::pcb_reset() READ8_MEMBER(nes_datach_device::read_m) { LOG_MMC(("Datach read_m, offset: %04x\n", offset)); - UINT8 i2c_val = 0; + uint8_t i2c_val = 0; #if TEST_EEPROM if (m_i2c_dir) { diff --git a/src/devices/bus/nes/datach.h b/src/devices/bus/nes/datach.h index 47c625badc7..323f09956b1 100644 --- a/src/devices/bus/nes/datach.h +++ b/src/devices/bus/nes/datach.h @@ -26,16 +26,16 @@ public: // reading and writing virtual DECLARE_READ8_MEMBER(read); - UINT8 *get_cart_base() { return m_rom; } - void write_prg_bank(UINT8 bank) { m_bank = bank; } + uint8_t *get_cart_base() { return m_rom; } + void write_prg_bank(uint8_t bank) { m_bank = bank; } optional_device m_i2cmem; protected: // internal state - UINT8 *m_rom; + uint8_t *m_rom; // ROM is accessed via two 16K banks, but only the first one can be switched - UINT8 m_bank; + uint8_t m_bank; }; // ======================> nes_datach_slot_device @@ -46,7 +46,7 @@ class nes_datach_slot_device : public device_t, { public: // construction/destruction - nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~nes_datach_slot_device(); // device-level overrides @@ -70,7 +70,7 @@ public: virtual std::string get_default_card_software() override; virtual DECLARE_READ8_MEMBER(read); - void write_prg_bank(UINT8 bank) { if (m_cart) m_cart->write_prg_bank(bank); } + void write_prg_bank(uint8_t bank) { if (m_cart) m_cart->write_prg_bank(bank); } datach_cart_interface* m_cart; }; @@ -97,12 +97,12 @@ class nes_datach_rom_device : public device_t, { public: // construction/destruction - nes_datach_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - nes_datach_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_datach_rom_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); + nes_datach_rom_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; - virtual UINT8* get_cart_base(); + virtual uint8_t* get_cart_base(); protected: // device-level overrides @@ -116,7 +116,7 @@ class nes_datach_24c01_device : public nes_datach_rom_device { public: // construction/destruction - nes_datach_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_datach_24c01_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; @@ -139,7 +139,7 @@ class nes_datach_device : public nes_lz93d50_device { public: // construction/destruction - nes_datach_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_datach_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -152,12 +152,12 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_datach_latch; + uint8_t m_datach_latch; required_device m_i2cmem; required_device m_reader; required_device m_subslot; - UINT8 m_i2c_dir; - UINT8 m_i2c_in_use; + uint8_t m_i2c_dir; + uint8_t m_i2c_in_use; static const device_timer_id TIMER_SERIAL = 1; emu_timer *serial_timer; diff --git a/src/devices/bus/nes/discrete.cpp b/src/devices/bus/nes/discrete.cpp index e0109a84d94..a99b66fd77a 100644 --- a/src/devices/bus/nes/discrete.cpp +++ b/src/devices/bus/nes/discrete.cpp @@ -41,22 +41,22 @@ const device_type NES_74X377 = &device_creator; const device_type NES_74X161X138 = &device_creator; -nes_74x161x161x32_device::nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_74x161x161x32_device::nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_74X161X161X32, "NES Cart Discrete Logic (74*161/161/32) PCB", tag, owner, clock, "nes_74x161", __FILE__) { } -nes_74x139x74_device::nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_74x139x74_device::nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_74X139X74, "NES Cart Discrete Logic (74*139/74) PCB", tag, owner, clock, "nes_74x139", __FILE__) { } -nes_74x377_device::nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_74x377_device::nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_74X377, "NES Cart Discrete Logic (74*377) PCB", tag, owner, clock, "nes_74x377", __FILE__) { } -nes_74x161x138_device::nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_74x161x138_device::nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_74X161X138, "NES Cart Discrete Logic (74*161/138) PCB", tag, owner, clock, "nes_bitcorp_dis", __FILE__) { } diff --git a/src/devices/bus/nes/discrete.h b/src/devices/bus/nes/discrete.h index 94abf418a95..7448e62b727 100644 --- a/src/devices/bus/nes/discrete.h +++ b/src/devices/bus/nes/discrete.h @@ -12,7 +12,7 @@ class nes_74x161x161x32_device : public nes_nrom_device { public: // construction/destruction - nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_74x139x74_device : public nes_nrom_device { public: // construction/destruction - nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -44,7 +44,7 @@ class nes_74x377_device : public nes_nrom_device { public: // construction/destruction - nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -60,7 +60,7 @@ class nes_74x161x138_device : public nes_nrom_device { public: // construction/destruction - nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_74x161x138_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/devices/bus/nes/disksys.cpp b/src/devices/bus/nes/disksys.cpp index d272232387d..7e2d4a36e76 100644 --- a/src/devices/bus/nes/disksys.cpp +++ b/src/devices/bus/nes/disksys.cpp @@ -103,7 +103,7 @@ void nes_disksys_device::unload_proc(device_image_interface &image) const device_type NES_DISKSYS = &device_creator; -nes_disksys_device::nes_disksys_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_disksys_device::nes_disksys_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_DISKSYS, "FC RAM Expansion + Disk System PCB", tag, owner, clock, "fc_disksys", __FILE__), m_2c33_rom(nullptr), m_fds_data(nullptr), m_disk(*this, FLOPPY_0), irq_timer(nullptr), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_transfer(0), m_fds_motor_on(0), m_fds_door_closed(0), m_fds_current_side(0), m_fds_head_position(0), m_fds_status0(0), m_read_mode(0), m_drive_ready(0), @@ -116,7 +116,7 @@ void nes_disksys_device::device_start() { common_start(); - m_2c33_rom = (UINT8*)memregion("drive")->base(); + m_2c33_rom = (uint8_t*)memregion("drive")->base(); m_disk->floppy_install_load_proc(nes_disksys_device::load_proc); m_disk->floppy_install_unload_proc(nes_disksys_device::unload_proc); @@ -289,7 +289,7 @@ WRITE8_MEMBER(nes_disksys_device::write_ex) READ8_MEMBER(nes_disksys_device::read_ex) { LOG_MMC(("Famicom Disk System read_ex, offset: %04x\n", offset)); - UINT8 ret; + uint8_t ret; if (offset >= 0x20 && offset < 0x60) { @@ -416,7 +416,7 @@ void nes_disksys_device::load_disk(device_image_interface &image) m_fds_sides = (image.length() - header) / 65500; if (!m_fds_data) - m_fds_data = std::make_unique(m_fds_sides * 65500); + m_fds_data = std::make_unique(m_fds_sides * 65500); // if there is an header, skip it image.fseek(header, SEEK_SET); diff --git a/src/devices/bus/nes/disksys.h b/src/devices/bus/nes/disksys.h index 35cda095114..5f05125061b 100644 --- a/src/devices/bus/nes/disksys.h +++ b/src/devices/bus/nes/disksys.h @@ -13,7 +13,7 @@ class nes_disksys_device : public nes_nrom_device { public: // construction/destruction - nes_disksys_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_disksys_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -37,8 +37,8 @@ public: static void unload_proc(device_image_interface &image); private: - UINT8 *m_2c33_rom; - std::unique_ptr m_fds_data; // here, we store a copy of the disk + uint8_t *m_2c33_rom; + std::unique_ptr m_fds_data; // here, we store a copy of the disk required_device m_disk; static const device_timer_id TIMER_IRQ = 0; @@ -47,18 +47,18 @@ private: void load_disk(device_image_interface &image); void unload_disk(device_image_interface &image); - UINT16 m_irq_count, m_irq_count_latch; + uint16_t m_irq_count, m_irq_count_latch; int m_irq_enable, m_irq_transfer; - UINT8 m_fds_motor_on; - UINT8 m_fds_door_closed; - UINT8 m_fds_current_side; - UINT32 m_fds_head_position; - UINT8 m_fds_status0; - UINT8 m_read_mode; - UINT8 m_drive_ready; + uint8_t m_fds_motor_on; + uint8_t m_fds_door_closed; + uint8_t m_fds_current_side; + uint32_t m_fds_head_position; + uint8_t m_fds_status0; + uint8_t m_read_mode; + uint8_t m_drive_ready; - UINT8 m_fds_sides; + uint8_t m_fds_sides; int m_fds_last_side; int m_fds_count; }; diff --git a/src/devices/bus/nes/event.cpp b/src/devices/bus/nes/event.cpp index e8cc13e44bc..1e6c9085963 100644 --- a/src/devices/bus/nes/event.cpp +++ b/src/devices/bus/nes/event.cpp @@ -35,7 +35,7 @@ const device_type NES_EVENT = &device_creator; -nes_event_device::nes_event_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_event_device::nes_event_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sxrom_device(mconfig, NES_EVENT, "NES Cart Event PCB", tag, owner, clock, "nes_event", __FILE__), m_dsw(*this, "DIPSW"), m_nwc_init(0), @@ -113,7 +113,7 @@ void nes_event_device::set_prg() // printf("enter with %d and reg1 0x%x - reg3 0x%x\n", m_nwc_init, m_reg[1], m_reg[3]); // reg[1] is different from base MMC-1! // bit 0 is ignored, bit1/bit3 are used for PRG switch, bit4 is used for the timer - UINT8 temp = (m_reg[1] >> 1) & 7; + uint8_t temp = (m_reg[1] >> 1) & 7; // initially PRG is fixed, until bit4 of reg1 is set to 1 and then to 0 switch (m_nwc_init) diff --git a/src/devices/bus/nes/event.h b/src/devices/bus/nes/event.h index 7da34bc58c2..af154b7fffc 100644 --- a/src/devices/bus/nes/event.h +++ b/src/devices/bus/nes/event.h @@ -12,7 +12,7 @@ class nes_event_device : public nes_sxrom_device { public: // construction/destruction - nes_event_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_event_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -33,7 +33,7 @@ protected: emu_timer *event_timer; attotime timer_freq; - UINT32 m_timer_count; + uint32_t m_timer_count; int m_timer_on, m_timer_enabled; }; diff --git a/src/devices/bus/nes/ggenie.cpp b/src/devices/bus/nes/ggenie.cpp index 148b9b568ac..ec6664bb23d 100644 --- a/src/devices/bus/nes/ggenie.cpp +++ b/src/devices/bus/nes/ggenie.cpp @@ -34,7 +34,7 @@ const device_type NES_GGENIE = &device_creator; -nes_ggenie_device::nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ggenie_device::nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_GGENIE, "NES Cart Game Genie PCB", tag, owner, clock, "nes_ggenie", __FILE__), m_ggslot(*this, "gg_slot"), m_gg_bypass(0) @@ -48,7 +48,7 @@ void nes_ggenie_device::device_start() save_item(NAME(m_gg_bypass)); } -void nes_ggenie_device::pcb_start(running_machine &machine, UINT8 *ciram_ptr, bool cart_mounted) +void nes_ggenie_device::pcb_start(running_machine &machine, uint8_t *ciram_ptr, bool cart_mounted) { device_nes_cart_interface::pcb_start(machine, ciram_ptr, cart_mounted); if (m_ggslot->m_cart) @@ -170,7 +170,7 @@ READ8_MEMBER(nes_ggenie_device::read_h) { if (m_gg_bypass && m_ggslot->m_cart) { - UINT8 rom_value = m_ggslot->m_cart->hi_access_rom(offset); + uint8_t rom_value = m_ggslot->m_cart->hi_access_rom(offset); // check if GG code has to act on this address for (int i = 0; i < 3; i++) diff --git a/src/devices/bus/nes/ggenie.h b/src/devices/bus/nes/ggenie.h index f0b55ee3753..2a1289c4865 100644 --- a/src/devices/bus/nes/ggenie.h +++ b/src/devices/bus/nes/ggenie.h @@ -12,7 +12,7 @@ class nes_ggenie_device : public nes_nrom_device { public: // construction/destruction - nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -35,7 +35,7 @@ public: virtual machine_config_constructor device_mconfig_additions() const override; virtual void pcb_reset() override; - virtual void pcb_start(running_machine &machine, UINT8 *ciram_ptr, bool cart_mounted) override; + virtual void pcb_start(running_machine &machine, uint8_t *ciram_ptr, bool cart_mounted) override; private: // emulate the Game Genie! @@ -43,9 +43,9 @@ private: int m_gg_bypass; // GG codes - UINT16 m_gg_addr[3]; - UINT8 m_gg_repl[3]; - UINT8 m_gg_comp[3]; + uint16_t m_gg_addr[3]; + uint8_t m_gg_repl[3]; + uint8_t m_gg_comp[3]; int m_gg_disable[3]; int m_gg_is_comp[3]; }; diff --git a/src/devices/bus/nes/henggedianzi.cpp b/src/devices/bus/nes/henggedianzi.cpp index 8a212e17bf3..2665dff69a2 100644 --- a/src/devices/bus/nes/henggedianzi.cpp +++ b/src/devices/bus/nes/henggedianzi.cpp @@ -43,17 +43,17 @@ const device_type NES_HENGG_XHZS = &device_creator; const device_type NES_HENGG_SHJY3 = &device_creator; -nes_hengg_srich_device::nes_hengg_srich_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_hengg_srich_device::nes_hengg_srich_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_HENGG_SRICH, "NES Cart Henggedianzi Super Rich PCB", tag, owner, clock, "nes_hengg_srich", __FILE__) { } -nes_hengg_xhzs_device::nes_hengg_xhzs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_hengg_xhzs_device::nes_hengg_xhzs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_HENGG_XHZS, "NES Cart Henggedianzi Xing He Zhan Shi PCB", tag, owner, clock, "nes_hengg_xhzs", __FILE__) { } -nes_hengg_shjy3_device::nes_hengg_shjy3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_hengg_shjy3_device::nes_hengg_shjy3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_HENGG_SHJY3, "NES Cart Henggedianzi Shen Hua Jian Yun III PCB", tag, owner, clock, "nes_hengg_shjy3", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_chr_mode(0) { } @@ -209,7 +209,7 @@ void nes_hengg_shjy3_device::update_banks() for (int i = 0; i < 8; i++) { - UINT8 chr_bank = m_mmc_vrom_bank[i] | (m_mmc_extra_bank[i] << 4); + uint8_t chr_bank = m_mmc_vrom_bank[i] | (m_mmc_extra_bank[i] << 4); if (m_mmc_vrom_bank[i] == 0xc8) { m_chr_mode = 0; @@ -233,8 +233,8 @@ WRITE8_MEMBER(nes_hengg_shjy3_device::write_h) if (offset >= 0x3000 && offset <= 0x600c) { - UINT8 shift = offset & 4; - UINT8 mmc_helper = ((offset & 8) | (offset >> 8)) >> 3; + uint8_t shift = offset & 4; + uint8_t mmc_helper = ((offset & 8) | (offset >> 8)) >> 3; mmc_helper += 2; mmc_helper &= 7; diff --git a/src/devices/bus/nes/henggedianzi.h b/src/devices/bus/nes/henggedianzi.h index 9f1344bfab9..59bdf287e78 100644 --- a/src/devices/bus/nes/henggedianzi.h +++ b/src/devices/bus/nes/henggedianzi.h @@ -12,7 +12,7 @@ class nes_hengg_srich_device : public nes_nrom_device { public: // construction/destruction - nes_hengg_srich_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_hengg_srich_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_hengg_xhzs_device : public nes_nrom_device { public: // construction/destruction - nes_hengg_xhzs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_hengg_xhzs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -45,7 +45,7 @@ class nes_hengg_shjy3_device : public nes_nrom_device { public: // construction/destruction - nes_hengg_shjy3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_hengg_shjy3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -57,13 +57,13 @@ public: private: void update_banks(); - UINT16 m_irq_count, m_irq_count_latch; + uint16_t m_irq_count, m_irq_count_latch; int m_irq_enable; int m_chr_mode; - UINT8 m_mmc_prg_bank[2]; - UINT8 m_mmc_vrom_bank[8]; - UINT8 m_mmc_extra_bank[8]; + uint8_t m_mmc_prg_bank[2]; + uint8_t m_mmc_vrom_bank[8]; + uint8_t m_mmc_extra_bank[8]; }; diff --git a/src/devices/bus/nes/hes.cpp b/src/devices/bus/nes/hes.cpp index ddfda0590d8..5daae861b6e 100644 --- a/src/devices/bus/nes/hes.cpp +++ b/src/devices/bus/nes/hes.cpp @@ -33,7 +33,7 @@ const device_type NES_HES = &device_creator; -nes_hes_device::nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_hes_device::nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_HES, "NES Cart HES PCB", tag, owner, clock, "nes_hes", __FILE__) { } diff --git a/src/devices/bus/nes/hes.h b/src/devices/bus/nes/hes.h index d6e59f90bae..5cd2ad539b8 100644 --- a/src/devices/bus/nes/hes.h +++ b/src/devices/bus/nes/hes.h @@ -12,7 +12,7 @@ class nes_hes_device : public nes_nrom_device { public: // construction/destruction - nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_hes_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/devices/bus/nes/hosenkan.cpp b/src/devices/bus/nes/hosenkan.cpp index 0525534cbb9..f9dccb9dbd8 100644 --- a/src/devices/bus/nes/hosenkan.cpp +++ b/src/devices/bus/nes/hosenkan.cpp @@ -32,7 +32,7 @@ const device_type NES_HOSENKAN = &device_creator; -nes_hosenkan_device::nes_hosenkan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_hosenkan_device::nes_hosenkan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_HOSENKAN, "NES Cart HOSENKAN PCB", tag, owner, clock, "nes_hosenkan", __FILE__), m_irq_count(0), m_irq_count_latch(0), diff --git a/src/devices/bus/nes/hosenkan.h b/src/devices/bus/nes/hosenkan.h index ca3840bcbb9..0d87cc6acff 100644 --- a/src/devices/bus/nes/hosenkan.h +++ b/src/devices/bus/nes/hosenkan.h @@ -12,7 +12,7 @@ class nes_hosenkan_device : public nes_nrom_device { public: // construction/destruction - nes_hosenkan_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_hosenkan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -23,11 +23,11 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count, m_irq_count_latch; - UINT8 m_irq_clear; + uint16_t m_irq_count, m_irq_count_latch; + uint8_t m_irq_clear; int m_irq_enable; - UINT8 m_latch; + uint8_t m_latch; }; diff --git a/src/devices/bus/nes/irem.cpp b/src/devices/bus/nes/irem.cpp index 5a8a1052849..5dea3e46832 100644 --- a/src/devices/bus/nes/irem.cpp +++ b/src/devices/bus/nes/irem.cpp @@ -42,27 +42,27 @@ const device_type NES_G101 = &device_creator; const device_type NES_H3001 = &device_creator; -nes_lrog017_device::nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_lrog017_device::nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_LROG017, "NES Cart Irem Discrete 74*161/161/21/138 PCB", tag, owner, clock, "nes_lrog017", __FILE__) { } -nes_holydivr_device::nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_holydivr_device::nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_HOLYDIVR, "NES Cart Irem Holy Diver PCB", tag, owner, clock, "nes_holydivr", __FILE__) { } -nes_tam_s1_device::nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tam_s1_device::nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TAM_S1, "NES Cart Irem TAM-S1 PCB", tag, owner, clock, "nes_tam_s1", __FILE__) { } -nes_g101_device::nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_g101_device::nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_G101, "NES Cart Irem G-101 PCB", tag, owner, clock, "nes_g101", __FILE__), m_latch(0) { } -nes_h3001_device::nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_h3001_device::nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_H3001, "NES Cart Irem H-3001 PCB", tag, owner, clock, "nes_h3001", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), irq_timer(nullptr) { } diff --git a/src/devices/bus/nes/irem.h b/src/devices/bus/nes/irem.h index 0e1e55803f7..3aef2278957 100644 --- a/src/devices/bus/nes/irem.h +++ b/src/devices/bus/nes/irem.h @@ -12,7 +12,7 @@ class nes_lrog017_device : public nes_nrom_device { public: // construction/destruction - nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_holydivr_device : public nes_nrom_device { public: // construction/destruction - nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -44,7 +44,7 @@ class nes_tam_s1_device : public nes_nrom_device { public: // construction/destruction - nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -60,7 +60,7 @@ class nes_g101_device : public nes_nrom_device { public: // construction/destruction - nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -69,7 +69,7 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_latch; + uint8_t m_latch; }; @@ -79,7 +79,7 @@ class nes_h3001_device : public nes_nrom_device { public: // construction/destruction - nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -89,7 +89,7 @@ public: virtual void pcb_reset() override; protected: - UINT16 m_irq_count, m_irq_count_latch; + uint16_t m_irq_count, m_irq_count_latch; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; diff --git a/src/devices/bus/nes/jaleco.cpp b/src/devices/bus/nes/jaleco.cpp index 13be40eac4c..f910b840b70 100644 --- a/src/devices/bus/nes/jaleco.cpp +++ b/src/devices/bus/nes/jaleco.cpp @@ -51,88 +51,88 @@ const device_type NES_JF29 = &device_creator; const device_type NES_JF33 = &device_creator; -nes_jf11_device::nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf11_device::nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_JF11, "NES Cart Jaleco JF-11 PCB", tag, owner, clock, "nes_jf11", __FILE__) { } -nes_jf13_device::nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf13_device::nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_JF13, "NES Cart Jaleco JF-13 PCB", tag, owner, clock, "nes_jf13", __FILE__), m_samples(*this, "samples") { } -nes_jf16_device::nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf16_device::nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_JF16, "NES Cart Jaleco JF-16 PCB", tag, owner, clock, "nes_jf16", __FILE__) { } -nes_jf17_device::nes_jf17_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) +nes_jf17_device::nes_jf17_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0) { } -nes_jf17_device::nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf17_device::nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_JF17, "NES Cart Jaleco JF-17 PCB", tag, owner, clock, "nes_jf17", __FILE__), m_latch(0) { } -nes_jf17_adpcm_device::nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf17_adpcm_device::nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_jf17_device(mconfig, NES_JF17_ADPCM, "NES Cart Jaleco JF-17 + ADPCM (Moero!! Pro Tennis) PCB", tag, owner, clock, "nes_jf17_pcm", __FILE__), m_samples(*this, "samples") { } -nes_jf19_device::nes_jf19_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) +nes_jf19_device::nes_jf19_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -nes_jf19_device::nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf19_device::nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_JF19, "NES Cart Jaleco JF-19 (Moero!! Pro Soccer) PCB", tag, owner, clock, "nes_jf19", __FILE__) { } -nes_jf19_adpcm_device::nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf19_adpcm_device::nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_jf19_device(mconfig, NES_JF19_ADPCM, "NES Cart Jaleco JF-19 + ADPCM (Moero!! Pro Yakyuu 88) PCB", tag, owner, clock, "nes_jf19_pcm", __FILE__), m_samples(*this, "samples") { } -nes_ss88006_device::nes_ss88006_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) +nes_ss88006_device::nes_ss88006_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0) { } -nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SS88006, "NES Cart Jaleco SS88006 PCB", tag, owner, clock, "nes_ss88006", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0) { } -nes_ss88006_adpcm_device::nes_ss88006_adpcm_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) +nes_ss88006_adpcm_device::nes_ss88006_adpcm_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) : nes_ss88006_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -nes_jf23_device::nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf23_device::nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_ss88006_adpcm_device(mconfig, NES_JF23, "NES Cart Jaleco Shin Moero Pro Yakyuu PCB", tag, owner, clock, "nes_jf23", __FILE__), m_samples(*this, "samples") { } -nes_jf24_device::nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf24_device::nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_ss88006_adpcm_device(mconfig, NES_JF24, "NES Cart Jaleco Terao no Dosukoi Oozumou PCB", tag, owner, clock, "nes_jf24", __FILE__), m_samples(*this, "samples") { } -nes_jf29_device::nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf29_device::nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_ss88006_adpcm_device(mconfig, NES_JF29, "NES Cart Jaleco Moe Pro! '90 PCB", tag, owner, clock, "nes_jf29", __FILE__), m_samples(*this, "samples") { } -nes_jf33_device::nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jf33_device::nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_ss88006_adpcm_device(mconfig, NES_JF33, "NES Cart Jaleco Moe Pro! Saikyou-hen PCB", tag, owner, clock, "nes_jf33", __FILE__), m_samples(*this, "samples") { @@ -475,7 +475,7 @@ void nes_ss88006_device::device_timer(emu_timer &timer, device_timer_id id, int WRITE8_MEMBER(nes_ss88006_device::ss88006_write) { - UINT8 bank; + uint8_t bank; LOG_MMC(("ss88006 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x7003) @@ -563,7 +563,7 @@ WRITE8_MEMBER(nes_ss88006_device::ss88006_write) // bits2-bits6 are sample number, bit1 is setup/enable/disable // program first write sample # + bit1 set to 'init' the sample // then it writes sample # + bit1 clear to 'start' the sample -void nes_ss88006_adpcm_device::ss88006_adpcm_write(address_space &space, offs_t offset, UINT8 data, samples_device *dev) +void nes_ss88006_adpcm_device::ss88006_adpcm_write(address_space &space, offs_t offset, uint8_t data, samples_device *dev) { LOG_MMC(("ss88006 write_h, offset: %04x, data: %02x\n", offset, data)); diff --git a/src/devices/bus/nes/jaleco.h b/src/devices/bus/nes/jaleco.h index 7d8536b71ff..5ad09a78cba 100644 --- a/src/devices/bus/nes/jaleco.h +++ b/src/devices/bus/nes/jaleco.h @@ -13,7 +13,7 @@ class nes_jf11_device : public nes_nrom_device { public: // construction/destruction - nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -29,7 +29,7 @@ class nes_jf13_device : public nes_nrom_device { public: // construction/destruction - nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -49,7 +49,7 @@ class nes_jf16_device : public nes_nrom_device { public: // construction/destruction - nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -65,8 +65,8 @@ class nes_jf17_device : public nes_nrom_device { public: // construction/destruction - nes_jf17_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); - nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf17_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); + nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -75,7 +75,7 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_latch; + uint8_t m_latch; }; @@ -85,7 +85,7 @@ class nes_jf17_adpcm_device : public nes_jf17_device { public: // construction/destruction - nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -101,8 +101,8 @@ class nes_jf19_device : public nes_nrom_device { public: // construction/destruction - nes_jf19_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); - nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf19_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); + nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -118,7 +118,7 @@ class nes_jf19_adpcm_device : public nes_jf19_device { public: // construction/destruction - nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -134,8 +134,8 @@ class nes_ss88006_device : public nes_nrom_device { public: // construction/destruction - nes_ss88006_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); - nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ss88006_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); + nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -146,17 +146,17 @@ public: virtual void pcb_reset() override; protected: - UINT16 m_irq_count, m_irq_count_latch; - UINT8 m_irq_mode; + uint16_t m_irq_count, m_irq_count_latch; + uint8_t m_irq_mode; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; - UINT8 m_mmc_prg_bank[3]; - UINT8 m_mmc_vrom_bank[8]; + uint8_t m_mmc_prg_bank[3]; + uint8_t m_mmc_vrom_bank[8]; - UINT8 m_latch; // used for samples, in derived classes + uint8_t m_latch; // used for samples, in derived classes }; @@ -166,10 +166,10 @@ class nes_ss88006_adpcm_device : public nes_ss88006_device { public: // construction/destruction - nes_ss88006_adpcm_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); + nes_ss88006_adpcm_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-level overrides - void ss88006_adpcm_write(address_space &space, offs_t offset, UINT8 data, samples_device *dev); + void ss88006_adpcm_write(address_space &space, offs_t offset, uint8_t data, samples_device *dev); }; @@ -179,7 +179,7 @@ class nes_jf23_device : public nes_ss88006_adpcm_device { public: // construction/destruction - nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; @@ -195,7 +195,7 @@ class nes_jf24_device : public nes_ss88006_adpcm_device { public: // construction/destruction - nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; @@ -211,7 +211,7 @@ class nes_jf29_device : public nes_ss88006_adpcm_device { public: // construction/destruction - nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; @@ -227,7 +227,7 @@ class nes_jf33_device : public nes_ss88006_adpcm_device { public: // construction/destruction - nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/nes/jy.cpp b/src/devices/bus/nes/jy.cpp index 08763d250e9..cf947e4b74d 100644 --- a/src/devices/bus/nes/jy.cpp +++ b/src/devices/bus/nes/jy.cpp @@ -42,30 +42,30 @@ const device_type NES_JY_TYPEB = &device_creator; const device_type NES_JY_TYPEC = &device_creator; -nes_jy_typea_device::nes_jy_typea_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) +nes_jy_typea_device::nes_jy_typea_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0), m_extra_chr_bank(0), m_extra_chr_mask(0), m_bank_6000(0), m_irq_mode(0), m_irq_count(0), m_irq_prescale(0), m_irq_prescale_mask(0), m_irq_flip(0), m_irq_enable(0), m_irq_up(0), m_irq_down(0), irq_timer(nullptr) { } -nes_jy_typea_device::nes_jy_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jy_typea_device::nes_jy_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_JY_TYPEA, "NES Cart JY Company Type A PCB", tag, owner, clock, "nes_jya", __FILE__), m_latch(0), m_extra_chr_bank(0), m_extra_chr_mask(0), m_bank_6000(0), m_irq_mode(0), m_irq_count(0), m_irq_prescale(0), m_irq_prescale_mask(0), m_irq_flip(0), m_irq_enable(0), m_irq_up(0), m_irq_down(0), irq_timer(nullptr) { } -nes_jy_typeb_device::nes_jy_typeb_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) +nes_jy_typeb_device::nes_jy_typeb_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) : nes_jy_typea_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -nes_jy_typeb_device::nes_jy_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jy_typeb_device::nes_jy_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_jy_typea_device(mconfig, NES_JY_TYPEB, "NES Cart JY Company Type B PCB", tag, owner, clock, "nes_jyb", __FILE__) { } -nes_jy_typec_device::nes_jy_typec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_jy_typec_device::nes_jy_typec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_jy_typeb_device(mconfig, NES_JY_TYPEC, "NES Cart JY Company Type C PCB", tag, owner, clock, "nes_jyc", __FILE__) { } @@ -296,15 +296,15 @@ READ8_MEMBER(nes_jy_typea_device::read_m) } -inline UINT8 nes_jy_typea_device::unscramble(UINT8 bank) +inline uint8_t nes_jy_typea_device::unscramble(uint8_t bank) { return BITSWAP8(bank & 0x7f,7,0,1,2,3,4,5,6); } void nes_jy_typea_device::update_prg() { - UINT8 exPrg = (m_reg[3] & 0x06) << 5; - UINT8 last = (m_reg[0] & 0x04) ? m_mmc_prg_bank[3] : 0x3f; + uint8_t exPrg = (m_reg[3] & 0x06) << 5; + uint8_t last = (m_reg[0] & 0x04) ? m_mmc_prg_bank[3] : 0x3f; switch (m_reg[0] & 0x03) { @@ -351,9 +351,9 @@ void nes_jy_typea_device::update_chr() // docs suggest m_reg[3] & 0x1f for chr_page below, // but 45 in 1 (JY-120A) menu requires to use this (from NEStopia) - UINT8 chr_page = (m_reg[3] & 1) | ((m_reg[3] & 0x18) >> 2); - UINT32 extra_chr_base = BIT(m_reg[3], 5) ? 0 : (chr_page * 0x100); - UINT32 extra_chr_mask = BIT(m_reg[3], 5) ? 0xffffff : 0xff; + uint8_t chr_page = (m_reg[3] & 1) | ((m_reg[3] & 0x18) >> 2); + uint32_t extra_chr_base = BIT(m_reg[3], 5) ? 0 : (chr_page * 0x100); + uint32_t extra_chr_mask = BIT(m_reg[3], 5) ? 0xffffff : 0xff; switch (m_reg[0] & 0x18) { diff --git a/src/devices/bus/nes/jy.h b/src/devices/bus/nes/jy.h index 1eca466d681..5c835e42a87 100644 --- a/src/devices/bus/nes/jy.h +++ b/src/devices/bus/nes/jy.h @@ -12,8 +12,8 @@ class nes_jy_typea_device : public nes_nrom_device { public: // construction/destruction - nes_jy_typea_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); - nes_jy_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jy_typea_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); + nes_jy_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -36,24 +36,24 @@ protected: void update_chr(); void update_mirror_typea(); virtual void update_mirror() { update_mirror_typea(); } - inline UINT8 unscramble(UINT8 bank); - - UINT8 m_mul[2]; - UINT8 m_latch; - UINT8 m_reg[4]; - UINT8 m_chr_latch[2]; // type C uses a more complex CHR 4K mode, and these vars are only changed for those games - UINT8 m_mmc_prg_bank[4]; - UINT16 m_mmc_nt_bank[4]; - UINT16 m_mmc_vrom_bank[8]; - UINT16 m_extra_chr_bank; - UINT16 m_extra_chr_mask; + inline uint8_t unscramble(uint8_t bank); + + uint8_t m_mul[2]; + uint8_t m_latch; + uint8_t m_reg[4]; + uint8_t m_chr_latch[2]; // type C uses a more complex CHR 4K mode, and these vars are only changed for those games + uint8_t m_mmc_prg_bank[4]; + uint16_t m_mmc_nt_bank[4]; + uint16_t m_mmc_vrom_bank[8]; + uint16_t m_extra_chr_bank; + uint16_t m_extra_chr_mask; int m_bank_6000; - UINT8 m_irq_mode; - UINT8 m_irq_count; - UINT8 m_irq_prescale; - UINT8 m_irq_prescale_mask; - UINT8 m_irq_flip; + uint8_t m_irq_mode; + uint8_t m_irq_count; + uint8_t m_irq_prescale; + uint8_t m_irq_prescale_mask; + uint8_t m_irq_flip; int m_irq_enable; int m_irq_up, m_irq_down; @@ -69,8 +69,8 @@ class nes_jy_typeb_device : public nes_jy_typea_device { public: // construction/destruction - nes_jy_typeb_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); - nes_jy_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jy_typeb_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); + nes_jy_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: void update_mirror_typeb(); @@ -83,7 +83,7 @@ class nes_jy_typec_device : public nes_jy_typeb_device { public: // construction/destruction - nes_jy_typec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_jy_typec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(chr_r) override; diff --git a/src/devices/bus/nes/kaiser.cpp b/src/devices/bus/nes/kaiser.cpp index e335681157d..4dfdeb867d6 100644 --- a/src/devices/bus/nes/kaiser.cpp +++ b/src/devices/bus/nes/kaiser.cpp @@ -60,57 +60,57 @@ const device_type NES_KS7016 = &device_creator; const device_type NES_KS7037 = &device_creator; -nes_ks7058_device::nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7058_device::nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KS7058, "NES Cart Kaiser KS-7058 PCB", tag, owner, clock, "nes_ks7058", __FILE__) { } -nes_ks7022_device::nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7022_device::nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KS7022, "NES Cart Kaiser KS-7022 PCB", tag, owner, clock, "nes_ks7022", __FILE__), m_latch(0) { } -nes_ks7032_device::nes_ks7032_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) +nes_ks7032_device::nes_ks7032_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_ks7032_device::nes_ks7032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7032_device::nes_ks7032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KS7032, "NES Cart Kaiser KS-7032 PCB", tag, owner, clock, "nes_ks7032", __FILE__), m_latch(0), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_ks202_device::nes_ks202_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks202_device::nes_ks202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_ks7032_device(mconfig, NES_KS202, "NES Cart Kaiser KS-202 PCB", tag, owner, clock, "nes_ks202", __FILE__) { } -nes_ks7017_device::nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7017_device::nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KS7017, "NES Cart Kaiser KS-7017 PCB", tag, owner, clock, "nes_ks7017", __FILE__), m_latch(0), m_irq_count(0), m_irq_status(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_ks7012_device::nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7012_device::nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KS7012, "NES Cart Kaiser KS-7012 PCB", tag, owner, clock, "nes_ks7012", __FILE__) { } -nes_ks7013b_device::nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7013b_device::nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KS7013B, "NES Cart Kaiser KS-7013B PCB", tag, owner, clock, "nes_ks7013b", __FILE__) { } -nes_ks7031_device::nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7031_device::nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KS7031, "NES Cart Kaiser KS-7031 PCB", tag, owner, clock, "nes_ks7031", __FILE__) { } -nes_ks7016_device::nes_ks7016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7016_device::nes_ks7016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KS7031, "NES Cart Kaiser KS-7016 PCB", tag, owner, clock, "nes_ks7016", __FILE__) { } -nes_ks7037_device::nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7037_device::nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KS7037, "NES Cart Kaiser KS-7037 PCB", tag, owner, clock, "nes_ks7037", __FILE__) { } @@ -657,7 +657,7 @@ READ8_MEMBER(nes_ks7016_device::read_m) WRITE8_MEMBER(nes_ks7016_device::write_h) { LOG_MMC(("ks7016 write_h, offset: %04x, data: %02x\n", offset, data)); - UINT8 mask = offset & 0x30; + uint8_t mask = offset & 0x30; if ((offset & 0x5943) == 0x5943) m_reg = (mask == 0x30) ? 0xb : (((offset >> 2) & 0x0f) << 1); if ((offset & 0x5943) == 0x5903) diff --git a/src/devices/bus/nes/kaiser.h b/src/devices/bus/nes/kaiser.h index 6d58ff134fe..c6d094d4390 100644 --- a/src/devices/bus/nes/kaiser.h +++ b/src/devices/bus/nes/kaiser.h @@ -12,7 +12,7 @@ class nes_ks7058_device : public nes_nrom_device { public: // construction/destruction - nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_ks7022_device : public nes_nrom_device { public: // construction/destruction - nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -38,7 +38,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -48,8 +48,8 @@ class nes_ks7032_device : public nes_nrom_device { public: // construction/destruction - nes_ks7032_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); - nes_ks7032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7032_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); + nes_ks7032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -63,10 +63,10 @@ public: protected: void prg_update(); - UINT8 m_latch; - UINT8 m_reg[8]; + uint8_t m_latch; + uint8_t m_reg[8]; - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; @@ -80,7 +80,7 @@ class nes_ks202_device : public nes_ks7032_device { public: // construction/destruction - nes_ks202_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_READ8_MEMBER(read_m) override; @@ -94,7 +94,7 @@ class nes_ks7017_device : public nes_nrom_device { public: // construction/destruction - nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -106,10 +106,10 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; - UINT16 m_irq_count; - UINT8 m_irq_status; + uint16_t m_irq_count; + uint8_t m_irq_status; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; @@ -123,7 +123,7 @@ class nes_ks7012_device : public nes_nrom_device { public: // construction/destruction - nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -138,7 +138,7 @@ class nes_ks7013b_device : public nes_nrom_device { public: // construction/destruction - nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -155,7 +155,7 @@ class nes_ks7031_device : public nes_nrom_device { public: // construction/destruction - nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -166,7 +166,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; @@ -176,7 +176,7 @@ class nes_ks7016_device : public nes_nrom_device { public: // construction/destruction - nes_ks7016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -186,7 +186,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg; + uint8_t m_reg; }; // ======================> nes_ks7037_device @@ -195,7 +195,7 @@ class nes_ks7037_device : public nes_nrom_device { public: // construction/destruction - nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -208,8 +208,8 @@ public: private: void update_prg(); - UINT8 m_latch; - UINT8 m_reg[8]; + uint8_t m_latch; + uint8_t m_reg[8]; }; diff --git a/src/devices/bus/nes/karastudio.cpp b/src/devices/bus/nes/karastudio.cpp index 13366022114..eb2177a240d 100644 --- a/src/devices/bus/nes/karastudio.cpp +++ b/src/devices/bus/nes/karastudio.cpp @@ -71,7 +71,7 @@ READ8_MEMBER(kstudio_cart_interface::read) const device_type NES_KSEXPANSION_SLOT = &device_creator; -nes_kstudio_slot_device::nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_kstudio_slot_device::nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_KSEXPANSION_SLOT, "NES Karaoke Studio Expansion Slot", tag, owner, clock, "nes_ks_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_cart(nullptr) @@ -100,7 +100,7 @@ image_init_result nes_kstudio_slot_device::call_load() { if (m_cart) { - UINT8 *ROM = m_cart->get_cart_base(); + uint8_t *ROM = m_cart->get_cart_base(); if (!ROM) return image_init_result::FAIL; @@ -144,7 +144,7 @@ ROM_END const device_type NES_KSEXPANSION_ROM = &device_creator; -nes_kstudio_rom_device::nes_kstudio_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_kstudio_rom_device::nes_kstudio_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_KSEXPANSION_ROM, "NES Karaoke Studio Expansion ROM", tag, owner, clock, "nes_ks_rom", __FILE__), kstudio_cart_interface( mconfig, *this ) { @@ -152,7 +152,7 @@ nes_kstudio_rom_device::nes_kstudio_rom_device(const machine_config &mconfig, co void nes_kstudio_rom_device::device_start() { - m_rom = (UINT8*)memregion("exrom")->base(); + m_rom = (uint8_t*)memregion("exrom")->base(); save_item(NAME(m_bank)); } @@ -166,7 +166,7 @@ const tiny_rom_entry *nes_kstudio_rom_device::device_rom_region() const return ROM_NAME( ks_exp_rom ); } -UINT8 *nes_kstudio_rom_device::get_cart_base() +uint8_t *nes_kstudio_rom_device::get_cart_base() { return m_rom; } @@ -181,7 +181,7 @@ UINT8 *nes_kstudio_rom_device::get_cart_base() const device_type NES_KARAOKESTUDIO = &device_creator; -nes_karaokestudio_device::nes_karaokestudio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_karaokestudio_device::nes_karaokestudio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_KARAOKESTUDIO, "NES Cart Bandai Karaoke Studio PCB", tag, owner, clock, "nes_karaoke", __FILE__), m_exp_active(0), m_subslot(*this, "exp_slot"), m_mic_ipt(*this, "MIC") diff --git a/src/devices/bus/nes/karastudio.h b/src/devices/bus/nes/karastudio.h index f5d15ce6e46..2accd9bf346 100644 --- a/src/devices/bus/nes/karastudio.h +++ b/src/devices/bus/nes/karastudio.h @@ -25,14 +25,14 @@ public: // reading and writing virtual DECLARE_READ8_MEMBER(read); - UINT8 *get_cart_base() { return m_rom; } - void write_prg_bank(UINT8 bank) { m_bank = bank; } + uint8_t *get_cart_base() { return m_rom; } + void write_prg_bank(uint8_t bank) { m_bank = bank; } protected: // internal state - UINT8 *m_rom; + uint8_t *m_rom; // ROM is accessed via two 16K banks, but only the first one can be switched - UINT8 m_bank; + uint8_t m_bank; }; // ======================> nes_kstudio_slot_device @@ -43,7 +43,7 @@ class nes_kstudio_slot_device : public device_t, { public: // construction/destruction - nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~nes_kstudio_slot_device(); // device-level overrides @@ -67,7 +67,7 @@ public: virtual std::string get_default_card_software() override; virtual DECLARE_READ8_MEMBER(read); - void write_prg_bank(UINT8 bank) { if (m_cart) m_cart->write_prg_bank(bank); } + void write_prg_bank(uint8_t bank) { if (m_cart) m_cart->write_prg_bank(bank); } kstudio_cart_interface* m_cart; }; @@ -94,11 +94,11 @@ class nes_kstudio_rom_device : public device_t, { public: // construction/destruction - nes_kstudio_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_kstudio_rom_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; - virtual UINT8* get_cart_base(); + virtual uint8_t* get_cart_base(); protected: // device-level overrides @@ -122,7 +122,7 @@ class nes_karaokestudio_device : public nes_nrom_device { public: // construction/destruction - nes_karaokestudio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_karaokestudio_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/devices/bus/nes/konami.cpp b/src/devices/bus/nes/konami.cpp index ded2e4b0980..a7565d5af96 100644 --- a/src/devices/bus/nes/konami.cpp +++ b/src/devices/bus/nes/konami.cpp @@ -51,38 +51,38 @@ const device_type NES_VRC6 = &device_creator; const device_type NES_VRC7 = &device_creator; -nes_konami_vrc1_device::nes_konami_vrc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_konami_vrc1_device::nes_konami_vrc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_VRC1, "NES Cart Konami VRC-1 PCB", tag, owner, clock, "nes_vrc1", __FILE__) { } -nes_konami_vrc2_device::nes_konami_vrc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_konami_vrc2_device::nes_konami_vrc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_VRC2, "NES Cart Konami VRC-2 PCB", tag, owner, clock, "nes_vrc2", __FILE__), m_latch(0) { } -nes_konami_vrc3_device::nes_konami_vrc3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_konami_vrc3_device::nes_konami_vrc3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_VRC3, "NES Cart Konami VRC-3 PCB", tag, owner, clock, "nes_vrc3", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0), m_irq_mode(0), irq_timer(nullptr) { } -nes_konami_vrc4_device::nes_konami_vrc4_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) +nes_konami_vrc4_device::nes_konami_vrc4_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0), m_mmc_prg_bank(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0), m_irq_mode(0), m_irq_prescale(0), irq_timer(nullptr) { } -nes_konami_vrc4_device::nes_konami_vrc4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_konami_vrc4_device::nes_konami_vrc4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_VRC4, "NES Cart Konami VRC-4 PCB", tag, owner, clock, "nes_vrc4", __FILE__), m_latch(0), m_mmc_prg_bank(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0), m_irq_mode(0), m_irq_prescale(0), irq_timer(nullptr) { } -nes_konami_vrc6_device::nes_konami_vrc6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_konami_vrc6_device::nes_konami_vrc6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_konami_vrc4_device(mconfig, NES_VRC6, "NES Cart Konami VRC-6 PCB", tag, owner, clock, "nes_vrc6", __FILE__), m_vrc6snd(*this, "vrc6snd") { } -nes_konami_vrc7_device::nes_konami_vrc7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_konami_vrc7_device::nes_konami_vrc7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_konami_vrc4_device(mconfig, NES_VRC7, "NES Cart Konami VRC-7 PCB", tag, owner, clock, "nes_vrc7", __FILE__), m_ym2413(*this, "ym") { @@ -309,8 +309,8 @@ WRITE8_MEMBER(nes_konami_vrc2_device::write_m) WRITE8_MEMBER(nes_konami_vrc2_device::write_h) { - UINT8 bank, shift, mask; - UINT16 add_lines = ((offset << (9 - m_vrc_ls_prg_a)) & 0x200) | ((offset << (8 - m_vrc_ls_prg_b)) & 0x100); + uint8_t bank, shift, mask; + uint16_t add_lines = ((offset << (9 - m_vrc_ls_prg_a)) & 0x200) | ((offset << (8 - m_vrc_ls_prg_b)) & 0x100); LOG_MMC(("VRC-2 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x7000) @@ -487,8 +487,8 @@ void nes_konami_vrc4_device::set_prg() WRITE8_MEMBER(nes_konami_vrc4_device::write_h) { - UINT8 bank, shift, mask; - UINT16 add_lines = ((offset << (9 - m_vrc_ls_prg_a)) & 0x200) | ((offset << (8 - m_vrc_ls_prg_b)) & 0x100); + uint8_t bank, shift, mask; + uint16_t add_lines = ((offset << (9 - m_vrc_ls_prg_a)) & 0x200) | ((offset << (8 - m_vrc_ls_prg_b)) & 0x100); LOG_MMC(("VRC-4 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x7000) @@ -569,8 +569,8 @@ WRITE8_MEMBER(nes_konami_vrc4_device::write_h) WRITE8_MEMBER(nes_konami_vrc6_device::write_h) { - UINT8 bank; - UINT16 add_lines = ((offset << (9 - m_vrc_ls_prg_a)) & 0x200) | ((offset << (8 - m_vrc_ls_prg_b)) & 0x100); + uint8_t bank; + uint16_t add_lines = ((offset << (9 - m_vrc_ls_prg_a)) & 0x200) | ((offset << (8 - m_vrc_ls_prg_b)) & 0x100); LOG_MMC(("VRC-6 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x7000) @@ -668,7 +668,7 @@ machine_config_constructor nes_konami_vrc6_device::device_mconfig_additions() co WRITE8_MEMBER(nes_konami_vrc7_device::write_h) { - UINT8 bank; + uint8_t bank; LOG_MMC(("VRC-7 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x7038) diff --git a/src/devices/bus/nes/konami.h b/src/devices/bus/nes/konami.h index 8a0ac20ff75..11a6e943bb3 100644 --- a/src/devices/bus/nes/konami.h +++ b/src/devices/bus/nes/konami.h @@ -14,7 +14,7 @@ class nes_konami_vrc1_device : public nes_nrom_device { public: // construction/destruction - nes_konami_vrc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_konami_vrc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -23,7 +23,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_mmc_vrom_bank[2]; + uint8_t m_mmc_vrom_bank[2]; }; @@ -33,7 +33,7 @@ class nes_konami_vrc2_device : public nes_nrom_device { public: // construction/destruction - nes_konami_vrc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_konami_vrc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -44,8 +44,8 @@ public: virtual void pcb_reset() override; private: - UINT8 m_mmc_vrom_bank[8]; - UINT8 m_latch; + uint8_t m_mmc_vrom_bank[8]; + uint8_t m_latch; }; @@ -55,7 +55,7 @@ class nes_konami_vrc3_device : public nes_nrom_device { public: // construction/destruction - nes_konami_vrc3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_konami_vrc3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -65,7 +65,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count, m_irq_count_latch; + uint16_t m_irq_count, m_irq_count_latch; int m_irq_enable, m_irq_enable_latch; int m_irq_mode; @@ -80,8 +80,8 @@ class nes_konami_vrc4_device : public nes_nrom_device { public: // construction/destruction - nes_konami_vrc4_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); - nes_konami_vrc4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_konami_vrc4_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); + nes_konami_vrc4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -92,11 +92,11 @@ public: protected: void set_prg(); - UINT8 m_mmc_vrom_bank[8]; - UINT8 m_latch, m_mmc_prg_bank; + uint8_t m_mmc_vrom_bank[8]; + uint8_t m_latch, m_mmc_prg_bank; void irq_tick(); - UINT16 m_irq_count, m_irq_count_latch; + uint16_t m_irq_count, m_irq_count_latch; int m_irq_enable, m_irq_enable_latch; int m_irq_mode; int m_irq_prescale; @@ -112,7 +112,7 @@ class nes_konami_vrc6_device : public nes_konami_vrc4_device { public: // construction/destruction - nes_konami_vrc6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_konami_vrc6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -129,7 +129,7 @@ class nes_konami_vrc7_device : public nes_konami_vrc4_device { public: // construction/destruction - nes_konami_vrc7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_konami_vrc7_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/devices/bus/nes/legacy.cpp b/src/devices/bus/nes/legacy.cpp index cdcc69df682..888a5077146 100644 --- a/src/devices/bus/nes/legacy.cpp +++ b/src/devices/bus/nes/legacy.cpp @@ -39,22 +39,22 @@ const device_type NES_FFE4 = &device_creator; const device_type NES_FFE8 = &device_creator; -nes_ffe3_device::nes_ffe3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ffe3_device::nes_ffe3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_FFE3, "NES Cart FFE-3 PCB", tag, owner, clock, "nes_ff3", __FILE__) { } -nes_ffe4_device::nes_ffe4_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) +nes_ffe4_device::nes_ffe4_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_exram_enabled(0), m_exram_bank(0) { } -nes_ffe4_device::nes_ffe4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ffe4_device::nes_ffe4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_FFE4, "NES Cart FFE-4 PCB", tag, owner, clock, "nes_ff4", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_exram_enabled(0), m_exram_bank(0) { } -nes_ffe8_device::nes_ffe8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ffe8_device::nes_ffe8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_ffe4_device(mconfig, NES_FFE8, "NES Cart FFE-8 PCB", tag, owner, clock, "nes_ff8", __FILE__) { } diff --git a/src/devices/bus/nes/legacy.h b/src/devices/bus/nes/legacy.h index 4efc4bc96f5..396eec92b46 100644 --- a/src/devices/bus/nes/legacy.h +++ b/src/devices/bus/nes/legacy.h @@ -12,7 +12,7 @@ class nes_ffe3_device : public nes_nrom_device { public: // construction/destruction - nes_ffe3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ffe3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,8 +28,8 @@ class nes_ffe4_device : public nes_nrom_device { public: // construction/destruction - nes_ffe4_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); - nes_ffe4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ffe4_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); + nes_ffe4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -42,16 +42,16 @@ public: virtual void pcb_reset() override; protected: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; - UINT8 m_latch; + uint8_t m_latch; int m_exram_enabled; int m_exram_bank; - UINT8 m_exram[0x8000]; + uint8_t m_exram[0x8000]; }; @@ -61,7 +61,7 @@ class nes_ffe8_device : public nes_ffe4_device { public: // construction/destruction - nes_ffe8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ffe8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_l) override; diff --git a/src/devices/bus/nes/mmc1.cpp b/src/devices/bus/nes/mmc1.cpp index b1bd17d3917..983fb5bfcb8 100644 --- a/src/devices/bus/nes/mmc1.cpp +++ b/src/devices/bus/nes/mmc1.cpp @@ -39,27 +39,27 @@ const device_type NES_SOROM_A = &device_creator; -nes_sxrom_device::nes_sxrom_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) +nes_sxrom_device::nes_sxrom_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_reg_write_enable(0), m_latch(0), m_count(0) { } -nes_sxrom_device::nes_sxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sxrom_device::nes_sxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SXROM, "NES Cart SxROM (MMC-1) PCB", tag, owner, clock, "nes_sxrom", __FILE__), m_reg_write_enable(0), m_latch(0), m_count(0) { } -nes_sorom_device::nes_sorom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sorom_device::nes_sorom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sxrom_device(mconfig, NES_SOROM, "NES Cart SOROM (MMC-1) PCB", tag, owner, clock, "nes_sorom", __FILE__) { } -nes_sxrom_a_device::nes_sxrom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sxrom_a_device::nes_sxrom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sxrom_device(mconfig, NES_SXROM_A, "NES Cart SxROM (MMC-1A) PCB", tag, owner, clock, "nes_sxrom_a", __FILE__) { } -nes_sorom_a_device::nes_sorom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sorom_a_device::nes_sorom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sxrom_device(mconfig, NES_SOROM_A, "NES Cart SOROM (MMC-1A) PCB", tag, owner, clock, "nes_sorom_a", __FILE__) { } @@ -144,7 +144,7 @@ TIMER_CALLBACK_MEMBER( nes_sxrom_device::resync_callback ) void nes_sxrom_device::set_prg() { - UINT8 prg_mode, prg_offset; + uint8_t prg_mode, prg_offset; prg_mode = m_reg[0] & 0x0c; /* prg_mode&0x8 determines bank size: 32k (if 0) or 16k (if 1)? when in 16k mode, @@ -179,7 +179,7 @@ void nes_sxrom_device::set_prg() void nes_sxrom_device::set_chr() { - UINT8 chr_mode = BIT(m_reg[0], 4); + uint8_t chr_mode = BIT(m_reg[0], 4); if (chr_mode) { @@ -267,7 +267,7 @@ WRITE8_MEMBER( nes_sxrom_device::write_h ) WRITE8_MEMBER(nes_sxrom_device::write_m) { - UINT8 bank = (m_reg[1] >> 2) & 3; + uint8_t bank = (m_reg[1] >> 2) & 3; LOG_MMC(("sxrom write_m, offset: %04x, data: %02x\n", offset, data)); if (!BIT(m_reg[3], 4)) // WRAM enabled @@ -281,7 +281,7 @@ WRITE8_MEMBER(nes_sxrom_device::write_m) READ8_MEMBER(nes_sxrom_device::read_m) { - UINT8 bank = (m_reg[1] >> 2) & 3; + uint8_t bank = (m_reg[1] >> 2) & 3; LOG_MMC(("sxrom read_m, offset: %04x\n", offset)); if (!BIT(m_reg[3], 4)) // WRAM enabled @@ -298,7 +298,7 @@ READ8_MEMBER(nes_sxrom_device::read_m) // SOROM has two RAM banks, the first is not battery backed up, the second is. WRITE8_MEMBER(nes_sorom_device::write_m) { - UINT8 type = BIT(m_reg[0], 4) ? BIT(m_reg[1], 4) : BIT(m_reg[1], 3); + uint8_t type = BIT(m_reg[0], 4) ? BIT(m_reg[1], 4) : BIT(m_reg[1], 3); LOG_MMC(("sorom write_m, offset: %04x, data: %02x\n", offset, data)); if (!BIT(m_reg[3], 4)) // WRAM enabled @@ -312,7 +312,7 @@ WRITE8_MEMBER(nes_sorom_device::write_m) READ8_MEMBER(nes_sorom_device::read_m) { - UINT8 type = BIT(m_reg[0], 4) ? BIT(m_reg[1], 4) : BIT(m_reg[1], 3); + uint8_t type = BIT(m_reg[0], 4) ? BIT(m_reg[1], 4) : BIT(m_reg[1], 3); LOG_MMC(("sorom read_m, offset: %04x\n", offset)); if (!BIT(m_reg[3], 4)) // WRAM enabled @@ -329,7 +329,7 @@ READ8_MEMBER(nes_sorom_device::read_m) // MMC1A boards have no wram enable/disable bit WRITE8_MEMBER(nes_sxrom_a_device::write_m) { - UINT8 bank = (m_reg[1] >> 2) & 3; + uint8_t bank = (m_reg[1] >> 2) & 3; LOG_MMC(("sxrom_a write_m, offset: %04x, data: %02x\n", offset, data)); if (!m_battery.empty()) @@ -340,7 +340,7 @@ WRITE8_MEMBER(nes_sxrom_a_device::write_m) READ8_MEMBER(nes_sxrom_a_device::read_m) { - UINT8 bank = (m_reg[1] >> 2) & 3; + uint8_t bank = (m_reg[1] >> 2) & 3; LOG_MMC(("sxrom_a read_m, offset: %04x\n", offset)); if (!m_battery.empty()) @@ -353,7 +353,7 @@ READ8_MEMBER(nes_sxrom_a_device::read_m) WRITE8_MEMBER(nes_sorom_a_device::write_m) { - UINT8 type = BIT(m_reg[0], 4) ? BIT(m_reg[1], 4) : BIT(m_reg[1], 3); + uint8_t type = BIT(m_reg[0], 4) ? BIT(m_reg[1], 4) : BIT(m_reg[1], 3); LOG_MMC(("sorom_a write_m, offset: %04x, data: %02x\n", offset, data)); if (type) @@ -364,7 +364,7 @@ WRITE8_MEMBER(nes_sorom_a_device::write_m) READ8_MEMBER(nes_sorom_a_device::read_m) { - UINT8 type = BIT(m_reg[0], 4) ? BIT(m_reg[1], 4) : BIT(m_reg[1], 3); + uint8_t type = BIT(m_reg[0], 4) ? BIT(m_reg[1], 4) : BIT(m_reg[1], 3); LOG_MMC(("sorom_a read_m, offset: %04x\n", offset)); if (type) diff --git a/src/devices/bus/nes/mmc1.h b/src/devices/bus/nes/mmc1.h index 7b71b732a87..8b30b6f0bbf 100644 --- a/src/devices/bus/nes/mmc1.h +++ b/src/devices/bus/nes/mmc1.h @@ -12,8 +12,8 @@ class nes_sxrom_device : public nes_nrom_device { public: // construction/destruction - nes_sxrom_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); - nes_sxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sxrom_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); + nes_sxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -29,7 +29,7 @@ protected: virtual void set_prg(); virtual void set_chr(); - UINT8 m_reg[4]; + uint8_t m_reg[4]; int m_reg_write_enable; int m_latch; int m_count; @@ -39,7 +39,7 @@ class nes_sorom_device : public nes_sxrom_device { public: // construction/destruction - nes_sorom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sorom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(read_m) override; virtual DECLARE_WRITE8_MEMBER(write_m) override; @@ -51,7 +51,7 @@ class nes_sxrom_a_device : public nes_sxrom_device { public: // construction/destruction - nes_sxrom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sxrom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(read_m) override; virtual DECLARE_WRITE8_MEMBER(write_m) override; @@ -61,7 +61,7 @@ class nes_sorom_a_device : public nes_sxrom_device { public: // construction/destruction - nes_sorom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sorom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(read_m) override; virtual DECLARE_WRITE8_MEMBER(write_m) override; diff --git a/src/devices/bus/nes/mmc2.cpp b/src/devices/bus/nes/mmc2.cpp index 9351761f31c..1fedbab04df 100644 --- a/src/devices/bus/nes/mmc2.cpp +++ b/src/devices/bus/nes/mmc2.cpp @@ -32,19 +32,19 @@ const device_type NES_PXROM = &device_creator; const device_type NES_FXROM = &device_creator; -nes_pxrom_device::nes_pxrom_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) +nes_pxrom_device::nes_pxrom_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch1(0), m_latch2(0) { } -nes_pxrom_device::nes_pxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_pxrom_device::nes_pxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_PXROM, "NES Cart PxROM (MMC-2) PCB", tag, owner, clock, "nes_pxrom", __FILE__), m_latch1(0), m_latch2(0) { } -nes_fxrom_device::nes_fxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_fxrom_device::nes_fxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_pxrom_device(mconfig, NES_FXROM, "NES Cart FxROM (MMC-4) PCB", tag, owner, clock, "nes_fxrom", __FILE__) { } diff --git a/src/devices/bus/nes/mmc2.h b/src/devices/bus/nes/mmc2.h index d127aafec2f..ecdf5e30ed0 100644 --- a/src/devices/bus/nes/mmc2.h +++ b/src/devices/bus/nes/mmc2.h @@ -12,8 +12,8 @@ class nes_pxrom_device : public nes_nrom_device { public: // construction/destruction - nes_pxrom_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); - nes_pxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_pxrom_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); + nes_pxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -24,7 +24,7 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_reg[4]; + uint8_t m_reg[4]; int m_latch1, m_latch2; }; @@ -35,7 +35,7 @@ class nes_fxrom_device : public nes_pxrom_device { public: // construction/destruction - nes_fxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; diff --git a/src/devices/bus/nes/mmc3.cpp b/src/devices/bus/nes/mmc3.cpp index a9bc5631b0d..1357ceb119b 100644 --- a/src/devices/bus/nes/mmc3.cpp +++ b/src/devices/bus/nes/mmc3.cpp @@ -53,39 +53,39 @@ const device_type NES_QJ_PCB = &device_creator; const device_type NES_ZZ_PCB = &device_creator; -nes_txrom_device::nes_txrom_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) +nes_txrom_device::nes_txrom_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_prg_base(0), m_prg_mask(0), m_chr_base(0), m_chr_mask(0), m_latch(0), m_wram_protect(0), m_alt_irq(0), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0) { } -nes_txrom_device::nes_txrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_txrom_device::nes_txrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TXROM, "NES Cart TxROM (MMC-3) PCB", tag, owner, clock, "nes_txrom", __FILE__), m_prg_base(0), m_prg_mask(0), m_chr_base(0), m_chr_mask(0), m_latch(0), m_wram_protect(0), m_alt_irq(0), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0) { } -nes_hkrom_device::nes_hkrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_hkrom_device::nes_hkrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_HKROM, "NES Cart HKROM (MMC-6) PCB", tag, owner, clock, "nes_hkrom", __FILE__), m_wram_enable(0), m_mmc6_reg(0) { } -nes_txsrom_device::nes_txsrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_txsrom_device::nes_txsrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_TXSROM, "NES Cart TxSROM PCB", tag, owner, clock, "nes_txsrom", __FILE__) { } -nes_tqrom_device::nes_tqrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tqrom_device::nes_tqrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_TQROM, "NES Cart TQROM PCB", tag, owner, clock, "nes_tqrom", __FILE__) { } -nes_qj_device::nes_qj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_qj_device::nes_qj_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_QJ_PCB, "NES Cart NES-QJ PCB", tag, owner, clock, "nes_qj", __FILE__) { } -nes_zz_device::nes_zz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_zz_device::nes_zz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_ZZ_PCB, "NES Cart PAL-ZZ PCB", tag, owner, clock, "nes_zz", __FILE__) { } @@ -224,7 +224,7 @@ void nes_txrom_device::chr_cb( int start, int bank, int source ) void nes_txrom_device::set_prg( int prg_base, int prg_mask ) { - UINT8 prg_flip = (m_latch & 0x40) ? 2 : 0; + uint8_t prg_flip = (m_latch & 0x40) ? 2 : 0; prg_cb(0, prg_base | (m_mmc_prg_bank[0 ^ prg_flip] & prg_mask)); prg_cb(1, prg_base | (m_mmc_prg_bank[1] & prg_mask)); @@ -232,9 +232,9 @@ void nes_txrom_device::set_prg( int prg_base, int prg_mask ) prg_cb(3, prg_base | (m_mmc_prg_bank[3] & prg_mask)); } -void nes_txrom_device::set_chr( UINT8 chr, int chr_base, int chr_mask ) +void nes_txrom_device::set_chr( uint8_t chr, int chr_base, int chr_mask ) { - UINT8 chr_page = (m_latch & 0x80) >> 5; + uint8_t chr_page = (m_latch & 0x80) >> 5; chr_cb(chr_page ^ 0, chr_base | ((m_mmc_vrom_bank[0] & ~0x01) & chr_mask), chr); chr_cb(chr_page ^ 1, chr_base | ((m_mmc_vrom_bank[0] | 0x01) & chr_mask), chr); @@ -248,7 +248,7 @@ void nes_txrom_device::set_chr( UINT8 chr, int chr_base, int chr_mask ) WRITE8_MEMBER(nes_txrom_device::txrom_write) { - UINT8 mmc_helper, cmd; + uint8_t mmc_helper, cmd; LOG_MMC(("txrom_write, offset: %04x, data: %02x\n", offset, data)); @@ -354,7 +354,7 @@ READ8_MEMBER(nes_txrom_device::read_m) WRITE8_MEMBER(nes_hkrom_device::write_m) { - UINT8 write_hi, write_lo; + uint8_t write_hi, write_lo; LOG_MMC(("hkrom write_m, offset: %04x, data: %02x\n", offset, data)); if (offset < 0x1000) @@ -393,7 +393,7 @@ READ8_MEMBER(nes_hkrom_device::read_m) WRITE8_MEMBER(nes_hkrom_device::write_h) { - UINT8 mmc6_helper; + uint8_t mmc6_helper; LOG_MMC(("hkrom write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) @@ -494,10 +494,10 @@ WRITE8_MEMBER(nes_txsrom_device::write_h) -------------------------------------------------*/ -void nes_tqrom_device::set_chr( UINT8 chr, int chr_base, int chr_mask ) +void nes_tqrom_device::set_chr( uint8_t chr, int chr_base, int chr_mask ) { - UINT8 chr_page = (m_latch & 0x80) >> 5; - UINT8 src[6], mask[6]; + uint8_t chr_page = (m_latch & 0x80) >> 5; + uint8_t src[6], mask[6]; // TQROM ignores the source, base and mask set by the MMC3 and determines them based on vrom bank bits for (int i = 0; i < 6; i++) @@ -550,7 +550,7 @@ WRITE8_MEMBER(nes_qj_device::write_m) WRITE8_MEMBER(nes_zz_device::write_m) { - UINT8 mmc_helper = data & 0x07; + uint8_t mmc_helper = data & 0x07; LOG_MMC(("zz write_m, offset: %04x, data: %02x\n", offset, data)); m_prg_base = (BIT(mmc_helper, 2) << 4) | (((mmc_helper & 0x03) == 0x03) ? 0x08 : 0); diff --git a/src/devices/bus/nes/mmc3.h b/src/devices/bus/nes/mmc3.h index 6436b247cea..17578b92adf 100644 --- a/src/devices/bus/nes/mmc3.h +++ b/src/devices/bus/nes/mmc3.h @@ -12,8 +12,8 @@ class nes_txrom_device : public nes_nrom_device { public: // construction/destruction - nes_txrom_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); - nes_txrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_txrom_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); + nes_txrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { mmc3_start(); } @@ -29,13 +29,13 @@ public: protected: virtual void set_prg(int prg_base, int prg_mask); - virtual void set_chr(UINT8 chr, int chr_base, int chr_mask); + virtual void set_chr(uint8_t chr, int chr_base, int chr_mask); void mmc3_start(); void mmc3_common_initialize(int prg_mask, int chr_mask, int IRQ_type); // are there MMC3 clones which need more regs? - UINT16 m_mmc_prg_bank[4]; - UINT16 m_mmc_vrom_bank[8]; // a few clones need more than the 6 banks used by base MMC3 (e.g. waixing_g) + uint16_t m_mmc_prg_bank[4]; + uint16_t m_mmc_vrom_bank[8]; // a few clones need more than the 6 banks used by base MMC3 (e.g. waixing_g) int m_prg_base, m_prg_mask; // MMC3 based multigame carts select a block of banks by using these (and then act like normal MMC3), int m_chr_base, m_chr_mask; // while MMC3 and clones (mapper 118 & 119) simply set them as 0 and 0xff resp. @@ -44,8 +44,8 @@ protected: int m_wram_protect; int m_alt_irq; - UINT16 m_irq_count, m_irq_count_latch; - UINT8 m_irq_clear; + uint16_t m_irq_count, m_irq_count_latch; + uint8_t m_irq_clear; int m_irq_enable; }; @@ -56,7 +56,7 @@ class nes_hkrom_device : public nes_txrom_device { public: // construction/destruction - nes_hkrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_hkrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -68,10 +68,10 @@ public: protected: int m_wram_enable; - UINT8 m_mmc6_reg; + uint8_t m_mmc6_reg; // MMC-6 contains 1K of internal ram, battery backed up - UINT8 m_mmc6_ram[0x400]; + uint8_t m_mmc6_ram[0x400]; }; @@ -81,7 +81,7 @@ class nes_txsrom_device : public nes_txrom_device { public: // construction/destruction - nes_txsrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_txsrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -98,10 +98,10 @@ class nes_tqrom_device : public nes_txrom_device { public: // construction/destruction - nes_tqrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tqrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual void set_chr( UINT8 chr, int chr_base, int chr_mask ) override; + virtual void set_chr( uint8_t chr, int chr_base, int chr_mask ) override; }; @@ -111,7 +111,7 @@ class nes_qj_device : public nes_txrom_device { public: // construction/destruction - nes_qj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_qj_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_m) override; @@ -125,7 +125,7 @@ class nes_zz_device : public nes_txrom_device { public: // construction/destruction - nes_zz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_zz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_m) override; diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp index 72fde58282f..b9866c1e63e 100644 --- a/src/devices/bus/nes/mmc3_clones.cpp +++ b/src/devices/bus/nes/mmc3_clones.cpp @@ -66,182 +66,182 @@ const device_type NES_PJOY84 = &device_creator; const device_type NES_COOLBOY = &device_creator; -nes_nitra_device::nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_nitra_device::nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_NITRA, "NES Cart Nitra PCB", tag, owner, clock, "nes_nitra", __FILE__) { } -nes_ks7057_device::nes_ks7057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ks7057_device::nes_ks7057_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_KS7057, "NES Cart KS-7057 PCB", tag, owner, clock, "nes_ks7057", __FILE__) { } -nes_sbros11_device::nes_sbros11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sbros11_device::nes_sbros11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_SBROS11, "NES Cart SMB 11 PCB", tag, owner, clock, "nes_smb11", __FILE__) { } -nes_malisb_device::nes_malisb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_malisb_device::nes_malisb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_MALISB, "NES Cart Mali Spash Bomb PCB", tag, owner, clock, "nes_malisb", __FILE__) { } -nes_family4646_device::nes_family4646_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_family4646_device::nes_family4646_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_FAMILY4646, "NES Cart BMC-FAMILY-4646 PCB", tag, owner, clock, "nes_family4646", __FILE__) { } -nes_pikay2k_device::nes_pikay2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_pikay2k_device::nes_pikay2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_PIKAY2K, "NES Cart PIKACHU Y2K PCB", tag, owner, clock, "nes_pikay2k", __FILE__) { } -nes_8237_device::nes_8237_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_8237_device::nes_8237_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_8237, "NES Cart UNL-8237 PCB", tag, owner, clock, "nes_8237", __FILE__), m_cd_enable(0) { } -nes_sglionk_device::nes_sglionk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sglionk_device::nes_sglionk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_SG_LIONK, "NES Cart SuperGame Lion King PCB", tag, owner, clock, "nes_sglionk", __FILE__), m_reg(0), m_reg_enabled(0) { } -nes_sgboog_device::nes_sgboog_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sgboog_device::nes_sgboog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_SG_BOOG, "NES Cart SuperGame BoogerMan PCB", tag, owner, clock, "nes_sgbooger", __FILE__), m_mode(0) { } -nes_kasing_device::nes_kasing_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_kasing_device::nes_kasing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_KASING, "NES Cart Kasing PCB", tag, owner, clock, "nes_kasing", __FILE__), m_reg(0) { } -nes_kay_device::nes_kay_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_kay_device::nes_kay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_KAY, "NES Cart KAY PCB", tag, owner, clock, "nes_kay", __FILE__), m_low_reg(0) { } -nes_h2288_device::nes_h2288_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_h2288_device::nes_h2288_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_H2288, "NES Cart H-2288 PCB", tag, owner, clock, "nes_h2288", __FILE__) { } -nes_6035052_device::nes_6035052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_6035052_device::nes_6035052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_6035052, "NES Cart UNL-603-5052 PCB", tag, owner, clock, "nes_6035052", __FILE__), m_prot(0) { } -nes_txc_tw_device::nes_txc_tw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_txc_tw_device::nes_txc_tw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_TXC_TW, "NES Cart TXC Thunder Warrior PCB", tag, owner, clock, "nes_txc_tw", __FILE__) { } -nes_kof97_device::nes_kof97_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_kof97_device::nes_kof97_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_KOF97, "NES Cart KOF 97 PCB", tag, owner, clock, "nes_kof97", __FILE__) { } -nes_kof96_device::nes_kof96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_kof96_device::nes_kof96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_KOF96, "NES Cart KOF 96 PCB", tag, owner, clock, "nes_kof96", __FILE__) { } -nes_sf3_device::nes_sf3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sf3_device::nes_sf3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_SF3, "NES Cart Super Fighter III PCB", tag, owner, clock, "nes_sf3", __FILE__) { } -nes_gouder_device::nes_gouder_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_gouder_device::nes_gouder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_GOUDER, "NES Cart Gouder PCB", tag, owner, clock, "nes_gouder", __FILE__) { } -nes_sa9602b_device::nes_sa9602b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sa9602b_device::nes_sa9602b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_SA9602B, "NES Cart SA-9602B PCB", tag, owner, clock, "nes_sa9602b", __FILE__), m_reg(0), m_prg_chip(0) { } -nes_sachen_shero_device::nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_shero_device::nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_SACHEN_SHERO, "NES Cart Street Hero PCB", tag, owner, clock, "nes_shero", __FILE__), m_reg(0) { } -//nes_a9746_device::nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +//nes_a9746_device::nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) // : nes_txrom_device(mconfig, NES_A9746, "NES Cart A-9746 PCB", tag, owner, clock, "nes_bmc_a9746", __FILE__) //{ //} -nes_fk23c_device::nes_fk23c_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) +nes_fk23c_device::nes_fk23c_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) : nes_txrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_mmc_cmd1(0) { } -nes_fk23c_device::nes_fk23c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_fk23c_device::nes_fk23c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_FK23C, "NES Cart FK23C PCB", tag, owner, clock, "nes_fk23c", __FILE__), m_mmc_cmd1(0) { } -nes_fk23ca_device::nes_fk23ca_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_fk23ca_device::nes_fk23ca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_fk23c_device(mconfig, NES_FK23CA, "NES Cart FK23CA PCB", tag, owner, clock, "nes_fk23ca", __FILE__) { } -nes_s24in1sc03_device::nes_s24in1sc03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_s24in1sc03_device::nes_s24in1sc03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_S24IN1SC03, "NES Cart Super 24 in 1 SC-03 PCB", tag, owner, clock, "nes_s24in1c03", __FILE__) { } -nes_bmc_15in1_device::nes_bmc_15in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_15in1_device::nes_bmc_15in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_BMC_15IN1, "NES Cart BMC 15 in 1 PCB", tag, owner, clock, "nes_bmc_15in1", __FILE__) { } -nes_bmc_sbig7_device::nes_bmc_sbig7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_sbig7_device::nes_bmc_sbig7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_BMC_SBIG7, "NES Cart BMC Super BIG 7 in 1 PCB", tag, owner, clock, "nes_bmc_sbit7", __FILE__) { } -nes_bmc_hik8_device::nes_bmc_hik8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_hik8_device::nes_bmc_hik8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_BMC_HIK8, "NES Cart BMC Super HIK 8 in 1 PCB", tag, owner, clock, "nes_bmc_hik8", __FILE__), m_count(0) { } -nes_bmc_hik4_device::nes_bmc_hik4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_hik4_device::nes_bmc_hik4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_BMC_HIK4, "NES Cart BMC Super HIK 4 in 1 PCB", tag, owner, clock, "nes_bmc_hik4", __FILE__) { } -nes_bmc_mario7in1_device::nes_bmc_mario7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_mario7in1_device::nes_bmc_mario7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_BMC_MARIO7IN1, "NES Cart BMC Mario 7 in 1 PCB", tag, owner, clock, "nes_bmc_mario7in1", __FILE__), m_reg_written(0) { } -nes_bmc_gold7in1_device::nes_bmc_gold7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_gold7in1_device::nes_bmc_gold7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_BMC_GOLD7IN1, "NES Cart BMC Golden 7 in 1 PCB", tag, owner, clock, "nes_bmc_gold7in1", __FILE__), m_reg_written(0) { } -nes_bmc_gc6in1_device::nes_bmc_gc6in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_gc6in1_device::nes_bmc_gc6in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_BMC_GC6IN1, "NES Cart BMC Golden Card 6 in 1 PCB", tag, owner, clock, "nes_bmc_gc6in1", __FILE__) { } -nes_bmc_411120c_device::nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_411120c_device::nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_BMC_411120C, "NES Cart BMC 411120C PCB", tag, owner, clock, "nes_bmc_411120c", __FILE__), m_reg(0) { } -nes_bmc_830118c_device::nes_bmc_830118c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_830118c_device::nes_bmc_830118c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_BMC_830118C, "NES Cart BMC 830118C PCB", tag, owner, clock, "nes_bmc_830118c", __FILE__), m_reg(0) { } -nes_pjoy84_device::nes_pjoy84_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_pjoy84_device::nes_pjoy84_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_PJOY84, "NES Cart Powerjoy 84 PCB", tag, owner, clock, "nes_pjoy84", __FILE__) { } -nes_coolboy_device::nes_coolboy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_coolboy_device::nes_coolboy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_COOLBOY, "NES Cart CoolBoy PCB", tag, owner, clock, "nes_coolboy", __FILE__) { } @@ -856,7 +856,7 @@ WRITE8_MEMBER(nes_8237_device::write_l) WRITE8_MEMBER(nes_8237_device::write_h) { - static const UINT8 conv_table[8] = {0, 2, 6, 1, 7, 3, 4, 5}; + static const uint8_t conv_table[8] = {0, 2, 6, 1, 7, 3, 4, 5}; LOG_MMC(("unl_8237 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x7000) @@ -925,7 +925,7 @@ WRITE8_MEMBER(nes_sglionk_device::write_m) WRITE8_MEMBER(nes_sglionk_device::write_h) { - static const UINT8 conv_table[8] = {0, 3, 1, 5, 6, 7, 2, 4}; + static const uint8_t conv_table[8] = {0, 3, 1, 5, 6, 7, 2, 4}; LOG_MMC(("sglionk write_h, offset: %04x, data: %02x\n", offset, data)); if (offset < 0x6000) @@ -1013,7 +1013,7 @@ void nes_sgboog_device::set_prg(int prg_base, int prg_mask) else { // here standard MMC3 bankswitch - UINT8 prg_flip = (m_latch & 0x40) ? 2 : 0; + uint8_t prg_flip = (m_latch & 0x40) ? 2 : 0; prg_cb(0, prg_base | (m_mmc_prg_bank[0 ^ prg_flip] & prg_mask)); prg_cb(1, prg_base | (m_mmc_prg_bank[1] & prg_mask)); @@ -1071,7 +1071,7 @@ WRITE8_MEMBER(nes_sgboog_device::write_m) WRITE8_MEMBER(nes_sgboog_device::write_h) { - static const UINT8 conv_table[8] = {0,2,5,3,6,1,7,4}; + static const uint8_t conv_table[8] = {0,2,5,3,6,1,7,4}; LOG_MMC(("sgboog write_h, offset: %04x, data: %02x\n", offset, data)); if (m_mode) @@ -1261,7 +1261,7 @@ void nes_kay_device::prg_cb(int start, int bank) void nes_kay_device::chr_cb(int start, int bank, int source) { - UINT8 chr_page = (m_latch & 0x80) >> 5; + uint8_t chr_page = (m_latch & 0x80) >> 5; if ((start & 0x04) == chr_page) bank |= 0x100; @@ -1324,8 +1324,8 @@ WRITE8_MEMBER(nes_h2288_device::write_l) m_reg[offset & 1] = data; if (m_reg[0] & 0x40) { - UINT8 helper1 = (m_reg[0] & 0x05) | ((m_reg[0] >> 2) & 0x0a); - UINT8 helper2 = BIT(m_reg[0], 1); + uint8_t helper1 = (m_reg[0] & 0x05) | ((m_reg[0] >> 2) & 0x0a); + uint8_t helper2 = BIT(m_reg[0], 1); prg16_89ab(helper1 & ~helper2); prg16_cdef(helper1 | helper2); } @@ -1353,7 +1353,7 @@ READ8_MEMBER(nes_h2288_device::read_l) WRITE8_MEMBER(nes_h2288_device::write_h) { - static const UINT8 conv_table[8] = {0, 3, 1, 5, 6, 7, 2, 4}; + static const uint8_t conv_table[8] = {0, 3, 1, 5, 6, 7, 2, 4}; LOG_MMC(("h2288 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) @@ -1431,7 +1431,7 @@ void nes_txc_tw_device::prg_cb(int start, int bank) -------------------------------------------------*/ -inline UINT8 kof97_unscramble( UINT8 data ) +inline uint8_t kof97_unscramble( uint8_t data ) { return ((data >> 1) & 0x01) | ((data >> 4) & 0x02) | ((data << 2) & 0x04) | ((data >> 0) & 0xd8) | ((data << 3) & 0x20); } @@ -1477,7 +1477,7 @@ void nes_kof96_device::prg_cb(int start, int bank) void nes_kof96_device::chr_cb(int start, int bank, int source) { - UINT8 chr_page = (m_latch & 0x80) >> 5; + uint8_t chr_page = (m_latch & 0x80) >> 5; if ((start & 0x04) == chr_page) bank |= 0x100; @@ -1487,7 +1487,7 @@ void nes_kof96_device::chr_cb(int start, int bank, int source) WRITE8_MEMBER(nes_kof96_device::write_l) { - UINT8 new_bank; + uint8_t new_bank; LOG_MMC(("kof96 write_l, offset: %04x, data: %02x\n", offset, data)); offset += 0x100; @@ -1593,7 +1593,7 @@ WRITE8_MEMBER(nes_kof96_device::write_h) -------------------------------------------------*/ -void nes_sf3_device::set_chr(UINT8 chr_source, int chr_base, int chr_mask) +void nes_sf3_device::set_chr(uint8_t chr_source, int chr_base, int chr_mask) { chr4_0(chr_base | ((m_mmc_vrom_bank[0] >> 1) & chr_mask), chr_source); chr2_4(chr_base | (m_mmc_vrom_bank[1] & chr_mask), chr_source); @@ -1602,7 +1602,7 @@ void nes_sf3_device::set_chr(UINT8 chr_source, int chr_base, int chr_mask) WRITE8_MEMBER(nes_sf3_device::write_h) { - UINT8 cmd; + uint8_t cmd; LOG_MMC(("sf3 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) @@ -1645,7 +1645,7 @@ WRITE8_MEMBER(nes_sf3_device::write_h) WRITE8_MEMBER(nes_gouder_device::write_l) { - static const UINT8 conv_table[256] = + static const uint8_t conv_table[256] = { 0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x49,0x19,0x09,0x59,0x49,0x19,0x09, 0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x51,0x41,0x11,0x01,0x51,0x41,0x11,0x01, @@ -1831,7 +1831,7 @@ void nes_fk23c_device::chr_cb(int start, int bank, int source) void nes_fk23c_device::prg_cb(int start, int bank) { - UINT8 mask = (0x3f >> (m_reg[0] & 0x03)); + uint8_t mask = (0x3f >> (m_reg[0] & 0x03)); if ((m_reg[0] & 0x07) < 3) { @@ -1955,7 +1955,7 @@ WRITE8_MEMBER(nes_fk23c_device::write_h) void nes_s24in1sc03_device::prg_cb(int start, int bank) { - static const UINT8 masks[8] = {0x3f, 0x1f, 0x0f, 0x01, 0x03, 0x00, 0x00, 0x00}; + static const uint8_t masks[8] = {0x3f, 0x1f, 0x0f, 0x01, 0x03, 0x00, 0x00, 0x00}; int prg_base = m_reg[1] << 1; int prg_mask = masks[m_reg[0] & 0x07]; @@ -1965,7 +1965,7 @@ void nes_s24in1sc03_device::prg_cb(int start, int bank) void nes_s24in1sc03_device::chr_cb(int start, int bank, int source) { - UINT8 chr = BIT(m_reg[0], 5) ? CHRRAM : CHRROM; + uint8_t chr = BIT(m_reg[0], 5) ? CHRRAM : CHRROM; int chr_base = (m_reg[2] << 3) & 0xf00; chr1_x(start, chr_base | bank, chr); @@ -2039,7 +2039,7 @@ WRITE8_MEMBER(nes_bmc_15in1_device::write_m) WRITE8_MEMBER(nes_bmc_sbig7_device::write_h) { - UINT8 page; + uint8_t page; LOG_MMC(("bmc_sbig7 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) @@ -2164,7 +2164,7 @@ WRITE8_MEMBER(nes_bmc_hik4_device::write_m) WRITE8_MEMBER(nes_bmc_mario7in1_device::write_m) { - UINT8 helper1, helper2; + uint8_t helper1, helper2; LOG_MMC(("bmc_mario7in1 write_m, offset: %04x, data: %02x\n", offset, data)); /* mid writes only work when WRAM is enabled. not sure if I should @@ -2206,7 +2206,7 @@ WRITE8_MEMBER(nes_bmc_mario7in1_device::write_m) WRITE8_MEMBER(nes_bmc_gold7in1_device::write_m) { - UINT8 helper1, helper2; + uint8_t helper1, helper2; LOG_MMC(("bmc_gold7in1 write_m, offset: %04x, data: %02x\n", offset, data)); if ((m_wram_protect & 0x80) && !m_reg_written) @@ -2267,7 +2267,7 @@ void nes_bmc_gc6in1_device::chr_cb(int start, int bank, int source) WRITE8_MEMBER(nes_bmc_gc6in1_device::write_l) { - UINT8 bank; + uint8_t bank; LOG_MMC(("bmc_gc6in1 write_l, offset: %04x, data: %02x\n", offset, data)); offset += 0x100; @@ -2296,8 +2296,8 @@ WRITE8_MEMBER(nes_bmc_gc6in1_device::write_l) WRITE8_MEMBER(nes_bmc_gc6in1_device::write_h) { - UINT8 cmd; - static const UINT8 conv_table[8] = {0, 6, 3, 7, 5, 2, 4, 1}; + uint8_t cmd; + static const uint8_t conv_table[8] = {0, 6, 3, 7, 5, 2, 4, 1}; LOG_MMC(("bmc_gc6in1 write_h, offset: %04x, data: %02x\n", offset, data)); if (!m_reg[2]) @@ -2442,7 +2442,7 @@ WRITE8_MEMBER(nes_bmc_830118c_device::write_m) void nes_pjoy84_device::prg_cb(int start, int bank) { - UINT8 flip = (m_latch & 0x40) ? 2 : 0; + uint8_t flip = (m_latch & 0x40) ? 2 : 0; if (!(m_reg[3] & 0x03)) prg8_x(start, bank); @@ -2563,9 +2563,9 @@ void nes_a9746_device::pcb_reset() mmc3_common_initialize(0x7f, 0xff, 0); } -void nes_a9746_device::update_banks(UINT8 value) +void nes_a9746_device::update_banks(uint8_t value) { - UINT8 bank = BITSWAP8(value & 0x3c,7,6,0,1,2,3,4,5); + uint8_t bank = BITSWAP8(value & 0x3c,7,6,0,1,2,3,4,5); switch (m_reg[0]) { diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h index e6878d9d461..d8b6327d518 100644 --- a/src/devices/bus/nes/mmc3_clones.h +++ b/src/devices/bus/nes/mmc3_clones.h @@ -12,7 +12,7 @@ class nes_nitra_device : public nes_txrom_device { public: // construction/destruction - nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -25,7 +25,7 @@ class nes_ks7057_device : public nes_txrom_device { public: // construction/destruction - nes_ks7057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ks7057_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -38,7 +38,7 @@ class nes_sbros11_device : public nes_txrom_device { public: // construction/destruction - nes_sbros11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sbros11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -51,7 +51,7 @@ class nes_malisb_device : public nes_txrom_device { public: // construction/destruction - nes_malisb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_malisb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -66,7 +66,7 @@ class nes_family4646_device : public nes_txrom_device { public: // construction/destruction - nes_family4646_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_family4646_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_m) override; @@ -81,7 +81,7 @@ class nes_pikay2k_device : public nes_txrom_device { public: // construction/destruction - nes_pikay2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_pikay2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -92,7 +92,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[2]; + uint8_t m_reg[2]; }; @@ -102,7 +102,7 @@ class nes_8237_device : public nes_txrom_device { public: // construction/destruction - nes_8237_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_8237_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -114,7 +114,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[3]; + uint8_t m_reg[3]; int m_cd_enable; }; @@ -125,7 +125,7 @@ class nes_sglionk_device : public nes_txrom_device { public: // construction/destruction - nes_sglionk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sglionk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -135,7 +135,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg; + uint8_t m_reg; int m_reg_enabled; }; @@ -146,7 +146,7 @@ class nes_sgboog_device : public nes_txrom_device { public: // construction/destruction - nes_sgboog_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sgboog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -160,8 +160,8 @@ public: private: virtual void set_prg(int prg_base, int prg_mask) override; - UINT8 m_reg[3]; - UINT8 m_mode; + uint8_t m_reg[3]; + uint8_t m_mode; }; @@ -171,7 +171,7 @@ class nes_kasing_device : public nes_txrom_device { public: // construction/destruction - nes_kasing_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_kasing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -181,7 +181,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg; + uint8_t m_reg; }; @@ -191,7 +191,7 @@ class nes_kay_device : public nes_txrom_device { public: // construction/destruction - nes_kay_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_kay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -205,8 +205,8 @@ public: private: void update_regs(); - UINT8 m_reg[8]; - UINT8 m_low_reg; + uint8_t m_reg[8]; + uint8_t m_low_reg; }; @@ -216,7 +216,7 @@ class nes_h2288_device : public nes_txrom_device { public: // construction/destruction - nes_h2288_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_h2288_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -228,7 +228,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[2]; // reg 1 is unused? + uint8_t m_reg[2]; // reg 1 is unused? }; @@ -238,7 +238,7 @@ class nes_6035052_device : public nes_txrom_device { public: // construction/destruction - nes_6035052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_6035052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -252,7 +252,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_prot; + uint8_t m_prot; }; @@ -262,7 +262,7 @@ class nes_txc_tw_device : public nes_txrom_device { public: // construction/destruction - nes_txc_tw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_txc_tw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_l) override; @@ -277,7 +277,7 @@ class nes_kof97_device : public nes_txrom_device { public: // construction/destruction - nes_kof97_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_kof97_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -290,7 +290,7 @@ class nes_kof96_device : public nes_txrom_device { public: // construction/destruction - nes_kof96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_kof96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -303,7 +303,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; @@ -313,13 +313,13 @@ class nes_sf3_device : public nes_txrom_device { public: // construction/destruction - nes_sf3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sf3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; protected: - virtual void set_chr(UINT8 chr, int chr_base, int chr_mask) override; + virtual void set_chr(uint8_t chr, int chr_base, int chr_mask) override; }; @@ -329,7 +329,7 @@ class nes_gouder_device : public nes_txrom_device { public: // construction/destruction - nes_gouder_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_gouder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -340,7 +340,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[5]; + uint8_t m_reg[5]; }; @@ -350,7 +350,7 @@ class nes_sa9602b_device : public nes_txrom_device { public: // construction/destruction - nes_sa9602b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sa9602b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -360,7 +360,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg; + uint8_t m_reg; int m_prg_chip; }; @@ -371,7 +371,7 @@ class nes_sachen_shero_device : public nes_txrom_device { public: // construction/destruction - nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -382,7 +382,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg; + uint8_t m_reg; }; #ifdef UNUSED_FUNCTION @@ -392,7 +392,7 @@ class nes_a9746_device : public nes_txrom_device { public: // construction/destruction - nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -401,8 +401,8 @@ public: virtual void pcb_reset(); private: - void update_banks(UINT8 value); - UINT8 m_reg[3]; + void update_banks(uint8_t value); + uint8_t m_reg[3]; }; #endif @@ -413,8 +413,8 @@ class nes_fk23c_device : public nes_txrom_device { public: // construction/destruction - nes_fk23c_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); - nes_fk23c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fk23c_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); + nes_fk23c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -428,8 +428,8 @@ public: protected: void fk23c_set_prg(); void fk23c_set_chr(); - UINT8 m_reg[8]; - UINT8 m_mmc_cmd1; + uint8_t m_reg[8]; + uint8_t m_mmc_cmd1; }; @@ -439,7 +439,7 @@ class nes_fk23ca_device : public nes_fk23c_device { public: // construction/destruction - nes_fk23ca_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fk23ca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void pcb_reset() override; }; @@ -451,7 +451,7 @@ class nes_s24in1sc03_device : public nes_txrom_device { public: // construction/destruction - nes_s24in1sc03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_s24in1sc03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -462,7 +462,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[3]; + uint8_t m_reg[3]; }; @@ -472,7 +472,7 @@ class nes_bmc_15in1_device : public nes_txrom_device { public: // construction/destruction - nes_bmc_15in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_15in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_m) override; @@ -487,7 +487,7 @@ class nes_bmc_sbig7_device : public nes_txrom_device { public: // construction/destruction - nes_bmc_sbig7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_sbig7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -502,7 +502,7 @@ class nes_bmc_hik8_device : public nes_txrom_device { public: // construction/destruction - nes_bmc_hik8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_hik8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -511,8 +511,8 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[4]; - UINT8 m_count; + uint8_t m_reg[4]; + uint8_t m_count; }; @@ -522,7 +522,7 @@ class nes_bmc_hik4_device : public nes_txrom_device { public: // construction/destruction - nes_bmc_hik4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_hik4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_m) override; @@ -537,7 +537,7 @@ class nes_bmc_mario7in1_device : public nes_txrom_device { public: // construction/destruction - nes_bmc_mario7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_mario7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -546,7 +546,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg_written; + uint8_t m_reg_written; }; @@ -556,7 +556,7 @@ class nes_bmc_gold7in1_device : public nes_txrom_device { public: // construction/destruction - nes_bmc_gold7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_gold7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -565,7 +565,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg_written; + uint8_t m_reg_written; }; @@ -575,7 +575,7 @@ class nes_bmc_gc6in1_device : public nes_txrom_device { public: // construction/destruction - nes_bmc_gc6in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_gc6in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -587,7 +587,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; @@ -597,7 +597,7 @@ class nes_bmc_411120c_device : public nes_txrom_device { public: // construction/destruction - nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -608,7 +608,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg; + uint8_t m_reg; }; @@ -618,7 +618,7 @@ class nes_bmc_830118c_device : public nes_txrom_device { public: // construction/destruction - nes_bmc_830118c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_830118c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -629,7 +629,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg; + uint8_t m_reg; }; @@ -639,7 +639,7 @@ class nes_pjoy84_device : public nes_txrom_device { public: // construction/destruction - nes_pjoy84_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_pjoy84_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -651,7 +651,7 @@ public: private: inline void set_base_mask(); - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; // ======================> nes_coolboy_device @@ -660,7 +660,7 @@ class nes_coolboy_device : public nes_txrom_device { public: // construction/destruction - nes_coolboy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_coolboy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides // virtual void device_start() override; @@ -672,7 +672,7 @@ public: private: // inline void set_base_mask(); - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; diff --git a/src/devices/bus/nes/mmc5.cpp b/src/devices/bus/nes/mmc5.cpp index 7c114ca0e77..f93882ff3c6 100644 --- a/src/devices/bus/nes/mmc5.cpp +++ b/src/devices/bus/nes/mmc5.cpp @@ -44,7 +44,7 @@ static const int m_mmc5_attrib[4] = {0x00, 0x55, 0xaa, 0xff}; const device_type NES_EXROM = &device_creator; -nes_exrom_device::nes_exrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_exrom_device::nes_exrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_EXROM, "NES Cart ExROM (MMC-5) PCB", tag, owner, clock, "nes_exrom", __FILE__), m_irq_count(0), m_irq_status(0), m_irq_enable(0), m_mult1(0), m_mult2(0), m_mmc5_scanline(0), m_vrom_page_a(0), m_vrom_page_b(0), m_floodtile(0), m_floodattr(0), m_prg_mode(0), m_chr_mode(0), m_wram_protect_1(0), m_wram_protect_2(0), m_exram_control(0), m_wram_base(0), m_last_chr(0), m_ex1_chr(0), @@ -359,9 +359,9 @@ WRITE8_MEMBER(nes_exrom_device::nt_w) } } -inline UINT8 nes_exrom_device::base_chr_r(int bank, UINT32 offset) +inline uint8_t nes_exrom_device::base_chr_r(int bank, uint32_t offset) { - UINT32 helper = 0; + uint32_t helper = 0; switch (m_chr_mode) { @@ -385,15 +385,15 @@ inline UINT8 nes_exrom_device::base_chr_r(int bank, UINT32 offset) return m_vrom[helper & (m_vrom_size - 1)]; } -inline UINT8 nes_exrom_device::split_chr_r(UINT32 offset) +inline uint8_t nes_exrom_device::split_chr_r(uint32_t offset) { - UINT32 helper = (m_split_bank * 0x1000) + (offset & 0x3f8) + (m_split_yst & 7); + uint32_t helper = (m_split_bank * 0x1000) + (offset & 0x3f8) + (m_split_yst & 7); return m_vrom[helper & (m_vrom_size - 1)]; } -inline UINT8 nes_exrom_device::bg_ex1_chr_r(UINT32 offset) +inline uint8_t nes_exrom_device::bg_ex1_chr_r(uint32_t offset) { - UINT32 helper = (m_ex1_bank * 0x1000) + (offset & 0xfff); + uint32_t helper = (m_ex1_bank * 0x1000) + (offset & 0xfff); return m_vrom[helper & (m_vrom_size - 1)]; } diff --git a/src/devices/bus/nes/mmc5.h b/src/devices/bus/nes/mmc5.h index 44569d3d561..1ca0dd1cd88 100644 --- a/src/devices/bus/nes/mmc5.h +++ b/src/devices/bus/nes/mmc5.h @@ -12,7 +12,7 @@ class nes_exrom_device : public nes_nrom_device { public: // construction/destruction - nes_exrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_exrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -34,13 +34,13 @@ protected: void set_mirror(int page, int src); void update_prg(); - inline UINT8 base_chr_r(int bank, UINT32 offset); - inline UINT8 split_chr_r(UINT32 offset); - inline UINT8 bg_ex1_chr_r(UINT32 offset); + inline uint8_t base_chr_r(int bank, uint32_t offset); + inline uint8_t split_chr_r(uint32_t offset); + inline uint8_t bg_ex1_chr_r(uint32_t offset); inline bool in_split(); - UINT16 m_irq_count; - UINT8 m_irq_status; + uint16_t m_irq_count; + uint8_t m_irq_status; int m_irq_enable; int m_mult1, m_mult2; @@ -48,7 +48,7 @@ protected: int m_mmc5_scanline; int m_vrom_page_a; int m_vrom_page_b; - UINT16 m_vrom_bank[12]; // MMC5 has 10bit wide VROM regs! + uint16_t m_vrom_bank[12]; // MMC5 has 10bit wide VROM regs! int m_floodtile; int m_floodattr; @@ -60,27 +60,27 @@ protected: int m_exram_control; // $5104 int m_wram_base; // $5113 - UINT8 m_last_chr; - UINT8 m_ex1_chr; - UINT8 m_split_chr; - UINT8 m_prg_regs[4]; - UINT8 m_prg_ram_mapped[4]; + uint8_t m_last_chr; + uint8_t m_ex1_chr; + uint8_t m_split_chr; + uint8_t m_prg_regs[4]; + uint8_t m_prg_ram_mapped[4]; - UINT8 m_ex1_bank; + uint8_t m_ex1_bank; - UINT8 m_high_chr; // $5130 + uint8_t m_high_chr; // $5130 - UINT8 m_split_scr; // $5200 - UINT8 m_split_rev; // $5200 - UINT8 m_split_ctrl; // $5200 - UINT8 m_split_yst; // $5201 - UINT8 m_split_bank; // $5202 + uint8_t m_split_scr; // $5200 + uint8_t m_split_rev; // $5200 + uint8_t m_split_ctrl; // $5200 + uint8_t m_split_yst; // $5201 + uint8_t m_split_bank; // $5202 int m_vcount; // MMC-5 contains 1K of internal ram - UINT8 m_exram[0x400]; + uint8_t m_exram[0x400]; - UINT8 m_ram_hi_banks[4]; + uint8_t m_ram_hi_banks[4]; // int m_nes_vram_sprite[8]; }; diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp index bd905a11de5..52ae1baccbe 100644 --- a/src/devices/bus/nes/multigame.cpp +++ b/src/devices/bus/nes/multigame.cpp @@ -77,237 +77,237 @@ const device_type NES_BMC_4IN1RESET = &device_creator; const device_type NES_BMC_42IN1RESET = &device_creator; -nes_action52_device::nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_action52_device::nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_ACTION52, "NES Cart Action 52 PCB", tag, owner, clock, "nes_action52", __FILE__) { } -nes_caltron_device::nes_caltron_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_caltron_device::nes_caltron_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_CALTRON6IN1, "NES Cart Caltron 6 in 1 PCB", tag, owner, clock, "nes_caltron", __FILE__), m_latch(0) { } -nes_rumblestat_device::nes_rumblestat_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_rumblestat_device::nes_rumblestat_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_RUMBLESTATION, "NES Cart Rumblestation PCB", tag, owner, clock, "nes_rumblestat", __FILE__), m_prg(0), m_chr(0) { } -nes_svision16_device::nes_svision16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_svision16_device::nes_svision16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SVISION16, "NES Cart Supervision 16 in 1 PCB", tag, owner, clock, "nes_svision16", __FILE__), m_latch1(0), m_latch2(0) { } -nes_n625092_device::nes_n625092_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_n625092_device::nes_n625092_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_N625092, "NES Cart N625092 PCB", tag, owner, clock, "nes_n625092", __FILE__), m_latch1(0), m_latch2(0) { } -nes_a65as_device::nes_a65as_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_a65as_device::nes_a65as_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_A65AS, "NES Cart A65AS PCB", tag, owner, clock, "nes_a65as", __FILE__) { } -nes_t262_device::nes_t262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_t262_device::nes_t262_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_T262, "NES Cart T-262 PCB", tag, owner, clock, "nes_t262", __FILE__), m_latch1(0), m_latch2(0) { } -nes_novel1_device::nes_novel1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_novel1_device::nes_novel1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NOVEL1, "NES Cart Novel Diamond Type 1 PCB", tag, owner, clock, "nes_novel1", __FILE__) { } -nes_novel2_device::nes_novel2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_novel2_device::nes_novel2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NOVEL2, "NES Cart Novel Diamond Type 2 PCB", tag, owner, clock, "nes_novel2", __FILE__) { } -nes_studyngame_device::nes_studyngame_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_studyngame_device::nes_studyngame_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_STUDYNGAME, "NES Cart Study n Game PCB", tag, owner, clock, "nes_studyngame", __FILE__) { } -nes_sgun20in1_device::nes_sgun20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sgun20in1_device::nes_sgun20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SUPERGUN20IN1, "NES Cart Supergun 20 in 1 PCB", tag, owner, clock, "nes_sgun20in1", __FILE__) { } -nes_vt5201_device::nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_vt5201_device::nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_VT5201, "NES Cart VT5201 PCB", tag, owner, clock, "nes_vt5201", __FILE__), m_latch(0), m_dipsetting(0) { } -nes_810544c_device::nes_810544c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_810544c_device::nes_810544c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_810544C, "NES Cart 810544-C-A1 PCB", tag, owner, clock, "nes_810544c", __FILE__) { } -nes_ntd03_device::nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ntd03_device::nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NTD03, "NES Cart NTD-03 PCB", tag, owner, clock, "nes_ntd03", __FILE__) { } -nes_bmc_gb63_device::nes_bmc_gb63_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_gb63_device::nes_bmc_gb63_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_GB63, "NES Cart BMC Ghostbusters 63 in 1 PCB", tag, owner, clock, "nes_bmc_gb63", __FILE__), m_latch(0), m_dipsetting(0), m_vram_disable(0) { } -nes_bmc_gka_device::nes_bmc_gka_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_gka_device::nes_bmc_gka_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_GKA, "NES Cart BMC GK-A PCB", tag, owner, clock, "nes_bmc_gka", __FILE__), m_latch1(0), m_latch2(0) { } -nes_bmc_gkb_device::nes_bmc_gkb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_gkb_device::nes_bmc_gkb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_GKB, "NES Cart BMC GK-B PCB", tag, owner, clock, "nes_bmc_gkb", __FILE__) { } -nes_bmc_ws_device::nes_bmc_ws_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_ws_device::nes_bmc_ws_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_WS, "NES Cart BMC WS PCB", tag, owner, clock, "nes_bmc_ws", __FILE__), m_latch(0) { } -nes_bmc_11160_device::nes_bmc_11160_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_11160_device::nes_bmc_11160_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_11160, "NES Cart BMC-11160 PCB", tag, owner, clock, "nes_bmc_11160", __FILE__) { } -nes_bmc_g146_device::nes_bmc_g146_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_g146_device::nes_bmc_g146_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_G146, "NES Cart BMC-G-146 PCB", tag, owner, clock, "nes_bmc_g146", __FILE__) { } -nes_bmc_8157_device::nes_bmc_8157_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_8157_device::nes_bmc_8157_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_8157, "NES Cart BMC-8157 PCB", tag, owner, clock, "nes_bmc_8157", __FILE__) { } -nes_bmc_hik300_device::nes_bmc_hik300_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_hik300_device::nes_bmc_hik300_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_HIK300, "NES Cart BMC HIK 300 in 1 PCB", tag, owner, clock, "nes_bmc_hik300", __FILE__) { } -nes_bmc_s700_device::nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_s700_device::nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_S700, "NES Cart BMC Super 700 in 1 PCB", tag, owner, clock, "nes_bmc_s700", __FILE__) { } -nes_bmc_ball11_device::nes_bmc_ball11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_ball11_device::nes_bmc_ball11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_BALL11, "NES Cart BMC Ball 11 in 1 PCB", tag, owner, clock, "nes_bmc_ball11", __FILE__) { } -nes_bmc_22games_device::nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_22games_device::nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_22GAMES, "NES Cart BMC 22 Games PCB", tag, owner, clock, "nes_bmc_22games", __FILE__) { } -nes_bmc_64y2k_device::nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_64y2k_device::nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_64Y2K, "NES Cart BMC 64 in 1 Y2K PCB", tag, owner, clock, "nes_bmc_64y2k", __FILE__) { } -nes_bmc_12in1_device::nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_12in1_device::nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_12IN1, "NES Cart BMC 12 in 1 PCB", tag, owner, clock, "nes_bmc_12in1", __FILE__) { } -nes_bmc_20in1_device::nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_20in1_device::nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_20IN1, "NES Cart BMC 20 in 1 PCB", tag, owner, clock, "nes_bmc_20in1", __FILE__) { } -nes_bmc_21in1_device::nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_21in1_device::nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_21IN1, "NES Cart BMC 21 in 1 PCB", tag, owner, clock, "nes_bmc_21in1", __FILE__) { } -nes_bmc_31in1_device::nes_bmc_31in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_31in1_device::nes_bmc_31in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_31IN1, "NES Cart BMC 31 in 1 PCB", tag, owner, clock, "nes_bmc_31in1", __FILE__) { } -nes_bmc_35in1_device::nes_bmc_35in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_35in1_device::nes_bmc_35in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_35IN1, "NES Cart BMC 35 in 1 PCB", tag, owner, clock, "nes_bmc_35in1", __FILE__) { } -nes_bmc_36in1_device::nes_bmc_36in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_36in1_device::nes_bmc_36in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_36IN1, "NES Cart BMC 36 in 1 PCB", tag, owner, clock, "nes_bmc_36in1", __FILE__) { } -nes_bmc_64in1_device::nes_bmc_64in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_64in1_device::nes_bmc_64in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_64IN1, "NES Cart BMC 64 in 1 PCB", tag, owner, clock, "nes_bmc_64in1", __FILE__) { } -nes_bmc_70in1_device::nes_bmc_70in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_70in1_device::nes_bmc_70in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_70IN1, "NES Cart BMC 70 in 1 PCB", tag, owner, clock, "nes_bmc_70in1", __FILE__), m_mode(0) { } -nes_bmc_72in1_device::nes_bmc_72in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_72in1_device::nes_bmc_72in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_72IN1, "NES Cart BMC 72 in 1 PCB", tag, owner, clock, "nes_bmc_72in1", __FILE__) { } -nes_bmc_76in1_device::nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_76in1_device::nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_76IN1, "NES Cart BMC 76 in 1 PCB", tag, owner, clock, "nes_bmc_76in1", __FILE__), m_latch1(0), m_latch2(0) { } -nes_bmc_110in1_device::nes_bmc_110in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_110in1_device::nes_bmc_110in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_110IN1, "NES Cart BMC 110 in 1 PCB", tag, owner, clock, "nes_bmc_110in1", __FILE__) { } -nes_bmc_150in1_device::nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_150in1_device::nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_150IN1, "NES Cart BMC 150 in 1 PCB", tag, owner, clock, "nes_bmc_150in1", __FILE__) { } -nes_bmc_190in1_device::nes_bmc_190in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_190in1_device::nes_bmc_190in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_190IN1, "NES Cart BMC 190 in 1 PCB", tag, owner, clock, "nes_bmc_190in1", __FILE__) { } -nes_bmc_800in1_device::nes_bmc_800in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_800in1_device::nes_bmc_800in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_800IN1, "NES Cart BMC 800 in 1 PCB", tag, owner, clock, "nes_bmc_800in1", __FILE__), m_mode(0) { } -nes_bmc_1200in1_device::nes_bmc_1200in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_1200in1_device::nes_bmc_1200in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_1200IN1, "NES Cart BMC 1200 in 1 PCB", tag, owner, clock, "nes_bmc_1200in1", __FILE__), m_vram_protect(0) { } -nes_bmc_gold150_device::nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_gold150_device::nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_GOLD150, "NES Cart BMC Golden 150 in 1 PCB", tag, owner, clock, "nes_bmc_gold150", __FILE__), m_latch(0) { } -nes_bmc_gold260_device::nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_gold260_device::nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_GOLD260, "NES Cart BMC Golden 260 in 1 PCB", tag, owner, clock, "nes_bmc_gold260", __FILE__) { } -nes_bmc_ch001_device::nes_bmc_ch001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_ch001_device::nes_bmc_ch001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_CH001, "NES Cart BMC CH-001 PCB", tag, owner, clock, "nes_bmc_ch001", __FILE__), m_latch(0) { } -nes_bmc_super22_device::nes_bmc_super22_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_super22_device::nes_bmc_super22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_SUPER22, "NES Cart BMC Super 22 Games PCB", tag, owner, clock, "nes_bmc_super22", __FILE__) { } -nes_bmc_4in1reset_device::nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_4in1reset_device::nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_4IN1RESET, "NES Cart BMC 4 in 1 (Reset Based) PCB", tag, owner, clock, "nes_bmc_4in1reset", __FILE__), m_latch(0) { } -nes_bmc_42in1reset_device::nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bmc_42in1reset_device::nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BMC_42IN1RESET, "NES Cart BMC 42 in 1 (Reset Based) PCB", tag, owner, clock, "nes_bmc_42in1reset", __FILE__), m_latch(0) { } @@ -1018,7 +1018,7 @@ void nes_bmc_42in1reset_device::pcb_reset() WRITE8_MEMBER(nes_action52_device::write_h) { - UINT8 pmode = offset & 0x20; + uint8_t pmode = offset & 0x20; int pbank = (offset & 0x1fc0) >> 6; int cbank = (data & 0x03) | ((offset & 0x0f) << 2); LOG_MMC(("ae_act52_w, offset: %04x, data: %02x\n", offset, data)); @@ -1164,9 +1164,9 @@ WRITE8_MEMBER(nes_svision16_device::write_h) -------------------------------------------------*/ -void nes_n625092_device::set_prg(UINT8 reg1, UINT8 reg2) +void nes_n625092_device::set_prg(uint8_t reg1, uint8_t reg2) { - UINT8 helper1, helper2; + uint8_t helper1, helper2; helper1 = !(reg1 & 0x01) ? reg2 : (reg1 & 0x80) ? reg2 : (reg2 & 0x06) | 0x00; helper2 = !(reg1 & 0x01) ? reg2 : (reg1 & 0x80) ? 0x07 : (reg2 & 0x06) | 0x01; @@ -1215,7 +1215,7 @@ WRITE8_MEMBER(nes_n625092_device::write_h) WRITE8_MEMBER(nes_a65as_device::write_h) { - UINT8 helper = (data & 0x30) >> 1; + uint8_t helper = (data & 0x30) >> 1; LOG_MMC(("a65as write_h, offset: %04x, data: %02x\n", offset, data)); if (data & 0x80) @@ -1244,7 +1244,7 @@ WRITE8_MEMBER(nes_a65as_device::write_h) WRITE8_MEMBER(nes_t262_device::write_h) { - UINT8 mmc_helper; + uint8_t mmc_helper; LOG_MMC(("t262 write_h, offset: %04x, data: %02x\n", offset, data)); if (m_latch2 || offset == 0) @@ -1385,7 +1385,7 @@ READ8_MEMBER(nes_vt5201_device::read_h) WRITE8_MEMBER(nes_810544c_device::write_h) { - UINT8 bank = (offset >> 7); + uint8_t bank = (offset >> 7); LOG_MMC(("810544 write_h, offset: %04x, data: %02x\n", offset, data)); if (!BIT(offset, 6)) @@ -1409,8 +1409,8 @@ WRITE8_MEMBER(nes_810544c_device::write_h) WRITE8_MEMBER(nes_ntd03_device::write_h) { - UINT8 pbank = (offset >> 10) & 0x1e; - UINT8 cbank = ((offset & 0x300) >> 5) | (offset & 0x07); + uint8_t pbank = (offset >> 10) & 0x1e; + uint8_t cbank = ((offset & 0x300) >> 5) | (offset & 0x07); LOG_MMC(("ntd03 write_h, offset: %04x, data: %02x\n", offset, data)); if (BIT(offset, 7)) @@ -1531,7 +1531,7 @@ WRITE8_MEMBER(nes_bmc_gka_device::write_h) WRITE8_MEMBER(nes_bmc_gkb_device::write_h) { - UINT8 bank = (offset & 0x40) ? 0 : 1; + uint8_t bank = (offset & 0x40) ? 0 : 1; LOG_MMC(("bmc_gkb write_h, offset: %04x, data: %02x\n", offset, data)); prg16_89ab(offset & ~bank); @@ -1553,7 +1553,7 @@ WRITE8_MEMBER(nes_bmc_gkb_device::write_h) WRITE8_MEMBER(nes_bmc_ws_device::write_m) { - UINT8 mmc_helper; + uint8_t mmc_helper; LOG_MMC(("bmc_ws write_m, offset: %04x, data: %02x\n", offset, data)); if (offset < 0x1000) @@ -1658,7 +1658,7 @@ READ8_MEMBER(nes_bmc_8157_device::read_h) LOG_MMC(("bmc_8157 read_h, offset: %04x\n", offset)); // m_dipsetting = ioport("CARTDIPS")->read(); -// UINT8 val = hi_access_rom(offset); +// uint8_t val = hi_access_rom(offset); // return val | m_noise; // the first write_h sets m_noise=0xff or 0 depending on dsw return hi_access_rom(offset); @@ -1829,8 +1829,8 @@ WRITE8_MEMBER(nes_bmc_22games_device::write_h) void nes_bmc_64y2k_device::set_prg() { - UINT8 helper1 = (m_reg[1] & 0x1f); - UINT8 helper2 = (helper1 << 1) | ((m_reg[1] & 0x40) >> 6); + uint8_t helper1 = (m_reg[1] & 0x1f); + uint8_t helper2 = (helper1 << 1) | ((m_reg[1] & 0x40) >> 6); if (m_reg[0] & 0x80) { @@ -2212,8 +2212,8 @@ WRITE8_MEMBER(nes_bmc_76in1_device::write_h) WRITE8_MEMBER(nes_bmc_110in1_device::write_h) { - UINT8 helper1 = (offset >> 12) ? 0 : 1; - UINT8 helper2 = ((offset >> 8) & 0x40) | ((offset >> 6) & 0x3f); + uint8_t helper1 = (offset >> 12) ? 0 : 1; + uint8_t helper2 = ((offset >> 8) & 0x40) | ((offset >> 6) & 0x3f); LOG_MMC(("bmc_110in1 write_h, offset: %04x, data: %02x\n", offset, data)); diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h index e9ecced4a7a..65c803910e8 100644 --- a/src/devices/bus/nes/multigame.h +++ b/src/devices/bus/nes/multigame.h @@ -12,7 +12,7 @@ class nes_action52_device : public nes_nrom_device { public: // construction/destruction - nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_caltron_device : public nes_nrom_device { public: // construction/destruction - nes_caltron_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_caltron_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -38,7 +38,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -48,7 +48,7 @@ class nes_rumblestat_device : public nes_nrom_device { public: // construction/destruction - nes_rumblestat_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_rumblestat_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -58,7 +58,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_prg, m_chr; + uint8_t m_prg, m_chr; }; @@ -68,7 +68,7 @@ class nes_svision16_device : public nes_nrom_device { public: // construction/destruction - nes_svision16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_svision16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -80,7 +80,7 @@ public: private: void update_prg(); - UINT8 m_latch1, m_latch2; + uint8_t m_latch1, m_latch2; }; @@ -90,7 +90,7 @@ class nes_n625092_device : public nes_nrom_device { public: // construction/destruction - nes_n625092_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_n625092_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -99,8 +99,8 @@ public: virtual void pcb_reset() override; private: - void set_prg(UINT8 reg1, UINT8 reg2); - UINT8 m_latch1, m_latch2; + void set_prg(uint8_t reg1, uint8_t reg2); + uint8_t m_latch1, m_latch2; }; @@ -110,7 +110,7 @@ class nes_a65as_device : public nes_nrom_device { public: // construction/destruction - nes_a65as_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_a65as_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -126,7 +126,7 @@ class nes_t262_device : public nes_nrom_device { public: // construction/destruction - nes_t262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_t262_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -135,7 +135,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch1, m_latch2; + uint8_t m_latch1, m_latch2; }; @@ -145,7 +145,7 @@ class nes_novel1_device : public nes_nrom_device { public: // construction/destruction - nes_novel1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_novel1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -161,7 +161,7 @@ class nes_novel2_device : public nes_nrom_device { public: // construction/destruction - nes_novel2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_novel2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -177,7 +177,7 @@ class nes_studyngame_device : public nes_nrom_device { public: // construction/destruction - nes_studyngame_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_studyngame_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -193,7 +193,7 @@ class nes_sgun20in1_device : public nes_nrom_device { public: // construction/destruction - nes_sgun20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sgun20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -209,7 +209,7 @@ class nes_vt5201_device : public nes_nrom_device { public: // construction/destruction - nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -219,7 +219,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch, m_dipsetting; + uint8_t m_latch, m_dipsetting; }; @@ -229,7 +229,7 @@ class nes_810544c_device : public nes_nrom_device { public: // construction/destruction - nes_810544c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_810544c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -245,7 +245,7 @@ class nes_ntd03_device : public nes_nrom_device { public: // construction/destruction - nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -261,7 +261,7 @@ class nes_bmc_gb63_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_gb63_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_gb63_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -273,8 +273,8 @@ public: private: void update_banks(); - UINT8 m_latch, m_dipsetting; - UINT8 m_reg[2]; + uint8_t m_latch, m_dipsetting; + uint8_t m_reg[2]; int m_vram_disable; }; @@ -284,7 +284,7 @@ class nes_bmc_gka_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_gka_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_gka_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -293,7 +293,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch1, m_latch2; + uint8_t m_latch1, m_latch2; }; @@ -303,7 +303,7 @@ class nes_bmc_gkb_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_gkb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_gkb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -319,7 +319,7 @@ class nes_bmc_ws_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_ws_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_ws_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -328,7 +328,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -338,7 +338,7 @@ class nes_bmc_11160_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_11160_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_11160_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -354,7 +354,7 @@ class nes_bmc_g146_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_g146_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_g146_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -370,7 +370,7 @@ class nes_bmc_8157_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_8157_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_8157_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -387,7 +387,7 @@ class nes_bmc_hik300_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_hik300_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_hik300_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -403,7 +403,7 @@ class nes_bmc_s700_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -419,7 +419,7 @@ class nes_bmc_ball11_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_ball11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_ball11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -430,7 +430,7 @@ public: private: void set_banks(); - UINT8 m_reg[2]; + uint8_t m_reg[2]; }; @@ -440,7 +440,7 @@ class nes_bmc_22games_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -456,7 +456,7 @@ class nes_bmc_64y2k_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -467,7 +467,7 @@ public: private: void set_prg(); - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; @@ -477,7 +477,7 @@ class nes_bmc_12in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -487,7 +487,7 @@ public: private: void update_banks(); - UINT8 m_reg[3]; + uint8_t m_reg[3]; }; @@ -497,7 +497,7 @@ class nes_bmc_20in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -513,7 +513,7 @@ class nes_bmc_21in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -529,7 +529,7 @@ class nes_bmc_31in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_31in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_31in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -545,7 +545,7 @@ class nes_bmc_35in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_35in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_35in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -561,7 +561,7 @@ class nes_bmc_36in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_36in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_36in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -577,7 +577,7 @@ class nes_bmc_64in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_64in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_64in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -593,7 +593,7 @@ class nes_bmc_70in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_70in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_70in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -603,8 +603,8 @@ public: virtual void pcb_reset() override; private: - UINT8 m_mode; - UINT8 m_reg[2]; + uint8_t m_mode; + uint8_t m_reg[2]; }; @@ -614,7 +614,7 @@ class nes_bmc_72in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_72in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_72in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -630,7 +630,7 @@ class nes_bmc_76in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -639,7 +639,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch1, m_latch2; + uint8_t m_latch1, m_latch2; }; @@ -649,7 +649,7 @@ class nes_bmc_110in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_110in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_110in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -665,7 +665,7 @@ class nes_bmc_150in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -681,7 +681,7 @@ class nes_bmc_190in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_190in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_190in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -697,7 +697,7 @@ class nes_bmc_800in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_800in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_800in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -707,8 +707,8 @@ public: virtual void pcb_reset() override; private: - UINT8 m_mode; - UINT8 m_reg[2]; + uint8_t m_mode; + uint8_t m_reg[2]; }; @@ -718,7 +718,7 @@ class nes_bmc_1200in1_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_1200in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_1200in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -728,7 +728,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_vram_protect; + uint8_t m_vram_protect; }; @@ -738,7 +738,7 @@ class nes_bmc_gold150_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -748,7 +748,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -758,7 +758,7 @@ class nes_bmc_gold260_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -774,7 +774,7 @@ class nes_bmc_ch001_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_ch001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_ch001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -784,7 +784,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -794,7 +794,7 @@ class nes_bmc_super22_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_super22_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_super22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -810,7 +810,7 @@ class nes_bmc_4in1reset_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -826,7 +826,7 @@ class nes_bmc_42in1reset_device : public nes_nrom_device { public: // construction/destruction - nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -836,7 +836,7 @@ public: private: int m_latch; - UINT8 m_reg[2]; + uint8_t m_reg[2]; }; diff --git a/src/devices/bus/nes/namcot.cpp b/src/devices/bus/nes/namcot.cpp index 2d9bf4bfc69..e65f15906be 100644 --- a/src/devices/bus/nes/namcot.cpp +++ b/src/devices/bus/nes/namcot.cpp @@ -49,42 +49,42 @@ const device_type NES_NAMCOT340 = &device_creator; const device_type NES_NAMCOT163 = &device_creator; -nes_namcot3433_device::nes_namcot3433_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) +nes_namcot3433_device::nes_namcot3433_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0) { } -nes_namcot3433_device::nes_namcot3433_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_namcot3433_device::nes_namcot3433_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NAMCOT3433, "NES Cart Namcot 3433 & 3443 / DxROM PCB", tag, owner, clock, "nes_namcot3433", __FILE__), m_latch(0) { } -nes_namcot3446_device::nes_namcot3446_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_namcot3446_device::nes_namcot3446_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NAMCOT3446, "NES Cart Namcot 3446 PCB", tag, owner, clock, "nes_namcot3446", __FILE__), m_latch(0) { } -nes_namcot3425_device::nes_namcot3425_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_namcot3425_device::nes_namcot3425_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NAMCOT3425, "NES Cart Namcot 3425 PCB", tag, owner, clock, "nes_namcot3425", __FILE__), m_latch(0) { } -nes_namcot340_device::nes_namcot340_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) +nes_namcot340_device::nes_namcot340_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_namcot340_device::nes_namcot340_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_namcot340_device::nes_namcot340_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NAMCOT175, "NES Cart Namcot 340 PCB", tag, owner, clock, "nes_namcot340", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } -nes_namcot175_device::nes_namcot175_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_namcot175_device::nes_namcot175_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_namcot340_device(mconfig, NES_NAMCOT340, "NES Cart Namcot 175 PCB", tag, owner, clock, "nes_namcot175", __FILE__), m_wram_protect(0) { } -nes_namcot163_device::nes_namcot163_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_namcot163_device::nes_namcot163_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_namcot340_device(mconfig, NES_NAMCOT163, "NES Cart Namcot 163 PCB", tag, owner, clock, "nes_namcot163", __FILE__), m_wram_protect(0), m_latch(0), m_chr_bank(0) { } @@ -338,7 +338,7 @@ WRITE8_MEMBER(nes_namcot3446_device::write_h) WRITE8_MEMBER(nes_namcot3425_device::write_h) { - UINT8 mode; + uint8_t mode; LOG_MMC(("namcot3425 write_h, offset: %04x, data: %02x\n", offset, data)); if (offset >= 0x2000) return; @@ -639,7 +639,7 @@ READ8_MEMBER(nes_namcot163_device::read_l) } } -void nes_namcot163_device::set_mirror(UINT8 page, UINT8 data) +void nes_namcot163_device::set_mirror(uint8_t page, uint8_t data) { if (data < 0xe0) set_nt_page(page, VROM, data, 0); diff --git a/src/devices/bus/nes/namcot.h b/src/devices/bus/nes/namcot.h index 6499218a752..bb65a0c8953 100644 --- a/src/devices/bus/nes/namcot.h +++ b/src/devices/bus/nes/namcot.h @@ -12,8 +12,8 @@ class nes_namcot3433_device : public nes_nrom_device { public: // construction/destruction - nes_namcot3433_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); - nes_namcot3433_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_namcot3433_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); + nes_namcot3433_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -23,7 +23,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -33,7 +33,7 @@ class nes_namcot3446_device : public nes_nrom_device { public: // construction/destruction - nes_namcot3446_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_namcot3446_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -42,7 +42,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -52,7 +52,7 @@ class nes_namcot3425_device : public nes_nrom_device { public: // construction/destruction - nes_namcot3425_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_namcot3425_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -61,8 +61,8 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; - UINT8 m_reg[4]; + uint8_t m_latch; + uint8_t m_reg[4]; }; @@ -72,8 +72,8 @@ class nes_namcot340_device : public nes_nrom_device { public: // construction/destruction - nes_namcot340_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); - nes_namcot340_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_namcot340_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); + nes_namcot340_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -88,7 +88,7 @@ public: virtual void pcb_reset() override; protected: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; @@ -96,7 +96,7 @@ protected: // Namcot-163 chip contains 8K of internal ram, possibly battery backed up (not emulated yet) // was it also present in 175 & 340 chips? - UINT8 m_n163_ram[0x2000]; + uint8_t m_n163_ram[0x2000]; }; @@ -106,7 +106,7 @@ class nes_namcot175_device : public nes_namcot340_device { public: // construction/destruction - nes_namcot175_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_namcot175_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -117,7 +117,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_wram_protect; + uint8_t m_wram_protect; }; @@ -127,7 +127,7 @@ class nes_namcot163_device : public nes_namcot340_device { public: // construction/destruction - nes_namcot163_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_namcot163_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -144,9 +144,9 @@ public: virtual void pcb_reset() override; private: - void set_mirror(UINT8 page, UINT8 data); + void set_mirror(uint8_t page, uint8_t data); - UINT8 m_wram_protect, m_latch, m_chr_bank; + uint8_t m_wram_protect, m_latch, m_chr_bank; // TODO: add emulation of the sound part of the chip }; diff --git a/src/devices/bus/nes/nanjing.cpp b/src/devices/bus/nes/nanjing.cpp index 9c4ea8bf3b1..8163cb7e156 100644 --- a/src/devices/bus/nes/nanjing.cpp +++ b/src/devices/bus/nes/nanjing.cpp @@ -33,7 +33,7 @@ const device_type NES_NANJING = &device_creator; -nes_nanjing_device::nes_nanjing_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_nanjing_device::nes_nanjing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NANJING, "NES Cart Nanjing PCB", tag, owner, clock, "nes_nanjing", __FILE__), m_count(0), m_latch1(0), @@ -124,7 +124,7 @@ WRITE8_MEMBER(nes_nanjing_device::write_l) if (offset == 0x1101) // 0x5101 { - UINT8 temp = m_count; + uint8_t temp = m_count; m_count = data; if ((temp & ~data) & 1) @@ -151,7 +151,7 @@ WRITE8_MEMBER(nes_nanjing_device::write_l) READ8_MEMBER(nes_nanjing_device::read_l) { - UINT8 value = 0; + uint8_t value = 0; LOG_MMC(("nanjing read_l, offset: %04x\n", offset)); offset += 0x100; diff --git a/src/devices/bus/nes/nanjing.h b/src/devices/bus/nes/nanjing.h index 3fe4d670527..c7f886ba107 100644 --- a/src/devices/bus/nes/nanjing.h +++ b/src/devices/bus/nes/nanjing.h @@ -12,7 +12,7 @@ class nes_nanjing_device : public nes_nrom_device { public: // construction/destruction - nes_nanjing_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_nanjing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -23,9 +23,9 @@ public: virtual void pcb_reset() override; private: - UINT8 m_count; - UINT8 m_reg[2]; - UINT8 m_latch1, m_latch2; + uint8_t m_count; + uint8_t m_reg[2]; + uint8_t m_latch1, m_latch2; }; diff --git a/src/devices/bus/nes/nes_ines.hxx b/src/devices/bus/nes/nes_ines.hxx index 9fd1e5a90eb..c7214ee9bc0 100644 --- a/src/devices/bus/nes/nes_ines.hxx +++ b/src/devices/bus/nes/nes_ines.hxx @@ -339,10 +339,10 @@ void ines_mapr_setup( int mapper, int *pcb_id ) void nes_cart_slot_device::call_load_ines() { - UINT32 vram_size = 0, prgram_size = 0, battery_size = 0, mapper_sram_size = 0; - UINT32 prg_size, vrom_size; - UINT8 header[0x10]; - UINT8 mapper, submapper = 0, local_options; + uint32_t vram_size = 0, prgram_size = 0, battery_size = 0, mapper_sram_size = 0; + uint32_t prg_size, vrom_size; + uint8_t header[0x10]; + uint8_t mapper, submapper = 0, local_options; bool ines20 = FALSE, prg16k; std::string mapinfo; int pcb_id = 0, mapint1 = 0, mapint2 = 0, mapint3 = 0, mapint4 = 0; @@ -797,8 +797,8 @@ void nes_cart_slot_device::call_load_ines() // A few boards have internal RAM with a battery (MMC6, Taito X1-005 & X1-017, etc.) if (battery_size || mapper_sram_size) { - UINT32 tot_size = battery_size + mapper_sram_size; - std::vector temp_nvram(tot_size); + uint32_t tot_size = battery_size + mapper_sram_size; + std::vector temp_nvram(tot_size); battery_load(&temp_nvram[0], tot_size, 0x00); if (battery_size) { @@ -811,9 +811,9 @@ void nes_cart_slot_device::call_load_ines() } } -const char * nes_cart_slot_device::get_default_card_ines(UINT8 *ROM, UINT32 len) +const char * nes_cart_slot_device::get_default_card_ines(uint8_t *ROM, uint32_t len) { - UINT8 mapper, submapper = 0; + uint8_t mapper, submapper = 0; bool ines20 = FALSE; std::string mapinfo; int pcb_id = 0, mapint1 = 0, mapint2 = 0, mapint3 = 0, mapint4 = 0; diff --git a/src/devices/bus/nes/nes_pcb.hxx b/src/devices/bus/nes/nes_pcb.hxx index 67a8d731cac..cc4def22dc0 100644 --- a/src/devices/bus/nes/nes_pcb.hxx +++ b/src/devices/bus/nes/nes_pcb.hxx @@ -436,10 +436,10 @@ static int nes_cart_get_line( const char *feature ) void nes_cart_slot_device::call_load_pcb() { - UINT32 vram_size = 0, prgram_size = 0, battery_size = 0, mapper_sram_size = 0; + uint32_t vram_size = 0, prgram_size = 0, battery_size = 0, mapper_sram_size = 0; // SETUP step 1: getting PRG, VROM, VRAM sizes - UINT32 prg_size = get_software_region_length("prg"); - UINT32 vrom_size = get_software_region_length("chr"); + uint32_t prg_size = get_software_region_length("prg"); + uint32_t vrom_size = get_software_region_length("chr"); vram_size = get_software_region_length("vram"); vram_size += get_software_region_length("vram2"); @@ -595,13 +595,13 @@ void nes_cart_slot_device::call_load_pcb() // A few boards have internal RAM with a battery (MMC6, Taito X1-005 & X1-017, etc.) if (battery_size || mapper_sram_size) { - UINT32 tot_size = battery_size + mapper_sram_size; - std::vector temp_nvram(tot_size); + uint32_t tot_size = battery_size + mapper_sram_size; + std::vector temp_nvram(tot_size); // some games relies on specific battery patterns to work // (e.g. Silva Saga does not work with SRAM fully initialized to 0x00) // and we use the info from xml here to prepare a default NVRAM - std::vector default_nvram(tot_size); + std::vector default_nvram(tot_size); if (battery_size) memcpy(&default_nvram[0], get_software_region("bwram"), battery_size); if (mapper_sram_size) diff --git a/src/devices/bus/nes/nes_slot.cpp b/src/devices/bus/nes/nes_slot.cpp index b63d2742246..596ca7d8d40 100644 --- a/src/devices/bus/nes/nes_slot.cpp +++ b/src/devices/bus/nes/nes_slot.cpp @@ -158,7 +158,7 @@ void device_nes_cart_interface::prg_alloc(size_t size, const char *tag) // A few pirate carts have PRG made of 32K + 2K or some weird similar config // in this case we treat the banking as if this 'extra' PRG is not present and // the pcb code has to handle it by accessing directly m_prg! - printf("Warning! The loaded PRG has size not a multiple of 8KB (0x%X)\n", (UINT32)size); + printf("Warning! The loaded PRG has size not a multiple of 8KB (0x%X)\n", (uint32_t)size); m_prg_chunks--; } @@ -259,7 +259,7 @@ inline int device_nes_cart_interface::prg_8k_bank_num(int bank_8k) return bank_8k; // case 2: otherwise return a mirror using the bank_map! -// UINT8 temp = bank_8k; +// uint8_t temp = bank_8k; bank_8k &= m_prg_mask; bank_8k -= (m_prg_mask/2 + 1); // printf("bank: accessed %x (top: %x), returned %x\n", temp, (m_prg_chunks << 1) - 1, m_prg_bank_map[bank_8k]); @@ -479,7 +479,7 @@ void device_nes_cart_interface::chr1_x(int start, int bank, int source) void device_nes_cart_interface::set_nt_page(int page, int source, int bank, int writable) { - UINT8* base_ptr; + uint8_t* base_ptr; switch (source) { @@ -570,7 +570,7 @@ void device_nes_cart_interface::set_nt_mirroring(int mirroring) // Helper function for the few mappers reading from 0x8000-0xffff for protection // so that they can access the ROM after the protection handling (which overwrites // the memory banks) -UINT8 device_nes_cart_interface::hi_access_rom(UINT32 offset) +uint8_t device_nes_cart_interface::hi_access_rom(uint32_t offset) { int bank = (offset & 0x6000) >> 13; return m_prg[m_prg_bank[bank] * 0x2000 + (offset & 0x1fff)]; @@ -580,7 +580,7 @@ UINT8 device_nes_cart_interface::hi_access_rom(UINT32 offset) // Tests by blargg showed that in many of the boards suffering of CPU/ROM // conflicts the behaviour can be accurately emulated by writing not the // original data, but data & rom[offset] -UINT8 device_nes_cart_interface::account_bus_conflict(UINT32 offset, UINT8 data) +uint8_t device_nes_cart_interface::account_bus_conflict(uint32_t offset, uint8_t data) { // pirate variants of boards subject to bus conflict are often not subject to it // so we allow to set m_bus_conflict to FALSE at loading time when necessary @@ -668,7 +668,7 @@ WRITE8_MEMBER(device_nes_cart_interface::write_h) } -void device_nes_cart_interface::pcb_start(running_machine &machine, UINT8 *ciram_ptr, bool cart_mounted) +void device_nes_cart_interface::pcb_start(running_machine &machine, uint8_t *ciram_ptr, bool cart_mounted) { // HACK: to reduce tagmap lookups for PPU-related IRQs, we add a hook to the // main NES CPU here, even if it does not belong to this device. @@ -742,7 +742,7 @@ void device_nes_cart_interface::nes_banks_restore() //------------------------------------------------- // nes_cart_slot_device - constructor //------------------------------------------------- -nes_cart_slot_device::nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_cart_slot_device::nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_CART_SLOT, "NES Cartridge Slot", tag, owner, clock, "nes_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -782,7 +782,7 @@ void nes_cart_slot_device::device_config_complete() } -void nes_cart_slot_device::pcb_start(UINT8 *ciram_ptr) +void nes_cart_slot_device::pcb_start(uint8_t *ciram_ptr) { if (m_cart) m_cart->pcb_start(machine(), ciram_ptr, exists()); @@ -885,8 +885,8 @@ void nes_cart_slot_device::call_unload() { if (m_cart->get_battery_size() || m_cart->get_mapper_sram_size()) { - UINT32 tot_size = m_cart->get_battery_size() + m_cart->get_mapper_sram_size(); - std::vector temp_nvram(tot_size); + uint32_t tot_size = m_cart->get_battery_size() + m_cart->get_mapper_sram_size(); + std::vector temp_nvram(tot_size); if (m_cart->get_battery_size()) memcpy(&temp_nvram[0], m_cart->get_battery_base(), m_cart->get_battery_size()); if (m_cart->get_mapper_sram_size()) @@ -907,8 +907,8 @@ std::string nes_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string = "nrom"; - UINT32 len = m_file->size(); - std::vector rom(len); + uint32_t len = m_file->size(); + std::vector rom(len); m_file->read(&rom[0], len); @@ -935,7 +935,7 @@ READ8_MEMBER(nes_cart_slot_device::read_l) { if (m_cart) { - UINT8 val = m_cart->read_l(space, offset); + uint8_t val = m_cart->read_l(space, offset); // update open bus m_cart->set_open_bus(((offset + 0x4100) & 0xff00) >> 8); return val; @@ -948,7 +948,7 @@ READ8_MEMBER(nes_cart_slot_device::read_m) { if (m_cart) { - UINT8 val = m_cart->read_m(space, offset); + uint8_t val = m_cart->read_m(space, offset); // update open bus m_cart->set_open_bus(((offset + 0x6000) & 0xff00) >> 8); return val; @@ -961,7 +961,7 @@ READ8_MEMBER(nes_cart_slot_device::read_h) { if (m_cart) { - UINT8 val = m_cart->read_h(space, offset); + uint8_t val = m_cart->read_h(space, offset); // update open bus m_cart->set_open_bus(((offset + 0x8000) & 0xff00) >> 8); return val; @@ -974,7 +974,7 @@ READ8_MEMBER(nes_cart_slot_device::read_ex) { if (m_cart) { - UINT8 val = m_cart->read_ex(space, offset); + uint8_t val = m_cart->read_ex(space, offset); // update open bus m_cart->set_open_bus(((offset + 0x4020) & 0xff00) >> 8); return val; diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index ab906ed6162..55adc6780e4 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -201,45 +201,45 @@ public: void set_vrc_lines(int PRG_A, int PRG_B, int CHR) { m_vrc_ls_prg_a = PRG_A; m_vrc_ls_prg_b = PRG_B; m_vrc_ls_chr = CHR; } void set_x1_005_alt(bool val) { m_x1_005_alt_mirroring = val; } void set_bus_conflict(bool val) { m_bus_conflict = val; } - void set_open_bus(UINT8 val) { m_open_bus = val; } - - UINT8* get_prg_base() { return m_prg; } - UINT8* get_prgram_base() { return &m_prgram[0]; } - UINT8* get_vrom_base() { return m_vrom; } - UINT8* get_vram_base() { return &m_vram[0]; } - UINT8* get_battery_base() { return &m_battery[0]; } - UINT8* get_mapper_sram_base() { return m_mapper_sram; } - - UINT32 get_prg_size() { return m_prg_size; } - UINT32 get_prgram_size() { return m_prgram.size(); } - UINT32 get_vrom_size() { return m_vrom_size; } - UINT32 get_vram_size() { return m_vram.size(); } - UINT32 get_battery_size() { return m_battery.size(); } - UINT32 get_mapper_sram_size() { return m_mapper_sram_size; } + void set_open_bus(uint8_t val) { m_open_bus = val; } + + uint8_t* get_prg_base() { return m_prg; } + uint8_t* get_prgram_base() { return &m_prgram[0]; } + uint8_t* get_vrom_base() { return m_vrom; } + uint8_t* get_vram_base() { return &m_vram[0]; } + uint8_t* get_battery_base() { return &m_battery[0]; } + uint8_t* get_mapper_sram_base() { return m_mapper_sram; } + + uint32_t get_prg_size() { return m_prg_size; } + uint32_t get_prgram_size() { return m_prgram.size(); } + uint32_t get_vrom_size() { return m_vrom_size; } + uint32_t get_vram_size() { return m_vram.size(); } + uint32_t get_battery_size() { return m_battery.size(); } + uint32_t get_mapper_sram_size() { return m_mapper_sram_size; } virtual void ppu_latch(offs_t offset) {} virtual void hblank_irq(int scanline, int vblank, int blanked) {} virtual void scanline_irq(int scanline, int vblank, int blanked) {} virtual void pcb_reset() {} // many pcb expect specific PRG/CHR banking at start - virtual void pcb_start(running_machine &machine, UINT8 *ciram_ptr, bool cart_mounted); + virtual void pcb_start(running_machine &machine, uint8_t *ciram_ptr, bool cart_mounted); void pcb_reg_postload(running_machine &machine); void nes_banks_restore(); - UINT8 hi_access_rom(UINT32 offset); // helper ROM access for a bunch of PCB reading 0x8000-0xffff for protection too - UINT8 account_bus_conflict(UINT32 offset, UINT8 data); + uint8_t hi_access_rom(uint32_t offset); // helper ROM access for a bunch of PCB reading 0x8000-0xffff for protection too + uint8_t account_bus_conflict(uint32_t offset, uint8_t data); protected: // internal state - UINT8 *m_prg; - UINT8 *m_vrom; - UINT8 *m_ciram; - std::vector m_prgram; - std::vector m_vram; - std::vector m_battery; - UINT32 m_prg_size; - UINT32 m_vrom_size; + uint8_t *m_prg; + uint8_t *m_vrom; + uint8_t *m_ciram; + std::vector m_prgram; + std::vector m_vram; + std::vector m_battery; + uint32_t m_prg_size; + uint32_t m_vrom_size; // HACK: to reduce tagmap lookups for PPU-related IRQs, we add a hook to the // main NES CPU here, even if it does not belong to this device. @@ -247,9 +247,9 @@ protected: // these are specific of some boards but must be accessible from the driver // E.g. additional save ram for HKROM, X1-005 & X1-017 boards, or ExRAM for MMC5 - UINT8 *m_mapper_sram; - std::vector m_ext_ntram; - UINT32 m_mapper_sram_size; + uint8_t *m_mapper_sram; + std::vector m_ext_ntram; + uint32_t m_mapper_sram_size; int m_ce_mask; int m_ce_state; @@ -261,15 +261,15 @@ protected: bool m_pcb_ctrl_mirror, m_four_screen_vram, m_has_trainer; bool m_x1_005_alt_mirroring; // temp hack for two kind of mirroring in Taito X1-005 boards (to be replaced with pin checking) bool m_bus_conflict; - UINT8 m_open_bus; + uint8_t m_open_bus; // PRG inline int prg_8k_bank_num(int bank); inline void update_prg_banks(int prg_bank_start, int prg_bank_end); memory_bank *m_prg_bank_mem[4]; int m_prg_bank[4]; - UINT32 m_prg_chunks; - UINT32 m_prg_mask; + uint32_t m_prg_chunks; + uint32_t m_prg_mask; // PRG helpers void prg32(int bank); @@ -290,10 +290,10 @@ protected: //because some of these change multiple times per scanline! int m_chr_src[8]; //defines source of base pointer int m_chr_orig[8]; //defines offset of 0x400 byte segment at base pointer - UINT8 *m_chr_access[8]; //source translated + origin -> valid pointer! + uint8_t *m_chr_access[8]; //source translated + origin -> valid pointer! - UINT32 m_vrom_chunks; - UINT32 m_vram_chunks; + uint32_t m_vrom_chunks; + uint32_t m_vram_chunks; // CHR helpers void chr8(int bank, int source); @@ -321,12 +321,12 @@ protected: int m_nt_src[4]; int m_nt_orig[4]; int m_nt_writable[4]; - UINT8 *m_nt_access[4]; //quick banking structure for a maximum of 4K of RAM/ROM/ExRAM + uint8_t *m_nt_access[4]; //quick banking structure for a maximum of 4K of RAM/ROM/ExRAM void set_nt_page(int page, int source, int bank, int writable); void set_nt_mirroring(int mirroring); - std::vector m_prg_bank_map; + std::vector m_prg_bank_map; }; void nes_partialhash(util::hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions); @@ -339,7 +339,7 @@ class nes_cart_slot_device : public device_t, { public: // construction/destruction - nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~nes_cart_slot_device(); // device-level overrides @@ -367,8 +367,8 @@ public: // slot interface overrides virtual std::string get_default_card_software() override; - const char * get_default_card_ines(UINT8 *ROM, UINT32 len); - const char * get_default_card_unif(UINT8 *ROM, UINT32 len); + const char * get_default_card_ines(uint8_t *ROM, uint32_t len); + const char * get_default_card_unif(uint8_t *ROM, uint32_t len); const char * nes_get_slot(int pcb_id); int nes_get_pcb_id(const char *slot); @@ -387,7 +387,7 @@ public: int get_pcb_id() { return m_pcb_id; }; - void pcb_start(UINT8 *ciram_ptr); + void pcb_start(uint8_t *ciram_ptr); void pcb_reset(); // temporarily here diff --git a/src/devices/bus/nes/nes_unif.hxx b/src/devices/bus/nes/nes_unif.hxx index ff5d9e1384d..168ca61a7ab 100644 --- a/src/devices/bus/nes/nes_unif.hxx +++ b/src/devices/bus/nes/nes_unif.hxx @@ -202,20 +202,20 @@ void unif_mapr_setup( const char *board, int *pcb_id, int *battery, int *prgram, void nes_cart_slot_device::call_load_unif() { - UINT32 vram_size = 0, prgram_size = 0, battery_size = 0, mapper_sram_size = 0; + uint32_t vram_size = 0, prgram_size = 0, battery_size = 0, mapper_sram_size = 0; // SETUP step 1: running through the file and getting PRG, VROM sizes - UINT32 unif_ver = 0, chunk_length = 0, read_length = 0x20; - UINT32 prg_start = 0, chr_start = 0; - UINT32 size = length(), prg_size = 0, vrom_size = 0; - UINT8 buffer[4], mirror = 0; + uint32_t unif_ver = 0, chunk_length = 0, read_length = 0x20; + uint32_t prg_start = 0, chr_start = 0; + uint32_t size = length(), prg_size = 0, vrom_size = 0; + uint8_t buffer[4], mirror = 0; char magic2[4]; char unif_mapr[32]; // here we should store MAPR chunks bool mapr_chunk_found = FALSE, small_prg = FALSE; // allocate space to temporarily store PRG & CHR banks - std::vector temp_prg(256 * 0x4000); - std::vector temp_chr(256 * 0x2000); - UINT8 temp_byte = 0; + std::vector temp_prg(256 * 0x4000); + std::vector temp_chr(256 * 0x2000); + uint8_t temp_byte = 0; fseek(4, SEEK_SET); fread(&buffer, 4); @@ -540,8 +540,8 @@ void nes_cart_slot_device::call_load_unif() // A few boards have internal RAM with a battery (MMC6, Taito X1-005 & X1-017, etc.) if (battery_size || mapper_sram_size) { - UINT32 tot_size = battery_size + mapper_sram_size; - std::vector temp_nvram(tot_size); + uint32_t tot_size = battery_size + mapper_sram_size; + std::vector temp_nvram(tot_size); battery_load(&temp_nvram[0], tot_size, 0x00); if (battery_size) { @@ -555,9 +555,9 @@ void nes_cart_slot_device::call_load_unif() logerror("UNIF support is only very preliminary.\n"); } -const char * nes_cart_slot_device::get_default_card_unif(UINT8 *ROM, UINT32 len) +const char * nes_cart_slot_device::get_default_card_unif(uint8_t *ROM, uint32_t len) { - UINT32 chunk_length = 0, read_length = 0x20; + uint32_t chunk_length = 0, read_length = 0x20; int pcb_id = 0, battery = 0, prgram = 0, vram_chunks = 0; char unif_mapr[32]; diff --git a/src/devices/bus/nes/ntdec.cpp b/src/devices/bus/nes/ntdec.cpp index 77b983137a3..2e75216664d 100644 --- a/src/devices/bus/nes/ntdec.cpp +++ b/src/devices/bus/nes/ntdec.cpp @@ -38,13 +38,13 @@ const device_type NES_NTDEC_ASDER = &device_creator; const device_type NES_NTDEC_FH = &device_creator; -nes_ntdec_asder_device::nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ntdec_asder_device::nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NTDEC_ASDER, "NES Cart NTDEC Asder PCB", tag, owner, clock, "nes_ntdec_asder", __FILE__), m_latch(0) { } -nes_ntdec_fh_device::nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ntdec_fh_device::nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NTDEC_FH, "NES Cart NTDEC Fighting Hero PCB", tag, owner, clock, "nes_ntdec_fh", __FILE__) { } diff --git a/src/devices/bus/nes/ntdec.h b/src/devices/bus/nes/ntdec.h index bc6906179ce..daa7ba8acdf 100644 --- a/src/devices/bus/nes/ntdec.h +++ b/src/devices/bus/nes/ntdec.h @@ -12,7 +12,7 @@ class nes_ntdec_asder_device : public nes_nrom_device { public: // construction/destruction - nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -21,7 +21,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -31,7 +31,7 @@ class nes_ntdec_fh_device : public nes_nrom_device { public: // construction/destruction - nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ntdec_fh_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/devices/bus/nes/nxrom.cpp b/src/devices/bus/nes/nxrom.cpp index c7fb9a90f3b..4af56430356 100644 --- a/src/devices/bus/nes/nxrom.cpp +++ b/src/devices/bus/nes/nxrom.cpp @@ -59,74 +59,74 @@ const device_type NES_UN1ROM = &device_creator; const device_type NES_NOCHR = &device_creator; -nes_nrom_device::nes_nrom_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) +nes_nrom_device::nes_nrom_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_nes_cart_interface( mconfig, *this ) { } -nes_nrom_device::nes_nrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_nrom_device::nes_nrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_NROM, "NES Cart NROM PCB", tag, owner, clock, "nes_nrom", __FILE__), device_nes_cart_interface( mconfig, *this ) { } -nes_nrom368_device::nes_nrom368_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_nrom368_device::nes_nrom368_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NROM368, "NES Cart NROM-368 PCB", tag, owner, clock, "nes_nrom368", __FILE__) { } -nes_fcbasic_device::nes_fcbasic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_fcbasic_device::nes_fcbasic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_FCBASIC, "NES Cart Famicom BASIC PCB", tag, owner, clock, "nes_fcbasic", __FILE__) { } -nes_axrom_device::nes_axrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_axrom_device::nes_axrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_AXROM, "NES Cart AxROM PCB", tag, owner, clock, "nes_axrom", __FILE__) { } -nes_bxrom_device::nes_bxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bxrom_device::nes_bxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_BXROM, "NES Cart BxROM PCB", tag, owner, clock, "nes_bxrom", __FILE__) { } -nes_cnrom_device::nes_cnrom_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) +nes_cnrom_device::nes_cnrom_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_chr_open_bus(0) { } -nes_cnrom_device::nes_cnrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_cnrom_device::nes_cnrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_CNROM, "NES Cart CNROM PCB", tag, owner, clock, "nes_cnrom", __FILE__), m_chr_open_bus(0) { } -nes_cprom_device::nes_cprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_cprom_device::nes_cprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_CPROM, "NES Cart CPROM PCB", tag, owner, clock, "nes_cprom", __FILE__) { } -nes_gxrom_device::nes_gxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_gxrom_device::nes_gxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_GXROM, "NES Cart GxROM PCB", tag, owner, clock, "nes_gxrom", __FILE__) { } -nes_uxrom_device::nes_uxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_uxrom_device::nes_uxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_UXROM, "NES Cart UxROM PCB", tag, owner, clock, "nes_uxrom", __FILE__) { } -nes_uxrom_cc_device::nes_uxrom_cc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_uxrom_cc_device::nes_uxrom_cc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_UXROM_CC, "NES Cart UNROM M5 PCB (Crazy Climber)", tag, owner, clock, "nes_uxrom_cc", __FILE__) { } -nes_un1rom_device::nes_un1rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_un1rom_device::nes_un1rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_UN1ROM, "NES Cart UN1ROM PCB", tag, owner, clock, "nes_un1rom", __FILE__) { } -nes_nochr_device::nes_nochr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_nochr_device::nes_nochr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_NOCHR, "NES Cart NoCash NOCHR PCB", tag, owner, clock, "nes_nochr", __FILE__) { } diff --git a/src/devices/bus/nes/nxrom.h b/src/devices/bus/nes/nxrom.h index e813e4f1ad3..c4f112bb68e 100644 --- a/src/devices/bus/nes/nxrom.h +++ b/src/devices/bus/nes/nxrom.h @@ -14,8 +14,8 @@ class nes_nrom_device : public device_t, { public: // construction/destruction - nes_nrom_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); - nes_nrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_nrom_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); + nes_nrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override { common_start(); } @@ -31,7 +31,7 @@ class nes_nrom368_device : public nes_nrom_device { public: // construction/destruction - nes_nrom368_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_nrom368_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(read_l) override; virtual DECLARE_READ8_MEMBER(read_m) override; @@ -45,7 +45,7 @@ class nes_fcbasic_device : public nes_nrom_device { public: // construction/destruction - nes_fcbasic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fcbasic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // emulate the additional WRAM }; @@ -57,7 +57,7 @@ class nes_axrom_device : public nes_nrom_device { public: // construction/destruction - nes_axrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_axrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -73,7 +73,7 @@ class nes_bxrom_device : public nes_nrom_device { public: // construction/destruction - nes_bxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -89,8 +89,8 @@ class nes_cnrom_device : public nes_nrom_device { public: // construction/destruction - nes_cnrom_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); - nes_cnrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_cnrom_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); + nes_cnrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -100,7 +100,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_chr_open_bus; + uint8_t m_chr_open_bus; }; @@ -110,7 +110,7 @@ class nes_cprom_device : public nes_nrom_device { public: // construction/destruction - nes_cprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_cprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -126,7 +126,7 @@ class nes_gxrom_device : public nes_nrom_device { public: // construction/destruction - nes_gxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_gxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -142,7 +142,7 @@ class nes_uxrom_device : public nes_nrom_device { public: // construction/destruction - nes_uxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_uxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -158,7 +158,7 @@ class nes_uxrom_cc_device : public nes_nrom_device { public: // construction/destruction - nes_uxrom_cc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_uxrom_cc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -174,7 +174,7 @@ class nes_un1rom_device : public nes_nrom_device { public: // construction/destruction - nes_un1rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_un1rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -190,7 +190,7 @@ class nes_nochr_device : public nes_nrom_device { public: // construction/destruction - nes_nochr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_nochr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_READ8_MEMBER(chr_r) override; diff --git a/src/devices/bus/nes/pirate.cpp b/src/devices/bus/nes/pirate.cpp index 9d31e1b7a1f..69e6117b977 100644 --- a/src/devices/bus/nes/pirate.cpp +++ b/src/devices/bus/nes/pirate.cpp @@ -53,87 +53,87 @@ const device_type NES_TF1201 = &device_creator; const device_type NES_CITYFIGHT = &device_creator; -nes_agci_device::nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_agci_device::nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_AGCI_50282, "NES Cart AGCI 50282 PCB", tag, owner, clock, "nes_agci50282", __FILE__) { } -nes_dreamtech_device::nes_dreamtech_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_dreamtech_device::nes_dreamtech_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_DREAMTECH01, "NES Cart Dreamtech01 PCB", tag, owner, clock, "nes_dreamtech", __FILE__) { } -nes_fukutake_device::nes_fukutake_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_fukutake_device::nes_fukutake_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_FUKUTAKE, "NES Cart Fukutake Study Box PCB", tag, owner, clock, "nes_fukutake", __FILE__), m_latch(0) { } -nes_futuremedia_device::nes_futuremedia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_futuremedia_device::nes_futuremedia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_FUTUREMEDIA, "NES Cart FutureMedia PCB", tag, owner, clock, "nes_futuremedia", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0) { } -nes_magseries_device::nes_magseries_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_magseries_device::nes_magseries_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_MAGSERIES, "NES Cart Magical Series PCB", tag, owner, clock, "nes_magseries", __FILE__) { } -nes_daou306_device::nes_daou306_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_daou306_device::nes_daou306_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_DAOU306, "NES Cart Daou 306 PCB", tag, owner, clock, "nes_daou306", __FILE__) { } -nes_subor0_device::nes_subor0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_subor0_device::nes_subor0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SUBOR0, "NES Cart Subor Type 0 PCB", tag, owner, clock, "nes_subor0", __FILE__) { } -nes_subor1_device::nes_subor1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_subor1_device::nes_subor1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SUBOR1, "NES Cart Subor Type 1 PCB", tag, owner, clock, "nes_subor1", __FILE__) { } -nes_cc21_device::nes_cc21_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_cc21_device::nes_cc21_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_CC21, "NES Cart CC-21 PCB", tag, owner, clock, "nes_cc21", __FILE__) { } -nes_xiaozy_device::nes_xiaozy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_xiaozy_device::nes_xiaozy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_XIAOZY, "NES Cart Xiao Zhuan Yuan PCB", tag, owner, clock, "nes_xiaozy", __FILE__) { } -nes_edu2k_device::nes_edu2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_edu2k_device::nes_edu2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_EDU2K, "NES Cart Educational Computer 2000 PCB", tag, owner, clock, "nes_edu2k", __FILE__), m_latch(0) { } -nes_t230_device::nes_t230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_t230_device::nes_t230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_T230, "NES Cart T-230 PCB", tag, owner, clock, "nes_t230", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), m_irq_enable_latch(0) { } -nes_mk2_device::nes_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_mk2_device::nes_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_MK2, "NES Cart Mortal Kombat 2 PCB", tag, owner, clock, "nes_mk2", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0) { } -nes_whero_device::nes_whero_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_whero_device::nes_whero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_WHERO, "NES Cart World Heroes PCB", tag, owner, clock, "nes_whero", __FILE__), m_reg(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0) { } -nes_43272_device::nes_43272_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_43272_device::nes_43272_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_43272, "NES Cart UNL-43272 PCB", tag, owner, clock, "nes_43272", __FILE__), m_latch(0) { } -nes_tf1201_device::nes_tf1201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tf1201_device::nes_tf1201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TF1201, "NES Cart UNL-TF1201 PCB", tag, owner, clock, "nes_tf1201", __FILE__), m_prg(0), m_swap(0), m_irq_count(0), m_irq_enable(0), m_irq_enable_latch(0) { } -nes_cityfight_device::nes_cityfight_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_cityfight_device::nes_cityfight_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TF1201, "NES Cart City Fighter PCB", tag, owner, clock, "nes_cityfight", __FILE__), m_prg_reg(0), m_prg_mode(0), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr) { } @@ -472,7 +472,7 @@ WRITE8_MEMBER(nes_agci_device::write_h) LOG_MMC(("agci write_h, offset: %04x, data: %02x\n", offset, data)); // this pcb is subject to bus conflict - UINT8 temp = account_bus_conflict(offset, 0xff); + uint8_t temp = account_bus_conflict(offset, 0xff); data = (data & temp) | (temp & 1); chr8(data >> 4, CHRROM); @@ -739,7 +739,7 @@ WRITE8_MEMBER(nes_daou306_device::write_h) WRITE8_MEMBER(nes_subor0_device::write_h) { - UINT8 subor_helper1, subor_helper2; + uint8_t subor_helper1, subor_helper2; LOG_MMC(("subor0 write_h, offset: %04x, data: %02x\n", offset, data)); m_reg[(offset >> 13) & 0x03] = data; @@ -777,7 +777,7 @@ WRITE8_MEMBER(nes_subor0_device::write_h) WRITE8_MEMBER(nes_subor1_device::write_h) { - UINT8 subor_helper1, subor_helper2; + uint8_t subor_helper1, subor_helper2; LOG_MMC(("subor1 write_h, offset: %04x, data: %02x\n", offset, data)); m_reg[(offset >> 13) & 0x03] = data; @@ -1139,7 +1139,7 @@ WRITE8_MEMBER(nes_43272_device::write_h) READ8_MEMBER(nes_43272_device::read_h) { - UINT8 mask = (m_latch & 0x400) ? 0xfe : 0xff; + uint8_t mask = (m_latch & 0x400) ? 0xfe : 0xff; LOG_MMC(("unl_43272 read_h, offset: %04x\n", offset)); return hi_access_rom(offset & mask); diff --git a/src/devices/bus/nes/pirate.h b/src/devices/bus/nes/pirate.h index c9425d5e263..3a8bd1c09ea 100644 --- a/src/devices/bus/nes/pirate.h +++ b/src/devices/bus/nes/pirate.h @@ -12,7 +12,7 @@ class nes_agci_device : public nes_nrom_device { public: // construction/destruction - nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_dreamtech_device : public nes_nrom_device { public: // construction/destruction - nes_dreamtech_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_dreamtech_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -44,7 +44,7 @@ class nes_fukutake_device : public nes_nrom_device { public: // construction/destruction - nes_fukutake_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fukutake_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -56,8 +56,8 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; - UINT8 m_ram[0xb00]; + uint8_t m_latch; + uint8_t m_ram[0xb00]; }; @@ -67,7 +67,7 @@ class nes_futuremedia_device : public nes_nrom_device { public: // construction/destruction - nes_futuremedia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_futuremedia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -77,8 +77,8 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count, m_irq_count_latch; - UINT8 m_irq_clear; + uint16_t m_irq_count, m_irq_count_latch; + uint8_t m_irq_clear; int m_irq_enable; }; @@ -89,7 +89,7 @@ class nes_magseries_device : public nes_nrom_device { public: // construction/destruction - nes_magseries_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_magseries_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -105,7 +105,7 @@ class nes_daou306_device : public nes_nrom_device { public: // construction/destruction - nes_daou306_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_daou306_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -114,7 +114,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[16]; + uint8_t m_reg[16]; }; @@ -124,7 +124,7 @@ class nes_subor0_device : public nes_nrom_device { public: // construction/destruction - nes_subor0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_subor0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -133,7 +133,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; @@ -143,7 +143,7 @@ class nes_subor1_device : public nes_nrom_device { public: // construction/destruction - nes_subor1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_subor1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -152,7 +152,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; @@ -162,7 +162,7 @@ class nes_cc21_device : public nes_nrom_device { public: // construction/destruction - nes_cc21_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_cc21_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -178,7 +178,7 @@ class nes_xiaozy_device : public nes_nrom_device { public: // construction/destruction - nes_xiaozy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_xiaozy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -194,7 +194,7 @@ class nes_edu2k_device : public nes_nrom_device { public: // construction/destruction - nes_edu2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_edu2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -205,7 +205,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -215,7 +215,7 @@ class nes_t230_device : public nes_nrom_device { public: // construction/destruction - nes_t230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_t230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -225,11 +225,11 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count, m_irq_count_latch; - UINT8 m_irq_mode; + uint16_t m_irq_count, m_irq_count_latch; + uint8_t m_irq_mode; int m_irq_enable, m_irq_enable_latch; - UINT8 m_mmc_vrom_bank[8]; + uint8_t m_mmc_vrom_bank[8]; }; @@ -239,7 +239,7 @@ class nes_mk2_device : public nes_nrom_device { public: // construction/destruction - nes_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -249,8 +249,8 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count, m_irq_count_latch; - UINT8 m_irq_clear; + uint16_t m_irq_count, m_irq_count_latch; + uint8_t m_irq_clear; int m_irq_enable; }; @@ -261,7 +261,7 @@ class nes_whero_device : public nes_nrom_device { public: // construction/destruction - nes_whero_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_whero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -271,10 +271,10 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg; - UINT8 m_mmc_vrom_bank[8]; + uint8_t m_reg; + uint8_t m_mmc_vrom_bank[8]; - UINT16 m_irq_count, m_irq_count_latch; + uint16_t m_irq_count, m_irq_count_latch; int m_irq_enable, m_irq_enable_latch; // int m_irq_mode; }; @@ -286,7 +286,7 @@ class nes_43272_device : public nes_nrom_device { public: // construction/destruction - nes_43272_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_43272_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -296,7 +296,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_latch; + uint16_t m_latch; }; @@ -306,7 +306,7 @@ class nes_tf1201_device : public nes_nrom_device { public: // construction/destruction - nes_tf1201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tf1201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -317,11 +317,11 @@ public: private: void update_prg(); - UINT8 m_prg, m_swap; - UINT16 m_irq_count; + uint8_t m_prg, m_swap; + uint16_t m_irq_count; int m_irq_enable, m_irq_enable_latch; - UINT8 m_mmc_vrom_bank[8]; + uint8_t m_mmc_vrom_bank[8]; }; @@ -331,7 +331,7 @@ class nes_cityfight_device : public nes_nrom_device { public: // construction/destruction - nes_cityfight_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_cityfight_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -342,14 +342,14 @@ public: private: void update_prg(); - UINT8 m_prg_reg, m_prg_mode; - UINT16 m_irq_count; + uint8_t m_prg_reg, m_prg_mode; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; - UINT8 m_mmc_vrom_bank[8]; + uint8_t m_mmc_vrom_bank[8]; }; @@ -361,7 +361,7 @@ class nes_fujiya_device : public nes_nrom_device { public: // construction/destruction - nes_fujiya_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fujiya_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -371,7 +371,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; #endif diff --git a/src/devices/bus/nes/pt554.cpp b/src/devices/bus/nes/pt554.cpp index c9fec996e8e..2794a78a55e 100644 --- a/src/devices/bus/nes/pt554.cpp +++ b/src/devices/bus/nes/pt554.cpp @@ -34,7 +34,7 @@ const device_type NES_BANDAI_PT554 = &device_creator; -nes_bandai_pt554_device::nes_bandai_pt554_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_bandai_pt554_device::nes_bandai_pt554_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_cnrom_device(mconfig, NES_BANDAI_PT554, "NES Cart Bandai PT-554 PCB", tag, owner, clock, "nes_bandai_pt554", __FILE__), m_samples(*this, "samples") { diff --git a/src/devices/bus/nes/pt554.h b/src/devices/bus/nes/pt554.h index b42cc048d5e..2dc1fe6f6f0 100644 --- a/src/devices/bus/nes/pt554.h +++ b/src/devices/bus/nes/pt554.h @@ -12,7 +12,7 @@ class nes_bandai_pt554_device : public nes_cnrom_device { public: // construction/destruction - nes_bandai_pt554_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bandai_pt554_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/nes/racermate.cpp b/src/devices/bus/nes/racermate.cpp index 9f549dc1f2d..f56733d2127 100644 --- a/src/devices/bus/nes/racermate.cpp +++ b/src/devices/bus/nes/racermate.cpp @@ -35,7 +35,7 @@ const device_type NES_RACERMATE = &device_creator; -nes_racermate_device::nes_racermate_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_racermate_device::nes_racermate_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_RACERMATE, "NES Cart Racermate PCB", tag, owner, clock, "nes_racermate", __FILE__), m_latch(0) { diff --git a/src/devices/bus/nes/racermate.h b/src/devices/bus/nes/racermate.h index 3ba50b399ae..da7a5f5174b 100644 --- a/src/devices/bus/nes/racermate.h +++ b/src/devices/bus/nes/racermate.h @@ -12,7 +12,7 @@ class nes_racermate_device : public nes_nrom_device { public: // construction/destruction - nes_racermate_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_racermate_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -22,7 +22,7 @@ public: private: void update_banks(); - UINT8 m_latch; + uint8_t m_latch; }; diff --git a/src/devices/bus/nes/rcm.cpp b/src/devices/bus/nes/rcm.cpp index a599dcbd432..30f867cb39b 100644 --- a/src/devices/bus/nes/rcm.cpp +++ b/src/devices/bus/nes/rcm.cpp @@ -46,27 +46,27 @@ const device_type NES_TF9IN1 = &device_creator; const device_type NES_3DBLOCK = &device_creator; -nes_gs2015_device::nes_gs2015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_gs2015_device::nes_gs2015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_GS2015, "NES Cart RCM GS-2015 PCB", tag, owner, clock, "nes_gs2015", __FILE__) { } -nes_gs2004_device::nes_gs2004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_gs2004_device::nes_gs2004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_GS2004, "NES Cart RCM GS-2004 PCB", tag, owner, clock, "nes_gs2004", __FILE__) { } -nes_gs2013_device::nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_gs2013_device::nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_GS2013, "NES Cart RCM GS-2013 PCB", tag, owner, clock, "nes_gs2013", __FILE__) { } -nes_tf9_device::nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tf9_device::nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TF9IN1, "NES Cart RCM Tetris Family 9 in 1 PCB", tag, owner, clock, "nes_tetrisfam", __FILE__) { } -nes_3dblock_device::nes_3dblock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_3dblock_device::nes_3dblock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_3DBLOCK, "NES Cart RCM 3D Block PCB", tag, owner, clock, "nes_3dblock", __FILE__), m_irq_count(0) { } diff --git a/src/devices/bus/nes/rcm.h b/src/devices/bus/nes/rcm.h index 0b78c1e41bf..d7858cbdb53 100644 --- a/src/devices/bus/nes/rcm.h +++ b/src/devices/bus/nes/rcm.h @@ -12,7 +12,7 @@ class nes_gs2015_device : public nes_nrom_device { public: // construction/destruction - nes_gs2015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_gs2015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -30,7 +30,7 @@ class nes_gs2004_device : public nes_nrom_device { public: // construction/destruction - nes_gs2004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_gs2004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -46,7 +46,7 @@ class nes_gs2013_device : public nes_nrom_device { public: // construction/destruction - nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -62,7 +62,7 @@ class nes_tf9_device : public nes_nrom_device { public: // construction/destruction - nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -78,7 +78,7 @@ class nes_3dblock_device : public nes_nrom_device { public: // construction/destruction - nes_3dblock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_3dblock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -88,8 +88,8 @@ public: virtual void pcb_reset() override; private: - UINT8 m_reg[4]; - UINT8 m_irq_count; + uint8_t m_reg[4]; + uint8_t m_irq_count; }; diff --git a/src/devices/bus/nes/rexsoft.cpp b/src/devices/bus/nes/rexsoft.cpp index ed2b7246726..de49c5d9af9 100644 --- a/src/devices/bus/nes/rexsoft.cpp +++ b/src/devices/bus/nes/rexsoft.cpp @@ -39,13 +39,13 @@ const device_type NES_REX_DBZ5 = &device_creator; const device_type NES_REX_SL1632 = &device_creator; -nes_rex_dbz5_device::nes_rex_dbz5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_rex_dbz5_device::nes_rex_dbz5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_REX_DBZ5, "NES Cart Rex Soft DragonBall Z V PCB", tag, owner, clock, "nes_rex_dbz5", __FILE__), m_extra(0) { } -nes_rex_sl1632_device::nes_rex_sl1632_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_rex_sl1632_device::nes_rex_sl1632_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_REX_SL1632, "NES Cart Rex Soft SL-1632 PCB", tag, owner, clock, "nes_rex_sl1632", __FILE__), m_mode(0), m_mirror(0) { } @@ -154,7 +154,7 @@ void nes_rex_sl1632_device::set_prg(int prg_base, int prg_mask) if (m_mode & 0x02) { // here standard MMC3 bankswitch - UINT8 prg_flip = (m_latch & 0x40) ? 2 : 0; + uint8_t prg_flip = (m_latch & 0x40) ? 2 : 0; prg_cb(0, prg_base | (m_mmc_prg_bank[0 ^ prg_flip] & prg_mask)); prg_cb(1, prg_base | (m_mmc_prg_bank[1] & prg_mask)); @@ -170,12 +170,12 @@ void nes_rex_sl1632_device::set_prg(int prg_base, int prg_mask) } } -void nes_rex_sl1632_device::set_chr(UINT8 chr, int chr_base, int chr_mask) +void nes_rex_sl1632_device::set_chr(uint8_t chr, int chr_base, int chr_mask) { - static const UINT8 conv_table[8] = {5, 5, 5, 5, 3, 3, 1, 1}; - UINT8 chr_page = (m_latch & 0x80) >> 5; - UINT8 bank[8]; - UINT8 chr_base2[8]; + static const uint8_t conv_table[8] = {5, 5, 5, 5, 3, 3, 1, 1}; + uint8_t chr_page = (m_latch & 0x80) >> 5; + uint8_t bank[8]; + uint8_t chr_base2[8]; if (m_mode & 0x02) { @@ -210,7 +210,7 @@ void nes_rex_sl1632_device::set_chr(UINT8 chr, int chr_base, int chr_mask) WRITE8_MEMBER(nes_rex_sl1632_device::write_h) { - UINT8 helper1, helper2; + uint8_t helper1, helper2; LOG_MMC(("rex_sl1632 write_h, offset: %04x, data: %02x\n", offset, data)); if (offset == 0x2131) diff --git a/src/devices/bus/nes/rexsoft.h b/src/devices/bus/nes/rexsoft.h index 0b9799ee168..996b22baf13 100644 --- a/src/devices/bus/nes/rexsoft.h +++ b/src/devices/bus/nes/rexsoft.h @@ -12,7 +12,7 @@ class nes_rex_dbz5_device : public nes_txrom_device { public: // construction/destruction - nes_rex_dbz5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_rex_dbz5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -24,7 +24,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_extra; + uint8_t m_extra; }; @@ -34,7 +34,7 @@ class nes_rex_sl1632_device : public nes_txrom_device { public: // construction/destruction - nes_rex_sl1632_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_rex_sl1632_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -44,10 +44,10 @@ public: protected: virtual void set_prg(int prg_base, int prg_mask) override; - virtual void set_chr(UINT8 chr, int chr_base, int chr_mask) override; + virtual void set_chr(uint8_t chr, int chr_base, int chr_mask) override; - UINT8 m_mode, m_mirror; - UINT8 m_extra_bank[12]; + uint8_t m_mode, m_mirror; + uint8_t m_extra_bank[12]; }; diff --git a/src/devices/bus/nes/sachen.cpp b/src/devices/bus/nes/sachen.cpp index a5128b1bf6a..e000b23216e 100644 --- a/src/devices/bus/nes/sachen.cpp +++ b/src/devices/bus/nes/sachen.cpp @@ -60,82 +60,82 @@ const device_type NES_SACHEN_8259C = &device_creator; const device_type NES_SACHEN_8259D = &device_creator; -nes_sachen_sa009_device::nes_sachen_sa009_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_sa009_device::nes_sachen_sa009_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SACHEN_SA009, "NES Cart Sachen SA009 PCB", tag, owner, clock, "nes_sa009", __FILE__) { } -nes_sachen_sa0036_device::nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_sa0036_device::nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SACHEN_SA0036, "NES Cart Sachen sa0036 PCB", tag, owner, clock, "nes_sa0036", __FILE__) { } -nes_sachen_sa0037_device::nes_sachen_sa0037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_sa0037_device::nes_sachen_sa0037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SACHEN_SA0037, "NES Cart Sachen sa0037 PCB", tag, owner, clock, "nes_sa0037", __FILE__) { } -nes_sachen_sa72007_device::nes_sachen_sa72007_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_sa72007_device::nes_sachen_sa72007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SACHEN_SA72007, "NES Cart Sachen SA72007 PCB", tag, owner, clock, "nes_sa72007", __FILE__) { } -nes_sachen_sa72008_device::nes_sachen_sa72008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_sa72008_device::nes_sachen_sa72008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SACHEN_SA72008, "NES Cart Sachen SA72008 PCB", tag, owner, clock, "nes_sa72008", __FILE__) { } -nes_sachen_tca01_device::nes_sachen_tca01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_tca01_device::nes_sachen_tca01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SACHEN_TCA01, "NES Cart Sachen TCA-01 PCB", tag, owner, clock, "nes_tca01", __FILE__) { } -nes_sachen_tcu01_device::nes_sachen_tcu01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_tcu01_device::nes_sachen_tcu01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SACHEN_TCU01, "NES Cart Sachen TCU-01 PCB", tag, owner, clock, "nes_tcu01", __FILE__) { } -nes_sachen_tcu02_device::nes_sachen_tcu02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_tcu02_device::nes_sachen_tcu02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SACHEN_TCU02, "NES Cart Sachen TCU-02 PCB", tag, owner, clock, "nes_tcu02", __FILE__), m_latch(0) { } -nes_sachen_74x374_device::nes_sachen_74x374_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) +nes_sachen_74x374_device::nes_sachen_74x374_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0), m_mmc_vrom_bank(0) { } -nes_sachen_74x374_device::nes_sachen_74x374_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_74x374_device::nes_sachen_74x374_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SACHEN_74X374, "NES Cart Sachen 74*374 PCB", tag, owner, clock, "nes_s74x34", __FILE__), m_latch(0), m_mmc_vrom_bank(0) { } -nes_sachen_74x374_alt_device::nes_sachen_74x374_alt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_74x374_alt_device::nes_sachen_74x374_alt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sachen_74x374_device(mconfig, NES_SACHEN_74X374_ALT, "NES Cart Sachen 74*374 Alt PCB", tag, owner, clock, "nes_s74x34a", __FILE__) { } -nes_sachen_8259a_device::nes_sachen_8259a_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) +nes_sachen_8259a_device::nes_sachen_8259a_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) : nes_sachen_74x374_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -nes_sachen_8259a_device::nes_sachen_8259a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_8259a_device::nes_sachen_8259a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sachen_74x374_device(mconfig, NES_SACHEN_8259A, "NES Cart Sachen 8259A PCB", tag, owner, clock, "nes_s8259a", __FILE__) { } -nes_sachen_8259b_device::nes_sachen_8259b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_8259b_device::nes_sachen_8259b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259B, "NES Cart Sachen 8259B PCB", tag, owner, clock, "nes_s8259b", __FILE__) { } -nes_sachen_8259c_device::nes_sachen_8259c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_8259c_device::nes_sachen_8259c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259C, "NES Cart Sachen 8259C PCB", tag, owner, clock, "nes_s8259c", __FILE__) { } -nes_sachen_8259d_device::nes_sachen_8259d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sachen_8259d_device::nes_sachen_8259d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259D, "NES Cart Sachen 8259D PCB", tag, owner, clock, "nes_s8259d", __FILE__) { } @@ -488,7 +488,7 @@ READ8_MEMBER(nes_sachen_tcu02_device::read_l) -------------------------------------------------*/ -void nes_sachen_74x374_device::set_mirror(UINT8 nt) // also used by mappers 137, 138, 139, 141 +void nes_sachen_74x374_device::set_mirror(uint8_t nt) // also used by mappers 137, 138, 139, 141 { switch (nt) { @@ -614,8 +614,8 @@ WRITE8_MEMBER(nes_sachen_74x374_alt_device::write_l) void nes_sachen_8259a_device::chr_update() { - UINT8 bank_helper1 = m_reg[7] & 0x01; - UINT8 bank_helper2 = (m_reg[4] & 0x07) << 3; + uint8_t bank_helper1 = m_reg[7] & 0x01; + uint8_t bank_helper2 = (m_reg[4] & 0x07) << 3; if (m_chr_source == CHRROM) { @@ -657,8 +657,8 @@ WRITE8_MEMBER(nes_sachen_8259a_device::write_l) void nes_sachen_8259b_device::chr_update() { - UINT8 bank_helper1 = m_reg[7] & 0x01; - UINT8 bank_helper2 = (m_reg[4] & 0x07) << 3; + uint8_t bank_helper1 = m_reg[7] & 0x01; + uint8_t bank_helper2 = (m_reg[4] & 0x07) << 3; if (m_chr_source == CHRROM) { @@ -671,8 +671,8 @@ void nes_sachen_8259b_device::chr_update() void nes_sachen_8259c_device::chr_update() { - UINT8 bank_helper1 = m_reg[7] & 0x01; - UINT8 bank_helper2 = (m_reg[4] & 0x07) << 3; + uint8_t bank_helper1 = m_reg[7] & 0x01; + uint8_t bank_helper2 = (m_reg[4] & 0x07) << 3; if (m_chr_source == CHRROM) { diff --git a/src/devices/bus/nes/sachen.h b/src/devices/bus/nes/sachen.h index 066a5e86a57..2c309a55a06 100644 --- a/src/devices/bus/nes/sachen.h +++ b/src/devices/bus/nes/sachen.h @@ -12,7 +12,7 @@ class nes_sachen_sa009_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_sa009_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_sa009_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,7 +28,7 @@ class nes_sachen_sa0036_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -44,7 +44,7 @@ class nes_sachen_sa0037_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_sa0037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_sa0037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -60,7 +60,7 @@ class nes_sachen_sa72007_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_sa72007_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_sa72007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -76,7 +76,7 @@ class nes_sachen_sa72008_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_sa72008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_sa72008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -92,7 +92,7 @@ class nes_sachen_tca01_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_tca01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_tca01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -108,7 +108,7 @@ class nes_sachen_tcu01_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_tcu01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_tcu01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -126,7 +126,7 @@ class nes_sachen_tcu02_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_tcu02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_tcu02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -136,7 +136,7 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; }; @@ -146,8 +146,8 @@ class nes_sachen_74x374_device : public nes_nrom_device { public: // construction/destruction - nes_sachen_74x374_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); - nes_sachen_74x374_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_74x374_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); + nes_sachen_74x374_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -157,8 +157,8 @@ public: virtual void pcb_reset() override; protected: - void set_mirror(UINT8 nt); - UINT8 m_latch, m_mmc_vrom_bank; + void set_mirror(uint8_t nt); + uint8_t m_latch, m_mmc_vrom_bank; }; @@ -168,7 +168,7 @@ class nes_sachen_74x374_alt_device : public nes_sachen_74x374_device { public: // construction/destruction - nes_sachen_74x374_alt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_74x374_alt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_READ8_MEMBER(read_l) override { return 0xff; } // no read_l here @@ -182,8 +182,8 @@ class nes_sachen_8259a_device : public nes_sachen_74x374_device { public: // construction/destruction - nes_sachen_8259a_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); - nes_sachen_8259a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_8259a_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); + nes_sachen_8259a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -194,7 +194,7 @@ public: protected: virtual void chr_update(); - UINT8 m_reg[8]; + uint8_t m_reg[8]; }; @@ -204,7 +204,7 @@ class nes_sachen_8259b_device : public nes_sachen_8259a_device { public: // construction/destruction - nes_sachen_8259b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_8259b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void chr_update() override; @@ -217,7 +217,7 @@ class nes_sachen_8259c_device : public nes_sachen_8259a_device { public: // construction/destruction - nes_sachen_8259c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_8259c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void chr_update() override; @@ -230,7 +230,7 @@ class nes_sachen_8259d_device : public nes_sachen_8259a_device { public: // construction/destruction - nes_sachen_8259d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sachen_8259d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void pcb_reset() override; diff --git a/src/devices/bus/nes/somari.cpp b/src/devices/bus/nes/somari.cpp index 39af6273eee..9990ae8d9db 100644 --- a/src/devices/bus/nes/somari.cpp +++ b/src/devices/bus/nes/somari.cpp @@ -39,7 +39,7 @@ const device_type NES_SOMARI = &device_creator; -nes_somari_device::nes_somari_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_somari_device::nes_somari_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_SOMARI, "NES Cart Team Somari PCB", tag, owner, clock, "nes_somari", __FILE__), m_board_mode(0), m_mmc3_mirror_reg(0), @@ -195,7 +195,7 @@ WRITE8_MEMBER(nes_somari_device::mmc1_w) // MMC3 Mode emulation WRITE8_MEMBER(nes_somari_device::mmc3_w) { - UINT8 mmc_helper, cmd; + uint8_t mmc_helper, cmd; assert(m_board_mode == 1); @@ -244,7 +244,7 @@ WRITE8_MEMBER(nes_somari_device::mmc3_w) // VRC2 Mode emulation WRITE8_MEMBER(nes_somari_device::vrc2_w) { - UINT8 bank, shift; + uint8_t bank, shift; assert(m_board_mode == 0); @@ -293,7 +293,7 @@ void nes_somari_device::update_prg() break; case SOMARI_MMC3_MODE: { - UINT8 prg_flip = (m_latch & 0x40) ? 2 : 0; + uint8_t prg_flip = (m_latch & 0x40) ? 2 : 0; prg8_x(0, m_mmc_prg_bank[0 ^ prg_flip]); prg8_x(1, m_mmc_prg_bank[1]); prg8_x(2, m_mmc_prg_bank[2 ^ prg_flip]); @@ -303,7 +303,7 @@ void nes_somari_device::update_prg() case SOMARI_MMC1_MODE: // case SOMARI_MMC1_MODE_AGAIN: { - UINT8 prg_offset = m_mmc1_reg[1] & 0x10; + uint8_t prg_offset = m_mmc1_reg[1] & 0x10; switch (m_mmc1_reg[0] & 0x0c) { @@ -335,7 +335,7 @@ void nes_somari_device::update_chr() break; case SOMARI_MMC3_MODE: { - UINT8 chr_page = (m_latch & 0x80) >> 5; + uint8_t chr_page = (m_latch & 0x80) >> 5; chr1_x(chr_page ^ 0, m_chr_base | ((m_mmc_vrom_bank[0] & ~0x01)), CHRROM); chr1_x(chr_page ^ 1, m_chr_base | ((m_mmc_vrom_bank[0] | 0x01)), CHRROM); chr1_x(chr_page ^ 2, m_chr_base | ((m_mmc_vrom_bank[1] & ~0x01)), CHRROM); diff --git a/src/devices/bus/nes/somari.h b/src/devices/bus/nes/somari.h index 340bdc1d439..6ccb8b73867 100644 --- a/src/devices/bus/nes/somari.h +++ b/src/devices/bus/nes/somari.h @@ -12,7 +12,7 @@ class nes_somari_device : public nes_txrom_device { public: // construction/destruction - nes_somari_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_somari_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -30,20 +30,20 @@ private: void update_mirror(); void bank_update_switchmode(); - UINT8 m_board_mode; + uint8_t m_board_mode; // MMC3 - inherited from txrom - UINT8 m_mmc3_mirror_reg; + uint8_t m_mmc3_mirror_reg; // MMC1 - UINT8 m_count; - UINT8 m_mmc1_latch; - UINT8 m_mmc1_reg[4]; + uint8_t m_count; + uint8_t m_mmc1_latch; + uint8_t m_mmc1_reg[4]; // VRC2 - UINT8 m_vrc_prg_bank[2]; - UINT8 m_vrc_vrom_bank[8]; - UINT8 m_vrc_mirror_reg; + uint8_t m_vrc_prg_bank[2]; + uint8_t m_vrc_vrom_bank[8]; + uint8_t m_vrc_mirror_reg; }; diff --git a/src/devices/bus/nes/sunsoft.cpp b/src/devices/bus/nes/sunsoft.cpp index 8cc1929b308..133bdcf2858 100644 --- a/src/devices/bus/nes/sunsoft.cpp +++ b/src/devices/bus/nes/sunsoft.cpp @@ -48,42 +48,42 @@ const device_type NES_SUNSOFT_FME7 = &device_creator; const device_type NES_SUNSOFT_5 = &device_creator; -nes_sunsoft_1_device::nes_sunsoft_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sunsoft_1_device::nes_sunsoft_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SUNSOFT_1, "NES Cart Sunsoft 1 PCB", tag, owner, clock, "nes_sun1", __FILE__) { } -nes_sunsoft_2_device::nes_sunsoft_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sunsoft_2_device::nes_sunsoft_2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SUNSOFT_2, "NES Cart Sunsoft 2 PCB", tag, owner, clock, "nes_sun2", __FILE__) { } -nes_sunsoft_3_device::nes_sunsoft_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sunsoft_3_device::nes_sunsoft_3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SUNSOFT_3, "NES Cart Sunsoft 3 PCB", tag, owner, clock, "nes_sun3", __FILE__), m_irq_count(0), m_irq_enable(0), m_irq_toggle(0), irq_timer(nullptr) { } -nes_sunsoft_4_device::nes_sunsoft_4_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) +nes_sunsoft_4_device::nes_sunsoft_4_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_reg(0), m_latch1(0), m_latch2(0), m_wram_enable(0) { } -nes_sunsoft_4_device::nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sunsoft_4_device::nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SUNSOFT_4, "NES Cart Sunsoft 4 PCB", tag, owner, clock, "nes_sun4", __FILE__), m_reg(0), m_latch1(0), m_latch2(0), m_wram_enable(0) { } -nes_sunsoft_fme7_device::nes_sunsoft_fme7_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) +nes_sunsoft_fme7_device::nes_sunsoft_fme7_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_wram_bank(0) { } -nes_sunsoft_fme7_device::nes_sunsoft_fme7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sunsoft_fme7_device::nes_sunsoft_fme7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_SUNSOFT_4, "NES Cart Sunsoft FME7 PCB", tag, owner, clock, "nes_fme7", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_wram_bank(0) { } -nes_sunsoft_5_device::nes_sunsoft_5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sunsoft_5_device::nes_sunsoft_5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sunsoft_fme7_device(mconfig, NES_SUNSOFT_5, "NES Cart Sunsoft 5A/5B PCB", tag, owner, clock, "nes_sun5", __FILE__), m_ym2149(*this, "ay") { @@ -236,7 +236,7 @@ WRITE8_MEMBER(nes_sunsoft_1_device::write_m) WRITE8_MEMBER(nes_sunsoft_2_device::write_h) { - UINT8 helper = (data & 0x07) | ((data & 0x80) ? 0x08 : 0x00); + uint8_t helper = (data & 0x07) | ((data & 0x80) ? 0x08 : 0x00); LOG_MMC(("Sunsoft 2 write_h, offset: %04x, data: %02x\n", offset, data)); // this pcb is subject to bus conflict @@ -534,7 +534,7 @@ WRITE8_MEMBER(nes_sunsoft_fme7_device::fme7_write) WRITE8_MEMBER(nes_sunsoft_fme7_device::write_m) { - UINT8 bank = m_wram_bank & 0x3f; + uint8_t bank = m_wram_bank & 0x3f; LOG_MMC(("Sunsoft FME7 write_m, offset: %04x, data: %02x\n", offset, data)); if (!(m_wram_bank & 0x40)) // is PRG ROM, no write @@ -550,7 +550,7 @@ WRITE8_MEMBER(nes_sunsoft_fme7_device::write_m) READ8_MEMBER(nes_sunsoft_fme7_device::read_m) { - UINT8 bank = m_wram_bank & 0x3f; + uint8_t bank = m_wram_bank & 0x3f; LOG_MMC(("Sunsoft FME7 read_m, offset: %04x\n", offset)); if (!(m_wram_bank & 0x40)) // is PRG ROM diff --git a/src/devices/bus/nes/sunsoft.h b/src/devices/bus/nes/sunsoft.h index 8e55a80ce39..9a0d7561b9c 100644 --- a/src/devices/bus/nes/sunsoft.h +++ b/src/devices/bus/nes/sunsoft.h @@ -13,7 +13,7 @@ class nes_sunsoft_1_device : public nes_nrom_device { public: // construction/destruction - nes_sunsoft_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sunsoft_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -29,7 +29,7 @@ class nes_sunsoft_2_device : public nes_nrom_device { public: // construction/destruction - nes_sunsoft_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sunsoft_2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -45,7 +45,7 @@ class nes_sunsoft_3_device : public nes_nrom_device { public: // construction/destruction - nes_sunsoft_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sunsoft_3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -55,7 +55,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable, m_irq_toggle; static const device_timer_id TIMER_IRQ = 0; @@ -69,8 +69,8 @@ class nes_sunsoft_4_device : public nes_nrom_device { public: // construction/destruction - nes_sunsoft_4_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); - nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sunsoft_4_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); + nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -92,8 +92,8 @@ class nes_sunsoft_fme7_device : public nes_nrom_device { public: // construction/destruction - nes_sunsoft_fme7_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); - nes_sunsoft_fme7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sunsoft_fme7_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); + nes_sunsoft_fme7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -106,14 +106,14 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count; + uint16_t m_irq_count; int m_irq_enable; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; - UINT8 m_latch; - UINT8 m_wram_bank; + uint8_t m_latch; + uint8_t m_wram_bank; }; @@ -123,7 +123,7 @@ class nes_sunsoft_5_device : public nes_sunsoft_fme7_device { public: // construction/destruction - nes_sunsoft_5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sunsoft_5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/nes/sunsoft_dcs.cpp b/src/devices/bus/nes/sunsoft_dcs.cpp index 40c9c69bff0..5e3fc043259 100644 --- a/src/devices/bus/nes/sunsoft_dcs.cpp +++ b/src/devices/bus/nes/sunsoft_dcs.cpp @@ -50,7 +50,7 @@ ntb_cart_interface::~ntb_cart_interface() const device_type NES_NTB_SLOT = &device_creator; -nes_ntb_slot_device::nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_ntb_slot_device::nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_NTB_SLOT, "NES NTB Cartridge Slot", tag, owner, clock, "nes_ntb_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_cart(nullptr) @@ -80,7 +80,7 @@ image_init_result nes_ntb_slot_device::call_load() { if (m_cart) { - UINT8 *ROM = m_cart->get_cart_base(); + uint8_t *ROM = m_cart->get_cart_base(); if (!ROM) return image_init_result::FAIL; @@ -122,7 +122,7 @@ ROM_END const device_type NES_NTB_ROM = &device_creator; -nes_ntb_rom_device::nes_ntb_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ntb_rom_device::nes_ntb_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_NTB_ROM, "NES NTB ROM", tag, owner, clock, "nes_ntbrom", __FILE__), ntb_cart_interface( mconfig, *this ) { @@ -130,7 +130,7 @@ nes_ntb_rom_device::nes_ntb_rom_device(const machine_config &mconfig, const char void nes_ntb_rom_device::device_start() { - m_rom = (UINT8*)memregion("ntbrom")->base(); + m_rom = (uint8_t*)memregion("ntbrom")->base(); } const tiny_rom_entry *nes_ntb_rom_device::device_rom_region() const @@ -138,7 +138,7 @@ const tiny_rom_entry *nes_ntb_rom_device::device_rom_region() const return ROM_NAME( ntb_rom ); } -UINT8 *nes_ntb_rom_device::get_cart_base() +uint8_t *nes_ntb_rom_device::get_cart_base() { return m_rom; } @@ -156,7 +156,7 @@ UINT8 *nes_ntb_rom_device::get_cart_base() const device_type NES_SUNSOFT_DCS = &device_creator; -nes_sunsoft_dcs_device::nes_sunsoft_dcs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_sunsoft_dcs_device::nes_sunsoft_dcs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_sunsoft_4_device(mconfig, NES_SUNSOFT_DCS, "NES Cart Sunsoft DCS PCB", tag, owner, clock, "nes_dcs", __FILE__), m_timer_on(0), m_exrom_enable(0), m_subslot(*this, "ntb_slot"), ntb_enable_timer(nullptr) { diff --git a/src/devices/bus/nes/sunsoft_dcs.h b/src/devices/bus/nes/sunsoft_dcs.h index 2428632824a..5aa8590c3ae 100644 --- a/src/devices/bus/nes/sunsoft_dcs.h +++ b/src/devices/bus/nes/sunsoft_dcs.h @@ -25,11 +25,11 @@ public: // reading and writing virtual DECLARE_READ8_MEMBER(read) { return m_rom[offset]; } - UINT8 *get_cart_base() { return m_rom; } + uint8_t *get_cart_base() { return m_rom; } protected: // internal state - UINT8 *m_rom; + uint8_t *m_rom; }; // ======================> nes_ntb_slot_device @@ -40,7 +40,7 @@ class nes_ntb_slot_device : public device_t, { public: // construction/destruction - nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~nes_ntb_slot_device(); // device-level overrides @@ -90,11 +90,11 @@ class nes_ntb_rom_device : public device_t, { public: // construction/destruction - nes_ntb_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ntb_rom_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; - virtual UINT8* get_cart_base(); + virtual uint8_t* get_cart_base(); protected: // device-level overrides @@ -120,7 +120,7 @@ class nes_sunsoft_dcs_device : public nes_sunsoft_4_device { public: // construction/destruction - nes_sunsoft_dcs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_sunsoft_dcs_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/devices/bus/nes/taito.cpp b/src/devices/bus/nes/taito.cpp index 6d3a4e68941..38f156080ae 100644 --- a/src/devices/bus/nes/taito.cpp +++ b/src/devices/bus/nes/taito.cpp @@ -47,27 +47,27 @@ const device_type NES_X1_005 = &device_creator; const device_type NES_X1_017 = &device_creator; -nes_tc0190fmc_device::nes_tc0190fmc_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) +nes_tc0190fmc_device::nes_tc0190fmc_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -nes_tc0190fmc_device::nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tc0190fmc_device::nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TC0190FMC, "NES Cart Taito TC0190FMC PCB", tag, owner, clock, "nes_tc0190fmc", __FILE__) { } -nes_tc0190fmc_pal16r4_device::nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tc0190fmc_pal16r4_device::nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_tc0190fmc_device(mconfig, NES_TC0190FMC_PAL16R4, "NES Cart Taito TC0190FMC + PAL16R4 PCB", tag, owner, clock, "nes_tc0190pal", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0) { } -nes_x1_005_device::nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_x1_005_device::nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_X1_005, "NES Cart Taito X1-005 PCB", tag, owner, clock, "nes_x1_005", __FILE__), m_latch(0) { } -nes_x1_017_device::nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_x1_017_device::nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_X1_017, "NES Cart Taito X1-017 PCB", tag, owner, clock, "nes_x1_017", __FILE__), m_latch(0) { } diff --git a/src/devices/bus/nes/taito.h b/src/devices/bus/nes/taito.h index 38fa05d960c..8d33ecd4c5e 100644 --- a/src/devices/bus/nes/taito.h +++ b/src/devices/bus/nes/taito.h @@ -12,8 +12,8 @@ class nes_tc0190fmc_device : public nes_nrom_device { public: // construction/destruction - nes_tc0190fmc_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); - nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tc0190fmc_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); + nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -30,7 +30,7 @@ class nes_tc0190fmc_pal16r4_device : public nes_tc0190fmc_device { public: // construction/destruction - nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -40,7 +40,7 @@ public: virtual void pcb_reset() override; private: - UINT16 m_irq_count, m_irq_count_latch; + uint16_t m_irq_count, m_irq_count_latch; int m_irq_enable; }; @@ -51,7 +51,7 @@ class nes_x1_005_device : public nes_nrom_device { public: // construction/destruction - nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -61,9 +61,9 @@ public: virtual void pcb_reset() override; private: - UINT8 m_latch; + uint8_t m_latch; // Taito X1-005 chip contains 80 bytes of internal ram, possibly battery backed up - UINT8 m_x1_005_ram[0x80]; + uint8_t m_x1_005_ram[0x80]; }; @@ -73,7 +73,7 @@ class nes_x1_017_device : public nes_nrom_device { public: // construction/destruction - nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -84,11 +84,11 @@ public: private: void set_chr(); - UINT8 m_latch; - UINT8 m_reg[3]; //mapper ram protect - UINT8 m_mmc_vrom_bank[6]; + uint8_t m_latch; + uint8_t m_reg[3]; //mapper ram protect + uint8_t m_mmc_vrom_bank[6]; // Taito X1-017 chip contains 5K of internal ram, battery backed up - UINT8 m_x1_017_ram[0x1400]; + uint8_t m_x1_017_ram[0x1400]; }; diff --git a/src/devices/bus/nes/tengen.cpp b/src/devices/bus/nes/tengen.cpp index 828519a0e71..af37dc223e0 100644 --- a/src/devices/bus/nes/tengen.cpp +++ b/src/devices/bus/nes/tengen.cpp @@ -43,22 +43,22 @@ const device_type NES_TENGEN_800032 = &device_creator; const device_type NES_TENGEN_800037 = &device_creator; -nes_tengen008_device::nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tengen008_device::nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TENGEN_800008, "NES Cart Tengen 800008 PCB", tag, owner, clock, "nes_tengen008", __FILE__) { } -nes_tengen032_device::nes_tengen032_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) +nes_tengen032_device::nes_tengen032_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_reset(0), m_irq_enable(0), m_latch(0), irq_timer(nullptr) { } -nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TENGEN_800032, "NES Cart Tengen 800032 PCB", tag, owner, clock, "nes_tengen032", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_reset(0), m_irq_enable(0), m_latch(0), irq_timer(nullptr) { } -nes_tengen037_device::nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_tengen037_device::nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_tengen032_device(mconfig, NES_TENGEN_800037, "NES Cart Tengen 800037 PCB", tag, owner, clock, "nes_tengen037", __FILE__) { } @@ -204,7 +204,7 @@ void nes_tengen032_device::hblank_irq(int scanline, int vblank, int blanked) void nes_tengen032_device::set_prg() { - UINT8 prg_mode = m_latch & 0x40; + uint8_t prg_mode = m_latch & 0x40; prg8_89(m_mmc_prg_bank[prg_mode ? 2: 0]); prg8_ab(m_mmc_prg_bank[prg_mode ? 0: 1]); @@ -218,7 +218,7 @@ void nes_tengen032_device::chr_cb(int start, int bank, int source) void nes_tengen032_device::set_chr() { - UINT8 chr_page = (m_latch & 0x80) >> 5; + uint8_t chr_page = (m_latch & 0x80) >> 5; if (m_latch & 0x20) { @@ -243,7 +243,7 @@ void nes_tengen032_device::set_chr() WRITE8_MEMBER(nes_tengen032_device::tengen032_write) { - UINT8 helper, cmd; + uint8_t helper, cmd; LOG_MMC(("tengen032_write, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) diff --git a/src/devices/bus/nes/tengen.h b/src/devices/bus/nes/tengen.h index d812443b613..3fb9cba0c88 100644 --- a/src/devices/bus/nes/tengen.h +++ b/src/devices/bus/nes/tengen.h @@ -12,7 +12,7 @@ class nes_tengen008_device : public nes_nrom_device { public: // construction/destruction - nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,8 +28,8 @@ class nes_tengen032_device : public nes_nrom_device { public: // construction/destruction - nes_tengen032_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); - nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tengen032_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); + nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -46,13 +46,13 @@ protected: void set_chr(); void irq_clock(int blanked); - UINT16 m_irq_count, m_irq_count_latch; - UINT8 m_irq_mode, m_irq_reset; + uint16_t m_irq_count, m_irq_count_latch; + uint8_t m_irq_mode, m_irq_reset; int m_irq_enable; - UINT8 m_latch; - UINT8 m_mmc_prg_bank[3]; - UINT8 m_mmc_vrom_bank[8]; + uint8_t m_latch; + uint8_t m_mmc_prg_bank[3]; + uint8_t m_mmc_vrom_bank[8]; static const device_timer_id TIMER_IRQ = 0; emu_timer *irq_timer; @@ -66,7 +66,7 @@ class nes_tengen037_device : public nes_tengen032_device { public: // construction/destruction - nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; diff --git a/src/devices/bus/nes/txc.cpp b/src/devices/bus/nes/txc.cpp index 8392ed61a68..daa01bca558 100644 --- a/src/devices/bus/nes/txc.cpp +++ b/src/devices/bus/nes/txc.cpp @@ -44,32 +44,32 @@ const device_type NES_TXC_STRIKEW = &device_creator; const device_type NES_TXC_COMMANDOS = &device_creator; -nes_txc_22211_device::nes_txc_22211_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) +nes_txc_22211_device::nes_txc_22211_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) : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -nes_txc_22211_device::nes_txc_22211_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_txc_22211_device::nes_txc_22211_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TXC_22211, "NES Cart TXC 22211 PCB", tag, owner, clock, "nes_txc_22211", __FILE__) { } -nes_txc_dumarc_device::nes_txc_dumarc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_txc_dumarc_device::nes_txc_dumarc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txc_22211_device(mconfig, NES_TXC_DUMARACING, "NES Cart TXC Du Ma Racing PCB", tag, owner, clock, "nes_dumarc", __FILE__) { } -nes_txc_mjblock_device::nes_txc_mjblock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_txc_mjblock_device::nes_txc_mjblock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txc_22211_device(mconfig, NES_TXC_MJBLOCK, "NES Cart TXC Mahjong Block PCB", tag, owner, clock, "nes_mjblock", __FILE__) { } -nes_txc_strikew_device::nes_txc_strikew_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_txc_strikew_device::nes_txc_strikew_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TXC_STRIKEW, "NES Cart Strike Wolf PCB", tag, owner, clock, "nes_txc_strikew", __FILE__) { } -nes_txc_commandos_device::nes_txc_commandos_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_txc_commandos_device::nes_txc_commandos_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_TXC_COMMANDOS, "NES Cart Commandos (and others) PCB", tag, owner, clock, "nes_txc_comm", __FILE__) { } diff --git a/src/devices/bus/nes/txc.h b/src/devices/bus/nes/txc.h index cd190c51f37..b8c11dddd20 100644 --- a/src/devices/bus/nes/txc.h +++ b/src/devices/bus/nes/txc.h @@ -12,8 +12,8 @@ class nes_txc_22211_device : public nes_nrom_device { public: // construction/destruction - nes_txc_22211_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); - nes_txc_22211_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_txc_22211_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); + nes_txc_22211_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -24,7 +24,7 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; @@ -34,7 +34,7 @@ class nes_txc_dumarc_device : public nes_txc_22211_device { public: // construction/destruction - nes_txc_dumarc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_txc_dumarc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -47,7 +47,7 @@ class nes_txc_mjblock_device : public nes_txc_22211_device { public: // construction/destruction - nes_txc_mjblock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_txc_mjblock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_READ8_MEMBER(read_l) override; @@ -60,7 +60,7 @@ class nes_txc_strikew_device : public nes_nrom_device { public: // construction/destruction - nes_txc_strikew_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_txc_strikew_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -76,7 +76,7 @@ class nes_txc_commandos_device : public nes_nrom_device { public: // construction/destruction - nes_txc_commandos_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_txc_commandos_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/devices/bus/nes/waixing.cpp b/src/devices/bus/nes/waixing.cpp index f4dbd58d718..509797a22ab 100644 --- a/src/devices/bus/nes/waixing.cpp +++ b/src/devices/bus/nes/waixing.cpp @@ -56,117 +56,117 @@ const device_type NES_WAIXING_WXZS2 = &device_creator; const device_type NES_WAIXING_FS304 = &device_creator; -nes_waixing_a_device::nes_waixing_a_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) +nes_waixing_a_device::nes_waixing_a_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) : nes_txrom_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -nes_waixing_a_device::nes_waixing_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_a_device::nes_waixing_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_WAIXING_A, "NES Cart Waixing Type A PCB", tag, owner, clock, "nes_waixing_a", __FILE__) { } -nes_waixing_a1_device::nes_waixing_a1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_a1_device::nes_waixing_a1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_a_device(mconfig, NES_WAIXING_A1, "NES Cart Waixing Type A (Alt) PCB", tag, owner, clock, "nes_waixing_a1", __FILE__) { } -nes_waixing_b_device::nes_waixing_b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_b_device::nes_waixing_b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_a_device(mconfig, NES_WAIXING_B, "NES Cart Waixing Type B PCB", tag, owner, clock, "nes_waixing_b", __FILE__) { } -nes_waixing_c_device::nes_waixing_c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_c_device::nes_waixing_c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_a_device(mconfig, NES_WAIXING_C, "NES Cart Waixing Type C PCB", tag, owner, clock, "nes_waixing_c", __FILE__) { } -nes_waixing_d_device::nes_waixing_d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_d_device::nes_waixing_d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_a_device(mconfig, NES_WAIXING_D, "NES Cart Waixing Type D PCB", tag, owner, clock, "nes_waixing_d", __FILE__) { } -nes_waixing_e_device::nes_waixing_e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_e_device::nes_waixing_e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_a_device(mconfig, NES_WAIXING_E, "NES Cart Waixing Type E PCB", tag, owner, clock, "nes_waixing_e", __FILE__) { } -nes_waixing_f_device::nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_f_device::nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_a_device(mconfig, NES_WAIXING_F, "NES Cart Waixing Type F PCB", tag, owner, clock, "nes_waixing_f", __FILE__) { } -nes_waixing_g_device::nes_waixing_g_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_g_device::nes_waixing_g_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_a_device(mconfig, NES_WAIXING_G, "NES Cart Waixing Type G PCB", tag, owner, clock, "nes_waixing_g", __FILE__) { } -nes_waixing_h_device::nes_waixing_h_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) +nes_waixing_h_device::nes_waixing_h_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) : nes_txrom_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -nes_waixing_h_device::nes_waixing_h_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_h_device::nes_waixing_h_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_WAIXING_H, "NES Cart Waixing Type H PCB", tag, owner, clock, "nes_waixing_h", __FILE__) { } -nes_waixing_h1_device::nes_waixing_h1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_h1_device::nes_waixing_h1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_h_device(mconfig, NES_WAIXING_H1, "NES Cart Waixing Type H (Alt) PCB", tag, owner, clock, "nes_waixing_h1", __FILE__) { } -nes_waixing_i_device::nes_waixing_i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_i_device::nes_waixing_i_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_a_device(mconfig, NES_WAIXING_I, "NES Cart Waixing Type I PCB", tag, owner, clock, "nes_waixing_i", __FILE__) { } -nes_waixing_j_device::nes_waixing_j_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_j_device::nes_waixing_j_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_waixing_a_device(mconfig, NES_WAIXING_J, "NES Cart Waixing Type J PCB", tag, owner, clock, "nes_waixing_j", __FILE__) { } -nes_waixing_sh2_device::nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_sh2_device::nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_WAIXING_SH2, "NES Cart Waixing SH2 PCB", tag, owner, clock, "nes_waixing_sh2", __FILE__) { } -nes_waixing_sec_device::nes_waixing_sec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_sec_device::nes_waixing_sec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_txrom_device(mconfig, NES_WAIXING_SEC, "NES Cart Waixing Security Chip PCB", tag, owner, clock, "nes_waixing_sec", __FILE__), m_reg(0) { } -nes_waixing_sgz_device::nes_waixing_sgz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_sgz_device::nes_waixing_sgz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_WAIXING_SGZ, "NES Cart Waixing San Guo Zhi PCB", tag, owner, clock, "nes_waixing_sgz", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0) { } -nes_waixing_sgzlz_device::nes_waixing_sgzlz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_sgzlz_device::nes_waixing_sgzlz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_WAIXING_SGZLZ, "NES Cart Waixing San Guo Zhong Lie Zhuan PCB", tag, owner, clock, "nes_waixing_sgzlz", __FILE__), m_latch(0) { } -nes_waixing_ffv_device::nes_waixing_ffv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_ffv_device::nes_waixing_ffv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_WAIXING_FFV, "NES Cart Waixing Final Fantasy V PCB", tag, owner, clock, "nes_waixing_ffv", __FILE__) { } -nes_waixing_wxzs_device::nes_waixing_wxzs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_wxzs_device::nes_waixing_wxzs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_WAIXING_WXZS, "NES Cart Waixing Wai Xing Zhan Shi PCB", tag, owner, clock, "nes_waixing_wxzs", __FILE__) { } -nes_waixing_dq8_device::nes_waixing_dq8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_dq8_device::nes_waixing_dq8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_WAIXING_DQ8, "NES Cart Waixing Dragon Quest VIII PCB", tag, owner, clock, "nes_waixing_dq8", __FILE__) { } -nes_waixing_wxzs2_device::nes_waixing_wxzs2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_wxzs2_device::nes_waixing_wxzs2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_WAIXING_WXZS2, "NES Cart Waixing Wai Xing Zhan Shi 2 PCB", tag, owner, clock, "nes_waixing_wxzs2", __FILE__) { } -nes_waixing_fs304_device::nes_waixing_fs304_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_waixing_fs304_device::nes_waixing_fs304_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_nrom_device(mconfig, NES_WAIXING_FS304, "NES Cart Waixing FS-304 PCB", tag, owner, clock, "nes_waixing_fs304", __FILE__) { } @@ -401,7 +401,7 @@ void nes_waixing_fs304_device::pcb_reset() -------------------------------------------------*/ /* MIRROR_LOW and MIRROR_HIGH are swapped! */ -void nes_waixing_a_device::set_mirror(UINT8 nt) +void nes_waixing_a_device::set_mirror(uint8_t nt) { switch (nt) { @@ -591,7 +591,7 @@ void nes_waixing_f_device::prg_cb(int start, int bank) void nes_waixing_f_device::set_prg( int prg_base, int prg_mask ) { - UINT8 prg_flip = (m_latch & 0x40) ? 2 : 0; + uint8_t prg_flip = (m_latch & 0x40) ? 2 : 0; prg_cb(0, m_mmc_prg_bank[0 ^ prg_flip]); prg_cb(1, m_mmc_prg_bank[1]); @@ -601,7 +601,7 @@ void nes_waixing_f_device::set_prg( int prg_base, int prg_mask ) WRITE8_MEMBER(nes_waixing_f_device::write_h) { - UINT8 cmd; + uint8_t cmd; LOG_MMC(("waixing_f write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) @@ -656,9 +656,9 @@ void nes_waixing_g_device::chr_cb(int start, int bank, int source) chr1_x(start, bank, chr_src); } -void nes_waixing_g_device::set_chr(UINT8 chr, int chr_base, int chr_mask) +void nes_waixing_g_device::set_chr(uint8_t chr, int chr_base, int chr_mask) { - UINT8 chr_page = (m_latch & 0x80) >> 5; + uint8_t chr_page = (m_latch & 0x80) >> 5; chr_cb(chr_page ^ 0, chr_base | (m_mmc_vrom_bank[0] & chr_mask), chr); chr_cb(chr_page ^ 1, chr_base | (m_mmc_vrom_bank[6] & chr_mask), chr); @@ -672,7 +672,7 @@ void nes_waixing_g_device::set_chr(UINT8 chr, int chr_base, int chr_mask) WRITE8_MEMBER(nes_waixing_g_device::write_h) { - UINT8 cmd; + uint8_t cmd; LOG_MMC(("waixing_g write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) @@ -735,7 +735,7 @@ void nes_waixing_h_device::chr_cb(int start, int bank, int source) WRITE8_MEMBER(nes_waixing_h_device::write_h) { - UINT8 cmd; + uint8_t cmd; LOG_MMC(("waixing_h write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) @@ -776,7 +776,7 @@ WRITE8_MEMBER(nes_waixing_h_device::write_h) WRITE8_MEMBER(nes_waixing_h1_device::write_h) { - UINT8 cmd; + uint8_t cmd; LOG_MMC(("waixing_h1 write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) @@ -826,7 +826,7 @@ WRITE8_MEMBER(nes_waixing_h1_device::write_h) void nes_waixing_j_device::set_prg( int prg_base, int prg_mask ) { - UINT8 prg_flip = (m_latch & 0x40) ? 2 : 0; + uint8_t prg_flip = (m_latch & 0x40) ? 2 : 0; prg_cb(0, m_reg[0 ^ prg_flip]); prg_cb(1, m_reg[1]); @@ -836,7 +836,7 @@ void nes_waixing_j_device::set_prg( int prg_base, int prg_mask ) WRITE8_MEMBER(nes_waixing_j_device::write_h) { - UINT8 cmd; + uint8_t cmd; LOG_MMC(("waixing_f write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x6001) @@ -892,7 +892,7 @@ void nes_waixing_sh2_device::chr_cb(int start, int bank, int source) READ8_MEMBER(nes_waixing_sh2_device::chr_r) { int bank = offset >> 10; - UINT8 val = m_chr_access[bank][offset & 0x3ff]; // this would be usual return value + uint8_t val = m_chr_access[bank][offset & 0x3ff]; // this would be usual return value int chr_helper; switch (offset & 0xff8) @@ -983,7 +983,7 @@ void nes_waixing_sgz_device::hblank_irq(int scanline, int vblank, int blanked) WRITE8_MEMBER(nes_waixing_sgz_device::write_h) { - UINT8 helper, bank; + uint8_t helper, bank; LOG_MMC(("waixing_sgz write_h, offset: %04x, data: %02x\n", offset, data)); switch (offset & 0x7000) @@ -1077,7 +1077,7 @@ WRITE8_MEMBER(nes_waixing_sgzlz_device::write_l) WRITE8_MEMBER(nes_waixing_ffv_device::write_l) { - UINT8 helper; + uint8_t helper; LOG_MMC(("waixing_ffv write_l, offset: %04x, data: %02x\n", offset, data)); offset += 0x100; /* the checks work better on addresses */ @@ -1177,8 +1177,8 @@ WRITE8_MEMBER(nes_waixing_dq8_device::write_h) WRITE8_MEMBER(nes_waixing_wxzs2_device::write_h) { - UINT8 flip = (data & 0x80) >> 7; - UINT8 helper = (data & 0x7f) << 1; + uint8_t flip = (data & 0x80) >> 7; + uint8_t helper = (data & 0x7f) << 1; LOG_MMC(("waixing_wxzs2 write_h, offset: %04x, data: %02x\n", offset, data)); diff --git a/src/devices/bus/nes/waixing.h b/src/devices/bus/nes/waixing.h index 132b3673cee..98d03b725b7 100644 --- a/src/devices/bus/nes/waixing.h +++ b/src/devices/bus/nes/waixing.h @@ -12,8 +12,8 @@ class nes_waixing_a_device : public nes_txrom_device { public: // construction/destruction - nes_waixing_a_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); - nes_waixing_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_a_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); + nes_waixing_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -26,8 +26,8 @@ public: virtual void pcb_reset() override; protected: - void set_mirror(UINT8 nt); - UINT8 mapper_ram[0x400]; + void set_mirror(uint8_t nt); + uint8_t mapper_ram[0x400]; }; @@ -37,7 +37,7 @@ class nes_waixing_a1_device : public nes_waixing_a_device { public: // construction/destruction - nes_waixing_a1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_a1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void chr_cb(int start, int bank, int source) override; }; @@ -49,7 +49,7 @@ class nes_waixing_b_device : public nes_waixing_a_device { public: // construction/destruction - nes_waixing_b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void chr_cb(int start, int bank, int source) override; @@ -62,7 +62,7 @@ class nes_waixing_c_device : public nes_waixing_a_device { public: // construction/destruction - nes_waixing_c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void chr_cb(int start, int bank, int source) override; @@ -75,7 +75,7 @@ class nes_waixing_d_device : public nes_waixing_a_device { public: // construction/destruction - nes_waixing_d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void chr_cb(int start, int bank, int source) override; @@ -88,7 +88,7 @@ class nes_waixing_e_device : public nes_waixing_a_device { public: // construction/destruction - nes_waixing_e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void chr_cb(int start, int bank, int source) override; @@ -101,7 +101,7 @@ class nes_waixing_f_device : public nes_waixing_a_device { public: // construction/destruction - nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -120,7 +120,7 @@ class nes_waixing_g_device : public nes_waixing_a_device { public: // construction/destruction - nes_waixing_g_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_g_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -129,7 +129,7 @@ public: virtual void pcb_reset() override; protected: - virtual void set_chr(UINT8 chr, int chr_base, int chr_mask) override; + virtual void set_chr(uint8_t chr, int chr_base, int chr_mask) override; }; @@ -139,8 +139,8 @@ class nes_waixing_h_device : public nes_txrom_device { public: // construction/destruction - nes_waixing_h_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); - nes_waixing_h_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_h_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); + nes_waixing_h_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -156,7 +156,7 @@ class nes_waixing_h1_device : public nes_waixing_h_device { public: // construction/destruction - nes_waixing_h1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_h1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual DECLARE_WRITE8_MEMBER(write_h) override; @@ -171,7 +171,7 @@ class nes_waixing_i_device : public nes_waixing_a_device { public: // construction/destruction - nes_waixing_i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_i_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // still to emulate this variant }; @@ -183,7 +183,7 @@ class nes_waixing_j_device : public nes_waixing_a_device { public: // construction/destruction - nes_waixing_j_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_j_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -193,7 +193,7 @@ public: protected: virtual void set_prg(int prg_base, int prg_mask) override; - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; @@ -203,7 +203,7 @@ class nes_waixing_sh2_device : public nes_txrom_device { public: // construction/destruction - nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -213,7 +213,7 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_reg[2]; + uint8_t m_reg[2]; }; @@ -223,7 +223,7 @@ class nes_waixing_sec_device : public nes_txrom_device { public: // construction/destruction - nes_waixing_sec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_sec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -234,7 +234,7 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_reg; + uint8_t m_reg; }; @@ -244,7 +244,7 @@ class nes_waixing_sgz_device : public nes_nrom_device { public: // construction/destruction - nes_waixing_sgz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_sgz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -254,10 +254,10 @@ public: virtual void pcb_reset() override; protected: - UINT16 m_irq_count, m_irq_count_latch; + uint16_t m_irq_count, m_irq_count_latch; int m_irq_enable, m_irq_enable_latch; - UINT8 m_mmc_vrom_bank[8]; + uint8_t m_mmc_vrom_bank[8]; }; @@ -267,7 +267,7 @@ class nes_waixing_sgzlz_device : public nes_nrom_device { public: // construction/destruction - nes_waixing_sgzlz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_sgzlz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -276,7 +276,7 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_latch; + uint8_t m_latch; }; @@ -286,7 +286,7 @@ class nes_waixing_ffv_device : public nes_nrom_device { public: // construction/destruction - nes_waixing_ffv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_ffv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -295,7 +295,7 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_reg[2]; + uint8_t m_reg[2]; }; @@ -305,7 +305,7 @@ class nes_waixing_wxzs_device : public nes_nrom_device { public: // construction/destruction - nes_waixing_wxzs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_wxzs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -321,7 +321,7 @@ class nes_waixing_dq8_device : public nes_nrom_device { public: // construction/destruction - nes_waixing_dq8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_dq8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -337,7 +337,7 @@ class nes_waixing_wxzs2_device : public nes_nrom_device { public: // construction/destruction - nes_waixing_wxzs2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_wxzs2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -353,7 +353,7 @@ class nes_waixing_fs304_device : public nes_nrom_device { public: // construction/destruction - nes_waixing_fs304_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_waixing_fs304_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -362,7 +362,7 @@ public: virtual void pcb_reset() override; protected: - UINT8 m_reg[4]; + uint8_t m_reg[4]; }; diff --git a/src/devices/bus/nes_ctrl/4score.cpp b/src/devices/bus/nes_ctrl/4score.cpp index e5adb5feb97..f1d602090b6 100644 --- a/src/devices/bus/nes_ctrl/4score.cpp +++ b/src/devices/bus/nes_ctrl/4score.cpp @@ -110,20 +110,20 @@ ioport_constructor nes_4score_p2p4_device::device_input_ports() const // nes_4score_device - constructor //------------------------------------------------- -nes_4score_device::nes_4score_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) +nes_4score_device::nes_4score_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_nes_control_port_interface(mconfig, *this), m_latch(0) { } -nes_4score_p1p3_device::nes_4score_p1p3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_4score_p1p3_device::nes_4score_p1p3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_4score_device(mconfig, NES_4SCORE_P1P3, "Nintendo Four Score Adapter P1/P3", tag, owner, clock, "nes_4score_p1p3", __FILE__), m_joypad1(*this, "PAD1"), m_joypad3(*this, "PAD3") { } -nes_4score_p2p4_device::nes_4score_p2p4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_4score_p2p4_device::nes_4score_p2p4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_4score_device(mconfig, NES_4SCORE_P2P4, "Nintendo Four Score Adapter P2/P4", tag, owner, clock, "nes_4score_p2p4", __FILE__), m_joypad2(*this, "PAD2"), m_joypad4(*this, "PAD4") @@ -155,9 +155,9 @@ void nes_4score_device::device_reset() // read //------------------------------------------------- -UINT8 nes_4score_device::read_bit0() +uint8_t nes_4score_device::read_bit0() { - UINT8 ret = m_latch & 1; + uint8_t ret = m_latch & 1; m_latch >>= 1; return ret; } @@ -166,7 +166,7 @@ UINT8 nes_4score_device::read_bit0() // write //------------------------------------------------- -void nes_4score_p1p3_device::write(UINT8 data) +void nes_4score_p1p3_device::write(uint8_t data) { if (data & 0x01) return; @@ -177,7 +177,7 @@ void nes_4score_p1p3_device::write(UINT8 data) m_latch |= (0x08 << 16); // signature } -void nes_4score_p2p4_device::write(UINT8 data) +void nes_4score_p2p4_device::write(uint8_t data) { if (data & 0x01) return; diff --git a/src/devices/bus/nes_ctrl/4score.h b/src/devices/bus/nes_ctrl/4score.h index c05cb403b39..543e9b85414 100644 --- a/src/devices/bus/nes_ctrl/4score.h +++ b/src/devices/bus/nes_ctrl/4score.h @@ -26,17 +26,17 @@ class nes_4score_device : public device_t, { public: // construction/destruction - nes_4score_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); + nes_4score_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: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_bit0() override; + virtual uint8_t read_bit0() override; protected: - UINT32 m_latch; + uint32_t m_latch; }; // ======================> nes_4score_p1p3_device @@ -45,12 +45,12 @@ class nes_4score_p1p3_device : public nes_4score_device { public: // construction/destruction - nes_4score_p1p3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_4score_p1p3_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 write(UINT8 data) override; + virtual void write(uint8_t data) override; private: required_ioport m_joypad1; @@ -63,12 +63,12 @@ class nes_4score_p2p4_device : public nes_4score_device { public: // construction/destruction - nes_4score_p2p4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_4score_p2p4_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 write(UINT8 data) override; + virtual void write(uint8_t data) override; private: required_ioport m_joypad2; diff --git a/src/devices/bus/nes_ctrl/arkpaddle.cpp b/src/devices/bus/nes_ctrl/arkpaddle.cpp index 15755d283ca..7f47510d551 100644 --- a/src/devices/bus/nes_ctrl/arkpaddle.cpp +++ b/src/devices/bus/nes_ctrl/arkpaddle.cpp @@ -44,7 +44,7 @@ ioport_constructor nes_vaus_device::device_input_ports() const // nes_vaus_device - constructor //------------------------------------------------- -nes_vaus_device::nes_vaus_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) +nes_vaus_device::nes_vaus_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_nes_control_port_interface(mconfig, *this), m_paddle(*this, "PADDLE"), @@ -52,7 +52,7 @@ nes_vaus_device::nes_vaus_device(const machine_config &mconfig, device_type type { } -nes_vaus_device::nes_vaus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_vaus_device::nes_vaus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_ARKPADDLE, "NES Arkanoid Vaus Controller", tag, owner, clock, "nes_vaus", __FILE__), device_nes_control_port_interface(mconfig, *this), m_paddle(*this, "PADDLE"), @@ -60,7 +60,7 @@ nes_vaus_device::nes_vaus_device(const machine_config &mconfig, const char *tag, { } -nes_vausfc_device::nes_vausfc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_vausfc_device::nes_vausfc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_vaus_device(mconfig, NES_ARKPADDLE_FC, "FC Arkanoid Vaus Controller", tag, owner, clock, "nes_vausfc", __FILE__) { } @@ -92,18 +92,18 @@ void nes_vaus_device::device_reset() // read //------------------------------------------------- -UINT8 nes_vaus_device::read_bit34() +uint8_t nes_vaus_device::read_bit34() { - UINT8 ret = (m_button->read() << 3); + uint8_t ret = (m_button->read() << 3); ret |= (m_latch & 0x80) >> 3; m_latch <<= 1; m_latch &= 0xff; return ret; } -UINT8 nes_vausfc_device::read_exp(offs_t offset) +uint8_t nes_vausfc_device::read_exp(offs_t offset) { - UINT8 ret; + uint8_t ret; if (offset == 0) //$4016 ret = m_button->read() << 1; else //$4017 @@ -119,12 +119,12 @@ UINT8 nes_vausfc_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_vaus_device::write(UINT8 data) +void nes_vaus_device::write(uint8_t data) { int old = m_start_conv; if (data == 0 && old == 1) - m_latch = (UINT8) (m_paddle->read() ^ 0xff); + m_latch = (uint8_t) (m_paddle->read() ^ 0xff); m_start_conv = data; } diff --git a/src/devices/bus/nes_ctrl/arkpaddle.h b/src/devices/bus/nes_ctrl/arkpaddle.h index d693bb7c0b7..13bd03f7e02 100644 --- a/src/devices/bus/nes_ctrl/arkpaddle.h +++ b/src/devices/bus/nes_ctrl/arkpaddle.h @@ -27,8 +27,8 @@ class nes_vaus_device : public device_t, { public: // construction/destruction - nes_vaus_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); - nes_vaus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_vaus_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); + nes_vaus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -38,13 +38,13 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_bit34() override; - virtual void write(UINT8 data) override; + virtual uint8_t read_bit34() override; + virtual void write(uint8_t data) override; required_ioport m_paddle; required_ioport m_button; - UINT8 m_start_conv; - UINT32 m_latch; + uint8_t m_start_conv; + uint32_t m_latch; }; @@ -54,11 +54,11 @@ class nes_vausfc_device : public nes_vaus_device { public: // construction/destruction - nes_vausfc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_vausfc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual UINT8 read_bit34() override { return 0; } - virtual UINT8 read_exp(offs_t offset) override; + virtual uint8_t read_bit34() override { return 0; } + virtual uint8_t read_exp(offs_t offset) override; }; diff --git a/src/devices/bus/nes_ctrl/bcbattle.cpp b/src/devices/bus/nes_ctrl/bcbattle.cpp index 336a14e92c8..04491e262c0 100644 --- a/src/devices/bus/nes_ctrl/bcbattle.cpp +++ b/src/devices/bus/nes_ctrl/bcbattle.cpp @@ -81,7 +81,7 @@ void nes_bcbattle_device::device_timer(emu_timer &timer, device_timer_id id, int // nes_bcbattle_device - constructor //------------------------------------------------- -nes_bcbattle_device::nes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_bcbattle_device::nes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_BARCODE_BATTLER, "Epoch Barcode Battler (FC)", tag, owner, clock, "nes_bcbattle", __FILE__), device_nes_control_port_interface(mconfig, *this), m_reader(*this, "battler"), m_pending_code(0), m_new_code(0), m_transmitting(0), m_cur_bit(0), m_cur_byte(0), battler_timer(nullptr) @@ -171,9 +171,9 @@ int nes_bcbattle_device::read_current_bit() return 0; } -UINT8 nes_bcbattle_device::read_exp(offs_t offset) +uint8_t nes_bcbattle_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 1) //$4017 { ret |= read_current_bit() << 2; diff --git a/src/devices/bus/nes_ctrl/bcbattle.h b/src/devices/bus/nes_ctrl/bcbattle.h index cbc7125c041..3d4e8f0d467 100644 --- a/src/devices/bus/nes_ctrl/bcbattle.h +++ b/src/devices/bus/nes_ctrl/bcbattle.h @@ -27,7 +27,7 @@ class nes_bcbattle_device : public device_t, { public: // construction/destruction - nes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -37,12 +37,12 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_exp(offs_t offset) override; + virtual uint8_t read_exp(offs_t offset) override; int read_current_bit(); static const device_timer_id TIMER_BATTLER = 1; required_device m_reader; - UINT8 m_current_barcode[20]; + uint8_t m_current_barcode[20]; int m_pending_code, m_new_code, m_transmitting, m_cur_bit, m_cur_byte; emu_timer *battler_timer; }; diff --git a/src/devices/bus/nes_ctrl/ctrl.cpp b/src/devices/bus/nes_ctrl/ctrl.cpp index a1ef7dc9c1a..66afea1e4bc 100644 --- a/src/devices/bus/nes_ctrl/ctrl.cpp +++ b/src/devices/bus/nes_ctrl/ctrl.cpp @@ -100,7 +100,7 @@ device_nes_control_port_interface::~device_nes_control_port_interface() // nes_control_port_device - constructor //------------------------------------------------- -nes_control_port_device::nes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_control_port_device::nes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_CONTROL_PORT, "Nintendo NES/FC control port", tag, owner, clock, "nes_control_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) { @@ -127,31 +127,31 @@ void nes_control_port_device::device_start() } -UINT8 nes_control_port_device::read_bit0() +uint8_t nes_control_port_device::read_bit0() { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data = m_device->read_bit0(); return data; } -UINT8 nes_control_port_device::read_bit34() +uint8_t nes_control_port_device::read_bit34() { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data = m_device->read_bit34(); return data; } -UINT8 nes_control_port_device::read_exp(offs_t offset) +uint8_t nes_control_port_device::read_exp(offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data = m_device->read_exp(offset); return data; } -void nes_control_port_device::write(UINT8 data) +void nes_control_port_device::write(uint8_t data) { if (m_device) m_device->write(data); diff --git a/src/devices/bus/nes_ctrl/ctrl.h b/src/devices/bus/nes_ctrl/ctrl.h index e899258547c..51d478eed49 100644 --- a/src/devices/bus/nes_ctrl/ctrl.h +++ b/src/devices/bus/nes_ctrl/ctrl.h @@ -32,10 +32,10 @@ public: device_nes_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_nes_control_port_interface(); - virtual UINT8 read_bit0() { return 0; }; - virtual UINT8 read_bit34() { return 0; }; - virtual UINT8 read_exp(offs_t offset) { return 0; }; - virtual void write(UINT8 data) { }; + virtual uint8_t read_bit0() { return 0; }; + virtual uint8_t read_bit34() { return 0; }; + virtual uint8_t read_exp(offs_t offset) { return 0; }; + virtual void write(uint8_t data) { }; protected: nes_control_port_device *m_port; @@ -53,15 +53,15 @@ class nes_control_port_device : public device_t, { public: // construction/destruction - nes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~nes_control_port_device(); static void set_brightpixel_callback(device_t &device, nesctrl_brightpixel_delegate callback) { downcast(device).m_brightpixel_cb = callback; } - UINT8 read_bit0(); - UINT8 read_bit34(); - UINT8 read_exp(offs_t offset); - void write(UINT8 data); + uint8_t read_bit0(); + uint8_t read_bit34(); + uint8_t read_exp(offs_t offset); + void write(uint8_t data); nesctrl_brightpixel_delegate m_brightpixel_cb; diff --git a/src/devices/bus/nes_ctrl/fckeybrd.cpp b/src/devices/bus/nes_ctrl/fckeybrd.cpp index b4c6dde6033..1222b93f3e0 100644 --- a/src/devices/bus/nes_ctrl/fckeybrd.cpp +++ b/src/devices/bus/nes_ctrl/fckeybrd.cpp @@ -144,7 +144,7 @@ machine_config_constructor nes_fckeybrd_device::device_mconfig_additions() const // nes_fckeybrd_device - constructor //------------------------------------------------- -nes_fckeybrd_device::nes_fckeybrd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_fckeybrd_device::nes_fckeybrd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_FCKEYBOARD, "Nintendo Family Computer Keyboard Component", tag, owner, clock, "nes_fckeybrd", __FILE__) , device_nes_control_port_interface(mconfig, *this) , m_cassette(*this, "tape") @@ -181,9 +181,9 @@ void nes_fckeybrd_device::device_reset() // read //------------------------------------------------- -UINT8 nes_fckeybrd_device::read_exp(offs_t offset) +uint8_t nes_fckeybrd_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 0) //$4016 { // FC Keyboard: tape input @@ -212,7 +212,7 @@ UINT8 nes_fckeybrd_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_fckeybrd_device::write(UINT8 data) +void nes_fckeybrd_device::write(uint8_t data) { // tape output (not fully tested) if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_RECORD) @@ -220,7 +220,7 @@ void nes_fckeybrd_device::write(UINT8 data) if (BIT(data, 2)) // keyboard active { - UINT8 out = BIT(data, 1); // scan + uint8_t out = BIT(data, 1); // scan if (m_fck_mode && !out && ++m_fck_scan > 9) m_fck_scan = 0; diff --git a/src/devices/bus/nes_ctrl/fckeybrd.h b/src/devices/bus/nes_ctrl/fckeybrd.h index f4cdc02ba39..4f70f5762a8 100644 --- a/src/devices/bus/nes_ctrl/fckeybrd.h +++ b/src/devices/bus/nes_ctrl/fckeybrd.h @@ -27,7 +27,7 @@ class nes_fckeybrd_device : public device_t, { public: // construction/destruction - nes_fckeybrd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fckeybrd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -37,13 +37,13 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; private: required_device m_cassette; required_ioport_array<9> m_kbd; - UINT8 m_fck_scan, m_fck_mode; + uint8_t m_fck_scan, m_fck_mode; }; diff --git a/src/devices/bus/nes_ctrl/ftrainer.cpp b/src/devices/bus/nes_ctrl/ftrainer.cpp index 93edab2425a..8a7a17d550d 100644 --- a/src/devices/bus/nes_ctrl/ftrainer.cpp +++ b/src/devices/bus/nes_ctrl/ftrainer.cpp @@ -83,7 +83,7 @@ ioport_constructor nes_ftrainer_device::device_input_ports() const // nes_ftrainer_device - constructor //------------------------------------------------- -nes_ftrainer_device::nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_ftrainer_device::nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_FTRAINER, "Bandai Family Trainer", tag, owner, clock, "nes_famtrain", __FILE__) , device_nes_control_port_interface(mconfig, *this) , m_trainer(*this, "FT_COL.%u", 0) @@ -116,9 +116,9 @@ void nes_ftrainer_device::device_reset() // read //------------------------------------------------- -UINT8 nes_ftrainer_device::read_exp(offs_t offset) +uint8_t nes_ftrainer_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 1) //$4017 { if (!BIT(m_row_scan, 0)) @@ -147,7 +147,7 @@ UINT8 nes_ftrainer_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_ftrainer_device::write(UINT8 data) +void nes_ftrainer_device::write(uint8_t data) { // select row to scan m_row_scan = data & 0x07; diff --git a/src/devices/bus/nes_ctrl/ftrainer.h b/src/devices/bus/nes_ctrl/ftrainer.h index f426f4e6a2c..f984c901cf2 100644 --- a/src/devices/bus/nes_ctrl/ftrainer.h +++ b/src/devices/bus/nes_ctrl/ftrainer.h @@ -26,7 +26,7 @@ class nes_ftrainer_device : public device_t, { public: // construction/destruction - nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -35,12 +35,12 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; private: required_ioport_array<4> m_trainer; - UINT8 m_row_scan; + uint8_t m_row_scan; }; diff --git a/src/devices/bus/nes_ctrl/hori.cpp b/src/devices/bus/nes_ctrl/hori.cpp index cecf1f05dbc..7281a61bf13 100644 --- a/src/devices/bus/nes_ctrl/hori.cpp +++ b/src/devices/bus/nes_ctrl/hori.cpp @@ -89,7 +89,7 @@ machine_config_constructor nes_hori4p_device::device_mconfig_additions() const // nes_horitwin_device - constructor //------------------------------------------------- -nes_horitwin_device::nes_horitwin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_horitwin_device::nes_horitwin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_HORITWIN, "Hori Twin Adapter", tag, owner, clock, "nes_horitwin", __FILE__), device_nes_control_port_interface(mconfig, *this), m_port1(*this, "port1"), @@ -97,7 +97,7 @@ nes_horitwin_device::nes_horitwin_device(const machine_config &mconfig, const ch { } -nes_hori4p_device::nes_hori4p_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_hori4p_device::nes_hori4p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_HORI4P, "Hori 4P Adapter", tag, owner, clock, "nes_hori4p", __FILE__), device_nes_control_port_interface(mconfig, *this), m_port1(*this, "port1"), @@ -113,9 +113,9 @@ nes_hori4p_device::nes_hori4p_device(const machine_config &mconfig, const char * // read //------------------------------------------------- -UINT8 nes_horitwin_device::read_exp(offs_t offset) +uint8_t nes_horitwin_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 0) //$4016 ret |= (m_port1->read_bit0() << 1); else //$4017 @@ -123,9 +123,9 @@ UINT8 nes_horitwin_device::read_exp(offs_t offset) return ret; } -UINT8 nes_hori4p_device::read_exp(offs_t offset) +uint8_t nes_hori4p_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (m_cfg->read() == 0) // 2P { if (offset == 0) //$4016 @@ -153,13 +153,13 @@ UINT8 nes_hori4p_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_horitwin_device::write(UINT8 data) +void nes_horitwin_device::write(uint8_t data) { m_port1->write(data); m_port2->write(data); } -void nes_hori4p_device::write(UINT8 data) +void nes_hori4p_device::write(uint8_t data) { m_port1->write(data); m_port2->write(data); diff --git a/src/devices/bus/nes_ctrl/hori.h b/src/devices/bus/nes_ctrl/hori.h index 613a8bdac7c..1205b400025 100644 --- a/src/devices/bus/nes_ctrl/hori.h +++ b/src/devices/bus/nes_ctrl/hori.h @@ -26,7 +26,7 @@ class nes_horitwin_device : public device_t, { public: // construction/destruction - nes_horitwin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_horitwin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; @@ -34,8 +34,8 @@ protected: // device-level overrides virtual void device_start() override {} - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; private: required_device m_port1; @@ -49,7 +49,7 @@ class nes_hori4p_device : public device_t, { public: // construction/destruction - nes_hori4p_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_hori4p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -58,8 +58,8 @@ protected: // device-level overrides virtual void device_start() override {} - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; private: required_device m_port1; diff --git a/src/devices/bus/nes_ctrl/joypad.cpp b/src/devices/bus/nes_ctrl/joypad.cpp index 7a78d08f2c7..08652d408cf 100644 --- a/src/devices/bus/nes_ctrl/joypad.cpp +++ b/src/devices/bus/nes_ctrl/joypad.cpp @@ -173,36 +173,36 @@ machine_config_constructor nes_arcstick_device::device_mconfig_additions() const // nes_joypad_device - constructor //------------------------------------------------- -nes_joypad_device::nes_joypad_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) : +nes_joypad_device::nes_joypad_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_nes_control_port_interface(mconfig, *this), m_joypad(*this, "JOYPAD"), m_latch(0) { } -nes_joypad_device::nes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_joypad_device::nes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_JOYPAD, "Nintendo NES / FC Control Pad", tag, owner, clock, "nes_joypad", __FILE__), device_nes_control_port_interface(mconfig, *this), m_joypad(*this, "JOYPAD"), m_latch(0) { } -nes_fcpad2_device::nes_fcpad2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_fcpad2_device::nes_fcpad2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_joypad_device(mconfig, NES_FCPAD_P2, "Nintendo Family Computer P2 Pad", tag, owner, clock, "nes_fcpad2", __FILE__) { } -nes_ccpadl_device::nes_ccpadl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_ccpadl_device::nes_ccpadl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_joypad_device(mconfig, NES_CCPAD_LEFT, "FC Crazy Climber Left Pad", tag, owner, clock, "nes_ccpadl", __FILE__) { } -nes_ccpadr_device::nes_ccpadr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_ccpadr_device::nes_ccpadr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_joypad_device(mconfig, NES_CCPAD_RIGHT, "FC Crazy Climber Right Pad", tag, owner, clock, "nes_ccpadr", __FILE__) { } -nes_arcstick_device::nes_arcstick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_arcstick_device::nes_arcstick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_joypad_device(mconfig, NES_ARCSTICK, "Nintendo Family Computer Arcade Stick", tag, owner, clock, "nes_arcstick", __FILE__), m_daisychain(*this, "subexp"), m_cfg(*this, "CONFIG") @@ -234,16 +234,16 @@ void nes_joypad_device::device_reset() // read //------------------------------------------------- -UINT8 nes_joypad_device::read_bit0() +uint8_t nes_joypad_device::read_bit0() { - UINT8 ret = m_latch & 1; + uint8_t ret = m_latch & 1; m_latch >>= 1; return ret; } -UINT8 nes_fcpad2_device::read_exp(offs_t offset) +uint8_t nes_fcpad2_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (!offset) // microphone input ret |= m_joypad->read() & 0x04; @@ -256,9 +256,9 @@ UINT8 nes_fcpad2_device::read_exp(offs_t offset) // with each other? currently, we only support the following setup: // if the first pad is set as P1, the daisy chained pad is checked // for P2 only, and vice versa. -UINT8 nes_arcstick_device::read_exp(offs_t offset) +uint8_t nes_arcstick_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 0) //$4016 { if ((m_cfg->read() & 2) == 0) // we are P1 input @@ -287,7 +287,7 @@ UINT8 nes_arcstick_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_joypad_device::write(UINT8 data) +void nes_joypad_device::write(uint8_t data) { if (data & 0x01) return; @@ -295,7 +295,7 @@ void nes_joypad_device::write(UINT8 data) m_latch = m_joypad->read(); } -void nes_fcpad2_device::write(UINT8 data) +void nes_fcpad2_device::write(uint8_t data) { if (data & 0x01) return; @@ -304,7 +304,7 @@ void nes_fcpad2_device::write(UINT8 data) m_latch = m_joypad->read() & ~0x04; } -void nes_arcstick_device::write(UINT8 data) +void nes_arcstick_device::write(uint8_t data) { m_daisychain->write(data); diff --git a/src/devices/bus/nes_ctrl/joypad.h b/src/devices/bus/nes_ctrl/joypad.h index 8430db4dff9..5af6ed93bf2 100644 --- a/src/devices/bus/nes_ctrl/joypad.h +++ b/src/devices/bus/nes_ctrl/joypad.h @@ -26,8 +26,8 @@ class nes_joypad_device : public device_t, { public: // construction/destruction - nes_joypad_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); - nes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_joypad_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); + nes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -36,11 +36,11 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_bit0() override; - virtual void write(UINT8 data) override; + virtual uint8_t read_bit0() override; + virtual void write(uint8_t data) override; required_ioport m_joypad; - UINT32 m_latch; + uint32_t m_latch; }; // ======================> nes_fcpad2_device @@ -49,13 +49,13 @@ class nes_fcpad2_device : public nes_joypad_device { public: // construction/destruction - nes_fcpad2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_fcpad2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; protected: - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; }; // ======================> nes_ccpadl_device @@ -64,7 +64,7 @@ class nes_ccpadl_device : public nes_joypad_device { public: // construction/destruction - nes_ccpadl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ccpadl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; }; @@ -75,7 +75,7 @@ class nes_ccpadr_device : public nes_joypad_device { public: // construction/destruction - nes_ccpadr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_ccpadr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; }; @@ -86,15 +86,15 @@ class nes_arcstick_device : public nes_joypad_device { public: // construction/destruction - nes_arcstick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_arcstick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; virtual machine_config_constructor device_mconfig_additions() const override; protected: - virtual UINT8 read_bit0() override { return 0; } - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_bit0() override { return 0; } + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; required_device m_daisychain; required_ioport m_cfg; diff --git a/src/devices/bus/nes_ctrl/konamihs.cpp b/src/devices/bus/nes_ctrl/konamihs.cpp index 46d5fb1f2fa..c3e998bba7b 100644 --- a/src/devices/bus/nes_ctrl/konamihs.cpp +++ b/src/devices/bus/nes_ctrl/konamihs.cpp @@ -42,7 +42,7 @@ ioport_constructor nes_konamihs_device::device_input_ports() const // nes_konamihs_device - constructor //------------------------------------------------- -nes_konamihs_device::nes_konamihs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_konamihs_device::nes_konamihs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_KONAMIHS, "Konami Hyper Shot Controller", tag, owner, clock, "nes_konamihs", __FILE__), device_nes_control_port_interface(mconfig, *this), m_ipt_p1(*this, "P1"), @@ -77,9 +77,9 @@ void nes_konamihs_device::device_reset() // read //------------------------------------------------- -UINT8 nes_konamihs_device::read_exp(offs_t offset) +uint8_t nes_konamihs_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 1) //$4017 { ret |= m_latch_p1 << 1; @@ -92,7 +92,7 @@ UINT8 nes_konamihs_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_konamihs_device::write(UINT8 data) +void nes_konamihs_device::write(uint8_t data) { if ((data & 0x02) == 0) m_latch_p1 = m_ipt_p1->read(); diff --git a/src/devices/bus/nes_ctrl/konamihs.h b/src/devices/bus/nes_ctrl/konamihs.h index da3aca612be..91070ba6e02 100644 --- a/src/devices/bus/nes_ctrl/konamihs.h +++ b/src/devices/bus/nes_ctrl/konamihs.h @@ -26,7 +26,7 @@ class nes_konamihs_device : public device_t, { public: // construction/destruction - nes_konamihs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_konamihs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -35,12 +35,12 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; required_ioport m_ipt_p1; required_ioport m_ipt_p2; - UINT32 m_latch_p1, m_latch_p2; + uint32_t m_latch_p1, m_latch_p2; }; // device type definition diff --git a/src/devices/bus/nes_ctrl/miracle.cpp b/src/devices/bus/nes_ctrl/miracle.cpp index 6fdbc6f273a..0d79645a018 100644 --- a/src/devices/bus/nes_ctrl/miracle.cpp +++ b/src/devices/bus/nes_ctrl/miracle.cpp @@ -58,7 +58,7 @@ void nes_miracle_device::device_timer(emu_timer &timer, device_timer_id id, int // nes_miracle_device - constructor //------------------------------------------------- -nes_miracle_device::nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_miracle_device::nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_MIRACLE, "Miracle Piano Controller", tag, owner, clock, "nes_miracle", __FILE__), device_serial_interface(mconfig, *this), device_nes_control_port_interface(mconfig, *this), @@ -111,9 +111,9 @@ void nes_miracle_device::device_reset() // read //------------------------------------------------- -UINT8 nes_miracle_device::read_bit0() +uint8_t nes_miracle_device::read_bit0() { - UINT8 ret = 0; + uint8_t ret = 0; if (m_midi_mode == MIRACLE_MIDI_RECEIVE) { @@ -139,7 +139,7 @@ UINT8 nes_miracle_device::read_bit0() // c4fc = start of recv routine // c53a = start of send routine -void nes_miracle_device::write(UINT8 data) +void nes_miracle_device::write(uint8_t data) { // printf("write: %d (%d %02x %d)\n", data & 1, m_sent_bits, m_data_sent, m_midi_mode); @@ -228,7 +228,7 @@ void nes_miracle_device::write(UINT8 data) void nes_miracle_device::rcv_complete() // Rx completed receiving byte { receive_register_extract(); - UINT8 rcv = get_received_char(); + uint8_t rcv = get_received_char(); // printf("Got %02x -> [%d]\n", rcv, m_recv_write); m_recvring[m_recv_write++] = rcv; @@ -257,13 +257,13 @@ void nes_miracle_device::tra_complete() // Tx completed sending byte void nes_miracle_device::tra_callback() // Tx send bit { - UINT8 bit = transmit_register_get_data_bit(); + uint8_t bit = transmit_register_get_data_bit(); // send this to midi out m_midiout->write_txd(bit); } -void nes_miracle_device::xmit_char(UINT8 data) +void nes_miracle_device::xmit_char(uint8_t data) { // if tx is busy it'll pick this up automatically when it completes // if not, send now! diff --git a/src/devices/bus/nes_ctrl/miracle.h b/src/devices/bus/nes_ctrl/miracle.h index 6d0730423aa..fee12bca313 100644 --- a/src/devices/bus/nes_ctrl/miracle.h +++ b/src/devices/bus/nes_ctrl/miracle.h @@ -31,7 +31,7 @@ public: static const int RECV_RING_SIZE = 64; // construction/destruction - nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -41,7 +41,7 @@ public: virtual void tra_complete() override; // Tx completed sending byte virtual void tra_callback() override; // Tx send bit - void xmit_char(UINT8 data); + void xmit_char(uint8_t data); required_device m_midiin, m_midiout; @@ -50,16 +50,16 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_bit0() override; - virtual void write(UINT8 data) override; + virtual uint8_t read_bit0() override; + virtual void write(uint8_t data) override; static const device_timer_id TIMER_STROBE_ON = 0; emu_timer *strobe_timer; int m_strobe_on, m_midi_mode, m_sent_bits; - UINT32 m_strobe_clock; - UINT8 m_data_sent; - UINT8 m_xmitring[XMIT_RING_SIZE], m_recvring[RECV_RING_SIZE]; + uint32_t m_strobe_clock; + uint8_t m_data_sent; + uint8_t m_xmitring[XMIT_RING_SIZE], m_recvring[RECV_RING_SIZE]; int m_xmit_read, m_xmit_write; int m_recv_read, m_recv_write; bool m_tx_busy, m_read_status, m_status_bit; diff --git a/src/devices/bus/nes_ctrl/mjpanel.cpp b/src/devices/bus/nes_ctrl/mjpanel.cpp index 988c54f11d1..06cac0fd051 100644 --- a/src/devices/bus/nes_ctrl/mjpanel.cpp +++ b/src/devices/bus/nes_ctrl/mjpanel.cpp @@ -69,7 +69,7 @@ ioport_constructor nes_mjpanel_device::device_input_ports() const // nes_mjpanel_device - constructor //------------------------------------------------- -nes_mjpanel_device::nes_mjpanel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_mjpanel_device::nes_mjpanel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_MJPANEL, "Famicom Mahjong Panel", tag, owner, clock, "nes_mjpanel", __FILE__) , device_nes_control_port_interface(mconfig, *this) , m_panel(*this, "MJPANEL.%u", 0) @@ -102,9 +102,9 @@ void nes_mjpanel_device::device_reset() // read //------------------------------------------------- -UINT8 nes_mjpanel_device::read_exp(offs_t offset) +uint8_t nes_mjpanel_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset) { ret = (m_latch & 1) << 1; @@ -120,7 +120,7 @@ UINT8 nes_mjpanel_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_mjpanel_device::write(UINT8 data) +void nes_mjpanel_device::write(uint8_t data) { if (data & 0x01) return; diff --git a/src/devices/bus/nes_ctrl/mjpanel.h b/src/devices/bus/nes_ctrl/mjpanel.h index ad470cb91e7..23f14f369ea 100644 --- a/src/devices/bus/nes_ctrl/mjpanel.h +++ b/src/devices/bus/nes_ctrl/mjpanel.h @@ -26,7 +26,7 @@ class nes_mjpanel_device : public device_t, { public: // construction/destruction - nes_mjpanel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_mjpanel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -35,12 +35,12 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; private: required_ioport_array<4> m_panel; - UINT32 m_latch; + uint32_t m_latch; }; diff --git a/src/devices/bus/nes_ctrl/pachinko.cpp b/src/devices/bus/nes_ctrl/pachinko.cpp index c4fdeb4b5d9..301647e7f15 100644 --- a/src/devices/bus/nes_ctrl/pachinko.cpp +++ b/src/devices/bus/nes_ctrl/pachinko.cpp @@ -47,7 +47,7 @@ ioport_constructor nes_pachinko_device::device_input_ports() const // nes_pachinko_device - constructor //------------------------------------------------- -nes_pachinko_device::nes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_pachinko_device::nes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_PACHINKO, "Famicom Pachinko Controller", tag, owner, clock, "nes_pachinko", __FILE__), device_nes_control_port_interface(mconfig, *this), m_joypad(*this, "JOYPAD"), @@ -80,9 +80,9 @@ void nes_pachinko_device::device_reset() // read //------------------------------------------------- -UINT8 nes_pachinko_device::read_exp(offs_t offset) +uint8_t nes_pachinko_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; // this controller behaves like a standard P3 joypad, with longer stream of inputs if (offset == 0) //$4016 { @@ -96,7 +96,7 @@ UINT8 nes_pachinko_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_pachinko_device::write(UINT8 data) +void nes_pachinko_device::write(uint8_t data) { if (data & 0x01) return; diff --git a/src/devices/bus/nes_ctrl/pachinko.h b/src/devices/bus/nes_ctrl/pachinko.h index 04fad189160..b11cdbab5d4 100644 --- a/src/devices/bus/nes_ctrl/pachinko.h +++ b/src/devices/bus/nes_ctrl/pachinko.h @@ -26,7 +26,7 @@ class nes_pachinko_device : public device_t, { public: // construction/destruction - nes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -35,12 +35,12 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; required_ioport m_joypad; required_ioport m_trigger; - UINT32 m_latch; + uint32_t m_latch; }; // device type definition diff --git a/src/devices/bus/nes_ctrl/partytap.cpp b/src/devices/bus/nes_ctrl/partytap.cpp index 2a1acd8adc9..dfa8683f73d 100644 --- a/src/devices/bus/nes_ctrl/partytap.cpp +++ b/src/devices/bus/nes_ctrl/partytap.cpp @@ -43,7 +43,7 @@ ioport_constructor nes_partytap_device::device_input_ports() const // nes_partytap_device - constructor //------------------------------------------------- -nes_partytap_device::nes_partytap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_partytap_device::nes_partytap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_PARTYTAP, "Yonezawa Party Tap Controller", tag, owner, clock, "nes_partytap", __FILE__), device_nes_control_port_interface(mconfig, *this), m_inputs(*this, "INPUTS"), m_mode(0), m_latch(0) @@ -77,9 +77,9 @@ void nes_partytap_device::device_reset() // read //------------------------------------------------- -UINT8 nes_partytap_device::read_exp(offs_t offset) +uint8_t nes_partytap_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 1) //$4017 { ret |= m_latch & 0x1c; @@ -94,7 +94,7 @@ UINT8 nes_partytap_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_partytap_device::write(UINT8 data) +void nes_partytap_device::write(uint8_t data) { // inputs are read in two chunks of 3 bits, before the second one is read bit2 is written here // probably a mechanism for the game to detect which group of inputs is being read diff --git a/src/devices/bus/nes_ctrl/partytap.h b/src/devices/bus/nes_ctrl/partytap.h index f66b7af7eec..0b3f6db9cb3 100644 --- a/src/devices/bus/nes_ctrl/partytap.h +++ b/src/devices/bus/nes_ctrl/partytap.h @@ -26,7 +26,7 @@ class nes_partytap_device : public device_t, { public: // construction/destruction - nes_partytap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_partytap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -35,12 +35,12 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; required_ioport m_inputs; - UINT8 m_mode; - UINT32 m_latch; + uint8_t m_mode; + uint32_t m_latch; }; // device type definition diff --git a/src/devices/bus/nes_ctrl/powerpad.cpp b/src/devices/bus/nes_ctrl/powerpad.cpp index 569695d97ca..1f47ea5f99f 100644 --- a/src/devices/bus/nes_ctrl/powerpad.cpp +++ b/src/devices/bus/nes_ctrl/powerpad.cpp @@ -77,7 +77,7 @@ ioport_constructor nes_powerpad_device::device_input_ports() const // nes_powerpad_device - constructor //------------------------------------------------- -nes_powerpad_device::nes_powerpad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_powerpad_device::nes_powerpad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_POWERPAD, "Bandai Power Pad", tag, owner, clock, "nes_powerpad", __FILE__), device_nes_control_port_interface(mconfig, *this), m_ipt1(*this, "POWERPAD1"), @@ -111,9 +111,9 @@ void nes_powerpad_device::device_reset() // read //------------------------------------------------- -UINT8 nes_powerpad_device::read_bit34() +uint8_t nes_powerpad_device::read_bit34() { - UINT8 ret = 0; + uint8_t ret = 0; ret |= (m_latch[0] & 0x01) << 3; ret |= (m_latch[1] & 0x01) << 4; m_latch[0] >>= 1; @@ -125,7 +125,7 @@ UINT8 nes_powerpad_device::read_bit34() // write //------------------------------------------------- -void nes_powerpad_device::write(UINT8 data) +void nes_powerpad_device::write(uint8_t data) { if (data & 0x01) return; diff --git a/src/devices/bus/nes_ctrl/powerpad.h b/src/devices/bus/nes_ctrl/powerpad.h index a69486e7e23..abfbac02551 100644 --- a/src/devices/bus/nes_ctrl/powerpad.h +++ b/src/devices/bus/nes_ctrl/powerpad.h @@ -26,7 +26,7 @@ class nes_powerpad_device : public device_t, { public: // construction/destruction - nes_powerpad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_powerpad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -35,13 +35,13 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_bit34() override; - virtual void write(UINT8 data) override; + virtual uint8_t read_bit34() override; + virtual void write(uint8_t data) override; private: required_ioport m_ipt1; required_ioport m_ipt2; - UINT32 m_latch[2]; + uint32_t m_latch[2]; }; diff --git a/src/devices/bus/nes_ctrl/suborkey.cpp b/src/devices/bus/nes_ctrl/suborkey.cpp index 3341887c761..d8fe8d6f8b0 100644 --- a/src/devices/bus/nes_ctrl/suborkey.cpp +++ b/src/devices/bus/nes_ctrl/suborkey.cpp @@ -160,7 +160,7 @@ ioport_constructor nes_suborkey_device::device_input_ports() const // nes_suborkey_device - constructor //------------------------------------------------- -nes_suborkey_device::nes_suborkey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nes_suborkey_device::nes_suborkey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_SUBORKEYBOARD, "Subor FC Keyboard", tag, owner, clock, "nes_suborkey", __FILE__) , device_nes_control_port_interface(mconfig, *this) , m_kbd(*this, "SUBOR.%u", 0) @@ -196,9 +196,9 @@ void nes_suborkey_device::device_reset() // read //------------------------------------------------- -UINT8 nes_suborkey_device::read_exp(offs_t offset) +uint8_t nes_suborkey_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 1) //$4017 { // Subor Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4 @@ -215,11 +215,11 @@ UINT8 nes_suborkey_device::read_exp(offs_t offset) // write //------------------------------------------------- -void nes_suborkey_device::write(UINT8 data) +void nes_suborkey_device::write(uint8_t data) { if (BIT(data, 2)) // keyboard active { - UINT8 out = BIT(data, 1); // scan + uint8_t out = BIT(data, 1); // scan if (m_fck_mode && !out && ++m_fck_scan > 12) m_fck_scan = 0; diff --git a/src/devices/bus/nes_ctrl/suborkey.h b/src/devices/bus/nes_ctrl/suborkey.h index b50b0e3bb94..8970b3b466f 100644 --- a/src/devices/bus/nes_ctrl/suborkey.h +++ b/src/devices/bus/nes_ctrl/suborkey.h @@ -26,7 +26,7 @@ class nes_suborkey_device : public device_t, { public: // construction/destruction - nes_suborkey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_suborkey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -35,12 +35,12 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_exp(offs_t offset) override; - virtual void write(UINT8 data) override; + virtual uint8_t read_exp(offs_t offset) override; + virtual void write(uint8_t data) override; private: required_ioport_array<13> m_kbd; - UINT8 m_fck_scan, m_fck_mode; + uint8_t m_fck_scan, m_fck_mode; }; diff --git a/src/devices/bus/nes_ctrl/zapper.cpp b/src/devices/bus/nes_ctrl/zapper.cpp index 422b9664f5e..82821ee2ad9 100644 --- a/src/devices/bus/nes_ctrl/zapper.cpp +++ b/src/devices/bus/nes_ctrl/zapper.cpp @@ -44,7 +44,7 @@ ioport_constructor nes_zapper_device::device_input_ports() const // nes_zapper_device - constructor //------------------------------------------------- -nes_zapper_device::nes_zapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nes_zapper_device::nes_zapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_ZAPPER, "Nintendo Zapper Lightgun", tag, owner, clock, "nes_zapper", __FILE__), device_nes_control_port_interface(mconfig, *this), m_lightx(*this, "ZAPPER_X"), @@ -76,9 +76,9 @@ void nes_zapper_device::device_reset() // read //------------------------------------------------- -UINT8 nes_zapper_device::read_bit34() +uint8_t nes_zapper_device::read_bit34() { - UINT8 ret = m_trigger->read(); + uint8_t ret = m_trigger->read(); if (!m_port->m_brightpixel_cb.isnull() && m_port->m_brightpixel_cb(m_lightx->read(), m_lighty->read())) ret &= ~0x08; // sprite hit @@ -87,9 +87,9 @@ UINT8 nes_zapper_device::read_bit34() return ret; } -UINT8 nes_zapper_device::read_exp(offs_t offset) +uint8_t nes_zapper_device::read_exp(offs_t offset) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 1) // $4017 ret |= nes_zapper_device::read_bit34(); return ret; diff --git a/src/devices/bus/nes_ctrl/zapper.h b/src/devices/bus/nes_ctrl/zapper.h index 8aedda7fc7a..22d4cea0664 100644 --- a/src/devices/bus/nes_ctrl/zapper.h +++ b/src/devices/bus/nes_ctrl/zapper.h @@ -26,7 +26,7 @@ class nes_zapper_device : public device_t, { public: // construction/destruction - nes_zapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nes_zapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; @@ -35,8 +35,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_bit34() override; - virtual UINT8 read_exp(offs_t offset) override; + virtual uint8_t read_bit34() override; + virtual uint8_t read_exp(offs_t offset) override; private: required_ioport m_lightx; diff --git a/src/devices/bus/newbrain/eim.cpp b/src/devices/bus/newbrain/eim.cpp index 599267b3ffb..7be6e38d6cf 100644 --- a/src/devices/bus/newbrain/eim.cpp +++ b/src/devices/bus/newbrain/eim.cpp @@ -119,7 +119,7 @@ machine_config_constructor newbrain_eim_t::device_mconfig_additions() const // newbrain_eim_t - constructor //------------------------------------------------- -newbrain_eim_t::newbrain_eim_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +newbrain_eim_t::newbrain_eim_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEWBRAIN_EIM, "Newbrain EIM", tag, owner, clock, "newbrain_eim", __FILE__), device_newbrain_expansion_slot_interface(mconfig, *this), m_ctc(*this, Z80CTC_TAG), @@ -156,7 +156,7 @@ void newbrain_eim_t::device_reset() // mreq_r - memory request read //------------------------------------------------- -UINT8 newbrain_eim_t::mreq_r(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) +uint8_t newbrain_eim_t::mreq_r(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) { return m_exp->mreq_r(space, offset, data, romov, exrm, raminh); } @@ -166,7 +166,7 @@ UINT8 newbrain_eim_t::mreq_r(address_space &space, offs_t offset, UINT8 data, bo // mreq_w - memory request write //------------------------------------------------- -void newbrain_eim_t::mreq_w(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) +void newbrain_eim_t::mreq_w(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) { m_exp->mreq_w(space, offset, data, romov, exrm, raminh); } @@ -176,7 +176,7 @@ void newbrain_eim_t::mreq_w(address_space &space, offs_t offset, UINT8 data, boo // iorq_r - I/O request read //------------------------------------------------- -UINT8 newbrain_eim_t::iorq_r(address_space &space, offs_t offset, UINT8 data, bool &prtov) +uint8_t newbrain_eim_t::iorq_r(address_space &space, offs_t offset, uint8_t data, bool &prtov) { return m_exp->iorq_r(space, offset, data, prtov); } @@ -186,7 +186,7 @@ UINT8 newbrain_eim_t::iorq_r(address_space &space, offs_t offset, UINT8 data, bo // iorq_w - I/O request write //------------------------------------------------- -void newbrain_eim_t::iorq_w(address_space &space, offs_t offset, UINT8 data, bool &prtov) +void newbrain_eim_t::iorq_w(address_space &space, offs_t offset, uint8_t data, bool &prtov) { m_exp->iorq_w(space, offset, data, prtov); } diff --git a/src/devices/bus/newbrain/eim.h b/src/devices/bus/newbrain/eim.h index 2512321783a..824de3daf69 100644 --- a/src/devices/bus/newbrain/eim.h +++ b/src/devices/bus/newbrain/eim.h @@ -32,7 +32,7 @@ class newbrain_eim_t : public device_t, { public: // construction/destruction - newbrain_eim_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + newbrain_eim_t(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,17 +58,17 @@ protected: virtual void device_reset() override; // device_newbrain_expansion_slot_interface overrides - virtual UINT8 mreq_r(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) override; - virtual void mreq_w(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) override; - virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data, bool &prtov) override; - virtual void iorq_w(address_space &space, offs_t offset, UINT8 data, bool &prtov) override; + virtual uint8_t mreq_r(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) override; + virtual void mreq_w(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) override; + virtual uint8_t iorq_r(address_space &space, offs_t offset, uint8_t data, bool &prtov) override; + virtual void iorq_w(address_space &space, offs_t offset, uint8_t data, bool &prtov) override; private: required_device m_ctc; required_device m_acia; required_device m_exp; required_memory_region m_rom; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; int m_aciaint; int m_anint; diff --git a/src/devices/bus/newbrain/exp.cpp b/src/devices/bus/newbrain/exp.cpp index b5ddf149114..85684823493 100644 --- a/src/devices/bus/newbrain/exp.cpp +++ b/src/devices/bus/newbrain/exp.cpp @@ -42,7 +42,7 @@ device_newbrain_expansion_slot_interface::device_newbrain_expansion_slot_interfa // newbrain_expansion_slot_t - constructor //------------------------------------------------- -newbrain_expansion_slot_t::newbrain_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +newbrain_expansion_slot_t::newbrain_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEWBRAIN_EXPANSION_SLOT, "NewBrain expansion port", tag, owner, clock, "newbrain_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_card(nullptr) { @@ -76,7 +76,7 @@ void newbrain_expansion_slot_t::device_reset() // mreq_r - memory request read //------------------------------------------------- -UINT8 newbrain_expansion_slot_t::mreq_r(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) +uint8_t newbrain_expansion_slot_t::mreq_r(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) { if (m_card != nullptr) { @@ -91,7 +91,7 @@ UINT8 newbrain_expansion_slot_t::mreq_r(address_space &space, offs_t offset, UIN // mreq_w - memory request write //------------------------------------------------- -void newbrain_expansion_slot_t::mreq_w(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) +void newbrain_expansion_slot_t::mreq_w(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) { if (m_card != nullptr) { @@ -104,7 +104,7 @@ void newbrain_expansion_slot_t::mreq_w(address_space &space, offs_t offset, UINT // iorq_r - I/O request read //------------------------------------------------- -UINT8 newbrain_expansion_slot_t::iorq_r(address_space &space, offs_t offset, UINT8 data, bool &prtov) +uint8_t newbrain_expansion_slot_t::iorq_r(address_space &space, offs_t offset, uint8_t data, bool &prtov) { if (m_card != nullptr) { @@ -119,7 +119,7 @@ UINT8 newbrain_expansion_slot_t::iorq_r(address_space &space, offs_t offset, UIN // iorq_w - I/O request write //------------------------------------------------- -void newbrain_expansion_slot_t::iorq_w(address_space &space, offs_t offset, UINT8 data, bool &prtov) +void newbrain_expansion_slot_t::iorq_w(address_space &space, offs_t offset, uint8_t data, bool &prtov) { if (m_card != nullptr) { diff --git a/src/devices/bus/newbrain/exp.h b/src/devices/bus/newbrain/exp.h index 52702a08b85..a81194945df 100644 --- a/src/devices/bus/newbrain/exp.h +++ b/src/devices/bus/newbrain/exp.h @@ -74,15 +74,15 @@ class newbrain_expansion_slot_t : public device_t, { public: // construction/destruction - newbrain_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + newbrain_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~newbrain_expansion_slot_t() { } // computer interface - UINT8 mreq_r(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh); - void mreq_w(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh); + uint8_t mreq_r(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh); + void mreq_w(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh); - UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data, bool &prtov); - void iorq_w(address_space &space, offs_t offset, UINT8 data, bool &prtov); + uint8_t iorq_r(address_space &space, offs_t offset, uint8_t data, bool &prtov); + void iorq_w(address_space &space, offs_t offset, uint8_t data, bool &prtov); protected: // device-level overrides @@ -104,12 +104,12 @@ public: virtual ~device_newbrain_expansion_slot_interface() { } // memory access - virtual UINT8 mreq_r(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) { return data; }; - virtual void mreq_w(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) { }; + virtual uint8_t mreq_r(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) { return data; }; + virtual void mreq_w(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) { }; // I/O access - virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data, bool &prtov) { return data; }; - virtual void iorq_w(address_space &space, offs_t offset, UINT8 data, bool &prtov) { }; + virtual uint8_t iorq_r(address_space &space, offs_t offset, uint8_t data, bool &prtov) { return data; }; + virtual void iorq_w(address_space &space, offs_t offset, uint8_t data, bool &prtov) { }; protected: newbrain_expansion_slot_t *m_slot; diff --git a/src/devices/bus/newbrain/fdc.cpp b/src/devices/bus/newbrain/fdc.cpp index d4fadb9df70..f8965589fb5 100644 --- a/src/devices/bus/newbrain/fdc.cpp +++ b/src/devices/bus/newbrain/fdc.cpp @@ -136,7 +136,7 @@ machine_config_constructor newbrain_fdc_t::device_mconfig_additions() const // newbrain_fdc_t - constructor //------------------------------------------------- -newbrain_fdc_t::newbrain_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +newbrain_fdc_t::newbrain_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEWBRAIN_FDC, "NewBrain FDC", tag, owner, clock, "newbrain_fdc", __FILE__), device_newbrain_expansion_slot_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), @@ -183,7 +183,7 @@ void newbrain_fdc_t::device_reset() // mreq_r - memory request read //------------------------------------------------- -UINT8 newbrain_fdc_t::mreq_r(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) +uint8_t newbrain_fdc_t::mreq_r(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) { return m_exp->mreq_r(space, offset, data, romov, exrm, raminh); } @@ -193,7 +193,7 @@ UINT8 newbrain_fdc_t::mreq_r(address_space &space, offs_t offset, UINT8 data, bo // mreq_w - memory request write //------------------------------------------------- -void newbrain_fdc_t::mreq_w(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) +void newbrain_fdc_t::mreq_w(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) { m_exp->mreq_w(space, offset, data, romov, exrm, raminh); } @@ -203,7 +203,7 @@ void newbrain_fdc_t::mreq_w(address_space &space, offs_t offset, UINT8 data, boo // iorq_r - I/O request read //------------------------------------------------- -UINT8 newbrain_fdc_t::iorq_r(address_space &space, offs_t offset, UINT8 data, bool &prtov) +uint8_t newbrain_fdc_t::iorq_r(address_space &space, offs_t offset, uint8_t data, bool &prtov) { return m_exp->iorq_r(space, offset, data, prtov); } @@ -213,7 +213,7 @@ UINT8 newbrain_fdc_t::iorq_r(address_space &space, offs_t offset, UINT8 data, bo // iorq_w - I/O request write //------------------------------------------------- -void newbrain_fdc_t::iorq_w(address_space &space, offs_t offset, UINT8 data, bool &prtov) +void newbrain_fdc_t::iorq_w(address_space &space, offs_t offset, uint8_t data, bool &prtov) { m_exp->iorq_w(space, offset, data, prtov); diff --git a/src/devices/bus/newbrain/fdc.h b/src/devices/bus/newbrain/fdc.h index fdb0e5f4fca..2d2d2bc8576 100644 --- a/src/devices/bus/newbrain/fdc.h +++ b/src/devices/bus/newbrain/fdc.h @@ -29,7 +29,7 @@ class newbrain_fdc_t : public device_t, { public: // construction/destruction - newbrain_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + newbrain_fdc_t(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; @@ -46,10 +46,10 @@ protected: virtual void device_reset() override; // device_newbrain_expansion_slot_interface overrides - virtual UINT8 mreq_r(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) override; - virtual void mreq_w(address_space &space, offs_t offset, UINT8 data, bool &romov, int &exrm, bool &raminh) override; - virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data, bool &prtov) override; - virtual void iorq_w(address_space &space, offs_t offset, UINT8 data, bool &prtov) override; + virtual uint8_t mreq_r(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) override; + virtual void mreq_w(address_space &space, offs_t offset, uint8_t data, bool &romov, int &exrm, bool &raminh) override; + virtual uint8_t iorq_r(address_space &space, offs_t offset, uint8_t data, bool &prtov) override; + virtual void iorq_w(address_space &space, offs_t offset, uint8_t data, bool &prtov) override; private: required_device m_maincpu; diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp index cf73062f82b..4df5c1c5560 100644 --- a/src/devices/bus/nubus/nubus.cpp +++ b/src/devices/bus/nubus/nubus.cpp @@ -25,7 +25,7 @@ const device_type NUBUS_SLOT = &device_creator; //------------------------------------------------- // nubus_slot_device - constructor //------------------------------------------------- -nubus_slot_device::nubus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_slot_device::nubus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_SLOT, "NUBUS_SLOT", tag, owner, clock, "nubus_slot", __FILE__), device_slot_interface(mconfig, *this), m_nubus_tag(nullptr), @@ -33,7 +33,7 @@ nubus_slot_device::nubus_slot_device(const machine_config &mconfig, const char * { } -nubus_slot_device::nubus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +nubus_slot_device::nubus_slot_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_slot_interface(mconfig, *this), m_nubus_tag(nullptr), m_nubus_slottag(nullptr) { @@ -77,7 +77,7 @@ void nubus_device::static_set_cputag(device_t &device, const char *tag) // nubus_device - constructor //------------------------------------------------- -nubus_device::nubus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_device::nubus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS, "NUBUS", tag, owner, clock, "nubus", __FILE__), m_maincpu(nullptr), m_out_irq9_cb(*this), m_out_irqa_cb(*this), @@ -88,7 +88,7 @@ nubus_device::nubus_device(const machine_config &mconfig, const char *tag, devic { } -nubus_device::nubus_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) : +nubus_device::nubus_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_maincpu(nullptr), m_out_irq9_cb(*this), m_out_irqa_cb(*this), @@ -127,7 +127,7 @@ void nubus_device::add_nubus_card(device_nubus_card_interface *card) m_device_list.append(*card); } -void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, UINT32 mask) +void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask) { m_maincpu = machine().device(m_cputag); int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; @@ -137,14 +137,14 @@ void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhand m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); } } -void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, UINT32 mask) +void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, uint32_t mask) { m_maincpu = machine().device(m_cputag); int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; @@ -154,14 +154,14 @@ void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhan m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); } } -void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, UINT32 mask) +void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, uint32_t mask) { m_maincpu = machine().device(m_cputag); int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; @@ -171,14 +171,14 @@ void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhan m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); } } -void nubus_device::install_readonly_device(offs_t start, offs_t end, read32_delegate rhandler, UINT32 mask) +void nubus_device::install_readonly_device(offs_t start, offs_t end, read32_delegate rhandler, uint32_t mask) { m_maincpu = machine().device(m_cputag); int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; @@ -188,14 +188,14 @@ void nubus_device::install_readonly_device(offs_t start, offs_t end, read32_dele m_maincpu->space(AS_PROGRAM).install_read_handler(start, end, rhandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_read_handler(start, end, rhandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM).install_read_handler(start, end, rhandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); } } -void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_delegate whandler, UINT32 mask) +void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_delegate whandler, uint32_t mask) { m_maincpu = machine().device(m_cputag); int buswidth = m_maincpu->space_config(AS_PROGRAM)->m_databus_width; @@ -205,14 +205,14 @@ void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_de m_maincpu->space(AS_PROGRAM).install_write_handler(start, end, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_write_handler(start, end, whandler, ((UINT64)mask<<32)|mask); + m_maincpu->space(AS_PROGRAM).install_write_handler(start, end, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); } } -void nubus_device::install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data) +void nubus_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data) { // printf("install_bank: %s @ %x->%x\n", tag, start, end); m_maincpu = machine().device(m_cputag); @@ -312,7 +312,7 @@ void device_nubus_card_interface::set_nubus_device() m_nubus->add_nubus_card(this); } -void device_nubus_card_interface::install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data) +void device_nubus_card_interface::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data) { char bank[256]; @@ -328,17 +328,17 @@ void device_nubus_card_interface::install_declaration_rom(device_t *dev, const c { bool inverted = false; - UINT8 *rom = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->base(); - UINT32 romlen = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->bytes(); + uint8_t *rom = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->base(); + uint32_t romlen = device().machine().root_device().memregion(dev->subtag(romregion).c_str())->bytes(); // printf("ROM length is %x, last bytes are %02x %02x\n", romlen, rom[romlen-2], rom[romlen-1]); if (reverse_rom) { - UINT8 temp; - UINT32 endptr = romlen-1; + uint8_t temp; + uint32_t endptr = romlen-1; - for (UINT32 idx = 0; idx < romlen / 2; idx++) + for (uint32_t idx = 0; idx < romlen / 2; idx++) { temp = rom[idx]; rom[idx] = rom[endptr]; @@ -347,7 +347,7 @@ void device_nubus_card_interface::install_declaration_rom(device_t *dev, const c } } - UINT8 byteLanes = rom[romlen-1]; + uint8_t byteLanes = rom[romlen-1]; // check if all bits are inverted if (rom[romlen-2] == 0xff) { @@ -459,7 +459,7 @@ void device_nubus_card_interface::install_declaration_rom(device_t *dev, const c } // now install the ROM - UINT32 addr = get_slotspace() + 0x01000000; + uint32_t addr = get_slotspace() + 0x01000000; char bankname[128]; strcpy(bankname, "rom_"); strcat(bankname, m_nubus_slottag); @@ -467,7 +467,7 @@ void device_nubus_card_interface::install_declaration_rom(device_t *dev, const c // printf("Installing ROM at %x, length %x\n", addr, romlen); if (mirror_all_mb) // mirror the declaration ROM across all 16 megs of the slot space { - UINT32 off = 0; + uint32_t off = 0; while(off < 0x1000000) { m_nubus->install_bank(addr + off, addr+off+romlen-1, bankname, &m_declaration_rom[0]); off += romlen; diff --git a/src/devices/bus/nubus/nubus.h b/src/devices/bus/nubus/nubus.h index cd0b69c1d27..5caaefb29fb 100644 --- a/src/devices/bus/nubus/nubus.h +++ b/src/devices/bus/nubus/nubus.h @@ -64,8 +64,8 @@ class nubus_slot_device : public device_t, { public: // construction/destruction - nubus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + nubus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_slot_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-level overrides virtual void device_start() override; @@ -87,8 +87,8 @@ class nubus_device : public device_t { public: // construction/destruction - nubus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_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); + nubus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_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); ~nubus_device() { m_device_list.detach_all(); } // inline configuration @@ -101,12 +101,12 @@ public: template static devcb_base &set_out_irqe_callback(device_t &device, _Object object) { return downcast(device).m_out_irqe_cb.set_callback(object); } void add_nubus_card(device_nubus_card_interface *card); - void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, UINT32 mask=0xffffffff); - void install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, UINT32 mask=0xffffffff); - void install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, UINT32 mask=0xffffffff); - void install_readonly_device(offs_t start, offs_t end, read32_delegate rhandler, UINT32 mask=0xffffffff); - void install_writeonly_device(offs_t start, offs_t end, write32_delegate whandler, UINT32 mask=0xffffffff); - void install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data); + void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask=0xffffffff); + void install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, uint32_t mask=0xffffffff); + void install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, uint32_t mask=0xffffffff); + void install_readonly_device(offs_t start, offs_t end, read32_delegate rhandler, uint32_t mask=0xffffffff); + void install_writeonly_device(offs_t start, offs_t end, write32_delegate whandler, uint32_t mask=0xffffffff); + void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data); void set_irq_line(int slot, int state); DECLARE_WRITE_LINE_MEMBER( irq9_w ); @@ -156,10 +156,10 @@ public: // helper functions for card devices void install_declaration_rom(device_t *dev, const char *romregion, bool mirror_all_mb = false, bool reverse_rom = false); - void install_bank(offs_t start, offs_t end, const char *tag, UINT8 *data); + void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data); - UINT32 get_slotspace() { return 0xf0000000 | (m_slot<<24); } - UINT32 get_super_slotspace() { return m_slot<<28; } + uint32_t get_slotspace() { return 0xf0000000 | (m_slot<<24); } + uint32_t get_super_slotspace() { return m_slot<<28; } void raise_slot_irq() { m_nubus->set_irq_line(m_slot, ASSERT_LINE); } void lower_slot_irq() { m_nubus->set_irq_line(m_slot, CLEAR_LINE); } @@ -171,7 +171,7 @@ public: const char *m_nubus_tag, *m_nubus_slottag; int m_slot; device_nubus_card_interface *m_next; - std::vector m_declaration_rom; + std::vector m_declaration_rom; }; #endif /* __NUBUS_H__ */ diff --git a/src/devices/bus/nubus/nubus_48gc.cpp b/src/devices/bus/nubus/nubus_48gc.cpp index 2a60b1e5bfb..0906d9dfeb6 100644 --- a/src/devices/bus/nubus/nubus_48gc.cpp +++ b/src/devices/bus/nubus/nubus_48gc.cpp @@ -76,7 +76,7 @@ const tiny_rom_entry *nubus_824gc_device::device_rom_region() const // jmfb_device - constructor //------------------------------------------------- -jmfb_device::jmfb_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) : +jmfb_device::jmfb_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_screen(nullptr), m_timer(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_stride(0), m_base(0), m_count(0), m_clutoffs(0), m_xres(0), m_yres(0), m_is824(false) @@ -85,13 +85,13 @@ jmfb_device::jmfb_device(const machine_config &mconfig, device_type type, const m_screen_tag = m_assembled_tag.c_str(); } -nubus_48gc_device::nubus_48gc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_48gc_device::nubus_48gc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : jmfb_device(mconfig, NUBUS_48GC, "Apple 4*8 video card", tag, owner, clock, "nb_48gc", __FILE__) { m_is824 = false; } -nubus_824gc_device::nubus_824gc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_824gc_device::nubus_824gc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : jmfb_device(mconfig, NUBUS_824GC, "Apple 8*24 video card", tag, owner, clock, "nb_824gc", __FILE__) { m_is824 = true; @@ -103,7 +103,7 @@ nubus_824gc_device::nubus_824gc_device(const machine_config &mconfig, const char void jmfb_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -157,12 +157,12 @@ void jmfb_device::device_timer(emu_timer &timer, device_timer_id tid, int param, m_timer->adjust(m_screen->time_until_pos(479, 0), 0); } -UINT32 jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline, *base; + uint32_t *scanline, *base; int x, y; - UINT8 *vram8 = &m_vram[0]; - UINT8 pixels; + uint8_t *vram8 = &m_vram[0]; + uint8_t pixels; // first time? kick off the VBL timer if (!m_screen) @@ -243,7 +243,7 @@ UINT32 jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c for (y = 0; y < m_yres; y++) { scanline = &bitmap.pix32(y); - base = (UINT32 *)&m_vram[y * m_stride]; + base = (uint32_t *)&m_vram[y * m_stride]; for (x = 0; x < m_xres; x++) { *scanline++ = *base++; diff --git a/src/devices/bus/nubus/nubus_48gc.h b/src/devices/bus/nubus/nubus_48gc.h index 32c333113f7..6a435f8c098 100644 --- a/src/devices/bus/nubus/nubus_48gc.h +++ b/src/devices/bus/nubus/nubus_48gc.h @@ -21,14 +21,14 @@ class jmfb_device : { public: // construction/destruction - jmfb_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); + jmfb_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); screen_device *m_screen; emu_timer *m_timer; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(mac_48gc_w); public: - std::vector m_vram; - UINT32 m_mode, m_vbl_disable, m_toggle, m_stride, m_base; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; - UINT32 m_registers[0x100]; + std::vector m_vram; + uint32_t m_mode, m_vbl_disable, m_toggle, m_stride, m_base; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; + uint32_t m_registers[0x100]; int m_xres, m_yres; bool m_is824; std::string m_assembled_tag; @@ -53,13 +53,13 @@ public: class nubus_48gc_device : public jmfb_device { public: - nubus_48gc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nubus_48gc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class nubus_824gc_device : public jmfb_device { public: - nubus_824gc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nubus_824gc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/devices/bus/nubus/nubus_asntmc3b.cpp b/src/devices/bus/nubus/nubus_asntmc3b.cpp index da9b4e9f803..09a872f6de4 100644 --- a/src/devices/bus/nubus/nubus_asntmc3b.cpp +++ b/src/devices/bus/nubus/nubus_asntmc3b.cpp @@ -76,19 +76,19 @@ const tiny_rom_entry *nubus_appleenet_device::device_rom_region() const // nubus_mac8390_device - constructor //------------------------------------------------- -nubus_mac8390_device::nubus_mac8390_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) : +nubus_mac8390_device::nubus_mac8390_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, NUBUS_ASNTMC3NB, name, tag, owner, clock, shortname, source), device_nubus_card_interface(mconfig, *this), m_dp83902(*this, MAC8390_839X) { } -nubus_asntmc3nb_device::nubus_asntmc3nb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_asntmc3nb_device::nubus_asntmc3nb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nubus_mac8390_device(mconfig, NUBUS_ASNTMC3NB, "Asante MC3NB Ethernet card", tag, owner, clock, "nb_amc3b", __FILE__) { } -nubus_appleenet_device::nubus_appleenet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_appleenet_device::nubus_appleenet_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nubus_mac8390_device(mconfig, NUBUS_APPLEENET, "Apple NuBus Ethernet card", tag, owner, clock, "nb_aenet", __FILE__) { } @@ -99,9 +99,9 @@ nubus_appleenet_device::nubus_appleenet_device(const machine_config &mconfig, co void nubus_mac8390_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; char mac[7]; - UINT32 num = rand(); + uint32_t num = rand(); memset(m_prom, 0x57, 16); sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff); mac[0] = mac[1] = 0; // avoid gcc warning @@ -116,7 +116,7 @@ void nubus_mac8390_device::device_start() // printf("[ASNTMC3NB %p] slotspace = %x\n", this, slotspace); // TODO: move 24-bit mirroring down into nubus.c - UINT32 ofs_24bit = m_slot<<20; + uint32_t ofs_24bit = m_slot<<20; m_nubus->install_device(slotspace+0xd0000, slotspace+0xdffff, read8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_r), this), write8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_w), this)); m_nubus->install_device(slotspace+0xe0000, slotspace+0xe003f, read32_delegate(FUNC(nubus_mac8390_device::en_r), this), write32_delegate(FUNC(nubus_mac8390_device::en_w), this)); m_nubus->install_device(slotspace+0xd0000+ofs_24bit, slotspace+0xdffff+ofs_24bit, read8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_r), this), write8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_w), this)); diff --git a/src/devices/bus/nubus/nubus_asntmc3b.h b/src/devices/bus/nubus/nubus_asntmc3b.h index 0f88175df5b..799f4c41470 100644 --- a/src/devices/bus/nubus/nubus_asntmc3b.h +++ b/src/devices/bus/nubus/nubus_asntmc3b.h @@ -21,7 +21,7 @@ class nubus_mac8390_device : { public: // construction/destruction - nubus_mac8390_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); + nubus_mac8390_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -44,20 +44,20 @@ protected: required_device m_dp83902; private: - UINT8 m_ram[0x20000]; - UINT8 m_prom[16]; + uint8_t m_ram[0x20000]; + uint8_t m_prom[16]; }; class nubus_asntmc3nb_device : public nubus_mac8390_device { public: - nubus_asntmc3nb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nubus_asntmc3nb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class nubus_appleenet_device : public nubus_mac8390_device { public: - nubus_appleenet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nubus_appleenet_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; diff --git a/src/devices/bus/nubus/nubus_cb264.cpp b/src/devices/bus/nubus/nubus_cb264.cpp index 04808f1520a..b7a021a0bd9 100644 --- a/src/devices/bus/nubus/nubus_cb264.cpp +++ b/src/devices/bus/nubus/nubus_cb264.cpp @@ -69,13 +69,13 @@ const tiny_rom_entry *nubus_cb264_device::device_rom_region() const // nubus_cb264_device - constructor //------------------------------------------------- -nubus_cb264_device::nubus_cb264_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_cb264_device::nubus_cb264_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_CB264, "RasterOps ColorBoard 264 video card", tag, owner, clock, "nb_cb264", __FILE__), device_nubus_card_interface(mconfig, *this), m_cb264_mode(0), m_cb264_vbl_disable(0), m_cb264_toggle(0), m_count(0), m_clutoffs(0) { } -nubus_cb264_device::nubus_cb264_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) : +nubus_cb264_device::nubus_cb264_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_nubus_card_interface(mconfig, *this), m_cb264_mode(0), m_cb264_vbl_disable(0), m_cb264_toggle(0), m_count(0), m_clutoffs(0) { @@ -87,7 +87,7 @@ nubus_cb264_device::nubus_cb264_device(const machine_config &mconfig, device_typ void nubus_cb264_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -125,11 +125,11 @@ void nubus_cb264_device::device_reset() ***************************************************************************/ -UINT32 nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline, *base; + uint32_t *scanline, *base; int x, y; - UINT8 pixels; + uint8_t pixels; if (!m_cb264_vbl_disable) { @@ -205,7 +205,7 @@ UINT32 nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &bi case 4: // 24 bpp case 7: // ??? { - UINT32 *vram32 = (UINT32 *)&m_vram[0]; + uint32_t *vram32 = (uint32_t *)&m_vram[0]; for (y = 0; y < 480; y++) { diff --git a/src/devices/bus/nubus/nubus_cb264.h b/src/devices/bus/nubus/nubus_cb264.h index 5caa7cf6545..766adfd2e89 100644 --- a/src/devices/bus/nubus/nubus_cb264.h +++ b/src/devices/bus/nubus/nubus_cb264.h @@ -20,14 +20,14 @@ class nubus_cb264_device : { public: // construction/destruction - nubus_cb264_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_cb264_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); + nubus_cb264_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_cb264_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -39,9 +39,9 @@ protected: DECLARE_WRITE32_MEMBER(cb264_ramdac_w); public: - std::vector m_vram; - UINT32 m_cb264_mode, m_cb264_vbl_disable, m_cb264_toggle; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t m_cb264_mode, m_cb264_vbl_disable, m_cb264_toggle; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; }; diff --git a/src/devices/bus/nubus/nubus_image.cpp b/src/devices/bus/nubus/nubus_image.cpp index 4b7901891ff..7902bf69669 100644 --- a/src/devices/bus/nubus/nubus_image.cpp +++ b/src/devices/bus/nubus/nubus_image.cpp @@ -19,11 +19,11 @@ // on big-endian, these are NOPs. (TODO: hey, where did WORDS_BIGENDIAN go since the GENie transition?!) #if defined(__ppc__) || defined (__PPC__) || defined(__ppc64__) || defined(__PPC64__) -static UINT32 ni_htonl(UINT32 x) { return x; } -static UINT32 ni_ntohl(UINT32 x) { return x; } +static uint32_t ni_htonl(uint32_t x) { return x; } +static uint32_t ni_ntohl(uint32_t x) { return x; } #else -static UINT32 ni_htonl(UINT32 x) { return flipendian_int32(x); } -static UINT32 ni_ntohl(UINT32 x) { return flipendian_int32(x); } +static uint32_t ni_htonl(uint32_t x) { return flipendian_int32(x); } +static uint32_t ni_ntohl(uint32_t x) { return flipendian_int32(x); } #endif @@ -34,7 +34,7 @@ class messimg_disk_image_device : public device_t, { public: // construction/destruction - messimg_disk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + messimg_disk_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_QUICKLOAD; } @@ -55,8 +55,8 @@ public: virtual void device_start() override; virtual void device_reset() override; public: - UINT32 m_size; - std::unique_ptr m_data; + uint32_t m_size; + std::unique_ptr m_data; bool m_ejected; }; @@ -66,7 +66,7 @@ extern const device_type MESSIMG_DISK; const device_type MESSIMG_DISK = &device_creator; -messimg_disk_image_device::messimg_disk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +messimg_disk_image_device::messimg_disk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MESSIMG_DISK, "Mac image", tag, owner, clock, "messimg_disk_image", __FILE__), device_image_interface(mconfig, *this), m_size(0), m_data(nullptr), m_ejected(false) { @@ -88,14 +88,14 @@ void messimg_disk_image_device::device_start() if (exists() && fseek(0, SEEK_END) == 0) { - m_size = (UINT32)ftell(); + m_size = (uint32_t)ftell(); } } image_init_result messimg_disk_image_device::call_load() { fseek(0, SEEK_END); - m_size = (UINT32)ftell(); + m_size = (uint32_t)ftell(); if (m_size > (256*1024*1024)) { printf("Mac image too large: must be 256MB or less!\n"); @@ -103,7 +103,7 @@ image_init_result messimg_disk_image_device::call_load() return image_init_result::FAIL; } - m_data = make_unique_clear(m_size); + m_data = make_unique_clear(m_size); fseek(0, SEEK_SET); fread(m_data.get(), m_size); m_ejected = false; @@ -171,13 +171,13 @@ const tiny_rom_entry *nubus_image_device::device_rom_region() const // nubus_image_device - constructor //------------------------------------------------- -nubus_image_device::nubus_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_image_device::nubus_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_IMAGE, "Disk Image Pseudo-Card", tag, owner, clock, "nb_image", __FILE__), device_nubus_card_interface(mconfig, *this), m_image(nullptr) { } -nubus_image_device::nubus_image_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) : +nubus_image_device::nubus_image_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_nubus_card_interface(mconfig, *this), m_image(nullptr) { @@ -189,8 +189,8 @@ nubus_image_device::nubus_image_device(const machine_config &mconfig, device_typ void nubus_image_device::device_start() { - UINT32 slotspace; - UINT32 superslotspace; + uint32_t slotspace; + uint32_t superslotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -253,7 +253,7 @@ READ32_MEMBER( nubus_image_device::image_r ) WRITE32_MEMBER( nubus_image_device::image_super_w ) { - UINT32 *image = (UINT32*)m_image->m_data.get(); + uint32_t *image = (uint32_t*)m_image->m_data.get(); data = ((data & 0xff) << 24) | ((data & 0xff00) << 8) | ((data & 0xff0000) >> 8) | ((data & 0xff000000) >> 24); mem_mask = ((mem_mask & 0xff) << 24) | ((mem_mask & 0xff00) << 8) | ((mem_mask & 0xff0000) >> 8) | ((mem_mask & 0xff000000) >> 24); @@ -262,8 +262,8 @@ WRITE32_MEMBER( nubus_image_device::image_super_w ) READ32_MEMBER( nubus_image_device::image_super_r ) { - UINT32 *image = (UINT32*)m_image->m_data.get(); - UINT32 data = image[offset]; + uint32_t *image = (uint32_t*)m_image->m_data.get(); + uint32_t data = image[offset]; return ((data & 0xff) << 24) | ((data & 0xff00) << 8) | ((data & 0xff0000) >> 8) | ((data & 0xff000000) >> 24); } @@ -271,7 +271,7 @@ WRITE32_MEMBER( nubus_image_device::file_cmd_w ) { const osd::directory::entry *dp; char fullpath[1024]; - UINT64 filesize; + uint64_t filesize; // data = ((data & 0xff) << 24) | ((data & 0xff00) << 8) | ((data & 0xff0000) >> 8) | ((data & 0xff000000) >> 24); filectx.curcmd = data; @@ -372,12 +372,12 @@ READ32_MEMBER( nubus_image_device::file_len_r ) WRITE32_MEMBER( nubus_image_device::file_name_w ) { - ((UINT32*)(filectx.filename))[offset] = ni_ntohl(data); + ((uint32_t*)(filectx.filename))[offset] = ni_ntohl(data); } READ32_MEMBER( nubus_image_device::file_name_r ) { - UINT32 ret; - ret = ni_htonl(((UINT32*)(filectx.filename))[offset]); + uint32_t ret; + ret = ni_htonl(((uint32_t*)(filectx.filename))[offset]); return ret; } diff --git a/src/devices/bus/nubus/nubus_image.h b/src/devices/bus/nubus/nubus_image.h index 1b86eed9636..a13de21c624 100644 --- a/src/devices/bus/nubus/nubus_image.h +++ b/src/devices/bus/nubus/nubus_image.h @@ -15,13 +15,13 @@ class messimg_disk_image_device; struct nbfilectx { - UINT32 curcmd; - UINT8 filename[128]; - UINT8 curdir[1024]; + uint32_t curcmd; + uint8_t filename[128]; + uint8_t curdir[1024]; osd::directory::ptr dirp; osd_file::ptr fd; - UINT64 filelen; - UINT32 bytecount; + uint64_t filelen; + uint32_t bytecount; }; // ======================> nubus_image_device @@ -32,8 +32,8 @@ class nubus_image_device : { public: // construction/destruction - nubus_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_image_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); + nubus_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_image_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/nubus/nubus_m2hires.cpp b/src/devices/bus/nubus/nubus_m2hires.cpp index 98217981055..e169586d884 100644 --- a/src/devices/bus/nubus/nubus_m2hires.cpp +++ b/src/devices/bus/nubus/nubus_m2hires.cpp @@ -65,7 +65,7 @@ const tiny_rom_entry *nubus_m2hires_device::device_rom_region() const // nubus_m2hires_device - constructor //------------------------------------------------- -nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_M2HIRES, "Macintosh II Hi-Resolution video card", tag, owner, clock, "nb_m2hr", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -74,7 +74,7 @@ nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, const m_screen_tag = m_assembled_tag.c_str(); } -nubus_m2hires_device::nubus_m2hires_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) : +nubus_m2hires_device::nubus_m2hires_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -89,7 +89,7 @@ nubus_m2hires_device::nubus_m2hires_device(const machine_config &mconfig, device void nubus_m2hires_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -100,7 +100,7 @@ void nubus_m2hires_device::device_start() // printf("[m2hires %p] slotspace = %x\n", this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_m2hires_device::vram_r), this), write32_delegate(FUNC(nubus_m2hires_device::vram_w), this)); m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_m2hires_device::vram_r), this), write32_delegate(FUNC(nubus_m2hires_device::vram_w), this)); @@ -144,11 +144,11 @@ void nubus_m2hires_device::device_timer(emu_timer &timer, device_timer_id tid, i ***************************************************************************/ -UINT32 nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = &m_vram[0x20]; diff --git a/src/devices/bus/nubus/nubus_m2hires.h b/src/devices/bus/nubus/nubus_m2hires.h index 1f5f932e333..0caa4c249ff 100644 --- a/src/devices/bus/nubus/nubus_m2hires.h +++ b/src/devices/bus/nubus/nubus_m2hires.h @@ -21,14 +21,14 @@ class nubus_m2hires_device : { public: // construction/destruction - nubus_m2hires_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_m2hires_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); + nubus_m2hires_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_m2hires_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable, m_toggle; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable, m_toggle; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; }; diff --git a/src/devices/bus/nubus/nubus_m2video.cpp b/src/devices/bus/nubus/nubus_m2video.cpp index 1d8134887f8..04db8cffb1b 100644 --- a/src/devices/bus/nubus/nubus_m2video.cpp +++ b/src/devices/bus/nubus/nubus_m2video.cpp @@ -66,7 +66,7 @@ const tiny_rom_entry *nubus_m2video_device::device_rom_region() const // nubus_m2video_device - constructor //------------------------------------------------- -nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_M2VIDEO, "Macintosh II Video Card", tag, owner, clock, "nb_m2vc", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -75,7 +75,7 @@ nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, const m_screen_tag = m_assembled_tag.c_str(); } -nubus_m2video_device::nubus_m2video_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) : +nubus_m2video_device::nubus_m2video_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -90,7 +90,7 @@ nubus_m2video_device::nubus_m2video_device(const machine_config &mconfig, device void nubus_m2video_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -101,7 +101,7 @@ void nubus_m2video_device::device_start() // printf("[m2video %p] slotspace = %x\n", this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_m2video_device::vram_r), this), write32_delegate(FUNC(nubus_m2video_device::vram_w), this)); m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_m2video_device::vram_r), this), write32_delegate(FUNC(nubus_m2video_device::vram_w), this)); @@ -145,11 +145,11 @@ void nubus_m2video_device::device_timer(emu_timer &timer, device_timer_id tid, i ***************************************************************************/ -UINT32 nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = &m_vram[0x20]; diff --git a/src/devices/bus/nubus/nubus_m2video.h b/src/devices/bus/nubus/nubus_m2video.h index 1ed9e33f3c5..949a10e3f9b 100644 --- a/src/devices/bus/nubus/nubus_m2video.h +++ b/src/devices/bus/nubus/nubus_m2video.h @@ -21,14 +21,14 @@ class nubus_m2video_device : { public: // construction/destruction - nubus_m2video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_m2video_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); + nubus_m2video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_m2video_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable, m_toggle; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable, m_toggle; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; }; diff --git a/src/devices/bus/nubus/nubus_radiustpd.cpp b/src/devices/bus/nubus/nubus_radiustpd.cpp index 42053976689..e12275ab710 100644 --- a/src/devices/bus/nubus/nubus_radiustpd.cpp +++ b/src/devices/bus/nubus/nubus_radiustpd.cpp @@ -65,7 +65,7 @@ const tiny_rom_entry *nubus_radiustpd_device::device_rom_region() const // nubus_radiustpd_device - constructor //------------------------------------------------- -nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_RADIUSTPD, "Radius Two Page Display video card", tag, owner, clock, "nb_rtpd", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -74,7 +74,7 @@ nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, co m_screen_tag = m_assembled_tag.c_str(); } -nubus_radiustpd_device::nubus_radiustpd_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) : +nubus_radiustpd_device::nubus_radiustpd_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -89,7 +89,7 @@ nubus_radiustpd_device::nubus_radiustpd_device(const machine_config &mconfig, de void nubus_radiustpd_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -100,7 +100,7 @@ void nubus_radiustpd_device::device_start() printf("[radiustpd %p] slotspace = %x\n", (void *)this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_radiustpd_device::vram_r), this), write32_delegate(FUNC(nubus_radiustpd_device::vram_w), this)); m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_radiustpd_device::vram_r), this), write32_delegate(FUNC(nubus_radiustpd_device::vram_w), this)); @@ -145,11 +145,11 @@ void nubus_radiustpd_device::device_timer(emu_timer &timer, device_timer_id tid, ***************************************************************************/ -UINT32 nubus_radiustpd_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_radiustpd_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = &m_vram[0x200]; diff --git a/src/devices/bus/nubus/nubus_radiustpd.h b/src/devices/bus/nubus/nubus_radiustpd.h index e227913a69b..4643633a6a7 100644 --- a/src/devices/bus/nubus/nubus_radiustpd.h +++ b/src/devices/bus/nubus/nubus_radiustpd.h @@ -21,14 +21,14 @@ class nubus_radiustpd_device : { public: // construction/destruction - nubus_radiustpd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_radiustpd_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); + nubus_radiustpd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_radiustpd_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable, m_toggle; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable, m_toggle; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; }; diff --git a/src/devices/bus/nubus/nubus_spec8.cpp b/src/devices/bus/nubus/nubus_spec8.cpp index fbe55114daf..db47b70cd83 100644 --- a/src/devices/bus/nubus/nubus_spec8.cpp +++ b/src/devices/bus/nubus/nubus_spec8.cpp @@ -67,7 +67,7 @@ const tiny_rom_entry *nubus_spec8s3_device::device_rom_region() const // nubus_spec8s3_device - constructor //------------------------------------------------- -nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_SPEC8S3, "SuperMac Spectrum/8 Series III video card", tag, owner, clock, "nb_sp8s3", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vbl_pending(false), m_parameter(0) @@ -76,7 +76,7 @@ nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, const m_screen_tag = m_assembled_tag.c_str(); } -nubus_spec8s3_device::nubus_spec8s3_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) : +nubus_spec8s3_device::nubus_spec8s3_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_vbl_pending(false), m_parameter(0) @@ -91,7 +91,7 @@ nubus_spec8s3_device::nubus_spec8s3_device(const machine_config &mconfig, device void nubus_spec8s3_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -102,7 +102,7 @@ void nubus_spec8s3_device::device_start() // printf("[SPEC8S3 %p] slotspace = %x\n", this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_spec8s3_device::vram_r), this), write32_delegate(FUNC(nubus_spec8s3_device::vram_w), this)); m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_spec8s3_device::vram_r), this), write32_delegate(FUNC(nubus_spec8s3_device::vram_w), this)); m_nubus->install_device(slotspace+0xd0000, slotspace+0xfffff, read32_delegate(FUNC(nubus_spec8s3_device::spec8s3_r), this), write32_delegate(FUNC(nubus_spec8s3_device::spec8s3_w), this)); @@ -148,11 +148,11 @@ void nubus_spec8s3_device::device_timer(emu_timer &timer, device_timer_id tid, i ***************************************************************************/ -UINT32 nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = &m_vram[0x400]; diff --git a/src/devices/bus/nubus/nubus_spec8.h b/src/devices/bus/nubus/nubus_spec8.h index 61af612c7a6..0259cd64140 100644 --- a/src/devices/bus/nubus/nubus_spec8.h +++ b/src/devices/bus/nubus/nubus_spec8.h @@ -21,15 +21,15 @@ class nubus_spec8s3_device : { public: // construction/destruction - nubus_spec8s3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_spec8s3_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); + nubus_spec8s3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_spec8s3_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,18 +41,18 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; private: - //UINT32 m_7xxxxx_regs[0x100000/4]; + //uint32_t m_7xxxxx_regs[0x100000/4]; //int m_width, m_height, m_patofsx, m_patofsy; - //UINT32 m_vram_addr, m_vram_src; - //UINT8 m_fillbytes[256]; + //uint32_t m_vram_addr, m_vram_src; + //uint8_t m_fillbytes[256]; bool m_vbl_pending; int m_parameter; }; diff --git a/src/devices/bus/nubus/nubus_specpdq.cpp b/src/devices/bus/nubus/nubus_specpdq.cpp index a7995cc1ff0..2926d1c2faa 100644 --- a/src/devices/bus/nubus/nubus_specpdq.cpp +++ b/src/devices/bus/nubus/nubus_specpdq.cpp @@ -82,7 +82,7 @@ const tiny_rom_entry *nubus_specpdq_device::device_rom_region() const // nubus_specpdq_device - constructor //------------------------------------------------- -nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_SPECPDQ, "SuperMac Spectrum PDQ video card", tag, owner, clock, "nb_spdq", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_width(0), m_height(0), m_patofsx(0), m_patofsy(0), m_vram_addr(0), m_vram_src(0), @@ -92,7 +92,7 @@ nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, const m_screen_tag = m_assembled_tag.c_str(); } -nubus_specpdq_device::nubus_specpdq_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) : +nubus_specpdq_device::nubus_specpdq_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_count(0), m_clutoffs(0), m_timer(nullptr), m_width(0), m_height(0), m_patofsx(0), m_patofsy(0), m_vram_addr(0), m_vram_src(0), @@ -108,7 +108,7 @@ nubus_specpdq_device::nubus_specpdq_device(const machine_config &mconfig, device void nubus_specpdq_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -119,7 +119,7 @@ void nubus_specpdq_device::device_start() // printf("[specpdq %p] slotspace = %x\n", this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_specpdq_device::vram_r), this), write32_delegate(FUNC(nubus_specpdq_device::vram_w), this)); m_nubus->install_device(slotspace+0x400000, slotspace+0xfbffff, read32_delegate(FUNC(nubus_specpdq_device::specpdq_r), this), write32_delegate(FUNC(nubus_specpdq_device::specpdq_w), this)); @@ -161,11 +161,11 @@ void nubus_specpdq_device::device_timer(emu_timer &timer, device_timer_id tid, i ***************************************************************************/ -UINT32 nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; // first time? kick off the VBL timer vram = &m_vram[0x9000]; @@ -426,7 +426,7 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w ) if (data == 2) { int x, y; - UINT8 *vram = &m_vram[m_vram_addr + m_patofsx]; // m_vram_addr is missing the low 2 bits, we add them back here + uint8_t *vram = &m_vram[m_vram_addr + m_patofsx]; // m_vram_addr is missing the low 2 bits, we add them back here // printf("Fill rectangle with %02x %02x %02x %02x, width %d height %d\n", m_fillbytes[0], m_fillbytes[1], m_fillbytes[2], m_fillbytes[3], m_width, m_height); @@ -441,8 +441,8 @@ WRITE32_MEMBER( nubus_specpdq_device::specpdq_w ) else if ((data == 0x101) || (data == 0x100)) { int x, y; - UINT8 *vram = &m_vram[m_vram_addr]; - UINT8 *vramsrc = &m_vram[m_vram_src]; + uint8_t *vram = &m_vram[m_vram_addr]; + uint8_t *vramsrc = &m_vram[m_vram_src]; // printf("Copy rectangle, width %d height %d src %x dst %x\n", m_width, m_height, m_vram_addr, m_vram_src); diff --git a/src/devices/bus/nubus/nubus_specpdq.h b/src/devices/bus/nubus/nubus_specpdq.h index 8b937ffbe64..819eac4a2f8 100644 --- a/src/devices/bus/nubus/nubus_specpdq.h +++ b/src/devices/bus/nubus/nubus_specpdq.h @@ -21,15 +21,15 @@ class nubus_specpdq_device : { public: // construction/destruction - nubus_specpdq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_specpdq_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); + nubus_specpdq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_specpdq_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,18 +41,18 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable; - UINT32 m_palette_val[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable; + uint32_t m_palette_val[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; private: - UINT32 m_7xxxxx_regs[0x100000/4]; + uint32_t m_7xxxxx_regs[0x100000/4]; int m_width, m_height, m_patofsx, m_patofsy; - UINT32 m_vram_addr, m_vram_src; - UINT8 m_fillbytes[256]; + uint32_t m_vram_addr, m_vram_src; + uint8_t m_fillbytes[256]; required_device m_palette; }; diff --git a/src/devices/bus/nubus/nubus_vikbw.cpp b/src/devices/bus/nubus/nubus_vikbw.cpp index fffdd5f7c36..1c12cbba4fa 100644 --- a/src/devices/bus/nubus/nubus_vikbw.cpp +++ b/src/devices/bus/nubus/nubus_vikbw.cpp @@ -65,13 +65,13 @@ const tiny_rom_entry *nubus_vikbw_device::device_rom_region() const // nubus_vikbw_device - constructor //------------------------------------------------- -nubus_vikbw_device::nubus_vikbw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_vikbw_device::nubus_vikbw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_VIKBW, "Moniterm Viking video card", tag, owner, clock, "nb_vikbw", __FILE__), device_nubus_card_interface(mconfig, *this), m_vbl_disable(0) { } -nubus_vikbw_device::nubus_vikbw_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) : +nubus_vikbw_device::nubus_vikbw_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_nubus_card_interface(mconfig, *this), m_vbl_disable(0) { @@ -83,7 +83,7 @@ nubus_vikbw_device::nubus_vikbw_device(const machine_config &mconfig, device_typ void nubus_vikbw_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -120,11 +120,11 @@ void nubus_vikbw_device::device_reset() ***************************************************************************/ -UINT32 nubus_vikbw_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_vikbw_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels; + uint8_t pixels; if (!m_vbl_disable) { diff --git a/src/devices/bus/nubus/nubus_vikbw.h b/src/devices/bus/nubus/nubus_vikbw.h index 1a4935a62c5..11d431dd8f0 100644 --- a/src/devices/bus/nubus/nubus_vikbw.h +++ b/src/devices/bus/nubus/nubus_vikbw.h @@ -20,14 +20,14 @@ class nubus_vikbw_device : { public: // construction/destruction - nubus_vikbw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_vikbw_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); + nubus_vikbw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_vikbw_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -39,8 +39,8 @@ protected: DECLARE_WRITE32_MEMBER(viking_disable_w); public: - std::vector m_vram; - UINT32 m_vbl_disable, m_palette[2]; + std::vector m_vram; + uint32_t m_vbl_disable, m_palette[2]; }; diff --git a/src/devices/bus/nubus/nubus_wsportrait.cpp b/src/devices/bus/nubus/nubus_wsportrait.cpp index 7a666f4ceda..e274a2d812c 100644 --- a/src/devices/bus/nubus/nubus_wsportrait.cpp +++ b/src/devices/bus/nubus/nubus_wsportrait.cpp @@ -68,7 +68,7 @@ const tiny_rom_entry *nubus_wsportrait_device::device_rom_region() const // nubus_wsportrait_device - constructor //------------------------------------------------- -nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NUBUS_WSPORTRAIT, "Macintosh II Portrait Video Card", tag, owner, clock, "nb_wspt", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -77,7 +77,7 @@ nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig, m_screen_tag = m_assembled_tag.c_str(); } -nubus_wsportrait_device::nubus_wsportrait_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) : +nubus_wsportrait_device::nubus_wsportrait_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -92,7 +92,7 @@ nubus_wsportrait_device::nubus_wsportrait_device(const machine_config &mconfig, void nubus_wsportrait_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -103,7 +103,7 @@ void nubus_wsportrait_device::device_start() printf("[wsportrait %p] slotspace = %x\n", (void *)this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_wsportrait_device::vram_r), this), write32_delegate(FUNC(nubus_wsportrait_device::vram_w), this)); m_nubus->install_device(slotspace+0x900000, slotspace+0x900000+VRAM_SIZE-1, read32_delegate(FUNC(nubus_wsportrait_device::vram_r), this), write32_delegate(FUNC(nubus_wsportrait_device::vram_w), this)); @@ -144,11 +144,11 @@ void nubus_wsportrait_device::device_timer(emu_timer &timer, device_timer_id tid ***************************************************************************/ -UINT32 nubus_wsportrait_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_wsportrait_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; // first time? kick off the VBL timer vram = &m_vram[0x80]; diff --git a/src/devices/bus/nubus/nubus_wsportrait.h b/src/devices/bus/nubus/nubus_wsportrait.h index 8a499dd632d..b6894211d82 100644 --- a/src/devices/bus/nubus/nubus_wsportrait.h +++ b/src/devices/bus/nubus/nubus_wsportrait.h @@ -21,14 +21,14 @@ class nubus_wsportrait_device : { public: // construction/destruction - nubus_wsportrait_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_wsportrait_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); + nubus_wsportrait_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_wsportrait_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable, m_toggle; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable, m_toggle; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; }; diff --git a/src/devices/bus/nubus/pds30_30hr.cpp b/src/devices/bus/nubus/pds30_30hr.cpp index 042726dbd80..492ad3a87e7 100644 --- a/src/devices/bus/nubus/pds30_30hr.cpp +++ b/src/devices/bus/nubus/pds30_30hr.cpp @@ -68,7 +68,7 @@ const tiny_rom_entry *nubus_xceed30hr_device::device_rom_region() const // nubus_xceed30hr_device - constructor //------------------------------------------------- -nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDS030_XCEED30HR, "Micron/XCEED Technology Color 30HR", tag, owner, clock, "pd3_30hr", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -77,7 +77,7 @@ nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, co m_screen_tag = m_assembled_tag.c_str(); } -nubus_xceed30hr_device::nubus_xceed30hr_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) : +nubus_xceed30hr_device::nubus_xceed30hr_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -92,7 +92,7 @@ nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, de void nubus_xceed30hr_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -103,7 +103,7 @@ void nubus_xceed30hr_device::device_start() // printf("[xceed30hr %p] slotspace = %x\n", this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_xceed30hr_device::vram_r), this), write32_delegate(FUNC(nubus_xceed30hr_device::vram_w), this)); m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_r), this), write32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_w), this)); @@ -146,11 +146,11 @@ void nubus_xceed30hr_device::device_timer(emu_timer &timer, device_timer_id tid, ***************************************************************************/ -UINT32 nubus_xceed30hr_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_xceed30hr_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = &m_vram[1024]; diff --git a/src/devices/bus/nubus/pds30_30hr.h b/src/devices/bus/nubus/pds30_30hr.h index c243e05a382..c90c3a8e6f3 100644 --- a/src/devices/bus/nubus/pds30_30hr.h +++ b/src/devices/bus/nubus/pds30_30hr.h @@ -21,14 +21,14 @@ class nubus_xceed30hr_device : { public: // construction/destruction - nubus_xceed30hr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_xceed30hr_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); + nubus_xceed30hr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_xceed30hr_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable, m_toggle; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable, m_toggle; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; }; diff --git a/src/devices/bus/nubus/pds30_cb264.cpp b/src/devices/bus/nubus/pds30_cb264.cpp index 8926db4e28a..c6d5809cb64 100644 --- a/src/devices/bus/nubus/pds30_cb264.cpp +++ b/src/devices/bus/nubus/pds30_cb264.cpp @@ -61,7 +61,7 @@ const tiny_rom_entry *nubus_cb264se30_device::device_rom_region() const // nubus_cb264se30_device - constructor //------------------------------------------------- -nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDS030_CB264SE30, "RasterOps Colorboard 264/SE30", tag, owner, clock, "pd3_c264", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -70,7 +70,7 @@ nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, co m_screen_tag = m_assembled_tag.c_str(); } -nubus_cb264se30_device::nubus_cb264se30_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) : +nubus_cb264se30_device::nubus_cb264se30_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -85,7 +85,7 @@ nubus_cb264se30_device::nubus_cb264se30_device(const machine_config &mconfig, de void nubus_cb264se30_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -96,7 +96,7 @@ void nubus_cb264se30_device::device_start() // printf("[cb264se30 %p] slotspace = %x\n", this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_cb264se30_device::vram_r), this), write32_delegate(FUNC(nubus_cb264se30_device::vram_w), this)); m_nubus->install_device(slotspace+0xf00000, slotspace+0xfeffff, read32_delegate(FUNC(nubus_cb264se30_device::cb264se30_r), this), write32_delegate(FUNC(nubus_cb264se30_device::cb264se30_w), this)); @@ -139,11 +139,11 @@ void nubus_cb264se30_device::device_timer(emu_timer &timer, device_timer_id tid, ***************************************************************************/ -UINT32 nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = &m_vram[8*1024]; @@ -215,8 +215,8 @@ UINT32 nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 case 4: // 24 bpp { - UINT32 *vram32 = (UINT32 *)&m_vram[0]; - UINT32 *base; + uint32_t *vram32 = (uint32_t *)&m_vram[0]; + uint32_t *base; for (y = 0; y < 480; y++) { diff --git a/src/devices/bus/nubus/pds30_cb264.h b/src/devices/bus/nubus/pds30_cb264.h index b327cb2aff5..0e4d7f6a488 100644 --- a/src/devices/bus/nubus/pds30_cb264.h +++ b/src/devices/bus/nubus/pds30_cb264.h @@ -21,14 +21,14 @@ class nubus_cb264se30_device : { public: // construction/destruction - nubus_cb264se30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_cb264se30_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); + nubus_cb264se30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_cb264se30_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable, m_toggle; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable, m_toggle; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; }; diff --git a/src/devices/bus/nubus/pds30_mc30.cpp b/src/devices/bus/nubus/pds30_mc30.cpp index 56719c0ffb0..3aa038639ba 100644 --- a/src/devices/bus/nubus/pds30_mc30.cpp +++ b/src/devices/bus/nubus/pds30_mc30.cpp @@ -64,7 +64,7 @@ const tiny_rom_entry *nubus_xceedmc30_device::device_rom_region() const // nubus_xceedmc30_device - constructor //------------------------------------------------- -nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDS030_XCEEDMC30, "Micron/XCEED Technology MacroColor 30", tag, owner, clock, "pd3_mclr", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -73,7 +73,7 @@ nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, co m_screen_tag = m_assembled_tag.c_str(); } -nubus_xceedmc30_device::nubus_xceedmc30_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) : +nubus_xceedmc30_device::nubus_xceedmc30_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -88,7 +88,7 @@ nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, de void nubus_xceedmc30_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -99,7 +99,7 @@ void nubus_xceedmc30_device::device_start() // printf("[xceedmc30 %p] slotspace = %x\n", this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_xceedmc30_device::vram_r), this), write32_delegate(FUNC(nubus_xceedmc30_device::vram_w), this)); m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_r), this), write32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_w), this)); @@ -142,11 +142,11 @@ void nubus_xceedmc30_device::device_timer(emu_timer &timer, device_timer_id tid, ***************************************************************************/ -UINT32 nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = &m_vram[4*1024]; @@ -218,8 +218,8 @@ UINT32 nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb32 case 4: // 24 bpp { - UINT32 *vram32 = (UINT32 *)vram; - UINT32 *base; + uint32_t *vram32 = (uint32_t *)vram; + uint32_t *base; for (y = 0; y < 480; y++) { diff --git a/src/devices/bus/nubus/pds30_mc30.h b/src/devices/bus/nubus/pds30_mc30.h index 2a953ee5a6f..b2560f6e604 100644 --- a/src/devices/bus/nubus/pds30_mc30.h +++ b/src/devices/bus/nubus/pds30_mc30.h @@ -21,14 +21,14 @@ class nubus_xceedmc30_device : { public: // construction/destruction - nubus_xceedmc30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_xceedmc30_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); + nubus_xceedmc30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_xceedmc30_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable, m_toggle; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable, m_toggle; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; }; diff --git a/src/devices/bus/nubus/pds30_procolor816.cpp b/src/devices/bus/nubus/pds30_procolor816.cpp index f56520fda8b..7aefbf0308a 100644 --- a/src/devices/bus/nubus/pds30_procolor816.cpp +++ b/src/devices/bus/nubus/pds30_procolor816.cpp @@ -67,7 +67,7 @@ const tiny_rom_entry *nubus_procolor816_device::device_rom_region() const // nubus_procolor816_device - constructor //------------------------------------------------- -nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDS030_PROCOLOR816, "Lapis ProColor Server 8*16", tag, owner, clock, "pd3_pc16", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -76,7 +76,7 @@ nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig m_screen_tag = m_assembled_tag.c_str(); } -nubus_procolor816_device::nubus_procolor816_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) : +nubus_procolor816_device::nubus_procolor816_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_mode(0), m_vbl_disable(0), m_toggle(0), m_count(0), m_clutoffs(0), m_timer(nullptr) @@ -91,7 +91,7 @@ nubus_procolor816_device::nubus_procolor816_device(const machine_config &mconfig void nubus_procolor816_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -102,7 +102,7 @@ void nubus_procolor816_device::device_start() // printf("[procolor816 %p] slotspace = %x\n", this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_procolor816_device::vram_r), this), write32_delegate(FUNC(nubus_procolor816_device::vram_w), this)); m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_procolor816_device::vram_r), this), write32_delegate(FUNC(nubus_procolor816_device::vram_w), this)); @@ -146,11 +146,11 @@ void nubus_procolor816_device::device_timer(emu_timer &timer, device_timer_id ti ***************************************************************************/ -UINT32 nubus_procolor816_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = &m_vram[4]; @@ -222,8 +222,8 @@ UINT32 nubus_procolor816_device::screen_update(screen_device &screen, bitmap_rgb case 4: // 15 bpp { - UINT16 *vram16 = (UINT16 *)&m_vram[0]; - UINT16 pixels; + uint16_t *vram16 = (uint16_t *)&m_vram[0]; + uint16_t pixels; for (y = 0; y < 480; y++) { diff --git a/src/devices/bus/nubus/pds30_procolor816.h b/src/devices/bus/nubus/pds30_procolor816.h index 482593cb549..bffe8969f33 100644 --- a/src/devices/bus/nubus/pds30_procolor816.h +++ b/src/devices/bus/nubus/pds30_procolor816.h @@ -21,14 +21,14 @@ class nubus_procolor816_device : { public: // construction/destruction - nubus_procolor816_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_procolor816_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); + nubus_procolor816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_procolor816_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_mode, m_vbl_disable, m_toggle; - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_mode, m_vbl_disable, m_toggle; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; emu_timer *m_timer; std::string m_assembled_tag; }; diff --git a/src/devices/bus/nubus/pds30_sigmalview.cpp b/src/devices/bus/nubus/pds30_sigmalview.cpp index 19ff5ef869f..e9588a40568 100644 --- a/src/devices/bus/nubus/pds30_sigmalview.cpp +++ b/src/devices/bus/nubus/pds30_sigmalview.cpp @@ -61,7 +61,7 @@ const tiny_rom_entry *nubus_lview_device::device_rom_region() const // nubus_lview_device - constructor //------------------------------------------------- -nubus_lview_device::nubus_lview_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nubus_lview_device::nubus_lview_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDS030_LVIEW, "Sigma Designs L-View", tag, owner, clock, "pd3_lviw", __FILE__), device_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_vbl_disable(0), m_toggle(0), m_timer(nullptr), m_protstate(0) @@ -70,7 +70,7 @@ nubus_lview_device::nubus_lview_device(const machine_config &mconfig, const char m_screen_tag = m_assembled_tag.c_str(); } -nubus_lview_device::nubus_lview_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) : +nubus_lview_device::nubus_lview_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_video_interface(mconfig, *this), device_nubus_card_interface(mconfig, *this), m_vram32(nullptr), m_vbl_disable(0), m_toggle(0), m_timer(nullptr), m_protstate(0) @@ -85,7 +85,7 @@ nubus_lview_device::nubus_lview_device(const machine_config &mconfig, device_typ void nubus_lview_device::device_start() { - UINT32 slotspace; + uint32_t slotspace; // set_nubus_device makes m_slot valid set_nubus_device(); @@ -96,7 +96,7 @@ void nubus_lview_device::device_start() // printf("[lview %p] slotspace = %x\n", this, slotspace); m_vram.resize(VRAM_SIZE); - m_vram32 = (UINT32 *)&m_vram[0]; + m_vram32 = (uint32_t *)&m_vram[0]; m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_lview_device::vram_r), this), write32_delegate(FUNC(nubus_lview_device::vram_w), this)); m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_lview_device::vram_r), this), write32_delegate(FUNC(nubus_lview_device::vram_w), this)); @@ -138,11 +138,11 @@ void nubus_lview_device::device_timer(emu_timer &timer, device_timer_id tid, int ***************************************************************************/ -UINT32 nubus_lview_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nubus_lview_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, *vram; + uint8_t pixels, *vram; vram = &m_vram[0x20]; @@ -169,7 +169,7 @@ UINT32 nubus_lview_device::screen_update(screen_device &screen, bitmap_rgb32 &bi READ32_MEMBER( nubus_lview_device::lview_r ) { - UINT32 rv = 0; + uint32_t rv = 0; // printf("prot_r: @ %x, mask %08x [PC=%x state %d]\n", offset, mem_mask, machine().device("maincpu")->safe_pc(), m_protstate); diff --git a/src/devices/bus/nubus/pds30_sigmalview.h b/src/devices/bus/nubus/pds30_sigmalview.h index 3db62231f29..a7b078d2ab5 100644 --- a/src/devices/bus/nubus/pds30_sigmalview.h +++ b/src/devices/bus/nubus/pds30_sigmalview.h @@ -21,14 +21,14 @@ class nubus_lview_device : { public: // construction/destruction - nubus_lview_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nubus_lview_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); + nubus_lview_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nubus_lview_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); // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; virtual const tiny_rom_entry *device_rom_region() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides virtual void device_start() override; @@ -41,10 +41,10 @@ protected: DECLARE_WRITE32_MEMBER(vram_w); public: - std::vector m_vram; - UINT32 *m_vram32; - UINT32 m_vbl_disable, m_toggle; - UINT32 m_palette[256]; + std::vector m_vram; + uint32_t *m_vram32; + uint32_t m_vbl_disable, m_toggle; + uint32_t m_palette[256]; emu_timer *m_timer; int m_protstate; std::string m_assembled_tag; diff --git a/src/devices/bus/odyssey2/chess.cpp b/src/devices/bus/odyssey2/chess.cpp index 8885733923c..9ddd62b7f6a 100644 --- a/src/devices/bus/odyssey2/chess.cpp +++ b/src/devices/bus/odyssey2/chess.cpp @@ -22,7 +22,7 @@ const device_type O2_ROM_CHESS = &device_creator; -o2_chess_device::o2_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +o2_chess_device::o2_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : o2_rom_device(mconfig, O2_ROM_CHESS, "Odyssey 2 BASIC Carts", tag, owner, clock, "o2_chess", __FILE__), m_cpu(*this, "subcpu") { diff --git a/src/devices/bus/odyssey2/chess.h b/src/devices/bus/odyssey2/chess.h index 4cfefa10347..86c5822decf 100644 --- a/src/devices/bus/odyssey2/chess.h +++ b/src/devices/bus/odyssey2/chess.h @@ -17,7 +17,7 @@ class o2_chess_device : public o2_rom_device public: // construction/destruction - o2_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + o2_chess_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); private: required_device m_cpu; diff --git a/src/devices/bus/odyssey2/rom.cpp b/src/devices/bus/odyssey2/rom.cpp index dd2a3739bea..dac96ec563a 100644 --- a/src/devices/bus/odyssey2/rom.cpp +++ b/src/devices/bus/odyssey2/rom.cpp @@ -22,26 +22,26 @@ const device_type O2_ROM_12K = &device_creator; const device_type O2_ROM_16K = &device_creator; -o2_rom_device::o2_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +o2_rom_device::o2_rom_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_o2_cart_interface(mconfig, *this), m_bank_base(0) { } -o2_rom_device::o2_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +o2_rom_device::o2_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, O2_ROM_STD, "Odyssey 2 Standard Carts", tag, owner, clock, "o2_rom", __FILE__), device_o2_cart_interface( mconfig, *this ), m_bank_base(0) { } -o2_rom12_device::o2_rom12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +o2_rom12_device::o2_rom12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : o2_rom_device(mconfig, O2_ROM_12K, "Odyssey 2 12K Carts", tag, owner, clock, "o2_rom12", __FILE__) { } -o2_rom16_device::o2_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +o2_rom16_device::o2_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : o2_rom_device(mconfig, O2_ROM_16K, "Odyssey 2 16K Carts", tag, owner, clock, "o2_rom16", __FILE__) { } diff --git a/src/devices/bus/odyssey2/rom.h b/src/devices/bus/odyssey2/rom.h index 7f82a0c0e1a..d3931e96b88 100644 --- a/src/devices/bus/odyssey2/rom.h +++ b/src/devices/bus/odyssey2/rom.h @@ -13,8 +13,8 @@ class o2_rom_device : public device_t, { public: // construction/destruction - o2_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - o2_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + o2_rom_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); + o2_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -36,7 +36,7 @@ class o2_rom12_device : public o2_rom_device { public: // construction/destruction - o2_rom12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + o2_rom12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom04) override; @@ -49,7 +49,7 @@ class o2_rom16_device : public o2_rom_device { public: // construction/destruction - o2_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + o2_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom04) override; diff --git a/src/devices/bus/odyssey2/slot.cpp b/src/devices/bus/odyssey2/slot.cpp index 3ae5091568b..2593647a23c 100644 --- a/src/devices/bus/odyssey2/slot.cpp +++ b/src/devices/bus/odyssey2/slot.cpp @@ -45,7 +45,7 @@ device_o2_cart_interface::~device_o2_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_o2_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_o2_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -59,7 +59,7 @@ void device_o2_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_o2_cart_interface::ram_alloc(UINT32 size) +void device_o2_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -72,7 +72,7 @@ void device_o2_cart_interface::ram_alloc(UINT32 size) //------------------------------------------------- // o2_cart_slot_device - constructor //------------------------------------------------- -o2_cart_slot_device::o2_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +o2_cart_slot_device::o2_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, O2_CART_SLOT, "Odyssey 2 Cartridge Slot", tag, owner, clock, "o2_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -162,7 +162,7 @@ image_init_result o2_cart_slot_device::call_load() { if (m_cart) { - UINT32 size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); m_cart->rom_alloc(size, tag()); if (software_entry() == nullptr) @@ -203,7 +203,7 @@ std::string o2_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 size = m_file->size(); + uint32_t size = m_file->size(); int type = O2_STD; if (size == 12288) diff --git a/src/devices/bus/odyssey2/slot.h b/src/devices/bus/odyssey2/slot.h index 454239d8a5a..bb8bb7674a5 100644 --- a/src/devices/bus/odyssey2/slot.h +++ b/src/devices/bus/odyssey2/slot.h @@ -39,18 +39,18 @@ public: virtual DECLARE_WRITE8_MEMBER(io_write) {} virtual DECLARE_READ8_MEMBER(t0_read) { return 0; } - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; }; @@ -62,7 +62,7 @@ class o2_cart_slot_device : public device_t, { public: // construction/destruction - o2_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + o2_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~o2_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/odyssey2/voice.cpp b/src/devices/bus/odyssey2/voice.cpp index 0f1f702a541..b46d7010226 100644 --- a/src/devices/bus/odyssey2/voice.cpp +++ b/src/devices/bus/odyssey2/voice.cpp @@ -23,7 +23,7 @@ const device_type O2_ROM_VOICE = &device_creator; -o2_voice_device::o2_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +o2_voice_device::o2_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : o2_rom_device(mconfig, O2_ROM_VOICE, "Odyssey 2 The Voice Passthrough Cart", tag, owner, clock, "o2_voice", __FILE__), m_speech(*this, "sp0256_speech"), m_subslot(*this, "subslot"), diff --git a/src/devices/bus/odyssey2/voice.h b/src/devices/bus/odyssey2/voice.h index b841189f149..8c82aeeab31 100644 --- a/src/devices/bus/odyssey2/voice.h +++ b/src/devices/bus/odyssey2/voice.h @@ -14,7 +14,7 @@ class o2_voice_device : public o2_rom_device { public: // construction/destruction - o2_voice_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + o2_voice_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/devices/bus/oricext/jasmin.cpp b/src/devices/bus/oricext/jasmin.cpp index 8383fc5ddcd..e2e1bdb04a8 100644 --- a/src/devices/bus/oricext/jasmin.cpp +++ b/src/devices/bus/oricext/jasmin.cpp @@ -42,7 +42,7 @@ DEVICE_ADDRESS_MAP_START(map, 8, jasmin_device) AM_RANGE(0x3fc, 0x3ff) AM_WRITE(select_w) ADDRESS_MAP_END -jasmin_device::jasmin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +jasmin_device::jasmin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : oricext_device(mconfig, JASMIN, "Jasmin floppy drive interface", tag, owner, clock, "jasmin", __FILE__), fdc(*this, "fdc"), side_sel(false), fdc_reset(false), ram_access(false), rom_access(false), jasmin_rom(nullptr), cur_floppy(nullptr) { diff --git a/src/devices/bus/oricext/jasmin.h b/src/devices/bus/oricext/jasmin.h index 9befe4a2900..8b4047be695 100644 --- a/src/devices/bus/oricext/jasmin.h +++ b/src/devices/bus/oricext/jasmin.h @@ -12,7 +12,7 @@ extern const device_type JASMIN; class jasmin_device : public oricext_device { public: - jasmin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + jasmin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~jasmin_device(); DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -28,7 +28,7 @@ protected: required_device fdc; bool side_sel, fdc_reset, ram_access, rom_access, select[4]; - UINT8 *jasmin_rom; + uint8_t *jasmin_rom; floppy_image_device *cur_floppy, *floppies[4]; virtual void device_start() override; diff --git a/src/devices/bus/oricext/microdisc.cpp b/src/devices/bus/oricext/microdisc.cpp index f4b1e6f1678..6268c1860f4 100644 --- a/src/devices/bus/oricext/microdisc.cpp +++ b/src/devices/bus/oricext/microdisc.cpp @@ -37,7 +37,7 @@ DEVICE_ADDRESS_MAP_START(map, 8, microdisc_device) AM_RANGE(0x318, 0x318) AM_READ(port_318_r) ADDRESS_MAP_END -microdisc_device::microdisc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +microdisc_device::microdisc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : oricext_device(mconfig, MICRODISC, "Microdisc floppy drive interface", tag, owner, clock, "microdisc", __FILE__), fdc(*this, "fdc"), microdisc_rom(nullptr), port_314(0), intrq_state(false), drq_state(false), hld_state(false) { diff --git a/src/devices/bus/oricext/microdisc.h b/src/devices/bus/oricext/microdisc.h index 663e7fbf029..c4cc450db4f 100644 --- a/src/devices/bus/oricext/microdisc.h +++ b/src/devices/bus/oricext/microdisc.h @@ -12,7 +12,7 @@ extern const device_type MICRODISC; class microdisc_device : public oricext_device { public: - microdisc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + microdisc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~microdisc_device(); DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -38,9 +38,9 @@ protected: required_device fdc; - UINT8 *microdisc_rom; + uint8_t *microdisc_rom; floppy_image_device *floppies[4]; - UINT8 port_314; + uint8_t port_314; bool intrq_state, drq_state, hld_state; virtual void device_start() override; diff --git a/src/devices/bus/oricext/oricext.cpp b/src/devices/bus/oricext/oricext.cpp index 2c1894b385c..1499bf8c544 100644 --- a/src/devices/bus/oricext/oricext.cpp +++ b/src/devices/bus/oricext/oricext.cpp @@ -6,7 +6,7 @@ const device_type ORICEXT_CONNECTOR = &device_creator; -oricext_connector::oricext_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +oricext_connector::oricext_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ORICEXT_CONNECTOR, "ORIC extension connector", tag, owner, clock, "oricext_connector", __FILE__), device_slot_interface(mconfig, *this), irq_handler(*this), @@ -40,7 +40,7 @@ void oricext_connector::device_config_complete() dev->set_cputag(cputag); } -oricext_device::oricext_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) : +oricext_device::oricext_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_slot_card_interface(mconfig, *this), cputag(nullptr), @@ -72,8 +72,8 @@ void oricext_device::device_start() bank_c000_w = membank(":bank_c000_w"); bank_e000_w = membank(":bank_e000_w"); bank_f800_w = membank(":bank_f800_w"); - rom = (UINT8 *)machine().root_device().memregion(cputag)->base(); - ram = (UINT8 *)memshare(":ram")->ptr(); + rom = (uint8_t *)machine().root_device().memregion(cputag)->base(); + ram = (uint8_t *)memshare(":ram")->ptr(); memset(junk_read, 0xff, sizeof(junk_read)); memset(junk_write, 0x00, sizeof(junk_write)); diff --git a/src/devices/bus/oricext/oricext.h b/src/devices/bus/oricext/oricext.h index 738850a40b5..bf423ad852c 100644 --- a/src/devices/bus/oricext/oricext.h +++ b/src/devices/bus/oricext/oricext.h @@ -25,7 +25,7 @@ class oricext_connector: public device_t, public device_slot_interface { public: - oricext_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + oricext_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~oricext_connector(); void set_cputag(const char *tag); @@ -43,7 +43,7 @@ class oricext_device : public device_t, public device_slot_card_interface { public: - oricext_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); + oricext_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); void set_cputag(const char *tag); DECLARE_WRITE_LINE_MEMBER(irq_w); @@ -53,8 +53,8 @@ protected: m6502_device *cpu; oricext_connector *connector; memory_bank *bank_c000_r, *bank_e000_r, *bank_f800_r, *bank_c000_w, *bank_e000_w, *bank_f800_w; - UINT8 *rom, *ram; - UINT8 junk_read[8192], junk_write[8192]; + uint8_t *rom, *ram; + uint8_t junk_read[8192], junk_write[8192]; virtual void device_start() override; }; diff --git a/src/devices/bus/pc1512/mouse.cpp b/src/devices/bus/pc1512/mouse.cpp index d1f3aba2f51..24bd5f3e451 100644 --- a/src/devices/bus/pc1512/mouse.cpp +++ b/src/devices/bus/pc1512/mouse.cpp @@ -44,7 +44,7 @@ device_pc1512_mouse_port_interface::device_pc1512_mouse_port_interface(const mac // pc1512_mouse_port_t - constructor //------------------------------------------------- -pc1512_mouse_port_t::pc1512_mouse_port_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc1512_mouse_port_t::pc1512_mouse_port_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC1512_MOUSE_PORT, "Amstrad PC1512 mouse port", tag, owner, clock, "pc1512_mouse_port", __FILE__), device_slot_interface(mconfig, *this), m_write_x(*this), @@ -55,7 +55,7 @@ pc1512_mouse_port_t::pc1512_mouse_port_t(const machine_config &mconfig, const ch { } -pc1512_mouse_t::pc1512_mouse_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc1512_mouse_t::pc1512_mouse_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC1512_MOUSE, "Amstrad PC1512 mouse", tag, owner, clock, "pc1512_mouse", __FILE__), device_pc1512_mouse_port_interface(mconfig, *this) { diff --git a/src/devices/bus/pc1512/mouse.h b/src/devices/bus/pc1512/mouse.h index 38eca0ac0bc..58e56459be5 100644 --- a/src/devices/bus/pc1512/mouse.h +++ b/src/devices/bus/pc1512/mouse.h @@ -79,7 +79,7 @@ class pc1512_mouse_port_t : public device_t, { public: // construction/destruction - pc1512_mouse_port_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc1512_mouse_port_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_x_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_x.set_callback(object); } @@ -88,8 +88,8 @@ public: template static devcb_base &set_m2_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_m2.set_callback(object); } // peripheral interface - void x_w(UINT8 data) { m_write_x(data); } - void y_w(UINT8 data) { m_write_y(data); } + void x_w(uint8_t data) { m_write_x(data); } + void y_w(uint8_t data) { m_write_y(data); } void m1_w(int state) { m_write_m1(state); } void m2_w(int state) { m_write_m2(state); } @@ -113,7 +113,7 @@ class pc1512_mouse_t : public device_t, { public: // construction/destruction - pc1512_mouse_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc1512_mouse_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/pc_joy/pc_joy.cpp b/src/devices/bus/pc_joy/pc_joy.cpp index bf530eb6ab5..ecffaa88840 100644 --- a/src/devices/bus/pc_joy/pc_joy.cpp +++ b/src/devices/bus/pc_joy/pc_joy.cpp @@ -13,7 +13,7 @@ const device_type PC_JOY = &device_creator; -pc_joy_device::pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc_joy_device::pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_JOY, "PC joystick port", tag, owner, clock, "pc_joy", __FILE__), device_slot_interface(mconfig, *this), m_dev(nullptr) @@ -79,7 +79,7 @@ ioport_constructor pc_basic_joy_device::device_input_ports() const const device_type PC_BASIC_JOY = &device_creator; -pc_basic_joy_device::pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc_basic_joy_device::pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_BASIC_JOY, "PC basic joystick", tag, owner, clock, "basic_joy", __FILE__), device_pc_joy_interface(mconfig, *this), m_btn(*this, "btn"), diff --git a/src/devices/bus/pc_joy/pc_joy.h b/src/devices/bus/pc_joy/pc_joy.h index c5e1d890c8e..dbc0647ffc0 100644 --- a/src/devices/bus/pc_joy/pc_joy.h +++ b/src/devices/bus/pc_joy/pc_joy.h @@ -25,11 +25,11 @@ public: device_pc_joy_interface(const machine_config &mconfig, device_t &device); virtual ~device_pc_joy_interface(); - virtual UINT8 x1(int delta) { return 0; } - virtual UINT8 x2(int delta) { return 0; } - virtual UINT8 y1(int delta) { return 0; } - virtual UINT8 y2(int delta) { return 0; } - virtual UINT8 btn() { return 0xf; } + virtual uint8_t x1(int delta) { return 0; } + virtual uint8_t x2(int delta) { return 0; } + virtual uint8_t y1(int delta) { return 0; } + virtual uint8_t y2(int delta) { return 0; } + virtual uint8_t btn() { return 0xf; } virtual void port_write() { } }; @@ -37,7 +37,7 @@ class pc_joy_device : public device_t, public device_slot_interface { public: - pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(joy_port_r); DECLARE_WRITE8_MEMBER(joy_port_w); @@ -55,14 +55,14 @@ class pc_basic_joy_device : public device_t, public device_pc_joy_interface { public: - pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_basic_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; - virtual UINT8 x1(int delta) override { return (m_x1->read() > delta); } - virtual UINT8 x2(int delta) override { return (m_x2->read() > delta); } - virtual UINT8 y1(int delta) override { return (m_y1->read() > delta); } - virtual UINT8 y2(int delta) override { return (m_y2->read() > delta); } - virtual UINT8 btn() override { return m_btn->read(); } + virtual uint8_t x1(int delta) override { return (m_x1->read() > delta); } + virtual uint8_t x2(int delta) override { return (m_x2->read() > delta); } + virtual uint8_t y1(int delta) override { return (m_y1->read() > delta); } + virtual uint8_t y2(int delta) override { return (m_y2->read() > delta); } + virtual uint8_t btn() override { return m_btn->read(); } protected: virtual void device_start() override {} diff --git a/src/devices/bus/pc_joy/pc_joy_sw.cpp b/src/devices/bus/pc_joy/pc_joy_sw.cpp index 4d826e9f62a..a21bba8bd93 100644 --- a/src/devices/bus/pc_joy/pc_joy_sw.cpp +++ b/src/devices/bus/pc_joy/pc_joy_sw.cpp @@ -6,7 +6,7 @@ const device_type PC_MSSW_PAD = &device_creator; -pc_mssw_pad_device::pc_mssw_pad_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) : +pc_mssw_pad_device::pc_mssw_pad_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : device_t(mconfig, PC_MSSW_PAD, "Microsoft Sidewinder Pad", tag, owner, clock, "mssw_pad", __FILE__), device_pc_joy_interface(mconfig, *this), m_btn1(*this, "btn1"), @@ -36,7 +36,7 @@ void pc_mssw_pad_device::device_reset() void pc_mssw_pad_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) { - UINT16 pad_state = 0; + uint16_t pad_state = 0; // only multibit mode for now if(m_count == -1) { @@ -90,7 +90,7 @@ void pc_mssw_pad_device::device_timer(emu_timer &timer, device_timer_id tid, int break; case 4: { - UINT8 parity = (pad_state >> 8) ^ pad_state; + uint8_t parity = (pad_state >> 8) ^ pad_state; parity = (parity >> 4) ^ parity; parity = (parity >> 2) ^ parity; parity = (((parity >> 1) ^ parity) & 1); diff --git a/src/devices/bus/pc_joy/pc_joy_sw.h b/src/devices/bus/pc_joy/pc_joy_sw.h index 29500ed35ea..c36c564d8e5 100644 --- a/src/devices/bus/pc_joy/pc_joy_sw.h +++ b/src/devices/bus/pc_joy/pc_joy_sw.h @@ -9,10 +9,10 @@ class pc_mssw_pad_device : public device_t, public device_pc_joy_interface { public: - pc_mssw_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_mssw_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; - virtual UINT8 btn() override { return m_state; } + virtual uint8_t btn() override { return m_state; } // timing is guessed, calibrated for at486 virtual void port_write() override { if(!m_active) { m_timer->adjust(attotime::from_usec(50), 0, attotime::from_usec(5)); m_active = true; } } @@ -29,7 +29,7 @@ private: required_ioport m_conf; emu_timer *m_timer; int m_count; - UINT8 m_state; + uint8_t m_state; bool m_active; }; diff --git a/src/devices/bus/pc_kbd/ec1841.cpp b/src/devices/bus/pc_kbd/ec1841.cpp index 3d7020d9ad2..b9a2db9ab39 100644 --- a/src/devices/bus/pc_kbd/ec1841.cpp +++ b/src/devices/bus/pc_kbd/ec1841.cpp @@ -280,7 +280,7 @@ ioport_constructor ec_1841_keyboard_device::device_input_ports() const // ec_1841_keyboard_device - constructor //------------------------------------------------- -ec_1841_keyboard_device::ec_1841_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ec_1841_keyboard_device::ec_1841_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KBD_EC_1841, "EC-1841 Keyboard", tag, owner, clock, "kb_ec1841", __FILE__), device_pc_kbd_interface(mconfig, *this), m_maincpu(*this, I8048_TAG), @@ -371,7 +371,7 @@ READ8_MEMBER( ec_1841_keyboard_device::p1_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= clock_signal(); data |= data_signal() << 1; @@ -442,7 +442,7 @@ READ8_MEMBER( ec_1841_keyboard_device::t1_r ) if (BIT(m_p2,0)) { m_q = 1; } else { - UINT8 sense = 0xff; + uint8_t sense = 0xff; sense &= m_kbd[m_bus & 15]->read(); m_q = BIT(sense, (m_bus >> 4) & 7); } diff --git a/src/devices/bus/pc_kbd/ec1841.h b/src/devices/bus/pc_kbd/ec1841.h index 7c7b830a083..b6ef745696b 100644 --- a/src/devices/bus/pc_kbd/ec1841.h +++ b/src/devices/bus/pc_kbd/ec1841.h @@ -28,7 +28,7 @@ class ec_1841_keyboard_device : public device_t, { public: // construction/destruction - ec_1841_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ec_1841_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; @@ -54,9 +54,9 @@ private: required_device m_maincpu; required_ioport_array<16> m_kbd; - UINT8 m_bus; - UINT8 m_p1; - UINT8 m_p2; + uint8_t m_bus; + uint8_t m_p1; + uint8_t m_p2; int m_q; }; diff --git a/src/devices/bus/pc_kbd/iskr1030.cpp b/src/devices/bus/pc_kbd/iskr1030.cpp index 0b752793785..1b8afeee9ec 100644 --- a/src/devices/bus/pc_kbd/iskr1030.cpp +++ b/src/devices/bus/pc_kbd/iskr1030.cpp @@ -259,7 +259,7 @@ ioport_constructor iskr_1030_keyboard_device::device_input_ports() const // iskr_1030_keyboard_device - constructor //------------------------------------------------- -iskr_1030_keyboard_device::iskr_1030_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iskr_1030_keyboard_device::iskr_1030_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KBD_ISKR_1030, "Iskra-1030 Keyboard", tag, owner, clock, "kb_iskr1030", __FILE__), device_pc_kbd_interface(mconfig, *this), m_maincpu(*this, I8048_TAG), @@ -348,8 +348,8 @@ WRITE_LINE_MEMBER( iskr_1030_keyboard_device::data_write ) READ8_MEMBER( iskr_1030_keyboard_device::t1_r ) { - UINT8 data = data_signal(); - UINT8 bias = m_p1 & 15; + uint8_t data = data_signal(); + uint8_t bias = m_p1 & 15; if (!BIT(m_p1, 7)) { DBG_LOG(2,0,( "%s: t1_r (l) %d\n", tag(), data)); @@ -440,7 +440,7 @@ READ8_MEMBER( iskr_1030_keyboard_device::p1_r ) 7 */ - UINT8 data = 0; + uint8_t data = 0; DBG_LOG(1,0,( "%s: p1_r %02x\n", tag(), data)); diff --git a/src/devices/bus/pc_kbd/iskr1030.h b/src/devices/bus/pc_kbd/iskr1030.h index dd3573f0f75..4d7ce5e1826 100644 --- a/src/devices/bus/pc_kbd/iskr1030.h +++ b/src/devices/bus/pc_kbd/iskr1030.h @@ -29,7 +29,7 @@ class iskr_1030_keyboard_device : public device_t, { public: // construction/destruction - iskr_1030_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iskr_1030_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; @@ -79,10 +79,10 @@ private: required_ioport m_md22; required_ioport m_md23; - std::vector m_ram; - UINT8 m_bus; - UINT8 m_p1; - UINT8 m_p2; + std::vector m_ram; + uint8_t m_bus; + uint8_t m_p1; + uint8_t m_p2; int m_q; }; diff --git a/src/devices/bus/pc_kbd/keytro.cpp b/src/devices/bus/pc_kbd/keytro.cpp index 331ed871d09..480e0a65b75 100644 --- a/src/devices/bus/pc_kbd/keytro.cpp +++ b/src/devices/bus/pc_kbd/keytro.cpp @@ -377,7 +377,7 @@ ROM_START( keytronic_pc3270 ) ROM_END -pc_kbd_keytronic_pc3270_device::pc_kbd_keytronic_pc3270_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc_kbd_keytronic_pc3270_device::pc_kbd_keytronic_pc3270_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KBD_KEYTRONIC_PC3270, "Keytronic PC3270", tag, owner, clock, "keytronic_pc3270", __FILE__), device_pc_kbd_interface(mconfig, *this), m_cpu(*this, "kb_keytr"), m_p1(0), m_p1_data(0), m_p2(0), m_p3(0), m_last_write_addr(0) @@ -606,7 +606,7 @@ WRITE8_MEMBER( pc_kbd_keytronic_pc3270_device::p2_write ) READ8_MEMBER( pc_kbd_keytronic_pc3270_device::p3_read ) { - UINT8 data = m_p3; + uint8_t data = m_p3; data &= ~0x14; diff --git a/src/devices/bus/pc_kbd/keytro.h b/src/devices/bus/pc_kbd/keytro.h index 98f8097fda7..938a09edf89 100644 --- a/src/devices/bus/pc_kbd/keytro.h +++ b/src/devices/bus/pc_kbd/keytro.h @@ -22,7 +22,7 @@ class pc_kbd_keytronic_pc3270_device : public device_t, { public: // construction/destruction - pc_kbd_keytronic_pc3270_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_kbd_keytronic_pc3270_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_cpu; @@ -48,11 +48,11 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT8 m_p1; - UINT8 m_p1_data; - UINT8 m_p2; - UINT8 m_p3; - UINT16 m_last_write_addr; + uint8_t m_p1; + uint8_t m_p1_data; + uint8_t m_p2; + uint8_t m_p3; + uint16_t m_last_write_addr; }; @@ -60,7 +60,7 @@ class pc_kbd_keytronic_pc3270_at_device : public pc_kbd_keytronic_pc3270_device { public: // construction/destruction - pc_kbd_keytronic_pc3270_at_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + pc_kbd_keytronic_pc3270_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pc_kbd_keytronic_pc3270_device(mconfig, tag, owner, clock) { } diff --git a/src/devices/bus/pc_kbd/msnat.cpp b/src/devices/bus/pc_kbd/msnat.cpp index c1bb29f6a7e..e7aaf50e968 100644 --- a/src/devices/bus/pc_kbd/msnat.cpp +++ b/src/devices/bus/pc_kbd/msnat.cpp @@ -228,7 +228,7 @@ ROM_START( microsoft_natural ) ROM_END -pc_kbd_microsoft_natural_device::pc_kbd_microsoft_natural_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pc_kbd_microsoft_natural_device::pc_kbd_microsoft_natural_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KBD_MICROSOFT_NATURAL, "Microsoft Natural Keyboard", tag, owner, clock, "ms_natural", __FILE__) , device_pc_kbd_interface(mconfig, *this) , m_cpu(*this, "ms_natrl_cpu") @@ -315,7 +315,7 @@ WRITE_LINE_MEMBER( pc_kbd_microsoft_natural_device::data_write ) READ8_MEMBER( pc_kbd_microsoft_natural_device::p0_read ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; if (LOG) logerror("%s: P0 read. P1 = %02x, P2 = %02x\n", tag(), m_p1, m_p2 ); @@ -424,7 +424,7 @@ WRITE8_MEMBER( pc_kbd_microsoft_natural_device::p2_write ) READ8_MEMBER( pc_kbd_microsoft_natural_device::p3_read ) { - UINT8 data = m_p3 & ~0x21; + uint8_t data = m_p3 & ~0x21; // (Incoming) Clock signal is tied to the T1/P3.5 pin data |= (clock_signal() ? 0x20 : 0x00); diff --git a/src/devices/bus/pc_kbd/msnat.h b/src/devices/bus/pc_kbd/msnat.h index bbcc9e26516..c3c8eaa5c99 100644 --- a/src/devices/bus/pc_kbd/msnat.h +++ b/src/devices/bus/pc_kbd/msnat.h @@ -20,7 +20,7 @@ class pc_kbd_microsoft_natural_device : public device_t, { public: // construction/destruction - pc_kbd_microsoft_natural_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_kbd_microsoft_natural_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_cpu; @@ -61,10 +61,10 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT8 m_p0; - UINT8 m_p1; - UINT8 m_p2; - UINT8 m_p3; + uint8_t m_p0; + uint8_t m_p1; + uint8_t m_p2; + uint8_t m_p3; }; diff --git a/src/devices/bus/pc_kbd/pc83.cpp b/src/devices/bus/pc_kbd/pc83.cpp index 8b1d25366ae..044d12d46d5 100644 --- a/src/devices/bus/pc_kbd/pc83.cpp +++ b/src/devices/bus/pc_kbd/pc83.cpp @@ -248,7 +248,7 @@ ioport_constructor ibm_pc_83_keyboard_device::device_input_ports() const // ibm_pc_83_keyboard_device - constructor //------------------------------------------------- -ibm_pc_83_keyboard_device::ibm_pc_83_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ibm_pc_83_keyboard_device::ibm_pc_83_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KBD_IBM_PC_83, "IBM PC Keyboard", tag, owner, clock, "kb_pc83", __FILE__), device_pc_kbd_interface(mconfig, *this), m_maincpu(*this, I8048_TAG), @@ -325,7 +325,7 @@ READ8_MEMBER( ibm_pc_83_keyboard_device::p1_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= clock_signal(); data |= data_signal() << 1; @@ -366,7 +366,7 @@ WRITE8_MEMBER( ibm_pc_83_keyboard_device::p2_w ) READ8_MEMBER( ibm_pc_83_keyboard_device::t1_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; int keylatch = m_cnt >> 2; diff --git a/src/devices/bus/pc_kbd/pc83.h b/src/devices/bus/pc_kbd/pc83.h index 9aa3c82bd85..18c81dfc97e 100644 --- a/src/devices/bus/pc_kbd/pc83.h +++ b/src/devices/bus/pc_kbd/pc83.h @@ -29,7 +29,7 @@ class ibm_pc_83_keyboard_device : public device_t, { public: // construction/destruction - ibm_pc_83_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ibm_pc_83_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; @@ -54,7 +54,7 @@ private: required_device m_maincpu; required_ioport_array<24> m_dr; - UINT8 m_cnt; + uint8_t m_cnt; }; diff --git a/src/devices/bus/pc_kbd/pc_kbdc.cpp b/src/devices/bus/pc_kbd/pc_kbdc.cpp index 987c51eda63..d5768d633f4 100644 --- a/src/devices/bus/pc_kbd/pc_kbdc.cpp +++ b/src/devices/bus/pc_kbd/pc_kbdc.cpp @@ -30,7 +30,7 @@ const device_type PC_KBDC_SLOT = &device_creator; //------------------------------------------------- // pc_kbdc_slot_device - constructor //------------------------------------------------- -pc_kbdc_slot_device::pc_kbdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc_kbdc_slot_device::pc_kbdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KBDC_SLOT, "PC_KBDC_SLOT", tag, owner, clock, "pc_kbdc_slot", __FILE__), device_slot_interface(mconfig, *this), m_kbdc_device(nullptr) @@ -69,7 +69,7 @@ const device_type PC_KBDC = &device_creator; //------------------------------------------------- // pc_kbdc_device - constructor //------------------------------------------------- -pc_kbdc_device::pc_kbdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc_kbdc_device::pc_kbdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KBDC, "PC_KBDC", tag, owner, clock, "pc_kbdc", __FILE__), m_out_clock_cb(*this), m_out_data_cb(*this), diff --git a/src/devices/bus/pc_kbd/pc_kbdc.h b/src/devices/bus/pc_kbd/pc_kbdc.h index 3f1788ac021..a90164171c2 100644 --- a/src/devices/bus/pc_kbd/pc_kbdc.h +++ b/src/devices/bus/pc_kbd/pc_kbdc.h @@ -42,7 +42,7 @@ class pc_kbdc_slot_device : public device_t, { public: // construction/destruction - pc_kbdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_kbdc_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -65,7 +65,7 @@ class pc_kbdc_device : public device_t { public: // construction/destruction - pc_kbdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_kbdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_clock_callback(device_t &device, _Object object) { return downcast(device).m_out_clock_cb.set_callback(object); } template static devcb_base &set_out_data_callback(device_t &device, _Object object) { return downcast(device).m_out_data_cb.set_callback(object); } diff --git a/src/devices/bus/pc_kbd/pcat84.cpp b/src/devices/bus/pc_kbd/pcat84.cpp index d8babfa1a36..ec1ececa88a 100644 --- a/src/devices/bus/pc_kbd/pcat84.cpp +++ b/src/devices/bus/pc_kbd/pcat84.cpp @@ -353,7 +353,7 @@ ioport_constructor ibm_3270pc_122_keyboard_device::device_input_ports() const // ibm_pc_at_84_keyboard_device - constructor //------------------------------------------------- -ibm_pc_at_84_keyboard_device::ibm_pc_at_84_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) : +ibm_pc_at_84_keyboard_device::ibm_pc_at_84_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), device_pc_kbd_interface(mconfig, *this), m_maincpu(*this, I8048_TAG), @@ -367,10 +367,10 @@ ibm_pc_at_84_keyboard_device::ibm_pc_at_84_keyboard_device(const machine_config { } -ibm_pc_at_84_keyboard_device::ibm_pc_at_84_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ibm_pc_at_84_keyboard_device::ibm_pc_at_84_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ibm_pc_at_84_keyboard_device(mconfig, PC_KBD_IBM_PC_AT_84, "IBM PC/AT Keyboard", tag, owner, clock, "kb_pcat84", __FILE__) { } -ibm_3270pc_122_keyboard_device::ibm_3270pc_122_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ibm_3270pc_122_keyboard_device::ibm_3270pc_122_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ibm_pc_at_84_keyboard_device(mconfig, PC_KBD_IBM_3270PC_122, "IBM 3270PC Keyboard", tag, owner, clock, "kb_3270pc", __FILE__) { } @@ -451,7 +451,7 @@ READ8_MEMBER( ibm_pc_at_84_keyboard_device::p1_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_kbdida->read() << 2; @@ -510,7 +510,7 @@ READ8_MEMBER( ibm_pc_at_84_keyboard_device::p2_r ) */ - UINT8 data = 0xc0; + uint8_t data = 0xc0; data |= m_kbdidb->read(); @@ -574,7 +574,7 @@ READ8_MEMBER( ibm_pc_at_84_keyboard_device::t1_r ) int ibm_pc_at_84_keyboard_device::key_depressed() { - UINT8 data = m_dr[m_cnt]->read(); + uint8_t data = m_dr[m_cnt]->read(); return m_t1 && BIT(data, m_sense); } diff --git a/src/devices/bus/pc_kbd/pcat84.h b/src/devices/bus/pc_kbd/pcat84.h index 5c5f542c24c..d3219ea41da 100644 --- a/src/devices/bus/pc_kbd/pcat84.h +++ b/src/devices/bus/pc_kbd/pcat84.h @@ -29,8 +29,8 @@ class ibm_pc_at_84_keyboard_device : public device_t, { public: // construction/destruction - ibm_pc_at_84_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); - ibm_pc_at_84_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ibm_pc_at_84_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); + ibm_pc_at_84_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; @@ -69,7 +69,7 @@ private: optional_ioport m_kbdida; optional_ioport m_kbdidb; - UINT8 m_db; + uint8_t m_db; int m_cnt; int m_sense; int m_t1; @@ -82,7 +82,7 @@ class ibm_3270pc_122_keyboard_device : public ibm_pc_at_84_keyboard_device { public: // construction/destruction - ibm_3270pc_122_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ibm_3270pc_122_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; diff --git a/src/devices/bus/pc_kbd/pcxt83.cpp b/src/devices/bus/pc_kbd/pcxt83.cpp index 193f0e08931..22b1d7b3e52 100644 --- a/src/devices/bus/pc_kbd/pcxt83.cpp +++ b/src/devices/bus/pc_kbd/pcxt83.cpp @@ -247,7 +247,7 @@ ioport_constructor ibm_pc_xt_83_keyboard_device::device_input_ports() const // ibm_pc_xt_83_keyboard_device - constructor //------------------------------------------------- -ibm_pc_xt_83_keyboard_device::ibm_pc_xt_83_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ibm_pc_xt_83_keyboard_device::ibm_pc_xt_83_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KBD_IBM_PC_XT_83, "IBM PC/XT Keyboard", tag, owner, clock, "kb_pcxt83", __FILE__), device_pc_kbd_interface(mconfig, *this), m_maincpu(*this, I8048_TAG), @@ -343,7 +343,7 @@ WRITE8_MEMBER( ibm_pc_xt_83_keyboard_device::bus_w ) if (!BIT(m_bus, 7) && BIT(data, 7)) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (BIT(m_p1, 0)) data &= m_md[0]->read(); if (BIT(m_p1, 1)) data &= m_md[1]->read(); diff --git a/src/devices/bus/pc_kbd/pcxt83.h b/src/devices/bus/pc_kbd/pcxt83.h index 47e23205e62..672e67f406c 100644 --- a/src/devices/bus/pc_kbd/pcxt83.h +++ b/src/devices/bus/pc_kbd/pcxt83.h @@ -29,7 +29,7 @@ class ibm_pc_xt_83_keyboard_device : public device_t, { public: // construction/destruction - ibm_pc_xt_83_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ibm_pc_xt_83_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; @@ -56,9 +56,9 @@ private: required_device m_maincpu; required_ioport_array<12> m_md; - UINT8 m_bus; - UINT8 m_p1; - UINT8 m_p2; + uint8_t m_bus; + uint8_t m_p1; + uint8_t m_p2; int m_sense; int m_q; }; diff --git a/src/devices/bus/pce/pce_rom.cpp b/src/devices/bus/pce/pce_rom.cpp index 5323f8a675b..553ac06fedf 100644 --- a/src/devices/bus/pce/pce_rom.cpp +++ b/src/devices/bus/pce/pce_rom.cpp @@ -23,29 +23,29 @@ const device_type PCE_ROM_POPULOUS = &device_creator; const device_type PCE_ROM_SF2 = &device_creator; -pce_rom_device::pce_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +pce_rom_device::pce_rom_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_pce_cart_interface( mconfig, *this ) { } -pce_rom_device::pce_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pce_rom_device::pce_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCE_ROM_STD, "PCE & TG16 Carts", tag, owner, clock, "pce_rom", __FILE__), device_pce_cart_interface( mconfig, *this ) { } -pce_cdsys3_device::pce_cdsys3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pce_cdsys3_device::pce_cdsys3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pce_rom_device(mconfig, PCE_ROM_CDSYS3, "PCE & TG16 CD-System Cart v3.00", tag, owner, clock, "pce_cdsys3", __FILE__) { } -pce_populous_device::pce_populous_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pce_populous_device::pce_populous_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pce_rom_device(mconfig, PCE_ROM_POPULOUS, "PCE Populous Cart", tag, owner, clock, "pce_populous", __FILE__) { } -pce_sf2_device::pce_sf2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pce_sf2_device::pce_sf2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pce_rom_device(mconfig, PCE_ROM_SF2, "PCE Street Fighters 2 Cart", tag, owner, clock, "pce_sf2", __FILE__), m_bank_base(0) { } diff --git a/src/devices/bus/pce/pce_rom.h b/src/devices/bus/pce/pce_rom.h index 14d6dc29577..9dd69e7fd6b 100644 --- a/src/devices/bus/pce/pce_rom.h +++ b/src/devices/bus/pce/pce_rom.h @@ -13,8 +13,8 @@ class pce_rom_device : public device_t, { public: // construction/destruction - pce_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - pce_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pce_rom_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); + pce_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -30,7 +30,7 @@ class pce_cdsys3_device : public pce_rom_device { public: // construction/destruction - pce_cdsys3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pce_cdsys3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -44,7 +44,7 @@ class pce_populous_device : public pce_rom_device { public: // construction/destruction - pce_populous_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pce_populous_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -58,7 +58,7 @@ class pce_sf2_device : public pce_rom_device { public: // construction/destruction - pce_sf2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pce_sf2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -69,7 +69,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_cart) override; private: - UINT8 m_bank_base; + uint8_t m_bank_base; }; diff --git a/src/devices/bus/pce/pce_slot.cpp b/src/devices/bus/pce/pce_slot.cpp index db42af8281e..99b625244af 100644 --- a/src/devices/bus/pce/pce_slot.cpp +++ b/src/devices/bus/pce/pce_slot.cpp @@ -49,7 +49,7 @@ device_pce_cart_interface::~device_pce_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_pce_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_pce_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -63,7 +63,7 @@ void device_pce_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_pce_cart_interface::ram_alloc(UINT32 size) +void device_pce_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); device().save_item(NAME(m_ram)); @@ -74,7 +74,7 @@ void device_pce_cart_interface::ram_alloc(UINT32 size) // blocks, so to simplify ROM access to mirror //------------------------------------------------- -void device_pce_cart_interface::rom_map_setup(UINT32 size) +void device_pce_cart_interface::rom_map_setup(uint32_t size) { if (size == 0x60000) { @@ -135,7 +135,7 @@ void device_pce_cart_interface::rom_map_setup(UINT32 size) //------------------------------------------------- // pce_cart_slot_device - constructor //------------------------------------------------- -pce_cart_slot_device::pce_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pce_cart_slot_device::pce_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCE_CART_SLOT, "PCE & TG16 Cartridge Slot", tag, owner, clock, "pce_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -226,9 +226,9 @@ image_init_result pce_cart_slot_device::call_load() { if (m_cart) { - UINT32 offset; - UINT32 len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); - UINT8 *ROM; + uint32_t offset; + uint32_t len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint8_t *ROM; // From fullpath, check for presence of a header and skip it if (software_entry() == nullptr && (len % 0x4000) == 512) @@ -250,7 +250,7 @@ image_init_result pce_cart_slot_device::call_load() // check for encryption (US carts) if (ROM[0x1fff] < 0xe0) { - UINT8 decrypted[256]; + uint8_t decrypted[256]; /* Initialize decryption table */ for (int i = 0; i < 256; i++) @@ -299,7 +299,7 @@ void pce_cart_slot_device::call_unload() fullpath -------------------------------------------------*/ -int pce_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) +int pce_cart_slot_device::get_cart_type(uint8_t *ROM, uint32_t len) { int type = PCE_STD; @@ -332,8 +332,8 @@ std::string pce_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 len = m_file->size(); - std::vector rom(len); + uint32_t len = m_file->size(); + std::vector rom(len); int type; m_file->read(&rom[0], len); @@ -377,6 +377,6 @@ WRITE8_MEMBER(pce_cart_slot_device::write_cart) Internal header logging -------------------------------------------------*/ -void pce_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) +void pce_cart_slot_device::internal_header_logging(uint8_t *ROM, uint32_t len) { } diff --git a/src/devices/bus/pce/pce_slot.h b/src/devices/bus/pce/pce_slot.h index ccd7954b8a5..e76940aaa68 100644 --- a/src/devices/bus/pce/pce_slot.h +++ b/src/devices/bus/pce/pce_slot.h @@ -35,21 +35,21 @@ public: virtual DECLARE_READ8_MEMBER(read_cart) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_cart) {}; - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; - void rom_map_setup(UINT32 size); + void rom_map_setup(uint32_t size); - UINT8 rom_bank_map[8]; // 128K chunks of rom + uint8_t rom_bank_map[8]; // 128K chunks of rom }; @@ -61,7 +61,7 @@ class pce_cart_slot_device : public device_t, { public: // construction/destruction - pce_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pce_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~pce_cart_slot_device(); // device-level overrides @@ -74,9 +74,9 @@ public: virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } - int get_cart_type(UINT8 *ROM, UINT32 len); + int get_cart_type(uint8_t *ROM, uint32_t len); - void internal_header_logging(UINT8 *ROM, UINT32 len); + void internal_header_logging(uint8_t *ROM, uint32_t len); void set_intf(const char * interface) { m_interface = interface; } diff --git a/src/devices/bus/pet/2joysnd.cpp b/src/devices/bus/pet/2joysnd.cpp index 41e998ca429..34d00aa7886 100644 --- a/src/devices/bus/pet/2joysnd.cpp +++ b/src/devices/bus/pet/2joysnd.cpp @@ -110,7 +110,7 @@ machine_config_constructor pet_userport_joystick_and_sound_device::device_mconfi // pet_user_port_dual_joystick_and_sound_device - constructor //------------------------------------------------- -pet_userport_joystick_and_sound_device::pet_userport_joystick_and_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pet_userport_joystick_and_sound_device::pet_userport_joystick_and_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PET_USERPORT_JOYSTICK_AND_SOUND_DEVICE, "Dual Joysticks and Sound", tag, owner, clock, "2joysnd", __FILE__), device_pet_user_port_interface(mconfig, *this), m_dac(*this, "dac"), diff --git a/src/devices/bus/pet/2joysnd.h b/src/devices/bus/pet/2joysnd.h index 040e867ef99..64ba22438c0 100644 --- a/src/devices/bus/pet/2joysnd.h +++ b/src/devices/bus/pet/2joysnd.h @@ -28,7 +28,7 @@ class pet_userport_joystick_and_sound_device : public device_t, { public: // construction/destruction - pet_userport_joystick_and_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pet_userport_joystick_and_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/pet/64k.cpp b/src/devices/bus/pet/64k.cpp index dfdc278a77d..7b27e8c3c13 100644 --- a/src/devices/bus/pet/64k.cpp +++ b/src/devices/bus/pet/64k.cpp @@ -26,9 +26,9 @@ const device_type PET_64K = &device_creator; // read_ram - //------------------------------------------------- -inline UINT8 pet_64k_expansion_device::read_ram(offs_t offset) +inline uint8_t pet_64k_expansion_device::read_ram(offs_t offset) { - UINT8 data; + uint8_t data; if (offset < 0xc000) { @@ -47,7 +47,7 @@ inline UINT8 pet_64k_expansion_device::read_ram(offs_t offset) // write_ram - //------------------------------------------------- -inline void pet_64k_expansion_device::write_ram(offs_t offset, UINT8 data) +inline void pet_64k_expansion_device::write_ram(offs_t offset, uint8_t data) { if (offset < 0xc000) { @@ -75,7 +75,7 @@ inline void pet_64k_expansion_device::write_ram(offs_t offset, UINT8 data) // pet_64k_expansion_device - constructor //------------------------------------------------- -pet_64k_expansion_device::pet_64k_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pet_64k_expansion_device::pet_64k_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PET_64K, "PET 64KB RAM", tag, owner, clock, "pet_64k", __FILE__), device_pet_expansion_card_interface(mconfig, *this), m_ram(*this, "ram"), @@ -122,7 +122,7 @@ int pet_64k_expansion_device::pet_norom_r(address_space &space, offs_t offset, i // pet_bd_r - buffered data read //------------------------------------------------- -UINT8 pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel) +uint8_t pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, uint8_t data, int &sel) { if (BIT(m_ctrl, 7)) { @@ -163,7 +163,7 @@ UINT8 pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, UI // pet_bd_w - buffered data write //------------------------------------------------- -void pet_64k_expansion_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel) +void pet_64k_expansion_device::pet_bd_w(address_space &space, offs_t offset, uint8_t data, int &sel) { if (BIT(m_ctrl, 7)) { diff --git a/src/devices/bus/pet/64k.h b/src/devices/bus/pet/64k.h index ed698f539d1..fbaca888a58 100644 --- a/src/devices/bus/pet/64k.h +++ b/src/devices/bus/pet/64k.h @@ -27,7 +27,7 @@ class pet_64k_expansion_device : public device_t, { public: // construction/destruction - pet_64k_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pet_64k_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,16 +36,16 @@ protected: // device_pet_expansion_card_interface overrides virtual int pet_norom_r(address_space &space, offs_t offset, int sel) override; - virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel) override; - virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel) override; + virtual uint8_t pet_bd_r(address_space &space, offs_t offset, uint8_t data, int &sel) override; + virtual void pet_bd_w(address_space &space, offs_t offset, uint8_t data, int &sel) override; private: - inline UINT8 read_ram(offs_t offset); - inline void write_ram(offs_t offset, UINT8 data); + inline uint8_t read_ram(offs_t offset); + inline void write_ram(offs_t offset, uint8_t data); - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; - UINT8 m_ctrl; + uint8_t m_ctrl; }; diff --git a/src/devices/bus/pet/c2n.cpp b/src/devices/bus/pet/c2n.cpp index 585e651f3d7..1e86ed6738b 100644 --- a/src/devices/bus/pet/c2n.cpp +++ b/src/devices/bus/pet/c2n.cpp @@ -51,7 +51,7 @@ machine_config_constructor c2n_device::device_mconfig_additions() const // c2n_device - constructor //------------------------------------------------- -c2n_device::c2n_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) +c2n_device::c2n_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_pet_datassette_port_interface(mconfig, *this), m_cassette(*this, "cassette"), @@ -60,7 +60,7 @@ c2n_device::c2n_device(const machine_config &mconfig, device_type type, const ch { } -c2n_device::c2n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c2n_device::c2n_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C2N, "C2N Datassette", tag, owner, clock, "c2n", __FILE__), device_pet_datassette_port_interface(mconfig, *this), m_cassette(*this, "cassette"), @@ -73,7 +73,7 @@ c2n_device::c2n_device(const machine_config &mconfig, const char *tag, device_t // c1530_device - constructor //------------------------------------------------- -c1530_device::c1530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1530_device::c1530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c2n_device(mconfig, C1530, "C1530 Datassette", tag, owner, clock, "c1530", __FILE__) { } @@ -81,7 +81,7 @@ c1530_device::c1530_device(const machine_config &mconfig, const char *tag, devic // c1531_device - constructor //------------------------------------------------- -c1531_device::c1531_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1531_device::c1531_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : c2n_device(mconfig, C1531, "C1531 Datassette", tag, owner, clock, "c1531", __FILE__) { } diff --git a/src/devices/bus/pet/c2n.h b/src/devices/bus/pet/c2n.h index 5aeac83ce0b..e373d1ea4e8 100644 --- a/src/devices/bus/pet/c2n.h +++ b/src/devices/bus/pet/c2n.h @@ -29,8 +29,8 @@ class c2n_device : public device_t, { public: // construction/destruction - c2n_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); - c2n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c2n_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); + c2n_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; @@ -62,7 +62,7 @@ class c1530_device : public c2n_device { public: // construction/destruction - c1530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -72,7 +72,7 @@ class c1531_device : public c2n_device { public: // construction/destruction - c1531_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1531_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/pet/cass.cpp b/src/devices/bus/pet/cass.cpp index cb715a18434..5147908f1d1 100644 --- a/src/devices/bus/pet/cass.cpp +++ b/src/devices/bus/pet/cass.cpp @@ -51,7 +51,7 @@ device_pet_datassette_port_interface::~device_pet_datassette_port_interface() // pet_datassette_port_device - constructor //------------------------------------------------- -pet_datassette_port_device::pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pet_datassette_port_device::pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PET_DATASSETTE_PORT, "Datassette Port", tag, owner, clock, "pet_datassette_port", __FILE__), device_slot_interface(mconfig, *this), m_read_handler(*this), m_cart(nullptr) diff --git a/src/devices/bus/pet/cass.h b/src/devices/bus/pet/cass.h index a3dbda7797d..ab3d4432903 100644 --- a/src/devices/bus/pet/cass.h +++ b/src/devices/bus/pet/cass.h @@ -57,7 +57,7 @@ class pet_datassette_port_device : public device_t, { public: // construction/destruction - pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pet_datassette_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~pet_datassette_port_device(); // static configuration helpers diff --git a/src/devices/bus/pet/cb2snd.cpp b/src/devices/bus/pet/cb2snd.cpp index b2ef21f79b1..0b277a869ec 100644 --- a/src/devices/bus/pet/cb2snd.cpp +++ b/src/devices/bus/pet/cb2snd.cpp @@ -42,7 +42,7 @@ machine_config_constructor pet_userport_cb2_sound_device::device_mconfig_additio // pet_userport_cb2_sound_device - constructor //------------------------------------------------- -pet_userport_cb2_sound_device::pet_userport_cb2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pet_userport_cb2_sound_device::pet_userport_cb2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PET_USERPORT_CB2_SOUND_DEVICE, "PET Userport 'CB2 Sound' Device", tag, owner, clock, "petucb2", __FILE__), device_pet_user_port_interface(mconfig, *this), m_dac(*this, "dac") diff --git a/src/devices/bus/pet/cb2snd.h b/src/devices/bus/pet/cb2snd.h index e8caed04480..26c16ec6be4 100644 --- a/src/devices/bus/pet/cb2snd.h +++ b/src/devices/bus/pet/cb2snd.h @@ -24,7 +24,7 @@ class pet_userport_cb2_sound_device : public device_t, { public: // construction/destruction - pet_userport_cb2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pet_userport_cb2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/pet/diag.cpp b/src/devices/bus/pet/diag.cpp index 7cd73c6fff0..3c7be726494 100644 --- a/src/devices/bus/pet/diag.cpp +++ b/src/devices/bus/pet/diag.cpp @@ -26,7 +26,7 @@ const device_type PET_USERPORT_DIAGNOSTIC_CONNECTOR = &device_creator void set_callbacks(_read rd, _write wr) { @@ -62,14 +62,14 @@ public: // computer interface int norom_r(address_space &space, offs_t offset, int sel); - UINT8 read(address_space &space, offs_t offset, UINT8 data, int &sel); - void write(address_space &space, offs_t offset, UINT8 data, int &sel); + uint8_t read(address_space &space, offs_t offset, uint8_t data, int &sel); + void write(address_space &space, offs_t offset, uint8_t data, int &sel); DECLARE_READ_LINE_MEMBER( diag_r ); DECLARE_WRITE_LINE_MEMBER( irq_w ); // cartridge interface - UINT8 dma_bd_r(offs_t offset); - void dma_bd_w(offs_t offset, UINT8 data); + uint8_t dma_bd_r(offs_t offset); + void dma_bd_w(offs_t offset, uint8_t data); int phi2(); enum @@ -119,8 +119,8 @@ public: protected: // runtime virtual int pet_norom_r(address_space &space, offs_t offset, int sel) { return 1; } - virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel) { return data; }; - virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel) { }; + virtual uint8_t pet_bd_r(address_space &space, offs_t offset, uint8_t data, int &sel) { return data; }; + virtual void pet_bd_w(address_space &space, offs_t offset, uint8_t data, int &sel) { }; virtual int pet_diag_r() { return 1; } virtual void pet_irq_w(int state) { } diff --git a/src/devices/bus/pet/hsg.cpp b/src/devices/bus/pet/hsg.cpp index 3fa297e7a0d..765bd18b93a 100644 --- a/src/devices/bus/pet/hsg.cpp +++ b/src/devices/bus/pet/hsg.cpp @@ -149,7 +149,7 @@ machine_config_constructor cbm8000_hsg_b_t::device_mconfig_additions() const // cbm8000_hsg_t - constructor //------------------------------------------------- -cbm8000_hsg_t::cbm8000_hsg_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) : +cbm8000_hsg_t::cbm8000_hsg_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), device_pet_expansion_card_interface(mconfig, *this), m_gdc(*this, EF9365_TAG), @@ -158,12 +158,12 @@ cbm8000_hsg_t::cbm8000_hsg_t(const machine_config &mconfig, device_type type, co { } -cbm8000_hsg_a_t::cbm8000_hsg_a_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cbm8000_hsg_a_t::cbm8000_hsg_a_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cbm8000_hsg_t(mconfig, CBM8000_HSG_A, "CBM 8000 High Speed Graphics (A)", tag, owner, clock, "cbm8000_hsg_a", __FILE__) { } -cbm8000_hsg_b_t::cbm8000_hsg_b_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cbm8000_hsg_b_t::cbm8000_hsg_b_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cbm8000_hsg_t(mconfig, CBM8000_HSG_B, "CBM 8000 High Speed Graphics (B)", tag, owner, clock, "cbm8000_hsg_b", __FILE__) { } @@ -202,7 +202,7 @@ int cbm8000_hsg_t::pet_norom_r(address_space &space, offs_t offset, int sel) // pet_bd_r - buffered data read //------------------------------------------------- -UINT8 cbm8000_hsg_t::pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel) +uint8_t cbm8000_hsg_t::pet_bd_r(address_space &space, offs_t offset, uint8_t data, int &sel) { switch (sel) { @@ -251,7 +251,7 @@ UINT8 cbm8000_hsg_t::pet_bd_r(address_space &space, offs_t offset, UINT8 data, i // pet_bd_w - buffered data write //------------------------------------------------- -void cbm8000_hsg_t::pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel) +void cbm8000_hsg_t::pet_bd_w(address_space &space, offs_t offset, uint8_t data, int &sel) { if (offset == 0xaf00) { diff --git a/src/devices/bus/pet/hsg.h b/src/devices/bus/pet/hsg.h index b706124a5f1..ffb0b6cc385 100644 --- a/src/devices/bus/pet/hsg.h +++ b/src/devices/bus/pet/hsg.h @@ -28,15 +28,15 @@ class cbm8000_hsg_t : public device_t, { public: // construction/destruction - cbm8000_hsg_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); + cbm8000_hsg_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); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; // device_pet_expansion_card_interface overrides virtual int pet_norom_r(address_space &space, offs_t offset, int sel) override; - virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel) override; - virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel) override; + virtual uint8_t pet_bd_r(address_space &space, offs_t offset, uint8_t data, int &sel) override; + virtual void pet_bd_w(address_space &space, offs_t offset, uint8_t data, int &sel) override; protected: // device-level overrides @@ -56,7 +56,7 @@ class cbm8000_hsg_a_t : public cbm8000_hsg_t { public: // construction/destruction - cbm8000_hsg_a_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm8000_hsg_a_t(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; @@ -69,7 +69,7 @@ class cbm8000_hsg_b_t : public cbm8000_hsg_t { public: // construction/destruction - cbm8000_hsg_b_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cbm8000_hsg_b_t(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; diff --git a/src/devices/bus/pet/petuja.cpp b/src/devices/bus/pet/petuja.cpp index fa1c2deea88..4e225712d2d 100644 --- a/src/devices/bus/pet/petuja.cpp +++ b/src/devices/bus/pet/petuja.cpp @@ -59,7 +59,7 @@ ioport_constructor pet_userport_joystick_adapter_device::device_input_ports() co // pet_userport_joystick_adapter_device - constructor //------------------------------------------------- -pet_userport_joystick_adapter_device::pet_userport_joystick_adapter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pet_userport_joystick_adapter_device::pet_userport_joystick_adapter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PET_USERPORT_JOYSTICK_ADAPTER, "PET Userport Joystick Adapter", tag, owner, clock, "petuja", __FILE__), device_pet_user_port_interface(mconfig, *this), m_up1(1), diff --git a/src/devices/bus/pet/petuja.h b/src/devices/bus/pet/petuja.h index 720594e9561..0cb29c0c390 100644 --- a/src/devices/bus/pet/petuja.h +++ b/src/devices/bus/pet/petuja.h @@ -28,7 +28,7 @@ class pet_userport_joystick_adapter_device : public device_t, { public: // construction/destruction - pet_userport_joystick_adapter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pet_userport_joystick_adapter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/pet/superpet.cpp b/src/devices/bus/pet/superpet.cpp index 174ade45079..7cefd6a1df3 100644 --- a/src/devices/bus/pet/superpet.cpp +++ b/src/devices/bus/pet/superpet.cpp @@ -174,7 +174,7 @@ inline bool superpet_device::is_ram_writable() // superpet_device - constructor //------------------------------------------------- -superpet_device::superpet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +superpet_device::superpet_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SUPERPET, "SuperPET", tag, owner, clock, "pet_superpet", __FILE__), device_pet_expansion_card_interface(mconfig, *this), m_maincpu(*this, M6809_TAG), @@ -243,7 +243,7 @@ int superpet_device::pet_norom_r(address_space &space, offs_t offset, int sel) // pet_bd_r - buffered data read //------------------------------------------------- -UINT8 superpet_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel) +uint8_t superpet_device::pet_bd_r(address_space &space, offs_t offset, uint8_t data, int &sel) { int norom = pet_norom_r(space, offset, sel); @@ -304,7 +304,7 @@ UINT8 superpet_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data, // pet_bd_w - buffered data write //------------------------------------------------- -void superpet_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel) +void superpet_device::pet_bd_w(address_space &space, offs_t offset, uint8_t data, int &sel) { switch (sel) { diff --git a/src/devices/bus/pet/superpet.h b/src/devices/bus/pet/superpet.h index 4ec50f0d906..74caac39d73 100644 --- a/src/devices/bus/pet/superpet.h +++ b/src/devices/bus/pet/superpet.h @@ -28,7 +28,7 @@ class superpet_device : public device_t, { public: // construction/destruction - superpet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + superpet_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; @@ -46,8 +46,8 @@ protected: // device_pet_expansion_card_interface overrides virtual int pet_norom_r(address_space &space, offs_t offset, int sel) override; - virtual UINT8 pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel) override; - virtual void pet_bd_w(address_space &space, offs_t offset, UINT8 data, int &sel) override; + virtual uint8_t pet_bd_r(address_space &space, offs_t offset, uint8_t data, int &sel) override; + virtual void pet_bd_w(address_space &space, offs_t offset, uint8_t data, int &sel) override; virtual int pet_diag_r() override; virtual void pet_irq_w(int state) override; @@ -56,17 +56,17 @@ private: required_device m_acia; required_device m_dongle; required_memory_region m_rom; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; required_ioport m_io_sw1; required_ioport m_io_sw2; inline void update_cpu(); inline bool is_ram_writable(); - UINT8 m_system; - UINT8 m_bank; - UINT8 m_sw1; - UINT8 m_sw2; + uint8_t m_system; + uint8_t m_bank; + uint8_t m_sw1; + uint8_t m_sw2; int m_sel9_rom; int m_pet_irq; int m_acia_irq; diff --git a/src/devices/bus/pet/user.cpp b/src/devices/bus/pet/user.cpp index c79f9eec83a..dc1bc4e84b1 100644 --- a/src/devices/bus/pet/user.cpp +++ b/src/devices/bus/pet/user.cpp @@ -12,7 +12,7 @@ const device_type PET_USER_PORT = &device_creator; -pet_user_port_device::pet_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pet_user_port_device::pet_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PET_USER_PORT, "PET user port", tag, owner, clock, "pet_user_port", __FILE__), device_slot_interface(mconfig, *this), m_2_handler(*this), diff --git a/src/devices/bus/pet/user.h b/src/devices/bus/pet/user.h index 6b402691b17..f85a3e876ad 100644 --- a/src/devices/bus/pet/user.h +++ b/src/devices/bus/pet/user.h @@ -101,7 +101,7 @@ class pet_user_port_device : public device_t, friend class device_pet_user_port_interface; public: - pet_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pet_user_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_2_handler(device_t &device, _Object object) { return downcast(device).m_2_handler.set_callback(object); } template static devcb_base &set_3_handler(device_t &device, _Object object) { return downcast(device).m_3_handler.set_callback(object); } diff --git a/src/devices/bus/plus4/c1551.cpp b/src/devices/bus/plus4/c1551.cpp index d456580f67a..84792e28c79 100644 --- a/src/devices/bus/plus4/c1551.cpp +++ b/src/devices/bus/plus4/c1551.cpp @@ -73,7 +73,7 @@ READ8_MEMBER( c1551_t::port_r ) */ - UINT8 data = 0; + uint8_t data = 0; // write protect sense data |= !m_floppy->wpt_r() << 4; @@ -161,7 +161,7 @@ WRITE8_MEMBER( c1551_t::tcbm_data_w ) READ8_MEMBER( c1551_t::tpi0_r ) { - UINT8 data = m_tpi0->read(space, offset); + uint8_t data = m_tpi0->read(space, offset); m_ga->ted_w(0); m_ga->ted_w(1); @@ -194,7 +194,7 @@ READ8_MEMBER( c1551_t::tpi0_pc_r ) */ - UINT8 data = 0; + uint8_t data = 0; // JP1 data |= m_jp1->read() << 5; @@ -279,7 +279,7 @@ READ8_MEMBER( c1551_t::tpi1_pc_r ) */ - UINT8 data = 0; + uint8_t data = 0; // TCBM acknowledge data |= m_ack << 7; @@ -413,7 +413,7 @@ ioport_constructor c1551_t::device_input_ports() const // c1551_t - constructor //------------------------------------------------- -c1551_t::c1551_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c1551_t::c1551_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C1551, "C1551", tag, owner, clock, "c1551", __FILE__), device_plus4_expansion_card_interface(mconfig, *this), m_maincpu(*this, M6510T_TAG), @@ -504,8 +504,8 @@ bool c1551_t::tpi1_selected(offs_t offset) { #ifdef PLA_DUMPED int mux = 0, ras = 0, phi0 = 0, f7 = 0; - UINT16 input = A5 << 15 | A6 << 14 | A7 << 13 | A8 << 12 | A9 << 11 | mux << 10 | A10 << 9 | m_dev << 8 | ras << 7 | phi0 << 6 | A15 << 5 | A14 << 4 | A13 << 3 | A12 << 2 | A11 << 1 | f7; - UINT8 data = m_pla->read(input); + uint16_t input = A5 << 15 | A6 << 14 | A7 << 13 | A8 << 12 | A9 << 11 | mux << 10 | A10 << 9 | m_dev << 8 | ras << 7 | phi0 << 6 | A15 << 5 | A14 << 4 | A13 << 3 | A12 << 2 | A11 << 1 | f7; + uint8_t data = m_pla->read(input); return BIT(data, 0) ? true : false; #endif @@ -524,7 +524,7 @@ bool c1551_t::tpi1_selected(offs_t offset) // plus4_cd_r - cartridge data read //------------------------------------------------- -UINT8 c1551_t::plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) +uint8_t c1551_t::plus4_cd_r(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { data = m_exp->cd_r(space, offset, data, ba, cs0, c1l, c2l, cs1, c1h, c2h); @@ -541,7 +541,7 @@ UINT8 c1551_t::plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int b // plus4_cd_w - cartridge data write //------------------------------------------------- -void c1551_t::plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) +void c1551_t::plus4_cd_w(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { if (tpi1_selected(offset)) { diff --git a/src/devices/bus/plus4/c1551.h b/src/devices/bus/plus4/c1551.h index 39fdd69b0df..86631adc691 100644 --- a/src/devices/bus/plus4/c1551.h +++ b/src/devices/bus/plus4/c1551.h @@ -31,7 +31,7 @@ class c1551_t : public device_t, { public: // construction/destruction - c1551_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c1551_t(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; @@ -61,8 +61,8 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_plus4_expansion_card_interface overrides - virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; - virtual void plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; + virtual uint8_t plus4_cd_r(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; + virtual void plus4_cd_w(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; private: enum @@ -83,7 +83,7 @@ private: required_ioport m_jp1; // TCBM bus - UINT8 m_tcbm_data; // data + uint8_t m_tcbm_data; // data int m_status; // status int m_dav; // data valid int m_ack; // acknowledge diff --git a/src/devices/bus/plus4/diag264_lb_user.cpp b/src/devices/bus/plus4/diag264_lb_user.cpp index 10d93e462e6..fc47373a2e1 100644 --- a/src/devices/bus/plus4/diag264_lb_user.cpp +++ b/src/devices/bus/plus4/diag264_lb_user.cpp @@ -26,7 +26,7 @@ const device_type DIAG264_USER_PORT_LOOPBACK = &device_creator static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } template static devcb_base &set_cd_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_dma_cd.set_callback(object); } @@ -103,8 +103,8 @@ public: template static devcb_base &set_aec_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_aec.set_callback(object); } // computer interface - UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); - void cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); + uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); + void cd_w(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h); // cartridge interface DECLARE_READ8_MEMBER( dma_cd_r ) { return m_read_dma_cd(offset); } @@ -157,14 +157,14 @@ public: virtual ~device_plus4_expansion_card_interface(); // runtime - virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { return data; }; - virtual void plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { }; + virtual uint8_t plus4_cd_r(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { return data; }; + virtual void plus4_cd_w(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { }; protected: - optional_shared_ptr m_c1l; - optional_shared_ptr m_c1h; - optional_shared_ptr m_c2l; - optional_shared_ptr m_c2h; + optional_shared_ptr m_c1l; + optional_shared_ptr m_c1h; + optional_shared_ptr m_c2l; + optional_shared_ptr m_c2h; size_t m_c1l_mask; size_t m_c1h_mask; diff --git a/src/devices/bus/plus4/sid.cpp b/src/devices/bus/plus4/sid.cpp index d5b72e2a0ea..61ae71a66fe 100644 --- a/src/devices/bus/plus4/sid.cpp +++ b/src/devices/bus/plus4/sid.cpp @@ -90,7 +90,7 @@ machine_config_constructor plus4_sid_cartridge_device::device_mconfig_additions( // plus4_sid_cartridge_device - constructor //------------------------------------------------- -plus4_sid_cartridge_device::plus4_sid_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +plus4_sid_cartridge_device::plus4_sid_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PLUS4_SID, "Plus/4 SID cartridge", tag, owner, clock, "plus4_sid", __FILE__), device_plus4_expansion_card_interface(mconfig, *this), m_sid(*this, MOS8580_TAG), @@ -122,7 +122,7 @@ void plus4_sid_cartridge_device::device_reset() // plus4_cd_r - cartridge data read //------------------------------------------------- -UINT8 plus4_sid_cartridge_device::plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) +uint8_t plus4_sid_cartridge_device::plus4_cd_r(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { if ((offset >= 0xfe80 && offset < 0xfea0) || (offset >= 0xfd40 && offset < 0xfd60)) { @@ -141,7 +141,7 @@ UINT8 plus4_sid_cartridge_device::plus4_cd_r(address_space &space, offs_t offset // plus4_cd_w - cartridge data write //------------------------------------------------- -void plus4_sid_cartridge_device::plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) +void plus4_sid_cartridge_device::plus4_cd_w(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { if ((offset >= 0xfe80 && offset < 0xfea0) || (offset >= 0xfd40 && offset < 0xfd60)) { diff --git a/src/devices/bus/plus4/sid.h b/src/devices/bus/plus4/sid.h index 2c9f59c98f2..c465b2be458 100644 --- a/src/devices/bus/plus4/sid.h +++ b/src/devices/bus/plus4/sid.h @@ -29,7 +29,7 @@ class plus4_sid_cartridge_device : public device_t, { public: // construction/destruction - plus4_sid_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + plus4_sid_cartridge_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; @@ -41,8 +41,8 @@ protected: virtual void device_reset() override; // device_plus4_expansion_card_interface overrides - virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; - virtual void plus4_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; + virtual uint8_t plus4_cd_r(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; + virtual void plus4_cd_w(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; virtual void plus4_breset_w(int state); private: diff --git a/src/devices/bus/plus4/std.cpp b/src/devices/bus/plus4/std.cpp index 8627f99cc30..3fdab218138 100644 --- a/src/devices/bus/plus4/std.cpp +++ b/src/devices/bus/plus4/std.cpp @@ -26,7 +26,7 @@ const device_type PLUS4_STD = &device_creator; // plus4_standard_cartridge_device - constructor //------------------------------------------------- -plus4_standard_cartridge_device::plus4_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +plus4_standard_cartridge_device::plus4_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PLUS4_STD, "Plus/4 standard cartridge", tag, owner, clock, "plus4_standard", __FILE__), device_plus4_expansion_card_interface(mconfig, *this) { @@ -46,7 +46,7 @@ void plus4_standard_cartridge_device::device_start() // plus4_cd_r - cartridge data read //------------------------------------------------- -UINT8 plus4_standard_cartridge_device::plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) +uint8_t plus4_standard_cartridge_device::plus4_cd_r(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) { if (!c1l && m_c1l.bytes()) { diff --git a/src/devices/bus/plus4/std.h b/src/devices/bus/plus4/std.h index 29fe1d16b13..f4cde993c40 100644 --- a/src/devices/bus/plus4/std.h +++ b/src/devices/bus/plus4/std.h @@ -27,14 +27,14 @@ class plus4_standard_cartridge_device : public device_t, { public: // construction/destruction - plus4_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + plus4_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_plus4_expansion_card_interface overrides - virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; + virtual uint8_t plus4_cd_r(address_space &space, offs_t offset, uint8_t data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h) override; }; diff --git a/src/devices/bus/pofo/ccm.cpp b/src/devices/bus/pofo/ccm.cpp index a28f29c7637..2b2a3a13a94 100644 --- a/src/devices/bus/pofo/ccm.cpp +++ b/src/devices/bus/pofo/ccm.cpp @@ -44,7 +44,7 @@ device_portfolio_memory_card_slot_interface::device_portfolio_memory_card_slot_i // portfolio_memory_card_slot_t - constructor //------------------------------------------------- -portfolio_memory_card_slot_t::portfolio_memory_card_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +portfolio_memory_card_slot_t::portfolio_memory_card_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PORTFOLIO_MEMORY_CARD_SLOT, "Atari Portfolio memory card port", tag, owner, clock, "portfolio_ccm_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), diff --git a/src/devices/bus/pofo/ccm.h b/src/devices/bus/pofo/ccm.h index bba109912c4..b950225b82d 100644 --- a/src/devices/bus/pofo/ccm.h +++ b/src/devices/bus/pofo/ccm.h @@ -91,12 +91,12 @@ public: virtual bool cdet() { return 1; } - virtual UINT8 nrdi_r(address_space &space, offs_t offset) { return 0xff; }; - virtual void nwri_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t nrdi_r(address_space &space, offs_t offset) { return 0xff; }; + virtual void nwri_w(address_space &space, offs_t offset, uint8_t data) { }; protected: - optional_shared_ptr m_rom; - optional_shared_ptr m_nvram; + optional_shared_ptr m_rom; + optional_shared_ptr m_nvram; portfolio_memory_card_slot_t *m_slot; }; @@ -110,7 +110,7 @@ class portfolio_memory_card_slot_t : public device_t, { public: // construction/destruction - portfolio_memory_card_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + portfolio_memory_card_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~portfolio_memory_card_slot_t() { } // computer interface diff --git a/src/devices/bus/pofo/exp.cpp b/src/devices/bus/pofo/exp.cpp index ce7adb0d1fb..68613967ff3 100644 --- a/src/devices/bus/pofo/exp.cpp +++ b/src/devices/bus/pofo/exp.cpp @@ -47,7 +47,7 @@ WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::wake_w ) { m_slot- // portfolio_expansion_slot_t - constructor //------------------------------------------------- -portfolio_expansion_slot_t::portfolio_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +portfolio_expansion_slot_t::portfolio_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PORTFOLIO_EXPANSION_SLOT, "Atari Portfolio expansion port", tag, owner, clock, "portfolio_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_write_iint(*this), diff --git a/src/devices/bus/pofo/exp.h b/src/devices/bus/pofo/exp.h index 81777cf9852..8bfabe9bf93 100644 --- a/src/devices/bus/pofo/exp.h +++ b/src/devices/bus/pofo/exp.h @@ -97,11 +97,11 @@ public: virtual bool pdet() { return 0; } virtual bool cdet() { return 1; } - virtual UINT8 iack_r() { return 0xff; } - virtual UINT8 eack_r() { return 0xff; } + virtual uint8_t iack_r() { return 0xff; } + virtual uint8_t eack_r() { return 0xff; } - virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { return data; }; - virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { }; + virtual uint8_t nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { return data; }; + virtual void nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { }; DECLARE_WRITE_LINE_MEMBER( iint_w ); DECLARE_WRITE_LINE_MEMBER( eint_w ); @@ -120,7 +120,7 @@ class portfolio_expansion_slot_t : public device_t, { public: // construction/destruction - portfolio_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + portfolio_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~portfolio_expansion_slot_t() { } template static devcb_base &set_iint_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_iint.set_callback(object); } @@ -133,11 +133,11 @@ public: bool pdet_r() { return (m_card != nullptr) ? m_card->pdet() : 0; } bool cdet_r() { return (m_card != nullptr) ? m_card->cdet() : 1; } - UINT8 iack_r() { return (m_card != nullptr) ? m_card->iack_r() : 0xff; }; - UINT8 eack_r() { return (m_card != nullptr) ? m_card->eack_r() : 0xff; }; + uint8_t iack_r() { return (m_card != nullptr) ? m_card->iack_r() : 0xff; }; + uint8_t eack_r() { return (m_card != nullptr) ? m_card->eack_r() : 0xff; }; - UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { return (m_card != nullptr) ? m_card->nrdi_r(space, offset, data, iom, bcom, ncc1) : data; } - void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { if (m_card != nullptr) m_card->nwri_w(space, offset, data, iom, bcom, ncc1); } + uint8_t nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { return (m_card != nullptr) ? m_card->nrdi_r(space, offset, data, iom, bcom, ncc1) : data; } + void nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { if (m_card != nullptr) m_card->nwri_w(space, offset, data, iom, bcom, ncc1); } // peripheral interface WRITE_LINE_MEMBER( iint_w ) { m_write_iint(state); } diff --git a/src/devices/bus/pofo/hpc101.cpp b/src/devices/bus/pofo/hpc101.cpp index b3286d2b0ef..78f97aa3d53 100644 --- a/src/devices/bus/pofo/hpc101.cpp +++ b/src/devices/bus/pofo/hpc101.cpp @@ -75,7 +75,7 @@ machine_config_constructor hpc101_t::device_mconfig_additions() const // hpc101_t - constructor //------------------------------------------------- -hpc101_t::hpc101_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +hpc101_t::hpc101_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HPC101, "Atari Portfolio HPC-101", tag, owner, clock, "hpc101", __FILE__), device_portfolio_expansion_slot_interface(mconfig, *this), m_ppi(*this, M82C55A_TAG) @@ -106,7 +106,7 @@ void hpc101_t::device_reset() // nrdi_r - read //------------------------------------------------- -UINT8 hpc101_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +uint8_t hpc101_t::nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { if (!bcom) { @@ -129,7 +129,7 @@ UINT8 hpc101_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom // nwri_w - write //------------------------------------------------- -void hpc101_t::nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +void hpc101_t::nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { if (!bcom) { diff --git a/src/devices/bus/pofo/hpc101.h b/src/devices/bus/pofo/hpc101.h index 7fbdd58a1a9..03a449d8112 100644 --- a/src/devices/bus/pofo/hpc101.h +++ b/src/devices/bus/pofo/hpc101.h @@ -29,7 +29,7 @@ class hpc101_t : public device_t, { public: // construction/destruction - hpc101_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hpc101_t(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; @@ -42,8 +42,8 @@ protected: // device_portfolio_expansion_slot_interface overrides bool pdet() override { return 1; } - virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; - virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; + virtual uint8_t nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) override; + virtual void nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) override; private: required_device m_ppi; diff --git a/src/devices/bus/pofo/hpc102.cpp b/src/devices/bus/pofo/hpc102.cpp index 4ad13bd2308..5d9a13ce531 100644 --- a/src/devices/bus/pofo/hpc102.cpp +++ b/src/devices/bus/pofo/hpc102.cpp @@ -67,7 +67,7 @@ machine_config_constructor hpc102_t::device_mconfig_additions() const // hpc102_t - constructor //------------------------------------------------- -hpc102_t::hpc102_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +hpc102_t::hpc102_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HPC102, "Atari Portfolio HPC-102", tag, owner, clock, "hpc102", __FILE__), device_portfolio_expansion_slot_interface(mconfig, *this), m_uart(*this, M82C50A_TAG) @@ -98,7 +98,7 @@ void hpc102_t::device_reset() // eack_r - external interrupt acknowledge //------------------------------------------------- -UINT8 hpc102_t::eack_r() +uint8_t hpc102_t::eack_r() { return m_vector; } @@ -108,7 +108,7 @@ UINT8 hpc102_t::eack_r() // nrdi_r - read //------------------------------------------------- -UINT8 hpc102_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +uint8_t hpc102_t::nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { if (!bcom) { @@ -131,7 +131,7 @@ UINT8 hpc102_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom // nwri_w - write //------------------------------------------------- -void hpc102_t::nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +void hpc102_t::nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { if (!bcom) { diff --git a/src/devices/bus/pofo/hpc102.h b/src/devices/bus/pofo/hpc102.h index fc251b2e87b..baef3f4ec7d 100644 --- a/src/devices/bus/pofo/hpc102.h +++ b/src/devices/bus/pofo/hpc102.h @@ -29,7 +29,7 @@ class hpc102_t : public device_t, { public: // construction/destruction - hpc102_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hpc102_t(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; @@ -42,15 +42,15 @@ protected: // device_portfolio_expansion_slot_interface overrides bool pdet() override { return 1; } - virtual UINT8 eack_r() override; + virtual uint8_t eack_r() override; - virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; - virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; + virtual uint8_t nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) override; + virtual void nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) override; private: required_device m_uart; - UINT8 m_vector; + uint8_t m_vector; }; diff --git a/src/devices/bus/pofo/hpc104.cpp b/src/devices/bus/pofo/hpc104.cpp index 9a2cfa6b8cc..03c982f792e 100644 --- a/src/devices/bus/pofo/hpc104.cpp +++ b/src/devices/bus/pofo/hpc104.cpp @@ -105,7 +105,7 @@ ioport_constructor hpc104_2_t::device_input_ports() const // hpc104_t - constructor //------------------------------------------------- -hpc104_t::hpc104_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) : +hpc104_t::hpc104_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), device_portfolio_expansion_slot_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -116,7 +116,7 @@ hpc104_t::hpc104_t(const machine_config &mconfig, device_type type, const char * { } -hpc104_t::hpc104_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +hpc104_t::hpc104_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HPC104, "Atari Portfolio HPC-104", tag, owner, clock, "hpc104", __FILE__), device_portfolio_expansion_slot_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -132,7 +132,7 @@ hpc104_t::hpc104_t(const machine_config &mconfig, const char *tag, device_t *own // hpc104_2_t - constructor //------------------------------------------------- -hpc104_2_t::hpc104_2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +hpc104_2_t::hpc104_2_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hpc104_t(mconfig, HPC104_2, "Atari Portfolio HPC-104 (Unit 2)", tag, owner, clock, "hpc104_2", __FILE__) { } @@ -161,7 +161,7 @@ void hpc104_t::device_reset() // nrdi_r - read //------------------------------------------------- -UINT8 hpc104_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +uint8_t hpc104_t::nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { data = m_exp->nrdi_r(space, offset, data, iom, bcom, m_ncc1_out || ncc1); @@ -198,7 +198,7 @@ UINT8 hpc104_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom // nwri_w - write //------------------------------------------------- -void hpc104_t::nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +void hpc104_t::nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) { m_exp->nwri_w(space, offset, data, iom, bcom, m_ncc1_out || ncc1); diff --git a/src/devices/bus/pofo/hpc104.h b/src/devices/bus/pofo/hpc104.h index 9d930c21347..9dda5f9778b 100644 --- a/src/devices/bus/pofo/hpc104.h +++ b/src/devices/bus/pofo/hpc104.h @@ -30,8 +30,8 @@ class hpc104_t : public device_t, { public: // construction/destruction - hpc104_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); - hpc104_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hpc104_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); + hpc104_t(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; @@ -50,13 +50,13 @@ protected: // device_portfolio_expansion_slot_interface overrides virtual bool nmd1() override { return m_ccm->cdet_r(); } - virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; - virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; + virtual uint8_t nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) override; + virtual void nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) override; private: required_device m_ccm; required_device m_exp; - optional_shared_ptr m_nvram; + optional_shared_ptr m_nvram; required_ioport m_io_sw1; bool m_sw1; @@ -70,7 +70,7 @@ class hpc104_2_t : public hpc104_t { public: // construction/destruction - hpc104_2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hpc104_2_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/pofo/ram.cpp b/src/devices/bus/pofo/ram.cpp index e1fdce1b7ad..b4f9cce087e 100644 --- a/src/devices/bus/pofo/ram.cpp +++ b/src/devices/bus/pofo/ram.cpp @@ -25,7 +25,7 @@ const device_type PORTFOLIO_RAM_CARD = &device_creator; // portfolio_ram_card_t - constructor //------------------------------------------------- -portfolio_ram_card_t::portfolio_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +portfolio_ram_card_t::portfolio_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PORTFOLIO_RAM_CARD, "Atari Portfolio RAM card", tag, owner, clock, "portfolio_ram_card", __FILE__), device_portfolio_memory_card_slot_interface(mconfig, *this), device_nvram_interface(mconfig, *this) @@ -47,7 +47,7 @@ void portfolio_ram_card_t::device_start() // nrdi_r - read //------------------------------------------------- -UINT8 portfolio_ram_card_t::nrdi_r(address_space &space, offs_t offset) +uint8_t portfolio_ram_card_t::nrdi_r(address_space &space, offs_t offset) { return m_nvram[offset]; } @@ -57,7 +57,7 @@ UINT8 portfolio_ram_card_t::nrdi_r(address_space &space, offs_t offset) // nwri_w - write //------------------------------------------------- -void portfolio_ram_card_t::nwri_w(address_space &space, offs_t offset, UINT8 data) +void portfolio_ram_card_t::nwri_w(address_space &space, offs_t offset, uint8_t data) { m_nvram[offset] = data; } diff --git a/src/devices/bus/pofo/ram.h b/src/devices/bus/pofo/ram.h index 2bf6bed60f0..2b0cf2722ba 100644 --- a/src/devices/bus/pofo/ram.h +++ b/src/devices/bus/pofo/ram.h @@ -29,7 +29,7 @@ class portfolio_ram_card_t : public device_t, { public: // construction/destruction - portfolio_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + portfolio_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -43,8 +43,8 @@ protected: // device_portfolio_memory_card_slot_interface overrides virtual bool cdet() override { return 0; } - virtual UINT8 nrdi_r(address_space &space, offs_t offset) override; - virtual void nwri_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t nrdi_r(address_space &space, offs_t offset) override; + virtual void nwri_w(address_space &space, offs_t offset, uint8_t data) override; }; diff --git a/src/devices/bus/pofo/rom.cpp b/src/devices/bus/pofo/rom.cpp index fbc4c5961b5..3b182f4eb32 100644 --- a/src/devices/bus/pofo/rom.cpp +++ b/src/devices/bus/pofo/rom.cpp @@ -25,7 +25,7 @@ const device_type PORTFOLIO_ROM_CARD = &device_creator; // portfolio_rom_card_t - constructor //------------------------------------------------- -portfolio_rom_card_t::portfolio_rom_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +portfolio_rom_card_t::portfolio_rom_card_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PORTFOLIO_ROM_CARD, "Atari Portfolio ROM card", tag, owner, clock, "portfolio_rom_card", __FILE__), device_portfolio_memory_card_slot_interface(mconfig, *this) { @@ -45,7 +45,7 @@ void portfolio_rom_card_t::device_start() // nrdi_r - read //------------------------------------------------- -UINT8 portfolio_rom_card_t::nrdi_r(address_space &space, offs_t offset) +uint8_t portfolio_rom_card_t::nrdi_r(address_space &space, offs_t offset) { return m_rom[offset]; } diff --git a/src/devices/bus/pofo/rom.h b/src/devices/bus/pofo/rom.h index 6ee7a1ffd04..65f1c3e28d7 100644 --- a/src/devices/bus/pofo/rom.h +++ b/src/devices/bus/pofo/rom.h @@ -27,7 +27,7 @@ class portfolio_rom_card_t : public device_t, { public: // construction/destruction - portfolio_rom_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + portfolio_rom_card_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -36,7 +36,7 @@ protected: // device_portfolio_memory_card_slot_interface overrides virtual bool cdet() override { return 0; } - virtual UINT8 nrdi_r(address_space &space, offs_t offset) override; + virtual uint8_t nrdi_r(address_space &space, offs_t offset) override; }; diff --git a/src/devices/bus/psx/analogue.cpp b/src/devices/bus/psx/analogue.cpp index 69d980e5843..aa4cb65e88f 100644 --- a/src/devices/bus/psx/analogue.cpp +++ b/src/devices/bus/psx/analogue.cpp @@ -5,7 +5,7 @@ const device_type PSX_ANALOG_JOYSTICK = &device_creator; const device_type PSX_DUALSHOCK = &device_creator; -psx_analog_controller_device::psx_analog_controller_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) : +psx_analog_controller_device::psx_analog_controller_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_psx_controller_interface(mconfig, *this), m_type(), @@ -23,13 +23,13 @@ psx_analog_controller_device::psx_analog_controller_device(const machine_config { } -psx_dualshock_device::psx_dualshock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psx_dualshock_device::psx_dualshock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psx_analog_controller_device(mconfig, PSX_DUALSHOCK, "Playstation Dualshock Pad", tag, owner, clock, "psx_dualshock_pad", __FILE__) { m_type = DUALSHOCK; } -psx_analog_joystick_device::psx_analog_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psx_analog_joystick_device::psx_analog_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psx_analog_controller_device(mconfig, PSX_ANALOG_JOYSTICK, "Playstation Analog Joystick", tag, owner, clock, "psx_analog_joystick", __FILE__) { m_type = JOYSTICK; @@ -44,9 +44,9 @@ void psx_analog_controller_device::device_reset() m_cmd = 0; } -UINT8 psx_analog_controller_device::pad_data(int count, bool analog) +uint8_t psx_analog_controller_device::pad_data(int count, bool analog) { - UINT8 data = 0; + uint8_t data = 0; switch(count) { case 2: @@ -73,7 +73,7 @@ UINT8 psx_analog_controller_device::pad_data(int count, bool analog) return data; } -bool psx_analog_controller_device::get_pad(int count, UINT8 *odata, UINT8 idata) +bool psx_analog_controller_device::get_pad(int count, uint8_t *odata, uint8_t idata) { if(m_confmode) { @@ -116,7 +116,7 @@ bool psx_analog_controller_device::get_pad(int count, UINT8 *odata, UINT8 idata) break; case 0x45: // get mode ? { - const UINT8 val[] = { 1, 2, 0, 2, 1, 0 }; + const uint8_t val[] = { 1, 2, 0, 2, 1, 0 }; if(count == 4) *odata = m_analogmode; else @@ -125,7 +125,7 @@ bool psx_analog_controller_device::get_pad(int count, UINT8 *odata, UINT8 idata) } case 0x46: // query act (vibrate) ? { - const UINT8 val[2][6] = {{ 0, 0, 1, 2, 0, 10 }, + const uint8_t val[2][6] = {{ 0, 0, 1, 2, 0, 10 }, { 0, 0, 1, 1, 1, 14 }}; *odata = val[m_temp][count-2]; if(count == 3) @@ -134,7 +134,7 @@ bool psx_analog_controller_device::get_pad(int count, UINT8 *odata, UINT8 idata) } case 0x47: // query comb (combination?) ? { - const UINT8 val[] = { 0, 0, 2, 0, 1, 0 }; + const uint8_t val[] = { 0, 0, 2, 0, 1, 0 }; *odata = val[count-2]; break; } diff --git a/src/devices/bus/psx/analogue.h b/src/devices/bus/psx/analogue.h index 9fab90f3625..4a52a0cb80e 100644 --- a/src/devices/bus/psx/analogue.h +++ b/src/devices/bus/psx/analogue.h @@ -12,7 +12,7 @@ class psx_analog_controller_device : public device_t, public device_psx_controller_interface { public: - psx_analog_controller_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); + psx_analog_controller_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 ioport_constructor device_input_ports() const override; DECLARE_INPUT_CHANGED_MEMBER(change_mode); @@ -24,15 +24,15 @@ protected: DUALSHOCK } m_type; private: - virtual bool get_pad(int count, UINT8 *odata, UINT8 idata) override; - UINT8 pad_data(int count, bool analog); + virtual bool get_pad(int count, uint8_t *odata, uint8_t idata) override; + uint8_t pad_data(int count, bool analog); bool m_confmode; bool m_analogmode; bool m_analoglock; - UINT8 m_temp; - UINT8 m_cmd; + uint8_t m_temp; + uint8_t m_cmd; required_ioport m_pad0; required_ioport m_pad1; @@ -45,13 +45,13 @@ private: class psx_dualshock_device : public psx_analog_controller_device { public: - psx_dualshock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psx_dualshock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class psx_analog_joystick_device : public psx_analog_controller_device { public: - psx_analog_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psx_analog_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; #endif /* PSXANALOG_H_ */ diff --git a/src/devices/bus/psx/ctlrport.cpp b/src/devices/bus/psx/ctlrport.cpp index 5f84e482b4d..dfbfca0ef48 100644 --- a/src/devices/bus/psx/ctlrport.cpp +++ b/src/devices/bus/psx/ctlrport.cpp @@ -8,7 +8,7 @@ const device_type PSX_CONTROLLER_PORT = &device_creator; -psx_controller_port_device::psx_controller_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psx_controller_port_device::psx_controller_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSX_CONTROLLER_PORT, "Playstation Controller Port", tag, owner, clock, "psx_controller_port", __FILE__), device_slot_interface(mconfig, *this), m_tx(false), @@ -41,7 +41,7 @@ void psx_controller_port_device::disable_card(bool state) const device_type PSXCONTROLLERPORTS = &device_creator; -psxcontrollerports_device::psxcontrollerports_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +psxcontrollerports_device::psxcontrollerports_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSXCONTROLLERPORTS, "PSXCONTROLLERPORTS", tag, owner, clock, "psxcontrollerports", __FILE__), m_port0(nullptr), m_port1(nullptr), m_dsr_handler(*this), m_rxd_handler(*this) @@ -173,7 +173,7 @@ void device_psx_controller_interface::sel_w(bool state) { const device_type PSX_STANDARD_CONTROLLER = &device_creator; -psx_standard_controller_device::psx_standard_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psx_standard_controller_device::psx_standard_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSX_STANDARD_CONTROLLER, "Playstation Standard Controller", tag, owner, clock, "psx_standard_controller", __FILE__), device_psx_controller_interface(mconfig, *this), m_pad0(*this,"PSXPAD0"), @@ -181,7 +181,7 @@ psx_standard_controller_device::psx_standard_controller_device(const machine_con { } -bool psx_standard_controller_device::get_pad(int count, UINT8 *odata, UINT8 idata) +bool psx_standard_controller_device::get_pad(int count, uint8_t *odata, uint8_t idata) { switch(count) { diff --git a/src/devices/bus/psx/ctlrport.h b/src/devices/bus/psx/ctlrport.h index 09f1b947eab..24a72de1439 100644 --- a/src/devices/bus/psx/ctlrport.h +++ b/src/devices/bus/psx/ctlrport.h @@ -43,12 +43,12 @@ protected: }; private: - virtual bool get_pad(int count, UINT8 *odata, UINT8 idata) = 0; + virtual bool get_pad(int count, uint8_t *odata, uint8_t idata) = 0; virtual void do_pad(); void ack_timer(void *ptr, int param); - UINT8 m_odata; - UINT8 m_idata; + uint8_t m_odata; + uint8_t m_idata; int m_bit; int m_count; bool m_memcard; @@ -66,14 +66,14 @@ class psx_standard_controller_device : public device_t, public device_psx_controller_interface { public: - psx_standard_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psx_standard_controller_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 { } private: - virtual bool get_pad(int count, UINT8 *odata, UINT8 idata) override; + virtual bool get_pad(int count, uint8_t *odata, uint8_t idata) override; required_ioport m_pad0; required_ioport m_pad1; @@ -88,7 +88,7 @@ private: class psxcontrollerports_device : public device_t { public: - psxcontrollerports_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psxcontrollerports_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void ack(); template static devcb_base &set_dsr_handler(device_t &device, _Object object) { return downcast(device).m_dsr_handler.set_callback(object); } @@ -113,7 +113,7 @@ class psx_controller_port_device : public device_t, public device_slot_interface { public: - psx_controller_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psx_controller_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; typedef delegate void_cb; diff --git a/src/devices/bus/psx/memcard.cpp b/src/devices/bus/psx/memcard.cpp index 0b0a33a8856..50d36d19a9b 100644 --- a/src/devices/bus/psx/memcard.cpp +++ b/src/devices/bus/psx/memcard.cpp @@ -41,7 +41,7 @@ enum transfer_states state_end }; -psxcard_device::psxcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +psxcard_device::psxcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSXCARD, "Sony PSX Memory Card", tag, owner, clock, "psxcard", __FILE__), device_image_interface(mconfig, *this), pkt_ptr(0), @@ -113,7 +113,7 @@ void psxcard_device::device_config_complete() // // -bool psxcard_device::transfer(UINT8 to, UINT8 *from) +bool psxcard_device::transfer(uint8_t to, uint8_t *from) { bool ret=true; @@ -315,7 +315,7 @@ image_init_result psxcard_device::call_load() image_init_result psxcard_device::call_create(int format_type, util::option_resolution *format_options) { - UINT8 block[block_size]; + uint8_t block[block_size]; int i, ret; if(m_disabled) diff --git a/src/devices/bus/psx/memcard.h b/src/devices/bus/psx/memcard.h index eaea4ae5928..2a6f3d3e528 100644 --- a/src/devices/bus/psx/memcard.h +++ b/src/devices/bus/psx/memcard.h @@ -16,7 +16,7 @@ class psxcard_device : public device_t, public device_image_interface { public: - psxcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psxcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual iodevice_t image_type() const override { return IO_MEMCARD; } @@ -38,8 +38,8 @@ private: int state; bool m_disabled; - UINT8 m_odata; - UINT8 m_idata; + uint8_t m_odata; + uint8_t m_idata; int m_bit; int m_count; bool m_pad; @@ -56,7 +56,7 @@ private: void write_card(const unsigned short addr, unsigned char *buf); unsigned char checksum_data(const unsigned char *buf, const unsigned int sz); void do_card(); - bool transfer(UINT8 to, UINT8 *from); + bool transfer(uint8_t to, uint8_t *from); void ack_timer(void *ptr, int param); public: diff --git a/src/devices/bus/psx/multitap.cpp b/src/devices/bus/psx/multitap.cpp index 51cfd5948ab..e71e6175dd7 100644 --- a/src/devices/bus/psx/multitap.cpp +++ b/src/devices/bus/psx/multitap.cpp @@ -6,7 +6,7 @@ const device_type PSX_MULTITAP = &device_creator; -psx_multitap_device::psx_multitap_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) : +psx_multitap_device::psx_multitap_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : device_t(mconfig, PSX_MULTITAP, "Playstation Multitap", tag, owner, clock, "psx_multitap", __FILE__), device_psx_controller_interface(mconfig, *this), m_activeport(0), @@ -235,7 +235,7 @@ void psx_multitap_device::do_pad() m_count++; } -bool psx_multitap_device::get_pad(int count, UINT8 *odata, UINT8 idata) +bool psx_multitap_device::get_pad(int count, uint8_t *odata, uint8_t idata) { if(!count) *odata = 0x80; diff --git a/src/devices/bus/psx/multitap.h b/src/devices/bus/psx/multitap.h index 160b0de6b5d..c826edef8c3 100644 --- a/src/devices/bus/psx/multitap.h +++ b/src/devices/bus/psx/multitap.h @@ -11,7 +11,7 @@ class psx_multitap_device : public device_t, public device_psx_controller_interface { public: - psx_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psx_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; protected: @@ -22,7 +22,7 @@ protected: virtual void interface_pre_reset() override; private: - virtual bool get_pad(int count, UINT8 *odata, UINT8 idata) override; + virtual bool get_pad(int count, uint8_t *odata, uint8_t idata) override; virtual void do_pad() override; void ack(); void set_tx_line(bool tx, int port); @@ -31,7 +31,7 @@ private: int m_activeport; bool m_cack[4]; bool m_singlemode, m_nextmode, m_tapmc; - UINT8 m_data[3][8]; // port a is passed though + uint8_t m_data[3][8]; // port a is passed though required_device m_porta; required_device m_portb; required_device m_portc; diff --git a/src/devices/bus/ql/cst_q_plus4.cpp b/src/devices/bus/ql/cst_q_plus4.cpp index 27273687d65..d7a58306ef4 100644 --- a/src/devices/bus/ql/cst_q_plus4.cpp +++ b/src/devices/bus/ql/cst_q_plus4.cpp @@ -86,7 +86,7 @@ machine_config_constructor cst_q_plus4_t::device_mconfig_additions() const // cst_q_plus4_t - constructor //------------------------------------------------- -cst_q_plus4_t::cst_q_plus4_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cst_q_plus4_t::cst_q_plus4_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CST_Q_PLUS4, "CST Q+4", tag, owner, clock, "ql_qplus4", __FILE__), device_ql_expansion_card_interface(mconfig, *this), m_exp1(*this, "exp1"), @@ -115,7 +115,7 @@ void cst_q_plus4_t::device_start() // read - //------------------------------------------------- -UINT8 cst_q_plus4_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t cst_q_plus4_t::read(address_space &space, offs_t offset, uint8_t data) { if (offset >= 0xc000 && offset < 0xc200) { @@ -135,7 +135,7 @@ UINT8 cst_q_plus4_t::read(address_space &space, offs_t offset, UINT8 data) // write - //------------------------------------------------- -void cst_q_plus4_t::write(address_space &space, offs_t offset, UINT8 data) +void cst_q_plus4_t::write(address_space &space, offs_t offset, uint8_t data) { m_exp1->write(space, offset, data); m_exp2->write(space, offset, data); diff --git a/src/devices/bus/ql/cst_q_plus4.h b/src/devices/bus/ql/cst_q_plus4.h index 691e1b24281..8ac923d3856 100644 --- a/src/devices/bus/ql/cst_q_plus4.h +++ b/src/devices/bus/ql/cst_q_plus4.h @@ -27,7 +27,7 @@ class cst_q_plus4_t : public device_t, { public: // construction/destruction - cst_q_plus4_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cst_q_plus4_t(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; @@ -43,8 +43,8 @@ protected: virtual void device_start() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; private: void update_extintl() { m_slot->extintl_w(m_exp1_extinl || m_exp2_extinl || m_exp3_extinl || m_exp4_extinl); } diff --git a/src/devices/bus/ql/cst_qdisc.cpp b/src/devices/bus/ql/cst_qdisc.cpp index 8ba128b3d9b..1667c3e4a8f 100644 --- a/src/devices/bus/ql/cst_qdisc.cpp +++ b/src/devices/bus/ql/cst_qdisc.cpp @@ -50,7 +50,7 @@ const tiny_rom_entry *cst_ql_disc_interface_t::device_rom_region() const // cst_ql_disc_interface_t - constructor //------------------------------------------------- -cst_ql_disc_interface_t::cst_ql_disc_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cst_ql_disc_interface_t::cst_ql_disc_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CST_QL_DISC_INTERFACE, "CST QL Disc Interface", tag, owner, clock, "ql_qdisc", __FILE__), device_ql_expansion_card_interface(mconfig, *this) { @@ -70,7 +70,7 @@ void cst_ql_disc_interface_t::device_start() // read - //------------------------------------------------- -UINT8 cst_ql_disc_interface_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t cst_ql_disc_interface_t::read(address_space &space, offs_t offset, uint8_t data) { return data; } @@ -80,6 +80,6 @@ UINT8 cst_ql_disc_interface_t::read(address_space &space, offs_t offset, UINT8 d // write - //------------------------------------------------- -void cst_ql_disc_interface_t::write(address_space &space, offs_t offset, UINT8 data) +void cst_ql_disc_interface_t::write(address_space &space, offs_t offset, uint8_t data) { } diff --git a/src/devices/bus/ql/cst_qdisc.h b/src/devices/bus/ql/cst_qdisc.h index c272f345b6b..fc156e4a6b9 100644 --- a/src/devices/bus/ql/cst_qdisc.h +++ b/src/devices/bus/ql/cst_qdisc.h @@ -26,7 +26,7 @@ class cst_ql_disc_interface_t : public device_t, { public: // construction/destruction - cst_ql_disc_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cst_ql_disc_interface_t(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; @@ -36,8 +36,8 @@ protected: virtual void device_start() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; }; diff --git a/src/devices/bus/ql/cumana_fdi.cpp b/src/devices/bus/ql/cumana_fdi.cpp index ed868f985e2..bcc7e4b077e 100644 --- a/src/devices/bus/ql/cumana_fdi.cpp +++ b/src/devices/bus/ql/cumana_fdi.cpp @@ -50,7 +50,7 @@ const tiny_rom_entry *cumana_floppy_disk_interface_t::device_rom_region() const // cumana_floppy_disk_interface_t - constructor //------------------------------------------------- -cumana_floppy_disk_interface_t::cumana_floppy_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cumana_floppy_disk_interface_t::cumana_floppy_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CUMANA_FLOPPY_DISK_INTERFACE, "Cumana Floppy Disk Interface", tag, owner, clock, "ql_cumanafdi", __FILE__), device_ql_expansion_card_interface(mconfig, *this) { @@ -70,7 +70,7 @@ void cumana_floppy_disk_interface_t::device_start() // read - //------------------------------------------------- -UINT8 cumana_floppy_disk_interface_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t cumana_floppy_disk_interface_t::read(address_space &space, offs_t offset, uint8_t data) { return data; } @@ -80,6 +80,6 @@ UINT8 cumana_floppy_disk_interface_t::read(address_space &space, offs_t offset, // write - //------------------------------------------------- -void cumana_floppy_disk_interface_t::write(address_space &space, offs_t offset, UINT8 data) +void cumana_floppy_disk_interface_t::write(address_space &space, offs_t offset, uint8_t data) { } diff --git a/src/devices/bus/ql/cumana_fdi.h b/src/devices/bus/ql/cumana_fdi.h index 4425560d604..2531735cb2c 100644 --- a/src/devices/bus/ql/cumana_fdi.h +++ b/src/devices/bus/ql/cumana_fdi.h @@ -26,7 +26,7 @@ class cumana_floppy_disk_interface_t : public device_t, { public: // construction/destruction - cumana_floppy_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cumana_floppy_disk_interface_t(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; @@ -36,8 +36,8 @@ protected: virtual void device_start() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; }; diff --git a/src/devices/bus/ql/exp.cpp b/src/devices/bus/ql/exp.cpp index 92a5580334d..8b40250ca07 100644 --- a/src/devices/bus/ql/exp.cpp +++ b/src/devices/bus/ql/exp.cpp @@ -43,7 +43,7 @@ device_ql_expansion_card_interface::device_ql_expansion_card_interface(const mac // ql_expansion_slot_t - constructor //------------------------------------------------- -ql_expansion_slot_t::ql_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ql_expansion_slot_t::ql_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, QL_EXPANSION_SLOT, "QL expansion port", tag, owner, clock, "ql_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_write_ipl0l(*this), diff --git a/src/devices/bus/ql/exp.h b/src/devices/bus/ql/exp.h index e4b259b475c..c65b84f0eff 100644 --- a/src/devices/bus/ql/exp.h +++ b/src/devices/bus/ql/exp.h @@ -91,8 +91,8 @@ public: device_ql_expansion_card_interface(const machine_config &mconfig, device_t &device); virtual void romoeh_w(int state) { m_romoeh = state; } - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) { return data; } - virtual void write(address_space &space, offs_t offset, UINT8 data) { } + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) { return data; } + virtual void write(address_space &space, offs_t offset, uint8_t data) { } protected: ql_expansion_slot_t *m_slot; @@ -108,7 +108,7 @@ class ql_expansion_slot_t : public device_t, { public: // construction/destruction - ql_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ql_expansion_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_ipl0l_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_ipl0l.set_callback(object); } template static devcb_base &set_ipl1l_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_ipl1l.set_callback(object); } @@ -116,8 +116,8 @@ public: template static devcb_base &set_extintl_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_extintl.set_callback(object); } // computer interface - UINT8 read(address_space &space, offs_t offset, UINT8 data) { if (m_card) data = m_card->read(space, offset, data); return data; } - void write(address_space &space, offs_t offset, UINT8 data) { if (m_card) m_card->write(space, offset, data); } + uint8_t read(address_space &space, offs_t offset, uint8_t data) { if (m_card) data = m_card->read(space, offset, data); return data; } + void write(address_space &space, offs_t offset, uint8_t data) { if (m_card) m_card->write(space, offset, data); } DECLARE_WRITE_LINE_MEMBER( romoeh_w ) { if (m_card) m_card->romoeh_w(state); } // card interface diff --git a/src/devices/bus/ql/kempston_di.cpp b/src/devices/bus/ql/kempston_di.cpp index de6c30ac2e8..70cfda102e9 100644 --- a/src/devices/bus/ql/kempston_di.cpp +++ b/src/devices/bus/ql/kempston_di.cpp @@ -48,7 +48,7 @@ const tiny_rom_entry *kempston_disk_interface_t::device_rom_region() const // kempston_disk_interface_t - constructor //------------------------------------------------- -kempston_disk_interface_t::kempston_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +kempston_disk_interface_t::kempston_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KEMPSTON_DISK_INTERFACE, "Kempston Disk Interface", tag, owner, clock, "ql_kdi", __FILE__), device_ql_expansion_card_interface(mconfig, *this) { @@ -68,7 +68,7 @@ void kempston_disk_interface_t::device_start() // read - //------------------------------------------------- -UINT8 kempston_disk_interface_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t kempston_disk_interface_t::read(address_space &space, offs_t offset, uint8_t data) { return data; } @@ -78,6 +78,6 @@ UINT8 kempston_disk_interface_t::read(address_space &space, offs_t offset, UINT8 // write - //------------------------------------------------- -void kempston_disk_interface_t::write(address_space &space, offs_t offset, UINT8 data) +void kempston_disk_interface_t::write(address_space &space, offs_t offset, uint8_t data) { } diff --git a/src/devices/bus/ql/kempston_di.h b/src/devices/bus/ql/kempston_di.h index 19e68ce864d..8a16bfdee0a 100644 --- a/src/devices/bus/ql/kempston_di.h +++ b/src/devices/bus/ql/kempston_di.h @@ -26,7 +26,7 @@ class kempston_disk_interface_t : public device_t, { public: // construction/destruction - kempston_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kempston_disk_interface_t(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; @@ -36,8 +36,8 @@ protected: virtual void device_start() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; }; diff --git a/src/devices/bus/ql/miracle_gold_card.cpp b/src/devices/bus/ql/miracle_gold_card.cpp index 31a566b3944..87f711829d7 100644 --- a/src/devices/bus/ql/miracle_gold_card.cpp +++ b/src/devices/bus/ql/miracle_gold_card.cpp @@ -50,7 +50,7 @@ const tiny_rom_entry *miracle_gold_card_t::device_rom_region() const // miracle_gold_card_t - constructor //------------------------------------------------- -miracle_gold_card_t::miracle_gold_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +miracle_gold_card_t::miracle_gold_card_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIRACLE_GOLD_CARD, "Miracle Gold Card", tag, owner, clock, "ql_gold", __FILE__), device_ql_expansion_card_interface(mconfig, *this) { @@ -70,7 +70,7 @@ void miracle_gold_card_t::device_start() // read - //------------------------------------------------- -UINT8 miracle_gold_card_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t miracle_gold_card_t::read(address_space &space, offs_t offset, uint8_t data) { return data; } @@ -80,6 +80,6 @@ UINT8 miracle_gold_card_t::read(address_space &space, offs_t offset, UINT8 data) // write - //------------------------------------------------- -void miracle_gold_card_t::write(address_space &space, offs_t offset, UINT8 data) +void miracle_gold_card_t::write(address_space &space, offs_t offset, uint8_t data) { } diff --git a/src/devices/bus/ql/miracle_gold_card.h b/src/devices/bus/ql/miracle_gold_card.h index a92abc790e2..0d8404ca07b 100644 --- a/src/devices/bus/ql/miracle_gold_card.h +++ b/src/devices/bus/ql/miracle_gold_card.h @@ -26,7 +26,7 @@ class miracle_gold_card_t : public device_t, { public: // construction/destruction - miracle_gold_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + miracle_gold_card_t(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; @@ -36,8 +36,8 @@ protected: virtual void device_start() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; }; diff --git a/src/devices/bus/ql/miracle_hd.cpp b/src/devices/bus/ql/miracle_hd.cpp index 3de4d0360d0..82fe7a0835b 100644 --- a/src/devices/bus/ql/miracle_hd.cpp +++ b/src/devices/bus/ql/miracle_hd.cpp @@ -48,7 +48,7 @@ const tiny_rom_entry *miracle_hard_disk_t::device_rom_region() const // miracle_hard_disk_t - constructor //------------------------------------------------- -miracle_hard_disk_t::miracle_hard_disk_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +miracle_hard_disk_t::miracle_hard_disk_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIRACLE_HARD_DISK, "Miracle Hard Disk", tag, owner, clock, "ql_mhd", __FILE__), device_ql_rom_cartridge_card_interface(mconfig, *this) { @@ -68,7 +68,7 @@ void miracle_hard_disk_t::device_start() // read - //------------------------------------------------- -UINT8 miracle_hard_disk_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t miracle_hard_disk_t::read(address_space &space, offs_t offset, uint8_t data) { return data; } @@ -78,6 +78,6 @@ UINT8 miracle_hard_disk_t::read(address_space &space, offs_t offset, UINT8 data) // write - //------------------------------------------------- -void miracle_hard_disk_t::write(address_space &space, offs_t offset, UINT8 data) +void miracle_hard_disk_t::write(address_space &space, offs_t offset, uint8_t data) { } diff --git a/src/devices/bus/ql/miracle_hd.h b/src/devices/bus/ql/miracle_hd.h index 9881f6769f3..10bbe9051a4 100644 --- a/src/devices/bus/ql/miracle_hd.h +++ b/src/devices/bus/ql/miracle_hd.h @@ -26,7 +26,7 @@ class miracle_hard_disk_t : public device_t, { public: // construction/destruction - miracle_hard_disk_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + miracle_hard_disk_t(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; @@ -36,8 +36,8 @@ protected: virtual void device_start() override; // device_ql_rom_cartridge_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; }; diff --git a/src/devices/bus/ql/mp_fdi.cpp b/src/devices/bus/ql/mp_fdi.cpp index 72543005cb3..7676f607d6f 100644 --- a/src/devices/bus/ql/mp_fdi.cpp +++ b/src/devices/bus/ql/mp_fdi.cpp @@ -48,7 +48,7 @@ const tiny_rom_entry *micro_peripherals_floppy_disk_interface_t::device_rom_regi // micro_peripherals_floppy_disk_interface_t - constructor //------------------------------------------------- -micro_peripherals_floppy_disk_interface_t::micro_peripherals_floppy_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +micro_peripherals_floppy_disk_interface_t::micro_peripherals_floppy_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MICRO_PERIPHERALS_FLOPPY_DISK_INTERFACE, "Micro Peripherals Floppy Disk Interface", tag, owner, clock, "ql_mpfdi", __FILE__), device_ql_expansion_card_interface(mconfig, *this) { @@ -68,7 +68,7 @@ void micro_peripherals_floppy_disk_interface_t::device_start() // read - //------------------------------------------------- -UINT8 micro_peripherals_floppy_disk_interface_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t micro_peripherals_floppy_disk_interface_t::read(address_space &space, offs_t offset, uint8_t data) { return data; } @@ -78,6 +78,6 @@ UINT8 micro_peripherals_floppy_disk_interface_t::read(address_space &space, offs // write - //------------------------------------------------- -void micro_peripherals_floppy_disk_interface_t::write(address_space &space, offs_t offset, UINT8 data) +void micro_peripherals_floppy_disk_interface_t::write(address_space &space, offs_t offset, uint8_t data) { } diff --git a/src/devices/bus/ql/mp_fdi.h b/src/devices/bus/ql/mp_fdi.h index 14dc4087d6d..8ea642ea26d 100644 --- a/src/devices/bus/ql/mp_fdi.h +++ b/src/devices/bus/ql/mp_fdi.h @@ -26,7 +26,7 @@ class micro_peripherals_floppy_disk_interface_t : public device_t, { public: // construction/destruction - micro_peripherals_floppy_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + micro_peripherals_floppy_disk_interface_t(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; @@ -36,8 +36,8 @@ protected: virtual void device_start() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; }; diff --git a/src/devices/bus/ql/opd_basic_master.cpp b/src/devices/bus/ql/opd_basic_master.cpp index 58bc110f433..bf9cc893dce 100644 --- a/src/devices/bus/ql/opd_basic_master.cpp +++ b/src/devices/bus/ql/opd_basic_master.cpp @@ -46,7 +46,7 @@ const tiny_rom_entry *opd_basic_master_t::device_rom_region() const // opd_basic_master_t - constructor //------------------------------------------------- -opd_basic_master_t::opd_basic_master_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +opd_basic_master_t::opd_basic_master_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OPD_BASIC_MASTER, "OPD Basic Master", tag, owner, clock, "ql_opdbm", __FILE__), device_ql_expansion_card_interface(mconfig, *this) { @@ -66,7 +66,7 @@ void opd_basic_master_t::device_start() // read - //------------------------------------------------- -UINT8 opd_basic_master_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t opd_basic_master_t::read(address_space &space, offs_t offset, uint8_t data) { return data; } @@ -76,6 +76,6 @@ UINT8 opd_basic_master_t::read(address_space &space, offs_t offset, UINT8 data) // write - //------------------------------------------------- -void opd_basic_master_t::write(address_space &space, offs_t offset, UINT8 data) +void opd_basic_master_t::write(address_space &space, offs_t offset, uint8_t data) { } diff --git a/src/devices/bus/ql/opd_basic_master.h b/src/devices/bus/ql/opd_basic_master.h index ec0a92869ca..3611cfa11f1 100644 --- a/src/devices/bus/ql/opd_basic_master.h +++ b/src/devices/bus/ql/opd_basic_master.h @@ -26,7 +26,7 @@ class opd_basic_master_t : public device_t, { public: // construction/destruction - opd_basic_master_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + opd_basic_master_t(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; @@ -36,8 +36,8 @@ protected: virtual void device_start() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; }; diff --git a/src/devices/bus/ql/pcml_qdisk.cpp b/src/devices/bus/ql/pcml_qdisk.cpp index 0dd88363660..1f505e9ddc3 100644 --- a/src/devices/bus/ql/pcml_qdisk.cpp +++ b/src/devices/bus/ql/pcml_qdisk.cpp @@ -48,7 +48,7 @@ const tiny_rom_entry *pcml_q_disk_interface_t::device_rom_region() const // pcml_q_disk_interface_t - constructor //------------------------------------------------- -pcml_q_disk_interface_t::pcml_q_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pcml_q_disk_interface_t::pcml_q_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCML_Q_DISK_INTERFACE, "PCML Q+ Disk Interface", tag, owner, clock, "ql_pcmlqdi", __FILE__), device_ql_expansion_card_interface(mconfig, *this) { @@ -68,7 +68,7 @@ void pcml_q_disk_interface_t::device_start() // read - //------------------------------------------------- -UINT8 pcml_q_disk_interface_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t pcml_q_disk_interface_t::read(address_space &space, offs_t offset, uint8_t data) { return data; } @@ -78,6 +78,6 @@ UINT8 pcml_q_disk_interface_t::read(address_space &space, offs_t offset, UINT8 d // write - //------------------------------------------------- -void pcml_q_disk_interface_t::write(address_space &space, offs_t offset, UINT8 data) +void pcml_q_disk_interface_t::write(address_space &space, offs_t offset, uint8_t data) { } diff --git a/src/devices/bus/ql/pcml_qdisk.h b/src/devices/bus/ql/pcml_qdisk.h index 6348a7d5fd6..120787eebd2 100644 --- a/src/devices/bus/ql/pcml_qdisk.h +++ b/src/devices/bus/ql/pcml_qdisk.h @@ -26,7 +26,7 @@ class pcml_q_disk_interface_t : public device_t, { public: // construction/destruction - pcml_q_disk_interface_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pcml_q_disk_interface_t(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; @@ -36,8 +36,8 @@ protected: virtual void device_start() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; }; diff --git a/src/devices/bus/ql/qubide.cpp b/src/devices/bus/ql/qubide.cpp index 418eea3ea81..740a1188acf 100644 --- a/src/devices/bus/ql/qubide.cpp +++ b/src/devices/bus/ql/qubide.cpp @@ -168,7 +168,7 @@ ioport_constructor qubide_t::device_input_ports() const // qubide_t - constructor //------------------------------------------------- -qubide_t::qubide_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +qubide_t::qubide_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, QUBIDE, "QubIDE", tag, owner, clock, "ql_qubide", __FILE__), device_ql_expansion_card_interface(mconfig, *this), m_ata(*this, "ata"), @@ -210,7 +210,7 @@ void qubide_t::device_reset() // read - //------------------------------------------------- -UINT8 qubide_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t qubide_t::read(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xfc000) == m_base) { @@ -255,7 +255,7 @@ UINT8 qubide_t::read(address_space &space, offs_t offset, UINT8 data) // write - //------------------------------------------------- -void qubide_t::write(address_space &space, offs_t offset, UINT8 data) +void qubide_t::write(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xfc000) == m_base) { diff --git a/src/devices/bus/ql/qubide.h b/src/devices/bus/ql/qubide.h index 4ccb043847c..9ebbdaa95e5 100644 --- a/src/devices/bus/ql/qubide.h +++ b/src/devices/bus/ql/qubide.h @@ -27,7 +27,7 @@ class qubide_t : public device_t, { public: // construction/destruction - qubide_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + qubide_t(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; @@ -40,8 +40,8 @@ protected: virtual void device_reset() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; private: required_device m_ata; @@ -49,7 +49,7 @@ private: required_ioport m_j1_j5; offs_t m_base; - UINT16 m_ata_data; + uint16_t m_ata_data; }; diff --git a/src/devices/bus/ql/rom.cpp b/src/devices/bus/ql/rom.cpp index a0b773a0f58..4ad95a0febe 100644 --- a/src/devices/bus/ql/rom.cpp +++ b/src/devices/bus/ql/rom.cpp @@ -53,7 +53,7 @@ device_ql_rom_cartridge_card_interface::~device_ql_rom_cartridge_card_interface( // ql_rom_cartridge_slot_t - constructor //------------------------------------------------- -ql_rom_cartridge_slot_t::ql_rom_cartridge_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ql_rom_cartridge_slot_t::ql_rom_cartridge_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, QL_ROM_CARTRIDGE_SLOT, "QL ROM cartridge slot", tag, owner, clock, "ql_rom_cartridge_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), m_card(nullptr) diff --git a/src/devices/bus/ql/rom.h b/src/devices/bus/ql/rom.h index 5649804df66..ac128b72180 100644 --- a/src/devices/bus/ql/rom.h +++ b/src/devices/bus/ql/rom.h @@ -62,13 +62,13 @@ public: virtual ~device_ql_rom_cartridge_card_interface(); virtual void romoeh_w(int state) { m_romoeh = state; } - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) { return data; } - virtual void write(address_space &space, offs_t offset, UINT8 data) { } + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) { return data; } + virtual void write(address_space &space, offs_t offset, uint8_t data) { } protected: ql_rom_cartridge_slot_t *m_slot; - optional_shared_ptr m_rom; + optional_shared_ptr m_rom; int m_romoeh; }; @@ -82,11 +82,11 @@ class ql_rom_cartridge_slot_t : public device_t, { public: // construction/destruction - ql_rom_cartridge_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ql_rom_cartridge_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // computer interface - UINT8 read(address_space &space, offs_t offset, UINT8 data) { if (m_card) data = m_card->read(space, offset, data); return data; } - void write(address_space &space, offs_t offset, UINT8 data) { if (m_card) m_card->write(space, offset, data); } + uint8_t read(address_space &space, offs_t offset, uint8_t data) { if (m_card) data = m_card->read(space, offset, data); return data; } + void write(address_space &space, offs_t offset, uint8_t data) { if (m_card) m_card->write(space, offset, data); } DECLARE_WRITE_LINE_MEMBER( romoeh_w ) { if (m_card) m_card->romoeh_w(state); } protected: diff --git a/src/devices/bus/ql/sandy_superdisk.cpp b/src/devices/bus/ql/sandy_superdisk.cpp index 48d269fa68e..6cdd08e1c70 100644 --- a/src/devices/bus/ql/sandy_superdisk.cpp +++ b/src/devices/bus/ql/sandy_superdisk.cpp @@ -111,7 +111,7 @@ machine_config_constructor sandy_super_disk_t::device_mconfig_additions() const // sandy_super_disk_t - constructor //------------------------------------------------- -sandy_super_disk_t::sandy_super_disk_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sandy_super_disk_t::sandy_super_disk_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SANDY_SUPER_DISK, "Sandy Super Disk", tag, owner, clock, "ql_sdisk", __FILE__), device_ql_expansion_card_interface(mconfig, *this), m_fdc(*this, WD1772_TAG), @@ -156,7 +156,7 @@ void sandy_super_disk_t::device_reset() // read - //------------------------------------------------- -UINT8 sandy_super_disk_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t sandy_super_disk_t::read(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xf0000) == 0xc0000) { @@ -202,7 +202,7 @@ UINT8 sandy_super_disk_t::read(address_space &space, offs_t offset, UINT8 data) // write - //------------------------------------------------- -void sandy_super_disk_t::write(address_space &space, offs_t offset, UINT8 data) +void sandy_super_disk_t::write(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xf0000) == 0xc0000) { diff --git a/src/devices/bus/ql/sandy_superdisk.h b/src/devices/bus/ql/sandy_superdisk.h index 56efeafab6a..fe44b921bf6 100644 --- a/src/devices/bus/ql/sandy_superdisk.h +++ b/src/devices/bus/ql/sandy_superdisk.h @@ -29,7 +29,7 @@ class sandy_super_disk_t : public device_t, { public: // construction/destruction - sandy_super_disk_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sandy_super_disk_t(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; @@ -45,8 +45,8 @@ protected: virtual void device_reset() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; private: void check_interrupt(); diff --git a/src/devices/bus/ql/sandy_superqboard.cpp b/src/devices/bus/ql/sandy_superqboard.cpp index 03b9a09c92c..3b9c7440dde 100644 --- a/src/devices/bus/ql/sandy_superqboard.cpp +++ b/src/devices/bus/ql/sandy_superqboard.cpp @@ -212,7 +212,7 @@ ioport_constructor sandy_superqmouse_512k_t::device_input_ports() const // sandy_superqboard_t - constructor //------------------------------------------------- -sandy_superqboard_t::sandy_superqboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sandy_superqboard_t::sandy_superqboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SANDY_SUPERQBOARD, "Sandy SuperQBoard 256K", tag, owner, clock, "ql_sqboard256", __FILE__), device_ql_expansion_card_interface(mconfig, *this), m_fdc(*this, WD1772_TAG), @@ -230,7 +230,7 @@ sandy_superqboard_t::sandy_superqboard_t(const machine_config &mconfig, const ch { } -sandy_superqboard_t::sandy_superqboard_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, int ram_size) : +sandy_superqboard_t::sandy_superqboard_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, int ram_size) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), device_ql_expansion_card_interface(mconfig, *this), m_fdc(*this, WD1772_TAG), @@ -248,13 +248,13 @@ sandy_superqboard_t::sandy_superqboard_t(const machine_config &mconfig, device_t { } -sandy_superqboard_512k_t::sandy_superqboard_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sandy_superqboard_512k_t::sandy_superqboard_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sandy_superqboard_t(mconfig, SANDY_SUPERQBOARD_512K, "Sandy SuperQBoard 512K", tag, owner, clock, "ql_sqboard512", __FILE__, 512*1024) { } -sandy_superqmouse_t::sandy_superqmouse_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sandy_superqmouse_t::sandy_superqmouse_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sandy_superqboard_t(mconfig, SANDY_SUPERQMOUSE, "Sandy SuperQMouse", tag, owner, clock, "ql_sqmouse", __FILE__, 256*1024) { } -sandy_superqmouse_512k_t::sandy_superqmouse_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sandy_superqmouse_512k_t::sandy_superqmouse_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sandy_superqboard_t(mconfig, SANDY_SUPERQMOUSE_512K, "Sandy SuperQMouse 512K", tag, owner, clock, "ql_sqmouse512", __FILE__, 512*1024) { } @@ -299,7 +299,7 @@ void sandy_superqboard_t::device_reset() // read - //------------------------------------------------- -UINT8 sandy_superqboard_t::read(address_space &space, offs_t offset, UINT8 data) +uint8_t sandy_superqboard_t::read(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xf0000) == 0xc0000) { @@ -359,7 +359,7 @@ UINT8 sandy_superqboard_t::read(address_space &space, offs_t offset, UINT8 data) // write - //------------------------------------------------- -void sandy_superqboard_t::write(address_space &space, offs_t offset, UINT8 data) +void sandy_superqboard_t::write(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xf0000) == 0xc0000) { diff --git a/src/devices/bus/ql/sandy_superqboard.h b/src/devices/bus/ql/sandy_superqboard.h index 5aefdc250ed..a1982c38ede 100644 --- a/src/devices/bus/ql/sandy_superqboard.h +++ b/src/devices/bus/ql/sandy_superqboard.h @@ -29,8 +29,8 @@ class sandy_superqboard_t : public device_t, { public: // construction/destruction - sandy_superqboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - sandy_superqboard_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, int ram_size); + sandy_superqboard_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + sandy_superqboard_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, int ram_size); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; @@ -49,8 +49,8 @@ protected: virtual void device_reset() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; private: enum @@ -73,14 +73,14 @@ private: required_device m_centronics; required_device m_latch; required_memory_region m_rom; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; optional_ioport m_buttons; int m_ram_size; int m_fd6; int m_fd7; - UINT8 m_status; + uint8_t m_status; }; @@ -90,7 +90,7 @@ class sandy_superqboard_512k_t : public sandy_superqboard_t { public: // construction/destruction - sandy_superqboard_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sandy_superqboard_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -100,7 +100,7 @@ class sandy_superqmouse_t : public sandy_superqboard_t { public: // construction/destruction - sandy_superqmouse_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sandy_superqmouse_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -113,7 +113,7 @@ class sandy_superqmouse_512k_t : public sandy_superqboard_t { public: // construction/destruction - sandy_superqmouse_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sandy_superqmouse_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/ql/std.cpp b/src/devices/bus/ql/std.cpp index 11132954104..07f064d7b91 100644 --- a/src/devices/bus/ql/std.cpp +++ b/src/devices/bus/ql/std.cpp @@ -26,7 +26,7 @@ const device_type QL_STANDARD_ROM_CARTRIDGE = &device_creator= 0xc000 && offset < 0x10000) { @@ -229,7 +229,7 @@ UINT8 ql_trump_card_t::read(address_space &space, offs_t offset, UINT8 data) // write - //------------------------------------------------- -void ql_trump_card_t::write(address_space &space, offs_t offset, UINT8 data) +void ql_trump_card_t::write(address_space &space, offs_t offset, uint8_t data) { if (offset >= 0x1c000 && offset <= 0x1c003) { diff --git a/src/devices/bus/ql/trumpcard.h b/src/devices/bus/ql/trumpcard.h index 21ec7109712..631b584c9f1 100644 --- a/src/devices/bus/ql/trumpcard.h +++ b/src/devices/bus/ql/trumpcard.h @@ -28,8 +28,8 @@ class ql_trump_card_t : public device_t, { public: // construction/destruction - ql_trump_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ql_trump_card_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, int ram_size); + ql_trump_card_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ql_trump_card_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, int ram_size); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; @@ -43,15 +43,15 @@ protected: virtual void device_reset() override; // device_ql_expansion_card_interface overrides - virtual UINT8 read(address_space &space, offs_t offset, UINT8 data) override; - virtual void write(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t read(address_space &space, offs_t offset, uint8_t data) override; + virtual void write(address_space &space, offs_t offset, uint8_t data) override; private: required_device m_fdc; required_device m_floppy0; required_device m_floppy1; required_memory_region m_rom; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; int m_ram_size; bool m_rom_en; @@ -64,7 +64,7 @@ class ql_trump_card_256k_t : public ql_trump_card_t { public: // construction/destruction - ql_trump_card_256k_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ql_trump_card_256k_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -74,7 +74,7 @@ class ql_trump_card_512k_t : public ql_trump_card_t { public: // construction/destruction - ql_trump_card_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ql_trump_card_512k_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -84,7 +84,7 @@ class ql_trump_card_768k_t : public ql_trump_card_t { public: // construction/destruction - ql_trump_card_768k_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ql_trump_card_768k_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/rs232/keyboard.cpp b/src/devices/bus/rs232/keyboard.cpp index c6462022ea3..51ce4e9eb79 100644 --- a/src/devices/bus/rs232/keyboard.cpp +++ b/src/devices/bus/rs232/keyboard.cpp @@ -14,12 +14,12 @@ INPUT_PORTS_START(serial_keyboard) INPUT_PORTS_END } // anonymous namespace -serial_keyboard_device::serial_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +serial_keyboard_device::serial_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : serial_keyboard_device(mconfig, SERIAL_KEYBOARD, "Serial Keyboard", tag, owner, clock, "serial_keyboard", __FILE__) { } -serial_keyboard_device::serial_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) +serial_keyboard_device::serial_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) : generic_keyboard_device(mconfig, type, name, tag, owner, clock, shortname, source) , device_buffered_serial_interface(mconfig, *this) , device_rs232_port_interface(mconfig, *this) @@ -90,12 +90,12 @@ void serial_keyboard_device::tra_callback() output_rxd(transmit_register_get_data_bit()); } -void serial_keyboard_device::send_key(UINT8 code) +void serial_keyboard_device::send_key(uint8_t code) { transmit_byte(code); } -void serial_keyboard_device::received_byte(UINT8 byte) +void serial_keyboard_device::received_byte(uint8_t byte) { } diff --git a/src/devices/bus/rs232/keyboard.h b/src/devices/bus/rs232/keyboard.h index fd9ad0f80f8..7592dcd2ed5 100644 --- a/src/devices/bus/rs232/keyboard.h +++ b/src/devices/bus/rs232/keyboard.h @@ -14,8 +14,8 @@ class serial_keyboard_device , public device_rs232_port_interface { public: - serial_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - serial_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); + serial_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + serial_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); virtual ioport_constructor device_input_ports() const override; @@ -28,10 +28,10 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual void tra_callback() override; - virtual void send_key(UINT8 code) override; + virtual void send_key(uint8_t code) override; private: - virtual void received_byte(UINT8 byte) override; + virtual void received_byte(uint8_t byte) override; required_ioport m_rs232_txbaud; required_ioport m_rs232_startbits; diff --git a/src/devices/bus/rs232/loopback.cpp b/src/devices/bus/rs232/loopback.cpp index 20c75e4099d..83668f8c362 100644 --- a/src/devices/bus/rs232/loopback.cpp +++ b/src/devices/bus/rs232/loopback.cpp @@ -5,7 +5,7 @@ const device_type RS232_LOOPBACK = &device_creator; -rs232_loopback_device::rs232_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rs232_loopback_device::rs232_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RS232_LOOPBACK, "RS232 Loopback", tag, owner, clock, "rs232_loopback", __FILE__), device_rs232_port_interface(mconfig, *this) { diff --git a/src/devices/bus/rs232/loopback.h b/src/devices/bus/rs232/loopback.h index 5d262c93264..25de18df2a9 100644 --- a/src/devices/bus/rs232/loopback.h +++ b/src/devices/bus/rs232/loopback.h @@ -10,7 +10,7 @@ class rs232_loopback_device : public device_t, public device_rs232_port_interface { public: - rs232_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rs232_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual WRITE_LINE_MEMBER( input_txd ) override; virtual WRITE_LINE_MEMBER( input_rts ) override; diff --git a/src/devices/bus/rs232/null_modem.cpp b/src/devices/bus/rs232/null_modem.cpp index 8c182989ff6..846292d7690 100644 --- a/src/devices/bus/rs232/null_modem.cpp +++ b/src/devices/bus/rs232/null_modem.cpp @@ -2,7 +2,7 @@ // copyright-holders:smf,Carl #include "null_modem.h" -null_modem_device::null_modem_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +null_modem_device::null_modem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NULL_MODEM, "Null Modem", tag, owner, clock, "null_modem", __FILE__), device_serial_interface(mconfig, *this), device_rs232_port_interface(mconfig, *this), diff --git a/src/devices/bus/rs232/null_modem.h b/src/devices/bus/rs232/null_modem.h index 028614788d6..3568b313cbc 100644 --- a/src/devices/bus/rs232/null_modem.h +++ b/src/devices/bus/rs232/null_modem.h @@ -11,7 +11,7 @@ class null_modem_device : public device_t, public device_rs232_port_interface { public: - null_modem_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + null_modem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual WRITE_LINE_MEMBER( input_txd ) override { device_serial_interface::rx_w(state); } @@ -44,9 +44,9 @@ private: required_ioport m_rs232_stopbits; required_ioport m_flow; - UINT8 m_input_buffer[1000]; - UINT32 m_input_count; - UINT32 m_input_index; + uint8_t m_input_buffer[1000]; + uint32_t m_input_count; + uint32_t m_input_index; emu_timer *m_timer_poll; int m_rts; }; diff --git a/src/devices/bus/rs232/printer.cpp b/src/devices/bus/rs232/printer.cpp index e8734ad6de6..b75d028b81b 100644 --- a/src/devices/bus/rs232/printer.cpp +++ b/src/devices/bus/rs232/printer.cpp @@ -2,7 +2,7 @@ // copyright-holders:smf #include "printer.h" -serial_printer_device::serial_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +serial_printer_device::serial_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SERIAL_PRINTER, "Serial Printer", tag, owner, clock, "serial_printer", __FILE__), device_serial_interface(mconfig, *this), device_rs232_port_interface(mconfig, *this), diff --git a/src/devices/bus/rs232/printer.h b/src/devices/bus/rs232/printer.h index 4ce526fac4b..9380bf58fed 100644 --- a/src/devices/bus/rs232/printer.h +++ b/src/devices/bus/rs232/printer.h @@ -13,7 +13,7 @@ class serial_printer_device : public device_t, public device_rs232_port_interface { public: - serial_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + serial_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override { device_serial_interface::rx_w(state); } diff --git a/src/devices/bus/rs232/pty.cpp b/src/devices/bus/rs232/pty.cpp index 3a525236128..297870d4e30 100644 --- a/src/devices/bus/rs232/pty.cpp +++ b/src/devices/bus/rs232/pty.cpp @@ -6,7 +6,7 @@ static const int TIMER_POLL = 1; -pseudo_terminal_device::pseudo_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pseudo_terminal_device::pseudo_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSEUDO_TERMINAL, "Pseudo terminal", tag, owner, clock, "pseudo_terminal", __FILE__), device_serial_interface(mconfig, *this), device_rs232_port_interface(mconfig, *this), diff --git a/src/devices/bus/rs232/pty.h b/src/devices/bus/rs232/pty.h index 19f0a30ef9f..ada2bdd0698 100644 --- a/src/devices/bus/rs232/pty.h +++ b/src/devices/bus/rs232/pty.h @@ -12,7 +12,7 @@ class pseudo_terminal_device : public device_t, public device_pty_interface { public: - pseudo_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pseudo_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override { device_serial_interface::rx_w(state); @@ -39,9 +39,9 @@ private: required_ioport m_rs232_parity; required_ioport m_rs232_stopbits; - UINT8 m_input_buffer[ 1024 ]; - UINT32 m_input_count; - UINT32 m_input_index; + uint8_t m_input_buffer[ 1024 ]; + uint32_t m_input_count; + uint32_t m_input_index; emu_timer *m_timer_poll; void queue(void); diff --git a/src/devices/bus/rs232/rs232.cpp b/src/devices/bus/rs232/rs232.cpp index 82712343439..458f97ca865 100644 --- a/src/devices/bus/rs232/rs232.cpp +++ b/src/devices/bus/rs232/rs232.cpp @@ -4,7 +4,7 @@ const device_type RS232_PORT = &device_creator; -rs232_port_device::rs232_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +rs232_port_device::rs232_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RS232_PORT, "RS232 Port", tag, owner, clock, "rs232", __FILE__), device_slot_interface(mconfig, *this), m_rxd(0), @@ -21,7 +21,7 @@ rs232_port_device::rs232_port_device(const machine_config &mconfig, const char * { } -rs232_port_device::rs232_port_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) +rs232_port_device::rs232_port_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_slot_interface(mconfig, *this), m_rxd(0), diff --git a/src/devices/bus/rs232/rs232.h b/src/devices/bus/rs232/rs232.h index 8959d276dc7..a77e022f7dc 100644 --- a/src/devices/bus/rs232/rs232.h +++ b/src/devices/bus/rs232/rs232.h @@ -117,8 +117,8 @@ class rs232_port_device : public device_t, friend class device_rs232_port_interface; public: - rs232_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - rs232_port_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); + rs232_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + rs232_port_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 ~rs232_port_device(); // static configuration helpers @@ -181,7 +181,7 @@ public: protected: rs232_port_device *m_port; - static int convert_baud(UINT8 baud) + static int convert_baud(uint8_t baud) { static const int values[] = { @@ -204,7 +204,7 @@ protected: return values[baud]; } - static int convert_startbits(UINT8 startbits) + static int convert_startbits(uint8_t startbits) { static const int values[] = { @@ -215,7 +215,7 @@ protected: return values[startbits]; } - static int convert_databits(UINT8 databits) + static int convert_databits(uint8_t databits) { static const int values[] = { @@ -228,7 +228,7 @@ protected: return values[databits]; } - static device_serial_interface::parity_t convert_parity(UINT8 parity) + static device_serial_interface::parity_t convert_parity(uint8_t parity) { static const device_serial_interface::parity_t values[] = { @@ -242,7 +242,7 @@ protected: return values[parity]; } - static device_serial_interface::stop_bits_t convert_stopbits(UINT8 stopbits) + static device_serial_interface::stop_bits_t convert_stopbits(uint8_t stopbits) { static const device_serial_interface::stop_bits_t values[] = { @@ -256,7 +256,7 @@ protected: } }; -template +template class buffered_rs232_device : public device_t, public device_buffered_serial_interface, public device_rs232_port_interface { public: @@ -266,7 +266,7 @@ public: } protected: - buffered_rs232_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) + buffered_rs232_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_buffered_serial_interface(mconfig, *this) , device_rs232_port_interface(mconfig, *this) diff --git a/src/devices/bus/rs232/ser_mouse.cpp b/src/devices/bus/rs232/ser_mouse.cpp index ecf9414f1c9..e4c322ed204 100644 --- a/src/devices/bus/rs232/ser_mouse.cpp +++ b/src/devices/bus/rs232/ser_mouse.cpp @@ -11,7 +11,7 @@ #include "ser_mouse.h" -serial_mouse_device::serial_mouse_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) +serial_mouse_device::serial_mouse_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_rs232_port_interface(mconfig, *this), device_serial_interface(mconfig, *this), @@ -30,14 +30,14 @@ serial_mouse_device::serial_mouse_device(const machine_config &mconfig, device_t const device_type MSFT_SERIAL_MOUSE = &device_creator; -microsoft_mouse_device::microsoft_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +microsoft_mouse_device::microsoft_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : serial_mouse_device(mconfig, MSFT_SERIAL_MOUSE, "Microsoft Serial Mouse", tag, owner, clock, "microsoft_mouse", __FILE__) { } const device_type MSYSTEM_SERIAL_MOUSE = &device_creator; -mouse_systems_mouse_device::mouse_systems_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mouse_systems_mouse_device::mouse_systems_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : serial_mouse_device(mconfig, MSYSTEM_SERIAL_MOUSE, "Mouse Systems Serial Mouse", tag, owner, clock, "mouse_systems_mouse", __FILE__) { } @@ -132,7 +132,7 @@ void microsoft_mouse_device::mouse_trans(int dx, int dy, int nb, int mbc) /* split deltas into packets of -128..+127 max */ do { - UINT8 m0, m1, m2; + uint8_t m0, m1, m2; int ddx = (dx < -128) ? -128 : (dx > 127) ? 127 : dx; int ddy = (dy < -128) ? -128 : (dy > 127) ? 127 : dy; m0 = 0x40 | ((nb << 4) & 0x30) | ((ddx >> 6) & 0x03) | ((ddy >> 4) & 0x0c); diff --git a/src/devices/bus/rs232/ser_mouse.h b/src/devices/bus/rs232/ser_mouse.h index 6a8986aa081..0e001916d83 100644 --- a/src/devices/bus/rs232/ser_mouse.h +++ b/src/devices/bus/rs232/ser_mouse.h @@ -17,7 +17,7 @@ class serial_mouse_device : public device_serial_interface { public: - serial_mouse_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); + serial_mouse_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 ioport_constructor device_input_ports() const override; @@ -27,8 +27,8 @@ protected: virtual void mouse_trans(int dx, int dy, int nb, int mbc) = 0; virtual void set_frame() = 0; void set_mouse_enable(bool state); - void queue_data(UINT8 data) {m_queue[m_head] = data; ++m_head %= 256;} - UINT8 unqueue_data() {UINT8 ret = m_queue[m_tail]; ++m_tail %= 256; return ret;} + void queue_data(uint8_t data) {m_queue[m_head] = data; ++m_head %= 256;} + uint8_t unqueue_data() {uint8_t ret = m_queue[m_tail]; ++m_tail %= 256; return ret;} virtual void tra_complete() override; virtual void tra_callback() override; void reset_mouse(); @@ -39,8 +39,8 @@ protected: int m_rts; private: - UINT8 m_queue[256]; - UINT8 m_head, m_tail, m_mb; + uint8_t m_queue[256]; + uint8_t m_head, m_tail, m_mb; emu_timer *m_timer; bool m_enabled; @@ -55,7 +55,7 @@ private: class microsoft_mouse_device : public serial_mouse_device { public: - microsoft_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + microsoft_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual WRITE_LINE_MEMBER(input_rts) override; @@ -69,7 +69,7 @@ extern const device_type MSFT_SERIAL_MOUSE; class mouse_systems_mouse_device : public serial_mouse_device { public: - mouse_systems_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mouse_systems_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void set_frame() override { set_data_frame(1, 8, PARITY_NONE, STOP_BITS_2); } diff --git a/src/devices/bus/rs232/sun_kbd.cpp b/src/devices/bus/rs232/sun_kbd.cpp index c0fa833897c..169732db04b 100644 --- a/src/devices/bus/rs232/sun_kbd.cpp +++ b/src/devices/bus/rs232/sun_kbd.cpp @@ -16,7 +16,7 @@ sun_keyboard_adaptor_device::sun_keyboard_adaptor_device( machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock) + uint32_t clock) : device_t(mconfig, SUN_KBD_ADAPTOR, "Sun Keyboard Adaptor", tag, owner, clock, "sunkbd_adaptor", __FILE__) , device_rs232_port_interface(mconfig, *this) , m_keyboard_port(*this, "keyboard") diff --git a/src/devices/bus/rs232/sun_kbd.h b/src/devices/bus/rs232/sun_kbd.h index 3033b33ce2f..8154eaca57d 100644 --- a/src/devices/bus/rs232/sun_kbd.h +++ b/src/devices/bus/rs232/sun_kbd.h @@ -15,7 +15,7 @@ extern device_type const SUN_KBD_ADAPTOR; class sun_keyboard_adaptor_device : public device_t, public device_rs232_port_interface { public: - sun_keyboard_adaptor_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); + sun_keyboard_adaptor_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); virtual ~sun_keyboard_adaptor_device() override; virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/rs232/terminal.cpp b/src/devices/bus/rs232/terminal.cpp index b56071b2bee..d4e0911825e 100644 --- a/src/devices/bus/rs232/terminal.cpp +++ b/src/devices/bus/rs232/terminal.cpp @@ -2,7 +2,7 @@ // copyright-holders:smf #include "terminal.h" -serial_terminal_device::serial_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +serial_terminal_device::serial_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_terminal_device(mconfig, SERIAL_TERMINAL, "Serial Terminal", tag, owner, clock, "serial_terminal", __FILE__) , device_buffered_serial_interface(mconfig, *this) , device_rs232_port_interface(mconfig, *this) @@ -77,7 +77,7 @@ void serial_terminal_device::device_timer(emu_timer &timer, device_timer_id id, device_buffered_serial_interface::device_timer(timer, id, param, ptr); } -void serial_terminal_device::send_key(UINT8 code) +void serial_terminal_device::send_key(uint8_t code) { transmit_byte(code); } @@ -87,7 +87,7 @@ void serial_terminal_device::tra_callback() output_rxd(transmit_register_get_data_bit()); } -void serial_terminal_device::received_byte(UINT8 byte) +void serial_terminal_device::received_byte(uint8_t byte) { term_write(byte); } diff --git a/src/devices/bus/rs232/terminal.h b/src/devices/bus/rs232/terminal.h index b3a550381eb..d9c788a1284 100644 --- a/src/devices/bus/rs232/terminal.h +++ b/src/devices/bus/rs232/terminal.h @@ -12,7 +12,7 @@ class serial_terminal_device : public generic_terminal_device, public device_rs232_port_interface { public: - serial_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + serial_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override { device_buffered_serial_interface::rx_w(state); } @@ -25,10 +25,10 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual void tra_callback() override; - virtual void send_key(UINT8 code) override; + virtual void send_key(uint8_t code) override; private: - virtual void received_byte(UINT8 byte) override; + virtual void received_byte(uint8_t byte) override; required_ioport m_rs232_txbaud; required_ioport m_rs232_rxbaud; diff --git a/src/devices/bus/rs232/xvd701.cpp b/src/devices/bus/rs232/xvd701.cpp index 9b032606ea8..0022f3cc135 100644 --- a/src/devices/bus/rs232/xvd701.cpp +++ b/src/devices/bus/rs232/xvd701.cpp @@ -2,7 +2,7 @@ // copyright-holders:smf #include "xvd701.h" -jvc_xvd701_device::jvc_xvd701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +jvc_xvd701_device::jvc_xvd701_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JVC_XVD701, "JVC XV-D701", tag, owner, clock, "xvd701", __FILE__), device_serial_interface(mconfig, *this), device_rs232_port_interface(mconfig, *this), diff --git a/src/devices/bus/rs232/xvd701.h b/src/devices/bus/rs232/xvd701.h index 29f6dd0a5a9..9c3c361b050 100644 --- a/src/devices/bus/rs232/xvd701.h +++ b/src/devices/bus/rs232/xvd701.h @@ -10,7 +10,7 @@ class jvc_xvd701_device : public device_t, public device_rs232_port_interface { public: - jvc_xvd701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + jvc_xvd701_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; virtual WRITE_LINE_MEMBER( input_txd ) override { device_serial_interface::rx_w(state); } diff --git a/src/devices/bus/s100/dj2db.cpp b/src/devices/bus/s100/dj2db.cpp index 2d068245c47..48f58c4981f 100644 --- a/src/devices/bus/s100/dj2db.cpp +++ b/src/devices/bus/s100/dj2db.cpp @@ -250,7 +250,7 @@ ioport_constructor s100_dj2db_device::device_input_ports() const // s100_dj2db_device - constructor //------------------------------------------------- -s100_dj2db_device::s100_dj2db_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +s100_dj2db_device::s100_dj2db_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S100_DJ2DB, "DJ2DB", tag, owner, clock, "dj2db", __FILE__), device_s100_card_interface(mconfig, *this), m_fdc(*this, MB8866_TAG), @@ -309,9 +309,9 @@ void s100_dj2db_device::device_reset() // s100_smemr_r - memory read //------------------------------------------------- -UINT8 s100_dj2db_device::s100_smemr_r(address_space &space, offs_t offset) +uint8_t s100_dj2db_device::s100_smemr_r(address_space &space, offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; // if (!(m_board_enbl & m_phantom)) return 0; @@ -388,7 +388,7 @@ UINT8 s100_dj2db_device::s100_smemr_r(address_space &space, offs_t offset) // s100_mwrt_w - memory write //------------------------------------------------- -void s100_dj2db_device::s100_mwrt_w(address_space &space, offs_t offset, UINT8 data) +void s100_dj2db_device::s100_mwrt_w(address_space &space, offs_t offset, uint8_t data) { // if (!(m_board_enbl & m_phantom)) return; @@ -481,7 +481,7 @@ void s100_dj2db_device::s100_mwrt_w(address_space &space, offs_t offset, UINT8 d // s100_sinp_r - I/O read //------------------------------------------------- -UINT8 s100_dj2db_device::s100_sinp_r(address_space &space, offs_t offset) +uint8_t s100_dj2db_device::s100_sinp_r(address_space &space, offs_t offset) { return 0; } @@ -491,7 +491,7 @@ UINT8 s100_dj2db_device::s100_sinp_r(address_space &space, offs_t offset) // s100_sout_w - I/O write //------------------------------------------------- -void s100_dj2db_device::s100_sout_w(address_space &space, offs_t offset, UINT8 data) +void s100_dj2db_device::s100_sout_w(address_space &space, offs_t offset, uint8_t data) { if (offset == 0x41) { diff --git a/src/devices/bus/s100/dj2db.h b/src/devices/bus/s100/dj2db.h index 725b2f3144a..19de517522b 100644 --- a/src/devices/bus/s100/dj2db.h +++ b/src/devices/bus/s100/dj2db.h @@ -29,7 +29,7 @@ class s100_dj2db_device : public device_t, { public: // construction/destruction - s100_dj2db_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s100_dj2db_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; @@ -47,10 +47,10 @@ protected: virtual void device_reset() override; // device_s100_card_interface overrides - virtual UINT8 s100_smemr_r(address_space &space, offs_t offset) override; - virtual void s100_mwrt_w(address_space &space, offs_t offset, UINT8 data) override; - virtual UINT8 s100_sinp_r(address_space &space, offs_t offset) override; - virtual void s100_sout_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t s100_smemr_r(address_space &space, offs_t offset) override; + virtual void s100_mwrt_w(address_space &space, offs_t offset, uint8_t data) override; + virtual uint8_t s100_sinp_r(address_space &space, offs_t offset) override; + virtual void s100_sout_w(address_space &space, offs_t offset, uint8_t data) override; virtual void s100_phantom_w(int state) override; private: @@ -63,7 +63,7 @@ private: required_device m_floppy3; floppy_image_device *m_floppy; required_memory_region m_rom; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; required_ioport m_j1a; required_ioport m_j3a; required_ioport m_j4; diff --git a/src/devices/bus/s100/djdma.cpp b/src/devices/bus/s100/djdma.cpp index 0d75e497040..427c063ceef 100644 --- a/src/devices/bus/s100/djdma.cpp +++ b/src/devices/bus/s100/djdma.cpp @@ -102,7 +102,7 @@ machine_config_constructor s100_djdma_device::device_mconfig_additions() const // s100_djdma_device - constructor //------------------------------------------------- -s100_djdma_device::s100_djdma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +s100_djdma_device::s100_djdma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S100_DJDMA, "DJDMA", tag, owner, clock, "djdma", __FILE__), device_s100_card_interface(mconfig, *this) { diff --git a/src/devices/bus/s100/djdma.h b/src/devices/bus/s100/djdma.h index a21e717493c..ce60e368630 100644 --- a/src/devices/bus/s100/djdma.h +++ b/src/devices/bus/s100/djdma.h @@ -28,7 +28,7 @@ class s100_djdma_device : public device_t, { public: // construction/destruction - s100_djdma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s100_djdma_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; diff --git a/src/devices/bus/s100/mm65k16s.cpp b/src/devices/bus/s100/mm65k16s.cpp index 1a6af3c4c89..058731005e8 100644 --- a/src/devices/bus/s100/mm65k16s.cpp +++ b/src/devices/bus/s100/mm65k16s.cpp @@ -201,7 +201,7 @@ ioport_constructor s100_mm65k16s_device::device_input_ports() const // s100_mm65k16s_device - constructor //------------------------------------------------- -s100_mm65k16s_device::s100_mm65k16s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +s100_mm65k16s_device::s100_mm65k16s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S100_MM65K16S, "MM65K16S", tag, owner, clock, "mm65k16s", __FILE__), device_s100_card_interface(mconfig, *this), m_ram(*this, "ram") @@ -232,9 +232,9 @@ void s100_mm65k16s_device::device_reset() // s100_smemr_r - memory read //------------------------------------------------- -UINT8 s100_mm65k16s_device::s100_smemr_r(address_space &space, offs_t offset) +uint8_t s100_mm65k16s_device::s100_smemr_r(address_space &space, offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; if (offset < 0xf800) { @@ -249,7 +249,7 @@ UINT8 s100_mm65k16s_device::s100_smemr_r(address_space &space, offs_t offset) // s100_mwrt_w - memory write //------------------------------------------------- -void s100_mm65k16s_device::s100_mwrt_w(address_space &space, offs_t offset, UINT8 data) +void s100_mm65k16s_device::s100_mwrt_w(address_space &space, offs_t offset, uint8_t data) { if (offset < 0xf800) { diff --git a/src/devices/bus/s100/mm65k16s.h b/src/devices/bus/s100/mm65k16s.h index c8ec89af58c..d44d600ce7e 100644 --- a/src/devices/bus/s100/mm65k16s.h +++ b/src/devices/bus/s100/mm65k16s.h @@ -27,7 +27,7 @@ class s100_mm65k16s_device : public device_t, { public: // construction/destruction - s100_mm65k16s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s100_mm65k16s_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; @@ -39,12 +39,12 @@ protected: virtual void device_reset() override; // device_s100_card_interface overrides - virtual UINT8 s100_smemr_r(address_space &space, offs_t offset) override; - virtual void s100_mwrt_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t s100_smemr_r(address_space &space, offs_t offset) override; + virtual void s100_mwrt_w(address_space &space, offs_t offset, uint8_t data) override; virtual void s100_phantom_w(int state) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; }; diff --git a/src/devices/bus/s100/nsmdsa.cpp b/src/devices/bus/s100/nsmdsa.cpp index d892c1931e7..d39ef735ad5 100644 --- a/src/devices/bus/s100/nsmdsa.cpp +++ b/src/devices/bus/s100/nsmdsa.cpp @@ -81,7 +81,7 @@ machine_config_constructor s100_mds_a_device::device_mconfig_additions() const // s100_mds_a_device - constructor //------------------------------------------------- -s100_mds_a_device::s100_mds_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +s100_mds_a_device::s100_mds_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S100_MDS_A, "MDS-A", tag, owner, clock, "nsmdsa", __FILE__), device_s100_card_interface(mconfig, *this), m_floppy0(*this, "floppy0"), @@ -114,7 +114,7 @@ void s100_mds_a_device::device_reset() // s100_smemr_r - memory read //------------------------------------------------- -UINT8 s100_mds_a_device::s100_smemr_r(address_space &space, offs_t offset) +uint8_t s100_mds_a_device::s100_smemr_r(address_space &space, offs_t offset) { return 0; } diff --git a/src/devices/bus/s100/nsmdsa.h b/src/devices/bus/s100/nsmdsa.h index 3eb7f4049e4..96c0219dd5a 100644 --- a/src/devices/bus/s100/nsmdsa.h +++ b/src/devices/bus/s100/nsmdsa.h @@ -28,7 +28,7 @@ class s100_mds_a_device : public device_t, { public: // construction/destruction - s100_mds_a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s100_mds_a_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; @@ -40,7 +40,7 @@ protected: virtual void device_reset() override; // device_s100_card_interface overrides - virtual UINT8 s100_smemr_r(address_space &space, offs_t offset) override; + virtual uint8_t s100_smemr_r(address_space &space, offs_t offset) override; private: required_device m_floppy0; diff --git a/src/devices/bus/s100/nsmdsad.cpp b/src/devices/bus/s100/nsmdsad.cpp index 191c265cf59..bd6b6b1f9d7 100644 --- a/src/devices/bus/s100/nsmdsad.cpp +++ b/src/devices/bus/s100/nsmdsad.cpp @@ -82,7 +82,7 @@ machine_config_constructor s100_mds_ad_device::device_mconfig_additions() const // s100_mds_ad_device - constructor //------------------------------------------------- -s100_mds_ad_device::s100_mds_ad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +s100_mds_ad_device::s100_mds_ad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S100_MDS_AD, "MDS-A-D", tag, owner, clock, "nsmdsad", __FILE__), device_s100_card_interface(mconfig, *this), m_floppy0(*this, "floppy0"), @@ -116,7 +116,7 @@ void s100_mds_ad_device::device_reset() // s100_smemr_r - memory read //------------------------------------------------- -UINT8 s100_mds_ad_device::s100_smemr_r(address_space &space, offs_t offset) +uint8_t s100_mds_ad_device::s100_smemr_r(address_space &space, offs_t offset) { return 0; } diff --git a/src/devices/bus/s100/nsmdsad.h b/src/devices/bus/s100/nsmdsad.h index 105a526b0a6..f8c124d00e5 100644 --- a/src/devices/bus/s100/nsmdsad.h +++ b/src/devices/bus/s100/nsmdsad.h @@ -28,7 +28,7 @@ class s100_mds_ad_device : public device_t, { public: // construction/destruction - s100_mds_ad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s100_mds_ad_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; @@ -40,7 +40,7 @@ protected: virtual void device_reset() override; // device_s100_card_interface overrides - virtual UINT8 s100_smemr_r(address_space &space, offs_t offset) override; + virtual uint8_t s100_smemr_r(address_space &space, offs_t offset) override; private: required_device m_floppy0; diff --git a/src/devices/bus/s100/s100.cpp b/src/devices/bus/s100/s100.cpp index da63653b737..889c05b40f9 100644 --- a/src/devices/bus/s100/s100.cpp +++ b/src/devices/bus/s100/s100.cpp @@ -37,7 +37,7 @@ device_s100_card_interface::device_s100_card_interface(const machine_config &mco //------------------------------------------------- // s100_slot_t - constructor //------------------------------------------------- -s100_slot_t::s100_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +s100_slot_t::s100_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S100_SLOT, "S100 slot", tag, owner, clock, "s100_slot", __FILE__), device_slot_interface(mconfig, *this), m_bus(nullptr) { @@ -60,7 +60,7 @@ void s100_slot_t::device_start() // s100_bus_t - constructor //------------------------------------------------- -s100_bus_t::s100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +s100_bus_t::s100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S100_BUS, "S100", tag, owner, clock, "s100", __FILE__), m_write_irq(*this), m_write_nmi(*this), @@ -136,7 +136,7 @@ void s100_bus_t::add_card(device_s100_card_interface *card) READ8_MEMBER( s100_bus_t::smemr_r ) { - UINT8 data = 0; + uint8_t data = 0; device_s100_card_interface *entry = m_device_list.first(); @@ -172,7 +172,7 @@ WRITE8_MEMBER( s100_bus_t::mwrt_w ) READ8_MEMBER( s100_bus_t::sinp_r ) { - UINT8 data = 0; + uint8_t data = 0; device_s100_card_interface *entry = m_device_list.first(); diff --git a/src/devices/bus/s100/s100.h b/src/devices/bus/s100/s100.h index 97d067f62e8..9a740bd3dd5 100644 --- a/src/devices/bus/s100/s100.h +++ b/src/devices/bus/s100/s100.h @@ -163,7 +163,7 @@ public: // interrupts virtual void s100_int_w(int state) { }; virtual void s100_nmi_w(int state) { }; - virtual UINT8 s100_sinta_r(offs_t offset) { return 0; }; + virtual uint8_t s100_sinta_r(offs_t offset) { return 0; }; // vectored interrupts virtual void s100_vi0_w(int state) { }; @@ -176,12 +176,12 @@ public: virtual void s100_vi7_w(int state) { }; // memory access - virtual UINT8 s100_smemr_r(address_space &space, offs_t offset) { return 0; }; - virtual void s100_mwrt_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t s100_smemr_r(address_space &space, offs_t offset) { return 0; }; + virtual void s100_mwrt_w(address_space &space, offs_t offset, uint8_t data) { }; // I/O access - virtual UINT8 s100_sinp_r(address_space &space, offs_t offset) { return 0; }; - virtual void s100_sout_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t s100_sinp_r(address_space &space, offs_t offset) { return 0; }; + virtual void s100_sout_w(address_space &space, offs_t offset, uint8_t data) { }; // configuration access virtual void s100_phlda_w(int state) { } @@ -208,7 +208,7 @@ class s100_bus_t : public device_t { public: // construction/destruction - s100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~s100_bus_t() { m_device_list.detach_all(); } template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } @@ -290,7 +290,7 @@ class s100_slot_t : public device_t, { public: // construction/destruction - s100_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s100_slot_t(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/devices/bus/s100/wunderbus.cpp b/src/devices/bus/s100/wunderbus.cpp index 37d10342d4e..b6e757217c9 100644 --- a/src/devices/bus/s100/wunderbus.cpp +++ b/src/devices/bus/s100/wunderbus.cpp @@ -236,7 +236,7 @@ ioport_constructor s100_wunderbus_device::device_input_ports() const // s100_wunderbus_device - constructor //------------------------------------------------- -s100_wunderbus_device::s100_wunderbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +s100_wunderbus_device::s100_wunderbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S100_WUNDERBUS, "Wunderbus I/O", tag, owner, clock, "s100_wunderbus", __FILE__), device_s100_card_interface(mconfig, *this), m_pic(*this, I8259A_TAG), @@ -302,12 +302,12 @@ void s100_wunderbus_device::s100_vi2_w(int state) // s100_sinp_r - I/O read //------------------------------------------------- -UINT8 s100_wunderbus_device::s100_sinp_r(address_space &space, offs_t offset) +uint8_t s100_wunderbus_device::s100_sinp_r(address_space &space, offs_t offset) { - UINT8 address = (m_7c->read() & 0x3e) << 2; + uint8_t address = (m_7c->read() & 0x3e) << 2; if ((offset & 0xf8) != address) return 0; - UINT8 data = 0; + uint8_t data = 0; if ((offset & 0x07) < 7) { @@ -411,9 +411,9 @@ UINT8 s100_wunderbus_device::s100_sinp_r(address_space &space, offs_t offset) // s100_sout_w - I/O write //------------------------------------------------- -void s100_wunderbus_device::s100_sout_w(address_space &space, offs_t offset, UINT8 data) +void s100_wunderbus_device::s100_sout_w(address_space &space, offs_t offset, uint8_t data) { - UINT8 address = (m_7c->read() & 0x3e) << 2; + uint8_t address = (m_7c->read() & 0x3e) << 2; if ((offset & 0xf8) != address) return; if ((offset & 0x07) == 7) diff --git a/src/devices/bus/s100/wunderbus.h b/src/devices/bus/s100/wunderbus.h index 53aae135b06..5d2e37ed48b 100644 --- a/src/devices/bus/s100/wunderbus.h +++ b/src/devices/bus/s100/wunderbus.h @@ -29,7 +29,7 @@ class s100_wunderbus_device : public device_t, { public: // construction/destruction - s100_wunderbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s100_wunderbus_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,8 +48,8 @@ protected: virtual void s100_vi0_w(int state) override; virtual void s100_vi1_w(int state) override; virtual void s100_vi2_w(int state) override; - virtual UINT8 s100_sinp_r(address_space &space, offs_t offset) override; - virtual void s100_sout_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t s100_sinp_r(address_space &space, offs_t offset) override; + virtual void s100_sout_w(address_space &space, offs_t offset, uint8_t data) override; private: required_device m_pic; @@ -60,7 +60,7 @@ private: required_ioport m_7c; required_ioport m_10a; - UINT8 m_group; + uint8_t m_group; int m_rtc_tp; }; diff --git a/src/devices/bus/sat_ctrl/analog.cpp b/src/devices/bus/sat_ctrl/analog.cpp index 32cf2092385..fe47de25800 100644 --- a/src/devices/bus/sat_ctrl/analog.cpp +++ b/src/devices/bus/sat_ctrl/analog.cpp @@ -62,7 +62,7 @@ ioport_constructor saturn_analog_device::device_input_ports() const // saturn_analog_device - constructor //------------------------------------------------- -saturn_analog_device::saturn_analog_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_analog_device::saturn_analog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_ANALOG, "Sega Saturn Analog Controller", tag, owner, clock, "saturn_analog", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_joy(*this, "JOY"), @@ -96,9 +96,9 @@ void saturn_analog_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 saturn_analog_device::read_ctrl(UINT8 offset) +uint8_t saturn_analog_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; + uint8_t res = 0; switch (offset) { case 0: diff --git a/src/devices/bus/sat_ctrl/analog.h b/src/devices/bus/sat_ctrl/analog.h index ebd99d570fa..670d2f09af1 100644 --- a/src/devices/bus/sat_ctrl/analog.h +++ b/src/devices/bus/sat_ctrl/analog.h @@ -26,7 +26,7 @@ class saturn_analog_device : public device_t, { public: // construction/destruction - saturn_analog_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_analog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,9 +37,9 @@ protected: virtual void device_reset() override; // device_saturn_control_port_interface overrides - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0xf1; } - virtual UINT8 read_id(int idx) override { return m_ctrl_id; } + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0xf1; } + virtual uint8_t read_id(int idx) override { return m_ctrl_id; } private: required_ioport m_joy; diff --git a/src/devices/bus/sat_ctrl/ctrl.cpp b/src/devices/bus/sat_ctrl/ctrl.cpp index 2d5473bbb19..884dcd118d4 100644 --- a/src/devices/bus/sat_ctrl/ctrl.cpp +++ b/src/devices/bus/sat_ctrl/ctrl.cpp @@ -58,7 +58,7 @@ device_saturn_control_port_interface::~device_saturn_control_port_interface() // saturn_control_port_device - constructor //------------------------------------------------- -saturn_control_port_device::saturn_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_control_port_device::saturn_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_CONTROL_PORT, "Sega Saturn control port", tag, owner, clock, "saturn_control_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) { @@ -84,9 +84,9 @@ void saturn_control_port_device::device_start() } -UINT8 saturn_control_port_device::read_status() +uint8_t saturn_control_port_device::read_status() { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data |= m_device->read_status(); return data; @@ -94,25 +94,25 @@ UINT8 saturn_control_port_device::read_status() // Notice that the variable idx is only used by the multitap / segatap adapters // Otherwise, any value is ignored and the unique controller ID is returned -UINT8 saturn_control_port_device::read_id(int idx) +uint8_t saturn_control_port_device::read_id(int idx) { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data |= m_device->read_id(idx); return data; } -UINT8 saturn_control_port_device::read_ctrl(UINT8 offset) +uint8_t saturn_control_port_device::read_ctrl(uint8_t offset) { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data |= m_device->read_ctrl(offset); return data; } -UINT16 saturn_control_port_device::read_direct() +uint16_t saturn_control_port_device::read_direct() { - UINT16 data = 0; + uint16_t data = 0; if (m_device) data |= m_device->read_direct(); return data; diff --git a/src/devices/bus/sat_ctrl/ctrl.h b/src/devices/bus/sat_ctrl/ctrl.h index ad3fe80cec7..255a02a9399 100644 --- a/src/devices/bus/sat_ctrl/ctrl.h +++ b/src/devices/bus/sat_ctrl/ctrl.h @@ -29,13 +29,13 @@ public: device_saturn_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_saturn_control_port_interface(); - virtual UINT16 read_direct() { return 0; }; - virtual UINT8 read_ctrl(UINT8 offset) { return 0; }; - virtual UINT8 read_status() { return 0xf0; }; - virtual UINT8 read_id(int idx) { return 0xff; }; + virtual uint16_t read_direct() { return 0; }; + virtual uint8_t read_ctrl(uint8_t offset) { return 0; }; + virtual uint8_t read_status() { return 0xf0; }; + virtual uint8_t read_id(int idx) { return 0xff; }; protected: - UINT8 m_ctrl_id; + uint8_t m_ctrl_id; saturn_control_port_device *m_port; }; @@ -46,13 +46,13 @@ class saturn_control_port_device : public device_t, { public: // construction/destruction - saturn_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~saturn_control_port_device(); - UINT16 read_direct(); - UINT8 read_ctrl(UINT8 offset); - UINT8 read_status(); - UINT8 read_id(int idx); + uint16_t read_direct(); + uint8_t read_ctrl(uint8_t offset); + uint8_t read_status(); + uint8_t read_id(int idx); // device-level overrides virtual void device_start() override; diff --git a/src/devices/bus/sat_ctrl/joy.cpp b/src/devices/bus/sat_ctrl/joy.cpp index ff2ebb0733e..9a4ef6fd378 100644 --- a/src/devices/bus/sat_ctrl/joy.cpp +++ b/src/devices/bus/sat_ctrl/joy.cpp @@ -53,7 +53,7 @@ ioport_constructor saturn_joy_device::device_input_ports() const // saturn_joy_device - constructor //------------------------------------------------- -saturn_joy_device::saturn_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_joy_device::saturn_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_JOY, "Sega Saturn Joypad", tag, owner, clock, "saturn_joy", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_joy(*this, "JOY") @@ -84,9 +84,9 @@ void saturn_joy_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 saturn_joy_device::read_ctrl(UINT8 offset) +uint8_t saturn_joy_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; + uint8_t res = 0; switch (offset) { case 0: @@ -104,7 +104,7 @@ UINT8 saturn_joy_device::read_ctrl(UINT8 offset) // read_direct //------------------------------------------------- -UINT16 saturn_joy_device::read_direct() +uint16_t saturn_joy_device::read_direct() { return m_joy->read(); } diff --git a/src/devices/bus/sat_ctrl/joy.h b/src/devices/bus/sat_ctrl/joy.h index 58ec4e544c6..b9a54f1afcd 100644 --- a/src/devices/bus/sat_ctrl/joy.h +++ b/src/devices/bus/sat_ctrl/joy.h @@ -26,7 +26,7 @@ class saturn_joy_device : public device_t, { public: // construction/destruction - saturn_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,10 +37,10 @@ protected: virtual void device_reset() override; // device_saturn_control_port_interface overrides - virtual UINT16 read_direct() override; - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0xf1; } - virtual UINT8 read_id(int idx) override { return m_ctrl_id; } + virtual uint16_t read_direct() override; + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0xf1; } + virtual uint8_t read_id(int idx) override { return m_ctrl_id; } private: required_ioport m_joy; diff --git a/src/devices/bus/sat_ctrl/joy_md.cpp b/src/devices/bus/sat_ctrl/joy_md.cpp index d88753c591b..ae57cbb79a9 100644 --- a/src/devices/bus/sat_ctrl/joy_md.cpp +++ b/src/devices/bus/sat_ctrl/joy_md.cpp @@ -69,7 +69,7 @@ ioport_constructor saturn_joymd6b_device::device_input_ports() const // constructors //------------------------------------------------- -saturn_joymd3b_device::saturn_joymd3b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_joymd3b_device::saturn_joymd3b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_JOYMD3B, "Sega Saturn Joypad MD 3buttons", tag, owner, clock, "saturn_md3b", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_joy(*this, "JOY") @@ -78,7 +78,7 @@ saturn_joymd3b_device::saturn_joymd3b_device(const machine_config &mconfig, cons } -saturn_joymd6b_device::saturn_joymd6b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_joymd6b_device::saturn_joymd6b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_JOYMD6B, "Sega Saturn Joypad MD 6buttons", tag, owner, clock, "saturn_md6b", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_joy(*this, "JOY") @@ -91,9 +91,9 @@ saturn_joymd6b_device::saturn_joymd6b_device(const machine_config &mconfig, cons // read_ctrl //------------------------------------------------- -UINT8 saturn_joymd3b_device::read_ctrl(UINT8 offset) +uint8_t saturn_joymd3b_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; + uint8_t res = 0; switch (offset) { case 0: @@ -104,9 +104,9 @@ UINT8 saturn_joymd3b_device::read_ctrl(UINT8 offset) return res; } -UINT8 saturn_joymd6b_device::read_ctrl(UINT8 offset) +uint8_t saturn_joymd6b_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; + uint8_t res = 0; switch (offset) { case 0: diff --git a/src/devices/bus/sat_ctrl/joy_md.h b/src/devices/bus/sat_ctrl/joy_md.h index 8c2505aad5e..a19596fcdab 100644 --- a/src/devices/bus/sat_ctrl/joy_md.h +++ b/src/devices/bus/sat_ctrl/joy_md.h @@ -26,7 +26,7 @@ class saturn_joymd3b_device : public device_t, { public: // construction/destruction - saturn_joymd3b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_joymd3b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,9 +37,9 @@ protected: virtual void device_reset() override {}; // device_saturn_control_port_interface overrides - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0xf1; } - virtual UINT8 read_id(int idx) override { return m_ctrl_id; } + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0xf1; } + virtual uint8_t read_id(int idx) override { return m_ctrl_id; } private: required_ioport m_joy; @@ -53,7 +53,7 @@ class saturn_joymd6b_device : public device_t, { public: // construction/destruction - saturn_joymd6b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_joymd6b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -64,9 +64,9 @@ protected: virtual void device_reset() override {}; // device_saturn_control_port_interface overrides - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0xf1; } - virtual UINT8 read_id(int idx) override { return m_ctrl_id; } + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0xf1; } + virtual uint8_t read_id(int idx) override { return m_ctrl_id; } private: required_ioport m_joy; diff --git a/src/devices/bus/sat_ctrl/keybd.cpp b/src/devices/bus/sat_ctrl/keybd.cpp index d84922929ff..b257ae2878c 100644 --- a/src/devices/bus/sat_ctrl/keybd.cpp +++ b/src/devices/bus/sat_ctrl/keybd.cpp @@ -205,7 +205,7 @@ ioport_constructor saturn_keybd_device::device_input_ports() const // saturn_keybd_device - constructor //------------------------------------------------- -saturn_keybd_device::saturn_keybd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_keybd_device::saturn_keybd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_KEYBD, "Sega Saturn Keyboard", tag, owner, clock, "saturn_keybd", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_key(*this, "KEY.%u", 0), @@ -250,7 +250,7 @@ INPUT_CHANGED_MEMBER(saturn_keybd_device::key_stroke) { if (newval && !oldval) { - m_data = ((UINT8)(uintptr_t)(param) & 0xff); + m_data = ((uint8_t)(uintptr_t)(param) & 0xff); m_status |= 8; } @@ -261,9 +261,9 @@ INPUT_CHANGED_MEMBER(saturn_keybd_device::key_stroke) } } -UINT16 saturn_keybd_device::get_game_key() +uint16_t saturn_keybd_device::get_game_key() { - UINT16 game_key = 0xffff; + uint16_t game_key = 0xffff; game_key ^= ((m_key_s1->read() & 0x80) << 8); // right game_key ^= ((m_key_s1->read() & 0x40) << 8); // left @@ -282,9 +282,9 @@ UINT16 saturn_keybd_device::get_game_key() return game_key; } -UINT8 saturn_keybd_device::read_ctrl(UINT8 offset) +uint8_t saturn_keybd_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; + uint8_t res = 0; /* Keyboard Status hook-up diff --git a/src/devices/bus/sat_ctrl/keybd.h b/src/devices/bus/sat_ctrl/keybd.h index 314e87bf118..18585c6d976 100644 --- a/src/devices/bus/sat_ctrl/keybd.h +++ b/src/devices/bus/sat_ctrl/keybd.h @@ -26,7 +26,7 @@ class saturn_keybd_device : public device_t, { public: // construction/destruction - saturn_keybd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_keybd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -39,17 +39,17 @@ protected: virtual void device_reset() override; // device_saturn_control_port_interface overrides - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0xf1; } - virtual UINT8 read_id(int idx) override { return m_ctrl_id; } + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0xf1; } + virtual uint8_t read_id(int idx) override { return m_ctrl_id; } private: - UINT8 m_status; - UINT8 m_data; - UINT8 m_prev_data; - UINT16 m_repeat_count; + uint8_t m_status; + uint8_t m_data; + uint8_t m_prev_data; + uint16_t m_repeat_count; - UINT16 get_game_key(); + uint16_t get_game_key(); required_ioport_array<16> m_key; required_ioport m_key_s1; diff --git a/src/devices/bus/sat_ctrl/mouse.cpp b/src/devices/bus/sat_ctrl/mouse.cpp index 45ac96ea6d2..66618edccac 100644 --- a/src/devices/bus/sat_ctrl/mouse.cpp +++ b/src/devices/bus/sat_ctrl/mouse.cpp @@ -50,7 +50,7 @@ ioport_constructor saturn_mouse_device::device_input_ports() const // saturn_mouse_device - constructor //------------------------------------------------- -saturn_mouse_device::saturn_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_mouse_device::saturn_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_MOUSE, "Sega Saturn Mouse", tag, owner, clock, "saturn_mouse", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_pointx(*this, "MOUSE_X"), @@ -83,12 +83,12 @@ void saturn_mouse_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 saturn_mouse_device::read_ctrl(UINT8 offset) +uint8_t saturn_mouse_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; - UINT8 mouse_ctrl = m_buttons->read(); - INT16 mouse_x = m_pointx->read(); - INT16 mouse_y = m_pointy->read(); + uint8_t res = 0; + uint8_t mouse_ctrl = m_buttons->read(); + int16_t mouse_x = m_pointx->read(); + int16_t mouse_y = m_pointy->read(); if (mouse_x < 0) mouse_ctrl |= 0x10; diff --git a/src/devices/bus/sat_ctrl/mouse.h b/src/devices/bus/sat_ctrl/mouse.h index 87e1d847e8c..562602ad778 100644 --- a/src/devices/bus/sat_ctrl/mouse.h +++ b/src/devices/bus/sat_ctrl/mouse.h @@ -26,7 +26,7 @@ class saturn_mouse_device : public device_t, { public: // construction/destruction - saturn_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,9 +37,9 @@ protected: virtual void device_reset() override; // device_saturn_control_port_interface overrides - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0xf1; } - virtual UINT8 read_id(int idx) override { return m_ctrl_id; } + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0xf1; } + virtual uint8_t read_id(int idx) override { return m_ctrl_id; } private: required_ioport m_pointx; diff --git a/src/devices/bus/sat_ctrl/multitap.cpp b/src/devices/bus/sat_ctrl/multitap.cpp index 4de26acb070..94c2384e084 100644 --- a/src/devices/bus/sat_ctrl/multitap.cpp +++ b/src/devices/bus/sat_ctrl/multitap.cpp @@ -25,7 +25,7 @@ const device_type SATURN_MULTITAP = &device_creator; // saturn_multitap_device - constructor //------------------------------------------------- -saturn_multitap_device::saturn_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_multitap_device::saturn_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_MULTITAP, "Sega Saturn Multitap", tag, owner, clock, "saturn_multitap", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_subctrl1_port(*this, "ctrl1"), @@ -64,9 +64,9 @@ void saturn_multitap_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 saturn_multitap_device::read_ctrl(UINT8 offset) +uint8_t saturn_multitap_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; + uint8_t res = 0; switch (offset) { default: @@ -102,7 +102,7 @@ UINT8 saturn_multitap_device::read_ctrl(UINT8 offset) // read_id //------------------------------------------------- -UINT8 saturn_multitap_device::read_id(int idx) +uint8_t saturn_multitap_device::read_id(int idx) { switch (idx) { diff --git a/src/devices/bus/sat_ctrl/multitap.h b/src/devices/bus/sat_ctrl/multitap.h index acc8f109e3e..41715846c84 100644 --- a/src/devices/bus/sat_ctrl/multitap.h +++ b/src/devices/bus/sat_ctrl/multitap.h @@ -28,7 +28,7 @@ class saturn_multitap_device : public device_t, { public: // construction/destruction - saturn_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_multitap_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; @@ -39,9 +39,9 @@ protected: virtual void device_reset() override; // device_saturn_control_port_interface overrides - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0x16; } - virtual UINT8 read_id(int idx) override; + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0x16; } + virtual uint8_t read_id(int idx) override; private: required_device m_subctrl1_port; diff --git a/src/devices/bus/sat_ctrl/pointer.cpp b/src/devices/bus/sat_ctrl/pointer.cpp index 9762286dbbe..efc39966085 100644 --- a/src/devices/bus/sat_ctrl/pointer.cpp +++ b/src/devices/bus/sat_ctrl/pointer.cpp @@ -50,7 +50,7 @@ ioport_constructor saturn_track_device::device_input_ports() const // saturn_track_device - constructor //------------------------------------------------- -saturn_track_device::saturn_track_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_track_device::saturn_track_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_TRACK, "Sega Saturn Pointing Controller / Trackball", tag, owner, clock, "saturn_track", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_pointx(*this, "POINT_X"), @@ -83,12 +83,12 @@ void saturn_track_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 saturn_track_device::read_ctrl(UINT8 offset) +uint8_t saturn_track_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; - UINT8 mouse_ctrl = m_buttons->read(); - INT16 mouse_x = m_pointx->read(); - INT16 mouse_y = m_pointy->read(); + uint8_t res = 0; + uint8_t mouse_ctrl = m_buttons->read(); + int16_t mouse_x = m_pointx->read(); + int16_t mouse_y = m_pointy->read(); if (mouse_x < 0) mouse_ctrl |= 0x10; diff --git a/src/devices/bus/sat_ctrl/pointer.h b/src/devices/bus/sat_ctrl/pointer.h index 9b9a8986a3f..e060ea07d43 100644 --- a/src/devices/bus/sat_ctrl/pointer.h +++ b/src/devices/bus/sat_ctrl/pointer.h @@ -26,7 +26,7 @@ class saturn_track_device : public device_t, { public: // construction/destruction - saturn_track_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_track_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,9 +37,9 @@ protected: virtual void device_reset() override; // device_saturn_control_port_interface overrides - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0xf1; } - virtual UINT8 read_id(int idx) override { return m_ctrl_id; } + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0xf1; } + virtual uint8_t read_id(int idx) override { return m_ctrl_id; } private: required_ioport m_pointx; diff --git a/src/devices/bus/sat_ctrl/racing.cpp b/src/devices/bus/sat_ctrl/racing.cpp index 0f86c6d3d23..25f4653bd21 100644 --- a/src/devices/bus/sat_ctrl/racing.cpp +++ b/src/devices/bus/sat_ctrl/racing.cpp @@ -56,7 +56,7 @@ ioport_constructor saturn_wheel_device::device_input_ports() const // saturn_wheel_device - constructor //------------------------------------------------- -saturn_wheel_device::saturn_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_wheel_device::saturn_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_WHEEL, "Sega Saturn Racing Wheel", tag, owner, clock, "saturn_racing", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_joy(*this, "JOY"), @@ -88,9 +88,9 @@ void saturn_wheel_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 saturn_wheel_device::read_ctrl(UINT8 offset) +uint8_t saturn_wheel_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; + uint8_t res = 0; switch (offset) { case 0: diff --git a/src/devices/bus/sat_ctrl/racing.h b/src/devices/bus/sat_ctrl/racing.h index 3edb9658d34..14fc3f2e0c6 100644 --- a/src/devices/bus/sat_ctrl/racing.h +++ b/src/devices/bus/sat_ctrl/racing.h @@ -26,7 +26,7 @@ class saturn_wheel_device : public device_t, { public: // construction/destruction - saturn_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,9 +37,9 @@ protected: virtual void device_reset() override; // device_saturn_control_port_interface overrides - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0xf1; } - virtual UINT8 read_id(int idx) override { return m_ctrl_id; } + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0xf1; } + virtual uint8_t read_id(int idx) override { return m_ctrl_id; } private: required_ioport m_joy; diff --git a/src/devices/bus/sat_ctrl/segatap.cpp b/src/devices/bus/sat_ctrl/segatap.cpp index 7b759902cd7..508f06d655f 100644 --- a/src/devices/bus/sat_ctrl/segatap.cpp +++ b/src/devices/bus/sat_ctrl/segatap.cpp @@ -25,7 +25,7 @@ const device_type SATURN_SEGATAP = &device_creator; // saturn_segatap_device - constructor //------------------------------------------------- -saturn_segatap_device::saturn_segatap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saturn_segatap_device::saturn_segatap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_SEGATAP, "Sega Saturn SegaTap", tag, owner, clock, "saturn_segatap", __FILE__), device_saturn_control_port_interface(mconfig, *this), m_subctrl1_port(*this, "ctrl1"), @@ -60,9 +60,9 @@ void saturn_segatap_device::device_reset() // read_ctrl //------------------------------------------------- -UINT8 saturn_segatap_device::read_ctrl(UINT8 offset) +uint8_t saturn_segatap_device::read_ctrl(uint8_t offset) { - UINT8 res = 0; + uint8_t res = 0; switch (offset) { default: @@ -90,7 +90,7 @@ UINT8 saturn_segatap_device::read_ctrl(UINT8 offset) // read_id //------------------------------------------------- -UINT8 saturn_segatap_device::read_id(int idx) +uint8_t saturn_segatap_device::read_id(int idx) { switch (idx) { diff --git a/src/devices/bus/sat_ctrl/segatap.h b/src/devices/bus/sat_ctrl/segatap.h index 149fb05f551..744b7e45620 100644 --- a/src/devices/bus/sat_ctrl/segatap.h +++ b/src/devices/bus/sat_ctrl/segatap.h @@ -28,7 +28,7 @@ class saturn_segatap_device : public device_t, { public: // construction/destruction - saturn_segatap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_segatap_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; @@ -39,9 +39,9 @@ protected: virtual void device_reset() override; // device_saturn_control_port_interface overrides - virtual UINT8 read_ctrl(UINT8 offset) override; - virtual UINT8 read_status() override { return 0x04; } - virtual UINT8 read_id(int idx) override; + virtual uint8_t read_ctrl(uint8_t offset) override; + virtual uint8_t read_status() override { return 0x04; } + virtual uint8_t read_id(int idx) override; private: required_device m_subctrl1_port; diff --git a/src/devices/bus/saturn/bram.cpp b/src/devices/bus/saturn/bram.cpp index 28d0aba2945..497580a9973 100644 --- a/src/devices/bus/saturn/bram.cpp +++ b/src/devices/bus/saturn/bram.cpp @@ -21,32 +21,32 @@ const device_type SATURN_BRAM_16MB = &device_creator; const device_type SATURN_BRAM_32MB = &device_creator; -saturn_bram_device::saturn_bram_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) +saturn_bram_device::saturn_bram_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_sat_cart_interface( mconfig, *this ), device_nvram_interface(mconfig, *this) { } -saturn_bram4mb_device::saturn_bram4mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saturn_bram4mb_device::saturn_bram4mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saturn_bram_device(mconfig, SATURN_BRAM_4MB, "Saturn Battery RAM 4Mbit Cart", tag, owner, clock, "sat_bram_4mb", __FILE__) { m_cart_type = 0x21; } -saturn_bram8mb_device::saturn_bram8mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saturn_bram8mb_device::saturn_bram8mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saturn_bram_device(mconfig, SATURN_BRAM_8MB, "Saturn Battery RAM 8Mbit Cart", tag, owner, clock, "sat_bram_8mb", __FILE__) { m_cart_type = 0x22; } -saturn_bram16mb_device::saturn_bram16mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saturn_bram16mb_device::saturn_bram16mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saturn_bram_device(mconfig, SATURN_BRAM_16MB, "Saturn Battery RAM 16Mbit Cart", tag, owner, clock, "sat_bram_16mb", __FILE__) { m_cart_type = 0x23; } -saturn_bram32mb_device::saturn_bram32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saturn_bram32mb_device::saturn_bram32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saturn_bram_device(mconfig, SATURN_BRAM_32MB, "Saturn Battery RAM 32Mbit Cart", tag, owner, clock, "sat_bram_32mb", __FILE__) { m_cart_type = 0x24; @@ -67,7 +67,7 @@ void saturn_bram_device::device_reset() void saturn_bram_device::nvram_default() { - static const UINT8 init[16] = + static const uint8_t init[16] = { 'B', 'a', 'c', 'k', 'U', 'p', 'R', 'a', 'm', ' ', 'F', 'o', 'r', 'm', 'a', 't' }; memset(&m_ext_bram[0], 0, m_ext_bram.size()); diff --git a/src/devices/bus/saturn/bram.h b/src/devices/bus/saturn/bram.h index e6237ff76ce..7a96d11706f 100644 --- a/src/devices/bus/saturn/bram.h +++ b/src/devices/bus/saturn/bram.h @@ -14,7 +14,7 @@ class saturn_bram_device : public device_t, { public: // construction/destruction - saturn_bram_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); + saturn_bram_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-level overrides virtual void device_start() override; @@ -34,28 +34,28 @@ class saturn_bram4mb_device : public saturn_bram_device { public: // construction/destruction - saturn_bram4mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_bram4mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class saturn_bram8mb_device : public saturn_bram_device { public: // construction/destruction - saturn_bram8mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_bram8mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class saturn_bram16mb_device : public saturn_bram_device { public: // construction/destruction - saturn_bram16mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_bram16mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class saturn_bram32mb_device : public saturn_bram_device { public: // construction/destruction - saturn_bram32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_bram32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/saturn/dram.cpp b/src/devices/bus/saturn/dram.cpp index d1078fcc722..c7b96edff91 100644 --- a/src/devices/bus/saturn/dram.cpp +++ b/src/devices/bus/saturn/dram.cpp @@ -19,19 +19,19 @@ const device_type SATURN_DRAM_8MB = &device_creator; const device_type SATURN_DRAM_32MB = &device_creator; -saturn_dram_device::saturn_dram_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) +saturn_dram_device::saturn_dram_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_sat_cart_interface( mconfig, *this ) { } -saturn_dram8mb_device::saturn_dram8mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saturn_dram8mb_device::saturn_dram8mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saturn_dram_device(mconfig, SATURN_DRAM_8MB, "Saturn Data RAM 8Mbit Cart", tag, owner, clock, "sat_dram_8mb", __FILE__) { m_cart_type = 0x5a; } -saturn_dram32mb_device::saturn_dram32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saturn_dram32mb_device::saturn_dram32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saturn_dram_device(mconfig, SATURN_DRAM_32MB, "Saturn Data RAM 32Mbit Cart", tag, owner, clock, "sat_dram_32mb", __FILE__) { m_cart_type = 0x5c; diff --git a/src/devices/bus/saturn/dram.h b/src/devices/bus/saturn/dram.h index 29ddbfcbcdc..3cf89b50093 100644 --- a/src/devices/bus/saturn/dram.h +++ b/src/devices/bus/saturn/dram.h @@ -13,7 +13,7 @@ class saturn_dram_device : public device_t, { public: // construction/destruction - saturn_dram_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); + saturn_dram_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-level overrides virtual void device_start() override; @@ -30,14 +30,14 @@ class saturn_dram8mb_device : public saturn_dram_device { public: // construction/destruction - saturn_dram8mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_dram8mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class saturn_dram32mb_device : public saturn_dram_device { public: // construction/destruction - saturn_dram32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_dram32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/bus/saturn/rom.cpp b/src/devices/bus/saturn/rom.cpp index 7b8068735a1..3fbb441b6c6 100644 --- a/src/devices/bus/saturn/rom.cpp +++ b/src/devices/bus/saturn/rom.cpp @@ -18,13 +18,13 @@ const device_type SATURN_ROM = &device_creator; -saturn_rom_device::saturn_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +saturn_rom_device::saturn_rom_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_sat_cart_interface( mconfig, *this ) { } -saturn_rom_device::saturn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saturn_rom_device::saturn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_ROM, "Saturn ROM Carts", tag, owner, clock, "sat_rom", __FILE__), device_sat_cart_interface( mconfig, *this ) { diff --git a/src/devices/bus/saturn/rom.h b/src/devices/bus/saturn/rom.h index ffd80e272ee..8f377bf2164 100644 --- a/src/devices/bus/saturn/rom.h +++ b/src/devices/bus/saturn/rom.h @@ -13,8 +13,8 @@ class saturn_rom_device : public device_t, { public: // construction/destruction - saturn_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - saturn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_rom_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); + saturn_rom_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/devices/bus/saturn/sat_slot.cpp b/src/devices/bus/saturn/sat_slot.cpp index 56137e39634..49e708d7cad 100644 --- a/src/devices/bus/saturn/sat_slot.cpp +++ b/src/devices/bus/saturn/sat_slot.cpp @@ -56,11 +56,11 @@ device_sat_cart_interface::~device_sat_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_sat_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_sat_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { - m_rom = (UINT32 *)device().machine().memory().region_alloc(std::string(tag).append(SATSLOT_ROM_REGION_TAG).c_str(), size, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(SATSLOT_ROM_REGION_TAG).c_str(), size, 4, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } } @@ -70,7 +70,7 @@ void device_sat_cart_interface::rom_alloc(UINT32 size, const char *tag) // bram_alloc - alloc the space for the Backup RAM //------------------------------------------------- -void device_sat_cart_interface::bram_alloc(UINT32 size) +void device_sat_cart_interface::bram_alloc(uint32_t size) { m_ext_bram.resize(size); device().save_item(NAME(m_ext_bram)); @@ -81,15 +81,15 @@ void device_sat_cart_interface::bram_alloc(UINT32 size) // dram*_alloc - alloc the space for the DRAM //------------------------------------------------- -void device_sat_cart_interface::dram0_alloc(UINT32 size) +void device_sat_cart_interface::dram0_alloc(uint32_t size) { - m_ext_dram0.resize(size/sizeof(UINT32)); + m_ext_dram0.resize(size/sizeof(uint32_t)); device().save_item(NAME(m_ext_dram0)); } -void device_sat_cart_interface::dram1_alloc(UINT32 size) +void device_sat_cart_interface::dram1_alloc(uint32_t size) { - m_ext_dram1.resize(size/sizeof(UINT32)); + m_ext_dram1.resize(size/sizeof(uint32_t)); device().save_item(NAME(m_ext_dram1)); } @@ -101,7 +101,7 @@ void device_sat_cart_interface::dram1_alloc(UINT32 size) //------------------------------------------------- // sat_cart_slot_device - constructor //------------------------------------------------- -sat_cart_slot_device::sat_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sat_cart_slot_device::sat_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SATURN_CART_SLOT, "Saturn Cartridge Slot", tag, owner, clock, "sat_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_cart(nullptr) @@ -154,8 +154,8 @@ image_init_result sat_cart_slot_device::call_load() if (is_rom) { // from fullpath, only ROM carts - UINT32 len = (software_entry() != nullptr) ? get_software_region_length("rom") : length(); - UINT32 *ROM; + uint32_t len = (software_entry() != nullptr) ? get_software_region_length("rom") : length(); + uint32_t *ROM; m_cart->rom_alloc(len, tag()); ROM = m_cart->get_rom_base(); @@ -169,8 +169,8 @@ image_init_result sat_cart_slot_device::call_load() for (int i = 0; i < len/4; i ++) ROM[i] = BITSWAP32(ROM[i],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8,23,22,21,20,19,18,17,16,31,30,29,28,27,26,25,24); // { -// UINT8 tempa = ROM[i+0]; -// UINT8 tempb = ROM[i+1]; +// uint8_t tempa = ROM[i+0]; +// uint8_t tempb = ROM[i+1]; // ROM[i+1] = ROM[i+2]; // ROM[i+0] = ROM[i+3]; // ROM[i+3] = tempa; diff --git a/src/devices/bus/saturn/sat_slot.h b/src/devices/bus/saturn/sat_slot.h index 5aec2dfdd40..40cd5fd23e6 100644 --- a/src/devices/bus/saturn/sat_slot.h +++ b/src/devices/bus/saturn/sat_slot.h @@ -34,28 +34,28 @@ public: virtual int get_cart_type() { return m_cart_type; }; - void rom_alloc(UINT32 size, const char *tag); - void bram_alloc(UINT32 size); - void dram0_alloc(UINT32 size); - void dram1_alloc(UINT32 size); - UINT32* get_rom_base() { return m_rom; } - UINT32* get_ext_dram0_base() { return &m_ext_dram0[0]; } - UINT32* get_ext_dram1_base() { return &m_ext_dram1[0]; } - UINT8* get_ext_bram_base() { return &m_ext_bram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ext_dram0_size() { return m_ext_dram0.size()*sizeof(UINT32); } - UINT32 get_ext_dram1_size() { return m_ext_dram1.size()*sizeof(UINT32); } - UINT32 get_ext_bram_size() { return m_ext_bram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void bram_alloc(uint32_t size); + void dram0_alloc(uint32_t size); + void dram1_alloc(uint32_t size); + uint32_t* get_rom_base() { return m_rom; } + uint32_t* get_ext_dram0_base() { return &m_ext_dram0[0]; } + uint32_t* get_ext_dram1_base() { return &m_ext_dram1[0]; } + uint8_t* get_ext_bram_base() { return &m_ext_bram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ext_dram0_size() { return m_ext_dram0.size()*sizeof(uint32_t); } + uint32_t get_ext_dram1_size() { return m_ext_dram1.size()*sizeof(uint32_t); } + uint32_t get_ext_bram_size() { return m_ext_bram.size(); } protected: int m_cart_type; // internal state - UINT32 *m_rom; - UINT32 m_rom_size; - std::vector m_ext_dram0; - std::vector m_ext_dram1; - std::vector m_ext_bram; + uint32_t *m_rom; + uint32_t m_rom_size; + std::vector m_ext_dram0; + std::vector m_ext_dram1; + std::vector m_ext_bram; }; @@ -67,7 +67,7 @@ class sat_cart_slot_device : public device_t, { public: // construction/destruction - sat_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sat_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~sat_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/scsi/acb4070.cpp b/src/devices/bus/scsi/acb4070.cpp index 1503272b55c..695b9527842 100644 --- a/src/devices/bus/scsi/acb4070.cpp +++ b/src/devices/bus/scsi/acb4070.cpp @@ -10,7 +10,7 @@ // device type definition const device_type ACB4070 = &device_creator; -acb4070_device::acb4070_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +acb4070_device::acb4070_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scsihd_device(mconfig, ACB4070, "ACB4070", tag, owner, clock, "acb4070", __FILE__) { } @@ -48,7 +48,7 @@ void acb4070_device::ExecCommand() } } -void acb4070_device::WriteData( UINT8 *data, int dataLength ) +void acb4070_device::WriteData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { diff --git a/src/devices/bus/scsi/acb4070.h b/src/devices/bus/scsi/acb4070.h index ea9b1583c28..b983aad0477 100644 --- a/src/devices/bus/scsi/acb4070.h +++ b/src/devices/bus/scsi/acb4070.h @@ -11,33 +11,33 @@ class acb4070_device : public scsihd_device { public: // construction/destruction - acb4070_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + acb4070_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void ExecCommand() override; - virtual void WriteData( UINT8 *data, int dataLength ) override; + virtual void WriteData( uint8_t *data, int dataLength ) override; private: struct adaptec_sense_t { // parameter list - UINT8 reserved1[3]; - UINT8 length; + uint8_t reserved1[3]; + uint8_t length; // descriptor list - UINT8 density; - UINT8 reserved2[4]; - UINT8 block_size[3]; + uint8_t density; + uint8_t reserved2[4]; + uint8_t block_size[3]; // drive parameter list - UINT8 format_code; - UINT8 cylinder_count[2]; - UINT8 head_count; - UINT8 reduced_write[2]; - UINT8 write_precomp[2]; - UINT8 landing_zone; - UINT8 step_pulse_code; - UINT8 bit_flags; - UINT8 sectors_per_track; + uint8_t format_code; + uint8_t cylinder_count[2]; + uint8_t head_count; + uint8_t reduced_write[2]; + uint8_t write_precomp[2]; + uint8_t landing_zone; + uint8_t step_pulse_code; + uint8_t bit_flags; + uint8_t sectors_per_track; }; }; diff --git a/src/devices/bus/scsi/cdu76s.cpp b/src/devices/bus/scsi/cdu76s.cpp index bb6a70390ed..b9256135b87 100644 --- a/src/devices/bus/scsi/cdu76s.cpp +++ b/src/devices/bus/scsi/cdu76s.cpp @@ -15,7 +15,7 @@ void sony_cdu76s_device::ExecCommand() } } -void sony_cdu76s_device::ReadData( UINT8 *data, int dataLength ) +void sony_cdu76s_device::ReadData( uint8_t *data, int dataLength ) { switch ( command[0] ) { @@ -41,7 +41,7 @@ void sony_cdu76s_device::ReadData( UINT8 *data, int dataLength ) // device type definition const device_type CDU76S = &device_creator; -sony_cdu76s_device::sony_cdu76s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sony_cdu76s_device::sony_cdu76s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scsicd_device(mconfig, CDU76S, "Sony CDU-76S", tag, owner, clock, "cdu76s", __FILE__) { } diff --git a/src/devices/bus/scsi/cdu76s.h b/src/devices/bus/scsi/cdu76s.h index d10a23c1246..0449254b958 100644 --- a/src/devices/bus/scsi/cdu76s.h +++ b/src/devices/bus/scsi/cdu76s.h @@ -19,10 +19,10 @@ class sony_cdu76s_device : public scsicd_device { public: - sony_cdu76s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sony_cdu76s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void ExecCommand() override; - virtual void ReadData( UINT8 *data, int dataLength ) override; + virtual void ReadData( uint8_t *data, int dataLength ) override; }; // device type definition diff --git a/src/devices/bus/scsi/d9060hd.cpp b/src/devices/bus/scsi/d9060hd.cpp index 3d212582a39..4ea264030eb 100644 --- a/src/devices/bus/scsi/d9060hd.cpp +++ b/src/devices/bus/scsi/d9060hd.cpp @@ -10,7 +10,7 @@ // device type definition const device_type D9060HD = &device_creator; -d9060hd_device::d9060hd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +d9060hd_device::d9060hd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scsihd_device(mconfig, D9060HD, "D9060HD", tag, owner, clock, "d9060hd", __FILE__) { } diff --git a/src/devices/bus/scsi/d9060hd.h b/src/devices/bus/scsi/d9060hd.h index 2daed5e40af..979538a0b14 100644 --- a/src/devices/bus/scsi/d9060hd.h +++ b/src/devices/bus/scsi/d9060hd.h @@ -11,7 +11,7 @@ class d9060hd_device : public scsihd_device { public: // construction/destruction - d9060hd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + d9060hd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void ExecCommand() override; }; diff --git a/src/devices/bus/scsi/omti5100.cpp b/src/devices/bus/scsi/omti5100.cpp index de40a68c32c..614f48a11a2 100644 --- a/src/devices/bus/scsi/omti5100.cpp +++ b/src/devices/bus/scsi/omti5100.cpp @@ -23,7 +23,7 @@ const tiny_rom_entry *omti5100_device::device_rom_region() const } #endif -omti5100_device::omti5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +omti5100_device::omti5100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scsihd_device(mconfig, OMTI5100, "OMTI 5100", tag, owner, clock, "omti5100", __FILE__), m_image0(*this, "image0"), m_image1(*this, "image1") @@ -95,7 +95,7 @@ void omti5100_device::ExecCommand() int track = ((command[1]&0x1f)<<16 | command[2]<<8 | command[3]) / m_param[drive].sectors; if(((track % m_param[drive].heads) <= info->heads) && (track < (info->cylinders * m_param[drive].heads))) { - std::vector sector(info->sectorbytes); + std::vector sector(info->sectorbytes); memset(§or[0], 0xe5, info->sectorbytes); m_phase = SCSI_PHASE_STATUS; m_status_code = SCSI_STATUS_CODE_GOOD; @@ -119,7 +119,7 @@ void omti5100_device::ExecCommand() } } -void omti5100_device::ReadData( UINT8 *data, int dataLength ) +void omti5100_device::ReadData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { @@ -136,7 +136,7 @@ void omti5100_device::ReadData( UINT8 *data, int dataLength ) } } -void omti5100_device::WriteData( UINT8 *data, int dataLength ) +void omti5100_device::WriteData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { diff --git a/src/devices/bus/scsi/omti5100.h b/src/devices/bus/scsi/omti5100.h index 63ac7b8a4dc..6d13f0f9bad 100644 --- a/src/devices/bus/scsi/omti5100.h +++ b/src/devices/bus/scsi/omti5100.h @@ -11,14 +11,14 @@ class omti5100_device : public scsihd_device { public: - omti5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + omti5100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; //virtual const rom_entry *device_rom_region() const; virtual void ExecCommand() override; - virtual void ReadData( UINT8 *data, int dataLength ) override; - virtual void WriteData( UINT8 *data, int dataLength ) override; + virtual void ReadData( uint8_t *data, int dataLength ) override; + virtual void WriteData( uint8_t *data, int dataLength ) override; void device_start() override; private: diff --git a/src/devices/bus/scsi/pc9801_sasi.cpp b/src/devices/bus/scsi/pc9801_sasi.cpp index 619f9f074da..7fdbdd699c8 100644 --- a/src/devices/bus/scsi/pc9801_sasi.cpp +++ b/src/devices/bus/scsi/pc9801_sasi.cpp @@ -6,7 +6,7 @@ const device_type PC9801_SASI = &device_creator; -pc9801_sasi_device::pc9801_sasi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pc9801_sasi_device::pc9801_sasi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scsihd_device(mconfig, PC9801_SASI, "PC-9801 SASI Controller", tag, owner, clock, "pc9801_sasi", __FILE__) { } diff --git a/src/devices/bus/scsi/pc9801_sasi.h b/src/devices/bus/scsi/pc9801_sasi.h index b3e5816573d..1cbd9eb72af 100644 --- a/src/devices/bus/scsi/pc9801_sasi.h +++ b/src/devices/bus/scsi/pc9801_sasi.h @@ -9,7 +9,7 @@ class pc9801_sasi_device : public scsihd_device { public: // construction/destruction - pc9801_sasi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc9801_sasi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void ExecCommand() override; }; diff --git a/src/devices/bus/scsi/s1410.cpp b/src/devices/bus/scsi/s1410.cpp index b26b9b5aef7..d4d8ff84d29 100644 --- a/src/devices/bus/scsi/s1410.cpp +++ b/src/devices/bus/scsi/s1410.cpp @@ -192,7 +192,7 @@ machine_config_constructor s1410_device::device_mconfig_additions() const // s1410_device - constructor //------------------------------------------------- -s1410_device::s1410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s1410_device::s1410_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scsihd_device(mconfig, S1410, "Xebec S1410", tag, owner, clock, "s1410", __FILE__) { } @@ -256,7 +256,7 @@ void s1410_device::ExecCommand() if ((m_disk) && (m_blocks)) { - std::vector data(m_sector_bytes); + std::vector data(m_sector_bytes); memset(&data[0], 0xc6, m_sector_bytes); while (m_blocks > 0) @@ -314,7 +314,7 @@ void s1410_device::ExecCommand() } } -void s1410_device::WriteData( UINT8 *data, int dataLength ) +void s1410_device::WriteData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { @@ -333,9 +333,9 @@ void s1410_device::WriteData( UINT8 *data, int dataLength ) break; } - UINT16 tracks = ((data[0]<<8)+data[1]); - UINT8 heads = data[2]; - UINT32 capacity = tracks * heads * sectorsPerTrack * m_sector_bytes; + uint16_t tracks = ((data[0]<<8)+data[1]); + uint8_t heads = data[2]; + uint32_t capacity = tracks * heads * sectorsPerTrack * m_sector_bytes; logerror("S1410_CMD_INIT_DRIVE_PARAMS Tracks=%d, Heads=%d, Capacity=%d\n",tracks,heads,capacity); } @@ -347,7 +347,7 @@ void s1410_device::WriteData( UINT8 *data, int dataLength ) } } -void s1410_device::ReadData( UINT8 *data, int dataLength ) +void s1410_device::ReadData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { diff --git a/src/devices/bus/scsi/s1410.h b/src/devices/bus/scsi/s1410.h index c17d6e349ed..d76686529bf 100644 --- a/src/devices/bus/scsi/s1410.h +++ b/src/devices/bus/scsi/s1410.h @@ -17,15 +17,15 @@ class s1410_device : public scsihd_device { public: // construction/destruction - s1410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s1410_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; virtual machine_config_constructor device_mconfig_additions() const override; 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; }; diff --git a/src/devices/bus/scsi/sa1403d.cpp b/src/devices/bus/scsi/sa1403d.cpp index 1e8e3a512cf..21f086b4218 100644 --- a/src/devices/bus/scsi/sa1403d.cpp +++ b/src/devices/bus/scsi/sa1403d.cpp @@ -122,7 +122,7 @@ ioport_constructor sa1403d_device::device_input_ports() const // sa1403d_device - constructor //------------------------------------------------- -sa1403d_device::sa1403d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sa1403d_device::sa1403d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scsihd_device(mconfig, SA1403D, "Shugart SA1403D", tag, owner, clock, "sa1403d", __FILE__) { } @@ -137,7 +137,7 @@ void sa1403d_device::ExecCommand() } } -void sa1403d_device::WriteData( UINT8 *data, int dataLength ) +void sa1403d_device::WriteData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { diff --git a/src/devices/bus/scsi/sa1403d.h b/src/devices/bus/scsi/sa1403d.h index 3241b0aa782..3299527a8f8 100644 --- a/src/devices/bus/scsi/sa1403d.h +++ b/src/devices/bus/scsi/sa1403d.h @@ -18,7 +18,7 @@ class sa1403d_device : public scsihd_device { public: // construction/destruction - sa1403d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sa1403d_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; @@ -26,7 +26,7 @@ public: virtual ioport_constructor device_input_ports() const override; virtual void ExecCommand() override; - virtual void WriteData( UINT8 *data, int dataLength ) override; + virtual void WriteData( uint8_t *data, int dataLength ) override; }; diff --git a/src/devices/bus/scsi/scsi.cpp b/src/devices/bus/scsi/scsi.cpp index 118e2d58114..3df52a5d53d 100644 --- a/src/devices/bus/scsi/scsi.cpp +++ b/src/devices/bus/scsi/scsi.cpp @@ -3,7 +3,7 @@ #include "scsi.h" -SCSI_PORT_DEVICE::SCSI_PORT_DEVICE(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +SCSI_PORT_DEVICE::SCSI_PORT_DEVICE(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SCSI_PORT, "SCSI Port", tag, owner, clock, "scsi", __FILE__), m_bsy_handler(*this), m_sel_handler(*this), @@ -666,7 +666,7 @@ WRITE_LINE_MEMBER( SCSI_PORT_DEVICE::write_data7 ) const device_type SCSI_PORT = &device_creator; -SCSI_PORT_SLOT_device::SCSI_PORT_SLOT_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +SCSI_PORT_SLOT_device::SCSI_PORT_SLOT_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SCSI_PORT_SLOT, "SCSI Connector", tag, owner, clock, "scsi_slot", __FILE__), device_slot_interface(mconfig, *this), m_dev(nullptr), diff --git a/src/devices/bus/scsi/scsi.h b/src/devices/bus/scsi/scsi.h index 19fec347f53..81dfea08959 100644 --- a/src/devices/bus/scsi/scsi.h +++ b/src/devices/bus/scsi/scsi.h @@ -99,7 +99,7 @@ class SCSI_PORT_DEVICE : public device_t public: // construction/destruction - SCSI_PORT_DEVICE(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + SCSI_PORT_DEVICE(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_bsy_handler(device_t &device, _Object object) { return downcast(device).m_bsy_handler.set_callback(object); } template static devcb_base &set_sel_handler(device_t &device, _Object object) { return downcast(device).m_sel_handler.set_callback(object); } @@ -229,7 +229,7 @@ class SCSI_PORT_SLOT_device : public device_t, friend class scsi_port_interface; public: - SCSI_PORT_SLOT_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + SCSI_PORT_SLOT_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); scsi_port_interface *dev() { return m_dev; } SCSI_PORT_DEVICE *port() { return m_port; } diff --git a/src/devices/bus/scsi/scsicd.cpp b/src/devices/bus/scsi/scsicd.cpp index 9ee7d92668f..2f0cccef1e5 100644 --- a/src/devices/bus/scsi/scsicd.cpp +++ b/src/devices/bus/scsi/scsicd.cpp @@ -11,12 +11,12 @@ // device type definition const device_type SCSICD = &device_creator; -scsicd_device::scsicd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +scsicd_device::scsicd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scsihle_device(mconfig, SCSICD, "SCSI CD", tag, owner, clock, "scsicd", __FILE__) { } -scsicd_device::scsicd_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) : +scsicd_device::scsicd_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) : scsihle_device(mconfig, type, name, tag, owner, clock, shortname, source) { } diff --git a/src/devices/bus/scsi/scsicd.h b/src/devices/bus/scsi/scsicd.h index 3acfffe2ad6..c7c2f377e50 100644 --- a/src/devices/bus/scsi/scsicd.h +++ b/src/devices/bus/scsi/scsicd.h @@ -17,8 +17,8 @@ class scsicd_device : public scsihle_device, { public: // construction/destruction - scsicd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - scsicd_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); + scsicd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + scsicd_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 machine_config_constructor device_mconfig_additions() const override; protected: diff --git a/src/devices/bus/scsi/scsihd.cpp b/src/devices/bus/scsi/scsihd.cpp index 8774310d0b3..a822327ca92 100644 --- a/src/devices/bus/scsi/scsihd.cpp +++ b/src/devices/bus/scsi/scsihd.cpp @@ -11,12 +11,12 @@ // device type definition const device_type SCSIHD = &device_creator; -scsihd_device::scsihd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scsihd_device::scsihd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scsihle_device(mconfig, SCSIHD, "SCSI HD", tag, owner, clock, "scsihd", __FILE__) { } -scsihd_device::scsihd_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) : +scsihd_device::scsihd_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) : scsihle_device(mconfig, type, name, tag, owner, clock, shortname, source) { } diff --git a/src/devices/bus/scsi/scsihd.h b/src/devices/bus/scsi/scsihd.h index 41b535a15b1..1a312a79216 100644 --- a/src/devices/bus/scsi/scsihd.h +++ b/src/devices/bus/scsi/scsihd.h @@ -17,8 +17,8 @@ class scsihd_device : public scsihle_device, { public: // construction/destruction - scsihd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - scsihd_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); + scsihd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + scsihd_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 machine_config_constructor device_mconfig_additions() const override; protected: diff --git a/src/devices/bus/scsi/scsihle.cpp b/src/devices/bus/scsi/scsihle.cpp index e14d875881f..96c89506444 100644 --- a/src/devices/bus/scsi/scsihle.cpp +++ b/src/devices/bus/scsi/scsihle.cpp @@ -10,7 +10,7 @@ Base class for HLE'd SCSI devices. #include "scsihle.h" -scsihle_device::scsihle_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) : +scsihle_device::scsihle_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), scsi_port_interface(mconfig, *this), m_scsi_id(*this, "SCSI_ID"), @@ -131,7 +131,7 @@ static const char *const phasenames[] = #define LOG(level, ...) if(LOGLEVEL>=level) logerror(__VA_ARGS__) -void scsihle_device::data_out(UINT8 data) +void scsihle_device::data_out(uint8_t data) { // printf( "%s data out %02x\n", tag(), data ); output_data0(BIT(data, 0)); @@ -144,12 +144,12 @@ void scsihle_device::data_out(UINT8 data) output_data7(BIT(data, 7)); } -void scsihle_device::scsi_out_req_delay(UINT8 state) +void scsihle_device::scsi_out_req_delay(uint8_t state) { req_timer->adjust(attotime::from_nsec(REQ_DELAY_NS),state); } -void scsihle_device::dump_bytes(UINT8 *buff, int count) +void scsihle_device::dump_bytes(uint8_t *buff, int count) { int byteno; @@ -317,7 +317,7 @@ void scsihle_device::scsibus_exec_command() scsibus_read_data(); } -UINT8 scsihle_device::scsibus_driveno(UINT8 drivesel) +uint8_t scsihle_device::scsibus_driveno(uint8_t drivesel) { switch (drivesel) { @@ -333,7 +333,7 @@ UINT8 scsihle_device::scsibus_driveno(UINT8 drivesel) } } -void scsihle_device::scsi_change_phase(UINT8 newphase) +void scsihle_device::scsi_change_phase(uint8_t newphase) { LOG(1,"scsi_change_phase() from=%s, to=%s\n",phasenames[m_phase],phasenames[newphase]); diff --git a/src/devices/bus/scsi/scsihle.h b/src/devices/bus/scsi/scsihle.h index 4963210726c..72537d3b3b0 100644 --- a/src/devices/bus/scsi/scsihle.h +++ b/src/devices/bus/scsi/scsihle.h @@ -22,7 +22,7 @@ class scsihle_device : public device_t, { public: // construction/destruction - scsihle_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); + scsihle_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 int GetDeviceID(); // hack for legacy_scsi_host_adapter::get_device @@ -47,32 +47,32 @@ protected: private: required_ioport m_scsi_id; - void data_out(UINT8 data); - void scsi_out_req_delay(UINT8 state); - void scsi_change_phase(UINT8 newphase); + void data_out(uint8_t data); + void scsi_out_req_delay(uint8_t state); + void scsi_change_phase(uint8_t newphase); int get_scsi_cmd_len(int cbyte); - UINT8 scsibus_driveno(UINT8 drivesel); + uint8_t scsibus_driveno(uint8_t drivesel); void scsibus_read_data(); void scsibus_write_data(); void scsibus_exec_command(); void dump_command_bytes(); void dump_data_bytes(int count); - void dump_bytes(UINT8 *buff, int count); + void dump_bytes(uint8_t *buff, int count); emu_timer *req_timer; emu_timer *sel_timer; emu_timer *dataout_timer; - UINT8 cmd_idx; - UINT8 is_linked; + uint8_t cmd_idx; + uint8_t is_linked; - UINT8 buffer[ 1024 ]; - UINT16 data_idx; + uint8_t buffer[ 1024 ]; + uint16_t data_idx; int bytes_left; int data_last; int scsiID; - UINT8 m_input_data; + uint8_t m_input_data; }; extern const input_device_default DEVICE_INPUT_DEFAULTS_NAME(SCSI_ID_0)[]; diff --git a/src/devices/bus/scv/rom.cpp b/src/devices/bus/scv/rom.cpp index 27487e8cc73..ccf05a85d94 100644 --- a/src/devices/bus/scv/rom.cpp +++ b/src/devices/bus/scv/rom.cpp @@ -26,44 +26,44 @@ const device_type SCV_ROM128K = &device_creator; const device_type SCV_ROM128K_RAM4K = &device_creator; -scv_rom8_device::scv_rom8_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) +scv_rom8_device::scv_rom8_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_scv_cart_interface( mconfig, *this ) { } -scv_rom8_device::scv_rom8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scv_rom8_device::scv_rom8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SCV_ROM8K, "SCV 8K Carts", tag, owner, clock, "scv_rom8", __FILE__), device_scv_cart_interface( mconfig, *this ) { } -scv_rom16_device::scv_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scv_rom16_device::scv_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scv_rom8_device(mconfig, SCV_ROM16K, "SCV 16K Carts", tag, owner, clock, "scv_rom16", __FILE__) { } -scv_rom32_device::scv_rom32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scv_rom32_device::scv_rom32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scv_rom8_device(mconfig, SCV_ROM32K, "SCV 32K Carts", tag, owner, clock, "scv_rom32", __FILE__) { } -scv_rom32ram8_device::scv_rom32ram8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scv_rom32ram8_device::scv_rom32ram8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scv_rom8_device(mconfig, SCV_ROM32K_RAM8K, "SCV 32K + RAM 8K Carts", tag, owner, clock, "scv_rom32_ram8", __FILE__), m_ram_enabled(0) { } -scv_rom64_device::scv_rom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scv_rom64_device::scv_rom64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scv_rom8_device(mconfig, SCV_ROM16K, "SCV 64K Carts", tag, owner, clock, "scv_rom64", __FILE__), m_bank_base(0) { } -scv_rom128_device::scv_rom128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scv_rom128_device::scv_rom128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scv_rom8_device(mconfig, SCV_ROM32K, "SCV 128K Carts", tag, owner, clock, "scv_rom128", __FILE__), m_bank_base(0) { } -scv_rom128ram4_device::scv_rom128ram4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scv_rom128ram4_device::scv_rom128ram4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scv_rom8_device(mconfig, SCV_ROM128K_RAM4K, "SCV 128K + RAM 4K Carts", tag, owner, clock, "scv_rom128_ram4", __FILE__), m_bank_base(0), m_ram_enabled(0) { } diff --git a/src/devices/bus/scv/rom.h b/src/devices/bus/scv/rom.h index 381a82fb7cf..40a56ec5ce0 100644 --- a/src/devices/bus/scv/rom.h +++ b/src/devices/bus/scv/rom.h @@ -13,8 +13,8 @@ class scv_rom8_device : public device_t, { public: // construction/destruction - scv_rom8_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); - scv_rom8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scv_rom8_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); + scv_rom8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -30,7 +30,7 @@ class scv_rom16_device : public scv_rom8_device { public: // construction/destruction - scv_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scv_rom16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -43,7 +43,7 @@ class scv_rom32_device : public scv_rom8_device { public: // construction/destruction - scv_rom32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scv_rom32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -56,7 +56,7 @@ class scv_rom32ram8_device : public scv_rom8_device { public: // construction/destruction - scv_rom32ram8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scv_rom32ram8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -68,7 +68,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_bank) override; private: - UINT8 m_ram_enabled; + uint8_t m_ram_enabled; }; @@ -78,7 +78,7 @@ class scv_rom64_device : public scv_rom8_device { public: // construction/destruction - scv_rom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scv_rom64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -89,7 +89,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_bank) override; private: - UINT8 m_bank_base; + uint8_t m_bank_base; }; @@ -99,7 +99,7 @@ class scv_rom128_device : public scv_rom8_device { public: // construction/destruction - scv_rom128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scv_rom128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -110,7 +110,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_bank) override; private: - UINT8 m_bank_base; + uint8_t m_bank_base; }; @@ -120,7 +120,7 @@ class scv_rom128ram4_device : public scv_rom8_device { public: // construction/destruction - scv_rom128ram4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scv_rom128ram4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -132,7 +132,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_bank) override; private: - UINT8 m_bank_base, m_ram_enabled; + uint8_t m_bank_base, m_ram_enabled; }; diff --git a/src/devices/bus/scv/slot.cpp b/src/devices/bus/scv/slot.cpp index d0554c44584..799f4adc78a 100644 --- a/src/devices/bus/scv/slot.cpp +++ b/src/devices/bus/scv/slot.cpp @@ -45,7 +45,7 @@ device_scv_cart_interface::~device_scv_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_scv_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_scv_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -59,7 +59,7 @@ void device_scv_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_scv_cart_interface::ram_alloc(UINT32 size) +void device_scv_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -72,7 +72,7 @@ void device_scv_cart_interface::ram_alloc(UINT32 size) //------------------------------------------------- // scv_cart_slot_device - constructor //------------------------------------------------- -scv_cart_slot_device::scv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +scv_cart_slot_device::scv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SCV_CART_SLOT, "SCV Cartridge Slot", tag, owner, clock, "scv_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -164,8 +164,8 @@ image_init_result scv_cart_slot_device::call_load() { if (m_cart) { - UINT8 *ROM; - UINT32 len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint8_t *ROM; + uint32_t len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); bool has_ram = (software_entry() != nullptr) && get_software_region("ram"); if (len > 0x20000) @@ -215,7 +215,7 @@ image_init_result scv_cart_slot_device::call_load() fullpath -------------------------------------------------*/ -int scv_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) +int scv_cart_slot_device::get_cart_type(uint8_t *ROM, uint32_t len) { int type = SCV_8K; @@ -252,8 +252,8 @@ std::string scv_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 len = m_file->size(); - std::vector rom(len); + uint32_t len = m_file->size(); + std::vector rom(len); int type; m_file->read(&rom[0], len); diff --git a/src/devices/bus/scv/slot.h b/src/devices/bus/scv/slot.h index d6168ebed81..c39f929a634 100644 --- a/src/devices/bus/scv/slot.h +++ b/src/devices/bus/scv/slot.h @@ -38,20 +38,20 @@ public: virtual DECLARE_WRITE8_MEMBER(write_cart) {} virtual DECLARE_WRITE8_MEMBER(write_bank) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } void save_ram() { device().save_item(NAME(m_ram)); } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; }; @@ -63,7 +63,7 @@ class scv_cart_slot_device : public device_t, { public: // construction/destruction - scv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scv_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~scv_cart_slot_device(); // device-level overrides @@ -76,7 +76,7 @@ public: virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } - int get_cart_type(UINT8 *ROM, UINT32 len); + int get_cart_type(uint8_t *ROM, uint32_t len); void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); } diff --git a/src/devices/bus/sega8/ccatch.cpp b/src/devices/bus/sega8/ccatch.cpp index 5ec9295fdba..7c3c198adba 100644 --- a/src/devices/bus/sega8/ccatch.cpp +++ b/src/devices/bus/sega8/ccatch.cpp @@ -23,7 +23,7 @@ const device_type SEGA8_ROM_CARDCATCH = &device_creator; -sega8_cardcatch_device::sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_cardcatch_device::sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_CARDCATCH, "SG-1000 Card Catcher Cart", tag, owner, clock, "sega8_ccatch", __FILE__), m_card(*this, "cardslot") { diff --git a/src/devices/bus/sega8/ccatch.h b/src/devices/bus/sega8/ccatch.h index 959376173c5..138f39dba9b 100644 --- a/src/devices/bus/sega8/ccatch.h +++ b/src/devices/bus/sega8/ccatch.h @@ -12,7 +12,7 @@ class sega8_cardcatch_device : public sega8_rom_device { public: // construction/destruction - sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; diff --git a/src/devices/bus/sega8/mgear.cpp b/src/devices/bus/sega8/mgear.cpp index e715d0b1652..bb40fa73bd7 100644 --- a/src/devices/bus/sega8/mgear.cpp +++ b/src/devices/bus/sega8/mgear.cpp @@ -23,7 +23,7 @@ const device_type SEGA8_ROM_MGEAR = &device_creator; -sega8_mgear_device::sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_mgear_device::sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_MGEAR, "Master Gear Converter", tag, owner, clock, "sega8_mgear", __FILE__), m_subslot(*this, "subslot") { diff --git a/src/devices/bus/sega8/mgear.h b/src/devices/bus/sega8/mgear.h index 960545c7350..0544fd74741 100644 --- a/src/devices/bus/sega8/mgear.h +++ b/src/devices/bus/sega8/mgear.h @@ -13,7 +13,7 @@ class sega8_mgear_device : public sega8_rom_device { public: // construction/destruction - sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_mgear_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/devices/bus/sega8/rom.cpp b/src/devices/bus/sega8/rom.cpp index b9c35af15f9..096369826b2 100644 --- a/src/devices/bus/sega8/rom.cpp +++ b/src/devices/bus/sega8/rom.cpp @@ -43,13 +43,13 @@ const device_type SEGA8_ROM_KOREAN_NB = &device_creator; -sega8_rom_device::sega8_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +sega8_rom_device::sega8_rom_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_sega8_cart_interface( mconfig, *this ), m_ram_base(0), m_ram_enabled(0) { } -sega8_rom_device::sega8_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_rom_device::sega8_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA8_ROM_STD, "Mark III, SMS & GG Carts", tag, owner, clock, "sega8_rom", __FILE__), device_sega8_cart_interface( mconfig, *this ), m_ram_base(0), m_ram_enabled(0) { @@ -58,31 +58,31 @@ sega8_rom_device::sega8_rom_device(const machine_config &mconfig, const char *ta -sega8_othello_device::sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_othello_device::sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_OTHELLO, "SG-1000 Othello Cart", tag, owner, clock, "sega8_othello", __FILE__) { } -sega8_castle_device::sega8_castle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_castle_device::sega8_castle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_CASTLE, "SG-1000 The Castle Cart", tag, owner, clock, "sega8_castle", __FILE__) { } -sega8_basic_l3_device::sega8_basic_l3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_basic_l3_device::sega8_basic_l3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_BASIC_L3, "SC-3000 BASIC Level III Cart", tag, owner, clock, "sega8_basicl3", __FILE__) { } -sega8_music_editor_device::sega8_music_editor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_music_editor_device::sega8_music_editor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_MUSIC_EDITOR, "SC-3000 Music Editor Cart", tag, owner, clock, "sega8_music", __FILE__) { } -sega8_terebi_device::sega8_terebi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_terebi_device::sega8_terebi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_TEREBI, "SG-1000 Terebi Oekaki Cart", tag, owner, clock, "sega8_terebi", __FILE__), m_tvdraw_x(*this, "TVDRAW_X"), m_tvdraw_y(*this, "TVDRAW_Y"), @@ -91,13 +91,13 @@ sega8_terebi_device::sega8_terebi_device(const machine_config &mconfig, const ch } -sega8_dahjee_typea_device::sega8_dahjee_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_dahjee_typea_device::sega8_dahjee_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_DAHJEE_TYPEA, "SG-1000 Dahjee RAM expansion + Cart (Type A)", tag, owner, clock, "sega8_dahjeea", __FILE__) { } -sega8_dahjee_typeb_device::sega8_dahjee_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_dahjee_typeb_device::sega8_dahjee_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_DAHJEE_TYPEB, "SG-1000 Dahjee RAM expansion + Cart (Type B)", tag, owner, clock, "sega8_dahjeeb", __FILE__) { } @@ -105,7 +105,7 @@ sega8_dahjee_typeb_device::sega8_dahjee_typeb_device(const machine_config &mconf -sega8_eeprom_device::sega8_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_eeprom_device::sega8_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA8_ROM_EEPROM, "GG Carts + EEPROM", tag, owner, clock, "sega8_eeprom", __FILE__), device_sega8_cart_interface( mconfig, *this ), m_eeprom(*this, "eeprom"), m_93c46_enabled(0), m_93c46_lines(0) @@ -113,58 +113,58 @@ sega8_eeprom_device::sega8_eeprom_device(const machine_config &mconfig, const ch } -sega8_codemasters_device::sega8_codemasters_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_codemasters_device::sega8_codemasters_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA8_ROM_CODEMASTERS, "Mark III, SMS & GG Codemasters Carts", tag, owner, clock, "sega8_codemasters", __FILE__), device_sega8_cart_interface( mconfig, *this ), m_ram_base(0), m_ram_enabled(0) { } -sega8_4pak_device::sega8_4pak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_4pak_device::sega8_4pak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_4PAK, "SMS 4-Pak Cart", tag, owner, clock, "sega8_4pak", __FILE__) { } -sega8_zemina_device::sega8_zemina_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) +sega8_zemina_device::sega8_zemina_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_sega8_cart_interface( mconfig, *this ), m_ram_base(0), m_ram_enabled(0) { } -sega8_zemina_device::sega8_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_zemina_device::sega8_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA8_ROM_ZEMINA, "SMS Zemina Carts", tag, owner, clock, "sega8_zemina", __FILE__), device_sega8_cart_interface( mconfig, *this ), m_ram_base(0), m_ram_enabled(0) { } -sega8_nemesis_device::sega8_nemesis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_nemesis_device::sega8_nemesis_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_zemina_device(mconfig, SEGA8_ROM_NEMESIS, "SMS Nemesis Cart", tag, owner, clock, "sega8_nemesis", __FILE__) { } -sega8_janggun_device::sega8_janggun_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_janggun_device::sega8_janggun_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA8_ROM_JANGGUN, "SMS Janggun Cart", tag, owner, clock, "sega8_janggun", __FILE__), device_sega8_cart_interface( mconfig, *this ) { } -sega8_hicom_device::sega8_hicom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_hicom_device::sega8_hicom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_HICOM, "SMS Hi-Com Carts", tag, owner, clock, "sega8_hicom", __FILE__), m_rom_bank_base(0) { } -sega8_korean_device::sega8_korean_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_korean_device::sega8_korean_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_KOREAN, "SMS Korean Carts", tag, owner, clock, "sega8_korean", __FILE__) { } -sega8_korean_nb_device::sega8_korean_nb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega8_korean_nb_device::sega8_korean_nb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_rom_device(mconfig, SEGA8_ROM_KOREAN_NB, "SMS Korean No-Bank Mapper Carts", tag, owner, clock, "sega8_korean_nb", __FILE__) { } @@ -653,7 +653,7 @@ READ8_MEMBER(sega8_eeprom_device::read_cart) if (offset == 0x8000 && m_93c46_enabled) { - UINT8 value = (m_93c46_lines & 0xfc) | 0x02; + uint8_t value = (m_93c46_lines & 0xfc) | 0x02; value |= m_eeprom->do_read() ? 1 : 0; return value; } diff --git a/src/devices/bus/sega8/rom.h b/src/devices/bus/sega8/rom.h index 462ea7d8e28..ef3448a8428 100644 --- a/src/devices/bus/sega8/rom.h +++ b/src/devices/bus/sega8/rom.h @@ -13,8 +13,8 @@ class sega8_rom_device : public device_t, { public: // construction/destruction - sega8_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - sega8_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_rom_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); + sega8_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -28,8 +28,8 @@ public: virtual DECLARE_WRITE8_MEMBER(write_mapper) override; protected: - UINT8 m_rom_bank_base[3]; - UINT8 m_ram_base; + uint8_t m_rom_bank_base[3]; + uint8_t m_ram_base; int m_ram_enabled; }; @@ -42,7 +42,7 @@ class sega8_othello_device : public sega8_rom_device { public: // construction/destruction - sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -57,7 +57,7 @@ class sega8_castle_device : public sega8_rom_device { public: // construction/destruction - sega8_castle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_castle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -72,7 +72,7 @@ class sega8_basic_l3_device : public sega8_rom_device { public: // construction/destruction - sega8_basic_l3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_basic_l3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -91,7 +91,7 @@ class sega8_music_editor_device : public sega8_rom_device { public: // construction/destruction - sega8_music_editor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_music_editor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -110,7 +110,7 @@ class sega8_terebi_device : public sega8_rom_device { public: // construction/destruction - sega8_terebi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_terebi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -127,7 +127,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_mapper) override {} protected: - UINT8 m_tvdraw_data; + uint8_t m_tvdraw_data; }; @@ -137,7 +137,7 @@ class sega8_dahjee_typea_device : public sega8_rom_device { public: // construction/destruction - sega8_dahjee_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_dahjee_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -156,7 +156,7 @@ class sega8_dahjee_typeb_device : public sega8_rom_device { public: // construction/destruction - sega8_dahjee_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_dahjee_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_cart) override; @@ -178,7 +178,7 @@ class sega8_eeprom_device : public device_t, { public: // construction/destruction - sega8_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -193,11 +193,11 @@ public: virtual DECLARE_WRITE8_MEMBER(write_mapper) override; protected: - UINT8 m_rom_bank_base[3]; + uint8_t m_rom_bank_base[3]; required_device m_eeprom; int m_93c46_enabled; - UINT8 m_93c46_lines; + uint8_t m_93c46_lines; }; @@ -208,7 +208,7 @@ class sega8_codemasters_device : public device_t, { public: // construction/destruction - sega8_codemasters_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_codemasters_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -222,8 +222,8 @@ public: // no mapper write for this! protected: - UINT8 m_rom_bank_base[3]; - UINT8 m_ram_base; + uint8_t m_rom_bank_base[3]; + uint8_t m_ram_base; int m_ram_enabled; }; @@ -234,7 +234,7 @@ class sega8_4pak_device : public sega8_rom_device { public: // construction/destruction - sega8_4pak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_4pak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -245,7 +245,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_cart) override; private: - UINT8 m_reg[3]; + uint8_t m_reg[3]; }; @@ -256,8 +256,8 @@ class sega8_zemina_device : public device_t, { public: // construction/destruction - sega8_zemina_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); - sega8_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_zemina_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); + sega8_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -271,8 +271,8 @@ public: // no mapper write for this! protected: - UINT8 m_rom_bank_base[6]; - UINT8 m_ram_base; + uint8_t m_rom_bank_base[6]; + uint8_t m_ram_base; int m_ram_enabled; }; @@ -283,7 +283,7 @@ class sega8_nemesis_device : public sega8_zemina_device { public: // construction/destruction - sega8_nemesis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_nemesis_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void late_bank_setup() override; }; @@ -296,7 +296,7 @@ class sega8_janggun_device : public device_t, { public: // construction/destruction - sega8_janggun_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_janggun_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { save_item(NAME(m_rom_bank_base)); } @@ -309,7 +309,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_mapper) override; protected: - UINT8 m_rom_bank_base[6]; + uint8_t m_rom_bank_base[6]; }; @@ -319,7 +319,7 @@ class sega8_hicom_device : public sega8_rom_device { public: // construction/destruction - sega8_hicom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_hicom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override { save_item(NAME(m_rom_bank_base)); } @@ -332,7 +332,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_mapper) override; protected: - UINT8 m_rom_bank_base; + uint8_t m_rom_bank_base; }; @@ -342,7 +342,7 @@ class sega8_korean_device : public sega8_rom_device { public: // construction/destruction - sega8_korean_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_korean_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void late_bank_setup() override; @@ -358,7 +358,7 @@ class sega8_korean_nb_device : public sega8_rom_device { public: // construction/destruction - sega8_korean_nb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_korean_nb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_WRITE8_MEMBER(write_mapper) override {} diff --git a/src/devices/bus/sega8/sega8_slot.cpp b/src/devices/bus/sega8/sega8_slot.cpp index 3cfb14b4981..41ae0e6cf17 100644 --- a/src/devices/bus/sega8/sega8_slot.cpp +++ b/src/devices/bus/sega8/sega8_slot.cpp @@ -74,7 +74,7 @@ device_sega8_cart_interface::~device_sega8_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_sega8_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_sega8_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -92,7 +92,7 @@ void device_sega8_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_sega8_cart_interface::ram_alloc(UINT32 size) +void device_sega8_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -107,7 +107,7 @@ void device_sega8_cart_interface::ram_alloc(UINT32 size) // sega8_cart_slot_device - constructor //------------------------------------------------- -sega8_cart_slot_device::sega8_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool is_card, const char *shortname, const char *source) : +sega8_cart_slot_device::sega8_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, bool is_card, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -119,7 +119,7 @@ sega8_cart_slot_device::sega8_cart_slot_device(const machine_config &mconfig, de m_is_card = is_card; } -sega8_cart_slot_device::sega8_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sega8_cart_slot_device::sega8_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA8_CART_SLOT, "Sega Master System / Game Gear / SG1000 Cartridge Slot", tag, owner, clock, "sega8_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -131,7 +131,7 @@ sega8_cart_slot_device::sega8_cart_slot_device(const machine_config &mconfig, co { } -sega8_card_slot_device::sega8_card_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sega8_card_slot_device::sega8_card_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega8_cart_slot_device(mconfig, SEGA8_CARD_SLOT, "Sega Master System / Game Gear / SG1000 Card Slot", tag, owner, clock, TRUE, "sega8_card_slot", __FILE__) { } @@ -213,7 +213,7 @@ static const char *sega8_get_slot(int type) call load -------------------------------------------------*/ -image_verify_result sega8_cart_slot_device::verify_cart( UINT8 *magic, int size ) +image_verify_result sega8_cart_slot_device::verify_cart( uint8_t *magic, int size ) { image_verify_result retval(image_verify_result::FAIL); @@ -227,9 +227,9 @@ image_verify_result sega8_cart_slot_device::verify_cart( UINT8 *magic, int size return retval; } -void sega8_cart_slot_device::set_lphaser_xoffset( UINT8 *rom, int size ) +void sega8_cart_slot_device::set_lphaser_xoffset( uint8_t *rom, int size ) { - static const UINT8 signatures[7][16] = + static const uint8_t signatures[7][16] = { /* Spacegun */ { 0x54, 0x4d, 0x52, 0x20, 0x53, 0x45, 0x47, 0x41, 0xff, 0xff, 0x9d, 0x99, 0x10, 0x90, 0x00, 0x40 }, @@ -335,9 +335,9 @@ image_init_result sega8_cart_slot_device::call_load() { if (m_cart) { - UINT32 len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); - UINT32 offset = 0; - UINT8 *ROM; + uint32_t len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t offset = 0; + uint8_t *ROM; if (m_is_card && len > 0x8000) { @@ -438,9 +438,9 @@ void sega8_cart_slot_device::call_unload() The Korean game Jang Pung II also seems to use a codemasters style mapper. */ -int sms_state::detect_codemasters_mapper( UINT8 *rom ) +int sms_state::detect_codemasters_mapper( uint8_t *rom ) { - static const UINT8 jang_pung2[16] = { 0x00, 0xba, 0x38, 0x0d, 0x00, 0xb8, 0x38, 0x0c, 0x00, 0xb6, 0x38, 0x0b, 0x00, 0xb4, 0x38, 0x0a }; + static const uint8_t jang_pung2[16] = { 0x00, 0xba, 0x38, 0x0d, 0x00, 0xb8, 0x38, 0x0c, 0x00, 0xb6, 0x38, 0x0b, 0x00, 0xb4, 0x38, 0x0a }; if (((rom[0x7fe0] & 0x0f ) <= 9) && (rom[0x7fe3] == 0x93 || rom[0x7fe3] == 0x94 || rom[0x7fe3] == 0x95) && rom[0x7fef] == 0x00) return 1; @@ -452,9 +452,9 @@ int sms_state::detect_codemasters_mapper( UINT8 *rom ) } -int sms_state::detect_korean_mapper( UINT8 *rom ) +int sms_state::detect_korean_mapper( uint8_t *rom ) { - static const UINT8 signatures[2][16] = + static const uint8_t signatures[2][16] = { { 0x3e, 0x11, 0x32, 0x00, 0xa0, 0x78, 0xcd, 0x84, 0x85, 0x3e, 0x02, 0x32, 0x00, 0xa0, 0xc9, 0xff }, /* Dodgeball King */ { 0x41, 0x48, 0x37, 0x37, 0x44, 0x37, 0x4e, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20 }, /* Sangokushi 3 */ @@ -472,7 +472,7 @@ int sms_state::detect_korean_mapper( UINT8 *rom ) } #endif -int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) +int sega8_cart_slot_device::get_cart_type(uint8_t *ROM, uint32_t len) { int type = SEGA8_BASE_ROM; @@ -484,7 +484,7 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) { if (ROM[i] == 0x32) // Z80 opcode for: LD (xxxx), A { - UINT16 addr = (ROM[i + 2] << 8) | ROM[i + 1]; + uint16_t addr = (ROM[i + 2] << 8) | ROM[i + 1]; if (addr == 0xffff) { i += 2; _ffff++; continue; } if (addr == 0x0002 || addr == 0x0003 || addr == 0x0004) @@ -533,7 +533,7 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) { if (ROM[i] == 0x32) { - UINT16 addr = ROM[i + 1] | (ROM[i + 2] << 8); + uint16_t addr = ROM[i + 1] | (ROM[i + 2] << 8); switch (addr & 0xf000) { @@ -597,8 +597,8 @@ std::string sega8_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 len = m_file->size(), offset = 0; - std::vector rom(len); + uint32_t len = m_file->size(), offset = 0; + std::vector rom(len); int type; m_file->read(&rom[0], len); @@ -668,7 +668,7 @@ WRITE8_MEMBER(sega8_cart_slot_device::write_ram) Internal header logging -------------------------------------------------*/ -void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UINT32 nvram_len) +void sega8_cart_slot_device::internal_header_logging(uint8_t *ROM, uint32_t len, uint32_t nvram_len) { static const char *const system_region[] = { @@ -711,9 +711,9 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN }; char reserved[10]; - UINT8 version, csum_size, region, serial[3]; - UINT16 checksum, csum = 0; - UINT32 csum_end; + uint8_t version, csum_size, region, serial[3]; + uint16_t checksum, csum = 0; + uint32_t csum_end; // LOG FILE DETAILS logerror("FILE DETAILS\n" ); @@ -773,7 +773,7 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN if (m_type == SEGA8_CODEMASTERS) { - UINT8 day, month, year, hour, minute; + uint8_t day, month, year, hour, minute; csum = 0; day = ROM[0x7fe1]; diff --git a/src/devices/bus/sega8/sega8_slot.h b/src/devices/bus/sega8/sega8_slot.h index 4d032e30b50..408f0aa9d87 100644 --- a/src/devices/bus/sega8/sega8_slot.h +++ b/src/devices/bus/sega8/sega8_slot.h @@ -55,8 +55,8 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_ram) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); virtual void late_bank_setup() {} @@ -69,18 +69,18 @@ public: int get_sms_mode() { return m_sms_mode; } //protected: - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } void save_ram() { device().save_item(NAME(m_ram)); } //private: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; int m_rom_page_count; bool has_battery; @@ -102,8 +102,8 @@ class sega8_cart_slot_device : public device_t, { public: // construction/destruction - sega8_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool is_card, const char *shortname, const char *source); - sega8_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, bool is_card, const char *shortname, const char *source); + sega8_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~sega8_cart_slot_device(); // device-level overrides @@ -116,12 +116,12 @@ public: virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_type() { return m_type; } - int get_cart_type(UINT8 *ROM, UINT32 len); + int get_cart_type(uint8_t *ROM, uint32_t len); void setup_ram(); - void internal_header_logging(UINT8 *ROM, UINT32 len, UINT32 nvram_len); - image_verify_result verify_cart(UINT8 *magic, int size); - void set_lphaser_xoffset(UINT8 *rom, int size); + void internal_header_logging(uint8_t *ROM, uint32_t len, uint32_t nvram_len); + image_verify_result verify_cart(uint8_t *magic, int size); + void set_lphaser_xoffset(uint8_t *rom, int size); void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); } @@ -163,7 +163,7 @@ class sega8_card_slot_device : public sega8_cart_slot_device { public: // construction/destruction - sega8_card_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega8_card_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_config_complete() override { update_names(SEGA8_CARD_SLOT, "card", "card"); } }; diff --git a/src/devices/bus/sg1000_exp/fm_unit.cpp b/src/devices/bus/sg1000_exp/fm_unit.cpp index 41142e95bbf..fdb380e79b2 100644 --- a/src/devices/bus/sg1000_exp/fm_unit.cpp +++ b/src/devices/bus/sg1000_exp/fm_unit.cpp @@ -72,7 +72,7 @@ machine_config_constructor sega_fm_unit_device::device_mconfig_additions() const // sega_fm_unit_device - constructor //------------------------------------------------- -sega_fm_unit_device::sega_fm_unit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sega_fm_unit_device::sega_fm_unit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_FM_UNIT, "Sega FM Sound Unit", tag, owner, clock, "sega_fm_unit", __FILE__), device_sg1000_expansion_slot_interface(mconfig, *this), m_ym(*this, "ym2413"), @@ -147,13 +147,13 @@ WRITE8_MEMBER(sega_fm_unit_device::peripheral_w) } -bool sega_fm_unit_device::is_readable(UINT8 offset) +bool sega_fm_unit_device::is_readable(uint8_t offset) { return (offset <= 3) ? true : false; } -bool sega_fm_unit_device::is_writeable(UINT8 offset) +bool sega_fm_unit_device::is_writeable(uint8_t offset) { return (offset <= 3) ? true : false; } diff --git a/src/devices/bus/sg1000_exp/fm_unit.h b/src/devices/bus/sg1000_exp/fm_unit.h index 9f71ff81190..b821b00c6fd 100644 --- a/src/devices/bus/sg1000_exp/fm_unit.h +++ b/src/devices/bus/sg1000_exp/fm_unit.h @@ -30,7 +30,7 @@ class sega_fm_unit_device : public device_t, { public: // construction/destruction - sega_fm_unit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_fm_unit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -40,13 +40,13 @@ protected: // device_sg1000_expansion_slot_interface overrides virtual DECLARE_READ8_MEMBER(peripheral_r) override; virtual DECLARE_WRITE8_MEMBER(peripheral_w) override; - virtual bool is_readable(UINT8 offset) override; - virtual bool is_writeable(UINT8 offset) override; + virtual bool is_readable(uint8_t offset) override; + virtual bool is_writeable(uint8_t offset) override; private: required_device m_ym; optional_device m_psg; - UINT8 m_audio_control; + uint8_t m_audio_control; }; diff --git a/src/devices/bus/sg1000_exp/sg1000exp.cpp b/src/devices/bus/sg1000_exp/sg1000exp.cpp index 0460efccbef..9560905de41 100644 --- a/src/devices/bus/sg1000_exp/sg1000exp.cpp +++ b/src/devices/bus/sg1000_exp/sg1000exp.cpp @@ -53,7 +53,7 @@ device_sg1000_expansion_slot_interface::~device_sg1000_expansion_slot_interface( // sg1000_expansion_slot_device - constructor //------------------------------------------------- -sg1000_expansion_slot_device::sg1000_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sg1000_expansion_slot_device::sg1000_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SG1000_EXPANSION_SLOT, "Sega SG-1000 expansion slot", tag, owner, clock, "sg1000_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) { @@ -85,7 +85,7 @@ void sg1000_expansion_slot_device::device_start() READ8_MEMBER(sg1000_expansion_slot_device::read) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_device) data = m_device->peripheral_r(space, offset & 0x07); return data; @@ -98,7 +98,7 @@ WRITE8_MEMBER(sg1000_expansion_slot_device::write) } -bool sg1000_expansion_slot_device::is_readable(UINT8 offset) +bool sg1000_expansion_slot_device::is_readable(uint8_t offset) { if (m_device) return m_device->is_readable(offset & 0x07); @@ -106,7 +106,7 @@ bool sg1000_expansion_slot_device::is_readable(UINT8 offset) } -bool sg1000_expansion_slot_device::is_writeable(UINT8 offset) +bool sg1000_expansion_slot_device::is_writeable(uint8_t offset) { if (m_device) return m_device->is_writeable(offset & 0x07); diff --git a/src/devices/bus/sg1000_exp/sg1000exp.h b/src/devices/bus/sg1000_exp/sg1000exp.h index 183ee9ea948..12cecb1bc89 100644 --- a/src/devices/bus/sg1000_exp/sg1000exp.h +++ b/src/devices/bus/sg1000_exp/sg1000exp.h @@ -43,13 +43,13 @@ class sg1000_expansion_slot_device : public device_t, { public: // construction/destruction - sg1000_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sg1000_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~sg1000_expansion_slot_device(); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); - bool is_readable(UINT8 offset); - bool is_writeable(UINT8 offset); + bool is_readable(uint8_t offset); + bool is_writeable(uint8_t offset); protected: // device-level overrides @@ -73,8 +73,8 @@ public: virtual DECLARE_READ8_MEMBER(peripheral_r) { return 0xff; }; virtual DECLARE_WRITE8_MEMBER(peripheral_w) { }; - virtual bool is_readable(UINT8 offset) { return true; }; - virtual bool is_writeable(UINT8 offset) { return true; }; + virtual bool is_readable(uint8_t offset) { return true; }; + virtual bool is_writeable(uint8_t offset) { return true; }; protected: sg1000_expansion_slot_device *m_port; diff --git a/src/devices/bus/sg1000_exp/sk1100.cpp b/src/devices/bus/sg1000_exp/sk1100.cpp index b6c2e037748..275a73b67b8 100644 --- a/src/devices/bus/sg1000_exp/sk1100.cpp +++ b/src/devices/bus/sg1000_exp/sk1100.cpp @@ -186,7 +186,7 @@ machine_config_constructor sega_sk1100_device::device_mconfig_additions() const // sega_sk1100_device - constructor //------------------------------------------------- -sega_sk1100_device::sega_sk1100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sega_sk1100_device::sega_sk1100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_SK1100, "Sega SK-1100 Keyboard", tag, owner, clock, "sega_sk1100", __FILE__), device_sg1000_expansion_slot_interface(mconfig, *this), m_cassette(*this, "cassette"), @@ -229,7 +229,7 @@ WRITE8_MEMBER(sega_sk1100_device::peripheral_w) } -bool sega_sk1100_device::is_readable(UINT8 offset) +bool sega_sk1100_device::is_readable(uint8_t offset) { return (m_keylatch != 0x07 ? true : false); } @@ -273,7 +273,7 @@ READ8_MEMBER( sega_sk1100_device::ppi_pb_r ) */ /* keyboard */ - UINT8 data = m_pb[m_keylatch]->read(); + uint8_t data = m_pb[m_keylatch]->read(); /* cartridge contact */ data |= 0x10; diff --git a/src/devices/bus/sg1000_exp/sk1100.h b/src/devices/bus/sg1000_exp/sk1100.h index 8ee058e9d5e..592ee0dd5b5 100644 --- a/src/devices/bus/sg1000_exp/sk1100.h +++ b/src/devices/bus/sg1000_exp/sk1100.h @@ -34,7 +34,7 @@ class sega_sk1100_device : public device_t, { public: // construction/destruction - sega_sk1100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_sk1100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -51,7 +51,7 @@ protected: // device_sg1000_expansion_slot_interface overrides virtual DECLARE_READ8_MEMBER(peripheral_r) override; virtual DECLARE_WRITE8_MEMBER(peripheral_w) override; - virtual bool is_readable(UINT8 offset) override; + virtual bool is_readable(uint8_t offset) override; private: required_device m_cassette; @@ -60,7 +60,7 @@ private: required_ioport_array<8> m_pb; /* keyboard state */ - UINT8 m_keylatch; + uint8_t m_keylatch; }; diff --git a/src/devices/bus/sms_ctrl/graphic.cpp b/src/devices/bus/sms_ctrl/graphic.cpp index 31d211e30a8..9cff60be1ac 100644 --- a/src/devices/bus/sms_ctrl/graphic.cpp +++ b/src/devices/bus/sms_ctrl/graphic.cpp @@ -75,7 +75,7 @@ ioport_constructor sms_graphic_device::device_input_ports() const // sms_graphic_device - constructor //------------------------------------------------- -sms_graphic_device::sms_graphic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sms_graphic_device::sms_graphic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_GRAPHIC, "Sega SMS Graphic Board", tag, owner, clock, "sms_graphic", __FILE__) , device_sms_control_port_interface(mconfig, *this) , m_buttons(*this, "BUTTONS") @@ -103,7 +103,7 @@ void sms_graphic_device::device_start() // sms_peripheral_r - joypad read //------------------------------------------------- -UINT8 sms_graphic_device::peripheral_r() +uint8_t sms_graphic_device::peripheral_r() { switch (m_index) { @@ -138,7 +138,7 @@ UINT8 sms_graphic_device::peripheral_r() return 0xff; } -void sms_graphic_device::peripheral_w(UINT8 data) +void sms_graphic_device::peripheral_w(uint8_t data) { // Check for toggle on TH/TL if ((data ^ m_previous_write) & 0xc0) diff --git a/src/devices/bus/sms_ctrl/graphic.h b/src/devices/bus/sms_ctrl/graphic.h index 82d624c07b5..b6c364d4984 100644 --- a/src/devices/bus/sms_ctrl/graphic.h +++ b/src/devices/bus/sms_ctrl/graphic.h @@ -28,7 +28,7 @@ class sms_graphic_device : public device_t, { public: // construction/destruction - sms_graphic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_graphic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -38,8 +38,8 @@ protected: virtual void device_start() override; // device_sms_control_port_interface overrides - virtual UINT8 peripheral_r() override; - virtual void peripheral_w(UINT8 data) override; + virtual uint8_t peripheral_r() override; + virtual void peripheral_w(uint8_t data) override; private: required_ioport m_buttons; @@ -47,8 +47,8 @@ private: required_ioport m_y; int m_index; - UINT8 m_previous_write; - UINT8 m_pressure; + uint8_t m_previous_write; + uint8_t m_pressure; }; diff --git a/src/devices/bus/sms_ctrl/joypad.cpp b/src/devices/bus/sms_ctrl/joypad.cpp index 99ca264cec4..e750e2435ab 100644 --- a/src/devices/bus/sms_ctrl/joypad.cpp +++ b/src/devices/bus/sms_ctrl/joypad.cpp @@ -64,7 +64,7 @@ ioport_constructor sms_joypad_device::device_input_ports() const // sms_joypad_device - constructor //------------------------------------------------- -sms_joypad_device::sms_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sms_joypad_device::sms_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_JOYPAD, "Sega SMS Control Pad", tag, owner, clock, "sms_joypad", __FILE__), device_sms_control_port_interface(mconfig, *this), m_joypad(*this, "JOYPAD") @@ -85,7 +85,7 @@ void sms_joypad_device::device_start() // sms_peripheral_r - joypad read //------------------------------------------------- -UINT8 sms_joypad_device::peripheral_r() +uint8_t sms_joypad_device::peripheral_r() { return m_joypad->read(); } diff --git a/src/devices/bus/sms_ctrl/joypad.h b/src/devices/bus/sms_ctrl/joypad.h index d8028bef6c3..56e076a6819 100644 --- a/src/devices/bus/sms_ctrl/joypad.h +++ b/src/devices/bus/sms_ctrl/joypad.h @@ -28,7 +28,7 @@ class sms_joypad_device : public device_t, { public: // construction/destruction - sms_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -38,7 +38,7 @@ protected: virtual void device_start() override; // device_sms_control_port_interface overrides - virtual UINT8 peripheral_r() override; + virtual uint8_t peripheral_r() override; private: required_ioport m_joypad; diff --git a/src/devices/bus/sms_ctrl/lphaser.cpp b/src/devices/bus/sms_ctrl/lphaser.cpp index 474b8100d76..3ba680032dc 100644 --- a/src/devices/bus/sms_ctrl/lphaser.cpp +++ b/src/devices/bus/sms_ctrl/lphaser.cpp @@ -80,7 +80,7 @@ ioport_constructor sms_light_phaser_device::device_input_ports() const // sms_light_phaser_device - constructor //------------------------------------------------- -sms_light_phaser_device::sms_light_phaser_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sms_light_phaser_device::sms_light_phaser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_LIGHT_PHASER, "Sega SMS Light Phaser", tag, owner, clock, "sms_light_phaser", __FILE__), device_video_interface(mconfig, *this), device_sms_control_port_interface(mconfig, *this), @@ -115,7 +115,7 @@ void sms_light_phaser_device::device_reset() // sms_peripheral_r - light phaser read //------------------------------------------------- -UINT8 sms_light_phaser_device::peripheral_r() +uint8_t sms_light_phaser_device::peripheral_r() { return m_lphaser_pins->read(); } @@ -187,8 +187,8 @@ int sms_light_phaser_device::bright_aim_area( emu_timer *timer, int lgun_x, int dx_radius = ceil((float) sqrt((float) (r_x_r - (dy * dy)))); } - aim_area.min_x = std::max(INT32(lgun_x - dx_radius), visarea.min_x); - aim_area.max_x = std::min(INT32(lgun_x + dx_radius), visarea.max_x); + aim_area.min_x = std::max(int32_t(lgun_x - dx_radius), visarea.min_x); + aim_area.max_x = std::min(int32_t(lgun_x + dx_radius), visarea.max_x); while (!new_check_point) { @@ -224,9 +224,9 @@ int sms_light_phaser_device::bright_aim_area( emu_timer *timer, int lgun_x, int else { rgb_t color; - UINT8 brightness; + uint8_t brightness; /* brightness of the lightgray color in the frame drawn by Light Phaser games */ - const UINT8 sensor_min_brightness = 0x7f; + const uint8_t sensor_min_brightness = 0x7f; color = m_port->pixel_r(); @@ -258,7 +258,7 @@ int sms_light_phaser_device::bright_aim_area( emu_timer *timer, int lgun_x, int } -UINT16 sms_light_phaser_device::screen_hpos_nonscaled(int scaled_hpos) +uint16_t sms_light_phaser_device::screen_hpos_nonscaled(int scaled_hpos) { const rectangle &visarea = m_screen->visible_area(); int offset_x = (scaled_hpos * (visarea.max_x - visarea.min_x)) / 255; @@ -266,7 +266,7 @@ UINT16 sms_light_phaser_device::screen_hpos_nonscaled(int scaled_hpos) } -UINT16 sms_light_phaser_device::screen_vpos_nonscaled(int scaled_vpos) +uint16_t sms_light_phaser_device::screen_vpos_nonscaled(int scaled_vpos) { const rectangle &visarea = m_screen->visible_area(); int offset_y = (scaled_vpos * (visarea.max_y - visarea.min_y)) / 255; diff --git a/src/devices/bus/sms_ctrl/lphaser.h b/src/devices/bus/sms_ctrl/lphaser.h index 860b8d4007f..d3004e2de80 100644 --- a/src/devices/bus/sms_ctrl/lphaser.h +++ b/src/devices/bus/sms_ctrl/lphaser.h @@ -29,7 +29,7 @@ class sms_light_phaser_device : public device_t, { public: // construction/destruction - sms_light_phaser_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_light_phaser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -43,7 +43,7 @@ protected: virtual void device_reset() override; // device_sms_control_port_interface overrides - virtual UINT8 peripheral_r() override; + virtual uint8_t peripheral_r() override; private: required_ioport m_lphaser_pins; @@ -57,8 +57,8 @@ private: void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; void sensor_check(); int bright_aim_area( emu_timer *timer, int lgun_x, int lgun_y ); - UINT16 screen_hpos_nonscaled(int scaled_hpos); - UINT16 screen_vpos_nonscaled(int scaled_vpos); + uint16_t screen_hpos_nonscaled(int scaled_hpos); + uint16_t screen_vpos_nonscaled(int scaled_vpos); }; diff --git a/src/devices/bus/sms_ctrl/multitap.cpp b/src/devices/bus/sms_ctrl/multitap.cpp index fd098b82c18..55101810647 100644 --- a/src/devices/bus/sms_ctrl/multitap.cpp +++ b/src/devices/bus/sms_ctrl/multitap.cpp @@ -27,7 +27,7 @@ const device_type SMS_MULTITAP = &device_creator; // sms_multitap_device - constructor //------------------------------------------------- -sms_multitap_device::sms_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sms_multitap_device::sms_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_MULTITAP, "Sega SMS Multitap", tag, owner, clock, "sms_multitap", __FILE__), device_sms_control_port_interface(mconfig, *this), m_subctrl1_port(*this, "ctrl1"), @@ -60,9 +60,9 @@ void sms_multitap_device::device_start() // sms_peripheral_r - multitap read //------------------------------------------------- -UINT8 sms_multitap_device::peripheral_r() +uint8_t sms_multitap_device::peripheral_r() { - UINT8 data = 0xff; + uint8_t data = 0xff; switch(m_read_state) { @@ -91,9 +91,9 @@ UINT8 sms_multitap_device::peripheral_r() // sms_peripheral_w - multitap write //------------------------------------------------- -void sms_multitap_device::peripheral_w(UINT8 data) +void sms_multitap_device::peripheral_w(uint8_t data) { - UINT8 output_data; + uint8_t output_data; // check if TH level is low (0) and was high (1) if (!(data & 0x40) && (m_last_data & 0x40)) diff --git a/src/devices/bus/sms_ctrl/multitap.h b/src/devices/bus/sms_ctrl/multitap.h index bf3e79e5616..93c71f8e215 100644 --- a/src/devices/bus/sms_ctrl/multitap.h +++ b/src/devices/bus/sms_ctrl/multitap.h @@ -28,7 +28,7 @@ class sms_multitap_device : public device_t, { public: // construction/destruction - sms_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ32_MEMBER(pixel_r); @@ -38,8 +38,8 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; // device_sms_control_port_interface overrides - virtual UINT8 peripheral_r() override; - virtual void peripheral_w(UINT8 data) override; + virtual uint8_t peripheral_r() override; + virtual void peripheral_w(uint8_t data) override; private: required_device m_subctrl1_port; @@ -47,8 +47,8 @@ private: required_device m_subctrl3_port; required_device m_subctrl4_port; - UINT8 m_read_state; - UINT8 m_last_data; + uint8_t m_read_state; + uint8_t m_last_data; }; diff --git a/src/devices/bus/sms_ctrl/paddle.cpp b/src/devices/bus/sms_ctrl/paddle.cpp index 805e0827533..88f6af4137a 100644 --- a/src/devices/bus/sms_ctrl/paddle.cpp +++ b/src/devices/bus/sms_ctrl/paddle.cpp @@ -40,7 +40,7 @@ const device_type SMS_PADDLE = &device_creator; CUSTOM_INPUT_MEMBER( sms_paddle_device::rldu_pins_r ) { - UINT8 data = m_paddle_x->read(); + uint8_t data = m_paddle_x->read(); if (m_read_state) data >>= 4; @@ -89,7 +89,7 @@ ioport_constructor sms_paddle_device::device_input_ports() const // sms_paddle_device - constructor //------------------------------------------------- -sms_paddle_device::sms_paddle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sms_paddle_device::sms_paddle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_PADDLE, "Sega SMS Paddle", tag, owner, clock, "sms_paddle", __FILE__), device_sms_control_port_interface(mconfig, *this), m_paddle_pins(*this, "CTRL_PORT"), @@ -117,7 +117,7 @@ void sms_paddle_device::device_start() // sms_peripheral_r - paddle read //------------------------------------------------- -UINT8 sms_paddle_device::peripheral_r() +uint8_t sms_paddle_device::peripheral_r() { int num_intervals = (machine().time() - m_start_time).as_double() / m_interval.as_double(); m_read_state = num_intervals & 1; diff --git a/src/devices/bus/sms_ctrl/paddle.h b/src/devices/bus/sms_ctrl/paddle.h index 968abe1b345..c5da3741b04 100644 --- a/src/devices/bus/sms_ctrl/paddle.h +++ b/src/devices/bus/sms_ctrl/paddle.h @@ -28,7 +28,7 @@ class sms_paddle_device : public device_t, { public: // construction/destruction - sms_paddle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_paddle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -41,13 +41,13 @@ protected: virtual void device_start() override; // device_sms_control_port_interface overrides - virtual UINT8 peripheral_r() override; + virtual uint8_t peripheral_r() override; private: required_ioport m_paddle_pins; required_ioport m_paddle_x; - UINT8 m_read_state; + uint8_t m_read_state; attotime m_start_time; const attotime m_interval; }; diff --git a/src/devices/bus/sms_ctrl/rfu.cpp b/src/devices/bus/sms_ctrl/rfu.cpp index 3c27307c137..d2e376a6d80 100644 --- a/src/devices/bus/sms_ctrl/rfu.cpp +++ b/src/devices/bus/sms_ctrl/rfu.cpp @@ -62,7 +62,7 @@ ioport_constructor sms_rapid_fire_device::device_input_ports() const // sms_rapid_fire_device - constructor //------------------------------------------------- -sms_rapid_fire_device::sms_rapid_fire_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sms_rapid_fire_device::sms_rapid_fire_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_RAPID_FIRE, "Sega SMS Rapid Fire", tag, owner, clock, "sms_rapid_fire", __FILE__), device_sms_control_port_interface(mconfig, *this), m_rfire_sw(*this, "rfu_sw"), @@ -92,9 +92,9 @@ void sms_rapid_fire_device::device_start() // sms_peripheral_r - rapid fire read //------------------------------------------------- -UINT8 sms_rapid_fire_device::peripheral_r() +uint8_t sms_rapid_fire_device::peripheral_r() { - UINT8 data; + uint8_t data; int num_intervals = (machine().time() - m_start_time).as_double() / m_interval.as_double(); m_read_state = num_intervals & 1; @@ -117,7 +117,7 @@ UINT8 sms_rapid_fire_device::peripheral_r() // sms_peripheral_w - rapid fire write //------------------------------------------------- -void sms_rapid_fire_device::peripheral_w(UINT8 data) +void sms_rapid_fire_device::peripheral_w(uint8_t data) { m_subctrl_port->port_w(data); } diff --git a/src/devices/bus/sms_ctrl/rfu.h b/src/devices/bus/sms_ctrl/rfu.h index 6a56b06ae3a..6784b55c66d 100644 --- a/src/devices/bus/sms_ctrl/rfu.h +++ b/src/devices/bus/sms_ctrl/rfu.h @@ -28,7 +28,7 @@ class sms_rapid_fire_device : public device_t, { public: // construction/destruction - sms_rapid_fire_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_rapid_fire_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -42,14 +42,14 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; // device_sms_control_port_interface overrides - virtual UINT8 peripheral_r() override; - virtual void peripheral_w(UINT8 data) override; + virtual uint8_t peripheral_r() override; + virtual void peripheral_w(uint8_t data) override; private: required_ioport m_rfire_sw; required_device m_subctrl_port; - UINT8 m_read_state; + uint8_t m_read_state; attotime m_start_time; const attotime m_interval; }; diff --git a/src/devices/bus/sms_ctrl/smsctrl.cpp b/src/devices/bus/sms_ctrl/smsctrl.cpp index 170a716a70f..e99cce2c827 100644 --- a/src/devices/bus/sms_ctrl/smsctrl.cpp +++ b/src/devices/bus/sms_ctrl/smsctrl.cpp @@ -60,7 +60,7 @@ device_sms_control_port_interface::~device_sms_control_port_interface() // sms_control_port_device - constructor //------------------------------------------------- -sms_control_port_device::sms_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sms_control_port_device::sms_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_CONTROL_PORT, "Sega SMS control port", tag, owner, clock, "sms_control_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr), m_th_pin_handler(*this), @@ -91,15 +91,15 @@ void sms_control_port_device::device_start() } -UINT8 sms_control_port_device::port_r() +uint8_t sms_control_port_device::port_r() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_device) data = m_device->peripheral_r(); return data; } -void sms_control_port_device::port_w( UINT8 data ) +void sms_control_port_device::port_w( uint8_t data ) { if (m_device) m_device->peripheral_w(data); @@ -111,7 +111,7 @@ void sms_control_port_device::th_pin_w(int state) m_th_pin_handler(state); } -UINT32 sms_control_port_device::pixel_r() +uint32_t sms_control_port_device::pixel_r() { return m_pixel_handler(); } diff --git a/src/devices/bus/sms_ctrl/smsctrl.h b/src/devices/bus/sms_ctrl/smsctrl.h index 4cce2437149..b85b9d91954 100644 --- a/src/devices/bus/sms_ctrl/smsctrl.h +++ b/src/devices/bus/sms_ctrl/smsctrl.h @@ -51,7 +51,7 @@ class sms_control_port_device : public device_t, { public: // construction/destruction - sms_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~sms_control_port_device(); // static configuration helpers @@ -72,11 +72,11 @@ public: // pin 8 - GND // bit 7 - pin 9 - TR (Button 2) // - UINT8 port_r(); - void port_w( UINT8 data ); + uint8_t port_r(); + void port_w( uint8_t data ); void th_pin_w(int state); - UINT32 pixel_r(); + uint32_t pixel_r(); //protected: // device-level overrides @@ -100,8 +100,8 @@ public: device_sms_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_sms_control_port_interface(); - virtual UINT8 peripheral_r() { return 0xff; }; - virtual void peripheral_w(UINT8 data) { }; + virtual uint8_t peripheral_r() { return 0xff; }; + virtual void peripheral_w(uint8_t data) { }; protected: sms_control_port_device *m_port; diff --git a/src/devices/bus/sms_ctrl/sports.cpp b/src/devices/bus/sms_ctrl/sports.cpp index d2a5647e965..5cd92b4e565 100644 --- a/src/devices/bus/sms_ctrl/sports.cpp +++ b/src/devices/bus/sms_ctrl/sports.cpp @@ -92,7 +92,7 @@ WRITE_LINE_MEMBER( sms_sports_pad_device::th_pin_w ) CUSTOM_INPUT_MEMBER( sms_sports_pad_device::rldu_pins_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (m_read_state) { @@ -157,7 +157,7 @@ ioport_constructor sms_sports_pad_device::device_input_ports() const // sms_sports_pad_device - constructor //------------------------------------------------- -sms_sports_pad_device::sms_sports_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sms_sports_pad_device::sms_sports_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_SPORTS_PAD, "Sega SMS Sports Pad US", tag, owner, clock, "sms_sports_pad", __FILE__), device_sms_control_port_interface(mconfig, *this), m_sports_in(*this, "SPORTS_IN"), @@ -192,7 +192,7 @@ void sms_sports_pad_device::device_start() // sms_peripheral_r - sports pad read //------------------------------------------------- -UINT8 sms_sports_pad_device::peripheral_r() +uint8_t sms_sports_pad_device::peripheral_r() { return m_sports_in->read(); } @@ -202,7 +202,7 @@ UINT8 sms_sports_pad_device::peripheral_r() // sms_peripheral_w - sports pad write //------------------------------------------------- -void sms_sports_pad_device::peripheral_w(UINT8 data) +void sms_sports_pad_device::peripheral_w(uint8_t data) { m_sports_out->write(data); } diff --git a/src/devices/bus/sms_ctrl/sports.h b/src/devices/bus/sms_ctrl/sports.h index 5ca209e748d..5e371372e3c 100644 --- a/src/devices/bus/sms_ctrl/sports.h +++ b/src/devices/bus/sms_ctrl/sports.h @@ -28,7 +28,7 @@ class sms_sports_pad_device : public device_t, { public: // construction/destruction - sms_sports_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_sports_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -42,8 +42,8 @@ protected: virtual void device_start() override; // device_sms_control_port_interface overrides - virtual UINT8 peripheral_r() override; - virtual void peripheral_w(UINT8 data) override; + virtual uint8_t peripheral_r() override; + virtual void peripheral_w(uint8_t data) override; private: required_ioport m_sports_in; @@ -51,10 +51,10 @@ private: required_ioport m_sports_x; required_ioport m_sports_y; - UINT8 m_read_state; - UINT8 m_th_pin_state; - UINT8 m_x_axis_reset_value; - UINT8 m_y_axis_reset_value; + uint8_t m_read_state; + uint8_t m_th_pin_state; + uint8_t m_x_axis_reset_value; + uint8_t m_y_axis_reset_value; const attotime m_interval; emu_timer *m_sportspad_timer; static const device_timer_id TIMER_SPORTSPAD = 0; diff --git a/src/devices/bus/sms_ctrl/sportsjp.cpp b/src/devices/bus/sms_ctrl/sportsjp.cpp index e9b148c19e9..97914397272 100644 --- a/src/devices/bus/sms_ctrl/sportsjp.cpp +++ b/src/devices/bus/sms_ctrl/sportsjp.cpp @@ -92,7 +92,7 @@ ioport_constructor sms_sports_pad_jp_device::device_input_ports() const // sms_sports_pad_jp_device - constructor //------------------------------------------------- -sms_sports_pad_jp_device::sms_sports_pad_jp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sms_sports_pad_jp_device::sms_sports_pad_jp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMS_SPORTS_PAD_JP, "Sega SMS Sports Pad JP", tag, owner, clock, "sms_sports_pad_jp", __FILE__), device_sms_control_port_interface(mconfig, *this), m_sports_jp_in(*this, "SPORTS_JP_IN"), @@ -126,7 +126,7 @@ void sms_sports_pad_jp_device::device_start() // sms_peripheral_r - sports pad read //------------------------------------------------- -UINT8 sms_sports_pad_jp_device::peripheral_r() +uint8_t sms_sports_pad_jp_device::peripheral_r() { int num_intervals = (machine().time() - m_start_time).as_double() / m_interval.as_double(); diff --git a/src/devices/bus/sms_ctrl/sportsjp.h b/src/devices/bus/sms_ctrl/sportsjp.h index 3e82c18dd85..2679f685806 100644 --- a/src/devices/bus/sms_ctrl/sportsjp.h +++ b/src/devices/bus/sms_ctrl/sportsjp.h @@ -28,7 +28,7 @@ class sms_sports_pad_jp_device : public device_t, { public: // construction/destruction - sms_sports_pad_jp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sms_sports_pad_jp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -42,7 +42,7 @@ protected: virtual void device_start() override; // device_sms_control_port_interface overrides - virtual UINT8 peripheral_r() override; + virtual uint8_t peripheral_r() override; private: required_ioport m_sports_jp_in; @@ -50,9 +50,9 @@ private: required_ioport m_sports_jp_x; required_ioport m_sports_jp_y; - UINT8 m_rldu_pins_state; - UINT8 m_tl_pin_state; - UINT8 m_tr_pin_state; + uint8_t m_rldu_pins_state; + uint8_t m_tl_pin_state; + uint8_t m_tr_pin_state; attotime m_start_time; const attotime m_interval; }; diff --git a/src/devices/bus/sms_exp/gender.cpp b/src/devices/bus/sms_exp/gender.cpp index 49ccc50e24e..c021b9feef3 100644 --- a/src/devices/bus/sms_exp/gender.cpp +++ b/src/devices/bus/sms_exp/gender.cpp @@ -33,7 +33,7 @@ const device_type SMS_GENDER_ADAPTER = &device_creator; const device_type SNS_BSMEMPAK = &device_creator; -sns_rom_bsx_device::sns_rom_bsx_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) +sns_rom_bsx_device::sns_rom_bsx_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) : sns_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_base_unit(nullptr), access_00_1f(0), @@ -37,7 +37,7 @@ sns_rom_bsx_device::sns_rom_bsx_device(const machine_config &mconfig, device_typ { } -sns_rom_bsx_device::sns_rom_bsx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_bsx_device::sns_rom_bsx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_ROM_BSX, "SNES BS-X Cart", tag, owner, clock, "sns_rom_bsx", __FILE__), m_base_unit(nullptr), access_00_1f(0), @@ -50,19 +50,19 @@ sns_rom_bsx_device::sns_rom_bsx_device(const machine_config &mconfig, const char { } -sns_rom_bsxlo_device::sns_rom_bsxlo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_bsxlo_device::sns_rom_bsxlo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_BSX, "SNES Cart (LoROM) + BS-X slot", tag, owner, clock, "sns_rom_bsxlo", __FILE__), m_slot(*this, "bs_slot") { } -sns_rom_bsxhi_device::sns_rom_bsxhi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_bsxhi_device::sns_rom_bsxhi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom21_device(mconfig, SNS_HIROM_BSX, "SNES Cart (HiROM) + BS-X slot", tag, owner, clock, "sns_rom_bsxhi", __FILE__), m_slot(*this, "bs_slot") { } -sns_rom_bsmempak_device::sns_rom_bsmempak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_bsmempak_device::sns_rom_bsmempak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_BSMEMPAK, "SNES BS-X Memory packs", tag, owner, clock, "sns_bsmempak", __FILE__), m_command(0), m_write_old(0), m_write_new(0), m_flash_enable(0), m_read_enable(0), m_write_enable(0) { } @@ -145,7 +145,7 @@ void BSX_base::init() } -UINT8 BSX_base::read(UINT32 offset) +uint8_t BSX_base::read(uint32_t offset) { offset &= 0xffff; if (offset < 0x2188 || offset >= 0x21a0) @@ -159,7 +159,7 @@ UINT8 BSX_base::read(UINT32 offset) // no 218b? no 218d? no 2191? no 2195? no 219a-219f? case 0x2192: { - UINT8 counter = r2192_counter++; + uint8_t counter = r2192_counter++; if (r2192_counter >= 18) r2192_counter = 0; @@ -207,7 +207,7 @@ UINT8 BSX_base::read(UINT32 offset) } -void BSX_base::write(UINT32 offset, UINT8 data) +void BSX_base::write(uint32_t offset, uint8_t data) { offset &= 0xffff; if (offset < 0x2188 || offset >= 0x21a0) @@ -436,7 +436,7 @@ READ8_MEMBER(sns_rom_bsx_device::chip_read) if ((offset & 0xf0ffff) == 0x005000) //$[00-0f]:5000 reg access { - UINT8 n = (offset >> 16) & 0x0f; + uint8_t n = (offset >> 16) & 0x0f; return m_cart_regs[n]; } @@ -455,7 +455,7 @@ WRITE8_MEMBER(sns_rom_bsx_device::chip_write) if ((offset & 0xf0ffff) == 0x005000) //$[00-0f]:5000 reg access { - UINT8 n = (offset >> 16) & 0x0f; + uint8_t n = (offset >> 16) & 0x0f; m_cart_regs[n] = data; if (n == 0x0e && data & 0x80) access_update(); diff --git a/src/devices/bus/snes/bsx.h b/src/devices/bus/snes/bsx.h index 43ee42f7b4a..677b81808dc 100644 --- a/src/devices/bus/snes/bsx.h +++ b/src/devices/bus/snes/bsx.h @@ -14,16 +14,16 @@ public: running_machine &machine() const { return m_machine; } void init(); - UINT8 read(UINT32 offset); - void write(UINT32 offset, UINT8 data); + uint8_t read(uint32_t offset); + void write(uint32_t offset, uint8_t data); private: // regs - UINT8 regs[0x18]; // 0x2188-0x219f + uint8_t regs[0x18]; // 0x2188-0x219f // counter + clock - UINT8 r2192_counter; - UINT8 r2192_hour, r2192_minute, r2192_second; + uint8_t r2192_counter; + uint8_t r2192_hour, r2192_minute, r2192_second; running_machine& m_machine; }; @@ -34,8 +34,8 @@ class sns_rom_bsx_device : public sns_rom_device { public: // construction/destruction - sns_rom_bsx_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); - sns_rom_bsx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_bsx_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); + sns_rom_bsx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -54,17 +54,17 @@ public: std::unique_ptr m_base_unit; // cart regs - UINT8 m_cart_regs[16]; - UINT8 access_00_1f; // 1 = CART, 0 = NOTHING - UINT8 access_80_9f; // 1 = CART, 0 = NOTHING - UINT8 access_40_4f; // 1 = NOTHING, 0 = PRAM - UINT8 access_50_5f; // 1 = NOTHING, 0 = PRAM - UINT8 access_60_6f; // 1 = PRAM, 0 = NOTHING - UINT8 rom_access; // 2 = HiROM, 1 = LoROM, 0 = PRAM + uint8_t m_cart_regs[16]; + uint8_t access_00_1f; // 1 = CART, 0 = NOTHING + uint8_t access_80_9f; // 1 = CART, 0 = NOTHING + uint8_t access_40_4f; // 1 = NOTHING, 0 = PRAM + uint8_t access_50_5f; // 1 = NOTHING, 0 = PRAM + uint8_t access_60_6f; // 1 = PRAM, 0 = NOTHING + uint8_t rom_access; // 2 = HiROM, 1 = LoROM, 0 = PRAM void access_update(); - UINT8 m_pram[0x80000]; + uint8_t m_pram[0x80000]; private: required_device m_slot; @@ -76,7 +76,7 @@ class sns_rom_bsxlo_device : public sns_rom_device { public: // construction/destruction - sns_rom_bsxlo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_bsxlo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -96,7 +96,7 @@ class sns_rom_bsxhi_device : public sns_rom21_device { public: // construction/destruction - sns_rom_bsxhi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_bsxhi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -117,7 +117,7 @@ class sns_rom_bsmempak_device : public sns_rom_device { public: // construction/destruction - sns_rom_bsmempak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_bsmempak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -132,9 +132,9 @@ public: // virtual DECLARE_WRITE8_MEMBER(chip_write); // flash regs - UINT32 m_command; - UINT8 m_write_old; - UINT8 m_write_new; + uint32_t m_command; + uint8_t m_write_old; + uint8_t m_write_new; int m_flash_enable; int m_read_enable; diff --git a/src/devices/bus/snes/event.cpp b/src/devices/bus/snes/event.cpp index ef39d9fbce6..ca46a2a89ea 100644 --- a/src/devices/bus/snes/event.cpp +++ b/src/devices/bus/snes/event.cpp @@ -20,7 +20,7 @@ const device_type SNS_PFEST94 = &device_creator; -sns_pfest94_device::sns_pfest94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_pfest94_device::sns_pfest94_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNS_PFEST94, "SNES Powerfest '94", tag, owner, clock, "sns_pfest94", __FILE__), device_sns_cart_interface(mconfig, *this), m_upd7725(*this, "dsp"), @@ -36,8 +36,8 @@ sns_pfest94_device::sns_pfest94_device(const machine_config &mconfig, const char void sns_pfest94_device::device_start() { - m_dsp_prg.resize(0x2000/sizeof(UINT32)); - m_dsp_data.resize(0x800/sizeof(UINT16)); + m_dsp_prg.resize(0x2000/sizeof(uint32_t)); + m_dsp_data.resize(0x800/sizeof(uint16_t)); pfest94_timer = timer_alloc(TIMER_EVENT); pfest94_timer->reset(); @@ -162,11 +162,11 @@ WRITE8_MEMBER( sns_pfest94_device::chip_write ) //------------------------------------------------- // helpers -inline UINT32 get_prg(UINT8 *CPU, UINT32 addr) +inline uint32_t get_prg(uint8_t *CPU, uint32_t addr) { return ((CPU[addr * 4] << 24) | (CPU[addr * 4 + 1] << 16) | (CPU[addr * 4 + 2] << 8) | 0x00); } -inline UINT16 get_data(UINT8 *CPU, UINT32 addr) +inline uint16_t get_data(uint8_t *CPU, uint32_t addr) { return ((CPU[addr * 2] << 8) | CPU[addr * 2 + 1]); } diff --git a/src/devices/bus/snes/event.h b/src/devices/bus/snes/event.h index a09adf15949..4703ed9b2cf 100644 --- a/src/devices/bus/snes/event.h +++ b/src/devices/bus/snes/event.h @@ -14,7 +14,7 @@ class sns_pfest94_device : public device_t, { public: // construction/destruction - sns_pfest94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_pfest94_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -38,13 +38,13 @@ public: virtual DECLARE_READ16_MEMBER(necdsp_data_r); private: - UINT8 m_base_bank; - UINT8 m_mask; - UINT8 m_status; - UINT32 m_count; + uint8_t m_base_bank; + uint8_t m_mask; + uint8_t m_status; + uint32_t m_count; - std::vector m_dsp_prg; - std::vector m_dsp_data; + std::vector m_dsp_prg; + std::vector m_dsp_data; static const device_timer_id TIMER_EVENT = 0; emu_timer *pfest94_timer; diff --git a/src/devices/bus/snes/rom.cpp b/src/devices/bus/snes/rom.cpp index 3763f11ed91..1eed877ce83 100644 --- a/src/devices/bus/snes/rom.cpp +++ b/src/devices/bus/snes/rom.cpp @@ -29,19 +29,19 @@ const device_type SNS_LOROM_MCPIR2 = &device_creator; const device_type SNS_LOROM_20COL = &device_creator; -sns_rom_device::sns_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +sns_rom_device::sns_rom_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_sns_cart_interface( mconfig, *this ) { } -sns_rom_device::sns_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_device::sns_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNS_LOROM, "SNES Cart (LoROM)", tag, owner, clock, "sns_rom", __FILE__), device_sns_cart_interface( mconfig, *this ) { } -sns_rom_obc1_device::sns_rom_obc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_obc1_device::sns_rom_obc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_OBC1, "SNES Cart (LoROM) + OBC-1", tag, owner, clock, "sns_rom_obc1", __FILE__), m_address(0), m_offset(0), m_shift(0) { } @@ -49,43 +49,43 @@ sns_rom_obc1_device::sns_rom_obc1_device(const machine_config &mconfig, const ch // Pirate LoROM 'mappers' -sns_rom_pokemon_device::sns_rom_pokemon_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_pokemon_device::sns_rom_pokemon_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_POKEMON, "SNES Pirate Carts with Protection", tag, owner, clock, "sns_rom_pokemon", __FILE__), m_latch(0) { } -sns_rom_tekken2_device::sns_rom_tekken2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_tekken2_device::sns_rom_tekken2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_TEKKEN2, "SNES Tekken 2", tag, owner, clock, "sns_rom_tekken2", __FILE__), m_prot(0) { } -sns_rom_soulblad_device::sns_rom_soulblad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_soulblad_device::sns_rom_soulblad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_SOULBLAD, "SNES Soul Blade", tag, owner, clock, "sns_rom_soulblad", __FILE__) { } -sns_rom_banana_device::sns_rom_banana_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_banana_device::sns_rom_banana_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_BANANA, "SNES Banana de Pijamas", tag, owner, clock, "sns_rom_banana", __FILE__) { } -sns_rom_bugs_device::sns_rom_bugs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_bugs_device::sns_rom_bugs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_BUGSLIFE, "SNES A Bug's Life", tag, owner, clock, "sns_rom_bugslife", __FILE__) { } // Multigame LoROM 'mappers' -sns_rom_mcpirate1_device::sns_rom_mcpirate1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_mcpirate1_device::sns_rom_mcpirate1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_MCPIR1, "SNES Pirate Multigame Carts Type 1", tag, owner, clock, "sns_rom_mcpirate1", __FILE__), m_base_bank(0) { } -sns_rom_mcpirate2_device::sns_rom_mcpirate2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_mcpirate2_device::sns_rom_mcpirate2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_MCPIR2, "SNES Pirate Multigame Carts Type 2", tag, owner, clock, "sns_rom_mcpirate2", __FILE__), m_base_bank(0) { } -sns_rom_20col_device::sns_rom_20col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_20col_device::sns_rom_20col_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_20COL, "SNES Super 20 Collection", tag, owner, clock, "sns_rom_20col", __FILE__), m_base_bank(0) { } @@ -204,8 +204,8 @@ READ8_MEMBER(sns_rom_device::read_h) READ8_MEMBER( sns_rom_obc1_device::chip_read ) { - UINT16 address = offset & 0x1fff; - UINT8 value; + uint16_t address = offset & 0x1fff; + uint8_t value; switch (address) { @@ -240,8 +240,8 @@ READ8_MEMBER( sns_rom_obc1_device::chip_read ) WRITE8_MEMBER( sns_rom_obc1_device::chip_write ) { - UINT16 address = offset & 0x1fff; - UINT8 temp; + uint16_t address = offset & 0x1fff; + uint8_t temp; switch(address) { @@ -308,7 +308,7 @@ WRITE8_MEMBER( sns_rom_pokemon_device::chip_write ) // The protection itself is accessed in banks $80-$bf. Accessing (read/write, doesn't matter) address lines // A8,A9,A10 in these banks in a certain sequence makes the mc return a 4bit value. [d4s] // Details on a possible algorythm behind the sequence of accesses were provided by nocash. Thanks! -void sns_rom_tekken2_device::update_prot(UINT32 offset) +void sns_rom_tekken2_device::update_prot(uint32_t offset) { // accesses to [80-bf][8000-87ff] ranges update the protection value offset &= 0x7ff; @@ -377,7 +377,7 @@ WRITE8_MEMBER( sns_rom_tekken2_device::chip_write ) // Banks $c0-$ff return open bus. READ8_MEMBER( sns_rom_soulblad_device::chip_read ) { - UINT8 value; + uint8_t value; offset &= 3; switch (offset) { diff --git a/src/devices/bus/snes/rom.h b/src/devices/bus/snes/rom.h index a197383d1cb..ddd73ab33da 100644 --- a/src/devices/bus/snes/rom.h +++ b/src/devices/bus/snes/rom.h @@ -13,8 +13,8 @@ class sns_rom_device : public device_t, { public: // construction/destruction - sns_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - sns_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_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); + sns_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -30,7 +30,7 @@ class sns_rom_obc1_device : public sns_rom_device { public: // construction/destruction - sns_rom_obc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_obc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -43,7 +43,7 @@ public: int m_address; int m_offset; int m_shift; - UINT8 m_ram[0x2000]; + uint8_t m_ram[0x2000]; }; @@ -54,7 +54,7 @@ class sns_rom_pokemon_device : public sns_rom_device { public: // construction/destruction - sns_rom_pokemon_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_pokemon_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -63,7 +63,7 @@ public: // reading and writing virtual DECLARE_READ8_MEMBER(chip_read) override; // protection device virtual DECLARE_WRITE8_MEMBER(chip_write) override; // protection device - UINT8 m_latch; + uint8_t m_latch; }; // ======================> sns_rom_tekken2_device @@ -72,7 +72,7 @@ class sns_rom_tekken2_device : public sns_rom_device { public: // construction/destruction - sns_rom_tekken2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_tekken2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -82,11 +82,11 @@ public: virtual DECLARE_READ8_MEMBER(chip_read) override; // protection device virtual DECLARE_WRITE8_MEMBER(chip_write) override; // protection device - void update_prot(UINT32 offset); + void update_prot(uint32_t offset); // bit0-3 prot value, bit4 direction, bit5 function // reads must return (prot value) +1/-1/<<1/>>1 depending on bit4 & bit5 - UINT8 m_prot; + uint8_t m_prot; }; // ======================> sns_rom_soulblad_device @@ -95,7 +95,7 @@ class sns_rom_soulblad_device : public sns_rom_device { public: // construction/destruction - sns_rom_soulblad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_soulblad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(chip_read) override; // protection device @@ -107,7 +107,7 @@ class sns_rom_mcpirate1_device : public sns_rom_device { public: // construction/destruction - sns_rom_mcpirate1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_mcpirate1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -117,7 +117,7 @@ public: virtual DECLARE_READ8_MEMBER(read_l) override; virtual DECLARE_READ8_MEMBER(read_h) override; virtual DECLARE_WRITE8_MEMBER(chip_write) override; // bankswitch device - UINT8 m_base_bank; + uint8_t m_base_bank; }; // ======================> sns_rom_mcpirate2_device @@ -126,7 +126,7 @@ class sns_rom_mcpirate2_device : public sns_rom_device { public: // construction/destruction - sns_rom_mcpirate2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_mcpirate2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -136,7 +136,7 @@ public: virtual DECLARE_READ8_MEMBER(read_l) override; virtual DECLARE_READ8_MEMBER(read_h) override; virtual DECLARE_WRITE8_MEMBER(chip_write) override; // bankswitch device - UINT8 m_base_bank; + uint8_t m_base_bank; }; // ======================> sns_rom_20col_device @@ -145,7 +145,7 @@ class sns_rom_20col_device : public sns_rom_device { public: // construction/destruction - sns_rom_20col_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_20col_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -154,7 +154,7 @@ public: virtual DECLARE_READ8_MEMBER(read_l) override; virtual DECLARE_READ8_MEMBER(read_h) override; virtual DECLARE_WRITE8_MEMBER(chip_write) override; // bankswitch device - UINT8 m_base_bank; + uint8_t m_base_bank; }; // ======================> sns_rom_banana_device @@ -163,7 +163,7 @@ class sns_rom_banana_device : public sns_rom_device { public: // construction/destruction - sns_rom_banana_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_banana_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides // virtual void device_start(); @@ -172,7 +172,7 @@ public: // reading and writing virtual DECLARE_READ8_MEMBER(chip_read) override; // protection device virtual DECLARE_WRITE8_MEMBER(chip_write) override; // protection device - UINT8 m_latch[16]; + uint8_t m_latch[16]; }; // ======================> sns_rom_bugs_device @@ -181,7 +181,7 @@ class sns_rom_bugs_device : public sns_rom_device { public: // construction/destruction - sns_rom_bugs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_bugs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -190,7 +190,7 @@ public: // reading and writing virtual DECLARE_READ8_MEMBER(chip_read) override; // protection device virtual DECLARE_WRITE8_MEMBER(chip_write) override; // protection device - UINT8 m_latch[0x800]; + uint8_t m_latch[0x800]; }; diff --git a/src/devices/bus/snes/rom21.cpp b/src/devices/bus/snes/rom21.cpp index 175e64991de..78db94492d8 100644 --- a/src/devices/bus/snes/rom21.cpp +++ b/src/devices/bus/snes/rom21.cpp @@ -19,19 +19,19 @@ const device_type SNS_HIROM = &device_creator; const device_type SNS_HIROM_SRTC = &device_creator; -sns_rom21_device::sns_rom21_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) +sns_rom21_device::sns_rom21_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_sns_cart_interface( mconfig, *this ) { } -sns_rom21_device::sns_rom21_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom21_device::sns_rom21_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNS_HIROM, "SNES Cart (HiROM)", tag, owner, clock, "sns_rom21", __FILE__), device_sns_cart_interface( mconfig, *this ) { } -sns_rom21_srtc_device::sns_rom21_srtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom21_srtc_device::sns_rom21_srtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom21_device(mconfig, SNS_HIROM_SRTC, "SNES Cart (HiROM) + S-RTC", tag, owner, clock, "sns_rom21_srtc", __FILE__), m_mode(0), m_index(0) { } @@ -94,7 +94,7 @@ READ8_MEMBER(sns_rom21_device::read_h) ***************************************************************************/ -static const UINT8 srtc_months[12] = +static const uint8_t srtc_months[12] = { 31, 28, 31, 30, 31, 30, @@ -124,10 +124,10 @@ void sns_rom21_srtc_device::update_time() // Returns day-of-week for specified date // e.g. 0 = Sunday, 1 = Monday, ... 6 = Saturday // Usage: weekday(2008, 1, 1) returns the weekday of January 1st, 2008 -UINT8 sns_rom21_srtc_device::srtc_weekday( UINT32 year, UINT32 month, UINT32 day ) +uint8_t sns_rom21_srtc_device::srtc_weekday( uint32_t year, uint32_t month, uint32_t day ) { - UINT32 y = 1900, m = 1; // Epoch is 1900-01-01 - UINT32 sum = 0; // Number of days passed since epoch + uint32_t y = 1900, m = 1; // Epoch is 1900-01-01 + uint32_t sum = 0; // Number of days passed since epoch year = std::max(1900U, year); month = std::max(1U, std::min(12U, month)); @@ -135,7 +135,7 @@ UINT8 sns_rom21_srtc_device::srtc_weekday( UINT32 year, UINT32 month, UINT32 day while (y < year) { - UINT8 leapyear = 0; + uint8_t leapyear = 0; if ((y % 4) == 0) { leapyear = 1; @@ -150,10 +150,10 @@ UINT8 sns_rom21_srtc_device::srtc_weekday( UINT32 year, UINT32 month, UINT32 day while (m < month) { - UINT32 days = srtc_months[m - 1]; + uint32_t days = srtc_months[m - 1]; if (days == 28) { - UINT8 leapyear = 0; + uint8_t leapyear = 0; if ((y % 4) == 0) { leapyear = 1; @@ -225,9 +225,9 @@ WRITE8_MEMBER(sns_rom21_srtc_device::chip_write) if (m_index == 12) { // Day of week is automatically calculated and written - UINT32 day = m_rtc_ram[6] + m_rtc_ram[7] * 10; - UINT32 month = m_rtc_ram[8]; - UINT32 year = m_rtc_ram[9] + m_rtc_ram[10] * 10 + m_rtc_ram[11] * 100; + uint32_t day = m_rtc_ram[6] + m_rtc_ram[7] * 10; + uint32_t month = m_rtc_ram[8]; + uint32_t year = m_rtc_ram[9] + m_rtc_ram[10] * 10 + m_rtc_ram[11] * 100; year += 1000; m_rtc_ram[m_index++] = srtc_weekday(year, month, day); @@ -243,7 +243,7 @@ WRITE8_MEMBER(sns_rom21_srtc_device::chip_write) } else if (data == 4) { - UINT8 i; + uint8_t i; m_mode = RTCM_Ready; m_index = -1; for(i = 0; i < 13; i++) diff --git a/src/devices/bus/snes/rom21.h b/src/devices/bus/snes/rom21.h index 2196e90ca56..befd130f02f 100644 --- a/src/devices/bus/snes/rom21.h +++ b/src/devices/bus/snes/rom21.h @@ -13,8 +13,8 @@ class sns_rom21_device : public device_t, { public: // construction/destruction - sns_rom21_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); - sns_rom21_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom21_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); + sns_rom21_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -31,7 +31,7 @@ class sns_rom21_srtc_device : public sns_rom21_device { public: // construction/destruction - sns_rom21_srtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom21_srtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -51,12 +51,12 @@ public: }; void update_time(); - UINT8 srtc_weekday(UINT32 year, UINT32 month, UINT32 day); + uint8_t srtc_weekday(uint32_t year, uint32_t month, uint32_t day); //this is now allocated in the main snes cart class, to allow saving to nvram - //UINT8 m_rtc_ram[13]; - INT32 m_mode; - INT8 m_index; + //uint8_t m_rtc_ram[13]; + int32_t m_mode; + int8_t m_index; }; diff --git a/src/devices/bus/snes/sa1.cpp b/src/devices/bus/snes/sa1.cpp index b22af792a97..3608aa9bd8d 100644 --- a/src/devices/bus/snes/sa1.cpp +++ b/src/devices/bus/snes/sa1.cpp @@ -85,7 +85,7 @@ const device_type SNS_LOROM_SA1 = &device_creator; -sns_sa1_device::sns_sa1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_sa1_device::sns_sa1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNS_LOROM_SA1, "SNES Cart + SA-1", tag, owner, clock, "sns_rom_sa1", __FILE__), device_sns_cart_interface( mconfig, *this ), m_sa1(*this, "sa1cpu"), m_sa1_ctrl(0), m_scpu_sie(0), m_sa1_reset(0), m_sa1_nmi(0), m_sa1_irq(0), m_scpu_ctrl(0), m_sa1_sie(0), m_irq_vector(0), m_nmi_vector(0), m_hcount(0), m_vcount(0), m_bank_c_hi(0), m_bank_c_rom(0), m_bank_d_hi(0), m_bank_d_rom(0), m_bank_e_hi(0), m_bank_e_rom(0), m_bank_f_hi(0), m_bank_f_rom(0), m_bwram_snes(0), m_bwram_sa1(0), m_bwram_sa1_source(0), m_bwram_sa1_format(0), m_bwram_write_snes(0), m_bwram_write_sa1(0), m_bwpa_sa1(0), m_iram_write_snes(0), m_iram_write_sa1(0), m_dma_ctrl(0), m_dma_ccparam(0), m_src_addr(0), m_dst_addr(0), m_dma_cnt(0), m_math_ctlr(0), m_math_overflow(0), m_math_a(0), m_math_b(0), m_math_res(0), m_vda(0), m_vbit(0), m_vlen(0), m_drm(0), m_scpu_flags(0), m_sa1_flags(0), m_hcr(0), m_vcr(0) @@ -195,7 +195,7 @@ void sns_sa1_device::recalc_irqs() // handle this separately to avoid accessing recursively the regs? -UINT8 sns_sa1_device::var_length_read(address_space &space, UINT32 offset) +uint8_t sns_sa1_device::var_length_read(address_space &space, uint32_t offset) { // handle 0xffea/0xffeb/0xffee/0xffef if ((offset & 0xffffe0) == 0x00ffe0) @@ -236,9 +236,9 @@ void sns_sa1_device::dma_transfer(address_space &space) while (m_dma_cnt--) { - UINT8 data = 0; // open bus? - UINT32 dma_src = m_src_addr++; - UINT32 dma_dst = m_dst_addr++; + uint8_t data = 0; // open bus? + uint32_t dma_src = m_src_addr++; + uint32_t dma_dst = m_dst_addr++; // source and destination cannot be the same // source = { 0=ROM, 1=BWRAM, 2=IRAM } @@ -312,9 +312,9 @@ void sns_sa1_device::dma_cctype2_transfer(address_space &space) { } -UINT8 sns_sa1_device::read_regs(address_space &space, UINT32 offset) +uint8_t sns_sa1_device::read_regs(address_space &space, uint32_t offset) { - UINT8 value = 0xff; + uint8_t value = 0xff; offset &= 0x1ff; // $2200 + offset gives the reg value to compare with docs switch (offset) @@ -349,23 +349,23 @@ UINT8 sns_sa1_device::read_regs(address_space &space, UINT32 offset) break; case 0x106: // Math Result bits0-7 - value = (UINT64)(m_math_res >> 0) & 0xff; + value = (uint64_t)(m_math_res >> 0) & 0xff; break; case 0x107: // Math Result bits8-15 - value = (UINT64)(m_math_res >> 8) & 0xff; + value = (uint64_t)(m_math_res >> 8) & 0xff; break; case 0x108: // Math Result bits16-23 - value = (UINT64)(m_math_res >> 16) & 0xff; + value = (uint64_t)(m_math_res >> 16) & 0xff; break; case 0x109: // Math Result bits24-31 - value = (UINT64)(m_math_res >> 24) & 0xff; + value = (uint64_t)(m_math_res >> 24) & 0xff; break; case 0x10a: // Math Result bits32-39 - value = (UINT64)(m_math_res >> 32) & 0xff; + value = (uint64_t)(m_math_res >> 32) & 0xff; break; case 0x10b: // Math Overflow (above 40bit result) @@ -374,7 +374,7 @@ UINT8 sns_sa1_device::read_regs(address_space &space, UINT32 offset) case 0x10c: // Var-Length Read Port Low { - UINT32 data = (var_length_read(space, m_vda + 0) << 0) | (var_length_read(space, m_vda + 1) << 8) + uint32_t data = (var_length_read(space, m_vda + 0) << 0) | (var_length_read(space, m_vda + 1) << 8) | (var_length_read(space, m_vda + 2) << 16); data >>= m_vbit; value = (data >> 0) & 0xff; @@ -383,7 +383,7 @@ UINT8 sns_sa1_device::read_regs(address_space &space, UINT32 offset) case 0x10d: // Var-Length Read Port High { - UINT32 data = (var_length_read(space, m_vda + 0) << 0) | (var_length_read(space, m_vda + 1) << 8) + uint32_t data = (var_length_read(space, m_vda + 0) << 0) | (var_length_read(space, m_vda + 1) << 8) | (var_length_read(space, m_vda + 2) << 16); data >>= m_vbit; @@ -408,7 +408,7 @@ UINT8 sns_sa1_device::read_regs(address_space &space, UINT32 offset) return value; } -void sns_sa1_device::write_regs(address_space &space, UINT32 offset, UINT8 data) +void sns_sa1_device::write_regs(address_space &space, uint32_t offset, uint8_t data) { offset &= 0x1ff; // $2200 + offset gives the reg value to compare with docs @@ -749,7 +749,7 @@ void sns_sa1_device::write_regs(address_space &space, UINT32 offset, UINT8 data) switch (m_math_ctlr) { case 0: //signed multiplication - m_math_res = (INT16)m_math_a * (INT16)m_math_b; + m_math_res = (int16_t)m_math_a * (int16_t)m_math_b; m_math_b = 0; break; case 1: //unsigned division @@ -757,15 +757,15 @@ void sns_sa1_device::write_regs(address_space &space, UINT32 offset, UINT8 data) m_math_res = 0; else { - INT16 quotient = (INT16)m_math_a / (UINT16)m_math_b; - UINT16 remainder = (INT16)m_math_a % (UINT16)m_math_b; - m_math_res = (UINT64)((remainder << 16) | quotient); + int16_t quotient = (int16_t)m_math_a / (uint16_t)m_math_b; + uint16_t remainder = (int16_t)m_math_a % (uint16_t)m_math_b; + m_math_res = (uint64_t)((remainder << 16) | quotient); } break; case 2: //sigma (accumulative multiplication) case 3: - UINT64 acum = (INT16)m_math_a * (INT16)m_math_b; - UINT64 mask = U64(0xffffffffff); + uint64_t acum = (int16_t)m_math_a * (int16_t)m_math_b; + uint64_t mask = U64(0xffffffffff); m_math_res += acum; m_math_overflow = (m_math_res > mask) ? 0x80 : 0; m_math_res &= mask; @@ -807,20 +807,20 @@ void sns_sa1_device::write_regs(address_space &space, UINT32 offset, UINT8 data) } } -UINT8 sns_sa1_device::read_iram(UINT32 offset) +uint8_t sns_sa1_device::read_iram(uint32_t offset) { return m_internal_ram[offset & 0x7ff]; } -void sns_sa1_device::write_iram(UINT32 offset, UINT8 data) +void sns_sa1_device::write_iram(uint32_t offset, uint8_t data) { m_internal_ram[offset & 0x7ff] = data; } -UINT8 sns_sa1_device::read_bwram(UINT32 offset) +uint8_t sns_sa1_device::read_bwram(uint32_t offset) { int shift; - UINT8 mask; + uint8_t mask; if (m_nvram.empty()) return 0xff; // this should probably never happen, or are there SA-1 games with no BWRAM? @@ -850,9 +850,9 @@ UINT8 sns_sa1_device::read_bwram(UINT32 offset) return (m_nvram[offset & (m_nvram.size() - 1)] >> shift) & mask; } -void sns_sa1_device::write_bwram(UINT32 offset, UINT8 data) +void sns_sa1_device::write_bwram(uint32_t offset, uint8_t data) { - UINT8 mask; + uint8_t mask; if (m_nvram.empty()) return; // this should probably never happen, or are there SA-1 games with no BWRAM? @@ -973,7 +973,7 @@ WRITE8_MEMBER(sns_sa1_device::write_h) READ8_MEMBER( sns_sa1_device::chip_read ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000 && address >= 0x2200 && address < 0x2400) return read_regs(space, address & 0x1ff); // SA-1 Regs @@ -993,7 +993,7 @@ READ8_MEMBER( sns_sa1_device::chip_read ) WRITE8_MEMBER( sns_sa1_device::chip_write ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000 && address >= 0x2200 && address < 0x2400) write_regs(space, address & 0x1ff, data); // SA-1 Regs @@ -1019,7 +1019,7 @@ WRITE8_MEMBER( sns_sa1_device::chip_write ) READ8_MEMBER( sns_sa1_device::sa1_hi_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -1045,7 +1045,7 @@ READ8_MEMBER( sns_sa1_device::sa1_hi_r ) READ8_MEMBER( sns_sa1_device::sa1_lo_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -1099,7 +1099,7 @@ READ8_MEMBER( sns_sa1_device::sa1_lo_r ) WRITE8_MEMBER( sns_sa1_device::sa1_hi_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { if (address < 0x6000) diff --git a/src/devices/bus/snes/sa1.h b/src/devices/bus/snes/sa1.h index 5d0767340c5..bcd5b6503cc 100644 --- a/src/devices/bus/snes/sa1.h +++ b/src/devices/bus/snes/sa1.h @@ -14,7 +14,7 @@ class sns_sa1_device : public device_t, { public: // construction/destruction - sns_sa1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_sa1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -38,72 +38,72 @@ public: private: - UINT8 var_length_read(address_space &space, UINT32 offset); + uint8_t var_length_read(address_space &space, uint32_t offset); void dma_transfer(address_space &space); void dma_cctype1_transfer(address_space &space); void dma_cctype2_transfer(address_space &space); - UINT8 read_regs(address_space &space, UINT32 offset); - UINT8 read_iram(UINT32 offset); - UINT8 read_bwram(UINT32 offset); - void write_regs(address_space &space, UINT32 offset, UINT8 data); - void write_iram(UINT32 offset, UINT8 data); - void write_bwram(UINT32 offset, UINT8 data); + uint8_t read_regs(address_space &space, uint32_t offset); + uint8_t read_iram(uint32_t offset); + uint8_t read_bwram(uint32_t offset); + void write_regs(address_space &space, uint32_t offset, uint8_t data); + void write_iram(uint32_t offset, uint8_t data); + void write_bwram(uint32_t offset, uint8_t data); void recalc_irqs(); required_device m_sa1; - UINT8 m_internal_ram[0x800]; + uint8_t m_internal_ram[0x800]; // register related // $2200 - UINT8 m_sa1_ctrl; + uint8_t m_sa1_ctrl; // $2201 - UINT8 m_scpu_sie; + uint8_t m_scpu_sie; // $2203-$2208 - UINT16 m_sa1_reset, m_sa1_nmi, m_sa1_irq; + uint16_t m_sa1_reset, m_sa1_nmi, m_sa1_irq; // $2209 - UINT8 m_scpu_ctrl; + uint8_t m_scpu_ctrl; // $220a - UINT8 m_sa1_sie; + uint8_t m_sa1_sie; // $200c-$200d - S-CPU vectors - UINT16 m_irq_vector, m_nmi_vector; + uint16_t m_irq_vector, m_nmi_vector; // $2012-$2015 - UINT16 m_hcount, m_vcount; + uint16_t m_hcount, m_vcount; // $2220-$2223 int m_bank_c_hi, m_bank_c_rom; int m_bank_d_hi, m_bank_d_rom; int m_bank_e_hi, m_bank_e_rom; int m_bank_f_hi, m_bank_f_rom; // $2224-$2225 & $223f - UINT8 m_bwram_snes, m_bwram_sa1; + uint8_t m_bwram_snes, m_bwram_sa1; int m_bwram_sa1_source, m_bwram_sa1_format; // $2226-$2227 int m_bwram_write_snes, m_bwram_write_sa1; // $2228 - UINT32 m_bwpa_sa1; + uint32_t m_bwpa_sa1; // $2229-$222a - UINT8 m_iram_write_snes, m_iram_write_sa1; + uint8_t m_iram_write_snes, m_iram_write_sa1; // $2230-$2231 - UINT8 m_dma_ctrl, m_dma_ccparam; + uint8_t m_dma_ctrl, m_dma_ccparam; // $2232-$2237 - UINT32 m_src_addr, m_dst_addr; + uint32_t m_src_addr, m_dst_addr; // $2238-$2239 - UINT16 m_dma_cnt; + uint16_t m_dma_cnt; // $2240-$224f - UINT8 m_brf_reg[0x10]; + uint8_t m_brf_reg[0x10]; // $2250-$2254 - UINT8 m_math_ctlr, m_math_overflow; - UINT16 m_math_a, m_math_b; - UINT64 m_math_res; + uint8_t m_math_ctlr, m_math_overflow; + uint16_t m_math_a, m_math_b; + uint64_t m_math_res; // $2258-$225b - UINT32 m_vda; - UINT8 m_vbit, m_vlen; + uint32_t m_vda; + uint8_t m_vbit, m_vlen; int m_drm; // $2300-$2301 - UINT8 m_scpu_flags, m_sa1_flags; + uint8_t m_scpu_flags, m_sa1_flags; // $2302-$2305 - UINT16 m_hcr, m_vcr; + uint16_t m_hcr, m_vcr; }; diff --git a/src/devices/bus/snes/sdd1.cpp b/src/devices/bus/snes/sdd1.cpp index 9570b5110ad..e1f870d5ff4 100644 --- a/src/devices/bus/snes/sdd1.cpp +++ b/src/devices/bus/snes/sdd1.cpp @@ -20,15 +20,15 @@ // Input Manager -void SDD1_IM::IM_prepareDecomp(UINT32 in_buf) +void SDD1_IM::IM_prepareDecomp(uint32_t in_buf) { m_byte_ptr = in_buf; m_bit_count = 4; } -UINT8 SDD1_IM::IM_getCodeword(UINT8 *ROM, UINT32 *mmc, const UINT8 code_len) +uint8_t SDD1_IM::IM_getCodeword(uint8_t *ROM, uint32_t *mmc, const uint8_t code_len) { - UINT8 codeword = ROM[SSD1_ADD(m_byte_ptr)] << m_bit_count; + uint8_t codeword = ROM[SSD1_ADD(m_byte_ptr)] << m_bit_count; ++m_bit_count; @@ -49,9 +49,9 @@ UINT8 SDD1_IM::IM_getCodeword(UINT8 *ROM, UINT32 *mmc, const UINT8 code_len) // GCD -void SDD1_GCD::GCD_getRunCount(UINT8 *ROM, UINT32 *mmc, UINT8 code_num, UINT8* MPScount, UINT8* LPSind) +void SDD1_GCD::GCD_getRunCount(uint8_t *ROM, uint32_t *mmc, uint8_t code_num, uint8_t* MPScount, uint8_t* LPSind) { - const UINT8 run_count[] = + const uint8_t run_count[] = { 0x00, 0x00, 0x01, 0x00, 0x03, 0x01, 0x02, 0x00, 0x07, 0x03, 0x05, 0x01, 0x06, 0x02, 0x04, 0x00, @@ -87,7 +87,7 @@ void SDD1_GCD::GCD_getRunCount(UINT8 *ROM, UINT32 *mmc, UINT8 code_num, UINT8* M 0x70, 0x30, 0x50, 0x10, 0x60, 0x20, 0x40, 0x00, }; - UINT8 codeword = m_IM->IM_getCodeword(ROM, mmc, code_num); + uint8_t codeword = m_IM->IM_getCodeword(ROM, mmc, code_num); if (codeword & 0x80) { @@ -108,9 +108,9 @@ void SDD1_BG::BG_prepareDecomp() m_LPSind = 0; } -UINT8 SDD1_BG::BG_getBit(UINT8 *ROM, UINT32 *mmc, UINT8* endOfRun) +uint8_t SDD1_BG::BG_getBit(uint8_t *ROM, uint32_t *mmc, uint8_t* endOfRun) { - UINT8 bit; + uint8_t bit; if (!(m_MPScount || m_LPSind)) { @@ -144,9 +144,9 @@ UINT8 SDD1_BG::BG_getBit(UINT8 *ROM, UINT32 *mmc, UINT8* endOfRun) struct SDD1_PEM_state { - UINT8 code_num; - UINT8 nextIfMPS; - UINT8 nextIfLPS; + uint8_t code_num; + uint8_t nextIfMPS; + uint8_t nextIfLPS; }; static const SDD1_PEM_state PEM_evolution_table[33] = @@ -195,15 +195,15 @@ void SDD1_PEM::PEM_prepareDecomp() } } -UINT8 SDD1_PEM::PEM_getBit(UINT8 *ROM, UINT32 *mmc, UINT8 context) +uint8_t SDD1_PEM::PEM_getBit(uint8_t *ROM, uint32_t *mmc, uint8_t context) { - UINT8 endOfRun; - UINT8 bit; + uint8_t endOfRun; + uint8_t bit; SDD1_PEM_ContextInfo *pContInfo = &(m_contextInfo)[context]; - UINT8 currStatus = pContInfo->status; + uint8_t currStatus = pContInfo->status; const SDD1_PEM_state* pState = &(PEM_evolution_table[currStatus]); - UINT8 currentMPS = pContInfo->MPS; + uint8_t currentMPS = pContInfo->MPS; bit = m_BG[pState->code_num]->BG_getBit(ROM, mmc, &endOfRun); @@ -228,9 +228,9 @@ UINT8 SDD1_PEM::PEM_getBit(UINT8 *ROM, UINT32 *mmc, UINT8 context) // CM -void SDD1_CM::CM_prepareDecomp(UINT8 *ROM, UINT32 *mmc, UINT32 first_byte) +void SDD1_CM::CM_prepareDecomp(uint8_t *ROM, uint32_t *mmc, uint32_t first_byte) { - INT32 i = 0; + int32_t i = 0; m_bitplanesInfo = ROM[SSD1_ADD(first_byte)] & 0xc0; m_contextBitsInfo = ROM[SSD1_ADD(first_byte)] & 0x30; m_bit_number = 0; @@ -252,11 +252,11 @@ void SDD1_CM::CM_prepareDecomp(UINT8 *ROM, UINT32 *mmc, UINT32 first_byte) } } -UINT8 SDD1_CM::CM_getBit(UINT8 *ROM, UINT32 *mmc) +uint8_t SDD1_CM::CM_getBit(uint8_t *ROM, uint32_t *mmc) { - UINT8 currContext; - UINT16 *context_bits; - UINT8 bit; + uint8_t currContext; + uint16_t *context_bits; + uint8_t bit; switch (m_bitplanesInfo) { @@ -309,17 +309,17 @@ UINT8 SDD1_CM::CM_getBit(UINT8 *ROM, UINT32 *mmc) // OL -void SDD1_OL::OL_prepareDecomp(UINT8 *ROM, UINT32 *mmc, UINT32 first_byte, UINT16 out_len, UINT8 *out_buf) +void SDD1_OL::OL_prepareDecomp(uint8_t *ROM, uint32_t *mmc, uint32_t first_byte, uint16_t out_len, uint8_t *out_buf) { m_bitplanesInfo = ROM[SSD1_ADD(first_byte)] & 0xc0; m_length = out_len; m_buffer = out_buf; } -void SDD1_OL::OL_launch(UINT8 *ROM, UINT32 *mmc) +void SDD1_OL::OL_launch(uint8_t *ROM, uint32_t *mmc) { - UINT8 i; - UINT8 register1, register2 = 0; + uint8_t i; + uint8_t register1, register2 = 0; switch (m_bitplanesInfo) { @@ -385,7 +385,7 @@ SDD1_emu::SDD1_emu(running_machine &machine) m_OL = std::make_unique(m_CM.get()); } -void SDD1_emu::SDD1emu_decompress(UINT8 *ROM, UINT32 *mmc, UINT32 in_buf, UINT16 out_len, UINT8 *out_buf) +void SDD1_emu::SDD1emu_decompress(uint8_t *ROM, uint32_t *mmc, uint32_t in_buf, uint16_t out_len, uint8_t *out_buf) { m_IM->IM_prepareDecomp(in_buf); m_BG0->BG_prepareDecomp(); @@ -411,13 +411,13 @@ void SDD1_emu::SDD1emu_decompress(UINT8 *ROM, UINT32 *mmc, UINT32 in_buf, UINT16 const device_type SNS_LOROM_SDD1 = &device_creator; -sns_rom_sdd1_device::sns_rom_sdd1_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) +sns_rom_sdd1_device::sns_rom_sdd1_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_sns_cart_interface( mconfig, *this ), m_sdd1_enable(0), m_xfer_enable(0), m_sdd1emu(nullptr) { } -sns_rom_sdd1_device::sns_rom_sdd1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_sdd1_device::sns_rom_sdd1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNS_LOROM_SDD1, "SNES Cart + S-DD1", tag, owner, clock, "sns_rom_sdd1", __FILE__), device_sns_cart_interface( mconfig, *this ), m_sdd1_enable(0), m_xfer_enable(0), m_sdd1emu(nullptr) { @@ -428,7 +428,7 @@ void sns_rom_sdd1_device::device_start() { m_sdd1emu = std::make_unique(machine()); - m_buffer.data = std::make_unique(0x10000); + m_buffer.data = std::make_unique(0x10000); m_buffer.ready = 0; save_item(NAME(m_sdd1_enable)); @@ -472,7 +472,7 @@ void sns_rom_sdd1_device::device_reset() READ8_MEMBER( sns_rom_sdd1_device::chip_read ) { - UINT16 addr = offset & 0xffff; + uint16_t addr = offset & 0xffff; switch (addr) { @@ -493,11 +493,11 @@ READ8_MEMBER( sns_rom_sdd1_device::chip_read ) WRITE8_MEMBER( sns_rom_sdd1_device::chip_write ) { - UINT16 addr = offset & 0xffff; + uint16_t addr = offset & 0xffff; if ((addr & 0x4380) == 0x4300) { - UINT8 channel = (addr >> 4) & 7; + uint8_t channel = (addr >> 4) & 7; switch(addr & 0xf) { case 2: @@ -545,7 +545,7 @@ WRITE8_MEMBER( sns_rom_sdd1_device::chip_write ) } -UINT8 sns_rom_sdd1_device::read_helper(UINT32 addr) +uint8_t sns_rom_sdd1_device::read_helper(uint32_t addr) { if (m_sdd1_enable & m_xfer_enable) { @@ -557,7 +557,7 @@ UINT8 sns_rom_sdd1_device::read_helper(UINT32 addr) // S-DD1 always uses fixed transfer mode, so address will not change during transfer if ((addr + 0xc00000) == m_dma[i].addr) { - UINT8 data; + uint8_t data; if (!m_buffer.ready) { // first byte read for channel performs full decompression. @@ -573,7 +573,7 @@ UINT8 sns_rom_sdd1_device::read_helper(UINT32 addr) } // fetch a decompressed byte; once buffer is depleted, disable channel and invalidate buffer - data = m_buffer.data[(UINT16)m_buffer.offset++]; + data = m_buffer.data[(uint16_t)m_buffer.offset++]; if (m_buffer.offset >= m_buffer.size) { m_buffer.ready = 0; diff --git a/src/devices/bus/snes/sdd1.h b/src/devices/bus/snes/sdd1.h index e9dcc9e71e1..244c552f101 100644 --- a/src/devices/bus/snes/sdd1.h +++ b/src/devices/bus/snes/sdd1.h @@ -15,11 +15,11 @@ public: m_bit_count(0) { } - UINT32 m_byte_ptr; - UINT8 m_bit_count; + uint32_t m_byte_ptr; + uint8_t m_bit_count; - void IM_prepareDecomp(UINT32 in_buf); - UINT8 IM_getCodeword(UINT8 *ROM, UINT32 *mmc, const UINT8 code_len); + void IM_prepareDecomp(uint32_t in_buf); + uint8_t IM_getCodeword(uint8_t *ROM, uint32_t *mmc, const uint8_t code_len); }; class SDD1_GCD //Golomb-Code Decoder @@ -30,13 +30,13 @@ public: SDD1_IM* m_IM; - void GCD_getRunCount(UINT8 *ROM, UINT32 *mmc, UINT8 code_num, UINT8* MPScount, UINT8* LPSind); + void GCD_getRunCount(uint8_t *ROM, uint32_t *mmc, uint8_t code_num, uint8_t* MPScount, uint8_t* LPSind); }; class SDD1_BG // Bits Generator { public: - SDD1_BG(SDD1_GCD* associatedGCD, UINT8 code) + SDD1_BG(SDD1_GCD* associatedGCD, uint8_t code) : m_code_num(code), m_MPScount(0), m_LPSind(0), @@ -44,19 +44,19 @@ public: { } - UINT8 m_code_num; - UINT8 m_MPScount; - UINT8 m_LPSind; + uint8_t m_code_num; + uint8_t m_MPScount; + uint8_t m_LPSind; SDD1_GCD* m_GCD; void BG_prepareDecomp(); - UINT8 BG_getBit(UINT8 *ROM, UINT32 *mmc, UINT8* endOfRun); + uint8_t BG_getBit(uint8_t *ROM, uint32_t *mmc, uint8_t* endOfRun); } ; struct SDD1_PEM_ContextInfo { - UINT8 status; - UINT8 MPS; + uint8_t status; + uint8_t MPS; }; class SDD1_PEM //Probability Estimation Module @@ -82,7 +82,7 @@ public: SDD1_BG* m_BG[8]; void PEM_prepareDecomp(); - UINT8 PEM_getBit(UINT8 *ROM, UINT32 *mmc, UINT8 context); + uint8_t PEM_getBit(uint8_t *ROM, uint32_t *mmc, uint8_t context); } ; @@ -92,15 +92,15 @@ public: SDD1_CM(SDD1_PEM* associatedPEM) : m_bitplanesInfo(0), m_contextBitsInfo(0), m_bit_number(0), m_currBitplane(0), m_PEM(associatedPEM) { } - UINT8 m_bitplanesInfo; - UINT8 m_contextBitsInfo; - UINT8 m_bit_number; - UINT8 m_currBitplane; - UINT16 m_prevBitplaneBits[8]; + uint8_t m_bitplanesInfo; + uint8_t m_contextBitsInfo; + uint8_t m_bit_number; + uint8_t m_currBitplane; + uint16_t m_prevBitplaneBits[8]; SDD1_PEM* m_PEM; - void CM_prepareDecomp(UINT8 *ROM, UINT32 *mmc, UINT32 first_byte); - UINT8 CM_getBit(UINT8 *ROM, UINT32 *mmc); + void CM_prepareDecomp(uint8_t *ROM, uint32_t *mmc, uint32_t first_byte); + uint8_t CM_getBit(uint8_t *ROM, uint32_t *mmc); } ; @@ -110,13 +110,13 @@ public: SDD1_OL(SDD1_CM* associatedCM) : m_bitplanesInfo(0), m_length(0), m_buffer(nullptr), m_CM(associatedCM) { } - UINT8 m_bitplanesInfo; - UINT16 m_length; - UINT8* m_buffer; + uint8_t m_bitplanesInfo; + uint16_t m_length; + uint8_t* m_buffer; SDD1_CM* m_CM; - void OL_prepareDecomp(UINT8 *ROM, UINT32 *mmc, UINT32 first_byte, UINT16 out_len, UINT8 *out_buf); - void OL_launch(UINT8 *ROM, UINT32 *mmc); + void OL_prepareDecomp(uint8_t *ROM, uint32_t *mmc, uint32_t first_byte, uint16_t out_len, uint8_t *out_buf); + void OL_launch(uint8_t *ROM, uint32_t *mmc); } ; class SDD1_emu @@ -140,7 +140,7 @@ public: std::unique_ptr m_CM; std::unique_ptr m_OL; - void SDD1emu_decompress(UINT8 *ROM, UINT32 *mmc, UINT32 in_buf, UINT16 out_len, UINT8 *out_buf); + void SDD1emu_decompress(uint8_t *ROM, uint32_t *mmc, uint32_t in_buf, uint16_t out_len, uint8_t *out_buf); private: running_machine& m_machine; @@ -155,8 +155,8 @@ class sns_rom_sdd1_device : public device_t, { public: // construction/destruction - sns_rom_sdd1_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); - sns_rom_sdd1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_sdd1_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); + sns_rom_sdd1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -170,26 +170,26 @@ public: virtual DECLARE_READ8_MEMBER(chip_read) override; virtual DECLARE_WRITE8_MEMBER(chip_write) override; - UINT8 read_helper(UINT32 offset); + uint8_t read_helper(uint32_t offset); - UINT8 m_sdd1_enable; // channel bit-mask - UINT8 m_xfer_enable; // channel bit-mask - UINT32 m_mmc[4]; // memory map controller ROM indices + uint8_t m_sdd1_enable; // channel bit-mask + uint8_t m_xfer_enable; // channel bit-mask + uint32_t m_mmc[4]; // memory map controller ROM indices struct { - UINT32 addr; // $43x2-$43x4 -- DMA transfer address - UINT16 size; // $43x5-$43x6 -- DMA transfer size + uint32_t addr; // $43x2-$43x4 -- DMA transfer address + uint16_t size; // $43x5-$43x6 -- DMA transfer size } m_dma[8]; std::unique_ptr m_sdd1emu; struct { - std::unique_ptr data; // pointer to decompressed S-DD1 data (65536 bytes) - UINT16 offset; // read index into S-DD1 decompression buffer - UINT32 size; // length of data buffer; reads decrement counter, set ready to false at 0 - UINT8 ready; // 1 when data[] is valid; 0 to invoke sdd1emu.decompress() + std::unique_ptr data; // pointer to decompressed S-DD1 data (65536 bytes) + uint16_t offset; // read index into S-DD1 decompression buffer + uint32_t size; // length of data buffer; reads decrement counter, set ready to false at 0 + uint8_t ready; // 1 when data[] is valid; 0 to invoke sdd1emu.decompress() } m_buffer; }; diff --git a/src/devices/bus/snes/sfx.cpp b/src/devices/bus/snes/sfx.cpp index 9fce31d00db..e44042de962 100644 --- a/src/devices/bus/snes/sfx.cpp +++ b/src/devices/bus/snes/sfx.cpp @@ -18,7 +18,7 @@ const device_type SNS_LOROM_SUPERFX = &device_creator; -sns_rom_superfx_device::sns_rom_superfx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_superfx_device::sns_rom_superfx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_SUPERFX, "SNES Cart (LoROM) + SuperFX", tag, owner, clock, "sns_rom_superfx", __FILE__), m_superfx(*this, "superfx") { @@ -124,7 +124,7 @@ READ8_MEMBER(sns_rom_superfx_device::read_h) } else { - static const UINT8 sfx_data[16] = { + static const uint8_t sfx_data[16] = { 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x01, 0x08, 0x01, 0x00, 0x01, 0x0c, 0x01, }; diff --git a/src/devices/bus/snes/sfx.h b/src/devices/bus/snes/sfx.h index 785a68bb827..678b09b5e1c 100644 --- a/src/devices/bus/snes/sfx.h +++ b/src/devices/bus/snes/sfx.h @@ -14,7 +14,7 @@ class sns_rom_superfx_device : public sns_rom_device { public: // construction/destruction - sns_rom_superfx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_superfx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -40,7 +40,7 @@ public: virtual DECLARE_WRITE_LINE_MEMBER(snes_extern_irq_w); - UINT8 sfx_ram[0x200000]; + uint8_t sfx_ram[0x200000]; }; diff --git a/src/devices/bus/snes/sgb.cpp b/src/devices/bus/snes/sgb.cpp index 5a2888a8294..d61281952b6 100644 --- a/src/devices/bus/snes/sgb.cpp +++ b/src/devices/bus/snes/sgb.cpp @@ -23,7 +23,7 @@ const device_type SNS_LOROM_SUPERGB = &device_creator; const device_type SNS_LOROM_SUPERGB2 = &device_creator; -sns_rom_sgb_device::sns_rom_sgb_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) +sns_rom_sgb_device::sns_rom_sgb_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) : sns_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_sgb_cpu(*this, "sgb_cpu"), m_sgb_apu(*this, "sgb_apu"), @@ -47,13 +47,13 @@ sns_rom_sgb_device::sns_rom_sgb_device(const machine_config &mconfig, device_typ } -sns_rom_sgb1_device::sns_rom_sgb1_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) : +sns_rom_sgb1_device::sns_rom_sgb1_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : sns_rom_sgb_device(mconfig, SNS_LOROM_SUPERGB, "SNES Super Game Boy Cart", tag, owner, clock, "sns_rom_sgb", __FILE__) { } -sns_rom_sgb2_device::sns_rom_sgb2_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) : +sns_rom_sgb2_device::sns_rom_sgb2_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : sns_rom_sgb_device(mconfig, SNS_LOROM_SUPERGB2, "SNES Super Game Boy 2 Cart", tag, owner, clock, "sns_rom_sgb2", __FILE__) { } @@ -242,7 +242,7 @@ READ8_MEMBER(sns_rom_sgb_device::read_h) READ8_MEMBER( sns_rom_sgb_device::chip_read ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; //LY counter if (address == 0x6000) @@ -284,7 +284,7 @@ READ8_MEMBER( sns_rom_sgb_device::chip_read ) //VRAM port if (address == 0x7800) { - UINT8 data = m_lcd_output[m_vram_offs]; + uint8_t data = m_lcd_output[m_vram_offs]; m_vram_offs = (m_vram_offs + 1) % 320; return data; } @@ -292,16 +292,16 @@ READ8_MEMBER( sns_rom_sgb_device::chip_read ) return 0x00; // this should never happen? } -void sns_rom_sgb_device::lcd_render(UINT32 *source) +void sns_rom_sgb_device::lcd_render(uint32_t *source) { - memset(m_lcd_output, 0x00, 320 * sizeof(UINT16)); + memset(m_lcd_output, 0x00, 320 * sizeof(uint16_t)); for (int y = 0; y < 8; y++) { for (int x = 0; x < 160; x++) { - UINT32 pixel = *source++; - UINT16 addr = y * 2 + (x / 8 * 16); + uint32_t pixel = *source++; + uint16_t addr = y * 2 + (x / 8 * 16); m_lcd_output[addr + 0] |= ((pixel & 1) >> 0) << (7 - (x & 7)); m_lcd_output[addr + 1] |= ((pixel & 2) >> 1) << (7 - (x & 7)); } @@ -310,7 +310,7 @@ void sns_rom_sgb_device::lcd_render(UINT32 *source) WRITE8_MEMBER( sns_rom_sgb_device::chip_write ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; //VRAM port if (address == 0x6001) @@ -318,7 +318,7 @@ WRITE8_MEMBER( sns_rom_sgb_device::chip_write ) m_vram = data; m_vram_offs = 0; - UINT8 offset = (m_sgb_row - (4 - (m_vram - (m_sgb_ly & 3)))) & 3; + uint8_t offset = (m_sgb_row - (4 - (m_vram - (m_sgb_ly & 3)))) & 3; lcd_render(m_lcd_buffer + offset * 160 * 8); return; diff --git a/src/devices/bus/snes/sgb.h b/src/devices/bus/snes/sgb.h index dc959109923..44e6f2ac9c4 100644 --- a/src/devices/bus/snes/sgb.h +++ b/src/devices/bus/snes/sgb.h @@ -20,7 +20,7 @@ class sns_rom_sgb_device : public sns_rom_device { public: // construction/destruction - sns_rom_sgb_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); + sns_rom_sgb_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-level overrides virtual void device_start() override; @@ -51,25 +51,25 @@ protected: required_device m_cartslot; required_memory_region m_region_bios; - void lcd_render(UINT32 *source); + void lcd_render(uint32_t *source); // ICD2 regs - UINT8 m_sgb_ly; - UINT8 m_sgb_row; - UINT8 m_vram; - UINT8 m_port; - UINT8 m_joy1, m_joy2, m_joy3, m_joy4; - UINT8 m_joy_pckt[16]; - UINT16 m_vram_offs; - UINT8 m_mlt_req; - - UINT32 m_lcd_buffer[4 * 160 * 8]; - UINT16 m_lcd_output[320]; - UINT16 m_lcd_row; + uint8_t m_sgb_ly; + uint8_t m_sgb_row; + uint8_t m_vram; + uint8_t m_port; + uint8_t m_joy1, m_joy2, m_joy3, m_joy4; + uint8_t m_joy_pckt[16]; + uint16_t m_vram_offs; + uint8_t m_mlt_req; + + uint32_t m_lcd_buffer[4 * 160 * 8]; + uint16_t m_lcd_output[320]; + uint16_t m_lcd_row; // input bits int m_packetsize; - UINT8 m_packet_data[64][16]; + uint8_t m_packet_data[64][16]; bool m_bios_disabled; }; @@ -79,7 +79,7 @@ class sns_rom_sgb1_device : public sns_rom_sgb_device { public: // construction/destruction - sns_rom_sgb1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_sgb1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -91,7 +91,7 @@ class sns_rom_sgb2_device : public sns_rom_sgb_device { public: // construction/destruction - sns_rom_sgb2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_sgb2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/snes/snes_slot.cpp b/src/devices/bus/snes/snes_slot.cpp index c70a1cac664..ae553a7f612 100644 --- a/src/devices/bus/snes/snes_slot.cpp +++ b/src/devices/bus/snes/snes_slot.cpp @@ -88,7 +88,7 @@ device_sns_cart_interface::~device_sns_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_sns_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_sns_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -102,7 +102,7 @@ void device_sns_cart_interface::rom_alloc(UINT32 size, const char *tag) // nvram_alloc - alloc the space for the nvram //------------------------------------------------- -void device_sns_cart_interface::nvram_alloc(UINT32 size) +void device_sns_cart_interface::nvram_alloc(uint32_t size) { m_nvram.resize(size); } @@ -115,7 +115,7 @@ void device_sns_cart_interface::nvram_alloc(UINT32 size) // saved by the device itself) //------------------------------------------------- -void device_sns_cart_interface::rtc_ram_alloc(UINT32 size) +void device_sns_cart_interface::rtc_ram_alloc(uint32_t size) { m_rtc_ram.resize(size); } @@ -126,7 +126,7 @@ void device_sns_cart_interface::rtc_ram_alloc(UINT32 size) // (optional) add-on CPU bios //------------------------------------------------- -void device_sns_cart_interface::addon_bios_alloc(UINT32 size) +void device_sns_cart_interface::addon_bios_alloc(uint32_t size) { m_bios.resize(size); } @@ -137,7 +137,7 @@ void device_sns_cart_interface::addon_bios_alloc(UINT32 size) // blocks, so to simplify ROM access //------------------------------------------------- -void device_sns_cart_interface::rom_map_setup(UINT32 size) +void device_sns_cart_interface::rom_map_setup(uint32_t size) { int i; // setup the rom_bank_map array to faster ROM read @@ -172,7 +172,7 @@ void device_sns_cart_interface::rom_map_setup(UINT32 size) //------------------------------------------------- // base_sns_cart_slot_device - constructor //------------------------------------------------- -base_sns_cart_slot_device::base_sns_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +base_sns_cart_slot_device::base_sns_cart_slot_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_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -181,17 +181,17 @@ base_sns_cart_slot_device::base_sns_cart_slot_device(const machine_config &mconf { } -sns_cart_slot_device::sns_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sns_cart_slot_device::sns_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : base_sns_cart_slot_device(mconfig, SNS_CART_SLOT, "SNES Cartridge Slot", tag, owner, clock, "sns_cart_slot", __FILE__) { } -sns_sufami_cart_slot_device::sns_sufami_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sns_sufami_cart_slot_device::sns_sufami_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : base_sns_cart_slot_device(mconfig, SNS_SUFAMI_CART_SLOT, "SNES Sufami Turbo Cartridge Slot", tag, owner, clock, "sns_sufami_cart_slot", __FILE__) { } -sns_bsx_cart_slot_device::sns_bsx_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sns_bsx_cart_slot_device::sns_bsx_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : base_sns_cart_slot_device(mconfig, SNS_BSX_CART_SLOT, "SNES BS-X Cartridge Slot", tag, owner, clock, "sns_bsx_cart_slot", __FILE__) { } @@ -320,10 +320,10 @@ static const char *sns_get_slot(int type) /* Here we add a couple of cart utilities, to avoid duplicating the code in each DEVICE_IMAGE_LOAD */ -UINT32 base_sns_cart_slot_device::snes_skip_header( UINT8 *ROM, UINT32 rom_size ) +uint32_t base_sns_cart_slot_device::snes_skip_header( uint8_t *ROM, uint32_t rom_size ) { - UINT8 header[512]; - UINT32 offset = 512; + uint8_t header[512]; + uint32_t offset = 512; /* Check for a header (512 bytes) */ memcpy(header, ROM, 512); @@ -357,14 +357,14 @@ UINT32 base_sns_cart_slot_device::snes_skip_header( UINT8 *ROM, UINT32 rom_size /* This function assign a 'score' to data immediately after 'offset' to measure how valid they are as information block (to decide if the image is HiRom, LoRom, ExLoRom or ExHiRom) */ /* Code from bsnes, courtesy of byuu - http://byuu.org/ , based on previous code by Cowering */ -static int snes_validate_infoblock( UINT8 *infoblock, UINT32 offset ) +static int snes_validate_infoblock( uint8_t *infoblock, uint32_t offset ) { int score = 0; - UINT16 reset_vector = infoblock[offset + 0x3c] | (infoblock[offset + 0x3d] << 8); - UINT16 checksum = infoblock[offset + 0x1e] | (infoblock[offset + 0x1f] << 8); - UINT16 ichecksum = infoblock[offset + 0x1c] | (infoblock[offset + 0x1d] << 8); - UINT8 reset_opcode = infoblock[(offset & ~0x7fff) | (reset_vector & 0x7fff)]; //first opcode executed upon reset - UINT8 mapper = infoblock[offset + 0x15] & ~0x10; //mask off irrelevant FastROM-capable bit + uint16_t reset_vector = infoblock[offset + 0x3c] | (infoblock[offset + 0x3d] << 8); + uint16_t checksum = infoblock[offset + 0x1e] | (infoblock[offset + 0x1f] << 8); + uint16_t ichecksum = infoblock[offset + 0x1c] | (infoblock[offset + 0x1d] << 8); + uint8_t reset_opcode = infoblock[(offset & ~0x7fff) | (reset_vector & 0x7fff)]; //first opcode executed upon reset + uint8_t mapper = infoblock[offset + 0x15] & ~0x10; //mask off irrelevant FastROM-capable bit /* $00:[000-7fff] contains uninitialized RAM and MMIO. reset vector must point to ROM at $00:[8000-ffff] to be considered valid. */ @@ -466,12 +466,12 @@ static int snes_validate_infoblock( UINT8 *infoblock, UINT32 offset ) /* This determines if a cart is in Mode 20, 21, 22 or 25; sets state->m_cart[0].mode and state->m_cart[0].sram accordingly; and returns the offset of the internal header (needed to detect BSX and ST carts) */ -static UINT32 snes_find_hilo_mode(device_t *device, UINT8 *buffer, UINT32 buf_len ) +static uint32_t snes_find_hilo_mode(device_t *device, uint8_t *buffer, uint32_t buf_len ) { - UINT8 valid_mode20 = 0; - UINT8 valid_mode21 = 0; - UINT8 valid_mode25 = 0; - UINT32 retvalue; + uint8_t valid_mode20 = 0; + uint8_t valid_mode21 = 0; + uint8_t valid_mode25 = 0; + uint32_t retvalue; /* Now to determine if this is a lo-ROM, a hi-ROM or an extended lo/hi-ROM */ if (buf_len > 0x007fc0) @@ -502,7 +502,7 @@ static UINT32 snes_find_hilo_mode(device_t *device, UINT8 *buffer, UINT32 buf_le } -static int snes_find_addon_chip( UINT8 *buffer, UINT32 start_offs ) +static int snes_find_addon_chip( uint8_t *buffer, uint32_t start_offs ) { /* Info mostly taken from http://snesemu.black-ship.net/misc/hardware/-from%20nsrt.edgeemu.com-chipinfo.htm */ switch (buffer[start_offs + 0x16]) @@ -604,15 +604,15 @@ image_init_result base_sns_cart_slot_device::call_load() { if (m_cart) { - UINT8 *ROM; - UINT32 len, offset = 0; + uint8_t *ROM; + uint32_t len, offset = 0; const char *slot_name; /* Check for a header (512 bytes), and skip it if found */ if (software_entry() == nullptr) { - UINT32 tmplen = length(); - std::vector tmpROM(tmplen); + uint32_t tmplen = length(); + std::vector tmpROM(tmplen); fread(&tmpROM[0], tmplen); offset = snes_skip_header(&tmpROM[0], tmplen); fseek(offset, SEEK_SET); @@ -664,8 +664,8 @@ image_init_result base_sns_cart_slot_device::call_load() if (m_cart->get_nvram_size() || m_cart->get_rtc_ram_size()) { - UINT32 tot_size = m_cart->get_nvram_size() + m_cart->get_rtc_ram_size(); - std::vector temp_nvram(tot_size); + uint32_t tot_size = m_cart->get_nvram_size() + m_cart->get_rtc_ram_size(); + std::vector temp_nvram(tot_size); battery_load(&temp_nvram[0], tot_size, 0xff); if (m_cart->get_nvram_size()) memcpy(m_cart->get_nvram_base(), &temp_nvram[0], m_cart->get_nvram_size()); @@ -694,8 +694,8 @@ void base_sns_cart_slot_device::call_unload() { if (m_cart->get_nvram_size() || m_cart->get_rtc_ram_size()) { - UINT32 tot_size = m_cart->get_nvram_size() + m_cart->get_rtc_ram_size(); - std::vector temp_nvram(tot_size); + uint32_t tot_size = m_cart->get_nvram_size() + m_cart->get_rtc_ram_size(); + std::vector temp_nvram(tot_size); if (m_cart->get_nvram_size()) memcpy(&temp_nvram[0], m_cart->get_nvram_base(), m_cart->get_nvram_size()); if (m_cart->get_rtc_ram_size()) @@ -797,7 +797,7 @@ void base_sns_cart_slot_device::setup_addon_from_fullpath() if (!m_cart->get_addon_bios_size()) { std::string region = std::string(m_cart->device().tag()).append(":addon"); - UINT8 *ROM; + uint8_t *ROM; switch (m_addon) { @@ -843,15 +843,15 @@ void base_sns_cart_slot_device::setup_addon_from_fullpath() void base_sns_cart_slot_device::setup_nvram() { - UINT8 *ROM = (UINT8 *)m_cart->get_rom_base(); - UINT32 size = 0; + uint8_t *ROM = (uint8_t *)m_cart->get_rom_base(); + uint32_t size = 0; if (software_entry() == nullptr) { int hilo_mode = snes_find_hilo_mode(this, ROM, m_cart->get_rom_size()); - UINT8 sram_size = (m_type == SNES_SFX) ? (ROM[0x00ffbd] & 0x07) : (ROM[hilo_mode + 0x18] & 0x07); + uint8_t sram_size = (m_type == SNES_SFX) ? (ROM[0x00ffbd] & 0x07) : (ROM[hilo_mode + 0x18] & 0x07); if (sram_size) { - UINT32 max = (hilo_mode == 0x007fc0) ? 0x80000 : 0x20000; // MODE20 vs MODE21 + uint32_t max = (hilo_mode == 0x007fc0) ? 0x80000 : 0x20000; // MODE20 vs MODE21 size = 1024 << sram_size; if (size > max) size = max; @@ -880,7 +880,7 @@ void base_sns_cart_slot_device::setup_nvram() -void base_sns_cart_slot_device::get_cart_type_addon(UINT8 *ROM, UINT32 len, int &type, int &addon) +void base_sns_cart_slot_device::get_cart_type_addon(uint8_t *ROM, uint32_t len, int &type, int &addon) { // First, look if the cart is HiROM or LoROM (and set snes_cart accordingly) int hilo_mode = snes_find_hilo_mode(this,ROM, len); @@ -913,7 +913,7 @@ void base_sns_cart_slot_device::get_cart_type_addon(UINT8 *ROM, UINT32 len, int // Detect BS-X Flash Cart if ((ROM[hilo_mode + 0x13] == 0x00 || ROM[hilo_mode + 0x13] == 0xff) && ROM[hilo_mode + 0x14] == 0x00) { - UINT8 n15 = ROM[hilo_mode + 0x15]; + uint8_t n15 = ROM[hilo_mode + 0x15]; if (n15 == 0x00 || n15 == 0x80 || n15 == 0x84 || n15 == 0x9c || n15 == 0xbc || n15 == 0xfc) { if (ROM[hilo_mode + 0x1a] == 0x33 || ROM[hilo_mode + 0x1a] == 0xff) @@ -996,9 +996,9 @@ std::string base_sns_cart_slot_device::get_default_card_software() if (fullpath) { const char *slot_string; - UINT32 offset; - UINT32 len = m_file->size(); - std::vector rom(len); + uint32_t offset; + uint32_t len = m_file->size(); + std::vector rom(len); int type = 0, addon = 0; m_file->read(&rom[0], len); @@ -1151,7 +1151,7 @@ static int char_to_int_conv( char id ) #define UNK "UNKNOWN" -void base_sns_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) +void base_sns_cart_slot_device::internal_header_logging(uint8_t *ROM, uint32_t len) { static const char *const cart_types[] = { @@ -1270,7 +1270,7 @@ void base_sns_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) // Detect BS-X Flash Cart if ((ROM[hilo_mode + 0x13] == 0x00 || ROM[hilo_mode + 0x13] == 0xff) && ROM[hilo_mode + 0x14] == 0x00) { - UINT8 n15 = ROM[hilo_mode + 0x15]; + uint8_t n15 = ROM[hilo_mode + 0x15]; if (n15 == 0x00 || n15 == 0x80 || n15 == 0x84 || n15 == 0x9c || n15 == 0xbc || n15 == 0xfc) { if (ROM[hilo_mode + 0x1a] == 0x33 || ROM[hilo_mode + 0x1a] == 0xff) diff --git a/src/devices/bus/snes/snes_slot.h b/src/devices/bus/snes/snes_slot.h index c86595d3557..3e7823aec9c 100644 --- a/src/devices/bus/snes/snes_slot.h +++ b/src/devices/bus/snes/snes_slot.h @@ -116,31 +116,31 @@ public: virtual DECLARE_WRITE8_MEMBER(chip_write) {} virtual void speedup_addon_bios_access() {}; - void rom_alloc(UINT32 size, const char *tag); - void nvram_alloc(UINT32 size); - void rtc_ram_alloc(UINT32 size); - void addon_bios_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; }; - UINT8* get_nvram_base() { return &m_nvram[0]; }; - UINT8* get_addon_bios_base() { return &m_bios[0]; }; - UINT8* get_rtc_ram_base() { return &m_rtc_ram[0]; }; - UINT32 get_rom_size() { return m_rom_size; }; - UINT32 get_nvram_size() { return m_nvram.size(); }; - UINT32 get_addon_bios_size() { return m_bios.size(); }; - UINT32 get_rtc_ram_size() { return m_rtc_ram.size(); }; - - void rom_map_setup(UINT32 size); + void rom_alloc(uint32_t size, const char *tag); + void nvram_alloc(uint32_t size); + void rtc_ram_alloc(uint32_t size); + void addon_bios_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; }; + uint8_t* get_nvram_base() { return &m_nvram[0]; }; + uint8_t* get_addon_bios_base() { return &m_bios[0]; }; + uint8_t* get_rtc_ram_base() { return &m_rtc_ram[0]; }; + uint32_t get_rom_size() { return m_rom_size; }; + uint32_t get_nvram_size() { return m_nvram.size(); }; + uint32_t get_addon_bios_size() { return m_bios.size(); }; + uint32_t get_rtc_ram_size() { return m_rtc_ram.size(); }; + + void rom_map_setup(uint32_t size); void save_nvram() { device().save_item(NAME(m_nvram)); } void save_rtc_ram() { device().save_item(NAME(m_rtc_ram)); } // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_nvram; - std::vector m_bios; - std::vector m_rtc_ram; // temp pointer to save RTC ram to nvram (will disappear when RTCs become devices) + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_nvram; + std::vector m_bios; + std::vector m_rtc_ram; // temp pointer to save RTC ram to nvram (will disappear when RTCs become devices) - UINT8 rom_bank_map[256]; // 32K chunks of rom + uint8_t rom_bank_map[256]; // 32K chunks of rom }; @@ -152,7 +152,7 @@ class base_sns_cart_slot_device : public device_t, { public: // construction/destruction - base_sns_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + base_sns_cart_slot_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 ~base_sns_cart_slot_device(); // device-level overrides @@ -164,12 +164,12 @@ public: virtual void call_unload() override; virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } - void get_cart_type_addon(UINT8 *ROM, UINT32 len, int &type, int &addon); - UINT32 snes_skip_header(UINT8 *ROM, UINT32 snes_rom_size); + void get_cart_type_addon(uint8_t *ROM, uint32_t len, int &type, int &addon); + uint32_t snes_skip_header(uint8_t *ROM, uint32_t snes_rom_size); int get_type() { return m_type; } void setup_nvram(); - void internal_header_logging(UINT8 *ROM, UINT32 len); + void internal_header_logging(uint8_t *ROM, uint32_t len); void save_ram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); if (m_cart && m_cart->get_rtc_ram_size()) m_cart->save_rtc_ram(); } @@ -217,7 +217,7 @@ class sns_cart_slot_device : public base_sns_cart_slot_device { public: // construction/destruction - sns_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const char *image_interface() const override { return "snes_cart"; } virtual const char *file_extensions() const override { return "sfc"; } }; @@ -228,7 +228,7 @@ class sns_sufami_cart_slot_device : public base_sns_cart_slot_device { public: // construction/destruction - sns_sufami_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_sufami_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const char *image_interface() const override { return "st_cart"; } virtual const char *file_extensions() const override { return "st"; } virtual bool must_be_loaded() const override { return 0; } @@ -240,7 +240,7 @@ class sns_bsx_cart_slot_device : public base_sns_cart_slot_device { public: // construction/destruction - sns_bsx_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_bsx_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const char *image_interface() const override { return "bspack"; } virtual const char *file_extensions() const override { return "bs"; } virtual bool must_be_loaded() const override { return 0; } diff --git a/src/devices/bus/snes/spc7110.cpp b/src/devices/bus/snes/spc7110.cpp index b9b0ee77cd3..03cea5805e0 100644 --- a/src/devices/bus/snes/spc7110.cpp +++ b/src/devices/bus/snes/spc7110.cpp @@ -24,7 +24,7 @@ const device_type SNS_HIROM_SPC7110 = &device_creator; const device_type SNS_HIROM_SPC7110_RTC = &device_creator; -sns_rom_spc7110_device::sns_rom_spc7110_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) +sns_rom_spc7110_device::sns_rom_spc7110_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) : sns_rom21_device(mconfig, type, name, tag, owner, clock, shortname, source), m_r4801(0), m_r4802(0), m_r4803(0), m_r4804(0), m_r4805(0), m_r4806(0), m_r4807(0), m_r4808(0), m_r4809(0), m_r480a(0), m_r480b(0), m_r480c(0), m_decomp(nullptr), m_r4811(0), m_r4812(0), m_r4813(0), m_r4814(0), m_r4815(0), m_r4816(0), m_r4817(0), m_r4818(0), m_r481x(0), m_r4814_latch(0), m_r4815_latch(0), m_r4820(0), m_r4821(0), m_r4822(0), m_r4823(0), m_r4824(0), m_r4825(0), m_r4826(0), m_r4827(0), m_r4828(0), m_r4829(0), m_r482a(0), @@ -33,7 +33,7 @@ sns_rom_spc7110_device::sns_rom_spc7110_device(const machine_config &mconfig, de { } -sns_rom_spc7110_device::sns_rom_spc7110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_spc7110_device::sns_rom_spc7110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom21_device(mconfig, SNS_HIROM_SPC7110, "SNES Cart + SPC-7110", tag, owner, clock, "sns_rom_spc7110", __FILE__), m_r4801(0), m_r4802(0), m_r4803(0), m_r4804(0), m_r4805(0), m_r4806(0), m_r4807(0), m_r4808(0), m_r4809(0), m_r480a(0), m_r480b(0), m_r480c(0), m_decomp(nullptr), m_r4811(0), m_r4812(0), m_r4813(0), m_r4814(0), m_r4815(0), m_r4816(0), m_r4817(0), m_r4818(0), m_r481x(0), m_r4814_latch(0), m_r4815_latch(0), m_r4820(0), m_r4821(0), m_r4822(0), m_r4823(0), m_r4824(0), m_r4825(0), m_r4826(0), m_r4827(0), m_r4828(0), m_r4829(0), m_r482a(0), @@ -42,7 +42,7 @@ sns_rom_spc7110_device::sns_rom_spc7110_device(const machine_config &mconfig, co { } -sns_rom_spc7110rtc_device::sns_rom_spc7110rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_spc7110rtc_device::sns_rom_spc7110rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_spc7110_device(mconfig, SNS_HIROM_SPC7110_RTC, "SNES Cart + SPC-7110 + RTC", tag, owner, clock, "sns_rom_spc7110rtc", __FILE__) { } @@ -196,7 +196,7 @@ void sns_rom_spc7110rtc_device::device_start() #define SPC7110_DECOMP_BUFFER_SIZE 64 -static const UINT8 spc7110_evolution_table[53][4] = +static const uint8_t spc7110_evolution_table[53][4] = { { 0x5a, 1, 1, 1 }, { 0x25, 6, 2, 0 }, @@ -257,7 +257,7 @@ static const UINT8 spc7110_evolution_table[53][4] = { 0x37, 51, 43, 0 }, }; -static const UINT8 spc7110_mode2_context_table[32][2] = +static const uint8_t spc7110_mode2_context_table[32][2] = { { 1, 2 }, @@ -300,7 +300,7 @@ static const UINT8 spc7110_mode2_context_table[32][2] = SPC7110_Decomp::SPC7110_Decomp(running_machine &machine) : m_machine(machine) { - m_decomp_buffer = std::make_unique(SPC7110_DECOMP_BUFFER_SIZE); + m_decomp_buffer = std::make_unique(SPC7110_DECOMP_BUFFER_SIZE); reset(); for (int i = 0; i < 256; i++) @@ -379,7 +379,7 @@ void SPC7110_Decomp::reset() m_decomp_buffer_length = 0; } -void SPC7110_Decomp::init(running_machine &machine, UINT8 *ROM, UINT32 len, UINT32 mode, UINT32 offset, UINT32 index) +void SPC7110_Decomp::init(running_machine &machine, uint8_t *ROM, uint32_t len, uint32_t mode, uint32_t offset, uint32_t index) { m_decomp_mode = mode; m_decomp_offset = offset; @@ -409,9 +409,9 @@ void SPC7110_Decomp::init(running_machine &machine, UINT8 *ROM, UINT32 len, UINT } } -UINT8 SPC7110_Decomp::read(UINT8 *ROM, UINT32 len) +uint8_t SPC7110_Decomp::read(uint8_t *ROM, uint32_t len) { - UINT8 data; + uint8_t data; if (m_decomp_buffer_length == 0) { @@ -441,16 +441,16 @@ UINT8 SPC7110_Decomp::read(UINT8 *ROM, UINT32 len) return data; } -void SPC7110_Decomp::write(UINT8 data) +void SPC7110_Decomp::write(uint8_t data) { m_decomp_buffer[m_decomp_buffer_wroffset++] = data; m_decomp_buffer_wroffset &= SPC7110_DECOMP_BUFFER_SIZE - 1; m_decomp_buffer_length++; } -UINT8 SPC7110_Decomp::dataread(UINT8 *ROM, UINT32 len) +uint8_t SPC7110_Decomp::dataread(uint8_t *ROM, uint32_t len) { - UINT32 size = len - 0x100000; + uint32_t size = len - 0x100000; while (m_decomp_offset >= size) { m_decomp_offset -= size; @@ -458,7 +458,7 @@ UINT8 SPC7110_Decomp::dataread(UINT8 *ROM, UINT32 len) return ROM[0x100000 + m_decomp_offset++]; } -void SPC7110_Decomp::mode0(UINT8 init, UINT8 *ROM, UINT32 len) +void SPC7110_Decomp::mode0(uint8_t init, uint8_t *ROM, uint32_t len) { if (init == 1) { @@ -475,10 +475,10 @@ void SPC7110_Decomp::mode0(UINT8 init, UINT8 *ROM, UINT32 len) for (int bit = 0; bit < 8; bit++) { //get context - UINT8 mask = (1 << (bit & 3)) - 1; - UINT8 con = mask + ((m_m0_inverts & mask) ^ (m_m0_lps & mask)); - UINT32 prob, mps, flag_lps; - UINT32 shift = 0; + uint8_t mask = (1 << (bit & 3)) - 1; + uint8_t con = mask + ((m_m0_inverts & mask) ^ (m_m0_lps & mask)); + uint32_t prob, mps, flag_lps; + uint32_t shift = 0; if (bit > 3) { con += 15; @@ -543,7 +543,7 @@ void SPC7110_Decomp::mode0(UINT8 init, UINT8 *ROM, UINT32 len) } } -void SPC7110_Decomp::mode1(UINT8 init, UINT8 *ROM, UINT32 len) +void SPC7110_Decomp::mode1(uint8_t init, uint8_t *ROM, uint32_t len) { if (init == 1) { @@ -561,17 +561,17 @@ void SPC7110_Decomp::mode1(UINT8 init, UINT8 *ROM, UINT32 len) while (m_decomp_buffer_length < (SPC7110_DECOMP_BUFFER_SIZE >> 1)) { - UINT16 data; + uint16_t data; for (int pixel = 0; pixel < 8; pixel++) { //get first symbol context - UINT32 a = ((m_m1_out >> (1 * 2)) & 3); - UINT32 b = ((m_m1_out >> (7 * 2)) & 3); - UINT32 c = ((m_m1_out >> (8 * 2)) & 3); - UINT32 con = (a == b) ? (b != c) : (b == c) ? 2 : 4 - (a == c); + uint32_t a = ((m_m1_out >> (1 * 2)) & 3); + uint32_t b = ((m_m1_out >> (7 * 2)) & 3); + uint32_t c = ((m_m1_out >> (8 * 2)) & 3); + uint32_t con = (a == b) ? (b != c) : (b == c) ? 2 : 4 - (a == c); //update pixel order - UINT32 m, n; + uint32_t m, n; for (m = 0; m < 4; m++) { if (m_m1_pixelorder[m] == a) @@ -637,11 +637,11 @@ void SPC7110_Decomp::mode1(UINT8 init, UINT8 *ROM, UINT32 len) for (int bit = 0; bit < 2; bit++) { //get prob - UINT32 prob = probability(con); - UINT32 shift = 0; + uint32_t prob = probability(con); + uint32_t shift = 0; //get symbol - UINT32 flag_lps; + uint32_t flag_lps; if (m_m1_val <= m_m1_span - prob) //mps { m_m1_span = m_m1_span - prob; @@ -704,7 +704,7 @@ void SPC7110_Decomp::mode1(UINT8 init, UINT8 *ROM, UINT32 len) } } -void SPC7110_Decomp::mode2(UINT8 init, UINT8 *ROM, UINT32 len) +void SPC7110_Decomp::mode2(uint8_t init, uint8_t *ROM, uint32_t len) { if (init == 1) { @@ -723,18 +723,18 @@ void SPC7110_Decomp::mode2(UINT8 init, UINT8 *ROM, UINT32 len) while (m_decomp_buffer_length < (SPC7110_DECOMP_BUFFER_SIZE >> 1)) { - UINT32 data; + uint32_t data; for (int pixel = 0; pixel < 8; pixel++) { //get first symbol context - UINT32 a = ((m_m2_out0 >> (0 * 4)) & 15); - UINT32 b = ((m_m2_out0 >> (7 * 4)) & 15); - UINT32 c = ((m_m2_out1 >> (0 * 4)) & 15); - UINT32 con = 0; - UINT32 refcon = (a == b) ? (b != c) : (b == c) ? 2 : 4 - (a == c); + uint32_t a = ((m_m2_out0 >> (0 * 4)) & 15); + uint32_t b = ((m_m2_out0 >> (7 * 4)) & 15); + uint32_t c = ((m_m2_out1 >> (0 * 4)) & 15); + uint32_t con = 0; + uint32_t refcon = (a == b) ? (b != c) : (b == c) ? 2 : 4 - (a == c); //update pixel order - UINT32 m, n; + uint32_t m, n; for (m = 0; m < 16; m++) { if (m_m2_pixelorder[m] == a) @@ -799,13 +799,13 @@ void SPC7110_Decomp::mode2(UINT8 init, UINT8 *ROM, UINT32 len) //get 4 symbols for (int bit = 0; bit < 4; bit++) { - UINT32 invertbit, shift; + uint32_t invertbit, shift; //get prob - UINT32 prob = probability(con); + uint32_t prob = probability(con); //get symbol - UINT32 flag_lps; + uint32_t flag_lps; if (m_m2_val <= m_m2_span - prob) //mps { m_m2_span = m_m2_span - prob; @@ -882,27 +882,27 @@ void SPC7110_Decomp::mode2(UINT8 init, UINT8 *ROM, UINT32 len) } } -UINT8 SPC7110_Decomp::probability(UINT32 n) +uint8_t SPC7110_Decomp::probability(uint32_t n) { return spc7110_evolution_table[m_context[n].index][0]; } -UINT8 SPC7110_Decomp::next_lps(UINT32 n) +uint8_t SPC7110_Decomp::next_lps(uint32_t n) { return spc7110_evolution_table[m_context[n].index][1]; } -UINT8 SPC7110_Decomp::next_mps(UINT32 n) +uint8_t SPC7110_Decomp::next_mps(uint32_t n) { return spc7110_evolution_table[m_context[n].index][2]; } -UINT8 SPC7110_Decomp::toggle_invert(UINT32 n) +uint8_t SPC7110_Decomp::toggle_invert(uint32_t n) { return spc7110_evolution_table[m_context[n].index][3]; } -UINT32 SPC7110_Decomp::morton_2x8(UINT32 data) +uint32_t SPC7110_Decomp::morton_2x8(uint32_t data) { //reverse morton lookup: de-interleave two 8-bit values //15, 13, 11, 9, 7, 5, 3, 1 -> 15- 8 @@ -910,7 +910,7 @@ UINT32 SPC7110_Decomp::morton_2x8(UINT32 data) return m_morton16[0][(data >> 0) & 255] + m_morton16[1][(data >> 8) & 255]; } -UINT32 SPC7110_Decomp::morton_4x8(UINT32 data) +uint32_t SPC7110_Decomp::morton_4x8(uint32_t data) { //reverse morton lookup: de-interleave four 8-bit values //31, 27, 23, 19, 15, 11, 7, 3 -> 31-24 @@ -922,11 +922,11 @@ UINT32 SPC7110_Decomp::morton_4x8(UINT32 data) } -static const UINT32 spc7110_months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; +static const uint32_t spc7110_months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -UINT32 sns_rom_spc7110_device::spc7110_datarom_addr(UINT32 addr, UINT32 rom_len) +uint32_t sns_rom_spc7110_device::spc7110_datarom_addr(uint32_t addr, uint32_t rom_len) { - UINT32 size = rom_len - 0x100000; + uint32_t size = rom_len - 0x100000; while (addr >= size) { addr -= size; @@ -934,29 +934,29 @@ UINT32 sns_rom_spc7110_device::spc7110_datarom_addr(UINT32 addr, UINT32 rom_len) return addr + 0x100000; } -UINT32 sns_rom_spc7110_device::spc7110_data_pointer(void) +uint32_t sns_rom_spc7110_device::spc7110_data_pointer(void) { return m_r4811 + (m_r4812 << 8) + (m_r4813 << 16); } -UINT32 sns_rom_spc7110_device::spc7110_data_adjust(void) +uint32_t sns_rom_spc7110_device::spc7110_data_adjust(void) { return m_r4814 + (m_r4815 << 8); } -UINT32 sns_rom_spc7110_device::spc7110_data_increment(void) +uint32_t sns_rom_spc7110_device::spc7110_data_increment(void) { return m_r4816 + (m_r4817 << 8); } -void sns_rom_spc7110_device::spc7110_set_data_pointer(UINT32 addr) +void sns_rom_spc7110_device::spc7110_set_data_pointer(uint32_t addr) { m_r4811 = addr; m_r4812 = addr >> 8; m_r4813 = addr >> 16; } -void sns_rom_spc7110_device::spc7110_set_data_adjust(UINT32 addr) +void sns_rom_spc7110_device::spc7110_set_data_adjust(uint32_t addr) { m_r4814 = addr; m_r4815 = addr >> 8; @@ -966,11 +966,11 @@ void sns_rom_spc7110_device::spc7110_set_data_adjust(UINT32 addr) // we should probably keep track internally of the time rather than updating // to the system time at each call with a "offset" tracking as we do now... // (and indeed current code fails to pass Tengai Makyou Zero tests) -void sns_rom_spc7110_device::spc7110_update_time(UINT8 offset) +void sns_rom_spc7110_device::spc7110_update_time(uint8_t offset) { system_time curtime; machine().current_datetime(curtime); - INT64 diff = curtime.time - m_rtc_basetime.time - offset; + int64_t diff = curtime.time - m_rtc_basetime.time - offset; // printf("diff %llx\n", diff); bool update = TRUE; @@ -984,18 +984,18 @@ void sns_rom_spc7110_device::spc7110_update_time(UINT8 offset) if (update && diff > 0) { /* update time with offset, assuming offset < 3600s */ - UINT32 second = m_rtc_ram[0] + m_rtc_ram[1] * 10; - UINT8 minute = m_rtc_ram[2] + m_rtc_ram[3] * 10; - UINT8 hour = m_rtc_ram[4] + m_rtc_ram[5] * 10; - UINT8 day = m_rtc_ram[6] + m_rtc_ram[7] * 10; - UINT8 month = m_rtc_ram[8] + m_rtc_ram[9] * 10; - UINT8 year = m_rtc_ram[10] + m_rtc_ram[11] * 10; - UINT8 weekday = m_rtc_ram[12]; + uint32_t second = m_rtc_ram[0] + m_rtc_ram[1] * 10; + uint8_t minute = m_rtc_ram[2] + m_rtc_ram[3] * 10; + uint8_t hour = m_rtc_ram[4] + m_rtc_ram[5] * 10; + uint8_t day = m_rtc_ram[6] + m_rtc_ram[7] * 10; + uint8_t month = m_rtc_ram[8] + m_rtc_ram[9] * 10; + uint8_t year = m_rtc_ram[10] + m_rtc_ram[11] * 10; + uint8_t weekday = m_rtc_ram[12]; day--; month--; year += (year >= 90) ? 1900 : 2000; - second += (UINT32)diff; + second += (uint32_t)diff; while (second >= 60) { second -= 60; @@ -1017,7 +1017,7 @@ void sns_rom_spc7110_device::spc7110_update_time(UINT8 offset) weekday = (weekday + 1) % 7; - UINT8 days = spc7110_months[month % 12]; + uint8_t days = spc7110_months[month % 12]; // check for feb 29th if (days == 28) { @@ -1069,9 +1069,9 @@ void sns_rom_spc7110_device::spc7110_update_time(UINT8 offset) READ8_MEMBER(sns_rom_spc7110_device::chip_read) { - UINT8 *ROM = get_rom_base(); - UINT32 len = get_rom_size(); - UINT16 addr = offset & 0xffff; + uint8_t *ROM = get_rom_base(); + uint32_t len = get_rom_size(); + uint16_t addr = offset & 0xffff; switch (addr) { @@ -1081,7 +1081,7 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) case 0x4800: { - UINT16 counter = (m_r4809 + (m_r480a << 8)); + uint16_t counter = (m_r4809 + (m_r480a << 8)); counter--; m_r4809 = counter; m_r480a = counter >> 8; @@ -1100,7 +1100,7 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) case 0x480b: return m_r480b; case 0x480c: { - UINT8 status = m_r480c; + uint8_t status = m_r480c; m_r480c &= 0x7f; return status; } @@ -1111,8 +1111,8 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) case 0x4810: { - UINT8 data; - UINT32 address, adjust, adjustaddr; + uint8_t data; + uint32_t address, adjust, adjustaddr; if (m_r481x != 0x07) return 0x00; @@ -1120,7 +1120,7 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) adjust = spc7110_data_adjust(); if (m_r4818 & 8) { - adjust = (INT16)adjust; //16-bit sign extend + adjust = (int16_t)adjust; //16-bit sign extend } adjustaddr = address; @@ -1133,10 +1133,10 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) data = ROM[spc7110_datarom_addr(adjustaddr, len)]; if (!(m_r4818 & 2)) { - UINT32 increment = (m_r4818 & 1) ? spc7110_data_increment() : 1; + uint32_t increment = (m_r4818 & 1) ? spc7110_data_increment() : 1; if (m_r4818 & 4) { - increment = (INT16)increment; //16-bit sign extend + increment = (int16_t)increment; //16-bit sign extend } if ((m_r4818 & 16) == 0) @@ -1161,8 +1161,8 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) case 0x4818: return m_r4818; case 0x481a: { - UINT8 data; - UINT32 address, adjust; + uint8_t data; + uint32_t address, adjust; if (m_r481x != 0x07) { return 0x00; @@ -1172,7 +1172,7 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) adjust = spc7110_data_adjust(); if (m_r4818 & 8) { - adjust = (INT16)adjust; //16-bit sign extend + adjust = (int16_t)adjust; //16-bit sign extend } data = ROM[spc7110_datarom_addr(address + adjust, len)]; @@ -1212,7 +1212,7 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) case 0x482e: return m_r482e; case 0x482f: { - UINT8 status = m_r482f; + uint8_t status = m_r482f; m_r482f &= 0x7f; return status; } @@ -1233,7 +1233,7 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) case 0x4840: return m_r4840; case 0x4841: { - UINT8 data; + uint8_t data; if (m_rtc_state == RTCS_Inactive || m_rtc_state == RTCS_ModeSelect) return 0x00; @@ -1244,7 +1244,7 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) } case 0x4842: { - UINT8 status = m_r4842; + uint8_t status = m_r4842; m_r4842 &= 0x7f; return status; } @@ -1255,9 +1255,9 @@ READ8_MEMBER(sns_rom_spc7110_device::chip_read) WRITE8_MEMBER(sns_rom_spc7110_device::chip_write) { - UINT8 *ROM = get_rom_base(); - UINT32 len = get_rom_size(); - UINT16 addr = offset & 0xffff; + uint8_t *ROM = get_rom_base(); + uint32_t len = get_rom_size(); + uint16_t addr = offset & 0xffff; switch (addr) { @@ -1272,7 +1272,7 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write) case 0x4805: m_r4805 = data; break; case 0x4806: { - UINT32 table, index, address, mode, offset; + uint32_t table, index, address, mode, offset; m_r4806 = data; table = (m_r4801 + (m_r4802 << 8) + (m_r4803 << 16)); @@ -1321,19 +1321,19 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write) if ((m_r4818 & 0x60) == 0x20) { - UINT32 increment = spc7110_data_adjust() & 0xff; + uint32_t increment = spc7110_data_adjust() & 0xff; if (m_r4818 & 8) { - increment = (INT8)increment; //8-bit sign extend + increment = (int8_t)increment; //8-bit sign extend } spc7110_set_data_pointer(spc7110_data_pointer() + increment); } else if ((m_r4818 & 0x60) == 0x40) { - UINT32 increment = spc7110_data_adjust(); + uint32_t increment = spc7110_data_adjust(); if (m_r4818 & 8) { - increment = (INT16)increment; //16-bit sign extend + increment = (int16_t)increment; //16-bit sign extend } spc7110_set_data_pointer(spc7110_data_pointer() + increment); } @@ -1359,19 +1359,19 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write) if ((m_r4818 & 0x60) == 0x20) { - UINT32 increment = spc7110_data_adjust() & 0xff; + uint32_t increment = spc7110_data_adjust() & 0xff; if (m_r4818 & 8) { - increment = (INT8)increment; //8-bit sign extend + increment = (int8_t)increment; //8-bit sign extend } spc7110_set_data_pointer(spc7110_data_pointer() + increment); } else if ((m_r4818 & 0x60) == 0x40) { - UINT32 increment = spc7110_data_adjust(); + uint32_t increment = spc7110_data_adjust(); if (m_r4818 & 8) { - increment = (INT16)increment; //16-bit sign extend + increment = (int16_t)increment; //16-bit sign extend } spc7110_set_data_pointer(spc7110_data_pointer() + increment); } @@ -1406,10 +1406,10 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write) if (m_r482e & 1) { //signed 16-bit x 16-bit multiplication - INT16 r0 = (INT16)(m_r4824 + (m_r4825 << 8)); - INT16 r1 = (INT16)(m_r4820 + (m_r4821 << 8)); + int16_t r0 = (int16_t)(m_r4824 + (m_r4825 << 8)); + int16_t r1 = (int16_t)(m_r4820 + (m_r4821 << 8)); - INT32 result = r0 * r1; + int32_t result = r0 * r1; m_r4828 = result; m_r4829 = result >> 8; m_r482a = result >> 16; @@ -1418,10 +1418,10 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write) else { //unsigned 16-bit x 16-bit multiplication - UINT16 r0 = (UINT16)(m_r4824 + (m_r4825 << 8)); - UINT16 r1 = (UINT16)(m_r4820 + (m_r4821 << 8)); + uint16_t r0 = (uint16_t)(m_r4824 + (m_r4825 << 8)); + uint16_t r1 = (uint16_t)(m_r4820 + (m_r4821 << 8)); - UINT32 result = r0 * r1; + uint32_t result = r0 * r1; m_r4828 = result; m_r4829 = result >> 8; m_r482a = result >> 16; @@ -1440,16 +1440,16 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write) if (m_r482e & 1) { //signed 32-bit x 16-bit division - INT32 dividend = (INT32)(m_r4820 + (m_r4821 << 8) + (m_r4822 << 16) + (m_r4823 << 24)); - INT16 divisor = (INT16)(m_r4826 + (m_r4827 << 8)); + int32_t dividend = (int32_t)(m_r4820 + (m_r4821 << 8) + (m_r4822 << 16) + (m_r4823 << 24)); + int16_t divisor = (int16_t)(m_r4826 + (m_r4827 << 8)); - INT32 quotient; - INT16 remainder; + int32_t quotient; + int16_t remainder; if (divisor) { - quotient = (INT32)(dividend / divisor); - remainder = (INT32)(dividend % divisor); + quotient = (int32_t)(dividend / divisor); + remainder = (int32_t)(dividend % divisor); } else { @@ -1469,16 +1469,16 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write) else { //unsigned 32-bit x 16-bit division - UINT32 dividend = (UINT32)(m_r4820 + (m_r4821 << 8) + (m_r4822 << 16) + (m_r4823 << 24)); - UINT16 divisor = (UINT16)(m_r4826 + (m_r4827 << 8)); + uint32_t dividend = (uint32_t)(m_r4820 + (m_r4821 << 8) + (m_r4822 << 16) + (m_r4823 << 24)); + uint16_t divisor = (uint16_t)(m_r4826 + (m_r4827 << 8)); - UINT32 quotient; - UINT16 remainder; + uint32_t quotient; + uint16_t remainder; if (divisor) { - quotient = (UINT32)(dividend / divisor); - remainder = (UINT16)(dividend % divisor); + quotient = (uint32_t)(dividend / divisor); + remainder = (uint16_t)(dividend % divisor); } else { @@ -1602,7 +1602,7 @@ WRITE8_MEMBER(sns_rom_spc7110_device::chip_write) { spc7110_update_time(0); - UINT8 second = m_rtc_ram[0] + m_rtc_ram[1] * 10; + uint8_t second = m_rtc_ram[0] + m_rtc_ram[1] * 10; //clear seconds m_rtc_ram[0] = 0; m_rtc_ram[1] = 0; @@ -1649,7 +1649,7 @@ READ8_MEMBER(sns_rom_spc7110_device::read_l) READ8_MEMBER(sns_rom_spc7110_device::read_h) { - UINT16 address = offset & 0xfffff; + uint16_t address = offset & 0xfffff; if (offset < 0x400000) return m_rom[rom_bank_map[offset / 0x8000] * 0x8000 + (offset & 0x7fff)]; diff --git a/src/devices/bus/snes/spc7110.h b/src/devices/bus/snes/spc7110.h index 33d7170d02c..90274f551a9 100644 --- a/src/devices/bus/snes/spc7110.h +++ b/src/devices/bus/snes/spc7110.h @@ -28,59 +28,59 @@ public: running_machine &machine() const { return m_machine; } - void init(running_machine &machine, UINT8 *ROM, UINT32 len, UINT32 mode, UINT32 offset, UINT32 index); + void init(running_machine &machine, uint8_t *ROM, uint32_t len, uint32_t mode, uint32_t offset, uint32_t index); void reset(); - UINT8 read(UINT8 *ROM, UINT32 len); - void write(UINT8 data); - void mode0(UINT8 init, UINT8 *ROM, UINT32 len); - void mode1(UINT8 init, UINT8 *ROM, UINT32 len); - void mode2(UINT8 init, UINT8 *ROM, UINT32 len); + uint8_t read(uint8_t *ROM, uint32_t len); + void write(uint8_t data); + void mode0(uint8_t init, uint8_t *ROM, uint32_t len); + void mode1(uint8_t init, uint8_t *ROM, uint32_t len); + void mode2(uint8_t init, uint8_t *ROM, uint32_t len); private: - UINT8 dataread(UINT8 *ROM, UINT32 len); - UINT8 probability(UINT32 n); - UINT8 next_lps(UINT32 n); - UINT8 next_mps(UINT32 n); - UINT8 toggle_invert(UINT32 n); - UINT32 morton_2x8(UINT32 data); - UINT32 morton_4x8(UINT32 data); + uint8_t dataread(uint8_t *ROM, uint32_t len); + uint8_t probability(uint32_t n); + uint8_t next_lps(uint32_t n); + uint8_t next_mps(uint32_t n); + uint8_t toggle_invert(uint32_t n); + uint32_t morton_2x8(uint32_t data); + uint32_t morton_4x8(uint32_t data); - UINT32 m_decomp_mode; - UINT32 m_decomp_offset; + uint32_t m_decomp_mode; + uint32_t m_decomp_offset; - std::unique_ptr m_decomp_buffer; - UINT32 m_decomp_buffer_rdoffset; - UINT32 m_decomp_buffer_wroffset; - UINT32 m_decomp_buffer_length; + std::unique_ptr m_decomp_buffer; + uint32_t m_decomp_buffer_rdoffset; + uint32_t m_decomp_buffer_wroffset; + uint32_t m_decomp_buffer_length; struct ContextState { - UINT8 index; - UINT8 invert; + uint8_t index; + uint8_t invert; } m_context[32]; - UINT32 m_morton16[2][256]; - UINT32 m_morton32[4][256]; + uint32_t m_morton16[2][256]; + uint32_t m_morton32[4][256]; // mode 0 vars - UINT8 m_m0_val, m_m0_in, m_m0_span; - INT32 m_m0_out, m_m0_inverts, m_m0_lps, m_m0_in_count; + uint8_t m_m0_val, m_m0_in, m_m0_span; + int32_t m_m0_out, m_m0_inverts, m_m0_lps, m_m0_in_count; // mode 1 vars - INT32 m_m1_pixelorder[4], m_m1_realorder[4]; - UINT8 m_m1_in, m_m1_val, m_m1_span; - INT32 m_m1_out, m_m1_inverts, m_m1_lps, m_m1_in_count; + int32_t m_m1_pixelorder[4], m_m1_realorder[4]; + uint8_t m_m1_in, m_m1_val, m_m1_span; + int32_t m_m1_out, m_m1_inverts, m_m1_lps, m_m1_in_count; // mode 2 vars - INT32 m_m2_pixelorder[16], m_m2_realorder[16]; - UINT8 m_m2_bitplanebuffer[16], m_m2_buffer_index; - UINT8 m_m2_in, m_m2_val, m_m2_span; - INT32 m_m2_out0, m_m2_out1, m_m2_inverts, m_m2_lps, m_m2_in_count; + int32_t m_m2_pixelorder[16], m_m2_realorder[16]; + uint8_t m_m2_bitplanebuffer[16], m_m2_buffer_index; + uint8_t m_m2_in, m_m2_val, m_m2_span; + int32_t m_m2_out0, m_m2_out1, m_m2_inverts, m_m2_lps, m_m2_in_count; running_machine& m_machine; - //UINT32 m_rom_size; + //uint32_t m_rom_size; }; // ======================> sns_rom_spc7110_device @@ -89,8 +89,8 @@ class sns_rom_spc7110_device : public sns_rom21_device { public: // construction/destruction - sns_rom_spc7110_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); - sns_rom_spc7110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_spc7110_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); + sns_rom_spc7110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -105,97 +105,97 @@ public: virtual DECLARE_WRITE8_MEMBER(chip_write) override; void spc7110_start(); - UINT32 spc7110_datarom_addr(UINT32 addr, UINT32 len); - UINT32 spc7110_data_pointer(); - UINT32 spc7110_data_adjust(); - UINT32 spc7110_data_increment(); - void spc7110_set_data_pointer(UINT32 addr); - void spc7110_set_data_adjust(UINT32 addr); - void spc7110_update_time(UINT8 offset); + uint32_t spc7110_datarom_addr(uint32_t addr, uint32_t len); + uint32_t spc7110_data_pointer(); + uint32_t spc7110_data_adjust(); + uint32_t spc7110_data_increment(); + void spc7110_set_data_pointer(uint32_t addr); + void spc7110_set_data_adjust(uint32_t addr); + void spc7110_update_time(uint8_t offset); //================== //decompression unit //================== - UINT8 m_r4801; // compression table low - UINT8 m_r4802; // compression table high - UINT8 m_r4803; // compression table bank - UINT8 m_r4804; // compression table index - UINT8 m_r4805; // decompression buffer index low - UINT8 m_r4806; // decompression buffer index high - UINT8 m_r4807; // ??? - UINT8 m_r4808; // ??? - UINT8 m_r4809; // compression length low - UINT8 m_r480a; // compression length high - UINT8 m_r480b; // decompression control register - UINT8 m_r480c; // decompression status + uint8_t m_r4801; // compression table low + uint8_t m_r4802; // compression table high + uint8_t m_r4803; // compression table bank + uint8_t m_r4804; // compression table index + uint8_t m_r4805; // decompression buffer index low + uint8_t m_r4806; // decompression buffer index high + uint8_t m_r4807; // ??? + uint8_t m_r4808; // ??? + uint8_t m_r4809; // compression length low + uint8_t m_r480a; // compression length high + uint8_t m_r480b; // decompression control register + uint8_t m_r480c; // decompression status std::unique_ptr m_decomp; - UINT8 m_r4811; // data pointer low - UINT8 m_r4812; // data pointer high - UINT8 m_r4813; // data pointer bank - UINT8 m_r4814; // data adjust low - UINT8 m_r4815; // data adjust high - UINT8 m_r4816; // data increment low - UINT8 m_r4817; // data increment high - UINT8 m_r4818; // data port control register + uint8_t m_r4811; // data pointer low + uint8_t m_r4812; // data pointer high + uint8_t m_r4813; // data pointer bank + uint8_t m_r4814; // data adjust low + uint8_t m_r4815; // data adjust high + uint8_t m_r4816; // data increment low + uint8_t m_r4817; // data increment high + uint8_t m_r4818; // data port control register - UINT8 m_r481x; + uint8_t m_r481x; - UINT8 m_r4814_latch; - UINT8 m_r4815_latch; + uint8_t m_r4814_latch; + uint8_t m_r4815_latch; //========= //math unit //========= - UINT8 m_r4820; // 16-bit multiplicand B0, 32-bit dividend B0 - UINT8 m_r4821; // 16-bit multiplicand B1, 32-bit dividend B1 - UINT8 m_r4822; // 32-bit dividend B2 - UINT8 m_r4823; // 32-bit dividend B3 - UINT8 m_r4824; // 16-bit multiplier B0 - UINT8 m_r4825; // 16-bit multiplier B1 - UINT8 m_r4826; // 16-bit divisor B0 - UINT8 m_r4827; // 16-bit divisor B1 - UINT8 m_r4828; // 32-bit product B0, 32-bit quotient B0 - UINT8 m_r4829; // 32-bit product B1, 32-bit quotient B1 - UINT8 m_r482a; // 32-bit product B2, 32-bit quotient B2 - UINT8 m_r482b; // 32-bit product B3, 32-bit quotient B3 - UINT8 m_r482c; // 16-bit remainder B0 - UINT8 m_r482d; // 16-bit remainder B1 - UINT8 m_r482e; // math control register - UINT8 m_r482f; // math status + uint8_t m_r4820; // 16-bit multiplicand B0, 32-bit dividend B0 + uint8_t m_r4821; // 16-bit multiplicand B1, 32-bit dividend B1 + uint8_t m_r4822; // 32-bit dividend B2 + uint8_t m_r4823; // 32-bit dividend B3 + uint8_t m_r4824; // 16-bit multiplier B0 + uint8_t m_r4825; // 16-bit multiplier B1 + uint8_t m_r4826; // 16-bit divisor B0 + uint8_t m_r4827; // 16-bit divisor B1 + uint8_t m_r4828; // 32-bit product B0, 32-bit quotient B0 + uint8_t m_r4829; // 32-bit product B1, 32-bit quotient B1 + uint8_t m_r482a; // 32-bit product B2, 32-bit quotient B2 + uint8_t m_r482b; // 32-bit product B3, 32-bit quotient B3 + uint8_t m_r482c; // 16-bit remainder B0 + uint8_t m_r482d; // 16-bit remainder B1 + uint8_t m_r482e; // math control register + uint8_t m_r482f; // math status //=================== //memory mapping unit //=================== - UINT8 m_r4830; // SRAM write enable - UINT8 m_r4831; // $[d0-df]:[0000-ffff] mapping - UINT8 m_r4832; // $[e0-ef]:[0000-ffff] mapping - UINT8 m_r4833; // $[f0-ff]:[0000-ffff] mapping - UINT8 m_r4834; // ??? + uint8_t m_r4830; // SRAM write enable + uint8_t m_r4831; // $[d0-df]:[0000-ffff] mapping + uint8_t m_r4832; // $[e0-ef]:[0000-ffff] mapping + uint8_t m_r4833; // $[f0-ff]:[0000-ffff] mapping + uint8_t m_r4834; // ??? - UINT32 m_dx_offset; - UINT32 m_ex_offset; - UINT32 m_fx_offset; + uint32_t m_dx_offset; + uint32_t m_ex_offset; + uint32_t m_fx_offset; //==================== //real-time clock unit //==================== - UINT8 m_r4840; // RTC latch - UINT8 m_r4841; // RTC index/data port - UINT8 m_r4842; // RTC status + uint8_t m_r4840; // RTC latch + uint8_t m_r4841; // RTC index/data port + uint8_t m_r4842; // RTC status - UINT32 m_rtc_state; - UINT32 m_rtc_mode; - UINT32 m_rtc_index; + uint32_t m_rtc_state; + uint32_t m_rtc_mode; + uint32_t m_rtc_index; - UINT64 m_rtc_offset; + uint64_t m_rtc_offset; system_time m_rtc_basetime; //this is now allocated in the main snes cart class, to allow saving to nvram - //UINT8 m_rtc_ram[16]; // 0-12 secs, min, hrs, etc.; 13-14-15 control registers + //uint8_t m_rtc_ram[16]; // 0-12 secs, min, hrs, etc.; 13-14-15 control registers }; // ======================> sns_rom_spc7110_device @@ -204,7 +204,7 @@ class sns_rom_spc7110rtc_device : public sns_rom_spc7110_device { public: // construction/destruction - sns_rom_spc7110rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_spc7110rtc_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/devices/bus/snes/sufami.cpp b/src/devices/bus/snes/sufami.cpp index b6ac1b376d2..c181c5cde95 100644 --- a/src/devices/bus/snes/sufami.cpp +++ b/src/devices/bus/snes/sufami.cpp @@ -24,14 +24,14 @@ const device_type SNS_LOROM_SUFAMI = &device_creator; const device_type SNS_STROM = &device_creator; -sns_rom_sufami_device::sns_rom_sufami_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_sufami_device::sns_rom_sufami_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_SUFAMI, "SNES Sufami Turbo Cart", tag, owner, clock, "sns_rom_sufami", __FILE__), m_slot1(*this, "st_slot1"), m_slot2(*this, "st_slot2") { } -sns_rom_strom_device::sns_rom_strom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_strom_device::sns_rom_strom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_STROM, "SNES Sufami Turbo Minicart", tag, owner, clock, "sns_strom", __FILE__) { } diff --git a/src/devices/bus/snes/sufami.h b/src/devices/bus/snes/sufami.h index 7881a6f6d58..b00c8c8ed07 100644 --- a/src/devices/bus/snes/sufami.h +++ b/src/devices/bus/snes/sufami.h @@ -13,7 +13,7 @@ class sns_rom_sufami_device : public sns_rom_device { public: // construction/destruction - sns_rom_sufami_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_sufami_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -36,7 +36,7 @@ class sns_rom_strom_device : public sns_rom_device { public: // construction/destruction - sns_rom_strom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_strom_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/devices/bus/snes/upd.cpp b/src/devices/bus/snes/upd.cpp index 611b84f6610..f87e41194fa 100644 --- a/src/devices/bus/snes/upd.cpp +++ b/src/devices/bus/snes/upd.cpp @@ -13,11 +13,11 @@ // helpers -inline UINT32 get_prg(UINT8 *CPU, UINT32 addr) +inline uint32_t get_prg(uint8_t *CPU, uint32_t addr) { return ((CPU[addr * 4] << 24) | (CPU[addr * 4 + 1] << 16) | (CPU[addr * 4 + 2] << 8) | 0x00); } -inline UINT16 get_data(UINT8 *CPU, UINT32 addr) +inline uint16_t get_data(uint8_t *CPU, uint32_t addr) { return ((CPU[addr * 2] << 8) | CPU[addr * 2 + 1]); } @@ -32,42 +32,42 @@ const device_type SNS_LOROM_SETA10 = &device_creator; const device_type SNS_LOROM_SETA11 = &device_creator; -sns_rom20_necdsp_device::sns_rom20_necdsp_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) +sns_rom20_necdsp_device::sns_rom20_necdsp_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) : sns_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_upd7725(*this, "dsp") { } -sns_rom20_necdsp_device::sns_rom20_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom20_necdsp_device::sns_rom20_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_device(mconfig, SNS_LOROM_NECDSP, "SNES Cart (LoROM) + NEC DSP", tag, owner, clock, "sns_rom_necdsp", __FILE__), m_upd7725(*this, "dsp") { } -sns_rom21_necdsp_device::sns_rom21_necdsp_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) +sns_rom21_necdsp_device::sns_rom21_necdsp_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) : sns_rom21_device(mconfig, type, name, tag, owner, clock, shortname, source), m_upd7725(*this, "dsp") { } -sns_rom21_necdsp_device::sns_rom21_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom21_necdsp_device::sns_rom21_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom21_device(mconfig, SNS_HIROM_NECDSP, "SNES Cart (HiROM) + NEC DSP", tag, owner, clock, "sns_rom21_necdsp", __FILE__), m_upd7725(*this, "dsp") { } -sns_rom_setadsp_device::sns_rom_setadsp_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) +sns_rom_setadsp_device::sns_rom_setadsp_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) : sns_rom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_upd96050(*this, "dsp") { } -sns_rom_seta10dsp_device::sns_rom_seta10dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_seta10dsp_device::sns_rom_seta10dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_setadsp_device(mconfig, SNS_LOROM_SETA10, "SNES Cart (LoROM) + Seta ST010 DSP", tag, owner, clock, "sns_rom_seta10", __FILE__) { } -sns_rom_seta11dsp_device::sns_rom_seta11dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_seta11dsp_device::sns_rom_seta11dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_setadsp_device(mconfig, SNS_LOROM_SETA11, "SNES Cart (LoROM) + Seta ST011 DSP", tag, owner, clock, "sns_rom_seta11", __FILE__) { } @@ -75,20 +75,20 @@ sns_rom_seta11dsp_device::sns_rom_seta11dsp_device(const machine_config &mconfig void sns_rom20_necdsp_device::device_start() { - m_dsp_prg.resize(0x2000/sizeof(UINT32)); - m_dsp_data.resize(0x800/sizeof(UINT16)); + m_dsp_prg.resize(0x2000/sizeof(uint32_t)); + m_dsp_data.resize(0x800/sizeof(uint16_t)); } void sns_rom21_necdsp_device::device_start() { - m_dsp_prg.resize(0x2000/sizeof(UINT32)); - m_dsp_data.resize(0x800/sizeof(UINT16)); + m_dsp_prg.resize(0x2000/sizeof(uint32_t)); + m_dsp_data.resize(0x800/sizeof(uint16_t)); } void sns_rom_setadsp_device::device_start() { - m_dsp_prg.resize(0x10000/sizeof(UINT32)); - m_dsp_data.resize(0x1000/sizeof(UINT16)); + m_dsp_prg.resize(0x10000/sizeof(uint32_t)); + m_dsp_data.resize(0x1000/sizeof(uint16_t)); } /*------------------------------------------------- @@ -244,8 +244,8 @@ READ8_MEMBER( sns_rom_setadsp_device::chip_read ) if (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000) { - UINT16 address = offset & 0xffff; - UINT16 temp = m_upd96050->dataram_r(address/2); + uint16_t address = offset & 0xffff; + uint16_t temp = m_upd96050->dataram_r(address/2); if (offset & 1) return temp >> 8; else @@ -266,8 +266,8 @@ WRITE8_MEMBER( sns_rom_setadsp_device::chip_write ) if (offset >= 0x680000 && offset < 0x700000 && (offset & 0xffff) < 0x8000) { - UINT16 address = offset & 0xffff; - UINT16 temp = m_upd96050->dataram_r(address/2); + uint16_t address = offset & 0xffff; + uint16_t temp = m_upd96050->dataram_r(address/2); if (offset & 1) { @@ -408,42 +408,42 @@ const device_type SNS_LOROM_SETA10_LEG = &device_creator; -sns_rom20_necdsp1_legacy_device::sns_rom20_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom20_necdsp1_legacy_device::sns_rom20_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP1_LEG, "SNES Cart (LoROM) + NEC DSP1 Legacy", tag, owner, clock, "dsp1leg", __FILE__) { } -sns_rom20_necdsp1b_legacy_device::sns_rom20_necdsp1b_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom20_necdsp1b_legacy_device::sns_rom20_necdsp1b_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP1B_LEG, "SNES Cart (LoROM) + NEC DSP1B Legacy", tag, owner, clock, "dsp1bleg", __FILE__) { } -sns_rom20_necdsp2_legacy_device::sns_rom20_necdsp2_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom20_necdsp2_legacy_device::sns_rom20_necdsp2_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP2_LEG, "SNES Cart (LoROM) + NEC DSP2 Legacy", tag, owner, clock, "dsp2leg", __FILE__) { } -sns_rom20_necdsp3_legacy_device::sns_rom20_necdsp3_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom20_necdsp3_legacy_device::sns_rom20_necdsp3_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP3_LEG, "SNES Cart (LoROM) + NEC DSP3 Legacy", tag, owner, clock, "dsp3leg", __FILE__) { } -sns_rom20_necdsp4_legacy_device::sns_rom20_necdsp4_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom20_necdsp4_legacy_device::sns_rom20_necdsp4_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom20_necdsp_device(mconfig, SNS_LOROM_NECDSP4_LEG, "SNES Cart (LoROM) + NEC DSP4 Legacy", tag, owner, clock, "dsp4leg", __FILE__) { } -sns_rom21_necdsp1_legacy_device::sns_rom21_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom21_necdsp1_legacy_device::sns_rom21_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom21_necdsp_device(mconfig, SNS_HIROM_NECDSP1_LEG, "SNES Cart (HiROM) + NEC DSP1 Legacy", tag, owner, clock, "dsp1leg_hi", __FILE__) { } -sns_rom_seta10dsp_legacy_device::sns_rom_seta10dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_seta10dsp_legacy_device::sns_rom_seta10dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_setadsp_device(mconfig, SNS_LOROM_SETA10_LEG, "SNES Cart (LoROM) + Seta ST010 DSP Legacy", tag, owner, clock, "seta10leg", __FILE__) { } -sns_rom_seta11dsp_legacy_device::sns_rom_seta11dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sns_rom_seta11dsp_legacy_device::sns_rom_seta11dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sns_rom_setadsp_device(mconfig, SNS_LOROM_SETA11_LEG, "SNES Cart (LoROM) + Seta ST011 DSP Legacy", tag, owner, clock, "seta11leg", __FILE__) { } diff --git a/src/devices/bus/snes/upd.h b/src/devices/bus/snes/upd.h index 653ee71d9e4..fa0d4dcb2ff 100644 --- a/src/devices/bus/snes/upd.h +++ b/src/devices/bus/snes/upd.h @@ -14,8 +14,8 @@ class sns_rom20_necdsp_device : public sns_rom_device { public: // construction/destruction - sns_rom20_necdsp_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); - sns_rom20_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom20_necdsp_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); + sns_rom20_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -31,8 +31,8 @@ public: virtual DECLARE_READ32_MEMBER(necdsp_prg_r); virtual DECLARE_READ16_MEMBER(necdsp_data_r); - std::vector m_dsp_prg; - std::vector m_dsp_data; + std::vector m_dsp_prg; + std::vector m_dsp_data; }; // ======================> sns_rom21_necdsp_device @@ -41,8 +41,8 @@ class sns_rom21_necdsp_device : public sns_rom21_device { public: // construction/destruction - sns_rom21_necdsp_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); - sns_rom21_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom21_necdsp_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); + sns_rom21_necdsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -58,8 +58,8 @@ public: virtual DECLARE_READ32_MEMBER(necdsp_prg_r); virtual DECLARE_READ16_MEMBER(necdsp_data_r); - std::vector m_dsp_prg; - std::vector m_dsp_data; + std::vector m_dsp_prg; + std::vector m_dsp_data; }; // ======================> sns_rom_setadsp_device @@ -68,7 +68,7 @@ class sns_rom_setadsp_device : public sns_rom_device { public: // construction/destruction - sns_rom_setadsp_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); + sns_rom_setadsp_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-level overrides virtual void device_start() override; @@ -83,8 +83,8 @@ public: virtual DECLARE_READ32_MEMBER(setadsp_prg_r); virtual DECLARE_READ16_MEMBER(setadsp_data_r); - std::vector m_dsp_prg; - std::vector m_dsp_data; + std::vector m_dsp_prg; + std::vector m_dsp_data; }; // ======================> sns_rom_seta10dsp_device @@ -93,7 +93,7 @@ class sns_rom_seta10dsp_device : public sns_rom_setadsp_device { public: // construction/destruction - sns_rom_seta10dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_seta10dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -105,7 +105,7 @@ class sns_rom_seta11dsp_device : public sns_rom_setadsp_device { public: // construction/destruction - sns_rom_seta11dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_seta11dsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -127,7 +127,7 @@ class sns_rom20_necdsp1_legacy_device : public sns_rom20_necdsp_device { public: // construction/destruction - sns_rom20_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom20_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -138,7 +138,7 @@ class sns_rom20_necdsp1b_legacy_device : public sns_rom20_necdsp_device { public: // construction/destruction - sns_rom20_necdsp1b_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom20_necdsp1b_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -149,7 +149,7 @@ class sns_rom20_necdsp2_legacy_device : public sns_rom20_necdsp_device { public: // construction/destruction - sns_rom20_necdsp2_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom20_necdsp2_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -160,7 +160,7 @@ class sns_rom20_necdsp3_legacy_device : public sns_rom20_necdsp_device { public: // construction/destruction - sns_rom20_necdsp3_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom20_necdsp3_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -171,7 +171,7 @@ class sns_rom20_necdsp4_legacy_device : public sns_rom20_necdsp_device { public: // construction/destruction - sns_rom20_necdsp4_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom20_necdsp4_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -182,7 +182,7 @@ class sns_rom21_necdsp1_legacy_device : public sns_rom21_necdsp_device { public: // construction/destruction - sns_rom21_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom21_necdsp1_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -193,7 +193,7 @@ class sns_rom_seta10dsp_legacy_device : public sns_rom_setadsp_device { public: // construction/destruction - sns_rom_seta10dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_seta10dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; @@ -204,7 +204,7 @@ class sns_rom_seta11dsp_legacy_device : public sns_rom_setadsp_device { public: // construction/destruction - sns_rom_seta11dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sns_rom_seta11dsp_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual machine_config_constructor device_mconfig_additions() const override; diff --git a/src/devices/bus/snes_ctrl/bcbattle.cpp b/src/devices/bus/snes_ctrl/bcbattle.cpp index dddda96de46..53f63236e31 100644 --- a/src/devices/bus/snes_ctrl/bcbattle.cpp +++ b/src/devices/bus/snes_ctrl/bcbattle.cpp @@ -81,7 +81,7 @@ void snes_bcbattle_device::device_timer(emu_timer &timer, device_timer_id id, in // snes_bcbattle_device - constructor //------------------------------------------------- -snes_bcbattle_device::snes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +snes_bcbattle_device::snes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_BARCODE_BATTLER, "Epoch Barcode Battler (SFC)", tag, owner, clock, "snes_bcbattle", __FILE__), device_snes_control_port_interface(mconfig, *this), m_reader(*this, "battler"), m_pending_code(0), m_new_code(0), m_transmitting(0), m_cur_bit(0), m_cur_byte(0), battler_timer(nullptr), m_strobe(0), m_idx(0) @@ -171,9 +171,9 @@ void snes_bcbattle_device::port_poll() // read //------------------------------------------------- -UINT8 snes_bcbattle_device::read_pin4() +uint8_t snes_bcbattle_device::read_pin4() { - UINT8 ret = 0; + uint8_t ret = 0; if (m_idx >= 80) ret |= 0x00; @@ -202,7 +202,7 @@ UINT8 snes_bcbattle_device::read_pin4() // write //------------------------------------------------- -void snes_bcbattle_device::write_strobe(UINT8 data) +void snes_bcbattle_device::write_strobe(uint8_t data) { int old = m_strobe; m_strobe = data & 0x01; diff --git a/src/devices/bus/snes_ctrl/bcbattle.h b/src/devices/bus/snes_ctrl/bcbattle.h index d336c31b6a7..fffdeb1e3f3 100644 --- a/src/devices/bus/snes_ctrl/bcbattle.h +++ b/src/devices/bus/snes_ctrl/bcbattle.h @@ -27,7 +27,7 @@ class snes_bcbattle_device : public device_t, { public: // construction/destruction - snes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -37,8 +37,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT8 read_pin4() override; - virtual void write_strobe(UINT8 data) override; + virtual uint8_t read_pin4() override; + virtual void write_strobe(uint8_t data) override; virtual void port_poll() override; int read_current_bit(); @@ -47,7 +47,7 @@ private: static const device_timer_id TIMER_BATTLER = 1; required_device m_reader; - UINT8 m_current_barcode[20]; + uint8_t m_current_barcode[20]; int m_pending_code, m_new_code, m_transmitting, m_cur_bit, m_cur_byte; emu_timer *battler_timer; diff --git a/src/devices/bus/snes_ctrl/ctrl.cpp b/src/devices/bus/snes_ctrl/ctrl.cpp index af8ed67db02..33d342e3d7f 100644 --- a/src/devices/bus/snes_ctrl/ctrl.cpp +++ b/src/devices/bus/snes_ctrl/ctrl.cpp @@ -57,7 +57,7 @@ device_snes_control_port_interface::~device_snes_control_port_interface() // snes_control_port_device - constructor //------------------------------------------------- -snes_control_port_device::snes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +snes_control_port_device::snes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_CONTROL_PORT, "Nintendo SNES / SFC control port", tag, owner, clock, "snes_control_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr) { @@ -85,29 +85,29 @@ void snes_control_port_device::device_start() } -UINT8 snes_control_port_device::read_pin4() +uint8_t snes_control_port_device::read_pin4() { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data |= m_device->read_pin4(); return data; } -UINT8 snes_control_port_device::read_pin5() +uint8_t snes_control_port_device::read_pin5() { - UINT8 data = 0; + uint8_t data = 0; if (m_device) data |= m_device->read_pin5(); return data; } -void snes_control_port_device::write_strobe(UINT8 data) +void snes_control_port_device::write_strobe(uint8_t data) { if (m_device) m_device->write_strobe(data); } -void snes_control_port_device::write_pin6(UINT8 data) +void snes_control_port_device::write_pin6(uint8_t data) { if (m_device) m_device->write_pin6(data); diff --git a/src/devices/bus/snes_ctrl/ctrl.h b/src/devices/bus/snes_ctrl/ctrl.h index 94a6a7b8ce8..5777cc4bc04 100644 --- a/src/devices/bus/snes_ctrl/ctrl.h +++ b/src/devices/bus/snes_ctrl/ctrl.h @@ -29,21 +29,21 @@ public: device_snes_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_snes_control_port_interface(); - virtual UINT8 read_pin4() { return 0; }; - virtual UINT8 read_pin5() { return 0; }; - virtual void write_pin6(UINT8 data) { }; - virtual void write_strobe(UINT8 data) { }; + virtual uint8_t read_pin4() { return 0; }; + virtual uint8_t read_pin5() { return 0; }; + virtual void write_pin6(uint8_t data) { }; + virtual void write_strobe(uint8_t data) { }; virtual void port_poll() { }; protected: snes_control_port_device *m_port; }; -typedef device_delegate snesctrl_onscreen_delegate; -#define SNESCTRL_ONSCREEN_CB(name) bool name(INT16 x, INT16 y) +typedef device_delegate snesctrl_onscreen_delegate; +#define SNESCTRL_ONSCREEN_CB(name) bool name(int16_t x, int16_t y) -typedef device_delegate snesctrl_gunlatch_delegate; -#define SNESCTRL_GUNLATCH_CB(name) void name(INT16 x, INT16 y) +typedef device_delegate snesctrl_gunlatch_delegate; +#define SNESCTRL_GUNLATCH_CB(name) void name(int16_t x, int16_t y) // ======================> snes_control_port_device @@ -52,16 +52,16 @@ class snes_control_port_device : public device_t, { public: // construction/destruction - snes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~snes_control_port_device(); static void set_onscreen_callback(device_t &device, snesctrl_onscreen_delegate callback) { downcast(device).m_onscreen_cb = callback; } static void set_gunlatch_callback(device_t &device, snesctrl_gunlatch_delegate callback) { downcast(device).m_gunlatch_cb = callback; } - UINT8 read_pin4(); - UINT8 read_pin5(); - void write_pin6(UINT8 data); - void write_strobe(UINT8 data); + uint8_t read_pin4(); + uint8_t read_pin5(); + void write_pin6(uint8_t data); + void write_strobe(uint8_t data); void port_poll(); snesctrl_onscreen_delegate m_onscreen_cb; diff --git a/src/devices/bus/snes_ctrl/joypad.cpp b/src/devices/bus/snes_ctrl/joypad.cpp index 0edea6be148..b9af5f32161 100644 --- a/src/devices/bus/snes_ctrl/joypad.cpp +++ b/src/devices/bus/snes_ctrl/joypad.cpp @@ -52,7 +52,7 @@ ioport_constructor snes_joypad_device::device_input_ports() const // snes_joypad_device - constructor //------------------------------------------------- -snes_joypad_device::snes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +snes_joypad_device::snes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_JOYPAD, "Nintendo SNES / SFC Control Pad", tag, owner, clock, "snes_joypad", __FILE__), device_snes_control_port_interface(mconfig, *this), m_joypad(*this, "JOYPAD"), m_strobe(0), m_latch(0) @@ -88,7 +88,7 @@ void snes_joypad_device::device_reset() void snes_joypad_device::port_poll() { - UINT16 temp = m_joypad->read(); + uint16_t temp = m_joypad->read(); // avoid sending signals that could crash games // if left, no right if (temp & 0x40) @@ -104,9 +104,9 @@ void snes_joypad_device::port_poll() // read //------------------------------------------------- -UINT8 snes_joypad_device::read_pin4() +uint8_t snes_joypad_device::read_pin4() { - UINT8 ret = m_latch & 1; + uint8_t ret = m_latch & 1; m_latch >>= 1; return ret; } @@ -115,7 +115,7 @@ UINT8 snes_joypad_device::read_pin4() // write //------------------------------------------------- -void snes_joypad_device::write_strobe(UINT8 data) +void snes_joypad_device::write_strobe(uint8_t data) { int old = m_strobe; m_strobe = data & 0x01; diff --git a/src/devices/bus/snes_ctrl/joypad.h b/src/devices/bus/snes_ctrl/joypad.h index 7ba3ea3e514..b1b549c2106 100644 --- a/src/devices/bus/snes_ctrl/joypad.h +++ b/src/devices/bus/snes_ctrl/joypad.h @@ -26,7 +26,7 @@ class snes_joypad_device : public device_t, { public: // construction/destruction - snes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,14 +37,14 @@ protected: virtual void device_reset() override; // device_snes_control_port_interface overrides - virtual UINT8 read_pin4() override; - virtual void write_strobe(UINT8 data) override; + virtual uint8_t read_pin4() override; + virtual void write_strobe(uint8_t data) override; virtual void port_poll() override; private: required_ioport m_joypad; int m_strobe; - UINT32 m_latch; + uint32_t m_latch; }; diff --git a/src/devices/bus/snes_ctrl/miracle.cpp b/src/devices/bus/snes_ctrl/miracle.cpp index 7ec640047de..3c5b01daa2b 100644 --- a/src/devices/bus/snes_ctrl/miracle.cpp +++ b/src/devices/bus/snes_ctrl/miracle.cpp @@ -59,7 +59,7 @@ void snes_miracle_device::device_timer(emu_timer &timer, device_timer_id id, int // snes_miracle_device - constructor //------------------------------------------------- -snes_miracle_device::snes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +snes_miracle_device::snes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_MIRACLE, "Miracle Piano SNES Cable", tag, owner, clock, "snes_miracle", __FILE__), device_serial_interface(mconfig, *this), device_snes_control_port_interface(mconfig, *this), @@ -107,9 +107,9 @@ void snes_miracle_device::device_reset() m_tx_busy = false; } -UINT8 snes_miracle_device::read_pin4() +uint8_t snes_miracle_device::read_pin4() { - UINT8 ret = 0; + uint8_t ret = 0; if (m_midi_mode == MIRACLE_MIDI_RECEIVE) { @@ -128,12 +128,12 @@ UINT8 snes_miracle_device::read_pin4() return ret; } -void snes_miracle_device::write_pin6(UINT8 data) +void snes_miracle_device::write_pin6(uint8_t data) { // printf("%02x to pin6\n", data); } -void snes_miracle_device::write_strobe(UINT8 data) +void snes_miracle_device::write_strobe(uint8_t data) { // printf("%02x to strobe\n", data); @@ -223,7 +223,7 @@ void snes_miracle_device::write_strobe(UINT8 data) void snes_miracle_device::rcv_complete() // Rx completed receiving byte { receive_register_extract(); - UINT8 rcv = get_received_char(); + uint8_t rcv = get_received_char(); // printf("Got %02x -> [%d]\n", rcv, m_recv_write); m_recvring[m_recv_write++] = rcv; @@ -252,13 +252,13 @@ void snes_miracle_device::tra_complete() // Tx completed sending byte void snes_miracle_device::tra_callback() // Tx send bit { - UINT8 bit = transmit_register_get_data_bit(); + uint8_t bit = transmit_register_get_data_bit(); // send this to midi out m_midiout->write_txd(bit); } -void snes_miracle_device::xmit_char(UINT8 data) +void snes_miracle_device::xmit_char(uint8_t data) { // if tx is busy it'll pick this up automatically when it completes // if not, send now! diff --git a/src/devices/bus/snes_ctrl/miracle.h b/src/devices/bus/snes_ctrl/miracle.h index a89b41accaf..6155511eee3 100644 --- a/src/devices/bus/snes_ctrl/miracle.h +++ b/src/devices/bus/snes_ctrl/miracle.h @@ -31,7 +31,7 @@ public: static const int RECV_RING_SIZE = 64; // construction/destruction - snes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -41,7 +41,7 @@ public: virtual void tra_complete() override; // Tx completed sending byte virtual void tra_callback() override; // Tx send bit - void xmit_char(UINT8 data); + void xmit_char(uint8_t data); required_device m_midiin, m_midiout; @@ -50,17 +50,17 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT8 read_pin4() override; - void write_pin6(UINT8 data) override; - void write_strobe(UINT8 data) override; + uint8_t read_pin4() override; + void write_pin6(uint8_t data) override; + void write_strobe(uint8_t data) override; static const device_timer_id TIMER_STROBE_ON = 0; emu_timer *strobe_timer; int m_strobe_on, m_midi_mode, m_sent_bits; - UINT32 m_strobe_clock; - UINT8 m_data_sent; - UINT8 m_xmitring[XMIT_RING_SIZE], m_recvring[RECV_RING_SIZE]; + uint32_t m_strobe_clock; + uint8_t m_data_sent; + uint8_t m_xmitring[XMIT_RING_SIZE], m_recvring[RECV_RING_SIZE]; int m_xmit_read, m_xmit_write; int m_recv_read, m_recv_write; bool m_tx_busy, m_read_status, m_status_bit; diff --git a/src/devices/bus/snes_ctrl/mouse.cpp b/src/devices/bus/snes_ctrl/mouse.cpp index fc851dc33f6..ad7e9ba3008 100644 --- a/src/devices/bus/snes_ctrl/mouse.cpp +++ b/src/devices/bus/snes_ctrl/mouse.cpp @@ -58,7 +58,7 @@ ioport_constructor snes_mouse_device::device_input_ports() const // snes_mouse_device - constructor //------------------------------------------------- -snes_mouse_device::snes_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +snes_mouse_device::snes_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_MOUSE, "Nintendo SNES / SFC Mouse Controller", tag, owner, clock, "snes_mouse", __FILE__), device_snes_control_port_interface(mconfig, *this), m_buttons(*this, "BUTTONS"), @@ -117,7 +117,7 @@ void snes_mouse_device::device_reset() void snes_mouse_device::port_poll() { - INT16 var; + int16_t var; int new_dir; m_idx = 0; m_latch = m_buttons->read(); @@ -193,9 +193,9 @@ void snes_mouse_device::port_poll() // read //------------------------------------------------- -UINT8 snes_mouse_device::read_pin4() +uint8_t snes_mouse_device::read_pin4() { - UINT8 res = 0; + uint8_t res = 0; if (m_strobe == 1) { @@ -230,7 +230,7 @@ UINT8 snes_mouse_device::read_pin4() // write //------------------------------------------------- -void snes_mouse_device::write_strobe(UINT8 data) +void snes_mouse_device::write_strobe(uint8_t data) { int old = m_strobe; m_strobe = data & 0x01; diff --git a/src/devices/bus/snes_ctrl/mouse.h b/src/devices/bus/snes_ctrl/mouse.h index 39daae165d2..94907fc6306 100644 --- a/src/devices/bus/snes_ctrl/mouse.h +++ b/src/devices/bus/snes_ctrl/mouse.h @@ -26,7 +26,7 @@ class snes_mouse_device : public device_t, { public: // construction/destruction - snes_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,8 +37,8 @@ protected: virtual void device_reset() override; // device_snes_control_port_interface overrides - virtual UINT8 read_pin4() override; - virtual void write_strobe(UINT8 data) override; + virtual uint8_t read_pin4() override; + virtual void write_strobe(uint8_t data) override; virtual void port_poll() override; private: @@ -47,10 +47,10 @@ private: required_ioport m_yaxis; int m_strobe; int m_idx; - UINT32 m_latch; + uint32_t m_latch; - INT16 m_x, m_y, m_oldx, m_oldy; - UINT8 m_deltax, m_deltay; + int16_t m_x, m_y, m_oldx, m_oldy; + uint8_t m_deltax, m_deltay; int m_speed; int m_dirx, m_diry; }; diff --git a/src/devices/bus/snes_ctrl/multitap.cpp b/src/devices/bus/snes_ctrl/multitap.cpp index 2eba8914bcb..d88f687f547 100644 --- a/src/devices/bus/snes_ctrl/multitap.cpp +++ b/src/devices/bus/snes_ctrl/multitap.cpp @@ -67,7 +67,7 @@ machine_config_constructor snes_multitap_device::device_mconfig_additions() cons // snes_multitap_device - constructor //------------------------------------------------- -snes_multitap_device::snes_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +snes_multitap_device::snes_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_MULTITAP, "Nintendo SNES / SFC Multitap Adapter", tag, owner, clock, "snes_multitap", __FILE__), device_snes_control_port_interface(mconfig, *this), m_port1(*this, "port1"), @@ -112,9 +112,9 @@ void snes_multitap_device::port_poll() // read //------------------------------------------------- -UINT8 snes_multitap_device::read_pin4() +uint8_t snes_multitap_device::read_pin4() { - UINT8 ret = 0; + uint8_t ret = 0; if (m_cfg->read() == 0) // 4P ret |= m_select ? m_port1->read_pin4() : m_port3->read_pin4(); @@ -124,9 +124,9 @@ UINT8 snes_multitap_device::read_pin4() return ret; } -UINT8 snes_multitap_device::read_pin5() +uint8_t snes_multitap_device::read_pin5() { - UINT8 ret = 0; + uint8_t ret = 0; if (m_cfg->read() == 0) // 4P ret |= m_select ? m_port2->read_pin4() : m_port4->read_pin4(); @@ -137,7 +137,7 @@ UINT8 snes_multitap_device::read_pin5() // write //------------------------------------------------- -void snes_multitap_device::write_strobe(UINT8 data) +void snes_multitap_device::write_strobe(uint8_t data) { m_port1->write_strobe(data); if (m_cfg->read() == 0) // 4P @@ -148,7 +148,7 @@ void snes_multitap_device::write_strobe(UINT8 data) } } -void snes_multitap_device::write_pin6(UINT8 data) +void snes_multitap_device::write_pin6(uint8_t data) { m_select = data & 1; } diff --git a/src/devices/bus/snes_ctrl/multitap.h b/src/devices/bus/snes_ctrl/multitap.h index edc6ee110dc..e9256ba7dbd 100644 --- a/src/devices/bus/snes_ctrl/multitap.h +++ b/src/devices/bus/snes_ctrl/multitap.h @@ -26,7 +26,7 @@ class snes_multitap_device : public device_t, { public: // construction/destruction - snes_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -38,10 +38,10 @@ protected: virtual void device_reset() override; // device_snes_control_port_interface overrides - virtual UINT8 read_pin4() override; - virtual UINT8 read_pin5() override; - virtual void write_strobe(UINT8 data) override; - virtual void write_pin6(UINT8 data) override; + virtual uint8_t read_pin4() override; + virtual uint8_t read_pin5() override; + virtual void write_strobe(uint8_t data) override; + virtual void write_pin6(uint8_t data) override; virtual void port_poll() override; private: diff --git a/src/devices/bus/snes_ctrl/pachinko.cpp b/src/devices/bus/snes_ctrl/pachinko.cpp index ecdc1b21fe5..10ddda50d52 100644 --- a/src/devices/bus/snes_ctrl/pachinko.cpp +++ b/src/devices/bus/snes_ctrl/pachinko.cpp @@ -44,7 +44,7 @@ ioport_constructor snes_pachinko_device::device_input_ports() const // snes_pachinko_device - constructor //------------------------------------------------- -snes_pachinko_device::snes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +snes_pachinko_device::snes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_PACHINKO, "Sunsoft Pachinko Controller", tag, owner, clock, "snes_pachinko", __FILE__), device_snes_control_port_interface(mconfig, *this), m_dial(*this, "DIAL"), @@ -81,7 +81,7 @@ void snes_pachinko_device::device_reset() void snes_pachinko_device::port_poll() { - UINT8 dial = BITSWAP8(m_dial->read() ^ 0xff,7,6,5,4,3,2,1,0); + uint8_t dial = BITSWAP8(m_dial->read() ^ 0xff,7,6,5,4,3,2,1,0); m_latch = m_button->read() | (dial << 25) | 0xee7000; // add ID } @@ -89,9 +89,9 @@ void snes_pachinko_device::port_poll() // read //------------------------------------------------- -UINT8 snes_pachinko_device::read_pin4() +uint8_t snes_pachinko_device::read_pin4() { - UINT8 ret = m_latch & 1; + uint8_t ret = m_latch & 1; m_latch >>= 1; return ret; } @@ -100,7 +100,7 @@ UINT8 snes_pachinko_device::read_pin4() // write //------------------------------------------------- -void snes_pachinko_device::write_strobe(UINT8 data) +void snes_pachinko_device::write_strobe(uint8_t data) { int old = m_strobe; m_strobe = data & 0x01; diff --git a/src/devices/bus/snes_ctrl/pachinko.h b/src/devices/bus/snes_ctrl/pachinko.h index d340a1c8689..ba41a168e25 100644 --- a/src/devices/bus/snes_ctrl/pachinko.h +++ b/src/devices/bus/snes_ctrl/pachinko.h @@ -26,7 +26,7 @@ class snes_pachinko_device : public device_t, { public: // construction/destruction - snes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,15 +37,15 @@ protected: virtual void device_reset() override; // device_snes_control_port_interface overrides - virtual UINT8 read_pin4() override; - virtual void write_strobe(UINT8 data) override; + virtual uint8_t read_pin4() override; + virtual void write_strobe(uint8_t data) override; virtual void port_poll() override; private: required_ioport m_dial; required_ioport m_button; int m_strobe; - UINT32 m_latch; + uint32_t m_latch; }; diff --git a/src/devices/bus/snes_ctrl/sscope.cpp b/src/devices/bus/snes_ctrl/sscope.cpp index 3f26fe562c4..58243314935 100644 --- a/src/devices/bus/snes_ctrl/sscope.cpp +++ b/src/devices/bus/snes_ctrl/sscope.cpp @@ -53,7 +53,7 @@ ioport_constructor snes_sscope_device::device_input_ports() const // snes_sscope_device - constructor //------------------------------------------------- -snes_sscope_device::snes_sscope_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +snes_sscope_device::snes_sscope_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_SUPERSCOPE, "Nintendo SNES / SFC SuperScope", tag, owner, clock, "snes_sscope", __FILE__), device_snes_control_port_interface(mconfig, *this), m_buttons(*this, "BUTTONS"), @@ -103,7 +103,7 @@ void snes_sscope_device::device_reset() void snes_sscope_device::port_poll() { // first read input bits - UINT8 input = m_buttons->read(); + uint8_t input = m_buttons->read(); m_x = m_xaxis->read(); m_y = m_yaxis->read(); m_idx = 0; @@ -159,9 +159,9 @@ void snes_sscope_device::port_poll() // read //------------------------------------------------- -UINT8 snes_sscope_device::read_pin4() +uint8_t snes_sscope_device::read_pin4() { - UINT8 res = 0; + uint8_t res = 0; if (m_idx >= 8) // bits 8-15 = ID = all 1s; bits >= 16 all 1s res |= 0x01; @@ -175,7 +175,7 @@ UINT8 snes_sscope_device::read_pin4() // write //------------------------------------------------- -void snes_sscope_device::write_strobe(UINT8 data) +void snes_sscope_device::write_strobe(uint8_t data) { int old = m_strobe; m_strobe = data & 0x01; diff --git a/src/devices/bus/snes_ctrl/sscope.h b/src/devices/bus/snes_ctrl/sscope.h index d625bc237ea..e060b228759 100644 --- a/src/devices/bus/snes_ctrl/sscope.h +++ b/src/devices/bus/snes_ctrl/sscope.h @@ -26,7 +26,7 @@ class snes_sscope_device : public device_t, { public: // construction/destruction - snes_sscope_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_sscope_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,8 +37,8 @@ protected: virtual void device_reset() override; // device_snes_control_port_interface overrides - virtual UINT8 read_pin4() override; - virtual void write_strobe(UINT8 data) override; + virtual uint8_t read_pin4() override; + virtual void write_strobe(uint8_t data) override; virtual void port_poll() override; private: @@ -46,9 +46,9 @@ private: required_ioport m_xaxis; required_ioport m_yaxis; int m_strobe, m_idx; - UINT32 m_latch; + uint32_t m_latch; - INT16 m_x, m_y; + int16_t m_x, m_y; int m_turbo_lock, m_pause_lock, m_fire_lock; }; diff --git a/src/devices/bus/snes_ctrl/twintap.cpp b/src/devices/bus/snes_ctrl/twintap.cpp index 29db7df0029..5377ca8fb4f 100644 --- a/src/devices/bus/snes_ctrl/twintap.cpp +++ b/src/devices/bus/snes_ctrl/twintap.cpp @@ -49,7 +49,7 @@ ioport_constructor snes_twintap_device::device_input_ports() const // snes_twintap_device - constructor //------------------------------------------------- -snes_twintap_device::snes_twintap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +snes_twintap_device::snes_twintap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_TWINTAP, "Yonezawa Twin Tap Controller", tag, owner, clock, "snes_twintap", __FILE__), device_snes_control_port_interface(mconfig, *this), m_inputs(*this, "INPUTS"), m_strobe(0), m_latch(0) @@ -92,9 +92,9 @@ void snes_twintap_device::port_poll() // read //------------------------------------------------- -UINT8 snes_twintap_device::read_pin4() +uint8_t snes_twintap_device::read_pin4() { - UINT8 ret = m_latch & 1; + uint8_t ret = m_latch & 1; m_latch >>= 1; return ret; } @@ -103,7 +103,7 @@ UINT8 snes_twintap_device::read_pin4() // write //------------------------------------------------- -void snes_twintap_device::write_strobe(UINT8 data) +void snes_twintap_device::write_strobe(uint8_t data) { int old = m_strobe; m_strobe = data & 0x01; diff --git a/src/devices/bus/snes_ctrl/twintap.h b/src/devices/bus/snes_ctrl/twintap.h index 085a9ead09c..cf8934901bc 100644 --- a/src/devices/bus/snes_ctrl/twintap.h +++ b/src/devices/bus/snes_ctrl/twintap.h @@ -26,7 +26,7 @@ class snes_twintap_device : public device_t, { public: // construction/destruction - snes_twintap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_twintap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,14 +37,14 @@ protected: virtual void device_reset() override; // device_snes_control_port_interface overrides - virtual UINT8 read_pin4() override; - virtual void write_strobe(UINT8 data) override; + virtual uint8_t read_pin4() override; + virtual void write_strobe(uint8_t data) override; virtual void port_poll() override; private: required_ioport m_inputs; int m_strobe; - UINT32 m_latch; + uint32_t m_latch; }; diff --git a/src/devices/bus/spc1000/exp.cpp b/src/devices/bus/spc1000/exp.cpp index 83d919215a1..b90c59ecc93 100644 --- a/src/devices/bus/spc1000/exp.cpp +++ b/src/devices/bus/spc1000/exp.cpp @@ -35,7 +35,7 @@ device_spc1000_card_interface::~device_spc1000_card_interface() //------------------------------------------------- // spc1000_exp_device - constructor //------------------------------------------------- -spc1000_exp_device::spc1000_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +spc1000_exp_device::spc1000_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SPC1000_EXP_SLOT, "Samsung SPC-1000 expansion", tag, owner, clock, "spc1000_exp", __FILE__), device_slot_interface(mconfig, *this), m_card(nullptr) { diff --git a/src/devices/bus/spc1000/exp.h b/src/devices/bus/spc1000/exp.h index e48e9efe3c8..1e63ff4a57d 100644 --- a/src/devices/bus/spc1000/exp.h +++ b/src/devices/bus/spc1000/exp.h @@ -25,7 +25,7 @@ class spc1000_exp_device : public device_t, { public: // construction/destruction - spc1000_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + spc1000_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~spc1000_exp_device(); // device-level overrides diff --git a/src/devices/bus/spc1000/fdd.cpp b/src/devices/bus/spc1000/fdd.cpp index 5e624862e23..13a32cfb808 100644 --- a/src/devices/bus/spc1000/fdd.cpp +++ b/src/devices/bus/spc1000/fdd.cpp @@ -134,7 +134,7 @@ const device_type SPC1000_FDD_EXP = &device_creator; // spc1000_fdd_exp_device - constructor //------------------------------------------------- -spc1000_fdd_exp_device::spc1000_fdd_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +spc1000_fdd_exp_device::spc1000_fdd_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SPC1000_FDD_EXP, "SPC1000 FDD expansion", tag, owner, clock, "spc1000_fdd_exp", __FILE__), device_spc1000_card_interface(mconfig, *this), m_cpu(*this, "fdccpu"), @@ -190,7 +190,7 @@ READ8_MEMBER(spc1000_fdd_exp_device::read) return 0xff; else { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { case 1: diff --git a/src/devices/bus/spc1000/fdd.h b/src/devices/bus/spc1000/fdd.h index 51c53d74f1f..b52d6091cba 100644 --- a/src/devices/bus/spc1000/fdd.h +++ b/src/devices/bus/spc1000/fdd.h @@ -19,7 +19,7 @@ class spc1000_fdd_exp_device : public device_t, { public: // construction/destruction - spc1000_fdd_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + spc1000_fdd_exp_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; @@ -50,9 +50,9 @@ private: emu_timer *m_timer_tc; - UINT8 m_i8255_0_pc; - UINT8 m_i8255_1_pc; - UINT8 m_i8255_portb; + uint8_t m_i8255_0_pc; + uint8_t m_i8255_1_pc; + uint8_t m_i8255_portb; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; static const device_timer_id TIMER_TC = 0; diff --git a/src/devices/bus/spc1000/vdp.cpp b/src/devices/bus/spc1000/vdp.cpp index 7824e9fccb4..0f055ef6382 100644 --- a/src/devices/bus/spc1000/vdp.cpp +++ b/src/devices/bus/spc1000/vdp.cpp @@ -52,7 +52,7 @@ const device_type SPC1000_VDP_EXP = &device_creator; // spc1000_vdp_exp_device - constructor //------------------------------------------------- -spc1000_vdp_exp_device::spc1000_vdp_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +spc1000_vdp_exp_device::spc1000_vdp_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SPC1000_VDP_EXP, "SPC1000 VDP expansion", tag, owner, clock, "spc1000_vdp_exp", __FILE__), device_spc1000_card_interface(mconfig, *this), m_vdp(*this, "tms") diff --git a/src/devices/bus/spc1000/vdp.h b/src/devices/bus/spc1000/vdp.h index 20a0e23acd7..0c22dcbcfc0 100644 --- a/src/devices/bus/spc1000/vdp.h +++ b/src/devices/bus/spc1000/vdp.h @@ -18,7 +18,7 @@ class spc1000_vdp_exp_device : public device_t, { public: // construction/destruction - spc1000_vdp_exp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + spc1000_vdp_exp_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; diff --git a/src/devices/bus/sunkbd/hlekbd.cpp b/src/devices/bus/sunkbd/hlekbd.cpp index 8696a97d704..e2a38d0f358 100644 --- a/src/devices/bus/sunkbd/hlekbd.cpp +++ b/src/devices/bus/sunkbd/hlekbd.cpp @@ -755,7 +755,7 @@ hle_device_base::hle_device_base( char const *name, char const *tag, device_t *owner, - UINT32 clock, + uint32_t clock, char const *shortname, char const *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) @@ -880,7 +880,7 @@ void hle_device_base::device_timer(emu_timer &timer, device_timer_id id, int par switch (id) { case CLICK_TIMER_ID: - m_beeper_state &= ~UINT8(BEEPER_CLICK); + m_beeper_state &= ~uint8_t(BEEPER_CLICK); m_beeper->set_state(m_beeper_state ? 1 : 0); break; @@ -922,7 +922,7 @@ void hle_device_base::tra_complete() handle a key being pressed --------------------------------------------------*/ -void hle_device_base::key_make(UINT8 row, UINT8 column) +void hle_device_base::key_make(uint8_t row, uint8_t column) { // we should have stopped processing if we filled the FIFO assert(!fifo_full()); @@ -931,7 +931,7 @@ void hle_device_base::key_make(UINT8 row, UINT8 column) transmit_byte((row << 4) | column); if (m_keyclick) { - m_beeper_state |= UINT8(BEEPER_CLICK); + m_beeper_state |= uint8_t(BEEPER_CLICK); m_beeper->set_state(m_beeper_state ? 1 : 0); m_click_timer->reset(attotime::from_msec(5)); } @@ -947,7 +947,7 @@ void hle_device_base::key_make(UINT8 row, UINT8 column) handle a key being released --------------------------------------------------*/ -void hle_device_base::key_break(UINT8 row, UINT8 column) +void hle_device_base::key_break(uint8_t row, uint8_t column) { // we should have stopped processing if we filled the FIFO assert(!fifo_full()); @@ -968,7 +968,7 @@ void hle_device_base::key_break(UINT8 row, UINT8 column) send a byte or queue it to send later --------------------------------------------------*/ -void hle_device_base::transmit_byte(UINT8 byte) +void hle_device_base::transmit_byte(uint8_t byte) { device_buffered_serial_interface::transmit_byte(byte); if (fifo_full()) @@ -981,7 +981,7 @@ void hle_device_base::transmit_byte(UINT8 byte) handle received byte frame --------------------------------------------------*/ -void hle_device_base::received_byte(UINT8 byte) +void hle_device_base::received_byte(uint8_t byte) { switch (m_rx_state) { @@ -1004,13 +1004,13 @@ void hle_device_base::received_byte(UINT8 byte) break; case COMMAND_BELL_ON: - m_beeper_state |= UINT8(BEEPER_BELL); + m_beeper_state |= uint8_t(BEEPER_BELL); m_beeper->set_state(m_beeper_state ? 1 : 0); m_rx_state = RX_IDLE; break; case COMMAND_BELL_OFF: - m_beeper_state &= ~UINT8(BEEPER_BELL); + m_beeper_state &= ~uint8_t(BEEPER_BELL); m_beeper->set_state(m_beeper_state ? 1 : 0); m_rx_state = RX_IDLE; break; @@ -1023,7 +1023,7 @@ void hle_device_base::received_byte(UINT8 byte) case COMMAND_CLICK_OFF: m_keyclick = 0U; m_click_timer->reset(); - m_beeper_state &= ~UINT8(BEEPER_CLICK); + m_beeper_state &= ~uint8_t(BEEPER_CLICK); m_beeper->set_state(m_beeper_state ? 1 : 0); m_rx_state = RX_IDLE; break; @@ -1034,7 +1034,7 @@ void hle_device_base::received_byte(UINT8 byte) case COMMAND_LAYOUT: transmit_byte(0xfeU); - transmit_byte(UINT8(m_dips->read() & 0x3fU)); + transmit_byte(uint8_t(m_dips->read() & 0x3fU)); m_rx_state = RX_IDLE; break; @@ -1057,7 +1057,7 @@ void hle_device_base::received_byte(UINT8 byte) response --------------------------------------------------*/ -UINT8 hle_type4_device_base::ident_byte() +uint8_t hle_type4_device_base::ident_byte() { return (m_dips->read() & 0x80U) ? 0x03U : 0x04U; } @@ -1077,7 +1077,7 @@ hle_type3_device::hle_type3_device( machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock) + uint32_t clock) : hle_device_base( mconfig, SUN_TYPE3_HLE_KEYBOARD, @@ -1108,7 +1108,7 @@ ioport_constructor hle_type3_device::device_input_ports() const response --------------------------------------------------*/ -UINT8 hle_type3_device::ident_byte() +uint8_t hle_type3_device::ident_byte() { return 0x03U; } @@ -1128,7 +1128,7 @@ hle_type4_device::hle_type4_device( machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock) + uint32_t clock) : hle_type4_device_base( mconfig, SUN_TYPE4_HLE_KEYBOARD, @@ -1167,7 +1167,7 @@ hle_type5_device::hle_type5_device( machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock) + uint32_t clock) : hle_type4_device_base( mconfig, SUN_TYPE5_HLE_KEYBOARD, @@ -1206,7 +1206,7 @@ hle_type5_gb_device::hle_type5_gb_device( machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock) + uint32_t clock) : hle_type4_device_base( mconfig, SUN_TYPE5_HLE_KEYBOARD, @@ -1245,7 +1245,7 @@ hle_type5_se_device::hle_type5_se_device( machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock) + uint32_t clock) : hle_type4_device_base( mconfig, SUN_TYPE5_HLE_KEYBOARD, @@ -1284,7 +1284,7 @@ hle_type5_jp_device::hle_type5_jp_device( machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock) + uint32_t clock) : hle_type4_device_base( mconfig, SUN_TYPE5_HLE_KEYBOARD, diff --git a/src/devices/bus/sunkbd/hlekbd.h b/src/devices/bus/sunkbd/hlekbd.h index c34e438a53a..059c18caf06 100644 --- a/src/devices/bus/sunkbd/hlekbd.h +++ b/src/devices/bus/sunkbd/hlekbd.h @@ -37,7 +37,7 @@ protected: device_type type, char const *name, char const *tag, device_t *owner, - UINT32 clock, + uint32_t clock, char const *shortname, char const *source); virtual ~hle_device_base() override; @@ -52,11 +52,11 @@ protected: virtual void tra_complete() override; // device_matrix_keyboard_interface overrides - 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; // customised transmit_byte method - void transmit_byte(UINT8 byte); + void transmit_byte(uint8_t byte); required_ioport m_dips; @@ -76,17 +76,17 @@ private: LED_KANA }; - enum : UINT8 { + enum : uint8_t { BEEPER_BELL = 0x01U, BEEPER_CLICK = 0x02U }; - enum : UINT8 { + enum : uint8_t { RX_IDLE, RX_LED }; - enum : UINT8 { + enum : uint8_t { COMMAND_RESET = 0x01U, COMMAND_BELL_ON = 0x02U, COMMAND_BELL_OFF = 0x03U, @@ -97,18 +97,18 @@ private: }; // device_buffered_serial_interface overrides - virtual void received_byte(UINT8 byte) override; + virtual void received_byte(uint8_t byte) override; - virtual UINT8 ident_byte() = 0; + virtual uint8_t ident_byte() = 0; emu_timer *m_click_timer; required_device m_beeper; - UINT8 m_make_count; - UINT8 m_rx_state; + uint8_t m_make_count; + uint8_t m_rx_state; - UINT8 m_keyclick; - UINT8 m_beeper_state; + uint8_t m_keyclick; + uint8_t m_beeper_state; }; @@ -118,7 +118,7 @@ protected: using hle_device_base::hle_device_base; private: - virtual UINT8 ident_byte() override; + virtual uint8_t ident_byte() override; }; @@ -129,12 +129,12 @@ public: machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock); + uint32_t clock); virtual ioport_constructor device_input_ports() const override; private: - virtual UINT8 ident_byte() override; + virtual uint8_t ident_byte() override; }; @@ -145,7 +145,7 @@ public: machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock); + uint32_t clock); virtual ioport_constructor device_input_ports() const override; }; @@ -158,7 +158,7 @@ public: machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock); + uint32_t clock); virtual ioport_constructor device_input_ports() const override; }; @@ -171,7 +171,7 @@ public: machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock); + uint32_t clock); virtual ioport_constructor device_input_ports() const override; }; @@ -184,7 +184,7 @@ public: machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock); + uint32_t clock); virtual ioport_constructor device_input_ports() const override; }; @@ -197,7 +197,7 @@ public: machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock); + uint32_t clock); virtual ioport_constructor device_input_ports() const override; }; diff --git a/src/devices/bus/sunkbd/sunkbd.cpp b/src/devices/bus/sunkbd/sunkbd.cpp index 23037d82904..ed0225c2785 100644 --- a/src/devices/bus/sunkbd/sunkbd.cpp +++ b/src/devices/bus/sunkbd/sunkbd.cpp @@ -19,7 +19,7 @@ sun_keyboard_port_device::sun_keyboard_port_device( machine_config const &mconfig, char const *tag, device_t *owner, - UINT32 clock) + uint32_t clock) : sun_keyboard_port_device(mconfig, SUNKBD_PORT, "Sun Keyboard Port", tag, owner, clock, "sunkbd", __FILE__) { } @@ -31,7 +31,7 @@ sun_keyboard_port_device::sun_keyboard_port_device( char const *name, char const *tag, device_t *owner, - UINT32 clock, + uint32_t clock, char const *shortname, char const *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) diff --git a/src/devices/bus/sunkbd/sunkbd.h b/src/devices/bus/sunkbd/sunkbd.h index 006d914dff0..9d840854029 100644 --- a/src/devices/bus/sunkbd/sunkbd.h +++ b/src/devices/bus/sunkbd/sunkbd.h @@ -24,8 +24,8 @@ class sun_keyboard_port_device : public device_t, public device_slot_interface friend class device_sun_keyboard_port_interface; public: - sun_keyboard_port_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); - sun_keyboard_port_device(machine_config const &mconfig, device_type type, char const *name, char const *tag, device_t *owner, UINT32 clock, char const *shortname, char const *source); + sun_keyboard_port_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); + sun_keyboard_port_device(machine_config const &mconfig, device_type type, char const *name, char const *tag, device_t *owner, uint32_t clock, char const *shortname, char const *source); virtual ~sun_keyboard_port_device(); // static configuration helpers diff --git a/src/devices/bus/svi3x8/expander/expander.cpp b/src/devices/bus/svi3x8/expander/expander.cpp index 4ce0145f667..176b697a634 100644 --- a/src/devices/bus/svi3x8/expander/expander.cpp +++ b/src/devices/bus/svi3x8/expander/expander.cpp @@ -26,7 +26,7 @@ const device_type SVI_EXPANDER = &device_creator; // svi_expander_device - constructor //------------------------------------------------- -svi_expander_device::svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +svi_expander_device::svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SVI_EXPANDER, "SVI 318/328 Expander Bus", tag, owner, clock, "svi_expander", __FILE__), device_slot_interface(mconfig, *this), m_module(nullptr), diff --git a/src/devices/bus/svi3x8/expander/expander.h b/src/devices/bus/svi3x8/expander/expander.h index 98c2b8af348..9dc4a76422b 100644 --- a/src/devices/bus/svi3x8/expander/expander.h +++ b/src/devices/bus/svi3x8/expander/expander.h @@ -83,7 +83,7 @@ class svi_expander_device : public device_t, public device_slot_interface { public: // construction/destruction - svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + svi_expander_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~svi_expander_device(); // callbacks diff --git a/src/devices/bus/svi3x8/expander/sv601.cpp b/src/devices/bus/svi3x8/expander/sv601.cpp index 6f29b12b6e2..60b116e0a72 100644 --- a/src/devices/bus/svi3x8/expander/sv601.cpp +++ b/src/devices/bus/svi3x8/expander/sv601.cpp @@ -48,7 +48,7 @@ machine_config_constructor sv601_device::device_mconfig_additions() const // sv601_device - constructor //------------------------------------------------- -sv601_device::sv601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sv601_device::sv601_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SV601, "SV-601 Super Expander", tag, owner, clock, "sv601", __FILE__), device_svi_expander_interface(mconfig, *this), m_slotbus(*this, "slotbus") diff --git a/src/devices/bus/svi3x8/expander/sv601.h b/src/devices/bus/svi3x8/expander/sv601.h index 1e0eb86c507..3db3719b884 100644 --- a/src/devices/bus/svi3x8/expander/sv601.h +++ b/src/devices/bus/svi3x8/expander/sv601.h @@ -26,7 +26,7 @@ class sv601_device : public device_t, public device_svi_expander_interface { public: // construction/destruction - sv601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sv601_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // from slots WRITE_LINE_MEMBER( int_w ); diff --git a/src/devices/bus/svi3x8/expander/sv602.cpp b/src/devices/bus/svi3x8/expander/sv602.cpp index aef20a8e464..1a05777cb8e 100644 --- a/src/devices/bus/svi3x8/expander/sv602.cpp +++ b/src/devices/bus/svi3x8/expander/sv602.cpp @@ -42,7 +42,7 @@ machine_config_constructor sv602_device::device_mconfig_additions() const // sv602_device - constructor //------------------------------------------------- -sv602_device::sv602_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sv602_device::sv602_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SV602, "SV-602 Single Slot Expander", tag, owner, clock, "sv602", __FILE__), device_svi_expander_interface(mconfig, *this), m_slotbus(*this, "slotbus") diff --git a/src/devices/bus/svi3x8/expander/sv602.h b/src/devices/bus/svi3x8/expander/sv602.h index 2026302d293..0abaccd6d4d 100644 --- a/src/devices/bus/svi3x8/expander/sv602.h +++ b/src/devices/bus/svi3x8/expander/sv602.h @@ -26,7 +26,7 @@ class sv602_device : public device_t, public device_svi_expander_interface { public: // construction/destruction - sv602_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sv602_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // from slots WRITE_LINE_MEMBER( int_w ); diff --git a/src/devices/bus/svi3x8/expander/sv603.cpp b/src/devices/bus/svi3x8/expander/sv603.cpp index f6baca7d2ac..1adc323377e 100644 --- a/src/devices/bus/svi3x8/expander/sv603.cpp +++ b/src/devices/bus/svi3x8/expander/sv603.cpp @@ -59,7 +59,7 @@ machine_config_constructor sv603_device::device_mconfig_additions() const DEVICE_IMAGE_LOAD_MEMBER( sv603_device, cartridge ) { - UINT32 size = m_cart_rom->common_get_size("rom"); + uint32_t size = m_cart_rom->common_get_size("rom"); m_cart_rom->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); m_cart_rom->common_load_rom(m_cart_rom->get_rom_base(), size, "rom"); @@ -76,7 +76,7 @@ DEVICE_IMAGE_LOAD_MEMBER( sv603_device, cartridge ) // sv603_device - constructor //------------------------------------------------- -sv603_device::sv603_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sv603_device::sv603_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SV603, "SV-603 Coleco Game Adapter", tag, owner, clock, "sv603", __FILE__), device_svi_expander_interface(mconfig, *this), m_bios(*this, "bios"), diff --git a/src/devices/bus/svi3x8/expander/sv603.h b/src/devices/bus/svi3x8/expander/sv603.h index eb58a51b003..aec93de11a0 100644 --- a/src/devices/bus/svi3x8/expander/sv603.h +++ b/src/devices/bus/svi3x8/expander/sv603.h @@ -28,7 +28,7 @@ class sv603_device : public device_t, public device_svi_expander_interface { public: // construction/destruction - sv603_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sv603_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // from host virtual DECLARE_READ8_MEMBER( mreq_r ) override; diff --git a/src/devices/bus/svi3x8/slot/slot.cpp b/src/devices/bus/svi3x8/slot/slot.cpp index d713f2d3322..87564889d82 100644 --- a/src/devices/bus/svi3x8/slot/slot.cpp +++ b/src/devices/bus/svi3x8/slot/slot.cpp @@ -19,7 +19,7 @@ const device_type SVI_SLOT_BUS = &device_creator; // svi_slot_bus_device - constructor //------------------------------------------------- -svi_slot_bus_device::svi_slot_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +svi_slot_bus_device::svi_slot_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SVI_SLOT_BUS, "SVI Slot Bus", tag, owner, clock, "svislotbus", __FILE__), m_int_handler(*this), m_romdis_handler(*this), @@ -73,7 +73,7 @@ void svi_slot_bus_device::add_card(device_svi_slot_interface *card) READ8_MEMBER( svi_slot_bus_device::mreq_r ) { device_svi_slot_interface *entry = m_dev.first(); - UINT8 data = 0xff; + uint8_t data = 0xff; while (entry) { @@ -106,7 +106,7 @@ WRITE8_MEMBER( svi_slot_bus_device::mreq_w ) READ8_MEMBER( svi_slot_bus_device::iorq_r ) { device_svi_slot_interface *entry = m_dev.first(); - UINT8 data = 0xff; + uint8_t data = 0xff; while (entry) { @@ -203,7 +203,7 @@ const device_type SVI_SLOT = &device_creator; // svi_slot_device - constructor //------------------------------------------------- -svi_slot_device::svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +svi_slot_device::svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SVI_SLOT, "SVI Slot", tag, owner, clock, "svislot", __FILE__), device_slot_interface(mconfig, *this), m_bus_tag(nullptr) diff --git a/src/devices/bus/svi3x8/slot/slot.h b/src/devices/bus/svi3x8/slot/slot.h index f7f2be940ef..ba636d0e9cc 100644 --- a/src/devices/bus/svi3x8/slot/slot.h +++ b/src/devices/bus/svi3x8/slot/slot.h @@ -76,7 +76,7 @@ class svi_slot_bus_device : public device_t { public: // construction/destruction - svi_slot_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + svi_slot_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~svi_slot_bus_device(); // callbacks @@ -128,7 +128,7 @@ class svi_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + svi_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration static void set_bus(device_t &device, device_t *owner, const char *bus_tag); diff --git a/src/devices/bus/svi3x8/slot/sv801.cpp b/src/devices/bus/svi3x8/slot/sv801.cpp index bccfd1539eb..892d8047ad5 100644 --- a/src/devices/bus/svi3x8/slot/sv801.cpp +++ b/src/devices/bus/svi3x8/slot/sv801.cpp @@ -55,7 +55,7 @@ machine_config_constructor sv801_device::device_mconfig_additions() const // sv801_device - constructor //------------------------------------------------- -sv801_device::sv801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sv801_device::sv801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SV801, "SV-801 Disk Controller", tag, owner, clock, "sv801", __FILE__), device_svi_slot_interface(mconfig, *this), m_fdc(*this, "fdc"), diff --git a/src/devices/bus/svi3x8/slot/sv801.h b/src/devices/bus/svi3x8/slot/sv801.h index 2f670f05ad1..e3354faeff6 100644 --- a/src/devices/bus/svi3x8/slot/sv801.h +++ b/src/devices/bus/svi3x8/slot/sv801.h @@ -27,7 +27,7 @@ class sv801_device : public device_t, public device_svi_slot_interface { public: // construction/destruction - sv801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sv801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_FLOPPY_FORMATS(floppy_formats); diff --git a/src/devices/bus/svi3x8/slot/sv802.cpp b/src/devices/bus/svi3x8/slot/sv802.cpp index adeed63588b..710d17e4971 100644 --- a/src/devices/bus/svi3x8/slot/sv802.cpp +++ b/src/devices/bus/svi3x8/slot/sv802.cpp @@ -41,7 +41,7 @@ machine_config_constructor sv802_device::device_mconfig_additions() const // sv802_device - constructor //------------------------------------------------- -sv802_device::sv802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sv802_device::sv802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SV805, "SV-802 Centronics Printer Interface", tag, owner, clock, "sv802", __FILE__), device_svi_slot_interface(mconfig, *this), m_centronics(*this, "centronics"), diff --git a/src/devices/bus/svi3x8/slot/sv802.h b/src/devices/bus/svi3x8/slot/sv802.h index 0b363c035ed..3950ce05274 100644 --- a/src/devices/bus/svi3x8/slot/sv802.h +++ b/src/devices/bus/svi3x8/slot/sv802.h @@ -27,7 +27,7 @@ class sv802_device : public device_t, public device_svi_slot_interface { public: // construction/destruction - sv802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sv802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER( iorq_r ) override; virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; diff --git a/src/devices/bus/svi3x8/slot/sv803.cpp b/src/devices/bus/svi3x8/slot/sv803.cpp index 8db3cf1f601..a8665b04ab8 100644 --- a/src/devices/bus/svi3x8/slot/sv803.cpp +++ b/src/devices/bus/svi3x8/slot/sv803.cpp @@ -24,11 +24,11 @@ const device_type SV803 = &device_creator; // sv803_device - constructor //------------------------------------------------- -sv803_device::sv803_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sv803_device::sv803_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SV803, "SV-803 16k RAM Cartridge", tag, owner, clock, "sv803", __FILE__), device_svi_slot_interface(mconfig, *this) { - m_ram = std::make_unique(0x4000); + m_ram = std::make_unique(0x4000); memset(m_ram.get(), 0xff, 0x4000); } diff --git a/src/devices/bus/svi3x8/slot/sv803.h b/src/devices/bus/svi3x8/slot/sv803.h index 9dea0ea9180..b930e647cdc 100644 --- a/src/devices/bus/svi3x8/slot/sv803.h +++ b/src/devices/bus/svi3x8/slot/sv803.h @@ -25,7 +25,7 @@ class sv803_device : public device_t, public device_svi_slot_interface { public: // construction/destruction - sv803_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sv803_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER( mreq_r ) override; virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; @@ -35,7 +35,7 @@ protected: virtual void device_reset() override; private: - std::unique_ptr m_ram; + std::unique_ptr m_ram; }; // device type definition diff --git a/src/devices/bus/svi3x8/slot/sv805.cpp b/src/devices/bus/svi3x8/slot/sv805.cpp index 71ba5b69820..2eb1e217671 100644 --- a/src/devices/bus/svi3x8/slot/sv805.cpp +++ b/src/devices/bus/svi3x8/slot/sv805.cpp @@ -48,7 +48,7 @@ machine_config_constructor sv805_device::device_mconfig_additions() const // sv805_device - constructor //------------------------------------------------- -sv805_device::sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sv805_device::sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SV805, "SV-805 RS-232 Interface", tag, owner, clock, "sv805", __FILE__), device_svi_slot_interface(mconfig, *this), m_uart(*this, "uart"), diff --git a/src/devices/bus/svi3x8/slot/sv805.h b/src/devices/bus/svi3x8/slot/sv805.h index 6d64ef54256..fda554f901c 100644 --- a/src/devices/bus/svi3x8/slot/sv805.h +++ b/src/devices/bus/svi3x8/slot/sv805.h @@ -27,7 +27,7 @@ class sv805_device : public device_t, public device_svi_slot_interface { public: // construction/destruction - sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER( iorq_r ) override; virtual DECLARE_WRITE8_MEMBER( iorq_w ) override; diff --git a/src/devices/bus/svi3x8/slot/sv806.cpp b/src/devices/bus/svi3x8/slot/sv806.cpp index 87f35b268f7..13b0ebd105d 100644 --- a/src/devices/bus/svi3x8/slot/sv806.cpp +++ b/src/devices/bus/svi3x8/slot/sv806.cpp @@ -64,7 +64,7 @@ machine_config_constructor sv806_device::device_mconfig_additions() const // sv806_device - constructor //------------------------------------------------- -sv806_device::sv806_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sv806_device::sv806_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SV806, "SV-806 80 Column Cartridge", tag, owner, clock, "sv806", __FILE__), device_svi_slot_interface(mconfig, *this), m_crtc(*this, "crtc"), @@ -72,7 +72,7 @@ sv806_device::sv806_device(const machine_config &mconfig, const char *tag, devic m_gfx(*this, "gfx"), m_ram_enabled(0) { - m_ram = std::make_unique(0x800); + m_ram = std::make_unique(0x800); memset(m_ram.get(), 0xff, 0x800); } @@ -98,7 +98,7 @@ MC6845_UPDATE_ROW( sv806_device::crtc_update_row ) for (int i = 0; i < x_count; i++) { - UINT8 data = m_gfx->u8((m_ram[(ma + i) & 0x7ff] << 4) | ra); + uint8_t data = m_gfx->u8((m_ram[(ma + i) & 0x7ff] << 4) | ra); if (i == cursor_x) data = 0xff; diff --git a/src/devices/bus/svi3x8/slot/sv806.h b/src/devices/bus/svi3x8/slot/sv806.h index 2a3071ed8ec..336a2ea99d7 100644 --- a/src/devices/bus/svi3x8/slot/sv806.h +++ b/src/devices/bus/svi3x8/slot/sv806.h @@ -26,7 +26,7 @@ class sv806_device : public device_t, public device_svi_slot_interface { public: // construction/destruction - sv806_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sv806_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER( mreq_r ) override; virtual DECLARE_WRITE8_MEMBER( mreq_w ) override; @@ -45,7 +45,7 @@ private: required_device m_palette; required_memory_region m_gfx; - std::unique_ptr m_ram; + std::unique_ptr m_ram; int m_ram_enabled; }; diff --git a/src/devices/bus/svi3x8/slot/sv807.cpp b/src/devices/bus/svi3x8/slot/sv807.cpp index 4f55f6c8e30..17cd09f603f 100644 --- a/src/devices/bus/svi3x8/slot/sv807.cpp +++ b/src/devices/bus/svi3x8/slot/sv807.cpp @@ -75,14 +75,14 @@ ioport_constructor sv807_device::device_input_ports() const // sv807_device - constructor //------------------------------------------------- -sv807_device::sv807_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sv807_device::sv807_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SV803, "SV-807 64k RAM Cartridge", tag, owner, clock, "sv807", __FILE__), device_svi_slot_interface(mconfig, *this), m_switch(*this, "S"), m_bk21(1), m_bk22(1), m_bk31(1), m_bk32(1) { - m_ram_bank1 = std::make_unique(0x8000); - m_ram_bank2 = std::make_unique(0x8000); + m_ram_bank1 = std::make_unique(0x8000); + m_ram_bank2 = std::make_unique(0x8000); memset(m_ram_bank1.get(), 0xff, 0x8000); memset(m_ram_bank2.get(), 0xff, 0x8000); } diff --git a/src/devices/bus/svi3x8/slot/sv807.h b/src/devices/bus/svi3x8/slot/sv807.h index deebb9bf79e..1e2139372d5 100644 --- a/src/devices/bus/svi3x8/slot/sv807.h +++ b/src/devices/bus/svi3x8/slot/sv807.h @@ -25,7 +25,7 @@ class sv807_device : public device_t, public device_svi_slot_interface { public: // construction/destruction - sv807_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sv807_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -45,8 +45,8 @@ protected: private: required_ioport m_switch; - std::unique_ptr m_ram_bank1; - std::unique_ptr m_ram_bank2; + std::unique_ptr m_ram_bank1; + std::unique_ptr m_ram_bank2; int m_bk21; int m_bk22; diff --git a/src/devices/bus/ti99_peb/bwg.cpp b/src/devices/bus/ti99_peb/bwg.cpp index d54c6ae7060..d2a04e0c6d0 100644 --- a/src/devices/bus/ti99_peb/bwg.cpp +++ b/src/devices/bus/ti99_peb/bwg.cpp @@ -84,7 +84,7 @@ Modern implementation */ -snug_bwg_device::snug_bwg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +snug_bwg_device::snug_bwg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_BWG, "SNUG BwG Floppy Controller", tag, owner, clock, "ti99_bwg", __FILE__), m_DRQ(), m_IRQ(), m_dip1(0), m_dip2(0), m_dip34(0), m_ram_page(0), m_rom_page(0), m_WAITena(false), m_inDsrArea(false), m_WDsel(false), @@ -187,7 +187,7 @@ SETADDRESS_DBIN_MEMBER( snug_bwg_device::setaddress_dbin ) Access for debugger. This is a stripped-down version of the main methods below. We only allow ROM and RAM access. */ -void snug_bwg_device::debug_read(offs_t offset, UINT8* value) +void snug_bwg_device::debug_read(offs_t offset, uint8_t* value) { if (((offset & m_select_mask)==m_select_value) && m_selected) { @@ -201,7 +201,7 @@ void snug_bwg_device::debug_read(offs_t offset, UINT8* value) } } -void snug_bwg_device::debug_write(offs_t offset, UINT8 data) +void snug_bwg_device::debug_write(offs_t offset, uint8_t data) { if (((offset & m_select_mask)==m_select_value) && m_selected) { @@ -343,7 +343,7 @@ WRITE8_MEMBER(snug_bwg_device::write) */ READ8Z_MEMBER(snug_bwg_device::crureadz) { - UINT8 reply; + uint8_t reply; if ((offset & 0xff00)==m_cru_base) { diff --git a/src/devices/bus/ti99_peb/bwg.h b/src/devices/bus/ti99_peb/bwg.h index e61b4769dea..47955637ea7 100644 --- a/src/devices/bus/ti99_peb/bwg.h +++ b/src/devices/bus/ti99_peb/bwg.h @@ -24,7 +24,7 @@ extern const device_type TI99_BWG; class snug_bwg_device : public ti_expansion_card_device { public: - snug_bwg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snug_bwg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin) override; @@ -50,8 +50,8 @@ private: void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // Debugger accessors - void debug_read(offs_t offset, UINT8* value); - void debug_write(offs_t offset, UINT8 data); + void debug_read(offs_t offset, uint8_t* value); + void debug_write(offs_t offset, uint8_t data); // Wait state logic void operate_ready_line(); @@ -98,7 +98,7 @@ private: int m_MOTOR_ON; // Needed for triggering the motor monoflop - UINT8 m_lastval; + uint8_t m_lastval; // Recent address int m_address; @@ -117,7 +117,7 @@ private: emu_timer* m_motor_on_timer; // DSR ROM - UINT8* m_dsrrom; + uint8_t* m_dsrrom; // Buffer RAM required_device m_buffer_ram; diff --git a/src/devices/bus/ti99_peb/evpc.cpp b/src/devices/bus/ti99_peb/evpc.cpp index 14671574e20..aedabb6e172 100644 --- a/src/devices/bus/ti99_peb/evpc.cpp +++ b/src/devices/bus/ti99_peb/evpc.cpp @@ -45,7 +45,7 @@ #define NOVRAM_SIZE 256 -snug_enhanced_video_device::snug_enhanced_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +snug_enhanced_video_device::snug_enhanced_video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_EVPC, "SNUG Enhanced Video Processor Card", tag, owner, clock, "ti99_evpc", __FILE__), device_nvram_interface(mconfig, *this), m_dsr_page(0), @@ -380,7 +380,7 @@ WRITE_LINE_MEMBER( snug_enhanced_video_device::ready_line ) void snug_enhanced_video_device::device_start() { m_dsrrom = memregion(DSRROM)->base(); - m_novram = std::make_unique(NOVRAM_SIZE); + m_novram = std::make_unique(NOVRAM_SIZE); m_console_conn = downcast(machine().device(EVPC_CONN_TAG)); save_item(NAME(m_address)); save_item(NAME(m_dsr_page)); diff --git a/src/devices/bus/ti99_peb/evpc.h b/src/devices/bus/ti99_peb/evpc.h index 0556c17bf64..32ecaa5a7d6 100644 --- a/src/devices/bus/ti99_peb/evpc.h +++ b/src/devices/bus/ti99_peb/evpc.h @@ -25,17 +25,17 @@ extern const device_type TI99_EVPC; struct evpc_palette { - UINT8 read_index, write_index, mask; + uint8_t read_index, write_index, mask; int read; int state; - struct { UINT8 red, green, blue; } color[0x100]; + struct { uint8_t red, green, blue; } color[0x100]; //int dirty; }; class snug_enhanced_video_device : public ti_expansion_card_device, public device_nvram_interface { public: - snug_enhanced_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snug_enhanced_video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin) override; @@ -69,9 +69,9 @@ private: bool m_sound_accessed; bool m_video_accessed; - UINT8* m_dsrrom; + uint8_t* m_dsrrom; - std::unique_ptr m_novram; // NOVRAM area + std::unique_ptr m_novram; // NOVRAM area evpc_palette m_palette; required_device m_video; diff --git a/src/devices/bus/ti99_peb/hfdc.cpp b/src/devices/bus/ti99_peb/hfdc.cpp index 2dd1868b6ef..6554f687f25 100644 --- a/src/devices/bus/ti99_peb/hfdc.cpp +++ b/src/devices/bus/ti99_peb/hfdc.cpp @@ -87,7 +87,7 @@ /* Constructor for the HFDC card. */ -myarc_hfdc_device::myarc_hfdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +myarc_hfdc_device::myarc_hfdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_HFDC, "Myarc Hard and Floppy Disk Controller", tag, owner, clock, "ti99_hfdc", __FILE__), m_motor_on_timer(nullptr), m_hdc9234(*this, FDC_TAG), m_clock(*this, CLOCK_TAG), m_current_floppy(nullptr), @@ -149,7 +149,7 @@ SETADDRESS_DBIN_MEMBER( myarc_hfdc_device::setaddress_dbin ) Access for debugger. This is a stripped-down version of the main methods below. We only allow ROM and RAM access. */ -void myarc_hfdc_device::debug_read(offs_t offset, UINT8* value) +void myarc_hfdc_device::debug_read(offs_t offset, uint8_t* value) { if (((offset & m_select_mask)==m_select_value) && m_selected) { @@ -168,7 +168,7 @@ void myarc_hfdc_device::debug_read(offs_t offset, UINT8* value) } } -void myarc_hfdc_device::debug_write(offs_t offset, UINT8 data) +void myarc_hfdc_device::debug_write(offs_t offset, uint8_t data) { if (((offset & m_select_mask)==m_select_value) && m_selected) { @@ -369,7 +369,7 @@ WRITE8_MEMBER( myarc_hfdc_device::write ) */ READ8Z_MEMBER(myarc_hfdc_device::crureadz) { - UINT8 reply; + uint8_t reply; if ((offset & 0xff00)==m_cru_base) { if ((offset & 0x00ff)==0) // CRU bits 0-7 @@ -546,7 +546,7 @@ void myarc_hfdc_device::harddisk_skcom_callback(mfm_harddisk_device *harddisk, i signal_drive_status(); } -void myarc_hfdc_device::set_bits(UINT8& byte, int mask, bool set) +void myarc_hfdc_device::set_bits(uint8_t& byte, int mask, bool set) { if (set) byte |= mask; else byte &= ~mask; @@ -570,7 +570,7 @@ int myarc_hfdc_device::bit_to_index(int value) */ void myarc_hfdc_device::signal_drive_status() { - UINT8 reply = 0; + uint8_t reply = 0; // Status byte as defined by HDC9234 // +------+------+------+------+------+------+------+------+ // | ECC |Index | SeekC| Tr00 | User | WrPrt| Ready|Fault | @@ -853,7 +853,7 @@ READ8_MEMBER( myarc_hfdc_device::read_buffer ) { if (TRACE_DMA) logerror("Read access to onboard SRAM at %04x\n", m_dma_address); if (m_dma_address > 0x8000) logerror("Read access beyond RAM size: %06x\n", m_dma_address); - UINT8 value = m_buffer_ram->pointer()[m_dma_address & 0x7fff]; + uint8_t value = m_buffer_ram->pointer()[m_dma_address & 0x7fff]; m_dma_address = (m_dma_address+1) & 0x7fff; return value; } diff --git a/src/devices/bus/ti99_peb/hfdc.h b/src/devices/bus/ti99_peb/hfdc.h index 2897fc16740..38a95c787a1 100644 --- a/src/devices/bus/ti99_peb/hfdc.h +++ b/src/devices/bus/ti99_peb/hfdc.h @@ -31,7 +31,7 @@ extern const device_type TI99_HFDC; class myarc_hfdc_device : public ti_expansion_card_device { public: - myarc_hfdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + myarc_hfdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -61,8 +61,8 @@ private: ioport_constructor device_input_ports() const override; // Debug accessors - void debug_read(offs_t offset, UINT8* value); - void debug_write(offs_t offset, UINT8 data); + void debug_read(offs_t offset, uint8_t* value); + void debug_write(offs_t offset, uint8_t data); // Callbacks for the index hole and seek complete void floppy_index_callback(floppy_image_device *floppy, int state); @@ -144,7 +144,7 @@ private: bool m_wait_for_hd1; // Device Service Routine ROM (firmware) - UINT8* m_dsrrom; + uint8_t* m_dsrrom; // ROM banks. int m_rom_page; @@ -156,19 +156,19 @@ private: int m_ram_page[4]; // Drive status latch (STB0) - UINT8 m_status_latch; + uint8_t m_status_latch; // DMA address latch (in Gate Array) (STB1) - UINT32 m_dma_address; + uint32_t m_dma_address; // Output 1 latch (STB2) - UINT8 m_output1_latch; + uint8_t m_output1_latch; // Output 2 latch (STB3) - UINT8 m_output2_latch; + uint8_t m_output2_latch; // Needed for triggering the motor monoflop - UINT8 m_lastval; + uint8_t m_lastval; // Signal motor_on. When TRUE, makes all drives turning. int m_MOTOR_ON; @@ -177,7 +177,7 @@ private: int bit_to_index(int value); // Utility function to set or unset bits in a byte - void set_bits(UINT8& byte, int mask, bool set); + void set_bits(uint8_t& byte, int mask, bool set); // Joined ready line towards the controller int m_readyflags; diff --git a/src/devices/bus/ti99_peb/horizon.cpp b/src/devices/bus/ti99_peb/horizon.cpp index f97f0447302..09117a905a7 100644 --- a/src/devices/bus/ti99_peb/horizon.cpp +++ b/src/devices/bus/ti99_peb/horizon.cpp @@ -64,7 +64,7 @@ #define TRACE_WRITE 0 #define TRACE_CRU 0 -horizon_ramdisk_device::horizon_ramdisk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +horizon_ramdisk_device::horizon_ramdisk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_HORIZON, "Horizon 4000 Ramdisk", tag, owner, clock,"ti99_horizon",__FILE__), device_nvram_interface(mconfig, *this), m_ram(*this, RAMREGION), @@ -106,7 +106,7 @@ void horizon_ramdisk_device::nvram_read(emu_file &file) int size = 2097152*(1 << ioport("HORIZONSIZE")->read()); // NVRAM plus ROS - UINT8* buffer = global_alloc_array_clear(MAXSIZE + ROSSIZE); + uint8_t* buffer = global_alloc_array_clear(MAXSIZE + ROSSIZE); memset(m_nvram->pointer(), 0, size); memset(m_ros->pointer(), 0, ROSSIZE); @@ -135,7 +135,7 @@ void horizon_ramdisk_device::nvram_write(emu_file &file) { int nvramsize = 2097152*(1 << ioport("HORIZONSIZE")->read()); - UINT8* buffer = global_alloc_array_clear(nvramsize + ROSSIZE); + uint8_t* buffer = global_alloc_array_clear(nvramsize + ROSSIZE); memcpy(buffer, m_nvram->pointer(), nvramsize); memcpy(buffer + nvramsize, m_ros->pointer(), ROSSIZE); diff --git a/src/devices/bus/ti99_peb/horizon.h b/src/devices/bus/ti99_peb/horizon.h index 078d987b369..1469bca8c30 100644 --- a/src/devices/bus/ti99_peb/horizon.h +++ b/src/devices/bus/ti99_peb/horizon.h @@ -23,7 +23,7 @@ extern const device_type TI99_HORIZON; class horizon_ramdisk_device : public ti_expansion_card_device, public device_nvram_interface { public: - horizon_ramdisk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + horizon_ramdisk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; diff --git a/src/devices/bus/ti99_peb/hsgpl.cpp b/src/devices/bus/ti99_peb/hsgpl.cpp index 966f7aed727..2602df19f36 100644 --- a/src/devices/bus/ti99_peb/hsgpl.cpp +++ b/src/devices/bus/ti99_peb/hsgpl.cpp @@ -140,7 +140,7 @@ #define GROM_A_EEPROM "u1_grom" #define ROM6_EEPROM "u6_rom6" -snug_high_speed_gpl_device::snug_high_speed_gpl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +snug_high_speed_gpl_device::snug_high_speed_gpl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_HSGPL, "SNUG High-speed GPL card", tag, owner, clock, "ti99_hsgpl", __FILE__), m_dsr_eeprom(*this, DSR_EEPROM), m_rom6_eeprom(*this, ROM6_EEPROM), @@ -295,7 +295,7 @@ WRITE8_MEMBER(snug_high_speed_gpl_device::write) /* Specific read access: dsrspace */ -void snug_high_speed_gpl_device::dsrspace_readz(address_space& space, offs_t offset, UINT8* value, UINT8 mem_mask) +void snug_high_speed_gpl_device::dsrspace_readz(address_space& space, offs_t offset, uint8_t* value, uint8_t mem_mask) { if (m_dsr_enabled) { @@ -307,7 +307,7 @@ void snug_high_speed_gpl_device::dsrspace_readz(address_space& space, offs_t off /* Specific read access: cartspace */ -void snug_high_speed_gpl_device::cartspace_readz(address_space& space, offs_t offset, UINT8* value, UINT8 mem_mask) +void snug_high_speed_gpl_device::cartspace_readz(address_space& space, offs_t offset, uint8_t* value, uint8_t mem_mask) { if (!m_card_enabled || m_flash_mode) { @@ -339,7 +339,7 @@ void snug_high_speed_gpl_device::cartspace_readz(address_space& space, offs_t of it here - which is indeed closer to reality, since the real HSGPL also emulates GROM instead of using proper ones. */ -void snug_high_speed_gpl_device::grom_readz(address_space& space, offs_t offset, UINT8* value, UINT8 mem_mask) +void snug_high_speed_gpl_device::grom_readz(address_space& space, offs_t offset, uint8_t* value, uint8_t mem_mask) { if (space.debugger_access()) return; @@ -457,7 +457,7 @@ void snug_high_speed_gpl_device::grom_readz(address_space& space, offs_t offset, /* Specific write access: cartspace */ -void snug_high_speed_gpl_device::cartspace_write(address_space& space, offs_t offset, UINT8 data, UINT8 mem_mask) +void snug_high_speed_gpl_device::cartspace_write(address_space& space, offs_t offset, uint8_t data, uint8_t mem_mask) { if (!m_card_enabled || m_flash_mode) { @@ -525,7 +525,7 @@ void snug_high_speed_gpl_device::cartspace_write(address_space& space, offs_t of /* Specific write access: grom_write */ -void snug_high_speed_gpl_device::grom_write(address_space& space, offs_t offset, UINT8 data, UINT8 mem_mask) +void snug_high_speed_gpl_device::grom_write(address_space& space, offs_t offset, uint8_t data, uint8_t mem_mask) { if (space.debugger_access()) return; diff --git a/src/devices/bus/ti99_peb/hsgpl.h b/src/devices/bus/ti99_peb/hsgpl.h index 04ea2b99e8e..09e2e46ff7b 100644 --- a/src/devices/bus/ti99_peb/hsgpl.h +++ b/src/devices/bus/ti99_peb/hsgpl.h @@ -26,7 +26,7 @@ extern const device_type TI99_HSGPL; class snug_high_speed_gpl_device : public ti_expansion_card_device { public: - snug_high_speed_gpl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snug_high_speed_gpl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -50,12 +50,12 @@ private: required_device m_ram6_memory; required_device m_gram_memory; - void dsrspace_readz(address_space& space, offs_t offset, UINT8* value, UINT8 mem_mask); - void cartspace_readz(address_space& space, offs_t offset, UINT8* value, UINT8 mem_mask); - void grom_readz(address_space& space, offs_t offset, UINT8* value, UINT8 mem_mask); + void dsrspace_readz(address_space& space, offs_t offset, uint8_t* value, uint8_t mem_mask); + void cartspace_readz(address_space& space, offs_t offset, uint8_t* value, uint8_t mem_mask); + void grom_readz(address_space& space, offs_t offset, uint8_t* value, uint8_t mem_mask); - void cartspace_write(address_space& space, offs_t offset, UINT8 data, UINT8 mem_mask); - void grom_write(address_space& space, offs_t offset, UINT8 data, UINT8 mem_mask); + void cartspace_write(address_space& space, offs_t offset, uint8_t data, uint8_t mem_mask); + void grom_write(address_space& space, offs_t offset, uint8_t data, uint8_t mem_mask); bool m_dsr_enabled; bool m_gram_enabled; diff --git a/src/devices/bus/ti99_peb/memex.cpp b/src/devices/bus/ti99_peb/memex.cpp index 021fb19b96e..2a9b596d0c8 100644 --- a/src/devices/bus/ti99_peb/memex.cpp +++ b/src/devices/bus/ti99_peb/memex.cpp @@ -29,7 +29,7 @@ enum MDIP8 = 0x80 }; -geneve_memex_device::geneve_memex_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +geneve_memex_device::geneve_memex_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_MEMEX, "Geneve memory expansion card", tag, owner, clock, "ti99_memex", __FILE__), m_ram(*this, RAMREGION) { diff --git a/src/devices/bus/ti99_peb/memex.h b/src/devices/bus/ti99_peb/memex.h index b457fb78c95..f63f1b62044 100644 --- a/src/devices/bus/ti99_peb/memex.h +++ b/src/devices/bus/ti99_peb/memex.h @@ -22,7 +22,7 @@ extern const device_type TI99_MEMEX; class geneve_memex_device : public ti_expansion_card_device { public: - geneve_memex_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + geneve_memex_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -38,7 +38,7 @@ protected: private: bool access_enabled(offs_t offset); required_device m_ram; - UINT8 m_switches; + uint8_t m_switches; }; #endif diff --git a/src/devices/bus/ti99_peb/myarcmem.cpp b/src/devices/bus/ti99_peb/myarcmem.cpp index 51e5655d40a..7d8c7be5fd3 100644 --- a/src/devices/bus/ti99_peb/myarcmem.cpp +++ b/src/devices/bus/ti99_peb/myarcmem.cpp @@ -39,7 +39,7 @@ enum SIZE_512 }; -myarc_memory_expansion_device::myarc_memory_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +myarc_memory_expansion_device::myarc_memory_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_MYARCMEM, "Myarc Memory expansion card MEXP-1", tag, owner, clock, "ti99_myarcmem", __FILE__), m_ram(*this, RAM_TAG), m_dsrrom(nullptr), m_bank(0), m_size(0) diff --git a/src/devices/bus/ti99_peb/myarcmem.h b/src/devices/bus/ti99_peb/myarcmem.h index 19a8f1fd95a..5a82bc83cac 100644 --- a/src/devices/bus/ti99_peb/myarcmem.h +++ b/src/devices/bus/ti99_peb/myarcmem.h @@ -22,7 +22,7 @@ extern const device_type TI99_MYARCMEM; class myarc_memory_expansion_device : public ti_expansion_card_device { public: - myarc_memory_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + myarc_memory_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -39,7 +39,7 @@ protected: private: int get_base(int offset); required_device m_ram; - UINT8* m_dsrrom; + uint8_t* m_dsrrom; int m_bank; int m_size; }; diff --git a/src/devices/bus/ti99_peb/pcode.cpp b/src/devices/bus/ti99_peb/pcode.cpp index 5e8a4bf2e1c..3b18f9a41b7 100644 --- a/src/devices/bus/ti99_peb/pcode.cpp +++ b/src/devices/bus/ti99_peb/pcode.cpp @@ -94,7 +94,7 @@ #define TRACE_CRU 0 #define TRACE_SWITCH 0 -ti_pcode_card_device::ti_pcode_card_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti_pcode_card_device::ti_pcode_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_P_CODE, "TI-99 P-Code Card", tag, owner, clock, "ti99_pcode", __FILE__), m_rom(nullptr), m_bank_select(0), @@ -137,7 +137,7 @@ SETADDRESS_DBIN_MEMBER( ti_pcode_card_device::setaddress_dbin ) } } -void ti_pcode_card_device::debugger_read(address_space& space, UINT16 offset, UINT8& value) +void ti_pcode_card_device::debugger_read(address_space& space, uint16_t offset, uint8_t& value) { // The debuger does not call setaddress if (m_active && ((offset & m_select_mask)==m_select_value)) diff --git a/src/devices/bus/ti99_peb/pcode.h b/src/devices/bus/ti99_peb/pcode.h index dfb2fb1a371..4b9662ebffa 100644 --- a/src/devices/bus/ti99_peb/pcode.h +++ b/src/devices/bus/ti99_peb/pcode.h @@ -24,7 +24,7 @@ extern const device_type TI99_P_CODE; class ti_pcode_card_device : public ti_expansion_card_device { public: - ti_pcode_card_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti_pcode_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; DECLARE_READ8Z_MEMBER(crureadz) override; @@ -45,9 +45,9 @@ protected: virtual ioport_constructor device_input_ports() const override; private: - void debugger_read(address_space& space, UINT16 addr, UINT8& value); + void debugger_read(address_space& space, uint16_t addr, uint8_t& value); tmc0430_device* m_grom[8]; - UINT8* m_rom; + uint8_t* m_rom; int m_bank_select; bool m_active; int m_clock_count; diff --git a/src/devices/bus/ti99_peb/peribox.cpp b/src/devices/bus/ti99_peb/peribox.cpp index 3a576b33490..34190757fb4 100644 --- a/src/devices/bus/ti99_peb/peribox.cpp +++ b/src/devices/bus/ti99_peb/peribox.cpp @@ -216,7 +216,7 @@ CRUCLK* 51||52 DBIN #define PEBSLOT7 "slot7" #define PEBSLOT8 "slot8" -peribox_device::peribox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +peribox_device::peribox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bus8z_device(mconfig, PERIBOX, "Peripheral expansion box", tag, owner, clock, "peribox", __FILE__), m_console_inta(*this), m_console_intb(*this), @@ -233,7 +233,7 @@ peribox_device::peribox_device(const machine_config &mconfig, const char *tag, d /* Constructor called from subclasses. */ -peribox_device::peribox_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) +peribox_device::peribox_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) : bus8z_device(mconfig, type, name, tag, owner, clock, shortname, source), m_console_inta(*this), m_console_intb(*this), @@ -482,7 +482,7 @@ machine_config_constructor peribox_device::device_mconfig_additions() const A variant of the box used for the Geneve. *****************************************************************************/ -peribox_gen_device::peribox_gen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +peribox_gen_device::peribox_gen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : peribox_device(mconfig, PERIBOX_GEN, "Peripheral expansion box Geneve", tag, owner, clock, "peribox_gen", __FILE__) { // The Geneve sits in slot 1; there is no prefix here - it can control @@ -524,7 +524,7 @@ machine_config_constructor peribox_gen_device::device_mconfig_additions() const A variant of the box used for the TI-99/8 *****************************************************************************/ -peribox_998_device::peribox_998_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +peribox_998_device::peribox_998_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : peribox_device(mconfig, PERIBOX_998, "Peripheral expansion box 99/8", tag, owner, clock, "peribox_998", __FILE__) { m_address_prefix = 0x70000; @@ -562,7 +562,7 @@ machine_config_constructor peribox_998_device::device_mconfig_additions() const A variant of the box used for the SGCPU (aka TI-99/4P). *****************************************************************************/ -peribox_sg_device::peribox_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +peribox_sg_device::peribox_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : peribox_device(mconfig, PERIBOX_SG, "Peripheral expansion box SGCPU", tag, owner, clock, "peribox_sg", __FILE__) { m_address_prefix = 0x70000; @@ -610,7 +610,7 @@ machine_config_constructor peribox_sg_device::device_mconfig_additions() const obviously required. *****************************************************************************/ -peribox_ev_device::peribox_ev_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +peribox_ev_device::peribox_ev_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : peribox_device(mconfig, PERIBOX_EV, "Peripheral expansion box EVPC", tag, owner, clock, "peribox_ev", __FILE__) { m_address_prefix = 0x70000; @@ -646,7 +646,7 @@ int peribox_slot_device::get_index_from_tagname() return atoi(mytag+i+1); } -peribox_slot_device::peribox_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +peribox_slot_device::peribox_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bus8z_device(mconfig, PERIBOX_SLOT, "TI P-Box slot", tag, owner, clock, "peribox_slot", __FILE__), device_slot_interface(mconfig, *this), m_card(nullptr), m_slotnumber(0) { } diff --git a/src/devices/bus/ti99_peb/peribox.h b/src/devices/bus/ti99_peb/peribox.h index b5a4c55e074..51aa007497c 100644 --- a/src/devices/bus/ti99_peb/peribox.h +++ b/src/devices/bus/ti99_peb/peribox.h @@ -36,8 +36,8 @@ class peribox_device : public bus8z_device { friend class peribox_slot_device; public: - peribox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - peribox_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); + peribox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + peribox_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 &static_set_inta_callback(device_t &device, _Object object) { return downcast(device).m_console_inta.set_callback(object); } template static devcb_base &static_set_intb_callback(device_t &device, _Object object) { return downcast(device).m_console_intb.set_callback(object); } @@ -113,7 +113,7 @@ protected: class peribox_ev_device : public peribox_device { public: - peribox_ev_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + peribox_ev_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -125,7 +125,7 @@ protected: class peribox_sg_device : public peribox_device { public: - peribox_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + peribox_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -137,7 +137,7 @@ protected: class peribox_gen_device : public peribox_device { public: - peribox_gen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + peribox_gen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -149,7 +149,7 @@ protected: class peribox_998_device : public peribox_device { public: - peribox_998_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + peribox_998_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -163,7 +163,7 @@ class peribox_slot_device : public bus8z_device, public device_slot_interface { friend class peribox_device; public: - peribox_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + peribox_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // Called from the box (direction to card) DECLARE_READ8Z_MEMBER(readz) override; @@ -208,7 +208,7 @@ class ti_expansion_card_device : public bus8z_device, public device_slot_card_in friend class peribox_slot_device; public: - ti_expansion_card_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) + ti_expansion_card_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) : bus8z_device(mconfig, type, name, tag, owner, clock, shortname, source), device_slot_card_interface(mconfig, *this), m_selected(false), m_cru_base(0), m_select_mask(0), m_select_value(0) { diff --git a/src/devices/bus/ti99_peb/samsmem.cpp b/src/devices/bus/ti99_peb/samsmem.cpp index 1261ac32ffc..9906e664b76 100644 --- a/src/devices/bus/ti99_peb/samsmem.cpp +++ b/src/devices/bus/ti99_peb/samsmem.cpp @@ -27,7 +27,7 @@ #define SAMS_CRU_BASE 0x1e00 -sams_memory_expansion_device::sams_memory_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sams_memory_expansion_device::sams_memory_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_SAMSMEM, "SuperAMS memory expansion card", tag, owner, clock, "ti99_sams", __FILE__), m_ram(*this, RAM_TAG), m_map_mode(false), m_access_mapper(false) diff --git a/src/devices/bus/ti99_peb/samsmem.h b/src/devices/bus/ti99_peb/samsmem.h index 10c69c1d655..b7943270f4d 100644 --- a/src/devices/bus/ti99_peb/samsmem.h +++ b/src/devices/bus/ti99_peb/samsmem.h @@ -24,7 +24,7 @@ extern const device_type TI99_SAMSMEM; class sams_memory_expansion_device : public ti_expansion_card_device { public: - sams_memory_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sams_memory_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; diff --git a/src/devices/bus/ti99_peb/spchsyn.cpp b/src/devices/bus/ti99_peb/spchsyn.cpp index e4971ed0763..9a3ad050c75 100644 --- a/src/devices/bus/ti99_peb/spchsyn.cpp +++ b/src/devices/bus/ti99_peb/spchsyn.cpp @@ -31,7 +31,7 @@ /****************************************************************************/ -ti_speech_synthesizer_device::ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti_speech_synthesizer_device::ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_SPEECH, "TI-99 Speech synthesizer (on adapter card)", tag, owner, clock, "ti99_speech", __FILE__), m_vsp(nullptr), m_reading(false), m_sbe(false) { diff --git a/src/devices/bus/ti99_peb/spchsyn.h b/src/devices/bus/ti99_peb/spchsyn.h index 6841e397793..e6d0bd1ad02 100644 --- a/src/devices/bus/ti99_peb/spchsyn.h +++ b/src/devices/bus/ti99_peb/spchsyn.h @@ -22,7 +22,7 @@ extern const device_type TI99_SPEECH; class ti_speech_synthesizer_device : public ti_expansion_card_device { public: - ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin) override; diff --git a/src/devices/bus/ti99_peb/ti_32kmem.cpp b/src/devices/bus/ti99_peb/ti_32kmem.cpp index 02e147e33df..16f2d0ccef2 100644 --- a/src/devices/bus/ti99_peb/ti_32kmem.cpp +++ b/src/devices/bus/ti99_peb/ti_32kmem.cpp @@ -34,7 +34,7 @@ #define RAMREGION "ram32k" -ti_32k_expcard_device::ti_32k_expcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti_32k_expcard_device::ti_32k_expcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI_32KMEM, "TI-99 32KiB memory expansion card", tag, owner, clock, "ti99_32k", __FILE__), m_ram(*this, RAMREGION) { @@ -42,7 +42,7 @@ ti_32k_expcard_device::ti_32k_expcard_device(const machine_config &mconfig, cons READ8Z_MEMBER(ti_32k_expcard_device::readz) { - UINT8 val = 0; + uint8_t val = 0; /* The problem for mapping the memory into the address space is that we have a block at 2000-3FFF and another one at A000-FFFF. The trick diff --git a/src/devices/bus/ti99_peb/ti_32kmem.h b/src/devices/bus/ti99_peb/ti_32kmem.h index 37bafe0524b..791a1e01ef6 100644 --- a/src/devices/bus/ti99_peb/ti_32kmem.h +++ b/src/devices/bus/ti99_peb/ti_32kmem.h @@ -23,7 +23,7 @@ extern const device_type TI_32KMEM; class ti_32k_expcard_device : public ti_expansion_card_device { public: - ti_32k_expcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti_32k_expcard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; diff --git a/src/devices/bus/ti99_peb/ti_fdc.cpp b/src/devices/bus/ti99_peb/ti_fdc.cpp index 4cf7fe9ee4e..3fef602c3fb 100644 --- a/src/devices/bus/ti99_peb/ti_fdc.cpp +++ b/src/devices/bus/ti99_peb/ti_fdc.cpp @@ -48,7 +48,7 @@ #define TI_FDC_TAG "ti_dssd_controller" -ti_fdc_device::ti_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti_fdc_device::ti_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_FDC, "TI-99 Standard DSSD Floppy Controller", tag, owner, clock, "ti99_fdc", __FILE__), m_address(0), m_DRQ(0), @@ -131,7 +131,7 @@ SETADDRESS_DBIN_MEMBER( ti_fdc_device::setaddress_dbin ) Access for debugger. This is a stripped-down version of the main methods below. We only allow ROM access. */ -void ti_fdc_device::debug_read(offs_t offset, UINT8* value) +void ti_fdc_device::debug_read(offs_t offset, uint8_t* value) { if (((offset & m_select_mask)==m_select_value) && m_selected) { @@ -152,7 +152,7 @@ READ8Z_MEMBER(ti_fdc_device::readz) { // Read ports of 1771 are mapped to 5FF0,2,4,6: 0101 1111 1111 0xx0 // Note that incoming/outgoing data are inverted for FD1771 - UINT8 reply = 0; + uint8_t reply = 0; if (m_WDsel && ((m_address & 9)==0)) { @@ -221,7 +221,7 @@ READ8Z_MEMBER(ti_fdc_device::crureadz) { if ((offset & 0xff00)==m_cru_base) { - UINT8 reply = 0; + uint8_t reply = 0; if ((offset & 0x07) == 0) { // Selected drive diff --git a/src/devices/bus/ti99_peb/ti_fdc.h b/src/devices/bus/ti99_peb/ti_fdc.h index e0446c0c1a1..aeba6d6fdc2 100644 --- a/src/devices/bus/ti99_peb/ti_fdc.h +++ b/src/devices/bus/ti99_peb/ti_fdc.h @@ -22,7 +22,7 @@ extern const device_type TI99_FDC; class ti_fdc_device : public ti_expansion_card_device { public: - ti_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin) override; @@ -48,7 +48,7 @@ protected: private: // For debugger access - void debug_read(offs_t offset, UINT8* value); + void debug_read(offs_t offset, uint8_t* value); // Wait state logic void operate_ready_line(); @@ -66,7 +66,7 @@ private: int m_DRQ, m_IRQ; // Needed for triggering the motor monoflop - UINT8 m_lastval; + uint8_t m_lastval; // Signal DVENA. When TRUE, makes some drive turning. int m_DVENA; @@ -97,7 +97,7 @@ private: required_device m_fd1771; // DSR ROM - UINT8* m_dsrrom; + uint8_t* m_dsrrom; // Link to the attached floppy drives floppy_image_device* m_floppy[3]; diff --git a/src/devices/bus/ti99_peb/ti_rs232.cpp b/src/devices/bus/ti99_peb/ti_rs232.cpp index 2fde3f4c07a..d89d1dc354f 100644 --- a/src/devices/bus/ti99_peb/ti_rs232.cpp +++ b/src/devices/bus/ti99_peb/ti_rs232.cpp @@ -121,7 +121,7 @@ #define ESC 0x1b -ti_rs232_pio_device::ti_rs232_pio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti_rs232_pio_device::ti_rs232_pio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_RS232, "TI-99 RS232/PIO interface", tag, owner, clock, "ti99_rs232", __FILE__), m_piodev(nullptr), m_dsrrom(nullptr), m_pio_direction_in(false), m_pio_handshakeout(false), m_pio_handshakein(false), m_pio_spareout(false), m_pio_sparein(false), m_flag0(false), m_led(false), m_pio_out_buffer(0), m_pio_in_buffer(0), m_pio_readable(false), m_pio_writable(false), m_pio_write(false), m_ila(0) { } @@ -130,13 +130,13 @@ ti_rs232_pio_device::ti_rs232_pio_device(const machine_config &mconfig, const ch /**************************************************************************/ /* Ports */ -ti_rs232_attached_device::ti_rs232_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti_rs232_attached_device::ti_rs232_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI99_RS232_DEV, "Serial attached device", tag, owner, clock, "ti_rs232_attached", __FILE__), device_image_interface(mconfig, *this) { } -ti_pio_attached_device::ti_pio_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti_pio_attached_device::ti_pio_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI99_PIO_DEV, "Parallel attached device", tag, owner, clock, "ti_pio_attached", __FILE__), device_image_interface(mconfig, *this) { @@ -270,7 +270,7 @@ READ8Z_MEMBER(ti_rs232_pio_device::crureadz) { if ((offset & 0x00c0)==0x0000) { - UINT8 reply = 0x00; + uint8_t reply = 0x00; if (m_pio_direction_in) reply |= 0x02; if (m_pio_handshakein) reply |= 0x04; if (m_pio_sparein) reply |= 0x08; @@ -336,7 +336,7 @@ WRITE8_MEMBER(ti_rs232_pio_device::cruwrite) if (!m_pio_handshakeout) { /* write data strobe */ /* write data and acknowledge */ - UINT8 buf = m_pio_out_buffer; + uint8_t buf = m_pio_out_buffer; int ret = image->fwrite(&buf, 1); if (ret) m_pio_handshakein = 1; @@ -353,7 +353,7 @@ WRITE8_MEMBER(ti_rs232_pio_device::cruwrite) if (!m_pio_handshakeout) { /* receiver ready */ /* send data and strobe */ - UINT8 buf; + uint8_t buf; if (image->fread(&buf, 1)) m_pio_in_buffer = buf; m_pio_handshakein = 0; @@ -456,9 +456,9 @@ void ti_rs232_pio_device::incoming_dtr(int uartind, line_state value) /* Data transmission */ -void ti_rs232_pio_device::transmit_data(int uartind, UINT8 value) +void ti_rs232_pio_device::transmit_data(int uartind, uint8_t value) { - UINT8 buf = value; + uint8_t buf = value; device_image_interface *serial; serial = dynamic_cast(m_serdev[uartind]); @@ -523,9 +523,9 @@ void ti_rs232_pio_device::transmit_data(int uartind, UINT8 value) |-( 8) <--- DCD */ -UINT8 ti_rs232_pio_device::map_lines_out(int uartind, UINT8 value) +uint8_t ti_rs232_pio_device::map_lines_out(int uartind, uint8_t value) { - UINT8 ret = 0; + uint8_t ret = 0; int mapping = ioport("SERIALMAP")->read(); // 00ab cdef = setting line RTS=a, CTS=b, DSR=c, DCD=d, DTR=e, RI=f @@ -595,9 +595,9 @@ UINT8 ti_rs232_pio_device::map_lines_out(int uartind, UINT8 value) return ret; } -UINT8 ti_rs232_pio_device::map_lines_in(int uartind, UINT8 value) +uint8_t ti_rs232_pio_device::map_lines_in(int uartind, uint8_t value) { - UINT8 ret = 0; + uint8_t ret = 0; int mapping = ioport("SERIALMAP")->read(); // 00ab cdef = setting line RTS=a, CTS=b, DSR=c, DCD=d, DTR=e, RI=f @@ -692,7 +692,7 @@ UINT8 ti_rs232_pio_device::map_lines_in(int uartind, UINT8 value) void ti_rs232_pio_device::receive_data_or_line_state(int uartind) { device_image_interface *serial; - UINT8 buffer; + uint8_t buffer; serial = dynamic_cast(m_serdev[uartind]); @@ -801,9 +801,9 @@ void ti_rs232_pio_device::receive_data_or_line_state(int uartind) */ void ti_rs232_pio_device::configure_interface(int uartind, int type, int value) { - UINT8 bufctrl[4]; + uint8_t bufctrl[4]; device_image_interface *serial; - UINT8 esc = ESC; + uint8_t esc = ESC; serial = dynamic_cast(m_serdev[uartind]); @@ -877,11 +877,11 @@ void ti_rs232_pio_device::set_bit(int uartind, int line, int value) /* Line changes */ -void ti_rs232_pio_device::output_exception(int uartind, int param, UINT8 value) +void ti_rs232_pio_device::output_exception(int uartind, int param, uint8_t value) { device_image_interface *serial; - UINT8 bufctrl[2]; - UINT8 esc = ESC; + uint8_t bufctrl[2]; + uint8_t esc = ESC; serial = dynamic_cast(m_serdev[uartind]); @@ -903,11 +903,11 @@ void ti_rs232_pio_device::output_exception(int uartind, int param, UINT8 value) /* Line changes */ -void ti_rs232_pio_device::output_line_state(int uartind, int mask, UINT8 value) +void ti_rs232_pio_device::output_line_state(int uartind, int mask, uint8_t value) { device_image_interface *serial; - UINT8 bufctrl[2]; - UINT8 esc = ESC; + uint8_t bufctrl[2]; + uint8_t esc = ESC; serial = dynamic_cast(m_serdev[uartind]); @@ -996,7 +996,7 @@ WRITE8_MEMBER( ti_rs232_pio_device::xmit1_callback ) transmit_data(1, data); } -void ti_rs232_pio_device::ctrl_callback(int uartind, int offset, UINT8 data) +void ti_rs232_pio_device::ctrl_callback(int uartind, int offset, uint8_t data) { if ((offset & CONFIG)!=0) { @@ -1036,8 +1036,8 @@ void ti_rs232_pio_device::device_start() m_serdev[1] = subdevice("serdev1"); m_piodev = subdevice("piodev"); // Prepare the receive buffers - m_recvbuf[0] = std::make_unique(512); - m_recvbuf[1] = std::make_unique(512); + m_recvbuf[0] = std::make_unique(512); + m_recvbuf[1] = std::make_unique(512); m_pio_write = true; // required for call_load of pio_attached_device m_pio_writable = false; m_pio_handshakein = false; diff --git a/src/devices/bus/ti99_peb/ti_rs232.h b/src/devices/bus/ti99_peb/ti_rs232.h index 371eefccdf9..255127c63ea 100644 --- a/src/devices/bus/ti99_peb/ti_rs232.h +++ b/src/devices/bus/ti99_peb/ti_rs232.h @@ -30,7 +30,7 @@ class ti_rs232_pio_device : public ti_expansion_card_device friend class ti_rs232_attached_device; public: - ti_rs232_pio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti_rs232_pio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -56,16 +56,16 @@ protected: private: void incoming_dtr(int uartind, line_state value); - void transmit_data(int uartind, UINT8 value); - UINT8 map_lines_out(int uartind, UINT8 value); - UINT8 map_lines_in(int uartind, UINT8 value); + void transmit_data(int uartind, uint8_t value); + uint8_t map_lines_out(int uartind, uint8_t value); + uint8_t map_lines_in(int uartind, uint8_t value); void receive_data_or_line_state(int uartind); void set_bit(int uartind, int line, int value); void configure_interface(int uartind, int type, int value); - void output_line_state(int uartind, int mask, UINT8 value); - void output_exception(int uartind, int param, UINT8 value); - void ctrl_callback(int uartind, int type, UINT8 data); + void output_line_state(int uartind, int mask, uint8_t value); + void output_exception(int uartind, int param, uint8_t value); + void ctrl_callback(int uartind, int type, uint8_t data); // UART chips tms9902_device* m_uart[2]; @@ -75,15 +75,15 @@ private: // Connected image (file) that represents the device connected to the // parallel interface ti_pio_attached_device* m_piodev; - UINT8* m_dsrrom; + uint8_t* m_dsrrom; // Input buffer for each UART. We have to copy the contents of sdlsocket here // because the buffer in corefile will be lost on the next write operation - std::unique_ptr m_recvbuf[2]; + std::unique_ptr m_recvbuf[2]; int m_bufpos[2], m_buflen[2]; // Latches the state of the output lines for UART0/UART1 - UINT8 m_signals[2]; + uint8_t m_signals[2]; int m_recv_mode[2]; // May be NORMAL or ESC // Baud rate management @@ -106,7 +106,7 @@ private: bool m_pio_write; // true if image is to be written to /* Keeps the value put on the bus when SENILA becomes active. */ - UINT8 m_ila; + uint8_t m_ila; }; /****************************************************************************/ @@ -117,7 +117,7 @@ private: class ti_rs232_attached_device : public device_t, public device_image_interface { public: - ti_rs232_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti_rs232_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); iodevice_t image_type() const override { return IO_SERIAL; } bool is_readable() const override { return true; } @@ -144,7 +144,7 @@ private: class ti_pio_attached_device : public device_t, public device_image_interface { public: - ti_pio_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti_pio_attached_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); iodevice_t image_type() const override { return IO_PARALLEL; } bool is_readable() const override { return true; } diff --git a/src/devices/bus/ti99_peb/tn_ide.cpp b/src/devices/bus/ti99_peb/tn_ide.cpp index e7bbbc06a3f..371802d4d99 100644 --- a/src/devices/bus/ti99_peb/tn_ide.cpp +++ b/src/devices/bus/ti99_peb/tn_ide.cpp @@ -49,7 +49,7 @@ enum cru_reg_reset = 0x80 }; -nouspikel_ide_interface_device::nouspikel_ide_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nouspikel_ide_interface_device::nouspikel_ide_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_IDE, "Nouspikel IDE interface card", tag, owner, clock, "ti99_ide", __FILE__), m_ata_irq(false), m_cru_register(0), m_rtc(nullptr), m_ata(*this, "ata"), m_clk_irq(false), m_sram_enable(false), @@ -63,7 +63,7 @@ nouspikel_ide_interface_device::nouspikel_ide_interface_device(const machine_con */ READ8Z_MEMBER(nouspikel_ide_interface_device::crureadz) { - UINT8 reply = 0; + uint8_t reply = 0; if ((offset & 0xff00)==m_cru_base) { int bit = (offset >> 4) & 7; @@ -127,7 +127,7 @@ WRITE8_MEMBER(nouspikel_ide_interface_device::cruwrite) */ READ8Z_MEMBER(nouspikel_ide_interface_device::readz) { - UINT8 reply = 0; + uint8_t reply = 0; if (space.debugger_access()) return; if (((offset & m_select_mask)==m_select_value) && m_selected) diff --git a/src/devices/bus/ti99_peb/tn_ide.h b/src/devices/bus/ti99_peb/tn_ide.h index e4bb41e2642..08a1a20f609 100644 --- a/src/devices/bus/ti99_peb/tn_ide.h +++ b/src/devices/bus/ti99_peb/tn_ide.h @@ -24,7 +24,7 @@ extern const device_type TI99_IDE; class nouspikel_ide_interface_device : public ti_expansion_card_device { public: - nouspikel_ide_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nouspikel_ide_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -55,8 +55,8 @@ private: bool m_tms9995_mode; - UINT16 m_input_latch; - UINT16 m_output_latch; + uint16_t m_input_latch; + uint16_t m_output_latch; required_device m_ram; }; diff --git a/src/devices/bus/ti99_peb/tn_usbsm.cpp b/src/devices/bus/ti99_peb/tn_usbsm.cpp index b59fbdffe7d..22978be8625 100644 --- a/src/devices/bus/ti99_peb/tn_usbsm.cpp +++ b/src/devices/bus/ti99_peb/tn_usbsm.cpp @@ -54,7 +54,7 @@ enum FEEPROM_WRITE_ENABLE = 0x10 }; -nouspikel_usb_smartmedia_device::nouspikel_usb_smartmedia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nouspikel_usb_smartmedia_device::nouspikel_usb_smartmedia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti_expansion_card_device(mconfig, TI99_USBSM, "Nouspikel USB/Smartmedia card", tag, owner, clock, "ti99_usbsm", __FILE__), m_feeprom_page(0), m_sram_page(0), @@ -80,7 +80,7 @@ READ8Z_MEMBER(nouspikel_usb_smartmedia_device::crureadz) { if ((offset & 0xff00)==m_cru_base) { - UINT8 reply = 0; + uint8_t reply = 0; offset &= 3; if (offset == 0) diff --git a/src/devices/bus/ti99_peb/tn_usbsm.h b/src/devices/bus/ti99_peb/tn_usbsm.h index 6769783cd5a..b974f08511e 100644 --- a/src/devices/bus/ti99_peb/tn_usbsm.h +++ b/src/devices/bus/ti99_peb/tn_usbsm.h @@ -25,7 +25,7 @@ extern const device_type TI99_USBSM; class nouspikel_usb_smartmedia_device : public ti_expansion_card_device { public: - nouspikel_usb_smartmedia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nouspikel_usb_smartmedia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -50,8 +50,8 @@ private: bool m_enable_sm; bool m_write_flash; - UINT16 m_input_latch; - UINT16 m_output_latch; + uint16_t m_input_latch; + uint16_t m_output_latch; required_device m_ram_lb; required_device m_ram_hb; diff --git a/src/devices/bus/ti99x/990_dk.cpp b/src/devices/bus/ti99x/990_dk.cpp index 7b6c8e9e36e..f36e93a963e 100644 --- a/src/devices/bus/ti99x/990_dk.cpp +++ b/src/devices/bus/ti99x/990_dk.cpp @@ -42,7 +42,7 @@ enum const device_type FD800 = &device_creator; -fd800_legacy_device::fd800_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fd800_legacy_device::fd800_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FD800, "TI FD800 Diablo floppy disk controller", tag, owner, clock, "fd800", __FILE__), m_recv_buf(0), m_stat_reg(0), m_xmit_buf(0), m_cmd_reg(0), m_interrupt_f_f(0), m_int_line(*this), m_buf_pos(0), m_buf_mode(), m_unit(0), m_sector(0) @@ -104,7 +104,7 @@ void fd800_machine_init(void (*interrupt_callback)(running_machine &machine, int */ int fd800_legacy_device::read_id(int unit, int head, int *cylinder_id, int *sector_id) { - //UINT8 revolution_count;*/ + //uint8_t revolution_count;*/ // chrn_id id; //revolution_count = 0;*/ @@ -136,7 +136,7 @@ int fd800_legacy_device::read_id(int unit, int head, int *cylinder_id, int *sect */ int fd800_legacy_device::find_sector(int unit, int head, int sector, int *data_id) { -/* UINT8 revolution_count; +/* uint8_t revolution_count; chrn_id id; revolution_count = 0; diff --git a/src/devices/bus/ti99x/990_dk.h b/src/devices/bus/ti99x/990_dk.h index ffb7f79784a..e7cbed7b985 100644 --- a/src/devices/bus/ti99x/990_dk.h +++ b/src/devices/bus/ti99x/990_dk.h @@ -14,7 +14,7 @@ extern const device_type FD800; class fd800_legacy_device : public device_t { public: - fd800_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd800_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( cru_r ); DECLARE_WRITE8_MEMBER( cru_w ); @@ -36,10 +36,10 @@ private: void do_write(void); void do_cmd(void); - UINT16 m_recv_buf; - UINT16 m_stat_reg; - UINT16 m_xmit_buf; - UINT16 m_cmd_reg; + uint16_t m_recv_buf; + uint16_t m_stat_reg; + uint16_t m_xmit_buf; + uint16_t m_cmd_reg; int m_interrupt_f_f; devcb_write_line m_int_line; @@ -48,7 +48,7 @@ private: bm_off, bm_read, bm_write }; - UINT8 m_buf[128]; + uint8_t m_buf[128]; int m_buf_pos; buf_mode_t m_buf_mode; int m_unit; diff --git a/src/devices/bus/ti99x/990_hd.cpp b/src/devices/bus/ti99x/990_hd.cpp index 6c6fdda6c5d..7882a8f37e3 100644 --- a/src/devices/bus/ti99x/990_hd.cpp +++ b/src/devices/bus/ti99x/990_hd.cpp @@ -38,16 +38,16 @@ for TI990. */ /* machine-independent big-endian 32-bit integer */ struct UINT32BE { - UINT8 bytes[4]; + uint8_t bytes[4]; }; -static inline UINT32 get_UINT32BE(UINT32BE word) +static inline uint32_t get_UINT32BE(UINT32BE word) { return (word.bytes[0] << 24) | (word.bytes[1] << 16) | (word.bytes[2] << 8) | word.bytes[3]; } #ifdef UNUSED_FUNCTION -static inline void set_UINT32BE(UINT32BE *word, UINT32 data) +static inline void set_UINT32BE(UINT32BE *word, uint32_t data) { word->bytes[0] = (data >> 24) & 0xff; word->bytes[1] = (data >> 16) & 0xff; @@ -119,7 +119,7 @@ enum }; /* masks for computer-controlled bit in each controller register */ -static const UINT16 w_mask[8] = +static const uint16_t w_mask[8] = { 0x000f, /* Controllers should prevent overwriting of w0 status bits, and I know that some controllers do so. */ @@ -422,7 +422,7 @@ void ti990_hdc_device::store_registers() int dma_address; int byte_count; - UINT16 buffer[3]; + uint16_t buffer[3]; int i, real_word_count; int dsk_sel = cur_disk_unit(); @@ -481,7 +481,7 @@ void ti990_hdc_device::write_format() unsigned int cylinder, head, sector; unsigned int lba; - UINT8 buffer[MAX_SECTOR_SIZE]; + uint8_t buffer[MAX_SECTOR_SIZE]; int bytes_written; int dsk_sel = cur_disk_unit(); @@ -554,7 +554,7 @@ void ti990_hdc_device::read_data() unsigned int cylinder, head, sector; unsigned int lba; - UINT8 buffer[MAX_SECTOR_SIZE]; + uint8_t buffer[MAX_SECTOR_SIZE]; int bytes_to_read; int bytes_read; int i; @@ -654,8 +654,8 @@ void ti990_hdc_device::write_data() unsigned int cylinder, head, sector; unsigned int lba; - UINT8 buffer[MAX_SECTOR_SIZE]; - UINT16 word; + uint8_t buffer[MAX_SECTOR_SIZE]; + uint16_t word; int bytes_written; int i; @@ -765,7 +765,7 @@ void ti990_hdc_device::unformatted_read() unsigned int cylinder, head, sector; - UINT16 buffer[3]; + uint16_t buffer[3]; int i, real_word_count; int dsk_sel = cur_disk_unit(); @@ -942,7 +942,7 @@ WRITE16_MEMBER(ti990_hdc_device::write) /* write protect if a command is in progress */ if (m_w[7] & w7_idle) { - UINT16 old_data = m_w[offset]; + uint16_t old_data = m_w[offset]; /* Only write writable bits AND honor byte accesses (ha!) */ m_w[offset] = (m_w[offset] & ((~w_mask[offset]) | mem_mask)) | (data & w_mask[offset] & ~mem_mask); @@ -976,7 +976,7 @@ MACHINE_CONFIG_END const device_type TI990_HDC = &device_creator; -ti990_hdc_device::ti990_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti990_hdc_device::ti990_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI990_HDC, "Generic TI-990 Hard Disk Controller", tag, owner, clock, "hdc_990", __FILE__), m_interrupt_callback(*this) { diff --git a/src/devices/bus/ti99x/990_hd.h b/src/devices/bus/ti99x/990_hd.h index f6468a807f9..8c1435d0eb5 100644 --- a/src/devices/bus/ti99x/990_hd.h +++ b/src/devices/bus/ti99x/990_hd.h @@ -15,7 +15,7 @@ overriden if more than one controller is used */ class ti990_hdc_device : public device_t { public: - ti990_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti990_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &static_set_int_callback(device_t &device, _Object object) { return downcast(device).m_interrupt_callback.set_callback(object); } @@ -65,7 +65,7 @@ private: unsigned int cylinders, heads, sectors_per_track, bytes_per_sector; }; - UINT16 m_w[8]; + uint16_t m_w[8]; devcb_write_line m_interrupt_callback; diff --git a/src/devices/bus/ti99x/990_tap.cpp b/src/devices/bus/ti99x/990_tap.cpp index dc2a927673a..7ab14725f19 100644 --- a/src/devices/bus/ti99x/990_tap.cpp +++ b/src/devices/bus/ti99x/990_tap.cpp @@ -69,7 +69,7 @@ enum w7_tape_error = 0x0001 }; -static const UINT16 w_mask[8] = +static const uint16_t w_mask[8] = { 0x000f, /* Controllers should prevent overwriting of w0 status bits, and I know that some controllers do so. */ @@ -123,7 +123,7 @@ void tap_990_device::update_interrupt() */ void tap_990_device::cmd_read_binary_forward() { - UINT8 buffer[256]; + uint8_t buffer[256]; int reclen; int dma_address; @@ -349,7 +349,7 @@ update_registers: */ void tap_990_device::cmd_record_skip_forward() { - UINT8 buffer[4]; + uint8_t buffer[4]; int reclen; int record_count; @@ -485,7 +485,7 @@ update_registers: */ void tap_990_device::cmd_record_skip_reverse() { - UINT8 buffer[4]; + uint8_t buffer[4]; int reclen; int record_count; @@ -871,7 +871,7 @@ WRITE16_MEMBER( tap_990_device::write ) /* write protect if a command is in progress */ if (m_w[7] & w7_idle) { - UINT16 old_data = m_w[offset]; + uint16_t old_data = m_w[offset]; /* Only write writable bits AND honor byte accesses (ha!) */ m_w[offset] = (m_w[offset] & ((~w_mask[offset]) | mem_mask)) | (data & w_mask[offset] & ~mem_mask); @@ -892,7 +892,7 @@ class ti990_tape_image_device : public device_t, { public: // construction/destruction - ti990_tape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti990_tape_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_MAGTAPE; } @@ -916,7 +916,7 @@ private: const device_type TI990_TAPE = &device_creator; -ti990_tape_image_device::ti990_tape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti990_tape_image_device::ti990_tape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI990_TAPE, "TI-990 Magnetic Tape", tag, owner, clock, "ti990_tape_image", __FILE__), device_image_interface(mconfig, *this) { @@ -976,7 +976,7 @@ MACHINE_CONFIG_END const device_type TI990_TAPE_CTRL = &device_creator; -tap_990_device::tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tap_990_device::tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI990_TAPE_CTRL, "Generic TI-990 Tape Controller", tag, owner, clock, "tap_990", __FILE__), m_int_line(*this) { diff --git a/src/devices/bus/ti99x/990_tap.h b/src/devices/bus/ti99x/990_tap.h index 6622e2af587..b4599837aa5 100644 --- a/src/devices/bus/ti99x/990_tap.h +++ b/src/devices/bus/ti99x/990_tap.h @@ -18,7 +18,7 @@ struct tape_unit_t class tap_990_device : public device_t { public: - tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &static_set_int_callback(device_t &device, _Object object) { return downcast(device).m_int_line.set_callback(object); @@ -54,7 +54,7 @@ private: devcb_write_line m_int_line; - UINT16 m_w[8]; + uint16_t m_w[8]; tape_unit_t m_tape[MAX_TAPE_UNIT]; }; diff --git a/src/devices/bus/ti99x/998board.cpp b/src/devices/bus/ti99x/998board.cpp index 290ca12e10f..074336f3441 100644 --- a/src/devices/bus/ti99x/998board.cpp +++ b/src/devices/bus/ti99x/998board.cpp @@ -121,7 +121,7 @@ #define TRACE_GROM 0 #define TRACE_PUNMAP 0 -mainboard8_device::mainboard8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mainboard8_device::mainboard8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MAINBOARD8, "TI-99/8 Mainboard", tag, owner, clock, "ti998_mainboard", __FILE__), m_A14_set(false), m_pending_write(false), @@ -457,7 +457,7 @@ WRITE_LINE_MEMBER( mainboard8_device::msast_in ) READ8_MEMBER( mainboard8_device::read ) { - UINT8 value = 0; + uint8_t value = 0; const char* what; // ================================================= @@ -917,7 +917,7 @@ const device_type MAINBOARD8 = &device_creator; ***************************************************************************/ -vaquerro_device::vaquerro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vaquerro_device::vaquerro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VAQUERRO, "Logical Address Space Decoder", tag, owner, clock, "ti998_vaquerro", __FILE__), m_crus(ASSERT_LINE), m_crugl(ASSERT_LINE), @@ -1366,7 +1366,7 @@ enum INTERNAL }; -mofetta_device::mofetta_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mofetta_device::mofetta_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOFETTA, "Physical Address Space Decoder", tag, owner, clock, "ti998_mofetta", __FILE__), m_gotfirstword(false) { @@ -1652,7 +1652,7 @@ const device_type MOFETTA = &device_creator; ***************************************************************************/ -amigo_device::amigo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amigo_device::amigo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AMIGO, "Address space mapper", tag, owner, clock, "ti998_amigo", __FILE__), m_logical_space(true), m_crus(ASSERT_LINE) @@ -1798,7 +1798,7 @@ SETOFFSET_MEMBER( amigo_device::set_address ) READ8_MEMBER( amigo_device::read ) { // Read the protection status bits and reset them - UINT8 value = m_protflag; + uint8_t value = m_protflag; m_protflag = 0; return value; } @@ -2002,7 +2002,7 @@ enum SHSK = 0x01 }; -oso_device::oso_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +oso_device::oso_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OSO, "Hexbus interface", tag, owner, clock, "oso", __FILE__), m_data(0), m_status(0), m_control(0), m_xmit(0) { } diff --git a/src/devices/bus/ti99x/998board.h b/src/devices/bus/ti99x/998board.h index ab0682b6b38..3d974d87e73 100644 --- a/src/devices/bus/ti99x/998board.h +++ b/src/devices/bus/ti99x/998board.h @@ -112,7 +112,7 @@ public: class vaquerro_device : public device_t { public: - vaquerro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vaquerro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void device_start() override; void device_reset() override; @@ -202,7 +202,7 @@ private: class mofetta_device : public device_t { public: - mofetta_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mofetta_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void device_start() override; void device_reset() override; @@ -286,7 +286,7 @@ private: class amigo_device : public device_t { public: - amigo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amigo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void device_start() override; void device_reset() override; @@ -306,7 +306,7 @@ public: DECLARE_READ_LINE_MEMBER( sramcs_out ); DECLARE_READ_LINE_MEMBER( skdrcs_out ); - void connect_sram(UINT8* sram) { m_sram = sram; } + void connect_sram(uint8_t* sram) { m_sram = sram; } bool mapper_accessed() { return m_mapper_accessed; } private: @@ -319,16 +319,16 @@ private: // Address mapper registers. Each offset is selected by the first 4 bits // of the logical address. - UINT32 m_base_register[16]; + uint32_t m_base_register[16]; // Indicates a logical space access bool m_logical_space; // Physical address - UINT32 m_physical_address; + uint32_t m_physical_address; // Pointer to SRAM where AMIGO needs to upload/download its map values - UINT8* m_sram; + uint8_t* m_sram; // Pointer to mainboard mainboard8_device* m_mainboard; @@ -361,13 +361,13 @@ private: bool m_hold_acknowledged; // Address in SRAM during DMA - UINT32 m_sram_address; + uint32_t m_sram_address; // Number of the currently loaded/save base register int m_basereg; // Latched value for mapper DMA transfer - UINT32 m_mapvalue; + uint32_t m_mapvalue; }; /* @@ -376,22 +376,22 @@ private: class oso_device : public device_t { public: - oso_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + oso_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); void device_start() override; private: - UINT8 m_data; - UINT8 m_status; - UINT8 m_control; - UINT8 m_xmit; + uint8_t m_data; + uint8_t m_status; + uint8_t m_control; + uint8_t m_xmit; }; class mainboard8_device : public device_t { public: - mainboard8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mainboard8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // Memory space DECLARE_READ8_MEMBER( read ); @@ -469,7 +469,7 @@ private: // Hold the value of the data bus. In a real machine, the data bus continues // to show that value, but in this emulation we have a push mechanism. - UINT8 m_latched_data; + uint8_t m_latched_data; // Hold the level of the GROMCLK line int m_gromclk; @@ -534,9 +534,9 @@ private: bool m_p3grom_idle; // ROM area of the system. - UINT8* m_rom0; - UINT8* m_rom1; - UINT8* m_pascalrom; + uint8_t* m_rom0; + uint8_t* m_rom1; + uint8_t* m_pascalrom; }; #define MCFG_MAINBOARD8_READY_CALLBACK(_write) \ diff --git a/src/devices/bus/ti99x/datamux.cpp b/src/devices/bus/ti99x/datamux.cpp index dcda3cc0cf3..34f25a89c91 100644 --- a/src/devices/bus/ti99x/datamux.cpp +++ b/src/devices/bus/ti99x/datamux.cpp @@ -74,7 +74,7 @@ /* Constructor */ -ti99_datamux_device::ti99_datamux_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti99_datamux_device::ti99_datamux_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DATAMUX, "Databus multiplexer", tag, owner, clock, "ti99_datamux", __FILE__), m_video(*owner, VDP_TAG), m_sound(*owner, TISOUNDCHIP_TAG), @@ -106,7 +106,7 @@ ti99_datamux_device::ti99_datamux_device(const machine_config &mconfig, const ch DEVICE ACCESSOR FUNCTIONS ***************************************************************************/ -void ti99_datamux_device::read_all(address_space& space, UINT16 addr, UINT8 *value) +void ti99_datamux_device::read_all(address_space& space, uint16_t addr, uint8_t *value) { // Valid access bool validaccess = ((addr & 0x0400)==0); @@ -144,7 +144,7 @@ void ti99_datamux_device::read_all(address_space& space, UINT16 addr, UINT8 *val m_peb->memen_in(CLEAR_LINE); } -void ti99_datamux_device::write_all(address_space& space, UINT16 addr, UINT8 value) +void ti99_datamux_device::write_all(address_space& space, uint16_t addr, uint8_t value) { // GROM access if ((addr & 0xf801)==0x9800) @@ -180,7 +180,7 @@ void ti99_datamux_device::write_all(address_space& space, UINT16 addr, UINT8 val m_peb->memen_in(CLEAR_LINE); } -void ti99_datamux_device::setaddress_all(address_space& space, UINT16 addr) +void ti99_datamux_device::setaddress_all(address_space& space, uint16_t addr) { line_state a14 = ((addr & 2)!=0)? ASSERT_LINE : CLEAR_LINE; @@ -223,10 +223,10 @@ void ti99_datamux_device::setaddress_all(address_space& space, UINT16 addr) mapped devices are excluded because their state would be changed unpredictably by the debugger access. */ -UINT16 ti99_datamux_device::debugger_read(address_space& space, UINT16 addr) +uint16_t ti99_datamux_device::debugger_read(address_space& space, uint16_t addr) { - UINT16 addrb = addr << 1; - UINT16 value = 0; + uint16_t addrb = addr << 1; + uint16_t value = 0; if ((addrb & 0xe000)==0x0000) value = m_consolerom[(addrb & 0x1fff)>>1]; else @@ -248,8 +248,8 @@ UINT16 ti99_datamux_device::debugger_read(address_space& space, UINT16 addr) } else { - UINT8 lval = 0; - UINT8 hval = 0; + uint8_t lval = 0; + uint8_t hval = 0; if ((addrb & 0xe000)==0x6000) { @@ -268,9 +268,9 @@ UINT16 ti99_datamux_device::debugger_read(address_space& space, UINT16 addr) return value; } -void ti99_datamux_device::debugger_write(address_space& space, UINT16 addr, UINT16 data) +void ti99_datamux_device::debugger_write(address_space& space, uint16_t addr, uint16_t data) { - UINT16 addrb = addr << 1; + uint16_t addrb = addr << 1; if ((addrb & 0xe000)==0x0000) return; @@ -319,7 +319,7 @@ void ti99_datamux_device::debugger_write(address_space& space, UINT16 addr, UINT */ READ16_MEMBER( ti99_datamux_device::read ) { - UINT16 value = 0; + uint16_t value = 0; // Care for debugger if (space.debugger_access()) @@ -355,7 +355,7 @@ READ16_MEMBER( ti99_datamux_device::read ) { // The byte from the odd address has already been read into the latch // Reading the even address now (addr) - UINT8 hbyte = 0; + uint8_t hbyte = 0; read_all(space, m_addr_buf, &hbyte); if (TRACE_ACCESS) logerror("Read even byte from address %04x -> %02x\n", m_addr_buf, hbyte); @@ -589,7 +589,7 @@ void ti99_datamux_device::device_stop(void) void ti99_datamux_device::device_reset(void) { - m_consolerom = (UINT16*)owner()->memregion(CONSOLEROM)->base(); + m_consolerom = (uint16_t*)owner()->memregion(CONSOLEROM)->base(); m_use32k = (ioport("RAM")->read()==1); m_console_groms_present = (ioport("GROMENA")->read()==1); diff --git a/src/devices/bus/ti99x/datamux.h b/src/devices/bus/ti99x/datamux.h index 3fe74f4ead2..828abebe667 100644 --- a/src/devices/bus/ti99x/datamux.h +++ b/src/devices/bus/ti99x/datamux.h @@ -30,7 +30,7 @@ extern const device_type DATAMUX; class ti99_datamux_device : public device_t { public: - ti99_datamux_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti99_datamux_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER( read ); DECLARE_WRITE16_MEMBER( write ); DECLARE_SETOFFSET_MEMBER( setoffset ); @@ -77,23 +77,23 @@ private: address_space* m_spacep; // Console ROM - UINT16* m_consolerom; + uint16_t* m_consolerom; // Console GROMs tmc0430_device* m_grom[3]; // Common read routine - void read_all(address_space& space, UINT16 addr, UINT8 *target); + void read_all(address_space& space, uint16_t addr, uint8_t *target); // Common write routine - void write_all(address_space& space, UINT16 addr, UINT8 value); + void write_all(address_space& space, uint16_t addr, uint8_t value); // Common set address method - void setaddress_all(address_space& space, UINT16 addr); + void setaddress_all(address_space& space, uint16_t addr); // Debugger access - UINT16 debugger_read(address_space& space, UINT16 addr); - void debugger_write(address_space& space, UINT16 addr, UINT16 data); + uint16_t debugger_read(address_space& space, uint16_t addr); + void debugger_write(address_space& space, uint16_t addr, uint16_t data); // Join own READY and external READY void ready_join(); @@ -102,7 +102,7 @@ private: devcb_write_line m_ready; // Address latch (emu). In reality, the address bus remains constant. - UINT16 m_addr_buf; + uint16_t m_addr_buf; // DBIN line int m_dbin; @@ -114,7 +114,7 @@ private: int m_sysready; // Latch which stores the first (odd) byte - UINT8 m_latch; + uint8_t m_latch; // Counter for the wait states. int m_waitcount; @@ -123,7 +123,7 @@ private: bool m_use32k; // Memory base for piggy-back 32K expansion. If 0, expansion is not used. - UINT16 m_base32k; + uint16_t m_base32k; // Console GROMs are available (the HSGPL expects them to be removed) bool m_console_groms_present; diff --git a/src/devices/bus/ti99x/genboard.cpp b/src/devices/bus/ti99x/genboard.cpp index 404cfbc0012..581b829c08e 100644 --- a/src/devices/bus/ti99x/genboard.cpp +++ b/src/devices/bus/ti99x/genboard.cpp @@ -209,7 +209,7 @@ #define SRAM_PAR_TAG ":sram" #define DRAM_PAR_TAG ":dram" -geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GENEVE_MAPPER, "Geneve Gate Array", tag, owner, clock, "geneve_mapper", __FILE__), m_gromwaddr_LSB(false), m_gromraddr_LSB(false), m_grom_address(0), m_video_waitstates(false), m_extra_waitstates(false), m_ready_asserted(false), m_read_mode(false), @@ -228,7 +228,7 @@ geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, const INPUT_CHANGED_MEMBER( geneve_mapper_device::settings_changed ) { - int number = (int)((UINT64)param&0x03); + int number = (int)((uint64_t)param&0x03); int value = newval; switch (number) @@ -265,7 +265,7 @@ INPUT_CHANGED_MEMBER( geneve_mapper_device::settings_changed ) */ READ8_MEMBER( geneve_mapper_device::read_grom ) { - UINT8 reply; + uint8_t reply; if (offset & 0x0002) { // GROM address handling @@ -312,7 +312,7 @@ WRITE8_MEMBER( geneve_mapper_device::write_grom ) } else { - m_grom_address = (m_grom_address & 0x00ff) | ((UINT16)data<<8); + m_grom_address = (m_grom_address & 0x00ff) | ((uint16_t)data<<8); m_gromwaddr_LSB = true; } } @@ -457,7 +457,7 @@ enum */ READ8_MEMBER( geneve_mapper_device::readm ) { - UINT8 value = 0; + uint8_t value = 0; decdata *dec; decdata debug; @@ -1225,7 +1225,7 @@ void geneve_mapper_device::decode(address_space& space, offs_t offset, bool read */ READ8_MEMBER( geneve_mapper_device::read_from_pfm ) { - UINT8 value; + uint8_t value; if (!m_pfm_output_enable) return 0; int address = (offset & 0x01ffff) | (m_pfm_bank<<17); @@ -1497,7 +1497,7 @@ const device_type GENEVE_MAPPER = &device_creator; static const char *const KEYNAMES[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" }; -static const UINT8 MF1_CODE[0xe] = +static const uint8_t MF1_CODE[0xe] = { /* extended keys that are equivalent to non-extended keys */ 0x1c, /* keypad enter */ @@ -1525,7 +1525,7 @@ static const UINT8 MF1_CODE[0xe] = 0x53 /* delete */ }; -geneve_keyboard_device::geneve_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +geneve_keyboard_device::geneve_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GENEVE_KEYBOARD, "Geneve XT-style keyboard", tag, owner, clock, "geneve_keyboard", __FILE__), m_interrupt(*this), m_key_reset(false), m_key_queue_length(0), m_key_queue_head(0), m_key_in_buffer(false), m_key_numlock_state(false), m_key_ctrl_state(0), m_key_alt_state(0), m_key_real_shift_state(0), m_key_fake_shift_state(false), m_key_fake_unshift_state(false), m_key_autorepeat_key(0), m_key_autorepeat_timer(0), m_keep_keybuf(false), @@ -1548,8 +1548,8 @@ void geneve_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, void geneve_keyboard_device::poll() { - UINT32 keystate; - UINT32 key_transitions; + uint32_t keystate; + uint32_t key_transitions; int i, j; int keycode; int pressed; @@ -1747,7 +1747,7 @@ void geneve_keyboard_device::poll() } } -UINT8 geneve_keyboard_device::get_recent_key() +uint8_t geneve_keyboard_device::get_recent_key() { if (m_key_in_buffer) return m_key_queue[m_key_queue_head]; else return 0; @@ -1996,7 +1996,7 @@ const device_type GENEVE_KEYBOARD = &device_creator; Mouse support ****************************************************************************/ -geneve_mouse_device::geneve_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +geneve_mouse_device::geneve_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GENEVE_MOUSE, "Geneve mouse", tag, owner, clock, "geneve_mouse", __FILE__), m_v9938(nullptr), m_last_mx(0), m_last_my(0) { } diff --git a/src/devices/bus/ti99x/genboard.h b/src/devices/bus/ti99x/genboard.h index 932989cf8d7..17683ba0358 100644 --- a/src/devices/bus/ti99x/genboard.h +++ b/src/devices/bus/ti99x/genboard.h @@ -32,7 +32,7 @@ extern const device_type GENEVE_MAPPER; class geneve_mouse_device : public device_t { public: - geneve_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + geneve_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void poll(); line_state left_button(); // left button is not connected to the V9938 but to a TMS9901 pin @@ -60,11 +60,11 @@ private: class geneve_keyboard_device : public device_t { public: - geneve_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + geneve_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( reset_line ); DECLARE_WRITE_LINE_MEMBER( send_scancodes ); DECLARE_WRITE_LINE_MEMBER( clock_control ); - UINT8 get_recent_key(); + uint8_t get_recent_key(); template static devcb_base &static_set_int_callback(device_t &device, _Object object) { return downcast(device).m_interrupt.set_callback(object); } @@ -82,10 +82,10 @@ private: bool m_key_reset; int m_key_queue_length; - UINT8 m_key_queue[KEYQUEUESIZE]; + uint8_t m_key_queue[KEYQUEUESIZE]; int m_key_queue_head; bool m_key_in_buffer; - UINT32 m_key_state_save[4]; + uint32_t m_key_state_save[4]; bool m_key_numlock_state; int m_key_ctrl_state; @@ -112,7 +112,7 @@ private: class geneve_mapper_device : public device_t { public: - geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_geneve_mode(bool geneve); void set_direct_mode(bool direct); void set_cartridge_size(int size); @@ -212,7 +212,7 @@ private: geneve_keyboard_device* m_keyboard; v9938_device* m_video; peribox_device* m_peribox; - UINT8* m_eprom; + uint8_t* m_eprom; required_device m_sram; required_device m_dram; }; diff --git a/src/devices/bus/ti99x/gromport.cpp b/src/devices/bus/ti99x/gromport.cpp index ac00f72df02..846efab7608 100644 --- a/src/devices/bus/ti99x/gromport.cpp +++ b/src/devices/bus/ti99x/gromport.cpp @@ -130,7 +130,7 @@ #define GKRACKER_ROM_TAG "gkracker_rom" #define GKRACKER_NVRAM_TAG "gkracker_nvram" -gromport_device::gromport_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gromport_device::gromport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bus8z_device(mconfig, GROMPORT, "Cartridge port", tag, owner, clock, "gromport", __FILE__), device_slot_interface(mconfig, *this), m_connector(nullptr), @@ -293,7 +293,7 @@ const device_type GROMPORT_SINGLE = &device_creator; const device_type GROMPORT_MULTI = &device_creator; const device_type GROMPORT_GK = &device_creator; -ti99_cartridge_connector_device::ti99_cartridge_connector_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) +ti99_cartridge_connector_device::ti99_cartridge_connector_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) : bus8z_device(mconfig, type, name, tag, owner, clock, shortname, source), m_gromport(nullptr) { @@ -309,7 +309,7 @@ void ti99_cartridge_connector_device::device_config_complete() m_gromport = static_cast(owner()); } -single_conn_device::single_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +single_conn_device::single_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti99_cartridge_connector_device(mconfig, GROMPORT_SINGLE, "Standard cartridge connector", tag, owner, clock, "single", __FILE__), m_cartridge(nullptr) { @@ -432,7 +432,7 @@ machine_config_constructor single_conn_device::device_mconfig_additions() const #define AUTO -1 -multi_conn_device::multi_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +multi_conn_device::multi_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti99_cartridge_connector_device(mconfig, GROMPORT_MULTI, "Multi-cartridge extender", tag, owner, clock, "multi", __FILE__), m_active_slot(0), m_fixed_slot(0), @@ -571,7 +571,7 @@ READ8Z_MEMBER(multi_conn_device::readz) { if (m_cartridge[i] != nullptr) { - UINT8 newval = *value; + uint8_t newval = *value; m_cartridge[i]->readz(space, offset, &newval, 0xff); if (i==slot) { @@ -692,7 +692,7 @@ machine_config_constructor multi_conn_device::device_mconfig_additions() const INPUT_CHANGED_MEMBER( multi_conn_device::switch_changed ) { - if (TRACE_CHANGE) logerror("Slot changed %d - %d\n", (int)((UINT64)param & 0x07), newval); + if (TRACE_CHANGE) logerror("Slot changed %d - %d\n", (int)((uint64_t)param & 0x07), newval); m_active_slot = m_fixed_slot = newval - 1; } @@ -826,7 +826,7 @@ enum #define GKSWITCH4_TAG "GKSWITCH4" #define GKSWITCH5_TAG "GKSWITCH5" -gkracker_device::gkracker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gkracker_device::gkracker_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ti99_cartridge_connector_device(mconfig, GROMPORT_GK, "GRAMKracker", tag, owner, clock, "ti99_gkracker", __FILE__), device_nvram_interface(mconfig, *this), m_romspace_selected(false), @@ -918,7 +918,7 @@ READ8Z_MEMBER(gkracker_device::readz) if (m_cartridge != nullptr) { // For debugging - UINT8 val1 = *value; + uint8_t val1 = *value; // Read from the guest cartridge. m_cartridge->readz(space, offset, value, mem_mask); @@ -1011,8 +1011,8 @@ WRITE8_MEMBER( gkracker_device::cruwrite ) INPUT_CHANGED_MEMBER( gkracker_device::gk_changed ) { - if (TRACE_GKRACKER) logerror("Input changed %d - %d\n", (int)((UINT64)param & 0x07), newval); - m_gk_switch[(UINT64)param & 0x07] = newval; + if (TRACE_GKRACKER) logerror("Input changed %d - %d\n", (int)((uint64_t)param & 0x07), newval); + m_gk_switch[(uint64_t)param & 0x07] = newval; } void gkracker_device::insert(int index, ti99_cartridge_device* cart) @@ -1033,12 +1033,12 @@ void gkracker_device::remove(int index) void gkracker_device::gk_install_menu(const char* menutext, int len, int ptr, int next, int start) { const int base = 0x0000; - m_ram_ptr[base + ptr] = (UINT8)((next >> 8) & 0xff); - m_ram_ptr[base + ptr+1] = (UINT8)(next & 0xff); - m_ram_ptr[base + ptr+2] = (UINT8)((start >> 8) & 0xff); - m_ram_ptr[base + ptr+3] = (UINT8)(start & 0xff); + m_ram_ptr[base + ptr] = (uint8_t)((next >> 8) & 0xff); + m_ram_ptr[base + ptr+1] = (uint8_t)(next & 0xff); + m_ram_ptr[base + ptr+2] = (uint8_t)((start >> 8) & 0xff); + m_ram_ptr[base + ptr+3] = (uint8_t)(start & 0xff); - m_ram_ptr[base + ptr+4] = (UINT8)(len & 0xff); + m_ram_ptr[base + ptr+4] = (uint8_t)(len & 0xff); memcpy(m_ram_ptr + base + ptr+5, menutext, len); } @@ -1225,7 +1225,7 @@ static const pcb_type sw_pcbdefs[] = { 0, nullptr} }; -ti99_cartridge_device::ti99_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti99_cartridge_device::ti99_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : bus8z_device(mconfig, TI99CART, "TI-99 cartridge", tag, owner, clock, "cartridge", __FILE__), device_image_interface(mconfig, *this), m_pcbtype(0), @@ -1240,8 +1240,8 @@ void ti99_cartridge_device::prepare_cartridge() { int rom2_length; - UINT8* grom_ptr; - UINT8* rom_ptr; + uint8_t* grom_ptr; + uint8_t* rom_ptr; memory_region *regg; memory_region *regr; @@ -1970,7 +1970,7 @@ READ8Z_MEMBER(ti99_super_cartridge::crureadz) if ((offset & 0xfff0) == 0x0800) { if (TRACE_CRU) space.device().logerror("CRU accessed at %04x\n", offset); - UINT8 val = 0x02 << (m_ram_page << 1); + uint8_t val = 0x02 << (m_ram_page << 1); *value = (val >> ((offset - 0x0800)>>1)) & 0xff; } } @@ -2520,7 +2520,7 @@ rpk::~rpk() /* Deliver the contents of the socket by name of the socket. */ -UINT8* rpk::get_contents_of_socket(const char *socket_name) +uint8_t* rpk::get_contents_of_socket(const char *socket_name) { auto socket = m_sockets.find(socket_name); if (socket == m_sockets.end()) return nullptr; @@ -2572,12 +2572,12 @@ void rpk::close() not a network socket) ***************************************************************/ -rpk_socket::rpk_socket(const char* id, int length, UINT8* contents, const char *pathname) +rpk_socket::rpk_socket(const char* id, int length, uint8_t* contents, const char *pathname) : m_id(id), m_length(length), m_contents(contents), m_pathname(pathname) { } -rpk_socket::rpk_socket(const char* id, int length, UINT8* contents) +rpk_socket::rpk_socket(const char* id, int length, uint8_t* contents) : m_id(id), m_length(length), m_contents(contents), m_pathname(nullptr) { } @@ -2585,7 +2585,7 @@ rpk_socket::rpk_socket(const char* id, int length, UINT8* contents) /* Locate a file in the ZIP container */ -int rpk_reader::find_file(util::archive_file &zip, const char *filename, UINT32 crc) +int rpk_reader::find_file(util::archive_file &zip, const char *filename, uint32_t crc) { for (int header = zip.first_file(); header >= 0; header = zip.next_file()) { @@ -2621,9 +2621,9 @@ std::unique_ptr rpk_reader::load_rom_resource(util::archive_file &zi const char* crcstr; const char* sha1; util::archive_file::error ziperr; - UINT32 crc; + uint32_t crc; int length; - UINT8* contents; + uint8_t* contents; int header; // find the file attribute (required) @@ -2649,7 +2649,7 @@ std::unique_ptr rpk_reader::load_rom_resource(util::archive_file &zi length = zip.current_uncompressed_length(); // Allocate storage - contents = global_alloc_array_clear(length); + contents = global_alloc_array_clear(length); if (contents==nullptr) throw rpk_exception(RPK_OUT_OF_MEMORY); // and unzip file from the zip file @@ -2665,7 +2665,7 @@ std::unique_ptr rpk_reader::load_rom_resource(util::archive_file &zi if (sha1 != nullptr) { util::hash_collection actual_hashes; - actual_hashes.compute((const UINT8 *)contents, length, util::hash_collection::HASH_TYPES_CRC_SHA1); + actual_hashes.compute((const uint8_t *)contents, length, util::hash_collection::HASH_TYPES_CRC_SHA1); util::hash_collection expected_hashes; expected_hashes.add_from_string(util::hash_collection::HASH_SHA1, sha1, strlen(sha1)); @@ -2687,7 +2687,7 @@ std::unique_ptr rpk_reader::load_ram_resource(emu_options &options, const char* ram_filename; const char* ram_pname; unsigned int length; - UINT8* contents; + uint8_t* contents; // find the length attribute length_string = xml_get_attribute_string(ram_resource_node, "length", nullptr); @@ -2715,7 +2715,7 @@ std::unique_ptr rpk_reader::load_ram_resource(emu_options &options, } // Allocate memory for this resource - contents = global_alloc_array_clear(length); + contents = global_alloc_array_clear(length); if (contents==nullptr) throw rpk_exception(RPK_OUT_OF_MEMORY); if (TRACE_RPK) printf("gromport/RPK: Allocating RAM buffer (%d bytes) for socket '%s'\n", length, socketname); diff --git a/src/devices/bus/ti99x/gromport.h b/src/devices/bus/ti99x/gromport.h index 34161cb6a5d..9e0765fd826 100644 --- a/src/devices/bus/ti99x/gromport.h +++ b/src/devices/bus/ti99x/gromport.h @@ -22,7 +22,7 @@ class ti99_cartridge_connector_device; class gromport_device : public bus8z_device, public device_slot_interface { public: - gromport_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gromport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; DECLARE_READ8Z_MEMBER(crureadz); @@ -86,7 +86,7 @@ class ti99_cartridge_pcb; class ti99_cartridge_device : public bus8z_device, public device_image_interface { public: - ti99_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti99_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -164,7 +164,7 @@ public: virtual bool is_grom_idle() =0; protected: - ti99_cartridge_connector_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); + ti99_cartridge_connector_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_config_complete() override; gromport_device* m_gromport; @@ -177,7 +177,7 @@ protected: class single_conn_device : public ti99_cartridge_connector_device { public: - single_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + single_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -210,7 +210,7 @@ private: class multi_conn_device : public ti99_cartridge_connector_device { public: - multi_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + multi_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -249,7 +249,7 @@ private: class gkracker_device : public ti99_cartridge_connector_device, public device_nvram_interface { public: - gkracker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gkracker_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; @@ -285,8 +285,8 @@ private: bool m_romspace_selected; int m_ram_page; int m_grom_address; - UINT8* m_ram_ptr; - UINT8* m_grom_ptr; + uint8_t* m_ram_ptr; + uint8_t* m_grom_ptr; bool m_waddr_LSB; @@ -334,16 +334,16 @@ protected: int m_rom_size; int m_ram_size; - UINT8* m_rom_ptr; - UINT8* m_ram_ptr; + uint8_t* m_rom_ptr; + uint8_t* m_ram_ptr; bool m_romspace_selected; int m_rom_page; // for some cartridge types - UINT8* m_grom_ptr; // for gromemu + uint8_t* m_grom_ptr; // for gromemu int m_grom_address; // for gromemu int m_ram_page; // for super const char* m_tag; - std::vector m_nvram; // for MiniMemory - std::vector m_ram; // for MBX + std::vector m_nvram; // for MiniMemory + std::vector m_ram; // for MBX }; /******************** Standard cartridge ******************************/ @@ -488,21 +488,21 @@ class rpk_socket friend class rpk; public: - rpk_socket(const char *id, int length, UINT8 *contents); - rpk_socket(const char *id, int length, UINT8 *contents, const char *pathname); + rpk_socket(const char *id, int length, uint8_t *contents); + rpk_socket(const char *id, int length, uint8_t *contents, const char *pathname); ~rpk_socket() {} const char* id() { return m_id; } int get_content_length() { return m_length; } - UINT8* get_contents() { return m_contents; } + uint8_t* get_contents() { return m_contents; } bool persistent_ram() { return m_pathname != nullptr; } const char* get_pathname() { return m_pathname; } void cleanup() { if (m_contents != nullptr) global_free_array(m_contents); } private: const char* m_id; - UINT32 m_length; - UINT8* m_contents; + uint32_t m_length; + uint8_t* m_contents; const char* m_pathname; }; @@ -515,7 +515,7 @@ public: rpk *open(emu_options &options, const char *filename, const char *system_name); private: - int find_file(util::archive_file &zip, const char *filename, UINT32 crc); + int find_file(util::archive_file &zip, const char *filename, uint32_t crc); std::unique_ptr load_rom_resource(util::archive_file &zip, xml_data_node* rom_resource_node, const char* socketname); std::unique_ptr load_ram_resource(emu_options &options, xml_data_node* ram_resource_node, const char* socketname, const char* system_name); const pcb_type* m_types; @@ -529,7 +529,7 @@ public: ~rpk(); int get_type(void) { return m_type; } - UINT8* get_contents_of_socket(const char *socket_name); + uint8_t* get_contents_of_socket(const char *socket_name); int get_resource_length(const char *socket_name); void close(); diff --git a/src/devices/bus/ti99x/handset.cpp b/src/devices/bus/ti99x/handset.cpp index 6e759b2115c..c4a3f86630c 100644 --- a/src/devices/bus/ti99x/handset.cpp +++ b/src/devices/bus/ti99x/handset.cpp @@ -50,7 +50,7 @@ static const char *const joynames[2][4] = static const char *const keynames[] = { "KP0", "KP1", "KP2", "KP3", "KP4" }; -ti99_handset_device::ti99_handset_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti99_handset_device::ti99_handset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : joyport_attached_device(mconfig, HANDSET, "TI-99/4 IR handset", tag, owner, clock, "handset", __FILE__), m_ack(0), m_clock_high(false), m_buf(0), m_buflen(0), m_delay_timer(nullptr) { } @@ -68,12 +68,12 @@ ti99_handset_device::ti99_handset_device(const machine_config &mconfig, const ch answer = |0|I|C|1|B|B|B|B| */ -UINT8 ti99_handset_device::read_dev() +uint8_t ti99_handset_device::read_dev() { return (m_buf & 0xf) | 0x10 | (m_clock_high? 0x20:0) | ( m_buflen==3? 0x00:0x40); } -void ti99_handset_device::write_dev(UINT8 data) +void ti99_handset_device::write_dev(uint8_t data) { if (VERBOSE>7) LOG("ti99_handset_device: Set ack %d\n", data); set_acknowledge(data); @@ -152,8 +152,8 @@ void ti99_handset_device::post_message(int message) */ bool ti99_handset_device::poll_keyboard(int num) { - UINT32 key_buf; - UINT8 current_key; + uint32_t key_buf; + uint8_t current_key; int i; /* read current key state */ @@ -223,7 +223,7 @@ bool ti99_handset_device::poll_keyboard(int num) */ bool ti99_handset_device::poll_joystick(int num) { - UINT8 current_joy; + uint8_t current_joy; int current_joy_x, current_joy_y; int message; /* read joystick position */ @@ -495,7 +495,7 @@ INPUT_PORTS_START( joysticks ) PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1/*, "(2FIRE)", CODE_NONE, OSD_JOY2_FIRE, 0*/) PORT_PLAYER(2) INPUT_PORTS_END -ti99_twin_joystick::ti99_twin_joystick(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti99_twin_joystick::ti99_twin_joystick(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : joyport_attached_device(mconfig, HANDSET, "TI-99/4(A) Twin Joystick", tag, owner, clock, "twinjoy", __FILE__), m_joystick(0) { } @@ -510,9 +510,9 @@ void ti99_twin_joystick::device_start(void) answer = |0|0|0|U|D|R|L|B| */ -UINT8 ti99_twin_joystick::read_dev() +uint8_t ti99_twin_joystick::read_dev() { - UINT8 value; + uint8_t value; if (m_joystick==1) value = ioport("JOY1")->read(); else { @@ -523,7 +523,7 @@ UINT8 ti99_twin_joystick::read_dev() return value; } -void ti99_twin_joystick::write_dev(UINT8 data) +void ti99_twin_joystick::write_dev(uint8_t data) { if (VERBOSE>7) LOG("ti99_twin_joystick: Select joystick %d\n", data); m_joystick = data & 0x03; diff --git a/src/devices/bus/ti99x/handset.h b/src/devices/bus/ti99x/handset.h index 5e592bd2ebc..5b899813ed0 100644 --- a/src/devices/bus/ti99x/handset.h +++ b/src/devices/bus/ti99x/handset.h @@ -27,10 +27,10 @@ extern const device_type HANDSET; class ti99_handset_device : public joyport_attached_device { public: - ti99_handset_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti99_handset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT8 read_dev() override; - void write_dev(UINT8 data) override; + uint8_t read_dev() override; + void write_dev(uint8_t data) override; void pulse_clock() override; @@ -52,8 +52,8 @@ private: bool m_clock_high; int m_buf; int m_buflen; - UINT8 previous_joy[MAX_HANDSETS]; - UINT8 previous_key[MAX_HANDSETS]; + uint8_t previous_joy[MAX_HANDSETS]; + uint8_t previous_key[MAX_HANDSETS]; emu_timer *m_delay_timer; }; @@ -65,11 +65,11 @@ extern const device_type TI99_JOYSTICK; class ti99_twin_joystick : public joyport_attached_device { public: - ti99_twin_joystick(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti99_twin_joystick(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start(void) override; - UINT8 read_dev() override; - void write_dev(UINT8 data) override; + uint8_t read_dev() override; + void write_dev(uint8_t data) override; protected: virtual ioport_constructor device_input_ports() const override; diff --git a/src/devices/bus/ti99x/joyport.cpp b/src/devices/bus/ti99x/joyport.cpp index 5cc4dd08e56..d37dea4c48f 100644 --- a/src/devices/bus/ti99x/joyport.cpp +++ b/src/devices/bus/ti99x/joyport.cpp @@ -39,7 +39,7 @@ #include "handset.h" #include "mecmouse.h" -joyport_device::joyport_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +joyport_device::joyport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JOYPORT, "Joystick port", tag, owner, clock, "ti99_joyport", __FILE__), device_slot_interface(mconfig, *this), m_interrupt(*this), m_connected(nullptr) @@ -49,7 +49,7 @@ joyport_device::joyport_device(const machine_config &mconfig, const char *tag, d /* Reads a value from the port. */ -UINT8 joyport_device::read_port() +uint8_t joyport_device::read_port() { return m_connected->read_dev(); } diff --git a/src/devices/bus/ti99x/joyport.h b/src/devices/bus/ti99x/joyport.h index 82129db726e..d50988c47c6 100644 --- a/src/devices/bus/ti99x/joyport.h +++ b/src/devices/bus/ti99x/joyport.h @@ -32,12 +32,12 @@ class joyport_device; class joyport_attached_device : public device_t { public: - joyport_attached_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) + joyport_attached_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_joyport(nullptr) { } - virtual UINT8 read_dev() =0; - virtual void write_dev(UINT8 data) =0; + virtual uint8_t read_dev() =0; + virtual void write_dev(uint8_t data) =0; virtual void pulse_clock() { }; protected: @@ -51,8 +51,8 @@ protected: class joyport_device : public device_t, public device_slot_interface { public: - joyport_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - UINT8 read_port(); + joyport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + uint8_t read_port(); void write_port(int data); void set_interrupt(int state); void pulse_clock(); diff --git a/src/devices/bus/ti99x/mecmouse.cpp b/src/devices/bus/ti99x/mecmouse.cpp index 56b370e55c5..9bd767484ec 100644 --- a/src/devices/bus/ti99x/mecmouse.cpp +++ b/src/devices/bus/ti99x/mecmouse.cpp @@ -52,13 +52,13 @@ #define POLL_TIMER 1 -mecmouse_device::mecmouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mecmouse_device::mecmouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : joyport_attached_device(mconfig, MECMOUSE, "Mechatronics Mouse", tag, owner, clock, "mecmouse", __FILE__), m_last_select(0), m_read_y_axis(false), m_x(0), m_y(0), m_x_buf(0), m_y_buf(0), m_last_mx(0), m_last_my(0), m_poll_timer(nullptr) { } -UINT8 mecmouse_device::read_dev() +uint8_t mecmouse_device::read_dev() { int answer; int buttons = ioport("MOUSE0")->read() & 3; @@ -80,7 +80,7 @@ UINT8 mecmouse_device::read_dev() /* Used to select lines. data = 0x01 (Joy1), 0x02 (Joy2) */ -void mecmouse_device::write_dev(UINT8 data) +void mecmouse_device::write_dev(uint8_t data) { if (data == 0x02) { if (m_last_select == 0x01) { diff --git a/src/devices/bus/ti99x/mecmouse.h b/src/devices/bus/ti99x/mecmouse.h index 37390a7461c..ba0e70b4629 100644 --- a/src/devices/bus/ti99x/mecmouse.h +++ b/src/devices/bus/ti99x/mecmouse.h @@ -22,10 +22,10 @@ extern const device_type MECMOUSE; class mecmouse_device : public joyport_attached_device { public: - mecmouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mecmouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT8 read_dev() override; - void write_dev(UINT8 data) override; + uint8_t read_dev() override; + void write_dev(uint8_t data) override; protected: virtual void device_start(void) override; diff --git a/src/devices/bus/ti99x/ti99defs.h b/src/devices/bus/ti99x/ti99defs.h index 38d0f1d9f61..134b7cf0331 100644 --- a/src/devices/bus/ti99x/ti99defs.h +++ b/src/devices/bus/ti99x/ti99defs.h @@ -91,10 +91,10 @@ #define PFM512_TAG "pfm512" #define PFM512A_TAG "pfm512a" -#define READ16Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 *value, ATTR_UNUSED UINT16 mem_mask) -#define DECLARE_READ16Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 *value, ATTR_UNUSED UINT16 mem_mask = 0xffff) -#define READ8Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 *value, ATTR_UNUSED UINT8 mem_mask) -#define DECLARE_READ8Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 *value, ATTR_UNUSED UINT8 mem_mask = 0xff) +#define READ16Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint16_t *value, ATTR_UNUSED uint16_t mem_mask) +#define DECLARE_READ16Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint16_t *value, ATTR_UNUSED uint16_t mem_mask = 0xffff) +#define READ8Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t *value, ATTR_UNUSED uint8_t mem_mask) +#define DECLARE_READ8Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t *value, ATTR_UNUSED uint8_t mem_mask = 0xff) /* For almost all applications of setoffset, we also need the data bus @@ -117,7 +117,7 @@ class bus8z_device : public device_t { public: - bus8z_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) + bus8z_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) { } virtual DECLARE_READ8Z_MEMBER(readz) =0; virtual DECLARE_WRITE8_MEMBER(write) =0; @@ -127,7 +127,7 @@ public: class bus16z_device : device_t { public: - bus16z_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) + bus16z_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) { } virtual DECLARE_READ16Z_MEMBER(read16z) =0; virtual DECLARE_WRITE16_MEMBER(write16) =0; @@ -160,7 +160,7 @@ const device_type EVPC_CONN = &device_creator; class evpc_clock_connector : public device_t { public: - evpc_clock_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + evpc_clock_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EVPC_CONN, "EVPC clock connector", tag, owner, clock, "ti99_evpc_clock", __FILE__), m_vdpint(*this) { }; diff --git a/src/devices/bus/tiki100/8088.cpp b/src/devices/bus/tiki100/8088.cpp index e3bc01908fb..2c1fb9f7cbd 100644 --- a/src/devices/bus/tiki100/8088.cpp +++ b/src/devices/bus/tiki100/8088.cpp @@ -91,7 +91,7 @@ machine_config_constructor tiki100_8088_t::device_mconfig_additions() const // tiki100_8088_t - constructor //------------------------------------------------- -tiki100_8088_t::tiki100_8088_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +tiki100_8088_t::tiki100_8088_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TIKI100_8088, "TIKI-100 8/16", tag, owner, clock, "tiki100_8088", __FILE__), device_tiki100bus_card_interface(mconfig, *this), m_maincpu(*this, I8088_TAG), @@ -125,7 +125,7 @@ void tiki100_8088_t::device_reset() // tiki100bus_iorq_r - I/O read //------------------------------------------------- -UINT8 tiki100_8088_t::iorq_r(address_space &space, offs_t offset, UINT8 data) +uint8_t tiki100_8088_t::iorq_r(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xff) == 0x7f) { @@ -140,7 +140,7 @@ UINT8 tiki100_8088_t::iorq_r(address_space &space, offs_t offset, UINT8 data) // tiki100bus_iorq_w - I/O write //------------------------------------------------- -void tiki100_8088_t::iorq_w(address_space &space, offs_t offset, UINT8 data) +void tiki100_8088_t::iorq_w(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xff) == 0x7f) { diff --git a/src/devices/bus/tiki100/8088.h b/src/devices/bus/tiki100/8088.h index 3b019131472..640feb1b3f0 100644 --- a/src/devices/bus/tiki100/8088.h +++ b/src/devices/bus/tiki100/8088.h @@ -28,7 +28,7 @@ class tiki100_8088_t : public device_t, { public: // construction/destruction - tiki100_8088_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tiki100_8088_t(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; @@ -43,13 +43,13 @@ protected: virtual void device_reset() override; // device_tiki100bus_card_interface overrides - virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data) override; - virtual void iorq_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t iorq_r(address_space &space, offs_t offset, uint8_t data) override; + virtual void iorq_w(address_space &space, offs_t offset, uint8_t data) override; private: required_device m_maincpu; - UINT8 m_data; + uint8_t m_data; }; diff --git a/src/devices/bus/tiki100/exp.cpp b/src/devices/bus/tiki100/exp.cpp index 9ec594375b2..8cc34faed90 100644 --- a/src/devices/bus/tiki100/exp.cpp +++ b/src/devices/bus/tiki100/exp.cpp @@ -26,7 +26,7 @@ const device_type TIKI100_BUS_SLOT = &device_creator; // tiki100_bus_slot_t - constructor //------------------------------------------------- -tiki100_bus_slot_t::tiki100_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +tiki100_bus_slot_t::tiki100_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TIKI100_BUS_SLOT, "TIKI-100 expansion bus slot", tag, owner, clock, "tiki100bus_slot", __FILE__), device_slot_interface(mconfig, *this), device_z80daisy_interface(mconfig, *this), @@ -56,7 +56,7 @@ void tiki100_bus_slot_t::device_start() // tiki100_bus_t - constructor //------------------------------------------------- -tiki100_bus_t::tiki100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +tiki100_bus_t::tiki100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TIKI100_BUS, "TIKI-100 expansion bus", tag, owner, clock, "tiki100bus", __FILE__), m_irq_cb(*this), m_nmi_cb(*this), @@ -98,7 +98,7 @@ void tiki100_bus_t::add_card(device_tiki100bus_card_interface *card) // mrq_r - memory read //------------------------------------------------- -UINT8 tiki100_bus_t::mrq_r(address_space &space, offs_t offset, UINT8 data, bool &mdis) +uint8_t tiki100_bus_t::mrq_r(address_space &space, offs_t offset, uint8_t data, bool &mdis) { device_tiki100bus_card_interface *entry = m_device_list.first(); @@ -132,7 +132,7 @@ WRITE8_MEMBER( tiki100_bus_t::mrq_w ) // iorq_r - I/O read //------------------------------------------------- -UINT8 tiki100_bus_t::iorq_r(address_space &space, offs_t offset, UINT8 data) +uint8_t tiki100_bus_t::iorq_r(address_space &space, offs_t offset, uint8_t data) { device_tiki100bus_card_interface *entry = m_device_list.first(); diff --git a/src/devices/bus/tiki100/exp.h b/src/devices/bus/tiki100/exp.h index 511d449beea..831694612f4 100644 --- a/src/devices/bus/tiki100/exp.h +++ b/src/devices/bus/tiki100/exp.h @@ -80,12 +80,12 @@ public: device_tiki100bus_card_interface *next() const { return m_next; } // memory access - virtual UINT8 mrq_r(address_space &space, offs_t offset, UINT8 data, bool &mdis) { mdis = 1; return data; }; - virtual void mrq_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t mrq_r(address_space &space, offs_t offset, uint8_t data, bool &mdis) { mdis = 1; return data; }; + virtual void mrq_w(address_space &space, offs_t offset, uint8_t data) { }; // I/O access - virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data) { return data; }; - virtual void iorq_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t iorq_r(address_space &space, offs_t offset, uint8_t data) { return data; }; + virtual void iorq_w(address_space &space, offs_t offset, uint8_t data) { }; virtual void busak_w(int state) { m_busak = state; }; @@ -110,7 +110,7 @@ class tiki100_bus_slot_t : public device_t, { public: // construction/destruction - tiki100_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tiki100_bus_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -138,7 +138,7 @@ class tiki100_bus_t : public device_t { public: // construction/destruction - tiki100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tiki100_bus_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tiki100_bus_t() { m_device_list.detach_all(); } template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } @@ -150,10 +150,10 @@ public: void add_card(device_tiki100bus_card_interface *card); // computer interface - UINT8 mrq_r(address_space &space, offs_t offset, UINT8 data, bool &mdis); + uint8_t mrq_r(address_space &space, offs_t offset, uint8_t data, bool &mdis); DECLARE_WRITE8_MEMBER( mrq_w ); - UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data); + uint8_t iorq_r(address_space &space, offs_t offset, uint8_t data); DECLARE_WRITE8_MEMBER( iorq_w ); DECLARE_WRITE_LINE_MEMBER( busak_w ); diff --git a/src/devices/bus/tiki100/hdc.cpp b/src/devices/bus/tiki100/hdc.cpp index 504222f0f48..a79e51242b2 100644 --- a/src/devices/bus/tiki100/hdc.cpp +++ b/src/devices/bus/tiki100/hdc.cpp @@ -63,7 +63,7 @@ machine_config_constructor tiki100_hdc_t::device_mconfig_additions() const // tiki100_hdc_t - constructor //------------------------------------------------- -tiki100_hdc_t::tiki100_hdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +tiki100_hdc_t::tiki100_hdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TIKI100_HDC, "TIKI-100 Winchester controller", tag, owner, clock, "tiki100_hdc", __FILE__), device_tiki100bus_card_interface(mconfig, *this), m_hdc(*this, WD1010_TAG) @@ -94,7 +94,7 @@ void tiki100_hdc_t::device_reset() // tiki100bus_iorq_r - I/O read //------------------------------------------------- -UINT8 tiki100_hdc_t::iorq_r(address_space &space, offs_t offset, UINT8 data) +uint8_t tiki100_hdc_t::iorq_r(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xf8) == 0x20) { @@ -109,7 +109,7 @@ UINT8 tiki100_hdc_t::iorq_r(address_space &space, offs_t offset, UINT8 data) // tiki100bus_iorq_w - I/O write //------------------------------------------------- -void tiki100_hdc_t::iorq_w(address_space &space, offs_t offset, UINT8 data) +void tiki100_hdc_t::iorq_w(address_space &space, offs_t offset, uint8_t data) { if ((offset & 0xf8) == 0x20) { diff --git a/src/devices/bus/tiki100/hdc.h b/src/devices/bus/tiki100/hdc.h index 0d533bf7f96..b02cd79d3b0 100644 --- a/src/devices/bus/tiki100/hdc.h +++ b/src/devices/bus/tiki100/hdc.h @@ -29,7 +29,7 @@ class tiki100_hdc_t : public device_t, { public: // construction/destruction - tiki100_hdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tiki100_hdc_t(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; @@ -40,8 +40,8 @@ protected: virtual void device_reset() override; // device_tiki100bus_card_interface overrides - virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data) override; - virtual void iorq_w(address_space &space, offs_t offset, UINT8 data) override; + virtual uint8_t iorq_r(address_space &space, offs_t offset, uint8_t data) override; + virtual void iorq_w(address_space &space, offs_t offset, uint8_t data) override; private: required_device m_hdc; diff --git a/src/devices/bus/tvc/hbf.cpp b/src/devices/bus/tvc/hbf.cpp index e8de66ebc07..017d67af1d6 100644 --- a/src/devices/bus/tvc/hbf.cpp +++ b/src/devices/bus/tvc/hbf.cpp @@ -58,7 +58,7 @@ const device_type TVC_HBF = &device_creator; // tvc_hbf_device - constructor //------------------------------------------------- -tvc_hbf_device::tvc_hbf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tvc_hbf_device::tvc_hbf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TVC_HBF, "HBF floppy interface", tag, owner, clock, "tvc_hbf", __FILE__), device_tvcexp_interface( mconfig, *this ), m_fdc(*this, "fdc"), m_rom(nullptr), m_ram(nullptr), m_rom_bank(0) diff --git a/src/devices/bus/tvc/hbf.h b/src/devices/bus/tvc/hbf.h index 83d98d8a0cb..2beb189391d 100644 --- a/src/devices/bus/tvc/hbf.h +++ b/src/devices/bus/tvc/hbf.h @@ -23,7 +23,7 @@ class tvc_hbf_device : { public: // construction/destruction - tvc_hbf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tvc_hbf_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; @@ -37,7 +37,7 @@ protected: virtual void device_reset() override; // tvcexp_interface overrides - virtual UINT8 id_r() override { return 0x02; } // ID_A to GND, ID_B to VCC + virtual uint8_t id_r() override { return 0x02; } // ID_A to GND, ID_B to VCC virtual DECLARE_READ8_MEMBER(read) override; virtual DECLARE_WRITE8_MEMBER(write) override; virtual DECLARE_READ8_MEMBER(io_read) override; @@ -47,9 +47,9 @@ private: // internal state required_device m_fdc; - UINT8 * m_rom; - UINT8 * m_ram; - UINT8 m_rom_bank; // A12 and A13 + uint8_t * m_rom; + uint8_t * m_ram; + uint8_t m_rom_bank; // A12 and A13 }; diff --git a/src/devices/bus/tvc/tvc.cpp b/src/devices/bus/tvc/tvc.cpp index db2ed411ad2..84f90f96af1 100644 --- a/src/devices/bus/tvc/tvc.cpp +++ b/src/devices/bus/tvc/tvc.cpp @@ -51,7 +51,7 @@ device_tvcexp_interface::~device_tvcexp_interface() //------------------------------------------------- // tvcexp_slot_device - constructor //------------------------------------------------- -tvcexp_slot_device::tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +tvcexp_slot_device::tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TVCEXP_SLOT, "TVC64 Expansion Slot", tag, owner, clock, "tvcexp_slot", __FILE__), device_slot_interface(mconfig, *this), m_out_irq_cb(*this), @@ -84,9 +84,9 @@ void tvcexp_slot_device::device_start() module id read -------------------------------------------------*/ -UINT8 tvcexp_slot_device::id_r() +uint8_t tvcexp_slot_device::id_r() { - UINT8 result = 0x00; + uint8_t result = 0x00; if (m_cart) result = m_cart->id_r() & 0x03; @@ -108,9 +108,9 @@ void tvcexp_slot_device::int_ack() module int read -------------------------------------------------*/ -UINT8 tvcexp_slot_device::int_r() +uint8_t tvcexp_slot_device::int_r() { - UINT8 result = 1; + uint8_t result = 1; if (m_cart) result = m_cart->int_r() & 0x01; diff --git a/src/devices/bus/tvc/tvc.h b/src/devices/bus/tvc/tvc.h index 9fa9e89fd2b..40ceb334886 100644 --- a/src/devices/bus/tvc/tvc.h +++ b/src/devices/bus/tvc/tvc.h @@ -71,9 +71,9 @@ public: virtual ~device_tvcexp_interface(); // reading and writing - virtual UINT8 id_r() { return 0x00; } // ID_A and ID_B lines + virtual uint8_t id_r() { return 0x00; } // ID_A and ID_B lines virtual void int_ack() { } - virtual UINT8 int_r() { return 1; } + virtual uint8_t int_r() { return 1; } virtual DECLARE_READ8_MEMBER(read) { return 0x00; } virtual DECLARE_WRITE8_MEMBER(write) {} virtual DECLARE_READ8_MEMBER(io_read) { return 0x00; } @@ -87,7 +87,7 @@ class tvcexp_slot_device : public device_t, { public: // construction/destruction - tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~tvcexp_slot_device(); template static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_cb.set_callback(object); } @@ -97,9 +97,9 @@ public: virtual void device_start() override; // reading and writing - virtual UINT8 id_r(); + virtual uint8_t id_r(); virtual void int_ack(); - virtual UINT8 int_r(); + virtual uint8_t int_r(); virtual DECLARE_READ8_MEMBER(read); virtual DECLARE_WRITE8_MEMBER(write); virtual DECLARE_READ8_MEMBER(io_read); diff --git a/src/devices/bus/vboy/rom.cpp b/src/devices/bus/vboy/rom.cpp index 587be158610..7ae6a408233 100644 --- a/src/devices/bus/vboy/rom.cpp +++ b/src/devices/bus/vboy/rom.cpp @@ -21,19 +21,19 @@ const device_type VBOY_ROM_STD = &device_creator; const device_type VBOY_ROM_EEPROM = &device_creator; -vboy_rom_device::vboy_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +vboy_rom_device::vboy_rom_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_vboy_cart_interface( mconfig, *this ) { } -vboy_rom_device::vboy_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vboy_rom_device::vboy_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VBOY_ROM_STD, "Nintendo Virtual Boy Carts", tag, owner, clock, "vboy_rom", __FILE__), device_vboy_cart_interface( mconfig, *this ) { } -vboy_eeprom_device::vboy_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vboy_eeprom_device::vboy_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : vboy_rom_device(mconfig, VBOY_ROM_EEPROM, "Nintendo Virtual Boy Carts + EEPROM", tag, owner, clock, "vboy_eeprom", __FILE__) { } diff --git a/src/devices/bus/vboy/rom.h b/src/devices/bus/vboy/rom.h index 9ced7b51296..05b0a518120 100644 --- a/src/devices/bus/vboy/rom.h +++ b/src/devices/bus/vboy/rom.h @@ -13,8 +13,8 @@ class vboy_rom_device : public device_t, { public: // construction/destruction - vboy_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - vboy_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vboy_rom_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); + vboy_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -29,7 +29,7 @@ class vboy_eeprom_device : public vboy_rom_device { public: // construction/destruction - vboy_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vboy_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ32_MEMBER(read_eeprom) override; diff --git a/src/devices/bus/vboy/slot.cpp b/src/devices/bus/vboy/slot.cpp index e59a7299a7a..d89e497a3b5 100644 --- a/src/devices/bus/vboy/slot.cpp +++ b/src/devices/bus/vboy/slot.cpp @@ -46,11 +46,11 @@ device_vboy_cart_interface::~device_vboy_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_vboy_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_vboy_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { - m_rom = (UINT32 *)device().machine().memory().region_alloc(std::string(tag).append(VBOYSLOT_ROM_REGION_TAG).c_str(), size, 4, ENDIANNESS_LITTLE)->base(); + m_rom = (uint32_t *)device().machine().memory().region_alloc(std::string(tag).append(VBOYSLOT_ROM_REGION_TAG).c_str(), size, 4, ENDIANNESS_LITTLE)->base(); m_rom_size = size/4; m_rom_mask = m_rom_size - 1; } @@ -61,9 +61,9 @@ void device_vboy_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_vboy_cart_interface::eeprom_alloc(UINT32 size) +void device_vboy_cart_interface::eeprom_alloc(uint32_t size) { - m_eeprom.resize(size/sizeof(UINT32)); + m_eeprom.resize(size/sizeof(uint32_t)); } @@ -74,7 +74,7 @@ void device_vboy_cart_interface::eeprom_alloc(UINT32 size) //------------------------------------------------- // vboy_cart_slot_device - constructor //------------------------------------------------- -vboy_cart_slot_device::vboy_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vboy_cart_slot_device::vboy_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VBOY_CART_SLOT, "Nintendo Virtual Boy Cartridge Slot", tag, owner, clock, "vboy_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -162,8 +162,8 @@ image_init_result vboy_cart_slot_device::call_load() { if (m_cart) { - UINT8 *ROM; - UINT32 len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint8_t *ROM; + uint32_t len = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); bool has_eeprom = (software_entry() != nullptr) && get_software_region("eeprom"); if (len > 0x200000) @@ -178,7 +178,7 @@ image_init_result vboy_cart_slot_device::call_load() if (has_eeprom) m_cart->eeprom_alloc(get_software_region_length("eeprom")); - ROM = (UINT8 *)m_cart->get_rom_base(); + ROM = (uint8_t *)m_cart->get_rom_base(); if (software_entry() == nullptr) fread(ROM, len); diff --git a/src/devices/bus/vboy/slot.h b/src/devices/bus/vboy/slot.h index 71adadd6a2a..831882984d5 100644 --- a/src/devices/bus/vboy/slot.h +++ b/src/devices/bus/vboy/slot.h @@ -33,21 +33,21 @@ public: virtual DECLARE_READ32_MEMBER(read_eeprom) { return 0xffffffff; } virtual DECLARE_WRITE32_MEMBER(write_eeprom) {} - void rom_alloc(UINT32 size, const char *tag); - void eeprom_alloc(UINT32 size); - UINT32* get_rom_base() { return m_rom; } - UINT32* get_eeprom_base() { return &m_eeprom[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_eeprom_size() { return m_eeprom.size(); } + void rom_alloc(uint32_t size, const char *tag); + void eeprom_alloc(uint32_t size); + uint32_t* get_rom_base() { return m_rom; } + uint32_t* get_eeprom_base() { return &m_eeprom[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_eeprom_size() { return m_eeprom.size(); } void save_eeprom() { device().save_item(NAME(m_eeprom)); } protected: // internal state - UINT32 *m_rom; - UINT32 m_rom_size; - UINT32 m_rom_mask; - std::vector m_eeprom; + uint32_t *m_rom; + uint32_t m_rom_size; + uint32_t m_rom_mask; + std::vector m_eeprom; }; @@ -59,7 +59,7 @@ class vboy_cart_slot_device : public device_t, { public: // construction/destruction - vboy_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vboy_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~vboy_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/vc4000/rom.cpp b/src/devices/bus/vc4000/rom.cpp index 5c8ebf5c7bb..ef5289abe0f 100644 --- a/src/devices/bus/vc4000/rom.cpp +++ b/src/devices/bus/vc4000/rom.cpp @@ -198,29 +198,29 @@ const device_type VC4000_ROM_RAM1K = &device_creator; const device_type VC4000_ROM_CHESS2 = &device_creator; -vc4000_rom_device::vc4000_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +vc4000_rom_device::vc4000_rom_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_vc4000_cart_interface( mconfig, *this ) { } -vc4000_rom_device::vc4000_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vc4000_rom_device::vc4000_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VC4000_ROM_STD, "VC 4000 Standard Carts", tag, owner, clock, "vc4000_rom", __FILE__), device_vc4000_cart_interface( mconfig, *this ) { } -vc4000_rom4k_device::vc4000_rom4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vc4000_rom4k_device::vc4000_rom4k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : vc4000_rom_device(mconfig, VC4000_ROM_ROM4K, "VC 4000 Carts w/4K ROM", tag, owner, clock, "vc4000_rom4k", __FILE__) { } -vc4000_ram1k_device::vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vc4000_ram1k_device::vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : vc4000_rom_device(mconfig, VC4000_ROM_RAM1K, "VC 4000 Carts w/1K RAM", tag, owner, clock, "vc4000_ram1k", __FILE__) { } -vc4000_chess2_device::vc4000_chess2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vc4000_chess2_device::vc4000_chess2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : vc4000_rom_device(mconfig, VC4000_ROM_CHESS2, "VC 4000 Chess II Cart", tag, owner, clock, "vc4000_chess2", __FILE__) { } diff --git a/src/devices/bus/vc4000/rom.h b/src/devices/bus/vc4000/rom.h index af7bb070271..dcd5d3b37f8 100644 --- a/src/devices/bus/vc4000/rom.h +++ b/src/devices/bus/vc4000/rom.h @@ -13,8 +13,8 @@ class vc4000_rom_device : public device_t, { public: // construction/destruction - vc4000_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - vc4000_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vc4000_rom_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); + vc4000_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -30,7 +30,7 @@ class vc4000_rom4k_device : public vc4000_rom_device { public: // construction/destruction - vc4000_rom4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vc4000_rom4k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // ======================> vc4000_ram1k_device @@ -39,7 +39,7 @@ class vc4000_ram1k_device : public vc4000_rom_device { public: // construction/destruction - vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vc4000_ram1k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_ram) override; @@ -52,7 +52,7 @@ class vc4000_chess2_device : public vc4000_rom_device { public: // construction/destruction - vc4000_chess2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vc4000_chess2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(extra_rom) override; diff --git a/src/devices/bus/vc4000/slot.cpp b/src/devices/bus/vc4000/slot.cpp index 9351a055dec..e582831151f 100644 --- a/src/devices/bus/vc4000/slot.cpp +++ b/src/devices/bus/vc4000/slot.cpp @@ -46,7 +46,7 @@ device_vc4000_cart_interface::~device_vc4000_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_vc4000_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_vc4000_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -60,7 +60,7 @@ void device_vc4000_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the ram //------------------------------------------------- -void device_vc4000_cart_interface::ram_alloc(UINT32 size) +void device_vc4000_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); } @@ -73,7 +73,7 @@ void device_vc4000_cart_interface::ram_alloc(UINT32 size) //------------------------------------------------- // vc4000_cart_slot_device - constructor //------------------------------------------------- -vc4000_cart_slot_device::vc4000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vc4000_cart_slot_device::vc4000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VC4000_CART_SLOT, "Interton VC 4000 Cartridge Slot", tag, owner, clock, "vc4000_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -115,7 +115,7 @@ void vc4000_cart_slot_device::device_config_complete() // trq h-21 slot //------------------------------------------------- -h21_cart_slot_device::h21_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h21_cart_slot_device::h21_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : vc4000_cart_slot_device(mconfig, tag, owner, clock) { } @@ -174,7 +174,7 @@ image_init_result vc4000_cart_slot_device::call_load() { if (m_cart) { - UINT32 size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); if (size > 0x1800) { @@ -229,7 +229,7 @@ std::string vc4000_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 size = m_file->size(); + uint32_t size = m_file->size(); int type = VC4000_STD; // attempt to identify the non-standard types diff --git a/src/devices/bus/vc4000/slot.h b/src/devices/bus/vc4000/slot.h index 479da188c07..e61259d08d0 100644 --- a/src/devices/bus/vc4000/slot.h +++ b/src/devices/bus/vc4000/slot.h @@ -36,20 +36,20 @@ public: virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_ram) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } void save_ram() { device().save_item(NAME(m_ram)); } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; }; @@ -61,7 +61,7 @@ class vc4000_cart_slot_device : public device_t, { public: // construction/destruction - vc4000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vc4000_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~vc4000_cart_slot_device(); // device-level overrides @@ -105,7 +105,7 @@ class h21_cart_slot_device : public vc4000_cart_slot_device { public: // construction/destruction - h21_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h21_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~h21_cart_slot_device(); virtual const char *image_interface() const override { return "h21_cart"; } diff --git a/src/devices/bus/vcs/compumat.cpp b/src/devices/bus/vcs/compumat.cpp index 4fc7d9cba5b..b5e90744688 100644 --- a/src/devices/bus/vcs/compumat.cpp +++ b/src/devices/bus/vcs/compumat.cpp @@ -16,7 +16,7 @@ const device_type A26_ROM_COMPUMATE = &device_creator; -a26_rom_cm_device::a26_rom_cm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_cm_device::a26_rom_cm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_COMPUMATE, "Atari 2600 ROM Cart Compumate", tag, owner, clock, "a2600_cm", __FILE__) { } diff --git a/src/devices/bus/vcs/compumat.h b/src/devices/bus/vcs/compumat.h index 986cab23320..6f59ead6ea0 100644 --- a/src/devices/bus/vcs/compumat.h +++ b/src/devices/bus/vcs/compumat.h @@ -15,7 +15,7 @@ class a26_rom_cm_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_cm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_cm_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/devices/bus/vcs/dpc.cpp b/src/devices/bus/vcs/dpc.cpp index fac776fabb1..476f102456c 100644 --- a/src/devices/bus/vcs/dpc.cpp +++ b/src/devices/bus/vcs/dpc.cpp @@ -17,7 +17,7 @@ const device_type ATARI_DPC = &device_creator; -dpc_device::dpc_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) : +dpc_device::dpc_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : device_t(mconfig, ATARI_DPC, "Atari DCP", tag, owner, clock, "atari_dcp", __FILE__), m_movamt(0), m_latch_62(0), @@ -65,7 +65,7 @@ void dpc_device::device_reset() } -void dpc_device::check_flag(UINT8 data_fetcher) +void dpc_device::check_flag(uint8_t data_fetcher) { /* Set flag when low counter equals top */ if (m_df[data_fetcher].low == m_df[data_fetcher].top) @@ -76,7 +76,7 @@ void dpc_device::check_flag(UINT8 data_fetcher) m_df[data_fetcher].flag = 0; } -void dpc_device::decrement_counter(UINT8 data_fetcher) +void dpc_device::decrement_counter(uint8_t data_fetcher) { m_df[data_fetcher].low -= 1; if (m_df[data_fetcher].low == 0xff) @@ -116,9 +116,9 @@ void dpc_device::device_timer(emu_timer &timer, device_timer_id id, int param, v READ8_MEMBER(dpc_device::read) { - static const UINT8 dpc_amplitude[8] = { 0x00, 0x04, 0x05, 0x09, 0x06, 0x0a, 0x0b, 0x0f }; - UINT8 data_fetcher = offset & 0x07; - UINT8 data = 0xff; + static const uint8_t dpc_amplitude[8] = { 0x00, 0x04, 0x05, 0x09, 0x06, 0x0a, 0x0b, 0x0f }; + uint8_t data_fetcher = offset & 0x07; + uint8_t data = 0xff; //logerror("%04X: Read from DPC offset $%02X\n", machine().device("maincpu")->pc(), offset); if (offset < 0x08) @@ -148,7 +148,7 @@ READ8_MEMBER(dpc_device::read) } else { - UINT8 display_data = m_displaydata[(~((m_df[data_fetcher].low | (m_df[data_fetcher].high << 8))) & 0x7ff)]; + uint8_t display_data = m_displaydata[(~((m_df[data_fetcher].low | (m_df[data_fetcher].high << 8))) & 0x7ff)]; switch (offset & 0x38) { @@ -185,7 +185,7 @@ READ8_MEMBER(dpc_device::read) WRITE8_MEMBER(dpc_device::write) { - UINT8 data_fetcher = offset & 0x07; + uint8_t data_fetcher = offset & 0x07; switch (offset & 0x38) { @@ -240,7 +240,7 @@ WRITE8_MEMBER(dpc_device::write) const device_type A26_ROM_DPC = &device_creator; -a26_rom_dpc_device::a26_rom_dpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_dpc_device::a26_rom_dpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f8_device(mconfig, A26_ROM_DPC, "Atari 2600 ROM Cart Pitfall II", tag, owner, clock, "a2600_dcp", __FILE__), m_dpc(*this, "dpc") { @@ -260,7 +260,7 @@ void a26_rom_dpc_device::device_reset() m_base_bank = 0; } -void a26_rom_dpc_device::setup_addon_ptr(UINT8 *ptr) +void a26_rom_dpc_device::setup_addon_ptr(uint8_t *ptr) { m_dpc->set_display_data(ptr); } @@ -296,7 +296,7 @@ DIRECT_UPDATE_MEMBER(a26_rom_dpc_device::cart_opbase) { if (!direct.space().debugger_access()) { - UINT8 new_bit; + uint8_t new_bit; new_bit = (m_dpc->m_shift_reg & 0x80) ^ ((m_dpc->m_shift_reg & 0x20) << 2); new_bit = new_bit ^ (((m_dpc->m_shift_reg & 0x10) << 3) ^ ((m_dpc->m_shift_reg & 0x08) << 4)); new_bit = new_bit ^ 0x80; diff --git a/src/devices/bus/vcs/dpc.h b/src/devices/bus/vcs/dpc.h index f9af63202a3..6debc39164b 100644 --- a/src/devices/bus/vcs/dpc.h +++ b/src/devices/bus/vcs/dpc.h @@ -12,13 +12,13 @@ // TO DO: DPC should be made a separate device! struct df_t { - UINT8 top; - UINT8 bottom; - UINT8 low; - UINT8 high; - UINT8 flag; - UINT8 music_mode; /* Only used by data fetchers 5,6, and 7 */ - UINT8 osc_clk; /* Only used by data fetchers 5,6, and 7 */ + uint8_t top; + uint8_t bottom; + uint8_t low; + uint8_t high; + uint8_t flag; + uint8_t music_mode; /* Only used by data fetchers 5,6, and 7 */ + uint8_t osc_clk; /* Only used by data fetchers 5,6, and 7 */ }; // m_dpc.oscillator = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(a2600_state::modeDPC_timer_callback),this)); @@ -27,16 +27,16 @@ class dpc_device : public device_t { public: // construction/destruction - dpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); df_t m_df[8]; - UINT8 m_movamt; - UINT8 m_latch_62; - UINT8 m_latch_64; - UINT8 m_dlc; - UINT8 m_shift_reg; - UINT8 *m_displaydata; - void set_display_data(UINT8 *data) { m_displaydata = data; } + uint8_t m_movamt; + uint8_t m_latch_62; + uint8_t m_latch_64; + uint8_t m_dlc; + uint8_t m_shift_reg; + uint8_t *m_displaydata; + void set_display_data(uint8_t *data) { m_displaydata = data; } virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -49,8 +49,8 @@ public: private: - void decrement_counter(UINT8 data_fetcher); - void check_flag(UINT8 data_fetcher); + void decrement_counter(uint8_t data_fetcher); + void check_flag(uint8_t data_fetcher); static const device_timer_id TIMER_OSC = 0; emu_timer *m_oscillator; @@ -68,7 +68,7 @@ class a26_rom_dpc_device : public a26_rom_f8_device { public: // construction/destruction - a26_rom_dpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_dpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -82,7 +82,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_bank) override; virtual DECLARE_DIRECT_UPDATE_MEMBER(cart_opbase) override; - virtual void setup_addon_ptr(UINT8 *ptr) override; + virtual void setup_addon_ptr(uint8_t *ptr) override; }; diff --git a/src/devices/bus/vcs/harmony_melody.cpp b/src/devices/bus/vcs/harmony_melody.cpp index af5b09e0d8a..2940bd5cf4f 100644 --- a/src/devices/bus/vcs/harmony_melody.cpp +++ b/src/devices/bus/vcs/harmony_melody.cpp @@ -66,7 +66,7 @@ map: const device_type A26_ROM_HARMONY = &device_creator; -a26_rom_harmony_device::a26_rom_harmony_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_harmony_device::a26_rom_harmony_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f8_device(mconfig, A26_ROM_HARMONY, "Atari 2600 ROM Cart HARMONY/MELODY", tag, owner, clock, "a2600_harmony", __FILE__), m_cpu(*this, "arm") { @@ -132,7 +132,7 @@ void a26_rom_harmony_device::check_bankswitch(offs_t offset) READ8_MEMBER(a26_rom_harmony_device::read_rom) { - UINT8 retvalue = read8_r(space, offset + 0xc00); // banks start at 0xc00 + uint8_t retvalue = read8_r(space, offset + 0xc00); // banks start at 0xc00 check_bankswitch(offset); diff --git a/src/devices/bus/vcs/harmony_melody.h b/src/devices/bus/vcs/harmony_melody.h index 344d929af29..7ed337c56ec 100644 --- a/src/devices/bus/vcs/harmony_melody.h +++ b/src/devices/bus/vcs/harmony_melody.h @@ -13,7 +13,7 @@ class a26_rom_harmony_device : public a26_rom_f8_device { public: // construction/destruction - a26_rom_harmony_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_harmony_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/devices/bus/vcs/rom.cpp b/src/devices/bus/vcs/rom.cpp index 2c4dcd0d3a0..65ff0715fa8 100755 --- a/src/devices/bus/vcs/rom.cpp +++ b/src/devices/bus/vcs/rom.cpp @@ -44,143 +44,143 @@ const device_type A26_ROM_32IN1 = &device_creator; const device_type A26_ROM_X07 = &device_creator; -a26_rom_2k_device::a26_rom_2k_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a26_rom_2k_device::a26_rom_2k_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_vcs_cart_interface( mconfig, *this ) { } -a26_rom_2k_device::a26_rom_2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_2k_device::a26_rom_2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, A26_ROM_2K, "Atari VCS 2600 2K ROM Carts", tag, owner, clock, "vcs_2k", __FILE__), device_vcs_cart_interface( mconfig, *this ) { } -a26_rom_4k_device::a26_rom_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_4k_device::a26_rom_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_2k_device(mconfig, A26_ROM_4K, "Atari VCS 2600 4K ROM Carts", tag, owner, clock, "vcs_4k", __FILE__) { } -a26_rom_f6_device::a26_rom_f6_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a26_rom_f6_device::a26_rom_f6_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) : a26_rom_2k_device(mconfig, type, name, tag, owner, clock, shortname, source), m_base_bank(-1) // set to -1 to help the Xin1 multicart... { } -a26_rom_f6_device::a26_rom_f6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_f6_device::a26_rom_f6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_2k_device(mconfig, A26_ROM_F6, "Atari VCS 2600 ROM Carts w/F6 bankswitch", tag, owner, clock, "vcs_f6", __FILE__), m_base_bank(-1) // set to -1 to help the Xin1 multicart... { } -a26_rom_f4_device::a26_rom_f4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_f4_device::a26_rom_f4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_F4, "Atari VCS 2600 ROM Carts w/F4 bankswitch", tag, owner, clock, "vcs_f4", __FILE__) { } -a26_rom_f8_device::a26_rom_f8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +a26_rom_f8_device::a26_rom_f8_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) : a26_rom_f6_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -a26_rom_f8_device::a26_rom_f8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_f8_device::a26_rom_f8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_F8, "Atari VCS 2600 ROM Carts w/F8 bankswitch", tag, owner, clock, "vcs_f8", __FILE__) { } -a26_rom_f8_sw_device::a26_rom_f8_sw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_f8_sw_device::a26_rom_f8_sw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f8_device(mconfig, A26_ROM_F8_SW, "Atari VCS 2600 ROM Cart Snow White", tag, owner, clock, "vcs_f8_sw", __FILE__) { } -a26_rom_fa_device::a26_rom_fa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_fa_device::a26_rom_fa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_FA, "Atari VCS 2600 ROM Carts w/FA bankswitch", tag, owner, clock, "vcs_fa", __FILE__) { } -a26_rom_fe_device::a26_rom_fe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_fe_device::a26_rom_fe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_2k_device(mconfig, A26_ROM_FE, "Atari VCS 2600 ROM Carts w/FE bankswitch", tag, owner, clock, "vcs_fe", __FILE__), m_base_bank(0), m_trigger_on_next_access(0) { } -a26_rom_3e_device::a26_rom_3e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_3e_device::a26_rom_3e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_3E, "Atari VCS 2600 ROM Carts w/3E bankswitch", tag, owner, clock, "vcs_3e", __FILE__), m_num_bank(0), m_ram_bank(0), m_ram_enable(0) { } -a26_rom_3f_device::a26_rom_3f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_3f_device::a26_rom_3f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_3F, "Atari VCS 2600 ROM Carts w/3F bankswitch", tag, owner, clock, "vcs_3f", __FILE__), m_num_bank(0) { } -a26_rom_e0_device::a26_rom_e0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_e0_device::a26_rom_e0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_E0, "Atari VCS 2600 ROM Carts w/E0 bankswitch", tag, owner, clock, "vcs_e0", __FILE__) { } -a26_rom_e7_device::a26_rom_e7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_e7_device::a26_rom_e7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_E7, "Atari VCS 2600 ROM Carts w/E7 bankswitch", tag, owner, clock, "vcs_e7", __FILE__), m_ram_bank(0) { } -a26_rom_ua_device::a26_rom_ua_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_ua_device::a26_rom_ua_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_UA, "Atari VCS 2600 ROM Carts w/UA bankswitch", tag, owner, clock, "vcs_ua", __FILE__) { } -a26_rom_cv_device::a26_rom_cv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_cv_device::a26_rom_cv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_2k_device(mconfig, A26_ROM_CV, "Atari VCS 2600 ROM Carts w/Commavid bankswitch", tag, owner, clock, "vcs_cv", __FILE__) { } -a26_rom_dc_device::a26_rom_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_dc_device::a26_rom_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_DC, "Atari VCS 2600 ROM Carts w/Dynacom bankswitch", tag, owner, clock, "vcs_dc", __FILE__) { } -a26_rom_fv_device::a26_rom_fv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_fv_device::a26_rom_fv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_FV, "Atari VCS 2600 ROM Carts w/FV bankswitch", tag, owner, clock, "vcs_fv", __FILE__), m_locked(0) { } -a26_rom_jvp_device::a26_rom_jvp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_jvp_device::a26_rom_jvp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_JVP, "Atari VCS 2600 ROM Carts w/JVP bankswitch", tag, owner, clock, "vcs_jvp", __FILE__) { } -a26_rom_4in1_device::a26_rom_4in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_4in1_device::a26_rom_4in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_4IN1, "Atari VCS 2600 ROM Cart 4 in 1", tag, owner, clock, "vcs_4in1", __FILE__) { } -a26_rom_8in1_device::a26_rom_8in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_8in1_device::a26_rom_8in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f8_device(mconfig, A26_ROM_8IN1, "Atari VCS 2600 ROM Cart 8 in 1", tag, owner, clock, "vcs_8in1", __FILE__), m_reset_bank(0) { } -a26_rom_32in1_device::a26_rom_32in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_32in1_device::a26_rom_32in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_32IN1, "Atari VCS 2600 ROM Cart 32 in 1", tag, owner, clock, "vcs_32in1", __FILE__) { } -a26_rom_x07_device::a26_rom_x07_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_x07_device::a26_rom_x07_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_X07, "Atari VCS 2600 ROM Carts w/X07 bankswitch", tag, owner, clock, "vcs_x07", __FILE__) { } @@ -608,7 +608,7 @@ WRITE8_MEMBER(a26_rom_fa_device::write_bank) READ8_MEMBER(a26_rom_fe_device::read_rom) { - UINT8 data; + uint8_t data; // Super Chip RAM reads are mapped in 0x1080-0x10ff if (!m_ram.empty() && offset >= 0x80 && offset < 0x100) @@ -641,7 +641,7 @@ WRITE8_MEMBER(a26_rom_fe_device::write_ram) READ8_MEMBER(a26_rom_fe_device::read_bank) { - UINT8 data = space.read_byte(0xfe + offset); + uint8_t data = space.read_byte(0xfe + offset); if (!space.debugger_access()) { diff --git a/src/devices/bus/vcs/rom.h b/src/devices/bus/vcs/rom.h index a6c37465c07..cfccbd3e80a 100755 --- a/src/devices/bus/vcs/rom.h +++ b/src/devices/bus/vcs/rom.h @@ -13,8 +13,8 @@ class a26_rom_2k_device : public device_t, { public: // construction/destruction - a26_rom_2k_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a26_rom_2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_2k_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); + a26_rom_2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -31,7 +31,7 @@ class a26_rom_4k_device : public a26_rom_2k_device { public: // construction/destruction - a26_rom_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_4k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing @@ -46,8 +46,8 @@ class a26_rom_f6_device : public a26_rom_2k_device { public: // construction/destruction - a26_rom_f6_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a26_rom_f6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_f6_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); + a26_rom_f6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -69,7 +69,7 @@ class a26_rom_f4_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_f4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_f4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_reset() override; @@ -86,8 +86,8 @@ class a26_rom_f8_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_f8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - a26_rom_f8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_f8_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); + a26_rom_f8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; @@ -101,7 +101,7 @@ class a26_rom_f8_sw_device : public a26_rom_f8_device { public: // construction/destruction - a26_rom_f8_sw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_f8_sw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_reset() override; @@ -114,7 +114,7 @@ class a26_rom_fa_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_fa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_fa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; @@ -128,7 +128,7 @@ class a26_rom_fe_device : public a26_rom_2k_device { public: // construction/destruction - a26_rom_fe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_fe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -152,7 +152,7 @@ class a26_rom_3e_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_3e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_3e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -176,7 +176,7 @@ class a26_rom_3f_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_3f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_3f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_reset() override; @@ -196,7 +196,7 @@ class a26_rom_e0_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_e0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_e0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -217,7 +217,7 @@ class a26_rom_e7_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_e7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_e7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -238,7 +238,7 @@ class a26_rom_ua_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_ua_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_ua_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_reset() override; @@ -256,7 +256,7 @@ class a26_rom_cv_device : public a26_rom_2k_device { public: // construction/destruction - a26_rom_cv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_cv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; @@ -270,7 +270,7 @@ class a26_rom_dc_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_dc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; @@ -284,7 +284,7 @@ class a26_rom_fv_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_fv_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_fv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -305,7 +305,7 @@ class a26_rom_jvp_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_jvp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_jvp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; @@ -319,7 +319,7 @@ class a26_rom_4in1_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_4in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_4in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_reset() override; @@ -335,7 +335,7 @@ class a26_rom_8in1_device : public a26_rom_f8_device { public: // construction/destruction - a26_rom_8in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_8in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -355,7 +355,7 @@ class a26_rom_32in1_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_32in1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_32in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_reset() override; @@ -371,7 +371,7 @@ class a26_rom_x07_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_x07_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_x07_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_READ8_MEMBER(read_rom) override; diff --git a/src/devices/bus/vcs/scharger.cpp b/src/devices/bus/vcs/scharger.cpp index aeebde0f4c6..49c27b2f311 100644 --- a/src/devices/bus/vcs/scharger.cpp +++ b/src/devices/bus/vcs/scharger.cpp @@ -40,7 +40,7 @@ const device_type A26_ROM_SUPERCHARGER = &device_creator; -a26_rom_ss_device::a26_rom_ss_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +a26_rom_ss_device::a26_rom_ss_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : a26_rom_f6_device(mconfig, A26_ROM_SUPERCHARGER, "Atari 2600 ROM Cart Supercharger", tag, owner, clock, "a2600_ss", __FILE__), m_cassette(*this, "cassette"), m_maincpu(nullptr), @@ -102,7 +102,7 @@ machine_config_constructor a26_rom_ss_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( a26_ss ); } -inline UINT8 a26_rom_ss_device::read_byte(UINT32 offset) +inline uint8_t a26_rom_ss_device::read_byte(uint32_t offset) { if (offset < 0x800) return m_ram[(offset & 0x7ff) + (m_base_banks[0] * 0x800)]; diff --git a/src/devices/bus/vcs/scharger.h b/src/devices/bus/vcs/scharger.h index 141a08e00e7..d4c8b2d10bc 100644 --- a/src/devices/bus/vcs/scharger.h +++ b/src/devices/bus/vcs/scharger.h @@ -16,7 +16,7 @@ class a26_rom_ss_device : public a26_rom_f6_device { public: // construction/destruction - a26_rom_ss_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + a26_rom_ss_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -30,14 +30,14 @@ public: private: cpu_device *m_maincpu; - inline UINT8 read_byte(UINT32 offset); + inline uint8_t read_byte(uint32_t offset); int m_base_banks[2]; - UINT8 m_reg; - UINT8 m_write_delay, m_ram_write_enabled, m_rom_enabled; - UINT32 m_byte_started; - UINT16 m_last_address; - UINT32 m_diff_adjust; + uint8_t m_reg; + uint8_t m_write_delay, m_ram_write_enabled, m_rom_enabled; + uint32_t m_byte_started; + uint16_t m_last_address; + uint32_t m_diff_adjust; }; diff --git a/src/devices/bus/vcs/vcs_slot.cpp b/src/devices/bus/vcs/vcs_slot.cpp index e9b0a93900b..8ae6783e2dd 100644 --- a/src/devices/bus/vcs/vcs_slot.cpp +++ b/src/devices/bus/vcs/vcs_slot.cpp @@ -49,7 +49,7 @@ device_vcs_cart_interface::~device_vcs_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_vcs_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_vcs_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -62,7 +62,7 @@ void device_vcs_cart_interface::rom_alloc(UINT32 size, const char *tag) // ram_alloc - alloc the space for the on-cart RAM //------------------------------------------------- -void device_vcs_cart_interface::ram_alloc(UINT32 size) +void device_vcs_cart_interface::ram_alloc(uint32_t size) { m_ram.resize(size); device().save_item(NAME(m_ram)); @@ -77,7 +77,7 @@ void device_vcs_cart_interface::ram_alloc(UINT32 size) //------------------------------------------------- // vcs_cart_slot_device - constructor //------------------------------------------------- -vcs_cart_slot_device::vcs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vcs_cart_slot_device::vcs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VCS_CART_SLOT, "Atari VCS 2600 Cartridge Slot", tag, owner, clock, "vcs_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), m_cart(nullptr), m_type(0) @@ -186,8 +186,8 @@ image_init_result vcs_cart_slot_device::call_load() { if (m_cart) { - UINT8 *ROM; - UINT32 len; + uint8_t *ROM; + uint32_t len; if (software_entry() != nullptr) len = get_software_region_length("rom"); @@ -308,7 +308,7 @@ image_init_result vcs_cart_slot_device::call_load() // pass a pointer to the now allocated ROM for the DPC chip if (m_type == A26_DPC) - m_cart->setup_addon_ptr((UINT8 *)m_cart->get_rom_base() + 0x2000); + m_cart->setup_addon_ptr((uint8_t *)m_cart->get_rom_base() + 0x2000); return image_init_result::PASS; } @@ -331,7 +331,7 @@ void vcs_cart_slot_device::call_unload() detection helper routines -------------------------------------------------*/ -int vcs_cart_slot_device::detect_modeDC(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeDC(uint8_t *cart, uint32_t len) { int numfound = 0; // signature is also in 'video reflex'.. maybe figure out that controller port someday... @@ -352,7 +352,7 @@ int vcs_cart_slot_device::detect_modeDC(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_modeF6(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeF6(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signature[3] = { 0x8d, 0xf6, 0xff }; @@ -372,7 +372,7 @@ int vcs_cart_slot_device::detect_modeF6(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_snowhite(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_snowhite(uint8_t *cart, uint32_t len) { static const unsigned char snowwhite[] = { 0x10, 0xd0, 0xff, 0xff }; // Snow White Proto @@ -381,7 +381,7 @@ int vcs_cart_slot_device::detect_snowhite(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_mode3E(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_mode3E(uint8_t *cart, uint32_t len) { // this one is a little hacky... looks for STY $3e, which is unique to // 'not boulderdash', but is the only example I have (cow) @@ -404,7 +404,7 @@ int vcs_cart_slot_device::detect_mode3E(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_modeSS(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeSS(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signature[5] = { 0xbd, 0xe5, 0xff, 0x95, 0x81 }; @@ -424,7 +424,7 @@ int vcs_cart_slot_device::detect_modeSS(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_modeFE(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeFE(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signatures[][5] = { @@ -452,7 +452,7 @@ int vcs_cart_slot_device::detect_modeFE(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_modeE0(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeE0(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signatures[][3] = { @@ -482,7 +482,7 @@ int vcs_cart_slot_device::detect_modeE0(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_modeCV(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeCV(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signatures[][3] = { @@ -508,7 +508,7 @@ int vcs_cart_slot_device::detect_modeCV(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_modeFV(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeFV(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signatures[][3] = { { 0x2c, 0xd0, 0xff } }; @@ -531,7 +531,7 @@ int vcs_cart_slot_device::detect_modeFV(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_modeJVP(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeJVP(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signatures[][4] = { @@ -557,7 +557,7 @@ int vcs_cart_slot_device::detect_modeJVP(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_modeE7(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeE7(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signatures[][3] = { @@ -583,7 +583,7 @@ int vcs_cart_slot_device::detect_modeE7(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_modeUA(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_modeUA(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signature[3] = { 0x8d, 0x40, 0x02 }; @@ -603,7 +603,7 @@ int vcs_cart_slot_device::detect_modeUA(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_8K_mode3F(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_8K_mode3F(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signature1[4] = { 0xa9, 0x01, 0x85, 0x3f }; @@ -629,7 +629,7 @@ int vcs_cart_slot_device::detect_8K_mode3F(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_32K_mode3F(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_32K_mode3F(uint8_t *cart, uint32_t len) { int numfound = 0; static const unsigned char signature[4] = { 0xa9, 0x0e, 0x85, 0x3f }; @@ -649,7 +649,7 @@ int vcs_cart_slot_device::detect_32K_mode3F(UINT8 *cart, UINT32 len) return 0; } -int vcs_cart_slot_device::detect_super_chip(UINT8 *cart, UINT32 len) +int vcs_cart_slot_device::detect_super_chip(uint8_t *cart, uint32_t len) { static const unsigned char signatures[][5] = { { 0xa2, 0x7f, 0x9d, 0x00, 0xf0 }, // dig dug @@ -691,7 +691,7 @@ int vcs_cart_slot_device::detect_super_chip(UINT8 *cart, UINT32 len) -------------------------------------------------*/ // 4in1 & 8in1 are not currently detected from fullpath... -int vcs_cart_slot_device::identify_cart_type(UINT8 *ROM, UINT32 len) +int vcs_cart_slot_device::identify_cart_type(uint8_t *ROM, uint32_t len) { int type = 0xff; @@ -775,8 +775,8 @@ std::string vcs_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 len = m_file->size(); - std::vector rom(len); + uint32_t len = m_file->size(); + std::vector rom(len); int type; m_file->read(&rom[0], len); diff --git a/src/devices/bus/vcs/vcs_slot.h b/src/devices/bus/vcs/vcs_slot.h index da08b7db743..65024d33e26 100755 --- a/src/devices/bus/vcs/vcs_slot.h +++ b/src/devices/bus/vcs/vcs_slot.h @@ -63,20 +63,20 @@ public: // direct update handler virtual DECLARE_DIRECT_UPDATE_MEMBER(cart_opbase) { return address; } - virtual void setup_addon_ptr(UINT8 *ptr) {} + virtual void setup_addon_ptr(uint8_t *ptr) {} - void rom_alloc(UINT32 size, const char *tag); - void ram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_ram_base() { return &m_ram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_ram_size() { return m_ram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void ram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_ram_base() { return &m_ram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_ram_size() { return m_ram.size(); } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_ram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_ram; }; @@ -88,7 +88,7 @@ class vcs_cart_slot_device : public device_t, { public: // construction/destruction - vcs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vcs_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~vcs_cart_slot_device(); // device-level overrides @@ -101,7 +101,7 @@ public: virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); } int get_cart_type() { return m_type; }; - int identify_cart_type(UINT8 *ROM, UINT32 len); + int identify_cart_type(uint8_t *ROM, uint32_t len); virtual iodevice_t image_type() const override { return IO_CARTSLOT; } virtual bool is_readable() const override { return 1; } @@ -126,21 +126,21 @@ private: device_vcs_cart_interface* m_cart; int m_type; - int detect_snowhite(UINT8 *cart, UINT32 len); - int detect_modeDC(UINT8 *cart, UINT32 len); - int detect_modeF6(UINT8 *cart, UINT32 len); - int detect_mode3E(UINT8 *cart, UINT32 len); - int detect_modeSS(UINT8 *cart, UINT32 len); - int detect_modeFE(UINT8 *cart, UINT32 len); - int detect_modeE0(UINT8 *cart, UINT32 len); - int detect_modeCV(UINT8 *cart, UINT32 len); - int detect_modeFV(UINT8 *cart, UINT32 len); - int detect_modeJVP(UINT8 *cart, UINT32 len); - int detect_modeE7(UINT8 *cart, UINT32 len); - int detect_modeUA(UINT8 *cart, UINT32 len); - int detect_8K_mode3F(UINT8 *cart, UINT32 len); - int detect_32K_mode3F(UINT8 *cart, UINT32 len); - int detect_super_chip(UINT8 *cart, UINT32 len); + int detect_snowhite(uint8_t *cart, uint32_t len); + int detect_modeDC(uint8_t *cart, uint32_t len); + int detect_modeF6(uint8_t *cart, uint32_t len); + int detect_mode3E(uint8_t *cart, uint32_t len); + int detect_modeSS(uint8_t *cart, uint32_t len); + int detect_modeFE(uint8_t *cart, uint32_t len); + int detect_modeE0(uint8_t *cart, uint32_t len); + int detect_modeCV(uint8_t *cart, uint32_t len); + int detect_modeFV(uint8_t *cart, uint32_t len); + int detect_modeJVP(uint8_t *cart, uint32_t len); + int detect_modeE7(uint8_t *cart, uint32_t len); + int detect_modeUA(uint8_t *cart, uint32_t len); + int detect_8K_mode3F(uint8_t *cart, uint32_t len); + int detect_32K_mode3F(uint8_t *cart, uint32_t len); + int detect_super_chip(uint8_t *cart, uint32_t len); }; diff --git a/src/devices/bus/vcs_ctrl/ctrl.cpp b/src/devices/bus/vcs_ctrl/ctrl.cpp index a74c5ae1b84..dbcbefb0aeb 100644 --- a/src/devices/bus/vcs_ctrl/ctrl.cpp +++ b/src/devices/bus/vcs_ctrl/ctrl.cpp @@ -42,7 +42,7 @@ device_vcs_control_port_interface::device_vcs_control_port_interface(const machi // vcs_control_port_device - constructor //------------------------------------------------- -vcs_control_port_device::vcs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vcs_control_port_device::vcs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VCS_CONTROL_PORT, "Atari VCS control port", tag, owner, clock, "vcs_control_port", __FILE__), device_slot_interface(mconfig, *this), m_device(nullptr), m_write_trigger(*this) diff --git a/src/devices/bus/vcs_ctrl/ctrl.h b/src/devices/bus/vcs_ctrl/ctrl.h index 41f7c12e75a..46c39d2ae85 100644 --- a/src/devices/bus/vcs_ctrl/ctrl.h +++ b/src/devices/bus/vcs_ctrl/ctrl.h @@ -48,10 +48,10 @@ public: device_vcs_control_port_interface(const machine_config &mconfig, device_t &device); virtual ~device_vcs_control_port_interface() { } - virtual UINT8 vcs_joy_r() { return 0xff; }; - virtual UINT8 vcs_pot_x_r() { return 0xff; }; - virtual UINT8 vcs_pot_y_r() { return 0xff; }; - virtual void vcs_joy_w(UINT8 data) { }; + virtual uint8_t vcs_joy_r() { return 0xff; }; + virtual uint8_t vcs_pot_x_r() { return 0xff; }; + virtual uint8_t vcs_pot_y_r() { return 0xff; }; + virtual void vcs_joy_w(uint8_t data) { }; virtual bool has_pot_x() { return false; } virtual bool has_pot_y() { return false; } @@ -68,7 +68,7 @@ class vcs_control_port_device : public device_t, { public: // construction/destruction - vcs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vcs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~vcs_control_port_device() { } // static configuration helpers @@ -87,14 +87,14 @@ public: // pin 8 - GND // bit 6 - pin 9 - // - UINT8 joy_r() { UINT8 data = 0xff; if (exists()) data = m_device->vcs_joy_r(); return data; } + uint8_t joy_r() { uint8_t data = 0xff; if (exists()) data = m_device->vcs_joy_r(); return data; } DECLARE_READ8_MEMBER( joy_r ) { return joy_r(); } - UINT8 pot_x_r() { UINT8 data = 0xff; if (exists()) data = m_device->vcs_pot_x_r(); return data; } + uint8_t pot_x_r() { uint8_t data = 0xff; if (exists()) data = m_device->vcs_pot_x_r(); return data; } DECLARE_READ8_MEMBER( pot_x_r ) { return pot_x_r(); } - UINT8 pot_y_r() { UINT8 data = 0xff; if (exists()) data = m_device->vcs_pot_y_r(); return data; } + uint8_t pot_y_r() { uint8_t data = 0xff; if (exists()) data = m_device->vcs_pot_y_r(); return data; } DECLARE_READ8_MEMBER( pot_y_r ) { return pot_y_r(); } - void joy_w( UINT8 data ) { if ( exists() ) m_device->vcs_joy_w( data ); } + void joy_w( uint8_t data ) { if ( exists() ) m_device->vcs_joy_w( data ); } bool exists() { return m_device != nullptr; } bool has_pot_x() { return exists() && m_device->has_pot_x(); } diff --git a/src/devices/bus/vcs_ctrl/joybooster.cpp b/src/devices/bus/vcs_ctrl/joybooster.cpp index e1fbfec7c90..af73a326e0f 100644 --- a/src/devices/bus/vcs_ctrl/joybooster.cpp +++ b/src/devices/bus/vcs_ctrl/joybooster.cpp @@ -56,7 +56,7 @@ ioport_constructor vcs_joystick_booster_device::device_input_ports() const // vcs_joystick_booster_device - constructor //------------------------------------------------- -vcs_joystick_booster_device::vcs_joystick_booster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vcs_joystick_booster_device::vcs_joystick_booster_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VCS_JOYSTICK_BOOSTER, "Atari / CBM Digital joystick with Boostergrip", tag, owner, clock, "vcs_joystick_booster", __FILE__), device_vcs_control_port_interface(mconfig, *this), m_joy(*this, "JOY"), @@ -79,17 +79,17 @@ void vcs_joystick_booster_device::device_start() // vcs_joy_r - joystick read //------------------------------------------------- -UINT8 vcs_joystick_booster_device::vcs_joy_r() +uint8_t vcs_joystick_booster_device::vcs_joy_r() { return m_joy->read(); } -UINT8 vcs_joystick_booster_device::vcs_pot_x_r() +uint8_t vcs_joystick_booster_device::vcs_pot_x_r() { return m_potx->read(); } -UINT8 vcs_joystick_booster_device::vcs_pot_y_r() +uint8_t vcs_joystick_booster_device::vcs_pot_y_r() { return m_poty->read(); } diff --git a/src/devices/bus/vcs_ctrl/joybooster.h b/src/devices/bus/vcs_ctrl/joybooster.h index d04be025ab9..55455dcf92e 100644 --- a/src/devices/bus/vcs_ctrl/joybooster.h +++ b/src/devices/bus/vcs_ctrl/joybooster.h @@ -28,7 +28,7 @@ class vcs_joystick_booster_device : public device_t, { public: // construction/destruction - vcs_joystick_booster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vcs_joystick_booster_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -38,9 +38,9 @@ protected: virtual void device_start() override; // device_vcs_control_port_interface overrides - virtual UINT8 vcs_joy_r() override; - virtual UINT8 vcs_pot_x_r() override; - virtual UINT8 vcs_pot_y_r() override; + virtual uint8_t vcs_joy_r() override; + virtual uint8_t vcs_pot_x_r() override; + virtual uint8_t vcs_pot_y_r() override; virtual bool has_pot_x() override { return true; } virtual bool has_pot_y() override { return true; } diff --git a/src/devices/bus/vcs_ctrl/joystick.cpp b/src/devices/bus/vcs_ctrl/joystick.cpp index f1539eabeef..789d679a56c 100644 --- a/src/devices/bus/vcs_ctrl/joystick.cpp +++ b/src/devices/bus/vcs_ctrl/joystick.cpp @@ -47,7 +47,7 @@ ioport_constructor vcs_joystick_device::device_input_ports() const // vcs_joystick_device - constructor //------------------------------------------------- -vcs_joystick_device::vcs_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vcs_joystick_device::vcs_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VCS_JOYSTICK, "Atari / CBM Digital joystick", tag, owner, clock, "vcs_joystick", __FILE__), device_vcs_control_port_interface(mconfig, *this), m_joy(*this, "JOY") @@ -68,7 +68,7 @@ void vcs_joystick_device::device_start() // vcs_joy_r - joystick read //------------------------------------------------- -UINT8 vcs_joystick_device::vcs_joy_r() +uint8_t vcs_joystick_device::vcs_joy_r() { return m_joy->read(); } diff --git a/src/devices/bus/vcs_ctrl/joystick.h b/src/devices/bus/vcs_ctrl/joystick.h index d43f6912dff..80dfeafb0f5 100644 --- a/src/devices/bus/vcs_ctrl/joystick.h +++ b/src/devices/bus/vcs_ctrl/joystick.h @@ -27,7 +27,7 @@ class vcs_joystick_device : public device_t, { public: // construction/destruction - vcs_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vcs_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,7 +37,7 @@ protected: virtual void device_start() override; // device_vcs_control_port_interface overrides - virtual UINT8 vcs_joy_r() override; + virtual uint8_t vcs_joy_r() override; private: required_ioport m_joy; diff --git a/src/devices/bus/vcs_ctrl/keypad.cpp b/src/devices/bus/vcs_ctrl/keypad.cpp index b1a1f2079d6..9d16b5a8f2d 100644 --- a/src/devices/bus/vcs_ctrl/keypad.cpp +++ b/src/devices/bus/vcs_ctrl/keypad.cpp @@ -53,7 +53,7 @@ ioport_constructor vcs_keypad_device::device_input_ports() const // vcs_keypad_device - constructor //------------------------------------------------- -vcs_keypad_device::vcs_keypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vcs_keypad_device::vcs_keypad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VCS_KEYPAD, "Atari / CBM Keypad", tag, owner, clock, "vcs_keypad", __FILE__), device_vcs_control_port_interface(mconfig, *this), m_keypad(*this, "KEYPAD"), m_column(0) @@ -76,7 +76,7 @@ void vcs_keypad_device::device_start() // vcs_joy_w - joystick write //------------------------------------------------- -UINT8 vcs_keypad_device::vcs_joy_r() +uint8_t vcs_keypad_device::vcs_joy_r() { for ( int i = 0; i < 4; i++ ) { @@ -95,12 +95,12 @@ UINT8 vcs_keypad_device::vcs_joy_r() return 0xff; } -void vcs_keypad_device::vcs_joy_w( UINT8 data ) +void vcs_keypad_device::vcs_joy_w( uint8_t data ) { m_column = data & 0x0F; } -UINT8 vcs_keypad_device::vcs_pot_x_r() +uint8_t vcs_keypad_device::vcs_pot_x_r() { for ( int i = 0; i < 4; i++ ) { @@ -119,7 +119,7 @@ UINT8 vcs_keypad_device::vcs_pot_x_r() return 0; } -UINT8 vcs_keypad_device::vcs_pot_y_r() +uint8_t vcs_keypad_device::vcs_pot_y_r() { for ( int i = 0; i < 4; i++ ) { diff --git a/src/devices/bus/vcs_ctrl/keypad.h b/src/devices/bus/vcs_ctrl/keypad.h index ffa4c1fed63..272ca6fa626 100644 --- a/src/devices/bus/vcs_ctrl/keypad.h +++ b/src/devices/bus/vcs_ctrl/keypad.h @@ -27,7 +27,7 @@ class vcs_keypad_device : public device_t, { public: // construction/destruction - vcs_keypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vcs_keypad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,10 +37,10 @@ protected: virtual void device_start() override; // device_vcs_control_port_interface overrides - virtual UINT8 vcs_joy_r() override; - virtual void vcs_joy_w( UINT8 data ) override; - virtual UINT8 vcs_pot_x_r() override; - virtual UINT8 vcs_pot_y_r() override; + virtual uint8_t vcs_joy_r() override; + virtual void vcs_joy_w( uint8_t data ) override; + virtual uint8_t vcs_pot_x_r() override; + virtual uint8_t vcs_pot_y_r() override; virtual bool has_pot_x() override { return true; } virtual bool has_pot_y() override { return true; } @@ -48,7 +48,7 @@ protected: private: required_ioport m_keypad; - UINT8 m_column; + uint8_t m_column; }; diff --git a/src/devices/bus/vcs_ctrl/lightpen.cpp b/src/devices/bus/vcs_ctrl/lightpen.cpp index 446e57cd6a0..2a1ca665412 100644 --- a/src/devices/bus/vcs_ctrl/lightpen.cpp +++ b/src/devices/bus/vcs_ctrl/lightpen.cpp @@ -56,7 +56,7 @@ ioport_constructor vcs_lightpen_device::device_input_ports() const // vcs_lightpen_device - constructor //------------------------------------------------- -vcs_lightpen_device::vcs_lightpen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vcs_lightpen_device::vcs_lightpen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VCS_LIGHTPEN, "Atari / CBM Light Pen", tag, owner, clock, "vcs_lightpen", __FILE__), device_vcs_control_port_interface(mconfig, *this), m_joy(*this, "JOY"), @@ -79,7 +79,7 @@ void vcs_lightpen_device::device_start() // vcs_joy_r - lightpen read //------------------------------------------------- -UINT8 vcs_lightpen_device::vcs_joy_r() +uint8_t vcs_lightpen_device::vcs_joy_r() { return m_joy->read(); } diff --git a/src/devices/bus/vcs_ctrl/lightpen.h b/src/devices/bus/vcs_ctrl/lightpen.h index 0aed6ac85a4..cc6bfe454ab 100644 --- a/src/devices/bus/vcs_ctrl/lightpen.h +++ b/src/devices/bus/vcs_ctrl/lightpen.h @@ -27,7 +27,7 @@ class vcs_lightpen_device : public device_t, { public: // construction/destruction - vcs_lightpen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vcs_lightpen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -39,7 +39,7 @@ protected: virtual void device_start() override; // device_vcs_control_port_interface overrides - virtual UINT8 vcs_joy_r() override; + virtual uint8_t vcs_joy_r() override; private: required_ioport m_joy; diff --git a/src/devices/bus/vcs_ctrl/paddles.cpp b/src/devices/bus/vcs_ctrl/paddles.cpp index b8a4f4a6de5..0329853b0c8 100644 --- a/src/devices/bus/vcs_ctrl/paddles.cpp +++ b/src/devices/bus/vcs_ctrl/paddles.cpp @@ -50,7 +50,7 @@ ioport_constructor vcs_paddles_device::device_input_ports() const // vcs_paddles_device - constructor //------------------------------------------------- -vcs_paddles_device::vcs_paddles_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vcs_paddles_device::vcs_paddles_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VCS_PADDLES, "Atari / CBM Digital paddles", tag, owner, clock, "vcs_paddles", __FILE__), device_vcs_control_port_interface(mconfig, *this), m_joy(*this, "JOY"), @@ -73,7 +73,7 @@ void vcs_paddles_device::device_start() // vcs_joy_r - joystick read //------------------------------------------------- -UINT8 vcs_paddles_device::vcs_joy_r() +uint8_t vcs_paddles_device::vcs_joy_r() { return m_joy->read(); } @@ -83,7 +83,7 @@ UINT8 vcs_paddles_device::vcs_joy_r() // vcs_pot_x_r - potentiometer X read //------------------------------------------------- -UINT8 vcs_paddles_device::vcs_pot_x_r() +uint8_t vcs_paddles_device::vcs_pot_x_r() { return m_potx->read(); } @@ -93,7 +93,7 @@ UINT8 vcs_paddles_device::vcs_pot_x_r() // vcs_pot_y_r - potentiometer Y read //------------------------------------------------- -UINT8 vcs_paddles_device::vcs_pot_y_r() +uint8_t vcs_paddles_device::vcs_pot_y_r() { return m_poty->read(); } diff --git a/src/devices/bus/vcs_ctrl/paddles.h b/src/devices/bus/vcs_ctrl/paddles.h index 65ffd394fef..44c3f066a8e 100644 --- a/src/devices/bus/vcs_ctrl/paddles.h +++ b/src/devices/bus/vcs_ctrl/paddles.h @@ -27,7 +27,7 @@ class vcs_paddles_device : public device_t, { public: // construction/destruction - vcs_paddles_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vcs_paddles_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,9 +37,9 @@ protected: virtual void device_start() override; // device_vcs_control_port_interface overrides - virtual UINT8 vcs_joy_r() override; - virtual UINT8 vcs_pot_x_r() override; - virtual UINT8 vcs_pot_y_r() override; + virtual uint8_t vcs_joy_r() override; + virtual uint8_t vcs_pot_x_r() override; + virtual uint8_t vcs_pot_y_r() override; virtual bool has_pot_x() override { return true; } virtual bool has_pot_y() override { return true; } diff --git a/src/devices/bus/vcs_ctrl/wheel.cpp b/src/devices/bus/vcs_ctrl/wheel.cpp index 9d1f3009596..e9374c65ece 100644 --- a/src/devices/bus/vcs_ctrl/wheel.cpp +++ b/src/devices/bus/vcs_ctrl/wheel.cpp @@ -46,7 +46,7 @@ ioport_constructor vcs_wheel_device::device_input_ports() const // vcs_wheel_device - constructor //------------------------------------------------- -vcs_wheel_device::vcs_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vcs_wheel_device::vcs_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VCS_WHEEL, "Atari / CBM Driving Wheel", tag, owner, clock, "vcs_wheel", __FILE__), device_vcs_control_port_interface(mconfig, *this), m_joy(*this, "JOY"), @@ -68,9 +68,9 @@ void vcs_wheel_device::device_start() // vcs_joy_r - joystick read //------------------------------------------------- -UINT8 vcs_wheel_device::vcs_joy_r() +uint8_t vcs_wheel_device::vcs_joy_r() { - static const UINT8 driving_lookup[4] = { 0x00, 0x02, 0x03, 0x01 }; + static const uint8_t driving_lookup[4] = { 0x00, 0x02, 0x03, 0x01 }; return m_joy->read() | driving_lookup[ ( m_wheel->read() & 0x18 ) >> 3 ]; } diff --git a/src/devices/bus/vcs_ctrl/wheel.h b/src/devices/bus/vcs_ctrl/wheel.h index 9cb8818144e..126ba65ebd9 100644 --- a/src/devices/bus/vcs_ctrl/wheel.h +++ b/src/devices/bus/vcs_ctrl/wheel.h @@ -27,7 +27,7 @@ class vcs_wheel_device : public device_t, { public: // construction/destruction - vcs_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vcs_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,7 +37,7 @@ protected: virtual void device_start() override; // device_vcs_control_port_interface overrides - virtual UINT8 vcs_joy_r() override; + virtual uint8_t vcs_joy_r() override; private: required_ioport m_joy; diff --git a/src/devices/bus/vectrex/rom.cpp b/src/devices/bus/vectrex/rom.cpp index d8f2993a3be..44c4cd23c40 100644 --- a/src/devices/bus/vectrex/rom.cpp +++ b/src/devices/bus/vectrex/rom.cpp @@ -25,24 +25,24 @@ const device_type VECTREX_ROM_64K = &device_creator; const device_type VECTREX_ROM_SRAM = &device_creator; -vectrex_rom_device::vectrex_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +vectrex_rom_device::vectrex_rom_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_vectrex_cart_interface(mconfig, *this) { } -vectrex_rom_device::vectrex_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vectrex_rom_device::vectrex_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VECTREX_ROM_STD, "Vectrex Standard Carts", tag, owner, clock, "vectrex_rom", __FILE__), device_vectrex_cart_interface(mconfig, *this) { } -vectrex_rom64k_device::vectrex_rom64k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vectrex_rom64k_device::vectrex_rom64k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : vectrex_rom_device(mconfig, VECTREX_ROM_64K, "Vectrex Carts w/ Bankswitch", tag, owner, clock, "vectrex_64k", __FILE__), m_bank(0) { } -vectrex_sram_device::vectrex_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vectrex_sram_device::vectrex_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : vectrex_rom_device(mconfig, VECTREX_ROM_SRAM, "Vectrex Carts w/ SRAM", tag, owner, clock, "vectrex_sram", __FILE__) { } diff --git a/src/devices/bus/vectrex/rom.h b/src/devices/bus/vectrex/rom.h index 453cbfed89b..4ef56d8f58d 100644 --- a/src/devices/bus/vectrex/rom.h +++ b/src/devices/bus/vectrex/rom.h @@ -13,8 +13,8 @@ class vectrex_rom_device : public device_t, { public: // construction/destruction - vectrex_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - vectrex_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vectrex_rom_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); + vectrex_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override {} @@ -30,7 +30,7 @@ class vectrex_rom64k_device : public vectrex_rom_device { public: // construction/destruction - vectrex_rom64k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vectrex_rom64k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -50,7 +50,7 @@ class vectrex_sram_device : public vectrex_rom_device { public: // construction/destruction - vectrex_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vectrex_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // reading and writing virtual DECLARE_WRITE8_MEMBER(write_ram) override; diff --git a/src/devices/bus/vectrex/slot.cpp b/src/devices/bus/vectrex/slot.cpp index 4063ed7b01c..44649a8929a 100644 --- a/src/devices/bus/vectrex/slot.cpp +++ b/src/devices/bus/vectrex/slot.cpp @@ -45,7 +45,7 @@ device_vectrex_cart_interface::~device_vectrex_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_vectrex_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_vectrex_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -62,7 +62,7 @@ void device_vectrex_cart_interface::rom_alloc(UINT32 size, const char *tag) //------------------------------------------------- // vectrex_cart_slot_device - constructor //------------------------------------------------- -vectrex_cart_slot_device::vectrex_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vectrex_cart_slot_device::vectrex_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VECTREX_CART_SLOT, "GCE Vectrex Cartridge Slot", tag, owner, clock, "vectrex_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -152,8 +152,8 @@ image_init_result vectrex_cart_slot_device::call_load() { if (m_cart) { - UINT32 size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); - UINT8 *ROM; + uint32_t size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint8_t *ROM; if (size > 0x10000) { @@ -211,8 +211,8 @@ std::string vectrex_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 size = m_file->size(); - std::vector rom(size); + uint32_t size = m_file->size(); + std::vector rom(size); int type = VECTREX_STD; m_file->read(&rom[0], size); diff --git a/src/devices/bus/vectrex/slot.h b/src/devices/bus/vectrex/slot.h index 261574556cd..3a06107faf8 100644 --- a/src/devices/bus/vectrex/slot.h +++ b/src/devices/bus/vectrex/slot.h @@ -42,14 +42,14 @@ public: virtual DECLARE_WRITE8_MEMBER(write_ram) {} virtual DECLARE_WRITE8_MEMBER(write_bank) {} - void rom_alloc(UINT32 size, const char *tag); - UINT8* get_rom_base() { return m_rom; } - UINT32 get_rom_size() { return m_rom_size; } + void rom_alloc(uint32_t size, const char *tag); + uint8_t* get_rom_base() { return m_rom; } + uint32_t get_rom_size() { return m_rom_size; } protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; + uint8_t *m_rom; + uint32_t m_rom_size; }; @@ -61,7 +61,7 @@ class vectrex_cart_slot_device : public device_t, { public: // construction/destruction - vectrex_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vectrex_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~vectrex_cart_slot_device(); // device-level overrides diff --git a/src/devices/bus/vic10/exp.cpp b/src/devices/bus/vic10/exp.cpp index d9a5c414768..dc162e12f8a 100644 --- a/src/devices/bus/vic10/exp.cpp +++ b/src/devices/bus/vic10/exp.cpp @@ -56,7 +56,7 @@ device_vic10_expansion_card_interface::~device_vic10_expansion_card_interface() // vic10_expansion_slot_device - constructor //------------------------------------------------- -vic10_expansion_slot_device::vic10_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vic10_expansion_slot_device::vic10_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC10_EXPANSION_SLOT, "VIC-10 expansion port", tag, owner, clock, "vic10_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), @@ -141,8 +141,8 @@ image_init_result vic10_expansion_slot_device::call_load() if (cbm_crt_read_header(*m_file, &roml_size, &romh_size, &exrom, &game)) { - UINT8 *roml = nullptr; - UINT8 *romh = nullptr; + uint8_t *roml = nullptr; + uint8_t *romh = nullptr; m_card->m_lorom.allocate(roml_size); m_card->m_uprom.allocate(romh_size); @@ -188,7 +188,7 @@ std::string vic10_expansion_slot_device::get_default_card_software() // cd_r - cartridge data read //------------------------------------------------- -UINT8 vic10_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) +uint8_t vic10_expansion_slot_device::cd_r(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) { if (m_card != nullptr) { @@ -203,7 +203,7 @@ UINT8 vic10_expansion_slot_device::cd_r(address_space &space, offs_t offset, UIN // cd_w - cartridge data write //------------------------------------------------- -void vic10_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) +void vic10_expansion_slot_device::cd_w(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) { if (m_card != nullptr) { diff --git a/src/devices/bus/vic10/exp.h b/src/devices/bus/vic10/exp.h index a3ff118c891..7084727e84a 100644 --- a/src/devices/bus/vic10/exp.h +++ b/src/devices/bus/vic10/exp.h @@ -93,7 +93,7 @@ class vic10_expansion_slot_device : public device_t, { public: // construction/destruction - vic10_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic10_expansion_slot_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); } template static devcb_base &set_res_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_res.set_callback(object); } @@ -101,8 +101,8 @@ public: template static devcb_base &set_sp_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_sp.set_callback(object); } // computer interface - UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); - void cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram); + uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram); + void cd_w(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram); DECLARE_READ_LINE_MEMBER( p0_r ); DECLARE_WRITE_LINE_MEMBER( p0_w ); @@ -156,17 +156,17 @@ public: device_vic10_expansion_card_interface(const machine_config &mconfig, device_t &device); virtual ~device_vic10_expansion_card_interface(); - virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) { return data; }; - virtual void vic10_cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) { }; + virtual uint8_t vic10_cd_r(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) { return data; }; + virtual void vic10_cd_w(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) { }; virtual int vic10_p0_r() { return 0; }; virtual void vic10_p0_w(int state) { }; virtual void vic10_sp_w(int state) { }; virtual void vic10_cnt_w(int state) { }; protected: - optional_shared_ptr m_lorom; - optional_shared_ptr m_exram; - optional_shared_ptr m_uprom; + optional_shared_ptr m_lorom; + optional_shared_ptr m_exram; + optional_shared_ptr m_uprom; vic10_expansion_slot_device *m_slot; }; diff --git a/src/devices/bus/vic10/std.cpp b/src/devices/bus/vic10/std.cpp index a0cd1aa67cf..a9005056f31 100644 --- a/src/devices/bus/vic10/std.cpp +++ b/src/devices/bus/vic10/std.cpp @@ -26,7 +26,7 @@ const device_type VIC10_STD = &device_creator; // vic10_standard_cartridge_device - constructor //------------------------------------------------- -vic10_standard_cartridge_device::vic10_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic10_standard_cartridge_device::vic10_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC10_STD, "VIC-10 Standard Cartridge", tag, owner, clock, "vic10_standard", __FILE__), device_vic10_expansion_card_interface(mconfig, *this) { @@ -46,7 +46,7 @@ void vic10_standard_cartridge_device::device_start() // vic10_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic10_standard_cartridge_device::vic10_cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) +uint8_t vic10_standard_cartridge_device::vic10_cd_r(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) { if (!lorom && m_lorom.bytes()) { @@ -69,7 +69,7 @@ UINT8 vic10_standard_cartridge_device::vic10_cd_r(address_space &space, offs_t o // vic10_cd_w - cartridge data write //------------------------------------------------- -void vic10_standard_cartridge_device::vic10_cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) +void vic10_standard_cartridge_device::vic10_cd_w(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) { if (!exram && m_exram.bytes()) { diff --git a/src/devices/bus/vic10/std.h b/src/devices/bus/vic10/std.h index 5f7e206a166..cac02e275e3 100644 --- a/src/devices/bus/vic10/std.h +++ b/src/devices/bus/vic10/std.h @@ -27,15 +27,15 @@ class vic10_standard_cartridge_device : public device_t, { public: // construction/destruction - vic10_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic10_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_vic10_expansion_card_interface overrides - virtual UINT8 vic10_cd_r(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) override; - virtual void vic10_cd_w(address_space &space, offs_t offset, UINT8 data, int lorom, int uprom, int exram) override; + virtual uint8_t vic10_cd_r(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) override; + virtual void vic10_cd_w(address_space &space, offs_t offset, uint8_t data, int lorom, int uprom, int exram) override; }; diff --git a/src/devices/bus/vic20/4cga.cpp b/src/devices/bus/vic20/4cga.cpp index 67901823065..57627b2e88f 100644 --- a/src/devices/bus/vic20/4cga.cpp +++ b/src/devices/bus/vic20/4cga.cpp @@ -58,7 +58,7 @@ ioport_constructor c64_4cga_device::device_input_ports() const // c64_4cga_device - constructor //------------------------------------------------- -c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock, "c64_4cga", __FILE__), device_pet_user_port_interface(mconfig, *this), m_port(0), @@ -84,7 +84,7 @@ void c64_4cga_device::device_start() void c64_4cga_device::update_output() { - UINT8 data; + uint8_t data; if (m_port) { diff --git a/src/devices/bus/vic20/4cga.h b/src/devices/bus/vic20/4cga.h index e95e682ae1d..342201c2506 100644 --- a/src/devices/bus/vic20/4cga.h +++ b/src/devices/bus/vic20/4cga.h @@ -28,7 +28,7 @@ class c64_4cga_device : public device_t, { public: // construction/destruction - c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -54,8 +54,8 @@ private: void update_output(); int m_port; - UINT8 m_joy3; - UINT8 m_joy4; + uint8_t m_joy3; + uint8_t m_joy4; }; diff --git a/src/devices/bus/vic20/exp.cpp b/src/devices/bus/vic20/exp.cpp index 1f560f62b5d..c95601773e3 100644 --- a/src/devices/bus/vic20/exp.cpp +++ b/src/devices/bus/vic20/exp.cpp @@ -56,7 +56,7 @@ device_vic20_expansion_card_interface::~device_vic20_expansion_card_interface() // vic20_expansion_slot_device - constructor //------------------------------------------------- -vic20_expansion_slot_device::vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vic20_expansion_slot_device::vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC20_EXPANSION_SLOT, "VIC-20 expansion port", tag, owner, clock, "vic20_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), @@ -122,9 +122,9 @@ image_init_result vic20_expansion_slot_device::call_load() else if (is_filetype("crt")) { // read the header - UINT8 header[2]; + uint8_t header[2]; fread(&header, 2); - UINT16 address = (header[1] << 8) | header[0]; + uint16_t address = (header[1] << 8) | header[0]; switch (address) { @@ -165,7 +165,7 @@ std::string vic20_expansion_slot_device::get_default_card_software() // cd_r - cartridge data read //------------------------------------------------- -UINT8 vic20_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +uint8_t vic20_expansion_slot_device::cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (m_card != nullptr) { @@ -180,7 +180,7 @@ UINT8 vic20_expansion_slot_device::cd_r(address_space &space, offs_t offset, UIN // cd_w - cartridge data write //------------------------------------------------- -void vic20_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +void vic20_expansion_slot_device::cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (m_card != nullptr) { diff --git a/src/devices/bus/vic20/exp.h b/src/devices/bus/vic20/exp.h index 9f161fb5c28..8c2d9fc0059 100644 --- a/src/devices/bus/vic20/exp.h +++ b/src/devices/bus/vic20/exp.h @@ -88,15 +88,15 @@ class vic20_expansion_slot_device : public device_t, { public: // construction/destruction - vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic20_expansion_slot_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); } template static devcb_base &set_nmi_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_nmi.set_callback(object); } template static devcb_base &set_res_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_res.set_callback(object); } // computer interface - UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); - void cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + uint8_t cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); + void cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3); // cartridge interface DECLARE_WRITE_LINE_MEMBER( irq_w ) { m_write_irq(state); } @@ -146,15 +146,15 @@ public: device_vic20_expansion_card_interface(const machine_config &mconfig, device_t &device); virtual ~device_vic20_expansion_card_interface(); - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { return data; }; - virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { }; + virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { return data; }; + virtual void vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { }; protected: - optional_shared_ptr m_blk1; - optional_shared_ptr m_blk2; - optional_shared_ptr m_blk3; - optional_shared_ptr m_blk5; - optional_shared_ptr m_nvram; + optional_shared_ptr m_blk1; + optional_shared_ptr m_blk2; + optional_shared_ptr m_blk3; + optional_shared_ptr m_blk5; + optional_shared_ptr m_nvram; vic20_expansion_slot_device *m_slot; }; diff --git a/src/devices/bus/vic20/fe3.cpp b/src/devices/bus/vic20/fe3.cpp index 1c07b296f98..4b338a49d08 100644 --- a/src/devices/bus/vic20/fe3.cpp +++ b/src/devices/bus/vic20/fe3.cpp @@ -110,7 +110,7 @@ machine_config_constructor vic20_final_expansion_3_t::device_mconfig_additions() // vic20_final_expansion_3_t - constructor //------------------------------------------------- -vic20_final_expansion_3_t::vic20_final_expansion_3_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vic20_final_expansion_3_t::vic20_final_expansion_3_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC20_FE3, "Final Expansion v3", tag, owner, clock, "vic20_fe3", __FILE__), device_vic20_expansion_card_interface(mconfig, *this), m_flash_rom(*this, AM29F040_TAG), @@ -149,7 +149,7 @@ void vic20_final_expansion_3_t::device_reset() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic20_final_expansion_3_t::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +uint8_t vic20_final_expansion_3_t::vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { switch (m_reg1 & REG1_MODE_MASK) { @@ -370,7 +370,7 @@ UINT8 vic20_final_expansion_3_t::vic20_cd_r(address_space &space, offs_t offset, // vic20_cd_w - cartridge data write //------------------------------------------------- -void vic20_final_expansion_3_t::vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +void vic20_final_expansion_3_t::vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { switch (m_reg1 & REG1_MODE_MASK) { @@ -600,9 +600,9 @@ offs_t vic20_final_expansion_3_t::get_address(int bank, int block, offs_t offset // read_register - //------------------------------------------------- -UINT8 vic20_final_expansion_3_t::read_register(offs_t offset) +uint8_t vic20_final_expansion_3_t::read_register(offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -623,7 +623,7 @@ UINT8 vic20_final_expansion_3_t::read_register(offs_t offset) // write_register - //------------------------------------------------- -void vic20_final_expansion_3_t::write_register(offs_t offset, UINT8 data) +void vic20_final_expansion_3_t::write_register(offs_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/bus/vic20/fe3.h b/src/devices/bus/vic20/fe3.h index 01a4a743c63..c4446b393d5 100644 --- a/src/devices/bus/vic20/fe3.h +++ b/src/devices/bus/vic20/fe3.h @@ -28,7 +28,7 @@ class vic20_final_expansion_3_t : public device_t, { public: // construction/destruction - vic20_final_expansion_3_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic20_final_expansion_3_t(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; @@ -40,8 +40,8 @@ protected: virtual void device_reset() override; // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; - virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual void vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; private: enum @@ -74,14 +74,14 @@ private: }; offs_t get_address(int bank, int block, offs_t offset); - UINT8 read_register(offs_t offset); - void write_register(offs_t offset, UINT8 data); + uint8_t read_register(offs_t offset); + void write_register(offs_t offset, uint8_t data); required_device m_flash_rom; - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; - UINT8 m_reg1; - UINT8 m_reg2; + uint8_t m_reg1; + uint8_t m_reg2; int m_lockbit; }; diff --git a/src/devices/bus/vic20/megacart.cpp b/src/devices/bus/vic20/megacart.cpp index e92e1dbbc55..a6d178f72f2 100644 --- a/src/devices/bus/vic20/megacart.cpp +++ b/src/devices/bus/vic20/megacart.cpp @@ -46,7 +46,7 @@ machine_config_constructor vic20_megacart_device::device_mconfig_additions() con // vic20_megacart_device - constructor //------------------------------------------------- -vic20_megacart_device::vic20_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic20_megacart_device::vic20_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC20_MEGACART, "Mega-Cart", tag, owner, clock, "megacart", __FILE__), device_vic20_expansion_card_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -81,7 +81,7 @@ void vic20_megacart_device::device_reset() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic20_megacart_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +uint8_t vic20_megacart_device::vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (!ram1 || !ram2 || !ram3 || !io2 || !io3) { @@ -105,7 +105,7 @@ UINT8 vic20_megacart_device::vic20_cd_r(address_space &space, offs_t offset, UIN // vic20_cd_w - cartridge data write //------------------------------------------------- -void vic20_megacart_device::vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +void vic20_megacart_device::vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (!ram1 || !ram2 || !ram3 || !io2) { diff --git a/src/devices/bus/vic20/megacart.h b/src/devices/bus/vic20/megacart.h index 678ddac1cff..a4bb4ff4231 100644 --- a/src/devices/bus/vic20/megacart.h +++ b/src/devices/bus/vic20/megacart.h @@ -28,7 +28,7 @@ class vic20_megacart_device : public device_t, { public: // construction/destruction - vic20_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic20_megacart_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; @@ -44,8 +44,8 @@ protected: virtual void nvram_write(emu_file &file) override { file.write(m_nvram, m_nvram.bytes()); } // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; - virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual void vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; private: int m_nvram_en; diff --git a/src/devices/bus/vic20/std.cpp b/src/devices/bus/vic20/std.cpp index fe02022f2be..fb8b2bf90d1 100644 --- a/src/devices/bus/vic20/std.cpp +++ b/src/devices/bus/vic20/std.cpp @@ -26,7 +26,7 @@ const device_type VIC20_STD = &device_creator; // vic20_standard_cartridge_device - constructor //------------------------------------------------- -vic20_standard_cartridge_device::vic20_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic20_standard_cartridge_device::vic20_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC20_STD, "VIC-20 Standard Cartridge", tag, owner, clock, "vic20_standard", __FILE__), device_vic20_expansion_card_interface(mconfig, *this) { @@ -46,7 +46,7 @@ void vic20_standard_cartridge_device::device_start() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic20_standard_cartridge_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +uint8_t vic20_standard_cartridge_device::vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (!blk1 && (m_blk1 != nullptr)) { diff --git a/src/devices/bus/vic20/std.h b/src/devices/bus/vic20/std.h index 0ea4cdec1ab..2e73ba0f037 100644 --- a/src/devices/bus/vic20/std.h +++ b/src/devices/bus/vic20/std.h @@ -27,14 +27,14 @@ class vic20_standard_cartridge_device : public device_t, { public: // construction/destruction - vic20_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic20_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; }; diff --git a/src/devices/bus/vic20/vic1010.cpp b/src/devices/bus/vic20/vic1010.cpp index 5aa981edb5a..cf112877b9f 100644 --- a/src/devices/bus/vic20/vic1010.cpp +++ b/src/devices/bus/vic20/vic1010.cpp @@ -51,7 +51,7 @@ machine_config_constructor vic1010_device::device_mconfig_additions() const // vic1010_device - constructor //------------------------------------------------- -vic1010_device::vic1010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic1010_device::vic1010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC1010, "VIC1010", tag, owner, clock, "vic1010", __FILE__), device_vic20_expansion_card_interface(mconfig, *this), m_slot1(*this, "slot1"), @@ -97,11 +97,11 @@ void vic1010_device::device_reset() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1010_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +uint8_t vic1010_device::vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { for (auto elem : m_expansion_slot) { - UINT8 slot_data = elem->cd_r(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); + uint8_t slot_data = elem->cd_r(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); if (data != slot_data) { @@ -117,7 +117,7 @@ UINT8 vic1010_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data // vic20_cd_w - cartridge data write //------------------------------------------------- -void vic1010_device::vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +void vic1010_device::vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { for (auto & elem : m_expansion_slot) { diff --git a/src/devices/bus/vic20/vic1010.h b/src/devices/bus/vic20/vic1010.h index a481ba9cb08..264c32a7734 100644 --- a/src/devices/bus/vic20/vic1010.h +++ b/src/devices/bus/vic20/vic1010.h @@ -35,7 +35,7 @@ class vic1010_device : public device_t, { public: // construction/destruction - vic1010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic1010_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,8 +46,8 @@ protected: virtual void device_reset() override; // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; - virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual void vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; private: required_device m_slot1; diff --git a/src/devices/bus/vic20/vic1011.cpp b/src/devices/bus/vic20/vic1011.cpp index 0b0d30f97f5..3c8bc3352a4 100644 --- a/src/devices/bus/vic20/vic1011.cpp +++ b/src/devices/bus/vic20/vic1011.cpp @@ -58,7 +58,7 @@ machine_config_constructor vic1011_device::device_mconfig_additions() const // vic1011_device - constructor //------------------------------------------------- -vic1011_device::vic1011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic1011_device::vic1011_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC1011, "VIC1011", tag, owner, clock, "vic1011", __FILE__), device_pet_user_port_interface(mconfig, *this), m_rs232(*this, RS232_TAG) diff --git a/src/devices/bus/vic20/vic1011.h b/src/devices/bus/vic20/vic1011.h index 0e5b104b0e3..d3362b95d1a 100644 --- a/src/devices/bus/vic20/vic1011.h +++ b/src/devices/bus/vic20/vic1011.h @@ -27,7 +27,7 @@ class vic1011_device : public device_t, { public: // construction/destruction - vic1011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic1011_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; diff --git a/src/devices/bus/vic20/vic1110.cpp b/src/devices/bus/vic20/vic1110.cpp index c8d9acb1398..4144cb2b97d 100644 --- a/src/devices/bus/vic20/vic1110.cpp +++ b/src/devices/bus/vic20/vic1110.cpp @@ -65,7 +65,7 @@ ioport_constructor vic1110_device::device_input_ports() const // vic1110_device - constructor //------------------------------------------------- -vic1110_device::vic1110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic1110_device::vic1110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC1110, "VIC1110", tag, owner, clock, "vic1110", __FILE__), device_vic20_expansion_card_interface(mconfig, *this), m_ram(*this, "ram"), @@ -89,9 +89,9 @@ void vic1110_device::device_start() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1110_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +uint8_t vic1110_device::vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 sw = m_sw->read(); + uint8_t sw = m_sw->read(); if ((!blk1 && (sw == BLK1)) || (!blk2 && (sw == BLK2)) || (!blk3 && (sw == BLK3)) || (!blk5 && (sw == BLK5))) { @@ -106,9 +106,9 @@ UINT8 vic1110_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data // vic20_cd_w - cartridge data write //------------------------------------------------- -void vic1110_device::vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +void vic1110_device::vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { - UINT8 sw = m_sw->read(); + uint8_t sw = m_sw->read(); if ((!blk1 && (sw == BLK1)) || (!blk2 && (sw == BLK2)) || (!blk3 && (sw == BLK3)) || (!blk5 && (sw == BLK5))) { diff --git a/src/devices/bus/vic20/vic1110.h b/src/devices/bus/vic20/vic1110.h index 21a4660d282..05c99216849 100644 --- a/src/devices/bus/vic20/vic1110.h +++ b/src/devices/bus/vic20/vic1110.h @@ -27,7 +27,7 @@ class vic1110_device : public device_t, { public: // construction/destruction - vic1110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic1110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,11 +37,11 @@ protected: virtual void device_start() override; // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; - virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual void vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; required_ioport m_sw; }; diff --git a/src/devices/bus/vic20/vic1111.cpp b/src/devices/bus/vic20/vic1111.cpp index 770d5639d8f..894b4075802 100644 --- a/src/devices/bus/vic20/vic1111.cpp +++ b/src/devices/bus/vic20/vic1111.cpp @@ -26,7 +26,7 @@ const device_type VIC1111 = &device_creator; // vic1111_device - constructor //------------------------------------------------- -vic1111_device::vic1111_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic1111_device::vic1111_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC1111, "VIC1111", tag, owner, clock, "vic1111", __FILE__), device_vic20_expansion_card_interface(mconfig, *this), m_ram(*this, "ram") @@ -49,7 +49,7 @@ void vic1111_device::device_start() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1111_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +uint8_t vic1111_device::vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (!blk1) { @@ -68,7 +68,7 @@ UINT8 vic1111_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data // vic20_cd_w - cartridge data write //------------------------------------------------- -void vic1111_device::vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +void vic1111_device::vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (!blk1) { diff --git a/src/devices/bus/vic20/vic1111.h b/src/devices/bus/vic20/vic1111.h index 83783da6878..eebe166805a 100644 --- a/src/devices/bus/vic20/vic1111.h +++ b/src/devices/bus/vic20/vic1111.h @@ -27,18 +27,18 @@ class vic1111_device : public device_t, { public: // construction/destruction - vic1111_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic1111_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; - virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual void vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; }; diff --git a/src/devices/bus/vic20/vic1112.cpp b/src/devices/bus/vic20/vic1112.cpp index 9ccb180aa6a..063fab98d68 100644 --- a/src/devices/bus/vic20/vic1112.cpp +++ b/src/devices/bus/vic20/vic1112.cpp @@ -50,7 +50,7 @@ READ8_MEMBER( vic1112_device::via0_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_bus->eoi_r() << 3; data |= m_bus->dav_r() << 4; @@ -134,7 +134,7 @@ machine_config_constructor vic1112_device::device_mconfig_additions() const // vic1112_device - constructor //------------------------------------------------- -vic1112_device::vic1112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic1112_device::vic1112_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC1112, "VIC1112", tag, owner, clock, "vic1112", __FILE__), device_vic20_expansion_card_interface(mconfig, *this), m_via0(*this, M6522_0_TAG), @@ -171,7 +171,7 @@ void vic1112_device::device_reset() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1112_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +uint8_t vic1112_device::vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (!io2) { @@ -200,7 +200,7 @@ UINT8 vic1112_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data // vic20_cd_w - cartridge data write //------------------------------------------------- -void vic1112_device::vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +void vic1112_device::vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (!io2) { diff --git a/src/devices/bus/vic20/vic1112.h b/src/devices/bus/vic20/vic1112.h index fce5971c533..84cb158f17b 100644 --- a/src/devices/bus/vic20/vic1112.h +++ b/src/devices/bus/vic20/vic1112.h @@ -32,7 +32,7 @@ class vic1112_device : public device_t, { public: // construction/destruction - vic1112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic1112_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; @@ -49,15 +49,15 @@ protected: virtual void device_reset() override; // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; - virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual void vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; private: required_device m_via0; required_device m_via1; required_device m_bus; - //UINT8 *m_rom; + //uint8_t *m_rom; int m_via0_irq; int m_via1_irq; diff --git a/src/devices/bus/vic20/vic1210.cpp b/src/devices/bus/vic20/vic1210.cpp index 5acb518cd08..026fba61c9b 100644 --- a/src/devices/bus/vic20/vic1210.cpp +++ b/src/devices/bus/vic20/vic1210.cpp @@ -27,7 +27,7 @@ const device_type VIC1210 = &device_creator; // vic1210_device - constructor //------------------------------------------------- -vic1210_device::vic1210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic1210_device::vic1210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC1210, "VIC1210", tag, owner, clock, "vic1210", __FILE__), device_vic20_expansion_card_interface(mconfig, *this), m_ram(*this, "ram") @@ -50,7 +50,7 @@ void vic1210_device::device_start() // vic20_cd_r - cartridge data read //------------------------------------------------- -UINT8 vic1210_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +uint8_t vic1210_device::vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (!ram1 || !ram2 || !ram3) { @@ -69,7 +69,7 @@ UINT8 vic1210_device::vic20_cd_r(address_space &space, offs_t offset, UINT8 data // vic20_cd_w - cartridge data write //------------------------------------------------- -void vic1210_device::vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) +void vic1210_device::vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { if (!ram1 || !ram2 || !ram3) { diff --git a/src/devices/bus/vic20/vic1210.h b/src/devices/bus/vic20/vic1210.h index 90de25cddae..dbdcffc3407 100644 --- a/src/devices/bus/vic20/vic1210.h +++ b/src/devices/bus/vic20/vic1210.h @@ -28,18 +28,18 @@ class vic1210_device : public device_t, { public: // construction/destruction - vic1210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic1210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_vic20_expansion_card_interface overrides - virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; - virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual uint8_t vic20_cd_r(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; + virtual void vic20_cd_w(address_space &space, offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; }; diff --git a/src/devices/bus/vidbrain/exp.cpp b/src/devices/bus/vidbrain/exp.cpp index 183d2f590ff..128a40d82c9 100644 --- a/src/devices/bus/vidbrain/exp.cpp +++ b/src/devices/bus/vidbrain/exp.cpp @@ -47,7 +47,7 @@ device_videobrain_expansion_card_interface::device_videobrain_expansion_card_int // videobrain_roml_pointer - get low ROM pointer //------------------------------------------------- -UINT8* device_videobrain_expansion_card_interface::videobrain_rom_pointer(running_machine &machine, size_t size) +uint8_t* device_videobrain_expansion_card_interface::videobrain_rom_pointer(running_machine &machine, size_t size) { if (m_rom.empty()) { @@ -64,7 +64,7 @@ UINT8* device_videobrain_expansion_card_interface::videobrain_rom_pointer(runnin // videobrain_ram_pointer - get RAM pointer //------------------------------------------------- -UINT8* device_videobrain_expansion_card_interface::videobrain_ram_pointer(running_machine &machine, size_t size) +uint8_t* device_videobrain_expansion_card_interface::videobrain_ram_pointer(running_machine &machine, size_t size) { if (m_ram.empty()) { @@ -86,7 +86,7 @@ UINT8* device_videobrain_expansion_card_interface::videobrain_ram_pointer(runnin // videobrain_expansion_slot_device - constructor //------------------------------------------------- -videobrain_expansion_slot_device::videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +videobrain_expansion_slot_device::videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIDEOBRAIN_EXPANSION_SLOT, "VideoBrain expansion port", tag, owner, clock, "videobrain_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), device_image_interface(mconfig, *this), @@ -152,9 +152,9 @@ std::string videobrain_expansion_slot_device::get_default_card_software() // bo_r - cartridge data read //------------------------------------------------- -UINT8 videobrain_expansion_slot_device::bo_r(address_space &space, offs_t offset, int cs1, int cs2) +uint8_t videobrain_expansion_slot_device::bo_r(address_space &space, offs_t offset, int cs1, int cs2) { - UINT8 data = 0; + uint8_t data = 0; if (m_cart != nullptr) { @@ -169,7 +169,7 @@ UINT8 videobrain_expansion_slot_device::bo_r(address_space &space, offs_t offset // bo_w - cartridge data write //------------------------------------------------- -void videobrain_expansion_slot_device::bo_w(address_space &space, offs_t offset, UINT8 data, int cs1, int cs2) +void videobrain_expansion_slot_device::bo_w(address_space &space, offs_t offset, uint8_t data, int cs1, int cs2) { if (m_cart != nullptr) { diff --git a/src/devices/bus/vidbrain/exp.h b/src/devices/bus/vidbrain/exp.h index d7ef79f3528..4c00a34ff4f 100644 --- a/src/devices/bus/vidbrain/exp.h +++ b/src/devices/bus/vidbrain/exp.h @@ -84,18 +84,18 @@ public: protected: // initialization - virtual UINT8* videobrain_rom_pointer(running_machine &machine, size_t size); - virtual UINT8* videobrain_ram_pointer(running_machine &machine, size_t size); + virtual uint8_t* videobrain_rom_pointer(running_machine &machine, size_t size); + virtual uint8_t* videobrain_ram_pointer(running_machine &machine, size_t size); // runtime - virtual UINT8 videobrain_bo_r(address_space &space, offs_t offset, int cs1, int cs2) { return 0; }; - virtual void videobrain_bo_w(address_space &space, offs_t offset, UINT8 data, int cs1, int cs2) { }; + virtual uint8_t videobrain_bo_r(address_space &space, offs_t offset, int cs1, int cs2) { return 0; }; + virtual void videobrain_bo_w(address_space &space, offs_t offset, uint8_t data, int cs1, int cs2) { }; virtual void videobrain_extres_w() { }; videobrain_expansion_slot_device *m_slot; - std::vector m_rom; - std::vector m_ram; + std::vector m_rom; + std::vector m_ram; size_t m_rom_mask; size_t m_ram_mask; @@ -110,14 +110,14 @@ class videobrain_expansion_slot_device : public device_t, { public: // construction/destruction - videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + videobrain_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~videobrain_expansion_slot_device() { } template static devcb_base &set_extres_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_extres.set_callback(object); } // computer interface - UINT8 bo_r(address_space &space, offs_t offset, int cs1, int cs2); - void bo_w(address_space &space, offs_t offset, UINT8 data, int cs1, int cs2); + uint8_t bo_r(address_space &space, offs_t offset, int cs1, int cs2); + void bo_w(address_space &space, offs_t offset, uint8_t data, int cs1, int cs2); DECLARE_READ8_MEMBER( cs1_r ) { return bo_r(space, offset + 0x1000, 0, 1); } DECLARE_WRITE8_MEMBER( cs1_w ) { bo_w(space, offset + 0x1000, data, 0, 1); } diff --git a/src/devices/bus/vidbrain/money_minder.cpp b/src/devices/bus/vidbrain/money_minder.cpp index f5fa70bd868..47c2589c335 100644 --- a/src/devices/bus/vidbrain/money_minder.cpp +++ b/src/devices/bus/vidbrain/money_minder.cpp @@ -26,7 +26,7 @@ const device_type VB_MONEY_MINDER = &device_creator= 0x3800) { diff --git a/src/devices/bus/vidbrain/money_minder.h b/src/devices/bus/vidbrain/money_minder.h index b32723338f9..a9cf0263334 100644 --- a/src/devices/bus/vidbrain/money_minder.h +++ b/src/devices/bus/vidbrain/money_minder.h @@ -27,15 +27,15 @@ class videobrain_money_minder_cartridge_device : public device_t, { public: // construction/destruction - videobrain_money_minder_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + videobrain_money_minder_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_videobrain_expansion_card_interface overrides - virtual UINT8 videobrain_bo_r(address_space &space, offs_t offset, int cs1, int cs2) override; - virtual void videobrain_bo_w(address_space &space, offs_t offset, UINT8 data, int cs1, int cs2) override; + virtual uint8_t videobrain_bo_r(address_space &space, offs_t offset, int cs1, int cs2) override; + virtual void videobrain_bo_w(address_space &space, offs_t offset, uint8_t data, int cs1, int cs2) override; }; diff --git a/src/devices/bus/vidbrain/std.cpp b/src/devices/bus/vidbrain/std.cpp index f56f5fd9d9f..93f2867098b 100644 --- a/src/devices/bus/vidbrain/std.cpp +++ b/src/devices/bus/vidbrain/std.cpp @@ -26,7 +26,7 @@ const device_type VB_STD = &device_creator // videobrain_standard_cartridge_device - constructor //------------------------------------------------- -videobrain_standard_cartridge_device::videobrain_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +videobrain_standard_cartridge_device::videobrain_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VB_STD, "VideoBrain standard cartridge", tag, owner, clock, "vb_std", __FILE__), device_videobrain_expansion_card_interface(mconfig, *this) { @@ -46,9 +46,9 @@ void videobrain_standard_cartridge_device::device_start() // videobrain_bo_r - cartridge data read //------------------------------------------------- -UINT8 videobrain_standard_cartridge_device::videobrain_bo_r(address_space &space, offs_t offset, int cs1, int cs2) +uint8_t videobrain_standard_cartridge_device::videobrain_bo_r(address_space &space, offs_t offset, int cs1, int cs2) { - UINT8 data = 0; + uint8_t data = 0; if (!cs1) { diff --git a/src/devices/bus/vidbrain/std.h b/src/devices/bus/vidbrain/std.h index 8cde3c70db4..c1e93d0dc94 100644 --- a/src/devices/bus/vidbrain/std.h +++ b/src/devices/bus/vidbrain/std.h @@ -27,14 +27,14 @@ class videobrain_standard_cartridge_device : public device_t, { public: // construction/destruction - videobrain_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + videobrain_standard_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; // device_videobrain_expansion_card_interface overrides - virtual UINT8 videobrain_bo_r(address_space &space, offs_t offset, int cs1, int cs2) override; + virtual uint8_t videobrain_bo_r(address_space &space, offs_t offset, int cs1, int cs2) override; }; diff --git a/src/devices/bus/vidbrain/timeshare.cpp b/src/devices/bus/vidbrain/timeshare.cpp index 196bf66db2e..2b24c0e997e 100644 --- a/src/devices/bus/vidbrain/timeshare.cpp +++ b/src/devices/bus/vidbrain/timeshare.cpp @@ -26,7 +26,7 @@ const device_type VB_TIMESHARE = &device_creatorvip_in_r(); return data; } -void vip_byteio_port_device::out_w(UINT8 data) { if (m_cart != nullptr) m_cart->vip_out_w(data); } +uint8_t vip_byteio_port_device::in_r() { uint8_t data = 0xff; if (m_cart != nullptr) data = m_cart->vip_in_r(); return data; } +void vip_byteio_port_device::out_w(uint8_t data) { if (m_cart != nullptr) m_cart->vip_out_w(data); } READ_LINE_MEMBER( vip_byteio_port_device::ef3_r ) { int state = CLEAR_LINE; if (m_cart != nullptr) state = m_cart->vip_ef3_r(); return state; } READ_LINE_MEMBER( vip_byteio_port_device::ef4_r ) { int state = CLEAR_LINE; if (m_cart != nullptr) state = m_cart->vip_ef4_r(); return state; } WRITE_LINE_MEMBER( vip_byteio_port_device::q_w ) { if (m_cart != nullptr) m_cart->vip_q_w(state); } diff --git a/src/devices/bus/vip/byteio.h b/src/devices/bus/vip/byteio.h index 8871e1f0d72..ce196dc20fd 100644 --- a/src/devices/bus/vip/byteio.h +++ b/src/devices/bus/vip/byteio.h @@ -72,13 +72,13 @@ class vip_byteio_port_device : public device_t, { public: // construction/destruction - vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vip_byteio_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_inst_callback(_inst inst) { m_write_inst.set_callback(inst); } // computer interface - UINT8 in_r(); - void out_w(UINT8 data); + uint8_t in_r(); + void out_w(uint8_t data); DECLARE_READ_LINE_MEMBER( ef3_r ); DECLARE_READ_LINE_MEMBER( ef4_r ); DECLARE_WRITE_LINE_MEMBER( q_w ); @@ -106,8 +106,8 @@ public: // construction/destruction device_vip_byteio_port_interface(const machine_config &mconfig, device_t &device); - virtual UINT8 vip_in_r() { return 0xff; }; - virtual void vip_out_w(UINT8 data) { }; + virtual uint8_t vip_in_r() { return 0xff; }; + virtual void vip_out_w(uint8_t data) { }; virtual int vip_ef3_r() { return CLEAR_LINE; } virtual int vip_ef4_r() { return CLEAR_LINE; } diff --git a/src/devices/bus/vip/exp.cpp b/src/devices/bus/vip/exp.cpp index 59db0c4844d..a062ea14670 100644 --- a/src/devices/bus/vip/exp.cpp +++ b/src/devices/bus/vip/exp.cpp @@ -50,7 +50,7 @@ device_vip_expansion_card_interface::device_vip_expansion_card_interface(const m // vip_expansion_slot_device - constructor //------------------------------------------------- -vip_expansion_slot_device::vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vip_expansion_slot_device::vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIP_EXPANSION_SLOT, "VIP expansion port", tag, owner, clock, "vip_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_write_int(*this), @@ -79,9 +79,9 @@ void vip_expansion_slot_device::device_start() // program_r - program read //------------------------------------------------- -UINT8 vip_expansion_slot_device::program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) +uint8_t vip_expansion_slot_device::program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) { - UINT8 data = 0; + uint8_t data = 0; if (m_card != nullptr) { @@ -96,7 +96,7 @@ UINT8 vip_expansion_slot_device::program_r(address_space &space, offs_t offset, // program_w - program write //------------------------------------------------- -void vip_expansion_slot_device::program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +void vip_expansion_slot_device::program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) { if (m_card != nullptr) { @@ -109,9 +109,9 @@ void vip_expansion_slot_device::program_w(address_space &space, offs_t offset, U // io_r - io read //------------------------------------------------- -UINT8 vip_expansion_slot_device::io_r(address_space &space, offs_t offset) +uint8_t vip_expansion_slot_device::io_r(address_space &space, offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; if (m_card != nullptr) { @@ -126,7 +126,7 @@ UINT8 vip_expansion_slot_device::io_r(address_space &space, offs_t offset) // io_w - io write //------------------------------------------------- -void vip_expansion_slot_device::io_w(address_space &space, offs_t offset, UINT8 data) +void vip_expansion_slot_device::io_w(address_space &space, offs_t offset, uint8_t data) { if (m_card != nullptr) { @@ -139,9 +139,9 @@ void vip_expansion_slot_device::io_w(address_space &space, offs_t offset, UINT8 // dma_r - dma read //------------------------------------------------- -UINT8 vip_expansion_slot_device::dma_r(address_space &space, offs_t offset) +uint8_t vip_expansion_slot_device::dma_r(address_space &space, offs_t offset) { - UINT8 data = 0; + uint8_t data = 0; if (m_card != nullptr) { @@ -156,7 +156,7 @@ UINT8 vip_expansion_slot_device::dma_r(address_space &space, offs_t offset) // dma_w - dma write //------------------------------------------------- -void vip_expansion_slot_device::dma_w(address_space &space, offs_t offset, UINT8 data) +void vip_expansion_slot_device::dma_w(address_space &space, offs_t offset, uint8_t data) { if (m_card != nullptr) { @@ -169,7 +169,7 @@ void vip_expansion_slot_device::dma_w(address_space &space, offs_t offset, UINT8 // screen_update - //------------------------------------------------- -UINT32 vip_expansion_slot_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t vip_expansion_slot_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bool value = false; diff --git a/src/devices/bus/vip/exp.h b/src/devices/bus/vip/exp.h index 8aad60fafc8..6c9d65b5b12 100644 --- a/src/devices/bus/vip/exp.h +++ b/src/devices/bus/vip/exp.h @@ -81,20 +81,20 @@ class vip_expansion_slot_device : public device_t, { public: // construction/destruction - vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vip_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_int_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_int.set_callback(object); } template static devcb_base &set_dma_out_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_dma_out.set_callback(object); } template static devcb_base &set_dma_in_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_dma_in.set_callback(object); } // computer interface - UINT8 program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh); - void program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh); - UINT8 io_r(address_space &space, offs_t offset); - void io_w(address_space &space, offs_t offset, UINT8 data); - UINT8 dma_r(address_space &space, offs_t offset); - void dma_w(address_space &space, offs_t offset, UINT8 data); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint8_t program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh); + void program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh); + uint8_t io_r(address_space &space, offs_t offset); + void io_w(address_space &space, offs_t offset, uint8_t data); + uint8_t dma_r(address_space &space, offs_t offset); + void dma_w(address_space &space, offs_t offset, uint8_t data); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ_LINE_MEMBER( ef1_r ); DECLARE_READ_LINE_MEMBER( ef3_r ); DECLARE_READ_LINE_MEMBER( ef4_r ); @@ -131,16 +131,16 @@ public: protected: // runtime - virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) { return 0xff; }; - virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) { }; + virtual uint8_t vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) { return 0xff; }; + virtual void vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) { }; - virtual UINT8 vip_io_r(address_space &space, offs_t offset) { return 0xff; }; - virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t vip_io_r(address_space &space, offs_t offset) { return 0xff; }; + virtual void vip_io_w(address_space &space, offs_t offset, uint8_t data) { }; - virtual UINT8 vip_dma_r(address_space &space, offs_t offset) { return 0xff; }; - virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual uint8_t vip_dma_r(address_space &space, offs_t offset) { return 0xff; }; + virtual void vip_dma_w(address_space &space, offs_t offset, uint8_t data) { }; - virtual UINT32 vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } + virtual uint32_t vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } virtual int vip_ef1_r() { return CLEAR_LINE; } virtual int vip_ef3_r() { return CLEAR_LINE; } diff --git a/src/devices/bus/vip/vp550.cpp b/src/devices/bus/vip/vp550.cpp index dbf25a6a190..3d31b268c38 100644 --- a/src/devices/bus/vip/vp550.cpp +++ b/src/devices/bus/vip/vp550.cpp @@ -78,7 +78,7 @@ machine_config_constructor vp550_device::device_mconfig_additions() const // vp550_device - constructor //------------------------------------------------- -vp550_device::vp550_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vp550_device::vp550_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VP550, "VP550", tag, owner, clock, "vp550", __FILE__), device_vip_expansion_card_interface(mconfig, *this), m_pfg_a(*this, CDP1863_A_TAG), @@ -116,7 +116,7 @@ void vp550_device::device_timer(emu_timer &timer, device_timer_id id, int param, // vip_program_w - program write //------------------------------------------------- -void vp550_device::vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +void vp550_device::vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) { if (BIT(offset, 15)) { diff --git a/src/devices/bus/vip/vp550.h b/src/devices/bus/vip/vp550.h index 99ba25b64fd..9f3f5a74fc7 100644 --- a/src/devices/bus/vip/vp550.h +++ b/src/devices/bus/vip/vp550.h @@ -28,7 +28,7 @@ class vp550_device : public device_t, { public: // construction/destruction - vp550_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vp550_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; @@ -45,7 +45,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_vip_expansion_card_interface overrides - virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) override; + virtual void vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) override; virtual void vip_sc_w(int data) override; virtual void vip_q_w(int state) override; virtual void vip_run_w(int state) override; diff --git a/src/devices/bus/vip/vp570.cpp b/src/devices/bus/vip/vp570.cpp index 42ec4119c21..1b8852438e7 100644 --- a/src/devices/bus/vip/vp570.cpp +++ b/src/devices/bus/vip/vp570.cpp @@ -59,7 +59,7 @@ ioport_constructor vp570_device::device_input_ports() const // vp570_device - constructor //------------------------------------------------- -vp570_device::vp570_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vp570_device::vp570_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VP570, "VP570", tag, owner, clock, "vp570", __FILE__), device_vip_expansion_card_interface(mconfig, *this), m_ram(*this, "ram"), @@ -83,9 +83,9 @@ void vp570_device::device_start() // vip_program_r - program read //------------------------------------------------- -UINT8 vp570_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) +uint8_t vp570_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) { - UINT8 data = 0xff; + uint8_t data = 0xff; offs_t base = m_base->read() << 12; @@ -104,7 +104,7 @@ UINT8 vp570_device::vip_program_r(address_space &space, offs_t offset, int cs, i // vip_program_w - program write //------------------------------------------------- -void vp570_device::vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +void vp570_device::vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) { offs_t base = m_base->read() << 12; diff --git a/src/devices/bus/vip/vp570.h b/src/devices/bus/vip/vp570.h index 745b96cff95..befde726eec 100644 --- a/src/devices/bus/vip/vp570.h +++ b/src/devices/bus/vip/vp570.h @@ -27,7 +27,7 @@ class vp570_device : public device_t, { public: // construction/destruction - vp570_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vp570_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,11 +37,11 @@ protected: virtual void device_start() override; // device_vip_expansion_card_interface overrides - virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) override; - virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) override; + virtual uint8_t vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) override; + virtual void vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) override; private: - optional_shared_ptr m_ram; + optional_shared_ptr m_ram; required_ioport m_base; required_ioport m_sw1; }; diff --git a/src/devices/bus/vip/vp575.cpp b/src/devices/bus/vip/vp575.cpp index 680a2a14369..6eaa17289f8 100644 --- a/src/devices/bus/vip/vp575.cpp +++ b/src/devices/bus/vip/vp575.cpp @@ -92,7 +92,7 @@ machine_config_constructor vp575_device::device_mconfig_additions() const // vp575_device - constructor //------------------------------------------------- -vp575_device::vp575_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vp575_device::vp575_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VP575, "VP575", tag, owner, clock, "vp575", __FILE__), device_vip_expansion_card_interface(mconfig, *this) { @@ -124,9 +124,9 @@ void vp575_device::device_start() // vip_program_r - program read //------------------------------------------------- -UINT8 vp575_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) +uint8_t vp575_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (auto & elem : m_expansion_slot) { @@ -141,7 +141,7 @@ UINT8 vp575_device::vip_program_r(address_space &space, offs_t offset, int cs, i // vip_program_w - program write //------------------------------------------------- -void vp575_device::vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +void vp575_device::vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) { for (auto & elem : m_expansion_slot) { @@ -154,9 +154,9 @@ void vp575_device::vip_program_w(address_space &space, offs_t offset, UINT8 data // vip_io_r - I/O read //------------------------------------------------- -UINT8 vp575_device::vip_io_r(address_space &space, offs_t offset) +uint8_t vp575_device::vip_io_r(address_space &space, offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (auto & elem : m_expansion_slot) { @@ -171,7 +171,7 @@ UINT8 vp575_device::vip_io_r(address_space &space, offs_t offset) // vip_io_w - I/O write //------------------------------------------------- -void vp575_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) +void vp575_device::vip_io_w(address_space &space, offs_t offset, uint8_t data) { for (auto & elem : m_expansion_slot) { @@ -184,9 +184,9 @@ void vp575_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) // vip_dma_r - DMA read //------------------------------------------------- -UINT8 vp575_device::vip_dma_r(address_space &space, offs_t offset) +uint8_t vp575_device::vip_dma_r(address_space &space, offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (auto & elem : m_expansion_slot) { @@ -201,7 +201,7 @@ UINT8 vp575_device::vip_dma_r(address_space &space, offs_t offset) // vip_dma_w - DMA write //------------------------------------------------- -void vp575_device::vip_dma_w(address_space &space, offs_t offset, UINT8 data) +void vp575_device::vip_dma_w(address_space &space, offs_t offset, uint8_t data) { for (auto & elem : m_expansion_slot) { @@ -214,9 +214,9 @@ void vp575_device::vip_dma_w(address_space &space, offs_t offset, UINT8 data) // vip_screen_update - screen update //------------------------------------------------- -UINT32 vp575_device::vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t vp575_device::vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 data = 0; + uint32_t data = 0; for (auto & elem : m_expansion_slot) { diff --git a/src/devices/bus/vip/vp575.h b/src/devices/bus/vip/vp575.h index a91bf188aef..05671cda9f8 100644 --- a/src/devices/bus/vip/vp575.h +++ b/src/devices/bus/vip/vp575.h @@ -35,7 +35,7 @@ class vp575_device : public device_t, { public: // construction/destruction - vp575_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vp575_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,13 +66,13 @@ protected: virtual void device_start() override; // device_vip_expansion_card_interface overrides - virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) override; - virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) override; - virtual UINT8 vip_io_r(address_space &space, offs_t offset) override; - virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data) override; - virtual UINT8 vip_dma_r(address_space &space, offs_t offset) override; - virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data) override; - virtual UINT32 vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual uint8_t vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) override; + virtual void vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) override; + virtual uint8_t vip_io_r(address_space &space, offs_t offset) override; + virtual void vip_io_w(address_space &space, offs_t offset, uint8_t data) override; + virtual uint8_t vip_dma_r(address_space &space, offs_t offset) override; + virtual void vip_dma_w(address_space &space, offs_t offset, uint8_t data) override; + virtual uint32_t vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; virtual int vip_ef1_r() override; virtual int vip_ef3_r() override; virtual int vip_ef4_r() override; diff --git a/src/devices/bus/vip/vp585.cpp b/src/devices/bus/vip/vp585.cpp index 81d73634fe1..d913c0ce497 100644 --- a/src/devices/bus/vip/vp585.cpp +++ b/src/devices/bus/vip/vp585.cpp @@ -79,7 +79,7 @@ ioport_constructor vp585_device::device_input_ports() const // vp585_device - constructor //------------------------------------------------- -vp585_device::vp585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vp585_device::vp585_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VP585, "VP585", tag, owner, clock, "vp585", __FILE__), device_vip_expansion_card_interface(mconfig, *this), m_j1(*this, "J1"), @@ -103,7 +103,7 @@ void vp585_device::device_start() // vip_io_w - I/O write //------------------------------------------------- -void vp585_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) +void vp585_device::vip_io_w(address_space &space, offs_t offset, uint8_t data) { if (offset == 0x02) { diff --git a/src/devices/bus/vip/vp585.h b/src/devices/bus/vip/vp585.h index 8ae23737b64..2390f2b3ab3 100644 --- a/src/devices/bus/vip/vp585.h +++ b/src/devices/bus/vip/vp585.h @@ -27,7 +27,7 @@ class vp585_device : public device_t, { public: // construction/destruction - vp585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vp585_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // optional information overrides virtual ioport_constructor device_input_ports() const override; @@ -37,7 +37,7 @@ protected: virtual void device_start() override; // device_vip_expansion_card_interface overrides - virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data) override; + virtual void vip_io_w(address_space &space, offs_t offset, uint8_t data) override; virtual int vip_ef3_r() override; virtual int vip_ef4_r() override; @@ -45,7 +45,7 @@ private: required_ioport m_j1; required_ioport m_j2; - UINT8 m_keylatch; + uint8_t m_keylatch; }; diff --git a/src/devices/bus/vip/vp590.cpp b/src/devices/bus/vip/vp590.cpp index b9027a9c943..6f90c6d7473 100644 --- a/src/devices/bus/vip/vp590.cpp +++ b/src/devices/bus/vip/vp590.cpp @@ -136,7 +136,7 @@ ioport_constructor vp590_device::device_input_ports() const // vp590_device - constructor //------------------------------------------------- -vp590_device::vp590_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vp590_device::vp590_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VP590, "VP590", tag, owner, clock, "vp590", __FILE__), device_vip_expansion_card_interface(mconfig, *this), m_cgc(*this, CDP1862_TAG), @@ -167,11 +167,11 @@ void vp590_device::device_start() // vip_program_w - program write //------------------------------------------------- -void vp590_device::vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) +void vp590_device::vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) { if (offset >= 0xc000 && offset < 0xe000) { - UINT8 mask = 0xff; + uint8_t mask = 0xff; m_a12 = (offset & 0x1000) ? 1 : 0; @@ -193,7 +193,7 @@ void vp590_device::vip_program_w(address_space &space, offs_t offset, UINT8 data // vip_io_w - I/O write //------------------------------------------------- -void vp590_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) +void vp590_device::vip_io_w(address_space &space, offs_t offset, uint8_t data) { switch (offset) { @@ -213,9 +213,9 @@ void vp590_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) // vip_dma_w - DMA write //------------------------------------------------- -void vp590_device::vip_dma_w(address_space &space, offs_t offset, UINT8 data) +void vp590_device::vip_dma_w(address_space &space, offs_t offset, uint8_t data) { - UINT8 mask = 0xff; + uint8_t mask = 0xff; if (!m_a12) { @@ -233,7 +233,7 @@ void vp590_device::vip_dma_w(address_space &space, offs_t offset, UINT8 data) // vip_screen_update - screen update //------------------------------------------------- -UINT32 vp590_device::vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t vp590_device::vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_cgc->screen_update(screen, bitmap, cliprect); diff --git a/src/devices/bus/vip/vp590.h b/src/devices/bus/vip/vp590.h index fe006db8e6d..d01630f3c59 100644 --- a/src/devices/bus/vip/vp590.h +++ b/src/devices/bus/vip/vp590.h @@ -29,7 +29,7 @@ class vp590_device : public device_t, { public: // construction/destruction - vp590_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vp590_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; @@ -45,22 +45,22 @@ protected: virtual void device_start() override; // device_vip_expansion_card_interface overrides - virtual void vip_program_w(address_space &space, offs_t offset, UINT8 data, int cdef, int *minh) override; - virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data) override; - virtual void vip_dma_w(address_space &space, offs_t offset, UINT8 data) override; - virtual UINT32 vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual void vip_program_w(address_space &space, offs_t offset, uint8_t data, int cdef, int *minh) override; + virtual void vip_io_w(address_space &space, offs_t offset, uint8_t data) override; + virtual void vip_dma_w(address_space &space, offs_t offset, uint8_t data) override; + virtual uint32_t vip_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; virtual int vip_ef3_r() override; virtual int vip_ef4_r() override; private: required_device m_cgc; - optional_shared_ptr m_color_ram; + optional_shared_ptr m_color_ram; required_ioport m_j1; required_ioport m_j2; int m_a12; - UINT8 m_color; - UINT8 m_keylatch; + uint8_t m_color; + uint8_t m_keylatch; }; diff --git a/src/devices/bus/vip/vp595.cpp b/src/devices/bus/vip/vp595.cpp index d2ed10de18d..4e947245dd8 100644 --- a/src/devices/bus/vip/vp595.cpp +++ b/src/devices/bus/vip/vp595.cpp @@ -58,7 +58,7 @@ machine_config_constructor vp595_device::device_mconfig_additions() const // vp595_device - constructor //------------------------------------------------- -vp595_device::vp595_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vp595_device::vp595_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VP595, "VP595", tag, owner, clock, "vp595", __FILE__), device_vip_expansion_card_interface(mconfig, *this), m_pfg(*this, CDP1863_TAG) @@ -79,7 +79,7 @@ void vp595_device::device_start() // vip_io_w - I/O write //------------------------------------------------- -void vp595_device::vip_io_w(address_space &space, offs_t offset, UINT8 data) +void vp595_device::vip_io_w(address_space &space, offs_t offset, uint8_t data) { if (offset == 0x03) { diff --git a/src/devices/bus/vip/vp595.h b/src/devices/bus/vip/vp595.h index 43dcebd6d57..af1fde36094 100644 --- a/src/devices/bus/vip/vp595.h +++ b/src/devices/bus/vip/vp595.h @@ -28,7 +28,7 @@ class vp595_device : public device_t, { public: // construction/destruction - vp595_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vp595_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; @@ -38,7 +38,7 @@ protected: virtual void device_start() override; // device_vip_expansion_card_interface overrides - virtual void vip_io_w(address_space &space, offs_t offset, UINT8 data) override; + virtual void vip_io_w(address_space &space, offs_t offset, uint8_t data) override; virtual void vip_q_w(int state) override; private: diff --git a/src/devices/bus/vip/vp620.cpp b/src/devices/bus/vip/vp620.cpp index 42a00b37444..45353701f27 100644 --- a/src/devices/bus/vip/vp620.cpp +++ b/src/devices/bus/vip/vp620.cpp @@ -61,7 +61,7 @@ machine_config_constructor vp620_device::device_mconfig_additions() const // vp620_device - constructor //------------------------------------------------- -vp620_device::vp620_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vp620_device::vp620_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VP620, "VP620", tag, owner, clock, "vp620", __FILE__), device_vip_byteio_port_interface(mconfig, *this), m_keydata(0), @@ -83,7 +83,7 @@ void vp620_device::device_start() // vip_in_r - byte input read //------------------------------------------------- -UINT8 vp620_device::vip_in_r() +uint8_t vp620_device::vip_in_r() { return m_keydata; } diff --git a/src/devices/bus/vip/vp620.h b/src/devices/bus/vip/vp620.h index 036cf482e68..6d87bccc55e 100644 --- a/src/devices/bus/vip/vp620.h +++ b/src/devices/bus/vip/vp620.h @@ -28,7 +28,7 @@ class vp620_device : public device_t, { public: // construction/destruction - vp620_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vp620_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; @@ -41,11 +41,11 @@ protected: virtual void device_start() override; // device_vip_byteio_port_interface overrides - virtual UINT8 vip_in_r() override; + virtual uint8_t vip_in_r() override; virtual int vip_ef4_r() override; private: - UINT8 m_keydata; + uint8_t m_keydata; int m_keystb; }; diff --git a/src/devices/bus/vip/vp700.cpp b/src/devices/bus/vip/vp700.cpp index bfdfd488067..682913cfde4 100644 --- a/src/devices/bus/vip/vp700.cpp +++ b/src/devices/bus/vip/vp700.cpp @@ -45,7 +45,7 @@ const tiny_rom_entry *vp700_device::device_rom_region() const // vp700_device - constructor //------------------------------------------------- -vp700_device::vp700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vp700_device::vp700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VP700, "VP700", tag, owner, clock, "vp700", __FILE__), device_vip_expansion_card_interface(mconfig, *this), m_rom(*this, "vp700") @@ -66,9 +66,9 @@ void vp700_device::device_start() // vip_program_r - program read //------------------------------------------------- -UINT8 vp700_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) +uint8_t vp700_device::vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset < 0x1000) { diff --git a/src/devices/bus/vip/vp700.h b/src/devices/bus/vip/vp700.h index f3e515928a9..b305e27191d 100644 --- a/src/devices/bus/vip/vp700.h +++ b/src/devices/bus/vip/vp700.h @@ -28,7 +28,7 @@ class vp700_device : public device_t, { public: // construction/destruction - vp700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vp700_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; @@ -38,7 +38,7 @@ protected: virtual void device_start() override; // device_vip_expansion_card_interface overrides - virtual UINT8 vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) override; + virtual uint8_t vip_program_r(address_space &space, offs_t offset, int cs, int cdef, int *minh) override; private: required_memory_region m_rom; diff --git a/src/devices/bus/vtech/ioexp/ioexp.cpp b/src/devices/bus/vtech/ioexp/ioexp.cpp index 55671583558..4967e305c31 100644 --- a/src/devices/bus/vtech/ioexp/ioexp.cpp +++ b/src/devices/bus/vtech/ioexp/ioexp.cpp @@ -26,7 +26,7 @@ const device_type IOEXP_SLOT = &device_creator; // ioexp_slot_device - constructor //------------------------------------------------- -ioexp_slot_device::ioexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ioexp_slot_device::ioexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IOEXP_SLOT, "Peripheral Expansion Slot", tag, owner, clock, "ioexp_slot", __FILE__), device_slot_interface(mconfig, *this), m_io(nullptr), diff --git a/src/devices/bus/vtech/ioexp/ioexp.h b/src/devices/bus/vtech/ioexp/ioexp.h index bd98a4aaeb1..e00479761a0 100644 --- a/src/devices/bus/vtech/ioexp/ioexp.h +++ b/src/devices/bus/vtech/ioexp/ioexp.h @@ -51,7 +51,7 @@ class ioexp_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - ioexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ioexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~ioexp_slot_device(); void set_io_space(address_space *io); diff --git a/src/devices/bus/vtech/ioexp/joystick.cpp b/src/devices/bus/vtech/ioexp/joystick.cpp index 38e9732d17a..c9084f7559c 100644 --- a/src/devices/bus/vtech/ioexp/joystick.cpp +++ b/src/devices/bus/vtech/ioexp/joystick.cpp @@ -64,7 +64,7 @@ ioport_constructor joystick_interface_device::device_input_ports() const // joystick_interface_device - constructor //------------------------------------------------- -joystick_interface_device::joystick_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +joystick_interface_device::joystick_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JOYSTICK_INTERFACE, "Laser/VZ Joystick Interface", tag, owner, clock, "joystick", __FILE__), device_ioexp_interface(mconfig, *this), m_joy0(*this, "joystick_0"), @@ -98,7 +98,7 @@ void joystick_interface_device::device_reset() READ8_MEMBER( joystick_interface_device::joystick_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(offset, 0)) data &= m_joy0->read(); if (!BIT(offset, 1)) data &= m_joy0_arm->read(); diff --git a/src/devices/bus/vtech/ioexp/joystick.h b/src/devices/bus/vtech/ioexp/joystick.h index 1575dde42f2..30d1fdb4239 100644 --- a/src/devices/bus/vtech/ioexp/joystick.h +++ b/src/devices/bus/vtech/ioexp/joystick.h @@ -28,7 +28,7 @@ class joystick_interface_device : public device_t, public device_ioexp_interface { public: // construction/destruction - joystick_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + joystick_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( joystick_r ); diff --git a/src/devices/bus/vtech/ioexp/printer.cpp b/src/devices/bus/vtech/ioexp/printer.cpp index a122c9fa2c7..a80ab27ebdc 100644 --- a/src/devices/bus/vtech/ioexp/printer.cpp +++ b/src/devices/bus/vtech/ioexp/printer.cpp @@ -43,7 +43,7 @@ machine_config_constructor printer_interface_device::device_mconfig_additions() // printer_interface_device - constructor //------------------------------------------------- -printer_interface_device::printer_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +printer_interface_device::printer_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PRINTER_INTERFACE, "Laser/VZ Printer Interface", tag, owner, clock, "printer", __FILE__), device_ioexp_interface(mconfig, *this), m_centronics(*this, "centronics"), diff --git a/src/devices/bus/vtech/ioexp/printer.h b/src/devices/bus/vtech/ioexp/printer.h index 0f2b8746400..0b0e8dbe6e1 100644 --- a/src/devices/bus/vtech/ioexp/printer.h +++ b/src/devices/bus/vtech/ioexp/printer.h @@ -28,7 +28,7 @@ class printer_interface_device : public device_t, public device_ioexp_interface { public: // construction/destruction - printer_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + printer_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( busy_w ); DECLARE_READ8_MEMBER( busy_r ); diff --git a/src/devices/bus/vtech/memexp/floppy.cpp b/src/devices/bus/vtech/memexp/floppy.cpp index 6f3196f64e0..6da28bee463 100644 --- a/src/devices/bus/vtech/memexp/floppy.cpp +++ b/src/devices/bus/vtech/memexp/floppy.cpp @@ -67,7 +67,7 @@ machine_config_constructor floppy_controller_device::device_mconfig_additions() // floppy_controller_device - constructor //------------------------------------------------- -floppy_controller_device::floppy_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_controller_device::floppy_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FLOPPY_CONTROLLER, "Laser/VZ Floppy Disk Controller", tag, owner, clock, "laserfdc", __FILE__), device_memexp_interface(mconfig, *this), m_memexp(*this, "mem"), @@ -92,7 +92,7 @@ void floppy_controller_device::device_start() // TODO: save m_write_buffer and rebuild m_floppy after load - UINT8 *bios = memregion("software")->base(); + uint8_t *bios = memregion("software")->base(); // Obvious bugs... must have worked by sheer luck and very subtle // timings. Our current z80 is not subtle enough. @@ -138,7 +138,7 @@ void floppy_controller_device::device_reset() WRITE8_MEMBER(floppy_controller_device::latch_w) { - UINT8 diff = m_latch ^ data; + uint8_t diff = m_latch ^ data; m_latch = data; floppy_image_device *newflop = nullptr; diff --git a/src/devices/bus/vtech/memexp/floppy.h b/src/devices/bus/vtech/memexp/floppy.h index e12dea6ffb2..9daa4fe2ee7 100644 --- a/src/devices/bus/vtech/memexp/floppy.h +++ b/src/devices/bus/vtech/memexp/floppy.h @@ -29,7 +29,7 @@ class floppy_controller_device : public device_t, public device_memexp_interface { public: // construction/destruction - floppy_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + floppy_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_ADDRESS_MAP(map, 8); @@ -48,7 +48,7 @@ protected: required_device m_floppy0, m_floppy1; floppy_image_device *m_floppy; - UINT8 m_latch, m_shifter; + uint8_t m_latch, m_shifter; bool m_latching_inverter; int m_current_cyl; attotime m_last_latching_inverter_update_time; diff --git a/src/devices/bus/vtech/memexp/memexp.cpp b/src/devices/bus/vtech/memexp/memexp.cpp index 5b547103645..9415ea68320 100644 --- a/src/devices/bus/vtech/memexp/memexp.cpp +++ b/src/devices/bus/vtech/memexp/memexp.cpp @@ -26,7 +26,7 @@ const device_type MEMEXP_SLOT = &device_creator; // memexp_slot_device - constructor //------------------------------------------------- -memexp_slot_device::memexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +memexp_slot_device::memexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MEMEXP_SLOT, "Memory Expansion Slot", tag, owner, clock, "memexp_slot", __FILE__), device_slot_interface(mconfig, *this), m_program(nullptr), diff --git a/src/devices/bus/vtech/memexp/memexp.h b/src/devices/bus/vtech/memexp/memexp.h index 1026ddb2bba..ca2d677c724 100644 --- a/src/devices/bus/vtech/memexp/memexp.h +++ b/src/devices/bus/vtech/memexp/memexp.h @@ -67,7 +67,7 @@ class memexp_slot_device : public device_t, public device_slot_interface { public: // construction/destruction - memexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + memexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~memexp_slot_device(); void set_program_space(address_space *program); diff --git a/src/devices/bus/vtech/memexp/memory.cpp b/src/devices/bus/vtech/memexp/memory.cpp index 5b4b9d71701..b294f4a8ff8 100644 --- a/src/devices/bus/vtech/memexp/memory.cpp +++ b/src/devices/bus/vtech/memexp/memory.cpp @@ -27,7 +27,7 @@ const device_type LASER_64K = &device_creator; // laser110_16k_device - constructor //------------------------------------------------- -laser110_16k_device::laser110_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +laser110_16k_device::laser110_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LASER110_16K, "Laser 110/200/VZ-200 16k Memory", tag, owner, clock, "laser110_16k", __FILE__), device_memexp_interface(mconfig, *this) { @@ -60,7 +60,7 @@ void laser110_16k_device::device_reset() // laser210_16k_device - constructor //------------------------------------------------- -laser210_16k_device::laser210_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +laser210_16k_device::laser210_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LASER210_16K, "Laser 210/VZ-200 (DSE) 16k Memory", tag, owner, clock, "laser210_16k", __FILE__), device_memexp_interface(mconfig, *this) { @@ -93,7 +93,7 @@ void laser210_16k_device::device_reset() // laser310_16k_device - constructor //------------------------------------------------- -laser310_16k_device::laser310_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +laser310_16k_device::laser310_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LASER310_16K, "Laser 310/VZ-300 16k Memory", tag, owner, clock, "laser310_16k", __FILE__), device_memexp_interface(mconfig, *this) { @@ -126,7 +126,7 @@ void laser310_16k_device::device_reset() // laser_64k_device - constructor //------------------------------------------------- -laser_64k_device::laser_64k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +laser_64k_device::laser_64k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LASER_64K, "Laser/VZ 64k Memory", tag, owner, clock, "laser_64k", __FILE__), device_memexp_interface(mconfig, *this) { diff --git a/src/devices/bus/vtech/memexp/memory.h b/src/devices/bus/vtech/memexp/memory.h index 87518d20123..bfc727d652e 100644 --- a/src/devices/bus/vtech/memexp/memory.h +++ b/src/devices/bus/vtech/memexp/memory.h @@ -25,14 +25,14 @@ class laser110_16k_device : public device_t, public device_memexp_interface { public: // construction/destruction - laser110_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + laser110_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; virtual void device_reset() override; private: - std::vector m_ram; + std::vector m_ram; }; // ======================> laser210_16k_device @@ -41,14 +41,14 @@ class laser210_16k_device : public device_t, public device_memexp_interface { public: // construction/destruction - laser210_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + laser210_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; virtual void device_reset() override; private: - std::vector m_ram; + std::vector m_ram; }; // ======================> laser310_16k_device @@ -57,14 +57,14 @@ class laser310_16k_device : public device_t, public device_memexp_interface { public: // construction/destruction - laser310_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + laser310_16k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; virtual void device_reset() override; private: - std::vector m_ram; + std::vector m_ram; }; // ======================> laser_64k_device @@ -73,7 +73,7 @@ class laser_64k_device : public device_t, public device_memexp_interface { public: // construction/destruction - laser_64k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + laser_64k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( bankswitch_w ); @@ -82,7 +82,7 @@ protected: virtual void device_reset() override; private: - std::vector m_ram; + std::vector m_ram; }; // device type definition diff --git a/src/devices/bus/vtech/memexp/rs232.cpp b/src/devices/bus/vtech/memexp/rs232.cpp index 254664acbf7..1cac4d8212d 100644 --- a/src/devices/bus/vtech/memexp/rs232.cpp +++ b/src/devices/bus/vtech/memexp/rs232.cpp @@ -53,7 +53,7 @@ machine_config_constructor rs232_interface_device::device_mconfig_additions() co // rs232_interface_device - constructor //------------------------------------------------- -rs232_interface_device::rs232_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +rs232_interface_device::rs232_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RS232_INTERFACE, "DSE VZ-200/300 RS-232 Interface", tag, owner, clock, "vz_rs232", __FILE__), device_memexp_interface(mconfig, *this), m_rs232(*this, "rs232"), diff --git a/src/devices/bus/vtech/memexp/rs232.h b/src/devices/bus/vtech/memexp/rs232.h index eef273da255..f235670bb3d 100644 --- a/src/devices/bus/vtech/memexp/rs232.h +++ b/src/devices/bus/vtech/memexp/rs232.h @@ -26,7 +26,7 @@ class rs232_interface_device : public device_t, public device_memexp_interface { public: // construction/destruction - rs232_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rs232_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( rs232_rx_w ); DECLARE_READ8_MEMBER( receive_data_r ); diff --git a/src/devices/bus/vtech/memexp/rtty.cpp b/src/devices/bus/vtech/memexp/rtty.cpp index b44a81c370a..b1416fbdad1 100644 --- a/src/devices/bus/vtech/memexp/rtty.cpp +++ b/src/devices/bus/vtech/memexp/rtty.cpp @@ -38,7 +38,7 @@ const tiny_rom_entry *rtty_interface_device::device_rom_region() const // rtty_interface_device - constructor //------------------------------------------------- -rtty_interface_device::rtty_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +rtty_interface_device::rtty_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RTTY_INTERFACE, "DSE VZ-200/300 RTTY Interface", tag, owner, clock, "vz_rtty", __FILE__), device_memexp_interface(mconfig, *this) { diff --git a/src/devices/bus/vtech/memexp/rtty.h b/src/devices/bus/vtech/memexp/rtty.h index 1b96c611ece..fb65ce1f513 100644 --- a/src/devices/bus/vtech/memexp/rtty.h +++ b/src/devices/bus/vtech/memexp/rtty.h @@ -25,7 +25,7 @@ class rtty_interface_device : public device_t, public device_memexp_interface { public: // construction/destruction - rtty_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rtty_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( receive_data_r ); DECLARE_WRITE8_MEMBER( transmit_data_w ); diff --git a/src/devices/bus/vtech/memexp/wordpro.cpp b/src/devices/bus/vtech/memexp/wordpro.cpp index 1eb51c23d82..570fe3e431d 100644 --- a/src/devices/bus/vtech/memexp/wordpro.cpp +++ b/src/devices/bus/vtech/memexp/wordpro.cpp @@ -40,7 +40,7 @@ const tiny_rom_entry *wordpro_device::device_rom_region() const // wordpro_device - constructor //------------------------------------------------- -wordpro_device::wordpro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wordpro_device::wordpro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WORDPRO, "DSE VZ-300 WordPro", tag, owner, clock, "wordpro", __FILE__), device_memexp_interface(mconfig, *this) { diff --git a/src/devices/bus/vtech/memexp/wordpro.h b/src/devices/bus/vtech/memexp/wordpro.h index 288a7fb565d..51e5b412ab1 100644 --- a/src/devices/bus/vtech/memexp/wordpro.h +++ b/src/devices/bus/vtech/memexp/wordpro.h @@ -25,7 +25,7 @@ class wordpro_device : public device_t, public device_memexp_interface { public: // construction/destruction - wordpro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wordpro_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/devices/bus/wangpc/emb.cpp b/src/devices/bus/wangpc/emb.cpp index 43e1176e04c..5dbc2627382 100644 --- a/src/devices/bus/wangpc/emb.cpp +++ b/src/devices/bus/wangpc/emb.cpp @@ -43,7 +43,7 @@ const device_type WANGPC_EMB = &device_creator; // wangpc_emb_device - constructor //------------------------------------------------- -wangpc_emb_device::wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpc_emb_device::wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_EMB, "Wang PC-PM031-B", tag, owner, clock, "wangpc_emb", __FILE__), device_wangpcbus_card_interface(mconfig, *this), m_ram(*this, "ram"), m_option(0), m_parity_error(0), m_parity_odd(0) @@ -83,9 +83,9 @@ void wangpc_emb_device::device_reset() // wangpcbus_mrdc_r - memory read //------------------------------------------------- -UINT16 wangpc_emb_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_emb_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; for (int bank = 0; bank < 4; bank++) { @@ -103,7 +103,7 @@ UINT16 wangpc_emb_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, // wangpcbus_amwc_w - memory write //------------------------------------------------- -void wangpc_emb_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_emb_device::wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { for (int bank = 0; bank < 4; bank++) { @@ -119,9 +119,9 @@ void wangpc_emb_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UI // wangpcbus_iorc_r - I/O read //------------------------------------------------- -UINT16 wangpc_emb_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_emb_device::wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (sad(offset)) { @@ -147,7 +147,7 @@ UINT16 wangpc_emb_device::wangpcbus_iorc_r(address_space &space, offs_t offset, // wangpcbus_aiowc_w - I/O write //------------------------------------------------- -void wangpc_emb_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_emb_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (sad(offset)) { diff --git a/src/devices/bus/wangpc/emb.h b/src/devices/bus/wangpc/emb.h index f40f7fe4e1c..bf871947070 100644 --- a/src/devices/bus/wangpc/emb.h +++ b/src/devices/bus/wangpc/emb.h @@ -27,7 +27,7 @@ class wangpc_emb_device : public device_t, { public: // construction/destruction - wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -35,14 +35,14 @@ protected: virtual void device_reset() override; // device_wangpcbus_card_interface overrides - virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; - virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; + virtual uint16_t wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; + virtual uint16_t wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; private: - optional_shared_ptr m_ram; - UINT16 m_option; + optional_shared_ptr m_ram; + uint16_t m_option; int m_parity_error; int m_parity_odd; }; diff --git a/src/devices/bus/wangpc/lic.cpp b/src/devices/bus/wangpc/lic.cpp index c14dce7a5d3..171ab69bf04 100644 --- a/src/devices/bus/wangpc/lic.cpp +++ b/src/devices/bus/wangpc/lic.cpp @@ -73,7 +73,7 @@ machine_config_constructor wangpc_lic_device::device_mconfig_additions() const // wangpc_lic_device - constructor //------------------------------------------------- -wangpc_lic_device::wangpc_lic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpc_lic_device::wangpc_lic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_LIC, "Wang PC-PM070", tag, owner, clock, "wangpc_lic", __FILE__), device_wangpcbus_card_interface(mconfig, *this) { @@ -102,9 +102,9 @@ void wangpc_lic_device::device_reset() // wangpcbus_mrdc_r - memory read //------------------------------------------------- -UINT16 wangpc_lic_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_lic_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; return data; } @@ -114,7 +114,7 @@ UINT16 wangpc_lic_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, // wangpcbus_amwc_w - memory write //------------------------------------------------- -void wangpc_lic_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_lic_device::wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { } @@ -123,9 +123,9 @@ void wangpc_lic_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UI // wangpcbus_iorc_r - I/O read //------------------------------------------------- -UINT16 wangpc_lic_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_lic_device::wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (sad(offset)) { @@ -145,7 +145,7 @@ UINT16 wangpc_lic_device::wangpcbus_iorc_r(address_space &space, offs_t offset, // wangpcbus_aiowc_w - I/O write //------------------------------------------------- -void wangpc_lic_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_lic_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (sad(offset)) { diff --git a/src/devices/bus/wangpc/lic.h b/src/devices/bus/wangpc/lic.h index 071b26dde58..c5b49b6627d 100644 --- a/src/devices/bus/wangpc/lic.h +++ b/src/devices/bus/wangpc/lic.h @@ -27,7 +27,7 @@ class wangpc_lic_device : public device_t, { public: // construction/destruction - wangpc_lic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpc_lic_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; @@ -39,10 +39,10 @@ protected: virtual void device_reset() override; // device_wangpcbus_card_interface overrides - virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; - virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; + virtual uint16_t wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; + virtual uint16_t wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; }; diff --git a/src/devices/bus/wangpc/lvc.cpp b/src/devices/bus/wangpc/lvc.cpp index 7f7e0ebe25b..7fff3142240 100644 --- a/src/devices/bus/wangpc/lvc.cpp +++ b/src/devices/bus/wangpc/lvc.cpp @@ -60,7 +60,7 @@ MC6845_UPDATE_ROW( wangpc_lvc_device::crtc_update_row ) for (int column = 0; column < x_count; column++) { offs_t addr = scroll_y + (m_scroll & 0x3f) + ((ma / 80) * 0x480) + (((ra & 0x0f) << 7) | (column & 0x7f)); - UINT16 data = m_video_ram[addr & 0x7fff]; + uint16_t data = m_video_ram[addr & 0x7fff]; for (int bit = 0; bit < 8; bit++) { @@ -82,7 +82,7 @@ MC6845_UPDATE_ROW( wangpc_lvc_device::crtc_update_row ) for (int column = 0; column < x_count; column++) { - UINT32 data = (m_video_ram[(addr + 1) & 0x7fff] << 16) | m_video_ram[addr & 0x7fff]; + uint32_t data = (m_video_ram[(addr + 1) & 0x7fff] << 16) | m_video_ram[addr & 0x7fff]; for (int bit = 0; bit < 8; bit++) { @@ -166,7 +166,7 @@ inline void wangpc_lvc_device::set_irq(int state) // wangpc_lvc_device - constructor //------------------------------------------------- -wangpc_lvc_device::wangpc_lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpc_lvc_device::wangpc_lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_LVC, "Wang PC Low Resolution Video Card", tag, owner, clock, "wangpc_lvc", __FILE__), device_wangpcbus_card_interface(mconfig, *this), m_crtc(*this, MC6845_TAG), @@ -209,9 +209,9 @@ void wangpc_lvc_device::device_reset() // wangpcbus_mrdc_r - memory read //------------------------------------------------- -UINT16 wangpc_lvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_lvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (OPTION_VRAM && (offset >= 0xe0000/2) && (offset < 0xf0000/2)) { @@ -228,7 +228,7 @@ UINT16 wangpc_lvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, // wangpcbus_amwc_w - memory write //------------------------------------------------- -void wangpc_lvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_lvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (OPTION_VRAM && (offset >= 0xe0000/2) && (offset < 0xf0000/2)) { @@ -243,9 +243,9 @@ void wangpc_lvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UI // wangpcbus_iorc_r - I/O read //------------------------------------------------- -UINT16 wangpc_lvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_lvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (sad(offset)) { @@ -276,7 +276,7 @@ UINT16 wangpc_lvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, // wangpcbus_aiowc_w - I/O write //------------------------------------------------- -void wangpc_lvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_lvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (sad(offset)) { diff --git a/src/devices/bus/wangpc/lvc.h b/src/devices/bus/wangpc/lvc.h index ada6f261fd3..acd3f1e64cd 100644 --- a/src/devices/bus/wangpc/lvc.h +++ b/src/devices/bus/wangpc/lvc.h @@ -28,7 +28,7 @@ class wangpc_lvc_device : public device_t, { public: // construction/destruction - wangpc_lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpc_lvc_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; @@ -43,20 +43,20 @@ protected: virtual void device_reset() override; // device_wangpcbus_card_interface overrides - virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; - virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; + virtual uint16_t wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; + virtual uint16_t wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; private: inline void set_irq(int state); required_device m_crtc; - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; rgb_t m_palette[16]; - UINT8 m_option; - UINT16 m_scroll; + uint8_t m_option; + uint16_t m_scroll; int m_irq; }; diff --git a/src/devices/bus/wangpc/mcc.cpp b/src/devices/bus/wangpc/mcc.cpp index 37bd21dda25..3f4737e31ee 100644 --- a/src/devices/bus/wangpc/mcc.cpp +++ b/src/devices/bus/wangpc/mcc.cpp @@ -102,7 +102,7 @@ inline void wangpc_mcc_device::set_irq(int state) // wangpc_mcc_device - constructor //------------------------------------------------- -wangpc_mcc_device::wangpc_mcc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpc_mcc_device::wangpc_mcc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_MCC, "Wang PC-PM043", tag, owner, clock, "wangpc_mcc", __FILE__), device_wangpcbus_card_interface(mconfig, *this), m_sio(*this, Z80SIO2_TAG), @@ -138,9 +138,9 @@ void wangpc_mcc_device::device_reset() // wangpcbus_iorc_r - I/O read //------------------------------------------------- -UINT16 wangpc_mcc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_mcc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (sad(offset)) { @@ -207,7 +207,7 @@ UINT16 wangpc_mcc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, // wangpcbus_aiowc_w - I/O write //------------------------------------------------- -void wangpc_mcc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_mcc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (sad(offset) && ACCESSING_BITS_0_7) { diff --git a/src/devices/bus/wangpc/mcc.h b/src/devices/bus/wangpc/mcc.h index 54b0b868e45..6e00086cc1d 100644 --- a/src/devices/bus/wangpc/mcc.h +++ b/src/devices/bus/wangpc/mcc.h @@ -28,7 +28,7 @@ class wangpc_mcc_device : public device_t, { public: // construction/destruction - wangpc_mcc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpc_mcc_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; @@ -39,8 +39,8 @@ protected: virtual void device_reset() override; // device_wangpcbus_card_interface overrides - virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; + virtual uint16_t wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; private: inline void set_irq(int state); @@ -48,7 +48,7 @@ private: required_device m_sio; required_device m_dart; - UINT8 m_option; + uint8_t m_option; int m_irq; }; diff --git a/src/devices/bus/wangpc/mvc.cpp b/src/devices/bus/wangpc/mvc.cpp index ac5b09a0466..41643c21b87 100644 --- a/src/devices/bus/wangpc/mvc.cpp +++ b/src/devices/bus/wangpc/mvc.cpp @@ -71,7 +71,7 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row ) for (int sx = 0; sx < 50; sx++) { offs_t addr = (y * 50) + sx; - UINT16 data = m_bitmap_ram[addr]; + uint16_t data = m_bitmap_ram[addr]; for (int bit = 0; bit < 16; bit++) { @@ -86,10 +86,10 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row ) for (int column = 0; column < x_count; column++) { - UINT16 code = m_video_ram[((ma + column) & 0x7ff)]; - UINT8 attr = code & 0xff; + uint16_t code = m_video_ram[((ma + column) & 0x7ff)]; + uint8_t attr = code & 0xff; - UINT8 new_ra = ra + 1; + uint8_t new_ra = ra + 1; if (ATTR_SUPERSCRIPT) { @@ -101,7 +101,7 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row ) } offs_t addr = ((code >> 8) << 4) | (new_ra & 0x0f); - UINT16 data = m_char_ram[addr & 0xfff]; + uint16_t data = m_char_ram[addr & 0xfff]; if ((column == cursor_x) || (!ra && ATTR_OVERSCORE) || ((ra == 9) && ATTR_UNDERSCORE)) { @@ -186,7 +186,7 @@ inline void wangpc_mvc_device::set_irq(int state) // wangpc_mvc_device - constructor //------------------------------------------------- -wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_MVC, "Wang PC Medium Resolution Video Card", tag, owner, clock, "wangpc_mvc", __FILE__), device_wangpcbus_card_interface(mconfig, *this), m_crtc(*this, MC6845_TAG), @@ -232,9 +232,9 @@ void wangpc_mvc_device::device_reset() // wangpcbus_mrdc_r - memory read //------------------------------------------------- -UINT16 wangpc_mvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_mvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (OPTION_VRAM) { @@ -260,7 +260,7 @@ UINT16 wangpc_mvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, // wangpcbus_amwc_w - memory write //------------------------------------------------- -void wangpc_mvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_mvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (OPTION_VRAM) { @@ -284,9 +284,9 @@ void wangpc_mvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UI // wangpcbus_iorc_r - I/O read //------------------------------------------------- -UINT16 wangpc_mvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_mvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (sad(offset)) { @@ -308,7 +308,7 @@ UINT16 wangpc_mvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, // wangpcbus_aiowc_w - I/O write //------------------------------------------------- -void wangpc_mvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_mvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (sad(offset) && ACCESSING_BITS_0_7) { diff --git a/src/devices/bus/wangpc/mvc.h b/src/devices/bus/wangpc/mvc.h index eed98d499f0..a71891028e6 100644 --- a/src/devices/bus/wangpc/mvc.h +++ b/src/devices/bus/wangpc/mvc.h @@ -28,7 +28,7 @@ class wangpc_mvc_device : public device_t, { public: // construction/destruction - wangpc_mvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpc_mvc_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; @@ -43,20 +43,20 @@ protected: virtual void device_reset() override; // device_wangpcbus_card_interface overrides - virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; - virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; + virtual uint16_t wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; + virtual uint16_t wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; private: inline void set_irq(int state); required_device m_crtc; - optional_shared_ptr m_video_ram; - optional_shared_ptr m_char_ram; - optional_shared_ptr m_bitmap_ram; + optional_shared_ptr m_video_ram; + optional_shared_ptr m_char_ram; + optional_shared_ptr m_bitmap_ram; - UINT8 m_option; + uint8_t m_option; int m_irq; }; diff --git a/src/devices/bus/wangpc/rtc.cpp b/src/devices/bus/wangpc/rtc.cpp index 6f9ffb171c7..f22e71f4a93 100644 --- a/src/devices/bus/wangpc/rtc.cpp +++ b/src/devices/bus/wangpc/rtc.cpp @@ -185,7 +185,7 @@ ioport_constructor wangpc_rtc_device::device_input_ports() const // wangpc_rtc_device - constructor //------------------------------------------------- -wangpc_rtc_device::wangpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpc_rtc_device::wangpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_RTC, "Wang PC-PM040-B", tag, owner, clock, "wangpc_rtc", __FILE__), device_wangpcbus_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), @@ -221,9 +221,9 @@ void wangpc_rtc_device::device_reset() // wangpcbus_mrdc_r - memory read //------------------------------------------------- -UINT16 wangpc_rtc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_rtc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; return data; } @@ -233,7 +233,7 @@ UINT16 wangpc_rtc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, // wangpcbus_amwc_w - memory write //------------------------------------------------- -void wangpc_rtc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_rtc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { } @@ -242,9 +242,9 @@ void wangpc_rtc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UI // wangpcbus_iorc_r - I/O read //------------------------------------------------- -UINT16 wangpc_rtc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_rtc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (sad(offset)) { @@ -264,7 +264,7 @@ UINT16 wangpc_rtc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, // wangpcbus_aiowc_w - I/O write //------------------------------------------------- -void wangpc_rtc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_rtc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (sad(offset)) { diff --git a/src/devices/bus/wangpc/rtc.h b/src/devices/bus/wangpc/rtc.h index 3265e895f72..beb3841107a 100644 --- a/src/devices/bus/wangpc/rtc.h +++ b/src/devices/bus/wangpc/rtc.h @@ -31,7 +31,7 @@ class wangpc_rtc_device : public device_t, { public: // construction/destruction - wangpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpc_rtc_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; @@ -44,10 +44,10 @@ protected: virtual void device_reset() override; // device_wangpcbus_card_interface overrides - virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; - virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; + virtual uint16_t wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; + virtual uint16_t wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; private: required_device m_maincpu; @@ -55,7 +55,7 @@ private: required_device m_ctc0; required_device m_ctc1; required_device m_sio; - optional_shared_ptr m_char_ram; + optional_shared_ptr m_char_ram; }; diff --git a/src/devices/bus/wangpc/tig.cpp b/src/devices/bus/wangpc/tig.cpp index c808ac69622..cc51120f379 100644 --- a/src/devices/bus/wangpc/tig.cpp +++ b/src/devices/bus/wangpc/tig.cpp @@ -150,7 +150,7 @@ machine_config_constructor wangpc_tig_device::device_mconfig_additions() const // wangpc_tig_device - constructor //------------------------------------------------- -wangpc_tig_device::wangpc_tig_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpc_tig_device::wangpc_tig_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_TIG, "Wang PC TIG Controller", tag, owner, clock, "wangpc_tig", __FILE__), device_wangpcbus_card_interface(mconfig, *this), m_hgdc0(*this, UPD7720_0_TAG), @@ -188,7 +188,7 @@ void wangpc_tig_device::device_reset() // screen_update - //------------------------------------------------- -UINT32 wangpc_tig_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t wangpc_tig_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_hgdc0->screen_update(screen, bitmap, cliprect); m_hgdc1->screen_update(screen, bitmap, cliprect); @@ -201,9 +201,9 @@ UINT32 wangpc_tig_device::screen_update(screen_device &screen, bitmap_rgb32 &bit // wangpcbus_iorc_r - I/O read //------------------------------------------------- -UINT16 wangpc_tig_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_tig_device::wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (sad(offset)) { @@ -233,7 +233,7 @@ UINT16 wangpc_tig_device::wangpcbus_iorc_r(address_space &space, offs_t offset, // wangpcbus_aiowc_w - I/O write //------------------------------------------------- -void wangpc_tig_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_tig_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (sad(offset) && ACCESSING_BITS_0_7) { @@ -280,9 +280,9 @@ void wangpc_tig_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, U // wangpcbus_dack_r - DMA read //------------------------------------------------- -UINT8 wangpc_tig_device::wangpcbus_dack_r(address_space &space, int line) +uint8_t wangpc_tig_device::wangpcbus_dack_r(address_space &space, int line) { - UINT8 data; + uint8_t data; if (DMA_GRAPHICS) { @@ -301,7 +301,7 @@ UINT8 wangpc_tig_device::wangpcbus_dack_r(address_space &space, int line) // wangpcbus_dack_w - DMA write //------------------------------------------------- -void wangpc_tig_device::wangpcbus_dack_w(address_space &space, int line, UINT8 data) +void wangpc_tig_device::wangpcbus_dack_w(address_space &space, int line, uint8_t data) { if (DMA_GRAPHICS) { diff --git a/src/devices/bus/wangpc/tig.h b/src/devices/bus/wangpc/tig.h index fd9d3fc12a0..3a954c45ec2 100644 --- a/src/devices/bus/wangpc/tig.h +++ b/src/devices/bus/wangpc/tig.h @@ -28,12 +28,12 @@ class wangpc_tig_device : public device_t, { public: // construction/destruction - wangpc_tig_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpc_tig_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; virtual machine_config_constructor device_mconfig_additions() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UPD7220_DRAW_TEXT_LINE_MEMBER( hgdc_draw_text ); UPD7220_DISPLAY_PIXELS_MEMBER( hgdc_display_pixels ); @@ -44,10 +44,10 @@ protected: virtual void device_reset() override; // device_wangpcbus_card_interface overrides - virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; - virtual UINT8 wangpcbus_dack_r(address_space &space, int line) override; - virtual void wangpcbus_dack_w(address_space &space, int line, UINT8 data) override; + virtual uint16_t wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; + virtual uint8_t wangpcbus_dack_r(address_space &space, int line) override; + virtual void wangpcbus_dack_w(address_space &space, int line, uint8_t data) override; virtual bool wangpcbus_have_dack(int line) override; private: @@ -55,9 +55,9 @@ private: required_device m_hgdc0; required_device m_hgdc1; - UINT8 m_option; - UINT8 m_attr[16]; - UINT8 m_underline; + uint8_t m_option; + uint8_t m_attr[16]; + uint8_t m_underline; required_device m_palette; }; diff --git a/src/devices/bus/wangpc/wangpc.cpp b/src/devices/bus/wangpc/wangpc.cpp index d3aebaf1fac..846ce086756 100644 --- a/src/devices/bus/wangpc/wangpc.cpp +++ b/src/devices/bus/wangpc/wangpc.cpp @@ -26,7 +26,7 @@ const device_type WANGPC_BUS_SLOT = &device_creator; // wangpcbus_slot_device - constructor //------------------------------------------------- -wangpcbus_slot_device::wangpcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpcbus_slot_device::wangpcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_BUS_SLOT, "Wang PC bus slot", tag, owner, clock, "wangpcbus_slot", __FILE__), device_slot_interface(mconfig, *this), m_bus(nullptr), @@ -57,7 +57,7 @@ void wangpcbus_slot_device::device_start() // wangpcbus_device - constructor //------------------------------------------------- -wangpcbus_device::wangpcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpcbus_device::wangpcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_BUS, "Wang PC bus", tag, owner, clock, "wangpcbus", __FILE__), m_write_irq2(*this), m_write_irq3(*this), @@ -112,7 +112,7 @@ void wangpcbus_device::add_card(device_wangpcbus_card_interface *card, int sid) READ16_MEMBER( wangpcbus_device::mrdc_r ) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; device_wangpcbus_card_interface *entry = m_device_list.first(); @@ -148,7 +148,7 @@ WRITE16_MEMBER( wangpcbus_device::amwc_w ) READ16_MEMBER( wangpcbus_device::sad_r ) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; device_wangpcbus_card_interface *entry = m_device_list.first(); @@ -182,9 +182,9 @@ WRITE16_MEMBER( wangpcbus_device::sad_w ) // dack_r - DMA read //------------------------------------------------- -UINT8 wangpcbus_device::dack_r(address_space &space, int line) +uint8_t wangpcbus_device::dack_r(address_space &space, int line) { - UINT8 retVal = 0xff; + uint8_t retVal = 0xff; device_wangpcbus_card_interface *entry = m_device_list.first(); while (entry) @@ -206,7 +206,7 @@ UINT8 wangpcbus_device::dack_r(address_space &space, int line) // dack_w - DMA write //------------------------------------------------- -void wangpcbus_device::dack_w(address_space &space, int line, UINT8 data) +void wangpcbus_device::dack_w(address_space &space, int line, uint8_t data) { device_wangpcbus_card_interface *entry = m_device_list.first(); diff --git a/src/devices/bus/wangpc/wangpc.h b/src/devices/bus/wangpc/wangpc.h index e892cc3b880..ddcbe326b57 100644 --- a/src/devices/bus/wangpc/wangpc.h +++ b/src/devices/bus/wangpc/wangpc.h @@ -83,7 +83,7 @@ class wangpcbus_slot_device : public device_t, { public: // construction/destruction - wangpcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -111,7 +111,7 @@ class wangpcbus_device : public device_t { public: // construction/destruction - wangpcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~wangpcbus_device() { m_device_list.detach_all(); } template static devcb_base &set_irq2_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq2.set_callback(object); } @@ -134,8 +134,8 @@ public: DECLARE_READ16_MEMBER( sad_r ); DECLARE_WRITE16_MEMBER( sad_w ); - UINT8 dack_r(address_space &space, int line); - void dack_w(address_space &space, int line, UINT8 data); + uint8_t dack_r(address_space &space, int line); + void dack_w(address_space &space, int line, uint8_t data); DECLARE_READ8_MEMBER( dack0_r ) { return dack_r(space, 0); } DECLARE_WRITE8_MEMBER( dack0_w ) { dack_w(space, 0, data); } @@ -199,17 +199,17 @@ public: device_wangpcbus_card_interface *next() const { return m_next; } // memory access - virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) { return 0; }; - virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) { }; + virtual uint16_t wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) { return 0; }; + virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { }; // I/O access - virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) { return 0; }; - virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) { }; + virtual uint16_t wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) { return 0; }; + virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { }; bool sad(offs_t offset) { return ((offset & 0xf80) == (0x800 | (m_sid << 7))) ? true : false; } // DMA - virtual UINT8 wangpcbus_dack_r(address_space &space, int line) { return 0; } - virtual void wangpcbus_dack_w(address_space &space, int line, UINT8 data) { } + virtual uint8_t wangpcbus_dack_r(address_space &space, int line) { return 0; } + virtual void wangpcbus_dack_w(address_space &space, int line, uint8_t data) { } virtual void wangpcbus_tc_w(int state) { } virtual bool wangpcbus_have_dack(int line) { return false; } diff --git a/src/devices/bus/wangpc/wdc.cpp b/src/devices/bus/wangpc/wdc.cpp index 740a16e5c8c..7bfb7337729 100644 --- a/src/devices/bus/wangpc/wdc.cpp +++ b/src/devices/bus/wangpc/wdc.cpp @@ -141,7 +141,7 @@ inline void wangpc_wdc_device::set_irq(int state) // wangpc_wdc_device - constructor //------------------------------------------------- -wangpc_wdc_device::wangpc_wdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wangpc_wdc_device::wangpc_wdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WANGPC_WDC, "Wang PC-PM001", tag, owner, clock, "wangpc_wdc", __FILE__), device_wangpcbus_card_interface(mconfig, *this), m_maincpu(*this, Z80_TAG), @@ -180,9 +180,9 @@ void wangpc_wdc_device::device_reset() // wangpcbus_mrdc_r - memory read //------------------------------------------------- -UINT16 wangpc_wdc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_wdc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; return data; } @@ -192,7 +192,7 @@ UINT16 wangpc_wdc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, // wangpcbus_amwc_w - memory write //------------------------------------------------- -void wangpc_wdc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_wdc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { } @@ -201,9 +201,9 @@ void wangpc_wdc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UI // wangpcbus_iorc_r - I/O read //------------------------------------------------- -UINT16 wangpc_wdc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) +uint16_t wangpc_wdc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (sad(offset)) { @@ -235,7 +235,7 @@ UINT16 wangpc_wdc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, // wangpcbus_aiowc_w - I/O write //------------------------------------------------- -void wangpc_wdc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) +void wangpc_wdc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) { if (sad(offset) && ACCESSING_BITS_0_7) { @@ -270,7 +270,7 @@ void wangpc_wdc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, U // wangpcbus_dack_r - DMA acknowledge read //------------------------------------------------- -UINT8 wangpc_wdc_device::wangpcbus_dack_r(address_space &space, int line) +uint8_t wangpc_wdc_device::wangpcbus_dack_r(address_space &space, int line) { return 0; } @@ -280,7 +280,7 @@ UINT8 wangpc_wdc_device::wangpcbus_dack_r(address_space &space, int line) // wangpcbus_dack_r - DMA acknowledge write //------------------------------------------------- -void wangpc_wdc_device::wangpcbus_dack_w(address_space &space, int line, UINT8 data) +void wangpc_wdc_device::wangpcbus_dack_w(address_space &space, int line, uint8_t data) { } diff --git a/src/devices/bus/wangpc/wdc.h b/src/devices/bus/wangpc/wdc.h index 7657c77dfe2..5cf3dbc8092 100644 --- a/src/devices/bus/wangpc/wdc.h +++ b/src/devices/bus/wangpc/wdc.h @@ -30,7 +30,7 @@ class wangpc_wdc_device : public device_t, { public: // construction/destruction - wangpc_wdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wangpc_wdc_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; @@ -54,12 +54,12 @@ protected: virtual void device_reset() override; // device_wangpcbus_card_interface overrides - virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; - virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask) override; - virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data) override; - virtual UINT8 wangpcbus_dack_r(address_space &space, int line) override; - virtual void wangpcbus_dack_w(address_space &space, int line, UINT8 data) override; + virtual uint16_t wangpcbus_mrdc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; + virtual uint16_t wangpcbus_iorc_r(address_space &space, offs_t offset, uint16_t mem_mask) override; + virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, uint16_t mem_mask, uint16_t data) override; + virtual uint8_t wangpcbus_dack_r(address_space &space, int line) override; + virtual void wangpcbus_dack_w(address_space &space, int line, uint8_t data) override; virtual bool wangpcbus_have_dack(int line) override; private: @@ -68,8 +68,8 @@ private: required_device m_maincpu; required_device m_ctc; - UINT8 m_status; - UINT8 m_option; + uint8_t m_status; + uint8_t m_option; int m_irq; }; diff --git a/src/devices/bus/wswan/rom.cpp b/src/devices/bus/wswan/rom.cpp index 5dbe1e5c7bf..e95585dd08f 100644 --- a/src/devices/bus/wswan/rom.cpp +++ b/src/devices/bus/wswan/rom.cpp @@ -26,7 +26,7 @@ const device_type WS_ROM_SRAM = &device_creator; const device_type WS_ROM_EEPROM = &device_creator; -ws_rom_device::ws_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : +ws_rom_device::ws_rom_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_ws_cart_interface(mconfig, *this), m_base20(0), @@ -45,7 +45,7 @@ ws_rom_device::ws_rom_device(const machine_config &mconfig, device_type type, co { } -ws_rom_device::ws_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ws_rom_device::ws_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WS_ROM_STD, "Wonderswan Standard Carts", tag, owner, clock, "ws_rom", __FILE__), device_ws_cart_interface( mconfig, *this ), m_base20(0), m_base30(0), @@ -63,13 +63,13 @@ ws_rom_device::ws_rom_device(const machine_config &mconfig, const char *tag, dev { } -ws_rom_sram_device::ws_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ws_rom_sram_device::ws_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ws_rom_device(mconfig, WS_ROM_SRAM, "Wonderswan Carts w/SRAM", tag, owner, clock, "ws_sram", __FILE__), m_nvram_base(0) { } -ws_rom_eeprom_device::ws_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ws_rom_eeprom_device::ws_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ws_rom_device(mconfig, WS_ROM_EEPROM, "Wonderswan Carts w/EEPROM", tag, owner, clock, "ws_eeprom", __FILE__), m_eeprom_mode(0), m_eeprom_address(0), m_eeprom_command(0), m_eeprom_start(0), m_eeprom_write_enabled(0) { @@ -238,7 +238,7 @@ READ8_MEMBER(ws_rom_device::read_rom40) READ8_MEMBER(ws_rom_device::read_io) { - UINT8 value = m_io_regs[offset]; + uint8_t value = m_io_regs[offset]; switch (offset) { @@ -381,7 +381,7 @@ WRITE8_MEMBER(ws_rom_sram_device::write_io) READ8_MEMBER(ws_rom_eeprom_device::read_io) { - UINT8 value = m_io_regs[offset]; + uint8_t value = m_io_regs[offset]; switch (offset) { diff --git a/src/devices/bus/wswan/rom.h b/src/devices/bus/wswan/rom.h index e3a15550e73..9197cf98911 100644 --- a/src/devices/bus/wswan/rom.h +++ b/src/devices/bus/wswan/rom.h @@ -13,8 +13,8 @@ class ws_rom_device : public device_t, { public: // construction/destruction - ws_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - ws_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ws_rom_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); + ws_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -29,19 +29,19 @@ public: virtual DECLARE_WRITE8_MEMBER(write_io) override; protected: - UINT8 m_io_regs[0x10]; - UINT32 m_base20, m_base30, m_base40; + uint8_t m_io_regs[0x10]; + uint32_t m_base20, m_base30, m_base40; // RTC - UINT8 m_rtc_setting; /* Timer setting byte */ - UINT8 m_rtc_year; /* Year */ - UINT8 m_rtc_month; /* Month */ - UINT8 m_rtc_day; /* Day */ - UINT8 m_rtc_day_of_week; /* Day of the week */ - UINT8 m_rtc_hour; /* Hour, high bit = 0 => AM, high bit = 1 => PM */ - UINT8 m_rtc_minute; /* Minute */ - UINT8 m_rtc_second; /* Second */ - UINT8 m_rtc_index; /* index for reading/writing of current of alarm time */ + uint8_t m_rtc_setting; /* Timer setting byte */ + uint8_t m_rtc_year; /* Year */ + uint8_t m_rtc_month; /* Month */ + uint8_t m_rtc_day; /* Day */ + uint8_t m_rtc_day_of_week; /* Day of the week */ + uint8_t m_rtc_hour; /* Hour, high bit = 0 => AM, high bit = 1 => PM */ + uint8_t m_rtc_minute; /* Minute */ + uint8_t m_rtc_second; /* Second */ + uint8_t m_rtc_index; /* index for reading/writing of current of alarm time */ static const device_timer_id TIMER_RTC = 0; emu_timer *rtc_timer; @@ -54,7 +54,7 @@ class ws_rom_sram_device : public ws_rom_device { public: // construction/destruction - ws_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ws_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -66,7 +66,7 @@ public: virtual DECLARE_WRITE8_MEMBER(write_io) override; private: - UINT32 m_nvram_base; + uint32_t m_nvram_base; }; @@ -76,7 +76,7 @@ class ws_rom_eeprom_device : public ws_rom_device { public: // construction/destruction - ws_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ws_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -87,11 +87,11 @@ public: virtual DECLARE_WRITE8_MEMBER(write_io) override; private: - UINT8 m_eeprom_mode; /* eeprom mode */ - UINT16 m_eeprom_address; /* Read/write address */ - UINT8 m_eeprom_command; /* Commands: 00, 01, 02, 03, 04, 08, 0C */ - UINT8 m_eeprom_start; /* start bit */ - UINT8 m_eeprom_write_enabled; /* write enabled yes/no */ + uint8_t m_eeprom_mode; /* eeprom mode */ + uint16_t m_eeprom_address; /* Read/write address */ + uint8_t m_eeprom_command; /* Commands: 00, 01, 02, 03, 04, 08, 0C */ + uint8_t m_eeprom_start; /* start bit */ + uint8_t m_eeprom_write_enabled; /* write enabled yes/no */ }; diff --git a/src/devices/bus/wswan/slot.cpp b/src/devices/bus/wswan/slot.cpp index abfa903a6a3..de0b0393179 100644 --- a/src/devices/bus/wswan/slot.cpp +++ b/src/devices/bus/wswan/slot.cpp @@ -48,7 +48,7 @@ device_ws_cart_interface::~device_ws_cart_interface() // rom_alloc - alloc the space for the cart //------------------------------------------------- -void device_ws_cart_interface::rom_alloc(UINT32 size, const char *tag) +void device_ws_cart_interface::rom_alloc(uint32_t size, const char *tag) { if (m_rom == nullptr) { @@ -63,7 +63,7 @@ void device_ws_cart_interface::rom_alloc(UINT32 size, const char *tag) // nvram_alloc - alloc the space for the ram //------------------------------------------------- -void device_ws_cart_interface::nvram_alloc(UINT32 size) +void device_ws_cart_interface::nvram_alloc(uint32_t size) { m_nvram.resize(size); } @@ -76,7 +76,7 @@ void device_ws_cart_interface::nvram_alloc(UINT32 size) //------------------------------------------------- // ws_cart_slot_device - constructor //------------------------------------------------- -ws_cart_slot_device::ws_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ws_cart_slot_device::ws_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WS_CART_SLOT, "Wonderswan Cartridge Slot", tag, owner, clock, "ws_cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -164,9 +164,9 @@ image_init_result ws_cart_slot_device::call_load() { if (m_cart) { - UINT8 *ROM; - UINT32 size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); - UINT32 nvram_size = 0; + uint8_t *ROM; + uint32_t size = (software_entry() == nullptr) ? length() : get_software_region_length("rom"); + uint32_t nvram_size = 0; m_cart->rom_alloc(size, tag()); ROM = m_cart->get_rom_base(); @@ -241,7 +241,7 @@ void ws_cart_slot_device::call_unload() get cart type from cart file -------------------------------------------------*/ -int ws_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len, UINT32 &nvram_len) +int ws_cart_slot_device::get_cart_type(uint8_t *ROM, uint32_t len, uint32_t &nvram_len) { int chunks = len / 0x10000; int type = WS_STD; @@ -300,10 +300,10 @@ std::string ws_cart_slot_device::get_default_card_software() if (open_image_file(mconfig().options())) { const char *slot_string; - UINT32 size = m_file->size(); - std::vector rom(size); + uint32_t size = m_file->size(); + std::vector rom(size); int type; - UINT32 nvram; + uint32_t nvram; m_file->read(&rom[0], size); @@ -410,10 +410,10 @@ static const char *const sram_str[] = { "none", "64Kbit SRAM", "256Kbit SRAM", " static const char *const eeprom_str[] = { "none", "1Kbit EEPROM", "16Kbit EEPROM", "Unknown", "Unknown", "8Kbit EEPROM" }; static const char *const romsize_str[] = { "Unknown", "Unknown", "4Mbit", "8Mbit", "16Mbit", "Unknown", "32Mbit", "Unknown", "64Mbit", "128Mbit" }; -void ws_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 offs, UINT32 len) +void ws_cart_slot_device::internal_header_logging(uint8_t *ROM, uint32_t offs, uint32_t len) { int sum = 0, banks = len / 0x10000; - UINT8 romsize, ramtype, ramsize; + uint8_t romsize, ramtype, ramsize; romsize = ROM[offs + 0xfffa]; ramtype = (ROM[offs + 0xfffb] & 0xf0) ? 1 : 0; // 1 = EEPROM, 0 = SRAM ramsize = ramtype ? ((ROM[offs + 0xfffb] & 0xf0) >> 4) : (ROM[offs + 0xfffb] & 0x0f); diff --git a/src/devices/bus/wswan/slot.h b/src/devices/bus/wswan/slot.h index 36ac1c43bc6..bdf67a58c3c 100644 --- a/src/devices/bus/wswan/slot.h +++ b/src/devices/bus/wswan/slot.h @@ -38,12 +38,12 @@ public: virtual DECLARE_READ8_MEMBER(read_io) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write_io) {} - void rom_alloc(UINT32 size, const char *tag); - void nvram_alloc(UINT32 size); - UINT8* get_rom_base() { return m_rom; } - UINT8* get_nvram_base() { return &m_nvram[0]; } - UINT32 get_rom_size() { return m_rom_size; } - UINT32 get_nvram_size() { return m_nvram.size(); } + void rom_alloc(uint32_t size, const char *tag); + void nvram_alloc(uint32_t size); + uint8_t* get_rom_base() { return m_rom; } + uint8_t* get_nvram_base() { return &m_nvram[0]; } + uint32_t get_rom_size() { return m_rom_size; } + uint32_t get_nvram_size() { return m_nvram.size(); } void save_nvram() { device().save_item(NAME(m_nvram)); } void set_has_rtc(bool val) { m_has_rtc = val; } @@ -52,9 +52,9 @@ public: protected: // internal state - UINT8 *m_rom; - UINT32 m_rom_size; - std::vector m_nvram; + uint8_t *m_rom; + uint32_t m_rom_size; + std::vector m_nvram; int m_bank_mask; bool m_has_rtc, m_is_rotated; @@ -69,7 +69,7 @@ class ws_cart_slot_device : public device_t, { public: // construction/destruction - ws_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ws_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~ws_cart_slot_device(); // device-level overrides @@ -83,8 +83,8 @@ public: int get_type() { return m_type; } int get_is_rotated() { return m_cart->get_is_rotated(); } - int get_cart_type(UINT8 *ROM, UINT32 len, UINT32 &nvram_len); - void internal_header_logging(UINT8 *ROM, UINT32 offs, UINT32 len); + int get_cart_type(uint8_t *ROM, uint32_t len, uint32_t &nvram_len); + void internal_header_logging(uint8_t *ROM, uint32_t offs, uint32_t len); void save_nvram() { if (m_cart && m_cart->get_nvram_size()) m_cart->save_nvram(); } diff --git a/src/devices/bus/x68k/x68k_neptunex.cpp b/src/devices/bus/x68k/x68k_neptunex.cpp index 1b97427be3e..e8e2c8b8199 100644 --- a/src/devices/bus/x68k/x68k_neptunex.cpp +++ b/src/devices/bus/x68k/x68k_neptunex.cpp @@ -28,7 +28,7 @@ machine_config_constructor x68k_neptune_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( x68k_neptunex ); } -x68k_neptune_device::x68k_neptune_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +x68k_neptune_device::x68k_neptune_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, X68K_NEPTUNEX, "Neptune-X", tag, owner, clock, "x68k_neptunex", __FILE__), device_x68k_expansion_card_interface(mconfig, *this), m_slot(nullptr), @@ -44,7 +44,7 @@ void x68k_neptune_device::device_start() { device_t* cpu = machine().device("maincpu"); char mac[7]; - UINT32 num = rand(); + uint32_t num = rand(); address_space& space = cpu->memory().space(AS_PROGRAM); m_slot = dynamic_cast(owner()); memset(m_prom, 0x57, 16); @@ -61,7 +61,7 @@ void x68k_neptune_device::device_reset() { READ16_MEMBER(x68k_neptune_device::x68k_neptune_port_r) { - UINT16 data; + uint16_t data; if(offset >= 0x100+32 || offset < 0x100) return 0xffff; diff --git a/src/devices/bus/x68k/x68k_neptunex.h b/src/devices/bus/x68k/x68k_neptunex.h index 6700f1bea3b..2f6c49bceaf 100644 --- a/src/devices/bus/x68k/x68k_neptunex.h +++ b/src/devices/bus/x68k/x68k_neptunex.h @@ -24,7 +24,7 @@ class x68k_neptune_device : public device_t, { public: // construction/destruction - x68k_neptune_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + x68k_neptune_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; @@ -44,8 +44,8 @@ private: x68k_expansion_slot_device *m_slot; required_device m_dp8390; - UINT8 m_board_ram[16*1024]; - UINT8 m_prom[16]; + uint8_t m_board_ram[16*1024]; + uint8_t m_prom[16]; }; // device type definition diff --git a/src/devices/bus/x68k/x68k_scsiext.cpp b/src/devices/bus/x68k/x68k_scsiext.cpp index e6414a4a9b5..2036fb414e4 100644 --- a/src/devices/bus/x68k/x68k_scsiext.cpp +++ b/src/devices/bus/x68k/x68k_scsiext.cpp @@ -56,7 +56,7 @@ machine_config_constructor x68k_scsiext_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME( x68k_scsiext ); } -x68k_scsiext_device::x68k_scsiext_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +x68k_scsiext_device::x68k_scsiext_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, X68K_SCSIEXT, "Sharp CZ-6BS1 SCSI-1", tag, owner, clock, "x68k_cz6bs1", __FILE__), device_x68k_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_spc(*this, "mb89352") @@ -66,7 +66,7 @@ x68k_scsiext_device::x68k_scsiext_device(const machine_config &mconfig, const ch void x68k_scsiext_device::device_start() { device_t* cpu = machine().device("maincpu"); - UINT8* ROM; + uint8_t* ROM; address_space& space = cpu->memory().space(AS_PROGRAM); m_slot = dynamic_cast(owner()); space.install_read_bank(0xea0020,0xea1fff,"scsi_ext"); diff --git a/src/devices/bus/x68k/x68k_scsiext.h b/src/devices/bus/x68k/x68k_scsiext.h index 3477daa7ad3..e772ede4d86 100644 --- a/src/devices/bus/x68k/x68k_scsiext.h +++ b/src/devices/bus/x68k/x68k_scsiext.h @@ -18,7 +18,7 @@ class x68k_scsiext_device : public device_t, { public: // construction/destruction - x68k_scsiext_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + x68k_scsiext_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; diff --git a/src/devices/bus/x68k/x68kexp.cpp b/src/devices/bus/x68k/x68kexp.cpp index 7019498fa23..94484ac3ea1 100644 --- a/src/devices/bus/x68k/x68kexp.cpp +++ b/src/devices/bus/x68k/x68kexp.cpp @@ -33,7 +33,7 @@ device_x68k_expansion_card_interface::~device_x68k_expansion_card_interface() // LIVE DEVICE //************************************************************************** -x68k_expansion_slot_device::x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +x68k_expansion_slot_device::x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, X68K_EXPANSION_SLOT, "Sharp X680x0 expansion slot", tag, owner, clock, "x68k_expansion_slot", __FILE__), device_slot_interface(mconfig, *this), m_out_irq2_cb(*this), diff --git a/src/devices/bus/x68k/x68kexp.h b/src/devices/bus/x68k/x68kexp.h index b3a07242180..824a5868d42 100644 --- a/src/devices/bus/x68k/x68kexp.h +++ b/src/devices/bus/x68k/x68kexp.h @@ -115,7 +115,7 @@ class x68k_expansion_slot_device : public device_t, { public: // construction/destruction - x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + x68k_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~x68k_expansion_slot_device(); template static devcb_base &set_out_irq2_callback(device_t &device, _Object object) { return downcast(device).m_out_irq2_cb.set_callback(object); } diff --git a/src/devices/bus/z88/flash.cpp b/src/devices/bus/z88/flash.cpp index 03b18d98f35..ea6337a9c2f 100644 --- a/src/devices/bus/z88/flash.cpp +++ b/src/devices/bus/z88/flash.cpp @@ -41,7 +41,7 @@ MACHINE_CONFIG_END // z88_1024k_flash_device - constructor //------------------------------------------------- -z88_1024k_flash_device::z88_1024k_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z88_1024k_flash_device::z88_1024k_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z88_1024K_FLASH, "Z88 1024KB Flash", tag, owner, clock, "z88_1024k_flash", __FILE__), device_z88cart_interface( mconfig, *this ), m_flash(*this, FLASH_TAG) @@ -70,7 +70,7 @@ machine_config_constructor z88_1024k_flash_device::device_mconfig_additions() co get_cart_base -------------------------------------------------*/ -UINT8* z88_1024k_flash_device::get_cart_base() +uint8_t* z88_1024k_flash_device::get_cart_base() { return m_flash->base(); } diff --git a/src/devices/bus/z88/flash.h b/src/devices/bus/z88/flash.h index 37fe76e2f99..76dc4d18c76 100644 --- a/src/devices/bus/z88/flash.h +++ b/src/devices/bus/z88/flash.h @@ -20,7 +20,7 @@ class z88_1024k_flash_device : public device_t, { public: // construction/destruction - z88_1024k_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z88_1024k_flash_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; @@ -32,8 +32,8 @@ protected: // z88cart_interface overrides virtual DECLARE_READ8_MEMBER(read) override; virtual DECLARE_WRITE8_MEMBER(write) override; - virtual UINT8* get_cart_base() override; - virtual UINT32 get_cart_size() override { return 0x100000; } + virtual uint8_t* get_cart_base() override; + virtual uint32_t get_cart_size() override { return 0x100000; } private: required_device m_flash; diff --git a/src/devices/bus/z88/ram.cpp b/src/devices/bus/z88/ram.cpp index b9c8cc6cea7..08f70d46b16 100644 --- a/src/devices/bus/z88/ram.cpp +++ b/src/devices/bus/z88/ram.cpp @@ -32,13 +32,13 @@ const device_type Z88_1024K_RAM = &device_creator; // z88_32k_ram_device - constructor //------------------------------------------------- -z88_32k_ram_device::z88_32k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z88_32k_ram_device::z88_32k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z88_32K_RAM, "Z88 32KB RAM", tag, owner, clock, "z88_32k_ram", __FILE__), device_z88cart_interface( mconfig, *this ), m_ram(nullptr) { } -z88_32k_ram_device::z88_32k_ram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +z88_32k_ram_device::z88_32k_ram_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_z88cart_interface( mconfig, *this ), m_ram(nullptr) { @@ -48,7 +48,7 @@ z88_32k_ram_device::z88_32k_ram_device(const machine_config &mconfig, device_typ // z88_128k_ram_device - constructor //------------------------------------------------- -z88_128k_ram_device::z88_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z88_128k_ram_device::z88_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z88_32k_ram_device(mconfig, Z88_128K_RAM, "Z88 128KB RAM", tag, owner, clock, "z88_128k_ram", __FILE__) { } @@ -57,7 +57,7 @@ z88_128k_ram_device::z88_128k_ram_device(const machine_config &mconfig, const ch // z88_512k_ram_device - constructor //------------------------------------------------- -z88_512k_ram_device::z88_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z88_512k_ram_device::z88_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z88_32k_ram_device(mconfig, Z88_512K_RAM, "Z88 512KB RAM", tag, owner, clock, "z88_512k_ram", __FILE__) { } @@ -66,7 +66,7 @@ z88_512k_ram_device::z88_512k_ram_device(const machine_config &mconfig, const ch // z88_1024k_ram_device - constructor //------------------------------------------------- -z88_1024k_ram_device::z88_1024k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z88_1024k_ram_device::z88_1024k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z88_32k_ram_device(mconfig, Z88_1024K_RAM, "Z88 1024KB RAM", tag, owner, clock, "z88_1024k_ram", __FILE__) { } @@ -86,7 +86,7 @@ void z88_32k_ram_device::device_start() get_cart_base -------------------------------------------------*/ -UINT8* z88_32k_ram_device::get_cart_base() +uint8_t* z88_32k_ram_device::get_cart_base() { return m_ram; } diff --git a/src/devices/bus/z88/ram.h b/src/devices/bus/z88/ram.h index d8515a6b9c0..d30be0a9968 100644 --- a/src/devices/bus/z88/ram.h +++ b/src/devices/bus/z88/ram.h @@ -19,8 +19,8 @@ class z88_32k_ram_device : public device_t, { public: // construction/destruction - z88_32k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - z88_32k_ram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + z88_32k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + z88_32k_ram_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: // device-level overrides @@ -29,12 +29,12 @@ protected: // z88cart_interface overrides virtual DECLARE_READ8_MEMBER(read) override; virtual DECLARE_WRITE8_MEMBER(write) override; - virtual UINT8* get_cart_base() override; - virtual UINT32 get_cart_size() override { return 0x8000; } + virtual uint8_t* get_cart_base() override; + virtual uint32_t get_cart_size() override { return 0x8000; } protected: // internal state - UINT8 * m_ram; + uint8_t * m_ram; }; // ======================> z88_128k_ram_device @@ -43,11 +43,11 @@ class z88_128k_ram_device : public z88_32k_ram_device { public: // construction/destruction - z88_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z88_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // z88cart_interface overrides - virtual UINT32 get_cart_size() override { return 0x20000; } + virtual uint32_t get_cart_size() override { return 0x20000; } }; // ======================> z88_512k_ram_device @@ -56,11 +56,11 @@ class z88_512k_ram_device : public z88_32k_ram_device { public: // construction/destruction - z88_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z88_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // z88cart_interface overrides - virtual UINT32 get_cart_size() override { return 0x80000; } + virtual uint32_t get_cart_size() override { return 0x80000; } }; // ======================> z88_1024k_ram_device @@ -69,11 +69,11 @@ class z88_1024k_ram_device : public z88_32k_ram_device { public: // construction/destruction - z88_1024k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z88_1024k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // z88cart_interface overrides - virtual UINT32 get_cart_size() override { return 0x100000; } + virtual uint32_t get_cart_size() override { return 0x100000; } }; // device type definition diff --git a/src/devices/bus/z88/rom.cpp b/src/devices/bus/z88/rom.cpp index 08f14011c9d..6ec8fb0b773 100644 --- a/src/devices/bus/z88/rom.cpp +++ b/src/devices/bus/z88/rom.cpp @@ -31,13 +31,13 @@ const device_type Z88_256K_ROM = &device_creator; // z88_32k_rom_device - constructor //------------------------------------------------- -z88_32k_rom_device::z88_32k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z88_32k_rom_device::z88_32k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z88_32K_ROM, "Z88 32KB ROM", tag, owner, clock, "z88_32k_rom", __FILE__), device_z88cart_interface( mconfig, *this ), m_rom(nullptr) { } -z88_32k_rom_device::z88_32k_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +z88_32k_rom_device::z88_32k_rom_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_z88cart_interface( mconfig, *this ), m_rom(nullptr) { @@ -47,7 +47,7 @@ z88_32k_rom_device::z88_32k_rom_device(const machine_config &mconfig, device_typ // z88_128k_rom_device - constructor //------------------------------------------------- -z88_128k_rom_device::z88_128k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z88_128k_rom_device::z88_128k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z88_32k_rom_device(mconfig, Z88_128K_ROM, "Z88 128KB ROM", tag, owner, clock, "z88_128k_rom", __FILE__) { } @@ -56,7 +56,7 @@ z88_128k_rom_device::z88_128k_rom_device(const machine_config &mconfig, const ch // z88_256k_rom_device - constructor //------------------------------------------------- -z88_256k_rom_device::z88_256k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z88_256k_rom_device::z88_256k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z88_32k_rom_device(mconfig, Z88_256K_ROM, "Z88 256KB ROM", tag, owner, clock, "z88_256k_rom", __FILE__) { } @@ -74,7 +74,7 @@ void z88_32k_rom_device::device_start() get_cart_base -------------------------------------------------*/ -UINT8* z88_32k_rom_device::get_cart_base() +uint8_t* z88_32k_rom_device::get_cart_base() { return m_rom; } diff --git a/src/devices/bus/z88/rom.h b/src/devices/bus/z88/rom.h index 8ebc4da3bc8..5997bd47cee 100644 --- a/src/devices/bus/z88/rom.h +++ b/src/devices/bus/z88/rom.h @@ -19,8 +19,8 @@ class z88_32k_rom_device : public device_t, { public: // construction/destruction - z88_32k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - z88_32k_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + z88_32k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + z88_32k_rom_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: // device-level overrides @@ -28,12 +28,12 @@ protected: // z88cart_interface overrides virtual DECLARE_READ8_MEMBER(read) override; - virtual UINT8* get_cart_base() override; - virtual UINT32 get_cart_size() override { return 0x8000; } + virtual uint8_t* get_cart_base() override; + virtual uint32_t get_cart_size() override { return 0x8000; } protected: // internal state - UINT8 * m_rom; + uint8_t * m_rom; }; // ======================> z88_128k_rom_device @@ -42,11 +42,11 @@ class z88_128k_rom_device : public z88_32k_rom_device { public: // construction/destruction - z88_128k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z88_128k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // z88cart_interface overrides - virtual UINT32 get_cart_size() override { return 0x20000; } + virtual uint32_t get_cart_size() override { return 0x20000; } }; // ======================> z88_256k_rom_device @@ -55,11 +55,11 @@ class z88_256k_rom_device : public z88_32k_rom_device { public: // construction/destruction - z88_256k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z88_256k_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // z88cart_interface overrides - virtual UINT32 get_cart_size() override { return 0x200000; } + virtual uint32_t get_cart_size() override { return 0x200000; } }; // device type definition diff --git a/src/devices/bus/z88/z88.cpp b/src/devices/bus/z88/z88.cpp index 036aa7c4134..ac6b1b7d101 100644 --- a/src/devices/bus/z88/z88.cpp +++ b/src/devices/bus/z88/z88.cpp @@ -55,7 +55,7 @@ device_z88cart_interface::~device_z88cart_interface() //------------------------------------------------- // z88cart_slot_device - constructor //------------------------------------------------- -z88cart_slot_device::z88cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +z88cart_slot_device::z88cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z88CART_SLOT, "Z88 Cartridge Slot", tag, owner, clock, "z88cart_slot", __FILE__), device_image_interface(mconfig, *this), device_slot_interface(mconfig, *this), @@ -121,7 +121,7 @@ image_init_result z88cart_slot_device::call_load() if (m_cart) { offs_t read_length; - UINT8 *cart_base = m_cart->get_cart_base(); + uint8_t *cart_base = m_cart->get_cart_base(); if (cart_base != nullptr) { diff --git a/src/devices/bus/z88/z88.h b/src/devices/bus/z88/z88.h index 73d64575976..9d6a76c4edd 100644 --- a/src/devices/bus/z88/z88.h +++ b/src/devices/bus/z88/z88.h @@ -73,8 +73,8 @@ public: // reading and writing virtual DECLARE_READ8_MEMBER(read) { return 0xff; } virtual DECLARE_WRITE8_MEMBER(write) { } - virtual UINT8* get_cart_base() { return nullptr; } - virtual UINT32 get_cart_size() { return 0; } + virtual uint8_t* get_cart_base() { return nullptr; } + virtual uint32_t get_cart_size() { return 0; } }; @@ -86,7 +86,7 @@ class z88cart_slot_device : public device_t, { public: // construction/destruction - z88cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z88cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~z88cart_slot_device(); template static devcb_base &set_out_flp_callback(device_t &device, _Object object) { return downcast(device).m_out_flp_cb.set_callback(object); } diff --git a/src/devices/cpu/8x300/8x300.cpp b/src/devices/cpu/8x300/8x300.cpp index 58a9077fd9d..9800d6bf57e 100644 --- a/src/devices/cpu/8x300/8x300.cpp +++ b/src/devices/cpu/8x300/8x300.cpp @@ -39,14 +39,14 @@ const device_type N8X300 = &device_creator; -n8x300_cpu_device::n8x300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +n8x300_cpu_device::n8x300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, N8X300, "Signetics 8X300", tag, owner, clock, "8x300", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 16, 14, 0) , m_io_config("io", ENDIANNESS_BIG, 8, 9, 0) { } -void n8x300_cpu_device::set_reg(UINT8 reg, UINT8 val) +void n8x300_cpu_device::set_reg(uint8_t reg, uint8_t val) { switch(reg) { @@ -65,7 +65,7 @@ void n8x300_cpu_device::set_reg(UINT8 reg, UINT8 val) } } -UINT8 n8x300_cpu_device::get_reg(UINT8 reg) +uint8_t n8x300_cpu_device::get_reg(uint8_t reg) { switch(reg) { @@ -158,12 +158,12 @@ void n8x300_cpu_device::execute_run() { do { - UINT16 opcode; - UINT8 src; - UINT8 dst; - UINT8 rotlen; // rotate amount or I/O field length - UINT8 mask; - UINT16 result; + uint16_t opcode; + uint8_t src; + uint8_t dst; + uint8_t rotlen; // rotate amount or I/O field length + uint8_t mask; + uint16_t result; /* fetch the opcode */ debugger_instruction_hook(this, m_genPC); @@ -543,7 +543,7 @@ void n8x300_cpu_device::execute_run() } while (m_icount > 0); } -offs_t n8x300_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t n8x300_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( n8x300 ); return CPU_DISASSEMBLE_NAME(n8x300)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/8x300/8x300.h b/src/devices/cpu/8x300/8x300.h index 0ba76e30d20..ef34c7b00b8 100644 --- a/src/devices/cpu/8x300/8x300.h +++ b/src/devices/cpu/8x300/8x300.h @@ -43,7 +43,7 @@ class n8x300_cpu_device : public cpu_device { public: // construction/destruction - n8x300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + n8x300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -51,9 +51,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -68,9 +68,9 @@ protected: } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; address_space_config m_io_config; @@ -81,53 +81,53 @@ protected: direct_read_data *m_direct; address_space *m_io; - UINT16 m_PC; // Program Counter - UINT16 m_AR; // Address Register - UINT16 m_IR; // Instruction Register - UINT8 m_AUX; // Auxiliary Register (second operand for AND, ADD, XOR) - UINT8 m_R1; - UINT8 m_R2; - UINT8 m_R3; - UINT8 m_R4; - UINT8 m_R5; - UINT8 m_R6; - UINT8 m_R11; - UINT8 m_IVL; // Interface vector (I/O) left bank (write-only) - UINT8 m_IVR; // Interface vector (I/O) right bank (write-only) - UINT8 m_OVF; // Overflow register (read-only) - UINT16 m_genPC; - - UINT8 m_left_IV; // IV bank contents, these are latched when IVL or IVR are set - UINT8 m_right_IV; + uint16_t m_PC; // Program Counter + uint16_t m_AR; // Address Register + uint16_t m_IR; // Instruction Register + uint8_t m_AUX; // Auxiliary Register (second operand for AND, ADD, XOR) + uint8_t m_R1; + uint8_t m_R2; + uint8_t m_R3; + uint8_t m_R4; + uint8_t m_R5; + uint8_t m_R6; + uint8_t m_R11; + uint8_t m_IVL; // Interface vector (I/O) left bank (write-only) + uint8_t m_IVR; // Interface vector (I/O) right bank (write-only) + uint8_t m_OVF; // Overflow register (read-only) + uint16_t m_genPC; + + uint8_t m_left_IV; // IV bank contents, these are latched when IVL or IVR are set + uint8_t m_right_IV; private: - inline bool is_rot(UINT16 opcode) + inline bool is_rot(uint16_t opcode) { if((opcode & 0x1000) || (opcode & 0x0010)) return false; else return true; } - inline bool is_src_reg(UINT16 opcode) + inline bool is_src_reg(uint16_t opcode) { if((opcode & 0x1000)) return false; else return true; } - inline bool is_dst_reg(UINT16 opcode) + inline bool is_dst_reg(uint16_t opcode) { if((opcode & 0x0010)) return false; else return true; } - inline UINT8 rotate(UINT8 s, UINT8 n) // right rotate + inline uint8_t rotate(uint8_t s, uint8_t n) // right rotate { - return ((s & ((UINT8)0xff << n)) >> n) | ((s & ((UINT8)0xff >> (8-n))) << (8-n)); + return ((s & ((uint8_t)0xff << n)) >> n) | ((s & ((uint8_t)0xff >> (8-n))) << (8-n)); } - void set_reg(UINT8 reg,UINT8 val); - UINT8 get_reg(UINT8 reg); + void set_reg(uint8_t reg,uint8_t val); + uint8_t get_reg(uint8_t reg); }; extern const device_type N8X300; diff --git a/src/devices/cpu/8x300/8x300dasm.cpp b/src/devices/cpu/8x300/8x300dasm.cpp index eb65e735162..562dbaf4693 100644 --- a/src/devices/cpu/8x300/8x300dasm.cpp +++ b/src/devices/cpu/8x300/8x300dasm.cpp @@ -25,7 +25,7 @@ static const char *reg_names[32] = }; // determines if right rotate or I/O field length is to be used -static inline bool is_rot(UINT16 opcode) +static inline bool is_rot(uint16_t opcode) { if((opcode & 0x1000) || (opcode & 0x0010)) return false; @@ -33,7 +33,7 @@ static inline bool is_rot(UINT16 opcode) return true; } -static inline bool is_src_rot(UINT16 opcode) +static inline bool is_src_rot(uint16_t opcode) { if((opcode & 0x1000)) return false; @@ -45,8 +45,8 @@ CPU_DISASSEMBLE( n8x300 ) { char tmp[16]; unsigned startpc = pc; - UINT16 opcode = (oprom[pc - startpc] << 8) | oprom[pc+1 - startpc]; - UINT8 inst = opcode >> 13; + uint16_t opcode = (oprom[pc - startpc] << 8) | oprom[pc+1 - startpc]; + uint8_t inst = opcode >> 13; pc+=2; // determine instruction diff --git a/src/devices/cpu/adsp2100/2100ops.hxx b/src/devices/cpu/adsp2100/2100ops.hxx index c52767bd9cf..7143b90fb67 100644 --- a/src/devices/cpu/adsp2100/2100ops.hxx +++ b/src/devices/cpu/adsp2100/2100ops.hxx @@ -49,7 +49,7 @@ #define CALC_NZVC_SUB(s,d,r) CLR_FLAGS; CALC_N(r); CALC_Z(r); CALC_V(s,d,r); CALC_C_SUB(r) /* ADSP-218x constants */ -static const INT32 constants[] = +static const int32_t constants[] = { 0x0001, 0xfffe, 0x0002, 0xfffd, 0x0004, 0xfffb, 0x0008, 0xfff7, 0x0010, 0xffef, 0x0020, 0xffdf, 0x0040, 0xffbf, 0x0080, 0xff7f, @@ -112,7 +112,7 @@ inline void adsp21xx_device::update_mstat() PC stack handlers ===========================================================================*/ -inline UINT32 adsp21xx_device::pc_stack_top() +inline uint32_t adsp21xx_device::pc_stack_top() { if (m_pc_sp > 0) return m_pc_stack[m_pc_sp - 1]; @@ -120,7 +120,7 @@ inline UINT32 adsp21xx_device::pc_stack_top() return m_pc_stack[0]; } -inline void adsp21xx_device::set_pc_stack_top(UINT32 top) +inline void adsp21xx_device::set_pc_stack_top(uint32_t top) { if (m_pc_sp > 0) m_pc_stack[m_pc_sp - 1] = top; @@ -140,7 +140,7 @@ inline void adsp21xx_device::pc_stack_push() m_sstat |= PC_OVER; } -inline void adsp21xx_device::pc_stack_push_val(UINT32 val) +inline void adsp21xx_device::pc_stack_push_val(uint32_t val) { if (m_pc_sp < PC_STACK_DEPTH) { @@ -163,7 +163,7 @@ inline void adsp21xx_device::pc_stack_pop() m_pc = m_pc_stack[m_pc_sp]; } -inline UINT32 adsp21xx_device::pc_stack_pop_val() +inline uint32_t adsp21xx_device::pc_stack_pop_val() { if (m_pc_sp > 0) { @@ -179,7 +179,7 @@ inline UINT32 adsp21xx_device::pc_stack_pop_val() CNTR stack handlers ===========================================================================*/ -inline UINT32 adsp21xx_device::cntr_stack_top() +inline uint32_t adsp21xx_device::cntr_stack_top() { if (m_cntr_sp > 0) return m_cntr_stack[m_cntr_sp - 1]; @@ -215,7 +215,7 @@ inline void adsp21xx_device::cntr_stack_pop() LOOP stack handlers ===========================================================================*/ -inline UINT32 adsp21xx_device::loop_stack_top() +inline uint32_t adsp21xx_device::loop_stack_top() { if (m_loop_sp > 0) return m_loop_stack[m_loop_sp - 1]; @@ -223,7 +223,7 @@ inline UINT32 adsp21xx_device::loop_stack_top() return m_loop_stack[0]; } -inline void adsp21xx_device::loop_stack_push(UINT32 value) +inline void adsp21xx_device::loop_stack_push(uint32_t value) { if (m_loop_sp < LOOP_STACK_DEPTH) { @@ -311,7 +311,7 @@ inline int adsp21xx_device::condition(int c) int adsp21xx_device::slow_condition() { - if ((INT32)--m_cntr > 0) + if ((int32_t)--m_cntr > 0) return 1; else { @@ -337,7 +337,7 @@ inline void adsp21xx_device::update_l(int which) m_base[which] = m_i[which] & m_lmask[which]; } -void adsp21xx_device::write_reg0(int regnum, INT32 val) +void adsp21xx_device::write_reg0(int regnum, int32_t val) { switch (regnum) { @@ -350,17 +350,17 @@ void adsp21xx_device::write_reg0(int regnum, INT32 val) case 0x06: m_core.my0.s = val; break; case 0x07: m_core.my1.s = val; break; case 0x08: m_core.si.s = val; break; - case 0x09: m_core.se.s = (INT8)val; break; + case 0x09: m_core.se.s = (int8_t)val; break; case 0x0a: m_core.ar.s = val; break; case 0x0b: m_core.mr.mrx.mr0.s = val; break; - case 0x0c: m_core.mr.mrx.mr1.s = val; m_core.mr.mrx.mr2.s = (INT16)val >> 15; break; - case 0x0d: m_core.mr.mrx.mr2.s = (INT8)val; break; + case 0x0c: m_core.mr.mrx.mr1.s = val; m_core.mr.mrx.mr2.s = (int16_t)val >> 15; break; + case 0x0d: m_core.mr.mrx.mr2.s = (int8_t)val; break; case 0x0e: m_core.sr.srx.sr0.s = val; break; case 0x0f: m_core.sr.srx.sr1.s = val; break; } } -void adsp21xx_device::write_reg1(int regnum, INT32 val) +void adsp21xx_device::write_reg1(int regnum, int32_t val) { int index = regnum & 3; switch (regnum >> 2) @@ -371,7 +371,7 @@ void adsp21xx_device::write_reg1(int regnum, INT32 val) break; case 1: - m_m[index] = (INT32)(val << 18) >> 18; + m_m[index] = (int32_t)(val << 18) >> 18; break; case 2: @@ -389,7 +389,7 @@ void adsp21xx_device::write_reg1(int regnum, INT32 val) } } -void adsp21xx_device::write_reg2(int regnum, INT32 val) +void adsp21xx_device::write_reg2(int regnum, int32_t val) { int index = 4 + (regnum & 3); switch (regnum >> 2) @@ -400,7 +400,7 @@ void adsp21xx_device::write_reg2(int regnum, INT32 val) break; case 1: - m_m[index] = (INT32)(val << 18) >> 18; + m_m[index] = (int32_t)(val << 18) >> 18; break; case 2: @@ -414,7 +414,7 @@ void adsp21xx_device::write_reg2(int regnum, INT32 val) } } -void adsp21xx_device::write_reg3(int regnum, INT32 val) +void adsp21xx_device::write_reg3(int regnum, int32_t val) { switch (regnum) { @@ -423,7 +423,7 @@ void adsp21xx_device::write_reg3(int regnum, INT32 val) case 0x03: m_imask = val & m_imask_mask; check_irqs(); break; case 0x04: m_icntl = val & 0x001f; check_irqs(); break; case 0x05: cntr_stack_push(); m_cntr = val & 0x3fff; break; - case 0x06: m_core.sb.s = (INT32)(val << 27) >> 27; break; + case 0x06: m_core.sb.s = (int32_t)(val << 27) >> 27; break; case 0x07: m_px = val; break; case 0x09: if (!m_sport_tx_cb.isnull()) m_sport_tx_cb(0, val, 0xffff); break; case 0x0b: if (!m_sport_tx_cb.isnull()) m_sport_tx_cb(1, val, 0xffff); break; @@ -479,22 +479,22 @@ void adsp21xx_device::write_reg3(int regnum, INT32 val) register reading ===========================================================================*/ -INT32 adsp21xx_device::read_reg0(int regnum) +int32_t adsp21xx_device::read_reg0(int regnum) { return *m_read0_ptr[regnum]; } -INT32 adsp21xx_device::read_reg1(int regnum) +int32_t adsp21xx_device::read_reg1(int regnum) { return *m_read1_ptr[regnum]; } -INT32 adsp21xx_device::read_reg2(int regnum) +int32_t adsp21xx_device::read_reg2(int regnum) { return *m_read2_ptr[regnum]; } -INT32 adsp21xx_device::read_reg3(int regnum) +int32_t adsp21xx_device::read_reg3(int regnum) { switch (regnum) { @@ -519,11 +519,11 @@ INT32 adsp21xx_device::read_reg3(int regnum) Modulus addressing logic ===========================================================================*/ -inline void adsp21xx_device::modify_address(UINT32 ireg, UINT32 mreg) +inline void adsp21xx_device::modify_address(uint32_t ireg, uint32_t mreg) { - UINT32 base = m_base[ireg]; - UINT32 i = m_i[ireg]; - UINT32 l = m_l[ireg]; + uint32_t base = m_base[ireg]; + uint32_t i = m_i[ireg]; + uint32_t l = m_l[ireg]; i += m_m[mreg]; if (i < base) i += l; @@ -537,17 +537,17 @@ inline void adsp21xx_device::modify_address(UINT32 ireg, UINT32 mreg) Data memory accessors ===========================================================================*/ -inline void adsp21xx_device::data_write_dag1(UINT32 op, INT32 val) +inline void adsp21xx_device::data_write_dag1(uint32_t op, int32_t val) { - UINT32 ireg = (op >> 2) & 3; - UINT32 mreg = op & 3; - UINT32 base = m_base[ireg]; - UINT32 i = m_i[ireg]; - UINT32 l = m_l[ireg]; + uint32_t ireg = (op >> 2) & 3; + uint32_t mreg = op & 3; + uint32_t base = m_base[ireg]; + uint32_t i = m_i[ireg]; + uint32_t l = m_l[ireg]; if ( m_mstat & MSTAT_REVERSE ) { - UINT32 ir = m_reverse_table[ i & 0x3fff ]; + uint32_t ir = m_reverse_table[ i & 0x3fff ]; data_write(ir, val); } else @@ -560,18 +560,18 @@ inline void adsp21xx_device::data_write_dag1(UINT32 op, INT32 val) } -inline UINT32 adsp21xx_device::data_read_dag1(UINT32 op) +inline uint32_t adsp21xx_device::data_read_dag1(uint32_t op) { - UINT32 ireg = (op >> 2) & 3; - UINT32 mreg = op & 3; - UINT32 base = m_base[ireg]; - UINT32 i = m_i[ireg]; - UINT32 l = m_l[ireg]; - UINT32 res; + uint32_t ireg = (op >> 2) & 3; + uint32_t mreg = op & 3; + uint32_t base = m_base[ireg]; + uint32_t i = m_i[ireg]; + uint32_t l = m_l[ireg]; + uint32_t res; if (m_mstat & MSTAT_REVERSE) { - UINT32 ir = m_reverse_table[i & 0x3fff]; + uint32_t ir = m_reverse_table[i & 0x3fff]; res = data_read(ir); } else @@ -585,13 +585,13 @@ inline UINT32 adsp21xx_device::data_read_dag1(UINT32 op) return res; } -inline void adsp21xx_device::data_write_dag2(UINT32 op, INT32 val) +inline void adsp21xx_device::data_write_dag2(uint32_t op, int32_t val) { - UINT32 ireg = 4 + ((op >> 2) & 3); - UINT32 mreg = 4 + (op & 3); - UINT32 base = m_base[ireg]; - UINT32 i = m_i[ireg]; - UINT32 l = m_l[ireg]; + uint32_t ireg = 4 + ((op >> 2) & 3); + uint32_t mreg = 4 + (op & 3); + uint32_t base = m_base[ireg]; + uint32_t i = m_i[ireg]; + uint32_t l = m_l[ireg]; data_write(i, val); @@ -602,15 +602,15 @@ inline void adsp21xx_device::data_write_dag2(UINT32 op, INT32 val) } -inline UINT32 adsp21xx_device::data_read_dag2(UINT32 op) +inline uint32_t adsp21xx_device::data_read_dag2(uint32_t op) { - UINT32 ireg = 4 + ((op >> 2) & 3); - UINT32 mreg = 4 + (op & 3); - UINT32 base = m_base[ireg]; - UINT32 i = m_i[ireg]; - UINT32 l = m_l[ireg]; + uint32_t ireg = 4 + ((op >> 2) & 3); + uint32_t mreg = 4 + (op & 3); + uint32_t base = m_base[ireg]; + uint32_t i = m_i[ireg]; + uint32_t l = m_l[ireg]; - UINT32 res = data_read(i); + uint32_t res = data_read(i); i += m_m[mreg]; if (i < base) i += l; @@ -624,13 +624,13 @@ inline UINT32 adsp21xx_device::data_read_dag2(UINT32 op) Program memory accessors ===========================================================================*/ -inline void adsp21xx_device::pgm_write_dag2(UINT32 op, INT32 val) +inline void adsp21xx_device::pgm_write_dag2(uint32_t op, int32_t val) { - UINT32 ireg = 4 + ((op >> 2) & 3); - UINT32 mreg = 4 + (op & 3); - UINT32 base = m_base[ireg]; - UINT32 i = m_i[ireg]; - UINT32 l = m_l[ireg]; + uint32_t ireg = 4 + ((op >> 2) & 3); + uint32_t mreg = 4 + (op & 3); + uint32_t base = m_base[ireg]; + uint32_t i = m_i[ireg]; + uint32_t l = m_l[ireg]; program_write(i, (val << 8) | m_px); @@ -641,14 +641,14 @@ inline void adsp21xx_device::pgm_write_dag2(UINT32 op, INT32 val) } -inline UINT32 adsp21xx_device::pgm_read_dag2(UINT32 op) +inline uint32_t adsp21xx_device::pgm_read_dag2(uint32_t op) { - UINT32 ireg = 4 + ((op >> 2) & 3); - UINT32 mreg = 4 + (op & 3); - UINT32 base = m_base[ireg]; - UINT32 i = m_i[ireg]; - UINT32 l = m_l[ireg]; - UINT32 res; + uint32_t ireg = 4 + ((op >> 2) & 3); + uint32_t mreg = 4 + (op & 3); + uint32_t base = m_base[ireg]; + uint32_t i = m_i[ireg]; + uint32_t l = m_l[ireg]; + uint32_t res; res = program_read(i); m_px = res; @@ -668,16 +668,16 @@ inline UINT32 adsp21xx_device::pgm_read_dag2(UINT32 op) register reading ===========================================================================*/ -#define ALU_GETXREG_UNSIGNED(x) (*(UINT16 *)m_alu_xregs[x]) -#define ALU_GETYREG_UNSIGNED(y) (*(UINT16 *)m_alu_yregs[y]) +#define ALU_GETXREG_UNSIGNED(x) (*(uint16_t *)m_alu_xregs[x]) +#define ALU_GETYREG_UNSIGNED(y) (*(uint16_t *)m_alu_yregs[y]) -#define MAC_GETXREG_UNSIGNED(x) (*(UINT16 *)m_mac_xregs[x]) -#define MAC_GETXREG_SIGNED(x) (*( INT16 *)m_mac_xregs[x]) -#define MAC_GETYREG_UNSIGNED(y) (*(UINT16 *)m_mac_yregs[y]) -#define MAC_GETYREG_SIGNED(y) (*( INT16 *)m_mac_yregs[y]) +#define MAC_GETXREG_UNSIGNED(x) (*(uint16_t *)m_mac_xregs[x]) +#define MAC_GETXREG_SIGNED(x) (*( int16_t *)m_mac_xregs[x]) +#define MAC_GETYREG_UNSIGNED(y) (*(uint16_t *)m_mac_yregs[y]) +#define MAC_GETYREG_SIGNED(y) (*( int16_t *)m_mac_yregs[y]) -#define SHIFT_GETXREG_UNSIGNED(x) (*(UINT16 *)m_shift_xregs[x]) -#define SHIFT_GETXREG_SIGNED(x) (*( INT16 *)m_shift_xregs[x]) +#define SHIFT_GETXREG_UNSIGNED(x) (*(uint16_t *)m_shift_xregs[x]) +#define SHIFT_GETXREG_SIGNED(x) (*( int16_t *)m_shift_xregs[x]) @@ -687,9 +687,9 @@ inline UINT32 adsp21xx_device::pgm_read_dag2(UINT32 op) void adsp21xx_device::alu_op_ar(int op) { - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 res; + int32_t xop = (op >> 8) & 7; + int32_t yop = (op >> 11) & 3; + int32_t res; switch (op & (15<<13)) /*JB*/ { @@ -825,9 +825,9 @@ void adsp21xx_device::alu_op_ar(int op) void adsp21xx_device::alu_op_ar_const(int op) { - INT32 xop = (op >> 8) & 7; - INT32 yop = constants[((op >> 5) & 0x07) | ((op >> 8) & 0x18)]; - INT32 res; + int32_t xop = (op >> 8) & 7; + int32_t yop = constants[((op >> 5) & 0x07) | ((op >> 8) & 0x18)]; + int32_t res; switch (op & (15<<13)) /*JB*/ { @@ -951,9 +951,9 @@ void adsp21xx_device::alu_op_ar_const(int op) void adsp21xx_device::alu_op_af(int op) { - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 res; + int32_t xop = (op >> 8) & 7; + int32_t yop = (op >> 11) & 3; + int32_t res; switch (op & (15<<13)) /*JB*/ { @@ -1086,9 +1086,9 @@ void adsp21xx_device::alu_op_af(int op) void adsp21xx_device::alu_op_af_const(int op) { - INT32 xop = (op >> 8) & 7; - INT32 yop = constants[((op >> 5) & 0x07) | ((op >> 8) & 0x18)]; - INT32 res; + int32_t xop = (op >> 8) & 7; + int32_t yop = constants[((op >> 5) & 0x07) | ((op >> 8) & 0x18)]; + int32_t res; switch (op & (15<<13)) /*JB*/ { @@ -1209,9 +1209,9 @@ void adsp21xx_device::alu_op_af_const(int op) void adsp21xx_device::alu_op_none(int op) { - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 res; + int32_t xop = (op >> 8) & 7; + int32_t yop = (op >> 11) & 3; + int32_t res; switch (op & (15<<13)) /*JB*/ { @@ -1338,11 +1338,11 @@ void adsp21xx_device::alu_op_none(int op) void adsp21xx_device::mac_op_mr(int op) { - INT8 shift = ((m_mstat & MSTAT_INTEGER) >> 4) ^ 1; - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 temp; - INT64 res; + int8_t shift = ((m_mstat & MSTAT_INTEGER) >> 4) ^ 1; + int32_t xop = (op >> 8) & 7; + int32_t yop = (op >> 11) & 3; + int32_t temp; + int64_t res; switch (op & (15<<13)) /*JB*/ { @@ -1354,15 +1354,15 @@ void adsp21xx_device::mac_op_mr(int op) xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x02<<13: @@ -1370,15 +1370,15 @@ void adsp21xx_device::mac_op_mr(int op) xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x03<<13: @@ -1386,15 +1386,15 @@ void adsp21xx_device::mac_op_mr(int op) xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x04<<13: @@ -1402,84 +1402,84 @@ void adsp21xx_device::mac_op_mr(int op) xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x05<<13: /* X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x06<<13: /* X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x07<<13: /* X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x08<<13: /* MR + X * Y (SS) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x09<<13: /* MR + X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0a<<13: /* MR + X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0b<<13: /* MR + X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0c<<13: /* MR - X * Y (SS) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0d<<13: /* MR - X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0e<<13: /* MR - X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0f<<13: /* MR - X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; default: res = 0; /* just to keep the compiler happy */ @@ -1501,10 +1501,10 @@ void adsp21xx_device::mac_op_mr(int op) void adsp21xx_device::mac_op_mr_xop(int op) { - INT8 shift = ((m_mstat & MSTAT_INTEGER) >> 4) ^ 1; - INT32 xop = (op >> 8) & 7; - INT32 temp; - INT64 res; + int8_t shift = ((m_mstat & MSTAT_INTEGER) >> 4) ^ 1; + int32_t xop = (op >> 8) & 7; + int32_t temp; + int64_t res; switch (op & (15<<13)) /*JB*/ { @@ -1515,118 +1515,118 @@ void adsp21xx_device::mac_op_mr_xop(int op) /* X * Y (RND) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x02<<13: /* MR + X * Y (RND) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x03<<13: /* MR - X * Y (RND) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x04<<13: /* X * Y (SS) Clear when y = 0 */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x05<<13: /* X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x06<<13: /* X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x07<<13: /* X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x08<<13: /* MR + X * Y (SS) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x09<<13: /* MR + X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0a<<13: /* MR + X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0b<<13: /* MR + X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0c<<13: /* MR - X * Y (SS) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0d<<13: /* MR - X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0e<<13: /* MR - X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0f<<13: /* MR - X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; default: res = 0; /* just to keep the compiler happy */ @@ -1648,11 +1648,11 @@ void adsp21xx_device::mac_op_mr_xop(int op) void adsp21xx_device::mac_op_mf(int op) { - INT8 shift = ((m_mstat & MSTAT_INTEGER) >> 4) ^ 1; - INT32 xop = (op >> 8) & 7; - INT32 yop = (op >> 11) & 3; - INT32 temp; - INT64 res; + int8_t shift = ((m_mstat & MSTAT_INTEGER) >> 4) ^ 1; + int32_t xop = (op >> 8) & 7; + int32_t yop = (op >> 11) & 3; + int32_t temp; + int64_t res; switch (op & (15<<13)) /*JB*/ { @@ -1664,15 +1664,15 @@ void adsp21xx_device::mac_op_mf(int op) xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x02<<13: @@ -1680,15 +1680,15 @@ void adsp21xx_device::mac_op_mf(int op) xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x03<<13: @@ -1696,15 +1696,15 @@ void adsp21xx_device::mac_op_mf(int op) xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x04<<13: @@ -1712,84 +1712,84 @@ void adsp21xx_device::mac_op_mf(int op) xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x05<<13: /* X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x06<<13: /* X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x07<<13: /* X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x08<<13: /* MR + X * Y (SS) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x09<<13: /* MR + X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0a<<13: /* MR + X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0b<<13: /* MR + X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0c<<13: /* MR - X * Y (SS) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0d<<13: /* MR - X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0e<<13: /* MR - X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_SIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0f<<13: /* MR - X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); yop = MAC_GETYREG_UNSIGNED(yop); temp = (xop * yop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; default: res = 0; /* just to keep the compiler happy */ @@ -1797,7 +1797,7 @@ void adsp21xx_device::mac_op_mf(int op) } /* set the final value */ - m_core.mf.u = (UINT32)res >> 16; + m_core.mf.u = (uint32_t)res >> 16; } @@ -1808,10 +1808,10 @@ void adsp21xx_device::mac_op_mf(int op) void adsp21xx_device::mac_op_mf_xop(int op) { - INT8 shift = ((m_mstat & MSTAT_INTEGER) >> 4) ^ 1; - INT32 xop = (op >> 8) & 7; - INT32 temp; - INT64 res; + int8_t shift = ((m_mstat & MSTAT_INTEGER) >> 4) ^ 1; + int32_t xop = (op >> 8) & 7; + int32_t temp; + int64_t res; switch (op & (15<<13)) /*JB*/ { @@ -1822,118 +1822,118 @@ void adsp21xx_device::mac_op_mf_xop(int op) /* X * Y (RND) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x02<<13: /* MR + X * Y (RND) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x03<<13: /* MR - X * Y (RND) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; #if 0 - if ((res & 0xffff) == 0x8000) res &= ~((UINT64)0x10000); + if ((res & 0xffff) == 0x8000) res &= ~((uint64_t)0x10000); else res += (res & 0x8000) << 1; #else temp &= 0xffff; res += 0x8000; if ( temp == 0x8000 ) - res &= ~((UINT64)0x10000); + res &= ~((uint64_t)0x10000); #endif break; case 0x04<<13: /* X * Y (SS) Clear when y = 0 */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x05<<13: /* X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x06<<13: /* X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x07<<13: /* X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = (INT64)temp; + res = (int64_t)temp; break; case 0x08<<13: /* MR + X * Y (SS) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x09<<13: /* MR + X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0a<<13: /* MR + X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0b<<13: /* MR + X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr + (INT64)temp; + res = m_core.mr.mr + (int64_t)temp; break; case 0x0c<<13: /* MR - X * Y (SS) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0d<<13: /* MR - X * Y (SU) */ xop = MAC_GETXREG_SIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0e<<13: /* MR - X * Y (US) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; case 0x0f<<13: /* MR - X * Y (UU) */ xop = MAC_GETXREG_UNSIGNED(xop); temp = (xop * xop) << shift; - res = m_core.mr.mr - (INT64)temp; + res = m_core.mr.mr - (int64_t)temp; break; default: res = 0; /* just to keep the compiler happy */ @@ -1941,7 +1941,7 @@ void adsp21xx_device::mac_op_mf_xop(int op) } /* set the final value */ - m_core.mf.u = (UINT32)res >> 16; + m_core.mf.u = (uint32_t)res >> 16; } @@ -1952,9 +1952,9 @@ void adsp21xx_device::mac_op_mf_xop(int op) void adsp21xx_device::shift_op(int op) { - INT8 sc = m_core.se.s; - INT32 xop = (op >> 8) & 7; - UINT32 res; + int8_t sc = m_core.se.s; + int32_t xop = (op >> 8) & 7; + uint32_t res; switch (op & (15<<11)) /*JB*/ { @@ -1962,14 +1962,14 @@ void adsp21xx_device::shift_op(int op) /* LSHIFT (HI) */ xop = SHIFT_GETXREG_UNSIGNED(xop) << 16; if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? ((UINT32)xop >> -sc) : 0; + else res = (sc > -32) ? ((uint32_t)xop >> -sc) : 0; m_core.sr.sr = res; break; case 0x01<<11: /* LSHIFT (HI, OR) */ xop = SHIFT_GETXREG_UNSIGNED(xop) << 16; if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? ((UINT32)xop >> -sc) : 0; + else res = (sc > -32) ? ((uint32_t)xop >> -sc) : 0; m_core.sr.sr |= res; break; case 0x02<<11: @@ -2019,7 +2019,7 @@ void adsp21xx_device::shift_op(int op) xop = SHIFT_GETXREG_SIGNED(xop) << 16; if (sc > 0) { - xop = ((UINT32)xop >> 1) | ((m_astat & CFLAG) << 28); + xop = ((uint32_t)xop >> 1) | ((m_astat & CFLAG) << 28); res = xop >> (sc - 1); } else res = (sc > -32) ? (xop << -sc) : 0; @@ -2030,7 +2030,7 @@ void adsp21xx_device::shift_op(int op) xop = SHIFT_GETXREG_SIGNED(xop) << 16; if (sc > 0) { - xop = ((UINT32)xop >> 1) | ((m_astat & CFLAG) << 28); + xop = ((uint32_t)xop >> 1) | ((m_astat & CFLAG) << 28); res = xop >> (sc - 1); } else res = (sc > -32) ? (xop << -sc) : 0; @@ -2134,9 +2134,9 @@ void adsp21xx_device::shift_op(int op) void adsp21xx_device::shift_op_imm(int op) { - INT8 sc = (INT8)op; - INT32 xop = (op >> 8) & 7; - UINT32 res; + int8_t sc = (int8_t)op; + int32_t xop = (op >> 8) & 7; + uint32_t res; switch (op & (15<<11)) /*JB*/ { @@ -2144,14 +2144,14 @@ void adsp21xx_device::shift_op_imm(int op) /* LSHIFT (HI) */ xop = SHIFT_GETXREG_UNSIGNED(xop) << 16; if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? ((UINT32)xop >> -sc) : 0; + else res = (sc > -32) ? ((uint32_t)xop >> -sc) : 0; m_core.sr.sr = res; break; case 0x01<<11: /* LSHIFT (HI, OR) */ xop = SHIFT_GETXREG_UNSIGNED(xop) << 16; if (sc > 0) res = (sc < 32) ? (xop << sc) : 0; - else res = (sc > -32) ? ((UINT32)xop >> -sc) : 0; + else res = (sc > -32) ? ((uint32_t)xop >> -sc) : 0; m_core.sr.sr |= res; break; case 0x02<<11: @@ -2201,7 +2201,7 @@ void adsp21xx_device::shift_op_imm(int op) xop = SHIFT_GETXREG_SIGNED(xop) << 16; if (sc > 0) { - xop = ((UINT32)xop >> 1) | ((m_astat & CFLAG) << 28); + xop = ((uint32_t)xop >> 1) | ((m_astat & CFLAG) << 28); res = xop >> (sc - 1); } else res = (sc > -32) ? (xop << -sc) : 0; @@ -2212,7 +2212,7 @@ void adsp21xx_device::shift_op_imm(int op) xop = SHIFT_GETXREG_SIGNED(xop) << 16; if (sc > 0) { - xop = ((UINT32)xop >> 1) | ((m_astat & CFLAG) << 28); + xop = ((uint32_t)xop >> 1) | ((m_astat & CFLAG) << 28); res = xop >> (sc - 1); } else res = (sc > -32) ? (xop << -sc) : 0; diff --git a/src/devices/cpu/adsp2100/adsp2100.cpp b/src/devices/cpu/adsp2100/adsp2100.cpp index 42627c3d5e2..a0cbda562b5 100644 --- a/src/devices/cpu/adsp2100/adsp2100.cpp +++ b/src/devices/cpu/adsp2100/adsp2100.cpp @@ -119,7 +119,7 @@ const device_type ADSP2181 = &device_creator; // adsp21xx_device - constructor //------------------------------------------------- -adsp21xx_device::adsp21xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype, const char *shortname, const char *source) +adsp21xx_device::adsp21xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t chiptype, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_LITTLE, 32, 14, -2), m_data_config("data", ENDIANNESS_LITTLE, 16, 14, -1), @@ -200,11 +200,11 @@ adsp21xx_device::adsp21xx_device(const machine_config &mconfig, device_type type for (int index = 0; index < 4; index++) { m_read1_ptr[0x00 + index] = &m_i[0 + index]; - m_read1_ptr[0x04 + index] = (UINT32 *)&m_m[0 + index]; + m_read1_ptr[0x04 + index] = (uint32_t *)&m_m[0 + index]; m_read1_ptr[0x08 + index] = &m_l[0 + index]; m_read1_ptr[0x0c + index] = &m_l[0 + index]; m_read2_ptr[0x00 + index] = &m_i[4 + index]; - m_read2_ptr[0x04 + index] = (UINT32 *)&m_m[4 + index]; + m_read2_ptr[0x04 + index] = (uint32_t *)&m_m[4 + index]; m_read2_ptr[0x08 + index] = &m_l[4 + index]; m_read2_ptr[0x0c + index] = &m_l[4 + index]; } @@ -248,25 +248,25 @@ adsp21xx_device::adsp21xx_device(const machine_config &mconfig, device_type type m_shift_xregs[7] = &m_core.sr.srx.sr1; } -adsp2100_device::adsp2100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adsp2100_device::adsp2100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adsp21xx_device(mconfig, ADSP2100, "ADSP-2100", tag, owner, clock, CHIP_TYPE_ADSP2100, "adsp2100", __FILE__) { } -adsp2101_device::adsp2101_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adsp2101_device::adsp2101_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adsp21xx_device(mconfig, ADSP2101, "ADSP-2101", tag, owner, clock, CHIP_TYPE_ADSP2101, "adsp2101", __FILE__) { } -adsp2101_device::adsp2101_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype, const char *shortname, const char *source) +adsp2101_device::adsp2101_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t chiptype, const char *shortname, const char *source) : adsp21xx_device(mconfig, type, name, tag, owner, clock, chiptype, shortname, source) { } -adsp2104_device::adsp2104_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adsp2104_device::adsp2104_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adsp2101_device(mconfig, ADSP2104, "ADSP-2104", tag, owner, clock, CHIP_TYPE_ADSP2104, "adsp2104", __FILE__) { } -adsp2105_device::adsp2105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adsp2105_device::adsp2105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adsp2101_device(mconfig, ADSP2105, "ADSP-2105", tag, owner, clock, CHIP_TYPE_ADSP2105, "adsp2105", __FILE__) { } -adsp2115_device::adsp2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adsp2115_device::adsp2115_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adsp2101_device(mconfig, ADSP2115, "ADSP-2115", tag, owner, clock, CHIP_TYPE_ADSP2115, "adsp2115", __FILE__) { } -adsp2181_device::adsp2181_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adsp2181_device::adsp2181_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adsp21xx_device(mconfig, ADSP2181, "ADSP-2181", tag, owner, clock, CHIP_TYPE_ADSP2181, "adsp2181", __FILE__), m_io_config("I/O", ENDIANNESS_LITTLE, 16, 11, -1) { } @@ -300,13 +300,13 @@ adsp21xx_device::~adsp21xx_device() // 8-bit ROM //------------------------------------------------- -void adsp21xx_device::load_boot_data(UINT8 *srcdata, UINT32 *dstdata) +void adsp21xx_device::load_boot_data(uint8_t *srcdata, uint32_t *dstdata) { // see how many words we need to copy int pagelen = (srcdata[3] + 1) * 8; for (int i = 0; i < pagelen; i++) { - UINT32 opcode = (srcdata[i*4+0] << 16) | (srcdata[i*4+1] << 8) | srcdata[i*4+2]; + uint32_t opcode = (srcdata[i*4+0] << 16) | (srcdata[i*4+1] << 8) | srcdata[i*4+2]; dstdata[i] = opcode; } } @@ -316,7 +316,7 @@ void adsp21xx_device::load_boot_data(UINT8 *srcdata, UINT32 *dstdata) // idma_addr_w - write the IDMA address register //------------------------------------------------- -void adsp2181_device::idma_addr_w(UINT16 data) +void adsp2181_device::idma_addr_w(uint16_t data) { m_idma_addr = data; m_idma_offs = 0; @@ -327,7 +327,7 @@ void adsp2181_device::idma_addr_w(UINT16 data) // idma_addr_r - read the IDMA address register //------------------------------------------------- -UINT16 adsp2181_device::idma_addr_r() +uint16_t adsp2181_device::idma_addr_r() { return m_idma_addr; } @@ -337,7 +337,7 @@ UINT16 adsp2181_device::idma_addr_r() // idma_data_w - write the IDMA data register //------------------------------------------------- -void adsp2181_device::idma_data_w(UINT16 data) +void adsp2181_device::idma_data_w(uint16_t data) { // program memory? if (!(m_idma_addr & 0x4000)) @@ -367,9 +367,9 @@ void adsp2181_device::idma_data_w(UINT16 data) // idma_data_r - read the IDMA data register //------------------------------------------------- -UINT16 adsp2181_device::idma_data_r() +uint16_t adsp2181_device::idma_data_r() { - UINT16 result; + uint16_t result; // program memory? if (!(m_idma_addr & 0x4000)) @@ -745,7 +745,7 @@ void adsp21xx_device::state_string_export(const device_state_entry &entry, std:: // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 adsp21xx_device::disasm_min_opcode_bytes() const +uint32_t adsp21xx_device::disasm_min_opcode_bytes() const { return 4; } @@ -756,7 +756,7 @@ UINT32 adsp21xx_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 adsp21xx_device::disasm_max_opcode_bytes() const +uint32_t adsp21xx_device::disasm_max_opcode_bytes() const { return 4; } @@ -767,7 +767,7 @@ UINT32 adsp21xx_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t adsp21xx_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t adsp21xx_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( adsp21xx ); return CPU_DISASSEMBLE_NAME(adsp21xx)(this, buffer, pc, oprom, opram, options); @@ -780,37 +780,37 @@ offs_t adsp21xx_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 MEMORY ACCESSORS ***************************************************************************/ -inline UINT16 adsp21xx_device::data_read(UINT32 addr) +inline uint16_t adsp21xx_device::data_read(uint32_t addr) { return m_data->read_word(addr << 1); } -inline void adsp21xx_device::data_write(UINT32 addr, UINT16 data) +inline void adsp21xx_device::data_write(uint32_t addr, uint16_t data) { m_data->write_word(addr << 1, data); } -inline UINT16 adsp21xx_device::io_read(UINT32 addr) +inline uint16_t adsp21xx_device::io_read(uint32_t addr) { return m_io->read_word(addr << 1); } -inline void adsp21xx_device::io_write(UINT32 addr, UINT16 data) +inline void adsp21xx_device::io_write(uint32_t addr, uint16_t data) { m_io->write_word(addr << 1, data); } -inline UINT32 adsp21xx_device::program_read(UINT32 addr) +inline uint32_t adsp21xx_device::program_read(uint32_t addr) { return m_program->read_dword(addr << 2); } -inline void adsp21xx_device::program_write(UINT32 addr, UINT32 data) +inline void adsp21xx_device::program_write(uint32_t addr, uint32_t data) { m_program->write_dword(addr << 2, data & 0xffffff); } -inline UINT32 adsp21xx_device::opcode_read() +inline uint32_t adsp21xx_device::opcode_read() { return m_direct->read_dword(m_pc << 2); } @@ -905,7 +905,7 @@ bool adsp2181_device::generate_irq(int which, int indx) void adsp2100_device::check_irqs() { - UINT8 check; + uint8_t check; // check IRQ3 check = (m_icntl & 8) ? m_irq_latch[ADSP2100_IRQ3] : m_irq_state[ADSP2100_IRQ3]; @@ -931,7 +931,7 @@ void adsp2100_device::check_irqs() void adsp2101_device::check_irqs() { - UINT8 check; + uint8_t check; // check IRQ2 check = (m_icntl & 4) ? m_irq_latch[ADSP2101_IRQ2] : m_irq_state[ADSP2101_IRQ2]; @@ -967,7 +967,7 @@ void adsp2101_device::check_irqs() void adsp2181_device::check_irqs() { - UINT8 check; + uint8_t check; // check IRQ2 check = (m_icntl & 4) ? m_irq_latch[ADSP2181_IRQ2] : m_irq_state[ADSP2181_IRQ2]; @@ -1028,7 +1028,7 @@ void adsp21xx_device::create_tables() // initialize the bit reversing table for (int i = 0; i < 0x4000; i++) { - UINT16 data = 0; + uint16_t data = 0; data |= (i >> 13) & 0x0001; data |= (i >> 11) & 0x0002; @@ -1107,7 +1107,7 @@ void adsp21xx_device::create_tables() // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 adsp21xx_device::execute_min_cycles() const +uint32_t adsp21xx_device::execute_min_cycles() const { return 1; } @@ -1118,7 +1118,7 @@ UINT32 adsp21xx_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 adsp21xx_device::execute_max_cycles() const +uint32_t adsp21xx_device::execute_max_cycles() const { return 1; } @@ -1129,17 +1129,17 @@ UINT32 adsp21xx_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 adsp2100_device::execute_input_lines() const +uint32_t adsp2100_device::execute_input_lines() const { return 4; } -UINT32 adsp2101_device::execute_input_lines() const +uint32_t adsp2101_device::execute_input_lines() const { return 5; } -UINT32 adsp2181_device::execute_input_lines() const +uint32_t adsp2181_device::execute_input_lines() const { return 9; } @@ -1174,7 +1174,7 @@ void adsp21xx_device::execute_run() #endif // instruction fetch - UINT32 op = opcode_read(); + uint32_t op = opcode_read(); // advance to the next instruction if (m_pc != m_loop) @@ -1197,7 +1197,7 @@ void adsp21xx_device::execute_run() } // parse the instruction - UINT32 temp; + uint32_t temp; switch ((op >> 16) & 0xff) { case 0x00: @@ -1529,19 +1529,19 @@ void adsp21xx_device::execute_run() break; case 0x30: case 0x31: case 0x32: case 0x33: // 001100xx xxxxxxxx xxxxxxxx load non-data register immediate (group 0) - write_reg0(op & 15, (INT32)(op << 14) >> 18); + write_reg0(op & 15, (int32_t)(op << 14) >> 18); break; case 0x34: case 0x35: case 0x36: case 0x37: // 001101xx xxxxxxxx xxxxxxxx load non-data register immediate (group 1) - write_reg1(op & 15, (INT32)(op << 14) >> 18); + write_reg1(op & 15, (int32_t)(op << 14) >> 18); break; case 0x38: case 0x39: case 0x3a: case 0x3b: // 001110xx xxxxxxxx xxxxxxxx load non-data register immediate (group 2) - write_reg2(op & 15, (INT32)(op << 14) >> 18); + write_reg2(op & 15, (int32_t)(op << 14) >> 18); break; case 0x3c: case 0x3d: case 0x3e: case 0x3f: // 001111xx xxxxxxxx xxxxxxxx load non-data register immediate (group 3) - write_reg3(op & 15, (INT32)(op << 14) >> 18); + write_reg3(op & 15, (int32_t)(op << 14) >> 18); break; case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: diff --git a/src/devices/cpu/adsp2100/adsp2100.h b/src/devices/cpu/adsp2100/adsp2100.h index 71fe14eae8c..d8dd28ee2ea 100644 --- a/src/devices/cpu/adsp2100/adsp2100.h +++ b/src/devices/cpu/adsp2100/adsp2100.h @@ -211,7 +211,7 @@ protected: }; // construction/destruction - adsp21xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype, const char *shortname, const char *source); + adsp21xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t chiptype, const char *shortname, const char *source); virtual ~adsp21xx_device(); public: @@ -222,7 +222,7 @@ public: template static devcb_base &set_dmovlay_callback(device_t &device, _Object object) { return downcast(device).m_dmovlay_cb.set_callback(object); } // public interfaces - void load_boot_data(UINT8 *srcdata, UINT32 *dstdata); + void load_boot_data(uint8_t *srcdata, uint32_t *dstdata); protected: // device-level overrides @@ -230,8 +230,8 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -240,36 +240,36 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // helpers void create_tables(); inline void update_mstat(); - inline UINT32 pc_stack_top(); - inline void set_pc_stack_top(UINT32 top); + inline uint32_t pc_stack_top(); + inline void set_pc_stack_top(uint32_t top); inline void pc_stack_push(); - inline void pc_stack_push_val(UINT32 val); + inline void pc_stack_push_val(uint32_t val); inline void pc_stack_pop(); - inline UINT32 pc_stack_pop_val(); - inline UINT32 cntr_stack_top(); + inline uint32_t pc_stack_pop_val(); + inline uint32_t cntr_stack_top(); inline void cntr_stack_push(); inline void cntr_stack_pop(); - inline UINT32 loop_stack_top(); - inline void loop_stack_push(UINT32 value); + inline uint32_t loop_stack_top(); + inline void loop_stack_push(uint32_t value); inline void loop_stack_pop(); inline void stat_stack_push(); inline void stat_stack_pop(); // inline int condition(int c); int slow_condition(); - inline void modify_address(UINT32 ireg, UINT32 mreg); - inline void data_write_dag1(UINT32 op, INT32 val); - inline UINT32 data_read_dag1(UINT32 op); - inline void data_write_dag2(UINT32 op, INT32 val); - inline UINT32 data_read_dag2(UINT32 op); - inline void pgm_write_dag2(UINT32 op, INT32 val); - inline UINT32 pgm_read_dag2(UINT32 op); + inline void modify_address(uint32_t ireg, uint32_t mreg); + inline void data_write_dag1(uint32_t op, int32_t val); + inline uint32_t data_read_dag1(uint32_t op); + inline void data_write_dag2(uint32_t op, int32_t val); + inline uint32_t data_read_dag2(uint32_t op); + inline void pgm_write_dag2(uint32_t op, int32_t val); + inline uint32_t pgm_read_dag2(uint32_t op); void alu_op_ar(int op); void alu_op_ar_const(int op); void alu_op_af(int op); @@ -283,25 +283,25 @@ protected: void shift_op_imm(int op); // memory access - inline UINT16 data_read(UINT32 addr); - inline void data_write(UINT32 addr, UINT16 data); - inline UINT16 io_read(UINT32 addr); - inline void io_write(UINT32 addr, UINT16 data); - inline UINT32 program_read(UINT32 addr); - inline void program_write(UINT32 addr, UINT32 data); - inline UINT32 opcode_read(); + inline uint16_t data_read(uint32_t addr); + inline void data_write(uint32_t addr, uint16_t data); + inline uint16_t io_read(uint32_t addr); + inline void io_write(uint32_t addr, uint16_t data); + inline uint32_t program_read(uint32_t addr); + inline void program_write(uint32_t addr, uint32_t data); + inline uint32_t opcode_read(); // register read/write inline void update_i(int which); inline void update_l(int which); - inline void write_reg0(int regnum, INT32 val); - inline void write_reg1(int regnum, INT32 val); - inline void write_reg2(int regnum, INT32 val); - inline void write_reg3(int regnum, INT32 val); - inline INT32 read_reg0(int regnum); - inline INT32 read_reg1(int regnum); - inline INT32 read_reg2(int regnum); - inline INT32 read_reg3(int regnum); + inline void write_reg0(int regnum, int32_t val); + inline void write_reg1(int regnum, int32_t val); + inline void write_reg2(int regnum, int32_t val); + inline void write_reg3(int regnum, int32_t val); + inline int32_t read_reg0(int regnum); + inline int32_t read_reg1(int regnum); + inline int32_t read_reg2(int regnum); + inline int32_t read_reg3(int regnum); // interrupts virtual bool generate_irq(int which, int indx = 0) = 0; @@ -316,8 +316,8 @@ protected: // 16-bit registers that can be loaded signed or unsigned union adsp_reg16 { - UINT16 u; - INT16 s; + uint16_t u; + int16_t s; }; // the SHIFT result register is 32 bits @@ -328,7 +328,7 @@ protected: #else struct { adsp_reg16 sr1, sr0; } srx; #endif - UINT32 sr; + uint32_t sr; }; // the MAC result register is 40 bits @@ -336,12 +336,12 @@ protected: { #ifdef LSB_FIRST struct { adsp_reg16 mr0, mr1, mr2, mrzero; } mrx; - struct { UINT32 mr0, mr1; } mry; + struct { uint32_t mr0, mr1; } mry; #else struct { adsp_reg16 mrzero, mr2, mr1, mr0; } mrx; - struct { UINT32 mr1, mr0; } mry; + struct { uint32_t mr1, mr0; } mry; #endif - UINT64 mr; + uint64_t mr; }; // core registers which are replicated @@ -372,60 +372,60 @@ protected: // configuration const address_space_config m_program_config; const address_space_config m_data_config; - UINT32 m_chip_type; + uint32_t m_chip_type; // other CPU registers - UINT32 m_pc; - UINT32 m_ppc; - UINT32 m_loop; - UINT32 m_loop_condition; - UINT32 m_cntr; + uint32_t m_pc; + uint32_t m_ppc; + uint32_t m_loop; + uint32_t m_loop_condition; + uint32_t m_cntr; // status registers - UINT32 m_astat; - UINT32 m_sstat; - UINT32 m_mstat; - UINT32 m_mstat_prev; - UINT32 m_astat_clear; - UINT32 m_idle; + uint32_t m_astat; + uint32_t m_sstat; + uint32_t m_mstat; + uint32_t m_mstat_prev; + uint32_t m_astat_clear; + uint32_t m_idle; // live set of core registers adsp_core m_core; // memory addressing registers - UINT32 m_i[8]; - INT32 m_m[8]; - UINT32 m_l[8]; - UINT32 m_lmask[8]; - UINT32 m_base[8]; - UINT8 m_px; + uint32_t m_i[8]; + int32_t m_m[8]; + uint32_t m_l[8]; + uint32_t m_lmask[8]; + uint32_t m_base[8]; + uint8_t m_px; // stacks - UINT32 m_loop_stack[LOOP_STACK_DEPTH]; - UINT32 m_cntr_stack[CNTR_STACK_DEPTH]; - UINT32 m_pc_stack[PC_STACK_DEPTH]; - UINT16 m_stat_stack[STAT_STACK_DEPTH][3]; - INT32 m_pc_sp; - INT32 m_cntr_sp; - INT32 m_stat_sp; - INT32 m_loop_sp; + uint32_t m_loop_stack[LOOP_STACK_DEPTH]; + uint32_t m_cntr_stack[CNTR_STACK_DEPTH]; + uint32_t m_pc_stack[PC_STACK_DEPTH]; + uint16_t m_stat_stack[STAT_STACK_DEPTH][3]; + int32_t m_pc_sp; + int32_t m_cntr_sp; + int32_t m_stat_sp; + int32_t m_loop_sp; // external I/O - UINT8 m_flagout; - UINT8 m_flagin; - UINT8 m_fl0; - UINT8 m_fl1; - UINT8 m_fl2; - UINT16 m_idma_addr; - UINT16 m_idma_cache; - UINT8 m_idma_offs; + uint8_t m_flagout; + uint8_t m_flagin; + uint8_t m_fl0; + uint8_t m_fl1; + uint8_t m_fl2; + uint16_t m_idma_addr; + uint16_t m_idma_cache; + uint8_t m_idma_offs; // interrupt handling - UINT16 m_imask; - UINT8 m_icntl; - UINT16 m_ifc; - UINT8 m_irq_state[9]; - UINT8 m_irq_latch[9]; + uint16_t m_imask; + uint8_t m_icntl; + uint16_t m_ifc; + uint8_t m_irq_state[9]; + uint8_t m_irq_latch[9]; // other internal states int m_icount; @@ -433,9 +433,9 @@ protected: int m_imask_mask; // register maps - INT16 * m_read0_ptr[16]; - UINT32 * m_read1_ptr[16]; - UINT32 * m_read2_ptr[16]; + int16_t * m_read0_ptr[16]; + uint32_t * m_read1_ptr[16]; + uint32_t * m_read2_ptr[16]; void * m_alu_xregs[8]; void * m_alu_yregs[4]; void * m_mac_xregs[8]; @@ -452,9 +452,9 @@ protected: direct_read_data * m_direct; // tables - UINT8 m_condition_table[0x1000]; - UINT16 m_mask_table[0x4000]; - UINT16 m_reverse_table[0x4000]; + uint8_t m_condition_table[0x1000]; + uint16_t m_mask_table[0x4000]; + uint16_t m_reverse_table[0x4000]; devcb_read32 m_sport_rx_cb; // callback for serial receive devcb_write32 m_sport_tx_cb; // callback for serial transmit @@ -463,7 +463,7 @@ protected: // debugging #if ADSP_TRACK_HOTSPOTS - UINT32 m_pcbucket[0x4000]; + uint32_t m_pcbucket[0x4000]; #endif // flag definitions @@ -484,11 +484,11 @@ class adsp2100_device : public adsp21xx_device { public: // construction/destruction - adsp2100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adsp2100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device_execute_interface overrides - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_input_lines() const override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; @@ -505,13 +505,13 @@ class adsp2101_device : public adsp21xx_device { public: // construction/destruction - adsp2101_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adsp2101_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - adsp2101_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype, const char *shortname, const char *source); + adsp2101_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t chiptype, const char *shortname, const char *source); // device_execute_interface overrides - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_input_lines() const override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; @@ -528,11 +528,11 @@ class adsp2181_device : public adsp21xx_device { public: // construction/destruction - adsp2181_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adsp2181_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device_execute_interface overrides - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_input_lines() const override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; @@ -546,10 +546,10 @@ protected: public: // public interfaces - void idma_addr_w(UINT16 data); - UINT16 idma_addr_r(); - void idma_data_w(UINT16 data); - UINT16 idma_data_r(); + void idma_addr_w(uint16_t data); + uint16_t idma_addr_r(); + void idma_data_w(uint16_t data); + uint16_t idma_data_r(); }; @@ -558,19 +558,19 @@ public: class adsp2104_device : public adsp2101_device { public: - adsp2104_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adsp2104_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class adsp2105_device : public adsp2101_device { public: - adsp2105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adsp2105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class adsp2115_device : public adsp2101_device { public: - adsp2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adsp2115_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/alph8201/8201dasm.cpp b/src/devices/cpu/alph8201/8201dasm.cpp index 464813cd170..f8fadecaedb 100644 --- a/src/devices/cpu/alph8201/8201dasm.cpp +++ b/src/devices/cpu/alph8201/8201dasm.cpp @@ -334,7 +334,7 @@ static void InitDasm8201(void) Op[i].type = type; /* 2 byte code ? */ - while (isspace((UINT8)*p)) p++; + while (isspace((uint8_t)*p)) p++; if( (*p) ) Op[i].type |= 0x10; /* number of param */ diff --git a/src/devices/cpu/alph8201/alph8201.cpp b/src/devices/cpu/alph8201/alph8201.cpp index 26b358c7b90..509075e0bdb 100644 --- a/src/devices/cpu/alph8201/alph8201.cpp +++ b/src/devices/cpu/alph8201/alph8201.cpp @@ -184,7 +184,7 @@ const device_type ALPHA8301L = &device_creator; #define FN(x) &alpha8201_cpu_device::x -alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ALPHA8201L, "ALPHA-8201L", tag, owner, clock, "alpha8201l", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 10, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 6, 0) @@ -193,7 +193,7 @@ alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, const } -alpha8201_cpu_device::alpha8201_cpu_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) +alpha8201_cpu_device::alpha8201_cpu_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, 10, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 6, 0) @@ -201,7 +201,7 @@ alpha8201_cpu_device::alpha8201_cpu_device(const machine_config &mconfig, device { } -alpha8301_cpu_device::alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +alpha8301_cpu_device::alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : alpha8201_cpu_device(mconfig, ALPHA8301L, "ALPHA-8301L", tag, owner, clock, "alpha8301l", __FILE__) { m_opmap = opcode_8301; @@ -217,49 +217,49 @@ unsigned alpha8201_cpu_device::M_RDMEM_OPCODE() return retval; } -void alpha8201_cpu_device::M_ADD(UINT8 dat) +void alpha8201_cpu_device::M_ADD(uint8_t dat) { - UINT16 temp = m_A + dat; + uint16_t temp = m_A + dat; m_A = temp & 0xff; m_zf = (m_A==0); m_cf = temp>>8; } -void alpha8201_cpu_device::M_ADDB(UINT8 dat) +void alpha8201_cpu_device::M_ADDB(uint8_t dat) { - UINT16 temp = m_B + dat; + uint16_t temp = m_B + dat; m_B = temp & 0xff; m_zf = (m_B==0); m_cf = temp>>8; } -void alpha8201_cpu_device::M_SUB(UINT8 dat) +void alpha8201_cpu_device::M_SUB(uint8_t dat) { m_cf = (m_A>=dat); // m_cf is No Borrow m_A -= dat; m_zf = (m_A==0); } -void alpha8201_cpu_device::M_AND(UINT8 dat) +void alpha8201_cpu_device::M_AND(uint8_t dat) { m_A &= dat; m_zf = (m_A==0); } -void alpha8201_cpu_device::M_OR(UINT8 dat) +void alpha8201_cpu_device::M_OR(uint8_t dat) { m_A |= dat; m_zf = (m_A==0); } -void alpha8201_cpu_device::M_XOR(UINT8 dat) +void alpha8201_cpu_device::M_XOR(uint8_t dat) { m_A ^= dat; m_zf = (m_A==0); m_cf = 0; } -void alpha8201_cpu_device::M_JMP(UINT8 dat) +void alpha8201_cpu_device::M_JMP(uint8_t dat) { m_pc.b.l = dat; /* update pc page */ @@ -279,8 +279,8 @@ void alpha8201_cpu_device::M_UNDEFINED() void alpha8201_cpu_device::M_UNDEFINED2() { - UINT8 op = M_RDOP(m_pc.w.l-1); - UINT8 imm = M_RDMEM_OPCODE(); + uint8_t op = M_RDOP(m_pc.w.l-1); + uint8_t imm = M_RDMEM_OPCODE(); logerror("alpha8201: PC = %03x, Unimplemented opcode = %02x,%02x\n", m_pc.w.l-2, op,imm); #if SHOW_MESSAGE_CONSOLE osd_printf_debug("alpha8201: PC = %03x, Unimplemented opcode = %02x,%02x\n", m_pc.w.l-2, op,imm); @@ -293,7 +293,7 @@ void alpha8201_cpu_device::M_UNDEFINED2() void alpha8201_cpu_device::stop() { - UINT8 pcptr = M_RDMEM(0x001) & 0x1f; + uint8_t pcptr = M_RDMEM(0x001) & 0x1f; M_WRMEM(pcptr,(M_RDMEM(pcptr)&0xf)+0x08); /* mark entry point ODD to HALT */ m_mb |= 0x08; /* mark internal HALT state */ } @@ -585,7 +585,7 @@ void alpha8201_cpu_device::device_reset() void alpha8201_cpu_device::execute_run() { unsigned opcode; - UINT8 pcptr; + uint8_t pcptr; if(m_halt) { @@ -673,7 +673,7 @@ void alpha8201_cpu_device::execute_set_input(int inputnum, int state) } -offs_t alpha8201_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t alpha8201_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( alpha8201 ); return CPU_DISASSEMBLE_NAME(alpha8201)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/alph8201/alph8201.h b/src/devices/cpu/alph8201/alph8201.h index 432f8193c69..d9b34389e69 100644 --- a/src/devices/cpu/alph8201/alph8201.h +++ b/src/devices/cpu/alph8201/alph8201.h @@ -50,8 +50,8 @@ class alpha8201_cpu_device : public cpu_device { public: // construction/destruction - alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - alpha8201_cpu_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); + alpha8201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + alpha8201_cpu_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: // device-level overrides @@ -59,9 +59,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 16; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 16; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -74,25 +74,25 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - UINT8 M_RDMEM(UINT16 A) { return m_program->read_byte(A); } - void M_WRMEM(UINT16 A,UINT8 V) { m_program->write_byte(A, V); } - UINT8 M_RDOP(UINT16 A) { return m_direct->read_byte(A); } - UINT8 M_RDOP_ARG(UINT16 A) { return m_direct->read_byte(A); } - UINT8 RD_REG(UINT8 x) { return m_RAM[(m_regPtr<<3)+(x)]; } - void WR_REG(UINT8 x, UINT8 d) { m_RAM[(m_regPtr<<3)+(x)]=(d); } + uint8_t M_RDMEM(uint16_t A) { return m_program->read_byte(A); } + void M_WRMEM(uint16_t A,uint8_t V) { m_program->write_byte(A, V); } + uint8_t M_RDOP(uint16_t A) { return m_direct->read_byte(A); } + uint8_t M_RDOP_ARG(uint16_t A) { return m_direct->read_byte(A); } + uint8_t RD_REG(uint8_t x) { return m_RAM[(m_regPtr<<3)+(x)]; } + void WR_REG(uint8_t x, uint8_t d) { m_RAM[(m_regPtr<<3)+(x)]=(d); } unsigned M_RDMEM_OPCODE(); - void M_ADD(UINT8 dat); - void M_ADDB(UINT8 dat); - void M_SUB(UINT8 dat); - void M_AND(UINT8 dat); - void M_OR(UINT8 dat); - void M_XOR(UINT8 dat); - void M_JMP(UINT8 dat); + void M_ADD(uint8_t dat); + void M_ADDB(uint8_t dat); + void M_SUB(uint8_t dat); + void M_AND(uint8_t dat); + void M_OR(uint8_t dat); + void M_XOR(uint8_t dat); + void M_JMP(uint8_t dat); void M_UNDEFINED(); void M_UNDEFINED2(); @@ -290,26 +290,26 @@ protected: void ld_lp2_n() { m_lp2 = M_RDMEM_OPCODE(); } void ld_b_n() { m_B = M_RDMEM_OPCODE(); } - void djnz_lp0() { UINT8 i=M_RDMEM_OPCODE(); m_lp0--; if (m_lp0 != 0) M_JMP(i); } - void djnz_lp1() { UINT8 i=M_RDMEM_OPCODE(); m_lp1--; if (m_lp1 != 0) M_JMP(i); } - void djnz_lp2() { UINT8 i=M_RDMEM_OPCODE(); m_lp2--; if (m_lp2 != 0) M_JMP(i); } - void jnz() { UINT8 i=M_RDMEM_OPCODE(); if (!m_zf) M_JMP(i); } - void jnc() { UINT8 i=M_RDMEM_OPCODE(); if (!m_cf) M_JMP(i);} - void jz() { UINT8 i=M_RDMEM_OPCODE(); if ( m_zf) M_JMP(i); } - void jc() { UINT8 i=M_RDMEM_OPCODE(); if ( m_cf) M_JMP(i);} + void djnz_lp0() { uint8_t i=M_RDMEM_OPCODE(); m_lp0--; if (m_lp0 != 0) M_JMP(i); } + void djnz_lp1() { uint8_t i=M_RDMEM_OPCODE(); m_lp1--; if (m_lp1 != 0) M_JMP(i); } + void djnz_lp2() { uint8_t i=M_RDMEM_OPCODE(); m_lp2--; if (m_lp2 != 0) M_JMP(i); } + void jnz() { uint8_t i=M_RDMEM_OPCODE(); if (!m_zf) M_JMP(i); } + void jnc() { uint8_t i=M_RDMEM_OPCODE(); if (!m_cf) M_JMP(i);} + void jz() { uint8_t i=M_RDMEM_OPCODE(); if ( m_zf) M_JMP(i); } + void jc() { uint8_t i=M_RDMEM_OPCODE(); if ( m_cf) M_JMP(i);} void jmp() { M_JMP(M_RDMEM_OPCODE() ); } void stop(); /* ALPHA 8301 : added instruction */ - void exg_a_ix0() { UINT8 t=m_A; m_A = m_ix0.b.l; m_ix0.b.l = t; } - void exg_a_ix1() { UINT8 t=m_A; m_A = m_ix1.b.l; m_ix1.b.l = t; } - void exg_a_ix2() { UINT8 t=m_A; m_A = m_ix2.b.l; m_ix2.b.l = t; } - void exg_a_lp0() { UINT8 t=m_A; m_A = m_lp0; m_lp0 = t; } - void exg_a_lp1() { UINT8 t=m_A; m_A = m_lp1; m_lp1 = t; } - void exg_a_lp2() { UINT8 t=m_A; m_A = m_lp2; m_lp2 = t; } - void exg_a_b() { UINT8 t=m_A; m_A = m_B; m_B = t; } - void exg_a_rb() { UINT8 t=m_A; m_A = m_regPtr; m_regPtr = t; } + void exg_a_ix0() { uint8_t t=m_A; m_A = m_ix0.b.l; m_ix0.b.l = t; } + void exg_a_ix1() { uint8_t t=m_A; m_A = m_ix1.b.l; m_ix1.b.l = t; } + void exg_a_ix2() { uint8_t t=m_A; m_A = m_ix2.b.l; m_ix2.b.l = t; } + void exg_a_lp0() { uint8_t t=m_A; m_A = m_lp0; m_lp0 = t; } + void exg_a_lp1() { uint8_t t=m_A; m_A = m_lp1; m_lp1 = t; } + void exg_a_lp2() { uint8_t t=m_A; m_A = m_lp2; m_lp2 = t; } + void exg_a_b() { uint8_t t=m_A; m_A = m_B; m_B = t; } + void exg_a_rb() { uint8_t t=m_A; m_A = m_regPtr; m_regPtr = t; } void ld_ix0_a() { m_ix0.b.l = m_A; } void ld_ix1_a() { m_ix1.b.l = m_A; } @@ -320,8 +320,8 @@ protected: void ld_b_a() { m_B = m_A; } void ld_rb_a() { m_regPtr = m_A; } - void exg_ix0_ix1() { UINT8 t=m_ix1.b.l; m_ix1.b.l = m_ix0.b.l; m_ix0.b.l = t; } - void exg_ix0_ix2() { UINT8 t=m_ix2.b.l; m_ix2.b.l = m_ix0.b.l; m_ix0.b.l = t; } + void exg_ix0_ix1() { uint8_t t=m_ix1.b.l; m_ix1.b.l = m_ix0.b.l; m_ix0.b.l = t; } + void exg_ix0_ix2() { uint8_t t=m_ix2.b.l; m_ix2.b.l = m_ix0.b.l; m_ix0.b.l = t; } void op_d4() { m_A = M_RDMEM( ((m_RAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE() ); } void op_d5() { M_WRMEM( ((m_RAM[(7<<3)+7] & 3) << 8) | M_RDMEM_OPCODE(), m_A ); } @@ -337,16 +337,16 @@ protected: void op_rep_ld_b_ix0() { do { m_RAM[(m_B>>1)&0x3f] = M_RDMEM(m_ix0.w.l); m_ix0.b.l++; m_B+=2; m_lp0--; } while (m_lp0 != 0); } void ld_rxb_a() { m_RAM[(m_B>>1)&0x3f] = m_A; } void ld_a_rxb() { m_A = m_RAM[(m_B>>1)&0x3f]; } - void cmp_a_rxb() { UINT8 i=m_RAM[(m_B>>1)&0x3f]; m_zf = (m_A==i); m_cf = (m_A>=i); } + void cmp_a_rxb() { uint8_t i=m_RAM[(m_B>>1)&0x3f]; m_zf = (m_A==i); m_cf = (m_A>=i); } void xor_a_rxb() { M_XOR(m_RAM[(m_B>>1)&0x3f] ); } void add_a_cf() { if (m_cf) inc_a(); } void sub_a_cf() { if (m_cf) dec_a(); } void tst_a() { m_zf = (m_A==0); } void clr_a() { m_A = 0; m_zf = (m_A==0); } - void cmp_a_n() { UINT8 i=M_RDMEM_OPCODE(); m_zf = (m_A==i); m_cf = (m_A>=i); } + void cmp_a_n() { uint8_t i=M_RDMEM_OPCODE(); m_zf = (m_A==i); m_cf = (m_A>=i); } void xor_a_n() { M_XOR(M_RDMEM_OPCODE() ); } - void call() { UINT8 i=M_RDMEM_OPCODE(); m_retptr.w.l = m_pc.w.l; M_JMP(i); }; + void call() { uint8_t i=M_RDMEM_OPCODE(); m_retptr.w.l = m_pc.w.l; M_JMP(i); }; void ld_a_ix0_a() { m_A = M_RDMEM(m_ix0.w.l+m_A); } void ret() { m_mb = m_retptr.b.h; M_JMP( m_retptr.b.l ); }; void save_zc() { m_savez = m_zf; m_savec = m_cf; }; @@ -366,27 +366,27 @@ protected: address_space_config m_program_config; address_space_config m_io_config; - UINT8 m_RAM[8*8]; /* internal GP register 8 * 8bank */ + uint8_t m_RAM[8*8]; /* internal GP register 8 * 8bank */ unsigned m_PREVPC; PAIR m_retptr; /* for 8301, return address of CALL */ PAIR m_pc; /* 2bit+8bit program counter */ - UINT8 m_regPtr; /* RB register base */ - UINT8 m_mb; /* MB memory bank reg. latch after Branch */ - UINT8 m_cf; /* C flag */ - UINT8 m_zf; /* Z flag */ - UINT8 m_savec; /* for 8301, save flags */ - UINT8 m_savez; /* for 8301, save flags */ + uint8_t m_regPtr; /* RB register base */ + uint8_t m_mb; /* MB memory bank reg. latch after Branch */ + uint8_t m_cf; /* C flag */ + uint8_t m_zf; /* Z flag */ + uint8_t m_savec; /* for 8301, save flags */ + uint8_t m_savez; /* for 8301, save flags */ // PAIR m_ix0; /* 8bit memory read index reg. */ PAIR m_ix1; /* 8bitmemory read index reg. */ PAIR m_ix2; /* 8bitmemory write index reg. */ - UINT8 m_lp0; /* 8bit loop reg. */ - UINT8 m_lp1; /* 8bit loop reg. */ - UINT8 m_lp2; /* 8bit loop reg. */ - UINT8 m_A; /* 8bit accumerator */ - UINT8 m_B; /* 8bit regiser */ + uint8_t m_lp0; /* 8bit loop reg. */ + uint8_t m_lp1; /* 8bit loop reg. */ + uint8_t m_lp2; /* 8bit loop reg. */ + uint8_t m_A; /* 8bit accumerator */ + uint8_t m_B; /* 8bit regiser */ // - UINT8 m_halt; /* halt input line */ + uint8_t m_halt; /* halt input line */ address_space *m_program; direct_read_data *m_direct; @@ -396,9 +396,9 @@ protected: const s_opcode *m_opmap; // Used for import/export only - UINT8 m_sp; - UINT8 m_R[8]; - UINT8 m_flags; + uint8_t m_sp; + uint8_t m_R[8]; + uint8_t m_flags; }; @@ -406,7 +406,7 @@ class alpha8301_cpu_device : public alpha8201_cpu_device { public: // construction/destruction - alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + alpha8301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/alto2/a2dht.cpp b/src/devices/cpu/alto2/a2dht.cpp index cb2a0ee7fa9..620a5491817 100644 --- a/src/devices/cpu/alto2/a2dht.cpp +++ b/src/devices/cpu/alto2/a2dht.cpp @@ -74,7 +74,7 @@ void alto2_cpu_device::f1_early_dht_block() */ void alto2_cpu_device::f2_late_dht_setmode() { - UINT16 r = X_RDBITS(m_bus,16,0,0); + uint16_t r = X_RDBITS(m_bus,16,0,0); m_dsp.setmode = m_bus; LOG((this,LOG_DHT,2," SETMODE<- BUS (%#o), branch on BUS[0] (%#o | %#o)\n", m_bus, m_next2, r)); m_next2 |= r; diff --git a/src/devices/cpu/alto2/a2disk.cpp b/src/devices/cpu/alto2/a2disk.cpp index 0d0d43c0ceb..8a8d8f0d1d3 100644 --- a/src/devices/cpu/alto2/a2disk.cpp +++ b/src/devices/cpu/alto2/a2disk.cpp @@ -346,7 +346,7 @@ void alto2_cpu_device::kwd_timing(int bitclk, int datin, int block) diablo_hd_device* dhd = m_drive[m_dsk.drive]; int wddone = m_dsk.wddone; // get previous state of word-done int i; - UINT8 s0, s1; + uint8_t s0, s1; LOG((this,LOG_DISK,9," *** KWD timing bitclk:%d datin:%d block:%d\n", bitclk, datin, block)); if (0 == m_dsk.seclate) @@ -794,7 +794,7 @@ void alto2_cpu_device::kwd_timing(int bitclk, int datin, int block) * @param ptr some unused pointer * @param arg contains the seclate value */ -void alto2_cpu_device::disk_seclate(void* ptr, INT32 arg) +void alto2_cpu_device::disk_seclate(void* ptr, int32_t arg) { (void)ptr; LOG((this,LOG_DISK,2," SECLATE -> %d\n", arg)); @@ -807,7 +807,7 @@ void alto2_cpu_device::disk_seclate(void* ptr, INT32 arg) * @param ptr some unused pointer * @param arg contains the ok_to_run value */ -void alto2_cpu_device::disk_ok_to_run(void* ptr, INT32 arg) +void alto2_cpu_device::disk_ok_to_run(void* ptr, int32_t arg) { (void)ptr; LOG((this,LOG_DISK,2," OK TO RUN -> %d\n", arg)); @@ -835,7 +835,7 @@ void alto2_cpu_device::disk_ok_to_run(void* ptr, INT32 arg) * @param ptr some unused pointer * @param arg contains the drive, cylinder, and restore flag */ -void alto2_cpu_device::disk_strobon(void* ptr, INT32 arg) +void alto2_cpu_device::disk_strobon(void* ptr, int32_t arg) { (void)ptr; int unit = arg % 2; @@ -849,7 +849,7 @@ void alto2_cpu_device::disk_strobon(void* ptr, INT32 arg) dhd->set_restore(restore); // This is really monoflop 52a generating a very short 0 pulse for (int strobe = 0; strobe < 2; strobe++) { - UINT8 s0, s1; + uint8_t s0, s1; dhd->set_strobe(strobe); // pulse the strobe signal to the unit int lai = dhd->get_log_addx_interlock_0(); @@ -903,7 +903,7 @@ void alto2_cpu_device::disk_strobon(void* ptr, INT32 arg) } /** @brief timer callback to change the READY monoflop 31a */ -void alto2_cpu_device::disk_ready_mf31a(void* ptr, INT32 arg) +void alto2_cpu_device::disk_ready_mf31a(void* ptr, int32_t arg) { diablo_hd_device* dhd = m_drive[m_dsk.drive]; m_dsk.ready_mf31a = arg & dhd->get_ready_0(); @@ -938,7 +938,7 @@ void alto2_cpu_device::disk_block(int task) void alto2_cpu_device::bs_early_read_kstat() { diablo_hd_device* dhd = m_drive[m_dsk.drive]; - UINT16 r; + uint16_t r; /* KSTAT[4-7] bus is open */ PUT_KSTAT_DONE(m_dsk.kstat, 017); @@ -984,7 +984,7 @@ void alto2_cpu_device::bs_early_read_kstat() */ void alto2_cpu_device::bs_early_read_kdata() { - UINT16 r; + uint16_t r; /* get the current word from the drive */ r = m_dsk.datain; LOG((this,LOG_DISK,1," <-KDATA (%#o)\n", r)); @@ -1045,7 +1045,7 @@ void alto2_cpu_device::f1_late_load_kstat() * Q Q' inverted to BUS[13] on <-KSTAT */ for (int i = 0; i < 2; i++) { - UINT8 s0, s1; + uint8_t s0, s1; s0 = m_dsk.ff_44b; s1 = i ? JKFF_CLK : JKFF_0; if (!GET_KSTAT_CKSUM(m_bus)) @@ -1173,7 +1173,7 @@ void alto2_cpu_device::f1_late_increcno() void alto2_cpu_device::f1_late_clrstat() { diablo_hd_device* dhd = m_drive[m_dsk.drive]; - UINT8 s0, s1; + uint8_t s0, s1; /* clears the LAI clocked flip-flop 44a * JK flip-flop 44a (LAI' clocked) @@ -1274,7 +1274,7 @@ void alto2_cpu_device::f1_late_clrstat() */ void alto2_cpu_device::f1_late_load_kcom() { - UINT16 change = m_dsk.kcom ^ m_bus; + uint16_t change = m_dsk.kcom ^ m_bus; m_dsk.kcom = m_bus; LOG((this,LOG_DISK,2," KCOM<-; BUS %06o\n", m_dsk.kcom)); LOG((this,LOG_DISK,2," XFEROFF : %d\n", GET_KCOM_XFEROFF(m_dsk.kcom))); @@ -1285,7 +1285,7 @@ void alto2_cpu_device::f1_late_load_kcom() if (GET_KCOM_WDINHIB(change)) { // WDALLOW going 0: should asynchronously reset 43a and 53a and set 53b if (m_task == task_kwd) { - UINT8 s0, s1; + uint8_t s0, s1; /** * JK flip-flop 53b (word task) *
@@ -1402,7 +1402,7 @@ void alto2_cpu_device::f1_late_load_kadr()
 void alto2_cpu_device::f2_late_init()
 {
 	// INIT = current task == KWD and WDINIT
-	UINT16 r = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
+	uint16_t r = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
 	LOG((this,LOG_DISK,1,"   INIT; %sbranch (%#o | %#o)\n", r ? "" : "no ", m_next2, r));
 	m_next2 |= r;
 	m_dsk.wdinit0 = 0;
@@ -1432,8 +1432,8 @@ void alto2_cpu_device::f2_late_init()
  */
 void alto2_cpu_device::f2_late_rwc()
 {
-	UINT16 r;
-	UINT16 init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
+	uint16_t r;
+	uint16_t init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
 
 	switch (m_dsk.krwc & 3) {
 	case 0:     // read
@@ -1485,8 +1485,8 @@ void alto2_cpu_device::f2_late_rwc()
  */
 void alto2_cpu_device::f2_late_recno()
 {
-	UINT16 r = m_dsk.krecno;
-	UINT16 init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
+	uint16_t r = m_dsk.krecno;
+	uint16_t init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
 	LOG((this,LOG_DISK,1,"   RECNO; %sbranch recno:%d (%#o|%#o|%#o)\n", (r | init) ? "" : "no ", m_dsk.krecno, m_next2, r, init));
 	m_next2 |= r | init;
 	m_dsk.wdinit0 = 0;
@@ -1499,8 +1499,8 @@ void alto2_cpu_device::f2_late_recno()
  */
 void alto2_cpu_device::f2_late_xfrdat()
 {
-	UINT16 r = GET_KADR_NOXFER(m_dsk.kadr) ? 0 : 1;
-	UINT16 init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
+	uint16_t r = GET_KADR_NOXFER(m_dsk.kadr) ? 0 : 1;
+	uint16_t init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
 	LOG((this,LOG_DISK,1,"   XFRDAT; %sbranch (%#o|%#o|%#o)\n", (r | init) ? "" : "no ", m_next2, r, init));
 	m_next2 |= r | init;
 	m_dsk.wdinit0 = 0;
@@ -1514,8 +1514,8 @@ void alto2_cpu_device::f2_late_xfrdat()
 void alto2_cpu_device::f2_late_swrnrdy()
 {
 	diablo_hd_device* dhd = m_drive[m_dsk.drive];
-	UINT16 r = dhd->get_seek_read_write_0();
-	UINT16 init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
+	uint16_t r = dhd->get_seek_read_write_0();
+	uint16_t init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
 
 	LOG((this,LOG_DISK,1,"   SWRNRDY; %sbranch (%#o|%#o|%#o)\n", (r | init) ? "" : "no ", m_next2, r, init));
 	m_next2 |= r | init;
@@ -1529,8 +1529,8 @@ void alto2_cpu_device::f2_late_swrnrdy()
  */
 void alto2_cpu_device::f2_late_nfer()
 {
-	UINT16 r = m_dsk.kfer ? 0 : 1;
-	UINT16 init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
+	uint16_t r = m_dsk.kfer ? 0 : 1;
+	uint16_t init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
 
 	LOG((this,LOG_DISK,1,"   NFER; %sbranch (%#o|%#o|%#o)\n", (r | init) ? "" : "no ", m_next2, r, init));
 	m_next2 |= r | init;
@@ -1558,8 +1558,8 @@ void alto2_cpu_device::f2_late_nfer()
  */
 void alto2_cpu_device::f2_late_strobon()
 {
-	UINT16 r = m_dsk.strobe;
-	UINT16 init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
+	uint16_t r = m_dsk.strobe;
+	uint16_t init = (m_task == task_kwd && m_dsk.wdinit0) ? 037 : 0;
 
 	LOG((this,LOG_DISK,2,"   STROBON; %sbranch (%#o|%#o|%#o)\n", (r | init) ? "" : "no ", m_next2, r, init));
 	m_next2 |= r | init;
@@ -1572,7 +1572,7 @@ void alto2_cpu_device::f2_late_strobon()
  * @param id timer id
  * @param arg bit number
  */
-void alto2_cpu_device::disk_bitclk(void* ptr, INT32 arg)
+void alto2_cpu_device::disk_bitclk(void* ptr, int32_t arg)
 {
 	(void)ptr;
 	diablo_hd_device* dhd = m_drive[m_dsk.drive];
diff --git a/src/devices/cpu/alto2/a2disk.h b/src/devices/cpu/alto2/a2disk.h
index e000ad7cfc4..cb5d671c76a 100644
--- a/src/devices/cpu/alto2/a2disk.h
+++ b/src/devices/cpu/alto2/a2disk.h
@@ -15,40 +15,40 @@ diablo_hd_device* m_drive[2];       //!< two diablo_hd_device drives
 
 //! disk controller context
 struct {
-	UINT8 drive;                    //!< selected drive from KADDR[14] (written to data out with SENDADR)
-	UINT16 kaddr;                   //!< A[0-15] disk hardware address (sector, cylinder, head, drive, restore)
-	UINT16 kadr;                    //!< C[0-15] with read/write/check modes for header, label and data
-	UINT16 kstat;                   //!< S[0-15] disk status
-	UINT16 kcom;                    //!< disk command (5 bits kcom[1-5])
-	UINT8 krecno;                   //!< record number (2 bits indexing header, label, data, -/-)
-	UINT8 egate;                    //!< current erase gate signal to the DIABLO hd
-	UINT8 wrgate;                   //!< current write gate signal to the DIABLO hd
-	UINT8 rdgate;                   //!< current read gate signal to the DIABLO hd
-	UINT32 shiftin;                 //!< input shift register
-	UINT32 shiftout;                //!< output shift register
-	UINT32 datain;                  //!< disk data in latch
-	UINT32 dataout;                 //!< disk data out latch
-	UINT8 krwc;                     //!< read/write/check for current record
-	UINT8 kfer;                     //!< disk fatal error signal state
-	UINT8 wdtskena;                 //!< disk word task enable (active low)
-	UINT8 wddone;                   //!< previous state of WDDONE
-	UINT8 wdinit0;                  //!< disk word task init at the early microcycle
-	UINT8 wdinit;                   //!< disk word task init at the late microcycle
-	UINT8 strobe;                   //!< strobe (still) active
+	uint8_t drive;                    //!< selected drive from KADDR[14] (written to data out with SENDADR)
+	uint16_t kaddr;                   //!< A[0-15] disk hardware address (sector, cylinder, head, drive, restore)
+	uint16_t kadr;                    //!< C[0-15] with read/write/check modes for header, label and data
+	uint16_t kstat;                   //!< S[0-15] disk status
+	uint16_t kcom;                    //!< disk command (5 bits kcom[1-5])
+	uint8_t krecno;                   //!< record number (2 bits indexing header, label, data, -/-)
+	uint8_t egate;                    //!< current erase gate signal to the DIABLO hd
+	uint8_t wrgate;                   //!< current write gate signal to the DIABLO hd
+	uint8_t rdgate;                   //!< current read gate signal to the DIABLO hd
+	uint32_t shiftin;                 //!< input shift register
+	uint32_t shiftout;                //!< output shift register
+	uint32_t datain;                  //!< disk data in latch
+	uint32_t dataout;                 //!< disk data out latch
+	uint8_t krwc;                     //!< read/write/check for current record
+	uint8_t kfer;                     //!< disk fatal error signal state
+	uint8_t wdtskena;                 //!< disk word task enable (active low)
+	uint8_t wddone;                   //!< previous state of WDDONE
+	uint8_t wdinit0;                  //!< disk word task init at the early microcycle
+	uint8_t wdinit;                   //!< disk word task init at the late microcycle
+	uint8_t strobe;                   //!< strobe (still) active
 	emu_timer* strobon_timer;       //!< set strobe on timer
-	UINT8 bitclk;                   //!< current bitclk state (either crystal clock, or rdclk from the drive)
+	uint8_t bitclk;                   //!< current bitclk state (either crystal clock, or rdclk from the drive)
 	attoseconds_t bitclk_time[2];   //!< per drive time in attoseconds per bit
-	UINT8 datin;                    //!< current datin from the drive
-	UINT8 bitcount;                 //!< bit counter
-	UINT8 carry;                    //!< carry output of the bitcounter
-	UINT8 seclate;                  //!< sector late (monoflop output)
+	uint8_t datin;                    //!< current datin from the drive
+	uint8_t bitcount;                 //!< bit counter
+	uint8_t carry;                    //!< carry output of the bitcounter
+	uint8_t seclate;                  //!< sector late (monoflop output)
 	emu_timer* seclate_timer;       //!< sector late timer
-	UINT8 seekok;                   //!< seekok state (SKINC' & LAI' & ff_44a.Q')
-	UINT8 ok_to_run;                //!< ok to run signal (set to 1 some time after reset)
+	uint8_t seekok;                   //!< seekok state (SKINC' & LAI' & ff_44a.Q')
+	uint8_t ok_to_run;                //!< ok to run signal (set to 1 some time after reset)
 	emu_timer* ok_to_run_timer;     //!< ok to run timer
-	UINT8 ready_mf31a;              //!< ready monoflop 31a
+	uint8_t ready_mf31a;              //!< ready monoflop 31a
 	emu_timer* ready_timer;         //!< ready timer
-	UINT8 seclate_mf31b;            //!< seclate monoflop 31b
+	uint8_t seclate_mf31b;            //!< seclate monoflop 31b
 	jkff_t ff_21a;                  //!< JK flip-flop 21a (sector task)
 	jkff_t ff_21a_old;              //!< -"- previous state
 	jkff_t ff_21b;                  //!< JK flip-flop 21b (sector task)
diff --git a/src/devices/cpu/alto2/a2disp.cpp b/src/devices/cpu/alto2/a2disp.cpp
index df8ac15f3a5..0102cd8a73f 100644
--- a/src/devices/cpu/alto2/a2disp.cpp
+++ b/src/devices/cpu/alto2/a2disp.cpp
@@ -46,7 +46,7 @@ static const prom_load_t pl_displ_a38 =
 	/* shift */ 0,
 	/* dmap */  DMAP_DEFAULT,
 	/* dand */  ZERO,
-	/* type */  sizeof(UINT8)
+	/* type */  sizeof(uint8_t)
 };
 
 //! PROM a38 bit O1 is STOPWAKE' (stop DWT if bit is zero)
@@ -134,7 +134,7 @@ static const prom_load_t pl_displ_a63 =
 	/* shift */ 0,
 	/* dmap */  DMAP_DEFAULT,
 	/* dand */  ZERO,
-	/* type */  sizeof(UINT8)
+	/* type */  sizeof(uint8_t)
 };
 
 //!< test the HBLANK (horizontal blanking) signal in PROM a63 being high
@@ -177,7 +177,7 @@ static const prom_load_t pl_displ_a66 =
 	/* shift */ 0,
 	/* dmap */  DMAP_DEFAULT,
 	/* dand */  ZERO,
-	/* type */  sizeof(UINT8)
+	/* type */  sizeof(uint8_t)
 };
 
 //! test the VSYNC (vertical synchronisation) signal in PROM a66 being high
@@ -189,7 +189,7 @@ static const prom_load_t pl_displ_a66 =
 /**
  * @brief double the bits for a byte (left and right of display word) to a word
  */
-static const UINT16 double_bits[256] = {
+static const uint16_t double_bits[256] = {
 	0x0000,0x0003,0x000c,0x000f,0x0030,0x0033,0x003c,0x003f,
 	0x00c0,0x00c3,0x00cc,0x00cf,0x00f0,0x00f3,0x00fc,0x00ff,
 	0x0300,0x0303,0x030c,0x030f,0x0330,0x0333,0x033c,0x033f,
@@ -243,7 +243,7 @@ static const UINT16 double_bits[256] = {
 #define A63_NEXT(n) ((n >> 2) & 017)
 
 //! update the internal frame buffer and draw the scanline segment if changed
-void alto2_cpu_device::update_framebuf_word(UINT16* framebuf, int x, int y, UINT16 word)
+void alto2_cpu_device::update_framebuf_word(uint16_t* framebuf, int x, int y, uint16_t word)
 {
 	if (y >= A2_DISP_TOTAL_HEIGHT)
 		return;
@@ -272,9 +272,9 @@ void alto2_cpu_device::unload_word()
 		m_unload_time = -1;
 		return;
 	}
-	UINT16* framebuf = m_dsp.framebuf.get() + y * A2_DISP_SCANLINE_WORDS;
-	UINT16 word = m_dsp.inverse;
-	UINT8 a38 = m_disp_a38[m_dsp.ra * 16 + m_dsp.wa];
+	uint16_t* framebuf = m_dsp.framebuf.get() + y * A2_DISP_SCANLINE_WORDS;
+	uint16_t word = m_dsp.inverse;
+	uint8_t a38 = m_disp_a38[m_dsp.ra * 16 + m_dsp.wa];
 	if (FIFO_MBEMPTY(a38))
 	{
 		LOG((this,LOG_DISPL,1, " DSP FIFO underrun y:%d x:%d\n", y, x));
@@ -289,12 +289,12 @@ void alto2_cpu_device::unload_word()
 
 	if (m_dsp.halfclock)
 	{
-		const UINT16 word1 = double_bits[word / 256];
+		const uint16_t word1 = double_bits[word / 256];
 		update_framebuf_word(framebuf, x, y, word1);
 		x++;
 		if (x < A2_DISP_VISIBLE_WORDS)
 		{
-			const UINT16 word2 = double_bits[word % 256];
+			const uint16_t word2 = double_bits[word % 256];
 			update_framebuf_word(framebuf, x, y, word2);
 			x++;
 		}
@@ -326,7 +326,7 @@ void alto2_cpu_device::display_state_machine()
 		LOG((this,LOG_DISPL,2," HLC=%d", m_dsp.hlc));
 	}
 
-	const UINT8 a63 = m_disp_a63[m_dsp.state];
+	const uint8_t a63 = m_disp_a63[m_dsp.state];
 	if (A63_HLCGATE(a63))
 	{
 		// count horizontal line counters and wrap
@@ -341,10 +341,10 @@ void alto2_cpu_device::display_state_machine()
 		m_task_wakeup |= 1 << task_mrt;
 	}
 	// PROM a66 is disabled, if any of HLC256 or HLC512 are high
-	const UINT8 a66 = (HLC256 | HLC512) ? 017 : m_disp_a66[m_dsp.hlc & 0377];
+	const uint8_t a66 = (HLC256 | HLC512) ? 017 : m_disp_a66[m_dsp.hlc & 0377];
 
 	// next address from PROM a63, use A4 from HLC1
-	const UINT8 next = ((HLC1 ^ 1) << 4) | A63_NEXT(a63);
+	const uint8_t next = ((HLC1 ^ 1) << 4) | A63_NEXT(a63);
 
 	if (A66_VBLANK(a66))
 	{
@@ -412,7 +412,7 @@ void alto2_cpu_device::display_state_machine()
 	 * if DHT is not blocked, and if the buffer is not full, DWT wakeups
 	 * are generated.
 	 */
-	UINT8 a38 = m_disp_a38[m_dsp.ra * 16 + m_dsp.wa];
+	uint8_t a38 = m_disp_a38[m_dsp.ra * 16 + m_dsp.wa];
 	if (!m_dsp.dwt_blocks && !m_dsp.dht_blocks && !FIFO_STOPWAKE(a38))
 	{
 		m_task_wakeup |= 1 << task_dwt;
@@ -484,7 +484,7 @@ void alto2_cpu_device::display_state_machine()
  */
 void alto2_cpu_device::f2_late_evenfield()
 {
-	UINT16 r = HLC1024 ^ 1;
+	uint16_t r = HLC1024 ^ 1;
 	LOG((this,LOG_DISPL,2,"  EVENFIELD branch (%#o | %#o)\n", m_next2, r));
 	m_next2 |= r;
 }
@@ -522,10 +522,10 @@ void alto2_cpu_device::init_disp()
 
 	m_dsp.hlc = A2_DISP_HLC_START;
 
-	m_dsp.framebuf = std::make_unique(A2_DISP_TOTAL_HEIGHT * A2_DISP_SCANLINE_WORDS);
-	m_dsp.patterns = auto_alloc_array(machine(), UINT8, 65536 * 16);
+	m_dsp.framebuf = std::make_unique(A2_DISP_TOTAL_HEIGHT * A2_DISP_SCANLINE_WORDS);
+	m_dsp.patterns = auto_alloc_array(machine(), uint8_t, 65536 * 16);
 	for (int y = 0; y < 65536; y++) {
-		UINT8* dst = m_dsp.patterns + y * 16;
+		uint8_t* dst = m_dsp.patterns + y * 16;
 		for (int x = 0; x < 16; x++)
 			*dst++ = (~y >> (15 - x)) & 1;
 	}
@@ -559,11 +559,11 @@ void alto2_cpu_device::reset_disp()
 	m_dsp.vblank = false;
 	m_dsp.xpreg = 0;
 	m_dsp.csr = 0;
-	memset(m_dsp.framebuf.get(), 1, sizeof(UINT16) * A2_DISP_HEIGHT * A2_DISP_SCANLINE_WORDS);
+	memset(m_dsp.framebuf.get(), 1, sizeof(uint16_t) * A2_DISP_HEIGHT * A2_DISP_SCANLINE_WORDS);
 }
 
 /* Video update */
-UINT32 alto2_cpu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t alto2_cpu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
 {
 	copybitmap(bitmap, *m_dsp.bitmap, 0, 0, 0, 0, cliprect);
 	return 0;
diff --git a/src/devices/cpu/alto2/a2disp.h b/src/devices/cpu/alto2/a2disp.h
index c2c321583e6..2d5e641b035 100644
--- a/src/devices/cpu/alto2/a2disp.h
+++ b/src/devices/cpu/alto2/a2disp.h
@@ -193,26 +193,26 @@
 #ifndef _A2DISP_H_
 #define _A2DISP_H_
 struct {
-	UINT32 state;                           //!< current state of the display_state_machine()
-	UINT32 hlc;                             //!< horizontal line counter
-	UINT32 setmode;                         //!< value written by last SETMODE<-
-	UINT32 inverse;                         //!< set to 0xffff if line is inverse, 0x0000 otherwise
-	UINT32 scanline;                        //!< current scanline
+	uint32_t state;                           //!< current state of the display_state_machine()
+	uint32_t hlc;                             //!< horizontal line counter
+	uint32_t setmode;                         //!< value written by last SETMODE<-
+	uint32_t inverse;                         //!< set to 0xffff if line is inverse, 0x0000 otherwise
+	uint32_t scanline;                        //!< current scanline
 	bool halfclock;                         //!< false for normal pixel clock, true for half pixel clock
 	bool vblank;                            //!< true during vblank, false otherwise
-	UINT16 fifo[A2_DISP_FIFO];              //!< display word fifo
-	UINT32 wa;                              //!< fifo input pointer (write address; 4-bit)
-	UINT32 ra;                              //!< fifo output pointer (read address; 4-bit)
-	UINT32 a63;                             //!< most recent value read from the PROM a63
-	UINT32 a66;                             //!< most recent value read from the PROM a66
+	uint16_t fifo[A2_DISP_FIFO];              //!< display word fifo
+	uint32_t wa;                              //!< fifo input pointer (write address; 4-bit)
+	uint32_t ra;                              //!< fifo output pointer (read address; 4-bit)
+	uint32_t a63;                             //!< most recent value read from the PROM a63
+	uint32_t a66;                             //!< most recent value read from the PROM a66
 	bool dht_blocks;                        //!< set true, if the DHT executed BLOCK
 	bool dwt_blocks;                        //!< set true, if the DWT executed BLOCK
 	bool curt_blocks;                       //!< set true, if the CURT executed BLOCK
 	bool curt_wakeup;                       //!< set true, if CURT wakeups are generated
-	UINT32 xpreg;                           //!< cursor cursor x position register (10-bit)
-	UINT32 csr;                             //!< cursor shift register (16-bit)
-	std::unique_ptr framebuf;     //!< array of words of the raw bitmap that is displayed
-	UINT8 *patterns;                        //!< array of 65536 patterns (16 bytes) with 1 byte per pixel
+	uint32_t xpreg;                           //!< cursor cursor x position register (10-bit)
+	uint32_t csr;                             //!< cursor shift register (16-bit)
+	std::unique_ptr framebuf;     //!< array of words of the raw bitmap that is displayed
+	uint8_t *patterns;                        //!< array of 65536 patterns (16 bytes) with 1 byte per pixel
 	std::unique_ptr bitmap;   //!< MAME bitmap with 16 bit indices
 }   m_dsp;
 
@@ -238,7 +238,7 @@ struct {
  *  O3 (010) = MBEMPTY'
  * 
*/ -UINT8* m_disp_a38; +uint8_t* m_disp_a38; //! output bits of PROM A38 enum { @@ -273,7 +273,7 @@ enum { * which happens to be very close to every 7th CPU micrcocycle. * */ -UINT8* m_disp_a63; +uint8_t* m_disp_a63; enum { disp_a63_HBLANK = (1 << 0), //!< PROM a63 B0 is latched as HBLANK signal @@ -293,7 +293,7 @@ enum { * Address lines are driven by H[1] to H[128] of the horz. line counters. * The PROM is enabled whenever H[256] and H[512] are both 0. */ -UINT8* m_disp_a66; +uint8_t* m_disp_a66; enum { disp_a66_VSYNC_ODD = (1 << 0), //!< Q1 (001) is VSYNC for the odd field (with H1024=1) @@ -302,7 +302,7 @@ enum { disp_a66_VBLANK_EVEN = (1 << 3) //!< Q4 (010) is VBLANK for the even field (with H1024=0) }; -void update_framebuf_word(UINT16* framebuf, int x, int y, UINT16 word); +void update_framebuf_word(uint16_t* framebuf, int x, int y, uint16_t word); void unload_word(); //!< unload the next word from the display FIFO and shift it to the screen void display_state_machine(); //!< function called by the CPU execution loop to enter the next display state diff --git a/src/devices/cpu/alto2/a2dwt.cpp b/src/devices/cpu/alto2/a2dwt.cpp index c11523a02ef..752a1ab9660 100644 --- a/src/devices/cpu/alto2/a2dwt.cpp +++ b/src/devices/cpu/alto2/a2dwt.cpp @@ -67,7 +67,7 @@ void alto2_cpu_device::f2_late_load_ddr() LOG((this,LOG_DWT,2," DDR<- BUS (%#o)\n", m_bus)); m_dsp.fifo[m_dsp.wa] = m_bus; m_dsp.wa = (m_dsp.wa + 1) % A2_DISP_FIFO; - UINT8 a38 = m_disp_a38[m_dsp.ra * 16 + m_dsp.wa]; + uint8_t a38 = m_disp_a38[m_dsp.ra * 16 + m_dsp.wa]; if (FIFO_STOPWAKE(a38)) m_task_wakeup &= ~(1 << task_dwt); LOG((this,LOG_DWT,2, " DWT push %04x into FIFO[%02o]%s\n", diff --git a/src/devices/cpu/alto2/a2emu.cpp b/src/devices/cpu/alto2/a2emu.cpp index 8cb0296e512..bd0fb8d16f6 100644 --- a/src/devices/cpu/alto2/a2emu.cpp +++ b/src/devices/cpu/alto2/a2emu.cpp @@ -247,7 +247,7 @@ */ void alto2_cpu_device::bs_early_emu_disp() { - UINT16 r = IR_DISP(m_emu.ir); + uint16_t r = IR_DISP(m_emu.ir); if (IR_X(m_emu.ir)) { r = ((signed char)r) & 0177777; } @@ -304,7 +304,7 @@ void alto2_cpu_device::f1_late_emu_load_esrb() */ void alto2_cpu_device::f1_early_rsnf() { - UINT16 r = 0177400 | m_ether_id; + uint16_t r = 0177400 | m_ether_id; LOG((this,LOG_EMU,2," <-RSNF; (%#o)\n", r)); m_bus &= r; } @@ -354,7 +354,7 @@ void alto2_cpu_device::f1_early_startf() */ void alto2_cpu_device::f2_late_busodd() { - UINT16 r = m_bus & 1; + uint16_t r = m_bus & 1; LOG((this,LOG_EMU,2," BUSODD; %sbranch (%#o|%#o)\n", r ? "" : "no ", m_next2, r)); m_next2 |= r; } @@ -424,22 +424,22 @@ void alto2_cpu_device::f2_early_load_dns() */ void alto2_cpu_device::f2_late_load_dns() { - UINT8 IR10 = X_BIT(m_emu.ir,16,10); - UINT8 IR11 = X_BIT(m_emu.ir,16,11); - UINT8 IR12 = X_BIT(m_emu.ir,16,12); - UINT8 IR13 = X_BIT(m_emu.ir,16,13); - UINT8 IR14 = X_BIT(m_emu.ir,16,14); - UINT8 IR15 = X_BIT(m_emu.ir,16,15); - UINT8 exorB = IR11 ^ IR10; - UINT8 CARRY = m_emu.cy ^ 1; - UINT8 ORA = (exorB | CARRY) ^ 1; - UINT8 exorC = ORA ^ (IR11 ^ 1); - UINT8 exorD = exorC ^ m_laluc0; - UINT8 XC = exorD; - UINT8 NEWCARRY; - UINT8 DCARRY; - UINT8 DSKIP; - UINT8 SHZERO; + uint8_t IR10 = X_BIT(m_emu.ir,16,10); + uint8_t IR11 = X_BIT(m_emu.ir,16,11); + uint8_t IR12 = X_BIT(m_emu.ir,16,12); + uint8_t IR13 = X_BIT(m_emu.ir,16,13); + uint8_t IR14 = X_BIT(m_emu.ir,16,14); + uint8_t IR15 = X_BIT(m_emu.ir,16,15); + uint8_t exorB = IR11 ^ IR10; + uint8_t CARRY = m_emu.cy ^ 1; + uint8_t ORA = (exorB | CARRY) ^ 1; + uint8_t exorC = ORA ^ (IR11 ^ 1); + uint8_t exorD = exorC ^ m_laluc0; + uint8_t XC = exorD; + uint8_t NEWCARRY; + uint8_t DCARRY; + uint8_t DSKIP; + uint8_t SHZERO; switch (f1()) { case f1_l_rsh_1: // <-L RSH 1 @@ -534,7 +534,7 @@ void alto2_cpu_device::bitblt_info() */ void alto2_cpu_device::f2_late_load_ir() { - UINT16 r = (X_BIT(m_bus,16,0) << 3) | X_RDBITS(m_bus,16,5,7); + uint16_t r = (X_BIT(m_bus,16,0) << 3) | X_RDBITS(m_bus,16,5,7); #if ALTO2_DEBUG /* special logging of some opcodes */ @@ -599,7 +599,7 @@ void alto2_cpu_device::f2_late_load_ir() */ void alto2_cpu_device::f2_late_idisp() { - UINT16 r; + uint16_t r; if (IR_ARITH(m_emu.ir)) { /* 1xxxxxxxxxxxxxxx */ @@ -633,7 +633,7 @@ void alto2_cpu_device::f2_early_acsource() */ void alto2_cpu_device::f2_late_acsource() { - UINT16 r; + uint16_t r; if (IR_ARITH(m_emu.ir)) { /* 1xxxxxxxxxxxxxxx */ diff --git a/src/devices/cpu/alto2/a2emu.h b/src/devices/cpu/alto2/a2emu.h index 344c7ff2c71..5fd012b6196 100644 --- a/src/devices/cpu/alto2/a2emu.h +++ b/src/devices/cpu/alto2/a2emu.h @@ -42,9 +42,9 @@ enum { }; struct { - UINT16 ir; //!< emulator instruction register - UINT8 skip; //!< emulator skip - UINT8 cy; //!< emulator carry + uint16_t ir; //!< emulator instruction register + uint8_t skip; //!< emulator skip + uint8_t cy; //!< emulator carry } m_emu; void bs_early_emu_disp(); //!< bus source: drive bus by IR[8-15], possibly sign extended void f1_early_emu_block(); //!< F1 func: block task diff --git a/src/devices/cpu/alto2/a2ether.cpp b/src/devices/cpu/alto2/a2ether.cpp index 3a360f8854e..97d2fe6399e 100644 --- a/src/devices/cpu/alto2/a2ether.cpp +++ b/src/devices/cpu/alto2/a2ether.cpp @@ -58,7 +58,7 @@ static const prom_load_t pl_enet_a41 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; static const prom_load_t pl_enet_a42 = @@ -75,7 +75,7 @@ static const prom_load_t pl_enet_a42 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; /** @@ -117,7 +117,7 @@ static const prom_load_t pl_enet_a49 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; #define GET_ETH_WLF(st) X_BIT(st,16,4) //!< hardware status: write latch full/filled (? set by EODFCT) @@ -164,7 +164,7 @@ static const prom_load_t pl_enet_a49 = #define BREATHLEN ALTO2_ETHER_PACKET_SIZE //!< ethernet packet length #define BREATHADDR (0377<<8) //!< destination (0377) and source (0000) #define BREATHTYPE 0602 //!< ethernet packet type -static const UINT16 breath_of_life_data[BREATHLEN] = +static const uint16_t breath_of_life_data[BREATHLEN] = { BREATHADDR, /* 3MB destination and source */ BREATHTYPE, /* ether packet type */ @@ -207,7 +207,7 @@ static const UINT16 breath_of_life_data[BREATHLEN] = }; #if DEBUG_PACKETS -static void dump_ascii(device_t *device, const UINT16 *src, size_t size) +static void dump_ascii(device_t *device, const uint16_t *src, size_t size) { device->logerror(" ["); for (size_t offs = 0; offs < size; offs++) { @@ -219,11 +219,11 @@ static void dump_ascii(device_t *device, const UINT16 *src, size_t size) device->logerror("]\n"); } -static void dump_packet(device_t *device, const char* name, const UINT16 *src, size_t addr, size_t size) +static void dump_packet(device_t *device, const char* name, const uint16_t *src, size_t addr, size_t size) { size_t offs; for (offs = 0; offs < size; offs++) { - UINT16 word = src[offs]; + uint16_t word = src[offs]; if (offs % 8) { device->logerror(" %06o", word); } else { @@ -247,7 +247,7 @@ void alto2_cpu_device::eth_wakeup() { int st = m_eth.status; LOG((this,LOG_ETH,0,"IBUSY=%d OBUSY=%d ", GET_ETH_IBUSY(st), GET_ETH_OBUSY(st))); - UINT8 busy = GET_ETH_IBUSY(st) | GET_ETH_OBUSY(st); + uint8_t busy = GET_ETH_IBUSY(st) | GET_ETH_OBUSY(st); if (0 == busy) { // if not busy, reset the FIFO read and write counters m_eth.fifo_rd = 0; @@ -312,11 +312,11 @@ void alto2_cpu_device::eth_wakeup() * ************************************************************ */ - UINT8 a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; - UINT8 ETAC = m_task == task_ether ? 0 : 1; - UINT8 i1 = ~(BNE(a49) & ETAC); - UINT8 i2 = ~(~BNNE(a49) & i1); - UINT8 IDR = ~(GET_ETH_IBUSY(st) & i2); + uint8_t a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; + uint8_t ETAC = m_task == task_ether ? 0 : 1; + uint8_t i1 = ~(BNE(a49) & ETAC); + uint8_t i2 = ~(~BNNE(a49) & i1); + uint8_t IDR = ~(GET_ETH_IBUSY(st) & i2); if (0 == IDR) { m_task_wakeup |= 1 << task_ether; LOG((this,LOG_ETH,0,"IDR (input data ready)\n")); @@ -346,8 +346,8 @@ void alto2_cpu_device::eth_wakeup() * ************************************************************ */ - UINT8 o1 = ~(~GET_ETH_WLF(st) & BF(a49)); - UINT8 ODR = ~(GET_ETH_OBUSY(st) & ~GET_ETH_OEOT(st) & o1); + uint8_t o1 = ~(~GET_ETH_WLF(st) & BF(a49)); + uint8_t ODR = ~(GET_ETH_OBUSY(st) & ~GET_ETH_OEOT(st) & o1); if (0 == ODR) { m_task_wakeup |= 1 << task_ether; LOG((this,LOG_ETH,0,"ODR (output data ready)\n")); @@ -467,9 +467,9 @@ void alto2_cpu_device::eth_wakeup() * @param data 16 bit data * @return new CRC value after 16 bits */ -UINT32 f9401_7(UINT32 crc, UINT32 data) +uint32_t f9401_7(uint32_t crc, uint32_t data) { - static const UINT32 XOR = (1 << 10) | (1 << 3) | (1 << 0); + static const uint32_t XOR = (1 << 10) | (1 << 3) | (1 << 0); crc ^= data; for (int i = 0; i < 16; i++) crc = (crc >> 1) ^ ((crc & 1) ? XOR : 0); @@ -482,9 +482,9 @@ UINT32 f9401_7(UINT32 crc, UINT32 data) * This is probably lacking the updates to one or more of * the status flip flops. */ -void alto2_cpu_device::rx_breath_of_life(void* ptr, INT32 arg) +void alto2_cpu_device::rx_breath_of_life(void* ptr, int32_t arg) { - UINT32 data; + uint32_t data; if (arg == 0) { // on the first word set the IBUSY flip flop @@ -506,7 +506,7 @@ void alto2_cpu_device::rx_breath_of_life(void* ptr, INT32 arg) PUT_ETH_IT(m_eth.status, 1); // set IT (input shift register full ...)? - UINT8 a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; + uint8_t a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; if (0 == BF(a49)) PUT_ETH_IDL(m_eth.status, 1); // fifo is overrun: set input data late flip flop @@ -532,9 +532,9 @@ void alto2_cpu_device::rx_breath_of_life(void* ptr, INT32 arg) * @param ptr unused pointer * @param arg word count if >= 0, -1 if CRC is to be transmitted (last word) */ -void alto2_cpu_device::tx_packet(void* ptr, INT32 arg) +void alto2_cpu_device::tx_packet(void* ptr, int32_t arg) { - UINT32 data; + uint32_t data; // the last word sent is the CRC if (-1 == arg) { @@ -551,7 +551,7 @@ void alto2_cpu_device::tx_packet(void* ptr, INT32 arg) m_eth.tx_crc = f9401_7(m_eth.tx_crc, data); m_eth.fifo_rd = (m_eth.fifo_rd + 1) % ALTO2_ETHER_FIFO_SIZE; - UINT8 a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; + uint8_t a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; if (0 == BE(a49)) { // the FIFO is empty now: clear the OBUSY and WLF flip flops PUT_ETH_OBUSY(m_eth.status, 0); @@ -590,7 +590,7 @@ void alto2_cpu_device::eth_startf() */ void alto2_cpu_device::bs_early_eidfct() { - UINT16 r = m_eth.fifo[m_eth.fifo_rd]; + uint16_t r = m_eth.fifo[m_eth.fifo_rd]; LOG((this,LOG_ETH,3, " <-EIDFCT; pull %06o from FIFO[%02o]\n", r, m_eth.fifo_rd)); m_eth.fifo_rd = (m_eth.fifo_rd + 1) % ALTO2_ETHER_FIFO_SIZE; m_bus &= r; @@ -624,7 +624,7 @@ void alto2_cpu_device::f1_early_eth_block() */ void alto2_cpu_device::f1_early_eilfct() { - UINT16 r = m_eth.fifo[m_eth.fifo_rd]; + uint16_t r = m_eth.fifo[m_eth.fifo_rd]; LOG((this,LOG_ETH,3, " <-EILFCT; %06o at FIFO[%02o]\n", r, m_eth.fifo_rd)); m_bus &= r; } @@ -645,8 +645,8 @@ void alto2_cpu_device::f1_early_eilfct() */ void alto2_cpu_device::f1_early_epfct() { - UINT16 r = 0177777; - UINT16 st = m_eth.status; + uint16_t r = 0177777; + uint16_t st = m_eth.status; m_eth.status = 0; m_eth.tx_count = 0; @@ -718,7 +718,7 @@ void alto2_cpu_device::f2_late_eodfct() PUT_ETH_OBUSY(m_eth.status, 1); // set OBUSY (output busy) eth_wakeup(); // if the FIFO is full, stop wakeup and kick off the timer - UINT8 a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; + uint8_t a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; if (0 == BF(a49)) { m_task_wakeup &= ~(1 << task_ether); m_eth.tx_timer->adjust(attotime::from_usec(5.44), 0); @@ -753,7 +753,7 @@ void alto2_cpu_device::f2_late_eosfct() */ void alto2_cpu_device::f2_late_erbfct() { - UINT16 r = 0; + uint16_t r = 0; X_WRBITS(r,10,6,6,GET_ETH_ICMD(m_eth.status)); X_WRBITS(r,10,7,7,GET_ETH_OCMD(m_eth.status)); LOG((this,LOG_ETH,3, " ERBFCT; NEXT[6-7] = ICMD,OCMD (%#o | %#o)\n", m_next2, r)); @@ -789,7 +789,7 @@ void alto2_cpu_device::f2_late_eefct() */ void alto2_cpu_device::f2_late_ebfct() { - UINT16 r = 0; + uint16_t r = 0; X_WRBITS(r,10,6,6, GET_ETH_COLL(m_eth.status)); X_WRBITS(r,10,7,7, GET_ETH_IDL(m_eth.status) | @@ -809,8 +809,8 @@ void alto2_cpu_device::f2_late_ebfct() */ void alto2_cpu_device::f2_late_ecbfct() { - UINT16 r = 0; - UINT8 a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; + uint16_t r = 0; + uint8_t a49 = m_ether_a49[16 * m_eth.fifo_wr + m_eth.fifo_rd]; X_WRBITS(r,10,7,7,~BE(a49)); LOG((this,LOG_ETH,3, " ECBFCT; NEXT[7] = FIFO %sempty (%#o | %#o)\n", r ? "not " : "is ", m_next2, r)); m_next2 |= r; @@ -846,7 +846,7 @@ void alto2_cpu_device::activate_eth() */ void alto2_cpu_device::update_sysclk(int sysclk) { - UINT8 s0, s1; + uint8_t s0, s1; /* * JK flip-flop 35a (SIO' and SYSCLK clocked) @@ -926,10 +926,10 @@ void alto2_cpu_device::update_sysclk(int sysclk) * 3Y RR * 4Y WLL' */ - UINT8 WLLOAD; - UINT8 RDCNT0; - UINT8 RR; - UINT8 WLL0; + uint8_t WLLOAD; + uint8_t RDCNT0; + uint8_t RR; + uint8_t WLL0; if (m_eth.ff_10a & JKFF_Q) { WLLOAD = ~(sysclk & (f2() == f2_ether_eodfct)) & 1; RDCNT0 = m_eth.ff_52b & JKFF_Q ? 1 : 0; @@ -1167,7 +1167,7 @@ void alto2_cpu_device::update_sysclk(int sysclk) */ void alto2_cpu_device::update_rclk(int rclk) { - UINT8 s0, s1; + uint8_t s0, s1; /* * JK flip-flop 70a IMID (Sheet 14) @@ -1221,7 +1221,7 @@ void alto2_cpu_device::update_rclk(int rclk) */ void alto2_cpu_device::update_tclk(int tclk) { - UINT8 s0, s1; + uint8_t s0, s1; /* * JK flip-flop 52b OSLOAD (Sheet 17) @@ -1321,8 +1321,8 @@ void alto2_cpu_device::init_ether(int task) m_ether_a42 = prom_load(machine(), &pl_enet_a42, memregion("ether_a42")->base()); m_ether_a49 = prom_load(machine(), &pl_enet_a49, memregion("ether_a49")->base()); - m_eth.rx_packet = std::make_unique(sizeof(UINT16)*ALTO2_ETHER_PACKET_SIZE); - m_eth.tx_packet = std::make_unique(sizeof(UINT16)*ALTO2_ETHER_PACKET_SIZE); + m_eth.rx_packet = std::make_unique(sizeof(uint16_t)*ALTO2_ETHER_PACKET_SIZE); + m_eth.tx_packet = std::make_unique(sizeof(uint16_t)*ALTO2_ETHER_PACKET_SIZE); m_eth.tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(alto2_cpu_device::tx_packet),this)); m_eth.tx_timer->reset(); diff --git a/src/devices/cpu/alto2/a2ether.h b/src/devices/cpu/alto2/a2ether.h index 484bd187f8c..fe302fd0eef 100644 --- a/src/devices/cpu/alto2/a2ether.h +++ b/src/devices/cpu/alto2/a2ether.h @@ -37,9 +37,9 @@ enum { //!< f2 (1111): undefined }; -UINT8* m_ether_a41; //!< BPROM; P3601-1; 256x4; enet.a41 "PE1" -UINT8* m_ether_a42; //!< BPROM; P3601-1; 256x4; enet.a42 "PE2" -UINT8* m_ether_a49; //!< BPROM; P3601-1; 265x4 enet.a49 "AFIFO" +uint8_t* m_ether_a41; //!< BPROM; P3601-1; 256x4; enet.a41 "PE1" +uint8_t* m_ether_a42; //!< BPROM; P3601-1; 256x4; enet.a42 "PE2" +uint8_t* m_ether_a49; //!< BPROM; P3601-1; 265x4 enet.a49 "AFIFO" enum { ether_a49_BE = (1 << 0), //!< buffer empty ether_a49_BNE = (1 << 1), //!< buffer next empty @@ -48,17 +48,17 @@ enum { }; struct { - UINT32 serin; //!< serial input shift registers 74164 #37 and #33 - UINT16 fifo[ALTO2_ETHER_FIFO_SIZE]; //!< FIFO buffer - UINT16 fifo_rd; //!< FIFO input pointer - UINT16 fifo_wr; //!< FIFO output pointer - UINT16 status; //!< status word - UINT16 rx_crc; //!< receiver CRC - UINT16 tx_crc; //!< transmitter CRC - UINT32 rx_count; //!< received words count - UINT32 tx_count; //!< transmitted words count - std::unique_ptr rx_packet; //!< buffer to collect received words - std::unique_ptr tx_packet; //!< buffer to collect transmitted words + uint32_t serin; //!< serial input shift registers 74164 #37 and #33 + uint16_t fifo[ALTO2_ETHER_FIFO_SIZE]; //!< FIFO buffer + uint16_t fifo_rd; //!< FIFO input pointer + uint16_t fifo_wr; //!< FIFO output pointer + uint16_t status; //!< status word + uint16_t rx_crc; //!< receiver CRC + uint16_t tx_crc; //!< transmitter CRC + uint32_t rx_count; //!< received words count + uint32_t tx_count; //!< transmitted words count + std::unique_ptr rx_packet; //!< buffer to collect received words + std::unique_ptr tx_packet; //!< buffer to collect transmitted words emu_timer* rx_timer; //!< receiver timer emu_timer* tx_timer; //!< transmitter timer jkff_t ff_10a; //!< JK flip-flop 10a IBUSY (Sheet 13) diff --git a/src/devices/cpu/alto2/a2hw.cpp b/src/devices/cpu/alto2/a2hw.cpp index 5a85c8c8083..43dc4709a38 100644 --- a/src/devices/cpu/alto2/a2hw.cpp +++ b/src/devices/cpu/alto2/a2hw.cpp @@ -184,7 +184,7 @@ WRITE16_MEMBER( alto2_cpu_device::mouse_buttons_w ) { X_WRBITS(m_hw.utilin,16,13 * @brief printer paper strobe bit * Paper strobe bit. Toggling this bit causes a paper scrolling operation. */ -//static inline UINT16 GET_PPPSTR(UINT16 utilout) { return X_RDBITS(utilout,16,0,0); } +//static inline uint16_t GET_PPPSTR(uint16_t utilout) { return X_RDBITS(utilout,16,0,0); } /** * @brief printer retstore bit @@ -192,26 +192,26 @@ WRITE16_MEMBER( alto2_cpu_device::mouse_buttons_w ) { X_WRBITS(m_hw.utilin,16,13 * the "check" condition if present) and moves the carriage to the * left margin. */ -//static inline UINT16 GET_PREST(UINT16 utilout) { return X_RDBITS(utilout,16,1,1); } +//static inline uint16_t GET_PREST(uint16_t utilout) { return X_RDBITS(utilout,16,1,1); } /** * @brief printer ribbon bit * Ribbon bit. When this bit is 1 the ribbon is up (in printing * position); when 0, it is down. */ -//static inline UINT16 GET_PRIB(UINT16 utilout) { return X_RDBITS(utilout,16,2,2); } +//static inline uint16_t GET_PRIB(uint16_t utilout) { return X_RDBITS(utilout,16,2,2); } /** * @brief printer daisy strobe bit * Daisy strobe bit. Toggling this bit causes a character to be printed. */ -//static inline UINT16 GET_PCHSTR(UINT16 utilout) { return X_RDBITS(utilout,16,3,3); } +//static inline uint16_t GET_PCHSTR(uint16_t utilout) { return X_RDBITS(utilout,16,3,3); } /** * @brief printer carriage strobe bit * Carriage strobe bit. Toggling this bit causes a horizontal position operation. */ -//static inline UINT16 GET_PCARSTR(UINT16 utilout) { return X_RDBITS(utilout,16,4,4); } +//static inline uint16_t GET_PCARSTR(uint16_t utilout) { return X_RDBITS(utilout,16,4,4); } /** * @brief printer data @@ -225,7 +225,7 @@ WRITE16_MEMBER( alto2_cpu_device::mouse_buttons_w ) { X_WRBITS(m_hw.utilin,16,13 * represented as sign-magnitude (i.e., bit 5 is 1 for negative numbers, 0 for * positive; bits 6-15 are the absolute value of the number). */ -//static inline UINT16 GET_PDATA(UINT16 utilout) { return X_RDBITS(utilout,16,5,15); } +//static inline uint16_t GET_PDATA(uint16_t utilout) { return X_RDBITS(utilout,16,5,15); } /** * @brief read the UTILIN port @@ -235,7 +235,7 @@ WRITE16_MEMBER( alto2_cpu_device::mouse_buttons_w ) { X_WRBITS(m_hw.utilin,16,13 */ READ16_MEMBER( alto2_cpu_device::utilin_r ) { - UINT16 data; + uint16_t data; // FIXME: update the printer status // printer_read(); @@ -255,7 +255,7 @@ READ16_MEMBER( alto2_cpu_device::utilin_r ) */ READ16_MEMBER( alto2_cpu_device::xbus_r ) { - UINT16 data = m_hw.xbus[offset & 3]; + uint16_t data = m_hw.xbus[offset & 3]; if (!space.debugger_access()) { LOG((this,LOG_HW,2," XBUS[%d] rd %#o (%#o)\n", offset & 3, offset, data)); @@ -287,7 +287,7 @@ WRITE16_MEMBER( alto2_cpu_device::xbus_w ) */ READ16_MEMBER( alto2_cpu_device::utilout_r ) { - UINT16 data = m_hw.utilout ^ 0177777; + uint16_t data = m_hw.utilout ^ 0177777; if (!space.debugger_access()) { LOG((this,0,2," UTILOUT rd %#o (%#o)\n", offset, data)); } @@ -374,7 +374,7 @@ static const prom_load_t pl_madr_a64 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; static const prom_load_t pl_madr_a65 = @@ -391,7 +391,7 @@ static const prom_load_t pl_madr_a65 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; /** diff --git a/src/devices/cpu/alto2/a2hw.h b/src/devices/cpu/alto2/a2hw.h index 49d20ff5e30..18accb36c23 100644 --- a/src/devices/cpu/alto2/a2hw.h +++ b/src/devices/cpu/alto2/a2hw.h @@ -12,10 +12,10 @@ #define _A2HW_H_ //! miscellaneous hardware registers in the memory mapped I/O range struct { - UINT16 eia; //!< the EIA port at 0177001 - UINT16 utilout; //!< the UTILOUT port at 0177016 (active-low outputs) - UINT16 xbus[4]; //!< the XBUS port at 0177020 to 0177023 - UINT16 utilin; //!< the UTILIN port at 0177030 to 0177033 (same value on all addresses) + uint16_t eia; //!< the EIA port at 0177001 + uint16_t utilout; //!< the UTILOUT port at 0177016 (active-low outputs) + uint16_t xbus[4]; //!< the XBUS port at 0177020 to 0177023 + uint16_t utilin; //!< the UTILIN port at 0177030 to 0177033 (same value on all addresses) } m_hw; DECLARE_READ16_MEMBER ( pprdy_r ); //!< read UTILIN[0] printer paper ready bit diff --git a/src/devices/cpu/alto2/a2jkff.h b/src/devices/cpu/alto2/a2jkff.h index 9f9caa5c558..49929474c19 100644 --- a/src/devices/cpu/alto2/a2jkff.h +++ b/src/devices/cpu/alto2/a2jkff.h @@ -55,7 +55,7 @@ typedef enum { * @param s1 is the next state * @return returns the next state and probably modified Q output */ -static inline jkff_t update_jkff(UINT8 s0, UINT8 s1, const char* jkff_name) +static inline jkff_t update_jkff(uint8_t s0, uint8_t s1, const char* jkff_name) { switch (s1 & (JKFF_C | JKFF_S)) { @@ -133,7 +133,7 @@ static inline jkff_t update_jkff(UINT8 s0, UINT8 s1, const char* jkff_name) * @param s1 is the next state * @return returns the next state and probably modified Q output */ -static inline jkff_t update_jkff(UINT8 s0, UINT8 s1, const char*) +static inline jkff_t update_jkff(uint8_t s0, uint8_t s1, const char*) { switch (s1 & (JKFF_C | JKFF_S)) { diff --git a/src/devices/cpu/alto2/a2kbd.cpp b/src/devices/cpu/alto2/a2kbd.cpp index 45800f03bd2..bb7105686fe 100644 --- a/src/devices/cpu/alto2/a2kbd.cpp +++ b/src/devices/cpu/alto2/a2kbd.cpp @@ -15,7 +15,7 @@ */ READ16_MEMBER( alto2_cpu_device::kbd_ad_r ) { - UINT16 data = 0177777; + uint16_t data = 0177777; switch (offset & 3) { case 0: data = machine().root_device().ioport("ROW0")->read(); @@ -44,7 +44,7 @@ READ16_MEMBER( alto2_cpu_device::kbd_ad_r ) return data; } -void alto2_cpu_device::init_kbd(UINT16 bootkey) +void alto2_cpu_device::init_kbd(uint16_t bootkey) { m_kbd.bootkey = bootkey; } diff --git a/src/devices/cpu/alto2/a2kbd.h b/src/devices/cpu/alto2/a2kbd.h index b7bf6607ee2..8921132fc11 100644 --- a/src/devices/cpu/alto2/a2kbd.h +++ b/src/devices/cpu/alto2/a2kbd.h @@ -96,13 +96,13 @@ #ifndef _A2KBD_H_ #define _A2KBD_H_ struct { - UINT16 bootkey; //!< boot key - key code pressed before power on - UINT16 matrix[4]; //!< a bit map of the keys pressed (ioports ROW0 ... ROW3) + uint16_t bootkey; //!< boot key - key code pressed before power on + uint16_t matrix[4]; //!< a bit map of the keys pressed (ioports ROW0 ... ROW3) } m_kbd; DECLARE_READ16_MEMBER( kbd_ad_r ); //!< read the keyboard matrix -void init_kbd(UINT16 bootkey = 0177777); //!< initialize the keyboard hardware, optinally set the boot key +void init_kbd(uint16_t bootkey = 0177777); //!< initialize the keyboard hardware, optinally set the boot key void exit_kbd(); //!< deinitialize the keyboard hardware void reset_kbd(); //!< reset the keyboard hardware #endif // _A2KBD_H_ diff --git a/src/devices/cpu/alto2/a2mem.cpp b/src/devices/cpu/alto2/a2mem.cpp index 2a09c0fab10..1f5f5609374 100644 --- a/src/devices/cpu/alto2/a2mem.cpp +++ b/src/devices/cpu/alto2/a2mem.cpp @@ -289,7 +289,7 @@ * @param val 32 bits * @return 1 for even parity, 0 for odd parity */ -static __inline UINT8 parity_even(UINT32 val) +static __inline uint8_t parity_even(uint32_t val) { val -= ((val >> 1) & 0x55555555); val = (((val >> 2) & 0x33333333) + (val & 0x33333333)); @@ -330,47 +330,47 @@ static const int hamming_lut[64] = { * @param dw_data the double-word data * @return dw_data, possibly with 1 bit error corrected */ -UINT32 alto2_cpu_device::hamming_code(bool write, UINT32 dw_addr, UINT32 dw_data) +uint32_t alto2_cpu_device::hamming_code(bool write, uint32_t dw_addr, uint32_t dw_data) { - const UINT8 hpb = write ? 0 : m_mem.hpb[dw_addr]; + const uint8_t hpb = write ? 0 : m_mem.hpb[dw_addr]; /* a75: WD01 WD04 WD08 WD11 WD15 WD19 WD23 WD26 WD30 --- HC(0)A */ - const UINT8 hc_0_a = parity_odd (dw_data & A75); + const uint8_t hc_0_a = parity_odd (dw_data & A75); /* a76: WD00 WD03 WD06 WD10 WD13 WD17 WD21 WD25 WD29 HC(0B1) --- */ - const UINT8 hc_0b1 = parity_even(dw_data & A76); + const uint8_t hc_0b1 = parity_even(dw_data & A76); /* a86: WD02 WD05 WD09 WD12 WD16 WD20 WD24 WD27 WD31 HC(1)A --- */ - const UINT8 hc_1_a = parity_even(dw_data & A86); + const uint8_t hc_1_a = parity_even(dw_data & A86); /* a64: WD01 WD02 WD03 WD07 WD08 WD09 WD10 WD14 WD15 --- HC(2)A */ - const UINT8 hc_2_a = parity_odd (dw_data & A64); + const uint8_t hc_2_a = parity_odd (dw_data & A64); /* a85: WD16 WD17 WD22 WD23 WD24 WD25 WD29 WD30 WD31 HC(2)B --- */ - const UINT8 hc_2_b = parity_even(dw_data & A85); + const uint8_t hc_2_b = parity_even(dw_data & A85); - const UINT8 hc_0 = H0(hpb) ^ hc_0_a ^ hc_0b1; - const UINT8 hc_1 = H1(hpb) ^ hc_1_a ^ hc_0b1; - const UINT8 hc_2 = hc_2_a ^ hc_2_b ^ H2(hpb); - const UINT8 h_0_2 = H0(hpb) ^ H1(hpb) ^ H2(hpb); + const uint8_t hc_0 = H0(hpb) ^ hc_0_a ^ hc_0b1; + const uint8_t hc_1 = H1(hpb) ^ hc_1_a ^ hc_0b1; + const uint8_t hc_2 = hc_2_a ^ hc_2_b ^ H2(hpb); + const uint8_t h_0_2 = H0(hpb) ^ H1(hpb) ^ H2(hpb); /* a66: WD04 WD05 WD06 WD07 WD08 WD09 WD10 H(3) 0 --- HC(3)A */ - const UINT8 hc_3_a = parity_odd ((dw_data & A66) ^ H3(hpb)); + const uint8_t hc_3_a = parity_odd ((dw_data & A66) ^ H3(hpb)); /* a84: WD18 WD19 WD20 WD21 WD22 WD23 WD24 WD25 0 HC(3/4) HCPA */ - const UINT8 hcpa = parity_odd (dw_data & A84); - const UINT8 hc_3_4 = hcpa ^ 1; + const uint8_t hcpa = parity_odd (dw_data & A84); + const uint8_t hc_3_4 = hcpa ^ 1; /* a63: WD11 WD12 WD13 WD14 WD15 WD16 WD17 H(4) 0 --- HC(4)A */ - const UINT8 hc_4_a = parity_odd ((dw_data & A63) ^ H4(hpb)); + const uint8_t hc_4_a = parity_odd ((dw_data & A63) ^ H4(hpb)); /* a87: WD26 WD27 WD28 WD29 WD30 WD31 H(5) 0 0 HC(5) HCPB */ - const UINT8 hcpb = parity_odd ((dw_data & A87) ^ H5(hpb)); - const UINT8 hc_3 = hc_3_a ^ hc_3_4; - const UINT8 hc_4 = hc_4_a ^ hc_3_4; - const UINT8 hc_5 = hcpb ^ 1; + const uint8_t hcpb = parity_odd ((dw_data & A87) ^ H5(hpb)); + const uint8_t hc_3 = hc_3_a ^ hc_3_4; + const uint8_t hc_4 = hc_4_a ^ hc_3_4; + const uint8_t hc_5 = hcpb ^ 1; - const UINT8 syndrome = 32*hc_0 + 16*hc_1 + 8*hc_2 + 4*hc_3 + 2*hc_4 + hc_5; + const uint8_t syndrome = 32*hc_0 + 16*hc_1 + 8*hc_2 + 4*hc_3 + 2*hc_4 + hc_5; /* a54: HC(3)A HC(4)A HCPA HCPB H(0/2) XX01 WD02 WD03 P PERR --- @@ -379,7 +379,7 @@ UINT32 alto2_cpu_device::hamming_code(bool write, UINT32 dw_addr, UINT32 dw_data * which has the same effect as spreading them over some bits * and then counting them... I hope ;-) */ - const UINT8 perr = parity_even( + const uint8_t perr = parity_even( hc_3_a ^ hc_4_a ^ hcpa ^ @@ -392,11 +392,11 @@ UINT32 alto2_cpu_device::hamming_code(bool write, UINT32 dw_addr, UINT32 dw_data 1); /* a65: WD00 WD01 WD02 WD04 WD05 WD07 WD10 WD11 WD12 --- PCA */ - const UINT8 pca = parity_odd (dw_data & A65); + const uint8_t pca = parity_odd (dw_data & A65); /* a74: WD14 WD17 WD18 WD21 WD23 WD24 WD26 WD27 WD29 PCB --- */ - const UINT8 pcb = parity_even(dw_data & A74); - const UINT8 pc = pca ^ pcb; + const uint8_t pcb = parity_even(dw_data & A74); + const uint8_t pc = pca ^ pcb; if (write) { /* Update the hamming code and parity bit store */ @@ -508,7 +508,7 @@ READ16_MEMBER( alto2_cpu_device::mear_r ) */ READ16_MEMBER( alto2_cpu_device::mesr_r ) { - UINT16 data = m_mem.mesr ^ 0177777; + uint16_t data = m_mem.mesr ^ 0177777; if (!space.debugger_access()) { LOG((this,LOG_MEM,2," MESR read %07o\n", data)); LOG((this,LOG_MEM,6," Hamming code read : %#o\n", GET_MESR_HAMMING(data))); @@ -572,7 +572,7 @@ WRITE16_MEMBER( alto2_cpu_device::mecr_w ) */ READ16_MEMBER( alto2_cpu_device::mecr_r ) { - UINT16 data = m_mem.mecr ^ 0177777; + uint16_t data = m_mem.mecr ^ 0177777; // all spare bits are set if (!space.debugger_access()) { LOG((this,LOG_MEM,2," MECR read %07o\n", data)); @@ -593,7 +593,7 @@ READ16_MEMBER( alto2_cpu_device::mecr_r ) READ16_MEMBER ( alto2_cpu_device::ioram_r ) { offs_t dw_addr = offset / 2; - return static_cast(offset & 1 ? GET_ODD(m_mem.ram[dw_addr]) : GET_EVEN(m_mem.ram[dw_addr])); + return static_cast(offset & 1 ? GET_ODD(m_mem.ram[dw_addr]) : GET_EVEN(m_mem.ram[dw_addr])); } /** @@ -616,7 +616,7 @@ WRITE16_MEMBER( alto2_cpu_device::ioram_w ) * @param rsel selected register (to detect refresh cycles) * @param addr memory address */ -void alto2_cpu_device::load_mar(UINT8 rsel, UINT32 addr) +void alto2_cpu_device::load_mar(uint8_t rsel, uint32_t addr) { if (rsel == 037) { /* @@ -657,7 +657,7 @@ void alto2_cpu_device::load_mar(UINT8 rsel, UINT32 addr) * * @result returns value from memory (RAM or MMIO) */ -UINT16 alto2_cpu_device::read_mem() +uint16_t alto2_cpu_device::read_mem() { if (ALTO2_MEM_NONE == m_mem.access) { LOG((this,LOG_MEM,0," fatal: mem read with no preceding address\n")); @@ -668,7 +668,7 @@ UINT16 alto2_cpu_device::read_mem() return m_mem.md; } - const UINT32 base_addr = m_mem.mar & 0177777; + const uint32_t base_addr = m_mem.mar & 0177777; if (base_addr >= ALTO2_IO_PAGE_BASE && m_mem.mar < ALTO2_RAM_SIZE) { m_mem.md = m_iomem->read_word(m_iomem->address_to_byte(base_addr)); LOG((this,LOG_MEM,6," MD = MMIO[%#o] (%#o)\n", base_addr, m_mem.md)); @@ -709,7 +709,7 @@ UINT16 alto2_cpu_device::read_mem() * * @param data data to write to RAM or MMIO */ -void alto2_cpu_device::write_mem(UINT16 data) +void alto2_cpu_device::write_mem(uint16_t data) { int base_addr; @@ -766,7 +766,7 @@ void alto2_cpu_device::write_mem(UINT16 data) * @param addr address to read * @return memory contents at address (16 bits) */ -UINT16 alto2_cpu_device::debug_read_mem(UINT32 addr) +uint16_t alto2_cpu_device::debug_read_mem(uint32_t addr) { int base_addr = addr & 0177777; int data; @@ -786,7 +786,7 @@ UINT16 alto2_cpu_device::debug_read_mem(UINT32 addr) * @param addr address to write * @param data data to write (16 bits used) */ -void alto2_cpu_device::debug_write_mem(UINT32 addr, UINT16 data) +void alto2_cpu_device::debug_write_mem(uint32_t addr, uint16_t data) { int base_addr = addr & 0177777; if (addr >= ALTO2_IO_PAGE_BASE && addr < ALTO2_RAM_SIZE) { @@ -840,13 +840,13 @@ void alto2_cpu_device::reset_memory() // config should be valid, unless the driver doesn't define it if (config && 0 == config->read()) m_mem.size *= 2; - logerror("Main memory %u KiB\n", static_cast(sizeof(UINT16) * m_mem.size / 1024)); + logerror("Main memory %u KiB\n", static_cast(sizeof(uint16_t) * m_mem.size / 1024)); - m_mem.ram = make_unique_clear(sizeof(UINT16) * m_mem.size); - m_mem.hpb = make_unique_clear (sizeof(UINT16) * m_mem.size); + m_mem.ram = make_unique_clear(sizeof(uint16_t) * m_mem.size); + m_mem.hpb = make_unique_clear (sizeof(uint16_t) * m_mem.size); // Initialize the hamming codes and parity bits - for (UINT32 addr = 0; addr < m_mem.size; addr++) + for (uint32_t addr = 0; addr < m_mem.size; addr++) hamming_code(true, addr, 0); m_mem.mar = 0; diff --git a/src/devices/cpu/alto2/a2mem.h b/src/devices/cpu/alto2/a2mem.h index 0f00d16fbeb..d9ff97060c9 100644 --- a/src/devices/cpu/alto2/a2mem.h +++ b/src/devices/cpu/alto2/a2mem.h @@ -25,14 +25,14 @@ enum { }; struct { - UINT32 size; //!< main memory size (64K or 128K) - std::unique_ptr ram; //!< main memory organized as double-words - std::unique_ptr hpb; //!< Hamming Code bits (6) and Parity bits (1) per double word - UINT32 mar; //!< memory address register - UINT32 rmdd; //!< read memory data double-word - UINT32 wmdd; //!< write memory data double-word - UINT32 md; //!< memory data register - UINT64 cycle; //!< cycle when the memory address register was loaded + uint32_t size; //!< main memory size (64K or 128K) + std::unique_ptr ram; //!< main memory organized as double-words + std::unique_ptr hpb; //!< Hamming Code bits (6) and Parity bits (1) per double word + uint32_t mar; //!< memory address register + uint32_t rmdd; //!< read memory data double-word + uint32_t wmdd; //!< write memory data double-word + uint32_t md; //!< memory data register + uint64_t cycle; //!< cycle when the memory address register was loaded /** * @brief memory access under the way if non-zero @@ -43,9 +43,9 @@ struct { */ int access; bool error; //!< non-zero after a memory error was detected - UINT32 mear; //!< memory error address register - UINT32 mesr; //!< memory error status register - UINT32 mecr; //!< memory error control register + uint32_t mear; //!< memory error address register + uint32_t mesr; //!< memory error status register + uint32_t mecr; //!< memory error control register } m_mem; /** @@ -61,7 +61,7 @@ struct { * * @return false, if memory address can be loaded */ -inline bool check_mem_load_mar_stall(UINT8 rsel) { +inline bool check_mem_load_mar_stall(uint8_t rsel) { if (ALTO2_MEM_NONE == m_mem.access || ALTO2_MEM_REFRESH == m_mem.access) return false; return cycle() < m_mem.cycle+5; @@ -110,26 +110,26 @@ DECLARE_READ16_MEMBER ( mecr_r ); //!< memory error control register read DECLARE_WRITE16_MEMBER( mecr_w ); //!< memory error control register write //! Read or write a memory double-word and caluclate or compare its Hamming code. -UINT32 hamming_code(bool write, UINT32 dw_addr, UINT32 dw_data); +uint32_t hamming_code(bool write, uint32_t dw_addr, uint32_t dw_data); //! Load the memory address register with some value. -void load_mar(UINT8 rsel, UINT32 addr); +void load_mar(uint8_t rsel, uint32_t addr); //! Read memory or memory mapped I/O from the address in mar to md. -UINT16 read_mem(); +uint16_t read_mem(); //! Write memory or memory mapped I/O from md to the address in mar. -void write_mem(UINT16 data); +void write_mem(uint16_t data); //! Debugger interface to read memory. -UINT16 debug_read_mem(UINT32 addr); +uint16_t debug_read_mem(uint32_t addr); //! Debugger interface to write memory. -void debug_write_mem(UINT32 addr, UINT16 data); +void debug_write_mem(uint32_t addr, uint16_t data); #if ALTO2_DEBUG -void watch_write(UINT32 addr, UINT32 data); -void watch_read(UINT32 addr, UINT32 data); +void watch_write(uint32_t addr, uint32_t data); +void watch_read(uint32_t addr, uint32_t data); #endif void init_memory(); //!< initialize the memory system diff --git a/src/devices/cpu/alto2/a2mouse.cpp b/src/devices/cpu/alto2/a2mouse.cpp index 411e9135b21..7f18e7b7280 100644 --- a/src/devices/cpu/alto2/a2mouse.cpp +++ b/src/devices/cpu/alto2/a2mouse.cpp @@ -106,9 +106,9 @@ enum { * * @return lookup value from madr_a32 */ -UINT16 alto2_cpu_device::mouse_read() +uint16_t alto2_cpu_device::mouse_read() { - UINT16 data; + uint16_t data; m_mouse.latch = (m_mouse.latch << 1) & MLATCH; data = m_madr_a32[m_mouse.latch]; @@ -145,8 +145,8 @@ UINT16 alto2_cpu_device::mouse_read() */ INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_x ) { - INT16 ox = static_cast(oldval); - INT16 nx = static_cast(newval); + int16_t ox = static_cast(oldval); + int16_t nx = static_cast(newval); m_mouse.dx = std::min(std::max(0, m_mouse.dx + (nx - ox)), 639); } @@ -159,8 +159,8 @@ INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_x ) */ INPUT_CHANGED_MEMBER( alto2_cpu_device::mouse_motion_y ) { - INT16 oy = static_cast(oldval); - INT16 ny = static_cast(newval); + int16_t oy = static_cast(oldval); + int16_t ny = static_cast(newval); m_mouse.dy = std::min(std::max(0, m_mouse.dy + (ny - oy)), 824); } @@ -203,7 +203,7 @@ static const prom_load_t pl_madr_a32 = /* shift */ 0, /* dmap */ DMAP_REVERSE_0_3, // reverse D0-D3 to D3-D0 /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; /** diff --git a/src/devices/cpu/alto2/a2mouse.h b/src/devices/cpu/alto2/a2mouse.h index 29d5e88ca5b..375a37397a2 100644 --- a/src/devices/cpu/alto2/a2mouse.h +++ b/src/devices/cpu/alto2/a2mouse.h @@ -51,7 +51,7 @@ * sequence: 10 -> 70 -> e0 -> 80 * */ -UINT8* m_madr_a32; +uint8_t* m_madr_a32; //! mouse context struct { @@ -59,11 +59,11 @@ struct { int y; //!< current Y coordinate int dx; //!< destination X coordinate (real mouse X) int dy; //!< destination Y coordinate (real mouse Y) - UINT8 latch; //!< current latch value - UINT8 phase; //!< current read latch phase + uint8_t latch; //!< current latch value + uint8_t phase; //!< current read latch phase } m_mouse; -UINT16 mouse_read(); //!< return the mouse motion flags +uint16_t mouse_read(); //!< return the mouse motion flags void init_mouse(); //!< initialize the mouse context void exit_mouse(); //!< deinitialize the mouse context void reset_mouse(); //!< reset the mouse context diff --git a/src/devices/cpu/alto2/a2ram.cpp b/src/devices/cpu/alto2/a2ram.cpp index d655f461bc2..83930364c8b 100644 --- a/src/devices/cpu/alto2/a2ram.cpp +++ b/src/devices/cpu/alto2/a2ram.cpp @@ -12,7 +12,7 @@ #define DEBUG_BRANCH 0 //!< define to 1 to print branching to ROM/RAM //! direct read access to the microcode CRAM -#define RD_CRAM(addr) (*reinterpret_cast(m_ucode_cram.get() + addr * 4)) +#define RD_CRAM(addr) (*reinterpret_cast(m_ucode_cram.get() + addr * 4)) /** * @brief read the microcode ROM/RAM halfword @@ -70,9 +70,9 @@ */ void alto2_cpu_device::rdram() { - UINT32 addr, value; - UINT32 bank = GET_CRAM_BANKSEL(m_cram_addr); - UINT32 wordaddr = GET_CRAM_WORDADDR(m_cram_addr); + uint32_t addr, value; + uint32_t bank = GET_CRAM_BANKSEL(m_cram_addr); + uint32_t wordaddr = GET_CRAM_WORDADDR(m_cram_addr); if (GET_CRAM_RAMROM(m_cram_addr)) { /* read CROM 0 at current mpc */ @@ -94,10 +94,10 @@ void alto2_cpu_device::rdram() #endif return; } - value = *reinterpret_cast(m_ucode_cram.get() + addr * 4) ^ ALTO2_UCODE_INVERTED; + value = *reinterpret_cast(m_ucode_cram.get() + addr * 4) ^ ALTO2_UCODE_INVERTED; #if DEBUG_RDRAM char buffer[256]; - UINT8* oprom = m_ucode_cram.get() + 4 * wordaddr; + uint8_t* oprom = m_ucode_cram.get() + 4 * wordaddr; disasm_disassemble(buffer, wordaddr, oprom, oprom, 0); printf("RD CRAM_BANKSEL=%d RAM%d [%04o] upper:%06o lower:%06o value:%011o '%s'\n", GET_CRAM_BANKSEL(m_cram_addr), bank, wordaddr, m_myl, m_alu, @@ -125,10 +125,10 @@ void alto2_cpu_device::rdram() */ void alto2_cpu_device::wrtram() { - const UINT32 bank = GET_CRAM_BANKSEL(m_cram_addr); - const UINT32 wordaddr = GET_CRAM_WORDADDR(m_cram_addr); - const UINT32 addr = bank * ALTO2_UCODE_PAGE_SIZE + wordaddr; // write RAM 0,1,2 - const UINT32 value = (m_myl << 16) | m_alu; + const uint32_t bank = GET_CRAM_BANKSEL(m_cram_addr); + const uint32_t wordaddr = GET_CRAM_WORDADDR(m_cram_addr); + const uint32_t addr = bank * ALTO2_UCODE_PAGE_SIZE + wordaddr; // write RAM 0,1,2 + const uint32_t value = (m_myl << 16) | m_alu; LOG((this,LOG_CPU,0," wrtram: RAM%d [%04o] upper:%06o lower:%06o", bank, wordaddr, m_myl, m_alu)); @@ -138,11 +138,11 @@ void alto2_cpu_device::wrtram() return; } LOG((this,LOG_CPU,0,"\n")); - *reinterpret_cast(m_ucode_cram.get() + addr * 4) = value ^ ALTO2_UCODE_INVERTED; + *reinterpret_cast(m_ucode_cram.get() + addr * 4) = value ^ ALTO2_UCODE_INVERTED; #if DEBUG_WRTRAM char buffer[256]; - UINT8* oprom = m_ucode_cram.get() + 4 * wordaddr; + uint8_t* oprom = m_ucode_cram.get() + 4 * wordaddr; disasm_disassemble(buffer, wordaddr, oprom, oprom, 0); printf("WR CRAM_BANKSEL=%d RAM%d [%04o] upper:%06o lower:%06o value:%011o '%s'\n", GET_CRAM_BANKSEL(m_cram_addr), bank, wordaddr, m_myl, m_alu, @@ -158,10 +158,10 @@ void alto2_cpu_device::wrtram() */ void alto2_cpu_device::bs_early_read_sreg() { - UINT16 r; + uint16_t r; if (rsel()) { - UINT8 bank = m_s_reg_bank[m_task]; + uint8_t bank = m_s_reg_bank[m_task]; r = m_s[bank][rsel()]; LOG((this,LOG_RAM,2," <-S%02o; bus &= S[%o][%02o] (%#o)\n", rsel(), bank, rsel(), r)); } else { @@ -186,7 +186,7 @@ void alto2_cpu_device::bs_early_load_sreg() */ void alto2_cpu_device::bs_late_load_sreg() { - UINT8 bank = m_s_reg_bank[m_task]; + uint8_t bank = m_s_reg_bank[m_task]; m_s[bank][rsel()] = m_myl; LOG((this,LOG_RAM,2," S%02o<- S[%o][%02o] := %#o\n", rsel(), bank, rsel(), m_myl)); } @@ -232,8 +232,8 @@ void alto2_cpu_device::branch_RAM(const char *from, int page) void alto2_cpu_device::f1_late_swmode() { // Currently executing in what CROM/CRAM page? - UINT16 page = m_mpc / ALTO2_UCODE_PAGE_SIZE; - UINT16 next; + uint16_t page = m_mpc / ALTO2_UCODE_PAGE_SIZE; + uint16_t next; switch (m_cram_config) { case 1: // 1K CROM, 1K CRAM diff --git a/src/devices/cpu/alto2/a2roms.cpp b/src/devices/cpu/alto2/a2roms.cpp index 995d1841da2..ec262d1be27 100644 --- a/src/devices/cpu/alto2/a2roms.cpp +++ b/src/devices/cpu/alto2/a2roms.cpp @@ -17,7 +17,7 @@ * but first step is mapping 2-bit values * into sum of 2 1-bit values in sneaky way. */ -static UINT32 ones_u32(UINT32 val) +static uint32_t ones_u32(uint32_t val) { val -= ((val >> 1) & 0x55555555); val = (((val >> 2) & 0x33333333) + (val & 0x33333333)); @@ -30,7 +30,7 @@ static UINT32 ones_u32(UINT32 val) /** * @brief return the log2 of an integer value */ -static UINT32 log2_u32(UINT32 val) +static uint32_t log2_u32(uint32_t val) { val |= (val >> 1); val |= (val >> 2); @@ -48,12 +48,12 @@ static UINT32 log2_u32(UINT32 val) * @param val value to map * @result returns the remapped value, or just val, if map was nullptr */ -static UINT32 map_lines(const UINT8 *map, int lines, UINT32 val) +static uint32_t map_lines(const uint8_t *map, int lines, uint32_t val) { if (nullptr == map) return val; - UINT32 res = 0; + uint32_t res = 0; for (int i = 0; i < lines; i++) if (val & (1 << i)) res |= 1 << map[i]; @@ -64,29 +64,29 @@ static UINT32 map_lines(const UINT8 *map, int lines, UINT32 val) * @brief write to a ROM base + address of type 'type', ANDing with and, ORing with or * * @param base ROM base address in memory - * @param type one of 1 for UINT8, 2 for UINT16, 4 for UINT32 + * @param type one of 1 for uint8_t, 2 for uint16_t, 4 for uint32_t * @param addr address offset into base * @param dand value to AND to contents before XORing * @param dxor value to XOR before writing back */ -static void write_type_and_xor(void *base, int type, UINT32 addr, UINT32 dand, UINT32 dxor) +static void write_type_and_xor(void *base, int type, uint32_t addr, uint32_t dand, uint32_t dxor) { switch (type) { - case sizeof(UINT8): + case sizeof(uint8_t): { - UINT8 *base8 = reinterpret_cast(base); + uint8_t *base8 = reinterpret_cast(base); base8[addr] = (base8[addr] & dand) ^ dxor; } break; - case sizeof(UINT16): + case sizeof(uint16_t): { - UINT16 *base16 = reinterpret_cast(base); + uint16_t *base16 = reinterpret_cast(base); base16[addr] = (base16[addr] & dand) ^ dxor; } break; - case sizeof(UINT32): + case sizeof(uint32_t): { - UINT32 *base32 = reinterpret_cast(base); + uint32_t *base32 = reinterpret_cast(base); base32[addr] = (base32[addr] & dand) ^ dxor; } break; @@ -103,39 +103,39 @@ static void write_type_and_xor(void *base, int type, UINT32 addr, UINT32 dand, U * @param segments number of segments in one page of the result * @return pointer to the newly allocated memory filled with source bits */ -UINT8* prom_load(running_machine& machine, const prom_load_t* prom, const UINT8* src, int pages, int segments) +uint8_t* prom_load(running_machine& machine, const prom_load_t* prom, const uint8_t* src, int pages, int segments) { void* array = nullptr; size_t type = prom->type; size_t size = prom->size; #if DEBUG_PROM_LOAD - UINT8 width = prom->width; + uint8_t width = prom->width; #endif switch (type) { - case sizeof(UINT8): - array = auto_alloc_array(machine, UINT8, pages * size); + case sizeof(uint8_t): + array = auto_alloc_array(machine, uint8_t, pages * size); break; - case sizeof(UINT16): - array = auto_alloc_array(machine, UINT16, pages * size); + case sizeof(uint16_t): + array = auto_alloc_array(machine, uint16_t, pages * size); break; - case sizeof(UINT32): - array = auto_alloc_array(machine, UINT32, pages * size); + case sizeof(uint32_t): + array = auto_alloc_array(machine, uint32_t, pages * size); break; } - UINT8* base = reinterpret_cast(array); + uint8_t* base = reinterpret_cast(array); for (int page = 0; page < pages; page++) { - UINT8* dst = base + (prom->type * prom->size * page); + uint8_t* dst = base + (prom->type * prom->size * page); for (int segment = 0; segment < segments; segment++, prom++) { - for (UINT32 src_addr = 0; src_addr < prom->size; src_addr++) + for (uint32_t src_addr = 0; src_addr < prom->size; src_addr++) { // map destination address lines - UINT32 dst_addr = map_lines(prom->amap, log2_u32(prom->size) + 1, src_addr); + uint32_t dst_addr = map_lines(prom->amap, log2_u32(prom->size) + 1, src_addr); // fetch data bits - UINT32 data = src[src_addr ^ prom->axor] ^ prom->dxor; + uint32_t data = src[src_addr ^ prom->axor] ^ prom->dxor; // mask width bits data = data & ((1 << prom->width) - 1); // map destination data lines @@ -151,9 +151,9 @@ UINT8* prom_load(running_machine& machine, const prom_load_t* prom, const UINT8* #if DEBUG_PROM_LOAD switch (type) { - case sizeof(UINT8): + case sizeof(uint8_t): { - UINT8* data = reinterpret_cast(array); + uint8_t* data = reinterpret_cast(array); for (int addr = 0; addr < pages*size; addr++) { if (0 == (addr % 16)) printf("%04x:", addr); @@ -166,9 +166,9 @@ UINT8* prom_load(running_machine& machine, const prom_load_t* prom, const UINT8* } } break; - case sizeof(UINT16): + case sizeof(uint16_t): { - UINT16* data = reinterpret_cast(array); + uint16_t* data = reinterpret_cast(array); for (int addr = 0; addr < pages*size; addr++) { if (0 == (addr % 8)) printf("%04x:", addr); @@ -178,9 +178,9 @@ UINT8* prom_load(running_machine& machine, const prom_load_t* prom, const UINT8* } } break; - case sizeof(UINT32): + case sizeof(uint32_t): { - UINT32* data = reinterpret_cast(array); + uint32_t* data = reinterpret_cast(array); for (int addr = 0; addr < pages*size; addr++) { if (0 == (addr % 4)) printf("%04x:", addr); @@ -192,5 +192,5 @@ UINT8* prom_load(running_machine& machine, const prom_load_t* prom, const UINT8* break; } #endif - return reinterpret_cast(array); + return reinterpret_cast(array); } diff --git a/src/devices/cpu/alto2/a2roms.h b/src/devices/cpu/alto2/a2roms.h index abd218344c9..e320239fc86 100644 --- a/src/devices/cpu/alto2/a2roms.h +++ b/src/devices/cpu/alto2/a2roms.h @@ -19,13 +19,13 @@ typedef struct { const char *crc32; //!< CRC32 hash of the file const char *sha1; //!< SHA1 hash of the file size_t size; //!< size of the file, and elements in destination memory - const UINT8 amap[16]; //!< address bit mapping - UINT32 axor; //!< address XOR mask (applied to source address) - UINT32 dxor; //!< data XOR mask (applied before shifting and mapping) - UINT8 width; //!< width in bits - UINT8 shift; //!< left shift in bits - const UINT8 dmap[16]; //!< data bit mapping - UINT32 dand; //!< ANDing destination with this value, before XORing the data + const uint8_t amap[16]; //!< address bit mapping + uint32_t axor; //!< address XOR mask (applied to source address) + uint32_t dxor; //!< data XOR mask (applied before shifting and mapping) + uint8_t width; //!< width in bits + uint8_t shift; //!< left shift in bits + const uint8_t dmap[16]; //!< data bit mapping + uint32_t dand; //!< ANDing destination with this value, before XORing the data size_t type; //!< type of the destination, i.e. sizeof(type) } prom_load_t; @@ -39,5 +39,5 @@ typedef struct { #define DMAP_DEFAULT {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15} #define DMAP_REVERSE_0_3 {3,2,1,0,} -extern UINT8* prom_load(running_machine& machine, const prom_load_t* prom, const UINT8* src, int pages = 1, int segments = 1); +extern uint8_t* prom_load(running_machine& machine, const prom_load_t* prom, const uint8_t* src, int pages = 1, int segments = 1); #endif // _CPU_A2ROMS_H_ diff --git a/src/devices/cpu/alto2/alto2cpu.cpp b/src/devices/cpu/alto2/alto2cpu.cpp index 74d0b07d8f8..7096fb09e3e 100644 --- a/src/devices/cpu/alto2/alto2cpu.cpp +++ b/src/devices/cpu/alto2/alto2cpu.cpp @@ -120,7 +120,7 @@ ADDRESS_MAP_END // alto2_cpu_device - constructor //------------------------------------------------- -alto2_cpu_device::alto2_cpu_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) : +alto2_cpu_device::alto2_cpu_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : cpu_device(mconfig, ALTO2, "Xerox Alto-II", tag, owner, clock, "alto2_cpu", __FILE__), m_ucode_config("ucode", ENDIANNESS_BIG, 32, 12, -2 ), m_const_config("const", ENDIANNESS_BIG, 16, 8, -1 ), @@ -271,7 +271,7 @@ ROM_START( alto2_cpu ) ROM_LOAD( "xm51.u72", 15*02000, 02000, CRC(a28e5251) SHA1(44dd8ad4ad56541b5394d30ce3521b4d1d561394) ) //!< 00000-01777 NEXT(6)',NEXT(7)',NEXT(8)',NEXT(9)' // constant PROMs, 4 x 4bit - // UINT16 src = BITS(addr, 3,2,1,4,5,6,7,0); + // uint16_t src = BITS(addr, 3,2,1,4,5,6,7,0); ROM_REGION( 4 * 0400, "const_proms", 0 ) ROM_LOAD( "madr.a6", 0*00400, 00400, CRC(c2c196b2) SHA1(8b2a599ac839ec2a070dbfef2f1626e645c858ca) ) //!< 0000-0377 C(00)',C(01)',C(02)',C(03)' ROM_LOAD( "madr.a5", 1*00400, 00400, CRC(42336101) SHA1(c77819cf40f063af3abf66ea43f17cc1a62e928b) ) //!< 0000-0377 C(04)',C(05)',C(06)',C(07)' @@ -370,7 +370,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 28, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 0000-01777 RSEL(4)',ALUF(0)',ALUF(1)',ALUF(2)' "64x.3", @@ -385,7 +385,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 24, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 0000-01777 ALUF(3)',BS(0)',BS(1)',BS(2)' "65x.3", @@ -400,7 +400,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 20, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 0000-01777 F1(0),F1(1)',F1(2)',F1(3)' "63x.3", @@ -415,7 +415,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 16, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 0000-01777 F2(0),F2(1)',F2(2)',F2(3)' "53x.3", @@ -430,7 +430,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 12, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 0000-01777 LOADT',LOADL,NEXT(0)',NEXT(1)' "60x.3", @@ -445,7 +445,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 8, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 0000-01777 NEXT(2)',NEXT(3)',NEXT(4)',NEXT(5)' "61x.3", @@ -460,7 +460,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 4, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 0000-01777 NEXT(6)',NEXT(7)',NEXT(8)',NEXT(9)' "62x.3", @@ -475,7 +475,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, // NOTE: the Mesa 5.1 ucode PROM may be used as RAM, if m_cram_config == 3 { // 02000-03777 RSEL(0)',RSEL(1)',RSEL(2)',RSEL(3)' @@ -491,7 +491,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 28, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 02000-03777 RSEL(4)',ALUF(0)',ALUF(1)',ALUF(2)' "xm51.u74", @@ -506,7 +506,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 24, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 02000-03777 ALUF(3)',BS(0)',BS(1)',BS(2)' "xm51.u75", @@ -521,7 +521,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 20, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 02000-03777 F1(0),F1(1)',F1(2)',F1(3)' "xm51.u73", @@ -536,7 +536,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 16, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 02000-03777 F2(0),F2(1)',F2(2)',F2(3)' "xm51.u52", @@ -551,7 +551,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 12, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 02000-03777 LOADT',LOADL,NEXT(0)',NEXT(1)' "xm51.u70", @@ -566,7 +566,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 8, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 02000-03777 NEXT(2)',NEXT(3)',NEXT(4)',NEXT(5)' "xm51.u71", @@ -581,7 +581,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 4, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) }, { // 02000-03777 NEXT(6)',NEXT(7)',NEXT(8)',NEXT(9)' "xm51.u72", @@ -596,7 +596,7 @@ static const prom_load_t pl_ucode[] = { /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ KEEP, - /* type */ sizeof(UINT32) + /* type */ sizeof(uint32_t) } }; @@ -617,7 +617,7 @@ static const prom_load_t pl_const[] = { /* shift */ 0, /* dmap */ DMAP_REVERSE_0_3, // reverse D0-D3 to D3-D0 /* dand */ ZERO, - /* type */ sizeof(UINT16) + /* type */ sizeof(uint16_t) }, { // constant prom D4-D7 "madr.a5", @@ -632,7 +632,7 @@ static const prom_load_t pl_const[] = { /* shift */ 4, /* dmap */ DMAP_REVERSE_0_3, // reverse D0-D3 to D3-D0 /* dand */ KEEP, - /* type */ sizeof(UINT16) + /* type */ sizeof(uint16_t) }, { // constant prom D8-D11 "madr.a4", @@ -647,7 +647,7 @@ static const prom_load_t pl_const[] = { /* shift */ 8, /* dmap */ DMAP_REVERSE_0_3, // reverse D0-D3 to D3-D0 /* dand */ KEEP, - /* type */ sizeof(UINT16) + /* type */ sizeof(uint16_t) }, { // constant PROM D12-D15 "madr.a3", @@ -662,7 +662,7 @@ static const prom_load_t pl_const[] = { /* shift */ 12, /* dmap */ DMAP_REVERSE_0_3, // reverse D0-D3 to D3-D0 /* dand */ KEEP, - /* type */ sizeof(UINT16) + /* type */ sizeof(uint16_t) } }; @@ -681,7 +681,7 @@ static const prom_load_t pl_2kctl_u3 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; //! 82S23 32x8 BPROM; task priority and initial address @@ -699,7 +699,7 @@ static const prom_load_t pl_2kctl_u38 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; //! 3601-1 256x4 BPROM; 2KCTL replacement for u51 (1KCTL) @@ -717,7 +717,7 @@ static const prom_load_t pl_2kctl_u76 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; //! ALUF to ALU 741818 functions and carry in mapper @@ -735,7 +735,7 @@ static const prom_load_t pl_alu_a10 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; static const prom_load_t pl_3kcram_a37 = @@ -752,7 +752,7 @@ static const prom_load_t pl_3kcram_a37 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; static const prom_load_t pl_madr_a90 = @@ -769,7 +769,7 @@ static const prom_load_t pl_madr_a90 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; static const prom_load_t pl_madr_a91 = @@ -786,7 +786,7 @@ static const prom_load_t pl_madr_a91 = /* shift */ 0, /* dmap */ DMAP_DEFAULT, /* dand */ ZERO, - /* type */ sizeof(UINT8) + /* type */ sizeof(uint8_t) }; //------------------------------------------------- @@ -818,10 +818,10 @@ void alto2_cpu_device::device_start() m_ucode_crom = prom_load(machine(), pl_ucode, memregion("ucode_proms")->base(), 2, 8); // allocate micro code CRAM for max 3 pages - m_ucode_cram = std::make_unique(sizeof(UINT32) * 3 * ALTO2_UCODE_PAGE_SIZE); + m_ucode_cram = std::make_unique(sizeof(uint32_t) * 3 * ALTO2_UCODE_PAGE_SIZE); // fill with the micro code inverted bits value for (offs_t offset = 0; offset < 3 * ALTO2_UCODE_PAGE_SIZE; offset++) - *reinterpret_cast(m_ucode_cram.get() + offset * 4) = ALTO2_UCODE_INVERTED; + *reinterpret_cast(m_ucode_cram.get() + offset * 4) = ALTO2_UCODE_INVERTED; // decode constant PROMs to m_const_data m_const_data = prom_load(machine(), pl_const, memregion("const_proms")->base(), 1, 4); @@ -836,8 +836,8 @@ void alto2_cpu_device::device_start() #if DEBUG_ALU_A10_PROM // dump ALU a10 PROM after loading - for (UINT8 i = 0; i < 32; i++) { - UINT8 a = m_alu_a10[i]; + for (uint8_t i = 0; i < 32; i++) { + uint8_t a = m_alu_a10[i]; printf("%03o: S3-S0:%u%u%u%u M:%u CI:%u T:%u ?:%u\n", i, (a >> 7) & 1, (a >> 6) & 1, (a >> 5) & 1, (a >> 4) & 1, (a >> 3) & 1, (a >> 2) & 1, (a >> 1) & 1, (a >> 0) & 1); @@ -1014,7 +1014,7 @@ void alto2_cpu_device::state_string_export(const device_state_entry &entry, std: m_aluc0 ? 'C' : '-', m_laluc0 ? 'c' : '-', (m_shifter == 0) ? '0' : '-', - (INT16(m_shifter) < 0) ? '<' : '-'); + (int16_t(m_shifter) < 0) ? '<' : '-'); break; } } @@ -1023,8 +1023,8 @@ void alto2_cpu_device::state_string_export(const device_state_entry &entry, std: READ32_MEMBER ( alto2_cpu_device::crom_cram_r ) { if (offset < m_ucode_ram_base) - return *reinterpret_cast(m_ucode_crom + offset * 4); - return *reinterpret_cast(m_ucode_cram.get() + (offset - m_ucode_ram_base) * 4); + return *reinterpret_cast(m_ucode_crom + offset * 4); + return *reinterpret_cast(m_ucode_cram.get() + (offset - m_ucode_ram_base) * 4); } //! write microcode CROM or CRAM (CROM of course can't be written) @@ -1032,19 +1032,19 @@ WRITE32_MEMBER( alto2_cpu_device::crom_cram_w ) { if (offset < m_ucode_ram_base) return; - *reinterpret_cast(m_ucode_cram.get() + (offset - m_ucode_ram_base) * 4) = data; + *reinterpret_cast(m_ucode_cram.get() + (offset - m_ucode_ram_base) * 4) = data; } //! read constants PROM READ16_MEMBER ( alto2_cpu_device::const_r ) { - return *reinterpret_cast(m_const_data + offset * 2); + return *reinterpret_cast(m_const_data + offset * 2); } //! direct read access to the microcode CROM or CRAM #define RD_UCODE(addr) (addr < m_ucode_ram_base ? \ - *reinterpret_cast(m_ucode_crom + addr * 4) : \ - *reinterpret_cast(m_ucode_cram.get() + (addr - m_ucode_ram_base) * 4)) + *reinterpret_cast(m_ucode_crom + addr * 4) : \ + *reinterpret_cast(m_ucode_cram.get() + (addr - m_ucode_ram_base) * 4)) //------------------------------------------------- // device_reset - device-specific reset @@ -1140,7 +1140,7 @@ const char* alto2_cpu_device::task_name(int task) } /** @brief register names (as used by the microcode) */ -const char* alto2_cpu_device::r_name(UINT8 reg) +const char* alto2_cpu_device::r_name(uint8_t reg) { switch (reg) { case 000: return "ac(3)"; @@ -1180,7 +1180,7 @@ const char* alto2_cpu_device::r_name(UINT8 reg) } /** @brief ALU function names */ -const char* alto2_cpu_device::aluf_name(UINT8 aluf) +const char* alto2_cpu_device::aluf_name(uint8_t aluf) { switch (aluf) { case 000: return "bus"; @@ -1204,7 +1204,7 @@ const char* alto2_cpu_device::aluf_name(UINT8 aluf) } /** @brief BUS source names */ -const char* alto2_cpu_device::bs_name(UINT8 bs) +const char* alto2_cpu_device::bs_name(uint8_t bs) { switch (bs) { case 000: return "read_r"; @@ -1220,7 +1220,7 @@ const char* alto2_cpu_device::bs_name(UINT8 bs) } /** @brief F1 function names */ -const char* alto2_cpu_device::f1_name(UINT8 f1) +const char* alto2_cpu_device::f1_name(uint8_t f1) { switch (f1) { case 000: return "nop"; @@ -1244,7 +1244,7 @@ const char* alto2_cpu_device::f1_name(UINT8 f1) } /** @brief F2 function names */ -const char* alto2_cpu_device::f2_name(UINT8 f2) +const char* alto2_cpu_device::f2_name(uint8_t f2) { switch (f2) { case 000: return "nop"; @@ -1268,12 +1268,12 @@ const char* alto2_cpu_device::f2_name(UINT8 f2) } #if ALTO2_DEBUG -void alto2_cpu_device::watch_read(UINT32 addr, UINT32 data) +void alto2_cpu_device::watch_read(uint32_t addr, uint32_t data) { LOG((this,LOG_MEM,0,"mem: rd[%06o] = %06o\n", addr, data)); } -void alto2_cpu_device::watch_write(UINT32 addr, UINT32 data) +void alto2_cpu_device::watch_write(uint32_t addr, uint32_t data) { LOG((this,LOG_MEM,0,"mem: wr[%06o] = %06o\n", addr, data)); } @@ -1323,7 +1323,7 @@ void alto2_cpu_device::f2_late_bad() #if ALTO2_DEBUG typedef struct { - UINT16 first, last; + uint16_t first, last; const char* name; } memory_range_name_t; @@ -1433,7 +1433,7 @@ WRITE16_MEMBER( alto2_cpu_device::bank_reg_w ) */ void alto2_cpu_device::bs_early_read_r() { - UINT16 r = m_r[m_rsel]; + uint16_t r = m_r[m_rsel]; LOG((this,LOG_CPU,2," <-R%02o; %s (%#o)\n", m_rsel, r_name(m_rsel), r)); m_bus &= r; } @@ -1443,7 +1443,7 @@ void alto2_cpu_device::bs_early_read_r() */ void alto2_cpu_device::bs_early_load_r() { - UINT16 r = 0; + uint16_t r = 0; LOG((this,LOG_CPU,2," R%02o<-; %s (BUS&=0)\n", m_rsel, r_name(m_rsel))); m_bus &= r; } @@ -1467,9 +1467,9 @@ void alto2_cpu_device::bs_late_load_r() void alto2_cpu_device::bs_early_read_md() { #if ALTO2_DEBUG - UINT32 mar = m_mem.mar; + uint32_t mar = m_mem.mar; #endif - UINT16 md = read_mem(); + uint16_t md = read_mem(); LOG((this,LOG_CPU,2," <-MD; BUS&=MD (%#o=[%#o])\n", md, mar)); m_bus &= md; } @@ -1479,7 +1479,7 @@ void alto2_cpu_device::bs_early_read_md() */ void alto2_cpu_device::bs_early_mouse() { - UINT16 r = mouse_read(); + uint16_t r = mouse_read(); LOG((this,LOG_CPU,2," <-MOUSE; BUS&=MOUSE (%#o)\n", r)); m_bus &= r; } @@ -1489,7 +1489,7 @@ void alto2_cpu_device::bs_early_mouse() */ void alto2_cpu_device::bs_early_disp() { - UINT16 r = 0177777; + uint16_t r = 0177777; LOG((this,LOG_CPU,0,"BS <-DISP not handled by task %s mpc:%04x\n", task_name(m_task), m_mpc)); LOG((this,LOG_CPU,2," <-DISP; BUS&=DISP ?? (%#o)\n", r)); m_bus &= r; @@ -1503,8 +1503,8 @@ void alto2_cpu_device::bs_early_disp() */ void alto2_cpu_device::f1_late_load_mar() { - UINT8 bank = m_bank_reg[m_task]; - UINT32 msb; + uint8_t bank = m_bank_reg[m_task]; + uint32_t msb; if (f2() == f2_load_md) { msb = GET_BANK_EXTENDED(bank) << 16; LOG((this,LOG_CPU,7, " XMAR %#o\n", msb | m_alu)); @@ -1829,7 +1829,7 @@ void alto2_cpu_device::f1_late_l_lcy_8() */ void alto2_cpu_device::f2_late_bus_eq_zero() { - UINT16 r = m_bus == 0 ? 1 : 0; + uint16_t r = m_bus == 0 ? 1 : 0; LOG((this,LOG_CPU,2, " BUS=0; %sbranch (%#o|%#o)\n", r ? "" : "no ", m_next2, r)); m_next2 |= r; } @@ -1839,7 +1839,7 @@ void alto2_cpu_device::f2_late_bus_eq_zero() */ void alto2_cpu_device::f2_late_shifter_lt_zero() { - UINT16 r = (m_shifter & 0100000) ? 1 : 0; + uint16_t r = (m_shifter & 0100000) ? 1 : 0; LOG((this,LOG_CPU,2, " SH<0; %sbranch (%#o|%#o)\n", r ? "" : "no ", m_next2, r)); m_next2 |= r; } @@ -1849,7 +1849,7 @@ void alto2_cpu_device::f2_late_shifter_lt_zero() */ void alto2_cpu_device::f2_late_shifter_eq_zero() { - UINT16 r = m_shifter == 0 ? 1 : 0; + uint16_t r = m_shifter == 0 ? 1 : 0; LOG((this,LOG_CPU,2, " SH=0; %sbranch (%#o|%#o)\n", r ? "" : "no ", m_next2, r)); m_next2 |= r; } @@ -1859,7 +1859,7 @@ void alto2_cpu_device::f2_late_shifter_eq_zero() */ void alto2_cpu_device::f2_late_bus() { - UINT16 r = X_RDBITS(m_bus,16,6,15); + uint16_t r = X_RDBITS(m_bus,16,6,15); LOG((this,LOG_CPU,2, " BUS; %sbranch (%#o|%#o)\n", r ? "" : "no ", m_next2, r)); m_next2 |= r; } @@ -1869,7 +1869,7 @@ void alto2_cpu_device::f2_late_bus() */ void alto2_cpu_device::f2_late_alucy() { - UINT16 r = m_laluc0; + uint16_t r = m_laluc0; LOG((this,LOG_CPU,2, " ALUCY; %sbranch (%#o|%#o)\n", r ? "" : "no ", m_next2, r)); m_next2 |= r; } @@ -1882,7 +1882,7 @@ void alto2_cpu_device::f2_late_alucy() void alto2_cpu_device::f2_late_load_md() { #if ALTO2_DEBUG - UINT16 mar = m_mem.mar; + uint16_t mar = m_mem.mar; #endif if (f1() == f1_load_mar) { /* part of an XMAR */ @@ -2000,10 +2000,10 @@ void alto2_cpu_device::f2_late_load_md() * @return resulting ALU output */ #if 1 -UINT32 alto2_cpu_device::alu_74181(UINT32 a, UINT32 b, UINT8 smc) +uint32_t alto2_cpu_device::alu_74181(uint32_t a, uint32_t b, uint8_t smc) { - UINT32 f; - const UINT32 cout = 1 << 16; + uint32_t f; + const uint32_t cout = 1 << 16; switch (smc & A10_ALUIN) { case SMC(0,0,0,0, 0, 0): // 0000: A + 1 @@ -2243,7 +2243,7 @@ UINT32 alto2_cpu_device::alu_74181(UINT32 a, UINT32 b, UINT8 smc) } while (0) -UINT32 alto2_cpu_device::alu_74181(UINT32 a, UINT32 b, UINT8 smc) +uint32_t alto2_cpu_device::alu_74181(uint32_t a, uint32_t b, uint8_t smc) { // inputs int ci = !BIT(smc, 2); @@ -2251,7 +2251,7 @@ UINT32 alto2_cpu_device::alu_74181(UINT32 a, UINT32 b, UINT8 smc) int s0 = !BIT(smc, 4), s1 = !BIT(smc, 5), s2 = !BIT(smc, 6), s3 = !BIT(smc, 7); // outputs - UINT32 f = 0; + uint32_t f = 0; int cn_x; DO_74181(ci, mp,s0,s1,s2,s3,a,b, 0, 1, 2, 3,f,cn_x); // 74181 #1 int cn_y; @@ -2359,8 +2359,8 @@ void alto2_cpu_device::execute_run() // The constant memory is gated to the bus by F1 == f1_const, F2 == f2_const, or BS >= 4 if (!do_bs || bs() >= bs_task_4) { - const UINT32 addr = 8 * m_rsel + bs(); - const UINT16 data = m_const_data[2*addr] | (m_const_data[2*addr+1] << 8); + const uint32_t addr = 8 * m_rsel + bs(); + const uint16_t data = m_const_data[2*addr] | (m_const_data[2*addr+1] << 8); m_bus &= data; LOG((this,LOG_CPU,2," %#o; BUS &= %#o CONST[%03o]\n", m_bus, data, addr)); } @@ -2544,11 +2544,11 @@ void alto2_cpu_device::execute_run() * * B1 and B3-B7 are inverted on loading the PROM */ - const UINT8 a10 = m_alu_a10[(m_emu.skip << 4) | aluf()]; - const UINT32 alu = alu_74181(m_bus, m_t, a10); + const uint8_t a10 = m_alu_a10[(m_emu.skip << 4) | aluf()]; + const uint32_t alu = alu_74181(m_bus, m_t, a10); const int flags = a10 & (TSELECT | ALUM); m_aluc0 = (alu >> 16) & 1; - m_alu = static_cast(alu); + m_alu = static_cast(alu); // WRTRAM must happen now before L is changed if (m_wrtram_flag) diff --git a/src/devices/cpu/alto2/alto2cpu.h b/src/devices/cpu/alto2/alto2cpu.h index 036f709dae0..20211b511e7 100644 --- a/src/devices/cpu/alto2/alto2cpu.h +++ b/src/devices/cpu/alto2/alto2cpu.h @@ -85,7 +85,7 @@ enum { //! put a value %val into %reg, a word of %width bits, starting at bit %from until bit %to #define X_WRBITS(reg,width,from,to,val) do { \ - UINT32 mask = X_BITMASK(from,to) << X_BITSHIFT(width,to); \ + uint32_t mask = X_BITMASK(from,to) << X_BITSHIFT(width,to); \ reg = ((reg) & ~mask) | (((val) << X_BITSHIFT(width,to)) & mask); \ } while (0) @@ -180,7 +180,7 @@ class alto2_cpu_device : public cpu_device { public: // construction/destruction - alto2_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + alto2_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~alto2_cpu_device(); //! driver interface to set diablo_hd_device @@ -193,7 +193,7 @@ public: void next_sector(int unit); //! update the screen bitmap - 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); //! set the vblank bit for the display to synch upon void screen_vblank(); @@ -221,9 +221,9 @@ protected: void interface_post_reset() override; //! device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -236,9 +236,9 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; //! device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: @@ -250,16 +250,16 @@ private: address_space* m_iomem; - UINT32 m_cram_config; //!< CROM/CRAM configuration (1 .. 3) - UINT32 m_ucode_rom_pages; //!< Number of CROM pages; derived from m_cram_config - UINT32 m_ucode_ram_pages; //!< Number of CRAM pages; derived from m_cram_config - UINT32 m_ucode_ram_base; //!< Base offset of the CRAM addresses - UINT32 m_ucode_size; //!< Size of both, CROM and CRAM together - UINT32 m_sreg_banks; //!< Number of S register banks; derived from m_cram_config + uint32_t m_cram_config; //!< CROM/CRAM configuration (1 .. 3) + uint32_t m_ucode_rom_pages; //!< Number of CROM pages; derived from m_cram_config + uint32_t m_ucode_ram_pages; //!< Number of CRAM pages; derived from m_cram_config + uint32_t m_ucode_ram_base; //!< Base offset of the CRAM addresses + uint32_t m_ucode_size; //!< Size of both, CROM and CRAM together + uint32_t m_sreg_banks; //!< Number of S register banks; derived from m_cram_config - UINT8* m_ucode_crom; - std::unique_ptr m_ucode_cram; - UINT8* m_const_data; + uint8_t* m_ucode_crom; + std::unique_ptr m_ucode_cram; + uint8_t* m_const_data; //! read microcode CROM or CRAM, depending on m_ucode_ram_base DECLARE_READ32_MEMBER ( crom_cram_r ); @@ -520,42 +520,42 @@ private: }; //! get the normally accessed bank number from a bank register - static inline UINT16 GET_BANK_NORMAL(UINT16 breg) { return X_RDBITS(breg,16,12,13); } + static inline uint16_t GET_BANK_NORMAL(uint16_t breg) { return X_RDBITS(breg,16,12,13); } //! get the extended bank number (accessed via XMAR) from a bank register - static inline UINT16 GET_BANK_EXTENDED(UINT16 breg) { return X_RDBITS(breg,16,14,15); } + static inline uint16_t GET_BANK_EXTENDED(uint16_t breg) { return X_RDBITS(breg,16,14,15); } //! get an ignored bit field from a control RAM address - static inline UINT16 GET_CRAM_IGNORE(UINT16 addr) { return X_RDBITS(addr,16,0,1); } + static inline uint16_t GET_CRAM_IGNORE(uint16_t addr) { return X_RDBITS(addr,16,0,1); } //! get the bank select bit field from a control RAM address - static inline UINT16 GET_CRAM_BANKSEL(UINT16 addr) { return X_RDBITS(addr,16,2,3); } + static inline uint16_t GET_CRAM_BANKSEL(uint16_t addr) { return X_RDBITS(addr,16,2,3); } //! get the ROM/RAM flag from a control RAM address - static inline UINT16 GET_CRAM_RAMROM(UINT16 addr) { return X_RDBITS(addr,16,4,4); } + static inline uint16_t GET_CRAM_RAMROM(uint16_t addr) { return X_RDBITS(addr,16,4,4); } //! get the half select flag from a control RAM address - static inline UINT16 GET_CRAM_HALFSEL(UINT16 addr) { return X_RDBITS(addr,16,5,5); } + static inline uint16_t GET_CRAM_HALFSEL(uint16_t addr) { return X_RDBITS(addr,16,5,5); } //! get the word address bit field from a control RAM address - static inline UINT16 GET_CRAM_WORDADDR(UINT16 addr) { return X_RDBITS(addr,16,6,15); } - - UINT16 m_task_mpc[ALTO2_TASKS]; //!< per task micro program counter - UINT16 m_task_next2[ALTO2_TASKS]; //!< per task address modifier - UINT8 m_task; //!< active task - UINT8 m_next_task; //!< next micro instruction's task - UINT8 m_next2_task; //!< next but one micro instruction's task - UINT16 m_mpc; //!< micro program counter - UINT32 m_mir; //!< micro instruction register - - inline UINT32 rsel() const { return X_RDBITS(m_mir, 32, DRSEL0, DRSEL4); } - inline UINT32 aluf() const { return X_RDBITS(m_mir, 32, DALUF0, DALUF3); } - inline UINT32 bs() const { return X_RDBITS(m_mir, 32, DBS0, DBS2); } - inline UINT32 f1() const { return X_RDBITS(m_mir, 32, DF1_0, DF1_3); } - inline UINT32 f2() const { return X_RDBITS(m_mir, 32, DF2_0, DF2_3); } - inline UINT32 loadt() const { return X_BIT(m_mir, 32, DLOADT); } - inline UINT32 loadl() const { return X_BIT(m_mir, 32, DLOADL); } - inline UINT32 next() const { return X_RDBITS(m_mir, 32, NEXT0, NEXT9); } + static inline uint16_t GET_CRAM_WORDADDR(uint16_t addr) { return X_RDBITS(addr,16,6,15); } + + uint16_t m_task_mpc[ALTO2_TASKS]; //!< per task micro program counter + uint16_t m_task_next2[ALTO2_TASKS]; //!< per task address modifier + uint8_t m_task; //!< active task + uint8_t m_next_task; //!< next micro instruction's task + uint8_t m_next2_task; //!< next but one micro instruction's task + uint16_t m_mpc; //!< micro program counter + uint32_t m_mir; //!< micro instruction register + + inline uint32_t rsel() const { return X_RDBITS(m_mir, 32, DRSEL0, DRSEL4); } + inline uint32_t aluf() const { return X_RDBITS(m_mir, 32, DALUF0, DALUF3); } + inline uint32_t bs() const { return X_RDBITS(m_mir, 32, DBS0, DBS2); } + inline uint32_t f1() const { return X_RDBITS(m_mir, 32, DF1_0, DF1_3); } + inline uint32_t f2() const { return X_RDBITS(m_mir, 32, DF2_0, DF2_3); } + inline uint32_t loadt() const { return X_BIT(m_mir, 32, DLOADT); } + inline uint32_t loadl() const { return X_BIT(m_mir, 32, DLOADL); } + inline uint32_t next() const { return X_RDBITS(m_mir, 32, NEXT0, NEXT9); } /** * \brief current micro instruction's register selection @@ -563,28 +563,28 @@ private: * Note: The S registers are addressed by the original RSEL[0-4], * even when the emulator modifies this. */ - UINT8 m_rsel; - UINT16 m_next; //!< current micro instruction's next - UINT16 m_next2; //!< next micro instruction's next - UINT16 m_r[ALTO2_REGS]; //!< R register file - UINT16 m_s[8][ALTO2_REGS]; //!< S register file(s) (1 or 8 are used) - UINT16 m_bus; //!< wired-AND bus - UINT16 m_t; //!< T register - UINT16 m_alu; //!< the current ALU - UINT16 m_aluc0; //!< the current ALU carry output - UINT16 m_l; //!< L register - UINT16 m_shifter; //!< shifter output - UINT16 m_laluc0; //!< the latched ALU carry output - UINT16 m_myl; //!< M register of RAM related tasks (MYL latch in the schematics) - UINT16 m_cram_addr; //!< constant RAM address - UINT16 m_task_wakeup; //!< task wakeup: bit 1< */ - UINT8* m_ctl2k_u3; + uint8_t* m_ctl2k_u3; /** * @brief 2KCTL PROM u38; 82S23; 32x8 bit @@ -708,7 +708,7 @@ private: * B7 9 NEXT[06]' * */ - UINT8* m_ctl2k_u38; + uint8_t* m_ctl2k_u38; //! output lines of the 2KCTL U38 PROM enum { @@ -780,22 +780,22 @@ private: * depending on the current NEXT[01]' level. * */ - UINT8* m_ctl2k_u76; + uint8_t* m_ctl2k_u76; /** * @brief 3k CRAM PROM a37 */ - UINT8* m_cram3k_a37; + uint8_t* m_cram3k_a37; /** * @brief memory addressing PROM a64 */ - UINT8* m_madr_a64; + uint8_t* m_madr_a64; /** * @brief memory addressing PROM a65 */ - UINT8* m_madr_a65; + uint8_t* m_madr_a65; /** * @brief unused PROM a90 @@ -810,7 +810,7 @@ private: * * I haven't found yet where KP3-KP5 are used */ - UINT8* m_madr_a90; + uint8_t* m_madr_a90; /** * @brief unused PROM a91 @@ -837,12 +837,12 @@ private: * KE(6) KB(^L) KB(RTN) KB(") KB(/) KB(S3) KB(<-) KB(]) KB(\) * KE(7) KB(S1) KB(DEL) KB(S2) KB(LF) KB(S4) KB(S5) KB(BW) KB(BS) */ - UINT8* m_madr_a91; + uint8_t* m_madr_a91; /** * @brief ALU function to 74181 operation lookup PROM */ - UINT8* m_alu_a10; + uint8_t* m_alu_a10; //! output lines of the ALU a10 PROM enum { @@ -862,10 +862,10 @@ private: bool m_ram_related[ALTO2_TASKS]; //!< set when task is RAM related - UINT64 m_cycle; //!< number of cycles executed in the current slice + uint64_t m_cycle; //!< number of cycles executed in the current slice - UINT64 cycle() { return m_cycle; } //!< return the current CPU cycle - UINT64 ntime() { return m_cycle*ALTO2_UCYCLE/1000; } //!< return the current nano seconds + uint64_t cycle() { return m_cycle; } //!< return the current CPU cycle + uint64_t ntime() { return m_cycle*ALTO2_UCYCLE/1000; } //!< return the current nano seconds void hard_reset(); //!< reset the various registers void soft_reset(); //!< soft reset @@ -906,12 +906,12 @@ private: void f2_late_alucy(); //!< F2 func: branch on latched ALU carry void f2_late_load_md(); //!< F2 func: load memory data - UINT32 alu_74181(UINT32 a, UINT32 b, UINT8 smc); + uint32_t alu_74181(uint32_t a, uint32_t b, uint8_t smc); void rdram(); //!< read the microcode ROM/RAM halfword void wrtram(); //!< write the microcode RAM from M register and ALU - UINT8 m_ether_id; //!< configured Ethernet ID for this machine + uint8_t m_ether_id; //!< configured Ethernet ID for this machine //******************************************* // inline the sub-devices diff --git a/src/devices/cpu/alto2/alto2dsm.cpp b/src/devices/cpu/alto2/alto2dsm.cpp index 57571352c53..791cafb56e7 100644 --- a/src/devices/cpu/alto2/alto2dsm.cpp +++ b/src/devices/cpu/alto2/alto2dsm.cpp @@ -147,7 +147,7 @@ static const char* t_bus_alu[16] = { /** * @brief copy of the constant PROM, which this disassembler may not have access to */ -static UINT16 const_prom[PROM_SIZE] = { +static uint16_t const_prom[PROM_SIZE] = { /* 0000 */ 0x0000, 0x0001, 0x0002, 0xfffe, 0xffff, 0xffff, 0x000f, 0xffff, /* 0008 */ 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0xfff8, 0xfff8, /* 0010 */ 0x0010, 0x001f, 0x0020, 0x003f, 0x0040, 0x007f, 0x0080, 0x0007, @@ -206,14 +206,14 @@ static const char *addrname(int a) return dst; } -offs_t alto2_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t alto2_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { size_t len = 128; - UINT32 mir = (static_cast(oprom[0]) << 24) | - (static_cast(oprom[1]) << 16) | - (static_cast(oprom[2]) << 8) | - (static_cast(oprom[3]) << 0); + uint32_t mir = (static_cast(oprom[0]) << 24) | + (static_cast(oprom[1]) << 16) | + (static_cast(oprom[2]) << 8) | + (static_cast(oprom[3]) << 0); int rsel = (mir >> 27) & 31; int aluf = (mir >> 23) & 15; int bs = (mir >> 20) & 7; @@ -222,15 +222,15 @@ offs_t alto2_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 int t = (mir >> 11) & 1; int l = (mir >> 10) & 1; offs_t next = mir & 1023; - const UINT8* src = oprom - 4 * pc + 4 * next; - UINT32 next2 = (static_cast(src[0]) << 24) | - (static_cast(src[1]) << 16) | - (static_cast(src[2]) << 8) | - (static_cast(src[3]) << 0); - UINT16 prefetch = next2 & 1023; + const uint8_t* src = oprom - 4 * pc + 4 * next; + uint32_t next2 = (static_cast(src[0]) << 24) | + (static_cast(src[1]) << 16) | + (static_cast(src[2]) << 8) | + (static_cast(src[3]) << 0); + uint16_t prefetch = next2 & 1023; char *dst = buffer; offs_t result = 1 | DASMFLAG_SUPPORTED; - UINT8 pa; + uint8_t pa; if (next != pc + 1) result |= DASMFLAG_STEP_OUT; diff --git a/src/devices/cpu/am29000/am29000.cpp b/src/devices/cpu/am29000/am29000.cpp index 524cb8b28d8..62fbb6a5536 100644 --- a/src/devices/cpu/am29000/am29000.cpp +++ b/src/devices/cpu/am29000/am29000.cpp @@ -78,7 +78,7 @@ const device_type AM29000 = &device_creator; STATE ACCESSORS ***************************************************************************/ -am29000_cpu_device::am29000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +am29000_cpu_device::am29000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, AM29000, "AMD Am29000", tag, owner, clock, "am29000", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 32, 32, 0) , m_io_config("io", ENDIANNESS_BIG, 32, 32, 0) @@ -439,7 +439,7 @@ void am29000_cpu_device::device_reset() } -void am29000_cpu_device::signal_exception(UINT32 type) +void am29000_cpu_device::signal_exception(uint32_t type) { m_exception_queue[m_exceptions++] = type; } @@ -477,7 +477,7 @@ void am29000_cpu_device::external_irq_check() } -UINT32 am29000_cpu_device::read_program_word(UINT32 address) +uint32_t am29000_cpu_device::read_program_word(uint32_t address) { /* TODO: ROM enable? */ if (m_cps & CPS_PI || m_cps & CPS_RE) @@ -494,7 +494,7 @@ UINT32 am29000_cpu_device::read_program_word(UINT32 address) HELPER FUNCTIONS ***************************************************************************/ -UINT32 am29000_cpu_device::get_abs_reg(UINT8 r, UINT32 iptr) +uint32_t am29000_cpu_device::get_abs_reg(uint8_t r, uint32_t iptr) { if (r & 0x80) { @@ -528,8 +528,8 @@ UINT32 am29000_cpu_device::get_abs_reg(UINT8 r, UINT32 iptr) void am29000_cpu_device::fetch_decode() { - UINT32 inst; - UINT32 op_flags; + uint32_t inst; + uint32_t op_flags; inst = read_program_word(m_pc); m_next_ir = inst; @@ -598,7 +598,7 @@ void am29000_cpu_device::fetch_decode() void am29000_cpu_device::execute_run() { - UINT32 call_debugger = (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0; + uint32_t call_debugger = (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0; external_irq_check(); @@ -627,8 +627,8 @@ void am29000_cpu_device::execute_run() if (m_cfg & CFG_VF) { - UINT32 vaddr = m_vab | m_exception_queue[0] * 4; - UINT32 vect = m_datadirect->read_dword(vaddr); + uint32_t vaddr = m_vab | m_exception_queue[0] * 4; + uint32_t vect = m_datadirect->read_dword(vaddr); m_pc = vect & ~3; m_next_pc = m_pc; @@ -674,7 +674,7 @@ void am29000_cpu_device::execute_set_input(int inputnum, int state) } -offs_t am29000_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t am29000_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( am29000 ); return CPU_DISASSEMBLE_NAME(am29000)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/am29000/am29000.h b/src/devices/cpu/am29000/am29000.h index 4f0c1a1a4af..2b8dd1be5f8 100644 --- a/src/devices/cpu/am29000/am29000.h +++ b/src/devices/cpu/am29000/am29000.h @@ -435,7 +435,7 @@ class am29000_cpu_device : public cpu_device { public: // construction/destruction - am29000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + am29000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -443,9 +443,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -465,17 +465,17 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - void signal_exception(UINT32 type); + void signal_exception(uint32_t type); void external_irq_check(); - UINT32 read_program_word(UINT32 address); - UINT32 get_abs_reg(UINT8 r, UINT32 iptr); + uint32_t read_program_word(uint32_t address); + uint32_t get_abs_reg(uint8_t r, uint32_t iptr); void fetch_decode(); - UINT32 read_spr(UINT32 idx); - void write_spr(UINT32 idx, UINT32 val); + uint32_t read_spr(uint32_t idx); + void write_spr(uint32_t idx, uint32_t val); void ADD(); void ADDS(); void ADDU(); @@ -584,59 +584,59 @@ protected: address_space_config m_io_config; address_space_config m_data_config; - INT32 m_icount; - UINT32 m_pc; + int32_t m_icount; + uint32_t m_pc; /* General purpose */ - UINT32 m_r[256]; // TODO: There's only 192 implemented! + uint32_t m_r[256]; // TODO: There's only 192 implemented! /* TLB */ - UINT32 m_tlb[128]; + uint32_t m_tlb[128]; /* Protected SPRs */ - UINT32 m_vab; - UINT32 m_ops; - UINT32 m_cps; - UINT32 m_cfg; - UINT32 m_cha; - UINT32 m_chd; - UINT32 m_chc; - UINT32 m_rbp; - UINT32 m_tmc; - UINT32 m_tmr; - UINT32 m_pc0; - UINT32 m_pc1; - UINT32 m_pc2; - UINT32 m_mmu; - UINT32 m_lru; + uint32_t m_vab; + uint32_t m_ops; + uint32_t m_cps; + uint32_t m_cfg; + uint32_t m_cha; + uint32_t m_chd; + uint32_t m_chc; + uint32_t m_rbp; + uint32_t m_tmc; + uint32_t m_tmr; + uint32_t m_pc0; + uint32_t m_pc1; + uint32_t m_pc2; + uint32_t m_mmu; + uint32_t m_lru; /* Unprotected SPRs */ - UINT32 m_ipc; - UINT32 m_ipa; - UINT32 m_ipb; - UINT32 m_q; - UINT32 m_alu; - UINT32 m_fpe; - UINT32 m_inte; - UINT32 m_fps; + uint32_t m_ipc; + uint32_t m_ipa; + uint32_t m_ipb; + uint32_t m_q; + uint32_t m_alu; + uint32_t m_fpe; + uint32_t m_inte; + uint32_t m_fps; /* Pipeline state */ - UINT32 m_exceptions; - UINT32 m_exception_queue[4]; + uint32_t m_exceptions; + uint32_t m_exception_queue[4]; - UINT8 m_irq_active; - UINT8 m_irq_lines; + uint8_t m_irq_active; + uint8_t m_irq_lines; - UINT32 m_exec_ir; - UINT32 m_next_ir; + uint32_t m_exec_ir; + uint32_t m_next_ir; - UINT32 m_pl_flags; - UINT32 m_next_pl_flags; + uint32_t m_pl_flags; + uint32_t m_next_pl_flags; - UINT32 m_iret_pc; + uint32_t m_iret_pc; - UINT32 m_exec_pc; - UINT32 m_next_pc; + uint32_t m_exec_pc; + uint32_t m_next_pc; address_space *m_program; direct_read_data *m_direct; @@ -647,7 +647,7 @@ protected: typedef void ( am29000_cpu_device::*opcode_func ) (); struct op_info { opcode_func opcode; - UINT32 flags; + uint32_t flags; }; static const op_info op_table[256]; diff --git a/src/devices/cpu/am29000/am29dasm.cpp b/src/devices/cpu/am29000/am29dasm.cpp index bd8c6712fd2..039181d65a4 100644 --- a/src/devices/cpu/am29000/am29dasm.cpp +++ b/src/devices/cpu/am29000/am29dasm.cpp @@ -29,14 +29,14 @@ #define OP_CE ((op >> 23) & 1) #define OP_CNTL ((op >> 16) & 0x7f) -#define OP_SJMP ((INT32)(INT16)OP_I16 << 2) +#define OP_SJMP ((int32_t)(int16_t)OP_I16 << 2) /*************************************************************************** CODE ***************************************************************************/ -static const char *dasm_type1(UINT32 op) +static const char *dasm_type1(uint32_t op) { static char buf[32]; @@ -48,7 +48,7 @@ static const char *dasm_type1(UINT32 op) return buf; } -static const char *dasm_type2(UINT32 op) +static const char *dasm_type2(uint32_t op) { static char buf[32]; @@ -57,7 +57,7 @@ static const char *dasm_type2(UINT32 op) return buf; } -static const char *dasm_type3(UINT32 op) +static const char *dasm_type3(uint32_t op) { static char buf[32]; @@ -66,7 +66,7 @@ static const char *dasm_type3(UINT32 op) return buf; } -static const char *dasm_type4(UINT32 op, UINT32 pc) +static const char *dasm_type4(uint32_t op, uint32_t pc) { static char buf[32]; @@ -78,7 +78,7 @@ static const char *dasm_type4(UINT32 op, UINT32 pc) return buf; } -static const char *dasm_type5(UINT32 op) +static const char *dasm_type5(uint32_t op) { static char buf[32]; @@ -90,7 +90,7 @@ static const char *dasm_type5(UINT32 op) return buf; } -static const char *dasm_type6(UINT32 op) +static const char *dasm_type6(uint32_t op) { static char buf[32]; @@ -147,8 +147,8 @@ static const char* get_spr(int spid) CPU_DISASSEMBLE( am29000 ) { - UINT32 op = (oprom[0] << 24) | (oprom[1] << 16) | (oprom[2] << 8) | oprom[3]; - UINT32 flags = 0; + uint32_t op = (oprom[0] << 24) | (oprom[1] << 16) | (oprom[2] << 8) | oprom[3]; + uint32_t flags = 0; switch (op >> 24) { diff --git a/src/devices/cpu/am29000/am29ops.h b/src/devices/cpu/am29000/am29ops.h index df8925972ab..87890ea0137 100644 --- a/src/devices/cpu/am29000/am29ops.h +++ b/src/devices/cpu/am29000/am29ops.h @@ -45,12 +45,12 @@ #define I8 (m_exec_ir & 0xff) #define I16 (((m_exec_ir >> 8) & 0xff00) | (m_exec_ir & 0xff)) -#define I16_ZEX ((UINT32)(I16)) -#define I16_SEX ((INT32)(INT16)I16) +#define I16_ZEX ((uint32_t)(I16)) +#define I16_SEX ((int32_t)(int16_t)I16) #define I16_OEX (0xffff0000 | I16) #define JMP_ZEX (I16 << 2) -#define JMP_SEX ((INT32)(INT16)(((m_exec_ir >> 8) & 0xff00) | (m_exec_ir & 0xff)) << 2) +#define JMP_SEX ((int32_t)(int16_t)(((m_exec_ir >> 8) & 0xff00) | (m_exec_ir & 0xff)) << 2) #define BOOLEAN_MASK (1 << 31) #define BOOLEAN_TRUE (1 << 31) @@ -67,31 +67,31 @@ m_alu |= (r == 0) << ALU_Z_SHIFT; #define SET_ALU_N(r) m_alu &= ~ALU_N; \ - m_alu |= ((UINT32)r & 0x80000000) >> (31 - ALU_N_SHIFT); + m_alu |= ((uint32_t)r & 0x80000000) >> (31 - ALU_N_SHIFT); -#define CALC_C_ADD(r, a) ((UINT32)(r) < (UINT32)(a)) +#define CALC_C_ADD(r, a) ((uint32_t)(r) < (uint32_t)(a)) #define SET_ALU_C_ADD(r, a) m_alu &= ~ALU_C; \ m_alu |= CALC_C_ADD(r, a) << ALU_C_SHIFT; -#define CALC_C_SUB(a, b) (!((UINT32)(a) < (UINT32)(b))) +#define CALC_C_SUB(a, b) (!((uint32_t)(a) < (uint32_t)(b))) #define SET_ALU_C_SUB(a, b) m_alu &= ~ALU_C; \ m_alu |= CALC_C_SUB(a, b) << ALU_C_SHIFT; #define SET_ALU_V_ADD(r, a, b) m_alu &= ~ALU_V; \ - m_alu |= (((INT32)(~((a) ^ (b)) & ((a) ^ (r))) < 0)) << ALU_V_SHIFT; + m_alu |= (((int32_t)(~((a) ^ (b)) & ((a) ^ (r))) < 0)) << ALU_V_SHIFT; #define SET_ALU_V_SUB(r, a, b) m_alu &= ~ALU_V; \ - m_alu |= ((INT32)(((a) ^ (b)) & ((a) ^ (r))) < 0) << ALU_V_SHIFT; + m_alu |= ((int32_t)(((a) ^ (b)) & ((a) ^ (r))) < 0) << ALU_V_SHIFT; #define GET_CARRY ((m_alu >> ALU_C_SHIFT) & 1) -UINT32 am29000_cpu_device::read_spr(UINT32 idx) +uint32_t am29000_cpu_device::read_spr(uint32_t idx) { - UINT32 val = 0; + uint32_t val = 0; switch (idx) { @@ -129,7 +129,7 @@ UINT32 am29000_cpu_device::read_spr(UINT32 idx) } -void am29000_cpu_device::write_spr(UINT32 idx, UINT32 val) +void am29000_cpu_device::write_spr(uint32_t idx, uint32_t val) { switch (idx) { @@ -203,9 +203,9 @@ void am29000_cpu_device::write_spr(UINT32 idx, UINT32 val) void am29000_cpu_device::ADD() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = a + b; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = a + b; if (!FREEZE_MODE) { @@ -235,14 +235,14 @@ void am29000_cpu_device::ADDC() void am29000_cpu_device::ADDCS() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = a + b + GET_CARRY; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = a + b + GET_CARRY; if (!FREEZE_MODE) { - UINT32 carry = GET_CARRY; - UINT32 tmp = a + b; + uint32_t carry = GET_CARRY; + uint32_t tmp = a + b; SET_ALU_V_ADD(r, a, b); SET_ALU_Z(r); @@ -264,9 +264,9 @@ void am29000_cpu_device::ADDCU() void am29000_cpu_device::SUB() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8 : GET_RB_VAL; - UINT32 r = a - b; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8 : GET_RB_VAL; + uint32_t r = a - b; if (!FREEZE_MODE) { @@ -282,9 +282,9 @@ void am29000_cpu_device::SUB() void am29000_cpu_device::SUBS() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8 : GET_RB_VAL; - UINT32 r = a - b; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8 : GET_RB_VAL; + uint32_t r = a - b; if (!FREEZE_MODE) { @@ -294,7 +294,7 @@ void am29000_cpu_device::SUBS() SET_ALU_C_SUB(a, b); } - if ((INT32)(((a) ^ (b)) & ((a) ^ (r))) < 0) + if ((int32_t)(((a) ^ (b)) & ((a) ^ (r))) < 0) SIGNAL_EXCEPTION(EXCEPTION_OUT_OF_RANGE); m_r[RC] = r; @@ -322,9 +322,9 @@ void am29000_cpu_device::SUBCU() void am29000_cpu_device::SUBR() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8 : GET_RB_VAL; - UINT32 r = b - a; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8 : GET_RB_VAL; + uint32_t r = b - a; if (!FREEZE_MODE) { @@ -349,9 +349,9 @@ void am29000_cpu_device::SUBRU() void am29000_cpu_device::SUBRC() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8 : GET_RB_VAL; - UINT32 r = b - a - 1 + GET_CARRY; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8 : GET_RB_VAL; + uint32_t r = b - a - 1 + GET_CARRY; if (!FREEZE_MODE) { @@ -387,16 +387,16 @@ void am29000_cpu_device::MULTIPLY() void am29000_cpu_device::MUL() { /* TODO: Zero/Neg flags ? */ - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8 : GET_RB_VAL; - UINT32 r; - UINT64 v; - UINT32 sign; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8 : GET_RB_VAL; + uint32_t r; + uint64_t v; + uint32_t sign; if (m_q & 1) { r = a + b; - sign = (r >> 31) ^ (((INT32)(~((a) ^ (b)) & ((a) ^ (r))) < 0)); + sign = (r >> 31) ^ (((int32_t)(~((a) ^ (b)) & ((a) ^ (r))) < 0)); } else { @@ -404,7 +404,7 @@ void am29000_cpu_device::MUL() sign = b >> 31; } - v = ((((UINT64)r << 32) | m_q) >> 1) | ((UINT64)sign << 63); + v = ((((uint64_t)r << 32) | m_q) >> 1) | ((uint64_t)sign << 63); m_q = v & 0xffffffff; m_r[RC] = v >> 32; @@ -413,16 +413,16 @@ void am29000_cpu_device::MUL() void am29000_cpu_device::MULL() { /* TODO: Zero/Neg flags ? */ - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8 : GET_RB_VAL; - UINT32 r; - UINT64 v; - UINT32 sign; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8 : GET_RB_VAL; + uint32_t r; + uint64_t v; + uint32_t sign; if (m_q & 1) { r = b - a; - sign = (r >> 31) ^ ((INT32)(((a) ^ (b)) & ((a) ^ (r))) < 0); + sign = (r >> 31) ^ ((int32_t)(((a) ^ (b)) & ((a) ^ (r))) < 0); } else { @@ -430,7 +430,7 @@ void am29000_cpu_device::MULL() sign = b >> 31; } - v = ((((UINT64)r << 32) | m_q) >> 1) | ((UINT64)sign << 63); + v = ((((uint64_t)r << 32) | m_q) >> 1) | ((uint64_t)sign << 63); m_q = v & 0xffffffff; m_r[RC] = v >> 32; @@ -439,16 +439,16 @@ void am29000_cpu_device::MULL() void am29000_cpu_device::MULU() { /* TODO: Zero/Neg flags ? */ - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8 : GET_RB_VAL; - UINT32 r; - UINT64 v; - UINT32 c; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8 : GET_RB_VAL; + uint32_t r; + uint64_t v; + uint32_t c; if (m_q & 1) { r = a + b; - c = (UINT32)(r) < (UINT32)(a); + c = (uint32_t)(r) < (uint32_t)(a); } else { @@ -456,7 +456,7 @@ void am29000_cpu_device::MULU() c = 0; } - v = ((((UINT64)r << 32) | m_q) >> 1) | ((UINT64)c << 63); + v = ((((uint64_t)r << 32) | m_q) >> 1) | ((uint64_t)c << 63); m_q = v & 0xffffffff; m_r[RC] = v >> 32; @@ -478,8 +478,8 @@ void am29000_cpu_device::DIVIDU() void am29000_cpu_device::DIV0() { - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT64 v; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint64_t v; if (!FREEZE_MODE) { @@ -487,7 +487,7 @@ void am29000_cpu_device::DIV0() SET_ALU_N(b); } - v = (((UINT64)b << 32) | m_q) << 1; + v = (((uint64_t)b << 32) | m_q) << 1; m_q = v & 0xffffffff; @@ -496,22 +496,22 @@ void am29000_cpu_device::DIV0() void am29000_cpu_device::DIV() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 c; - UINT32 r; - UINT64 r64; - UINT32 df; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t c; + uint32_t r; + uint64_t r64; + uint32_t df; if (m_alu & ALU_DF) { r = a - b; - c = !((UINT32)(a) < (UINT32)(b)); + c = !((uint32_t)(a) < (uint32_t)(b)); } else { r = a + b; - c = (UINT32)(r) < (UINT32)(a); + c = (uint32_t)(r) < (uint32_t)(a); } @@ -524,7 +524,7 @@ void am29000_cpu_device::DIV() SET_ALU_N(r); } - r64 = ((((UINT64)r << 32) | m_q) << 1) | df; + r64 = ((((uint64_t)r << 32) | m_q) << 1) | df; m_q = r64 & 0xffffffff; m_r[RC] = r64 >> 32; @@ -532,21 +532,21 @@ void am29000_cpu_device::DIV() void am29000_cpu_device::DIVL() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 c; - UINT32 r; - UINT32 df; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t c; + uint32_t r; + uint32_t df; if (m_alu & ALU_DF) { r = a - b; - c = !((UINT32)(a) < (UINT32)(b)); + c = !((uint32_t)(a) < (uint32_t)(b)); } else { r = a + b; - c = (UINT32)(r) < (UINT32)(a); + c = (uint32_t)(r) < (uint32_t)(a); } df = (~(c ^ (m_alu >> ALU_DF_SHIFT) ^ (m_alu >> ALU_N_SHIFT)) & 1); @@ -564,8 +564,8 @@ void am29000_cpu_device::DIVL() void am29000_cpu_device::DIVREM() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; if (m_alu & ALU_DF) m_r[RC] = a; @@ -580,99 +580,99 @@ void am29000_cpu_device::DIVREM() void am29000_cpu_device::CPEQ() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = a == b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = a == b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPNEQ() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = a != b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = a != b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPLT() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = (INT32)a < (INT32)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = (int32_t)a < (int32_t)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPLTU() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = (UINT32)a < (UINT32)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = (uint32_t)a < (uint32_t)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPLE() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = (INT32)a <= (INT32)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = (int32_t)a <= (int32_t)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPLEU() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = (UINT32)a <= (UINT32)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = (uint32_t)a <= (uint32_t)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPGT() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = (INT32)a > (INT32)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = (int32_t)a > (int32_t)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPGTU() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = (UINT32)a > (UINT32)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = (uint32_t)a > (uint32_t)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPGE() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = (INT32)a >= (INT32)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = (int32_t)a >= (int32_t)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPGEU() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = (UINT32)a >= (UINT32)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = (uint32_t)a >= (uint32_t)b ? BOOLEAN_TRUE : BOOLEAN_FALSE; m_r[RC] = r; } void am29000_cpu_device::CPBYTE() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8 : GET_RB_VAL; - UINT32 r = + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8 : GET_RB_VAL; + uint32_t r = ((a & 0xff000000) == (b & 0xff000000)) || ((a & 0x00ff0000) == (b & 0x00ff0000)) || ((a & 0x0000ff00) == (b & 0x0000ff00)) || @@ -702,7 +702,7 @@ void am29000_cpu_device::ASLT() { if (USER_MODE && INST_VN < 64) SIGNAL_EXCEPTION(EXCEPTION_PROTECTION_VIOLATION); - else if (!((INT32)GET_RA_VAL < (INT32)GET_RB_VAL)) + else if (!((int32_t)GET_RA_VAL < (int32_t)GET_RB_VAL)) SIGNAL_EXCEPTION(INST_VN); } @@ -710,7 +710,7 @@ void am29000_cpu_device::ASLTU() { if (USER_MODE && INST_VN < 64) SIGNAL_EXCEPTION(EXCEPTION_PROTECTION_VIOLATION); - else if (!((UINT32)GET_RA_VAL < (UINT32)GET_RB_VAL)) + else if (!((uint32_t)GET_RA_VAL < (uint32_t)GET_RB_VAL)) SIGNAL_EXCEPTION(INST_VN); } @@ -718,7 +718,7 @@ void am29000_cpu_device::ASLE() { if (USER_MODE && INST_VN < 64) SIGNAL_EXCEPTION(EXCEPTION_PROTECTION_VIOLATION); - else if (!((INT32)GET_RA_VAL <= (INT32)GET_RB_VAL)) + else if (!((int32_t)GET_RA_VAL <= (int32_t)GET_RB_VAL)) SIGNAL_EXCEPTION(INST_VN); } @@ -726,7 +726,7 @@ void am29000_cpu_device::ASLEU() { if (USER_MODE && INST_VN < 64) SIGNAL_EXCEPTION(EXCEPTION_PROTECTION_VIOLATION); - else if (!((UINT32)GET_RA_VAL <= (UINT32)GET_RB_VAL)) + else if (!((uint32_t)GET_RA_VAL <= (uint32_t)GET_RB_VAL)) SIGNAL_EXCEPTION(INST_VN); } @@ -734,7 +734,7 @@ void am29000_cpu_device::ASGT() { if (USER_MODE && INST_VN < 64) SIGNAL_EXCEPTION(EXCEPTION_PROTECTION_VIOLATION); - else if (!((INT32)GET_RA_VAL > (INT32)GET_RB_VAL)) + else if (!((int32_t)GET_RA_VAL > (int32_t)GET_RB_VAL)) SIGNAL_EXCEPTION(INST_VN); } @@ -742,7 +742,7 @@ void am29000_cpu_device::ASGTU() { if (USER_MODE && INST_VN < 64) SIGNAL_EXCEPTION(EXCEPTION_PROTECTION_VIOLATION); - else if (!((UINT32)GET_RA_VAL > (UINT32)GET_RB_VAL)) + else if (!((uint32_t)GET_RA_VAL > (uint32_t)GET_RB_VAL)) SIGNAL_EXCEPTION(INST_VN); } @@ -750,7 +750,7 @@ void am29000_cpu_device::ASGE() { if (USER_MODE && INST_VN < 64) SIGNAL_EXCEPTION(EXCEPTION_PROTECTION_VIOLATION); - else if (!((INT32)GET_RA_VAL >= (INT32)GET_RB_VAL)) + else if (!((int32_t)GET_RA_VAL >= (int32_t)GET_RB_VAL)) SIGNAL_EXCEPTION(INST_VN); } @@ -758,7 +758,7 @@ void am29000_cpu_device::ASGEU() { if (USER_MODE && INST_VN < 64) SIGNAL_EXCEPTION(EXCEPTION_PROTECTION_VIOLATION); - else if (!((UINT32)GET_RA_VAL >= (UINT32)GET_RB_VAL)) + else if (!((uint32_t)GET_RA_VAL >= (uint32_t)GET_RB_VAL)) SIGNAL_EXCEPTION(INST_VN); } @@ -769,9 +769,9 @@ void am29000_cpu_device::ASGEU() void am29000_cpu_device::AND() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = a & b; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = a & b; if (!FREEZE_MODE) { @@ -784,9 +784,9 @@ void am29000_cpu_device::AND() void am29000_cpu_device::ANDN() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = a & ~b; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = a & ~b; if (!FREEZE_MODE) { @@ -799,9 +799,9 @@ void am29000_cpu_device::ANDN() void am29000_cpu_device::NAND() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = ~(a & b); + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = ~(a & b); if (!FREEZE_MODE) { @@ -814,9 +814,9 @@ void am29000_cpu_device::NAND() void am29000_cpu_device::OR() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = a | b; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = a | b; if (!FREEZE_MODE) { @@ -829,9 +829,9 @@ void am29000_cpu_device::OR() void am29000_cpu_device::NOR() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = ~(a | b); + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = ~(a | b); if (!FREEZE_MODE) { @@ -844,9 +844,9 @@ void am29000_cpu_device::NOR() void am29000_cpu_device::XOR() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = a ^ b; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = a ^ b; if (!FREEZE_MODE) { @@ -859,9 +859,9 @@ void am29000_cpu_device::XOR() void am29000_cpu_device::XNOR() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r = ~(a ^ b); + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r = ~(a ^ b); if (!FREEZE_MODE) { @@ -879,38 +879,38 @@ void am29000_cpu_device::XNOR() void am29000_cpu_device::SLL() { - UINT32 a = GET_RA_VAL; - UINT32 b = (INST_M_BIT ? I8: GET_RB_VAL) & 0x1f; - UINT32 r = a << b; + uint32_t a = GET_RA_VAL; + uint32_t b = (INST_M_BIT ? I8: GET_RB_VAL) & 0x1f; + uint32_t r = a << b; m_r[RC] = r; } void am29000_cpu_device::SRL() { - UINT32 a = GET_RA_VAL; - UINT32 b = (INST_M_BIT ? I8: GET_RB_VAL) & 0x1f; - UINT32 r = a >> b; + uint32_t a = GET_RA_VAL; + uint32_t b = (INST_M_BIT ? I8: GET_RB_VAL) & 0x1f; + uint32_t r = a >> b; m_r[RC] = r; } void am29000_cpu_device::SRA() { - INT32 a = GET_RA_VAL; - UINT32 b = (INST_M_BIT ? I8: GET_RB_VAL) & 0x1f; - UINT32 r = a >> b; + int32_t a = GET_RA_VAL; + uint32_t b = (INST_M_BIT ? I8: GET_RB_VAL) & 0x1f; + uint32_t r = a >> b; m_r[RC] = r; } void am29000_cpu_device::EXTRACT() { - INT32 a = GET_RA_VAL; - UINT32 b = (INST_M_BIT ? I8: GET_RB_VAL); - UINT64 r; + int32_t a = GET_RA_VAL; + uint32_t b = (INST_M_BIT ? I8: GET_RB_VAL); + uint64_t r; - r = (((UINT64)a << 32) | b) << GET_ALU_FC; + r = (((uint64_t)a << 32) | b) << GET_ALU_FC; m_r[RC] = r >> 32; } @@ -922,8 +922,8 @@ void am29000_cpu_device::EXTRACT() void am29000_cpu_device::LOAD() { - UINT32 addr = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 r; + uint32_t addr = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t r; if (INST_UA_BIT) fatalerror("Am29000: UA bit set on LOAD\n"); @@ -986,14 +986,14 @@ void am29000_cpu_device::LOADSET() void am29000_cpu_device::LOADM() { - UINT32 addr = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t addr = INST_M_BIT ? I8: GET_RB_VAL; if (INST_UA_BIT) { fatalerror("Am29000: UA bit set on LOAD\n"); } - UINT32 r; + uint32_t r; if (INST_CE_BIT) { logerror("Am29000: Attempting a co-processor LOAD!\n"); @@ -1033,7 +1033,7 @@ void am29000_cpu_device::LOADM() r = RA; - for (INT32 cnt = 0; cnt <= GET_CHC_CR; ++cnt) + for (int32_t cnt = 0; cnt <= GET_CHC_CR; ++cnt) { m_r[r] = m_data->read_dword(addr); @@ -1049,7 +1049,7 @@ void am29000_cpu_device::LOADM() void am29000_cpu_device::STORE() { - UINT32 addr = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t addr = INST_M_BIT ? I8: GET_RB_VAL; if (INST_UA_BIT) { @@ -1102,14 +1102,14 @@ void am29000_cpu_device::STOREL() void am29000_cpu_device::STOREM() { - UINT32 addr = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t addr = INST_M_BIT ? I8: GET_RB_VAL; if (INST_UA_BIT) { fatalerror("Am29000: UA bit set on LOAD\n"); } - UINT32 r; + uint32_t r; if (INST_CE_BIT) { logerror("Am29000: Attempting a co-processor LOAD!\n"); @@ -1146,7 +1146,7 @@ void am29000_cpu_device::STOREM() r = RA; - for (INT32 cnt = 0; cnt <= GET_CHC_CR; ++cnt) + for (int32_t cnt = 0; cnt <= GET_CHC_CR; ++cnt) { m_data->write_dword(addr, m_r[r]); @@ -1161,11 +1161,11 @@ void am29000_cpu_device::STOREM() void am29000_cpu_device::EXBYTE() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 bp = GET_ALU_BP; - UINT8 srcbyte; - UINT32 r; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t bp = GET_ALU_BP; + uint8_t srcbyte; + uint32_t r; if (m_cfg & CFG_BO) srcbyte = a >> 8 * bp; @@ -1179,11 +1179,11 @@ void am29000_cpu_device::EXBYTE() void am29000_cpu_device::EXHW() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 wp = ((m_alu >> ALU_BP_SHIFT) & ALU_BP_MASK) >> 1; - UINT16 srcword; - UINT32 r; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t wp = ((m_alu >> ALU_BP_SHIFT) & ALU_BP_MASK) >> 1; + uint16_t srcword; + uint32_t r; if (m_cfg & CFG_BO) srcword = a >> 16 * wp; @@ -1197,28 +1197,28 @@ void am29000_cpu_device::EXHW() void am29000_cpu_device::EXHWS() { - UINT32 a = GET_RA_VAL; - UINT32 wp = ((m_alu >> ALU_BP_SHIFT) & ALU_BP_MASK) >> 1; - UINT16 srcword; - UINT32 r; + uint32_t a = GET_RA_VAL; + uint32_t wp = ((m_alu >> ALU_BP_SHIFT) & ALU_BP_MASK) >> 1; + uint16_t srcword; + uint32_t r; if (m_cfg & CFG_BO) srcword = a >> 16 * wp; else srcword = a >> (16 * (1 - wp)); - r = (INT32)(INT16)srcword; + r = (int32_t)(int16_t)srcword; m_r[RC] = r; } void am29000_cpu_device::INBYTE() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 bp = GET_ALU_BP; - UINT8 shift = (m_cfg & CFG_BO) ? 8 * bp : (8 * (3 - bp)); - UINT32 r; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t bp = GET_ALU_BP; + uint8_t shift = (m_cfg & CFG_BO) ? 8 * bp : (8 * (3 - bp)); + uint32_t r; r = (a & ~(0xff << shift)) | ((b & 0xff) << shift); @@ -1227,11 +1227,11 @@ void am29000_cpu_device::INBYTE() void am29000_cpu_device::INHW() { - UINT32 a = GET_RA_VAL; - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; - UINT32 wp = ((m_alu >> ALU_BP_SHIFT) & ALU_BP_MASK) >> 1; - UINT32 shift = (m_cfg & CFG_BO) ? 16 * wp : (16 * (1 - wp)); - UINT32 r; + uint32_t a = GET_RA_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t wp = ((m_alu >> ALU_BP_SHIFT) & ALU_BP_MASK) >> 1; + uint32_t shift = (m_cfg & CFG_BO) ? 16 * wp : (16 * (1 - wp)); + uint32_t r; r = (a & ~(0xffff << shift)) | ((b & 0xffff) << shift); @@ -1290,7 +1290,7 @@ void am29000_cpu_device::CONSTN() void am29000_cpu_device::CALL() { - UINT32 ret = m_next_pc; + uint32_t ret = m_next_pc; if (INST_M_BIT) m_next_pc = JMP_ZEX; @@ -1303,7 +1303,7 @@ m_next_pl_flags |= PFLAG_JUMP; void am29000_cpu_device::CALLI() { - UINT32 ret = m_next_pc; + uint32_t ret = m_next_pc; m_next_pc = GET_RB_VAL; m_r[RA] = ret; m_next_pl_flags |= PFLAG_JUMP; @@ -1372,7 +1372,7 @@ void am29000_cpu_device::JMPFI() void am29000_cpu_device::JMPFDEC() { - UINT32 a = GET_RA_VAL; + uint32_t a = GET_RA_VAL; if ((a & BOOLEAN_MASK) == BOOLEAN_FALSE) { @@ -1394,7 +1394,7 @@ void am29000_cpu_device::JMPFDEC() void am29000_cpu_device::CLZ() { - UINT32 b = INST_M_BIT ? I8: GET_RB_VAL; + uint32_t b = INST_M_BIT ? I8: GET_RB_VAL; m_r[RC] = count_leading_zeros(b); } diff --git a/src/devices/cpu/amis2000/amis2000.cpp b/src/devices/cpu/amis2000/amis2000.cpp index 1deb6967864..6409a8b1917 100644 --- a/src/devices/cpu/amis2000/amis2000.cpp +++ b/src/devices/cpu/amis2000/amis2000.cpp @@ -55,15 +55,15 @@ ADDRESS_MAP_END // device definitions -amis2000_cpu_device::amis2000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amis2000_cpu_device::amis2000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : amis2000_base_device(mconfig, AMI_S2000, "AMI S2000", tag, owner, clock, 2, 10, 3, 13, ADDRESS_MAP_NAME(program_1k), 6, ADDRESS_MAP_NAME(data_64x4), "amis2000", __FILE__) { } -amis2150_cpu_device::amis2150_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amis2150_cpu_device::amis2150_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : amis2000_base_device(mconfig, AMI_S2150, "AMI S2150", tag, owner, clock, 3, 11, 3, 13, ADDRESS_MAP_NAME(program_1_5k), 7, ADDRESS_MAP_NAME(data_80x4), "amis2150", __FILE__) { } -amis2152_cpu_device::amis2152_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amis2152_cpu_device::amis2152_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : amis2000_base_device(mconfig, AMI_S2152, "AMI S2152", tag, owner, clock, 3, 11, 3, 13, ADDRESS_MAP_NAME(program_1_5k), 7, ADDRESS_MAP_NAME(data_80x4), "amis2152", __FILE__) { } @@ -89,7 +89,7 @@ void amis2000_base_device::state_string_export(const device_state_entry &entry, } } -offs_t amis2000_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t amis2000_base_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(amis2000); return CPU_DISASSEMBLE_NAME(amis2000)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/amis2000/amis2000.h b/src/devices/cpu/amis2000/amis2000.h index 5beee90fae9..0e46c7d0dd7 100644 --- a/src/devices/cpu/amis2000/amis2000.h +++ b/src/devices/cpu/amis2000/amis2000.h @@ -44,7 +44,7 @@ class amis2000_base_device : public cpu_device { public: // construction/destruction - amis2000_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 bu_bits, UINT8 callstack_bits, UINT8 callstack_depth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + amis2000_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t bu_bits, uint8_t callstack_bits, uint8_t callstack_depth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 8, prgwidth, 0, program) , m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data) @@ -67,7 +67,7 @@ public: template static devcb_base &set_write_d_callback(device_t &device, _Object object) { return downcast(device).m_write_d.set_callback(object); } template static devcb_base &set_write_a_callback(device_t &device, _Object object) { return downcast(device).m_write_a.set_callback(object); } template static devcb_base &set_write_f_callback(device_t &device, _Object object) { return downcast(device).m_write_f.set_callback(object); } - static void set_7seg_table(device_t &device, const UINT8 *ptr) { downcast(device).m_7seg_table = ptr; } + static void set_7seg_table(device_t &device, const uint8_t *ptr) { downcast(device).m_7seg_table = ptr; } protected: // device-level overrides @@ -75,20 +75,20 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } // " - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } // " + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 1; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 1; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; address_space_config m_program_config; @@ -96,33 +96,33 @@ protected: address_space *m_program; address_space *m_data; - UINT8 m_bu_bits; - UINT16 m_bu_mask; - UINT8 m_callstack_bits; // number of program counter bits held in callstack - UINT16 m_callstack_mask; - UINT8 m_callstack_depth; // callstack levels: 3 on 2000/2150, 5 on 2200/2400 - UINT16 m_callstack[5]; // max 5 + uint8_t m_bu_bits; + uint16_t m_bu_mask; + uint8_t m_callstack_bits; // number of program counter bits held in callstack + uint16_t m_callstack_mask; + uint8_t m_callstack_depth; // callstack levels: 3 on 2000/2150, 5 on 2200/2400 + uint16_t m_callstack[5]; // max 5 int m_icount; - UINT16 m_pc; // 13-bit program counter - UINT8 m_ppr; // prepared page register (PP 1) - UINT8 m_pbr; // prepared bank register (PP 2) + uint16_t m_pc; // 13-bit program counter + uint8_t m_ppr; // prepared page register (PP 1) + uint8_t m_pbr; // prepared bank register (PP 2) bool m_skip; // skip next opcode, including PP prefixes - UINT8 m_op; - UINT8 m_prev_op; // previous opcode, needed for PP, LAI, LB* - UINT8 m_f; // generic flags: 2 on 2000/2150, 6 on 2200/2400 - UINT8 m_carry; // carry flag - UINT8 m_bl; // 4-bit ram index x - UINT8 m_bu; // 2/3-bit ram index y - UINT8 m_acc; // 4-bit accumulator - UINT8 m_e; // 4-bit generic register - UINT8 m_ki_mask; // 4-bit k/i-pins select latch - UINT8 m_d; // 8-bit d-pins latch + uint8_t m_op; + uint8_t m_prev_op; // previous opcode, needed for PP, LAI, LB* + uint8_t m_f; // generic flags: 2 on 2000/2150, 6 on 2200/2400 + uint8_t m_carry; // carry flag + uint8_t m_bl; // 4-bit ram index x + uint8_t m_bu; // 2/3-bit ram index y + uint8_t m_acc; // 4-bit accumulator + uint8_t m_e; // 4-bit generic register + uint8_t m_ki_mask; // 4-bit k/i-pins select latch + uint8_t m_d; // 8-bit d-pins latch bool m_d_active; // d-pins available for direct i/o(floating), or outputting d-latch - UINT8 m_d_polarity; // invert d-latch output - UINT16 m_a; // 13-bit a-pins latch (master strobe latch) + uint8_t m_d_polarity; // invert d-latch output + uint16_t m_a; // 13-bit a-pins latch (master strobe latch) // i/o handlers - const UINT8 *m_7seg_table; + const uint8_t *m_7seg_table; devcb_read8 m_read_k; devcb_read8 m_read_i; devcb_read8 m_read_d; @@ -131,8 +131,8 @@ protected: devcb_write_line m_write_f; // misc internal helpers - UINT8 ram_r(); - void ram_w(UINT8 data); + uint8_t ram_r(); + void ram_w(uint8_t data); void pop_callstack(); void push_callstack(); void d_latch_out(bool active); @@ -201,21 +201,21 @@ protected: class amis2000_cpu_device : public amis2000_base_device { public: - amis2000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amis2000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class amis2150_cpu_device : public amis2000_base_device { public: - amis2150_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amis2150_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class amis2152_cpu_device : public amis2000_base_device { public: - amis2152_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amis2152_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -223,7 +223,7 @@ protected: virtual void device_reset() override; // digital-to-frequency converter - UINT8 m_d2f_latch; + uint8_t m_d2f_latch; emu_timer *m_d2f_timer; int m_fout_state; diff --git a/src/devices/cpu/amis2000/amis2000d.cpp b/src/devices/cpu/amis2000/amis2000d.cpp index 27077170402..f820fcec79a 100644 --- a/src/devices/cpu/amis2000/amis2000d.cpp +++ b/src/devices/cpu/amis2000/amis2000d.cpp @@ -32,7 +32,7 @@ static const char *const s_mnemonics[] = }; // number of bits per opcode parameter, negative indicates complement -static const INT8 s_bits[] = +static const int8_t s_bits[] = { 0, 0, 4, 2, 2, 2, 2, 0, 0, 0, -2, -2, -2, -2, 2, 2, @@ -45,7 +45,7 @@ static const INT8 s_bits[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 s_flags[] = +static const uint32_t s_flags[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -56,7 +56,7 @@ static const UINT32 s_flags[] = }; -static const UINT8 s2000_mnemonic[0x100] = +static const uint8_t s2000_mnemonic[0x100] = { /* 0x00 */ mNOP, mHALT, mRT, mRTS, mPSH, mPSL, mAND, mSOS, @@ -103,8 +103,8 @@ static const UINT8 s2000_mnemonic[0x100] = CPU_DISASSEMBLE( amis2000 ) { int pos = 0; - UINT8 op = oprom[pos++]; - UINT8 instr = s2000_mnemonic[op]; + uint8_t op = oprom[pos++]; + uint8_t instr = s2000_mnemonic[op]; char *dst = buffer; dst += sprintf(dst, "%-5s ", s_mnemonics[instr]); @@ -118,7 +118,7 @@ CPU_DISASSEMBLE( amis2000 ) if (mask != 0) { - UINT8 param = op; + uint8_t param = op; if (complement) param = ~param; param &= mask; diff --git a/src/devices/cpu/amis2000/amis2000op.cpp b/src/devices/cpu/amis2000/amis2000op.cpp index 3a172590bf3..2962f5327cc 100644 --- a/src/devices/cpu/amis2000/amis2000op.cpp +++ b/src/devices/cpu/amis2000/amis2000op.cpp @@ -8,15 +8,15 @@ // internal helpers -inline UINT8 amis2000_base_device::ram_r() +inline uint8_t amis2000_base_device::ram_r() { - UINT16 address = m_bu << 4 | m_bl; + uint16_t address = m_bu << 4 | m_bl; return m_data->read_byte(address) & 0xf; } -inline void amis2000_base_device::ram_w(UINT8 data) +inline void amis2000_base_device::ram_w(uint8_t data) { - UINT16 address = m_bu << 4 | m_bl; + uint16_t address = m_bu << 4 | m_bl; m_data->write_byte(address, data & 0xf); } @@ -49,7 +49,7 @@ void amis2000_base_device::op_lai() // note: only execute the first one in a sequence of LAI if ((m_prev_op & 0xf0) != (m_op & 0xf0)) { - UINT8 param = m_op & 0x0f; + uint8_t param = m_op & 0x0f; m_acc = param; m_ki_mask = param; } @@ -70,7 +70,7 @@ void amis2000_base_device::op_lae() void amis2000_base_device::op_xab() { // XAB: exchange ACC with BL - UINT8 old_acc = m_acc; + uint8_t old_acc = m_acc; m_acc = m_bl; m_bl = old_acc; } @@ -78,7 +78,7 @@ void amis2000_base_device::op_xab() void amis2000_base_device::op_xabu() { // XABU: exchange ACC with BU - UINT8 old_acc = m_acc; + uint8_t old_acc = m_acc; m_acc = (m_acc & ~m_bu_mask) | (m_bu & m_bu_mask); m_bu = old_acc & m_bu_mask; } @@ -86,7 +86,7 @@ void amis2000_base_device::op_xabu() void amis2000_base_device::op_xae() { // XAE: exchange ACC with E - UINT8 old_acc = m_acc; + uint8_t old_acc = m_acc; m_acc = m_e; m_e = old_acc; } @@ -97,7 +97,7 @@ void amis2000_base_device::op_lbe() // note: only execute the first one in a sequence of LB* if ((m_prev_op & 0xf0) != (m_op & 0xf0)) { - UINT8 param = m_op & 0x03; + uint8_t param = m_op & 0x03; m_bu = param & m_bu_mask; m_bl = m_e; } @@ -109,7 +109,7 @@ void amis2000_base_device::op_lbep() // note: only execute the first one in a sequence of LB* if ((m_prev_op & 0xf0) != (m_op & 0xf0)) { - UINT8 param = m_op & 0x03; + uint8_t param = m_op & 0x03; m_bu = param & m_bu_mask; m_bl = (m_e + 1) & 0xf; } @@ -121,7 +121,7 @@ void amis2000_base_device::op_lbz() // note: only execute the first one in a sequence of LB* if ((m_prev_op & 0xf0) != (m_op & 0xf0)) { - UINT8 param = m_op & 0x03; + uint8_t param = m_op & 0x03; m_bu = param & m_bu_mask; m_bl = 0; } @@ -133,7 +133,7 @@ void amis2000_base_device::op_lbf() // note: only execute the first one in a sequence of LB* if ((m_prev_op & 0xf0) != (m_op & 0xf0)) { - UINT8 param = m_op & 0x03; + uint8_t param = m_op & 0x03; m_bu = param & m_bu_mask; m_bl = 0xf; } @@ -146,17 +146,17 @@ void amis2000_base_device::op_lam() { // LAM _Y: load ACC with RAM, xor BU with _Y m_acc = ram_r(); - UINT8 param = ~m_op & 0x03; + uint8_t param = ~m_op & 0x03; m_bu ^= (param & m_bu_mask); } void amis2000_base_device::op_xc() { // XC _Y: exchange ACC with RAM, xor BU with _Y - UINT8 old_acc = m_acc; + uint8_t old_acc = m_acc; m_acc = ram_r(); ram_w(old_acc); - UINT8 param = ~m_op & 0x03; + uint8_t param = ~m_op & 0x03; m_bu ^= (param & m_bu_mask); } @@ -179,14 +179,14 @@ void amis2000_base_device::op_xcd() void amis2000_base_device::op_stm() { // STM Z: set RAM bit Z - UINT8 param = 1 << (m_op & 0x03); + uint8_t param = 1 << (m_op & 0x03); ram_w(ram_r() | param); } void amis2000_base_device::op_rsm() { // RSM Z: reset RAM bit Z - UINT8 param = 1 << (m_op & 0x03); + uint8_t param = 1 << (m_op & 0x03); ram_w(ram_r() & ~param); } @@ -196,7 +196,7 @@ void amis2000_base_device::op_rsm() void amis2000_base_device::op_inp() { // INP: input D-pins to ACC and RAM - UINT8 in = m_d_active ? m_d : m_read_d(0, 0xff); + uint8_t in = m_d_active ? m_d : m_read_d(0, 0xff); m_acc = in & 0xf; ram_w(in >> 4 & 0xf); } @@ -217,12 +217,12 @@ void amis2000_base_device::op_disb() void amis2000_base_device::op_disn() { // DISN: set D-latch to ACC+carry via on-die segment decoder - static const UINT8 lut_segment_decoder[0x10] = + static const uint8_t lut_segment_decoder[0x10] = { // 0-F digits in bit order [DP]abcdefg 0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x5f, 0x70, 0x7f, 0x7b, 0x77, 0x1f, 0x4e, 0x3d, 0x4f, 0x47 }; - const UINT8 *ptr = (m_7seg_table != nullptr) ? m_7seg_table : lut_segment_decoder; + const uint8_t *ptr = (m_7seg_table != nullptr) ? m_7seg_table : lut_segment_decoder; m_d = ptr[m_acc] | (m_carry ? 0x80 : 0x00); d_latch_out(true); } @@ -301,7 +301,7 @@ void amis2000_base_device::op_eur() void amis2000_base_device::op_pp() { // PP _X: prepare page/bank with _X - UINT8 param = ~m_op & 0x0f; + uint8_t param = ~m_op & 0x0f; if ((m_prev_op & 0xf0) != (m_op & 0xf0)) m_ppr = param; else @@ -311,8 +311,8 @@ void amis2000_base_device::op_pp() void amis2000_base_device::op_jmp() { // JMP X: jump to X(+PP) - UINT16 mask = 0x3f; - UINT16 param = m_op & mask; + uint16_t mask = 0x3f; + uint16_t param = m_op & mask; // if previous opcode was PP, change PC high bits too if ((m_prev_op & 0xf0) == 0x60) @@ -371,7 +371,7 @@ void amis2000_base_device::op_szc() void amis2000_base_device::op_szm() { // SZM Z: skip next on zero RAM bit Z - UINT8 param = 1 << (m_op & 0x03); + uint8_t param = 1 << (m_op & 0x03); m_skip = !(ram_r() & param); } @@ -432,7 +432,7 @@ void amis2000_base_device::op_adcs() void amis2000_base_device::op_adis() { // ADIS X: add X to ACC, skip next on not carry - UINT8 param = m_op & 0x0f; + uint8_t param = m_op & 0x0f; m_acc += param; m_skip = !(m_acc & 0x10); m_acc &= 0xf; diff --git a/src/devices/cpu/apexc/apexc.cpp b/src/devices/cpu/apexc/apexc.cpp index 5d367d33667..3b490b2339d 100644 --- a/src/devices/cpu/apexc/apexc.cpp +++ b/src/devices/cpu/apexc/apexc.cpp @@ -337,7 +337,7 @@ const device_type APEXC = &device_creator; #define DELAY(n) {m_icount -= (n); m_current_word = (m_current_word + (n)) & 0x1f;} -apexc_cpu_device::apexc_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apexc_cpu_device::apexc_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, APEXC, "APEXC", tag, owner, clock, "apexc_cpu", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 32, 15, 0) , m_io_config("io", ENDIANNESS_BIG, 8, 1, 0) @@ -369,7 +369,7 @@ apexc_cpu_device::apexc_cpu_device(const machine_config &mconfig, const char *ta /* compute complete word address (i.e. translate a logical track address (expressed in current working store) to an absolute track address) */ -UINT32 apexc_cpu_device::effective_address(UINT32 address) +uint32_t apexc_cpu_device::effective_address(uint32_t address) { if (address & 0x200) { @@ -380,9 +380,9 @@ UINT32 apexc_cpu_device::effective_address(UINT32 address) } /* read word */ -UINT32 apexc_cpu_device::word_read(UINT32 address, UINT32 special) +uint32_t apexc_cpu_device::word_read(uint32_t address, uint32_t special) { - UINT32 result; + uint32_t result; /* compute absolute track address */ address = effective_address(address); @@ -408,7 +408,7 @@ UINT32 apexc_cpu_device::word_read(UINT32 address, UINT32 special) } /* write word (or part of a word, according to mask) */ -void apexc_cpu_device::word_write(UINT32 address, UINT32 data, UINT32 mask) +void apexc_cpu_device::word_write(uint32_t address, uint32_t data, uint32_t mask) { /* compute absolute track address */ address = effective_address(address); @@ -430,12 +430,12 @@ void apexc_cpu_device::word_write(UINT32 address, UINT32 data, UINT32 mask) no address is used, these functions just punch or read 5 bits */ -UINT8 apexc_cpu_device::papertape_read() +uint8_t apexc_cpu_device::papertape_read() { return m_io->read_byte(0) & 0x1f; } -void apexc_cpu_device::papertape_punch(UINT8 data) +void apexc_cpu_device::papertape_punch(uint8_t data) { m_io->write_byte(0, data); } @@ -447,7 +447,7 @@ void apexc_cpu_device::papertape_punch(UINT8 data) /* set the memory location (i.e. address) register, and compute the associated delay */ -UINT32 apexc_cpu_device::load_ml(UINT32 address, UINT32 vector) +uint32_t apexc_cpu_device::load_ml(uint32_t address, uint32_t vector) { int delay; @@ -599,7 +599,7 @@ void apexc_cpu_device::execute() m_r >>= 1; if (m_a & 1) m_r |= 0x80000000UL; - m_a = ((INT32) m_a) >> 1; + m_a = ((int32_t) m_a) >> 1; c6 = (c6+1) & 0x3f; } @@ -648,7 +648,7 @@ void apexc_cpu_device::execute() m_r >>= 1; if (m_a & 1) m_r |= 0x80000000UL; - m_a = ((INT32) m_a) >> 1; + m_a = ((int32_t) m_a) >> 1; } } @@ -687,7 +687,7 @@ void apexc_cpu_device::execute() /* R_(1-n)(x) & R_(n-32)(x) */ { - UINT32 mask; + uint32_t mask; if (c6 & 0x20) mask = 0xFFFFFFFFUL << (64 - c6); @@ -706,7 +706,7 @@ void apexc_cpu_device::execute() /* A_(1-n)(x) & A_(n-32)(x) */ { - UINT32 mask; + uint32_t mask; if (c6 & 0x20) mask = 0xFFFFFFFFUL << (64 - c6); @@ -860,7 +860,7 @@ void apexc_cpu_device::execute_run() } -offs_t apexc_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t apexc_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( apexc ); return CPU_DISASSEMBLE_NAME(apexc)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/apexc/apexc.h b/src/devices/cpu/apexc/apexc.h index e5634c3dcb1..9f84e6f073e 100644 --- a/src/devices/cpu/apexc/apexc.h +++ b/src/devices/cpu/apexc/apexc.h @@ -25,7 +25,7 @@ class apexc_cpu_device : public cpu_device { public: // construction/destruction - apexc_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apexc_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -33,9 +33,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 2; } - virtual UINT32 execute_max_cycles() const override { return 75; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 2; } + virtual uint32_t execute_max_cycles() const override { return 75; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -47,44 +47,44 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - inline UINT32 apexc_readmem(UINT32 address) { return m_program->read_dword((address)<<2); } - inline void apexc_writemem(UINT32 address, UINT32 data) { m_program->write_dword((address)<<2, (data)); } - inline void apexc_writemem_masked(UINT32 address, UINT32 data, UINT32 mask) { apexc_writemem((address), (apexc_readmem(address) & ~(mask)) | ((data) & (mask))); } + inline uint32_t apexc_readmem(uint32_t address) { return m_program->read_dword((address)<<2); } + inline void apexc_writemem(uint32_t address, uint32_t data) { m_program->write_dword((address)<<2, (data)); } + inline void apexc_writemem_masked(uint32_t address, uint32_t data, uint32_t mask) { apexc_writemem((address), (apexc_readmem(address) & ~(mask)) | ((data) & (mask))); } - UINT32 effective_address(UINT32 address); - UINT32 word_read(UINT32 address, UINT32 special); - void word_write(UINT32 address, UINT32 data, UINT32 mask); - UINT8 papertape_read(); - void papertape_punch(UINT8 data); + uint32_t effective_address(uint32_t address); + uint32_t word_read(uint32_t address, uint32_t special); + void word_write(uint32_t address, uint32_t data, uint32_t mask); + uint8_t papertape_read(); + void papertape_punch(uint8_t data); - UINT32 load_ml(UINT32 address, UINT32 vector); + uint32_t load_ml(uint32_t address, uint32_t vector); void execute(); address_space_config m_program_config; address_space_config m_io_config; - UINT32 m_a; /* accumulator */ - UINT32 m_r; /* register */ - UINT32 m_cr; /* control register (i.e. instruction register) */ + uint32_t m_a; /* accumulator */ + uint32_t m_r; /* register */ + uint32_t m_cr; /* control register (i.e. instruction register) */ int m_ml; /* memory location (current track in working store, and requested word position within track) (10 bits) */ int m_working_store; /* current working store (group of 16 tracks) (1-15) */ int m_current_word; /* current word position within track (0-31) */ int m_running; /* 1 flag: */ /* running: flag implied by the existence of the stop instruction */ - UINT32 m_pc; /* address of next instruction for the disassembler */ + uint32_t m_pc; /* address of next instruction for the disassembler */ address_space *m_program; address_space *m_io; int m_icount; // For state - UINT32 m_ml_full; - UINT32 m_genpc; + uint32_t m_ml_full; + uint32_t m_genpc; }; diff --git a/src/devices/cpu/apexc/apexcdsm.cpp b/src/devices/cpu/apexc/apexcdsm.cpp index 81effc58b0e..a5d5cfbf754 100644 --- a/src/devices/cpu/apexc/apexcdsm.cpp +++ b/src/devices/cpu/apexc/apexcdsm.cpp @@ -85,7 +85,7 @@ static const instr_desc instructions[16] = CPU_DISASSEMBLE( apexc ) { - UINT32 instruction; /* 32-bit machine instruction */ + uint32_t instruction; /* 32-bit machine instruction */ int x, y, function, c6, vector; /* instruction fields */ int n; /* 'friendly', instruction-dependant interpretation of C6 */ const instr_desc *the_desc; /* pointer to the relevant entry in the instructions array */ diff --git a/src/devices/cpu/arc/arc.cpp b/src/devices/cpu/arc/arc.cpp index b0672f03bfe..03fddcb14e5 100644 --- a/src/devices/cpu/arc/arc.cpp +++ b/src/devices/cpu/arc/arc.cpp @@ -17,7 +17,7 @@ const device_type ARC = &device_creator; -arc_device::arc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arc_device::arc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ARC, "ARCtangent A4", tag, owner, clock, "arc", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 32, 24, 0), m_pc(0), m_program(nullptr), m_icount(0), m_debugger_temp(0) // some docs describe these as 'middle endian'?! @@ -25,7 +25,7 @@ arc_device::arc_device(const machine_config &mconfig, const char *tag, device_t } -offs_t arc_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t arc_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( arc ); return CPU_DISASSEMBLE_NAME(arc)(this, buffer, pc, oprom, opram, options); @@ -36,19 +36,19 @@ offs_t arc_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opro /*****************************************************************************/ -void arc_device::unimplemented_opcode(UINT16 op) +void arc_device::unimplemented_opcode(uint16_t op) { fatalerror("arc: unknown opcode %04x at %04x\n", op, m_pc << 2); } /*****************************************************************************/ -UINT32 arc_device::READ32(UINT32 address) +uint32_t arc_device::READ32(uint32_t address) { return m_program->read_dword(address << 2); } -void arc_device::WRITE32(UINT32 address, UINT32 data) +void arc_device::WRITE32(uint32_t address, uint32_t data) { m_program->write_dword(address << 2, data); } @@ -109,14 +109,14 @@ void arc_device::execute_set_input(int irqline, int state) void arc_device::execute_run() { - //UINT32 lres; + //uint32_t lres; //lres = 0; while (m_icount > 0) { debugger_instruction_hook(this, m_pc<<2); - //UINT32 op = READ32(m_pc); + //uint32_t op = READ32(m_pc); m_pc++; diff --git a/src/devices/cpu/arc/arc.h b/src/devices/cpu/arc/arc.h index 5b9302cc99f..6421b2eb94d 100644 --- a/src/devices/cpu/arc/arc.h +++ b/src/devices/cpu/arc/arc.h @@ -16,7 +16,7 @@ class arc_device : public cpu_device { public: // construction/destruction - arc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -24,9 +24,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 5; } - virtual UINT32 execute_max_cycles() const override { return 5; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 5; } + virtual uint32_t execute_max_cycles() const override { return 5; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -38,9 +38,9 @@ protected: virtual void state_export(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -54,18 +54,18 @@ private: // 61 = Short Immediate Data Indicator Settings Flag // 62 = Long Immediate Data Indicator // 63 = Short Immediate Data Indicator NOT Settings Flag - UINT32 m_pc; - //UINT32 m_r[64]; + uint32_t m_pc; + //uint32_t m_r[64]; address_space *m_program; int m_icount; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; - void unimplemented_opcode(UINT16 op); - inline UINT32 READ32(UINT32 address); - inline void WRITE32(UINT32 address, UINT32 data); + void unimplemented_opcode(uint16_t op); + inline uint32_t READ32(uint32_t address); + inline void WRITE32(uint32_t address, uint32_t data); }; diff --git a/src/devices/cpu/arc/arcdasm.cpp b/src/devices/cpu/arc/arcdasm.cpp index 1b7897069de..872f821d560 100644 --- a/src/devices/cpu/arc/arcdasm.cpp +++ b/src/devices/cpu/arc/arcdasm.cpp @@ -193,12 +193,12 @@ static const char *regnames[0x40] = CPU_DISASSEMBLE(arc) { - UINT32 op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); + uint32_t op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); op = big_endianize_int32(op); output = buffer; - UINT8 opcode = ARC_OPERATION; + uint8_t opcode = ARC_OPERATION; switch (opcode) { diff --git a/src/devices/cpu/arcompact/arcompact.cpp b/src/devices/cpu/arcompact/arcompact.cpp index 7c290e1adad..8f44ea45b52 100644 --- a/src/devices/cpu/arcompact/arcompact.cpp +++ b/src/devices/cpu/arcompact/arcompact.cpp @@ -50,7 +50,7 @@ ADDRESS_MAP_END //#define AUX_SPACE_ADDRESS_WIDTH 34 // IO space is 32 bits of dwords, so 34-bits #define AUX_SPACE_ADDRESS_WIDTH 64 // but the MAME core requires us to use power of 2 values for >32 -arcompact_device::arcompact_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arcompact_device::arcompact_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ARCA5, "ARCtangent-A5", tag, owner, clock, "arca5", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0) // some docs describe these as 'middle endian'?! , m_io_config( "io", ENDIANNESS_LITTLE, 32, AUX_SPACE_ADDRESS_WIDTH, 0, ADDRESS_MAP_NAME( arcompact_auxreg_map ) ) @@ -58,7 +58,7 @@ arcompact_device::arcompact_device(const machine_config &mconfig, const char *ta } -offs_t arcompact_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t arcompact_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( arcompact ); return CPU_DISASSEMBLE_NAME(arcompact)(this, buffer, pc, oprom, opram, options); @@ -69,7 +69,7 @@ offs_t arcompact_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 /*****************************************************************************/ -void arcompact_device::unimplemented_opcode(UINT16 op) +void arcompact_device::unimplemented_opcode(uint16_t op) { fatalerror("ARCOMPACT: unknown opcode %04x at %04x\n", op, m_pc << 2); } diff --git a/src/devices/cpu/arcompact/arcompact.h b/src/devices/cpu/arcompact/arcompact.h index a6d10528040..fed808b0cc8 100644 --- a/src/devices/cpu/arcompact/arcompact.h +++ b/src/devices/cpu/arcompact/arcompact.h @@ -11,9 +11,9 @@ #ifndef __ARCOMPACT_H__ #define __ARCOMPACT_H__ -#define ARCOMPACT_RETTYPE UINT32 -#define OPS_32 UINT32 op -#define OPS_16 UINT16 op +#define ARCOMPACT_RETTYPE uint32_t +#define OPS_32 uint32_t op +#define OPS_16 uint16_t op #define PARAMS op #define LIMM_REG 62 #define ARCOMPACT_OPERATION ((op & 0xf800) >> 11) @@ -61,7 +61,7 @@ class arcompact_device : public cpu_device { public: // construction/destruction - arcompact_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arcompact_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ32_MEMBER( arcompact_auxreg002_LPSTART_r); DECLARE_WRITE32_MEMBER(arcompact_auxreg002_LPSTART_w); @@ -79,9 +79,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 5; } - virtual UINT32 execute_max_cycles() const override { return 5; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 5; } + virtual uint32_t execute_max_cycles() const override { return 5; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -93,9 +93,9 @@ protected: virtual void state_export(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; @@ -774,8 +774,8 @@ protected: ARCOMPACT_RETTYPE arcompact_handle1e_03_0x_helper(OPS_16, const char* optext); - UINT32 handle_jump_to_addr(int delay, int link, UINT32 address, UINT32 next_addr); - UINT32 handle_jump_to_register(int delay, int link, UINT32 reg, UINT32 next_addr, int flag); + uint32_t handle_jump_to_addr(int delay, int link, uint32_t address, uint32_t next_addr); + uint32_t handle_jump_to_register(int delay, int link, uint32_t reg, uint32_t next_addr, int flag); ARCOMPACT_RETTYPE get_insruction(OPS_32); @@ -813,43 +813,43 @@ private: const address_space_config m_program_config; const address_space_config m_io_config; - UINT32 m_pc; + uint32_t m_pc; address_space *m_program; address_space *m_io; int m_icount; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; - void unimplemented_opcode(UINT16 op); + void unimplemented_opcode(uint16_t op); - inline UINT32 READ32(UINT32 address) { return m_program->read_dword(address << 2); } - inline void WRITE32(UINT32 address, UINT32 data) { m_program->write_dword(address << 2, data); } - inline UINT16 READ16(UINT32 address) { return m_program->read_word(address << 1); } - inline void WRITE16(UINT32 address, UINT16 data){ m_program->write_word(address << 1, data); } - inline UINT8 READ8(UINT32 address) { return m_program->read_byte(address << 0); } - inline void WRITE8(UINT32 address, UINT8 data){ m_program->write_byte(address << 0, data); } + inline uint32_t READ32(uint32_t address) { return m_program->read_dword(address << 2); } + inline void WRITE32(uint32_t address, uint32_t data) { m_program->write_dword(address << 2, data); } + inline uint16_t READ16(uint32_t address) { return m_program->read_word(address << 1); } + inline void WRITE16(uint32_t address, uint16_t data){ m_program->write_word(address << 1, data); } + inline uint8_t READ8(uint32_t address) { return m_program->read_byte(address << 0); } + inline void WRITE8(uint32_t address, uint8_t data){ m_program->write_byte(address << 0, data); } - inline UINT64 READAUX(UINT64 address) { return m_io->read_dword(address *4); } - inline void WRITEAUX(UINT64 address, UINT32 data) { m_io->write_dword(address *4, data); } + inline uint64_t READAUX(uint64_t address) { return m_io->read_dword(address *4); } + inline void WRITEAUX(uint64_t address, uint32_t data) { m_io->write_dword(address *4, data); } - int check_condition(UINT8 condition); + int check_condition(uint8_t condition); - UINT32 m_regs[0x40]; + uint32_t m_regs[0x40]; int m_delayactive; int m_delaylinks; - UINT32 m_delayjump; + uint32_t m_delayjump; // f e d c| b a 9 8| 7 6 5 4| 3 2 1 0 // - - - L| Z N C V| U DE AE A2|A1 E2 E1 H - UINT32 m_status32; + uint32_t m_status32; - UINT32 m_LP_START; - UINT32 m_LP_END; - UINT32 m_INTVECTORBASE; + uint32_t m_LP_START; + uint32_t m_LP_END; + uint32_t m_INTVECTORBASE; }; diff --git a/src/devices/cpu/arcompact/arcompact_execute.cpp b/src/devices/cpu/arcompact/arcompact_execute.cpp index d145a698fc8..53d3ce742cb 100644 --- a/src/devices/cpu/arcompact/arcompact_execute.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute.cpp @@ -14,7 +14,7 @@ void arcompact_device::execute_run() { - //UINT32 lres; + //uint32_t lres; //lres = 0; while (m_icount > 0) @@ -25,7 +25,7 @@ void arcompact_device::execute_run() if (m_delayactive) { - UINT16 op = READ16((m_pc + 0) >> 1); + uint16_t op = READ16((m_pc + 0) >> 1); m_pc = get_insruction(op); if (m_delaylinks) m_regs[REG_BLINK] = m_pc; @@ -34,7 +34,7 @@ void arcompact_device::execute_run() } else { - UINT16 op = READ16((m_pc + 0) >> 1); + uint16_t op = READ16((m_pc + 0) >> 1); m_pc = get_insruction(op); } @@ -56,7 +56,7 @@ void arcompact_device::execute_run() #define GET_01_01_01_BRANCH_ADDR \ - INT32 address = (op & 0x00fe0000) >> 17; \ + int32_t address = (op & 0x00fe0000) >> 17; \ address |= ((op & 0x00008000) >> 15) << 7; \ if (address & 0x80) address = -0x80 + (address & 0x7f); @@ -83,10 +83,10 @@ void arcompact_device::execute_run() #define COMMON32_GET_s12 \ int S_temp = (op & 0x0000003f) >> 0; \ int s_temp = (op & 0x00000fc0) >> 6; \ - INT32 S = s_temp | (S_temp<<6); \ + int32_t S = s_temp | (S_temp<<6); \ if (S & 0x800) S = -0x800 + (S&0x7ff); /* sign extend */ #define COMMON32_GET_CONDITION \ - UINT8 condition = op & 0x0000001f; + uint8_t condition = op & 0x0000001f; #define COMMON16_GET_breg \ @@ -121,7 +121,7 @@ void arcompact_device::execute_run() #define PC_ALIGNED32 \ (m_pc&0xfffffffc) -int arcompact_device::check_condition(UINT8 condition) +int arcompact_device::check_condition(uint8_t condition) { switch (condition & 0x1f) { @@ -166,7 +166,7 @@ int arcompact_device::check_condition(UINT8 condition) ARCOMPACT_RETTYPE arcompact_device::get_insruction(OPS_32) { - UINT8 instruction = ARCOMPACT_OPERATION; + uint8_t instruction = ARCOMPACT_OPERATION; if (instruction < 0x0c) { @@ -221,7 +221,7 @@ ARCOMPACT_RETTYPE arcompact_device::get_insruction(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle00(OPS_32) { - UINT8 subinstr = (op & 0x00010000) >> 16; + uint8_t subinstr = (op & 0x00010000) >> 16; switch (subinstr) { @@ -234,7 +234,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle00(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01(OPS_32) { - UINT8 subinstr = (op & 0x00010000) >> 16; + uint8_t subinstr = (op & 0x00010000) >> 16; switch (subinstr) { @@ -247,7 +247,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_00(OPS_32) { - UINT8 subinstr2 = (op & 0x00020000) >> 17; + uint8_t subinstr2 = (op & 0x00020000) >> 17; switch (subinstr2) { @@ -260,7 +260,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_00(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01(OPS_32) { - UINT8 subinstr2 = (op & 0x00000010) >> 4; + uint8_t subinstr2 = (op & 0x00000010) >> 4; switch (subinstr2) { @@ -273,7 +273,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_00(OPS_32) { - UINT8 subinstr3 = (op & 0x0000000f) >> 0; + uint8_t subinstr3 = (op & 0x0000000f) >> 0; switch (subinstr3) { @@ -300,7 +300,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_00(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01(OPS_32) // Branch on Compare/Bit Test Register-Immediate { - UINT8 subinstr3 = (op & 0x0000000f) >> 0; + uint8_t subinstr3 = (op & 0x0000000f) >> 0; switch (subinstr3) { @@ -327,7 +327,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01(OPS_32) // Branch ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04(OPS_32) { - UINT8 subinstr = (op & 0x003f0000) >> 16; + uint8_t subinstr = (op & 0x003f0000) >> 16; switch (subinstr) { @@ -402,7 +402,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f(OPS_32) { - UINT8 subinstr2 = (op & 0x0000003f) >> 0; + uint8_t subinstr2 = (op & 0x0000003f) >> 0; switch (subinstr2) { @@ -478,7 +478,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_2f(OPS_32) { - UINT8 subinstr2 = (op & 0x0000003f) >> 0; + uint8_t subinstr2 = (op & 0x0000003f) >> 0; switch (subinstr2) { @@ -553,7 +553,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_2f(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_3f(OPS_32) { - UINT8 subinstr3 = (op & 0x07000000) >> 24; + uint8_t subinstr3 = (op & 0x07000000) >> 24; subinstr3 |= ((op & 0x00007000) >> 12) << 3; switch (subinstr3) @@ -630,7 +630,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_3f(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_2f_3f(OPS_32) // useless ZOP group, no actual opcodes { - UINT8 subinstr3 = (op & 0x07000000) >> 24; + uint8_t subinstr3 = (op & 0x07000000) >> 24; subinstr3 |= ((op & 0x00007000) >> 12) << 3; switch (subinstr3) @@ -708,7 +708,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_2f_3f(OPS_32) // useless // this is an Extension ALU group, maybe optional on some CPUs? ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05(OPS_32) { - UINT8 subinstr = (op & 0x003f0000) >> 16; + uint8_t subinstr = (op & 0x003f0000) >> 16; switch (subinstr) { @@ -783,7 +783,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0c(OPS_16) { - UINT8 subinstr = (op & 0x0018) >> 3; + uint8_t subinstr = (op & 0x0018) >> 3; switch (subinstr) { @@ -798,7 +798,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0c(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d(OPS_16) { - UINT8 subinstr = (op & 0x0018) >> 3; + uint8_t subinstr = (op & 0x0018) >> 3; switch (subinstr) { @@ -813,7 +813,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0e(OPS_16) { - UINT8 subinstr = (op & 0x0018) >> 3; + uint8_t subinstr = (op & 0x0018) >> 3; switch (subinstr) { @@ -828,7 +828,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0e(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f(OPS_16) { - UINT8 subinstr = (op & 0x01f) >> 0; + uint8_t subinstr = (op & 0x01f) >> 0; switch (subinstr) { @@ -872,7 +872,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00(OPS_16) { - UINT8 subinstr = (op & 0x00e0) >> 5; + uint8_t subinstr = (op & 0x00e0) >> 5; switch (subinstr) { @@ -892,7 +892,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07(OPS_16) { - UINT8 subinstr3 = (op & 0x0700) >> 8; + uint8_t subinstr3 = (op & 0x0700) >> 8; switch (subinstr3) { @@ -912,7 +912,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_00_07(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17(OPS_16) { - UINT8 subinstr = (op & 0x00e0) >> 5; + uint8_t subinstr = (op & 0x00e0) >> 5; switch (subinstr) { @@ -931,7 +931,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18(OPS_16) { - UINT8 subinstr = (op & 0x00e0) >> 5; + uint8_t subinstr = (op & 0x00e0) >> 5; switch (subinstr) { @@ -950,7 +950,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_05(OPS_16) { - UINT8 subinstr2 = (op & 0x0700) >> 8; + uint8_t subinstr2 = (op & 0x0700) >> 8; switch (subinstr2) { @@ -969,7 +969,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_05(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_06(OPS_16) { - UINT8 subinstr2 = (op & 0x001f) >> 0; + uint8_t subinstr2 = (op & 0x001f) >> 0; switch (subinstr2) { @@ -1012,7 +1012,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_06(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07(OPS_16) { - UINT8 subinstr2 = (op & 0x001f) >> 0; + uint8_t subinstr2 = (op & 0x001f) >> 0; switch (subinstr2) { @@ -1055,7 +1055,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle19(OPS_16) { - UINT8 subinstr = (op & 0x0600) >> 9; + uint8_t subinstr = (op & 0x0600) >> 9; switch (subinstr) { @@ -1070,7 +1070,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle19(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1c(OPS_16) { - UINT8 subinstr = (op & 0x0080) >> 7; + uint8_t subinstr = (op & 0x0080) >> 7; switch (subinstr) { @@ -1083,7 +1083,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1c(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1d(OPS_16) { - UINT8 subinstr = (op & 0x0080) >> 7; + uint8_t subinstr = (op & 0x0080) >> 7; switch (subinstr) { @@ -1096,7 +1096,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1d(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e(OPS_16) { - UINT8 subinstr = (op & 0x0600) >> 9; + uint8_t subinstr = (op & 0x0600) >> 9; switch (subinstr) { @@ -1111,7 +1111,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03(OPS_16) { - UINT8 subinstr2 = (op & 0x01c0) >> 6; + uint8_t subinstr2 = (op & 0x01c0) >> 6; switch (subinstr2) { @@ -1130,7 +1130,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03(OPS_16) // handlers -UINT32 arcompact_device::handle_jump_to_addr(int delay, int link, UINT32 address, UINT32 next_addr) +uint32_t arcompact_device::handle_jump_to_addr(int delay, int link, uint32_t address, uint32_t next_addr) { if (delay) { @@ -1148,7 +1148,7 @@ UINT32 arcompact_device::handle_jump_to_addr(int delay, int link, UINT32 address } -UINT32 arcompact_device::handle_jump_to_register(int delay, int link, UINT32 reg, UINT32 next_addr, int flag) +uint32_t arcompact_device::handle_jump_to_register(int delay, int link, uint32_t reg, uint32_t next_addr, int flag) { if (reg == LIMM_REG) arcompact_fatal("handle_jump_to_register called with LIMM register, call handle_jump_to_addr instead"); @@ -1176,7 +1176,7 @@ UINT32 arcompact_device::handle_jump_to_register(int delay, int link, UINT32 reg else { //arcompact_fatal("jump not supported"); - UINT32 target = m_regs[reg]; + uint32_t target = m_regs[reg]; return handle_jump_to_addr(delay, link, target, next_addr); } } @@ -1195,12 +1195,12 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle00_00(OPS_32) // Branch Conditionally // 0000 0sss ssss sss0 SSSS SSSS SSNQ QQQQ - INT32 address = (op & 0x07fe0000) >> 17; + int32_t address = (op & 0x07fe0000) >> 17; address |= ((op & 0x0000ffc0) >> 6) << 10; if (address & 0x80000) address = -0x80000 + (address & 0x7ffff); int n = (op & 0x00000020) >> 5; op &= ~0x00000020; - UINT32 realaddress = PC_ALIGNED32 + (address * 2); + uint32_t realaddress = PC_ALIGNED32 + (address * 2); if (n) { @@ -1222,14 +1222,14 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle00_01(OPS_32) { int size = 4; // Branch Unconditionally Far - INT32 address = (op & 0x07fe0000) >> 17; + int32_t address = (op & 0x07fe0000) >> 17; address |= ((op & 0x0000ffc0) >> 6) << 10; address |= ((op & 0x0000000f) >> 0) << 20; if (address & 0x800000) address = -0x800000 + (address & 0x7fffff); int n = (op & 0x00000020) >> 5; op &= ~0x00000020; // int res = (op & 0x00000010) >> 4; op &= ~0x00000010; // should be set to 0 - UINT32 realaddress = PC_ALIGNED32 + (address * 2); + uint32_t realaddress = PC_ALIGNED32 + (address * 2); if (n) { @@ -1264,14 +1264,14 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_00_01dasm(OPS_32) int size = 4; // Branch and Link Unconditionally Far // 00001 sssssssss 10 SSSSSSSSSS N R TTTT - INT32 address = (op & 0x07fc0000) >> 17; + int32_t address = (op & 0x07fc0000) >> 17; address |= ((op & 0x0000ffc0) >> 6) << 10; address |= ((op & 0x0000000f) >> 0) << 20; if (address & 0x800000) address = -0x800000 + (address&0x7fffff); int n = (op & 0x00000020) >> 5; op &= ~0x00000020; // int res = (op & 0x00000010) >> 4; op &= ~0x00000010; - UINT32 realaddress = PC_ALIGNED32 + (address * 2); + uint32_t realaddress = PC_ALIGNED32 + (address * 2); if (n) { @@ -1307,7 +1307,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_01_01_00_helper(OPS_32, const char } else { - //UINT32 limm; + //uint32_t limm; //GET_LIMM_32; size = 8; } @@ -1326,7 +1326,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_01_01_00_helper(OPS_32, const char COMMON32_GET_creg; \ COMMON32_GET_breg; \ int n = (op & 0x00000020) >> 5; \ - UINT32 b,c; \ + uint32_t b,c; \ if ((breg != LIMM_REG) && (creg != LIMM_REG)) \ { \ b = m_regs[breg]; \ @@ -1334,7 +1334,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_01_01_00_helper(OPS_32, const char } \ else \ { \ - UINT32 limm; \ + uint32_t limm; \ GET_LIMM_32; \ size = 8; \ \ @@ -1350,7 +1350,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_01_01_00_helper(OPS_32, const char } #define BR_TAKEJUMP \ /* take jump */ \ - UINT32 realaddress = PC_ALIGNED32 + (address * 2); \ + uint32_t realaddress = PC_ALIGNED32 + (address * 2); \ \ if (n) \ { \ @@ -1395,7 +1395,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_00_02(OPS_32) // regit BR_REGREG_SETUP // BRLT (signed operation) - if ((INT32)b < (INT32)c) + if ((int32_t)b < (int32_t)c) { BR_TAKEJUMP } @@ -1408,7 +1408,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_00_03(OPS_32) // regis BR_REGREG_SETUP // BRGE (signed operation) - if ((INT32)b >= (INT32)c) + if ((int32_t)b >= (int32_t)c) { BR_TAKEJUMP } @@ -1460,7 +1460,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_01_01_01_helper(OPS_32, const char COMMON32_GET_u6; \ COMMON32_GET_breg; \ int n = (op & 0x00000020) >> 5; \ - UINT32 b,c; \ + uint32_t b,c; \ c = u; \ /* comparing a LIMM to an immediate is pointless, is it a valid encoding? */ \ if ((breg != LIMM_REG)) \ @@ -1469,7 +1469,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_01_01_01_helper(OPS_32, const char } \ else \ { \ - UINT32 limm; \ + uint32_t limm; \ GET_LIMM_32; \ size = 8; \ b = limm; \ @@ -1509,7 +1509,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_02(OPS_32) // BRLT BR_REGIMM_SETUP // BRLT (signed operation) - if ((INT32)b < (INT32)c) + if ((int32_t)b < (int32_t)c) { BR_TAKEJUMP } @@ -1522,7 +1522,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_03(OPS_32) BR_REGIMM_SETUP // BRGE (signed operation) - if ((INT32)b >= (INT32)c) + if ((int32_t)b >= (int32_t)c) { BR_TAKEJUMP } @@ -1564,7 +1564,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_0f(OPS_32) { retur ARCOMPACT_RETTYPE arcompact_device::arcompact_handle02(OPS_32) { int size = 4; - UINT32 limm; + uint32_t limm; int S = (op & 0x00008000) >> 15;// op &= ~0x00008000; int s = (op & 0x00ff0000) >> 16;// op &= ~0x00ff0000; @@ -1578,7 +1578,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle02(OPS_32) int a = (op & 0x00000600) >> 9; //op &= ~0x00000600; // int D = (op & 0x00000800) >> 11;// op &= ~0x00000800; // we don't use the data cache currently - UINT32 address = m_regs[breg]; + uint32_t address = m_regs[breg]; if (breg == LIMM_REG) { @@ -1613,7 +1613,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle02(OPS_32) } } - UINT32 readdata = 0; + uint32_t readdata = 0; // read data if (Z == 0) @@ -1663,7 +1663,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle02(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle03(OPS_32) { int size = 4; - UINT32 limm = 0; + uint32_t limm = 0; int got_limm = 0; int S = (op & 0x00008000) >> 15; int s = (op & 0x00ff0000) >> 16; @@ -1678,7 +1678,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle03(OPS_32) // int D = (op & 0x00000020) >> 5; // we don't use the data cache currently - UINT32 address = m_regs[breg]; + uint32_t address = m_regs[breg]; if (breg == LIMM_REG) { @@ -1689,7 +1689,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle03(OPS_32) address = limm; } - UINT32 writedata = m_regs[creg]; + uint32_t writedata = m_regs[creg]; if (creg == LIMM_REG) { @@ -1762,7 +1762,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle03(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_helper(OPS_32, const char* optext, int ignore_dst, int b_reserved) { int size; - //UINT32 limm = 0; + //uint32_t limm = 0; int got_limm = 0; COMMON32_GET_p; @@ -1926,7 +1926,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1d(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p00(OPS_32) { int size; - UINT32 limm = 0; + uint32_t limm = 0; int got_limm = 0; COMMON32_GET_creg @@ -2004,14 +2004,14 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p10(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_32) // Jcc (no link, no delay) { int size = 4; - UINT32 limm = 0; + uint32_t limm = 0; int got_limm = 0; COMMON32_GET_creg COMMON32_GET_CONDITION; COMMON32_GET_F - UINT32 c; + uint32_t c; if (creg == LIMM_REG) { @@ -2048,7 +2048,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_32) // Jcc } else { - UINT32 realaddress = c; + uint32_t realaddress = c; return realaddress; } } @@ -2085,7 +2085,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m1(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_21_p00(OPS_32) { int size = 4; - UINT32 limm = 0; + uint32_t limm = 0; int got_limm = 0; COMMON32_GET_creg @@ -2127,14 +2127,14 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_21_p10(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_21_p11_m0(OPS_32) // Jcc.D (no link, delay) { int size = 4; - UINT32 limm; + uint32_t limm; int got_limm = 0; COMMON32_GET_creg COMMON32_GET_CONDITION; COMMON32_GET_F - //UINT32 c = 0; + //uint32_t c = 0; if (creg == LIMM_REG) { @@ -2243,7 +2243,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_28(OPS_32) // LPcc (loop // if the loop condition fails then just jump to after the end of the loop, don't set any registers if (!check_condition(condition)) { - UINT32 realoffset = PC_ALIGNED32 + (u * 2); + uint32_t realoffset = PC_ALIGNED32 + (u * 2); return realoffset; } else @@ -2281,7 +2281,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_helper(OPS_32, const c if (creg == LIMM_REG) { - //UINT32 limm; + //uint32_t limm; //GET_LIMM_32; size = 8; } @@ -2331,7 +2331,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_3f_05(OPS_32) { arcom ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_3x_helper(OPS_32, int dsize, int extend) { int size; - //UINT32 limm=0; + //uint32_t limm=0; int got_limm = 0; @@ -2417,7 +2417,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_2f_0x_helper(OPS_32, cons if (creg == LIMM_REG) { - //UINT32 limm; + //uint32_t limm; //GET_LIMM_32; size = 8; @@ -2554,7 +2554,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0e_0x_helper(OPS_16, const c if (h == LIMM_REG) { - //UINT32 limm; + //uint32_t limm; //GET_LIMM; size = 6; } @@ -2579,7 +2579,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0e_00(OPS_16) // ADD_s b, b, if (h == LIMM_REG) { - UINT32 limm; + uint32_t limm; GET_LIMM_16; size = 6; @@ -2609,7 +2609,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0e_01(OPS_16) // MOV_S b <- // opcode iiii ibbb hhhI Ihhh // MOV_S b, limm 0111 0bbb 1100 1111 [LIMM] (h == LIMM) - UINT32 limm; + uint32_t limm; GET_LIMM_16; size = 6; @@ -2914,14 +2914,14 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_0x_helper(OPS_16, const c ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_00(OPS_16) // LD_S b, [SP, u7] { int breg; - UINT32 u; + uint32_t u; COMMON16_GET_breg; COMMON16_GET_u5; REG_16BIT_RANGE(breg); - UINT32 address = m_regs[REG_SP] + (u << 2); + uint32_t address = m_regs[REG_SP] + (u << 2); m_regs[breg] = READ32(address >> 2); @@ -2936,14 +2936,14 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_01(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_02(OPS_16) // ST_S b, [SP, u7] { int breg; - UINT32 u; + uint32_t u; COMMON16_GET_breg; COMMON16_GET_u5; REG_16BIT_RANGE(breg); - UINT32 address = m_regs[REG_SP] + (u << 2); + uint32_t address = m_regs[REG_SP] + (u << 2); WRITE32(address >> 2, m_regs[breg]); @@ -2958,7 +2958,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_03(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_04(OPS_16) // ADD_S b, SP, u7 { int breg; - UINT32 u; + uint32_t u; COMMON16_GET_breg; COMMON16_GET_u5; @@ -3060,7 +3060,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1a(OPS_16) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1b(OPS_16) // MOV_S b, u8 { int breg; - UINT32 u; + uint32_t u; COMMON16_GET_breg; COMMON16_GET_u8; REG_16BIT_RANGE(breg); @@ -3073,7 +3073,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1b(OPS_16) // MOV_S b, u8 ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1c_00(OPS_16) // ADD_S b, b, u7 { int breg; - UINT32 u; + uint32_t u; COMMON16_GET_breg; COMMON16_GET_u7; REG_16BIT_RANGE(breg); @@ -3086,7 +3086,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1c_00(OPS_16) // ADD_S b, b, ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1c_01(OPS_16) // CMP b, u7 { int breg; - UINT32 u; + uint32_t u; COMMON16_GET_breg; COMMON16_GET_u7; REG_16BIT_RANGE(breg); @@ -3114,7 +3114,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1c_01(OPS_16) // CMP b, u7 STATUS32_CLEAR_C; } // signed checks - INT32 temp = (INT32)m_regs[breg] - (INT32)u; + int32_t temp = (int32_t)m_regs[breg] - (int32_t)u; if (temp < 0) { @@ -3155,7 +3155,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1d_00(OPS_16) // BREQ_S b,0, { int s = (op & 0x007f) >> 0; op &= ~0x007f; if (s & 0x40) s = -0x40 + (s & 0x3f); - UINT32 realaddress = PC_ALIGNED32 + (s * 2); + uint32_t realaddress = PC_ALIGNED32 + (s * 2); //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link return realaddress; } @@ -3174,7 +3174,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1d_01(OPS_16) // BRNE_S b,0, { int s = (op & 0x007f) >> 0; op &= ~0x007f; if (s & 0x40) s = -0x40 + (s & 0x3f); - UINT32 realaddress = PC_ALIGNED32 + (s * 2); + uint32_t realaddress = PC_ALIGNED32 + (s * 2); //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link return realaddress; } @@ -3195,7 +3195,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_00(OPS_16) // B_S s10 (b { int s = (op & 0x01ff) >> 0; op &= ~0x01ff; if (s & 0x100) s = -0x100 + (s & 0xff); - UINT32 realaddress = PC_ALIGNED32 + (s * 2); + uint32_t realaddress = PC_ALIGNED32 + (s * 2); //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link return realaddress; } @@ -3206,7 +3206,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_01(OPS_16) // BEQ_S s10 ( { int s = (op & 0x01ff) >> 0; op &= ~0x01ff; if (s & 0x100) s = -0x100 + (s & 0xff); - UINT32 realaddress = PC_ALIGNED32 + (s * 2); + uint32_t realaddress = PC_ALIGNED32 + (s * 2); //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link return realaddress; } @@ -3220,7 +3220,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_02(OPS_16) // BNE_S s10 { int s = (op & 0x01ff) >> 0; op &= ~0x01ff; if (s & 0x100) s = -0x100 + (s & 0xff); - UINT32 realaddress = PC_ALIGNED32 + (s * 2); + uint32_t realaddress = PC_ALIGNED32 + (s * 2); //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link return realaddress; } @@ -3243,7 +3243,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03_02(OPS_16) // BLT_S { int s = (op & 0x003f) >> 0; op &= ~0x003f; if (s & 0x020) s = -0x20 + (s & 0x1f); - UINT32 realaddress = PC_ALIGNED32 + (s * 2); + uint32_t realaddress = PC_ALIGNED32 + (s * 2); //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link return realaddress; } @@ -3257,7 +3257,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_03_03(OPS_16) // BLE_S { int s = (op & 0x003f) >> 0; op &= ~0x003f; if (s & 0x020) s = -0x20 + (s & 0x1f); - UINT32 realaddress = PC_ALIGNED32 + (s * 2); + uint32_t realaddress = PC_ALIGNED32 + (s * 2); //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link return realaddress; } @@ -3275,7 +3275,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1f(OPS_16) // BL_S s13 int s = (op & 0x07ff) >> 0; op &= ~0x07ff; if (s & 0x400) s = -0x400 + (s & 0x3ff); - UINT32 realaddress = PC_ALIGNED32 + (s * 4); + uint32_t realaddress = PC_ALIGNED32 + (s * 4); m_regs[REG_BLINK] = m_pc + (2 >> 0); return realaddress; diff --git a/src/devices/cpu/arcompact/arcompact_make.py b/src/devices/cpu/arcompact/arcompact_make.py index 30aba810a99..2f1ce7ff4fe 100644 --- a/src/devices/cpu/arcompact/arcompact_make.py +++ b/src/devices/cpu/arcompact/arcompact_make.py @@ -71,7 +71,7 @@ def EmitGroup04_u5fragment(f,funcname, opname, opexecute, opwrite, opwrite_alt, print(" int size = 4;", file=f) if breg_is_dst_only == 0: - print(" UINT32 limm = 0;", file=f) + print(" uint32_t limm = 0;", file=f) print("/* int got_limm = 0; */", file=f) print(" ", file=f) @@ -92,9 +92,9 @@ def EmitGroup04_u5fragment(f,funcname, opname, opexecute, opwrite, opwrite_alt, print(" //COMMON32_GET_areg; // areg bits already used as condition code select", file=f) print(" ", file=f) - print(" UINT32 c;", file=f) + print(" uint32_t c;", file=f) if breg_is_dst_only == 0: - print(" UINT32 b;", file=f) + print(" uint32_t b;", file=f) print(" ", file=f) print(" /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */", file=f) print(" if (breg == LIMM_REG)", file=f) @@ -120,7 +120,7 @@ def EmitGroup04(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, b print("{", file=f) print(" int size = 4;", file=f) - print(" UINT32 limm = 0;", file=f) + print(" uint32_t limm = 0;", file=f) print(" int got_limm = 0;", file=f) print(" ", file=f) @@ -140,9 +140,9 @@ def EmitGroup04(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, b print(" ", file=f) - print(" UINT32 c;", file=f) + print(" uint32_t c;", file=f) if breg_is_dst_only == 0: - print(" UINT32 b;", file=f) + print(" uint32_t b;", file=f) print(" ", file=f) print(" if (breg == LIMM_REG)", file=f) print(" {", file=f) @@ -204,7 +204,7 @@ def EmitGroup04(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, b print("{", file=f) print(" int size = 4;", file=f) if breg_is_dst_only == 0: - print(" UINT32 limm = 0;", file=f) + print(" uint32_t limm = 0;", file=f) print("/* int got_limm = 0; */", file=f) print(" ", file=f) @@ -218,9 +218,9 @@ def EmitGroup04(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, b # areg can't be used here, it's used for s12 bits print(" ", file=f) - print(" UINT32 c;", file=f) + print(" uint32_t c;", file=f) if breg_is_dst_only == 0: - print(" UINT32 b;", file=f) + print(" uint32_t b;", file=f) print(" ", file=f) print(" /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */", file=f) print(" if (breg == LIMM_REG)", file=f) @@ -236,7 +236,7 @@ def EmitGroup04(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, b print(" }", file=f) print(" ", file=f) - print(" c = (UINT32)S;", file=f) + print(" c = (uint32_t)S;", file=f) print(" ", file=f) print(" /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */", file=f) print(" %s" % opexecute, file=f) @@ -359,72 +359,72 @@ except Exception: sys.exit(1) -EmitGroup04(f, "04_00", "ADD", "UINT32 result = b + c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_Handle_NZCV_ADD_Flags ) +EmitGroup04(f, "04_00", "ADD", "uint32_t result = b + c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_Handle_NZCV_ADD_Flags ) -EmitGroup04(f, "04_02", "SUB", "UINT32 result = b - c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_02", "SUB", "uint32_t result = b - c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_04", "AND", "UINT32 result = b & c;", "if (areg != LIMM_REG) { m_regs[areg] = result; }", "if (breg != LIMM_REG) { m_regs[breg] = result; }", 0,0, -1, EmitGroup04_Handle_NZ_Flags ) -EmitGroup04(f, "04_05", "OR", "UINT32 result = b | c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_06", "BIC", "UINT32 result = b & (~c);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_07", "XOR", "UINT32 result = b ^ c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_04", "AND", "uint32_t result = b & c;", "if (areg != LIMM_REG) { m_regs[areg] = result; }", "if (breg != LIMM_REG) { m_regs[breg] = result; }", 0,0, -1, EmitGroup04_Handle_NZ_Flags ) +EmitGroup04(f, "04_05", "OR", "uint32_t result = b | c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_06", "BIC", "uint32_t result = b & (~c);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_07", "XOR", "uint32_t result = b ^ c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_0a", "MOV", "UINT32 result = c;", "m_regs[breg] = result;", "m_regs[breg] = result;", 1,1, -1, EmitGroup04_Handle_NZ_Flags ) # special case, result always goes to breg +EmitGroup04(f, "04_0a", "MOV", "uint32_t result = c;", "m_regs[breg] = result;", "m_regs[breg] = result;", 1,1, -1, EmitGroup04_Handle_NZ_Flags ) # special case, result always goes to breg -EmitGroup04(f, "04_0e", "RSUB", "UINT32 result = c - b;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_0f", "BSET", "UINT32 result = b | (1 << (c & 0x1f));", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_0e", "RSUB", "uint32_t result = c - b;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_0f", "BSET", "uint32_t result = b | (1 << (c & 0x1f));", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_13", "BMSK", "UINT32 result = b & ((1<<(c+1))-1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_13", "BMSK", "uint32_t result = b & ((1<<(c+1))-1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_14", "ADD1", "UINT32 result = b + (c << 1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_15", "ADD2", "UINT32 result = b + (c << 2);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_16", "ADD3", "UINT32 result = b + (c << 3);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_17", "SUB1", "UINT32 result = b - (c << 1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_18", "SUB2", "UINT32 result = b - (c << 2);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "04_19", "SUB3", "UINT32 result = b - (c << 3);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_14", "ADD1", "uint32_t result = b + (c << 1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_15", "ADD2", "uint32_t result = b + (c << 2);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_16", "ADD3", "uint32_t result = b + (c << 3);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_17", "SUB1", "uint32_t result = b - (c << 1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_18", "SUB2", "uint32_t result = b - (c << 2);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "04_19", "SUB3", "uint32_t result = b - (c << 3);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) EmitGroup04(f, "04_2a", "LR", "m_regs[breg] = READAUX(c);", "", "", 1,1, -1, EmitGroup04_no_Flags ) # this can't be conditional (todo) EmitGroup04(f, "04_2b", "SR", "WRITEAUX(c,b);", "", "", 1,0, -1, EmitGroup04_no_Flags ) # this can't be conditional (todo) -EmitGroup04(f, "05_00", "ASL", "UINT32 result = b << (c&0x1f);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) -EmitGroup04(f, "05_01", "LSR", "UINT32 result = b >> (c&0x1f);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "05_00", "ASL", "uint32_t result = b << (c&0x1f);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) +EmitGroup04(f, "05_01", "LSR", "uint32_t result = b >> (c&0x1f);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags ) # the 04_2f subgroup uses the same encoding, but the areg is already used as sub-opcode select, so any modes relying on areg bits for other reasons (sign, condition) (modes 10, 11m0, 11m1) are illegal. the destination is also breg not areg -EmitGroup04(f, "04_2f_02", "LSR1", "UINT32 result = c >> 1;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_Handle_NZC_LSR1_Flags ) # no alt handler (invalid path) -EmitGroup04(f, "04_2f_03", "ROR", "int shift = 1; UINT32 mask = (1 << (shift)) - 1; mask <<= (32-shift); UINT32 result = ((c >> shift) & ~mask) | ((c << (32-shift)) & mask);", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_Handle_NZC_LSR1_Flags ) +EmitGroup04(f, "04_2f_02", "LSR1", "uint32_t result = c >> 1;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_Handle_NZC_LSR1_Flags ) # no alt handler (invalid path) +EmitGroup04(f, "04_2f_03", "ROR", "int shift = 1; uint32_t mask = (1 << (shift)) - 1; mask <<= (32-shift); uint32_t result = ((c >> shift) & ~mask) | ((c << (32-shift)) & mask);", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_Handle_NZC_LSR1_Flags ) -EmitGroup04(f, "04_2f_07", "EXTB", "UINT32 result = c & 0x000000ff;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_unsupported_Flags ) # ^ -EmitGroup04(f, "04_2f_08", "EXTW", "UINT32 result = c & 0x0000ffff;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_unsupported_Flags ) # ^ +EmitGroup04(f, "04_2f_07", "EXTB", "uint32_t result = c & 0x000000ff;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_unsupported_Flags ) # ^ +EmitGroup04(f, "04_2f_08", "EXTW", "uint32_t result = c & 0x0000ffff;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_unsupported_Flags ) # ^ # xxx_S c, b, u3 format opcodes (note c is destination) -EmitGroup0d(f, "0d_00", "ADD_S", "UINT32 result = m_regs[breg] + u;", "m_regs[creg] = result;" ) -EmitGroup0d(f, "0d_01", "SUB_S", "UINT32 result = m_regs[breg] - u;", "m_regs[creg] = result;" ) -EmitGroup0d(f, "0d_02", "ASL_S", "UINT32 result = m_regs[breg] << u;", "m_regs[creg] = result;" ) +EmitGroup0d(f, "0d_00", "ADD_S", "uint32_t result = m_regs[breg] + u;", "m_regs[creg] = result;" ) +EmitGroup0d(f, "0d_01", "SUB_S", "uint32_t result = m_regs[breg] - u;", "m_regs[creg] = result;" ) +EmitGroup0d(f, "0d_02", "ASL_S", "uint32_t result = m_regs[breg] << u;", "m_regs[creg] = result;" ) # xxx_S b <- b,c format opcodes (or in some cases xxx_S b,c) -EmitGroup0f(f, "0f_02", "SUB_S", "UINT32 result = m_regs[breg] - m_regs[creg];", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_04", "AND_S", "UINT32 result = m_regs[breg] & m_regs[creg];", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_05", "OR_S", "UINT32 result = m_regs[breg] | m_regs[creg];", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_07", "XOR_S", "UINT32 result = m_regs[breg] ^ m_regs[creg];", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_0f", "EXTB_S","UINT32 result = m_regs[creg] & 0x000000ff;", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_10", "EXTW_S","UINT32 result = m_regs[creg] & 0x0000ffff;", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_13", "NEG_S"," UINT32 result = 0 - m_regs[creg];", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_02", "SUB_S", "uint32_t result = m_regs[breg] - m_regs[creg];", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_04", "AND_S", "uint32_t result = m_regs[breg] & m_regs[creg];", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_05", "OR_S", "uint32_t result = m_regs[breg] | m_regs[creg];", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_07", "XOR_S", "uint32_t result = m_regs[breg] ^ m_regs[creg];", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_0f", "EXTB_S","uint32_t result = m_regs[creg] & 0x000000ff;", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_10", "EXTW_S","uint32_t result = m_regs[creg] & 0x0000ffff;", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_13", "NEG_S"," uint32_t result = 0 - m_regs[creg];", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_14", "ADD1_S"," UINT32 result = m_regs[breg] + (m_regs[creg] <<1);", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_15", "ADD2_S"," UINT32 result = m_regs[breg] + (m_regs[creg] <<2);", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_16", "ADD3_S"," UINT32 result = m_regs[breg] + (m_regs[creg] <<3);", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_14", "ADD1_S"," uint32_t result = m_regs[breg] + (m_regs[creg] <<1);", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_15", "ADD2_S"," uint32_t result = m_regs[breg] + (m_regs[creg] <<2);", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_16", "ADD3_S"," uint32_t result = m_regs[breg] + (m_regs[creg] <<3);", "m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_19", "LSR_S", "UINT32 result = m_regs[breg] >> (m_regs[creg]&0x1f);","m_regs[breg] = result;" ) -EmitGroup0f(f, "0f_1b", "ASL1_S","UINT32 result = m_regs[creg] << 1;", "m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_19", "LSR_S", "uint32_t result = m_regs[breg] >> (m_regs[creg]&0x1f);","m_regs[breg] = result;" ) +EmitGroup0f(f, "0f_1b", "ASL1_S","uint32_t result = m_regs[creg] << 1;", "m_regs[breg] = result;" ) # xxx_S b, b, u5 format opcodes EmitGroup17(f, "17_00", "ASL_S", "m_regs[breg] = m_regs[breg] << (u&0x1f);" ) EmitGroup17(f, "17_01", "LSR_S", "m_regs[breg] = m_regs[breg] >> (u&0x1f);" ) -EmitGroup17(f, "17_02", "ASR_S", "INT32 temp = (INT32)m_regs[breg]; m_regs[breg] = temp >> (u&0x1f); // treat it as a signed value, so sign extension occurs during shift" ) +EmitGroup17(f, "17_02", "ASR_S", "int32_t temp = (int32_t)m_regs[breg]; m_regs[breg] = temp >> (u&0x1f); // treat it as a signed value, so sign extension occurs during shift" ) EmitGroup17(f, "17_03", "SUB_S", "m_regs[breg] = m_regs[breg] - u;" ) EmitGroup17(f, "17_04", "BSET_S", "m_regs[breg] = m_regs[breg] | (1 << (u & 0x1f));" ) diff --git a/src/devices/cpu/arcompact/arcompactdasm.cpp b/src/devices/cpu/arcompact/arcompactdasm.cpp index 755106ce90c..cc77f73c585 100644 --- a/src/devices/cpu/arcompact/arcompactdasm.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm.cpp @@ -28,10 +28,10 @@ CPU_DISASSEMBLE(arcompact) { int size; - UINT32 op = oprom[0] | (oprom[1] << 8); + uint32_t op = oprom[0] | (oprom[1] << 8); output = buffer; - UINT8 instruction = ARCOMPACT_OPERATION; + uint8_t instruction = ARCOMPACT_OPERATION; if (instruction < 0x0c) { diff --git a/src/devices/cpu/arcompact/arcompactdasm_dispatch.cpp b/src/devices/cpu/arcompact/arcompactdasm_dispatch.cpp index ddd809b84bc..769a8604fc8 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_dispatch.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_dispatch.cpp @@ -15,7 +15,7 @@ int arcompact_handle00_dasm(DASM_OPS_32) { int size = 4; - UINT8 subinstr = (op & 0x00010000) >> 16; + uint8_t subinstr = (op & 0x00010000) >> 16; op &= ~0x00010000; switch (subinstr) @@ -30,7 +30,7 @@ int arcompact_handle00_dasm(DASM_OPS_32) int arcompact_handle01_dasm(DASM_OPS_32) { int size = 4; - UINT8 subinstr = (op & 0x00010000) >> 16; + uint8_t subinstr = (op & 0x00010000) >> 16; op &= ~0x00010000; switch (subinstr) @@ -45,7 +45,7 @@ int arcompact_handle01_dasm(DASM_OPS_32) int arcompact_handle01_00_dasm(DASM_OPS_32) { int size = 4; - UINT8 subinstr2 = (op & 0x00020000) >> 17; + uint8_t subinstr2 = (op & 0x00020000) >> 17; op &= ~0x00020000; switch (subinstr2) @@ -61,7 +61,7 @@ int arcompact_handle01_01_dasm(DASM_OPS_32) { int size = 4; - UINT8 subinstr2 = (op & 0x00000010) >> 4; + uint8_t subinstr2 = (op & 0x00000010) >> 4; op &= ~0x00000010; switch (subinstr2) @@ -76,7 +76,7 @@ int arcompact_handle01_01_dasm(DASM_OPS_32) int arcompact_handle01_01_00_dasm(DASM_OPS_32) { int size = 4; - UINT8 subinstr3 = (op & 0x0000000f) >> 0; + uint8_t subinstr3 = (op & 0x0000000f) >> 0; op &= ~0x0000000f; switch (subinstr3) @@ -105,7 +105,7 @@ int arcompact_handle01_01_00_dasm(DASM_OPS_32) int arcompact_handle01_01_01_dasm(DASM_OPS_32) // Branch on Compare/Bit Test Register-Immediate { int size = 4; - UINT8 subinstr3 = (op & 0x0000000f) >> 0; + uint8_t subinstr3 = (op & 0x0000000f) >> 0; op &= ~0x0000000f; switch (subinstr3) @@ -146,7 +146,7 @@ int arcompact_handle04_dasm(DASM_OPS_32) // 00100 bbb 11 iiiiii F BBB CCCCCC 0 QQQQQ General Operations Conditional Register // 00100 bbb 11 iiiiii F BBB UUUUUU 1 QQQQQ General Operations Conditional Register (Unsigned 6-bit IMM) - UINT8 subinstr = (op & 0x003f0000) >> 16; + uint8_t subinstr = (op & 0x003f0000) >> 16; op &= ~0x003f0000; switch (subinstr) @@ -223,7 +223,7 @@ int arcompact_handle04_dasm(DASM_OPS_32) int arcompact_handle04_2f_dasm(DASM_OPS_32) { int size = 4; - UINT8 subinstr2 = (op & 0x0000003f) >> 0; + uint8_t subinstr2 = (op & 0x0000003f) >> 0; op &= ~0x0000003f; switch (subinstr2) @@ -301,7 +301,7 @@ int arcompact_handle04_2f_dasm(DASM_OPS_32) int arcompact_handle05_2f_dasm(DASM_OPS_32) { int size = 4; - UINT8 subinstr2 = (op & 0x0000003f) >> 0; + uint8_t subinstr2 = (op & 0x0000003f) >> 0; op &= ~0x0000003f; switch (subinstr2) @@ -378,7 +378,7 @@ int arcompact_handle05_2f_dasm(DASM_OPS_32) int arcompact_handle04_2f_3f_dasm(DASM_OPS_32) { int size = 4; - UINT8 subinstr3 = (op & 0x07000000) >> 24; + uint8_t subinstr3 = (op & 0x07000000) >> 24; subinstr3 |= ((op & 0x00007000) >> 12) << 3; op &= ~0x07007000; @@ -458,7 +458,7 @@ int arcompact_handle04_2f_3f_dasm(DASM_OPS_32) int arcompact_handle05_2f_3f_dasm(DASM_OPS_32) // useless ZOP group, no actual opcodes { int size = 4; - UINT8 subinstr3 = (op & 0x07000000) >> 24; + uint8_t subinstr3 = (op & 0x07000000) >> 24; subinstr3 |= ((op & 0x00007000) >> 12) << 3; op &= ~0x07007000; @@ -539,7 +539,7 @@ int arcompact_handle05_2f_3f_dasm(DASM_OPS_32) // useless ZOP group, no actual o int arcompact_handle05_dasm(DASM_OPS_32) { int size = 4; - UINT8 subinstr = (op & 0x003f0000) >> 16; + uint8_t subinstr = (op & 0x003f0000) >> 16; op &= ~0x003f0000; switch (subinstr) @@ -616,7 +616,7 @@ int arcompact_handle05_dasm(DASM_OPS_32) int arcompact_handle0c_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr = (op & 0x0018) >> 3; + uint8_t subinstr = (op & 0x0018) >> 3; op &= ~0x0018; switch (subinstr) @@ -632,7 +632,7 @@ int arcompact_handle0c_dasm(DASM_OPS_16) int arcompact_handle0d_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr = (op & 0x0018) >> 3; + uint8_t subinstr = (op & 0x0018) >> 3; op &= ~0x0018; switch (subinstr) @@ -648,7 +648,7 @@ int arcompact_handle0d_dasm(DASM_OPS_16) int arcompact_handle0e_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr = (op & 0x0018) >> 3; + uint8_t subinstr = (op & 0x0018) >> 3; op &= ~0x0018; switch (subinstr) @@ -666,7 +666,7 @@ int arcompact_handle0f_dasm(DASM_OPS_16) int size = 2; // General Register Instructions (16-bit) // 0111 1bbb ccci iiii - UINT8 subinstr = (op & 0x01f) >> 0; + uint8_t subinstr = (op & 0x01f) >> 0; op &= ~0x001f; switch (subinstr) @@ -711,7 +711,7 @@ int arcompact_handle0f_dasm(DASM_OPS_16) int arcompact_handle0f_00_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr = (op & 0x00e0) >> 5; + uint8_t subinstr = (op & 0x00e0) >> 5; op &= ~0x00e0; switch (subinstr) @@ -735,7 +735,7 @@ int arcompact_handle0f_00_07_dasm(DASM_OPS_16) int size = 2; // General Operations w/o Register // 01111 iii 111 00000 - UINT8 subinstr3 = (op & 0x0700) >> 8; + uint8_t subinstr3 = (op & 0x0700) >> 8; op &= ~0x0700; switch (subinstr3) @@ -756,7 +756,7 @@ int arcompact_handle0f_00_07_dasm(DASM_OPS_16) int arcompact_handle17_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr = (op & 0x00e0) >> 5; + uint8_t subinstr = (op & 0x00e0) >> 5; op &= ~0x00e0; switch (subinstr) @@ -779,7 +779,7 @@ int arcompact_handle18_dasm(DASM_OPS_16) int size = 2; // Stack Pointer Based Instructions (16-bit) // 11000 bbb iii uuuuu - UINT8 subinstr = (op & 0x00e0) >> 5; + uint8_t subinstr = (op & 0x00e0) >> 5; op &= ~0x00e0; switch (subinstr) @@ -800,7 +800,7 @@ int arcompact_handle18_dasm(DASM_OPS_16) int arcompact_handle18_05_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr2 = (op & 0x0700) >> 8; + uint8_t subinstr2 = (op & 0x0700) >> 8; op &= ~0x0700; switch (subinstr2) @@ -821,7 +821,7 @@ int arcompact_handle18_05_dasm(DASM_OPS_16) int arcompact_handle18_06_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr2 = (op & 0x001f) >> 0; + uint8_t subinstr2 = (op & 0x001f) >> 0; op &= ~0x001f; switch (subinstr2) @@ -866,7 +866,7 @@ int arcompact_handle18_06_dasm(DASM_OPS_16) int arcompact_handle18_07_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr2 = (op & 0x001f) >> 0; + uint8_t subinstr2 = (op & 0x001f) >> 0; op &= ~0x001f; switch (subinstr2) @@ -911,7 +911,7 @@ int arcompact_handle18_07_dasm(DASM_OPS_16) int arcompact_handle19_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr = (op & 0x0600) >> 9; + uint8_t subinstr = (op & 0x0600) >> 9; op &= ~0x0600; switch (subinstr) @@ -927,7 +927,7 @@ int arcompact_handle19_dasm(DASM_OPS_16) int arcompact_handle1c_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr = (op & 0x0080) >> 7; + uint8_t subinstr = (op & 0x0080) >> 7; op &= ~0x0080; switch (subinstr) @@ -941,7 +941,7 @@ int arcompact_handle1c_dasm(DASM_OPS_16) int arcompact_handle1d_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr = (op & 0x0080) >> 7; + uint8_t subinstr = (op & 0x0080) >> 7; op &= ~0x0080; switch (subinstr) @@ -955,7 +955,7 @@ int arcompact_handle1d_dasm(DASM_OPS_16) int arcompact_handle1e_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr = (op & 0x0600) >> 9; + uint8_t subinstr = (op & 0x0600) >> 9; op &= ~0x0600; switch (subinstr) @@ -971,7 +971,7 @@ int arcompact_handle1e_dasm(DASM_OPS_16) int arcompact_handle1e_03_dasm(DASM_OPS_16) { int size = 2; - UINT8 subinstr2 = (op & 0x01c0) >> 6; + uint8_t subinstr2 = (op & 0x01c0) >> 6; op &= ~0x01c0; switch (subinstr2) diff --git a/src/devices/cpu/arcompact/arcompactdasm_dispatch.h b/src/devices/cpu/arcompact/arcompactdasm_dispatch.h index 40cb06f2d6b..1642871e1cf 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_dispatch.h +++ b/src/devices/cpu/arcompact/arcompactdasm_dispatch.h @@ -6,8 +6,8 @@ \*********************************/ -#define DASM_OPS_16 char *output, offs_t pc, UINT16 op, const UINT8* oprom -#define DASM_OPS_32 char *output, offs_t pc, UINT32 op, const UINT8* oprom +#define DASM_OPS_16 char *output, offs_t pc, uint16_t op, const uint8_t* oprom +#define DASM_OPS_32 char *output, offs_t pc, uint32_t op, const uint8_t* oprom #define DASM_PARAMS output, pc, op, oprom #define LIMM_REG 62 diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops.cpp b/src/devices/cpu/arcompact/arcompactdasm_ops.cpp index b9cfc30b545..d8498069682 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops.cpp +++ b/src/devices/cpu/arcompact/arcompactdasm_ops.cpp @@ -25,7 +25,7 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) #define GET_01_01_01_BRANCH_ADDR \ - INT32 address = (op & 0x00fe0000) >> 17; \ + int32_t address = (op & 0x00fe0000) >> 17; \ address |= ((op & 0x00008000) >> 15) << 7; \ if (address & 0x80) address = -0x80 + (address & 0x7f); \ op &= ~ 0x00fe800f; @@ -57,7 +57,7 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) int s_temp = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0; \ int S = s_temp | (S_temp<<6); #define COMMON32_GET_CONDITION \ - UINT8 condition = op & 0x0000001f; op &= ~0x0000001f; + uint8_t condition = op & 0x0000001f; op &= ~0x0000001f; #define COMMON16_GET_breg \ @@ -110,7 +110,7 @@ int arcompact_handle00_00_dasm(DASM_OPS_32) int size = 4; // Branch Conditionally // 0000 0sss ssss sss0 SSSS SSSS SSNQ QQQQ - INT32 address = (op & 0x07fe0000) >> 17; + int32_t address = (op & 0x07fe0000) >> 17; address |= ((op & 0x0000ffc0) >> 6) << 10; if (address & 0x80000) address = -0x80000 + (address & 0x7ffff); int n = (op & 0x00000020) >> 5; op &= ~0x00000020; @@ -125,7 +125,7 @@ int arcompact_handle00_01_dasm(DASM_OPS_32) int size = 4; // Branch Unconditionally Far // 0000 0sss ssss sss1 SSSS SSSS SSNR TTTT - INT32 address = (op & 0x07fe0000) >> 17; + int32_t address = (op & 0x07fe0000) >> 17; address |= ((op & 0x0000ffc0) >> 6) << 10; address |= ((op & 0x0000000f) >> 0) << 20; if (address & 0x800000) address = -0x800000 + (address & 0x7fffff); @@ -144,7 +144,7 @@ int arcompact_handle01_00_00dasm(DASM_OPS_32) // Branch and Link Conditionally // 00001 sssssssss 00 SSSSSSSSSS N QQQQQ - INT32 address = (op & 0x07fc0000) >> 17; + int32_t address = (op & 0x07fc0000) >> 17; address |= ((op & 0x0000ffc0) >> 6) << 10; if (address & 0x800000) address = -0x800000 + (address&0x7fffff); int n = (op & 0x00000020) >> 5; op &= ~0x00000020; @@ -160,7 +160,7 @@ int arcompact_handle01_00_01dasm(DASM_OPS_32) int size = 4; // Branch and Link Unconditionally Far // 00001 sssssssss 10 SSSSSSSSSS N R TTTT - INT32 address = (op & 0x07fc0000) >> 17; + int32_t address = (op & 0x07fc0000) >> 17; address |= ((op & 0x0000ffc0) >> 6) << 10; address |= ((op & 0x0000000f) >> 0) << 20; if (address & 0x800000) address = -0x800000 + (address&0x7fffff); @@ -196,7 +196,7 @@ int arcompact_01_01_00_helper(DASM_OPS_32, const char* optext) } else { - UINT32 limm; + uint32_t limm; GET_LIMM_32; size = 8; @@ -283,7 +283,7 @@ int arcompact_handle02_dasm(DASM_OPS_32) int sdat = s | (S << 8); // todo - signed - UINT32 limm = 0; + uint32_t limm = 0; if (breg == LIMM_REG) { GET_LIMM_32; @@ -309,7 +309,7 @@ int arcompact_handle02_dasm(DASM_OPS_32) int arcompact_handle03_dasm(DASM_OPS_32) { int size = 4; - UINT32 limm = 0; + uint32_t limm = 0; int got_limm = 0; // bitpos // 1111 1111 1111 1111 0000 0000 0000 0000 @@ -374,7 +374,7 @@ int arcompact_handle04_p00_helper_dasm(DASM_OPS_32, const char* optext, int igno // PP // 0010 0bbb 00ii iiii FBBB CCCC CCAA AAAA int size = 4; - UINT32 limm = 0; + uint32_t limm = 0; int got_limm = 0; COMMON32_GET_breg; @@ -446,7 +446,7 @@ int arcompact_handle04_p01_helper_dasm(DASM_OPS_32, const char* optext, int igno // PP // 0010 0bbb 01ii iiii FBBB uuuu uuAA AAAA int size = 4; - UINT32 limm = 0; + uint32_t limm = 0; // int got_limm = 0; COMMON32_GET_breg; @@ -504,7 +504,7 @@ int arcompact_handle04_p01_helper_dasm(DASM_OPS_32, const char* optext, int igno int arcompact_handle04_p10_helper_dasm(DASM_OPS_32, const char* optext, int b_reserved) { int size = 4; - UINT32 limm; + uint32_t limm; //int got_limm = 0; COMMON32_GET_breg; @@ -543,7 +543,7 @@ int arcompact_handle04_p10_helper_dasm(DASM_OPS_32, const char* optext, int b_re int arcompact_handle04_p11_m0_helper_dasm(DASM_OPS_32, const char* optext, int b_reserved) { int size = 4; - UINT32 limm = 0; + uint32_t limm = 0; int got_limm = 0; COMMON32_GET_breg; @@ -599,7 +599,7 @@ int arcompact_handle04_p11_m0_helper_dasm(DASM_OPS_32, const char* optext, int b int arcompact_handle04_p11_m1_helper_dasm(DASM_OPS_32, const char* optext, int b_reserved) { int size = 4; - UINT32 limm; + uint32_t limm; //int got_limm = 0; COMMON32_GET_breg; @@ -902,7 +902,7 @@ int arcompact_handle04_2a_dasm(DASM_OPS_32) // Load FROM Auxiliary register TO int size = 4; - UINT32 limm = 0; + uint32_t limm = 0; int got_limm = 0; COMMON32_GET_p; @@ -981,7 +981,7 @@ int arcompact_handle04_2b_dasm(DASM_OPS_32) // Store TO Auxiliary register FROM // rather than using the lPcc opcode int size = 4; - UINT32 limm = 0; + uint32_t limm = 0; int got_limm = 0; COMMON32_GET_p; @@ -1102,7 +1102,7 @@ int arcompact_handle04_2f_helper_dasm(DASM_OPS_32, const char* optext) if (creg == LIMM_REG) { - UINT32 limm; + uint32_t limm; GET_LIMM_32; size = 8; output += sprintf( output, "(%08x) ", limm ); @@ -1167,7 +1167,7 @@ int arcompact_handle04_2f_3f_05_dasm(DASM_OPS_32) { print("BRK (%08x)", op); re int arcompact_handle04_3x_helper_dasm(DASM_OPS_32, int dsize, int extend) { int size = 4; - UINT32 limm=0; + uint32_t limm=0; int got_limm = 0; output += sprintf(output, "LD"); @@ -1283,7 +1283,7 @@ int arcompact_handle05_2f_0x_helper_dasm(DASM_OPS_32, const char* optext) if (creg == LIMM_REG) { - UINT32 limm; + uint32_t limm; GET_LIMM_32; size = 8; output += sprintf( output, "(%08x) ", limm ); @@ -1451,7 +1451,7 @@ int arcompact_handle0e_0x_helper_dasm(DASM_OPS_16, const char* optext, int revop if (h == LIMM_REG) { - UINT32 limm; + uint32_t limm; GET_LIMM; size = 6; if (!revop) print("%s %s <- 0x%08x", optext, regnames[breg], limm); diff --git a/src/devices/cpu/arcompact/arcompactdasm_ops.h b/src/devices/cpu/arcompact/arcompactdasm_ops.h index a2d09d83441..338fc9976a0 100644 --- a/src/devices/cpu/arcompact/arcompactdasm_ops.h +++ b/src/devices/cpu/arcompact/arcompactdasm_ops.h @@ -9,8 +9,8 @@ #include "arcompact_common.h" -#define DASM_OPS_16 char *output, offs_t pc, UINT16 op, const UINT8* oprom -#define DASM_OPS_32 char *output, offs_t pc, UINT32 op, const UINT8* oprom +#define DASM_OPS_16 char *output, offs_t pc, uint16_t op, const uint8_t* oprom +#define DASM_OPS_32 char *output, offs_t pc, uint32_t op, const uint8_t* oprom #define DASM_PARAMS output, pc, op, oprom #define LIMM_REG 62 diff --git a/src/devices/cpu/arm/arm.cpp b/src/devices/cpu/arm/arm.cpp index 31bcfa527dd..b4870ce9f54 100644 --- a/src/devices/cpu/arm/arm.cpp +++ b/src/devices/cpu/arm/arm.cpp @@ -96,12 +96,12 @@ static const int sRegisterTable[kNumModes][16] = #define I_BIT 27 #define F_BIT 26 -#define N_MASK ((UINT32)(1<> 31) /* Deconstructing an instruction */ -#define INSN_COND ((UINT32) 0xf0000000u) -#define INSN_SDT_L ((UINT32) 0x00100000u) -#define INSN_SDT_W ((UINT32) 0x00200000u) -#define INSN_SDT_B ((UINT32) 0x00400000u) -#define INSN_SDT_U ((UINT32) 0x00800000u) -#define INSN_SDT_P ((UINT32) 0x01000000u) -#define INSN_BDT_L ((UINT32) 0x00100000u) -#define INSN_BDT_W ((UINT32) 0x00200000u) -#define INSN_BDT_S ((UINT32) 0x00400000u) -#define INSN_BDT_U ((UINT32) 0x00800000u) -#define INSN_BDT_P ((UINT32) 0x01000000u) -#define INSN_BDT_REGS ((UINT32) 0x0000ffffu) -#define INSN_SDT_IMM ((UINT32) 0x00000fffu) -#define INSN_MUL_A ((UINT32) 0x00200000u) -#define INSN_MUL_RM ((UINT32) 0x0000000fu) -#define INSN_MUL_RS ((UINT32) 0x00000f00u) -#define INSN_MUL_RN ((UINT32) 0x0000f000u) -#define INSN_MUL_RD ((UINT32) 0x000f0000u) -#define INSN_I ((UINT32) 0x02000000u) -#define INSN_OPCODE ((UINT32) 0x01e00000u) -#define INSN_S ((UINT32) 0x00100000u) -#define INSN_BL ((UINT32) 0x01000000u) -#define INSN_BRANCH ((UINT32) 0x00ffffffu) -#define INSN_SWI ((UINT32) 0x00ffffffu) -#define INSN_RN ((UINT32) 0x000f0000u) -#define INSN_RD ((UINT32) 0x0000f000u) -#define INSN_OP2 ((UINT32) 0x00000fffu) -#define INSN_OP2_SHIFT ((UINT32) 0x00000f80u) -#define INSN_OP2_SHIFT_TYPE ((UINT32) 0x00000070u) -#define INSN_OP2_RM ((UINT32) 0x0000000fu) -#define INSN_OP2_ROTATE ((UINT32) 0x00000f00u) -#define INSN_OP2_IMM ((UINT32) 0x000000ffu) +#define INSN_COND ((uint32_t) 0xf0000000u) +#define INSN_SDT_L ((uint32_t) 0x00100000u) +#define INSN_SDT_W ((uint32_t) 0x00200000u) +#define INSN_SDT_B ((uint32_t) 0x00400000u) +#define INSN_SDT_U ((uint32_t) 0x00800000u) +#define INSN_SDT_P ((uint32_t) 0x01000000u) +#define INSN_BDT_L ((uint32_t) 0x00100000u) +#define INSN_BDT_W ((uint32_t) 0x00200000u) +#define INSN_BDT_S ((uint32_t) 0x00400000u) +#define INSN_BDT_U ((uint32_t) 0x00800000u) +#define INSN_BDT_P ((uint32_t) 0x01000000u) +#define INSN_BDT_REGS ((uint32_t) 0x0000ffffu) +#define INSN_SDT_IMM ((uint32_t) 0x00000fffu) +#define INSN_MUL_A ((uint32_t) 0x00200000u) +#define INSN_MUL_RM ((uint32_t) 0x0000000fu) +#define INSN_MUL_RS ((uint32_t) 0x00000f00u) +#define INSN_MUL_RN ((uint32_t) 0x0000f000u) +#define INSN_MUL_RD ((uint32_t) 0x000f0000u) +#define INSN_I ((uint32_t) 0x02000000u) +#define INSN_OPCODE ((uint32_t) 0x01e00000u) +#define INSN_S ((uint32_t) 0x00100000u) +#define INSN_BL ((uint32_t) 0x01000000u) +#define INSN_BRANCH ((uint32_t) 0x00ffffffu) +#define INSN_SWI ((uint32_t) 0x00ffffffu) +#define INSN_RN ((uint32_t) 0x000f0000u) +#define INSN_RD ((uint32_t) 0x0000f000u) +#define INSN_OP2 ((uint32_t) 0x00000fffu) +#define INSN_OP2_SHIFT ((uint32_t) 0x00000f80u) +#define INSN_OP2_SHIFT_TYPE ((uint32_t) 0x00000070u) +#define INSN_OP2_RM ((uint32_t) 0x0000000fu) +#define INSN_OP2_ROTATE ((uint32_t) 0x00000f00u) +#define INSN_OP2_IMM ((uint32_t) 0x000000ffu) #define INSN_OP2_SHIFT_TYPE_SHIFT 4 #define INSN_OP2_SHIFT_SHIFT 7 #define INSN_OP2_ROTATE_SHIFT 8 @@ -228,7 +228,7 @@ const device_type ARM = &device_creator; const device_type ARM_BE = &device_creator; -arm_cpu_device::arm_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arm_cpu_device::arm_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ARM, "ARM", tag, owner, clock, "arm", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 32, 26, 0) , m_endian(ENDIANNESS_LITTLE) @@ -238,7 +238,7 @@ arm_cpu_device::arm_cpu_device(const machine_config &mconfig, const char *tag, d } -arm_cpu_device::arm_cpu_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, endianness_t endianness) +arm_cpu_device::arm_cpu_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, endianness_t endianness) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", endianness, 32, 26, 0) , m_endian(endianness) @@ -248,28 +248,28 @@ arm_cpu_device::arm_cpu_device(const machine_config &mconfig, device_type type, } -arm_be_cpu_device::arm_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arm_be_cpu_device::arm_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm_cpu_device(mconfig, ARM_BE, "ARM (big endian)", tag, owner, clock, "arm be", __FILE__, ENDIANNESS_BIG) { } -void arm_cpu_device::cpu_write32( int addr, UINT32 data ) +void arm_cpu_device::cpu_write32( int addr, uint32_t data ) { /* Unaligned writes are treated as normal writes */ m_program->write_dword(addr&ADDRESS_MASK,data); if (ARM_DEBUG_CORE && !DWORD_ALIGNED(addr)) logerror("%08x: Unaligned write %08x\n",R15,addr); } -void arm_cpu_device::cpu_write8( int addr, UINT8 data ) +void arm_cpu_device::cpu_write8( int addr, uint8_t data ) { m_program->write_byte(addr,data); } -UINT32 arm_cpu_device::cpu_read32( int addr ) +uint32_t arm_cpu_device::cpu_read32( int addr ) { - UINT32 result = m_program->read_dword(addr&ADDRESS_MASK); + uint32_t result = m_program->read_dword(addr&ADDRESS_MASK); /* Unaligned reads rotate the word, they never combine words */ if (!DWORD_ALIGNED(addr)) @@ -288,27 +288,27 @@ UINT32 arm_cpu_device::cpu_read32( int addr ) return result; } -UINT8 arm_cpu_device::cpu_read8( int addr ) +uint8_t arm_cpu_device::cpu_read8( int addr ) { return m_program->read_byte(addr); } -UINT32 arm_cpu_device::GetRegister( int rIndex ) +uint32_t arm_cpu_device::GetRegister( int rIndex ) { return m_sArmRegister[sRegisterTable[MODE][rIndex]]; } -void arm_cpu_device::SetRegister( int rIndex, UINT32 value ) +void arm_cpu_device::SetRegister( int rIndex, uint32_t value ) { m_sArmRegister[sRegisterTable[MODE][rIndex]] = value; } -UINT32 arm_cpu_device::GetModeRegister( int mode, int rIndex ) +uint32_t arm_cpu_device::GetModeRegister( int mode, int rIndex ) { return m_sArmRegister[sRegisterTable[mode][rIndex]]; } -void arm_cpu_device::SetModeRegister( int mode, int rIndex, UINT32 value ) +void arm_cpu_device::SetModeRegister( int mode, int rIndex, uint32_t value ) { m_sArmRegister[sRegisterTable[mode][rIndex]] = value; } @@ -336,8 +336,8 @@ void arm_cpu_device::device_reset() void arm_cpu_device::execute_run() { - UINT32 pc; - UINT32 insn; + uint32_t pc; + uint32_t insn; do { @@ -451,7 +451,7 @@ void arm_cpu_device::execute_run() void arm_cpu_device::arm_check_irq_state() { - UINT32 pc = R15+4; /* save old pc (already incremented in pipeline) */; + uint32_t pc = R15+4; /* save old pc (already incremented in pipeline) */; /* Exception priorities (from ARM6, not specifically ARM2/3): @@ -575,9 +575,9 @@ void arm_cpu_device::state_string_export(const device_state_entry &entry, std::s /***************************************************************************/ -void arm_cpu_device::HandleBranch( UINT32 insn ) +void arm_cpu_device::HandleBranch( uint32_t insn ) { - UINT32 off = (insn & INSN_BRANCH) << 2; + uint32_t off = (insn & INSN_BRANCH) << 2; /* Save PC into LR if this is a branch with link */ if (insn & INSN_BL) @@ -598,9 +598,9 @@ void arm_cpu_device::HandleBranch( UINT32 insn ) } -void arm_cpu_device::HandleMemSingle( UINT32 insn ) +void arm_cpu_device::HandleMemSingle( uint32_t insn ) { - UINT32 rn, rnv, off, rd; + uint32_t rn, rnv, off, rd; /* Fetch the offset */ if (insn & INSN_I) @@ -669,7 +669,7 @@ void arm_cpu_device::HandleMemSingle( UINT32 insn ) { if (ARM_DEBUG_CORE && rd == eR15) logerror("read byte R15 %08x\n", R15); - SetRegister(rd,(UINT32) cpu_read8(rnv) ); + SetRegister(rd,(uint32_t) cpu_read8(rnv) ); } else { @@ -705,7 +705,7 @@ void arm_cpu_device::HandleMemSingle( UINT32 insn ) if (ARM_DEBUG_CORE && rd==eR15) logerror("Wrote R15 in byte mode\n"); - cpu_write8(rnv, (UINT8) GetRegister(rd) & 0xffu); + cpu_write8(rnv, (uint8_t) GetRegister(rd) & 0xffu); } else { @@ -793,10 +793,10 @@ void arm_cpu_device::HandleMemSingle( UINT32 insn ) | (((sc) != 0) << C_BIT)) + 4; \ else R15 += 4; -void arm_cpu_device::HandleALU( UINT32 insn ) +void arm_cpu_device::HandleALU( uint32_t insn ) { - UINT32 op2, sc=0, rd, rn, opcode; - UINT32 by, rdn; + uint32_t op2, sc=0, rd, rn, opcode; + uint32_t by, rdn; opcode = (insn & INSN_OPCODE) >> INSN_OPCODE_SHIFT; m_icount -= S_CYCLE; @@ -958,9 +958,9 @@ void arm_cpu_device::HandleALU( UINT32 insn ) } } -void arm_cpu_device::HandleMul( UINT32 insn) +void arm_cpu_device::HandleMul( uint32_t insn) { - UINT32 r; + uint32_t r; m_icount -= S_CYCLE + I_CYCLE; /* should be: @@ -1011,7 +1011,7 @@ void arm_cpu_device::HandleMul( UINT32 insn) } -int arm_cpu_device::loadInc(UINT32 pat, UINT32 rbv, UINT32 s) +int arm_cpu_device::loadInc(uint32_t pat, uint32_t rbv, uint32_t s) { int i,result; @@ -1037,7 +1037,7 @@ int arm_cpu_device::loadInc(UINT32 pat, UINT32 rbv, UINT32 s) } -int arm_cpu_device::loadDec(UINT32 pat, UINT32 rbv, UINT32 s, UINT32* deferredR15, int* defer) +int arm_cpu_device::loadDec(uint32_t pat, uint32_t rbv, uint32_t s, uint32_t* deferredR15, int* defer) { int i,result; @@ -1063,7 +1063,7 @@ int arm_cpu_device::loadDec(UINT32 pat, UINT32 rbv, UINT32 s, UINT32* deferredR1 } -int arm_cpu_device::storeInc(UINT32 pat, UINT32 rbv) +int arm_cpu_device::storeInc(uint32_t pat, uint32_t rbv) { int i,result; @@ -1083,7 +1083,7 @@ int arm_cpu_device::storeInc(UINT32 pat, UINT32 rbv) } /* storeInc */ -int arm_cpu_device::storeDec(UINT32 pat, UINT32 rbv) +int arm_cpu_device::storeDec(uint32_t pat, uint32_t rbv) { int i,result; @@ -1103,10 +1103,10 @@ int arm_cpu_device::storeDec(UINT32 pat, UINT32 rbv) } /* storeDec */ -void arm_cpu_device::HandleMemBlock( UINT32 insn ) +void arm_cpu_device::HandleMemBlock( uint32_t insn ) { - UINT32 rb = (insn & INSN_RN) >> INSN_RN_SHIFT; - UINT32 rbp = GetRegister(rb); + uint32_t rb = (insn & INSN_RN) >> INSN_RN_SHIFT; + uint32_t rbp = GetRegister(rb); int result; if (ARM_DEBUG_CORE && insn & INSN_BDT_S) @@ -1154,7 +1154,7 @@ void arm_cpu_device::HandleMemBlock( UINT32 insn ) } else { - UINT32 deferredR15=0; + uint32_t deferredR15=0; int defer=0; /* Decrementing */ @@ -1242,11 +1242,11 @@ void arm_cpu_device::HandleMemBlock( UINT32 insn ) * shifter carry output will manifest itself as @*carry == 0@ for carry clear * and @*carry != 0@ for carry set. */ -UINT32 arm_cpu_device::decodeShift(UINT32 insn, UINT32 *pCarry) +uint32_t arm_cpu_device::decodeShift(uint32_t insn, uint32_t *pCarry) { - UINT32 k = (insn & INSN_OP2_SHIFT) >> INSN_OP2_SHIFT_SHIFT; - UINT32 rm = GetRegister( insn & INSN_OP2_RM ); - UINT32 t = (insn & INSN_OP2_SHIFT_TYPE) >> INSN_OP2_SHIFT_TYPE_SHIFT; + uint32_t k = (insn & INSN_OP2_SHIFT) >> INSN_OP2_SHIFT_SHIFT; + uint32_t rm = GetRegister( insn & INSN_OP2_RM ); + uint32_t t = (insn & INSN_OP2_SHIFT_TYPE) >> INSN_OP2_SHIFT_TYPE_SHIFT; if ((insn & INSN_OP2_RM)==0xf) { @@ -1332,10 +1332,10 @@ UINT32 arm_cpu_device::decodeShift(UINT32 insn, UINT32 *pCarry) } /* decodeShift */ -UINT32 arm_cpu_device::BCDToDecimal(UINT32 value) +uint32_t arm_cpu_device::BCDToDecimal(uint32_t value) { - UINT32 accumulator = 0; - UINT32 multiplier = 1; + uint32_t accumulator = 0; + uint32_t multiplier = 1; int i; for(i = 0; i < 8; i++) @@ -1350,15 +1350,15 @@ UINT32 arm_cpu_device::BCDToDecimal(UINT32 value) } -UINT32 arm_cpu_device::DecimalToBCD(UINT32 value) +uint32_t arm_cpu_device::DecimalToBCD(uint32_t value) { - UINT32 accumulator = 0; - UINT32 divisor = 10; + uint32_t accumulator = 0; + uint32_t divisor = 10; int i; for(i = 0; i < 8; i++) { - UINT32 temp; + uint32_t temp; temp = value % divisor; value -= temp; @@ -1372,10 +1372,10 @@ UINT32 arm_cpu_device::DecimalToBCD(UINT32 value) return accumulator; } -void arm_cpu_device::HandleCoProVL86C020( UINT32 insn ) +void arm_cpu_device::HandleCoProVL86C020( uint32_t insn ) { - UINT32 rn=(insn>>12)&0xf; - UINT32 crn=(insn>>16)&0xf; + uint32_t rn=(insn>>12)&0xf; + uint32_t crn=(insn>>16)&0xf; m_icount -= S_CYCLE; @@ -1412,10 +1412,10 @@ void arm_cpu_device::HandleCoProVL86C020( UINT32 insn ) } } -void arm_cpu_device::HandleCoPro( UINT32 insn ) +void arm_cpu_device::HandleCoPro( uint32_t insn ) { - UINT32 rn=(insn>>12)&0xf; - UINT32 crn=(insn>>16)&0xf; + uint32_t rn=(insn>>12)&0xf; + uint32_t crn=(insn>>16)&0xf; m_icount -= S_CYCLE; @@ -1506,14 +1506,14 @@ void arm_cpu_device::HandleCoPro( UINT32 insn ) } -offs_t arm_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t arm_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( arm ); return CPU_DISASSEMBLE_NAME(arm)(this, buffer, pc, oprom, opram, options); } -offs_t arm_be_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t arm_be_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( arm_be ); return CPU_DISASSEMBLE_NAME(arm_be)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/arm/arm.h b/src/devices/cpu/arm/arm.h index d2f6156127b..051c88f64b9 100644 --- a/src/devices/cpu/arm/arm.h +++ b/src/devices/cpu/arm/arm.h @@ -40,8 +40,8 @@ class arm_cpu_device : public cpu_device { public: // construction/destruction - arm_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - arm_cpu_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, endianness_t endianness); + arm_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + arm_cpu_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, endianness_t endianness); static void set_copro_type(device_t &device, int type) { downcast(device).m_copro_type = type; } @@ -51,9 +51,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 3; } - virtual UINT32 execute_max_cycles() const override { return 4; } - virtual UINT32 execute_input_lines() const override { return 2; } + virtual uint32_t execute_min_cycles() const override { return 3; } + virtual uint32_t execute_max_cycles() const override { return 4; } + virtual uint32_t execute_input_lines() const override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -64,45 +64,45 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; int m_icount; - UINT32 m_sArmRegister[27]; - UINT32 m_coproRegister[16]; - UINT8 m_pendingIrq; - UINT8 m_pendingFiq; + uint32_t m_sArmRegister[27]; + uint32_t m_coproRegister[16]; + uint8_t m_pendingIrq; + uint8_t m_pendingFiq; address_space *m_program; direct_read_data *m_direct; endianness_t m_endian; - UINT8 m_copro_type; - - void cpu_write32( int addr, UINT32 data ); - void cpu_write8( int addr, UINT8 data ); - UINT32 cpu_read32( int addr ); - UINT8 cpu_read8( int addr ); - UINT32 GetRegister( int rIndex ); - void SetRegister( int rIndex, UINT32 value ); - UINT32 GetModeRegister( int mode, int rIndex ); - void SetModeRegister( int mode, int rIndex, UINT32 value ); - void HandleALU(UINT32 insn); - void HandleMul(UINT32 insn); - void HandleBranch(UINT32 insn); - void HandleMemSingle(UINT32 insn); - void HandleMemBlock(UINT32 insn); - void HandleCoPro(UINT32 insn); - void HandleCoProVL86C020(UINT32 insn); - UINT32 decodeShift(UINT32 insn, UINT32 *pCarry); + uint8_t m_copro_type; + + void cpu_write32( int addr, uint32_t data ); + void cpu_write8( int addr, uint8_t data ); + uint32_t cpu_read32( int addr ); + uint8_t cpu_read8( int addr ); + uint32_t GetRegister( int rIndex ); + void SetRegister( int rIndex, uint32_t value ); + uint32_t GetModeRegister( int mode, int rIndex ); + void SetModeRegister( int mode, int rIndex, uint32_t value ); + void HandleALU(uint32_t insn); + void HandleMul(uint32_t insn); + void HandleBranch(uint32_t insn); + void HandleMemSingle(uint32_t insn); + void HandleMemBlock(uint32_t insn); + void HandleCoPro(uint32_t insn); + void HandleCoProVL86C020(uint32_t insn); + uint32_t decodeShift(uint32_t insn, uint32_t *pCarry); void arm_check_irq_state(); - int loadInc(UINT32 pat, UINT32 rbv, UINT32 s); - int loadDec(UINT32 pat, UINT32 rbv, UINT32 s, UINT32* deferredR15, int* defer); - int storeInc(UINT32 pat, UINT32 rbv); - int storeDec(UINT32 pat, UINT32 rbv); - static UINT32 BCDToDecimal(UINT32 value); - static UINT32 DecimalToBCD(UINT32 value); + int loadInc(uint32_t pat, uint32_t rbv, uint32_t s); + int loadDec(uint32_t pat, uint32_t rbv, uint32_t s, uint32_t* deferredR15, int* defer); + int storeInc(uint32_t pat, uint32_t rbv); + int storeDec(uint32_t pat, uint32_t rbv); + static uint32_t BCDToDecimal(uint32_t value); + static uint32_t DecimalToBCD(uint32_t value); }; @@ -110,10 +110,10 @@ class arm_be_cpu_device : public arm_cpu_device { public: // construction/destruction - arm_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arm_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; diff --git a/src/devices/cpu/arm/armdasm.cpp b/src/devices/cpu/arm/armdasm.cpp index 83860b22aff..08a0b282afe 100644 --- a/src/devices/cpu/arm/armdasm.cpp +++ b/src/devices/cpu/arm/armdasm.cpp @@ -9,10 +9,10 @@ #include "emu.h" #include "arm.h" -static char *WriteImmediateOperand( char *pBuf, UINT32 opcode ) +static char *WriteImmediateOperand( char *pBuf, uint32_t opcode ) { /* rrrrbbbbbbbb */ - UINT32 imm; + uint32_t imm; int r; imm = opcode&0xff; @@ -22,7 +22,7 @@ static char *WriteImmediateOperand( char *pBuf, UINT32 opcode ) return pBuf; } -static char *WriteDataProcessingOperand( char *pBuf, UINT32 opcode, int printOp0, int printOp1, int printOp2 ) +static char *WriteDataProcessingOperand( char *pBuf, uint32_t opcode, int printOp0, int printOp1, int printOp2 ) { /* ccccctttmmmm */ static const char *const pRegOp[4] = { "LSL","LSR","ASR","ROR" }; @@ -55,7 +55,7 @@ static char *WriteDataProcessingOperand( char *pBuf, UINT32 opcode, int printOp0 return pBuf; } -static char *WriteRegisterOperand1( char *pBuf, UINT32 opcode ) +static char *WriteRegisterOperand1( char *pBuf, uint32_t opcode ) { /* ccccctttmmmm */ static const char *const pRegOp[4] = { "LSL","LSR","ASR","ROR" }; @@ -80,7 +80,7 @@ static char *WriteRegisterOperand1( char *pBuf, UINT32 opcode ) } /* WriteRegisterOperand */ -static char *WriteBranchAddress( char *pBuf, UINT32 pc, UINT32 opcode ) +static char *WriteBranchAddress( char *pBuf, uint32_t pc, uint32_t opcode ) { opcode &= 0x00ffffff; if( opcode&0x00800000 ) @@ -102,7 +102,7 @@ static char *WritePadding( char *pBuf, const char *pBuf0 ) return pBuf; } -static UINT32 arm_disasm( char *pBuf, UINT32 pc, UINT32 opcode ) +static uint32_t arm_disasm( char *pBuf, uint32_t pc, uint32_t opcode ) { const char *pBuf0; @@ -121,7 +121,7 @@ static UINT32 arm_disasm( char *pBuf, UINT32 pc, UINT32 opcode ) "ORR","MOV","BIC","MVN" }; const char *pConditionCode; - UINT32 dasmflags = 0; + uint32_t dasmflags = 0; pConditionCode= pConditionCodeTable[opcode>>28]; pBuf0 = pBuf; @@ -397,12 +397,12 @@ static UINT32 arm_disasm( char *pBuf, UINT32 pc, UINT32 opcode ) CPU_DISASSEMBLE( arm ) { - UINT32 opcode = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); + uint32_t opcode = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); return 4 | arm_disasm(buffer, pc, opcode); } CPU_DISASSEMBLE( arm_be ) { - UINT32 opcode = oprom[3] | (oprom[2] << 8) | (oprom[1] << 16) | (oprom[0] << 24); + uint32_t opcode = oprom[3] | (oprom[2] << 8) | (oprom[1] << 16) | (oprom[0] << 24); return 4 | arm_disasm(buffer, pc, opcode); } diff --git a/src/devices/cpu/arm7/arm7.cpp b/src/devices/cpu/arm7/arm7.cpp index 952ddc46c73..5a3dd15be17 100644 --- a/src/devices/cpu/arm7/arm7.cpp +++ b/src/devices/cpu/arm7/arm7.cpp @@ -37,12 +37,12 @@ TODO: /* prototypes of coprocessor functions */ -void arm7_dt_r_callback(arm_state *arm, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *arm, UINT32 addr)); -void arm7_dt_w_callback(arm_state *arm, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *arm, UINT32 addr, UINT32 data)); +void arm7_dt_r_callback(arm_state *arm, uint32_t insn, uint32_t *prn, uint32_t (*read32)(arm_state *arm, uint32_t addr)); +void arm7_dt_w_callback(arm_state *arm, uint32_t insn, uint32_t *prn, void (*write32)(arm_state *arm, uint32_t addr, uint32_t data)); // holder for the co processor Data Transfer Read & Write Callback funcs -void (*arm7_coproc_dt_r_callback)(arm_state *arm, UINT32 insn, UINT32 *prn, UINT32 (*read32)(arm_state *arm, UINT32 addr)); -void (*arm7_coproc_dt_w_callback)(arm_state *arm, UINT32 insn, UINT32 *prn, void (*write32)(arm_state *arm, UINT32 addr, UINT32 data)); +void (*arm7_coproc_dt_r_callback)(arm_state *arm, uint32_t insn, uint32_t *prn, uint32_t (*read32)(arm_state *arm, uint32_t addr)); +void (*arm7_coproc_dt_w_callback)(arm_state *arm, uint32_t insn, uint32_t *prn, void (*write32)(arm_state *arm, uint32_t addr, uint32_t data)); const device_type ARM7 = &device_creator; @@ -54,7 +54,7 @@ const device_type PXA255 = &device_creator; const device_type SA1110 = &device_creator; -arm7_cpu_device::arm7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arm7_cpu_device::arm7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ARM7, "ARM7", tag, owner, clock, "arm7", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0) , m_endian(ENDIANNESS_LITTLE) @@ -67,7 +67,7 @@ arm7_cpu_device::arm7_cpu_device(const machine_config &mconfig, const char *tag, } -arm7_cpu_device::arm7_cpu_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, UINT8 archRev, UINT8 archFlags, endianness_t endianness) +arm7_cpu_device::arm7_cpu_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, uint8_t archRev, uint8_t archFlags, endianness_t endianness) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", endianness, 32, 32, 0) , m_endian(endianness) @@ -80,20 +80,20 @@ arm7_cpu_device::arm7_cpu_device(const machine_config &mconfig, device_type type } -arm7_be_cpu_device::arm7_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arm7_be_cpu_device::arm7_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, ARM7_BE, "ARM7 (big endian)", tag, owner, clock, "arm7_be", __FILE__, 4, eARM_ARCHFLAGS_T, ENDIANNESS_BIG) { } -arm7500_cpu_device::arm7500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arm7500_cpu_device::arm7500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, ARM7500, "ARM7500", tag, owner, clock, "arm7500", __FILE__, 3, eARM_ARCHFLAGS_MODE26) { m_copro_id = (0x41 << 24) | (0 << 20) | (1 << 16) | (0x710 << 4) | (0 << 0); } -arm9_cpu_device::arm9_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arm9_cpu_device::arm9_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, ARM9, "ARM9", tag, owner, clock, "arm9", __FILE__, 5, eARM_ARCHFLAGS_T | eARM_ARCHFLAGS_E) // ARMv5 // has TE extensions @@ -101,7 +101,7 @@ arm9_cpu_device::arm9_cpu_device(const machine_config &mconfig, const char *tag, } -arm920t_cpu_device::arm920t_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arm920t_cpu_device::arm920t_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, ARM920T, "ARM920T", tag, owner, clock, "arm920t", __FILE__, 4, eARM_ARCHFLAGS_T) // ARMv4 // has T extension @@ -110,7 +110,7 @@ arm920t_cpu_device::arm920t_cpu_device(const machine_config &mconfig, const char } -pxa255_cpu_device::pxa255_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pxa255_cpu_device::pxa255_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, PXA255, "PXA255", tag, owner, clock, "pxa255", __FILE__, 5, eARM_ARCHFLAGS_T | eARM_ARCHFLAGS_E | eARM_ARCHFLAGS_XSCALE) // ARMv5 // has TE and XScale extensions @@ -118,7 +118,7 @@ pxa255_cpu_device::pxa255_cpu_device(const machine_config &mconfig, const char * } -sa1110_cpu_device::sa1110_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sa1110_cpu_device::sa1110_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, SA1110, "SA1110", tag, owner, clock, "sa1110", __FILE__, 4, eARM_ARCHFLAGS_SA) // ARMv4 // has StrongARM, no Thumb, no Enhanced DSP @@ -130,9 +130,9 @@ void arm7_cpu_device::update_reg_ptr() m_reg_group = sRegisterTable[GET_MODE]; } -void arm7_cpu_device::set_cpsr(UINT32 val) +void arm7_cpu_device::set_cpsr(uint32_t val) { - UINT8 old_mode = GET_CPSR & MODE_FLAG; + uint8_t old_mode = GET_CPSR & MODE_FLAG; if (m_archFlags & eARM_ARCHFLAGS_MODE26) { if ((val & 0x10) != (m_r[eCPSR] & 0x10)) @@ -189,9 +189,9 @@ enum // COARSE, desc_level1, vaddr -UINT32 arm7_cpu_device::arm7_tlb_get_second_level_descriptor( UINT32 granularity, UINT32 first_desc, UINT32 vaddr ) +uint32_t arm7_cpu_device::arm7_tlb_get_second_level_descriptor( uint32_t granularity, uint32_t first_desc, uint32_t vaddr ) { - UINT32 desc_lvl2 = vaddr; + uint32_t desc_lvl2 = vaddr; switch( granularity ) { @@ -294,7 +294,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags) addr += m_pid_offset; } - UINT32 desc_lvl1 = m_program->read_dword(m_tlb_base_mask | ((addr & COPRO_TLB_VADDR_FLTI_MASK) >> COPRO_TLB_VADDR_FLTI_MASK_SHIFT)); + uint32_t desc_lvl1 = m_program->read_dword(m_tlb_base_mask | ((addr & COPRO_TLB_VADDR_FLTI_MASK) >> COPRO_TLB_VADDR_FLTI_MASK_SHIFT)); #if ARM7_MMU_ENABLE_HACK if ((m_r[eR15] == (m_mmu_enable_addr + 4)) || (m_r[eR15] == (m_mmu_enable_addr + 8))) @@ -308,7 +308,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags) } #endif - UINT8 tlb_type = desc_lvl1 & 3; + uint8_t tlb_type = desc_lvl1 & 3; if (tlb_type == COPRO_TLB_SECTION_TABLE) { // Entry is a section @@ -321,7 +321,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags) { if (flags & ARM7_TLB_ABORT_D) { - UINT8 domain = (desc_lvl1 >> 5) & 0xF; + uint8_t domain = (desc_lvl1 >> 5) & 0xF; LOG( ( "ARM7: Section Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15] ) ); m_faultStatus[0] = ((fault == FAULT_DOMAIN) ? (9 << 0) : (13 << 0)) | (domain << 4); // 9 = section domain fault, 13 = section permission fault m_faultAddress = addr; @@ -358,11 +358,11 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags) else { // Entry is the physical address of a coarse second-level table - UINT8 permission = (m_domainAccessControl >> ((desc_lvl1 >> 4) & 0x1e)) & 3; - UINT32 desc_lvl2 = arm7_tlb_get_second_level_descriptor( (desc_lvl1 & 3) == COPRO_TLB_COARSE_TABLE ? TLB_COARSE : TLB_FINE, desc_lvl1, addr ); + uint8_t permission = (m_domainAccessControl >> ((desc_lvl1 >> 4) & 0x1e)) & 3; + uint32_t desc_lvl2 = arm7_tlb_get_second_level_descriptor( (desc_lvl1 & 3) == COPRO_TLB_COARSE_TABLE ? TLB_COARSE : TLB_FINE, desc_lvl1, addr ); if ((permission != 1) && (permission != 3)) { - UINT8 domain = (desc_lvl1 >> 5) & 0xF; + uint8_t domain = (desc_lvl1 >> 5) & 0xF; fatalerror("ARM7: Not Yet Implemented: Coarse Table, Section Domain fault on virtual address, vaddr = %08x, domain = %08x, PC = %08x\n", addr, domain, m_r[eR15]); } @@ -372,7 +372,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags) // Unmapped, generate a translation fault if (flags & ARM7_TLB_ABORT_D) { - UINT8 domain = (desc_lvl1 >> 5) & 0xF; + uint8_t domain = (desc_lvl1 >> 5) & 0xF; LOG( ( "ARM7: Translation fault on unmapped virtual address, vaddr = %08x, PC %08X\n", addr, m_r[eR15] ) ); m_faultStatus[0] = (7 << 0) | (domain << 4); // 7 = page translation fault m_faultAddress = addr; @@ -391,7 +391,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags) case COPRO_TLB_SMALL_PAGE: // Small page descriptor { - UINT8 ap = ((((desc_lvl2 >> 4) & 0xFF) >> (((addr >> 10) & 3) << 1)) & 3); + uint8_t ap = ((((desc_lvl2 >> 4) & 0xFF) >> (((addr >> 10) & 3) << 1)) & 3); int fault = detect_fault(desc_lvl1, ap, flags); if (fault == FAULT_NONE) { @@ -401,7 +401,7 @@ bool arm7_cpu_device::arm7_tlb_translate(offs_t &addr, int flags) { if (flags & ARM7_TLB_ABORT_D) { - UINT8 domain = (desc_lvl1 >> 5) & 0xF; + uint8_t domain = (desc_lvl1 >> 5) & 0xF; // hapyfish expects a data abort when something tries to write to a read-only memory location from user mode LOG( ( "ARM7: Page Table, Section %s fault on virtual address, vaddr = %08x, PC = %08x\n", (fault == FAULT_DOMAIN) ? "domain" : "permission", addr, m_r[eR15] ) ); m_faultStatus[0] = ((fault == FAULT_DOMAIN) ? (11 << 0) : (15 << 0)) | (domain << 4); // 11 = page domain fault, 15 = page permission fault @@ -571,7 +571,7 @@ void arm7_cpu_device::device_reset() m_fcsePID = 0; m_pid_offset = 0; m_domainAccessControl = 0; - memset(m_decoded_access_control, 0, sizeof(UINT8) * 16); + memset(m_decoded_access_control, 0, sizeof(uint8_t) * 16); /* start up in SVC mode with interrupts disabled. */ m_r[eCPSR] = I_MASK | F_MASK | 0x10; @@ -588,11 +588,11 @@ void arm7_cpu_device::device_reset() void arm7_cpu_device::execute_run() { - UINT32 insn; + uint32_t insn; do { - UINT32 pc = GET_PC; + uint32_t pc = GET_PC; debugger_instruction_hook(this, pc); @@ -638,7 +638,7 @@ void arm7_cpu_device::execute_run() #if 0 if (MODE26) { - UINT32 temp1, temp2; + uint32_t temp1, temp2; temp1 = GET_CPSR & 0xF00000C3; temp2 = (R15 & 0xF0000000) | ((R15 & 0x0C000000) >> (26 - 6)) | (R15 & 0x00000003); if (temp1 != temp2) fatalerror( "%08X: 32-bit and 26-bit modes are out of sync (%08X %08X)\n", pc, temp1, temp2); @@ -756,7 +756,7 @@ void arm7_cpu_device::execute_set_input(int irqline, int state) } -offs_t arm7_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t arm7_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( arm7arm ); extern CPU_DISASSEMBLE( arm7thumb ); @@ -789,12 +789,12 @@ WRITE32_MEMBER( arm7_cpu_device::arm7_do_callback ) READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback ) { - UINT32 opcode = offset; - UINT8 cReg = ( opcode & INSN_COPRO_CREG ) >> INSN_COPRO_CREG_SHIFT; - UINT8 op2 = ( opcode & INSN_COPRO_OP2 ) >> INSN_COPRO_OP2_SHIFT; - UINT8 op3 = opcode & INSN_COPRO_OP3; - UINT8 cpnum = (opcode & INSN_COPRO_CPNUM) >> INSN_COPRO_CPNUM_SHIFT; - UINT32 data = 0; + uint32_t opcode = offset; + uint8_t cReg = ( opcode & INSN_COPRO_CREG ) >> INSN_COPRO_CREG_SHIFT; + uint8_t op2 = ( opcode & INSN_COPRO_OP2 ) >> INSN_COPRO_OP2_SHIFT; + uint8_t op3 = opcode & INSN_COPRO_OP3; + uint8_t cpnum = (opcode & INSN_COPRO_CPNUM) >> INSN_COPRO_CPNUM_SHIFT; + uint32_t data = 0; // printf("cpnum %d cReg %d op2 %d op3 %d (%x)\n", cpnum, cReg, op2, op3, GET_REGISTER(arm, 15)); @@ -809,7 +809,7 @@ READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback ) switch( cReg ) { case 1: // clock counter - data = (UINT32)total_cycles(); + data = (uint32_t)total_cycles(); break; default: @@ -952,11 +952,11 @@ READ32_MEMBER( arm7_cpu_device::arm7_rt_r_callback ) WRITE32_MEMBER( arm7_cpu_device::arm7_rt_w_callback ) { - UINT32 opcode = offset; - UINT8 cReg = ( opcode & INSN_COPRO_CREG ) >> INSN_COPRO_CREG_SHIFT; - UINT8 op2 = ( opcode & INSN_COPRO_OP2 ) >> INSN_COPRO_OP2_SHIFT; - UINT8 op3 = opcode & INSN_COPRO_OP3; - UINT8 cpnum = (opcode & INSN_COPRO_CPNUM) >> INSN_COPRO_CPNUM_SHIFT; + uint32_t opcode = offset; + uint8_t cReg = ( opcode & INSN_COPRO_CREG ) >> INSN_COPRO_CREG_SHIFT; + uint8_t op2 = ( opcode & INSN_COPRO_OP2 ) >> INSN_COPRO_OP2_SHIFT; + uint8_t op3 = opcode & INSN_COPRO_OP3; + uint8_t cpnum = (opcode & INSN_COPRO_CPNUM) >> INSN_COPRO_CPNUM_SHIFT; // handle XScale specific CP14 - just eat writes for now if (cpnum != 15) @@ -1060,9 +1060,9 @@ WRITE32_MEMBER( arm7_cpu_device::arm7_rt_w_callback ) } -void arm7_cpu_device::arm7_dt_r_callback(UINT32 insn, UINT32 *prn) +void arm7_cpu_device::arm7_dt_r_callback(uint32_t insn, uint32_t *prn) { - UINT8 cpn = (insn >> 8) & 0xF; + uint8_t cpn = (insn >> 8) & 0xF; if ((m_archFlags & eARM_ARCHFLAGS_XSCALE) && (cpn == 0)) { LOG( ( "arm7_dt_r_callback: DSP Coprocessor 0 (CP0) not yet emulated (PC %08x)\n", GET_PC ) ); @@ -1074,9 +1074,9 @@ void arm7_cpu_device::arm7_dt_r_callback(UINT32 insn, UINT32 *prn) } -void arm7_cpu_device::arm7_dt_w_callback(UINT32 insn, UINT32 *prn) +void arm7_cpu_device::arm7_dt_w_callback(uint32_t insn, uint32_t *prn) { - UINT8 cpn = (insn >> 8) & 0xF; + uint8_t cpn = (insn >> 8) & 0xF; if ((m_archFlags & eARM_ARCHFLAGS_XSCALE) && (cpn == 0)) { LOG( ( "arm7_dt_w_callback: DSP Coprocessor 0 (CP0) not yet emulated (PC %08x)\n", GET_PC ) ); @@ -1091,7 +1091,7 @@ void arm7_cpu_device::arm7_dt_w_callback(UINT32 insn, UINT32 *prn) /*************************************************************************** * Default Memory Handlers ***************************************************************************/ -void arm7_cpu_device::arm7_cpu_write32(UINT32 addr, UINT32 data) +void arm7_cpu_device::arm7_cpu_write32(uint32_t addr, uint32_t data) { if( COPRO_CTRL & COPRO_CTRL_MMU_EN ) { @@ -1106,7 +1106,7 @@ void arm7_cpu_device::arm7_cpu_write32(UINT32 addr, UINT32 data) } -void arm7_cpu_device::arm7_cpu_write16(UINT32 addr, UINT16 data) +void arm7_cpu_device::arm7_cpu_write16(uint32_t addr, uint16_t data) { if( COPRO_CTRL & COPRO_CTRL_MMU_EN ) { @@ -1120,7 +1120,7 @@ void arm7_cpu_device::arm7_cpu_write16(UINT32 addr, UINT16 data) m_program->write_word(addr, data); } -void arm7_cpu_device::arm7_cpu_write8(UINT32 addr, UINT8 data) +void arm7_cpu_device::arm7_cpu_write8(uint32_t addr, uint8_t data) { if( COPRO_CTRL & COPRO_CTRL_MMU_EN ) { @@ -1133,9 +1133,9 @@ void arm7_cpu_device::arm7_cpu_write8(UINT32 addr, UINT8 data) m_program->write_byte(addr, data); } -UINT32 arm7_cpu_device::arm7_cpu_read32(UINT32 addr) +uint32_t arm7_cpu_device::arm7_cpu_read32(uint32_t addr) { - UINT32 result; + uint32_t result; if( COPRO_CTRL & COPRO_CTRL_MMU_EN ) { @@ -1158,9 +1158,9 @@ UINT32 arm7_cpu_device::arm7_cpu_read32(UINT32 addr) return result; } -UINT16 arm7_cpu_device::arm7_cpu_read16(UINT32 addr) +uint16_t arm7_cpu_device::arm7_cpu_read16(uint32_t addr) { - UINT16 result; + uint16_t result; if( COPRO_CTRL & COPRO_CTRL_MMU_EN ) { @@ -1180,7 +1180,7 @@ UINT16 arm7_cpu_device::arm7_cpu_read16(UINT32 addr) return result; } -UINT8 arm7_cpu_device::arm7_cpu_read8(UINT32 addr) +uint8_t arm7_cpu_device::arm7_cpu_read8(uint32_t addr) { if( COPRO_CTRL & COPRO_CTRL_MMU_EN ) { diff --git a/src/devices/cpu/arm7/arm7.h b/src/devices/cpu/arm7/arm7.h index 27615a7dbb1..94b0f9cff4e 100644 --- a/src/devices/cpu/arm7/arm7.h +++ b/src/devices/cpu/arm7/arm7.h @@ -50,8 +50,8 @@ class arm7_cpu_device : public cpu_device { public: // construction/destruction - arm7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - arm7_cpu_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, UINT8 archRev, UINT8 archFlags, endianness_t endianness = ENDIANNESS_LITTLE); + arm7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + arm7_cpu_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, uint8_t archRev, uint8_t archFlags, endianness_t endianness = ENDIANNESS_LITTLE); protected: // device-level overrides @@ -59,9 +59,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 3; } - virtual UINT32 execute_max_cycles() const override { return 4; } - virtual UINT32 execute_input_lines() const override { return 4; } /* There are actually only 2 input lines: we use 3 variants of the ABORT line while there is only 1 real one */ + virtual uint32_t execute_min_cycles() const override { return 3; } + virtual uint32_t execute_max_cycles() const override { return 4; } + virtual uint32_t execute_input_lines() const override { return 4; } /* There are actually only 2 input lines: we use 3 variants of the ABORT line while there is only 1 real one */ virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -74,13 +74,13 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; - UINT32 m_r[/*NUM_REGS*/37]; + uint32_t m_r[/*NUM_REGS*/37]; bool m_pendingIrq; bool m_pendingFiq; bool m_pendingAbtD; @@ -94,180 +94,180 @@ protected: direct_read_data *m_direct; /* Coprocessor Registers */ - UINT32 m_control; - UINT32 m_tlbBase; - UINT32 m_tlb_base_mask; - UINT32 m_faultStatus[2]; - UINT32 m_faultAddress; - UINT32 m_fcsePID; - UINT32 m_pid_offset; - UINT32 m_domainAccessControl; - UINT8 m_decoded_access_control[16]; - - UINT8 m_archRev; // ARM architecture revision (3, 4, and 5 are valid) - UINT8 m_archFlags; // architecture flags + uint32_t m_control; + uint32_t m_tlbBase; + uint32_t m_tlb_base_mask; + uint32_t m_faultStatus[2]; + uint32_t m_faultAddress; + uint32_t m_fcsePID; + uint32_t m_pid_offset; + uint32_t m_domainAccessControl; + uint8_t m_decoded_access_control[16]; + + uint8_t m_archRev; // ARM architecture revision (3, 4, and 5 are valid) + uint8_t m_archFlags; // architecture flags //#if ARM7_MMU_ENABLE_HACK -// UINT32 mmu_enable_addr; // workaround for "MMU is enabled when PA != VA" problem +// uint32_t mmu_enable_addr; // workaround for "MMU is enabled when PA != VA" problem //#endif - UINT32 m_copro_id; + uint32_t m_copro_id; // For debugger - UINT32 m_pc; - - INT64 saturate_qbit_overflow(INT64 res); - void SwitchMode(UINT32 cpsr_mode_val); - UINT32 decodeShift(UINT32 insn, UINT32 *pCarry); - int loadInc(UINT32 pat, UINT32 rbv, UINT32 s, int mode); - int loadDec(UINT32 pat, UINT32 rbv, UINT32 s, int mode); - int storeInc(UINT32 pat, UINT32 rbv, int mode); - int storeDec(UINT32 pat, UINT32 rbv, int mode); - void HandleCoProcDO(UINT32 insn); - void HandleCoProcRT(UINT32 insn); - void HandleCoProcDT(UINT32 insn); - void HandleBranch(UINT32 insn); - void HandleMemSingle(UINT32 insn); - void HandleHalfWordDT(UINT32 insn); - void HandleSwap(UINT32 insn); - void HandlePSRTransfer(UINT32 insn); - void HandleALU(UINT32 insn); - void HandleMul(UINT32 insn); - void HandleSMulLong(UINT32 insn); - void HandleUMulLong(UINT32 insn); - void HandleMemBlock(UINT32 insn); - void arm7ops_0123(UINT32 insn); - void arm7ops_4567(UINT32 insn); - void arm7ops_89(UINT32 insn); - void arm7ops_ab(UINT32 insn); - void arm7ops_cd(UINT32 insn); - void arm7ops_e(UINT32 insn); - void arm7ops_f(UINT32 insn); - void set_cpsr(UINT32 val); + uint32_t m_pc; + + int64_t saturate_qbit_overflow(int64_t res); + void SwitchMode(uint32_t cpsr_mode_val); + uint32_t decodeShift(uint32_t insn, uint32_t *pCarry); + int loadInc(uint32_t pat, uint32_t rbv, uint32_t s, int mode); + int loadDec(uint32_t pat, uint32_t rbv, uint32_t s, int mode); + int storeInc(uint32_t pat, uint32_t rbv, int mode); + int storeDec(uint32_t pat, uint32_t rbv, int mode); + void HandleCoProcDO(uint32_t insn); + void HandleCoProcRT(uint32_t insn); + void HandleCoProcDT(uint32_t insn); + void HandleBranch(uint32_t insn); + void HandleMemSingle(uint32_t insn); + void HandleHalfWordDT(uint32_t insn); + void HandleSwap(uint32_t insn); + void HandlePSRTransfer(uint32_t insn); + void HandleALU(uint32_t insn); + void HandleMul(uint32_t insn); + void HandleSMulLong(uint32_t insn); + void HandleUMulLong(uint32_t insn); + void HandleMemBlock(uint32_t insn); + void arm7ops_0123(uint32_t insn); + void arm7ops_4567(uint32_t insn); + void arm7ops_89(uint32_t insn); + void arm7ops_ab(uint32_t insn); + void arm7ops_cd(uint32_t insn); + void arm7ops_e(uint32_t insn); + void arm7ops_f(uint32_t insn); + void set_cpsr(uint32_t val); bool arm7_tlb_translate(offs_t &addr, int flags); - UINT32 arm7_tlb_get_second_level_descriptor( UINT32 granularity, UINT32 first_desc, UINT32 vaddr ); + uint32_t arm7_tlb_get_second_level_descriptor( uint32_t granularity, uint32_t first_desc, uint32_t vaddr ); int detect_fault(int desc_lvl1, int ap, int flags); void arm7_check_irq_state(); void update_irq_state(); - void arm7_cpu_write32(UINT32 addr, UINT32 data); - void arm7_cpu_write16(UINT32 addr, UINT16 data); - void arm7_cpu_write8(UINT32 addr, UINT8 data); - UINT32 arm7_cpu_read32(UINT32 addr); - UINT16 arm7_cpu_read16(UINT32 addr); - UINT8 arm7_cpu_read8(UINT32 addr); + void arm7_cpu_write32(uint32_t addr, uint32_t data); + void arm7_cpu_write16(uint32_t addr, uint16_t data); + void arm7_cpu_write8(uint32_t addr, uint8_t data); + uint32_t arm7_cpu_read32(uint32_t addr); + uint16_t arm7_cpu_read16(uint32_t addr); + uint8_t arm7_cpu_read8(uint32_t addr); // Coprocessor support DECLARE_WRITE32_MEMBER( arm7_do_callback ); DECLARE_READ32_MEMBER( arm7_rt_r_callback ); DECLARE_WRITE32_MEMBER( arm7_rt_w_callback ); - void arm7_dt_r_callback(UINT32 insn, UINT32 *prn); - void arm7_dt_w_callback(UINT32 insn, UINT32 *prn); - - void tg00_0(UINT32 pc, UINT32 insn); - void tg00_1(UINT32 pc, UINT32 insn); - void tg01_0(UINT32 pc, UINT32 insn); - void tg01_10(UINT32 pc, UINT32 insn); - void tg01_11(UINT32 pc, UINT32 insn); - void tg01_12(UINT32 pc, UINT32 insn); - void tg01_13(UINT32 pc, UINT32 insn); - void tg02_0(UINT32 pc, UINT32 insn); - void tg02_1(UINT32 pc, UINT32 insn); - void tg03_0(UINT32 pc, UINT32 insn); - void tg03_1(UINT32 pc, UINT32 insn); - void tg04_00_00(UINT32 pc, UINT32 insn); - void tg04_00_01(UINT32 pc, UINT32 insn); - void tg04_00_02(UINT32 pc, UINT32 insn); - void tg04_00_03(UINT32 pc, UINT32 insn); - void tg04_00_04(UINT32 pc, UINT32 insn); - void tg04_00_05(UINT32 pc, UINT32 insn); - void tg04_00_06(UINT32 pc, UINT32 insn); - void tg04_00_07(UINT32 pc, UINT32 insn); - void tg04_00_08(UINT32 pc, UINT32 insn); - void tg04_00_09(UINT32 pc, UINT32 insn); - void tg04_00_0a(UINT32 pc, UINT32 insn); - void tg04_00_0b(UINT32 pc, UINT32 insn); - void tg04_00_0c(UINT32 pc, UINT32 insn); - void tg04_00_0d(UINT32 pc, UINT32 insn); - void tg04_00_0e(UINT32 pc, UINT32 insn); - void tg04_00_0f(UINT32 pc, UINT32 insn); - void tg04_01_00(UINT32 pc, UINT32 insn); - void tg04_01_01(UINT32 pc, UINT32 insn); - void tg04_01_02(UINT32 pc, UINT32 insn); - void tg04_01_03(UINT32 pc, UINT32 insn); - void tg04_01_10(UINT32 pc, UINT32 insn); - void tg04_01_11(UINT32 pc, UINT32 insn); - void tg04_01_12(UINT32 pc, UINT32 insn); - void tg04_01_13(UINT32 pc, UINT32 insn); - void tg04_01_20(UINT32 pc, UINT32 insn); - void tg04_01_21(UINT32 pc, UINT32 insn); - void tg04_01_22(UINT32 pc, UINT32 insn); - void tg04_01_23(UINT32 pc, UINT32 insn); - void tg04_01_30(UINT32 pc, UINT32 insn); - void tg04_01_31(UINT32 pc, UINT32 insn); - void tg04_01_32(UINT32 pc, UINT32 insn); - void tg04_01_33(UINT32 pc, UINT32 insn); - void tg04_0203(UINT32 pc, UINT32 insn); - void tg05_0(UINT32 pc, UINT32 insn); - void tg05_1(UINT32 pc, UINT32 insn); - void tg05_2(UINT32 pc, UINT32 insn); - void tg05_3(UINT32 pc, UINT32 insn); - void tg05_4(UINT32 pc, UINT32 insn); - void tg05_5(UINT32 pc, UINT32 insn); - void tg05_6(UINT32 pc, UINT32 insn); - void tg05_7(UINT32 pc, UINT32 insn); - void tg06_0(UINT32 pc, UINT32 insn); - void tg06_1(UINT32 pc, UINT32 insn); - void tg07_0(UINT32 pc, UINT32 insn); - void tg07_1(UINT32 pc, UINT32 insn); - void tg08_0(UINT32 pc, UINT32 insn); - void tg08_1(UINT32 pc, UINT32 insn); - void tg09_0(UINT32 pc, UINT32 insn); - void tg09_1(UINT32 pc, UINT32 insn); - void tg0a_0(UINT32 pc, UINT32 insn); - void tg0a_1(UINT32 pc, UINT32 insn); - void tg0b_0(UINT32 pc, UINT32 insn); - void tg0b_1(UINT32 pc, UINT32 insn); - void tg0b_2(UINT32 pc, UINT32 insn); - void tg0b_3(UINT32 pc, UINT32 insn); - void tg0b_4(UINT32 pc, UINT32 insn); - void tg0b_5(UINT32 pc, UINT32 insn); - void tg0b_6(UINT32 pc, UINT32 insn); - void tg0b_7(UINT32 pc, UINT32 insn); - void tg0b_8(UINT32 pc, UINT32 insn); - void tg0b_9(UINT32 pc, UINT32 insn); - void tg0b_a(UINT32 pc, UINT32 insn); - void tg0b_b(UINT32 pc, UINT32 insn); - void tg0b_c(UINT32 pc, UINT32 insn); - void tg0b_d(UINT32 pc, UINT32 insn); - void tg0b_e(UINT32 pc, UINT32 insn); - void tg0b_f(UINT32 pc, UINT32 insn); - void tg0c_0(UINT32 pc, UINT32 insn); - void tg0c_1(UINT32 pc, UINT32 insn); - void tg0d_0(UINT32 pc, UINT32 insn); - void tg0d_1(UINT32 pc, UINT32 insn); - void tg0d_2(UINT32 pc, UINT32 insn); - void tg0d_3(UINT32 pc, UINT32 insn); - void tg0d_4(UINT32 pc, UINT32 insn); - void tg0d_5(UINT32 pc, UINT32 insn); - void tg0d_6(UINT32 pc, UINT32 insn); - void tg0d_7(UINT32 pc, UINT32 insn); - void tg0d_8(UINT32 pc, UINT32 insn); - void tg0d_9(UINT32 pc, UINT32 insn); - void tg0d_a(UINT32 pc, UINT32 insn); - void tg0d_b(UINT32 pc, UINT32 insn); - void tg0d_c(UINT32 pc, UINT32 insn); - void tg0d_d(UINT32 pc, UINT32 insn); - void tg0d_e(UINT32 pc, UINT32 insn); - void tg0d_f(UINT32 pc, UINT32 insn); - void tg0e_0(UINT32 pc, UINT32 insn); - void tg0e_1(UINT32 pc, UINT32 insn); - void tg0f_0(UINT32 pc, UINT32 insn); - void tg0f_1(UINT32 pc, UINT32 insn); - - typedef void ( arm7_cpu_device::*arm7thumb_ophandler ) (UINT32, UINT32); + void arm7_dt_r_callback(uint32_t insn, uint32_t *prn); + void arm7_dt_w_callback(uint32_t insn, uint32_t *prn); + + void tg00_0(uint32_t pc, uint32_t insn); + void tg00_1(uint32_t pc, uint32_t insn); + void tg01_0(uint32_t pc, uint32_t insn); + void tg01_10(uint32_t pc, uint32_t insn); + void tg01_11(uint32_t pc, uint32_t insn); + void tg01_12(uint32_t pc, uint32_t insn); + void tg01_13(uint32_t pc, uint32_t insn); + void tg02_0(uint32_t pc, uint32_t insn); + void tg02_1(uint32_t pc, uint32_t insn); + void tg03_0(uint32_t pc, uint32_t insn); + void tg03_1(uint32_t pc, uint32_t insn); + void tg04_00_00(uint32_t pc, uint32_t insn); + void tg04_00_01(uint32_t pc, uint32_t insn); + void tg04_00_02(uint32_t pc, uint32_t insn); + void tg04_00_03(uint32_t pc, uint32_t insn); + void tg04_00_04(uint32_t pc, uint32_t insn); + void tg04_00_05(uint32_t pc, uint32_t insn); + void tg04_00_06(uint32_t pc, uint32_t insn); + void tg04_00_07(uint32_t pc, uint32_t insn); + void tg04_00_08(uint32_t pc, uint32_t insn); + void tg04_00_09(uint32_t pc, uint32_t insn); + void tg04_00_0a(uint32_t pc, uint32_t insn); + void tg04_00_0b(uint32_t pc, uint32_t insn); + void tg04_00_0c(uint32_t pc, uint32_t insn); + void tg04_00_0d(uint32_t pc, uint32_t insn); + void tg04_00_0e(uint32_t pc, uint32_t insn); + void tg04_00_0f(uint32_t pc, uint32_t insn); + void tg04_01_00(uint32_t pc, uint32_t insn); + void tg04_01_01(uint32_t pc, uint32_t insn); + void tg04_01_02(uint32_t pc, uint32_t insn); + void tg04_01_03(uint32_t pc, uint32_t insn); + void tg04_01_10(uint32_t pc, uint32_t insn); + void tg04_01_11(uint32_t pc, uint32_t insn); + void tg04_01_12(uint32_t pc, uint32_t insn); + void tg04_01_13(uint32_t pc, uint32_t insn); + void tg04_01_20(uint32_t pc, uint32_t insn); + void tg04_01_21(uint32_t pc, uint32_t insn); + void tg04_01_22(uint32_t pc, uint32_t insn); + void tg04_01_23(uint32_t pc, uint32_t insn); + void tg04_01_30(uint32_t pc, uint32_t insn); + void tg04_01_31(uint32_t pc, uint32_t insn); + void tg04_01_32(uint32_t pc, uint32_t insn); + void tg04_01_33(uint32_t pc, uint32_t insn); + void tg04_0203(uint32_t pc, uint32_t insn); + void tg05_0(uint32_t pc, uint32_t insn); + void tg05_1(uint32_t pc, uint32_t insn); + void tg05_2(uint32_t pc, uint32_t insn); + void tg05_3(uint32_t pc, uint32_t insn); + void tg05_4(uint32_t pc, uint32_t insn); + void tg05_5(uint32_t pc, uint32_t insn); + void tg05_6(uint32_t pc, uint32_t insn); + void tg05_7(uint32_t pc, uint32_t insn); + void tg06_0(uint32_t pc, uint32_t insn); + void tg06_1(uint32_t pc, uint32_t insn); + void tg07_0(uint32_t pc, uint32_t insn); + void tg07_1(uint32_t pc, uint32_t insn); + void tg08_0(uint32_t pc, uint32_t insn); + void tg08_1(uint32_t pc, uint32_t insn); + void tg09_0(uint32_t pc, uint32_t insn); + void tg09_1(uint32_t pc, uint32_t insn); + void tg0a_0(uint32_t pc, uint32_t insn); + void tg0a_1(uint32_t pc, uint32_t insn); + void tg0b_0(uint32_t pc, uint32_t insn); + void tg0b_1(uint32_t pc, uint32_t insn); + void tg0b_2(uint32_t pc, uint32_t insn); + void tg0b_3(uint32_t pc, uint32_t insn); + void tg0b_4(uint32_t pc, uint32_t insn); + void tg0b_5(uint32_t pc, uint32_t insn); + void tg0b_6(uint32_t pc, uint32_t insn); + void tg0b_7(uint32_t pc, uint32_t insn); + void tg0b_8(uint32_t pc, uint32_t insn); + void tg0b_9(uint32_t pc, uint32_t insn); + void tg0b_a(uint32_t pc, uint32_t insn); + void tg0b_b(uint32_t pc, uint32_t insn); + void tg0b_c(uint32_t pc, uint32_t insn); + void tg0b_d(uint32_t pc, uint32_t insn); + void tg0b_e(uint32_t pc, uint32_t insn); + void tg0b_f(uint32_t pc, uint32_t insn); + void tg0c_0(uint32_t pc, uint32_t insn); + void tg0c_1(uint32_t pc, uint32_t insn); + void tg0d_0(uint32_t pc, uint32_t insn); + void tg0d_1(uint32_t pc, uint32_t insn); + void tg0d_2(uint32_t pc, uint32_t insn); + void tg0d_3(uint32_t pc, uint32_t insn); + void tg0d_4(uint32_t pc, uint32_t insn); + void tg0d_5(uint32_t pc, uint32_t insn); + void tg0d_6(uint32_t pc, uint32_t insn); + void tg0d_7(uint32_t pc, uint32_t insn); + void tg0d_8(uint32_t pc, uint32_t insn); + void tg0d_9(uint32_t pc, uint32_t insn); + void tg0d_a(uint32_t pc, uint32_t insn); + void tg0d_b(uint32_t pc, uint32_t insn); + void tg0d_c(uint32_t pc, uint32_t insn); + void tg0d_d(uint32_t pc, uint32_t insn); + void tg0d_e(uint32_t pc, uint32_t insn); + void tg0d_f(uint32_t pc, uint32_t insn); + void tg0e_0(uint32_t pc, uint32_t insn); + void tg0e_1(uint32_t pc, uint32_t insn); + void tg0f_0(uint32_t pc, uint32_t insn); + void tg0f_1(uint32_t pc, uint32_t insn); + + typedef void ( arm7_cpu_device::*arm7thumb_ophandler ) (uint32_t, uint32_t); static const arm7thumb_ophandler thumb_handler[0x40*0x10]; - typedef void ( arm7_cpu_device::*arm7ops_ophandler )(UINT32); + typedef void ( arm7_cpu_device::*arm7ops_ophandler )(uint32_t); static const arm7ops_ophandler ops_handler[0x10]; // @@ -279,23 +279,23 @@ protected: { offs_t start; /* start of the RAM block */ offs_t end; /* end of the RAM block */ - UINT8 readonly; /* TRUE if read-only */ + uint8_t readonly; /* TRUE if read-only */ void * base; /* base in memory where the RAM lives */ }; struct hotspot_info { - UINT32 pc; - UINT32 opcode; - UINT32 cycles; + uint32_t pc; + uint32_t opcode; + uint32_t cycles; }; /* internal compiler state */ struct compiler_state { - UINT32 cycles; /* accumulated cycles */ - UINT8 checkints; /* need to check interrupts before next instruction */ - UINT8 checksoftints; /* need to check software interrupts before next instruction */ + uint32_t cycles; /* accumulated cycles */ + uint8_t checkints; /* need to check interrupts before next instruction */ + uint8_t checksoftints; /* need to check software interrupts before next instruction */ uml::code_label labelnum; /* index for local labels */ }; @@ -306,18 +306,18 @@ protected: drc_cache * cache; /* pointer to the DRC code cache */ drcuml_state * drcuml; /* DRC UML generator state */ //arm7_frontend * drcfe; /* pointer to the DRC front-end state */ - UINT32 drcoptions; /* configurable DRC options */ + uint32_t drcoptions; /* configurable DRC options */ /* internal stuff */ - UINT8 cache_dirty; /* true if we need to flush the cache */ - UINT32 jmpdest; /* destination jump target */ + uint8_t cache_dirty; /* true if we need to flush the cache */ + uint32_t jmpdest; /* destination jump target */ /* parameters for subroutines */ - UINT64 numcycles; /* return value from gettotalcycles */ - UINT32 mode; /* current global mode */ + uint64_t numcycles; /* return value from gettotalcycles */ + uint32_t mode; /* current global mode */ const char * format; /* format string for print_debug */ - UINT32 arg0; /* print_debug argument 1 */ - UINT32 arg1; /* print_debug argument 2 */ + uint32_t arg0; /* print_debug argument 1 */ + uint32_t arg1; /* print_debug argument 2 */ /* register mappings */ uml::parameter regmap[/*NUM_REGS*/37]; /* parameter to register mappings for all 16 integer registers */ @@ -337,11 +337,11 @@ protected: uml::code_handle * write32; /* write word */ /* fast RAM */ - UINT32 fastram_select; + uint32_t fastram_select; fast_ram_info fastram[ARM7_MAX_FASTRAM]; /* hotspots */ - UINT32 hotspot_select; + uint32_t hotspot_select; hotspot_info hotspot[ARM7_MAX_HOTSPOTS]; } m_impstate; @@ -456,11 +456,11 @@ protected: void arm7_drc_init(); void arm7_drc_exit(); void execute_run_drc(); - void arm7drc_set_options(UINT32 options); - void arm7drc_add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base); - void arm7drc_add_hotspot(offs_t pc, UINT32 opcode, UINT32 cycles); + void arm7drc_set_options(uint32_t options); + void arm7drc_add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base); + void arm7drc_add_hotspot(offs_t pc, uint32_t opcode, uint32_t cycles); void code_flush_cache(); - void code_compile_block(UINT8 mode, offs_t pc); + void code_compile_block(uint8_t mode, offs_t pc); void cfunc_get_cycles(); void cfunc_unimplemented(); void static_generate_entry_point(); @@ -473,19 +473,19 @@ protected: void generate_update_cycles(drcuml_block *block, compiler_state *compiler, uml::parameter param); void generate_checksum_block(drcuml_block *block, compiler_state *compiler, const opcode_desc *seqhead, const opcode_desc *seqlast); void generate_sequence_instruction(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); - void generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 linkreg); + void generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t linkreg); - typedef bool ( arm7_cpu_device::*drcarm7ops_ophandler)(drcuml_block*, compiler_state*, const opcode_desc*, UINT32); + typedef bool ( arm7_cpu_device::*drcarm7ops_ophandler)(drcuml_block*, compiler_state*, const opcode_desc*, uint32_t); static const drcarm7ops_ophandler drcops_handler[0x10]; void saturate_qbit_overflow(drcuml_block *block); - bool drcarm7ops_0123(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op); - bool drcarm7ops_4567(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op); - bool drcarm7ops_89(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op); - bool drcarm7ops_ab(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op); - bool drcarm7ops_cd(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op); - bool drcarm7ops_e(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op); - bool drcarm7ops_f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op); + bool drcarm7ops_0123(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op); + bool drcarm7ops_4567(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op); + bool drcarm7ops_89(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op); + bool drcarm7ops_ab(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op); + bool drcarm7ops_cd(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op); + bool drcarm7ops_e(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op); + bool drcarm7ops_f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op); int generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); }; @@ -495,7 +495,7 @@ class arm7_be_cpu_device : public arm7_cpu_device { public: // construction/destruction - arm7_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arm7_be_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -504,7 +504,7 @@ class arm7500_cpu_device : public arm7_cpu_device { public: // construction/destruction - arm7500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arm7500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -513,7 +513,7 @@ class arm9_cpu_device : public arm7_cpu_device { public: // construction/destruction - arm9_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arm9_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -522,7 +522,7 @@ class arm920t_cpu_device : public arm7_cpu_device { public: // construction/destruction - arm920t_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arm920t_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -531,7 +531,7 @@ class pxa255_cpu_device : public arm7_cpu_device { public: // construction/destruction - pxa255_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pxa255_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -540,7 +540,7 @@ class sa1110_cpu_device : public arm7_cpu_device { public: // construction/destruction - sa1110_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sa1110_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/arm7/arm7core.h b/src/devices/cpu/arm7/arm7core.h index 2d4179eda7a..85b26043152 100644 --- a/src/devices/cpu/arm7/arm7core.h +++ b/src/devices/cpu/arm7/arm7core.h @@ -164,7 +164,7 @@ struct arm7imp_state; /* CPU state struct */ struct arm_state { - UINT32 m_r[NUM_REGS]; + uint32_t m_r[NUM_REGS]; bool m_pendingIrq; bool m_pendingFiq; bool m_pendingAbtD; @@ -178,20 +178,20 @@ struct arm_state direct_read_data *m_direct; /* Coprocessor Registers */ - UINT32 m_control; - UINT32 m_tlbBase; - UINT32 m_tlb_base_mask; - UINT32 m_faultStatus[2]; - UINT32 m_faultAddress; - UINT32 m_fcsePID; - UINT32 m_domainAccessControl; - UINT32 m_decoded_access_control[16]; - - UINT8 m_archRev; // ARM architecture revision (3, 4, and 5 are valid) - UINT8 m_archFlags; // architecture flags + uint32_t m_control; + uint32_t m_tlbBase; + uint32_t m_tlb_base_mask; + uint32_t m_faultStatus[2]; + uint32_t m_faultAddress; + uint32_t m_fcsePID; + uint32_t m_domainAccessControl; + uint32_t m_decoded_access_control[16]; + + uint8_t m_archRev; // ARM architecture revision (3, 4, and 5 are valid) + uint8_t m_archFlags; // architecture flags #if ARM7_MMU_ENABLE_HACK - UINT32 mmu_enable_addr; // workaround for "MMU is enabled when PA != VA" problem + uint32_t mmu_enable_addr; // workaround for "MMU is enabled when PA != VA" problem #endif arm7imp_state m_impstate; }; @@ -296,14 +296,14 @@ static const int sRegisterTable[ARM7_NUM_MODES][18] = #define F_BIT 6 #define T_BIT 5 // Thumb mode -#define N_MASK ((UINT32)(1 << N_BIT)) /* Negative flag */ -#define Z_MASK ((UINT32)(1 << Z_BIT)) /* Zero flag */ -#define C_MASK ((UINT32)(1 << C_BIT)) /* Carry flag */ -#define V_MASK ((UINT32)(1 << V_BIT)) /* oVerflow flag */ -#define Q_MASK ((UINT32)(1 << Q_BIT)) /* signed overflow for QADD, MAC */ -#define I_MASK ((UINT32)(1 << I_BIT)) /* Interrupt request disable */ -#define F_MASK ((UINT32)(1 << F_BIT)) /* Fast interrupt request disable */ -#define T_MASK ((UINT32)(1 << T_BIT)) /* Thumb Mode flag */ +#define N_MASK ((uint32_t)(1 << N_BIT)) /* Negative flag */ +#define Z_MASK ((uint32_t)(1 << Z_BIT)) /* Zero flag */ +#define C_MASK ((uint32_t)(1 << C_BIT)) /* Carry flag */ +#define V_MASK ((uint32_t)(1 << V_BIT)) /* oVerflow flag */ +#define Q_MASK ((uint32_t)(1 << Q_BIT)) /* signed overflow for QADD, MAC */ +#define I_MASK ((uint32_t)(1 << I_BIT)) /* Interrupt request disable */ +#define F_MASK ((uint32_t)(1 << F_BIT)) /* Fast interrupt request disable */ +#define T_MASK ((uint32_t)(1 << T_BIT)) /* Thumb Mode flag */ #define N_IS_SET(pc) ((pc) & N_MASK) #define Z_IS_SET(pc) ((pc) & Z_MASK) @@ -325,38 +325,38 @@ static const int sRegisterTable[ARM7_NUM_MODES][18] = /* Deconstructing an instruction */ // todo: use these in all places (including dasm file) -#define INSN_COND ((UINT32)0xf0000000u) -#define INSN_SDT_L ((UINT32)0x00100000u) -#define INSN_SDT_W ((UINT32)0x00200000u) -#define INSN_SDT_B ((UINT32)0x00400000u) -#define INSN_SDT_U ((UINT32)0x00800000u) -#define INSN_SDT_P ((UINT32)0x01000000u) -#define INSN_BDT_L ((UINT32)0x00100000u) -#define INSN_BDT_W ((UINT32)0x00200000u) -#define INSN_BDT_S ((UINT32)0x00400000u) -#define INSN_BDT_U ((UINT32)0x00800000u) -#define INSN_BDT_P ((UINT32)0x01000000u) -#define INSN_BDT_REGS ((UINT32)0x0000ffffu) -#define INSN_SDT_IMM ((UINT32)0x00000fffu) -#define INSN_MUL_A ((UINT32)0x00200000u) -#define INSN_MUL_RM ((UINT32)0x0000000fu) -#define INSN_MUL_RS ((UINT32)0x00000f00u) -#define INSN_MUL_RN ((UINT32)0x0000f000u) -#define INSN_MUL_RD ((UINT32)0x000f0000u) -#define INSN_I ((UINT32)0x02000000u) -#define INSN_OPCODE ((UINT32)0x01e00000u) -#define INSN_S ((UINT32)0x00100000u) -#define INSN_BL ((UINT32)0x01000000u) -#define INSN_BRANCH ((UINT32)0x00ffffffu) -#define INSN_SWI ((UINT32)0x00ffffffu) -#define INSN_RN ((UINT32)0x000f0000u) -#define INSN_RD ((UINT32)0x0000f000u) -#define INSN_OP2 ((UINT32)0x00000fffu) -#define INSN_OP2_SHIFT ((UINT32)0x00000f80u) -#define INSN_OP2_SHIFT_TYPE ((UINT32)0x00000070u) -#define INSN_OP2_RM ((UINT32)0x0000000fu) -#define INSN_OP2_ROTATE ((UINT32)0x00000f00u) -#define INSN_OP2_IMM ((UINT32)0x000000ffu) +#define INSN_COND ((uint32_t)0xf0000000u) +#define INSN_SDT_L ((uint32_t)0x00100000u) +#define INSN_SDT_W ((uint32_t)0x00200000u) +#define INSN_SDT_B ((uint32_t)0x00400000u) +#define INSN_SDT_U ((uint32_t)0x00800000u) +#define INSN_SDT_P ((uint32_t)0x01000000u) +#define INSN_BDT_L ((uint32_t)0x00100000u) +#define INSN_BDT_W ((uint32_t)0x00200000u) +#define INSN_BDT_S ((uint32_t)0x00400000u) +#define INSN_BDT_U ((uint32_t)0x00800000u) +#define INSN_BDT_P ((uint32_t)0x01000000u) +#define INSN_BDT_REGS ((uint32_t)0x0000ffffu) +#define INSN_SDT_IMM ((uint32_t)0x00000fffu) +#define INSN_MUL_A ((uint32_t)0x00200000u) +#define INSN_MUL_RM ((uint32_t)0x0000000fu) +#define INSN_MUL_RS ((uint32_t)0x00000f00u) +#define INSN_MUL_RN ((uint32_t)0x0000f000u) +#define INSN_MUL_RD ((uint32_t)0x000f0000u) +#define INSN_I ((uint32_t)0x02000000u) +#define INSN_OPCODE ((uint32_t)0x01e00000u) +#define INSN_S ((uint32_t)0x00100000u) +#define INSN_BL ((uint32_t)0x01000000u) +#define INSN_BRANCH ((uint32_t)0x00ffffffu) +#define INSN_SWI ((uint32_t)0x00ffffffu) +#define INSN_RN ((uint32_t)0x000f0000u) +#define INSN_RD ((uint32_t)0x0000f000u) +#define INSN_OP2 ((uint32_t)0x00000fffu) +#define INSN_OP2_SHIFT ((uint32_t)0x00000f80u) +#define INSN_OP2_SHIFT_TYPE ((uint32_t)0x00000070u) +#define INSN_OP2_RM ((uint32_t)0x0000000fu) +#define INSN_OP2_ROTATE ((uint32_t)0x00000f00u) +#define INSN_OP2_IMM ((uint32_t)0x000000ffu) #define INSN_OP2_SHIFT_TYPE_SHIFT 4 #define INSN_OP2_SHIFT_SHIFT 7 #define INSN_OP2_ROTATE_SHIFT 8 @@ -368,56 +368,56 @@ static const int sRegisterTable[ARM7_NUM_MODES][18] = #define INSN_RD_SHIFT 12 #define INSN_COND_SHIFT 28 -#define INSN_COPRO_N ((UINT32) 0x00100000u) -#define INSN_COPRO_CREG ((UINT32) 0x000f0000u) -#define INSN_COPRO_AREG ((UINT32) 0x0000f000u) -#define INSN_COPRO_CPNUM ((UINT32) 0x00000f00u) -#define INSN_COPRO_OP2 ((UINT32) 0x000000e0u) -#define INSN_COPRO_OP3 ((UINT32) 0x0000000fu) +#define INSN_COPRO_N ((uint32_t) 0x00100000u) +#define INSN_COPRO_CREG ((uint32_t) 0x000f0000u) +#define INSN_COPRO_AREG ((uint32_t) 0x0000f000u) +#define INSN_COPRO_CPNUM ((uint32_t) 0x00000f00u) +#define INSN_COPRO_OP2 ((uint32_t) 0x000000e0u) +#define INSN_COPRO_OP3 ((uint32_t) 0x0000000fu) #define INSN_COPRO_N_SHIFT 20 #define INSN_COPRO_CREG_SHIFT 16 #define INSN_COPRO_AREG_SHIFT 12 #define INSN_COPRO_CPNUM_SHIFT 8 #define INSN_COPRO_OP2_SHIFT 5 -#define THUMB_INSN_TYPE ((UINT16)0xf000) -#define THUMB_COND_TYPE ((UINT16)0x0f00) -#define THUMB_GROUP4_TYPE ((UINT16)0x0c00) -#define THUMB_GROUP5_TYPE ((UINT16)0x0e00) -#define THUMB_GROUP5_RM ((UINT16)0x01c0) -#define THUMB_GROUP5_RN ((UINT16)0x0038) -#define THUMB_GROUP5_RD ((UINT16)0x0007) -#define THUMB_ADDSUB_RNIMM ((UINT16)0x01c0) -#define THUMB_ADDSUB_RS ((UINT16)0x0038) -#define THUMB_ADDSUB_RD ((UINT16)0x0007) -#define THUMB_INSN_CMP ((UINT16)0x0800) -#define THUMB_INSN_SUB ((UINT16)0x0800) -#define THUMB_INSN_IMM_RD ((UINT16)0x0700) -#define THUMB_INSN_IMM_S ((UINT16)0x0080) -#define THUMB_INSN_IMM ((UINT16)0x00ff) -#define THUMB_INSN_ADDSUB ((UINT16)0x0800) -#define THUMB_ADDSUB_TYPE ((UINT16)0x0600) -#define THUMB_HIREG_OP ((UINT16)0x0300) -#define THUMB_HIREG_H ((UINT16)0x00c0) -#define THUMB_HIREG_RS ((UINT16)0x0038) -#define THUMB_HIREG_RD ((UINT16)0x0007) -#define THUMB_STACKOP_TYPE ((UINT16)0x0f00) -#define THUMB_STACKOP_L ((UINT16)0x0800) -#define THUMB_STACKOP_RD ((UINT16)0x0700) -#define THUMB_ALUOP_TYPE ((UINT16)0x03c0) -#define THUMB_BLOP_LO ((UINT16)0x0800) -#define THUMB_BLOP_OFFS ((UINT16)0x07ff) -#define THUMB_SHIFT_R ((UINT16)0x0800) -#define THUMB_SHIFT_AMT ((UINT16)0x07c0) -#define THUMB_HALFOP_L ((UINT16)0x0800) -#define THUMB_HALFOP_OFFS ((UINT16)0x07c0) -#define THUMB_BRANCH_OFFS ((UINT16)0x07ff) -#define THUMB_LSOP_L ((UINT16)0x0800) -#define THUMB_LSOP_OFFS ((UINT16)0x07c0) -#define THUMB_MULTLS ((UINT16)0x0800) -#define THUMB_MULTLS_BASE ((UINT16)0x0700) -#define THUMB_RELADDR_SP ((UINT16)0x0800) -#define THUMB_RELADDR_RD ((UINT16)0x0700) +#define THUMB_INSN_TYPE ((uint16_t)0xf000) +#define THUMB_COND_TYPE ((uint16_t)0x0f00) +#define THUMB_GROUP4_TYPE ((uint16_t)0x0c00) +#define THUMB_GROUP5_TYPE ((uint16_t)0x0e00) +#define THUMB_GROUP5_RM ((uint16_t)0x01c0) +#define THUMB_GROUP5_RN ((uint16_t)0x0038) +#define THUMB_GROUP5_RD ((uint16_t)0x0007) +#define THUMB_ADDSUB_RNIMM ((uint16_t)0x01c0) +#define THUMB_ADDSUB_RS ((uint16_t)0x0038) +#define THUMB_ADDSUB_RD ((uint16_t)0x0007) +#define THUMB_INSN_CMP ((uint16_t)0x0800) +#define THUMB_INSN_SUB ((uint16_t)0x0800) +#define THUMB_INSN_IMM_RD ((uint16_t)0x0700) +#define THUMB_INSN_IMM_S ((uint16_t)0x0080) +#define THUMB_INSN_IMM ((uint16_t)0x00ff) +#define THUMB_INSN_ADDSUB ((uint16_t)0x0800) +#define THUMB_ADDSUB_TYPE ((uint16_t)0x0600) +#define THUMB_HIREG_OP ((uint16_t)0x0300) +#define THUMB_HIREG_H ((uint16_t)0x00c0) +#define THUMB_HIREG_RS ((uint16_t)0x0038) +#define THUMB_HIREG_RD ((uint16_t)0x0007) +#define THUMB_STACKOP_TYPE ((uint16_t)0x0f00) +#define THUMB_STACKOP_L ((uint16_t)0x0800) +#define THUMB_STACKOP_RD ((uint16_t)0x0700) +#define THUMB_ALUOP_TYPE ((uint16_t)0x03c0) +#define THUMB_BLOP_LO ((uint16_t)0x0800) +#define THUMB_BLOP_OFFS ((uint16_t)0x07ff) +#define THUMB_SHIFT_R ((uint16_t)0x0800) +#define THUMB_SHIFT_AMT ((uint16_t)0x07c0) +#define THUMB_HALFOP_L ((uint16_t)0x0800) +#define THUMB_HALFOP_OFFS ((uint16_t)0x07c0) +#define THUMB_BRANCH_OFFS ((uint16_t)0x07ff) +#define THUMB_LSOP_L ((uint16_t)0x0800) +#define THUMB_LSOP_OFFS ((uint16_t)0x07c0) +#define THUMB_MULTLS ((uint16_t)0x0800) +#define THUMB_MULTLS_BASE ((uint16_t)0x0700) +#define THUMB_RELADDR_SP ((uint16_t)0x0800) +#define THUMB_RELADDR_RD ((uint16_t)0x0700) #define THUMB_INSN_TYPE_SHIFT 12 #define THUMB_COND_TYPE_SHIFT 8 #define THUMB_GROUP4_TYPE_SHIFT 10 @@ -493,10 +493,10 @@ enum #define GET_CPSR m_r[eCPSR] #define MODE_FLAG 0xF // Mode bits are 4:0 of CPSR, but we ignore bit 4. #define GET_MODE (GET_CPSR & MODE_FLAG) -#define SIGN_BIT ((UINT32)(1 << 31)) +#define SIGN_BIT ((uint32_t)(1 << 31)) #define SIGN_BITS_DIFFER(a, b) (((a) ^ (b)) >> 31) /* I really don't know why these were set to 16-bit, the thumb registers are still 32-bit ... */ -#define THUMB_SIGN_BIT ((UINT32)(1 << 31)) +#define THUMB_SIGN_BIT ((uint32_t)(1 << 31)) #define THUMB_SIGN_BITS_DIFFER(a, b) (((a)^(b)) >> 31) #define SR_MODE32 0x10 diff --git a/src/devices/cpu/arm7/arm7core.hxx b/src/devices/cpu/arm7/arm7core.hxx index 12a6884033c..0e418209e73 100644 --- a/src/devices/cpu/arm7/arm7core.hxx +++ b/src/devices/cpu/arm7/arm7core.hxx @@ -96,8 +96,8 @@ void arm7_cpu_device::arm7_check_irq_state() if (!m_pending_interrupt) return; - UINT32 cpsr = m_r[eCPSR]; /* save current CPSR */ - UINT32 pc = m_r[eR15] + 4; /* save old pc (already incremented in pipeline) */; + uint32_t cpsr = m_r[eCPSR]; /* save current CPSR */ + uint32_t pc = m_r[eR15] + 4; /* save old pc (already incremented in pipeline) */; /* Exception priorities: @@ -154,7 +154,7 @@ void arm7_cpu_device::arm7_check_irq_state() } else { - UINT32 temp; + uint32_t temp; R15 = (pc & 0xF4000000) /* N Z C V F */ | 0x18 | 0x00000002 /* IRQ */ | 0x08000000 /* I */; temp = (GET_CPSR & 0x0FFFFF3F) /* N Z C V I F */ | (R15 & 0xF0000000) /* N Z C V */ | ((R15 & 0x0C000000) >> (26 - 6)) /* I F */; set_cpsr(temp); /* Mask IRQ */ @@ -225,7 +225,7 @@ void arm7_cpu_device::arm7_check_irq_state() } else { - UINT32 temp; + uint32_t temp; R15 = (pc & 0xF4000000) /* N Z C V F */ | 0x08 | 0x00000003 /* SVC */ | 0x08000000 /* I */; temp = (GET_CPSR & 0x0FFFFF3F) /* N Z C V I F */ | (R15 & 0xF0000000) /* N Z C V */ | ((R15 & 0x0C000000) >> (26 - 6)) /* I F */; set_cpsr(temp); /* Mask IRQ */ diff --git a/src/devices/cpu/arm7/arm7dasm.cpp b/src/devices/cpu/arm7/arm7dasm.cpp index 68a2bb38654..622064bf078 100644 --- a/src/devices/cpu/arm7/arm7dasm.cpp +++ b/src/devices/cpu/arm7/arm7dasm.cpp @@ -35,7 +35,7 @@ static char *WritePadding( char *pBuf, const char *pBuf0 ) return pBuf; } -static char *DasmCoProc_RT( char *pBuf, UINT32 opcode, const char *pConditionCode, const char *pBuf0) +static char *DasmCoProc_RT( char *pBuf, uint32_t opcode, const char *pConditionCode, const char *pBuf0) { /* co processor register transfer */ /* xxxx 1110 oooL nnnn dddd cccc ppp1 mmmm */ @@ -55,7 +55,7 @@ static char *DasmCoProc_RT( char *pBuf, UINT32 opcode, const char *pConditionCod return pBuf; } -static char *DasmCoProc_DT( char *pBuf, UINT32 opcode, const char *pConditionCode, const char *pBuf0 ) +static char *DasmCoProc_DT( char *pBuf, uint32_t opcode, const char *pConditionCode, const char *pBuf0 ) { /* co processor data transfer */ /* xxxx 111P UNWL nnnn dddd pppp oooooooo */ @@ -80,7 +80,7 @@ static char *DasmCoProc_DT( char *pBuf, UINT32 opcode, const char *pConditionCod return pBuf; } -static char *DasmCoProc_DO( char *pBuf, UINT32 opcode, const char *pConditionCode, const char *pBuf0 ) +static char *DasmCoProc_DO( char *pBuf, uint32_t opcode, const char *pConditionCode, const char *pBuf0 ) { /* co processor data operation */ /* xxxx 1110 oooo nnnn dddd cccc ppp0 mmmm */ @@ -94,10 +94,10 @@ static char *DasmCoProc_DO( char *pBuf, UINT32 opcode, const char *pConditionCod return pBuf; } -static char *WriteImmediateOperand( char *pBuf, UINT32 opcode ) +static char *WriteImmediateOperand( char *pBuf, uint32_t opcode ) { /* rrrrbbbbbbbb */ - UINT32 imm; + uint32_t imm; int r; imm = opcode&0xff; @@ -107,7 +107,7 @@ static char *WriteImmediateOperand( char *pBuf, UINT32 opcode ) return pBuf; } -static char *WriteDataProcessingOperand( char *pBuf, UINT32 opcode, int printOp0, int printOp1, int printOp2 ) +static char *WriteDataProcessingOperand( char *pBuf, uint32_t opcode, int printOp0, int printOp1, int printOp2 ) { /* ccccctttmmmm */ static const char *const pRegOp[4] = { "LSL","LSR","ASR","ROR" }; @@ -146,7 +146,7 @@ static char *WriteDataProcessingOperand( char *pBuf, UINT32 opcode, int printOp0 return pBuf; } -static char *WriteRegisterOperand1( char *pBuf, UINT32 opcode ) +static char *WriteRegisterOperand1( char *pBuf, uint32_t opcode ) { /* ccccctttmmmm */ static const char *const pRegOp[4] = { "LSL","LSR","ASR","ROR" }; @@ -177,7 +177,7 @@ static char *WriteRegisterOperand1( char *pBuf, UINT32 opcode ) } /* WriteRegisterOperand */ -static char *WriteBranchAddress( char *pBuf, UINT32 pc, UINT32 opcode ) +static char *WriteBranchAddress( char *pBuf, uint32_t pc, uint32_t opcode ) { opcode &= 0x00ffffff; if( opcode&0x00800000 ) @@ -189,7 +189,7 @@ static char *WriteBranchAddress( char *pBuf, UINT32 pc, UINT32 opcode ) return pBuf; } /* WriteBranchAddress */ -static UINT32 arm7_disasm( char *pBuf, UINT32 pc, UINT32 opcode ) +static uint32_t arm7_disasm( char *pBuf, uint32_t pc, uint32_t opcode ) { const char *pBuf0; @@ -208,7 +208,7 @@ static UINT32 arm7_disasm( char *pBuf, UINT32 pc, UINT32 opcode ) "ORR","MOV","BIC","MVN" }; const char *pConditionCode; - UINT32 dasmflags = 0; + uint32_t dasmflags = 0; pConditionCode= pConditionCodeTable[opcode>>28]; pBuf0 = pBuf; @@ -494,8 +494,8 @@ static UINT32 arm7_disasm( char *pBuf, UINT32 pc, UINT32 opcode ) } else if( (opcode&0x0c000000)==0x04000000 ) //bits 27-26 == 01 { - UINT32 rn; - UINT32 rnv = 0; + uint32_t rn; + uint32_t rnv = 0; /* Data Transfer */ @@ -682,15 +682,15 @@ static UINT32 arm7_disasm( char *pBuf, UINT32 pc, UINT32 opcode ) return dasmflags | DASMFLAG_SUPPORTED; } -static UINT32 thumb_disasm( char *pBuf, UINT32 pc, UINT16 opcode ) +static uint32_t thumb_disasm( char *pBuf, uint32_t pc, uint16_t opcode ) { const char *pBuf0; - UINT32 dasmflags = 0; + uint32_t dasmflags = 0; -// UINT32 readword; - UINT32 addr; - UINT32 rm, rn, rs, rd, op2, imm;//, rrs; - INT32 offs; +// uint32_t readword; + uint32_t addr; + uint32_t rm, rn, rs, rd, op2, imm;//, rrs; + int32_t offs; pBuf0 = pBuf; pBuf = WritePadding( pBuf, pBuf0 ); @@ -1100,13 +1100,13 @@ static UINT32 thumb_disasm( char *pBuf, UINT32 pc, UINT16 opcode ) if( opcode & THUMB_STACKOP_L ) { rd = ( opcode & THUMB_STACKOP_RD ) >> THUMB_STACKOP_RD_SHIFT; - offs = (UINT8)( opcode & THUMB_INSN_IMM ); + offs = (uint8_t)( opcode & THUMB_INSN_IMM ); pBuf += sprintf( pBuf, "LDR R%d, [SP, #%03x]", rd, offs << 2 ); } else { rd = ( opcode & THUMB_STACKOP_RD ) >> THUMB_STACKOP_RD_SHIFT; - offs = (UINT8)( opcode & THUMB_INSN_IMM ); + offs = (uint8_t)( opcode & THUMB_INSN_IMM ); pBuf += sprintf( pBuf, "STR R%d, [SP, #%03x]", rd, offs << 2 ); } break; @@ -1114,13 +1114,13 @@ static UINT32 thumb_disasm( char *pBuf, UINT32 pc, UINT16 opcode ) if( opcode & THUMB_RELADDR_SP ) /* ADD Rd, SP, #nn */ { rd = ( opcode & THUMB_RELADDR_RD ) >> THUMB_RELADDR_RD_SHIFT; - offs = (UINT8)( opcode & THUMB_INSN_IMM ) << 2; + offs = (uint8_t)( opcode & THUMB_INSN_IMM ) << 2; pBuf += sprintf( pBuf, "ADD R%d, SP, #%03x", rd, offs ); } else /* ADD Rd, PC, #nn */ { rd = ( opcode & THUMB_RELADDR_RD ) >> THUMB_RELADDR_RD_SHIFT; - offs = (UINT8)( opcode & THUMB_INSN_IMM ) << 2; + offs = (uint8_t)( opcode & THUMB_INSN_IMM ) << 2; pBuf += sprintf( pBuf, "ADD R%d, PC, #%03x", rd, offs ); } break; @@ -1215,7 +1215,7 @@ static UINT32 thumb_disasm( char *pBuf, UINT32 pc, UINT16 opcode ) } break; case 0xd: /* Conditional Branch */ - offs = (INT8)( opcode & THUMB_INSN_IMM ); + offs = (int8_t)( opcode & THUMB_INSN_IMM ); switch( ( opcode & THUMB_COND_TYPE ) >> THUMB_COND_TYPE_SHIFT ) { case COND_EQ: diff --git a/src/devices/cpu/arm7/arm7drc.hxx b/src/devices/cpu/arm7/arm7drc.hxx index bff2b776969..ae7255f6714 100644 --- a/src/devices/cpu/arm7/arm7drc.hxx +++ b/src/devices/cpu/arm7/arm7drc.hxx @@ -68,7 +68,7 @@ descriptor -------------------------------------------------*/ -static inline UINT32 epc(const opcode_desc *desc) +static inline uint32_t epc(const opcode_desc *desc) { return desc->pc; } @@ -129,12 +129,12 @@ void arm7_cpu_device::arm7_drc_init() { drc_cache *cache; drcbe_info beinfo; - UINT32 flags = 0; + uint32_t flags = 0; /* allocate enough space for the cache and the core */ cache = auto_alloc(machine(), drc_cache(CACHE_SIZE)); if (cache == nullptr) - fatalerror("Unable to allocate cache of size %d\n", (UINT32)(CACHE_SIZE)); + fatalerror("Unable to allocate cache of size %d\n", (uint32_t)(CACHE_SIZE)); /* allocate the implementation-specific state from the full cache */ memset(&m_impstate, 0, sizeof(m_impstate)); @@ -241,7 +241,7 @@ void arm7_cpu_device::arm7_drc_exit() arm7drc_set_options - configure DRC options -------------------------------------------------*/ -void arm7_cpu_device::arm7drc_set_options(UINT32 options) +void arm7_cpu_device::arm7drc_set_options(uint32_t options) { m_impstate.drcoptions = options; } @@ -252,7 +252,7 @@ void arm7_cpu_device::arm7drc_set_options(UINT32 options) region -------------------------------------------------*/ -void arm7_cpu_device::arm7drc_add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base) +void arm7_cpu_device::arm7drc_add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base) { if (m_impstate.fastram_select < ARRAY_LENGTH(m_impstate.fastram)) { @@ -269,7 +269,7 @@ void arm7_cpu_device::arm7drc_add_fastram(offs_t start, offs_t end, UINT8 readon arm7drc_add_hotspot - add a new hotspot -------------------------------------------------*/ -void arm7_cpu_device::arm7drc_add_hotspot(offs_t pc, UINT32 opcode, UINT32 cycles) +void arm7_cpu_device::arm7drc_add_hotspot(offs_t pc, uint32_t opcode, uint32_t cycles) { if (m_impstate.hotspot_select < ARRAY_LENGTH(m_impstate.hotspot)) { @@ -326,7 +326,7 @@ void arm7_cpu_device::code_flush_cache() given mode at the specified pc -------------------------------------------------*/ -void arm7_cpu_device::code_compile_block(UINT8 mode, offs_t pc) +void arm7_cpu_device::code_compile_block(uint8_t mode, offs_t pc) { drcuml_state *drcuml = m_impstate.drcuml; compiler_state compiler = { 0 }; @@ -354,7 +354,7 @@ void arm7_cpu_device::code_compile_block(UINT8 mode, offs_t pc) for (const opcode_desc *seqhead = desclist; seqhead != nullptr; seqhead = seqlast->next()) { const opcode_desc *curdesc; - UINT32 nextpc; + uint32_t nextpc; /* add a code log entry */ if (drcuml->logging()) @@ -454,7 +454,7 @@ void arm7_cpu_device::cfunc_get_cycles() void arm7_cpu_device::cfunc_unimplemented() { - UINT32 opcode = m_impstate.arg0; + uint32_t opcode = m_impstate.arg0; fatalerror("PC=%08X: Unimplemented op %08X\n", m_r[eR15], opcode); } @@ -620,9 +620,9 @@ void arm7_cpu_device::static_generate_check_irq() UML_JMPc(block, uml::COND_Z, nopabt = label++); // jmpz nound UML_ROLINS(block, uml::mem(&GET_CPSR), eARM7_MODE_UND, 0, MODE_FLAG); // rolins CPSR, eARM7_MODE_UND, 0, MODE_FLAG - UML_MOV(block, uml::I1, (UINT64)-4); // mov i1, -4 + UML_MOV(block, uml::I1, (uint64_t)-4); // mov i1, -4 UML_TEST(block, uml::mem(&GET_CPSR), T_MASK); // test CPSR, T_MASK - UML_MOVc(block, uml::COND_NZ, uml::I1, (UINT64)-2); // movnz i1, -2 + UML_MOVc(block, uml::COND_NZ, uml::I1, (uint64_t)-2); // movnz i1, -2 UML_ADD(block, uml::mem(&GetRegister(14)), uml::I0, uml::I1); // add LR, i0, i1 UML_MOV(block, uml::mem(&GetRegister(SPSR)), uml::mem(&GET_CPSR)); // mov SPSR, CPSR UML_OR(block, uml::mem(&GET_CPSR), uml::mem(&GET_CPSR), I_MASK); // or CPSR, CPSR, I_MASK @@ -638,9 +638,9 @@ void arm7_cpu_device::static_generate_check_irq() UML_JMPc(block, uml::COND_Z, done = label++); // jmpz done UML_ROLINS(block, uml::mem(&GET_CPSR), eARM7_MODE_SVC, 0, MODE_FLAG); // rolins CPSR, eARM7_MODE_SVC, 0, MODE_FLAG - UML_MOV(block, uml::I1, (UINT64)-4); // mov i1, -4 + UML_MOV(block, uml::I1, (uint64_t)-4); // mov i1, -4 UML_TEST(block, uml::mem(&GET_CPSR), T_MASK); // test CPSR, T_MASK - UML_MOVc(block, uml::COND_NZ, uml::I1, (UINT64)-2); // movnz i1, -2 + UML_MOVc(block, uml::COND_NZ, uml::I1, (uint64_t)-2); // movnz i1, -2 UML_ADD(block, uml::mem(&GetRegister(14)), uml::I0, uml::I1); // add LR, i0, i1 UML_TEST(block, uml::mem(&GET_CPSR), SR_MODE32); // test CPSR, MODE32 @@ -1053,8 +1053,8 @@ void arm7_cpu_device::static_generate_memory_accessor(int size, bool istlb, bool { if (m_impstate.fastram[ramnum].base != nullptr && (!iswrite || !m_impstate.fastram[ramnum].readonly)) { - void *fastbase = (UINT8 *)m_impstate.fastram[ramnum].base - m_impstate.fastram[ramnum].start; - UINT32 skip = label++; + void *fastbase = (uint8_t *)m_impstate.fastram[ramnum].base - m_impstate.fastram[ramnum].start; + uint32_t skip = label++; if (m_impstate.fastram[ramnum].end != 0xffffffff) { UML_CMP(block, uml::I0, m_impstate.fastram[ramnum].end); // cmp i0, end @@ -1202,7 +1202,7 @@ void arm7_cpu_device::generate_checksum_block(drcuml_block *block, compiler_stat { if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) { - UINT32 sum = seqhead->opptr.l[0]; + uint32_t sum = seqhead->opptr.l[0]; void *base = m_direct->read_ptr(seqhead->physpc); UML_LOAD(block, uml::I0, base, 0, uml::SIZE_DWORD, uml::SCALE_x4); // load i0,base,0,dword @@ -1223,7 +1223,7 @@ void arm7_cpu_device::generate_checksum_block(drcuml_block *block, compiler_stat /* full verification; sum up everything */ else { - UINT32 sum = 0; + uint32_t sum = 0; void *base = m_direct->read_ptr(seqhead->physpc); UML_LOAD(block, uml::I0, base, 0, uml::SIZE_DWORD, uml::SCALE_x4); // load i0,base,0,dword sum += seqhead->opptr.l[0]; @@ -1321,7 +1321,7 @@ void arm7_cpu_device::generate_sequence_instruction(drcuml_block *block, compile generate_delay_slot_and_branch ------------------------------------------------------------------*/ -void arm7_cpu_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 linkreg) +void arm7_cpu_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t linkreg) { compiler_state compiler_temp = *compiler; @@ -1368,7 +1368,7 @@ void arm7_cpu_device::saturate_qbit_overflow(drcuml_block *block) UML_OR(block, DRC_CPSR, DRC_CPSR, uml::I1); } -bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 insn) +bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t insn) { uml::code_label done; /* Branch and Exchange (BX) */ @@ -1382,17 +1382,17 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } else if ((insn & 0x0ff000f0) == 0x01600010) // CLZ - v5 { - UINT32 rm = insn&0xf; - UINT32 rd = (insn>>12)&0xf; + uint32_t rm = insn&0xf; + uint32_t rd = (insn>>12)&0xf; UML_LZCNT(block, DRC_REG(rd), DRC_REG(rm)); UML_ADD(block, DRC_PC, DRC_PC, 4); } else if ((insn & 0x0ff000f0) == 0x01000050) // QADD - v5 { - UINT32 rm = insn&0xf; - UINT32 rn = (insn>>16)&0xf; - UINT32 rd = (insn>>12)&0xf; + uint32_t rm = insn&0xf; + uint32_t rn = (insn>>16)&0xf; + uint32_t rd = (insn>>12)&0xf; UML_DSEXT(block, uml::I0, DRC_REG(rm), uml::SIZE_DWORD); UML_DSEXT(block, uml::I1, DRC_REG(rn), uml::SIZE_DWORD); UML_DADD(block, uml::I0, uml::I0, uml::I1); @@ -1402,9 +1402,9 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } else if ((insn & 0x0ff000f0) == 0x01400050) // QDADD - v5 { - UINT32 rm = insn&0xf; - UINT32 rn = (insn>>16)&0xf; - UINT32 rd = (insn>>12)&0xf; + uint32_t rm = insn&0xf; + uint32_t rn = (insn>>16)&0xf; + uint32_t rd = (insn>>12)&0xf; UML_DSEXT(block, uml::I1, DRC_REG(rn), uml::SIZE_DWORD); UML_DADD(block, uml::I0, uml::I1, uml::I1); @@ -1421,9 +1421,9 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } else if ((insn & 0x0ff000f0) == 0x01200050) // QSUB - v5 { - UINT32 rm = insn&0xf; - UINT32 rn = (insn>>16)&0xf; - UINT32 rd = (insn>>12)&0xf; + uint32_t rm = insn&0xf; + uint32_t rn = (insn>>16)&0xf; + uint32_t rd = (insn>>12)&0xf; UML_DSEXT(block, uml::I0, DRC_REG(rm), uml::SIZE_DWORD); UML_DSEXT(block, uml::I1, DRC_REG(rn), uml::SIZE_DWORD); @@ -1434,9 +1434,9 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } else if ((insn & 0x0ff000f0) == 0x01600050) // QDSUB - v5 { - UINT32 rm = insn&0xf; - UINT32 rn = (insn>>16)&0xf; - UINT32 rd = (insn>>12)&0xf; + uint32_t rm = insn&0xf; + uint32_t rn = (insn>>16)&0xf; + uint32_t rd = (insn>>12)&0xf; UML_DSEXT(block, uml::I1, DRC_REG(rn), uml::SIZE_DWORD); UML_DADD(block, uml::I0, uml::I1, uml::I1); @@ -1453,10 +1453,10 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } else if ((insn & 0x0ff00090) == 0x01000080) // SMLAxy - v5 { - UINT32 rm = insn&0xf; - UINT32 rn = (insn>>8)&0xf; - UINT32 rd = (insn>>16)&0xf; - UINT32 ra = (insn>>12)&0xf; + uint32_t rm = insn&0xf; + uint32_t rn = (insn>>8)&0xf; + uint32_t rd = (insn>>16)&0xf; + uint32_t ra = (insn>>12)&0xf; UML_MOV(block, uml::I0, DRC_REG(rm)); UML_MOV(block, uml::I1, DRC_REG(rn)); @@ -1487,10 +1487,10 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } else if ((insn & 0x0ff00090) == 0x01400080) // SMLALxy - v5 { - UINT32 rm = insn&0xf; - UINT32 rn = (insn>>8)&0xf; - UINT32 rdh = (insn>>16)&0xf; - UINT32 rdl = (insn>>12)&0xf; + uint32_t rm = insn&0xf; + uint32_t rn = (insn>>8)&0xf; + uint32_t rdh = (insn>>16)&0xf; + uint32_t rdl = (insn>>12)&0xf; UML_DSEXT(block, uml::I0, DRC_REG(rm), uml::SIZE_DWORD); UML_DSEXT(block, uml::I1, DRC_REG(rn), uml::SIZE_DWORD); @@ -1508,9 +1508,9 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } else if ((insn & 0x0ff00090) == 0x01600080) // SMULxy - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>8)&0xf); - INT32 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>8)&0xf); + int32_t res; // select top and bottom halves of src1/src2 and sign extend if necessary if (insn & 0x20) @@ -1541,9 +1541,9 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } else if ((insn & 0x0ff000b0) == 0x012000a0) // SMULWy - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>8)&0xf); - INT64 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>8)&0xf); + int64_t res; if (insn & 0x40) { @@ -1558,16 +1558,16 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } } - res = (INT64)src1 * (INT64)src2; + res = (int64_t)src1 * (int64_t)src2; res >>= 16; - SetRegister((insn>>16)&0xf, (UINT32)res); + SetRegister((insn>>16)&0xf, (uint32_t)res); } else if ((insn & 0x0ff000b0) == 0x01200080) // SMLAWy - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>8)&0xf); - INT32 src3 = GetRegister((insn>>12)&0xf); - INT64 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>8)&0xf); + int32_t src3 = GetRegister((insn>>12)&0xf); + int64_t res; if (insn & 0x40) { @@ -1582,17 +1582,17 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi } } - res = (INT64)src1 * (INT64)src2; + res = (int64_t)src1 * (int64_t)src2; res >>= 16; // check for overflow and set the Q bit - saturate_qbit_overflow((INT64)src3 + res); + saturate_qbit_overflow((int64_t)src3 + res); // do the real accumulate - src3 += (INT32)res; + src3 += (int32_t)res; // write the result back - SetRegister((insn>>16)&0xf, (UINT32)res); + SetRegister((insn>>16)&0xf, (uint32_t)res); } else /* Multiply OR Swap OR Half Word Data Transfer */ @@ -1650,32 +1650,32 @@ bool arm7_cpu_device::drcarm7ops_0123(drcuml_block *block, compiler_state *compi return true; } -bool arm7_cpu_device::drcarm7ops_4567(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op) +bool arm7_cpu_device::drcarm7ops_4567(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op) { return false; } -bool arm7_cpu_device::drcarm7ops_89(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op) +bool arm7_cpu_device::drcarm7ops_89(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op) { return false; } -bool arm7_cpu_device::drcarm7ops_ab(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op) +bool arm7_cpu_device::drcarm7ops_ab(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op) { return false; } -bool arm7_cpu_device::drcarm7ops_cd(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op) +bool arm7_cpu_device::drcarm7ops_cd(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op) { return false; } -bool arm7_cpu_device::drcarm7ops_e(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op) +bool arm7_cpu_device::drcarm7ops_e(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op) { return false; } -bool arm7_cpu_device::drcarm7ops_f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 op) +bool arm7_cpu_device::drcarm7ops_f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t op) { return false; } @@ -1688,8 +1688,8 @@ bool arm7_cpu_device::drcarm7ops_f(drcuml_block *block, compiler_state *compiler int arm7_cpu_device::generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { //int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = op >> 26; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = op >> 26; uml::code_label skip; uml::code_label contdecode; uml::code_label unexecuted; diff --git a/src/devices/cpu/arm7/arm7help.h b/src/devices/cpu/arm7/arm7help.h index 41d9e8ad63b..4b0b4f21c8a 100644 --- a/src/devices/cpu/arm7/arm7help.h +++ b/src/devices/cpu/arm7/arm7help.h @@ -118,7 +118,7 @@ // Long ALU Functions use bit 63 #define HandleLongALUNZFlags(rd) \ - ((((rd) & ((UINT64)1 << 63)) >> 32) | ((!(rd)) << Z_BIT)) + ((((rd) & ((uint64_t)1 << 63)) >> 32) | ((!(rd)) << Z_BIT)) #define HandleALULogicalFlags(rd, sc) \ if (insn & INSN_S) \ diff --git a/src/devices/cpu/arm7/arm7ops.cpp b/src/devices/cpu/arm7/arm7ops.cpp index b41008bc4b1..b43fa89b60b 100644 --- a/src/devices/cpu/arm7/arm7ops.cpp +++ b/src/devices/cpu/arm7/arm7ops.cpp @@ -5,7 +5,7 @@ #include "arm7core.h" #include "arm7help.h" -INT64 arm7_cpu_device::saturate_qbit_overflow(INT64 res) +int64_t arm7_cpu_device::saturate_qbit_overflow(int64_t res) { if (res > 2147483647) // INT32_MAX { // overflow high? saturate and set Q @@ -22,9 +22,9 @@ INT64 arm7_cpu_device::saturate_qbit_overflow(INT64 res) } -void arm7_cpu_device::SwitchMode(UINT32 cpsr_mode_val) +void arm7_cpu_device::SwitchMode(uint32_t cpsr_mode_val) { - UINT32 cspr = m_r[eCPSR] & ~MODE_FLAG; + uint32_t cspr = m_r[eCPSR] & ~MODE_FLAG; set_cpsr(cspr | cpsr_mode_val); } @@ -47,11 +47,11 @@ void arm7_cpu_device::SwitchMode(UINT32 cpsr_mode_val) ROR >32 = Same result as ROR n-32 until amount in range of 1-32 then follow rules */ -UINT32 arm7_cpu_device::decodeShift(UINT32 insn, UINT32 *pCarry) +uint32_t arm7_cpu_device::decodeShift(uint32_t insn, uint32_t *pCarry) { - UINT32 k = (insn & INSN_OP2_SHIFT) >> INSN_OP2_SHIFT_SHIFT; // Bits 11-7 - UINT32 rm = GetRegister(insn & INSN_OP2_RM); - UINT32 t = (insn & INSN_OP2_SHIFT_TYPE) >> INSN_OP2_SHIFT_TYPE_SHIFT; + uint32_t k = (insn & INSN_OP2_SHIFT) >> INSN_OP2_SHIFT_SHIFT; // Bits 11-7 + uint32_t rm = GetRegister(insn & INSN_OP2_RM); + uint32_t t = (insn & INSN_OP2_SHIFT_TYPE) >> INSN_OP2_SHIFT_TYPE_SHIFT; if ((insn & INSN_OP2_RM) == 0xf) { // "If a register is used to specify the shift amount the PC will be 12 bytes ahead." (instead of 8) @@ -165,10 +165,10 @@ UINT32 arm7_cpu_device::decodeShift(UINT32 insn, UINT32 *pCarry) } /* decodeShift */ -int arm7_cpu_device::loadInc(UINT32 pat, UINT32 rbv, UINT32 s, int mode) +int arm7_cpu_device::loadInc(uint32_t pat, uint32_t rbv, uint32_t s, int mode) { int i, result; - UINT32 data; + uint32_t data; result = 0; rbv &= ~3; @@ -202,10 +202,10 @@ int arm7_cpu_device::loadInc(UINT32 pat, UINT32 rbv, UINT32 s, int mode) } -int arm7_cpu_device::loadDec(UINT32 pat, UINT32 rbv, UINT32 s, int mode) +int arm7_cpu_device::loadDec(uint32_t pat, uint32_t rbv, uint32_t s, int mode) { int i, result; - UINT32 data; + uint32_t data; result = 0; rbv &= ~3; @@ -239,7 +239,7 @@ int arm7_cpu_device::loadDec(UINT32 pat, UINT32 rbv, UINT32 s, int mode) } -int arm7_cpu_device::storeInc(UINT32 pat, UINT32 rbv, int mode) +int arm7_cpu_device::storeInc(uint32_t pat, uint32_t rbv, int mode) { int i, result; @@ -260,7 +260,7 @@ int arm7_cpu_device::storeInc(UINT32 pat, UINT32 rbv, int mode) } /* storeInc */ -int arm7_cpu_device::storeDec(UINT32 pat, UINT32 rbv, int mode) +int arm7_cpu_device::storeDec(uint32_t pat, uint32_t rbv, int mode) { int i, result = 0, cnt; @@ -298,21 +298,21 @@ int arm7_cpu_device::storeDec(UINT32 pat, UINT32 rbv, int mode) ***************************************************************************/ // Co-Processor Data Operation -void arm7_cpu_device::HandleCoProcDO(UINT32 insn) +void arm7_cpu_device::HandleCoProcDO(uint32_t insn) { // This instruction simply instructs the co-processor to do something, no data is returned to ARM7 core arm7_do_callback(*m_program, insn, 0, 0); // simply pass entire opcode to callback - since data format is actually dependent on co-proc implementation } // Co-Processor Register Transfer - To/From Arm to Co-Proc -void arm7_cpu_device::HandleCoProcRT(UINT32 insn) +void arm7_cpu_device::HandleCoProcRT(uint32_t insn) { /* xxxx 1110 oooL nnnn dddd cccc ppp1 mmmm */ // Load (MRC) data from Co-Proc to ARM7 register if (insn & 0x00100000) // Bit 20 = Load or Store { - UINT32 res = arm7_rt_r_callback(*m_program, insn, 0); // RT Read handler must parse opcode & return appropriate result + uint32_t res = arm7_rt_r_callback(*m_program, insn, 0); // RT Read handler must parse opcode & return appropriate result if (!m_pendingUnd) { SetRegister((insn >> 12) & 0xf, res); @@ -337,13 +337,13 @@ void arm7_cpu_device::HandleCoProcRT(UINT32 insn) but if co-proc reads multiple address, it must handle the offset adjustment itself. */ // todo: test with valid instructions -void arm7_cpu_device::HandleCoProcDT(UINT32 insn) +void arm7_cpu_device::HandleCoProcDT(uint32_t insn) { - UINT32 rn = (insn >> 16) & 0xf; - UINT32 rnv = GetRegister(rn); // Get Address Value stored from Rn - UINT32 ornv = rnv; // Keep value of Rn - UINT32 off = (insn & 0xff) << 2; // Offset is << 2 according to manual - UINT32 *prn = &ARM7REG(rn); // Pointer to our register, so it can be changed in the callback + uint32_t rn = (insn >> 16) & 0xf; + uint32_t rnv = GetRegister(rn); // Get Address Value stored from Rn + uint32_t ornv = rnv; // Keep value of Rn + uint32_t off = (insn & 0xff) << 2; // Offset is << 2 according to manual + uint32_t *prn = &ARM7REG(rn); // Pointer to our register, so it can be changed in the callback #if ARM7_DEBUG_CORE if (((insn >> 16) & 0xf) == 15 && (insn & 0x200000)) @@ -378,9 +378,9 @@ void arm7_cpu_device::HandleCoProcDT(UINT32 insn) SetRegister(rn, ornv); } -void arm7_cpu_device::HandleBranch(UINT32 insn) +void arm7_cpu_device::HandleBranch(uint32_t insn) { - UINT32 off = (insn & INSN_BRANCH) << 2; + uint32_t off = (insn & INSN_BRANCH) << 2; /* Save PC into LR if this is a branch with link */ if (insn & INSN_BL) @@ -405,9 +405,9 @@ void arm7_cpu_device::HandleBranch(UINT32 insn) } } -void arm7_cpu_device::HandleMemSingle(UINT32 insn) +void arm7_cpu_device::HandleMemSingle(uint32_t insn) { - UINT32 rn, rnv, off, rd, rnv_old = 0; + uint32_t rn, rnv, off, rd, rnv_old = 0; /* Fetch the offset */ if (insn & INSN_I) @@ -477,7 +477,7 @@ void arm7_cpu_device::HandleMemSingle(UINT32 insn) /* Load */ if (insn & INSN_SDT_B) { - UINT32 data = READ8(rnv); + uint32_t data = READ8(rnv); if (!m_pendingAbtD) { SetRegister(rd, data); @@ -485,7 +485,7 @@ void arm7_cpu_device::HandleMemSingle(UINT32 insn) } else { - UINT32 data = READ32(rnv); + uint32_t data = READ32(rnv); if (!m_pendingAbtD) { if (rd == eR15) @@ -514,7 +514,7 @@ void arm7_cpu_device::HandleMemSingle(UINT32 insn) LOG(("Wrote R15 in byte mode\n")); #endif - WRITE8(rnv, (UINT8) GetRegister(rd) & 0xffu); + WRITE8(rnv, (uint8_t) GetRegister(rd) & 0xffu); } else { @@ -578,9 +578,9 @@ void arm7_cpu_device::HandleMemSingle(UINT32 insn) } /* HandleMemSingle */ -void arm7_cpu_device::HandleHalfWordDT(UINT32 insn) +void arm7_cpu_device::HandleHalfWordDT(uint32_t insn) { - UINT32 rn, rnv, off, rd, rnv_old = 0; + uint32_t rn, rnv, off, rd, rnv_old = 0; // Immediate or Register Offset? if (insn & 0x400000) { // Bit 22 - 1 = immediate, 0 = register @@ -641,22 +641,22 @@ void arm7_cpu_device::HandleHalfWordDT(UINT32 insn) // Signed? if (insn & 0x40) { - UINT32 newval; + uint32_t newval; // Signed Half Word? if (insn & 0x20) { - UINT16 signbyte, databyte; + uint16_t signbyte, databyte; databyte = READ16(rnv) & 0xFFFF; signbyte = (databyte & 0x8000) ? 0xffff : 0; - newval = (UINT32)(signbyte << 16)|databyte; + newval = (uint32_t)(signbyte << 16)|databyte; } // Signed Byte else { - UINT8 databyte; - UINT32 signbyte; + uint8_t databyte; + uint32_t signbyte; databyte = READ8(rnv) & 0xff; signbyte = (databyte & 0x80) ? 0xffffff : 0; - newval = (UINT32)(signbyte << 8)|databyte; + newval = (uint32_t)(signbyte << 8)|databyte; } if (!m_pendingAbtD) @@ -685,7 +685,7 @@ void arm7_cpu_device::HandleHalfWordDT(UINT32 insn) // Unsigned Half Word else { - UINT32 newval = READ16(rnv); + uint32_t newval = READ16(rnv); if (!m_pendingAbtD) { @@ -790,9 +790,9 @@ void arm7_cpu_device::HandleHalfWordDT(UINT32 insn) } -void arm7_cpu_device::HandleSwap(UINT32 insn) +void arm7_cpu_device::HandleSwap(uint32_t insn) { - UINT32 rn, rm, rd, tmp; + uint32_t rn, rm, rd, tmp; rn = GetRegister((insn >> 16) & 0xf); // reg. w/read address rm = GetRegister(insn & 0xf); // reg. w/write address @@ -822,10 +822,10 @@ void arm7_cpu_device::HandleSwap(UINT32 insn) ARM7_ICOUNT -= 1; } -void arm7_cpu_device::HandlePSRTransfer(UINT32 insn) +void arm7_cpu_device::HandlePSRTransfer(uint32_t insn) { int reg = (insn & 0x400000) ? SPSR : eCPSR; // Either CPSR or SPSR - UINT32 newval, val; + uint32_t newval, val; int oldmode = GET_CPSR & MODE_FLAG; // get old value of CPSR/SPSR @@ -924,10 +924,10 @@ void arm7_cpu_device::HandlePSRTransfer(UINT32 insn) } } -void arm7_cpu_device::HandleALU(UINT32 insn) +void arm7_cpu_device::HandleALU(uint32_t insn) { - UINT32 op2, sc = 0, rd, rn, opcode; - UINT32 by, rdn; + uint32_t op2, sc = 0, rd, rn, opcode; + uint32_t by, rdn; // Normal Data Processing : 1S // Data Processing with register specified shift : 1S + 1I @@ -1092,7 +1092,7 @@ void arm7_cpu_device::HandleALU(UINT32 insn) } else { - UINT32 temp; + uint32_t temp; R15 = rd; //(R15 & 0x03FFFFFC) | (rd & 0xFC000003); temp = (GET_CPSR & 0x0FFFFF20) | (rd & 0xF0000000) /* N Z C V */ | ((rd & 0x0C000000) >> (26 - 6)) /* I F */ | (rd & 0x00000003) /* M1 M0 */; set_cpsr( temp); @@ -1122,7 +1122,7 @@ void arm7_cpu_device::HandleALU(UINT32 insn) R15 = rd; else { - UINT32 temp; + uint32_t temp; R15 = (R15 & 0x03FFFFFC) | (rd & ~0x03FFFFFC); temp = (GET_CPSR & 0x0FFFFF20) | (rd & 0xF0000000) /* N Z C V */ | ((rd & 0x0C000000) >> (26 - 6)) /* I F */ | (rd & 0x00000003) /* M1 M0 */; set_cpsr( temp); @@ -1146,9 +1146,9 @@ void arm7_cpu_device::HandleALU(UINT32 insn) ARM7_ICOUNT += 2; } -void arm7_cpu_device::HandleMul(UINT32 insn) +void arm7_cpu_device::HandleMul(uint32_t insn) { - UINT32 r, rm, rs; + uint32_t r, rm, rs; // MUL takes 1S + mI and MLA 1S + (m+1)I cycles to execute, where S and I are as // defined in 6.2 Cycle Types on page 6-2. @@ -1196,18 +1196,18 @@ void arm7_cpu_device::HandleMul(UINT32 insn) } // todo: add proper cycle counts -void arm7_cpu_device::HandleSMulLong(UINT32 insn) +void arm7_cpu_device::HandleSMulLong(uint32_t insn) { - INT32 rm, rs; - UINT32 rhi, rlo; - INT64 res; + int32_t rm, rs; + uint32_t rhi, rlo; + int64_t res; // MULL takes 1S + (m+1)I and MLAL 1S + (m+2)I cycles to execute, where m is the // number of 8 bit multiplier array cycles required to complete the multiply, which is // controlled by the value of the multiplier operand specified by Rs. - rm = (INT32)GetRegister(insn & 0xf); - rs = (INT32)GetRegister(((insn >> 8) & 0xf)); + rm = (int32_t)GetRegister(insn & 0xf); + rs = (int32_t)GetRegister(((insn >> 8) & 0xf)); rhi = (insn >> 16) & 0xf; rlo = (insn >> 12) & 0xf; @@ -1217,12 +1217,12 @@ void arm7_cpu_device::HandleSMulLong(UINT32 insn) #endif /* Perform the multiplication */ - res = (INT64)rm * rs; + res = (int64_t)rm * rs; /* Add on Rn if this is a MLA */ if (insn & INSN_MUL_A) { - INT64 acum = (INT64)((((INT64)(GetRegister(rhi))) << 32) | GetRegister(rlo)); + int64_t acum = (int64_t)((((int64_t)(GetRegister(rhi))) << 32) | GetRegister(rlo)); res += acum; // extra cycle for MLA ARM7_ICOUNT -= 1; @@ -1248,18 +1248,18 @@ void arm7_cpu_device::HandleSMulLong(UINT32 insn) } // todo: add proper cycle counts -void arm7_cpu_device::HandleUMulLong(UINT32 insn) +void arm7_cpu_device::HandleUMulLong(uint32_t insn) { - UINT32 rm, rs; - UINT32 rhi, rlo; - UINT64 res; + uint32_t rm, rs; + uint32_t rhi, rlo; + uint64_t res; // MULL takes 1S + (m+1)I and MLAL 1S + (m+2)I cycles to execute, where m is the // number of 8 bit multiplier array cycles required to complete the multiply, which is // controlled by the value of the multiplier operand specified by Rs. - rm = (INT32)GetRegister(insn & 0xf); - rs = (INT32)GetRegister(((insn >> 8) & 0xf)); + rm = (int32_t)GetRegister(insn & 0xf); + rs = (int32_t)GetRegister(((insn >> 8) & 0xf)); rhi = (insn >> 16) & 0xf; rlo = (insn >> 12) & 0xf; @@ -1269,12 +1269,12 @@ void arm7_cpu_device::HandleUMulLong(UINT32 insn) #endif /* Perform the multiplication */ - res = (UINT64)rm * rs; + res = (uint64_t)rm * rs; /* Add on Rn if this is a MLA */ if (insn & INSN_MUL_A) { - UINT64 acum = (UINT64)((((UINT64)(GetRegister(rhi))) << 32) | GetRegister(rlo)); + uint64_t acum = (uint64_t)((((uint64_t)(GetRegister(rhi))) << 32) | GetRegister(rlo)); res += acum; // extra cycle for MLA ARM7_ICOUNT -= 1; @@ -1298,10 +1298,10 @@ void arm7_cpu_device::HandleUMulLong(UINT32 insn) ARM7_ICOUNT += 3; } -void arm7_cpu_device::HandleMemBlock(UINT32 insn) +void arm7_cpu_device::HandleMemBlock(uint32_t insn) { - UINT32 rb = (insn & INSN_RN) >> INSN_RN_SHIFT; - UINT32 rbp = GetRegister(rb); + uint32_t rb = (insn & INSN_RN) >> INSN_RN_SHIFT; + uint32_t rbp = GetRegister(rb); int result; #if ARM7_DEBUG_CORE @@ -1368,7 +1368,7 @@ void arm7_cpu_device::HandleMemBlock(UINT32 insn) } else { - UINT32 temp; + uint32_t temp; // LOG(("LDM + S | R15 %08X CPSR %08X\n", R15, GET_CPSR)); temp = (GET_CPSR & 0x0FFFFF20) | (R15 & 0xF0000000) /* N Z C V */ | ((R15 & 0x0C000000) >> (26 - 6)) /* I F */ | (R15 & 0x00000003) /* M1 M0 */; set_cpsr( temp); @@ -1425,7 +1425,7 @@ void arm7_cpu_device::HandleMemBlock(UINT32 insn) } else { - UINT32 temp; + uint32_t temp; // LOG(("LDM + S | R15 %08X CPSR %08X\n", R15, GET_CPSR)); temp = (GET_CPSR & 0x0FFFFF20) /* N Z C V I F M4 M3 M2 M1 M0 */ | (R15 & 0xF0000000) /* N Z C V */ | ((R15 & 0x0C000000) >> (26 - 6)) /* I F */ | (R15 & 0x00000003) /* M1 M0 */; set_cpsr(temp); @@ -1527,7 +1527,7 @@ const arm7_cpu_device::arm7ops_ophandler arm7_cpu_device::ops_handler[0x10] = &arm7_cpu_device::arm7ops_cd, &arm7_cpu_device::arm7ops_cd, &arm7_cpu_device::arm7ops_e, &arm7_cpu_device::arm7ops_f, }; -void arm7_cpu_device::arm7ops_0123(UINT32 insn) +void arm7_cpu_device::arm7ops_0123(uint32_t insn) { //case 0: //case 1: @@ -1545,8 +1545,8 @@ void arm7_cpu_device::arm7ops_0123(UINT32 insn) } else if ((insn & 0x0ff000f0) == 0x01600010) // CLZ - v5 { - UINT32 rm = insn&0xf; - UINT32 rd = (insn>>12)&0xf; + uint32_t rm = insn&0xf; + uint32_t rd = (insn>>12)&0xf; SetRegister(rd, count_leading_zeros(GetRegister(rm))); @@ -1554,63 +1554,63 @@ void arm7_cpu_device::arm7ops_0123(UINT32 insn) } else if ((insn & 0x0ff000f0) == 0x01000050) // QADD - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>16)&0xf); - INT64 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>16)&0xf); + int64_t res; - res = saturate_qbit_overflow((INT64)src1 + (INT64)src2); + res = saturate_qbit_overflow((int64_t)src1 + (int64_t)src2); - SetRegister((insn>>12)&0xf, (INT32)res); + SetRegister((insn>>12)&0xf, (int32_t)res); R15 += 4; } else if ((insn & 0x0ff000f0) == 0x01400050) // QDADD - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>16)&0xf); - INT64 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>16)&0xf); + int64_t res; // check if doubling operation will overflow - res = (INT64)src2 * 2; + res = (int64_t)src2 * 2; saturate_qbit_overflow(res); src2 *= 2; - res = saturate_qbit_overflow((INT64)src1 + (INT64)src2); + res = saturate_qbit_overflow((int64_t)src1 + (int64_t)src2); - SetRegister((insn>>12)&0xf, (INT32)res); + SetRegister((insn>>12)&0xf, (int32_t)res); R15 += 4; } else if ((insn & 0x0ff000f0) == 0x01200050) // QSUB - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>16)&0xf); - INT64 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>16)&0xf); + int64_t res; - res = saturate_qbit_overflow((INT64)src1 - (INT64)src2); + res = saturate_qbit_overflow((int64_t)src1 - (int64_t)src2); - SetRegister((insn>>12)&0xf, (INT32)res); + SetRegister((insn>>12)&0xf, (int32_t)res); R15 += 4; } else if ((insn & 0x0ff000f0) == 0x01600050) // QDSUB - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>16)&0xf); - INT64 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>16)&0xf); + int64_t res; // check if doubling operation will overflow - res = (INT64)src2 * 2; + res = (int64_t)src2 * 2; saturate_qbit_overflow(res); src2 *= 2; - res = saturate_qbit_overflow((INT64)src1 - (INT64)src2); + res = saturate_qbit_overflow((int64_t)src1 - (int64_t)src2); - SetRegister((insn>>12)&0xf, (INT32)res); + SetRegister((insn>>12)&0xf, (int32_t)res); R15 += 4; } else if ((insn & 0x0ff00090) == 0x01000080) // SMLAxy - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>8)&0xf); - INT32 res1; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>8)&0xf); + int32_t res1; // select top and bottom halves of src1/src2 and sign extend if necessary if (insn & 0x20) @@ -1638,33 +1638,33 @@ void arm7_cpu_device::arm7ops_0123(UINT32 insn) // do the signed multiply res1 = src1 * src2; // and the accumulate. NOTE: only the accumulate can cause an overflow, which is why we do it this way. - saturate_qbit_overflow((INT64)res1 + (INT64)GetRegister((insn>>12)&0xf)); + saturate_qbit_overflow((int64_t)res1 + (int64_t)GetRegister((insn>>12)&0xf)); SetRegister((insn>>16)&0xf, res1 + GetRegister((insn>>12)&0xf)); R15 += 4; } else if ((insn & 0x0ff00090) == 0x01400080) // SMLALxy - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>8)&0xf); - INT64 dst; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>8)&0xf); + int64_t dst; - dst = (INT64)GetRegister((insn>>12)&0xf); - dst |= (INT64)GetRegister((insn>>16)&0xf)<<32; + dst = (int64_t)GetRegister((insn>>12)&0xf); + dst |= (int64_t)GetRegister((insn>>16)&0xf)<<32; // do the multiply and accumulate - dst += (INT64)src1 * (INT64)src2; + dst += (int64_t)src1 * (int64_t)src2; // write back the result - SetRegister((insn>>12)&0xf, (UINT32)dst); - SetRegister((insn>>16)&0xf, (UINT32)(dst >> 32)); + SetRegister((insn>>12)&0xf, (uint32_t)dst); + SetRegister((insn>>16)&0xf, (uint32_t)(dst >> 32)); R15 += 4; } else if ((insn & 0x0ff00090) == 0x01600080) // SMULxy - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>8)&0xf); - INT32 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>8)&0xf); + int32_t res; // select top and bottom halves of src1/src2 and sign extend if necessary if (insn & 0x20) @@ -1695,9 +1695,9 @@ void arm7_cpu_device::arm7ops_0123(UINT32 insn) } else if ((insn & 0x0ff000b0) == 0x012000a0) // SMULWy - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>8)&0xf); - INT64 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>8)&0xf); + int64_t res; if (insn & 0x40) { @@ -1710,17 +1710,17 @@ void arm7_cpu_device::arm7ops_0123(UINT32 insn) src2 |= 0xffff0000; } - res = (INT64)src1 * (INT64)src2; + res = (int64_t)src1 * (int64_t)src2; res >>= 16; - SetRegister((insn>>16)&0xf, (UINT32)res); + SetRegister((insn>>16)&0xf, (uint32_t)res); R15 += 4; } else if ((insn & 0x0ff000b0) == 0x01200080) // SMLAWy - v5 { - INT32 src1 = GetRegister(insn&0xf); - INT32 src2 = GetRegister((insn>>8)&0xf); - INT32 src3 = GetRegister((insn>>12)&0xf); - INT64 res; + int32_t src1 = GetRegister(insn&0xf); + int32_t src2 = GetRegister((insn>>8)&0xf); + int32_t src3 = GetRegister((insn>>12)&0xf); + int64_t res; if (insn & 0x40) { @@ -1733,17 +1733,17 @@ void arm7_cpu_device::arm7ops_0123(UINT32 insn) src2 |= 0xffff0000; } - res = (INT64)src1 * (INT64)src2; + res = (int64_t)src1 * (int64_t)src2; res >>= 16; // check for overflow and set the Q bit - saturate_qbit_overflow((INT64)src3 + res); + saturate_qbit_overflow((int64_t)src3 + res); // do the real accumulate - src3 += (INT32)res; + src3 += (int32_t)res; // write the result back - SetRegister((insn>>16)&0xf, (UINT32)res); + SetRegister((insn>>16)&0xf, (uint32_t)res); R15 += 4; } else @@ -1800,7 +1800,7 @@ void arm7_cpu_device::arm7ops_0123(UINT32 insn) // break; } -void arm7_cpu_device::arm7ops_4567(UINT32 insn) /* Data Transfer - Single Data Access */ +void arm7_cpu_device::arm7ops_4567(uint32_t insn) /* Data Transfer - Single Data Access */ { //case 4: //case 5: @@ -1811,7 +1811,7 @@ void arm7_cpu_device::arm7ops_4567(UINT32 insn) /* Data Transfer - Single Data A // break; } -void arm7_cpu_device::arm7ops_89(UINT32 insn) /* Block Data Transfer/Access */ +void arm7_cpu_device::arm7ops_89(uint32_t insn) /* Block Data Transfer/Access */ { //case 8: //case 9: @@ -1820,7 +1820,7 @@ void arm7_cpu_device::arm7ops_89(UINT32 insn) /* Block Data Transfer/Access */ // break; } -void arm7_cpu_device::arm7ops_ab(UINT32 insn) /* Branch or Branch & Link */ +void arm7_cpu_device::arm7ops_ab(uint32_t insn) /* Branch or Branch & Link */ { //case 0xa: //case 0xb: @@ -1828,7 +1828,7 @@ void arm7_cpu_device::arm7ops_ab(UINT32 insn) /* Branch or Branch & Link */ // break; } -void arm7_cpu_device::arm7ops_cd(UINT32 insn) /* Co-Processor Data Transfer */ +void arm7_cpu_device::arm7ops_cd(uint32_t insn) /* Co-Processor Data Transfer */ { //case 0xc: //case 0xd: @@ -1837,7 +1837,7 @@ void arm7_cpu_device::arm7ops_cd(UINT32 insn) /* Co-Processor Data Transfer */ // break; } -void arm7_cpu_device::arm7ops_e(UINT32 insn) /* Co-Processor Data Operation or Register Transfer */ +void arm7_cpu_device::arm7ops_e(uint32_t insn) /* Co-Processor Data Operation or Register Transfer */ { //case 0xe: if (insn & 0x10) @@ -1848,7 +1848,7 @@ void arm7_cpu_device::arm7ops_e(UINT32 insn) /* Co-Processor Data Operation or R // break; } -void arm7_cpu_device::arm7ops_f(UINT32 insn) /* Software Interrupt */ +void arm7_cpu_device::arm7ops_f(uint32_t insn) /* Software Interrupt */ { m_pendingSwi = true; update_irq_state(); diff --git a/src/devices/cpu/arm7/arm7tdrc.hxx b/src/devices/cpu/arm7/arm7tdrc.hxx index ee0573a32e7..fac7a70f7fa 100644 --- a/src/devices/cpu/arm7/arm7tdrc.hxx +++ b/src/devices/cpu/arm7/arm7tdrc.hxx @@ -7,7 +7,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[0x40*0x10] = { -// #define THUMB_SHIFT_R ((UINT16)0x0800) +// #define THUMB_SHIFT_R ((uint16_t)0x0800) &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, &arm7_cpu_device::drctg00_0, @@ -16,7 +16,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, &arm7_cpu_device::drctg00_1, -// #define THUMB_INSN_ADDSUB ((UINT16)0x0800) // #define THUMB_ADDSUB_TYPE ((UINT16)0x0600) +// #define THUMB_INSN_ADDSUB ((uint16_t)0x0800) // #define THUMB_ADDSUB_TYPE ((uint16_t)0x0600) &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, &arm7_cpu_device::drctg01_0, @@ -25,7 +25,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg01_11, &arm7_cpu_device::drctg01_11, &arm7_cpu_device::drctg01_11, &arm7_cpu_device::drctg01_11, &arm7_cpu_device::drctg01_11, &arm7_cpu_device::drctg01_11, &arm7_cpu_device::drctg01_11, &arm7_cpu_device::drctg01_11, &arm7_cpu_device::drctg01_12, &arm7_cpu_device::drctg01_12, &arm7_cpu_device::drctg01_12, &arm7_cpu_device::drctg01_12, &arm7_cpu_device::drctg01_12, &arm7_cpu_device::drctg01_12, &arm7_cpu_device::drctg01_12, &arm7_cpu_device::drctg01_12, &arm7_cpu_device::drctg01_13, &arm7_cpu_device::drctg01_13, &arm7_cpu_device::drctg01_13, &arm7_cpu_device::drctg01_13, &arm7_cpu_device::drctg01_13, &arm7_cpu_device::drctg01_13, &arm7_cpu_device::drctg01_13, &arm7_cpu_device::drctg01_13, -// #define THUMB_INSN_CMP ((UINT16)0x0800) +// #define THUMB_INSN_CMP ((uint16_t)0x0800) &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, &arm7_cpu_device::drctg02_0, @@ -34,7 +34,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, &arm7_cpu_device::drctg02_1, -// #define THUMB_INSN_SUB ((UINT16)0x0800) +// #define THUMB_INSN_SUB ((uint16_t)0x0800) &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, &arm7_cpu_device::drctg03_0, @@ -43,7 +43,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, &arm7_cpu_device::drctg03_1, -//#define THUMB_GROUP4_TYPE ((UINT16)0x0c00) //#define THUMB_ALUOP_TYPE ((UINT16)0x03c0) // #define THUMB_HIREG_OP ((UINT16)0x0300) // #define THUMB_HIREG_H ((UINT16)0x00c0) +//#define THUMB_GROUP4_TYPE ((uint16_t)0x0c00) //#define THUMB_ALUOP_TYPE ((uint16_t)0x03c0) // #define THUMB_HIREG_OP ((uint16_t)0x0300) // #define THUMB_HIREG_H ((uint16_t)0x00c0) &arm7_cpu_device::drctg04_00_00, &arm7_cpu_device::drctg04_00_01, &arm7_cpu_device::drctg04_00_02, &arm7_cpu_device::drctg04_00_03, &arm7_cpu_device::drctg04_00_04, &arm7_cpu_device::drctg04_00_05, &arm7_cpu_device::drctg04_00_06, &arm7_cpu_device::drctg04_00_07, &arm7_cpu_device::drctg04_00_08, &arm7_cpu_device::drctg04_00_09, &arm7_cpu_device::drctg04_00_0a, &arm7_cpu_device::drctg04_00_0b, &arm7_cpu_device::drctg04_00_0c, &arm7_cpu_device::drctg04_00_0d, &arm7_cpu_device::drctg04_00_0e, &arm7_cpu_device::drctg04_00_0f, &arm7_cpu_device::drctg04_01_00, &arm7_cpu_device::drctg04_01_01, &arm7_cpu_device::drctg04_01_02, &arm7_cpu_device::drctg04_01_03, &arm7_cpu_device::drctg04_01_10, &arm7_cpu_device::drctg04_01_11, &arm7_cpu_device::drctg04_01_12, &arm7_cpu_device::drctg04_01_13, @@ -52,7 +52,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, &arm7_cpu_device::drctg04_0203, -//#define THUMB_GROUP5_TYPE ((UINT16)0x0e00) +//#define THUMB_GROUP5_TYPE ((uint16_t)0x0e00) &arm7_cpu_device::drctg05_0, &arm7_cpu_device::drctg05_0, &arm7_cpu_device::drctg05_0, &arm7_cpu_device::drctg05_0, &arm7_cpu_device::drctg05_0, &arm7_cpu_device::drctg05_0, &arm7_cpu_device::drctg05_0, &arm7_cpu_device::drctg05_0, &arm7_cpu_device::drctg05_1, &arm7_cpu_device::drctg05_1, &arm7_cpu_device::drctg05_1, &arm7_cpu_device::drctg05_1, &arm7_cpu_device::drctg05_1, &arm7_cpu_device::drctg05_1, &arm7_cpu_device::drctg05_1, &arm7_cpu_device::drctg05_1, &arm7_cpu_device::drctg05_2, &arm7_cpu_device::drctg05_2, &arm7_cpu_device::drctg05_2, &arm7_cpu_device::drctg05_2, &arm7_cpu_device::drctg05_2, &arm7_cpu_device::drctg05_2, &arm7_cpu_device::drctg05_2, &arm7_cpu_device::drctg05_2, @@ -61,7 +61,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg05_5, &arm7_cpu_device::drctg05_5, &arm7_cpu_device::drctg05_5, &arm7_cpu_device::drctg05_5, &arm7_cpu_device::drctg05_5, &arm7_cpu_device::drctg05_5, &arm7_cpu_device::drctg05_5, &arm7_cpu_device::drctg05_5, &arm7_cpu_device::drctg05_6, &arm7_cpu_device::drctg05_6, &arm7_cpu_device::drctg05_6, &arm7_cpu_device::drctg05_6, &arm7_cpu_device::drctg05_6, &arm7_cpu_device::drctg05_6, &arm7_cpu_device::drctg05_6, &arm7_cpu_device::drctg05_6, &arm7_cpu_device::drctg05_7, &arm7_cpu_device::drctg05_7, &arm7_cpu_device::drctg05_7, &arm7_cpu_device::drctg05_7, &arm7_cpu_device::drctg05_7, &arm7_cpu_device::drctg05_7, &arm7_cpu_device::drctg05_7, &arm7_cpu_device::drctg05_7, -//#define THUMB_LSOP_L ((UINT16)0x0800) +//#define THUMB_LSOP_L ((uint16_t)0x0800) &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, &arm7_cpu_device::drctg06_0, @@ -70,7 +70,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, &arm7_cpu_device::drctg06_1, -//#define THUMB_LSOP_L ((UINT16)0x0800) +//#define THUMB_LSOP_L ((uint16_t)0x0800) &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, &arm7_cpu_device::drctg07_0, @@ -79,7 +79,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, &arm7_cpu_device::drctg07_1, -// #define THUMB_HALFOP_L ((UINT16)0x0800) +// #define THUMB_HALFOP_L ((uint16_t)0x0800) &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, &arm7_cpu_device::drctg08_0, @@ -88,7 +88,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, &arm7_cpu_device::drctg08_1, -// #define THUMB_STACKOP_L ((UINT16)0x0800) +// #define THUMB_STACKOP_L ((uint16_t)0x0800) &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, &arm7_cpu_device::drctg09_0, @@ -97,7 +97,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, &arm7_cpu_device::drctg09_1, -// #define THUMB_RELADDR_SP ((UINT16)0x0800) +// #define THUMB_RELADDR_SP ((uint16_t)0x0800) &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, &arm7_cpu_device::drctg0a_0, @@ -106,7 +106,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, &arm7_cpu_device::drctg0a_1, -// #define THUMB_STACKOP_TYPE ((UINT16)0x0f00) +// #define THUMB_STACKOP_TYPE ((uint16_t)0x0f00) &arm7_cpu_device::drctg0b_0, &arm7_cpu_device::drctg0b_0, &arm7_cpu_device::drctg0b_0, &arm7_cpu_device::drctg0b_0, &arm7_cpu_device::drctg0b_1, &arm7_cpu_device::drctg0b_1, &arm7_cpu_device::drctg0b_1, &arm7_cpu_device::drctg0b_1, &arm7_cpu_device::drctg0b_2, &arm7_cpu_device::drctg0b_2, &arm7_cpu_device::drctg0b_2, &arm7_cpu_device::drctg0b_2, &arm7_cpu_device::drctg0b_3, &arm7_cpu_device::drctg0b_3, &arm7_cpu_device::drctg0b_3, &arm7_cpu_device::drctg0b_3, &arm7_cpu_device::drctg0b_4, &arm7_cpu_device::drctg0b_4, &arm7_cpu_device::drctg0b_4, &arm7_cpu_device::drctg0b_4, &arm7_cpu_device::drctg0b_5, &arm7_cpu_device::drctg0b_5, &arm7_cpu_device::drctg0b_5, &arm7_cpu_device::drctg0b_5, @@ -115,7 +115,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg0b_a, &arm7_cpu_device::drctg0b_a, &arm7_cpu_device::drctg0b_a, &arm7_cpu_device::drctg0b_a, &arm7_cpu_device::drctg0b_b, &arm7_cpu_device::drctg0b_b, &arm7_cpu_device::drctg0b_b, &arm7_cpu_device::drctg0b_b, &arm7_cpu_device::drctg0b_c, &arm7_cpu_device::drctg0b_c, &arm7_cpu_device::drctg0b_c, &arm7_cpu_device::drctg0b_c, &arm7_cpu_device::drctg0b_d, &arm7_cpu_device::drctg0b_d, &arm7_cpu_device::drctg0b_d, &arm7_cpu_device::drctg0b_d, &arm7_cpu_device::drctg0b_e, &arm7_cpu_device::drctg0b_e, &arm7_cpu_device::drctg0b_e, &arm7_cpu_device::drctg0b_e, &arm7_cpu_device::drctg0b_f, &arm7_cpu_device::drctg0b_f, &arm7_cpu_device::drctg0b_f, &arm7_cpu_device::drctg0b_f, -// #define THUMB_MULTLS ((UINT16)0x0800) +// #define THUMB_MULTLS ((uint16_t)0x0800) &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, &arm7_cpu_device::drctg0c_0, @@ -124,7 +124,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, &arm7_cpu_device::drctg0c_1, -// #define THUMB_COND_TYPE ((UINT16)0x0f00) +// #define THUMB_COND_TYPE ((uint16_t)0x0f00) &arm7_cpu_device::drctg0d_0, &arm7_cpu_device::drctg0d_0, &arm7_cpu_device::drctg0d_0, &arm7_cpu_device::drctg0d_0, &arm7_cpu_device::drctg0d_1, &arm7_cpu_device::drctg0d_1, &arm7_cpu_device::drctg0d_1, &arm7_cpu_device::drctg0d_1, &arm7_cpu_device::drctg0d_2, &arm7_cpu_device::drctg0d_2, &arm7_cpu_device::drctg0d_2, &arm7_cpu_device::drctg0d_2, &arm7_cpu_device::drctg0d_3, &arm7_cpu_device::drctg0d_3, &arm7_cpu_device::drctg0d_3, &arm7_cpu_device::drctg0d_3, &arm7_cpu_device::drctg0d_4, &arm7_cpu_device::drctg0d_4, &arm7_cpu_device::drctg0d_4, &arm7_cpu_device::drctg0d_4, &arm7_cpu_device::drctg0d_5, &arm7_cpu_device::drctg0d_5, &arm7_cpu_device::drctg0d_5, &arm7_cpu_device::drctg0d_5, @@ -133,7 +133,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg0d_a, &arm7_cpu_device::drctg0d_a, &arm7_cpu_device::drctg0d_a, &arm7_cpu_device::drctg0d_a, &arm7_cpu_device::drctg0d_b, &arm7_cpu_device::drctg0d_b, &arm7_cpu_device::drctg0d_b, &arm7_cpu_device::drctg0d_b, &arm7_cpu_device::drctg0d_c, &arm7_cpu_device::drctg0d_c, &arm7_cpu_device::drctg0d_c, &arm7_cpu_device::drctg0d_c, &arm7_cpu_device::drctg0d_d, &arm7_cpu_device::drctg0d_d, &arm7_cpu_device::drctg0d_d, &arm7_cpu_device::drctg0d_d, &arm7_cpu_device::drctg0d_e, &arm7_cpu_device::drctg0d_e, &arm7_cpu_device::drctg0d_e, &arm7_cpu_device::drctg0d_e, &arm7_cpu_device::drctg0d_f, &arm7_cpu_device::drctg0d_f, &arm7_cpu_device::drctg0d_f, &arm7_cpu_device::drctg0d_f, -// #define THUMB_BLOP_LO ((UINT16)0x0800) +// #define THUMB_BLOP_LO ((uint16_t)0x0800) &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, &arm7_cpu_device::drctg0e_0, @@ -142,7 +142,7 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, &arm7_cpu_device::drctg0e_1, -// #define THUMB_BLOP_LO ((UINT16)0x0800) +// #define THUMB_BLOP_LO ((uint16_t)0x0800) &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, &arm7_cpu_device::drctg0f_0, @@ -157,10 +157,10 @@ const arm7_cpu_device::arm7thumb_drcophandler arm7_cpu_device::drcthumb_handler[ void arm7_cpu_device::drctg00_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Shift left */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - INT32 offs = (op & THUMB_SHIFT_AMT) >> THUMB_SHIFT_AMT_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + int32_t offs = (op & THUMB_SHIFT_AMT) >> THUMB_SHIFT_AMT_SHIFT; UML_MOV(block, uml::I0, DRC_RS); // rrs if (offs != 0) @@ -184,10 +184,10 @@ void arm7_cpu_device::drctg00_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg00_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Shift right */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - INT32 offs = (op & THUMB_SHIFT_AMT) >> THUMB_SHIFT_AMT_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + int32_t offs = (op & THUMB_SHIFT_AMT) >> THUMB_SHIFT_AMT_SHIFT; UML_MOV(block, uml::I0, DRC_RS); // rrs if (offs != 0) @@ -218,10 +218,10 @@ void arm7_cpu_device::drctg00_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg01_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - INT32 offs = (op & THUMB_SHIFT_AMT) >> THUMB_SHIFT_AMT_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + int32_t offs = (op & THUMB_SHIFT_AMT) >> THUMB_SHIFT_AMT_SHIFT; /* ASR.. */ UML_MOV(block, uml::I0, DRC_RS); @@ -262,40 +262,40 @@ void arm7_cpu_device::drctg01_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg01_10(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 rn = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rn = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_ADD(block, DRC_REG(rd), DRC_REG(rs), DRC_REG(rn)); DRCHandleThumbALUAddFlags(DRC_REG(rd), DRC_REG(rs), DRC_REG(rn)); } void arm7_cpu_device::drctg01_11(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* SUB Rd, Rs, Rn */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rn = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rn = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_SUB(block, DRC_REG(rd), DRC_REG(rs), DRC_REG(rn)); DRCHandleThumbALUSubFlags(DRC_REG(rd), DRC_REG(rs), DRC_REG(rn)); } void arm7_cpu_device::drctg01_12(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ADD Rd, Rs, #imm */ { - UINT32 op = desc->opptr.l[0]; - UINT32 imm = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t imm = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_ADD(block, DRC_REG(rd), DRC_REG(rs), imm); DRCHandleThumbALUAddFlags(DRC_REG(rd), DRC_REG(rs), imm); } void arm7_cpu_device::drctg01_13(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* SUB Rd, Rs, #imm */ { - UINT32 op = desc->opptr.l[0]; - UINT32 imm = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t imm = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_SUB(block, DRC_REG(rd), DRC_REG(rs), imm); DRCHandleThumbALUSubFlags(DRC_REG(rd), DRC_REG(rs), imm); } @@ -304,9 +304,9 @@ void arm7_cpu_device::drctg01_13(drcuml_block *block, compiler_state *compiler, void arm7_cpu_device::drctg02_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; - UINT32 op2 = (op & THUMB_INSN_IMM); + uint32_t op = desc->opptr.l[0]; + uint32_t rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; + uint32_t op2 = (op & THUMB_INSN_IMM); UML_MOV(block, DRC_REG(rd), op2); UML_AND(block, DRC_CPSR, DRC_CPSR, ~(Z_MASK | N_MASK)); DRCHandleALUNZFlags(DRC_REG(rd)); @@ -316,9 +316,9 @@ void arm7_cpu_device::drctg02_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg02_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 rn = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; - UINT32 op2 = op & THUMB_INSN_IMM; + uint32_t op = desc->opptr.l[0]; + uint32_t rn = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; + uint32_t op2 = op & THUMB_INSN_IMM; UML_SUB(block, uml::I3, DRC_REG(rn), op2); DRCHandleThumbALUSubFlags(uml::I3, DRC_REG(rn), op2); @@ -328,20 +328,20 @@ void arm7_cpu_device::drctg02_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg03_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ADD Rd, #Offset8 */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rn = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; - UINT32 op2 = op & THUMB_INSN_IMM; - UINT32 rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rn = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; + uint32_t op2 = op & THUMB_INSN_IMM; + uint32_t rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; UML_ADD(block, DRC_REG(rd), DRC_REG(rn), op2); DRCHandleThumbALUAddFlags(DRC_REG(rd), DRC_REG(rn), op2); } void arm7_cpu_device::drctg03_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* SUB Rd, #Offset8 */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rn = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; - UINT32 op2 = op & THUMB_INSN_IMM; - UINT32 rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rn = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; + uint32_t op2 = op & THUMB_INSN_IMM; + uint32_t rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; UML_SUB(block, DRC_REG(rd), DRC_REG(rn), op2); DRCHandleThumbALUSubFlags(DRC_REG(rd), DRC_REG(rn), op2); } @@ -350,9 +350,9 @@ void arm7_cpu_device::drctg03_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg04_00_00(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* AND Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_AND(block, DRC_REG(rd), DRC_REG(rd), DRC_REG(rs)); UML_AND(block, DRC_CPSR, DRC_CPSR, ~(Z_MASK | N_MASK)); DRCHandleALUNZFlags(DRC_REG(rd)); @@ -362,9 +362,9 @@ void arm7_cpu_device::drctg04_00_00(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_01(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* EOR Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_XOR(block, DRC_REG(rd), DRC_REG(rd), DRC_REG(rs)); UML_AND(block, DRC_CPSR, DRC_CPSR, ~(Z_MASK | N_MASK)); DRCHandleALUNZFlags(DRC_REG(rd)); @@ -374,9 +374,9 @@ void arm7_cpu_device::drctg04_00_01(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_02(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* LSL Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; uml::code_label skip; uml::code_label offsg32; uml::code_label offs32; @@ -421,9 +421,9 @@ void arm7_cpu_device::drctg04_00_02(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_03(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* LSR Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; uml::code_label skip; uml::code_label offsg32; uml::code_label offs32; @@ -466,9 +466,9 @@ void arm7_cpu_device::drctg04_00_03(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_04(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ASR Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; uml::code_label skip; uml::code_label offsg32; uml::code_label offs32; @@ -514,9 +514,9 @@ void arm7_cpu_device::drctg04_00_04(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_05(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ADC Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_TEST(block, DRC_CPSR, C_MASK); UML_MOVc(block, uml::COND_NZ, uml::I3, 1); UML_MOVc(block, uml::COND_Z, uml::I3, 0); @@ -528,9 +528,9 @@ void arm7_cpu_device::drctg04_00_05(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_06(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* SBC Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_TEST(block, DRC_CPSR, C_MASK); UML_MOVc(block, uml::COND_NZ, uml::I3, 0); UML_MOVc(block, uml::COND_Z, uml::I3, 1); @@ -542,9 +542,9 @@ void arm7_cpu_device::drctg04_00_06(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_07(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ROR Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_MOV(block, uml::I0, DRC_REG(rd)); UML_AND(block, uml::I1, DRC_REG(rs), 0x1f); UML_SHR(block, DRC_REG(rd), uml::I0, uml::I1); @@ -564,9 +564,9 @@ void arm7_cpu_device::drctg04_00_07(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_08(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* TST Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_AND(block, DRC_CPSR, DRC_CPSR, ~(Z_MASK | N_MASK)); UML_AND(block, uml::I2, DRC_REG(rd), DRC_REG(rs)); DRCHandleALUNZFlags(uml::I2); @@ -576,9 +576,9 @@ void arm7_cpu_device::drctg04_00_08(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_09(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* NEG Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_MOV(block, uml::I3, DRC_REG(rs)); UML_SUB(block, DRC_REG(rd), 0, uml::I3); DRCHandleThumbALUSubFlags(DRC_REG(rd), 0, uml::I3); @@ -586,27 +586,27 @@ void arm7_cpu_device::drctg04_00_09(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_0a(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* CMP Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_SUB(block, uml::I3, DRC_REG(rd), DRC_REG(rs)); DRCHandleThumbALUSubFlags(uml::I3, DRC_REG(rd), DRC_REG(rs)); } void arm7_cpu_device::drctg04_00_0b(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* CMN Rd, Rs - check flags, add dasm */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_ADD(block, uml::I3, DRC_REG(rd), DRC_REG(rs)); DRCHandleThumbALUAddFlags(uml::I3, DRC_REG(rd), DRC_REG(rs)); } void arm7_cpu_device::drctg04_00_0c(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ORR Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_OR(block, DRC_REG(rd), DRC_REG(rd), DRC_REG(rs)); UML_AND(block, DRC_CPSR, DRC_CPSR, ~(Z_MASK | N_MASK)); DRCHandleALUNZFlags(DRC_REG(rd)); @@ -616,9 +616,9 @@ void arm7_cpu_device::drctg04_00_0c(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_0d(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* MUL Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_AND(block, DRC_CPSR, DRC_CPSR, ~(Z_MASK | N_MASK)); UML_MULU(block, DRC_REG(rd), uml::I1, DRC_REG(rd), DRC_REG(rs)); DRCHandleALUNZFlags(DRC_REG(rd)); @@ -628,9 +628,9 @@ void arm7_cpu_device::drctg04_00_0d(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_0e(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* BIC Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_AND(block, DRC_CPSR, DRC_CPSR, ~(Z_MASK | N_MASK)); UML_XOR(block, uml::I0, DRC_REG(rs), ~0); UML_AND(block, DRC_REG(rd), DRC_REG(rd), uml::I0); @@ -641,9 +641,9 @@ void arm7_cpu_device::drctg04_00_0e(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_00_0f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* MVN Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_XOR(block, uml::I0, DRC_REG(rs), ~0); UML_MOV(block, DRC_REG(rd), uml::I0); UML_AND(block, DRC_CPSR, DRC_CPSR, ~(Z_MASK | N_MASK)); @@ -656,16 +656,16 @@ void arm7_cpu_device::drctg04_00_0f(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_00(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: G4-1-0 Undefined Thumb instruction: %04x %x\n", pc, op, (op & THUMB_HIREG_H) >> THUMB_HIREG_H_SHIFT); } void arm7_cpu_device::drctg04_01_01(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ADD Rd, HRs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_ADD(block, DRC_REG(rd), DRC_REG(rd), DRC_REG(rs+8)); if (rs == 7) { @@ -676,9 +676,9 @@ void arm7_cpu_device::drctg04_01_01(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_02(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ADD HRd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_ADD(block, DRC_REG(rd+8), DRC_REG(rd+8), DRC_REG(rs)); if (rd == 7) { @@ -689,9 +689,9 @@ void arm7_cpu_device::drctg04_01_02(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_03(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Add HRd, HRs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_ADD(block, DRC_REG(rd+8), DRC_REG(rd+8), DRC_REG(rs+8)); // emulate the effects of pre-fetch if (rs == 7) @@ -707,36 +707,36 @@ void arm7_cpu_device::drctg04_01_03(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_10(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* CMP Rd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_SUB(block, uml::I3, DRC_REG(rd), DRC_REG(rs)); DRCHandleThumbALUSubFlags(uml::I3, DRC_REG(rd), DRC_REG(rs)); } void arm7_cpu_device::drctg04_01_11(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* CMP Rd, Hs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_SUB(block, uml::I3, DRC_REG(rd), DRC_REG(rs+8)); DRCHandleThumbALUSubFlags(uml::I3, DRC_REG(rd), DRC_REG(rs+8)); } void arm7_cpu_device::drctg04_01_12(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* CMP Hd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_SUB(block, uml::I3, DRC_REG(rd+8), DRC_REG(rs)); DRCHandleThumbALUSubFlags(uml::I3, DRC_REG(rd+8), DRC_REG(rs)); } void arm7_cpu_device::drctg04_01_13(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* CMP Hd, Hs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_SUB(block, uml::I3, DRC_REG(rd+8), DRC_REG(rs+8)); DRCHandleThumbALUSubFlags(uml::I3, DRC_REG(rd+8), DRC_REG(rs+8)); } @@ -745,18 +745,18 @@ void arm7_cpu_device::drctg04_01_13(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_20(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* MOV Rd, Rs (undefined) */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_MOV(block, DRC_REG(rd), DRC_REG(rs)); UML_ADD(block, DRC_PC, DRC_PC, 2); } void arm7_cpu_device::drctg04_01_21(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* MOV Rd, Hs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_MOV(block, DRC_REG(rd), DRC_REG(rs+8)); if (rs == 7) { @@ -767,9 +767,9 @@ void arm7_cpu_device::drctg04_01_21(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_22(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* MOV Hd, Rs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_MOV(block, DRC_REG(rd+8), DRC_REG(rs)); // CHECKME if (rd != 7) @@ -784,9 +784,9 @@ void arm7_cpu_device::drctg04_01_22(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_23(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* MOV Hd, Hs */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t op = desc->opptr.l[0]; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; UML_MOV(block, DRC_REG(rd+8), DRC_REG(rs+8)); if (rs == 7) { @@ -805,10 +805,10 @@ void arm7_cpu_device::drctg04_01_23(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_30(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; uml::code_label switch_state; uml::code_label done; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; UML_MOV(block, uml::I0, DRC_REG(rs)); UML_TEST(block, uml::I0, 1); UML_JMPc(block, uml::COND_Z, switch_state = compiler->labelnum++); @@ -828,10 +828,10 @@ void arm7_cpu_device::drctg04_01_30(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_31(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; uml::code_label switch_state; uml::code_label done; - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; UML_MOV(block, uml::I0, DRC_REG(rs+8)); if(rs == 7) { @@ -855,23 +855,23 @@ void arm7_cpu_device::drctg04_01_31(drcuml_block *block, compiler_state *compile void arm7_cpu_device::drctg04_01_32(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: G4-3 Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg04_01_33(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: G4-3 Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg04_0203(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; - UINT32 imm = 4 + ((op & THUMB_INSN_IMM) << 2); + uint32_t op = desc->opptr.l[0]; + uint32_t rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; + uint32_t imm = 4 + ((op & THUMB_INSN_IMM) << 2); UML_AND(block, uml::I0, DRC_PC, ~2); UML_ADD(block, uml::I0, uml::I0, imm); UML_CALLH(block, *m_impstate.read32); @@ -883,10 +883,10 @@ void arm7_cpu_device::drctg04_0203(drcuml_block *block, compiler_state *compiler void arm7_cpu_device::drctg05_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* STR Rd, [Rn, Rm] */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; UML_MOV(block, uml::I1, DRC_REG(rd)); UML_ADD(block, uml::I0, DRC_REG(rn), DRC_REG(rm)); UML_CALLH(block, *m_impstate.write32); @@ -895,10 +895,10 @@ void arm7_cpu_device::drctg05_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg05_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* STRH Rd, [Rn, Rm] */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; UML_MOV(block, uml::I1, DRC_REG(rd)); UML_ADD(block, uml::I0, DRC_REG(rn), DRC_REG(rm)); UML_CALLH(block, *m_impstate.write16); @@ -907,10 +907,10 @@ void arm7_cpu_device::drctg05_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg05_2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* STRB Rd, [Rn, Rm] */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; UML_MOV(block, uml::I1, DRC_REG(rd)); UML_ADD(block, uml::I0, DRC_REG(rn), DRC_REG(rm)); UML_CALLH(block, *m_impstate.write16); @@ -919,10 +919,10 @@ void arm7_cpu_device::drctg05_2(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg05_3(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* LDSB Rd, [Rn, Rm] todo, add dasm */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; UML_ADD(block, uml::I0, DRC_REG(rn), DRC_REG(rm)); UML_CALLH(block, *m_impstate.read8); UML_SEXT(block, DRC_REG(rd), uml::I0, uml::SIZE_BYTE); @@ -931,10 +931,10 @@ void arm7_cpu_device::drctg05_3(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg05_4(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* LDR Rd, [Rn, Rm] */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; UML_ADD(block, uml::I0, DRC_REG(rn), DRC_REG(rm)); UML_CALLH(block, *m_impstate.read32); UML_MOV(block, DRC_REG(rd), uml::I0); @@ -943,10 +943,10 @@ void arm7_cpu_device::drctg05_4(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg05_5(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* LDRH Rd, [Rn, Rm] */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; UML_ADD(block, uml::I0, DRC_REG(rn), DRC_REG(rm)); UML_CALLH(block, *m_impstate.read16); UML_MOV(block, DRC_REG(rd), uml::I0); @@ -955,10 +955,10 @@ void arm7_cpu_device::drctg05_5(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg05_6(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* LDRB Rd, [Rn, Rm] */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; UML_ADD(block, uml::I0, DRC_REG(rn), DRC_REG(rm)); UML_CALLH(block, *m_impstate.read8); UML_MOV(block, DRC_REG(rd), uml::I0); @@ -967,10 +967,10 @@ void arm7_cpu_device::drctg05_6(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg05_7(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* LDSH Rd, [Rn, Rm] */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; UML_ADD(block, uml::I0, DRC_REG(rn), DRC_REG(rm)); UML_CALLH(block, *m_impstate.read16); UML_SEXT(block, DRC_REG(rd), uml::I0, uml::SIZE_WORD); @@ -981,10 +981,10 @@ void arm7_cpu_device::drctg05_7(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg06_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Store */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = op & THUMB_ADDSUB_RD; - INT32 offs = ((op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; + uint32_t op = desc->opptr.l[0]; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = op & THUMB_ADDSUB_RD; + int32_t offs = ((op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; UML_ADD(block, uml::I0, DRC_REG(rn), offs); UML_MOV(block, uml::I1, DRC_REG(rd)); UML_CALLH(block, *m_impstate.write32); @@ -993,10 +993,10 @@ void arm7_cpu_device::drctg06_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg06_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Load */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = op & THUMB_ADDSUB_RD; - INT32 offs = ((op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; + uint32_t op = desc->opptr.l[0]; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = op & THUMB_ADDSUB_RD; + int32_t offs = ((op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; UML_ADD(block, uml::I0, DRC_REG(rn), offs); UML_CALLH(block, *m_impstate.read32); UML_MOV(block, DRC_REG(rd), uml::I0); @@ -1007,10 +1007,10 @@ void arm7_cpu_device::drctg06_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg07_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Store */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = op & THUMB_ADDSUB_RD; - INT32 offs = (op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = op & THUMB_ADDSUB_RD; + int32_t offs = (op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; UML_ADD(block, uml::I0, DRC_REG(rn), offs); UML_MOV(block, uml::I1, DRC_REG(rd)); UML_CALLH(block, *m_impstate.write8); @@ -1019,10 +1019,10 @@ void arm7_cpu_device::drctg07_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg07_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Load */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = op & THUMB_ADDSUB_RD; - INT32 offs = (op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = op & THUMB_ADDSUB_RD; + int32_t offs = (op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; UML_ADD(block, uml::I0, DRC_REG(rn), offs); UML_CALLH(block, *m_impstate.read8); UML_MOV(block, DRC_REG(rd), uml::I0); @@ -1033,10 +1033,10 @@ void arm7_cpu_device::drctg07_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg08_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Store */ { - UINT32 op = desc->opptr.l[0]; - UINT32 offs = (op & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t offs = (op & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_ADD(block, uml::I0, DRC_REG(rn), offs << 1); UML_MOV(block, uml::I1, DRC_REG(rd)); UML_CALLH(block, *m_impstate.write16); @@ -1045,10 +1045,10 @@ void arm7_cpu_device::drctg08_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg08_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Load */ { - UINT32 op = desc->opptr.l[0]; - UINT32 offs = (op & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t offs = (op & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; UML_ADD(block, uml::I0, DRC_REG(rn), offs << 1); UML_CALLH(block, *m_impstate.read16); UML_MOV(block, DRC_REG(rd), uml::I0); @@ -1059,9 +1059,9 @@ void arm7_cpu_device::drctg08_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg09_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Store */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rd = (op & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; - INT32 offs = (UINT8)(op & THUMB_INSN_IMM) << 2; + uint32_t op = desc->opptr.l[0]; + uint32_t rd = (op & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; + int32_t offs = (uint8_t)(op & THUMB_INSN_IMM) << 2; UML_ADD(block, uml::I0, DRC_REG(13), offs); UML_MOV(block, uml::I1, DRC_REG(rd)); UML_CALLH(block, *m_impstate.write32); @@ -1070,9 +1070,9 @@ void arm7_cpu_device::drctg09_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg09_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Load */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rd = (op & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; - UINT32 offs = (UINT8)(op & THUMB_INSN_IMM) << 2; + uint32_t op = desc->opptr.l[0]; + uint32_t rd = (op & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; + uint32_t offs = (uint8_t)(op & THUMB_INSN_IMM) << 2; UML_ADD(block, uml::I0, DRC_REG(13), offs); UML_CALLH(block, *m_impstate.read32); UML_MOV(block, DRC_REG(rd), uml::I0); @@ -1083,9 +1083,9 @@ void arm7_cpu_device::drctg09_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0a_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ADD Rd, PC, #nn */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rd = (op & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; - INT32 offs = (UINT8)(op & THUMB_INSN_IMM) << 2; + uint32_t op = desc->opptr.l[0]; + uint32_t rd = (op & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; + int32_t offs = (uint8_t)(op & THUMB_INSN_IMM) << 2; UML_ADD(block, uml::I0, DRC_PC, 4); UML_AND(block, uml::I0, uml::I0, ~2); UML_ADD(block, DRC_REG(rd), uml::I0, offs); @@ -1094,9 +1094,9 @@ void arm7_cpu_device::drctg0a_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0a_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ADD Rd, SP, #nn */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rd = (op & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; - INT32 offs = (UINT8)(op & THUMB_INSN_IMM) << 2; + uint32_t op = desc->opptr.l[0]; + uint32_t rd = (op & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; + int32_t offs = (uint8_t)(op & THUMB_INSN_IMM) << 2; UML_ADD(block, DRC_REG(rd), DRC_REG(13), offs); UML_ADD(block, DRC_PC, DRC_PC, 2); } @@ -1105,8 +1105,8 @@ void arm7_cpu_device::drctg0a_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0b_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* ADD SP, #imm */ { - UINT32 op = desc->opptr.l[0]; - INT32 addr = (op & THUMB_INSN_IMM); + uint32_t op = desc->opptr.l[0]; + int32_t addr = (op & THUMB_INSN_IMM); addr &= ~THUMB_INSN_IMM_S; addr = ((op & THUMB_INSN_IMM_S) ? -(addr << 2) : (addr << 2)); UML_ADD(block, DRC_REG(13), DRC_REG(13), addr); @@ -1115,29 +1115,29 @@ void arm7_cpu_device::drctg0b_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0b_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_3(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_4(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* PUSH {Rlist} */ { - UINT32 op = desc->opptr.l[0]; - for (INT32 offs = 7; offs >= 0; offs--) + uint32_t op = desc->opptr.l[0]; + for (int32_t offs = 7; offs >= 0; offs--) { if (op & (1 << offs)) { @@ -1152,12 +1152,12 @@ void arm7_cpu_device::drctg0b_4(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0b_5(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* PUSH {Rlist}{LR} */ { - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; UML_SUB(block, DRC_REG(13), DRC_REG(13), 4); UML_MOV(block, uml::I0, DRC_REG(13)); UML_MOV(block, uml::I1, DRC_REG(14)); UML_CALLH(block, *m_impstate.write32); - for (INT32 offs = 7; offs >= 0; offs--) + for (int32_t offs = 7; offs >= 0; offs--) { if (op & (1 << offs)) { @@ -1172,50 +1172,50 @@ void arm7_cpu_device::drctg0b_5(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0b_6(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_7(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_8(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_9(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_a(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_b(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_c(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* POP {Rlist} */ { - UINT32 op = desc->opptr.l[0]; - for (INT32 offs = 0; offs < 8; offs++) + uint32_t op = desc->opptr.l[0]; + for (int32_t offs = 0; offs < 8; offs++) { if (op & (1 << offs)) { @@ -1230,11 +1230,11 @@ void arm7_cpu_device::drctg0b_c(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0b_d(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* POP {Rlist}{PC} */ { - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; uml::code_label arch5up; uml::code_label done; uml::code_label switch_mode; - for (INT32 offs = 0; offs < 8; offs++) + for (int32_t offs = 0; offs < 8; offs++) { if (op & (1 << offs)) { @@ -1273,15 +1273,15 @@ void arm7_cpu_device::drctg0b_d(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0b_e(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } void arm7_cpu_device::drctg0b_f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } @@ -1295,10 +1295,10 @@ void arm7_cpu_device::drctg0b_f(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0c_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Store */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rd = (op & THUMB_MULTLS_BASE) >> THUMB_MULTLS_BASE_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rd = (op & THUMB_MULTLS_BASE) >> THUMB_MULTLS_BASE_SHIFT; UML_MOV(block, uml::I2, DRC_REG(rd)); - for (INT32 offs = 0; offs < 8; offs++) + for (int32_t offs = 0; offs < 8; offs++) { if (op & (1 << offs)) { @@ -1314,11 +1314,11 @@ void arm7_cpu_device::drctg0c_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0c_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* Load */ { - UINT32 op = desc->opptr.l[0]; - UINT32 rd = (op & THUMB_MULTLS_BASE) >> THUMB_MULTLS_BASE_SHIFT; + uint32_t op = desc->opptr.l[0]; + uint32_t rd = (op & THUMB_MULTLS_BASE) >> THUMB_MULTLS_BASE_SHIFT; int rd_in_list = op & (1 << rd); UML_MOV(block, uml::I2, DRC_REG(rd)); - for (INT32 offs = 0; offs < 8; offs++) + for (int32_t offs = 0; offs < 8; offs++) { if (op & (1 << offs)) { @@ -1338,8 +1338,8 @@ void arm7_cpu_device::drctg0c_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_EQ: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, Z_MASK); UML_MOVc(block, uml::COND_NZ, uml::I0, offs); UML_MOVc(block, uml::COND_Z, uml::I0, 2); @@ -1348,8 +1348,8 @@ void arm7_cpu_device::drctg0d_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_NE: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, Z_MASK); UML_MOVc(block, uml::COND_Z, uml::I0, offs); UML_MOVc(block, uml::COND_NZ, uml::I0, 2); @@ -1358,8 +1358,8 @@ void arm7_cpu_device::drctg0d_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_CS: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, C_MASK); UML_MOVc(block, uml::COND_NZ, uml::I0, offs); UML_MOVc(block, uml::COND_Z, uml::I0, 2); @@ -1368,8 +1368,8 @@ void arm7_cpu_device::drctg0d_2(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_3(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_CC: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, C_MASK); UML_MOVc(block, uml::COND_Z, uml::I0, offs); UML_MOVc(block, uml::COND_NZ, uml::I0, 2); @@ -1378,8 +1378,8 @@ void arm7_cpu_device::drctg0d_3(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_4(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_MI: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, N_MASK); UML_MOVc(block, uml::COND_NZ, uml::I0, offs); UML_MOVc(block, uml::COND_Z, uml::I0, 2); @@ -1388,8 +1388,8 @@ void arm7_cpu_device::drctg0d_4(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_5(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_PL: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, N_MASK); UML_MOVc(block, uml::COND_Z, uml::I0, offs); UML_MOVc(block, uml::COND_NZ, uml::I0, 2); @@ -1398,8 +1398,8 @@ void arm7_cpu_device::drctg0d_5(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_6(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_VS: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, V_MASK); UML_MOVc(block, uml::COND_NZ, uml::I0, offs); UML_MOVc(block, uml::COND_Z, uml::I0, 2); @@ -1408,8 +1408,8 @@ void arm7_cpu_device::drctg0d_6(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_7(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_VC: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, V_MASK); UML_MOVc(block, uml::COND_Z, uml::I0, offs); UML_MOVc(block, uml::COND_NZ, uml::I0, 2); @@ -1418,8 +1418,8 @@ void arm7_cpu_device::drctg0d_7(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_8(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_HI: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, C_MASK); UML_MOVc(block, uml::COND_NZ, uml::I0, 1); UML_MOVc(block, uml::COND_Z, uml::I0, 0); @@ -1435,8 +1435,8 @@ void arm7_cpu_device::drctg0d_8(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_9(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_LS: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, C_MASK); UML_MOVc(block, uml::COND_Z, uml::I0, 1); UML_MOVc(block, uml::COND_NZ, uml::I0, 0); @@ -1452,8 +1452,8 @@ void arm7_cpu_device::drctg0d_9(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_a(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_GE: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, N_MASK); UML_MOVc(block, uml::COND_Z, uml::I0, 1); UML_MOVc(block, uml::COND_NZ, uml::I0, 0); @@ -1468,8 +1468,8 @@ void arm7_cpu_device::drctg0d_a(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_b(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_LT: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, N_MASK); UML_MOVc(block, uml::COND_Z, uml::I0, 1); UML_MOVc(block, uml::COND_NZ, uml::I0, 0); @@ -1484,8 +1484,8 @@ void arm7_cpu_device::drctg0d_b(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_c(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_GT: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, N_MASK); UML_MOVc(block, uml::COND_Z, uml::I0, 1); UML_MOVc(block, uml::COND_NZ, uml::I0, 0); @@ -1507,8 +1507,8 @@ void arm7_cpu_device::drctg0d_c(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_d(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_LE: { - UINT32 op = desc->opptr.l[0]; - INT32 offs = ((INT8)(op & THUMB_INSN_IMM) << 1) + 4; + uint32_t op = desc->opptr.l[0]; + int32_t offs = ((int8_t)(op & THUMB_INSN_IMM) << 1) + 4; UML_TEST(block, DRC_CPSR, N_MASK); UML_MOVc(block, uml::COND_Z, uml::I0, 1); UML_MOVc(block, uml::COND_NZ, uml::I0, 0); @@ -1530,8 +1530,8 @@ void arm7_cpu_device::drctg0d_d(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0d_e(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) // COND_AL: { - UINT32 op = desc->opptr.l[0]; - UINT32 pc = desc->pc; + uint32_t op = desc->opptr.l[0]; + uint32_t pc = desc->pc; fatalerror("%08x: Undefined Thumb instruction: %04x (ARM9 reserved)\n", pc, op); } @@ -1545,8 +1545,8 @@ void arm7_cpu_device::drctg0d_f(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0e_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - INT32 offs = (op & THUMB_BRANCH_OFFS) << 1; + uint32_t op = desc->opptr.l[0]; + int32_t offs = (op & THUMB_BRANCH_OFFS) << 1; if (offs & 0x00000800) { offs |= 0xfffff800; @@ -1556,8 +1556,8 @@ void arm7_cpu_device::drctg0e_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0e_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 offs = (op & THUMB_BLOP_OFFS) << 1; + uint32_t op = desc->opptr.l[0]; + uint32_t offs = (op & THUMB_BLOP_OFFS) << 1; UML_MOV(block, uml::I0, DRC_REG(14)); UML_ADD(block, uml::I0, uml::I0, offs); UML_AND(block, uml::I0, uml::I0, ~3); @@ -1570,8 +1570,8 @@ void arm7_cpu_device::drctg0e_1(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0f_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 addr = (op & THUMB_BLOP_OFFS) << 12; + uint32_t op = desc->opptr.l[0]; + uint32_t addr = (op & THUMB_BLOP_OFFS) << 12; if (addr & (1 << 22)) { addr |= 0xff800000; @@ -1583,8 +1583,8 @@ void arm7_cpu_device::drctg0f_0(drcuml_block *block, compiler_state *compiler, c void arm7_cpu_device::drctg0f_1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) /* BL */ { - UINT32 op = desc->opptr.l[0]; - UINT32 addr = (op & THUMB_BLOP_OFFS) << 1; + uint32_t op = desc->opptr.l[0]; + uint32_t addr = (op & THUMB_BLOP_OFFS) << 1; UML_AND(block, uml::I0, DRC_REG(14), ~1); UML_ADD(block, uml::I0, uml::I0, addr); UML_ADD(block, DRC_REG(14), DRC_PC, 2); diff --git a/src/devices/cpu/arm7/arm7thmb.cpp b/src/devices/cpu/arm7/arm7thmb.cpp index fd26210d7bc..4c5fd62a1ae 100644 --- a/src/devices/cpu/arm7/arm7thmb.cpp +++ b/src/devices/cpu/arm7/arm7thmb.cpp @@ -8,7 +8,7 @@ // this is our master dispatch jump table for THUMB mode, representing [(INSN & 0xffc0) >> 6] bits of the 16-bit decoded instruction const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0x10] = { -// #define THUMB_SHIFT_R ((UINT16)0x0800) +// #define THUMB_SHIFT_R ((uint16_t)0x0800) &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, &arm7_cpu_device::tg00_0, @@ -25,7 +25,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, &arm7_cpu_device::tg00_1, -// #define THUMB_INSN_ADDSUB ((UINT16)0x0800) // #define THUMB_ADDSUB_TYPE ((UINT16)0x0600) +// #define THUMB_INSN_ADDSUB ((uint16_t)0x0800) // #define THUMB_ADDSUB_TYPE ((uint16_t)0x0600) &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, &arm7_cpu_device::tg01_0, @@ -42,7 +42,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg01_12, &arm7_cpu_device::tg01_12, &arm7_cpu_device::tg01_12, &arm7_cpu_device::tg01_12, &arm7_cpu_device::tg01_13, &arm7_cpu_device::tg01_13, &arm7_cpu_device::tg01_13, &arm7_cpu_device::tg01_13, &arm7_cpu_device::tg01_13, &arm7_cpu_device::tg01_13, &arm7_cpu_device::tg01_13, &arm7_cpu_device::tg01_13, -// #define THUMB_INSN_CMP ((UINT16)0x0800) +// #define THUMB_INSN_CMP ((uint16_t)0x0800) &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, &arm7_cpu_device::tg02_0, @@ -59,7 +59,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, &arm7_cpu_device::tg02_1, -// #define THUMB_INSN_SUB ((UINT16)0x0800) +// #define THUMB_INSN_SUB ((uint16_t)0x0800) &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, &arm7_cpu_device::tg03_0, @@ -76,7 +76,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, &arm7_cpu_device::tg03_1, -//#define THUMB_GROUP4_TYPE ((UINT16)0x0c00) //#define THUMB_ALUOP_TYPE ((UINT16)0x03c0) // #define THUMB_HIREG_OP ((UINT16)0x0300) // #define THUMB_HIREG_H ((UINT16)0x00c0) +//#define THUMB_GROUP4_TYPE ((uint16_t)0x0c00) //#define THUMB_ALUOP_TYPE ((uint16_t)0x03c0) // #define THUMB_HIREG_OP ((uint16_t)0x0300) // #define THUMB_HIREG_H ((uint16_t)0x00c0) &arm7_cpu_device::tg04_00_00, &arm7_cpu_device::tg04_00_01, &arm7_cpu_device::tg04_00_02, &arm7_cpu_device::tg04_00_03, &arm7_cpu_device::tg04_00_04, &arm7_cpu_device::tg04_00_05, &arm7_cpu_device::tg04_00_06, &arm7_cpu_device::tg04_00_07, &arm7_cpu_device::tg04_00_08, &arm7_cpu_device::tg04_00_09, &arm7_cpu_device::tg04_00_0a, &arm7_cpu_device::tg04_00_0b, @@ -93,7 +93,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, &arm7_cpu_device::tg04_0203, -//#define THUMB_GROUP5_TYPE ((UINT16)0x0e00) +//#define THUMB_GROUP5_TYPE ((uint16_t)0x0e00) &arm7_cpu_device::tg05_0, &arm7_cpu_device::tg05_0, &arm7_cpu_device::tg05_0, &arm7_cpu_device::tg05_0, &arm7_cpu_device::tg05_0, &arm7_cpu_device::tg05_0, &arm7_cpu_device::tg05_0, &arm7_cpu_device::tg05_0, &arm7_cpu_device::tg05_1, &arm7_cpu_device::tg05_1, &arm7_cpu_device::tg05_1, &arm7_cpu_device::tg05_1, @@ -110,7 +110,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg05_6, &arm7_cpu_device::tg05_6, &arm7_cpu_device::tg05_6, &arm7_cpu_device::tg05_6, &arm7_cpu_device::tg05_7, &arm7_cpu_device::tg05_7, &arm7_cpu_device::tg05_7, &arm7_cpu_device::tg05_7, &arm7_cpu_device::tg05_7, &arm7_cpu_device::tg05_7, &arm7_cpu_device::tg05_7, &arm7_cpu_device::tg05_7, -//#define THUMB_LSOP_L ((UINT16)0x0800) +//#define THUMB_LSOP_L ((uint16_t)0x0800) &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, &arm7_cpu_device::tg06_0, @@ -127,7 +127,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, &arm7_cpu_device::tg06_1, -//#define THUMB_LSOP_L ((UINT16)0x0800) +//#define THUMB_LSOP_L ((uint16_t)0x0800) &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, &arm7_cpu_device::tg07_0, @@ -144,7 +144,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, &arm7_cpu_device::tg07_1, -// #define THUMB_HALFOP_L ((UINT16)0x0800) +// #define THUMB_HALFOP_L ((uint16_t)0x0800) &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, &arm7_cpu_device::tg08_0, @@ -161,7 +161,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, &arm7_cpu_device::tg08_1, -// #define THUMB_STACKOP_L ((UINT16)0x0800) +// #define THUMB_STACKOP_L ((uint16_t)0x0800) &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, &arm7_cpu_device::tg09_0, @@ -178,7 +178,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, &arm7_cpu_device::tg09_1, -// #define THUMB_RELADDR_SP ((UINT16)0x0800) +// #define THUMB_RELADDR_SP ((uint16_t)0x0800) &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, &arm7_cpu_device::tg0a_0, @@ -195,7 +195,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, &arm7_cpu_device::tg0a_1, -// #define THUMB_STACKOP_TYPE ((UINT16)0x0f00) +// #define THUMB_STACKOP_TYPE ((uint16_t)0x0f00) &arm7_cpu_device::tg0b_0, &arm7_cpu_device::tg0b_0, &arm7_cpu_device::tg0b_0, &arm7_cpu_device::tg0b_0, &arm7_cpu_device::tg0b_1, &arm7_cpu_device::tg0b_1, &arm7_cpu_device::tg0b_1, &arm7_cpu_device::tg0b_1, &arm7_cpu_device::tg0b_2, &arm7_cpu_device::tg0b_2, &arm7_cpu_device::tg0b_2, &arm7_cpu_device::tg0b_2, @@ -212,7 +212,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg0b_d, &arm7_cpu_device::tg0b_d, &arm7_cpu_device::tg0b_d, &arm7_cpu_device::tg0b_d, &arm7_cpu_device::tg0b_e, &arm7_cpu_device::tg0b_e, &arm7_cpu_device::tg0b_e, &arm7_cpu_device::tg0b_e, &arm7_cpu_device::tg0b_f, &arm7_cpu_device::tg0b_f, &arm7_cpu_device::tg0b_f, &arm7_cpu_device::tg0b_f, -// #define THUMB_MULTLS ((UINT16)0x0800) +// #define THUMB_MULTLS ((uint16_t)0x0800) &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, &arm7_cpu_device::tg0c_0, @@ -229,7 +229,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, &arm7_cpu_device::tg0c_1, -// #define THUMB_COND_TYPE ((UINT16)0x0f00) +// #define THUMB_COND_TYPE ((uint16_t)0x0f00) &arm7_cpu_device::tg0d_0, &arm7_cpu_device::tg0d_0, &arm7_cpu_device::tg0d_0, &arm7_cpu_device::tg0d_0, &arm7_cpu_device::tg0d_1, &arm7_cpu_device::tg0d_1, &arm7_cpu_device::tg0d_1, &arm7_cpu_device::tg0d_1, &arm7_cpu_device::tg0d_2, &arm7_cpu_device::tg0d_2, &arm7_cpu_device::tg0d_2, &arm7_cpu_device::tg0d_2, @@ -246,7 +246,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg0d_d, &arm7_cpu_device::tg0d_d, &arm7_cpu_device::tg0d_d, &arm7_cpu_device::tg0d_d, &arm7_cpu_device::tg0d_e, &arm7_cpu_device::tg0d_e, &arm7_cpu_device::tg0d_e, &arm7_cpu_device::tg0d_e, &arm7_cpu_device::tg0d_f, &arm7_cpu_device::tg0d_f, &arm7_cpu_device::tg0d_f, &arm7_cpu_device::tg0d_f, -// #define THUMB_BLOP_LO ((UINT16)0x0800) +// #define THUMB_BLOP_LO ((uint16_t)0x0800) &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, &arm7_cpu_device::tg0e_0, @@ -263,7 +263,7 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, &arm7_cpu_device::tg0e_1, -// #define THUMB_BLOP_LO ((UINT16)0x0800) +// #define THUMB_BLOP_LO ((uint16_t)0x0800) &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, &arm7_cpu_device::tg0f_0, @@ -284,10 +284,10 @@ const arm7_cpu_device::arm7thumb_ophandler arm7_cpu_device::thumb_handler[0x40*0 /* Shift operations */ -void arm7_cpu_device::tg00_0(UINT32 pc, UINT32 op) /* Shift left */ +void arm7_cpu_device::tg00_0(uint32_t pc, uint32_t op) /* Shift left */ { - UINT32 rs, rd, rrs; - INT32 offs; + uint32_t rs, rd, rrs; + int32_t offs; set_cpsr(GET_CPSR & ~(N_MASK | Z_MASK)); @@ -316,10 +316,10 @@ void arm7_cpu_device::tg00_0(UINT32 pc, UINT32 op) /* Shift left */ R15 += 2; } -void arm7_cpu_device::tg00_1(UINT32 pc, UINT32 op) /* Shift right */ +void arm7_cpu_device::tg00_1(uint32_t pc, uint32_t op) /* Shift right */ { - UINT32 rs, rd, rrs; - INT32 offs; + uint32_t rs, rd, rrs; + int32_t offs; rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; @@ -356,10 +356,10 @@ void arm7_cpu_device::tg00_1(UINT32 pc, UINT32 op) /* Shift right */ /* Arithmetic */ -void arm7_cpu_device::tg01_0(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg01_0(uint32_t pc, uint32_t op) { - UINT32 rs, rd, rrs; - INT32 offs; + uint32_t rs, rd, rrs; + int32_t offs; /* ASR.. */ //if (op & THUMB_SHIFT_R) /* Shift right */ { @@ -404,41 +404,41 @@ void arm7_cpu_device::tg01_0(UINT32 pc, UINT32 op) } } -void arm7_cpu_device::tg01_10(UINT32 pc, UINT32 op) /* ADD Rd, Rs, Rn */ +void arm7_cpu_device::tg01_10(uint32_t pc, uint32_t op) /* ADD Rd, Rs, Rn */ { - UINT32 rn = GetRegister((op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT); - UINT32 rs = GetRegister((op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rn = GetRegister((op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT); + uint32_t rs = GetRegister((op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; SetRegister(rd, rs + rn); HandleThumbALUAddFlags(GetRegister(rd), rs, rn); } -void arm7_cpu_device::tg01_11(UINT32 pc, UINT32 op) /* SUB Rd, Rs, Rn */ +void arm7_cpu_device::tg01_11(uint32_t pc, uint32_t op) /* SUB Rd, Rs, Rn */ { - UINT32 rn = GetRegister((op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT); - UINT32 rs = GetRegister((op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rn = GetRegister((op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT); + uint32_t rs = GetRegister((op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; SetRegister(rd, rs - rn); HandleThumbALUSubFlags(GetRegister(rd), rs, rn); } -void arm7_cpu_device::tg01_12(UINT32 pc, UINT32 op) /* ADD Rd, Rs, #imm */ +void arm7_cpu_device::tg01_12(uint32_t pc, uint32_t op) /* ADD Rd, Rs, #imm */ { - UINT32 imm = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; - UINT32 rs = GetRegister((op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t imm = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; + uint32_t rs = GetRegister((op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; SetRegister(rd, rs + imm); HandleThumbALUAddFlags(GetRegister(rd), rs, imm); } -void arm7_cpu_device::tg01_13(UINT32 pc, UINT32 op) /* SUB Rd, Rs, #imm */ +void arm7_cpu_device::tg01_13(uint32_t pc, uint32_t op) /* SUB Rd, Rs, #imm */ { - UINT32 imm = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; - UINT32 rs = GetRegister((op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t imm = (op & THUMB_ADDSUB_RNIMM) >> THUMB_ADDSUB_RNIMM_SHIFT; + uint32_t rs = GetRegister((op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT); + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; SetRegister(rd, rs - imm); HandleThumbALUSubFlags(GetRegister(rd), rs,imm); @@ -446,72 +446,72 @@ void arm7_cpu_device::tg01_13(UINT32 pc, UINT32 op) /* SUB Rd, Rs, #imm */ /* CMP / MOV */ -void arm7_cpu_device::tg02_0(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg02_0(uint32_t pc, uint32_t op) { - UINT32 rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; - UINT32 op2 = (op & THUMB_INSN_IMM); + uint32_t rd = (op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT; + uint32_t op2 = (op & THUMB_INSN_IMM); SetRegister(rd, op2); set_cpsr(GET_CPSR & ~(Z_MASK | N_MASK)); set_cpsr(GET_CPSR | HandleALUNZFlags(GetRegister(rd))); R15 += 2; } -void arm7_cpu_device::tg02_1(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg02_1(uint32_t pc, uint32_t op) { - UINT32 rn = GetRegister((op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT); - UINT32 op2 = op & THUMB_INSN_IMM; - UINT32 rd = rn - op2; + uint32_t rn = GetRegister((op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT); + uint32_t op2 = op & THUMB_INSN_IMM; + uint32_t rd = rn - op2; HandleThumbALUSubFlags(rd, rn, op2); } /* ADD/SUB immediate */ -void arm7_cpu_device::tg03_0(UINT32 pc, UINT32 op) /* ADD Rd, #Offset8 */ +void arm7_cpu_device::tg03_0(uint32_t pc, uint32_t op) /* ADD Rd, #Offset8 */ { - UINT32 rn = GetRegister((op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT); - UINT32 op2 = op & THUMB_INSN_IMM; - UINT32 rd = rn + op2; + uint32_t rn = GetRegister((op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT); + uint32_t op2 = op & THUMB_INSN_IMM; + uint32_t rd = rn + op2; SetRegister((op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT, rd); HandleThumbALUAddFlags(rd, rn, op2); } -void arm7_cpu_device::tg03_1(UINT32 pc, UINT32 op) /* SUB Rd, #Offset8 */ +void arm7_cpu_device::tg03_1(uint32_t pc, uint32_t op) /* SUB Rd, #Offset8 */ { - UINT32 rn = GetRegister((op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT); - UINT32 op2 = op & THUMB_INSN_IMM; - UINT32 rd = rn - op2; + uint32_t rn = GetRegister((op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT); + uint32_t op2 = op & THUMB_INSN_IMM; + uint32_t rd = rn - op2; SetRegister((op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT, rd); HandleThumbALUSubFlags(rd, rn, op2); } /* Rd & Rm instructions */ -void arm7_cpu_device::tg04_00_00(UINT32 pc, UINT32 op) /* AND Rd, Rs */ +void arm7_cpu_device::tg04_00_00(uint32_t pc, uint32_t op) /* AND Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; SetRegister(rd, GetRegister(rd) & GetRegister(rs)); set_cpsr(GET_CPSR & ~(Z_MASK | N_MASK)); set_cpsr(GET_CPSR | HandleALUNZFlags(GetRegister(rd))); R15 += 2; } -void arm7_cpu_device::tg04_00_01(UINT32 pc, UINT32 op) /* EOR Rd, Rs */ +void arm7_cpu_device::tg04_00_01(uint32_t pc, uint32_t op) /* EOR Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; SetRegister(rd, GetRegister(rd) ^ GetRegister(rs)); set_cpsr(GET_CPSR & ~(Z_MASK | N_MASK)); set_cpsr(GET_CPSR | HandleALUNZFlags(GetRegister(rd))); R15 += 2; } -void arm7_cpu_device::tg04_00_02(UINT32 pc, UINT32 op) /* LSL Rd, Rs */ +void arm7_cpu_device::tg04_00_02(uint32_t pc, uint32_t op) /* LSL Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 rrd = GetRegister(rd); - INT32 offs = GetRegister(rs) & 0x000000ff; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rrd = GetRegister(rd); + int32_t offs = GetRegister(rs) & 0x000000ff; if (offs > 0) { if (offs < 32) @@ -549,12 +549,12 @@ void arm7_cpu_device::tg04_00_02(UINT32 pc, UINT32 op) /* LSL Rd, Rs */ R15 += 2; } -void arm7_cpu_device::tg04_00_03(UINT32 pc, UINT32 op) /* LSR Rd, Rs */ +void arm7_cpu_device::tg04_00_03(uint32_t pc, uint32_t op) /* LSR Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 rrd = GetRegister(rd); - INT32 offs = GetRegister(rs) & 0x000000ff; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rrd = GetRegister(rd); + int32_t offs = GetRegister(rs) & 0x000000ff; if (offs > 0) { if (offs < 32) @@ -592,12 +592,12 @@ void arm7_cpu_device::tg04_00_03(UINT32 pc, UINT32 op) /* LSR Rd, Rs */ R15 += 2; } -void arm7_cpu_device::tg04_00_04(UINT32 pc, UINT32 op) /* ASR Rd, Rs */ +void arm7_cpu_device::tg04_00_04(uint32_t pc, uint32_t op) /* ASR Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 rrs = GetRegister(rs)&0xff; - UINT32 rrd = GetRegister(rd); + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rrs = GetRegister(rs)&0xff; + uint32_t rrd = GetRegister(rd); if (rrs != 0) { if (rrs >= 32) @@ -632,32 +632,32 @@ void arm7_cpu_device::tg04_00_04(UINT32 pc, UINT32 op) /* ASR Rd, Rs */ R15 += 2; } -void arm7_cpu_device::tg04_00_05(UINT32 pc, UINT32 op) /* ADC Rd, Rs */ +void arm7_cpu_device::tg04_00_05(uint32_t pc, uint32_t op) /* ADC Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 op2 = (GET_CPSR & C_MASK) ? 1 : 0; - UINT32 rn = GetRegister(rd) + GetRegister(rs) + op2; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op2 = (GET_CPSR & C_MASK) ? 1 : 0; + uint32_t rn = GetRegister(rd) + GetRegister(rs) + op2; HandleThumbALUAddFlags(rn, GetRegister(rd), (GetRegister(rs))); // ? SetRegister(rd, rn); } -void arm7_cpu_device::tg04_00_06(UINT32 pc, UINT32 op) /* SBC Rd, Rs */ +void arm7_cpu_device::tg04_00_06(uint32_t pc, uint32_t op) /* SBC Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 op2 = (GET_CPSR & C_MASK) ? 0 : 1; - UINT32 rn = GetRegister(rd) - GetRegister(rs) - op2; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op2 = (GET_CPSR & C_MASK) ? 0 : 1; + uint32_t rn = GetRegister(rd) - GetRegister(rs) - op2; HandleThumbALUSubFlags(rn, GetRegister(rd), (GetRegister(rs))); //? SetRegister(rd, rn); } -void arm7_cpu_device::tg04_00_07(UINT32 pc, UINT32 op) /* ROR Rd, Rs */ +void arm7_cpu_device::tg04_00_07(uint32_t pc, uint32_t op) /* ROR Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 rrd = GetRegister(rd); - UINT32 imm = GetRegister(rs) & 0x0000001f; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rrd = GetRegister(rd); + uint32_t imm = GetRegister(rs) & 0x0000001f; SetRegister(rd, (rrd >> imm) | (rrd << (32 - imm))); if (rrd & (1 << (imm - 1))) { @@ -672,76 +672,76 @@ void arm7_cpu_device::tg04_00_07(UINT32 pc, UINT32 op) /* ROR Rd, Rs */ R15 += 2; } -void arm7_cpu_device::tg04_00_08(UINT32 pc, UINT32 op) /* TST Rd, Rs */ +void arm7_cpu_device::tg04_00_08(uint32_t pc, uint32_t op) /* TST Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; set_cpsr(GET_CPSR & ~(Z_MASK | N_MASK)); set_cpsr(GET_CPSR | HandleALUNZFlags(GetRegister(rd) & GetRegister(rs))); R15 += 2; } -void arm7_cpu_device::tg04_00_09(UINT32 pc, UINT32 op) /* NEG Rd, Rs */ +void arm7_cpu_device::tg04_00_09(uint32_t pc, uint32_t op) /* NEG Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 rrs = GetRegister(rs); + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rrs = GetRegister(rs); SetRegister(rd, 0 - rrs); HandleThumbALUSubFlags(GetRegister(rd), 0, rrs); } -void arm7_cpu_device::tg04_00_0a(UINT32 pc, UINT32 op) /* CMP Rd, Rs */ +void arm7_cpu_device::tg04_00_0a(uint32_t pc, uint32_t op) /* CMP Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 rn = GetRegister(rd) - GetRegister(rs); + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rn = GetRegister(rd) - GetRegister(rs); HandleThumbALUSubFlags(rn, GetRegister(rd), GetRegister(rs)); } -void arm7_cpu_device::tg04_00_0b(UINT32 pc, UINT32 op) /* CMN Rd, Rs - check flags, add dasm */ +void arm7_cpu_device::tg04_00_0b(uint32_t pc, uint32_t op) /* CMN Rd, Rs - check flags, add dasm */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 rn = GetRegister(rd) + GetRegister(rs); + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rn = GetRegister(rd) + GetRegister(rs); HandleThumbALUAddFlags(rn, GetRegister(rd), GetRegister(rs)); } -void arm7_cpu_device::tg04_00_0c(UINT32 pc, UINT32 op) /* ORR Rd, Rs */ +void arm7_cpu_device::tg04_00_0c(uint32_t pc, uint32_t op) /* ORR Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; SetRegister(rd, GetRegister(rd) | GetRegister(rs)); set_cpsr(GET_CPSR & ~(Z_MASK | N_MASK)); set_cpsr(GET_CPSR | HandleALUNZFlags(GetRegister(rd))); R15 += 2; } -void arm7_cpu_device::tg04_00_0d(UINT32 pc, UINT32 op) /* MUL Rd, Rs */ +void arm7_cpu_device::tg04_00_0d(uint32_t pc, uint32_t op) /* MUL Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 rn = GetRegister(rd) * GetRegister(rs); + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rn = GetRegister(rd) * GetRegister(rs); set_cpsr(GET_CPSR & ~(Z_MASK | N_MASK)); SetRegister(rd, rn); set_cpsr(GET_CPSR | HandleALUNZFlags(rn)); R15 += 2; } -void arm7_cpu_device::tg04_00_0e(UINT32 pc, UINT32 op) /* BIC Rd, Rs */ +void arm7_cpu_device::tg04_00_0e(uint32_t pc, uint32_t op) /* BIC Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; SetRegister(rd, GetRegister(rd) & (~GetRegister(rs))); set_cpsr(GET_CPSR & ~(Z_MASK | N_MASK)); set_cpsr(GET_CPSR | HandleALUNZFlags(GetRegister(rd))); R15 += 2; } -void arm7_cpu_device::tg04_00_0f(UINT32 pc, UINT32 op) /* MVN Rd, Rs */ +void arm7_cpu_device::tg04_00_0f(uint32_t pc, uint32_t op) /* MVN Rd, Rs */ { - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; - UINT32 op2 = GetRegister(rs); + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t op2 = GetRegister(rs); SetRegister(rd, ~op2); set_cpsr(GET_CPSR & ~(Z_MASK | N_MASK)); set_cpsr(GET_CPSR | HandleALUNZFlags(GetRegister(rd))); @@ -750,15 +750,15 @@ void arm7_cpu_device::tg04_00_0f(UINT32 pc, UINT32 op) /* MVN Rd, Rs */ /* ADD Rd, Rs group */ -void arm7_cpu_device::tg04_01_00(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg04_01_00(uint32_t pc, uint32_t op) { fatalerror("%08x: G4-1-0 Undefined Thumb instruction: %04x %x\n", pc, op, (op & THUMB_HIREG_H) >> THUMB_HIREG_H_SHIFT); } -void arm7_cpu_device::tg04_01_01(UINT32 pc, UINT32 op) /* ADD Rd, HRs */ +void arm7_cpu_device::tg04_01_01(uint32_t pc, uint32_t op) /* ADD Rd, HRs */ { - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; SetRegister(rd, GetRegister(rd) + GetRegister(rs+8)); // emulate the effects of pre-fetch if (rs == 7) @@ -769,10 +769,10 @@ void arm7_cpu_device::tg04_01_01(UINT32 pc, UINT32 op) /* ADD Rd, HRs */ R15 += 2; } -void arm7_cpu_device::tg04_01_02(UINT32 pc, UINT32 op) /* ADD HRd, Rs */ +void arm7_cpu_device::tg04_01_02(uint32_t pc, uint32_t op) /* ADD HRd, Rs */ { - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; SetRegister(rd+8, GetRegister(rd+8) + GetRegister(rs)); if (rd == 7) { @@ -782,10 +782,10 @@ void arm7_cpu_device::tg04_01_02(UINT32 pc, UINT32 op) /* ADD HRd, Rs */ R15 += 2; } -void arm7_cpu_device::tg04_01_03(UINT32 pc, UINT32 op) /* Add HRd, HRs */ +void arm7_cpu_device::tg04_01_03(uint32_t pc, uint32_t op) /* Add HRd, HRs */ { - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; SetRegister(rd+8, GetRegister(rd+8) + GetRegister(rs+8)); // emulate the effects of pre-fetch if (rs == 7) @@ -800,53 +800,53 @@ void arm7_cpu_device::tg04_01_03(UINT32 pc, UINT32 op) /* Add HRd, HRs */ R15 += 2; } -void arm7_cpu_device::tg04_01_10(UINT32 pc, UINT32 op) /* CMP Rd, Rs */ +void arm7_cpu_device::tg04_01_10(uint32_t pc, uint32_t op) /* CMP Rd, Rs */ { - UINT32 rs = GetRegister(((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT)); - UINT32 rd = GetRegister(op & THUMB_HIREG_RD); - UINT32 rn = rd - rs; + uint32_t rs = GetRegister(((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT)); + uint32_t rd = GetRegister(op & THUMB_HIREG_RD); + uint32_t rn = rd - rs; HandleThumbALUSubFlags(rn, rd, rs); } -void arm7_cpu_device::tg04_01_11(UINT32 pc, UINT32 op) /* CMP Rd, Hs */ +void arm7_cpu_device::tg04_01_11(uint32_t pc, uint32_t op) /* CMP Rd, Hs */ { - UINT32 rs = GetRegister(((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT) + 8); - UINT32 rd = GetRegister(op & THUMB_HIREG_RD); - UINT32 rn = rd - rs; + uint32_t rs = GetRegister(((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT) + 8); + uint32_t rd = GetRegister(op & THUMB_HIREG_RD); + uint32_t rn = rd - rs; HandleThumbALUSubFlags(rn, rd, rs); } -void arm7_cpu_device::tg04_01_12(UINT32 pc, UINT32 op) /* CMP Hd, Rs */ +void arm7_cpu_device::tg04_01_12(uint32_t pc, uint32_t op) /* CMP Hd, Rs */ { - UINT32 rs = GetRegister(((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT)); - UINT32 rd = GetRegister((op & THUMB_HIREG_RD) + 8); - UINT32 rn = rd - rs; + uint32_t rs = GetRegister(((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT)); + uint32_t rd = GetRegister((op & THUMB_HIREG_RD) + 8); + uint32_t rn = rd - rs; HandleThumbALUSubFlags(rn, rd, rs); } -void arm7_cpu_device::tg04_01_13(UINT32 pc, UINT32 op) /* CMP Hd, Hs */ +void arm7_cpu_device::tg04_01_13(uint32_t pc, uint32_t op) /* CMP Hd, Hs */ { - UINT32 rs = GetRegister(((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT) + 8); - UINT32 rd = GetRegister((op & THUMB_HIREG_RD) + 8); - UINT32 rn = rd - rs; + uint32_t rs = GetRegister(((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT) + 8); + uint32_t rd = GetRegister((op & THUMB_HIREG_RD) + 8); + uint32_t rn = rd - rs; HandleThumbALUSubFlags(rn, rd, rs); } /* MOV group */ // "The action of H1 = 0, H2 = 0 for Op = 00 (ADD), Op = 01 (CMP) and Op = 10 (MOV) is undefined, and should not be used." -void arm7_cpu_device::tg04_01_20(UINT32 pc, UINT32 op) /* MOV Rd, Rs (undefined) */ +void arm7_cpu_device::tg04_01_20(uint32_t pc, uint32_t op) /* MOV Rd, Rs (undefined) */ { - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; SetRegister(rd, GetRegister(rs)); R15 += 2; } -void arm7_cpu_device::tg04_01_21(UINT32 pc, UINT32 op) /* MOV Rd, Hs */ +void arm7_cpu_device::tg04_01_21(uint32_t pc, uint32_t op) /* MOV Rd, Hs */ { - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; SetRegister(rd, GetRegister(rs + 8)); if (rs == 7) { @@ -855,10 +855,10 @@ void arm7_cpu_device::tg04_01_21(UINT32 pc, UINT32 op) /* MOV Rd, Hs */ R15 += 2; } -void arm7_cpu_device::tg04_01_22(UINT32 pc, UINT32 op) /* MOV Hd, Rs */ +void arm7_cpu_device::tg04_01_22(uint32_t pc, uint32_t op) /* MOV Hd, Rs */ { - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; SetRegister(rd + 8, GetRegister(rs)); if (rd != 7) { @@ -870,10 +870,10 @@ void arm7_cpu_device::tg04_01_22(UINT32 pc, UINT32 op) /* MOV Hd, Rs */ } } -void arm7_cpu_device::tg04_01_23(UINT32 pc, UINT32 op) /* MOV Hd, Hs */ +void arm7_cpu_device::tg04_01_23(uint32_t pc, uint32_t op) /* MOV Hd, Hs */ { - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 rd = op & THUMB_HIREG_RD; + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t rd = op & THUMB_HIREG_RD; if (rs == 7) { SetRegister(rd + 8, GetRegister(rs+8)+4); @@ -892,10 +892,10 @@ void arm7_cpu_device::tg04_01_23(UINT32 pc, UINT32 op) /* MOV Hd, Hs */ } } -void arm7_cpu_device::tg04_01_30(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg04_01_30(uint32_t pc, uint32_t op) { - UINT32 rd = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 addr = GetRegister(rd); + uint32_t rd = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t addr = GetRegister(rd); if (addr & 1) { addr &= ~1; @@ -911,10 +911,10 @@ void arm7_cpu_device::tg04_01_30(UINT32 pc, UINT32 op) R15 = addr; } -void arm7_cpu_device::tg04_01_31(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg04_01_31(uint32_t pc, uint32_t op) { - UINT32 rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; - UINT32 addr = GetRegister(rs+8); + uint32_t rs = (op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT; + uint32_t addr = GetRegister(rs+8); if (rs == 7) { addr += 2; @@ -935,9 +935,9 @@ void arm7_cpu_device::tg04_01_31(UINT32 pc, UINT32 op) } /* BLX */ -void arm7_cpu_device::tg04_01_32(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg04_01_32(uint32_t pc, uint32_t op) { - UINT32 addr = GetRegister((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT); + uint32_t addr = GetRegister((op & THUMB_HIREG_RS) >> THUMB_HIREG_RS_SHIFT); SetRegister(14, (R15 + 2) | 1); // are we also switching to ARM mode? @@ -957,57 +957,57 @@ void arm7_cpu_device::tg04_01_32(UINT32 pc, UINT32 op) R15 = addr; } -void arm7_cpu_device::tg04_01_33(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg04_01_33(uint32_t pc, uint32_t op) { fatalerror("%08x: G4-3 Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg04_0203(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg04_0203(uint32_t pc, uint32_t op) { - UINT32 readword = READ32((R15 & ~2) + 4 + ((op & THUMB_INSN_IMM) << 2)); + uint32_t readword = READ32((R15 & ~2) + 4 + ((op & THUMB_INSN_IMM) << 2)); SetRegister((op & THUMB_INSN_IMM_RD) >> THUMB_INSN_IMM_RD_SHIFT, readword); R15 += 2; } /* LDR* STR* group */ -void arm7_cpu_device::tg05_0(UINT32 pc, UINT32 op) /* STR Rd, [Rn, Rm] */ +void arm7_cpu_device::tg05_0(uint32_t pc, uint32_t op) /* STR Rd, [Rn, Rm] */ { - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - UINT32 addr = GetRegister(rn) + GetRegister(rm); + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t addr = GetRegister(rn) + GetRegister(rm); WRITE32(addr, GetRegister(rd)); R15 += 2; } -void arm7_cpu_device::tg05_1(UINT32 pc, UINT32 op) /* STRH Rd, [Rn, Rm] */ +void arm7_cpu_device::tg05_1(uint32_t pc, uint32_t op) /* STRH Rd, [Rn, Rm] */ { - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - UINT32 addr = GetRegister(rn) + GetRegister(rm); + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t addr = GetRegister(rn) + GetRegister(rm); WRITE16(addr, GetRegister(rd)); R15 += 2; } -void arm7_cpu_device::tg05_2(UINT32 pc, UINT32 op) /* STRB Rd, [Rn, Rm] */ +void arm7_cpu_device::tg05_2(uint32_t pc, uint32_t op) /* STRB Rd, [Rn, Rm] */ { - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - UINT32 addr = GetRegister(rn) + GetRegister(rm); + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t addr = GetRegister(rn) + GetRegister(rm); WRITE8(addr, GetRegister(rd)); R15 += 2; } -void arm7_cpu_device::tg05_3(UINT32 pc, UINT32 op) /* LDSB Rd, [Rn, Rm] todo, add dasm */ +void arm7_cpu_device::tg05_3(uint32_t pc, uint32_t op) /* LDSB Rd, [Rn, Rm] todo, add dasm */ { - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - UINT32 addr = GetRegister(rn) + GetRegister(rm); - UINT32 op2 = READ8(addr); + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t addr = GetRegister(rn) + GetRegister(rm); + uint32_t op2 = READ8(addr); if (op2 & 0x00000080) { op2 |= 0xffffff00; @@ -1016,46 +1016,46 @@ void arm7_cpu_device::tg05_3(UINT32 pc, UINT32 op) /* LDSB Rd, [Rn, Rm] todo, a R15 += 2; } -void arm7_cpu_device::tg05_4(UINT32 pc, UINT32 op) /* LDR Rd, [Rn, Rm] */ +void arm7_cpu_device::tg05_4(uint32_t pc, uint32_t op) /* LDR Rd, [Rn, Rm] */ { - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - UINT32 addr = GetRegister(rn) + GetRegister(rm); - UINT32 op2 = READ32(addr); + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t addr = GetRegister(rn) + GetRegister(rm); + uint32_t op2 = READ32(addr); SetRegister(rd, op2); R15 += 2; } -void arm7_cpu_device::tg05_5(UINT32 pc, UINT32 op) /* LDRH Rd, [Rn, Rm] */ +void arm7_cpu_device::tg05_5(uint32_t pc, uint32_t op) /* LDRH Rd, [Rn, Rm] */ { - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - UINT32 addr = GetRegister(rn) + GetRegister(rm); - UINT32 op2 = READ16(addr); + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t addr = GetRegister(rn) + GetRegister(rm); + uint32_t op2 = READ16(addr); SetRegister(rd, op2); R15 += 2; } -void arm7_cpu_device::tg05_6(UINT32 pc, UINT32 op) /* LDRB Rd, [Rn, Rm] */ +void arm7_cpu_device::tg05_6(uint32_t pc, uint32_t op) /* LDRB Rd, [Rn, Rm] */ { - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - UINT32 addr = GetRegister(rn) + GetRegister(rm); - UINT32 op2 = READ8(addr); + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t addr = GetRegister(rn) + GetRegister(rm); + uint32_t op2 = READ8(addr); SetRegister(rd, op2); R15 += 2; } -void arm7_cpu_device::tg05_7(UINT32 pc, UINT32 op) /* LDSH Rd, [Rn, Rm] */ +void arm7_cpu_device::tg05_7(uint32_t pc, uint32_t op) /* LDSH Rd, [Rn, Rm] */ { - UINT32 rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; - UINT32 rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; - UINT32 rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; - UINT32 addr = GetRegister(rn) + GetRegister(rm); - UINT32 op2 = READ16(addr); + uint32_t rm = (op & THUMB_GROUP5_RM) >> THUMB_GROUP5_RM_SHIFT; + uint32_t rn = (op & THUMB_GROUP5_RN) >> THUMB_GROUP5_RN_SHIFT; + uint32_t rd = (op & THUMB_GROUP5_RD) >> THUMB_GROUP5_RD_SHIFT; + uint32_t addr = GetRegister(rn) + GetRegister(rm); + uint32_t op2 = READ16(addr); if (op2 & 0x00008000) { op2 |= 0xffff0000; @@ -1066,129 +1066,129 @@ void arm7_cpu_device::tg05_7(UINT32 pc, UINT32 op) /* LDSH Rd, [Rn, Rm] */ /* Word Store w/ Immediate Offset */ -void arm7_cpu_device::tg06_0(UINT32 pc, UINT32 op) /* Store */ +void arm7_cpu_device::tg06_0(uint32_t pc, uint32_t op) /* Store */ { - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = op & THUMB_ADDSUB_RD; - INT32 offs = ((op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = op & THUMB_ADDSUB_RD; + int32_t offs = ((op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; WRITE32(GetRegister(rn) + offs, GetRegister(rd)); R15 += 2; } -void arm7_cpu_device::tg06_1(UINT32 pc, UINT32 op) /* Load */ +void arm7_cpu_device::tg06_1(uint32_t pc, uint32_t op) /* Load */ { - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = op & THUMB_ADDSUB_RD; - INT32 offs = ((op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = op & THUMB_ADDSUB_RD; + int32_t offs = ((op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT) << 2; SetRegister(rd, READ32(GetRegister(rn) + offs)); // fix R15 += 2; } /* Byte Store w/ Immeidate Offset */ -void arm7_cpu_device::tg07_0(UINT32 pc, UINT32 op) /* Store */ +void arm7_cpu_device::tg07_0(uint32_t pc, uint32_t op) /* Store */ { - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = op & THUMB_ADDSUB_RD; - INT32 offs = (op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = op & THUMB_ADDSUB_RD; + int32_t offs = (op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; WRITE8(GetRegister(rn) + offs, GetRegister(rd)); R15 += 2; } -void arm7_cpu_device::tg07_1(UINT32 pc, UINT32 op) /* Load */ +void arm7_cpu_device::tg07_1(uint32_t pc, uint32_t op) /* Load */ { - UINT32 rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = op & THUMB_ADDSUB_RD; - INT32 offs = (op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; + uint32_t rn = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = op & THUMB_ADDSUB_RD; + int32_t offs = (op & THUMB_LSOP_OFFS) >> THUMB_LSOP_OFFS_SHIFT; SetRegister(rd, READ8(GetRegister(rn) + offs)); R15 += 2; } /* Load/Store Halfword */ -void arm7_cpu_device::tg08_0(UINT32 pc, UINT32 op) /* Store */ +void arm7_cpu_device::tg08_0(uint32_t pc, uint32_t op) /* Store */ { - UINT32 imm = (op & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t imm = (op & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; WRITE16(GetRegister(rs) + (imm << 1), GetRegister(rd)); R15 += 2; } -void arm7_cpu_device::tg08_1(UINT32 pc, UINT32 op) /* Load */ +void arm7_cpu_device::tg08_1(uint32_t pc, uint32_t op) /* Load */ { - UINT32 imm = (op & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; - UINT32 rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; - UINT32 rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; + uint32_t imm = (op & THUMB_HALFOP_OFFS) >> THUMB_HALFOP_OFFS_SHIFT; + uint32_t rs = (op & THUMB_ADDSUB_RS) >> THUMB_ADDSUB_RS_SHIFT; + uint32_t rd = (op & THUMB_ADDSUB_RD) >> THUMB_ADDSUB_RD_SHIFT; SetRegister(rd, READ16(GetRegister(rs) + (imm << 1))); R15 += 2; } /* Stack-Relative Load/Store */ -void arm7_cpu_device::tg09_0(UINT32 pc, UINT32 op) /* Store */ +void arm7_cpu_device::tg09_0(uint32_t pc, uint32_t op) /* Store */ { - UINT32 rd = (op & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; - INT32 offs = (UINT8)(op & THUMB_INSN_IMM); - WRITE32(GetRegister(13) + ((UINT32)offs << 2), GetRegister(rd)); + uint32_t rd = (op & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; + int32_t offs = (uint8_t)(op & THUMB_INSN_IMM); + WRITE32(GetRegister(13) + ((uint32_t)offs << 2), GetRegister(rd)); R15 += 2; } -void arm7_cpu_device::tg09_1(UINT32 pc, UINT32 op) /* Load */ +void arm7_cpu_device::tg09_1(uint32_t pc, uint32_t op) /* Load */ { - UINT32 rd = (op & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; - INT32 offs = (UINT8)(op & THUMB_INSN_IMM); - UINT32 readword = READ32(GetRegister(13) + ((UINT32)offs << 2)); + uint32_t rd = (op & THUMB_STACKOP_RD) >> THUMB_STACKOP_RD_SHIFT; + int32_t offs = (uint8_t)(op & THUMB_INSN_IMM); + uint32_t readword = READ32(GetRegister(13) + ((uint32_t)offs << 2)); SetRegister(rd, readword); R15 += 2; } /* Get relative address */ -void arm7_cpu_device::tg0a_0(UINT32 pc, UINT32 op) /* ADD Rd, PC, #nn */ +void arm7_cpu_device::tg0a_0(uint32_t pc, uint32_t op) /* ADD Rd, PC, #nn */ { - UINT32 rd = (op & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; - INT32 offs = (UINT8)(op & THUMB_INSN_IMM) << 2; + uint32_t rd = (op & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; + int32_t offs = (uint8_t)(op & THUMB_INSN_IMM) << 2; SetRegister(rd, ((R15 + 4) & ~2) + offs); R15 += 2; } -void arm7_cpu_device::tg0a_1(UINT32 pc, UINT32 op) /* ADD Rd, SP, #nn */ +void arm7_cpu_device::tg0a_1(uint32_t pc, uint32_t op) /* ADD Rd, SP, #nn */ { - UINT32 rd = (op & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; - INT32 offs = (UINT8)(op & THUMB_INSN_IMM) << 2; + uint32_t rd = (op & THUMB_RELADDR_RD) >> THUMB_RELADDR_RD_SHIFT; + int32_t offs = (uint8_t)(op & THUMB_INSN_IMM) << 2; SetRegister(rd, GetRegister(13) + offs); R15 += 2; } /* Stack-Related Opcodes */ -void arm7_cpu_device::tg0b_0(UINT32 pc, UINT32 op) /* ADD SP, #imm */ +void arm7_cpu_device::tg0b_0(uint32_t pc, uint32_t op) /* ADD SP, #imm */ { - UINT32 addr = (op & THUMB_INSN_IMM); + uint32_t addr = (op & THUMB_INSN_IMM); addr &= ~THUMB_INSN_IMM_S; SetRegister(13, GetRegister(13) + ((op & THUMB_INSN_IMM_S) ? -(addr << 2) : (addr << 2))); R15 += 2; } -void arm7_cpu_device::tg0b_1(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_1(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_2(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_2(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_3(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_3(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_4(UINT32 pc, UINT32 op) /* PUSH {Rlist} */ +void arm7_cpu_device::tg0b_4(uint32_t pc, uint32_t op) /* PUSH {Rlist} */ { - for (INT32 offs = 7; offs >= 0; offs--) + for (int32_t offs = 7; offs >= 0; offs--) { if (op & (1 << offs)) { @@ -1199,11 +1199,11 @@ void arm7_cpu_device::tg0b_4(UINT32 pc, UINT32 op) /* PUSH {Rlist} */ R15 += 2; } -void arm7_cpu_device::tg0b_5(UINT32 pc, UINT32 op) /* PUSH {Rlist}{LR} */ +void arm7_cpu_device::tg0b_5(uint32_t pc, uint32_t op) /* PUSH {Rlist}{LR} */ { SetRegister(13, GetRegister(13) - 4); WRITE32(GetRegister(13), GetRegister(14)); - for (INT32 offs = 7; offs >= 0; offs--) + for (int32_t offs = 7; offs >= 0; offs--) { if (op & (1 << offs)) { @@ -1214,39 +1214,39 @@ void arm7_cpu_device::tg0b_5(UINT32 pc, UINT32 op) /* PUSH {Rlist}{LR} */ R15 += 2; } -void arm7_cpu_device::tg0b_6(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_6(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_7(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_7(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_8(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_8(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_9(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_9(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_a(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_a(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_b(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_b(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_c(UINT32 pc, UINT32 op) /* POP {Rlist} */ +void arm7_cpu_device::tg0b_c(uint32_t pc, uint32_t op) /* POP {Rlist} */ { - for (INT32 offs = 0; offs < 8; offs++) + for (int32_t offs = 0; offs < 8; offs++) { if (op & (1 << offs)) { @@ -1257,9 +1257,9 @@ void arm7_cpu_device::tg0b_c(UINT32 pc, UINT32 op) /* POP {Rlist} */ R15 += 2; } -void arm7_cpu_device::tg0b_d(UINT32 pc, UINT32 op) /* POP {Rlist}{PC} */ +void arm7_cpu_device::tg0b_d(uint32_t pc, uint32_t op) /* POP {Rlist}{PC} */ { - for (INT32 offs = 0; offs < 8; offs++) + for (int32_t offs = 0; offs < 8; offs++) { if (op & (1 << offs)) { @@ -1267,7 +1267,7 @@ void arm7_cpu_device::tg0b_d(UINT32 pc, UINT32 op) /* POP {Rlist}{PC} */ SetRegister(13, GetRegister(13) + 4); } } - UINT32 addr = READ32(GetRegister(13)); + uint32_t addr = READ32(GetRegister(13)); if (m_archRev < 5) { R15 = addr & ~1; @@ -1292,12 +1292,12 @@ void arm7_cpu_device::tg0b_d(UINT32 pc, UINT32 op) /* POP {Rlist}{PC} */ SetRegister(13, GetRegister(13) + 4); } -void arm7_cpu_device::tg0b_e(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_e(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } -void arm7_cpu_device::tg0b_f(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0b_f(uint32_t pc, uint32_t op) { fatalerror("%08x: Gb Undefined Thumb instruction: %04x\n", pc, op); } @@ -1310,11 +1310,11 @@ void arm7_cpu_device::tg0b_f(UINT32 pc, UINT32 op) // GBA "BB Ball" performs an unaligned read with A[1:0] = 2 and expects A[1] not to be ignored [BP 800B90A,(R4&3)!=0] // GBA "Gadget Racers" performs an unaligned read with A[1:0] = 1 and expects A[0] to be ignored [BP B72,(R0&3)!=0] -void arm7_cpu_device::tg0c_0(UINT32 pc, UINT32 op) /* Store */ +void arm7_cpu_device::tg0c_0(uint32_t pc, uint32_t op) /* Store */ { - UINT32 rd = (op & THUMB_MULTLS_BASE) >> THUMB_MULTLS_BASE_SHIFT; - UINT32 ld_st_address = GetRegister(rd); - for (INT32 offs = 0; offs < 8; offs++) + uint32_t rd = (op & THUMB_MULTLS_BASE) >> THUMB_MULTLS_BASE_SHIFT; + uint32_t ld_st_address = GetRegister(rd); + for (int32_t offs = 0; offs < 8; offs++) { if (op & (1 << offs)) { @@ -1326,12 +1326,12 @@ void arm7_cpu_device::tg0c_0(UINT32 pc, UINT32 op) /* Store */ R15 += 2; } -void arm7_cpu_device::tg0c_1(UINT32 pc, UINT32 op) /* Load */ +void arm7_cpu_device::tg0c_1(uint32_t pc, uint32_t op) /* Load */ { - UINT32 rd = (op & THUMB_MULTLS_BASE) >> THUMB_MULTLS_BASE_SHIFT; + uint32_t rd = (op & THUMB_MULTLS_BASE) >> THUMB_MULTLS_BASE_SHIFT; int rd_in_list = op & (1 << rd); - UINT32 ld_st_address = GetRegister(rd); - for (INT32 offs = 0; offs < 8; offs++) + uint32_t ld_st_address = GetRegister(rd); + for (int32_t offs = 0; offs < 8; offs++) { if (op & (1 << offs)) { @@ -1348,9 +1348,9 @@ void arm7_cpu_device::tg0c_1(UINT32 pc, UINT32 op) /* Load */ /* Conditional Branch */ -void arm7_cpu_device::tg0d_0(UINT32 pc, UINT32 op) // COND_EQ: +void arm7_cpu_device::tg0d_0(uint32_t pc, uint32_t op) // COND_EQ: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (Z_IS_SET(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1362,9 +1362,9 @@ void arm7_cpu_device::tg0d_0(UINT32 pc, UINT32 op) // COND_EQ: } -void arm7_cpu_device::tg0d_1(UINT32 pc, UINT32 op) // COND_NE: +void arm7_cpu_device::tg0d_1(uint32_t pc, uint32_t op) // COND_NE: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (Z_IS_CLEAR(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1375,9 +1375,9 @@ void arm7_cpu_device::tg0d_1(UINT32 pc, UINT32 op) // COND_NE: } } -void arm7_cpu_device::tg0d_2(UINT32 pc, UINT32 op) // COND_CS: +void arm7_cpu_device::tg0d_2(uint32_t pc, uint32_t op) // COND_CS: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (C_IS_SET(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1388,9 +1388,9 @@ void arm7_cpu_device::tg0d_2(UINT32 pc, UINT32 op) // COND_CS: } } -void arm7_cpu_device::tg0d_3(UINT32 pc, UINT32 op) // COND_CC: +void arm7_cpu_device::tg0d_3(uint32_t pc, uint32_t op) // COND_CC: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (C_IS_CLEAR(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1401,9 +1401,9 @@ void arm7_cpu_device::tg0d_3(UINT32 pc, UINT32 op) // COND_CC: } } -void arm7_cpu_device::tg0d_4(UINT32 pc, UINT32 op) // COND_MI: +void arm7_cpu_device::tg0d_4(uint32_t pc, uint32_t op) // COND_MI: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (N_IS_SET(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1414,9 +1414,9 @@ void arm7_cpu_device::tg0d_4(UINT32 pc, UINT32 op) // COND_MI: } } -void arm7_cpu_device::tg0d_5(UINT32 pc, UINT32 op) // COND_PL: +void arm7_cpu_device::tg0d_5(uint32_t pc, uint32_t op) // COND_PL: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (N_IS_CLEAR(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1427,9 +1427,9 @@ void arm7_cpu_device::tg0d_5(UINT32 pc, UINT32 op) // COND_PL: } } -void arm7_cpu_device::tg0d_6(UINT32 pc, UINT32 op) // COND_VS: +void arm7_cpu_device::tg0d_6(uint32_t pc, uint32_t op) // COND_VS: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (V_IS_SET(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1440,9 +1440,9 @@ void arm7_cpu_device::tg0d_6(UINT32 pc, UINT32 op) // COND_VS: } } -void arm7_cpu_device::tg0d_7(UINT32 pc, UINT32 op) // COND_VC: +void arm7_cpu_device::tg0d_7(uint32_t pc, uint32_t op) // COND_VC: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (V_IS_CLEAR(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1453,9 +1453,9 @@ void arm7_cpu_device::tg0d_7(UINT32 pc, UINT32 op) // COND_VC: } } -void arm7_cpu_device::tg0d_8(UINT32 pc, UINT32 op) // COND_HI: +void arm7_cpu_device::tg0d_8(uint32_t pc, uint32_t op) // COND_HI: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (C_IS_SET(GET_CPSR) && Z_IS_CLEAR(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1466,9 +1466,9 @@ void arm7_cpu_device::tg0d_8(UINT32 pc, UINT32 op) // COND_HI: } } -void arm7_cpu_device::tg0d_9(UINT32 pc, UINT32 op) // COND_LS: +void arm7_cpu_device::tg0d_9(uint32_t pc, uint32_t op) // COND_LS: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (C_IS_CLEAR(GET_CPSR) || Z_IS_SET(GET_CPSR)) { R15 += 4 + (offs << 1); @@ -1479,9 +1479,9 @@ void arm7_cpu_device::tg0d_9(UINT32 pc, UINT32 op) // COND_LS: } } -void arm7_cpu_device::tg0d_a(UINT32 pc, UINT32 op) // COND_GE: +void arm7_cpu_device::tg0d_a(uint32_t pc, uint32_t op) // COND_GE: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (!(GET_CPSR & N_MASK) == !(GET_CPSR & V_MASK)) { R15 += 4 + (offs << 1); @@ -1492,9 +1492,9 @@ void arm7_cpu_device::tg0d_a(UINT32 pc, UINT32 op) // COND_GE: } } -void arm7_cpu_device::tg0d_b(UINT32 pc, UINT32 op) // COND_LT: +void arm7_cpu_device::tg0d_b(uint32_t pc, uint32_t op) // COND_LT: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (!(GET_CPSR & N_MASK) != !(GET_CPSR & V_MASK)) { R15 += 4 + (offs << 1); @@ -1505,9 +1505,9 @@ void arm7_cpu_device::tg0d_b(UINT32 pc, UINT32 op) // COND_LT: } } -void arm7_cpu_device::tg0d_c(UINT32 pc, UINT32 op) // COND_GT: +void arm7_cpu_device::tg0d_c(uint32_t pc, uint32_t op) // COND_GT: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (Z_IS_CLEAR(GET_CPSR) && !(GET_CPSR & N_MASK) == !(GET_CPSR & V_MASK)) { R15 += 4 + (offs << 1); @@ -1518,9 +1518,9 @@ void arm7_cpu_device::tg0d_c(UINT32 pc, UINT32 op) // COND_GT: } } -void arm7_cpu_device::tg0d_d(UINT32 pc, UINT32 op) // COND_LE: +void arm7_cpu_device::tg0d_d(uint32_t pc, uint32_t op) // COND_LE: { - INT32 offs = (INT8)(op & THUMB_INSN_IMM); + int32_t offs = (int8_t)(op & THUMB_INSN_IMM); if (Z_IS_SET(GET_CPSR) || !(GET_CPSR & N_MASK) != !(GET_CPSR & V_MASK)) { R15 += 4 + (offs << 1); @@ -1531,12 +1531,12 @@ void arm7_cpu_device::tg0d_d(UINT32 pc, UINT32 op) // COND_LE: } } -void arm7_cpu_device::tg0d_e(UINT32 pc, UINT32 op) // COND_AL: +void arm7_cpu_device::tg0d_e(uint32_t pc, uint32_t op) // COND_AL: { fatalerror("%08x: Undefined Thumb instruction: %04x (ARM9 reserved)\n", pc, op); } -void arm7_cpu_device::tg0d_f(UINT32 pc, UINT32 op) // COND_NV: // SWI (this is sort of a "hole" in the opcode encoding) +void arm7_cpu_device::tg0d_f(uint32_t pc, uint32_t op) // COND_NV: // SWI (this is sort of a "hole" in the opcode encoding) { m_pendingSwi = 1; arm7_check_irq_state(); @@ -1544,9 +1544,9 @@ void arm7_cpu_device::tg0d_f(UINT32 pc, UINT32 op) // COND_NV: // SWI (this is /* B #offs */ -void arm7_cpu_device::tg0e_0(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0e_0(uint32_t pc, uint32_t op) { - INT32 offs = (op & THUMB_BRANCH_OFFS) << 1; + int32_t offs = (op & THUMB_BRANCH_OFFS) << 1; if (offs & 0x00000800) { offs |= 0xfffff800; @@ -1554,9 +1554,9 @@ void arm7_cpu_device::tg0e_0(UINT32 pc, UINT32 op) R15 += 4 + offs; } -void arm7_cpu_device::tg0e_1(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0e_1(uint32_t pc, uint32_t op) { - UINT32 addr = GetRegister(14); + uint32_t addr = GetRegister(14); addr += (op & THUMB_BLOP_OFFS) << 1; addr &= 0xfffffffc; SetRegister(14, (R15 + 4) | 1); @@ -1565,9 +1565,9 @@ void arm7_cpu_device::tg0e_1(UINT32 pc, UINT32 op) /* BL */ -void arm7_cpu_device::tg0f_0(UINT32 pc, UINT32 op) +void arm7_cpu_device::tg0f_0(uint32_t pc, uint32_t op) { - UINT32 addr = (op & THUMB_BLOP_OFFS) << 12; + uint32_t addr = (op & THUMB_BLOP_OFFS) << 12; if (addr & (1 << 22)) { addr |= 0xff800000; @@ -1577,9 +1577,9 @@ void arm7_cpu_device::tg0f_0(UINT32 pc, UINT32 op) R15 += 2; } -void arm7_cpu_device::tg0f_1(UINT32 pc, UINT32 op) /* BL */ +void arm7_cpu_device::tg0f_1(uint32_t pc, uint32_t op) /* BL */ { - UINT32 addr = GetRegister(14) & ~1; + uint32_t addr = GetRegister(14) & ~1; addr += (op & THUMB_BLOP_OFFS) << 1; SetRegister(14, (R15 + 2) | 1); R15 = addr; diff --git a/src/devices/cpu/arm7/lpc210x.cpp b/src/devices/cpu/arm7/lpc210x.cpp index 1d6acac4c79..28205774f30 100644 --- a/src/devices/cpu/arm7/lpc210x.cpp +++ b/src/devices/cpu/arm7/lpc210x.cpp @@ -39,7 +39,7 @@ static ADDRESS_MAP_START( lpc2103_map, AS_PROGRAM, 32, lpc210x_device ) ADDRESS_MAP_END -lpc210x_device::lpc210x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lpc210x_device::lpc210x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : arm7_cpu_device(mconfig, LPC2103, "LPC2103", tag, owner, clock, "lpc2103", __FILE__, 4, eARM_ARCHFLAGS_T, ENDIANNESS_LITTLE), m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0, ADDRESS_MAP_NAME(lpc2103_map)) { @@ -52,7 +52,7 @@ READ32_MEMBER(lpc210x_device::arm_E01FC088_r) READ32_MEMBER(lpc210x_device::flash_r) { - UINT32 ret = (m_flash[offset * 4 + 3] << 24) | + uint32_t ret = (m_flash[offset * 4 + 3] << 24) | (m_flash[offset * 4 + 2] << 16) | (m_flash[offset * 4 + 1] << 8) | (m_flash[offset * 4 + 0] << 0); @@ -245,7 +245,7 @@ WRITE32_MEMBER( lpc210x_device::pll_w ) /* Timers */ -UINT32 lpc210x_device::read_timer(address_space &space, int timer, int offset, UINT32 mem_mask) +uint32_t lpc210x_device::read_timer(address_space &space, int timer, int offset, uint32_t mem_mask) { switch (offset*4) { @@ -260,7 +260,7 @@ UINT32 lpc210x_device::read_timer(address_space &space, int timer, int offset, U } -void lpc210x_device::write_timer(address_space &space, int timer, int offset, UINT32 data, UINT32 mem_mask) +void lpc210x_device::write_timer(address_space &space, int timer, int offset, uint32_t data, uint32_t mem_mask) { switch (offset * 4) { diff --git a/src/devices/cpu/arm7/lpc210x.h b/src/devices/cpu/arm7/lpc210x.h index 1d083f39dbc..53f4e28a798 100644 --- a/src/devices/cpu/arm7/lpc210x.h +++ b/src/devices/cpu/arm7/lpc210x.h @@ -22,12 +22,12 @@ class lpc210x_device : public arm7_cpu_device { public: - lpc210x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + lpc210x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); // static configuration helpers // todo, use an appropriate flash type instead - UINT8 m_flash[0x8000]; + uint8_t m_flash[0x8000]; DECLARE_READ32_MEMBER(arm_E01FC088_r); @@ -41,10 +41,10 @@ public: DECLARE_READ32_MEMBER(timer1_r) { return read_timer(space, 1, offset, mem_mask); } DECLARE_WRITE32_MEMBER(timer1_w) { write_timer(space, 1, offset, data, mem_mask); } - void write_timer(address_space &space, int timer, int offset, UINT32 data, UINT32 mem_mask); - UINT32 read_timer(address_space &space, int timer, int offset, UINT32 mem_mask); + void write_timer(address_space &space, int timer, int offset, uint32_t data, uint32_t mem_mask); + uint32_t read_timer(address_space &space, int timer, int offset, uint32_t mem_mask); - UINT32 m_TxPR[2]; + uint32_t m_TxPR[2]; // VIC DECLARE_READ32_MEMBER(vic_r); diff --git a/src/devices/cpu/asap/asap.cpp b/src/devices/cpu/asap/asap.cpp index bfad7b0a4cf..c5271ab128a 100644 --- a/src/devices/cpu/asap/asap.cpp +++ b/src/devices/cpu/asap/asap.cpp @@ -20,12 +20,12 @@ // CONSTANTS //************************************************************************** -const UINT32 PS_CFLAG = 0x00000001; -const UINT32 PS_VFLAG = 0x00000002; -const UINT32 PS_ZFLAG = 0x00000004; -const UINT32 PS_NFLAG = 0x00000008; -const UINT32 PS_IFLAG = 0x00000010; -const UINT32 PS_PFLAG = 0x00000020; +const uint32_t PS_CFLAG = 0x00000001; +const uint32_t PS_VFLAG = 0x00000002; +const uint32_t PS_ZFLAG = 0x00000004; +const uint32_t PS_NFLAG = 0x00000008; +const uint32_t PS_IFLAG = 0x00000010; +const uint32_t PS_PFLAG = 0x00000020; //const int EXCEPTION_RESET = 0; const int EXCEPTION_TRAP0 = 1; @@ -40,8 +40,8 @@ const int REGBASE = 0xffe0; // MACROS //************************************************************************** -#define SET_C_ADD(a,b) (m_cflag = (UINT32)(b) > (UINT32)(~(a))) -#define SET_C_SUB(a,b) (m_cflag = (UINT32)(b) <= (UINT32)(a)) +#define SET_C_ADD(a,b) (m_cflag = (uint32_t)(b) > (uint32_t)(~(a))) +#define SET_C_SUB(a,b) (m_cflag = (uint32_t)(b) <= (uint32_t)(a)) #define SET_V_ADD(r,a,b) (m_vflag = ~((a) ^ (b)) & ((a) ^ (r))) #define SET_V_SUB(r,a,b) (m_vflag = ((a) ^ (b)) & ((a) ^ (r))) #define SET_ZN(r) (m_znflag = (r)) @@ -136,7 +136,7 @@ const device_type ASAP = &device_creator; // asap_device - constructor //------------------------------------------------- -asap_device::asap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +asap_device::asap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ASAP, "ASAP", tag, owner, clock, "asap", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 32, 32), m_pc(0), @@ -288,7 +288,7 @@ void asap_device::state_string_export(const device_state_entry &entry, std::stri str = string_format("%c%c%c%c%c%c", m_pflag ? 'P' : '.', m_iflag ? 'I' : '.', - ((INT32)m_znflag < 0) ? 'N' : '.', + ((int32_t)m_znflag < 0) ? 'N' : '.', (m_znflag == 0) ? 'Z' : '.', ((m_vflag >> 30) & PS_VFLAG) ? 'V' : '.', m_cflag ? 'C' : '.'); @@ -302,7 +302,7 @@ void asap_device::state_string_export(const device_state_entry &entry, std::stri // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 asap_device::disasm_min_opcode_bytes() const +uint32_t asap_device::disasm_min_opcode_bytes() const { return 4; } @@ -313,7 +313,7 @@ UINT32 asap_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 asap_device::disasm_max_opcode_bytes() const +uint32_t asap_device::disasm_max_opcode_bytes() const { return 12; } @@ -324,7 +324,7 @@ UINT32 asap_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t asap_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t asap_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( asap ); return CPU_DISASSEMBLE_NAME(asap)(this, buffer, pc, oprom, opram, options); @@ -340,7 +340,7 @@ offs_t asap_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr // readop - read an opcode at the given address //------------------------------------------------- -inline UINT32 asap_device::readop(offs_t pc) +inline uint32_t asap_device::readop(offs_t pc) { return m_direct->read_dword(pc); } @@ -350,7 +350,7 @@ inline UINT32 asap_device::readop(offs_t pc) // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT8 asap_device::readbyte(offs_t address) +inline uint8_t asap_device::readbyte(offs_t address) { // no alignment issues with bytes return m_program->read_byte(address); @@ -361,7 +361,7 @@ inline UINT8 asap_device::readbyte(offs_t address) // readword - read a word at the given address //------------------------------------------------- -inline UINT16 asap_device::readword(offs_t address) +inline uint16_t asap_device::readword(offs_t address) { // aligned reads are easy if (WORD_ALIGNED(address)) @@ -376,7 +376,7 @@ inline UINT16 asap_device::readword(offs_t address) // readlong - read a long at the given address //------------------------------------------------- -inline UINT32 asap_device::readlong(offs_t address) +inline uint32_t asap_device::readlong(offs_t address) { // aligned reads are easy if (DWORD_ALIGNED(address)) @@ -391,7 +391,7 @@ inline UINT32 asap_device::readlong(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void asap_device::writebyte(offs_t address, UINT8 data) +inline void asap_device::writebyte(offs_t address, uint8_t data) { // no alignment issues with bytes m_program->write_byte(address, data); @@ -402,7 +402,7 @@ inline void asap_device::writebyte(offs_t address, UINT8 data) // writeword - write a word at the given address //------------------------------------------------- -inline void asap_device::writeword(offs_t address, UINT16 data) +inline void asap_device::writeword(offs_t address, uint16_t data) { // aligned writes are easy if (WORD_ALIGNED(address)) @@ -426,7 +426,7 @@ inline void asap_device::writeword(offs_t address, UINT16 data) // writelong - write a long at the given address //------------------------------------------------- -inline void asap_device::writelong(offs_t address, UINT32 data) +inline void asap_device::writelong(offs_t address, uint32_t data) { // aligned writes are easy if (DWORD_ALIGNED(address)) @@ -524,7 +524,7 @@ inline void asap_device::execute_instruction() // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 asap_device::execute_min_cycles() const +uint32_t asap_device::execute_min_cycles() const { return 1; } @@ -535,7 +535,7 @@ UINT32 asap_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 asap_device::execute_max_cycles() const +uint32_t asap_device::execute_max_cycles() const { return 2; } @@ -546,7 +546,7 @@ UINT32 asap_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 asap_device::execute_input_lines() const +uint32_t asap_device::execute_input_lines() const { return 1; } @@ -635,9 +635,9 @@ void asap_device::trap0() void asap_device::bsp() { - if ((INT32)m_znflag > 0) + if ((int32_t)m_znflag > 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -650,9 +650,9 @@ void asap_device::bsp() void asap_device::bmz() { - if ((INT32)m_znflag <= 0) + if ((int32_t)m_znflag <= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -665,9 +665,9 @@ void asap_device::bmz() void asap_device::bgt() { - if (m_znflag != 0 && (INT32)(m_znflag ^ m_vflag) >= 0) + if (m_znflag != 0 && (int32_t)(m_znflag ^ m_vflag) >= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -680,9 +680,9 @@ void asap_device::bgt() void asap_device::ble() { - if (m_znflag == 0 || (INT32)(m_znflag ^ m_vflag) < 0) + if (m_znflag == 0 || (int32_t)(m_znflag ^ m_vflag) < 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -695,9 +695,9 @@ void asap_device::ble() void asap_device::bge() { - if ((INT32)(m_znflag ^ m_vflag) >= 0) + if ((int32_t)(m_znflag ^ m_vflag) >= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -710,9 +710,9 @@ void asap_device::bge() void asap_device::blt() { - if ((INT32)(m_znflag ^ m_vflag) < 0) + if ((int32_t)(m_znflag ^ m_vflag) < 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -727,7 +727,7 @@ void asap_device::bhi() { if (m_znflag != 0 && m_cflag) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -742,7 +742,7 @@ void asap_device::bls() { if (m_znflag == 0 || !m_cflag) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -757,7 +757,7 @@ void asap_device::bcc() { if (!m_cflag) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -772,7 +772,7 @@ void asap_device::bcs() { if (m_cflag) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -785,9 +785,9 @@ void asap_device::bcs() void asap_device::bpl() { - if ((INT32)m_znflag >= 0) + if ((int32_t)m_znflag >= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -800,9 +800,9 @@ void asap_device::bpl() void asap_device::bmi() { - if ((INT32)m_znflag < 0) + if ((int32_t)m_znflag < 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -817,7 +817,7 @@ void asap_device::bne() { if (m_znflag != 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -832,7 +832,7 @@ void asap_device::beq() { if (m_znflag == 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -845,9 +845,9 @@ void asap_device::beq() void asap_device::bvc() { - if ((INT32)m_vflag >= 0) + if ((int32_t)m_vflag >= 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -860,9 +860,9 @@ void asap_device::bvc() void asap_device::bvs() { - if ((INT32)m_vflag < 0) + if ((int32_t)m_vflag < 0) { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -878,7 +878,7 @@ void asap_device::bvs() void asap_device::bsr() { DSTVAL = m_pc + 4; - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -890,7 +890,7 @@ void asap_device::bsr() void asap_device::bsr_0() { - m_nextpc = m_ppc + ((INT32)(m_op << 10) >> 8); + m_nextpc = m_ppc + ((int32_t)(m_op << 10) >> 8); fetch_instruction(); m_pc = m_nextpc; @@ -909,9 +909,9 @@ void asap_device::lea() void asap_device::lea_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + (src2 << 2); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + (src2 << 2); SET_ZNCV_ADD(dst, src1, src2); if (src1 & 0xc0000000) @@ -923,9 +923,9 @@ void asap_device::lea_c() void asap_device::lea_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + (src2 << 2); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + (src2 << 2); SET_ZNCV_ADD(dst, src1, src2); if (src1 & 0xc0000000) @@ -943,9 +943,9 @@ void asap_device::leah() void asap_device::leah_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + (src2 << 1); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + (src2 << 1); SET_ZNCV_ADD(dst, src1, src2); if (src1 & 0x80000000) @@ -957,9 +957,9 @@ void asap_device::leah_c() void asap_device::leah_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + (src2 << 1); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + (src2 << 1); SET_ZNCV_ADD(dst, src1, src2); if (src1 & 0x80000000) @@ -977,9 +977,9 @@ void asap_device::subr() void asap_device::subr_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src2 - src1; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src2 - src1; SET_ZNCV_SUB(dst, src2, src1); DSTVAL = dst; @@ -987,9 +987,9 @@ void asap_device::subr_c() void asap_device::subr_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src2 - src1; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src2 - src1; SET_ZNCV_SUB(dst, src2, src1); } @@ -1003,14 +1003,14 @@ void asap_device::xor_() void asap_device::xor_c() { - UINT32 dst = SRC1VAL ^ SRC2VAL; + uint32_t dst = SRC1VAL ^ SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::xor_c0() { - UINT32 dst = SRC1VAL ^ SRC2VAL; + uint32_t dst = SRC1VAL ^ SRC2VAL; SET_ZN(dst); } @@ -1023,14 +1023,14 @@ void asap_device::xorn() void asap_device::xorn_c() { - UINT32 dst = SRC1VAL ^ ~SRC2VAL; + uint32_t dst = SRC1VAL ^ ~SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::xorn_c0() { - UINT32 dst = SRC1VAL ^ ~SRC2VAL; + uint32_t dst = SRC1VAL ^ ~SRC2VAL; SET_ZN(dst); } @@ -1043,9 +1043,9 @@ void asap_device::add() void asap_device::add_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + src2; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + src2; SET_ZNCV_ADD(dst, src1, src2); DSTVAL = dst; @@ -1053,9 +1053,9 @@ void asap_device::add_c() void asap_device::add_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + src2; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + src2; SET_ZNCV_ADD(dst, src1, src2); } @@ -1069,9 +1069,9 @@ void asap_device::sub() void asap_device::sub_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 - src2; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 - src2; SET_ZNCV_SUB(dst, src1, src2); DSTVAL = dst; @@ -1079,9 +1079,9 @@ void asap_device::sub_c() void asap_device::sub_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 - src2; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 - src2; SET_ZNCV_SUB(dst, src1, src2); } @@ -1095,9 +1095,9 @@ void asap_device::addc() void asap_device::addc_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + src2 + m_cflag; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + src2 + m_cflag; SET_ZNCV_ADD(dst, src1, src2); DSTVAL = dst; @@ -1105,9 +1105,9 @@ void asap_device::addc_c() void asap_device::addc_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 + src2 + m_cflag; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 + src2 + m_cflag; SET_ZNCV_ADD(dst, src1, src2); } @@ -1121,9 +1121,9 @@ void asap_device::subc() void asap_device::subc_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 - src2 - 1 + m_cflag; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 - src2 - 1 + m_cflag; SET_ZNCV_SUB(dst, src1, src2); DSTVAL = dst; @@ -1131,9 +1131,9 @@ void asap_device::subc_c() void asap_device::subc_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL; - UINT32 dst = src1 - src2 - 1 + m_cflag; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL; + uint32_t dst = src1 - src2 - 1 + m_cflag; SET_ZNCV_SUB(dst, src1, src2); } @@ -1147,14 +1147,14 @@ void asap_device::and_() void asap_device::and_c() { - UINT32 dst = SRC1VAL & SRC2VAL; + uint32_t dst = SRC1VAL & SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::and_c0() { - UINT32 dst = SRC1VAL & SRC2VAL; + uint32_t dst = SRC1VAL & SRC2VAL; SET_ZN(dst); } @@ -1167,14 +1167,14 @@ void asap_device::andn() void asap_device::andn_c() { - UINT32 dst = SRC1VAL & ~SRC2VAL; + uint32_t dst = SRC1VAL & ~SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::andn_c0() { - UINT32 dst = SRC1VAL & ~SRC2VAL; + uint32_t dst = SRC1VAL & ~SRC2VAL; SET_ZN(dst); } @@ -1187,14 +1187,14 @@ void asap_device::or_() void asap_device::or_c() { - UINT32 dst = SRC1VAL | SRC2VAL; + uint32_t dst = SRC1VAL | SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::or_c0() { - UINT32 dst = SRC1VAL | SRC2VAL; + uint32_t dst = SRC1VAL | SRC2VAL; SET_ZN(dst); } @@ -1207,14 +1207,14 @@ void asap_device::orn() void asap_device::orn_c() { - UINT32 dst = SRC1VAL | ~SRC2VAL; + uint32_t dst = SRC1VAL | ~SRC2VAL; SET_ZN(dst); DSTVAL = dst; } void asap_device::orn_c0() { - UINT32 dst = SRC1VAL | ~SRC2VAL; + uint32_t dst = SRC1VAL | ~SRC2VAL; SET_ZN(dst); } @@ -1232,14 +1232,14 @@ void asap_device::ld_0() void asap_device::ld_c() { - UINT32 dst = readlong(SRC1VAL + (SRC2VAL << 2)); + uint32_t dst = readlong(SRC1VAL + (SRC2VAL << 2)); SET_ZN(dst); DSTVAL = dst; } void asap_device::ld_c0() { - UINT32 dst = readlong(SRC1VAL + (SRC2VAL << 2)); + uint32_t dst = readlong(SRC1VAL + (SRC2VAL << 2)); SET_ZN(dst); } @@ -1247,7 +1247,7 @@ void asap_device::ld_c0() void asap_device::ldh() { - DSTVAL = (INT16)readword(SRC1VAL + (SRC2VAL << 1)); + DSTVAL = (int16_t)readword(SRC1VAL + (SRC2VAL << 1)); } void asap_device::ldh_0() @@ -1257,14 +1257,14 @@ void asap_device::ldh_0() void asap_device::ldh_c() { - UINT32 dst = (INT16)readword(SRC1VAL + (SRC2VAL << 1)); + uint32_t dst = (int16_t)readword(SRC1VAL + (SRC2VAL << 1)); SET_ZN(dst); DSTVAL = dst; } void asap_device::ldh_c0() { - UINT32 dst = (INT16)readword(SRC1VAL + (SRC2VAL << 1)); + uint32_t dst = (int16_t)readword(SRC1VAL + (SRC2VAL << 1)); SET_ZN(dst); } @@ -1282,14 +1282,14 @@ void asap_device::lduh_0() void asap_device::lduh_c() { - UINT32 dst = readword(SRC1VAL + (SRC2VAL << 1)); + uint32_t dst = readword(SRC1VAL + (SRC2VAL << 1)); SET_ZN(dst); DSTVAL = dst; } void asap_device::lduh_c0() { - UINT32 dst = readword(SRC1VAL + (SRC2VAL << 1)); + uint32_t dst = readword(SRC1VAL + (SRC2VAL << 1)); SET_ZN(dst); } @@ -1307,7 +1307,7 @@ void asap_device::sth_0() void asap_device::sth_c() { - UINT32 dst = (UINT16)DSTVAL; + uint32_t dst = (uint16_t)DSTVAL; SET_ZN(dst); writeword(SRC1VAL + (SRC2VAL << 1), dst); } @@ -1332,7 +1332,7 @@ void asap_device::st_0() void asap_device::st_c() { - UINT32 dst = DSTVAL; + uint32_t dst = DSTVAL; SET_ZN(dst); writelong(SRC1VAL + (SRC2VAL << 2), dst); } @@ -1347,7 +1347,7 @@ void asap_device::st_c0() void asap_device::ldb() { - DSTVAL = (INT8)readbyte(SRC1VAL + SRC2VAL); + DSTVAL = (int8_t)readbyte(SRC1VAL + SRC2VAL); } void asap_device::ldb_0() @@ -1357,14 +1357,14 @@ void asap_device::ldb_0() void asap_device::ldb_c() { - UINT32 dst = (INT8)readbyte(SRC1VAL + SRC2VAL); + uint32_t dst = (int8_t)readbyte(SRC1VAL + SRC2VAL); SET_ZN(dst); DSTVAL = dst; } void asap_device::ldb_c0() { - UINT32 dst = (INT8)readbyte(SRC1VAL + SRC2VAL); + uint32_t dst = (int8_t)readbyte(SRC1VAL + SRC2VAL); SET_ZN(dst); } @@ -1382,14 +1382,14 @@ void asap_device::ldub_0() void asap_device::ldub_c() { - UINT32 dst = readbyte(SRC1VAL + SRC2VAL); + uint32_t dst = readbyte(SRC1VAL + SRC2VAL); SET_ZN(dst); DSTVAL = dst; } void asap_device::ldub_c0() { - UINT32 dst = readbyte(SRC1VAL + SRC2VAL); + uint32_t dst = readbyte(SRC1VAL + SRC2VAL); SET_ZN(dst); } @@ -1407,7 +1407,7 @@ void asap_device::stb_0() void asap_device::stb_c() { - UINT32 dst = (UINT8)DSTVAL; + uint32_t dst = (uint8_t)DSTVAL; SET_ZN(dst); writebyte(SRC1VAL + SRC2VAL, dst); } @@ -1422,18 +1422,18 @@ void asap_device::stb_c0() void asap_device::ashr() { - UINT32 src2 = SRC2VAL; - DSTVAL = (src2 < 32) ? ((INT32)SRC1VAL >> src2) : ((INT32)SRC1VAL >> 31); + uint32_t src2 = SRC2VAL; + DSTVAL = (src2 < 32) ? ((int32_t)SRC1VAL >> src2) : ((int32_t)SRC1VAL >> 31); } void asap_device::ashr_c() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = (INT32)src1 >> src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = (int32_t)src1 >> src2; SET_ZN(dst); if (src2 != 0) { @@ -1444,7 +1444,7 @@ void asap_device::ashr_c() } else { - UINT32 dst = (INT32)SRC1VAL >> 31; + uint32_t dst = (int32_t)SRC1VAL >> 31; SET_ZN(dst); DSTVAL = dst; } @@ -1452,12 +1452,12 @@ void asap_device::ashr_c() void asap_device::ashr_c0() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = (INT32)src1 >> src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = (int32_t)src1 >> src2; SET_ZN(dst); if (src2 != 0) { @@ -1467,7 +1467,7 @@ void asap_device::ashr_c0() } else { - UINT32 dst = (INT32)SRC1VAL >> 31; + uint32_t dst = (int32_t)SRC1VAL >> 31; SET_ZN(dst); } } @@ -1476,18 +1476,18 @@ void asap_device::ashr_c0() void asap_device::lshr() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; DSTVAL = (src2 < 32) ? (SRC1VAL >> src2) : (SRC1VAL >> 31); } void asap_device::lshr_c() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = src1 >> src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = src1 >> src2; SET_ZN(dst); if (src2 != 0) { @@ -1498,7 +1498,7 @@ void asap_device::lshr_c() } else { - UINT32 dst = SRC1VAL >> 31; + uint32_t dst = SRC1VAL >> 31; SET_ZN(dst); DSTVAL = dst; } @@ -1506,12 +1506,12 @@ void asap_device::lshr_c() void asap_device::lshr_c0() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = src1 >> src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = src1 >> src2; SET_ZN(dst); if (src2 != 0) { @@ -1530,24 +1530,24 @@ void asap_device::lshr_c0() void asap_device::ashl() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; DSTVAL = (src2 < 32) ? (SRC1VAL << src2) : 0; } void asap_device::ashl_c() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = m_vflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = src1 << src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = src1 << src2; SET_ZN(dst); if (src2 != 0) { - src1 = (INT32)src1 >> (32 - src2); + src1 = (int32_t)src1 >> (32 - src2); m_cflag = src1 & PS_CFLAG; - m_vflag = (src1 != ((INT32)dst >> 31)) << 31; + m_vflag = (src1 != ((int32_t)dst >> 31)) << 31; } DSTVAL = dst; } @@ -1560,18 +1560,18 @@ void asap_device::ashl_c() void asap_device::ashl_c0() { - UINT32 src2 = SRC2VAL; + uint32_t src2 = SRC2VAL; m_cflag = m_vflag = 0; if (src2 < 32) { - UINT32 src1 = SRC1VAL; - UINT32 dst = src1 << src2; + uint32_t src1 = SRC1VAL; + uint32_t dst = src1 << src2; SET_ZN(dst); if (src2 != 0) { - src1 = (INT32)src1 >> (32 - src2); + src1 = (int32_t)src1 >> (32 - src2); m_cflag = src1 & PS_CFLAG; - m_vflag = (src1 != ((INT32)dst >> 31)) << 31; + m_vflag = (src1 != ((int32_t)dst >> 31)) << 31; } } else @@ -1582,25 +1582,25 @@ void asap_device::ashl_c0() void asap_device::rotl() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL & 31; + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL & 31; DSTVAL = (src1 << src2) | (src1 >> (32 - src2)); } void asap_device::rotl_c() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL & 31; - UINT32 dst = (src1 << src2) | (src1 >> (32 - src2)); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL & 31; + uint32_t dst = (src1 << src2) | (src1 >> (32 - src2)); SET_ZN(dst); DSTVAL = dst; } void asap_device::rotl_c0() { - UINT32 src1 = SRC1VAL; - UINT32 src2 = SRC2VAL & 31; - UINT32 dst = (src1 << src2) | (src1 >> (32 - src2)); + uint32_t src1 = SRC1VAL; + uint32_t src2 = SRC2VAL & 31; + uint32_t dst = (src1 << src2) | (src1 >> (32 - src2)); SET_ZN(dst); } @@ -1615,7 +1615,7 @@ void asap_device::getps() void asap_device::putps() { - UINT32 src2 = SRC2VAL & 0x3f; + uint32_t src2 = SRC2VAL & 0x3f; SET_FLAGS(src2); check_irqs(); } diff --git a/src/devices/cpu/asap/asap.h b/src/devices/cpu/asap/asap.h index 87d11282072..1ed0583d4d1 100644 --- a/src/devices/cpu/asap/asap.h +++ b/src/devices/cpu/asap/asap.h @@ -26,7 +26,7 @@ class asap_device : public cpu_device { public: // construction/destruction - asap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + asap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // public interfaces @@ -36,9 +36,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -51,18 +51,18 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // helpers - inline UINT32 readop(offs_t pc); - inline UINT8 readbyte(offs_t address); - inline UINT16 readword(offs_t address); - inline UINT32 readlong(offs_t address); - inline void writebyte(offs_t address, UINT8 data); - inline void writeword(offs_t address, UINT16 data); - inline void writelong(offs_t address, UINT32 data); + inline uint32_t readop(offs_t pc); + inline uint8_t readbyte(offs_t address); + inline uint16_t readword(offs_t address); + inline uint32_t readlong(offs_t address); + inline void writebyte(offs_t address, uint8_t data); + inline void writeword(offs_t address, uint16_t data); + inline void writelong(offs_t address, uint32_t data); inline void generate_exception(int exception); inline void check_irqs(); inline void fetch_instruction(); @@ -185,27 +185,27 @@ protected: // internal state const address_space_config m_program_config; - UINT32 m_pc; + uint32_t m_pc; // expanded flags - UINT32 m_pflag; - UINT32 m_iflag; - UINT32 m_cflag; - UINT32 m_vflag; - UINT32 m_znflag; - UINT32 m_flagsio; + uint32_t m_pflag; + uint32_t m_iflag; + uint32_t m_cflag; + uint32_t m_vflag; + uint32_t m_znflag; + uint32_t m_flagsio; // internal stuff - UINT32 m_op; - UINT32 m_ppc; - UINT32 m_nextpc; - UINT8 m_irq_state; + uint32_t m_op; + uint32_t m_ppc; + uint32_t m_nextpc; + uint8_t m_irq_state; int m_icount; address_space * m_program; direct_read_data * m_direct; // src2val table, registers are at the end - UINT32 m_src2val[65536]; + uint32_t m_src2val[65536]; // opcode/condition tables typedef void (asap_device::*ophandler)(); diff --git a/src/devices/cpu/asap/asapdasm.cpp b/src/devices/cpu/asap/asapdasm.cpp index ded3a24e17b..47665331da2 100644 --- a/src/devices/cpu/asap/asapdasm.cpp +++ b/src/devices/cpu/asap/asapdasm.cpp @@ -35,7 +35,7 @@ static const char *const condition[16] = CODE CODE ***************************************************************************/ -static inline char *src2(UINT32 op, int scale) +static inline char *src2(uint32_t op, int scale) { static char temp[20]; if ((op & 0xffe0) == 0xffe0) @@ -47,25 +47,25 @@ static inline char *src2(UINT32 op, int scale) CPU_DISASSEMBLE( asap ) { - UINT32 op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); + uint32_t op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); int opcode = op >> 27; int cond = (op >> 21) & 1; int rdst = (op >> 22) & 31; int rsrc1 = (op >> 16) & 31; int rsrc2 = op & 0xffff; int rsrc2_iszero = (!rsrc2 || rsrc2 == 0xffe0); - UINT32 flags = 0; + uint32_t flags = 0; switch (opcode) { case 0x00: sprintf(buffer, "trap $00"); flags = DASMFLAG_STEP_OVER; break; - case 0x01: sprintf(buffer, "b%s $%08x", condition[rdst & 15], pc + ((INT32)(op << 10) >> 8)); break; + case 0x01: sprintf(buffer, "b%s $%08x", condition[rdst & 15], pc + ((int32_t)(op << 10) >> 8)); break; case 0x02: if ((op & 0x003fffff) == 3) { - UINT32 nextop = oprom[4] | (oprom[5] << 8) | (oprom[6] << 16) | (oprom[7] << 24); + uint32_t nextop = oprom[4] | (oprom[5] << 8) | (oprom[6] << 16) | (oprom[7] << 24); if ((nextop >> 27) == 0x10 && ((nextop >> 22) & 31) == rdst && (nextop & 0xffff) == 0) { - UINT32 nextnextop = oprom[8] | (oprom[9] << 8) | (oprom[10] << 16) | (oprom[11] << 24); + uint32_t nextnextop = oprom[8] | (oprom[9] << 8) | (oprom[10] << 16) | (oprom[11] << 24); sprintf(buffer, "llit%s $%08x,%s", setcond[cond], nextnextop, reg[rdst]); return 12 | DASMFLAG_STEP_OVER | DASMFLAG_SUPPORTED; } @@ -73,10 +73,10 @@ CPU_DISASSEMBLE( asap ) if (rdst) { flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); - sprintf(buffer, "bsr %s,$%08x", reg[rdst], pc + ((INT32)(op << 10) >> 8)); + sprintf(buffer, "bsr %s,$%08x", reg[rdst], pc + ((int32_t)(op << 10) >> 8)); } else - sprintf(buffer, "bra $%08x", pc + ((INT32)(op << 10) >> 8)); + sprintf(buffer, "bra $%08x", pc + ((int32_t)(op << 10) >> 8)); break; case 0x03: sprintf(buffer, "lea%s %s[%s],%s", setcond[cond], reg[rsrc1], src2(op,2), reg[rdst]); break; case 0x04: sprintf(buffer, "leah%s %s[%s],%s", setcond[cond], reg[rsrc1], src2(op,1), reg[rdst]); break; diff --git a/src/devices/cpu/avr8/avr8.cpp b/src/devices/cpu/avr8/avr8.cpp index 44009a8c6fd..6f0a4278d5b 100644 --- a/src/devices/cpu/avr8/avr8.cpp +++ b/src/devices/cpu/avr8/avr8.cpp @@ -66,7 +66,7 @@ #define ENABLE_VERBOSE_LOG (0) #if ENABLE_VERBOSE_LOG -static inline void ATTR_PRINTF(3,4) verboselog(UINT16 pc, int n_level, const char *s_fmt, ...) +static inline void ATTR_PRINTF(3,4) verboselog(uint16_t pc, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { @@ -189,7 +189,7 @@ enum #define KCONST6(op) ((((op) >> 2) & 0x0030) | ((op) & 0x000f)) #define KCONST7(op) (((op) >> 3) & 0x007f) #define KCONST8(op) ((((op) >> 4) & 0x00f0) | ((op) & 0x000f)) -#define KCONST22(op) (((((UINT32)(op) >> 3) & 0x003e) | ((UINT32)(op) & 0x0001)) << 16) +#define KCONST22(op) (((((uint32_t)(op) >> 3) & 0x003e) | ((uint32_t)(op) & 0x0001)) << 16) #define QCONST6(op) ((((op) >> 8) & 0x0020) | (((op) >> 7) & 0x0018) | ((op) & 0x0007)) #define ACONST5(op) (((op) >> 3) & 0x001f) #define ACONST6(op) ((((op) >> 5) & 0x0030) | ((op) & 0x000f)) @@ -596,7 +596,7 @@ ADDRESS_MAP_END // atmega88_device - constructor //------------------------------------------------- -atmega88_device::atmega88_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atmega88_device::atmega88_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : avr8_device(mconfig, "ATMEGA88", tag, owner, clock, ATMEGA88, 0x0fff, ADDRESS_MAP_NAME(atmega88_internal_map), CPU_TYPE_ATMEGA88, "atmega88", __FILE__) { } @@ -605,7 +605,7 @@ atmega88_device::atmega88_device(const machine_config &mconfig, const char *tag, // atmega644_device - constructor //------------------------------------------------- -atmega644_device::atmega644_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atmega644_device::atmega644_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : avr8_device(mconfig, "ATMEGA644", tag, owner, clock, ATMEGA644, 0xffff, ADDRESS_MAP_NAME(atmega644_internal_map), CPU_TYPE_ATMEGA644, "atmega644", __FILE__) { } @@ -614,7 +614,7 @@ atmega644_device::atmega644_device(const machine_config &mconfig, const char *ta // atmega1280_device - constructor //------------------------------------------------- -atmega1280_device::atmega1280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atmega1280_device::atmega1280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : avr8_device(mconfig, "ATMEGA1280", tag, owner, clock, ATMEGA1280, 0x1ffff, ADDRESS_MAP_NAME(atmega1280_internal_map), CPU_TYPE_ATMEGA1280, "atmega1280", __FILE__) { } @@ -623,7 +623,7 @@ atmega1280_device::atmega1280_device(const machine_config &mconfig, const char * // atmega2560_device - constructor //------------------------------------------------- -atmega2560_device::atmega2560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atmega2560_device::atmega2560_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : avr8_device(mconfig, "ATMEGA2560", tag, owner, clock, ATMEGA2560, 0x1ffff, ADDRESS_MAP_NAME(atmega2560_internal_map), CPU_TYPE_ATMEGA2560, "atmega2560", __FILE__) { } @@ -632,7 +632,7 @@ atmega2560_device::atmega2560_device(const machine_config &mconfig, const char * // avr8_device - constructor //------------------------------------------------- -avr8_device::avr8_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, const device_type type, UINT32 addr_mask, address_map_constructor internal_map, UINT8 cpu_type, const char *shortname, const char *source) +avr8_device::avr8_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, const device_type type, uint32_t addr_mask, address_map_constructor internal_map, uint8_t cpu_type, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_shifted_pc(0) , m_program_config("program", ENDIANNESS_LITTLE, 8, 22) @@ -667,7 +667,7 @@ avr8_device::avr8_device(const machine_config &mconfig, const char *name, const // static_set_low_fuses //------------------------------------------------- -void avr8_device::set_low_fuses(const UINT8 byte) +void avr8_device::set_low_fuses(const uint8_t byte) { m_lfuses = byte; } @@ -676,7 +676,7 @@ void avr8_device::set_low_fuses(const UINT8 byte) // static_set_high_fuses //------------------------------------------------- -void avr8_device::set_high_fuses(const UINT8 byte) +void avr8_device::set_high_fuses(const uint8_t byte) { m_hfuses = byte; } @@ -685,7 +685,7 @@ void avr8_device::set_high_fuses(const UINT8 byte) // static_set_extended_fuses //------------------------------------------------- -void avr8_device::set_extended_fuses(const UINT8 byte) +void avr8_device::set_extended_fuses(const uint8_t byte) { m_efuses = byte; } @@ -694,7 +694,7 @@ void avr8_device::set_extended_fuses(const UINT8 byte) // static_set_lock_bits //------------------------------------------------- -void avr8_device::set_lock_bits(const UINT8 byte) +void avr8_device::set_lock_bits(const uint8_t byte) { m_lock_bits = byte; } @@ -704,7 +704,7 @@ void avr8_device::set_lock_bits(const UINT8 byte) // instruction //------------------------------------------------- -void avr8_device::unimplemented_opcode(UINT32 op) +void avr8_device::unimplemented_opcode(uint32_t op) { // machine().debug_break(); fatalerror("AVR8: unknown opcode (%08x) at %08x\n", op, m_shifted_pc); @@ -716,7 +716,7 @@ void avr8_device::unimplemented_opcode(UINT32 op) // bytes long //------------------------------------------------- -inline bool avr8_device::is_long_opcode(UINT16 op) +inline bool avr8_device::is_long_opcode(uint16_t op) { if((op & 0xf000) == 0x9000) { @@ -927,7 +927,7 @@ void avr8_device::state_string_export(const device_state_entry &entry, std::stri // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 avr8_device::disasm_min_opcode_bytes() const +uint32_t avr8_device::disasm_min_opcode_bytes() const { return 2; } @@ -938,7 +938,7 @@ UINT32 avr8_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 avr8_device::disasm_max_opcode_bytes() const +uint32_t avr8_device::disasm_max_opcode_bytes() const { return 4; } @@ -949,7 +949,7 @@ UINT32 avr8_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t avr8_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t avr8_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( avr8 ); return CPU_DISASSEMBLE_NAME(avr8)(this, buffer, pc, oprom, opram, options); @@ -960,18 +960,18 @@ offs_t avr8_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr // MEMORY ACCESSORS //************************************************************************** -inline void avr8_device::push(UINT8 val) +inline void avr8_device::push(uint8_t val) { - UINT16 sp = SPREG; + uint16_t sp = SPREG; m_data->write_byte(sp, val); sp--; m_r[AVR8_REGIDX_SPL] = sp & 0x00ff; m_r[AVR8_REGIDX_SPH] = (sp >> 8) & 0x00ff; } -inline UINT8 avr8_device::pop() +inline uint8_t avr8_device::pop() { - UINT16 sp = SPREG; + uint16_t sp = SPREG; sp++; m_r[AVR8_REGIDX_SPL] = sp & 0x00ff; m_r[AVR8_REGIDX_SPH] = (sp >> 8) & 0x00ff; @@ -982,7 +982,7 @@ inline UINT8 avr8_device::pop() // IRQ HANDLING //************************************************************************** -void avr8_device::set_irq_line(UINT16 vector, int state) +void avr8_device::set_irq_line(uint16_t vector, int state) { // Horrible hack, not accurate if(state) @@ -1005,11 +1005,11 @@ void avr8_device::set_irq_line(UINT16 vector, int state) class CInterruptCondition { public: - UINT8 m_intindex; - UINT8 m_intreg; - UINT8 m_intmask; - UINT8 m_regindex; - UINT8 m_regmask; + uint8_t m_intindex; + uint8_t m_intreg; + uint8_t m_intmask; + uint8_t m_regindex; + uint8_t m_regmask; }; static const CInterruptCondition s_int_conditions[AVR8_INTIDX_COUNT] = @@ -1124,7 +1124,7 @@ void avr8_device::timer_tick(int cycles) m_spi_prescale_count++; if (m_spi_prescale_count >= m_spi_prescale) { - UINT8 out_bit = (m_r[AVR8_REGIDX_SPDR] & (1 << m_spi_prescale_countdown)) >> m_spi_prescale_countdown; + uint8_t out_bit = (m_r[AVR8_REGIDX_SPDR] & (1 << m_spi_prescale_countdown)) >> m_spi_prescale_countdown; m_spi_prescale_countdown--; m_io->write_byte(AVR8_IO_PORTB, (m_r[AVR8_REGIDX_PORTB] &~ AVR8_PORTB_MOSI) | (out_bit ? AVR8_PORTB_MOSI : 0)); m_r[AVR8_REGIDX_PORTB] = (m_r[AVR8_REGIDX_PORTB] &~ AVR8_PORTB_MOSI) | (out_bit ? AVR8_PORTB_MOSI : 0); @@ -1154,9 +1154,9 @@ void avr8_device::timer_tick(int cycles) } } -// UINT8 ocr0[2] = { m_r[AVR8_REGIDX_OCR0A], m_r[AVR8_REGIDX_OCR0B] }; -//TODO UINT8 ocf0[2] = { (1 << AVR8_TIFR0_OCF0A_SHIFT), (1 << AVR8_TIFR4_OCF0B_SHIFT) }; -//TODO UINT8 int0[2] = { AVR8_INTIDX_OCF0A, AVR8_INTIDX_OCF0B }; +// uint8_t ocr0[2] = { m_r[AVR8_REGIDX_OCR0A], m_r[AVR8_REGIDX_OCR0B] }; +//TODO uint8_t ocf0[2] = { (1 << AVR8_TIFR0_OCF0A_SHIFT), (1 << AVR8_TIFR4_OCF0B_SHIFT) }; +//TODO uint8_t int0[2] = { AVR8_INTIDX_OCF0A, AVR8_INTIDX_OCF0B }; #define LOG_TIMER_0 0 #define LOG_TIMER_5 0 @@ -1168,8 +1168,8 @@ void avr8_device::timer0_tick() printf("AVR8_TCCR0A_COM0B: %d\n", AVR8_TCCR0A_COM0B); #endif - UINT8 count = m_r[AVR8_REGIDX_TCNT0]; - INT32 increment = m_timer_increment[0]; + uint8_t count = m_r[AVR8_REGIDX_TCNT0]; + int32_t increment = m_timer_increment[0]; switch(AVR8_WGM0) { @@ -1242,11 +1242,11 @@ void avr8_device::timer0_tick() m_r[AVR8_REGIDX_TCNT0] = count & 0xff; } -void avr8_device::changed_tccr0a(UINT8 data) +void avr8_device::changed_tccr0a(uint8_t data) { - UINT8 oldtccr = AVR8_TCCR0A; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR0A; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; AVR8_TCCR0A = data; @@ -1262,13 +1262,13 @@ void avr8_device::timer0_force_output_compare(int reg) verboselog(m_pc, 0, "timer0_force_output_compare: TODO; should be forcing OC0%c\n", avr8_reg_name[reg]); } -void avr8_device::changed_tccr0b(UINT8 data) +void avr8_device::changed_tccr0b(uint8_t data) { if (VERBOSE_LEVEL) printf("changed_tccr0b: data=0x%02X\n", data); - UINT8 oldtccr = AVR8_TCCR0B; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR0B; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; AVR8_TCCR0B = data; @@ -1295,7 +1295,7 @@ void avr8_device::changed_tccr0b(UINT8 data) } } -void avr8_device::update_ocr0(UINT8 newval, UINT8 reg) +void avr8_device::update_ocr0(uint8_t newval, uint8_t reg) { m_r[(reg == AVR8_REG_A) ? AVR8_REGIDX_OCR0A : AVR8_REGIDX_OCR0B] = newval; } @@ -1306,20 +1306,20 @@ void avr8_device::timer1_tick() { /* TODO: Handle comparison, setting OC1x pins, detection of BOTTOM and TOP */ - UINT16 count = (m_r[AVR8_REGIDX_TCNT1H] << 8) | m_r[AVR8_REGIDX_TCNT1L]; - INT32 wgm1 = ((m_r[AVR8_REGIDX_TCCR1B] & AVR8_TCCR1B_WGM1_32_MASK) >> 1) | + uint16_t count = (m_r[AVR8_REGIDX_TCNT1H] << 8) | m_r[AVR8_REGIDX_TCNT1L]; + int32_t wgm1 = ((m_r[AVR8_REGIDX_TCCR1B] & AVR8_TCCR1B_WGM1_32_MASK) >> 1) | (m_r[AVR8_REGIDX_TCCR1A] & AVR8_TCCR1A_WGM1_10_MASK); // Cache things in array form to avoid a compare+branch inside a potentially high-frequency timer - //UINT8 compare_mode[2] = { (m_r[AVR8_REGIDX_TCCR1A] & AVR8_TCCR1A_COM1A_MASK) >> AVR8_TCCR1A_COM1A_SHIFT, + //uint8_t compare_mode[2] = { (m_r[AVR8_REGIDX_TCCR1A] & AVR8_TCCR1A_COM1A_MASK) >> AVR8_TCCR1A_COM1A_SHIFT, //(m_r[AVR8_REGIDX_TCCR1A] & AVR8_TCCR1A_COM1B_MASK) >> AVR8_TCCR1A_COM1B_SHIFT }; - UINT16 ocr1[2] = { static_cast((m_r[AVR8_REGIDX_OCR1AH] << 8) | m_r[AVR8_REGIDX_OCR1AL]), - static_cast((m_r[AVR8_REGIDX_OCR1BH] << 8) | m_r[AVR8_REGIDX_OCR1BL]) }; - UINT8 ocf1[2] = { (1 << AVR8_TIFR1_OCF1A_SHIFT), (1 << AVR8_TIFR1_OCF1B_SHIFT) }; - UINT8 int1[2] = { AVR8_INTIDX_OCF1A, AVR8_INTIDX_OCF1B }; - INT32 increment = m_timer_increment[1]; + uint16_t ocr1[2] = { static_cast((m_r[AVR8_REGIDX_OCR1AH] << 8) | m_r[AVR8_REGIDX_OCR1AL]), + static_cast((m_r[AVR8_REGIDX_OCR1BH] << 8) | m_r[AVR8_REGIDX_OCR1BL]) }; + uint8_t ocf1[2] = { (1 << AVR8_TIFR1_OCF1A_SHIFT), (1 << AVR8_TIFR1_OCF1B_SHIFT) }; + uint8_t int1[2] = { AVR8_INTIDX_OCF1A, AVR8_INTIDX_OCF1B }; + int32_t increment = m_timer_increment[1]; - for(INT32 reg = AVR8_REG_A; reg <= AVR8_REG_B; reg++) + for(int32_t reg = AVR8_REG_A; reg <= AVR8_REG_B; reg++) { switch(wgm1) { @@ -1409,9 +1409,9 @@ void avr8_device::timer1_tick() m_r[AVR8_REGIDX_TCNT1L] = count & 0xff; } -void avr8_device::update_timer_waveform_gen_mode(UINT8 t, UINT8 mode) +void avr8_device::update_timer_waveform_gen_mode(uint8_t t, uint8_t mode) { - INT32 oc_val = -1, ic_val = -1; + int32_t oc_val = -1, ic_val = -1; switch (t){ case 0: @@ -1440,9 +1440,9 @@ void avr8_device::update_timer_waveform_gen_mode(UINT8 t, UINT8 mode) break; } - INT32 top_values_02[8] = {0xFF, 0xFF, oc_val, 0xFF, -1, oc_val, -1, oc_val}; //table 20-8 + int32_t top_values_02[8] = {0xFF, 0xFF, oc_val, 0xFF, -1, oc_val, -1, oc_val}; //table 20-8 - INT32 top_values_1345[16] = {0xFFFF, 0x00FF, 0x01FF, 0x03FF, + int32_t top_values_1345[16] = {0xFFFF, 0x00FF, 0x01FF, 0x03FF, oc_val, 0x00FF, 0x01FF, 0x03FF, ic_val, oc_val, ic_val, oc_val, ic_val, -1, ic_val, oc_val}; //table 17-2 @@ -1466,11 +1466,11 @@ void avr8_device::update_timer_waveform_gen_mode(UINT8 t, UINT8 mode) } } -void avr8_device::changed_tccr1a(UINT8 data) +void avr8_device::changed_tccr1a(uint8_t data) { - UINT8 oldtccr = AVR8_TCCR1A; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR1A; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; m_r[AVR8_REGIDX_TCCR1A] = newtccr; @@ -1491,13 +1491,13 @@ void avr8_device::update_timer1_input_edge_select() //verboselog(m_pc, 0, "update_timer1_input_edge_select: TODO; Clocking edge is %s\n", "test"); } -void avr8_device::changed_tccr1b(UINT8 data) +void avr8_device::changed_tccr1b(uint8_t data) { if (VERBOSE_LEVEL) printf("changed_tccr1b: data=0x%02X\n", data); - UINT8 oldtccr = AVR8_TCCR1B; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR1B; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; m_r[AVR8_REGIDX_TCCR1B] = newtccr; @@ -1524,12 +1524,12 @@ void avr8_device::changed_tccr1b(UINT8 data) } } -void avr8_device::update_ocr1(UINT16 newval, UINT8 reg) +void avr8_device::update_ocr1(uint16_t newval, uint8_t reg) { - UINT8 *p_reg_h = (reg == AVR8_REG_A) ? &m_r[AVR8_REGIDX_OCR1AH] : &m_r[AVR8_REGIDX_OCR1BH]; - UINT8 *p_reg_l = (reg == AVR8_REG_A) ? &m_r[AVR8_REGIDX_OCR1AL] : &m_r[AVR8_REGIDX_OCR1BL]; - *p_reg_h = (UINT8)(newval >> 8); - *p_reg_l = (UINT8)newval; + uint8_t *p_reg_h = (reg == AVR8_REG_A) ? &m_r[AVR8_REGIDX_OCR1AH] : &m_r[AVR8_REGIDX_OCR1BH]; + uint8_t *p_reg_l = (reg == AVR8_REG_A) ? &m_r[AVR8_REGIDX_OCR1AL] : &m_r[AVR8_REGIDX_OCR1BL]; + *p_reg_h = (uint8_t)(newval >> 8); + *p_reg_l = (uint8_t)newval; // Nothing needs to be done? All handled in timer callback } @@ -1538,18 +1538,18 @@ void avr8_device::update_ocr1(UINT16 newval, UINT8 reg) void avr8_device::timer2_tick() { - UINT16 count = m_r[AVR8_REGIDX_TCNT2]; - INT32 wgm2 = ((m_r[AVR8_REGIDX_TCCR2B] & AVR8_TCCR2B_WGM2_2_MASK) >> 1) | + uint16_t count = m_r[AVR8_REGIDX_TCNT2]; + int32_t wgm2 = ((m_r[AVR8_REGIDX_TCCR2B] & AVR8_TCCR2B_WGM2_2_MASK) >> 1) | (m_r[AVR8_REGIDX_TCCR2A] & AVR8_TCCR2A_WGM2_10_MASK); // Cache things in array form to avoid a compare+branch inside a potentially high-frequency timer - //UINT8 compare_mode[2] = { (m_r[AVR8_REGIDX_TCCR2A] & AVR8_TCCR2A_COM2A_MASK) >> AVR8_TCCR2A_COM2A_SHIFT, + //uint8_t compare_mode[2] = { (m_r[AVR8_REGIDX_TCCR2A] & AVR8_TCCR2A_COM2A_MASK) >> AVR8_TCCR2A_COM2A_SHIFT, //(m_r[AVR8_REGIDX_TCCR2A] & AVR8_TCCR2A_COM2B_MASK) >> AVR8_TCCR2A_COM2B_SHIFT }; - UINT8 ocr2[2] = { m_r[AVR8_REGIDX_OCR2A], m_r[AVR8_REGIDX_OCR2B] }; - UINT8 ocf2[2] = { (1 << AVR8_TIFR2_OCF2A_SHIFT), (1 << AVR8_TIFR2_OCF2B_SHIFT) }; - INT32 increment = m_timer_increment[2]; + uint8_t ocr2[2] = { m_r[AVR8_REGIDX_OCR2A], m_r[AVR8_REGIDX_OCR2B] }; + uint8_t ocf2[2] = { (1 << AVR8_TIFR2_OCF2A_SHIFT), (1 << AVR8_TIFR2_OCF2B_SHIFT) }; + int32_t increment = m_timer_increment[2]; - for(INT32 reg = AVR8_REG_A; reg <= AVR8_REG_B; reg++) + for(int32_t reg = AVR8_REG_A; reg <= AVR8_REG_B; reg++) { switch(wgm2) { @@ -1628,11 +1628,11 @@ void avr8_device::timer2_tick() update_interrupt(AVR8_INTIDX_TOV2); } -void avr8_device::changed_tccr2a(UINT8 data) +void avr8_device::changed_tccr2a(uint8_t data) { - UINT8 oldtccr = AVR8_TCCR2A; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR2A; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; AVR8_TCCR2A = data; @@ -1649,13 +1649,13 @@ void avr8_device::timer2_force_output_compare(int reg) verboselog(m_pc, 0, "force_output_compare: TODO; should be forcing OC2%c\n", avr8_reg_name[reg]); } -void avr8_device::changed_tccr2b(UINT8 data) +void avr8_device::changed_tccr2b(uint8_t data) { if (VERBOSE_LEVEL) printf("changed_tccr2b: data=0x%02X\n", data); - UINT8 oldtccr = AVR8_TCCR2B; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR2B; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; AVR8_TCCR2B = data; @@ -1682,7 +1682,7 @@ void avr8_device::changed_tccr2b(UINT8 data) } } -void avr8_device::update_ocr2(UINT8 newval, UINT8 reg) +void avr8_device::update_ocr2(uint8_t newval, uint8_t reg) { m_r[(reg == AVR8_REG_A) ? AVR8_REGIDX_OCR2A : AVR8_REGIDX_OCR2B] = newval; @@ -1704,16 +1704,16 @@ void avr8_device::timer4_tick() // printf("AVR8_WGM4: %d\n", AVR8_WGM4); // printf("AVR8_TCCR4A_COM4B: %d\n", AVR8_TCCR4A_COM4B); - UINT16 count = (m_r[AVR8_REGIDX_TCNT4H] << 8) | m_r[AVR8_REGIDX_TCNT4L]; + uint16_t count = (m_r[AVR8_REGIDX_TCNT4H] << 8) | m_r[AVR8_REGIDX_TCNT4L]; // Cache things in array form to avoid a compare+branch inside a potentially high-frequency timer - //UINT8 compare_mode[2] = { (m_r[AVR8_REGIDX_TCCR1A] & AVR8_TCCR1A_COM1A_MASK) >> AVR8_TCCR1A_COM1A_SHIFT, + //uint8_t compare_mode[2] = { (m_r[AVR8_REGIDX_TCCR1A] & AVR8_TCCR1A_COM1A_MASK) >> AVR8_TCCR1A_COM1A_SHIFT, //(m_r[AVR8_REGIDX_TCCR1A] & AVR8_TCCR1A_COM1B_MASK) >> AVR8_TCCR1A_COM1B_SHIFT }; - UINT16 ocr4[2] = { static_cast((m_r[AVR8_REGIDX_OCR4AH] << 8) | m_r[AVR8_REGIDX_OCR4AL]), - static_cast((m_r[AVR8_REGIDX_OCR4BH] << 8) | m_r[AVR8_REGIDX_OCR4BL]) }; -//TODO UINT8 ocf4[2] = { (1 << AVR8_TIFR4_OCF4A_SHIFT), (1 << AVR8_TIFR4_OCF4B_SHIFT) }; -//TODO UINT8 int4[2] = { AVR8_INTIDX_OCF4A, AVR8_INTIDX_OCF4B }; - INT32 increment = m_timer_increment[4]; + uint16_t ocr4[2] = { static_cast((m_r[AVR8_REGIDX_OCR4AH] << 8) | m_r[AVR8_REGIDX_OCR4AL]), + static_cast((m_r[AVR8_REGIDX_OCR4BH] << 8) | m_r[AVR8_REGIDX_OCR4BL]) }; +//TODO uint8_t ocf4[2] = { (1 << AVR8_TIFR4_OCF4A_SHIFT), (1 << AVR8_TIFR4_OCF4B_SHIFT) }; +//TODO uint8_t int4[2] = { AVR8_INTIDX_OCF4A, AVR8_INTIDX_OCF4B }; + int32_t increment = m_timer_increment[4]; switch(AVR8_WGM4) { @@ -1783,7 +1783,7 @@ void avr8_device::timer4_tick() m_r[AVR8_REGIDX_TCNT4L] = count & 0xff; } -void avr8_device::update_timer_clock_source(UINT8 t, UINT8 clock_select) +void avr8_device::update_timer_clock_source(uint8_t t, uint8_t clock_select) { int prescale_values[8] = {0, 1, 8, 64, 256, 1024, -1, -1}; m_timer_prescale[t] = prescale_values[clock_select]; @@ -1799,22 +1799,22 @@ void avr8_device::update_timer_clock_source(UINT8 t, UINT8 clock_select) m_timer_prescale_count[t] = m_timer_prescale[t] - 1; } -void avr8_device::changed_tccr3a(UINT8 data) +void avr8_device::changed_tccr3a(uint8_t data) { //TODO: Implement-me // AVR8_TCCR3A = data; } -void avr8_device::changed_tccr3b(UINT8 data) +void avr8_device::changed_tccr3b(uint8_t data) { printf("IMPLEMENT-ME: changed_tccr4b: data=0x%02X\n", data); } -void avr8_device::changed_tccr3c(UINT8 data) +void avr8_device::changed_tccr3c(uint8_t data) { -// UINT8 oldtccr = AVR8_TCCR3C; -// UINT8 newtccr = data; -// UINT8 changed = newtccr ^ oldtccr; +// uint8_t oldtccr = AVR8_TCCR3C; +// uint8_t newtccr = data; +// uint8_t changed = newtccr ^ oldtccr; printf("IMPLEMENT-ME: changed_tccr3c: data=0x%02X\n", data); // AVR8_TCCR3C = data; @@ -1822,11 +1822,11 @@ void avr8_device::changed_tccr3c(UINT8 data) //TODO: Implement-me } -void avr8_device::changed_tccr4a(UINT8 data) +void avr8_device::changed_tccr4a(uint8_t data) { - UINT8 oldtccr = AVR8_TCCR4A; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR4A; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; AVR8_TCCR4A = data; @@ -1836,13 +1836,13 @@ void avr8_device::changed_tccr4a(UINT8 data) } } -void avr8_device::changed_tccr4b(UINT8 data) +void avr8_device::changed_tccr4b(uint8_t data) { printf("changed_tccr4b: data=0x%02X\n", data); - UINT8 oldtccr = AVR8_TCCR4B; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR4B; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; AVR8_TCCR4B = data; @@ -1869,11 +1869,11 @@ void avr8_device::changed_tccr4b(UINT8 data) } } -void avr8_device::changed_tccr4c(UINT8 data) +void avr8_device::changed_tccr4c(uint8_t data) { -// UINT8 oldtccr = AVR8_TCCR4C; -// UINT8 newtccr = data; -// UINT8 changed = newtccr ^ oldtccr; +// uint8_t oldtccr = AVR8_TCCR4C; +// uint8_t newtccr = data; +// uint8_t changed = newtccr ^ oldtccr; AVR8_TCCR4C = data; @@ -1890,8 +1890,8 @@ void avr8_device::timer5_tick() printf("AVR8_TCCR5A_COM5B: %d\n", AVR8_TCCR5A_COM5B); #endif - UINT16 count = (AVR8_TCNT5H << 8) + AVR8_TCNT5L; - INT32 increment = m_timer_increment[5]; + uint16_t count = (AVR8_TCNT5H << 8) + AVR8_TCNT5L; + int32_t increment = m_timer_increment[5]; switch(AVR8_WGM5) { @@ -1964,11 +1964,11 @@ void avr8_device::timer5_tick() m_r[AVR8_REGIDX_TCNT5L] = count & 0xff; } -void avr8_device::changed_tccr5a(UINT8 data) +void avr8_device::changed_tccr5a(uint8_t data) { - UINT8 oldtccr = AVR8_TCCR5A; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR5A; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; AVR8_TCCR5A = data; @@ -1978,13 +1978,13 @@ void avr8_device::changed_tccr5a(UINT8 data) } } -void avr8_device::changed_tccr5b(UINT8 data) +void avr8_device::changed_tccr5b(uint8_t data) { printf("changed_tccr5b: data=0x%02X\n", data); - UINT8 oldtccr = AVR8_TCCR5B; - UINT8 newtccr = data; - UINT8 changed = newtccr ^ oldtccr; + uint8_t oldtccr = AVR8_TCCR5B; + uint8_t newtccr = data; + uint8_t changed = newtccr ^ oldtccr; AVR8_TCCR5B = data; @@ -2049,7 +2049,7 @@ void avr8_device::spi_update_clock_phase() // TODO } -const UINT8 avr8_device::spi_clock_divisor[8] = { 4, 16, 64, 128, 2, 8, 32, 64 }; +const uint8_t avr8_device::spi_clock_divisor[8] = { 4, 16, 64, 128, 2, 8, 32, 64 }; void avr8_device::spi_update_clock_rate() { @@ -2057,13 +2057,13 @@ void avr8_device::spi_update_clock_rate() m_spi_prescale_count &= m_spi_prescale - 1; } -void avr8_device::change_spcr(UINT8 data) +void avr8_device::change_spcr(uint8_t data) { - UINT8 oldspcr = AVR8_SPCR; - UINT8 newspcr = data; - UINT8 changed = newspcr ^ oldspcr; - UINT8 high_to_low = ~newspcr & oldspcr; - UINT8 low_to_high = newspcr & ~oldspcr; + uint8_t oldspcr = AVR8_SPCR; + uint8_t newspcr = data; + uint8_t changed = newspcr ^ oldspcr; + uint8_t high_to_low = ~newspcr & oldspcr; + uint8_t low_to_high = newspcr & ~oldspcr; AVR8_SPCR = data; @@ -2103,11 +2103,11 @@ void avr8_device::change_spcr(UINT8 data) } } -void avr8_device::change_spsr(UINT8 data) +void avr8_device::change_spsr(uint8_t data) { - UINT8 oldspsr = AVR8_SPSR; - UINT8 newspsr = data; - UINT8 changed = newspsr ^ oldspsr; + uint8_t oldspsr = AVR8_SPSR; + uint8_t newspsr = data; + uint8_t changed = newspsr ^ oldspsr; AVR8_SPSR &= ~1; AVR8_SPSR |= data & 1; @@ -2296,14 +2296,14 @@ WRITE8_MEMBER( avr8_device::regs_w ) if (data & AVR8_EECR_EERE_MASK) { - UINT16 addr = (m_r[AVR8_REGIDX_EEARH] & AVR8_EEARH_MASK) << 8; + uint16_t addr = (m_r[AVR8_REGIDX_EEARH] & AVR8_EEARH_MASK) << 8; addr |= m_r[AVR8_REGIDX_EEARL]; m_r[AVR8_REGIDX_EEDR] = m_eeprom[addr]; if (VERBOSE_LEVEL) printf("EEPROM read @ 0x%04x data = 0x%02x\n", addr, m_eeprom[addr]); } if ((data & AVR8_EECR_EEPE_MASK) && (data & AVR8_EECR_EEMPE_MASK)) { - UINT16 addr = (m_r[AVR8_REGIDX_EEARH] & AVR8_EEARH_MASK) << 8; + uint16_t addr = (m_r[AVR8_REGIDX_EEARH] & AVR8_EEARH_MASK) << 8; addr |= m_r[AVR8_REGIDX_EEARL]; m_eeprom[addr] = m_r[AVR8_REGIDX_EEDR]; if (VERBOSE_LEVEL) printf("EEPROM write @ 0x%04x data = 0x%02x ('%c')\n", addr, m_eeprom[addr], m_eeprom[addr]); @@ -2931,7 +2931,7 @@ READ8_MEMBER( avr8_device::regs_r ) // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 avr8_device::execute_min_cycles() const +uint32_t avr8_device::execute_min_cycles() const { return 1; } @@ -2942,7 +2942,7 @@ UINT32 avr8_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 avr8_device::execute_max_cycles() const +uint32_t avr8_device::execute_max_cycles() const { return 4; } @@ -2953,7 +2953,7 @@ UINT32 avr8_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 avr8_device::execute_input_lines() const +uint32_t avr8_device::execute_input_lines() const { return 0; } @@ -2971,15 +2971,15 @@ void avr8_device::execute_set_input(int inputnum, int state) void avr8_device::execute_run() { - UINT32 op; - INT32 offs; - UINT8 rd; - UINT8 rr; - UINT8 res; - UINT16 pd; - UINT32 pd32; - INT16 sd; - INT32 opcycles; + uint32_t op; + int32_t offs; + uint8_t rd; + uint8_t rr; + uint8_t res; + uint16_t pd; + uint32_t pd32; + int16_t sd; + int32_t opcycles; while (m_icount > 0) { @@ -2990,7 +2990,7 @@ void avr8_device::execute_run() debugger_instruction_hook(this, m_shifted_pc); - op = (UINT32)m_program->read_word(m_shifted_pc); + op = (uint32_t)m_program->read_word(m_shifted_pc); switch(op & 0xf000) { @@ -3004,7 +3004,7 @@ void avr8_device::execute_run() m_r[RD4(op) << 1] = m_r[RR4(op) << 1]; break; case 0x0200: // MULS Rd,Rr - sd = (INT8)m_r[16 + RD4(op)] * (INT8)m_r[16 + RR4(op)]; + sd = (int8_t)m_r[16 + RD4(op)] * (int8_t)m_r[16 + RR4(op)]; m_r[1] = (sd >> 8) & 0x00ff; m_r[0] = sd & 0x00ff; SREG_W(AVR8_SREG_C, (sd & 0x8000) ? 1 : 0); @@ -3015,7 +3015,7 @@ void avr8_device::execute_run() switch(MULCONST2(op)) { case 0x0000: // MULSU Rd,Rr - sd = (INT8)m_r[16 + RD3(op)] * (UINT8)m_r[16 + RR3(op)]; + sd = (int8_t)m_r[16 + RD3(op)] * (uint8_t)m_r[16 + RR3(op)]; m_r[1] = (sd >> 8) & 0x00ff; m_r[0] = sd & 0x00ff; SREG_W(AVR8_SREG_C, (sd & 0x8000) ? 1 : 0); @@ -3023,7 +3023,7 @@ void avr8_device::execute_run() opcycles = 2; break; case 0x0001: // FMUL Rd,Rr - sd = (UINT8)m_r[16 + RD3(op)] * (UINT8)m_r[16 + RR3(op)]; + sd = (uint8_t)m_r[16 + RD3(op)] * (uint8_t)m_r[16 + RR3(op)]; sd <<= 1; m_r[1] = (sd >> 8) & 0x00ff; m_r[0] = sd & 0x00ff; @@ -3032,7 +3032,7 @@ void avr8_device::execute_run() opcycles = 2; break; case 0x0002: // FMULS Rd,Rr - sd = (INT8)m_r[16 + RD3(op)] * (INT8)m_r[16 + RR3(op)]; + sd = (int8_t)m_r[16 + RD3(op)] * (int8_t)m_r[16 + RR3(op)]; sd <<= 1; m_r[1] = (sd >> 8) & 0x00ff; m_r[0] = sd & 0x00ff; @@ -3041,7 +3041,7 @@ void avr8_device::execute_run() opcycles = 2; break; case 0x0003: // FMULSU Rd,Rr - sd = (INT8)m_r[16 + RD3(op)] * (UINT8)m_r[16 + RR3(op)]; + sd = (int8_t)m_r[16 + RD3(op)] * (uint8_t)m_r[16 + RR3(op)]; sd <<= 1; m_r[1] = (sd >> 8) & 0x00ff; m_r[0] = sd & 0x00ff; @@ -3105,7 +3105,7 @@ void avr8_device::execute_run() rr = m_r[RR5(op)]; if (rd == rr) { - op = (UINT32)m_program->read_word(m_shifted_pc + 2); + op = (uint32_t)m_program->read_word(m_shifted_pc + 2); opcycles += is_long_opcode(op) ? 2 : 1; m_pc += is_long_opcode(op) ? 2 : 1; } @@ -3793,7 +3793,7 @@ void avr8_device::execute_run() case 0x0900: // SBIC A,b if(NOT(BIT(m_data->read_byte(32 + ACONST5(op)), RR3(op)))) { - op = (UINT32)m_program->read_word(m_shifted_pc + 2); + op = (uint32_t)m_program->read_word(m_shifted_pc + 2); opcycles = is_long_opcode(op) ? 3 : 2; m_pc += is_long_opcode(op) ? 2 : 1; } @@ -3805,7 +3805,7 @@ void avr8_device::execute_run() case 0x0b00: // SBIS A,b if(BIT(m_data->read_byte(32 + ACONST5(op)), RR3(op))) { - op = (UINT32)m_program->read_word(m_shifted_pc + 2); + op = (uint32_t)m_program->read_word(m_shifted_pc + 2); opcycles = is_long_opcode(op) ? 3 : 2; m_pc += is_long_opcode(op) ? 2 : 1; } @@ -3814,7 +3814,7 @@ void avr8_device::execute_run() case 0x0d00: case 0x0e00: case 0x0f00: // MUL Rd,Rr - sd = (UINT8)m_r[RD5(op)] * (UINT8)m_r[RR5(op)]; + sd = (uint8_t)m_r[RD5(op)] * (uint8_t)m_r[RR5(op)]; m_r[1] = (sd >> 8) & 0x00ff; m_r[0] = sd & 0x00ff; SREG_W(AVR8_SREG_C, (sd & 0x8000) ? 1 : 0); @@ -3834,12 +3834,12 @@ void avr8_device::execute_run() } break; case 0xc000: // RJMP k - offs = (INT32)((op & 0x0800) ? ((op & 0x0fff) | 0xfffff000) : (op & 0x0fff)); + offs = (int32_t)((op & 0x0800) ? ((op & 0x0fff) | 0xfffff000) : (op & 0x0fff)); m_pc += offs; opcycles = 2; break; case 0xd000: // RCALL k - offs = (INT32)((op & 0x0800) ? ((op & 0x0fff) | 0xfffff000) : (op & 0x0fff)); + offs = (int32_t)((op & 0x0800) ? ((op & 0x0fff) | 0xfffff000) : (op & 0x0fff)); push((m_pc + 1) & 0x00ff); push(((m_pc + 1) >> 8) & 0x00ff); m_pc += offs; @@ -3854,7 +3854,7 @@ void avr8_device::execute_run() case 0x0000: // BRLO through BRIE if(SREG_R(op & 0x0007)) { - offs = (INT32)(KCONST7(op)); + offs = (int32_t)(KCONST7(op)); if(offs & 0x40) { offs |= 0xffffff80; @@ -3866,7 +3866,7 @@ void avr8_device::execute_run() case 0x0400: // BRSH through BRID if(SREG_R(op & 0x0007) == 0) { - offs = (INT32)(KCONST7(op)); + offs = (int32_t)(KCONST7(op)); if(offs & 0x40) { offs |= 0xffffff80; @@ -3897,7 +3897,7 @@ void avr8_device::execute_run() { if(BIT(m_r[RD5(op)], RR3(op))) { - op = (UINT32)m_program->read_word(m_shifted_pc + 2); + op = (uint32_t)m_program->read_word(m_shifted_pc + 2); m_pc += is_long_opcode(op) ? 2 : 1; opcycles = is_long_opcode(op) ? 3 : 2; } @@ -3906,7 +3906,7 @@ void avr8_device::execute_run() { if(NOT(BIT(m_r[RD5(op)], RR3(op)))) { - op = (UINT32)m_program->read_word(m_shifted_pc + 2); + op = (uint32_t)m_program->read_word(m_shifted_pc + 2); m_pc += is_long_opcode(op) ? 2 : 1; opcycles = is_long_opcode(op) ? 3 : 2; } diff --git a/src/devices/cpu/avr8/avr8.h b/src/devices/cpu/avr8/avr8.h index ea9cf8c8a19..006d052f70c 100644 --- a/src/devices/cpu/avr8/avr8.h +++ b/src/devices/cpu/avr8/avr8.h @@ -83,14 +83,14 @@ public: static void set_eeprom_tag(device_t &device, const char *tag) { downcast(device).m_eeprom.set_tag(tag); } // fuse configs - void set_low_fuses(UINT8 byte); - void set_high_fuses(UINT8 byte); - void set_extended_fuses(UINT8 byte); - void set_lock_bits(UINT8 byte); + void set_low_fuses(uint8_t byte); + void set_high_fuses(uint8_t byte); + void set_extended_fuses(uint8_t byte); + void set_lock_bits(uint8_t byte); // public interfaces virtual void update_interrupt(int source); - UINT64 get_elapsed_cycles() + uint64_t get_elapsed_cycles() { return m_elapsed_cycles; } @@ -98,7 +98,7 @@ public: // register handling DECLARE_WRITE8_MEMBER( regs_w ); DECLARE_READ8_MEMBER( regs_r ); - UINT32 m_shifted_pc; + uint32_t m_shifted_pc; protected: enum @@ -109,16 +109,16 @@ protected: CPU_TYPE_ATMEGA2560 }; - avr8_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, const device_type type, UINT32 address_mask, address_map_constructor internal_map, UINT8 cpu_type, const char *shortname, const char *source); + avr8_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, const device_type type, uint32_t address_mask, address_map_constructor internal_map, uint8_t cpu_type, const char *shortname, const char *source); // device-level overrides virtual void device_start() override; virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -126,9 +126,9 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; @@ -137,111 +137,111 @@ protected: const address_space_config m_program_config; const address_space_config m_data_config; const address_space_config m_io_config; - required_region_ptr m_eeprom; + required_region_ptr m_eeprom; // bootloader - UINT16 m_boot_size; - UINT8 m_cpu_type; + uint16_t m_boot_size; + uint8_t m_cpu_type; // Fuses - UINT8 m_lfuses; - UINT8 m_hfuses; - UINT8 m_efuses; - UINT8 m_lock_bits; + uint8_t m_lfuses; + uint8_t m_hfuses; + uint8_t m_efuses; + uint8_t m_lock_bits; // CPU registers - UINT32 m_pc; - UINT8 m_r[0x200]; + uint32_t m_pc; + uint8_t m_r[0x200]; // internal timers - INT32 m_timer_top[6]; - UINT8 m_timer_increment[6]; - UINT16 m_timer_prescale[6]; - UINT16 m_timer_prescale_count[6]; + int32_t m_timer_top[6]; + uint8_t m_timer_increment[6]; + uint16_t m_timer_prescale[6]; + uint16_t m_timer_prescale_count[6]; bool m_ocr2_not_reached_yet; // SPI bool m_spi_active; - UINT8 m_spi_prescale; - UINT8 m_spi_prescale_count; - INT8 m_spi_prescale_countdown; - static const UINT8 spi_clock_divisor[8]; + uint8_t m_spi_prescale; + uint8_t m_spi_prescale_count; + int8_t m_spi_prescale_countdown; + static const uint8_t spi_clock_divisor[8]; void enable_spi(); void disable_spi(); void spi_update_masterslave_select(); void spi_update_clock_polarity(); void spi_update_clock_phase(); void spi_update_clock_rate(); - void change_spcr(UINT8 data); - void change_spsr(UINT8 data); + void change_spcr(uint8_t data); + void change_spsr(uint8_t data); // internal CPU state - UINT32 m_addr_mask; + uint32_t m_addr_mask; bool m_interrupt_pending; // other internal states int m_icount; - UINT64 m_elapsed_cycles; + uint64_t m_elapsed_cycles; // memory access - inline void push(UINT8 val); - inline UINT8 pop(); - inline bool is_long_opcode(UINT16 op); + inline void push(uint8_t val); + inline uint8_t pop(); + inline bool is_long_opcode(uint16_t op); // utility - void unimplemented_opcode(UINT32 op); + void unimplemented_opcode(uint32_t op); // interrupts - void set_irq_line(UINT16 vector, int state); + void set_irq_line(uint16_t vector, int state); // timers void timer_tick(int cycles); - void update_timer_clock_source(UINT8 timer, UINT8 selection); - void update_timer_waveform_gen_mode(UINT8 timer, UINT8 mode); + void update_timer_clock_source(uint8_t timer, uint8_t selection); + void update_timer_waveform_gen_mode(uint8_t timer, uint8_t mode); // timer 0 void timer0_tick(); - void changed_tccr0a(UINT8 data); - void changed_tccr0b(UINT8 data); - void update_ocr0(UINT8 newval, UINT8 reg); + void changed_tccr0a(uint8_t data); + void changed_tccr0b(uint8_t data); + void update_ocr0(uint8_t newval, uint8_t reg); void timer0_force_output_compare(int reg); // timer 1 void timer1_tick(); - void changed_tccr1a(UINT8 data); - void changed_tccr1b(UINT8 data); + void changed_tccr1a(uint8_t data); + void changed_tccr1b(uint8_t data); void update_timer1_input_noise_canceler(); void update_timer1_input_edge_select(); - void update_ocr1(UINT16 newval, UINT8 reg); + void update_ocr1(uint16_t newval, uint8_t reg); // timer 2 void timer2_tick(); - void changed_tccr2a(UINT8 data); - void changed_tccr2b(UINT8 data); - void update_ocr2(UINT8 newval, UINT8 reg); + void changed_tccr2a(uint8_t data); + void changed_tccr2b(uint8_t data); + void update_ocr2(uint8_t newval, uint8_t reg); void timer2_force_output_compare(int reg); // timer 3 void timer3_tick(); - void changed_tccr3a(UINT8 data); - void changed_tccr3b(UINT8 data); - void changed_tccr3c(UINT8 data); -// void update_ocr3(UINT8 newval, UINT8 reg); + void changed_tccr3a(uint8_t data); + void changed_tccr3b(uint8_t data); + void changed_tccr3c(uint8_t data); +// void update_ocr3(uint8_t newval, uint8_t reg); // void timer3_force_output_compare(int reg); // timer 4 void timer4_tick(); - void changed_tccr4a(UINT8 data); - void changed_tccr4b(UINT8 data); - void changed_tccr4c(UINT8 data); - //void update_ocr4(UINT8 newval, UINT8 reg); + void changed_tccr4a(uint8_t data); + void changed_tccr4b(uint8_t data); + void changed_tccr4c(uint8_t data); + //void update_ocr4(uint8_t newval, uint8_t reg); //void timer4_force_output_compare(int reg); // timer 5 void timer5_tick(); - void changed_tccr5a(UINT8 data); - void changed_tccr5b(UINT8 data); -// void update_ocr5(UINT8 newval, UINT8 reg); + void changed_tccr5a(uint8_t data); + void changed_tccr5b(uint8_t data); +// void update_ocr5(uint8_t newval, uint8_t reg); // void timer5_force_output_compare(int reg); // address spaces @@ -262,7 +262,7 @@ class atmega88_device : public avr8_device { public: // construction/destruction - atmega88_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atmega88_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // ======================> atmega644_device @@ -271,7 +271,7 @@ class atmega644_device : public avr8_device { public: // construction/destruction - atmega644_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atmega644_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void update_interrupt(int source) override; }; @@ -282,7 +282,7 @@ class atmega1280_device : public avr8_device { public: // construction/destruction - atmega1280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atmega1280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void update_interrupt(int source) override; }; @@ -293,7 +293,7 @@ class atmega2560_device : public avr8_device { public: // construction/destruction - atmega2560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atmega2560_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void update_interrupt(int source) override; }; diff --git a/src/devices/cpu/avr8/avr8dasm.cpp b/src/devices/cpu/avr8/avr8dasm.cpp index cc5fcecf3a9..c344b4085b2 100644 --- a/src/devices/cpu/avr8/avr8dasm.cpp +++ b/src/devices/cpu/avr8/avr8dasm.cpp @@ -19,7 +19,7 @@ #define KCONST6(op) ((((op) >> 2) & 0x0030) | ((op) & 0x000f)) #define KCONST7(op) (((op) >> 3) & 0x007f) #define KCONST8(op) ((((op) >> 4) & 0x00f0) | ((op) & 0x000f)) -#define KCONST22(op) (((((UINT32)(op) >> 3) & 0x003e) | ((UINT32)(op) & 0x0001)) << 16) +#define KCONST22(op) (((((uint32_t)(op) >> 3) & 0x003e) | ((uint32_t)(op) & 0x0001)) << 16) #define QCONST6(op) ((((op) >> 8) & 0x0020) | (((op) >> 7) & 0x0018) | ((op) & 0x0007)) #define ACONST5(op) (((op) >> 3) & 0x001f) #define ACONST6(op) ((((op) >> 5) & 0x0030) | ((op) & 0x000f)) @@ -29,9 +29,9 @@ CPU_DISASSEMBLE( avr8 ) { char *output = buffer; int pos = 0; - UINT32 op = oprom[pos++]; + uint32_t op = oprom[pos++]; op |= oprom[pos++] << 8; - UINT32 addr; + uint32_t addr; const char* register_names[0x40] = {"PINA", "DDRA", "PORTA", "PINB", "DDRB", "PORTB", "PINC", "DDRC", "PORTC", "PIND", "DDRD", "PORTD", "PINE", "DDRE", "PORTE", "PINF", "DDRF", "PORTF", "PING", "DDRG", "PORTG", "TIFR0", "TIFR1", "TIFR2","TIFR3", "TIFR4", "TIFR5", "PCIFR", "EIFR", "EIMSK", "GPIOR0", "EECR", "EEDR", "EEARL", "EEARH", "GTCCR", "TCCR0A", "TCCR0B", "TCNT0", "OCR0A", "OCR0B", "0x29", "GPIOR1", "GPIOR2", "SPCR", "SPSR", "SPDR", "0x2F", "ACSR", "OCDR", "0x32", "SMCR", "MCUSR", "MCUCR", "0x36", "SPMCSR", "0x38", "0x39", "0x3A", "RAMPZ", "EIND", "SPL", "SPH", "SREG"}; const char* register_bit_names[0x40][8] = { diff --git a/src/devices/cpu/ccpu/ccpu.cpp b/src/devices/cpu/ccpu/ccpu.cpp index 9758faff4f0..419dcd23061 100644 --- a/src/devices/cpu/ccpu/ccpu.cpp +++ b/src/devices/cpu/ccpu/ccpu.cpp @@ -49,7 +49,7 @@ const device_type CCPU = &device_creator; #define STANDARD_ACC_OP(resexp,cmpval) \ do { \ - UINT16 result = resexp; \ + uint16_t result = resexp; \ SET_A0; /* set the A0 bit based on the previous 'A' value */ \ SET_CMP_VAL(cmpval); /* set the compare values to the previous accumulator and the cmpval */ \ SET_NC(result); /* set the NC flag based on the unmasked result */ \ @@ -62,7 +62,7 @@ do { \ INITIALIZATION AND SHUTDOWN ***************************************************************************/ -ccpu_cpu_device::ccpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ccpu_cpu_device::ccpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, CCPU, "Cinematronics CPU", tag, owner, clock, "ccpu", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 8, 15, 0) , m_data_config("data", ENDIANNESS_BIG, 16, 32, -1) @@ -200,8 +200,8 @@ void ccpu_cpu_device::execute_run() do { - UINT16 tempval; - UINT8 opcode; + uint16_t tempval; + uint8_t opcode; /* update the delayed MI flag */ m_miflag = m_nextmiflag; @@ -437,7 +437,7 @@ void ccpu_cpu_device::execute_run() m_I = (m_P << 4) + (opcode & 0x0f); tempval = RDMEM(m_I); { - UINT16 result = *m_acc + (tempval ^ 0xfff) + 1; + uint16_t result = *m_acc + (tempval ^ 0xfff) + 1; SET_A0; SET_CMP_VAL(tempval); SET_NC(result); @@ -469,11 +469,11 @@ void ccpu_cpu_device::execute_run() /* DV */ case 0xe0: { - INT16 stopX = (INT16)(m_A << 4) >> 4; - INT16 stopY = (INT16)(m_B << 4) >> 4; + int16_t stopX = (int16_t)(m_A << 4) >> 4; + int16_t stopY = (int16_t)(m_B << 4) >> 4; - stopX = ((INT16)(stopX - m_X) >> m_T) + m_X; - stopY = ((INT16)(stopY - m_Y) >> m_T) + m_Y; + stopX = ((int16_t)(stopX - m_X) >> m_T) + m_X; + stopY = ((int16_t)(stopY - m_Y) >> m_T) + m_Y; m_vector_callback(m_X, m_Y, stopX, stopY, m_T); @@ -515,10 +515,10 @@ void ccpu_cpu_device::execute_run() { if (m_A & 1) { - UINT16 result; + uint16_t result; m_cmpacc = m_B; m_A = (m_A >> 1) | ((m_B << 11) & 0x800); - m_B = ((INT16)(m_B << 4) >> 5) & 0xfff; + m_B = ((int16_t)(m_B << 4) >> 5) & 0xfff; result = m_B + tempval; SET_NC(result); SET_MI(result); @@ -526,20 +526,20 @@ void ccpu_cpu_device::execute_run() } else { - UINT16 result; + uint16_t result; m_cmpacc = m_A; result = m_A + tempval; m_A = (m_A >> 1) | ((m_B << 11) & 0x800); - m_B = ((INT16)(m_B << 4) >> 5) & 0xfff; + m_B = ((int16_t)(m_B << 4) >> 5) & 0xfff; SET_NC(result); SET_MI(result); } } else { - UINT16 result; + uint16_t result; m_cmpacc = m_B; - m_B = ((INT16)(m_B << 4) >> 5) & 0xfff; + m_B = ((int16_t)(m_B << 4) >> 5) & 0xfff; result = m_B + tempval; SET_NC(result); SET_MI(result); @@ -623,7 +623,7 @@ void ccpu_cpu_device::execute_run() /* SHR */ case 0xeb: case 0xfb: - tempval = ((m_acc == &m_A) ? (m_A >> 1) : ((INT16)(m_B << 4) >> 5)) & 0xfff; + tempval = ((m_acc == &m_A) ? (m_A >> 1) : ((int16_t)(m_B << 4) >> 5)) & 0xfff; tempval |= (*m_acc + (0xb0b | (opcode & 0xf0))) & 0x1000; STANDARD_ACC_OP(tempval, 0xb0b | (opcode & 0xf0)); NEXT_ACC_A; CYCLES(1); @@ -641,7 +641,7 @@ void ccpu_cpu_device::execute_run() /* ASR */ case 0xed: case 0xfd: - tempval = ((INT16)(*m_acc << 4) >> 5) & 0xfff; + tempval = ((int16_t)(*m_acc << 4) >> 5) & 0xfff; STANDARD_ACC_OP(tempval, 0xd0d | (opcode & 0xf0)); NEXT_ACC_A; CYCLES(1); break; @@ -652,10 +652,10 @@ void ccpu_cpu_device::execute_run() if (m_acc == &m_A) { tempval = (m_A >> 1) | ((m_B << 11) & 0x800); - m_B = ((INT16)(m_B << 4) >> 5) & 0xfff; + m_B = ((int16_t)(m_B << 4) >> 5) & 0xfff; } else - tempval = ((INT16)(m_B << 4) >> 5) & 0xfff; + tempval = ((int16_t)(m_B << 4) >> 5) & 0xfff; tempval |= (*m_acc + (0xe0e | (opcode & 0xf0))) & 0x1000; STANDARD_ACC_OP(tempval, 0xe0e | (opcode & 0xf0)); NEXT_ACC_A; CYCLES(1); @@ -678,8 +678,8 @@ void ccpu_cpu_device::execute_run() /* IV */ case 0xf0: - m_X = (INT16)(m_A << 4) >> 4; - m_Y = (INT16)(m_B << 4) >> 4; + m_X = (int16_t)(m_A << 4) >> 4; + m_Y = (int16_t)(m_B << 4) >> 4; NEXT_ACC_A; CYCLES(1); break; } @@ -687,7 +687,7 @@ void ccpu_cpu_device::execute_run() } -offs_t ccpu_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t ccpu_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( ccpu ); return CPU_DISASSEMBLE_NAME(ccpu)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/ccpu/ccpu.h b/src/devices/cpu/ccpu/ccpu.h index 9247e54f16d..6fff475a3b6 100644 --- a/src/devices/cpu/ccpu/ccpu.h +++ b/src/devices/cpu/ccpu/ccpu.h @@ -35,7 +35,7 @@ enum }; -typedef device_delegate ccpu_vector_delegate; +typedef device_delegate ccpu_vector_delegate; #define MCFG_CCPU_EXTERNAL_FUNC(_devcb) \ @@ -49,7 +49,7 @@ class ccpu_cpu_device : public cpu_device { public: // construction/destruction - ccpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ccpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_external_func(device_t &device, _Object object) { return downcast(device).m_external_input.set_callback(object); } @@ -64,9 +64,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -85,35 +85,35 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 3; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 3; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; address_space_config m_data_config; address_space_config m_io_config; - UINT16 m_PC; - UINT16 m_A; - UINT16 m_B; - UINT8 m_I; - UINT16 m_J; - UINT8 m_P; - UINT16 m_X; - UINT16 m_Y; - UINT16 m_T; - UINT16 * m_acc; - - UINT16 m_a0flag, m_ncflag, m_cmpacc, m_cmpval; - UINT16 m_miflag, m_nextmiflag, m_nextnextmiflag; - UINT16 m_drflag; + uint16_t m_PC; + uint16_t m_A; + uint16_t m_B; + uint8_t m_I; + uint16_t m_J; + uint8_t m_P; + uint16_t m_X; + uint16_t m_Y; + uint16_t m_T; + uint16_t * m_acc; + + uint16_t m_a0flag, m_ncflag, m_cmpacc, m_cmpval; + uint16_t m_miflag, m_nextmiflag, m_nextnextmiflag; + uint16_t m_drflag; devcb_read8 m_external_input; ccpu_vector_delegate m_vector_callback; - UINT8 m_waiting; - UINT8 m_watchdog; - UINT8 m_extinput; + uint8_t m_waiting; + uint8_t m_watchdog; + uint8_t m_extinput; int m_icount; @@ -122,7 +122,7 @@ protected: address_space *m_data; address_space *m_io; - UINT16 m_flags; + uint16_t m_flags; }; diff --git a/src/devices/cpu/ccpu/ccpudasm.cpp b/src/devices/cpu/ccpu/ccpudasm.cpp index e1f54d1ec00..9a02ee58d49 100644 --- a/src/devices/cpu/ccpu/ccpudasm.cpp +++ b/src/devices/cpu/ccpu/ccpudasm.cpp @@ -17,8 +17,8 @@ CPU_DISASSEMBLE( ccpu ) { unsigned startpc = pc; - UINT8 opcode = oprom[pc++ - startpc]; - UINT8 tempval; + uint8_t opcode = oprom[pc++ - startpc]; + uint8_t tempval; switch (opcode) { diff --git a/src/devices/cpu/cop400/cop400.cpp b/src/devices/cpu/cop400/cop400.cpp index 885f00d34cf..58a5c672a35 100644 --- a/src/devices/cpu/cop400/cop400.cpp +++ b/src/devices/cpu/cop400/cop400.cpp @@ -168,7 +168,7 @@ ADDRESS_MAP_END #endif -cop400_cpu_device::cop400_cpu_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, UINT8 program_addr_bits, UINT8 data_addr_bits, UINT8 featuremask, UINT8 g_mask, UINT8 d_mask, UINT8 in_mask, bool has_counter, bool has_inil, address_map_constructor internal_map_program, address_map_constructor internal_map_data) +cop400_cpu_device::cop400_cpu_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, uint8_t program_addr_bits, uint8_t data_addr_bits, uint8_t featuremask, uint8_t g_mask, uint8_t d_mask, uint8_t in_mask, bool has_counter, bool has_inil, address_map_constructor internal_map_program, address_map_constructor internal_map_data) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, program_addr_bits, 0, internal_map_program) , m_data_config("data", ENDIANNESS_LITTLE, 8, data_addr_bits, 0, internal_map_data) // data width is really 4 @@ -230,67 +230,67 @@ cop400_cpu_device::cop400_cpu_device(const machine_config &mconfig, device_type } } -cop401_cpu_device::cop401_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop401_cpu_device::cop401_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP401, "COP401", tag, owner, clock, "cop401", __FILE__, 9, 5, COP410_FEATURE, 0xf, 0xf, 0, false, false, nullptr, ADDRESS_MAP_NAME(data_32b)) { } -cop410_cpu_device::cop410_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop410_cpu_device::cop410_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP410, "COP410", tag, owner, clock, "cop410", __FILE__, 9, 5, COP410_FEATURE, 0xf, 0xf, 0, false, false, ADDRESS_MAP_NAME(program_512b), ADDRESS_MAP_NAME(data_32b)) { } -cop411_cpu_device::cop411_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop411_cpu_device::cop411_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP411, "COP411", tag, owner, clock, "cop411", __FILE__, 9, 5, COP410_FEATURE, 0x7, 0x3, 0, false, false, ADDRESS_MAP_NAME(program_512b), ADDRESS_MAP_NAME(data_32b)) { } -cop402_cpu_device::cop402_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop402_cpu_device::cop402_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP402, "COP402", tag, owner, clock, "cop402", __FILE__, 10, 6, COP420_FEATURE, 0xf, 0xf, 0xf, true, true, nullptr, ADDRESS_MAP_NAME(data_64b)) { } -cop420_cpu_device::cop420_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop420_cpu_device::cop420_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP420, "COP420", tag, owner, clock, "cop420", __FILE__, 10, 6, COP420_FEATURE, 0xf, 0xf, 0xf, true, true, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b)) { } -cop421_cpu_device::cop421_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop421_cpu_device::cop421_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP421, "COP421", tag, owner, clock, "cop421", __FILE__, 10, 6, COP420_FEATURE, 0xf, 0xf, 0, true, false, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b)) { } -cop422_cpu_device::cop422_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop422_cpu_device::cop422_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP422, "COP422", tag, owner, clock, "cop422", __FILE__, 10, 6, COP420_FEATURE, 0xe, 0xe, 0, true, false, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b)) { } -cop404_cpu_device::cop404_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop404_cpu_device::cop404_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP404, "COP404", tag, owner, clock, "cop404", __FILE__, 11, 7, COP444_FEATURE, 0xf, 0xf, 0xf, true, true, nullptr, ADDRESS_MAP_NAME(data_128b)) { } -cop424_cpu_device::cop424_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop424_cpu_device::cop424_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP424, "COP424", tag, owner, clock, "cop424", __FILE__, 10, 6, COP444_FEATURE, 0xf, 0xf, 0xf, true, true, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b)) { } -cop425_cpu_device::cop425_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop425_cpu_device::cop425_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP425, "COP425", tag, owner, clock, "cop425", __FILE__, 10, 6, COP444_FEATURE, 0xf, 0xf, 0, true, false, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b)) { } -cop426_cpu_device::cop426_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop426_cpu_device::cop426_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP426, "COP426", tag, owner, clock, "cop426", __FILE__, 10, 6, COP444_FEATURE, 0xe, 0xe, 0xf, true, true, ADDRESS_MAP_NAME(program_1kb), ADDRESS_MAP_NAME(data_64b)) { } -cop444_cpu_device::cop444_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop444_cpu_device::cop444_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP444, "COP444", tag, owner, clock, "cop444", __FILE__, 11, 7, COP444_FEATURE, 0xf, 0xf, 0xf, true, true, ADDRESS_MAP_NAME(program_2kb), ADDRESS_MAP_NAME(data_128b)) { } -cop445_cpu_device::cop445_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cop445_cpu_device::cop445_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cop400_cpu_device(mconfig, COP445, "COP445", tag, owner, clock, "cop445", __FILE__, 11, 7, COP444_FEATURE, 0x7, 0x3, 0, true, false, ADDRESS_MAP_NAME(program_2kb), ADDRESS_MAP_NAME(data_128b)) { } @@ -300,7 +300,7 @@ cop445_cpu_device::cop445_cpu_device(const machine_config &mconfig, const char * ***************************************************************************/ -void cop400_cpu_device::PUSH(UINT16 data) +void cop400_cpu_device::PUSH(uint16_t data) { if (m_featuremask != COP410_FEATURE) { @@ -322,7 +322,7 @@ void cop400_cpu_device::POP() } } -void cop400_cpu_device::WRITE_Q(UINT8 data) +void cop400_cpu_device::WRITE_Q(uint8_t data) { Q = data; @@ -332,7 +332,7 @@ void cop400_cpu_device::WRITE_Q(UINT8 data) } } -void cop400_cpu_device::WRITE_G(UINT8 data) +void cop400_cpu_device::WRITE_G(uint8_t data) { G = data; @@ -343,7 +343,7 @@ void cop400_cpu_device::WRITE_G(UINT8 data) OPCODE HANDLERS ***************************************************************************/ -#define INSTRUCTION(mnemonic) void (cop400_cpu_device::mnemonic)(UINT8 opcode) +#define INSTRUCTION(mnemonic) void (cop400_cpu_device::mnemonic)(uint8_t opcode) #define INST(mnemonic) &cop400_cpu_device::mnemonic INSTRUCTION(illegal) @@ -396,9 +396,9 @@ const cop400_cpu_device::cop400_opcode_map cop400_cpu_device::COP410_OPCODE_23_M {1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) } }; -void cop400_cpu_device::cop410_op23(UINT8 opcode) +void cop400_cpu_device::cop410_op23(uint8_t opcode) { - UINT8 opcode23 = ROM(PC++); + uint8_t opcode23 = ROM(PC++); (this->*COP410_OPCODE_23_MAP[opcode23].function)(opcode23); } @@ -442,9 +442,9 @@ const cop400_cpu_device::cop400_opcode_map cop400_cpu_device::COP410_OPCODE_33_M {1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) } }; -void cop400_cpu_device::cop410_op33(UINT8 opcode) +void cop400_cpu_device::cop410_op33(uint8_t opcode) { - UINT8 opcode33 = ROM(PC++); + uint8_t opcode33 = ROM(PC++); (this->*COP410_OPCODE_33_MAP[opcode33].function)(opcode33); } @@ -527,9 +527,9 @@ const cop400_cpu_device::cop400_opcode_map cop400_cpu_device::COP420_OPCODE_23_M {1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) } }; -void cop400_cpu_device::cop420_op23(UINT8 opcode) +void cop400_cpu_device::cop420_op23(uint8_t opcode) { - UINT8 opcode23 = ROM(PC++); + uint8_t opcode23 = ROM(PC++); (this->*COP420_OPCODE_23_MAP[opcode23].function)(opcode23); } @@ -573,9 +573,9 @@ const cop400_cpu_device::cop400_opcode_map cop400_cpu_device::COP420_OPCODE_33_M {1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) },{1, INST(illegal) } }; -void cop400_cpu_device::cop420_op33(UINT8 opcode) +void cop400_cpu_device::cop420_op33(uint8_t opcode) { - UINT8 opcode33 = ROM(PC++); + uint8_t opcode33 = ROM(PC++); (this->*COP420_OPCODE_33_MAP[opcode33].function)(opcode33); } @@ -658,9 +658,9 @@ const cop400_cpu_device::cop400_opcode_map cop400_cpu_device::COP444_OPCODE_23_M {1, INST(xad) },{1, INST(xad) },{1, INST(xad) },{1, INST(xad) },{1, INST(xad) },{1, INST(xad) },{1, INST(xad) },{1, INST(xad) }, }; -void cop400_cpu_device::cop444_op23(UINT8 opcode) +void cop400_cpu_device::cop444_op23(uint8_t opcode) { - UINT8 opcode23 = ROM(PC++); + uint8_t opcode23 = ROM(PC++); (this->*COP444_OPCODE_23_MAP[opcode23].function)(opcode23); } @@ -704,9 +704,9 @@ const cop400_cpu_device::cop400_opcode_map cop400_cpu_device::COP444_OPCODE_33_M {1, INST(lbi) },{1, INST(lbi) },{1, INST(lbi) },{1, INST(lbi) },{1, INST(lbi) },{1, INST(lbi) },{1, INST(lbi) },{1, INST(lbi) }, }; -void cop400_cpu_device::cop444_op33(UINT8 opcode) +void cop400_cpu_device::cop444_op33(uint8_t opcode) { - UINT8 opcode33 = ROM(PC++); + uint8_t opcode33 = ROM(PC++); (this->*COP444_OPCODE_33_MAP[opcode33].function)(opcode33); } @@ -845,7 +845,7 @@ void cop400_cpu_device::counter_tick() void cop400_cpu_device::inil_tick() { - UINT8 in; + uint8_t in; int i; in = IN_IN(); @@ -1072,7 +1072,7 @@ void cop400_cpu_device::execute_run() continue; } - UINT8 opcode = ROM(PC); + uint8_t opcode = ROM(PC); int inst_cycles = m_opcode_map[opcode].cycles; PC++; @@ -1171,7 +1171,7 @@ void cop400_cpu_device::state_string_export(const device_state_entry &entry, std } -offs_t cop400_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t cop400_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( cop410 ); extern CPU_DISASSEMBLE( cop420 ); diff --git a/src/devices/cpu/cop400/cop400.h b/src/devices/cpu/cop400/cop400.h index d5ccef3a4a4..6788d52c2a2 100644 --- a/src/devices/cpu/cop400/cop400.h +++ b/src/devices/cpu/cop400/cop400.h @@ -119,7 +119,7 @@ class cop400_cpu_device : public cpu_device { public: // construction/destruction - cop400_cpu_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, UINT8 program_addr_bits, UINT8 data_addr_bits, UINT8 featuremask, UINT8 g_mask, UINT8 d_mask, UINT8 in_mask, bool has_counter, bool has_inil, address_map_constructor internal_map_program, address_map_constructor internal_map_data); + cop400_cpu_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, uint8_t program_addr_bits, uint8_t data_addr_bits, uint8_t featuremask, uint8_t g_mask, uint8_t d_mask, uint8_t in_mask, bool has_counter, bool has_inil, address_map_constructor internal_map_program, address_map_constructor internal_map_data); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -148,11 +148,11 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + m_cki - 1) / m_cki; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * m_cki); } - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + m_cki - 1) / m_cki; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * m_cki); } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -167,9 +167,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; address_space_config m_data_config; @@ -197,36 +197,36 @@ protected: direct_read_data *m_direct; address_space *m_data; - UINT8 m_featuremask; + uint8_t m_featuremask; /* registers */ - UINT16 m_pc; /* 9/10/11-bit ROM address program counter */ - UINT16 m_prevpc; /* previous value of program counter */ - UINT8 m_a; /* 4-bit accumulator */ - UINT8 m_b; /* 5/6/7-bit RAM address register */ + uint16_t m_pc; /* 9/10/11-bit ROM address program counter */ + uint16_t m_prevpc; /* previous value of program counter */ + uint8_t m_a; /* 4-bit accumulator */ + uint8_t m_b; /* 5/6/7-bit RAM address register */ int m_c; /* 1-bit carry register */ - UINT8 m_n; /* 2-bit stack pointer (COP440 only) */ - UINT8 m_en; /* 4-bit enable register */ - UINT8 m_g; /* 4-bit general purpose I/O port */ - UINT8 m_q; /* 8-bit latch for L port */ - UINT16 m_sa, m_sb, m_sc; /* subroutine save registers (not present in COP440) */ - UINT8 m_sio; /* 4-bit shift register and counter */ + uint8_t m_n; /* 2-bit stack pointer (COP440 only) */ + uint8_t m_en; /* 4-bit enable register */ + uint8_t m_g; /* 4-bit general purpose I/O port */ + uint8_t m_q; /* 8-bit latch for L port */ + uint16_t m_sa, m_sb, m_sc; /* subroutine save registers (not present in COP440) */ + uint8_t m_sio; /* 4-bit shift register and counter */ int m_skl; /* 1-bit latch for SK output */ - UINT8 m_h; /* 4-bit general purpose I/O port (COP440 only) */ - UINT8 m_r; /* 8-bit general purpose I/O port (COP440 only) */ - UINT8 m_flags; // used for I/O only + uint8_t m_h; /* 4-bit general purpose I/O port (COP440 only) */ + uint8_t m_r; /* 8-bit general purpose I/O port (COP440 only) */ + uint8_t m_flags; // used for I/O only /* counter */ - UINT8 m_t; /* 8-bit timer */ + uint8_t m_t; /* 8-bit timer */ int m_skt_latch; /* timer overflow latch */ /* input/output ports */ - UINT8 m_g_mask; /* G port mask */ - UINT8 m_d_mask; /* D port mask */ - UINT8 m_in_mask; /* IN port mask */ - UINT8 m_il; /* IN latch */ - UINT8 m_in[4]; /* IN port shift register */ - UINT8 m_si; /* serial input */ + uint8_t m_g_mask; /* G port mask */ + uint8_t m_d_mask; /* D port mask */ + uint8_t m_in_mask; /* IN port mask */ + uint8_t m_il; /* IN latch */ + uint8_t m_in[4]; /* IN port shift register */ + uint8_t m_si; /* serial input */ /* skipping logic */ int m_skip; /* skip next instruction */ @@ -244,11 +244,11 @@ protected: emu_timer *m_counter_timer; emu_timer *m_inil_timer; - typedef void ( cop400_cpu_device::*cop400_opcode_func ) (UINT8 opcode); + typedef void ( cop400_cpu_device::*cop400_opcode_func ) (uint8_t opcode); /* The opcode table now is a combination of cycle counts and function pointers */ struct cop400_opcode_map { - UINT32 cycles; + uint32_t cycles; cop400_opcode_func function; }; @@ -268,85 +268,85 @@ protected: void counter_tick(); void inil_tick(); - void PUSH(UINT16 data); + void PUSH(uint16_t data); void POP(); - void WRITE_Q(UINT8 data); - void WRITE_G(UINT8 data); - - void illegal(UINT8 opcode); - void asc(UINT8 opcode); - void add(UINT8 opcode); - void aisc(UINT8 opcode); - void clra(UINT8 opcode); - void comp(UINT8 opcode); - void nop(UINT8 opcode); - void rc(UINT8 opcode); - void sc(UINT8 opcode); - void xor_(UINT8 opcode); - void adt(UINT8 opcode); - void casc(UINT8 opcode); - void jid(UINT8 opcode); - void jmp(UINT8 opcode); - void jp(UINT8 opcode); - void jsr(UINT8 opcode); - void ret(UINT8 opcode); - void cop420_ret(UINT8 opcode); - void retsk(UINT8 opcode); - void halt(UINT8 opcode); - void it(UINT8 opcode); - void camq(UINT8 opcode); - void ld(UINT8 opcode); - void lqid(UINT8 opcode); - void rmb0(UINT8 opcode); - void rmb1(UINT8 opcode); - void rmb2(UINT8 opcode); - void rmb3(UINT8 opcode); - void smb0(UINT8 opcode); - void smb1(UINT8 opcode); - void smb2(UINT8 opcode); - void smb3(UINT8 opcode); - void stii(UINT8 opcode); - void x(UINT8 opcode); - void xad(UINT8 opcode); - void xds(UINT8 opcode); - void xis(UINT8 opcode); - void cqma(UINT8 opcode); - void ldd(UINT8 opcode); - void camt(UINT8 opcode); - void ctma(UINT8 opcode); - void cab(UINT8 opcode); - void cba(UINT8 opcode); - void lbi(UINT8 opcode); - void lei(UINT8 opcode); - void xabr(UINT8 opcode); - void cop444_xabr(UINT8 opcode); - void skc(UINT8 opcode); - void ske(UINT8 opcode); - void skgz(UINT8 opcode); - void skgbz0(UINT8 opcode); - void skgbz1(UINT8 opcode); - void skgbz2(UINT8 opcode); - void skgbz3(UINT8 opcode); - void skmbz0(UINT8 opcode); - void skmbz1(UINT8 opcode); - void skmbz2(UINT8 opcode); - void skmbz3(UINT8 opcode); - void skt(UINT8 opcode); - void ing(UINT8 opcode); - void inl(UINT8 opcode); - void obd(UINT8 opcode); - void omg(UINT8 opcode); - void xas(UINT8 opcode); - void inin(UINT8 opcode); - void cop402m_inin(UINT8 opcode); - void inil(UINT8 opcode); - void ogi(UINT8 opcode); - void cop410_op23(UINT8 opcode); - void cop410_op33(UINT8 opcode); - void cop420_op23(UINT8 opcode); - void cop420_op33(UINT8 opcode); - void cop444_op23(UINT8 opcode); - void cop444_op33(UINT8 opcode); + void WRITE_Q(uint8_t data); + void WRITE_G(uint8_t data); + + void illegal(uint8_t opcode); + void asc(uint8_t opcode); + void add(uint8_t opcode); + void aisc(uint8_t opcode); + void clra(uint8_t opcode); + void comp(uint8_t opcode); + void nop(uint8_t opcode); + void rc(uint8_t opcode); + void sc(uint8_t opcode); + void xor_(uint8_t opcode); + void adt(uint8_t opcode); + void casc(uint8_t opcode); + void jid(uint8_t opcode); + void jmp(uint8_t opcode); + void jp(uint8_t opcode); + void jsr(uint8_t opcode); + void ret(uint8_t opcode); + void cop420_ret(uint8_t opcode); + void retsk(uint8_t opcode); + void halt(uint8_t opcode); + void it(uint8_t opcode); + void camq(uint8_t opcode); + void ld(uint8_t opcode); + void lqid(uint8_t opcode); + void rmb0(uint8_t opcode); + void rmb1(uint8_t opcode); + void rmb2(uint8_t opcode); + void rmb3(uint8_t opcode); + void smb0(uint8_t opcode); + void smb1(uint8_t opcode); + void smb2(uint8_t opcode); + void smb3(uint8_t opcode); + void stii(uint8_t opcode); + void x(uint8_t opcode); + void xad(uint8_t opcode); + void xds(uint8_t opcode); + void xis(uint8_t opcode); + void cqma(uint8_t opcode); + void ldd(uint8_t opcode); + void camt(uint8_t opcode); + void ctma(uint8_t opcode); + void cab(uint8_t opcode); + void cba(uint8_t opcode); + void lbi(uint8_t opcode); + void lei(uint8_t opcode); + void xabr(uint8_t opcode); + void cop444_xabr(uint8_t opcode); + void skc(uint8_t opcode); + void ske(uint8_t opcode); + void skgz(uint8_t opcode); + void skgbz0(uint8_t opcode); + void skgbz1(uint8_t opcode); + void skgbz2(uint8_t opcode); + void skgbz3(uint8_t opcode); + void skmbz0(uint8_t opcode); + void skmbz1(uint8_t opcode); + void skmbz2(uint8_t opcode); + void skmbz3(uint8_t opcode); + void skt(uint8_t opcode); + void ing(uint8_t opcode); + void inl(uint8_t opcode); + void obd(uint8_t opcode); + void omg(uint8_t opcode); + void xas(uint8_t opcode); + void inin(uint8_t opcode); + void cop402m_inin(uint8_t opcode); + void inil(uint8_t opcode); + void ogi(uint8_t opcode); + void cop410_op23(uint8_t opcode); + void cop410_op33(uint8_t opcode); + void cop420_op23(uint8_t opcode); + void cop420_op33(uint8_t opcode); + void cop444_op23(uint8_t opcode); + void cop444_op33(uint8_t opcode); void skgbz(int bit); void skmbz(int bit); @@ -359,7 +359,7 @@ class cop401_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop401_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop401_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -367,7 +367,7 @@ class cop410_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop410_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop410_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -376,7 +376,7 @@ class cop411_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop411_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop411_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -386,7 +386,7 @@ class cop402_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop402_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop402_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -394,7 +394,7 @@ class cop420_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop420_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop420_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -403,7 +403,7 @@ class cop421_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop421_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop421_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -412,7 +412,7 @@ class cop422_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop422_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop422_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -422,7 +422,7 @@ class cop404_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop404_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop404_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -431,7 +431,7 @@ class cop424_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop424_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop424_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -440,7 +440,7 @@ class cop425_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop425_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop425_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -449,7 +449,7 @@ class cop426_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop426_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop426_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -457,7 +457,7 @@ class cop444_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop444_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop444_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -466,7 +466,7 @@ class cop445_cpu_device : public cop400_cpu_device { public: // construction/destruction - cop445_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cop445_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/cop400/cop400op.hxx b/src/devices/cpu/cop400/cop400op.hxx index 1f1bf1bfade..1c1d5f6f86d 100644 --- a/src/devices/cpu/cop400/cop400op.hxx +++ b/src/devices/cpu/cop400/cop400op.hxx @@ -80,7 +80,7 @@ INSTRUCTION( add ) INSTRUCTION( aisc ) { - UINT8 y = opcode & 0x0f; + uint8_t y = opcode & 0x0f; A = A + y; @@ -266,7 +266,7 @@ INSTRUCTION( casc ) INSTRUCTION( jid ) { - UINT16 addr = (PC & 0x700) | (A << 4) | RAM_R(B); + uint16_t addr = (PC & 0x700) | (A << 4) | RAM_R(B); PC = (PC & 0x700) | ROM(addr); } @@ -286,7 +286,7 @@ INSTRUCTION( jid ) INSTRUCTION( jmp ) { - UINT16 a = ((opcode & 0x07) << 8) | ROM(PC); + uint16_t a = ((opcode & 0x07) << 8) | ROM(PC); PC = a; } @@ -313,22 +313,22 @@ INSTRUCTION( jmp ) INSTRUCTION( jp ) { - UINT8 page = PC >> 6; + uint8_t page = PC >> 6; if (page == 2 || page == 3) { - UINT8 a = opcode & 0x7f; + uint8_t a = opcode & 0x7f; PC = (PC & 0x780) | a; } else if ((opcode & 0xc0) == 0xc0) { - UINT8 a = opcode & 0x3f; + uint8_t a = opcode & 0x3f; PC = (PC & 0x7c0) | a; } else { // JSRP - UINT8 a = opcode & 0x3f; + uint8_t a = opcode & 0x3f; PUSH(PC); PC = 0x80 | a; } @@ -351,7 +351,7 @@ INSTRUCTION( jp ) INSTRUCTION( jsr ) { - UINT16 a = ((opcode & 0x07) << 8) | ROM(PC); + uint16_t a = ((opcode & 0x07) << 8) | ROM(PC); PUSH(PC + 1); PC = a; @@ -503,7 +503,7 @@ INSTRUCTION( camq ) */ - UINT8 data = (A << 4) | RAM_R(B); + uint8_t data = (A << 4) | RAM_R(B); WRITE_Q(data); @@ -530,7 +530,7 @@ INSTRUCTION( camq ) INSTRUCTION( ld ) { - UINT8 r = opcode & 0x30; + uint8_t r = opcode & 0x30; A = RAM_R(B); B = B ^ r; @@ -641,8 +641,8 @@ INSTRUCTION( smb3 ) { RAM_W(B, RAM_R(B) | 0x8); } INSTRUCTION( stii ) { - UINT8 y = opcode & 0x0f; - UINT16 Bd; + uint8_t y = opcode & 0x0f; + uint16_t Bd; RAM_W(B, y); @@ -667,8 +667,8 @@ INSTRUCTION( stii ) INSTRUCTION( x ) { - UINT8 r = opcode & 0x30; - UINT8 t = RAM_R(B); + uint8_t r = opcode & 0x30; + uint8_t t = RAM_R(B); RAM_W(B, A); @@ -692,8 +692,8 @@ INSTRUCTION( x ) INSTRUCTION( xad ) { - UINT8 rd = opcode & 0x7f; - UINT8 t = A; + uint8_t rd = opcode & 0x7f; + uint8_t t = A; A = RAM_R(rd); @@ -720,8 +720,8 @@ INSTRUCTION( xad ) INSTRUCTION( xds ) { - UINT8 t, Bd; - UINT8 r = opcode & 0x30; + uint8_t t, Bd; + uint8_t r = opcode & 0x30; t = RAM_R(B); RAM_W(B, A); @@ -755,8 +755,8 @@ INSTRUCTION( xds ) INSTRUCTION( xis ) { - UINT8 t, Bd; - UINT8 r = opcode & 0x30; + uint8_t t, Bd; + uint8_t r = opcode & 0x30; t = RAM_R(B); RAM_W(B, A); @@ -806,7 +806,7 @@ INSTRUCTION( cqma ) INSTRUCTION( ldd ) { - UINT8 rd = opcode & 0x7f; + uint8_t rd = opcode & 0x7f; A = RAM_R(rd); } @@ -940,7 +940,7 @@ INSTRUCTION( lbi ) INSTRUCTION( lei ) { - UINT8 y = opcode & 0x0f; + uint8_t y = opcode & 0x0f; EN = y; @@ -965,8 +965,8 @@ INSTRUCTION( lei ) INSTRUCTION( xabr ) { - UINT8 Br = A & 0x03; - UINT8 Bd = B & 0x0f; + uint8_t Br = A & 0x03; + uint8_t Bd = B & 0x0f; A = B >> 4; B = (Br << 4) + Bd; @@ -989,8 +989,8 @@ INSTRUCTION( xabr ) INSTRUCTION( cop444_xabr ) { - UINT8 Br = A & 0x07; - UINT8 Bd = B & 0x0f; + uint8_t Br = A & 0x07; + uint8_t Bd = B & 0x0f; A = B >> 4; B = (Br << 4) + Bd; @@ -1174,7 +1174,7 @@ INSTRUCTION( ing ) INSTRUCTION( inl ) { - UINT8 L = IN_L(); + uint8_t L = IN_L(); RAM_W(B, L >> 4); A = L & 0xF; @@ -1232,7 +1232,7 @@ INSTRUCTION( omg ) INSTRUCTION( xas ) { - UINT8 t = SIO; + uint8_t t = SIO; SIO = A; A = t; @@ -1313,7 +1313,7 @@ INSTRUCTION( inil ) INSTRUCTION( ogi ) { - UINT8 y = opcode & 0x0f; + uint8_t y = opcode & 0x0f; WRITE_G(y); } diff --git a/src/devices/cpu/cop400/cop410ds.cpp b/src/devices/cpu/cop400/cop410ds.cpp index 638653151d0..fa8f675506e 100644 --- a/src/devices/cpu/cop400/cop410ds.cpp +++ b/src/devices/cpu/cop400/cop410ds.cpp @@ -12,29 +12,29 @@ CPU_DISASSEMBLE( cop410 ) { - UINT8 opcode = oprom[0]; - UINT8 next_opcode = oprom[1]; - UINT16 address; - UINT32 flags = 0; + uint8_t opcode = oprom[0]; + uint8_t next_opcode = oprom[1]; + uint16_t address; + uint32_t flags = 0; int bytes = 1; if ((opcode >= 0x80 && opcode <= 0xBE) || (opcode >= 0xC0 && opcode <= 0xFE)) { if ((pc & 0x3E0) >= 0x80 && (pc & 0x3E0) < 0x100) //JP pages 2,3 { - address = (UINT16)((pc & 0x380) | (opcode & 0x7F)); + address = (uint16_t)((pc & 0x380) | (opcode & 0x7F)); sprintf(buffer, "JP %x", address); } else { if ((opcode & 0xC0) == 0xC0) //JP other pages { - address = (UINT16)((pc & 0x3C0) | (opcode & 0x3F)); + address = (uint16_t)((pc & 0x3C0) | (opcode & 0x3F)); sprintf(buffer, "JP %x", address); } else //JSRP { - address = (UINT16)(0x80 | (opcode & 0x3F)); + address = (uint16_t)(0x80 | (opcode & 0x3F)); sprintf(buffer, "JSRP %x", address); flags = DASMFLAG_STEP_OVER; } @@ -154,7 +154,7 @@ CPU_DISASSEMBLE( cop410 ) if (next_opcode >= 0x80 && next_opcode <= 0xbf) { - address = (UINT16)(next_opcode & 0x3F); + address = (uint16_t)(next_opcode & 0x3F); sprintf(buffer, "XAD %x,%x", ((address & 0x30) >> 4),address & 0x0F); } else diff --git a/src/devices/cpu/cop400/cop420ds.cpp b/src/devices/cpu/cop400/cop420ds.cpp index 007b9afc8c6..e1e90eb7130 100644 --- a/src/devices/cpu/cop400/cop420ds.cpp +++ b/src/devices/cpu/cop400/cop420ds.cpp @@ -12,29 +12,29 @@ CPU_DISASSEMBLE( cop420 ) { - UINT8 opcode = oprom[0]; - UINT8 next_opcode = oprom[1]; - UINT16 address; - UINT32 flags = 0; + uint8_t opcode = oprom[0]; + uint8_t next_opcode = oprom[1]; + uint16_t address; + uint32_t flags = 0; int bytes = 1; if ((opcode >= 0x80 && opcode <= 0xBE) || (opcode >= 0xC0 && opcode <= 0xFE)) { if ((pc & 0x3E0) >= 0x80 && (pc & 0x3E0) < 0x100) //JP pages 2,3 { - address = (UINT16)((pc & 0x380) | (opcode & 0x7F)); + address = (uint16_t)((pc & 0x380) | (opcode & 0x7F)); sprintf(buffer, "JP %x", address); } else { if ((opcode & 0xC0) == 0xC0) //JP other pages { - address = (UINT16)((pc & 0x3C0) | (opcode & 0x3F)); + address = (uint16_t)((pc & 0x3C0) | (opcode & 0x3F)); sprintf(buffer, "JP %x", address); } else //JSRP { - address = (UINT16)(0x80 | (opcode & 0x3F)); + address = (uint16_t)(0x80 | (opcode & 0x3F)); sprintf(buffer, "JSRP %x", address); flags = DASMFLAG_STEP_OVER; } @@ -162,12 +162,12 @@ CPU_DISASSEMBLE( cop420 ) if (next_opcode <= 0x3f) { - address = (UINT16)(next_opcode & 0x3F); + address = (uint16_t)(next_opcode & 0x3F); sprintf(buffer, "LDD %x,%x", ((address & 0x30) >> 4),address & 0x0F); } else if (next_opcode >= 0x80 && next_opcode <= 0xbf) { - address = (UINT16)(next_opcode & 0x3F); + address = (uint16_t)(next_opcode & 0x3F); sprintf(buffer, "XAD %x,%x", ((address & 0x30) >> 4),address & 0x0F); } else diff --git a/src/devices/cpu/cop400/cop440ds.cpp b/src/devices/cpu/cop400/cop440ds.cpp index 4af02d3c481..460cf0a4e5b 100644 --- a/src/devices/cpu/cop400/cop440ds.cpp +++ b/src/devices/cpu/cop400/cop440ds.cpp @@ -12,29 +12,29 @@ CPU_DISASSEMBLE( cop444 ) { - UINT8 opcode = oprom[0]; - UINT8 next_opcode = oprom[1]; - UINT16 address; - UINT32 flags = 0; + uint8_t opcode = oprom[0]; + uint8_t next_opcode = oprom[1]; + uint16_t address; + uint32_t flags = 0; int bytes = 1; if ((opcode >= 0x80 && opcode <= 0xBE) || (opcode >= 0xC0 && opcode <= 0xFE)) { if ((pc & 0x3E0) >= 0x80 && (pc & 0x3E0) < 0x100) //JP pages 2,3 { - address = (UINT16)((pc & 0x380) | (opcode & 0x7F)); + address = (uint16_t)((pc & 0x380) | (opcode & 0x7F)); sprintf(buffer, "JP %x", address); } else { if ((opcode & 0xC0) == 0xC0) //JP other pages { - address = (UINT16)((pc & 0x3C0) | (opcode & 0x3F)); + address = (uint16_t)((pc & 0x3C0) | (opcode & 0x3F)); sprintf(buffer, "JP %x", address); } else //JSRP { - address = (UINT16)(0x80 | (opcode & 0x3F)); + address = (uint16_t)(0x80 | (opcode & 0x3F)); sprintf(buffer, "JSRP %x", address); flags = DASMFLAG_STEP_OVER; } @@ -162,12 +162,12 @@ CPU_DISASSEMBLE( cop444 ) if (next_opcode <= 0x3f) { - address = (UINT16)(next_opcode & 0x3F); + address = (uint16_t)(next_opcode & 0x3F); sprintf(buffer, "LDD %x,%x", ((address & 0x30) >> 4),address & 0x0F); } else if (next_opcode >= 0x80 && next_opcode <= 0xbf) { - address = (UINT16)(next_opcode & 0x3F); + address = (uint16_t)(next_opcode & 0x3F); sprintf(buffer, "XAD %x,%x", ((address & 0x30) >> 4),address & 0x0F); } else diff --git a/src/devices/cpu/cosmac/cosdasm.cpp b/src/devices/cpu/cosmac/cosdasm.cpp index f8f41e2c4ce..ce93110e021 100644 --- a/src/devices/cpu/cosmac/cosdasm.cpp +++ b/src/devices/cpu/cosmac/cosdasm.cpp @@ -23,22 +23,22 @@ enum #define CDP1802_OPCODE(...) \ if (variant < TYPE_1802) sprintf(buffer, "illegal"); else sprintf(buffer, __VA_ARGS__) -static offs_t implied(const UINT8 opcode) +static offs_t implied(const uint8_t opcode) { return opcode & 0x0f; } -static offs_t immediate(const UINT8 **opram) +static offs_t immediate(const uint8_t **opram) { return *(*opram)++; } -static offs_t short_branch(offs_t pc, const UINT8 **opram) +static offs_t short_branch(offs_t pc, const uint8_t **opram) { return (pc & 0xff00) | immediate(opram); } -static offs_t long_branch(const UINT8 **opram) +static offs_t long_branch(const uint8_t **opram) { return (immediate(opram) << 8) | immediate(opram); } @@ -53,13 +53,13 @@ static offs_t long_skip(offs_t pc) return pc + 3; } -static UINT32 disassemble(device_t *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 variant) +static uint32_t disassemble(device_t *device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t variant) { - const UINT8 *startram = opram; - UINT32 flags = 0; + const uint8_t *startram = opram; + uint32_t flags = 0; opram++; - UINT8 opcode = *oprom++; + uint8_t opcode = *oprom++; switch (opcode) { diff --git a/src/devices/cpu/cosmac/cosmac.cpp b/src/devices/cpu/cosmac/cosmac.cpp index f46f6de4dfc..a05d9cd1825 100644 --- a/src/devices/cpu/cosmac/cosmac.cpp +++ b/src/devices/cpu/cosmac/cosmac.cpp @@ -160,7 +160,7 @@ const cosmac_device::ophandler cdp1801_device::s_opcodetable[256] = &cdp1801_device::adi, &cdp1801_device::sdi, &cdp1801_device::und, &cdp1801_device::smi }; -cosmac_device::ophandler cdp1801_device::get_ophandler(UINT8 opcode) +cosmac_device::ophandler cdp1801_device::get_ophandler(uint8_t opcode) { return s_opcodetable[opcode]; } @@ -248,7 +248,7 @@ const cosmac_device::ophandler cdp1802_device::s_opcodetable[256] = &cdp1802_device::adi, &cdp1802_device::sdi, &cdp1802_device::shl, &cdp1802_device::smi }; -cosmac_device::ophandler cdp1802_device::get_ophandler(UINT8 opcode) +cosmac_device::ophandler cdp1802_device::get_ophandler(uint8_t opcode) { return s_opcodetable[opcode]; } @@ -268,7 +268,7 @@ const device_type CDP1802 = &device_creator; // cosmac_device - constructor //------------------------------------------------- -cosmac_device::cosmac_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) +cosmac_device::cosmac_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_LITTLE, 8, 16), m_io_config("io", ENDIANNESS_LITTLE, 8, 3), @@ -301,7 +301,7 @@ cosmac_device::cosmac_device(const machine_config &mconfig, device_type type, co // cdp1801_device - constructor //------------------------------------------------- -cdp1801_device::cdp1801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdp1801_device::cdp1801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cosmac_device(mconfig, CDP1801, "CDP1801", tag, owner, clock, "cdp1801", __FILE__) { } @@ -311,7 +311,7 @@ cdp1801_device::cdp1801_device(const machine_config &mconfig, const char *tag, d // cdp1802_device - constructor //------------------------------------------------- -cdp1802_device::cdp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdp1802_device::cdp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cosmac_device(mconfig, CDP1802, "CDP1802", tag, owner, clock, "cdp1802", __FILE__) { } @@ -490,7 +490,7 @@ void cosmac_device::state_string_export(const device_state_entry &entry, std::st // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 cosmac_device::disasm_min_opcode_bytes() const +uint32_t cosmac_device::disasm_min_opcode_bytes() const { return 1; } @@ -501,7 +501,7 @@ UINT32 cosmac_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 cosmac_device::disasm_max_opcode_bytes() const +uint32_t cosmac_device::disasm_max_opcode_bytes() const { return 3; } @@ -512,13 +512,13 @@ UINT32 cosmac_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t cdp1801_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t cdp1801_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( cdp1801 ); return CPU_DISASSEMBLE_NAME( cdp1801 )(this, buffer, pc, oprom, opram, options); } -offs_t cdp1802_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t cdp1802_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( cdp1802 ); return CPU_DISASSEMBLE_NAME( cdp1802 )(this, buffer, pc, oprom, opram, options); @@ -533,7 +533,7 @@ offs_t cdp1802_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 * // read_opcode - read an opcode at the given address //------------------------------------------------- -inline UINT8 cosmac_device::read_opcode(offs_t pc) +inline uint8_t cosmac_device::read_opcode(offs_t pc) { return m_direct->read_byte(pc); } @@ -543,7 +543,7 @@ inline UINT8 cosmac_device::read_opcode(offs_t pc) // read_byte - read a byte at the given address //------------------------------------------------- -inline UINT8 cosmac_device::read_byte(offs_t address) +inline uint8_t cosmac_device::read_byte(offs_t address) { return m_program->read_byte(address); } @@ -554,7 +554,7 @@ inline UINT8 cosmac_device::read_byte(offs_t address) // address //------------------------------------------------- -inline UINT8 cosmac_device::read_io_byte(offs_t address) +inline uint8_t cosmac_device::read_io_byte(offs_t address) { return m_io->read_byte(address); } @@ -564,7 +564,7 @@ inline UINT8 cosmac_device::read_io_byte(offs_t address) // write_byte - write a byte at the given address //------------------------------------------------- -inline void cosmac_device::write_byte(offs_t address, UINT8 data) +inline void cosmac_device::write_byte(offs_t address, uint8_t data) { m_program->write_byte(address, data); } @@ -575,7 +575,7 @@ inline void cosmac_device::write_byte(offs_t address, UINT8 data) // address //------------------------------------------------- -inline void cosmac_device::write_io_byte(offs_t address, UINT8 data) +inline void cosmac_device::write_io_byte(offs_t address, uint8_t data) { m_io->write_byte(address, data); } @@ -601,7 +601,7 @@ offs_t cosmac_device::get_memory_address() // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 cosmac_device::execute_min_cycles() const +uint32_t cosmac_device::execute_min_cycles() const { return 8 * 2; } @@ -612,7 +612,7 @@ UINT32 cosmac_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 cosmac_device::execute_max_cycles() const +uint32_t cosmac_device::execute_max_cycles() const { return 8 * 3; } @@ -623,7 +623,7 @@ UINT32 cosmac_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 cosmac_device::execute_input_lines() const +uint32_t cosmac_device::execute_input_lines() const { return 7; } @@ -1215,7 +1215,7 @@ void cosmac_device::mark() void cosmac_device::return_from_interrupt(int ie) { - UINT8 data = RAM_R(R[X]); + uint8_t data = RAM_R(R[X]); R[X]++; P = data & 0xf; X = data >> 4; diff --git a/src/devices/cpu/cosmac/cosmac.h b/src/devices/cpu/cosmac/cosmac.h index 31b1d8dc11c..7e4728f918b 100644 --- a/src/devices/cpu/cosmac/cosmac.h +++ b/src/devices/cpu/cosmac/cosmac.h @@ -190,7 +190,7 @@ class cosmac_device : public cpu_device { public: // construction/destruction - cosmac_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); + cosmac_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_wait_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_wait.set_callback(object); } template static devcb_base &set_clear_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_clear.set_callback(object); } @@ -220,9 +220,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -235,15 +235,15 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; // helpers - inline UINT8 read_opcode(offs_t pc); - inline UINT8 read_byte(offs_t address); - inline UINT8 read_io_byte(offs_t address); - inline void write_byte(offs_t address, UINT8 data); - inline void write_io_byte(offs_t address, UINT8 data); + inline uint8_t read_opcode(offs_t pc); + inline uint8_t read_byte(offs_t address); + inline uint8_t read_io_byte(offs_t address); + inline void write_byte(offs_t address, uint8_t data); + inline void write_io_byte(offs_t address, uint8_t data); // execution logic inline void run(); @@ -403,9 +403,9 @@ protected: }; // internal state - UINT16 m_pc; // fake program counter - UINT8 m_op; // current opcode - UINT8 m_flagsio; // flags storage for state saving + uint16_t m_pc; // fake program counter + uint8_t m_op; // current opcode + uint8_t m_flagsio; // flags storage for state saving cosmac_state m_state; // state cosmac_mode m_mode; // control mode cosmac_mode m_pmode; // previous control mode @@ -415,14 +415,14 @@ protected: int m_ef[4]; // external flags // registers - UINT8 m_d; // data register (accumulator) - UINT8 m_b; // auxiliary holding register - UINT16 m_r[16]; // scratchpad registers - UINT8 m_p; // designates which register is Program Counter - UINT8 m_x; // designates which register is Data Pointer - UINT8 m_n; // low-order instruction digit - UINT8 m_i; // high-order instruction digit - UINT8 m_t; // temporary register + uint8_t m_d; // data register (accumulator) + uint8_t m_b; // auxiliary holding register + uint16_t m_r[16]; // scratchpad registers + uint8_t m_p; // designates which register is Program Counter + uint8_t m_x; // designates which register is Data Pointer + uint8_t m_n; // low-order instruction digit + uint8_t m_i; // high-order instruction digit + uint8_t m_t; // temporary register // flags int m_df; // data flag (ALU carry) @@ -437,7 +437,7 @@ protected: // opcode/condition tables typedef void (cosmac_device::*ophandler)(); - virtual cosmac_device::ophandler get_ophandler(UINT8 opcode) = 0; + virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) = 0; }; @@ -447,13 +447,13 @@ class cdp1801_device : public cosmac_device { public: // construction/destruction - cdp1801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdp1801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device_disasm_interface overrides - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual cosmac_device::ophandler get_ophandler(UINT8 opcode) override; + virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) override; static const ophandler s_opcodetable[256]; }; @@ -465,13 +465,13 @@ class cdp1802_device : public cosmac_device { public: // construction/destruction - cdp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device_disasm_interface overrides - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual cosmac_device::ophandler get_ophandler(UINT8 opcode) override; + virtual cosmac_device::ophandler get_ophandler(uint8_t opcode) override; static const ophandler s_opcodetable[256]; }; diff --git a/src/devices/cpu/cp1610/1610dasm.cpp b/src/devices/cpu/cp1610/1610dasm.cpp index 83b2ef018e0..964b1a5e612 100644 --- a/src/devices/cpu/cp1610/1610dasm.cpp +++ b/src/devices/cpu/cp1610/1610dasm.cpp @@ -6,9 +6,9 @@ CPU_DISASSEMBLE( cp1610 ) { - UINT16 oprom16[4]={ static_cast((oprom[0] << 8) | oprom[1]), static_cast((oprom[2] << 8) | oprom[3]), static_cast((oprom[4] << 8) | oprom[5]), static_cast((oprom[6] << 8) | oprom[7]) }; - UINT16 op = oprom16[0]; UINT16 subop; - UINT16 ea, ea1, ea2; + uint16_t oprom16[4]={ static_cast((oprom[0] << 8) | oprom[1]), static_cast((oprom[2] << 8) | oprom[3]), static_cast((oprom[4] << 8) | oprom[5]), static_cast((oprom[6] << 8) | oprom[7]) }; + uint16_t op = oprom16[0]; uint16_t subop; + uint16_t ea, ea1, ea2; unsigned size = 1; // const char *sym, *sym2; diff --git a/src/devices/cpu/cp1610/cp1610.cpp b/src/devices/cpu/cp1610/cp1610.cpp index fa3ef8a1d4b..9c2ed837b3b 100644 --- a/src/devices/cpu/cp1610/cp1610.cpp +++ b/src/devices/cpu/cp1610/cp1610.cpp @@ -196,7 +196,7 @@ void cp1610_cpu_device::cp1610_comr(int n) ***************************************************/ void cp1610_cpu_device::cp1610_negr(int n) { - UINT32 temp; + uint32_t temp; CLR_SZOC; temp = (m_r[n] ^ 0xffff) + 1; SET_COV(0,temp,1); @@ -211,7 +211,7 @@ void cp1610_cpu_device::cp1610_negr(int n) ***************************************************/ void cp1610_cpu_device::cp1610_adcr(int n) { - UINT16 offset = 0; + uint16_t offset = 0; if (m_flags & C) offset = 1; CLR_SZOC; @@ -266,7 +266,7 @@ void cp1610_cpu_device::cp1610_rswd(int n) ***************************************************/ void cp1610_cpu_device::cp1610_swap(int r) { - UINT8 temp; + uint8_t temp; m_mask_interrupts = 1; CLR_SZ; temp = m_r[r] >> 8; @@ -286,7 +286,7 @@ void cp1610_cpu_device::cp1610_swap(int r) void cp1610_cpu_device::cp1610_dswap(int r) { /* This instruction was not officially supported by GI */ - UINT16 temp; + uint16_t temp; m_mask_interrupts = 1; CLR_SZ; temp = m_r[r] & 0xff; @@ -331,7 +331,7 @@ void cp1610_cpu_device::cp1610_sll_2(int r) ***************************************************/ void cp1610_cpu_device::cp1610_rlc_1(int r) { - UINT16 offset = 0; + uint16_t offset = 0; m_mask_interrupts = 1; if (m_flags & C) offset = 1; @@ -349,7 +349,7 @@ void cp1610_cpu_device::cp1610_rlc_1(int r) ***************************************************/ void cp1610_cpu_device::cp1610_rlc_2(int r) { - UINT16 offset = 0; + uint16_t offset = 0; m_mask_interrupts = 1; switch(m_flags & (C | OV)) { @@ -452,7 +452,7 @@ void cp1610_cpu_device::cp1610_sar_1(int r) { m_mask_interrupts = 1; CLR_SZ; - m_r[r] = (UINT16)(((INT16)(m_r[r])) >> 1); + m_r[r] = (uint16_t)(((int16_t)(m_r[r])) >> 1); SET_SZ(m_r[r]); /* S flag is set on bit 7 not bit 15 */ m_flags &= ~S; @@ -469,7 +469,7 @@ void cp1610_cpu_device::cp1610_sar_2(int r) { m_mask_interrupts = 1; CLR_SZ; - m_r[r] = (UINT16)(((INT16)(m_r[r])) >> 2); + m_r[r] = (uint16_t)(((int16_t)(m_r[r])) >> 2); SET_SZ(m_r[r]); /* S flag is set on bit 7 not bit 15 */ m_flags &= ~S; @@ -484,7 +484,7 @@ void cp1610_cpu_device::cp1610_sar_2(int r) ***************************************************/ void cp1610_cpu_device::cp1610_rrc_1(int r) { - UINT16 offset = 0; + uint16_t offset = 0; m_mask_interrupts = 1; if (m_flags & C) offset = 0x8000; @@ -507,7 +507,7 @@ void cp1610_cpu_device::cp1610_rrc_1(int r) ***************************************************/ void cp1610_cpu_device::cp1610_rrc_2(int r) { - UINT16 offset = 0; + uint16_t offset = 0; m_mask_interrupts = 1; if (m_flags & C) offset |= 0x4000; @@ -538,7 +538,7 @@ void cp1610_cpu_device::cp1610_sarc_1(int r) CLR_SZC; if (m_r[r] & 1) m_flags |= C; - m_r[r] = (UINT16)(((INT16)m_r[r]) >> 1); + m_r[r] = (uint16_t)(((int16_t)m_r[r]) >> 1); SET_SZ(m_r[r]); /* S flag is set on bit 7 not bit 15 */ m_flags &= ~S; @@ -559,7 +559,7 @@ void cp1610_cpu_device::cp1610_sarc_2(int r) m_flags |= C; if (m_r[r] & 2) m_flags |= OV; - m_r[r] = (UINT16)(((INT16)m_r[r]) >> 2); + m_r[r] = (uint16_t)(((int16_t)m_r[r]) >> 2); SET_SZ(m_r[r]); /* S flag is set on bit 7 not bit 15 */ m_flags &= ~S; @@ -615,7 +615,7 @@ void cp1610_cpu_device::cp1610_addr(int s, int d) void cp1610_cpu_device::cp1610_subr(int s, int d) { CLR_SZOC; - SET_COV(m_r[d],(UINT32)((m_r[s]^0xffff)+1),1); + SET_COV(m_r[d],(uint32_t)((m_r[s]^0xffff)+1),1); m_r[d] -= m_r[s]; SET_SZ(m_r[d]); m_icount -= 6; @@ -627,9 +627,9 @@ void cp1610_cpu_device::cp1610_subr(int s, int d) ***************************************************/ void cp1610_cpu_device::cp1610_cmpr(int s, int d) { - UINT16 temp; + uint16_t temp; CLR_SZOC; - SET_COV(m_r[d],(UINT32)((m_r[s]^0xffff)+1),1); + SET_COV(m_r[d],(uint32_t)((m_r[s]^0xffff)+1),1); temp = m_r[d] - m_r[s]; SET_SZ(temp); m_icount -= 6; @@ -677,7 +677,7 @@ void cp1610_cpu_device::cp1610_clrr(int d) ***************************************************/ void cp1610_cpu_device::cp1610_b(int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; m_r[7] += (offset ^ dir); m_icount -= 9; @@ -700,7 +700,7 @@ void cp1610_cpu_device::cp1610_nopp(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_bc(int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & C) { @@ -719,7 +719,7 @@ void cp1610_cpu_device::cp1610_bc(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_bnc(int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (!(m_flags & C)) { @@ -738,7 +738,7 @@ void cp1610_cpu_device::cp1610_bnc(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_bov(int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & OV) { @@ -757,7 +757,7 @@ void cp1610_cpu_device::cp1610_bov(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_bnov(int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (!(m_flags & OV)) { @@ -776,7 +776,7 @@ void cp1610_cpu_device::cp1610_bnov(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_bpl(int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (!(m_flags & S)) { @@ -795,7 +795,7 @@ void cp1610_cpu_device::cp1610_bpl(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_bmi(int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & S) { @@ -814,7 +814,7 @@ void cp1610_cpu_device::cp1610_bmi(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_bze(int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & Z) { @@ -833,7 +833,7 @@ void cp1610_cpu_device::cp1610_bze(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_bnze(int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (!(m_flags & Z)) { @@ -854,7 +854,7 @@ void cp1610_cpu_device::cp1610_blt(int dir) { int condition1 = 0; int condition2 = 0; - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & S) condition1 = 1; if (m_flags & OV) condition2 = 1; @@ -877,7 +877,7 @@ void cp1610_cpu_device::cp1610_bge(int dir) { int condition1 = 0; int condition2 = 0; - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & S) condition1 = 1; if (m_flags & OV) condition2 = 1; @@ -900,7 +900,7 @@ void cp1610_cpu_device::cp1610_ble(int dir) { int condition1 = 0; int condition2 = 0; - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & S) condition1 = 1; if (m_flags & OV) condition2 = 1; @@ -923,7 +923,7 @@ void cp1610_cpu_device::cp1610_bgt(int dir) { int condition1 = 0; int condition2 = 0; - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & S) condition1 = 1; if (m_flags & OV) condition2 = 1; @@ -946,7 +946,7 @@ void cp1610_cpu_device::cp1610_busc(int dir) { int condition1 = 0; int condition2 = 0; - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & C) condition1 = 1; if (m_flags & S) condition2 = 1; @@ -969,7 +969,7 @@ void cp1610_cpu_device::cp1610_besc(int dir) { int condition1 = 0; int condition2 = 0; - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_flags & C) condition1 = 1; if (m_flags & S) condition2 = 1; @@ -990,7 +990,7 @@ void cp1610_cpu_device::cp1610_besc(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_bext(int ext, int dir) { - UINT16 offset = cp1610_readop(m_r[7]); + uint16_t offset = cp1610_readop(m_r[7]); m_r[7]++; if (m_read_bext(ext)) @@ -1010,7 +1010,7 @@ void cp1610_cpu_device::cp1610_besc(int dir) ***************************************************/ void cp1610_cpu_device::cp1610_mvo(int s) { - UINT16 addr; + uint16_t addr; m_mask_interrupts = 1; addr = cp1610_readop(m_r[7]); m_r[7]++; @@ -1059,7 +1059,7 @@ void cp1610_cpu_device::cp1610_mvoi(int s) ***************************************************/ void cp1610_cpu_device::cp1610_mvi(int d) { - UINT16 addr = cp1610_readop(m_r[7]); + uint16_t addr = cp1610_readop(m_r[7]); m_r[7]++; m_r[d] = cp1610_readmem16(addr); m_icount -= 10; @@ -1081,7 +1081,7 @@ void cp1610_cpu_device::cp1610_mviat(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_mviat_i(int m, int d) { - UINT16 temp = cp1610_readmem16(m_r[m]); + uint16_t temp = cp1610_readmem16(m_r[m]); m_r[m]++; m_r[d] = temp; m_icount -= 8; @@ -1104,7 +1104,7 @@ void cp1610_cpu_device::cp1610_pulr(int d) ***************************************************/ void cp1610_cpu_device::cp1610_mvii(int d) { - UINT16 temp = cp1610_readop(m_r[7]); + uint16_t temp = cp1610_readop(m_r[7]); m_r[7]++; m_r[d] = temp; m_icount -= 8; @@ -1116,8 +1116,8 @@ void cp1610_cpu_device::cp1610_mvii(int d) ***************************************************/ void cp1610_cpu_device::cp1610_add(int d) { - UINT16 addr = cp1610_readop(m_r[7]); - UINT16 data = cp1610_readmem16(addr); + uint16_t addr = cp1610_readop(m_r[7]); + uint16_t data = cp1610_readmem16(addr); m_r[7]++; CLR_SZOC; SET_COV(m_r[d],data,0); @@ -1132,7 +1132,7 @@ void cp1610_cpu_device::cp1610_add(int d) ***************************************************/ void cp1610_cpu_device::cp1610_addat(int m, int d) { - UINT16 data = cp1610_readmem16(m_r[m]); + uint16_t data = cp1610_readmem16(m_r[m]); CLR_SZOC; SET_COV(m_r[d],data,0); m_r[d] += data; @@ -1146,7 +1146,7 @@ void cp1610_cpu_device::cp1610_addat(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_addat_i(int m, int d) { - UINT16 data = cp1610_readmem16(m_r[m]); + uint16_t data = cp1610_readmem16(m_r[m]); m_r[m]++; CLR_SZOC; SET_COV(m_r[d],data,0); @@ -1161,7 +1161,7 @@ void cp1610_cpu_device::cp1610_addat_i(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_addat_d(int m, int d) { - UINT16 data; + uint16_t data; m_r[m]--; data = cp1610_readmem16(m_r[m]); CLR_SZOC; @@ -1177,7 +1177,7 @@ void cp1610_cpu_device::cp1610_addat_d(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_addi(int d) { - UINT16 data; + uint16_t data; data = cp1610_readop(m_r[7]); m_r[7]++; CLR_SZOC; @@ -1193,8 +1193,8 @@ void cp1610_cpu_device::cp1610_addi(int d) ***************************************************/ void cp1610_cpu_device::cp1610_sub(int d) { - UINT16 addr = cp1610_readop(m_r[7]); - UINT32 data = cp1610_readmem16(addr); + uint16_t addr = cp1610_readop(m_r[7]); + uint32_t data = cp1610_readmem16(addr); m_r[7]++; CLR_SZOC; data = (data ^ 0xffff) + 1; @@ -1211,7 +1211,7 @@ void cp1610_cpu_device::cp1610_sub(int d) ***************************************************/ void cp1610_cpu_device::cp1610_subat(int m, int d) { - UINT32 data = cp1610_readmem16(m_r[m]); + uint32_t data = cp1610_readmem16(m_r[m]); CLR_SZOC; data = (data ^ 0xffff) + 1; SET_COV(m_r[d],data,1); @@ -1227,7 +1227,7 @@ void cp1610_cpu_device::cp1610_subat(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_subat_i(int m, int d) { - UINT32 data = cp1610_readmem16(m_r[m]); + uint32_t data = cp1610_readmem16(m_r[m]); m_r[m]++; CLR_SZOC; data = (data ^ 0xffff) + 1; @@ -1244,7 +1244,7 @@ void cp1610_cpu_device::cp1610_subat_i(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_subat_d(int m, int d) { - UINT32 data; + uint32_t data; m_r[m]--; data = cp1610_readmem16(m_r[m]); CLR_SZOC; @@ -1262,7 +1262,7 @@ void cp1610_cpu_device::cp1610_subat_d(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_subi(int d) { - UINT32 data; + uint32_t data; data = cp1610_readop(m_r[7]); m_r[7]++; data = (data ^ 0xffff) + 1; @@ -1280,9 +1280,9 @@ void cp1610_cpu_device::cp1610_subi(int d) ***************************************************/ void cp1610_cpu_device::cp1610_cmp(int d) { - UINT16 addr = cp1610_readop(m_r[7]); - UINT32 data = cp1610_readmem16(addr); - UINT16 res; + uint16_t addr = cp1610_readop(m_r[7]); + uint32_t data = cp1610_readmem16(addr); + uint16_t res; m_r[7]++; CLR_SZOC; data = (data ^ 0xffff) + 1; @@ -1299,8 +1299,8 @@ void cp1610_cpu_device::cp1610_cmp(int d) ***************************************************/ void cp1610_cpu_device::cp1610_cmpat(int m, int d) { - UINT32 data = cp1610_readmem16(m_r[m]); - UINT16 res; + uint32_t data = cp1610_readmem16(m_r[m]); + uint16_t res; CLR_SZOC; data = (data ^ 0xffff) + 1; SET_COV(m_r[d],data,1); @@ -1316,8 +1316,8 @@ void cp1610_cpu_device::cp1610_cmpat(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_cmpat_i(int m, int d) { - UINT32 data = cp1610_readmem16(m_r[m]); - UINT16 res; + uint32_t data = cp1610_readmem16(m_r[m]); + uint16_t res; m_r[m]++; CLR_SZOC; data = (data ^ 0xffff) + 1; @@ -1334,8 +1334,8 @@ void cp1610_cpu_device::cp1610_cmpat_i(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_cmpat_d(int m, int d) { - UINT32 data; - UINT16 res; + uint32_t data; + uint16_t res; m_r[m]--; data = cp1610_readmem16(m_r[m]); CLR_SZOC; @@ -1353,8 +1353,8 @@ void cp1610_cpu_device::cp1610_cmpat_d(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_cmpi(int d) { - UINT32 data; - UINT16 res; + uint32_t data; + uint16_t res; data = cp1610_readop(m_r[7]); m_r[7]++; data = (data ^ 0xffff) + 1; @@ -1372,8 +1372,8 @@ void cp1610_cpu_device::cp1610_cmpi(int d) ***************************************************/ void cp1610_cpu_device::cp1610_and(int d) { - UINT16 addr = cp1610_readop(m_r[7]); - UINT16 data = cp1610_readmem16(addr); + uint16_t addr = cp1610_readop(m_r[7]); + uint16_t data = cp1610_readmem16(addr); m_r[7]++; CLR_SZ; m_r[d] &= data; @@ -1387,7 +1387,7 @@ void cp1610_cpu_device::cp1610_and(int d) ***************************************************/ void cp1610_cpu_device::cp1610_andat(int m, int d) { - UINT16 data = cp1610_readmem16(m_r[m]); + uint16_t data = cp1610_readmem16(m_r[m]); CLR_SZ; m_r[d] &= data; SET_SZ(m_r[d]); @@ -1400,7 +1400,7 @@ void cp1610_cpu_device::cp1610_andat(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_andat_i(int m, int d) { - UINT16 data = cp1610_readmem16(m_r[m]); + uint16_t data = cp1610_readmem16(m_r[m]); m_r[m]++; CLR_SZ; m_r[d] &= data; @@ -1414,7 +1414,7 @@ void cp1610_cpu_device::cp1610_andat_i(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_andat_d(int m, int d) { - UINT16 data; + uint16_t data; m_r[m]--; data = cp1610_readmem16(m_r[m]); CLR_SZ; @@ -1429,7 +1429,7 @@ void cp1610_cpu_device::cp1610_andat_d(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_andi(int d) { - UINT16 data; + uint16_t data; data = cp1610_readop(m_r[7]); m_r[7]++; CLR_SZ; @@ -1444,8 +1444,8 @@ void cp1610_cpu_device::cp1610_andi(int d) ***************************************************/ void cp1610_cpu_device::cp1610_xor(int d) { - UINT16 addr = cp1610_readop(m_r[7]); - UINT16 data = cp1610_readmem16(addr); + uint16_t addr = cp1610_readop(m_r[7]); + uint16_t data = cp1610_readmem16(addr); m_r[7]++; CLR_SZ; m_r[d] ^= data; @@ -1459,7 +1459,7 @@ void cp1610_cpu_device::cp1610_xor(int d) ***************************************************/ void cp1610_cpu_device::cp1610_xorat(int m, int d) { - UINT16 data = cp1610_readmem16(m_r[m]); + uint16_t data = cp1610_readmem16(m_r[m]); CLR_SZ; m_r[d] ^= data; SET_SZ(m_r[d]); @@ -1472,7 +1472,7 @@ void cp1610_cpu_device::cp1610_xorat(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_xorat_i(int m, int d) { - UINT16 data = cp1610_readmem16(m_r[m]); + uint16_t data = cp1610_readmem16(m_r[m]); m_r[m]++; CLR_SZ; m_r[d] ^= data; @@ -1486,7 +1486,7 @@ void cp1610_cpu_device::cp1610_xorat_i(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_xorat_d(int m, int d) { - UINT16 data; + uint16_t data; m_r[m]--; data = cp1610_readmem16(m_r[m]); CLR_SZ; @@ -1501,7 +1501,7 @@ void cp1610_cpu_device::cp1610_xorat_d(int m, int d) ***************************************************/ void cp1610_cpu_device::cp1610_xori(int d) { - UINT16 data; + uint16_t data; data = cp1610_readop(m_r[7]); m_r[7]++; CLR_SZ; @@ -1527,7 +1527,7 @@ void cp1610_cpu_device::cp1610_sdbd_mviat(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_mviat_i(int r, int d) { - UINT16 temp; + uint16_t temp; temp = cp1610_readmem16(m_r[r]) & 0xff; m_r[r]++; m_r[d] = temp; @@ -1556,7 +1556,7 @@ void cp1610_cpu_device::cp1610_sdbd_mviat_d(int r, int d) ************************************************************************/ void cp1610_cpu_device::cp1610_sdbd_mvii(int d) { - UINT16 addr; + uint16_t addr; addr = cp1610_readop(m_r[7]) & 0xff; m_r[7]++; addr |= (cp1610_readop(m_r[7]) << 8); @@ -1571,7 +1571,7 @@ void cp1610_cpu_device::cp1610_sdbd_mvii(int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_addat(int r, int d) { - UINT16 temp; + uint16_t temp; CLR_SZOC; temp = cp1610_readmem16(m_r[r]) & 0xff; temp |= (cp1610_readmem16(m_r[r]) << 8); @@ -1587,7 +1587,7 @@ void cp1610_cpu_device::cp1610_sdbd_addat(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_addat_i(int r, int d) { - UINT16 temp; + uint16_t temp; CLR_SZOC; temp = cp1610_readmem16(m_r[r]) & 0xff; m_r[r]++; @@ -1605,7 +1605,7 @@ void cp1610_cpu_device::cp1610_sdbd_addat_i(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_addat_d(int r, int d) { - UINT16 temp; + uint16_t temp; CLR_SZOC; m_r[r]--; temp = cp1610_readmem16(m_r[r]) & 0xff; @@ -1623,8 +1623,8 @@ void cp1610_cpu_device::cp1610_sdbd_addat_d(int r, int d) ************************************************************************/ void cp1610_cpu_device::cp1610_sdbd_addi(int d) { - UINT16 addr; - UINT16 temp; + uint16_t addr; + uint16_t temp; CLR_SZOC; addr = cp1610_readop(m_r[7]) & 0xff; m_r[7]++; @@ -1643,7 +1643,7 @@ void cp1610_cpu_device::cp1610_sdbd_addi(int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_subat(int r, int d) { - UINT32 temp; + uint32_t temp; CLR_SZOC; temp = cp1610_readmem16(m_r[r]) & 0xff; temp |= (cp1610_readmem16(m_r[r]) << 8); @@ -1661,7 +1661,7 @@ void cp1610_cpu_device::cp1610_sdbd_subat(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_subat_i(int r, int d) { - UINT32 temp; + uint32_t temp; CLR_SZOC; temp = cp1610_readmem16(m_r[r]) & 0xff; m_r[r]++; @@ -1681,7 +1681,7 @@ void cp1610_cpu_device::cp1610_sdbd_subat_i(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_subat_d(int r, int d) { - UINT32 temp; + uint32_t temp; CLR_SZOC; m_r[r]--; temp = cp1610_readmem16(m_r[r]) & 0xff; @@ -1701,8 +1701,8 @@ void cp1610_cpu_device::cp1610_sdbd_subat_d(int r, int d) ************************************************************************/ void cp1610_cpu_device::cp1610_sdbd_subi(int d) { - UINT16 addr; - UINT32 temp; + uint16_t addr; + uint32_t temp; CLR_SZOC; addr = cp1610_readop(m_r[7]) & 0xff; m_r[7]++; @@ -1723,8 +1723,8 @@ void cp1610_cpu_device::cp1610_sdbd_subi(int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_cmpat(int r, int d) { - UINT32 temp; - UINT16 temp2; + uint32_t temp; + uint16_t temp2; CLR_SZOC; temp = cp1610_readmem16(m_r[r]) & 0xff; temp |= (cp1610_readmem16(m_r[r]) << 8); @@ -1742,8 +1742,8 @@ void cp1610_cpu_device::cp1610_sdbd_cmpat(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_cmpat_i(int r, int d) { - UINT32 temp; - UINT16 temp2; + uint32_t temp; + uint16_t temp2; CLR_SZOC; temp = cp1610_readmem16(m_r[r]) & 0xff; m_r[r]++; @@ -1763,8 +1763,8 @@ void cp1610_cpu_device::cp1610_sdbd_cmpat_i(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_cmpat_d(int r, int d) { - UINT32 temp; - UINT16 temp2; + uint32_t temp; + uint16_t temp2; CLR_SZOC; m_r[r]--; temp = cp1610_readmem16(m_r[r]) & 0xff; @@ -1784,9 +1784,9 @@ void cp1610_cpu_device::cp1610_sdbd_cmpat_d(int r, int d) ************************************************************************/ void cp1610_cpu_device::cp1610_sdbd_cmpi(int d) { - UINT16 addr; - UINT32 temp; - UINT16 temp2; + uint16_t addr; + uint32_t temp; + uint16_t temp2; CLR_SZOC; addr = cp1610_readop(m_r[7]) & 0xff; m_r[7]++; @@ -1807,7 +1807,7 @@ void cp1610_cpu_device::cp1610_sdbd_cmpi(int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_andat(int r, int d) { - UINT16 temp; + uint16_t temp; CLR_SZ; temp = cp1610_readmem16(m_r[r]) & 0xff; temp |= (cp1610_readmem16(m_r[r]) << 8); @@ -1822,7 +1822,7 @@ void cp1610_cpu_device::cp1610_sdbd_andat(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_andat_i(int r, int d) { - UINT16 temp; + uint16_t temp; CLR_SZ; temp = cp1610_readmem16(m_r[r]) & 0xff; m_r[r]++; @@ -1839,7 +1839,7 @@ void cp1610_cpu_device::cp1610_sdbd_andat_i(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_andat_d(int r, int d) { - UINT16 temp; + uint16_t temp; CLR_SZ; m_r[r]--; temp = cp1610_readmem16(m_r[r]) & 0xff; @@ -1856,7 +1856,7 @@ void cp1610_cpu_device::cp1610_sdbd_andat_d(int r, int d) ************************************************************************/ void cp1610_cpu_device::cp1610_sdbd_andi(int d) { - UINT16 addr; + uint16_t addr; CLR_SZ; addr = cp1610_readop(m_r[7]) & 0xff; m_r[7]++; @@ -1873,7 +1873,7 @@ void cp1610_cpu_device::cp1610_sdbd_andi(int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_xorat(int r, int d) { - UINT16 temp; + uint16_t temp; CLR_SZ; temp = cp1610_readmem16(m_r[r]) & 0xff; temp |= (cp1610_readmem16(m_r[r]) << 8); @@ -1888,7 +1888,7 @@ void cp1610_cpu_device::cp1610_sdbd_xorat(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_xorat_i(int r, int d) { - UINT16 temp; + uint16_t temp; CLR_SZ; temp = cp1610_readmem16(m_r[r]) & 0xff; m_r[r]++; @@ -1905,7 +1905,7 @@ void cp1610_cpu_device::cp1610_sdbd_xorat_i(int r, int d) ***************************************************/ void cp1610_cpu_device::cp1610_sdbd_xorat_d(int r, int d) { - UINT16 temp; + uint16_t temp; CLR_SZ; m_r[r]--; temp = cp1610_readmem16(m_r[r]) & 0xff; @@ -1922,7 +1922,7 @@ void cp1610_cpu_device::cp1610_sdbd_xorat_d(int r, int d) ************************************************************************/ void cp1610_cpu_device::cp1610_sdbd_xori(int d) { - UINT16 addr; + uint16_t addr; CLR_SZ; addr = cp1610_readop(m_r[7]) & 0xff; m_r[7]++; @@ -1937,7 +1937,7 @@ void cp1610_cpu_device::cp1610_sdbd_xori(int d) * S Z C OV b baa aaa a00 x xxx xxa aaa aaa aaa * - - - - JSR R1bb, ADDR ***************************************************/ -void cp1610_cpu_device::cp1610_jsr(int r, UINT16 addr) +void cp1610_cpu_device::cp1610_jsr(int r, uint16_t addr) { m_r[r] = m_r[7]; m_r[7] = addr; @@ -1947,7 +1947,7 @@ void cp1610_cpu_device::cp1610_jsr(int r, UINT16 addr) * S Z C OV b baa aaa a01 x xxx xxa aaa aaa aaa * - - - - JSRE R1bb, ADDR ***************************************************/ -void cp1610_cpu_device::cp1610_jsre(int r, UINT16 addr) +void cp1610_cpu_device::cp1610_jsre(int r, uint16_t addr) { m_r[r] = m_r[7]; m_r[7] = addr; @@ -1958,7 +1958,7 @@ void cp1610_cpu_device::cp1610_jsre(int r, UINT16 addr) * S Z C OV b baa aaa a10 x xxx xxa aaa aaa aaa * - - - - JSRD R1bb, ADDR ***************************************************/ -void cp1610_cpu_device::cp1610_jsrd(int r, UINT16 addr) +void cp1610_cpu_device::cp1610_jsrd(int r, uint16_t addr) { m_r[r] = m_r[7]; m_r[7] = addr; @@ -1969,7 +1969,7 @@ void cp1610_cpu_device::cp1610_jsrd(int r, UINT16 addr) * S Z C OV 1 1aa aaa a00 x xxx xxa aaa aaa aaa * - - - - J ADDR ***************************************************/ -void cp1610_cpu_device::cp1610_j(UINT16 addr) +void cp1610_cpu_device::cp1610_j(uint16_t addr) { m_r[7] = addr; } @@ -1978,7 +1978,7 @@ void cp1610_cpu_device::cp1610_j(UINT16 addr) * S Z C OV 1 1aa aaa a01 x xxx xxa aaa aaa aaa * - - - - JE ADDR ***************************************************/ -void cp1610_cpu_device::cp1610_je(UINT16 addr) +void cp1610_cpu_device::cp1610_je(uint16_t addr) { m_r[7] = addr; m_intr_enabled = 1; @@ -1988,7 +1988,7 @@ void cp1610_cpu_device::cp1610_je(UINT16 addr) * S Z C OV 1 1aa aaa a10 x xxx xxa aaa aaa aaa * - - - - JD ADDR ***************************************************/ -void cp1610_cpu_device::cp1610_jd(UINT16 addr) +void cp1610_cpu_device::cp1610_jd(uint16_t addr) { m_r[7] = addr; m_intr_enabled = 0; @@ -1996,7 +1996,7 @@ void cp1610_cpu_device::cp1610_jd(UINT16 addr) void cp1610_cpu_device::cp1610_do_sdbd() { - UINT16 sdbdtype, dest; + uint16_t sdbdtype, dest; /* Even though SDBD is uninterruptable, we don't need to set the mask bit, * because we already treat the SDBD prefixed instructions as uninterruptable @@ -2077,7 +2077,7 @@ void cp1610_cpu_device::cp1610_do_sdbd() void cp1610_cpu_device::cp1610_do_jumps() { - UINT16 jumptype, arg1, arg2, addr; + uint16_t jumptype, arg1, arg2, addr; arg1 = cp1610_readop(m_r[7]); m_r[7]++; @@ -2118,7 +2118,7 @@ void cp1610_cpu_device::cp1610_do_jumps() /* Execute cycles */ void cp1610_cpu_device::execute_run() { - UINT16 opcode; + uint16_t opcode; do { @@ -3394,7 +3394,7 @@ void cp1610_cpu_device::execute_set_input(int irqline, int state) } -cp1610_cpu_device::cp1610_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cp1610_cpu_device::cp1610_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, CP1610, "CP1610", tag, owner, clock, "cp1610", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 16, 16, -1) , m_read_bext(*this) @@ -3417,7 +3417,7 @@ void cp1610_cpu_device::state_string_export(const device_state_entry &entry, std } -offs_t cp1610_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t cp1610_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( cp1610 ); return CPU_DISASSEMBLE_NAME(cp1610)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/cp1610/cp1610.h b/src/devices/cpu/cp1610/cp1610.h index 84611f75a2c..fd821b6d8dc 100644 --- a/src/devices/cpu/cp1610/cp1610.h +++ b/src/devices/cpu/cp1610/cp1610.h @@ -33,7 +33,7 @@ class cp1610_cpu_device : public cpu_device { public: // construction/destruction - cp1610_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + cp1610_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); template void set_bext_callback(_read rd) { @@ -46,9 +46,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 7; } - virtual UINT32 execute_input_lines() const override { return 2; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 7; } + virtual uint32_t execute_input_lines() const override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -59,17 +59,17 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; - UINT16 m_r[8]; /* registers */ - UINT8 m_flags; /* flags */ + uint16_t m_r[8]; /* registers */ + uint8_t m_flags; /* flags */ int m_intr_enabled; - UINT16 m_intr_vector; + uint16_t m_intr_vector; int m_reset_state; int m_intr_state; int m_intrm_state; @@ -197,12 +197,12 @@ private: void cp1610_sdbd_xorat_i(int r, int d); void cp1610_sdbd_xorat_d(int r, int d); void cp1610_sdbd_xori(int d); - void cp1610_jsr(int r, UINT16 addr); - void cp1610_jsre(int r, UINT16 addr); - void cp1610_jsrd(int r, UINT16 addr); - void cp1610_j(UINT16 addr); - void cp1610_je(UINT16 addr); - void cp1610_jd(UINT16 addr); + void cp1610_jsr(int r, uint16_t addr); + void cp1610_jsre(int r, uint16_t addr); + void cp1610_jsrd(int r, uint16_t addr); + void cp1610_j(uint16_t addr); + void cp1610_je(uint16_t addr); + void cp1610_jd(uint16_t addr); void cp1610_do_sdbd(); void cp1610_do_jumps(); }; diff --git a/src/devices/cpu/cubeqcpu/cubedasm.cpp b/src/devices/cpu/cubeqcpu/cubedasm.cpp index bbd1c750361..034ac4873b2 100644 --- a/src/devices/cpu/cubeqcpu/cubedasm.cpp +++ b/src/devices/cpu/cubeqcpu/cubedasm.cpp @@ -81,9 +81,9 @@ CPU_DISASSEMBLE( cquestsnd ) " ", }; - UINT64 inst = big_endianize_int64(*(UINT64 *)oprom); - UINT32 inslow = inst & 0xffffffff; - UINT32 inshig = inst >> 32; + uint64_t inst = big_endianize_int64(*(uint64_t *)oprom); + uint32_t inslow = inst & 0xffffffff; + uint32_t inshig = inst >> 32; int t = (inshig >> 24) & 0xff; int b = (inshig >> 20) & 0xf; @@ -185,9 +185,9 @@ CPU_DISASSEMBLE( cquestrot ) "??? " }; - UINT64 inst = big_endianize_int64(*(UINT64 *)oprom); - UINT32 inslow = inst & 0xffffffff; - UINT32 inshig = inst >> 32; + uint64_t inst = big_endianize_int64(*(uint64_t *)oprom); + uint32_t inslow = inst & 0xffffffff; + uint32_t inshig = inst >> 32; int t = (inshig >> 20) & 0xfff; int jmp = (inshig >> 16) & 0xf; @@ -271,9 +271,9 @@ CPU_DISASSEMBLE( cquestlin ) "BRES ", }; - UINT64 inst = big_endianize_int64(*(UINT64 *)oprom); - UINT32 inslow = inst & 0xffffffff; - UINT32 inshig = inst >> 32; + uint64_t inst = big_endianize_int64(*(uint64_t *)oprom); + uint32_t inslow = inst & 0xffffffff; + uint32_t inshig = inst >> 32; int t = (inshig >> 24) & 0xff; int jmp = (inshig >> 20) & 0xf; diff --git a/src/devices/cpu/cubeqcpu/cubeqcpu.cpp b/src/devices/cpu/cubeqcpu/cubeqcpu.cpp index ec286c10570..6939332b647 100644 --- a/src/devices/cpu/cubeqcpu/cubeqcpu.cpp +++ b/src/devices/cpu/cubeqcpu/cubeqcpu.cpp @@ -75,7 +75,7 @@ const device_type CQUESTROT = &device_creator; const device_type CQUESTLIN = &device_creator; -cquestsnd_cpu_device::cquestsnd_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cquestsnd_cpu_device::cquestsnd_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, CQUESTSND, "Cube Quest Sound CPU", tag, owner, clock, "cquestsnd", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 64, 8, -3) , m_dac_w(*this) @@ -84,14 +84,14 @@ cquestsnd_cpu_device::cquestsnd_cpu_device(const machine_config &mconfig, const } -offs_t cquestsnd_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t cquestsnd_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( cquestsnd ); return CPU_DISASSEMBLE_NAME(cquestsnd)(this, buffer, pc, oprom, opram, options); } -cquestrot_cpu_device::cquestrot_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cquestrot_cpu_device::cquestrot_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, CQUESTROT, "Cube Quest Rotate CPU", tag, owner, clock, "cquestrot", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 64, 9, -3) , m_linedata_w(*this) @@ -105,14 +105,14 @@ READ16_MEMBER( cquestrot_cpu_device::linedata_r ) } -offs_t cquestrot_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t cquestrot_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( cquestrot ); return CPU_DISASSEMBLE_NAME(cquestrot)(this, buffer, pc, oprom, opram, options); } -cquestlin_cpu_device::cquestlin_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cquestlin_cpu_device::cquestlin_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, CQUESTLIN, "Cube Quest Line CPU", tag, owner, clock, "cquestlin", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 64, 8, -3) , m_linedata_r(*this) @@ -122,7 +122,7 @@ cquestlin_cpu_device::cquestlin_cpu_device(const machine_config &mconfig, const } -offs_t cquestlin_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t cquestlin_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( cquestlin ); return CPU_DISASSEMBLE_NAME(cquestlin)(this, buffer, pc, oprom, opram, options); @@ -169,7 +169,7 @@ void cquestsnd_cpu_device::device_start() { m_dac_w.resolve_safe(); assert(m_sound_region_tag != nullptr); - m_sound_data = (UINT16*)machine().root_device().memregion(m_sound_region_tag)->base(); + m_sound_data = (uint16_t*)machine().root_device().memregion(m_sound_region_tag)->base(); m_program = &space(AS_PROGRAM); m_direct = &m_program->direct(); @@ -525,9 +525,9 @@ void cquestsnd_cpu_device::execute_run() do { /* Decode the instruction */ - UINT64 inst = m_direct->read_qword(SND_PC << 3); - UINT32 inslow = inst & 0xffffffff; - UINT32 inshig = inst >> 32; + uint64_t inst = m_direct->read_qword(SND_PC << 3); + uint32_t inslow = inst & 0xffffffff; + uint32_t inshig = inst >> 32; int t = (inshig >> 24) & 0xff; int b = (inshig >> 20) & 0xf; @@ -554,12 +554,12 @@ void cquestsnd_cpu_device::execute_run() /* Handle the AM2901 ALU instruction */ { - UINT16 r = 0; - UINT16 s = 0; + uint16_t r = 0; + uint16_t s = 0; - UINT32 res = 0; - UINT32 cflag = 0; - UINT32 vflag = 0; + uint32_t res = 0; + uint32_t cflag = 0; + uint32_t vflag = 0; /* Determine the ALU sources */ switch (i2_0) @@ -632,7 +632,7 @@ void cquestsnd_cpu_device::execute_run() break; case RAMQD: { - UINT16 qin; + uint16_t qin; m_ram[b] = (_rin ? 0 : 0x8000) | (m_f >> 1); m_q >>= 1; @@ -663,7 +663,7 @@ void cquestsnd_cpu_device::execute_run() /* Now handle any SRAM accesses from the previous cycle */ if (!m_prev_ipram) { - UINT16 addr = m_adrlatch | (m_adrcntr & 0x7f); + uint16_t addr = m_adrlatch | (m_adrcntr & 0x7f); if (!m_prev_ipwrt) m_sram[addr] = m_ramwlatch; @@ -781,10 +781,10 @@ void cquestrot_cpu_device::execute_run() do { /* Decode the instruction */ - UINT64 inst = m_direct->read_qword(ROT_PC << 3); + uint64_t inst = m_direct->read_qword(ROT_PC << 3); - UINT32 inslow = inst & 0xffffffff; - UINT32 inshig = inst >> 32; + uint32_t inslow = inst & 0xffffffff; + uint32_t inshig = inst >> 32; int t = (inshig >> 20) & 0xfff; int jmp = (inshig >> 16) & 0xf; @@ -802,7 +802,7 @@ void cquestrot_cpu_device::execute_run() int i2_0 = (inslow >> 16) & 0x7; int dsrclatch; - UINT16 data_in = 0xffff; + uint16_t data_in = 0xffff; debugger_instruction_hook(this, ROT_PC); @@ -854,12 +854,12 @@ void cquestrot_cpu_device::execute_run() /* No do the ALU operation */ { - UINT16 r = 0; - UINT16 s = 0; + uint16_t r = 0; + uint16_t s = 0; - UINT32 res = 0; - UINT32 cflag = 0; - UINT32 vflag = 0; + uint32_t res = 0; + uint32_t cflag = 0; + uint32_t vflag = 0; /* First, determine correct I1 bit */ if ((spf == SPF_MULT) && !_BIT(m_q, 0)) @@ -943,10 +943,10 @@ void cquestrot_cpu_device::execute_run() break; case RAMQD: { - UINT16 q0 = m_q & 1; - UINT16 r0 = m_f & 1; - UINT16 q15 = 0; - UINT16 r15 = 0; + uint16_t q0 = m_q & 1; + uint16_t r0 = m_f & 1; + uint16_t q15 = 0; + uint16_t r15 = 0; /* Determine Q15 and RAM15 */ switch (sel) @@ -970,8 +970,8 @@ void cquestrot_cpu_device::execute_run() } case RAMD: { - UINT16 r0 = m_f & 1; - UINT16 r15 = 0; + uint16_t r0 = m_f & 1; + uint16_t r15 = 0; switch (sel) { @@ -989,10 +989,10 @@ void cquestrot_cpu_device::execute_run() } case RAMQU: { - UINT16 q15 = BIT(m_q, 15); - UINT16 r15 = BIT(m_f, 15); - UINT16 q0 = 0; - UINT16 r0 = 0; + uint16_t q15 = BIT(m_q, 15); + uint16_t r15 = BIT(m_f, 15); + uint16_t q0 = 0; + uint16_t r0 = 0; switch (sel) { @@ -1014,9 +1014,9 @@ void cquestrot_cpu_device::execute_run() } case RAMU: { - UINT16 q15 = BIT(m_q, 15); - UINT16 r15 = BIT(m_f, 15); - UINT16 r0 = 0; + uint16_t q15 = BIT(m_q, 15); + uint16_t r15 = BIT(m_f, 15); + uint16_t r0 = 0; switch (sel) { @@ -1160,13 +1160,13 @@ void cquestlin_cpu_device::cubeqcpu_clear_stack() } -UINT8 cquestlin_cpu_device::cubeqcpu_get_ptr_ram_val(int i) +uint8_t cquestlin_cpu_device::cubeqcpu_get_ptr_ram_val(int i) { return m_ptr_ram[((m_field^1) * 256) + i]; } -UINT32* cquestlin_cpu_device::cubeqcpu_get_stack_ram() +uint32_t* cquestlin_cpu_device::cubeqcpu_get_stack_ram() { if (m_field != ODD_FIELD) return m_o_stack; @@ -1179,8 +1179,8 @@ void cquestlin_cpu_device::execute_run() { #define LINE_PC ((m_pc[prog] & 0x7f) | ((prog == BACKGROUND) ? 0x80 : 0)) - UINT32 *stack_ram; - UINT8 *ptr_ram; + uint32_t *stack_ram; + uint8_t *ptr_ram; /* Check the field and set the stack/pointer RAM pointers appropriately */ if (m_field == ODD_FIELD) @@ -1201,10 +1201,10 @@ void cquestlin_cpu_device::execute_run() int prog = (m_clkcnt & 3) ? BACKGROUND : FOREGROUND; m_curpc = LINE_PC; - UINT64 inst = m_direct->read_qword(LINE_PC << 3); + uint64_t inst = m_direct->read_qword(LINE_PC << 3); - UINT32 inslow = inst & 0xffffffff; - UINT32 inshig = inst >> 32; + uint32_t inslow = inst & 0xffffffff; + uint32_t inshig = inst >> 32; int t = (inshig >> 24) & 0xff; int jmp = (inshig >> 20) & 0xf; @@ -1219,7 +1219,7 @@ void cquestlin_cpu_device::execute_run() int _pbcs = (inslow >> 27) & 0x1; int i2_0 = (inslow >> 24) & 0x7; - UINT16 data_in = 0; + uint16_t data_in = 0; debugger_instruction_hook(this, m_pc[prog]); @@ -1247,9 +1247,9 @@ void cquestlin_cpu_device::execute_run() if (_BIT(m_fglatch, 4) && (m_ycnt < 256)) { /* 20-bit words */ - UINT32 data; - UINT16 h = m_xcnt; - UINT8 v = m_ycnt & 0xff; + uint32_t data; + uint16_t h = m_xcnt; + uint8_t v = m_ycnt & 0xff; /* Clamp H between 0 and 319 */ if (h >= 320) @@ -1282,12 +1282,12 @@ void cquestlin_cpu_device::execute_run() /* Now do the ALU operation */ { - UINT16 r = 0; - UINT16 s = 0; + uint16_t r = 0; + uint16_t s = 0; - UINT16 res = 0; - UINT32 cflag = 0; - UINT32 vflag = 0; + uint16_t res = 0; + uint32_t cflag = 0; + uint32_t vflag = 0; /* Determine the ALU sources */ switch (i2_0) @@ -1364,8 +1364,8 @@ void cquestlin_cpu_device::execute_run() break; case RAMQD: { - UINT16 r11 = (BIT(m_f, 11) ^ m_vflag) ? 0x800 : 0; - UINT16 q11 = (prog == BACKGROUND) ? 0x800 : 0; + uint16_t r11 = (BIT(m_f, 11) ^ m_vflag) ? 0x800 : 0; + uint16_t q11 = (prog == BACKGROUND) ? 0x800 : 0; m_ram[b] = r11 | (m_f >> 1); m_q = q11 | (m_q >> 1); @@ -1374,7 +1374,7 @@ void cquestlin_cpu_device::execute_run() } case RAMD: { - UINT16 r11 = (BIT(m_f, 11) ^ m_vflag) ? 0x800 : 0; + uint16_t r11 = (BIT(m_f, 11) ^ m_vflag) ? 0x800 : 0; m_ram[b] = r11 | (m_f >> 1); m_y = m_f; @@ -1383,7 +1383,7 @@ void cquestlin_cpu_device::execute_run() case RAMQU: { /* Determine shift inputs */ - UINT16 r0 = (prog == BACKGROUND); + uint16_t r0 = (prog == BACKGROUND); /* This should never happen - Q0 will be invalid */ m_ram[b] = (m_f << 1) | r0; @@ -1393,7 +1393,7 @@ void cquestlin_cpu_device::execute_run() } case RAMU: { - UINT16 r0 = (prog == BACKGROUND); + uint16_t r0 = (prog == BACKGROUND); m_ram[b] = (m_f << 1) | r0; m_y = m_f; diff --git a/src/devices/cpu/cubeqcpu/cubeqcpu.h b/src/devices/cpu/cubeqcpu/cubeqcpu.h index 23bfbf84f5b..824ec9c29b1 100644 --- a/src/devices/cpu/cubeqcpu/cubeqcpu.h +++ b/src/devices/cpu/cubeqcpu/cubeqcpu.h @@ -140,7 +140,7 @@ class cquestsnd_cpu_device : public cpu_device { public: // construction/destruction - cquestsnd_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cquestsnd_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_dac_w(device_t &device, _Object object) { return downcast(device).m_dac_w.set_callback(object); } @@ -155,46 +155,46 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : nullptr; } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 8; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 8; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; /* AM2901 internals */ - UINT16 m_ram[16]; - UINT16 m_q; - UINT16 m_f; - UINT16 m_y; - UINT32 m_cflag; - UINT32 m_vflag; - - UINT8 m_pc; /* 2 x LS161 @ 6E, 6F */ - UINT16 m_platch; - UINT8 m_rtnlatch; /* LS374 @ 5F */ - UINT8 m_adrcntr; /* 2 x LS161 */ - UINT16 m_adrlatch; - UINT16 m_dinlatch; - UINT16 m_ramwlatch; - - UINT16 m_sram[4096/2]; + uint16_t m_ram[16]; + uint16_t m_q; + uint16_t m_f; + uint16_t m_y; + uint32_t m_cflag; + uint32_t m_vflag; + + uint8_t m_pc; /* 2 x LS161 @ 6E, 6F */ + uint16_t m_platch; + uint8_t m_rtnlatch; /* LS374 @ 5F */ + uint8_t m_adrcntr; /* 2 x LS161 */ + uint16_t m_adrlatch; + uint16_t m_dinlatch; + uint16_t m_ramwlatch; + + uint16_t m_sram[4096/2]; int m_prev_ipram; int m_prev_ipwrt; devcb_write16 m_dac_w; const char *m_sound_region_tag; - UINT16 *m_sound_data; + uint16_t *m_sound_data; address_space *m_program; direct_read_data *m_direct; @@ -208,7 +208,7 @@ class cquestrot_cpu_device : public cpu_device { public: // construction/destruction - cquestrot_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cquestrot_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_linedata_w(device_t &device, _Object object) { return downcast(device).m_linedata_w.set_callback(object); } @@ -223,9 +223,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -235,52 +235,52 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 8; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 8; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; devcb_write16 m_linedata_w; /* AM2901 internals */ - UINT16 m_ram[16]; - UINT16 m_q; - UINT16 m_f; - UINT16 m_y; - UINT32 m_cflag; - UINT32 m_vflag; - - UINT16 m_pc; /* 12-bit, but only 9 used */ - UINT8 m_seqcnt; /* 4-bit counter */ - - UINT8 m_dsrclatch; - UINT8 m_rsrclatch; - UINT16 m_dynaddr; /* LS374 at 2D, 8D */ - UINT16 m_dyndata; /* LS374 at 10B, 9B */ - UINT16 m_yrlatch; /* LS374 at 9D, 10D */ - UINT16 m_ydlatch; /* LS374 at 9C, 10C */ - UINT16 m_dinlatch; - UINT8 m_divreg; /* LS74 at ? */ - - UINT16 m_linedata; - UINT16 m_lineaddr; - - UINT16 m_dram[16384]; /* Shared with 68000 */ - UINT16 m_sram[2048]; /* Private */ - - UINT8 m_prev_dred; - UINT8 m_prev_dwrt; - UINT8 m_wc; - UINT8 m_rc; - UINT8 m_clkcnt; + uint16_t m_ram[16]; + uint16_t m_q; + uint16_t m_f; + uint16_t m_y; + uint32_t m_cflag; + uint32_t m_vflag; + + uint16_t m_pc; /* 12-bit, but only 9 used */ + uint8_t m_seqcnt; /* 4-bit counter */ + + uint8_t m_dsrclatch; + uint8_t m_rsrclatch; + uint16_t m_dynaddr; /* LS374 at 2D, 8D */ + uint16_t m_dyndata; /* LS374 at 10B, 9B */ + uint16_t m_yrlatch; /* LS374 at 9D, 10D */ + uint16_t m_ydlatch; /* LS374 at 9C, 10C */ + uint16_t m_dinlatch; + uint8_t m_divreg; /* LS74 at ? */ + + uint16_t m_linedata; + uint16_t m_lineaddr; + + uint16_t m_dram[16384]; /* Shared with 68000 */ + uint16_t m_sram[2048]; /* Private */ + + uint8_t m_prev_dred; + uint8_t m_prev_dwrt; + uint8_t m_wc; + uint8_t m_rc; + uint8_t m_clkcnt; address_space *m_program; direct_read_data *m_direct; int m_icount; // For the debugger - UINT8 m_flags; + uint8_t m_flags; int do_rotjmp(int jmp); }; @@ -290,7 +290,7 @@ class cquestlin_cpu_device : public cpu_device { public: // construction/destruction - cquestlin_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cquestlin_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_linedata_r(device_t &device, _Object object) { return downcast(device).m_linedata_r.set_callback(object); } @@ -298,8 +298,8 @@ public: DECLARE_WRITE16_MEMBER( linedata_w ); void cubeqcpu_swap_line_banks(); void cubeqcpu_clear_stack(); - UINT8 cubeqcpu_get_ptr_ram_val(int i); - UINT32* cubeqcpu_get_stack_ram(); + uint8_t cubeqcpu_get_ptr_ram_val(int i); + uint32_t* cubeqcpu_get_stack_ram(); protected: // device-level overrides @@ -307,9 +307,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -319,58 +319,58 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 8; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 8; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; devcb_read16 m_linedata_r; /* 12-bit AM2901 internals */ - UINT16 m_ram[16]; - UINT16 m_q; - UINT16 m_f; - UINT16 m_y; - UINT32 m_cflag; - UINT32 m_vflag; + uint16_t m_ram[16]; + uint16_t m_q; + uint16_t m_f; + uint16_t m_y; + uint32_t m_cflag; + uint32_t m_vflag; - UINT8 m_pc[2]; /* Two program counters; one for FG, other for BG */ + uint8_t m_pc[2]; /* Two program counters; one for FG, other for BG */ - UINT16 m_seqcnt; /* 12-bit */ - UINT16 m_clatch; /* LS374 at 9E and 1-bit FF */ - UINT8 m_zlatch; /* LS374 at 4H */ + uint16_t m_seqcnt; /* 12-bit */ + uint16_t m_clatch; /* LS374 at 9E and 1-bit FF */ + uint8_t m_zlatch; /* LS374 at 4H */ - UINT16 m_xcnt; - UINT16 m_ycnt; - UINT8 m_sreg; + uint16_t m_xcnt; + uint16_t m_ycnt; + uint8_t m_sreg; - UINT16 m_fadlatch; - UINT16 m_badlatch; + uint16_t m_fadlatch; + uint16_t m_badlatch; - UINT16 m_sramdlatch; + uint16_t m_sramdlatch; - UINT8 m_fglatch; - UINT8 m_bglatch; - UINT8 m_gt0reg; - UINT8 m_fdxreg; - UINT32 m_field; + uint8_t m_fglatch; + uint8_t m_bglatch; + uint8_t m_gt0reg; + uint8_t m_fdxreg; + uint32_t m_field; - UINT32 m_clkcnt; + uint32_t m_clkcnt; /* RAM */ - UINT16 m_sram[4096]; /* Shared with rotate CPU */ - UINT8 m_ptr_ram[1024]; /* Pointer RAM */ - UINT32 m_e_stack[32768]; /* Stack DRAM: 32kx20 */ - UINT32 m_o_stack[32768]; /* Stack DRAM: 32kx20 */ + uint16_t m_sram[4096]; /* Shared with rotate CPU */ + uint8_t m_ptr_ram[1024]; /* Pointer RAM */ + uint32_t m_e_stack[32768]; /* Stack DRAM: 32kx20 */ + uint32_t m_o_stack[32768]; /* Stack DRAM: 32kx20 */ address_space *m_program; direct_read_data *m_direct; int m_icount; // For the debugger - UINT8 m_flags; - UINT16 m_curpc; + uint8_t m_flags; + uint16_t m_curpc; int do_linjmp(int jmp); }; diff --git a/src/devices/cpu/drcbec.cpp b/src/devices/cpu/drcbec.cpp index a5437e8dfb1..6ad8085afd6 100644 --- a/src/devices/cpu/drcbec.cpp +++ b/src/devices/cpu/drcbec.cpp @@ -179,24 +179,24 @@ enum #define FDPARAM3 (*inst[3].pdouble) // compute C and V flags for 32-bit add/subtract -#define FLAGS32_C_ADD(a,b) ((UINT32)~(a) < (UINT32)(b)) -#define FLAGS32_C_SUB(a,b) ((UINT32)(b) > (UINT32)(a)) +#define FLAGS32_C_ADD(a,b) ((uint32_t)~(a) < (uint32_t)(b)) +#define FLAGS32_C_SUB(a,b) ((uint32_t)(b) > (uint32_t)(a)) #define FLAGS32_V_SUB(r,a,b) (((((a) ^ (b)) & ((a) ^ (r))) >> 30) & FLAG_V) #define FLAGS32_V_ADD(r,a,b) (((~((a) ^ (b)) & ((a) ^ (r))) >> 30) & FLAG_V) // compute N and Z flags for 32-bit operations -#define FLAGS32_NZ(v) ((((v) >> 28) & FLAG_S) | (((UINT32)(v) == 0) << 2)) +#define FLAGS32_NZ(v) ((((v) >> 28) & FLAG_S) | (((uint32_t)(v) == 0) << 2)) #define FLAGS32_NZCV_ADD(r,a,b) (FLAGS32_NZ(r) | FLAGS32_C_ADD(a,b) | FLAGS32_V_ADD(r,a,b)) #define FLAGS32_NZCV_SUB(r,a,b) (FLAGS32_NZ(r) | FLAGS32_C_SUB(a,b) | FLAGS32_V_SUB(r,a,b)) // compute C and V flags for 64-bit add/subtract -#define FLAGS64_C_ADD(a,b) ((UINT64)~(a) < (UINT64)(b)) -#define FLAGS64_C_SUB(a,b) ((UINT64)(b) > (UINT64)(a)) +#define FLAGS64_C_ADD(a,b) ((uint64_t)~(a) < (uint64_t)(b)) +#define FLAGS64_C_SUB(a,b) ((uint64_t)(b) > (uint64_t)(a)) #define FLAGS64_V_SUB(r,a,b) (((((a) ^ (b)) & ((a) ^ (r))) >> 62) & FLAG_V) #define FLAGS64_V_ADD(r,a,b) (((~((a) ^ (b)) & ((a) ^ (r))) >> 62) & FLAG_V) // compute N and Z flags for 64-bit operations -#define FLAGS64_NZ(v) ((((v) >> 60) & FLAG_S) | (((UINT64)(v) == 0) << 2)) +#define FLAGS64_NZ(v) ((((v) >> 60) & FLAG_S) | (((uint64_t)(v) == 0) << 2)) #define FLAGS64_NZCV_ADD(r,a,b) (FLAGS64_NZ(r) | FLAGS64_C_ADD(a,b) | FLAGS64_V_ADD(r,a,b)) #define FLAGS64_NZCV_SUB(r,a,b) (FLAGS64_NZ(r) | FLAGS64_C_SUB(a,b) | FLAGS64_V_SUB(r,a,b)) @@ -209,17 +209,17 @@ enum // union to simplify accessing data via the instruction stream union drcbec_instruction { - UINT32 i; + uint32_t i; void * v; char * c; - UINT8 * puint8; - INT8 * pint8; - UINT16 * puint16; - INT16 * pint16; - UINT32 * puint32; - INT32 * pint32; - UINT64 * puint64; - INT64 * pint64; + uint8_t * puint8; + int8_t * pint8; + uint16_t * puint16; + int16_t * pint16; + uint32_t * puint32; + int32_t * pint32; + uint64_t * puint64; + int64_t * pint64; float * pfloat; double * pdouble; void (*cfunc)(void *); @@ -235,9 +235,9 @@ union drcbec_instruction // GLOBAL VARIABLES //************************************************************************** -UINT64 drcbe_c::s_immediate_zero = 0; +uint64_t drcbe_c::s_immediate_zero = 0; -const UINT32 drcbe_c::s_condition_map[] = +const uint32_t drcbe_c::s_condition_map[] = { /* ..... */ NCBIT | NVBIT | NZBIT | NSBIT | NUBIT | ABIT | GBIT | GEBIT, /* ....C */ CBIT | NVBIT | NZBIT | NSBIT | NUBIT | BEBIT | GBIT | GEBIT, @@ -283,7 +283,7 @@ const UINT32 drcbe_c::s_condition_map[] = // drcbe_c - constructor //------------------------------------------------- -drcbe_c::drcbe_c(drcuml_state &drcuml, device_t &device, drc_cache &cache, UINT32 flags, int modes, int addrbits, int ignorebits) +drcbe_c::drcbe_c(drcuml_state &drcuml, device_t &device, drc_cache &cache, uint32_t flags, int modes, int addrbits, int ignorebits) : drcbe_interface(drcuml, cache, device), m_hash(cache, modes, addrbits, ignorebits), m_map(cache, 0), @@ -318,7 +318,7 @@ void drcbe_c::reset() // drcbec_generate - generate code //------------------------------------------------- -void drcbe_c::generate(drcuml_block &block, const instruction *instlist, UINT32 numinst) +void drcbe_c::generate(drcuml_block &block, const instruction *instlist, uint32_t numinst) { // tell all of our utility objects that a block is beginning m_hash.block_begin(block, instlist, numinst); @@ -338,7 +338,7 @@ void drcbe_c::generate(drcuml_block &block, const instruction *instlist, UINT32 for (int inum = 0; inum < numinst; inum++) { const instruction &inst = instlist[inum]; - UINT8 psize[instruction::MAX_PARAMS]; + uint8_t psize[instruction::MAX_PARAMS]; // handle most instructions generally, but a few special cases opcode_t opcode = inst.opcode(); @@ -464,7 +464,7 @@ void drcbe_c::generate(drcuml_block &block, const instruction *instlist, UINT32 // exists in the hash table //------------------------------------------------- -bool drcbe_c::hash_exists(UINT32 mode, UINT32 pc) +bool drcbe_c::hash_exists(uint32_t mode, uint32_t pc) { return m_hash.code_exists(mode, pc); } @@ -496,14 +496,14 @@ int drcbe_c::execute(code_handle &entry) // loop while we have cycles const drcbec_instruction *callstack[32]; const drcbec_instruction *newinst; - UINT32 temp32; - UINT64 temp64; + uint32_t temp32; + uint64_t temp64; int shift; - UINT8 flags = 0; - UINT8 sp = 0; + uint8_t flags = 0; + uint8_t sp = 0; while (true) { - UINT32 opcode = (inst++)->i; + uint32_t opcode = (inst++)->i; switch (OPCODE_GET_SHORT(opcode)) { @@ -646,19 +646,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOAD1x2, 4, 0): // LOAD dst,base,index,BYTE_x2 - PARAM0 = *(UINT8 *)&inst[1].puint16[PARAM2]; + PARAM0 = *(uint8_t *)&inst[1].puint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD1x4, 4, 0): // LOAD dst,base,index,BYTE_x4 - PARAM0 = *(UINT8 *)&inst[1].puint32[PARAM2]; + PARAM0 = *(uint8_t *)&inst[1].puint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD1x8, 4, 0): // LOAD dst,base,index,BYTE_x8 - PARAM0 = *(UINT8 *)&inst[1].puint64[PARAM2]; + PARAM0 = *(uint8_t *)&inst[1].puint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD2x1, 4, 0): // LOAD dst,base,index,WORD_x1 - PARAM0 = *(UINT16 *)&inst[1].puint8[PARAM2]; + PARAM0 = *(uint16_t *)&inst[1].puint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD2, 4, 0): // LOAD dst,base,index,WORD @@ -666,19 +666,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOAD2x4, 4, 0): // LOAD dst,base,index,WORD_x4 - PARAM0 = *(UINT16 *)&inst[1].puint32[PARAM2]; + PARAM0 = *(uint16_t *)&inst[1].puint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD2x8, 4, 0): // LOAD dst,base,index,WORD_x8 - PARAM0 = *(UINT16 *)&inst[1].puint64[PARAM2]; + PARAM0 = *(uint16_t *)&inst[1].puint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD4x1, 4, 0): // LOAD dst,base,index,DWORD_x1 - PARAM0 = *(UINT32 *)&inst[1].puint8[PARAM2]; + PARAM0 = *(uint32_t *)&inst[1].puint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD4x2, 4, 0): // LOAD dst,base,index,DWORD_x2 - PARAM0 = *(UINT32 *)&inst[1].puint16[PARAM2]; + PARAM0 = *(uint32_t *)&inst[1].puint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD4, 4, 0): // LOAD dst,base,index,DWORD @@ -686,7 +686,7 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOAD4x8, 4, 0): // LOAD dst,base,index,DWORD_x8 - PARAM0 = *(UINT32 *)&inst[1].puint64[PARAM2]; + PARAM0 = *(uint32_t *)&inst[1].puint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS1, 4, 0): // LOADS dst,base,index,BYTE @@ -694,19 +694,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOADS1x2, 4, 0): // LOADS dst,base,index,BYTE_x2 - PARAM0 = *(INT8 *)&inst[1].pint16[PARAM2]; + PARAM0 = *(int8_t *)&inst[1].pint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS1x4, 4, 0): // LOADS dst,base,index,BYTE_x4 - PARAM0 = *(INT8 *)&inst[1].pint32[PARAM2]; + PARAM0 = *(int8_t *)&inst[1].pint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS1x8, 4, 0): // LOADS dst,base,index,BYTE_x8 - PARAM0 = *(INT8 *)&inst[1].pint64[PARAM2]; + PARAM0 = *(int8_t *)&inst[1].pint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS2x1, 4, 0): // LOADS dst,base,index,WORD_x1 - PARAM0 = *(INT16 *)&inst[1].pint8[PARAM2]; + PARAM0 = *(int16_t *)&inst[1].pint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS2, 4, 0): // LOADS dst,base,index,WORD @@ -714,19 +714,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOADS2x4, 4, 0): // LOADS dst,base,index,WORD_x4 - PARAM0 = *(INT16 *)&inst[1].pint32[PARAM2]; + PARAM0 = *(int16_t *)&inst[1].pint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS2x8, 4, 0): // LOADS dst,base,index,WORD_x8 - PARAM0 = *(INT16 *)&inst[1].pint64[PARAM2]; + PARAM0 = *(int16_t *)&inst[1].pint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS4x1, 4, 0): // LOADS dst,base,index,DWORD_x1 - PARAM0 = *(INT32 *)&inst[1].pint8[PARAM2]; + PARAM0 = *(int32_t *)&inst[1].pint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS4x2, 4, 0): // LOADS dst,base,index,DWORD_x2 - PARAM0 = *(INT32 *)&inst[1].pint16[PARAM2]; + PARAM0 = *(int32_t *)&inst[1].pint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS4, 4, 0): // LOADS dst,base,index,DWORD @@ -734,7 +734,7 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOADS4x8, 4, 0): // LOADS dst,base,index,DWORD_x8 - PARAM0 = *(INT32 *)&inst[1].pint64[PARAM2]; + PARAM0 = *(int32_t *)&inst[1].pint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_STORE1, 4, 0): // STORE dst,base,index,BYTE @@ -742,19 +742,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_STORE1x2, 4, 0): // STORE dst,base,index,BYTE_x2 - *(UINT8 *)&inst[0].puint16[PARAM1] = PARAM2; + *(uint8_t *)&inst[0].puint16[PARAM1] = PARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE1x4, 4, 0): // STORE dst,base,index,BYTE_x4 - *(UINT8 *)&inst[0].puint32[PARAM1] = PARAM2; + *(uint8_t *)&inst[0].puint32[PARAM1] = PARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE1x8, 4, 0): // STORE dst,base,index,BYTE_x8 - *(UINT8 *)&inst[0].puint64[PARAM1] = PARAM2; + *(uint8_t *)&inst[0].puint64[PARAM1] = PARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE2x1, 4, 0): // STORE dst,base,index,WORD_x1 - *(UINT16 *)&inst[0].puint8[PARAM1] = PARAM2; + *(uint16_t *)&inst[0].puint8[PARAM1] = PARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE2, 4, 0): // STORE dst,base,index,WORD @@ -762,19 +762,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_STORE2x4, 4, 0): // STORE dst,base,index,WORD_x4 - *(UINT16 *)&inst[0].puint32[PARAM1] = PARAM2; + *(uint16_t *)&inst[0].puint32[PARAM1] = PARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE2x8, 4, 0): // STORE dst,base,index,WORD_x8 - *(UINT16 *)&inst[0].puint64[PARAM1] = PARAM2; + *(uint16_t *)&inst[0].puint64[PARAM1] = PARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE4x1, 4, 0): // STORE dst,base,index,DWORD_x1 - *(UINT32 *)&inst[0].puint8[PARAM1] = PARAM2; + *(uint32_t *)&inst[0].puint8[PARAM1] = PARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE4x2, 4, 0): // STORE dst,base,index,DWORD_x2 - *(UINT32 *)&inst[0].puint16[PARAM1] = PARAM2; + *(uint32_t *)&inst[0].puint16[PARAM1] = PARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE4, 4, 0): // STORE dst,base,index,DWORD @@ -782,7 +782,7 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_STORE4x8, 4, 0): // STORE dst,base,index,DWORD_x8 - *(UINT32 *)&inst[0].puint64[PARAM1] = PARAM2; + *(uint32_t *)&inst[0].puint64[PARAM1] = PARAM2; break; case MAKE_OPCODE_SHORT(OP_READ1, 4, 0): // READ dst,src1,space_BYTE @@ -843,21 +843,21 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_SEXT1, 4, 0): // SEXT1 dst,src - PARAM0 = (INT8)PARAM1; + PARAM0 = (int8_t)PARAM1; break; case MAKE_OPCODE_SHORT(OP_SEXT1, 4, 1): - temp32 = (INT8)PARAM1; + temp32 = (int8_t)PARAM1; flags = FLAGS32_NZ(temp32); PARAM0 = temp32; break; case MAKE_OPCODE_SHORT(OP_SEXT2, 4, 0): // SEXT2 dst,src - PARAM0 = (INT16)PARAM1; + PARAM0 = (int16_t)PARAM1; break; case MAKE_OPCODE_SHORT(OP_SEXT2, 4, 1): - temp32 = (INT16)PARAM1; + temp32 = (int16_t)PARAM1; flags = FLAGS32_NZ(temp32); PARAM0 = temp32; break; @@ -933,7 +933,7 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_SUBB, 4, 1): temp32 = PARAM1 - PARAM2 - (flags & FLAG_C); - temp64 = (UINT64)PARAM1 - (UINT64)PARAM2 - (UINT64)(flags & FLAG_C); + temp64 = (uint64_t)PARAM1 - (uint64_t)PARAM2 - (uint64_t)(flags & FLAG_C); if (PARAM2 + 1 != 0) flags = FLAGS32_NZCV_SUB(temp32, PARAM1, PARAM2 + (flags & FLAG_C)); else @@ -953,41 +953,41 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_MULU, 4, 0): // MULU dst,edst,src1,src2[,f] - temp64 = (UINT64)(UINT32)PARAM2 * (UINT64)(UINT32)PARAM3; + temp64 = (uint64_t)(uint32_t)PARAM2 * (uint64_t)(uint32_t)PARAM3; PARAM1 = temp64 >> 32; - PARAM0 = (UINT32)temp64; + PARAM0 = (uint32_t)temp64; break; case MAKE_OPCODE_SHORT(OP_MULU, 4, 1): - temp64 = (UINT64)(UINT32)PARAM2 * (UINT64)(UINT32)PARAM3; + temp64 = (uint64_t)(uint32_t)PARAM2 * (uint64_t)(uint32_t)PARAM3; flags = FLAGS64_NZ(temp64); PARAM1 = temp64 >> 32; - PARAM0 = (UINT32)temp64; - if (temp64 != (UINT32)temp64) + PARAM0 = (uint32_t)temp64; + if (temp64 != (uint32_t)temp64) flags |= FLAG_V; break; case MAKE_OPCODE_SHORT(OP_MULS, 4, 0): // MULS dst,edst,src1,src2[,f] - temp64 = (INT64)(INT32)PARAM2 * (INT64)(INT32)PARAM3; + temp64 = (int64_t)(int32_t)PARAM2 * (int64_t)(int32_t)PARAM3; PARAM1 = temp64 >> 32; - PARAM0 = (UINT32)temp64; + PARAM0 = (uint32_t)temp64; break; case MAKE_OPCODE_SHORT(OP_MULS, 4, 1): - temp64 = (INT64)(INT32)PARAM2 * (INT64)(INT32)PARAM3; - temp32 = (INT32)temp64; + temp64 = (int64_t)(int32_t)PARAM2 * (int64_t)(int32_t)PARAM3; + temp32 = (int32_t)temp64; flags = FLAGS32_NZ(temp32); PARAM1 = temp64 >> 32; - PARAM0 = (UINT32)temp64; - if (temp64 != (INT32)temp64) + PARAM0 = (uint32_t)temp64; + if (temp64 != (int32_t)temp64) flags |= FLAG_V; break; case MAKE_OPCODE_SHORT(OP_DIVU, 4, 0): // DIVU dst,edst,src1,src2[,f] if (PARAM3 != 0) { - temp32 = (UINT32)PARAM2 / (UINT32)PARAM3; - PARAM1 = (UINT32)PARAM2 % (UINT32)PARAM3; + temp32 = (uint32_t)PARAM2 / (uint32_t)PARAM3; + PARAM1 = (uint32_t)PARAM2 % (uint32_t)PARAM3; PARAM0 = temp32; } break; @@ -995,8 +995,8 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_DIVU, 4, 1): if (PARAM3 != 0) { - temp32 = (UINT32)PARAM2 / (UINT32)PARAM3; - PARAM1 = (UINT32)PARAM2 % (UINT32)PARAM3; + temp32 = (uint32_t)PARAM2 / (uint32_t)PARAM3; + PARAM1 = (uint32_t)PARAM2 % (uint32_t)PARAM3; flags = FLAGS32_NZ(temp32); PARAM0 = temp32; } @@ -1007,8 +1007,8 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_DIVS, 4, 0): // DIVS dst,edst,src1,src2[,f] if (PARAM3 != 0) { - temp32 = (INT32)PARAM2 / (INT32)PARAM3; - PARAM1 = (INT32)PARAM2 % (INT32)PARAM3; + temp32 = (int32_t)PARAM2 / (int32_t)PARAM3; + PARAM1 = (int32_t)PARAM2 % (int32_t)PARAM3; PARAM0 = temp32; } break; @@ -1016,8 +1016,8 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_DIVS, 4, 1): if (PARAM3 != 0) { - temp32 = (INT32)PARAM2 / (INT32)PARAM3; - PARAM1 = (INT32)PARAM2 % (INT32)PARAM3; + temp32 = (int32_t)PARAM2 / (int32_t)PARAM3; + PARAM1 = (int32_t)PARAM2 % (int32_t)PARAM3; flags = FLAGS32_NZ(temp32); PARAM0 = temp32; } @@ -1122,12 +1122,12 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_SAR, 4, 0): // SAR dst,src,count[,f] - PARAM0 = (INT32)PARAM1 >> (PARAM2 & 31); + PARAM0 = (int32_t)PARAM1 >> (PARAM2 & 31); break; case MAKE_OPCODE_SHORT(OP_SAR, 4, 1): shift = PARAM2 & 31; - temp32 = (INT32)PARAM1 >> shift; + temp32 = (int32_t)PARAM1 >> shift; if (shift != 0) { flags = FLAGS32_NZ(temp32); @@ -1215,19 +1215,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOAD1x2, 8, 0): // DLOAD dst,base,index,BYTE_x2 - DPARAM0 = *(UINT8 *)&inst[1].puint16[PARAM2]; + DPARAM0 = *(uint8_t *)&inst[1].puint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD1x4, 8, 0): // DLOAD dst,base,index,BYTE_x4 - DPARAM0 = *(UINT8 *)&inst[1].puint32[PARAM2]; + DPARAM0 = *(uint8_t *)&inst[1].puint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD1x8, 8, 0): // DLOAD dst,base,index,BYTE_x8 - DPARAM0 = *(UINT8 *)&inst[1].puint64[PARAM2]; + DPARAM0 = *(uint8_t *)&inst[1].puint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD2x1, 8, 0): // DLOAD dst,base,index,WORD_x1 - DPARAM0 = *(UINT16 *)&inst[1].puint8[PARAM2]; + DPARAM0 = *(uint16_t *)&inst[1].puint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD2, 8, 0): // DLOAD dst,base,index,WORD @@ -1235,19 +1235,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOAD2x4, 8, 0): // DLOAD dst,base,index,WORD_x4 - DPARAM0 = *(UINT16 *)&inst[1].puint32[PARAM2]; + DPARAM0 = *(uint16_t *)&inst[1].puint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD2x8, 8, 0): // DLOAD dst,base,index,WORD_x8 - DPARAM0 = *(UINT16 *)&inst[1].puint64[PARAM2]; + DPARAM0 = *(uint16_t *)&inst[1].puint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD4x1, 8, 0): // DLOAD dst,base,index,DWORD_x1 - DPARAM0 = *(UINT32 *)&inst[1].puint8[PARAM2]; + DPARAM0 = *(uint32_t *)&inst[1].puint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD4x2, 8, 0): // DLOAD dst,base,index,DWORD_x2 - DPARAM0 = *(UINT32 *)&inst[1].puint16[PARAM2]; + DPARAM0 = *(uint32_t *)&inst[1].puint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD4, 8, 0): // DLOAD dst,base,index,DWORD @@ -1255,19 +1255,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOAD4x8, 8, 0): // DLOAD dst,base,index,DWORD_x8 - DPARAM0 = *(UINT32 *)&inst[1].puint64[PARAM2]; + DPARAM0 = *(uint32_t *)&inst[1].puint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD8x1, 8, 0): // DLOAD dst,base,index,QWORD_x1 - DPARAM0 = *(UINT64 *)&inst[1].puint8[PARAM2]; + DPARAM0 = *(uint64_t *)&inst[1].puint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD8x2, 8, 0): // DLOAD dst,base,index,QWORD_x2 - DPARAM0 = *(UINT64 *)&inst[1].puint16[PARAM2]; + DPARAM0 = *(uint64_t *)&inst[1].puint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD8x4, 8, 0): // DLOAD dst,base,index,QWORD_x4 - DPARAM0 = *(UINT64 *)&inst[1].puint32[PARAM2]; + DPARAM0 = *(uint64_t *)&inst[1].puint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOAD8, 8, 0): // DLOAD dst,base,index,QWORD @@ -1279,19 +1279,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOADS1x2, 8, 0): // DLOADS dst,base,index,BYTE_x2 - DPARAM0 = *(INT8 *)&inst[1].pint16[PARAM2]; + DPARAM0 = *(int8_t *)&inst[1].pint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS1x4, 8, 0): // DLOADS dst,base,index,BYTE_x4 - DPARAM0 = *(INT8 *)&inst[1].pint32[PARAM2]; + DPARAM0 = *(int8_t *)&inst[1].pint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS1x8, 8, 0): // DLOADS dst,base,index,BYTE_x8 - DPARAM0 = *(INT8 *)&inst[1].pint64[PARAM2]; + DPARAM0 = *(int8_t *)&inst[1].pint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS2x1, 8, 0): // DLOADS dst,base,index,WORD_x1 - DPARAM0 = *(INT16 *)&inst[1].pint8[PARAM2]; + DPARAM0 = *(int16_t *)&inst[1].pint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS2, 8, 0): // DLOADS dst,base,index,WORD @@ -1299,19 +1299,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOADS2x4, 8, 0): // DLOADS dst,base,index,WORD_x4 - DPARAM0 = *(INT16 *)&inst[1].pint32[PARAM2]; + DPARAM0 = *(int16_t *)&inst[1].pint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS2x8, 8, 0): // DLOADS dst,base,index,WORD_x8 - DPARAM0 = *(INT16 *)&inst[1].pint64[PARAM2]; + DPARAM0 = *(int16_t *)&inst[1].pint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS4x1, 8, 0): // DLOADS dst,base,index,DWORD_x1 - DPARAM0 = *(INT32 *)&inst[1].pint8[PARAM2]; + DPARAM0 = *(int32_t *)&inst[1].pint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS4x2, 8, 0): // DLOADS dst,base,index,DWORD_x2 - DPARAM0 = *(INT32 *)&inst[1].pint16[PARAM2]; + DPARAM0 = *(int32_t *)&inst[1].pint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS4, 8, 0): // DLOADS dst,base,index,DWORD @@ -1319,19 +1319,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LOADS4x8, 8, 0): // DLOADS dst,base,index,DWORD_x8 - DPARAM0 = *(INT32 *)&inst[1].pint64[PARAM2]; + DPARAM0 = *(int32_t *)&inst[1].pint64[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS8x1, 8, 0): // DLOADS dst,base,index,QWORD_x1 - DPARAM0 = *(INT64 *)&inst[1].pint8[PARAM2]; + DPARAM0 = *(int64_t *)&inst[1].pint8[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS8x2, 8, 0): // DLOADS dst,base,index,QWORD_x2 - DPARAM0 = *(INT64 *)&inst[1].pint16[PARAM2]; + DPARAM0 = *(int64_t *)&inst[1].pint16[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS8x4, 8, 0): // DLOADS dst,base,index,QWORD_x4 - DPARAM0 = *(INT64 *)&inst[1].pint32[PARAM2]; + DPARAM0 = *(int64_t *)&inst[1].pint32[PARAM2]; break; case MAKE_OPCODE_SHORT(OP_LOADS8, 8, 0): // DLOADS dst,base,index,QWORD @@ -1343,19 +1343,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_STORE1x2, 8, 0): // DSTORE dst,base,index,BYTE_x2 - *(UINT8 *)&inst[0].puint16[PARAM1] = DPARAM2; + *(uint8_t *)&inst[0].puint16[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE1x4, 8, 0): // DSTORE dst,base,index,BYTE_x4 - *(UINT8 *)&inst[0].puint32[PARAM1] = DPARAM2; + *(uint8_t *)&inst[0].puint32[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE1x8, 8, 0): // DSTORE dst,base,index,BYTE_x8 - *(UINT8 *)&inst[0].puint64[PARAM1] = DPARAM2; + *(uint8_t *)&inst[0].puint64[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE2x1, 8, 0): // DSTORE dst,base,index,WORD_x1 - *(UINT16 *)&inst[0].puint8[PARAM1] = DPARAM2; + *(uint16_t *)&inst[0].puint8[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE2, 8, 0): // DSTORE dst,base,index,WORD @@ -1363,19 +1363,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_STORE2x4, 8, 0): // DSTORE dst,base,index,WORD_x4 - *(UINT16 *)&inst[0].puint32[PARAM1] = DPARAM2; + *(uint16_t *)&inst[0].puint32[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE2x8, 8, 0): // DSTORE dst,base,index,WORD_x8 - *(UINT16 *)&inst[0].puint64[PARAM1] = DPARAM2; + *(uint16_t *)&inst[0].puint64[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE4x1, 8, 0): // DSTORE dst,base,index,DWORD_x1 - *(UINT32 *)&inst[0].puint8[PARAM1] = DPARAM2; + *(uint32_t *)&inst[0].puint8[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE4x2, 8, 0): // DSTORE dst,base,index,DWORD_x2 - *(UINT32 *)&inst[0].puint16[PARAM1] = DPARAM2; + *(uint32_t *)&inst[0].puint16[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE4, 8, 0): // DSTORE dst,base,index,DWORD @@ -1383,19 +1383,19 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_STORE4x8, 8, 0): // DSTORE dst,base,index,DWORD_x8 - *(UINT32 *)&inst[0].puint64[PARAM1] = DPARAM2; + *(uint32_t *)&inst[0].puint64[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE8x1, 8, 0): // DSTORE dst,base,index,QWORD_x1 - *(UINT64 *)&inst[0].puint8[PARAM1] = DPARAM2; + *(uint64_t *)&inst[0].puint8[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE8x2, 8, 0): // DSTORE dst,base,index,QWORD_x2 - *(UINT64 *)&inst[0].puint16[PARAM1] = DPARAM2; + *(uint64_t *)&inst[0].puint16[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE8x4, 8, 0): // DSTORE dst,base,index,QWORD_x4 - *(UINT64 *)&inst[0].puint32[PARAM1] = DPARAM2; + *(uint64_t *)&inst[0].puint32[PARAM1] = DPARAM2; break; case MAKE_OPCODE_SHORT(OP_STORE8, 8, 0): // DSTORE dst,base,index,QWORD @@ -1476,31 +1476,31 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_SEXT1, 8, 0): // DSEXT dst,src,BYTE - DPARAM0 = (INT8)PARAM1; + DPARAM0 = (int8_t)PARAM1; break; case MAKE_OPCODE_SHORT(OP_SEXT1, 8, 1): - temp64 = (INT8)PARAM1; + temp64 = (int8_t)PARAM1; flags = FLAGS64_NZ(temp64); DPARAM0 = temp64; break; case MAKE_OPCODE_SHORT(OP_SEXT2, 8, 0): // DSEXT dst,src,WORD - DPARAM0 = (INT16)PARAM1; + DPARAM0 = (int16_t)PARAM1; break; case MAKE_OPCODE_SHORT(OP_SEXT2, 8, 1): - temp64 = (INT16)PARAM1; + temp64 = (int16_t)PARAM1; flags = FLAGS64_NZ(temp64); DPARAM0 = temp64; break; case MAKE_OPCODE_SHORT(OP_SEXT4, 8, 0): // DSEXT dst,src,DWORD - DPARAM0 = (INT32)PARAM1; + DPARAM0 = (int32_t)PARAM1; break; case MAKE_OPCODE_SHORT(OP_SEXT4, 8, 1): - temp64 = (INT32)PARAM1; + temp64 = (int32_t)PARAM1; flags = FLAGS64_NZ(temp64); DPARAM0 = temp64; break; @@ -1599,8 +1599,8 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_DIVU, 8, 0): // DDIVU dst,edst,src1,src2[,f] if (DPARAM3 != 0) { - temp64 = (UINT64)DPARAM2 / (UINT64)DPARAM3; - DPARAM1 = (UINT64)DPARAM2 % (UINT64)DPARAM3; + temp64 = (uint64_t)DPARAM2 / (uint64_t)DPARAM3; + DPARAM1 = (uint64_t)DPARAM2 % (uint64_t)DPARAM3; DPARAM0 = temp64; } break; @@ -1608,8 +1608,8 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_DIVU, 8, 1): if (DPARAM3 != 0) { - temp64 = (UINT64)DPARAM2 / (UINT64)DPARAM3; - DPARAM1 = (UINT64)DPARAM2 % (UINT64)DPARAM3; + temp64 = (uint64_t)DPARAM2 / (uint64_t)DPARAM3; + DPARAM1 = (uint64_t)DPARAM2 % (uint64_t)DPARAM3; flags = FLAGS64_NZ(temp64); DPARAM0 = temp64; } @@ -1620,8 +1620,8 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_DIVS, 8, 0): // DDIVS dst,edst,src1,src2[,f] if (DPARAM3 != 0) { - temp64 = (INT64)DPARAM2 / (INT64)DPARAM3; - DPARAM1 = (INT64)DPARAM2 % (INT64)DPARAM3; + temp64 = (int64_t)DPARAM2 / (int64_t)DPARAM3; + DPARAM1 = (int64_t)DPARAM2 % (int64_t)DPARAM3; DPARAM0 = temp64; } break; @@ -1629,8 +1629,8 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_DIVS, 8, 1): if (DPARAM3 != 0) { - temp64 = (INT64)DPARAM2 / (INT64)DPARAM3; - DPARAM1 = (INT64)DPARAM2 % (INT64)DPARAM3; + temp64 = (int64_t)DPARAM2 / (int64_t)DPARAM3; + DPARAM1 = (int64_t)DPARAM2 % (int64_t)DPARAM3; flags = FLAGS64_NZ(temp64); DPARAM0 = temp64; } @@ -1674,14 +1674,14 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_LZCNT, 8, 0): // DLZCNT dst,src - if ((UINT32)(DPARAM1 >> 32) != 0) + if ((uint32_t)(DPARAM1 >> 32) != 0) DPARAM0 = count_leading_zeros(DPARAM1 >> 32); else DPARAM0 = 32 + count_leading_zeros(DPARAM1); break; case MAKE_OPCODE_SHORT(OP_LZCNT, 8, 1): - if ((UINT32)(DPARAM1 >> 32) != 0) + if ((uint32_t)(DPARAM1 >> 32) != 0) temp64 = count_leading_zeros(DPARAM1 >> 32); else temp64 = 32 + count_leading_zeros(DPARAM1); @@ -1735,12 +1735,12 @@ int drcbe_c::execute(code_handle &entry) break; case MAKE_OPCODE_SHORT(OP_SAR, 8, 0): // DSAR dst,src,count[,f] - DPARAM0 = (INT64)DPARAM1 >> (DPARAM2 & 63); + DPARAM0 = (int64_t)DPARAM1 >> (DPARAM2 & 63); break; case MAKE_OPCODE_SHORT(OP_SAR, 8, 1): shift = DPARAM2 & 63; - temp64 = (INT32)DPARAM1 >> shift; + temp64 = (int32_t)DPARAM1 >> shift; flags = FLAGS64_NZ(temp64); if (shift != 0) flags |= (DPARAM1 >> (shift - 1)) & FLAG_C; DPARAM0 = temp64; @@ -1796,17 +1796,17 @@ int drcbe_c::execute(code_handle &entry) case MAKE_OPCODE_SHORT(OP_RORC, 8, 0): // DRORC dst,src,count[,f] shift = DPARAM2 & 63; if (shift > 1) - DPARAM0 = (DPARAM1 >> shift) | ((((UINT64)flags & FLAG_C) << 63) >> (shift - 1)) | (DPARAM1 << (65 - shift)); + DPARAM0 = (DPARAM1 >> shift) | ((((uint64_t)flags & FLAG_C) << 63) >> (shift - 1)) | (DPARAM1 << (65 - shift)); else if (shift == 1) - DPARAM0 = (DPARAM1 >> shift) | (((UINT64)flags & FLAG_C) << 63); + DPARAM0 = (DPARAM1 >> shift) | (((uint64_t)flags & FLAG_C) << 63); break; case MAKE_OPCODE_SHORT(OP_RORC, 8, 1): shift = DPARAM2 & 63; if (shift > 1) - temp64 = (DPARAM1 >> shift) | ((((UINT64)flags & FLAG_C) << 63) >> (shift - 1)) | (DPARAM1 << (65 - shift)); + temp64 = (DPARAM1 >> shift) | ((((uint64_t)flags & FLAG_C) << 63) >> (shift - 1)) | (DPARAM1 << (65 - shift)); else if (shift == 1) - temp64 = (DPARAM1 >> shift) | (((UINT64)flags & FLAG_C) << 63); + temp64 = (DPARAM1 >> shift) | (((uint64_t)flags & FLAG_C) << 63); else temp64 = DPARAM1; flags = FLAGS64_NZ(temp64); @@ -2137,10 +2137,10 @@ void drcbe_c::output_parameter(drcbec_instruction **dstptr, void **immedptr, int { (dst++)->v = immed; if (size == 4) - *(UINT32 *)immed = (UINT32)param.immediate(); + *(uint32_t *)immed = (uint32_t)param.immediate(); else - *(UINT64 *)immed = (UINT64)param.immediate(); - immed = (UINT8 *)immed + size; + *(uint64_t *)immed = (uint64_t)param.immediate(); + immed = (uint8_t *)immed + size; } break; @@ -2188,7 +2188,7 @@ void drcbe_c::output_parameter(drcbec_instruction **dstptr, void **immedptr, int // code label just contains the label value case parameter::PTYPE_CODE_LABEL: - return output_parameter(dstptr, immedptr, size, UINT32(param.label())); + return output_parameter(dstptr, immedptr, size, uint32_t(param.label())); // c_function just points to the C function case parameter::PTYPE_C_FUNCTION: @@ -2220,7 +2220,7 @@ void drcbe_c::fixup_label(void *parameter, drccodeptr labelcodeptr) // dmulu - perform a double-wide unsigned multiply //------------------------------------------------- -int drcbe_c::dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int flags) +int drcbe_c::dmulu(uint64_t &dstlo, uint64_t &dsthi, uint64_t src1, uint64_t src2, int flags) { // shortcut if we don't care about the high bits or the flags if (&dstlo == &dsthi && flags == 0) @@ -2230,8 +2230,8 @@ int drcbe_c::dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int f } // fetch source values - UINT64 a = src1; - UINT64 b = src2; + uint64_t a = src1; + uint64_t b = src2; if (a == 0 || b == 0) { dsthi = dstlo = 0; @@ -2239,17 +2239,17 @@ int drcbe_c::dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int f } // compute high and low parts first - UINT64 lo = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 0); - UINT64 hi = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 32); + uint64_t lo = (uint64_t)(uint32_t)(a >> 0) * (uint64_t)(uint32_t)(b >> 0); + uint64_t hi = (uint64_t)(uint32_t)(a >> 32) * (uint64_t)(uint32_t)(b >> 32); // compute middle parts - UINT64 prevlo = lo; - UINT64 temp = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 0); + uint64_t prevlo = lo; + uint64_t temp = (uint64_t)(uint32_t)(a >> 32) * (uint64_t)(uint32_t)(b >> 0); lo += temp << 32; hi += (temp >> 32) + (lo < prevlo); prevlo = lo; - temp = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 32); + temp = (uint64_t)(uint32_t)(a >> 0) * (uint64_t)(uint32_t)(b >> 32); lo += temp << 32; hi += (temp >> 32) + (lo < prevlo); @@ -2264,7 +2264,7 @@ int drcbe_c::dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int f // dmuls - perform a double-wide signed multiply //------------------------------------------------- -int drcbe_c::dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int flags) +int drcbe_c::dmuls(uint64_t &dstlo, uint64_t &dsthi, int64_t src1, int64_t src2, int flags) { // shortcut if we don't care about the high bits or the flags if (&dstlo == &dsthi && flags == 0) @@ -2274,8 +2274,8 @@ int drcbe_c::dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int fla } // fetch absolute source values - UINT64 a = src1; if ((INT64)a < 0) a = -a; - UINT64 b = src2; if ((INT64)b < 0) b = -b; + uint64_t a = src1; if ((int64_t)a < 0) a = -a; + uint64_t b = src2; if ((int64_t)b < 0) b = -b; if (a == 0 || b == 0) { dsthi = dstlo = 0; @@ -2283,22 +2283,22 @@ int drcbe_c::dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int fla } // compute high and low parts first - UINT64 lo = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 0); - UINT64 hi = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 32); + uint64_t lo = (uint64_t)(uint32_t)(a >> 0) * (uint64_t)(uint32_t)(b >> 0); + uint64_t hi = (uint64_t)(uint32_t)(a >> 32) * (uint64_t)(uint32_t)(b >> 32); // compute middle parts - UINT64 prevlo = lo; - UINT64 temp = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 0); + uint64_t prevlo = lo; + uint64_t temp = (uint64_t)(uint32_t)(a >> 32) * (uint64_t)(uint32_t)(b >> 0); lo += temp << 32; hi += (temp >> 32) + (lo < prevlo); prevlo = lo; - temp = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 32); + temp = (uint64_t)(uint32_t)(a >> 0) * (uint64_t)(uint32_t)(b >> 32); lo += temp << 32; hi += (temp >> 32) + (lo < prevlo); // adjust for signage - if ((INT64)(src1 ^ src2) < 0) + if ((int64_t)(src1 ^ src2) < 0) { hi = ~hi + (lo == 0); lo = ~lo + 1; @@ -2307,10 +2307,10 @@ int drcbe_c::dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int fla // store the results dsthi = hi; dstlo = lo; - return ((hi >> 60) & FLAG_S) | ((dsthi != ((INT64)lo >> 63)) << 1); + return ((hi >> 60) & FLAG_S) | ((dsthi != ((int64_t)lo >> 63)) << 1); } -UINT32 drcbe_c::tzcount32(UINT32 value) +uint32_t drcbe_c::tzcount32(uint32_t value) { for (int i = 0; i < 32; i++) { @@ -2320,11 +2320,11 @@ UINT32 drcbe_c::tzcount32(UINT32 value) return 32; } -UINT64 drcbe_c::tzcount64(UINT64 value) +uint64_t drcbe_c::tzcount64(uint64_t value) { for (int i = 0; i < 64; i++) { - if (value & ((UINT64)(1) << i)) + if (value & ((uint64_t)(1) << i)) return i; } return 64; diff --git a/src/devices/cpu/drcbec.h b/src/devices/cpu/drcbec.h index 7326144681e..d92fc7672e9 100644 --- a/src/devices/cpu/drcbec.h +++ b/src/devices/cpu/drcbec.h @@ -28,24 +28,24 @@ class drcbe_c : public drcbe_interface { public: // construction/destruction - drcbe_c(drcuml_state &drcuml, device_t &device, drc_cache &cache, UINT32 flags, int modes, int addrbits, int ignorebits); + drcbe_c(drcuml_state &drcuml, device_t &device, drc_cache &cache, uint32_t flags, int modes, int addrbits, int ignorebits); virtual ~drcbe_c(); // required overrides virtual void reset() override; virtual int execute(uml::code_handle &entry) override; - virtual void generate(drcuml_block &block, const uml::instruction *instlist, UINT32 numinst) override; - virtual bool hash_exists(UINT32 mode, UINT32 pc) override; + virtual void generate(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst) override; + virtual bool hash_exists(uint32_t mode, uint32_t pc) override; virtual void get_info(drcbe_info &info) override; private: // helpers void output_parameter(drcbec_instruction **dstptr, void **immedptr, int size, const uml::parameter ¶m); void fixup_label(void *parameter, drccodeptr labelcodeptr); - int dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int flags); - int dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int flags); - UINT32 tzcount32(UINT32 value); - UINT64 tzcount64(UINT64 value); + int dmulu(uint64_t &dstlo, uint64_t &dsthi, uint64_t src1, uint64_t src2, int flags); + int dmuls(uint64_t &dstlo, uint64_t &dsthi, int64_t src1, int64_t src2, int flags); + uint32_t tzcount32(uint32_t value); + uint64_t tzcount64(uint64_t value); // internal state drc_hash_table m_hash; // hash table state @@ -53,8 +53,8 @@ private: drc_label_list m_labels; // label list drc_label_fixup_delegate m_fixup_delegate; // precomputed delegate - static const UINT32 s_condition_map[32]; - static UINT64 s_immediate_zero; + static const uint32_t s_condition_map[32]; + static uint64_t s_immediate_zero; }; diff --git a/src/devices/cpu/drcbeut.cpp b/src/devices/cpu/drcbeut.cpp index 8d4821e7421..265740d463c 100644 --- a/src/devices/cpu/drcbeut.cpp +++ b/src/devices/cpu/drcbeut.cpp @@ -30,7 +30,7 @@ using namespace uml; // drc_hash_table - constructor //------------------------------------------------- -drc_hash_table::drc_hash_table(drc_cache &cache, UINT32 modes, UINT8 addrbits, UINT8 ignorebits) +drc_hash_table::drc_hash_table(drc_cache &cache, uint32_t modes, uint8_t addrbits, uint8_t ignorebits) : m_cache(cache), m_modes(modes), m_nocodeptr(nullptr), @@ -85,7 +85,7 @@ bool drc_hash_table::reset() // block_begin - note the beginning of a block //------------------------------------------------- -void drc_hash_table::block_begin(drcuml_block &block, const uml::instruction *instlist, UINT32 numinst) +void drc_hash_table::block_begin(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst) { // before generating code, pre-allocate any hash entries; we do this by setting dummy hash values for (int inum = 0; inum < numinst; inum++) @@ -157,7 +157,7 @@ void drc_hash_table::set_default_codeptr(drccodeptr nocodeptr) // mode/pc //------------------------------------------------- -bool drc_hash_table::set_codeptr(UINT32 mode, UINT32 pc, drccodeptr code) +bool drc_hash_table::set_codeptr(uint32_t mode, uint32_t pc, drccodeptr code) { // copy-on-write for the l1 hash table assert(mode < m_modes); @@ -171,7 +171,7 @@ bool drc_hash_table::set_codeptr(UINT32 mode, UINT32 pc, drccodeptr code) } // copy-on-write for the l2 hash table - UINT32 l1 = (pc >> m_l1shift) & m_l1mask; + uint32_t l1 = (pc >> m_l1shift) & m_l1mask; if (m_base[mode][l1] == m_emptyl2) { drccodeptr *newtable = (drccodeptr *)m_cache.alloc_temporary(sizeof(drccodeptr) << m_l2bits); @@ -182,7 +182,7 @@ bool drc_hash_table::set_codeptr(UINT32 mode, UINT32 pc, drccodeptr code) } // set the new entry - UINT32 l2 = (pc >> m_l2shift) & m_l2mask; + uint32_t l2 = (pc >> m_l2shift) & m_l2mask; m_base[mode][l1][l2] = code; return true; } @@ -197,7 +197,7 @@ bool drc_hash_table::set_codeptr(UINT32 mode, UINT32 pc, drccodeptr code) // drc_map_variables - constructor //------------------------------------------------- -drc_map_variables::drc_map_variables(drc_cache &cache, UINT64 uniquevalue) +drc_map_variables::drc_map_variables(drc_cache &cache, uint64_t uniquevalue) : m_cache(cache), m_uniquevalue(uniquevalue) { @@ -244,13 +244,13 @@ void drc_map_variables::block_end(drcuml_block &block) return; // begin "code generation" aligned to an 8-byte boundary - drccodeptr *top = m_cache.begin_codegen(sizeof(UINT64) + sizeof(UINT32) + 2 * sizeof(UINT32) * m_entry_list.count()); + drccodeptr *top = m_cache.begin_codegen(sizeof(uint64_t) + sizeof(uint32_t) + 2 * sizeof(uint32_t) * m_entry_list.count()); if (top == nullptr) block.abort(); - UINT32 *dest = (UINT32 *)(((uintptr_t)*top + 7) & ~7); + uint32_t *dest = (uint32_t *)(((uintptr_t)*top + 7) & ~7); // store the cookie first - *(UINT64 *)dest = m_uniquevalue; + *(uint64_t *)dest = m_uniquevalue; dest += 2; // get the pointer to the first item and store an initial backwards offset @@ -259,7 +259,7 @@ void drc_map_variables::block_end(drcuml_block &block) dest++; // now iterate over entries and store them - UINT32 curvalue[MAPVAR_COUNT] = { 0 }; + uint32_t curvalue[MAPVAR_COUNT] = { 0 }; bool changed[MAPVAR_COUNT] = { false }; for (map_entry *entry = m_entry_list.first(); entry != nullptr; entry = entry->next()) { @@ -275,7 +275,7 @@ void drc_map_variables::block_end(drcuml_block &block) { // build a mask of changed variables int numchanged = 0; - UINT32 varmask = 0; + uint32_t varmask = 0; for (int varnum = 0; varnum < ARRAY_LENGTH(changed); varnum++) if (changed[varnum]) { @@ -289,7 +289,7 @@ void drc_map_variables::block_end(drcuml_block &block) continue; // first word is a code delta plus mask of changed variables - UINT32 codedelta = entry->m_codeptr - lastptr; + uint32_t codedelta = entry->m_codeptr - lastptr; while (codedelta > 0xffff) { *dest++ = 0xffff << 16; @@ -321,7 +321,7 @@ void drc_map_variables::block_end(drcuml_block &block) // code pointer //------------------------------------------------- -void drc_map_variables::set_value(drccodeptr codebase, UINT32 mapvar, UINT32 newvalue) +void drc_map_variables::set_value(drccodeptr codebase, uint32_t mapvar, uint32_t newvalue) { assert(mapvar >= MAPVAR_M0 && mapvar < MAPVAR_END); @@ -349,14 +349,14 @@ void drc_map_variables::set_value(drccodeptr codebase, UINT32 mapvar, UINT32 new // code pointer //------------------------------------------------- -UINT32 drc_map_variables::get_value(drccodeptr codebase, UINT32 mapvar) const +uint32_t drc_map_variables::get_value(drccodeptr codebase, uint32_t mapvar) const { assert(mapvar >= MAPVAR_M0 && mapvar < MAPVAR_END); mapvar -= MAPVAR_M0; // get an aligned pointer to start scanning - UINT64 *curscan = (UINT64 *)(((uintptr_t)codebase | 7) + 1); - UINT64 *endscan = (UINT64 *)m_cache.top(); + uint64_t *curscan = (uint64_t *)(((uintptr_t)codebase | 7) + 1); + uint64_t *endscan = (uint64_t *)m_cache.top(); // look for the signature while (curscan < endscan && *curscan++ != m_uniquevalue) {}; @@ -364,19 +364,19 @@ UINT32 drc_map_variables::get_value(drccodeptr codebase, UINT32 mapvar) const return 0; // switch to 32-bit pointers for processing the rest - UINT32 *data = (UINT32 *)curscan; + uint32_t *data = (uint32_t *)curscan; // first get the 32-bit starting offset to the code drccodeptr curcode = (drccodeptr)data - *data; data++; // now loop until we advance past our target - UINT32 varmask = 0x10 << mapvar; - UINT32 result = 0; + uint32_t varmask = 0x10 << mapvar; + uint32_t result = 0; while (true) { // a 0 is a terminator - UINT32 controlword = *data++; + uint32_t controlword = *data++; if (controlword == 0) break; @@ -390,7 +390,7 @@ UINT32 drc_map_variables::get_value(drccodeptr codebase, UINT32 mapvar) const { // count how many words precede the one we care about int dataoffs = 0; - for (UINT32 skipmask = (controlword & (varmask - 1)) >> 4; skipmask != 0; skipmask = skipmask & (skipmask - 1)) + for (uint32_t skipmask = (controlword & (varmask - 1)) >> 4; skipmask != 0; skipmask = skipmask & (skipmask - 1)) dataoffs++; // fetch the one we want @@ -405,7 +405,7 @@ UINT32 drc_map_variables::get_value(drccodeptr codebase, UINT32 mapvar) const return result; } -UINT32 drc_map_variables::static_get_value(drc_map_variables &map, drccodeptr codebase, UINT32 mapvar) +uint32_t drc_map_variables::static_get_value(drc_map_variables &map, drccodeptr codebase, uint32_t mapvar) { return map.get_value(codebase, mapvar); } @@ -417,7 +417,7 @@ UINT32 drc_map_variables::static_get_value(drc_map_variables &map, drccodeptr co // map value //------------------------------------------------- -UINT32 drc_map_variables::get_last_value(UINT32 mapvar) +uint32_t drc_map_variables::get_last_value(uint32_t mapvar) { assert(mapvar >= MAPVAR_M0 && mapvar < MAPVAR_END); return m_mapvalue[mapvar - MAPVAR_M0]; diff --git a/src/devices/cpu/drcbeut.h b/src/devices/cpu/drcbeut.h index 8987edb49c2..b18fb008060 100644 --- a/src/devices/cpu/drcbeut.h +++ b/src/devices/cpu/drcbeut.h @@ -27,42 +27,42 @@ class drc_hash_table { public: // construction/destruction - drc_hash_table(drc_cache &cache, UINT32 modes, UINT8 addrbits, UINT8 ignorebits); + drc_hash_table(drc_cache &cache, uint32_t modes, uint8_t addrbits, uint8_t ignorebits); // getters drccodeptr ***base() const { return m_base; } - UINT8 l1bits() const { return m_l1bits; } - UINT8 l2bits() const { return m_l2bits; } - UINT8 l1shift() const { return m_l1shift; } - UINT8 l2shift() const { return m_l2shift; } + uint8_t l1bits() const { return m_l1bits; } + uint8_t l2bits() const { return m_l2bits; } + uint8_t l1shift() const { return m_l1shift; } + uint8_t l2shift() const { return m_l2shift; } offs_t l1mask() const { return m_l1mask; } offs_t l2mask() const { return m_l2mask; } - bool is_mode_populated(UINT32 mode) const { return m_base[mode] != m_emptyl1; } + bool is_mode_populated(uint32_t mode) const { return m_base[mode] != m_emptyl1; } // set up and configuration bool reset(); void set_default_codeptr(drccodeptr code); // block begin/end - void block_begin(drcuml_block &block, const uml::instruction *instlist, UINT32 numinst); + void block_begin(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst); void block_end(drcuml_block &block); // code pointer access - bool set_codeptr(UINT32 mode, UINT32 pc, drccodeptr code); - drccodeptr get_codeptr(UINT32 mode, UINT32 pc) { assert(mode < m_modes); return m_base[mode][(pc >> m_l1shift) & m_l1mask][(pc >> m_l2shift) & m_l2mask]; } - bool code_exists(UINT32 mode, UINT32 pc) { return get_codeptr(mode, pc) != m_nocodeptr; } + bool set_codeptr(uint32_t mode, uint32_t pc, drccodeptr code); + drccodeptr get_codeptr(uint32_t mode, uint32_t pc) { assert(mode < m_modes); return m_base[mode][(pc >> m_l1shift) & m_l1mask][(pc >> m_l2shift) & m_l2mask]; } + bool code_exists(uint32_t mode, uint32_t pc) { return get_codeptr(mode, pc) != m_nocodeptr; } private: // internal state drc_cache & m_cache; // cache where allocations come from - UINT32 m_modes; // number of modes supported + uint32_t m_modes; // number of modes supported drccodeptr m_nocodeptr; // pointer to code which will handle missing entries - UINT8 m_l1bits; // bits worth of entries in l1 hash tables - UINT8 m_l2bits; // bits worth of entries in l2 hash tables - UINT8 m_l1shift; // shift to apply to the PC to get the l1 hash entry - UINT8 m_l2shift; // shift to apply to the PC to get the l2 hash entry + uint8_t m_l1bits; // bits worth of entries in l1 hash tables + uint8_t m_l2bits; // bits worth of entries in l2 hash tables + uint8_t m_l1shift; // shift to apply to the PC to get the l1 hash entry + uint8_t m_l2shift; // shift to apply to the PC to get the l2 hash entry offs_t m_l1mask; // mask to apply after shifting offs_t m_l2mask; // mask to apply after shifting @@ -79,7 +79,7 @@ class drc_map_variables { public: // construction/destruction - drc_map_variables(drc_cache &cache, UINT64 uniquevalue); + drc_map_variables(drc_cache &cache, uint64_t uniquevalue); ~drc_map_variables(); // block begin/end @@ -87,18 +87,18 @@ public: void block_end(drcuml_block &block); // get/set values - void set_value(drccodeptr codebase, UINT32 mapvar, UINT32 newvalue); - UINT32 get_value(drccodeptr codebase, UINT32 mapvar) const; - UINT32 get_last_value(UINT32 mapvar); + void set_value(drccodeptr codebase, uint32_t mapvar, uint32_t newvalue); + uint32_t get_value(drccodeptr codebase, uint32_t mapvar) const; + uint32_t get_last_value(uint32_t mapvar); // static accessors to be called directly by generated code - static UINT32 static_get_value(drc_map_variables &map, drccodeptr codebase, UINT32 mapvar); + static uint32_t static_get_value(drc_map_variables &map, drccodeptr codebase, uint32_t mapvar); private: // internal state drc_cache & m_cache; // pointer to the cache - UINT64 m_uniquevalue; // unique value used to find the table - UINT32 m_mapvalue[uml::MAPVAR_END - uml::MAPVAR_M0]; // array of current values + uint64_t m_uniquevalue; // unique value used to find the table + uint32_t m_mapvalue[uml::MAPVAR_END - uml::MAPVAR_M0]; // array of current values // list of entries struct map_entry @@ -106,8 +106,8 @@ private: map_entry *next() const { return m_next; } map_entry * m_next; // pointer to next map entry drccodeptr m_codeptr; // pointer to the relevant code - UINT32 m_mapvar; // map variable id - UINT32 m_newval; // value of the variable starting at codeptr + uint32_t m_mapvar; // map variable id + uint32_t m_newval; // value of the variable starting at codeptr }; simple_list m_entry_list; // list of entries }; diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index 4ecb8cef939..78dd9146ee2 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -219,15 +219,15 @@ using x64emit::REG_R15; // CONSTANTS //************************************************************************** -const UINT32 PTYPE_M = 1 << parameter::PTYPE_MEMORY; -const UINT32 PTYPE_I = 1 << parameter::PTYPE_IMMEDIATE; -const UINT32 PTYPE_R = 1 << parameter::PTYPE_INT_REGISTER; -const UINT32 PTYPE_F = 1 << parameter::PTYPE_FLOAT_REGISTER; -//const UINT32 PTYPE_MI = PTYPE_M | PTYPE_I; -//const UINT32 PTYPE_RI = PTYPE_R | PTYPE_I; -const UINT32 PTYPE_MR = PTYPE_M | PTYPE_R; -const UINT32 PTYPE_MRI = PTYPE_M | PTYPE_R | PTYPE_I; -const UINT32 PTYPE_MF = PTYPE_M | PTYPE_F; +const uint32_t PTYPE_M = 1 << parameter::PTYPE_MEMORY; +const uint32_t PTYPE_I = 1 << parameter::PTYPE_IMMEDIATE; +const uint32_t PTYPE_R = 1 << parameter::PTYPE_INT_REGISTER; +const uint32_t PTYPE_F = 1 << parameter::PTYPE_FLOAT_REGISTER; +//const uint32_t PTYPE_MI = PTYPE_M | PTYPE_I; +//const uint32_t PTYPE_RI = PTYPE_R | PTYPE_I; +const uint32_t PTYPE_MR = PTYPE_M | PTYPE_R; +const uint32_t PTYPE_MRI = PTYPE_M | PTYPE_R | PTYPE_I; +const uint32_t PTYPE_MF = PTYPE_M | PTYPE_F; #ifdef X64_WINDOWS_ABI @@ -273,10 +273,10 @@ inline x86_memref drcbe_x64::MABS(const void *ptr) drcbe_x64::opcode_generate_func drcbe_x64::s_opcode_table[OP_MAX]; // size-to-mask table -//static const UINT64 size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) }; +//static const uint64_t size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) }; // register mapping tables -static const UINT8 int_register_map[REG_I_COUNT] = +static const uint8_t int_register_map[REG_I_COUNT] = { #ifdef X64_WINDOWS_ABI REG_RBX, REG_RSI, REG_RDI, REG_R12, REG_R13, REG_R14, REG_R15 @@ -285,13 +285,13 @@ static const UINT8 int_register_map[REG_I_COUNT] = #endif }; -static UINT8 float_register_map[REG_F_COUNT] = +static uint8_t float_register_map[REG_F_COUNT] = { REG_XMM6, REG_XMM7, REG_XMM8, REG_XMM9, REG_XMM10, REG_XMM11, REG_XMM12, REG_XMM13, REG_XMM14, REG_XMM15 }; // condition mapping table -static const UINT8 condition_map[uml::COND_MAX - uml::COND_Z] = +static const uint8_t condition_map[uml::COND_MAX - uml::COND_Z] = { x64emit::COND_Z, // COND_Z = 0x80, requires Z x64emit::COND_NZ, // COND_NZ, requires Z @@ -313,7 +313,7 @@ static const UINT8 condition_map[uml::COND_MAX - uml::COND_Z] = #if 0 // rounding mode mapping table -static const UINT8 fprnd_map[4] = +static const uint8_t fprnd_map[4] = { FPRND_CHOP, // ROUND_TRUNC, truncate FPRND_NEAR, // ROUND_ROUND, round @@ -430,7 +430,7 @@ const drcbe_x64::opcode_table_entry drcbe_x64::s_opcode_table_source[] = // into a reduced set //------------------------------------------------- -drcbe_x64::be_parameter::be_parameter(drcbe_x64 &drcbe, const parameter ¶m, UINT32 allowed) +drcbe_x64::be_parameter::be_parameter(drcbe_x64 &drcbe, const parameter ¶m, uint32_t allowed) { int regnum; @@ -536,11 +536,11 @@ inline void drcbe_x64::normalize_commutative(be_parameter &inner, be_parameter & // from rbp //------------------------------------------------- -inline INT32 drcbe_x64::offset_from_rbp(const void *ptr) +inline int32_t drcbe_x64::offset_from_rbp(const void *ptr) { - INT64 delta = reinterpret_cast(const_cast(ptr)) - m_rbpvalue; - assert_always((INT32)delta == delta, "offset_from_rbp: delta out of range"); - return (INT32)delta; + int64_t delta = reinterpret_cast(const_cast(ptr)) - m_rbpvalue; + assert_always((int32_t)delta == delta, "offset_from_rbp: delta out of range"); + return (int32_t)delta; } @@ -550,9 +550,9 @@ inline INT32 drcbe_x64::offset_from_rbp(const void *ptr) // target address //------------------------------------------------- -inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target, UINT8 reg, INT32 &offset) +inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target, uint8_t reg, int32_t &offset) { - INT64 delta = (UINT8 *)target - m_rbpvalue; + int64_t delta = (uint8_t *)target - m_rbpvalue; if (short_immediate(delta)) { offset = delta; @@ -572,9 +572,9 @@ inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target, // directly or via a call through pointer //------------------------------------------------- -inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, UINT8 reg) +inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, uint8_t reg) { - INT64 delta = target - (dst + 5); + int64_t delta = target - (dst + 5); if (short_immediate(delta)) emit_call(dst, target); // call target else @@ -592,7 +592,7 @@ inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, UINT8 inline void drcbe_x64::emit_smart_call_m64(x86code *&dst, x86code **target) { - INT64 delta = *target - (dst + 5); + int64_t delta = *target - (dst + 5); if (short_immediate(delta)) emit_call(dst, *target); // call *target else @@ -609,14 +609,14 @@ inline void drcbe_x64::emit_smart_call_m64(x86code *&dst, x86code **target) // drcbe_x64 - constructor //------------------------------------------------- -drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, UINT32 flags, int modes, int addrbits, int ignorebits) +drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, uint32_t flags, int modes, int addrbits, int ignorebits) : drcbe_interface(drcuml, cache, device), m_hash(cache, modes, addrbits, ignorebits), m_map(cache, 0), m_labels(cache), m_log(nullptr), m_sse41(false), - m_absmask32((UINT32 *)cache.alloc_near(16*2 + 15)), + m_absmask32((uint32_t *)cache.alloc_near(16*2 + 15)), m_absmask64(nullptr), m_rbpvalue(cache.near() + 0x80), m_entry(nullptr), @@ -627,7 +627,7 @@ drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, U m_near(*(near_state *)cache.alloc_near(sizeof(m_near))) { // build up necessary arrays - static const UINT32 sse_control[4] = + static const uint32_t sse_control[4] = { 0xffc0, // ROUND_TRUNC 0x9fc0, // ROUND_ROUND @@ -639,9 +639,9 @@ drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, U m_near.double1 = 1.0; // create absolute value masks that are aligned to SSE boundaries - m_absmask32 = (UINT32 *)(((uintptr_t)m_absmask32 + 15) & ~15); + m_absmask32 = (uint32_t *)(((uintptr_t)m_absmask32 + 15) & ~15); m_absmask32[0] = m_absmask32[1] = m_absmask32[2] = m_absmask32[3] = 0x7fffffff; - m_absmask64 = (UINT64 *)&m_absmask32[4]; + m_absmask64 = (uint64_t *)&m_absmask32[4]; m_absmask64[0] = m_absmask64[1] = U64(0x7fffffffffffffff); // get pointers to C functions we need to call @@ -656,7 +656,7 @@ drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, U // build the flags map for (int entry = 0; entry < ARRAY_LENGTH(m_near.flagsmap); entry++) { - UINT8 flags = 0; + uint8_t flags = 0; if (entry & 0x001) flags |= FLAG_C; if (entry & 0x004) flags |= FLAG_U; if (entry & 0x040) flags |= FLAG_Z; @@ -666,7 +666,7 @@ drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, U } for (int entry = 0; entry < ARRAY_LENGTH(m_near.flagsunmap); entry++) { - UINT64 flags = 0; + uint64_t flags = 0; if (entry & FLAG_C) flags |= 0x001; if (entry & FLAG_U) flags |= 0x004; if (entry & FLAG_Z) flags |= 0x040; @@ -718,7 +718,7 @@ void drcbe_x64::reset() x86code *dst = (x86code *)*cachetop; // generate a simple CPUID stub - UINT32 (*cpuid_ecx_stub)(void) = (UINT32 (*)(void))dst; + uint32_t (*cpuid_ecx_stub)(void) = (uint32_t (*)(void))dst; emit_push_r64(dst, REG_RBX); // push rbx emit_mov_r32_imm(dst, REG_EAX, 1); // mov eax,1 emit_cpuid(dst); // cpuid @@ -798,7 +798,7 @@ int drcbe_x64::execute(code_handle &entry) // drcbex64_generate - generate code //------------------------------------------------- -void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, UINT32 numinst) +void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, uint32_t numinst) { // tell all of our utility objects that a block is beginning m_hash.block_begin(block, instlist, numinst); @@ -834,7 +834,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, UINT3 if (inst.opcode() == OP_HANDLE) blockname = inst.param(0).handle().string(); else if (inst.opcode() == OP_HASH) - blockname = string_format("Code: mode=%d PC=%08X", (UINT32)inst.param(0).immediate(), (offs_t)inst.param(1).immediate()).c_str(); + blockname = string_format("Code: mode=%d PC=%08X", (uint32_t)inst.param(0).immediate(), (offs_t)inst.param(1).immediate()).c_str(); } // generate code @@ -861,7 +861,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, UINT3 // exists in the hash table //------------------------------------------------- -bool drcbe_x64::hash_exists(UINT32 mode, UINT32 pc) +bool drcbe_x64::hash_exists(uint32_t mode, uint32_t pc) { return m_hash.code_exists(mode, pc); } @@ -893,7 +893,7 @@ void drcbe_x64::get_info(drcbe_info &info) // into a register //------------------------------------------------- -void drcbe_x64::emit_mov_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m) +void drcbe_x64::emit_mov_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m) { if (param.is_immediate()) { @@ -917,16 +917,16 @@ void drcbe_x64::emit_mov_r32_p32(x86code *&dst, UINT8 reg, const be_parameter &p // sign-extended into a register //------------------------------------------------- -void drcbe_x64::emit_movsx_r64_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m) +void drcbe_x64::emit_movsx_r64_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m) { if (param.is_immediate()) { if (param.immediate() == 0) emit_xor_r32_r32(dst, reg, reg); // xor reg,reg - else if ((INT32)param.immediate() >= 0) + else if ((int32_t)param.immediate() >= 0) emit_mov_r32_imm(dst, reg, param.immediate()); // mov reg,param else - emit_mov_r64_imm(dst, reg, (INT32)param.immediate()); // mov reg,param + emit_mov_r64_imm(dst, reg, (int32_t)param.immediate()); // mov reg,param } else if (param.is_memory()) emit_movsxd_r64_m32(dst, reg, MABS(param.memory())); // movsxd reg,[param] @@ -941,7 +941,7 @@ void drcbe_x64::emit_movsx_r64_p32(x86code *&dst, UINT8 reg, const be_parameter // any flags //------------------------------------------------- -void drcbe_x64::emit_mov_r32_p32_keepflags(x86code *&dst, UINT8 reg, const be_parameter ¶m) +void drcbe_x64::emit_mov_r32_p32_keepflags(x86code *&dst, uint8_t reg, const be_parameter ¶m) { if (param.is_immediate()) emit_mov_r32_imm(dst, reg, param.immediate()); // mov reg,param @@ -979,7 +979,7 @@ void drcbe_x64::emit_mov_m32_p32(x86code *&dst, x86_memref memref, const be_para // 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, UINT8 reg) +void drcbe_x64::emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, uint8_t reg) { assert(!param.is_immediate()); if (param.is_memory()) @@ -997,7 +997,7 @@ void drcbe_x64::emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, UINT8 // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_add_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_add_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -1037,7 +1037,7 @@ void drcbe_x64::emit_add_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_adc_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_adc_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) emit_adc_r32_imm(dst, reg, param.immediate()); // adc reg,param @@ -1071,7 +1071,7 @@ void drcbe_x64::emit_adc_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_sub_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_sub_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -1111,7 +1111,7 @@ void drcbe_x64::emit_sub_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_sbb_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_sbb_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) emit_sbb_r32_imm(dst, reg, param.immediate()); // sbb reg,param @@ -1145,7 +1145,7 @@ void drcbe_x64::emit_sbb_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_cmp_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_cmp_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) emit_cmp_r32_imm(dst, reg, param.immediate()); // cmp reg,param @@ -1179,13 +1179,13 @@ void drcbe_x64::emit_cmp_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_and_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_and_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) emit_xor_r32_r32(dst, reg, reg); // xor reg,reg else emit_and_r32_imm(dst, reg, param.immediate()); // and reg,param @@ -1206,9 +1206,9 @@ void drcbe_x64::emit_and_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) emit_mov_m32_imm(dst, memref, 0); // mov [dest],0 else emit_and_m32_imm(dst, memref, param.immediate()); // and [dest],param @@ -1227,7 +1227,7 @@ void drcbe_x64::emit_and_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_test_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_test_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) emit_test_r32_imm(dst, reg, param.immediate()); // test reg,param @@ -1262,13 +1262,13 @@ void drcbe_x64::emit_test_m32_p32(x86code *&dst, x86_memref memref, const be_par // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_or_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_or_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_mov_r32_imm(dst, reg, 0xffffffff); // mov reg,-1 else emit_or_r32_imm(dst, reg, param.immediate()); // or reg,param @@ -1289,9 +1289,9 @@ void drcbe_x64::emit_or_m32_p32(x86code *&dst, x86_memref memref, const be_param { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_mov_m32_imm(dst, memref, 0xffffffff); // mov [dest],-1 else emit_or_m32_imm(dst, memref, param.immediate()); // or [dest],param @@ -1310,13 +1310,13 @@ void drcbe_x64::emit_or_m32_p32(x86code *&dst, x86_memref memref, const be_param // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_xor_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_xor_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_not_r32(dst, reg); // not reg else emit_xor_r32_imm(dst, reg, param.immediate()); // xor reg,param @@ -1337,9 +1337,9 @@ void drcbe_x64::emit_xor_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_not_m32(dst, memref); // not [dest] else emit_xor_m32_imm(dst, memref, param.immediate()); // xor [dest],param @@ -1358,11 +1358,11 @@ void drcbe_x64::emit_xor_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_shl_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_shl_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shl_r32_imm(dst, reg, param.immediate()); // shl reg,param @@ -1384,7 +1384,7 @@ void drcbe_x64::emit_shl_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shl_m32_imm(dst, memref, param.immediate()); // shl [dest],param @@ -1402,11 +1402,11 @@ void drcbe_x64::emit_shl_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_shr_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_shr_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shr_r32_imm(dst, reg, param.immediate()); // shr reg,param @@ -1428,7 +1428,7 @@ void drcbe_x64::emit_shr_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shr_m32_imm(dst, memref, param.immediate()); // shr [dest],param @@ -1446,11 +1446,11 @@ void drcbe_x64::emit_shr_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_sar_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_sar_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_sar_r32_imm(dst, reg, param.immediate()); // sar reg,param @@ -1472,7 +1472,7 @@ void drcbe_x64::emit_sar_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_sar_m32_imm(dst, memref, param.immediate()); // sar [dest],param @@ -1490,11 +1490,11 @@ void drcbe_x64::emit_sar_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_rol_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_rol_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rol_r32_imm(dst, reg, param.immediate()); // rol reg,param @@ -1516,7 +1516,7 @@ void drcbe_x64::emit_rol_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rol_m32_imm(dst, memref, param.immediate()); // rol [dest],param @@ -1534,11 +1534,11 @@ void drcbe_x64::emit_rol_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_ror_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_ror_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_ror_r32_imm(dst, reg, param.immediate()); // ror reg,param @@ -1560,7 +1560,7 @@ void drcbe_x64::emit_ror_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_ror_m32_imm(dst, memref, param.immediate()); // ror [dest],param @@ -1578,11 +1578,11 @@ void drcbe_x64::emit_ror_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_rcl_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_rcl_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcl_r32_imm(dst, reg, param.immediate()); // rcl reg,param @@ -1604,7 +1604,7 @@ void drcbe_x64::emit_rcl_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcl_m32_imm(dst, memref, param.immediate()); // rcl [dest],param @@ -1622,11 +1622,11 @@ void drcbe_x64::emit_rcl_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_rcr_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_rcr_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcr_r32_imm(dst, reg, param.immediate()); // rcr reg,param @@ -1648,7 +1648,7 @@ void drcbe_x64::emit_rcr_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcr_m32_imm(dst, memref, param.immediate()); // rcr [dest],param @@ -1671,7 +1671,7 @@ void drcbe_x64::emit_rcr_m32_p32(x86code *&dst, x86_memref memref, const be_para // into a register //------------------------------------------------- -void drcbe_x64::emit_mov_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m) +void drcbe_x64::emit_mov_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m) { if (param.is_immediate()) { @@ -1696,7 +1696,7 @@ void drcbe_x64::emit_mov_r64_p64(x86code *&dst, UINT8 reg, const be_parameter &p // any flags //------------------------------------------------- -void drcbe_x64::emit_mov_r64_p64_keepflags(x86code *&dst, UINT8 reg, const be_parameter ¶m) +void drcbe_x64::emit_mov_r64_p64_keepflags(x86code *&dst, uint8_t reg, const be_parameter ¶m) { if (param.is_immediate()) emit_mov_r64_imm(dst, reg, param.immediate()); // mov reg,param @@ -1715,7 +1715,7 @@ void drcbe_x64::emit_mov_r64_p64_keepflags(x86code *&dst, UINT8 reg, const be_pa // 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, UINT8 reg) +void drcbe_x64::emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, uint8_t reg) { assert(!param.is_immediate()); if (param.is_memory()) @@ -1733,7 +1733,7 @@ void drcbe_x64::emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, UINT8 // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_add_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_add_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -1789,7 +1789,7 @@ void drcbe_x64::emit_add_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_adc_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_adc_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -1831,7 +1831,7 @@ void drcbe_x64::emit_adc_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_sub_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_sub_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -1887,7 +1887,7 @@ void drcbe_x64::emit_sub_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_sbb_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_sbb_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -1929,7 +1929,7 @@ void drcbe_x64::emit_sbb_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_cmp_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_cmp_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -1971,7 +1971,7 @@ void drcbe_x64::emit_cmp_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_and_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_and_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -2027,7 +2027,7 @@ void drcbe_x64::emit_and_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_test_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_test_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -2070,7 +2070,7 @@ void drcbe_x64::emit_test_m64_p64(x86code *&dst, x86_memref memref, const be_par // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_or_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_or_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -2126,7 +2126,7 @@ void drcbe_x64::emit_or_m64_p64(x86code *&dst, x86_memref memref, const be_param // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_xor_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_xor_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -2186,11 +2186,11 @@ void drcbe_x64::emit_xor_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_shl_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_shl_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shl_r64_imm(dst, reg, param.immediate()); // shl reg,param @@ -2212,7 +2212,7 @@ void drcbe_x64::emit_shl_m64_p64(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT64)param.immediate() == 0) + if (inst.flags() == 0 && (uint64_t)param.immediate() == 0) ;// skip else emit_shl_m64_imm(dst, memref, param.immediate()); // shl [dest],param @@ -2230,11 +2230,11 @@ void drcbe_x64::emit_shl_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_shr_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_shr_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shr_r64_imm(dst, reg, param.immediate()); // shr reg,param @@ -2256,7 +2256,7 @@ void drcbe_x64::emit_shr_m64_p64(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT64)param.immediate() == 0) + if (inst.flags() == 0 && (uint64_t)param.immediate() == 0) ;// skip else emit_shr_m64_imm(dst, memref, param.immediate()); // shr [dest],param @@ -2274,11 +2274,11 @@ void drcbe_x64::emit_shr_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_sar_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_sar_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_sar_r64_imm(dst, reg, param.immediate()); // sar reg,param @@ -2300,7 +2300,7 @@ void drcbe_x64::emit_sar_m64_p64(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT64)param.immediate() == 0) + if (inst.flags() == 0 && (uint64_t)param.immediate() == 0) ;// skip else emit_sar_m64_imm(dst, memref, param.immediate()); // sar [dest],param @@ -2318,11 +2318,11 @@ void drcbe_x64::emit_sar_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_rol_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_rol_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rol_r64_imm(dst, reg, param.immediate()); // rol reg,param @@ -2344,7 +2344,7 @@ void drcbe_x64::emit_rol_m64_p64(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT64)param.immediate() == 0) + if (inst.flags() == 0 && (uint64_t)param.immediate() == 0) ;// skip else emit_rol_m64_imm(dst, memref, param.immediate()); // rol [dest],param @@ -2362,11 +2362,11 @@ void drcbe_x64::emit_rol_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_ror_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_ror_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_ror_r64_imm(dst, reg, param.immediate()); // ror reg,param @@ -2388,7 +2388,7 @@ void drcbe_x64::emit_ror_m64_p64(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT64)param.immediate() == 0) + if (inst.flags() == 0 && (uint64_t)param.immediate() == 0) ;// skip else emit_ror_m64_imm(dst, memref, param.immediate()); // ror [dest],param @@ -2406,11 +2406,11 @@ void drcbe_x64::emit_ror_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_rcl_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_rcl_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcl_r64_imm(dst, reg, param.immediate()); // rcl reg,param @@ -2432,7 +2432,7 @@ void drcbe_x64::emit_rcl_m64_p64(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT64)param.immediate() == 0) + if (inst.flags() == 0 && (uint64_t)param.immediate() == 0) ;// skip else emit_rcl_m64_imm(dst, memref, param.immediate()); // rcl [dest],param @@ -2450,11 +2450,11 @@ void drcbe_x64::emit_rcl_m64_p64(x86code *&dst, x86_memref memref, const be_para // register from a 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_rcr_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x64::emit_rcr_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcr_r64_imm(dst, reg, param.immediate()); // rcr reg,param @@ -2476,7 +2476,7 @@ void drcbe_x64::emit_rcr_m64_p64(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT64)param.immediate() == 0) + if (inst.flags() == 0 && (uint64_t)param.immediate() == 0) ;// skip else emit_rcr_m64_imm(dst, memref, param.immediate()); // rcr [dest],param @@ -2499,7 +2499,7 @@ void drcbe_x64::emit_rcr_m64_p64(x86code *&dst, x86_memref memref, const be_para // into a register //------------------------------------------------- -void drcbe_x64::emit_movss_r128_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m) +void drcbe_x64::emit_movss_r128_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m) { assert(!param.is_immediate()); if (param.is_memory()) @@ -2517,7 +2517,7 @@ void drcbe_x64::emit_movss_r128_p32(x86code *&dst, UINT8 reg, const be_parameter // 32-bit parameter //------------------------------------------------- -void drcbe_x64::emit_movss_p32_r128(x86code *&dst, const be_parameter ¶m, UINT8 reg) +void drcbe_x64::emit_movss_p32_r128(x86code *&dst, const be_parameter ¶m, uint8_t reg) { assert(!param.is_immediate()); if (param.is_memory()) @@ -2535,7 +2535,7 @@ void drcbe_x64::emit_movss_p32_r128(x86code *&dst, const be_parameter ¶m, UI // into a register //------------------------------------------------- -void drcbe_x64::emit_movsd_r128_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m) +void drcbe_x64::emit_movsd_r128_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m) { assert(!param.is_immediate()); if (param.is_memory()) @@ -2553,7 +2553,7 @@ void drcbe_x64::emit_movsd_r128_p64(x86code *&dst, UINT8 reg, const be_parameter // 64-bit parameter //------------------------------------------------- -void drcbe_x64::emit_movsd_p64_r128(x86code *&dst, const be_parameter ¶m, UINT8 reg) +void drcbe_x64::emit_movsd_p64_r128(x86code *&dst, const be_parameter ¶m, uint8_t reg) { assert(!param.is_immediate()); if (param.is_memory()) @@ -2589,12 +2589,12 @@ void drcbe_x64::fixup_label(void *parameter, drccodeptr labelcodeptr) else if (src[0] == 0xe9) { src += 1 + 4; - ((UINT32 *)src)[-1] = labelcodeptr - src; + ((uint32_t *)src)[-1] = labelcodeptr - src; } else if (src[0] == 0x0f && (src[1] & 0xf0) == 0x80) { src += 2 + 4; - ((UINT32 *)src)[-1] = labelcodeptr - src; + ((uint32_t *)src)[-1] = labelcodeptr - src; } else fatalerror("fixup_label called with invalid jmp source!\n"); @@ -2621,7 +2621,7 @@ void drcbe_x64::fixup_exception(drccodeptr *codeptr, void *param1, void *param2) // first fixup the jump to get us here drccodeptr dst = *codeptr; - ((UINT32 *)src)[-1] = dst - src; + ((uint32_t *)src)[-1] = dst - src; // then store the exception parameter emit_mov_m32_p32(dst, MABS(&m_state.exp), exp); // mov [exp],exp @@ -2862,8 +2862,8 @@ void drcbe_x64::op_hashjmp(x86code *&dst, const instruction &inst) // a straight immediate jump is direct, though we need the PC in EAX in case of failure if (pcp.is_immediate()) { - UINT32 l1val = (pcp.immediate() >> m_hash.l1shift()) & m_hash.l1mask(); - UINT32 l2val = (pcp.immediate() >> m_hash.l2shift()) & m_hash.l2mask(); + uint32_t l1val = (pcp.immediate() >> m_hash.l1shift()) & m_hash.l1mask(); + uint32_t l2val = (pcp.immediate() >> m_hash.l2shift()) & m_hash.l2mask(); emit_call_m64(dst, MABS(&m_hash.base()[modep.immediate()][l1val][l2val])); // call hash[modep][l1val][l2val] } @@ -2891,8 +2891,8 @@ void drcbe_x64::op_hashjmp(x86code *&dst, const instruction &inst) // fixed PC if (pcp.is_immediate()) { - UINT32 l1val = (pcp.immediate() >> m_hash.l1shift()) & m_hash.l1mask(); - UINT32 l2val = (pcp.immediate() >> m_hash.l2shift()) & m_hash.l2mask(); + uint32_t l1val = (pcp.immediate() >> m_hash.l1shift()) & m_hash.l1mask(); + uint32_t l2val = (pcp.immediate() >> m_hash.l2shift()) & m_hash.l2mask(); emit_mov_r64_m64(dst, REG_RDX, MBD(REG_RCX, l1val*8)); // mov rdx,[rcx+l1val*8] emit_call_m64(dst, MBD(REG_RDX, l2val*8)); // call [l2val*8] } @@ -3211,7 +3211,7 @@ void drcbe_x64::op_getflgs(x86code *&dst, const instruction &inst) int dstreg = dstp.select_register(REG_EAX); // compute mask for flags - UINT32 flagmask = 0; + uint32_t flagmask = 0; if (maskp.immediate() & FLAG_C) flagmask |= 0x001; if (maskp.immediate() & FLAG_V) flagmask |= 0x800; if (maskp.immediate() & FLAG_Z) flagmask |= 0x040; @@ -3467,7 +3467,7 @@ void drcbe_x64::op_load(x86code *&dst, const instruction &inst) int size = scalesizep.size(); // determine the pointer base - INT32 baseoffs; + int32_t baseoffs; int basereg = get_base_register_and_offset(dst, basep.memory(), REG_RDX, baseoffs); // pick a target register for the general case @@ -3531,7 +3531,7 @@ void drcbe_x64::op_loads(x86code *&dst, const instruction &inst) int size = scalesizep.size(); // determine the pointer base - INT32 baseoffs; + int32_t baseoffs; int basereg = get_base_register_and_offset(dst, basep.memory(), REG_RDX, baseoffs); // pick a target register for the general case @@ -3618,7 +3618,7 @@ void drcbe_x64::op_store(x86code *&dst, const instruction &inst) int size = scalesizep.size(); // determine the pointer base - INT32 baseoffs; + int32_t baseoffs; int basereg = get_base_register_and_offset(dst, basep.memory(), REG_RDX, baseoffs); // pick a source register for the general case @@ -3930,7 +3930,7 @@ void drcbe_x64::op_carry(x86code *&dst, const instruction &inst) // degenerate case: source is immediate if (srcp.is_immediate() && bitp.is_immediate()) { - if (srcp.immediate() & ((UINT64)1 << bitp.immediate())) + if (srcp.immediate() & ((uint64_t)1 << bitp.immediate())) emit_stc(dst); else emit_clc(dst); @@ -4602,8 +4602,8 @@ void drcbe_x64::op_cmp(x86code *&dst, const instruction &inst) void drcbe_x64::op_mulu(x86code *&dst, const instruction &inst) { - UINT8 zsflags = inst.flags() & (FLAG_Z | FLAG_S); - UINT8 vflag = inst.flags() & FLAG_V; + uint8_t zsflags = inst.flags() & (FLAG_Z | FLAG_S); + uint8_t vflag = inst.flags() & FLAG_V; // validate instruction assert(inst.size() == 4 || inst.size() == 8); @@ -4736,8 +4736,8 @@ void drcbe_x64::op_mulu(x86code *&dst, const instruction &inst) void drcbe_x64::op_muls(x86code *&dst, const instruction &inst) { - UINT8 zsflags = inst.flags() & (FLAG_Z | FLAG_S); - UINT8 vflag = inst.flags() & FLAG_V; + uint8_t zsflags = inst.flags() & (FLAG_Z | FLAG_S); + uint8_t vflag = inst.flags() & FLAG_V; // validate instruction assert(inst.size() == 4 || inst.size() == 8); @@ -5860,7 +5860,7 @@ void drcbe_x64::op_fload(x86code *&dst, const instruction &inst) int dstreg = dstp.select_register(REG_XMM0); // determine the pointer base - INT32 baseoffs; + int32_t baseoffs; int basereg = get_base_register_and_offset(dst, basep.memory(), REG_RDX, baseoffs); // 32-bit form @@ -5913,7 +5913,7 @@ void drcbe_x64::op_fstore(x86code *&dst, const instruction &inst) int srcreg = srcp.select_register(REG_XMM0); // determine the pointer base - INT32 baseoffs; + int32_t baseoffs; int basereg = get_base_register_and_offset(dst, basep.memory(), REG_RDX, baseoffs); // 32-bit form diff --git a/src/devices/cpu/drcbex64.h b/src/devices/cpu/drcbex64.h index fc8b3cae1af..d996c5db8c7 100644 --- a/src/devices/cpu/drcbex64.h +++ b/src/devices/cpu/drcbex64.h @@ -28,18 +28,18 @@ namespace drc { class drcbe_x64 : public drcbe_interface { - typedef UINT32 (*x86_entry_point_func)(UINT8 *rbpvalue, x86code *entry); + typedef uint32_t (*x86_entry_point_func)(uint8_t *rbpvalue, x86code *entry); public: // construction/destruction - drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, UINT32 flags, int modes, int addrbits, int ignorebits); + drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, uint32_t flags, int modes, int addrbits, int ignorebits); virtual ~drcbe_x64(); // required overrides virtual void reset() override; virtual int execute(uml::code_handle &entry) override; - virtual void generate(drcuml_block &block, const uml::instruction *instlist, UINT32 numinst) override; - virtual bool hash_exists(UINT32 mode, UINT32 pc) override; + virtual void generate(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst) override; + virtual bool hash_exists(uint32_t mode, uint32_t pc) override; virtual void get_info(drcbe_info &info) override; virtual bool logging() const override { return m_log != nullptr; } @@ -61,13 +61,13 @@ private: }; // represents the value of a parameter - typedef UINT64 be_parameter_value; + typedef uint64_t be_parameter_value; // construction be_parameter() : m_type(PTYPE_NONE), m_value(0) { } be_parameter(const be_parameter ¶m) : m_type(param.m_type), m_value(param.m_value) { } - be_parameter(UINT64 val) : m_type(PTYPE_IMMEDIATE), m_value(val) { } - be_parameter(drcbe_x64 &drcbe, const uml::parameter ¶m, UINT32 allowed); + be_parameter(uint64_t val) : m_type(PTYPE_IMMEDIATE), m_value(val) { } + be_parameter(drcbe_x64 &drcbe, const uml::parameter ¶m, uint32_t allowed); // creators for types that don't safely default static inline be_parameter make_ireg(int regnum) { assert(regnum >= 0 && regnum < x64emit::REG_MAX); return be_parameter(PTYPE_INT_REGISTER, regnum); } @@ -82,7 +82,7 @@ private: // getters be_parameter_type type() const { return m_type; } - UINT64 immediate() const { assert(m_type == PTYPE_IMMEDIATE); return m_value; } + uint64_t immediate() const { assert(m_type == PTYPE_IMMEDIATE); return m_value; } int ireg() const { assert(m_type == PTYPE_INT_REGISTER); assert(m_value < x64emit::REG_MAX); return m_value; } int freg() const { assert(m_type == PTYPE_FLOAT_REGISTER); assert(m_value < x64emit::REG_MAX); return m_value; } int vreg() const { assert(m_type == PTYPE_VECTOR_REGISTER); assert(m_value < x64emit::REG_MAX); return m_value; } @@ -96,7 +96,7 @@ private: bool is_memory() const { return (m_type == PTYPE_MEMORY); } // other queries - bool is_immediate_value(UINT64 value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); } + bool is_immediate_value(uint64_t value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); } // helpers int select_register(int defreg) const; @@ -114,11 +114,11 @@ private: // helpers x86_memref MABS(const void *ptr); - bool short_immediate(INT64 immediate) const { return (INT32)immediate == immediate; } + bool short_immediate(int64_t immediate) const { return (int32_t)immediate == immediate; } void normalize_commutative(be_parameter &inner, be_parameter &outer); - INT32 offset_from_rbp(const void *ptr); - int get_base_register_and_offset(x86code *&dst, void *target, UINT8 reg, INT32 &offset); - void emit_smart_call_r64(x86code *&dst, x86code *target, UINT8 reg); + int32_t offset_from_rbp(const void *ptr); + int get_base_register_and_offset(x86code *&dst, void *target, uint8_t reg, int32_t &offset); + void emit_smart_call_r64(x86code *&dst, x86code *target, uint8_t reg); void emit_smart_call_m64(x86code *&dst, x86code **target); void fixup_label(void *parameter, drccodeptr labelcodeptr); @@ -212,86 +212,86 @@ private: void op_icopyf(x86code *&dst, const uml::instruction &inst); // 32-bit code emission helpers - void emit_mov_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m); - void emit_movsx_r64_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m); - void emit_mov_r32_p32_keepflags(x86code *&dst, UINT8 reg, const be_parameter ¶m); + void emit_mov_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m); + void emit_movsx_r64_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m); + void emit_mov_r32_p32_keepflags(x86code *&dst, uint8_t reg, const be_parameter ¶m); void emit_mov_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m); - void emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, UINT8 reg); - void emit_add_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, uint8_t reg); + void emit_add_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_add_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_adc_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_adc_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_adc_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sub_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_sub_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_sub_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sbb_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_sbb_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_sbb_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_cmp_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_cmp_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_cmp_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_and_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_and_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_and_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_test_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_test_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_test_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_or_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_or_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_or_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_xor_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_xor_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_xor_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_shl_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_shl_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_shl_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_shr_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_shr_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_shr_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sar_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_sar_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_sar_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_rol_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_rol_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_rol_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_ror_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_ror_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_ror_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_rcl_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_rcl_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_rcl_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_rcr_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_rcr_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_rcr_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); // 64-bit code emission helpers - void emit_mov_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m); - void emit_mov_r64_p64_keepflags(x86code *&dst, UINT8 reg, const be_parameter ¶m); - void emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, UINT8 reg); - void emit_add_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_mov_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m); + void emit_mov_r64_p64_keepflags(x86code *&dst, uint8_t reg, const be_parameter ¶m); + void emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, uint8_t reg); + void emit_add_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_add_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_adc_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_adc_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_adc_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sub_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_sub_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_sub_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sbb_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_sbb_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_sbb_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_cmp_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_cmp_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_cmp_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_and_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_and_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_and_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_test_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_test_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_test_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_or_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_or_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_or_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_xor_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_xor_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_xor_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_shl_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_shl_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_shl_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_shr_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_shr_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_shr_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sar_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_sar_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_sar_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_rol_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_rol_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_rol_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_ror_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_ror_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_ror_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_rcl_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_rcl_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_rcl_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_rcr_r64_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_rcr_r64_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_rcr_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); // floating-point code emission helpers - void emit_movss_r128_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m); - void emit_movss_p32_r128(x86code *&dst, const be_parameter ¶m, UINT8 reg); - void emit_movsd_r128_p64(x86code *&dst, UINT8 reg, const be_parameter ¶m); - void emit_movsd_p64_r128(x86code *&dst, const be_parameter ¶m, UINT8 reg); + void emit_movss_r128_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m); + void emit_movss_p32_r128(x86code *&dst, const be_parameter ¶m, uint8_t reg); + void emit_movsd_r128_p64(x86code *&dst, uint8_t reg, const be_parameter ¶m); + void emit_movsd_p64_r128(x86code *&dst, const be_parameter ¶m, uint8_t reg); // internal state drc_hash_table m_hash; // hash table state @@ -300,9 +300,9 @@ private: x86log_context * m_log; // logging bool m_sse41; // do we have SSE4.1 support? - UINT32 * m_absmask32; // absolute value mask (32-bit) - UINT64 * m_absmask64; // absolute value mask (32-bit) - UINT8 * m_rbpvalue; // value of RBP + uint32_t * m_absmask32; // absolute value mask (32-bit) + uint64_t * m_absmask64; // absolute value mask (32-bit) + uint8_t * m_rbpvalue; // value of RBP x86_entry_point_func m_entry; // entry point x86code * m_exit; // exit point @@ -319,17 +319,17 @@ private: x86code * debug_log_hashjmp_fail; // hashjmp debugging x86code * drcmap_get_value; // map lookup helper - UINT32 ssemode; // saved SSE mode - UINT32 ssemodesave; // temporary location for saving - UINT32 ssecontrol[4]; // copy of the sse_control array + uint32_t ssemode; // saved SSE mode + uint32_t ssemodesave; // temporary location for saving + uint32_t ssecontrol[4]; // copy of the sse_control array float single1; // 1.0 is single-precision double double1; // 1.0 in double-precision void * stacksave; // saved stack pointer void * hashstacksave; // saved stack pointer for hashjmp - UINT8 flagsmap[0x1000]; // flags map - UINT64 flagsunmap[0x20]; // flags unmapper + uint8_t flagsmap[0x1000]; // flags map + uint64_t flagsunmap[0x20]; // flags unmapper }; near_state & m_near; diff --git a/src/devices/cpu/drcbex86.cpp b/src/devices/cpu/drcbex86.cpp index 4bd869b410d..53dbe1eb347 100644 --- a/src/devices/cpu/drcbex86.cpp +++ b/src/devices/cpu/drcbex86.cpp @@ -115,15 +115,15 @@ using x86emit::REG_EDI; // CONSTANTS //************************************************************************** -const UINT32 PTYPE_M = 1 << parameter::PTYPE_MEMORY; -const UINT32 PTYPE_I = 1 << parameter::PTYPE_IMMEDIATE; -const UINT32 PTYPE_R = 1 << parameter::PTYPE_INT_REGISTER; -const UINT32 PTYPE_F = 1 << parameter::PTYPE_FLOAT_REGISTER; -//const UINT32 PTYPE_MI = PTYPE_M | PTYPE_I; -//const UINT32 PTYPE_RI = PTYPE_R | PTYPE_I; -const UINT32 PTYPE_MR = PTYPE_M | PTYPE_R; -const UINT32 PTYPE_MRI = PTYPE_M | PTYPE_R | PTYPE_I; -const UINT32 PTYPE_MF = PTYPE_M | PTYPE_F; +const uint32_t PTYPE_M = 1 << parameter::PTYPE_MEMORY; +const uint32_t PTYPE_I = 1 << parameter::PTYPE_IMMEDIATE; +const uint32_t PTYPE_R = 1 << parameter::PTYPE_INT_REGISTER; +const uint32_t PTYPE_F = 1 << parameter::PTYPE_FLOAT_REGISTER; +//const uint32_t PTYPE_MI = PTYPE_M | PTYPE_I; +//const uint32_t PTYPE_RI = PTYPE_R | PTYPE_I; +const uint32_t PTYPE_MR = PTYPE_M | PTYPE_R; +const uint32_t PTYPE_MRI = PTYPE_M | PTYPE_R | PTYPE_I; +const uint32_t PTYPE_MF = PTYPE_M | PTYPE_F; @@ -148,20 +148,20 @@ const UINT32 PTYPE_MF = PTYPE_M | PTYPE_F; drcbe_x86::opcode_generate_func drcbe_x86::s_opcode_table[OP_MAX]; // size-to-mask table -//static const UINT64 size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) }; +//static const uint64_t size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) }; // register mapping tables -static const UINT8 int_register_map[REG_I_COUNT] = +static const uint8_t int_register_map[REG_I_COUNT] = { REG_EBX, REG_ESI, REG_EDI, REG_EBP }; // flags mapping tables -static UINT8 flags_map[0x1000]; -static UINT32 flags_unmap[0x20]; +static uint8_t flags_map[0x1000]; +static uint32_t flags_unmap[0x20]; // condition mapping table -static const UINT8 condition_map[uml::COND_MAX - uml::COND_Z] = +static const uint8_t condition_map[uml::COND_MAX - uml::COND_Z] = { x86emit::COND_Z, // COND_Z = 0x80, requires Z x86emit::COND_NZ, // COND_NZ, requires Z @@ -182,7 +182,7 @@ static const UINT8 condition_map[uml::COND_MAX - uml::COND_Z] = }; // FPU control register mapping -static const UINT16 fp_control[4] = +static const uint16_t fp_control[4] = { 0x0e3f, // ROUND_TRUNC 0x023f, // ROUND_ROUND @@ -298,7 +298,7 @@ const drcbe_x86::opcode_table_entry drcbe_x86::s_opcode_table_source[] = // into a reduced set //------------------------------------------------- -drcbe_x86::be_parameter::be_parameter(drcbe_x86 &drcbe, const parameter ¶m, UINT32 allowed) +drcbe_x86::be_parameter::be_parameter(drcbe_x86 &drcbe, const parameter ¶m, uint32_t allowed) { int regnum; @@ -447,12 +447,12 @@ inline void drcbe_x86::reset_last_upper_lower_reg() // loaded a lower register //------------------------------------------------- -inline void drcbe_x86::set_last_lower_reg(x86code *&dst, const be_parameter ¶m, UINT8 reglo) +inline void drcbe_x86::set_last_lower_reg(x86code *&dst, const be_parameter ¶m, uint8_t reglo) { if (param.is_memory()) { m_last_lower_reg = reglo; - m_last_lower_addr = (UINT32 *)((uintptr_t)param.memory()); + m_last_lower_addr = (uint32_t *)((uintptr_t)param.memory()); m_last_lower_pc = dst; } } @@ -463,10 +463,10 @@ inline void drcbe_x86::set_last_lower_reg(x86code *&dst, const be_parameter &par // loaded an upper register //------------------------------------------------- -inline void drcbe_x86::set_last_upper_reg(x86code *&dst, const be_parameter ¶m, UINT8 reghi) +inline void drcbe_x86::set_last_upper_reg(x86code *&dst, const be_parameter ¶m, uint8_t reghi) { m_last_upper_reg = reghi; - m_last_upper_addr = (param.is_int_register()) ? m_reghi[param.ireg()] : (UINT32 *)((uintptr_t)param.memory(4)); + m_last_upper_addr = (param.is_int_register()) ? m_reghi[param.ireg()] : (uint32_t *)((uintptr_t)param.memory(4)); m_last_upper_pc = dst; } @@ -476,7 +476,7 @@ inline void drcbe_x86::set_last_upper_reg(x86code *&dst, const be_parameter &par // skip re-loading a lower half of a register //------------------------------------------------- -inline bool drcbe_x86::can_skip_lower_load(x86code *&dst, UINT32 *memref, UINT8 reglo) +inline bool drcbe_x86::can_skip_lower_load(x86code *&dst, uint32_t *memref, uint8_t reglo) { return (dst == m_last_lower_pc && memref == m_last_lower_addr && reglo == m_last_lower_reg); } @@ -487,7 +487,7 @@ inline bool drcbe_x86::can_skip_lower_load(x86code *&dst, UINT32 *memref, UINT8 // skip re-loading an upper half of a register //------------------------------------------------- -inline bool drcbe_x86::can_skip_upper_load(x86code *&dst, UINT32 *memref, UINT8 reghi) +inline bool drcbe_x86::can_skip_upper_load(x86code *&dst, uint32_t *memref, uint8_t reghi) { return (dst == m_last_upper_pc && memref == m_last_upper_addr && reghi == m_last_upper_reg); } @@ -516,7 +516,7 @@ inline void drcbe_x86::track_resolve_link(x86code *&destptr, const emit_link &li // drcbe_x86 - constructor //------------------------------------------------- -drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, UINT32 flags, int modes, int addrbits, int ignorebits) +drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, uint32_t flags, int modes, int addrbits, int ignorebits) : drcbe_interface(drcuml, cache, device), m_hash(cache, modes, addrbits, ignorebits), m_map(cache, 0), @@ -556,7 +556,7 @@ drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, U // build the flags map (static but it doesn't hurt to regenerate it) for (int entry = 0; entry < ARRAY_LENGTH(flags_map); entry++) { - UINT8 flags = 0; + uint8_t flags = 0; if (entry & 0x001) flags |= FLAG_C; if (entry & 0x004) flags |= FLAG_U; if (entry & 0x040) flags |= FLAG_Z; @@ -566,7 +566,7 @@ drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, U } for (int entry = 0; entry < ARRAY_LENGTH(flags_unmap); entry++) { - UINT32 flags = 0; + uint32_t flags = 0; if (entry & FLAG_C) flags |= 0x001; if (entry & FLAG_U) flags |= 0x004; if (entry & FLAG_Z) flags |= 0x040; @@ -618,7 +618,7 @@ void drcbe_x86::reset() x86code *dst = (x86code *)*cachetop; // generate a simple CPUID stub - UINT32 (*cpuid_ecx_stub)(void) = (UINT32 (*)(void))dst; + uint32_t (*cpuid_ecx_stub)(void) = (uint32_t (*)(void))dst; emit_push_r32(dst, REG_EBX); // push ebx emit_mov_r32_imm(dst, REG_EAX, 1); // mov eax,1 emit_cpuid(dst); // cpuid @@ -767,7 +767,7 @@ int drcbe_x86::execute(code_handle &entry) // drcbex86_generate - generate code //------------------------------------------------- -void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, UINT32 numinst) +void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, uint32_t numinst) { // tell all of our utility objects that a block is beginning m_hash.block_begin(block, instlist, numinst); @@ -803,7 +803,7 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, UINT3 if (inst.opcode() == OP_HANDLE) blockname = inst.param(0).handle().string(); else if (inst.opcode() == OP_HASH) - blockname = string_format("Code: mode=%d PC=%08X", (UINT32)inst.param(0).immediate(), (offs_t)inst.param(1).immediate()).c_str(); + blockname = string_format("Code: mode=%d PC=%08X", (uint32_t)inst.param(0).immediate(), (offs_t)inst.param(1).immediate()).c_str(); } // generate code @@ -830,7 +830,7 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, UINT3 // given mode/pc exists in the hash table //------------------------------------------------- -bool drcbe_x86::hash_exists(UINT32 mode, UINT32 pc) +bool drcbe_x86::hash_exists(uint32_t mode, uint32_t pc) { return m_hash.code_exists(mode, pc); } @@ -860,7 +860,7 @@ void drcbe_x86::get_info(drcbe_info &info) // into a register //------------------------------------------------- -void drcbe_x86::emit_mov_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m) +void drcbe_x86::emit_mov_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m) { if (param.is_immediate()) { @@ -885,13 +885,13 @@ void drcbe_x86::emit_mov_r32_p32(x86code *&dst, UINT8 reg, const be_parameter &p // any flags //------------------------------------------------- -void drcbe_x86::emit_mov_r32_p32_keepflags(x86code *&dst, UINT8 reg, const be_parameter ¶m) +void drcbe_x86::emit_mov_r32_p32_keepflags(x86code *&dst, uint8_t reg, const be_parameter ¶m) { if (param.is_immediate()) emit_mov_r32_imm(dst, reg, param.immediate()); // mov reg,param else if (param.is_memory()) { - if (!can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), reg)) + if (!can_skip_lower_load(dst, (uint32_t *)((uintptr_t)param.memory()), reg)) emit_mov_r32_m32(dst, reg, MABS(param.memory())); // mov reg,[param] } else if (param.is_int_register()) @@ -913,7 +913,7 @@ void drcbe_x86::emit_mov_m32_p32(x86code *&dst, x86_memref memref, const be_para emit_mov_m32_imm(dst, memref, param.immediate()); // mov [mem],param else if (param.is_memory()) { - if (!can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), REG_EAX)) + if (!can_skip_lower_load(dst, (uint32_t *)((uintptr_t)param.memory()), REG_EAX)) emit_mov_r32_m32(dst, REG_EAX, MABS(param.memory())); // mov eax,[param] emit_mov_m32_r32(dst, memref, REG_EAX); // mov [mem],eax } @@ -927,7 +927,7 @@ void drcbe_x86::emit_mov_m32_p32(x86code *&dst, x86_memref memref, const be_para // 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, UINT8 reg) +void drcbe_x86::emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, uint8_t reg) { assert(!param.is_immediate()); if (param.is_memory()) @@ -948,7 +948,7 @@ void drcbe_x86::emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, UINT8 // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_add_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_add_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -988,7 +988,7 @@ void drcbe_x86::emit_add_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_adc_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_adc_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) emit_adc_r32_imm(dst, reg, param.immediate()); // adc reg,param @@ -1022,7 +1022,7 @@ void drcbe_x86::emit_adc_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_sub_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_sub_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { @@ -1062,7 +1062,7 @@ void drcbe_x86::emit_sub_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_sbb_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_sbb_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) emit_sbb_r32_imm(dst, reg, param.immediate()); // sbb reg,param @@ -1096,7 +1096,7 @@ void drcbe_x86::emit_sbb_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_cmp_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_cmp_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) emit_cmp_r32_imm(dst, reg, param.immediate()); // cmp reg,param @@ -1130,13 +1130,13 @@ void drcbe_x86::emit_cmp_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_and_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_and_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) emit_xor_r32_r32(dst, reg, reg); // xor reg,reg else emit_and_r32_imm(dst, reg, param.immediate()); // and reg,param @@ -1157,9 +1157,9 @@ void drcbe_x86::emit_and_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) emit_mov_m32_imm(dst, memref, 0); // mov [dest],0 else emit_and_m32_imm(dst, memref, param.immediate()); // and [dest],param @@ -1178,7 +1178,7 @@ void drcbe_x86::emit_and_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_test_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_test_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) emit_test_r32_imm(dst, reg, param.immediate()); // test reg,param @@ -1213,13 +1213,13 @@ void drcbe_x86::emit_test_m32_p32(x86code *&dst, x86_memref memref, const be_par // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_or_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_or_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_mov_r32_imm(dst, reg, ~0); // mov reg,-1 else emit_or_r32_imm(dst, reg, param.immediate()); // or reg,param @@ -1240,9 +1240,9 @@ void drcbe_x86::emit_or_m32_p32(x86code *&dst, x86_memref memref, const be_param { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_mov_m32_imm(dst, memref, ~0); // mov [dest],-1 else emit_or_m32_imm(dst, memref, param.immediate()); // or [dest],param @@ -1261,13 +1261,13 @@ void drcbe_x86::emit_or_m32_p32(x86code *&dst, x86_memref memref, const be_param // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_xor_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_xor_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_not_r32(dst, reg); // not reg else emit_xor_r32_imm(dst, reg, param.immediate()); // xor reg,param @@ -1288,9 +1288,9 @@ void drcbe_x86::emit_xor_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_not_m32(dst, memref); // not [dest] else emit_xor_m32_imm(dst, memref, param.immediate()); // xor [dest],param @@ -1309,11 +1309,11 @@ void drcbe_x86::emit_xor_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_shl_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_shl_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shl_r32_imm(dst, reg, param.immediate()); // shl reg,param @@ -1335,7 +1335,7 @@ void drcbe_x86::emit_shl_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shl_m32_imm(dst, memref, param.immediate()); // shl [dest],param @@ -1353,11 +1353,11 @@ void drcbe_x86::emit_shl_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_shr_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_shr_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shr_r32_imm(dst, reg, param.immediate()); // shr reg,param @@ -1379,7 +1379,7 @@ void drcbe_x86::emit_shr_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_shr_m32_imm(dst, memref, param.immediate()); // shr [dest],param @@ -1397,11 +1397,11 @@ void drcbe_x86::emit_shr_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_sar_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_sar_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_sar_r32_imm(dst, reg, param.immediate()); // sar reg,param @@ -1423,7 +1423,7 @@ void drcbe_x86::emit_sar_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_sar_m32_imm(dst, memref, param.immediate()); // sar [dest],param @@ -1441,11 +1441,11 @@ void drcbe_x86::emit_sar_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_rol_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_rol_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rol_r32_imm(dst, reg, param.immediate()); // rol reg,param @@ -1467,7 +1467,7 @@ void drcbe_x86::emit_rol_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rol_m32_imm(dst, memref, param.immediate()); // rol [dest],param @@ -1485,11 +1485,11 @@ void drcbe_x86::emit_rol_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_ror_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_ror_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_ror_r32_imm(dst, reg, param.immediate()); // ror reg,param @@ -1511,7 +1511,7 @@ void drcbe_x86::emit_ror_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_ror_m32_imm(dst, memref, param.immediate()); // ror [dest],param @@ -1529,11 +1529,11 @@ void drcbe_x86::emit_ror_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_rcl_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_rcl_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcl_r32_imm(dst, reg, param.immediate()); // rcl reg,param @@ -1555,7 +1555,7 @@ void drcbe_x86::emit_rcl_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcl_m32_imm(dst, memref, param.immediate()); // rcl [dest],param @@ -1573,11 +1573,11 @@ void drcbe_x86::emit_rcl_m32_p32(x86code *&dst, x86_memref memref, const be_para // register from a 32-bit parameter //------------------------------------------------- -void drcbe_x86::emit_rcr_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_rcr_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const instruction &inst) { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcr_r32_imm(dst, reg, param.immediate()); // rcr reg,param @@ -1599,7 +1599,7 @@ void drcbe_x86::emit_rcr_m32_p32(x86code *&dst, x86_memref memref, const be_para { if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip else emit_rcr_m32_imm(dst, memref, param.immediate()); // rcr [dest],param @@ -1622,27 +1622,27 @@ void drcbe_x86::emit_rcr_m32_p32(x86code *&dst, x86_memref memref, const be_para // into a pair of registers //------------------------------------------------- -void drcbe_x86::emit_mov_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m) +void drcbe_x86::emit_mov_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m) { if (param.is_immediate()) { if (reglo == REG_NONE) ; - else if ((UINT32)param.immediate() == 0) + else if ((uint32_t)param.immediate() == 0) emit_xor_r32_r32(dst, reglo, reglo); // xor reglo,reglo else emit_mov_r32_imm(dst, reglo, param.immediate()); // mov reglo,param if (reghi == REG_NONE) ; - else if ((UINT32)(param.immediate() >> 32) == 0) + else if ((uint32_t)(param.immediate() >> 32) == 0) emit_xor_r32_r32(dst, reghi, reghi); // xor reghi,reghi else emit_mov_r32_imm(dst, reghi, param.immediate() >> 32); // mov reghi,param >> 32 } else if (param.is_memory()) { - int skip_lower = can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), reglo); - int skip_upper = can_skip_upper_load(dst, (UINT32 *)((uintptr_t)param.memory(4)), reghi); + int skip_lower = can_skip_lower_load(dst, (uint32_t *)((uintptr_t)param.memory()), reglo); + int skip_upper = can_skip_upper_load(dst, (uint32_t *)((uintptr_t)param.memory(4)), reghi); if (reglo != REG_NONE && !skip_lower) emit_mov_r32_m32(dst, reglo, MABS(param.memory())); // mov reglo,[param] if (reghi != REG_NONE && !skip_upper) @@ -1665,7 +1665,7 @@ void drcbe_x86::emit_mov_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const // affecting any flags //------------------------------------------------- -void drcbe_x86::emit_mov_r64_p64_keepflags(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m) +void drcbe_x86::emit_mov_r64_p64_keepflags(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m) { if (param.is_immediate()) { @@ -1676,8 +1676,8 @@ void drcbe_x86::emit_mov_r64_p64_keepflags(x86code *&dst, UINT8 reglo, UINT8 reg } else if (param.is_memory()) { - int skip_lower = can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), reglo); - int skip_upper = can_skip_upper_load(dst, (UINT32 *)((uintptr_t)param.memory(4)), reghi); + int skip_lower = can_skip_lower_load(dst, (uint32_t *)((uintptr_t)param.memory()), reglo); + int skip_upper = can_skip_upper_load(dst, (uint32_t *)((uintptr_t)param.memory(4)), reghi); if (reglo != REG_NONE && !skip_lower) emit_mov_r32_m32(dst, reglo, MABS(param.memory())); // mov reglo,[param] if (reghi != REG_NONE && !skip_upper) @@ -1708,7 +1708,7 @@ void drcbe_x86::emit_mov_m64_p64(x86code *&dst, x86_memref memref, const be_para } else if (param.is_memory()) { - int skip_lower = can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), REG_EAX); + int skip_lower = can_skip_lower_load(dst, (uint32_t *)((uintptr_t)param.memory()), REG_EAX); if (!skip_lower) emit_mov_r32_m32(dst, REG_EAX, MABS(param.memory())); // mov eax,[param] emit_mov_m32_r32(dst, memref + 0, REG_EAX); // mov [mem],eax @@ -1729,7 +1729,7 @@ void drcbe_x86::emit_mov_m64_p64(x86code *&dst, x86_memref memref, const be_para // into a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, UINT8 reglo, UINT8 reghi) +void drcbe_x86::emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, uint8_t reglo, uint8_t reghi) { assert(!param.is_immediate()); if (param.is_memory()) @@ -1753,7 +1753,7 @@ void drcbe_x86::emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, UINT8 // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_add_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_add_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_memory()) @@ -1811,7 +1811,7 @@ void drcbe_x86::emit_add_m64_p64(x86code *&dst, x86_memref memref, const be_para // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_adc_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_adc_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_memory()) @@ -1869,7 +1869,7 @@ void drcbe_x86::emit_adc_m64_p64(x86code *&dst, x86_memref memref, const be_para // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_sub_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_sub_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_memory()) @@ -1927,7 +1927,7 @@ void drcbe_x86::emit_sub_m64_p64(x86code *&dst, x86_memref memref, const be_para // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_sbb_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_sbb_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_memory()) @@ -1985,7 +1985,7 @@ void drcbe_x86::emit_sbb_m64_p64(x86code *&dst, x86_memref memref, const be_para // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_cmp_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_cmp_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = (inst.flags() != FLAG_Z && (inst.flags() & FLAG_Z) != 0); if (param.is_memory()) @@ -2018,7 +2018,7 @@ void drcbe_x86::emit_cmp_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_and_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_and_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_memory()) @@ -2029,16 +2029,16 @@ void drcbe_x86::emit_and_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const } else if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) emit_xor_r32_r32(dst, reglo, reglo); // xor reglo,reglo else emit_and_r32_imm(dst, reglo, param.immediate()); // and reglo,param if (saveflags) emit_pushf(dst); // pushf - if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0xffffffff) + if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0xffffffff) ;// skip - else if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0) + else if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0) emit_xor_r32_r32(dst, reghi, reghi); // xor reghi,reghi else emit_and_r32_imm(dst, reghi, param.immediate() >> 32); // and reghi,param >> 32 @@ -2064,16 +2064,16 @@ void drcbe_x86::emit_and_m64_p64(x86code *&dst, x86_memref memref, const be_para int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) emit_mov_m32_imm(dst, memref, 0); // mov [dest],0 else emit_and_m32_imm(dst, memref, param.immediate()); // and [dest],param if (saveflags) emit_pushf(dst); // pushf - if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0xffffffff) + if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0xffffffff) ;// skip - else if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0) + else if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0) emit_mov_m32_imm(dst, memref + 4, 0); // mov [dest+4],0 else emit_and_m32_imm(dst, memref + 4, param.immediate() >> 32); // and [dest+4],param >> 32 @@ -2096,7 +2096,7 @@ void drcbe_x86::emit_and_m64_p64(x86code *&dst, x86_memref memref, const be_para // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_test_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_test_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_memory()) @@ -2154,7 +2154,7 @@ void drcbe_x86::emit_test_m64_p64(x86code *&dst, x86_memref memref, const be_par // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_or_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_or_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_memory()) @@ -2165,16 +2165,16 @@ void drcbe_x86::emit_or_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const b } else if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_mov_r32_imm(dst, reglo, ~0); // mov reglo,-1 else emit_or_r32_imm(dst, reglo, param.immediate()); // or reglo,param if (saveflags) emit_pushf(dst); // pushf - if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0) + if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0xffffffff) emit_mov_r32_imm(dst, reghi, ~0); // mov reghi,-1 else emit_or_r32_imm(dst, reghi, param.immediate() >> 32); // or reghi,param >> 32 @@ -2200,16 +2200,16 @@ void drcbe_x86::emit_or_m64_p64(x86code *&dst, x86_memref memref, const be_param int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_mov_m32_imm(dst, memref, ~0); // mov [dest],-1 else emit_or_m32_imm(dst, memref, param.immediate()); // or [dest],param if (saveflags) emit_pushf(dst); // pushf - if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0) + if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0xffffffff) emit_mov_m32_imm(dst, memref + 4, ~0); // mov [dest+4],-1 else emit_or_m32_imm(dst, memref + 4, param.immediate() >> 32); // or [dest+4],param >> 32 @@ -2232,7 +2232,7 @@ void drcbe_x86::emit_or_m64_p64(x86code *&dst, x86_memref memref, const be_param // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_xor_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_xor_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_memory()) @@ -2243,16 +2243,16 @@ void drcbe_x86::emit_xor_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const } else if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_not_r32(dst, reglo); // not reglo else emit_xor_r32_imm(dst, reglo, param.immediate()); // xor reglo,param if (saveflags) emit_pushf(dst); // pushf - if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0) + if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0xffffffff) emit_not_r32(dst, reghi); // not reghi else emit_xor_r32_imm(dst, reghi, param.immediate() >> 32); // xor reghi,param >> 32 @@ -2278,16 +2278,16 @@ void drcbe_x86::emit_xor_m64_p64(x86code *&dst, x86_memref memref, const be_para int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_immediate()) { - if (inst.flags() == 0 && (UINT32)param.immediate() == 0) + if (inst.flags() == 0 && (uint32_t)param.immediate() == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)param.immediate() == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)param.immediate() == 0xffffffff) emit_not_m32(dst, memref); // not [dest] else emit_xor_m32_imm(dst, memref, param.immediate()); // xor [dest],param if (saveflags) emit_pushf(dst); // pushf - if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0) + if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0) ;// skip - else if (inst.flags() == 0 && (UINT32)(param.immediate() >> 32) == 0xffffffff) + else if (inst.flags() == 0 && (uint32_t)(param.immediate() >> 32) == 0xffffffff) emit_not_m32(dst, memref + 4); // not [dest+4] else emit_xor_m32_imm(dst, memref + 4, param.immediate() >> 32); // xor [dest+4],param >> 32 @@ -2310,7 +2310,7 @@ void drcbe_x86::emit_xor_m64_p64(x86code *&dst, x86_memref memref, const be_para // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_shl_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_shl_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = (inst.flags() != 0); if (param.is_immediate()) @@ -2381,7 +2381,7 @@ void drcbe_x86::emit_shl_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_shr_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_shr_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_immediate()) @@ -2452,7 +2452,7 @@ void drcbe_x86::emit_shr_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_sar_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_sar_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_immediate()) @@ -2523,7 +2523,7 @@ void drcbe_x86::emit_sar_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_rol_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_rol_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_immediate()) @@ -2598,7 +2598,7 @@ void drcbe_x86::emit_rol_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_ror_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_ror_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); if (param.is_immediate()) @@ -2673,7 +2673,7 @@ void drcbe_x86::emit_ror_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_rcl_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_rcl_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = ((inst.flags() & FLAG_Z) != 0); emit_link skipall, skiploop; @@ -2715,7 +2715,7 @@ void drcbe_x86::emit_rcl_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const // pair of registers from a 64-bit parameter //------------------------------------------------- -void drcbe_x86::emit_rcr_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const instruction &inst) +void drcbe_x86::emit_rcr_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const instruction &inst) { int saveflags = (inst.flags() != 0); emit_link skipall, skiploop; @@ -2812,12 +2812,12 @@ void drcbe_x86::fixup_label(void *parameter, drccodeptr labelcodeptr) else if (src[0] == 0xe9) { src += 1 + 4; - ((UINT32 *)src)[-1] = labelcodeptr - src; + ((uint32_t *)src)[-1] = labelcodeptr - src; } else if (src[0] == 0x0f && (src[1] & 0xf0) == 0x80) { src += 2 + 4; - ((UINT32 *)src)[-1] = labelcodeptr - src; + ((uint32_t *)src)[-1] = labelcodeptr - src; } else fatalerror("fixup_label called with invalid jmp source!\n"); @@ -2844,7 +2844,7 @@ void drcbe_x86::fixup_exception(drccodeptr *codeptr, void *param1, void *param2) // first fixup the jump to get us here drccodeptr dst = *codeptr; - ((UINT32 *)src)[-1] = dst - src; + ((uint32_t *)src)[-1] = dst - src; // then store the exception parameter emit_mov_m32_p32(dst, MABS(&m_state.exp), exp); // mov [exp],exp @@ -3076,8 +3076,8 @@ void drcbe_x86::op_hashjmp(x86code *&dst, const instruction &inst) // a straight immediate jump is direct, though we need the PC in EAX in case of failure if (pcp.is_immediate()) { - UINT32 l1val = (pcp.immediate() >> m_hash.l1shift()) & m_hash.l1mask(); - UINT32 l2val = (pcp.immediate() >> m_hash.l2shift()) & m_hash.l2mask(); + uint32_t l1val = (pcp.immediate() >> m_hash.l1shift()) & m_hash.l1mask(); + uint32_t l2val = (pcp.immediate() >> m_hash.l2shift()) & m_hash.l2mask(); emit_call_m32(dst, MABS(&m_hash.base()[modep.immediate()][l1val][l2val])); // call hash[modep][l1val][l2val] } @@ -3103,8 +3103,8 @@ void drcbe_x86::op_hashjmp(x86code *&dst, const instruction &inst) // fixed PC if (pcp.is_immediate()) { - UINT32 l1val = (pcp.immediate() >> m_hash.l1shift()) & m_hash.l1mask(); - UINT32 l2val = (pcp.immediate() >> m_hash.l2shift()) & m_hash.l2mask(); + uint32_t l1val = (pcp.immediate() >> m_hash.l1shift()) & m_hash.l1mask(); + uint32_t l2val = (pcp.immediate() >> m_hash.l2shift()) & m_hash.l2mask(); emit_mov_r32_m32(dst, REG_EDX, MBD(REG_ECX, l1val*4)); // mov edx,[ecx+l1val*4] emit_call_m32(dst, MBD(REG_EDX, l2val*4)); // call [l2val*4] } @@ -3416,7 +3416,7 @@ void drcbe_x86::op_getflgs(x86code *&dst, const instruction &inst) int dstreg = dstp.select_register(REG_EAX); // compute mask for flags - UINT32 flagmask = 0; + uint32_t flagmask = 0; if (maskp.immediate() & FLAG_C) flagmask |= 0x001; if (maskp.immediate() & FLAG_V) flagmask |= 0x800; if (maskp.immediate() & FLAG_Z) flagmask |= 0x040; @@ -4097,7 +4097,7 @@ void drcbe_x86::op_carry(x86code *&dst, const instruction &inst) // degenerate case: source is immediate if (srcp.is_immediate() && bitp.is_immediate()) { - if (srcp.immediate() & ((UINT64)1 << bitp.immediate())) + if (srcp.immediate() & ((uint64_t)1 << bitp.immediate())) emit_stc(dst); else emit_clc(dst); @@ -4769,8 +4769,8 @@ void drcbe_x86::op_cmp(x86code *&dst, const instruction &inst) void drcbe_x86::op_mulu(x86code *&dst, const instruction &inst) { - UINT8 zsflags = inst.flags() & (FLAG_Z | FLAG_S); - UINT8 vflag = inst.flags() & FLAG_V; + uint8_t zsflags = inst.flags() & (FLAG_Z | FLAG_S); + uint8_t vflag = inst.flags() & FLAG_V; // validate instruction assert(inst.size() == 4 || inst.size() == 8); @@ -4855,13 +4855,13 @@ void drcbe_x86::op_mulu(x86code *&dst, const instruction &inst) emit_call(dst, (x86code *)dmulu); // call dmulu if (inst.flags() != 0) emit_push_m32(dst, MABSI(flags_unmap, REG_EAX, 4)); // push flags_unmap[eax*4] - emit_mov_r32_m32(dst, REG_EAX, MABS((UINT32 *)&m_reslo + 0)); // mov eax,reslo.lo - emit_mov_r32_m32(dst, REG_EDX, MABS((UINT32 *)&m_reslo + 1)); // mov edx,reslo.hi + emit_mov_r32_m32(dst, REG_EAX, MABS((uint32_t *)&m_reslo + 0)); // mov eax,reslo.lo + emit_mov_r32_m32(dst, REG_EDX, MABS((uint32_t *)&m_reslo + 1)); // mov edx,reslo.hi emit_mov_p64_r64(dst, dstp, REG_EAX, REG_EDX); // mov dstp,edx:eax if (compute_hi) { - emit_mov_r32_m32(dst, REG_EAX, MABS((UINT32 *)&m_reshi + 0)); // mov eax,reshi.lo - emit_mov_r32_m32(dst, REG_ECX, MABS((UINT32 *)&m_reshi + 1)); // mov ecx,reshi.hi + emit_mov_r32_m32(dst, REG_EAX, MABS((uint32_t *)&m_reshi + 0)); // mov eax,reshi.lo + emit_mov_r32_m32(dst, REG_ECX, MABS((uint32_t *)&m_reshi + 1)); // mov ecx,reshi.hi emit_mov_p64_r64(dst, edstp, REG_EAX, REG_ECX); // mov edstp,ecx:eax } if (inst.flags() != 0) @@ -4876,8 +4876,8 @@ void drcbe_x86::op_mulu(x86code *&dst, const instruction &inst) void drcbe_x86::op_muls(x86code *&dst, const instruction &inst) { - UINT8 zsflags = inst.flags() & (FLAG_Z | FLAG_S); - UINT8 vflag = inst.flags() & FLAG_V; + uint8_t zsflags = inst.flags() & (FLAG_Z | FLAG_S); + uint8_t vflag = inst.flags() & FLAG_V; // validate instruction assert(inst.size() == 4 || inst.size() == 8); @@ -4985,13 +4985,13 @@ void drcbe_x86::op_muls(x86code *&dst, const instruction &inst) emit_call(dst, (x86code *)dmuls); // call dmuls if (inst.flags() != 0) emit_push_m32(dst, MABSI(flags_unmap, REG_EAX, 4)); // push flags_unmap[eax*4] - emit_mov_r32_m32(dst, REG_EAX, MABS((UINT32 *)&m_reslo + 0)); // mov eax,reslo.lo - emit_mov_r32_m32(dst, REG_EDX, MABS((UINT32 *)&m_reslo + 1)); // mov edx,reslo.hi + emit_mov_r32_m32(dst, REG_EAX, MABS((uint32_t *)&m_reslo + 0)); // mov eax,reslo.lo + emit_mov_r32_m32(dst, REG_EDX, MABS((uint32_t *)&m_reslo + 1)); // mov edx,reslo.hi emit_mov_p64_r64(dst, dstp, REG_EAX, REG_EDX); // mov dstp,edx:eax if (compute_hi) { - emit_mov_r32_m32(dst, REG_EAX, MABS((UINT32 *)&m_reshi + 0)); // mov eax,reshi.lo - emit_mov_r32_m32(dst, REG_EDX, MABS((UINT32 *)&m_reshi + 1)); // mov edx,reshi.hi + emit_mov_r32_m32(dst, REG_EAX, MABS((uint32_t *)&m_reshi + 0)); // mov eax,reshi.lo + emit_mov_r32_m32(dst, REG_EDX, MABS((uint32_t *)&m_reshi + 1)); // mov edx,reshi.hi emit_mov_p64_r64(dst, edstp, REG_EAX, REG_EDX); // mov edstp,edx:eax } if (inst.flags() != 0) @@ -5055,13 +5055,13 @@ void drcbe_x86::op_divu(x86code *&dst, const instruction &inst) emit_call(dst, (x86code *)ddivu); // call ddivu if (inst.flags() != 0) emit_push_m32(dst, MABSI(flags_unmap, REG_EAX, 4)); // push flags_unmap[eax*4] - emit_mov_r32_m32(dst, REG_EAX, MABS((UINT32 *)&m_reslo + 0)); // mov eax,reslo.lo - emit_mov_r32_m32(dst, REG_EDX, MABS((UINT32 *)&m_reslo + 1)); // mov edx,reslo.hi + emit_mov_r32_m32(dst, REG_EAX, MABS((uint32_t *)&m_reslo + 0)); // mov eax,reslo.lo + emit_mov_r32_m32(dst, REG_EDX, MABS((uint32_t *)&m_reslo + 1)); // mov edx,reslo.hi emit_mov_p64_r64(dst, dstp, REG_EAX, REG_EDX); // mov dstp,edx:eax if (compute_rem) { - emit_mov_r32_m32(dst, REG_EAX, MABS((UINT32 *)&m_reshi + 0)); // mov eax,reshi.lo - emit_mov_r32_m32(dst, REG_EDX, MABS((UINT32 *)&m_reshi + 1)); // mov edx,reshi.hi + emit_mov_r32_m32(dst, REG_EAX, MABS((uint32_t *)&m_reshi + 0)); // mov eax,reshi.lo + emit_mov_r32_m32(dst, REG_EDX, MABS((uint32_t *)&m_reshi + 1)); // mov edx,reshi.hi emit_mov_p64_r64(dst, edstp, REG_EAX, REG_EDX); // mov edstp,edx:eax } if (inst.flags() != 0) @@ -5125,13 +5125,13 @@ void drcbe_x86::op_divs(x86code *&dst, const instruction &inst) emit_call(dst, (x86code *)ddivs); // call ddivs if (inst.flags() != 0) emit_push_m32(dst, MABSI(flags_unmap, REG_EAX, 4)); // push flags_unmap[eax*4] - emit_mov_r32_m32(dst, REG_EAX, MABS((UINT32 *)&m_reslo + 0)); // mov eax,reslo.lo - emit_mov_r32_m32(dst, REG_EDX, MABS((UINT32 *)&m_reslo + 1)); // mov edx,reslo.hi + emit_mov_r32_m32(dst, REG_EAX, MABS((uint32_t *)&m_reslo + 0)); // mov eax,reslo.lo + emit_mov_r32_m32(dst, REG_EDX, MABS((uint32_t *)&m_reslo + 1)); // mov edx,reslo.hi emit_mov_p64_r64(dst, dstp, REG_EAX, REG_EDX); // mov dstp,edx:eax if (compute_rem) { - emit_mov_r32_m32(dst, REG_EAX, MABS((UINT32 *)&m_reshi + 0)); // mov eax,reshi.lo - emit_mov_r32_m32(dst, REG_EDX, MABS((UINT32 *)&m_reshi + 1)); // mov edx,reshi.hi + emit_mov_r32_m32(dst, REG_EAX, MABS((uint32_t *)&m_reshi + 0)); // mov eax,reshi.lo + emit_mov_r32_m32(dst, REG_EDX, MABS((uint32_t *)&m_reshi + 1)); // mov edx,reshi.hi emit_mov_p64_r64(dst, edstp, REG_EAX, REG_EDX); // mov edstp,edx:eax } if (inst.flags() != 0) @@ -6206,7 +6206,7 @@ void drcbe_x86::op_ffrint(x86code *&dst, const instruction &inst) if (srcp.is_immediate()) { emit_mov_m32_imm(dst, MABS(&m_fptemp), srcp.immediate()); // mov [fptemp],srcp - emit_mov_m32_imm(dst, MABS((UINT8 *)&m_fptemp + 4), srcp.immediate()); // mov [fptemp+4],srcp + emit_mov_m32_imm(dst, MABS((uint8_t *)&m_fptemp + 4), srcp.immediate()); // mov [fptemp+4],srcp emit_fild_m64(dst, MABS(&m_fptemp)); // fild [fptemp] } else if (srcp.is_memory()) @@ -6615,7 +6615,7 @@ void drcbe_x86::op_icopyf(x86code *&dst, const instruction &inst) // dmulu - perform a double-wide unsigned multiply //------------------------------------------------- -int drcbe_x86::dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int flags) +int drcbe_x86::dmulu(uint64_t &dstlo, uint64_t &dsthi, uint64_t src1, uint64_t src2, int flags) { // shortcut if we don't care about the high bits or the flags if (&dstlo == &dsthi && flags == 0) @@ -6625,8 +6625,8 @@ int drcbe_x86::dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int } // fetch source values - UINT64 a = src1; - UINT64 b = src2; + uint64_t a = src1; + uint64_t b = src2; if (a == 0 || b == 0) { dsthi = dstlo = 0; @@ -6634,17 +6634,17 @@ int drcbe_x86::dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int } // compute high and low parts first - UINT64 lo = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 0); - UINT64 hi = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 32); + uint64_t lo = (uint64_t)(uint32_t)(a >> 0) * (uint64_t)(uint32_t)(b >> 0); + uint64_t hi = (uint64_t)(uint32_t)(a >> 32) * (uint64_t)(uint32_t)(b >> 32); // compute middle parts - UINT64 prevlo = lo; - UINT64 temp = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 0); + uint64_t prevlo = lo; + uint64_t temp = (uint64_t)(uint32_t)(a >> 32) * (uint64_t)(uint32_t)(b >> 0); lo += temp << 32; hi += (temp >> 32) + (lo < prevlo); prevlo = lo; - temp = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 32); + temp = (uint64_t)(uint32_t)(a >> 0) * (uint64_t)(uint32_t)(b >> 32); lo += temp << 32; hi += (temp >> 32) + (lo < prevlo); @@ -6659,10 +6659,10 @@ int drcbe_x86::dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int // dmuls - perform a double-wide signed multiply //------------------------------------------------- -int drcbe_x86::dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int flags) +int drcbe_x86::dmuls(uint64_t &dstlo, uint64_t &dsthi, int64_t src1, int64_t src2, int flags) { - UINT64 lo, hi, prevlo; - UINT64 a, b, temp; + uint64_t lo, hi, prevlo; + uint64_t a, b, temp; // shortcut if we don't care about the high bits or the flags if (&dstlo == &dsthi && flags == 0) @@ -6672,8 +6672,8 @@ int drcbe_x86::dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int f } // fetch absolute source values - a = src1; if ((INT64)a < 0) a = -a; - b = src2; if ((INT64)b < 0) b = -b; + a = src1; if ((int64_t)a < 0) a = -a; + b = src2; if ((int64_t)b < 0) b = -b; if (a == 0 || b == 0) { dsthi = dstlo = 0; @@ -6681,22 +6681,22 @@ int drcbe_x86::dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int f } // compute high and low parts first - lo = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 0); - hi = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 32); + lo = (uint64_t)(uint32_t)(a >> 0) * (uint64_t)(uint32_t)(b >> 0); + hi = (uint64_t)(uint32_t)(a >> 32) * (uint64_t)(uint32_t)(b >> 32); // compute middle parts prevlo = lo; - temp = (UINT64)(UINT32)(a >> 32) * (UINT64)(UINT32)(b >> 0); + temp = (uint64_t)(uint32_t)(a >> 32) * (uint64_t)(uint32_t)(b >> 0); lo += temp << 32; hi += (temp >> 32) + (lo < prevlo); prevlo = lo; - temp = (UINT64)(UINT32)(a >> 0) * (UINT64)(UINT32)(b >> 32); + temp = (uint64_t)(uint32_t)(a >> 0) * (uint64_t)(uint32_t)(b >> 32); lo += temp << 32; hi += (temp >> 32) + (lo < prevlo); // adjust for signage - if ((INT64)(src1 ^ src2) < 0) + if ((int64_t)(src1 ^ src2) < 0) { hi = ~hi + (lo == 0); lo = ~lo + 1; @@ -6705,7 +6705,7 @@ int drcbe_x86::dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int f // store the results dsthi = hi; dstlo = lo; - return ((hi >> 60) & FLAG_S) | ((dsthi != ((INT64)lo >> 63)) << 1); + return ((hi >> 60) & FLAG_S) | ((dsthi != ((int64_t)lo >> 63)) << 1); } @@ -6713,7 +6713,7 @@ int drcbe_x86::dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int f // ddivu - perform a double-wide unsigned divide //------------------------------------------------- -int drcbe_x86::ddivu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2) +int drcbe_x86::ddivu(uint64_t &dstlo, uint64_t &dsthi, uint64_t src1, uint64_t src2) { // do nothing if src2 == 0 if (src2 == 0) @@ -6731,7 +6731,7 @@ int drcbe_x86::ddivu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2) // ddivs - perform a double-wide signed divide //------------------------------------------------- -int drcbe_x86::ddivs(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2) +int drcbe_x86::ddivs(uint64_t &dstlo, uint64_t &dsthi, int64_t src1, int64_t src2) { // do nothing if src2 == 0 if (src2 == 0) diff --git a/src/devices/cpu/drcbex86.h b/src/devices/cpu/drcbex86.h index c5c462c36b1..b7baaf8c9a7 100644 --- a/src/devices/cpu/drcbex86.h +++ b/src/devices/cpu/drcbex86.h @@ -29,18 +29,18 @@ namespace drc { class drcbe_x86 : public drcbe_interface { - typedef UINT32 (*x86_entry_point_func)(x86code *entry); + typedef uint32_t (*x86_entry_point_func)(x86code *entry); public: // construction/destruction - drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, UINT32 flags, int modes, int addrbits, int ignorebits); + drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, uint32_t flags, int modes, int addrbits, int ignorebits); virtual ~drcbe_x86(); // required overrides virtual void reset() override; virtual int execute(uml::code_handle &entry) override; - virtual void generate(drcuml_block &block, const uml::instruction *instlist, UINT32 numinst) override; - virtual bool hash_exists(UINT32 mode, UINT32 pc) override; + virtual void generate(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst) override; + virtual bool hash_exists(uint32_t mode, uint32_t pc) override; virtual void get_info(drcbe_info &info) override; virtual bool logging() const override { return m_log != nullptr; } @@ -62,13 +62,13 @@ private: }; // represents the value of a parameter - typedef UINT64 be_parameter_value; + typedef uint64_t be_parameter_value; // construction be_parameter() : m_type(PTYPE_NONE), m_value(0) { } be_parameter(const be_parameter ¶m) : m_type(param.m_type), m_value(param.m_value) { } - be_parameter(UINT64 val) : m_type(PTYPE_IMMEDIATE), m_value(val) { } - be_parameter(drcbe_x86 &drcbe, const uml::parameter ¶m, UINT32 allowed); + be_parameter(uint64_t val) : m_type(PTYPE_IMMEDIATE), m_value(val) { } + be_parameter(drcbe_x86 &drcbe, const uml::parameter ¶m, uint32_t allowed); // creators for types that don't safely default static inline be_parameter make_ireg(int regnum) { assert(regnum >= 0 && regnum < x86emit::REG_MAX); return be_parameter(PTYPE_INT_REGISTER, regnum); } @@ -83,11 +83,11 @@ private: // getters be_parameter_type type() const { return m_type; } - UINT64 immediate() const { assert(m_type == PTYPE_IMMEDIATE); return m_value; } + uint64_t immediate() const { assert(m_type == PTYPE_IMMEDIATE); return m_value; } int ireg() const { assert(m_type == PTYPE_INT_REGISTER); assert(m_value < x86emit::REG_MAX); return m_value; } int freg() const { assert(m_type == PTYPE_FLOAT_REGISTER); assert(m_value < x86emit::REG_MAX); return m_value; } int vreg() const { assert(m_type == PTYPE_VECTOR_REGISTER); assert(m_value < x86emit::REG_MAX); return m_value; } - void *memory(UINT32 offset = 0) const { assert(m_type == PTYPE_MEMORY); return reinterpret_cast(m_value + offset); } + void *memory(uint32_t offset = 0) const { assert(m_type == PTYPE_MEMORY); return reinterpret_cast(m_value + offset); } // type queries bool is_immediate() const { return (m_type == PTYPE_IMMEDIATE); } @@ -97,7 +97,7 @@ private: bool is_memory() const { return (m_type == PTYPE_MEMORY); } // other queries - bool is_immediate_value(UINT64 value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); } + bool is_immediate_value(uint64_t value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); } // helpers int select_register(int defreg) const; @@ -118,10 +118,10 @@ private: void emit_combine_z_flags(x86code *&dst); void emit_combine_z_shl_flags(x86code *&dst); void reset_last_upper_lower_reg(); - void set_last_lower_reg(x86code *&dst, const be_parameter ¶m, UINT8 reglo); - void set_last_upper_reg(x86code *&dst, const be_parameter ¶m, UINT8 reghi); - bool can_skip_lower_load(x86code *&dst, UINT32 *memref, UINT8 reglo); - bool can_skip_upper_load(x86code *&dst, UINT32 *memref, UINT8 reghi); + void set_last_lower_reg(x86code *&dst, const be_parameter ¶m, uint8_t reglo); + void set_last_upper_reg(x86code *&dst, const be_parameter ¶m, uint8_t reghi); + bool can_skip_lower_load(x86code *&dst, uint32_t *memref, uint8_t reglo); + bool can_skip_upper_load(x86code *&dst, uint32_t *memref, uint8_t reghi); void track_resolve_link(x86code *&destptr, const emit_link &linkinfo); void fixup_label(void *parameter, drccodeptr labelcodeptr); @@ -214,82 +214,82 @@ private: void op_icopyf(x86code *&dst, const uml::instruction &inst); // 32-bit code emission helpers - void emit_mov_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m); - void emit_mov_r32_p32_keepflags(x86code *&dst, UINT8 reg, const be_parameter ¶m); + void emit_mov_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m); + void emit_mov_r32_p32_keepflags(x86code *&dst, uint8_t reg, const be_parameter ¶m); void emit_mov_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m); - void emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, UINT8 reg); - void emit_add_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_mov_p32_r32(x86code *&dst, const be_parameter ¶m, uint8_t reg); + void emit_add_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_add_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_adc_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_adc_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_adc_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sub_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_sub_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_sub_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sbb_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_sbb_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_sbb_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_cmp_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_cmp_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_cmp_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_and_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_and_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_and_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_test_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_test_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_test_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_or_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_or_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_or_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_xor_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_xor_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_xor_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_shl_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_shl_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_shl_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_shr_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_shr_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_shr_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sar_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_sar_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_sar_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_rol_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_rol_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_rol_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_ror_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_ror_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_ror_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_rcl_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_rcl_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_rcl_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_rcr_r32_p32(x86code *&dst, UINT8 reg, const be_parameter ¶m, const uml::instruction &inst); + void emit_rcr_r32_p32(x86code *&dst, uint8_t reg, const be_parameter ¶m, const uml::instruction &inst); void emit_rcr_m32_p32(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); // 64-bit code emission helpers - void emit_mov_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m); - void emit_mov_r64_p64_keepflags(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m); + void emit_mov_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m); + void emit_mov_r64_p64_keepflags(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m); void emit_mov_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m); - void emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, UINT8 reglo, UINT8 reghi); - void emit_add_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_mov_p64_r64(x86code *&dst, const be_parameter ¶m, uint8_t reglo, uint8_t reghi); + void emit_add_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); void emit_add_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_adc_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_adc_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); void emit_adc_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sub_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_sub_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); void emit_sub_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_sbb_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_sbb_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); void emit_sbb_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_cmp_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); - void emit_and_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_cmp_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_and_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); void emit_and_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_test_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_test_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); void emit_test_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_or_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_or_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); void emit_or_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_xor_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_xor_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); void emit_xor_m64_p64(x86code *&dst, x86_memref memref, const be_parameter ¶m, const uml::instruction &inst); - void emit_shl_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); - void emit_shr_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); - void emit_sar_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); - void emit_rol_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); - void emit_ror_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); - void emit_rcl_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); - void emit_rcr_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_shl_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_shr_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_sar_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_rol_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_ror_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_rcl_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); + void emit_rcr_r64_p64(x86code *&dst, uint8_t reglo, uint8_t reghi, const be_parameter ¶m, const uml::instruction &inst); // floating-point code emission helpers void emit_fld_p(x86code *&dst, int size, const be_parameter ¶m); void emit_fstp_p(x86code *&dst, int size, const be_parameter ¶m); // callback helpers - static int dmulu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2, int flags); - static int dmuls(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2, int flags); - static int ddivu(UINT64 &dstlo, UINT64 &dsthi, UINT64 src1, UINT64 src2); - static int ddivs(UINT64 &dstlo, UINT64 &dsthi, INT64 src1, INT64 src2); + static int dmulu(uint64_t &dstlo, uint64_t &dsthi, uint64_t src1, uint64_t src2, int flags); + static int dmuls(uint64_t &dstlo, uint64_t &dsthi, int64_t src1, int64_t src2, int flags); + static int ddivu(uint64_t &dstlo, uint64_t &dsthi, uint64_t src1, uint64_t src2); + static int ddivs(uint64_t &dstlo, uint64_t &dsthi, int64_t src1, int64_t src2); // internal state drc_hash_table m_hash; // hash table state @@ -305,23 +305,23 @@ private: x86code * m_save; // save handler x86code * m_restore; // restore handler - UINT32 * m_reglo[x86emit::REG_MAX];// pointer to low part of data for each register - UINT32 * m_reghi[x86emit::REG_MAX];// pointer to high part of data for each register - UINT8 m_last_lower_reg; // last register we stored a lower from + uint32_t * m_reglo[x86emit::REG_MAX];// pointer to low part of data for each register + uint32_t * m_reghi[x86emit::REG_MAX];// pointer to high part of data for each register + uint8_t m_last_lower_reg; // last register we stored a lower from x86code * m_last_lower_pc; // PC after instruction where we last stored a lower register - UINT32 * m_last_lower_addr; // address where we last stored an lower register - UINT8 m_last_upper_reg; // last register we stored an upper from + uint32_t * m_last_lower_addr; // address where we last stored an lower register + uint8_t m_last_upper_reg; // last register we stored an upper from x86code * m_last_upper_pc; // PC after instruction where we last stored an upper register - UINT32 * m_last_upper_addr; // address where we last stored an upper register + uint32_t * m_last_upper_addr; // address where we last stored an upper register double m_fptemp; // temporary storage for floating point - UINT16 m_fpumode; // saved FPU mode - UINT16 m_fmodesave; // temporary location for saving + uint16_t m_fpumode; // saved FPU mode + uint16_t m_fmodesave; // temporary location for saving void * m_stacksave; // saved stack pointer void * m_hashstacksave; // saved stack pointer for hashjmp - UINT64 m_reslo; // extended low result - UINT64 m_reshi; // extended high result + uint64_t m_reslo; // extended low result + uint64_t m_reshi; // extended high result drc_label_fixup_delegate m_fixup_label; // precomputed delegate for fixups drc_oob_delegate m_fixup_exception; // precomputed delegate for exception fixups diff --git a/src/devices/cpu/drccache.cpp b/src/devices/cpu/drccache.cpp index 113ce0e5392..9c4ba9c3148 100644 --- a/src/devices/cpu/drccache.cpp +++ b/src/devices/cpu/drccache.cpp @@ -184,7 +184,7 @@ void drc_cache::dealloc(void *memory, size_t bytes) // begin_codegen - begin code generation //------------------------------------------------- -drccodeptr *drc_cache::begin_codegen(UINT32 reserve_bytes) +drccodeptr *drc_cache::begin_codegen(uint32_t reserve_bytes) { // can't restart in the middle of codegen assert(m_codegen == nullptr); diff --git a/src/devices/cpu/drccache.h b/src/devices/cpu/drccache.h index 129a54e6936..48243a56482 100644 --- a/src/devices/cpu/drccache.h +++ b/src/devices/cpu/drccache.h @@ -30,7 +30,7 @@ //************************************************************************** // generic code pointer -typedef UINT8 *drccodeptr; +typedef uint8_t *drccodeptr; // helper template for oob codegen @@ -63,7 +63,7 @@ public: void dealloc(void *memory, size_t bytes); // codegen helpers - drccodeptr *begin_codegen(UINT32 reserve_bytes); + drccodeptr *begin_codegen(uint32_t reserve_bytes); drccodeptr end_codegen(); void request_oob_codegen(drc_oob_delegate callback, void *param1 = nullptr, void *param2 = nullptr); diff --git a/src/devices/cpu/drcfe.cpp b/src/devices/cpu/drcfe.cpp index 92753e983d7..dc743f01253 100644 --- a/src/devices/cpu/drcfe.cpp +++ b/src/devices/cpu/drcfe.cpp @@ -23,7 +23,7 @@ // CONSTANTS //************************************************************************** -const UINT32 MAX_STACK_DEPTH = 100; +const uint32_t MAX_STACK_DEPTH = 100; @@ -48,7 +48,7 @@ struct pc_stack_entry // drc_frontend - constructor //------------------------------------------------- -drc_frontend::drc_frontend(device_t &cpu, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) +drc_frontend::drc_frontend(device_t &cpu, uint32_t window_start, uint32_t window_end, uint32_t max_sequence) : m_window_start(window_start), m_window_end(window_end), m_max_sequence(max_sequence), @@ -208,7 +208,7 @@ opcode_desc *drc_frontend::describe_one(offs_t curpc, const opcode_desc *prevdes } } opcode_desc *prev = desc; - for (UINT8 slotnum = 0; slotnum < desc->delayslots; slotnum++) + for (uint8_t slotnum = 0; slotnum < desc->delayslots; slotnum++) { // recursively describe the next instruction opcode_desc *delaydesc = describe_one(delaypc, prev, true); @@ -237,7 +237,7 @@ opcode_desc *drc_frontend::describe_one(offs_t curpc, const opcode_desc *prevdes // of instructions //------------------------------------------------- -void drc_frontend::build_sequence(int start, int end, UINT32 endflag) +void drc_frontend::build_sequence(int start, int end, uint32_t endflag) { // iterate in order from start to end, picking up all non-NULL instructions int consecutive = 0; @@ -250,7 +250,7 @@ void drc_frontend::build_sequence(int start, int end, UINT32 endflag) opcode_desc *curdesc = m_desc_array[descnum]; int nextdescnum = descnum + curdesc->length; opcode_desc *nextdesc = (nextdescnum < end) ? m_desc_array[nextdescnum] : nullptr; - for (UINT8 skipnum = 0; skipnum < curdesc->skipslots && nextdesc != nullptr; skipnum++) + for (uint8_t skipnum = 0; skipnum < curdesc->skipslots && nextdesc != nullptr; skipnum++) { nextdescnum = nextdescnum + nextdesc->length; nextdesc = (nextdescnum < end) ? m_desc_array[nextdescnum] : nullptr; @@ -302,7 +302,7 @@ void drc_frontend::build_sequence(int start, int end, UINT32 endflag) if (curdesc->flags & OPFLAG_END_SEQUENCE) { // figure out which registers we *must* generate, assuming at the end all must be - UINT32 reqmask[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; + uint32_t reqmask[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; if (seqstart != -1) for (int backdesc = descnum; backdesc != seqstart - 1; backdesc--) if (m_desc_array[backdesc] != nullptr) @@ -342,7 +342,7 @@ void drc_frontend::build_sequence(int start, int end, UINT32 endflag) // walking in a backwards direction //------------------------------------------------- -void drc_frontend::accumulate_required_backwards(opcode_desc &desc, UINT32 *reqmask) +void drc_frontend::accumulate_required_backwards(opcode_desc &desc, uint32_t *reqmask) { // recursively handle delay slots if (desc.delay.first() != nullptr) diff --git a/src/devices/cpu/drcfe.h b/src/devices/cpu/drcfe.h index 39d8184e5ff..66b55bcf4fb 100644 --- a/src/devices/cpu/drcfe.h +++ b/src/devices/cpu/drcfe.h @@ -44,39 +44,39 @@ const offs_t BRANCH_TARGET_DYNAMIC = ~0; // opcode branch flags -const UINT32 OPFLAG_IS_UNCONDITIONAL_BRANCH = 0x00000001; // instruction is unconditional branch -const UINT32 OPFLAG_IS_CONDITIONAL_BRANCH = 0x00000002; // instruction is conditional branch -const UINT32 OPFLAG_IS_BRANCH = (OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_IS_CONDITIONAL_BRANCH); -const UINT32 OPFLAG_IS_BRANCH_TARGET = 0x00000004; // instruction is the target of a branch -const UINT32 OPFLAG_IN_DELAY_SLOT = 0x00000008; // instruction is in the delay slot of a branch -const UINT32 OPFLAG_INTRABLOCK_BRANCH = 0x00000010; // instruction branches within the block +const uint32_t OPFLAG_IS_UNCONDITIONAL_BRANCH = 0x00000001; // instruction is unconditional branch +const uint32_t OPFLAG_IS_CONDITIONAL_BRANCH = 0x00000002; // instruction is conditional branch +const uint32_t OPFLAG_IS_BRANCH = (OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_IS_CONDITIONAL_BRANCH); +const uint32_t OPFLAG_IS_BRANCH_TARGET = 0x00000004; // instruction is the target of a branch +const uint32_t OPFLAG_IN_DELAY_SLOT = 0x00000008; // instruction is in the delay slot of a branch +const uint32_t OPFLAG_INTRABLOCK_BRANCH = 0x00000010; // instruction branches within the block // opcode exception flags -const UINT32 OPFLAG_CAN_TRIGGER_SW_INT = 0x00000020; // instruction can trigger a software interrupt -const UINT32 OPFLAG_CAN_EXPOSE_EXTERNAL_INT = 0x00000040; // instruction can expose an external interrupt -const UINT32 OPFLAG_CAN_CAUSE_EXCEPTION = 0x00000080; // instruction may generate exception -const UINT32 OPFLAG_WILL_CAUSE_EXCEPTION = 0x00000100; // instruction will generate exception -const UINT32 OPFLAG_PRIVILEGED = 0x00000200; // instruction is privileged +const uint32_t OPFLAG_CAN_TRIGGER_SW_INT = 0x00000020; // instruction can trigger a software interrupt +const uint32_t OPFLAG_CAN_EXPOSE_EXTERNAL_INT = 0x00000040; // instruction can expose an external interrupt +const uint32_t OPFLAG_CAN_CAUSE_EXCEPTION = 0x00000080; // instruction may generate exception +const uint32_t OPFLAG_WILL_CAUSE_EXCEPTION = 0x00000100; // instruction will generate exception +const uint32_t OPFLAG_PRIVILEGED = 0x00000200; // instruction is privileged // opcode virtual->physical translation flags -const UINT32 OPFLAG_VALIDATE_TLB = 0x00000400; // instruction must validate TLB before execution -const UINT32 OPFLAG_MODIFIES_TRANSLATION = 0x00000800; // instruction modifies the TLB -const UINT32 OPFLAG_COMPILER_PAGE_FAULT = 0x00001000; // compiler hit a page fault when parsing -const UINT32 OPFLAG_COMPILER_UNMAPPED = 0x00002000; // compiler hit unmapped memory when parsing +const uint32_t OPFLAG_VALIDATE_TLB = 0x00000400; // instruction must validate TLB before execution +const uint32_t OPFLAG_MODIFIES_TRANSLATION = 0x00000800; // instruction modifies the TLB +const uint32_t OPFLAG_COMPILER_PAGE_FAULT = 0x00001000; // compiler hit a page fault when parsing +const uint32_t OPFLAG_COMPILER_UNMAPPED = 0x00002000; // compiler hit unmapped memory when parsing // opcode flags -const UINT32 OPFLAG_INVALID_OPCODE = 0x00004000; // instruction is invalid -const UINT32 OPFLAG_VIRTUAL_NOOP = 0x00008000; // instruction is a virtual no-op +const uint32_t OPFLAG_INVALID_OPCODE = 0x00004000; // instruction is invalid +const uint32_t OPFLAG_VIRTUAL_NOOP = 0x00008000; // instruction is a virtual no-op // opcode sequence flow flags -const UINT32 OPFLAG_REDISPATCH = 0x00010000; // instruction must redispatch after completion -const UINT32 OPFLAG_RETURN_TO_START = 0x00020000; // instruction must jump back to the beginning after completion -const UINT32 OPFLAG_END_SEQUENCE = 0x00040000; // this is the last instruction in a sequence -const UINT32 OPFLAG_CAN_CHANGE_MODES = 0x00080000; // instruction can change modes +const uint32_t OPFLAG_REDISPATCH = 0x00010000; // instruction must redispatch after completion +const uint32_t OPFLAG_RETURN_TO_START = 0x00020000; // instruction must jump back to the beginning after completion +const uint32_t OPFLAG_END_SEQUENCE = 0x00040000; // this is the last instruction in a sequence +const uint32_t OPFLAG_CAN_CHANGE_MODES = 0x00080000; // instruction can change modes // execution semantics -const UINT32 OPFLAG_READS_MEMORY = 0x00100000; // instruction reads memory -const UINT32 OPFLAG_WRITES_MEMORY = 0x00200000; // instruction writes memory +const uint32_t OPFLAG_READS_MEMORY = 0x00100000; // instruction reads memory +const uint32_t OPFLAG_WRITES_MEMORY = 0x00200000; // instruction writes memory @@ -102,25 +102,25 @@ struct opcode_desc // copy of up to 16 bytes of opcode union { - UINT8 b[16]; - UINT16 w[8]; - UINT32 l[4]; - UINT64 q[2]; + uint8_t b[16]; + uint16_t w[8]; + uint32_t l[4]; + uint64_t q[2]; } opptr; // pointer to opcode memory // information about this instruction's execution - UINT8 length; // length in bytes of this opcode - UINT8 delayslots; // number of delay slots (for branches) - UINT8 skipslots; // number of skip slots (for branches) - UINT32 flags; // OPFLAG_* opcode flags - UINT32 userflags; // core specific flags - UINT32 userdata0; // core specific data - UINT32 cycles; // number of cycles needed to execute + uint8_t length; // length in bytes of this opcode + uint8_t delayslots; // number of delay slots (for branches) + uint8_t skipslots; // number of skip slots (for branches) + uint32_t flags; // OPFLAG_* opcode flags + uint32_t userflags; // core specific flags + uint32_t userdata0; // core specific data + uint32_t cycles; // number of cycles needed to execute // register usage information - UINT32 regin[4]; // input registers - UINT32 regout[4]; // output registers - UINT32 regreq[4]; // required output registers + uint32_t regin[4]; // input registers + uint32_t regout[4]; // output registers + uint32_t regreq[4]; // required output registers }; @@ -129,7 +129,7 @@ class drc_frontend { public: // construction/destruction - drc_frontend(device_t &cpu, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); + drc_frontend(device_t &cpu, uint32_t window_start, uint32_t window_end, uint32_t max_sequence); virtual ~drc_frontend(); // describe a block @@ -142,14 +142,14 @@ protected: private: // internal helpers opcode_desc *describe_one(offs_t curpc, const opcode_desc *prevdesc, bool in_delay_slot = false); - void build_sequence(int start, int end, UINT32 endflag); - void accumulate_required_backwards(opcode_desc &desc, UINT32 *reqmask); + void build_sequence(int start, int end, uint32_t endflag); + void accumulate_required_backwards(opcode_desc &desc, uint32_t *reqmask); void release_descriptions(); // configuration parameters - UINT32 m_window_start; // code window start offset = startpc - window_start - UINT32 m_window_end; // code window end offset = startpc + window_end - UINT32 m_max_sequence; // maximum instructions to include in a sequence + uint32_t m_window_start; // code window start offset = startpc - window_start + uint32_t m_window_end; // code window end offset = startpc + window_end + uint32_t m_max_sequence; // maximum instructions to include in a sequence // CPU parameters cpu_device & m_cpudevice; // CPU device object diff --git a/src/devices/cpu/drcuml.cpp b/src/devices/cpu/drcuml.cpp index 4b1b4d55a9b..252efa332e5 100644 --- a/src/devices/cpu/drcuml.cpp +++ b/src/devices/cpu/drcuml.cpp @@ -67,10 +67,10 @@ typedef NATIVE_DRC drcbe_native; struct bevalidate_test { opcode_t opcode; - UINT8 size; - UINT8 iflags; - UINT8 flags; - UINT64 param[4]; + uint8_t size; + uint8_t iflags; + uint8_t flags; + uint64_t param[4]; }; @@ -124,7 +124,7 @@ drcbe_interface::~drcbe_interface() // drcuml_state - constructor //------------------------------------------------- -drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int modes, int addrbits, int ignorebits) +drcuml_state::drcuml_state(device_t &device, drc_cache &cache, uint32_t flags, int modes, int addrbits, int ignorebits) : m_device(device), m_cache(cache), m_drcbe_interface(device.machine().options().drc_use_c() ? @@ -196,7 +196,7 @@ void drcuml_state::reset() // begin_block - begin a new code block //------------------------------------------------- -drcuml_block *drcuml_state::begin_block(UINT32 maxinst) +drcuml_block *drcuml_state::begin_block(uint32_t maxinst) { // find an inactive block that matches our qualifications drcuml_block *bestblock = nullptr; @@ -230,7 +230,7 @@ code_handle *drcuml_state::handle_alloc(const char *name) // symbol table //------------------------------------------------- -void drcuml_state::symbol_add(void *base, UINT32 length, const char *name) +void drcuml_state::symbol_add(void *base, uint32_t length, const char *name) { m_symlist.append(*global_alloc(symbol(base, length, name))); } @@ -242,7 +242,7 @@ void drcuml_state::symbol_add(void *base, UINT32 length, const char *name) // found //------------------------------------------------- -const char *drcuml_state::symbol_find(void *base, UINT32 *offset) +const char *drcuml_state::symbol_find(void *base, uint32_t *offset) { drccodeptr search = drccodeptr(base); @@ -295,7 +295,7 @@ void drcuml_state::log_printf(const char *format, ...) // drcuml_block - constructor //------------------------------------------------- -drcuml_block::drcuml_block(drcuml_state &drcuml, UINT32 maxinst) +drcuml_block::drcuml_block(drcuml_state &drcuml, uint32_t maxinst) : m_drcuml(drcuml), m_next(nullptr), m_nextinst(0), @@ -389,7 +389,7 @@ uml::instruction &drcuml_block::append() void drcuml_block::optimize() { - UINT32 mapvar[MAPVAR_COUNT] = { 0 }; + uint32_t mapvar[MAPVAR_COUNT] = { 0 }; // iterate over instructions for (int instnum = 0; instnum < m_nextinst; instnum++) @@ -397,8 +397,8 @@ void drcuml_block::optimize() instruction &inst = m_inst[instnum]; // first compute what flags we need - UINT8 accumflags = 0; - UINT8 remainingflags = inst.output_flags(); + uint8_t accumflags = 0; + uint8_t remainingflags = inst.output_flags(); // scan ahead until we run out of possible remaining flags for (int scannum = instnum + 1; remainingflags != 0 && scannum < m_nextinst; scannum++) @@ -454,11 +454,11 @@ void drcuml_block::disassemble() // print labels, handles, and hashes left justified else if (inst.opcode() == OP_LABEL) - m_drcuml.log_printf("$%X:\n", UINT32(inst.param(0).label())); + m_drcuml.log_printf("$%X:\n", uint32_t(inst.param(0).label())); else if (inst.opcode() == OP_HANDLE) m_drcuml.log_printf("%s:\n", inst.param(0).handle().string()); else if (inst.opcode() == OP_HASH) - m_drcuml.log_printf("(%X,%X):\n", UINT32(inst.param(0).immediate()), UINT32(inst.param(1).immediate())); + m_drcuml.log_printf("(%X,%X):\n", uint32_t(inst.param(0).immediate()), uint32_t(inst.param(1).immediate())); // indent everything else with a tab else @@ -506,7 +506,7 @@ const char *drcuml_block::get_comment_text(const instruction &inst, std::string // mapvars comment about their values else if (inst.opcode() == OP_MAPVAR) { - comment = string_format("m%d = $%X", (int)inst.param(0).mapvar() - MAPVAR_M0, (UINT32)inst.param(1).immediate()); + comment = string_format("m%d = $%X", (int)inst.param(0).mapvar() - MAPVAR_M0, (uint32_t)inst.param(1).immediate()); return comment.c_str(); } @@ -528,7 +528,7 @@ const char *drcuml_block::get_comment_text(const instruction &inst, std::string // array of parameter values //------------------------------------------------- -inline UINT8 effective_test_psize(const opcode_info &opinfo, int pnum, int instsize, const UINT64 *params) +inline uint8_t effective_test_psize(const opcode_info &opinfo, int pnum, int instsize, const uint64_t *params) { switch (opinfo.param[pnum].size) { @@ -809,8 +809,8 @@ static void bevalidate_iterate_over_params(drcuml_state *drcuml, code_handle **h static void bevalidate_iterate_over_flags(drcuml_state *drcuml, code_handle **handles, const bevalidate_test *test, parameter *paramlist) { const opcode_info *opinfo = opcode_info_table[test->opcode()]; - UINT8 flagmask = opinfo->outflags; - UINT8 curmask; + uint8_t flagmask = opinfo->outflags; + uint8_t curmask; // iterate over all possible flag combinations for (curmask = 0; curmask <= flagmask; curmask++) @@ -825,17 +825,17 @@ static void bevalidate_iterate_over_flags(drcuml_state *drcuml, code_handle **ha results -------------------------------------------------*/ -static void bevalidate_execute(drcuml_state *drcuml, code_handle **handles, const bevalidate_test *test, const parameter *paramlist, UINT8 flagmask) +static void bevalidate_execute(drcuml_state *drcuml, code_handle **handles, const bevalidate_test *test, const parameter *paramlist, uint8_t flagmask) { parameter params[ARRAY_LENGTH(test->param)]; drcuml_machine_state istate, fstate; instruction testinst; drcuml_block *block; - UINT64 *parammem; + uint64_t *parammem; int numparams; // allocate memory for parameters - parammem = (UINT64 *)drcuml->cache->alloc_near(sizeof(UINT64) * (ARRAY_LENGTH(test->param) + 1)); + parammem = (uint64_t *)drcuml->cache->alloc_near(sizeof(uint64_t) * (ARRAY_LENGTH(test->param) + 1)); // flush the cache drcuml->reset(); @@ -888,10 +888,10 @@ static void bevalidate_execute(drcuml_state *drcuml, code_handle **handles, cons drcuml->execute(*handles[0]); // verify the results - bevalidate_verify_state(drcuml, &istate, &fstate, test, *(UINT32 *)¶mmem[ARRAY_LENGTH(test->param)], params, &testinst, handles[1]->code, handles[2]->code, flagmask); + bevalidate_verify_state(drcuml, &istate, &fstate, test, *(uint32_t *)¶mmem[ARRAY_LENGTH(test->param)], params, &testinst, handles[1]->code, handles[2]->code, flagmask); // free memory - drcuml->cache->dealloc(parammem, sizeof(UINT64) * (ARRAY_LENGTH(test->param) + 1)); + drcuml->cache->dealloc(parammem, sizeof(uint64_t) * (ARRAY_LENGTH(test->param) + 1)); } @@ -920,8 +920,8 @@ static void bevalidate_initialize_random_state(drcuml_state *drcuml, drcuml_bloc // initialize float registers to random values for (regnum = 0; regnum < ARRAY_LENGTH(state->f); regnum++) { - *(UINT32 *)&state->f[regnum].s.h = machine.rand(); - *(UINT32 *)&state->f[regnum].s.l = machine.rand(); + *(uint32_t *)&state->f[regnum].s.h = machine.rand(); + *(uint32_t *)&state->f[regnum].s.l = machine.rand(); } // initialize map variables to random values @@ -936,7 +936,7 @@ static void bevalidate_initialize_random_state(drcuml_state *drcuml, drcuml_bloc to executing a test -------------------------------------------------*/ -static int bevalidate_populate_state(drcuml_block *block, drcuml_machine_state *state, const bevalidate_test *test, const parameter *paramlist, parameter *params, UINT64 *parammem) +static int bevalidate_populate_state(drcuml_block *block, drcuml_machine_state *state, const bevalidate_test *test, const parameter *paramlist, parameter *params, uint64_t *parammem) { const opcode_info *opinfo = opcode_info_table[test->opcode()]; int numparams = ARRAY_LENGTH(test->param); @@ -978,9 +978,9 @@ static int bevalidate_populate_state(drcuml_block *block, drcuml_machine_state * case parameter::PTYPE_MEMORY: curparam->value = (uintptr_t)¶mmem[pnum]; if (psize == 4) - *(UINT32 *)(uintptr_t)curparam->value = test->param[pnum]; + *(uint32_t *)(uintptr_t)curparam->value = test->param[pnum]; else - *(UINT64 *)(uintptr_t)curparam->value = test->param[pnum]; + *(uint64_t *)(uintptr_t)curparam->value = test->param[pnum]; break; // map variables: issue a MAPVAR instruction to set the value and set the parameter value to the mapvar index @@ -1007,11 +1007,11 @@ static int bevalidate_populate_state(drcuml_block *block, drcuml_machine_state * discrepancies -------------------------------------------------*/ -static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_state *istate, drcuml_machine_state *state, const bevalidate_test *test, UINT32 flags, const parameter *params, const instruction *testinst, drccodeptr codestart, drccodeptr codeend, UINT8 flagmask) +static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_state *istate, drcuml_machine_state *state, const bevalidate_test *test, uint32_t flags, const parameter *params, const instruction *testinst, drccodeptr codestart, drccodeptr codeend, uint8_t flagmask) { const opcode_info *opinfo = opcode_info_table[test->opcode()]; - UINT8 ireg[REG_I_END - REG_I0] = { 0 }; - UINT8 freg[REG_F_END - REG_F0] = { 0 }; + uint8_t ireg[REG_I_END - REG_I0] = { 0 }; + uint8_t freg[REG_F_END - REG_F0] = { 0 }; char errorbuf[1024]; char *errend = errorbuf; int pnum, regnum; @@ -1039,8 +1039,8 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st if (opinfo->param[pnum].output & PIO_OUT) { int psize = effective_test_psize(opinfo, pnum, test->size, test->param); - UINT64 mask = U64(0xffffffffffffffff) >> (64 - 8 * psize); - UINT64 result = 0; + uint64_t mask = U64(0xffffffffffffffff) >> (64 - 8 * psize); + uint64_t result = 0; // fetch the result from the parameters switch (params[pnum].type) @@ -1060,9 +1060,9 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st // memory registers fetch from the memory address case parameter::PTYPE_MEMORY: if (psize == 4) - result = *(UINT32 *)(uintptr_t)params[pnum].value; + result = *(uint32_t *)(uintptr_t)params[pnum].value; else - result = *(UINT64 *)(uintptr_t)params[pnum].value; + result = *(uint64_t *)(uintptr_t)params[pnum].value; break; default: @@ -1072,13 +1072,13 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st // check against the mask if (test->param[pnum] != UNDEFINED_U64 && (result & mask) != (test->param[pnum] & mask)) { - if ((UINT32)mask == mask) + if ((uint32_t)mask == mask) errend += sprintf(errend, " Parameter %d ... result:%08X expected:%08X\n", pnum, - (UINT32)(result & mask), (UINT32)(test->param[pnum] & mask)); + (uint32_t)(result & mask), (uint32_t)(test->param[pnum] & mask)); else errend += sprintf(errend, " Parameter %d ... result:%08X%08X expected:%08X%08X\n", pnum, - (UINT32)((result & mask) >> 32), (UINT32)(result & mask), - (UINT32)((test->param[pnum] & mask) >> 32), (UINT32)(test->param[pnum] & mask)); + (uint32_t)((result & mask) >> 32), (uint32_t)(result & mask), + (uint32_t)((test->param[pnum] & mask) >> 32), (uint32_t)(test->param[pnum] & mask)); } } @@ -1086,15 +1086,15 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st for (regnum = 0; regnum < ARRAY_LENGTH(state->r); regnum++) if (ireg[regnum] == 0 && istate->r[regnum].d != state->r[regnum].d) errend += sprintf(errend, " Register i%d ... result:%08X%08X originally:%08X%08X\n", regnum, - (UINT32)(state->r[regnum].d >> 32), (UINT32)state->r[regnum].d, - (UINT32)(istate->r[regnum].d >> 32), (UINT32)istate->r[regnum].d); + (uint32_t)(state->r[regnum].d >> 32), (uint32_t)state->r[regnum].d, + (uint32_t)(istate->r[regnum].d >> 32), (uint32_t)istate->r[regnum].d); // check source float parameters for unexpected alterations for (regnum = 0; regnum < ARRAY_LENGTH(state->f); regnum++) - if (freg[regnum] == 0 && *(UINT64 *)&istate->f[regnum].d != *(UINT64 *)&state->f[regnum].d) + if (freg[regnum] == 0 && *(uint64_t *)&istate->f[regnum].d != *(uint64_t *)&state->f[regnum].d) errend += sprintf(errend, " Register f%d ... result:%08X%08X originally:%08X%08X\n", regnum, - (UINT32)(*(UINT64 *)&state->f[regnum].d >> 32), (UINT32)*(UINT64 *)&state->f[regnum].d, - (UINT32)(*(UINT64 *)&istate->f[regnum].d >> 32), (UINT32)*(UINT64 *)&istate->f[regnum].d); + (uint32_t)(*(uint64_t *)&state->f[regnum].d >> 32), (uint32_t)*(uint64_t *)&state->f[regnum].d, + (uint32_t)(*(uint64_t *)&istate->f[regnum].d >> 32), (uint32_t)*(uint64_t *)&istate->f[regnum].d); // output the error if we have one if (errend != errorbuf) diff --git a/src/devices/cpu/drcuml.h b/src/devices/cpu/drcuml.h index 5a93b132752..0d90c9412aa 100644 --- a/src/devices/cpu/drcuml.h +++ b/src/devices/cpu/drcuml.h @@ -37,11 +37,11 @@ class drcuml_state; union drcuml_ireg { #ifdef LSB_FIRST - struct { UINT32 l,h; } w; // 32-bit low, high parts of the register + struct { uint32_t l,h; } w; // 32-bit low, high parts of the register #else - struct { UINT32 h,l; } w; // 32-bit low, high parts of the register + struct { uint32_t h,l; } w; // 32-bit low, high parts of the register #endif - UINT64 d; // 64-bit full register + uint64_t d; // 64-bit full register }; @@ -62,17 +62,17 @@ struct drcuml_machine_state { drcuml_ireg r[uml::REG_I_COUNT]; // integer registers drcuml_freg f[uml::REG_F_COUNT]; // floating-point registers - UINT32 exp; // exception parameter register - UINT8 fmod; // fmod (floating-point mode) register - UINT8 flags; // flags state + uint32_t exp; // exception parameter register + uint8_t fmod; // fmod (floating-point mode) register + uint8_t flags; // flags state }; // hints and information about the back-end struct drcbe_info { - UINT8 direct_iregs; // number of direct-mapped integer registers - UINT8 direct_fregs; // number of direct-mapped floating point registers + uint8_t direct_iregs; // number of direct-mapped integer registers + uint8_t direct_fregs; // number of direct-mapped floating point registers }; @@ -83,13 +83,13 @@ class drcuml_block public: // construction/destruction - drcuml_block(drcuml_state &drcuml, UINT32 maxinst); + drcuml_block(drcuml_state &drcuml, uint32_t maxinst); ~drcuml_block(); // getters drcuml_block *next() const { return m_next; } bool inuse() const { return m_inuse; } - UINT32 maxinst() const { return m_maxinst; } + uint32_t maxinst() const { return m_maxinst; } // code generation void begin(); @@ -116,8 +116,8 @@ private: // internal state drcuml_state & m_drcuml; // pointer back to the owning UML drcuml_block * m_next; // pointer to next block - UINT32 m_nextinst; // next instruction to fill in the cache - UINT32 m_maxinst; // maximum number of instructions + uint32_t m_nextinst; // next instruction to fill in the cache + uint32_t m_maxinst; // maximum number of instructions std::vector m_inst; // pointer to the instruction list bool m_inuse; // this block is in use }; @@ -134,8 +134,8 @@ public: // required overrides virtual void reset() = 0; virtual int execute(uml::code_handle &entry) = 0; - virtual void generate(drcuml_block &block, const uml::instruction *instlist, UINT32 numinst) = 0; - virtual bool hash_exists(UINT32 mode, UINT32 pc) = 0; + virtual void generate(drcuml_block &block, const uml::instruction *instlist, uint32_t numinst) = 0; + virtual bool hash_exists(uint32_t mode, uint32_t pc) = 0; virtual void get_info(drcbe_info &info) = 0; virtual bool logging() const { return false; } @@ -155,7 +155,7 @@ class drcuml_state { public: // construction/destruction - drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int modes, int addrbits, int ignorebits); + drcuml_state(device_t &device, drc_cache &cache, uint32_t flags, int modes, int addrbits, int ignorebits); ~drcuml_state(); // getters @@ -167,19 +167,19 @@ public: int execute(uml::code_handle &entry) { return m_beintf.execute(entry); } // code generation - drcuml_block *begin_block(UINT32 maxinst); + drcuml_block *begin_block(uint32_t maxinst); // back-end interface void get_backend_info(drcbe_info &info) { m_beintf.get_info(info); } - bool hash_exists(UINT32 mode, UINT32 pc) { return m_beintf.hash_exists(mode, pc); } - void generate(drcuml_block &block, uml::instruction *instructions, UINT32 count) { m_beintf.generate(block, instructions, count); } + bool hash_exists(uint32_t mode, uint32_t pc) { return m_beintf.hash_exists(mode, pc); } + void generate(drcuml_block &block, uml::instruction *instructions, uint32_t count) { m_beintf.generate(block, instructions, count); } // handle management uml::code_handle *handle_alloc(const char *name); // symbol management - void symbol_add(void *base, UINT32 length, const char *name); - const char *symbol_find(void *base, UINT32 *offset = nullptr); + void symbol_add(void *base, uint32_t length, const char *name); + const char *symbol_find(void *base, uint32_t *offset = nullptr); // logging bool logging() const { return (m_umllog != nullptr); } @@ -195,7 +195,7 @@ private: friend class simple_list; // construction/destruction - symbol(void *base, UINT32 length, const char *name) + symbol(void *base, uint32_t length, const char *name) : m_next(nullptr), m_base(drccodeptr(base)), m_length(length), @@ -209,7 +209,7 @@ private: // internal state symbol * m_next; // link to the next symbol drccodeptr m_base; // base of the symbol - UINT32 m_length; // length of the region covered + uint32_t m_length; // length of the region covered std::string m_name; // name of the symbol }; diff --git a/src/devices/cpu/dsp16/dsp16.cpp b/src/devices/cpu/dsp16/dsp16.cpp index 0c41933bf32..6cefa03836c 100644 --- a/src/devices/cpu/dsp16/dsp16.cpp +++ b/src/devices/cpu/dsp16/dsp16.cpp @@ -34,7 +34,7 @@ const device_type DSP16 = &device_creator; // dsp16_device - constructor //------------------------------------------------- -dsp16_device::dsp16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dsp16_device::dsp16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, DSP16, "DSP16", tag, owner, clock, "dsp16", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 16, 16, -1), m_data_config("data", ENDIANNESS_LITTLE, 16, 16, -1), @@ -225,7 +225,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, std::str case DSP16_AUC: { std::string alignString; - const UINT8 align = m_auc & 0x03; + const uint8_t align = m_auc & 0x03; switch (align) { case 0x00: alignString = "xy"; break; @@ -266,7 +266,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, std::str case DSP16_PIOC: { std::string strobeString; - const UINT8 strobe = (m_pioc & 0x6000) >> 13; + const uint8_t strobe = (m_pioc & 0x6000) >> 13; switch (strobe) { case 0x00: strobeString = "1T"; break; @@ -297,7 +297,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, std::str case DSP16_SIOC: { std::string clkString; - const UINT8 clk = (m_sioc & 0x0180) >> 7; + const uint8_t clk = (m_sioc & 0x0180) >> 7; switch (clk) { case 0x00: clkString = "/4"; break; @@ -326,7 +326,7 @@ void dsp16_device::state_string_export(const device_state_entry &entry, std::str // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 dsp16_device::disasm_min_opcode_bytes() const +uint32_t dsp16_device::disasm_min_opcode_bytes() const { return 2; } @@ -337,7 +337,7 @@ UINT32 dsp16_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 dsp16_device::disasm_max_opcode_bytes() const +uint32_t dsp16_device::disasm_max_opcode_bytes() const { return 4; } @@ -348,7 +348,7 @@ UINT32 dsp16_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t dsp16_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t dsp16_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( dsp16a ); return CPU_DISASSEMBLE_NAME(dsp16a)(this, buffer, pc, oprom, opram, options); @@ -360,19 +360,19 @@ offs_t dsp16_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op MEMORY ACCESSORS ***************************************************************************/ -inline UINT32 dsp16_device::data_read(const UINT16& addr) +inline uint32_t dsp16_device::data_read(const uint16_t& addr) { return m_data->read_word(addr << 1); } -inline void dsp16_device::data_write(const UINT16& addr, const UINT16& data) +inline void dsp16_device::data_write(const uint16_t& addr, const uint16_t& data) { m_data->write_word(addr << 1, data & 0xffff); } -inline UINT32 dsp16_device::opcode_read(const UINT8 pcOffset) +inline uint32_t dsp16_device::opcode_read(const uint8_t pcOffset) { - const UINT16 readPC = m_pc + pcOffset; + const uint16_t readPC = m_pc + pcOffset; return m_direct->read_dword(readPC << 1); } @@ -386,7 +386,7 @@ inline UINT32 dsp16_device::opcode_read(const UINT8 pcOffset) // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 dsp16_device::execute_min_cycles() const +uint32_t dsp16_device::execute_min_cycles() const { return 1; } @@ -397,7 +397,7 @@ UINT32 dsp16_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 dsp16_device::execute_max_cycles() const +uint32_t dsp16_device::execute_max_cycles() const { return 1; } @@ -408,7 +408,7 @@ UINT32 dsp16_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 dsp16_device::execute_input_lines() const +uint32_t dsp16_device::execute_input_lines() const { return 1; } @@ -434,9 +434,9 @@ void dsp16_device::execute_run() debugger_instruction_hook(this, m_pc); // instruction fetch & execute - UINT8 cycles; - UINT8 pcAdvance; - const UINT16 op = opcode_read(); + uint8_t cycles; + uint8_t pcAdvance; + const uint16_t op = opcode_read(); execute_one(op, cycles, pcAdvance); // step diff --git a/src/devices/cpu/dsp16/dsp16.h b/src/devices/cpu/dsp16/dsp16.h index 6e509da0569..1a558f1f18a 100644 --- a/src/devices/cpu/dsp16/dsp16.h +++ b/src/devices/cpu/dsp16/dsp16.h @@ -24,7 +24,7 @@ class dsp16_device : public cpu_device { public: // construction/destruction - dsp16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dsp16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // public interfaces @@ -34,11 +34,11 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 2 - 1) / 2; } // internal /2 divider - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 2); } // internal /2 divider - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 2 - 1) / 2; } // internal /2 divider + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } // internal /2 divider + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -49,9 +49,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // address spaces const address_space_config m_program_config; @@ -59,57 +59,57 @@ protected: // CPU registers // ROM Address Arithmetic Unit (XAAU) (page 2-4) - UINT16 m_i; // 12 bits - UINT16 m_pc; - UINT16 m_pt; - UINT16 m_pr; - UINT16 m_pi; + uint16_t m_i; // 12 bits + uint16_t m_pc; + uint16_t m_pt; + uint16_t m_pr; + uint16_t m_pi; // RAM Address Arithmetic Unit (YAAU) (page 2-6) - UINT16 m_j; // Signed - UINT16 m_k; // Signed - UINT16 m_rb; - UINT16 m_re; - UINT16 m_r0; - UINT16 m_r1; - UINT16 m_r2; - UINT16 m_r3; + uint16_t m_j; // Signed + uint16_t m_k; // Signed + uint16_t m_rb; + uint16_t m_re; + uint16_t m_r0; + uint16_t m_r1; + uint16_t m_r2; + uint16_t m_r3; // Data Arithmetic Unit (DAU) (page 2-6) - UINT16 m_x; - UINT32 m_y; - UINT32 m_p; - UINT64 m_a0; // 36 bits - UINT64 m_a1; // 36 bits - UINT8 m_auc; // 6 bits - UINT16 m_psw; - UINT8 m_c0; - UINT8 m_c1; - UINT8 m_c2; + uint16_t m_x; + uint32_t m_y; + uint32_t m_p; + uint64_t m_a0; // 36 bits + uint64_t m_a1; // 36 bits + uint8_t m_auc; // 6 bits + uint16_t m_psw; + uint8_t m_c0; + uint8_t m_c1; + uint8_t m_c2; // Serial and parallel interfaces (TODO: More here (page 2-13)) - UINT16 m_sioc; - UINT16 m_srta; - UINT16 m_sdx; - UINT16 m_pioc; - UINT16 m_pdx0; // pdx0 & pdx1 refer to the same physical register (page 6-1) - UINT16 m_pdx1; // but we keep them separate for logic's sake. + uint16_t m_sioc; + uint16_t m_srta; + uint16_t m_sdx; + uint16_t m_pioc; + uint16_t m_pdx0; // pdx0 & pdx1 refer to the same physical register (page 6-1) + uint16_t m_pdx1; // but we keep them separate for logic's sake. // internal stuff - UINT16 m_ppc; + uint16_t m_ppc; // This CPU core handles the cache as more of a loop than 15 separate memory elements. // It's a bit of a hack, but it's easier this way (for now). - UINT16 m_cacheStart; - UINT16 m_cacheEnd; - UINT16 m_cacheRedoNextPC; - UINT16 m_cacheIterations; - static const UINT16 CACHE_INVALID = 0xffff; + uint16_t m_cacheStart; + uint16_t m_cacheEnd; + uint16_t m_cacheRedoNextPC; + uint16_t m_cacheIterations; + static const uint16_t CACHE_INVALID = 0xffff; // memory access - inline UINT32 data_read(const UINT16& addr); - inline void data_write(const UINT16& addr, const UINT16& data); - inline UINT32 opcode_read(const UINT8 pcOffset=0); + inline uint32_t data_read(const uint16_t& addr); + inline void data_write(const uint16_t& addr, const uint16_t& data); + inline uint32_t opcode_read(const uint8_t pcOffset=0); // address spaces address_space* m_program; @@ -120,23 +120,23 @@ protected: int m_icount; // operations - void execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance); + void execute_one(const uint16_t& op, uint8_t& cycles, uint8_t& pcAdvance); // table decoders - void* registerFromRImmediateField(const UINT8& R); - void* registerFromRTable(const UINT8& R); - UINT16* registerFromYFieldUpper(const UINT8& Y); + void* registerFromRImmediateField(const uint8_t& R); + void* registerFromRTable(const uint8_t& R); + uint16_t* registerFromYFieldUpper(const uint8_t& Y); // execution - void executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& S); - void executeYFieldPost(const UINT8& Y); - void executeZFieldPartOne(const UINT8& Z, UINT16* rN); - void executeZFieldPartTwo(const UINT8& Z, UINT16* rN); + void executeF1Field(const uint8_t& F1, const uint8_t& D, const uint8_t& S); + void executeYFieldPost(const uint8_t& Y); + void executeZFieldPartOne(const uint8_t& Z, uint16_t* rN); + void executeZFieldPartTwo(const uint8_t& Z, uint16_t* rN); // helpers void* addressYL(); - void writeRegister(void* reg, const UINT16& value); - bool conditionTest(const UINT8& CON); + void writeRegister(void* reg, const uint16_t& value); + bool conditionTest(const uint8_t& CON); // flags bool lmi(); diff --git a/src/devices/cpu/dsp16/dsp16dis.cpp b/src/devices/cpu/dsp16/dsp16dis.cpp index 6b2de29a79c..136eaab0e22 100644 --- a/src/devices/cpu/dsp16/dsp16dis.cpp +++ b/src/devices/cpu/dsp16/dsp16dis.cpp @@ -3,7 +3,7 @@ #include "emu.h" #include "dsp16.h" -std::string disasmF1Field(const UINT8& F1, const UINT8& D, const UINT8& S) +std::string disasmF1Field(const uint8_t& F1, const uint8_t& D, const uint8_t& S) { switch (F1) { @@ -28,7 +28,7 @@ std::string disasmF1Field(const UINT8& F1, const UINT8& D, const UINT8& S) } } -std::string disasmYField(const UINT8& Y) +std::string disasmYField(const uint8_t& Y) { switch (Y) { @@ -58,7 +58,7 @@ std::string disasmYField(const UINT8& Y) //return ""; } -std::string disasmZField(const UINT8& Z) +std::string disasmZField(const uint8_t& Z) { switch (Z) { @@ -88,7 +88,7 @@ std::string disasmZField(const UINT8& Z) //return ""; } -std::string disasmF2Field(const UINT8& F2, const UINT8& D, const UINT8& S) +std::string disasmF2Field(const uint8_t& F2, const uint8_t& D, const uint8_t& S) { std::string ret = ""; switch (F2) @@ -116,7 +116,7 @@ std::string disasmF2Field(const UINT8& F2, const UINT8& D, const UINT8& S) return ret; } -std::string disasmCONField(const UINT8& CON) +std::string disasmCONField(const uint8_t& CON) { switch (CON) { @@ -145,7 +145,7 @@ std::string disasmCONField(const UINT8& CON) //return ""; } -std::string disasmBField(const UINT8& B) +std::string disasmBField(const uint8_t& B) { switch (B) { @@ -164,7 +164,7 @@ std::string disasmBField(const UINT8& B) //return ""; } -std::string disasmRImmediateField(const UINT8& R) +std::string disasmRImmediateField(const uint8_t& R) { switch (R) { @@ -183,7 +183,7 @@ std::string disasmRImmediateField(const UINT8& R) //return ""; } -std::string disasmRField(const UINT8& R) +std::string disasmRField(const uint8_t& R) { switch (R) { @@ -222,7 +222,7 @@ std::string disasmRField(const UINT8& R) //return ""; } -std::string disasmIField(const UINT8& I) +std::string disasmIField(const uint8_t& I) { switch (I) { @@ -237,7 +237,7 @@ std::string disasmIField(const UINT8& I) //return ""; } -bool disasmSIField(const UINT8& SI) +bool disasmSIField(const uint8_t& SI) { switch (SI) { @@ -250,24 +250,24 @@ bool disasmSIField(const UINT8& SI) CPU_DISASSEMBLE( dsp16a ) { - UINT8 opSize = 1; - UINT32 dasmflags = 0; - UINT16 op = oprom[0] | (oprom[1] << 8); - UINT16 op2 = oprom[2] | (oprom[3] << 8); + uint8_t opSize = 1; + uint32_t dasmflags = 0; + uint16_t op = oprom[0] | (oprom[1] << 8); + uint16_t op2 = oprom[2] | (oprom[3] << 8); // TODO: Test for previous "if CON" instruction and tab the next instruction in? - const UINT8 opcode = (op >> 11) & 0x1f; + const uint8_t opcode = (op >> 11) & 0x1f; switch(opcode) { // Format 1: Multiply/ALU Read/Write Group case 0x06: { // F1, Y - const UINT8 Y = (op & 0x000f); - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string yString = disasmYField(Y); std::string fString = disasmF1Field(F1, D, S); sprintf(buffer, "%s, %s", fString.c_str(), yString.c_str()); @@ -276,11 +276,11 @@ CPU_DISASSEMBLE( dsp16a ) case 0x04: case 0x1c: { // F1 Y=a0[1] | F1 Y=a1[1] - const UINT8 Y = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string yString = disasmYField(Y); std::string fString = disasmF1Field(F1, D, S); std::string aString = (opcode == 0x1c) ? "a0" : "a1"; @@ -291,10 +291,10 @@ CPU_DISASSEMBLE( dsp16a ) case 0x16: { // F1, x = Y - const UINT8 Y = (op & 0x000f); - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string yString = disasmYField(Y); std::string fString = disasmF1Field(F1, D, S); sprintf(buffer, "%s, x = %s", fString.c_str(), yString.c_str()); @@ -303,11 +303,11 @@ CPU_DISASSEMBLE( dsp16a ) case 0x17: { // F1, y[l] = Y - const UINT8 Y = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string yString = disasmYField(Y); std::string fString = disasmF1Field(F1, D, S); std::string xString = (X ? "y" : "y1"); @@ -317,11 +317,11 @@ CPU_DISASSEMBLE( dsp16a ) case 0x1f: { // F1, y = Y, x = *pt++[i] - const UINT8 Y = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string yString = disasmYField(Y); std::string fString = disasmF1Field(F1, D, S); std::string xString = (X ? "*pt++i" : "*pt++"); @@ -331,11 +331,11 @@ CPU_DISASSEMBLE( dsp16a ) case 0x19: case 0x1b: { // F1, y = a0|1, x = *pt++[i] - const UINT8 Y = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string fString = disasmF1Field(F1, D, S); std::string xString = (X ? "*pt++i" : "*pt++"); std::string aString = (opcode == 0x19) ? "a0" : "a1"; @@ -346,11 +346,11 @@ CPU_DISASSEMBLE( dsp16a ) case 0x14: { // F1, Y = y[1] - const UINT8 Y = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string yString = disasmYField(Y); std::string xString = (X ? "y" : "y1"); std::string fString = disasmF1Field(F1, D, S); @@ -362,10 +362,10 @@ CPU_DISASSEMBLE( dsp16a ) case 0x07: { // F1, At[1] = Y - const UINT8 Y = (op & 0x000f); - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 aT = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t aT = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string yString = disasmYField(Y); std::string atString = (aT ? "a0" : "a1"); std::string fString = disasmF1Field(F1, aT, S); @@ -377,11 +377,11 @@ CPU_DISASSEMBLE( dsp16a ) case 0x15: { // F1, Z : y[1] - const UINT8 Z = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Z = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string zString = disasmZField(Z); std::string xString = (X ? "y" : "y1"); std::string fString = disasmF1Field(F1, D, S); @@ -391,11 +391,11 @@ CPU_DISASSEMBLE( dsp16a ) case 0x1d: { // F1, Z : y, x=*pt++[i] - const UINT8 Z = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Z = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string zString = disasmZField(Z); std::string xString = (X ? "*pt++i" : "*pt++"); std::string fString = disasmF1Field(F1, D, S); @@ -407,11 +407,11 @@ CPU_DISASSEMBLE( dsp16a ) case 0x05: { // F1, Z : aT[1] - const UINT8 Z = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 aT = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Z = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t aT = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; std::string zString = disasmZField(Z); std::string atString = (aT ? "a0" : "a1"); atString += X ? "" : "1"; // TODO: Figure out unclear wording. @@ -425,10 +425,10 @@ CPU_DISASSEMBLE( dsp16a ) case 0x13: { // if|ifc CON F2 - const UINT8 CON = (op & 0x001f); - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F2 = (op & 0x01e0) >> 5; + const uint8_t CON = (op & 0x001f); + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F2 = (op & 0x01e0) >> 5; std::string fString = disasmF2Field(F2, D, S); std::string conString = disasmCONField(CON); if (op & 0x0800) sprintf(buffer, "if %s : %s", conString.c_str(), fString.c_str()); @@ -440,14 +440,14 @@ CPU_DISASSEMBLE( dsp16a ) case 0x00: case 0x01: { // goto JA - const UINT16 JA = (op & 0x0fff) | (pc & 0xf000); + const uint16_t JA = (op & 0x0fff) | (pc & 0xf000); sprintf(buffer, "goto 0x%04x", JA); break; } case 0x10: case 0x11: { // call JA - const UINT16 JA = (op & 0x0fff) | (pc & 0xf000); + const uint16_t JA = (op & 0x0fff) | (pc & 0xf000); sprintf(buffer, "call 0x%04x", JA); break; } @@ -456,7 +456,7 @@ CPU_DISASSEMBLE( dsp16a ) case 0x18: { // goto B - const UINT8 B = (op & 0x0700) >> 8; + const uint8_t B = (op & 0x0700) >> 8; std::string bString = disasmBField(B); sprintf(buffer, "%s", bString.c_str()); break; @@ -466,7 +466,7 @@ CPU_DISASSEMBLE( dsp16a ) case 0x1a: { // if CON [goto/call/return] - const UINT8 CON = (op & 0x001f); + const uint8_t CON = (op & 0x001f); std::string conString = disasmCONField(CON); sprintf(buffer, "if %s:", conString.c_str()); // TODO: Test for invalid ops @@ -479,8 +479,8 @@ CPU_DISASSEMBLE( dsp16a ) case 0x09: case 0x0b: { // R = aS - const UINT8 R = (op & 0x03f0) >> 4; - const UINT8 S = (op & 0x1000) >> 12; + const uint8_t R = (op & 0x03f0) >> 4; + const uint8_t S = (op & 0x1000) >> 12; std::string rString = disasmRField(R); sprintf(buffer, "%s = %s", rString.c_str(), (S ? "a1" : "a0")); break; @@ -488,8 +488,8 @@ CPU_DISASSEMBLE( dsp16a ) case 0x08: { // aT = R - const UINT8 R = (op & 0x03f0) >> 4; - const UINT8 aT = (op & 0x0400) >> 10; + const uint8_t R = (op & 0x03f0) >> 4; + const uint8_t aT = (op & 0x0400) >> 10; std::string rString = disasmRField(R); sprintf(buffer, "%s = %s", (aT ? "a0" : "a1"), rString.c_str()); break; @@ -497,8 +497,8 @@ CPU_DISASSEMBLE( dsp16a ) case 0x0f: { // R = Y - const UINT8 Y = (op & 0x000f); - const UINT8 R = (op & 0x03f0) >> 4; + const uint8_t Y = (op & 0x000f); + const uint8_t R = (op & 0x03f0) >> 4; std::string yString = disasmYField(Y); std::string rString = disasmRField(R); sprintf(buffer, "%s = %s", rString.c_str(), yString.c_str()); @@ -508,8 +508,8 @@ CPU_DISASSEMBLE( dsp16a ) case 0x0c: { // Y = R - const UINT8 Y = (op & 0x000f); - const UINT8 R = (op & 0x03f0) >> 4; + const uint8_t Y = (op & 0x000f); + const uint8_t R = (op & 0x03f0) >> 4; std::string yString = disasmYField(Y); std::string rString = disasmRField(R); // TODO: page 3-31 "special function encoding" @@ -519,8 +519,8 @@ CPU_DISASSEMBLE( dsp16a ) case 0x0d: { // Z : R - const UINT8 Z = (op & 0x000f); - const UINT8 R = (op & 0x03f0) >> 4; + const uint8_t Z = (op & 0x000f); + const uint8_t R = (op & 0x03f0) >> 4; std::string zString = disasmZField(Z); std::string rString = disasmRField(R); sprintf(buffer, "%s <=> %s", zString.c_str(), rString.c_str()); @@ -531,7 +531,7 @@ CPU_DISASSEMBLE( dsp16a ) case 0x0a: { // R = N - const UINT8 R = (op & 0x03f0) >> 4; + const uint8_t R = (op & 0x03f0) >> 4; std::string rString = disasmRField(R); sprintf(buffer, "%s = 0x%04x", rString.c_str(), op2); opSize = 2; @@ -542,8 +542,8 @@ CPU_DISASSEMBLE( dsp16a ) case 0x02: case 0x03: { // R = M - const UINT16 M = (op & 0x01ff); - const UINT8 R = (op & 0x0e00) >> 9; + const uint16_t M = (op & 0x01ff); + const uint8_t R = (op & 0x0e00) >> 9; std::string rString = disasmRImmediateField(R); sprintf(buffer, "%s = 0x%04x", rString.c_str(), M); break; @@ -553,8 +553,8 @@ CPU_DISASSEMBLE( dsp16a ) case 0x0e: { // do|redo K - const UINT8 K = (op & 0x007f); - const UINT8 NI = (op & 0x0780) >> 7; + const uint8_t K = (op & 0x007f); + const uint8_t NI = (op & 0x0780) >> 7; sprintf(buffer, "do (next %d inst) %d times", NI, K); // TODO: Limits on K & NI if (NI == 0x00) diff --git a/src/devices/cpu/dsp16/dsp16ops.hxx b/src/devices/cpu/dsp16/dsp16ops.hxx index 23d8797e64d..6893819f754 100644 --- a/src/devices/cpu/dsp16/dsp16ops.hxx +++ b/src/devices/cpu/dsp16/dsp16ops.hxx @@ -24,7 +24,7 @@ // The YL register is the lower half of the 32 bit Y register void* dsp16_device::addressYL() { - return (void*)(((UINT8*)&m_y) + 2); + return (void*)(((uint8_t*)&m_y) + 2); } @@ -50,7 +50,7 @@ bool dsp16_device::lmv() } -void dsp16_device::writeRegister(void* reg, const UINT16 &value) +void dsp16_device::writeRegister(void* reg, const uint16_t &value) { // Make sure you're not attempting to write somewhere this function doesn't support. if (reg == &m_p || reg == &m_a0 || reg == &m_a1) @@ -62,7 +62,7 @@ void dsp16_device::writeRegister(void* reg, const UINT16 &value) if (reg == &m_auc || reg == &m_c0 || reg == &m_c1 || reg == &m_c2) { // 8 bit registers - *(UINT8*)reg = value & 0x00ff; + *(uint8_t*)reg = value & 0x00ff; } else if (reg == &m_psw) { @@ -92,12 +92,12 @@ void dsp16_device::writeRegister(void* reg, const UINT16 &value) else { // Everything else - *(UINT16*)reg = value; + *(uint16_t*)reg = value; } } -bool dsp16_device::conditionTest(const UINT8& CON) +bool dsp16_device::conditionTest(const uint8_t& CON) { switch (CON) { @@ -128,7 +128,7 @@ bool dsp16_device::conditionTest(const UINT8& CON) } -void* dsp16_device::registerFromRImmediateField(const UINT8& R) +void* dsp16_device::registerFromRImmediateField(const uint8_t& R) { switch (R) { @@ -147,7 +147,7 @@ void* dsp16_device::registerFromRImmediateField(const UINT8& R) } -void* dsp16_device::registerFromRTable(const UINT8 &R) +void* dsp16_device::registerFromRTable(const uint8_t &R) { switch (R) { @@ -186,7 +186,7 @@ void* dsp16_device::registerFromRTable(const UINT8 &R) } -void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& S) +void dsp16_device::executeF1Field(const uint8_t& F1, const uint8_t& D, const uint8_t& S) { // TODO: I'm pretty sure we need to feed X into these as well - Double check @@ -195,7 +195,7 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& // implementation details (page 3-9) // Where is are the results going? - UINT64* destinationReg = nullptr; + uint64_t* destinationReg = nullptr; switch (D) { case 0x00: destinationReg = &m_a0; break; @@ -204,7 +204,7 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& } // Which source is being used? - UINT64* sourceReg = nullptr; + uint64_t* sourceReg = nullptr; switch (S) { case 0x00: sourceReg = &m_a0; break; @@ -214,7 +214,7 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& // We must compute into an intermediate variable to compute flags on - UINT64 result = 0; + uint64_t result = 0; bool justATest = false; switch (F1) @@ -235,8 +235,8 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& { // p = x*y // TODO: What happens to the flags in this operation? - const INT16 y = (m_y & 0xffff0000) >> 16; - m_p = (INT32)((INT16)m_x * y); + const int16_t y = (m_y & 0xffff0000) >> 16; + m_p = (int32_t)((int16_t)m_x * y); justATest = true; break; } @@ -292,11 +292,11 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& case 0x0b: { // aS-y - INT64 aS = *sourceReg; + int64_t aS = *sourceReg; if (aS & U64(0x800000000)) aS |= U64(0xfffffff000000000); - INT64 y = (m_y & 0xffff0000) >> 16; + int64_t y = (m_y & 0xffff0000) >> 16; if (y & 0x8000) y |= U64(0xffffffffffff0000); @@ -313,11 +313,11 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& case 0x0d: { // Ad = aS+y - INT64 aS = *sourceReg; + int64_t aS = *sourceReg; if (aS & U64(0x800000000)) aS |= U64(0xfffffff000000000); - INT64 y = (m_y & 0xffff0000) >> 16; + int64_t y = (m_y & 0xffff0000) >> 16; if (y & 0x8000) y |= U64(0xffffffffffff0000); @@ -333,11 +333,11 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& case 0x0f: { // Ad = aS-y - INT64 aS = *sourceReg; + int64_t aS = *sourceReg; if (aS & U64(0x800000000)) aS |= U64(0xfffffff000000000); - INT64 y = (m_y & 0xffff0000) >> 16; + int64_t y = (m_y & 0xffff0000) >> 16; if (y & 0x8000) y |= U64(0xffffffffffff0000); @@ -371,14 +371,14 @@ void dsp16_device::executeF1Field(const UINT8& F1, const UINT8& D, const UINT8& // If it was a real operation, make sure the data goes where it should if (!justATest) - *destinationReg = (UINT64)result & U64(0x0000000fffffffff); + *destinationReg = (uint64_t)result & U64(0x0000000fffffffff); } -UINT16* dsp16_device::registerFromYFieldUpper(const UINT8& Y) +uint16_t* dsp16_device::registerFromYFieldUpper(const uint8_t& Y) { - UINT16* destinationReg = nullptr; - const UINT8 N = (Y & 0x0c) >> 2; + uint16_t* destinationReg = nullptr; + const uint8_t N = (Y & 0x0c) >> 2; switch (N) { case 0x00: destinationReg = &m_r0; break; @@ -391,11 +391,11 @@ UINT16* dsp16_device::registerFromYFieldUpper(const UINT8& Y) } -void dsp16_device::executeYFieldPost(const UINT8& Y) +void dsp16_device::executeYFieldPost(const uint8_t& Y) { - UINT16* opReg = registerFromYFieldUpper(Y); + uint16_t* opReg = registerFromYFieldUpper(Y); - const UINT8 lower = Y & 0x03; + const uint8_t lower = Y & 0x03; switch (lower) { case 0x00: /* nop */ break; @@ -406,9 +406,9 @@ void dsp16_device::executeYFieldPost(const UINT8& Y) } -void dsp16_device::executeZFieldPartOne(const UINT8& Z, UINT16* rN) +void dsp16_device::executeZFieldPartOne(const uint8_t& Z, uint16_t* rN) { - const UINT8 lower = Z & 0x03; + const uint8_t lower = Z & 0x03; switch (lower) { case 0x00: /* nop */ break; @@ -419,9 +419,9 @@ void dsp16_device::executeZFieldPartOne(const UINT8& Z, UINT16* rN) } -void dsp16_device::executeZFieldPartTwo(const UINT8& Z, UINT16* rN) +void dsp16_device::executeZFieldPartTwo(const uint8_t& Z, uint16_t* rN) { - const UINT8 lower = Z & 0x03; + const uint8_t lower = Z & 0x03; switch (lower) { case 0x00: (*rN)++; break; @@ -432,14 +432,14 @@ void dsp16_device::executeZFieldPartTwo(const UINT8& Z, UINT16* rN) } -void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance) +void dsp16_device::execute_one(const uint16_t& op, uint8_t& cycles, uint8_t& pcAdvance) { cycles = 1; pcAdvance = 0; // NOTE: pages 3-5 through 3-19 are good english descriptions of what's up - const UINT8 opcode = (op >> 11) & 0x1f; + const uint8_t opcode = (op >> 11) & 0x1f; switch(opcode) { // Format 1: Multiply/ALU Read/Write Group @@ -447,10 +447,10 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-38") // F1, Y : (page 3-38) - const UINT8 Y = (op & 0x000f); - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; executeF1Field(F1, D, S); executeYFieldPost(Y); cycles = 1; @@ -461,14 +461,14 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-40") // F1 Y=a0[1] | F1 Y=a1[1] : (page 3-40) - const UINT8 Y = (op & 0x000f); - //const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; - UINT16* destinationReg = registerFromYFieldUpper(Y); + const uint8_t Y = (op & 0x000f); + //const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; + uint16_t* destinationReg = registerFromYFieldUpper(Y); // (page 3-18) - UINT16 aRegValue = 0x0000; + uint16_t aRegValue = 0x0000; if (op & 0xc000) { aRegValue = (m_a0 & U64(0x0ffff0000)) >> 16; @@ -488,12 +488,12 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-42") // F1, x = Y : (page 3-42) - const UINT8 Y = (op & 0x000f); - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; executeF1Field(F1, D, S); - UINT16* sourceReg = registerFromYFieldUpper(Y); + uint16_t* sourceReg = registerFromYFieldUpper(Y); writeRegister(&m_x, data_read(*sourceReg)); executeYFieldPost(Y); cycles = 1; @@ -504,14 +504,14 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-44") // F1, y[l] = Y : (page 3-44) - const UINT8 Y = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; executeF1Field(F1, D, S); - UINT16* sourceReg = registerFromYFieldUpper(Y); - UINT16 sourceValue = data_read(*sourceReg); + uint16_t* sourceReg = registerFromYFieldUpper(Y); + uint16_t sourceValue = data_read(*sourceReg); switch (X) { case 0x00: writeRegister(addressYL(), sourceValue); break; @@ -527,13 +527,13 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-46") // F1, y = Y, x = *pt++[i] : (page 3-46) - const UINT8 Y = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; executeF1Field(F1, D, S); - UINT16* sourceRegR = registerFromYFieldUpper(Y); + uint16_t* sourceRegR = registerFromYFieldUpper(Y); writeRegister(&m_y, data_read(*sourceRegR)); executeYFieldPost(Y); writeRegister(&m_x, data_read(m_pt)); @@ -550,11 +550,11 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-48") // F1, y = a0|1, x = *pt++[i] : (page 3-48) - const UINT8 Y = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; bool useA1 = (opcode == 0x1b); if (Y != 0x00) printf("Unknown opcode @ PC=0x%04x", m_pc); m_y = (useA1) ? (m_a1 & 0xffffffff) : (m_a0 & 0xffffffff); // TODO: What happens to Ax when it goes 32 bit (pc=3f & pc=47)? @@ -573,14 +573,14 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-53") // F1, Y = y[l] : (page 3-53) - const UINT8 Y = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; executeF1Field(F1, D, S); - UINT16* destinationReg = registerFromYFieldUpper(Y); - UINT16 yRegValue = 0x0000; + uint16_t* destinationReg = registerFromYFieldUpper(Y); + uint16_t yRegValue = 0x0000; switch (X) { case 0x00: yRegValue = (m_y & 0x0000ffff); break; @@ -600,20 +600,20 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance DSP_LINE("3-50") // F1, At[1] = Y : (page 3-50) // TODO: What does the X field do here, exactly? - const UINT8 Y = (op & 0x000f); - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 aT = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Y = (op & 0x000f); + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t aT = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; executeF1Field(F1, !aT, S); - UINT64* destinationReg = nullptr; + uint64_t* destinationReg = nullptr; switch(aT) { case 0: destinationReg = &m_a1; break; case 1: destinationReg = &m_a0; break; default: break; } - UINT16 sourceAddress = *(registerFromYFieldUpper(Y)); - INT64 sourceValueSigned = (INT16)data_read(sourceAddress); + uint16_t sourceAddress = *(registerFromYFieldUpper(Y)); + int64_t sourceValueSigned = (int16_t)data_read(sourceAddress); *destinationReg = sourceValueSigned & U64(0xffffffffff); executeYFieldPost(Y); cycles = 1; @@ -626,14 +626,14 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-54") // F1, Z : y[l] : (page 3-54) - const UINT8 Z = (op & 0x000f); - const UINT8 X = (op & 0x0010) >> 4; - const UINT8 S = (op & 0x0200) >> 9; - const UINT8 D = (op & 0x0400) >> 10; - const UINT8 F1 = (op & 0x01e0) >> 5; + const uint8_t Z = (op & 0x000f); + const uint8_t X = (op & 0x0010) >> 4; + const uint8_t S = (op & 0x0200) >> 9; + const uint8_t D = (op & 0x0400) >> 10; + const uint8_t F1 = (op & 0x01e0) >> 5; executeF1Field(F1, D, S); - UINT16 temp = 0x0000; - UINT16* rN = registerFromYFieldUpper(Z); + uint16_t temp = 0x0000; + uint16_t* rN = registerFromYFieldUpper(Z); switch (X) { case 0x00: @@ -661,11 +661,11 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("?") // F1, Z : y, x=*pt++[i] - //const UINT8 Z = (op & 0x000f); - //const UINT8 X = (op & 0x0010) >> 4; - //const UINT8 S = (op & 0x0200) >> 9; - //const UINT8 D = (op & 0x0400) >> 10; - //const UINT8 F1 = (op & 0x01e0) >> 5; + //const uint8_t Z = (op & 0x000f); + //const uint8_t X = (op & 0x0010) >> 4; + //const uint8_t S = (op & 0x0200) >> 9; + //const uint8_t D = (op & 0x0400) >> 10; + //const uint8_t F1 = (op & 0x01e0) >> 5; break; } @@ -674,11 +674,11 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("?") // F1, Z : aT[1] - //const UINT8 Z = (op & 0x000f); - //const UINT8 X = (op & 0x0010) >> 4; - //const UINT8 S = (op & 0x0200) >> 9; - //const UINT8 aT = (op & 0x0400) >> 10; - //const UINT8 F1 = (op & 0x01e0) >> 5; + //const uint8_t Z = (op & 0x000f); + //const uint8_t X = (op & 0x0010) >> 4; + //const uint8_t S = (op & 0x0200) >> 9; + //const uint8_t aT = (op & 0x0400) >> 10; + //const uint8_t F1 = (op & 0x01e0) >> 5; break; } @@ -688,10 +688,10 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-36") // if|ifc CON F2 (page 3-36) - const UINT8 CON = (op & 0x001f); - //const UINT8 S = (op & 0x0200) >> 9; - //const UINT8 D = (op & 0x0400) >> 10; - //const UINT8 F2 = (op & 0x01e0) >> 5; + const uint8_t CON = (op & 0x001f); + //const uint8_t S = (op & 0x0200) >> 9; + //const uint8_t D = (op & 0x0400) >> 10; + //const uint8_t F2 = (op & 0x01e0) >> 5; bool conditionFulfilled = conditionTest(CON); if (conditionFulfilled) { @@ -707,7 +707,7 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-20") // goto JA : (page 3-20) (DONE) - const UINT16 JA = (op & 0x0fff) | (m_pc & 0xf000); + const uint16_t JA = (op & 0x0fff) | (m_pc & 0xf000); m_pc = JA; cycles = 2; pcAdvance = 0; @@ -718,7 +718,7 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-23") // call JA : (page 3-23) - const UINT16 JA = (op & 0x0fff) | (m_pc & 0xf000); + const uint16_t JA = (op & 0x0fff) | (m_pc & 0xf000); m_pr = m_pc + 1; m_pc = JA; cycles = 2; @@ -731,7 +731,7 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-21") // goto B : (page 3-21) - const UINT8 B = (op & 0x0700) >> 8; + const uint8_t B = (op & 0x0700) >> 8; switch (B) { case 0x00: m_pc = m_pr; break; @@ -750,7 +750,7 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-22") // if CON [goto/call/return] : (page 3-22) - const UINT8 CON = (op & 0x001f); + const uint8_t CON = (op & 0x001f); bool conditionFulfilled = conditionTest(CON); cycles = 3; // TODO: This may need to interact with the next opcode to make sure it doesn't exceed 3? pcAdvance = 1; @@ -767,11 +767,11 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance DSP_LINE("3-29") // R = aS : (page 3-29) // TODO: Fix register pdxX (pc=338) - const UINT8 R = (op & 0x03f0) >> 4; - const UINT8 S = (op & 0x1000) >> 12; + const uint8_t R = (op & 0x03f0) >> 4; + const uint8_t S = (op & 0x1000) >> 12; void* destinationReg = registerFromRTable(R); - UINT64* sourceReg = (S) ? &m_a1 : &m_a0; - UINT16 sourceValue = (*sourceReg & U64(0x0ffff0000)) >> 16; + uint64_t* sourceReg = (S) ? &m_a1 : &m_a0; + uint16_t sourceValue = (*sourceReg & U64(0x0ffff0000)) >> 16; writeRegister(destinationReg, sourceValue); cycles = 2; pcAdvance = 1; @@ -781,9 +781,9 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-30") // aT = R : (page 3-30) - const UINT8 R = (op & 0x03f0) >> 4; - const UINT8 aT = (op & 0x0400) >> 10; - UINT64* destinationReg = nullptr; + const uint8_t R = (op & 0x03f0) >> 4; + const uint8_t aT = (op & 0x0400) >> 10; + uint64_t* destinationReg = nullptr; switch(aT) { case 0: destinationReg = &m_a1; break; @@ -792,8 +792,8 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance } void* sourceReg = registerFromRTable(R); *destinationReg &= U64(0x00000ffff); - *destinationReg |= (*(UINT16*)sourceReg) << 16; // TODO: Fix for all registers - if (*(UINT16*)sourceReg & 0x8000) + *destinationReg |= (*(uint16_t*)sourceReg) << 16; // TODO: Fix for all registers + if (*(uint16_t*)sourceReg & 0x8000) *destinationReg |= U64(0xf00000000); // TODO: Special function encoding cycles = 2; @@ -804,9 +804,9 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("3-32") // R = Y : (page 3-32) - const UINT8 Y = (op & 0x000f); - const UINT8 R = (op & 0x03f0) >> 4; - UINT16* sourceReg = registerFromYFieldUpper(Y); + const uint8_t Y = (op & 0x000f); + const uint8_t R = (op & 0x03f0) >> 4; + uint16_t* sourceReg = registerFromYFieldUpper(Y); void* destinationReg = registerFromRTable(R); writeRegister(destinationReg, data_read(*sourceReg)); executeYFieldPost(Y); @@ -819,10 +819,10 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance DSP_LINE("3-33") // Y = R : (page 3-33) // TODO: Zero & Sign extend i, c0, c1, c2, and auc - const UINT8 Y = (op & 0x000f); - const UINT8 R = (op & 0x03f0) >> 4; - UINT16* destinationReg = registerFromYFieldUpper(Y); - UINT16* sourceReg = (UINT16*)registerFromRTable(R); // TODO: This won't work for certain registers! + const uint8_t Y = (op & 0x000f); + const uint8_t R = (op & 0x03f0) >> 4; + uint16_t* destinationReg = registerFromYFieldUpper(Y); + uint16_t* sourceReg = (uint16_t*)registerFromRTable(R); // TODO: This won't work for certain registers! data_write(*destinationReg, *sourceReg); // Fix in data_write() maybe? executeYFieldPost(Y); cycles = 2; @@ -833,8 +833,8 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance { DSP_LINE("?") // Z : R - //const UINT8 Z = (op & 0x000f); - //const UINT8 R = (op & 0x03f0) >> 4; + //const uint8_t Z = (op & 0x000f); + //const uint8_t R = (op & 0x03f0) >> 4; break; } @@ -845,8 +845,8 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance // R = N : (page 3-28) (DONE) // NOTE: The docs speak of register sources & sign extension, but this is a register // destination, so, typo? If so, what does one do with the overflow bits? - const UINT8 R = (op & 0x03f0) >> 4; - const UINT16 iVal = opcode_read(1); + const uint8_t R = (op & 0x03f0) >> 4; + const uint16_t iVal = opcode_read(1); void* destinationReg = registerFromRTable(R); writeRegister(destinationReg, iVal); cycles = 2; @@ -860,11 +860,11 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance DSP_LINE("3-27") // R = M : (page 3-27) // TODO: Figure out notes about the DSP16A vs the DSP16. 9 bit is very DSP16... - const UINT16 M = (op & 0x01ff); - const UINT8 R = (op & 0x0e00) >> 9; + const uint16_t M = (op & 0x01ff); + const uint8_t R = (op & 0x0e00) >> 9; void* destinationReg = registerFromRImmediateField(R); // Sign extend if the destination is j or k - UINT16 mValue = M; + uint16_t mValue = M; if (destinationReg == &m_j || destinationReg == &m_k) { if (mValue & 0x0100) mValue |= 0xfe00; @@ -881,8 +881,8 @@ void dsp16_device::execute_one(const UINT16& op, UINT8& cycles, UINT8& pcAdvance DSP_LINE("3-25/3-26") // do|redo K : (pages 3-25 & 3-26) // TODO: The timings are intricate to say the least... - const UINT8 K = (op & 0x007f); - const UINT8 NI = (op & 0x0780) >> 7; + const uint8_t K = (op & 0x007f); + const uint8_t NI = (op & 0x0780) >> 7; if (NI != 0) { // Do diff --git a/src/devices/cpu/dsp32/dsp32.cpp b/src/devices/cpu/dsp32/dsp32.cpp index 454be6c1aa7..2f0d8d2eeab 100644 --- a/src/devices/cpu/dsp32/dsp32.cpp +++ b/src/devices/cpu/dsp32/dsp32.cpp @@ -142,7 +142,7 @@ const device_type DSP32C = &device_creator; // dsp32c_device - constructor //------------------------------------------------- -dsp32c_device::dsp32c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dsp32c_device::dsp32c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, DSP32C, "DSP32C", tag, owner, clock, "dsp32c", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 32, 24), m_pin(0), @@ -399,7 +399,7 @@ void dsp32c_device::state_string_export(const device_state_entry &entry, std::st // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 dsp32c_device::disasm_min_opcode_bytes() const +uint32_t dsp32c_device::disasm_min_opcode_bytes() const { return 4; } @@ -410,7 +410,7 @@ UINT32 dsp32c_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 dsp32c_device::disasm_max_opcode_bytes() const +uint32_t dsp32c_device::disasm_max_opcode_bytes() const { return 4; } @@ -421,7 +421,7 @@ UINT32 dsp32c_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t dsp32c_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t dsp32c_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( dsp32c ); return CPU_DISASSEMBLE_NAME(dsp32c)(this, buffer, pc, oprom, opram, options); @@ -434,22 +434,22 @@ offs_t dsp32c_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o // MEMORY ACCESSORS //************************************************************************** -inline UINT32 dsp32c_device::ROPCODE(offs_t pc) +inline uint32_t dsp32c_device::ROPCODE(offs_t pc) { return m_direct->read_dword(pc); } -inline UINT8 dsp32c_device::RBYTE(offs_t addr) +inline uint8_t dsp32c_device::RBYTE(offs_t addr) { return m_program->read_byte(addr); } -inline void dsp32c_device::WBYTE(offs_t addr, UINT8 data) +inline void dsp32c_device::WBYTE(offs_t addr, uint8_t data) { m_program->write_byte(addr, data); } -inline UINT16 dsp32c_device::RWORD(offs_t addr) +inline uint16_t dsp32c_device::RWORD(offs_t addr) { #if DETECT_MISALIGNED_MEMORY if (!WORD_ALIGNED(addr)) @@ -458,7 +458,7 @@ inline UINT16 dsp32c_device::RWORD(offs_t addr) return m_program->read_word(addr); } -inline UINT32 dsp32c_device::RLONG(offs_t addr) +inline uint32_t dsp32c_device::RLONG(offs_t addr) { #if DETECT_MISALIGNED_MEMORY if (!DWORD_ALIGNED(addr)) @@ -467,7 +467,7 @@ inline UINT32 dsp32c_device::RLONG(offs_t addr) return m_program->read_dword(addr); } -inline void dsp32c_device::WWORD(offs_t addr, UINT16 data) +inline void dsp32c_device::WWORD(offs_t addr, uint16_t data) { #if DETECT_MISALIGNED_MEMORY if (!WORD_ALIGNED(addr)) @@ -476,7 +476,7 @@ inline void dsp32c_device::WWORD(offs_t addr, UINT16 data) m_program->write_word(addr, data); } -inline void dsp32c_device::WLONG(offs_t addr, UINT32 data) +inline void dsp32c_device::WLONG(offs_t addr, uint32_t data) { #if DETECT_MISALIGNED_MEMORY if (!DWORD_ALIGNED(addr)) @@ -508,9 +508,9 @@ void dsp32c_device::set_irq_line(int irqline, int state) // REGISTER HANDLING //************************************************************************** -void dsp32c_device::update_pcr(UINT16 newval) +void dsp32c_device::update_pcr(uint16_t newval) { - UINT16 oldval = m_pcr; + uint16_t oldval = m_pcr; m_pcr = newval; // reset the chip if we get a reset @@ -528,7 +528,7 @@ void dsp32c_device::update_pins(void) { if (m_pcr & PCR_ENI) { - UINT16 newoutput = 0; + uint16_t newoutput = 0; if (m_pcr & PCR_PIFs) newoutput |= DSP32_OUTPUT_PIF; @@ -563,7 +563,7 @@ void dsp32c_device::update_pins(void) // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 dsp32c_device::execute_min_cycles() const +uint32_t dsp32c_device::execute_min_cycles() const { return 4; } @@ -574,7 +574,7 @@ UINT32 dsp32c_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 dsp32c_device::execute_max_cycles() const +uint32_t dsp32c_device::execute_max_cycles() const { return 4; } @@ -585,7 +585,7 @@ UINT32 dsp32c_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 dsp32c_device::execute_input_lines() const +uint32_t dsp32c_device::execute_input_lines() const { return 2; } @@ -630,7 +630,7 @@ void dsp32c_device::execute_run() // PARALLEL INTERFACE WRITES //************************************************************************** -const UINT32 dsp32c_device::s_regmap[4][16] = +const uint32_t dsp32c_device::s_regmap[4][16] = { { // DSP32 compatible mode PIO_PAR|LOWER, PIO_PAR|UPPER, PIO_PDR|LOWER, PIO_PDR|UPPER, @@ -681,7 +681,7 @@ void dsp32c_device::dma_load() // only process if DMA is enabled if (m_pcr & PCR_DMA) { - UINT32 addr = m_par | (m_pare << 16); + uint32_t addr = m_par | (m_pare << 16); // 16-bit case if (!(m_pcr & PCR_DMA32)) @@ -690,7 +690,7 @@ void dsp32c_device::dma_load() // 32-bit case else { - UINT32 temp = RLONG(addr & 0xfffffc); + uint32_t temp = RLONG(addr & 0xfffffc); m_pdr = temp >> 16; m_pdr2 = temp & 0xffff; } @@ -706,7 +706,7 @@ void dsp32c_device::dma_store() // only process if DMA is enabled if (m_pcr & PCR_DMA) { - UINT32 addr = m_par | (m_pare << 16); + uint32_t addr = m_par | (m_pare << 16); // 16-bit case if (!(m_pcr & PCR_DMA32)) @@ -724,8 +724,8 @@ void dsp32c_device::dma_store() void dsp32c_device::pio_w(int reg, int data) { - UINT16 mask; - UINT8 mode; + uint16_t mask; + uint8_t mode; // look up register and mask mode = ((m_pcr >> 8) & 2) | ((m_pcr >> 1) & 1); @@ -806,8 +806,8 @@ void dsp32c_device::pio_w(int reg, int data) int dsp32c_device::pio_r(int reg) { - UINT16 mask, result = 0xffff; - UINT8 mode, shift = 0; + uint16_t mask, result = 0xffff; + uint8_t mode, shift = 0; // look up register and mask mode = ((m_pcr >> 8) & 2) | ((m_pcr >> 1) & 1); diff --git a/src/devices/cpu/dsp32/dsp32.h b/src/devices/cpu/dsp32/dsp32.h index b83888b7a6a..62a56ef4a0a 100644 --- a/src/devices/cpu/dsp32/dsp32.h +++ b/src/devices/cpu/dsp32/dsp32.h @@ -96,7 +96,7 @@ class dsp32c_device : public cpu_device { public: // construction/destruction - dsp32c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dsp32c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_output_pins_callback(device_t &device, _Object object) { return downcast(device).m_output_pins_changed.set_callback(object); } @@ -111,9 +111,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -126,248 +126,248 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // memory accessors - UINT32 ROPCODE(offs_t pc); - UINT8 RBYTE(offs_t addr); - void WBYTE(offs_t addr, UINT8 data); - UINT16 RWORD(offs_t addr); - UINT32 RLONG(offs_t addr); - void WWORD(offs_t addr, UINT16 data); - void WLONG(offs_t addr, UINT32 data); + uint32_t ROPCODE(offs_t pc); + uint8_t RBYTE(offs_t addr); + void WBYTE(offs_t addr, uint8_t data); + uint16_t RWORD(offs_t addr); + uint32_t RLONG(offs_t addr); + void WWORD(offs_t addr, uint16_t data); + void WLONG(offs_t addr, uint32_t data); // interrupts void check_irqs(); void set_irq_line(int irqline, int state); - void update_pcr(UINT16 newval); + void update_pcr(uint16_t newval); void update_pins(void); - void illegal(UINT32 op); - void unimplemented(UINT32 op); + void illegal(uint32_t op); + void unimplemented(uint32_t op); void execute_one(); // CAU helpers - UINT32 cau_read_pi_special(UINT8 i); - void cau_write_pi_special(UINT8 i, UINT32 val); - UINT8 cau_read_pi_1byte(int pi); - UINT16 cau_read_pi_2byte(int pi); - UINT32 cau_read_pi_4byte(int pi); - void cau_write_pi_1byte(int pi, UINT8 val); - void cau_write_pi_2byte(int pi, UINT16 val); - void cau_write_pi_4byte(int pi, UINT32 val); + uint32_t cau_read_pi_special(uint8_t i); + void cau_write_pi_special(uint8_t i, uint32_t val); + uint8_t cau_read_pi_1byte(int pi); + uint16_t cau_read_pi_2byte(int pi); + uint32_t cau_read_pi_4byte(int pi); + void cau_write_pi_1byte(int pi, uint8_t val); + void cau_write_pi_2byte(int pi, uint16_t val); + void cau_write_pi_4byte(int pi, uint32_t val); // DAU helpers double dau_get_amult(int aidx); double dau_get_anzflags(); - UINT8 dau_get_avuflags(); + uint8_t dau_get_avuflags(); void remember_last_dau(int aidx); void dau_set_val_noflags(int aidx, double res); void dau_set_val_flags(int aidx, double res); - double dsp_to_double(UINT32 val); - UINT32 double_to_dsp(double val); + double dsp_to_double(uint32_t val); + uint32_t double_to_dsp(double val); double dau_read_pi_special(int i); void dau_write_pi_special(int i, double val); double dau_read_pi_double_1st(int pi, int multiplier); double dau_read_pi_double_2nd(int pi, int multiplier, double xval); - UINT32 dau_read_pi_4bytes(int pi); - UINT16 dau_read_pi_2bytes(int pi); + uint32_t dau_read_pi_4bytes(int pi); + uint16_t dau_read_pi_2bytes(int pi); void dau_write_pi_double(int pi, double val); - void dau_write_pi_4bytes(int pi, UINT32 val); - void dau_write_pi_2bytes(int pi, UINT16 val); + void dau_write_pi_4bytes(int pi, uint32_t val); + void dau_write_pi_2bytes(int pi, uint16_t val); // common condition routine int condition(int cond); // CAU branch instruction implementation - void nop(UINT32 op); - void goto_t(UINT32 op); - void goto_pl(UINT32 op); - void goto_mi(UINT32 op); - void goto_ne(UINT32 op); - void goto_eq(UINT32 op); - void goto_vc(UINT32 op); - void goto_vs(UINT32 op); - void goto_cc(UINT32 op); - void goto_cs(UINT32 op); - void goto_ge(UINT32 op); - void goto_lt(UINT32 op); - void goto_gt(UINT32 op); - void goto_le(UINT32 op); - void goto_hi(UINT32 op); - void goto_ls(UINT32 op); - void goto_auc(UINT32 op); - void goto_aus(UINT32 op); - void goto_age(UINT32 op); - void goto_alt(UINT32 op); - void goto_ane(UINT32 op); - void goto_aeq(UINT32 op); - void goto_avc(UINT32 op); - void goto_avs(UINT32 op); - void goto_agt(UINT32 op); - void goto_ale(UINT32 op); - void goto_ibe(UINT32 op); - void goto_ibf(UINT32 op); - void goto_obf(UINT32 op); - void goto_obe(UINT32 op); - void goto_pde(UINT32 op); - void goto_pdf(UINT32 op); - void goto_pie(UINT32 op); - void goto_pif(UINT32 op); - void goto_syc(UINT32 op); - void goto_sys(UINT32 op); - void goto_fbc(UINT32 op); - void goto_fbs(UINT32 op); - void goto_irq1lo(UINT32 op); - void goto_irq1hi(UINT32 op); - void goto_irq2lo(UINT32 op); - void goto_irq2hi(UINT32 op); - void dec_goto(UINT32 op); - void call(UINT32 op); - void goto24(UINT32 op); - void call24(UINT32 op); - void do_i(UINT32 op); - void do_r(UINT32 op); + void nop(uint32_t op); + void goto_t(uint32_t op); + void goto_pl(uint32_t op); + void goto_mi(uint32_t op); + void goto_ne(uint32_t op); + void goto_eq(uint32_t op); + void goto_vc(uint32_t op); + void goto_vs(uint32_t op); + void goto_cc(uint32_t op); + void goto_cs(uint32_t op); + void goto_ge(uint32_t op); + void goto_lt(uint32_t op); + void goto_gt(uint32_t op); + void goto_le(uint32_t op); + void goto_hi(uint32_t op); + void goto_ls(uint32_t op); + void goto_auc(uint32_t op); + void goto_aus(uint32_t op); + void goto_age(uint32_t op); + void goto_alt(uint32_t op); + void goto_ane(uint32_t op); + void goto_aeq(uint32_t op); + void goto_avc(uint32_t op); + void goto_avs(uint32_t op); + void goto_agt(uint32_t op); + void goto_ale(uint32_t op); + void goto_ibe(uint32_t op); + void goto_ibf(uint32_t op); + void goto_obf(uint32_t op); + void goto_obe(uint32_t op); + void goto_pde(uint32_t op); + void goto_pdf(uint32_t op); + void goto_pie(uint32_t op); + void goto_pif(uint32_t op); + void goto_syc(uint32_t op); + void goto_sys(uint32_t op); + void goto_fbc(uint32_t op); + void goto_fbs(uint32_t op); + void goto_irq1lo(uint32_t op); + void goto_irq1hi(uint32_t op); + void goto_irq2lo(uint32_t op); + void goto_irq2hi(uint32_t op); + void dec_goto(uint32_t op); + void call(uint32_t op); + void goto24(uint32_t op); + void call24(uint32_t op); + void do_i(uint32_t op); + void do_r(uint32_t op); // CAU 16-bit arithmetic implementation - void add_si(UINT32 op); - void add_ss(UINT32 op); - void mul2_s(UINT32 op); - void subr_ss(UINT32 op); - void addr_ss(UINT32 op); - void sub_ss(UINT32 op); - void neg_s(UINT32 op); - void andc_ss(UINT32 op); - void cmp_ss(UINT32 op); - void xor_ss(UINT32 op); - void rcr_s(UINT32 op); - void or_ss(UINT32 op); - void rcl_s(UINT32 op); - void shr_s(UINT32 op); - void div2_s(UINT32 op); - void and_ss(UINT32 op); - void test_ss(UINT32 op); - void add_di(UINT32 op); - void subr_di(UINT32 op); - void addr_di(UINT32 op); - void sub_di(UINT32 op); - void andc_di(UINT32 op); - void cmp_di(UINT32 op); - void xor_di(UINT32 op); - void or_di(UINT32 op); - void and_di(UINT32 op); - void test_di(UINT32 op); + void add_si(uint32_t op); + void add_ss(uint32_t op); + void mul2_s(uint32_t op); + void subr_ss(uint32_t op); + void addr_ss(uint32_t op); + void sub_ss(uint32_t op); + void neg_s(uint32_t op); + void andc_ss(uint32_t op); + void cmp_ss(uint32_t op); + void xor_ss(uint32_t op); + void rcr_s(uint32_t op); + void or_ss(uint32_t op); + void rcl_s(uint32_t op); + void shr_s(uint32_t op); + void div2_s(uint32_t op); + void and_ss(uint32_t op); + void test_ss(uint32_t op); + void add_di(uint32_t op); + void subr_di(uint32_t op); + void addr_di(uint32_t op); + void sub_di(uint32_t op); + void andc_di(uint32_t op); + void cmp_di(uint32_t op); + void xor_di(uint32_t op); + void or_di(uint32_t op); + void and_di(uint32_t op); + void test_di(uint32_t op); // CAU 24-bit arithmetic implementation - void adde_si(UINT32 op); - void adde_ss(UINT32 op); - void mul2e_s(UINT32 op); - void subre_ss(UINT32 op); - void addre_ss(UINT32 op); - void sube_ss(UINT32 op); - void nege_s(UINT32 op); - void andce_ss(UINT32 op); - void cmpe_ss(UINT32 op); - void xore_ss(UINT32 op); - void rcre_s(UINT32 op); - void ore_ss(UINT32 op); - void rcle_s(UINT32 op); - void shre_s(UINT32 op); - void div2e_s(UINT32 op); - void ande_ss(UINT32 op); - void teste_ss(UINT32 op); - void adde_di(UINT32 op); - void subre_di(UINT32 op); - void addre_di(UINT32 op); - void sube_di(UINT32 op); - void andce_di(UINT32 op); - void cmpe_di(UINT32 op); - void xore_di(UINT32 op); - void ore_di(UINT32 op); - void ande_di(UINT32 op); - void teste_di(UINT32 op); + void adde_si(uint32_t op); + void adde_ss(uint32_t op); + void mul2e_s(uint32_t op); + void subre_ss(uint32_t op); + void addre_ss(uint32_t op); + void sube_ss(uint32_t op); + void nege_s(uint32_t op); + void andce_ss(uint32_t op); + void cmpe_ss(uint32_t op); + void xore_ss(uint32_t op); + void rcre_s(uint32_t op); + void ore_ss(uint32_t op); + void rcle_s(uint32_t op); + void shre_s(uint32_t op); + void div2e_s(uint32_t op); + void ande_ss(uint32_t op); + void teste_ss(uint32_t op); + void adde_di(uint32_t op); + void subre_di(uint32_t op); + void addre_di(uint32_t op); + void sube_di(uint32_t op); + void andce_di(uint32_t op); + void cmpe_di(uint32_t op); + void xore_di(uint32_t op); + void ore_di(uint32_t op); + void ande_di(uint32_t op); + void teste_di(uint32_t op); // CAU load/store implementation - void load_hi(UINT32 op); - void load_li(UINT32 op); - void load_i(UINT32 op); - void load_ei(UINT32 op); - void store_hi(UINT32 op); - void store_li(UINT32 op); - void store_i(UINT32 op); - void store_ei(UINT32 op); - void load_hr(UINT32 op); - void load_lr(UINT32 op); - void load_r(UINT32 op); - void load_er(UINT32 op); - void store_hr(UINT32 op); - void store_lr(UINT32 op); - void store_r(UINT32 op); - void store_er(UINT32 op); - void load24(UINT32 op); + void load_hi(uint32_t op); + void load_li(uint32_t op); + void load_i(uint32_t op); + void load_ei(uint32_t op); + void store_hi(uint32_t op); + void store_li(uint32_t op); + void store_i(uint32_t op); + void store_ei(uint32_t op); + void load_hr(uint32_t op); + void load_lr(uint32_t op); + void load_r(uint32_t op); + void load_er(uint32_t op); + void store_hr(uint32_t op); + void store_lr(uint32_t op); + void store_r(uint32_t op); + void store_er(uint32_t op); + void load24(uint32_t op); // DAU form 1 implementation - void d1_aMpp(UINT32 op); - void d1_aMpm(UINT32 op); - void d1_aMmp(UINT32 op); - void d1_aMmm(UINT32 op); - void d1_0px(UINT32 op); - void d1_0mx(UINT32 op); - void d1_1pp(UINT32 op); - void d1_1pm(UINT32 op); - void d1_1mp(UINT32 op); - void d1_1mm(UINT32 op); - void d1_aMppr(UINT32 op); - void d1_aMpmr(UINT32 op); - void d1_aMmpr(UINT32 op); - void d1_aMmmr(UINT32 op); + void d1_aMpp(uint32_t op); + void d1_aMpm(uint32_t op); + void d1_aMmp(uint32_t op); + void d1_aMmm(uint32_t op); + void d1_0px(uint32_t op); + void d1_0mx(uint32_t op); + void d1_1pp(uint32_t op); + void d1_1pm(uint32_t op); + void d1_1mp(uint32_t op); + void d1_1mm(uint32_t op); + void d1_aMppr(uint32_t op); + void d1_aMpmr(uint32_t op); + void d1_aMmpr(uint32_t op); + void d1_aMmmr(uint32_t op); // DAU form 2 implementation - void d2_aMpp(UINT32 op); - void d2_aMpm(UINT32 op); - void d2_aMmp(UINT32 op); - void d2_aMmm(UINT32 op); - void d2_aMppr(UINT32 op); - void d2_aMpmr(UINT32 op); - void d2_aMmpr(UINT32 op); - void d2_aMmmr(UINT32 op); + void d2_aMpp(uint32_t op); + void d2_aMpm(uint32_t op); + void d2_aMmp(uint32_t op); + void d2_aMmm(uint32_t op); + void d2_aMppr(uint32_t op); + void d2_aMpmr(uint32_t op); + void d2_aMmpr(uint32_t op); + void d2_aMmmr(uint32_t op); // DAU form 3 implementation - void d3_aMpp(UINT32 op); - void d3_aMpm(UINT32 op); - void d3_aMmp(UINT32 op); - void d3_aMmm(UINT32 op); - void d3_aMppr(UINT32 op); - void d3_aMpmr(UINT32 op); - void d3_aMmpr(UINT32 op); - void d3_aMmmr(UINT32 op); + void d3_aMpp(uint32_t op); + void d3_aMpm(uint32_t op); + void d3_aMmp(uint32_t op); + void d3_aMmm(uint32_t op); + void d3_aMppr(uint32_t op); + void d3_aMpmr(uint32_t op); + void d3_aMmpr(uint32_t op); + void d3_aMmmr(uint32_t op); // DAU form 4 implementation - void d4_pp(UINT32 op); - void d4_pm(UINT32 op); - void d4_mp(UINT32 op); - void d4_mm(UINT32 op); - void d4_ppr(UINT32 op); - void d4_pmr(UINT32 op); - void d4_mpr(UINT32 op); - void d4_mmr(UINT32 op); + void d4_pp(uint32_t op); + void d4_pm(uint32_t op); + void d4_mp(uint32_t op); + void d4_mm(uint32_t op); + void d4_ppr(uint32_t op); + void d4_pmr(uint32_t op); + void d4_mpr(uint32_t op); + void d4_mmr(uint32_t op); // DAU form 5 implementation - void d5_ic(UINT32 op); - void d5_oc(UINT32 op); - void d5_float(UINT32 op); - void d5_int(UINT32 op); - void d5_round(UINT32 op); - void d5_ifalt(UINT32 op); - void d5_ifaeq(UINT32 op); - void d5_ifagt(UINT32 op); - void d5_float24(UINT32 op); - void d5_int24(UINT32 op); - void d5_ieee(UINT32 op); - void d5_dsp(UINT32 op); - void d5_seed(UINT32 op); + void d5_ic(uint32_t op); + void d5_oc(uint32_t op); + void d5_float(uint32_t op); + void d5_int(uint32_t op); + void d5_round(uint32_t op); + void d5_ifalt(uint32_t op); + void d5_ifaeq(uint32_t op); + void d5_ifagt(uint32_t op); + void d5_float24(uint32_t op); + void d5_int24(uint32_t op); + void d5_ieee(uint32_t op); + void d5_dsp(uint32_t op); + void d5_seed(uint32_t op); // dma helpers void dma_increment(); @@ -378,57 +378,57 @@ protected: const address_space_config m_program_config; // internal state - UINT32 m_r[32]; - UINT32 m_pin, m_pout; - UINT32 m_ivtp; - UINT32 m_nzcflags; - UINT32 m_vflags; + uint32_t m_r[32]; + uint32_t m_pin, m_pout; + uint32_t m_ivtp; + uint32_t m_nzcflags; + uint32_t m_vflags; double m_a[6]; double m_NZflags; - UINT8 m_VUflags; + uint8_t m_VUflags; double m_abuf[4]; - UINT8 m_abufreg[4]; - UINT8 m_abufVUflags[4]; - UINT8 m_abufNZflags[4]; + uint8_t m_abufreg[4]; + uint8_t m_abufVUflags[4]; + uint8_t m_abufNZflags[4]; int m_abufcycle[4]; int m_abuf_index; - INT32 m_mbufaddr[4]; - UINT32 m_mbufdata[4]; + int32_t m_mbufaddr[4]; + uint32_t m_mbufdata[4]; int m_mbuf_index; - UINT16 m_par; - UINT8 m_pare; - UINT16 m_pdr; - UINT16 m_pdr2; - UINT16 m_pir; - UINT16 m_pcr; - UINT16 m_emr; - UINT8 m_esr; - UINT16 m_pcw; - UINT8 m_piop; + uint16_t m_par; + uint8_t m_pare; + uint16_t m_pdr; + uint16_t m_pdr2; + uint16_t m_pir; + uint16_t m_pcr; + uint16_t m_emr; + uint8_t m_esr; + uint16_t m_pcw; + uint8_t m_piop; - UINT32 m_ibuf; - UINT32 m_isr; - UINT32 m_obuf; - UINT32 m_osr; + uint32_t m_ibuf; + uint32_t m_isr; + uint32_t m_obuf; + uint32_t m_osr; - UINT32 m_iotemp; + uint32_t m_iotemp; // internal stuff int m_lastp; int m_icount; - UINT8 m_lastpins; - UINT32 m_ppc; + uint8_t m_lastpins; + uint32_t m_ppc; address_space * m_program; direct_read_data *m_direct; devcb_write32 m_output_pins_changed; // tables - static void (dsp32c_device::*const s_dsp32ops[])(UINT32 op); - static const UINT32 s_regmap[4][16]; + static void (dsp32c_device::*const s_dsp32ops[])(uint32_t op); + static const uint32_t s_regmap[4][16]; }; diff --git a/src/devices/cpu/dsp32/dsp32dis.cpp b/src/devices/cpu/dsp32/dsp32dis.cpp index 18c06f01e9d..52dbfdeb79e 100644 --- a/src/devices/cpu/dsp32/dsp32dis.cpp +++ b/src/devices/cpu/dsp32/dsp32dis.cpp @@ -85,7 +85,7 @@ static const char *const regnamee[] = static char tempbuf[10][40]; -static inline char *signed_16bit_unary(INT16 val) +static inline char *signed_16bit_unary(int16_t val) { static char temp[10]; if (val < 0) @@ -95,7 +95,7 @@ static inline char *signed_16bit_unary(INT16 val) return temp; } -static inline char *signed_16bit_sep(INT16 val) +static inline char *signed_16bit_sep(int16_t val) { static char temp[10]; if (val < 0) @@ -105,7 +105,7 @@ static inline char *signed_16bit_sep(INT16 val) return temp; } -static inline char *signed_16bit_sep_nospace(INT16 val) +static inline char *signed_16bit_sep_nospace(int16_t val) { static char temp[10]; if (val < 0) @@ -115,21 +115,21 @@ static inline char *signed_16bit_sep_nospace(INT16 val) return temp; } -static inline char *unsigned_16bit_size(INT16 val, UINT8 size) +static inline char *unsigned_16bit_size(int16_t val, uint8_t size) { static char temp[10]; if (size) - sprintf(temp, "$%06x", (INT32)val & 0xffffff); + sprintf(temp, "$%06x", (int32_t)val & 0xffffff); else sprintf(temp, "$%04x", val & 0xffff); return temp; } -static UINT8 lastp; -static const char *dasm_XYZ(UINT8 bits, char *buffer) +static uint8_t lastp; +static const char *dasm_XYZ(uint8_t bits, char *buffer) { - UINT8 p = bits >> 3; - UINT8 i = bits & 7; + uint8_t p = bits >> 3; + uint8_t i = bits & 7; if (p) { @@ -165,10 +165,10 @@ static const char *dasm_XYZ(UINT8 bits, char *buffer) } -static const char *dasm_PI(UINT16 bits, char *buffer) +static const char *dasm_PI(uint16_t bits, char *buffer) { - UINT8 p = bits >> 5; - UINT8 i = bits & 0x1f; + uint8_t p = bits >> 5; + uint8_t i = bits & 0x1f; if (p) { @@ -199,9 +199,9 @@ static const char *dasm_PI(UINT16 bits, char *buffer) } -static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) +static unsigned dasm_dsp32(char *buffer, unsigned pc, uint32_t op) { - UINT32 flags = 0; + uint32_t flags = 0; switch (op >> 25) { @@ -214,7 +214,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) const char *Y = dasm_XYZ((op >> 7) & 0x7f, tempbuf[1]); const char *Z = dasm_XYZ((op >> 0) & 0x7f, tempbuf[2]); const char *aM = aMvals[(op >> 26) & 7]; - UINT8 aN = (op >> 21) & 3; + uint8_t aN = (op >> 21) & 3; if ((op & 0x7f) == 7) { if (aM[0] == '0') @@ -245,7 +245,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) const char *Y = dasm_XYZ((op >> 7) & 0x7f, tempbuf[1]); const char *Z = dasm_XYZ((op >> 0) & 0x7f, tempbuf[2]); const char *aM = aMvals[(op >> 26) & 7]; - UINT8 aN = (op >> 21) & 3; + uint8_t aN = (op >> 21) & 3; if ((op & 0x7f) == 7) { @@ -273,7 +273,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) const char *Y = dasm_XYZ((op >> 7) & 0x7f, tempbuf[1]); const char *Z = dasm_XYZ((op >> 0) & 0x7f, tempbuf[2]); const char *aM = aMvals[(op >> 26) & 7]; - UINT8 aN = (op >> 21) & 3; + uint8_t aN = (op >> 21) & 3; if ((op & 0x7f) == 7) { @@ -298,7 +298,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) const char *X = dasm_XYZ((op >> 14) & 0x7f, tempbuf[0]); const char *Y = dasm_XYZ((op >> 7) & 0x7f, tempbuf[1]); const char *Z = dasm_XYZ((op >> 0) & 0x7f, tempbuf[2]); - UINT8 aN = (op >> 21) & 3; + uint8_t aN = (op >> 21) & 3; if ((op & 0x7f) == 7) sprintf(buffer, "a%d = %s%s %s %s", aN, unarysign[(op >> 24) & 1], Y, sign[(op >> 23) & 1], X); @@ -326,8 +326,8 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) case 0x00: case 0x01: case 0x02: case 0x03: { const char *rH = regname[(op >> 16) & 0x1f]; - UINT8 C = (op >> 21) & 0x3f; - INT16 N = (INT16)op; + uint8_t C = (op >> 21) & 0x3f; + int16_t N = (int16_t)op; if (op == 0) sprintf(buffer, "nop"); @@ -340,7 +340,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) else if (N && rH[0] != '0') sprintf(buffer, "goto %s%s", rH, signed_16bit_sep_nospace(N)); else if (N) - sprintf(buffer, "goto $%x", ((INT32)N & 0xffffff)); + sprintf(buffer, "goto $%x", ((int32_t)N & 0xffffff)); else { if (((op >> 16) & 0x1f) == 20) @@ -355,7 +355,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) else if (N && rH[0] != '0') sprintf(buffer, "if (%s) goto %s%s", condtable[C], rH, signed_16bit_sep_nospace(N)); else if (N) - sprintf(buffer, "if (%s) goto $%x", condtable[C], ((INT32)N & 0xffffff)); + sprintf(buffer, "if (%s) goto $%x", condtable[C], ((int32_t)N & 0xffffff)); else { if (((op >> 16) & 0x1f) == 20) @@ -371,7 +371,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) { const char *rH = regname[(op >> 16) & 0x1f]; const char *rM = regname[(op >> 21) & 0x1f]; - INT16 N = (INT16)op; + int16_t N = (int16_t)op; if (((op >> 16) & 0x1f) == 15) { @@ -383,8 +383,8 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) sprintf(buffer, "if (%s-- >= 0) goto %s%s", rM, rH, signed_16bit_sep_nospace(N)); else if (N) { - sprintf(buffer, "if (%s-- >= 0) goto $%x", rM, ((INT32)N & 0xffffff)); - if (((INT32)N & 0xffffff) < pc) + sprintf(buffer, "if (%s-- >= 0) goto $%x", rM, ((int32_t)N & 0xffffff)); + if (((int32_t)N & 0xffffff) < pc) flags = DASMFLAG_STEP_OVER; } else @@ -409,14 +409,14 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) { const char *rH = regname[(op >> 16) & 0x1f]; const char *rM = regname[(op >> 21) & 0x1f]; - INT16 N = (INT16)op; + int16_t N = (int16_t)op; if (((op >> 16) & 0x1f) == 15) sprintf(buffer, "call %s%s (%s) [%x]", rH, signed_16bit_sep_nospace(N), rM, (pc + 8 + N) & 0xffffff); else if (N && rH[0] != '0') sprintf(buffer, "call %s%s (%s)", rH, signed_16bit_sep_nospace(N), rM); else if (N) - sprintf(buffer, "call $%x (%s)", ((INT32)N & 0xffffff), rM); + sprintf(buffer, "call $%x (%s)", ((int32_t)N & 0xffffff), rM); else sprintf(buffer, "call %s (%s)", rH, rM); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -430,13 +430,13 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) const char *rD = regname[(op >> 21) & 0x1f]; const char *rH = regname[(op >> 16) & 0x1f]; const char *s = sizesuffix[(op >> 31) & 1]; - INT16 N = (INT16)op; + int16_t N = (int16_t)op; if (N == 0) sprintf(buffer, "%s%s = %s%s", rD, s, rH, s); else if (rH[0] == '0') sprintf(buffer, "%s%s = %s", rD, s, signed_16bit_unary(N)); else - sprintf(buffer, "%s%s = %s%s%s", rD, s, rH, s, signed_16bit_sep((INT16)op)); + sprintf(buffer, "%s%s = %s%s%s", rD, s, rH, s, signed_16bit_sep((int16_t)op)); break; } @@ -447,7 +447,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) const char *rS1 = regname[(op >> 5) & 0x1f]; const char *rS2 = regname[(op >> 0) & 0x1f]; const char *s = sizesuffix[(op >> 31) & 1]; - UINT8 threeop = (op >> 11) & 1; + uint8_t threeop = (op >> 11) & 1; char condbuf[40] = { 0 }; if ((op >> 10) & 1) @@ -572,7 +572,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) { const char *rD = regname[(op >> 16) & 0x1f]; const char *s = sizesuffix[(op >> 31) & 1]; - INT16 N = (INT16)op; + int16_t N = (int16_t)op; switch ((op >> 21) & 15) { @@ -628,9 +628,9 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) /* CA format 7a */ case 0x0e: if ((op >> 24) & 1) - sprintf(buffer, "*%08X = %s%s", (INT16)op, regname[(op >> 16) & 0x1f], memsuffix[(op >> 22) & 3]); + sprintf(buffer, "*%08X = %s%s", (int16_t)op, regname[(op >> 16) & 0x1f], memsuffix[(op >> 22) & 3]); else - sprintf(buffer, "%s%s = *%08X", regname[(op >> 16) & 0x1f], memsuffix[(op >> 22) & 3], (INT16)op); + sprintf(buffer, "%s%s = *%08X", regname[(op >> 16) & 0x1f], memsuffix[(op >> 22) & 3], (int16_t)op); break; /* CA format 7b */ @@ -647,7 +647,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: { - INT32 N = (op & 0xffff) | ((INT32)((op & 0x1fe00000) << 3) >> 8); + int32_t N = (op & 0xffff) | ((int32_t)((op & 0x1fe00000) << 3) >> 8); const char *rH = regname[(op >> 16) & 0x1f]; if (((op >> 16) & 0x1f) == 15) @@ -655,7 +655,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) else if (N && rH[0] != '0') sprintf(buffer, "goto %s%s", rH, signed_16bit_sep_nospace(N)); else if (N) - sprintf(buffer, "goto $%x", ((INT32)N & 0xffffff)); + sprintf(buffer, "goto $%x", ((int32_t)N & 0xffffff)); else { if (((op >> 16) & 0x1f) == 20) @@ -671,7 +671,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: { - INT32 immed = (op & 0xffff) | ((INT32)((op & 0x1fe00000) << 3) >> 8); + int32_t immed = (op & 0xffff) | ((int32_t)((op & 0x1fe00000) << 3) >> 8); sprintf(buffer, "%s = $%x", regnamee[(op >> 16) & 0x1f], immed & 0xffffff); break; } @@ -682,7 +682,7 @@ static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: { - INT32 N = (op & 0xffff) | ((INT32)((op & 0x1fe00000) << 3) >> 8); + int32_t N = (op & 0xffff) | ((int32_t)((op & 0x1fe00000) << 3) >> 8); const char *rM = regname[(op >> 16) & 0x1f]; sprintf(buffer, "call $%x (%s)", N & 0xffffff, rM); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); diff --git a/src/devices/cpu/dsp32/dsp32ops.hxx b/src/devices/cpu/dsp32/dsp32ops.hxx index 696e4f14885..f8970c55405 100644 --- a/src/devices/cpu/dsp32/dsp32ops.hxx +++ b/src/devices/cpu/dsp32/dsp32ops.hxx @@ -41,8 +41,8 @@ #define SET_NZ00_24(r) m_nzcflags = ((r) & 0xffffff); m_vflags = 0 #define TRUNCATE24(a) ((a) & 0xffffff) -#define EXTEND16_TO_24(a) TRUNCATE24((INT32)(INT16)(a)) -#define REG16(a) ((UINT16)m_r[a]) +#define EXTEND16_TO_24(a) TRUNCATE24((int32_t)(int16_t)(a)) +#define REG16(a) ((uint16_t)m_r[a]) #define REG24(a) (m_r[a]) #define WRITEABLE_REGS (0x6f3efffe) @@ -100,7 +100,7 @@ union int_double { double d; - UINT32 i[2]; + uint32_t i[2]; }; @@ -109,12 +109,12 @@ union int_double // IMPLEMENTATION //************************************************************************** -void dsp32c_device::illegal(UINT32 op) +void dsp32c_device::illegal(uint32_t op) { } -void dsp32c_device::unimplemented(UINT32 op) +void dsp32c_device::unimplemented(uint32_t op) { fatalerror("Unimplemented op @ %06X: %08X (dis=%02X, tbl=%03X)\n", PC - 4, op, op >> 25, op >> 21); } @@ -122,7 +122,7 @@ void dsp32c_device::unimplemented(UINT32 op) inline void dsp32c_device::execute_one() { - UINT32 op; + uint32_t op; PROCESS_DEFERRED_MEMORY(); m_ppc = PC; @@ -140,7 +140,7 @@ inline void dsp32c_device::execute_one() // CAU HELPERS //************************************************************************** -UINT32 dsp32c_device::cau_read_pi_special(UINT8 i) +uint32_t dsp32c_device::cau_read_pi_special(uint8_t i) { switch (i) { @@ -157,7 +157,7 @@ UINT32 dsp32c_device::cau_read_pi_special(UINT8 i) } -void dsp32c_device::cau_write_pi_special(UINT8 i, UINT32 val) +void dsp32c_device::cau_write_pi_special(uint8_t i, uint32_t val) { switch (i) { @@ -173,13 +173,13 @@ void dsp32c_device::cau_write_pi_special(UINT8 i, UINT32 val) } -inline UINT8 dsp32c_device::cau_read_pi_1byte(int pi) +inline uint8_t dsp32c_device::cau_read_pi_1byte(int pi) { int p = (pi >> 5) & 0x1f; int i = (pi >> 0) & 0x1f; if (p) { - UINT32 result = RBYTE(m_r[p]); + uint32_t result = RBYTE(m_r[p]); m_r[p] = TRUNCATE24(m_r[p] + m_r[i]); return result; } @@ -188,13 +188,13 @@ inline UINT8 dsp32c_device::cau_read_pi_1byte(int pi) } -inline UINT16 dsp32c_device::cau_read_pi_2byte(int pi) +inline uint16_t dsp32c_device::cau_read_pi_2byte(int pi) { int p = (pi >> 5) & 0x1f; int i = (pi >> 0) & 0x1f; if (p) { - UINT32 result = RWORD(m_r[p]); + uint32_t result = RWORD(m_r[p]); if (i < 22 || i > 23) m_r[p] = TRUNCATE24(m_r[p] + m_r[i]); else @@ -206,13 +206,13 @@ inline UINT16 dsp32c_device::cau_read_pi_2byte(int pi) } -inline UINT32 dsp32c_device::cau_read_pi_4byte(int pi) +inline uint32_t dsp32c_device::cau_read_pi_4byte(int pi) { int p = (pi >> 5) & 0x1f; int i = (pi >> 0) & 0x1f; if (p) { - UINT32 result = RLONG(m_r[p]); + uint32_t result = RLONG(m_r[p]); if (i < 22 || i > 23) m_r[p] = TRUNCATE24(m_r[p] + m_r[i]); else @@ -224,7 +224,7 @@ inline UINT32 dsp32c_device::cau_read_pi_4byte(int pi) } -inline void dsp32c_device::cau_write_pi_1byte(int pi, UINT8 val) +inline void dsp32c_device::cau_write_pi_1byte(int pi, uint8_t val) { int p = (pi >> 5) & 0x1f; int i = (pi >> 0) & 0x1f; @@ -238,7 +238,7 @@ inline void dsp32c_device::cau_write_pi_1byte(int pi, UINT8 val) } -inline void dsp32c_device::cau_write_pi_2byte(int pi, UINT16 val) +inline void dsp32c_device::cau_write_pi_2byte(int pi, uint16_t val) { int p = (pi >> 5) & 0x1f; int i = (pi >> 0) & 0x1f; @@ -255,13 +255,13 @@ inline void dsp32c_device::cau_write_pi_2byte(int pi, UINT16 val) } -inline void dsp32c_device::cau_write_pi_4byte(int pi, UINT32 val) +inline void dsp32c_device::cau_write_pi_4byte(int pi, uint32_t val) { int p = (pi >> 5) & 0x1f; int i = (pi >> 0) & 0x1f; if (p) { - WLONG(m_r[p], (INT32)(val << 8) >> 8); + WLONG(m_r[p], (int32_t)(val << 8) >> 8); if (i < 22 || i > 23) m_r[p] = TRUNCATE24(m_r[p] + m_r[i]); else @@ -304,11 +304,11 @@ inline double dsp32c_device::dau_get_anzflags() } -inline UINT8 dsp32c_device::dau_get_avuflags() +inline uint8_t dsp32c_device::dau_get_avuflags() { #if (!IGNORE_DAU_UV_FLAGS) int bufidx = (m_abuf_index - 1) & 3; - UINT8 vuflags = m_VUflags; + uint8_t vuflags = m_VUflags; while (m_icount >= m_abufcycle[bufidx] - 3 * 4) { vuflags = m_abufVUflags[bufidx]; @@ -370,13 +370,13 @@ inline void dsp32c_device::dau_set_val_flags(int aidx, double res) } -inline double dsp32c_device::dsp_to_double(UINT32 val) +inline double dsp32c_device::dsp_to_double(uint32_t val) { int_double id; if (val == 0) return 0; - else if ((INT32)val > 0) + else if ((int32_t)val > 0) { int exponent = ((val & 0xff) - 128 + 1023) << 20; id.i[BYTE_XOR_BE(0)] = exponent + (val >> 11); @@ -393,7 +393,7 @@ inline double dsp32c_device::dsp_to_double(UINT32 val) } -inline UINT32 dsp32c_device::double_to_dsp(double val) +inline uint32_t dsp32c_device::double_to_dsp(double val) { int mantissa, exponent; int_double id; @@ -406,9 +406,9 @@ inline UINT32 dsp32c_device::double_to_dsp(double val) { // machine().debug_break(); // fprintf(stderr, "Exponent = %d\n", exponent); - return ((INT32)id.i[BYTE_XOR_BE(0)] >= 0) ? 0x7fffffff : 0x800000ff; + return ((int32_t)id.i[BYTE_XOR_BE(0)] >= 0) ? 0x7fffffff : 0x800000ff; } - else if ((INT32)id.i[BYTE_XOR_BE(0)] >= 0) + else if ((int32_t)id.i[BYTE_XOR_BE(0)] >= 0) return exponent | mantissa; else { @@ -440,7 +440,7 @@ inline double dsp32c_device::dau_read_pi_double_1st(int pi, int multiplier) m_lastp = p; if (p) { - UINT32 result = RLONG(m_r[p]); + uint32_t result = RLONG(m_r[p]); if (i < 6) m_r[p] = TRUNCATE24(m_r[p] + m_r[i+16]); else @@ -463,7 +463,7 @@ inline double dsp32c_device::dau_read_pi_double_2nd(int pi, int multiplier, doub m_lastp = p; if (p) { - UINT32 result; + uint32_t result; result = RLONG(m_r[p]); if (i < 6) m_r[p] = TRUNCATE24(m_r[p] + m_r[i+16]); @@ -478,7 +478,7 @@ inline double dsp32c_device::dau_read_pi_double_2nd(int pi, int multiplier, doub } -inline UINT32 dsp32c_device::dau_read_pi_4bytes(int pi) +inline uint32_t dsp32c_device::dau_read_pi_4bytes(int pi) { int p = (pi >> 3) & 15; int i = (pi >> 0) & 7; @@ -486,7 +486,7 @@ inline UINT32 dsp32c_device::dau_read_pi_4bytes(int pi) m_lastp = p; if (p) { - UINT32 result = RLONG(m_r[p]); + uint32_t result = RLONG(m_r[p]); if (i < 6) m_r[p] = TRUNCATE24(m_r[p] + m_r[i+16]); else @@ -500,7 +500,7 @@ inline UINT32 dsp32c_device::dau_read_pi_4bytes(int pi) } -inline UINT16 dsp32c_device::dau_read_pi_2bytes(int pi) +inline uint16_t dsp32c_device::dau_read_pi_2bytes(int pi) { int p = (pi >> 3) & 15; int i = (pi >> 0) & 7; @@ -508,7 +508,7 @@ inline UINT16 dsp32c_device::dau_read_pi_2bytes(int pi) m_lastp = p; if (p) { - UINT32 result = RWORD(m_r[p]); + uint32_t result = RWORD(m_r[p]); if (i < 6) m_r[p] = TRUNCATE24(m_r[p] + m_r[i+16]); else @@ -543,7 +543,7 @@ inline void dsp32c_device::dau_write_pi_double(int pi, double val) } -inline void dsp32c_device::dau_write_pi_4bytes(int pi, UINT32 val) +inline void dsp32c_device::dau_write_pi_4bytes(int pi, uint32_t val) { int p = (pi >> 3) & 15; int i = (pi >> 0) & 7; @@ -565,7 +565,7 @@ inline void dsp32c_device::dau_write_pi_4bytes(int pi, UINT32 val) } -inline void dsp32c_device::dau_write_pi_2bytes(int pi, UINT16 val) +inline void dsp32c_device::dau_write_pi_2bytes(int pi, uint16_t val) { int p = (pi >> 3) & 15; int i = (pi >> 0) & 7; @@ -679,405 +679,405 @@ int dsp32c_device::condition(int cond) // CAU BRANCH INSTRUCTION IMPLEMENTATION //************************************************************************** -void dsp32c_device::nop(UINT32 op) +void dsp32c_device::nop(uint32_t op) { if (op == 0) return; execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } -void dsp32c_device::goto_t(UINT32 op) +void dsp32c_device::goto_t(uint32_t op) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } -void dsp32c_device::goto_pl(UINT32 op) +void dsp32c_device::goto_pl(uint32_t op) { if (!nFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_mi(UINT32 op) +void dsp32c_device::goto_mi(uint32_t op) { if (nFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_ne(UINT32 op) +void dsp32c_device::goto_ne(uint32_t op) { if (!zFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_eq(UINT32 op) +void dsp32c_device::goto_eq(uint32_t op) { if (zFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_vc(UINT32 op) +void dsp32c_device::goto_vc(uint32_t op) { if (!vFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_vs(UINT32 op) +void dsp32c_device::goto_vs(uint32_t op) { if (vFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_cc(UINT32 op) +void dsp32c_device::goto_cc(uint32_t op) { if (!cFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_cs(UINT32 op) +void dsp32c_device::goto_cs(uint32_t op) { if (cFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_ge(UINT32 op) +void dsp32c_device::goto_ge(uint32_t op) { if (!(nFLAG ^ vFLAG)) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_lt(UINT32 op) +void dsp32c_device::goto_lt(uint32_t op) { if (nFLAG ^ vFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_gt(UINT32 op) +void dsp32c_device::goto_gt(uint32_t op) { if (!(zFLAG | (nFLAG ^ vFLAG))) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_le(UINT32 op) +void dsp32c_device::goto_le(uint32_t op) { if (zFLAG | (nFLAG ^ vFLAG)) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_hi(UINT32 op) +void dsp32c_device::goto_hi(uint32_t op) { if (!cFLAG && !zFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_ls(UINT32 op) +void dsp32c_device::goto_ls(uint32_t op) { if (cFLAG || zFLAG) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_auc(UINT32 op) +void dsp32c_device::goto_auc(uint32_t op) { if (!(DEFERRED_VUFLAGS() & UFLAGBIT)) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_aus(UINT32 op) +void dsp32c_device::goto_aus(uint32_t op) { if (DEFERRED_VUFLAGS() & UFLAGBIT) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_age(UINT32 op) +void dsp32c_device::goto_age(uint32_t op) { if (DEFERRED_NZFLAGS() >= 0) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_alt(UINT32 op) +void dsp32c_device::goto_alt(uint32_t op) { if (DEFERRED_NZFLAGS() < 0) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_ane(UINT32 op) +void dsp32c_device::goto_ane(uint32_t op) { if (DEFERRED_NZFLAGS() != 0) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_aeq(UINT32 op) +void dsp32c_device::goto_aeq(uint32_t op) { if (DEFERRED_NZFLAGS() == 0) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_avc(UINT32 op) +void dsp32c_device::goto_avc(uint32_t op) { if (!(DEFERRED_VUFLAGS() & VFLAGBIT)) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_avs(UINT32 op) +void dsp32c_device::goto_avs(uint32_t op) { if (DEFERRED_VUFLAGS() & VFLAGBIT) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_agt(UINT32 op) +void dsp32c_device::goto_agt(uint32_t op) { if (DEFERRED_NZFLAGS() > 0) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_ale(UINT32 op) +void dsp32c_device::goto_ale(uint32_t op) { if (DEFERRED_NZFLAGS() <= 0) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_ibe(UINT32 op) +void dsp32c_device::goto_ibe(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_ibf(UINT32 op) +void dsp32c_device::goto_ibf(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_obf(UINT32 op) +void dsp32c_device::goto_obf(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_obe(UINT32 op) +void dsp32c_device::goto_obe(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_pde(UINT32 op) +void dsp32c_device::goto_pde(uint32_t op) { if (!(m_pcr & PCR_PDFs)) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_pdf(UINT32 op) +void dsp32c_device::goto_pdf(uint32_t op) { if (m_pcr & PCR_PDFs) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_pie(UINT32 op) +void dsp32c_device::goto_pie(uint32_t op) { if (!(m_pcr & PCR_PIFs)) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_pif(UINT32 op) +void dsp32c_device::goto_pif(uint32_t op) { if (m_pcr & PCR_PIFs) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::goto_syc(UINT32 op) +void dsp32c_device::goto_syc(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_sys(UINT32 op) +void dsp32c_device::goto_sys(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_fbc(UINT32 op) +void dsp32c_device::goto_fbc(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_fbs(UINT32 op) +void dsp32c_device::goto_fbs(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_irq1lo(UINT32 op) +void dsp32c_device::goto_irq1lo(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_irq1hi(UINT32 op) +void dsp32c_device::goto_irq1hi(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_irq2lo(UINT32 op) +void dsp32c_device::goto_irq2lo(uint32_t op) { unimplemented(op); } -void dsp32c_device::goto_irq2hi(UINT32 op) +void dsp32c_device::goto_irq2hi(uint32_t op) { unimplemented(op); } -void dsp32c_device::dec_goto(UINT32 op) +void dsp32c_device::dec_goto(uint32_t op) { int hr = (op >> 21) & 0x1f; - int old = (INT16)m_r[hr]; + int old = (int16_t)m_r[hr]; m_r[hr] = EXTEND16_TO_24(m_r[hr] - 1); if (old >= 0) { execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } } -void dsp32c_device::call(UINT32 op) +void dsp32c_device::call(uint32_t op) { int mr = (op >> 21) & 0x1f; if (IS_WRITEABLE(mr)) m_r[mr] = PC + 4; execute_one(); - PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (INT16)op); + PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (int16_t)op); } -void dsp32c_device::goto24(UINT32 op) +void dsp32c_device::goto24(uint32_t op) { execute_one(); PC = TRUNCATE24(REG24((op >> 16) & 0x1f) + (op & 0xffff) + ((op >> 5) & 0xff0000)); } -void dsp32c_device::call24(UINT32 op) +void dsp32c_device::call24(uint32_t op) { int mr = (op >> 16) & 0x1f; if (IS_WRITEABLE(mr)) @@ -1087,13 +1087,13 @@ void dsp32c_device::call24(UINT32 op) } -void dsp32c_device::do_i(UINT32 op) +void dsp32c_device::do_i(uint32_t op) { unimplemented(op); } -void dsp32c_device::do_r(UINT32 op) +void dsp32c_device::do_r(uint32_t op) { unimplemented(op); } @@ -1104,18 +1104,18 @@ void dsp32c_device::do_r(UINT32 op) // CAU 16-BIT ARITHMETIC IMPLEMENTATION //************************************************************************** -void dsp32c_device::add_si(UINT32 op) +void dsp32c_device::add_si(uint32_t op) { int dr = (op >> 21) & 0x1f; int hrval = REG16((op >> 16) & 0x1f); - int res = hrval + (UINT16)op; + int res = hrval + (uint16_t)op; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); SET_NZCV_16(hrval, op, res); } -void dsp32c_device::add_ss(UINT32 op) +void dsp32c_device::add_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1130,7 +1130,7 @@ void dsp32c_device::add_ss(UINT32 op) } -void dsp32c_device::mul2_s(UINT32 op) +void dsp32c_device::mul2_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1144,7 +1144,7 @@ void dsp32c_device::mul2_s(UINT32 op) } -void dsp32c_device::subr_ss(UINT32 op) +void dsp32c_device::subr_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1159,13 +1159,13 @@ void dsp32c_device::subr_ss(UINT32 op) } -void dsp32c_device::addr_ss(UINT32 op) +void dsp32c_device::addr_ss(uint32_t op) { unimplemented(op); } -void dsp32c_device::sub_ss(UINT32 op) +void dsp32c_device::sub_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1180,7 +1180,7 @@ void dsp32c_device::sub_ss(UINT32 op) } -void dsp32c_device::neg_s(UINT32 op) +void dsp32c_device::neg_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1194,7 +1194,7 @@ void dsp32c_device::neg_s(UINT32 op) } -void dsp32c_device::andc_ss(UINT32 op) +void dsp32c_device::andc_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1209,7 +1209,7 @@ void dsp32c_device::andc_ss(UINT32 op) } -void dsp32c_device::cmp_ss(UINT32 op) +void dsp32c_device::cmp_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1221,7 +1221,7 @@ void dsp32c_device::cmp_ss(UINT32 op) } -void dsp32c_device::xor_ss(UINT32 op) +void dsp32c_device::xor_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1236,7 +1236,7 @@ void dsp32c_device::xor_ss(UINT32 op) } -void dsp32c_device::rcr_s(UINT32 op) +void dsp32c_device::rcr_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1251,7 +1251,7 @@ void dsp32c_device::rcr_s(UINT32 op) } -void dsp32c_device::or_ss(UINT32 op) +void dsp32c_device::or_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1266,7 +1266,7 @@ void dsp32c_device::or_ss(UINT32 op) } -void dsp32c_device::rcl_s(UINT32 op) +void dsp32c_device::rcl_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1281,7 +1281,7 @@ void dsp32c_device::rcl_s(UINT32 op) } -void dsp32c_device::shr_s(UINT32 op) +void dsp32c_device::shr_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1296,7 +1296,7 @@ void dsp32c_device::shr_s(UINT32 op) } -void dsp32c_device::div2_s(UINT32 op) +void dsp32c_device::div2_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1311,7 +1311,7 @@ void dsp32c_device::div2_s(UINT32 op) } -void dsp32c_device::and_ss(UINT32 op) +void dsp32c_device::and_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1326,7 +1326,7 @@ void dsp32c_device::and_ss(UINT32 op) } -void dsp32c_device::test_ss(UINT32 op) +void dsp32c_device::test_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1338,101 +1338,101 @@ void dsp32c_device::test_ss(UINT32 op) } -void dsp32c_device::add_di(UINT32 op) +void dsp32c_device::add_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG16(dr); - int res = drval + (UINT16)op; + int res = drval + (uint16_t)op; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); SET_NZCV_16(drval, op, res); } -void dsp32c_device::subr_di(UINT32 op) +void dsp32c_device::subr_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG16(dr); - int res = (UINT16)op - drval; + int res = (uint16_t)op - drval; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); SET_NZCV_16(drval, op, res); } -void dsp32c_device::addr_di(UINT32 op) +void dsp32c_device::addr_di(uint32_t op) { unimplemented(op); } -void dsp32c_device::sub_di(UINT32 op) +void dsp32c_device::sub_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG16(dr); - int res = drval - (UINT16)op; + int res = drval - (uint16_t)op; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); SET_NZCV_16(drval, op, res); } -void dsp32c_device::andc_di(UINT32 op) +void dsp32c_device::andc_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG16(dr); - int res = drval & ~(UINT16)op; + int res = drval & ~(uint16_t)op; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); SET_NZ00_16(res); } -void dsp32c_device::cmp_di(UINT32 op) +void dsp32c_device::cmp_di(uint32_t op) { int drval = REG16((op >> 16) & 0x1f); - int res = drval - (UINT16)op; + int res = drval - (uint16_t)op; SET_NZCV_16(drval, op, res); } -void dsp32c_device::xor_di(UINT32 op) +void dsp32c_device::xor_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG16(dr); - int res = drval ^ (UINT16)op; + int res = drval ^ (uint16_t)op; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); SET_NZ00_16(res); } -void dsp32c_device::or_di(UINT32 op) +void dsp32c_device::or_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG16(dr); - int res = drval | (UINT16)op; + int res = drval | (uint16_t)op; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); SET_NZ00_16(res); } -void dsp32c_device::and_di(UINT32 op) +void dsp32c_device::and_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG16(dr); - int res = drval & (UINT16)op; + int res = drval & (uint16_t)op; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); SET_NZ00_16(res); } -void dsp32c_device::test_di(UINT32 op) +void dsp32c_device::test_di(uint32_t op) { int drval = REG16((op >> 16) & 0x1f); - int res = drval & (UINT16)op; + int res = drval & (uint16_t)op; SET_NZ00_16(res); } @@ -1442,7 +1442,7 @@ void dsp32c_device::test_di(UINT32 op) // CAU 24-BIT ARITHMETIC IMPLEMENTATION //************************************************************************** -void dsp32c_device::adde_si(UINT32 op) +void dsp32c_device::adde_si(uint32_t op) { int dr = (op >> 21) & 0x1f; int hrval = REG24((op >> 16) & 0x1f); @@ -1453,7 +1453,7 @@ void dsp32c_device::adde_si(UINT32 op) } -void dsp32c_device::adde_ss(UINT32 op) +void dsp32c_device::adde_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1468,7 +1468,7 @@ void dsp32c_device::adde_ss(UINT32 op) } -void dsp32c_device::mul2e_s(UINT32 op) +void dsp32c_device::mul2e_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1482,7 +1482,7 @@ void dsp32c_device::mul2e_s(UINT32 op) } -void dsp32c_device::subre_ss(UINT32 op) +void dsp32c_device::subre_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1497,13 +1497,13 @@ void dsp32c_device::subre_ss(UINT32 op) } -void dsp32c_device::addre_ss(UINT32 op) +void dsp32c_device::addre_ss(uint32_t op) { unimplemented(op); } -void dsp32c_device::sube_ss(UINT32 op) +void dsp32c_device::sube_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1518,7 +1518,7 @@ void dsp32c_device::sube_ss(UINT32 op) } -void dsp32c_device::nege_s(UINT32 op) +void dsp32c_device::nege_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1532,7 +1532,7 @@ void dsp32c_device::nege_s(UINT32 op) } -void dsp32c_device::andce_ss(UINT32 op) +void dsp32c_device::andce_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1547,7 +1547,7 @@ void dsp32c_device::andce_ss(UINT32 op) } -void dsp32c_device::cmpe_ss(UINT32 op) +void dsp32c_device::cmpe_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1559,7 +1559,7 @@ void dsp32c_device::cmpe_ss(UINT32 op) } -void dsp32c_device::xore_ss(UINT32 op) +void dsp32c_device::xore_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1574,7 +1574,7 @@ void dsp32c_device::xore_ss(UINT32 op) } -void dsp32c_device::rcre_s(UINT32 op) +void dsp32c_device::rcre_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1589,7 +1589,7 @@ void dsp32c_device::rcre_s(UINT32 op) } -void dsp32c_device::ore_ss(UINT32 op) +void dsp32c_device::ore_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1604,7 +1604,7 @@ void dsp32c_device::ore_ss(UINT32 op) } -void dsp32c_device::rcle_s(UINT32 op) +void dsp32c_device::rcle_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1619,7 +1619,7 @@ void dsp32c_device::rcle_s(UINT32 op) } -void dsp32c_device::shre_s(UINT32 op) +void dsp32c_device::shre_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1634,7 +1634,7 @@ void dsp32c_device::shre_s(UINT32 op) } -void dsp32c_device::div2e_s(UINT32 op) +void dsp32c_device::div2e_s(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1649,7 +1649,7 @@ void dsp32c_device::div2e_s(UINT32 op) } -void dsp32c_device::ande_ss(UINT32 op) +void dsp32c_device::ande_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1664,7 +1664,7 @@ void dsp32c_device::ande_ss(UINT32 op) } -void dsp32c_device::teste_ss(UINT32 op) +void dsp32c_device::teste_ss(uint32_t op) { if (CONDITION_IS_TRUE()) { @@ -1676,7 +1676,7 @@ void dsp32c_device::teste_ss(UINT32 op) } -void dsp32c_device::adde_di(UINT32 op) +void dsp32c_device::adde_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG24(dr); @@ -1687,7 +1687,7 @@ void dsp32c_device::adde_di(UINT32 op) } -void dsp32c_device::subre_di(UINT32 op) +void dsp32c_device::subre_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG24(dr); @@ -1698,13 +1698,13 @@ void dsp32c_device::subre_di(UINT32 op) } -void dsp32c_device::addre_di(UINT32 op) +void dsp32c_device::addre_di(uint32_t op) { unimplemented(op); } -void dsp32c_device::sube_di(UINT32 op) +void dsp32c_device::sube_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG24(dr); @@ -1715,7 +1715,7 @@ void dsp32c_device::sube_di(UINT32 op) } -void dsp32c_device::andce_di(UINT32 op) +void dsp32c_device::andce_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG24(dr); @@ -1726,7 +1726,7 @@ void dsp32c_device::andce_di(UINT32 op) } -void dsp32c_device::cmpe_di(UINT32 op) +void dsp32c_device::cmpe_di(uint32_t op) { int drval = REG24((op >> 16) & 0x1f); int res = drval - EXTEND16_TO_24(op); @@ -1734,7 +1734,7 @@ void dsp32c_device::cmpe_di(UINT32 op) } -void dsp32c_device::xore_di(UINT32 op) +void dsp32c_device::xore_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG24(dr); @@ -1745,7 +1745,7 @@ void dsp32c_device::xore_di(UINT32 op) } -void dsp32c_device::ore_di(UINT32 op) +void dsp32c_device::ore_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG24(dr); @@ -1756,7 +1756,7 @@ void dsp32c_device::ore_di(UINT32 op) } -void dsp32c_device::ande_di(UINT32 op) +void dsp32c_device::ande_di(uint32_t op) { int dr = (op >> 16) & 0x1f; int drval = REG24(dr); @@ -1767,7 +1767,7 @@ void dsp32c_device::ande_di(UINT32 op) } -void dsp32c_device::teste_di(UINT32 op) +void dsp32c_device::teste_di(uint32_t op) { int drval = REG24((op >> 16) & 0x1f); int res = drval & EXTEND16_TO_24(op); @@ -1780,10 +1780,10 @@ void dsp32c_device::teste_di(UINT32 op) // CAU LOAD/STORE IMPLEMENTATION //************************************************************************** -void dsp32c_device::load_hi(UINT32 op) +void dsp32c_device::load_hi(uint32_t op) { int dr = (op >> 16) & 0x1f; - UINT32 res = RBYTE(EXTEND16_TO_24(op)); + uint32_t res = RBYTE(EXTEND16_TO_24(op)); if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); m_nzcflags = res << 8; @@ -1791,10 +1791,10 @@ void dsp32c_device::load_hi(UINT32 op) } -void dsp32c_device::load_li(UINT32 op) +void dsp32c_device::load_li(uint32_t op) { int dr = (op >> 16) & 0x1f; - UINT32 res = RBYTE(EXTEND16_TO_24(op)); + uint32_t res = RBYTE(EXTEND16_TO_24(op)); if (IS_WRITEABLE(dr)) m_r[dr] = res; m_nzcflags = res << 8; @@ -1802,9 +1802,9 @@ void dsp32c_device::load_li(UINT32 op) } -void dsp32c_device::load_i(UINT32 op) +void dsp32c_device::load_i(uint32_t op) { - UINT32 res = RWORD(EXTEND16_TO_24(op)); + uint32_t res = RWORD(EXTEND16_TO_24(op)); int dr = (op >> 16) & 0x1f; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); @@ -1813,9 +1813,9 @@ void dsp32c_device::load_i(UINT32 op) } -void dsp32c_device::load_ei(UINT32 op) +void dsp32c_device::load_ei(uint32_t op) { - UINT32 res = TRUNCATE24(RLONG(EXTEND16_TO_24(op))); + uint32_t res = TRUNCATE24(RLONG(EXTEND16_TO_24(op))); int dr = (op >> 16) & 0x1f; if (IS_WRITEABLE(dr)) m_r[dr] = res; @@ -1824,36 +1824,36 @@ void dsp32c_device::load_ei(UINT32 op) } -void dsp32c_device::store_hi(UINT32 op) +void dsp32c_device::store_hi(uint32_t op) { WBYTE(EXTEND16_TO_24(op), m_r[(op >> 16) & 0x1f] >> 8); } -void dsp32c_device::store_li(UINT32 op) +void dsp32c_device::store_li(uint32_t op) { WBYTE(EXTEND16_TO_24(op), m_r[(op >> 16) & 0x1f]); } -void dsp32c_device::store_i(UINT32 op) +void dsp32c_device::store_i(uint32_t op) { WWORD(EXTEND16_TO_24(op), REG16((op >> 16) & 0x1f)); } -void dsp32c_device::store_ei(UINT32 op) +void dsp32c_device::store_ei(uint32_t op) { - WLONG(EXTEND16_TO_24(op), (INT32)(REG24((op >> 16) & 0x1f) << 8) >> 8); + WLONG(EXTEND16_TO_24(op), (int32_t)(REG24((op >> 16) & 0x1f) << 8) >> 8); } -void dsp32c_device::load_hr(UINT32 op) +void dsp32c_device::load_hr(uint32_t op) { if (!(op & 0x400)) { int dr = (op >> 16) & 0x1f; - UINT32 res = cau_read_pi_1byte(op) << 8; + uint32_t res = cau_read_pi_1byte(op) << 8; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); m_nzcflags = res << 8; @@ -1864,12 +1864,12 @@ void dsp32c_device::load_hr(UINT32 op) } -void dsp32c_device::load_lr(UINT32 op) +void dsp32c_device::load_lr(uint32_t op) { if (!(op & 0x400)) { int dr = (op >> 16) & 0x1f; - UINT32 res = cau_read_pi_1byte(op); + uint32_t res = cau_read_pi_1byte(op); if (IS_WRITEABLE(dr)) m_r[dr] = res; m_nzcflags = res << 8; @@ -1880,11 +1880,11 @@ void dsp32c_device::load_lr(UINT32 op) } -void dsp32c_device::load_r(UINT32 op) +void dsp32c_device::load_r(uint32_t op) { if (!(op & 0x400)) { - UINT32 res = cau_read_pi_2byte(op); + uint32_t res = cau_read_pi_2byte(op); int dr = (op >> 16) & 0x1f; if (IS_WRITEABLE(dr)) m_r[dr] = EXTEND16_TO_24(res); @@ -1896,11 +1896,11 @@ void dsp32c_device::load_r(UINT32 op) } -void dsp32c_device::load_er(UINT32 op) +void dsp32c_device::load_er(uint32_t op) { if (!(op & 0x400)) { - UINT32 res = TRUNCATE24(cau_read_pi_4byte(op)); + uint32_t res = TRUNCATE24(cau_read_pi_4byte(op)); int dr = (op >> 16) & 0x1f; if (IS_WRITEABLE(dr)) m_r[dr] = res; @@ -1912,7 +1912,7 @@ void dsp32c_device::load_er(UINT32 op) } -void dsp32c_device::store_hr(UINT32 op) +void dsp32c_device::store_hr(uint32_t op) { if (!(op & 0x400)) cau_write_pi_1byte(op, m_r[(op >> 16) & 0x1f] >> 8); @@ -1921,7 +1921,7 @@ void dsp32c_device::store_hr(UINT32 op) } -void dsp32c_device::store_lr(UINT32 op) +void dsp32c_device::store_lr(uint32_t op) { if (!(op & 0x400)) cau_write_pi_1byte(op, m_r[(op >> 16) & 0x1f]); @@ -1930,7 +1930,7 @@ void dsp32c_device::store_lr(UINT32 op) } -void dsp32c_device::store_r(UINT32 op) +void dsp32c_device::store_r(uint32_t op) { if (!(op & 0x400)) cau_write_pi_2byte(op, REG16((op >> 16) & 0x1f)); @@ -1939,7 +1939,7 @@ void dsp32c_device::store_r(UINT32 op) } -void dsp32c_device::store_er(UINT32 op) +void dsp32c_device::store_er(uint32_t op) { if (!(op & 0x400)) cau_write_pi_4byte(op, REG24((op >> 16) & 0x1f)); @@ -1948,10 +1948,10 @@ void dsp32c_device::store_er(UINT32 op) } -void dsp32c_device::load24(UINT32 op) +void dsp32c_device::load24(uint32_t op) { int dr = (op >> 16) & 0x1f; - UINT32 res = (op & 0xffff) + ((op >> 5) & 0xff0000); + uint32_t res = (op & 0xffff) + ((op >> 5) & 0xff0000); if (IS_WRITEABLE(dr)) m_r[dr] = res; } @@ -1962,7 +1962,7 @@ void dsp32c_device::load24(UINT32 op) // DAU FORM 1 IMPLEMENTATION //************************************************************************** -void dsp32c_device::d1_aMpp(UINT32 op) +void dsp32c_device::d1_aMpp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -1974,7 +1974,7 @@ void dsp32c_device::d1_aMpp(UINT32 op) } -void dsp32c_device::d1_aMpm(UINT32 op) +void dsp32c_device::d1_aMpm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -1986,7 +1986,7 @@ void dsp32c_device::d1_aMpm(UINT32 op) } -void dsp32c_device::d1_aMmp(UINT32 op) +void dsp32c_device::d1_aMmp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -1998,7 +1998,7 @@ void dsp32c_device::d1_aMmp(UINT32 op) } -void dsp32c_device::d1_aMmm(UINT32 op) +void dsp32c_device::d1_aMmm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2010,7 +2010,7 @@ void dsp32c_device::d1_aMmm(UINT32 op) } -void dsp32c_device::d1_0px(UINT32 op) +void dsp32c_device::d1_0px(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2023,7 +2023,7 @@ void dsp32c_device::d1_0px(UINT32 op) } -void dsp32c_device::d1_0mx(UINT32 op) +void dsp32c_device::d1_0mx(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2036,7 +2036,7 @@ void dsp32c_device::d1_0mx(UINT32 op) } -void dsp32c_device::d1_1pp(UINT32 op) +void dsp32c_device::d1_1pp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2048,7 +2048,7 @@ void dsp32c_device::d1_1pp(UINT32 op) } -void dsp32c_device::d1_1pm(UINT32 op) +void dsp32c_device::d1_1pm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2060,7 +2060,7 @@ void dsp32c_device::d1_1pm(UINT32 op) } -void dsp32c_device::d1_1mp(UINT32 op) +void dsp32c_device::d1_1mp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2072,7 +2072,7 @@ void dsp32c_device::d1_1mp(UINT32 op) } -void dsp32c_device::d1_1mm(UINT32 op) +void dsp32c_device::d1_1mm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2084,25 +2084,25 @@ void dsp32c_device::d1_1mm(UINT32 op) } -void dsp32c_device::d1_aMppr(UINT32 op) +void dsp32c_device::d1_aMppr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d1_aMpmr(UINT32 op) +void dsp32c_device::d1_aMpmr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d1_aMmpr(UINT32 op) +void dsp32c_device::d1_aMmpr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d1_aMmmr(UINT32 op) +void dsp32c_device::d1_aMmmr(uint32_t op) { unimplemented(op); } @@ -2113,7 +2113,7 @@ void dsp32c_device::d1_aMmmr(UINT32 op) // DAU FORM 2 IMPLEMENTATION //************************************************************************** -void dsp32c_device::d2_aMpp(UINT32 op) +void dsp32c_device::d2_aMpp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 1, xval); @@ -2125,7 +2125,7 @@ void dsp32c_device::d2_aMpp(UINT32 op) } -void dsp32c_device::d2_aMpm(UINT32 op) +void dsp32c_device::d2_aMpm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 1, xval); @@ -2137,7 +2137,7 @@ void dsp32c_device::d2_aMpm(UINT32 op) } -void dsp32c_device::d2_aMmp(UINT32 op) +void dsp32c_device::d2_aMmp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 1, xval); @@ -2149,7 +2149,7 @@ void dsp32c_device::d2_aMmp(UINT32 op) } -void dsp32c_device::d2_aMmm(UINT32 op) +void dsp32c_device::d2_aMmm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 1, xval); @@ -2161,25 +2161,25 @@ void dsp32c_device::d2_aMmm(UINT32 op) } -void dsp32c_device::d2_aMppr(UINT32 op) +void dsp32c_device::d2_aMppr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d2_aMpmr(UINT32 op) +void dsp32c_device::d2_aMpmr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d2_aMmpr(UINT32 op) +void dsp32c_device::d2_aMmpr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d2_aMmmr(UINT32 op) +void dsp32c_device::d2_aMmmr(uint32_t op) { unimplemented(op); } @@ -2190,7 +2190,7 @@ void dsp32c_device::d2_aMmmr(UINT32 op) // DAU FORM 3 IMPLEMENTATION //************************************************************************** -void dsp32c_device::d3_aMpp(UINT32 op) +void dsp32c_device::d3_aMpp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 1, xval); @@ -2202,7 +2202,7 @@ void dsp32c_device::d3_aMpp(UINT32 op) } -void dsp32c_device::d3_aMpm(UINT32 op) +void dsp32c_device::d3_aMpm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 1, xval); @@ -2214,7 +2214,7 @@ void dsp32c_device::d3_aMpm(UINT32 op) } -void dsp32c_device::d3_aMmp(UINT32 op) +void dsp32c_device::d3_aMmp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 1, xval); @@ -2226,7 +2226,7 @@ void dsp32c_device::d3_aMmp(UINT32 op) } -void dsp32c_device::d3_aMmm(UINT32 op) +void dsp32c_device::d3_aMmm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 1, xval); @@ -2238,25 +2238,25 @@ void dsp32c_device::d3_aMmm(UINT32 op) } -void dsp32c_device::d3_aMppr(UINT32 op) +void dsp32c_device::d3_aMppr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d3_aMpmr(UINT32 op) +void dsp32c_device::d3_aMpmr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d3_aMmpr(UINT32 op) +void dsp32c_device::d3_aMmpr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d3_aMmmr(UINT32 op) +void dsp32c_device::d3_aMmmr(uint32_t op) { unimplemented(op); } @@ -2267,7 +2267,7 @@ void dsp32c_device::d3_aMmmr(UINT32 op) // DAU FORM 4 IMPLEMENTATION //************************************************************************** -void dsp32c_device::d4_pp(UINT32 op) +void dsp32c_device::d4_pp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2279,7 +2279,7 @@ void dsp32c_device::d4_pp(UINT32 op) } -void dsp32c_device::d4_pm(UINT32 op) +void dsp32c_device::d4_pm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2291,7 +2291,7 @@ void dsp32c_device::d4_pm(UINT32 op) } -void dsp32c_device::d4_mp(UINT32 op) +void dsp32c_device::d4_mp(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2303,7 +2303,7 @@ void dsp32c_device::d4_mp(UINT32 op) } -void dsp32c_device::d4_mm(UINT32 op) +void dsp32c_device::d4_mm(uint32_t op) { double xval = dau_read_pi_double_1st(op >> 14, 1); double yval = dau_read_pi_double_2nd(op >> 7, 0, xval); @@ -2315,25 +2315,25 @@ void dsp32c_device::d4_mm(UINT32 op) } -void dsp32c_device::d4_ppr(UINT32 op) +void dsp32c_device::d4_ppr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d4_pmr(UINT32 op) +void dsp32c_device::d4_pmr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d4_mpr(UINT32 op) +void dsp32c_device::d4_mpr(uint32_t op) { unimplemented(op); } -void dsp32c_device::d4_mmr(UINT32 op) +void dsp32c_device::d4_mmr(uint32_t op) { unimplemented(op); } @@ -2344,21 +2344,21 @@ void dsp32c_device::d4_mmr(UINT32 op) // DAU FORM 5 IMPLEMENTATION //************************************************************************** -void dsp32c_device::d5_ic(UINT32 op) +void dsp32c_device::d5_ic(uint32_t op) { unimplemented(op); } -void dsp32c_device::d5_oc(UINT32 op) +void dsp32c_device::d5_oc(uint32_t op) { unimplemented(op); } -void dsp32c_device::d5_float(UINT32 op) +void dsp32c_device::d5_float(uint32_t op) { - double res = (double)(INT16)dau_read_pi_2bytes(op >> 7); + double res = (double)(int16_t)dau_read_pi_2bytes(op >> 7); int zpi = (op >> 0) & 0x7f; if (zpi != 7) dau_write_pi_double(zpi, res); @@ -2366,21 +2366,21 @@ void dsp32c_device::d5_float(UINT32 op) } -void dsp32c_device::d5_int(UINT32 op) +void dsp32c_device::d5_int(uint32_t op) { double val = dau_read_pi_double_1st(op >> 7, 0); int zpi = (op >> 0) & 0x7f; - INT16 res; + int16_t res; if (!(DAUC & 0x10)) val = floor(val + 0.5); else val = ceil(val - 0.5); - res = (INT16)val; + res = (int16_t)val; if (zpi != 7) dau_write_pi_2bytes(zpi, res); dau_set_val_noflags((op >> 21) & 3, dsp_to_double(res << 16)); } -void dsp32c_device::d5_round(UINT32 op) +void dsp32c_device::d5_round(uint32_t op) { double res = (double)(float)dau_read_pi_double_1st(op >> 7, 0); int zpi = (op >> 0) & 0x7f; @@ -2390,7 +2390,7 @@ void dsp32c_device::d5_round(UINT32 op) } -void dsp32c_device::d5_ifalt(UINT32 op) +void dsp32c_device::d5_ifalt(uint32_t op) { int ar = (op >> 21) & 3; double res = m_a[ar]; @@ -2403,7 +2403,7 @@ void dsp32c_device::d5_ifalt(UINT32 op) } -void dsp32c_device::d5_ifaeq(UINT32 op) +void dsp32c_device::d5_ifaeq(uint32_t op) { int ar = (op >> 21) & 3; double res = m_a[ar]; @@ -2416,7 +2416,7 @@ void dsp32c_device::d5_ifaeq(UINT32 op) } -void dsp32c_device::d5_ifagt(UINT32 op) +void dsp32c_device::d5_ifagt(uint32_t op) { int ar = (op >> 21) & 3; double res = m_a[ar]; @@ -2429,9 +2429,9 @@ void dsp32c_device::d5_ifagt(UINT32 op) } -void dsp32c_device::d5_float24(UINT32 op) +void dsp32c_device::d5_float24(uint32_t op) { - double res = (double)((INT32)(dau_read_pi_4bytes(op >> 7) << 8) >> 8); + double res = (double)((int32_t)(dau_read_pi_4bytes(op >> 7) << 8) >> 8); int zpi = (op >> 0) & 0x7f; if (zpi != 7) dau_write_pi_double(zpi, res); @@ -2439,42 +2439,42 @@ void dsp32c_device::d5_float24(UINT32 op) } -void dsp32c_device::d5_int24(UINT32 op) +void dsp32c_device::d5_int24(uint32_t op) { double val = dau_read_pi_double_1st(op >> 7, 0); int zpi = (op >> 0) & 0x7f; - INT32 res; + int32_t res; if (!(DAUC & 0x10)) val = floor(val + 0.5); else val = ceil(val - 0.5); - res = (INT32)val; + res = (int32_t)val; if (res > 0x7fffff) res = 0x7fffff; else if (res < -0x800000) res = -0x800000; if (zpi != 7) - dau_write_pi_4bytes(zpi, (INT32)(res << 8) >> 8); + dau_write_pi_4bytes(zpi, (int32_t)(res << 8) >> 8); dau_set_val_noflags((op >> 21) & 3, dsp_to_double(res << 8)); } -void dsp32c_device::d5_ieee(UINT32 op) +void dsp32c_device::d5_ieee(uint32_t op) { unimplemented(op); } -void dsp32c_device::d5_dsp(UINT32 op) +void dsp32c_device::d5_dsp(uint32_t op) { unimplemented(op); } -void dsp32c_device::d5_seed(UINT32 op) +void dsp32c_device::d5_seed(uint32_t op) { - UINT32 val = dau_read_pi_4bytes(op >> 7); - INT32 res = val ^ 0x7fffffff; + uint32_t val = dau_read_pi_4bytes(op >> 7); + int32_t res = val ^ 0x7fffffff; int zpi = (op >> 0) & 0x7f; if (zpi != 7) dau_write_pi_4bytes(zpi, res); - dau_set_val_flags((op >> 21) & 3, dsp_to_double((INT32)res)); + dau_set_val_flags((op >> 21) & 3, dsp_to_double((int32_t)res)); } @@ -2483,7 +2483,7 @@ void dsp32c_device::d5_seed(UINT32 op) // FUNCTION TABLE //************************************************************************** -void (dsp32c_device::*const dsp32c_device::s_dsp32ops[])(UINT32 op) = +void (dsp32c_device::*const dsp32c_device::s_dsp32ops[])(uint32_t op) = { &dsp32c_device::nop, &dsp32c_device::goto_t, &dsp32c_device::goto_pl, &dsp32c_device::goto_mi, &dsp32c_device::goto_ne, &dsp32c_device::goto_eq, &dsp32c_device::goto_vc, &dsp32c_device::goto_vs, // 00 &dsp32c_device::goto_cc, &dsp32c_device::goto_cs, &dsp32c_device::goto_ge, &dsp32c_device::goto_lt, &dsp32c_device::goto_gt, &dsp32c_device::goto_le, &dsp32c_device::goto_hi, &dsp32c_device::goto_ls, diff --git a/src/devices/cpu/dsp56k/dsp56dsm.cpp b/src/devices/cpu/dsp56k/dsp56dsm.cpp index 283f712ecda..1fd102bdc66 100644 --- a/src/devices/cpu/dsp56k/dsp56dsm.cpp +++ b/src/devices/cpu/dsp56k/dsp56dsm.cpp @@ -18,8 +18,8 @@ /*****************************/ CPU_DISASSEMBLE( dsp56k ) { - const UINT16 w0 = oprom[0] | (oprom[1] << 8); - const UINT16 w1 = oprom[2] | (oprom[3] << 8); + const uint16_t w0 = oprom[0] | (oprom[1] << 8); + const uint16_t w1 = oprom[2] | (oprom[3] << 8); // Decode and disassemble. DSP56K::Opcode op(w0, w1); diff --git a/src/devices/cpu/dsp56k/dsp56k.cpp b/src/devices/cpu/dsp56k/dsp56k.cpp index 4ede3141226..29492ae9c79 100644 --- a/src/devices/cpu/dsp56k/dsp56k.cpp +++ b/src/devices/cpu/dsp56k/dsp56k.cpp @@ -118,7 +118,7 @@ static ADDRESS_MAP_START( dsp56156_x_data_map, AS_DATA, 16, dsp56k_device ) ADDRESS_MAP_END -dsp56k_device::dsp56k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dsp56k_device::dsp56k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, DSP56156, "DSP56156", tag, owner, clock, "dsp56156", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, 16, -1, ADDRESS_MAP_NAME(dsp56156_program_map)) , m_data_config("data", ENDIANNESS_LITTLE, 16, 16, -1, ADDRESS_MAP_NAME(dsp56156_x_data_map)) @@ -293,8 +293,8 @@ void dsp56k_device::device_start() state_add(DSP56K_X, "X", m_dsp56k_core.ALU.x.d).mask(0xffffffff).formatstr("%9s"); state_add(DSP56K_Y, "Y", m_dsp56k_core.ALU.y.d).mask(0xffffffff).formatstr("%9s"); - state_add(DSP56K_A, "A", m_dsp56k_core.ALU.a.q).mask((UINT64)U64(0xffffffffffffffff)).formatstr("%12s"); /* could benefit from a better mask? */ - state_add(DSP56K_B, "B", m_dsp56k_core.ALU.b.q).mask((UINT64)U64(0xffffffffffffffff)).formatstr("%12s"); /* could benefit from a better mask? */ + state_add(DSP56K_A, "A", m_dsp56k_core.ALU.a.q).mask((uint64_t)U64(0xffffffffffffffff)).formatstr("%12s"); /* could benefit from a better mask? */ + state_add(DSP56K_B, "B", m_dsp56k_core.ALU.b.q).mask((uint64_t)U64(0xffffffffffffffff)).formatstr("%12s"); /* could benefit from a better mask? */ state_add(DSP56K_R0, "R0", m_dsp56k_core.AGU.r0).formatstr("%04X"); state_add(DSP56K_R1, "R1", m_dsp56k_core.AGU.r1).formatstr("%04X"); @@ -455,8 +455,8 @@ static size_t execute_one_new(dsp56k_core* cpustate) debugger_instruction_hook(cpustate->device, PC); cpustate->op = ROPCODE(ADDRESS(PC)); - UINT16 w0 = ROPCODE(ADDRESS(PC)); - UINT16 w1 = ROPCODE(ADDRESS(PC) + ADDRESS(1)); + uint16_t w0 = ROPCODE(ADDRESS(PC)); + uint16_t w1 = ROPCODE(ADDRESS(PC) + ADDRESS(1)); Opcode op(w0, w1); op.evaluate(cpustate); @@ -494,7 +494,7 @@ void dsp56k_device::execute_run() } -offs_t dsp56k_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t dsp56k_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( dsp56k ); return CPU_DISASSEMBLE_NAME(dsp56k)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/dsp56k/dsp56k.h b/src/devices/cpu/dsp56k/dsp56k.h index 185b52dc033..6d497941d3a 100644 --- a/src/devices/cpu/dsp56k/dsp56k.h +++ b/src/devices/cpu/dsp56k/dsp56k.h @@ -33,33 +33,33 @@ struct dsp56k_host_interface { // **** Dsp56k side **** // // Host Control Register - UINT16* hcr; + uint16_t* hcr; // Host Status Register - UINT16* hsr; + uint16_t* hsr; // Host Transmit/Receive Data - UINT16* htrx; + uint16_t* htrx; // **** Host CPU side **** // // Interrupt Control Register - UINT8 icr; + uint8_t icr; // Command Vector Register - UINT8 cvr; + uint8_t cvr; // Interrupt Status Register - UINT8 isr; + uint8_t isr; // Interrupt Vector Register - UINT8 ivr; + uint8_t ivr; // Transmit / Receive Registers - UINT8 trxh; - UINT8 trxl; + uint8_t trxh; + uint8_t trxl; // HACK - Host interface bootstrap write offset - UINT16 bootstrap_offset; + uint16_t bootstrap_offset; }; @@ -84,28 +84,28 @@ struct dsp56k_data_alu struct dsp56k_agu { // Four address registers - UINT16 r0; - UINT16 r1; - UINT16 r2; - UINT16 r3; + uint16_t r0; + uint16_t r1; + uint16_t r2; + uint16_t r3; // Four offset registers - UINT16 n0; - UINT16 n1; - UINT16 n2; - UINT16 n3; + uint16_t n0; + uint16_t n1; + uint16_t n2; + uint16_t n3; // Four modifier registers - UINT16 m0; - UINT16 m1; - UINT16 m2; - UINT16 m3; + uint16_t m0; + uint16_t m1; + uint16_t m2; + uint16_t m3; // Used in loop processing - UINT16 temp; + uint16_t temp; // FM.4-5 - hmmm? - // UINT8 status; + // uint8_t status; // Basics }; @@ -114,22 +114,22 @@ struct dsp56k_agu struct dsp56k_pcu { // Program Counter - UINT16 pc; + uint16_t pc; // Loop Address - UINT16 la; + uint16_t la; // Loop Counter - UINT16 lc; + uint16_t lc; // Status Register - UINT16 sr; + uint16_t sr; // Operating Mode Register - UINT16 omr; + uint16_t omr; // Stack Pointer - UINT16 sp; + uint16_t sp; // Stack (TODO: 15-level?) PAIR ss[16]; @@ -138,12 +138,12 @@ struct dsp56k_pcu void (*service_interrupts)(void); // A list of pending interrupts (indices into dsp56k_interrupt_sources array) - INT8 pending_interrupts[32]; + int8_t pending_interrupts[32]; // Basics // Other PCU internals - UINT16 reset_vector; + uint16_t reset_vector; }; @@ -170,47 +170,47 @@ struct dsp56k_core dsp56k_host_interface HI; // IRQ line states - UINT8 modA_state; - UINT8 modB_state; - UINT8 modC_state; - UINT8 reset_state; + uint8_t modA_state; + uint8_t modB_state; + uint8_t modC_state; + uint8_t reset_state; // HACK - Bootstrap mode state variable. - UINT8 bootstrap_mode; + uint8_t bootstrap_mode; - UINT8 repFlag; // Knowing if we're in a 'repeat' state (dunno how the processor does this) - UINT32 repAddr; // The address of the instruction to repeat... + uint8_t repFlag; // Knowing if we're in a 'repeat' state (dunno how the processor does this) + uint32_t repAddr; // The address of the instruction to repeat... /* MAME internal stuff */ int icount; - UINT32 ppc; - UINT32 op; + uint32_t ppc; + uint32_t op; int interrupt_cycles; - void (*output_pins_changed)(UINT32 pins); + void (*output_pins_changed)(uint32_t pins); cpu_device *device; address_space *program; direct_read_data *direct; address_space *data; - UINT16 peripheral_ram[0x40]; - UINT16 *program_ram; + uint16_t peripheral_ram[0x40]; + uint16_t *program_ram; }; class dsp56k_device : public cpu_device { public: - dsp56k_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + dsp56k_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); DECLARE_READ16_MEMBER( peripheral_register_r ); DECLARE_WRITE16_MEMBER( peripheral_register_w ); - void host_interface_write(UINT8 offset, UINT8 data); - UINT8 host_interface_read(UINT8 offset); + void host_interface_write(uint8_t offset, uint8_t data); + uint8_t host_interface_read(uint8_t offset); - UINT16 get_peripheral_memory(UINT16 addr); + uint16_t get_peripheral_memory(uint16_t addr); protected: // device-level overrides @@ -218,12 +218,12 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 2 - 1) / 2; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 2); } - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 8; } - virtual UINT32 execute_input_lines() const override { return 4; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 2 - 1) / 2; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 8; } + virtual uint32_t execute_input_lines() const override { return 4; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -234,14 +234,14 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; address_space_config m_data_config; - required_shared_ptr m_program_ram; + required_shared_ptr m_program_ram; dsp56k_core m_dsp56k_core; diff --git a/src/devices/cpu/dsp56k/dsp56mem.cpp b/src/devices/cpu/dsp56k/dsp56mem.cpp index 5f8d4e405bd..ad8cfd6320e 100644 --- a/src/devices/cpu/dsp56k/dsp56mem.cpp +++ b/src/devices/cpu/dsp56k/dsp56mem.cpp @@ -9,21 +9,21 @@ namespace DSP56K { /* IPR Accessor Implementations */ -void IPR_set(dsp56k_core* cpustate, UINT16 value) +void IPR_set(dsp56k_core* cpustate, uint16_t value) { /* TODO: Is there anything else? */ IPR = value; } -INT8 irqa_ipl(dsp56k_core* cpustate) { return ((IPR & 0x0003) >> 0) - 1; } -UINT8 irqa_trigger(dsp56k_core* cpustate){ return (IPR & 0x0004) >> 2; } -INT8 irqb_ipl(dsp56k_core* cpustate) { return ((IPR & 0x0018) >> 3) - 1; } -UINT8 irqb_trigger(dsp56k_core* cpustate){ return (IPR & 0x0002) >> 5; } -INT8 codec_ipl(dsp56k_core* cpustate) { return ((IPR & 0x00c0) >> 6) - 1; } -INT8 host_ipl(dsp56k_core* cpustate) { return ((IPR & 0x0300) >> 8) - 1; } -INT8 ssi0_ipl(dsp56k_core* cpustate) { return ((IPR & 0x0c00) >> 10) - 1; } -INT8 ssi1_ipl(dsp56k_core* cpustate) { return ((IPR & 0x3000) >> 12) - 1; } -INT8 tm_ipl(dsp56k_core* cpustate) { return ((IPR & 0xc000) >> 14) - 1; } +int8_t irqa_ipl(dsp56k_core* cpustate) { return ((IPR & 0x0003) >> 0) - 1; } +uint8_t irqa_trigger(dsp56k_core* cpustate){ return (IPR & 0x0004) >> 2; } +int8_t irqb_ipl(dsp56k_core* cpustate) { return ((IPR & 0x0018) >> 3) - 1; } +uint8_t irqb_trigger(dsp56k_core* cpustate){ return (IPR & 0x0002) >> 5; } +int8_t codec_ipl(dsp56k_core* cpustate) { return ((IPR & 0x00c0) >> 6) - 1; } +int8_t host_ipl(dsp56k_core* cpustate) { return ((IPR & 0x0300) >> 8) - 1; } +int8_t ssi0_ipl(dsp56k_core* cpustate) { return ((IPR & 0x0c00) >> 10) - 1; } +int8_t ssi1_ipl(dsp56k_core* cpustate) { return ((IPR & 0x3000) >> 12) - 1; } +int8_t tm_ipl(dsp56k_core* cpustate) { return ((IPR & 0xc000) >> 14) - 1; } void mem_reset(dsp56k_core* cpustate) { @@ -44,7 +44,7 @@ void mem_reset(dsp56k_core* cpustate) /************************************/ /* Host Control Register (HCR) Bits */ /************************************/ -void HCR_set(dsp56k_core* cpustate, UINT16 value) +void HCR_set(dsp56k_core* cpustate, uint16_t value) { HF3_bit_set (cpustate, (value & 0x0010) >> 4); HF2_bit_set (cpustate, (value & 0x0008) >> 3); @@ -52,13 +52,13 @@ void HCR_set(dsp56k_core* cpustate, UINT16 value) HTIE_bit_set(cpustate, (value & 0x0002) >> 1); HRIE_bit_set(cpustate, (value & 0x0001) >> 0); } -//UINT16 HF3_bit(dsp56k_core* cpustate) { return ((HCR & 0x0010) != 0); } -//UINT16 HF2_bit(dsp56k_core* cpustate) { return ((HCR & 0x0008) != 0); } -UINT16 HCIE_bit(dsp56k_core* cpustate) { return ((HCR & 0x0004) != 0); } -UINT16 HTIE_bit(dsp56k_core* cpustate) { return ((HCR & 0x0002) != 0); } -UINT16 HRIE_bit(dsp56k_core* cpustate) { return ((HCR & 0x0001) != 0); } +//uint16_t HF3_bit(dsp56k_core* cpustate) { return ((HCR & 0x0010) != 0); } +//uint16_t HF2_bit(dsp56k_core* cpustate) { return ((HCR & 0x0008) != 0); } +uint16_t HCIE_bit(dsp56k_core* cpustate) { return ((HCR & 0x0004) != 0); } +uint16_t HTIE_bit(dsp56k_core* cpustate) { return ((HCR & 0x0002) != 0); } +uint16_t HRIE_bit(dsp56k_core* cpustate) { return ((HCR & 0x0001) != 0); } -void HF3_bit_set(dsp56k_core* cpustate, UINT16 value) +void HF3_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HCR &= ~(0x0010); @@ -66,7 +66,7 @@ void HF3_bit_set(dsp56k_core* cpustate, UINT16 value) HF3_bit_host_set(cpustate, value); } -void HF2_bit_set(dsp56k_core* cpustate, UINT16 value) +void HF2_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HCR &= ~(0x0008); @@ -74,19 +74,19 @@ void HF2_bit_set(dsp56k_core* cpustate, UINT16 value) HF2_bit_host_set(cpustate, value); } -void HCIE_bit_set(dsp56k_core* cpustate, UINT16 value) +void HCIE_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HCR &= ~(0x0004); HCR |= (value << 2); } -void HTIE_bit_set(dsp56k_core* cpustate, UINT16 value) +void HTIE_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HCR &= ~(0x0002); HCR |= (value << 1); } -void HRIE_bit_set(dsp56k_core* cpustate, UINT16 value) +void HRIE_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HCR &= ~(0x0001); @@ -96,33 +96,33 @@ void HRIE_bit_set(dsp56k_core* cpustate, UINT16 value) /***********************************/ /* Host Status Register (HSR) Bits */ /***********************************/ -//UINT16 DMA_bit(dsp56k_core* cpustate) { return ((HSR & 0x0080) != 0); } -//UINT16 HF1_bit(dsp56k_core* cpustate) { return ((HSR & 0x0010) != 0); } -//UINT16 HF0_bit(dsp56k_core* cpustate) { return ((HSR & 0x0008) != 0); } -//UINT16 HCP_bit(dsp56k_core* cpustate) { return ((HSR & 0x0004) != 0); } -UINT16 HTDE_bit(dsp56k_core* cpustate) { return ((HSR & 0x0002) != 0); } -UINT16 HRDF_bit(dsp56k_core* cpustate) { return ((HSR & 0x0001) != 0); } +//uint16_t DMA_bit(dsp56k_core* cpustate) { return ((HSR & 0x0080) != 0); } +//uint16_t HF1_bit(dsp56k_core* cpustate) { return ((HSR & 0x0010) != 0); } +//uint16_t HF0_bit(dsp56k_core* cpustate) { return ((HSR & 0x0008) != 0); } +//uint16_t HCP_bit(dsp56k_core* cpustate) { return ((HSR & 0x0004) != 0); } +uint16_t HTDE_bit(dsp56k_core* cpustate) { return ((HSR & 0x0002) != 0); } +uint16_t HRDF_bit(dsp56k_core* cpustate) { return ((HSR & 0x0001) != 0); } -void DMA_bit_set(dsp56k_core* cpustate, UINT16 value) +void DMA_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HSR &= ~(0x0080); HSR |= (value << 7); // TODO: 5-12 When the DMA bit is set, the DMA mode is enabled by the Host Mode bits HM0 & HM1 } -void HF1_bit_set(dsp56k_core* cpustate, UINT16 value) +void HF1_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HSR &= ~(0x0010); HSR |= (value << 4); } -void HF0_bit_set(dsp56k_core* cpustate, UINT16 value) +void HF0_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HSR &= ~(0x0008); HSR |= (value << 3); } -void HCP_bit_set(dsp56k_core* cpustate, UINT16 value) +void HCP_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HSR &= ~(0x0004); @@ -131,7 +131,7 @@ void HCP_bit_set(dsp56k_core* cpustate, UINT16 value) if (value && HCIE_bit(cpustate)) dsp56k_add_pending_interrupt(cpustate, "Host Command"); } -void HTDE_bit_set(dsp56k_core* cpustate, UINT16 value) +void HTDE_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HSR &= ~(0x0002); @@ -145,7 +145,7 @@ void HTDE_bit_set(dsp56k_core* cpustate, UINT16 value) if (!value && !RXDF_bit(cpustate)) dsp56k_host_interface_HTX_to_host(cpustate); } -void HRDF_bit_set(dsp56k_core* cpustate, UINT16 value) +void HRDF_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x01; HSR &= ~(0x0001); @@ -168,7 +168,7 @@ void HRDF_bit_set(dsp56k_core* cpustate, UINT16 value) /*****************************************/ /* Interrupt Control Register (ICR) Bits */ /*****************************************/ -void ICR_set(dsp56k_core* cpustate, UINT8 value) +void ICR_set(dsp56k_core* cpustate, uint8_t value) { HF1_bit_host_set(cpustate, (value & 0x10) >> 4); HF0_bit_host_set(cpustate, (value & 0x08) >> 3); @@ -176,18 +176,18 @@ void ICR_set(dsp56k_core* cpustate, UINT8 value) RREQ_bit_set(cpustate, (value & 0x01) >> 0); } -//UINT8 INIT_bit(dsp56k_core* cpustate); #define x_initBIT ((dsp56k.HI.ICR & 0x0080) != 0) -//UINT8 HM1_bit(dsp56k_core* cpustate); #define x_hm1BIT ((dsp56k.HI.ICR & 0x0040) != 0) -//UINT8 HM0_bit(dsp56k_core* cpustate); #define x_hm0BIT ((dsp56k.HI.ICR & 0x0020) != 0) -//UINT8 HF1_bit_host(dsp56k_core* cpustate); #define x_hf1BIT ((dsp56k.HI.ICR & 0x0010) != 0) -//UINT8 HF0_bit_host(dsp56k_core* cpustate); #define x_hf0BIT ((dsp56k.HI.ICR & 0x0008) != 0) -//UINT8 TREQ_bit(dsp56k_core* cpustate); #define x_treqBIT ((dsp56k.HI.ICR & 0x0002) != 0) -//UINT8 RREQ_bit(dsp56k_core* cpustate); #define x_rreqBIT ((dsp56k.HI.ICR & 0x0001) != 0) +//uint8_t INIT_bit(dsp56k_core* cpustate); #define x_initBIT ((dsp56k.HI.ICR & 0x0080) != 0) +//uint8_t HM1_bit(dsp56k_core* cpustate); #define x_hm1BIT ((dsp56k.HI.ICR & 0x0040) != 0) +//uint8_t HM0_bit(dsp56k_core* cpustate); #define x_hm0BIT ((dsp56k.HI.ICR & 0x0020) != 0) +//uint8_t HF1_bit_host(dsp56k_core* cpustate); #define x_hf1BIT ((dsp56k.HI.ICR & 0x0010) != 0) +//uint8_t HF0_bit_host(dsp56k_core* cpustate); #define x_hf0BIT ((dsp56k.HI.ICR & 0x0008) != 0) +//uint8_t TREQ_bit(dsp56k_core* cpustate); #define x_treqBIT ((dsp56k.HI.ICR & 0x0002) != 0) +//uint8_t RREQ_bit(dsp56k_core* cpustate); #define x_rreqBIT ((dsp56k.HI.ICR & 0x0001) != 0) -//void INIT_bit_set(dsp56k_core* cpustate, UINT8 value); #define CLEAR_x_initBIT() (dsp56k.HI.ICR &= (~0x0080)) -//void HM1_bit_set(dsp56k_core* cpustate, UINT8 value); #define CLEAR_x_hm1BIT() (dsp56k.HI.ICR &= (~0x0040)) -//void HM0_bit_set(dsp56k_core* cpustate, UINT8 value); #define CLEAR_x_hm0BIT() (dsp56k.HI.ICR &= (~0x0020)) -void HF1_bit_host_set(dsp56k_core* cpustate, UINT8 value) +//void INIT_bit_set(dsp56k_core* cpustate, uint8_t value); #define CLEAR_x_initBIT() (dsp56k.HI.ICR &= (~0x0080)) +//void HM1_bit_set(dsp56k_core* cpustate, uint8_t value); #define CLEAR_x_hm1BIT() (dsp56k.HI.ICR &= (~0x0040)) +//void HM0_bit_set(dsp56k_core* cpustate, uint8_t value); #define CLEAR_x_hm0BIT() (dsp56k.HI.ICR &= (~0x0020)) +void HF1_bit_host_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x01; ICR &= ~(0x10); @@ -195,7 +195,7 @@ void HF1_bit_host_set(dsp56k_core* cpustate, UINT8 value) HF1_bit_set(cpustate, value); // 5-14 } -void HF0_bit_host_set(dsp56k_core* cpustate, UINT8 value) +void HF0_bit_host_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x01; ICR &= ~(0x08); @@ -203,13 +203,13 @@ void HF0_bit_host_set(dsp56k_core* cpustate, UINT8 value) HF0_bit_set(cpustate, value); // 5-13 } -void TREQ_bit_set(dsp56k_core* cpustate, UINT8 value) +void TREQ_bit_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x01; ICR &= ~(0x02); ICR |= (value << 1); } -void RREQ_bit_set(dsp56k_core* cpustate, UINT8 value) +void RREQ_bit_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x01; ICR &= ~(0x01); @@ -227,16 +227,16 @@ void RREQ_bit_set(dsp56k_core* cpustate, UINT8 value) /**************************************/ /* Command Vector Register (CVR) Bits */ /**************************************/ -UINT8 HV_bits(dsp56k_core* cpustate) { return (CVR & 0x1f); } +uint8_t HV_bits(dsp56k_core* cpustate) { return (CVR & 0x1f); } -void CVR_set(dsp56k_core* cpustate, UINT8 value) +void CVR_set(dsp56k_core* cpustate, uint8_t value) { /* A single, unified place to run all callbacks for each of the bits */ HC_bit_set(cpustate, (value & 0x80) >> 7); HV_bits_set(cpustate, (value & 0x1f)); } -void HC_bit_set(dsp56k_core* cpustate, UINT8 value) +void HC_bit_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x01; CVR &= ~(0x80); @@ -244,7 +244,7 @@ void HC_bit_set(dsp56k_core* cpustate, UINT8 value) HCP_bit_set(cpustate, value); // 5-9 & 5-11 } -void HV_bits_set(dsp56k_core* cpustate, UINT8 value) +void HV_bits_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x1f; CVR &= ~(0x1f); @@ -255,23 +255,23 @@ void HV_bits_set(dsp56k_core* cpustate, UINT8 value) /****************************************/ /* Interrupt Status Register (ISR) Bits */ /****************************************/ -UINT8 TXDE_bit(dsp56k_core* cpustate) { return ((ISR & 0x0002) != 0); } -UINT8 RXDF_bit(dsp56k_core* cpustate) { return ((ISR & 0x0001) != 0); } +uint8_t TXDE_bit(dsp56k_core* cpustate) { return ((ISR & 0x0002) != 0); } +uint8_t RXDF_bit(dsp56k_core* cpustate) { return ((ISR & 0x0001) != 0); } -void HF3_bit_host_set(dsp56k_core* cpustate, UINT8 value) +void HF3_bit_host_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x01; ISR &= ~(0x0010); ISR |= (value << 4); } -void HF2_bit_host_set(dsp56k_core* cpustate, UINT8 value) +void HF2_bit_host_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x01; ISR &= ~(0x0008); ISR |= (value << 3); } -void TXDE_bit_set(dsp56k_core* cpustate, UINT8 value) +void TXDE_bit_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x01; ISR &= ~(0x0002); @@ -282,7 +282,7 @@ void TXDE_bit_set(dsp56k_core* cpustate, UINT8 value) dsp56k_host_interface_host_to_HTX(cpustate); } -void RXDF_bit_set(dsp56k_core* cpustate, UINT8 value) +void RXDF_bit_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x01; ISR &= ~(0x0001); @@ -347,7 +347,7 @@ void dsp56k_host_interface_host_to_HTX(dsp56k_core* cpustate) I/O INTERFACE ***************************************************************************/ /* BCR */ -void BCR_set(dsp56k_core* cpustate, UINT16 value) +void BCR_set(dsp56k_core* cpustate, uint16_t value) { RH_bit_set(cpustate, (value & 0x8000) >> 15); BS_bit_set(cpustate, (value & 0x4000) >> 14); @@ -355,12 +355,12 @@ void BCR_set(dsp56k_core* cpustate, UINT16 value) external_p_wait_states_set(cpustate, (value & 0x001f) >> 0); } -//UINT16 RH_bit(dsp56k_core* cpustate); -//UINT16 BS_bit(dsp56k_core* cpustate); -//UINT16 external_x_wait_states(dsp56k_core* cpustate); -//UINT16 external_p_wait_states(dsp56k_core* cpustate); +//uint16_t RH_bit(dsp56k_core* cpustate); +//uint16_t BS_bit(dsp56k_core* cpustate); +//uint16_t external_x_wait_states(dsp56k_core* cpustate); +//uint16_t external_p_wait_states(dsp56k_core* cpustate); -void RH_bit_set(dsp56k_core* cpustate, UINT16 value) +void RH_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x0001; BCR &= ~(0x8000); @@ -368,7 +368,7 @@ void RH_bit_set(dsp56k_core* cpustate, UINT16 value) // TODO: 4-6 Assert BR pin? } -void BS_bit_set(dsp56k_core* cpustate, UINT16 value) +void BS_bit_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x0001; BCR &= ~(0x4000); @@ -376,13 +376,13 @@ void BS_bit_set(dsp56k_core* cpustate, UINT16 value) // TODO: 4-6 Respond to BR pin? } -void external_x_wait_states_set(dsp56k_core* cpustate, UINT16 value) +void external_x_wait_states_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x001f; BCR &= ~(0x03e0); BCR |= (value << 5); } -void external_p_wait_states_set(dsp56k_core* cpustate, UINT16 value) +void external_p_wait_states_set(dsp56k_core* cpustate, uint16_t value) { value = value & 0x001f; BCR &= ~(0x001f); @@ -391,7 +391,7 @@ void external_p_wait_states_set(dsp56k_core* cpustate, UINT16 value) /* Port B Control Register PBC */ -void PBC_set(dsp56k_core* cpustate, UINT16 value) +void PBC_set(dsp56k_core* cpustate, uint16_t value) { if (value & 0xfffe) cpustate->device->logerror("Dsp56k : Attempting to set reserved bits in the PBC. Ignoring.\n"); @@ -410,7 +410,7 @@ int host_interface_active(dsp56k_core* cpustate) #endif /* Port B Data Direction Register (PBDDR) */ -void PBDDR_set(dsp56k_core* cpustate, UINT16 value) +void PBDDR_set(dsp56k_core* cpustate, uint16_t value) { if (value & 0x8000) cpustate->device->logerror("Dsp56k : Attempting to set reserved bits in the PBDDR. Ignoring.\n"); @@ -423,7 +423,7 @@ void PBDDR_set(dsp56k_core* cpustate, UINT16 value) } /* Port B Data Register (PBD) */ -void PBD_set(dsp56k_core* cpustate, UINT16 value) +void PBD_set(dsp56k_core* cpustate, uint16_t value) { if (value & 0x8000) cpustate->device->logerror("Dsp56k : Attempting to set reserved bits in the PBD. Ignoring.\n"); @@ -436,7 +436,7 @@ void PBD_set(dsp56k_core* cpustate, UINT16 value) } /* Port C Control Register (PCC) */ -void PCC_set(dsp56k_core* cpustate, UINT16 value) +void PCC_set(dsp56k_core* cpustate, uint16_t value) { if (value & 0xf000) cpustate->device->logerror("Dsp56k : Attempting to set reserved bits in the PCC. Ignoring.\n"); @@ -449,7 +449,7 @@ void PCC_set(dsp56k_core* cpustate, UINT16 value) } /* Port C Data Direction Register (PCDDR) */ -void PCDDR_set(dsp56k_core* cpustate, UINT16 value) +void PCDDR_set(dsp56k_core* cpustate, uint16_t value) { if (value & 0xf000) cpustate->device->logerror("Dsp56k : Attempting to set reserved bits in the PCDDR. Ignoring.\n"); @@ -462,7 +462,7 @@ void PCDDR_set(dsp56k_core* cpustate, UINT16 value) } /* Port C Data Register (PCD) */ -void PCD_set(dsp56k_core* cpustate, UINT16 value) +void PCD_set(dsp56k_core* cpustate, uint16_t value) { if (value & 0xf000) cpustate->device->logerror("Dsp56k : Attempting to set reserved bits in the PCD. Ignoring.\n"); @@ -557,7 +557,7 @@ READ16_MEMBER( dsp56k_device::peripheral_register_r ) return 0xbeef; else { - UINT16 value = HRX; // TODO: Maybe not exactly right? Just being safe. + uint16_t value = HRX; // TODO: Maybe not exactly right? Just being safe. DSP56K::HRDF_bit_set(cpustate, 0); return value; } @@ -780,7 +780,7 @@ WRITE16_MEMBER( dsp56k_device::peripheral_register_w ) /* These two functions are exposed to the outside world */ /* They represent the host side of the dsp56k's host interface */ -void dsp56k_device::host_interface_write(UINT8 offset, UINT8 data) +void dsp56k_device::host_interface_write(uint8_t offset, uint8_t data) { dsp56k_core* cpustate = &m_dsp56k_core; @@ -876,7 +876,7 @@ void dsp56k_device::host_interface_write(UINT8 offset, UINT8 data) } } -UINT8 dsp56k_device::host_interface_read(UINT8 offset) +uint8_t dsp56k_device::host_interface_read(uint8_t offset) { dsp56k_core* cpustate = &m_dsp56k_core; @@ -928,7 +928,7 @@ UINT8 dsp56k_device::host_interface_read(UINT8 offset) return 0xbf; else { - UINT8 value = RXL; // TODO: Maybe not exactly right? I'm just being safe. + uint8_t value = RXL; // TODO: Maybe not exactly right? I'm just being safe. DSP56K::RXDF_bit_set(cpustate, 0); return value; } @@ -941,7 +941,7 @@ UINT8 dsp56k_device::host_interface_read(UINT8 offset) } /* MISC*/ -UINT16 dsp56k_device::get_peripheral_memory(UINT16 addr) +uint16_t dsp56k_device::get_peripheral_memory(uint16_t addr) { dsp56k_core* cpustate = &m_dsp56k_core; return cpustate->peripheral_ram[A2O(addr)]; diff --git a/src/devices/cpu/dsp56k/dsp56mem.h b/src/devices/cpu/dsp56k/dsp56mem.h index e8445f1b736..c80e278758e 100644 --- a/src/devices/cpu/dsp56k/dsp56mem.h +++ b/src/devices/cpu/dsp56k/dsp56mem.h @@ -56,19 +56,19 @@ void mem_reset(dsp56k_core* cpustate); #define TSMB1 (cpustate->peripheral_ram[A2O(0xfffd)]) /* Interrupt priority register (IPR) bits */ -void IPR_set(dsp56k_core* cpustate, UINT16 value); +void IPR_set(dsp56k_core* cpustate, uint16_t value); /* A return value of -1 means disabled */ -INT8 irqa_ipl(dsp56k_core* cpustate); -INT8 irqb_ipl(dsp56k_core* cpustate); -UINT8 irqa_trigger(dsp56k_core* cpustate); -UINT8 irqb_trigger(dsp56k_core* cpustate); +int8_t irqa_ipl(dsp56k_core* cpustate); +int8_t irqb_ipl(dsp56k_core* cpustate); +uint8_t irqa_trigger(dsp56k_core* cpustate); +uint8_t irqb_trigger(dsp56k_core* cpustate); -INT8 codec_ipl(dsp56k_core* cpustate); -INT8 host_ipl(dsp56k_core* cpustate); -INT8 ssi0_ipl(dsp56k_core* cpustate); -INT8 ssi1_ipl(dsp56k_core* cpustate); -INT8 tm_ipl(dsp56k_core* cpustate); +int8_t codec_ipl(dsp56k_core* cpustate); +int8_t host_ipl(dsp56k_core* cpustate); +int8_t ssi0_ipl(dsp56k_core* cpustate); +int8_t ssi1_ipl(dsp56k_core* cpustate); +int8_t tm_ipl(dsp56k_core* cpustate); /*************************************************************************** @@ -91,107 +91,107 @@ void dsp56k_host_interface_reset(dsp56k_core* cpustate); /* DSP56k SIDE */ /***************/ /* Host Control Register (HCR) Bits */ -void HCR_set(dsp56k_core* cpustate, UINT16 value); +void HCR_set(dsp56k_core* cpustate, uint16_t value); -//UINT16 HF3_bit(dsp56k_core* cpustate); #define hf3BIT ((HCR & 0x0010) != 0) -//UINT16 HF2_bit(dsp56k_core* cpustate); #define hf2BIT ((HCR & 0x0008) != 0) -UINT16 HCIE_bit(dsp56k_core* cpustate); -UINT16 HTIE_bit(dsp56k_core* cpustate); -UINT16 HRIE_bit(dsp56k_core* cpustate); +//uint16_t HF3_bit(dsp56k_core* cpustate); #define hf3BIT ((HCR & 0x0010) != 0) +//uint16_t HF2_bit(dsp56k_core* cpustate); #define hf2BIT ((HCR & 0x0008) != 0) +uint16_t HCIE_bit(dsp56k_core* cpustate); +uint16_t HTIE_bit(dsp56k_core* cpustate); +uint16_t HRIE_bit(dsp56k_core* cpustate); -void HF3_bit_set(dsp56k_core* cpustate, UINT16 value); -void HF2_bit_set(dsp56k_core* cpustate, UINT16 value); -void HCIE_bit_set(dsp56k_core* cpustate, UINT16 value); -void HTIE_bit_set(dsp56k_core* cpustate, UINT16 value); -void HRIE_bit_set(dsp56k_core* cpustate, UINT16 value); +void HF3_bit_set(dsp56k_core* cpustate, uint16_t value); +void HF2_bit_set(dsp56k_core* cpustate, uint16_t value); +void HCIE_bit_set(dsp56k_core* cpustate, uint16_t value); +void HTIE_bit_set(dsp56k_core* cpustate, uint16_t value); +void HRIE_bit_set(dsp56k_core* cpustate, uint16_t value); /* Host Status Register (HSR) Bits */ -//void HSR_set(dsp56k_core* cpustate, UINT16 value); - -//UINT16 DMA_bit(dsp56k_core* cpustate); #define dmaBIT ((HSR & 0x0080) != 0) -//UINT16 HF1_bit(dsp56k_core* cpustate); #define hf1BIT ((HSR & 0x0010) != 0) -//UINT16 HF0_bit(dsp56k_core* cpustate); #define hf0BIT ((HSR & 0x0008) != 0) -//UINT16 HCP_bit(dsp56k_core* cpustate); #define hcpBIT ((HSR & 0x0004) != 0) -UINT16 HTDE_bit(dsp56k_core* cpustate); -UINT16 HRDF_bit(dsp56k_core* cpustate); - -void DMA_bit_set(dsp56k_core* cpustate, UINT16 value); -void HF1_bit_set(dsp56k_core* cpustate, UINT16 value); -void HF0_bit_set(dsp56k_core* cpustate, UINT16 value); -void HCP_bit_set(dsp56k_core* cpustate, UINT16 value); -void HTDE_bit_set(dsp56k_core* cpustate, UINT16 value); -void HRDF_bit_set(dsp56k_core* cpustate, UINT16 value); +//void HSR_set(dsp56k_core* cpustate, uint16_t value); + +//uint16_t DMA_bit(dsp56k_core* cpustate); #define dmaBIT ((HSR & 0x0080) != 0) +//uint16_t HF1_bit(dsp56k_core* cpustate); #define hf1BIT ((HSR & 0x0010) != 0) +//uint16_t HF0_bit(dsp56k_core* cpustate); #define hf0BIT ((HSR & 0x0008) != 0) +//uint16_t HCP_bit(dsp56k_core* cpustate); #define hcpBIT ((HSR & 0x0004) != 0) +uint16_t HTDE_bit(dsp56k_core* cpustate); +uint16_t HRDF_bit(dsp56k_core* cpustate); + +void DMA_bit_set(dsp56k_core* cpustate, uint16_t value); +void HF1_bit_set(dsp56k_core* cpustate, uint16_t value); +void HF0_bit_set(dsp56k_core* cpustate, uint16_t value); +void HCP_bit_set(dsp56k_core* cpustate, uint16_t value); +void HTDE_bit_set(dsp56k_core* cpustate, uint16_t value); +void HRDF_bit_set(dsp56k_core* cpustate, uint16_t value); /*************/ /* HOST SIDE */ /*************/ /* Interrupt Control Register (ICR) Bits */ -void ICR_set(dsp56k_core* cpustate, UINT8 value); - -//UINT8 INIT_bit(dsp56k_core* cpustate); #define x_initBIT ((dsp56k.HI.ICR & 0x0080) != 0) -//UINT8 HM1_bit(dsp56k_core* cpustate); #define x_hm1BIT ((dsp56k.HI.ICR & 0x0040) != 0) -//UINT8 HM0_bit(dsp56k_core* cpustate); #define x_hm0BIT ((dsp56k.HI.ICR & 0x0020) != 0) -//UINT8 HF1_bit_host(dsp56k_core* cpustate); #define x_hf1BIT ((dsp56k.HI.ICR & 0x0010) != 0) -//UINT8 HF0_bit_host(dsp56k_core* cpustate); #define x_hf0BIT ((dsp56k.HI.ICR & 0x0008) != 0) -//UINT8 TREQ_bit(dsp56k_core* cpustate); #define x_treqBIT ((dsp56k.HI.ICR & 0x0002) != 0) -//UINT8 RREQ_bit(dsp56k_core* cpustate); #define x_rreqBIT ((dsp56k.HI.ICR & 0x0001) != 0) - -//void INIT_bit_set(dsp56k_core* cpustate, UINT8 value); #define CLEAR_x_initBIT() (dsp56k.HI.ICR &= (~0x0080)) -//void HM1_bit_set(dsp56k_core* cpustate, UINT8 value); #define CLEAR_x_hm1BIT() (dsp56k.HI.ICR &= (~0x0040)) -//void HM0_bit_set(dsp56k_core* cpustate, UINT8 value); #define CLEAR_x_hm0BIT() (dsp56k.HI.ICR &= (~0x0020)) -void HF1_bit_host_set(dsp56k_core* cpustate, UINT8 value); -void HF0_bit_host_set(dsp56k_core* cpustate, UINT8 value); -void TREQ_bit_set(dsp56k_core* cpustate, UINT8 value); -void RREQ_bit_set(dsp56k_core* cpustate, UINT8 value); +void ICR_set(dsp56k_core* cpustate, uint8_t value); + +//uint8_t INIT_bit(dsp56k_core* cpustate); #define x_initBIT ((dsp56k.HI.ICR & 0x0080) != 0) +//uint8_t HM1_bit(dsp56k_core* cpustate); #define x_hm1BIT ((dsp56k.HI.ICR & 0x0040) != 0) +//uint8_t HM0_bit(dsp56k_core* cpustate); #define x_hm0BIT ((dsp56k.HI.ICR & 0x0020) != 0) +//uint8_t HF1_bit_host(dsp56k_core* cpustate); #define x_hf1BIT ((dsp56k.HI.ICR & 0x0010) != 0) +//uint8_t HF0_bit_host(dsp56k_core* cpustate); #define x_hf0BIT ((dsp56k.HI.ICR & 0x0008) != 0) +//uint8_t TREQ_bit(dsp56k_core* cpustate); #define x_treqBIT ((dsp56k.HI.ICR & 0x0002) != 0) +//uint8_t RREQ_bit(dsp56k_core* cpustate); #define x_rreqBIT ((dsp56k.HI.ICR & 0x0001) != 0) + +//void INIT_bit_set(dsp56k_core* cpustate, uint8_t value); #define CLEAR_x_initBIT() (dsp56k.HI.ICR &= (~0x0080)) +//void HM1_bit_set(dsp56k_core* cpustate, uint8_t value); #define CLEAR_x_hm1BIT() (dsp56k.HI.ICR &= (~0x0040)) +//void HM0_bit_set(dsp56k_core* cpustate, uint8_t value); #define CLEAR_x_hm0BIT() (dsp56k.HI.ICR &= (~0x0020)) +void HF1_bit_host_set(dsp56k_core* cpustate, uint8_t value); +void HF0_bit_host_set(dsp56k_core* cpustate, uint8_t value); +void TREQ_bit_set(dsp56k_core* cpustate, uint8_t value); +void RREQ_bit_set(dsp56k_core* cpustate, uint8_t value); /* Command Vector Register (CVR) Bits */ -void CVR_set(dsp56k_core* cpustate, UINT8 value); +void CVR_set(dsp56k_core* cpustate, uint8_t value); -//UINT8 HC_bit(); -UINT8 HV_bits(dsp56k_core* cpustate); +//uint8_t HC_bit(); +uint8_t HV_bits(dsp56k_core* cpustate); -void HC_bit_set(dsp56k_core* cpustate, UINT8 value); -void HV_bits_set(dsp56k_core* cpustate, UINT8 value); +void HC_bit_set(dsp56k_core* cpustate, uint8_t value); +void HV_bits_set(dsp56k_core* cpustate, uint8_t value); /* Interrupt Status Register (ISR) Bits */ -// void ISR_set(dsp56k_core* cpustate, UINT8 value); - -//UINT8 HREQ_bit(dsp56k_core* cpustate); #define x_hreqBIT ((dsp56k.HI.ISR & 0x0080) != 0) -//UINT8 DMA_bit(dsp56k_core* cpustate); #define x_dmaBIT ((dsp56k.HI.ISR & 0x0040) != 0) -//UINT8 HF3_bit_host(dsp56k_core* cpustate); #define x_hf3BIT ((dsp56k.HI.ISR & 0x0010) != 0) -//UINT8 HF2_bit_host(dsp56k_core* cpustate); #define x_hf2BIT ((dsp56k.HI.ISR & 0x0008) != 0) -//UINT8 TRDY_bit(dsp56k_core* cpustate); #define x_trdyBIT ((dsp56k.HI.ISR & 0x0004) != 0) -UINT8 TXDE_bit(dsp56k_core* cpustate); -UINT8 RXDF_bit(dsp56k_core* cpustate); - -//void HREQ_bit_set(dsp56k_core* cpustate, UINT8 value); #define CLEAR_x_hreqBIT() (dsp56k.HI.ISR &= (~0x0080)) -//void DMA_bit_set(dsp56k_core* cpustate, UINT8 value); #define CLEAR_x_dmaBIT() (dsp56k.HI.ISR &= (~0x0040)) -void HF3_bit_host_set(dsp56k_core* cpustate, UINT8 value); -void HF2_bit_host_set(dsp56k_core* cpustate, UINT8 value); -//void TRDY_bit_set(dsp56k_core* cpustate, UINT8 value); #define CLEAR_x_trdyBIT() (dsp56k.HI.ISR &= (~0x0004)) -void TXDE_bit_set(dsp56k_core* cpustate, UINT8 value); -void RXDF_bit_set(dsp56k_core* cpustate, UINT8 value); +// void ISR_set(dsp56k_core* cpustate, uint8_t value); + +//uint8_t HREQ_bit(dsp56k_core* cpustate); #define x_hreqBIT ((dsp56k.HI.ISR & 0x0080) != 0) +//uint8_t DMA_bit(dsp56k_core* cpustate); #define x_dmaBIT ((dsp56k.HI.ISR & 0x0040) != 0) +//uint8_t HF3_bit_host(dsp56k_core* cpustate); #define x_hf3BIT ((dsp56k.HI.ISR & 0x0010) != 0) +//uint8_t HF2_bit_host(dsp56k_core* cpustate); #define x_hf2BIT ((dsp56k.HI.ISR & 0x0008) != 0) +//uint8_t TRDY_bit(dsp56k_core* cpustate); #define x_trdyBIT ((dsp56k.HI.ISR & 0x0004) != 0) +uint8_t TXDE_bit(dsp56k_core* cpustate); +uint8_t RXDF_bit(dsp56k_core* cpustate); + +//void HREQ_bit_set(dsp56k_core* cpustate, uint8_t value); #define CLEAR_x_hreqBIT() (dsp56k.HI.ISR &= (~0x0080)) +//void DMA_bit_set(dsp56k_core* cpustate, uint8_t value); #define CLEAR_x_dmaBIT() (dsp56k.HI.ISR &= (~0x0040)) +void HF3_bit_host_set(dsp56k_core* cpustate, uint8_t value); +void HF2_bit_host_set(dsp56k_core* cpustate, uint8_t value); +//void TRDY_bit_set(dsp56k_core* cpustate, uint8_t value); #define CLEAR_x_trdyBIT() (dsp56k.HI.ISR &= (~0x0004)) +void TXDE_bit_set(dsp56k_core* cpustate, uint8_t value); +void RXDF_bit_set(dsp56k_core* cpustate, uint8_t value); /* Interrupt Vector Register (IVR) Bits */ -//void IVR_set(dsp56k_core* cpustate, UINT8 value); - -//UINT8 IV7_bit(dsp56k_core* cpustate); -//UINT8 IV6_bit(dsp56k_core* cpustate); -//UINT8 IV5_bit(dsp56k_core* cpustate); -//UINT8 IV4_bit(dsp56k_core* cpustate); -//UINT8 IV3_bit(dsp56k_core* cpustate); -//UINT8 IV2_bit(dsp56k_core* cpustate); -//UINT8 IV1_bit(dsp56k_core* cpustate); -//UINT8 IV0_bit(dsp56k_core* cpustate); - -//void IV7_bit_set(dsp56k_core* cpustate, UINT8 value); -//void IV6_bit_set(dsp56k_core* cpustate, UINT8 value); -//void IV5_bit_set(dsp56k_core* cpustate, UINT8 value); -//void IV4_bit_set(dsp56k_core* cpustate, UINT8 value); -//void IV3_bit_set(dsp56k_core* cpustate, UINT8 value); -//void IV2_bit_set(dsp56k_core* cpustate, UINT8 value); -//void IV1_bit_set(dsp56k_core* cpustate, UINT8 value); -//void IV0_bit_set(dsp56k_core* cpustate, UINT8 value); +//void IVR_set(dsp56k_core* cpustate, uint8_t value); + +//uint8_t IV7_bit(dsp56k_core* cpustate); +//uint8_t IV6_bit(dsp56k_core* cpustate); +//uint8_t IV5_bit(dsp56k_core* cpustate); +//uint8_t IV4_bit(dsp56k_core* cpustate); +//uint8_t IV3_bit(dsp56k_core* cpustate); +//uint8_t IV2_bit(dsp56k_core* cpustate); +//uint8_t IV1_bit(dsp56k_core* cpustate); +//uint8_t IV0_bit(dsp56k_core* cpustate); + +//void IV7_bit_set(dsp56k_core* cpustate, uint8_t value); +//void IV6_bit_set(dsp56k_core* cpustate, uint8_t value); +//void IV5_bit_set(dsp56k_core* cpustate, uint8_t value); +//void IV4_bit_set(dsp56k_core* cpustate, uint8_t value); +//void IV3_bit_set(dsp56k_core* cpustate, uint8_t value); +//void IV2_bit_set(dsp56k_core* cpustate, uint8_t value); +//void IV1_bit_set(dsp56k_core* cpustate, uint8_t value); +//void IV0_bit_set(dsp56k_core* cpustate, uint8_t value); /* PROTOTYPES */ @@ -205,36 +205,36 @@ void dsp56k_host_interface_host_to_HTX(dsp56k_core* cpustate); void dsp56k_io_reset(dsp56k_core* cpustate); /* Port A Bus Control Register (BCR) */ -void BCR_set(dsp56k_core* cpustate, UINT16 value); +void BCR_set(dsp56k_core* cpustate, uint16_t value); -//UINT16 RH_bit(dsp56k_core* cpustate); -//UINT16 BS_bit(dsp56k_core* cpustate); -//UINT16 external_x_wait_states(dsp56k_core* cpustate); -//UINT16 external_p_wait_states(dsp56k_core* cpustate); +//uint16_t RH_bit(dsp56k_core* cpustate); +//uint16_t BS_bit(dsp56k_core* cpustate); +//uint16_t external_x_wait_states(dsp56k_core* cpustate); +//uint16_t external_p_wait_states(dsp56k_core* cpustate); -void RH_bit_set(dsp56k_core* cpustate, UINT16 value); -void BS_bit_set(dsp56k_core* cpustate, UINT16 value); -void external_x_wait_states_set(dsp56k_core* cpustate, UINT16 value); -void external_p_wait_states_set(dsp56k_core* cpustate, UINT16 value); +void RH_bit_set(dsp56k_core* cpustate, uint16_t value); +void BS_bit_set(dsp56k_core* cpustate, uint16_t value); +void external_x_wait_states_set(dsp56k_core* cpustate, uint16_t value); +void external_p_wait_states_set(dsp56k_core* cpustate, uint16_t value); /* Port B Control Register (PBC) */ -void PBC_set(dsp56k_core* cpustate, UINT16 value); +void PBC_set(dsp56k_core* cpustate, uint16_t value); //int host_interface_active(dsp56k_core* cpustate); /* Port B Data Direction Register (PBDDR) */ -void PBDDR_set(dsp56k_core* cpustate, UINT16 value); +void PBDDR_set(dsp56k_core* cpustate, uint16_t value); /* Port B Data Register (PBD) */ -void PBD_set(dsp56k_core* cpustate, UINT16 value); +void PBD_set(dsp56k_core* cpustate, uint16_t value); /* Port C Control Register (PCC) */ -void PCC_set(dsp56k_core* cpustate, UINT16 value); +void PCC_set(dsp56k_core* cpustate, uint16_t value); /* Port C Data Direction Register (PCDDR) */ -void PCDDR_set(dsp56k_core* cpustate, UINT16 value); +void PCDDR_set(dsp56k_core* cpustate, uint16_t value); /* Port C Dtaa Register (PCD) */ -void PCD_set(dsp56k_core* cpustate, UINT16 value); +void PCD_set(dsp56k_core* cpustate, uint16_t value); } // namespace DSP56K diff --git a/src/devices/cpu/dsp56k/dsp56ops.hxx b/src/devices/cpu/dsp56k/dsp56ops.hxx index f581175b6d8..0395e08d337 100644 --- a/src/devices/cpu/dsp56k/dsp56ops.hxx +++ b/src/devices/cpu/dsp56k/dsp56ops.hxx @@ -48,167 +48,167 @@ struct typed_pointer /*********************/ /* Opcode prototypes */ /*********************/ -static size_t dsp56k_op_addsub_2 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles); -static size_t dsp56k_op_mac_1 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles); -static size_t dsp56k_op_macr_1 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles); -static size_t dsp56k_op_move_1 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles); -static size_t dsp56k_op_mpy_1 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles); -static size_t dsp56k_op_mpyr_1 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles); -static size_t dsp56k_op_tfr_2 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles); -static size_t dsp56k_op_mpy_2 (dsp56k_core* cpustate, const UINT16 op_byte, UINT8* cycles); -static size_t dsp56k_op_mac_2 (dsp56k_core* cpustate, const UINT16 op_byte, UINT8* cycles); -static size_t dsp56k_op_clr (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_add (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_move (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_tfr (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_rnd (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_tst (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_inc (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_inc24 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_or (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_asr (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_asl (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_lsr (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_lsl (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_eor (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_subl (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_sub (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_clr24 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_sbc (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_cmp (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_neg (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_not (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_dec (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_dec24 (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_and (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_abs (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_ror (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_rol (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_cmpm (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_mpy (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_mpyr (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_mac (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_macr (dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles); -static size_t dsp56k_op_adc (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_andi (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_asl4 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_asr4 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_asr16 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_bfop (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_bfop_1 (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_bfop_2 (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_bcc (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_bcc_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_bcc_2 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_bra (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_bra_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_bra_2 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_brkcc (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_bscc (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_bscc_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_bsr (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_bsr_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_chkaau (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_debug (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_debugcc (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_div (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_dmac (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_do (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_do_1 (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_do_2 (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_doforever(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_enddo (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_ext (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_illegal (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_imac (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_impy (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_jcc (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_jcc_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_jmp (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_jmp_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_jscc (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_jscc_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_jsr (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_jsr_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_jsr_2 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_lea (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_lea_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_macsuuu (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_move_2 (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_movec (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_movec_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_movec_2 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_movec_3 (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_movec_4 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_movec_5 (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_movei (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_movem (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_movem_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_movem_2 (dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles); -static size_t dsp56k_op_movep (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_movep_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_moves (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_mpysuuu (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_negc (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_nop (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_norm (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_ori (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_rep (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_rep_1 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_rep_2 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_repcc (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_reset (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_rti (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_rts (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_stop (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_swap (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_swi (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_tcc (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_tfr2 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_tfr3 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_tst2 (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_wait (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); -static size_t dsp56k_op_zero (dsp56k_core* cpustate, const UINT16 op, UINT8* cycles); - - -static void execute_register_to_register_data_move(dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register, UINT64* prev_accum_value); -static void execute_address_register_update(dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register, UINT64* prev_accum_value); -static void execute_x_memory_data_move (dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register, UINT64* prev_accum_value); -static void execute_x_memory_data_move2(dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register); -static void execute_dual_x_memory_data_read(dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register); -static void execute_x_memory_data_move_with_short_displacement(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2); - -static UINT16 decode_BBB_bitmask(dsp56k_core* cpustate, UINT16 BBB, UINT16 *iVal); -static int decode_cccc_table(dsp56k_core* cpustate, UINT16 cccc); -static void decode_DDDDD_table(dsp56k_core* cpustate, UINT16 DDDDD, typed_pointer* ret); -static void decode_DD_table(dsp56k_core* cpustate, UINT16 DD, typed_pointer* ret); -static void decode_DDF_table(dsp56k_core* cpustate, UINT16 DD, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret); -static void decode_F_table(dsp56k_core* cpustate, UINT16 F, typed_pointer* ret); -static void decode_h0hF_table(dsp56k_core* cpustate, UINT16 h0h, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret); -static void decode_HH_table(dsp56k_core* cpustate, UINT16 HH, typed_pointer* ret); -static void decode_HHH_table(dsp56k_core* cpustate, UINT16 HHH, typed_pointer* ret); -static void decode_IIII_table(dsp56k_core* cpustate, UINT16 IIII, typed_pointer* src_ret, typed_pointer* dst_ret, void* working); -static void decode_JJJF_table(dsp56k_core* cpustate, UINT16 JJJ, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret); -static void decode_JJF_table(dsp56k_core* cpustate, UINT16 JJ, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret); -static void decode_JF_table(dsp56k_core* cpustate, UINT16 JJ, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret); -static void decode_KKK_table(dsp56k_core* cpustate, UINT16 KKK, typed_pointer* dst_ret1, typed_pointer* dst_ret2, void* working); -static void decode_QQF_table(dsp56k_core* cpustate, UINT16 QQ, UINT16 F, void **S1, void **S2, void **D); -static void decode_QQF_special_table(dsp56k_core* cpustate, UINT16 QQ, UINT16 F, void **S1, void **S2, void **D); -static void decode_QQQF_table(dsp56k_core* cpustate, UINT16 QQQ, UINT16 F, void **S1, void **S2, void **D); -static void decode_RR_table(dsp56k_core* cpustate, UINT16 RR, typed_pointer* ret); -static void decode_TT_table(dsp56k_core* cpustate, UINT16 TT, typed_pointer* ret); -static void decode_uuuuF_table(dsp56k_core* cpustate, UINT16 uuuu, UINT16 F, UINT8 add_sub_other, typed_pointer* src_ret, typed_pointer* dst_ret); -static void decode_Z_table(dsp56k_core* cpustate, UINT16 Z, typed_pointer* ret); - -static void execute_m_table(dsp56k_core* cpustate, int x, UINT16 m); -static void execute_mm_table(dsp56k_core* cpustate, UINT16 rnum, UINT16 mm); -static void execute_MM_table(dsp56k_core* cpustate, UINT16 rnum, UINT16 MM); -static UINT16 execute_q_table(dsp56k_core* cpustate, int RR, UINT16 q); -static void execute_z_table(dsp56k_core* cpustate, int RR, UINT16 z); - -static UINT16 assemble_address_from_Pppppp_table(dsp56k_core* cpustate, UINT16 P, UINT16 ppppp); -static UINT16 assemble_address_from_IO_short_address(dsp56k_core* cpustate, UINT16 pp); -static UINT16 assemble_address_from_6bit_signed_relative_short_address(dsp56k_core* cpustate, UINT16 srs); +static size_t dsp56k_op_addsub_2 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles); +static size_t dsp56k_op_mac_1 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles); +static size_t dsp56k_op_macr_1 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles); +static size_t dsp56k_op_move_1 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles); +static size_t dsp56k_op_mpy_1 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles); +static size_t dsp56k_op_mpyr_1 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles); +static size_t dsp56k_op_tfr_2 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles); +static size_t dsp56k_op_mpy_2 (dsp56k_core* cpustate, const uint16_t op_byte, uint8_t* cycles); +static size_t dsp56k_op_mac_2 (dsp56k_core* cpustate, const uint16_t op_byte, uint8_t* cycles); +static size_t dsp56k_op_clr (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_add (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_move (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_tfr (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_rnd (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_tst (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_inc (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_inc24 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_or (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_asr (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_asl (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_lsr (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_lsl (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_eor (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_subl (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_sub (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_clr24 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_sbc (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_cmp (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_neg (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_not (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_dec (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_dec24 (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_and (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_abs (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_ror (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_rol (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_cmpm (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_mpy (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_mpyr (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_mac (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_macr (dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles); +static size_t dsp56k_op_adc (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_andi (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_asl4 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_asr4 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_asr16 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_bfop (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_bfop_1 (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_bfop_2 (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_bcc (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_bcc_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_bcc_2 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_bra (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_bra_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_bra_2 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_brkcc (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_bscc (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_bscc_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_bsr (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_bsr_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_chkaau (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_debug (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_debugcc (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_div (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_dmac (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_do (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_do_1 (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_do_2 (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_doforever(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_enddo (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_ext (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_illegal (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_imac (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_impy (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_jcc (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_jcc_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_jmp (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_jmp_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_jscc (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_jscc_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_jsr (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_jsr_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_jsr_2 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_lea (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_lea_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_macsuuu (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_move_2 (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_movec (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_movec_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_movec_2 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_movec_3 (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_movec_4 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_movec_5 (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_movei (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_movem (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_movem_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_movem_2 (dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles); +static size_t dsp56k_op_movep (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_movep_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_moves (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_mpysuuu (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_negc (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_nop (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_norm (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_ori (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_rep (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_rep_1 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_rep_2 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_repcc (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_reset (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_rti (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_rts (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_stop (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_swap (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_swi (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_tcc (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_tfr2 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_tfr3 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_tst2 (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_wait (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); +static size_t dsp56k_op_zero (dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles); + + +static void execute_register_to_register_data_move(dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register, uint64_t* prev_accum_value); +static void execute_address_register_update(dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register, uint64_t* prev_accum_value); +static void execute_x_memory_data_move (dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register, uint64_t* prev_accum_value); +static void execute_x_memory_data_move2(dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register); +static void execute_dual_x_memory_data_read(dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register); +static void execute_x_memory_data_move_with_short_displacement(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2); + +static uint16_t decode_BBB_bitmask(dsp56k_core* cpustate, uint16_t BBB, uint16_t *iVal); +static int decode_cccc_table(dsp56k_core* cpustate, uint16_t cccc); +static void decode_DDDDD_table(dsp56k_core* cpustate, uint16_t DDDDD, typed_pointer* ret); +static void decode_DD_table(dsp56k_core* cpustate, uint16_t DD, typed_pointer* ret); +static void decode_DDF_table(dsp56k_core* cpustate, uint16_t DD, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret); +static void decode_F_table(dsp56k_core* cpustate, uint16_t F, typed_pointer* ret); +static void decode_h0hF_table(dsp56k_core* cpustate, uint16_t h0h, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret); +static void decode_HH_table(dsp56k_core* cpustate, uint16_t HH, typed_pointer* ret); +static void decode_HHH_table(dsp56k_core* cpustate, uint16_t HHH, typed_pointer* ret); +static void decode_IIII_table(dsp56k_core* cpustate, uint16_t IIII, typed_pointer* src_ret, typed_pointer* dst_ret, void* working); +static void decode_JJJF_table(dsp56k_core* cpustate, uint16_t JJJ, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret); +static void decode_JJF_table(dsp56k_core* cpustate, uint16_t JJ, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret); +static void decode_JF_table(dsp56k_core* cpustate, uint16_t JJ, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret); +static void decode_KKK_table(dsp56k_core* cpustate, uint16_t KKK, typed_pointer* dst_ret1, typed_pointer* dst_ret2, void* working); +static void decode_QQF_table(dsp56k_core* cpustate, uint16_t QQ, uint16_t F, void **S1, void **S2, void **D); +static void decode_QQF_special_table(dsp56k_core* cpustate, uint16_t QQ, uint16_t F, void **S1, void **S2, void **D); +static void decode_QQQF_table(dsp56k_core* cpustate, uint16_t QQQ, uint16_t F, void **S1, void **S2, void **D); +static void decode_RR_table(dsp56k_core* cpustate, uint16_t RR, typed_pointer* ret); +static void decode_TT_table(dsp56k_core* cpustate, uint16_t TT, typed_pointer* ret); +static void decode_uuuuF_table(dsp56k_core* cpustate, uint16_t uuuu, uint16_t F, uint8_t add_sub_other, typed_pointer* src_ret, typed_pointer* dst_ret); +static void decode_Z_table(dsp56k_core* cpustate, uint16_t Z, typed_pointer* ret); + +static void execute_m_table(dsp56k_core* cpustate, int x, uint16_t m); +static void execute_mm_table(dsp56k_core* cpustate, uint16_t rnum, uint16_t mm); +static void execute_MM_table(dsp56k_core* cpustate, uint16_t rnum, uint16_t MM); +static uint16_t execute_q_table(dsp56k_core* cpustate, int RR, uint16_t q); +static void execute_z_table(dsp56k_core* cpustate, int RR, uint16_t z); + +static uint16_t assemble_address_from_Pppppp_table(dsp56k_core* cpustate, uint16_t P, uint16_t ppppp); +static uint16_t assemble_address_from_IO_short_address(dsp56k_core* cpustate, uint16_t pp); +static uint16_t assemble_address_from_6bit_signed_relative_short_address(dsp56k_core* cpustate, uint16_t srs); static void dsp56k_process_loop(dsp56k_core* cpustate); static void dsp56k_process_rep(dsp56k_core* cpustate, size_t repSize); @@ -218,13 +218,13 @@ static void dsp56k_process_rep(dsp56k_core* cpustate, size_t repSize); /********************/ /* Helper Functions */ /********************/ -static UINT16 Dsp56kOpMask(UINT16 op, UINT16 mask); +static uint16_t Dsp56kOpMask(uint16_t op, uint16_t mask); /* These arguments are written source->destination to fall in line with the processor's paradigm. */ static void SetDestinationValue(typed_pointer source, typed_pointer dest); -static void SetDataMemoryValue(dsp56k_core* cpustate, typed_pointer source, UINT32 destinationAddr); -static void SetProgramMemoryValue(dsp56k_core* cpustate, typed_pointer source, UINT32 destinationAddr); +static void SetDataMemoryValue(dsp56k_core* cpustate, typed_pointer source, uint32_t destinationAddr); +static void SetProgramMemoryValue(dsp56k_core* cpustate, typed_pointer source, uint32_t destinationAddr); @@ -234,10 +234,10 @@ static void SetProgramMemoryValue(dsp56k_core* cpustate, typed_pointer source, U static void execute_one(dsp56k_core* cpustate) { - UINT16 op; - UINT16 op2; + uint16_t op; + uint16_t op2; size_t size = 0x1337; - UINT8 cycle_count = 0; + uint8_t cycle_count = 0; /* For MAME */ cpustate->ppc = PC; @@ -256,7 +256,7 @@ static void execute_one(dsp56k_core* cpustate) typed_pointer d_register = {nullptr, DT_BYTE}; /* Quote: (MOVE, MAC(R), MPY(R), ADD, SUB, TFR) */ - UINT16 op_byte = op & 0x00ff; + uint16_t op_byte = op & 0x00ff; /* ADD : 011m mKKK 0rru Fuuu : A-22 */ /* SUB : 011m mKKK 0rru Fuuu : A-202 */ @@ -309,7 +309,7 @@ static void execute_one(dsp56k_core* cpustate) else if ((op & 0xfe00) == 0x1600) { /* Quote: (MPY or MAC) */ - UINT16 op_byte = op & 0x00ff; + uint16_t op_byte = op & 0x00ff; /* MPY : 0001 0110 RRDD FQQQ : A-160 */ if ((op & 0xff00) == 0x1600) @@ -342,9 +342,9 @@ static void execute_one(dsp56k_core* cpustate) kXMemoryDataMoveWithDisp }; int parallelType = -1; - UINT16 op_byte = 0x0000; + uint16_t op_byte = 0x0000; typed_pointer d_register = {nullptr, DT_BYTE}; - UINT64 prev_accum_value = U64(0x0000000000000000); + uint64_t prev_accum_value = U64(0x0000000000000000); /* Note: it's important that NPDM comes before RtRDM here */ /* No Parallel Data Move : 0100 1010 .... .... : A-131 */ @@ -609,7 +609,7 @@ static void execute_one(dsp56k_core* cpustate) /* Drop out if you've already completed your work. */ if (size != 0x1337) { - PC += (UINT16)size; + PC += (uint16_t)size; dsp56k_process_loop(cpustate); dsp56k_process_rep(cpustate, size); @@ -1094,7 +1094,7 @@ static void execute_one(dsp56k_core* cpustate) } /* Must have been a good opcode */ - PC += (UINT16)size; + PC += (uint16_t)size; dsp56k_process_loop(cpustate); dsp56k_process_rep(cpustate, size); @@ -1115,10 +1115,10 @@ static void execute_one(dsp56k_core* cpustate) /* ADD : 011m mKKK 0rru Fuuu : A-22 */ /* SUB : 011m mKKK 0rru Fuuu : A-202 */ -static size_t dsp56k_op_addsub_2(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles) +static size_t dsp56k_op_addsub_2(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles) { - UINT64 useVal = 0; - UINT8 op_type = OP_OTHER; + uint64_t useVal = 0; + uint8_t op_type = OP_OTHER; typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; @@ -1136,9 +1136,9 @@ static size_t dsp56k_op_addsub_2(dsp56k_core* cpustate, const UINT16 op_byte, ty /* It's a real operation. Get on with it. */ switch(S.data_type) { - case DT_WORD: useVal = (UINT64)*((UINT16*)S.addr) << 16; break; - case DT_DOUBLE_WORD: useVal = (UINT64)*((UINT32*)S.addr); break; - case DT_LONG_WORD: useVal = (UINT64)*((UINT64*)S.addr); break; + case DT_WORD: useVal = (uint64_t)*((uint16_t*)S.addr) << 16; break; + case DT_DOUBLE_WORD: useVal = (uint64_t)*((uint32_t*)S.addr); break; + case DT_LONG_WORD: useVal = (uint64_t)*((uint64_t*)S.addr); break; } /* Sign-extend word for proper add/sub op */ @@ -1147,9 +1147,9 @@ static size_t dsp56k_op_addsub_2(dsp56k_core* cpustate, const UINT16 op_byte, ty /* Operate*/ if (op_type == OP_ADD) - *((UINT64*)D.addr) += useVal; + *((uint64_t*)D.addr) += useVal; else if (op_type == OP_SUB) - *((UINT64*)D.addr) -= useVal; + *((uint64_t*)D.addr) -= useVal; d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1157,21 +1157,21 @@ static size_t dsp56k_op_addsub_2(dsp56k_core* cpustate, const UINT16 op_byte, ty /* S L E U N Z V C */ /* * * * * * * * * */ /* TODO S, L, E, U, V, C */ - if (*((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if (*((UINT64*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; /* TODO: + mv oscillator cycles */ return 1; } /* MAC : 011m mKKK 1xx0 F1QQ : A-122 */ -static size_t dsp56k_op_mac_1(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles) +static size_t dsp56k_op_mac_1(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles) { - INT64 opD = 0; - INT64 result = 0; + int64_t opD = 0; + int64_t result = 0; - INT32 s1 = 0; - INT32 s2 = 0; + int32_t s1 = 0; + int32_t s2 = 0; void* D = nullptr; void* S1 = nullptr; @@ -1180,14 +1180,14 @@ static size_t dsp56k_op_mac_1(dsp56k_core* cpustate, const UINT16 op_byte, typed decode_QQF_table(cpustate, BITS(op_byte,0x0003), BITS(op_byte,0x0008), &S1, &S2, &D); /* Cast both values as being signed */ - s1 = *((INT16*)S1); - s2 = *((INT16*)S2); + s1 = *((int16_t*)S1); + s2 = *((int16_t*)S2); /* Fixed-point 2's complement multiplication requires a shift */ result = (s1 * s2) << 1; /* Sign extend D into a temp variable */ - opD = (*((UINT64*)D)); + opD = (*((uint64_t*)D)); if (opD & U64(0x0000008000000000)) opD |= U64(0xffffff0000000000); else @@ -1199,7 +1199,7 @@ static size_t dsp56k_op_mac_1(dsp56k_core* cpustate, const UINT16 op_byte, typed /* And out the bits that don't live in the register */ opD &= U64(0x000000ffffffffff); - (*((UINT64*)D)) = (UINT64)opD; + (*((uint64_t*)D)) = (uint64_t)opD; /* For the parallel move */ d_register->addr = D; @@ -1208,15 +1208,15 @@ static size_t dsp56k_op_mac_1(dsp56k_core* cpustate, const UINT16 op_byte, typed /* S L E U N Z V C */ /* * * * * * * * - */ /* TODO: S, L, E, V */ - if ( *((UINT64*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; /* TODO: +mv oscillator cycles */ return 1; } /* MACR: 011m mKKK 1--1 F1QQ : A-124 */ -static size_t dsp56k_op_macr_1(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles) +static size_t dsp56k_op_macr_1(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * * - */ @@ -1224,7 +1224,7 @@ static size_t dsp56k_op_macr_1(dsp56k_core* cpustate, const UINT16 op_byte, type } /* MOVE : 011m mKKK 0rr1 0000 : A-128 */ -static size_t dsp56k_op_move_1(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles) +static size_t dsp56k_op_move_1(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - - - - - */ @@ -1232,12 +1232,12 @@ static size_t dsp56k_op_move_1(dsp56k_core* cpustate, const UINT16 op_byte, type } /* MPY : 011m mKKK 1xx0 F0QQ : A-160 */ -static size_t dsp56k_op_mpy_1(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles) +static size_t dsp56k_op_mpy_1(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles) { - INT64 result = 0; + int64_t result = 0; - INT32 s1 = 0; - INT32 s2 = 0; + int32_t s1 = 0; + int32_t s2 = 0; void* D = nullptr; void* S1 = nullptr; @@ -1246,14 +1246,14 @@ static size_t dsp56k_op_mpy_1(dsp56k_core* cpustate, const UINT16 op_byte, typed decode_QQF_table(cpustate, BITS(op_byte,0x0003), BITS(op_byte,0x0008), &S1, &S2, &D); /* Cast both values as being signed */ - s1 = *((INT16*)S1); - s2 = *((INT16*)S2); + s1 = *((int16_t*)S1); + s2 = *((int16_t*)S2); /* Fixed-point 2's complement multiplication requires a shift */ result = (s1 * s2) << 1; /* And out the bits that don't live in the register */ - (*((UINT64*)D)) = result & U64(0x000000ffffffffff); + (*((uint64_t*)D)) = result & U64(0x000000ffffffffff); /* For the parallel move */ d_register->addr = D; @@ -1262,15 +1262,15 @@ static size_t dsp56k_op_mpy_1(dsp56k_core* cpustate, const UINT16 op_byte, typed /* S L E U N Z V C */ /* * * * * * * * - */ /* TODO: S, L, E, V */ - if ( *((UINT64*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; /* TODO: +mv oscillator cycles */ return 1; } /* MPYR : 011m mKKK 1--1 F0QQ : A-162 */ -static size_t dsp56k_op_mpyr_1(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles) +static size_t dsp56k_op_mpyr_1(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * * - */ @@ -1278,7 +1278,7 @@ static size_t dsp56k_op_mpyr_1(dsp56k_core* cpustate, const UINT16 op_byte, type } /* TFR : 011m mKKK 0rr1 F0DD : A-212 */ -static size_t dsp56k_op_tfr_2(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT8* cycles) +static size_t dsp56k_op_tfr_2(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -1286,7 +1286,7 @@ static size_t dsp56k_op_tfr_2(dsp56k_core* cpustate, const UINT16 op_byte, typed } /* MPY : 0001 0110 RRDD FQQQ : A-160 */ -static size_t dsp56k_op_mpy_2(dsp56k_core* cpustate, const UINT16 op_byte, UINT8* cycles) +static size_t dsp56k_op_mpy_2(dsp56k_core* cpustate, const uint16_t op_byte, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * * - */ @@ -1294,7 +1294,7 @@ static size_t dsp56k_op_mpy_2(dsp56k_core* cpustate, const UINT16 op_byte, UINT8 } /* MAC : 0001 0111 RRDD FQQQ : A-122 */ -static size_t dsp56k_op_mac_2(dsp56k_core* cpustate, const UINT16 op_byte, UINT8* cycles) +static size_t dsp56k_op_mac_2(dsp56k_core* cpustate, const uint16_t op_byte, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * * - */ @@ -1302,15 +1302,15 @@ static size_t dsp56k_op_mac_2(dsp56k_core* cpustate, const UINT16 op_byte, UINT8 } /* CLR : .... .... 0000 F001 : A-60 */ -static size_t dsp56k_op_clr(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_clr(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer D = {nullptr, DT_LONG_WORD}; typed_pointer clear = {nullptr, DT_LONG_WORD}; - UINT64 clear_val = U64(0x0000000000000000); + uint64_t clear_val = U64(0x0000000000000000); decode_F_table(cpustate, BITS(op_byte,0x0008), &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); clear.addr = &clear_val; clear.data_type = DT_LONG_WORD; @@ -1333,21 +1333,21 @@ static size_t dsp56k_op_clr(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* ADD : .... .... 0000 FJJJ : A-22 */ -static size_t dsp56k_op_add(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_add(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - UINT64 addVal = 0; + uint64_t addVal = 0; typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; decode_JJJF_table(cpustate, BITS(op_byte,0x0007),BITS(op_byte,0x0008), &S, &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); switch(S.data_type) { - case DT_WORD: addVal = (UINT64)*((UINT16*)S.addr) << 16; break; - case DT_DOUBLE_WORD: addVal = (UINT64)*((UINT32*)S.addr); break; - case DT_LONG_WORD: addVal = (UINT64)*((UINT64*)S.addr); break; + case DT_WORD: addVal = (uint64_t)*((uint16_t*)S.addr) << 16; break; + case DT_DOUBLE_WORD: addVal = (uint64_t)*((uint32_t*)S.addr); break; + case DT_LONG_WORD: addVal = (uint64_t)*((uint64_t*)S.addr); break; } /* Sign-extend word for proper add/sub op */ @@ -1355,7 +1355,7 @@ static size_t dsp56k_op_add(dsp56k_core* cpustate, const UINT16 op_byte, typed_p addVal |= U64(0x000000ff00000000); /* Operate*/ - *((UINT64*)D.addr) += addVal; + *((uint64_t*)D.addr) += addVal; d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1363,15 +1363,15 @@ static size_t dsp56k_op_add(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* S L E U N Z V C */ /* * * * * * * * * */ /* TODO S, L, E, U, V, C */ - if (*((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if (*((UINT64*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; /* TODO: + mv oscillator cycles */ return 1; } /* MOVE : .... .... 0001 0001 : A-128 */ -static size_t dsp56k_op_move(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_move(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* Equivalent to a nop with a parallel move */ /* These can't be used later. Hopefully compilers would pick this up. */ @@ -1387,14 +1387,14 @@ static size_t dsp56k_op_move(dsp56k_core* cpustate, const UINT16 op_byte, typed_ } /* TFR : .... .... 0001 FJJJ : A-212 */ -static size_t dsp56k_op_tfr(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_tfr(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; decode_JJJF_table(cpustate, BITS(op_byte,0x0007),BITS(op_byte,0x0008), &S, &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); SetDestinationValue(S, D); @@ -1409,19 +1409,19 @@ static size_t dsp56k_op_tfr(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* RND : .... .... 0010 F000 : A-188 */ -static size_t dsp56k_op_rnd(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_rnd(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op_byte,0x0008), &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); /* WARNING : ROUNDING NOT FULLY IMPLEMENTED YET! */ - if ((*((UINT64*)D.addr) & U64(0x000000000000ffff)) >= 0x8000) - *((UINT64*)D.addr) += U64(0x0000000000010000); + if ((*((uint64_t*)D.addr) & U64(0x000000000000ffff)) >= 0x8000) + *((uint64_t*)D.addr) += U64(0x0000000000010000); - *((UINT64*)D.addr) = *((UINT64*)D.addr) & U64(0x000000ffffff0000); + *((uint64_t*)D.addr) = *((uint64_t*)D.addr) & U64(0x000000ffffff0000); d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1429,21 +1429,21 @@ static size_t dsp56k_op_rnd(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* S L E U N Z V C */ /* * * * * * * * - */ /* TODO: S, L, E, U, V */ - if ((*((UINT64*)D.addr)) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D.addr)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ((*((uint64_t*)D.addr)) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D.addr)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; /* TODO: + mv oscillator clock cycles */ return 1; } /* TST : .... .... 0010 F001 : A-218 */ -static size_t dsp56k_op_tst(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_tst(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer D = {nullptr, DT_LONG_WORD}; decode_F_table(cpustate, BITS(op_byte,0x0008), &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1451,8 +1451,8 @@ static size_t dsp56k_op_tst(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* S L E U N Z V C */ /* 0 * * * * * 0 0 */ /* TODO: S, L, E, U */ - if ((*((UINT64*)D.addr)) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D.addr)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ((*((uint64_t*)D.addr)) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D.addr)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); DSP56K_V_CLEAR(); DSP56K_C_CLEAR(); @@ -1461,19 +1461,19 @@ static size_t dsp56k_op_tst(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* INC : .... .... 0010 F010 : A-104 */ -static size_t dsp56k_op_inc(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_inc(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op_byte,0x0008), &D); /* Save some data for the parallel move */ - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); /* Make sure the destination is a real 40-bit value */ - *((UINT64*)D.addr) &= U64(0x000000ffffffffff); + *((uint64_t*)D.addr) &= U64(0x000000ffffffffff); /* Increment */ - *((UINT64*)D.addr) = *((UINT64*)D.addr) + 1; + *((uint64_t*)D.addr) = *((uint64_t*)D.addr) + 1; d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1481,34 +1481,34 @@ static size_t dsp56k_op_inc(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* S L E U N Z V C */ /* * * * * * * * * */ /* TODO: S, L, E, U */ - if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR(); + if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR(); cycles += 2; /* TODO: +mv oscillator cycles */ return 1; } /* INC24 : .... .... 0010 F011 : A-106 */ -static size_t dsp56k_op_inc24(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_inc24(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - UINT32 workBits24; + uint32_t workBits24; typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op_byte,0x0008), &D); /* Save some data for the parallel move */ - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); /* TODO: I wonder if workBits24 should be signed? */ - workBits24 = ((*((UINT64*)D.addr)) & U64(0x000000ffffff0000)) >> 16; + workBits24 = ((*((uint64_t*)D.addr)) & U64(0x000000ffffff0000)) >> 16; workBits24++; //workBits24 &= 0x00ffffff; /* Solves -x issues - TODO: huh? */ /* Set the D bits with the dec result */ - *((UINT64*)D.addr) &= U64(0x000000000000ffff); - *((UINT64*)D.addr) |= (((UINT64)(workBits24)) << 16); + *((uint64_t*)D.addr) &= U64(0x000000000000ffff); + *((uint64_t*)D.addr) |= (((uint64_t)(workBits24)) << 16); d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1516,8 +1516,8 @@ static size_t dsp56k_op_inc24(dsp56k_core* cpustate, const UINT16 op_byte, typed /* S L E U N Z V C */ /* * * * * * ? * * */ /* TODO: S, L, E, U */ - if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); if ((workBits24 & 0xff000000) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR(); if ((workBits24 & 0xff000000) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR(); @@ -1526,7 +1526,7 @@ static size_t dsp56k_op_inc24(dsp56k_core* cpustate, const UINT16 op_byte, typed } /* OR : .... .... 0010 F1JJ : A-176 */ -static size_t dsp56k_op_or(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_or(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; @@ -1534,10 +1534,10 @@ static size_t dsp56k_op_or(dsp56k_core* cpustate, const UINT16 op_byte, typed_po decode_JJF_table(cpustate, BITS(op_byte,0x0003), BITS(op_byte,0x0008), &S, &D); /* Save some data for the parallel move */ - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); /* OR a word of S with A1|B1 */ - ((PAIR64*)D.addr)->w.h = *((UINT16*)S.addr) | ((PAIR64*)D.addr)->w.h; + ((PAIR64*)D.addr)->w.h = *((uint16_t*)S.addr) | ((PAIR64*)D.addr)->w.h; d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1545,8 +1545,8 @@ static size_t dsp56k_op_or(dsp56k_core* cpustate, const UINT16 op_byte, typed_po /* S L E U N Z V C */ /* * * - - ? ? 0 - */ /* TODO: S, L */ - if ( *((UINT64*)D.addr) & U64(0x0000000080000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0x00000000ffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D.addr) & U64(0x0000000080000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0x00000000ffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); DSP56K_V_CLEAR(); cycles += 2; /* TODO: + mv oscillator cycles */ @@ -1554,20 +1554,20 @@ static size_t dsp56k_op_or(dsp56k_core* cpustate, const UINT16 op_byte, typed_po } /* ASR : .... .... 0011 F000 : A-32 */ -static size_t dsp56k_op_asr(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_asr(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op_byte,0x0008), &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); - *((UINT64*)D.addr) = (*((UINT64*)D.addr)) >> 1; + *((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) >> 1; /* Make sure the MSB is maintained */ if (*p_accum & U64(0x0000008000000000)) - *((UINT64*)D.addr) |= U64(0x0000008000000000); + *((uint64_t*)D.addr) |= U64(0x0000008000000000); else - *((UINT64*)D.addr) &= (~U64(0x0000008000000000)); + *((uint64_t*)D.addr) &= (~U64(0x0000008000000000)); /* For the parallel move */ d_register->addr = D.addr; @@ -1576,8 +1576,8 @@ static size_t dsp56k_op_asr(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* S L E U N Z V C */ /* * * * * * * 0 ? */ /* TODO: S, L, E, U */ - if (*((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if (*((UINT64*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); DSP56K_V_CLEAR(); if (*p_accum & U64(0x0000000000000001)) DSP56K_C_SET(); else DSP56K_C_CLEAR(); @@ -1586,7 +1586,7 @@ static size_t dsp56k_op_asr(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* ASL : .... .... 0011 F001 : A-28 */ -static size_t dsp56k_op_asl(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_asl(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * ? ? */ @@ -1597,12 +1597,12 @@ static size_t dsp56k_op_asl(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* LSR : .... .... 0011 F010 : A-120 */ -static size_t dsp56k_op_lsr(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_lsr(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op_byte,0x0008), &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); ((PAIR64*)D.addr)->w.h = (((PAIR64*)D.addr)->w.h) >> 1; @@ -1626,7 +1626,7 @@ static size_t dsp56k_op_lsr(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* LSL : .... .... 0011 F011 : A-118 */ -static size_t dsp56k_op_lsl(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_lsl(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - ? ? 0 ? */ @@ -1637,7 +1637,7 @@ static size_t dsp56k_op_lsl(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* EOR : .... .... 0011 F1JJ : A-94 */ -static size_t dsp56k_op_eor(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_eor(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - ? ? 0 - */ @@ -1647,7 +1647,7 @@ static size_t dsp56k_op_eor(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* SUBL : .... .... 0100 F001 : A-204 */ -static size_t dsp56k_op_subl(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_subl(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * ? * */ @@ -1657,9 +1657,9 @@ static size_t dsp56k_op_subl(dsp56k_core* cpustate, const UINT16 op_byte, typed_ } /* SUB : .... .... 0100 FJJJ : A-202 */ -static size_t dsp56k_op_sub(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_sub(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - UINT64 useVal = 0; + uint64_t useVal = 0; typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; @@ -1668,9 +1668,9 @@ static size_t dsp56k_op_sub(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* Get on with it. */ switch(S.data_type) { - case DT_WORD: useVal = (UINT64)*((UINT16*)S.addr) << 16; break; - case DT_DOUBLE_WORD: useVal = (UINT64)*((UINT32*)S.addr); break; - case DT_LONG_WORD: useVal = (UINT64)*((UINT64*)S.addr); break; + case DT_WORD: useVal = (uint64_t)*((uint16_t*)S.addr) << 16; break; + case DT_DOUBLE_WORD: useVal = (uint64_t)*((uint32_t*)S.addr); break; + case DT_LONG_WORD: useVal = (uint64_t)*((uint64_t*)S.addr); break; } /* Sign-extend word for proper sub op */ @@ -1679,10 +1679,10 @@ static size_t dsp56k_op_sub(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* Make sure they're both real 40-bit values */ useVal &= U64(0x000000ffffffffff); - *((UINT64*)D.addr) &= U64(0x000000ffffffffff); + *((uint64_t*)D.addr) &= U64(0x000000ffffffffff); /* Operate*/ - *((UINT64*)D.addr) -= useVal; + *((uint64_t*)D.addr) -= useVal; d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1690,17 +1690,17 @@ static size_t dsp56k_op_sub(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* S L E U N Z V C */ /* * * * * * * * * */ /* TODO S, L, E, U */ - if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ( *((UINT64*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR(); + if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ( *((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR(); cycles += 2; /* TODO: + mv oscillator cycles */ return 1; } /* CLR24 : .... .... 0101 F001 : A-62 */ -static size_t dsp56k_op_clr24(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_clr24(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * ? 0 - */ @@ -1709,7 +1709,7 @@ static size_t dsp56k_op_clr24(dsp56k_core* cpustate, const UINT16 op_byte, typed } /* SBC : .... .... 0101 F01J : A-198 */ -static size_t dsp56k_op_sbc(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_sbc(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * * * */ @@ -1717,23 +1717,23 @@ static size_t dsp56k_op_sbc(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* CMP : .... .... 0101 FJJJ : A-64 */ -static size_t dsp56k_op_cmp(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_cmp(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - UINT64 cmpVal = 0; - UINT64 result = 0; + uint64_t cmpVal = 0; + uint64_t result = 0; typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; decode_JJJF_table(cpustate, BITS(op_byte,0x0007),BITS(op_byte,0x0008), &S, &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); switch(S.data_type) { - case DT_WORD: cmpVal = (UINT64)*((UINT16*)S.addr) << 16; break; - case DT_DOUBLE_WORD: cmpVal = (UINT64)*((UINT32*)S.addr); break; - case DT_LONG_WORD: cmpVal = (UINT64)*((UINT64*)S.addr); break; + case DT_WORD: cmpVal = (uint64_t)*((uint16_t*)S.addr) << 16; break; + case DT_DOUBLE_WORD: cmpVal = (uint64_t)*((uint32_t*)S.addr); break; + case DT_LONG_WORD: cmpVal = (uint64_t)*((uint64_t*)S.addr); break; } /* Sign-extend word for proper subtraction op */ @@ -1742,10 +1742,10 @@ static size_t dsp56k_op_cmp(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* Make sure they're both real 40-bit values */ cmpVal &= U64(0x000000ffffffffff); - *((UINT64*)D.addr) &= U64(0x000000ffffffffff); + *((uint64_t*)D.addr) &= U64(0x000000ffffffffff); /* Operate */ - result = *((UINT64*)D.addr) - cmpVal; + result = *((uint64_t*)D.addr) - cmpVal; d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1764,7 +1764,7 @@ static size_t dsp56k_op_cmp(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* NEG : .... .... 0110 F000 : A-166 */ -static size_t dsp56k_op_neg(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_neg(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * * * */ @@ -1772,12 +1772,12 @@ static size_t dsp56k_op_neg(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* NOT : .... .... 0110 F001 : A-174 */ -static size_t dsp56k_op_not(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_not(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op_byte,0x0008), &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); /* Invert bits [16:31] of D */ ((PAIR64*)D.addr)->w.h = ~(((PAIR64*)D.addr)->w.h); @@ -1788,8 +1788,8 @@ static size_t dsp56k_op_not(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* S L E U N Z V C */ /* * * - - ? ? 0 - */ /* TODO: S?, L */ - if ( *((UINT64*)D.addr) & U64(0x0000000080000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0x00000000ffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D.addr) & U64(0x0000000080000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0x00000000ffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); DSP56K_V_CLEAR(); cycles += 2; /* TODO: + mv oscillator cycles */ @@ -1797,7 +1797,7 @@ static size_t dsp56k_op_not(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* DEC : .... .... 0110 F010 : A-72 */ -static size_t dsp56k_op_dec(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_dec(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * * * */ @@ -1805,24 +1805,24 @@ static size_t dsp56k_op_dec(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* DEC24 : .... .... 0110 F011 : A-74 */ -static size_t dsp56k_op_dec24(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_dec24(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - UINT32 workBits24; + uint32_t workBits24; typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op_byte,0x0008), &D); /* Save some data for the parallel move */ - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); /* TODO: I wonder if workBits24 should be signed? */ - workBits24 = ((*((UINT64*)D.addr)) & U64(0x000000ffffff0000)) >> 16; + workBits24 = ((*((uint64_t*)D.addr)) & U64(0x000000ffffff0000)) >> 16; workBits24--; workBits24 &= 0x00ffffff; /* Solves -x issues */ /* Set the D bits with the dec result */ - *((UINT64*)D.addr) &= U64(0x000000000000ffff); - *((UINT64*)D.addr) |= (((UINT64)(workBits24)) << 16); + *((uint64_t*)D.addr) &= U64(0x000000000000ffff); + *((uint64_t*)D.addr) |= (((uint64_t)(workBits24)) << 16); d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1830,15 +1830,15 @@ static size_t dsp56k_op_dec24(dsp56k_core* cpustate, const UINT16 op_byte, typed /* S L E U N Z V C */ /* * * * * * ? * * */ /* TODO: S, L, E, U, V, C */ - if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; /* TODO: + mv oscillator clock cycles */ return 1; } /* AND : .... .... 0110 F1JJ : A-24 */ -static size_t dsp56k_op_and(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_and(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; @@ -1846,10 +1846,10 @@ static size_t dsp56k_op_and(dsp56k_core* cpustate, const UINT16 op_byte, typed_p decode_JJF_table(cpustate, BITS(op_byte,0x0003), BITS(op_byte,0x0008), &S, &D); /* Save some data for the parallel move */ - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); /* AND a word of S with A1|B1 */ - ((PAIR64*)D.addr)->w.h = *((UINT16*)S.addr) & ((PAIR64*)D.addr)->w.h; + ((PAIR64*)D.addr)->w.h = *((uint16_t*)S.addr) & ((PAIR64*)D.addr)->w.h; d_register->addr = D.addr; d_register->data_type = D.data_type; @@ -1857,8 +1857,8 @@ static size_t dsp56k_op_and(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* S L E U N Z V C */ /* * * - - ? ? 0 - */ /* TODO: S, L */ - if ( *((UINT64*)D.addr) & U64(0x0000000080000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0x00000000ffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D.addr) & U64(0x0000000080000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0x00000000ffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); DSP56K_V_CLEAR(); cycles += 2; /* TODO: + mv oscillator cycles */ @@ -1866,14 +1866,14 @@ static size_t dsp56k_op_and(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* ABS : .... .... 0111 F001 : A-18 */ -static size_t dsp56k_op_abs(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_abs(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - INT64 opD = 0; + int64_t opD = 0; typed_pointer D = {nullptr, DT_LONG_WORD}; decode_F_table(cpustate, BITS(op_byte,0x0008), &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); /* Sign extend D into a temp variable */ opD = *p_accum; @@ -1887,17 +1887,17 @@ static size_t dsp56k_op_abs(dsp56k_core* cpustate, const UINT16 op_byte, typed_p opD &= U64(0x000000ffffffffff); /* Reassign */ - *((UINT64*)D.addr) = opD; + *((uint64_t*)D.addr) = opD; /* Special overflow case */ if ((*p_accum) == U64(0x0000008000000000)) - *((UINT64*)D.addr) = U64(0x0000007fffffffff); + *((uint64_t*)D.addr) = U64(0x0000007fffffffff); /* S L E U N Z V C */ /* * * * * * * * - */ /* TODO: S, L, E, U */ - if ( *((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D.addr) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D.addr) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); if ((*p_accum) == U64(0x0000008000000000)) DSP56K_V_SET(); else DSP56K_V_CLEAR(); cycles += 2; /* TODO: + mv oscillator clock cycles */ @@ -1905,7 +1905,7 @@ static size_t dsp56k_op_abs(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* ROR : .... .... 0111 F010 : A-192 */ -static size_t dsp56k_op_ror(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_ror(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - ? ? 0 ? */ @@ -1916,7 +1916,7 @@ static size_t dsp56k_op_ror(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* ROL : .... .... 0111 F011 : A-190 */ -static size_t dsp56k_op_rol(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_rol(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - ? ? 0 ? */ @@ -1927,29 +1927,29 @@ static size_t dsp56k_op_rol(dsp56k_core* cpustate, const UINT16 op_byte, typed_p } /* CMPM : .... .... 0111 FJJJ : A-66 */ -static size_t dsp56k_op_cmpm(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_cmpm(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - INT64 absS; - INT64 absD; - INT64 absResult; + int64_t absS; + int64_t absD; + int64_t absResult; typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; decode_JJJF_table(cpustate, BITS(op_byte,0x0007),BITS(op_byte,0x0008), &S, &D); - *p_accum = *((UINT64*)D.addr); + *p_accum = *((uint64_t*)D.addr); /* Sign extend and get absolute value of the source */ if (S.addr == &A || S.addr == &B) { - absS = *((UINT64*)S.addr); + absS = *((uint64_t*)S.addr); if (absS & U64(0x0000008000000000)) absS |= U64(0xffffff8000000000); } else { - absS = (*((UINT16*)S.addr)) << 16; + absS = (*((uint16_t*)S.addr)) << 16; if (absS & U64(0x0000000080000000)) absS |= U64(0xffffffff80000000); } @@ -1958,13 +1958,13 @@ static size_t dsp56k_op_cmpm(dsp56k_core* cpustate, const UINT16 op_byte, typed_ /* Sign extend and get absolute value of the destination */ if (D.addr == &A || D.addr == &B) { - absD = *((UINT64*)D.addr); + absD = *((uint64_t*)D.addr); if (absD & U64(0x0000008000000000)) absD |= U64(0xffffff8000000000); } else { - absD = (*((UINT16*)D.addr)) << 16; + absD = (*((uint16_t*)D.addr)) << 16; if (absS & U64(0x0000000080000000)) absS |= U64(0xffffffff80000000); } @@ -1989,13 +1989,13 @@ static size_t dsp56k_op_cmpm(dsp56k_core* cpustate, const UINT16 op_byte, typed_ } /* MPY : .... .... 1k00 FQQQ : A-160 -- CONFIRMED TYPO IN DOCS (HHHH vs HHHW) */ -static size_t dsp56k_op_mpy(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_mpy(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - UINT16 k = 0; - INT64 result = 0; + uint16_t k = 0; + int64_t result = 0; - INT32 s1 = 0; - INT32 s2 = 0; + int32_t s1 = 0; + int32_t s2 = 0; void* D = nullptr; void* S1 = nullptr; @@ -2006,8 +2006,8 @@ static size_t dsp56k_op_mpy(dsp56k_core* cpustate, const UINT16 op_byte, typed_p k = BITS(op_byte,0x0040); /* Cast both values as being signed */ - s1 = *((INT16*)S1); - s2 = *((INT16*)S2); + s1 = *((int16_t*)S1); + s2 = *((int16_t*)S2); /* Fixed-point 2's complement multiplication requires a shift */ result = (s1 * s2) << 1; @@ -2016,20 +2016,20 @@ static size_t dsp56k_op_mpy(dsp56k_core* cpustate, const UINT16 op_byte, typed_p if (k) result *= -1; - (*((UINT64*)D)) = result & U64(0x000000ffffffffff); + (*((uint64_t*)D)) = result & U64(0x000000ffffffffff); /* S L E U N Z V C */ /* * * * * * * * - */ /* TODO: S, L, E, V */ - if ( *((UINT64*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; /* TODO: +mv oscillator cycles */ return 1; } /* MPYR : .... .... 1k01 FQQQ : A-162 */ -static size_t dsp56k_op_mpyr(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_mpyr(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { /* S L E U N Z V C */ /* * * * * * * * - */ @@ -2037,14 +2037,14 @@ static size_t dsp56k_op_mpyr(dsp56k_core* cpustate, const UINT16 op_byte, typed_ } /* MAC : .... .... 1k10 FQQQ : A-122 */ -static size_t dsp56k_op_mac(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_mac(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - UINT16 k = 0; - INT64 opD = 0; - INT64 result = 0; + uint16_t k = 0; + int64_t opD = 0; + int64_t result = 0; - INT32 s1 = 0; - INT32 s2 = 0; + int32_t s1 = 0; + int32_t s2 = 0; void* D = nullptr; void* S1 = nullptr; @@ -2055,14 +2055,14 @@ static size_t dsp56k_op_mac(dsp56k_core* cpustate, const UINT16 op_byte, typed_p k = BITS(op_byte,0x0040); /* Cast both values as being signed */ - s1 = *((INT16*)S1); - s2 = *((INT16*)S2); + s1 = *((int16_t*)S1); + s2 = *((int16_t*)S2); /* Fixed-point 2's complement multiplication requires a shift */ result = (s1 * s2) << 1; /* Sign extend D into a temp variable */ - opD = (*((UINT64*)D)); + opD = (*((uint64_t*)D)); if (opD & U64(0x0000008000000000)) opD |= U64(0xffffff0000000000); else @@ -2078,7 +2078,7 @@ static size_t dsp56k_op_mac(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* And out the bits that don't live in the register */ opD &= U64(0x000000ffffffffff); - (*((UINT64*)D)) = (UINT64)opD; + (*((uint64_t*)D)) = (uint64_t)opD; /* For the parallel move */ d_register->addr = D; @@ -2087,22 +2087,22 @@ static size_t dsp56k_op_mac(dsp56k_core* cpustate, const UINT16 op_byte, typed_p /* S L E U N Z V C */ /* * * * * * * * - */ /* TODO: S, L, E, V */ - if ( *((UINT64*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; /* TODO: +mv oscillator cycles */ return 1; } /* MACR : .... .... 1k11 FQQQ : A-124 -- DRAMA - rr vs xx (805) */ -static size_t dsp56k_op_macr(dsp56k_core* cpustate, const UINT16 op_byte, typed_pointer* d_register, UINT64* p_accum, UINT8* cycles) +static size_t dsp56k_op_macr(dsp56k_core* cpustate, const uint16_t op_byte, typed_pointer* d_register, uint64_t* p_accum, uint8_t* cycles) { - UINT16 k = 0; - INT64 opD = 0; - INT64 result = 0; + uint16_t k = 0; + int64_t opD = 0; + int64_t result = 0; - INT32 s1 = 0; - INT32 s2 = 0; + int32_t s1 = 0; + int32_t s2 = 0; void* D = nullptr; void* S1 = nullptr; @@ -2113,14 +2113,14 @@ static size_t dsp56k_op_macr(dsp56k_core* cpustate, const UINT16 op_byte, typed_ k = BITS(op_byte,0x0040); /* Cast both values as being signed */ - s1 = *((INT16*)S1); - s2 = *((INT16*)S2); + s1 = *((int16_t*)S1); + s2 = *((int16_t*)S2); /* Fixed-point 2's complement multiplication requires a shift */ result = (s1 * s2) << 1; /* Sign extend D into a temp variable */ - opD = (*((UINT64*)D)); + opD = (*((uint64_t*)D)); if (opD & U64(0x0000008000000000)) opD |= U64(0xffffff0000000000); else @@ -2144,7 +2144,7 @@ static size_t dsp56k_op_macr(dsp56k_core* cpustate, const UINT16 op_byte, typed_ opD &= U64(0x000000ffffffffff); /* Store the result */ - (*((UINT64*)D)) = (UINT64)opD; + (*((uint64_t*)D)) = (uint64_t)opD; /* For the parallel move */ d_register->addr = D; @@ -2153,8 +2153,8 @@ static size_t dsp56k_op_macr(dsp56k_core* cpustate, const UINT16 op_byte, typed_ /* S L E U N Z V C */ /* * * * * * * * - */ /* TODO: S, L, E, V */ - if ( *((UINT64*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; /* TODO: +mv oscillator cycles */ return 1; @@ -2166,7 +2166,7 @@ static size_t dsp56k_op_macr(dsp56k_core* cpustate, const UINT16 op_byte, typed_ /******************************/ /* ADC : 0001 0101 0000 F01J : A-20 */ -static size_t dsp56k_op_adc(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_adc(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - * * * * * * * */ @@ -2174,9 +2174,9 @@ static size_t dsp56k_op_adc(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* ANDI : 0001 1EE0 iiii iiii : A-26 */ -static size_t dsp56k_op_andi(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_andi(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT16 immediate = BITS(op,0x00ff); + uint16_t immediate = BITS(op,0x00ff); /* There is not currently a good way to refer to CCR or MR. Explicitly decode here. */ switch(BITS(op,0x0600)) @@ -2190,7 +2190,7 @@ static size_t dsp56k_op_andi(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl break; case 0x03: /* OMR */ - OMR &= (UINT8)(immediate); + OMR &= (uint8_t)(immediate); break; default: @@ -2206,16 +2206,16 @@ static size_t dsp56k_op_andi(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* ASL4 : 0001 0101 0011 F001 : A-30 */ -static size_t dsp56k_op_asl4(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_asl4(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT64 p_accum = 0; + uint64_t p_accum = 0; typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op,0x0008), &D); - p_accum = *((UINT64*)D.addr); + p_accum = *((uint64_t*)D.addr); - *((UINT64*)D.addr) = (*((UINT64*)D.addr)) << 4; - *((UINT64*)D.addr) = (*((UINT64*)D.addr)) & U64(0x000000ffffffffff); + *((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) << 4; + *((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) & U64(0x000000ffffffffff); /* S L E U N Z V C */ /* - ? * * * * ? ? */ @@ -2223,9 +2223,9 @@ static size_t dsp56k_op_asl4(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl /* V - Set if an arithmetic overflow occurs in the 40 bit result. Also set if bit 35 through 39 are not the same. */ /* C - Set if bit 36 of source operand is set. Cleared otherwise. */ - if (*((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if (*((UINT64*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); - if ( (*((UINT64*)D.addr) & U64(0x000000ff00000000)) != (p_accum & U64(0x000000ff00000000)) ) DSP56K_V_SET(); else DSP56K_V_CLEAR(); + if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( (*((uint64_t*)D.addr) & U64(0x000000ff00000000)) != (p_accum & U64(0x000000ff00000000)) ) DSP56K_V_SET(); else DSP56K_V_CLEAR(); if (p_accum & U64(0x0000001000000000)) DSP56K_C_SET(); else DSP56K_C_CLEAR(); cycles += 2; @@ -2233,29 +2233,29 @@ static size_t dsp56k_op_asl4(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* ASR4 : 0001 0101 0011 F000 : A-34 */ -static size_t dsp56k_op_asr4(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_asr4(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT64 p_accum = 0; + uint64_t p_accum = 0; typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op,0x0008), &D); - p_accum = *((UINT64*)D.addr); + p_accum = *((uint64_t*)D.addr); - *((UINT64*)D.addr) = (*((UINT64*)D.addr)) >> 4; - *((UINT64*)D.addr) = (*((UINT64*)D.addr)) & U64(0x000000ffffffffff); + *((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) >> 4; + *((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) & U64(0x000000ffffffffff); /* The top 4 bits become the old bit 39 */ if (p_accum & U64(0x0000008000000000)) - *((UINT64*)D.addr) |= U64(0x000000f000000000); + *((uint64_t*)D.addr) |= U64(0x000000f000000000); else - *((UINT64*)D.addr) &= (~U64(0x000000f000000000)); + *((uint64_t*)D.addr) &= (~U64(0x000000f000000000)); /* S L E U N Z V C */ /* - * * * * * 0 ? */ /* TODO: E, U */ /* C - Set if bit 3 of source operand is set. Cleared otherwise. */ - if (*((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if (*((UINT64*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); DSP56K_V_CLEAR(); if (p_accum & U64(0x0000000000000008)) DSP56K_C_SET(); else DSP56K_C_CLEAR(); @@ -2264,27 +2264,27 @@ static size_t dsp56k_op_asr4(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* ASR16 : 0001 0101 0111 F000 : A-36 */ -static size_t dsp56k_op_asr16(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_asr16(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT64 backupVal; + uint64_t backupVal; typed_pointer D = {nullptr, DT_BYTE}; decode_F_table(cpustate, BITS(op,0x0008), &D); - backupVal = *((UINT64*)D.addr); + backupVal = *((uint64_t*)D.addr); - *((UINT64*)D.addr) = *((UINT64*)D.addr) >> 16; + *((uint64_t*)D.addr) = *((uint64_t*)D.addr) >> 16; if(backupVal & U64(0x0000008000000000)) - *((UINT64*)D.addr) |= U64(0x000000ffff000000); + *((uint64_t*)D.addr) |= U64(0x000000ffff000000); else - *((UINT64*)D.addr) &= U64(0x0000000000ffffff); + *((uint64_t*)D.addr) &= U64(0x0000000000ffffff); /* S L E U N Z V C */ /* - * * * * * 0 ? */ /* TODO: E, U */ - if (*((UINT64*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if (*((UINT64*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); DSP56K_V_CLEAR(); if (backupVal & U64(0x0000000000008000)) DSP56K_C_SET(); else DSP56K_C_CLEAR(); @@ -2297,14 +2297,14 @@ static size_t dsp56k_op_asr16(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc /* BFSET : 0001 0100 11Pp pppp BBB1 1000 iiii iiii : A-42 */ /* BFTSTH : 0001 0100 01Pp pppp BBB1 0000 iiii iiii : A-44 */ /* BFTSTL : 0001 0100 01Pp pppp BBB0 0000 iiii iiii : A-46 */ -static size_t dsp56k_op_bfop(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_bfop(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { - UINT16 workAddr = 0x0000; - UINT16 workingWord = 0x0000; - UINT16 previousValue = 0x0000; + uint16_t workAddr = 0x0000; + uint16_t workingWord = 0x0000; + uint16_t previousValue = 0x0000; typed_pointer tempTP = { nullptr, DT_BYTE }; - UINT16 iVal = op2 & 0x00ff; + uint16_t iVal = op2 & 0x00ff; decode_BBB_bitmask(cpustate, BITS(op2,0xe000), &iVal); workAddr = assemble_address_from_Pppppp_table(cpustate, BITS(op,0x0020), BITS(op,0x001f)); @@ -2360,20 +2360,20 @@ static size_t dsp56k_op_bfop(dsp56k_core* cpustate, const UINT16 op, const UINT1 /* BFSET : 0001 0100 101- --RR BBB1 1000 iiii iiii : A-42 */ /* BFTSTH : 0001 0100 001- --RR BBB1 0000 iiii iiii : A-44 */ /* BFTSTL : 0001 0100 001- --RR BBB0 0000 iiii iiii : A-46 */ -static size_t dsp56k_op_bfop_1(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_bfop_1(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { - UINT16 workAddr = 0x0000; - UINT16 workingWord = 0x0000; - UINT16 previousValue = 0x0000; + uint16_t workAddr = 0x0000; + uint16_t workingWord = 0x0000; + uint16_t previousValue = 0x0000; typed_pointer R = { nullptr, DT_BYTE }; typed_pointer tempTP = { nullptr, DT_BYTE }; - UINT16 iVal = op2 & 0x00ff; + uint16_t iVal = op2 & 0x00ff; decode_BBB_bitmask(cpustate, BITS(op2,0xe000), &iVal); decode_RR_table(cpustate, BITS(op,0x0003), &R); - workAddr = *((UINT16*)R.addr); + workAddr = *((uint16_t*)R.addr); previousValue = cpustate->data->read_word(ADDRESS(workAddr)); workingWord = previousValue; @@ -2426,12 +2426,12 @@ static size_t dsp56k_op_bfop_1(dsp56k_core* cpustate, const UINT16 op, const UIN /* BFSET : 0001 0100 100D DDDD BBB1 1000 iiii iiii : A-42 */ /* BFTSTH : 0001 0100 000D DDDD BBB1 0000 iiii iiii : A-44 */ /* BFTSTL : 0001 0100 000D DDDD BBB0 0000 iiii iiii : A-46 */ -static size_t dsp56k_op_bfop_2(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_bfop_2(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { - UINT16 workingWord = 0x0000; - UINT16 previousValue = 0x0000; + uint16_t workingWord = 0x0000; + uint16_t previousValue = 0x0000; - UINT16 iVal = op2 & 0x00ff; + uint16_t iVal = op2 & 0x00ff; typed_pointer S = { nullptr, DT_BYTE }; decode_BBB_bitmask(cpustate, BITS(op2,0xe000), &iVal); @@ -2441,7 +2441,7 @@ static size_t dsp56k_op_bfop_2(dsp56k_core* cpustate, const UINT16 op, const UIN if (S.data_type == DT_LONG_WORD) previousValue = ((PAIR64*)S.addr)->w.h; else - previousValue = *((UINT16*)S.addr); + previousValue = *((uint16_t*)S.addr); workingWord = previousValue; @@ -2468,7 +2468,7 @@ static size_t dsp56k_op_bfop_2(dsp56k_core* cpustate, const UINT16 op, const UIN if (S.data_type == DT_LONG_WORD) ((PAIR64*)S.addr)->w.h = workingWord; else - *((UINT16*)S.addr) = workingWord; + *((uint16_t*)S.addr) = workingWord; /* S L E U N Z V C */ /* - * - - - - - ? */ @@ -2492,13 +2492,13 @@ static size_t dsp56k_op_bfop_2(dsp56k_core* cpustate, const UINT16 op, const UIN } /* Bcc : 0000 0111 --11 cccc xxxx xxxx xxxx xxxx : A-48 */ -static size_t dsp56k_op_bcc(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_bcc(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { int shouldBranch = decode_cccc_table(cpustate, BITS(op,0x000f)); if (shouldBranch) { - INT16 offset = (INT16)op2; + int16_t offset = (int16_t)op2; PC += offset + 2; @@ -2517,13 +2517,13 @@ static size_t dsp56k_op_bcc(dsp56k_core* cpustate, const UINT16 op, const UINT16 } /* Bcc : 0010 11cc ccee eeee : A-48 */ -static size_t dsp56k_op_bcc_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_bcc_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { int shouldBranch = decode_cccc_table(cpustate, BITS(op,0x03c0)); if (shouldBranch) { - INT16 offset = (INT16)assemble_address_from_6bit_signed_relative_short_address(cpustate, BITS(op,0x003f)); + int16_t offset = (int16_t)assemble_address_from_6bit_signed_relative_short_address(cpustate, BITS(op,0x003f)); PC += offset + 1; @@ -2542,7 +2542,7 @@ static size_t dsp56k_op_bcc_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* Bcc : 0000 0111 RR10 cccc : A-48 */ -static size_t dsp56k_op_bcc_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_bcc_2(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2550,7 +2550,7 @@ static size_t dsp56k_op_bcc_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* BRA : 0000 0001 0011 11-- xxxx xxxx xxxx xxxx : A-50 */ -static size_t dsp56k_op_bra(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_bra(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2558,10 +2558,10 @@ static size_t dsp56k_op_bra(dsp56k_core* cpustate, const UINT16 op, const UINT16 } /* BRA : 0000 1011 aaaa aaaa : A-50 */ -static size_t dsp56k_op_bra_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_bra_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* 8 bit immediate, relative offset */ - INT8 branchOffset = (INT8)BITS(op,0x00ff); + int8_t branchOffset = (int8_t)BITS(op,0x00ff); /* "The PC Contains the address of the next instruction" */ PC += 1; @@ -2576,7 +2576,7 @@ static size_t dsp56k_op_bra_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* BRA : 0000 0001 0010 11RR : A-50 */ -static size_t dsp56k_op_bra_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_bra_2(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2584,7 +2584,7 @@ static size_t dsp56k_op_bra_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* BRKcc : 0000 0001 0001 cccc : A-52 */ -static size_t dsp56k_op_brkcc(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_brkcc(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { int shouldBreak = decode_cccc_table(cpustate, BITS(op,0x000f)); @@ -2615,7 +2615,7 @@ static size_t dsp56k_op_brkcc(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* BScc : 0000 0111 --01 cccc xxxx xxxx xxxx xxxx : A-54 */ -static size_t dsp56k_op_bscc(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_bscc(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { int shouldBranch = decode_cccc_table(cpustate, BITS(op,0x000f)); @@ -2630,7 +2630,7 @@ static size_t dsp56k_op_bscc(dsp56k_core* cpustate, const UINT16 op, const UINT1 SSL = SR; /* Change */ - PC = PC + (INT16)op2; + PC = PC + (int16_t)op2; /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2645,7 +2645,7 @@ static size_t dsp56k_op_bscc(dsp56k_core* cpustate, const UINT16 op, const UINT1 } /* BScc : 0000 0111 RR00 cccc : A-54 */ -static size_t dsp56k_op_bscc_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_bscc_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2653,7 +2653,7 @@ static size_t dsp56k_op_bscc_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cy } /* BSR : 0000 0001 0011 10-- xxxx xxxx xxxx xxxx : A-56 */ -static size_t dsp56k_op_bsr(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_bsr(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { /* The PC Contains the address of the next instruction */ PC += 2; @@ -2664,7 +2664,7 @@ static size_t dsp56k_op_bsr(dsp56k_core* cpustate, const UINT16 op, const UINT16 SSL = SR; /* Change */ - PC = PC + (INT16)op2; + PC = PC + (int16_t)op2; /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2673,7 +2673,7 @@ static size_t dsp56k_op_bsr(dsp56k_core* cpustate, const UINT16 op, const UINT16 } /* BSR : 0000 0001 0010 10RR : A-56 */ -static size_t dsp56k_op_bsr_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_bsr_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2681,7 +2681,7 @@ static size_t dsp56k_op_bsr_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* CHKAAU : 0000 0000 0000 0100 : A-58 */ -static size_t dsp56k_op_chkaau(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_chkaau(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - ? ? ? - */ @@ -2695,7 +2695,7 @@ static size_t dsp56k_op_chkaau(dsp56k_core* cpustate, const UINT16 op, UINT8* cy } /* DEBUG : 0000 0000 0000 0001 : A-68 */ -static size_t dsp56k_op_debug(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_debug(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2703,7 +2703,7 @@ static size_t dsp56k_op_debug(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* DEBUGcc : 0000 0000 0101 cccc : A-70 */ -static size_t dsp56k_op_debugcc(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_debugcc(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2712,7 +2712,7 @@ static size_t dsp56k_op_debugcc(dsp56k_core* cpustate, const UINT16 op, UINT8* c /* DIV : 0001 0101 0--0 F1DD : A-76 */ /* WARNING : DOCS SAY THERE IS A PARALLEL MOVE HERE !!! */ -static size_t dsp56k_op_div(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_div(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* WARNING : THIS DOES NOT WORK. IT DOESN'T EVEN TRY !!! */ typed_pointer S = {nullptr, DT_BYTE}; @@ -2730,10 +2730,10 @@ static size_t dsp56k_op_div(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* DMAC : 0001 0101 10s1 FsQQ : A-80 */ -static size_t dsp56k_op_dmac(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_dmac(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT8 ss = 0; - INT64 result = 0; + uint8_t ss = 0; + int64_t result = 0; void* D = nullptr; void* S1 = nullptr; @@ -2747,42 +2747,42 @@ static size_t dsp56k_op_dmac(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl if (ss == 0x00 || ss == 0x01) { /* Signed * Signed */ - INT32 s1 = ((INT32)(*((UINT16*)S1))); - INT32 s2 = ((INT32)(*((UINT16*)S2))); + int32_t s1 = ((int32_t)(*((uint16_t*)S1))); + int32_t s2 = ((int32_t)(*((uint16_t*)S2))); result = ( s1 * s2 ) << 1; } else if (ss == 0x2) { /* Signed * Unsigned */ /* WARNING : THERE IS A HUGE CHANCE THIS DOESN'T WORK RIGHT */ - INT32 s1 = ((INT32)(*((UINT16*)S1))); - INT32 s2 = (UINT32)(*((UINT16*)S2)); + int32_t s1 = ((int32_t)(*((uint16_t*)S1))); + int32_t s2 = (uint32_t)(*((uint16_t*)S2)); result = ( s1 * s2 ) << 1; } else if (ss == 0x3) { /* Unsigned * Unsigned */ - UINT32 s1 = (UINT32)(*((UINT16*)S1)); - UINT32 s2 = (UINT32)(*((UINT16*)S2)); + uint32_t s1 = (uint32_t)(*((uint16_t*)S1)); + uint32_t s2 = (uint32_t)(*((uint16_t*)S2)); result = ( s1 * s2 ) << 1; } /* Shift right, then accumulate */ - (*((UINT64*)D)) = (*((UINT64*)D)) >> 16; - (*((UINT64*)D)) += result; + (*((uint64_t*)D)) = (*((uint64_t*)D)) >> 16; + (*((uint64_t*)D)) += result; /* S L E U N Z V C */ /* - * * * * * * - */ /* TODO: L, E, U, V */ - if ( *((UINT64*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; return 1; } /* DO : 0000 0000 110- --RR xxxx xxxx xxxx xxxx : A-82 */ -static size_t dsp56k_op_do(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_do(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { /* S L E U N Z V C */ /* - * - - - - - - */ @@ -2790,10 +2790,10 @@ static size_t dsp56k_op_do(dsp56k_core* cpustate, const UINT16 op, const UINT16 } /* DO : 0000 1110 iiii iiii xxxx xxxx xxxx xxxx : A-82 */ -static size_t dsp56k_op_do_1(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_do_1(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { - UINT8 retSize = 0; - UINT8 iValue = BITS(op,0x00ff); + uint8_t retSize = 0; + uint8_t iValue = BITS(op,0x00ff); /* Don't execute if the loop counter == 0 */ if (iValue != 0x00) @@ -2802,7 +2802,7 @@ static size_t dsp56k_op_do_1(dsp56k_core* cpustate, const UINT16 op, const UINT1 SP++; /* TODO: Should i really inc here first? */ SSH = LA; SSL = LC; - LC = (UINT16)iValue; + LC = (uint16_t)iValue; /* Second instruction cycle */ @@ -2839,18 +2839,18 @@ static size_t dsp56k_op_do_1(dsp56k_core* cpustate, const UINT16 op, const UINT1 } /* DO : 0000 0100 000D DDDD xxxx xxxx xxxx xxxx : A-82 */ -static size_t dsp56k_op_do_2(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_do_2(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { - UINT8 retSize = 0; - UINT16 lValue = 0x0000; + uint8_t retSize = 0; + uint16_t lValue = 0x0000; typed_pointer S = {nullptr, DT_BYTE}; decode_DDDDD_table(cpustate, BITS(op,0x001f), &S); /* TODO: Does not properly shift-limit sources A&B - Fix per the docs. */ /* TODO: There are other cases besides A&B this code won't work. */ - if (S.addr == &A) lValue = *((UINT16*)(&A1)); - else if (S.addr == &B) lValue = *((UINT16*)(&B1)); - else lValue = *((UINT16*)S.addr); + if (S.addr == &A) lValue = *((uint16_t*)(&A1)); + else if (S.addr == &B) lValue = *((uint16_t*)(&B1)); + else lValue = *((uint16_t*)S.addr); /* HACK */ if (lValue >= 0xfff0) @@ -2874,7 +2874,7 @@ static size_t dsp56k_op_do_2(dsp56k_core* cpustate, const UINT16 op, const UINT1 SP++; /* TODO: Should i really inc here first? */ SSH = LA; SSL = LC; - LC = (UINT16)lValue; + LC = (uint16_t)lValue; /* Second instruction cycle */ @@ -2908,7 +2908,7 @@ static size_t dsp56k_op_do_2(dsp56k_core* cpustate, const UINT16 op, const UINT1 } /* DO FOREVER : 0000 0000 0000 0010 xxxx xxxx xxxx xxxx : A-88 */ -static size_t dsp56k_op_doforever(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_doforever(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { /* First instruction cycle */ SP++; @@ -2932,7 +2932,7 @@ static size_t dsp56k_op_doforever(dsp56k_core* cpustate, const UINT16 op, const } /* ENDDO : 0000 0000 0000 1001 : A-92 */ -static size_t dsp56k_op_enddo(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_enddo(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2940,7 +2940,7 @@ static size_t dsp56k_op_enddo(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* EXT : 0001 0101 0101 F010 : A-96 */ -static size_t dsp56k_op_ext(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_ext(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - * * * * * * - */ @@ -2948,7 +2948,7 @@ static size_t dsp56k_op_ext(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* ILLEGAL : 0000 0000 0000 1111 : A-98 */ -static size_t dsp56k_op_illegal(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_illegal(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -2956,13 +2956,13 @@ static size_t dsp56k_op_illegal(dsp56k_core* cpustate, const UINT16 op, UINT8* c } /* IMAC : 0001 0101 1010 FQQQ : A-100 */ -static size_t dsp56k_op_imac(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_imac(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - INT64 opD = 0; - INT64 result = 0; + int64_t opD = 0; + int64_t result = 0; - INT32 s1 = 0; - INT32 s2 = 0; + int32_t s1 = 0; + int32_t s2 = 0; void* D = nullptr; void* S1 = nullptr; @@ -2971,8 +2971,8 @@ static size_t dsp56k_op_imac(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl decode_QQQF_table(cpustate, BITS(op,0x0007), BITS(op,0x0008), &S1, &S2, &D); /* Cast both values as being signed */ - s1 = *((INT16*)S1); - s2 = *((INT16*)S2); + s1 = *((int16_t*)S1); + s2 = *((int16_t*)S2); /* Integral multiply doesn't require the shift */ result = (s1 * s2); @@ -2981,7 +2981,7 @@ static size_t dsp56k_op_imac(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl result = (result << 16) & 0xffff0000; /* Sign extend D into a temp variable */ - opD = (*((UINT64*)D)); + opD = (*((uint64_t*)D)); if (opD & U64(0x0000008000000000)) opD |= U64(0xffffff0000000000); else @@ -2993,14 +2993,14 @@ static size_t dsp56k_op_imac(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl /* And out the bits that don't live in the register */ opD &= U64(0x000000ffffffffff); - (*((UINT64*)D)) = (UINT64)opD; + (*((uint64_t*)D)) = (uint64_t)opD; /* S L E U N Z V C */ /* - * ? ? * ? ? - */ /* TODO: L */ /* U,E - Will not be set correctly by this instruction*/ - if ( *((UINT64*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); DSP56K_V_CLEAR(); cycles += 2; @@ -3008,7 +3008,7 @@ static size_t dsp56k_op_imac(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* IMPY : 0001 0101 1000 FQQQ : A-102 */ -static size_t dsp56k_op_impy(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_impy(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - * ? ? * ? ? - */ @@ -3019,7 +3019,7 @@ static size_t dsp56k_op_impy(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* Jcc : 0000 0110 --11 cccc xxxx xxxx xxxx xxxx : A-108 */ -static size_t dsp56k_op_jcc(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_jcc(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3027,7 +3027,7 @@ static size_t dsp56k_op_jcc(dsp56k_core* cpustate, const UINT16 op, const UINT16 } /* Jcc : 0000 0110 RR10 cccc : A-108 */ -static size_t dsp56k_op_jcc_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_jcc_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3035,7 +3035,7 @@ static size_t dsp56k_op_jcc_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* JMP : 0000 0001 0011 01-- xxxx xxxx xxxx xxxx : A-110 */ -static size_t dsp56k_op_jmp(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_jmp(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { PC = op2; @@ -3047,12 +3047,12 @@ static size_t dsp56k_op_jmp(dsp56k_core* cpustate, const UINT16 op, const UINT16 } /* JMP : 0000 0001 0010 01RR : A-110 */ -static size_t dsp56k_op_jmp_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_jmp_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { typed_pointer R = { nullptr, DT_BYTE }; decode_RR_table(cpustate, BITS(op,0x0003), &R); - PC = *((UINT16*)R.addr); + PC = *((uint16_t*)R.addr); /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3062,14 +3062,14 @@ static size_t dsp56k_op_jmp_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* JScc : 0000 0110 --01 cccc xxxx xxxx xxxx xxxx : A-112 */ -static size_t dsp56k_op_jscc(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_jscc(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { int shouldJump = decode_cccc_table(cpustate, BITS(op,0x000f)); if(shouldJump) { /* TODO: It says "signed" absolute offset. Weird. */ - UINT16 branchOffset = op2; + uint16_t branchOffset = op2; /* TODO: Verify, since it's not in the docs, but it must be true */ PC += 2; @@ -3095,7 +3095,7 @@ static size_t dsp56k_op_jscc(dsp56k_core* cpustate, const UINT16 op, const UINT1 } /* JScc : 0000 0110 RR00 cccc : A-112 */ -static size_t dsp56k_op_jscc_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_jscc_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3103,10 +3103,10 @@ static size_t dsp56k_op_jscc_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cy } /* JSR : 0000 0001 0011 00-- xxxx xxxx xxxx xxxx : A-114 */ -static size_t dsp56k_op_jsr(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_jsr(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { /* TODO: It says "signed" absolute offset. Weird. */ - UINT16 branchOffset = op2; + uint16_t branchOffset = op2; /* TODO: Verify, since it's not in the docs, but it must be true */ PC += 2; @@ -3138,7 +3138,7 @@ static size_t dsp56k_op_jsr(dsp56k_core* cpustate, const UINT16 op, const UINT16 } /* JSR : 0000 1010 AAAA AAAA : A-114 */ -static size_t dsp56k_op_jsr_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_jsr_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3146,7 +3146,7 @@ static size_t dsp56k_op_jsr_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* JSR : 0000 0001 0010 00RR : A-114 */ -static size_t dsp56k_op_jsr_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_jsr_2(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3154,11 +3154,11 @@ static size_t dsp56k_op_jsr_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* LEA : 0000 0001 11TT MMRR : A-116 */ -static size_t dsp56k_op_lea(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_lea(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT16 ea = 0; - UINT16 *rX = nullptr; - UINT16 *nX = nullptr; + uint16_t ea = 0; + uint16_t *rX = nullptr; + uint16_t *nX = nullptr; typed_pointer D = {nullptr, DT_BYTE}; decode_TT_table(cpustate, BITS(op,0x0030), &D); @@ -3182,7 +3182,7 @@ static size_t dsp56k_op_lea(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle case 0x3: ea = *rX + *nX; break; } - *((UINT16*)D.addr) = ea; + *((uint16_t*)D.addr) = ea; /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3190,7 +3190,7 @@ static size_t dsp56k_op_lea(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* LEA : 0000 0001 10NN MMRR : A-116 */ -static size_t dsp56k_op_lea_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_lea_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3198,10 +3198,10 @@ static size_t dsp56k_op_lea_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* MAC(su,uu) : 0001 0101 1110 FsQQ : A-126 */ -static size_t dsp56k_op_macsuuu(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_macsuuu(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT8 s = 0; - INT64 result = 0; + uint8_t s = 0; + int64_t result = 0; void* D = nullptr; void* S1 = nullptr; @@ -3215,36 +3215,36 @@ static size_t dsp56k_op_macsuuu(dsp56k_core* cpustate, const UINT16 op, UINT8* c if (s) { /* Unsigned * Unsigned */ - UINT32 s1 = (UINT32)(*((UINT16*)S1)); - UINT32 s2 = (UINT32)(*((UINT16*)S2)); + uint32_t s1 = (uint32_t)(*((uint16_t*)S1)); + uint32_t s2 = (uint32_t)(*((uint16_t*)S2)); result = ( s1 * s2 ) << 1; } else { /* Signed * Unsigned */ /* WARNING : THERE IS A HUGE CHANCE THIS DOESN'T WORK RIGHT */ - INT32 s1 = ((INT32)(*((UINT16*)S1))); - INT32 s2 = (UINT32)(*((UINT16*)S2)); + int32_t s1 = ((int32_t)(*((uint16_t*)S1))); + int32_t s2 = (uint32_t)(*((uint16_t*)S2)); result = ( s1 * s2 ) << 1; } - (*((UINT64*)D)) += result; + (*((uint64_t*)D)) += result; /* And out the bits that don't live in the register */ - (*((UINT64*)D)) &= U64(0x000000ffffffffff); + (*((uint64_t*)D)) &= U64(0x000000ffffffffff); /* S L E U N Z V C */ /* - * * * * * * - */ /* TODO: L, E, U, V */ - if ( *((UINT64*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; return 1; } /* MOVE : 0000 0101 BBBB BBBB ---- HHHW 0001 0001 : A-128 */ -static size_t dsp56k_op_move_2(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_move_2(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - - - - - */ @@ -3252,9 +3252,9 @@ static size_t dsp56k_op_move_2(dsp56k_core* cpustate, const UINT16 op, const UIN } /* MOVE(C) : 0011 1WDD DDD0 MMRR : A-144 */ -static size_t dsp56k_op_movec(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_movec(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT8 W; + uint8_t W; typed_pointer R = { nullptr, DT_BYTE }; typed_pointer SD = { nullptr, DT_BYTE }; @@ -3265,14 +3265,14 @@ static size_t dsp56k_op_movec(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc if (W) { /* Write D */ - UINT16 value = cpustate->data->read_word(ADDRESS(*((UINT16*)R.addr))) ; + uint16_t value = cpustate->data->read_word(ADDRESS(*((uint16_t*)R.addr))) ; typed_pointer temp_src = { &value, DT_WORD }; SetDestinationValue(temp_src, SD); } else { /* Read S */ - UINT16 dataMemOffset = *((UINT16*)R.addr); + uint16_t dataMemOffset = *((uint16_t*)R.addr); SetDataMemoryValue(cpustate, SD, ADDRESS(dataMemOffset)); } @@ -3294,10 +3294,10 @@ static size_t dsp56k_op_movec(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* MOVE(C) : 0011 1WDD DDD1 q0RR : A-144 */ -static size_t dsp56k_op_movec_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_movec_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT8 W; - UINT16 memOffset; + uint8_t W; + uint16_t memOffset; typed_pointer SD = {nullptr, DT_BYTE}; W = BITS(op,0x0400); @@ -3307,14 +3307,14 @@ static size_t dsp56k_op_movec_1(dsp56k_core* cpustate, const UINT16 op, UINT8* c if (W) { /* Write D */ - UINT16 tempData = cpustate->data->read_word(ADDRESS(memOffset)); + uint16_t tempData = cpustate->data->read_word(ADDRESS(memOffset)); typed_pointer temp_src = { (void*)&tempData, DT_WORD }; SetDestinationValue(temp_src, SD); } else { /* Read S */ - UINT16 tempData = *((UINT16*)SD.addr); + uint16_t tempData = *((uint16_t*)SD.addr); typed_pointer temp_src = { (void*)&tempData, DT_WORD }; SetDataMemoryValue(cpustate, temp_src, ADDRESS(memOffset)); } @@ -3335,10 +3335,10 @@ static size_t dsp56k_op_movec_1(dsp56k_core* cpustate, const UINT16 op, UINT8* c } /* MOVE(C) : 0011 1WDD DDD1 Z11- : A-144 */ -static size_t dsp56k_op_movec_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_movec_2(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT8 W; - UINT16 memOffset; + uint8_t W; + uint16_t memOffset; typed_pointer SD = {nullptr, DT_BYTE}; typed_pointer XMemOffset = {nullptr, DT_BYTE}; @@ -3346,19 +3346,19 @@ static size_t dsp56k_op_movec_2(dsp56k_core* cpustate, const UINT16 op, UINT8* c decode_Z_table(cpustate, BITS(op,0x0008), &XMemOffset); decode_DDDDD_table(cpustate, BITS(op,0x03e0), &SD); - memOffset = *((UINT16*)XMemOffset.addr); + memOffset = *((uint16_t*)XMemOffset.addr); if (W) { /* Write D */ - UINT16 tempData = cpustate->data->read_word(ADDRESS(memOffset)); + uint16_t tempData = cpustate->data->read_word(ADDRESS(memOffset)); typed_pointer temp_src = { (void*)&tempData, DT_WORD }; SetDestinationValue(temp_src, SD); } else { /* Read S */ - UINT16 tempData = *((UINT16*)SD.addr); + uint16_t tempData = *((uint16_t*)SD.addr); typed_pointer temp_src = { (void*)&tempData, DT_WORD }; SetDataMemoryValue(cpustate, temp_src, ADDRESS(memOffset)); } @@ -3380,10 +3380,10 @@ static size_t dsp56k_op_movec_2(dsp56k_core* cpustate, const UINT16 op, UINT8* c } /* MOVE(C) : 0011 1WDD DDD1 t10- xxxx xxxx xxxx xxxx : A-144 */ -static size_t dsp56k_op_movec_3(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_movec_3(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { - UINT8 W; - UINT8 t; + uint8_t W; + uint8_t t; typed_pointer SD = { nullptr, DT_BYTE }; W = BITS(op,0x0400); @@ -3402,7 +3402,7 @@ static size_t dsp56k_op_movec_3(dsp56k_core* cpustate, const UINT16 op, const UI else { /* 16-bit long address */ - UINT16 tempD = cpustate->data->read_word(ADDRESS(op2)); + uint16_t tempD = cpustate->data->read_word(ADDRESS(op2)); typed_pointer tempTP = {&tempD, DT_WORD}; SetDestinationValue(tempTP, SD); } @@ -3438,7 +3438,7 @@ static size_t dsp56k_op_movec_3(dsp56k_core* cpustate, const UINT16 op, const UI } /* MOVE(C) : 0010 10dd dddD DDDD : A-144 */ -static size_t dsp56k_op_movec_4(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_movec_4(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; @@ -3464,30 +3464,30 @@ static size_t dsp56k_op_movec_4(dsp56k_core* cpustate, const UINT16 op, UINT8* c } /* MOVE(C) : 0000 0101 BBBB BBBB 0011 1WDD DDD0 ---- : A-144 */ -static size_t dsp56k_op_movec_5(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_movec_5(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { - INT8 xx; - UINT8 W; - UINT16 memOffset; + int8_t xx; + uint8_t W; + uint16_t memOffset; typed_pointer SD = { nullptr, DT_BYTE }; - xx = (INT8)(op & 0x00ff); + xx = (int8_t)(op & 0x00ff); W = BITS(op2,0x0400); decode_DDDDD_table(cpustate, BITS(op2,0x03e0), &SD); - memOffset = R2 + (INT16)xx; + memOffset = R2 + (int16_t)xx; if (W) { /* Write D */ - UINT16 tempData = cpustate->data->read_word(ADDRESS(memOffset)); + uint16_t tempData = cpustate->data->read_word(ADDRESS(memOffset)); typed_pointer temp_src = { (void*)&tempData, DT_WORD }; SetDestinationValue(temp_src, SD); } else { /* Read S */ - UINT16 tempData = *((UINT16*)SD.addr); + uint16_t tempData = *((uint16_t*)SD.addr); typed_pointer temp_src = { (void*)&tempData, DT_WORD }; SetDataMemoryValue(cpustate, temp_src, ADDRESS(memOffset)); } @@ -3508,13 +3508,13 @@ static size_t dsp56k_op_movec_5(dsp56k_core* cpustate, const UINT16 op, const UI } /* MOVE(I) : 0010 00DD BBBB BBBB : A-150 */ -static size_t dsp56k_op_movei(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_movei(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { typed_pointer D = {nullptr, DT_BYTE}; typed_pointer immTP = {nullptr, DT_BYTE}; - /* Typecasting to INT16 sign-extends the BBBBBBBB operand */ - UINT16 immediateSignExtended = (INT16)(op & 0x00ff); + /* Typecasting to int16_t sign-extends the BBBBBBBB operand */ + uint16_t immediateSignExtended = (int16_t)(op & 0x00ff); immTP.addr = &immediateSignExtended; immTP.data_type = DT_WORD; @@ -3529,9 +3529,9 @@ static size_t dsp56k_op_movei(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* MOVE(M) : 0000 001W RR0M MHHH : A-152 */ -static size_t dsp56k_op_movem(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_movem(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT8 W; + uint8_t W; typed_pointer R = { nullptr, DT_BYTE }; typed_pointer SD = { nullptr, DT_BYTE }; @@ -3543,7 +3543,7 @@ static size_t dsp56k_op_movem(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc { /* Read from Program Memory */ typed_pointer data; - UINT16 ldata = cpustate->program->read_word(ADDRESS(*((UINT16*)R.addr))); + uint16_t ldata = cpustate->program->read_word(ADDRESS(*((uint16_t*)R.addr))); data.addr = &ldata; data.data_type = DT_WORD; @@ -3552,7 +3552,7 @@ static size_t dsp56k_op_movem(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc else { /* Write to Program Memory */ - SetProgramMemoryValue(cpustate, SD, ADDRESS(*((UINT16*)R.addr))) ; + SetProgramMemoryValue(cpustate, SD, ADDRESS(*((uint16_t*)R.addr))) ; } execute_MM_table(cpustate, BITS(op,0x00c0), BITS(op,0x0018)); @@ -3565,7 +3565,7 @@ static size_t dsp56k_op_movem(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* MOVE(M) : 0000 001W RR11 mmRR : A-152 */ -static size_t dsp56k_op_movem_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_movem_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - - - - - */ @@ -3573,7 +3573,7 @@ static size_t dsp56k_op_movem_1(dsp56k_core* cpustate, const UINT16 op, UINT8* c } /* MOVE(M) : 0000 0101 BBBB BBBB 0000 001W --0- -HHH : A-152 */ -static size_t dsp56k_op_movem_2(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2, UINT8* cycles) +static size_t dsp56k_op_movem_2(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - - - - - */ @@ -3581,10 +3581,10 @@ static size_t dsp56k_op_movem_2(dsp56k_core* cpustate, const UINT16 op, const UI } /* MOVE(P) : 0001 100W HH1p pppp : A-156 */ -static size_t dsp56k_op_movep(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_movep(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT16 W; - UINT16 pp; + uint16_t W; + uint16_t pp; typed_pointer SD = {nullptr, DT_BYTE}; decode_HH_table(cpustate, BITS(op,0x00c0), &SD); @@ -3597,7 +3597,7 @@ static size_t dsp56k_op_movep(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc if (W) { - UINT16 data = cpustate->data->read_word(ADDRESS(pp)); + uint16_t data = cpustate->data->read_word(ADDRESS(pp)); typed_pointer tempTP; tempTP.addr = &data; @@ -3619,11 +3619,11 @@ static size_t dsp56k_op_movep(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* MOVE(P) : 0000 110W RRmp pppp : A-156 */ -static size_t dsp56k_op_movep_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_movep_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* X: and X: */ - UINT16 W; - UINT16 pp; + uint16_t W; + uint16_t pp; typed_pointer SD = {nullptr, DT_BYTE}; decode_RR_table(cpustate, BITS(op,0x00c0), &SD); @@ -3636,7 +3636,7 @@ static size_t dsp56k_op_movep_1(dsp56k_core* cpustate, const UINT16 op, UINT8* c /* A little different than most W if's - opposite read and write */ if (W) { - UINT16 data = cpustate->data->read_word(ADDRESS(*((UINT16*)SD.addr))); + uint16_t data = cpustate->data->read_word(ADDRESS(*((uint16_t*)SD.addr))); typed_pointer tempTP; tempTP.addr = &data; @@ -3661,7 +3661,7 @@ static size_t dsp56k_op_movep_1(dsp56k_core* cpustate, const UINT16 op, UINT8* c } /* MOVE(S) : 0001 100W HH0a aaaa : A-158 */ -static size_t dsp56k_op_moves(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_moves(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - - - - - */ @@ -3669,10 +3669,10 @@ static size_t dsp56k_op_moves(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* MPY(su,uu) : 0001 0101 1100 FsQQ : A-164 */ -static size_t dsp56k_op_mpysuuu(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_mpysuuu(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { - UINT8 s = 0; - INT64 result = 0; + uint8_t s = 0; + int64_t result = 0; void* D = nullptr; void* S1 = nullptr; @@ -3686,36 +3686,36 @@ static size_t dsp56k_op_mpysuuu(dsp56k_core* cpustate, const UINT16 op, UINT8* c if (s) { /* Unsigned * Unsigned */ - UINT32 s1 = (UINT32)(*((UINT16*)S1)); - UINT32 s2 = (UINT32)(*((UINT16*)S2)); + uint32_t s1 = (uint32_t)(*((uint16_t*)S1)); + uint32_t s2 = (uint32_t)(*((uint16_t*)S2)); result = ( s1 * s2 ) << 1; } else { /* Signed * Unsigned */ /* WARNING : THERE IS A HUGE CHANCE THIS DOESN'T WORK RIGHT */ - INT32 s1 = ((INT32)(*((UINT16*)S1))); - INT32 s2 = (UINT32)(*((UINT16*)S2)); + int32_t s1 = ((int32_t)(*((uint16_t*)S1))); + int32_t s2 = (uint32_t)(*((uint16_t*)S2)); result = ( s1 * s2 ) << 1; } - (*((UINT64*)D)) = result; + (*((uint64_t*)D)) = result; /* And out the bits that don't live in the register */ - (*((UINT64*)D)) &= U64(0x000000ffffffffff); + (*((uint64_t*)D)) &= U64(0x000000ffffffffff); /* S L E U N Z V C */ /* - * * * * * * - */ /* TODO: L, E, U, V */ - if ( *((UINT64*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT64*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); cycles += 2; return 1; } /* NEGC : 0001 0101 0110 F000 : A-168 */ -static size_t dsp56k_op_negc(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_negc(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - * * * * * * * */ @@ -3723,7 +3723,7 @@ static size_t dsp56k_op_negc(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* NOP : 0000 0000 0000 0000 : A-170 */ -static size_t dsp56k_op_nop(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_nop(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3731,7 +3731,7 @@ static size_t dsp56k_op_nop(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* NORM : 0001 0101 0010 F0RR : A-172 */ -static size_t dsp56k_op_norm(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_norm(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - * * * * * ? - */ @@ -3741,7 +3741,7 @@ static size_t dsp56k_op_norm(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* ORI : 0001 1EE1 iiii iiii : A-178 */ -static size_t dsp56k_op_ori(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_ori(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - ? ? ? ? ? ? ? */ @@ -3751,7 +3751,7 @@ static size_t dsp56k_op_ori(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* REP : 0000 0000 111- --RR : A-180 */ -static size_t dsp56k_op_rep(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_rep(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - * - - - - - - */ @@ -3759,10 +3759,10 @@ static size_t dsp56k_op_rep(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* REP : 0000 1111 iiii iiii : A-180 */ -static size_t dsp56k_op_rep_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_rep_1(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* TODO: This is non-interruptable, probably have to turn off interrupts here */ - UINT16 iVal = op & 0x00ff; + uint16_t iVal = op & 0x00ff; if (iVal != 0) { @@ -3787,10 +3787,10 @@ static size_t dsp56k_op_rep_1(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* REP : 0000 0100 001D DDDD : A-180 */ -static size_t dsp56k_op_rep_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_rep_2(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* TODO: This is non-interruptable, probably have to turn off interrupts here */ - UINT16 repValue; + uint16_t repValue; typed_pointer D = {nullptr, DT_BYTE}; decode_DDDDD_table(cpustate, BITS(op,0x001f), &D); @@ -3798,7 +3798,7 @@ static size_t dsp56k_op_rep_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc if (D.addr == &A || D.addr == &B) cpustate->device->logerror("DSP56k ERROR : Rep with A or B instruction not implemented yet!\n"); - repValue = *((UINT16*)D.addr); + repValue = *((uint16_t*)D.addr); if (repValue != 0) { @@ -3822,7 +3822,7 @@ static size_t dsp56k_op_rep_2(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* REPcc : 0000 0001 0101 cccc : A-184 */ -static size_t dsp56k_op_repcc(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_repcc(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3830,7 +3830,7 @@ static size_t dsp56k_op_repcc(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* RESET : 0000 0000 0000 1000 : A-186 */ -static size_t dsp56k_op_reset(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_reset(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3838,7 +3838,7 @@ static size_t dsp56k_op_reset(dsp56k_core* cpustate, const UINT16 op, UINT8* cyc } /* RTI : 0000 0000 0000 0111 : A-194 */ -static size_t dsp56k_op_rti(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_rti(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* WARNING : THERE SHOULD BE A MORE GENERAL HANDLING OF STACK ERRORS. */ if (SP == 0) @@ -3860,7 +3860,7 @@ static size_t dsp56k_op_rti(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* RTS : 0000 0000 0000 0110 : A-196 */ -static size_t dsp56k_op_rts(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_rts(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* Pop */ PC = SSH; @@ -3876,7 +3876,7 @@ static size_t dsp56k_op_rts(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* STOP : 0000 0000 0000 1010 : A-200 */ -static size_t dsp56k_op_stop(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_stop(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3884,7 +3884,7 @@ static size_t dsp56k_op_stop(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* SWAP : 0001 0101 0111 F001 : A-206 */ -static size_t dsp56k_op_swap(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_swap(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3892,7 +3892,7 @@ static size_t dsp56k_op_swap(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* SWI : 0000 0000 0000 0101 : A-208 */ -static size_t dsp56k_op_swi(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_swi(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3900,7 +3900,7 @@ static size_t dsp56k_op_swi(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* Tcc : 0001 00cc ccTT Fh0h : A-210 */ -static size_t dsp56k_op_tcc(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_tcc(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { int shouldTransfer = decode_cccc_table(cpustate, BITS(op,0x03c0)); @@ -3926,7 +3926,7 @@ static size_t dsp56k_op_tcc(dsp56k_core* cpustate, const UINT16 op, UINT8* cycle } /* TFR(2) : 0001 0101 0000 F00J : A-214 */ -static size_t dsp56k_op_tfr2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_tfr2(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; @@ -3943,7 +3943,7 @@ static size_t dsp56k_op_tfr2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* TFR(3) : 0010 01mW RRDD FHHH : A-216 */ -static size_t dsp56k_op_tfr3(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_tfr3(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* * * - - - - - - */ @@ -3951,7 +3951,7 @@ static size_t dsp56k_op_tfr3(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* TST(2) : 0001 0101 0001 -1DD : A-220 */ -static size_t dsp56k_op_tst2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_tst2(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { typed_pointer D = {nullptr, DT_BYTE}; decode_DD_table(cpustate, BITS(op,0x0003), &D); @@ -3962,8 +3962,8 @@ static size_t dsp56k_op_tst2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl DSP56K_L_CLEAR(); DSP56K_E_CLEAR(); /* U_CLEAR(); */ /* TODO: Conflicting opinions? "Set if unnormalized." Documentation is weird (A&B?) */ - if ((*((UINT16*)D.addr)) & 0x8000) DSP56K_N_SET(); else DSP56K_N_CLEAR(); - if ((*((UINT16*)D.addr)) == 0x0000) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); + if ((*((uint16_t*)D.addr)) & 0x8000) DSP56K_N_SET(); else DSP56K_N_CLEAR(); + if ((*((uint16_t*)D.addr)) == 0x0000) DSP56K_Z_SET(); else DSP56K_Z_CLEAR(); /* DSP56K_V_CLEAR(); */ /* Unaffected */ DSP56K_C_CLEAR(); @@ -3972,7 +3972,7 @@ static size_t dsp56k_op_tst2(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* WAIT : 0000 0000 0000 1011 : A-222 */ -static size_t dsp56k_op_wait(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_wait(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - - - - - - - - */ @@ -3980,7 +3980,7 @@ static size_t dsp56k_op_wait(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl } /* ZERO : 0001 0101 0101 F000 : A-224 */ -static size_t dsp56k_op_zero(dsp56k_core* cpustate, const UINT16 op, UINT8* cycles) +static size_t dsp56k_op_zero(dsp56k_core* cpustate, const uint16_t op, uint8_t* cycles) { /* S L E U N Z V C */ /* - * * * * * * - */ @@ -3992,9 +3992,9 @@ static size_t dsp56k_op_zero(dsp56k_core* cpustate, const UINT16 op, UINT8* cycl /*************************************************************************** Table decoding ***************************************************************************/ -static UINT16 decode_BBB_bitmask(dsp56k_core* cpustate, UINT16 BBB, UINT16 *iVal) +static uint16_t decode_BBB_bitmask(dsp56k_core* cpustate, uint16_t BBB, uint16_t *iVal) { - UINT16 retVal = 0x0000; + uint16_t retVal = 0x0000; switch(BBB) { @@ -4006,7 +4006,7 @@ static UINT16 decode_BBB_bitmask(dsp56k_core* cpustate, UINT16 BBB, UINT16 *iVal return retVal; } -static int decode_cccc_table(dsp56k_core* cpustate, UINT16 cccc) +static int decode_cccc_table(dsp56k_core* cpustate, uint16_t cccc) { int retVal = 0; @@ -4035,7 +4035,7 @@ static int decode_cccc_table(dsp56k_core* cpustate, UINT16 cccc) return retVal; } -static void decode_DDDDD_table(dsp56k_core* cpustate, UINT16 DDDDD, typed_pointer* ret) +static void decode_DDDDD_table(dsp56k_core* cpustate, uint16_t DDDDD, typed_pointer* ret) { switch(DDDDD) { @@ -4075,7 +4075,7 @@ static void decode_DDDDD_table(dsp56k_core* cpustate, UINT16 DDDDD, typed_pointe } } -static void decode_DD_table(dsp56k_core* cpustate, UINT16 DD, typed_pointer* ret) +static void decode_DD_table(dsp56k_core* cpustate, uint16_t DD, typed_pointer* ret) { switch(DD) { @@ -4086,9 +4086,9 @@ static void decode_DD_table(dsp56k_core* cpustate, UINT16 DD, typed_pointer* ret } } -static void decode_DDF_table(dsp56k_core* cpustate, UINT16 DD, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret) +static void decode_DDF_table(dsp56k_core* cpustate, uint16_t DD, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret) { - UINT16 switchVal = (DD << 1) | F; + uint16_t switchVal = (DD << 1) | F; switch (switchVal) { @@ -4103,7 +4103,7 @@ static void decode_DDF_table(dsp56k_core* cpustate, UINT16 DD, UINT16 F, typed_p } } -static void decode_F_table(dsp56k_core* cpustate, UINT16 F, typed_pointer* ret) +static void decode_F_table(dsp56k_core* cpustate, uint16_t F, typed_pointer* ret) { switch(F) { @@ -4112,9 +4112,9 @@ static void decode_F_table(dsp56k_core* cpustate, UINT16 F, typed_pointer* ret) } } -static void decode_h0hF_table(dsp56k_core* cpustate, UINT16 h0h, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret) +static void decode_h0hF_table(dsp56k_core* cpustate, uint16_t h0h, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret) { - UINT16 switchVal = (h0h << 1) | F ; + uint16_t switchVal = (h0h << 1) | F ; switch (switchVal) { @@ -4129,7 +4129,7 @@ static void decode_h0hF_table(dsp56k_core* cpustate, UINT16 h0h, UINT16 F, typed } } -static void decode_HH_table(dsp56k_core* cpustate, UINT16 HH, typed_pointer* ret) +static void decode_HH_table(dsp56k_core* cpustate, uint16_t HH, typed_pointer* ret) { switch(HH) { @@ -4140,7 +4140,7 @@ static void decode_HH_table(dsp56k_core* cpustate, UINT16 HH, typed_pointer* ret } } -static void decode_HHH_table(dsp56k_core* cpustate, UINT16 HHH, typed_pointer* ret) +static void decode_HHH_table(dsp56k_core* cpustate, uint16_t HHH, typed_pointer* ret) { switch(HHH) { @@ -4155,7 +4155,7 @@ static void decode_HHH_table(dsp56k_core* cpustate, UINT16 HHH, typed_pointer* r } } -static void decode_IIII_table(dsp56k_core* cpustate, UINT16 IIII, typed_pointer* src_ret, typed_pointer* dst_ret, void *working) +static void decode_IIII_table(dsp56k_core* cpustate, uint16_t IIII, typed_pointer* src_ret, typed_pointer* dst_ret, void *working) { void *opposite = nullptr ; @@ -4181,9 +4181,9 @@ static void decode_IIII_table(dsp56k_core* cpustate, UINT16 IIII, typed_pointer* } } -static void decode_JJJF_table(dsp56k_core* cpustate, UINT16 JJJ, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret) +static void decode_JJJF_table(dsp56k_core* cpustate, uint16_t JJJ, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret) { - UINT16 switchVal = (JJJ << 1) | F ; + uint16_t switchVal = (JJJ << 1) | F ; switch(switchVal) { @@ -4204,9 +4204,9 @@ static void decode_JJJF_table(dsp56k_core* cpustate, UINT16 JJJ, UINT16 F, typed } } -static void decode_JJF_table(dsp56k_core* cpustate, UINT16 JJ, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret) +static void decode_JJF_table(dsp56k_core* cpustate, uint16_t JJ, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret) { - UINT16 switchVal = (JJ << 1) | F ; + uint16_t switchVal = (JJ << 1) | F ; switch (switchVal) { @@ -4221,9 +4221,9 @@ static void decode_JJF_table(dsp56k_core* cpustate, UINT16 JJ, UINT16 F, typed_p } } -static void decode_JF_table(dsp56k_core* cpustate, UINT16 J, UINT16 F, typed_pointer* src_ret, typed_pointer* dst_ret) +static void decode_JF_table(dsp56k_core* cpustate, uint16_t J, uint16_t F, typed_pointer* src_ret, typed_pointer* dst_ret) { - UINT16 switchVal = (J << 1) | F ; + uint16_t switchVal = (J << 1) | F ; switch (switchVal) { @@ -4234,7 +4234,7 @@ static void decode_JF_table(dsp56k_core* cpustate, UINT16 J, UINT16 F, typed_poi } } -static void decode_KKK_table(dsp56k_core* cpustate, UINT16 KKK, typed_pointer* dst_ret1, typed_pointer* dst_ret2, void* working) +static void decode_KKK_table(dsp56k_core* cpustate, uint16_t KKK, typed_pointer* dst_ret1, typed_pointer* dst_ret2, void* working) { void *opposite = nullptr ; @@ -4254,9 +4254,9 @@ static void decode_KKK_table(dsp56k_core* cpustate, UINT16 KKK, typed_pointer* d } } -static void decode_QQF_table(dsp56k_core* cpustate, UINT16 QQ, UINT16 F, void **S1, void **S2, void **D) +static void decode_QQF_table(dsp56k_core* cpustate, uint16_t QQ, uint16_t F, void **S1, void **S2, void **D) { - UINT16 switchVal = (QQ << 1) | F ; + uint16_t switchVal = (QQ << 1) | F ; switch(switchVal) { @@ -4271,9 +4271,9 @@ static void decode_QQF_table(dsp56k_core* cpustate, UINT16 QQ, UINT16 F, void ** } } -static void decode_QQF_special_table(dsp56k_core* cpustate, UINT16 QQ, UINT16 F, void **S1, void **S2, void **D) +static void decode_QQF_special_table(dsp56k_core* cpustate, uint16_t QQ, uint16_t F, void **S1, void **S2, void **D) { - UINT16 switchVal = (QQ << 1) | F ; + uint16_t switchVal = (QQ << 1) | F ; switch(switchVal) { @@ -4288,9 +4288,9 @@ static void decode_QQF_special_table(dsp56k_core* cpustate, UINT16 QQ, UINT16 F, } } -static void decode_QQQF_table(dsp56k_core* cpustate, UINT16 QQQ, UINT16 F, void **S1, void **S2, void **D) +static void decode_QQQF_table(dsp56k_core* cpustate, uint16_t QQQ, uint16_t F, void **S1, void **S2, void **D) { - UINT16 switchVal = (QQQ << 1) | F; + uint16_t switchVal = (QQQ << 1) | F; switch(switchVal) { @@ -4313,7 +4313,7 @@ static void decode_QQQF_table(dsp56k_core* cpustate, UINT16 QQQ, UINT16 F, void } } -static void decode_RR_table(dsp56k_core* cpustate, UINT16 RR, typed_pointer* ret) +static void decode_RR_table(dsp56k_core* cpustate, uint16_t RR, typed_pointer* ret) { switch(RR) { @@ -4324,7 +4324,7 @@ static void decode_RR_table(dsp56k_core* cpustate, UINT16 RR, typed_pointer* ret } } -static void decode_TT_table(dsp56k_core* cpustate, UINT16 TT, typed_pointer* ret) +static void decode_TT_table(dsp56k_core* cpustate, uint16_t TT, typed_pointer* ret) { switch(TT) { @@ -4336,9 +4336,9 @@ static void decode_TT_table(dsp56k_core* cpustate, UINT16 TT, typed_pointer* ret } -static void decode_uuuuF_table(dsp56k_core* cpustate, UINT16 uuuu, UINT16 F, UINT8 add_sub_other, typed_pointer* src_ret, typed_pointer* dst_ret) +static void decode_uuuuF_table(dsp56k_core* cpustate, uint16_t uuuu, uint16_t F, uint8_t add_sub_other, typed_pointer* src_ret, typed_pointer* dst_ret) { - UINT16 switchVal = (uuuu << 1) | F; + uint16_t switchVal = (uuuu << 1) | F; /* Unknown uuuuFs have been seen in the wild */ add_sub_other = OP_OTHER; @@ -4410,7 +4410,7 @@ static void decode_uuuuF_table(dsp56k_core* cpustate, UINT16 uuuu, UINT16 F, UIN } } -static void decode_Z_table(dsp56k_core* cpustate, UINT16 Z, typed_pointer* ret) +static void decode_Z_table(dsp56k_core* cpustate, uint16_t Z, typed_pointer* ret) { switch(Z) { @@ -4420,10 +4420,10 @@ static void decode_Z_table(dsp56k_core* cpustate, UINT16 Z, typed_pointer* ret) } } -static void execute_m_table(dsp56k_core* cpustate, int x, UINT16 m) +static void execute_m_table(dsp56k_core* cpustate, int x, uint16_t m) { - UINT16 *rX = nullptr ; - UINT16 *nX = nullptr ; + uint16_t *rX = nullptr ; + uint16_t *nX = nullptr ; switch(x) { @@ -4440,10 +4440,10 @@ static void execute_m_table(dsp56k_core* cpustate, int x, UINT16 m) } } -static void execute_mm_table(dsp56k_core* cpustate, UINT16 rnum, UINT16 mm) +static void execute_mm_table(dsp56k_core* cpustate, uint16_t rnum, uint16_t mm) { - UINT16 *rX = nullptr; - UINT16 *nX = nullptr; + uint16_t *rX = nullptr; + uint16_t *nX = nullptr; switch(rnum) { @@ -4462,10 +4462,10 @@ static void execute_mm_table(dsp56k_core* cpustate, UINT16 rnum, UINT16 mm) } } -static void execute_MM_table(dsp56k_core* cpustate, UINT16 rnum, UINT16 MM) +static void execute_MM_table(dsp56k_core* cpustate, uint16_t rnum, uint16_t MM) { - UINT16 *rX = nullptr ; - UINT16 *nX = nullptr ; + uint16_t *rX = nullptr ; + uint16_t *nX = nullptr ; switch(rnum) { @@ -4485,10 +4485,10 @@ static void execute_MM_table(dsp56k_core* cpustate, UINT16 rnum, UINT16 MM) } /* Returns R value */ -static UINT16 execute_q_table(dsp56k_core* cpustate, int RR, UINT16 q) +static uint16_t execute_q_table(dsp56k_core* cpustate, int RR, uint16_t q) { - UINT16 *rX = nullptr; - UINT16 *nX = nullptr; + uint16_t *rX = nullptr; + uint16_t *nX = nullptr; switch(RR) { @@ -4509,10 +4509,10 @@ static UINT16 execute_q_table(dsp56k_core* cpustate, int RR, UINT16 q) return 0; } -static void execute_z_table(dsp56k_core* cpustate, int RR, UINT16 z) +static void execute_z_table(dsp56k_core* cpustate, int RR, uint16_t z) { - UINT16 *rX = nullptr; - UINT16 *nX = nullptr; + uint16_t *rX = nullptr; + uint16_t *nX = nullptr; switch(RR) { @@ -4529,9 +4529,9 @@ static void execute_z_table(dsp56k_core* cpustate, int RR, UINT16 z) } } -static UINT16 assemble_address_from_Pppppp_table(dsp56k_core* cpustate, UINT16 P, UINT16 ppppp) +static uint16_t assemble_address_from_Pppppp_table(dsp56k_core* cpustate, uint16_t P, uint16_t ppppp) { - UINT16 destAddr = 0x00 ; + uint16_t destAddr = 0x00 ; switch (P) { @@ -4542,16 +4542,16 @@ static UINT16 assemble_address_from_Pppppp_table(dsp56k_core* cpustate, UINT16 P return destAddr ; } -static UINT16 assemble_address_from_IO_short_address(dsp56k_core* cpustate, UINT16 pp) +static uint16_t assemble_address_from_IO_short_address(dsp56k_core* cpustate, uint16_t pp) { - UINT16 fullAddy = 0xffe0; + uint16_t fullAddy = 0xffe0; fullAddy |= pp; return fullAddy; } -static UINT16 assemble_address_from_6bit_signed_relative_short_address(dsp56k_core* cpustate, UINT16 srs) +static uint16_t assemble_address_from_6bit_signed_relative_short_address(dsp56k_core* cpustate, uint16_t srs) { - UINT16 fullAddy = srs ; + uint16_t fullAddy = srs ; if (fullAddy & 0x0020) fullAddy |= 0xffc0 ; @@ -4622,7 +4622,7 @@ static void dsp56k_process_rep(dsp56k_core* cpustate, size_t repSize) Parallel Memory Ops ***************************************************************************/ /* Register to Register Data Move : 0100 IIII .... .... : A-132 */ -static void execute_register_to_register_data_move(dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register, UINT64* prev_accum_value) +static void execute_register_to_register_data_move(dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register, uint64_t* prev_accum_value) { typed_pointer S = {nullptr, DT_BYTE}; typed_pointer D = {nullptr, DT_BYTE}; @@ -4644,15 +4644,15 @@ static void execute_register_to_register_data_move(dsp56k_core* cpustate, const } /* Address Register Update : 0011 0zRR .... .... : A-135 */ -static void execute_address_register_update(dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register, UINT64* prev_accum_value) +static void execute_address_register_update(dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register, uint64_t* prev_accum_value) { execute_z_table(cpustate, BITS(op,0x0300), BITS(op,0x0400)); } /* X Memory Data Move : 1mRR HHHW .... .... : A-137 */ -static void execute_x_memory_data_move(dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register, UINT64* prev_accum_value) +static void execute_x_memory_data_move(dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register, uint64_t* prev_accum_value) { - UINT16 W; + uint16_t W; typed_pointer R = {nullptr, DT_BYTE}; typed_pointer SD = {nullptr, DT_BYTE}; @@ -4663,7 +4663,7 @@ static void execute_x_memory_data_move(dsp56k_core* cpustate, const UINT16 op, t if (W) { /* From X: to SD */ - UINT16 data = cpustate->data->read_word(ADDRESS(*((UINT16*)R.addr))); + uint16_t data = cpustate->data->read_word(ADDRESS(*((uint16_t*)R.addr))); typed_pointer tempTP; tempTP.addr = &data; @@ -4681,11 +4681,11 @@ static void execute_x_memory_data_move(dsp56k_core* cpustate, const UINT16 op, t tempTP.addr = prev_accum_value; tempTP.data_type = DT_LONG_WORD; - SetDataMemoryValue(cpustate, tempTP, ADDRESS(*((UINT16*)R.addr))) ; + SetDataMemoryValue(cpustate, tempTP, ADDRESS(*((uint16_t*)R.addr))) ; } else { - SetDataMemoryValue(cpustate, SD, ADDRESS(*((UINT16*)R.addr))) ; + SetDataMemoryValue(cpustate, SD, ADDRESS(*((uint16_t*)R.addr))) ; } } @@ -4694,10 +4694,10 @@ static void execute_x_memory_data_move(dsp56k_core* cpustate, const UINT16 op, t /* X Memory Data Move : 0101 HHHW .... .... : A-137 */ /* NOTE: previous accumulator value is not needed since ^F1 is always the opposite accumulator */ -static void execute_x_memory_data_move2(dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register) +static void execute_x_memory_data_move2(dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register) { - UINT16 W; - UINT16* mem_offset = nullptr; + uint16_t W; + uint16_t* mem_offset = nullptr; typed_pointer SD = {nullptr, DT_BYTE}; W = BITS(op,0x0100); @@ -4711,7 +4711,7 @@ static void execute_x_memory_data_move2(dsp56k_core* cpustate, const UINT16 op, if (W) { /* Write D */ - UINT16 value = cpustate->data->read_word(ADDRESS(*mem_offset)); + uint16_t value = cpustate->data->read_word(ADDRESS(*mem_offset)); typed_pointer tempV = {&value, DT_WORD}; SetDestinationValue(tempV, SD); } @@ -4723,41 +4723,41 @@ static void execute_x_memory_data_move2(dsp56k_core* cpustate, const UINT16 op, } /* X Memory Data Move With Short Displacement : 0000 0101 BBBB BBBB ---- HHHW .... .... : A-139 */ -static void execute_x_memory_data_move_with_short_displacement(dsp56k_core* cpustate, const UINT16 op, const UINT16 op2) +static void execute_x_memory_data_move_with_short_displacement(dsp56k_core* cpustate, const uint16_t op, const uint16_t op2) { - INT8 xx; - UINT8 W; - UINT16 memOffset; + int8_t xx; + uint8_t W; + uint16_t memOffset; typed_pointer SD = { nullptr, DT_BYTE }; - xx = (INT8)(op & 0x00ff); + xx = (int8_t)(op & 0x00ff); W = BITS(op2,0x0100); decode_HHH_table(cpustate, BITS(op2,0x0e00), &SD); - memOffset = R2 + (INT16)xx; + memOffset = R2 + (int16_t)xx; if (W) { /* Write D */ - UINT16 tempData = cpustate->data->read_word(ADDRESS(memOffset)); + uint16_t tempData = cpustate->data->read_word(ADDRESS(memOffset)); typed_pointer temp_src = { (void*)&tempData, DT_WORD }; SetDestinationValue(temp_src, SD); } else { /* Read S */ - UINT16 tempData = *((UINT16*)SD.addr); + uint16_t tempData = *((uint16_t*)SD.addr); typed_pointer temp_src = { (void*)&tempData, DT_WORD }; SetDataMemoryValue(cpustate, temp_src, ADDRESS(memOffset)); } } /* Dual X Memory Data Read : 011m mKKK .rr. .... : A-142*/ -static void execute_dual_x_memory_data_read(dsp56k_core* cpustate, const UINT16 op, typed_pointer* d_register) +static void execute_dual_x_memory_data_read(dsp56k_core* cpustate, const uint16_t op, typed_pointer* d_register) { typed_pointer tempV; - UINT16 srcVal1 = 0x0000; - UINT16 srcVal2 = 0x0000; + uint16_t srcVal1 = 0x0000; + uint16_t srcVal2 = 0x0000; typed_pointer R = {nullptr, DT_BYTE}; typed_pointer D1 = {nullptr, DT_BYTE}; typed_pointer D2 = {nullptr, DT_BYTE}; @@ -4771,11 +4771,11 @@ static void execute_dual_x_memory_data_read(dsp56k_core* cpustate, const UINT16 /* The note on A-142 is very interesting. You can effectively access external memory in the last 64 bytes of X data memory! */ - if (*((UINT16*)D2.addr) >= 0xffc0) + if (*((uint16_t*)D2.addr) >= 0xffc0) fatalerror("Dsp56k: Unimplemented access to external X Data Memory >= 0xffc0 in Dual X Memory Data Read.\n"); /* First memmove */ - srcVal1 = cpustate->data->read_word(ADDRESS(*((UINT16*)R.addr))); + srcVal1 = cpustate->data->read_word(ADDRESS(*((uint16_t*)R.addr))); tempV.addr = &srcVal1; tempV.data_type = DT_WORD; SetDestinationValue(tempV, D1); @@ -4793,12 +4793,12 @@ static void execute_dual_x_memory_data_read(dsp56k_core* cpustate, const UINT16 /*************************************************************************** Helper Functions ***************************************************************************/ -static UINT16 Dsp56kOpMask(UINT16 cur, UINT16 mask) +static uint16_t Dsp56kOpMask(uint16_t cur, uint16_t mask) { int i ; - UINT16 retVal = (cur & mask) ; - UINT16 temp = 0x0000 ; + uint16_t retVal = (cur & mask) ; + uint16_t temp = 0x0000 ; int offsetCount = 0 ; /* Shift everything right, eliminating 'whitespace' */ @@ -4816,7 +4816,7 @@ static UINT16 Dsp56kOpMask(UINT16 cur, UINT16 mask) static void SetDestinationValue(typed_pointer source, typed_pointer dest) { - UINT64 destinationValue = 0 ; + uint64_t destinationValue = 0 ; switch(dest.data_type) { @@ -4825,10 +4825,10 @@ static void SetDestinationValue(typed_pointer source, typed_pointer dest) switch(source.data_type) { /* From a ? */ - case DT_BYTE: *((UINT8*)dest.addr) = (*((UINT8*) source.addr)) & 0xff; break; - case DT_WORD: *((UINT8*)dest.addr) = (*((UINT16*)source.addr)) & 0x00ff; break; - case DT_DOUBLE_WORD: *((UINT8*)dest.addr) = (*((UINT32*)source.addr)) & 0x000000ff; break; - case DT_LONG_WORD: *((UINT8*)dest.addr) = (*((UINT64*)source.addr)) & U64(0x00000000000000ff); break; + case DT_BYTE: *((uint8_t*)dest.addr) = (*((uint8_t*) source.addr)) & 0xff; break; + case DT_WORD: *((uint8_t*)dest.addr) = (*((uint16_t*)source.addr)) & 0x00ff; break; + case DT_DOUBLE_WORD: *((uint8_t*)dest.addr) = (*((uint32_t*)source.addr)) & 0x000000ff; break; + case DT_LONG_WORD: *((uint8_t*)dest.addr) = (*((uint64_t*)source.addr)) & U64(0x00000000000000ff); break; } break ; @@ -4836,10 +4836,10 @@ static void SetDestinationValue(typed_pointer source, typed_pointer dest) case DT_WORD: switch(source.data_type) { - case DT_BYTE: *((UINT16*)dest.addr) = (*((UINT8*) source.addr)) & 0xff; break; - case DT_WORD: *((UINT16*)dest.addr) = (*((UINT16*)source.addr)) & 0xffff; break; - case DT_DOUBLE_WORD: *((UINT16*)dest.addr) = (*((UINT32*)source.addr)) & 0x0000ffff; break; - case DT_LONG_WORD: *((UINT16*)dest.addr) = (*((UINT64*)source.addr)) & U64(0x000000000000ffff); break; /* TODO: Shift limiter action! A-147 */ + case DT_BYTE: *((uint16_t*)dest.addr) = (*((uint8_t*) source.addr)) & 0xff; break; + case DT_WORD: *((uint16_t*)dest.addr) = (*((uint16_t*)source.addr)) & 0xffff; break; + case DT_DOUBLE_WORD: *((uint16_t*)dest.addr) = (*((uint32_t*)source.addr)) & 0x0000ffff; break; + case DT_LONG_WORD: *((uint16_t*)dest.addr) = (*((uint64_t*)source.addr)) & U64(0x000000000000ffff); break; /* TODO: Shift limiter action! A-147 */ } break ; @@ -4847,10 +4847,10 @@ static void SetDestinationValue(typed_pointer source, typed_pointer dest) case DT_DOUBLE_WORD: switch(source.data_type) { - case DT_BYTE: *((UINT32*)dest.addr) = (*((UINT8*) source.addr)) & 0xff; break; - case DT_WORD: *((UINT32*)dest.addr) = (*((UINT16*)source.addr)) & 0xffff; break; - case DT_DOUBLE_WORD: *((UINT32*)dest.addr) = (*((UINT32*)source.addr)) & 0xffffffff; break; - case DT_LONG_WORD: *((UINT32*)dest.addr) = (*((UINT64*)source.addr)) & U64(0x00000000ffffffff); break; + case DT_BYTE: *((uint32_t*)dest.addr) = (*((uint8_t*) source.addr)) & 0xff; break; + case DT_WORD: *((uint32_t*)dest.addr) = (*((uint16_t*)source.addr)) & 0xffff; break; + case DT_DOUBLE_WORD: *((uint32_t*)dest.addr) = (*((uint32_t*)source.addr)) & 0xffffffff; break; + case DT_LONG_WORD: *((uint32_t*)dest.addr) = (*((uint64_t*)source.addr)) & U64(0x00000000ffffffff); break; } break ; @@ -4858,46 +4858,46 @@ static void SetDestinationValue(typed_pointer source, typed_pointer dest) case DT_LONG_WORD: switch(source.data_type) { - case DT_BYTE: *((UINT64*)dest.addr) = (*((UINT8*)source.addr)) & 0xff; break; + case DT_BYTE: *((uint64_t*)dest.addr) = (*((uint8_t*)source.addr)) & 0xff; break; - case DT_WORD: destinationValue = (*((UINT16*)source.addr)) << 16; + case DT_WORD: destinationValue = (*((uint16_t*)source.addr)) << 16; if (destinationValue & U64(0x0000000080000000)) destinationValue |= U64(0x000000ff00000000); - *((UINT64*)dest.addr) = (UINT64)destinationValue; break; /* Forget not, yon shift register */ + *((uint64_t*)dest.addr) = (uint64_t)destinationValue; break; /* Forget not, yon shift register */ - case DT_DOUBLE_WORD: *((UINT64*)dest.addr) = (*((UINT32*)source.addr)) & 0xffffffff; break; - case DT_LONG_WORD: *((UINT64*)dest.addr) = (*((UINT64*)source.addr)) & U64(0x000000ffffffffff); break; + case DT_DOUBLE_WORD: *((uint64_t*)dest.addr) = (*((uint32_t*)source.addr)) & 0xffffffff; break; + case DT_LONG_WORD: *((uint64_t*)dest.addr) = (*((uint64_t*)source.addr)) & U64(0x000000ffffffffff); break; } break ; } } /* TODO: Wait-state timings! */ -static void SetDataMemoryValue(dsp56k_core* cpustate, typed_pointer source, UINT32 destinationAddr) +static void SetDataMemoryValue(dsp56k_core* cpustate, typed_pointer source, uint32_t destinationAddr) { switch(source.data_type) { - case DT_BYTE: cpustate->data->write_word(destinationAddr, (UINT16)( (*((UINT8*) source.addr) & 0xff) ) ) ; break ; - case DT_WORD: cpustate->data->write_word(destinationAddr, (UINT16)( (*((UINT16*)source.addr) & 0xffff) ) ) ; break ; - case DT_DOUBLE_WORD: cpustate->data->write_word(destinationAddr, (UINT16)( (*((UINT32*)source.addr) & 0x0000ffff) ) ) ; break ; + case DT_BYTE: cpustate->data->write_word(destinationAddr, (uint16_t)( (*((uint8_t*) source.addr) & 0xff) ) ) ; break ; + case DT_WORD: cpustate->data->write_word(destinationAddr, (uint16_t)( (*((uint16_t*)source.addr) & 0xffff) ) ) ; break ; + case DT_DOUBLE_WORD: cpustate->data->write_word(destinationAddr, (uint16_t)( (*((uint32_t*)source.addr) & 0x0000ffff) ) ) ; break ; /* !!! Is this universal ??? */ /* !!! Forget not, yon shift-limiter !!! */ - case DT_LONG_WORD: cpustate->data->write_word(destinationAddr, (UINT16)( ((*((UINT64*)source.addr)) & U64(0x00000000ffff0000)) >> 16) ) ; break ; + case DT_LONG_WORD: cpustate->data->write_word(destinationAddr, (uint16_t)( ((*((uint64_t*)source.addr)) & U64(0x00000000ffff0000)) >> 16) ) ; break ; } } /* TODO: Wait-state timings! */ -static void SetProgramMemoryValue(dsp56k_core* cpustate, typed_pointer source, UINT32 destinationAddr) +static void SetProgramMemoryValue(dsp56k_core* cpustate, typed_pointer source, uint32_t destinationAddr) { switch(source.data_type) { - case DT_BYTE: cpustate->program->write_word(destinationAddr, (UINT16)( (*((UINT8*) source.addr) & 0xff) ) ) ; break ; - case DT_WORD: cpustate->program->write_word(destinationAddr, (UINT16)( (*((UINT16*)source.addr) & 0xffff) ) ) ; break ; - case DT_DOUBLE_WORD: cpustate->program->write_word(destinationAddr, (UINT16)( (*((UINT32*)source.addr) & 0x0000ffff) ) ) ; break ; + case DT_BYTE: cpustate->program->write_word(destinationAddr, (uint16_t)( (*((uint8_t*) source.addr) & 0xff) ) ) ; break ; + case DT_WORD: cpustate->program->write_word(destinationAddr, (uint16_t)( (*((uint16_t*)source.addr) & 0xffff) ) ) ; break ; + case DT_DOUBLE_WORD: cpustate->program->write_word(destinationAddr, (uint16_t)( (*((uint32_t*)source.addr) & 0x0000ffff) ) ) ; break ; /* !!! Is this universal ??? */ /* !!! Forget not, yon shift-limiter !!! */ - case DT_LONG_WORD: cpustate->program->write_word(destinationAddr, (UINT16)( ((*((UINT64*)source.addr)) & U64(0x00000000ffff0000)) >> 16) ) ; break ; + case DT_LONG_WORD: cpustate->program->write_word(destinationAddr, (uint16_t)( ((*((uint64_t*)source.addr)) & U64(0x00000000ffff0000)) >> 16) ) ; break ; } } diff --git a/src/devices/cpu/dsp56k/dsp56pcu.cpp b/src/devices/cpu/dsp56k/dsp56pcu.cpp index 5bfe52cd242..2c7da64c1ed 100644 --- a/src/devices/cpu/dsp56k/dsp56pcu.cpp +++ b/src/devices/cpu/dsp56k/dsp56pcu.cpp @@ -14,34 +14,34 @@ namespace DSP56K /* |-------------------------------------| |-------------------------------| */ /* */ /* ************************************************************************* */ -UINT8 LF_bit(const dsp56k_core* cpustate) { return (SR & 0x8000) >> 15; } -UINT8 FV_bit(const dsp56k_core* cpustate) { return (SR & 0x4000) >> 14; } -// UINT8 S_bits(const dsp56k_core* cpustate) { return (SR & 0x0c00) >> 10; } -UINT8 I_bits(const dsp56k_core* cpustate) { return (SR & 0x0300) >> 8; } -UINT8 S_bit (const dsp56k_core* cpustate) { return (SR & 0x0080) >> 7; } -UINT8 L_bit (const dsp56k_core* cpustate) { return (SR & 0x0040) >> 6; } -UINT8 E_bit (const dsp56k_core* cpustate) { return (SR & 0x0020) >> 5; } -UINT8 U_bit (const dsp56k_core* cpustate) { return (SR & 0x0010) >> 4; } -UINT8 N_bit (const dsp56k_core* cpustate) { return (SR & 0x0008) >> 3; } -UINT8 Z_bit (const dsp56k_core* cpustate) { return (SR & 0x0004) >> 2; } -UINT8 V_bit (const dsp56k_core* cpustate) { return (SR & 0x0002) >> 1; } -UINT8 C_bit (const dsp56k_core* cpustate) { return (SR & 0x0001) >> 0; } +uint8_t LF_bit(const dsp56k_core* cpustate) { return (SR & 0x8000) >> 15; } +uint8_t FV_bit(const dsp56k_core* cpustate) { return (SR & 0x4000) >> 14; } +// uint8_t S_bits(const dsp56k_core* cpustate) { return (SR & 0x0c00) >> 10; } +uint8_t I_bits(const dsp56k_core* cpustate) { return (SR & 0x0300) >> 8; } +uint8_t S_bit (const dsp56k_core* cpustate) { return (SR & 0x0080) >> 7; } +uint8_t L_bit (const dsp56k_core* cpustate) { return (SR & 0x0040) >> 6; } +uint8_t E_bit (const dsp56k_core* cpustate) { return (SR & 0x0020) >> 5; } +uint8_t U_bit (const dsp56k_core* cpustate) { return (SR & 0x0010) >> 4; } +uint8_t N_bit (const dsp56k_core* cpustate) { return (SR & 0x0008) >> 3; } +uint8_t Z_bit (const dsp56k_core* cpustate) { return (SR & 0x0004) >> 2; } +uint8_t V_bit (const dsp56k_core* cpustate) { return (SR & 0x0002) >> 1; } +uint8_t C_bit (const dsp56k_core* cpustate) { return (SR & 0x0001) >> 0; } /* MR setters */ -void LF_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x8000); else (SR &= (~0x8000)); } -void FV_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x4000); else (SR &= (~0x4000)); } -void S_bits_set(dsp56k_core* cpustate, UINT8 value) { value = value & 0x03; SR &= ~(0x0c00); SR |= (value << 10); } -void I_bits_set(dsp56k_core* cpustate, UINT8 value) { value = value & 0x03; SR &= ~(0x0300); SR |= (value << 8); } +void LF_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x8000); else (SR &= (~0x8000)); } +void FV_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x4000); else (SR &= (~0x4000)); } +void S_bits_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x03; SR &= ~(0x0c00); SR |= (value << 10); } +void I_bits_set(dsp56k_core* cpustate, uint8_t value) { value = value & 0x03; SR &= ~(0x0300); SR |= (value << 8); } /* CCR setters */ -void S_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x0080); else (SR &= (~0x0080)); } -void L_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x0040); else (SR &= (~0x0040)); } -void E_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x0020); else (SR &= (~0x0020)); } -void U_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x0010); else (SR &= (~0x0010)); } -void N_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x0008); else (SR &= (~0x0008)); } -void Z_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x0004); else (SR &= (~0x0004)); } -void V_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x0002); else (SR &= (~0x0002)); } -void C_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x0001); else (SR &= (~0x0001)); } +void S_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x0080); else (SR &= (~0x0080)); } +void L_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x0040); else (SR &= (~0x0040)); } +void E_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x0020); else (SR &= (~0x0020)); } +void U_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x0010); else (SR &= (~0x0010)); } +void N_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x0008); else (SR &= (~0x0008)); } +void Z_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x0004); else (SR &= (~0x0004)); } +void V_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x0002); else (SR &= (~0x0002)); } +void C_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (SR |= 0x0001); else (SR &= (~0x0001)); } @@ -54,23 +54,23 @@ void C_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (SR |= 0x0001); /* |---------------------------------------------------------------------| */ /* */ /* ************************************************************************* */ -// UINT8 CD_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0080) != 0); } -// UINT8 SD_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0040) != 0); } -// UINT8 R_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0020) != 0); } -// UINT8 SA_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0010) != 0); } -// UINT8 MC_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0004) != 0); } -UINT8 MB_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0002) != 0); } -UINT8 MA_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0001) != 0); } - -void CD_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (OMR |= 0x0080); else (OMR &= (~0x0080)); } -void SD_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (OMR |= 0x0040); else (OMR &= (~0x0040)); } -void R_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (OMR |= 0x0020); else (OMR &= (~0x0020)); } -void SA_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (OMR |= 0x0010); else (OMR &= (~0x0010)); } -void MC_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (OMR |= 0x0004); else (OMR &= (~0x0004)); } -void MB_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (OMR |= 0x0002); else (OMR &= (~0x0002)); } -void MA_bit_set(dsp56k_core* cpustate, UINT8 value) { if (value) (OMR |= 0x0001); else (OMR &= (~0x0001)); } - -UINT8 dsp56k_operating_mode(const dsp56k_core* cpustate) +// uint8_t CD_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0080) != 0); } +// uint8_t SD_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0040) != 0); } +// uint8_t R_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0020) != 0); } +// uint8_t SA_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0010) != 0); } +// uint8_t MC_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0004) != 0); } +uint8_t MB_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0002) != 0); } +uint8_t MA_bit(const dsp56k_core* cpustate) { return ((OMR & 0x0001) != 0); } + +void CD_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (OMR |= 0x0080); else (OMR &= (~0x0080)); } +void SD_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (OMR |= 0x0040); else (OMR &= (~0x0040)); } +void R_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (OMR |= 0x0020); else (OMR &= (~0x0020)); } +void SA_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (OMR |= 0x0010); else (OMR &= (~0x0010)); } +void MC_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (OMR |= 0x0004); else (OMR &= (~0x0004)); } +void MB_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (OMR |= 0x0002); else (OMR &= (~0x0002)); } +void MA_bit_set(dsp56k_core* cpustate, uint8_t value) { if (value) (OMR |= 0x0001); else (OMR &= (~0x0001)); } + +uint8_t dsp56k_operating_mode(const dsp56k_core* cpustate) { return ((MB_bit(cpustate) << 1) | MA_bit(cpustate)); } @@ -86,11 +86,11 @@ UINT8 dsp56k_operating_mode(const dsp56k_core* cpustate) /* |---------------------------------------------------------------------| */ /* */ /* ************************************************************************* */ -UINT8 UF_bit(const dsp56k_core* cpustate) { return ((SP & 0x0020) != 0); } -UINT8 SE_bit(const dsp56k_core* cpustate) { return ((SP & 0x0010) != 0); } +uint8_t UF_bit(const dsp56k_core* cpustate) { return ((SP & 0x0020) != 0); } +uint8_t SE_bit(const dsp56k_core* cpustate) { return ((SP & 0x0010) != 0); } -//void UF_bit_set(dsp56k_core* cpustate, UINT8 value) {}; -//void SE_bit_set(dsp56k_core* cpustate, UINT8 value) {}; +//void UF_bit_set(dsp56k_core* cpustate, uint8_t value) {}; +//void SE_bit_set(dsp56k_core* cpustate, uint8_t value) {}; @@ -137,7 +137,7 @@ void pcu_reset(dsp56k_core* cpustate) /* This, in actuality, is handled with the internal boot ROM. */ for (i = 0; i < 0x800; i++) { - UINT32 mem_offset = (0xc000<<1) + (i<<1); /* TODO: TEST */ + uint32_t mem_offset = (0xc000<<1) + (i<<1); /* TODO: TEST */ /* TODO - DO I HAVE TO FLIP THIS WORD? */ /* P:$c000 -> Internal P:$0000 low byte */ @@ -145,8 +145,8 @@ void pcu_reset(dsp56k_core* cpustate) /* ... */ /* P:$cffe -> Internal P:$07ff low byte */ /* P:$cfff -> Internal P:$07ff high byte */ - UINT8 mem_value_low = cpustate->program->read_byte(mem_offset); /* TODO: IS THIS READING RIGHT? */ - UINT8 mem_value_high = cpustate->program->read_byte(mem_offset); + uint8_t mem_value_low = cpustate->program->read_byte(mem_offset); /* TODO: IS THIS READING RIGHT? */ + uint8_t mem_value_high = cpustate->program->read_byte(mem_offset); cpustate->program_ram[i] = (mem_value_high << 8) || mem_value_low; } @@ -239,7 +239,7 @@ void pcu_reset(dsp56k_core* cpustate) ***************************************************************************/ struct dsp56k_irq_data { - UINT16 irq_vector; + uint16_t irq_vector; char irq_source[128]; }; @@ -266,7 +266,7 @@ void pcu_service_interrupts(dsp56k_core* cpustate) const int interrupt_index = cpustate->PCU.pending_interrupts[i]; /* Get the priority of the interrupt - a return value of -1 means disabled! */ - INT8 priority = dsp56k_get_irq_priority(cpustate, interrupt_index); + int8_t priority = dsp56k_get_irq_priority(cpustate, interrupt_index); /* 1-12 Make sure you're not masked out against the Interrupt Mask Bits (disabled is handled for free here) */ if (priority >= I_bits(cpustate)) @@ -283,7 +283,7 @@ void pcu_service_interrupts(dsp56k_core* cpustate) else { /* The host command input has a floating vector. */ - const UINT16 irq_vector = HV_bits(cpustate) << 1; + const uint16_t irq_vector = HV_bits(cpustate) << 1; PC = irq_vector; @@ -314,7 +314,7 @@ void dsp56k_add_pending_interrupt(dsp56k_core* cpustate, const char* name) } /* Utility function to construct IRQ table */ -void dsp56k_set_irq_source(UINT8 irq_num, UINT16 iv, const char* source) +void dsp56k_set_irq_source(uint8_t irq_num, uint16_t iv, const char* source) { dsp56k_interrupt_sources[irq_num].irq_vector = iv; strcpy(dsp56k_interrupt_sources[irq_num].irq_source, source); @@ -420,7 +420,7 @@ void dsp56k_sort_pending_interrupts(dsp56k_core* cpustate, int num) } /* Given an index into the irq table, return the interrupt's current priority */ -INT8 dsp56k_get_irq_priority(dsp56k_core* cpustate, int index) +int8_t dsp56k_get_irq_priority(dsp56k_core* cpustate, int index) { /* 1-12 */ switch (index) diff --git a/src/devices/cpu/dsp56k/dsp56pcu.h b/src/devices/cpu/dsp56k/dsp56pcu.h index b3b83109a35..6e640af3839 100644 --- a/src/devices/cpu/dsp56k/dsp56pcu.h +++ b/src/devices/cpu/dsp56k/dsp56pcu.h @@ -42,87 +42,87 @@ void pcu_init(dsp56k_core* cpustate, device_t *device); /* STATUS REGISTER (SR) BITS (1-25) */ /* MR */ -UINT8 LF_bit(const dsp56k_core* cpustate); -UINT8 FV_bit(const dsp56k_core* cpustate); -//UINT8 S_bits(const dsp56k_core* cpustate); -UINT8 I_bits(const dsp56k_core* cpustate); +uint8_t LF_bit(const dsp56k_core* cpustate); +uint8_t FV_bit(const dsp56k_core* cpustate); +//uint8_t S_bits(const dsp56k_core* cpustate); +uint8_t I_bits(const dsp56k_core* cpustate); /* CCR - with macros for easy access */ #define S() (S_bit(cpustate)) -UINT8 S_bit(const dsp56k_core* cpustate); +uint8_t S_bit(const dsp56k_core* cpustate); #define L() (L_bit(cpustate)) -UINT8 L_bit(const dsp56k_core* cpustate); +uint8_t L_bit(const dsp56k_core* cpustate); #define E() (E_bit(cpustate)) -UINT8 E_bit(const dsp56k_core* cpustate); +uint8_t E_bit(const dsp56k_core* cpustate); #define U() (U_bit(cpustate)) -UINT8 U_bit(const dsp56k_core* cpustate); +uint8_t U_bit(const dsp56k_core* cpustate); #define N() (N_bit(cpustate)) -UINT8 N_bit(const dsp56k_core* cpustate); +uint8_t N_bit(const dsp56k_core* cpustate); #define Z() (Z_bit(cpustate)) -UINT8 Z_bit(const dsp56k_core* cpustate); +uint8_t Z_bit(const dsp56k_core* cpustate); #define V() (V_bit(cpustate)) -UINT8 V_bit(const dsp56k_core* cpustate); +uint8_t V_bit(const dsp56k_core* cpustate); #define C() (C_bit(cpustate)) -UINT8 C_bit(const dsp56k_core* cpustate); +uint8_t C_bit(const dsp56k_core* cpustate); /* MR setters */ -void LF_bit_set(dsp56k_core* cpustate, UINT8 value); -void FV_bit_set(dsp56k_core* cpustate, UINT8 value); -void S_bits_set(dsp56k_core* cpustate, UINT8 value); -void I_bits_set(dsp56k_core* cpustate, UINT8 value); +void LF_bit_set(dsp56k_core* cpustate, uint8_t value); +void FV_bit_set(dsp56k_core* cpustate, uint8_t value); +void S_bits_set(dsp56k_core* cpustate, uint8_t value); +void I_bits_set(dsp56k_core* cpustate, uint8_t value); /* CCR setters - with macros for easy access */ #define DSP56K_S_SET() (S_bit_set(cpustate, 1)) #define DSP56K_S_CLEAR() (S_bit_set(cpustate, 0)) -void S_bit_set(dsp56k_core* cpustate, UINT8 value); +void S_bit_set(dsp56k_core* cpustate, uint8_t value); #define DSP56K_L_SET() (L_bit_set(cpustate, 1)) #define DSP56K_L_CLEAR() (L_bit_set(cpustate, 0)) -void L_bit_set(dsp56k_core* cpustate, UINT8 value); +void L_bit_set(dsp56k_core* cpustate, uint8_t value); #define DSP56K_E_SET() (E_bit_set(cpustate, 1)) #define DSP56K_E_CLEAR() (E_bit_set(cpustate, 0)) -void E_bit_set(dsp56k_core* cpustate, UINT8 value); +void E_bit_set(dsp56k_core* cpustate, uint8_t value); #define DSP56K_U_SET() (U_bit_set(cpustate, 1)) #define DSP56K_U_CLEAR() (U_bit_set(cpustate, 0)) -void U_bit_set(dsp56k_core* cpustate, UINT8 value); +void U_bit_set(dsp56k_core* cpustate, uint8_t value); #define DSP56K_N_SET() (N_bit_set(cpustate, 1)) #define DSP56K_N_CLEAR() (N_bit_set(cpustate, 0)) -void N_bit_set(dsp56k_core* cpustate, UINT8 value); +void N_bit_set(dsp56k_core* cpustate, uint8_t value); #define DSP56K_Z_SET() (Z_bit_set(cpustate, 1)) #define DSP56K_Z_CLEAR() (Z_bit_set(cpustate, 0)) -void Z_bit_set(dsp56k_core* cpustate, UINT8 value); +void Z_bit_set(dsp56k_core* cpustate, uint8_t value); #define DSP56K_V_SET() (V_bit_set(cpustate, 1)) #define DSP56K_V_CLEAR() (V_bit_set(cpustate, 0)) -void V_bit_set(dsp56k_core* cpustate, UINT8 value); +void V_bit_set(dsp56k_core* cpustate, uint8_t value); #define DSP56K_C_SET() (C_bit_set(cpustate, 1)) #define DSP56K_C_CLEAR() (C_bit_set(cpustate, 0)) -void C_bit_set(dsp56k_core* cpustate, UINT8 value); +void C_bit_set(dsp56k_core* cpustate, uint8_t value); // TODO: Maybe some functions for Interrupt Mask and Scaling Mode go here? /* 1-28 OPERATING MODE REGISTER (OMR) BITS */ -//UINT8 CD_bit(const dsp56k_core* cpustate); -//UINT8 SD_bit(const dsp56k_core* cpustate); -//UINT8 R_bit(const dsp56k_core* cpustate); -//UINT8 SA_bit(const dsp56k_core* cpustate); -//UINT8 MC_bit(const dsp56k_core* cpustate); -UINT8 MB_bit(const dsp56k_core* cpustate); -UINT8 MA_bit(const dsp56k_core* cpustate); - -void CD_bit_set(dsp56k_core* cpustate, UINT8 value); -void SD_bit_set(dsp56k_core* cpustate, UINT8 value); -void R_bit_set(dsp56k_core* cpustate, UINT8 value); -void SA_bit_set(dsp56k_core* cpustate, UINT8 value); -void MC_bit_set(dsp56k_core* cpustate, UINT8 value); -void MB_bit_set(dsp56k_core* cpustate, UINT8 value); -void MA_bit_set(dsp56k_core* cpustate, UINT8 value); +//uint8_t CD_bit(const dsp56k_core* cpustate); +//uint8_t SD_bit(const dsp56k_core* cpustate); +//uint8_t R_bit(const dsp56k_core* cpustate); +//uint8_t SA_bit(const dsp56k_core* cpustate); +//uint8_t MC_bit(const dsp56k_core* cpustate); +uint8_t MB_bit(const dsp56k_core* cpustate); +uint8_t MA_bit(const dsp56k_core* cpustate); + +void CD_bit_set(dsp56k_core* cpustate, uint8_t value); +void SD_bit_set(dsp56k_core* cpustate, uint8_t value); +void R_bit_set(dsp56k_core* cpustate, uint8_t value); +void SA_bit_set(dsp56k_core* cpustate, uint8_t value); +void MC_bit_set(dsp56k_core* cpustate, uint8_t value); +void MB_bit_set(dsp56k_core* cpustate, uint8_t value); +void MA_bit_set(dsp56k_core* cpustate, uint8_t value); /* 1-27 STACK POINTER (SP) BITS */ -UINT8 UF_bit(const dsp56k_core* cpustate); -UINT8 SE_bit(const dsp56k_core* cpustate); +uint8_t UF_bit(const dsp56k_core* cpustate); +uint8_t SE_bit(const dsp56k_core* cpustate); -//void UF_bit_set(dsp56k_core* cpustate, UINT8 value) {}; -//void SE_bit_set(dsp56k_core* cpustate, UINT8 value) {}; +//void UF_bit_set(dsp56k_core* cpustate, uint8_t value) {}; +//void SE_bit_set(dsp56k_core* cpustate, uint8_t value) {}; // HACK - Bootstrap modes @@ -135,7 +135,7 @@ UINT8 SE_bit(const dsp56k_core* cpustate); void pcu_service_interrupts(dsp56k_core* cpustate); void dsp56k_irq_table_init(void); -void dsp56k_set_irq_source(UINT8 irq_num, UINT16 iv, const char* source); +void dsp56k_set_irq_source(uint8_t irq_num, uint16_t iv, const char* source); int dsp56k_get_irq_index_by_tag(const char* tag); void dsp56k_add_pending_interrupt(dsp56k_core* cpustate, const char* name); // Call me to add an interrupt to the queue @@ -143,7 +143,7 @@ void dsp56k_add_pending_interrupt(dsp56k_core* cpustate, const char* name); void dsp56k_clear_pending_interrupts(dsp56k_core* cpustate); int dsp56k_count_pending_interrupts(dsp56k_core* cpustate); void dsp56k_sort_pending_interrupts(dsp56k_core* cpustate, int num); -INT8 dsp56k_get_irq_priority(dsp56k_core* cpustate, int index); +int8_t dsp56k_get_irq_priority(dsp56k_core* cpustate, int index); } // namespace DSP56K diff --git a/src/devices/cpu/dsp56k/inst.cpp b/src/devices/cpu/dsp56k/inst.cpp index c7e6e2e6756..c07320fc5b3 100644 --- a/src/devices/cpu/dsp56k/inst.cpp +++ b/src/devices/cpu/dsp56k/inst.cpp @@ -7,12 +7,12 @@ namespace DSP56K { // Factory std::unique_ptr Instruction::decodeInstruction(const Opcode* opc, - const UINT16 word0, - const UINT16 word1, + const uint16_t word0, + const uint16_t word1, bool shifted) { - UINT16 w0 = word0; - UINT16 w1 = word1; + uint16_t w0 = word0; + uint16_t w1 = word1; if (shifted) { diff --git a/src/devices/cpu/dsp56k/inst.h b/src/devices/cpu/dsp56k/inst.h index 93da87f8d15..91a624f030a 100644 --- a/src/devices/cpu/dsp56k/inst.h +++ b/src/devices/cpu/dsp56k/inst.h @@ -30,7 +30,7 @@ public: m_destination(iINVALID) { } virtual ~Instruction() {} - virtual bool decode(const UINT16 word0, const UINT16 word1) = 0; + virtual bool decode(const uint16_t word0, const uint16_t word1) = 0; virtual void disassemble(std::string& retString) const = 0; virtual void evaluate(dsp56k_core* cpustate) = 0; @@ -40,8 +40,8 @@ public: virtual size_t flags() const { return 0; } static std::unique_ptr decodeInstruction(const Opcode* opc, - const UINT16 word0, - const UINT16 word1, + const uint16_t word0, + const uint16_t word1, bool shifted=false); bool valid() const { return m_valid; } @@ -70,11 +70,11 @@ protected: class Abs: public Instruction { public: - Abs(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Abs(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -92,11 +92,11 @@ public: class Adc: public Instruction { public: - Adc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Adc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_JF_table(BITSn(word0,0x0001), BITSn(word0,0x0008), m_source, m_destination); @@ -115,11 +115,11 @@ public: class Add: public Instruction { public: - Add(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Add(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_JJJF_table(BITSn(word0,0x07), BITSn(word0,0x08), m_source, m_destination); @@ -139,13 +139,13 @@ public: class Add_2: public Instruction { public: - Add_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Add_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_arg = ""; m_opcode = ""; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_uuuuF_table(BITSn(word0,0x17), BITSn(word0,0x08), m_opcode, m_source, m_destination); @@ -169,11 +169,11 @@ private: class And: public Instruction { public: - And(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + And(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_JJF_table(BITSn(word0,0x03),BITSn(word0,0x08), m_source, m_destination); @@ -192,12 +192,12 @@ public: class Andi: public Instruction { public: - Andi(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Andi(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_immediate = BITSn(word0,0x00ff); decode_EE_table(BITSn(word0,0x0600), m_destination); @@ -215,18 +215,18 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT8 m_immediate; + uint8_t m_immediate; }; // ASL : .... .... 0011 F001 : A-28 //////////////////////////////////////////// class Asl: public Instruction { public: - Asl(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Asl(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -244,11 +244,11 @@ public: class Asl4: public Instruction { public: - Asl4(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Asl4(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x0008), m_destination); return true; @@ -266,11 +266,11 @@ public: class Asr: public Instruction { public: - Asr(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Asr(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -288,11 +288,11 @@ public: class Asr4: public Instruction { public: - Asr4(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Asr4(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x0008), m_destination); return true; @@ -310,11 +310,11 @@ public: class Asr16: public Instruction { public: - Asr16(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Asr16(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x0008), m_destination); return true; @@ -336,14 +336,14 @@ public: class BfInstruction: public Instruction { public: - BfInstruction(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + BfInstruction(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { dString = ""; m_opcode = ""; m_iVal = 0x0000; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { /* Decode the common parts */ m_iVal = BITSn(word1,0x00ff); @@ -384,7 +384,7 @@ public: size_t size() const override { return 2; } size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT16 m_iVal; + uint16_t m_iVal; std::string m_opcode; std::string dString; }; @@ -397,14 +397,14 @@ private: class BfInstruction_2: public Instruction { public: - BfInstruction_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + BfInstruction_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_opcode = ""; m_r = iINVALID; m_iVal = 0x0000; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { /* Decode the common parts */ m_iVal = BITSn(word1,0x00ff); @@ -452,7 +452,7 @@ public: private: reg_id m_r; - UINT16 m_iVal; + uint16_t m_iVal; std::string m_opcode; }; @@ -464,13 +464,13 @@ private: class BfInstruction_3: public Instruction { public: - BfInstruction_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + BfInstruction_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_opcode = ""; m_iVal = 0x0000; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { /* Decode the common parts */ m_iVal = BITSn(word1,0x00ff); @@ -514,7 +514,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT16 m_iVal; + uint16_t m_iVal; std::string m_opcode; }; @@ -522,15 +522,15 @@ private: class Bcc: public Instruction { public: - Bcc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bcc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_immediate = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - m_immediate = (INT16)word1; + m_immediate = (int16_t)word1; decode_cccc_table(BITSn(word0,0x000f), m_mnem); return true; } @@ -541,7 +541,7 @@ public: char temp[32]; sprintf(temp, ">*+$%x", 2 + m_immediate); - // NEW // sprintf(temp, "$%04x (%d)", pc + 2 + (INT16)word1, (INT16)word1); + // NEW // sprintf(temp, "$%04x (%d)", pc + 2 + (int16_t)word1, (int16_t)word1); retString = opcode + " " + std::string(temp); } void evaluate(dsp56k_core* cpustate) override {} @@ -550,20 +550,20 @@ public: private: op_mnem m_mnem; - INT16 m_immediate; + int16_t m_immediate; }; // Bcc : 0010 11cc ccee eeee : A-48 //////////////////////////////////////////// class Bcc_2: public Instruction { public: - Bcc_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bcc_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_cccc_table(BITSn(word0,0x3c0), m_mnem); m_immediate = get_6_bit_signed_value(BITSn(word0,0x003f)); @@ -587,19 +587,19 @@ public: private: op_mnem m_mnem; - INT8 m_immediate; + int8_t m_immediate; }; // Bcc : 0000 0111 RR10 cccc : A-48 //////////////////////////////////////////// class Bcc_3: public Instruction { public: - Bcc_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bcc_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_RR_table(BITSn(word0,0x00c0), m_destination); decode_cccc_table(BITSn(word0,0x000f), m_mnem); @@ -623,21 +623,21 @@ private: class Bra: public Instruction { public: - Bra(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bra(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - m_immediate = (INT16)word1; + m_immediate = (int16_t)word1; return true; } void disassemble(std::string& retString) const override { char temp[32]; sprintf(temp, ">*+$%x", 2 + m_immediate); - // NEW // sprintf(temp, "$%04x (%d)", pc + 2 + word1, (INT16)word1); + // NEW // sprintf(temp, "$%04x (%d)", pc + 2 + word1, (int16_t)word1); retString = "bra " + std::string(temp); } void evaluate(dsp56k_core* cpustate) override {} @@ -645,21 +645,21 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT16 m_immediate; + int16_t m_immediate; }; // BRA : 0000 1011 aaaa aaaa : A-50 //////////////////////////////////////////// class Bra_2: public Instruction { public: - Bra_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bra_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - m_immediate = (INT8)BITSn(word0,0x00ff); + m_immediate = (int8_t)BITSn(word0,0x00ff); return true; } void disassemble(std::string& retString) const override @@ -675,18 +675,18 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_immediate; + int8_t m_immediate; }; // BRA : 0000 0001 0010 11RR : A-50 //////////////////////////////////////////// class Bra_3: public Instruction { public: - Bra_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bra_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_RR_table(BITSn(word0,0x0003), m_destination); return true; @@ -704,12 +704,12 @@ public: class Brkcc: public Instruction { public: - Brkcc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Brkcc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_cccc_table(BITSn(word0,0x000f), m_mnem); return true; @@ -732,15 +732,15 @@ private: class Bscc: public Instruction { public: - Bscc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bscc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - m_immediate = (INT16)word1; + m_immediate = (int16_t)word1; decode_cccc_table(BITSn(word0,0x000f), m_mnem); return true; } @@ -753,7 +753,7 @@ public: if (m_immediate >= 0) sprintf(temp, ">*+$%x", 2 + m_immediate); else sprintf(temp, ">*-$%x", 1 - m_immediate - 1 - 2); //sprintf(temp, ">*+$%x", 2 + m_immediate); - // NEW // sprintf(temp, "$%04x (%d)", pc + 2 + (INT16)word1, (INT16)word1); + // NEW // sprintf(temp, "$%04x (%d)", pc + 2 + (int16_t)word1, (int16_t)word1); retString = opcode + " " + std::string(temp); } void evaluate(dsp56k_core* cpustate) override {} @@ -763,19 +763,19 @@ public: private: op_mnem m_mnem; - INT16 m_immediate; + int16_t m_immediate; }; // BScc : 0000 0111 RR00 cccc : A-54 /////////////////////////////////////////// class Bscc_2: public Instruction { public: - Bscc_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bscc_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_RR_table(BITSn(word0,0x00c0), m_destination); decode_cccc_table(BITSn(word0,0x000f), m_mnem); @@ -800,14 +800,14 @@ private: class Bsr: public Instruction { public: - Bsr(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bsr(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - m_immediate = (INT16)word1; + m_immediate = (int16_t)word1; return true; } void disassemble(std::string& retString) const override @@ -815,7 +815,7 @@ public: char temp[32]; if (m_immediate >= 0) sprintf(temp, ">*+$%x", 2 + m_immediate); else sprintf(temp, ">*-$%x", 1 - m_immediate - 1 - 2); - // NEW // sprintf(temp, "$%04x (%d)", pc + 2 + (INT16)word1, (INT16)word1); + // NEW // sprintf(temp, "$%04x (%d)", pc + 2 + (int16_t)word1, (int16_t)word1); retString = "bsr " + std::string(temp); } void evaluate(dsp56k_core* cpustate) override {} @@ -824,18 +824,18 @@ public: size_t flags() const override { return DASMFLAG_STEP_OVER; } private: - INT16 m_immediate; + int16_t m_immediate; }; // BSR : 0000 0001 0010 10RR : A-56 //////////////////////////////////////////// class Bsr_2: public Instruction { public: - Bsr_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Bsr_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_RR_table(BITSn(word0,0x0003), m_destination); return true; @@ -854,11 +854,11 @@ public: class Chkaau: public Instruction { public: - Chkaau(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Chkaau(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -875,11 +875,11 @@ public: class Clr: public Instruction { public: - Clr(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Clr(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -897,11 +897,11 @@ public: class Clr24: public Instruction { public: - Clr24(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Clr24(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -919,11 +919,11 @@ public: class Cmp: public Instruction { public: - Cmp(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Cmp(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { /* Note: This is a JJJF limited in the docs, but other opcodes sneak in before cmp, so the same decode function can be used. */ @@ -944,11 +944,11 @@ public: class Cmpm: public Instruction { public: - Cmpm(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Cmpm(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { /* Note: This is a JJJF limited in the docs, but other opcodes sneak in before cmp, so the same decode function can be used. */ @@ -969,11 +969,11 @@ public: class Debug: public Instruction { public: - Debug(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Debug(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -990,12 +990,12 @@ public: class Debugcc: public Instruction { public: - Debugcc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Debugcc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_cccc_table(BITSn(word0,0x000f), m_mnem); return true; @@ -1018,11 +1018,11 @@ private: class Dec: public Instruction { public: - Dec(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Dec(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -1040,11 +1040,11 @@ public: class Dec24: public Instruction { public: - Dec24(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Dec24(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -1062,11 +1062,11 @@ public: class Div: public Instruction { public: - Div(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Div(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_DDF_table(BITSn(word0,0x0003), BITSn(word0,0x0008), m_source, m_destination); @@ -1085,13 +1085,13 @@ public: class Dmac: public Instruction { public: - Dmac(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Dmac(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQF_special_table(BITSn(word0,0x0003), BITSn(word0,0x0008), m_source, m_source2, m_destination); @@ -1122,12 +1122,12 @@ private: class Do: public Instruction { public: - Do(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Do(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_immediate = word1; decode_RR_table(BITSn(word0,0x0003), m_source); @@ -1150,20 +1150,20 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT16 m_immediate; + uint16_t m_immediate; }; // DO : 0000 1110 iiii iiii xxxx xxxx xxxx xxxx : A-82 ///////////////////////// class Do_2: public Instruction { public: - Do_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Do_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_displacement = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_immediate = BITSn(word0,0x00ff); m_displacement = word1; @@ -1181,20 +1181,20 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT8 m_immediate; - UINT16 m_displacement; + uint8_t m_immediate; + uint16_t m_displacement; }; // DO : 0000 0100 000D DDDD xxxx xxxx xxxx xxxx : A-82 ///////////////////////// class Do_3: public Instruction { public: - Do_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Do_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_displacement = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_displacement = word1; @@ -1215,19 +1215,19 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT16 m_displacement; + uint16_t m_displacement; }; // DO FOREVER : 0000 0000 0000 0010 xxxx xxxx xxxx xxxx : A-88 ///////////////// class DoForever: public Instruction { public: - DoForever(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + DoForever(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_displacement = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_displacement = word1; return true; @@ -1245,18 +1245,18 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT16 m_displacement; + uint16_t m_displacement; }; // ENDDO : 0000 0000 0000 1001 : A-92 ////////////////////////////////////////// class Enddo: public Instruction { public: - Enddo(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Enddo(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -1273,11 +1273,11 @@ public: class Eor: public Instruction { public: - Eor(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Eor(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_JJF_table(BITSn(word0,0x03),BITSn(word0,0x08), m_source, m_destination); @@ -1296,11 +1296,11 @@ public: class Ext: public Instruction { public: - Ext(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Ext(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x0008), m_destination); return true; @@ -1318,11 +1318,11 @@ public: class Illegal: public Instruction { public: - Illegal(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Illegal(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -1339,12 +1339,12 @@ public: class Imac: public Instruction { public: - Imac(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Imac(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQQF_table(BITSn(word0,0x0007), BITSn(word0,0x0008), m_source, m_source2, m_destination); @@ -1368,12 +1368,12 @@ private: class Impy: public Instruction { public: - Impy(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Impy(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQQF_table(BITSn(word0,0x0007), BITSn(word0,0x0008), m_source, m_source2, m_destination); @@ -1397,11 +1397,11 @@ private: class Inc: public Instruction { public: - Inc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Inc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -1419,11 +1419,11 @@ public: class Inc24: public Instruction { public: - Inc24(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Inc24(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -1441,13 +1441,13 @@ public: class Jcc: public Instruction { public: - Jcc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Jcc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_displacement = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_displacement = word1; decode_cccc_table(BITSn(word0,0x000f), m_mnem); @@ -1469,19 +1469,19 @@ public: private: op_mnem m_mnem; - UINT16 m_displacement; + uint16_t m_displacement; }; // Jcc : 0000 0110 RR10 cccc : A-108 /////////////////////////////////////////// class Jcc_2: public Instruction { public: - Jcc_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Jcc_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_RR_table(BITSn(word0,0x00c0), m_destination); decode_cccc_table(BITSn(word0,0x000f), m_mnem); @@ -1505,12 +1505,12 @@ private: class Jmp: public Instruction { public: - Jmp(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Jmp(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_displacement = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_displacement = word1; return true; @@ -1534,18 +1534,18 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT16 m_displacement; + uint16_t m_displacement; }; // JMP : 0000 0001 0010 01RR : A-110 /////////////////////////////////////////// class Jmp_2: public Instruction { public: - Jmp_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Jmp_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_RR_table(BITSn(word0,0x0003), m_destination); return true; @@ -1572,13 +1572,13 @@ public: class Jscc: public Instruction { public: - Jscc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Jscc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_displacement = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_displacement = word1; decode_cccc_table(BITSn(word0,0x000f), m_mnem); @@ -1601,19 +1601,19 @@ public: private: op_mnem m_mnem; - UINT16 m_displacement; + uint16_t m_displacement; }; // JScc : 0000 0110 RR00 cccc : A-112 ////////////////////////////////////////// class Jscc_2: public Instruction { public: - Jscc_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Jscc_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_RR_table(BITSn(word0,0x00c0), m_destination); decode_cccc_table(BITSn(word0,0x000f), m_mnem); @@ -1638,12 +1638,12 @@ private: class Jsr: public Instruction { public: - Jsr(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Jsr(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_displacement = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_displacement = word1; return true; @@ -1661,19 +1661,19 @@ public: size_t flags() const override { return DASMFLAG_STEP_OVER; } private: - UINT16 m_displacement; + uint16_t m_displacement; }; // JSR : 0000 1010 AAAA AAAA : A-114 /////////////////////////////////////////// class Jsr_2: public Instruction { public: - Jsr_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Jsr_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_bAddr = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_bAddr = BITSn(word0,0x00ff); return true; @@ -1691,18 +1691,18 @@ public: size_t flags() const override { return DASMFLAG_STEP_OVER; } private: - UINT8 m_bAddr; + uint8_t m_bAddr; }; // JSR : 0000 0001 0010 00RR : A-114 /////////////////////////////////////////// class Jsr_3: public Instruction { public: - Jsr_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Jsr_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_RR_table(BITSn(word0,0x0003), m_destination); return true; @@ -1721,18 +1721,18 @@ public: class Lea: public Instruction { public: - Lea(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Lea(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_ea = ""; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { if ((word0 & 0x000c) == 0) return false; // NEW TODO // decode_TT_table(BITSn(word0,0x0030), m_destination); - INT8 rNum = BITSn(word0,0x0003); + int8_t rNum = BITSn(word0,0x0003); assemble_ea_from_MM_table(BITSn(word0,0x000c), rNum, m_ea); return true; @@ -1754,17 +1754,17 @@ private: class Lea_2: public Instruction { public: - Lea_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Lea_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { if ((word0 & 0x000c) == 0) return false; // NEW TODO // decode_NN_table(BITSn(word0,0x0030), m_destination); - INT8 rNum = BITSn(word0,0x0003); + int8_t rNum = BITSn(word0,0x0003); assemble_ea_from_MM_table(BITSn(word0,0x000c), rNum, m_ea); return true; @@ -1786,11 +1786,11 @@ private: class Lsl: public Instruction { public: - Lsl(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Lsl(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -1808,11 +1808,11 @@ public: class Lsr: public Instruction { public: - Lsr(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Lsr(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -1830,13 +1830,13 @@ public: class Mac: public Instruction { public: - Mac(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Mac(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_sign = ""; m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQQF_table(BITSn(word0,0x07), BITSn(word0,0x08), m_source, m_source2, m_destination); @@ -1866,12 +1866,12 @@ private: class Mac_2: public Instruction { public: - Mac_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Mac_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQF_table(BITSn(word0,0x03), BITSn(word0,0x08), m_source, m_source2, m_destination); @@ -1895,12 +1895,12 @@ private: class Mac_3: public Instruction { public: - Mac_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Mac_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQQF_table(BITSn(word0,0x0007), BITSn(word0,0x0008), m_source, m_source2, m_destination); @@ -1924,13 +1924,13 @@ private: class Macr: public Instruction { public: - Macr(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Macr(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_sign = ""; m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQQF_table(BITSn(word0,0x07), BITSn(word0,0x08), m_source, m_source2, m_destination); @@ -1960,12 +1960,12 @@ private: class Macr_2: public Instruction { public: - Macr_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Macr_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQF_table(BITSn(word0,0x03), BITSn(word0,0x08), m_source, m_source2, m_destination); @@ -1989,13 +1989,13 @@ private: class Macsuuu: public Instruction { public: - Macsuuu(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Macsuuu(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { // Special QQF decode_QQF_special_table(BITSn(word0,0x0003), BITSn(word0,0x0008), @@ -2026,12 +2026,12 @@ private: class Move: public Instruction { public: - Move(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Move(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_isNop = false; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { // Equivalent to a NOP (+ parallel move) @@ -2043,7 +2043,7 @@ public: m_destination = iB; // Hack to match reference disassembler - UINT8 BITSn = (word0 & 0xff00) >> 8; + uint8_t BITSn = (word0 & 0xff00) >> 8; if (BITSn == 0x4a || BITSn == 0x4b) m_isNop = true; @@ -2068,11 +2068,11 @@ private: class Move_2: public Instruction { public: - Move_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Move_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { // Amounts to a nop with two parallel moves. // This insures the debugger matches the reference disassembler @@ -2096,14 +2096,14 @@ public: class Move_3: public Instruction { public: - Move_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Move_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_b = 0; m_SD = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_b = BITSn(word0,0x00ff); m_W = BITSn(word1,0x0100); @@ -2122,8 +2122,8 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_b; - UINT8 m_W; + int8_t m_b; + uint8_t m_W; reg_id m_SD; }; @@ -2131,16 +2131,16 @@ private: class Movec: public Instruction { public: - Movec(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movec(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_ea = ""; m_SD = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - INT8 rNum = BITSn(word0,0x0003); + int8_t rNum = BITSn(word0,0x0003); assemble_ea_from_MM_table(BITSn(word0,0x000c), rNum, m_ea); m_W = BITSn(word0,0x0400); @@ -2161,7 +2161,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_W; + int8_t m_W; reg_id m_SD; std::string m_ea; }; @@ -2170,16 +2170,16 @@ private: class Movec_2: public Instruction { public: - Movec_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movec_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_ea = ""; m_SD = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - INT8 rNum = BITSn(word0,0x0003); + int8_t rNum = BITSn(word0,0x0003); assemble_ea_from_q_table(BITSn(word0,0x0008), rNum, m_ea); decode_DDDDD_table(BITSn(word0,0x03e0), m_SD); @@ -2200,7 +2200,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_W; + int8_t m_W; reg_id m_SD; std::string m_ea; }; @@ -2209,14 +2209,14 @@ private: class Movec_3: public Instruction { public: - Movec_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movec_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_ea = ""; m_SD = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_Z_table(BITSn(word0,0x0008), m_ea); @@ -2238,7 +2238,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_W; + int8_t m_W; reg_id m_SD; std::string m_ea; }; @@ -2247,14 +2247,14 @@ private: class Movec_4: public Instruction { public: - Movec_4(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movec_4(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_t = 0; m_W = 0; m_sd = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_value = word1; m_t = BITSn(word0,0x0008); @@ -2289,7 +2289,7 @@ public: } else { - //UINT16 memValue = memory_read_word_16le(cpustate->data, ADDRESS(m_value)); + //uint16_t memValue = memory_read_word_16le(cpustate->data, ADDRESS(m_value)); //setReg16(cpustate, memValue, m_sd); } } @@ -2301,7 +2301,7 @@ public: } else { - //UINT16 regValue = regValue16(cpustate, m_sd); + //uint16_t regValue = regValue16(cpustate, m_sd); //memory_write_word_16le(cpustate->data, m_value, regValue); } } @@ -2316,9 +2316,9 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT8 m_t; - UINT8 m_W; - UINT16 m_value; + uint8_t m_t; + uint8_t m_W; + uint16_t m_value; reg_id m_sd; }; @@ -2326,11 +2326,11 @@ private: class Movec_5: public Instruction { public: - Movec_5(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movec_5(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_DDDDD_table(BITSn(word0,0x03e0), m_source); decode_DDDDD_table(BITSn(word0,0x001f), m_destination); @@ -2353,7 +2353,7 @@ public: class Movec_6: public Instruction { public: - Movec_6(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movec_6(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_b = 0; @@ -2361,7 +2361,7 @@ public: m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_b = BITSn(word0,0x00ff); m_W = BITSn(word1,0x0400); @@ -2381,8 +2381,8 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_b; - UINT8 m_W; + int8_t m_b; + uint8_t m_W; reg_id m_SD; op_mnem m_mnem; }; @@ -2391,14 +2391,14 @@ private: class Movei: public Instruction { public: - Movei(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movei(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - m_immediate = (INT8)BITSn(word0,0x00ff); + m_immediate = (int8_t)BITSn(word0,0x00ff); decode_DD_table(BITSn(word0,0x0300), m_destination); return true; } @@ -2418,23 +2418,23 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_immediate; + int8_t m_immediate; }; // MOVE(M) : 0000 001W RR0M MHHH : A-152 /////////////////////////////////////// class Movem: public Instruction { public: - Movem(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movem(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_ea = ""; m_SD = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - INT8 rNum = BITSn(word0,0x00c0); + int8_t rNum = BITSn(word0,0x00c0); decode_HHH_table(BITSn(word0,0x0007), m_SD); assemble_ea_from_MM_table(BITSn(word0,0x0018), rNum, m_ea); @@ -2454,7 +2454,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_W; + int8_t m_W; reg_id m_SD; std::string m_ea; }; @@ -2463,14 +2463,14 @@ private: class Movem_2: public Instruction { public: - Movem_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movem_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_ea = ""; m_ea2 = ""; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_W = BITSn(word0,0x0100); assemble_eas_from_mm_table(BITSn(word0,0x000c), BITSn(word0,0x00c0), BITSn(word0,0x0003), m_ea, m_ea2); @@ -2498,7 +2498,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT8 m_W; + uint8_t m_W; std::string m_ea; std::string m_ea2; }; @@ -2507,14 +2507,14 @@ private: class Movem_3: public Instruction { public: - Movem_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movem_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_b = 0; m_SD = iINVALID; m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_b = BITSn(word0,0x00ff); m_W = BITSn(word1,0x0100); @@ -2534,8 +2534,8 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_b; - UINT8 m_W; + int8_t m_b; + uint8_t m_W; reg_id m_SD; op_mnem m_mnem; }; @@ -2544,14 +2544,14 @@ private: class Movep: public Instruction { public: - Movep(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movep(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_ea = ""; m_SD = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_HH_table(BITSn(word0,0x00c0), m_SD); @@ -2574,7 +2574,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_W; + int8_t m_W; reg_id m_SD; std::string m_ea; }; @@ -2583,16 +2583,16 @@ private: class Movep_2: public Instruction { public: - Movep_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Movep_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_ea = ""; m_SD = ""; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - INT8 rNum = BITSn(word0,0x00c0); + int8_t rNum = BITSn(word0,0x00c0); assemble_ea_from_m_table(BITSn(word0,0x0020), rNum, m_ea); @@ -2617,7 +2617,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_W; + int8_t m_W; std::string m_SD; std::string m_ea; }; @@ -2626,14 +2626,14 @@ private: class Moves: public Instruction { public: - Moves(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Moves(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_ea = ""; m_SD = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_HH_table(BITSn(word0,0x00c0), m_SD); @@ -2657,7 +2657,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_W; + int8_t m_W; reg_id m_SD; std::string m_ea; }; @@ -2666,13 +2666,13 @@ private: class Mpy: public Instruction { public: - Mpy(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Mpy(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_sign = ""; m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { /* There are inconsistencies with the S1 & S2 operand ordering in the docs, but since it's a multiply it doesn't matter */ @@ -2704,12 +2704,12 @@ private: class Mpy_2: public Instruction { public: - Mpy_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Mpy_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQF_table(BITSn(word0,0x03), BITSn(word0,0x08), m_source, m_source2, m_destination); @@ -2733,12 +2733,12 @@ private: class Mpy_3: public Instruction { public: - Mpy_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Mpy_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQQF_table(BITSn(word0,0x0007), BITSn(word0,0x0008), m_source, m_source2, m_destination); @@ -2762,13 +2762,13 @@ private: class Mpyr: public Instruction { public: - Mpyr(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Mpyr(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_sign = "-"; m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { /* There are inconsistencies with the S1 & S2 operand ordering in the docs, but since it's a multiply it doesn't matter */ @@ -2800,12 +2800,12 @@ private: class Mpyr_2: public Instruction { public: - Mpyr_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Mpyr_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQF_table(BITSn(word0,0x03), BITSn(word0,0x08), m_source, m_source2, m_destination); @@ -2829,13 +2829,13 @@ private: class Mpysuuu: public Instruction { public: - Mpysuuu(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Mpysuuu(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQF_special_table(BITSn(word0,0x0003), BITSn(word0,0x0008), m_source, m_source2, m_destination); @@ -2865,11 +2865,11 @@ private: class Neg: public Instruction { public: - Neg(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Neg(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -2887,11 +2887,11 @@ public: class Negc: public Instruction { public: - Negc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Negc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x0008), m_destination); return true; @@ -2909,11 +2909,11 @@ public: class Nop: public Instruction { public: - Nop(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Nop(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -2930,11 +2930,11 @@ public: class Norm: public Instruction { public: - Norm(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Norm(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x0008), m_destination); @@ -2954,11 +2954,11 @@ public: class Not: public Instruction { public: - Not(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Not(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -2976,11 +2976,11 @@ public: class Or: public Instruction { public: - Or(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Or(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_JJF_table(BITSn(word0,0x03),BITSn(word0,0x08), m_source, m_destination); @@ -2999,12 +2999,12 @@ public: class Ori: public Instruction { public: - Ori(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Ori(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_immediate = BITSn(word0,0x00ff); decode_EE_table(BITSn(word0,0x0600), m_destination); @@ -3023,18 +3023,18 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT8 m_immediate; + uint8_t m_immediate; }; // REP : 0000 0000 111- --RR : A-180 /////////////////////////////////////////// class Rep: public Instruction { public: - Rep(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Rep(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_RR_table(BITSn(word0,0x0003), m_source); return true; @@ -3054,12 +3054,12 @@ public: class Rep_2: public Instruction { public: - Rep_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Rep_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_immediate = 0; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { m_immediate = BITSn(word0,0x00ff); return true; @@ -3076,18 +3076,18 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - UINT8 m_immediate; + uint8_t m_immediate; }; // REP : 0000 0100 001D DDDD : A-180 /////////////////////////////////////////// class Rep_3: public Instruction { public: - Rep_3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Rep_3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_DDDDD_table(BITSn(word0,0x001f), m_source); if (m_source == iINVALID) return false; @@ -3106,12 +3106,12 @@ public: class Repcc: public Instruction { public: - Repcc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Repcc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_cccc_table(BITSn(word0,0x000f), m_mnem); return true; @@ -3134,11 +3134,11 @@ private: class Reset: public Instruction { public: - Reset(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Reset(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -3155,11 +3155,11 @@ public: class Rnd: public Instruction { public: - Rnd(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Rnd(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -3177,11 +3177,11 @@ public: class Rol: public Instruction { public: - Rol(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Rol(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -3199,11 +3199,11 @@ public: class Ror: public Instruction { public: - Ror(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Ror(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -3221,11 +3221,11 @@ public: class Rti: public Instruction { public: - Rti(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Rti(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -3243,11 +3243,11 @@ public: class Rts: public Instruction { public: - Rts(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Rts(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -3265,11 +3265,11 @@ public: class Sbc: public Instruction { public: - Sbc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Sbc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_JF_table(BITSn(word0,0x01), BITSn(word0,0x08), m_source, m_destination); @@ -3288,11 +3288,11 @@ public: class Stop: public Instruction { public: - Stop(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Stop(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -3309,11 +3309,11 @@ public: class Sub: public Instruction { public: - Sub(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Sub(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_JJJF_table(BITSn(word0,0x07), BITSn(word0,0x08), m_source, m_destination); @@ -3332,12 +3332,12 @@ public: class Sub_2: public Instruction { public: - Sub_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Sub_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_opcode = ""; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_uuuuF_table(BITSn(word0,0x17), BITSn(word0,0x08), m_opcode, m_source, m_destination); @@ -3361,11 +3361,11 @@ private: class Subl: public Instruction { public: - Subl(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Subl(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { /* There is only one option for the F table. This is a very strange opcode. */ if (!BITSn(word0,0x0008)) @@ -3393,11 +3393,11 @@ public: class Swap: public Instruction { public: - Swap(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Swap(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x0008), m_destination); return true; @@ -3415,11 +3415,11 @@ public: class Swi: public Instruction { public: - Swi(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Swi(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -3436,13 +3436,13 @@ public: class Tcc: public Instruction { public: - Tcc(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Tcc(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_mnem = oINVALID; m_destination2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_h0hF_table(BITSn(word0,0x0007),BITSn(word0,0x0008), m_source, m_destination); @@ -3482,11 +3482,11 @@ private: class Tfr: public Instruction { public: - Tfr(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Tfr(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_JJJF_table(BITSn(word0,0x07), BITSn(word0,0x08), m_source, m_destination); @@ -3505,11 +3505,11 @@ public: class Tfr_2: public Instruction { public: - Tfr_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Tfr_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_DDF_table(BITSn(word0,0x03), BITSn(word0,0x08), m_source, m_destination); @@ -3528,11 +3528,11 @@ public: class Tfr2: public Instruction { public: - Tfr2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Tfr2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_JF_table(BITSn(word0,0x0001),BITSn(word0,0x0008), m_destination, m_source); @@ -3551,7 +3551,7 @@ public: class Tfr3: public Instruction { public: - Tfr3(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Tfr3(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_W = 0; m_ea = ""; @@ -3560,7 +3560,7 @@ public: m_destination2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_DDF_table(BITSn(word0,0x0030), BITSn(word0,0x0008), m_destination, m_source); @@ -3569,7 +3569,7 @@ public: // If the destination of the second move is the same as the first, you're invalid if (m_SD == m_destination && BITSn(word0,0x0100)) return false; - INT8 rNum = BITSn(word0,0x00c0); + int8_t rNum = BITSn(word0,0x00c0); assemble_ea_from_m_table(BITSn(word0,0x0200), rNum, m_ea); m_W = BITSn(word0,0x0100); @@ -3589,7 +3589,7 @@ public: size_t accumulatorBitsModified() const override { return BM_HIGH | BM_MIDDLE | BM_LOW; } private: - INT8 m_W; + int8_t m_W; reg_id m_SD; std::string m_ea; reg_id m_source2; @@ -3600,11 +3600,11 @@ private: class Tst: public Instruction { public: - Tst(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Tst(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x08), m_destination); return true; @@ -3622,11 +3622,11 @@ public: class Tst2: public Instruction { public: - Tst2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Tst2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_DD_table(BITSn(word0,0x0003), m_source); return true; @@ -3644,11 +3644,11 @@ public: class Wait: public Instruction { public: - Wait(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Wait(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { return true; } @@ -3665,11 +3665,11 @@ public: class Zero: public Instruction { public: - Zero(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Zero(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_F_table(BITSn(word0,0x0008), m_destination); return true; @@ -3687,12 +3687,12 @@ public: class Shfl: public Instruction { public: - Shfl(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Shfl(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQQF_table(BITSn(word0,0x0007), BITSn(word0,0x0008), m_source, m_source2, m_destination); @@ -3731,12 +3731,12 @@ private: class Shfr: public Instruction { public: - Shfr(const Opcode* oco, const UINT16 word0, const UINT16 word1) : Instruction(oco) + Shfr(const Opcode* oco, const uint16_t word0, const uint16_t word1) : Instruction(oco) { m_source2 = iINVALID; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_QQQF_table(BITSn(word0,0x0007), BITSn(word0,0x0008), m_source, m_source2, m_destination); diff --git a/src/devices/cpu/dsp56k/opcode.cpp b/src/devices/cpu/dsp56k/opcode.cpp index 37a7024b6e3..cdffaba030c 100644 --- a/src/devices/cpu/dsp56k/opcode.cpp +++ b/src/devices/cpu/dsp56k/opcode.cpp @@ -6,7 +6,7 @@ namespace DSP56K { -Opcode::Opcode(UINT16 w0, UINT16 w1) : m_word0(w0)/*, m_word1(w1)*/ +Opcode::Opcode(uint16_t w0, uint16_t w1) : m_word0(w0)/*, m_word1(w1)*/ { m_instruction = Instruction::decodeInstruction(this, w0, w1); m_parallelMove = ParallelMove::decodeParallelMove(this, w0, w1); diff --git a/src/devices/cpu/dsp56k/opcode.h b/src/devices/cpu/dsp56k/opcode.h index ba8c9f2b97c..2fbc1a69d39 100644 --- a/src/devices/cpu/dsp56k/opcode.h +++ b/src/devices/cpu/dsp56k/opcode.h @@ -20,7 +20,7 @@ class ParallelMove; class Opcode { public: - Opcode(UINT16 w0, UINT16 w1); + Opcode(uint16_t w0, uint16_t w1); virtual ~Opcode(); std::string disassemble() const; @@ -37,8 +37,8 @@ private: std::unique_ptr m_instruction; std::unique_ptr m_parallelMove; - UINT16 m_word0; - //UINT16 m_word1; + uint16_t m_word0; + //uint16_t m_word1; std::string dcString() const; }; diff --git a/src/devices/cpu/dsp56k/pmove.cpp b/src/devices/cpu/dsp56k/pmove.cpp index 681acd4dcf6..b57a8850154 100644 --- a/src/devices/cpu/dsp56k/pmove.cpp +++ b/src/devices/cpu/dsp56k/pmove.cpp @@ -9,10 +9,10 @@ const reg_id& ParallelMove::opDestination() const { return m_oco->instDestinatio size_t ParallelMove::opAccumulatorBitsModified() const { return m_oco->instAccumulatorBitsModified(); } -std::unique_ptr ParallelMove::decodeParallelMove(const Opcode* opc, const UINT16 word0, const UINT16 word1) +std::unique_ptr ParallelMove::decodeParallelMove(const Opcode* opc, const uint16_t word0, const uint16_t word1) { - const UINT16 w0 = word0; - const UINT16 w1 = word1; + const uint16_t w0 = word0; + const uint16_t w1 = word1; /* Dual X Memory Data Read : 011m mKKK .rr. .... : A-142*/ if ((w0 & 0xe000) == 0x6000) diff --git a/src/devices/cpu/dsp56k/pmove.h b/src/devices/cpu/dsp56k/pmove.h index f818e4a40b2..8e4ecaa5fde 100644 --- a/src/devices/cpu/dsp56k/pmove.h +++ b/src/devices/cpu/dsp56k/pmove.h @@ -20,11 +20,11 @@ public: ParallelMove(const Opcode* oco) : m_valid(false), m_oco(oco) { } virtual ~ParallelMove() {} - virtual bool decode(const UINT16 word0, const UINT16 word1) = 0; + virtual bool decode(const uint16_t word0, const uint16_t word1) = 0; virtual void disassemble(std::string& retString) const = 0; virtual void evaluate() = 0; - static std::unique_ptr decodeParallelMove(const Opcode* opc, const UINT16 word0, const UINT16 word1); + static std::unique_ptr decodeParallelMove(const Opcode* opc, const uint16_t word0, const uint16_t word1); bool valid() const { return m_valid; } @@ -47,11 +47,11 @@ protected: class XMemoryDataMove: public ParallelMove { public: - XMemoryDataMove(const Opcode* oco, const UINT16 word0, const UINT16 word1) : ParallelMove(oco) + XMemoryDataMove(const Opcode* oco, const uint16_t word0, const uint16_t word1) : ParallelMove(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { reg_id r; decode_RR_table(BITSn(word0,0x3000), r); @@ -87,11 +87,11 @@ private: class XMemoryDataMove_2: public ParallelMove { public: - XMemoryDataMove_2(const Opcode* oco, const UINT16 word0, const UINT16 word1) : ParallelMove(oco) + XMemoryDataMove_2(const Opcode* oco, const uint16_t word0, const uint16_t word1) : ParallelMove(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { std::string ea; if (opDestination() == iB) @@ -129,11 +129,11 @@ private: class DualXMemoryDataRead: public ParallelMove { public: - DualXMemoryDataRead(const Opcode* oco, const UINT16 word0, const UINT16 word1) : ParallelMove(oco) + DualXMemoryDataRead(const Opcode* oco, const uint16_t word0, const uint16_t word1) : ParallelMove(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { reg_id r; reg_id D1; @@ -183,11 +183,11 @@ private: class RegisterToRegisterDataMove: public ParallelMove { public: - RegisterToRegisterDataMove(const Opcode* oco, const UINT16 word0, const UINT16 word1) : ParallelMove(oco) + RegisterToRegisterDataMove(const Opcode* oco, const uint16_t word0, const uint16_t word1) : ParallelMove(oco) { m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { decode_IIIIx_table(BITSn(word0,0x0f00), BITSn(word0,0x0008), m_source, m_destination); @@ -234,13 +234,13 @@ private: class XMemoryDataWriteAndRegisterDataMove: public ParallelMove { public: - XMemoryDataWriteAndRegisterDataMove(const Opcode* oco, const UINT16 word0, const UINT16 word1) : ParallelMove(oco) + XMemoryDataWriteAndRegisterDataMove(const Opcode* oco, const uint16_t word0, const uint16_t word1) : ParallelMove(oco) { pms = ""; pms2 = ""; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { reg_id r; reg_id S; @@ -277,12 +277,12 @@ private: class AddressRegisterUpdate: public ParallelMove { public: - AddressRegisterUpdate(const Opcode* oco, const UINT16 word0, const UINT16 word1) : ParallelMove(oco) + AddressRegisterUpdate(const Opcode* oco, const uint16_t word0, const uint16_t word1) : ParallelMove(oco) { m_ea = ""; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { reg_id r; decode_RR_table(BITSn(word0,0x0300), r); @@ -305,15 +305,15 @@ private: class XMemoryDataMoveWithShortDisplacement: public ParallelMove { public: - XMemoryDataMoveWithShortDisplacement(const Opcode* oco, const UINT16 word0, const UINT16 word1) : ParallelMove(oco) + XMemoryDataMoveWithShortDisplacement(const Opcode* oco, const uint16_t word0, const uint16_t word1) : ParallelMove(oco) { m_source = ""; m_destination = ""; m_valid = decode(word0, word1); } - bool decode(const UINT16 word0, const UINT16 word1) override + bool decode(const uint16_t word0, const uint16_t word1) override { - INT8 b; + int8_t b; reg_id SD; b = (char)(word0 & 0x00ff); decode_HHH_table(BITSn(word1,0x0e00), SD); diff --git a/src/devices/cpu/dsp56k/tables.cpp b/src/devices/cpu/dsp56k/tables.cpp index 5837580409e..72a46bfa0ee 100644 --- a/src/devices/cpu/dsp56k/tables.cpp +++ b/src/devices/cpu/dsp56k/tables.cpp @@ -12,7 +12,7 @@ namespace DSP56K /******************/ /* Table decoding */ /******************/ -bfShift decode_BBB_table(UINT16 BBB) +bfShift decode_BBB_table(uint16_t BBB) { switch(BBB) { @@ -24,7 +24,7 @@ bfShift decode_BBB_table(UINT16 BBB) return BBB_INVALID; } -void decode_cccc_table(const UINT16 cccc, op_mnem& mnemonic) +void decode_cccc_table(const uint16_t cccc, op_mnem& mnemonic) { switch (cccc) { @@ -67,7 +67,7 @@ void decode_cccc_table(const UINT16 cccc, op_mnem& mnemonic) // NEW // } } -void decode_DDDDD_table(const UINT16 DDDDD, reg_id& SD) +void decode_DDDDD_table(const uint16_t DDDDD, reg_id& SD) { switch(DDDDD) { @@ -107,7 +107,7 @@ void decode_DDDDD_table(const UINT16 DDDDD, reg_id& SD) } } -void decode_DD_table(const UINT16 DD, reg_id& SD) +void decode_DD_table(const uint16_t DD, reg_id& SD) { switch (DD) { @@ -118,9 +118,9 @@ void decode_DD_table(const UINT16 DD, reg_id& SD) } } -void decode_DDF_table(const UINT16 DD, const UINT16 F, reg_id& S, reg_id& D) +void decode_DDF_table(const uint16_t DD, const uint16_t F, reg_id& S, reg_id& D) { - const UINT16 switchVal = (DD << 1) | F; + const uint16_t switchVal = (DD << 1) | F; switch (switchVal) { @@ -135,7 +135,7 @@ void decode_DDF_table(const UINT16 DD, const UINT16 F, reg_id& S, reg_id& D) } } -void decode_EE_table(const UINT16 EE, reg_id& D) +void decode_EE_table(const uint16_t EE, reg_id& D) { switch(EE) { @@ -145,7 +145,7 @@ void decode_EE_table(const UINT16 EE, reg_id& D) } } -void decode_F_table(const UINT16 F, reg_id& SD) +void decode_F_table(const uint16_t F, reg_id& SD) { switch(F) { @@ -154,9 +154,9 @@ void decode_F_table(const UINT16 F, reg_id& SD) } } -void decode_h0hF_table(const UINT16 h0h, UINT16 F, reg_id& S, reg_id& D) +void decode_h0hF_table(const uint16_t h0h, uint16_t F, reg_id& S, reg_id& D) { - const UINT16 switchVal = (h0h << 1) | F; + const uint16_t switchVal = (h0h << 1) | F; switch (switchVal) { @@ -171,7 +171,7 @@ void decode_h0hF_table(const UINT16 h0h, UINT16 F, reg_id& S, reg_id& D) } } -void decode_HH_table(const UINT16 HH, reg_id& SD) +void decode_HH_table(const uint16_t HH, reg_id& SD) { switch(HH) { @@ -182,7 +182,7 @@ void decode_HH_table(const UINT16 HH, reg_id& SD) } } -void decode_HHH_table(const UINT16 HHH, reg_id& SD) +void decode_HHH_table(const uint16_t HHH, reg_id& SD) { switch(HHH) { @@ -197,7 +197,7 @@ void decode_HHH_table(const UINT16 HHH, reg_id& SD) } } -void decode_IIIIx_table(const UINT16 IIII, const UINT16 x, reg_id& S, reg_id& D) +void decode_IIIIx_table(const uint16_t IIII, const uint16_t x, reg_id& S, reg_id& D) { S = D = iINVALID; switch(IIII) @@ -221,9 +221,9 @@ void decode_IIIIx_table(const UINT16 IIII, const UINT16 x, reg_id& S, reg_id& D) } } -void decode_JJJF_table(const UINT16 JJJ, const UINT16 F, reg_id& S, reg_id& D) +void decode_JJJF_table(const uint16_t JJJ, const uint16_t F, reg_id& S, reg_id& D) { - const UINT16 switchVal = (JJJ << 1) | F; + const uint16_t switchVal = (JJJ << 1) | F; switch(switchVal) { @@ -246,9 +246,9 @@ void decode_JJJF_table(const UINT16 JJJ, const UINT16 F, reg_id& S, reg_id& D) } } -void decode_JJF_table(const UINT16 JJ, const UINT16 F, reg_id& S, reg_id& D) +void decode_JJF_table(const uint16_t JJ, const uint16_t F, reg_id& S, reg_id& D) { - const UINT16 switchVal = (JJ << 1) | F; + const uint16_t switchVal = (JJ << 1) | F; switch (switchVal) { @@ -263,9 +263,9 @@ void decode_JJF_table(const UINT16 JJ, const UINT16 F, reg_id& S, reg_id& D) } } -void decode_JF_table(const UINT16 J, const UINT16 F, reg_id& S, reg_id& D) +void decode_JF_table(const uint16_t J, const uint16_t F, reg_id& S, reg_id& D) { - const UINT16 switchVal = (J << 1) | F; + const uint16_t switchVal = (J << 1) | F; switch(switchVal) { @@ -276,7 +276,7 @@ void decode_JF_table(const UINT16 J, const UINT16 F, reg_id& S, reg_id& D) } } -// NEW // void decode_k_table(UINT16 k, char *Dnot) +// NEW // void decode_k_table(uint16_t k, char *Dnot) // NEW // { // NEW // switch(k) // NEW // { @@ -285,7 +285,7 @@ void decode_JF_table(const UINT16 J, const UINT16 F, reg_id& S, reg_id& D) // NEW // } // NEW // } -void decode_kSign_table(const UINT16 k, std::string& plusMinus) +void decode_kSign_table(const uint16_t k, std::string& plusMinus) { switch(k) { @@ -294,7 +294,7 @@ void decode_kSign_table(const UINT16 k, std::string& plusMinus) } } -void decode_KKK_table(const UINT16 KKK, reg_id& D1, reg_id& D2) +void decode_KKK_table(const uint16_t KKK, reg_id& D1, reg_id& D2) { switch(KKK) { @@ -309,7 +309,7 @@ void decode_KKK_table(const UINT16 KKK, reg_id& D1, reg_id& D2) } } -void decode_NN_table(UINT16 NN, reg_id& ret) +void decode_NN_table(uint16_t NN, reg_id& ret) { switch(NN) { @@ -320,7 +320,7 @@ void decode_NN_table(UINT16 NN, reg_id& ret) } } -void decode_TT_table(UINT16 TT, reg_id& ret) +void decode_TT_table(uint16_t TT, reg_id& ret) { switch(TT) { @@ -331,9 +331,9 @@ void decode_TT_table(UINT16 TT, reg_id& ret) } } -void decode_QQF_table(const UINT16 QQ, const UINT16 F, reg_id& S1, reg_id& S2, reg_id& D) +void decode_QQF_table(const uint16_t QQ, const uint16_t F, reg_id& S1, reg_id& S2, reg_id& D) { - const UINT16 switchVal = (QQ << 1) | F; + const uint16_t switchVal = (QQ << 1) | F; switch(switchVal) { @@ -348,9 +348,9 @@ void decode_QQF_table(const UINT16 QQ, const UINT16 F, reg_id& S1, reg_id& S2, r } } -void decode_QQF_special_table(const UINT16 QQ, const UINT16 F, reg_id& S1, reg_id& S2, reg_id& D) +void decode_QQF_special_table(const uint16_t QQ, const uint16_t F, reg_id& S1, reg_id& S2, reg_id& D) { - const UINT16 switchVal = (QQ << 1) | F; + const uint16_t switchVal = (QQ << 1) | F; switch(switchVal) { @@ -365,9 +365,9 @@ void decode_QQF_special_table(const UINT16 QQ, const UINT16 F, reg_id& S1, reg_i } } -void decode_QQQF_table(const UINT16 QQQ, const UINT16 F, reg_id& S1, reg_id& S2, reg_id& D) +void decode_QQQF_table(const uint16_t QQQ, const uint16_t F, reg_id& S1, reg_id& S2, reg_id& D) { - const UINT16 switchVal = (QQQ << 1) | F; + const uint16_t switchVal = (QQQ << 1) | F; switch(switchVal) { @@ -390,7 +390,7 @@ void decode_QQQF_table(const UINT16 QQQ, const UINT16 F, reg_id& S1, reg_id& S2, } } -void decode_RR_table(UINT16 RR, reg_id& ret) +void decode_RR_table(uint16_t RR, reg_id& ret) { switch(RR) { @@ -401,7 +401,7 @@ void decode_RR_table(UINT16 RR, reg_id& ret) } } -void decode_rr_table(UINT16 rr, reg_id& ret) +void decode_rr_table(uint16_t rr, reg_id& ret) { switch(rr) { @@ -412,7 +412,7 @@ void decode_rr_table(UINT16 rr, reg_id& ret) } } -void decode_s_table(const UINT16 s, op_mnem& arithmetic) +void decode_s_table(const uint16_t s, op_mnem& arithmetic) { switch(s) { @@ -421,7 +421,7 @@ void decode_s_table(const UINT16 s, op_mnem& arithmetic) } } -void decode_ss_table(const UINT16 ss, op_mnem& arithmetic) +void decode_ss_table(const uint16_t ss, op_mnem& arithmetic) { switch(ss) { @@ -433,9 +433,9 @@ void decode_ss_table(const UINT16 ss, op_mnem& arithmetic) } } -void decode_uuuuF_table(const UINT16 uuuu, const UINT16 F, std::string& arg, reg_id& S, reg_id& D) +void decode_uuuuF_table(const uint16_t uuuu, const uint16_t F, std::string& arg, reg_id& S, reg_id& D) { - const UINT16 switchVal = (uuuu << 1) | F; + const uint16_t switchVal = (uuuu << 1) | F; //D = "sub?"; //S = "add"; @@ -475,7 +475,7 @@ void decode_uuuuF_table(const UINT16 uuuu, const UINT16 F, std::string& arg, reg } } -void decode_Z_table(const UINT16 Z, std::string& ea) +void decode_Z_table(const uint16_t Z, std::string& ea) { /* This is fixed as per the Family Manual errata addendum */ switch(Z) @@ -485,7 +485,7 @@ void decode_Z_table(const UINT16 Z, std::string& ea) } } -void assemble_ea_from_m_table(const UINT16 m, const int n, std::string& ea) +void assemble_ea_from_m_table(const uint16_t m, const int n, std::string& ea) { char temp[32]; switch(m) @@ -496,7 +496,7 @@ void assemble_ea_from_m_table(const UINT16 m, const int n, std::string& ea) ea = temp; } -void assemble_eas_from_mm_table(UINT16 mm, int n1, int n2, std::string& ea1, std::string& ea2) +void assemble_eas_from_mm_table(uint16_t mm, int n1, int n2, std::string& ea1, std::string& ea2) { char temp1[32]; char temp2[32]; @@ -515,7 +515,7 @@ void assemble_eas_from_mm_table(UINT16 mm, int n1, int n2, std::string& ea1, std ea2 = temp2; } -void assemble_ea_from_MM_table(UINT16 MM, int n, std::string& ea) +void assemble_ea_from_MM_table(uint16_t MM, int n, std::string& ea) { char temp[32]; switch(MM) @@ -528,7 +528,7 @@ void assemble_ea_from_MM_table(UINT16 MM, int n, std::string& ea) ea = temp; } -void assemble_ea_from_q_table(UINT16 q, int n, std::string& ea) +void assemble_ea_from_q_table(uint16_t q, int n, std::string& ea) { char temp[32]; switch(q) @@ -539,7 +539,7 @@ void assemble_ea_from_q_table(UINT16 q, int n, std::string& ea) ea = temp; } -void assemble_ea_from_t_table(UINT16 t, UINT16 val, std::string& ea) +void assemble_ea_from_t_table(uint16_t t, uint16_t val, std::string& ea) { char temp[32]; switch(t) @@ -552,7 +552,7 @@ void assemble_ea_from_t_table(UINT16 t, UINT16 val, std::string& ea) ea = temp; } -void assemble_ea_from_z_table(UINT16 z, int n, std::string& ea) +void assemble_ea_from_z_table(uint16_t z, int n, std::string& ea) { char temp[32]; switch(z) @@ -563,7 +563,7 @@ void assemble_ea_from_z_table(UINT16 z, int n, std::string& ea) ea = temp; } -void assemble_D_from_P_table(UINT16 P, UINT16 ppppp, std::string& D) +void assemble_D_from_P_table(uint16_t P, uint16_t ppppp, std::string& D) { char temp[32]; std::string fullAddy; /* Convert Short Absolute Address to full 16-bit */ @@ -583,7 +583,7 @@ void assemble_D_from_P_table(UINT16 P, UINT16 ppppp, std::string& D) D = temp; } -void assemble_arguments_from_W_table(UINT16 W, char ma, const reg_id& SD, const std::string& ea, +void assemble_arguments_from_W_table(uint16_t W, char ma, const reg_id& SD, const std::string& ea, std::string& source, std::string& destination) { char temp[32]; @@ -595,7 +595,7 @@ void assemble_arguments_from_W_table(UINT16 W, char ma, const reg_id& SD, const } } -void assemble_arguments_from_W_table(UINT16 W, char ma, const std::string& SD, const std::string& ea, +void assemble_arguments_from_W_table(uint16_t W, char ma, const std::string& SD, const std::string& ea, std::string& source, std::string& destination) { char temp[32]; @@ -607,9 +607,9 @@ void assemble_arguments_from_W_table(UINT16 W, char ma, const std::string& SD, c } } -void assemble_reg_from_W_table(UINT16 W, char ma, const reg_id& SD, const INT8 xx, std::string& S, std::string& D) +void assemble_reg_from_W_table(uint16_t W, char ma, const reg_id& SD, const int8_t xx, std::string& S, std::string& D) { - UINT8 abs_xx; + uint8_t abs_xx; char temp[32]; char operation[32]; @@ -629,24 +629,24 @@ void assemble_reg_from_W_table(UINT16 W, char ma, const reg_id& SD, const INT8 x } } -void assemble_address_from_IO_short_address(UINT16 pp, std::string& ea) +void assemble_address_from_IO_short_address(uint16_t pp, std::string& ea) { char temp[32]; - UINT16 fullAddy = 0xffe0; + uint16_t fullAddy = 0xffe0; fullAddy |= pp; sprintf(temp, "%.04x", fullAddy); ea = temp; } -INT8 get_6_bit_signed_value(UINT16 bits) +int8_t get_6_bit_signed_value(uint16_t bits) { - UINT16 fullAddy = bits; + uint16_t fullAddy = bits; if (fullAddy & 0x0020) fullAddy |= 0xffc0; - return (INT8)fullAddy; + return (int8_t)fullAddy; } @@ -654,12 +654,12 @@ INT8 get_6_bit_signed_value(UINT16 bits) /* HELPER FUNCTIONS */ /********************/ -UINT16 dsp56k_op_maskn(UINT16 cur, UINT16 mask) +uint16_t dsp56k_op_maskn(uint16_t cur, uint16_t mask) { int i; - UINT16 retVal = (cur & mask); - UINT16 temp = 0x0000; + uint16_t retVal = (cur & mask); + uint16_t temp = 0x0000; int offsetCount = 0; /* Shift everything right, eliminating 'whitespace'... */ @@ -694,7 +694,7 @@ bool registerOverlap(const reg_id& r0, const size_t bmd, const reg_id& r1) return false; } -UINT16 regValue16(dsp56k_core* cpustate, const reg_id& reg) +uint16_t regValue16(dsp56k_core* cpustate, const reg_id& reg) { if (reg == iX0) return X0; if (reg == iX1) return X1; @@ -725,7 +725,7 @@ UINT16 regValue16(dsp56k_core* cpustate, const reg_id& reg) return 0xdead; } -void setReg16(dsp56k_core* cpustate, const UINT16& value, const reg_id& reg) +void setReg16(dsp56k_core* cpustate, const uint16_t& value, const reg_id& reg) { if (reg == iX0) X0 = value; if (reg == iX1) X1 = value; @@ -876,7 +876,7 @@ reg_id stringAsRegID(const std::string& str) return iINVALID; } -UINT8 regIDAsNum(const reg_id& regId) +uint8_t regIDAsNum(const reg_id& regId) { if (regId == iR0) return 0; if (regId == iR1) return 1; diff --git a/src/devices/cpu/dsp56k/tables.h b/src/devices/cpu/dsp56k/tables.h index f0bb88f21d8..2b590dc9027 100644 --- a/src/devices/cpu/dsp56k/tables.h +++ b/src/devices/cpu/dsp56k/tables.h @@ -34,60 +34,60 @@ enum op_mnem {oCC, oGE, oNE, oPL, oSS, oSU, oUU, oINVALID}; -bfShift decode_BBB_table(UINT16 BBB); -void decode_cccc_table(const UINT16 cccc, op_mnem& mnemonic); -void decode_DDDDD_table(const UINT16 DDDDD, reg_id& SD); -void decode_DD_table(const UINT16 DD, reg_id& SD); -void decode_DDF_table(const UINT16 DD, const UINT16 F, reg_id& S, reg_id& D); -void decode_EE_table(const UINT16 EE, reg_id& D); -void decode_F_table(const UINT16 F, reg_id& SD); -void decode_h0hF_table(const UINT16 h0h, UINT16 F, reg_id& S, reg_id& D); -void decode_HH_table(const UINT16 HH, reg_id& SD); -void decode_HHH_table(const UINT16 HHH, reg_id& SD); -void decode_IIIIx_table(const UINT16 IIII, const UINT16 x, reg_id& S, reg_id& D); -void decode_JJJF_table(const UINT16 JJJ, const UINT16 F, reg_id& S, reg_id& D); -void decode_JJF_table(const UINT16 JJ, const UINT16 F, reg_id& S, reg_id& D); -void decode_JF_table(const UINT16 J, const UINT16 F, reg_id& S, reg_id& D); -void decode_kSign_table(const UINT16 k, std::string& plusMinus); -void decode_KKK_table(const UINT16 KKK, reg_id& D1, reg_id& D2); -void decode_NN_table(UINT16 NN, reg_id& ret); -void decode_TT_table(UINT16 TT, reg_id& ret); -void decode_QQF_table(const UINT16 QQ, const UINT16 F, reg_id& S1, reg_id& S2, reg_id& D); -void decode_QQF_special_table(const UINT16 QQ, const UINT16 F, reg_id& S1, reg_id& S2, reg_id& D); -void decode_QQQF_table(const UINT16 QQQ, const UINT16 F, reg_id& S1, reg_id& S2, reg_id& D); -void decode_RR_table(UINT16 RR, reg_id& ret); -void decode_rr_table(UINT16 rr, reg_id& ret); -void decode_s_table(const UINT16 s, op_mnem& arithmetic); -void decode_ss_table(const UINT16 ss, op_mnem& arithmetic); -void decode_uuuuF_table(const UINT16 uuuu, const UINT16 F, std::string& arg, reg_id& S, reg_id& D); -void decode_Z_table(const UINT16 Z, std::string& ea); - -void assemble_ea_from_m_table(const UINT16 m, const int n, std::string& ea); -void assemble_eas_from_mm_table(UINT16 mm, int n1, int n2, std::string& ea1, std::string& ea2); -void assemble_ea_from_MM_table(UINT16 MM, int n, std::string& ea); -void assemble_ea_from_q_table(UINT16 q, int n, std::string& ea); -void assemble_ea_from_t_table(UINT16 t, UINT16 val, std::string& ea); -void assemble_ea_from_z_table(UINT16 z, int n, std::string& ea); -void assemble_D_from_P_table(UINT16 P, UINT16 ppppp, std::string& D); -void assemble_arguments_from_W_table(UINT16 W, char ma, const reg_id& SD, const std::string& ea, std::string& S, std::string& D); -void assemble_arguments_from_W_table(UINT16 W, char ma, const std::string& SD, const std::string& ea, std::string& S, std::string& D); -void assemble_reg_from_W_table(UINT16 W, char ma, const reg_id& SD, const INT8 xx, std::string& S, std::string& D); -void assemble_address_from_IO_short_address(UINT16 pp, std::string& ea); - -INT8 get_6_bit_signed_value(UINT16 bits); +bfShift decode_BBB_table(uint16_t BBB); +void decode_cccc_table(const uint16_t cccc, op_mnem& mnemonic); +void decode_DDDDD_table(const uint16_t DDDDD, reg_id& SD); +void decode_DD_table(const uint16_t DD, reg_id& SD); +void decode_DDF_table(const uint16_t DD, const uint16_t F, reg_id& S, reg_id& D); +void decode_EE_table(const uint16_t EE, reg_id& D); +void decode_F_table(const uint16_t F, reg_id& SD); +void decode_h0hF_table(const uint16_t h0h, uint16_t F, reg_id& S, reg_id& D); +void decode_HH_table(const uint16_t HH, reg_id& SD); +void decode_HHH_table(const uint16_t HHH, reg_id& SD); +void decode_IIIIx_table(const uint16_t IIII, const uint16_t x, reg_id& S, reg_id& D); +void decode_JJJF_table(const uint16_t JJJ, const uint16_t F, reg_id& S, reg_id& D); +void decode_JJF_table(const uint16_t JJ, const uint16_t F, reg_id& S, reg_id& D); +void decode_JF_table(const uint16_t J, const uint16_t F, reg_id& S, reg_id& D); +void decode_kSign_table(const uint16_t k, std::string& plusMinus); +void decode_KKK_table(const uint16_t KKK, reg_id& D1, reg_id& D2); +void decode_NN_table(uint16_t NN, reg_id& ret); +void decode_TT_table(uint16_t TT, reg_id& ret); +void decode_QQF_table(const uint16_t QQ, const uint16_t F, reg_id& S1, reg_id& S2, reg_id& D); +void decode_QQF_special_table(const uint16_t QQ, const uint16_t F, reg_id& S1, reg_id& S2, reg_id& D); +void decode_QQQF_table(const uint16_t QQQ, const uint16_t F, reg_id& S1, reg_id& S2, reg_id& D); +void decode_RR_table(uint16_t RR, reg_id& ret); +void decode_rr_table(uint16_t rr, reg_id& ret); +void decode_s_table(const uint16_t s, op_mnem& arithmetic); +void decode_ss_table(const uint16_t ss, op_mnem& arithmetic); +void decode_uuuuF_table(const uint16_t uuuu, const uint16_t F, std::string& arg, reg_id& S, reg_id& D); +void decode_Z_table(const uint16_t Z, std::string& ea); + +void assemble_ea_from_m_table(const uint16_t m, const int n, std::string& ea); +void assemble_eas_from_mm_table(uint16_t mm, int n1, int n2, std::string& ea1, std::string& ea2); +void assemble_ea_from_MM_table(uint16_t MM, int n, std::string& ea); +void assemble_ea_from_q_table(uint16_t q, int n, std::string& ea); +void assemble_ea_from_t_table(uint16_t t, uint16_t val, std::string& ea); +void assemble_ea_from_z_table(uint16_t z, int n, std::string& ea); +void assemble_D_from_P_table(uint16_t P, uint16_t ppppp, std::string& D); +void assemble_arguments_from_W_table(uint16_t W, char ma, const reg_id& SD, const std::string& ea, std::string& S, std::string& D); +void assemble_arguments_from_W_table(uint16_t W, char ma, const std::string& SD, const std::string& ea, std::string& S, std::string& D); +void assemble_reg_from_W_table(uint16_t W, char ma, const reg_id& SD, const int8_t xx, std::string& S, std::string& D); +void assemble_address_from_IO_short_address(uint16_t pp, std::string& ea); + +int8_t get_6_bit_signed_value(uint16_t bits); // Helpers -UINT16 dsp56k_op_maskn(UINT16 cur, UINT16 mask); +uint16_t dsp56k_op_maskn(uint16_t cur, uint16_t mask); bool registerOverlap(const reg_id& r0, const size_t bmd, const reg_id& r1); -UINT16 regValue16(dsp56k_core* cpustate, const reg_id& reg); -void setReg16(dsp56k_core* cpustate, const UINT16& value, const reg_id& reg); +uint16_t regValue16(dsp56k_core* cpustate, const reg_id& reg); +void setReg16(dsp56k_core* cpustate, const uint16_t& value, const reg_id& reg); std::string regIdAsString(const reg_id& regId); std::string opMnemonicAsString(const op_mnem& mnem); reg_id stringAsRegID(const std::string& str); -UINT8 regIDAsNum(const reg_id& regId); +uint8_t regIDAsNum(const reg_id& regId); } diff --git a/src/devices/cpu/e0c6200/e0c6200.cpp b/src/devices/cpu/e0c6200/e0c6200.cpp index e2bb9390586..9cc9468429d 100644 --- a/src/devices/cpu/e0c6200/e0c6200.cpp +++ b/src/devices/cpu/e0c6200/e0c6200.cpp @@ -40,7 +40,7 @@ void e0c6200_cpu_device::state_string_export(const device_state_entry &entry, st } } -offs_t e0c6200_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t e0c6200_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(e0c6200); return CPU_DISASSEMBLE_NAME(e0c6200)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/e0c6200/e0c6200.h b/src/devices/cpu/e0c6200/e0c6200.h index 280ad88bd99..cc23c0b1897 100644 --- a/src/devices/cpu/e0c6200/e0c6200.h +++ b/src/devices/cpu/e0c6200/e0c6200.h @@ -16,7 +16,7 @@ class e0c6200_cpu_device : public cpu_device { public: // construction/destruction - e0c6200_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor program, address_map_constructor data, const char *shortname, const char *source) + e0c6200_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program, address_map_constructor data, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 16, 13, -1, program) , m_data_config("data", ENDIANNESS_BIG, 8, 12, 0, data), m_program(nullptr), m_data(nullptr), m_op(0), m_prev_op(0), m_irq_vector(0), m_irq_id(0), m_possible_irq(false), m_halt(false), @@ -29,9 +29,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 5; } - virtual UINT32 execute_max_cycles() const override { return 14; } // longest opcode is 12 cycles, but interrupt service takes up to 14 - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 5; } + virtual uint32_t execute_max_cycles() const override { return 14; } // longest opcode is 12 cycles, but interrupt service takes up to 14 + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_one(); virtual bool check_interrupt() { return false; } // nothing to do by default @@ -41,9 +41,9 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; address_space_config m_program_config; @@ -51,27 +51,27 @@ protected: address_space *m_program; address_space *m_data; - UINT16 m_op; - UINT16 m_prev_op; - UINT8 m_irq_vector; // low 4 bits for new programcounter after interrupt + uint16_t m_op; + uint16_t m_prev_op; + uint8_t m_irq_vector; // low 4 bits for new programcounter after interrupt int m_irq_id; // for standard_irq_callback(id) bool m_possible_irq; // indicates interrupts need to be re-checked bool m_halt; // cpu halt state bool m_sleep; // cpu sleep state int m_icount; - UINT16 m_pc; // 13-bit programcounter: 1-bit bank, 4-bit page, 8-bit 'step' - UINT16 m_prev_pc; - UINT16 m_npc; // new bank/page prepared by pset - UINT16 m_jpc; // actual bank/page destination for jumps + uint16_t m_pc; // 13-bit programcounter: 1-bit bank, 4-bit page, 8-bit 'step' + uint16_t m_prev_pc; + uint16_t m_npc; // new bank/page prepared by pset + uint16_t m_jpc; // actual bank/page destination for jumps // all work registers are 4-bit - UINT8 m_a; // accumulator - UINT8 m_b; // generic - UINT8 m_xp, m_xh, m_xl; // 12-bit index register when combined - UINT8 m_yp, m_yh, m_yl; // " - UINT8 m_sp; // stackpointer (SPH, SPL) - UINT8 m_f; // flags + uint8_t m_a; // accumulator + uint8_t m_b; // generic + uint8_t m_xp, m_xh, m_xl; // 12-bit index register when combined + uint8_t m_yp, m_yh, m_yl; // " + uint8_t m_sp; // stackpointer (SPH, SPL) + uint8_t m_f; // flags enum { C_FLAG = 1, @@ -81,39 +81,39 @@ protected: }; // internal data memory read/write - UINT8 read_mx(); - UINT8 read_my(); - UINT8 read_mn(); - void write_mx(UINT8 data); - void write_my(UINT8 data); - void write_mn(UINT8 data); + uint8_t read_mx(); + uint8_t read_my(); + uint8_t read_mn(); + void write_mx(uint8_t data); + void write_my(uint8_t data); + void write_mn(uint8_t data); // common stack ops - void push(UINT8 data); - UINT8 pop(); + void push(uint8_t data); + uint8_t pop(); void push_pc(); void pop_pc(); // misc internal helpers - void set_cf(UINT8 data); - void set_zf(UINT8 data); + void set_cf(uint8_t data); + void set_zf(uint8_t data); void inc_x(); void inc_y(); void do_branch(int condition = 1); // opcode handlers - UINT8 op_inc(UINT8 x); - UINT8 op_dec(UINT8 x); - UINT8 op_add(UINT8 x, UINT8 y, int decimal = 0); - UINT8 op_adc(UINT8 x, UINT8 y, int decimal = 0); - UINT8 op_sub(UINT8 x, UINT8 y, int decimal = 0); - UINT8 op_sbc(UINT8 x, UINT8 y, int decimal = 0); - - UINT8 op_and(UINT8 x, UINT8 y); - UINT8 op_or(UINT8 x, UINT8 y); - UINT8 op_xor(UINT8 x, UINT8 y); - UINT8 op_rlc(UINT8 x); - UINT8 op_rrc(UINT8 x); + uint8_t op_inc(uint8_t x); + uint8_t op_dec(uint8_t x); + uint8_t op_add(uint8_t x, uint8_t y, int decimal = 0); + uint8_t op_adc(uint8_t x, uint8_t y, int decimal = 0); + uint8_t op_sub(uint8_t x, uint8_t y, int decimal = 0); + uint8_t op_sbc(uint8_t x, uint8_t y, int decimal = 0); + + uint8_t op_and(uint8_t x, uint8_t y); + uint8_t op_or(uint8_t x, uint8_t y); + uint8_t op_xor(uint8_t x, uint8_t y); + uint8_t op_rlc(uint8_t x); + uint8_t op_rrc(uint8_t x); }; diff --git a/src/devices/cpu/e0c6200/e0c6200d.cpp b/src/devices/cpu/e0c6200/e0c6200d.cpp index 4935b257470..04025e1c484 100644 --- a/src/devices/cpu/e0c6200/e0c6200d.cpp +++ b/src/devices/cpu/e0c6200/e0c6200d.cpp @@ -34,7 +34,7 @@ static const char *const em_name[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 em_flags[] = +static const uint32_t em_flags[] = { 0, _OUT, _OVER, _OVER, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -56,7 +56,7 @@ enum e_params // 0-digit is number of bits per opcode parameter, 0 bits is literal, // 0x10-digit is for shift-right, 0x100-digit is special flag for r/q param -static const UINT16 ep_bits[] = +static const uint16_t ep_bits[] = { 8, 8, 4, 0x102, 0x122, 0x142, 0x102, 0, 0, 0, 0, @@ -65,7 +65,7 @@ static const UINT16 ep_bits[] = }; // redirect for r/q param -static const UINT8 ep_redirect_r[4] = { ep_A, ep_B, ep_MX, ep_MY }; +static const uint8_t ep_redirect_r[4] = { ep_A, ep_B, ep_MX, ep_MY }; // literal opcode parameter static const char *const ep_name[] = @@ -77,11 +77,11 @@ static const char *const ep_name[] = }; -static char* decode_param(UINT16 opcode, int param, char* buffer) +static char* decode_param(uint16_t opcode, int param, char* buffer) { int bits = ep_bits[param] & 0xf; int shift = ep_bits[param] >> 4 & 0xf; - UINT16 opmask = opcode >> shift & ((1 << bits) - 1); + uint16_t opmask = opcode >> shift & ((1 << bits) - 1); // redirect r/q to A/B/MX/MY if (ep_bits[param] & 0x100) @@ -112,7 +112,7 @@ static char* decode_param(UINT16 opcode, int param, char* buffer) CPU_DISASSEMBLE(e0c6200) { - UINT16 op = (oprom[1] | oprom[0] << 8) & 0xfff; + uint16_t op = (oprom[1] | oprom[0] << 8) & 0xfff; int m; int p1 = -1; diff --git a/src/devices/cpu/e0c6200/e0c6200op.cpp b/src/devices/cpu/e0c6200/e0c6200op.cpp index e6d2fed3933..ed2d4a06031 100644 --- a/src/devices/cpu/e0c6200/e0c6200op.cpp +++ b/src/devices/cpu/e0c6200/e0c6200op.cpp @@ -10,38 +10,38 @@ // MX/MY -UINT8 e0c6200_cpu_device::read_mx() +uint8_t e0c6200_cpu_device::read_mx() { - UINT16 address = m_xp << 8 | m_xh << 4 | m_xl; + uint16_t address = m_xp << 8 | m_xh << 4 | m_xl; return m_data->read_byte(address) & 0xf; } -UINT8 e0c6200_cpu_device::read_my() +uint8_t e0c6200_cpu_device::read_my() { - UINT16 address = m_yp << 8 | m_yh << 4 | m_yl; + uint16_t address = m_yp << 8 | m_yh << 4 | m_yl; return m_data->read_byte(address) & 0xf; } -void e0c6200_cpu_device::write_mx(UINT8 data) +void e0c6200_cpu_device::write_mx(uint8_t data) { - UINT16 address = m_xp << 8 | m_xh << 4 | m_xl; + uint16_t address = m_xp << 8 | m_xh << 4 | m_xl; m_data->write_byte(address, data); } -void e0c6200_cpu_device::write_my(UINT8 data) +void e0c6200_cpu_device::write_my(uint8_t data) { - UINT16 address = m_yp << 8 | m_yh << 4 | m_yl; + uint16_t address = m_yp << 8 | m_yh << 4 | m_yl; m_data->write_byte(address, data); } // Mn(RP) -UINT8 e0c6200_cpu_device::read_mn() +uint8_t e0c6200_cpu_device::read_mn() { return m_data->read_byte(m_op & 0xf) & 0xf; } -void e0c6200_cpu_device::write_mn(UINT8 data) +void e0c6200_cpu_device::write_mn(uint8_t data) { m_data->write_byte(m_op & 0xf, data); } @@ -49,12 +49,12 @@ void e0c6200_cpu_device::write_mn(UINT8 data) // common stack ops -void e0c6200_cpu_device::push(UINT8 data) +void e0c6200_cpu_device::push(uint8_t data) { m_data->write_byte(--m_sp, data); } -UINT8 e0c6200_cpu_device::pop() +uint8_t e0c6200_cpu_device::pop() { return m_data->read_byte(m_sp++) & 0xf; } @@ -70,7 +70,7 @@ void e0c6200_cpu_device::push_pc() void e0c6200_cpu_device::pop_pc() { // the highest bit(bank bit) is unchanged - UINT16 bank = m_pc & 0x1000; + uint16_t bank = m_pc & 0x1000; m_pc = pop(); m_pc |= pop() << 4; m_pc |= pop() << 8; @@ -80,13 +80,13 @@ void e0c6200_cpu_device::pop_pc() // misc internal helpers -void e0c6200_cpu_device::set_cf(UINT8 data) +void e0c6200_cpu_device::set_cf(uint8_t data) { // set carry flag if bit 4 is set, reset otherwise m_f = (m_f & ~C_FLAG) | ((data & 0x10) ? C_FLAG : 0); } -void e0c6200_cpu_device::set_zf(UINT8 data) +void e0c6200_cpu_device::set_zf(uint8_t data) { // set zero flag if 4-bit data is 0, reset otherwise m_f = (m_f & ~Z_FLAG) | ((data & 0xf) ? 0 : Z_FLAG); @@ -121,7 +121,7 @@ void e0c6200_cpu_device::do_branch(int condition) // arithmetic instructions -UINT8 e0c6200_cpu_device::op_inc(UINT8 x) +uint8_t e0c6200_cpu_device::op_inc(uint8_t x) { // INC x: increment x (flags: C, Z) m_icount -= 2; @@ -130,7 +130,7 @@ UINT8 e0c6200_cpu_device::op_inc(UINT8 x) return x & 0xf; } -UINT8 e0c6200_cpu_device::op_dec(UINT8 x) +uint8_t e0c6200_cpu_device::op_dec(uint8_t x) { // DEC x: decrement x (flags: C, Z) m_icount -= 2; @@ -139,7 +139,7 @@ UINT8 e0c6200_cpu_device::op_dec(UINT8 x) return x & 0xf; } -UINT8 e0c6200_cpu_device::op_add(UINT8 x, UINT8 y, int decimal) +uint8_t e0c6200_cpu_device::op_add(uint8_t x, uint8_t y, int decimal) { // ADD x,y: add y to x (flags: C, Z) m_icount -= 2; @@ -157,13 +157,13 @@ UINT8 e0c6200_cpu_device::op_add(UINT8 x, UINT8 y, int decimal) return x & 0xf; } -UINT8 e0c6200_cpu_device::op_adc(UINT8 x, UINT8 y, int decimal) +uint8_t e0c6200_cpu_device::op_adc(uint8_t x, uint8_t y, int decimal) { // ADC x,y: add with carry y to x (flags: C, Z) return op_add(x, y + (m_f & 1), decimal); } -UINT8 e0c6200_cpu_device::op_sub(UINT8 x, UINT8 y, int decimal) +uint8_t e0c6200_cpu_device::op_sub(uint8_t x, uint8_t y, int decimal) { // SUB x,y: subtract y from x (flags: C, Z) m_icount -= 2; @@ -178,7 +178,7 @@ UINT8 e0c6200_cpu_device::op_sub(UINT8 x, UINT8 y, int decimal) return x & 0xf; } -UINT8 e0c6200_cpu_device::op_sbc(UINT8 x, UINT8 y, int decimal) +uint8_t e0c6200_cpu_device::op_sbc(uint8_t x, uint8_t y, int decimal) { // SBC x,y: subtract with carry y from x (flags: C, Z) return op_sub(x, y + (m_f & 1), decimal); @@ -187,7 +187,7 @@ UINT8 e0c6200_cpu_device::op_sbc(UINT8 x, UINT8 y, int decimal) // logical instructions -UINT8 e0c6200_cpu_device::op_and(UINT8 x, UINT8 y) +uint8_t e0c6200_cpu_device::op_and(uint8_t x, uint8_t y) { // AND x,y: logical AND x with y (flags: Z) m_icount -= 2; @@ -196,7 +196,7 @@ UINT8 e0c6200_cpu_device::op_and(UINT8 x, UINT8 y) return x; } -UINT8 e0c6200_cpu_device::op_or(UINT8 x, UINT8 y) +uint8_t e0c6200_cpu_device::op_or(uint8_t x, uint8_t y) { // OR x,y: logical OR x with y (flags: Z) m_icount -= 2; @@ -205,7 +205,7 @@ UINT8 e0c6200_cpu_device::op_or(UINT8 x, UINT8 y) return x; } -UINT8 e0c6200_cpu_device::op_xor(UINT8 x, UINT8 y) +uint8_t e0c6200_cpu_device::op_xor(uint8_t x, uint8_t y) { // XOR x,y: exclusive-OR x with y (flags: Z) m_icount -= 2; @@ -214,7 +214,7 @@ UINT8 e0c6200_cpu_device::op_xor(UINT8 x, UINT8 y) return x; } -UINT8 e0c6200_cpu_device::op_rlc(UINT8 x) +uint8_t e0c6200_cpu_device::op_rlc(uint8_t x) { // RLC x: rotate x left through carry (flags: C, Z) m_icount -= 2; @@ -223,7 +223,7 @@ UINT8 e0c6200_cpu_device::op_rlc(UINT8 x) return x & 0xf; } -UINT8 e0c6200_cpu_device::op_rrc(UINT8 x) +uint8_t e0c6200_cpu_device::op_rrc(uint8_t x) { // RRC x: rotate x right through carry (flags: C, Z) // note: RRC only takes 5 clock cycles diff --git a/src/devices/cpu/e0c6200/e0c6s46.cpp b/src/devices/cpu/e0c6200/e0c6s46.cpp index 4dc37fa11fe..7563f4bc4a3 100644 --- a/src/devices/cpu/e0c6200/e0c6s46.cpp +++ b/src/devices/cpu/e0c6200/e0c6s46.cpp @@ -45,7 +45,7 @@ ADDRESS_MAP_END // device definitions -e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e0c6s46_device::e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : e0c6200_cpu_device(mconfig, E0C6S46, "E0C6S46", tag, owner, clock, ADDRESS_MAP_NAME(e0c6s46_program), ADDRESS_MAP_NAME(e0c6s46_data), "e0c6s46", __FILE__) , m_vram1(*this, "vram1") , m_vram2(*this, "vram2"), m_osc(0), m_svd(0), m_lcd_control(0), m_lcd_contrast(0) @@ -279,7 +279,7 @@ void e0c6s46_device::execute_set_input(int line, int state) state = (state) ? 1 : 0; int port = line >> 2 & 1; - UINT8 bit = 1 << (line & 3); + uint8_t bit = 1 << (line & 3); m_port_k[port] = (m_port_k[port] & ~bit) | (state ? bit : 0); } @@ -292,13 +292,13 @@ void e0c6s46_device::execute_set_input(int line, int state) // R output ports -void e0c6s46_device::write_r(UINT8 port, UINT8 data) +void e0c6s46_device::write_r(uint8_t port, uint8_t data) { data &= 0xf; m_port_r[port] = data; // ports R0x-R3x can be high-impedance - UINT8 out = data; + uint8_t out = data; if (port < 4 && !(m_r_dir >> port & 1)) out = 0xf; @@ -327,14 +327,14 @@ void e0c6s46_device::write_r4_out() // R40: _FOUT(clock inverted output) // R42: FOUT or _BZ // R43: BZ(buzzer) - UINT8 out = (m_port_r[4] & 2) | (m_bz_pulse << 3) | (m_bz_pulse << 2 ^ 4); + uint8_t out = (m_port_r[4] & 2) | (m_bz_pulse << 3) | (m_bz_pulse << 2 ^ 4); m_write_r4(4, out, 0xff); } // P I/O ports -void e0c6s46_device::write_p(UINT8 port, UINT8 data) +void e0c6s46_device::write_p(uint8_t port, uint8_t data) { data &= 0xf; m_port_p[port] = data; @@ -352,7 +352,7 @@ void e0c6s46_device::write_p(UINT8 port, UINT8 data) } } -UINT8 e0c6s46_device::read_p(UINT8 port) +uint8_t e0c6s46_device::read_p(uint8_t port) { // return written value if port direction is set to output if (m_p_dir >> port & 1) @@ -416,7 +416,7 @@ void e0c6s46_device::clock_clktimer() m_clktimer_count++; // irq on falling edge of 32, 8, 2, 1hz - UINT8 flag = 0; + uint8_t flag = 0; if ((m_clktimer_count & 0x07) == 0) flag |= 1; if ((m_clktimer_count & 0x1f) == 0) @@ -488,7 +488,7 @@ void e0c6s46_device::clock_prgtimer() bool e0c6s46_device::prgtimer_reset_prescaler() { // only 2 to 7 are clock dividers - UINT8 sel = m_prgtimer_select & 7; + uint8_t sel = m_prgtimer_select & 7; if (sel >= 2) m_prgtimer_handle->adjust(attotime::from_ticks(2 << (sel ^ 7), unscaled_clock())); @@ -572,12 +572,12 @@ void e0c6s46_device::clock_bz_1shot() // LCD Driver //------------------------------------------------- -UINT32 e0c6s46_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t e0c6s46_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // call this 32 times per second (osc1/1024: 32hz at default clock of 32768hz) for (int bank = 0; bank < 2; bank++) { - const UINT8* vram = bank ? m_vram2 : m_vram1; + const uint8_t* vram = bank ? m_vram2 : m_vram1; // determine operating mode bool lcd_on = false; @@ -626,7 +626,7 @@ READ8_MEMBER(e0c6s46_device::io_r) case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: { // irq flags are reset(acked) when read - UINT8 flag = m_irqflag[offset]; + uint8_t flag = m_irqflag[offset]; if (!space.debugger_access()) m_irqflag[offset] = 0; return flag; @@ -719,7 +719,7 @@ WRITE8_MEMBER(e0c6s46_device::io_w) // irq masks case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: { - static const UINT8 maskmask[6] = { 0xf, 3, 1, 1, 0xf, 0xf }; + static const uint8_t maskmask[6] = { 0xf, 3, 1, 1, 0xf, 0xf }; m_irqmask[offset-0x10] = data & maskmask[offset-0x10]; m_possible_irq = true; break; diff --git a/src/devices/cpu/e0c6200/e0c6s46.h b/src/devices/cpu/e0c6200/e0c6s46.h index 692f2332cd5..0d3ad7c250c 100644 --- a/src/devices/cpu/e0c6200/e0c6s46.h +++ b/src/devices/cpu/e0c6200/e0c6s46.h @@ -66,7 +66,7 @@ typedef void (*e0c6s46_pixel_update_func)(device_t &device, bitmap_ind16 &bitmap class e0c6s46_device : public e0c6200_cpu_device { public: - e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e0c6s46_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_write_r0_callback(device_t &device, _Object object) { return downcast(device).m_write_r0.set_callback(object); } @@ -89,7 +89,7 @@ public: DECLARE_READ8_MEMBER(io_r); DECLARE_WRITE8_MEMBER(io_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 @@ -97,40 +97,40 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_input_lines() const override { return 8; } + virtual uint32_t execute_input_lines() const override { return 8; } virtual void execute_set_input(int line, int state) override; virtual void execute_one() override; virtual bool check_interrupt() override; private: - required_shared_ptr m_vram1; - required_shared_ptr m_vram2; + required_shared_ptr m_vram1; + required_shared_ptr m_vram2; - UINT8 m_irqflag[6]; - UINT8 m_irqmask[6]; - UINT8 m_osc; - UINT8 m_svd; + uint8_t m_irqflag[6]; + uint8_t m_irqmask[6]; + uint8_t m_osc; + uint8_t m_svd; - UINT8 m_lcd_control; - UINT8 m_lcd_contrast; + uint8_t m_lcd_control; + uint8_t m_lcd_contrast; e0c6s46_pixel_update_func m_pixel_update_handler; // i/o ports devcb_write8 m_write_r0, m_write_r1, m_write_r2, m_write_r3, m_write_r4; devcb_read8 m_read_p0, m_read_p1, m_read_p2, m_read_p3; devcb_write8 m_write_p0, m_write_p1, m_write_p2, m_write_p3; - void write_r(UINT8 port, UINT8 data); + void write_r(uint8_t port, uint8_t data); void write_r4_out(); - void write_p(UINT8 port, UINT8 data); - UINT8 read_p(UINT8 port); + void write_p(uint8_t port, uint8_t data); + uint8_t read_p(uint8_t port); - UINT8 m_port_r[5]; - UINT8 m_r_dir; - UINT8 m_port_p[4]; - UINT8 m_p_dir; - UINT8 m_p_pullup; - UINT8 m_port_k[2]; - UINT8 m_dfk0; + uint8_t m_port_r[5]; + uint8_t m_r_dir; + uint8_t m_port_p[4]; + uint8_t m_p_dir; + uint8_t m_p_pullup; + uint8_t m_port_k[2]; + uint8_t m_dfk0; // timers int m_256_src_pulse; @@ -139,34 +139,34 @@ private: int m_watchdog_count; void clock_watchdog(); - UINT8 m_clktimer_count; + uint8_t m_clktimer_count; void clock_clktimer(); - UINT8 m_stopwatch_on; + uint8_t m_stopwatch_on; int m_swl_cur_pulse; int m_swl_slice; int m_swl_count; int m_swh_count; void clock_stopwatch(); - UINT8 m_prgtimer_select; - UINT8 m_prgtimer_on; + uint8_t m_prgtimer_select; + uint8_t m_prgtimer_on; int m_prgtimer_src_pulse; int m_prgtimer_cur_pulse; - UINT8 m_prgtimer_count; - UINT8 m_prgtimer_reload; + uint8_t m_prgtimer_count; + uint8_t m_prgtimer_reload; emu_timer *m_prgtimer_handle; TIMER_CALLBACK_MEMBER(prgtimer_cb); bool prgtimer_reset_prescaler(); void clock_prgtimer(); - UINT8 m_bz_43_on; - UINT8 m_bz_freq; - UINT8 m_bz_envelope; - UINT8 m_bz_duty_ratio; - UINT8 m_bz_1shot_on; + uint8_t m_bz_43_on; + uint8_t m_bz_freq; + uint8_t m_bz_envelope; + uint8_t m_bz_duty_ratio; + uint8_t m_bz_1shot_on; bool m_bz_1shot_running; - UINT8 m_bz_1shot_count; + uint8_t m_bz_1shot_count; int m_bz_pulse; emu_timer *m_buzzer_handle; TIMER_CALLBACK_MEMBER(buzzer_cb); diff --git a/src/devices/cpu/e132xs/32xsdasm.cpp b/src/devices/cpu/e132xs/32xsdasm.cpp index 48f3e97968f..a69f5d9dbcd 100644 --- a/src/devices/cpu/e132xs/32xsdasm.cpp +++ b/src/devices/cpu/e132xs/32xsdasm.cpp @@ -49,17 +49,17 @@ static const char *const SETxx[] = static int size, global_fp; static offs_t base_pc; -static const UINT8 *base_oprom; +static const uint8_t *base_oprom; #define READ_OP_DASM(p) ((base_oprom[(p) - base_pc] << 8) | base_oprom[(p) + 1 - base_pc]) -static void LL_format(char *source, char *dest, UINT16 op) +static void LL_format(char *source, char *dest, uint16_t op) { strcpy(source, L_REG[(SOURCECODE(op)+global_fp)%64]); strcpy(dest, L_REG[(DESTCODE(op)+global_fp)%64]); } -static void LR_format(char *source, char *dest, UINT16 op) +static void LR_format(char *source, char *dest, uint16_t op) { if( SOURCEBIT(op) ) { @@ -73,7 +73,7 @@ static void LR_format(char *source, char *dest, UINT16 op) strcpy(dest, L_REG[(DESTCODE(op)+global_fp)%64]); } -static void RR_format(char *source, char *dest, UINT16 op, unsigned h_flag) +static void RR_format(char *source, char *dest, uint16_t op, unsigned h_flag) { if( SOURCEBIT(op) ) { @@ -94,10 +94,10 @@ static void RR_format(char *source, char *dest, UINT16 op, unsigned h_flag) } } -static UINT32 LRconst_format(char *source, char *dest, UINT16 op, unsigned *pc) +static uint32_t LRconst_format(char *source, char *dest, uint16_t op, unsigned *pc) { - UINT16 next_op; - UINT32 const_val; + uint16_t next_op; + uint32_t const_val; if( SOURCEBIT(op) ) { @@ -117,7 +117,7 @@ static UINT32 LRconst_format(char *source, char *dest, UINT16 op, unsigned *pc) if( E_BIT(next_op) ) { - UINT16 next_op2; + uint16_t next_op2; size = 6; @@ -144,10 +144,10 @@ static UINT32 LRconst_format(char *source, char *dest, UINT16 op, unsigned *pc) return const_val; } -static UINT32 RRconst_format(char *source, char *dest, UINT16 op, unsigned *pc) +static uint32_t RRconst_format(char *source, char *dest, uint16_t op, unsigned *pc) { - UINT16 next_op; - UINT32 const_val; + uint16_t next_op; + uint32_t const_val; if( SOURCEBIT(op) ) { @@ -174,7 +174,7 @@ static UINT32 RRconst_format(char *source, char *dest, UINT16 op, unsigned *pc) if( E_BIT(next_op) ) { - UINT16 next_op2; + uint16_t next_op2; size = 6; @@ -201,10 +201,10 @@ static UINT32 RRconst_format(char *source, char *dest, UINT16 op, unsigned *pc) return const_val; } -static INT32 Rimm_format(char *dest, UINT16 op, unsigned *pc, unsigned h_flag) +static int32_t Rimm_format(char *dest, uint16_t op, unsigned *pc, unsigned h_flag) { - UINT16 imm1, imm2; - INT32 ret; + uint16_t imm1, imm2; + int32_t ret; int n = N_VALUE(op); @@ -243,7 +243,7 @@ static INT32 Rimm_format(char *dest, UINT16 op, unsigned *pc, unsigned h_flag) case 19: *pc += 2; - ret = (INT32) (0xffff0000 | READ_OP_DASM(*pc)); + ret = (int32_t) (0xffff0000 | READ_OP_DASM(*pc)); size = 4; return ret; @@ -289,14 +289,14 @@ static INT32 Rimm_format(char *dest, UINT16 op, unsigned *pc, unsigned h_flag) } } -static UINT8 Ln_format(char *dest, UINT16 op) +static uint8_t Ln_format(char *dest, uint16_t op) { strcpy(dest, L_REG[(DESTCODE(op)+global_fp)%64]); return N_VALUE(op); } -static UINT8 Rn_format(char *dest, UINT16 op) +static uint8_t Rn_format(char *dest, uint16_t op) { if( DESTBIT(op) ) { @@ -310,13 +310,13 @@ static UINT8 Rn_format(char *dest, UINT16 op) return N_VALUE(op); } -static INT32 PCrel_format(UINT16 op, unsigned pc) +static int32_t PCrel_format(uint16_t op, unsigned pc) { - INT32 ret; + int32_t ret; if( op & 0x80 ) //bit 7 = 1 { - UINT16 next; + uint16_t next; size = 4; @@ -342,9 +342,9 @@ static INT32 PCrel_format(UINT16 op, unsigned pc) return (pc + ret); } -static UINT32 RRdis_format(char *source, char *dest, UINT16 op, UINT16 next_op, unsigned pc) +static uint32_t RRdis_format(char *source, char *dest, uint16_t op, uint16_t next_op, unsigned pc) { - UINT32 ret; + uint32_t ret; if( SOURCEBIT(op) ) { @@ -366,7 +366,7 @@ static UINT32 RRdis_format(char *source, char *dest, UINT16 op, UINT16 next_op, if( E_BIT(next_op) ) { - UINT16 next; + uint16_t next; size = 6; @@ -392,15 +392,15 @@ static UINT32 RRdis_format(char *source, char *dest, UINT16 op, UINT16 next_op, return ret; } -unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned h_flag, int private_fp) +unsigned dasm_hyperstone(char *buffer, unsigned pc, const uint8_t *oprom, unsigned h_flag, int private_fp) { - UINT16 op; - UINT8 op_num; + uint16_t op; + uint8_t op_num; - UINT8 source_code, dest_code, source_bit, dest_bit; + uint8_t source_code, dest_code, source_bit, dest_bit; char source[5] = "\0", dest[5] = "\0"; - UINT32 flags = 0; + uint32_t flags = 0; base_pc = pc; base_oprom = oprom; @@ -498,11 +498,11 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned if( xcode < 4 ) { - UINT16 lim; + uint16_t lim; if( E_BIT(op) ) { - UINT16 next_op; + uint16_t next_op; size = 6; @@ -516,12 +516,12 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned lim = op & 0xfff; } - sprintf(buffer, "XM%x %s, %s, $%x", (UINT8)(float) pow(2.0, xcode), dest, source, lim); + sprintf(buffer, "XM%x %s, %s, $%x", (uint8_t)(float) pow(2.0, xcode), dest, source, lim); } else { - sprintf(buffer, "XX%x %s, %s, 0", (UINT8)(float) pow(2.0, (xcode - 4)), dest, source); + sprintf(buffer, "XX%x %s, %s, 0", (uint8_t)(float) pow(2.0, (xcode - 4)), dest, source); } break; @@ -530,7 +530,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // MASK case 0x14: case 0x15: case 0x16: case 0x17: { - UINT32 const_val = RRconst_format(source, dest, op, &pc); + uint32_t const_val = RRconst_format(source, dest, op, &pc); sprintf(buffer, "MASK %s, %s, $%x", dest, source, const_val); @@ -540,7 +540,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // SUM case 0x18: case 0x19: case 0x1a: case 0x1b: { - UINT32 const_val = RRconst_format(source, dest, op, &pc); + uint32_t const_val = RRconst_format(source, dest, op, &pc); if( source_code == SR_REGISTER && !source_bit ) { @@ -557,7 +557,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // SUMS case 0x1c: case 0x1d: case 0x1e: case 0x1f: { - UINT32 const_val = RRconst_format(source, dest, op, &pc); + uint32_t const_val = RRconst_format(source, dest, op, &pc); if( source_code == SR_REGISTER && !source_bit ) { @@ -775,7 +775,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // CMPI case 0x60: case 0x61: case 0x62: case 0x63: { - UINT32 imm = Rimm_format(dest, op, &pc, 0); + uint32_t imm = Rimm_format(dest, op, &pc, 0); sprintf(buffer, "CMPI %s, $%x", dest, imm); @@ -785,7 +785,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // MOVI case 0x64: case 0x65: case 0x66: case 0x67: { - UINT32 imm = Rimm_format(dest, op, &pc, h_flag); + uint32_t imm = Rimm_format(dest, op, &pc, h_flag); sprintf(buffer, "MOVI %s, $%x", dest, imm); @@ -795,7 +795,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // ADDI case 0x68: case 0x69: case 0x6a: case 0x6b: { - UINT32 imm = Rimm_format(dest, op, &pc, 0); + uint32_t imm = Rimm_format(dest, op, &pc, 0); if( !N_VALUE(op) ) { @@ -812,7 +812,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // ADDSI case 0x6c: case 0x6d: case 0x6e: case 0x6f: { - UINT32 imm = Rimm_format(dest, op, &pc, 0); + uint32_t imm = Rimm_format(dest, op, &pc, 0); if( !N_VALUE(op) ) { @@ -829,7 +829,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // CMPBI case 0x70: case 0x71: case 0x72: case 0x73: { - UINT32 imm = Rimm_format(dest, op, &pc, 0); + uint32_t imm = Rimm_format(dest, op, &pc, 0); if( !N_VALUE(op) ) { @@ -849,7 +849,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // ANDNI case 0x74: case 0x75: case 0x76: case 0x77: { - UINT32 imm = Rimm_format(dest, op, &pc, 0); + uint32_t imm = Rimm_format(dest, op, &pc, 0); if( N_VALUE(op) == 31 ) imm = 0x7fffffff; //bit 31 = 0, others = 1 @@ -862,7 +862,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // ORI case 0x78: case 0x79: case 0x7a: case 0x7b: { - UINT32 imm = Rimm_format(dest, op, &pc, 0); + uint32_t imm = Rimm_format(dest, op, &pc, 0); sprintf(buffer, "ORI %s, $%x", dest, imm); @@ -872,7 +872,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // XORI case 0x7c: case 0x7d: case 0x7e: case 0x7f: { - UINT32 imm = Rimm_format(dest, op, &pc, 0); + uint32_t imm = Rimm_format(dest, op, &pc, 0); sprintf(buffer, "XORI %s, $%x", dest, imm); @@ -882,7 +882,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // SHRDI case 0x80: case 0x81: { - UINT8 n = Ln_format(dest, op); + uint8_t n = Ln_format(dest, op); sprintf(buffer, "SHRDI %s, $%x", dest, n); @@ -910,7 +910,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // SARDI case 0x84: case 0x85: { - UINT8 n = Ln_format(dest, op); + uint8_t n = Ln_format(dest, op); sprintf(buffer, "SARDI %s, $%x", dest, n); @@ -938,7 +938,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // SHLDI case 0x88: case 0x89: { - UINT8 n = Ln_format(dest, op); + uint8_t n = Ln_format(dest, op); sprintf(buffer, "SHLDI %s, $%x", dest, n); @@ -992,8 +992,8 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // LDxx.D/A/IOD/IOA case 0x90: case 0x91: case 0x92: case 0x93: { - UINT16 next_op = READ_OP_DASM(pc + 2); - UINT32 dis = RRdis_format(source, dest, op, next_op, pc); + uint16_t next_op = READ_OP_DASM(pc + 2); + uint32_t dis = RRdis_format(source, dest, op, next_op, pc); if( size == 2 ) size = 4; @@ -1110,8 +1110,8 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // LDxx.N/S case 0x94: case 0x95: case 0x96: case 0x97: { - UINT16 next_op = READ_OP_DASM(pc + 2); - UINT32 dis = RRdis_format(source, dest, op, next_op, pc); + uint16_t next_op = READ_OP_DASM(pc + 2); + uint32_t dis = RRdis_format(source, dest, op, next_op, pc); if( size == 2 ) size = 4; @@ -1179,8 +1179,8 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // STxx.D/A/IOD/IOA case 0x98: case 0x99: case 0x9a: case 0x9b: { - UINT16 next_op = READ_OP_DASM(pc + 2); - UINT32 dis = RRdis_format(source, dest, op, next_op, pc); + uint16_t next_op = READ_OP_DASM(pc + 2); + uint32_t dis = RRdis_format(source, dest, op, next_op, pc); if( size == 2 ) size = 4; @@ -1300,8 +1300,8 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // STxx.N/S case 0x9c: case 0x9d: case 0x9e: case 0x9f: { - UINT16 next_op = READ_OP_DASM(pc + 2); - UINT32 dis = RRdis_format(source, dest, op, next_op, pc); + uint16_t next_op = READ_OP_DASM(pc + 2); + uint32_t dis = RRdis_format(source, dest, op, next_op, pc); if( size == 2 ) size = 4; @@ -1372,7 +1372,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // SHRI case 0xa0: case 0xa1: case 0xa2: case 0xa3: { - UINT8 n = Rn_format(dest, op); + uint8_t n = Rn_format(dest, op); sprintf(buffer, "SHRI %s, $%x", dest, n); @@ -1382,7 +1382,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // SARI case 0xa4: case 0xa5: case 0xa6: case 0xa7: { - UINT8 n = Rn_format(dest, op); + uint8_t n = Rn_format(dest, op); sprintf(buffer, "SARI %s, $%x", dest, n); @@ -1392,7 +1392,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // SHLI case 0xa8: case 0xa9: case 0xaa: case 0xab: { - UINT8 n = Rn_format(dest, op); + uint8_t n = Rn_format(dest, op); sprintf(buffer, "SHLI %s, $%x", dest, n); @@ -1420,7 +1420,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // SETxx - SETADR - FETCH case 0xb8: case 0xb9: case 0xba: case 0xbb: { - UINT8 n = Rn_format(dest, op); + uint8_t n = Rn_format(dest, op); if( dest_code == PC_REGISTER && !dest_bit ) { @@ -1576,7 +1576,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // EXTEND case 0xce: { - UINT16 extended_op; + uint16_t extended_op; LL_format(source, dest, op); @@ -1749,7 +1749,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBV case 0xe0: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBV $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1760,7 +1760,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBNV case 0xe1: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBNV $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1771,7 +1771,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBE case 0xe2: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBE $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1782,7 +1782,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBNE case 0xe3: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBNE $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1793,7 +1793,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBC case 0xe4: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBC $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1804,7 +1804,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBNC case 0xe5: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBNC $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1815,7 +1815,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBSE case 0xe6: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBSE $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1826,7 +1826,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBHT case 0xe7: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBHT $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1837,7 +1837,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBN case 0xe8: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBN $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1848,7 +1848,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBNN case 0xe9: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBNN $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1859,7 +1859,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBLE case 0xea: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBLE $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1870,7 +1870,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBGT case 0xeb: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBGT $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1881,7 +1881,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // DBR case 0xec: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "DBR $%x", rel); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); @@ -1902,7 +1902,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // CALL case 0xee: case 0xef: { - UINT32 const_val = LRconst_format(source, dest, op, &pc); + uint32_t const_val = LRconst_format(source, dest, op, &pc); if( source_code == SR_REGISTER && !source_bit ) { @@ -1921,7 +1921,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BV case 0xf0: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BV $%x", rel); @@ -1931,7 +1931,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BNV case 0xf1: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BNV $%x", rel); @@ -1941,7 +1941,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BE case 0xf2: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BE $%x", rel); @@ -1951,7 +1951,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BNE case 0xf3: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BNE $%x", rel); @@ -1961,7 +1961,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BC case 0xf4: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BC $%x", rel); @@ -1971,7 +1971,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BNC case 0xf5: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BNC $%x", rel); @@ -1981,7 +1981,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BSE case 0xf6: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BSE $%x", rel); @@ -1991,7 +1991,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BHT case 0xf7: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BHT $%x", rel); @@ -2001,7 +2001,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BN case 0xf8: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BN $%x", rel); @@ -2011,7 +2011,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BNN case 0xf9: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BNN $%x", rel); @@ -2021,7 +2021,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BLE case 0xfa: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BLE $%x", rel); @@ -2031,7 +2031,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BGT case 0xfb: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BGT $%x", rel); @@ -2041,7 +2041,7 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // BR case 0xfc: { - INT32 rel = PCrel_format(op, pc) + 2; + int32_t rel = PCrel_format(op, pc) + 2; sprintf(buffer, "BR $%x", rel); @@ -2051,8 +2051,8 @@ unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned // TRAPxx - TRAP case 0xfd: case 0xfe: case 0xff: { - UINT8 code = ((op & 0x300) >> 6) | (op & 0x03); - UINT8 trapno = (op & 0xfc) >> 2; + uint8_t code = ((op & 0x300) >> 6) | (op & 0x03); + uint8_t trapno = (op & 0xfc) >> 2; switch( code ) { diff --git a/src/devices/cpu/e132xs/e132xs.cpp b/src/devices/cpu/e132xs/e132xs.cpp index 7d01744147d..8bbdd4f5bbb 100644 --- a/src/devices/cpu/e132xs/e132xs.cpp +++ b/src/devices/cpu/e132xs/e132xs.cpp @@ -203,8 +203,8 @@ after a branch - Changed hyperstone_movi to decrement PC by 2 when G0 (PC) is modified so that the next opcode isn't skipped after a branch - - Changed hyperstone_movi to default to a UINT32 being moved into the register - as opposed to a UINT8. This is wrong, the bit width is quite likely to be + - Changed hyperstone_movi to default to a uint32_t being moved into the register + as opposed to a uint8_t. This is wrong, the bit width is quite likely to be dependent on the n field in the Rimm instruction type. However, vamphalf uses MOVI G0,[FFFF]FBAC (n=$13) since there's apparently no absolute branch opcode. What kind of CPU is this that it doesn't have an absolute jump in its branch @@ -238,10 +238,10 @@ #define EXTRA_U (decode)->extra.u #define EXTRA_S (decode)->extra.s -#define SET_SREG( _data_ ) ((decode)->src_is_local ? set_local_register((decode)->src, (UINT32)_data_) : set_global_register((decode)->src, (UINT32)_data_)) -#define SET_SREGF( _data_ ) ((decode)->src_is_local ? set_local_register((decode)->src + 1, (UINT32)_data_) : set_global_register((decode)->src + 1, (UINT32)_data_)) -#define SET_DREG( _data_ ) ((decode)->dst_is_local ? set_local_register((decode)->dst, (UINT32)_data_) : set_global_register((decode)->dst, (UINT32)_data_)) -#define SET_DREGF( _data_ ) ((decode)->dst_is_local ? set_local_register((decode)->dst + 1, (UINT32)_data_) : set_global_register((decode)->dst + 1, (UINT32)_data_)) +#define SET_SREG( _data_ ) ((decode)->src_is_local ? set_local_register((decode)->src, (uint32_t)_data_) : set_global_register((decode)->src, (uint32_t)_data_)) +#define SET_SREGF( _data_ ) ((decode)->src_is_local ? set_local_register((decode)->src + 1, (uint32_t)_data_) : set_global_register((decode)->src + 1, (uint32_t)_data_)) +#define SET_DREG( _data_ ) ((decode)->dst_is_local ? set_local_register((decode)->dst, (uint32_t)_data_) : set_global_register((decode)->dst, (uint32_t)_data_)) +#define SET_DREGF( _data_ ) ((decode)->dst_is_local ? set_local_register((decode)->dst + 1, (uint32_t)_data_) : set_global_register((decode)->dst + 1, (uint32_t)_data_)) #define SRC_IS_PC (!(decode)->src_is_local && (decode)->src == PC_REGISTER) #define DST_IS_PC (!(decode)->dst_is_local && (decode)->dst == PC_REGISTER) @@ -292,8 +292,8 @@ ADDRESS_MAP_END // hyperstone_device - constructor //------------------------------------------------- -hyperstone_device::hyperstone_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 io_data_width, address_map_constructor internal_map, const char *shortname, const char *source) +hyperstone_device::hyperstone_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t io_data_width, address_map_constructor internal_map, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_BIG, prg_data_width, 32, 0, internal_map), m_io_config("io", ENDIANNESS_BIG, io_data_width, 15), @@ -309,7 +309,7 @@ hyperstone_device::hyperstone_device(const machine_config &mconfig, const char * // e116t_device - constructor //------------------------------------------------- -e116t_device::e116t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e116t_device::e116t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-16T", tag, owner, clock, E116T, 16, 16, ADDRESS_MAP_NAME(e116_4k_iram_map), "e116t", __FILE__) { } @@ -319,7 +319,7 @@ e116t_device::e116t_device(const machine_config &mconfig, const char *tag, devic // e116xt_device - constructor //------------------------------------------------- -e116xt_device::e116xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e116xt_device::e116xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-16XT", tag, owner, clock, E116XT, 16, 16, ADDRESS_MAP_NAME(e116_8k_iram_map), "e116xt", __FILE__) { } @@ -329,7 +329,7 @@ e116xt_device::e116xt_device(const machine_config &mconfig, const char *tag, dev // e116xs_device - constructor //------------------------------------------------- -e116xs_device::e116xs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e116xs_device::e116xs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-16XS", tag, owner, clock, E116XS, 16, 16, ADDRESS_MAP_NAME(e116_16k_iram_map), "e116xs", __FILE__) { } @@ -339,7 +339,7 @@ e116xs_device::e116xs_device(const machine_config &mconfig, const char *tag, dev // e116xsr_device - constructor //------------------------------------------------- -e116xsr_device::e116xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e116xsr_device::e116xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-16XSR", tag, owner, clock, E116XT, 16, 16, ADDRESS_MAP_NAME(e116_16k_iram_map), "e116xsr", __FILE__) { } @@ -349,7 +349,7 @@ e116xsr_device::e116xsr_device(const machine_config &mconfig, const char *tag, d // e132n_device - constructor //------------------------------------------------- -e132n_device::e132n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e132n_device::e132n_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-32N", tag, owner, clock, E132N, 32, 32, ADDRESS_MAP_NAME(e132_4k_iram_map), "e132n", __FILE__) { } @@ -359,7 +359,7 @@ e132n_device::e132n_device(const machine_config &mconfig, const char *tag, devic // e132t_device - constructor //------------------------------------------------- -e132t_device::e132t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e132t_device::e132t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-32T", tag, owner, clock, E132T, 32, 32, ADDRESS_MAP_NAME(e132_4k_iram_map), "e132t", __FILE__) { } @@ -369,7 +369,7 @@ e132t_device::e132t_device(const machine_config &mconfig, const char *tag, devic // e132xn_device - constructor //------------------------------------------------- -e132xn_device::e132xn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e132xn_device::e132xn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-32XN", tag, owner, clock, E132XN, 32, 32, ADDRESS_MAP_NAME(e132_8k_iram_map), "e132xn", __FILE__) { } @@ -379,7 +379,7 @@ e132xn_device::e132xn_device(const machine_config &mconfig, const char *tag, dev // e132xt_device - constructor //------------------------------------------------- -e132xt_device::e132xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e132xt_device::e132xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-32XT", tag, owner, clock, E132XT, 32, 32, ADDRESS_MAP_NAME(e132_8k_iram_map), "e132xt", __FILE__) { } @@ -389,7 +389,7 @@ e132xt_device::e132xt_device(const machine_config &mconfig, const char *tag, dev // e132xs_device - constructor //------------------------------------------------- -e132xs_device::e132xs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e132xs_device::e132xs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-32XS", tag, owner, clock, E132XS, 32, 32, ADDRESS_MAP_NAME(e132_16k_iram_map), "e132xs", __FILE__) { } @@ -399,7 +399,7 @@ e132xs_device::e132xs_device(const machine_config &mconfig, const char *tag, dev // e132xsr_device - constructor //------------------------------------------------- -e132xsr_device::e132xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e132xsr_device::e132xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "E1-32XSR", tag, owner, clock, E132XSR, 32, 32, ADDRESS_MAP_NAME(e132_16k_iram_map), "e132xsr", __FILE__) { } @@ -409,7 +409,7 @@ e132xsr_device::e132xsr_device(const machine_config &mconfig, const char *tag, d // gms30c2116_device - constructor //------------------------------------------------- -gms30c2116_device::gms30c2116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gms30c2116_device::gms30c2116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "GMS30C2116", tag, owner, clock, GMS30C2116, 16, 16, ADDRESS_MAP_NAME(e116_4k_iram_map), "gms30c2116", __FILE__) { } @@ -419,7 +419,7 @@ gms30c2116_device::gms30c2116_device(const machine_config &mconfig, const char * // gms30c2132_device - constructor //------------------------------------------------- -gms30c2132_device::gms30c2132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gms30c2132_device::gms30c2132_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "GMS30C2132", tag, owner, clock, GMS30C2132, 32, 32, ADDRESS_MAP_NAME(e132_4k_iram_map), "gms30c2132", __FILE__) { } @@ -429,7 +429,7 @@ gms30c2132_device::gms30c2132_device(const machine_config &mconfig, const char * // gms30c2216_device - constructor //------------------------------------------------- -gms30c2216_device::gms30c2216_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gms30c2216_device::gms30c2216_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "GMS30C2216", tag, owner, clock, GMS30C2216, 16, 16, ADDRESS_MAP_NAME(e116_8k_iram_map), "gms30c2216", __FILE__) { } @@ -439,15 +439,15 @@ gms30c2216_device::gms30c2216_device(const machine_config &mconfig, const char * // gms30c2232_device - constructor //------------------------------------------------- -gms30c2232_device::gms30c2232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gms30c2232_device::gms30c2232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device(mconfig, "GMS30C2232", tag, owner, clock, GMS30C2232, 32, 32, ADDRESS_MAP_NAME(e132_8k_iram_map), "gms30c2232", __FILE__) { } /* Return the entry point for a determinated trap */ -UINT32 hyperstone_device::get_trap_addr(UINT8 trapno) +uint32_t hyperstone_device::get_trap_addr(uint8_t trapno) { - UINT32 addr; + uint32_t addr; if( m_trap_entry == 0xffffff00 ) /* @ MEM3 */ { addr = trapno * 4; @@ -462,9 +462,9 @@ UINT32 hyperstone_device::get_trap_addr(UINT8 trapno) } /* Return the entry point for a determinated emulated code (the one for "extend" opcode is reserved) */ -UINT32 hyperstone_device::get_emu_code_addr(UINT8 num) /* num is OP */ +uint32_t hyperstone_device::get_emu_code_addr(uint8_t num) /* num is OP */ { - UINT32 addr; + uint32_t addr; if( m_trap_entry == 0xffffff00 ) /* @ MEM3 */ { addr = (m_trap_entry - 0x100) | ((num & 0xf) << 4); @@ -569,7 +569,7 @@ void hyperstone_device::hyperstone_set_trap_entry(int which) #define SET_LOW_SR(val) (SR = (SR & 0xffff0000) | ((val) & 0x0000ffff)) // when SR is addressed, only low 16 bits can be changed -#define CHECK_C(x) (SR = (SR & ~0x00000001) | (((x) & (((UINT64)1) << 32)) ? 1 : 0 )) +#define CHECK_C(x) (SR = (SR & ~0x00000001) | (((x) & (((uint64_t)1) << 32)) ? 1 : 0 )) #define CHECK_VADD(x,y,z) (SR = (SR & ~0x00000008) | ((((x) ^ (z)) & ((y) ^ (z)) & 0x80000000) ? 8: 0)) #define CHECK_VADD3(x,y,w,z) (SR = (SR & ~0x00000008) | ((((x) ^ (z)) & ((y) ^ (z)) & ((w) ^ (z)) & 0x80000000) ? 8: 0)) #define CHECK_VSUB(x,y,z) (SR = (SR & ~0x00000008) | ((((z) ^ (y)) & ((y) ^ (x)) & 0x80000000) ? 8: 0)) @@ -582,16 +582,16 @@ void hyperstone_device::hyperstone_set_trap_entry(int which) //the user program can only changes the above 2 flags -UINT32 hyperstone_device::compute_tr() +uint32_t hyperstone_device::compute_tr() { - UINT64 cycles_since_base = total_cycles() - m_tr_base_cycles; - UINT64 clocks_since_base = cycles_since_base >> m_clck_scale; + uint64_t cycles_since_base = total_cycles() - m_tr_base_cycles; + uint64_t clocks_since_base = cycles_since_base >> m_clck_scale; return m_tr_base_value + (clocks_since_base / m_tr_clocks_per_tick); } void hyperstone_device::update_timer_prescale() { - UINT32 prevtr = compute_tr(); + uint32_t prevtr = compute_tr(); TPR &= ~0x80000000; m_clck_scale = (TPR >> 26) & m_clock_scale_mask; m_clock_cycles_1 = 1 << m_clck_scale; @@ -605,26 +605,26 @@ void hyperstone_device::update_timer_prescale() void hyperstone_device::adjust_timer_interrupt() { - UINT64 cycles_since_base = total_cycles() - m_tr_base_cycles; - UINT64 clocks_since_base = cycles_since_base >> m_clck_scale; - UINT64 cycles_until_next_clock = cycles_since_base - (clocks_since_base << m_clck_scale); + uint64_t cycles_since_base = total_cycles() - m_tr_base_cycles; + uint64_t clocks_since_base = cycles_since_base >> m_clck_scale; + uint64_t cycles_until_next_clock = cycles_since_base - (clocks_since_base << m_clck_scale); if (cycles_until_next_clock == 0) - cycles_until_next_clock = (UINT64)(1 << m_clck_scale); + cycles_until_next_clock = (uint64_t)(1 << m_clck_scale); /* special case: if we have a change pending, set a timer to fire then */ if (TPR & 0x80000000) { - UINT64 clocks_until_int = m_tr_clocks_per_tick - (clocks_since_base % m_tr_clocks_per_tick); - UINT64 cycles_until_int = (clocks_until_int << m_clck_scale) + cycles_until_next_clock; + uint64_t clocks_until_int = m_tr_clocks_per_tick - (clocks_since_base % m_tr_clocks_per_tick); + uint64_t cycles_until_int = (clocks_until_int << m_clck_scale) + cycles_until_next_clock; m_timer->adjust(cycles_to_attotime(cycles_until_int + 1), 1); } /* else if the timer interrupt is enabled, configure it to fire at the appropriate time */ else if (!(FCR & 0x00800000)) { - UINT32 curtr = m_tr_base_value + (clocks_since_base / m_tr_clocks_per_tick); - UINT32 delta = TCR - curtr; + uint32_t curtr = m_tr_base_value + (clocks_since_base / m_tr_clocks_per_tick); + uint32_t delta = TCR - curtr; if (delta > 0x80000000) { if (!m_timer_int_pending) @@ -632,8 +632,8 @@ void hyperstone_device::adjust_timer_interrupt() } else { - UINT64 clocks_until_int = mulu_32x32(delta, m_tr_clocks_per_tick); - UINT64 cycles_until_int = (clocks_until_int << m_clck_scale) + cycles_until_next_clock; + uint64_t clocks_until_int = mulu_32x32(delta, m_tr_clocks_per_tick); + uint64_t cycles_until_int = (clocks_until_int << m_clck_scale) + cycles_until_next_clock; m_timer->adjust(cycles_to_attotime(cycles_until_int)); } } @@ -663,7 +663,7 @@ TIMER_CALLBACK_MEMBER( hyperstone_device::timer_callback ) -UINT32 hyperstone_device::get_global_register(UINT8 code) +uint32_t hyperstone_device::get_global_register(uint8_t code) { /* if( code >= 16 ) @@ -707,14 +707,14 @@ UINT32 hyperstone_device::get_global_register(UINT8 code) return m_global_regs[code]; } -void hyperstone_device::set_local_register(UINT8 code, UINT32 val) +void hyperstone_device::set_local_register(uint8_t code, uint32_t val) { - UINT8 new_code = (code + GET_FP) % 64; + uint8_t new_code = (code + GET_FP) % 64; m_local_regs[new_code] = val; } -void hyperstone_device::set_global_register(UINT8 code, UINT32 val) +void hyperstone_device::set_global_register(uint8_t code, uint32_t val) { //TODO: add correct FER set instruction @@ -731,7 +731,7 @@ void hyperstone_device::set_global_register(UINT8 code, UINT32 val) } else { - UINT32 oldval = m_global_regs[code]; + uint32_t oldval = m_global_regs[code]; if( code != ISR_REGISTER ) m_global_regs[code] = val; else @@ -831,11 +831,11 @@ void hyperstone_device::set_global_register(UINT8 code, UINT32 val) #define LOCAL 1 -static const INT32 immediate_values[32] = +static const int32_t immediate_values[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 0, 0, 0, 32, 64, 128, static_cast(0x80000000), + 16, 0, 0, 0, 32, 64, 128, static_cast(0x80000000), -8, -7, -6, -5, -4, -3, -2, -1 }; @@ -846,7 +846,7 @@ do { \ if(local) \ { \ - UINT8 code = (decode)->src; \ + uint8_t code = (decode)->src; \ (decode)->src_is_local = 1; \ code = ((decode)->src + GET_FP) % 64; /* registers offset by frame pointer */\ SREG = m_local_regs[code]; \ @@ -887,7 +887,7 @@ do { \ if(local) \ { \ - UINT8 code = (decode)->dst; \ + uint8_t code = (decode)->dst; \ (decode)->dst_is_local = 1; \ code = ((decode)->dst + GET_FP) % 64; /* registers offset by frame pointer */\ DREG = m_local_regs[code]; \ @@ -1023,14 +1023,14 @@ do #define decode_const(decode) \ do \ { \ - UINT16 imm_1 = READ_OP(PC); \ + uint16_t imm_1 = READ_OP(PC); \ \ PC += 2; \ m_instruction_length = 2; \ \ if( E_BIT(imm_1) ) \ { \ - UINT16 imm_2 = READ_OP(PC); \ + uint16_t imm_2 = READ_OP(PC); \ \ PC += 2; \ m_instruction_length = 3; \ @@ -1059,7 +1059,7 @@ do { \ if( OP & 0x80 ) \ { \ - UINT16 next = READ_OP(PC); \ + uint16_t next = READ_OP(PC); \ \ PC += 2; \ m_instruction_length = 2; \ @@ -1082,7 +1082,7 @@ do #define decode_dis(decode) \ do \ { \ - UINT16 next_1 = READ_OP(PC); \ + uint16_t next_1 = READ_OP(PC); \ \ PC += 2; \ m_instruction_length = 2; \ @@ -1091,7 +1091,7 @@ do \ if( E_BIT(next_1) ) \ { \ - UINT16 next_2 = READ_OP(PC); \ + uint16_t next_2 = READ_OP(PC); \ \ PC += 2; \ m_instruction_length = 3; \ @@ -1118,7 +1118,7 @@ do #define decode_lim(decode) \ do \ { \ - UINT32 next = READ_OP(PC); \ + uint32_t next = READ_OP(PC); \ PC += 2; \ m_instruction_length = 2; \ \ @@ -1284,10 +1284,10 @@ void hyperstone_device::execute_dbr(struct hyperstone_device::regs_decode *decod } -void hyperstone_device::execute_trap(UINT32 addr) +void hyperstone_device::execute_trap(uint32_t addr) { - UINT8 reg; - UINT32 oldSR; + uint8_t reg; + uint32_t oldSR; reg = GET_FP + GET_FL; SET_ILC(m_instruction_length & 3); @@ -1312,10 +1312,10 @@ void hyperstone_device::execute_trap(UINT32 addr) } -void hyperstone_device::execute_int(UINT32 addr) +void hyperstone_device::execute_int(uint32_t addr) { - UINT8 reg; - UINT32 oldSR; + uint8_t reg; + uint32_t oldSR; reg = GET_FP + GET_FL; SET_ILC(m_instruction_length & 3); @@ -1341,10 +1341,10 @@ void hyperstone_device::execute_int(UINT32 addr) } /* TODO: mask Parity Error and Extended Overflow exceptions */ -void hyperstone_device::execute_exception(UINT32 addr) +void hyperstone_device::execute_exception(uint32_t addr) { - UINT8 reg; - UINT32 oldSR; + uint8_t reg; + uint32_t oldSR; reg = GET_FP + GET_FL; SET_ILC(m_instruction_length & 3); @@ -1371,10 +1371,10 @@ void hyperstone_device::execute_exception(UINT32 addr) void hyperstone_device::execute_software(struct hyperstone_device::regs_decode *decode) { - UINT8 reg; - UINT32 oldSR; - UINT32 addr; - UINT32 stack_of_dst; + uint8_t reg; + uint32_t oldSR; + uint32_t addr; + uint32_t stack_of_dst; SET_ILC(1); @@ -1532,8 +1532,8 @@ void hyperstone_device::device_start() void hyperstone_device::init(int scale_mask) { - memset(m_global_regs, 0, sizeof(UINT32) * 32); - memset(m_local_regs, 0, sizeof(UINT32) * 64); + memset(m_global_regs, 0, sizeof(uint32_t) * 32); + memset(m_local_regs, 0, sizeof(uint32_t) * 64); m_ppc = 0; m_op = 0; m_trap_entry = 0; @@ -1882,7 +1882,7 @@ void hyperstone_device::state_string_export(const device_state_entry &entry, std // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 hyperstone_device::disasm_min_opcode_bytes() const +uint32_t hyperstone_device::disasm_min_opcode_bytes() const { return 2; } @@ -1893,7 +1893,7 @@ UINT32 hyperstone_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 hyperstone_device::disasm_max_opcode_bytes() const +uint32_t hyperstone_device::disasm_max_opcode_bytes() const { return 6; } @@ -1904,7 +1904,7 @@ UINT32 hyperstone_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t hyperstone_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hyperstone_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( hyperstone ); return dasm_hyperstone( buffer, pc, oprom, GET_H, GET_FP ); @@ -1914,7 +1914,7 @@ offs_t hyperstone_device::disasm_disassemble(char *buffer, offs_t pc, const UINT void hyperstone_device::hyperstone_chk(struct hyperstone_device::regs_decode *decode) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_RANGE_ERROR); if( SRC_IS_SR ) { @@ -1944,8 +1944,8 @@ void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *d { // RET instruction - UINT8 old_s, old_l; - INT8 difference; // really it's 7 bits + uint8_t old_s, old_l; + int8_t difference; // really it's 7 bits if( SRC_IS_PC || SRC_IS_SR ) { @@ -1966,7 +1966,7 @@ void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *d if( (!old_s && GET_S) || (!GET_S && !old_l && GET_L)) { - UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); execute_exception(addr); } @@ -1974,7 +1974,7 @@ void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *d /* convert to 8 bits */ if(difference > 63) - difference = (INT8)(difference|0x80); + difference = (int8_t)(difference|0x80); else if( difference < -64 ) difference = difference & 0x7f; @@ -2004,7 +2004,7 @@ void hyperstone_device::hyperstone_movd(struct hyperstone_device::regs_decode *d } else // Rd doesn't denote PC and Rs doesn't denote SR { - UINT64 tmp; + uint64_t tmp; SET_DREG(SREG); SET_DREGF(SREGF); @@ -2031,7 +2031,7 @@ void hyperstone_device::hyperstone_divu(struct hyperstone_device::regs_decode *d } else { - UINT64 dividend; + uint64_t dividend; dividend = concat_64(DREG, DREGF); @@ -2040,14 +2040,14 @@ void hyperstone_device::hyperstone_divu(struct hyperstone_device::regs_decode *d //Rd//Rdf -> undefined //Z -> undefined //N -> undefined - UINT32 addr; + uint32_t addr; SET_V(1); addr = get_trap_addr(TRAPNO_RANGE_ERROR); execute_exception(addr); } else { - UINT32 quotient, remainder; + uint32_t quotient, remainder; /* TODO: add quotient overflow */ quotient = dividend / SREG; @@ -2080,27 +2080,27 @@ void hyperstone_device::hyperstone_divs(struct hyperstone_device::regs_decode *d } else { - INT64 dividend; + int64_t dividend; - dividend = (INT64) concat_64(DREG, DREGF); + dividend = (int64_t) concat_64(DREG, DREGF); if( SREG == 0 || (DREG & 0x80000000) ) { //Rd//Rdf -> undefined //Z -> undefined //N -> undefined - UINT32 addr; + uint32_t addr; SET_V(1); addr = get_trap_addr(TRAPNO_RANGE_ERROR); execute_exception(addr); } else { - INT32 quotient, remainder; + int32_t quotient, remainder; /* TODO: add quotient overflow */ - quotient = dividend / ((INT32)(SREG)); - remainder = dividend % ((INT32)(SREG)); + quotient = dividend / ((int32_t)(SREG)); + remainder = dividend % ((int32_t)(SREG)); SET_DREG(remainder); SET_DREGF(quotient); @@ -2131,12 +2131,12 @@ void hyperstone_device::hyperstone_xm(struct hyperstone_device::regs_decode *dec case 3: if( !SRC_IS_PC && (SREG > EXTRA_U) ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_RANGE_ERROR); execute_exception(addr); } else if( SRC_IS_PC && (SREG >= EXTRA_U) ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_RANGE_ERROR); execute_exception(addr); } else @@ -2174,12 +2174,12 @@ void hyperstone_device::hyperstone_mask(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_sum(struct hyperstone_device::regs_decode *decode) { - UINT64 tmp; + uint64_t tmp; if( SRC_IS_SR ) SREG = GET_C; - tmp = (UINT64)(SREG) + (UINT64)(EXTRA_U); + tmp = (uint64_t)(SREG) + (uint64_t)(EXTRA_U); CHECK_C(tmp); CHECK_VADD(SREG,EXTRA_U,tmp); @@ -2198,20 +2198,20 @@ void hyperstone_device::hyperstone_sum(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_sums(struct hyperstone_device::regs_decode *decode) { - INT32 res; - INT64 tmp; + int32_t res; + int64_t tmp; if( SRC_IS_SR ) SREG = GET_C; - tmp = (INT64)((INT32)(SREG)) + (INT64)(EXTRA_S); + tmp = (int64_t)((int32_t)(SREG)) + (int64_t)(EXTRA_S); CHECK_VADD(SREG,EXTRA_S,tmp); //#if SETCARRYS // CHECK_C(tmp); //#endif - res = (INT32)(SREG) + EXTRA_S; + res = (int32_t)(SREG) + EXTRA_S; SET_DREG(res); @@ -2222,14 +2222,14 @@ void hyperstone_device::hyperstone_sums(struct hyperstone_device::regs_decode *d if( GET_V && !SRC_IS_SR ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_RANGE_ERROR); execute_exception(addr); } } void hyperstone_device::hyperstone_cmp(struct hyperstone_device::regs_decode *decode) { - UINT64 tmp; + uint64_t tmp; if( SRC_IS_SR ) SREG = GET_C; @@ -2239,12 +2239,12 @@ void hyperstone_device::hyperstone_cmp(struct hyperstone_device::regs_decode *de else SET_Z(0); - if( (INT32) DREG < (INT32) SREG ) + if( (int32_t) DREG < (int32_t) SREG ) SET_N(1); else SET_N(0); - tmp = (UINT64)(DREG) - (UINT64)(SREG); + tmp = (uint64_t)(DREG) - (uint64_t)(SREG); CHECK_VSUB(SREG,DREG,tmp); if( DREG < SREG ) @@ -2259,7 +2259,7 @@ void hyperstone_device::hyperstone_mov(struct hyperstone_device::regs_decode *de { if( !GET_S && decode->dst >= 16 ) { - UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); execute_exception(addr); } @@ -2277,12 +2277,12 @@ void hyperstone_device::hyperstone_mov(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_add(struct hyperstone_device::regs_decode *decode) { - UINT64 tmp; + uint64_t tmp; if( SRC_IS_SR ) SREG = GET_C; - tmp = (UINT64)(SREG) + (UINT64)(DREG); + tmp = (uint64_t)(SREG) + (uint64_t)(DREG); CHECK_C(tmp); CHECK_VADD(SREG,DREG,tmp); @@ -2300,13 +2300,13 @@ void hyperstone_device::hyperstone_add(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_adds(struct hyperstone_device::regs_decode *decode) { - INT32 res; - INT64 tmp; + int32_t res; + int64_t tmp; if( SRC_IS_SR ) SREG = GET_C; - tmp = (INT64)((INT32)(SREG)) + (INT64)((INT32)(DREG)); + tmp = (int64_t)((int32_t)(SREG)) + (int64_t)((int32_t)(DREG)); CHECK_VADD(SREG,DREG,tmp); @@ -2314,7 +2314,7 @@ void hyperstone_device::hyperstone_adds(struct hyperstone_device::regs_decode *d // CHECK_C(tmp); //#endif - res = (INT32)(SREG) + (INT32)(DREG); + res = (int32_t)(SREG) + (int32_t)(DREG); SET_DREG(res); SET_Z( res == 0 ? 1 : 0 ); @@ -2324,7 +2324,7 @@ void hyperstone_device::hyperstone_adds(struct hyperstone_device::regs_decode *d if( GET_V ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_RANGE_ERROR); execute_exception(addr); } } @@ -2368,16 +2368,16 @@ void hyperstone_device::hyperstone_xor(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_subc(struct hyperstone_device::regs_decode *decode) { - UINT64 tmp; + uint64_t tmp; if( SRC_IS_SR ) { - tmp = (UINT64)(DREG) - (UINT64)(GET_C); + tmp = (uint64_t)(DREG) - (uint64_t)(GET_C); CHECK_VSUB(GET_C,DREG,tmp); } else { - tmp = (UINT64)(DREG) - ((UINT64)(SREG) + (UINT64)(GET_C)); + tmp = (uint64_t)(DREG) - ((uint64_t)(SREG) + (uint64_t)(GET_C)); //CHECK! CHECK_VSUB(SREG + GET_C,DREG,tmp); } @@ -2412,12 +2412,12 @@ void hyperstone_device::hyperstone_not(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_sub(struct hyperstone_device::regs_decode *decode) { - UINT64 tmp; + uint64_t tmp; if( SRC_IS_SR ) SREG = GET_C; - tmp = (UINT64)(DREG) - (UINT64)(SREG); + tmp = (uint64_t)(DREG) - (uint64_t)(SREG); CHECK_C(tmp); CHECK_VSUB(SREG,DREG,tmp); @@ -2435,13 +2435,13 @@ void hyperstone_device::hyperstone_sub(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_subs(struct hyperstone_device::regs_decode *decode) { - INT32 res; - INT64 tmp; + int32_t res; + int64_t tmp; if( SRC_IS_SR ) SREG = GET_C; - tmp = (INT64)((INT32)(DREG)) - (INT64)((INT32)(SREG)); + tmp = (int64_t)((int32_t)(DREG)) - (int64_t)((int32_t)(SREG)); //#ifdef SETCARRYS // CHECK_C(tmp); @@ -2449,7 +2449,7 @@ void hyperstone_device::hyperstone_subs(struct hyperstone_device::regs_decode *d CHECK_VSUB(SREG,DREG,tmp); - res = (INT32)(DREG) - (INT32)(SREG); + res = (int32_t)(DREG) - (int32_t)(SREG); SET_DREG(res); @@ -2460,23 +2460,23 @@ void hyperstone_device::hyperstone_subs(struct hyperstone_device::regs_decode *d if( GET_V ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_RANGE_ERROR); execute_exception(addr); } } void hyperstone_device::hyperstone_addc(struct hyperstone_device::regs_decode *decode) { - UINT64 tmp; + uint64_t tmp; if( SRC_IS_SR ) { - tmp = (UINT64)(DREG) + (UINT64)(GET_C); + tmp = (uint64_t)(DREG) + (uint64_t)(GET_C); CHECK_VADD(DREG,GET_C,tmp); } else { - tmp = (UINT64)(SREG) + (UINT64)(DREG) + (UINT64)(GET_C); + tmp = (uint64_t)(SREG) + (uint64_t)(DREG) + (uint64_t)(GET_C); //CHECK! //CHECK_VADD1: V = (DREG == 0x7FFF) && (C == 1); @@ -2518,12 +2518,12 @@ void hyperstone_device::hyperstone_and(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_neg(struct hyperstone_device::regs_decode *decode) { - UINT64 tmp; + uint64_t tmp; if( SRC_IS_SR ) SREG = GET_C; - tmp = -(UINT64)(SREG); + tmp = -(uint64_t)(SREG); CHECK_C(tmp); CHECK_VSUB(SREG,0,tmp); @@ -2539,20 +2539,20 @@ void hyperstone_device::hyperstone_neg(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_negs(struct hyperstone_device::regs_decode *decode) { - INT32 res; - INT64 tmp; + int32_t res; + int64_t tmp; if( SRC_IS_SR ) SREG = GET_C; - tmp = -(INT64)((INT32)(SREG)); + tmp = -(int64_t)((int32_t)(SREG)); CHECK_VSUB(SREG,0,tmp); //#if SETCARRYS // CHECK_C(tmp); //#endif - res = -(INT32)(SREG); + res = -(int32_t)(SREG); SET_DREG(res); @@ -2564,16 +2564,16 @@ void hyperstone_device::hyperstone_negs(struct hyperstone_device::regs_decode *d if( GET_V && !SRC_IS_SR ) //trap doesn't occur when source is SR { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_RANGE_ERROR); execute_exception(addr); } } void hyperstone_device::hyperstone_cmpi(struct hyperstone_device::regs_decode *decode) { - UINT64 tmp; + uint64_t tmp; - tmp = (UINT64)(DREG) - (UINT64)(EXTRA_U); + tmp = (uint64_t)(DREG) - (uint64_t)(EXTRA_U); CHECK_VSUB(EXTRA_U,DREG,tmp); if( DREG == EXTRA_U ) @@ -2581,7 +2581,7 @@ void hyperstone_device::hyperstone_cmpi(struct hyperstone_device::regs_decode *d else SET_Z(0); - if( (INT32) DREG < (INT32) EXTRA_U ) + if( (int32_t) DREG < (int32_t) EXTRA_U ) SET_N(1); else SET_N(0); @@ -2598,7 +2598,7 @@ void hyperstone_device::hyperstone_movi(struct hyperstone_device::regs_decode *d { if( !GET_S && decode->dst >= 16 ) { - UINT32 addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_PRIVILEGE_ERROR); execute_exception(addr); } @@ -2619,8 +2619,8 @@ void hyperstone_device::hyperstone_movi(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_addi(struct hyperstone_device::regs_decode *decode) { - UINT32 imm; - UINT64 tmp; + uint32_t imm; + uint64_t tmp; if( N_VALUE ) imm = EXTRA_U; @@ -2628,7 +2628,7 @@ void hyperstone_device::hyperstone_addi(struct hyperstone_device::regs_decode *d imm = GET_C & ((GET_Z == 0 ? 1 : 0) | (DREG & 0x01)); - tmp = (UINT64)(imm) + (UINT64)(DREG); + tmp = (uint64_t)(imm) + (uint64_t)(DREG); CHECK_C(tmp); CHECK_VADD(imm,DREG,tmp); @@ -2646,22 +2646,22 @@ void hyperstone_device::hyperstone_addi(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_addsi(struct hyperstone_device::regs_decode *decode) { - INT32 imm, res; - INT64 tmp; + int32_t imm, res; + int64_t tmp; if( N_VALUE ) imm = EXTRA_S; else imm = GET_C & ((GET_Z == 0 ? 1 : 0) | (DREG & 0x01)); - tmp = (INT64)(imm) + (INT64)((INT32)(DREG)); + tmp = (int64_t)(imm) + (int64_t)((int32_t)(DREG)); CHECK_VADD(imm,DREG,tmp); //#if SETCARRYS // CHECK_C(tmp); //#endif - res = imm + (INT32)(DREG); + res = imm + (int32_t)(DREG); SET_DREG(res); @@ -2672,14 +2672,14 @@ void hyperstone_device::hyperstone_addsi(struct hyperstone_device::regs_decode * if( GET_V ) { - UINT32 addr = get_trap_addr(TRAPNO_RANGE_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_RANGE_ERROR); execute_exception(addr); } } void hyperstone_device::hyperstone_cmpbi(struct hyperstone_device::regs_decode *decode) { - UINT32 imm; + uint32_t imm; if( N_VALUE ) { @@ -2708,7 +2708,7 @@ void hyperstone_device::hyperstone_cmpbi(struct hyperstone_device::regs_decode * void hyperstone_device::hyperstone_andni(struct hyperstone_device::regs_decode *decode) { - UINT32 imm; + uint32_t imm; if( N_VALUE == 31 ) imm = 0x7fffffff; // bit 31 = 0, others = 1 @@ -2745,8 +2745,8 @@ void hyperstone_device::hyperstone_xori(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_shrdi(struct hyperstone_device::regs_decode *decode) { - UINT32 low_order, high_order; - UINT64 val; + uint32_t low_order, high_order; + uint64_t val; high_order = DREG; low_order = DREGF; @@ -2773,9 +2773,9 @@ void hyperstone_device::hyperstone_shrdi(struct hyperstone_device::regs_decode * void hyperstone_device::hyperstone_shrd(struct hyperstone_device::regs_decode *decode) { - UINT32 low_order, high_order; - UINT64 val; - UINT8 n = SREG & 0x1f; + uint32_t low_order, high_order; + uint64_t val; + uint8_t n = SREG & 0x1f; // result undefined if Ls denotes the same register as Ld or Ldf if( SAME_SRC_DST || SAME_SRC_DSTF ) @@ -2811,8 +2811,8 @@ void hyperstone_device::hyperstone_shrd(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_shr(struct hyperstone_device::regs_decode *decode) { - UINT32 ret; - UINT8 n; + uint32_t ret; + uint8_t n; n = SREG & 0x1f; ret = DREG; @@ -2833,9 +2833,9 @@ void hyperstone_device::hyperstone_shr(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_sardi(struct hyperstone_device::regs_decode *decode) { - UINT32 low_order, high_order; - UINT64 val; - UINT8 sign_bit; + uint32_t low_order, high_order; + uint64_t val; + uint8_t sign_bit; high_order = DREG; low_order = DREGF; @@ -2873,9 +2873,9 @@ void hyperstone_device::hyperstone_sardi(struct hyperstone_device::regs_decode * void hyperstone_device::hyperstone_sard(struct hyperstone_device::regs_decode *decode) { - UINT32 low_order, high_order; - UINT64 val; - UINT8 n, sign_bit; + uint32_t low_order, high_order; + uint64_t val; + uint8_t n, sign_bit; n = SREG & 0x1f; @@ -2923,8 +2923,8 @@ void hyperstone_device::hyperstone_sard(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_sar(struct hyperstone_device::regs_decode *decode) { - UINT32 ret; - UINT8 n, sign_bit; + uint32_t ret; + uint8_t n, sign_bit; n = SREG & 0x1f; ret = DREG; @@ -2955,15 +2955,15 @@ void hyperstone_device::hyperstone_sar(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_shldi(struct hyperstone_device::regs_decode *decode) { - UINT32 low_order, high_order, tmp; - UINT64 val, mask; + uint32_t low_order, high_order, tmp; + uint64_t val, mask; high_order = DREG; low_order = DREGF; val = concat_64(high_order, low_order); SET_C( (N_VALUE)?(((val<<(N_VALUE-1))&U64(0x8000000000000000))?1:0):0); - mask = ((((UINT64)1) << (32 - N_VALUE)) - 1) ^ 0xffffffff; + mask = ((((uint64_t)1) << (32 - N_VALUE)) - 1) ^ 0xffffffff; tmp = high_order << N_VALUE; if( ((high_order & mask) && (!(tmp & 0x80000000))) || @@ -2988,8 +2988,8 @@ void hyperstone_device::hyperstone_shldi(struct hyperstone_device::regs_decode * void hyperstone_device::hyperstone_shld(struct hyperstone_device::regs_decode *decode) { - UINT32 low_order, high_order, tmp, n; - UINT64 val, mask; + uint32_t low_order, high_order, tmp, n; + uint64_t val, mask; n = SREG & 0x1f; @@ -3003,7 +3003,7 @@ void hyperstone_device::hyperstone_shld(struct hyperstone_device::regs_decode *d high_order = DREG; low_order = DREGF; - mask = ((((UINT64)1) << (32 - n)) - 1) ^ 0xffffffff; + mask = ((((uint64_t)1) << (32 - n)) - 1) ^ 0xffffffff; val = concat_64(high_order, low_order); SET_C( (n)?(((val<<(n-1))&U64(0x8000000000000000))?1:0):0); @@ -3032,12 +3032,12 @@ void hyperstone_device::hyperstone_shld(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_shl(struct hyperstone_device::regs_decode *decode) { - UINT32 base, ret, n; - UINT64 mask; + uint32_t base, ret, n; + uint64_t mask; n = SREG & 0x1f; base = DREG; - mask = ((((UINT64)1) << (32 - n)) - 1) ^ 0xffffffff; + mask = ((((uint64_t)1) << (32 - n)) - 1) ^ 0xffffffff; SET_C( (n)?(((base<<(n-1))&0x80000000)?1:0):0); ret = base << n; @@ -3061,8 +3061,8 @@ void hyperstone_device::reserved(struct hyperstone_device::regs_decode *decode) void hyperstone_device::hyperstone_testlz(struct hyperstone_device::regs_decode *decode) { - UINT8 zeros = 0; - UINT32 mask; + uint8_t zeros = 0; + uint32_t mask; for( mask = 0x80000000; ; mask >>= 1 ) { @@ -3082,15 +3082,15 @@ void hyperstone_device::hyperstone_testlz(struct hyperstone_device::regs_decode void hyperstone_device::hyperstone_rol(struct hyperstone_device::regs_decode *decode) { - UINT32 val, base; - UINT8 n; - UINT64 mask; + uint32_t val, base; + uint8_t n; + uint64_t mask; n = SREG & 0x1f; val = base = DREG; - mask = ((((UINT64)1) << (32 - n)) - 1) ^ 0xffffffff; + mask = ((((uint64_t)1) << (32 - n)) - 1) ^ 0xffffffff; while( n > 0 ) { @@ -3119,7 +3119,7 @@ void hyperstone_device::hyperstone_rol(struct hyperstone_device::regs_decode *de //TODO: add trap error void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode *decode) { - UINT32 load; + uint32_t load; if( DST_IS_SR ) { @@ -3275,7 +3275,7 @@ void hyperstone_device::hyperstone_ldxx1(struct hyperstone_device::regs_decode * void hyperstone_device::hyperstone_ldxx2(struct hyperstone_device::regs_decode *decode) { - UINT32 load; + uint32_t load; if( DST_IS_PC || DST_IS_SR ) { @@ -3623,7 +3623,7 @@ void hyperstone_device::hyperstone_stxx2(struct hyperstone_device::regs_decode * void hyperstone_device::hyperstone_shri(struct hyperstone_device::regs_decode *decode) { - UINT32 val; + uint32_t val; val = DREG; @@ -3643,8 +3643,8 @@ void hyperstone_device::hyperstone_shri(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_sari(struct hyperstone_device::regs_decode *decode) { - UINT32 val; - UINT8 sign_bit; + uint32_t val; + uint8_t sign_bit; val = DREG; sign_bit = (val & 0x80000000) >> 31; @@ -3674,12 +3674,12 @@ void hyperstone_device::hyperstone_sari(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_shli(struct hyperstone_device::regs_decode *decode) { - UINT32 val, val2; - UINT64 mask; + uint32_t val, val2; + uint64_t mask; val = DREG; SET_C( (N_VALUE)?(((val<<(N_VALUE-1))&0x80000000)?1:0):0); - mask = ((((UINT64)1) << (32 - N_VALUE)) - 1) ^ 0xffffffff; + mask = ((((uint64_t)1) << (32 - N_VALUE)) - 1) ^ 0xffffffff; val2 = val << N_VALUE; if( ((val & mask) && (!(val2 & 0x80000000))) || @@ -3697,8 +3697,8 @@ void hyperstone_device::hyperstone_shli(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_mulu(struct hyperstone_device::regs_decode *decode) { - UINT32 low_order, high_order; - UINT64 double_word; + uint32_t low_order, high_order; + uint64_t double_word; // PC or SR aren't denoted, else result is undefined if( SRC_IS_PC || SRC_IS_SR || DST_IS_PC || DST_IS_SR ) @@ -3707,7 +3707,7 @@ void hyperstone_device::hyperstone_mulu(struct hyperstone_device::regs_decode *d } else { - double_word = (UINT64)SREG *(UINT64)DREG; + double_word = (uint64_t)SREG *(uint64_t)DREG; low_order = double_word & 0xffffffff; high_order = double_word >> 32; @@ -3727,8 +3727,8 @@ void hyperstone_device::hyperstone_mulu(struct hyperstone_device::regs_decode *d void hyperstone_device::hyperstone_muls(struct hyperstone_device::regs_decode *decode) { - UINT32 low_order, high_order; - INT64 double_word; + uint32_t low_order, high_order; + int64_t double_word; // PC or SR aren't denoted, else result is undefined if( SRC_IS_PC || SRC_IS_SR || DST_IS_PC || DST_IS_SR ) @@ -3737,7 +3737,7 @@ void hyperstone_device::hyperstone_muls(struct hyperstone_device::regs_decode *d } else { - double_word = (INT64)(INT32)(SREG) * (INT64)(INT32)(DREG); + double_word = (int64_t)(int32_t)(SREG) * (int64_t)(int32_t)(DREG); low_order = double_word & 0xffffffff; high_order = double_word >> 32; @@ -3776,7 +3776,7 @@ void hyperstone_device::hyperstone_set(struct hyperstone_device::regs_decode *de // SETADR case 0: { - UINT32 val; + uint32_t val; val = (SP & 0xfffffe00) | (GET_FP << 2); //plus carry into bit 9 @@ -4102,7 +4102,7 @@ void hyperstone_device::hyperstone_set(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_mul(struct hyperstone_device::regs_decode *decode) { - UINT32 single_word; + uint32_t single_word; // PC or SR aren't denoted, else result is undefined if( SRC_IS_PC || SRC_IS_SR || DST_IS_PC || DST_IS_SR ) @@ -4212,7 +4212,7 @@ void hyperstone_device::hyperstone_fcvtd(struct hyperstone_device::regs_decode * void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode *decode) { //TODO: add locks, overflow error and other things - UINT32 vals, vald; + uint32_t vals, vald; vals = SREG; vald = DREG; @@ -4223,7 +4223,7 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode case EMUL: case 0x100: // used in "N" type cpu { - UINT32 result; + uint32_t result; result = vals * vald; SET_G_REG(15, result); @@ -4233,9 +4233,9 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // unsigned multiplication, double word product case EMULU: { - UINT64 result; + uint64_t result; - result = (UINT64)vals * (UINT64)vald; + result = (uint64_t)vals * (uint64_t)vald; vals = result >> 32; vald = result & 0xffffffff; SET_G_REG(14, vals); @@ -4246,9 +4246,9 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // signed multiplication, double word product case EMULS: { - INT64 result; + int64_t result; - result = (INT64)(INT32)(vals) * (INT64)(INT32)(vald); + result = (int64_t)(int32_t)(vals) * (int64_t)(int32_t)(vald); vals = result >> 32; vald = result & 0xffffffff; SET_G_REG(14, vals); @@ -4259,9 +4259,9 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // signed multiply/add, single word product sum case EMAC: { - INT32 result; + int32_t result; - result = (INT32)GET_G_REG(15) + ((INT32)(vals) * (INT32)(vald)); + result = (int32_t)GET_G_REG(15) + ((int32_t)(vals) * (int32_t)(vald)); SET_G_REG(15, result); break; @@ -4269,9 +4269,9 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // signed multiply/add, double word product sum case EMACD: { - INT64 result; + int64_t result; - result = (INT64)concat_64(GET_G_REG(14), GET_G_REG(15)) + (INT64)((INT64)(INT32)(vals) * (INT64)(INT32)(vald)); + result = (int64_t)concat_64(GET_G_REG(14), GET_G_REG(15)) + (int64_t)((int64_t)(int32_t)(vals) * (int64_t)(int32_t)(vald)); vals = result >> 32; vald = result & 0xffffffff; @@ -4283,9 +4283,9 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // signed multiply/substract, single word product difference case EMSUB: { - INT32 result; + int32_t result; - result = (INT32)GET_G_REG(15) - ((INT32)(vals) * (INT32)(vald)); + result = (int32_t)GET_G_REG(15) - ((int32_t)(vals) * (int32_t)(vald)); SET_G_REG(15, result); break; @@ -4293,9 +4293,9 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // signed multiply/substract, double word product difference case EMSUBD: { - INT64 result; + int64_t result; - result = (INT64)concat_64(GET_G_REG(14), GET_G_REG(15)) - (INT64)((INT64)(INT32)(vals) * (INT64)(INT32)(vald)); + result = (int64_t)concat_64(GET_G_REG(14), GET_G_REG(15)) - (int64_t)((int64_t)(int32_t)(vals) * (int64_t)(int32_t)(vald)); vals = result >> 32; vald = result & 0xffffffff; @@ -4307,9 +4307,9 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // signed half-word multiply/add, single word product sum case EHMAC: { - INT32 result; + int32_t result; - result = (INT32)GET_G_REG(15) + ((INT32)((vald & 0xffff0000) >> 16) * (INT32)((vals & 0xffff0000) >> 16)) + ((INT32)(vald & 0xffff) * (INT32)(vals & 0xffff)); + result = (int32_t)GET_G_REG(15) + ((int32_t)((vald & 0xffff0000) >> 16) * (int32_t)((vals & 0xffff0000) >> 16)) + ((int32_t)(vald & 0xffff) * (int32_t)(vals & 0xffff)); SET_G_REG(15, result); break; @@ -4317,9 +4317,9 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // signed half-word multiply/add, double word product sum case EHMACD: { - INT64 result; + int64_t result; - result = (INT64)concat_64(GET_G_REG(14), GET_G_REG(15)) + (INT64)((INT64)(INT32)((vald & 0xffff0000) >> 16) * (INT64)(INT32)((vals & 0xffff0000) >> 16)) + ((INT64)(INT32)(vald & 0xffff) * (INT64)(INT32)(vals & 0xffff)); + result = (int64_t)concat_64(GET_G_REG(14), GET_G_REG(15)) + (int64_t)((int64_t)(int32_t)((vald & 0xffff0000) >> 16) * (int64_t)(int32_t)((vals & 0xffff0000) >> 16)) + ((int64_t)(int32_t)(vald & 0xffff) * (int64_t)(int32_t)(vals & 0xffff)); vals = result >> 32; vald = result & 0xffffffff; @@ -4331,7 +4331,7 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // half-word complex multiply case EHCMULD: { - UINT32 result; + uint32_t result; result = (((vald & 0xffff0000) >> 16) * ((vals & 0xffff0000) >> 16)) - ((vald & 0xffff) * (vals & 0xffff)); SET_G_REG(14, result); @@ -4344,7 +4344,7 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // half-word complex multiply/add case EHCMACD: { - UINT32 result; + uint32_t result; result = GET_G_REG(14) + (((vald & 0xffff0000) >> 16) * ((vals & 0xffff0000) >> 16)) - ((vald & 0xffff) * (vals & 0xffff)); SET_G_REG(14, result); @@ -4358,7 +4358,7 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // Ls is not used and should denote the same register as Ld case EHCSUMD: { - UINT32 result; + uint32_t result; result = ((((vals & 0xffff0000) >> 16) + GET_G_REG(14)) << 16) & 0xffff0000; result |= ((vals & 0xffff) + GET_G_REG(15)) & 0xffff; @@ -4374,7 +4374,7 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // Ls is not used and should denote the same register as Ld case EHCFFTD: { - UINT32 result; + uint32_t result; result = ((((vals & 0xffff0000) >> 16) + (GET_G_REG(14) >> 15)) << 16) & 0xffff0000; result |= ((vals & 0xffff) + (GET_G_REG(15) >> 15)) & 0xffff; @@ -4390,7 +4390,7 @@ void hyperstone_device::hyperstone_extend(struct hyperstone_device::regs_decode // Ls is not used and should denote the same register as Ld case EHCFFTSD: { - UINT32 result; + uint32_t result; result = (((((vals & 0xffff0000) >> 16) + (GET_G_REG(14) >> 15)) >> 1) << 16) & 0xffff0000; result |= ((((vals & 0xffff) + (GET_G_REG(15) >> 15)) >> 1) & 0xffff); @@ -4612,8 +4612,8 @@ void hyperstone_device::hyperstone_dbr(struct hyperstone_device::regs_decode *de void hyperstone_device::hyperstone_frame(struct hyperstone_device::regs_decode *decode) { - INT8 difference; // really it's 7 bits - UINT8 realfp = GET_FP - SRC_CODE; + int8_t difference; // really it's 7 bits + uint8_t realfp = GET_FP - SRC_CODE; SET_FP(realfp); SET_FL(DST_CODE); @@ -4623,13 +4623,13 @@ void hyperstone_device::hyperstone_frame(struct hyperstone_device::regs_decode * /* convert to 8 bits */ if(difference > 63) - difference = (INT8)(difference|0x80); + difference = (int8_t)(difference|0x80); else if( difference < -64 ) difference = difference & 0x7f; if( difference < 0 ) // else it's finished { - UINT8 tmp_flag; + uint8_t tmp_flag; tmp_flag = ( SP >= UB ? 1 : 0 ); @@ -4643,7 +4643,7 @@ void hyperstone_device::hyperstone_frame(struct hyperstone_device::regs_decode * if( tmp_flag ) { - UINT32 addr = get_trap_addr(TRAPNO_FRAME_ERROR); + uint32_t addr = get_trap_addr(TRAPNO_FRAME_ERROR); execute_exception(addr); } } @@ -4786,8 +4786,8 @@ void hyperstone_device::hyperstone_br(struct hyperstone_device::regs_decode *dec void hyperstone_device::hyperstone_trap(struct hyperstone_device::regs_decode *decode) { - UINT8 code, trapno; - UINT32 addr; + uint8_t code, trapno; + uint32_t addr; trapno = (OP & 0xfc) >> 2; @@ -4883,7 +4883,7 @@ void hyperstone_device::hyperstone_trap(struct hyperstone_device::regs_decode *d // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 hyperstone_device::execute_min_cycles() const +uint32_t hyperstone_device::execute_min_cycles() const { return 1; } @@ -4894,7 +4894,7 @@ UINT32 hyperstone_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 hyperstone_device::execute_max_cycles() const +uint32_t hyperstone_device::execute_max_cycles() const { return 36; } @@ -4905,7 +4905,7 @@ UINT32 hyperstone_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 hyperstone_device::execute_input_lines() const +uint32_t hyperstone_device::execute_input_lines() const { return 8; } @@ -4934,7 +4934,7 @@ void hyperstone_device::execute_run() do { - UINT32 oldh = SR & 0x00000020; + uint32_t oldh = SR & 0x00000020; PPC = PC; /* copy PC to previous PC */ debugger_instruction_hook(this, PC); @@ -4954,7 +4954,7 @@ void hyperstone_device::execute_run() if( GET_T && GET_P && m_delay.delay_cmd == NO_DELAY ) /* Not in a Delayed Branch instructions */ { - UINT32 addr = get_trap_addr(TRAPNO_TRACE_EXCEPTION); + uint32_t addr = get_trap_addr(TRAPNO_TRACE_EXCEPTION); execute_exception(addr); } diff --git a/src/devices/cpu/e132xs/e132xs.h b/src/devices/cpu/e132xs/e132xs.h index 28149e1a742..8c2710aee68 100644 --- a/src/devices/cpu/e132xs/e132xs.h +++ b/src/devices/cpu/e132xs/e132xs.h @@ -174,7 +174,7 @@ enum E132XS_L60, E132XS_L61, E132XS_L62, E132XS_L63 }; -extern unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, unsigned h_flag, int private_fp); +extern unsigned dasm_hyperstone(char *buffer, unsigned pc, const uint8_t *oprom, unsigned h_flag, int private_fp); /* Memory access */ /* read byte */ @@ -212,8 +212,8 @@ class hyperstone_device : public cpu_device { public: // construction/destruction - hyperstone_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 io_data_width, address_map_constructor internal_map, const char *shortname, const char *source); + hyperstone_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t io_data_width, address_map_constructor internal_map, const char *shortname, const char *source); // public interfaces @@ -226,9 +226,9 @@ protected: virtual void device_stop() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -236,9 +236,9 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; @@ -253,38 +253,38 @@ protected: /* Delay information */ struct delay_info { - INT32 delay_cmd; - UINT32 delay_pc; + int32_t delay_cmd; + uint32_t delay_pc; }; // CPU registers - UINT32 m_global_regs[32]; - UINT32 m_local_regs[64]; + uint32_t m_global_regs[32]; + uint32_t m_local_regs[64]; /* internal stuff */ - UINT32 m_ppc; // previous pc - UINT16 m_op; // opcode - UINT32 m_trap_entry; // entry point to get trap address - - UINT8 m_clock_scale_mask; - UINT8 m_clck_scale; - UINT8 m_clock_cycles_1; - UINT8 m_clock_cycles_2; - UINT8 m_clock_cycles_4; - UINT8 m_clock_cycles_6; - - UINT64 m_tr_base_cycles; - UINT32 m_tr_base_value; - UINT32 m_tr_clocks_per_tick; - UINT8 m_timer_int_pending; + uint32_t m_ppc; // previous pc + uint16_t m_op; // opcode + uint32_t m_trap_entry; // entry point to get trap address + + uint8_t m_clock_scale_mask; + uint8_t m_clck_scale; + uint8_t m_clock_cycles_1; + uint8_t m_clock_cycles_2; + uint8_t m_clock_cycles_4; + uint8_t m_clock_cycles_6; + + uint64_t m_tr_base_cycles; + uint32_t m_tr_base_value; + uint32_t m_tr_clocks_per_tick; + uint8_t m_timer_int_pending; emu_timer *m_timer; delay_info m_delay; - UINT32 m_opcodexor; + uint32_t m_opcodexor; - INT32 m_instruction_length; - INT32 m_intblock; + int32_t m_instruction_length; + int32_t m_intblock; // other internal state int m_icount; @@ -298,36 +298,36 @@ protected: private: struct regs_decode { - UINT8 src, dst; // destination and source register code - UINT32 src_value; // current source register value - UINT32 next_src_value; // current next source register value - UINT32 dst_value; // current destination register value - UINT32 next_dst_value; // current next destination register value - UINT8 sub_type; // sub type opcode (for DD and X_CODE bits) + uint8_t src, dst; // destination and source register code + uint32_t src_value; // current source register value + uint32_t next_src_value; // current next source register value + uint32_t dst_value; // current destination register value + uint32_t next_dst_value; // current next destination register value + uint8_t sub_type; // sub type opcode (for DD and X_CODE bits) union { - UINT32 u; - INT32 s; + uint32_t u; + int32_t s; } extra; // extra value such as immediate value, const, pcrel, ... - UINT8 src_is_local; - UINT8 dst_is_local; - UINT8 same_src_dst; - UINT8 same_src_dstf; - UINT8 same_srcf_dst; + uint8_t src_is_local; + uint8_t dst_is_local; + uint8_t same_src_dst; + uint8_t same_src_dstf; + uint8_t same_srcf_dst; }; // internal functions void check_interrupts(); - void set_global_register(UINT8 code, UINT32 val); - void set_local_register(UINT8 code, UINT32 val); + void set_global_register(uint8_t code, uint32_t val); + void set_local_register(uint8_t code, uint32_t val); - UINT32 get_global_register(UINT8 code); + uint32_t get_global_register(uint8_t code); - UINT32 get_trap_addr(UINT8 trapno); - UINT32 get_emu_code_addr(UINT8 num); + uint32_t get_trap_addr(uint8_t trapno); + uint32_t get_emu_code_addr(uint8_t num); void hyperstone_set_trap_entry(int which); - UINT32 compute_tr(); + uint32_t compute_tr(); void update_timer_prescale(); void adjust_timer_interrupt(); @@ -335,9 +335,9 @@ private: void execute_br(struct regs_decode *decode); void execute_dbr(struct regs_decode *decode); - void execute_trap(UINT32 addr); - void execute_int(UINT32 addr); - void execute_exception(UINT32 addr); + void execute_trap(uint32_t addr); + void execute_int(uint32_t addr); + void execute_exception(uint32_t addr); void execute_software(struct regs_decode *decode); void hyperstone_chk(struct regs_decode *decode); @@ -517,7 +517,7 @@ class e116t_device : public hyperstone_device { public: // construction/destruction - e116t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e116t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -530,7 +530,7 @@ class e116xt_device : public hyperstone_device { public: // construction/destruction - e116xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e116xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -543,7 +543,7 @@ class e116xs_device : public hyperstone_device { public: // construction/destruction - e116xs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e116xs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -556,7 +556,7 @@ class e116xsr_device : public hyperstone_device { public: // construction/destruction - e116xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e116xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -569,7 +569,7 @@ class e132n_device : public hyperstone_device { public: // construction/destruction - e132n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e132n_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -582,7 +582,7 @@ class e132t_device : public hyperstone_device { public: // construction/destruction - e132t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e132t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -595,7 +595,7 @@ class e132xn_device : public hyperstone_device { public: // construction/destruction - e132xn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e132xn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -608,7 +608,7 @@ class e132xt_device : public hyperstone_device { public: // construction/destruction - e132xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e132xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -621,7 +621,7 @@ class e132xs_device : public hyperstone_device { public: // construction/destruction - e132xs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e132xs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -634,7 +634,7 @@ class e132xsr_device : public hyperstone_device { public: // construction/destruction - e132xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e132xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -647,7 +647,7 @@ class gms30c2116_device : public hyperstone_device { public: // construction/destruction - gms30c2116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gms30c2116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -660,7 +660,7 @@ class gms30c2132_device : public hyperstone_device { public: // construction/destruction - gms30c2132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gms30c2132_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -673,7 +673,7 @@ class gms30c2216_device : public hyperstone_device { public: // construction/destruction - gms30c2216_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gms30c2216_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -686,7 +686,7 @@ class gms30c2232_device : public hyperstone_device { public: // construction/destruction - gms30c2232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gms30c2232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/cpu/es5510/es5510.cpp b/src/devices/cpu/es5510/es5510.cpp index fa4bd97a598..6191369a6a3 100644 --- a/src/devices/cpu/es5510/es5510.cpp +++ b/src/devices/cpu/es5510/es5510.cpp @@ -13,11 +13,11 @@ #include "es5510.h" #include "cpu/m68000/m68000.h" -static const INT32 MIN_24 = -(1 << 23); -static const INT32 MAX_24 = (1 << 23) - 1; +static const int32_t MIN_24 = -(1 << 23); +static const int32_t MAX_24 = (1 << 23) - 1; -static const INT64 MIN_48 = -(S64(1) << 47); -static const INT64 MAX_48 = (S64(1) << 47) - 1; +static const int64_t MIN_48 = -(S64(1) << 47); +static const int64_t MAX_48 = (S64(1) << 47) - 1; #define SIGN_BIT_24 (0x00800000) #define GET_SIGN_BIT_24(x) ((x) & SIGN_BIT_24) @@ -25,10 +25,10 @@ static const INT64 MAX_48 = (S64(1) << 47) - 1; #define CARRY_OUT_24 (0x01000000) -static inline INT32 SX(INT32 x) { return IS_NEGATIVE(x) ? x | 0xff000000 : x & 0x00ffffff; } -static inline INT32 SC(INT32 x) { return x & 0x00ffffff; } -static inline INT64 SX64(INT64 x) { return (x & S64(0x0000800000000000)) ? x | S64(0xffff000000000000) : x & S64(0x0000ffffffffffff); } -//static inline INT64 SC64(INT64 x) { return x & S64(0x0000ffffffffffff); } +static inline int32_t SX(int32_t x) { return IS_NEGATIVE(x) ? x | 0xff000000 : x & 0x00ffffff; } +static inline int32_t SC(int32_t x) { return x & 0x00ffffff; } +static inline int64_t SX64(int64_t x) { return (x & S64(0x0000800000000000)) ? x | S64(0xffff000000000000) : x & S64(0x0000ffffffffffff); } +//static inline int64_t SC64(int64_t x) { return x & S64(0x0000ffffffffffff); } #define VERBOSE 0 #define VERBOSE_EXEC 0 @@ -71,27 +71,27 @@ char *stpcpy_int (char *dst, const char *src) return (char *) memcpy (dst, src, len + 1) + len; } -inline static UINT8 setFlag(UINT8 ccr, UINT8 flag) { +inline static uint8_t setFlag(uint8_t ccr, uint8_t flag) { return ccr | flag; } -inline static UINT8 clearFlag(UINT8 ccr, UINT8 flag) { +inline static uint8_t clearFlag(uint8_t ccr, uint8_t flag) { return ccr & ~flag; } -inline static UINT8 setFlagTo(UINT8 ccr, UINT8 flag, bool set) { +inline static uint8_t setFlagTo(uint8_t ccr, uint8_t flag, bool set) { return set ? setFlag(ccr, flag) : clearFlag(ccr, flag); } -inline static bool isFlagSet(UINT8 ccr, UINT8 flag) { +inline static bool isFlagSet(uint8_t ccr, uint8_t flag) { return (ccr & flag) != 0; } -inline static INT32 add(INT32 a, INT32 b, UINT8 &flags) { - INT32 aSign = a & SIGN_BIT_24; - INT32 bSign = b & SIGN_BIT_24; - INT32 result = a + b; - INT32 resultSign = result & SIGN_BIT_24; +inline static int32_t add(int32_t a, int32_t b, uint8_t &flags) { + int32_t aSign = a & SIGN_BIT_24; + int32_t bSign = b & SIGN_BIT_24; + int32_t result = a + b; + int32_t resultSign = result & SIGN_BIT_24; bool overflow = (aSign == bSign) && (aSign != resultSign); bool carry = result & CARRY_OUT_24; bool negative = resultSign != 0; @@ -104,7 +104,7 @@ inline static INT32 add(INT32 a, INT32 b, UINT8 &flags) { return SC(result); } -inline static INT32 saturate(INT32 value, UINT8 &flags, bool negative) { +inline static int32_t saturate(int32_t value, uint8_t &flags, bool negative) { if (isFlagSet(flags, FLAG_V)) { setFlagTo(flags, FLAG_N, negative); return negative ? MIN_24 : MAX_24; @@ -113,20 +113,20 @@ inline static INT32 saturate(INT32 value, UINT8 &flags, bool negative) { } } -inline static INT32 negate(INT32 value) { +inline static int32_t negate(int32_t value) { return ((value ^ 0x00ffffff) + 1) & 0x00ffffff; } -inline static INT32 asl(INT32 value, int shift, UINT8 &flags) { - INT32 signBefore = value & SIGN_BIT_24; - INT32 result = value << shift; - INT32 signAfter = result & SIGN_BIT_24; +inline static int32_t asl(int32_t value, int shift, uint8_t &flags) { + int32_t signBefore = value & SIGN_BIT_24; + int32_t result = value << shift; + int32_t signAfter = result & SIGN_BIT_24; bool overflow = signBefore != signAfter; flags = setFlagTo(flags, FLAG_V, overflow); return saturate(result, flags, signBefore != 0); } -es5510_device::es5510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +es5510_device::es5510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ES5510, "ES5510", tag, owner, clock, "es5510", __FILE__) { // Initialize ESP to mostly zeroed, configured for 64k samples of delay line memory, running (not halted) @@ -180,7 +180,7 @@ typedef es5510_device::alu_op_t alu_op_t; typedef es5510_device::op_select_t op_select_t; typedef es5510_device::op_src_dst_t op_src_dst_t; -static inline const char * REGNAME(UINT8 r) { +static inline const char * REGNAME(uint8_t r) { static char rn[8]; if (r < 234) { sprintf(rn, "GPR_%02x", r); return rn; } switch(r) { @@ -210,7 +210,7 @@ static inline const char * REGNAME(UINT8 r) { return nullptr; } -static inline char * DESCRIBE_REG(char *s, UINT8 r, const char *name) { +static inline char * DESCRIBE_REG(char *s, uint8_t r, const char *name) { if (name && *name) { return s + sprintf(s, "%s/%s", REGNAME(r), name); } else { @@ -262,7 +262,7 @@ const op_select_t es5510_device::OPERAND_SELECT[16] = { { es5510_device::SRC_DST_DELAY, es5510_device::SRC_DST_BOTH, es5510_device::SRC_DST_DELAY, es5510_device::SRC_DST_REG }, }; -static inline char * DESCRIBE_SRC_DST(char *s, UINT8 reg, const char *regname, op_src_dst_t src_dst) { +static inline char * DESCRIBE_SRC_DST(char *s, uint8_t reg, const char *regname, op_src_dst_t src_dst) { switch (src_dst) { case es5510_device::SRC_DST_REG: return DESCRIBE_REG(s, reg, regname); @@ -287,11 +287,11 @@ const es5510_device::ram_control_t es5510_device::RAM_CONTROL[8] = { { es5510_device::RAM_CYCLE_WRITE, es5510_device::RAM_CONTROL_IO, "Write to I/O at %06x" }, }; -static inline char * DESCRIBE_RAM(char *s, UINT8 ramControl, UINT32 gprContents) { +static inline char * DESCRIBE_RAM(char *s, uint8_t ramControl, uint32_t gprContents) { return s + sprintf(s, es5510_device::RAM_CONTROL[ramControl].description, SC(gprContents)); } -static inline char * DESCRIBE_ALU(char *s, UINT8 opcode, UINT8 aReg, const char *aName, UINT8 bReg, const char *bName, const op_select_t &opSelect) { +static inline char * DESCRIBE_ALU(char *s, uint8_t opcode, uint8_t aReg, const char *aName, uint8_t bReg, const char *bName, const op_select_t &opSelect) { const alu_op_t &op = es5510_device::ALU_OPS[opcode]; switch (op.operands) { @@ -315,7 +315,7 @@ static inline char * DESCRIBE_ALU(char *s, UINT8 opcode, UINT8 aReg, const char return s; } -static inline char * DESCRIBE_MAC(char *s, UINT8 mac, UINT8 cReg, const char *cName, UINT8 dReg, const char *dName, const op_select_t &opSelect) +static inline char * DESCRIBE_MAC(char *s, uint8_t mac, uint8_t cReg, const char *cName, uint8_t dReg, const char *dName, const op_select_t &opSelect) { if (mac) { @@ -328,17 +328,17 @@ static inline char * DESCRIBE_MAC(char *s, UINT8 mac, UINT8 cReg, const char *cN return DESCRIBE_SRC_DST(s, cReg, cName, opSelect.mac_dst); } -static inline char * DESCRIBE_INSTR(char *s, UINT64 instr, UINT32 gpr, const char *aName, const char *bName, const char *cName, const char *dName) +static inline char * DESCRIBE_INSTR(char *s, uint64_t instr, uint32_t gpr, const char *aName, const char *bName, const char *cName, const char *dName) { - UINT8 dReg = (UINT8)((instr >> 40) & 0xff); - UINT8 cReg = (UINT8)((instr >> 32) & 0xff); - UINT8 bReg = (UINT8)((instr >> 24) & 0xff); - UINT8 aReg = (UINT8)((instr >> 16) & 0xff); - UINT8 aluOpcode = (UINT8)((instr >> 12) & 0x0f); - UINT8 operandSelect = (UINT8)((instr >> 8) & 0x0f); - UINT8 skip = (UINT8)((instr >> 7) & 0x01); - UINT8 mac = (UINT8)((instr >> 6) & 0x01); - UINT8 ramControl = (UINT8)((instr >> 3) & 0x07); + uint8_t dReg = (uint8_t)((instr >> 40) & 0xff); + uint8_t cReg = (uint8_t)((instr >> 32) & 0xff); + uint8_t bReg = (uint8_t)((instr >> 24) & 0xff); + uint8_t aReg = (uint8_t)((instr >> 16) & 0xff); + uint8_t aluOpcode = (uint8_t)((instr >> 12) & 0x0f); + uint8_t operandSelect = (uint8_t)((instr >> 8) & 0x0f); + uint8_t skip = (uint8_t)((instr >> 7) & 0x01); + uint8_t mac = (uint8_t)((instr >> 6) & 0x01); + uint8_t ramControl = (uint8_t)((instr >> 3) & 0x07); const op_select_t &opSelect = es5510_device::OPERAND_SELECT[operandSelect]; @@ -374,12 +374,12 @@ READ8_MEMBER(es5510_device::host_r) case 0x01: LOG(("ES5510: Host Read GPR latch[1]: %02x\n", (gpr_latch >> 8) & 0xff)); return (gpr_latch >> 8) & 0xff; case 0x02: LOG(("ES5510: Host Read GPR latch[0]: %02x\n", (gpr_latch >> 0) & 0xff)); return (gpr_latch >> 0) & 0xff; - case 0x03: LOG(("ES5510: Host Read INSTR latch[5]: %02x\n", (UINT8)((instr_latch >> 40) & 0xff))); return (instr_latch >> 40) & 0xff; - case 0x04: LOG(("ES5510: Host Read INSTR latch[4]: %02x\n", (UINT8)((instr_latch >> 32) & 0xff))); return (instr_latch >> 32) & 0xff; - case 0x05: LOG(("ES5510: Host Read INSTR latch[3]: %02x\n", (UINT8)((instr_latch >> 24) & 0xff))); return (instr_latch >> 24) & 0xff; - case 0x06: LOG(("ES5510: Host Read INSTR latch[2]: %02x\n", (UINT8)((instr_latch >> 16) & 0xff))); return (instr_latch >> 16) & 0xff; - case 0x07: LOG(("ES5510: Host Read INSTR latch[1]: %02x\n", (UINT8)((instr_latch >> 8) & 0xff))); return (instr_latch >> 8) & 0xff; - case 0x08: LOG(("ES5510: Host Read INSTR latch[0]: %02x\n", (UINT8)((instr_latch >> 0) & 0xff))); return (instr_latch >> 0) & 0xff; + case 0x03: LOG(("ES5510: Host Read INSTR latch[5]: %02x\n", (uint8_t)((instr_latch >> 40) & 0xff))); return (instr_latch >> 40) & 0xff; + case 0x04: LOG(("ES5510: Host Read INSTR latch[4]: %02x\n", (uint8_t)((instr_latch >> 32) & 0xff))); return (instr_latch >> 32) & 0xff; + case 0x05: LOG(("ES5510: Host Read INSTR latch[3]: %02x\n", (uint8_t)((instr_latch >> 24) & 0xff))); return (instr_latch >> 24) & 0xff; + case 0x06: LOG(("ES5510: Host Read INSTR latch[2]: %02x\n", (uint8_t)((instr_latch >> 16) & 0xff))); return (instr_latch >> 16) & 0xff; + case 0x07: LOG(("ES5510: Host Read INSTR latch[1]: %02x\n", (uint8_t)((instr_latch >> 8) & 0xff))); return (instr_latch >> 8) & 0xff; + case 0x08: LOG(("ES5510: Host Read INSTR latch[0]: %02x\n", (uint8_t)((instr_latch >> 0) & 0xff))); return (instr_latch >> 0) & 0xff; case 0x09: LOG(("ES5510: Host Read DIL latch[2]: %02x\n", (dil_latch >> 16) & 0xff)); return (dil_latch >> 16) & 0xff; case 0x0a: LOG(("ES5510: Host Read DIL latch[1]: %02x\n", (dil_latch >> 8) & 0xff)); return (dil_latch >> 8) & 0xff; @@ -422,12 +422,12 @@ WRITE8_MEMBER(es5510_device::host_w) break; /* 0x03 to 0x08 INSTR Register */ - case 0x03: instr_latch = ((instr_latch&U64(0x00ffffffffff)) | ((INT64)data&0xff)<<40); LOG(("%s",string_format("ES5510: Host Write INSTR latch[5] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; - case 0x04: instr_latch = ((instr_latch&U64(0xff00ffffffff)) | ((INT64)data&0xff)<<32); LOG(("%s",string_format("ES5510: Host Write INSTR latch[4] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; - case 0x05: instr_latch = ((instr_latch&U64(0xffff00ffffff)) | ((INT64)data&0xff)<<24); LOG(("%s",string_format("ES5510: Host Write INSTR latch[3] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; - case 0x06: instr_latch = ((instr_latch&U64(0xffffff00ffff)) | ((INT64)data&0xff)<<16); LOG(("%s",string_format("ES5510: Host Write INSTR latch[2] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; - case 0x07: instr_latch = ((instr_latch&U64(0xffffffff00ff)) | ((INT64)data&0xff)<< 8); LOG(("%s",string_format("ES5510: Host Write INSTR latch[1] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; - case 0x08: instr_latch = ((instr_latch&U64(0xffffffffff00)) | ((INT64)data&0xff)<< 0); LOG(("%s",string_format("ES5510: Host Write INSTR latch[0] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x03: instr_latch = ((instr_latch&U64(0x00ffffffffff)) | ((int64_t)data&0xff)<<40); LOG(("%s",string_format("ES5510: Host Write INSTR latch[5] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x04: instr_latch = ((instr_latch&U64(0xff00ffffffff)) | ((int64_t)data&0xff)<<32); LOG(("%s",string_format("ES5510: Host Write INSTR latch[4] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x05: instr_latch = ((instr_latch&U64(0xffff00ffffff)) | ((int64_t)data&0xff)<<24); LOG(("%s",string_format("ES5510: Host Write INSTR latch[3] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x06: instr_latch = ((instr_latch&U64(0xffffff00ffff)) | ((int64_t)data&0xff)<<16); LOG(("%s",string_format("ES5510: Host Write INSTR latch[2] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x07: instr_latch = ((instr_latch&U64(0xffffffff00ff)) | ((int64_t)data&0xff)<< 8); LOG(("%s",string_format("ES5510: Host Write INSTR latch[1] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x08: instr_latch = ((instr_latch&U64(0xffffffffff00)) | ((int64_t)data&0xff)<< 0); LOG(("%s",string_format("ES5510: Host Write INSTR latch[0] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; /* 0x09 to 0x0b DIL Register (r/o) */ @@ -518,7 +518,7 @@ WRITE8_MEMBER(es5510_device::host_w) } } -INT16 es5510_device::ser_r(int offset) +int16_t es5510_device::ser_r(int offset) { switch(offset) { @@ -534,7 +534,7 @@ INT16 es5510_device::ser_r(int offset) return 0; } -void es5510_device::ser_w(int offset, INT16 data) +void es5510_device::ser_w(int offset, int16_t data) { switch(offset) { @@ -562,7 +562,7 @@ void es5510_device::device_reset() { memset(dram, 0, sizeof(*dram) * (1<<20)); state = STATE_RUNNING; dil_latch = dol_latch = dadr_latch = gpr_latch = 0; - instr_latch = UINT64(0); + instr_latch = uint64_t(0); ram_sel = 0; host_control = 0; memset(&ram, 0, sizeof(ram_t)); @@ -574,23 +574,23 @@ const address_space_config *es5510_device::memory_space_config(address_spacenum return nullptr; } -UINT64 es5510_device::execute_clocks_to_cycles(UINT64 clocks) const { +uint64_t es5510_device::execute_clocks_to_cycles(uint64_t clocks) const { return clocks / 3; } -UINT64 es5510_device::execute_cycles_to_clocks(UINT64 cycles) const { +uint64_t es5510_device::execute_cycles_to_clocks(uint64_t cycles) const { return cycles * 3; } -UINT32 es5510_device::execute_min_cycles() const { +uint32_t es5510_device::execute_min_cycles() const { return 1; } -UINT32 es5510_device::execute_max_cycles() const { +uint32_t es5510_device::execute_max_cycles() const { return 1; } -UINT32 es5510_device::execute_input_lines() const { +uint32_t es5510_device::execute_input_lines() const { return 1; } @@ -615,18 +615,18 @@ void es5510_device::list_program(void(p)(const char *, ...)) { for (addr = 0; addr < 0xa0; addr++) { DESCRIBE_INSTR(buf, instr[addr], gpr[addr], nullptr, nullptr, nullptr, nullptr); - UINT64 inst = instr[addr]; - UINT8 aReg = (UINT8)((inst >> 16) & 0xff); - UINT8 bReg = (UINT8)((inst >> 24) & 0xff); - UINT8 cReg = (UINT8)((inst >> 32) & 0xff); - UINT8 dReg = (UINT8)((inst >> 40) & 0xff); - UINT8 alu_op = (inst >> 12) & 0x0f; + uint64_t inst = instr[addr]; + uint8_t aReg = (uint8_t)((inst >> 16) & 0xff); + uint8_t bReg = (uint8_t)((inst >> 24) & 0xff); + uint8_t cReg = (uint8_t)((inst >> 32) & 0xff); + uint8_t dReg = (uint8_t)((inst >> 40) & 0xff); + uint8_t alu_op = (inst >> 12) & 0x0f; if (alu_op == 0x0f) { // END! break; } - UINT8 operandSelect = (UINT8)((inst >> 8) & 0x0f); + uint8_t operandSelect = (uint8_t)((inst >> 8) & 0x0f); const op_select_t &opSelect = OPERAND_SELECT[operandSelect]; if (opSelect.mac_src == SRC_DST_REG) { @@ -671,10 +671,10 @@ void es5510_device::list_program(void(p)(const char *, ...)) { } for (addr = 0; addr < 0xa0; addr++) { - UINT8 aReg = (UINT8)((instr[addr] >> 16) & 0xff); - UINT8 bReg = (UINT8)((instr[addr] >> 24) & 0xff); - UINT8 cReg = (UINT8)((instr[addr] >> 32) & 0xff); - UINT8 dReg = (UINT8)((instr[addr] >> 40) & 0xff); + uint8_t aReg = (uint8_t)((instr[addr] >> 16) & 0xff); + uint8_t bReg = (uint8_t)((instr[addr] >> 24) & 0xff); + uint8_t cReg = (uint8_t)((instr[addr] >> 32) & 0xff); + uint8_t dReg = (uint8_t)((instr[addr] >> 40) & 0xff); DESCRIBE_INSTR(buf, instr[addr], gpr[addr], name[aReg], name[bReg], name[cReg], name[dReg]); p("%s",string_format("%02x: %012I64x %06x (%8d) %s\n", addr, instr[addr], gpr[addr]&0xffffff, SX(gpr[addr]&0xffffff), buf).c_str()); } @@ -715,7 +715,7 @@ void es5510_device::execute_run() { // *** T0, clock low // --- Read instruction N - UINT64 instr = this->instr[pc]; + uint64_t instr = this->instr[pc]; // --- RAM cycle N-2 (if a Read cycle): data read from bus is stored in DIL if (ram_pp.cycle != RAM_CYCLE_WRITE) { @@ -733,7 +733,7 @@ void es5510_device::execute_run() { ram.io = ramControl.access == RAM_CONTROL_IO; // --- RAM cycle N: read offset N - INT32 offset = gpr[pc]; + int32_t offset = gpr[pc]; switch(ramControl.access) { case RAM_CONTROL_DELAY: ram.address = (((dbase + offset) % (dlength + memincrement)) & memmask) >> memshift; @@ -759,7 +759,7 @@ void es5510_device::execute_run() { LOG_EXEC(("- T1.1\n")); - UINT8 operandSelect = (UINT8)((instr >> 8) & 0x0f); + uint8_t operandSelect = (uint8_t)((instr >> 8) & 0x0f); const op_select_t &opSelect = OPERAND_SELECT[operandSelect]; bool skip; bool skippable = (instr & (0x01 << 7)) != 0; // aka the 'SKIP' bit in the instruction word @@ -777,7 +777,7 @@ void es5510_device::execute_run() { // --- Write Multiplier result N-1 LOG_EXEC((". write mulacc:\n")); if (mulacc.write_result) { - mulacc.product = ((INT64)SX(mulacc.cValue) * (INT64)SX(mulacc.dValue)) << mulshift; + mulacc.product = ((int64_t)SX(mulacc.cValue) * (int64_t)SX(mulacc.dValue)) << mulshift; if (mulacc.accumulate) { mulacc.result = mulacc.product + machl; } else { @@ -802,7 +802,7 @@ void es5510_device::execute_run() { } #endif machl = mulacc.result; - INT32 tmp = mac_overflow ? (machl < 0 ? MIN_24 : MAX_24) : (mulacc.result & U64(0x0000ffffff000000)) >> 24; + int32_t tmp = mac_overflow ? (machl < 0 ? MIN_24 : MAX_24) : (mulacc.result & U64(0x0000ffffff000000)) >> 24; if (mulacc.dst & SRC_DST_REG) { write_reg(mulacc.cReg, tmp); } @@ -817,8 +817,8 @@ void es5510_device::execute_run() { // --- Start of multiplier cycle N LOG_EXEC((". start mulacc:\n")); - mulacc.cReg = (UINT8)((instr >> 32) & 0xff); - mulacc.dReg = (UINT8)((instr >> 40) & 0xff); + mulacc.cReg = (uint8_t)((instr >> 32) & 0xff); + mulacc.dReg = (uint8_t)((instr >> 40) & 0xff); mulacc.src = opSelect.mac_src; mulacc.dst = opSelect.mac_dst; mulacc.accumulate = ((instr >> 6) & 0x01) != 0; @@ -840,7 +840,7 @@ void es5510_device::execute_run() { // --- Write ALU Result N-1 LOG_EXEC((". write ALU:\n")); if (alu.write_result) { - UINT8 flags = ccr; + uint8_t flags = ccr; alu.result = alu_operation(alu.op, alu.aValue, alu.bValue, flags); if (alu.dst & SRC_DST_REG) { write_reg(alu.aReg, alu.result); @@ -923,32 +923,32 @@ void es5510_device::execute_run() { } } -UINT32 es5510_device::disasm_min_opcode_bytes() const +uint32_t es5510_device::disasm_min_opcode_bytes() const { return 6; } -UINT32 es5510_device::disasm_max_opcode_bytes() const +uint32_t es5510_device::disasm_max_opcode_bytes() const { return 6; } -offs_t es5510_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t es5510_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return pc; } #if VERBOSE_EXEC -#define RETURN_GPR(r, x) do { INT32 v = (x); LOG_EXEC((" . reading %x (%d) from gpr_%02x\n", v, SX(v), r)); return v; } while(0) -#define RETURN(r, x) do { INT32 v = (x); LOG_EXEC((" . reading %x (%d) from " #r "\n", v, SX(v))); return v; } while(0) -#define RETURN16(r, x) do { INT16 vv = (x); INT32 v = vv << 8; LOG_EXEC((" . reading %x (%d) as %x (%d) from " #r "\n", vv, vv, v, SX(v))); return v; } while(0) +#define RETURN_GPR(r, x) do { int32_t v = (x); LOG_EXEC((" . reading %x (%d) from gpr_%02x\n", v, SX(v), r)); return v; } while(0) +#define RETURN(r, x) do { int32_t v = (x); LOG_EXEC((" . reading %x (%d) from " #r "\n", v, SX(v))); return v; } while(0) +#define RETURN16(r, x) do { int16_t vv = (x); int32_t v = vv << 8; LOG_EXEC((" . reading %x (%d) as %x (%d) from " #r "\n", vv, vv, v, SX(v))); return v; } while(0) #else #define RETURN_GPR(r, x) return x #define RETURN(r, x) return x #define RETURN16(r, x) return (x) << 8 #endif -INT32 es5510_device::read_reg(UINT8 reg) +int32_t es5510_device::read_reg(uint8_t reg) { if (reg < 0xc0) { RETURN_GPR(reg, gpr[reg]); @@ -1003,8 +1003,8 @@ void es5510_device::run_once() } } -INT8 countLowOnes(INT32 x) { - INT8 n = 0; +int8_t countLowOnes(int32_t x) { + int8_t n = 0; while ((x & 1) == 1) { ++n; x >>= 1; @@ -1020,10 +1020,10 @@ INT8 countLowOnes(INT32 x) { #define WRITE_REG16(r, x) do { r = ((value >> 8) & 0xffff); } while(0) #endif -void es5510_device::write_reg(UINT8 reg, INT32 value) +void es5510_device::write_reg(uint8_t reg, int32_t value) { #if VERBOSE_EXEC - INT64 old; + int64_t old; #endif value &= 0x00ffffff; if (reg < 0xc0) { @@ -1052,8 +1052,8 @@ void es5510_device::write_reg(UINT8 reg, INT32 value) #if VERBOSE_EXEC old = machl; #endif - INT64 masked = machl & (S64(0x00ffffff) << 24); - INT64 shifted = (INT64)(value & 0x00ffffff) << 0; + int64_t masked = machl & (S64(0x00ffffff) << 24); + int64_t shifted = (int64_t)(value & 0x00ffffff) << 0; machl = SX64(masked | shifted); #if VERBOSE_EXEC LOG_EXEC((" . writing machl: l -> %06x => %llx -> %llx\n", value, old, machl)); @@ -1064,8 +1064,8 @@ void es5510_device::write_reg(UINT8 reg, INT32 value) #if VERBOSE_EXEC old = machl; #endif - INT64 masked = machl & (S64(0x00ffffff) << 0); - INT64 shifted = (INT64)(value & 0x00ffffff) << 24; + int64_t masked = machl & (S64(0x00ffffff) << 0); + int64_t shifted = (int64_t)(value & 0x00ffffff) << 24; machl = SX64(masked | shifted); mac_overflow = false; #if VERBOSE_EXEC @@ -1108,7 +1108,7 @@ void es5510_device::write_reg(UINT8 reg, INT32 value) } } -void es5510_device::write_to_dol(INT32 value) { +void es5510_device::write_to_dol(int32_t value) { #if VERBOSE_EXEC LOG_EXEC((". writing %x (%d) to DOL: [ ", value, value)); if (dol_count >= 1) LOG_EXEC(("{ %x (%d) }", dol[0], SX(dol[0]))); @@ -1153,8 +1153,8 @@ void es5510_device::alu_operation_end() { #endif } -INT32 es5510_device::alu_operation(UINT8 op, INT32 a, INT32 b, UINT8 &flags) { - INT32 tmp; +int32_t es5510_device::alu_operation(uint8_t op, int32_t a, int32_t b, uint8_t &flags) { + int32_t tmp; switch(op) { case 0x0: // ADD tmp = add(a, b, flags); diff --git a/src/devices/cpu/es5510/es5510.h b/src/devices/cpu/es5510/es5510.h index 7cc2d7fba7e..76d890db2a7 100644 --- a/src/devices/cpu/es5510/es5510.h +++ b/src/devices/cpu/es5510/es5510.h @@ -16,13 +16,13 @@ class es5510_device : public cpu_device { public: - es5510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + es5510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(host_r); DECLARE_WRITE8_MEMBER(host_w); - INT16 ser_r(int offset); - void ser_w(int offset, INT16 data); + int16_t ser_r(int offset); + void ser_w(int offset, int16_t data); enum line_t { ES5510_HALT = 0 @@ -75,33 +75,33 @@ public: static const ram_control_t RAM_CONTROL[8]; struct alu_t { - UINT8 aReg; - UINT8 bReg; + uint8_t aReg; + uint8_t bReg; op_src_dst_t src; op_src_dst_t dst; - UINT8 op; - INT32 aValue; - INT32 bValue; - INT32 result; + uint8_t op; + int32_t aValue; + int32_t bValue; + int32_t result; bool update_ccr; bool write_result; }; struct mulacc_t { - UINT8 cReg; - UINT8 dReg; + uint8_t cReg; + uint8_t dReg; op_src_dst_t src; op_src_dst_t dst; bool accumulate; - INT32 cValue; - INT32 dValue; - INT64 product; - INT64 result; + int32_t cValue; + int32_t dValue; + int64_t product; + int64_t result; bool write_result; }; struct ram_t { - INT32 address; // up to 20 bits, left-justified within the right 24 bits of the 32-bit word + int32_t address; // up to 20 bits, left-justified within the right 24 bits of the 32-bit word bool io; // I/O space, rather than delay line memory ram_cycle_t cycle; // cycle type }; @@ -114,75 +114,75 @@ public: void list_program(void(p)(const char *, ...)); // for testing purposes - UINT64 &_instr(int pc) { return instr[pc % 160]; } - INT16 &_dram(int addr) { return dram[addr & 0xfffff]; } + uint64_t &_instr(int pc) { return instr[pc % 160]; } + int16_t &_dram(int addr) { return dram[addr & 0xfffff]; } // publicly visible for testing purposes - INT32 read_reg(UINT8 reg); - void write_reg(UINT8 reg, INT32 value); - void write_to_dol(INT32 value); + int32_t read_reg(uint8_t reg); + void write_reg(uint8_t reg, int32_t value); + void write_to_dol(int32_t value); protected: virtual void device_start() override; virtual void device_reset() override; virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override; - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override; - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override; + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void execute_set_input(int linenum, int state) override; - INT32 alu_operation(UINT8 op, INT32 aValue, INT32 bValue, UINT8 &flags); + int32_t alu_operation(uint8_t op, int32_t aValue, int32_t bValue, uint8_t &flags); void alu_operation_end(); private: int icount; bool halt_asserted; - UINT8 pc; + uint8_t pc; state_t state; - INT32 gpr[0xc0]; // 24 bits, right justified - INT16 ser0r; - INT16 ser0l; - INT16 ser1r; - INT16 ser1l; - INT16 ser2r; - INT16 ser2l; - INT16 ser3r; - INT16 ser3l; - INT64 machl; // 48 bits, right justified and sign extended + int32_t gpr[0xc0]; // 24 bits, right justified + int16_t ser0r; + int16_t ser0l; + int16_t ser1r; + int16_t ser1l; + int16_t ser2r; + int16_t ser2l; + int16_t ser3r; + int16_t ser3l; + int64_t machl; // 48 bits, right justified and sign extended bool mac_overflow; // whether reading the MAC register should return a saturated replacement value - INT32 dil; - INT32 memsiz; - INT32 memmask; - INT32 memincrement; - INT8 memshift; - INT32 dlength; - INT32 abase; - INT32 bbase; - INT32 dbase; - INT32 sigreg; + int32_t dil; + int32_t memsiz; + int32_t memmask; + int32_t memincrement; + int8_t memshift; + int32_t dlength; + int32_t abase; + int32_t bbase; + int32_t dbase; + int32_t sigreg; int mulshift; - INT8 ccr; // really, 5 bits, left justified - INT8 cmr; // really, 6 bits, left justified - INT32 dol[2]; + int8_t ccr; // really, 5 bits, left justified + int8_t cmr; // really, 6 bits, left justified + int32_t dol[2]; int dol_count; - UINT64 instr[160]; // 48 bits, right justified - INT16 dram[1<<20]; // there are up to 20 address bits (at least 16 expected), left justified within the 24 bits of a gpr or dadr; we preallocate all of it. + uint64_t instr[160]; // 48 bits, right justified + int16_t dram[1<<20]; // there are up to 20 address bits (at least 16 expected), left justified within the 24 bits of a gpr or dadr; we preallocate all of it. // latch registers for host interaction - INT32 dol_latch; // 24 bits - INT32 dil_latch; // 24 bits - UINT32 dadr_latch; // 24 bits - INT32 gpr_latch; // 24 bits, holding up to 20 address bits, left justified - UINT64 instr_latch; // 48 bits, right justified - UINT8 ram_sel; // effectively a boolean - UINT8 host_control; // + int32_t dol_latch; // 24 bits + int32_t dil_latch; // 24 bits + uint32_t dadr_latch; // 24 bits + int32_t gpr_latch; // 24 bits, holding up to 20 address bits, left justified + uint64_t instr_latch; // 48 bits, right justified + uint8_t ram_sel; // effectively a boolean + uint8_t host_control; // // currently executing instruction(s) alu_t alu; diff --git a/src/devices/cpu/esrip/esrip.cpp b/src/devices/cpu/esrip/esrip.cpp index def6fbc6a05..dc5e79a18d3 100644 --- a/src/devices/cpu/esrip/esrip.cpp +++ b/src/devices/cpu/esrip/esrip.cpp @@ -18,7 +18,7 @@ CONSTANTS ***************************************************************************/ -#define IPT_RAM_SIZE (8192 * sizeof(UINT16)) +#define IPT_RAM_SIZE (8192 * sizeof(uint16_t)) /*************************************************************************** @@ -65,7 +65,7 @@ PUBLIC FUNCTIONS ***************************************************************************/ -UINT8 esrip_device::get_rip_status() +uint8_t esrip_device::get_rip_status() { return m_status_out; } @@ -182,7 +182,7 @@ void esrip_device::device_start() /* Register configuration structure callbacks */ m_fdt_r.resolve_safe(0); m_fdt_w.resolve_safe(); - m_lbrm = (UINT8*)machine().root_device().memregion(m_lbrm_prom)->base(); + m_lbrm = (uint8_t*)machine().root_device().memregion(m_lbrm_prom)->base(); m_status_in.resolve_safe(0); m_draw.bind_relative_to(*owner()); @@ -376,7 +376,7 @@ void esrip_device::state_string_export(const device_state_entry &entry, std::str // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 esrip_device::disasm_min_opcode_bytes() const +uint32_t esrip_device::disasm_min_opcode_bytes() const { return 8; } @@ -387,7 +387,7 @@ UINT32 esrip_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 esrip_device::disasm_max_opcode_bytes() const +uint32_t esrip_device::disasm_max_opcode_bytes() const { return 8; } @@ -398,7 +398,7 @@ UINT32 esrip_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t esrip_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t esrip_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( esrip ); return CPU_DISASSEMBLE_NAME(esrip)(this, buffer, pc, oprom, opram, options); @@ -420,12 +420,12 @@ int esrip_device::get_lbrm() const int addr = ((m_y_scale & 0x3f) << 3) | ((m_line_latch >> 3) & 7); int sel = (m_line_latch & 7); - UINT8 val = m_lbrm[addr]; + uint8_t val = m_lbrm[addr]; return (val >> sel) & 1; } -int esrip_device::check_jmp(UINT8 jmp_ctrl) const +int esrip_device::check_jmp(uint8_t jmp_ctrl) const { int ret = 0; @@ -468,37 +468,37 @@ int esrip_device::check_jmp(UINT8 jmp_ctrl) const } -void esrip_device::calc_z_flag(UINT16 res) +void esrip_device::calc_z_flag(uint16_t res) { m_new_status &= ~Z_FLAG; m_new_status |= (res == 0); } -void esrip_device::calc_c_flag_add(UINT16 a, UINT16 b) +void esrip_device::calc_c_flag_add(uint16_t a, uint16_t b) { m_new_status &= ~C_FLAG; - m_new_status |= ((UINT16)(b) > (UINT16)(~(a))) ? 2 : 0; + m_new_status |= ((uint16_t)(b) > (uint16_t)(~(a))) ? 2 : 0; } -void esrip_device::calc_c_flag_sub(UINT16 a, UINT16 b) +void esrip_device::calc_c_flag_sub(uint16_t a, uint16_t b) { m_new_status &= ~C_FLAG; - m_new_status |= ((UINT16)(b) <= (UINT16)(a)) ? 2 : 0; + m_new_status |= ((uint16_t)(b) <= (uint16_t)(a)) ? 2 : 0; } -void esrip_device::calc_n_flag(UINT16 res) +void esrip_device::calc_n_flag(uint16_t res) { m_new_status &= ~N_FLAG; m_new_status |= (res & 0x8000) ? 4 : 0; } -void esrip_device::calc_v_flag_add(UINT16 a, UINT16 b, UINT32 r) +void esrip_device::calc_v_flag_add(uint16_t a, uint16_t b, uint32_t r) { m_new_status &= ~V_FLAG; m_new_status |= ((a ^ r) & (b ^ r) & 0x8000) ? 8 : 0; } -void esrip_device::calc_v_flag_sub(UINT16 a, UINT16 b, UINT32 r) +void esrip_device::calc_v_flag_sub(uint16_t a, uint16_t b, uint32_t r) { m_new_status &= ~V_FLAG; m_new_status |= ((a ^ b) & (r ^ b) & 0x8000) ? 8 : 0; @@ -545,9 +545,9 @@ enum SORR = 0xb }; -UINT16 esrip_device::sor_op(UINT16 r, UINT16 opcode) +uint16_t esrip_device::sor_op(uint16_t r, uint16_t opcode) { - UINT32 res = 0; + uint32_t res = 0; switch (opcode) { @@ -591,11 +591,11 @@ UINT16 esrip_device::sor_op(UINT16 r, UINT16 opcode) return res & 0xffff; } -void esrip_device::sor(UINT16 inst) +void esrip_device::sor(uint16_t inst) { - UINT16 r = 0; - UINT16 dst = 0; - UINT16 res = 0; + uint16_t r = 0; + uint16_t dst = 0; + uint16_t res = 0; if (BYTE_MODE) { @@ -663,10 +663,10 @@ enum NRAS = 5 }; -void esrip_device::sonr(UINT16 inst) +void esrip_device::sonr(uint16_t inst) { - UINT16 r = 0; - UINT16 res = 0; + uint16_t r = 0; + uint16_t res = 0; switch ((inst >> 5) & 0xf) { @@ -727,9 +727,9 @@ enum EXNOR = 0xb }; -UINT16 esrip_device::tor_op(UINT16 r, UINT16 s, int opcode) +uint16_t esrip_device::tor_op(uint16_t r, uint16_t s, int opcode) { - UINT32 res = 0; + uint32_t res = 0; switch (opcode) { @@ -825,12 +825,12 @@ UINT16 esrip_device::tor_op(UINT16 r, UINT16 s, int opcode) return res & 0xffff; } -void esrip_device::tor1(UINT16 inst) +void esrip_device::tor1(uint16_t inst) { - UINT16 r = 0; - UINT16 s = 0; - UINT16 dst = 0; - UINT16 res = 0; + uint16_t r = 0; + uint16_t s = 0; + uint16_t dst = 0; + uint16_t res = 0; enum { @@ -922,11 +922,11 @@ void esrip_device::tor1(UINT16 inst) m_result = res; } -void esrip_device::tor2(UINT16 inst) +void esrip_device::tor2(uint16_t inst) { - UINT16 r = 0; - UINT16 s = 0; - UINT32 res = 0; + uint16_t r = 0; + uint16_t s = 0; + uint32_t res = 0; enum { @@ -982,7 +982,7 @@ void esrip_device::tor2(UINT16 inst) m_result = res; } -void esrip_device::tonr(UINT16 inst) +void esrip_device::tonr(uint16_t inst) { enum { @@ -991,9 +991,9 @@ void esrip_device::tonr(UINT16 inst) TODI = 0x5 }; - UINT16 r = 0; - UINT16 s = 0; - UINT16 res = 0; + uint16_t r = 0; + uint16_t s = 0; + uint16_t res = 0; switch (SRC) { @@ -1055,7 +1055,7 @@ void esrip_device::tonr(UINT16 inst) * *************************************/ -void esrip_device::bonr(UINT16 inst) +void esrip_device::bonr(uint16_t inst) { enum { @@ -1075,7 +1075,7 @@ void esrip_device::bonr(UINT16 inst) LDC2NY = 0x17 }; - UINT16 res = 0; + uint16_t res = 0; switch (inst & 0x1f) { @@ -1106,8 +1106,8 @@ void esrip_device::bonr(UINT16 inst) } case A2NA: { - UINT16 r = m_acc; - UINT16 s = 1 << N; + uint16_t r = m_acc; + uint16_t s = 1 << N; res = r + s; calc_z_flag(res); calc_n_flag(res); @@ -1118,8 +1118,8 @@ void esrip_device::bonr(UINT16 inst) } case S2NA: { - UINT16 r = m_acc; - UINT16 s = 1 << N; + uint16_t r = m_acc; + uint16_t s = 1 << N; res = r - s; calc_z_flag(res); calc_n_flag(res); @@ -1140,7 +1140,7 @@ void esrip_device::bonr(UINT16 inst) case SETND: { - UINT16 r = m_d_latch; + uint16_t r = m_d_latch; res = r | (1 << N); m_d_latch = res; @@ -1165,8 +1165,8 @@ void esrip_device::bonr(UINT16 inst) case A2NDY: { - UINT16 r = m_d_latch; - UINT16 s = 1 << N; + uint16_t r = m_d_latch; + uint16_t s = 1 << N; res = r + s; calc_z_flag(res); @@ -1183,7 +1183,7 @@ void esrip_device::bonr(UINT16 inst) m_result = res; } -void esrip_device::bor1(UINT16 inst) +void esrip_device::bor1(uint16_t inst) { enum { @@ -1192,7 +1192,7 @@ void esrip_device::bor1(UINT16 inst) TSTNR = 0xf }; - UINT16 res = 0; + uint16_t res = 0; switch ((inst >> 5) & 0xf) { @@ -1227,7 +1227,7 @@ void esrip_device::bor1(UINT16 inst) m_result = res; } -void esrip_device::bor2(UINT16 inst) +void esrip_device::bor2(uint16_t inst) { enum { @@ -1237,7 +1237,7 @@ void esrip_device::bor2(UINT16 inst) S2NR = 0xf }; - UINT32 res = 0; + uint32_t res = 0; switch ((inst >> 5) & 0xf) { @@ -1257,8 +1257,8 @@ void esrip_device::bor2(UINT16 inst) } case A2NR: { - UINT16 r = m_ram[RAM_ADDR]; - UINT16 s = 1 << N; + uint16_t r = m_ram[RAM_ADDR]; + uint16_t s = 1 << N; res = r + s; calc_v_flag_add(r, s, res); @@ -1269,8 +1269,8 @@ void esrip_device::bor2(UINT16 inst) } case S2NR: { - UINT16 r = m_ram[RAM_ADDR]; - UINT16 s = 1 << N; + uint16_t r = m_ram[RAM_ADDR]; + uint16_t s = 1 << N; res = r - s; calc_v_flag_sub(r, s, res); @@ -1294,7 +1294,7 @@ void esrip_device::bor2(UINT16 inst) *************************************/ /* TODO Combine these */ -void esrip_device::rotr1(UINT16 inst) +void esrip_device::rotr1(uint16_t inst) { enum { @@ -1303,9 +1303,9 @@ void esrip_device::rotr1(UINT16 inst) RTRR = 0xf }; - UINT16 u = 0; - UINT16 dst = 0; - UINT16 res = 0; + uint16_t u = 0; + uint16_t dst = 0; + uint16_t res = 0; int n = N; switch ((inst >> 5) & 0xf) @@ -1330,7 +1330,7 @@ void esrip_device::rotr1(UINT16 inst) m_result = res; } -void esrip_device::rotr2(UINT16 inst) +void esrip_device::rotr2(uint16_t inst) { enum { @@ -1338,8 +1338,8 @@ void esrip_device::rotr2(UINT16 inst) RTDR = 1 }; - UINT16 u = 0; - UINT16 res = 0; + uint16_t u = 0; + uint16_t res = 0; switch ((inst >> 5) & 0xf) { @@ -1357,7 +1357,7 @@ void esrip_device::rotr2(UINT16 inst) m_result = res; } -void esrip_device::rotnr(UINT16 inst) +void esrip_device::rotnr(uint16_t inst) { enum { @@ -1367,9 +1367,9 @@ void esrip_device::rotnr(UINT16 inst) RTAA = 0x1d }; - UINT16 u = 0; - UINT16 res = 0; - UINT16 dst = 0; + uint16_t u = 0; + uint16_t res = 0; + uint16_t dst = 0; switch (inst & 0x1f) { @@ -1402,7 +1402,7 @@ void esrip_device::rotnr(UINT16 inst) * *************************************/ -void esrip_device::rotc(UINT16 inst) +void esrip_device::rotc(uint16_t inst) { UNHANDLED; } @@ -1413,7 +1413,7 @@ void esrip_device::rotc(UINT16 inst) * *************************************/ -void esrip_device::rotm(UINT16 inst) +void esrip_device::rotm(uint16_t inst) { UNHANDLED; } @@ -1424,12 +1424,12 @@ void esrip_device::rotm(UINT16 inst) * *************************************/ -void esrip_device::prt(UINT16 inst) +void esrip_device::prt(uint16_t inst) { UNHANDLED; } -void esrip_device::prtnr(UINT16 inst) +void esrip_device::prtnr(uint16_t inst) { UNHANDLED; } @@ -1441,12 +1441,12 @@ void esrip_device::prtnr(UINT16 inst) * *************************************/ -void esrip_device::crcf(UINT16 inst) +void esrip_device::crcf(uint16_t inst) { UNHANDLED; } -void esrip_device::crcr(UINT16 inst) +void esrip_device::crcr(uint16_t inst) { UNHANDLED; } @@ -1472,9 +1472,9 @@ enum #define SET_LINK_flag(x) (m_new_status &= ~L_FLAG); \ (m_new_status |= x ? L_FLAG : 0) -UINT16 esrip_device::shift_op(UINT16 u, int opcode) +uint16_t esrip_device::shift_op(uint16_t u, int opcode) { - UINT32 res = 0; + uint32_t res = 0; switch (opcode) { @@ -1517,7 +1517,7 @@ UINT16 esrip_device::shift_op(UINT16 u, int opcode) return res; } -void esrip_device::shftr(UINT16 inst) +void esrip_device::shftr(uint16_t inst) { enum { @@ -1525,8 +1525,8 @@ void esrip_device::shftr(UINT16 inst) SHDR = 7 }; - UINT16 u = 0; - UINT16 res = 0; + uint16_t u = 0; + uint16_t res = 0; switch ((inst >> 9) & 0xf) { @@ -1542,7 +1542,7 @@ void esrip_device::shftr(UINT16 inst) m_result = res; } -void esrip_device::shftnr(UINT16 inst) +void esrip_device::shftnr(uint16_t inst) { enum { @@ -1550,8 +1550,8 @@ void esrip_device::shftnr(UINT16 inst) SHD = 7 }; - UINT16 u = 0; - UINT16 res = 0; + uint16_t u = 0; + uint16_t res = 0; switch ((inst >> 9) & 0xf) { @@ -1578,12 +1578,12 @@ void esrip_device::shftnr(UINT16 inst) * *************************************/ -void esrip_device::svstr(UINT16 inst) +void esrip_device::svstr(uint16_t inst) { UNHANDLED; } -void esrip_device::rstst(UINT16 inst) +void esrip_device::rstst(uint16_t inst) { enum { @@ -1606,7 +1606,7 @@ void esrip_device::rstst(UINT16 inst) m_result = 0; } -void esrip_device::setst(UINT16 inst) +void esrip_device::setst(uint16_t inst) { enum { @@ -1629,7 +1629,7 @@ void esrip_device::setst(UINT16 inst) m_result = 0xffff; } -void esrip_device::test(UINT16 inst) +void esrip_device::test(uint16_t inst) { enum { @@ -1647,7 +1647,7 @@ void esrip_device::test(UINT16 inst) TF3 = 0x16 }; - UINT32 res = 0; + uint32_t res = 0; switch (inst & 0x1f) { @@ -1676,7 +1676,7 @@ void esrip_device::test(UINT16 inst) * *************************************/ -void esrip_device::nop(UINT16 inst) +void esrip_device::nop(uint16_t inst) { m_result = 0xff; // Undefined } @@ -1691,7 +1691,7 @@ const device_type ESRIP = &device_creator; // esrip_device - constructor //------------------------------------------------- -esrip_device::esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +esrip_device::esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ESRIP, "ESRIP", tag, owner, clock, "esrip", __FILE__), m_program_config("program", ENDIANNESS_BIG, 64, 9, -3), m_fdt_r(*this), @@ -1720,7 +1720,7 @@ const esrip_device::ophandler esrip_device::s_opcodetable[24] = }; -void esrip_device::am29116_execute(UINT16 inst, int _sre) +void esrip_device::am29116_execute(uint16_t inst, int _sre) { /* Status register shadow */ m_new_status = m_status; @@ -1746,7 +1746,7 @@ void esrip_device::am29116_execute(UINT16 inst, int _sre) // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 esrip_device::execute_min_cycles() const +uint32_t esrip_device::execute_min_cycles() const { return 1; } @@ -1757,7 +1757,7 @@ UINT32 esrip_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 esrip_device::execute_max_cycles() const +uint32_t esrip_device::execute_max_cycles() const { return 1; } @@ -1768,7 +1768,7 @@ UINT32 esrip_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 esrip_device::execute_input_lines() const +uint32_t esrip_device::execute_input_lines() const { return 0; } @@ -1787,7 +1787,7 @@ void esrip_device::execute_set_input(int inputnum, int state) void esrip_device::execute_run() { int calldebugger = (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0; - UINT8 status; + uint8_t status; /* I think we can get away with placing this outside of the loop */ status = m_status_in(*m_program, 0); @@ -1795,18 +1795,18 @@ void esrip_device::execute_run() /* Core execution loop */ do { - UINT64 inst; - UINT8 next_pc; - UINT16 x_bus = 0; - UINT16 ipt_bus = 0; - UINT16 y_bus = 0; + uint64_t inst; + uint8_t next_pc; + uint16_t x_bus = 0; + uint16_t ipt_bus = 0; + uint16_t y_bus = 0; int yoe = _BIT(m_l5, 1); int bl46 = BIT(m_l4, 6); int bl44 = BIT(m_l4, 4); - UINT32 in_h; - UINT32 in_l; + uint32_t in_h; + uint32_t in_l; if (m_fig_cycles) { diff --git a/src/devices/cpu/esrip/esrip.h b/src/devices/cpu/esrip/esrip.h index 852ce65533e..3d7fdc093e2 100644 --- a/src/devices/cpu/esrip/esrip.h +++ b/src/devices/cpu/esrip/esrip.h @@ -116,7 +116,7 @@ class esrip_device : public cpu_device { public: // construction/destruction - esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esrip_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers template static devcb_base &static_set_fdt_r_callback(device_t &device, _Object object) { return downcast(device).m_fdt_r.set_callback(object); } @@ -126,7 +126,7 @@ public: static void static_lbrm_prom(device_t &device, const char *name) { downcast(device).m_lbrm_prom = name; } // public interfaces - UINT8 get_rip_status(); + uint8_t get_rip_status(); protected: // device-level overrides @@ -137,9 +137,9 @@ protected: void make_ops(); // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -147,9 +147,9 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; @@ -158,52 +158,52 @@ protected: const address_space_config m_program_config; // CPU registers - UINT16 m_ram[32]; - UINT16 m_acc; - UINT16 m_d_latch; - UINT16 m_i_latch; - UINT16 m_result; - UINT8 m_new_status; - UINT8 m_status; - UINT16 m_inst; - UINT8 m_immflag; - UINT8 m_ct; - UINT8 m_t; + uint16_t m_ram[32]; + uint16_t m_acc; + uint16_t m_d_latch; + uint16_t m_i_latch; + uint16_t m_result; + uint8_t m_new_status; + uint8_t m_status; + uint16_t m_inst; + uint8_t m_immflag; + uint8_t m_ct; + uint8_t m_t; /* Instruction latches - current and previous values */ - UINT8 m_l1, m_pl1; - UINT8 m_l2, m_pl2; - UINT8 m_l3, m_pl3; - UINT8 m_l4, m_pl4; - UINT8 m_l5, m_pl5; - UINT8 m_l6, m_pl6; - UINT8 m_l7, m_pl7; - - UINT8 m_pc; - UINT16 m_rip_pc; - UINT8 m_status_out; - - UINT8 m_x_scale; - UINT8 m_y_scale; - UINT8 m_img_bank; - UINT8 m_line_latch; - UINT16 m_fig_latch; - UINT16 m_attr_latch; - UINT16 m_adl_latch; - UINT16 m_adr_latch; - UINT16 m_iaddr_latch; - UINT8 m_c_latch; - - UINT16 m_fdt_cnt; - UINT16 m_ipt_cnt; - - UINT8 m_fig; - UINT16 m_fig_cycles; - - UINT8 m_optable[65536]; - - std::vector m_ipt_ram; - UINT8 *m_lbrm; + uint8_t m_l1, m_pl1; + uint8_t m_l2, m_pl2; + uint8_t m_l3, m_pl3; + uint8_t m_l4, m_pl4; + uint8_t m_l5, m_pl5; + uint8_t m_l6, m_pl6; + uint8_t m_l7, m_pl7; + + uint8_t m_pc; + uint16_t m_rip_pc; + uint8_t m_status_out; + + uint8_t m_x_scale; + uint8_t m_y_scale; + uint8_t m_img_bank; + uint8_t m_line_latch; + uint16_t m_fig_latch; + uint16_t m_attr_latch; + uint16_t m_adl_latch; + uint16_t m_adr_latch; + uint16_t m_iaddr_latch; + uint8_t m_c_latch; + + uint16_t m_fdt_cnt; + uint16_t m_ipt_cnt; + + uint8_t m_fig; + uint16_t m_fig_cycles; + + uint8_t m_optable[65536]; + + std::vector m_ipt_ram; + uint8_t *m_lbrm; address_space *m_program; direct_read_data *m_direct; @@ -216,7 +216,7 @@ protected: esrip_draw_delegate m_draw; const char *m_lbrm_prom; - typedef void (esrip_device::*ophandler)(UINT16 inst); + typedef void (esrip_device::*ophandler)(uint16_t inst); ophandler m_opcode[24]; @@ -225,56 +225,56 @@ protected: private: int get_hblank() const; int get_lbrm() const; - int check_jmp(UINT8 jmp_ctrl) const; + int check_jmp(uint8_t jmp_ctrl) const; // flags - void calc_z_flag(UINT16 res); - void calc_c_flag_add(UINT16 a, UINT16 b); - void calc_c_flag_sub(UINT16 a, UINT16 b); - void calc_n_flag(UINT16 res); - void calc_v_flag_add(UINT16 a, UINT16 b, UINT32 r); - void calc_v_flag_sub(UINT16 a, UINT16 b, UINT32 r); + void calc_z_flag(uint16_t res); + void calc_c_flag_add(uint16_t a, uint16_t b); + void calc_c_flag_sub(uint16_t a, uint16_t b); + void calc_n_flag(uint16_t res); + void calc_v_flag_add(uint16_t a, uint16_t b, uint32_t r); + void calc_v_flag_sub(uint16_t a, uint16_t b, uint32_t r); // opcodes - UINT16 sor_op(UINT16 r, UINT16 opcode); - void sor(UINT16 inst); - void sonr(UINT16 inst); + uint16_t sor_op(uint16_t r, uint16_t opcode); + void sor(uint16_t inst); + void sonr(uint16_t inst); - UINT16 tor_op(UINT16 r, UINT16 s, int opcode); - void tonr(UINT16 inst); - void tor1(UINT16 inst); - void tor2(UINT16 inst); + uint16_t tor_op(uint16_t r, uint16_t s, int opcode); + void tonr(uint16_t inst); + void tor1(uint16_t inst); + void tor2(uint16_t inst); - void bonr(UINT16 inst); - void bor1(UINT16 inst); - void bor2(UINT16 inst); + void bonr(uint16_t inst); + void bor1(uint16_t inst); + void bor2(uint16_t inst); - void rotr1(UINT16 inst); - void rotr2(UINT16 inst); - void rotnr(UINT16 inst); - void rotc(UINT16 inst); - void rotm(UINT16 inst); + void rotr1(uint16_t inst); + void rotr2(uint16_t inst); + void rotnr(uint16_t inst); + void rotc(uint16_t inst); + void rotm(uint16_t inst); - void prt(UINT16 inst); - void prtnr(UINT16 inst); + void prt(uint16_t inst); + void prtnr(uint16_t inst); - void crcf(UINT16 inst); - void crcr(UINT16 inst); + void crcf(uint16_t inst); + void crcr(uint16_t inst); - UINT16 shift_op(UINT16 u, int opcode); - void shftr(UINT16 inst); - void shftnr(UINT16 inst); + uint16_t shift_op(uint16_t u, int opcode); + void shftr(uint16_t inst); + void shftnr(uint16_t inst); - void svstr(UINT16 inst); + void svstr(uint16_t inst); - void rstst(UINT16 inst); - void setst(UINT16 inst); + void rstst(uint16_t inst); + void setst(uint16_t inst); - void test(UINT16 inst); + void test(uint16_t inst); - void nop(UINT16 inst); + void nop(uint16_t inst); - void am29116_execute(UINT16 inst, int _sre); + void am29116_execute(uint16_t inst, int _sre); }; diff --git a/src/devices/cpu/esrip/esripdsm.cpp b/src/devices/cpu/esrip/esripdsm.cpp index 41f3434d2cd..64df6ca7dc5 100644 --- a/src/devices/cpu/esrip/esripdsm.cpp +++ b/src/devices/cpu/esrip/esripdsm.cpp @@ -45,20 +45,20 @@ CPU_DISASSEMBLE( esrip ) }; #endif - UINT64 inst = big_endianize_int64(*(UINT64 *)oprom); + uint64_t inst = big_endianize_int64(*(uint64_t *)oprom); - UINT32 inst_hi = inst >> 32; - UINT32 inst_lo = inst & 0xffffffff; + uint32_t inst_hi = inst >> 32; + uint32_t inst_lo = inst & 0xffffffff; - UINT16 ins = (inst_hi >> 16) & 0xffff; - UINT8 ctrl = (inst_hi >> 8) & 0xff; - UINT8 jmp_dest = (inst_lo >> 8) & 0xff; + uint16_t ins = (inst_hi >> 16) & 0xffff; + uint8_t ctrl = (inst_hi >> 8) & 0xff; + uint8_t jmp_dest = (inst_lo >> 8) & 0xff; - UINT8 jmp_ctrl = (ctrl >> 3) & 0x1f; + uint8_t jmp_ctrl = (ctrl >> 3) & 0x1f; - UINT8 ctrl1 = (inst_lo >> 16) & 0xff; - UINT8 ctrl2 = (inst_lo >> 24) & 0xff; - UINT8 ctrl3 = (inst_hi) & 0xff; + uint8_t ctrl1 = (inst_lo >> 16) & 0xff; + uint8_t ctrl2 = (inst_lo >> 24) & 0xff; + uint8_t ctrl3 = (inst_hi) & 0xff; sprintf(buffer, "%.4x %c%c%c%c %.2x %s%s%s%s%s%s%s%s %c%s%s%s %c%c%c%c%c%c%c%c", ins, diff --git a/src/devices/cpu/f8/f8.cpp b/src/devices/cpu/f8/f8.cpp index 7d711bf8b03..a4470c0686d 100644 --- a/src/devices/cpu/f8/f8.cpp +++ b/src/devices/cpu/f8/f8.cpp @@ -59,7 +59,7 @@ const device_type F8 = &device_creator; -f8_cpu_device::f8_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +f8_cpu_device::f8_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, F8, "Fairchild F8", tag, owner, clock, "f8", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0) , m_io_config("io", ENDIANNESS_BIG, 8, 8, 0) @@ -111,7 +111,7 @@ void f8_cpu_device::ROMC_01() * on the data bus as signed binary number to PC0. */ m_dbus = m_direct->read_byte(m_pc0); - m_pc0 += (INT8)m_dbus; + m_pc0 += (int8_t)m_dbus; m_icount -= cL; } @@ -206,7 +206,7 @@ void f8_cpu_device::ROMC_0A() * All devices add the 8-bit value on the data bus, treated as * signed binary number, to the data counter. */ - m_dc0 += (INT8)m_dbus; + m_dc0 += (int8_t)m_dbus; m_icount -= cL; } @@ -420,7 +420,7 @@ void f8_cpu_device::ROMC_1D() * Devices with DC0 and DC1 registers must switch registers. * Devices without a DC1 register perform no operation. */ - UINT16 tmp = m_dc0; + uint16_t tmp = m_dc0; m_dc0 = m_dc1; m_dc1 = tmp; m_icount -= cS; @@ -859,12 +859,12 @@ void f8_cpu_device::f8_ai() ***************************************************/ void f8_cpu_device::f8_ci() { - UINT16 tmp = ((UINT8)~m_a) + 1; + uint16_t tmp = ((uint8_t)~m_a) + 1; ROMC_03(cL); CLR_OZCS; SET_OC(tmp,m_dbus); tmp += m_dbus; - SET_SZ((UINT8)tmp); + SET_SZ((uint8_t)tmp); } /*************************************************** @@ -1146,13 +1146,13 @@ void f8_cpu_device::f8_amd() *NOTE* status flags are updated prior to the factor being added */ - UINT8 augend=m_a; + uint8_t augend=m_a; ROMC_02(); - UINT8 addend=m_dbus; - UINT8 tmp=addend+augend; + uint8_t addend=m_dbus; + uint8_t tmp=addend+augend; - UINT8 c=0; /* high order carry */ - UINT8 ic=0; /* low order carry */ + uint8_t c=0; /* high order carry */ + uint8_t ic=0; /* low order carry */ if(((augend+addend)&0xff0)>0xf0) c=1; if((augend&0x0f)+(addend&0x0f)>0x0F) @@ -1214,12 +1214,12 @@ void f8_cpu_device::f8_xm() ***************************************************/ void f8_cpu_device::f8_cm() /* SKR changed to match f8_ci() */ { - UINT16 tmp = ((UINT8)~m_a) + 1; + uint16_t tmp = ((uint8_t)~m_a) + 1; ROMC_02(); CLR_OZCS; SET_OC(tmp,m_dbus); tmp += m_dbus; - SET_SZ((UINT8)tmp); + SET_SZ((uint8_t)tmp); } /*************************************************** @@ -1362,13 +1362,13 @@ void f8_cpu_device::f8_as_isar_d() void f8_cpu_device::f8_asd(int r) { /*SKR from F8 Guide To programming description of AMD */ - UINT8 augend=m_a; + uint8_t augend=m_a; ROMC_1C(cS); - UINT8 addend=m_r[r]; - UINT8 tmp=augend+addend; + uint8_t addend=m_r[r]; + uint8_t tmp=augend+addend; - UINT8 c=0; - UINT8 ic=0; + uint8_t c=0; + uint8_t ic=0; if(((augend+addend)&0xff0)>0xf0) c=1; if((augend&0x0f)+(addend&0x0f)>0x0F) @@ -1395,13 +1395,13 @@ void f8_cpu_device::f8_asd(int r) void f8_cpu_device::f8_asd_isar() { /*SKR from F8 Guide To programming description of AMD */ - UINT8 augend=m_a; + uint8_t augend=m_a; ROMC_1C(cS); - UINT8 addend=m_r[m_is]; - UINT8 tmp=augend+addend; + uint8_t addend=m_r[m_is]; + uint8_t tmp=augend+addend; - UINT8 c=0; - UINT8 ic=0; + uint8_t c=0; + uint8_t ic=0; if(((augend+addend)&0xff0)>0xf0) c=1; if((augend&0x0f)+(addend&0x0f)>0x0F) @@ -1428,13 +1428,13 @@ void f8_cpu_device::f8_asd_isar() void f8_cpu_device::f8_asd_isar_i() { /*SKR from F8 Guide To programming description of AMD */ - UINT8 augend=m_a; + uint8_t augend=m_a; ROMC_1C(cS); - UINT8 addend=m_r[m_is]; - UINT8 tmp=augend+addend; + uint8_t addend=m_r[m_is]; + uint8_t tmp=augend+addend; - UINT8 c=0; - UINT8 ic=0; + uint8_t c=0; + uint8_t ic=0; if(((augend+addend)&0xff0)>0xf0) c=1; if((augend&0x0f)+(addend&0x0f)>0x0F) @@ -1462,13 +1462,13 @@ void f8_cpu_device::f8_asd_isar_i() void f8_cpu_device::f8_asd_isar_d() { /*SKR from F8 Guide To programming description of AMD */ - UINT8 augend=m_a; + uint8_t augend=m_a; ROMC_1C(cS); - UINT8 addend=m_r[m_is]; - UINT8 tmp=augend+addend; + uint8_t addend=m_r[m_is]; + uint8_t tmp=augend+addend; - UINT8 c=0; - UINT8 ic=0; + uint8_t c=0; + uint8_t ic=0; if(((augend+addend)&0xff0)>0xf0) c=1; if((augend&0x0f)+(addend&0x0f)>0x0F) @@ -1583,7 +1583,7 @@ void f8_cpu_device::f8_ns_isar_d() void f8_cpu_device::device_reset() { - UINT8 data; + uint8_t data; int i; m_pc0 = 0; @@ -1636,7 +1636,7 @@ void f8_cpu_device::execute_run() { do { - UINT8 op=m_dbus; + uint8_t op=m_dbus; m_pc = (m_pc0 - 1) & 0xffff; debugger_instruction_hook(this, (m_pc0 - 1) & 0xffff); @@ -2062,7 +2062,7 @@ void f8_cpu_device::state_string_export(const device_state_entry &entry, std::st } -offs_t f8_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t f8_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( f8 ); return CPU_DISASSEMBLE_NAME(f8)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/f8/f8.h b/src/devices/cpu/f8/f8.h index 8afddae22bd..6f96bea3f49 100644 --- a/src/devices/cpu/f8/f8.h +++ b/src/devices/cpu/f8/f8.h @@ -33,7 +33,7 @@ class f8_cpu_device : public cpu_device { public: // construction/destruction - f8_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + f8_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -41,9 +41,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 7; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 7; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -54,35 +54,35 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 3; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 3; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; address_space_config m_io_config; - UINT16 m_pc0; /* program counter 0 */ - UINT16 m_pc1; /* program counter 1 */ - UINT16 m_dc0; /* data counter 0 */ - UINT16 m_dc1; /* data counter 1 */ - UINT8 m_a; /* accumulator */ - UINT8 m_w; /* processor status */ - UINT8 m_is; /* scratchpad pointer */ - UINT8 m_dbus; /* data bus value */ - UINT16 m_io; /* last I/O address */ - UINT16 m_irq_vector; + uint16_t m_pc0; /* program counter 0 */ + uint16_t m_pc1; /* program counter 1 */ + uint16_t m_dc0; /* data counter 0 */ + uint16_t m_dc1; /* data counter 1 */ + uint8_t m_a; /* accumulator */ + uint8_t m_w; /* processor status */ + uint8_t m_is; /* scratchpad pointer */ + uint8_t m_dbus; /* data bus value */ + uint16_t m_io; /* last I/O address */ + uint16_t m_irq_vector; address_space *m_program; direct_read_data *m_direct; address_space *m_iospace; int m_icount; - UINT8 m_r[64]; /* scratchpad RAM */ + uint8_t m_r[64]; /* scratchpad RAM */ int m_irq_request; /* timer shifter polynome values (will be used for timer interrupts) */ - UINT8 timer_shifter[256]; + uint8_t timer_shifter[256]; - UINT16 m_pc; // For the debugger + uint16_t m_pc; // For the debugger void ROMC_00(int insttim); void ROMC_01(); diff --git a/src/devices/cpu/f8/f8dasm.cpp b/src/devices/cpu/f8/f8dasm.cpp index 03e3d3065ea..90d5c0e3baa 100644 --- a/src/devices/cpu/f8/f8dasm.cpp +++ b/src/devices/cpu/f8/f8dasm.cpp @@ -12,7 +12,7 @@ static const char *const rname[16] = { CPU_DISASSEMBLE( f8 ) { unsigned size = 0; - UINT8 op = oprom[size++]; + uint8_t op = oprom[size++]; switch( op ) { @@ -286,22 +286,22 @@ CPU_DISASSEMBLE( f8 ) case 0x81: /* 1000 0001 */ case 0x85: /* 1000 0101 */ - sprintf(buffer, "BP $%04X", pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BP $%04X", pc + (int8_t)oprom[size++] + 1); break; case 0x82: /* 1000 0010 */ - sprintf(buffer, "BC $%04X", pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BC $%04X", pc + (int8_t)oprom[size++] + 1); break; case 0x84: /* 1000 0100 */ - sprintf(buffer, "BZ $%04X", pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BZ $%04X", pc + (int8_t)oprom[size++] + 1); break; case 0x80: /* 1000 0000 */ case 0x83: /* 1000 0011 */ case 0x86: /* 1000 0110 */ case 0x87: /* 1000 0111 */ - sprintf(buffer, "BT $%02X,$%04X", op & 0x07, pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BT $%02X,$%04X", op & 0x07, pc + (int8_t)oprom[size++] + 1); break; case 0x88: /* 1000 1000 */ @@ -333,28 +333,28 @@ CPU_DISASSEMBLE( f8 ) break; case 0x8f: /* 1000 1111 */ - sprintf(buffer, "BR7 $%04X", pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BR7 $%04X", pc + (int8_t)oprom[size++] + 1); break; case 0x90: /* 1001 0000 */ - sprintf(buffer, "BR $%04X", pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BR $%04X", pc + (int8_t)oprom[size++] + 1); break; case 0x91: /* 1001 0001 */ case 0x95: /* 1001 0101 */ - sprintf(buffer, "BM $%04X", pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BM $%04X", pc + (int8_t)oprom[size++] + 1); break; case 0x92: /* 1001 0010 */ - sprintf(buffer, "BNC $%04X", pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BNC $%04X", pc + (int8_t)oprom[size++] + 1); break; case 0x94: /* 1001 0100 */ - sprintf(buffer, "BNZ $%04X", pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BNZ $%04X", pc + (int8_t)oprom[size++] + 1); break; case 0x98: /* 1001 1000 */ - sprintf(buffer, "BNO $%04X", pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BNO $%04X", pc + (int8_t)oprom[size++] + 1); break; case 0x93: /* 1001 0011 */ @@ -367,12 +367,12 @@ CPU_DISASSEMBLE( f8 ) case 0x9d: /* 1001 1101 */ case 0x9e: /* 1001 1110 */ case 0x9f: /* 1001 1111 */ - sprintf(buffer, "BF $%02X,$%04X", op & 0x0f, pc + (INT8)oprom[size++] + 1); + sprintf(buffer, "BF $%02X,$%04X", op & 0x0f, pc + (int8_t)oprom[size++] + 1); break; case 0xa0: /* 1010 0000 */ case 0xa1: /* 1010 0001 */ - sprintf(buffer, "INS $%02X", (unsigned) (INT8) (op & 0x0F)); + sprintf(buffer, "INS $%02X", (unsigned) (int8_t) (op & 0x0F)); break; case 0xa2: /* 1010 0010 */ @@ -392,12 +392,12 @@ CPU_DISASSEMBLE( f8 ) case 0xad: /* 1010 1101 */ case 0xae: /* 1010 1110 */ case 0xaf: /* 1010 1111 */ - sprintf(buffer, "INS $%02X", (INT8) op & 0x0f); + sprintf(buffer, "INS $%02X", (int8_t) op & 0x0f); break; case 0xb0: /* 1011 0000 */ case 0xb1: /* 1011 0001 */ - sprintf(buffer, "OUTS $%02X", (INT8) op & 0x0f); + sprintf(buffer, "OUTS $%02X", (int8_t) op & 0x0f); break; case 0xb2: /* 1011 0010 */ @@ -417,7 +417,7 @@ CPU_DISASSEMBLE( f8 ) case 0xbd: /* 1011 1101 */ case 0xbe: /* 1011 1110 */ case 0xbf: /* 1011 1111 */ - sprintf(buffer, "OUTS $%02X", (unsigned) (INT8) op & 0x0f); + sprintf(buffer, "OUTS $%02X", (unsigned) (int8_t) op & 0x0f); break; case 0xc0: /* 1100 0000 */ diff --git a/src/devices/cpu/g65816/g65816.cpp b/src/devices/cpu/g65816/g65816.cpp index 169a8208e52..5eef5b1f386 100644 --- a/src/devices/cpu/g65816/g65816.cpp +++ b/src/devices/cpu/g65816/g65816.cpp @@ -97,7 +97,7 @@ const device_type G65816 = &device_creator; const device_type _5A22 = &device_creator<_5a22_device>; -g65816_device::g65816_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +g65816_device::g65816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, G65816, "G65C816", tag, owner, clock, "g65c816", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 24, 0) , m_cpu_type(CPU_TYPE_G65816) @@ -105,7 +105,7 @@ g65816_device::g65816_device(const machine_config &mconfig, const char *tag, dev } -g65816_device::g65816_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, int cpu_type, address_map_constructor internal) +g65816_device::g65816_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, int cpu_type, address_map_constructor internal) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, 24, 0, internal) , m_cpu_type(cpu_type) @@ -129,7 +129,7 @@ static ADDRESS_MAP_START(_5a22_map, AS_PROGRAM, 8, _5a22_device) ADDRESS_MAP_END -_5a22_device::_5a22_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +_5a22_device::_5a22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : g65816_device(mconfig, _5A22, "5A22", tag, owner, clock, "5a22", __FILE__, CPU_TYPE_5A22, ADDRESS_MAP_NAME(_5a22_map)) { } @@ -759,7 +759,7 @@ void g65816_device::execute_set_input(int line, int state) #include "g65816ds.h" -offs_t g65816_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t g65816_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return g65816_disassemble(buffer, (pc & 0x00ffff), (pc & 0xff0000) >> 16, oprom, FLAG_M, FLAG_X); } @@ -1080,7 +1080,7 @@ WRITE8_MEMBER( _5a22_device::wrdivh_w ) WRITE8_MEMBER( _5a22_device::wrdvdd_w ) { - UINT16 quotient, remainder; + uint16_t quotient, remainder; m_dvdd = data; diff --git a/src/devices/cpu/g65816/g65816.h b/src/devices/cpu/g65816/g65816.h index c04b9adf71c..87bb2795101 100644 --- a/src/devices/cpu/g65816/g65816.h +++ b/src/devices/cpu/g65816/g65816.h @@ -59,8 +59,8 @@ class g65816_device : public cpu_device { public: // construction/destruction - g65816_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - g65816_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, int cpu_type, address_map_constructor internal = nullptr); + g65816_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + g65816_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, int cpu_type, address_map_constructor internal = nullptr); void set_read_vector_callback(read8_delegate read_vector); @@ -70,9 +70,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 20; } - virtual UINT32 execute_input_lines() const override { return 5; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 20; } + virtual uint32_t execute_input_lines() const override { return 5; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -85,9 +85,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; @@ -233,15 +233,15 @@ protected: uint m_destination; int m_ICount; int m_cpu_type; - UINT8 m_rw8_cycles, m_rw16_cycles, m_rw24_cycles; - UINT32 m_debugger_temp; + uint8_t m_rw8_cycles, m_rw16_cycles, m_rw24_cycles; + uint32_t m_debugger_temp; /* 5A22 specific registers */ - UINT8 m_wrmpya, m_wrmpyb; - UINT16 m_rdmpy; - UINT16 m_wrdiv; - UINT8 m_dvdd; - UINT16 m_rddiv; + uint8_t m_wrmpya, m_wrmpyb; + uint16_t m_rdmpy; + uint16_t m_wrdiv; + uint8_t m_dvdd; + uint16_t m_rddiv; void g65816i_00_M0X0(); void g65816i_01_M0X0(); @@ -1529,7 +1529,7 @@ protected: class _5a22_device : public g65816_device { public: - _5a22_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + _5a22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( wrmpya_w ); DECLARE_WRITE8_MEMBER( wrmpyb_w ); diff --git a/src/devices/cpu/g65816/g65816ds.cpp b/src/devices/cpu/g65816/g65816ds.cpp index d27dd67b1dc..849252a27d8 100644 --- a/src/devices/cpu/g65816/g65816ds.cpp +++ b/src/devices/cpu/g65816/g65816ds.cpp @@ -190,8 +190,8 @@ const g65816_opcode_struct g65816_opcode_struct::s_opcodes[256] = } // anonymous namespace -static const UINT8 *base_oprom; -static UINT32 base_pc; +static const uint8_t *base_oprom; +static uint32_t base_pc; static inline unsigned int read_8(unsigned int address) { @@ -241,7 +241,7 @@ static inline char* int_16_str(unsigned int val) } -unsigned g65816_disassemble(char* buff, unsigned int pc, unsigned int pb, const UINT8 *oprom, int m_flag, int x_flag) +unsigned g65816_disassemble(char* buff, unsigned int pc, unsigned int pb, const uint8_t *oprom, int m_flag, int x_flag) { unsigned int instruction; const g65816_opcode_struct* opcode; @@ -278,7 +278,7 @@ unsigned g65816_disassemble(char* buff, unsigned int pc, unsigned int pb, const sprintf(ptr, "A"); break; case RELB: - var = (INT8) read_8(address+1); + var = (int8_t) read_8(address+1); length++; sprintf(ptr, " %06x (%s)", pb | ((pc + length + var)&0xffff), int_8_str(var)); break; diff --git a/src/devices/cpu/g65816/g65816ds.h b/src/devices/cpu/g65816/g65816ds.h index 58b47752ca5..1663f0fb396 100644 --- a/src/devices/cpu/g65816/g65816ds.h +++ b/src/devices/cpu/g65816/g65816ds.h @@ -16,7 +16,7 @@ All rights reserved. */ -unsigned g65816_disassemble(char* buff, unsigned int pc, unsigned int pb, const UINT8 *oprom, int m_flag, int x_flag); +unsigned g65816_disassemble(char* buff, unsigned int pc, unsigned int pb, const uint8_t *oprom, int m_flag, int x_flag); #endif /* __G65816DS_H__ */ diff --git a/src/devices/cpu/g65816/g65816op.h b/src/devices/cpu/g65816/g65816op.h index 81f887b3e12..c7649b16b70 100644 --- a/src/devices/cpu/g65816/g65816op.h +++ b/src/devices/cpu/g65816/g65816op.h @@ -237,7 +237,7 @@ SRC = OPER_8_##MODE(); \ if(FLAG_D) \ { \ - INT32 result, r0, r1, carry; \ + int32_t result, r0, r1, carry; \ r0 = REGISTER_A; \ r1 = SRC; \ carry = CFLAG_AS_1(); \ @@ -263,7 +263,7 @@ #define OP_ADC(MODE) \ CLK(CLK_OP + CLK_R16 + CLK_##MODE); \ SRC = OPER_16_##MODE(); \ - INT32 result, r0, r1, carry; \ + int32_t result, r0, r1, carry; \ r0 = REGISTER_A; \ r1 = SRC; \ carry = CFLAG_AS_1(); \ @@ -1110,7 +1110,7 @@ } \ else \ { \ - INT32 result, r0, r1, carry; \ + int32_t result, r0, r1, carry; \ r0 = REGISTER_A; \ r1 = SRC; \ r1 ^= 0xff; \ @@ -1129,7 +1129,7 @@ #define OP_SBC(MODE) \ CLK(CLK_OP + CLK_R16 + CLK_##MODE); \ SRC = OPER_16_##MODE(); \ - INT32 result, r0, r1, carry; \ + int32_t result, r0, r1, carry; \ r0 = REGISTER_A; \ r1 = SRC; \ r1 ^= 0xffff; \ diff --git a/src/devices/cpu/h6280/6280dasm.cpp b/src/devices/cpu/h6280/6280dasm.cpp index 4a9923ae0dc..68d2ec5589c 100644 --- a/src/devices/cpu/h6280/6280dasm.cpp +++ b/src/devices/cpu/h6280/6280dasm.cpp @@ -146,7 +146,7 @@ static const unsigned char op6280[512]= *****************************************************************************/ CPU_DISASSEMBLE( h6280 ) { - UINT32 flags = 0; + uint32_t flags = 0; int PC, OP, opc, arg; PC = pc; diff --git a/src/devices/cpu/h6280/h6280.cpp b/src/devices/cpu/h6280/h6280.cpp index 5ca1397bb64..469e057c88d 100644 --- a/src/devices/cpu/h6280/h6280.cpp +++ b/src/devices/cpu/h6280/h6280.cpp @@ -158,7 +158,7 @@ const device_type H6280 = &device_creator; // h6280_device - constructor //------------------------------------------------- -h6280_device::h6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +h6280_device::h6280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, H6280, "H6280", tag, owner, clock, "h6280", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 8, 21), m_io_config("io", ENDIANNESS_LITTLE, 8, 2) @@ -282,7 +282,7 @@ void h6280_device::device_reset() m_x = 0; m_y = 0; m_p = 0; - memset(m_mmr, 0, sizeof(UINT8) * 8); + memset(m_mmr, 0, sizeof(uint8_t) * 8); m_irq_mask = 0; m_timer_ack = 0; m_timer_value = 0; @@ -321,7 +321,7 @@ void h6280_device::device_stop() } -inline UINT32 h6280_device::translated(UINT16 addr) +inline uint32_t h6280_device::translated(uint16_t addr) { return ((m_mmr[((addr) >> 13) & 7] << 13) | ((addr) & 0x1fff)); } @@ -335,7 +335,7 @@ inline void h6280_device::h6280_cycles(int cyc) #if LAZY_FLAGS #define NZ m_NZ -inline void h6280_device::set_nz(UINT8 n) +inline void h6280_device::set_nz(uint8_t n) { P &= ~_fT; NZ = ((n & _fN) << 8) | n; @@ -343,7 +343,7 @@ inline void h6280_device::set_nz(UINT8 n) #else -inline void h6280_device::set_nz(UINT8 n) +inline void h6280_device::set_nz(uint8_t n) { P = (P & ~(_fN|_fT|_fZ)) | (n & _fN) | @@ -357,7 +357,7 @@ inline void h6280_device::clear_t() P &= ~_fT; } -inline void h6280_device::do_interrupt(UINT16 vector) +inline void h6280_device::do_interrupt(uint16_t vector) { h6280_cycles(7); /* 7 cycles for an int */ push(PCH); @@ -408,7 +408,7 @@ inline void h6280_device::check_irq_lines() * The CPU inserts 1 clock delay when accessing the VDC or VCE * area. ***************************************************************/ -inline void h6280_device::check_vdc_vce_penalty(UINT16 addr) +inline void h6280_device::check_vdc_vce_penalty(uint16_t addr) { if ( ( translated(addr) & 0x1FF800 ) == 0x1FE000 ) { h6280_cycles(1); @@ -424,7 +424,7 @@ inline void h6280_device::bra(bool cond) if (cond) { h6280_cycles(4); - UINT8 tmp = read_opcode_arg(); + uint8_t tmp = read_opcode_arg(); PCW++; EAW = PCW + (signed char)tmp; PCD = EAD; @@ -547,7 +547,7 @@ inline void h6280_device::ea_idy() inline void h6280_device::ea_ind() { ea_abs(); - UINT8 tmp = program_read8(EAD); + uint8_t tmp = program_read8(EAD); EAD++; EAH = program_read8(EAD); EAL = tmp; @@ -560,139 +560,139 @@ inline void h6280_device::ea_iax() { ea_abs(); EAD+=X; - UINT8 tmp = program_read8(EAD); + uint8_t tmp = program_read8(EAD); EAD++; EAH = program_read8(EAD); EAL = tmp; } -inline UINT8 h6280_device::rd_imm() +inline uint8_t h6280_device::rd_imm() { - UINT8 tmp = read_opcode_arg(); + uint8_t tmp = read_opcode_arg(); PCW++; return tmp; } -inline UINT8 h6280_device::rd_zpg() +inline uint8_t h6280_device::rd_zpg() { ea_zpg(); return program_read8z(EAD); } -inline UINT8 h6280_device::rd_zpx() +inline uint8_t h6280_device::rd_zpx() { ea_zpx(); return program_read8z(EAD); } -inline UINT8 h6280_device::rd_zpy() +inline uint8_t h6280_device::rd_zpy() { ea_zpy(); return program_read8z(EAD); } -inline UINT8 h6280_device::rd_abs() +inline uint8_t h6280_device::rd_abs() { ea_abs(); return program_read8(EAD); } -inline UINT8 h6280_device::rd_abx() +inline uint8_t h6280_device::rd_abx() { ea_abx(); return program_read8(EAD); } -inline UINT8 h6280_device::rd_aby() +inline uint8_t h6280_device::rd_aby() { ea_aby(); return program_read8(EAD); } -inline UINT8 h6280_device::rd_zpi() +inline uint8_t h6280_device::rd_zpi() { ea_zpi(); return program_read8(EAD); } -inline UINT8 h6280_device::rd_idx() +inline uint8_t h6280_device::rd_idx() { ea_idx(); return program_read8(EAD); } -inline UINT8 h6280_device::rd_idy() +inline uint8_t h6280_device::rd_idy() { ea_idy(); return program_read8(EAD); } -inline UINT8 h6280_device::rd_tfl() +inline uint8_t h6280_device::rd_tfl() { ea_tflg(); return program_read8z(EAD); } -inline void h6280_device::wr_zpg(UINT8 tmp) +inline void h6280_device::wr_zpg(uint8_t tmp) { ea_zpg(); wb_eaz(tmp); } -inline void h6280_device::wr_zpx(UINT8 tmp) +inline void h6280_device::wr_zpx(uint8_t tmp) { ea_zpx(); wb_eaz(tmp); } -inline void h6280_device::wr_zpy(UINT8 tmp) +inline void h6280_device::wr_zpy(uint8_t tmp) { ea_zpy(); wb_eaz(tmp); } -inline void h6280_device::wr_abs(UINT8 tmp) +inline void h6280_device::wr_abs(uint8_t tmp) { ea_abs(); wb_ea(tmp); } -inline void h6280_device::wr_abx(UINT8 tmp) +inline void h6280_device::wr_abx(uint8_t tmp) { ea_abx(); wb_ea(tmp); } -inline void h6280_device::wr_aby(UINT8 tmp) +inline void h6280_device::wr_aby(uint8_t tmp) { ea_aby(); wb_ea(tmp); } -inline void h6280_device::wr_zpi(UINT8 tmp) +inline void h6280_device::wr_zpi(uint8_t tmp) { ea_zpi(); wb_ea(tmp); } -inline void h6280_device::wr_idx(UINT8 tmp) +inline void h6280_device::wr_idx(uint8_t tmp) { ea_idx(); wb_ea(tmp); } -inline void h6280_device::wr_idy(UINT8 tmp) +inline void h6280_device::wr_idy(uint8_t tmp) { ea_idy(); wb_ea(tmp); } -inline void h6280_device::wb_ea(UINT8 tmp) +inline void h6280_device::wb_ea(uint8_t tmp) { program_write8(EAD, tmp); } -inline void h6280_device::wb_eaz(UINT8 tmp) +inline void h6280_device::wb_eaz(uint8_t tmp) { program_write8z(EAD, tmp); } @@ -710,7 +710,7 @@ inline void h6280_device::wb_eaz(UINT8 tmp) ***************************************************************/ #if LAZY_FLAGS -inline void h6280_device::compose_p(UINT8 SET, UINT8 CLR) +inline void h6280_device::compose_p(uint8_t SET, uint8_t CLR) { P = (P & ~(_fN | _fZ | CLR)) | (NZ >> 8) | @@ -720,7 +720,7 @@ inline void h6280_device::compose_p(UINT8 SET, UINT8 CLR) #else -inline void h6280_device::compose_p(UINT8 SET, UINT8 CLR) +inline void h6280_device::compose_p(uint8_t SET, uint8_t CLR) { P = (P & ~CLR) | SET; } @@ -730,7 +730,7 @@ inline void h6280_device::compose_p(UINT8 SET, UINT8 CLR) /* 6280 ******************************************************** * ADC Add with carry ***************************************************************/ -inline void h6280_device::tadc(UINT8 tmp) +inline void h6280_device::tadc(uint8_t tmp) { clear_t(); int tflagtemp = rd_tfl(); @@ -761,7 +761,7 @@ inline void h6280_device::tadc(UINT8 tmp) P |= _fV; if (sum & 0xff00) P |= _fC; - tflagtemp = (UINT8) sum; + tflagtemp = (uint8_t) sum; } set_nz(tflagtemp); wb_eaz(tflagtemp); @@ -769,7 +769,7 @@ inline void h6280_device::tadc(UINT8 tmp) } -inline void h6280_device::adc(UINT8 tmp) +inline void h6280_device::adc(uint8_t tmp) { if(P & _fT) tadc(tmp); @@ -801,7 +801,7 @@ inline void h6280_device::adc(UINT8 tmp) P |= _fV; if (sum & 0xff00) P |= _fC; - A = (UINT8) sum; + A = (uint8_t) sum; } set_nz(A); } @@ -810,22 +810,22 @@ inline void h6280_device::adc(UINT8 tmp) /* 6280 ******************************************************** * AND Logical and ***************************************************************/ -inline void h6280_device::tand(UINT8 tmp) +inline void h6280_device::tand(uint8_t tmp) { clear_t(); int tflagtemp = rd_tfl(); - tflagtemp = (UINT8)(tflagtemp & tmp); + tflagtemp = (uint8_t)(tflagtemp & tmp); wb_eaz(tflagtemp); set_nz(tflagtemp); h6280_cycles(3); } -inline void h6280_device::and_a(UINT8 tmp) +inline void h6280_device::and_a(uint8_t tmp) { if(P & _fT) tand(tmp); else { - A = (UINT8)(A & tmp); + A = (uint8_t)(A & tmp); set_nz(A); } } @@ -833,11 +833,11 @@ inline void h6280_device::and_a(UINT8 tmp) /* 6280 ******************************************************** * ASL Arithmetic shift left ***************************************************************/ -inline UINT8 h6280_device::asl(UINT8 tmp) +inline uint8_t h6280_device::asl(uint8_t tmp) { clear_t(); P = (P & ~_fC) | ((tmp >> 7) & _fC); - tmp = (UINT8)(tmp << 1); + tmp = (uint8_t)(tmp << 1); set_nz(tmp); return tmp; } @@ -845,7 +845,7 @@ inline UINT8 h6280_device::asl(UINT8 tmp) /* 6280 ******************************************************** * BBR Branch if bit is reset ***************************************************************/ -inline void h6280_device::bbr(int bit, UINT8 tmp) +inline void h6280_device::bbr(int bit, uint8_t tmp) { bra(!(tmp & (1<= tmp) P |= _fC; - set_nz((UINT8)(A - tmp)); + set_nz((uint8_t)(A - tmp)); } /* 6280 ******************************************************** * CPX Compare index X ***************************************************************/ -inline void h6280_device::cpx(UINT8 tmp) +inline void h6280_device::cpx(uint8_t tmp) { clear_t(); P &= ~_fC; if (X >= tmp) P |= _fC; - set_nz((UINT8)(X - tmp)); + set_nz((uint8_t)(X - tmp)); } /* 6280 ******************************************************** * CPY Compare index Y ***************************************************************/ -inline void h6280_device::cpy(UINT8 tmp) +inline void h6280_device::cpy(uint8_t tmp) { clear_t(); P &= ~_fC; if (Y >= tmp) P |= _fC; - set_nz((UINT8)(Y - tmp)); + set_nz((uint8_t)(Y - tmp)); } /* 6280 ******************************************************** * DEC Decrement memory ***************************************************************/ -inline UINT8 h6280_device::dec(UINT8 tmp) +inline uint8_t h6280_device::dec(uint8_t tmp) { clear_t(); - tmp = (UINT8)(tmp-1); + tmp = (uint8_t)(tmp-1); set_nz(tmp); return tmp; } @@ -1099,7 +1099,7 @@ inline UINT8 h6280_device::dec(UINT8 tmp) inline void h6280_device::dex() { clear_t(); - X = (UINT8)(X - 1); + X = (uint8_t)(X - 1); set_nz(X); } @@ -1109,29 +1109,29 @@ inline void h6280_device::dex() inline void h6280_device::dey() { clear_t(); - Y = (UINT8)(Y - 1); + Y = (uint8_t)(Y - 1); set_nz(Y); } /* 6280 ******************************************************** * EOR Logical exclusive or ***************************************************************/ -inline void h6280_device::teor(UINT8 tmp) +inline void h6280_device::teor(uint8_t tmp) { clear_t(); int tflagtemp = rd_tfl(); - tflagtemp = (UINT8)(tflagtemp ^ tmp); + tflagtemp = (uint8_t)(tflagtemp ^ tmp); wb_eaz(tflagtemp); set_nz(tflagtemp); h6280_cycles(3); } -inline void h6280_device::eor(UINT8 tmp) +inline void h6280_device::eor(uint8_t tmp) { if(P & _fT) teor(tmp); else { - A = (UINT8)(A ^ tmp); + A = (uint8_t)(A ^ tmp); set_nz(A); } } @@ -1139,10 +1139,10 @@ inline void h6280_device::eor(UINT8 tmp) /* 6280 ******************************************************** * INC Increment memory ***************************************************************/ -inline UINT8 h6280_device::inc(UINT8 tmp) +inline uint8_t h6280_device::inc(uint8_t tmp) { clear_t(); - tmp = (UINT8)(tmp+1); + tmp = (uint8_t)(tmp+1); set_nz(tmp); return tmp; } @@ -1153,7 +1153,7 @@ inline UINT8 h6280_device::inc(UINT8 tmp) inline void h6280_device::inx() { clear_t(); - X = (UINT8)(X + 1); + X = (uint8_t)(X + 1); set_nz(X); } @@ -1163,7 +1163,7 @@ inline void h6280_device::inx() inline void h6280_device::iny() { clear_t(); - Y = (UINT8)(Y + 1); + Y = (uint8_t)(Y + 1); set_nz(Y); } @@ -1194,30 +1194,30 @@ inline void h6280_device::jsr() /* 6280 ******************************************************** * LDA Load accumulator ***************************************************************/ -inline void h6280_device::lda(UINT8 tmp) +inline void h6280_device::lda(uint8_t tmp) { clear_t(); - A = (UINT8)tmp; + A = (uint8_t)tmp; set_nz(A); } /* 6280 ******************************************************** * LDX Load index X ***************************************************************/ -inline void h6280_device::ldx(UINT8 tmp) +inline void h6280_device::ldx(uint8_t tmp) { clear_t(); - X = (UINT8)tmp; + X = (uint8_t)tmp; set_nz(X); } /* 6280 ******************************************************** * LDY Load index Y ***************************************************************/ -inline void h6280_device::ldy(UINT8 tmp) +inline void h6280_device::ldy(uint8_t tmp) { clear_t(); - Y = (UINT8)tmp; + Y = (uint8_t)tmp; set_nz(Y); } @@ -1225,11 +1225,11 @@ inline void h6280_device::ldy(UINT8 tmp) * LSR Logic shift right * 0 -> [7][6][5][4][3][2][1][0] -> C ***************************************************************/ -inline UINT8 h6280_device::lsr(UINT8 tmp) +inline uint8_t h6280_device::lsr(uint8_t tmp) { clear_t(); P = (P & ~_fC) | (tmp & _fC); - tmp = (UINT8)tmp >> 1; + tmp = (uint8_t)tmp >> 1; set_nz(tmp); return tmp; } @@ -1246,22 +1246,22 @@ inline void h6280_device::nop() * ORA Logical inclusive or ***************************************************************/ -inline void h6280_device::tora(UINT8 tmp) +inline void h6280_device::tora(uint8_t tmp) { clear_t(); int tflagtemp = rd_tfl(); - tflagtemp = (UINT8)(tflagtemp | tmp); + tflagtemp = (uint8_t)(tflagtemp | tmp); wb_eaz(tflagtemp); set_nz(tflagtemp); h6280_cycles(3); } -inline void h6280_device::ora(UINT8 tmp) +inline void h6280_device::ora(uint8_t tmp) { if(P & _fT) tora(tmp); else { - A = (UINT8)(A | tmp); + A = (uint8_t)(A | tmp); set_nz(A); } } @@ -1354,7 +1354,7 @@ inline void h6280_device::ply() /* 6280 ******************************************************** * RMB Reset memory bit ***************************************************************/ -inline UINT8 h6280_device::rmb(int bit, UINT8 tmp) +inline uint8_t h6280_device::rmb(int bit, uint8_t tmp) { clear_t(); tmp &= ~(1<> 8) & _fC); - tmp = (UINT8)tmp9; + tmp = (uint8_t)tmp9; set_nz(tmp); return tmp; } @@ -1379,12 +1379,12 @@ inline UINT8 h6280_device::rol(UINT8 tmp) * ROR Rotate right * C -> [7][6][5][4][3][2][1][0] -> new C ***************************************************************/ -inline UINT8 h6280_device::ror(UINT8 tmp) +inline uint8_t h6280_device::ror(uint8_t tmp) { clear_t(); int tmp9 = tmp | (P & _fC) << 8; P = (P & ~_fC) | (tmp & _fC); - tmp = (UINT8)(tmp9 >> 1); + tmp = (uint8_t)(tmp9 >> 1); set_nz(tmp); return tmp; } @@ -1430,7 +1430,7 @@ inline void h6280_device::rts() inline void h6280_device::sax() { clear_t(); - UINT8 tmp = X; + uint8_t tmp = X; X = A; A = tmp; } @@ -1441,7 +1441,7 @@ inline void h6280_device::sax() inline void h6280_device::say() { clear_t(); - UINT8 tmp = Y; + uint8_t tmp = Y; Y = A; A = tmp; } @@ -1449,7 +1449,7 @@ inline void h6280_device::say() /* 6280 ******************************************************** * SBC Subtract with carry ***************************************************************/ -inline void h6280_device::tsbc(UINT8 tmp) +inline void h6280_device::tsbc(uint8_t tmp) { clear_t(); int tflagtemp = rd_tfl(); @@ -1480,14 +1480,14 @@ inline void h6280_device::tsbc(UINT8 tmp) P |= _fV; if ((sum & 0xff00) == 0) P |= _fC; - tflagtemp = (UINT8) sum; + tflagtemp = (uint8_t) sum; } set_nz(tflagtemp); wb_eaz(tflagtemp); h6280_cycles(3); } -inline void h6280_device::sbc(UINT8 tmp) +inline void h6280_device::sbc(uint8_t tmp) { if(P & _fT) tsbc(tmp); @@ -1519,7 +1519,7 @@ inline void h6280_device::sbc(UINT8 tmp) P |= _fV; if ((sum & 0xff00) == 0) P |= _fC; - A = (UINT8) sum; + A = (uint8_t) sum; } set_nz(A); } @@ -1563,7 +1563,7 @@ inline void h6280_device::set() /* 6280 ******************************************************** * SMB Set memory bit ***************************************************************/ -inline UINT8 h6280_device::smb(int bit, UINT8 tmp) +inline uint8_t h6280_device::smb(int bit, uint8_t tmp) { clear_t(); tmp |= (1<write_byte(0x0000,tmp); @@ -1582,7 +1582,7 @@ inline void h6280_device::st0(UINT8 tmp) /* 6280 ******************************************************** * ST1 Store at hardware address 2 ***************************************************************/ -inline void h6280_device::st1(UINT8 tmp) +inline void h6280_device::st1(uint8_t tmp) { clear_t(); m_io->write_byte(0x0002,tmp); @@ -1591,7 +1591,7 @@ inline void h6280_device::st1(UINT8 tmp) /* 6280 ******************************************************** * ST2 Store at hardware address 3 ***************************************************************/ -inline void h6280_device::st2(UINT8 tmp) +inline void h6280_device::st2(uint8_t tmp) { clear_t(); m_io->write_byte(0x0003,tmp); @@ -1600,7 +1600,7 @@ inline void h6280_device::st2(UINT8 tmp) /* 6280 ******************************************************** * STA Store accumulator ***************************************************************/ -inline UINT8 h6280_device::sta() +inline uint8_t h6280_device::sta() { clear_t(); return A; @@ -1609,7 +1609,7 @@ inline UINT8 h6280_device::sta() /* 6280 ******************************************************** * STX Store index X ***************************************************************/ -inline UINT8 h6280_device::stx() +inline uint8_t h6280_device::stx() { clear_t(); return X; @@ -1618,7 +1618,7 @@ inline UINT8 h6280_device::stx() /* 6280 ******************************************************** * STY Store index Y ***************************************************************/ -inline UINT8 h6280_device::sty() +inline uint8_t h6280_device::sty() { clear_t(); return Y; @@ -1627,7 +1627,7 @@ inline UINT8 h6280_device::sty() /* 6280 ******************************************************** * STZ Store zero ***************************************************************/ -inline UINT8 h6280_device::stz() +inline uint8_t h6280_device::stz() { clear_t(); return 0; @@ -1639,7 +1639,7 @@ inline UINT8 h6280_device::stz() inline void h6280_device::sxy() { clear_t(); - UINT8 tmp = X; + uint8_t tmp = X; X = Y; Y = tmp; } @@ -1668,7 +1668,7 @@ inline void h6280_device::tai() /* H6280 ******************************************************* * TAM Transfer accumulator to memory mapper register(s) ***************************************************************/ -inline void h6280_device::tam(UINT8 tmp) +inline void h6280_device::tam(uint8_t tmp) { clear_t(); if (tmp&0x01) m_mmr[0] = A; @@ -1781,7 +1781,7 @@ inline void h6280_device::tin() * TMA Transfer memory mapper register(s) to accumulator * the highest bit set in tmp is the one that counts ***************************************************************/ -inline void h6280_device::tma(UINT8 tmp) +inline void h6280_device::tma(uint8_t tmp) { clear_t(); if (tmp&0x01) A = m_mmr[0]; @@ -1797,7 +1797,7 @@ inline void h6280_device::tma(UINT8 tmp) /* 6280 ******************************************************** * TRB Test and reset bits ***************************************************************/ -inline UINT8 h6280_device::trb(UINT8 tmp) +inline uint8_t h6280_device::trb(uint8_t tmp) { clear_t(); P = (P & ~(_fN|_fV|_fT|_fZ)) @@ -1811,7 +1811,7 @@ inline UINT8 h6280_device::trb(UINT8 tmp) /* 6280 ******************************************************** * TSB Test and set bits ***************************************************************/ -inline UINT8 h6280_device::tsb(UINT8 tmp) +inline uint8_t h6280_device::tsb(uint8_t tmp) { clear_t(); P = (P & ~(_fN|_fV|_fT|_fZ)) @@ -1835,7 +1835,7 @@ inline void h6280_device::tsx() /* 6280 ******************************************************** * TST ***************************************************************/ -inline void h6280_device::tst(UINT8 imm, UINT8 tmp) +inline void h6280_device::tst(uint8_t imm, uint8_t tmp) { P = (P & ~(_fN|_fV|_fT|_fZ)) | ((tmp&0x80) ? _fN:0) @@ -2216,7 +2216,7 @@ void h6280_device::state_string_export(const device_state_entry &entry, std::str // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 h6280_device::disasm_min_opcode_bytes() const +uint32_t h6280_device::disasm_min_opcode_bytes() const { return 1; } @@ -2227,7 +2227,7 @@ UINT32 h6280_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 h6280_device::disasm_max_opcode_bytes() const +uint32_t h6280_device::disasm_max_opcode_bytes() const { return 7; } @@ -2238,7 +2238,7 @@ UINT32 h6280_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t h6280_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t h6280_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( h6280 ); return CPU_DISASSEMBLE_NAME(h6280)(this, buffer, pc, oprom, opram, options); @@ -2250,7 +2250,7 @@ offs_t h6280_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 h6280_device::execute_min_cycles() const +uint32_t h6280_device::execute_min_cycles() const { return 2; } @@ -2261,7 +2261,7 @@ UINT32 h6280_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 h6280_device::execute_max_cycles() const +uint32_t h6280_device::execute_max_cycles() const { return 17 + 6*65536; } @@ -2272,7 +2272,7 @@ UINT32 h6280_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 h6280_device::execute_input_lines() const +uint32_t h6280_device::execute_input_lines() const { return 4; } @@ -2309,7 +2309,7 @@ void h6280_device::execute_set_input(int inputnum, int state) /*************************************************************** * program_read8 read memory ***************************************************************/ -UINT8 h6280_device::program_read8(offs_t addr) +uint8_t h6280_device::program_read8(offs_t addr) { check_vdc_vce_penalty(addr); return m_program->read_byte(translated(addr)); @@ -2318,7 +2318,7 @@ UINT8 h6280_device::program_read8(offs_t addr) /*************************************************************** * program_write8 write memory ***************************************************************/ -void h6280_device::program_write8(offs_t addr, UINT8 data) +void h6280_device::program_write8(offs_t addr, uint8_t data) { check_vdc_vce_penalty(addr); m_program->write_byte(translated(addr), data); @@ -2327,7 +2327,7 @@ void h6280_device::program_write8(offs_t addr, UINT8 data) /*************************************************************** * program_read8z read memory - zero page ***************************************************************/ -UINT8 h6280_device::program_read8z(offs_t addr) +uint8_t h6280_device::program_read8z(offs_t addr) { return m_program->read_byte((m_mmr[1] << 13) | (addr & 0x1fff)); } @@ -2335,7 +2335,7 @@ UINT8 h6280_device::program_read8z(offs_t addr) /*************************************************************** * program_write8z write memory - zero page ***************************************************************/ -void h6280_device::program_write8z(offs_t addr, UINT8 data) +void h6280_device::program_write8z(offs_t addr, uint8_t data) { m_program->write_byte((m_mmr[1] << 13) | (addr & 0x1fff), data); } @@ -2343,7 +2343,7 @@ void h6280_device::program_write8z(offs_t addr, UINT8 data) /*************************************************************** * program_read16 read word from memory ***************************************************************/ -UINT16 h6280_device::program_read16(offs_t addr) +uint16_t h6280_device::program_read16(offs_t addr) { return m_program->read_byte(translated(addr)) | (m_program->read_byte(translated(addr + 1)) << 8); @@ -2352,7 +2352,7 @@ UINT16 h6280_device::program_read16(offs_t addr) /*************************************************************** * program_read16z read a word from a zero page address ***************************************************************/ -UINT16 h6280_device::program_read16z(offs_t addr) +uint16_t h6280_device::program_read16z(offs_t addr) { if ((addr & 0xff) == 0xff) { @@ -2369,7 +2369,7 @@ UINT16 h6280_device::program_read16z(offs_t addr) /*************************************************************** * push a register onto the stack ***************************************************************/ -void h6280_device::push(UINT8 value) +void h6280_device::push(uint8_t value) { m_program->write_byte((m_mmr[1] << 13) | m_sp.d, value); S--; @@ -2378,7 +2378,7 @@ void h6280_device::push(UINT8 value) /*************************************************************** * pull a register from the stack ***************************************************************/ -void h6280_device::pull(UINT8 &value) +void h6280_device::pull(uint8_t &value) { S++; value = m_program->read_byte((m_mmr[1] << 13) | m_sp.d); @@ -2387,7 +2387,7 @@ void h6280_device::pull(UINT8 &value) /*************************************************************** * read_opcode read an opcode ***************************************************************/ -UINT8 h6280_device::read_opcode() +uint8_t h6280_device::read_opcode() { return m_direct->read_byte(translated(PCW)); } @@ -2395,7 +2395,7 @@ UINT8 h6280_device::read_opcode() /*************************************************************** * read_opcode_arg read an opcode argument ***************************************************************/ -UINT8 h6280_device::read_opcode_arg() +uint8_t h6280_device::read_opcode_arg() { return m_direct->read_byte(translated(PCW)); } @@ -2571,12 +2571,12 @@ bool h6280_device::memory_translate(address_spacenum spacenum, int intention, of return TRUE; } -UINT8 h6280_device::io_get_buffer() +uint8_t h6280_device::io_get_buffer() { return m_io_buffer; } -void h6280_device::io_set_buffer(UINT8 data) +void h6280_device::io_set_buffer(uint8_t data) { m_io_buffer = data; } diff --git a/src/devices/cpu/h6280/h6280.h b/src/devices/cpu/h6280/h6280.h index ecf93dee843..5717b3fa55f 100644 --- a/src/devices/cpu/h6280/h6280.h +++ b/src/devices/cpu/h6280/h6280.h @@ -60,7 +60,7 @@ class h6280_device : public cpu_device { public: // construction/destruction - h6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h6280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // public interfaces void set_irq_line(int irqline, int state); @@ -72,8 +72,8 @@ public: DECLARE_WRITE8_MEMBER( timer_w ); /* functions for use by the PSG and joypad port only! */ - UINT8 io_get_buffer(); - void io_set_buffer(UINT8); + uint8_t io_get_buffer(); + void io_set_buffer(uint8_t); protected: // device-level overrides @@ -82,9 +82,9 @@ protected: virtual void device_stop() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -93,24 +93,24 @@ protected: virtual bool memory_translate(address_spacenum spacenum, int intention, offs_t &address) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // opcode accessors - UINT8 program_read8(offs_t addr); - void program_write8(offs_t addr, UINT8 data); - UINT8 program_read8z(offs_t addr); - void program_write8z(offs_t addr, UINT8 data); - UINT16 program_read16(offs_t addr); - UINT16 program_read16z(offs_t addr); - void push(UINT8 value); - void pull(UINT8 &value); - UINT8 read_opcode(); - UINT8 read_opcode_arg(); + uint8_t program_read8(offs_t addr); + void program_write8(offs_t addr, uint8_t data); + uint8_t program_read8z(offs_t addr); + void program_write8z(offs_t addr, uint8_t data); + uint16_t program_read16(offs_t addr); + uint16_t program_read16z(offs_t addr); + void push(uint8_t value); + void pull(uint8_t &value); + uint8_t read_opcode(); + uint8_t read_opcode_arg(); #undef PROTOTYPES #define PROTOTYPES(prefix) \ @@ -181,14 +181,14 @@ protected: PROTOTYPES(op) - UINT32 translated(UINT16 addr); + uint32_t translated(uint16_t addr); void h6280_cycles(int cyc); - void set_nz(UINT8 n); + void set_nz(uint8_t n); void clear_t(); - void do_interrupt(UINT16 vector); + void do_interrupt(uint16_t vector); void check_and_take_irq_lines(); void check_irq_lines(); - void check_vdc_vce_penalty(UINT16 addr); + void check_vdc_vce_penalty(uint16_t addr); void bra(bool cond); void ea_zpg(); void ea_tflg(); @@ -202,40 +202,40 @@ protected: void ea_idy(); void ea_ind(); void ea_iax(); - UINT8 rd_imm(); - UINT8 rd_zpg(); - UINT8 rd_zpx(); - UINT8 rd_zpy(); - UINT8 rd_abs(); - UINT8 rd_abx(); - UINT8 rd_aby(); - UINT8 rd_zpi(); - UINT8 rd_idx(); - UINT8 rd_idy(); - UINT8 rd_tfl(); - void wr_zpg(UINT8 tmp); - void wr_zpx(UINT8 tmp); - void wr_zpy(UINT8 tmp); - void wr_abs(UINT8 tmp); - void wr_abx(UINT8 tmp); - void wr_aby(UINT8 tmp); - void wr_zpi(UINT8 tmp); - void wr_idx(UINT8 tmp); - void wr_idy(UINT8 tmp); - void wb_ea(UINT8 tmp); - void wb_eaz(UINT8 tmp); - void compose_p(UINT8 set, UINT8 clr); - void tadc(UINT8 tmp); - void adc(UINT8 tmp); - void tand(UINT8 tmp); - void and_a(UINT8 tmp); - UINT8 asl(UINT8 tmp); - void bbr(int bit, UINT8 tmp); - void bbs(int bit, UINT8 tmp); + uint8_t rd_imm(); + uint8_t rd_zpg(); + uint8_t rd_zpx(); + uint8_t rd_zpy(); + uint8_t rd_abs(); + uint8_t rd_abx(); + uint8_t rd_aby(); + uint8_t rd_zpi(); + uint8_t rd_idx(); + uint8_t rd_idy(); + uint8_t rd_tfl(); + void wr_zpg(uint8_t tmp); + void wr_zpx(uint8_t tmp); + void wr_zpy(uint8_t tmp); + void wr_abs(uint8_t tmp); + void wr_abx(uint8_t tmp); + void wr_aby(uint8_t tmp); + void wr_zpi(uint8_t tmp); + void wr_idx(uint8_t tmp); + void wr_idy(uint8_t tmp); + void wb_ea(uint8_t tmp); + void wb_eaz(uint8_t tmp); + void compose_p(uint8_t set, uint8_t clr); + void tadc(uint8_t tmp); + void adc(uint8_t tmp); + void tand(uint8_t tmp); + void and_a(uint8_t tmp); + uint8_t asl(uint8_t tmp); + void bbr(int bit, uint8_t tmp); + void bbs(int bit, uint8_t tmp); void bcc(); void bcs(); void beq(); - void bit(UINT8 tmp); + void bit(uint8_t tmp); void bmi(); void bne(); void bpl(); @@ -250,26 +250,26 @@ protected: void clv(); void clx(); void cly(); - void cmp(UINT8 tmp); - void cpx(UINT8 tmp); - void cpy(UINT8 tmp); - UINT8 dec(UINT8 tmp); + void cmp(uint8_t tmp); + void cpx(uint8_t tmp); + void cpy(uint8_t tmp); + uint8_t dec(uint8_t tmp); void dex(); void dey(); - void teor(UINT8 tmp); - void eor(UINT8 tmp); - UINT8 inc(UINT8 tmp); + void teor(uint8_t tmp); + void eor(uint8_t tmp); + uint8_t inc(uint8_t tmp); void inx(); void iny(); void jmp(); void jsr(); - void lda(UINT8 tmp); - void ldx(UINT8 tmp); - void ldy(UINT8 tmp); - UINT8 lsr(UINT8 tmp); + void lda(uint8_t tmp); + void ldx(uint8_t tmp); + void ldy(uint8_t tmp); + uint8_t lsr(uint8_t tmp); void nop(); - void tora(UINT8 tmp); - void ora(UINT8 tmp); + void tora(uint8_t tmp); + void ora(uint8_t tmp); void pha(); void php(); void phx(); @@ -278,41 +278,41 @@ protected: void plp(); void plx(); void ply(); - UINT8 rmb(int bit, UINT8 tmp); - UINT8 rol(UINT8 tmp); - UINT8 ror(UINT8 tmp); + uint8_t rmb(int bit, uint8_t tmp); + uint8_t rol(uint8_t tmp); + uint8_t ror(uint8_t tmp); void rti(); void rts(); void sax(); void say(); - void tsbc(UINT8 tmp); - void sbc(UINT8 tmp); + void tsbc(uint8_t tmp); + void sbc(uint8_t tmp); void sec(); void sed(); void sei(); void set(); - UINT8 smb(int bit, UINT8 tmp); - void st0(UINT8 tmp); - void st1(UINT8 tmp); - void st2(UINT8 tmp); - UINT8 sta(); - UINT8 stx(); - UINT8 sty(); - UINT8 stz(); + uint8_t smb(int bit, uint8_t tmp); + void st0(uint8_t tmp); + void st1(uint8_t tmp); + void st2(uint8_t tmp); + uint8_t sta(); + uint8_t stx(); + uint8_t sty(); + uint8_t stz(); void sxy(); void tai(); - void tam(UINT8 tmp); + void tam(uint8_t tmp); void tax(); void tay(); void tdd(); void tia(); void tii(); void tin(); - void tma(UINT8 tmp); - UINT8 trb(UINT8 tmp); - UINT8 tsb(UINT8 tmp); + void tma(uint8_t tmp); + uint8_t trb(uint8_t tmp); + uint8_t tsb(uint8_t tmp); void tsx(); - void tst(UINT8 imm, UINT8 tmp); + void tst(uint8_t imm, uint8_t tmp); void txa(); void txs(); void tya(); @@ -338,24 +338,24 @@ protected: PAIR m_sp; /* stack pointer (always 100 - 1FF) */ PAIR m_zp; /* zero page address */ PAIR m_ea; /* effective address */ - UINT8 m_a; /* Accumulator */ - UINT8 m_x; /* X index register */ - UINT8 m_y; /* Y index register */ - UINT8 m_p; /* Processor status */ - UINT8 m_mmr[8]; /* Hu6280 memory mapper registers */ - UINT8 m_irq_mask; /* interrupt enable/disable */ - UINT8 m_timer_status; /* timer status */ - UINT8 m_timer_ack; /* timer acknowledge */ - UINT8 m_clocks_per_cycle; /* 4 = low speed mode, 1 = high speed mode */ - INT32 m_timer_value; /* timer interrupt */ - INT32 m_timer_load; /* reload value */ - UINT8 m_nmi_state; - UINT8 m_irq_state[3]; - UINT8 m_irq_pending; + uint8_t m_a; /* Accumulator */ + uint8_t m_x; /* X index register */ + uint8_t m_y; /* Y index register */ + uint8_t m_p; /* Processor status */ + uint8_t m_mmr[8]; /* Hu6280 memory mapper registers */ + uint8_t m_irq_mask; /* interrupt enable/disable */ + uint8_t m_timer_status; /* timer status */ + uint8_t m_timer_ack; /* timer acknowledge */ + uint8_t m_clocks_per_cycle; /* 4 = low speed mode, 1 = high speed mode */ + int32_t m_timer_value; /* timer interrupt */ + int32_t m_timer_load; /* reload value */ + uint8_t m_nmi_state; + uint8_t m_irq_state[3]; + uint8_t m_irq_pending; #if LAZY_FLAGS - INT32 m_nz; /* last value (lazy N and Z flag) */ + int32_t m_nz; /* last value (lazy N and Z flag) */ #endif - UINT8 m_io_buffer; /* last value written to the PSG, timer, and interrupt pages */ + uint8_t m_io_buffer; /* last value written to the PSG, timer, and interrupt pages */ // other internal states int m_icount; diff --git a/src/devices/cpu/h8/h8.cpp b/src/devices/cpu/h8/h8.cpp index 4a413853b95..fe25c24d61f 100644 --- a/src/devices/cpu/h8/h8.cpp +++ b/src/devices/cpu/h8/h8.cpp @@ -15,7 +15,7 @@ #include "h8_dma.h" #include "h8_dtc.h" -h8_device::h8_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, bool mode_a16, address_map_delegate map_delegate) : +h8_device::h8_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, bool mode_a16, address_map_delegate map_delegate) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), program_config("program", ENDIANNESS_BIG, 16, mode_a16 ? 16 : 24, 0, map_delegate), io_config("io", ENDIANNESS_BIG, 16, 16, -1), program(nullptr), io(nullptr), direct(nullptr), PPC(0), NPC(0), PC(0), PIR(0), EXR(0), CCR(0), MAC(0), MACF(0), @@ -161,22 +161,22 @@ void h8_device::request_state(int state) requested_state = state; } -UINT32 h8_device::execute_min_cycles() const +uint32_t h8_device::execute_min_cycles() const { return 1; } -UINT32 h8_device::execute_max_cycles() const +uint32_t h8_device::execute_max_cycles() const { return 1; } -UINT32 h8_device::execute_input_lines() const +uint32_t h8_device::execute_input_lines() const { return 0; } -void h8_device::recompute_bcount(UINT64 event_time) +void h8_device::recompute_bcount(uint64_t event_time) { if(!event_time || event_time >= total_cycles() + icount) { bcount = 0; @@ -223,7 +223,7 @@ void h8_device::execute_run() } } -void h8_device::add_event(UINT64 &event_time, UINT64 new_event) +void h8_device::add_event(uint64_t &event_time, uint64_t new_event) { if(!new_event) return; @@ -324,17 +324,17 @@ void h8_device::state_string_export(const device_state_entry &entry, std::string } -UINT32 h8_device::disasm_min_opcode_bytes() const +uint32_t h8_device::disasm_min_opcode_bytes() const { return 2; } -UINT32 h8_device::disasm_max_opcode_bytes() const +uint32_t h8_device::disasm_max_opcode_bytes() const { return 10; } -void h8_device::disassemble_am(char *&buffer, int am, offs_t pc, const UINT8 *oprom, UINT32 opcode, int slot, int offset) +void h8_device::disassemble_am(char *&buffer, int am, offs_t pc, const uint8_t *oprom, uint32_t opcode, int slot, int offset) { static const char *const r8_names[16] = { "r0h", "r1h", "r2h", "r3h", "r4h", "r5h", "r6h", "r7h", @@ -453,9 +453,9 @@ void h8_device::disassemble_am(char *&buffer, int am, offs_t pc, const UINT8 *op case DASM_abs16: if(offset >= 6) - buffer += sprintf(buffer, "@%08x", INT16((oprom[offset-4] << 8) | oprom[offset-3])); + buffer += sprintf(buffer, "@%08x", int16_t((oprom[offset-4] << 8) | oprom[offset-3])); else - buffer += sprintf(buffer, "@%08x", INT16((oprom[offset-2] << 8) | oprom[offset-1])); + buffer += sprintf(buffer, "@%08x", int16_t((oprom[offset-2] << 8) | oprom[offset-1])); break; case DASM_abs32: @@ -478,11 +478,11 @@ void h8_device::disassemble_am(char *&buffer, int am, offs_t pc, const UINT8 *op break; case DASM_rel8: - buffer += sprintf(buffer, "%08x", pc + 2 + INT8(oprom[1])); + buffer += sprintf(buffer, "%08x", pc + 2 + int8_t(oprom[1])); break; case DASM_rel16: - buffer += sprintf(buffer, "%08x", pc + 4 + INT16((oprom[2] << 8) | oprom[3])); + buffer += sprintf(buffer, "%08x", pc + 4 + int16_t((oprom[2] << 8) | oprom[3])); break; case DASM_one: @@ -539,9 +539,9 @@ void h8_device::disassemble_am(char *&buffer, int am, offs_t pc, const UINT8 *op } } -offs_t h8_device::disassemble_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *table) +offs_t h8_device::disassemble_generic(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options, const disasm_entry *table) { - UINT32 slot[5]; + uint32_t slot[5]; slot[0] = (oprom[0] << 8) | oprom[1]; slot[1] = (oprom[0] << 24) | (oprom[1] << 16) | (oprom[2] << 8) | oprom[3]; slot[2] = (oprom[0] << 24) | (oprom[1] << 16) | (oprom[4] << 8) | oprom[5]; @@ -569,43 +569,43 @@ offs_t h8_device::disassemble_generic(char *buffer, offs_t pc, const UINT8 *opro return e.flags | DASMFLAG_SUPPORTED; } -offs_t h8_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t h8_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } -UINT16 h8_device::read16i(UINT32 adr) +uint16_t h8_device::read16i(uint32_t adr) { icount--; return direct->read_word(adr & ~1); } -UINT16 h8_device::fetch() +uint16_t h8_device::fetch() { - UINT16 res = read16i(PC); + uint16_t res = read16i(PC); PC += 2; return res; } -UINT8 h8_device::read8(UINT32 adr) +uint8_t h8_device::read8(uint32_t adr) { icount--; return program->read_byte(adr); } -void h8_device::write8(UINT32 adr, UINT8 data) +void h8_device::write8(uint32_t adr, uint8_t data) { icount--; program->write_byte(adr, data); } -UINT16 h8_device::read16(UINT32 adr) +uint16_t h8_device::read16(uint32_t adr) { icount--; return program->read_word(adr & ~1); } -void h8_device::write16(UINT32 adr, UINT16 data) +void h8_device::write16(uint32_t adr, uint16_t data) { icount--; program->write_word(adr & ~1, data); @@ -676,15 +676,15 @@ int h8_device::trapa_setup() throw emu_fatalerror("%s: Trapa setup called but unimplemented.\n", tag()); } -UINT8 h8_device::do_addx8(UINT8 v1, UINT8 v2) +uint8_t h8_device::do_addx8(uint8_t v1, uint8_t v2) { - UINT16 res = v1 + v2 + (CCR & F_C ? 1 : 0); + uint16_t res = v1 + v2 + (CCR & F_C ? 1 : 0); CCR &= ~(F_N|F_V|F_Z|F_C|F_H); if(((v1 & 0xf) + (v2 & 0xf) + (CCR & F_C ? 1 : 0)) & 0x10) CCR |= F_H; - if(!UINT8(res)) + if(!uint8_t(res)) CCR |= F_Z; - else if(INT8(res) < 0) + else if(int8_t(res) < 0) CCR |= F_N; if(~(v1^v2) & (v1^res) & 0x80) CCR |= F_V; @@ -694,15 +694,15 @@ UINT8 h8_device::do_addx8(UINT8 v1, UINT8 v2) } -UINT8 h8_device::do_subx8(UINT8 v1, UINT8 v2) +uint8_t h8_device::do_subx8(uint8_t v1, uint8_t v2) { - UINT16 res = v1 - v2 - (CCR & F_C ? 1 : 0); + uint16_t res = v1 - v2 - (CCR & F_C ? 1 : 0); CCR &= ~(F_N|F_V|F_Z|F_C|F_H); if(((v1 & 0xf) - (v2 & 0xf) - (CCR & F_C ? 1 : 0)) & 0x10) CCR |= F_H; - if(!UINT8(res)) + if(!uint8_t(res)) CCR |= F_Z; - else if(INT8(res) < 0) + else if(int8_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x80) CCR |= F_V; @@ -712,54 +712,54 @@ UINT8 h8_device::do_subx8(UINT8 v1, UINT8 v2) } -UINT8 h8_device::do_inc8(UINT8 v1, UINT8 v2) +uint8_t h8_device::do_inc8(uint8_t v1, uint8_t v2) { - UINT8 res = v1 + v2; + uint8_t res = v1 + v2; CCR &= ~(F_N|F_V|F_Z); if(!res) CCR |= F_Z; - else if(INT8(res) < 0) + else if(int8_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x80) CCR |= F_V; return res; } -UINT16 h8_device::do_inc16(UINT16 v1, UINT16 v2) +uint16_t h8_device::do_inc16(uint16_t v1, uint16_t v2) { - UINT16 res = v1 + v2; + uint16_t res = v1 + v2; CCR &= ~(F_N|F_V|F_Z); if(!res) CCR |= F_Z; - else if(INT16(res) < 0) + else if(int16_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x8000) CCR |= F_V; return res; } -UINT32 h8_device::do_inc32(UINT32 v1, UINT32 v2) +uint32_t h8_device::do_inc32(uint32_t v1, uint32_t v2) { - UINT32 res = v1 + v2; + uint32_t res = v1 + v2; CCR &= ~(F_N|F_V|F_Z); if(!res) CCR |= F_Z; - else if(INT32(res) < 0) + else if(int32_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x80000000) CCR |= F_V; return res; } -UINT8 h8_device::do_add8(UINT8 v1, UINT8 v2) +uint8_t h8_device::do_add8(uint8_t v1, uint8_t v2) { - UINT16 res = v1 + v2; + uint16_t res = v1 + v2; CCR &= ~(F_N|F_V|F_Z|F_C|F_H); if(((v1 & 0xf) + (v2 & 0xf)) & 0x10) CCR |= F_H; - if(!UINT8(res)) + if(!uint8_t(res)) CCR |= F_Z; - else if(INT8(res) < 0) + else if(int8_t(res) < 0) CCR |= F_N; if(~(v1^v2) & (v1^res) & 0x80) CCR |= F_V; @@ -769,15 +769,15 @@ UINT8 h8_device::do_add8(UINT8 v1, UINT8 v2) } -UINT16 h8_device::do_add16(UINT16 v1, UINT16 v2) +uint16_t h8_device::do_add16(uint16_t v1, uint16_t v2) { - UINT32 res = v1 + v2; + uint32_t res = v1 + v2; CCR &= ~(F_N|F_V|F_Z|F_C|F_H); if(((v1 & 0xfff) + (v2 & 0xffff)) & 0x1000) CCR |= F_H; - if(!UINT16(res)) + if(!uint16_t(res)) CCR |= F_Z; - else if(INT16(res) < 0) + else if(int16_t(res) < 0) CCR |= F_N; if(~(v1^v2) & (v1^res) & 0x8000) CCR |= F_V; @@ -787,15 +787,15 @@ UINT16 h8_device::do_add16(UINT16 v1, UINT16 v2) } -UINT32 h8_device::do_add32(UINT32 v1, UINT32 v2) +uint32_t h8_device::do_add32(uint32_t v1, uint32_t v2) { - UINT64 res = UINT64(v1) + UINT64(v2); + uint64_t res = uint64_t(v1) + uint64_t(v2); CCR &= ~(F_N|F_V|F_Z|F_C|F_H); if(((v1 & 0xfffffff) + (v2 & 0xfffffff)) & 0x10000000) CCR |= F_H; - if(!UINT32(res)) + if(!uint32_t(res)) CCR |= F_Z; - else if(INT32(res) < 0) + else if(int32_t(res) < 0) CCR |= F_N; if(~(v1^v2) & (v1^res) & 0x80000000) CCR |= F_V; @@ -804,54 +804,54 @@ UINT32 h8_device::do_add32(UINT32 v1, UINT32 v2) return res; } -UINT8 h8_device::do_dec8(UINT8 v1, UINT8 v2) +uint8_t h8_device::do_dec8(uint8_t v1, uint8_t v2) { - UINT8 res = v1 - v2; + uint8_t res = v1 - v2; CCR &= ~(F_N|F_V|F_Z); if(!res) CCR |= F_Z; - else if(INT8(res) < 0) + else if(int8_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x80) CCR |= F_V; return res; } -UINT16 h8_device::do_dec16(UINT16 v1, UINT16 v2) +uint16_t h8_device::do_dec16(uint16_t v1, uint16_t v2) { - UINT16 res = v1 - v2; + uint16_t res = v1 - v2; CCR &= ~(F_N|F_V|F_Z); if(!res) CCR |= F_Z; - else if(INT16(res) < 0) + else if(int16_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x8000) CCR |= F_V; return res; } -UINT32 h8_device::do_dec32(UINT32 v1, UINT32 v2) +uint32_t h8_device::do_dec32(uint32_t v1, uint32_t v2) { - UINT32 res = v1 - v2; + uint32_t res = v1 - v2; CCR &= ~(F_N|F_V|F_Z); if(!res) CCR |= F_Z; - else if(INT32(res) < 0) + else if(int32_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x80000000) CCR |= F_V; return res; } -UINT8 h8_device::do_sub8(UINT8 v1, UINT8 v2) +uint8_t h8_device::do_sub8(uint8_t v1, uint8_t v2) { - UINT16 res = v1 - v2; + uint16_t res = v1 - v2; CCR &= ~(F_N|F_V|F_Z|F_C|F_H); if(((v1 & 0xf) - (v2 & 0xf)) & 0x10) CCR |= F_H; - if(!UINT8(res)) + if(!uint8_t(res)) CCR |= F_Z; - else if(INT8(res) < 0) + else if(int8_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x80) CCR |= F_V; @@ -861,15 +861,15 @@ UINT8 h8_device::do_sub8(UINT8 v1, UINT8 v2) } -UINT16 h8_device::do_sub16(UINT16 v1, UINT16 v2) +uint16_t h8_device::do_sub16(uint16_t v1, uint16_t v2) { - UINT32 res = v1 - v2; + uint32_t res = v1 - v2; CCR &= ~(F_N|F_V|F_Z|F_C|F_H); if(((v1 & 0xfff) - (v2 & 0xffff)) & 0x1000) CCR |= F_H; - if(!UINT16(res)) + if(!uint16_t(res)) CCR |= F_Z; - else if(INT16(res) < 0) + else if(int16_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x8000) CCR |= F_V; @@ -879,15 +879,15 @@ UINT16 h8_device::do_sub16(UINT16 v1, UINT16 v2) } -UINT32 h8_device::do_sub32(UINT32 v1, UINT32 v2) +uint32_t h8_device::do_sub32(uint32_t v1, uint32_t v2) { - UINT64 res = UINT64(v1) - UINT64(v2); + uint64_t res = uint64_t(v1) - uint64_t(v2); CCR &= ~(F_N|F_V|F_Z|F_C|F_H); if(((v1 & 0xfffffff) - (v2 & 0xfffffff)) & 0x10000000) CCR |= F_H; - if(!UINT32(res)) + if(!uint32_t(res)) CCR |= F_Z; - else if(INT32(res) < 0) + else if(int32_t(res) < 0) CCR |= F_N; if((v1^v2) & (v1^res) & 0x80000000) CCR |= F_V; @@ -896,7 +896,7 @@ UINT32 h8_device::do_sub32(UINT32 v1, UINT32 v2) return res; } -UINT8 h8_device::do_shal8(UINT8 v) +uint8_t h8_device::do_shal8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x80) @@ -906,12 +906,12 @@ UINT8 h8_device::do_shal8(UINT8 v) v <<= 1; if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_shal16(UINT16 v) +uint16_t h8_device::do_shal16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x8000) @@ -921,12 +921,12 @@ UINT16 h8_device::do_shal16(UINT16 v) v <<= 1; if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_shal32(UINT32 v) +uint32_t h8_device::do_shal32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x80000000) @@ -936,12 +936,12 @@ UINT32 h8_device::do_shal32(UINT32 v) v <<= 1; if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_shar8(UINT8 v) +uint8_t h8_device::do_shar8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 1) @@ -956,7 +956,7 @@ UINT8 h8_device::do_shar8(UINT8 v) return v; } -UINT16 h8_device::do_shar16(UINT16 v) +uint16_t h8_device::do_shar16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 1) @@ -971,7 +971,7 @@ UINT16 h8_device::do_shar16(UINT16 v) return v; } -UINT32 h8_device::do_shar32(UINT32 v) +uint32_t h8_device::do_shar32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 1) @@ -986,7 +986,7 @@ UINT32 h8_device::do_shar32(UINT32 v) return v; } -UINT8 h8_device::do_shll8(UINT8 v) +uint8_t h8_device::do_shll8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x80) @@ -994,12 +994,12 @@ UINT8 h8_device::do_shll8(UINT8 v) v <<= 1; if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_shll16(UINT16 v) +uint16_t h8_device::do_shll16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x8000) @@ -1007,12 +1007,12 @@ UINT16 h8_device::do_shll16(UINT16 v) v <<= 1; if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_shll32(UINT32 v) +uint32_t h8_device::do_shll32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x80000000) @@ -1020,12 +1020,12 @@ UINT32 h8_device::do_shll32(UINT32 v) v <<= 1; if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_shlr8(UINT8 v) +uint8_t h8_device::do_shlr8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 1) @@ -1036,7 +1036,7 @@ UINT8 h8_device::do_shlr8(UINT8 v) return v; } -UINT16 h8_device::do_shlr16(UINT16 v) +uint16_t h8_device::do_shlr16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 1) @@ -1047,7 +1047,7 @@ UINT16 h8_device::do_shlr16(UINT16 v) return v; } -UINT32 h8_device::do_shlr32(UINT32 v) +uint32_t h8_device::do_shlr32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 1) @@ -1058,7 +1058,7 @@ UINT32 h8_device::do_shlr32(UINT32 v) return v; } -UINT8 h8_device::do_shal2_8(UINT8 v) +uint8_t h8_device::do_shal2_8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x40) @@ -1069,12 +1069,12 @@ UINT8 h8_device::do_shal2_8(UINT8 v) v <<= 2; if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_shal2_16(UINT16 v) +uint16_t h8_device::do_shal2_16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x4000) @@ -1085,12 +1085,12 @@ UINT16 h8_device::do_shal2_16(UINT16 v) v <<= 2; if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_shal2_32(UINT32 v) +uint32_t h8_device::do_shal2_32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x40000000) @@ -1101,12 +1101,12 @@ UINT32 h8_device::do_shal2_32(UINT32 v) v <<= 2; if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_shar2_8(UINT8 v) +uint8_t h8_device::do_shar2_8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 2) @@ -1121,7 +1121,7 @@ UINT8 h8_device::do_shar2_8(UINT8 v) return v; } -UINT16 h8_device::do_shar2_16(UINT16 v) +uint16_t h8_device::do_shar2_16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 2) @@ -1136,7 +1136,7 @@ UINT16 h8_device::do_shar2_16(UINT16 v) return v; } -UINT32 h8_device::do_shar2_32(UINT32 v) +uint32_t h8_device::do_shar2_32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 2) @@ -1151,7 +1151,7 @@ UINT32 h8_device::do_shar2_32(UINT32 v) return v; } -UINT8 h8_device::do_shll2_8(UINT8 v) +uint8_t h8_device::do_shll2_8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x40) @@ -1159,12 +1159,12 @@ UINT8 h8_device::do_shll2_8(UINT8 v) v <<= 2; if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_shll2_16(UINT16 v) +uint16_t h8_device::do_shll2_16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x4000) @@ -1172,12 +1172,12 @@ UINT16 h8_device::do_shll2_16(UINT16 v) v <<= 2; if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_shll2_32(UINT32 v) +uint32_t h8_device::do_shll2_32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x40000000) @@ -1185,12 +1185,12 @@ UINT32 h8_device::do_shll2_32(UINT32 v) v <<= 2; if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_shlr2_8(UINT8 v) +uint8_t h8_device::do_shlr2_8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 2) @@ -1201,7 +1201,7 @@ UINT8 h8_device::do_shlr2_8(UINT8 v) return v; } -UINT16 h8_device::do_shlr2_16(UINT16 v) +uint16_t h8_device::do_shlr2_16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 2) @@ -1212,7 +1212,7 @@ UINT16 h8_device::do_shlr2_16(UINT16 v) return v; } -UINT32 h8_device::do_shlr2_32(UINT32 v) +uint32_t h8_device::do_shlr2_32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 2) @@ -1223,7 +1223,7 @@ UINT32 h8_device::do_shlr2_32(UINT32 v) return v; } -UINT8 h8_device::do_rotl8(UINT8 v) +uint8_t h8_device::do_rotl8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x80) @@ -1231,12 +1231,12 @@ UINT8 h8_device::do_rotl8(UINT8 v) v = (v << 1) | (v >> 7); if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_rotl16(UINT16 v) +uint16_t h8_device::do_rotl16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x8000) @@ -1244,12 +1244,12 @@ UINT16 h8_device::do_rotl16(UINT16 v) v = (v << 1) | (v >> 15); if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_rotl32(UINT32 v) +uint32_t h8_device::do_rotl32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x80000000) @@ -1257,12 +1257,12 @@ UINT32 h8_device::do_rotl32(UINT32 v) v = (v << 1) | (v >> 31); if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_rotr8(UINT8 v) +uint8_t h8_device::do_rotr8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x01) @@ -1270,12 +1270,12 @@ UINT8 h8_device::do_rotr8(UINT8 v) v = (v << 7) | (v >> 1); if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_rotr16(UINT16 v) +uint16_t h8_device::do_rotr16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x0001) @@ -1283,12 +1283,12 @@ UINT16 h8_device::do_rotr16(UINT16 v) v = (v << 15) | (v >> 1); if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_rotr32(UINT32 v) +uint32_t h8_device::do_rotr32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x00000001) @@ -1296,96 +1296,96 @@ UINT32 h8_device::do_rotr32(UINT32 v) v = (v << 31) | (v >> 1); if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_rotxl8(UINT8 v) +uint8_t h8_device::do_rotxl8(uint8_t v) { - UINT8 c = CCR & F_C ? 1 : 0; + uint8_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x80) CCR |= F_C; v = (v << 1) | c; if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_rotxl16(UINT16 v) +uint16_t h8_device::do_rotxl16(uint16_t v) { - UINT16 c = CCR & F_C ? 1 : 0; + uint16_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x8000) CCR |= F_C; v = (v << 1) | c; if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_rotxl32(UINT32 v) +uint32_t h8_device::do_rotxl32(uint32_t v) { - UINT32 c = CCR & F_C ? 1 : 0; + uint32_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x80000000) CCR |= F_C; v = (v << 1) | c; if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_rotxr8(UINT8 v) +uint8_t h8_device::do_rotxr8(uint8_t v) { - UINT8 c = CCR & F_C ? 1 : 0; + uint8_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x01) CCR |= F_C; v = (v >> 1) | (c << 7); if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_rotxr16(UINT16 v) +uint16_t h8_device::do_rotxr16(uint16_t v) { - UINT8 c = CCR & F_C ? 1 : 0; + uint8_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x0001) CCR |= F_C; v = (v >> 1) | (c << 15); if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_rotxr32(UINT32 v) +uint32_t h8_device::do_rotxr32(uint32_t v) { - UINT8 c = CCR & F_C ? 1 : 0; + uint8_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x00000001) CCR |= F_C; v = (v >> 1) | (c << 31); if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_rotl2_8(UINT8 v) +uint8_t h8_device::do_rotl2_8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x40) @@ -1393,12 +1393,12 @@ UINT8 h8_device::do_rotl2_8(UINT8 v) v = (v << 2) | (v >> 6); if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_rotl2_16(UINT16 v) +uint16_t h8_device::do_rotl2_16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x4000) @@ -1406,12 +1406,12 @@ UINT16 h8_device::do_rotl2_16(UINT16 v) v = (v << 2) | (v >> 14); if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_rotl2_32(UINT32 v) +uint32_t h8_device::do_rotl2_32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x40000000) @@ -1419,12 +1419,12 @@ UINT32 h8_device::do_rotl2_32(UINT32 v) v = (v << 2) | (v >> 30); if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_rotr2_8(UINT8 v) +uint8_t h8_device::do_rotr2_8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x02) @@ -1432,12 +1432,12 @@ UINT8 h8_device::do_rotr2_8(UINT8 v) v = (v << 6) | (v >> 2); if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_rotr2_16(UINT16 v) +uint16_t h8_device::do_rotr2_16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x0002) @@ -1445,12 +1445,12 @@ UINT16 h8_device::do_rotr2_16(UINT16 v) v = (v << 14) | (v >> 2); if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_rotr2_32(UINT32 v) +uint32_t h8_device::do_rotr2_32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x00000002) @@ -1458,137 +1458,137 @@ UINT32 h8_device::do_rotr2_32(UINT32 v) v = (v << 30) | (v >> 2); if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_rotxl2_8(UINT8 v) +uint8_t h8_device::do_rotxl2_8(uint8_t v) { - UINT8 c = CCR & F_C ? 1 : 0; + uint8_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x40) CCR |= F_C; v = (v << 2) | (c << 1) | ((v >> 6) & 0x01); if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_rotxl2_16(UINT16 v) +uint16_t h8_device::do_rotxl2_16(uint16_t v) { - UINT16 c = CCR & F_C ? 1 : 0; + uint16_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x4000) CCR |= F_C; v = (v << 2) | (c << 1) | ((v >> 14) & 0x0001); if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_rotxl2_32(UINT32 v) +uint32_t h8_device::do_rotxl2_32(uint32_t v) { - UINT32 c = CCR & F_C ? 1 : 0; + uint32_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x40000000) CCR |= F_C; v = (v << 2) | (c << 1) | ((v >> 30) & 0x00000001); if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -UINT8 h8_device::do_rotxr2_8(UINT8 v) +uint8_t h8_device::do_rotxr2_8(uint8_t v) { - UINT8 c = CCR & F_C ? 1 : 0; + uint8_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x02) CCR |= F_C; v = (v >> 2) | (c << 6) | (v << 7); if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; return v; } -UINT16 h8_device::do_rotxr2_16(UINT16 v) +uint16_t h8_device::do_rotxr2_16(uint16_t v) { - UINT16 c = CCR & F_C ? 1 : 0; + uint16_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x0002) CCR |= F_C; v = (v >> 2) | (c << 14) | (v << 15); if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; return v; } -UINT32 h8_device::do_rotxr2_32(UINT32 v) +uint32_t h8_device::do_rotxr2_32(uint32_t v) { - UINT32 c = CCR & F_C ? 1 : 0; + uint32_t c = CCR & F_C ? 1 : 0; CCR &= ~(F_N|F_V|F_Z|F_C); if(v & 0x00000002) CCR |= F_C; v = (v >> 2) | (c << 30) | (v << 31); if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; return v; } -void h8_device::set_nzv8(UINT8 v) +void h8_device::set_nzv8(uint8_t v) { CCR &= ~(F_N|F_V|F_Z); if(!v) CCR |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) CCR |= F_N; } -void h8_device::set_nzv16(UINT16 v) +void h8_device::set_nzv16(uint16_t v) { CCR &= ~(F_N|F_V|F_Z); if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; } -void h8_device::set_nzv32(UINT32 v) +void h8_device::set_nzv32(uint32_t v) { CCR &= ~(F_N|F_V|F_Z); if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; } -void h8_device::set_nz16(UINT16 v) +void h8_device::set_nz16(uint16_t v) { CCR &= ~(F_N|F_Z); if(!v) CCR |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) CCR |= F_N; } -void h8_device::set_nz32(UINT32 v) +void h8_device::set_nz32(uint32_t v) { CCR &= ~(F_N|F_Z); if(!v) CCR |= F_Z; - else if(INT32(v) < 0) + else if(int32_t(v) < 0) CCR |= F_N; } diff --git a/src/devices/cpu/h8/h8.h b/src/devices/cpu/h8/h8.h index be466fae2d2..8a106ed852d 100644 --- a/src/devices/cpu/h8/h8.h +++ b/src/devices/cpu/h8/h8.h @@ -61,7 +61,7 @@ public: STATE_DTC_WRITEBACK = 0x10006 }; - h8_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, bool mode_a16, address_map_delegate map_delegate); + h8_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, bool mode_a16, address_map_delegate map_delegate); void internal_update(); void set_irq(int irq_vector, int irq_level, bool irq_nmi); @@ -74,8 +74,8 @@ public: protected: struct disasm_entry { int slot; - UINT32 val, mask; - UINT16 val0, mask0; + uint32_t val, mask; + uint16_t val0, mask0; const char *opcode; int am1, am2; offs_t flags; @@ -159,9 +159,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; // device_memory_interface overrides @@ -173,9 +173,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config program_config, io_config; address_space *program, *io; @@ -185,18 +185,18 @@ protected: h8_dma_state *current_dma; h8_dtc_state *current_dtc; - UINT32 PPC; /* previous program counter */ - UINT32 NPC; /* next start-of-instruction program counter */ - UINT32 PC; /* program counter */ - UINT16 PIR; /* Prefetched word */ - UINT16 IR[5]; /* Fetched instruction */ - UINT16 R[16]; /* Rn (0-7), En (8-15, h8-300h+) */ - UINT8 EXR; /* Interrupt/trace register (h8s/2000+) */ - UINT8 CCR; /* Condition-code register */ - INT64 MAC; /* Multiply accumulator (h8s/2600+) */ - UINT8 MACF; /* MAC flags (h8s/2600+) */ - UINT32 TMP1, TMP2; - UINT32 TMPR; /* For debugger ER register import */ + uint32_t PPC; /* previous program counter */ + uint32_t NPC; /* next start-of-instruction program counter */ + uint32_t PC; /* program counter */ + uint16_t PIR; /* Prefetched word */ + uint16_t IR[5]; /* Fetched instruction */ + uint16_t R[16]; /* Rn (0-7), En (8-15, h8-300h+) */ + uint8_t EXR; /* Interrupt/trace register (h8s/2000+) */ + uint8_t CCR; /* Condition-code register */ + int64_t MAC; /* Multiply accumulator (h8s/2600+) */ + uint8_t MACF; /* MAC flags (h8s/2600+) */ + uint32_t TMP1, TMP2; + uint32_t TMPR; /* For debugger ER register import */ bool has_exr, has_trace, supports_advanced, mode_advanced, mac_saturating; @@ -208,137 +208,137 @@ protected: static const disasm_entry disasm_entries[]; - offs_t disassemble_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *table); - void disassemble_am(char *&buffer, int am, offs_t pc, const UINT8 *oprom, UINT32 opcode, int slot, int offset); + offs_t disassemble_generic(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options, const disasm_entry *table); + void disassemble_am(char *&buffer, int am, offs_t pc, const uint8_t *oprom, uint32_t opcode, int slot, int offset); virtual void do_exec_full(); virtual void do_exec_partial(); - static void add_event(UINT64 &event_time, UINT64 new_event); + static void add_event(uint64_t &event_time, uint64_t new_event); virtual bool exr_in_stack() const; virtual void update_irq_filter() = 0; virtual void interrupt_taken() = 0; - virtual void internal_update(UINT64 current_time) = 0; - void recompute_bcount(UINT64 event_time); + virtual void internal_update(uint64_t current_time) = 0; + void recompute_bcount(uint64_t event_time); virtual int trace_setup(); virtual int trapa_setup(); virtual void irq_setup() = 0; - UINT16 read16i(UINT32 adr); - UINT16 fetch(); + uint16_t read16i(uint32_t adr); + uint16_t fetch(); inline void fetch(int slot) { IR[slot] = fetch(); } - UINT8 read8(UINT32 adr); - void write8(UINT32 adr, UINT8 data); - UINT16 read16(UINT32 adr); - void write16(UINT32 adr, UINT16 data); + uint8_t read8(uint32_t adr); + void write8(uint32_t adr, uint8_t data); + uint16_t read16(uint32_t adr); + void write16(uint32_t adr, uint16_t data); void internal(int cycles); inline void prefetch() { prefetch_start(); prefetch_done(); } inline void prefetch_noirq() { prefetch_start(); prefetch_done_noirq(); } inline void prefetch_noirq_notrace() { prefetch_start(); prefetch_done_noirq_notrace(); } void prefetch_start() { NPC = PC; PIR = fetch(); } - void prefetch_switch(UINT32 pc, UINT16 ir) { NPC = pc; PC = pc+2; PIR = ir; } + void prefetch_switch(uint32_t pc, uint16_t ir) { NPC = pc; PC = pc+2; PIR = ir; } void prefetch_done(); void prefetch_done_noirq(); void prefetch_done_noirq_notrace(); void illegal(); - UINT8 do_addx8(UINT8 a, UINT8 b); - UINT8 do_subx8(UINT8 a, UINT8 b); + uint8_t do_addx8(uint8_t a, uint8_t b); + uint8_t do_subx8(uint8_t a, uint8_t b); - UINT8 do_inc8(UINT8 a, UINT8 b); - UINT16 do_inc16(UINT16 a, UINT16 b); - UINT32 do_inc32(UINT32 a, UINT32 b); + uint8_t do_inc8(uint8_t a, uint8_t b); + uint16_t do_inc16(uint16_t a, uint16_t b); + uint32_t do_inc32(uint32_t a, uint32_t b); - UINT8 do_add8(UINT8 a, UINT8 b); - UINT16 do_add16(UINT16 a, UINT16 b); - UINT32 do_add32(UINT32 a, UINT32 b); + uint8_t do_add8(uint8_t a, uint8_t b); + uint16_t do_add16(uint16_t a, uint16_t b); + uint32_t do_add32(uint32_t a, uint32_t b); - UINT8 do_dec8(UINT8 a, UINT8 b); - UINT16 do_dec16(UINT16 a, UINT16 b); - UINT32 do_dec32(UINT32 a, UINT32 b); + uint8_t do_dec8(uint8_t a, uint8_t b); + uint16_t do_dec16(uint16_t a, uint16_t b); + uint32_t do_dec32(uint32_t a, uint32_t b); - UINT8 do_sub8(UINT8 a, UINT8 b); - UINT16 do_sub16(UINT16 a, UINT16 b); - UINT32 do_sub32(UINT32 a, UINT32 b); + uint8_t do_sub8(uint8_t a, uint8_t b); + uint16_t do_sub16(uint16_t a, uint16_t b); + uint32_t do_sub32(uint32_t a, uint32_t b); - UINT8 do_shal8(UINT8 v); - UINT16 do_shal16(UINT16 v); - UINT32 do_shal32(UINT32 v); + uint8_t do_shal8(uint8_t v); + uint16_t do_shal16(uint16_t v); + uint32_t do_shal32(uint32_t v); - UINT8 do_shar8(UINT8 v); - UINT16 do_shar16(UINT16 v); - UINT32 do_shar32(UINT32 v); + uint8_t do_shar8(uint8_t v); + uint16_t do_shar16(uint16_t v); + uint32_t do_shar32(uint32_t v); - UINT8 do_shll8(UINT8 v); - UINT16 do_shll16(UINT16 v); - UINT32 do_shll32(UINT32 v); + uint8_t do_shll8(uint8_t v); + uint16_t do_shll16(uint16_t v); + uint32_t do_shll32(uint32_t v); - UINT8 do_shlr8(UINT8 v); - UINT16 do_shlr16(UINT16 v); - UINT32 do_shlr32(UINT32 v); + uint8_t do_shlr8(uint8_t v); + uint16_t do_shlr16(uint16_t v); + uint32_t do_shlr32(uint32_t v); - UINT8 do_rotl8(UINT8 v); - UINT16 do_rotl16(UINT16 v); - UINT32 do_rotl32(UINT32 v); + uint8_t do_rotl8(uint8_t v); + uint16_t do_rotl16(uint16_t v); + uint32_t do_rotl32(uint32_t v); - UINT8 do_rotr8(UINT8 v); - UINT16 do_rotr16(UINT16 v); - UINT32 do_rotr32(UINT32 v); + uint8_t do_rotr8(uint8_t v); + uint16_t do_rotr16(uint16_t v); + uint32_t do_rotr32(uint32_t v); - UINT8 do_rotxl8(UINT8 v); - UINT16 do_rotxl16(UINT16 v); - UINT32 do_rotxl32(UINT32 v); + uint8_t do_rotxl8(uint8_t v); + uint16_t do_rotxl16(uint16_t v); + uint32_t do_rotxl32(uint32_t v); - UINT8 do_rotxr8(UINT8 v); - UINT16 do_rotxr16(UINT16 v); - UINT32 do_rotxr32(UINT32 v); + uint8_t do_rotxr8(uint8_t v); + uint16_t do_rotxr16(uint16_t v); + uint32_t do_rotxr32(uint32_t v); - UINT8 do_shal2_8(UINT8 v); - UINT16 do_shal2_16(UINT16 v); - UINT32 do_shal2_32(UINT32 v); + uint8_t do_shal2_8(uint8_t v); + uint16_t do_shal2_16(uint16_t v); + uint32_t do_shal2_32(uint32_t v); - UINT8 do_shar2_8(UINT8 v); - UINT16 do_shar2_16(UINT16 v); - UINT32 do_shar2_32(UINT32 v); + uint8_t do_shar2_8(uint8_t v); + uint16_t do_shar2_16(uint16_t v); + uint32_t do_shar2_32(uint32_t v); - UINT8 do_shll2_8(UINT8 v); - UINT16 do_shll2_16(UINT16 v); - UINT32 do_shll2_32(UINT32 v); + uint8_t do_shll2_8(uint8_t v); + uint16_t do_shll2_16(uint16_t v); + uint32_t do_shll2_32(uint32_t v); - UINT8 do_shlr2_8(UINT8 v); - UINT16 do_shlr2_16(UINT16 v); - UINT32 do_shlr2_32(UINT32 v); + uint8_t do_shlr2_8(uint8_t v); + uint16_t do_shlr2_16(uint16_t v); + uint32_t do_shlr2_32(uint32_t v); - UINT8 do_rotl2_8(UINT8 v); - UINT16 do_rotl2_16(UINT16 v); - UINT32 do_rotl2_32(UINT32 v); + uint8_t do_rotl2_8(uint8_t v); + uint16_t do_rotl2_16(uint16_t v); + uint32_t do_rotl2_32(uint32_t v); - UINT8 do_rotr2_8(UINT8 v); - UINT16 do_rotr2_16(UINT16 v); - UINT32 do_rotr2_32(UINT32 v); + uint8_t do_rotr2_8(uint8_t v); + uint16_t do_rotr2_16(uint16_t v); + uint32_t do_rotr2_32(uint32_t v); - UINT8 do_rotxl2_8(UINT8 v); - UINT16 do_rotxl2_16(UINT16 v); - UINT32 do_rotxl2_32(UINT32 v); + uint8_t do_rotxl2_8(uint8_t v); + uint16_t do_rotxl2_16(uint16_t v); + uint32_t do_rotxl2_32(uint32_t v); - UINT8 do_rotxr2_8(UINT8 v); - UINT16 do_rotxr2_16(UINT16 v); - UINT32 do_rotxr2_32(UINT32 v); + uint8_t do_rotxr2_8(uint8_t v); + uint16_t do_rotxr2_16(uint16_t v); + uint32_t do_rotxr2_32(uint32_t v); - void set_nzv8(UINT8 v); - void set_nzv16(UINT16 v); - void set_nzv32(UINT32 v); + void set_nzv8(uint8_t v); + void set_nzv16(uint16_t v); + void set_nzv32(uint32_t v); - void set_nz16(UINT16 v); - void set_nz32(UINT32 v); + void set_nz16(uint16_t v); + void set_nz32(uint32_t v); - inline void r8_w(int reg, UINT8 val) { + inline void r8_w(int reg, uint8_t val) { if(reg & 8) R[reg & 7] = (R[reg & 7] & 0xff00) | val; else R[reg & 7] = (R[reg & 7] & 0xff) | (val << 8); } - inline UINT8 r8_r(int reg) { + inline uint8_t r8_r(int reg) { if(reg & 8) return R[reg & 7]; else @@ -353,8 +353,8 @@ protected: // and the h8-300h is r32 of course, we have to be careful to mask // in h8.lst there if the top bit is 1. - inline void r16_w(int reg, UINT16 val) { R[reg & 0xf] = val; } - inline UINT16 r16_r(int reg) { return R[reg & 0xf]; } + inline void r16_w(int reg, uint16_t val) { R[reg & 0xf] = val; } + inline uint16_t r16_r(int reg) { return R[reg & 0xf]; } #define O(o) void o ## _full(); void o ## _partial() O(add_b_imm8_r8u); O(add_b_r8h_r8l); O(add_w_imm16_r16l); O(add_w_r16h_r16l); diff --git a/src/devices/cpu/h8/h8.lst b/src/devices/cpu/h8/h8.lst index 4763ca6f2cc..600deb94c95 100644 --- a/src/devices/cpu/h8/h8.lst +++ b/src/devices/cpu/h8/h8.lst @@ -8,11 +8,11 @@ macro bxx_any %cond prefetch_done(); macro bxx_8 %cond - TMP1 = PC + INT8(IR[0]); + TMP1 = PC + int8_t(IR[0]); bxx_any %cond macro bxx_16 %cond - TMP1 = PC + INT16(IR[1]); + TMP1 = PC + int16_t(IR[1]); bxx_any %cond macro bset %bit @@ -187,7 +187,7 @@ macro jsr32 %opc %spreg current_dma->dest += current_dma->incd; current_dma->count--; if(!current_dma->count) { - UINT8 id = current_dma->id; + uint8_t id = current_dma->id; current_dma = nullptr; dma_device->count_done(id); } @@ -205,7 +205,7 @@ macro jsr32 %opc %spreg current_dtc->dar = (current_dtc->dar & 0xff000000) | ((current_dtc->dar + current_dtc->incd) & 0x00ffffff); current_dtc->count--; if(!current_dtc->count) { - UINT8 id = current_dtc->id; + uint8_t id = current_dtc->id; current_dtc = nullptr; dtc_device->count_done(id); } @@ -267,7 +267,7 @@ macro jsr32 %opc %spreg 01006b00 fffffff8 0 mov.l abs16 r32l h prefetch_start(); - TMP2 = INT16(IR[2]); + TMP2 = int16_t(IR[2]); TMP1 = read16(TMP2) << 16; TMP1 |= read16(TMP2+2); set_nzv32(TMP1); @@ -286,7 +286,7 @@ macro jsr32 %opc %spreg 01006b80 fffffff8 0 mov.l r32l abs16 h prefetch_start(); TMP1 = r32_r(IR[1]); - TMP2 = INT16(IR[2]); + TMP2 = int16_t(IR[2]); set_nzv32(TMP1); write16(TMP2, TMP1 >> 16); write16(TMP2+2, TMP1); @@ -327,7 +327,7 @@ macro jsr32 %opc %spreg 01006f00 ffffff88 0 mov.l r32d16h r32l h prefetch_start(); - TMP1 = r32_r(IR[1] >> 4) + INT16(IR[2]); + TMP1 = r32_r(IR[1] >> 4) + int16_t(IR[2]); TMP2 = read16(TMP1) << 16; TMP2 |= read16(TMP1+2); set_nzv32(TMP2); @@ -336,7 +336,7 @@ macro jsr32 %opc %spreg 01006f80 ffffff88 0 mov.l r32l r32d16h h prefetch_start(); - TMP1 = r32_r(IR[1] >> 4) + INT16(IR[2]); + TMP1 = r32_r(IR[1] >> 4) + int16_t(IR[2]); TMP2 = r32_r(IR[1]); set_nzv32(TMP2); write16(TMP1, TMP2 >> 16); @@ -506,7 +506,7 @@ macro jsr32 %opc %spreg 01406b00 ffffffff 0 ldc.w abs16 ccr h prefetch_start(); - TMP1 = INT16(IR[2]); + TMP1 = int16_t(IR[2]); CCR = read16(TMP1) >> 8; update_irq_filter(); prefetch_done_noirq(); @@ -520,7 +520,7 @@ macro jsr32 %opc %spreg 01406b80 ffffffff 0 stc.w ccr abs16 h prefetch_start(); - TMP1 = INT16(IR[2]); + TMP1 = int16_t(IR[2]); write16(TMP1, (CCR << 8) | CCR); prefetch_done(); @@ -549,14 +549,14 @@ macro jsr32 %opc %spreg 01406f00 ffffff8f 0 ldc.w r32d16h ccr h prefetch_start(); - TMP1 = r32_r(IR[1] >> 4) + INT16(IR[2]); + TMP1 = r32_r(IR[1] >> 4) + int16_t(IR[2]); CCR = read16(TMP1) >> 8; update_irq_filter(); prefetch_done_noirq(); 01406f80 ffffff8f 0 stc.w ccr r32d16h h prefetch_start(); - TMP1 = r32_r(IR[1] >> 4) + INT16(IR[2]); + TMP1 = r32_r(IR[1] >> 4) + int16_t(IR[2]); write16(TMP1, (CCR << 8) | CCR); prefetch_done(); @@ -593,7 +593,7 @@ macro jsr32 %opc %spreg 01416b00 ffffffff 0 ldc.w abs16 exr s20 prefetch_start(); - TMP1 = INT16(IR[2]); + TMP1 = int16_t(IR[2]); EXR = (read16(TMP1) >> 8) | EXR_NC; update_irq_filter(); prefetch_done_noirq(); @@ -607,7 +607,7 @@ macro jsr32 %opc %spreg 01416b80 ffffffff 0 stc.w exr abs16 s20 prefetch_start(); - TMP1 = INT16(IR[2]); + TMP1 = int16_t(IR[2]); write16(TMP1, (EXR << 8) | EXR); prefetch_done(); @@ -636,14 +636,14 @@ macro jsr32 %opc %spreg 01416f00 ffffff8f 0 ldc.w r32d16h exr s20 prefetch_start(); - TMP1 = r32_r(IR[1] >> 4) + INT16(IR[2]); + TMP1 = r32_r(IR[1] >> 4) + int16_t(IR[2]); EXR = (read16(TMP1) >> 8) | EXR_NC; update_irq_filter(); prefetch_done_noirq(); 01416f80 ffffff8f 0 stc.w exr r32d16h s20 prefetch_start(); - TMP1 = r32_r(IR[1] >> 4) + INT16(IR[2]); + TMP1 = r32_r(IR[1] >> 4) + int16_t(IR[2]); write16(TMP1, (EXR << 8) | EXR); prefetch_done(); @@ -666,7 +666,7 @@ macro jsr32 %opc %spreg r32_w(IR[1], r32_r(IR[1]) + 2); TMP2 = read16(r32_r(IR[1] >> 4)); r32_w(IR[1] >> 4, r32_r(IR[1] >> 4) + 2); - MAC += INT16(TMP1)*INT16(TMP2); + MAC += int16_t(TMP1)*int16_t(TMP2); MACF &= ~(F_Z|F_N); if(MAC) MACF |= F_Z; @@ -707,7 +707,7 @@ macro jsr32 %opc %spreg 01c05000 ffffff00 0 mulxs.b r8h r16l h prefetch_start(); - TMP1 = INT8(r16_r(IR[1])) * INT8(r8_r(IR[1] >> 4)); + TMP1 = int8_t(r16_r(IR[1])) * int8_t(r8_r(IR[1] >> 4)); set_nz16(TMP1); r16_w(IR[1], TMP1); internal(2); @@ -715,7 +715,7 @@ macro jsr32 %opc %spreg 01c05200 ffffff08 0 mulxs.w r16h r32l h prefetch_start(); - TMP1 = INT16(r32_r(IR[1])) * INT16(r16_r(IR[1] >> 4)); + TMP1 = int16_t(r32_r(IR[1])) * int16_t(r16_r(IR[1] >> 4)); set_nz32(TMP1); r32_w(IR[1], TMP1); internal(3); @@ -724,8 +724,8 @@ macro jsr32 %opc %spreg 01d05100 ffffff00 0 divxs.b r8h r16l h prefetch_start(); internal(11); - TMP1 = INT16(r16_r(IR[1])); - TMP2 = INT8(r8_r(IR[1] >> 4)); + TMP1 = int16_t(r16_r(IR[1])); + TMP2 = int8_t(r8_r(IR[1] >> 4)); CCR &= ~(F_Z|F_N); if(!TMP2) { CCR |= F_Z; @@ -774,7 +774,7 @@ macro jsr32 %opc %spreg prefetch_start(); internal(19); TMP1 = r32_r(IR[1]); - TMP2 = INT16(r16_r(IR[1] >> 4)); + TMP2 = int16_t(r16_r(IR[1] >> 4)); CCR &= ~(F_Z|F_N); if(!TMP2) { CCR |= F_Z; @@ -881,7 +881,7 @@ macro jsr32 %opc %spreg TMP1 |= 0xfffffc00; else TMP1 &= ~0xfffffc00; - MAC = (MAC & 0x00000000ffffffffULL) | (UINT64(TMP1) << 32); + MAC = (MAC & 0x00000000ffffffffULL) | (uint64_t(TMP1) << 32); MACF &= ~F_V; prefetch_done(); @@ -1245,7 +1245,7 @@ macro jsr32 %opc %spreg 1750 fff0 0 extu.w r16l - h CCR &= ~(F_N|F_Z|F_V); - TMP1 = UINT8(r16_r(IR[0])); + TMP1 = uint8_t(r16_r(IR[0])); if(!TMP1) CCR |= F_Z; r16_w(IR[0], TMP1); @@ -1253,7 +1253,7 @@ macro jsr32 %opc %spreg 1770 fff8 0 extu.l r32l - h CCR &= ~(F_N|F_Z|F_V); - TMP1 = UINT16(r32_r(IR[0])); + TMP1 = uint16_t(r32_r(IR[0])); if(!TMP1) CCR |= F_Z; r32_w(IR[0], TMP1); @@ -1273,7 +1273,7 @@ macro jsr32 %opc %spreg 17d0 fff0 0 exts.w r16l - h CCR &= ~(F_N|F_Z|F_V); - TMP1 = INT8(r16_r(IR[0])); + TMP1 = int8_t(r16_r(IR[0])); if(!TMP1) CCR |= F_Z; r16_w(IR[0], TMP1); @@ -1281,7 +1281,7 @@ macro jsr32 %opc %spreg 17f0 fff8 0 exts.l r32l - h CCR &= ~(F_N|F_Z|F_V); - TMP1 = INT16(r32_r(IR[0])); + TMP1 = int16_t(r32_r(IR[0])); if(!TMP1) CCR |= F_Z; r32_w(IR[0], TMP1); @@ -1443,7 +1443,7 @@ macro jsr32 %opc %spreg 5000 ff00 0 mulxu.b r8h r16l prefetch_start(); - r16_w(IR[0], UINT8(r16_r(IR[0])) * r8_r(IR[0] >> 4)); + r16_w(IR[0], uint8_t(r16_r(IR[0])) * r8_r(IR[0] >> 4)); internal(2); prefetch_done(); @@ -1466,7 +1466,7 @@ macro jsr32 %opc %spreg 5200 ff08 0 mulxu.w r16h r32l h prefetch_start(); - r32_w(IR[0], UINT16(r32_r(IR[0])) * r16_r(IR[0] >> 4)); + r32_w(IR[0], uint16_t(r32_r(IR[0])) * r16_r(IR[0] >> 4)); internal(3); prefetch_done(); @@ -1513,12 +1513,12 @@ macro jsr32 %opc %spreg 5500 ff00 0 bsr rel8 - o TMP2 = PC; - PC += INT8(IR[0]); + PC += int8_t(IR[0]); jsr16 TMP2 TMP1 5500 ff00 0 bsr rel8 - h TMP2 = PC; - PC += INT8(IR[0]); + PC += int8_t(IR[0]); jsr32 TMP2 TMP1 5670 ffff 0 rte - - o @@ -1664,7 +1664,7 @@ macro jsr32 %opc %spreg 5c00 ffff 0 bsr rel16 - h internal(1); TMP2 = PC; - PC += INT16(IR[1]); + PC += int16_t(IR[1]); jsr32 TMP2 TMP1 5d00 ff8f 0 jsr r16h - o @@ -1818,73 +1818,73 @@ macro jsr32 %opc %spreg 6a00 fff0 0 mov.b abs16 r8l prefetch_start(); - TMP1 = read8(INT16(IR[1])); + TMP1 = read8(int16_t(IR[1])); set_nzv8(TMP1); r8_w(IR[0], TMP1); prefetch_done(); 6a106300 ffffff0f 1 btst r8h abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); btst r8_r(IR[2] >> 4) prefetch(); 6a107300 ffffff8f 1 btst imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); btst IR[2] >> 4 prefetch(); 6a107400 ffffff8f 1 bor imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); bor IR[2] >> 4 prefetch(); 6a107480 ffffff8f 1 bior imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); bior IR[2] >> 4 prefetch(); 6a107500 ffffff8f 1 bxor imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); bxor IR[2] >> 4 prefetch(); 6a107580 ffffff8f 1 bixor imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); bixor IR[2] >> 4 prefetch(); 6a107600 ffffff8f 1 band imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); band IR[2] >> 4 prefetch(); 6a107680 ffffff8f 1 biand imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); biand IR[2] >> 4 prefetch(); 6a107700 ffffff8f 1 bld imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); bld IR[2] >> 4 prefetch(); 6a107780 ffffff8f 1 bild imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); bild IR[2] >> 4 prefetch(); 6a186000 ffffff0f 1 bset r8h abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); prefetch_start(); bset r8_r(IR[2] >> 4) @@ -1892,7 +1892,7 @@ macro jsr32 %opc %spreg prefetch_done(); 6a186100 ffffff0f 1 bnot r8h abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); prefetch_start(); bnot r8_r(IR[2] >> 4) @@ -1900,7 +1900,7 @@ macro jsr32 %opc %spreg prefetch_done(); 6a186200 ffffff0f 1 bclr r8h abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); prefetch_start(); bclr r8_r(IR[2] >> 4) @@ -1908,7 +1908,7 @@ macro jsr32 %opc %spreg prefetch_done(); 6a186700 ffffff8f 1 bst imm3 abs16 - TMP2 = INT16(IR[2]); + TMP2 = int16_t(IR[2]); TMP1 = read8(TMP2); prefetch_start(); bst IR[2] >> 4 @@ -1916,7 +1916,7 @@ macro jsr32 %opc %spreg prefetch_done(); 6a186780 ffffff8f 1 bist imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); prefetch_start(); bist IR[2] >> 4 @@ -1924,7 +1924,7 @@ macro jsr32 %opc %spreg prefetch_done(); 6a187000 ffffff8f 1 bset imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); prefetch_start(); bset IR[2] >> 4 @@ -1932,7 +1932,7 @@ macro jsr32 %opc %spreg prefetch_done(); 6a187100 ffffff8f 1 bnot imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); prefetch_start(); bnot IR[2] >> 4 @@ -1940,7 +1940,7 @@ macro jsr32 %opc %spreg prefetch_done(); 6a187200 ffffff8f 1 bclr imm3 abs16 - TMP2 = INT16(IR[1]); + TMP2 = int16_t(IR[1]); TMP1 = read8(TMP2); prefetch_start(); bclr IR[2] >> 4 @@ -2083,7 +2083,7 @@ macro jsr32 %opc %spreg prefetch_start(); TMP1 = r8_r(IR[0]); set_nzv8(TMP1); - write8(INT16(IR[1]), TMP1); + write8(int16_t(IR[1]), TMP1); prefetch_done(); 6aa0 fff0 0 mov.b r8l abs32 h @@ -2096,7 +2096,7 @@ macro jsr32 %opc %spreg 6ac0 fff0 0 movtpe r8l abs16 6b00 fff0 0 mov.w abs16 r16l prefetch_start(); - TMP1 = read16(INT16(IR[1])); + TMP1 = read16(int16_t(IR[1])); set_nzv16(TMP1); r16_w(IR[0], TMP1); prefetch_done(); @@ -2112,7 +2112,7 @@ macro jsr32 %opc %spreg prefetch_start(); TMP1 = r16_r(IR[0]); set_nzv16(TMP1); - write16(INT16(IR[1]), TMP1); + write16(int16_t(IR[1]), TMP1); prefetch_done(); 6ba0 fff0 0 mov.w r16l abs32 h @@ -2212,7 +2212,7 @@ macro jsr32 %opc %spreg 6e00 ff80 0 mov.b r16d16h r8l o prefetch_start(); - TMP1 = UINT16(r16_r(IR[0] >> 4) + IR[1]); + TMP1 = uint16_t(r16_r(IR[0] >> 4) + IR[1]); TMP2 = read8(TMP1); set_nzv8(TMP2); r8_w(IR[0], TMP2); @@ -2220,7 +2220,7 @@ macro jsr32 %opc %spreg 6e00 ff80 0 mov.b r32d16h r8l h prefetch_start(); - TMP1 = r32_r(IR[0] >> 4) + INT16(IR[1]); + TMP1 = r32_r(IR[0] >> 4) + int16_t(IR[1]); TMP2 = read8(TMP1); set_nzv8(TMP2); r8_w(IR[0], TMP2); @@ -2228,7 +2228,7 @@ macro jsr32 %opc %spreg 6e80 ff80 0 mov.b r8l r16d16h o prefetch_start(); - TMP1 = UINT16(r16_r((IR[0] >> 4) & 7) + IR[1]); + TMP1 = uint16_t(r16_r((IR[0] >> 4) & 7) + IR[1]); TMP2 = r8_r(IR[0]); set_nzv8(TMP2); write8(TMP1, TMP2); @@ -2236,7 +2236,7 @@ macro jsr32 %opc %spreg 6e80 ff80 0 mov.b r8l r32d16h h prefetch_start(); - TMP1 = r32_r(IR[0] >> 4) + INT16(IR[1]); + TMP1 = r32_r(IR[0] >> 4) + int16_t(IR[1]); TMP2 = r8_r(IR[0]); set_nzv8(TMP2); write8(TMP1, TMP2); @@ -2244,7 +2244,7 @@ macro jsr32 %opc %spreg 6f00 ff80 0 mov.w r16d16h r16l o prefetch_start(); - TMP1 = UINT16(r16_r(IR[0] >> 4) + IR[1]); + TMP1 = uint16_t(r16_r(IR[0] >> 4) + IR[1]); TMP2 = read16(TMP1); set_nzv16(TMP2); r16_w(IR[0], TMP2); @@ -2252,7 +2252,7 @@ macro jsr32 %opc %spreg 6f00 ff80 0 mov.w r32d16h r16l h prefetch_start(); - TMP1 = r32_r(IR[0] >> 4) + INT16(IR[1]); + TMP1 = r32_r(IR[0] >> 4) + int16_t(IR[1]); TMP2 = read16(TMP1); set_nzv16(TMP2); r16_w(IR[0], TMP2); @@ -2260,7 +2260,7 @@ macro jsr32 %opc %spreg 6f80 ff80 0 mov.w r16l r16d16h o prefetch_start(); - TMP1 = UINT16(r16_r((IR[0] >> 4) & 7) + IR[1]); + TMP1 = uint16_t(r16_r((IR[0] >> 4) & 7) + IR[1]); TMP2 = r16_r(IR[0]); set_nzv16(TMP2); write16(TMP1, TMP2); @@ -2268,7 +2268,7 @@ macro jsr32 %opc %spreg 6f80 ff80 0 mov.w r16l r32d16h h prefetch_start(); - TMP1 = r32_r(IR[0] >> 4) + INT16(IR[1]); + TMP1 = r32_r(IR[0] >> 4) + int16_t(IR[1]); TMP2 = r16_r(IR[0]); set_nzv16(TMP2); write16(TMP1, TMP2); diff --git a/src/devices/cpu/h8/h83002.cpp b/src/devices/cpu/h8/h83002.cpp index 0b9a8036983..da976c31052 100644 --- a/src/devices/cpu/h8/h83002.cpp +++ b/src/devices/cpu/h8/h83002.cpp @@ -5,7 +5,7 @@ const device_type H83002 = &device_creator; -h83002_device::h83002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83002_device::h83002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8h_device(mconfig, H83002, "H8/3002", tag, owner, clock, "h83002", __FILE__, address_map_delegate(FUNC(h83002_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -185,9 +185,9 @@ void h83002_device::interrupt_taken() standard_irq_callback(intc->interrupt_taken(taken_irq_vector)); } -void h83002_device::internal_update(UINT64 current_time) +void h83002_device::internal_update(uint64_t current_time) { - UINT64 event_time = 0; + uint64_t event_time = 0; add_event(event_time, adc->internal_update(current_time)); add_event(event_time, sci0->internal_update(current_time)); diff --git a/src/devices/cpu/h8/h83002.h b/src/devices/cpu/h8/h83002.h index 64e38f43897..4f524c6f0b9 100644 --- a/src/devices/cpu/h8/h83002.h +++ b/src/devices/cpu/h8/h83002.h @@ -24,7 +24,7 @@ class h83002_device : public h8h_device { public: - h83002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(syscr_r); DECLARE_WRITE8_MEMBER(syscr_w); @@ -49,13 +49,13 @@ protected: required_device sci1; required_device watchdog; - UINT8 syscr; + uint8_t syscr; virtual void update_irq_filter() override; virtual void interrupt_taken() override; virtual int trapa_setup() override; virtual void irq_setup() override; - virtual void internal_update(UINT64 current_time) override; + virtual void internal_update(uint64_t current_time) override; virtual machine_config_constructor device_mconfig_additions() const override; DECLARE_ADDRESS_MAP(map, 16); diff --git a/src/devices/cpu/h8/h83006.cpp b/src/devices/cpu/h8/h83006.cpp index 04c51cd720c..fd0ed7cc9dc 100644 --- a/src/devices/cpu/h8/h83006.cpp +++ b/src/devices/cpu/h8/h83006.cpp @@ -7,7 +7,7 @@ const device_type H83006 = &device_creator; const device_type H83007 = &device_creator; -h83006_device::h83006_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) : +h83006_device::h83006_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) : h8h_device(mconfig, type, name, tag, owner, clock, shortname, source, address_map_delegate(FUNC(h83006_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -35,7 +35,7 @@ h83006_device::h83006_device(const machine_config &mconfig, device_type type, co ram_start = 0; } -h83006_device::h83006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83006_device::h83006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8h_device(mconfig, H83006, "H8/3006", tag, owner, clock, "h83006", __FILE__, address_map_delegate(FUNC(h83006_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -64,7 +64,7 @@ h83006_device::h83006_device(const machine_config &mconfig, const char *tag, dev } -h83007_device::h83007_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83007_device::h83007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h83006_device(mconfig, H83007, "H8/3007", tag, owner, clock, "h83007", __FILE__) { ram_start = 0xffef20; @@ -235,9 +235,9 @@ void h83006_device::interrupt_taken() standard_irq_callback(intc->interrupt_taken(taken_irq_vector)); } -void h83006_device::internal_update(UINT64 current_time) +void h83006_device::internal_update(uint64_t current_time) { - UINT64 event_time = 0; + uint64_t event_time = 0; add_event(event_time, adc->internal_update(current_time)); add_event(event_time, sci0->internal_update(current_time)); diff --git a/src/devices/cpu/h8/h83006.h b/src/devices/cpu/h8/h83006.h index 34427c94644..9b73d54d1fe 100644 --- a/src/devices/cpu/h8/h83006.h +++ b/src/devices/cpu/h8/h83006.h @@ -25,8 +25,8 @@ class h83006_device : public h8h_device { public: - h83006_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); - h83006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83006_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); + h83006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(syscr_r); DECLARE_WRITE8_MEMBER(syscr_w); @@ -54,14 +54,14 @@ protected: required_device sci2; required_device watchdog; - UINT8 syscr; - UINT32 ram_start; + uint8_t syscr; + uint32_t ram_start; virtual void update_irq_filter() override; virtual void interrupt_taken() override; virtual int trapa_setup() override; virtual void irq_setup() override; - virtual void internal_update(UINT64 current_time) override; + virtual void internal_update(uint64_t current_time) override; virtual machine_config_constructor device_mconfig_additions() const override; DECLARE_ADDRESS_MAP(map, 16); @@ -73,7 +73,7 @@ protected: class h83007_device : public h83006_device { public: - h83007_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type H83006; diff --git a/src/devices/cpu/h8/h83008.cpp b/src/devices/cpu/h8/h83008.cpp index abc7d49ec97..c6462944420 100644 --- a/src/devices/cpu/h8/h83008.cpp +++ b/src/devices/cpu/h8/h83008.cpp @@ -5,7 +5,7 @@ const device_type H83008 = &device_creator; -h83008_device::h83008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83008_device::h83008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8h_device(mconfig, H83008, "H8/3008", tag, owner, clock, "h83008", __FILE__, address_map_delegate(FUNC(h83008_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -188,9 +188,9 @@ void h83008_device::interrupt_taken() standard_irq_callback(intc->interrupt_taken(taken_irq_vector)); } -void h83008_device::internal_update(UINT64 current_time) +void h83008_device::internal_update(uint64_t current_time) { - UINT64 event_time = 0; + uint64_t event_time = 0; add_event(event_time, adc->internal_update(current_time)); add_event(event_time, sci0->internal_update(current_time)); diff --git a/src/devices/cpu/h8/h83008.h b/src/devices/cpu/h8/h83008.h index e3f9a50054d..8a24631ee90 100644 --- a/src/devices/cpu/h8/h83008.h +++ b/src/devices/cpu/h8/h83008.h @@ -25,7 +25,7 @@ class h83008_device : public h8h_device { public: - h83008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(syscr_r); DECLARE_WRITE8_MEMBER(syscr_w); @@ -52,13 +52,13 @@ protected: required_device sci1; required_device watchdog; - UINT8 syscr; + uint8_t syscr; virtual void update_irq_filter() override; virtual void interrupt_taken() override; virtual int trapa_setup() override; virtual void irq_setup() override; - virtual void internal_update(UINT64 current_time) override; + virtual void internal_update(uint64_t current_time) override; virtual machine_config_constructor device_mconfig_additions() const override; DECLARE_ADDRESS_MAP(map, 16); diff --git a/src/devices/cpu/h8/h83048.cpp b/src/devices/cpu/h8/h83048.cpp index 9fb781d465f..0689072e9aa 100644 --- a/src/devices/cpu/h8/h83048.cpp +++ b/src/devices/cpu/h8/h83048.cpp @@ -8,7 +8,7 @@ const device_type H83045 = &device_creator; const device_type H83047 = &device_creator; const device_type H83048 = &device_creator; -h83048_device::h83048_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) : +h83048_device::h83048_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) : h8h_device(mconfig, type, name, tag, owner, clock, shortname, source, address_map_delegate(FUNC(h83048_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -37,7 +37,7 @@ h83048_device::h83048_device(const machine_config &mconfig, device_type type, co syscr = 0; } -h83048_device::h83048_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83048_device::h83048_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8h_device(mconfig, H83048, "H8/3048", tag, owner, clock, "h83048", __FILE__, address_map_delegate(FUNC(h83048_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -66,19 +66,19 @@ h83048_device::h83048_device(const machine_config &mconfig, const char *tag, dev ram_start = 0xffef10; } -h83044_device::h83044_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83044_device::h83044_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h83048_device(mconfig, H83044, "H8/3044", tag, owner, clock, "h83044", __FILE__) { ram_start = 0xfff710; } -h83045_device::h83045_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83045_device::h83045_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h83048_device(mconfig, H83045, "H8/3045", tag, owner, clock, "h83045", __FILE__) { ram_start = 0xfff710; } -h83047_device::h83047_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83047_device::h83047_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h83048_device(mconfig, H83047, "H8/3047", tag, owner, clock, "h83047", __FILE__) { ram_start = 0xffef10; @@ -255,9 +255,9 @@ void h83048_device::interrupt_taken() standard_irq_callback(intc->interrupt_taken(taken_irq_vector)); } -void h83048_device::internal_update(UINT64 current_time) +void h83048_device::internal_update(uint64_t current_time) { - UINT64 event_time = 0; + uint64_t event_time = 0; add_event(event_time, adc->internal_update(current_time)); add_event(event_time, sci0->internal_update(current_time)); diff --git a/src/devices/cpu/h8/h83048.h b/src/devices/cpu/h8/h83048.h index 34cb2358f3b..367313290fc 100644 --- a/src/devices/cpu/h8/h83048.h +++ b/src/devices/cpu/h8/h83048.h @@ -32,8 +32,8 @@ class h83048_device : public h8h_device { public: - h83048_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); - h83048_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83048_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); + h83048_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(syscr_r); DECLARE_WRITE8_MEMBER(syscr_w); @@ -62,14 +62,14 @@ protected: required_device sci1; required_device watchdog; - UINT32 ram_start; - UINT8 syscr; + uint32_t ram_start; + uint8_t syscr; virtual void update_irq_filter() override; virtual void interrupt_taken() override; virtual int trapa_setup() override; virtual void irq_setup() override; - virtual void internal_update(UINT64 current_time) override; + virtual void internal_update(uint64_t current_time) override; virtual machine_config_constructor device_mconfig_additions() const override; DECLARE_ADDRESS_MAP(map, 16); @@ -80,17 +80,17 @@ protected: class h83044_device : public h83048_device { public: - h83044_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83044_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h83045_device : public h83048_device { public: - h83045_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83045_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h83047_device : public h83048_device { public: - h83047_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83047_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type H83044; diff --git a/src/devices/cpu/h8/h83337.cpp b/src/devices/cpu/h8/h83337.cpp index b325fc75496..8f1eeb57451 100644 --- a/src/devices/cpu/h8/h83337.cpp +++ b/src/devices/cpu/h8/h83337.cpp @@ -8,7 +8,7 @@ const device_type H83336 = &device_creator; const device_type H83337 = &device_creator; -h83337_device::h83337_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) : +h83337_device::h83337_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) : h8_device(mconfig, type, name, tag, owner, clock, shortname, source, true, address_map_delegate(FUNC(h83337_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -33,7 +33,7 @@ h83337_device::h83337_device(const machine_config &mconfig, device_type type, co ram_start = 0; } -h83337_device::h83337_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83337_device::h83337_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_device(mconfig, H83337, "H8/3337", tag, owner, clock, "h83337", __FILE__, true, address_map_delegate(FUNC(h83337_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -58,13 +58,13 @@ h83337_device::h83337_device(const machine_config &mconfig, const char *tag, dev ram_start = 0xf780; } -h83334_device::h83334_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83334_device::h83334_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h83337_device(mconfig, H83334, "H8/3334", tag, owner, clock, "h83334", __FILE__) { ram_start = 0xfb80; } -h83336_device::h83336_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h83336_device::h83336_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h83337_device(mconfig, H83336, "H8/3336", tag, owner, clock, "h83336", __FILE__) { ram_start = 0xf780; @@ -185,9 +185,9 @@ void h83337_device::interrupt_taken() standard_irq_callback(intc->interrupt_taken(taken_irq_vector)); } -void h83337_device::internal_update(UINT64 current_time) +void h83337_device::internal_update(uint64_t current_time) { - UINT64 event_time = 0; + uint64_t event_time = 0; add_event(event_time, adc->internal_update(current_time)); add_event(event_time, sci0->internal_update(current_time)); diff --git a/src/devices/cpu/h8/h83337.h b/src/devices/cpu/h8/h83337.h index 9862ca00347..f5a66409335 100644 --- a/src/devices/cpu/h8/h83337.h +++ b/src/devices/cpu/h8/h83337.h @@ -32,8 +32,8 @@ class h83337_device : public h8_device { public: - h83337_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); - h83337_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83337_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); + h83337_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(wscr_r); DECLARE_WRITE8_MEMBER(wscr_w); @@ -64,13 +64,13 @@ protected: required_device sci1; required_device watchdog; - UINT8 syscr; - UINT32 ram_start; + uint8_t syscr; + uint32_t ram_start; virtual void update_irq_filter() override; virtual void interrupt_taken() override; virtual void irq_setup() override; - virtual void internal_update(UINT64 current_time) override; + virtual void internal_update(uint64_t current_time) override; virtual machine_config_constructor device_mconfig_additions() const override; DECLARE_ADDRESS_MAP(map, 16); @@ -81,12 +81,12 @@ protected: class h83334_device : public h83337_device { public: - h83334_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83334_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h83336_device : public h83337_device { public: - h83336_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h83336_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type H83334; diff --git a/src/devices/cpu/h8/h8_adc.cpp b/src/devices/cpu/h8/h8_adc.cpp index 809e4d101d5..7a153253e10 100644 --- a/src/devices/cpu/h8/h8_adc.cpp +++ b/src/devices/cpu/h8/h8_adc.cpp @@ -15,7 +15,7 @@ const device_type H8_ADC_2320 = &device_creator; const device_type H8_ADC_2357 = &device_creator; const device_type H8_ADC_2655 = &device_creator; -h8_adc_device::h8_adc_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) : +h8_adc_device::h8_adc_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), cpu(*this, DEVICE_SELF_OWNER), intc(nullptr), io(nullptr), intc_tag(nullptr), intc_vector(0), adcsr(0), adcr(0), register_mask(0), trigger(0), start_mode(0), start_channel(0), end_channel(0), start_count(0), mode(0), channel(0), count(0), analog_powered(false), adtrg(false), next_event(0) @@ -57,7 +57,7 @@ READ8_MEMBER(h8_adc_device::adcr_r) WRITE8_MEMBER(h8_adc_device::adcsr_w) { if(V>=1) logerror("adcsr_w %02x\n", data); - UINT8 prev = adcsr; + uint8_t prev = adcsr; adcsr = (data & 0x7f) | (adcsr & data & F_ADF); mode_update(); if((prev & F_ADF) && !(adcsr & F_ADF)) { @@ -146,7 +146,7 @@ void h8_adc_device::done() analog_powered = false; } -UINT64 h8_adc_device::internal_update(UINT64 current_time) +uint64_t h8_adc_device::internal_update(uint64_t current_time) { if(next_event && next_event <= current_time) { next_event = 0; @@ -155,7 +155,7 @@ UINT64 h8_adc_device::internal_update(UINT64 current_time) return next_event; } -void h8_adc_device::conversion_wait(bool first, bool poweron, UINT64 current_time) +void h8_adc_device::conversion_wait(bool first, bool poweron, uint64_t current_time) { if(current_time) next_event = current_time + conversion_time(first, poweron); @@ -199,7 +199,7 @@ void h8_adc_device::start_conversion() analog_powered = true; } -void h8_adc_device::timeout(UINT64 current_time) +void h8_adc_device::timeout(uint64_t current_time) { if(mode & BUFFER) { do_buffering((mode & DUAL) && (channel & 1)); @@ -271,7 +271,7 @@ int h8_adc_device::get_channel_index(int count) } -h8_adc_3337_device::h8_adc_3337_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_adc_3337_device::h8_adc_3337_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_adc_device(mconfig, H8_ADC_3337, "H8 ADC 3337", tag, owner, clock, "h8_adc_3337", __FILE__) { register_mask = 3; @@ -302,7 +302,7 @@ void h8_adc_3337_device::mode_update() } -h8_adc_3006_device::h8_adc_3006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_adc_3006_device::h8_adc_3006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_adc_device(mconfig, H8_ADC_3006, "H8 ADC 3006", tag, owner, clock, "h8_adc_3006", __FILE__) { register_mask = 3; @@ -333,7 +333,7 @@ void h8_adc_3006_device::mode_update() } -h8_adc_2245_device::h8_adc_2245_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_adc_2245_device::h8_adc_2245_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_adc_device(mconfig, H8_ADC_2245, "H8 ADC 2245", tag, owner, clock, "h8_adc_2245", __FILE__) { register_mask = 3; @@ -364,7 +364,7 @@ void h8_adc_2245_device::mode_update() } -h8_adc_2320_device::h8_adc_2320_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_adc_2320_device::h8_adc_2320_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_adc_device(mconfig, H8_ADC_2320, "H8 ADC 2320", tag, owner, clock, "h8_adc_2320", __FILE__) { register_mask = 3; @@ -401,7 +401,7 @@ void h8_adc_2320_device::mode_update() } -h8_adc_2357_device::h8_adc_2357_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_adc_2357_device::h8_adc_2357_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_adc_device(mconfig, H8_ADC_2357, "H8 ADC 2357", tag, owner, clock, "h8_adc_2357", __FILE__) { register_mask = 3; @@ -432,7 +432,7 @@ void h8_adc_2357_device::mode_update() } -h8_adc_2655_device::h8_adc_2655_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_adc_2655_device::h8_adc_2655_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_adc_device(mconfig, H8_ADC_2655, "H8 ADC 2655", tag, owner, clock, "h8_adc_2655", __FILE__) { suspend_on_interrupt = true; diff --git a/src/devices/cpu/h8/h8_adc.h b/src/devices/cpu/h8/h8_adc.h index 02e670ba144..ad87432517f 100644 --- a/src/devices/cpu/h8/h8_adc.h +++ b/src/devices/cpu/h8/h8_adc.h @@ -39,7 +39,7 @@ class h8_adc_device : public device_t { public: - h8_adc_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); + h8_adc_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); void set_info(const char *intc_tag, int vect); @@ -52,7 +52,7 @@ public: DECLARE_WRITE_LINE_MEMBER(adtrg_w); void set_suspend(bool suspend); - UINT64 internal_update(UINT64 current_time); + uint64_t internal_update(uint64_t current_time); protected: required_device cpu; @@ -85,24 +85,24 @@ protected: COUNTED = 64 }; - UINT16 addr[8], buf[2]; - UINT8 adcsr, adcr; + uint16_t addr[8], buf[2]; + uint8_t adcsr, adcr; int register_mask; int trigger, start_mode, start_channel, end_channel, start_count; bool suspend_on_interrupt, analog_power_control; int mode, channel, count; bool analog_powered, adtrg; - UINT64 next_event; + uint64_t next_event; virtual void device_start() override; virtual void device_reset() override; void sampling(); void start_conversion(); - void conversion_wait(bool first, bool poweron, UINT64 current_time = 0); + void conversion_wait(bool first, bool poweron, uint64_t current_time = 0); void buffer_value(int port, int buffer = 0); void commit_value(int reg, int buffer = 0); - void timeout(UINT64 current_time); + void timeout(uint64_t current_time); void done(); virtual int conversion_time(bool first, bool poweron) = 0; @@ -113,7 +113,7 @@ protected: class h8_adc_3337_device : public h8_adc_device { public: - h8_adc_3337_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_adc_3337_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int conversion_time(bool first, bool poweron) override; @@ -122,7 +122,7 @@ protected: class h8_adc_3006_device : public h8_adc_device { public: - h8_adc_3006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_adc_3006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int conversion_time(bool first, bool poweron) override; @@ -131,7 +131,7 @@ protected: class h8_adc_2245_device : public h8_adc_device { public: - h8_adc_2245_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_adc_2245_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int conversion_time(bool first, bool poweron) override; @@ -140,7 +140,7 @@ protected: class h8_adc_2320_device : public h8_adc_device { public: - h8_adc_2320_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_adc_2320_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int conversion_time(bool first, bool poweron) override; @@ -149,7 +149,7 @@ protected: class h8_adc_2357_device : public h8_adc_device { public: - h8_adc_2357_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_adc_2357_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int conversion_time(bool first, bool poweron) override; @@ -158,7 +158,7 @@ protected: class h8_adc_2655_device : public h8_adc_device { public: - h8_adc_2655_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_adc_2655_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int conversion_time(bool first, bool poweron) override; diff --git a/src/devices/cpu/h8/h8_dma.cpp b/src/devices/cpu/h8/h8_dma.cpp index fb907ffcef1..e3ce2ccc939 100644 --- a/src/devices/cpu/h8/h8_dma.cpp +++ b/src/devices/cpu/h8/h8_dma.cpp @@ -4,7 +4,7 @@ const device_type H8_DMA = &device_creator; const device_type H8_DMA_CHANNEL = &device_creator; -h8_dma_device::h8_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_dma_device::h8_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_DMA, "H8 DMA controller", tag, owner, clock, "h8_dma", __FILE__), dmach0(*this, "0"), dmach1(*this, "1") @@ -85,7 +85,7 @@ WRITE16_MEMBER(h8_dma_device::dmabcr_w) -h8_dma_channel_device::h8_dma_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_dma_channel_device::h8_dma_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_DMA_CHANNEL, "H8 DMA channel", tag, owner, clock, "h8_dma_channel", __FILE__), dmac(*this, "^"), cpu(*this, "^^") @@ -247,7 +247,7 @@ WRITE16_MEMBER(h8_dma_channel_device::dmacr_w) start_test(-1); } -void h8_dma_channel_device::set_bcr(bool _fae, bool _sae, UINT8 _dta, UINT8 _dte, UINT8 _dtie) +void h8_dma_channel_device::set_bcr(bool _fae, bool _sae, uint8_t _dta, uint8_t _dte, uint8_t _dtie) { fae = _fae; sae = _sae; @@ -291,7 +291,7 @@ void h8_dma_channel_device::start(int submodule) state[submodule].dest = mar[1]; state[submodule].count = etcr[0] ? etcr[0] : 0x10000; state[submodule].mode_16 = dmacr & 0x8000; - INT32 step = state[submodule].mode_16 ? 2 : 1; + int32_t step = state[submodule].mode_16 ? 2 : 1; state[submodule].incs = dmacr & 0x2000 ? dmacr & 0x4000 ? -step : step : 0; state[submodule].incd = dmacr & 0x0020 ? dmacr & 0x0040 ? -step : step : 0; cpu->set_current_dma(state + submodule); diff --git a/src/devices/cpu/h8/h8_dma.h b/src/devices/cpu/h8/h8_dma.h index c561f15aea8..7ffd415b2de 100644 --- a/src/devices/cpu/h8/h8_dma.h +++ b/src/devices/cpu/h8/h8_dma.h @@ -15,9 +15,9 @@ #include "h8_intc.h" struct h8_dma_state { - UINT32 source, dest; - INT32 incs, incd; - UINT32 count; + uint32_t source, dest; + int32_t incs, incd; + uint32_t count; int id; bool mode_16; }; @@ -33,7 +33,7 @@ class h8_dma_channel_device; class h8_dma_device : public device_t { public: - h8_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(dmawer_r); DECLARE_WRITE8_MEMBER(dmawer_w); @@ -52,8 +52,8 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT8 dmawer, dmatcr; - UINT16 dmabcr; + uint8_t dmawer, dmatcr; + uint16_t dmabcr; }; class h8_dma_channel_device : public device_t { @@ -73,7 +73,7 @@ public: MODE16_MEM_DACK }; - h8_dma_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_dma_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_info(const char *intc, int irq_base, int v0, int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8, int v9, int va, int vb, int vc, int vd, int ve, int vf); @@ -97,7 +97,7 @@ public: DECLARE_WRITE16_MEMBER(dmacr_w); void set_id(int id); - void set_bcr(bool fae, bool sae, UINT8 dta, UINT8 dte, UINT8 dtie); + void set_bcr(bool fae, bool sae, uint8_t dta, uint8_t dte, uint8_t dtie); bool start_test(int vector); void count_done(int submodule); protected: @@ -110,9 +110,9 @@ protected: int activation_vectors[16]; - UINT32 mar[2]; - UINT16 ioar[2], etcr[2], dmacr; - UINT8 dta, dte, dtie; + uint32_t mar[2]; + uint16_t ioar[2], etcr[2], dmacr; + uint8_t dta, dte, dtie; bool fae, sae; virtual void device_start() override; diff --git a/src/devices/cpu/h8/h8_dtc.cpp b/src/devices/cpu/h8/h8_dtc.cpp index 2482b4b034c..117740cdd4b 100644 --- a/src/devices/cpu/h8/h8_dtc.cpp +++ b/src/devices/cpu/h8/h8_dtc.cpp @@ -24,7 +24,7 @@ const int h8_dtc_device::vector_to_enable[92] = { -1, 40, 41, -1 // ERI2, RXI2, TXI2, TEI2 }; -h8_dtc_device::h8_dtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_dtc_device::h8_dtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_DTC, "H8 DTC controller", tag, owner, clock, "h8_dtc", __FILE__), cpu(*this, DEVICE_SELF_OWNER) { @@ -45,7 +45,7 @@ void h8_dtc_device::device_reset() { memset(dtcer, 0x00, sizeof(dtcer)); memset(states, 0, sizeof(states)); - for(UINT8 i=0; isra; - UINT32 dar = state->dar; - UINT32 cr = state->cr; + uint32_t sra = state->sra; + uint32_t dar = state->dar; + uint32_t cr = state->cr; - UINT32 mode = sra & 0x0c000000; + uint32_t mode = sra & 0x0c000000; if(V>=1) logerror("regs at %08x sra=%08x dar=%08x cr=%08x %s mode\n", state->base, sra, dar, cr, mode == 0x00000000 || mode == 0x0c000000 ? "normal" : mode == 0x04000000 ? "repeat" : "block"); state->incs = sra & 0x80000000 ? diff --git a/src/devices/cpu/h8/h8_dtc.h b/src/devices/cpu/h8/h8_dtc.h index cdccf42758a..d74f0ef3252 100644 --- a/src/devices/cpu/h8/h8_dtc.h +++ b/src/devices/cpu/h8/h8_dtc.h @@ -20,9 +20,9 @@ downcast(device)->set_info(intc, irq); struct h8_dtc_state { - UINT32 base, sra, dar, cr; - INT32 incs, incd; - UINT32 count; + uint32_t base, sra, dar, cr; + int32_t incs, incd; + uint32_t count; int id; int next; }; @@ -31,7 +31,7 @@ class h8_dtc_device : public device_t { public: enum { DTC_CHAINED = 1000 }; - h8_dtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_dtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_info(const char *intc, int irq); DECLARE_READ8_MEMBER(dtcer_r); @@ -43,7 +43,7 @@ public: void count_done(int id); inline h8_dtc_state *get_object(int vector) { return states + vector; } - inline UINT32 get_vector_address(int vector) { return 0x400 | ((vector ? vector : dtvecr & 0x7f) << 1); } + inline uint32_t get_vector_address(int vector) { return 0x400 | ((vector ? vector : dtvecr & 0x7f) << 1); } int get_waiting_vector(); int get_waiting_writeback(); void vector_done(int vector); @@ -60,7 +60,7 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT8 dtcer[6], dtvecr; + uint8_t dtcer[6], dtvecr; int cur_active_vector; std::list waiting_vector, waiting_writeback; diff --git a/src/devices/cpu/h8/h8_intc.cpp b/src/devices/cpu/h8/h8_intc.cpp index ad41b2cc2cd..d81d53ccfe7 100644 --- a/src/devices/cpu/h8/h8_intc.cpp +++ b/src/devices/cpu/h8/h8_intc.cpp @@ -7,7 +7,7 @@ const device_type H8_INTC = &device_creator; const device_type H8H_INTC = &device_creator; const device_type H8S_INTC = &device_creator; -h8_intc_device::h8_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_intc_device::h8_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_INTC, "H8 INTC", tag, owner, clock, "h8_intc", __FILE__), cpu(*this, DEVICE_SELF_OWNER), nmi_input(false), irq_input(0), ier(0), isr(0), iscr(0), icr_filter(0), ipr_filter(0) { @@ -15,7 +15,7 @@ h8_intc_device::h8_intc_device(const machine_config &mconfig, const char *tag, d irq_vector_nmi = 3; } -h8_intc_device::h8_intc_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) : +h8_intc_device::h8_intc_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_vector_base(0), irq_vector_nmi(0), cpu(*this, DEVICE_SELF_OWNER), nmi_input(false), irq_input(0), ier(0), isr(0), iscr(0), icr_filter(0), ipr_filter(0) { @@ -193,14 +193,14 @@ void h8_intc_device::get_priority(int vect, int &icr_pri, int &ipr_pri) const } -h8h_intc_device::h8h_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8h_intc_device::h8h_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_intc_device(mconfig, H8H_INTC, "H8H INTC", tag, owner, clock, "h8h_intc", __FILE__) { irq_vector_base = 12; irq_vector_nmi = 7; } -h8h_intc_device::h8h_intc_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) : +h8h_intc_device::h8h_intc_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) : h8_intc_device(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -319,7 +319,7 @@ void h8h_intc_device::get_priority(int vect, int &icr_pri, int &ipr_pri) const icr_pri = (icr >> (slot ^ 7)) & 1; } -h8s_intc_device::h8s_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s_intc_device::h8s_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8h_intc_device(mconfig, H8S_INTC, "H8S INTC", tag, owner, clock, "h8s_intc", __FILE__) { irq_vector_base = 16; diff --git a/src/devices/cpu/h8/h8_intc.h b/src/devices/cpu/h8/h8_intc.h index b6a6da31af7..4b4b384b8b1 100644 --- a/src/devices/cpu/h8/h8_intc.h +++ b/src/devices/cpu/h8/h8_intc.h @@ -26,8 +26,8 @@ class h8_intc_device : public device_t { public: - h8_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - h8_intc_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); + h8_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + h8_intc_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); int interrupt_taken(int vector); void internal_interrupt(int vector); @@ -48,13 +48,13 @@ protected: required_device cpu; - UINT32 pending_irqs[MAX_VECTORS/32]; + uint32_t pending_irqs[MAX_VECTORS/32]; int irq_type[8]; bool nmi_input; - UINT8 irq_input; - UINT8 ier; - UINT8 isr; - UINT16 iscr; + uint8_t irq_input; + uint8_t ier; + uint8_t isr; + uint16_t iscr; int icr_filter, ipr_filter; virtual void device_start() override; @@ -68,8 +68,8 @@ protected: class h8h_intc_device : public h8_intc_device { public: - h8h_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - h8h_intc_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); + h8h_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + h8h_intc_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); DECLARE_READ8_MEMBER(isr_r); DECLARE_WRITE8_MEMBER(isr_w); @@ -85,7 +85,7 @@ public: protected: static const int vector_to_slot[]; - UINT32 icr; + uint32_t icr; virtual void device_start() override; virtual void device_reset() override; @@ -96,7 +96,7 @@ protected: class h8s_intc_device : public h8h_intc_device { public: - h8s_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(ipr_r); DECLARE_WRITE8_MEMBER(ipr_w); @@ -104,7 +104,7 @@ public: DECLARE_WRITE8_MEMBER(iprk_w); private: static const int vector_to_slot[]; - UINT8 ipr[11]; + uint8_t ipr[11]; virtual void get_priority(int vect, int &icr_pri, int &ipr_pri) const override; virtual void device_reset() override; diff --git a/src/devices/cpu/h8/h8_port.cpp b/src/devices/cpu/h8/h8_port.cpp index c610f0bde29..e319748d01a 100644 --- a/src/devices/cpu/h8/h8_port.cpp +++ b/src/devices/cpu/h8/h8_port.cpp @@ -5,13 +5,13 @@ const device_type H8_PORT = &device_creator; -h8_port_device::h8_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_port_device::h8_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_PORT, "H8 digital port", tag, owner, clock, "h8_digital_port", __FILE__), cpu(*this, DEVICE_SELF_OWNER), io(nullptr), address(0), default_ddr(0), ddr(0), pcr(0), odr(0), mask(0), dr(0), last_output(0) { } -void h8_port_device::set_info(int _address, UINT8 _default_ddr, UINT8 _mask) +void h8_port_device::set_info(int _address, uint8_t _default_ddr, uint8_t _mask) { address = 2*_address; default_ddr = _default_ddr; @@ -40,11 +40,11 @@ READ8_MEMBER(h8_port_device::dr_r) READ8_MEMBER(h8_port_device::port_r) { - UINT8 res = mask | (dr & ddr); - if((ddr & ~mask) != UINT8(~mask)) + uint8_t res = mask | (dr & ddr); + if((ddr & ~mask) != uint8_t(~mask)) res |= io->read_word(address) & ~ddr; - // logerror("port_r %02x (%02x %02x)\n", res, ddr & ~mask, UINT8(~mask)); + // logerror("port_r %02x (%02x %02x)\n", res, ddr & ~mask, uint8_t(~mask)); return res; } @@ -74,7 +74,7 @@ READ8_MEMBER(h8_port_device::odr_r) void h8_port_device::update_output() { - UINT8 res = dr & ddr & ~mask; + uint8_t res = dr & ddr & ~mask; if(res != last_output) { last_output = res; io->write_word(address, res); diff --git a/src/devices/cpu/h8/h8_port.h b/src/devices/cpu/h8/h8_port.h index 3b1230f9d17..c6b7e8e2095 100644 --- a/src/devices/cpu/h8/h8_port.h +++ b/src/devices/cpu/h8/h8_port.h @@ -20,9 +20,9 @@ class h8_port_device : public device_t { public: - h8_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_info(int address, UINT8 default_ddr, UINT8 mask); + void set_info(int address, uint8_t default_ddr, uint8_t mask); DECLARE_WRITE8_MEMBER(ddr_w); DECLARE_WRITE8_MEMBER(dr_w); @@ -38,10 +38,10 @@ protected: address_space *io; int address; - UINT8 default_ddr, ddr, pcr, odr; - UINT8 mask; - UINT8 dr; - UINT8 last_output; + uint8_t default_ddr, ddr, pcr, odr; + uint8_t mask; + uint8_t dr; + uint8_t last_output; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/cpu/h8/h8_sci.cpp b/src/devices/cpu/h8/h8_sci.cpp index 976e7546a9a..7a426ad65ec 100644 --- a/src/devices/cpu/h8/h8_sci.cpp +++ b/src/devices/cpu/h8/h8_sci.cpp @@ -15,7 +15,7 @@ const device_type H8_SCI = &device_creator; const char *const h8_sci_device::state_names[] = { "idle", "start", "bit", "parity", "stop", "last-tick" }; -h8_sci_device::h8_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_sci_device::h8_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_SCI, "H8 Serial Communications Interface", tag, owner, clock, "h8_sci", __FILE__), cpu(*this, DEVICE_SELF_OWNER), tx_cb(*this), @@ -95,7 +95,7 @@ WRITE8_MEMBER(h8_sci_device::scr_w) data & SCR_CKE, cpu->pc()); - UINT8 delta = scr ^ data; + uint8_t delta = scr ^ data; scr = data; clock_update(); @@ -356,15 +356,15 @@ WRITE_LINE_MEMBER(h8_sci_device::clk_w) } } -UINT64 h8_sci_device::internal_update(UINT64 current_time) +uint64_t h8_sci_device::internal_update(uint64_t current_time) { - UINT64 event = 0; + uint64_t event = 0; switch(clock_mode) { case CLKM_INTERNAL_SYNC_OUT: if(clock_state || !clock_value) { - UINT64 fp = divider*2; + uint64_t fp = divider*2; if(current_time >= clock_base) { - UINT64 delta = current_time - clock_base; + uint64_t delta = current_time - clock_base; if(delta >= fp) { delta -= fp; clock_base += fp; @@ -392,9 +392,9 @@ UINT64 h8_sci_device::internal_update(UINT64 current_time) case CLKM_INTERNAL_ASYNC: case CLKM_INTERNAL_ASYNC_OUT: if(clock_state || !clock_value) { - UINT64 fp = divider*16; + uint64_t fp = divider*16; if(current_time >= clock_base) { - UINT64 delta = current_time - clock_base; + uint64_t delta = current_time - clock_base; if(delta >= fp) { delta -= fp; clock_base += fp; @@ -421,9 +421,9 @@ UINT64 h8_sci_device::internal_update(UINT64 current_time) case CLKM_EXTERNAL_RATE_SYNC: if(clock_state || !clock_value) { - UINT64 ctime = UINT64(current_time*internal_to_external_ratio*2); + uint64_t ctime = uint64_t(current_time*internal_to_external_ratio*2); if(ctime >= clock_base) { - UINT64 delta = ctime - clock_base; + uint64_t delta = ctime - clock_base; clock_base += delta & ~1; delta &= 1; bool new_clock = delta >= 1; @@ -439,15 +439,15 @@ UINT64 h8_sci_device::internal_update(UINT64 current_time) } } - event = UINT64((clock_base + (clock_value ? 2 : 1))*external_to_internal_ratio)+1; + event = uint64_t((clock_base + (clock_value ? 2 : 1))*external_to_internal_ratio)+1; } break; case CLKM_EXTERNAL_RATE_ASYNC: if(clock_state || !clock_value) { - UINT64 ctime = UINT64(current_time*internal_to_external_ratio); + uint64_t ctime = uint64_t(current_time*internal_to_external_ratio); if(ctime >= clock_base) { - UINT64 delta = ctime - clock_base; + uint64_t delta = ctime - clock_base; clock_base += delta & ~15; delta &= 15; bool new_clock = delta >= 8; @@ -463,7 +463,7 @@ UINT64 h8_sci_device::internal_update(UINT64 current_time) } } - event = UINT64((clock_base + (clock_value ? 16 : 8))*external_to_internal_ratio)+1; + event = uint64_t((clock_base + (clock_value ? 16 : 8))*external_to_internal_ratio)+1; } break; @@ -503,13 +503,13 @@ void h8_sci_device::clock_start(int mode) case CLKM_EXTERNAL_RATE_ASYNC: if(V>=2) logerror("Simulating external clock async\n"); - clock_base = UINT64(cpu->total_cycles()*internal_to_external_ratio); + clock_base = uint64_t(cpu->total_cycles()*internal_to_external_ratio); cpu->internal_update(); break; case CLKM_EXTERNAL_RATE_SYNC: if(V>=2) logerror("Simulating external clock sync\n"); - clock_base = UINT64(cpu->total_cycles()*2*internal_to_external_ratio); + clock_base = uint64_t(cpu->total_cycles()*2*internal_to_external_ratio); cpu->internal_update(); break; diff --git a/src/devices/cpu/h8/h8_sci.h b/src/devices/cpu/h8/h8_sci.h index 285360afea1..1c3a79b0f39 100644 --- a/src/devices/cpu/h8/h8_sci.h +++ b/src/devices/cpu/h8/h8_sci.h @@ -30,7 +30,7 @@ class h8_sci_device : public device_t { public: - h8_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_info(const char *intc, int eri, int rxi, int txi, int tei); void set_external_clock_period(const attotime &_period); @@ -55,7 +55,7 @@ public: template static devcb_base &set_tx_cb(device_t &device, _Object object) { return downcast(device).tx_cb.set_callback(object); } template static devcb_base &set_clk_cb(device_t &device, _Object object) { return downcast(device).clk_cb.set_callback(object); } - UINT64 internal_update(UINT64 current_time); + uint64_t internal_update(uint64_t current_time); protected: enum { @@ -121,8 +121,8 @@ protected: int tx_state, rx_state, tx_bit, rx_bit, clock_state, clock_mode, tx_parity, rx_parity, ext_clock_counter; bool clock_value, ext_clock_value, rx_value; - UINT8 rdr, tdr, smr, scr, ssr, brr, rsr, tsr; - UINT64 clock_base, divider; + uint8_t rdr, tdr, smr, scr, ssr, brr, rsr, tsr; + uint64_t clock_base, divider; std::string last_clock_message; diff --git a/src/devices/cpu/h8/h8_timer16.cpp b/src/devices/cpu/h8/h8_timer16.cpp index 796a26c0fef..2beb6d86c61 100644 --- a/src/devices/cpu/h8/h8_timer16.cpp +++ b/src/devices/cpu/h8/h8_timer16.cpp @@ -13,7 +13,7 @@ const device_type H8_TIMER16_CHANNEL = &device_creator; const device_type H8S_TIMER16_CHANNEL = &device_creator; -h8_timer16_channel_device::h8_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_timer16_channel_device::h8_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_TIMER16_CHANNEL, "H8 16-bits timer channel", tag, owner, clock, "h8_16bits_timer_channel", __FILE__), cpu(*this, "^^"), chained_timer(nullptr), intc(nullptr), intc_tag(nullptr), tier_mask(0), tgr_count(0), tbr_count(0), tgr_clearing(0), tcr(0), tier(0), ier(0), isr(0), clock_type(0), clock_divider(0), tcnt(0), last_clock_update(0), event_time(0), phase(0), counter_cycle(0), counter_incrementing(false), channel_active(false) @@ -21,7 +21,7 @@ h8_timer16_channel_device::h8_timer16_channel_device(const machine_config &mconf chain_tag = nullptr; } -h8_timer16_channel_device::h8_timer16_channel_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) : +h8_timer16_channel_device::h8_timer16_channel_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), cpu(*this, "^^"), chained_timer(nullptr), intc(nullptr), intc_tag(nullptr), tier_mask(0), tgr_count(0), tbr_count(0), tgr_clearing(0), tcr(0), tier(0), ier(0), isr(0), clock_type(0), clock_divider(0), tcnt(0), last_clock_update(0), event_time(0), phase(0), counter_cycle(0), counter_incrementing(false), channel_active(false) @@ -77,7 +77,7 @@ WRITE8_MEMBER(h8_timer16_channel_device::tior_w) if(V>=1) logerror("tior_w %d, %02x\n", offset, data); } -void h8_timer16_channel_device::set_ier(UINT8 value) +void h8_timer16_channel_device::set_ier(uint8_t value) { update_counter(); ier = value; @@ -204,7 +204,7 @@ void h8_timer16_channel_device::device_reset() counter_incrementing = true; } -UINT64 h8_timer16_channel_device::internal_update(UINT64 current_time) +uint64_t h8_timer16_channel_device::internal_update(uint64_t current_time) { if(event_time && current_time >= event_time) { update_counter(current_time); @@ -214,7 +214,7 @@ UINT64 h8_timer16_channel_device::internal_update(UINT64 current_time) return event_time; } -void h8_timer16_channel_device::update_counter(UINT64 cur_time) +void h8_timer16_channel_device::update_counter(uint64_t cur_time) { if(clock_type != DIV_1) return; @@ -227,8 +227,8 @@ void h8_timer16_channel_device::update_counter(UINT64 cur_time) return; } - UINT64 base_time = last_clock_update; - UINT64 new_time = cur_time; + uint64_t base_time = last_clock_update; + uint64_t new_time = cur_time; if(clock_divider) { base_time = (base_time + phase) >> clock_divider; new_time = (new_time + phase) >> clock_divider; @@ -251,7 +251,7 @@ void h8_timer16_channel_device::update_counter(UINT64 cur_time) last_clock_update = cur_time; } -void h8_timer16_channel_device::recalc_event(UINT64 cur_time) +void h8_timer16_channel_device::recalc_event(uint64_t cur_time) { if(!channel_active) { event_time = 0; @@ -259,7 +259,7 @@ void h8_timer16_channel_device::recalc_event(UINT64 cur_time) } bool update_cpu = cur_time == 0; - UINT64 old_event_time = event_time; + uint64_t old_event_time = event_time; if(clock_type != DIV_1) { event_time = 0; @@ -273,7 +273,7 @@ void h8_timer16_channel_device::recalc_event(UINT64 cur_time) cur_time = cpu->total_cycles(); if(counter_incrementing) { - UINT32 event_delay = 0xffffffff; + uint32_t event_delay = 0xffffffff; if(tgr_clearing >= 0 && tgr[tgr_clearing]) counter_cycle = tgr[tgr_clearing]; else { @@ -286,7 +286,7 @@ void h8_timer16_channel_device::recalc_event(UINT64 cur_time) } for(int i=0; i tcnt) { if(tcnt >= counter_cycle || tgr[i] <= counter_cycle) new_delay = tgr[i] - tcnt; @@ -315,13 +315,13 @@ void h8_timer16_channel_device::recalc_event(UINT64 cur_time) cpu->internal_update(); } -h8_timer16_device::h8_timer16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_timer16_device::h8_timer16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_TIMER16, "H8 16-bits timer", tag, owner, clock, "h8_timer16", __FILE__), cpu(*this, DEVICE_SELF_OWNER) { } -void h8_timer16_device::set_info(int count, UINT8 tstr) +void h8_timer16_device::set_info(int count, uint8_t tstr) { timer_count = count; default_tstr = tstr; @@ -412,7 +412,7 @@ WRITE8_MEMBER(h8_timer16_device::tocr_w) READ8_MEMBER(h8_timer16_device::tisr_r) { - UINT8 r = 0; + uint8_t r = 0; for(int i=0; itisr_r(offset) << i; for(int i=timer_count; i<4; i++) @@ -451,11 +451,11 @@ void h8_timer16_channel_device::tier_update() { } -void h8_timer16_channel_device::isr_update(UINT8 val) +void h8_timer16_channel_device::isr_update(uint8_t val) { } -UINT8 h8_timer16_channel_device::isr_to_sr() const +uint8_t h8_timer16_channel_device::isr_to_sr() const { return 0x00; } @@ -464,7 +464,7 @@ void h8_timer16_channel_device::tcr_update() { } -void h8_timer16_channel_device::tisr_w(int offset, UINT8 value) +void h8_timer16_channel_device::tisr_w(int offset, uint8_t value) { update_counter(); if(!(value & 0x01)) { @@ -508,7 +508,7 @@ void h8_timer16_channel_device::tisr_w(int offset, UINT8 value) recalc_event(); } -UINT8 h8_timer16_channel_device::tisr_r(int offset) const +uint8_t h8_timer16_channel_device::tisr_r(int offset) const { switch(offset) { case 0: @@ -521,7 +521,7 @@ UINT8 h8_timer16_channel_device::tisr_r(int offset) const return 0x00; } -h8h_timer16_channel_device::h8h_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8h_timer16_channel_device::h8h_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_timer16_channel_device(mconfig, H8H_TIMER16_CHANNEL, "H8H 16-bits timer channel", tag, owner, clock, "h8h_16bits_timer_channel", __FILE__) { } @@ -553,7 +553,7 @@ void h8h_timer16_channel_device::tier_update() (tier & 0x04 ? IRQ_V : 0); } -void h8h_timer16_channel_device::isr_update(UINT8 val) +void h8h_timer16_channel_device::isr_update(uint8_t val) { if(!(val & 1)) isr &= ~IRQ_A; @@ -563,7 +563,7 @@ void h8h_timer16_channel_device::isr_update(UINT8 val) isr &= ~IRQ_V; } -UINT8 h8h_timer16_channel_device::isr_to_sr() const +uint8_t h8h_timer16_channel_device::isr_to_sr() const { return 0xf8 | (isr & IRQ_V ? 4 : 0) | (isr & IRQ_B ? 2 : 0) | (isr & IRQ_A ? 1 : 0); } @@ -619,7 +619,7 @@ void h8h_timer16_channel_device::tcr_update() } } -h8s_timer16_channel_device::h8s_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s_timer16_channel_device::h8s_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_timer16_channel_device(mconfig, H8S_TIMER16_CHANNEL, "H8S 16-bits timer channel", tag, owner, clock, "h8s_16bits_timer_channel", __FILE__) { } @@ -633,7 +633,7 @@ void h8s_timer16_channel_device::set_chain(const char *_chain_tag) chain_tag = _chain_tag; } -void h8s_timer16_channel_device::set_info(int _tgr_count, UINT8 _tier_mask, const char *intc, int irq_base, +void h8s_timer16_channel_device::set_info(int _tgr_count, uint8_t _tier_mask, const char *intc, int irq_base, int t0, int t1, int t2, int t3, int t4, int t5, int t6, int t7) { tgr_count = _tgr_count; @@ -671,12 +671,12 @@ void h8s_timer16_channel_device::tier_update() (tier & 0x80 ? IRQ_TRIG : 0); } -void h8s_timer16_channel_device::isr_update(UINT8 val) +void h8s_timer16_channel_device::isr_update(uint8_t val) { isr &= (val | tier_mask | 0xc0); } -UINT8 h8s_timer16_channel_device::isr_to_sr() const +uint8_t h8s_timer16_channel_device::isr_to_sr() const { return 0xc0 | isr; } diff --git a/src/devices/cpu/h8/h8_timer16.h b/src/devices/cpu/h8/h8_timer16.h index f8f6c1efda2..6a0973da0d5 100644 --- a/src/devices/cpu/h8/h8_timer16.h +++ b/src/devices/cpu/h8/h8_timer16.h @@ -73,8 +73,8 @@ public: }; - h8_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - h8_timer16_channel_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); + h8_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + h8_timer16_channel_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); void set_info(int tgr_count, int tbr_count, const char *intc, int irq_base); @@ -95,11 +95,11 @@ public: DECLARE_READ16_MEMBER(tbr_r); DECLARE_WRITE16_MEMBER(tbr_w); - UINT64 internal_update(UINT64 current_time); - void set_ier(UINT8 value); + uint64_t internal_update(uint64_t current_time); + void set_ier(uint8_t value); void set_enable(bool enable); - void tisr_w(int offset, UINT8 data); - UINT8 tisr_r(int offset) const; + void tisr_w(int offset, uint8_t data); + uint8_t tisr_r(int offset) const; protected: required_device cpu; @@ -107,32 +107,32 @@ protected: h8_intc_device *intc; const char *chain_tag, *intc_tag; int interrupt[6]; - UINT8 tier_mask; + uint8_t tier_mask; int tgr_count, tbr_count; int tgr_clearing; - UINT8 tcr, tier, ier, isr; + uint8_t tcr, tier, ier, isr; int clock_type, clock_divider; - UINT16 tcnt, tgr[6]; - UINT64 last_clock_update, event_time; - UINT32 phase, counter_cycle; + uint16_t tcnt, tgr[6]; + uint64_t last_clock_update, event_time; + uint32_t phase, counter_cycle; bool counter_incrementing; bool channel_active; virtual void device_start() override; virtual void device_reset() override; - void update_counter(UINT64 cur_time = 0); - void recalc_event(UINT64 cur_time = 0); + void update_counter(uint64_t cur_time = 0); + void recalc_event(uint64_t cur_time = 0); virtual void tcr_update(); virtual void tier_update(); - virtual void isr_update(UINT8 value); - virtual UINT8 isr_to_sr() const; + virtual void isr_update(uint8_t value); + virtual uint8_t isr_to_sr() const; }; class h8h_timer16_channel_device : public h8_timer16_channel_device { public: - h8h_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8h_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~h8h_timer16_channel_device(); void set_info(int tgr_count, int tbr_count, const char *intc, int irq_base); @@ -140,16 +140,16 @@ public: protected: virtual void tcr_update() override; virtual void tier_update() override; - virtual void isr_update(UINT8 value) override; - virtual UINT8 isr_to_sr() const override; + virtual void isr_update(uint8_t value) override; + virtual uint8_t isr_to_sr() const override; }; class h8s_timer16_channel_device : public h8_timer16_channel_device { public: - h8s_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~h8s_timer16_channel_device(); - void set_info(int tgr_count, UINT8 _tier_mask, const char *intc, int irq_base, + void set_info(int tgr_count, uint8_t _tier_mask, const char *intc, int irq_base, int t0, int t1, int t2, int t3, int t4, int t5, int t6, int t7); void set_chain(const char *chain_tag); @@ -158,15 +158,15 @@ protected: virtual void tcr_update() override; virtual void tier_update() override; - virtual void isr_update(UINT8 value) override; - virtual UINT8 isr_to_sr() const override; + virtual void isr_update(uint8_t value) override; + virtual uint8_t isr_to_sr() const override; }; class h8_timer16_device : public device_t { public: - h8_timer16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_timer16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_info(int timer_count, UINT8 default_tstr); + void set_info(int timer_count, uint8_t default_tstr); DECLARE_READ8_MEMBER(tstr_r); DECLARE_WRITE8_MEMBER(tstr_w); @@ -190,8 +190,8 @@ protected: required_device cpu; h8_timer16_channel_device *timer_channel[6]; int timer_count; - UINT8 default_tstr; - UINT8 tstr; + uint8_t default_tstr; + uint8_t tstr; virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/cpu/h8/h8_timer8.cpp b/src/devices/cpu/h8/h8_timer8.cpp index 671170e1cab..93538817313 100644 --- a/src/devices/cpu/h8/h8_timer8.cpp +++ b/src/devices/cpu/h8/h8_timer8.cpp @@ -12,14 +12,14 @@ const int V = 1; const device_type H8_TIMER8_CHANNEL = &device_creator; const device_type H8H_TIMER8_CHANNEL = &device_creator; -h8_timer8_channel_device::h8_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_timer8_channel_device::h8_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_TIMER8_CHANNEL, "H8 8-bits timer channel", tag, owner, clock, "h8_8bits_timer_channel", __FILE__), cpu(*this, "^"), chained_timer(nullptr), intc(nullptr), chain_tag(nullptr), intc_tag(nullptr), irq_ca(0), irq_cb(0), irq_v(0), chain_type(0), tcr(0), tcsr(0), tcnt(0), extra_clock_bit(false), has_adte(false), has_ice(false), clock_type(0), clock_divider(0), clear_type(0), counter_cycle(0), last_clock_update(0), event_time(0) { } -h8_timer8_channel_device::h8_timer8_channel_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) : +h8_timer8_channel_device::h8_timer8_channel_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), cpu(*this, "^"), chained_timer(nullptr), intc(nullptr), chain_tag(nullptr), intc_tag(nullptr), irq_ca(0), irq_cb(0), irq_v(0), chain_type(0), tcr(0), tcsr(0), tcnt(0), extra_clock_bit(false), has_adte(false), has_ice(false), clock_type(0), clock_divider(0), clear_type(0), counter_cycle(0), last_clock_update(0), event_time(0) @@ -145,7 +145,7 @@ WRITE8_MEMBER(h8_timer8_channel_device::tcsr_w) { update_counter(); - UINT8 mask = has_adte || has_ice ? 0x1f : 0x0f; + uint8_t mask = has_adte || has_ice ? 0x1f : 0x0f; tcsr = (tcsr & ~mask) | (data & mask); tcsr &= data | 0x1f; @@ -207,7 +207,7 @@ void h8_timer8_channel_device::device_reset() extra_clock_bit = false; } -UINT64 h8_timer8_channel_device::internal_update(UINT64 current_time) +uint64_t h8_timer8_channel_device::internal_update(uint64_t current_time) { if(event_time && current_time >= event_time) { update_counter(current_time); @@ -217,7 +217,7 @@ UINT64 h8_timer8_channel_device::internal_update(UINT64 current_time) return event_time; } -void h8_timer8_channel_device::update_counter(UINT64 cur_time) +void h8_timer8_channel_device::update_counter(uint64_t cur_time) { if(clock_type != DIV) return; @@ -225,8 +225,8 @@ void h8_timer8_channel_device::update_counter(UINT64 cur_time) if(!cur_time) cur_time = cpu->total_cycles(); - UINT64 base_time = (last_clock_update + clock_divider/2) / clock_divider; - UINT64 new_time = (cur_time + clock_divider/2) / clock_divider; + uint64_t base_time = (last_clock_update + clock_divider/2) / clock_divider; + uint64_t new_time = (cur_time + clock_divider/2) / clock_divider; int tt = tcnt + new_time - base_time; tcnt = tt % counter_cycle; @@ -260,10 +260,10 @@ void h8_timer8_channel_device::update_counter(UINT64 cur_time) last_clock_update = cur_time; } -void h8_timer8_channel_device::recalc_event(UINT64 cur_time) +void h8_timer8_channel_device::recalc_event(uint64_t cur_time) { bool update_cpu = cur_time == 0; - UINT64 old_event_time = event_time; + uint64_t old_event_time = event_time; if(clock_type != DIV) { event_time = 0; @@ -275,7 +275,7 @@ void h8_timer8_channel_device::recalc_event(UINT64 cur_time) if(!cur_time) cur_time = cpu->total_cycles(); - UINT32 event_delay = 0xffffffff; + uint32_t event_delay = 0xffffffff; if(clear_type == CLEAR_A || clear_type == CLEAR_B) counter_cycle = tcor[clear_type - CLEAR_A]; else { @@ -286,7 +286,7 @@ void h8_timer8_channel_device::recalc_event(UINT64 cur_time) } for(auto & elem : tcor) { - UINT32 new_delay = 0xffffffff; + uint32_t new_delay = 0xffffffff; if(elem > tcnt) { if(tcnt >= counter_cycle || elem <= counter_cycle) new_delay = elem - tcnt; @@ -353,7 +353,7 @@ void h8_timer8_channel_device::timer_tick() } } -h8h_timer8_channel_device::h8h_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8h_timer8_channel_device::h8h_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8_timer8_channel_device(mconfig, H8H_TIMER8_CHANNEL, "H8H 8-bits timer channel", tag, owner, clock, "h8h_8bits_timer_channel", __FILE__) { } diff --git a/src/devices/cpu/h8/h8_timer8.h b/src/devices/cpu/h8/h8_timer8.h index 0ab4055ea38..d4919dddce0 100644 --- a/src/devices/cpu/h8/h8_timer8.h +++ b/src/devices/cpu/h8/h8_timer8.h @@ -35,8 +35,8 @@ public: DIV }; - h8_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - h8_timer8_channel_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); + h8_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + h8_timer8_channel_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); void set_info(const char *intc, int irq_ca, int irq_cb, int irq_v, int div1, int div2, int div3, int div4, int div5, int div6); @@ -49,7 +49,7 @@ public: DECLARE_READ8_MEMBER(tcnt_r); DECLARE_WRITE8_MEMBER(tcnt_w); - UINT64 internal_update(UINT64 current_time); + uint64_t internal_update(uint64_t current_time); void set_extra_clock_bit(bool bit); void chained_timer_overflow(); @@ -83,17 +83,17 @@ protected: const char *chain_tag, *intc_tag; int irq_ca, irq_cb, irq_v, chain_type; int div_tab[6]; - UINT8 tcor[2]; - UINT8 tcr, tcsr, tcnt; + uint8_t tcor[2]; + uint8_t tcr, tcsr, tcnt; bool extra_clock_bit, has_adte, has_ice; int clock_type, clock_divider, clear_type, counter_cycle; - UINT64 last_clock_update, event_time; + uint64_t last_clock_update, event_time; virtual void device_start() override; virtual void device_reset() override; - void update_counter(UINT64 cur_time = 0); - void recalc_event(UINT64 cur_time = 0); + void update_counter(uint64_t cur_time = 0); + void recalc_event(uint64_t cur_time = 0); void timer_tick(); void update_tcr(); @@ -101,7 +101,7 @@ protected: class h8h_timer8_channel_device : public h8_timer8_channel_device { public: - h8h_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8h_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~h8h_timer8_channel_device(); void set_info(const char *intc, int irq_ca, int irq_cb, int irq_v, const char *chain_tag, int chain_type, bool has_adte, bool has_ice); diff --git a/src/devices/cpu/h8/h8_watchdog.cpp b/src/devices/cpu/h8/h8_watchdog.cpp index 19d9131819a..286be74c208 100644 --- a/src/devices/cpu/h8/h8_watchdog.cpp +++ b/src/devices/cpu/h8/h8_watchdog.cpp @@ -6,7 +6,7 @@ const device_type H8_WATCHDOG = &device_creator; const int h8_watchdog_device::div_bh[8] = { 1, 6, 7, 9, 11, 13, 15, 17 }; const int h8_watchdog_device::div_s [8] = { 1, 5, 6, 7, 8, 9, 11, 12 }; -h8_watchdog_device::h8_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8_watchdog_device::h8_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, H8_WATCHDOG, "H8 watchdog", tag, owner, clock, "h8_watchdog", __FILE__), cpu(*this, DEVICE_SELF_OWNER) { @@ -20,26 +20,26 @@ void h8_watchdog_device::set_info(const char *_intc_tag, int _irq, int _type) } -UINT64 h8_watchdog_device::internal_update(UINT64 current_time) +uint64_t h8_watchdog_device::internal_update(uint64_t current_time) { tcnt_update(current_time); if(tcsr & TCSR_TME) { int shift = (type == S ? div_s : div_bh)[tcsr & TCSR_CKS]; - UINT64 spos = tcnt_cycle_base >> shift; + uint64_t spos = tcnt_cycle_base >> shift; return (spos + 0x100 - tcnt) << shift; } else return 0; } -void h8_watchdog_device::tcnt_update(UINT64 cur_time) +void h8_watchdog_device::tcnt_update(uint64_t cur_time) { if(tcsr & TCSR_TME) { int shift = (type == S ? div_s : div_bh)[tcsr & TCSR_CKS]; if(!cur_time) cur_time = cpu->total_cycles(); - UINT64 spos = tcnt_cycle_base >> shift; - UINT64 epos = cur_time >> shift; + uint64_t spos = tcnt_cycle_base >> shift; + uint64_t epos = cur_time >> shift; int next_tcnt = tcnt + int(epos - spos); tcnt = next_tcnt; diff --git a/src/devices/cpu/h8/h8_watchdog.h b/src/devices/cpu/h8/h8_watchdog.h index efb77b29c05..f746be40aa9 100644 --- a/src/devices/cpu/h8/h8_watchdog.h +++ b/src/devices/cpu/h8/h8_watchdog.h @@ -51,11 +51,11 @@ class h8_watchdog_device : public device_t { public: enum { B, H, S }; - h8_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_info(const char *intc, int irq, int type); - UINT64 internal_update(UINT64 current_time); + uint64_t internal_update(uint64_t current_time); DECLARE_READ16_MEMBER(wd_r); DECLARE_WRITE16_MEMBER(wd_w); @@ -88,10 +88,10 @@ private: const char *intc_tag; int irq; int type; - UINT8 tcnt, tcsr, rst; - UINT64 tcnt_cycle_base; + uint8_t tcnt, tcsr, rst; + uint64_t tcnt_cycle_base; - void tcnt_update(UINT64 current_time = 0); + void tcnt_update(uint64_t current_time = 0); }; extern const device_type H8_WATCHDOG; diff --git a/src/devices/cpu/h8/h8h.cpp b/src/devices/cpu/h8/h8h.cpp index a7ca2bc8685..1710cb930f6 100644 --- a/src/devices/cpu/h8/h8h.cpp +++ b/src/devices/cpu/h8/h8h.cpp @@ -3,14 +3,14 @@ #include "emu.h" #include "h8h.h" -h8h_device::h8h_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, address_map_delegate map_delegate) : +h8h_device::h8h_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, address_map_delegate map_delegate) : h8_device(mconfig, type, name, tag, owner, clock, shortname, source, false, map_delegate) { supports_advanced = true; mode_advanced = true; } -offs_t h8h_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t h8h_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } diff --git a/src/devices/cpu/h8/h8h.h b/src/devices/cpu/h8/h8h.h index 5999ad1030f..b4385d96ef6 100644 --- a/src/devices/cpu/h8/h8h.h +++ b/src/devices/cpu/h8/h8h.h @@ -18,18 +18,18 @@ class h8h_device : public h8_device { public: - h8h_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, address_map_delegate map_delegate); + h8h_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, address_map_delegate map_delegate); protected: static const disasm_entry disasm_entries[]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; - inline void r32_w(int reg, UINT32 val) { R[reg & 7] = val; R[(reg & 7) | 8] = val >> 16; } - inline UINT32 r32_r(int reg) const { return R[reg & 7] | (R[(reg & 7) | 8] << 16); } + inline void r32_w(int reg, uint32_t val) { R[reg & 7] = val; R[(reg & 7) | 8] = val >> 16; } + inline uint32_t r32_r(int reg) const { return R[reg & 7] | (R[(reg & 7) | 8] << 16); } #define O(o) void o ## _full(); void o ## _partial() diff --git a/src/devices/cpu/h8/h8s2000.cpp b/src/devices/cpu/h8/h8s2000.cpp index 7ebb24fd181..ff8997e4728 100644 --- a/src/devices/cpu/h8/h8s2000.cpp +++ b/src/devices/cpu/h8/h8s2000.cpp @@ -3,13 +3,13 @@ #include "emu.h" #include "h8s2000.h" -h8s2000_device::h8s2000_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, address_map_delegate map_delegate) : +h8s2000_device::h8s2000_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, address_map_delegate map_delegate) : h8h_device(mconfig, type, name, tag, owner, clock, shortname, source, map_delegate) { has_exr = true; } -offs_t h8s2000_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t h8s2000_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } diff --git a/src/devices/cpu/h8/h8s2000.h b/src/devices/cpu/h8/h8s2000.h index 665f272fe5b..24808f8d596 100644 --- a/src/devices/cpu/h8/h8s2000.h +++ b/src/devices/cpu/h8/h8s2000.h @@ -20,12 +20,12 @@ class h8s2000_device : public h8h_device { public: - h8s2000_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, address_map_delegate map_delegate); + h8s2000_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, address_map_delegate map_delegate); protected: static const disasm_entry disasm_entries[]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; diff --git a/src/devices/cpu/h8/h8s2245.cpp b/src/devices/cpu/h8/h8s2245.cpp index 88650f775bc..20cc8bbc237 100644 --- a/src/devices/cpu/h8/h8s2245.cpp +++ b/src/devices/cpu/h8/h8s2245.cpp @@ -9,7 +9,7 @@ const device_type H8S2245 = &device_creator; const device_type H8S2246 = &device_creator; -h8s2245_device::h8s2245_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) : +h8s2245_device::h8s2245_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) : h8s2000_device(mconfig, type, name, tag, owner, clock, shortname, source, address_map_delegate(FUNC(h8s2245_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -41,7 +41,7 @@ h8s2245_device::h8s2245_device(const machine_config &mconfig, device_type type, ram_start = 0; } -h8s2245_device::h8s2245_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2245_device::h8s2245_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2000_device(mconfig, H8S2245, "H8S/2245", tag, owner, clock, "h8s2245", __FILE__, address_map_delegate(FUNC(h8s2245_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -73,19 +73,19 @@ h8s2245_device::h8s2245_device(const machine_config &mconfig, const char *tag, d ram_start = 0xffec00; } -h8s2241_device::h8s2241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2241_device::h8s2241_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2245_device(mconfig, H8S2241, "H8S/2241", tag, owner, clock, "h8s2241", __FILE__) { ram_start = 0xffec00; } -h8s2242_device::h8s2242_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2242_device::h8s2242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2245_device(mconfig, H8S2242, "H8S/2242", tag, owner, clock, "h8s2242", __FILE__) { ram_start = 0xffdc00; } -h8s2246_device::h8s2246_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2246_device::h8s2246_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2245_device(mconfig, H8S2246, "H8S/2246", tag, owner, clock, "h8s2246", __FILE__) { ram_start = 0xffdc00; @@ -319,9 +319,9 @@ void h8s2245_device::interrupt_taken() standard_irq_callback(intc->interrupt_taken(taken_irq_vector)); } -void h8s2245_device::internal_update(UINT64 current_time) +void h8s2245_device::internal_update(uint64_t current_time) { - UINT64 event_time = 0; + uint64_t event_time = 0; add_event(event_time, adc->internal_update(current_time)); add_event(event_time, sci0->internal_update(current_time)); @@ -369,7 +369,7 @@ READ16_MEMBER(h8s2245_device::mstpcr_r) WRITE16_MEMBER(h8s2245_device::mstpcr_w) { - UINT16 omstpcr = mstpcr; + uint16_t omstpcr = mstpcr; COMBINE_DATA(&mstpcr); if((omstpcr ^ mstpcr) & 0x72e0) { char buf[4096]; diff --git a/src/devices/cpu/h8/h8s2245.h b/src/devices/cpu/h8/h8s2245.h index a67fa9f9866..b5c64aef730 100644 --- a/src/devices/cpu/h8/h8s2245.h +++ b/src/devices/cpu/h8/h8s2245.h @@ -33,8 +33,8 @@ class h8s2245_device : public h8s2000_device { public: - h8s2245_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); - h8s2245_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2245_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); + h8s2245_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(syscr_r); DECLARE_WRITE8_MEMBER(syscr_w); @@ -68,16 +68,16 @@ protected: required_device sci2; required_device watchdog; - UINT32 ram_start; - UINT16 mstpcr; - UINT8 syscr; + uint32_t ram_start; + uint16_t mstpcr; + uint8_t syscr; virtual bool exr_in_stack() const override; virtual void update_irq_filter() override; virtual void interrupt_taken() override; virtual int trapa_setup() override; virtual void irq_setup() override; - virtual void internal_update(UINT64 current_time) override; + virtual void internal_update(uint64_t current_time) override; virtual machine_config_constructor device_mconfig_additions() const override; DECLARE_ADDRESS_MAP(map, 16); @@ -88,17 +88,17 @@ protected: class h8s2241_device : public h8s2245_device { public: - h8s2241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2241_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2242_device : public h8s2245_device { public: - h8s2242_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2246_device : public h8s2245_device { public: - h8s2246_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2246_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type H8S2241; diff --git a/src/devices/cpu/h8/h8s2320.cpp b/src/devices/cpu/h8/h8s2320.cpp index 5f0987c2f10..073725dcd3e 100644 --- a/src/devices/cpu/h8/h8s2320.cpp +++ b/src/devices/cpu/h8/h8s2320.cpp @@ -14,7 +14,7 @@ const device_type H8S2328 = &device_creator; const device_type H8S2329 = &device_creator; -h8s2320_device::h8s2320_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) : +h8s2320_device::h8s2320_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) : h8s2000_device(mconfig, type, name, tag, owner, clock, shortname, source, address_map_delegate(FUNC(h8s2320_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -53,7 +53,7 @@ h8s2320_device::h8s2320_device(const machine_config &mconfig, device_type type, ram_start = 0; } -h8s2320_device::h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2320_device::h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2000_device(mconfig, H8S2320, "H8S/2320", tag, owner, clock, "h8s2320", __FILE__, address_map_delegate(FUNC(h8s2320_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -92,49 +92,49 @@ h8s2320_device::h8s2320_device(const machine_config &mconfig, const char *tag, d ram_start = 0xffec00; } -h8s2321_device::h8s2321_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2321_device::h8s2321_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2320_device(mconfig, H8S2321, "H8S/2321", tag, owner, clock, "h8s2321", __FILE__) { ram_start = 0xffec00; } -h8s2322_device::h8s2322_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2322_device::h8s2322_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2320_device(mconfig, H8S2322, "H8S/2322", tag, owner, clock, "h8s2322", __FILE__) { ram_start = 0xffdc00; } -h8s2323_device::h8s2323_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2323_device::h8s2323_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2320_device(mconfig, H8S2323, "H8S/2323", tag, owner, clock, "h8s2323", __FILE__) { ram_start = 0xffdc00; } -h8s2324_device::h8s2324_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2324_device::h8s2324_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2320_device(mconfig, H8S2324, "H8S/2324", tag, owner, clock, "h8s2324", __FILE__) { ram_start = 0xff7c00; } -h8s2326_device::h8s2326_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2326_device::h8s2326_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2320_device(mconfig, H8S2326, "H8S/2326", tag, owner, clock, "h8s2326", __FILE__) { ram_start = 0xffdc00; } -h8s2327_device::h8s2327_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2327_device::h8s2327_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2320_device(mconfig, H8S2327, "H8S/2327", tag, owner, clock, "h8s2327", __FILE__) { ram_start = 0xffdc00; } -h8s2328_device::h8s2328_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2328_device::h8s2328_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2320_device(mconfig, H8S2328, "H8S/2328", tag, owner, clock, "h8s2328", __FILE__) { ram_start = 0xffdc00; } -h8s2329_device::h8s2329_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2329_device::h8s2329_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2320_device(mconfig, H8S2329, "H8S/2329", tag, owner, clock, "h8s2329", __FILE__) { ram_start = 0xff7c00; @@ -456,9 +456,9 @@ void h8s2320_device::interrupt_taken() standard_irq_callback(intc->interrupt_taken(taken_irq_vector)); } -void h8s2320_device::internal_update(UINT64 current_time) +void h8s2320_device::internal_update(uint64_t current_time) { - UINT64 event_time = 0; + uint64_t event_time = 0; add_event(event_time, adc->internal_update(current_time)); add_event(event_time, sci0->internal_update(current_time)); diff --git a/src/devices/cpu/h8/h8s2320.h b/src/devices/cpu/h8/h8s2320.h index 68ef4f7ba66..e8a979127cf 100644 --- a/src/devices/cpu/h8/h8s2320.h +++ b/src/devices/cpu/h8/h8s2320.h @@ -39,8 +39,8 @@ class h8s2320_device : public h8s2000_device { public: - h8s2320_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); - h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2320_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); + h8s2320_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(syscr_r); DECLARE_WRITE8_MEMBER(syscr_w); @@ -79,8 +79,8 @@ protected: required_device sci2; required_device watchdog; - UINT32 ram_start; - UINT8 syscr; + uint32_t ram_start; + uint8_t syscr; virtual bool exr_in_stack() const override; virtual void update_irq_filter() override; @@ -88,7 +88,7 @@ protected: virtual int trace_setup() override; virtual int trapa_setup() override; virtual void irq_setup() override; - virtual void internal_update(UINT64 current_time) override; + virtual void internal_update(uint64_t current_time) override; virtual machine_config_constructor device_mconfig_additions() const override; DECLARE_ADDRESS_MAP(map, 16); @@ -99,42 +99,42 @@ protected: class h8s2321_device : public h8s2320_device { public: - h8s2321_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2321_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2322_device : public h8s2320_device { public: - h8s2322_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2322_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2323_device : public h8s2320_device { public: - h8s2323_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2323_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2324_device : public h8s2320_device { public: - h8s2324_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2324_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2326_device : public h8s2320_device { public: - h8s2326_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2326_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2327_device : public h8s2320_device { public: - h8s2327_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2327_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2328_device : public h8s2320_device { public: - h8s2328_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2328_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2329_device : public h8s2320_device { public: - h8s2329_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2329_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type H8S2320; diff --git a/src/devices/cpu/h8/h8s2357.cpp b/src/devices/cpu/h8/h8s2357.cpp index d80f48e1551..c600904ba83 100644 --- a/src/devices/cpu/h8/h8s2357.cpp +++ b/src/devices/cpu/h8/h8s2357.cpp @@ -10,7 +10,7 @@ const device_type H8S2394 = &device_creator; const device_type H8S2392 = &device_creator; const device_type H8S2390 = &device_creator; -h8s2357_device::h8s2357_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) : +h8s2357_device::h8s2357_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) : h8s2000_device(mconfig, type, name, tag, owner, clock, shortname, source, address_map_delegate(FUNC(h8s2357_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -45,7 +45,7 @@ h8s2357_device::h8s2357_device(const machine_config &mconfig, device_type type, syscr = 0; } -h8s2357_device::h8s2357_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2357_device::h8s2357_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2000_device(mconfig, H8S2357, "H8S/2357", tag, owner, clock, "h8s2357", __FILE__, address_map_delegate(FUNC(h8s2357_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -81,31 +81,31 @@ h8s2357_device::h8s2357_device(const machine_config &mconfig, const char *tag, d ram_start = 0xffdc00; } -h8s2352_device::h8s2352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2352_device::h8s2352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2357_device(mconfig, H8S2352, "H8S/2352", tag, owner, clock, "h8s2352", __FILE__) { ram_start = 0xffdc00; } -h8s2398_device::h8s2398_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2398_device::h8s2398_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2357_device(mconfig, H8S2398, "H8S/2398", tag, owner, clock, "h8s2398", __FILE__) { ram_start = 0xffdc00; } -h8s2394_device::h8s2394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2394_device::h8s2394_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2357_device(mconfig, H8S2394, "H8S/2394", tag, owner, clock, "h8s2394", __FILE__) { ram_start = 0xff7c00; } -h8s2392_device::h8s2392_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2392_device::h8s2392_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2357_device(mconfig, H8S2392, "H8S/2392", tag, owner, clock, "h8s2392", __FILE__) { ram_start = 0xffdc00; } -h8s2390_device::h8s2390_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2390_device::h8s2390_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2357_device(mconfig, H8S2390, "H8S/2390", tag, owner, clock, "h8s2390", __FILE__) { ram_start = 0xffec00; @@ -392,9 +392,9 @@ void h8s2357_device::interrupt_taken() standard_irq_callback(intc->interrupt_taken(taken_irq_vector)); } -void h8s2357_device::internal_update(UINT64 current_time) +void h8s2357_device::internal_update(uint64_t current_time) { - UINT64 event_time = 0; + uint64_t event_time = 0; add_event(event_time, adc->internal_update(current_time)); add_event(event_time, sci0->internal_update(current_time)); diff --git a/src/devices/cpu/h8/h8s2357.h b/src/devices/cpu/h8/h8s2357.h index fc677b565c3..c7fe219b5a7 100644 --- a/src/devices/cpu/h8/h8s2357.h +++ b/src/devices/cpu/h8/h8s2357.h @@ -34,8 +34,8 @@ class h8s2357_device : public h8s2000_device { public: - h8s2357_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); - h8s2357_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2357_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); + h8s2357_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(syscr_r); DECLARE_WRITE8_MEMBER(syscr_w); @@ -70,7 +70,7 @@ protected: required_device sci2; required_device watchdog; - UINT32 ram_start; + uint32_t ram_start; unsigned char syscr; virtual bool exr_in_stack() const override; @@ -79,7 +79,7 @@ protected: virtual int trace_setup() override; virtual int trapa_setup() override; virtual void irq_setup() override; - virtual void internal_update(UINT64 current_time) override; + virtual void internal_update(uint64_t current_time) override; virtual machine_config_constructor device_mconfig_additions() const override; DECLARE_ADDRESS_MAP(map, 16); @@ -90,27 +90,27 @@ protected: class h8s2352_device : public h8s2357_device { public: - h8s2352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2398_device : public h8s2357_device { public: - h8s2398_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2398_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2394_device : public h8s2357_device { public: - h8s2394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2394_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2392_device : public h8s2357_device { public: - h8s2392_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2392_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class h8s2390_device : public h8s2357_device { public: - h8s2390_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2390_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type H8S2357; diff --git a/src/devices/cpu/h8/h8s2600.cpp b/src/devices/cpu/h8/h8s2600.cpp index d0b6edfeef2..7717bc2f179 100644 --- a/src/devices/cpu/h8/h8s2600.cpp +++ b/src/devices/cpu/h8/h8s2600.cpp @@ -3,12 +3,12 @@ #include "emu.h" #include "h8s2600.h" -h8s2600_device::h8s2600_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, address_map_delegate map_delegate) : +h8s2600_device::h8s2600_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, address_map_delegate map_delegate) : h8s2000_device(mconfig, type, name, tag, owner, clock, shortname, source, map_delegate) { } -offs_t h8s2600_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t h8s2600_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } diff --git a/src/devices/cpu/h8/h8s2600.h b/src/devices/cpu/h8/h8s2600.h index 1a8e723c142..a7c686e910d 100644 --- a/src/devices/cpu/h8/h8s2600.h +++ b/src/devices/cpu/h8/h8s2600.h @@ -18,12 +18,12 @@ class h8s2600_device : public h8s2000_device { public: - h8s2600_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, address_map_delegate map_delegate); + h8s2600_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, address_map_delegate map_delegate); protected: static const disasm_entry disasm_entries[]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; diff --git a/src/devices/cpu/h8/h8s2655.cpp b/src/devices/cpu/h8/h8s2655.cpp index 80558108b69..14610e9161d 100644 --- a/src/devices/cpu/h8/h8s2655.cpp +++ b/src/devices/cpu/h8/h8s2655.cpp @@ -6,7 +6,7 @@ const device_type H8S2655 = &device_creator; const device_type H8S2653 = &device_creator; -h8s2655_device::h8s2655_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) : +h8s2655_device::h8s2655_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) : h8s2600_device(mconfig, type, name, tag, owner, clock, shortname, source, address_map_delegate(FUNC(h8s2655_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -41,7 +41,7 @@ h8s2655_device::h8s2655_device(const machine_config &mconfig, device_type type, syscr = 0; } -h8s2655_device::h8s2655_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2655_device::h8s2655_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2600_device(mconfig, H8S2655, "H8S/2655", tag, owner, clock, "h8s2655", __FILE__, address_map_delegate(FUNC(h8s2655_device::map), this)), intc(*this, "intc"), adc(*this, "adc"), @@ -77,7 +77,7 @@ h8s2655_device::h8s2655_device(const machine_config &mconfig, const char *tag, d syscr = 0; } -h8s2653_device::h8s2653_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +h8s2653_device::h8s2653_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : h8s2655_device(mconfig, H8S2653, "H8S/2653", tag, owner, clock, "h8s2653", __FILE__) { } @@ -397,9 +397,9 @@ void h8s2655_device::interrupt_taken() standard_irq_callback(intc->interrupt_taken(taken_irq_vector)); } -void h8s2655_device::internal_update(UINT64 current_time) +void h8s2655_device::internal_update(uint64_t current_time) { - UINT64 event_time = 0; + uint64_t event_time = 0; add_event(event_time, adc->internal_update(current_time)); add_event(event_time, sci0->internal_update(current_time)); diff --git a/src/devices/cpu/h8/h8s2655.h b/src/devices/cpu/h8/h8s2655.h index 47fb7e57e23..7da96bce082 100644 --- a/src/devices/cpu/h8/h8s2655.h +++ b/src/devices/cpu/h8/h8s2655.h @@ -26,8 +26,8 @@ class h8s2655_device : public h8s2600_device { public: - h8s2655_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); - h8s2655_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2655_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); + h8s2655_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(syscr_r); DECLARE_WRITE8_MEMBER(syscr_w); @@ -62,7 +62,7 @@ protected: required_device sci2; required_device watchdog; - UINT8 syscr; + uint8_t syscr; virtual bool exr_in_stack() const override; virtual void update_irq_filter() override; @@ -70,7 +70,7 @@ protected: virtual int trace_setup() override; virtual int trapa_setup() override; virtual void irq_setup() override; - virtual void internal_update(UINT64 current_time) override; + virtual void internal_update(uint64_t current_time) override; virtual machine_config_constructor device_mconfig_additions() const override; DECLARE_ADDRESS_MAP(map, 16); @@ -81,7 +81,7 @@ protected: class h8s2653_device : public h8s2655_device { public: - h8s2653_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h8s2653_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type H8S2655; diff --git a/src/devices/cpu/hcd62121/hcd62121.cpp b/src/devices/cpu/hcd62121/hcd62121.cpp index 4cc98ab13fe..8a3e6fa5049 100644 --- a/src/devices/cpu/hcd62121/hcd62121.cpp +++ b/src/devices/cpu/hcd62121/hcd62121.cpp @@ -29,7 +29,7 @@ Martin Poupe's site can be found at http://martin.poupe.org/casio/ const device_type HCD62121 = &device_creator; -hcd62121_cpu_device::hcd62121_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hcd62121_cpu_device::hcd62121_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, HCD62121, "Hitachi HCD62121", tag, owner, clock, "hcd62121", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 8, 24, 0) , m_io_config("io", ENDIANNESS_BIG, 8, 8, 0), m_prev_pc(0) @@ -45,15 +45,15 @@ hcd62121_cpu_device::hcd62121_cpu_device(const machine_config &mconfig, const ch } -UINT8 hcd62121_cpu_device::read_op() +uint8_t hcd62121_cpu_device::read_op() { - UINT8 d = m_program->read_byte( ( m_cseg << 16 ) | m_ip ); + uint8_t d = m_program->read_byte( ( m_cseg << 16 ) | m_ip ); m_ip++; return d; } -UINT8 hcd62121_cpu_device::datasize( UINT8 op ) +uint8_t hcd62121_cpu_device::datasize( uint8_t op ) { switch( op & 0x03 ) { @@ -70,7 +70,7 @@ UINT8 hcd62121_cpu_device::datasize( UINT8 op ) } -void hcd62121_cpu_device::read_reg( int size, UINT8 op1 ) +void hcd62121_cpu_device::read_reg( int size, uint8_t op1 ) { int i; @@ -87,7 +87,7 @@ void hcd62121_cpu_device::read_reg( int size, UINT8 op1 ) } -void hcd62121_cpu_device::write_reg( int size, UINT8 op1 ) +void hcd62121_cpu_device::write_reg( int size, uint8_t op1 ) { int i; @@ -104,7 +104,7 @@ void hcd62121_cpu_device::write_reg( int size, UINT8 op1 ) } -void hcd62121_cpu_device::read_regreg( int size, UINT8 op1, UINT8 op2, bool op_is_logical ) +void hcd62121_cpu_device::read_regreg( int size, uint8_t op1, uint8_t op2, bool op_is_logical ) { int i; @@ -130,7 +130,7 @@ void hcd62121_cpu_device::read_regreg( int size, UINT8 op1, UINT8 op2, bool op_i /* We need to swap parameters */ for ( i = 0; i < size; i++ ) { - UINT8 v = m_temp1[i]; + uint8_t v = m_temp1[i]; m_temp1[i] = m_temp2[i]; m_temp2[i] = v; } @@ -138,7 +138,7 @@ void hcd62121_cpu_device::read_regreg( int size, UINT8 op1, UINT8 op2, bool op_i } -void hcd62121_cpu_device::write_regreg( int size, UINT8 op1, UINT8 op2 ) +void hcd62121_cpu_device::write_regreg( int size, uint8_t op1, uint8_t op2 ) { int i; @@ -157,10 +157,10 @@ void hcd62121_cpu_device::write_regreg( int size, UINT8 op1, UINT8 op2 ) } -void hcd62121_cpu_device::read_iregreg( int size, UINT8 op1, UINT8 op2 ) +void hcd62121_cpu_device::read_iregreg( int size, uint8_t op1, uint8_t op2 ) { int i; - UINT16 ad; + uint16_t ad; ad = m_reg[ ( 0x40 | op1 ) & 0x7f ] | ( m_reg[ ( 0x40 | ( op1 + 1 ) ) & 0x7f ] << 8 ); @@ -188,7 +188,7 @@ void hcd62121_cpu_device::read_iregreg( int size, UINT8 op1, UINT8 op2 ) /* We need to swap parameters */ for ( i = 0; i < size; i++ ) { - UINT8 v = m_temp1[i]; + uint8_t v = m_temp1[i]; m_temp1[i] = m_temp2[i]; m_temp2[i] = v; } @@ -196,14 +196,14 @@ void hcd62121_cpu_device::read_iregreg( int size, UINT8 op1, UINT8 op2 ) } -void hcd62121_cpu_device::write_iregreg( int size, UINT8 op1, UINT8 op2 ) +void hcd62121_cpu_device::write_iregreg( int size, uint8_t op1, uint8_t op2 ) { int i; if ( ( op1 & 0x80 ) || ( op2 & 0x80 ) ) { /* store in (reg1) */ - UINT16 ad = m_reg[ ( 0x40 | op1 ) & 0x7f ] | ( m_reg[ ( 0x40 | ( op1 + 1 ) ) & 0x7f ] << 8 ); + uint16_t ad = m_reg[ ( 0x40 | op1 ) & 0x7f ] | ( m_reg[ ( 0x40 | ( op1 + 1 ) ) & 0x7f ] << 8 ); for ( i = 0; i < size; i++ ) { @@ -221,7 +221,7 @@ void hcd62121_cpu_device::write_iregreg( int size, UINT8 op1, UINT8 op2 ) } -void hcd62121_cpu_device::write_iregreg2( int size, UINT8 op1, UINT8 op2 ) +void hcd62121_cpu_device::write_iregreg2( int size, uint8_t op1, uint8_t op2 ) { int i; @@ -234,7 +234,7 @@ void hcd62121_cpu_device::write_iregreg2( int size, UINT8 op1, UINT8 op2 ) else { /* store in (reg1) */ - UINT16 ad = m_reg[ ( 0x40 | op1 ) & 0x7f ] | ( m_reg[ ( 0x40 | ( op1 + 1 ) ) & 0x7f ] << 8 ); + uint16_t ad = m_reg[ ( 0x40 | op1 ) & 0x7f ] | ( m_reg[ ( 0x40 | ( op1 + 1 ) ) & 0x7f ] << 8 ); for ( i = 0; i < size; i++ ) { @@ -246,7 +246,7 @@ void hcd62121_cpu_device::write_iregreg2( int size, UINT8 op1, UINT8 op2 ) } -int hcd62121_cpu_device::check_cond( UINT8 op ) +int hcd62121_cpu_device::check_cond( uint8_t op ) { switch ( op & 0x07 ) { @@ -506,8 +506,8 @@ void hcd62121_cpu_device::execute_run() { do { - UINT32 pc = ( m_cseg << 16 ) | m_ip; - UINT8 op; + uint32_t pc = ( m_cseg << 16 ) | m_ip; + uint8_t op; debugger_instruction_hook(this, pc); m_prev_pc = pc; @@ -525,7 +525,7 @@ void hcd62121_cpu_device::execute_run() } -offs_t hcd62121_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hcd62121_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( hcd62121 ); return CPU_DISASSEMBLE_NAME(hcd62121)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/hcd62121/hcd62121.h b/src/devices/cpu/hcd62121/hcd62121.h index 2339f2229c3..df804d9a0e3 100644 --- a/src/devices/cpu/hcd62121/hcd62121.h +++ b/src/devices/cpu/hcd62121/hcd62121.h @@ -37,7 +37,7 @@ class hcd62121_cpu_device : public cpu_device { public: // construction/destruction - hcd62121_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hcd62121_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -45,9 +45,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 4; } - virtual UINT32 execute_max_cycles() const override { return 48; } - virtual UINT32 execute_input_lines() const override { return 2; } + virtual uint32_t execute_min_cycles() const override { return 4; } + virtual uint32_t execute_max_cycles() const override { return 48; } + virtual uint32_t execute_input_lines() const override { return 2; } virtual void execute_run() override; // device_memory_interface overrides @@ -57,36 +57,36 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 18; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; - - UINT8 read_op(); - UINT8 datasize( UINT8 op ); - void read_reg( int size, UINT8 op1 ); - void write_reg( int size, UINT8 op1 ); - void read_regreg( int size, UINT8 op1, UINT8 op2, bool op_is_logical ); - void write_regreg( int size, UINT8 op1, UINT8 op2 ); - void read_iregreg( int size, UINT8 op1, UINT8 op2 ); - void write_iregreg( int size, UINT8 op1, UINT8 op2 ); - void write_iregreg2( int size, UINT8 op1, UINT8 op2 ); - int check_cond( UINT8 op ); + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 18; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; + + uint8_t read_op(); + uint8_t datasize( uint8_t op ); + void read_reg( int size, uint8_t op1 ); + void write_reg( int size, uint8_t op1 ); + void read_regreg( int size, uint8_t op1, uint8_t op2, bool op_is_logical ); + void write_regreg( int size, uint8_t op1, uint8_t op2 ); + void read_iregreg( int size, uint8_t op1, uint8_t op2 ); + void write_iregreg( int size, uint8_t op1, uint8_t op2 ); + void write_iregreg2( int size, uint8_t op1, uint8_t op2 ); + int check_cond( uint8_t op ); address_space_config m_program_config; address_space_config m_io_config; - UINT32 m_prev_pc; - UINT16 m_sp; - UINT16 m_ip; - UINT8 m_dsize; - UINT8 m_cseg; - UINT8 m_dseg; - UINT8 m_sseg; - UINT8 m_f; - UINT16 m_lar; - UINT8 m_reg[0x80]; - UINT8 m_temp1[0x10]; - UINT8 m_temp2[0x10]; + uint32_t m_prev_pc; + uint16_t m_sp; + uint16_t m_ip; + uint8_t m_dsize; + uint8_t m_cseg; + uint8_t m_dseg; + uint8_t m_sseg; + uint8_t m_f; + uint16_t m_lar; + uint8_t m_reg[0x80]; + uint8_t m_temp1[0x10]; + uint8_t m_temp2[0x10]; address_space *m_program; address_space *m_io; diff --git a/src/devices/cpu/hcd62121/hcd62121_ops.h b/src/devices/cpu/hcd62121/hcd62121_ops.h index 27bd988e650..57c1f6b7d52 100644 --- a/src/devices/cpu/hcd62121/hcd62121_ops.h +++ b/src/devices/cpu/hcd62121/hcd62121_ops.h @@ -4,7 +4,7 @@ #define HCD62121_MSK \ { \ int i; \ - UINT8 mskres = 1; \ + uint8_t mskres = 1; \ \ for ( i = 0; i < size; i++ ) \ { \ @@ -21,8 +21,8 @@ #define HCD62121_IMSK \ { \ int i; \ - UINT8 mskres = 1; \ - UINT8 set_zero = 0; \ + uint8_t mskres = 1; \ + uint8_t set_zero = 0; \ \ for ( i = 0; i < size; i++ ) \ { \ @@ -47,7 +47,7 @@ #define HCD62121_AND \ { \ int i; \ - UINT8 is_zero = 1; \ + uint8_t is_zero = 1; \ \ for ( i = 0; i < size; i++ ) \ { \ @@ -75,7 +75,7 @@ #define HCD62121_OR \ { \ int i; \ - UINT8 is_zero = 1; \ + uint8_t is_zero = 1; \ \ for ( i = 0; i < size; i++ ) \ { \ @@ -103,7 +103,7 @@ #define HCD62121_XOR \ { \ int i; \ - UINT8 is_zero = 1; \ + uint8_t is_zero = 1; \ \ for ( i = 0; i < size; i++ ) \ { \ @@ -131,7 +131,7 @@ #define HCD62121_ADD \ { \ int i; \ - UINT8 is_zero = 1, carry = 0; \ + uint8_t is_zero = 1, carry = 0; \ \ if ( ( m_temp1[0] & 0x0f ) + ( m_temp2[0] & 0x0f ) > 15 ) \ m_f |= _FLAG_CL; \ @@ -140,7 +140,7 @@ \ for ( i = 0; i < size; i++ ) \ { \ - UINT16 res = m_temp1[i] + m_temp2[i] + carry; \ + uint16_t res = m_temp1[i] + m_temp2[i] + carry; \ \ m_temp1[i] = res & 0xff; \ if ( m_temp1[i] ) \ @@ -174,7 +174,7 @@ #define HCD62121_ADDB \ { \ int i; \ - UINT8 is_zero = 1, carry = 0; \ + uint8_t is_zero = 1, carry = 0; \ \ if ( ( m_temp1[0] & 0x0f ) + ( m_temp2[0] & 0x0f ) > 9 ) \ m_f |= _FLAG_CL; \ @@ -183,7 +183,7 @@ \ for ( i = 0; i < size; i++ ) \ { \ - UINT16 res = ( m_temp1[i] & 0x0f ) + ( m_temp2[i] & 0x0f ) + carry; \ + uint16_t res = ( m_temp1[i] & 0x0f ) + ( m_temp2[i] & 0x0f ) + carry; \ \ if ( res > 9 ) \ { \ @@ -225,7 +225,7 @@ #define HCD62121_SUB \ { \ int i; \ - UINT8 is_zero = 1, carry = 0; \ + uint8_t is_zero = 1, carry = 0; \ \ if ( ( m_temp1[0] & 0x0f ) < ( m_temp2[0] & 0x0f ) ) \ m_f |= _FLAG_CL; \ @@ -234,7 +234,7 @@ \ for ( i = 0; i < size; i++ ) \ { \ - UINT16 res = m_temp1[i] - m_temp2[i] - carry; \ + uint16_t res = m_temp1[i] - m_temp2[i] - carry; \ \ m_temp1[i] = res & 0xff; \ if ( m_temp1[i] ) \ @@ -266,7 +266,7 @@ #define HCD62121_PUSHW(source) \ { \ - UINT16 address = source; \ + uint16_t address = source; \ m_program->write_byte( ( m_sseg << 16 ) | m_sp, ( address ) & 0xff ); \ m_sp--; \ m_program->write_byte( ( m_sseg << 16 ) | m_sp, ( address ) >> 8 ); \ @@ -275,7 +275,7 @@ #define HCD62121_POPW(dest) \ { \ - UINT16 res; \ + uint16_t res; \ m_sp++; \ res = m_program->read_byte( ( m_sseg << 16 ) | m_sp ) << 8; \ m_sp++; \ @@ -289,8 +289,8 @@ case 0x06: /* mskq r1,r2 */ case 0x07: /* mskt r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -306,8 +306,8 @@ case 0x0B: /* sht r1,4 */ { int i; int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 d1 = 0, d2 = 0; + uint8_t reg1 = read_op(); + uint8_t d1 = 0, d2 = 0; read_reg( size, reg1 ); @@ -336,8 +336,8 @@ case 0x0E: /* testq r1,r2 */ case 0x0F: /* testt r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -351,8 +351,8 @@ case 0x12: /* xorq r1,r2 */ case 0x13: /* xort r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -368,8 +368,8 @@ case 0x16: /* cmpq r1,r2 */ case 0x17: /* cmpt r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -384,8 +384,8 @@ case 0x1B: /* movt r1,r2 */ { int i; int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -402,8 +402,8 @@ case 0x1E: /* imskq r1,r2 */ case 0x1F: /* imskt r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -419,8 +419,8 @@ case 0x23: /* shrt r1 */ { int i; int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 d1 = 0, d2 = 0; + uint8_t reg1 = read_op(); + uint8_t d1 = 0, d2 = 0; read_reg( size, reg1 ); @@ -441,8 +441,8 @@ case 0x26: /* orq r1,r2 */ case 0x27: /* ort r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -460,8 +460,8 @@ case 0x2B: /* shlt r1 */ { int i; int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 d1 = 0, d2 = 0; + uint8_t reg1 = read_op(); + uint8_t d1 = 0, d2 = 0; read_reg( size, reg1 ); @@ -482,8 +482,8 @@ case 0x2E: /* andq r1,r2 */ case 0x2F: /* andt r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, true ); @@ -499,8 +499,8 @@ case 0x36: /* subq r1,r2 */ case 0x37: /* subt r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -516,8 +516,8 @@ case 0x3A: /* adbq r1,r2 */ case 0x3B: /* adbt r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -533,8 +533,8 @@ case 0x3E: /* addq r1,r2 */ case 0x3F: /* addt r1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_regreg( size, reg1, reg2, false ); @@ -550,8 +550,8 @@ case 0x4E: /* testq ir1,r2 */ case 0x4F: /* testt ir1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_iregreg( size, reg1, reg2 ); @@ -565,8 +565,8 @@ case 0x56: /* cmpq ir1,r2 */ case 0x57: /* cmpt ir1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_iregreg( size, reg1, reg2 ); @@ -581,8 +581,8 @@ case 0x5B: /* movt ir1,r2 */ { int i; int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_iregreg( size, reg1, reg2 ); @@ -599,8 +599,8 @@ case 0x66: /* orb ir1,r2 */ case 0x67: /* orb ir1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_iregreg( size, reg1, reg2 ); @@ -616,8 +616,8 @@ case 0x6E: /* andq ir1,r2 */ case 0x6F: /* andt ir1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_iregreg( size, reg1, reg2 ); @@ -633,8 +633,8 @@ case 0x7E: /* addq ir1,r2 */ case 0x7F: /* addt ir1,r2 */ { int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_iregreg( size, reg1, reg2 ); @@ -650,9 +650,9 @@ case 0x88: /* jump _a16 */ case 0x89: /* jumpf cs:a16 */ { - UINT8 cs = read_op(); - UINT8 a1 = read_op(); - UINT8 a2 = read_op(); + uint8_t cs = read_op(); + uint8_t a1 = read_op(); + uint8_t a2 = read_op(); m_cseg = cs; m_ip = ( a1 << 8 ) | a2; @@ -661,8 +661,8 @@ case 0x89: /* jumpf cs:a16 */ case 0x8A: /* call a16 */ { - UINT8 a1 = read_op(); - UINT8 a2 = read_op(); + uint8_t a1 = read_op(); + uint8_t a2 = read_op(); HCD62121_PUSHW( m_ip ); @@ -690,8 +690,8 @@ case 0x97: /* retnz */ case 0x98: /* jump (r1) */ { - UINT8 reg1 = read_op(); - UINT16 ad = m_reg[ ( reg1 | 0x40 ) & 0x7f ] << 8; + uint8_t reg1 = read_op(); + uint16_t ad = m_reg[ ( reg1 | 0x40 ) & 0x7f ] << 8; if ( reg1 & 0x40 ) ad |= m_reg[ ( ( reg1 - 1 ) | 0x40 ) & 0x7f ]; @@ -715,8 +715,8 @@ case 0xA5: /* jmpcl a16 */ case 0xA6: /* jmpnc a16 */ case 0xA7: /* jmpnz a16 */ { - UINT8 a1 = read_op(); - UINT8 a2 = read_op(); + uint8_t a1 = read_op(); + uint8_t a2 = read_op(); if ( check_cond( op ) ) m_ip = ( a1 << 8 ) | a2; @@ -732,8 +732,8 @@ case 0xAD: /* callcl a16 */ case 0xAE: /* callnc a16 */ case 0xAF: /* callnz a16 */ { - UINT8 a1 = read_op(); - UINT8 a2 = read_op(); + uint8_t a1 = read_op(); + uint8_t a2 = read_op(); if ( check_cond( op ) ) { @@ -774,8 +774,8 @@ case 0xB9: /* unk_B9 reg/i8 */ case 0xBB: /* jmpcl? a16 */ logerror( "%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op ); { - UINT8 a1 = read_op(); - UINT8 a2 = read_op(); + uint8_t a1 = read_op(); + uint8_t a2 = read_op(); if ( m_f & _FLAG_CL ) m_ip = ( a1 << 8 ) | a2; @@ -785,8 +785,8 @@ case 0xBB: /* jmpcl? a16 */ case 0xBF: /* jmpncl? a16 */ logerror( "%02x:%04x: unimplemented instruction %02x encountered\n", m_cseg, m_ip-1, op ); { - UINT8 a1 = read_op(); - UINT8 a2 = read_op(); + uint8_t a1 = read_op(); + uint8_t a2 = read_op(); if ( ! ( m_f & _FLAG_CL ) ) m_ip = ( a1 << 8 ) | a2; @@ -800,7 +800,7 @@ case 0xC3: /* movw reg,i80 */ { int i; int size = datasize( op ); - UINT8 reg = read_op(); + uint8_t reg = read_op(); for( i = 0; i < size; i++ ) { @@ -816,8 +816,8 @@ case 0xC7: /* movt (lar),r1 / r1,(lar) */ { int i; int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); int pre_inc = 0; int post_inc = 1; @@ -871,14 +871,14 @@ case 0xCF: /* swapt ir1,r2? */ { int i; int size = datasize( op ); - UINT8 reg1 = read_op(); - UINT8 reg2 = read_op(); + uint8_t reg1 = read_op(); + uint8_t reg2 = read_op(); read_iregreg( size, reg1, reg2 ); for ( i = 0; i < size; i++ ) { - UINT8 d = m_temp1[i]; + uint8_t d = m_temp1[i]; m_temp1[i] = m_temp2[i]; m_temp2[i] = d; } @@ -914,7 +914,7 @@ case 0xD5: /* movb ss,i8 */ case 0xD6: /* movw sp,reg */ { - UINT8 reg1 = read_op(); + uint8_t reg1 = read_op(); m_sp = m_reg[ reg1 & 0x7f ] | ( m_reg[ ( reg1 + 1 ) & 0x7f ] << 8 ); } @@ -943,7 +943,7 @@ case 0xDD: /* movb ds,i8 */ case 0xDE: /* movw lar,reg */ { - UINT8 reg1 = read_op(); + uint8_t reg1 = read_op(); m_lar = m_reg[ reg1 & 0x7f ] | ( m_reg[ ( reg1 + 1 ) & 0x7f ] << 8 ); } @@ -951,7 +951,7 @@ case 0xDE: /* movw lar,reg */ case 0xE0: /* in0 reg */ { - UINT8 reg1 = read_op(); + uint8_t reg1 = read_op(); m_reg[ reg1 & 0x7f ] = m_io->read_byte( HCD62121_IN0 ); } @@ -977,7 +977,7 @@ case 0xE7: /* unk_e7 reg/i8 (in?) */ case 0xE8: /* movw r1,lar */ { - UINT8 reg1 = read_op(); + uint8_t reg1 = read_op(); m_reg[ reg1 & 0x7f ] = m_lar & 0xff; m_reg[ ( reg1 + 1 ) & 0x7f ] = m_lar >> 8; @@ -986,7 +986,7 @@ case 0xE8: /* movw r1,lar */ case 0xEB: /* movw reg,ss */ { - UINT8 reg1 = read_op(); + uint8_t reg1 = read_op(); m_reg[ reg1 & 0x7f ] = m_sp & 0xff; m_reg[ ( reg1 + 1 ) & 0x7f ] = m_sp >> 8; diff --git a/src/devices/cpu/hcd62121/hcd62121d.cpp b/src/devices/cpu/hcd62121/hcd62121d.cpp index 0c6bc082b11..8bc4d44d3d3 100644 --- a/src/devices/cpu/hcd62121/hcd62121d.cpp +++ b/src/devices/cpu/hcd62121/hcd62121d.cpp @@ -40,8 +40,8 @@ enum struct hcd62121_dasm { const char *str; - UINT8 arg1; - UINT8 arg2; + uint8_t arg1; + uint8_t arg2; }; @@ -131,9 +131,9 @@ static const hcd62121_dasm hcd62121_ops[256] = CPU_DISASSEMBLE( hcd62121 ) { - UINT8 op; - UINT8 op1; - UINT8 op2; + uint8_t op; + uint8_t op1; + uint8_t op2; int pos = 0; const hcd62121_dasm *inst; diff --git a/src/devices/cpu/hd61700/hd61700.cpp b/src/devices/cpu/hd61700/hd61700.cpp index e48b83a576f..11e0ab9f0c2 100644 --- a/src/devices/cpu/hd61700/hd61700.cpp +++ b/src/devices/cpu/hd61700/hd61700.cpp @@ -89,7 +89,7 @@ #define CPU_SLP 0x02 /* HD61700 IRQ vector */ -static const UINT16 irq_vector[] = {0x0032, 0x0042, 0x0052, 0x0062, 0x0072}; +static const uint16_t irq_vector[] = {0x0032, 0x0042, 0x0052, 0x0062, 0x0072}; //************************************************************************** // HD61700 DEVICE @@ -101,7 +101,7 @@ const device_type HD61700 = &device_creator; // hd61700_cpu_device - constructor //------------------------------------------------- -hd61700_cpu_device::hd61700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd61700_cpu_device::hd61700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, HD61700, "HD61700", tag, owner, clock, "hd61700", __FILE__), m_program_config("program", ENDIANNESS_BIG, 16, 18, -1), m_ppc(0x0000), @@ -292,7 +292,7 @@ void hd61700_cpu_device::state_string_export(const device_state_entry &entry, st // helper function //------------------------------------------------- -offs_t hd61700_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hd61700_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( hd61700 ); return CPU_DISASSEMBLE_NAME(hd61700)(this, buffer, pc, oprom, opram, options); @@ -344,7 +344,7 @@ void hd61700_cpu_device::execute_run() } else { - UINT8 op; + uint8_t op; check_irqs(); @@ -359,9 +359,9 @@ void hd61700_cpu_device::execute_run() case 0x08: //ad case 0x09: //sb { - UINT8 arg = read_op(); - UINT8 src = READ_REG(get_sir_im8(arg)); - UINT16 res = READ_REG(arg) + ((op&1) ? -src : +src); + uint8_t arg = read_op(); + uint8_t src = READ_REG(get_sir_im8(arg)); + uint16_t res = READ_REG(arg) + ((op&1) ? -src : +src); COND_WRITE_REG(op, arg, res & 0xff); @@ -377,7 +377,7 @@ void hd61700_cpu_device::execute_run() case 0x02: //ld { - UINT8 arg = read_op(); + uint8_t arg = read_op(); COPY_REG(arg, get_sir_im8(arg)); check_optional_jr(arg); @@ -394,9 +394,9 @@ void hd61700_cpu_device::execute_run() case 0x0e: //or case 0x0f: //xr { - UINT8 arg = read_op(); + uint8_t arg = read_op(); - UINT8 res = make_logic(op, READ_REG(arg), READ_REG(get_sir_im8(arg))); + uint8_t res = make_logic(op, READ_REG(arg), READ_REG(get_sir_im8(arg))); COND_WRITE_REG(op, arg, res); @@ -416,8 +416,8 @@ void hd61700_cpu_device::execute_run() case 0x0a: //adb case 0x0b: //sbb { - UINT8 arg = read_op(); - UINT16 res; + uint8_t arg = read_op(); + uint16_t res; if (op & 0x01) res = make_bcd_sub(READ_REG(arg), READ_REG(get_sir_im8(arg))); @@ -438,9 +438,9 @@ void hd61700_cpu_device::execute_run() case 0x10: //st { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 offset = REG_GET16(src); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t offset = REG_GET16(src); mem_writebyte(REG_UA>>4, offset, READ_REG(arg)); @@ -451,9 +451,9 @@ void hd61700_cpu_device::execute_run() case 0x11: //ld { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 offset = REG_GET16(src); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t offset = REG_GET16(src); WRITE_REG(arg, mem_readbyte(REG_UA>>4, offset)); @@ -464,7 +464,7 @@ void hd61700_cpu_device::execute_run() case 0x12: //stl { - UINT8 arg = read_op(); + uint8_t arg = read_op(); m_lcd_write_cb((offs_t)0, READ_REG(arg)); check_optional_jr(arg); @@ -474,8 +474,8 @@ void hd61700_cpu_device::execute_run() case 0x13: //ldl { - UINT8 arg = read_op(); - UINT8 res = m_lcd_read_cb(0); + uint8_t arg = read_op(); + uint8_t res = m_lcd_read_cb(0); WRITE_REG(arg, res); @@ -486,7 +486,7 @@ void hd61700_cpu_device::execute_run() case 0x14: //ppo/pfl { - UINT8 arg = read_op(); + uint8_t arg = read_op(); if (arg & 0x40) { @@ -504,7 +504,7 @@ void hd61700_cpu_device::execute_run() case 0x15: //psr { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_SREG(arg, READ_REG(arg)); check_optional_jr(arg); @@ -515,9 +515,9 @@ void hd61700_cpu_device::execute_run() case 0x16: //pst case 0x17: //pst { - UINT8 arg = read_op(); - UINT8 src = READ_REG(arg); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t src = READ_REG(arg); + uint8_t idx = GET_REG_IDX(op, arg); switch (idx) { @@ -554,15 +554,15 @@ void hd61700_cpu_device::execute_run() case 0x18: { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //rod case 0x02: //bid { - UINT8 src = READ_REG(arg); - UINT8 res = (src>>1)&0x7f; + uint8_t src = READ_REG(arg); + uint8_t res = (src>>1)&0x7f; if (!(op1&0x02)) res = res | ((m_flags&FLAG_C) !=0 )<<7; @@ -579,8 +579,8 @@ void hd61700_cpu_device::execute_run() case 0x01: //rou case 0x03: //biu { - UINT8 src = READ_REG(arg); - UINT8 res = (src<<1)&0xfe; + uint8_t src = READ_REG(arg); + uint8_t res = (src<<1)&0xfe; if (!(op1&0x02)) res = res | ((m_flags&FLAG_C) !=0 )<<0; @@ -602,14 +602,14 @@ void hd61700_cpu_device::execute_run() case 0x1a: { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //did case 0x01: //diu { - UINT8 res; + uint8_t res; if (op1&0x01) res = (READ_REG(arg)<<4)&0xf0; @@ -639,8 +639,8 @@ void hd61700_cpu_device::execute_run() case 0x1b: //cmp/inv { - UINT8 arg = read_op(); - UINT8 res = ~(READ_REG(arg)); + uint8_t arg = read_op(); + uint8_t res = ~(READ_REG(arg)); if (!(arg & 0x40)) res++; WRITE_REG(arg, res); @@ -657,8 +657,8 @@ void hd61700_cpu_device::execute_run() case 0x1c: //gpo/gfl { - UINT8 arg = read_op(); - UINT8 src; + uint8_t arg = read_op(); + uint8_t src; if (arg&0x40) { @@ -679,7 +679,7 @@ void hd61700_cpu_device::execute_run() case 0x1d: //gsr { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_REG(arg, READ_SREG(arg)); check_optional_jr(arg); m_icount -= 3; @@ -689,8 +689,8 @@ void hd61700_cpu_device::execute_run() case 0x1e: //gst case 0x1f: //gst { - UINT8 arg = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); WRITE_REG(arg, READ_REG8(idx)); check_optional_jr(arg); m_icount -= 3; @@ -700,8 +700,8 @@ void hd61700_cpu_device::execute_run() case 0x20: //st case 0x22: //sti { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; REG_IX += get_sign_mreg(arg); mem_writebyte(REG_UA>>4, REG_IX++, READ_REG(arg)); @@ -715,8 +715,8 @@ void hd61700_cpu_device::execute_run() case 0x21: //st case 0x23: //sti { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; REG_IZ += get_sign_mreg(arg); mem_writebyte(REG_UA>>6, REG_IZ++, READ_REG(arg)); @@ -729,7 +729,7 @@ void hd61700_cpu_device::execute_run() case 0x24: //std { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IX += get_sign_mreg(arg); mem_writebyte(REG_UA>>4, REG_IX, READ_REG(arg)); @@ -739,7 +739,7 @@ void hd61700_cpu_device::execute_run() case 0x25: //std { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IZ += get_sign_mreg(arg); mem_writebyte(REG_UA>>6, REG_IZ, READ_REG(arg)); @@ -749,7 +749,7 @@ void hd61700_cpu_device::execute_run() case 0x26: //phs { - UINT8 arg = read_op(); + uint8_t arg = read_op(); push(REG_SS, READ_REG(arg)); m_icount -= 9; @@ -757,7 +757,7 @@ void hd61700_cpu_device::execute_run() break; case 0x27: //phu { - UINT8 arg = read_op(); + uint8_t arg = read_op(); push(REG_US, READ_REG(arg)); m_icount -= 9; @@ -767,8 +767,8 @@ void hd61700_cpu_device::execute_run() case 0x28: //ld case 0x2a: //ldi { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; REG_IX += get_sign_mreg(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>4, REG_IX++)); @@ -782,8 +782,8 @@ void hd61700_cpu_device::execute_run() case 0x29: //ld case 0x2b: //ldi { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; REG_IZ += get_sign_mreg(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>6, REG_IZ++)); @@ -796,7 +796,7 @@ void hd61700_cpu_device::execute_run() case 0x2c: //ldd { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IX += get_sign_mreg(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>4, REG_IX)); @@ -807,7 +807,7 @@ void hd61700_cpu_device::execute_run() case 0x2d: //ldd { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IZ += get_sign_mreg(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>6, REG_IZ)); @@ -818,7 +818,7 @@ void hd61700_cpu_device::execute_run() case 0x2e: //pps { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_REG(arg, pop(REG_SS)); m_icount -= 11; @@ -826,7 +826,7 @@ void hd61700_cpu_device::execute_run() break; case 0x2f: //ppu { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_REG(arg, pop(REG_US)); m_icount -= 11; @@ -842,9 +842,9 @@ void hd61700_cpu_device::execute_run() case 0x36: //jp nlz case 0x37: //unconditional jp { - UINT8 lsb = read_op(); + uint8_t lsb = read_op(); if (m_pc < INT_ROM) read_op(); - UINT8 msb = read_op(); + uint8_t msb = read_op(); if (check_cond(op)) set_pc((msb<<8) | lsb); @@ -857,11 +857,11 @@ void hd61700_cpu_device::execute_run() case 0x3c: //ad case 0x3e: //sb { - UINT8 arg = read_op(); - UINT16 offset = REG_IX + get_sign_mreg(arg); - UINT8 src = mem_readbyte(REG_UA>>4, offset); + uint8_t arg = read_op(); + uint16_t offset = REG_IX + get_sign_mreg(arg); + uint8_t src = mem_readbyte(REG_UA>>4, offset); - UINT16 res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; + uint16_t res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; if ((op & 4)) mem_writebyte(REG_UA>>4, offset, res & 0xff); @@ -880,11 +880,11 @@ void hd61700_cpu_device::execute_run() case 0x3d: //ad case 0x3f: //sb { - UINT8 arg = read_op(); - UINT16 offset = REG_IZ + get_sign_mreg(arg); - UINT8 src = mem_readbyte(REG_UA>>6, offset); + uint8_t arg = read_op(); + uint16_t offset = REG_IZ + get_sign_mreg(arg); + uint8_t src = mem_readbyte(REG_UA>>6, offset); - UINT16 res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; + uint16_t res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; if ((op & 4)) mem_writebyte(REG_UA>>6, offset, res & 0xff); @@ -903,9 +903,9 @@ void hd61700_cpu_device::execute_run() case 0x48: //ad case 0x49: //sb { - UINT8 arg = read_op(); - UINT8 src = read_op(); - UINT16 res = READ_REG(arg) + ((op&1) ? -src : +src); + uint8_t arg = read_op(); + uint8_t src = read_op(); + uint16_t res = READ_REG(arg) + ((op&1) ? -src : +src); COND_WRITE_REG(op, arg, res & 0xff); @@ -921,8 +921,8 @@ void hd61700_cpu_device::execute_run() case 0x42: //ld { - UINT8 arg = read_op(); - UINT8 src = read_op() ; + uint8_t arg = read_op(); + uint8_t src = read_op() ; WRITE_REG(arg, src); @@ -940,10 +940,10 @@ void hd61700_cpu_device::execute_run() case 0x4e: //or case 0x4f: //xr { - UINT8 arg = read_op(); - UINT8 src = read_op(); + uint8_t arg = read_op(); + uint8_t src = read_op(); - UINT8 res = make_logic(op, READ_REG(arg), src); + uint8_t res = make_logic(op, READ_REG(arg), src); COND_WRITE_REG(op, arg, res); @@ -963,9 +963,9 @@ void hd61700_cpu_device::execute_run() case 0x4a: //adb case 0x4b: //sbb { - UINT8 arg = read_op(); - UINT8 src = read_op(); - UINT16 res; + uint8_t arg = read_op(); + uint8_t src = read_op(); + uint16_t res; if (op & 0x01) res = make_bcd_sub(READ_REG(arg), src); @@ -986,9 +986,9 @@ void hd61700_cpu_device::execute_run() case 0x50: //st { - UINT8 arg = read_op(); - UINT8 src = read_op(); - UINT16 offset = REG_GET16(READ_SREG(arg)); + uint8_t arg = read_op(); + uint8_t src = read_op(); + uint16_t offset = REG_GET16(READ_SREG(arg)); mem_writebyte(REG_UA>>4, offset, src); m_icount -= 8; @@ -997,8 +997,8 @@ void hd61700_cpu_device::execute_run() case 0x51: //ld { - UINT8 arg = read_op(); - UINT8 src = read_op(); + uint8_t arg = read_op(); + uint8_t src = read_op(); WRITE_REG(arg, src); m_icount -= 8; @@ -1007,7 +1007,7 @@ void hd61700_cpu_device::execute_run() case 0x52: //stl { - UINT8 arg = read_op(); + uint8_t arg = read_op(); m_lcd_write_cb((offs_t)0, arg); m_icount -= 12; @@ -1016,8 +1016,8 @@ void hd61700_cpu_device::execute_run() case 0x54: //ppo/pfl { - UINT8 arg = read_op(); - UINT8 src = read_op(); + uint8_t arg = read_op(); + uint8_t src = read_op(); if (arg & 0x40) { @@ -1034,7 +1034,7 @@ void hd61700_cpu_device::execute_run() case 0x55: //psr { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_SREG(arg, arg); m_icount -= 3; @@ -1044,9 +1044,9 @@ void hd61700_cpu_device::execute_run() case 0x56: //pst case 0x57: //pst { - UINT8 arg = read_op(); - UINT8 src = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t src = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); switch (idx) { @@ -1083,9 +1083,9 @@ void hd61700_cpu_device::execute_run() case 0x58: //bups case 0x59: //bdns { - UINT8 arg = read_op(); - UINT8 tmp; - UINT16 res; + uint8_t arg = read_op(); + uint8_t tmp; + uint16_t res; for(;;) { @@ -1113,8 +1113,8 @@ void hd61700_cpu_device::execute_run() case 0x5c: //sup case 0x5d: //sdn { - UINT8 arg = read_op(); - UINT16 res; + uint8_t arg = read_op(); + uint16_t res; for(;;) { @@ -1139,8 +1139,8 @@ void hd61700_cpu_device::execute_run() case 0x60: //st case 0x62: //sti { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; REG_IX += get_sign_im8(arg); mem_writebyte(REG_UA>>4, REG_IX++, READ_REG(arg)); @@ -1154,8 +1154,8 @@ void hd61700_cpu_device::execute_run() case 0x61: //st case 0x63: //sti { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; REG_IZ += get_sign_im8(arg); mem_writebyte(REG_UA>>6, REG_IZ++, READ_REG(arg)); @@ -1167,7 +1167,7 @@ void hd61700_cpu_device::execute_run() case 0x64: //std { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IX += get_sign_im8(arg); mem_writebyte(REG_UA>>4, REG_IX, READ_REG(arg)); @@ -1177,7 +1177,7 @@ void hd61700_cpu_device::execute_run() case 0x65: //std { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IZ += get_sign_im8(arg); mem_writebyte(REG_UA>>6, REG_IZ, READ_REG(arg)); @@ -1188,8 +1188,8 @@ void hd61700_cpu_device::execute_run() case 0x68: //ld case 0x6a: //ldi { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; REG_IX += get_sign_im8(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>4, REG_IX++)); @@ -1202,8 +1202,8 @@ void hd61700_cpu_device::execute_run() case 0x69: //ld case 0x6b: //ldi { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; REG_IZ += get_sign_im8(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>6, REG_IZ++)); @@ -1215,7 +1215,7 @@ void hd61700_cpu_device::execute_run() case 0x6c: //ldd { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IX += get_sign_im8(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>4, REG_IX)); @@ -1225,7 +1225,7 @@ void hd61700_cpu_device::execute_run() case 0x6d: //ldd { - UINT8 arg = read_op(); + uint8_t arg = read_op(); REG_IZ += get_sign_im8(arg); WRITE_REG(arg, mem_readbyte(REG_UA>>6, REG_IZ)); @@ -1242,9 +1242,9 @@ void hd61700_cpu_device::execute_run() case 0x76: //cal nlz case 0x77: //unconditional cal { - UINT8 lsb = read_op(); + uint8_t lsb = read_op(); if (m_pc < INT_ROM) read_op(); - UINT8 msb = read_op(); + uint8_t msb = read_op(); if (check_cond(op)) { @@ -1264,11 +1264,11 @@ void hd61700_cpu_device::execute_run() case 0x7c: //ad case 0x7e: //sb { - UINT8 arg = read_op(); - UINT16 offset = REG_IX + get_sign_im8(arg); - UINT8 src = mem_readbyte(REG_UA>>4, offset); + uint8_t arg = read_op(); + uint16_t offset = REG_IX + get_sign_im8(arg); + uint8_t src = mem_readbyte(REG_UA>>4, offset); - UINT16 res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; + uint16_t res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; if ((op & 4)) mem_writebyte(REG_UA>>4, offset, res & 0xff); @@ -1287,11 +1287,11 @@ void hd61700_cpu_device::execute_run() case 0x7d: //ad case 0x7f: //sb { - UINT8 arg = read_op(); - UINT16 offset = REG_IZ + get_sign_im8(arg); - UINT8 src = mem_readbyte(REG_UA>>6, offset); + uint8_t arg = read_op(); + uint16_t offset = REG_IZ + get_sign_im8(arg); + uint8_t src = mem_readbyte(REG_UA>>6, offset); - UINT16 res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; + uint16_t res = src + ((op & 2) ? -READ_REG(arg) : +READ_REG(arg)) ; if ((op & 4)) mem_writebyte(REG_UA>>6, offset, res & 0xff); @@ -1310,9 +1310,9 @@ void hd61700_cpu_device::execute_run() case 0x88: //adw case 0x89: //sbw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT32 res = REG_GET16(arg) + ((op & 0x01) ? -REG_GET16(src) : +REG_GET16(src)); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint32_t res = REG_GET16(arg) + ((op & 0x01) ? -REG_GET16(src) : +REG_GET16(src)); if (op & 0x08) REG_PUT16(arg, res&0xffff); @@ -1328,8 +1328,8 @@ void hd61700_cpu_device::execute_run() case 0x82: //ldw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); COPY_REG(arg, src); COPY_REG(arg+1, src+1); @@ -1348,13 +1348,13 @@ void hd61700_cpu_device::execute_run() case 0x8e: //orw case 0x8f: //xrw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); - UINT8 res0 = make_logic(op, READ_REG(arg), READ_REG(src)); + uint8_t res0 = make_logic(op, READ_REG(arg), READ_REG(src)); COND_WRITE_REG(op, arg, res0); - UINT8 res1 = make_logic(op, READ_REG(arg+1), READ_REG(src+1)); + uint8_t res1 = make_logic(op, READ_REG(arg+1), READ_REG(src+1)); COND_WRITE_REG(op, arg+1, res1); CLEAR_FLAGS; @@ -1373,9 +1373,9 @@ void hd61700_cpu_device::execute_run() case 0x8a: //adbw case 0x8b: //sbbw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 res0, res1; + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t res0, res1; if (op & 0x01) res0 = make_bcd_sub(READ_REG(arg), READ_REG(src)); @@ -1405,9 +1405,9 @@ void hd61700_cpu_device::execute_run() case 0x90: //stw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 offset = REG_GET16(src); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t offset = REG_GET16(src); mem_writebyte(REG_UA>>4, offset+0, READ_REG(arg+0)); mem_writebyte(REG_UA>>4, offset+1, READ_REG(arg+1)); @@ -1419,9 +1419,9 @@ void hd61700_cpu_device::execute_run() case 0x91: //ldw { - UINT8 arg = read_op(); - UINT8 src = get_sir_im8(arg); - UINT16 offset = REG_GET16(src); + uint8_t arg = read_op(); + uint8_t src = get_sir_im8(arg); + uint16_t offset = REG_GET16(src); WRITE_REG(arg+0, mem_readbyte(REG_UA>>4, offset+0)); WRITE_REG(arg+1, mem_readbyte(REG_UA>>4, offset+1)); @@ -1433,7 +1433,7 @@ void hd61700_cpu_device::execute_run() case 0x92: //stlw { - UINT8 arg = read_op(); + uint8_t arg = read_op(); m_lcd_write_cb((offs_t)0, READ_REG(arg)); m_lcd_write_cb((offs_t)0, READ_REG(arg+1)); @@ -1445,8 +1445,8 @@ void hd61700_cpu_device::execute_run() case 0x93: //ldcw { - UINT8 arg = read_op(); - UINT8 reg0, reg1; + uint8_t arg = read_op(); + uint8_t reg0, reg1; reg0 = m_lcd_read_cb(0); reg1 = m_lcd_read_cb(0); @@ -1462,8 +1462,8 @@ void hd61700_cpu_device::execute_run() case 0x96: //pre case 0x97: //pre { - UINT8 arg = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); if (idx < 5) m_reg16bit[idx] = REG_GET16(arg); @@ -1475,15 +1475,15 @@ void hd61700_cpu_device::execute_run() case 0x98: //rodw { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //rodw case 0x02: //bidw { - UINT16 src = REG_GET16(arg-1); - UINT16 res = (src>>1)&0x7fff; + uint16_t src = REG_GET16(arg-1); + uint16_t res = (src>>1)&0x7fff; if (!(op1&0x02)) res = res | ((m_flags&FLAG_C) !=0 )<<15; @@ -1500,8 +1500,8 @@ void hd61700_cpu_device::execute_run() case 0x01: //rouw case 0x03: //biuw { - UINT16 src = REG_GET16(arg); - UINT16 res = (src<<1)&0xfffe; + uint16_t src = REG_GET16(arg); + uint16_t res = (src<<1)&0xfffe; if (!(op1&0x02)) res = res | ((m_flags&FLAG_C) !=0 )<<0; @@ -1523,13 +1523,13 @@ void hd61700_cpu_device::execute_run() case 0x9a: { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //didw { - UINT16 src = (REG_GET16(arg-1)>>4)&0x0fff; + uint16_t src = (REG_GET16(arg-1)>>4)&0x0fff; REG_PUT16(arg-1, src); CLEAR_FLAGS; @@ -1540,7 +1540,7 @@ void hd61700_cpu_device::execute_run() case 0x01: //diuw { - UINT16 src = (REG_GET16(arg)<<4)&0xfff0; + uint16_t src = (REG_GET16(arg)<<4)&0xfff0; REG_PUT16(arg, src); CLEAR_FLAGS; @@ -1551,7 +1551,7 @@ void hd61700_cpu_device::execute_run() case 0x02: //bydw { - UINT8 src = READ_REG(arg); + uint8_t src = READ_REG(arg); WRITE_REG(arg, 0); WRITE_REG(arg-1, src); @@ -1564,7 +1564,7 @@ void hd61700_cpu_device::execute_run() case 0x03: //byuw { - UINT8 src = READ_REG(arg); + uint8_t src = READ_REG(arg); WRITE_REG(arg, 0); WRITE_REG(arg+1, src); @@ -1583,8 +1583,8 @@ void hd61700_cpu_device::execute_run() case 0x9b: //cmpw/invw { - UINT8 arg = read_op(); - UINT16 res = ~(REG_GET16(arg)); + uint8_t arg = read_op(); + uint16_t res = ~(REG_GET16(arg)); if (!(arg & 0x40)) res++; REG_PUT16(arg, res); @@ -1602,8 +1602,8 @@ void hd61700_cpu_device::execute_run() case 0x9c: //gpow/gflw { - UINT8 arg = read_op(); - UINT8 reg0, reg1; + uint8_t arg = read_op(); + uint8_t reg0, reg1; if (arg&0x40) { @@ -1630,13 +1630,13 @@ void hd61700_cpu_device::execute_run() case 0x9e: //gre case 0x9f: //gre { - UINT8 arg = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); - UINT16 src; + uint8_t arg = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); + uint16_t src; if (idx >= 5) { - UINT16 port = m_kb_read_cb(0); + uint16_t port = m_kb_read_cb(0); src = (REG_KY & 0x0f00) | (port & 0xf0ff); } else @@ -1652,9 +1652,9 @@ void hd61700_cpu_device::execute_run() case 0xa0: //stw case 0xa2: //stiw { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1669,9 +1669,9 @@ void hd61700_cpu_device::execute_run() case 0xa1: //stw case 0xa3: //stiw { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1685,8 +1685,8 @@ void hd61700_cpu_device::execute_run() case 0xa4: //stdw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1698,8 +1698,8 @@ void hd61700_cpu_device::execute_run() break; case 0xa5: //stdw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1712,7 +1712,7 @@ void hd61700_cpu_device::execute_run() case 0xa6: //phsw { - UINT8 arg = read_op(); + uint8_t arg = read_op(); push(REG_SS, READ_REG(arg)); push(REG_SS, READ_REG(arg-1)); @@ -1721,7 +1721,7 @@ void hd61700_cpu_device::execute_run() break; case 0xa7: //phuw { - UINT8 arg = read_op(); + uint8_t arg = read_op(); push(REG_US, READ_REG(arg)); push(REG_US, READ_REG(arg-1)); @@ -1732,9 +1732,9 @@ void hd61700_cpu_device::execute_run() case 0xa8: //ldw case 0xaa: //ldiw { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IX; - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IX; + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1750,9 +1750,9 @@ void hd61700_cpu_device::execute_run() case 0xa9: //ldw case 0xab: //ldiw { - UINT8 arg = read_op(); - UINT16 prev_ir = REG_IZ; - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint16_t prev_ir = REG_IZ; + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1767,8 +1767,8 @@ void hd61700_cpu_device::execute_run() case 0xac: //lddw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1781,8 +1781,8 @@ void hd61700_cpu_device::execute_run() case 0xad: //lddw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -1796,7 +1796,7 @@ void hd61700_cpu_device::execute_run() case 0xae: //ppsw case 0xaf: //ppuw { - UINT8 arg = read_op(); + uint8_t arg = read_op(); WRITE_REG(arg, pop((op&1) ? REG_US : REG_SS)); WRITE_REG(arg+1, pop((op&1) ? REG_US : REG_SS)); @@ -1814,8 +1814,8 @@ void hd61700_cpu_device::execute_run() case 0xb6: //jr nlz case 0xb7: //unconditional jr { - UINT8 arg = read_op(); - UINT32 new_pc = m_pc-1 + get_im_7(arg); + uint8_t arg = read_op(); + uint32_t new_pc = m_pc-1 + get_im_7(arg); if (check_cond(op)) set_pc(new_pc); @@ -1826,13 +1826,13 @@ void hd61700_cpu_device::execute_run() case 0xb8: //adcw case 0xbc: //adw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); - UINT16 offset = REG_IX + ((arg & 0x80) ? -ir_inc : +ir_inc); + uint16_t offset = REG_IX + ((arg & 0x80) ? -ir_inc : +ir_inc); - UINT16 src0 = mem_readbyte(REG_UA>>4, offset) + READ_REG(arg); - UINT16 src1 = mem_readbyte(REG_UA>>4, offset+1) + READ_REG(arg+1) + ((src0>0xff) ? 1 : 0); + uint16_t src0 = mem_readbyte(REG_UA>>4, offset) + READ_REG(arg); + uint16_t src1 = mem_readbyte(REG_UA>>4, offset+1) + READ_REG(arg+1) + ((src0>0xff) ? 1 : 0); if (op&0x04) { @@ -1852,13 +1852,13 @@ void hd61700_cpu_device::execute_run() case 0xba: //sbcw case 0xbe: //sbw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); - UINT16 offset = REG_IX + ((arg & 0x80) ? -ir_inc : +ir_inc); + uint16_t offset = REG_IX + ((arg & 0x80) ? -ir_inc : +ir_inc); - UINT16 src0 = mem_readbyte(REG_UA>>4, offset) - READ_REG(arg); - UINT16 src1 = mem_readbyte(REG_UA>>4, offset+1) - READ_REG(arg+1) - ((src0>0xff) ? 1 : 0); + uint16_t src0 = mem_readbyte(REG_UA>>4, offset) - READ_REG(arg); + uint16_t src1 = mem_readbyte(REG_UA>>4, offset+1) - READ_REG(arg+1) - ((src0>0xff) ? 1 : 0); if (op&0x04) { @@ -1878,13 +1878,13 @@ void hd61700_cpu_device::execute_run() case 0xb9: //adcw case 0xbd: //adw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); - UINT16 offset = REG_IZ + ((arg & 0x80) ? -ir_inc : +ir_inc); + uint16_t offset = REG_IZ + ((arg & 0x80) ? -ir_inc : +ir_inc); - UINT16 src0 = mem_readbyte(REG_UA>>6, offset) + READ_REG(arg); - UINT16 src1 = mem_readbyte(REG_UA>>6, offset+1) + READ_REG(arg+1) + ((src0>0xff) ? 1 : 0); + uint16_t src0 = mem_readbyte(REG_UA>>6, offset) + READ_REG(arg); + uint16_t src1 = mem_readbyte(REG_UA>>6, offset+1) + READ_REG(arg+1) + ((src0>0xff) ? 1 : 0); if (op&0x04) { @@ -1904,13 +1904,13 @@ void hd61700_cpu_device::execute_run() case 0xbb: //sbcw case 0xbf: //sbw { - UINT8 arg = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg)); + uint8_t arg = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg)); - UINT16 offset = REG_IZ + ((arg & 0x80) ? -ir_inc : +ir_inc); + uint16_t offset = REG_IZ + ((arg & 0x80) ? -ir_inc : +ir_inc); - UINT16 src0 = mem_readbyte(REG_UA>>6, offset) - READ_REG(arg); - UINT16 src1 = mem_readbyte(REG_UA>>6, offset+1) - READ_REG(arg+1) - ((src0>0xff) ? 1 : 0); + uint16_t src0 = mem_readbyte(REG_UA>>6, offset) - READ_REG(arg); + uint16_t src1 = mem_readbyte(REG_UA>>6, offset+1) - READ_REG(arg+1) - ((src0>0xff) ? 1 : 0); if (op&0x04) { @@ -1932,12 +1932,12 @@ void hd61700_cpu_device::execute_run() case 0xc8: //adbm case 0xc9: //sbbm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 dst = arg; - UINT8 src = get_sir_im8(arg, arg1); - UINT8 c, f; - UINT16 res = 0; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t dst = arg; + uint8_t src = get_sir_im8(arg, arg1); + uint8_t c, f; + uint16_t res = 0; c = f = 0; for (int n=GET_IM3(arg1); n>0; n--) @@ -1969,10 +1969,10 @@ void hd61700_cpu_device::execute_run() case 0xc2: //ldm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 dst = arg; - UINT8 src = get_sir_im8(arg, arg1); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t dst = arg; + uint8_t src = get_sir_im8(arg, arg1); for (int n=GET_IM3(arg1); n>0; n--) { @@ -1994,11 +1994,11 @@ void hd61700_cpu_device::execute_run() case 0xce: //orm case 0xcf: //xrm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 dst = arg; - UINT8 src = get_sir_im8(arg, arg1); - UINT8 res = 0, f = 0; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t dst = arg; + uint8_t src = get_sir_im8(arg, arg1); + uint8_t res = 0, f = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2028,11 +2028,11 @@ void hd61700_cpu_device::execute_run() case 0xca: //adbm case 0xcb: //sbbm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 dst = arg; - UINT16 res = 0; - UINT8 src, f; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t dst = arg; + uint16_t res = 0; + uint8_t src, f; src = arg1 & 0x1f; f = 0; @@ -2065,8 +2065,8 @@ void hd61700_cpu_device::execute_run() case 0xd0: //stw { - UINT8 arg = read_op(); - UINT16 offset = REG_GET16(READ_SREG(arg)); + uint8_t arg = read_op(); + uint16_t offset = REG_GET16(READ_SREG(arg)); mem_writebyte(REG_UA>>4, offset+0, read_op()); mem_writebyte(REG_UA>>4, offset+1, read_op()); @@ -2077,9 +2077,9 @@ void hd61700_cpu_device::execute_run() case 0xd1: //ldw { - UINT8 arg = read_op(); - UINT8 reg0 = read_op(); - UINT8 reg1 = read_op(); + uint8_t arg = read_op(); + uint8_t reg0 = read_op(); + uint8_t reg1 = read_op(); WRITE_REG(arg+0, reg0); WRITE_REG(arg+1, reg1); @@ -2089,8 +2089,8 @@ void hd61700_cpu_device::execute_run() case 0xd2: //stlm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); for (int n=GET_IM3(arg1); n>0; n--) { @@ -2106,9 +2106,9 @@ void hd61700_cpu_device::execute_run() case 0xd3: //ldlm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 src; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t src; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2126,10 +2126,10 @@ void hd61700_cpu_device::execute_run() case 0xd6: //pre case 0xd7: //pre { - UINT8 arg = read_op(); - UINT8 lsb = read_op(); - UINT8 msb = read_op(); - UINT8 idx = GET_REG_IDX(op, arg); + uint8_t arg = read_op(); + uint8_t lsb = read_op(); + uint8_t msb = read_op(); + uint8_t idx = GET_REG_IDX(op, arg); if (idx < 5) m_reg16bit[idx] = (msb<<8) | lsb; @@ -2141,7 +2141,7 @@ void hd61700_cpu_device::execute_run() case 0xd8: //bup case 0xd9: //bdn { - UINT8 src; + uint8_t src; for(;;) { src = mem_readbyte(REG_UA>>4, REG_IX); @@ -2161,14 +2161,14 @@ void hd61700_cpu_device::execute_run() case 0xda: { - UINT8 arg = read_op(); - UINT8 op1 = (arg>>5) & 0x03; + uint8_t arg = read_op(); + uint8_t op1 = (arg>>5) & 0x03; switch (op1) { case 0x00: //didm { - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2 = 0; + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2 = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2187,8 +2187,8 @@ void hd61700_cpu_device::execute_run() case 0x01: //dium { - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2 = 0; + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2 = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2207,8 +2207,8 @@ void hd61700_cpu_device::execute_run() case 0x02: //bydm { - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2 = 0, f = 0; + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2 = 0, f = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2227,8 +2227,8 @@ void hd61700_cpu_device::execute_run() case 0x03: //byum { - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2 = 0, f = 0; + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2 = 0, f = 0; for (int n=GET_IM3(arg1); n>0; n--) { @@ -2250,9 +2250,9 @@ void hd61700_cpu_device::execute_run() case 0xdb: //cmpm/invm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 r1 = 0, r2, f = 0; + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t r1 = 0, r2, f = 0; r2 = (arg&0x40) ? 0 : 1; @@ -2278,8 +2278,8 @@ void hd61700_cpu_device::execute_run() case 0xdc: //sup case 0xdd: //sdn { - UINT8 arg = read_op(); - UINT16 res; + uint8_t arg = read_op(); + uint16_t res; for(;;) { @@ -2303,7 +2303,7 @@ void hd61700_cpu_device::execute_run() case 0xde: //jp { - UINT8 arg = read_op(); + uint8_t arg = read_op(); set_pc(REG_GET16(arg)); m_icount -= 5; @@ -2312,10 +2312,10 @@ void hd61700_cpu_device::execute_run() case 0xdf: //jp { - UINT8 arg = read_op(); - UINT16 offset = REG_GET16(arg); - UINT8 lsb = mem_readbyte(REG_UA>>4, offset+0); - UINT8 msb = mem_readbyte(REG_UA>>4, offset+1); + uint8_t arg = read_op(); + uint16_t offset = REG_GET16(arg); + uint8_t lsb = mem_readbyte(REG_UA>>4, offset+0); + uint8_t msb = mem_readbyte(REG_UA>>4, offset+1); set_pc((msb<<8) | lsb); @@ -2326,10 +2326,10 @@ void hd61700_cpu_device::execute_run() case 0xe0: //stm case 0xe2: //stim { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT16 prev_ir = REG_IX; - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint16_t prev_ir = REG_IX; + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2348,10 +2348,10 @@ void hd61700_cpu_device::execute_run() case 0xe1: //stm case 0xe3: //stim { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT16 prev_ir = REG_IZ; - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint16_t prev_ir = REG_IZ; + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2369,9 +2369,9 @@ void hd61700_cpu_device::execute_run() case 0xe4: //stdm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2389,9 +2389,9 @@ void hd61700_cpu_device::execute_run() case 0xe5: //stdm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2410,8 +2410,8 @@ void hd61700_cpu_device::execute_run() case 0xe6: //phsm case 0xe7: //phum { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); for (int n=GET_IM3(arg1); n>0; n--) { @@ -2427,10 +2427,10 @@ void hd61700_cpu_device::execute_run() case 0xe8: //ldm case 0xea: //ldim { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT16 prev_ir = REG_IX; - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint16_t prev_ir = REG_IX; + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2449,10 +2449,10 @@ void hd61700_cpu_device::execute_run() case 0xe9: //ldm case 0xeb: //ldim { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT16 prev_ir = REG_IZ; - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint16_t prev_ir = REG_IZ; + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2470,9 +2470,9 @@ void hd61700_cpu_device::execute_run() case 0xec: //lddm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IX += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2490,9 +2490,9 @@ void hd61700_cpu_device::execute_run() case 0xed: //lddm { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); - UINT8 ir_inc = READ_REG(get_sir_im8(arg, arg1)); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); + uint8_t ir_inc = READ_REG(get_sir_im8(arg, arg1)); REG_IZ += ((arg & 0x80) ? -ir_inc : +ir_inc); @@ -2511,8 +2511,8 @@ void hd61700_cpu_device::execute_run() case 0xee: //ppsm case 0xef: //ppum { - UINT8 arg = read_op(); - UINT8 arg1 = read_op(); + uint8_t arg = read_op(); + uint8_t arg1 = read_op(); for (int n=GET_IM3(arg1); n>0; n--) { @@ -2535,8 +2535,8 @@ void hd61700_cpu_device::execute_run() { if (check_cond(op)) { - UINT8 lsb = pop(REG_SS) ; - UINT8 msb = pop(REG_SS); + uint8_t lsb = pop(REG_SS) ; + uint8_t msb = pop(REG_SS); set_pc((((msb<<8) | (lsb<<0)) + 1)); } @@ -2565,8 +2565,8 @@ void hd61700_cpu_device::execute_run() case 0xfd: //rtni { - UINT8 lsb = pop(REG_SS); - UINT8 msb = pop(REG_SS); + uint8_t lsb = pop(REG_SS); + uint8_t msb = pop(REG_SS); set_pc((msb<<8) | (lsb<<0)); @@ -2576,7 +2576,7 @@ void hd61700_cpu_device::execute_run() case 0xfc: //cani { - for (UINT8 arg=0x10; arg>0; arg>>=1) + for (uint8_t arg=0x10; arg>0; arg>>=1) { if (REG_IB & arg) { @@ -2733,7 +2733,7 @@ void hd61700_cpu_device::execute_set_input(int inputnum, int state) // INLINE HELPERS //************************************************************************** -inline void hd61700_cpu_device::set_pc(INT32 new_pc) +inline void hd61700_cpu_device::set_pc(int32_t new_pc) { m_curpc = (m_curpc & 0x30000) | new_pc; m_pc = new_pc & 0xffff; @@ -2741,10 +2741,10 @@ inline void hd61700_cpu_device::set_pc(INT32 new_pc) m_fetch_addr = new_pc<<1; } -inline UINT8 hd61700_cpu_device::read_op() +inline uint8_t hd61700_cpu_device::read_op() { - UINT16 data; - UINT32 addr18 = make_18bit_addr((m_irq_status) ? 0 : prev_ua, m_pc); + uint16_t data; + uint32_t addr18 = make_18bit_addr((m_irq_status) ? 0 : prev_ua, m_pc); if (m_pc <= INT_ROM) { @@ -2772,38 +2772,38 @@ inline UINT8 hd61700_cpu_device::read_op() return (data&0xff); } -inline UINT8 hd61700_cpu_device::mem_readbyte(UINT8 segment, UINT16 offset) +inline uint8_t hd61700_cpu_device::mem_readbyte(uint8_t segment, uint16_t offset) { return m_program->read_word(make_18bit_addr(segment, offset)<<1) & 0xff; } -inline void hd61700_cpu_device::mem_writebyte(UINT8 segment, UINT16 offset, UINT8 data) +inline void hd61700_cpu_device::mem_writebyte(uint8_t segment, uint16_t offset, uint8_t data) { m_program->write_word(make_18bit_addr(segment, offset)<<1, data); } -inline UINT32 hd61700_cpu_device::make_18bit_addr(UINT8 segment, UINT16 offset) +inline uint32_t hd61700_cpu_device::make_18bit_addr(uint8_t segment, uint16_t offset) { if (offset >= ((REG_IB>>6) & 0x03) * 0x4000) - return (UINT32)((offset | ((segment&0x03)<<16)) & 0x3ffff); + return (uint32_t)((offset | ((segment&0x03)<<16)) & 0x3ffff); else return offset; } -inline void hd61700_cpu_device::push(UINT16 &offset, UINT8 data) +inline void hd61700_cpu_device::push(uint16_t &offset, uint8_t data) { offset--; mem_writebyte(REG_UA>>2, offset, data); } -inline UINT8 hd61700_cpu_device::pop(UINT16 &offset) +inline uint8_t hd61700_cpu_device::pop(uint16_t &offset) { - UINT8 data = mem_readbyte(REG_UA>>2, offset); + uint8_t data = mem_readbyte(REG_UA>>2, offset); offset++; return data; } -inline int hd61700_cpu_device::check_cond(UINT32 op) +inline int hd61700_cpu_device::check_cond(uint32_t op) { switch ( op & 0x07 ) { @@ -2849,7 +2849,7 @@ inline int hd61700_cpu_device::check_cond(UINT32 op) return 0; } -inline UINT8 hd61700_cpu_device::make_logic(UINT8 type, UINT8 d1, UINT8 d2) +inline uint8_t hd61700_cpu_device::make_logic(uint8_t type, uint8_t d1, uint8_t d2) { switch (type&3) { @@ -2866,26 +2866,26 @@ inline UINT8 hd61700_cpu_device::make_logic(UINT8 type, UINT8 d1, UINT8 d2) } } -inline void hd61700_cpu_device::check_optional_jr(UINT8 arg) +inline void hd61700_cpu_device::check_optional_jr(uint8_t arg) { if (arg & 0x80) { if (m_pc < INT_ROM && WORD_ALIGNED(m_fetch_addr)) read_op(); - UINT8 arg1 = read_op(); + uint8_t arg1 = read_op(); - UINT32 new_pc = m_pc + get_im_7(arg1) - 1; + uint32_t new_pc = m_pc + get_im_7(arg1) - 1; set_pc(new_pc); m_icount -= 3; } } -inline UINT8 hd61700_cpu_device::get_sir_im8(UINT8 arg) +inline uint8_t hd61700_cpu_device::get_sir_im8(uint8_t arg) { if (((arg>>5) & 0x03) == 0x03) { - UINT8 arg1 = read_op(); + uint8_t arg1 = read_op(); return arg1&0x1f; } @@ -2895,7 +2895,7 @@ inline UINT8 hd61700_cpu_device::get_sir_im8(UINT8 arg) } } -inline UINT8 hd61700_cpu_device::get_sir_im8(UINT8 arg, UINT8 arg1) +inline uint8_t hd61700_cpu_device::get_sir_im8(uint8_t arg, uint8_t arg1) { if (((arg>>5) & 0x03) == 0x03) { @@ -2907,7 +2907,7 @@ inline UINT8 hd61700_cpu_device::get_sir_im8(UINT8 arg, UINT8 arg1) } } -inline int hd61700_cpu_device::get_sign_mreg(UINT8 arg) +inline int hd61700_cpu_device::get_sign_mreg(uint8_t arg) { int res = READ_REG(get_sir_im8(arg)); @@ -2916,7 +2916,7 @@ inline int hd61700_cpu_device::get_sign_mreg(UINT8 arg) return res; } -inline int hd61700_cpu_device::get_sign_im8(UINT8 arg) +inline int hd61700_cpu_device::get_sign_im8(uint8_t arg) { int res = read_op(); @@ -2925,7 +2925,7 @@ inline int hd61700_cpu_device::get_sign_im8(UINT8 arg) return res; } -inline int hd61700_cpu_device::get_im_7(UINT8 data) +inline int hd61700_cpu_device::get_im_7(uint8_t data) { if (data&0x80) return 0x80 - data; @@ -2933,10 +2933,10 @@ inline int hd61700_cpu_device::get_im_7(UINT8 data) return data; } -inline UINT16 hd61700_cpu_device::make_bcd_sub(UINT8 arg1, UINT8 arg2) +inline uint16_t hd61700_cpu_device::make_bcd_sub(uint8_t arg1, uint8_t arg2) { - UINT32 ret = (arg1&0x0f) - (arg2&0x0f); - UINT8 carry; + uint32_t ret = (arg1&0x0f) - (arg2&0x0f); + uint8_t carry; if (ret > 0x09) { @@ -2961,10 +2961,10 @@ inline UINT16 hd61700_cpu_device::make_bcd_sub(UINT8 arg1, UINT8 arg2) return ret; } -inline UINT16 hd61700_cpu_device::make_bcd_add(UINT8 arg1, UINT8 arg2) +inline uint16_t hd61700_cpu_device::make_bcd_add(uint8_t arg1, uint8_t arg2) { - UINT32 ret = (arg1&0x0f) + (arg2&0x0f); - UINT8 carry; + uint32_t ret = (arg1&0x0f) + (arg2&0x0f); + uint8_t carry; if (ret > 0x09) { diff --git a/src/devices/cpu/hd61700/hd61700.h b/src/devices/cpu/hd61700/hd61700.h index 838ea8833bb..ea836e5f51e 100644 --- a/src/devices/cpu/hd61700/hd61700.h +++ b/src/devices/cpu/hd61700/hd61700.h @@ -67,7 +67,7 @@ class hd61700_cpu_device : public cpu_device { public: // construction/destruction - hd61700_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + hd61700_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); template static devcb_base &set_lcd_ctrl_callback(device_t &device, _Object object) { return downcast(device).m_lcd_ctrl_cb.set_callback(object); } template static devcb_base &set_lcd_write_callback(device_t &device, _Object object) { return downcast(device).m_lcd_write_cb.set_callback(object); } @@ -84,9 +84,9 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 52; } - virtual UINT32 execute_input_lines() const override { return 6; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 52; } + virtual uint32_t execute_input_lines() const override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -98,31 +98,31 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : nullptr; } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 16; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 16; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // interrupts bool check_irqs(void); // inline helpers - inline void set_pc(INT32 new_pc); - inline UINT8 read_op(); - inline UINT8 mem_readbyte(UINT8 segment, UINT16 offset); - inline void mem_writebyte(UINT8 segment, UINT16 offset, UINT8 data); - inline UINT32 make_18bit_addr(UINT8 segment, UINT16 offset); - inline int check_cond( UINT32 op ); - inline void push(UINT16 &offset, UINT8 data); - inline UINT8 pop(UINT16 &offset); - inline UINT8 make_logic(UINT8 type, UINT8 d1, UINT8 d2); - inline void check_optional_jr(UINT8 arg); - inline UINT8 get_sir_im8(UINT8 arg); - inline UINT8 get_sir_im8(UINT8 arg, UINT8 arg1); - inline int get_sign_mreg(UINT8 op1); - inline int get_sign_im8(UINT8 op1); - inline int get_im_7(UINT8 data); - inline UINT16 make_bcd_sub(UINT8 arg1, UINT8 arg2); - inline UINT16 make_bcd_add(UINT8 arg1, UINT8 arg2); + inline void set_pc(int32_t new_pc); + inline uint8_t read_op(); + inline uint8_t mem_readbyte(uint8_t segment, uint16_t offset); + inline void mem_writebyte(uint8_t segment, uint16_t offset, uint8_t data); + inline uint32_t make_18bit_addr(uint8_t segment, uint16_t offset); + inline int check_cond( uint32_t op ); + inline void push(uint16_t &offset, uint8_t data); + inline uint8_t pop(uint16_t &offset); + inline uint8_t make_logic(uint8_t type, uint8_t d1, uint8_t d2); + inline void check_optional_jr(uint8_t arg); + inline uint8_t get_sir_im8(uint8_t arg); + inline uint8_t get_sir_im8(uint8_t arg, uint8_t arg1); + inline int get_sign_mreg(uint8_t op1); + inline int get_sign_im8(uint8_t op1); + inline int get_im_7(uint8_t data); + inline uint16_t make_bcd_sub(uint8_t arg1, uint8_t arg2); + inline uint16_t make_bcd_add(uint8_t arg1, uint8_t arg2); protected: @@ -133,16 +133,16 @@ protected: offs_t m_ppc; offs_t m_curpc; - UINT16 m_pc; - UINT8 m_flags; - UINT32 m_fetch_addr; - UINT8 m_regsir[3]; // 5bit register (sx, sy, sz) - UINT8 m_reg8bit[8]; // 8bit register (pe, pd, ib, ua, ia, ie, tm, tm) - UINT16 m_reg16bit[8]; // 16bit register (ix, iy, iz, us, ss, ky, ky, ky) - UINT8 m_regmain[0x20]; // main registers - UINT8 m_irq_status; - UINT8 m_state; - UINT8 prev_ua; + uint16_t m_pc; + uint8_t m_flags; + uint32_t m_fetch_addr; + uint8_t m_regsir[3]; // 5bit register (sx, sy, sz) + uint8_t m_reg8bit[8]; // 8bit register (pe, pd, ib, ua, ia, ie, tm, tm) + uint16_t m_reg16bit[8]; // 16bit register (ix, iy, iz, us, ss, ky, ky, ky) + uint8_t m_regmain[0x20]; // main registers + uint8_t m_irq_status; + uint8_t m_state; + uint8_t prev_ua; int m_lines_status[6]; int m_icount; diff --git a/src/devices/cpu/hd61700/hd61700d.cpp b/src/devices/cpu/hd61700/hd61700d.cpp index b5461ec58e8..8d6a73aa9eb 100644 --- a/src/devices/cpu/hd61700/hd61700d.cpp +++ b/src/devices/cpu/hd61700/hd61700d.cpp @@ -44,8 +44,8 @@ enum struct hd61700_dasm { const char *str; - UINT8 arg1; - UINT8 arg2; + uint8_t arg1; + uint8_t arg2; bool optjr; }; @@ -213,12 +213,12 @@ static const hd61700_dasm hd61700_ops[256] = }; -inline int dasm_im8(char *buffer, UINT16 pc, int arg, const UINT8 *oprom, int &pos, int type) +inline int dasm_im8(char *buffer, uint16_t pc, int arg, const uint8_t *oprom, int &pos, int type) { if (((arg>>5) & 0x03) == 0x03) { INC_POS; - UINT8 ret = sprintf( buffer, "0x%02x", oprom[POS] & 0x1f ); + uint8_t ret = sprintf( buffer, "0x%02x", oprom[POS] & 0x1f ); return ret; } else @@ -228,7 +228,7 @@ inline int dasm_im8(char *buffer, UINT16 pc, int arg, const UINT8 *oprom, int &p } -inline int dasm_im8(char *buffer, UINT16 pc, int arg, int arg1, const UINT8 *oprom, int &pos) +inline int dasm_im8(char *buffer, uint16_t pc, int arg, int arg1, const uint8_t *oprom, int &pos) { if (((arg>>5) & 0x03) == 0x03) { @@ -241,7 +241,7 @@ inline int dasm_im8(char *buffer, UINT16 pc, int arg, int arg1, const UINT8 *opr } -int dasm_arg(char *buffer, UINT8 op, UINT16 pc, int arg, const UINT8 *oprom, int &pos) +int dasm_arg(char *buffer, uint8_t op, uint16_t pc, int arg, const uint8_t *oprom, int &pos) { char* buffer_start = buffer; int type = EXT_ROM; @@ -302,7 +302,7 @@ int dasm_arg(char *buffer, UINT8 op, UINT16 pc, int arg, const UINT8 *oprom, int case OP_RMSIM3: { - UINT8 tmp = oprom[POS]; + uint8_t tmp = oprom[POS]; INC_POS; buffer += dasm_im8(buffer, pc, tmp, oprom[POS], oprom, pos); buffer += sprintf( buffer, ", 0x%02x", ((tmp>>5)&7)+1); @@ -312,7 +312,7 @@ int dasm_arg(char *buffer, UINT8 op, UINT16 pc, int arg, const UINT8 *oprom, int case OP_IR_IM3: { - UINT8 tmp = oprom[POS]; + uint8_t tmp = oprom[POS]; INC_POS; buffer += sprintf( buffer, "(%s%s", (op&1) ? "iz": "ix", (tmp&0x80) ? "-": "+"); buffer += dasm_im8(buffer, pc, tmp, oprom[POS], oprom, pos); @@ -357,10 +357,10 @@ int dasm_arg(char *buffer, UINT8 op, UINT16 pc, int arg, const UINT8 *oprom, int case OP_IM16: case OP_IM16A: { - UINT8 tmp1 = oprom[POS]; + uint8_t tmp1 = oprom[POS]; INC_POS; if (!EXT_ROM && arg == OP_IM16A) INC_POS; - UINT8 tmp2 = oprom[POS]; + uint8_t tmp2 = oprom[POS]; buffer += sprintf( buffer, "0x%04x", ((tmp2<<8) | tmp1)); INC_POS; } @@ -373,7 +373,7 @@ int dasm_arg(char *buffer, UINT8 op, UINT16 pc, int arg, const UINT8 *oprom, int return buffer - buffer_start; } -UINT32 get_dasmflags(UINT8 op) +uint32_t get_dasmflags(uint8_t op) { switch (op) { @@ -399,8 +399,8 @@ UINT32 get_dasmflags(UINT8 op) CPU_DISASSEMBLE( hd61700 ) { const hd61700_dasm *inst; - UINT32 dasmflags; - UINT8 op, op1; + uint32_t dasmflags; + uint8_t op, op1; int pos = 0, type = EXT_ROM; op = oprom[POS]; diff --git a/src/devices/cpu/hmcs40/hmcs40.cpp b/src/devices/cpu/hmcs40/hmcs40.cpp index c8d2148b861..b9e9f8e904b 100644 --- a/src/devices/cpu/hmcs40/hmcs40.cpp +++ b/src/devices/cpu/hmcs40/hmcs40.cpp @@ -78,56 +78,56 @@ ADDRESS_MAP_END // device definitions -hmcs43_cpu_device::hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname) +hmcs43_cpu_device::hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname) : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, HMCS40_FAMILY_HMCS43, polarity, 3 /* stack levels */, 10 /* pc width */, 11 /* prg width */, ADDRESS_MAP_NAME(program_1k), 7 /* data width */, ADDRESS_MAP_NAME(data_80x4), shortname, __FILE__) { } -hd38750_device::hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd38750_device::hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs43_cpu_device(mconfig, HD38750, "HD38750", tag, owner, clock, IS_PMOS, "hd38750") { } -hd38755_device::hd38755_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd38755_device::hd38755_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs43_cpu_device(mconfig, HD38755, "HD38755", tag, owner, clock, IS_PMOS, "hd38755") { } -hd44750_device::hd44750_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd44750_device::hd44750_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs43_cpu_device(mconfig, HD44750, "HD44750", tag, owner, clock, IS_CMOS, "hd44750") { } -hd44758_device::hd44758_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd44758_device::hd44758_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs43_cpu_device(mconfig, HD44758, "HD44758", tag, owner, clock, IS_CMOS, "hd44758") { } -hmcs44_cpu_device::hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname) +hmcs44_cpu_device::hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname) : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, HMCS40_FAMILY_HMCS44, polarity, 4, 11, 12, ADDRESS_MAP_NAME(program_2k), 8, ADDRESS_MAP_NAME(data_160x4), shortname, __FILE__) { } -hd38800_device::hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd38800_device::hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs44_cpu_device(mconfig, HD38800, "HD38800", tag, owner, clock, IS_PMOS, "hd38800") { } -hd38805_device::hd38805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd38805_device::hd38805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs44_cpu_device(mconfig, HD38805, "HD38805", tag, owner, clock, IS_PMOS, "hd38805") { } -hd44801_device::hd44801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd44801_device::hd44801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs44_cpu_device(mconfig, HD44801, "HD44801", tag, owner, clock, IS_CMOS, "hd44801") { } -hd44808_device::hd44808_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd44808_device::hd44808_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs44_cpu_device(mconfig, HD44808, "HD44808", tag, owner, clock, IS_CMOS, "hd44808") { } -hmcs45_cpu_device::hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname) +hmcs45_cpu_device::hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname) : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, HMCS40_FAMILY_HMCS45, polarity, 4, 11, 12, ADDRESS_MAP_NAME(program_2k), 8, ADDRESS_MAP_NAME(data_160x4), shortname, __FILE__) { } -hd38820_device::hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd38820_device::hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs45_cpu_device(mconfig, HD38820, "HD38820", tag, owner, clock, IS_PMOS, "hd38820") { } -hd38825_device::hd38825_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd38825_device::hd38825_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs45_cpu_device(mconfig, HD38825, "HD38825", tag, owner, clock, IS_PMOS, "hd38825") { } -hd44820_device::hd44820_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd44820_device::hd44820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs45_cpu_device(mconfig, HD44820, "HD44820", tag, owner, clock, IS_CMOS, "hd44820") { } -hd44828_device::hd44828_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd44828_device::hd44828_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hmcs45_cpu_device(mconfig, HD44828, "HD44828", tag, owner, clock, IS_CMOS, "hd44828") { } @@ -148,7 +148,7 @@ void hmcs40_cpu_device::state_string_export(const device_state_entry &entry, std } } -offs_t hmcs40_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hmcs40_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(hmcs40); return CPU_DISASSEMBLE_NAME(hmcs40)(this, buffer, pc, oprom, opram, options); @@ -306,10 +306,10 @@ void hmcs40_cpu_device::device_reset() // i/o handling //------------------------------------------------- -UINT8 hmcs40_cpu_device::read_r(int index) +uint8_t hmcs40_cpu_device::read_r(int index) { index &= 7; - UINT8 inp = 0; + uint8_t inp = 0; switch (index) { @@ -329,7 +329,7 @@ UINT8 hmcs40_cpu_device::read_r(int index) return (inp | m_r[index]) & 0xf; } -void hmcs40_cpu_device::write_r(int index, UINT8 data) +void hmcs40_cpu_device::write_r(int index, uint8_t data) { index &= 7; data &= 0xf; @@ -371,7 +371,7 @@ void hmcs40_cpu_device::write_d(int index, int state) // R0 is input-only, R1 is i/o, R2,R3 are output-only, no R4-R7 // D0-D3 are i/o, D4-D15 are output-only -UINT8 hmcs43_cpu_device::read_r(int index) +uint8_t hmcs43_cpu_device::read_r(int index) { index &= 7; @@ -381,7 +381,7 @@ UINT8 hmcs43_cpu_device::read_r(int index) return hmcs40_cpu_device::read_r(index); } -void hmcs43_cpu_device::write_r(int index, UINT8 data) +void hmcs43_cpu_device::write_r(int index, uint8_t data) { index &= 7; @@ -405,7 +405,7 @@ int hmcs43_cpu_device::read_d(int index) // R0-R3 are i/o, R4,R5 are extra registers, no R6,R7 // D0-D15 are i/o -UINT8 hmcs44_cpu_device::read_r(int index) +uint8_t hmcs44_cpu_device::read_r(int index) { index &= 7; @@ -415,7 +415,7 @@ UINT8 hmcs44_cpu_device::read_r(int index) return hmcs40_cpu_device::read_r(index); } -void hmcs44_cpu_device::write_r(int index, UINT8 data) +void hmcs44_cpu_device::write_r(int index, uint8_t data) { index &= 7; @@ -429,7 +429,7 @@ void hmcs44_cpu_device::write_r(int index, UINT8 data) // R0-R5 are i/o, R6 is output-only, no R7 // D0-D15 are i/o -UINT8 hmcs45_cpu_device::read_r(int index) +uint8_t hmcs45_cpu_device::read_r(int index) { index &= 7; @@ -439,7 +439,7 @@ UINT8 hmcs45_cpu_device::read_r(int index) return hmcs40_cpu_device::read_r(index); } -void hmcs45_cpu_device::write_r(int index, UINT8 data) +void hmcs45_cpu_device::write_r(int index, uint8_t data) { index &= 7; @@ -553,8 +553,8 @@ void hmcs40_cpu_device::increment_tc() inline void hmcs40_cpu_device::increment_pc() { // PC lower bits is a LFSR identical to TI TMS1000 - UINT8 mask = 0x3f; - UINT8 low = m_pc & mask; + uint8_t mask = 0x3f; + uint8_t low = m_pc & mask; int fb = (low << 1 & 0x20) == (low & 0x20); if (low == (mask >> 1)) diff --git a/src/devices/cpu/hmcs40/hmcs40.h b/src/devices/cpu/hmcs40/hmcs40.h index d9e30a92f72..225d5790b68 100644 --- a/src/devices/cpu/hmcs40/hmcs40.h +++ b/src/devices/cpu/hmcs40/hmcs40.h @@ -116,7 +116,7 @@ class hmcs40_cpu_device : public cpu_device { public: // construction/destruction - hmcs40_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int family, UINT16 polarity, int stack_levels, int pcwidth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + hmcs40_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int family, uint16_t polarity, int stack_levels, int pcwidth, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 16, prgwidth, -1, program) , m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data) @@ -160,11 +160,11 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } // " - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } - virtual UINT32 execute_input_lines() const override { return 2+1; } // 3rd one is internal + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } // " + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } + virtual uint32_t execute_input_lines() const override { return 2+1; } // 3rd one is internal virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; @@ -172,9 +172,9 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; address_space_config m_program_config; @@ -189,39 +189,39 @@ protected: int m_prgmask; int m_datamask; int m_family; // MCU family (42-47) - UINT16 m_polarity; // i/o polarity (pmos vs cmos) + uint16_t m_polarity; // i/o polarity (pmos vs cmos) int m_stack_levels; // number of callstack levels - UINT16 m_stack[4]; // max 4 - UINT16 m_op; // current opcode - UINT16 m_prev_op; - UINT8 m_i; // 4-bit immediate opcode param + uint16_t m_stack[4]; // max 4 + uint16_t m_op; // current opcode + uint16_t m_prev_op; + uint8_t m_i; // 4-bit immediate opcode param int m_eint_line; // which input_line caused an interrupt emu_timer *m_timer; int m_halt; // internal HLT state attotime m_timer_halted_remain; int m_icount; - UINT16 m_pc; // Program Counter - UINT16 m_prev_pc; - UINT8 m_page; // LPU prepared page - UINT8 m_a; // 4-bit Accumulator - UINT8 m_b; // 4-bit B register - UINT8 m_x; // 1/3/4-bit X register - UINT8 m_spx; // 1/3/4-bit SPX register - UINT8 m_y; // 4-bit Y register - UINT8 m_spy; // 4-bit SPY register - UINT8 m_s; // Status F/F (F/F = flip-flop) - UINT8 m_c; // Carry F/F - UINT8 m_tc; // Timer/Counter - UINT8 m_cf; // CF F/F (timer mode or counter mode) - UINT8 m_ie; // I/E(Interrupt Enable) F/F - UINT8 m_iri; // external interrupt pending I/RI F/F - UINT8 m_irt; // timer interrupt pending I/RT F/F - UINT8 m_if[2]; // external interrupt mask IF0,1 F/F - UINT8 m_tf; // timer interrupt mask TF F/F - UINT8 m_int[2]; // INT0/1 pins state - UINT8 m_r[8]; // R outputs state - UINT16 m_d; // D pins state + uint16_t m_pc; // Program Counter + uint16_t m_prev_pc; + uint8_t m_page; // LPU prepared page + uint8_t m_a; // 4-bit Accumulator + uint8_t m_b; // 4-bit B register + uint8_t m_x; // 1/3/4-bit X register + uint8_t m_spx; // 1/3/4-bit SPX register + uint8_t m_y; // 4-bit Y register + uint8_t m_spy; // 4-bit SPY register + uint8_t m_s; // Status F/F (F/F = flip-flop) + uint8_t m_c; // Carry F/F + uint8_t m_tc; // Timer/Counter + uint8_t m_cf; // CF F/F (timer mode or counter mode) + uint8_t m_ie; // I/E(Interrupt Enable) F/F + uint8_t m_iri; // external interrupt pending I/RI F/F + uint8_t m_irt; // timer interrupt pending I/RT F/F + uint8_t m_if[2]; // external interrupt mask IF0,1 F/F + uint8_t m_tf; // timer interrupt mask TF F/F + uint8_t m_int[2]; // INT0/1 pins state + uint8_t m_r[8]; // R outputs state + uint16_t m_d; // D pins state // i/o handlers devcb_read8 m_read_r0, m_read_r1, m_read_r2, m_read_r3, m_read_r4, m_read_r5, m_read_r6, m_read_r7; @@ -232,13 +232,13 @@ protected: // misc internal helpers void increment_pc(); - UINT8 ram_r(); - void ram_w(UINT8 data); + uint8_t ram_r(); + void ram_w(uint8_t data); void pop_stack(); void push_stack(); - virtual UINT8 read_r(int index); - virtual void write_r(int index, UINT8 data); + virtual uint8_t read_r(int index); + virtual void write_r(int index, uint8_t data); virtual int read_d(int index); virtual void write_d(int index, int state); @@ -349,109 +349,109 @@ protected: class hmcs43_cpu_device : public hmcs40_cpu_device { public: - hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname); + hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname); protected: // overrides - virtual UINT8 read_r(int index) override; - virtual void write_r(int index, UINT8 data) override; + virtual uint8_t read_r(int index) override; + virtual void write_r(int index, uint8_t data) override; virtual int read_d(int index) override; }; class hd38750_device : public hmcs43_cpu_device { public: - hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hd38755_device : public hmcs43_cpu_device { public: - hd38755_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd38755_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hd44750_device : public hmcs43_cpu_device { public: - hd44750_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd44750_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hd44758_device : public hmcs43_cpu_device { public: - hd44758_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd44758_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hmcs44_cpu_device : public hmcs40_cpu_device { public: - hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname); + hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname); protected: // overrides - virtual UINT8 read_r(int index) override; - virtual void write_r(int index, UINT8 data) override; + virtual uint8_t read_r(int index) override; + virtual void write_r(int index, uint8_t data) override; }; class hd38800_device : public hmcs44_cpu_device { public: - hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hd38805_device : public hmcs44_cpu_device { public: - hd38805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd38805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hd44801_device : public hmcs44_cpu_device { public: - hd44801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd44801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hd44808_device : public hmcs44_cpu_device { public: - hd44808_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd44808_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hmcs45_cpu_device : public hmcs40_cpu_device { public: - hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname); + hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint16_t polarity, const char *shortname); protected: // overrides - virtual UINT8 read_r(int index) override; - virtual void write_r(int index, UINT8 data) override; + virtual uint8_t read_r(int index) override; + virtual void write_r(int index, uint8_t data) override; }; class hd38820_device : public hmcs45_cpu_device { public: - hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hd38825_device : public hmcs45_cpu_device { public: - hd38825_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd38825_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hd44820_device : public hmcs45_cpu_device { public: - hd44820_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd44820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class hd44828_device : public hmcs45_cpu_device { public: - hd44828_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd44828_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/hmcs40/hmcs40d.cpp b/src/devices/cpu/hmcs40/hmcs40d.cpp index 1a40547ebf1..c8a3993ac9c 100644 --- a/src/devices/cpu/hmcs40/hmcs40d.cpp +++ b/src/devices/cpu/hmcs40/hmcs40d.cpp @@ -46,7 +46,7 @@ static const char *const s_mnemonics[] = }; // number of bits per opcode parameter, 99 means (XY) parameter, negative means reversed bit-order -static const INT8 s_bits[] = +static const int8_t s_bits[] = { 0, 0, 0, 0, 0, 0, 4, @@ -65,7 +65,7 @@ static const INT8 s_bits[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 s_flags[] = +static const uint32_t s_flags[] = { 0, 0, 0, 0, 0, 0, 0, @@ -82,7 +82,7 @@ static const UINT32 s_flags[] = }; // next program counter in sequence (relative) -static const INT8 s_next_pc[0x40] = +static const int8_t s_next_pc[0x40] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32+0x40 /* rollback */, @@ -91,7 +91,7 @@ static const INT8 s_next_pc[0x40] = }; -static const UINT8 hmcs40_mnemonic[0x400] = +static const uint8_t hmcs40_mnemonic[0x400] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0x000 */ @@ -186,10 +186,10 @@ static const UINT8 hmcs40_mnemonic[0x400] = CPU_DISASSEMBLE(hmcs40) { - UINT16 op = (oprom[0] | oprom[1] << 8) & 0x3ff; + uint16_t op = (oprom[0] | oprom[1] << 8) & 0x3ff; char *dst = buffer; - UINT8 instr = hmcs40_mnemonic[op]; - INT8 bits = s_bits[instr]; + uint8_t instr = hmcs40_mnemonic[op]; + int8_t bits = s_bits[instr]; // special case for (XY) opcode if (bits == 99) @@ -208,7 +208,7 @@ CPU_DISASSEMBLE(hmcs40) // opcode parameter if (bits != 0) { - UINT8 param = op; + uint8_t param = op; // reverse bits if (bits < 0) diff --git a/src/devices/cpu/hmcs40/hmcs40op.cpp b/src/devices/cpu/hmcs40/hmcs40op.cpp index 91777043553..31a74d76905 100644 --- a/src/devices/cpu/hmcs40/hmcs40op.cpp +++ b/src/devices/cpu/hmcs40/hmcs40op.cpp @@ -8,15 +8,15 @@ // internal helpers -inline UINT8 hmcs40_cpu_device::ram_r() +inline uint8_t hmcs40_cpu_device::ram_r() { - UINT8 address = (m_x << 4 | m_y) & m_datamask; + uint8_t address = (m_x << 4 | m_y) & m_datamask; return m_data->read_byte(address) & 0xf; } -inline void hmcs40_cpu_device::ram_w(UINT8 data) +inline void hmcs40_cpu_device::ram_w(uint8_t data) { - UINT8 address = (m_x << 4 | m_y) & m_datamask; + uint8_t address = (m_x << 4 | m_y) & m_datamask; m_data->write_byte(address, data & 0xf); } @@ -81,7 +81,7 @@ void hmcs40_cpu_device::op_xamr() // XAMR m: Exchange A and MR(m) // determine MR(Memory Register) location - UINT8 address = m_op & 0xf; + uint8_t address = m_op & 0xf; // HMCS42: MR0 on file 0, MR4-MR15 on file 4 (there is no file 1-3) // HMCS43: MR0-MR3 on file 0-3, MR4-MR15 on file 4 @@ -93,7 +93,7 @@ void hmcs40_cpu_device::op_xamr() address |= 0xf0; address &= m_datamask; - UINT8 old_a = m_a; + uint8_t old_a = m_a; m_a = m_data->read_byte(address) & 0xf; m_data->write_byte(address, old_a & 0xf); } @@ -160,13 +160,13 @@ void hmcs40_cpu_device::op_xsp() // XSP (XY): Exchange X and SPX, Y and SPY, or NOP if 0 if (m_op & 1) { - UINT8 old_x = m_x; + uint8_t old_x = m_x; m_x = m_spx; m_spx = old_x; } if (m_op & 2) { - UINT8 old_y = m_y; + uint8_t old_y = m_y; m_y = m_spy; m_spy = old_y; } @@ -192,7 +192,7 @@ void hmcs40_cpu_device::op_lbm() void hmcs40_cpu_device::op_xma() { // XMA (XY): Exchange Memory and A - UINT8 old_a = m_a; + uint8_t old_a = m_a; m_a = ram_r(); ram_w(old_a); op_xsp(); @@ -201,7 +201,7 @@ void hmcs40_cpu_device::op_xma() void hmcs40_cpu_device::op_xmb() { // XMB (XY): Exchange Memory and B - UINT8 old_b = m_b; + uint8_t old_b = m_b; m_b = ram_r(); ram_w(old_b); op_xsp(); @@ -357,7 +357,7 @@ void hmcs40_cpu_device::op_rotl() void hmcs40_cpu_device::op_rotr() { // ROTR: Rotate Right A with Carry - UINT8 c = m_a & 1; + uint8_t c = m_a & 1; m_a = m_a >> 1 | m_c << 3; m_c = c; } @@ -470,7 +470,7 @@ void hmcs40_cpu_device::op_lpu() void hmcs40_cpu_device::op_tbr() { // TBR p: Table Branch - UINT16 address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f); + uint16_t address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f); m_pc = address & m_pcmask; } @@ -661,8 +661,8 @@ void hmcs40_cpu_device::op_p() { // P p: Pattern Generation m_icount--; - UINT16 address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f); - UINT16 o = m_program->read_word((address & m_prgmask) << 1); + uint16_t address = m_a | m_b << 4 | m_c << 8 | (m_op & 7) << 9 | (m_pc & ~0x3f); + uint16_t o = m_program->read_word((address & m_prgmask) << 1); // destination is determined by the 2 highest bits if (o & 0x100) diff --git a/src/devices/cpu/hphybrid/hphybrid.cpp b/src/devices/cpu/hphybrid/hphybrid.cpp index 4a688ecc0d9..e2c58c86f15 100644 --- a/src/devices/cpu/hphybrid/hphybrid.cpp +++ b/src/devices/cpu/hphybrid/hphybrid.cpp @@ -140,12 +140,12 @@ WRITE_LINE_MEMBER(hp_hybrid_cpu_device::flag_w) } } -UINT8 hp_hybrid_cpu_device::pa_r(void) const +uint8_t hp_hybrid_cpu_device::pa_r(void) const { return CURRENT_PA; } -hp_hybrid_cpu_device::hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname , UINT8 addrwidth) +hp_hybrid_cpu_device::hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname , uint8_t addrwidth) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__), m_pa_changed_func(*this), m_program_config("program", ENDIANNESS_BIG, 16, addrwidth, -1), @@ -261,14 +261,14 @@ void hp_hybrid_cpu_device::execute_set_input(int inputnum, int state) * * @return Next opcode to be executed */ -UINT16 hp_hybrid_cpu_device::execute_one(UINT16 opcode) +uint16_t hp_hybrid_cpu_device::execute_one(uint16_t opcode) { if ((opcode & 0x7fe0) == 0x7000) { // EXE m_icount -= 8; // Indirect addressing in EXE instruction seems to use AEC case A instead of case C // (because it's an opcode fetch) - UINT16 reg = RM(opcode & 0x1f); + uint16_t reg = RM(opcode & 0x1f); if (BIT(opcode , 15)) { m_icount -= 6; return RM(add_mae(AEC_CASE_A , reg)); @@ -288,10 +288,10 @@ UINT16 hp_hybrid_cpu_device::execute_one(UINT16 opcode) * * @return new value of P register */ -UINT16 hp_hybrid_cpu_device::execute_one_sub(UINT16 opcode) +uint16_t hp_hybrid_cpu_device::execute_one_sub(uint16_t opcode) { - UINT32 ea; - UINT16 tmp; + uint32_t ea; + uint16_t tmp; switch (opcode & 0x7800) { case 0x0000: @@ -551,11 +551,11 @@ UINT16 hp_hybrid_cpu_device::execute_one_sub(UINT16 opcode) if (BIT(m_flags , HPHYBRID_IRH_SVC_BIT)) { BIT_CLR(m_flags , HPHYBRID_IRH_SVC_BIT); memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS); - m_pa_changed_func((UINT8)CURRENT_PA); + m_pa_changed_func((uint8_t)CURRENT_PA); } else if (BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) { BIT_CLR(m_flags , HPHYBRID_IRL_SVC_BIT); memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS); - m_pa_changed_func((UINT8)CURRENT_PA); + m_pa_changed_func((uint8_t)CURRENT_PA); } tmp = RM(AEC_CASE_C , m_reg_R--) + (opcode & 0x1f); BIT_CLR(m_flags, HPHYBRID_IM_BIT); @@ -675,26 +675,26 @@ void hp_hybrid_cpu_device::state_string_export(const device_state_entry &entry, } } -offs_t hp_hybrid_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hp_hybrid_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(hp_hybrid); return CPU_DISASSEMBLE_NAME(hp_hybrid)(this, buffer, pc, oprom, opram, options); } -UINT16 hp_hybrid_cpu_device::remove_mae(UINT32 addr) +uint16_t hp_hybrid_cpu_device::remove_mae(uint32_t addr) { - return (UINT16)(addr & 0xffff); + return (uint16_t)(addr & 0xffff); } -UINT16 hp_hybrid_cpu_device::RM(aec_cases_t aec_case , UINT16 addr) +uint16_t hp_hybrid_cpu_device::RM(aec_cases_t aec_case , uint16_t addr) { return RM(add_mae(aec_case , addr)); } -UINT16 hp_hybrid_cpu_device::RM(UINT32 addr) +uint16_t hp_hybrid_cpu_device::RM(uint32_t addr) { - UINT16 tmp; - UINT16 addr_wo_bsc = remove_mae(addr); + uint16_t tmp; + uint16_t addr_wo_bsc = remove_mae(addr); if (addr_wo_bsc <= HP_REG_LAST_ADDR) { // Any access to internal registers removes forcing of BSC 2x @@ -759,14 +759,14 @@ UINT16 hp_hybrid_cpu_device::RM(UINT32 addr) } } -void hp_hybrid_cpu_device::WM(aec_cases_t aec_case , UINT16 addr , UINT16 v) +void hp_hybrid_cpu_device::WM(aec_cases_t aec_case , uint16_t addr , uint16_t v) { WM(add_mae(aec_case , addr) , v); } -void hp_hybrid_cpu_device::WM(UINT32 addr , UINT16 v) +void hp_hybrid_cpu_device::WM(uint32_t addr , uint16_t v) { - UINT16 addr_wo_bsc = remove_mae(addr); + uint16_t addr_wo_bsc = remove_mae(addr); if (addr_wo_bsc <= HP_REG_LAST_ADDR) { // Any access to internal registers removes forcing of BSC 2x @@ -803,7 +803,7 @@ void hp_hybrid_cpu_device::WM(UINT32 addr , UINT16 v) case HP_REG_PA_ADDR: CURRENT_PA = v & HP_REG_PA_MASK; - m_pa_changed_func((UINT8)CURRENT_PA); + m_pa_changed_func((uint8_t)CURRENT_PA); break; case HP_REG_W_ADDR: @@ -839,16 +839,16 @@ void hp_hybrid_cpu_device::WM(UINT32 addr , UINT16 v) } } -UINT16 hp_hybrid_cpu_device::fetch(void) +uint16_t hp_hybrid_cpu_device::fetch(void) { m_genpc = add_mae(AEC_CASE_A , m_reg_P); return RM(m_genpc); } -UINT32 hp_hybrid_cpu_device::get_ea(UINT16 opcode) +uint32_t hp_hybrid_cpu_device::get_ea(uint16_t opcode) { - UINT16 base; - UINT16 off; + uint16_t base; + uint16_t off; aec_cases_t aec; if (BIT(opcode , 10)) { @@ -878,9 +878,9 @@ UINT32 hp_hybrid_cpu_device::get_ea(UINT16 opcode) } } -void hp_hybrid_cpu_device::do_add(UINT16& addend1 , UINT16 addend2) +void hp_hybrid_cpu_device::do_add(uint16_t& addend1 , uint16_t addend2) { - UINT32 tmp = addend1 + addend2; + uint32_t tmp = addend1 + addend2; if (BIT(tmp , 16)) { // Carry @@ -892,15 +892,15 @@ void hp_hybrid_cpu_device::do_add(UINT16& addend1 , UINT16 addend2) BIT_SET(m_flags , HPHYBRID_O_BIT); } - addend1 = (UINT16)tmp; + addend1 = (uint16_t)tmp; } -UINT16 hp_hybrid_cpu_device::get_skip_addr(UINT16 opcode , bool condition) const +uint16_t hp_hybrid_cpu_device::get_skip_addr(uint16_t opcode , bool condition) const { bool skip_val = BIT(opcode , 8) != 0; if (condition == skip_val) { - UINT16 off = opcode & 0x1f; + uint16_t off = opcode & 0x1f; if (BIT(opcode , 5)) { off -= 0x20; @@ -911,7 +911,7 @@ UINT16 hp_hybrid_cpu_device::get_skip_addr(UINT16 opcode , bool condition) const } } -UINT16 hp_hybrid_cpu_device::get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n) +uint16_t hp_hybrid_cpu_device::get_skip_addr_sc(uint16_t opcode , uint16_t& v , unsigned n) { bool val = BIT(v , n); @@ -926,7 +926,7 @@ UINT16 hp_hybrid_cpu_device::get_skip_addr_sc(UINT16 opcode , UINT16& v , unsign return get_skip_addr(opcode , val); } -UINT16 hp_hybrid_cpu_device::get_skip_addr_sc(UINT16 opcode , UINT32& v , unsigned n) +uint16_t hp_hybrid_cpu_device::get_skip_addr_sc(uint16_t opcode , uint32_t& v , unsigned n) { bool val = BIT(v , n); @@ -941,12 +941,12 @@ UINT16 hp_hybrid_cpu_device::get_skip_addr_sc(UINT16 opcode , UINT32& v , unsign return get_skip_addr(opcode , val); } -void hp_hybrid_cpu_device::do_pw(UINT16 opcode) +void hp_hybrid_cpu_device::do_pw(uint16_t opcode) { - UINT16 tmp; - UINT16 reg_addr = opcode & 7; - UINT16 *ptr_reg; - UINT16 b_mask; + uint16_t tmp; + uint16_t reg_addr = opcode & 7; + uint16_t *ptr_reg; + uint16_t b_mask; if (BIT(opcode , 3)) { ptr_reg = &m_reg_D; @@ -960,11 +960,11 @@ void hp_hybrid_cpu_device::do_pw(UINT16 opcode) // Withdraw if (BIT(opcode , 11)) { // Byte - UINT32 tmp_addr = (UINT32)(*ptr_reg); + uint32_t tmp_addr = (uint32_t)(*ptr_reg); if (m_flags & b_mask) { tmp_addr |= 0x10000; } - tmp = RM(AEC_CASE_C , (UINT16)(tmp_addr >> 1)); + tmp = RM(AEC_CASE_C , (uint16_t)(tmp_addr >> 1)); if (BIT(tmp_addr , 0)) { tmp &= 0xff; } else { @@ -1003,7 +1003,7 @@ void hp_hybrid_cpu_device::do_pw(UINT16 opcode) tmp = RM(reg_addr); if (BIT(opcode , 11)) { // Byte - UINT32 tmp_addr = (UINT32)(*ptr_reg); + uint32_t tmp_addr = (uint32_t)(*ptr_reg); if (m_flags & b_mask) { tmp_addr |= 0x10000; } @@ -1021,7 +1021,7 @@ void hp_hybrid_cpu_device::do_pw(UINT16 opcode) } else { // Extend address, preserve LSB & form byte address tmp_addr = (add_mae(AEC_CASE_C , tmp_addr >> 1) << 1) | (tmp_addr & 1); - m_program->write_byte(tmp_addr , (UINT8)tmp); + m_program->write_byte(tmp_addr , (uint8_t)tmp); } } else { // Word @@ -1054,8 +1054,8 @@ void hp_hybrid_cpu_device::check_for_interrupts(void) } // Get interrupt vector in low byte - UINT8 vector = (UINT8)standard_irq_callback(irqline); - UINT8 new_PA; + uint8_t vector = (uint8_t)standard_irq_callback(irqline); + uint8_t new_PA; // Get highest numbered 1 // Don't know what happens if vector is 0, here we assume bit 7 = 1 @@ -1074,7 +1074,7 @@ void hp_hybrid_cpu_device::check_for_interrupts(void) CURRENT_PA = new_PA; - m_pa_changed_func((UINT8)CURRENT_PA); + m_pa_changed_func((uint8_t)CURRENT_PA); // Is this correct? Patent @ pg 210 suggests that the whole interrupt recognition sequence // lasts for 32 cycles @@ -1098,7 +1098,7 @@ void hp_hybrid_cpu_device::handle_dma(void) { // Patent hints at the fact that terminal count is detected by bit 15 of dmac being 1 after decrementing bool tc = BIT(--m_dmac , 15) != 0; - UINT16 tmp; + uint16_t tmp; if (BIT(m_flags , HPHYBRID_DMADIR_BIT)) { // "Outward" DMA: memory -> peripheral @@ -1115,17 +1115,17 @@ void hp_hybrid_cpu_device::handle_dma(void) // Mystery solved: DMA is not automatically disabled at TC (test of 9845's graphic memory relies on this to work) } -UINT16 hp_hybrid_cpu_device::RIO(UINT8 pa , UINT8 ic) +uint16_t hp_hybrid_cpu_device::RIO(uint8_t pa , uint8_t ic) { return m_io->read_word(HP_MAKE_IOADDR(pa, ic) << 1); } -void hp_hybrid_cpu_device::WIO(UINT8 pa , UINT8 ic , UINT16 v) +void hp_hybrid_cpu_device::WIO(uint8_t pa , uint8_t ic , uint16_t v) { m_io->write_word(HP_MAKE_IOADDR(pa, ic) << 1 , v); } -hp_5061_3001_cpu_device::hp_5061_3001_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hp_5061_3001_cpu_device::hp_5061_3001_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hp_hybrid_cpu_device(mconfig, HP_5061_3001, "HP-5061-3001", tag, owner, clock, "5061-3001", 22), m_boot_mode(false) { @@ -1187,77 +1187,77 @@ void hp_5061_3001_cpu_device::device_reset() hp_hybrid_cpu_device::device_reset(); } -UINT8 hp_5061_3001_cpu_device::do_dec_shift_r(UINT8 d1 , UINT64& mantissa) +uint8_t hp_5061_3001_cpu_device::do_dec_shift_r(uint8_t d1 , uint64_t& mantissa) { - UINT8 d12 = (UINT8)(mantissa & 0xf); + uint8_t d12 = (uint8_t)(mantissa & 0xf); - mantissa = (mantissa >> 4) | ((UINT64)d1 << 44); + mantissa = (mantissa >> 4) | ((uint64_t)d1 << 44); return d12; } -UINT8 hp_5061_3001_cpu_device::do_dec_shift_l(UINT8 d12 , UINT64& mantissa) +uint8_t hp_5061_3001_cpu_device::do_dec_shift_l(uint8_t d12 , uint64_t& mantissa) { - UINT8 d1 = (UINT8)((mantissa >> 44) & 0xf); + uint8_t d1 = (uint8_t)((mantissa >> 44) & 0xf); - mantissa = (mantissa << 4) | ((UINT64)d12); + mantissa = (mantissa << 4) | ((uint64_t)d12); mantissa &= 0xffffffffffffULL; return d1; } -UINT64 hp_5061_3001_cpu_device::get_ar1(void) +uint64_t hp_5061_3001_cpu_device::get_ar1(void) { - UINT32 addr; - UINT64 tmp; + uint32_t addr; + uint64_t tmp; addr = add_mae(AEC_CASE_B , HP_REG_AR1_ADDR + 1); - tmp = (UINT64)RM(addr++); + tmp = (uint64_t)RM(addr++); tmp <<= 16; - tmp |= (UINT64)RM(addr++); + tmp |= (uint64_t)RM(addr++); tmp <<= 16; - tmp |= (UINT64)RM(addr); + tmp |= (uint64_t)RM(addr); return tmp; } -void hp_5061_3001_cpu_device::set_ar1(UINT64 v) +void hp_5061_3001_cpu_device::set_ar1(uint64_t v) { - UINT32 addr; + uint32_t addr; addr = add_mae(AEC_CASE_B , HP_REG_AR1_ADDR + 3); - WM(addr-- , (UINT16)(v & 0xffff)); + WM(addr-- , (uint16_t)(v & 0xffff)); v >>= 16; - WM(addr-- , (UINT16)(v & 0xffff)); + WM(addr-- , (uint16_t)(v & 0xffff)); v >>= 16; - WM(addr , (UINT16)(v & 0xffff)); + WM(addr , (uint16_t)(v & 0xffff)); } -UINT64 hp_5061_3001_cpu_device::get_ar2(void) const +uint64_t hp_5061_3001_cpu_device::get_ar2(void) const { - UINT64 tmp; + uint64_t tmp; - tmp = (UINT64)m_reg_ar2[ 1 ]; + tmp = (uint64_t)m_reg_ar2[ 1 ]; tmp <<= 16; - tmp |= (UINT64)m_reg_ar2[ 2 ]; + tmp |= (uint64_t)m_reg_ar2[ 2 ]; tmp <<= 16; - tmp |= (UINT64)m_reg_ar2[ 3 ]; + tmp |= (uint64_t)m_reg_ar2[ 3 ]; return tmp; } -void hp_5061_3001_cpu_device::set_ar2(UINT64 v) +void hp_5061_3001_cpu_device::set_ar2(uint64_t v) { - m_reg_ar2[ 3 ] = (UINT16)(v & 0xffff); + m_reg_ar2[ 3 ] = (uint16_t)(v & 0xffff); v >>= 16; - m_reg_ar2[ 2 ] = (UINT16)(v & 0xffff); + m_reg_ar2[ 2 ] = (uint16_t)(v & 0xffff); v >>= 16; - m_reg_ar2[ 1 ] = (UINT16)(v & 0xffff); + m_reg_ar2[ 1 ] = (uint16_t)(v & 0xffff); } -UINT64 hp_5061_3001_cpu_device::do_mrxy(UINT64 ar) +uint64_t hp_5061_3001_cpu_device::do_mrxy(uint64_t ar) { - UINT8 n; + uint8_t n; n = m_reg_B & 0xf; m_reg_A &= 0xf; @@ -1273,15 +1273,15 @@ UINT64 hp_5061_3001_cpu_device::do_mrxy(UINT64 ar) return ar; } -bool hp_5061_3001_cpu_device::do_dec_add(bool carry_in , UINT64& a , UINT64 b) +bool hp_5061_3001_cpu_device::do_dec_add(bool carry_in , uint64_t& a , uint64_t b) { - UINT64 tmp = 0; + uint64_t tmp = 0; unsigned i; - UINT8 digit_a , digit_b; + uint8_t digit_a , digit_b; for (i = 0; i < 12; i++) { - digit_a = (UINT8)(a & 0xf); - digit_b = (UINT8)(b & 0xf); + digit_a = (uint8_t)(a & 0xf); + digit_b = (uint8_t)(b & 0xf); if (carry_in) { digit_a++; @@ -1295,7 +1295,7 @@ bool hp_5061_3001_cpu_device::do_dec_add(bool carry_in , UINT64& a , UINT64 b) digit_a = (digit_a - 10) & 0xf; } - tmp |= (UINT64)digit_a << (4 * i); + tmp |= (uint64_t)digit_a << (4 * i); a >>= 4; b >>= 4; @@ -1308,25 +1308,25 @@ bool hp_5061_3001_cpu_device::do_dec_add(bool carry_in , UINT64& a , UINT64 b) void hp_5061_3001_cpu_device::do_mpy(void) { - INT32 a = (INT16)m_reg_A; - INT32 b = (INT16)m_reg_B; - INT32 p = a * b; + int32_t a = (int16_t)m_reg_A; + int32_t b = (int16_t)m_reg_B; + int32_t p = a * b; - m_reg_A = (UINT16)(p & 0xffff); - m_reg_B = (UINT16)((p >> 16) & 0xffff); + m_reg_A = (uint16_t)(p & 0xffff); + m_reg_B = (uint16_t)((p >> 16) & 0xffff); // Not entirely correct, timing depends on initial content of A register m_icount -= 65; } -UINT16 hp_5061_3001_cpu_device::execute_no_bpc_ioc(UINT16 opcode) +uint16_t hp_5061_3001_cpu_device::execute_no_bpc_ioc(uint16_t opcode) { // EMC instructions - UINT8 n; - UINT16 tmp1; - UINT16 tmp2; - UINT64 tmp_ar; - UINT64 tmp_ar2; + uint8_t n; + uint16_t tmp1; + uint16_t tmp2; + uint64_t tmp_ar; + uint64_t tmp_ar2; bool carry; switch (opcode & 0xfff0) { @@ -1536,15 +1536,15 @@ UINT16 hp_5061_3001_cpu_device::execute_no_bpc_ioc(UINT16 opcode) return m_reg_P + 1; } -offs_t hp_5061_3001_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hp_5061_3001_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(hp_5061_3001); return CPU_DISASSEMBLE_NAME(hp_5061_3001)(this, buffer, pc, oprom, opram, options); } -UINT32 hp_5061_3001_cpu_device::add_mae(aec_cases_t aec_case , UINT16 addr) +uint32_t hp_5061_3001_cpu_device::add_mae(aec_cases_t aec_case , uint16_t addr) { - UINT16 bsc_reg; + uint16_t bsc_reg; bool top_half = BIT(addr , 15) != 0; // Detect accesses to top half of base page @@ -1603,16 +1603,16 @@ UINT32 hp_5061_3001_cpu_device::add_mae(aec_cases_t aec_case , UINT16 addr) return 0; } - UINT16 aec_reg = bsc_reg & BSC_REG_MASK; + uint16_t aec_reg = bsc_reg & BSC_REG_MASK; if (m_forced_bsc_25) { aec_reg = (aec_reg & 0xf) | 0x20; } - return (UINT32)addr | ((UINT32)aec_reg << 16); + return (uint32_t)addr | ((uint32_t)aec_reg << 16); } -UINT16 hp_5061_3001_cpu_device::read_non_common_reg(UINT16 addr) +uint16_t hp_5061_3001_cpu_device::read_non_common_reg(uint16_t addr) { switch (addr) { case HP_REG_AR2_ADDR: @@ -1646,7 +1646,7 @@ UINT16 hp_5061_3001_cpu_device::read_non_common_reg(UINT16 addr) } } -void hp_5061_3001_cpu_device::write_non_common_reg(UINT16 addr , UINT16 v) +void hp_5061_3001_cpu_device::write_non_common_reg(uint16_t addr , uint16_t v) { switch (addr) { case HP_REG_AR2_ADDR: @@ -1692,12 +1692,12 @@ void hp_5061_3001_cpu_device::enter_isr(void) BIT_SET(m_flags, HPHYBRID_IM_BIT); } -hp_5061_3011_cpu_device::hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hp_5061_3011_cpu_device::hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hp_hybrid_cpu_device(mconfig, HP_5061_3011, "HP-5061-3011", tag, owner, clock, "5061-3011", 16) { } -UINT16 hp_5061_3011_cpu_device::execute_no_bpc_ioc(UINT16 opcode) +uint16_t hp_5061_3011_cpu_device::execute_no_bpc_ioc(uint16_t opcode) { // Unrecognized instructions: NOP // Execution time is fictional @@ -1706,19 +1706,19 @@ UINT16 hp_5061_3011_cpu_device::execute_no_bpc_ioc(UINT16 opcode) return m_reg_P + 1; } -UINT32 hp_5061_3011_cpu_device::add_mae(aec_cases_t aec_case , UINT16 addr) +uint32_t hp_5061_3011_cpu_device::add_mae(aec_cases_t aec_case , uint16_t addr) { // No MAE on 3011 return addr; } -UINT16 hp_5061_3011_cpu_device::read_non_common_reg(UINT16 addr) +uint16_t hp_5061_3011_cpu_device::read_non_common_reg(uint16_t addr) { // Non-existing registers are returned as 0 return 0; } -void hp_5061_3011_cpu_device::write_non_common_reg(UINT16 addr , UINT16 v) +void hp_5061_3011_cpu_device::write_non_common_reg(uint16_t addr , uint16_t v) { // Non-existing registers are silently discarded } diff --git a/src/devices/cpu/hphybrid/hphybrid.h b/src/devices/cpu/hphybrid/hphybrid.h index 43ce4533694..2ec2124567c 100644 --- a/src/devices/cpu/hphybrid/hphybrid.h +++ b/src/devices/cpu/hphybrid/hphybrid.h @@ -87,28 +87,28 @@ public: DECLARE_WRITE_LINE_MEMBER(status_w); DECLARE_WRITE_LINE_MEMBER(flag_w); - UINT8 pa_r(void) const; + uint8_t pa_r(void) const; template static devcb_base &set_pa_changed_func(device_t &device, _Object object) { return downcast(device).m_pa_changed_func.set_callback(object); } protected: - hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname , UINT8 addrwidth); + hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname , uint8_t addrwidth); // device-level overrides virtual void device_start() override; virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 6; } - virtual UINT32 execute_input_lines() const override { return 2; } - virtual UINT32 execute_default_irq_vector() const override { return 0xffff; } + virtual uint32_t execute_min_cycles() const override { return 6; } + virtual uint32_t execute_input_lines() const override { return 2; } + virtual uint32_t execute_default_irq_vector() const override { return 0xffff; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - UINT16 execute_one(UINT16 opcode); - UINT16 execute_one_sub(UINT16 opcode); + uint16_t execute_one(uint16_t opcode); + uint16_t execute_one_sub(uint16_t opcode); // Execute an instruction that doesn't belong to either BPC or IOC - virtual UINT16 execute_no_bpc_ioc(UINT16 opcode) = 0; + virtual uint16_t execute_no_bpc_ioc(uint16_t opcode) = 0; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : nullptr ); } @@ -117,9 +117,9 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // Different cases of memory access // See patent @ pg 361 @@ -131,21 +131,21 @@ protected: } aec_cases_t; // do memory address extension - virtual UINT32 add_mae(aec_cases_t aec_case , UINT16 addr) = 0; + virtual uint32_t add_mae(aec_cases_t aec_case , uint16_t addr) = 0; - UINT16 remove_mae(UINT32 addr); + uint16_t remove_mae(uint32_t addr); - UINT16 RM(aec_cases_t aec_case , UINT16 addr); - UINT16 RM(UINT32 addr); - virtual UINT16 read_non_common_reg(UINT16 addr) = 0; + uint16_t RM(aec_cases_t aec_case , uint16_t addr); + uint16_t RM(uint32_t addr); + virtual uint16_t read_non_common_reg(uint16_t addr) = 0; - void WM(aec_cases_t aec_case , UINT16 addr , UINT16 v); - void WM(UINT32 addr , UINT16 v); - virtual void write_non_common_reg(UINT16 addr , UINT16 v) = 0; + void WM(aec_cases_t aec_case , uint16_t addr , uint16_t v); + void WM(uint32_t addr , uint16_t v); + virtual void write_non_common_reg(uint16_t addr , uint16_t v) = 0; - UINT16 fetch(void); + uint16_t fetch(void); - UINT16 get_skip_addr(UINT16 opcode , bool condition) const; + uint16_t get_skip_addr(uint16_t opcode , bool condition) const; devcb_write8 m_pa_changed_func; @@ -153,21 +153,21 @@ protected: bool m_forced_bsc_25; // State of processor - UINT16 m_reg_A; // Register A - UINT16 m_reg_B; // Register B - UINT16 m_reg_P; // Register P - UINT16 m_reg_R; // Register R - UINT16 m_reg_C; // Register C - UINT16 m_reg_D; // Register D - UINT16 m_reg_IV; // Register IV - UINT16 m_reg_W; // Register W - UINT8 m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long) - UINT32 m_flags; // Flags - UINT8 m_dmapa; // DMA peripheral address (4 bits) - UINT16 m_dmama; // DMA address - UINT16 m_dmac; // DMA counter - UINT16 m_reg_I; // Instruction register - UINT32 m_genpc; // Full PC + uint16_t m_reg_A; // Register A + uint16_t m_reg_B; // Register B + uint16_t m_reg_P; // Register P + uint16_t m_reg_R; // Register R + uint16_t m_reg_C; // Register C + uint16_t m_reg_D; // Register D + uint16_t m_reg_IV; // Register IV + uint16_t m_reg_W; // Register W + uint8_t m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long) + uint32_t m_flags; // Flags + uint8_t m_dmapa; // DMA peripheral address (4 bits) + uint16_t m_dmama; // DMA address + uint16_t m_dmac; // DMA counter + uint16_t m_reg_I; // Instruction register + uint32_t m_genpc; // Full PC private: address_space_config m_program_config; @@ -177,57 +177,57 @@ private: direct_read_data *m_direct; address_space *m_io; - UINT32 get_ea(UINT16 opcode); - void do_add(UINT16& addend1 , UINT16 addend2); - UINT16 get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n); - UINT16 get_skip_addr_sc(UINT16 opcode , UINT32& v , unsigned n); - void do_pw(UINT16 opcode); + uint32_t get_ea(uint16_t opcode); + void do_add(uint16_t& addend1 , uint16_t addend2); + uint16_t get_skip_addr_sc(uint16_t opcode , uint16_t& v , unsigned n); + uint16_t get_skip_addr_sc(uint16_t opcode , uint32_t& v , unsigned n); + void do_pw(uint16_t opcode); void check_for_interrupts(void); virtual void enter_isr(void); void handle_dma(void); - UINT16 RIO(UINT8 pa , UINT8 ic); - void WIO(UINT8 pa , UINT8 ic , UINT16 v); + uint16_t RIO(uint8_t pa , uint8_t ic); + void WIO(uint8_t pa , uint8_t ic , uint16_t v); }; class hp_5061_3001_cpu_device : public hp_hybrid_cpu_device { public: - hp_5061_3001_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hp_5061_3001_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_boot_mode_static(device_t &device, bool mode) { downcast(device).m_boot_mode = mode; } protected: virtual void device_start() override; virtual void device_reset() override; - virtual UINT32 execute_max_cycles() const override { return 237; } // FMP 15 - - static UINT8 do_dec_shift_r(UINT8 d1 , UINT64& mantissa); - static UINT8 do_dec_shift_l(UINT8 d12 , UINT64& mantissa); - UINT64 get_ar1(void); - void set_ar1(UINT64 v); - UINT64 get_ar2(void) const; - void set_ar2(UINT64 v); - UINT64 do_mrxy(UINT64 ar); - bool do_dec_add(bool carry_in , UINT64& a , UINT64 b); + virtual uint32_t execute_max_cycles() const override { return 237; } // FMP 15 + + static uint8_t do_dec_shift_r(uint8_t d1 , uint64_t& mantissa); + static uint8_t do_dec_shift_l(uint8_t d12 , uint64_t& mantissa); + uint64_t get_ar1(void); + void set_ar1(uint64_t v); + uint64_t get_ar2(void) const; + void set_ar2(uint64_t v); + uint64_t do_mrxy(uint64_t ar); + bool do_dec_add(bool carry_in , uint64_t& a , uint64_t b); void do_mpy(void); - virtual UINT16 execute_no_bpc_ioc(UINT16 opcode) override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; - virtual UINT32 add_mae(aec_cases_t aec_case , UINT16 addr) override; - virtual UINT16 read_non_common_reg(UINT16 addr) override; - virtual void write_non_common_reg(UINT16 addr , UINT16 v) override; + virtual uint16_t execute_no_bpc_ioc(uint16_t opcode) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; + virtual uint32_t add_mae(aec_cases_t aec_case , uint16_t addr) override; + virtual uint16_t read_non_common_reg(uint16_t addr) override; + virtual void write_non_common_reg(uint16_t addr , uint16_t v) override; private: bool m_boot_mode; // Additional state of processor - UINT16 m_reg_ar2[ 4 ]; // AR2 register - UINT16 m_reg_se; // SE register (4 bits) - UINT16 m_reg_r25; // R25 register - UINT16 m_reg_r26; // R26 register - UINT16 m_reg_r27; // R27 register - UINT16 m_reg_aec[ HP_REG_R37_ADDR - HP_REG_R32_ADDR + 1 ]; // AEC registers R32-R37 + uint16_t m_reg_ar2[ 4 ]; // AR2 register + uint16_t m_reg_se; // SE register (4 bits) + uint16_t m_reg_r25; // R25 register + uint16_t m_reg_r26; // R26 register + uint16_t m_reg_r27; // R27 register + uint16_t m_reg_aec[ HP_REG_R37_ADDR - HP_REG_R32_ADDR + 1 ]; // AEC registers R32-R37 virtual void enter_isr(void) override; }; @@ -235,14 +235,14 @@ private: class hp_5061_3011_cpu_device : public hp_hybrid_cpu_device { public: - hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual UINT32 execute_max_cycles() const override { return 25; } - virtual UINT16 execute_no_bpc_ioc(UINT16 opcode) override; - virtual UINT32 add_mae(aec_cases_t aec_case , UINT16 addr) override; - virtual UINT16 read_non_common_reg(UINT16 addr) override; - virtual void write_non_common_reg(UINT16 addr , UINT16 v) override; + virtual uint32_t execute_max_cycles() const override { return 25; } + virtual uint16_t execute_no_bpc_ioc(uint16_t opcode) override; + virtual uint32_t add_mae(aec_cases_t aec_case , uint16_t addr) override; + virtual uint16_t read_non_common_reg(uint16_t addr) override; + virtual void write_non_common_reg(uint16_t addr , uint16_t v) override; }; diff --git a/src/devices/cpu/hphybrid/hphybrid_dasm.cpp b/src/devices/cpu/hphybrid/hphybrid_dasm.cpp index 869cbb0f32b..c656cc29c65 100644 --- a/src/devices/cpu/hphybrid/hphybrid_dasm.cpp +++ b/src/devices/cpu/hphybrid/hphybrid_dasm.cpp @@ -8,17 +8,17 @@ #include "debugger.h" #include "hphybrid.h" -typedef void (*fn_dis_param)(char *buffer , offs_t pc , UINT16 opcode , bool is_3001); +typedef void (*fn_dis_param)(char *buffer , offs_t pc , uint16_t opcode , bool is_3001); typedef struct { - UINT16 m_op_mask; - UINT16 m_opcode; + uint16_t m_op_mask; + uint16_t m_opcode; const char *m_mnemonic; fn_dis_param m_param_fn; - UINT32 m_dasm_flags; + uint32_t m_dasm_flags; } dis_entry_t; -static void addr_2_str(char *buffer , UINT16 addr , bool indirect , bool is_3001) +static void addr_2_str(char *buffer , uint16_t addr , bool indirect , bool is_3001) { char *s = buffer + strlen(buffer); @@ -167,14 +167,14 @@ static void addr_2_str(char *buffer , UINT16 addr , bool indirect , bool is_3001 } } -static void param_none(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) +static void param_none(char *buffer , offs_t pc , uint16_t opcode , bool is_3001) { } -static void param_loc(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) +static void param_loc(char *buffer , offs_t pc , uint16_t opcode , bool is_3001) { - UINT16 base; - UINT16 off; + uint16_t base; + uint16_t off; if (opcode & 0x0400) { // Current page @@ -192,21 +192,21 @@ static void param_loc(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) addr_2_str(buffer , base + off , (opcode & 0x8000) != 0 , is_3001); } -static void param_addr32(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) +static void param_addr32(char *buffer , offs_t pc , uint16_t opcode , bool is_3001) { addr_2_str(buffer , opcode & 0x1f , (opcode & 0x8000) != 0 , is_3001); } -static void param_skip(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) +static void param_skip(char *buffer , offs_t pc , uint16_t opcode , bool is_3001) { - UINT16 off = opcode & 0x3f; + uint16_t off = opcode & 0x3f; if (off & 0x20) { off -= 0x40; } addr_2_str(buffer , pc + off , false , is_3001); } -static void param_skip_sc(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) +static void param_skip_sc(char *buffer , offs_t pc , uint16_t opcode , bool is_3001) { param_skip(buffer, pc, opcode , is_3001); @@ -219,7 +219,7 @@ static void param_skip_sc(char *buffer , offs_t pc , UINT16 opcode , bool is_300 } } -static void param_ret(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) +static void param_ret(char *buffer , offs_t pc , uint16_t opcode , bool is_3001) { char *s = buffer + strlen(buffer); @@ -235,14 +235,14 @@ static void param_ret(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) } } -static void param_n16(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) +static void param_n16(char *buffer , offs_t pc , uint16_t opcode , bool is_3001) { char *s = buffer + strlen(buffer); sprintf(s , "%u" , (opcode & 0xf) + 1); } -static void param_reg_id(char *buffer , offs_t pc , UINT16 opcode , bool is_3001) +static void param_reg_id(char *buffer , offs_t pc , uint16_t opcode , bool is_3001) { addr_2_str(buffer, opcode & 7, false , is_3001); @@ -362,7 +362,7 @@ static const dis_entry_t dis_table_emc[] = { {0 , 0 , nullptr , nullptr , 0 } }; -static offs_t disassemble_table(UINT16 opcode , offs_t pc , const dis_entry_t *table , bool is_3001 , char *buffer) +static offs_t disassemble_table(uint16_t opcode , offs_t pc , const dis_entry_t *table , bool is_3001 , char *buffer) { const dis_entry_t *p; @@ -380,7 +380,7 @@ static offs_t disassemble_table(UINT16 opcode , offs_t pc , const dis_entry_t *t CPU_DISASSEMBLE(hp_hybrid) { - UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ]; + uint16_t opcode = ((uint16_t)oprom[ 0 ] << 8) | oprom[ 1 ]; offs_t res; res = disassemble_table(opcode , pc , dis_table , false , buffer); @@ -396,7 +396,7 @@ CPU_DISASSEMBLE(hp_hybrid) CPU_DISASSEMBLE(hp_5061_3001) { - UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ]; + uint16_t opcode = ((uint16_t)oprom[ 0 ] << 8) | oprom[ 1 ]; offs_t res; res = disassemble_table(opcode , pc , dis_table_emc , true , buffer); diff --git a/src/devices/cpu/i386/cycles.h b/src/devices/cpu/i386/cycles.h index 62b6da2a80a..b6399706858 100644 --- a/src/devices/cpu/i386/cycles.h +++ b/src/devices/cpu/i386/cycles.h @@ -342,7 +342,7 @@ enum X86_CYCLES struct X86_CYCLE_TABLE { X86_CYCLES op; - UINT8 cpu_cycles[X86_NUM_CPUS][2]; + uint8_t cpu_cycles[X86_NUM_CPUS][2]; }; static const X86_CYCLE_TABLE x86_cycle_table[] = diff --git a/src/devices/cpu/i386/i386.cpp b/src/devices/cpu/i386/i386.cpp index 5c26b195bfe..e6bd927d7de 100644 --- a/src/devices/cpu/i386/i386.cpp +++ b/src/devices/cpu/i386/i386.cpp @@ -39,7 +39,7 @@ const device_type PENTIUM3 = &device_creator; const device_type PENTIUM4 = &device_creator; -i386_device::i386_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i386_device::i386_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, I386, "I386", tag, owner, clock, "i386", __FILE__) , device_vtlb_interface(mconfig, *this, AS_PROGRAM) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0) @@ -54,7 +54,7 @@ i386_device::i386_device(const machine_config &mconfig, const char *tag, device_ } -i386_device::i386_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, int program_data_width, int program_addr_width, int io_data_width) +i386_device::i386_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, int program_data_width, int program_addr_width, int io_data_width) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , device_vtlb_interface(mconfig, *this, AS_PROGRAM) , m_program_config("program", ENDIANNESS_LITTLE, program_data_width, program_addr_width, 0) @@ -68,62 +68,62 @@ i386_device::i386_device(const machine_config &mconfig, device_type type, const set_vtlb_dynamic_entries(32); } -i386SX_device::i386SX_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i386SX_device::i386SX_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i386_device(mconfig, I386SX, "I386SX", tag, owner, clock, "i386sx", __FILE__, 16, 24, 16) { } -i486_device::i486_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i486_device::i486_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i386_device(mconfig, I486, "I486", tag, owner, clock, "i486", __FILE__) { } -pentium_device::pentium_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pentium_device::pentium_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i386_device(mconfig, PENTIUM, "PENTIUM", tag, owner, clock, "pentium", __FILE__) { // 64 dtlb small, 8 dtlb large, 32 itlb set_vtlb_dynamic_entries(96); } -pentium_device::pentium_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) +pentium_device::pentium_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) : i386_device(mconfig, type, name, tag, owner, clock, shortname, source) { // 64 dtlb small, 8 dtlb large, 32 itlb set_vtlb_dynamic_entries(96); } -mediagx_device::mediagx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mediagx_device::mediagx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i386_device(mconfig, MEDIAGX, "MEDIAGX", tag, owner, clock, "mediagx", __FILE__) { } -pentium_pro_device::pentium_pro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pentium_pro_device::pentium_pro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pentium_device(mconfig, PENTIUM_PRO, "Pentium Pro", tag, owner, clock, "pentium_pro", __FILE__) { } -pentium_mmx_device::pentium_mmx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pentium_mmx_device::pentium_mmx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pentium_device(mconfig, PENTIUM_MMX, "Pentium MMX", tag, owner, clock, "pentium_mmx", __FILE__) { // 64 dtlb small, 8 dtlb large, 32 itlb small, 2 itlb large set_vtlb_dynamic_entries(96); } -pentium2_device::pentium2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pentium2_device::pentium2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pentium_device(mconfig, PENTIUM2, "Pentium II", tag, owner, clock, "pentium2", __FILE__) { // 64 dtlb small, 8 dtlb large, 32 itlb small, 2 itlb large set_vtlb_dynamic_entries(96); } -pentium3_device::pentium3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pentium3_device::pentium3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pentium_device(mconfig, PENTIUM3, "Pentium III", tag, owner, clock, "pentium3", __FILE__) { // 64 dtlb small, 8 dtlb large, 32 itlb small, 2 itlb large set_vtlb_dynamic_entries(96); } -pentium4_device::pentium4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pentium4_device::pentium4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pentium_device(mconfig, PENTIUM4, "Pentium 4", tag, owner, clock, "pentium4", __FILE__) { // 128 dtlb, 64 itlb @@ -139,10 +139,10 @@ MODRM_TABLE i386_MODRM_table[256]; /*************************************************************************/ -UINT32 i386_device::i386_load_protected_mode_segment(I386_SREG *seg, UINT64 *desc ) +uint32_t i386_device::i386_load_protected_mode_segment(I386_SREG *seg, uint64_t *desc ) { - UINT32 v1,v2; - UINT32 base, limit; + uint32_t v1,v2; + uint32_t base, limit; int entry; if(!seg->selector) @@ -180,14 +180,14 @@ UINT32 i386_device::i386_load_protected_mode_segment(I386_SREG *seg, UINT64 *des seg->valid = true; if(desc) - *desc = ((UINT64)v2<<32)|v1; + *desc = ((uint64_t)v2<<32)|v1; return 1; } void i386_device::i386_load_call_gate(I386_CALL_GATE *gate) { - UINT32 v1,v2; - UINT32 base,limit; + uint32_t v1,v2; + uint32_t base,limit; int entry; if ( gate->segment & 0x4 ) @@ -215,11 +215,11 @@ void i386_device::i386_load_call_gate(I386_CALL_GATE *gate) gate->dpl = (gate->ar >> 5) & 0x03; } -void i386_device::i386_set_descriptor_accessed(UINT16 selector) +void i386_device::i386_set_descriptor_accessed(uint16_t selector) { // assume the selector is valid, we don't need to check it again - UINT32 base, addr; - UINT8 rights; + uint32_t base, addr; + uint8_t rights; if(!(selector & ~3)) return; @@ -266,9 +266,9 @@ void i386_device::i386_load_segment_descriptor(int segment ) } /* Retrieves the stack selector located in the current TSS */ -UINT32 i386_device::i386_get_stack_segment(UINT8 privilege) +uint32_t i386_device::i386_get_stack_segment(uint8_t privilege) { - UINT32 ret; + uint32_t ret; if(privilege >= 3) return 0; @@ -281,9 +281,9 @@ UINT32 i386_device::i386_get_stack_segment(UINT8 privilege) } /* Retrieves the stack pointer located in the current TSS */ -UINT32 i386_device::i386_get_stack_ptr(UINT8 privilege) +uint32_t i386_device::i386_get_stack_ptr(uint8_t privilege) { - UINT32 ret; + uint32_t ret; if(privilege >= 3) return 0; @@ -295,9 +295,9 @@ UINT32 i386_device::i386_get_stack_ptr(UINT8 privilege) return ret; } -UINT32 i386_device::get_flags() const +uint32_t i386_device::get_flags() const { - UINT32 f = 0x2; + uint32_t f = 0x2; f |= m_CF; f |= m_PF << 2; f |= m_AF << 4; @@ -319,7 +319,7 @@ UINT32 i386_device::get_flags() const return (m_eflags & ~m_eflags_mask) | (f & m_eflags_mask); } -void i386_device::set_flags(UINT32 f ) +void i386_device::set_flags(uint32_t f ) { m_CF = (f & 0x1) ? 1 : 0; m_PF = (f & 0x4) ? 1 : 0; @@ -342,12 +342,12 @@ void i386_device::set_flags(UINT32 f ) m_eflags = f & m_eflags_mask; } -void i386_device::sib_byte(UINT8 mod, UINT32* out_ea, UINT8* out_segment) +void i386_device::sib_byte(uint8_t mod, uint32_t* out_ea, uint8_t* out_segment) { - UINT32 ea = 0; - UINT8 segment = 0; - UINT8 scale, i, base; - UINT8 sib = FETCH(); + uint32_t ea = 0; + uint8_t segment = 0; + uint8_t scale, i, base; + uint8_t sib = FETCH(); scale = (sib >> 6) & 0x3; i = (sib >> 3) & 0x7; base = sib & 0x7; @@ -389,15 +389,15 @@ void i386_device::sib_byte(UINT8 mod, UINT32* out_ea, UINT8* out_segment) *out_segment = segment; } -void i386_device::modrm_to_EA(UINT8 mod_rm, UINT32* out_ea, UINT8* out_segment) +void i386_device::modrm_to_EA(uint8_t mod_rm, uint32_t* out_ea, uint8_t* out_segment) { - INT8 disp8; - INT16 disp16; - INT32 disp32; - UINT8 mod = (mod_rm >> 6) & 0x3; - UINT8 rm = mod_rm & 0x7; - UINT32 ea; - UINT8 segment; + int8_t disp8; + int16_t disp16; + int32_t disp32; + uint8_t mod = (mod_rm >> 6) & 0x3; + uint8_t rm = mod_rm & 0x7; + uint32_t ea; + uint8_t segment; if( mod_rm >= 0xc0 ) fatalerror("i386: Called modrm_to_EA with modrm value %02X!\n",mod_rm); @@ -424,7 +424,7 @@ void i386_device::modrm_to_EA(UINT8 mod_rm, UINT32* out_ea, UINT8* out_segment) } if( mod == 1 ) { disp8 = FETCH(); - ea += (INT32)disp8; + ea += (int32_t)disp8; } else if( mod == 2 ) { disp32 = FETCH32(); ea += disp32; @@ -457,10 +457,10 @@ void i386_device::modrm_to_EA(UINT8 mod_rm, UINT32* out_ea, UINT8* out_segment) } if( mod == 1 ) { disp8 = FETCH(); - ea += (INT32)disp8; + ea += (int32_t)disp8; } else if( mod == 2 ) { disp16 = FETCH16(); - ea += (INT32)disp16; + ea += (int32_t)disp16; } if( m_segment_prefix ) @@ -471,19 +471,19 @@ void i386_device::modrm_to_EA(UINT8 mod_rm, UINT32* out_ea, UINT8* out_segment) } } -UINT32 i386_device::GetNonTranslatedEA(UINT8 modrm,UINT8 *seg) +uint32_t i386_device::GetNonTranslatedEA(uint8_t modrm,uint8_t *seg) { - UINT8 segment; - UINT32 ea; + uint8_t segment; + uint32_t ea; modrm_to_EA(modrm, &ea, &segment ); if(seg) *seg = segment; return ea; } -UINT32 i386_device::GetEA(UINT8 modrm, int rwn) +uint32_t i386_device::GetEA(uint8_t modrm, int rwn) { - UINT8 segment; - UINT32 ea; + uint8_t segment; + uint32_t ea; modrm_to_EA(modrm, &ea, &segment ); return i386_translate(segment, ea, rwn ); } @@ -491,9 +491,9 @@ UINT32 i386_device::GetEA(UINT8 modrm, int rwn) /* Check segment register for validity when changing privilege level after an RETF */ void i386_device::i386_check_sreg_validity(int reg) { - UINT16 selector = m_sreg[reg].selector; - UINT8 CPL = m_CPL; - UINT8 DPL,RPL; + uint16_t selector = m_sreg[reg].selector; + uint8_t CPL = m_CPL; + uint8_t DPL,RPL; I386_SREG desc; int invalid; @@ -536,7 +536,7 @@ void i386_device::i386_check_sreg_validity(int reg) } } -int i386_device::i386_limit_check(int seg, UINT32 offset) +int i386_device::i386_limit_check(int seg, uint32_t offset) { if(PROTECTED_MODE && !V8086_MODE) { @@ -561,10 +561,10 @@ int i386_device::i386_limit_check(int seg, UINT32 offset) return 0; } -void i386_device::i386_sreg_load(UINT16 selector, UINT8 reg, bool *fault) +void i386_device::i386_sreg_load(uint16_t selector, uint8_t reg, bool *fault) { // Checks done when MOV changes a segment register in protected mode - UINT8 CPL,RPL,DPL; + uint8_t CPL,RPL,DPL; CPL = m_CPL; RPL = selector & 0x0003; @@ -713,9 +713,9 @@ void i386_device::i386_trap(int irq, int irq_gate, int trap_level) * 0x0f Reserved * 0x10 Coprocessor error */ - UINT32 v1, v2; - UINT32 offset, oldflags = get_flags(); - UINT16 segment; + uint32_t v1, v2; + uint32_t offset, oldflags = get_flags(); + uint16_t segment; int entry = irq * (PROTECTED_MODE ? 8 : 4); int SetRPL; m_lock = false; @@ -739,9 +739,9 @@ void i386_device::i386_trap(int irq, int irq_gate, int trap_level) else { int type; - UINT16 flags; + uint16_t flags; I386_SREG desc; - UINT8 CPL = m_CPL, DPL; //, RPL = 0; + uint8_t CPL = m_CPL, DPL; //, RPL = 0; /* 32-bit */ v1 = READ32PL0(m_idtr.base + entry ); @@ -882,7 +882,7 @@ void i386_device::i386_trap(int irq, int irq_gate, int trap_level) { /* IRQ to inner privilege */ I386_SREG stack; - UINT32 newESP,oldSS,oldESP; + uint32_t newESP,oldSS,oldESP; if(V8086_MODE && DPL) { @@ -1047,7 +1047,7 @@ void i386_device::i386_trap(int irq, int irq_gate, int trap_level) } } } - UINT32 tempSP = REG32(ESP); + uint32_t tempSP = REG32(ESP); try { // this is ugly but the alternative is worse @@ -1070,7 +1070,7 @@ void i386_device::i386_trap(int irq, int irq_gate, int trap_level) PUSH32(m_prev_eip ); } } - catch(UINT64 e) + catch(uint64_t e) { REG32(ESP) = tempSP; throw e; @@ -1091,7 +1091,7 @@ void i386_device::i386_trap(int irq, int irq_gate, int trap_level) } -void i386_device::i386_trap_with_error(int irq, int irq_gate, int trap_level, UINT32 error) +void i386_device::i386_trap_with_error(int irq, int irq_gate, int trap_level, uint32_t error) { i386_trap(irq,irq_gate,trap_level); if(irq == 8 || irq == 10 || irq == 11 || irq == 12 || irq == 13 || irq == 14) @@ -1100,8 +1100,8 @@ void i386_device::i386_trap_with_error(int irq, int irq_gate, int trap_level, UI // no error code is pushed for software interrupts, either. if(PROTECTED_MODE) { - UINT32 entry = irq * 8; - UINT32 v2,type; + uint32_t entry = irq * 8; + uint32_t v2,type; v2 = READ32PL0(m_idtr.base + entry + 4 ); type = (v2>>8) & 0x1F; if(type == 5) @@ -1121,12 +1121,12 @@ void i386_device::i386_trap_with_error(int irq, int irq_gate, int trap_level, UI } -void i386_device::i286_task_switch(UINT16 selector, UINT8 nested) +void i386_device::i286_task_switch(uint16_t selector, uint8_t nested) { - UINT32 tss; + uint32_t tss; I386_SREG seg; - UINT16 old_task; - UINT8 ar_byte; // access rights byte + uint16_t old_task; + uint8_t ar_byte; // access rights byte /* TODO: Task State Segment privilege checks */ @@ -1228,13 +1228,13 @@ void i386_device::i286_task_switch(UINT16 selector, UINT8 nested) // printf("286 Task Switch from selector %04x to %04x\n",old_task,selector); } -void i386_device::i386_task_switch(UINT16 selector, UINT8 nested) +void i386_device::i386_task_switch(uint16_t selector, uint8_t nested) { - UINT32 tss; + uint32_t tss; I386_SREG seg; - UINT16 old_task; - UINT8 ar_byte; // access rights byte - UINT32 oldcr3 = m_cr[3]; + uint16_t old_task; + uint8_t ar_byte; // access rights byte + uint32_t oldcr3 = m_cr[3]; /* TODO: Task State Segment privilege checks */ @@ -1362,14 +1362,14 @@ void i386_device::i386_check_irq_line() } } -void i386_device::i386_protected_mode_jump(UINT16 seg, UINT32 off, int indirect, int operand32) +void i386_device::i386_protected_mode_jump(uint16_t seg, uint32_t off, int indirect, int operand32) { I386_SREG desc; I386_CALL_GATE call_gate; - UINT8 CPL,DPL,RPL; - UINT8 SetRPL; - UINT16 segment = seg; - UINT32 offset = off; + uint8_t CPL,DPL,RPL; + uint8_t SetRPL; + uint16_t segment = seg; + uint32_t offset = off; /* Check selector is not null */ if((segment & ~0x03) == 0) @@ -1634,14 +1634,14 @@ void i386_device::i386_protected_mode_jump(UINT16 seg, UINT32 off, int indirect, CHANGE_PC(m_eip); } -void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect, int operand32) +void i386_device::i386_protected_mode_call(uint16_t seg, uint32_t off, int indirect, int operand32) { I386_SREG desc; I386_CALL_GATE gate; - UINT8 SetRPL; - UINT8 CPL, DPL, RPL; - UINT16 selector = seg; - UINT32 offset = off; + uint8_t SetRPL; + uint8_t CPL, DPL, RPL; + uint16_t selector = seg; + uint32_t offset = off; int x; if((selector & ~0x03) == 0) @@ -1835,7 +1835,7 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect, { I386_SREG stack; I386_SREG temp; - UINT32 oldSS,oldESP; + uint32_t oldSS,oldESP; /* more privilege */ /* Check new SS segment for privilege level from TSS */ memset(&stack, 0, sizeof(stack)); @@ -1882,7 +1882,7 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect, logerror("CALL: Call gate: Stack segment is not present\n"); FAULT(FAULT_SS,stack.selector) // #SS(SS selector) } - UINT32 newESP = i386_get_stack_ptr(DPL); + uint32_t newESP = i386_get_stack_ptr(DPL); if(!stack.d) { newESP &= 0xffff; @@ -1950,7 +1950,7 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect, /* copy parameters from old stack to new stack */ for(x=(gate.dword_count & 0x1f)-1;x>=0;x--) { - UINT32 addr = oldESP + (operand32?(x*4):(x*2)); + uint32_t addr = oldESP + (operand32?(x*4):(x*2)); addr = temp.base + (temp.d?addr:(addr&0xffff)); if(operand32) PUSH32(READ32(addr)); @@ -2052,7 +2052,7 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect, if(SetRPL != 0) selector = (selector & ~0x03) | m_CPL; - UINT32 tempSP = REG32(ESP); + uint32_t tempSP = REG32(ESP); try { // this is ugly but the alternative is worse @@ -2077,7 +2077,7 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect, i386_load_segment_descriptor(CS ); } } - catch(UINT64 e) + catch(uint64_t e) { REG32(ESP) = tempSP; throw e; @@ -2086,13 +2086,13 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect, CHANGE_PC(m_eip); } -void i386_device::i386_protected_mode_retf(UINT8 count, UINT8 operand32) +void i386_device::i386_protected_mode_retf(uint8_t count, uint8_t operand32) { - UINT32 newCS, newEIP; + uint32_t newCS, newEIP; I386_SREG desc; - UINT8 CPL, RPL, DPL; + uint8_t CPL, RPL, DPL; - UINT32 ea = i386_translate(SS, (STACK_32BIT)?REG32(ESP):REG16(SP), 0); + uint32_t ea = i386_translate(SS, (STACK_32BIT)?REG32(ESP):REG16(SP), 0); if(operand32 == 0) { @@ -2175,7 +2175,7 @@ void i386_device::i386_protected_mode_retf(UINT8 count, UINT8 operand32) } if(operand32 == 0) { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+count+3) != 0) { logerror("RETF (%08x): SP is past stack segment limit.\n",m_pc); @@ -2184,7 +2184,7 @@ void i386_device::i386_protected_mode_retf(UINT8 count, UINT8 operand32) } else { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+count+7) != 0) { logerror("RETF: ESP is past stack segment limit.\n"); @@ -2198,11 +2198,11 @@ void i386_device::i386_protected_mode_retf(UINT8 count, UINT8 operand32) } else if(RPL > CPL) { - UINT32 newSS, newESP; // when changing privilege + uint32_t newSS, newESP; // when changing privilege /* outer privilege level */ if(operand32 == 0) { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+count+7) != 0) { logerror("RETF (%08x): SP is past stack segment limit.\n",m_pc); @@ -2211,7 +2211,7 @@ void i386_device::i386_protected_mode_retf(UINT8 count, UINT8 operand32) } else { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+count+15) != 0) { logerror("RETF: ESP is past stack segment limit.\n"); @@ -2359,15 +2359,15 @@ void i386_device::i386_protected_mode_retf(UINT8 count, UINT8 operand32) void i386_device::i386_protected_mode_iret(int operand32) { - UINT32 newCS, newEIP; - UINT32 newSS, newESP; // when changing privilege + uint32_t newCS, newEIP; + uint32_t newSS, newESP; // when changing privilege I386_SREG desc,stack; - UINT8 CPL, RPL, DPL; - UINT32 newflags; - UINT8 IOPL = m_IOP1 | (m_IOP2 << 1); + uint8_t CPL, RPL, DPL; + uint32_t newflags; + uint8_t IOPL = m_IOP1 | (m_IOP2 << 1); CPL = m_CPL; - UINT32 ea = i386_translate(SS, (STACK_32BIT)?REG32(ESP):REG16(SP), 0); + uint32_t ea = i386_translate(SS, (STACK_32BIT)?REG32(ESP):REG16(SP), 0); if(operand32 == 0) { newEIP = READ16(ea) & 0xffff; @@ -2383,7 +2383,7 @@ void i386_device::i386_protected_mode_iret(int operand32) if(V8086_MODE) { - UINT32 oldflags = get_flags(); + uint32_t oldflags = get_flags(); if(IOPL != 3) { logerror("IRET (%08x): Is in Virtual 8086 mode and IOPL != 3.\n",m_pc); @@ -2410,7 +2410,7 @@ void i386_device::i386_protected_mode_iret(int operand32) } else if(NESTED_TASK) { - UINT32 task = READ32(m_task.base); + uint32_t task = READ32(m_task.base); /* Task Return */ logerror("IRET (%08x): Nested task return.\n",m_pc); /* Check back-link selector in TSS */ @@ -2454,7 +2454,7 @@ void i386_device::i386_protected_mode_iret(int operand32) //logerror("IRET (%08x): Returning to Virtual 8086 mode.\n",m_pc); if(CPL != 0) { - UINT32 oldflags = get_flags(); + uint32_t oldflags = get_flags(); newflags = (newflags & ~0x00003000) | (oldflags & 0x00003000); if(CPL > IOPL) newflags = (newflags & ~0x200 ) | (oldflags & 0x200); @@ -2482,7 +2482,7 @@ void i386_device::i386_protected_mode_iret(int operand32) { if(operand32 == 0) { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) != 0) { logerror("IRET: Data on stack is past SS limit.\n"); @@ -2491,7 +2491,7 @@ void i386_device::i386_protected_mode_iret(int operand32) } else { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+7) != 0) { logerror("IRET: Data on stack is past SS limit.\n"); @@ -2509,7 +2509,7 @@ void i386_device::i386_protected_mode_iret(int operand32) /* return to same privilege level */ if(operand32 == 0) { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+5) != 0) { logerror("IRET (%08x): Data on stack is past SS limit.\n",m_pc); @@ -2518,7 +2518,7 @@ void i386_device::i386_protected_mode_iret(int operand32) } else { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+11) != 0) { logerror("IRET (%08x): Data on stack is past SS limit.\n",m_pc); @@ -2585,7 +2585,7 @@ void i386_device::i386_protected_mode_iret(int operand32) if(CPL != 0) { - UINT32 oldflags = get_flags(); + uint32_t oldflags = get_flags(); newflags = (newflags & ~0x00003000) | (oldflags & 0x00003000); if(CPL > IOPL) newflags = (newflags & ~0x200 ) | (oldflags & 0x200); @@ -2616,7 +2616,7 @@ void i386_device::i386_protected_mode_iret(int operand32) RPL = newCS & 0x03; if(operand32 == 0) { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+9) != 0) { logerror("IRET: SP is past SS limit.\n"); @@ -2625,7 +2625,7 @@ void i386_device::i386_protected_mode_iret(int operand32) } else { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+19) != 0) { logerror("IRET: ESP is past SS limit.\n"); @@ -2756,7 +2756,7 @@ void i386_device::i386_protected_mode_iret(int operand32) // IOPL can only change if CPL is zero if(CPL != 0) { - UINT32 oldflags = get_flags(); + uint32_t oldflags = get_flags(); newflags = (newflags & ~0x00003000) | (oldflags & 0x00003000); if(CPL > IOPL) newflags = (newflags & ~0x200 ) | (oldflags & 0x200); @@ -2841,8 +2841,8 @@ void i386_device::build_cycle_table() int i, j; for (j=0; j < X86_NUM_CPUS; j++) { - cycle_table_rm[j] = std::make_unique(CYCLES_NUM_OPCODES); - cycle_table_pm[j] = std::make_unique(CYCLES_NUM_OPCODES); + cycle_table_rm[j] = std::make_unique(CYCLES_NUM_OPCODES); + cycle_table_pm[j] = std::make_unique(CYCLES_NUM_OPCODES); for (i=0; i < sizeof(x86_cycle_table)/sizeof(X86_CYCLE_TABLE); i++) { @@ -2865,7 +2865,7 @@ void i386_device::report_invalid_opcode() #endif } -void i386_device::report_invalid_modrm(const char* opcode, UINT8 modrm) +void i386_device::report_invalid_modrm(const char* opcode, uint8_t modrm) { #ifndef DEBUG_MISSING_OPCODE logerror("i386: Invalid %s modrm %01X at %08X\n", opcode, modrm, m_pc - 2); @@ -3019,9 +3019,9 @@ void i386_device::i386_decode_four_byte38f3() /*************************************************************************/ -UINT8 i386_device::read8_debug(UINT32 ea, UINT8 *data) +uint8_t i386_device::read8_debug(uint32_t ea, uint8_t *data) { - UINT32 address = ea; + uint32_t address = ea; if(!i386_translate_address(TRANSLATE_DEBUG_MASK,&address,nullptr)) return 0; @@ -3031,11 +3031,11 @@ UINT8 i386_device::read8_debug(UINT32 ea, UINT8 *data) return 1; } -UINT32 i386_device::i386_get_debug_desc(I386_SREG *seg) +uint32_t i386_device::i386_get_debug_desc(I386_SREG *seg) { - UINT32 base, limit, address; - union { UINT8 b[8]; UINT32 w[2]; } data; - UINT8 ret; + uint32_t base, limit, address; + union { uint8_t b[8]; uint32_t w[2]; } data; + uint8_t ret; int entry; if ( seg->selector & 0x4 ) @@ -3077,9 +3077,9 @@ UINT32 i386_device::i386_get_debug_desc(I386_SREG *seg) return seg->valid; } -UINT64 i386_device::debug_segbase(symbol_table &table, int params, const UINT64 *param) +uint64_t i386_device::debug_segbase(symbol_table &table, int params, const uint64_t *param) { - UINT32 result; + uint32_t result; I386_SREG seg; if(param[0] > 65535) @@ -3100,9 +3100,9 @@ UINT64 i386_device::debug_segbase(symbol_table &table, int params, const UINT64 return result; } -UINT64 i386_device::debug_seglimit(symbol_table &table, int params, const UINT64 *param) +uint64_t i386_device::debug_seglimit(symbol_table &table, int params, const uint64_t *param) { - UINT32 result = 0; + uint32_t result = 0; I386_SREG seg; if (PROTECTED_MODE && !V8086_MODE) @@ -3116,9 +3116,9 @@ UINT64 i386_device::debug_seglimit(symbol_table &table, int params, const UINT64 return result; } -UINT64 i386_device::debug_segofftovirt(symbol_table &table, int params, const UINT64 *param) +uint64_t i386_device::debug_segofftovirt(symbol_table &table, int params, const uint64_t *param) { - UINT32 result; + uint32_t result; I386_SREG seg; if(param[0] > 65535) @@ -3154,34 +3154,34 @@ UINT64 i386_device::debug_segofftovirt(symbol_table &table, int params, const UI return result; } -UINT64 i386_device::debug_virttophys(symbol_table &table, int params, const UINT64 *param) +uint64_t i386_device::debug_virttophys(symbol_table &table, int params, const uint64_t *param) { - UINT32 result = param[0]; + uint32_t result = param[0]; if(!i386_translate_address(TRANSLATE_DEBUG_MASK,&result,nullptr)) return 0; return result; } -UINT64 i386_debug_segbase(symbol_table &table, void *ref, int params, const UINT64 *param) +uint64_t i386_debug_segbase(symbol_table &table, void *ref, int params, const uint64_t *param) { i386_device *i386 = (i386_device *)(ref); return i386->debug_segbase(table, params, param); } -UINT64 i386_debug_seglimit(symbol_table &table, void *ref, int params, const UINT64 *param) +uint64_t i386_debug_seglimit(symbol_table &table, void *ref, int params, const uint64_t *param) { i386_device *i386 = (i386_device *)(ref); return i386->debug_seglimit(table, params, param); } -UINT64 i386_debug_segofftovirt(symbol_table &table, void *ref, int params, const UINT64 *param) +uint64_t i386_debug_segofftovirt(symbol_table &table, void *ref, int params, const uint64_t *param) { i386_device *i386 = (i386_device *)(ref); return i386->debug_segofftovirt(table, params, param); } -static UINT64 i386_debug_virttophys(symbol_table &table, void *ref, int params, const UINT64 *param) +static uint64_t i386_debug_virttophys(symbol_table &table, void *ref, int params, const uint64_t *param) { i386_device *i386 = (i386_device *)(ref); return i386->debug_virttophys(table, params, param); @@ -3550,7 +3550,7 @@ void i386_device::state_string_export(const device_state_entry &entry, std::stri } } -void i386_device::build_opcode_table(UINT32 features) +void i386_device::build_opcode_table(uint32_t features) { int i; for (i=0; i < 256; i++) @@ -3766,9 +3766,9 @@ void i386_device::device_reset() void i386_device::pentium_smi() { - UINT32 smram_state = m_smbase + 0xfe00; - UINT32 old_cr0 = m_cr[0]; - UINT32 old_flags = get_flags(); + uint32_t smram_state = m_smbase + 0xfe00; + uint32_t old_cr0 = m_cr[0]; + uint32_t old_flags = get_flags(); if(m_smm) return; @@ -3971,7 +3971,7 @@ void i386_device::execute_run() if(m_lock && (m_opcode != 0xf0)) m_lock = false; } - catch(UINT64 e) + catch(uint64_t e) { m_ext = 1; i386_trap_with_error(e&0xffffffff,0,0,e>>32); @@ -3991,7 +3991,7 @@ bool i386_device::memory_translate(address_spacenum spacenum, int intention, off return ret; } -offs_t i386_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i386_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return i386_dasm_one(buffer, pc, oprom, m_sreg[CS].d ? 32 : 16); } diff --git a/src/devices/cpu/i386/i386.h b/src/devices/cpu/i386/i386.h index 8e64458f228..60c962e8567 100644 --- a/src/devices/cpu/i386/i386.h +++ b/src/devices/cpu/i386/i386.h @@ -28,16 +28,16 @@ class i386_device : public cpu_device, public device_vtlb_interface { public: // construction/destruction - i386_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - i386_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, int program_data_width=32, int program_addr_width=32, int io_data_width=32); + i386_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + i386_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, int program_data_width=32, int program_addr_width=32, int io_data_width=32); // static configuration helpers template static devcb_base &set_smiact(device_t &device, _Object object) { return downcast(device).m_smiact.set_callback(object); } - UINT64 debug_segbase(symbol_table &table, int params, const UINT64 *param); - UINT64 debug_seglimit(symbol_table &table, int params, const UINT64 *param); - UINT64 debug_segofftovirt(symbol_table &table, int params, const UINT64 *param); - UINT64 debug_virttophys(symbol_table &table, int params, const UINT64 *param); + uint64_t debug_segbase(symbol_table &table, int params, const uint64_t *param); + uint64_t debug_seglimit(symbol_table &table, int params, const uint64_t *param); + uint64_t debug_segofftovirt(symbol_table &table, int params, const uint64_t *param); + uint64_t debug_virttophys(symbol_table &table, int params, const uint64_t *param); protected: // device-level overrides @@ -46,9 +46,9 @@ protected: virtual void device_debug_setup() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 40; } - virtual UINT32 execute_input_lines() const override { return 32; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 40; } + virtual uint32_t execute_input_lines() const override { return 32; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -62,85 +62,85 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 15; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 15; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; address_space_config m_io_config; - std::unique_ptr cycle_table_rm[X86_NUM_CPUS]; - std::unique_ptr cycle_table_pm[X86_NUM_CPUS]; + std::unique_ptr cycle_table_rm[X86_NUM_CPUS]; + std::unique_ptr cycle_table_pm[X86_NUM_CPUS]; union I386_GPR { - UINT32 d[8]; - UINT16 w[16]; - UINT8 b[32]; + uint32_t d[8]; + uint16_t w[16]; + uint8_t b[32]; }; struct I386_SREG { - UINT16 selector; - UINT16 flags; - UINT32 base; - UINT32 limit; + uint16_t selector; + uint16_t flags; + uint32_t base; + uint32_t limit; int d; // Operand size bool valid; }; struct I386_SYS_TABLE { - UINT32 base; - UINT16 limit; + uint32_t base; + uint16_t limit; }; struct I386_SEG_DESC { - UINT16 segment; - UINT16 flags; - UINT32 base; - UINT32 limit; + uint16_t segment; + uint16_t flags; + uint32_t base; + uint32_t limit; }; union XMM_REG { - UINT8 b[16]; - UINT16 w[8]; - UINT32 d[4]; - UINT64 q[2]; - INT8 c[16]; - INT16 s[8]; - INT32 i[4]; - INT64 l[2]; + uint8_t b[16]; + uint16_t w[8]; + uint32_t d[4]; + uint64_t q[2]; + int8_t c[16]; + int16_t s[8]; + int32_t i[4]; + int64_t l[2]; float f[4]; double f64[2]; }; union MMX_REG { - UINT32 d[2]; - INT32 i[2]; - UINT16 w[4]; - INT16 s[4]; - UINT8 b[8]; - INT8 c[8]; + uint32_t d[2]; + int32_t i[2]; + uint16_t w[4]; + int16_t s[4]; + uint8_t b[8]; + int8_t c[8]; float f[2]; - UINT64 q; - INT64 l; + uint64_t q; + int64_t l; }; struct I386_CALL_GATE { - UINT16 segment; - UINT16 selector; - UINT32 offset; - UINT8 ar; // access rights - UINT8 dpl; - UINT8 dword_count; - UINT8 present; + uint16_t segment; + uint16_t selector; + uint32_t offset; + uint8_t ar; // access rights + uint8_t dpl; + uint8_t dword_count; + uint8_t present; }; - typedef void (i386_device::*i386_modrm_func)(UINT8 modrm); + typedef void (i386_device::*i386_modrm_func)(uint8_t modrm); typedef void (i386_device::*i386_op_func)(); struct X86_OPCODE { - UINT8 opcode; - UINT32 flags; + uint8_t opcode; + uint32_t flags; i386_op_func handler16; i386_op_func handler32; bool lockable; @@ -149,45 +149,45 @@ struct I386_CALL_GATE I386_GPR m_reg; I386_SREG m_sreg[6]; - UINT32 m_eip; - UINT32 m_pc; - UINT32 m_prev_eip; - UINT32 m_eflags; - UINT32 m_eflags_mask; - UINT8 m_CF; - UINT8 m_DF; - UINT8 m_SF; - UINT8 m_OF; - UINT8 m_ZF; - UINT8 m_PF; - UINT8 m_AF; - UINT8 m_IF; - UINT8 m_TF; - UINT8 m_IOP1; - UINT8 m_IOP2; - UINT8 m_NT; - UINT8 m_RF; - UINT8 m_VM; - UINT8 m_AC; - UINT8 m_VIF; - UINT8 m_VIP; - UINT8 m_ID; - - UINT8 m_CPL; // current privilege level - - UINT8 m_performed_intersegment_jump; - UINT8 m_delayed_interrupt_enable; - - UINT32 m_cr[5]; // Control registers - UINT32 m_dr[8]; // Debug registers - UINT32 m_tr[8]; // Test registers + uint32_t m_eip; + uint32_t m_pc; + uint32_t m_prev_eip; + uint32_t m_eflags; + uint32_t m_eflags_mask; + uint8_t m_CF; + uint8_t m_DF; + uint8_t m_SF; + uint8_t m_OF; + uint8_t m_ZF; + uint8_t m_PF; + uint8_t m_AF; + uint8_t m_IF; + uint8_t m_TF; + uint8_t m_IOP1; + uint8_t m_IOP2; + uint8_t m_NT; + uint8_t m_RF; + uint8_t m_VM; + uint8_t m_AC; + uint8_t m_VIF; + uint8_t m_VIP; + uint8_t m_ID; + + uint8_t m_CPL; // current privilege level + + uint8_t m_performed_intersegment_jump; + uint8_t m_delayed_interrupt_enable; + + uint32_t m_cr[5]; // Control registers + uint32_t m_dr[8]; // Debug registers + uint32_t m_tr[8]; // Test registers I386_SYS_TABLE m_gdtr; // Global Descriptor Table Register I386_SYS_TABLE m_idtr; // Interrupt Descriptor Table Register I386_SEG_DESC m_task; // Task register I386_SEG_DESC m_ldtr; // Local Descriptor Table Register - UINT8 m_ext; // external interrupt + uint8_t m_ext; // external interrupt int m_halted; @@ -202,30 +202,30 @@ struct I386_CALL_GATE int m_cycles; int m_base_cycles; - UINT8 m_opcode; + uint8_t m_opcode; - UINT8 m_irq_state; + uint8_t m_irq_state; address_space *m_program; direct_read_data *m_direct; address_space *m_io; - UINT32 m_a20_mask; + uint32_t m_a20_mask; int m_cpuid_max_input_value_eax; - UINT32 m_cpuid_id0, m_cpuid_id1, m_cpuid_id2; - UINT32 m_cpu_version; - UINT32 m_feature_flags; - UINT64 m_tsc; - UINT64 m_perfctr[2]; + uint32_t m_cpuid_id0, m_cpuid_id1, m_cpuid_id2; + uint32_t m_cpu_version; + uint32_t m_feature_flags; + uint64_t m_tsc; + uint64_t m_perfctr[2]; // FPU floatx80 m_x87_reg[8]; - UINT16 m_x87_cw; - UINT16 m_x87_sw; - UINT16 m_x87_tw; - UINT64 m_x87_data_ptr; - UINT64 m_x87_inst_ptr; - UINT16 m_x87_opcode; + uint16_t m_x87_cw; + uint16_t m_x87_sw; + uint16_t m_x87_tw; + uint64_t m_x87_data_ptr; + uint64_t m_x87_inst_ptr; + uint16_t m_x87_opcode; i386_modrm_func m_opcode_table_x87_d8[256]; i386_modrm_func m_opcode_table_x87_d9[256]; @@ -238,7 +238,7 @@ struct I386_CALL_GATE // SSE XMM_REG m_sse_reg[8]; - UINT32 m_mxcsr; + uint32_t m_mxcsr; i386_op_func m_opcode_table1_16[256]; i386_op_func m_opcode_table1_32[256]; @@ -267,121 +267,121 @@ struct I386_CALL_GATE bool m_lock_table[2][256]; - UINT8 *m_cycle_table_pm; - UINT8 *m_cycle_table_rm; + uint8_t *m_cycle_table_pm; + uint8_t *m_cycle_table_rm; bool m_smm; bool m_smi; bool m_smi_latched; bool m_nmi_masked; bool m_nmi_latched; - UINT32 m_smbase; + uint32_t m_smbase; devcb_write_line m_smiact; bool m_lock; // bytes in current opcode, debug only - UINT8 m_opcode_bytes[16]; - UINT32 m_opcode_pc; + uint8_t m_opcode_bytes[16]; + uint32_t m_opcode_pc; int m_opcode_bytes_length; - UINT64 m_debugger_temp; + uint64_t m_debugger_temp; void register_state_i386(); void register_state_i386_x87(); void register_state_i386_x87_xmm(); - inline UINT32 i386_translate(int segment, UINT32 ip, int rwn); - inline vtlb_entry get_permissions(UINT32 pte, int wp); + inline uint32_t i386_translate(int segment, uint32_t ip, int rwn); + inline vtlb_entry get_permissions(uint32_t pte, int wp); bool i386_translate_address(int intention, offs_t *address, vtlb_entry *entry); - inline int translate_address(int pl, int type, UINT32 *address, UINT32 *error); - inline void CHANGE_PC(UINT32 pc); - inline void NEAR_BRANCH(INT32 offs); - inline UINT8 FETCH(); - inline UINT16 FETCH16(); - inline UINT32 FETCH32(); - inline UINT8 READ8(UINT32 ea); - inline UINT16 READ16(UINT32 ea); - inline UINT32 READ32(UINT32 ea); - inline UINT64 READ64(UINT32 ea); - inline UINT8 READ8PL0(UINT32 ea); - inline UINT16 READ16PL0(UINT32 ea); - inline UINT32 READ32PL0(UINT32 ea); - inline void WRITE_TEST(UINT32 ea); - inline void WRITE8(UINT32 ea, UINT8 value); - inline void WRITE16(UINT32 ea, UINT16 value); - inline void WRITE32(UINT32 ea, UINT32 value); - inline void WRITE64(UINT32 ea, UINT64 value); - inline UINT8 OR8(UINT8 dst, UINT8 src); - inline UINT16 OR16(UINT16 dst, UINT16 src); - inline UINT32 OR32(UINT32 dst, UINT32 src); - inline UINT8 AND8(UINT8 dst, UINT8 src); - inline UINT16 AND16(UINT16 dst, UINT16 src); - inline UINT32 AND32(UINT32 dst, UINT32 src); - inline UINT8 XOR8(UINT8 dst, UINT8 src); - inline UINT16 XOR16(UINT16 dst, UINT16 src); - inline UINT32 XOR32(UINT32 dst, UINT32 src); - inline UINT8 SBB8(UINT8 dst, UINT8 src, UINT8 b); - inline UINT16 SBB16(UINT16 dst, UINT16 src, UINT16 b); - inline UINT32 SBB32(UINT32 dst, UINT32 src, UINT32 b); - inline UINT8 ADC8(UINT8 dst, UINT8 src, UINT8 c); - inline UINT16 ADC16(UINT16 dst, UINT16 src, UINT8 c); - inline UINT32 ADC32(UINT32 dst, UINT32 src, UINT32 c); - inline UINT8 INC8(UINT8 dst); - inline UINT16 INC16(UINT16 dst); - inline UINT32 INC32(UINT32 dst); - inline UINT8 DEC8(UINT8 dst); - inline UINT16 DEC16(UINT16 dst); - inline UINT32 DEC32(UINT32 dst); - inline void PUSH16(UINT16 value); - inline void PUSH32(UINT32 value); - inline void PUSH32SEG(UINT32 value); - inline void PUSH8(UINT8 value); - inline UINT8 POP8(); - inline UINT16 POP16(); - inline UINT32 POP32(); + inline int translate_address(int pl, int type, uint32_t *address, uint32_t *error); + inline void CHANGE_PC(uint32_t pc); + inline void NEAR_BRANCH(int32_t offs); + inline uint8_t FETCH(); + inline uint16_t FETCH16(); + inline uint32_t FETCH32(); + inline uint8_t READ8(uint32_t ea); + inline uint16_t READ16(uint32_t ea); + inline uint32_t READ32(uint32_t ea); + inline uint64_t READ64(uint32_t ea); + inline uint8_t READ8PL0(uint32_t ea); + inline uint16_t READ16PL0(uint32_t ea); + inline uint32_t READ32PL0(uint32_t ea); + inline void WRITE_TEST(uint32_t ea); + inline void WRITE8(uint32_t ea, uint8_t value); + inline void WRITE16(uint32_t ea, uint16_t value); + inline void WRITE32(uint32_t ea, uint32_t value); + inline void WRITE64(uint32_t ea, uint64_t value); + inline uint8_t OR8(uint8_t dst, uint8_t src); + inline uint16_t OR16(uint16_t dst, uint16_t src); + inline uint32_t OR32(uint32_t dst, uint32_t src); + inline uint8_t AND8(uint8_t dst, uint8_t src); + inline uint16_t AND16(uint16_t dst, uint16_t src); + inline uint32_t AND32(uint32_t dst, uint32_t src); + inline uint8_t XOR8(uint8_t dst, uint8_t src); + inline uint16_t XOR16(uint16_t dst, uint16_t src); + inline uint32_t XOR32(uint32_t dst, uint32_t src); + inline uint8_t SBB8(uint8_t dst, uint8_t src, uint8_t b); + inline uint16_t SBB16(uint16_t dst, uint16_t src, uint16_t b); + inline uint32_t SBB32(uint32_t dst, uint32_t src, uint32_t b); + inline uint8_t ADC8(uint8_t dst, uint8_t src, uint8_t c); + inline uint16_t ADC16(uint16_t dst, uint16_t src, uint8_t c); + inline uint32_t ADC32(uint32_t dst, uint32_t src, uint32_t c); + inline uint8_t INC8(uint8_t dst); + inline uint16_t INC16(uint16_t dst); + inline uint32_t INC32(uint32_t dst); + inline uint8_t DEC8(uint8_t dst); + inline uint16_t DEC16(uint16_t dst); + inline uint32_t DEC32(uint32_t dst); + inline void PUSH16(uint16_t value); + inline void PUSH32(uint32_t value); + inline void PUSH32SEG(uint32_t value); + inline void PUSH8(uint8_t value); + inline uint8_t POP8(); + inline uint16_t POP16(); + inline uint32_t POP32(); inline void BUMP_SI(int adjustment); inline void BUMP_DI(int adjustment); - inline void check_ioperm(offs_t port, UINT8 mask); - inline UINT8 READPORT8(offs_t port); - inline void WRITEPORT8(offs_t port, UINT8 value); - inline UINT16 READPORT16(offs_t port); - inline void WRITEPORT16(offs_t port, UINT16 value); - inline UINT32 READPORT32(offs_t port); - inline void WRITEPORT32(offs_t port, UINT32 value); - UINT64 pentium_msr_read(UINT32 offset,UINT8 *valid_msr); - void pentium_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr); - UINT64 p6_msr_read(UINT32 offset,UINT8 *valid_msr); - void p6_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr); - UINT64 piv_msr_read(UINT32 offset,UINT8 *valid_msr); - void piv_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr); - inline UINT64 MSR_READ(UINT32 offset,UINT8 *valid_msr); - inline void MSR_WRITE(UINT32 offset, UINT64 data, UINT8 *valid_msr); - UINT32 i386_load_protected_mode_segment(I386_SREG *seg, UINT64 *desc ); + inline void check_ioperm(offs_t port, uint8_t mask); + inline uint8_t READPORT8(offs_t port); + inline void WRITEPORT8(offs_t port, uint8_t value); + inline uint16_t READPORT16(offs_t port); + inline void WRITEPORT16(offs_t port, uint16_t value); + inline uint32_t READPORT32(offs_t port); + inline void WRITEPORT32(offs_t port, uint32_t value); + uint64_t pentium_msr_read(uint32_t offset,uint8_t *valid_msr); + void pentium_msr_write(uint32_t offset, uint64_t data, uint8_t *valid_msr); + uint64_t p6_msr_read(uint32_t offset,uint8_t *valid_msr); + void p6_msr_write(uint32_t offset, uint64_t data, uint8_t *valid_msr); + uint64_t piv_msr_read(uint32_t offset,uint8_t *valid_msr); + void piv_msr_write(uint32_t offset, uint64_t data, uint8_t *valid_msr); + inline uint64_t MSR_READ(uint32_t offset,uint8_t *valid_msr); + inline void MSR_WRITE(uint32_t offset, uint64_t data, uint8_t *valid_msr); + uint32_t i386_load_protected_mode_segment(I386_SREG *seg, uint64_t *desc ); void i386_load_call_gate(I386_CALL_GATE *gate); - void i386_set_descriptor_accessed(UINT16 selector); + void i386_set_descriptor_accessed(uint16_t selector); void i386_load_segment_descriptor(int segment ); - UINT32 i386_get_stack_segment(UINT8 privilege); - UINT32 i386_get_stack_ptr(UINT8 privilege); - UINT32 get_flags() const; - void set_flags(UINT32 f ); - void sib_byte(UINT8 mod, UINT32* out_ea, UINT8* out_segment); - void modrm_to_EA(UINT8 mod_rm, UINT32* out_ea, UINT8* out_segment); - UINT32 GetNonTranslatedEA(UINT8 modrm,UINT8 *seg); - UINT32 GetEA(UINT8 modrm, int rwn); + uint32_t i386_get_stack_segment(uint8_t privilege); + uint32_t i386_get_stack_ptr(uint8_t privilege); + uint32_t get_flags() const; + void set_flags(uint32_t f ); + void sib_byte(uint8_t mod, uint32_t* out_ea, uint8_t* out_segment); + void modrm_to_EA(uint8_t mod_rm, uint32_t* out_ea, uint8_t* out_segment); + uint32_t GetNonTranslatedEA(uint8_t modrm,uint8_t *seg); + uint32_t GetEA(uint8_t modrm, int rwn); void i386_check_sreg_validity(int reg); - int i386_limit_check(int seg, UINT32 offset); - void i386_sreg_load(UINT16 selector, UINT8 reg, bool *fault); + int i386_limit_check(int seg, uint32_t offset); + void i386_sreg_load(uint16_t selector, uint8_t reg, bool *fault); void i386_trap(int irq, int irq_gate, int trap_level); - void i386_trap_with_error(int irq, int irq_gate, int trap_level, UINT32 error); - void i286_task_switch(UINT16 selector, UINT8 nested); - void i386_task_switch(UINT16 selector, UINT8 nested); + void i386_trap_with_error(int irq, int irq_gate, int trap_level, uint32_t error); + void i286_task_switch(uint16_t selector, uint8_t nested); + void i386_task_switch(uint16_t selector, uint8_t nested); void i386_check_irq_line(); - void i386_protected_mode_jump(UINT16 seg, UINT32 off, int indirect, int operand32); - void i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect, int operand32); - void i386_protected_mode_retf(UINT8 count, UINT8 operand32); + void i386_protected_mode_jump(uint16_t seg, uint32_t off, int indirect, int operand32); + void i386_protected_mode_call(uint16_t seg, uint32_t off, int indirect, int operand32); + void i386_protected_mode_retf(uint8_t count, uint8_t operand32); void i386_protected_mode_iret(int operand32); void build_cycle_table(); void report_invalid_opcode(); - void report_invalid_modrm(const char* opcode, UINT8 modrm); + void report_invalid_modrm(const char* opcode, uint8_t modrm); void i386_decode_opcode(); void i386_decode_two_byte(); void i386_decode_three_byte38(); @@ -394,11 +394,11 @@ struct I386_CALL_GATE void i386_decode_four_byte38f2(); void i386_decode_four_byte3af2(); void i386_decode_four_byte38f3(); - UINT8 read8_debug(UINT32 ea, UINT8 *data); - UINT32 i386_get_debug_desc(I386_SREG *seg); + uint8_t read8_debug(uint32_t ea, uint8_t *data); + uint32_t i386_get_debug_desc(I386_SREG *seg); inline void CYCLES(int x); inline void CYCLES_RM(int modrm, int r, int m); - UINT8 i386_shift_rotate8(UINT8 modrm, UINT32 value, UINT8 shift); + uint8_t i386_shift_rotate8(uint8_t modrm, uint32_t value, uint8_t shift); void i386_adc_rm8_r8(); void i386_adc_r8_rm8(); void i386_adc_al_i8(); @@ -545,7 +545,7 @@ struct I386_CALL_GATE void i386_loadall(); void i386_invalid(); void i386_xlat(); - UINT16 i386_shift_rotate16(UINT8 modrm, UINT32 value, UINT8 shift); + uint16_t i386_shift_rotate16(uint8_t modrm, uint32_t value, uint8_t shift); void i386_adc_rm16_r16(); void i386_adc_r16_rm16(); void i386_adc_ax_i16(); @@ -720,7 +720,7 @@ struct I386_CALL_GATE void i386_les16(); void i386_lfs16(); void i386_lgs16(); - UINT32 i386_shift_rotate32(UINT8 modrm, UINT32 value, UINT8 shift); + uint32_t i386_shift_rotate32(uint8_t modrm, uint32_t value, uint8_t shift); void i386_adc_rm32_r32(); void i386_adc_r32_rm32(); void i386_adc_eax_i32(); @@ -918,14 +918,14 @@ struct I386_CALL_GATE void i486_bswap_edi(); void i486_mov_cr_r32(); inline void MMXPROLOG(); - inline void READMMX(UINT32 ea,MMX_REG &r); - inline void WRITEMMX(UINT32 ea,MMX_REG &r); - inline void READXMM(UINT32 ea,XMM_REG &r); - inline void WRITEXMM(UINT32 ea,XMM_REG &r); - inline void READXMM_LO64(UINT32 ea,XMM_REG &r); - inline void WRITEXMM_LO64(UINT32 ea,XMM_REG &r); - inline void READXMM_HI64(UINT32 ea,XMM_REG &r); - inline void WRITEXMM_HI64(UINT32 ea,XMM_REG &r); + inline void READMMX(uint32_t ea,MMX_REG &r); + inline void WRITEMMX(uint32_t ea,MMX_REG &r); + inline void READXMM(uint32_t ea,XMM_REG &r); + inline void WRITEXMM(uint32_t ea,XMM_REG &r); + inline void READXMM_LO64(uint32_t ea,XMM_REG &r); + inline void WRITEXMM_LO64(uint32_t ea,XMM_REG &r); + inline void READXMM_HI64(uint32_t ea,XMM_REG &r); + inline void WRITEXMM_HI64(uint32_t ea,XMM_REG &r); void pentium_rdmsr(); void pentium_wrmsr(); void pentium_rdtsc(); @@ -1241,12 +1241,12 @@ struct I386_CALL_GATE void sse_movdq2q_r64_r128(); void sse_cvtpd2dq_r128_rm128(); void sse_lddqu_r128_m128(); - inline void sse_predicate_compare_single(UINT8 imm8, XMM_REG d, XMM_REG s); - inline void sse_predicate_compare_double(UINT8 imm8, XMM_REG d, XMM_REG s); - inline void sse_predicate_compare_single_scalar(UINT8 imm8, XMM_REG d, XMM_REG s); - inline void sse_predicate_compare_double_scalar(UINT8 imm8, XMM_REG d, XMM_REG s); - inline floatx80 READ80(UINT32 ea); - inline void WRITE80(UINT32 ea, floatx80 t); + inline void sse_predicate_compare_single(uint8_t imm8, XMM_REG d, XMM_REG s); + inline void sse_predicate_compare_double(uint8_t imm8, XMM_REG d, XMM_REG s); + inline void sse_predicate_compare_single_scalar(uint8_t imm8, XMM_REG d, XMM_REG s); + inline void sse_predicate_compare_double_scalar(uint8_t imm8, XMM_REG d, XMM_REG s); + inline floatx80 READ80(uint32_t ea); + inline void WRITE80(uint32_t ea, floatx80 t); inline void x87_set_stack_top(int top); inline void x87_set_tag(int reg, int tag); void x87_write_stack(int i, floatx80 value, int update_tag); @@ -1255,143 +1255,143 @@ struct I386_CALL_GATE int x87_inc_stack(); int x87_dec_stack(); int x87_check_exceptions(); - inline void x87_write_cw(UINT16 cw); + inline void x87_write_cw(uint16_t cw); void x87_reset(); floatx80 x87_add(floatx80 a, floatx80 b); floatx80 x87_sub(floatx80 a, floatx80 b); floatx80 x87_mul(floatx80 a, floatx80 b); floatx80 x87_div(floatx80 a, floatx80 b); - void x87_fadd_m32real(UINT8 modrm); - void x87_fadd_m64real(UINT8 modrm); - void x87_fadd_st_sti(UINT8 modrm); - void x87_fadd_sti_st(UINT8 modrm); - void x87_faddp(UINT8 modrm); - void x87_fiadd_m32int(UINT8 modrm); - void x87_fiadd_m16int(UINT8 modrm); - void x87_fsub_m32real(UINT8 modrm); - void x87_fsub_m64real(UINT8 modrm); - void x87_fsub_st_sti(UINT8 modrm); - void x87_fsub_sti_st(UINT8 modrm); - void x87_fsubp(UINT8 modrm); - void x87_fisub_m32int(UINT8 modrm); - void x87_fisub_m16int(UINT8 modrm); - void x87_fsubr_m32real(UINT8 modrm); - void x87_fsubr_m64real(UINT8 modrm); - void x87_fsubr_st_sti(UINT8 modrm); - void x87_fsubr_sti_st(UINT8 modrm); - void x87_fsubrp(UINT8 modrm); - void x87_fisubr_m32int(UINT8 modrm); - void x87_fisubr_m16int(UINT8 modrm); - void x87_fdiv_m32real(UINT8 modrm); - void x87_fdiv_m64real(UINT8 modrm); - void x87_fdiv_st_sti(UINT8 modrm); - void x87_fdiv_sti_st(UINT8 modrm); - void x87_fdivp(UINT8 modrm); - void x87_fidiv_m32int(UINT8 modrm); - void x87_fidiv_m16int(UINT8 modrm); - void x87_fdivr_m32real(UINT8 modrm); - void x87_fdivr_m64real(UINT8 modrm); - void x87_fdivr_st_sti(UINT8 modrm); - void x87_fdivr_sti_st(UINT8 modrm); - void x87_fdivrp(UINT8 modrm); - void x87_fidivr_m32int(UINT8 modrm); - void x87_fidivr_m16int(UINT8 modrm); - void x87_fmul_m32real(UINT8 modrm); - void x87_fmul_m64real(UINT8 modrm); - void x87_fmul_st_sti(UINT8 modrm); - void x87_fmul_sti_st(UINT8 modrm); - void x87_fmulp(UINT8 modrm); - void x87_fimul_m32int(UINT8 modrm); - void x87_fimul_m16int(UINT8 modrm); - void x87_fprem(UINT8 modrm); - void x87_fprem1(UINT8 modrm); - void x87_fsqrt(UINT8 modrm); - void x87_f2xm1(UINT8 modrm); - void x87_fyl2x(UINT8 modrm); - void x87_fyl2xp1(UINT8 modrm); - void x87_fptan(UINT8 modrm); - void x87_fpatan(UINT8 modrm); - void x87_fsin(UINT8 modrm); - void x87_fcos(UINT8 modrm); - void x87_fsincos(UINT8 modrm); - void x87_fld_m32real(UINT8 modrm); - void x87_fld_m64real(UINT8 modrm); - void x87_fld_m80real(UINT8 modrm); - void x87_fld_sti(UINT8 modrm); - void x87_fild_m16int(UINT8 modrm); - void x87_fild_m32int(UINT8 modrm); - void x87_fild_m64int(UINT8 modrm); - void x87_fbld(UINT8 modrm); - void x87_fst_m32real(UINT8 modrm); - void x87_fst_m64real(UINT8 modrm); - void x87_fst_sti(UINT8 modrm); - void x87_fstp_m32real(UINT8 modrm); - void x87_fstp_m64real(UINT8 modrm); - void x87_fstp_m80real(UINT8 modrm); - void x87_fstp_sti(UINT8 modrm); - void x87_fist_m16int(UINT8 modrm); - void x87_fist_m32int(UINT8 modrm); - void x87_fistp_m16int(UINT8 modrm); - void x87_fistp_m32int(UINT8 modrm); - void x87_fistp_m64int(UINT8 modrm); - void x87_fbstp(UINT8 modrm); - void x87_fld1(UINT8 modrm); - void x87_fldl2t(UINT8 modrm); - void x87_fldl2e(UINT8 modrm); - void x87_fldpi(UINT8 modrm); - void x87_fldlg2(UINT8 modrm); - void x87_fldln2(UINT8 modrm); - void x87_fldz(UINT8 modrm); - void x87_fnop(UINT8 modrm); - void x87_fchs(UINT8 modrm); - void x87_fabs(UINT8 modrm); - void x87_fscale(UINT8 modrm); - void x87_frndint(UINT8 modrm); - void x87_fxtract(UINT8 modrm); - void x87_ftst(UINT8 modrm); - void x87_fxam(UINT8 modrm); - void x87_fcmovb_sti(UINT8 modrm); - void x87_fcmove_sti(UINT8 modrm); - void x87_fcmovbe_sti(UINT8 modrm); - void x87_fcmovu_sti(UINT8 modrm); - void x87_fcmovnb_sti(UINT8 modrm); - void x87_fcmovne_sti(UINT8 modrm); - void x87_fcmovnbe_sti(UINT8 modrm); - void x87_fcmovnu_sti(UINT8 modrm); - void x87_ficom_m16int(UINT8 modrm); - void x87_ficom_m32int(UINT8 modrm); - void x87_ficomp_m16int(UINT8 modrm); - void x87_ficomp_m32int(UINT8 modrm); - void x87_fcom_m32real(UINT8 modrm); - void x87_fcom_m64real(UINT8 modrm); - void x87_fcom_sti(UINT8 modrm); - void x87_fcomp_m32real(UINT8 modrm); - void x87_fcomp_m64real(UINT8 modrm); - void x87_fcomp_sti(UINT8 modrm); - void x87_fcomi_sti(UINT8 modrm); - void x87_fcomip_sti(UINT8 modrm); - void x87_fucomi_sti(UINT8 modrm); - void x87_fucomip_sti(UINT8 modrm); - void x87_fcompp(UINT8 modrm); - void x87_fucom_sti(UINT8 modrm); - void x87_fucomp_sti(UINT8 modrm); - void x87_fucompp(UINT8 modrm); - void x87_fdecstp(UINT8 modrm); - void x87_fincstp(UINT8 modrm); - void x87_fclex(UINT8 modrm); - void x87_ffree(UINT8 modrm); - void x87_finit(UINT8 modrm); - void x87_fldcw(UINT8 modrm); - void x87_fstcw(UINT8 modrm); - void x87_fldenv(UINT8 modrm); - void x87_fstenv(UINT8 modrm); - void x87_fsave(UINT8 modrm); - void x87_frstor(UINT8 modrm); - void x87_fxch(UINT8 modrm); - void x87_fxch_sti(UINT8 modrm); - void x87_fstsw_ax(UINT8 modrm); - void x87_fstsw_m2byte(UINT8 modrm); - void x87_invalid(UINT8 modrm); + void x87_fadd_m32real(uint8_t modrm); + void x87_fadd_m64real(uint8_t modrm); + void x87_fadd_st_sti(uint8_t modrm); + void x87_fadd_sti_st(uint8_t modrm); + void x87_faddp(uint8_t modrm); + void x87_fiadd_m32int(uint8_t modrm); + void x87_fiadd_m16int(uint8_t modrm); + void x87_fsub_m32real(uint8_t modrm); + void x87_fsub_m64real(uint8_t modrm); + void x87_fsub_st_sti(uint8_t modrm); + void x87_fsub_sti_st(uint8_t modrm); + void x87_fsubp(uint8_t modrm); + void x87_fisub_m32int(uint8_t modrm); + void x87_fisub_m16int(uint8_t modrm); + void x87_fsubr_m32real(uint8_t modrm); + void x87_fsubr_m64real(uint8_t modrm); + void x87_fsubr_st_sti(uint8_t modrm); + void x87_fsubr_sti_st(uint8_t modrm); + void x87_fsubrp(uint8_t modrm); + void x87_fisubr_m32int(uint8_t modrm); + void x87_fisubr_m16int(uint8_t modrm); + void x87_fdiv_m32real(uint8_t modrm); + void x87_fdiv_m64real(uint8_t modrm); + void x87_fdiv_st_sti(uint8_t modrm); + void x87_fdiv_sti_st(uint8_t modrm); + void x87_fdivp(uint8_t modrm); + void x87_fidiv_m32int(uint8_t modrm); + void x87_fidiv_m16int(uint8_t modrm); + void x87_fdivr_m32real(uint8_t modrm); + void x87_fdivr_m64real(uint8_t modrm); + void x87_fdivr_st_sti(uint8_t modrm); + void x87_fdivr_sti_st(uint8_t modrm); + void x87_fdivrp(uint8_t modrm); + void x87_fidivr_m32int(uint8_t modrm); + void x87_fidivr_m16int(uint8_t modrm); + void x87_fmul_m32real(uint8_t modrm); + void x87_fmul_m64real(uint8_t modrm); + void x87_fmul_st_sti(uint8_t modrm); + void x87_fmul_sti_st(uint8_t modrm); + void x87_fmulp(uint8_t modrm); + void x87_fimul_m32int(uint8_t modrm); + void x87_fimul_m16int(uint8_t modrm); + void x87_fprem(uint8_t modrm); + void x87_fprem1(uint8_t modrm); + void x87_fsqrt(uint8_t modrm); + void x87_f2xm1(uint8_t modrm); + void x87_fyl2x(uint8_t modrm); + void x87_fyl2xp1(uint8_t modrm); + void x87_fptan(uint8_t modrm); + void x87_fpatan(uint8_t modrm); + void x87_fsin(uint8_t modrm); + void x87_fcos(uint8_t modrm); + void x87_fsincos(uint8_t modrm); + void x87_fld_m32real(uint8_t modrm); + void x87_fld_m64real(uint8_t modrm); + void x87_fld_m80real(uint8_t modrm); + void x87_fld_sti(uint8_t modrm); + void x87_fild_m16int(uint8_t modrm); + void x87_fild_m32int(uint8_t modrm); + void x87_fild_m64int(uint8_t modrm); + void x87_fbld(uint8_t modrm); + void x87_fst_m32real(uint8_t modrm); + void x87_fst_m64real(uint8_t modrm); + void x87_fst_sti(uint8_t modrm); + void x87_fstp_m32real(uint8_t modrm); + void x87_fstp_m64real(uint8_t modrm); + void x87_fstp_m80real(uint8_t modrm); + void x87_fstp_sti(uint8_t modrm); + void x87_fist_m16int(uint8_t modrm); + void x87_fist_m32int(uint8_t modrm); + void x87_fistp_m16int(uint8_t modrm); + void x87_fistp_m32int(uint8_t modrm); + void x87_fistp_m64int(uint8_t modrm); + void x87_fbstp(uint8_t modrm); + void x87_fld1(uint8_t modrm); + void x87_fldl2t(uint8_t modrm); + void x87_fldl2e(uint8_t modrm); + void x87_fldpi(uint8_t modrm); + void x87_fldlg2(uint8_t modrm); + void x87_fldln2(uint8_t modrm); + void x87_fldz(uint8_t modrm); + void x87_fnop(uint8_t modrm); + void x87_fchs(uint8_t modrm); + void x87_fabs(uint8_t modrm); + void x87_fscale(uint8_t modrm); + void x87_frndint(uint8_t modrm); + void x87_fxtract(uint8_t modrm); + void x87_ftst(uint8_t modrm); + void x87_fxam(uint8_t modrm); + void x87_fcmovb_sti(uint8_t modrm); + void x87_fcmove_sti(uint8_t modrm); + void x87_fcmovbe_sti(uint8_t modrm); + void x87_fcmovu_sti(uint8_t modrm); + void x87_fcmovnb_sti(uint8_t modrm); + void x87_fcmovne_sti(uint8_t modrm); + void x87_fcmovnbe_sti(uint8_t modrm); + void x87_fcmovnu_sti(uint8_t modrm); + void x87_ficom_m16int(uint8_t modrm); + void x87_ficom_m32int(uint8_t modrm); + void x87_ficomp_m16int(uint8_t modrm); + void x87_ficomp_m32int(uint8_t modrm); + void x87_fcom_m32real(uint8_t modrm); + void x87_fcom_m64real(uint8_t modrm); + void x87_fcom_sti(uint8_t modrm); + void x87_fcomp_m32real(uint8_t modrm); + void x87_fcomp_m64real(uint8_t modrm); + void x87_fcomp_sti(uint8_t modrm); + void x87_fcomi_sti(uint8_t modrm); + void x87_fcomip_sti(uint8_t modrm); + void x87_fucomi_sti(uint8_t modrm); + void x87_fucomip_sti(uint8_t modrm); + void x87_fcompp(uint8_t modrm); + void x87_fucom_sti(uint8_t modrm); + void x87_fucomp_sti(uint8_t modrm); + void x87_fucompp(uint8_t modrm); + void x87_fdecstp(uint8_t modrm); + void x87_fincstp(uint8_t modrm); + void x87_fclex(uint8_t modrm); + void x87_ffree(uint8_t modrm); + void x87_finit(uint8_t modrm); + void x87_fldcw(uint8_t modrm); + void x87_fstcw(uint8_t modrm); + void x87_fldenv(uint8_t modrm); + void x87_fstenv(uint8_t modrm); + void x87_fsave(uint8_t modrm); + void x87_frstor(uint8_t modrm); + void x87_fxch(uint8_t modrm); + void x87_fxch_sti(uint8_t modrm); + void x87_fstsw_ax(uint8_t modrm); + void x87_fstsw_m2byte(uint8_t modrm); + void x87_invalid(uint8_t modrm); void i386_x87_group_d8(); void i386_x87_group_d9(); void i386_x87_group_da(); @@ -1411,7 +1411,7 @@ struct I386_CALL_GATE void build_x87_opcode_table(); void i386_postload(); void i386_common_init(); - void build_opcode_table(UINT32 features); + void build_opcode_table(uint32_t features); void pentium_smi(); void zero_state(); void i386_set_a20_line(int state); @@ -1423,7 +1423,7 @@ class i386SX_device : public i386_device { public: // construction/destruction - i386SX_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i386SX_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -1431,7 +1431,7 @@ class i486_device : public i386_device { public: // construction/destruction - i486_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i486_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -1443,8 +1443,8 @@ class pentium_device : public i386_device { public: // construction/destruction - pentium_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - pentium_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); + pentium_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + pentium_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: virtual void execute_set_input(int inputnum, int state) override; @@ -1457,7 +1457,7 @@ class mediagx_device : public i386_device { public: // construction/destruction - mediagx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mediagx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -1469,7 +1469,7 @@ class pentium_pro_device : public pentium_device { public: // construction/destruction - pentium_pro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pentium_pro_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -1481,7 +1481,7 @@ class pentium_mmx_device : public pentium_device { public: // construction/destruction - pentium_mmx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pentium_mmx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -1493,7 +1493,7 @@ class pentium2_device : public pentium_device { public: // construction/destruction - pentium2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pentium2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -1505,7 +1505,7 @@ class pentium3_device : public pentium_device { public: // construction/destruction - pentium3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pentium3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -1517,7 +1517,7 @@ class pentium4_device : public pentium_device { public: // construction/destruction - pentium4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pentium4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/cpu/i386/i386dasm.cpp b/src/devices/cpu/i386/i386dasm.cpp index 780cda0ba1d..0e39a2edfe8 100644 --- a/src/devices/cpu/i386/i386dasm.cpp +++ b/src/devices/cpu/i386/i386dasm.cpp @@ -102,10 +102,10 @@ enum struct I386_OPCODE { const char *mnemonic; - UINT32 flags; - UINT32 param1; - UINT32 param2; - UINT32 param3; + uint32_t flags; + uint32_t param1; + uint32_t param2; + uint32_t param3; offs_t dasm_flags; }; @@ -114,8 +114,8 @@ struct GROUP_OP { const I386_OPCODE *opcode; }; -static const UINT8 *opcode_ptr; -static const UINT8 *opcode_ptr_base; +static const uint8_t *opcode_ptr; +static const uint8_t *opcode_ptr_base; static const I386_OPCODE i386_opcode_table1[256] = { @@ -1980,20 +1980,20 @@ static int operand_size; static int address_prefix; static int operand_prefix; static int max_length; -static UINT64 pc; -static UINT8 modrm; -static UINT32 segment; +static uint64_t pc; +static uint8_t modrm; +static uint32_t segment; static offs_t dasm_flags; static char modrm_string[256]; -static UINT8 rex, regex, sibex, rmex; -static UINT8 pre0f; -static UINT8 curmode; +static uint8_t rex, regex, sibex, rmex; +static uint8_t pre0f; +static uint8_t curmode; #define MODRM_REG1 ((modrm >> 3) & 0x7) #define MODRM_REG2 (modrm & 0x7) #define MODRM_MOD ((modrm >> 6) & 0x3) -static inline UINT8 FETCH(void) +static inline uint8_t FETCH(void) { if ((opcode_ptr - opcode_ptr_base) + 1 > max_length) return 0xff; @@ -2002,9 +2002,9 @@ static inline UINT8 FETCH(void) } #if 0 -static inline UINT16 FETCH16(void) +static inline uint16_t FETCH16(void) { - UINT16 d; + uint16_t d; if ((opcode_ptr - opcode_ptr_base) + 2 > max_length) return 0xffff; d = opcode_ptr[0] | (opcode_ptr[1] << 8); @@ -2014,9 +2014,9 @@ static inline UINT16 FETCH16(void) } #endif -static inline UINT32 FETCH32(void) +static inline uint32_t FETCH32(void) { - UINT32 d; + uint32_t d; if ((opcode_ptr - opcode_ptr_base) + 4 > max_length) return 0xffffffff; d = opcode_ptr[0] | (opcode_ptr[1] << 8) | (opcode_ptr[2] << 16) | (opcode_ptr[3] << 24); @@ -2025,7 +2025,7 @@ static inline UINT32 FETCH32(void) return d; } -static inline UINT8 FETCHD(void) +static inline uint8_t FETCHD(void) { if ((opcode_ptr - opcode_ptr_base) + 1 > max_length) return 0xff; @@ -2033,9 +2033,9 @@ static inline UINT8 FETCHD(void) return *opcode_ptr++; } -static inline UINT16 FETCHD16(void) +static inline uint16_t FETCHD16(void) { - UINT16 d; + uint16_t d; if ((opcode_ptr - opcode_ptr_base) + 2 > max_length) return 0xffff; d = opcode_ptr[0] | (opcode_ptr[1] << 8); @@ -2044,9 +2044,9 @@ static inline UINT16 FETCHD16(void) return d; } -static inline UINT32 FETCHD32(void) +static inline uint32_t FETCHD32(void) { - UINT32 d; + uint32_t d; if ((opcode_ptr - opcode_ptr_base) + 4 > max_length) return 0xffffffff; d = opcode_ptr[0] | (opcode_ptr[1] << 8) | (opcode_ptr[2] << 16) | (opcode_ptr[3] << 24); @@ -2055,7 +2055,7 @@ static inline UINT32 FETCHD32(void) return d; } -static char *hexstring(UINT32 value, int digits) +static char *hexstring(uint32_t value, int digits) { static char buffer[20]; buffer[0] = '0'; @@ -2066,7 +2066,7 @@ static char *hexstring(UINT32 value, int digits) return (buffer[1] >= '0' && buffer[1] <= '9') ? &buffer[1] : &buffer[0]; } -static char *hexstring64(UINT32 lo, UINT32 hi) +static char *hexstring64(uint32_t lo, uint32_t hi) { static char buffer[40]; buffer[0] = '0'; @@ -2077,15 +2077,15 @@ static char *hexstring64(UINT32 lo, UINT32 hi) return (buffer[1] >= '0' && buffer[1] <= '9') ? &buffer[1] : &buffer[0]; } -static char *hexstringpc(UINT64 pc) +static char *hexstringpc(uint64_t pc) { if (curmode == 64) - return hexstring64((UINT32)pc, (UINT32)(pc >> 32)); + return hexstring64((uint32_t)pc, (uint32_t)(pc >> 32)); else - return hexstring((UINT32)pc, 0); + return hexstring((uint32_t)pc, 0); } -static char *shexstring(UINT32 value, int digits, int always) +static char *shexstring(uint32_t value, int digits, int always) { static char buffer[20]; if (value >= 0x80000000) @@ -2097,11 +2097,11 @@ static char *shexstring(UINT32 value, int digits, int always) return buffer; } -static char* handle_sib_byte( char* s, UINT8 mod ) +static char* handle_sib_byte( char* s, uint8_t mod ) { - UINT32 i32; - UINT8 scale, i, base; - UINT8 sib = FETCHD(); + uint32_t i32; + uint8_t scale, i, base; + uint8_t sib = FETCHD(); scale = (sib >> 6) & 0x3; i = ((sib >> 3) & 0x7) | sibex; @@ -2123,10 +2123,10 @@ static char* handle_sib_byte( char* s, UINT8 mod ) static void handle_modrm(char* s) { - INT8 disp8; - INT16 disp16; - INT32 disp32; - UINT8 mod, rm; + int8_t disp8; + int16_t disp16; + int32_t disp32; + uint8_t mod, rm; modrm = FETCHD(); mod = (modrm >> 6) & 0x3; @@ -2157,7 +2157,7 @@ static void handle_modrm(char* s) if( mod == 1 ) { disp8 = FETCHD(); if (disp8 != 0) - s += sprintf( s, "%s", shexstring((INT32)disp8, 0, TRUE) ); + s += sprintf( s, "%s", shexstring((int32_t)disp8, 0, TRUE) ); } else if( mod == 2 ) { disp32 = FETCHD32(); if (disp32 != 0) @@ -2177,7 +2177,7 @@ static void handle_modrm(char* s) if( mod == 1 ) { disp8 = FETCHD(); if (disp8 != 0) - s += sprintf( s, "%s", shexstring((INT32)disp8, 0, TRUE) ); + s += sprintf( s, "%s", shexstring((int32_t)disp8, 0, TRUE) ); } else if( mod == 2 ) { disp32 = FETCHD32(); if (disp32 != 0) @@ -2195,7 +2195,7 @@ static void handle_modrm(char* s) case 6: if( mod == 0 ) { disp16 = FETCHD16(); - s += sprintf( s, "%s", hexstring((unsigned) (UINT16) disp16, 0) ); + s += sprintf( s, "%s", hexstring((unsigned) (uint16_t) disp16, 0) ); } else { s += sprintf( s, "bp" ); } @@ -2205,26 +2205,26 @@ static void handle_modrm(char* s) if( mod == 1 ) { disp8 = FETCHD(); if (disp8 != 0) - s += sprintf( s, "%s", shexstring((INT32)disp8, 0, TRUE) ); + s += sprintf( s, "%s", shexstring((int32_t)disp8, 0, TRUE) ); } else if( mod == 2 ) { disp16 = FETCHD16(); if (disp16 != 0) - s += sprintf( s, "%s", shexstring((INT32)disp16, 0, TRUE) ); + s += sprintf( s, "%s", shexstring((int32_t)disp16, 0, TRUE) ); } } s += sprintf( s, "]" ); } -static char* handle_param(char* s, UINT32 param) +static char* handle_param(char* s, uint32_t param) { - UINT8 i8; - UINT16 i16; - UINT32 i32; - UINT16 ptr; - UINT32 addr; - INT8 d8; - INT16 d16; - INT32 d32; + uint8_t i8; + uint16_t i16; + uint32_t i32; + uint16_t ptr; + uint32_t addr; + int8_t d8; + int16_t d16; + int32_t d32; switch(param) { @@ -2378,27 +2378,27 @@ static char* handle_param(char* s, UINT32 param) case PARAM_I8: i8 = FETCHD(); - s += sprintf( s, "%s", shexstring((INT8)i8, 0, FALSE) ); + s += sprintf( s, "%s", shexstring((int8_t)i8, 0, FALSE) ); break; case PARAM_I16: i16 = FETCHD16(); - s += sprintf( s, "%s", shexstring((INT16)i16, 0, FALSE) ); + s += sprintf( s, "%s", shexstring((int16_t)i16, 0, FALSE) ); break; case PARAM_UI8: i8 = FETCHD(); - s += sprintf( s, "%s", shexstring((UINT8)i8, 0, FALSE) ); + s += sprintf( s, "%s", shexstring((uint8_t)i8, 0, FALSE) ); break; case PARAM_UI16: i16 = FETCHD16(); - s += sprintf( s, "%s", shexstring((UINT16)i16, 0, FALSE) ); + s += sprintf( s, "%s", shexstring((uint16_t)i16, 0, FALSE) ); break; case PARAM_IMM64: if (operand_size == 2) { - UINT32 lo32 = FETCHD32(); + uint32_t lo32 = FETCHD32(); i32 = FETCHD32(); s += sprintf( s, "%s", hexstring64(lo32, i32) ); } else if( operand_size ) { @@ -2531,7 +2531,7 @@ static char* handle_param(char* s, UINT32 param) return s; } -static void handle_fpu(char *s, UINT8 op1, UINT8 op2) +static void handle_fpu(char *s, uint8_t op1, uint8_t op2) { switch (op1 & 0x7) { @@ -2908,10 +2908,10 @@ static void handle_fpu(char *s, UINT8 op1, UINT8 op2) } } -static void decode_opcode(char *s, const I386_OPCODE *op, UINT8 op1) +static void decode_opcode(char *s, const I386_OPCODE *op, uint8_t op1) { int i; - UINT8 op2; + uint8_t op2; if ((op->flags & SPECIAL64) && (address_size == 2)) op = &x64_opcode_alt[op->flags >> 24]; @@ -3057,9 +3057,9 @@ handle_unknown: sprintf(s, "???"); } -int i386_dasm_one_ex(char *buffer, UINT64 eip, const UINT8 *oprom, int mode) +int i386_dasm_one_ex(char *buffer, uint64_t eip, const uint8_t *oprom, int mode) { - UINT8 op; + uint8_t op; opcode_ptr = opcode_ptr_base = oprom; switch(mode) @@ -3105,7 +3105,7 @@ int i386_dasm_one_ex(char *buffer, UINT64 eip, const UINT8 *oprom, int mode) return (pc-eip) | dasm_flags | DASMFLAG_SUPPORTED; } -int i386_dasm_one(char *buffer, offs_t eip, const UINT8 *oprom, int mode) +int i386_dasm_one(char *buffer, offs_t eip, const uint8_t *oprom, int mode) { return i386_dasm_one_ex(buffer, eip, oprom, mode); } diff --git a/src/devices/cpu/i386/i386op16.hxx b/src/devices/cpu/i386/i386op16.hxx index c7ce16553b0..71c4ff8f28e 100644 --- a/src/devices/cpu/i386/i386op16.hxx +++ b/src/devices/cpu/i386/i386op16.hxx @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Ville Linde, Barry Rodewald, Carl, Philip Bennett -UINT16 i386_device::i386_shift_rotate16(UINT8 modrm, UINT32 value, UINT8 shift) +uint16_t i386_device::i386_shift_rotate16(uint8_t modrm, uint32_t value, uint8_t shift) { - UINT32 src = value & 0xffff; - UINT16 dst = value; + uint32_t src = value & 0xffff; + uint16_t dst = value; if( shift == 0 ) { CYCLES_RM(modrm, 3, 7); @@ -50,7 +50,7 @@ UINT16 i386_device::i386_shift_rotate16(UINT8 modrm, UINT32 value, UINT8 shift) CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); break; case 7: /* SAR rm16, 1 */ - dst = (INT16)(src) >> 1; + dst = (int16_t)(src) >> 1; m_CF = src & 0x1; m_OF = 0; SetSZPF16(dst); @@ -71,8 +71,8 @@ UINT16 i386_device::i386_shift_rotate16(UINT8 modrm, UINT32 value, UINT8 shift) break; } shift &= 15; - dst = ((src & ((UINT16)0xffff >> shift)) << shift) | - ((src & ((UINT16)0xffff << (16-shift))) >> (16-shift)); + dst = ((src & ((uint16_t)0xffff >> shift)) << shift) | + ((src & ((uint16_t)0xffff << (16-shift))) >> (16-shift)); m_CF = dst & 0x1; m_OF = (dst & 1) ^ (dst >> 15); CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); @@ -88,16 +88,16 @@ UINT16 i386_device::i386_shift_rotate16(UINT8 modrm, UINT32 value, UINT8 shift) break; } shift &= 15; - dst = ((src & ((UINT16)0xffff << shift)) >> shift) | - ((src & ((UINT16)0xffff >> (16-shift))) << (16-shift)); + dst = ((src & ((uint16_t)0xffff << shift)) >> shift) | + ((src & ((uint16_t)0xffff >> (16-shift))) << (16-shift)); m_CF = (dst >> 15) & 1; m_OF = ((dst >> 15) ^ (dst >> 14)) & 1; CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); break; case 2: /* RCL rm16, i8 */ shift %= 17; - dst = ((src & ((UINT16)0xffff >> shift)) << shift) | - ((src & ((UINT16)0xffff << (17-shift))) >> (17-shift)) | + dst = ((src & ((uint16_t)0xffff >> shift)) << shift) | + ((src & ((uint16_t)0xffff << (17-shift))) >> (17-shift)) | (m_CF << (shift-1)); if(shift) m_CF = (src >> (16-shift)) & 0x1; m_OF = m_CF ^ ((dst >> 15) & 1); @@ -105,8 +105,8 @@ UINT16 i386_device::i386_shift_rotate16(UINT8 modrm, UINT32 value, UINT8 shift) break; case 3: /* RCR rm16, i8 */ shift %= 17; - dst = ((src & ((UINT16)0xffff << shift)) >> shift) | - ((src & ((UINT16)0xffff >> (16-shift))) << (17-shift)) | + dst = ((src & ((uint16_t)0xffff << shift)) >> shift) | + ((src & ((uint16_t)0xffff >> (16-shift))) << (17-shift)) | (m_CF << (16-shift)); if(shift) m_CF = (src >> (shift-1)) & 0x1; m_OF = ((dst >> 15) ^ (dst >> 14)) & 1; @@ -129,7 +129,7 @@ UINT16 i386_device::i386_shift_rotate16(UINT8 modrm, UINT32 value, UINT8 shift) break; case 7: /* SAR rm16, i8 */ shift &= 31; - dst = (INT16)src >> shift; + dst = (int16_t)src >> shift; m_CF = (src & (1 << (shift-1))) ? 1 : 0; SetSZPF16(dst); CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); @@ -144,8 +144,8 @@ UINT16 i386_device::i386_shift_rotate16(UINT8 modrm, UINT32 value, UINT8 shift) void i386_device::i386_adc_rm16_r16() // Opcode 0x11 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); dst = LOAD_RM16(modrm); @@ -153,7 +153,7 @@ void i386_device::i386_adc_rm16_r16() // Opcode 0x11 STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG16(modrm); dst = READ16(ea); dst = ADC16(dst, src, m_CF); @@ -164,8 +164,8 @@ void i386_device::i386_adc_rm16_r16() // Opcode 0x11 void i386_device::i386_adc_r16_rm16() // Opcode 0x13 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); dst = LOAD_REG16(modrm); @@ -173,7 +173,7 @@ void i386_device::i386_adc_r16_rm16() // Opcode 0x13 STORE_REG16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); dst = LOAD_REG16(modrm); dst = ADC16(dst, src, m_CF); @@ -184,7 +184,7 @@ void i386_device::i386_adc_r16_rm16() // Opcode 0x13 void i386_device::i386_adc_ax_i16() // Opcode 0x15 { - UINT16 src, dst; + uint16_t src, dst; src = FETCH16(); dst = REG16(AX); dst = ADC16(dst, src, m_CF); @@ -194,8 +194,8 @@ void i386_device::i386_adc_ax_i16() // Opcode 0x15 void i386_device::i386_add_rm16_r16() // Opcode 0x01 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); dst = LOAD_RM16(modrm); @@ -203,7 +203,7 @@ void i386_device::i386_add_rm16_r16() // Opcode 0x01 STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG16(modrm); dst = READ16(ea); dst = ADD16(dst, src); @@ -214,8 +214,8 @@ void i386_device::i386_add_rm16_r16() // Opcode 0x01 void i386_device::i386_add_r16_rm16() // Opcode 0x03 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); dst = LOAD_REG16(modrm); @@ -223,7 +223,7 @@ void i386_device::i386_add_r16_rm16() // Opcode 0x03 STORE_REG16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); dst = LOAD_REG16(modrm); dst = ADD16(dst, src); @@ -234,7 +234,7 @@ void i386_device::i386_add_r16_rm16() // Opcode 0x03 void i386_device::i386_add_ax_i16() // Opcode 0x05 { - UINT16 src, dst; + uint16_t src, dst; src = FETCH16(); dst = REG16(AX); dst = ADD16(dst, src); @@ -244,8 +244,8 @@ void i386_device::i386_add_ax_i16() // Opcode 0x05 void i386_device::i386_and_rm16_r16() // Opcode 0x21 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); dst = LOAD_RM16(modrm); @@ -253,7 +253,7 @@ void i386_device::i386_and_rm16_r16() // Opcode 0x21 STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG16(modrm); dst = READ16(ea); dst = AND16(dst, src); @@ -264,8 +264,8 @@ void i386_device::i386_and_rm16_r16() // Opcode 0x21 void i386_device::i386_and_r16_rm16() // Opcode 0x23 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); dst = LOAD_REG16(modrm); @@ -273,7 +273,7 @@ void i386_device::i386_and_r16_rm16() // Opcode 0x23 STORE_REG16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); dst = LOAD_REG16(modrm); dst = AND16(dst, src); @@ -284,7 +284,7 @@ void i386_device::i386_and_r16_rm16() // Opcode 0x23 void i386_device::i386_and_ax_i16() // Opcode 0x25 { - UINT16 src, dst; + uint16_t src, dst; src = FETCH16(); dst = REG16(AX); dst = AND16(dst, src); @@ -294,13 +294,13 @@ void i386_device::i386_and_ax_i16() // Opcode 0x25 void i386_device::i386_bsf_r16_rm16() // Opcode 0x0f bc { - UINT16 src, dst, temp; - UINT8 modrm = FETCH(); + uint16_t src, dst, temp; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); } @@ -323,13 +323,13 @@ void i386_device::i386_bsf_r16_rm16() // Opcode 0x0f bc void i386_device::i386_bsr_r16_rm16() // Opcode 0x0f bd { - UINT16 src, dst, temp; - UINT8 modrm = FETCH(); + uint16_t src, dst, temp; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); } @@ -353,10 +353,10 @@ void i386_device::i386_bsr_r16_rm16() // Opcode 0x0f bd void i386_device::i386_bt_rm16_r16() // Opcode 0x0f a3 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 bit = LOAD_REG16(modrm); + uint16_t dst = LOAD_RM16(modrm); + uint16_t bit = LOAD_REG16(modrm); if( dst & (1 << (bit & 0xf)) ) m_CF = 1; @@ -365,13 +365,13 @@ void i386_device::i386_bt_rm16_r16() // Opcode 0x0f a3 CYCLES(CYCLES_BT_REG_REG); } else { - UINT8 segment; - UINT32 ea = GetNonTranslatedEA(modrm,&segment); - UINT16 bit = LOAD_REG16(modrm); + uint8_t segment; + uint32_t ea = GetNonTranslatedEA(modrm,&segment); + uint16_t bit = LOAD_REG16(modrm); ea += 2*(bit/16); ea = i386_translate(segment,(m_address_size)?ea:(ea&0xffff),0); bit %= 16; - UINT16 dst = READ16(ea); + uint16_t dst = READ16(ea); if( dst & (1 << bit) ) m_CF = 1; @@ -384,10 +384,10 @@ void i386_device::i386_bt_rm16_r16() // Opcode 0x0f a3 void i386_device::i386_btc_rm16_r16() // Opcode 0x0f bb { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 bit = LOAD_REG16(modrm); + uint16_t dst = LOAD_RM16(modrm); + uint16_t bit = LOAD_REG16(modrm); if( dst & (1 << (bit & 0xf)) ) m_CF = 1; @@ -398,13 +398,13 @@ void i386_device::i386_btc_rm16_r16() // Opcode 0x0f bb STORE_RM16(modrm, dst); CYCLES(CYCLES_BTC_REG_REG); } else { - UINT8 segment; - UINT32 ea = GetNonTranslatedEA(modrm,&segment); - UINT16 bit = LOAD_REG16(modrm); + uint8_t segment; + uint32_t ea = GetNonTranslatedEA(modrm,&segment); + uint16_t bit = LOAD_REG16(modrm); ea += 2*(bit/16); ea = i386_translate(segment,(m_address_size)?ea:(ea&0xffff),1); bit %= 16; - UINT16 dst = READ16(ea); + uint16_t dst = READ16(ea); if( dst & (1 << bit) ) m_CF = 1; @@ -419,10 +419,10 @@ void i386_device::i386_btc_rm16_r16() // Opcode 0x0f bb void i386_device::i386_btr_rm16_r16() // Opcode 0x0f b3 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 bit = LOAD_REG16(modrm); + uint16_t dst = LOAD_RM16(modrm); + uint16_t bit = LOAD_REG16(modrm); if( dst & (1 << (bit & 0xf)) ) m_CF = 1; @@ -433,13 +433,13 @@ void i386_device::i386_btr_rm16_r16() // Opcode 0x0f b3 STORE_RM16(modrm, dst); CYCLES(CYCLES_BTR_REG_REG); } else { - UINT8 segment; - UINT32 ea = GetNonTranslatedEA(modrm,&segment); - UINT16 bit = LOAD_REG16(modrm); + uint8_t segment; + uint32_t ea = GetNonTranslatedEA(modrm,&segment); + uint16_t bit = LOAD_REG16(modrm); ea += 2*(bit/16); ea = i386_translate(segment,(m_address_size)?ea:(ea&0xffff),1); bit %= 16; - UINT16 dst = READ16(ea); + uint16_t dst = READ16(ea); if( dst & (1 << bit) ) m_CF = 1; @@ -454,10 +454,10 @@ void i386_device::i386_btr_rm16_r16() // Opcode 0x0f b3 void i386_device::i386_bts_rm16_r16() // Opcode 0x0f ab { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 bit = LOAD_REG16(modrm); + uint16_t dst = LOAD_RM16(modrm); + uint16_t bit = LOAD_REG16(modrm); if( dst & (1 << (bit & 0xf)) ) m_CF = 1; @@ -468,13 +468,13 @@ void i386_device::i386_bts_rm16_r16() // Opcode 0x0f ab STORE_RM16(modrm, dst); CYCLES(CYCLES_BTS_REG_REG); } else { - UINT8 segment; - UINT32 ea = GetNonTranslatedEA(modrm,&segment); - UINT16 bit = LOAD_REG16(modrm); + uint8_t segment; + uint32_t ea = GetNonTranslatedEA(modrm,&segment); + uint16_t bit = LOAD_REG16(modrm); ea += 2*(bit/16); ea = i386_translate(segment,(m_address_size)?ea:(ea&0xffff),1); bit %= 16; - UINT16 dst = READ16(ea); + uint16_t dst = READ16(ea); if( dst & (1 << bit) ) m_CF = 1; @@ -489,8 +489,8 @@ void i386_device::i386_bts_rm16_r16() // Opcode 0x0f ab void i386_device::i386_call_abs16() // Opcode 0x9a { - UINT16 offset = FETCH16(); - UINT16 ptr = FETCH16(); + uint16_t offset = FETCH16(); + uint16_t ptr = FETCH16(); if( PROTECTED_MODE && !V8086_MODE) { @@ -511,7 +511,7 @@ void i386_device::i386_call_abs16() // Opcode 0x9a void i386_device::i386_call_rel16() // Opcode 0xe8 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); PUSH16(m_eip ); if (m_sreg[CS].d) @@ -528,21 +528,21 @@ void i386_device::i386_call_rel16() // Opcode 0xe8 void i386_device::i386_cbw() // Opcode 0x98 { - REG16(AX) = (INT16)((INT8)REG8(AL)); + REG16(AX) = (int16_t)((int8_t)REG8(AL)); CYCLES(CYCLES_CBW); } void i386_device::i386_cmp_rm16_r16() // Opcode 0x39 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); dst = LOAD_RM16(modrm); SUB16(dst, src); CYCLES(CYCLES_CMP_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = LOAD_REG16(modrm); dst = READ16(ea); SUB16(dst, src); @@ -552,15 +552,15 @@ void i386_device::i386_cmp_rm16_r16() // Opcode 0x39 void i386_device::i386_cmp_r16_rm16() // Opcode 0x3b { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); dst = LOAD_REG16(modrm); SUB16(dst, src); CYCLES(CYCLES_CMP_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); dst = LOAD_REG16(modrm); SUB16(dst, src); @@ -570,7 +570,7 @@ void i386_device::i386_cmp_r16_rm16() // Opcode 0x3b void i386_device::i386_cmp_ax_i16() // Opcode 0x3d { - UINT16 src, dst; + uint16_t src, dst; src = FETCH16(); dst = REG16(AX); SUB16(dst, src); @@ -579,8 +579,8 @@ void i386_device::i386_cmp_ax_i16() // Opcode 0x3d void i386_device::i386_cmpsw() // Opcode 0xa7 { - UINT32 eas, ead; - UINT16 src, dst; + uint32_t eas, ead; + uint16_t src, dst; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); } else { @@ -655,82 +655,82 @@ void i386_device::i386_dec_di() // Opcode 0x4f void i386_device::i386_imul_r16_rm16() // Opcode 0x0f af { - UINT8 modrm = FETCH(); - INT32 result; - INT32 src, dst; + uint8_t modrm = FETCH(); + int32_t result; + int32_t src, dst; if( modrm >= 0xc0 ) { - src = (INT32)(INT16)LOAD_RM16(modrm); + src = (int32_t)(int16_t)LOAD_RM16(modrm); CYCLES(CYCLES_IMUL16_REG_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); - src = (INT32)(INT16)READ16(ea); + uint32_t ea = GetEA(modrm,0); + src = (int32_t)(int16_t)READ16(ea); CYCLES(CYCLES_IMUL16_REG_MEM); /* TODO: Correct multiply timing */ } - dst = (INT32)(INT16)LOAD_REG16(modrm); + dst = (int32_t)(int16_t)LOAD_REG16(modrm); result = src * dst; - STORE_REG16(modrm, (UINT16)result); + STORE_REG16(modrm, (uint16_t)result); - m_CF = m_OF = !(result == (INT32)(INT16)result); + m_CF = m_OF = !(result == (int32_t)(int16_t)result); } void i386_device::i386_imul_r16_rm16_i16() // Opcode 0x69 { - UINT8 modrm = FETCH(); - INT32 result; - INT32 src, dst; + uint8_t modrm = FETCH(); + int32_t result; + int32_t src, dst; if( modrm >= 0xc0 ) { - dst = (INT32)(INT16)LOAD_RM16(modrm); + dst = (int32_t)(int16_t)LOAD_RM16(modrm); CYCLES(CYCLES_IMUL16_REG_IMM_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); - dst = (INT32)(INT16)READ16(ea); + uint32_t ea = GetEA(modrm,0); + dst = (int32_t)(int16_t)READ16(ea); CYCLES(CYCLES_IMUL16_MEM_IMM_REG); /* TODO: Correct multiply timing */ } - src = (INT32)(INT16)FETCH16(); + src = (int32_t)(int16_t)FETCH16(); result = src * dst; - STORE_REG16(modrm, (UINT16)result); + STORE_REG16(modrm, (uint16_t)result); - m_CF = m_OF = !(result == (INT32)(INT16)result); + m_CF = m_OF = !(result == (int32_t)(int16_t)result); } void i386_device::i386_imul_r16_rm16_i8() // Opcode 0x6b { - UINT8 modrm = FETCH(); - INT32 result; - INT32 src, dst; + uint8_t modrm = FETCH(); + int32_t result; + int32_t src, dst; if( modrm >= 0xc0 ) { - dst = (INT32)(INT16)LOAD_RM16(modrm); + dst = (int32_t)(int16_t)LOAD_RM16(modrm); CYCLES(CYCLES_IMUL16_REG_IMM_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); - dst = (INT32)(INT16)READ16(ea); + uint32_t ea = GetEA(modrm,0); + dst = (int32_t)(int16_t)READ16(ea); CYCLES(CYCLES_IMUL16_MEM_IMM_REG); /* TODO: Correct multiply timing */ } - src = (INT32)(INT8)FETCH(); + src = (int32_t)(int8_t)FETCH(); result = src * dst; - STORE_REG16(modrm, (UINT16)result); + STORE_REG16(modrm, (uint16_t)result); - m_CF = m_OF = !(result == (INT32)(INT16)result); + m_CF = m_OF = !(result == (int32_t)(int16_t)result); } void i386_device::i386_in_ax_i8() // Opcode 0xe5 { - UINT16 port = FETCH(); - UINT16 data = READPORT16(port); + uint16_t port = FETCH(); + uint16_t data = READPORT16(port); REG16(AX) = data; CYCLES(CYCLES_IN_VAR); } void i386_device::i386_in_ax_dx() // Opcode 0xed { - UINT16 port = REG16(DX); - UINT16 data = READPORT16(port); + uint16_t port = REG16(DX); + uint16_t data = READPORT16(port); REG16(AX) = data; CYCLES(CYCLES_IN); } @@ -804,7 +804,7 @@ void i386_device::i386_iret16() // Opcode 0xcf void i386_device::i386_ja_rel16() // Opcode 0x0f 87 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_CF == 0 && m_ZF == 0 ) { if (m_sreg[CS].d) { @@ -823,7 +823,7 @@ void i386_device::i386_ja_rel16() // Opcode 0x0f 87 void i386_device::i386_jbe_rel16() // Opcode 0x0f 86 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_CF != 0 || m_ZF != 0 ) { if (m_sreg[CS].d) { @@ -842,7 +842,7 @@ void i386_device::i386_jbe_rel16() // Opcode 0x0f 86 void i386_device::i386_jc_rel16() // Opcode 0x0f 82 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_CF != 0 ) { if (m_sreg[CS].d) { @@ -861,7 +861,7 @@ void i386_device::i386_jc_rel16() // Opcode 0x0f 82 void i386_device::i386_jg_rel16() // Opcode 0x0f 8f { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_ZF == 0 && (m_SF == m_OF) ) { if (m_sreg[CS].d) { @@ -880,7 +880,7 @@ void i386_device::i386_jg_rel16() // Opcode 0x0f 8f void i386_device::i386_jge_rel16() // Opcode 0x0f 8d { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if(m_SF == m_OF) { if (m_sreg[CS].d) { @@ -899,7 +899,7 @@ void i386_device::i386_jge_rel16() // Opcode 0x0f 8d void i386_device::i386_jl_rel16() // Opcode 0x0f 8c { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( (m_SF != m_OF) ) { if (m_sreg[CS].d) { @@ -918,7 +918,7 @@ void i386_device::i386_jl_rel16() // Opcode 0x0f 8c void i386_device::i386_jle_rel16() // Opcode 0x0f 8e { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_ZF != 0 || (m_SF != m_OF) ) { if (m_sreg[CS].d) { @@ -937,7 +937,7 @@ void i386_device::i386_jle_rel16() // Opcode 0x0f 8e void i386_device::i386_jnc_rel16() // Opcode 0x0f 83 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_CF == 0 ) { if (m_sreg[CS].d) { @@ -956,7 +956,7 @@ void i386_device::i386_jnc_rel16() // Opcode 0x0f 83 void i386_device::i386_jno_rel16() // Opcode 0x0f 81 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_OF == 0 ) { if (m_sreg[CS].d) { @@ -975,7 +975,7 @@ void i386_device::i386_jno_rel16() // Opcode 0x0f 81 void i386_device::i386_jnp_rel16() // Opcode 0x0f 8b { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_PF == 0 ) { if (m_sreg[CS].d) { @@ -994,7 +994,7 @@ void i386_device::i386_jnp_rel16() // Opcode 0x0f 8b void i386_device::i386_jns_rel16() // Opcode 0x0f 89 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_SF == 0 ) { if (m_sreg[CS].d) { @@ -1013,7 +1013,7 @@ void i386_device::i386_jns_rel16() // Opcode 0x0f 89 void i386_device::i386_jnz_rel16() // Opcode 0x0f 85 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_ZF == 0 ) { if (m_sreg[CS].d) { @@ -1032,7 +1032,7 @@ void i386_device::i386_jnz_rel16() // Opcode 0x0f 85 void i386_device::i386_jo_rel16() // Opcode 0x0f 80 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_OF != 0 ) { if (m_sreg[CS].d) { @@ -1051,7 +1051,7 @@ void i386_device::i386_jo_rel16() // Opcode 0x0f 80 void i386_device::i386_jp_rel16() // Opcode 0x0f 8a { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_PF != 0 ) { if (m_sreg[CS].d) { @@ -1070,7 +1070,7 @@ void i386_device::i386_jp_rel16() // Opcode 0x0f 8a void i386_device::i386_js_rel16() // Opcode 0x0f 88 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_SF != 0 ) { if (m_sreg[CS].d) { @@ -1089,7 +1089,7 @@ void i386_device::i386_js_rel16() // Opcode 0x0f 88 void i386_device::i386_jz_rel16() // Opcode 0x0f 84 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if( m_ZF != 0 ) { if (m_sreg[CS].d) { @@ -1108,7 +1108,7 @@ void i386_device::i386_jz_rel16() // Opcode 0x0f 84 void i386_device::i386_jcxz16() // Opcode 0xe3 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); int val = (m_address_size)?(REG32(ECX) == 0):(REG16(CX) == 0); if( val ) { if (m_sreg[CS].d) @@ -1128,7 +1128,7 @@ void i386_device::i386_jcxz16() // Opcode 0xe3 void i386_device::i386_jmp_rel16() // Opcode 0xe9 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); if (m_sreg[CS].d) { @@ -1144,8 +1144,8 @@ void i386_device::i386_jmp_rel16() // Opcode 0xe9 void i386_device::i386_jmp_abs16() // Opcode 0xea { - UINT16 address = FETCH16(); - UINT16 segment = FETCH16(); + uint16_t address = FETCH16(); + uint16_t segment = FETCH16(); if( PROTECTED_MODE && !V8086_MODE) { @@ -1164,18 +1164,18 @@ void i386_device::i386_jmp_abs16() // Opcode 0xea void i386_device::i386_lea16() // Opcode 0x8d { - UINT8 modrm = FETCH(); - UINT32 ea = GetNonTranslatedEA(modrm,nullptr); + uint8_t modrm = FETCH(); + uint32_t ea = GetNonTranslatedEA(modrm,nullptr); STORE_REG16(modrm, ea); CYCLES(CYCLES_LEA); } void i386_device::i386_enter16() // Opcode 0xc8 { - UINT16 framesize = FETCH16(); - UINT8 level = FETCH() % 32; - UINT8 x; - UINT16 frameptr; + uint16_t framesize = FETCH16(); + uint8_t level = FETCH() % 32; + uint8_t x; + uint16_t frameptr; PUSH16(REG16(BP)); if(!STACK_32BIT) @@ -1212,7 +1212,7 @@ void i386_device::i386_leave16() // Opcode 0xc9 void i386_device::i386_lodsw() // Opcode 0xad { - UINT32 eas; + uint32_t eas; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); } else { @@ -1225,8 +1225,8 @@ void i386_device::i386_lodsw() // Opcode 0xad void i386_device::i386_loop16() // Opcode 0xe2 { - INT8 disp = FETCH(); - INT32 val = (m_address_size)?(--REG32(ECX)):(--REG16(CX)); + int8_t disp = FETCH(); + int32_t val = (m_address_size)?(--REG32(ECX)):(--REG16(CX)); if( val != 0 ) { if (m_sreg[CS].d) { @@ -1243,8 +1243,8 @@ void i386_device::i386_loop16() // Opcode 0xe2 void i386_device::i386_loopne16() // Opcode 0xe0 { - INT8 disp = FETCH(); - INT32 val = (m_address_size)?(--REG32(ECX)):(--REG16(CX)); + int8_t disp = FETCH(); + int32_t val = (m_address_size)?(--REG32(ECX)):(--REG16(CX)); if( val != 0 && m_ZF == 0 ) { if (m_sreg[CS].d) { @@ -1261,8 +1261,8 @@ void i386_device::i386_loopne16() // Opcode 0xe0 void i386_device::i386_loopz16() // Opcode 0xe1 { - INT8 disp = FETCH(); - INT32 val = (m_address_size)?(--REG32(ECX)):(--REG16(CX)); + int8_t disp = FETCH(); + int32_t val = (m_address_size)?(--REG32(ECX)):(--REG16(CX)); if( val != 0 && m_ZF != 0 ) { if (m_sreg[CS].d) { @@ -1279,14 +1279,14 @@ void i386_device::i386_loopz16() // Opcode 0xe1 void i386_device::i386_mov_rm16_r16() // Opcode 0x89 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); STORE_RM16(modrm, src); CYCLES(CYCLES_MOV_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG16(modrm); WRITE16(ea, src); CYCLES(CYCLES_MOV_REG_MEM); @@ -1295,14 +1295,14 @@ void i386_device::i386_mov_rm16_r16() // Opcode 0x89 void i386_device::i386_mov_r16_rm16() // Opcode 0x8b { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); STORE_REG16(modrm, src); CYCLES(CYCLES_MOV_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); STORE_REG16(modrm, src); CYCLES(CYCLES_MOV_MEM_REG); @@ -1311,14 +1311,14 @@ void i386_device::i386_mov_r16_rm16() // Opcode 0x8b void i386_device::i386_mov_rm16_i16() // Opcode 0xc7 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 value = FETCH16(); + uint16_t value = FETCH16(); STORE_RM16(modrm, value); CYCLES(CYCLES_MOV_IMM_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 value = FETCH16(); + uint32_t ea = GetEA(modrm,1); + uint16_t value = FETCH16(); WRITE16(ea, value); CYCLES(CYCLES_MOV_IMM_MEM); } @@ -1326,7 +1326,7 @@ void i386_device::i386_mov_rm16_i16() // Opcode 0xc7 void i386_device::i386_mov_ax_m16() // Opcode 0xa1 { - UINT32 offset, ea; + uint32_t offset, ea; if( m_address_size ) { offset = FETCH32(); } else { @@ -1344,7 +1344,7 @@ void i386_device::i386_mov_ax_m16() // Opcode 0xa1 void i386_device::i386_mov_m16_ax() // Opcode 0xa3 { - UINT32 offset, ea; + uint32_t offset, ea; if( m_address_size ) { offset = FETCH32(); } else { @@ -1410,8 +1410,8 @@ void i386_device::i386_mov_di_i16() // Opcode 0xbf void i386_device::i386_movsw() // Opcode 0xa5 { - UINT32 eas, ead; - UINT16 v; + uint32_t eas, ead; + uint16_t v; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); } else { @@ -1427,14 +1427,14 @@ void i386_device::i386_movsw() // Opcode 0xa5 void i386_device::i386_movsx_r16_rm8() // Opcode 0x0f be { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - INT16 src = (INT8)LOAD_RM8(modrm); + int16_t src = (int8_t)LOAD_RM8(modrm); STORE_REG16(modrm, src); CYCLES(CYCLES_MOVSX_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); - INT16 src = (INT8)READ8(ea); + uint32_t ea = GetEA(modrm,0); + int16_t src = (int8_t)READ8(ea); STORE_REG16(modrm, src); CYCLES(CYCLES_MOVSX_MEM_REG); } @@ -1442,14 +1442,14 @@ void i386_device::i386_movsx_r16_rm8() // Opcode 0x0f be void i386_device::i386_movzx_r16_rm8() // Opcode 0x0f b6 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 src = (UINT8)LOAD_RM8(modrm); + uint16_t src = (uint8_t)LOAD_RM8(modrm); STORE_REG16(modrm, src); CYCLES(CYCLES_MOVZX_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); - UINT16 src = (UINT8)READ8(ea); + uint32_t ea = GetEA(modrm,0); + uint16_t src = (uint8_t)READ8(ea); STORE_REG16(modrm, src); CYCLES(CYCLES_MOVZX_MEM_REG); } @@ -1457,8 +1457,8 @@ void i386_device::i386_movzx_r16_rm8() // Opcode 0x0f b6 void i386_device::i386_or_rm16_r16() // Opcode 0x09 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); dst = LOAD_RM16(modrm); @@ -1466,7 +1466,7 @@ void i386_device::i386_or_rm16_r16() // Opcode 0x09 STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG16(modrm); dst = READ16(ea); dst = OR16(dst, src); @@ -1477,8 +1477,8 @@ void i386_device::i386_or_rm16_r16() // Opcode 0x09 void i386_device::i386_or_r16_rm16() // Opcode 0x0b { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); dst = LOAD_REG16(modrm); @@ -1486,7 +1486,7 @@ void i386_device::i386_or_r16_rm16() // Opcode 0x0b STORE_REG16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); dst = LOAD_REG16(modrm); dst = OR16(dst, src); @@ -1497,7 +1497,7 @@ void i386_device::i386_or_r16_rm16() // Opcode 0x0b void i386_device::i386_or_ax_i16() // Opcode 0x0d { - UINT16 src, dst; + uint16_t src, dst; src = FETCH16(); dst = REG16(AX); dst = OR16(dst, src); @@ -1507,23 +1507,23 @@ void i386_device::i386_or_ax_i16() // Opcode 0x0d void i386_device::i386_out_ax_i8() // Opcode 0xe7 { - UINT16 port = FETCH(); - UINT16 data = REG16(AX); + uint16_t port = FETCH(); + uint16_t data = REG16(AX); WRITEPORT16(port, data); CYCLES(CYCLES_OUT_VAR); } void i386_device::i386_out_ax_dx() // Opcode 0xef { - UINT16 port = REG16(DX); - UINT16 data = REG16(AX); + uint16_t port = REG16(DX); + uint16_t data = REG16(AX); WRITEPORT16(port, data); CYCLES(CYCLES_OUT); } void i386_device::i386_pop_ax() // Opcode 0x58 { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+1) == 0) REG16(AX) = POP16(); else @@ -1533,7 +1533,7 @@ void i386_device::i386_pop_ax() // Opcode 0x58 void i386_device::i386_pop_cx() // Opcode 0x59 { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+1) == 0) REG16(CX) = POP16(); else @@ -1543,7 +1543,7 @@ void i386_device::i386_pop_cx() // Opcode 0x59 void i386_device::i386_pop_dx() // Opcode 0x5a { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+1) == 0) REG16(DX) = POP16(); else @@ -1553,7 +1553,7 @@ void i386_device::i386_pop_dx() // Opcode 0x5a void i386_device::i386_pop_bx() // Opcode 0x5b { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+1) == 0) REG16(BX) = POP16(); else @@ -1563,7 +1563,7 @@ void i386_device::i386_pop_bx() // Opcode 0x5b void i386_device::i386_pop_sp() // Opcode 0x5c { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+1) == 0) REG16(SP) = POP16(); else @@ -1573,7 +1573,7 @@ void i386_device::i386_pop_sp() // Opcode 0x5c void i386_device::i386_pop_bp() // Opcode 0x5d { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+1) == 0) REG16(BP) = POP16(); else @@ -1583,7 +1583,7 @@ void i386_device::i386_pop_bp() // Opcode 0x5d void i386_device::i386_pop_si() // Opcode 0x5e { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+1) == 0) REG16(SI) = POP16(); else @@ -1593,7 +1593,7 @@ void i386_device::i386_pop_si() // Opcode 0x5e void i386_device::i386_pop_di() // Opcode 0x5f { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+1) == 0) REG16(DI) = POP16(); else @@ -1603,8 +1603,8 @@ void i386_device::i386_pop_di() // Opcode 0x5f bool i386_device::i386_pop_seg16(int segment) { - UINT32 ea, offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); - UINT16 value; + uint32_t ea, offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint16_t value; bool fault; if(i386_limit_check(SS,offset+1) == 0) { @@ -1659,13 +1659,13 @@ void i386_device::i386_pop_ss16() // Opcode 0x17 void i386_device::i386_pop_rm16() // Opcode 0x8f { - UINT8 modrm = FETCH(); - UINT16 value; - UINT32 ea, offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint8_t modrm = FETCH(); + uint16_t value; + uint32_t ea, offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+1) == 0) { - UINT32 temp_sp = REG32(ESP); + uint32_t temp_sp = REG32(ESP); value = POP16(); if( modrm >= 0xc0 ) { @@ -1676,7 +1676,7 @@ void i386_device::i386_pop_rm16() // Opcode 0x8f { WRITE16(ea, value); } - catch(UINT64 e) + catch(uint64_t e) { REG32(ESP) = temp_sp; throw e; @@ -1690,7 +1690,7 @@ void i386_device::i386_pop_rm16() // Opcode 0x8f void i386_device::i386_popa() // Opcode 0x61 { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+15) == 0) { @@ -1710,11 +1710,11 @@ void i386_device::i386_popa() // Opcode 0x61 void i386_device::i386_popf() // Opcode 0x9d { - UINT32 value; - UINT32 current = get_flags(); - UINT8 IOPL = (current >> 12) & 0x03; - UINT32 mask = 0x7fd5; - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t value; + uint32_t current = get_flags(); + uint8_t IOPL = (current >> 12) & 0x03; + uint32_t mask = 0x7fd5; + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); // IOPL can only change if CPL is 0 if(m_CPL != 0) @@ -1746,7 +1746,7 @@ void i386_device::i386_popf() // Opcode 0x9d void i386_device::i386_push_ax() // Opcode 0x50 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1760,7 +1760,7 @@ void i386_device::i386_push_ax() // Opcode 0x50 void i386_device::i386_push_cx() // Opcode 0x51 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1774,7 +1774,7 @@ void i386_device::i386_push_cx() // Opcode 0x51 void i386_device::i386_push_dx() // Opcode 0x52 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1788,7 +1788,7 @@ void i386_device::i386_push_dx() // Opcode 0x52 void i386_device::i386_push_bx() // Opcode 0x53 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1802,7 +1802,7 @@ void i386_device::i386_push_bx() // Opcode 0x53 void i386_device::i386_push_sp() // Opcode 0x54 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1816,7 +1816,7 @@ void i386_device::i386_push_sp() // Opcode 0x54 void i386_device::i386_push_bp() // Opcode 0x55 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1830,7 +1830,7 @@ void i386_device::i386_push_bp() // Opcode 0x55 void i386_device::i386_push_si() // Opcode 0x56 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1844,7 +1844,7 @@ void i386_device::i386_push_si() // Opcode 0x56 void i386_device::i386_push_di() // Opcode 0x57 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1858,7 +1858,7 @@ void i386_device::i386_push_di() // Opcode 0x57 void i386_device::i386_push_cs16() // Opcode 0x0e { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1872,7 +1872,7 @@ void i386_device::i386_push_cs16() // Opcode 0x0e void i386_device::i386_push_ds16() // Opcode 0x1e { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1886,7 +1886,7 @@ void i386_device::i386_push_ds16() // Opcode 0x1e void i386_device::i386_push_es16() // Opcode 0x06 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1900,7 +1900,7 @@ void i386_device::i386_push_es16() // Opcode 0x06 void i386_device::i386_push_fs16() // Opcode 0x0f a0 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1914,7 +1914,7 @@ void i386_device::i386_push_fs16() // Opcode 0x0f a0 void i386_device::i386_push_gs16() // Opcode 0x0f a8 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1928,7 +1928,7 @@ void i386_device::i386_push_gs16() // Opcode 0x0f a8 void i386_device::i386_push_ss16() // Opcode 0x16 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1942,8 +1942,8 @@ void i386_device::i386_push_ss16() // Opcode 0x16 void i386_device::i386_push_i16() // Opcode 0x68 { - UINT16 value = FETCH16(); - UINT32 offset; + uint16_t value = FETCH16(); + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1957,8 +1957,8 @@ void i386_device::i386_push_i16() // Opcode 0x68 void i386_device::i386_pusha() // Opcode 0x60 { - UINT16 temp = REG16(SP); - UINT32 offset; + uint16_t temp = REG16(SP); + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 16; else @@ -1981,7 +1981,7 @@ void i386_device::i386_pusha() // Opcode 0x60 void i386_device::i386_pushf() // Opcode 0x9c { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 2; else @@ -1995,7 +1995,7 @@ void i386_device::i386_pushf() // Opcode 0x9c void i386_device::i386_ret_near16_i16() // Opcode 0xc2 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); m_eip = POP16(); REG16(SP) += disp; CHANGE_PC(m_eip); @@ -2011,8 +2011,8 @@ void i386_device::i386_ret_near16() // Opcode 0xc3 void i386_device::i386_sbb_rm16_r16() // Opcode 0x19 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); dst = LOAD_RM16(modrm); @@ -2020,7 +2020,7 @@ void i386_device::i386_sbb_rm16_r16() // Opcode 0x19 STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG16(modrm); dst = READ16(ea); dst = SBB16(dst, src, m_CF); @@ -2031,8 +2031,8 @@ void i386_device::i386_sbb_rm16_r16() // Opcode 0x19 void i386_device::i386_sbb_r16_rm16() // Opcode 0x1b { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); dst = LOAD_REG16(modrm); @@ -2040,7 +2040,7 @@ void i386_device::i386_sbb_r16_rm16() // Opcode 0x1b STORE_REG16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); dst = LOAD_REG16(modrm); dst = SBB16(dst, src, m_CF); @@ -2051,7 +2051,7 @@ void i386_device::i386_sbb_r16_rm16() // Opcode 0x1b void i386_device::i386_sbb_ax_i16() // Opcode 0x1d { - UINT16 src, dst; + uint16_t src, dst; src = FETCH16(); dst = REG16(AX); dst = SBB16(dst, src, m_CF); @@ -2061,8 +2061,8 @@ void i386_device::i386_sbb_ax_i16() // Opcode 0x1d void i386_device::i386_scasw() // Opcode 0xaf { - UINT32 eas; - UINT16 src, dst; + uint32_t eas; + uint16_t src, dst; eas = i386_translate(ES, m_address_size ? REG32(EDI) : REG16(DI), 0 ); src = READ16(eas); dst = REG16(AX); @@ -2073,11 +2073,11 @@ void i386_device::i386_scasw() // Opcode 0xaf void i386_device::i386_shld16_i8() // Opcode 0x0f a4 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 upper = LOAD_REG16(modrm); - UINT8 shift = FETCH(); + uint16_t dst = LOAD_RM16(modrm); + uint16_t upper = LOAD_REG16(modrm); + uint8_t shift = FETCH(); shift &= 31; if( shift == 0 ) { } else if( shift > 15 ) { @@ -2095,10 +2095,10 @@ void i386_device::i386_shld16_i8() // Opcode 0x0f a4 STORE_RM16(modrm, dst); CYCLES(CYCLES_SHLD_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); - UINT16 upper = LOAD_REG16(modrm); - UINT8 shift = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); + uint16_t upper = LOAD_REG16(modrm); + uint8_t shift = FETCH(); shift &= 31; if( shift == 0 ) { } else if( shift > 15 ) { @@ -2119,11 +2119,11 @@ void i386_device::i386_shld16_i8() // Opcode 0x0f a4 void i386_device::i386_shld16_cl() // Opcode 0x0f a5 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 upper = LOAD_REG16(modrm); - UINT8 shift = REG8(CL); + uint16_t dst = LOAD_RM16(modrm); + uint16_t upper = LOAD_REG16(modrm); + uint8_t shift = REG8(CL); shift &= 31; if( shift == 0 ) { } else if( shift > 15 ) { @@ -2140,10 +2140,10 @@ void i386_device::i386_shld16_cl() // Opcode 0x0f a5 STORE_RM16(modrm, dst); CYCLES(CYCLES_SHLD_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); - UINT16 upper = LOAD_REG16(modrm); - UINT8 shift = REG8(CL); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); + uint16_t upper = LOAD_REG16(modrm); + uint8_t shift = REG8(CL); shift &= 31; if( shift == 0 ) { } else if( shift > 15 ) { @@ -2164,11 +2164,11 @@ void i386_device::i386_shld16_cl() // Opcode 0x0f a5 void i386_device::i386_shrd16_i8() // Opcode 0x0f ac { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 upper = LOAD_REG16(modrm); - UINT8 shift = FETCH(); + uint16_t dst = LOAD_RM16(modrm); + uint16_t upper = LOAD_REG16(modrm); + uint8_t shift = FETCH(); shift &= 31; if( shift == 0) { } else if( shift > 15 ) { @@ -2185,10 +2185,10 @@ void i386_device::i386_shrd16_i8() // Opcode 0x0f ac STORE_RM16(modrm, dst); CYCLES(CYCLES_SHRD_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); - UINT16 upper = LOAD_REG16(modrm); - UINT8 shift = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); + uint16_t upper = LOAD_REG16(modrm); + uint8_t shift = FETCH(); shift &= 31; if( shift == 0) { } else if( shift > 15 ) { @@ -2209,11 +2209,11 @@ void i386_device::i386_shrd16_i8() // Opcode 0x0f ac void i386_device::i386_shrd16_cl() // Opcode 0x0f ad { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 upper = LOAD_REG16(modrm); - UINT8 shift = REG8(CL); + uint16_t dst = LOAD_RM16(modrm); + uint16_t upper = LOAD_REG16(modrm); + uint8_t shift = REG8(CL); shift &= 31; if( shift == 0) { } else if( shift > 15 ) { @@ -2230,10 +2230,10 @@ void i386_device::i386_shrd16_cl() // Opcode 0x0f ad STORE_RM16(modrm, dst); CYCLES(CYCLES_SHRD_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); - UINT16 upper = LOAD_REG16(modrm); - UINT8 shift = REG8(CL); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); + uint16_t upper = LOAD_REG16(modrm); + uint8_t shift = REG8(CL); shift &= 31; if( shift == 0) { } else if( shift > 15 ) { @@ -2254,7 +2254,7 @@ void i386_device::i386_shrd16_cl() // Opcode 0x0f ad void i386_device::i386_stosw() // Opcode 0xab { - UINT32 ead; + uint32_t ead; ead = i386_translate(ES, m_address_size ? REG32(EDI) : REG16(DI), 1 ); WRITE16(ead, REG16(AX)); BUMP_DI(2); @@ -2263,8 +2263,8 @@ void i386_device::i386_stosw() // Opcode 0xab void i386_device::i386_sub_rm16_r16() // Opcode 0x29 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); dst = LOAD_RM16(modrm); @@ -2272,7 +2272,7 @@ void i386_device::i386_sub_rm16_r16() // Opcode 0x29 STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG16(modrm); dst = READ16(ea); dst = SUB16(dst, src); @@ -2283,8 +2283,8 @@ void i386_device::i386_sub_rm16_r16() // Opcode 0x29 void i386_device::i386_sub_r16_rm16() // Opcode 0x2b { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); dst = LOAD_REG16(modrm); @@ -2292,7 +2292,7 @@ void i386_device::i386_sub_r16_rm16() // Opcode 0x2b STORE_REG16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); dst = LOAD_REG16(modrm); dst = SUB16(dst, src); @@ -2303,7 +2303,7 @@ void i386_device::i386_sub_r16_rm16() // Opcode 0x2b void i386_device::i386_sub_ax_i16() // Opcode 0x2d { - UINT16 src, dst; + uint16_t src, dst; src = FETCH16(); dst = REG16(AX); dst = SUB16(dst, src); @@ -2313,8 +2313,8 @@ void i386_device::i386_sub_ax_i16() // Opcode 0x2d void i386_device::i386_test_ax_i16() // Opcode 0xa9 { - UINT16 src = FETCH16(); - UINT16 dst = REG16(AX); + uint16_t src = FETCH16(); + uint16_t dst = REG16(AX); dst = src & dst; SetSZPF16(dst); m_CF = 0; @@ -2324,8 +2324,8 @@ void i386_device::i386_test_ax_i16() // Opcode 0xa9 void i386_device::i386_test_rm16_r16() // Opcode 0x85 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); dst = LOAD_RM16(modrm); @@ -2335,7 +2335,7 @@ void i386_device::i386_test_rm16_r16() // Opcode 0x85 m_OF = 0; CYCLES(CYCLES_TEST_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = LOAD_REG16(modrm); dst = READ16(ea); dst = src & dst; @@ -2348,7 +2348,7 @@ void i386_device::i386_test_rm16_r16() // Opcode 0x85 void i386_device::i386_xchg_ax_cx() // Opcode 0x91 { - UINT16 temp; + uint16_t temp; temp = REG16(AX); REG16(AX) = REG16(CX); REG16(CX) = temp; @@ -2357,7 +2357,7 @@ void i386_device::i386_xchg_ax_cx() // Opcode 0x91 void i386_device::i386_xchg_ax_dx() // Opcode 0x92 { - UINT16 temp; + uint16_t temp; temp = REG16(AX); REG16(AX) = REG16(DX); REG16(DX) = temp; @@ -2366,7 +2366,7 @@ void i386_device::i386_xchg_ax_dx() // Opcode 0x92 void i386_device::i386_xchg_ax_bx() // Opcode 0x93 { - UINT16 temp; + uint16_t temp; temp = REG16(AX); REG16(AX) = REG16(BX); REG16(BX) = temp; @@ -2375,7 +2375,7 @@ void i386_device::i386_xchg_ax_bx() // Opcode 0x93 void i386_device::i386_xchg_ax_sp() // Opcode 0x94 { - UINT16 temp; + uint16_t temp; temp = REG16(AX); REG16(AX) = REG16(SP); REG16(SP) = temp; @@ -2384,7 +2384,7 @@ void i386_device::i386_xchg_ax_sp() // Opcode 0x94 void i386_device::i386_xchg_ax_bp() // Opcode 0x95 { - UINT16 temp; + uint16_t temp; temp = REG16(AX); REG16(AX) = REG16(BP); REG16(BP) = temp; @@ -2393,7 +2393,7 @@ void i386_device::i386_xchg_ax_bp() // Opcode 0x95 void i386_device::i386_xchg_ax_si() // Opcode 0x96 { - UINT16 temp; + uint16_t temp; temp = REG16(AX); REG16(AX) = REG16(SI); REG16(SI) = temp; @@ -2402,7 +2402,7 @@ void i386_device::i386_xchg_ax_si() // Opcode 0x96 void i386_device::i386_xchg_ax_di() // Opcode 0x97 { - UINT16 temp; + uint16_t temp; temp = REG16(AX); REG16(AX) = REG16(DI); REG16(DI) = temp; @@ -2411,17 +2411,17 @@ void i386_device::i386_xchg_ax_di() // Opcode 0x97 void i386_device::i386_xchg_r16_rm16() // Opcode 0x87 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 src = LOAD_RM16(modrm); - UINT16 dst = LOAD_REG16(modrm); + uint16_t src = LOAD_RM16(modrm); + uint16_t dst = LOAD_REG16(modrm); STORE_REG16(modrm, src); STORE_RM16(modrm, dst); CYCLES(CYCLES_XCHG_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 src = READ16(ea); - UINT16 dst = LOAD_REG16(modrm); + uint32_t ea = GetEA(modrm,1); + uint16_t src = READ16(ea); + uint16_t dst = LOAD_REG16(modrm); STORE_REG16(modrm, src); WRITE16(ea, dst); CYCLES(CYCLES_XCHG_REG_MEM); @@ -2430,8 +2430,8 @@ void i386_device::i386_xchg_r16_rm16() // Opcode 0x87 void i386_device::i386_xor_rm16_r16() // Opcode 0x31 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG16(modrm); dst = LOAD_RM16(modrm); @@ -2439,7 +2439,7 @@ void i386_device::i386_xor_rm16_r16() // Opcode 0x31 STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG16(modrm); dst = READ16(ea); dst = XOR16(dst, src); @@ -2450,8 +2450,8 @@ void i386_device::i386_xor_rm16_r16() // Opcode 0x31 void i386_device::i386_xor_r16_rm16() // Opcode 0x33 { - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint16_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); dst = LOAD_REG16(modrm); @@ -2459,7 +2459,7 @@ void i386_device::i386_xor_r16_rm16() // Opcode 0x33 STORE_REG16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); dst = LOAD_REG16(modrm); dst = XOR16(dst, src); @@ -2470,7 +2470,7 @@ void i386_device::i386_xor_r16_rm16() // Opcode 0x33 void i386_device::i386_xor_ax_i16() // Opcode 0x35 { - UINT16 src, dst; + uint16_t src, dst; src = FETCH16(); dst = REG16(AX); dst = XOR16(dst, src); @@ -2482,9 +2482,9 @@ void i386_device::i386_xor_ax_i16() // Opcode 0x35 void i386_device::i386_group81_16() // Opcode 0x81 { - UINT32 ea; - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint32_t ea; + uint16_t src, dst; + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { @@ -2619,23 +2619,23 @@ void i386_device::i386_group81_16() // Opcode 0x81 void i386_device::i386_group83_16() // Opcode 0x83 { - UINT32 ea; - UINT16 src, dst; - UINT8 modrm = FETCH(); + uint32_t ea; + uint16_t src, dst; + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 0: // ADD Rm16, i16 if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = ADD16(dst, src); STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ16(ea); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = ADD16(dst, src); WRITE16(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2644,14 +2644,14 @@ void i386_device::i386_group83_16() // Opcode 0x83 case 1: // OR Rm16, i16 if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = OR16(dst, src); STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ16(ea); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = OR16(dst, src); WRITE16(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2660,14 +2660,14 @@ void i386_device::i386_group83_16() // Opcode 0x83 case 2: // ADC Rm16, i16 if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = ADC16(dst, src, m_CF); STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ16(ea); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = ADC16(dst, src, m_CF); WRITE16(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2676,14 +2676,14 @@ void i386_device::i386_group83_16() // Opcode 0x83 case 3: // SBB Rm16, i16 if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); - src = ((UINT16)(INT16)(INT8)FETCH()); + src = ((uint16_t)(int16_t)(int8_t)FETCH()); dst = SBB16(dst, src, m_CF); STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ16(ea); - src = ((UINT16)(INT16)(INT8)FETCH()); + src = ((uint16_t)(int16_t)(int8_t)FETCH()); dst = SBB16(dst, src, m_CF); WRITE16(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2692,14 +2692,14 @@ void i386_device::i386_group83_16() // Opcode 0x83 case 4: // AND Rm16, i16 if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = AND16(dst, src); STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ16(ea); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = AND16(dst, src); WRITE16(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2708,14 +2708,14 @@ void i386_device::i386_group83_16() // Opcode 0x83 case 5: // SUB Rm16, i16 if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = SUB16(dst, src); STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ16(ea); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = SUB16(dst, src); WRITE16(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2724,14 +2724,14 @@ void i386_device::i386_group83_16() // Opcode 0x83 case 6: // XOR Rm16, i16 if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = XOR16(dst, src); STORE_RM16(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ16(ea); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); dst = XOR16(dst, src); WRITE16(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2740,13 +2740,13 @@ void i386_device::i386_group83_16() // Opcode 0x83 case 7: // CMP Rm16, i16 if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); SUB16(dst, src); CYCLES(CYCLES_CMP_REG_REG); } else { ea = GetEA(modrm,0); dst = READ16(ea); - src = (UINT16)(INT16)(INT8)FETCH(); + src = (uint16_t)(int16_t)(int8_t)FETCH(); SUB16(dst, src); CYCLES(CYCLES_CMP_REG_MEM); } @@ -2756,9 +2756,9 @@ void i386_device::i386_group83_16() // Opcode 0x83 void i386_device::i386_groupC1_16() // Opcode 0xc1 { - UINT16 dst; - UINT8 modrm = FETCH(); - UINT8 shift; + uint16_t dst; + uint8_t modrm = FETCH(); + uint8_t shift; if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); @@ -2766,7 +2766,7 @@ void i386_device::i386_groupC1_16() // Opcode 0xc1 dst = i386_shift_rotate16(modrm, dst, shift); STORE_RM16(modrm, dst); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); dst = READ16(ea); shift = FETCH() & 0x1f; dst = i386_shift_rotate16(modrm, dst, shift); @@ -2776,15 +2776,15 @@ void i386_device::i386_groupC1_16() // Opcode 0xc1 void i386_device::i386_groupD1_16() // Opcode 0xd1 { - UINT16 dst; - UINT8 modrm = FETCH(); + uint16_t dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); dst = i386_shift_rotate16(modrm, dst, 1); STORE_RM16(modrm, dst); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); dst = READ16(ea); dst = i386_shift_rotate16(modrm, dst, 1); WRITE16(ea, dst); @@ -2793,15 +2793,15 @@ void i386_device::i386_groupD1_16() // Opcode 0xd1 void i386_device::i386_groupD3_16() // Opcode 0xd3 { - UINT16 dst; - UINT8 modrm = FETCH(); + uint16_t dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { dst = LOAD_RM16(modrm); dst = i386_shift_rotate16(modrm, dst, REG8(CL)); STORE_RM16(modrm, dst); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); dst = READ16(ea); dst = i386_shift_rotate16(modrm, dst, REG8(CL)); WRITE16(ea, dst); @@ -2810,22 +2810,22 @@ void i386_device::i386_groupD3_16() // Opcode 0xd3 void i386_device::i386_groupF7_16() // Opcode 0xf7 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 0: /* TEST Rm16, i16 */ if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 src = FETCH16(); + uint16_t dst = LOAD_RM16(modrm); + uint16_t src = FETCH16(); dst &= src; m_CF = m_OF = m_AF = 0; SetSZPF16(dst); CYCLES(CYCLES_TEST_IMM_REG); } else { - UINT32 ea = GetEA(modrm,0); - UINT16 dst = READ16(ea); - UINT16 src = FETCH16(); + uint32_t ea = GetEA(modrm,0); + uint16_t dst = READ16(ea); + uint16_t src = FETCH16(); dst &= src; m_CF = m_OF = m_AF = 0; SetSZPF16(dst); @@ -2834,13 +2834,13 @@ void i386_device::i386_groupF7_16() // Opcode 0xf7 break; case 2: /* NOT Rm16 */ if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); + uint16_t dst = LOAD_RM16(modrm); dst = ~dst; STORE_RM16(modrm, dst); CYCLES(CYCLES_NOT_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); dst = ~dst; WRITE16(ea, dst); CYCLES(CYCLES_NOT_MEM); @@ -2848,13 +2848,13 @@ void i386_device::i386_groupF7_16() // Opcode 0xf7 break; case 3: /* NEG Rm16 */ if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); + uint16_t dst = LOAD_RM16(modrm); dst = SUB16(0, dst ); STORE_RM16(modrm, dst); CYCLES(CYCLES_NEG_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); dst = SUB16(0, dst ); WRITE16(ea, dst); CYCLES(CYCLES_NEG_MEM); @@ -2862,69 +2862,69 @@ void i386_device::i386_groupF7_16() // Opcode 0xf7 break; case 4: /* MUL AX, Rm16 */ { - UINT32 result; - UINT16 src, dst; + uint32_t result; + uint16_t src, dst; if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); CYCLES(CYCLES_MUL16_ACC_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); CYCLES(CYCLES_MUL16_ACC_MEM); /* TODO: Correct multiply timing */ } dst = REG16(AX); - result = (UINT32)src * (UINT32)dst; - REG16(DX) = (UINT16)(result >> 16); - REG16(AX) = (UINT16)result; + result = (uint32_t)src * (uint32_t)dst; + REG16(DX) = (uint16_t)(result >> 16); + REG16(AX) = (uint16_t)result; m_CF = m_OF = (REG16(DX) != 0); } break; case 5: /* IMUL AX, Rm16 */ { - INT32 result; - INT32 src, dst; + int32_t result; + int32_t src, dst; if( modrm >= 0xc0 ) { - src = (INT32)(INT16)LOAD_RM16(modrm); + src = (int32_t)(int16_t)LOAD_RM16(modrm); CYCLES(CYCLES_IMUL16_ACC_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); - src = (INT32)(INT16)READ16(ea); + uint32_t ea = GetEA(modrm,0); + src = (int32_t)(int16_t)READ16(ea); CYCLES(CYCLES_IMUL16_ACC_MEM); /* TODO: Correct multiply timing */ } - dst = (INT32)(INT16)REG16(AX); + dst = (int32_t)(int16_t)REG16(AX); result = src * dst; - REG16(DX) = (UINT16)(result >> 16); - REG16(AX) = (UINT16)result; + REG16(DX) = (uint16_t)(result >> 16); + REG16(AX) = (uint16_t)result; - m_CF = m_OF = !(result == (INT32)(INT16)result); + m_CF = m_OF = !(result == (int32_t)(int16_t)result); } break; case 6: /* DIV AX, Rm16 */ { - UINT32 quotient, remainder, result; - UINT16 src; + uint32_t quotient, remainder, result; + uint16_t src; if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); CYCLES(CYCLES_DIV16_ACC_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); CYCLES(CYCLES_DIV16_ACC_MEM); } - quotient = ((UINT32)(REG16(DX)) << 16) | (UINT32)(REG16(AX)); + quotient = ((uint32_t)(REG16(DX)) << 16) | (uint32_t)(REG16(AX)); if( src ) { - remainder = quotient % (UINT32)src; - result = quotient / (UINT32)src; + remainder = quotient % (uint32_t)src; + result = quotient / (uint32_t)src; if( result > 0xffff ) { /* TODO: Divide error */ } else { - REG16(DX) = (UINT16)remainder; - REG16(AX) = (UINT16)result; + REG16(DX) = (uint16_t)remainder; + REG16(AX) = (uint16_t)result; // this flag is actually undefined, enable on non-cyrix if (m_cpuid_id0 != 0x69727943) @@ -2937,26 +2937,26 @@ void i386_device::i386_groupF7_16() // Opcode 0xf7 break; case 7: /* IDIV AX, Rm16 */ { - INT32 quotient, remainder, result; - UINT16 src; + int32_t quotient, remainder, result; + uint16_t src; if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); CYCLES(CYCLES_IDIV16_ACC_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); CYCLES(CYCLES_IDIV16_ACC_MEM); } - quotient = (((INT32)REG16(DX)) << 16) | ((UINT32)REG16(AX)); + quotient = (((int32_t)REG16(DX)) << 16) | ((uint32_t)REG16(AX)); if( src ) { - remainder = quotient % (INT32)(INT16)src; - result = quotient / (INT32)(INT16)src; + remainder = quotient % (int32_t)(int16_t)src; + result = quotient / (int32_t)(int16_t)src; if( result > 0xffff ) { /* TODO: Divide error */ } else { - REG16(DX) = (UINT16)remainder; - REG16(AX) = (UINT16)result; + REG16(DX) = (uint16_t)remainder; + REG16(AX) = (uint16_t)result; // this flag is actually undefined, enable on non-cyrix if (m_cpuid_id0 != 0x69727943) @@ -2972,19 +2972,19 @@ void i386_device::i386_groupF7_16() // Opcode 0xf7 void i386_device::i386_groupFF_16() // Opcode 0xff { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 0: /* INC Rm16 */ if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); + uint16_t dst = LOAD_RM16(modrm); dst = INC16(dst); STORE_RM16(modrm, dst); CYCLES(CYCLES_INC_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); dst = INC16(dst); WRITE16(ea, dst); CYCLES(CYCLES_INC_MEM); @@ -2992,13 +2992,13 @@ void i386_device::i386_groupFF_16() // Opcode 0xff break; case 1: /* DEC Rm16 */ if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); + uint16_t dst = LOAD_RM16(modrm); dst = DEC16(dst); STORE_RM16(modrm, dst); CYCLES(CYCLES_DEC_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); dst = DEC16(dst); WRITE16(ea, dst); CYCLES(CYCLES_DEC_MEM); @@ -3006,12 +3006,12 @@ void i386_device::i386_groupFF_16() // Opcode 0xff break; case 2: /* CALL Rm16 */ { - UINT16 address; + uint16_t address; if( modrm >= 0xc0 ) { address = LOAD_RM16(modrm); CYCLES(CYCLES_CALL_REG); /* TODO: Timing = 7 + m */ } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); address = READ16(ea); CYCLES(CYCLES_CALL_MEM); /* TODO: Timing = 10 + m */ } @@ -3022,14 +3022,14 @@ void i386_device::i386_groupFF_16() // Opcode 0xff break; case 3: /* CALL FAR Rm16 */ { - UINT16 address, selector; + uint16_t address, selector; if( modrm >= 0xc0 ) { report_invalid_modrm("groupFF_16", modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); address = READ16(ea + 0); selector = READ16(ea + 2); CYCLES(CYCLES_CALL_MEM_INTERSEG); /* TODO: Timing = 10 + m */ @@ -3053,12 +3053,12 @@ void i386_device::i386_groupFF_16() // Opcode 0xff break; case 4: /* JMP Rm16 */ { - UINT16 address; + uint16_t address; if( modrm >= 0xc0 ) { address = LOAD_RM16(modrm); CYCLES(CYCLES_JMP_REG); /* TODO: Timing = 7 + m */ } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); address = READ16(ea); CYCLES(CYCLES_JMP_MEM); /* TODO: Timing = 10 + m */ } @@ -3068,7 +3068,7 @@ void i386_device::i386_groupFF_16() // Opcode 0xff break; case 5: /* JMP FAR Rm16 */ { - UINT16 address, selector; + uint16_t address, selector; if( modrm >= 0xc0 ) { @@ -3076,7 +3076,7 @@ void i386_device::i386_groupFF_16() // Opcode 0xff } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); address = READ16(ea + 0); selector = READ16(ea + 2); CYCLES(CYCLES_JMP_MEM_INTERSEG); /* TODO: Timing = 10 + m */ @@ -3097,11 +3097,11 @@ void i386_device::i386_groupFF_16() // Opcode 0xff break; case 6: /* PUSH Rm16 */ { - UINT16 value; + uint16_t value; if( modrm >= 0xc0 ) { value = LOAD_RM16(modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); value = READ16(ea); } PUSH16(value); @@ -3116,10 +3116,10 @@ void i386_device::i386_groupFF_16() // Opcode 0xff void i386_device::i386_group0F00_16() // Opcode 0x0f 00 { - UINT32 address, ea; - UINT8 modrm = FETCH(); + uint32_t address, ea; + uint8_t modrm = FETCH(); I386_SREG seg; - UINT8 result; + uint8_t result; switch( (modrm >> 3) & 0x7 ) { @@ -3202,7 +3202,7 @@ void i386_device::i386_group0F00_16() // Opcode 0x0f 00 seg.selector = m_task.segment; i386_load_protected_mode_segment(&seg,nullptr); - UINT32 addr = ((seg.selector & 4) ? m_ldtr.base : m_gdtr.base) + (seg.selector & ~7) + 5; + uint32_t addr = ((seg.selector & 4) ? m_ldtr.base : m_gdtr.base) + (seg.selector & ~7) + 5; i386_translate_address(TRANSLATE_READ, &addr, nullptr); m_program->write_byte(addr, (seg.flags & 0xff) | 2); @@ -3315,9 +3315,9 @@ void i386_device::i386_group0F00_16() // Opcode 0x0f 00 void i386_device::i386_group0F01_16() // Opcode 0x0f 01 { - UINT8 modrm = FETCH(); - UINT16 address; - UINT32 ea; + uint8_t modrm = FETCH(); + uint16_t address; + uint32_t ea; switch( (modrm >> 3) & 0x7 ) { @@ -3396,7 +3396,7 @@ void i386_device::i386_group0F01_16() // Opcode 0x0f 01 { if(PROTECTED_MODE && m_CPL) FAULT(FAULT_GP,0) - UINT16 b; + uint16_t b; if( modrm >= 0xc0 ) { b = LOAD_RM16(modrm); CYCLES(CYCLES_LMSW_REG); @@ -3419,14 +3419,14 @@ void i386_device::i386_group0F01_16() // Opcode 0x0f 01 void i386_device::i386_group0FBA_16() // Opcode 0x0f ba { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 4: /* BT Rm16, i8 */ if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT8 bit = FETCH(); + uint16_t dst = LOAD_RM16(modrm); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3435,9 +3435,9 @@ void i386_device::i386_group0FBA_16() // Opcode 0x0f ba CYCLES(CYCLES_BT_IMM_REG); } else { - UINT32 ea = GetEA(modrm,0); - UINT16 dst = READ16(ea); - UINT8 bit = FETCH(); + uint32_t ea = GetEA(modrm,0); + uint16_t dst = READ16(ea); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3449,8 +3449,8 @@ void i386_device::i386_group0FBA_16() // Opcode 0x0f ba break; case 5: /* BTS Rm16, i8 */ if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT8 bit = FETCH(); + uint16_t dst = LOAD_RM16(modrm); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3461,9 +3461,9 @@ void i386_device::i386_group0FBA_16() // Opcode 0x0f ba STORE_RM16(modrm, dst); CYCLES(CYCLES_BTS_IMM_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); - UINT8 bit = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3477,8 +3477,8 @@ void i386_device::i386_group0FBA_16() // Opcode 0x0f ba break; case 6: /* BTR Rm16, i8 */ if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT8 bit = FETCH(); + uint16_t dst = LOAD_RM16(modrm); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3489,9 +3489,9 @@ void i386_device::i386_group0FBA_16() // Opcode 0x0f ba STORE_RM16(modrm, dst); CYCLES(CYCLES_BTR_IMM_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); - UINT8 bit = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3505,8 +3505,8 @@ void i386_device::i386_group0FBA_16() // Opcode 0x0f ba break; case 7: /* BTC Rm16, i8 */ if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT8 bit = FETCH(); + uint16_t dst = LOAD_RM16(modrm); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3517,9 +3517,9 @@ void i386_device::i386_group0FBA_16() // Opcode 0x0f ba STORE_RM16(modrm, dst); CYCLES(CYCLES_BTC_IMM_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); - UINT8 bit = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3539,9 +3539,9 @@ void i386_device::i386_group0FBA_16() // Opcode 0x0f ba void i386_device::i386_lar_r16_rm16() // Opcode 0x0f 0x02 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); I386_SREG seg; - UINT8 type; + uint8_t type; if(PROTECTED_MODE && !V8086_MODE) { @@ -3553,7 +3553,7 @@ void i386_device::i386_lar_r16_rm16() // Opcode 0x0f 0x02 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); seg.selector = READ16(ea); CYCLES(CYCLES_LAR_MEM); } @@ -3569,7 +3569,7 @@ void i386_device::i386_lar_r16_rm16() // Opcode 0x0f 0x02 SetZF(0); return; } - UINT8 DPL = (seg.flags >> 5) & 3; + uint8_t DPL = (seg.flags >> 5) & 3; if(((DPL < m_CPL) || (DPL < (seg.selector & 3))) && ((seg.flags & 0x1c) != 0x1c)) { SetZF(0); @@ -3606,8 +3606,8 @@ void i386_device::i386_lar_r16_rm16() // Opcode 0x0f 0x02 void i386_device::i386_lsl_r16_rm16() // Opcode 0x0f 0x03 { - UINT8 modrm = FETCH(); - UINT32 limit; + uint8_t modrm = FETCH(); + uint32_t limit; I386_SREG seg; if(PROTECTED_MODE && !V8086_MODE) @@ -3619,7 +3619,7 @@ void i386_device::i386_lsl_r16_rm16() // Opcode 0x0f 0x03 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); seg.selector = READ16(ea); } if(seg.selector == 0) @@ -3628,13 +3628,13 @@ void i386_device::i386_lsl_r16_rm16() // Opcode 0x0f 0x03 } else { - UINT8 type; + uint8_t type; if(!i386_load_protected_mode_segment(&seg,nullptr)) { SetZF(0); return; } - UINT8 DPL = (seg.flags >> 5) & 3; + uint8_t DPL = (seg.flags >> 5) & 3; if(((DPL < m_CPL) || (DPL < (seg.selector & 3))) && ((seg.flags & 0x1c) != 0x1c)) { SetZF(0); @@ -3669,8 +3669,8 @@ void i386_device::i386_lsl_r16_rm16() // Opcode 0x0f 0x03 void i386_device::i386_bound_r16_m16_m16() // Opcode 0x62 { - UINT8 modrm; - INT16 val, low, high; + uint8_t modrm; + int16_t val, low, high; modrm = FETCH(); @@ -3680,7 +3680,7 @@ void i386_device::i386_bound_r16_m16_m16() // Opcode 0x62 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); low = READ16(ea + 0); high = READ16(ea + 2); } @@ -3716,7 +3716,7 @@ void i386_device::i386_retf16() // Opcode 0xcb void i386_device::i386_retf_i16() // Opcode 0xca { - UINT16 count = FETCH16(); + uint16_t count = FETCH16(); if(PROTECTED_MODE && !V8086_MODE) { @@ -3736,15 +3736,15 @@ void i386_device::i386_retf_i16() // Opcode 0xca bool i386_device::i386_load_far_pointer16(int s) { - UINT8 modrm = FETCH(); - UINT16 selector; + uint8_t modrm = FETCH(); + uint16_t selector; if( modrm >= 0xc0 ) { //logerror("i386: load_far_pointer16 NYI\n"); // don't log, NT will use this a lot i386_trap(6, 0, 0); return false; } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); STORE_REG16(modrm, READ16(ea + 0)); selector = READ16(ea + 2); i386_sreg_load(selector,s,nullptr); diff --git a/src/devices/cpu/i386/i386op32.hxx b/src/devices/cpu/i386/i386op32.hxx index 89c7bab44b4..e333bbaaa70 100644 --- a/src/devices/cpu/i386/i386op32.hxx +++ b/src/devices/cpu/i386/i386op32.hxx @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Ville Linde, Barry Rodewald, Carl, Philip Bennett -UINT32 i386_device::i386_shift_rotate32(UINT8 modrm, UINT32 value, UINT8 shift) +uint32_t i386_device::i386_shift_rotate32(uint8_t modrm, uint32_t value, uint8_t shift) { - UINT32 dst, src; + uint32_t dst, src; dst = value; src = value; @@ -51,7 +51,7 @@ UINT32 i386_device::i386_shift_rotate32(UINT8 modrm, UINT32 value, UINT8 shift) CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); break; case 7: /* SAR rm32, 1 */ - dst = (INT32)(src) >> 1; + dst = (int32_t)(src) >> 1; m_CF = src & 0x1; m_OF = 0; SetSZPF32(dst); @@ -64,30 +64,30 @@ UINT32 i386_device::i386_shift_rotate32(UINT8 modrm, UINT32 value, UINT8 shift) switch( (modrm >> 3) & 0x7 ) { case 0: /* ROL rm32, i8 */ - dst = ((src & ((UINT32)0xffffffff >> shift)) << shift) | - ((src & ((UINT32)0xffffffff << (32-shift))) >> (32-shift)); + dst = ((src & ((uint32_t)0xffffffff >> shift)) << shift) | + ((src & ((uint32_t)0xffffffff << (32-shift))) >> (32-shift)); m_CF = dst & 0x1; m_OF = (dst & 1) ^ (dst >> 31); CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); break; case 1: /* ROR rm32, i8 */ - dst = ((src & ((UINT32)0xffffffff << shift)) >> shift) | - ((src & ((UINT32)0xffffffff >> (32-shift))) << (32-shift)); + dst = ((src & ((uint32_t)0xffffffff << shift)) >> shift) | + ((src & ((uint32_t)0xffffffff >> (32-shift))) << (32-shift)); m_CF = (dst >> 31) & 0x1; m_OF = ((dst >> 31) ^ (dst >> 30)) & 1; CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); break; case 2: /* RCL rm32, i8 */ - dst = ((src & ((UINT32)0xffffffff >> shift)) << shift) | - ((src & ((UINT32)0xffffffff << (33-shift))) >> (33-shift)) | + dst = ((src & ((uint32_t)0xffffffff >> shift)) << shift) | + ((src & ((uint32_t)0xffffffff << (33-shift))) >> (33-shift)) | (m_CF << (shift-1)); m_CF = (src >> (32-shift)) & 0x1; m_OF = m_CF ^ ((dst >> 31) & 1); CYCLES_RM(modrm, CYCLES_ROTATE_CARRY_REG, CYCLES_ROTATE_CARRY_MEM); break; case 3: /* RCR rm32, i8 */ - dst = ((src & ((UINT32)0xffffffff << shift)) >> shift) | - ((src & ((UINT32)0xffffffff >> (32-shift))) << (33-shift)) | + dst = ((src & ((uint32_t)0xffffffff << shift)) >> shift) | + ((src & ((uint32_t)0xffffffff >> (32-shift))) << (33-shift)) | (m_CF << (32-shift)); m_CF = (src >> (shift-1)) & 0x1; m_OF = ((dst >> 31) ^ (dst >> 30)) & 1; @@ -107,7 +107,7 @@ UINT32 i386_device::i386_shift_rotate32(UINT8 modrm, UINT32 value, UINT8 shift) CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); break; case 7: /* SAR rm32, i8 */ - dst = (INT32)src >> shift; + dst = (int32_t)src >> shift; m_CF = (src & (1 << (shift-1))) ? 1 : 0; SetSZPF32(dst); CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); @@ -122,8 +122,8 @@ UINT32 i386_device::i386_shift_rotate32(UINT8 modrm, UINT32 value, UINT8 shift) void i386_device::i386_adc_rm32_r32() // Opcode 0x11 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); dst = LOAD_RM32(modrm); @@ -131,7 +131,7 @@ void i386_device::i386_adc_rm32_r32() // Opcode 0x11 STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG32(modrm); dst = READ32(ea); dst = ADC32(dst, src, m_CF); @@ -142,8 +142,8 @@ void i386_device::i386_adc_rm32_r32() // Opcode 0x11 void i386_device::i386_adc_r32_rm32() // Opcode 0x13 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); dst = LOAD_REG32(modrm); @@ -151,7 +151,7 @@ void i386_device::i386_adc_r32_rm32() // Opcode 0x13 STORE_REG32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); dst = LOAD_REG32(modrm); dst = ADC32(dst, src, m_CF); @@ -162,7 +162,7 @@ void i386_device::i386_adc_r32_rm32() // Opcode 0x13 void i386_device::i386_adc_eax_i32() // Opcode 0x15 { - UINT32 src, dst; + uint32_t src, dst; src = FETCH32(); dst = REG32(EAX); dst = ADC32(dst, src, m_CF); @@ -172,8 +172,8 @@ void i386_device::i386_adc_eax_i32() // Opcode 0x15 void i386_device::i386_add_rm32_r32() // Opcode 0x01 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); dst = LOAD_RM32(modrm); @@ -181,7 +181,7 @@ void i386_device::i386_add_rm32_r32() // Opcode 0x01 STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG32(modrm); dst = READ32(ea); dst = ADD32(dst, src); @@ -192,8 +192,8 @@ void i386_device::i386_add_rm32_r32() // Opcode 0x01 void i386_device::i386_add_r32_rm32() // Opcode 0x03 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); dst = LOAD_REG32(modrm); @@ -201,7 +201,7 @@ void i386_device::i386_add_r32_rm32() // Opcode 0x03 STORE_REG32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); dst = LOAD_REG32(modrm); dst = ADD32(dst, src); @@ -212,7 +212,7 @@ void i386_device::i386_add_r32_rm32() // Opcode 0x03 void i386_device::i386_add_eax_i32() // Opcode 0x05 { - UINT32 src, dst; + uint32_t src, dst; src = FETCH32(); dst = REG32(EAX); dst = ADD32(dst, src); @@ -222,8 +222,8 @@ void i386_device::i386_add_eax_i32() // Opcode 0x05 void i386_device::i386_and_rm32_r32() // Opcode 0x21 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); dst = LOAD_RM32(modrm); @@ -231,7 +231,7 @@ void i386_device::i386_and_rm32_r32() // Opcode 0x21 STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG32(modrm); dst = READ32(ea); dst = AND32(dst, src); @@ -242,8 +242,8 @@ void i386_device::i386_and_rm32_r32() // Opcode 0x21 void i386_device::i386_and_r32_rm32() // Opcode 0x23 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); dst = LOAD_REG32(modrm); @@ -251,7 +251,7 @@ void i386_device::i386_and_r32_rm32() // Opcode 0x23 STORE_REG32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); dst = LOAD_REG32(modrm); dst = AND32(dst, src); @@ -262,7 +262,7 @@ void i386_device::i386_and_r32_rm32() // Opcode 0x23 void i386_device::i386_and_eax_i32() // Opcode 0x25 { - UINT32 src, dst; + uint32_t src, dst; src = FETCH32(); dst = REG32(EAX); dst = AND32(dst, src); @@ -272,13 +272,13 @@ void i386_device::i386_and_eax_i32() // Opcode 0x25 void i386_device::i386_bsf_r32_rm32() // Opcode 0x0f bc { - UINT32 src, dst, temp; - UINT8 modrm = FETCH(); + uint32_t src, dst, temp; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); } @@ -301,13 +301,13 @@ void i386_device::i386_bsf_r32_rm32() // Opcode 0x0f bc void i386_device::i386_bsr_r32_rm32() // Opcode 0x0f bd { - UINT32 src, dst, temp; - UINT8 modrm = FETCH(); + uint32_t src, dst, temp; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); } @@ -330,10 +330,10 @@ void i386_device::i386_bsr_r32_rm32() // Opcode 0x0f bd void i386_device::i386_bt_rm32_r32() // Opcode 0x0f a3 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 bit = LOAD_REG32(modrm); + uint32_t dst = LOAD_RM32(modrm); + uint32_t bit = LOAD_REG32(modrm); if( dst & (1 << bit) ) m_CF = 1; @@ -342,13 +342,13 @@ void i386_device::i386_bt_rm32_r32() // Opcode 0x0f a3 CYCLES(CYCLES_BT_REG_REG); } else { - UINT8 segment; - UINT32 ea = GetNonTranslatedEA(modrm,&segment); - UINT32 bit = LOAD_REG32(modrm); + uint8_t segment; + uint32_t ea = GetNonTranslatedEA(modrm,&segment); + uint32_t bit = LOAD_REG32(modrm); ea += 4*(bit/32); ea = i386_translate(segment,(m_address_size)?ea:(ea&0xffff),0); bit %= 32; - UINT32 dst = READ32(ea); + uint32_t dst = READ32(ea); if( dst & (1 << bit) ) m_CF = 1; @@ -361,10 +361,10 @@ void i386_device::i386_bt_rm32_r32() // Opcode 0x0f a3 void i386_device::i386_btc_rm32_r32() // Opcode 0x0f bb { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 bit = LOAD_REG32(modrm); + uint32_t dst = LOAD_RM32(modrm); + uint32_t bit = LOAD_REG32(modrm); if( dst & (1 << bit) ) m_CF = 1; @@ -375,13 +375,13 @@ void i386_device::i386_btc_rm32_r32() // Opcode 0x0f bb STORE_RM32(modrm, dst); CYCLES(CYCLES_BTC_REG_REG); } else { - UINT8 segment; - UINT32 ea = GetNonTranslatedEA(modrm,&segment); - UINT32 bit = LOAD_REG32(modrm); + uint8_t segment; + uint32_t ea = GetNonTranslatedEA(modrm,&segment); + uint32_t bit = LOAD_REG32(modrm); ea += 4*(bit/32); ea = i386_translate(segment,(m_address_size)?ea:(ea&0xffff),1); bit %= 32; - UINT32 dst = READ32(ea); + uint32_t dst = READ32(ea); if( dst & (1 << bit) ) m_CF = 1; @@ -396,10 +396,10 @@ void i386_device::i386_btc_rm32_r32() // Opcode 0x0f bb void i386_device::i386_btr_rm32_r32() // Opcode 0x0f b3 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 bit = LOAD_REG32(modrm); + uint32_t dst = LOAD_RM32(modrm); + uint32_t bit = LOAD_REG32(modrm); if( dst & (1 << bit) ) m_CF = 1; @@ -410,13 +410,13 @@ void i386_device::i386_btr_rm32_r32() // Opcode 0x0f b3 STORE_RM32(modrm, dst); CYCLES(CYCLES_BTR_REG_REG); } else { - UINT8 segment; - UINT32 ea = GetNonTranslatedEA(modrm,&segment); - UINT32 bit = LOAD_REG32(modrm); + uint8_t segment; + uint32_t ea = GetNonTranslatedEA(modrm,&segment); + uint32_t bit = LOAD_REG32(modrm); ea += 4*(bit/32); ea = i386_translate(segment,(m_address_size)?ea:(ea&0xffff),1); bit %= 32; - UINT32 dst = READ32(ea); + uint32_t dst = READ32(ea); if( dst & (1 << bit) ) m_CF = 1; @@ -431,10 +431,10 @@ void i386_device::i386_btr_rm32_r32() // Opcode 0x0f b3 void i386_device::i386_bts_rm32_r32() // Opcode 0x0f ab { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 bit = LOAD_REG32(modrm); + uint32_t dst = LOAD_RM32(modrm); + uint32_t bit = LOAD_REG32(modrm); if( dst & (1 << bit) ) m_CF = 1; @@ -445,13 +445,13 @@ void i386_device::i386_bts_rm32_r32() // Opcode 0x0f ab STORE_RM32(modrm, dst); CYCLES(CYCLES_BTS_REG_REG); } else { - UINT8 segment; - UINT32 ea = GetNonTranslatedEA(modrm,&segment); - UINT32 bit = LOAD_REG32(modrm); + uint8_t segment; + uint32_t ea = GetNonTranslatedEA(modrm,&segment); + uint32_t bit = LOAD_REG32(modrm); ea += 4*(bit/32); ea = i386_translate(segment,(m_address_size)?ea:(ea&0xffff),1); bit %= 32; - UINT32 dst = READ32(ea); + uint32_t dst = READ32(ea); if( dst & (1 << bit) ) m_CF = 1; @@ -466,8 +466,8 @@ void i386_device::i386_bts_rm32_r32() // Opcode 0x0f ab void i386_device::i386_call_abs32() // Opcode 0x9a { - UINT32 offset = FETCH32(); - UINT16 ptr = FETCH16(); + uint32_t offset = FETCH32(); + uint16_t ptr = FETCH16(); if(PROTECTED_MODE && !V8086_MODE) { @@ -488,7 +488,7 @@ void i386_device::i386_call_abs32() // Opcode 0x9a void i386_device::i386_call_rel32() // Opcode 0xe8 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); PUSH32(m_eip ); m_eip += disp; CHANGE_PC(m_eip); @@ -507,15 +507,15 @@ void i386_device::i386_cdq() // Opcode 0x99 void i386_device::i386_cmp_rm32_r32() // Opcode 0x39 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); dst = LOAD_RM32(modrm); SUB32(dst, src); CYCLES(CYCLES_CMP_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = LOAD_REG32(modrm); dst = READ32(ea); SUB32(dst, src); @@ -525,15 +525,15 @@ void i386_device::i386_cmp_rm32_r32() // Opcode 0x39 void i386_device::i386_cmp_r32_rm32() // Opcode 0x3b { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); dst = LOAD_REG32(modrm); SUB32(dst, src); CYCLES(CYCLES_CMP_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); dst = LOAD_REG32(modrm); SUB32(dst, src); @@ -543,7 +543,7 @@ void i386_device::i386_cmp_r32_rm32() // Opcode 0x3b void i386_device::i386_cmp_eax_i32() // Opcode 0x3d { - UINT32 src, dst; + uint32_t src, dst; src = FETCH32(); dst = REG32(EAX); SUB32(dst, src); @@ -552,7 +552,7 @@ void i386_device::i386_cmp_eax_i32() // Opcode 0x3d void i386_device::i386_cmpsd() // Opcode 0xa7 { - UINT32 eas, ead, src, dst; + uint32_t eas, ead, src, dst; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); } else { @@ -569,7 +569,7 @@ void i386_device::i386_cmpsd() // Opcode 0xa7 void i386_device::i386_cwde() // Opcode 0x98 { - REG32(EAX) = (INT32)((INT16)REG16(AX)); + REG32(EAX) = (int32_t)((int16_t)REG16(AX)); CYCLES(CYCLES_CBW); } @@ -623,82 +623,82 @@ void i386_device::i386_dec_edi() // Opcode 0x4f void i386_device::i386_imul_r32_rm32() // Opcode 0x0f af { - UINT8 modrm = FETCH(); - INT64 result; - INT64 src, dst; + uint8_t modrm = FETCH(); + int64_t result; + int64_t src, dst; if( modrm >= 0xc0 ) { - src = (INT64)(INT32)LOAD_RM32(modrm); + src = (int64_t)(int32_t)LOAD_RM32(modrm); CYCLES(CYCLES_IMUL32_REG_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); - src = (INT64)(INT32)READ32(ea); + uint32_t ea = GetEA(modrm,0); + src = (int64_t)(int32_t)READ32(ea); CYCLES(CYCLES_IMUL32_REG_REG); /* TODO: Correct multiply timing */ } - dst = (INT64)(INT32)LOAD_REG32(modrm); + dst = (int64_t)(int32_t)LOAD_REG32(modrm); result = src * dst; - STORE_REG32(modrm, (UINT32)result); + STORE_REG32(modrm, (uint32_t)result); - m_CF = m_OF = !(result == (INT64)(INT32)result); + m_CF = m_OF = !(result == (int64_t)(int32_t)result); } void i386_device::i386_imul_r32_rm32_i32() // Opcode 0x69 { - UINT8 modrm = FETCH(); - INT64 result; - INT64 src, dst; + uint8_t modrm = FETCH(); + int64_t result; + int64_t src, dst; if( modrm >= 0xc0 ) { - dst = (INT64)(INT32)LOAD_RM32(modrm); + dst = (int64_t)(int32_t)LOAD_RM32(modrm); CYCLES(CYCLES_IMUL32_REG_IMM_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); - dst = (INT64)(INT32)READ32(ea); + uint32_t ea = GetEA(modrm,0); + dst = (int64_t)(int32_t)READ32(ea); CYCLES(CYCLES_IMUL32_MEM_IMM_REG); /* TODO: Correct multiply timing */ } - src = (INT64)(INT32)FETCH32(); + src = (int64_t)(int32_t)FETCH32(); result = src * dst; - STORE_REG32(modrm, (UINT32)result); + STORE_REG32(modrm, (uint32_t)result); - m_CF = m_OF = !(result == (INT64)(INT32)result); + m_CF = m_OF = !(result == (int64_t)(int32_t)result); } void i386_device::i386_imul_r32_rm32_i8() // Opcode 0x6b { - UINT8 modrm = FETCH(); - INT64 result; - INT64 src, dst; + uint8_t modrm = FETCH(); + int64_t result; + int64_t src, dst; if( modrm >= 0xc0 ) { - dst = (INT64)(INT32)LOAD_RM32(modrm); + dst = (int64_t)(int32_t)LOAD_RM32(modrm); CYCLES(CYCLES_IMUL32_REG_IMM_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); - dst = (INT64)(INT32)READ32(ea); + uint32_t ea = GetEA(modrm,0); + dst = (int64_t)(int32_t)READ32(ea); CYCLES(CYCLES_IMUL32_MEM_IMM_REG); /* TODO: Correct multiply timing */ } - src = (INT64)(INT8)FETCH(); + src = (int64_t)(int8_t)FETCH(); result = src * dst; - STORE_REG32(modrm, (UINT32)result); + STORE_REG32(modrm, (uint32_t)result); - m_CF = m_OF = !(result == (INT64)(INT32)result); + m_CF = m_OF = !(result == (int64_t)(int32_t)result); } void i386_device::i386_in_eax_i8() // Opcode 0xe5 { - UINT16 port = FETCH(); - UINT32 data = READPORT32(port); + uint16_t port = FETCH(); + uint32_t data = READPORT32(port); REG32(EAX) = data; CYCLES(CYCLES_IN_VAR); } void i386_device::i386_in_eax_dx() // Opcode 0xed { - UINT16 port = REG16(DX); - UINT32 data = READPORT32(port); + uint16_t port = REG16(DX); + uint32_t data = READPORT32(port); REG32(EAX) = data; CYCLES(CYCLES_IN); } @@ -772,7 +772,7 @@ void i386_device::i386_iret32() // Opcode 0xcf void i386_device::i386_ja_rel32() // Opcode 0x0f 87 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_CF == 0 && m_ZF == 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -784,7 +784,7 @@ void i386_device::i386_ja_rel32() // Opcode 0x0f 87 void i386_device::i386_jbe_rel32() // Opcode 0x0f 86 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_CF != 0 || m_ZF != 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -796,7 +796,7 @@ void i386_device::i386_jbe_rel32() // Opcode 0x0f 86 void i386_device::i386_jc_rel32() // Opcode 0x0f 82 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_CF != 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -808,7 +808,7 @@ void i386_device::i386_jc_rel32() // Opcode 0x0f 82 void i386_device::i386_jg_rel32() // Opcode 0x0f 8f { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_ZF == 0 && (m_SF == m_OF) ) { m_eip += disp; CHANGE_PC(m_eip); @@ -820,7 +820,7 @@ void i386_device::i386_jg_rel32() // Opcode 0x0f 8f void i386_device::i386_jge_rel32() // Opcode 0x0f 8d { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if(m_SF == m_OF) { m_eip += disp; CHANGE_PC(m_eip); @@ -832,7 +832,7 @@ void i386_device::i386_jge_rel32() // Opcode 0x0f 8d void i386_device::i386_jl_rel32() // Opcode 0x0f 8c { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( (m_SF != m_OF) ) { m_eip += disp; CHANGE_PC(m_eip); @@ -844,7 +844,7 @@ void i386_device::i386_jl_rel32() // Opcode 0x0f 8c void i386_device::i386_jle_rel32() // Opcode 0x0f 8e { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_ZF != 0 || (m_SF != m_OF) ) { m_eip += disp; CHANGE_PC(m_eip); @@ -856,7 +856,7 @@ void i386_device::i386_jle_rel32() // Opcode 0x0f 8e void i386_device::i386_jnc_rel32() // Opcode 0x0f 83 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_CF == 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -868,7 +868,7 @@ void i386_device::i386_jnc_rel32() // Opcode 0x0f 83 void i386_device::i386_jno_rel32() // Opcode 0x0f 81 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_OF == 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -880,7 +880,7 @@ void i386_device::i386_jno_rel32() // Opcode 0x0f 81 void i386_device::i386_jnp_rel32() // Opcode 0x0f 8b { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_PF == 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -892,7 +892,7 @@ void i386_device::i386_jnp_rel32() // Opcode 0x0f 8b void i386_device::i386_jns_rel32() // Opcode 0x0f 89 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_SF == 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -904,7 +904,7 @@ void i386_device::i386_jns_rel32() // Opcode 0x0f 89 void i386_device::i386_jnz_rel32() // Opcode 0x0f 85 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_ZF == 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -916,7 +916,7 @@ void i386_device::i386_jnz_rel32() // Opcode 0x0f 85 void i386_device::i386_jo_rel32() // Opcode 0x0f 80 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_OF != 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -928,7 +928,7 @@ void i386_device::i386_jo_rel32() // Opcode 0x0f 80 void i386_device::i386_jp_rel32() // Opcode 0x0f 8a { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_PF != 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -940,7 +940,7 @@ void i386_device::i386_jp_rel32() // Opcode 0x0f 8a void i386_device::i386_js_rel32() // Opcode 0x0f 88 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_SF != 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -952,7 +952,7 @@ void i386_device::i386_js_rel32() // Opcode 0x0f 88 void i386_device::i386_jz_rel32() // Opcode 0x0f 84 { - INT32 disp = FETCH32(); + int32_t disp = FETCH32(); if( m_ZF != 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -964,7 +964,7 @@ void i386_device::i386_jz_rel32() // Opcode 0x0f 84 void i386_device::i386_jcxz32() // Opcode 0xe3 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); int val = (m_address_size)?(REG32(ECX) == 0):(REG16(CX) == 0); if( val ) { m_eip += disp; @@ -977,7 +977,7 @@ void i386_device::i386_jcxz32() // Opcode 0xe3 void i386_device::i386_jmp_rel32() // Opcode 0xe9 { - UINT32 disp = FETCH32(); + uint32_t disp = FETCH32(); /* TODO: Segment limit */ m_eip += disp; CHANGE_PC(m_eip); @@ -986,8 +986,8 @@ void i386_device::i386_jmp_rel32() // Opcode 0xe9 void i386_device::i386_jmp_abs32() // Opcode 0xea { - UINT32 address = FETCH32(); - UINT16 segment = FETCH16(); + uint32_t address = FETCH32(); + uint16_t segment = FETCH16(); if( PROTECTED_MODE && !V8086_MODE) { @@ -1006,8 +1006,8 @@ void i386_device::i386_jmp_abs32() // Opcode 0xea void i386_device::i386_lea32() // Opcode 0x8d { - UINT8 modrm = FETCH(); - UINT32 ea = GetNonTranslatedEA(modrm,nullptr); + uint8_t modrm = FETCH(); + uint32_t ea = GetNonTranslatedEA(modrm,nullptr); if (!m_address_size) { ea &= 0xffff; @@ -1018,10 +1018,10 @@ void i386_device::i386_lea32() // Opcode 0x8d void i386_device::i386_enter32() // Opcode 0xc8 { - UINT16 framesize = FETCH16(); - UINT8 level = FETCH() % 32; - UINT8 x; - UINT32 frameptr; + uint16_t framesize = FETCH16(); + uint8_t level = FETCH() % 32; + uint8_t x; + uint32_t frameptr; PUSH32(REG32(EBP)); if(!STACK_32BIT) frameptr = REG16(SP); @@ -1057,7 +1057,7 @@ void i386_device::i386_leave32() // Opcode 0xc9 void i386_device::i386_lodsd() // Opcode 0xad { - UINT32 eas; + uint32_t eas; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); } else { @@ -1070,8 +1070,8 @@ void i386_device::i386_lodsd() // Opcode 0xad void i386_device::i386_loop32() // Opcode 0xe2 { - INT8 disp = FETCH(); - INT32 reg = (m_address_size)?--REG32(ECX):--REG16(CX); + int8_t disp = FETCH(); + int32_t reg = (m_address_size)?--REG32(ECX):--REG16(CX); if( reg != 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -1081,8 +1081,8 @@ void i386_device::i386_loop32() // Opcode 0xe2 void i386_device::i386_loopne32() // Opcode 0xe0 { - INT8 disp = FETCH(); - INT32 reg = (m_address_size)?--REG32(ECX):--REG16(CX); + int8_t disp = FETCH(); + int32_t reg = (m_address_size)?--REG32(ECX):--REG16(CX); if( reg != 0 && m_ZF == 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -1092,8 +1092,8 @@ void i386_device::i386_loopne32() // Opcode 0xe0 void i386_device::i386_loopz32() // Opcode 0xe1 { - INT8 disp = FETCH(); - INT32 reg = (m_address_size)?--REG32(ECX):--REG16(CX); + int8_t disp = FETCH(); + int32_t reg = (m_address_size)?--REG32(ECX):--REG16(CX); if( reg != 0 && m_ZF != 0 ) { m_eip += disp; CHANGE_PC(m_eip); @@ -1103,14 +1103,14 @@ void i386_device::i386_loopz32() // Opcode 0xe1 void i386_device::i386_mov_rm32_r32() // Opcode 0x89 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); STORE_RM32(modrm, src); CYCLES(CYCLES_MOV_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG32(modrm); WRITE32(ea, src); CYCLES(CYCLES_MOV_REG_MEM); @@ -1119,14 +1119,14 @@ void i386_device::i386_mov_rm32_r32() // Opcode 0x89 void i386_device::i386_mov_r32_rm32() // Opcode 0x8b { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); STORE_REG32(modrm, src); CYCLES(CYCLES_MOV_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); STORE_REG32(modrm, src); CYCLES(CYCLES_MOV_MEM_REG); @@ -1135,14 +1135,14 @@ void i386_device::i386_mov_r32_rm32() // Opcode 0x8b void i386_device::i386_mov_rm32_i32() // Opcode 0xc7 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 value = FETCH32(); + uint32_t value = FETCH32(); STORE_RM32(modrm, value); CYCLES(CYCLES_MOV_IMM_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 value = FETCH32(); + uint32_t ea = GetEA(modrm,1); + uint32_t value = FETCH32(); WRITE32(ea, value); CYCLES(CYCLES_MOV_IMM_MEM); } @@ -1150,7 +1150,7 @@ void i386_device::i386_mov_rm32_i32() // Opcode 0xc7 void i386_device::i386_mov_eax_m32() // Opcode 0xa1 { - UINT32 offset, ea; + uint32_t offset, ea; if( m_address_size ) { offset = FETCH32(); } else { @@ -1167,7 +1167,7 @@ void i386_device::i386_mov_eax_m32() // Opcode 0xa1 void i386_device::i386_mov_m32_eax() // Opcode 0xa3 { - UINT32 offset, ea; + uint32_t offset, ea; if( m_address_size ) { offset = FETCH32(); } else { @@ -1232,7 +1232,7 @@ void i386_device::i386_mov_edi_i32() // Opcode 0xbf void i386_device::i386_movsd() // Opcode 0xa5 { - UINT32 eas, ead, v; + uint32_t eas, ead, v; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); } else { @@ -1248,14 +1248,14 @@ void i386_device::i386_movsd() // Opcode 0xa5 void i386_device::i386_movsx_r32_rm8() // Opcode 0x0f be { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - INT32 src = (INT8)LOAD_RM8(modrm); + int32_t src = (int8_t)LOAD_RM8(modrm); STORE_REG32(modrm, src); CYCLES(CYCLES_MOVSX_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); - INT32 src = (INT8)READ8(ea); + uint32_t ea = GetEA(modrm,0); + int32_t src = (int8_t)READ8(ea); STORE_REG32(modrm, src); CYCLES(CYCLES_MOVSX_MEM_REG); } @@ -1263,14 +1263,14 @@ void i386_device::i386_movsx_r32_rm8() // Opcode 0x0f be void i386_device::i386_movsx_r32_rm16() // Opcode 0x0f bf { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - INT32 src = (INT16)LOAD_RM16(modrm); + int32_t src = (int16_t)LOAD_RM16(modrm); STORE_REG32(modrm, src); CYCLES(CYCLES_MOVSX_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); - INT32 src = (INT16)READ16(ea); + uint32_t ea = GetEA(modrm,0); + int32_t src = (int16_t)READ16(ea); STORE_REG32(modrm, src); CYCLES(CYCLES_MOVSX_MEM_REG); } @@ -1278,14 +1278,14 @@ void i386_device::i386_movsx_r32_rm16() // Opcode 0x0f bf void i386_device::i386_movzx_r32_rm8() // Opcode 0x0f b6 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 src = (UINT8)LOAD_RM8(modrm); + uint32_t src = (uint8_t)LOAD_RM8(modrm); STORE_REG32(modrm, src); CYCLES(CYCLES_MOVZX_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); - UINT32 src = (UINT8)READ8(ea); + uint32_t ea = GetEA(modrm,0); + uint32_t src = (uint8_t)READ8(ea); STORE_REG32(modrm, src); CYCLES(CYCLES_MOVZX_MEM_REG); } @@ -1293,14 +1293,14 @@ void i386_device::i386_movzx_r32_rm8() // Opcode 0x0f b6 void i386_device::i386_movzx_r32_rm16() // Opcode 0x0f b7 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 src = (UINT16)LOAD_RM16(modrm); + uint32_t src = (uint16_t)LOAD_RM16(modrm); STORE_REG32(modrm, src); CYCLES(CYCLES_MOVZX_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); - UINT32 src = (UINT16)READ16(ea); + uint32_t ea = GetEA(modrm,0); + uint32_t src = (uint16_t)READ16(ea); STORE_REG32(modrm, src); CYCLES(CYCLES_MOVZX_MEM_REG); } @@ -1308,8 +1308,8 @@ void i386_device::i386_movzx_r32_rm16() // Opcode 0x0f b7 void i386_device::i386_or_rm32_r32() // Opcode 0x09 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); dst = LOAD_RM32(modrm); @@ -1317,7 +1317,7 @@ void i386_device::i386_or_rm32_r32() // Opcode 0x09 STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG32(modrm); dst = READ32(ea); dst = OR32(dst, src); @@ -1328,8 +1328,8 @@ void i386_device::i386_or_rm32_r32() // Opcode 0x09 void i386_device::i386_or_r32_rm32() // Opcode 0x0b { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); dst = LOAD_REG32(modrm); @@ -1337,7 +1337,7 @@ void i386_device::i386_or_r32_rm32() // Opcode 0x0b STORE_REG32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); dst = LOAD_REG32(modrm); dst = OR32(dst, src); @@ -1348,7 +1348,7 @@ void i386_device::i386_or_r32_rm32() // Opcode 0x0b void i386_device::i386_or_eax_i32() // Opcode 0x0d { - UINT32 src, dst; + uint32_t src, dst; src = FETCH32(); dst = REG32(EAX); dst = OR32(dst, src); @@ -1358,23 +1358,23 @@ void i386_device::i386_or_eax_i32() // Opcode 0x0d void i386_device::i386_out_eax_i8() // Opcode 0xe7 { - UINT16 port = FETCH(); - UINT32 data = REG32(EAX); + uint16_t port = FETCH(); + uint32_t data = REG32(EAX); WRITEPORT32(port, data); CYCLES(CYCLES_OUT_VAR); } void i386_device::i386_out_eax_dx() // Opcode 0xef { - UINT16 port = REG16(DX); - UINT32 data = REG32(EAX); + uint16_t port = REG16(DX); + uint32_t data = REG32(EAX); WRITEPORT32(port, data); CYCLES(CYCLES_OUT); } void i386_device::i386_pop_eax() // Opcode 0x58 { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) == 0) REG32(EAX) = POP32(); else @@ -1384,7 +1384,7 @@ void i386_device::i386_pop_eax() // Opcode 0x58 void i386_device::i386_pop_ecx() // Opcode 0x59 { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) == 0) REG32(ECX) = POP32(); else @@ -1394,7 +1394,7 @@ void i386_device::i386_pop_ecx() // Opcode 0x59 void i386_device::i386_pop_edx() // Opcode 0x5a { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) == 0) REG32(EDX) = POP32(); else @@ -1404,7 +1404,7 @@ void i386_device::i386_pop_edx() // Opcode 0x5a void i386_device::i386_pop_ebx() // Opcode 0x5b { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) == 0) REG32(EBX) = POP32(); else @@ -1414,7 +1414,7 @@ void i386_device::i386_pop_ebx() // Opcode 0x5b void i386_device::i386_pop_esp() // Opcode 0x5c { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) == 0) REG32(ESP) = POP32(); else @@ -1424,7 +1424,7 @@ void i386_device::i386_pop_esp() // Opcode 0x5c void i386_device::i386_pop_ebp() // Opcode 0x5d { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) == 0) REG32(EBP) = POP32(); else @@ -1434,7 +1434,7 @@ void i386_device::i386_pop_ebp() // Opcode 0x5d void i386_device::i386_pop_esi() // Opcode 0x5e { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) == 0) REG32(ESI) = POP32(); else @@ -1444,7 +1444,7 @@ void i386_device::i386_pop_esi() // Opcode 0x5e void i386_device::i386_pop_edi() // Opcode 0x5f { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) == 0) REG32(EDI) = POP32(); else @@ -1454,8 +1454,8 @@ void i386_device::i386_pop_edi() // Opcode 0x5f bool i386_device::i386_pop_seg32(int segment) { - UINT32 ea, offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); - UINT32 value; + uint32_t ea, offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t value; bool fault; if(i386_limit_check(SS,offset+3) == 0) { @@ -1510,15 +1510,15 @@ void i386_device::i386_pop_ss32() // Opcode 0x17 void i386_device::i386_pop_rm32() // Opcode 0x8f { - UINT8 modrm = FETCH(); - UINT32 value; - UINT32 ea, offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint8_t modrm = FETCH(); + uint32_t value; + uint32_t ea, offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+3) == 0) { // be careful here, if the write references the esp register // it expects the post-pop value but esp must be wound back // if the write faults - UINT32 temp_sp = REG32(ESP); + uint32_t temp_sp = REG32(ESP); value = POP32(); if( modrm >= 0xc0 ) { @@ -1529,7 +1529,7 @@ void i386_device::i386_pop_rm32() // Opcode 0x8f { WRITE32(ea, value); } - catch(UINT64 e) + catch(uint64_t e) { REG32(ESP) = temp_sp; throw e; @@ -1543,7 +1543,7 @@ void i386_device::i386_pop_rm32() // Opcode 0x8f void i386_device::i386_popad() // Opcode 0x61 { - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); if(i386_limit_check(SS,offset+31) == 0) { REG32(EDI) = POP32(); @@ -1562,11 +1562,11 @@ void i386_device::i386_popad() // Opcode 0x61 void i386_device::i386_popfd() // Opcode 0x9d { - UINT32 value; - UINT32 current = get_flags(); - UINT8 IOPL = (current >> 12) & 0x03; - UINT32 mask = 0x00257fd5; // VM, VIP and VIF cannot be set by POPF/POPFD - UINT32 offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); + uint32_t value; + uint32_t current = get_flags(); + uint8_t IOPL = (current >> 12) & 0x03; + uint32_t mask = 0x00257fd5; // VM, VIP and VIF cannot be set by POPF/POPFD + uint32_t offset = (STACK_32BIT ? REG32(ESP) : REG16(SP)); // IOPL can only change if CPL is 0 if(m_CPL != 0) @@ -1599,7 +1599,7 @@ void i386_device::i386_popfd() // Opcode 0x9d void i386_device::i386_push_eax() // Opcode 0x50 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1613,7 +1613,7 @@ void i386_device::i386_push_eax() // Opcode 0x50 void i386_device::i386_push_ecx() // Opcode 0x51 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1627,7 +1627,7 @@ void i386_device::i386_push_ecx() // Opcode 0x51 void i386_device::i386_push_edx() // Opcode 0x52 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1641,7 +1641,7 @@ void i386_device::i386_push_edx() // Opcode 0x52 void i386_device::i386_push_ebx() // Opcode 0x53 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1655,7 +1655,7 @@ void i386_device::i386_push_ebx() // Opcode 0x53 void i386_device::i386_push_esp() // Opcode 0x54 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1669,7 +1669,7 @@ void i386_device::i386_push_esp() // Opcode 0x54 void i386_device::i386_push_ebp() // Opcode 0x55 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1683,7 +1683,7 @@ void i386_device::i386_push_ebp() // Opcode 0x55 void i386_device::i386_push_esi() // Opcode 0x56 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1697,7 +1697,7 @@ void i386_device::i386_push_esi() // Opcode 0x56 void i386_device::i386_push_edi() // Opcode 0x57 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1711,7 +1711,7 @@ void i386_device::i386_push_edi() // Opcode 0x57 void i386_device::i386_push_cs32() // Opcode 0x0e { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1725,7 +1725,7 @@ void i386_device::i386_push_cs32() // Opcode 0x0e void i386_device::i386_push_ds32() // Opcode 0x1e { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1739,7 +1739,7 @@ void i386_device::i386_push_ds32() // Opcode 0x1e void i386_device::i386_push_es32() // Opcode 0x06 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1753,7 +1753,7 @@ void i386_device::i386_push_es32() // Opcode 0x06 void i386_device::i386_push_fs32() // Opcode 0x0f a0 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1767,7 +1767,7 @@ void i386_device::i386_push_fs32() // Opcode 0x0f a0 void i386_device::i386_push_gs32() // Opcode 0x0f a8 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1781,7 +1781,7 @@ void i386_device::i386_push_gs32() // Opcode 0x0f a8 void i386_device::i386_push_ss32() // Opcode 0x16 { - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1795,8 +1795,8 @@ void i386_device::i386_push_ss32() // Opcode 0x16 void i386_device::i386_push_i32() // Opcode 0x68 { - UINT32 value = FETCH32(); - UINT32 offset; + uint32_t value = FETCH32(); + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1810,8 +1810,8 @@ void i386_device::i386_push_i32() // Opcode 0x68 void i386_device::i386_pushad() // Opcode 0x60 { - UINT32 temp = REG32(ESP); - UINT32 offset; + uint32_t temp = REG32(ESP); + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 32; else @@ -1836,7 +1836,7 @@ void i386_device::i386_pushfd() // Opcode 0x9c { if(!m_IOP1 && !m_IOP2 && V8086_MODE) FAULT(FAULT_GP,0) - UINT32 offset; + uint32_t offset; if(STACK_32BIT) offset = REG32(ESP) - 4; else @@ -1850,7 +1850,7 @@ void i386_device::i386_pushfd() // Opcode 0x9c void i386_device::i386_ret_near32_i16() // Opcode 0xc2 { - INT16 disp = FETCH16(); + int16_t disp = FETCH16(); m_eip = POP32(); REG32(ESP) += disp; CHANGE_PC(m_eip); @@ -1866,8 +1866,8 @@ void i386_device::i386_ret_near32() // Opcode 0xc3 void i386_device::i386_sbb_rm32_r32() // Opcode 0x19 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); dst = LOAD_RM32(modrm); @@ -1875,7 +1875,7 @@ void i386_device::i386_sbb_rm32_r32() // Opcode 0x19 STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG32(modrm); dst = READ32(ea); dst = SBB32(dst, src, m_CF); @@ -1886,8 +1886,8 @@ void i386_device::i386_sbb_rm32_r32() // Opcode 0x19 void i386_device::i386_sbb_r32_rm32() // Opcode 0x1b { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); dst = LOAD_REG32(modrm); @@ -1895,7 +1895,7 @@ void i386_device::i386_sbb_r32_rm32() // Opcode 0x1b STORE_REG32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); dst = LOAD_REG32(modrm); dst = SBB32(dst, src, m_CF); @@ -1906,7 +1906,7 @@ void i386_device::i386_sbb_r32_rm32() // Opcode 0x1b void i386_device::i386_sbb_eax_i32() // Opcode 0x1d { - UINT32 src, dst; + uint32_t src, dst; src = FETCH32(); dst = REG32(EAX); dst = SBB32(dst, src, m_CF); @@ -1916,7 +1916,7 @@ void i386_device::i386_sbb_eax_i32() // Opcode 0x1d void i386_device::i386_scasd() // Opcode 0xaf { - UINT32 eas, src, dst; + uint32_t eas, src, dst; eas = i386_translate(ES, m_address_size ? REG32(EDI) : REG16(DI), 0 ); src = READ32(eas); dst = REG32(EAX); @@ -1927,11 +1927,11 @@ void i386_device::i386_scasd() // Opcode 0xaf void i386_device::i386_shld32_i8() // Opcode 0x0f a4 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 upper = LOAD_REG32(modrm); - UINT8 shift = FETCH(); + uint32_t dst = LOAD_RM32(modrm); + uint32_t upper = LOAD_REG32(modrm); + uint8_t shift = FETCH(); shift &= 31; if( shift == 0 ) { } else { @@ -1943,10 +1943,10 @@ void i386_device::i386_shld32_i8() // Opcode 0x0f a4 STORE_RM32(modrm, dst); CYCLES(CYCLES_SHLD_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); - UINT32 upper = LOAD_REG32(modrm); - UINT8 shift = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); + uint32_t upper = LOAD_REG32(modrm); + uint8_t shift = FETCH(); shift &= 31; if( shift == 0 ) { } else { @@ -1962,11 +1962,11 @@ void i386_device::i386_shld32_i8() // Opcode 0x0f a4 void i386_device::i386_shld32_cl() // Opcode 0x0f a5 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 upper = LOAD_REG32(modrm); - UINT8 shift = REG8(CL); + uint32_t dst = LOAD_RM32(modrm); + uint32_t upper = LOAD_REG32(modrm); + uint8_t shift = REG8(CL); shift &= 31; if( shift == 0 ) { } else { @@ -1978,10 +1978,10 @@ void i386_device::i386_shld32_cl() // Opcode 0x0f a5 STORE_RM32(modrm, dst); CYCLES(CYCLES_SHLD_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); - UINT32 upper = LOAD_REG32(modrm); - UINT8 shift = REG8(CL); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); + uint32_t upper = LOAD_REG32(modrm); + uint8_t shift = REG8(CL); shift &= 31; if( shift == 0 ) { } else { @@ -1997,11 +1997,11 @@ void i386_device::i386_shld32_cl() // Opcode 0x0f a5 void i386_device::i386_shrd32_i8() // Opcode 0x0f ac { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 upper = LOAD_REG32(modrm); - UINT8 shift = FETCH(); + uint32_t dst = LOAD_RM32(modrm); + uint32_t upper = LOAD_REG32(modrm); + uint8_t shift = FETCH(); shift &= 31; if( shift == 0 ) { } else { @@ -2013,10 +2013,10 @@ void i386_device::i386_shrd32_i8() // Opcode 0x0f ac STORE_RM32(modrm, dst); CYCLES(CYCLES_SHRD_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); - UINT32 upper = LOAD_REG32(modrm); - UINT8 shift = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); + uint32_t upper = LOAD_REG32(modrm); + uint8_t shift = FETCH(); shift &= 31; if( shift == 0 ) { } else { @@ -2032,11 +2032,11 @@ void i386_device::i386_shrd32_i8() // Opcode 0x0f ac void i386_device::i386_shrd32_cl() // Opcode 0x0f ad { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 upper = LOAD_REG32(modrm); - UINT8 shift = REG8(CL); + uint32_t dst = LOAD_RM32(modrm); + uint32_t upper = LOAD_REG32(modrm); + uint8_t shift = REG8(CL); shift &= 31; if( shift == 0 ) { } else { @@ -2048,10 +2048,10 @@ void i386_device::i386_shrd32_cl() // Opcode 0x0f ad STORE_RM32(modrm, dst); CYCLES(CYCLES_SHRD_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); - UINT32 upper = LOAD_REG32(modrm); - UINT8 shift = REG8(CL); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); + uint32_t upper = LOAD_REG32(modrm); + uint8_t shift = REG8(CL); shift &= 31; if( shift == 0 ) { } else { @@ -2067,7 +2067,7 @@ void i386_device::i386_shrd32_cl() // Opcode 0x0f ad void i386_device::i386_stosd() // Opcode 0xab { - UINT32 eas = i386_translate(ES, m_address_size ? REG32(EDI) : REG16(DI), 1 ); + uint32_t eas = i386_translate(ES, m_address_size ? REG32(EDI) : REG16(DI), 1 ); WRITE32(eas, REG32(EAX)); BUMP_DI(4); CYCLES(CYCLES_STOS); @@ -2075,8 +2075,8 @@ void i386_device::i386_stosd() // Opcode 0xab void i386_device::i386_sub_rm32_r32() // Opcode 0x29 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); dst = LOAD_RM32(modrm); @@ -2084,7 +2084,7 @@ void i386_device::i386_sub_rm32_r32() // Opcode 0x29 STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG32(modrm); dst = READ32(ea); dst = SUB32(dst, src); @@ -2095,8 +2095,8 @@ void i386_device::i386_sub_rm32_r32() // Opcode 0x29 void i386_device::i386_sub_r32_rm32() // Opcode 0x2b { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); dst = LOAD_REG32(modrm); @@ -2104,7 +2104,7 @@ void i386_device::i386_sub_r32_rm32() // Opcode 0x2b STORE_REG32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = READ32(ea); dst = LOAD_REG32(modrm); dst = SUB32(dst, src); @@ -2115,7 +2115,7 @@ void i386_device::i386_sub_r32_rm32() // Opcode 0x2b void i386_device::i386_sub_eax_i32() // Opcode 0x2d { - UINT32 src, dst; + uint32_t src, dst; src = FETCH32(); dst = REG32(EAX); dst = SUB32(dst, src); @@ -2125,8 +2125,8 @@ void i386_device::i386_sub_eax_i32() // Opcode 0x2d void i386_device::i386_test_eax_i32() // Opcode 0xa9 { - UINT32 src = FETCH32(); - UINT32 dst = REG32(EAX); + uint32_t src = FETCH32(); + uint32_t dst = REG32(EAX); dst = src & dst; SetSZPF32(dst); m_CF = 0; @@ -2136,8 +2136,8 @@ void i386_device::i386_test_eax_i32() // Opcode 0xa9 void i386_device::i386_test_rm32_r32() // Opcode 0x85 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); dst = LOAD_RM32(modrm); @@ -2147,7 +2147,7 @@ void i386_device::i386_test_rm32_r32() // Opcode 0x85 m_OF = 0; CYCLES(CYCLES_TEST_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = LOAD_REG32(modrm); dst = READ32(ea); dst = src & dst; @@ -2160,7 +2160,7 @@ void i386_device::i386_test_rm32_r32() // Opcode 0x85 void i386_device::i386_xchg_eax_ecx() // Opcode 0x91 { - UINT32 temp; + uint32_t temp; temp = REG32(EAX); REG32(EAX) = REG32(ECX); REG32(ECX) = temp; @@ -2169,7 +2169,7 @@ void i386_device::i386_xchg_eax_ecx() // Opcode 0x91 void i386_device::i386_xchg_eax_edx() // Opcode 0x92 { - UINT32 temp; + uint32_t temp; temp = REG32(EAX); REG32(EAX) = REG32(EDX); REG32(EDX) = temp; @@ -2178,7 +2178,7 @@ void i386_device::i386_xchg_eax_edx() // Opcode 0x92 void i386_device::i386_xchg_eax_ebx() // Opcode 0x93 { - UINT32 temp; + uint32_t temp; temp = REG32(EAX); REG32(EAX) = REG32(EBX); REG32(EBX) = temp; @@ -2187,7 +2187,7 @@ void i386_device::i386_xchg_eax_ebx() // Opcode 0x93 void i386_device::i386_xchg_eax_esp() // Opcode 0x94 { - UINT32 temp; + uint32_t temp; temp = REG32(EAX); REG32(EAX) = REG32(ESP); REG32(ESP) = temp; @@ -2196,7 +2196,7 @@ void i386_device::i386_xchg_eax_esp() // Opcode 0x94 void i386_device::i386_xchg_eax_ebp() // Opcode 0x95 { - UINT32 temp; + uint32_t temp; temp = REG32(EAX); REG32(EAX) = REG32(EBP); REG32(EBP) = temp; @@ -2205,7 +2205,7 @@ void i386_device::i386_xchg_eax_ebp() // Opcode 0x95 void i386_device::i386_xchg_eax_esi() // Opcode 0x96 { - UINT32 temp; + uint32_t temp; temp = REG32(EAX); REG32(EAX) = REG32(ESI); REG32(ESI) = temp; @@ -2214,7 +2214,7 @@ void i386_device::i386_xchg_eax_esi() // Opcode 0x96 void i386_device::i386_xchg_eax_edi() // Opcode 0x97 { - UINT32 temp; + uint32_t temp; temp = REG32(EAX); REG32(EAX) = REG32(EDI); REG32(EDI) = temp; @@ -2223,17 +2223,17 @@ void i386_device::i386_xchg_eax_edi() // Opcode 0x97 void i386_device::i386_xchg_r32_rm32() // Opcode 0x87 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 src = LOAD_RM32(modrm); - UINT32 dst = LOAD_REG32(modrm); + uint32_t src = LOAD_RM32(modrm); + uint32_t dst = LOAD_REG32(modrm); STORE_REG32(modrm, src); STORE_RM32(modrm, dst); CYCLES(CYCLES_XCHG_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 src = READ32(ea); - UINT32 dst = LOAD_REG32(modrm); + uint32_t ea = GetEA(modrm,1); + uint32_t src = READ32(ea); + uint32_t dst = LOAD_REG32(modrm); WRITE32(ea, dst); STORE_REG32(modrm, src); CYCLES(CYCLES_XCHG_REG_MEM); @@ -2242,8 +2242,8 @@ void i386_device::i386_xchg_r32_rm32() // Opcode 0x87 void i386_device::i386_xor_rm32_r32() // Opcode 0x31 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG32(modrm); dst = LOAD_RM32(modrm); @@ -2251,7 +2251,7 @@ void i386_device::i386_xor_rm32_r32() // Opcode 0x31 STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG32(modrm); dst = READ32(ea); dst = XOR32(dst, src); @@ -2262,8 +2262,8 @@ void i386_device::i386_xor_rm32_r32() // Opcode 0x31 void i386_device::i386_xor_r32_rm32() // Opcode 0x33 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); dst = LOAD_REG32(modrm); @@ -2271,7 +2271,7 @@ void i386_device::i386_xor_r32_rm32() // Opcode 0x33 STORE_REG32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); dst = LOAD_REG32(modrm); dst = XOR32(dst, src); @@ -2282,7 +2282,7 @@ void i386_device::i386_xor_r32_rm32() // Opcode 0x33 void i386_device::i386_xor_eax_i32() // Opcode 0x35 { - UINT32 src, dst; + uint32_t src, dst; src = FETCH32(); dst = REG32(EAX); dst = XOR32(dst, src); @@ -2294,9 +2294,9 @@ void i386_device::i386_xor_eax_i32() // Opcode 0x35 void i386_device::i386_group81_32() // Opcode 0x81 { - UINT32 ea; - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t ea; + uint32_t src, dst; + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { @@ -2431,23 +2431,23 @@ void i386_device::i386_group81_32() // Opcode 0x81 void i386_device::i386_group83_32() // Opcode 0x83 { - UINT32 ea; - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t ea; + uint32_t src, dst; + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 0: // ADD Rm32, i32 if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = ADD32(dst, src); STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ32(ea); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = ADD32(dst, src); WRITE32(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2456,14 +2456,14 @@ void i386_device::i386_group83_32() // Opcode 0x83 case 1: // OR Rm32, i32 if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = OR32(dst, src); STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ32(ea); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = OR32(dst, src); WRITE32(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2472,14 +2472,14 @@ void i386_device::i386_group83_32() // Opcode 0x83 case 2: // ADC Rm32, i32 if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = ADC32(dst, src, m_CF); STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ32(ea); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = ADC32(dst, src, m_CF); WRITE32(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2488,14 +2488,14 @@ void i386_device::i386_group83_32() // Opcode 0x83 case 3: // SBB Rm32, i32 if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); - src = ((UINT32)(INT32)(INT8)FETCH()); + src = ((uint32_t)(int32_t)(int8_t)FETCH()); dst = SBB32(dst, src, m_CF); STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ32(ea); - src = ((UINT32)(INT32)(INT8)FETCH()); + src = ((uint32_t)(int32_t)(int8_t)FETCH()); dst = SBB32(dst, src, m_CF); WRITE32(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2504,14 +2504,14 @@ void i386_device::i386_group83_32() // Opcode 0x83 case 4: // AND Rm32, i32 if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = AND32(dst, src); STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ32(ea); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = AND32(dst, src); WRITE32(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2520,14 +2520,14 @@ void i386_device::i386_group83_32() // Opcode 0x83 case 5: // SUB Rm32, i32 if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = SUB32(dst, src); STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ32(ea); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = SUB32(dst, src); WRITE32(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2536,14 +2536,14 @@ void i386_device::i386_group83_32() // Opcode 0x83 case 6: // XOR Rm32, i32 if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = XOR32(dst, src); STORE_RM32(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { ea = GetEA(modrm,1); dst = READ32(ea); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); dst = XOR32(dst, src); WRITE32(ea, dst); CYCLES(CYCLES_ALU_REG_MEM); @@ -2552,13 +2552,13 @@ void i386_device::i386_group83_32() // Opcode 0x83 case 7: // CMP Rm32, i32 if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); SUB32(dst, src); CYCLES(CYCLES_CMP_REG_REG); } else { ea = GetEA(modrm,0); dst = READ32(ea); - src = (UINT32)(INT32)(INT8)FETCH(); + src = (uint32_t)(int32_t)(int8_t)FETCH(); SUB32(dst, src); CYCLES(CYCLES_CMP_REG_MEM); } @@ -2568,9 +2568,9 @@ void i386_device::i386_group83_32() // Opcode 0x83 void i386_device::i386_groupC1_32() // Opcode 0xc1 { - UINT32 dst; - UINT8 modrm = FETCH(); - UINT8 shift; + uint32_t dst; + uint8_t modrm = FETCH(); + uint8_t shift; if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); @@ -2578,7 +2578,7 @@ void i386_device::i386_groupC1_32() // Opcode 0xc1 dst = i386_shift_rotate32(modrm, dst, shift); STORE_RM32(modrm, dst); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); dst = READ32(ea); shift = FETCH() & 0x1f; dst = i386_shift_rotate32(modrm, dst, shift); @@ -2588,15 +2588,15 @@ void i386_device::i386_groupC1_32() // Opcode 0xc1 void i386_device::i386_groupD1_32() // Opcode 0xd1 { - UINT32 dst; - UINT8 modrm = FETCH(); + uint32_t dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); dst = i386_shift_rotate32(modrm, dst, 1); STORE_RM32(modrm, dst); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); dst = READ32(ea); dst = i386_shift_rotate32(modrm, dst, 1); WRITE32(ea, dst); @@ -2605,15 +2605,15 @@ void i386_device::i386_groupD1_32() // Opcode 0xd1 void i386_device::i386_groupD3_32() // Opcode 0xd3 { - UINT32 dst; - UINT8 modrm = FETCH(); + uint32_t dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { dst = LOAD_RM32(modrm); dst = i386_shift_rotate32(modrm, dst, REG8(CL)); STORE_RM32(modrm, dst); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); dst = READ32(ea); dst = i386_shift_rotate32(modrm, dst, REG8(CL)); WRITE32(ea, dst); @@ -2622,22 +2622,22 @@ void i386_device::i386_groupD3_32() // Opcode 0xd3 void i386_device::i386_groupF7_32() // Opcode 0xf7 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 0: /* TEST Rm32, i32 */ if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 src = FETCH32(); + uint32_t dst = LOAD_RM32(modrm); + uint32_t src = FETCH32(); dst &= src; m_CF = m_OF = m_AF = 0; SetSZPF32(dst); CYCLES(CYCLES_TEST_IMM_REG); } else { - UINT32 ea = GetEA(modrm,0); - UINT32 dst = READ32(ea); - UINT32 src = FETCH32(); + uint32_t ea = GetEA(modrm,0); + uint32_t dst = READ32(ea); + uint32_t src = FETCH32(); dst &= src; m_CF = m_OF = m_AF = 0; SetSZPF32(dst); @@ -2646,13 +2646,13 @@ void i386_device::i386_groupF7_32() // Opcode 0xf7 break; case 2: /* NOT Rm32 */ if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); + uint32_t dst = LOAD_RM32(modrm); dst = ~dst; STORE_RM32(modrm, dst); CYCLES(CYCLES_NOT_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); dst = ~dst; WRITE32(ea, dst); CYCLES(CYCLES_NOT_MEM); @@ -2660,13 +2660,13 @@ void i386_device::i386_groupF7_32() // Opcode 0xf7 break; case 3: /* NEG Rm32 */ if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); + uint32_t dst = LOAD_RM32(modrm); dst = SUB32(0, dst ); STORE_RM32(modrm, dst); CYCLES(CYCLES_NEG_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); dst = SUB32(0, dst ); WRITE32(ea, dst); CYCLES(CYCLES_NEG_MEM); @@ -2674,69 +2674,69 @@ void i386_device::i386_groupF7_32() // Opcode 0xf7 break; case 4: /* MUL EAX, Rm32 */ { - UINT64 result; - UINT32 src, dst; + uint64_t result; + uint32_t src, dst; if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); CYCLES(CYCLES_MUL32_ACC_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); CYCLES(CYCLES_MUL32_ACC_MEM); /* TODO: Correct multiply timing */ } dst = REG32(EAX); - result = (UINT64)src * (UINT64)dst; - REG32(EDX) = (UINT32)(result >> 32); - REG32(EAX) = (UINT32)result; + result = (uint64_t)src * (uint64_t)dst; + REG32(EDX) = (uint32_t)(result >> 32); + REG32(EAX) = (uint32_t)result; m_CF = m_OF = (REG32(EDX) != 0); } break; case 5: /* IMUL EAX, Rm32 */ { - INT64 result; - INT64 src, dst; + int64_t result; + int64_t src, dst; if( modrm >= 0xc0 ) { - src = (INT64)(INT32)LOAD_RM32(modrm); + src = (int64_t)(int32_t)LOAD_RM32(modrm); CYCLES(CYCLES_IMUL32_ACC_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); - src = (INT64)(INT32)READ32(ea); + uint32_t ea = GetEA(modrm,0); + src = (int64_t)(int32_t)READ32(ea); CYCLES(CYCLES_IMUL32_ACC_MEM); /* TODO: Correct multiply timing */ } - dst = (INT64)(INT32)REG32(EAX); + dst = (int64_t)(int32_t)REG32(EAX); result = src * dst; - REG32(EDX) = (UINT32)(result >> 32); - REG32(EAX) = (UINT32)result; + REG32(EDX) = (uint32_t)(result >> 32); + REG32(EAX) = (uint32_t)result; - m_CF = m_OF = !(result == (INT64)(INT32)result); + m_CF = m_OF = !(result == (int64_t)(int32_t)result); } break; case 6: /* DIV EAX, Rm32 */ { - UINT64 quotient, remainder, result; - UINT32 src; + uint64_t quotient, remainder, result; + uint32_t src; if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); CYCLES(CYCLES_DIV32_ACC_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); CYCLES(CYCLES_DIV32_ACC_MEM); } - quotient = ((UINT64)(REG32(EDX)) << 32) | (UINT64)(REG32(EAX)); + quotient = ((uint64_t)(REG32(EDX)) << 32) | (uint64_t)(REG32(EAX)); if( src ) { - remainder = quotient % (UINT64)src; - result = quotient / (UINT64)src; + remainder = quotient % (uint64_t)src; + result = quotient / (uint64_t)src; if( result > 0xffffffff ) { /* TODO: Divide error */ } else { - REG32(EDX) = (UINT32)remainder; - REG32(EAX) = (UINT32)result; + REG32(EDX) = (uint32_t)remainder; + REG32(EAX) = (uint32_t)result; } } else { i386_trap(0, 0, 0); @@ -2745,26 +2745,26 @@ void i386_device::i386_groupF7_32() // Opcode 0xf7 break; case 7: /* IDIV EAX, Rm32 */ { - INT64 quotient, remainder, result; - UINT32 src; + int64_t quotient, remainder, result; + uint32_t src; if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); CYCLES(CYCLES_IDIV32_ACC_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); CYCLES(CYCLES_IDIV32_ACC_MEM); } - quotient = (((INT64)REG32(EDX)) << 32) | ((UINT64)REG32(EAX)); + quotient = (((int64_t)REG32(EDX)) << 32) | ((uint64_t)REG32(EAX)); if( src ) { - remainder = quotient % (INT64)(INT32)src; - result = quotient / (INT64)(INT32)src; + remainder = quotient % (int64_t)(int32_t)src; + result = quotient / (int64_t)(int32_t)src; if( result > 0xffffffff ) { /* TODO: Divide error */ } else { - REG32(EDX) = (UINT32)remainder; - REG32(EAX) = (UINT32)result; + REG32(EDX) = (uint32_t)remainder; + REG32(EAX) = (uint32_t)result; } } else { i386_trap(0, 0, 0); @@ -2776,19 +2776,19 @@ void i386_device::i386_groupF7_32() // Opcode 0xf7 void i386_device::i386_groupFF_32() // Opcode 0xff { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 0: /* INC Rm32 */ if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); + uint32_t dst = LOAD_RM32(modrm); dst = INC32(dst); STORE_RM32(modrm, dst); CYCLES(CYCLES_INC_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); dst = INC32(dst); WRITE32(ea, dst); CYCLES(CYCLES_INC_MEM); @@ -2796,13 +2796,13 @@ void i386_device::i386_groupFF_32() // Opcode 0xff break; case 1: /* DEC Rm32 */ if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); + uint32_t dst = LOAD_RM32(modrm); dst = DEC32(dst); STORE_RM32(modrm, dst); CYCLES(CYCLES_DEC_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); dst = DEC32(dst); WRITE32(ea, dst); CYCLES(CYCLES_DEC_MEM); @@ -2810,12 +2810,12 @@ void i386_device::i386_groupFF_32() // Opcode 0xff break; case 2: /* CALL Rm32 */ { - UINT32 address; + uint32_t address; if( modrm >= 0xc0 ) { address = LOAD_RM32(modrm); CYCLES(CYCLES_CALL_REG); /* TODO: Timing = 7 + m */ } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); address = READ32(ea); CYCLES(CYCLES_CALL_MEM); /* TODO: Timing = 10 + m */ } @@ -2826,8 +2826,8 @@ void i386_device::i386_groupFF_32() // Opcode 0xff break; case 3: /* CALL FAR Rm32 */ { - UINT16 selector; - UINT32 address; + uint16_t selector; + uint32_t address; if( modrm >= 0xc0 ) { @@ -2835,7 +2835,7 @@ void i386_device::i386_groupFF_32() // Opcode 0xff } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); address = READ32(ea + 0); selector = READ16(ea + 4); CYCLES(CYCLES_CALL_MEM_INTERSEG); /* TODO: Timing = 10 + m */ @@ -2858,12 +2858,12 @@ void i386_device::i386_groupFF_32() // Opcode 0xff break; case 4: /* JMP Rm32 */ { - UINT32 address; + uint32_t address; if( modrm >= 0xc0 ) { address = LOAD_RM32(modrm); CYCLES(CYCLES_JMP_REG); /* TODO: Timing = 7 + m */ } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); address = READ32(ea); CYCLES(CYCLES_JMP_MEM); /* TODO: Timing = 10 + m */ } @@ -2873,8 +2873,8 @@ void i386_device::i386_groupFF_32() // Opcode 0xff break; case 5: /* JMP FAR Rm32 */ { - UINT16 selector; - UINT32 address; + uint16_t selector; + uint32_t address; if( modrm >= 0xc0 ) { @@ -2882,7 +2882,7 @@ void i386_device::i386_groupFF_32() // Opcode 0xff } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); address = READ32(ea + 0); selector = READ16(ea + 4); CYCLES(CYCLES_JMP_MEM_INTERSEG); /* TODO: Timing = 10 + m */ @@ -2903,11 +2903,11 @@ void i386_device::i386_groupFF_32() // Opcode 0xff break; case 6: /* PUSH Rm32 */ { - UINT32 value; + uint32_t value; if( modrm >= 0xc0 ) { value = LOAD_RM32(modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); value = READ32(ea); } PUSH32(value); @@ -2922,10 +2922,10 @@ void i386_device::i386_groupFF_32() // Opcode 0xff void i386_device::i386_group0F00_32() // Opcode 0x0f 00 { - UINT32 address, ea; - UINT8 modrm = FETCH(); + uint32_t address, ea; + uint8_t modrm = FETCH(); I386_SREG seg; - UINT8 result; + uint8_t result; switch( (modrm >> 3) & 0x7 ) { @@ -3008,7 +3008,7 @@ void i386_device::i386_group0F00_32() // Opcode 0x0f 00 seg.selector = m_task.segment; i386_load_protected_mode_segment(&seg,nullptr); - UINT32 addr = ((seg.selector & 4) ? m_ldtr.base : m_gdtr.base) + (seg.selector & ~7) + 5; + uint32_t addr = ((seg.selector & 4) ? m_ldtr.base : m_gdtr.base) + (seg.selector & ~7) + 5; i386_translate_address(TRANSLATE_READ, &addr, nullptr); m_program->write_byte(addr, (seg.flags & 0xff) | 2); @@ -3119,8 +3119,8 @@ void i386_device::i386_group0F00_32() // Opcode 0x0f 00 void i386_device::i386_group0F01_32() // Opcode 0x0f 01 { - UINT8 modrm = FETCH(); - UINT32 address, ea; + uint8_t modrm = FETCH(); + uint32_t address, ea; switch( (modrm >> 3) & 0x7 ) { @@ -3201,7 +3201,7 @@ void i386_device::i386_group0F01_32() // Opcode 0x0f 01 { if(PROTECTED_MODE && m_CPL) FAULT(FAULT_GP,0) - UINT16 b; + uint16_t b; if( modrm >= 0xc0 ) { b = LOAD_RM16(modrm); CYCLES(CYCLES_LMSW_REG); @@ -3224,14 +3224,14 @@ void i386_device::i386_group0F01_32() // Opcode 0x0f 01 void i386_device::i386_group0FBA_32() // Opcode 0x0f ba { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 4: /* BT Rm32, i8 */ if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT8 bit = FETCH(); + uint32_t dst = LOAD_RM32(modrm); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3240,9 +3240,9 @@ void i386_device::i386_group0FBA_32() // Opcode 0x0f ba CYCLES(CYCLES_BT_IMM_REG); } else { - UINT32 ea = GetEA(modrm,0); - UINT32 dst = READ32(ea); - UINT8 bit = FETCH(); + uint32_t ea = GetEA(modrm,0); + uint32_t dst = READ32(ea); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3254,8 +3254,8 @@ void i386_device::i386_group0FBA_32() // Opcode 0x0f ba break; case 5: /* BTS Rm32, i8 */ if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT8 bit = FETCH(); + uint32_t dst = LOAD_RM32(modrm); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3266,9 +3266,9 @@ void i386_device::i386_group0FBA_32() // Opcode 0x0f ba STORE_RM32(modrm, dst); CYCLES(CYCLES_BTS_IMM_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); - UINT8 bit = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3282,8 +3282,8 @@ void i386_device::i386_group0FBA_32() // Opcode 0x0f ba break; case 6: /* BTR Rm32, i8 */ if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT8 bit = FETCH(); + uint32_t dst = LOAD_RM32(modrm); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3294,9 +3294,9 @@ void i386_device::i386_group0FBA_32() // Opcode 0x0f ba STORE_RM32(modrm, dst); CYCLES(CYCLES_BTR_IMM_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); - UINT8 bit = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3310,8 +3310,8 @@ void i386_device::i386_group0FBA_32() // Opcode 0x0f ba break; case 7: /* BTC Rm32, i8 */ if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT8 bit = FETCH(); + uint32_t dst = LOAD_RM32(modrm); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3322,9 +3322,9 @@ void i386_device::i386_group0FBA_32() // Opcode 0x0f ba STORE_RM32(modrm, dst); CYCLES(CYCLES_BTC_IMM_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); - UINT8 bit = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); + uint8_t bit = FETCH(); if( dst & (1 << bit) ) m_CF = 1; @@ -3344,9 +3344,9 @@ void i386_device::i386_group0FBA_32() // Opcode 0x0f ba void i386_device::i386_lar_r32_rm32() // Opcode 0x0f 0x02 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); I386_SREG seg; - UINT8 type; + uint8_t type; if(PROTECTED_MODE && !V8086_MODE) { @@ -3358,7 +3358,7 @@ void i386_device::i386_lar_r32_rm32() // Opcode 0x0f 0x02 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); seg.selector = READ32(ea); CYCLES(CYCLES_LAR_MEM); } @@ -3368,13 +3368,13 @@ void i386_device::i386_lar_r32_rm32() // Opcode 0x0f 0x02 } else { - UINT64 desc; + uint64_t desc; if(!i386_load_protected_mode_segment(&seg,&desc)) { SetZF(0); return; } - UINT8 DPL = (seg.flags >> 5) & 3; + uint8_t DPL = (seg.flags >> 5) & 3; if(((DPL < m_CPL) || (DPL < (seg.selector & 3))) && ((seg.flags & 0x1c) != 0x1c)) { SetZF(0); @@ -3411,8 +3411,8 @@ void i386_device::i386_lar_r32_rm32() // Opcode 0x0f 0x02 void i386_device::i386_lsl_r32_rm32() // Opcode 0x0f 0x03 { - UINT8 modrm = FETCH(); - UINT32 limit; + uint8_t modrm = FETCH(); + uint32_t limit; I386_SREG seg; if(PROTECTED_MODE && !V8086_MODE) @@ -3424,7 +3424,7 @@ void i386_device::i386_lsl_r32_rm32() // Opcode 0x0f 0x03 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); seg.selector = READ32(ea); } if(seg.selector == 0) @@ -3433,13 +3433,13 @@ void i386_device::i386_lsl_r32_rm32() // Opcode 0x0f 0x03 } else { - UINT8 type; + uint8_t type; if(!i386_load_protected_mode_segment(&seg,nullptr)) { SetZF(0); return; } - UINT8 DPL = (seg.flags >> 5) & 3; + uint8_t DPL = (seg.flags >> 5) & 3; if(((DPL < m_CPL) || (DPL < (seg.selector & 3))) && ((seg.flags & 0x1c) != 0x1c)) { SetZF(0); @@ -3474,8 +3474,8 @@ void i386_device::i386_lsl_r32_rm32() // Opcode 0x0f 0x03 void i386_device::i386_bound_r32_m32_m32() // Opcode 0x62 { - UINT8 modrm; - INT32 val, low, high; + uint8_t modrm; + int32_t val, low, high; modrm = FETCH(); @@ -3485,7 +3485,7 @@ void i386_device::i386_bound_r32_m32_m32() // Opcode 0x62 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); low = READ32(ea + 0); high = READ32(ea + 4); } @@ -3521,7 +3521,7 @@ void i386_device::i386_retf32() // Opcode 0xcb void i386_device::i386_retf_i32() // Opcode 0xca { - UINT16 count = FETCH16(); + uint16_t count = FETCH16(); if(PROTECTED_MODE && !V8086_MODE) { @@ -3541,13 +3541,13 @@ void i386_device::i386_retf_i32() // Opcode 0xca void i386_device::i386_load_far_pointer32(int s) { - UINT8 modrm = FETCH(); - UINT16 selector; + uint8_t modrm = FETCH(); + uint16_t selector; if( modrm >= 0xc0 ) { report_invalid_modrm("load_far_pointer32", modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); STORE_REG32(modrm, READ32(ea + 0)); selector = READ16(ea + 4); i386_sreg_load(selector,s,nullptr); diff --git a/src/devices/cpu/i386/i386ops.hxx b/src/devices/cpu/i386/i386ops.hxx index 2f13445c8be..e27bb4a13bc 100644 --- a/src/devices/cpu/i386/i386ops.hxx +++ b/src/devices/cpu/i386/i386ops.hxx @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Ville Linde, Barry Rodewald, Carl, Philip Bennett -UINT8 i386_device::i386_shift_rotate8(UINT8 modrm, UINT32 value, UINT8 shift) +uint8_t i386_device::i386_shift_rotate8(uint8_t modrm, uint32_t value, uint8_t shift) { - UINT32 src = value & 0xff; - UINT8 dst = value; + uint32_t src = value & 0xff; + uint8_t dst = value; if( shift == 0 ) { CYCLES_RM(modrm, 3, 7); @@ -50,7 +50,7 @@ UINT8 i386_device::i386_shift_rotate8(UINT8 modrm, UINT32 value, UINT8 shift) CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); break; case 7: /* SAR rm8, 1 */ - dst = (INT8)(src) >> 1; + dst = (int8_t)(src) >> 1; m_CF = src & 0x1; m_OF = 0; SetSZPF8(dst); @@ -72,8 +72,8 @@ UINT8 i386_device::i386_shift_rotate8(UINT8 modrm, UINT32 value, UINT8 shift) break; } shift &= 7; - dst = ((src & ((UINT8)0xff >> shift)) << shift) | - ((src & ((UINT8)0xff << (8-shift))) >> (8-shift)); + dst = ((src & ((uint8_t)0xff >> shift)) << shift) | + ((src & ((uint8_t)0xff << (8-shift))) >> (8-shift)); m_CF = dst & 0x1; m_OF = (dst & 1) ^ (dst >> 7); CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); @@ -89,16 +89,16 @@ UINT8 i386_device::i386_shift_rotate8(UINT8 modrm, UINT32 value, UINT8 shift) break; } shift &= 7; - dst = ((src & ((UINT8)0xff << shift)) >> shift) | - ((src & ((UINT8)0xff >> (8-shift))) << (8-shift)); + dst = ((src & ((uint8_t)0xff << shift)) >> shift) | + ((src & ((uint8_t)0xff >> (8-shift))) << (8-shift)); m_CF = (dst >> 7) & 1; m_OF = ((dst >> 7) ^ (dst >> 6)) & 1; CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); break; case 2: /* RCL rm8, i8 */ shift %= 9; - dst = ((src & ((UINT8)0xff >> shift)) << shift) | - ((src & ((UINT8)0xff << (9-shift))) >> (9-shift)) | + dst = ((src & ((uint8_t)0xff >> shift)) << shift) | + ((src & ((uint8_t)0xff << (9-shift))) >> (9-shift)) | (m_CF << (shift-1)); if(shift) m_CF = (src >> (8-shift)) & 0x1; m_OF = m_CF ^ ((dst >> 7) & 1); @@ -106,8 +106,8 @@ UINT8 i386_device::i386_shift_rotate8(UINT8 modrm, UINT32 value, UINT8 shift) break; case 3: /* RCR rm8, i8 */ shift %= 9; - dst = ((src & ((UINT8)0xff << shift)) >> shift) | - ((src & ((UINT8)0xff >> (8-shift))) << (9-shift)) | + dst = ((src & ((uint8_t)0xff << shift)) >> shift) | + ((src & ((uint8_t)0xff >> (8-shift))) << (9-shift)) | (m_CF << (8-shift)); if(shift) m_CF = (src >> (shift-1)) & 0x1; m_OF = ((dst >> 7) ^ (dst >> 6)) & 1; @@ -130,7 +130,7 @@ UINT8 i386_device::i386_shift_rotate8(UINT8 modrm, UINT32 value, UINT8 shift) break; case 7: /* SAR rm8, i8 */ shift &= 31; - dst = (INT8)src >> shift; + dst = (int8_t)src >> shift; m_CF = (src & (1 << (shift-1))) ? 1 : 0; SetSZPF8(dst); CYCLES_RM(modrm, CYCLES_ROTATE_REG, CYCLES_ROTATE_MEM); @@ -145,8 +145,8 @@ UINT8 i386_device::i386_shift_rotate8(UINT8 modrm, UINT32 value, UINT8 shift) void i386_device::i386_adc_rm8_r8() // Opcode 0x10 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); dst = LOAD_RM8(modrm); @@ -154,7 +154,7 @@ void i386_device::i386_adc_rm8_r8() // Opcode 0x10 STORE_RM8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG8(modrm); dst = READ8(ea); dst = ADC8(dst, src, m_CF); @@ -165,8 +165,8 @@ void i386_device::i386_adc_rm8_r8() // Opcode 0x10 void i386_device::i386_adc_r8_rm8() // Opcode 0x12 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); dst = LOAD_REG8(modrm); @@ -174,7 +174,7 @@ void i386_device::i386_adc_r8_rm8() // Opcode 0x12 STORE_REG8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); dst = LOAD_REG8(modrm); dst = ADC8(dst, src, m_CF); @@ -185,7 +185,7 @@ void i386_device::i386_adc_r8_rm8() // Opcode 0x12 void i386_device::i386_adc_al_i8() // Opcode 0x14 { - UINT8 src, dst; + uint8_t src, dst; src = FETCH(); dst = REG8(AL); dst = ADC8(dst, src, m_CF); @@ -195,8 +195,8 @@ void i386_device::i386_adc_al_i8() // Opcode 0x14 void i386_device::i386_add_rm8_r8() // Opcode 0x00 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); dst = LOAD_RM8(modrm); @@ -204,7 +204,7 @@ void i386_device::i386_add_rm8_r8() // Opcode 0x00 STORE_RM8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG8(modrm); dst = READ8(ea); dst = ADD8(dst, src); @@ -215,8 +215,8 @@ void i386_device::i386_add_rm8_r8() // Opcode 0x00 void i386_device::i386_add_r8_rm8() // Opcode 0x02 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); dst = LOAD_REG8(modrm); @@ -224,7 +224,7 @@ void i386_device::i386_add_r8_rm8() // Opcode 0x02 STORE_REG8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); dst = LOAD_REG8(modrm); dst = ADD8(dst, src); @@ -235,7 +235,7 @@ void i386_device::i386_add_r8_rm8() // Opcode 0x02 void i386_device::i386_add_al_i8() // Opcode 0x04 { - UINT8 src, dst; + uint8_t src, dst; src = FETCH(); dst = REG8(AL); dst = ADD8(dst, src); @@ -245,8 +245,8 @@ void i386_device::i386_add_al_i8() // Opcode 0x04 void i386_device::i386_and_rm8_r8() // Opcode 0x20 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); dst = LOAD_RM8(modrm); @@ -254,7 +254,7 @@ void i386_device::i386_and_rm8_r8() // Opcode 0x20 STORE_RM8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG8(modrm); dst = READ8(ea); dst = AND8(dst, src); @@ -265,8 +265,8 @@ void i386_device::i386_and_rm8_r8() // Opcode 0x20 void i386_device::i386_and_r8_rm8() // Opcode 0x22 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); dst = LOAD_REG8(modrm); @@ -274,7 +274,7 @@ void i386_device::i386_and_r8_rm8() // Opcode 0x22 STORE_REG8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); dst = LOAD_REG8(modrm); dst = AND8(dst, src); @@ -285,7 +285,7 @@ void i386_device::i386_and_r8_rm8() // Opcode 0x22 void i386_device::i386_and_al_i8() // Opcode 0x24 { - UINT8 src, dst; + uint8_t src, dst; src = FETCH(); dst = REG8(AL); dst = AND8(dst, src); @@ -309,7 +309,7 @@ void i386_device::i386_cli() // Opcode 0xfa { if(PROTECTED_MODE) { - UINT8 IOPL = m_IOP1 | (m_IOP2 << 1); + uint8_t IOPL = m_IOP1 | (m_IOP2 << 1); if(m_CPL > IOPL) FAULT(FAULT_GP,0); } @@ -325,15 +325,15 @@ void i386_device::i386_cmc() // Opcode 0xf5 void i386_device::i386_cmp_rm8_r8() // Opcode 0x38 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); dst = LOAD_RM8(modrm); SUB8(dst, src); CYCLES(CYCLES_CMP_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = LOAD_REG8(modrm); dst = READ8(ea); SUB8(dst, src); @@ -343,15 +343,15 @@ void i386_device::i386_cmp_rm8_r8() // Opcode 0x38 void i386_device::i386_cmp_r8_rm8() // Opcode 0x3a { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); dst = LOAD_REG8(modrm); SUB8(dst, src); CYCLES(CYCLES_CMP_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); dst = LOAD_REG8(modrm); SUB8(dst, src); @@ -361,7 +361,7 @@ void i386_device::i386_cmp_r8_rm8() // Opcode 0x3a void i386_device::i386_cmp_al_i8() // Opcode 0x3c { - UINT8 src, dst; + uint8_t src, dst; src = FETCH(); dst = REG8(AL); SUB8(dst, src); @@ -370,8 +370,8 @@ void i386_device::i386_cmp_al_i8() // Opcode 0x3c void i386_device::i386_cmpsb() // Opcode 0xa6 { - UINT32 eas, ead; - UINT8 src, dst; + uint32_t eas, ead; + uint8_t src, dst; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); } else { @@ -388,23 +388,23 @@ void i386_device::i386_cmpsb() // Opcode 0xa6 void i386_device::i386_in_al_i8() // Opcode 0xe4 { - UINT16 port = FETCH(); - UINT8 data = READPORT8(port); + uint16_t port = FETCH(); + uint8_t data = READPORT8(port); REG8(AL) = data; CYCLES(CYCLES_IN_VAR); } void i386_device::i386_in_al_dx() // Opcode 0xec { - UINT16 port = REG16(DX); - UINT8 data = READPORT8(port); + uint16_t port = REG16(DX); + uint8_t data = READPORT8(port); REG8(AL) = data; CYCLES(CYCLES_IN); } void i386_device::i386_ja_rel8() // Opcode 0x77 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_CF == 0 && m_ZF == 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -415,7 +415,7 @@ void i386_device::i386_ja_rel8() // Opcode 0x77 void i386_device::i386_jbe_rel8() // Opcode 0x76 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_CF != 0 || m_ZF != 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -426,7 +426,7 @@ void i386_device::i386_jbe_rel8() // Opcode 0x76 void i386_device::i386_jc_rel8() // Opcode 0x72 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_CF != 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -437,7 +437,7 @@ void i386_device::i386_jc_rel8() // Opcode 0x72 void i386_device::i386_jg_rel8() // Opcode 0x7f { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_ZF == 0 && (m_SF == m_OF) ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -448,7 +448,7 @@ void i386_device::i386_jg_rel8() // Opcode 0x7f void i386_device::i386_jge_rel8() // Opcode 0x7d { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if(m_SF == m_OF) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -459,7 +459,7 @@ void i386_device::i386_jge_rel8() // Opcode 0x7d void i386_device::i386_jl_rel8() // Opcode 0x7c { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( (m_SF != m_OF) ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -470,7 +470,7 @@ void i386_device::i386_jl_rel8() // Opcode 0x7c void i386_device::i386_jle_rel8() // Opcode 0x7e { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_ZF != 0 || (m_SF != m_OF) ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -481,7 +481,7 @@ void i386_device::i386_jle_rel8() // Opcode 0x7e void i386_device::i386_jnc_rel8() // Opcode 0x73 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_CF == 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -492,7 +492,7 @@ void i386_device::i386_jnc_rel8() // Opcode 0x73 void i386_device::i386_jno_rel8() // Opcode 0x71 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_OF == 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -503,7 +503,7 @@ void i386_device::i386_jno_rel8() // Opcode 0x71 void i386_device::i386_jnp_rel8() // Opcode 0x7b { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_PF == 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -514,7 +514,7 @@ void i386_device::i386_jnp_rel8() // Opcode 0x7b void i386_device::i386_jns_rel8() // Opcode 0x79 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_SF == 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -525,7 +525,7 @@ void i386_device::i386_jns_rel8() // Opcode 0x79 void i386_device::i386_jnz_rel8() // Opcode 0x75 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_ZF == 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -536,7 +536,7 @@ void i386_device::i386_jnz_rel8() // Opcode 0x75 void i386_device::i386_jo_rel8() // Opcode 0x70 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_OF != 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -547,7 +547,7 @@ void i386_device::i386_jo_rel8() // Opcode 0x70 void i386_device::i386_jp_rel8() // Opcode 0x7a { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_PF != 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -558,7 +558,7 @@ void i386_device::i386_jp_rel8() // Opcode 0x7a void i386_device::i386_js_rel8() // Opcode 0x78 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_SF != 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -569,7 +569,7 @@ void i386_device::i386_js_rel8() // Opcode 0x78 void i386_device::i386_jz_rel8() // Opcode 0x74 { - INT8 disp = FETCH(); + int8_t disp = FETCH(); if( m_ZF != 0 ) { NEAR_BRANCH(disp); CYCLES(CYCLES_JCC_DISP8); /* TODO: Timing = 7 + m */ @@ -580,7 +580,7 @@ void i386_device::i386_jz_rel8() // Opcode 0x74 void i386_device::i386_jmp_rel8() // Opcode 0xeb { - INT8 disp = FETCH(); + int8_t disp = FETCH(); NEAR_BRANCH(disp); CYCLES(CYCLES_JMP_SHORT); /* TODO: Timing = 7 + m */ } @@ -593,7 +593,7 @@ void i386_device::i386_lahf() // Opcode 0x9f void i386_device::i386_lodsb() // Opcode 0xac { - UINT32 eas; + uint32_t eas; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); } else { @@ -606,14 +606,14 @@ void i386_device::i386_lodsb() // Opcode 0xac void i386_device::i386_mov_rm8_r8() // Opcode 0x88 { - UINT8 src; - UINT8 modrm = FETCH(); + uint8_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); STORE_RM8(modrm, src); CYCLES(CYCLES_MOV_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG8(modrm); WRITE8(ea, src); CYCLES(CYCLES_MOV_REG_MEM); @@ -622,14 +622,14 @@ void i386_device::i386_mov_rm8_r8() // Opcode 0x88 void i386_device::i386_mov_r8_rm8() // Opcode 0x8a { - UINT8 src; - UINT8 modrm = FETCH(); + uint8_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); STORE_REG8(modrm, src); CYCLES(CYCLES_MOV_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); STORE_REG8(modrm, src); CYCLES(CYCLES_MOV_MEM_REG); @@ -638,14 +638,14 @@ void i386_device::i386_mov_r8_rm8() // Opcode 0x8a void i386_device::i386_mov_rm8_i8() // Opcode 0xc6 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT8 value = FETCH(); + uint8_t value = FETCH(); STORE_RM8(modrm, value); CYCLES(CYCLES_MOV_IMM_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT8 value = FETCH(); + uint32_t ea = GetEA(modrm,1); + uint8_t value = FETCH(); WRITE8(ea, value); CYCLES(CYCLES_MOV_IMM_MEM); } @@ -655,8 +655,8 @@ void i386_device::i386_mov_r32_cr() // Opcode 0x0f 20 { if(PROTECTED_MODE && m_CPL) FAULT(FAULT_GP, 0); - UINT8 modrm = FETCH(); - UINT8 cr = (modrm >> 3) & 0x7; + uint8_t modrm = FETCH(); + uint8_t cr = (modrm >> 3) & 0x7; STORE_RM32(modrm, m_cr[cr]); CYCLES(CYCLES_MOV_CR_REG); @@ -666,8 +666,8 @@ void i386_device::i386_mov_r32_dr() // Opcode 0x0f 21 { if(PROTECTED_MODE && m_CPL) FAULT(FAULT_GP, 0); - UINT8 modrm = FETCH(); - UINT8 dr = (modrm >> 3) & 0x7; + uint8_t modrm = FETCH(); + uint8_t dr = (modrm >> 3) & 0x7; STORE_RM32(modrm, m_dr[dr]); switch(dr) @@ -689,9 +689,9 @@ void i386_device::i386_mov_cr_r32() // Opcode 0x0f 22 { if(PROTECTED_MODE && m_CPL) FAULT(FAULT_GP, 0); - UINT8 modrm = FETCH(); - UINT8 cr = (modrm >> 3) & 0x7; - UINT32 data = LOAD_RM32(modrm); + uint8_t modrm = FETCH(); + uint8_t cr = (modrm >> 3) & 0x7; + uint32_t data = LOAD_RM32(modrm); switch(cr) { case 0: @@ -715,8 +715,8 @@ void i386_device::i386_mov_dr_r32() // Opcode 0x0f 23 { if(PROTECTED_MODE && m_CPL) FAULT(FAULT_GP, 0); - UINT8 modrm = FETCH(); - UINT8 dr = (modrm >> 3) & 0x7; + uint8_t modrm = FETCH(); + uint8_t dr = (modrm >> 3) & 0x7; m_dr[dr] = LOAD_RM32(modrm); switch(dr) @@ -739,7 +739,7 @@ void i386_device::i386_mov_dr_r32() // Opcode 0x0f 23 void i386_device::i386_mov_al_m8() // Opcode 0xa0 { - UINT32 offset, ea; + uint32_t offset, ea; if( m_address_size ) { offset = FETCH32(); } else { @@ -757,7 +757,7 @@ void i386_device::i386_mov_al_m8() // Opcode 0xa0 void i386_device::i386_mov_m8_al() // Opcode 0xa2 { - UINT32 offset, ea; + uint32_t offset, ea; if( m_address_size ) { offset = FETCH32(); } else { @@ -775,7 +775,7 @@ void i386_device::i386_mov_m8_al() // Opcode 0xa2 void i386_device::i386_mov_rm16_sreg() // Opcode 0x8c { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); int s = (modrm >> 3) & 0x7; if( modrm >= 0xc0 ) { @@ -785,7 +785,7 @@ void i386_device::i386_mov_rm16_sreg() // Opcode 0x8c STORE_RM16(modrm, m_sreg[s].selector); CYCLES(CYCLES_MOV_SREG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE16(ea, m_sreg[s].selector); CYCLES(CYCLES_MOV_SREG_MEM); } @@ -793,8 +793,8 @@ void i386_device::i386_mov_rm16_sreg() // Opcode 0x8c void i386_device::i386_mov_sreg_rm16() // Opcode 0x8e { - UINT16 selector; - UINT8 modrm = FETCH(); + uint16_t selector; + uint8_t modrm = FETCH(); bool fault; int s = (modrm >> 3) & 0x7; @@ -802,7 +802,7 @@ void i386_device::i386_mov_sreg_rm16() // Opcode 0x8e selector = LOAD_RM16(modrm); CYCLES(CYCLES_MOV_REG_SREG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); selector = READ16(ea); CYCLES(CYCLES_MOV_MEM_SREG); } @@ -868,8 +868,8 @@ void i386_device::i386_mov_bh_i8() // Opcode 0xb7 void i386_device::i386_movsb() // Opcode 0xa4 { - UINT32 eas, ead; - UINT8 v; + uint32_t eas, ead; + uint8_t v; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); } else { @@ -885,8 +885,8 @@ void i386_device::i386_movsb() // Opcode 0xa4 void i386_device::i386_or_rm8_r8() // Opcode 0x08 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); dst = LOAD_RM8(modrm); @@ -894,7 +894,7 @@ void i386_device::i386_or_rm8_r8() // Opcode 0x08 STORE_RM8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG8(modrm); dst = READ8(ea); dst = OR8(dst, src); @@ -905,8 +905,8 @@ void i386_device::i386_or_rm8_r8() // Opcode 0x08 void i386_device::i386_or_r8_rm8() // Opcode 0x0a { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); dst = LOAD_REG8(modrm); @@ -914,7 +914,7 @@ void i386_device::i386_or_r8_rm8() // Opcode 0x0a STORE_REG8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); dst = LOAD_REG8(modrm); dst = OR8(dst, src); @@ -925,7 +925,7 @@ void i386_device::i386_or_r8_rm8() // Opcode 0x0a void i386_device::i386_or_al_i8() // Opcode 0x0c { - UINT8 src, dst; + uint8_t src, dst; src = FETCH(); dst = REG8(AL); dst = OR8(dst, src); @@ -935,16 +935,16 @@ void i386_device::i386_or_al_i8() // Opcode 0x0c void i386_device::i386_out_al_i8() // Opcode 0xe6 { - UINT16 port = FETCH(); - UINT8 data = REG8(AL); + uint16_t port = FETCH(); + uint8_t data = REG8(AL); WRITEPORT8(port, data); CYCLES(CYCLES_OUT_VAR); } void i386_device::i386_out_al_dx() // Opcode 0xee { - UINT16 port = REG16(DX); - UINT8 data = REG8(AL); + uint16_t port = REG16(DX); + uint8_t data = REG8(AL); WRITEPORT8(port, data); CYCLES(CYCLES_OUT); } @@ -952,9 +952,9 @@ void i386_device::i386_out_al_dx() // Opcode 0xee void i386_device::i386_arpl() // Opcode 0x63 { - UINT16 src, dst; - UINT8 modrm = FETCH(); - UINT8 flag = 0; + uint16_t src, dst; + uint8_t modrm = FETCH(); + uint8_t flag = 0; if(PROTECTED_MODE && !V8086_MODE) { @@ -967,7 +967,7 @@ void i386_device::i386_arpl() // Opcode 0x63 STORE_RM16(modrm, dst); } } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG16(modrm); dst = READ16(ea); if( (dst&0x3) < (src&0x3) ) { @@ -984,17 +984,17 @@ void i386_device::i386_arpl() // Opcode 0x63 void i386_device::i386_push_i8() // Opcode 0x6a { - UINT8 value = FETCH(); + uint8_t value = FETCH(); PUSH8(value); CYCLES(CYCLES_PUSH_IMM); } void i386_device::i386_ins_generic(int size) { - UINT32 ead; - UINT8 vb; - UINT16 vw; - UINT32 vd; + uint32_t ead; + uint8_t vb; + uint16_t vw; + uint32_t vd; ead = i386_translate(ES, m_address_size ? REG32(EDI) : REG16(DI), 1 ); @@ -1037,10 +1037,10 @@ void i386_device::i386_insd() // Opcode 0x6d void i386_device::i386_outs_generic(int size) { - UINT32 eas; - UINT8 vb; - UINT16 vw; - UINT32 vd; + uint32_t eas; + uint8_t vb; + uint16_t vw; + uint32_t vd; if( m_segment_prefix ) { eas = i386_translate(m_segment_override, m_address_size ? REG32(ESI) : REG16(SI), 0 ); @@ -1087,14 +1087,14 @@ void i386_device::i386_outsd() // Opcode 0x6f void i386_device::i386_repeat(int invert_flag) { - UINT32 repeated_eip = m_eip; - UINT32 repeated_pc = m_pc; - UINT8 opcode; // = FETCH(); -// UINT32 eas, ead; - UINT32 count; - INT32 cycle_base = 0, cycle_adjustment = 0; - UINT8 prefix_flag=1; - UINT8 *flag = nullptr; + uint32_t repeated_eip = m_eip; + uint32_t repeated_pc = m_pc; + uint8_t opcode; // = FETCH(); +// uint32_t eas, ead; + uint32_t count; + int32_t cycle_base = 0, cycle_adjustment = 0; + uint8_t prefix_flag=1; + uint8_t *flag = nullptr; do { @@ -1246,7 +1246,7 @@ void i386_device::i386_repeat(int invert_flag) { i386_decode_opcode(); } - catch (UINT64 e) + catch (uint64_t e) { m_eip = m_prev_eip; throw e; @@ -1293,8 +1293,8 @@ void i386_device::i386_sahf() // Opcode 0x9e void i386_device::i386_sbb_rm8_r8() // Opcode 0x18 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); dst = LOAD_RM8(modrm); @@ -1302,7 +1302,7 @@ void i386_device::i386_sbb_rm8_r8() // Opcode 0x18 STORE_RM8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG8(modrm); dst = READ8(ea); dst = SBB8(dst, src, m_CF); @@ -1313,8 +1313,8 @@ void i386_device::i386_sbb_rm8_r8() // Opcode 0x18 void i386_device::i386_sbb_r8_rm8() // Opcode 0x1a { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); dst = LOAD_REG8(modrm); @@ -1322,7 +1322,7 @@ void i386_device::i386_sbb_r8_rm8() // Opcode 0x1a STORE_REG8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); dst = LOAD_REG8(modrm); dst = SBB8(dst, src, m_CF); @@ -1333,7 +1333,7 @@ void i386_device::i386_sbb_r8_rm8() // Opcode 0x1a void i386_device::i386_sbb_al_i8() // Opcode 0x1c { - UINT8 src, dst; + uint8_t src, dst; src = FETCH(); dst = REG8(AL); dst = SBB8(dst, src, m_CF); @@ -1343,8 +1343,8 @@ void i386_device::i386_sbb_al_i8() // Opcode 0x1c void i386_device::i386_scasb() // Opcode 0xae { - UINT32 eas; - UINT8 src, dst; + uint32_t eas; + uint8_t src, dst; eas = i386_translate(ES, m_address_size ? REG32(EDI) : REG16(DI), 0 ); src = READ8(eas); dst = REG8(AL); @@ -1365,8 +1365,8 @@ void i386_device::i386_setalc() // Opcode 0xd6 (undocumented) void i386_device::i386_seta_rm8() // Opcode 0x0f 97 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_CF == 0 && m_ZF == 0 ) { value = 1; } @@ -1374,7 +1374,7 @@ void i386_device::i386_seta_rm8() // Opcode 0x0f 97 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1382,8 +1382,8 @@ void i386_device::i386_seta_rm8() // Opcode 0x0f 97 void i386_device::i386_setbe_rm8() // Opcode 0x0f 96 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_CF != 0 || m_ZF != 0 ) { value = 1; } @@ -1391,7 +1391,7 @@ void i386_device::i386_setbe_rm8() // Opcode 0x0f 96 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1399,8 +1399,8 @@ void i386_device::i386_setbe_rm8() // Opcode 0x0f 96 void i386_device::i386_setc_rm8() // Opcode 0x0f 92 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_CF != 0 ) { value = 1; } @@ -1408,7 +1408,7 @@ void i386_device::i386_setc_rm8() // Opcode 0x0f 92 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1416,8 +1416,8 @@ void i386_device::i386_setc_rm8() // Opcode 0x0f 92 void i386_device::i386_setg_rm8() // Opcode 0x0f 9f { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_ZF == 0 && (m_SF == m_OF) ) { value = 1; } @@ -1425,7 +1425,7 @@ void i386_device::i386_setg_rm8() // Opcode 0x0f 9f STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1433,8 +1433,8 @@ void i386_device::i386_setg_rm8() // Opcode 0x0f 9f void i386_device::i386_setge_rm8() // Opcode 0x0f 9d { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if(m_SF == m_OF) { value = 1; } @@ -1442,7 +1442,7 @@ void i386_device::i386_setge_rm8() // Opcode 0x0f 9d STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1450,8 +1450,8 @@ void i386_device::i386_setge_rm8() // Opcode 0x0f 9d void i386_device::i386_setl_rm8() // Opcode 0x0f 9c { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_SF != m_OF ) { value = 1; } @@ -1459,7 +1459,7 @@ void i386_device::i386_setl_rm8() // Opcode 0x0f 9c STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1467,8 +1467,8 @@ void i386_device::i386_setl_rm8() // Opcode 0x0f 9c void i386_device::i386_setle_rm8() // Opcode 0x0f 9e { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_ZF != 0 || (m_SF != m_OF) ) { value = 1; } @@ -1476,7 +1476,7 @@ void i386_device::i386_setle_rm8() // Opcode 0x0f 9e STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1484,8 +1484,8 @@ void i386_device::i386_setle_rm8() // Opcode 0x0f 9e void i386_device::i386_setnc_rm8() // Opcode 0x0f 93 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_CF == 0 ) { value = 1; } @@ -1493,7 +1493,7 @@ void i386_device::i386_setnc_rm8() // Opcode 0x0f 93 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1501,8 +1501,8 @@ void i386_device::i386_setnc_rm8() // Opcode 0x0f 93 void i386_device::i386_setno_rm8() // Opcode 0x0f 91 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_OF == 0 ) { value = 1; } @@ -1510,7 +1510,7 @@ void i386_device::i386_setno_rm8() // Opcode 0x0f 91 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1518,8 +1518,8 @@ void i386_device::i386_setno_rm8() // Opcode 0x0f 91 void i386_device::i386_setnp_rm8() // Opcode 0x0f 9b { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_PF == 0 ) { value = 1; } @@ -1527,7 +1527,7 @@ void i386_device::i386_setnp_rm8() // Opcode 0x0f 9b STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1535,8 +1535,8 @@ void i386_device::i386_setnp_rm8() // Opcode 0x0f 9b void i386_device::i386_setns_rm8() // Opcode 0x0f 99 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_SF == 0 ) { value = 1; } @@ -1544,7 +1544,7 @@ void i386_device::i386_setns_rm8() // Opcode 0x0f 99 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1552,8 +1552,8 @@ void i386_device::i386_setns_rm8() // Opcode 0x0f 99 void i386_device::i386_setnz_rm8() // Opcode 0x0f 95 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_ZF == 0 ) { value = 1; } @@ -1561,7 +1561,7 @@ void i386_device::i386_setnz_rm8() // Opcode 0x0f 95 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1569,8 +1569,8 @@ void i386_device::i386_setnz_rm8() // Opcode 0x0f 95 void i386_device::i386_seto_rm8() // Opcode 0x0f 90 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_OF != 0 ) { value = 1; } @@ -1578,7 +1578,7 @@ void i386_device::i386_seto_rm8() // Opcode 0x0f 90 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1586,8 +1586,8 @@ void i386_device::i386_seto_rm8() // Opcode 0x0f 90 void i386_device::i386_setp_rm8() // Opcode 0x0f 9a { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_PF != 0 ) { value = 1; } @@ -1595,7 +1595,7 @@ void i386_device::i386_setp_rm8() // Opcode 0x0f 9a STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1603,8 +1603,8 @@ void i386_device::i386_setp_rm8() // Opcode 0x0f 9a void i386_device::i386_sets_rm8() // Opcode 0x0f 98 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_SF != 0 ) { value = 1; } @@ -1612,7 +1612,7 @@ void i386_device::i386_sets_rm8() // Opcode 0x0f 98 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1620,8 +1620,8 @@ void i386_device::i386_sets_rm8() // Opcode 0x0f 98 void i386_device::i386_setz_rm8() // Opcode 0x0f 94 { - UINT8 modrm = FETCH(); - UINT8 value = 0; + uint8_t modrm = FETCH(); + uint8_t value = 0; if( m_ZF != 0 ) { value = 1; } @@ -1629,7 +1629,7 @@ void i386_device::i386_setz_rm8() // Opcode 0x0f 94 STORE_RM8(modrm, value); CYCLES(CYCLES_SETCC_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); WRITE8(ea, value); CYCLES(CYCLES_SETCC_MEM); } @@ -1651,7 +1651,7 @@ void i386_device::i386_sti() // Opcode 0xfb { if(PROTECTED_MODE) { - UINT8 IOPL = m_IOP1 | (m_IOP2 << 1); + uint8_t IOPL = m_IOP1 | (m_IOP2 << 1); if(m_CPL > IOPL) FAULT(FAULT_GP,0); } @@ -1661,7 +1661,7 @@ void i386_device::i386_sti() // Opcode 0xfb void i386_device::i386_stosb() // Opcode 0xaa { - UINT32 ead; + uint32_t ead; ead = i386_translate(ES, m_address_size ? REG32(EDI) : REG16(DI), 1 ); WRITE8(ead, REG8(AL)); BUMP_DI(1); @@ -1670,8 +1670,8 @@ void i386_device::i386_stosb() // Opcode 0xaa void i386_device::i386_sub_rm8_r8() // Opcode 0x28 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); dst = LOAD_RM8(modrm); @@ -1679,7 +1679,7 @@ void i386_device::i386_sub_rm8_r8() // Opcode 0x28 STORE_RM8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG8(modrm); dst = READ8(ea); dst = SUB8(dst, src); @@ -1690,8 +1690,8 @@ void i386_device::i386_sub_rm8_r8() // Opcode 0x28 void i386_device::i386_sub_r8_rm8() // Opcode 0x2a { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); dst = LOAD_REG8(modrm); @@ -1699,7 +1699,7 @@ void i386_device::i386_sub_r8_rm8() // Opcode 0x2a STORE_REG8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); dst = LOAD_REG8(modrm); dst = SUB8(dst, src); @@ -1710,7 +1710,7 @@ void i386_device::i386_sub_r8_rm8() // Opcode 0x2a void i386_device::i386_sub_al_i8() // Opcode 0x2c { - UINT8 src, dst; + uint8_t src, dst; src = FETCH(); dst = REG8(EAX); dst = SUB8(dst, src); @@ -1720,8 +1720,8 @@ void i386_device::i386_sub_al_i8() // Opcode 0x2c void i386_device::i386_test_al_i8() // Opcode 0xa8 { - UINT8 src = FETCH(); - UINT8 dst = REG8(AL); + uint8_t src = FETCH(); + uint8_t dst = REG8(AL); dst = src & dst; SetSZPF8(dst); m_CF = 0; @@ -1731,8 +1731,8 @@ void i386_device::i386_test_al_i8() // Opcode 0xa8 void i386_device::i386_test_rm8_r8() // Opcode 0x84 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); dst = LOAD_RM8(modrm); @@ -1742,7 +1742,7 @@ void i386_device::i386_test_rm8_r8() // Opcode 0x84 m_OF = 0; CYCLES(CYCLES_TEST_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = LOAD_REG8(modrm); dst = READ8(ea); dst = src & dst; @@ -1755,17 +1755,17 @@ void i386_device::i386_test_rm8_r8() // Opcode 0x84 void i386_device::i386_xchg_r8_rm8() // Opcode 0x86 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT8 src = LOAD_RM8(modrm); - UINT8 dst = LOAD_REG8(modrm); + uint8_t src = LOAD_RM8(modrm); + uint8_t dst = LOAD_REG8(modrm); STORE_REG8(modrm, src); STORE_RM8(modrm, dst); CYCLES(CYCLES_XCHG_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT8 src = READ8(ea); - UINT8 dst = LOAD_REG8(modrm); + uint32_t ea = GetEA(modrm,1); + uint8_t src = READ8(ea); + uint8_t dst = LOAD_REG8(modrm); WRITE8(ea, dst); STORE_REG8(modrm, src); CYCLES(CYCLES_XCHG_REG_MEM); @@ -1774,8 +1774,8 @@ void i386_device::i386_xchg_r8_rm8() // Opcode 0x86 void i386_device::i386_xor_rm8_r8() // Opcode 0x30 { - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint8_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_REG8(modrm); dst = LOAD_RM8(modrm); @@ -1783,7 +1783,7 @@ void i386_device::i386_xor_rm8_r8() // Opcode 0x30 STORE_RM8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); src = LOAD_REG8(modrm); dst = READ8(ea); dst = XOR8(dst, src); @@ -1794,8 +1794,8 @@ void i386_device::i386_xor_rm8_r8() // Opcode 0x30 void i386_device::i386_xor_r8_rm8() // Opcode 0x32 { - UINT32 src, dst; - UINT8 modrm = FETCH(); + uint32_t src, dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); dst = LOAD_REG8(modrm); @@ -1803,7 +1803,7 @@ void i386_device::i386_xor_r8_rm8() // Opcode 0x32 STORE_REG8(modrm, dst); CYCLES(CYCLES_ALU_REG_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); dst = LOAD_REG8(modrm); dst = XOR8(dst, src); @@ -1814,7 +1814,7 @@ void i386_device::i386_xor_r8_rm8() // Opcode 0x32 void i386_device::i386_xor_al_i8() // Opcode 0x34 { - UINT8 src, dst; + uint8_t src, dst; src = FETCH(); dst = REG8(AL); dst = XOR8(dst, src); @@ -1826,9 +1826,9 @@ void i386_device::i386_xor_al_i8() // Opcode 0x34 void i386_device::i386_group80_8() // Opcode 0x80 { - UINT32 ea; - UINT8 src, dst; - UINT8 modrm = FETCH(); + uint32_t ea; + uint8_t src, dst; + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { @@ -1963,9 +1963,9 @@ void i386_device::i386_group80_8() // Opcode 0x80 void i386_device::i386_groupC0_8() // Opcode 0xc0 { - UINT8 dst; - UINT8 modrm = FETCH(); - UINT8 shift; + uint8_t dst; + uint8_t modrm = FETCH(); + uint8_t shift; if( modrm >= 0xc0 ) { dst = LOAD_RM8(modrm); @@ -1973,7 +1973,7 @@ void i386_device::i386_groupC0_8() // Opcode 0xc0 dst = i386_shift_rotate8(modrm, dst, shift); STORE_RM8(modrm, dst); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); dst = READ8(ea); shift = FETCH() & 0x1f; dst = i386_shift_rotate8(modrm, dst, shift); @@ -1983,15 +1983,15 @@ void i386_device::i386_groupC0_8() // Opcode 0xc0 void i386_device::i386_groupD0_8() // Opcode 0xd0 { - UINT8 dst; - UINT8 modrm = FETCH(); + uint8_t dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { dst = LOAD_RM8(modrm); dst = i386_shift_rotate8(modrm, dst, 1); STORE_RM8(modrm, dst); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); dst = READ8(ea); dst = i386_shift_rotate8(modrm, dst, 1); WRITE8(ea, dst); @@ -2000,15 +2000,15 @@ void i386_device::i386_groupD0_8() // Opcode 0xd0 void i386_device::i386_groupD2_8() // Opcode 0xd2 { - UINT8 dst; - UINT8 modrm = FETCH(); + uint8_t dst; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { dst = LOAD_RM8(modrm); dst = i386_shift_rotate8(modrm, dst, REG8(CL)); STORE_RM8(modrm, dst); } else { - UINT32 ea = GetEA(modrm,1); + uint32_t ea = GetEA(modrm,1); dst = READ8(ea); dst = i386_shift_rotate8(modrm, dst, REG8(CL)); WRITE8(ea, dst); @@ -2017,22 +2017,22 @@ void i386_device::i386_groupD2_8() // Opcode 0xd2 void i386_device::i386_groupF6_8() // Opcode 0xf6 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 0: /* TEST Rm8, i8 */ if( modrm >= 0xc0 ) { - UINT8 dst = LOAD_RM8(modrm); - UINT8 src = FETCH(); + uint8_t dst = LOAD_RM8(modrm); + uint8_t src = FETCH(); dst &= src; m_CF = m_OF = m_AF = 0; SetSZPF8(dst); CYCLES(CYCLES_TEST_IMM_REG); } else { - UINT32 ea = GetEA(modrm,0); - UINT8 dst = READ8(ea); - UINT8 src = FETCH(); + uint32_t ea = GetEA(modrm,0); + uint8_t dst = READ8(ea); + uint8_t src = FETCH(); dst &= src; m_CF = m_OF = m_AF = 0; SetSZPF8(dst); @@ -2041,13 +2041,13 @@ void i386_device::i386_groupF6_8() // Opcode 0xf6 break; case 2: /* NOT Rm8 */ if( modrm >= 0xc0 ) { - UINT8 dst = LOAD_RM8(modrm); + uint8_t dst = LOAD_RM8(modrm); dst = ~dst; STORE_RM8(modrm, dst); CYCLES(CYCLES_NOT_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT8 dst = READ8(ea); + uint32_t ea = GetEA(modrm,1); + uint8_t dst = READ8(ea); dst = ~dst; WRITE8(ea, dst); CYCLES(CYCLES_NOT_MEM); @@ -2055,13 +2055,13 @@ void i386_device::i386_groupF6_8() // Opcode 0xf6 break; case 3: /* NEG Rm8 */ if( modrm >= 0xc0 ) { - UINT8 dst = LOAD_RM8(modrm); + uint8_t dst = LOAD_RM8(modrm); dst = SUB8(0, dst ); STORE_RM8(modrm, dst); CYCLES(CYCLES_NEG_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT8 dst = READ8(ea); + uint32_t ea = GetEA(modrm,1); + uint8_t dst = READ8(ea); dst = SUB8(0, dst ); WRITE8(ea, dst); CYCLES(CYCLES_NEG_MEM); @@ -2069,67 +2069,67 @@ void i386_device::i386_groupF6_8() // Opcode 0xf6 break; case 4: /* MUL AL, Rm8 */ { - UINT16 result; - UINT8 src, dst; + uint16_t result; + uint8_t src, dst; if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); CYCLES(CYCLES_MUL8_ACC_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); CYCLES(CYCLES_MUL8_ACC_MEM); /* TODO: Correct multiply timing */ } dst = REG8(AL); - result = (UINT16)src * (UINT16)dst; - REG16(AX) = (UINT16)result; + result = (uint16_t)src * (uint16_t)dst; + REG16(AX) = (uint16_t)result; m_CF = m_OF = (REG16(AX) > 0xff); } break; case 5: /* IMUL AL, Rm8 */ { - INT16 result; - INT16 src, dst; + int16_t result; + int16_t src, dst; if( modrm >= 0xc0 ) { - src = (INT16)(INT8)LOAD_RM8(modrm); + src = (int16_t)(int8_t)LOAD_RM8(modrm); CYCLES(CYCLES_IMUL8_ACC_REG); /* TODO: Correct multiply timing */ } else { - UINT32 ea = GetEA(modrm,0); - src = (INT16)(INT8)READ8(ea); + uint32_t ea = GetEA(modrm,0); + src = (int16_t)(int8_t)READ8(ea); CYCLES(CYCLES_IMUL8_ACC_MEM); /* TODO: Correct multiply timing */ } - dst = (INT16)(INT8)REG8(AL); + dst = (int16_t)(int8_t)REG8(AL); result = src * dst; - REG16(AX) = (UINT16)result; + REG16(AX) = (uint16_t)result; - m_CF = m_OF = !(result == (INT16)(INT8)result); + m_CF = m_OF = !(result == (int16_t)(int8_t)result); } break; case 6: /* DIV AL, Rm8 */ { - UINT16 quotient, remainder, result; - UINT8 src; + uint16_t quotient, remainder, result; + uint8_t src; if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); CYCLES(CYCLES_DIV8_ACC_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); CYCLES(CYCLES_DIV8_ACC_MEM); } - quotient = (UINT16)REG16(AX); + quotient = (uint16_t)REG16(AX); if( src ) { - remainder = quotient % (UINT16)src; - result = quotient / (UINT16)src; + remainder = quotient % (uint16_t)src; + result = quotient / (uint16_t)src; if( result > 0xff ) { /* TODO: Divide error */ } else { - REG8(AH) = (UINT8)remainder & 0xff; - REG8(AL) = (UINT8)result & 0xff; + REG8(AH) = (uint8_t)remainder & 0xff; + REG8(AL) = (uint8_t)result & 0xff; // this flag is actually undefined, enable on non-cyrix if (m_cpuid_id0 != 0x69727943) @@ -2142,26 +2142,26 @@ void i386_device::i386_groupF6_8() // Opcode 0xf6 break; case 7: /* IDIV AL, Rm8 */ { - INT16 quotient, remainder, result; - UINT8 src; + int16_t quotient, remainder, result; + uint8_t src; if( modrm >= 0xc0 ) { src = LOAD_RM8(modrm); CYCLES(CYCLES_IDIV8_ACC_REG); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ8(ea); CYCLES(CYCLES_IDIV8_ACC_MEM); } - quotient = (INT16)REG16(AX); + quotient = (int16_t)REG16(AX); if( src ) { - remainder = quotient % (INT16)(INT8)src; - result = quotient / (INT16)(INT8)src; + remainder = quotient % (int16_t)(int8_t)src; + result = quotient / (int16_t)(int8_t)src; if( result > 0xff ) { /* TODO: Divide error */ } else { - REG8(AH) = (UINT8)remainder & 0xff; - REG8(AL) = (UINT8)result & 0xff; + REG8(AH) = (uint8_t)remainder & 0xff; + REG8(AL) = (uint8_t)result & 0xff; // this flag is actually undefined, enable on non-cyrix if (m_cpuid_id0 != 0x69727943) @@ -2177,19 +2177,19 @@ void i386_device::i386_groupF6_8() // Opcode 0xf6 void i386_device::i386_groupFE_8() // Opcode 0xfe { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); switch( (modrm >> 3) & 0x7 ) { case 0: /* INC Rm8 */ if( modrm >= 0xc0 ) { - UINT8 dst = LOAD_RM8(modrm); + uint8_t dst = LOAD_RM8(modrm); dst = INC8(dst); STORE_RM8(modrm, dst); CYCLES(CYCLES_INC_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT8 dst = READ8(ea); + uint32_t ea = GetEA(modrm,1); + uint8_t dst = READ8(ea); dst = INC8(dst); WRITE8(ea, dst); CYCLES(CYCLES_INC_MEM); @@ -2197,13 +2197,13 @@ void i386_device::i386_groupFE_8() // Opcode 0xfe break; case 1: /* DEC Rm8 */ if( modrm >= 0xc0 ) { - UINT8 dst = LOAD_RM8(modrm); + uint8_t dst = LOAD_RM8(modrm); dst = DEC8(dst); STORE_RM8(modrm, dst); CYCLES(CYCLES_DEC_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT8 dst = READ8(ea); + uint32_t ea = GetEA(modrm,1); + uint8_t dst = READ8(ea); dst = DEC8(dst); WRITE8(ea, dst); CYCLES(CYCLES_DEC_MEM); @@ -2211,11 +2211,11 @@ void i386_device::i386_groupFE_8() // Opcode 0xfe break; case 6: /* PUSH Rm8*/ { - UINT8 value; + uint8_t value; if( modrm >= 0xc0 ) { value = LOAD_RM8(modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); value = READ8(ea); } if( m_operand_size ) { @@ -2348,10 +2348,10 @@ void i386_device::i386_into() // Opcode 0xce } } -static UINT32 i386_escape_ea; // hack around GCC 4.6 error because we need the side effects of GetEA() +static uint32_t i386_escape_ea; // hack around GCC 4.6 error because we need the side effects of GetEA() void i386_device::i386_escape() // Opcodes 0xd8 - 0xdf { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if(modrm < 0xc0) { i386_escape_ea = GetEA(modrm,0); @@ -2372,13 +2372,13 @@ void i386_device::i386_hlt() // Opcode 0xf4 void i386_device::i386_decimal_adjust(int direction) { - UINT8 tmpAL = REG8(AL); - UINT8 tmpCF = m_CF; + uint8_t tmpAL = REG8(AL); + uint8_t tmpCF = m_CF; if (m_AF || ((REG8(AL) & 0xf) > 9)) { - UINT16 t= (UINT16)REG8(AL) + (direction * 0x06); - REG8(AL) = (UINT8)t&0xff; + uint16_t t= (uint16_t)REG8(AL) + (direction * 0x06); + REG8(AL) = (uint8_t)t&0xff; m_AF = 1; if (t & 0x100) m_CF = 1; @@ -2442,9 +2442,9 @@ void i386_device::i386_aas() // Opcode 0x3f void i386_device::i386_aad() // Opcode 0xd5 { - UINT8 tempAL = REG8(AL); - UINT8 tempAH = REG8(AH); - UINT8 i = FETCH(); + uint8_t tempAL = REG8(AL); + uint8_t tempAH = REG8(AH); + uint8_t i = FETCH(); REG8(AL) = (tempAL + (tempAH * i)) & 0xff; REG8(AH) = 0; @@ -2454,8 +2454,8 @@ void i386_device::i386_aad() // Opcode 0xd5 void i386_device::i386_aam() // Opcode 0xd4 { - UINT8 tempAL = REG8(AL); - UINT8 i = FETCH(); + uint8_t tempAL = REG8(AL); + uint8_t i = FETCH(); if(!i) { @@ -2506,7 +2506,7 @@ void i386_device::i386_loadall() // Opcode 0x0f 0x07 (0x0f 0x05 on 80286), { if(PROTECTED_MODE && (m_CPL != 0)) FAULT(FAULT_GP,0) - UINT32 ea = i386_translate(ES, REG32(EDI), 0); + uint32_t ea = i386_translate(ES, REG32(EDI), 0); m_cr[0] = READ32(ea) & 0xfffeffff; // wp not supported on 386 set_flags(READ32(ea + 0x04)); m_eip = READ32(ea + 0x08); @@ -2574,7 +2574,7 @@ void i386_device::i386_invalid() void i386_device::i386_xlat() // Opcode 0xd7 { - UINT32 ea; + uint32_t ea; if( m_segment_prefix ) { if(!m_address_size) { diff --git a/src/devices/cpu/i386/i386priv.h b/src/devices/cpu/i386/i386priv.h index 3edf681744b..528dade6c72 100644 --- a/src/devices/cpu/i386/i386priv.h +++ b/src/devices/cpu/i386/i386priv.h @@ -15,7 +15,7 @@ #define MMXOP(XX) mmx_##XX #define SSEOP(XX) sse_##XX -extern int i386_dasm_one(char *buffer, UINT32 pc, const UINT8 *oprom, int mode); +extern int i386_dasm_one(char *buffer, uint32_t pc, const uint8_t *oprom, int mode); enum SREGS { ES, CS, SS, DS, FS, GS }; @@ -277,20 +277,20 @@ enum smram_intel_p5 #define MXCSR_FZ (1<<15) // Flush to Zero union MMX_REG { - UINT32 d[2]; - INT32 i[2]; - UINT16 w[4]; - INT16 s[4]; - UINT8 b[8]; - INT8 c[8]; + uint32_t d[2]; + int32_t i[2]; + uint16_t w[4]; + int16_t s[4]; + uint8_t b[8]; + int8_t c[8]; float f[2]; - UINT64 q; - INT64 l; + uint64_t q; + int64_t l; }; extern int i386_parity_table[256]; -#define FAULT_THROW(fault,error) { throw (UINT64)(fault | (UINT64)error << 32); } +#define FAULT_THROW(fault,error) { throw (uint64_t)(fault | (uint64_t)error << 32); } #define PF_THROW(error) { m_cr[2] = address; FAULT_THROW(FAULT_PF,error); } #define PROTECTED_MODE (m_cr[0] & 0x1) @@ -309,16 +309,16 @@ extern int i386_parity_table[256]; #define SetCF8(x) {m_CF = ((x) & 0x100) ? 1 : 0; } #define SetCF16(x) {m_CF = ((x) & 0x10000) ? 1 : 0; } -#define SetCF32(x) {m_CF = ((x) & (((UINT64)1) << 32)) ? 1 : 0; } +#define SetCF32(x) {m_CF = ((x) & (((uint64_t)1) << 32)) ? 1 : 0; } #define SetSF(x) (m_SF = (x)) #define SetZF(x) (m_ZF = (x)) #define SetAF(x,y,z) (m_AF = (((x) ^ ((y) ^ (z))) & 0x10) ? 1 : 0) #define SetPF(x) (m_PF = i386_parity_table[(x) & 0xFF]) -#define SetSZPF8(x) {m_ZF = ((UINT8)(x)==0); m_SF = ((x)&0x80) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } -#define SetSZPF16(x) {m_ZF = ((UINT16)(x)==0); m_SF = ((x)&0x8000) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } -#define SetSZPF32(x) {m_ZF = ((UINT32)(x)==0); m_SF = ((x)&0x80000000) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } +#define SetSZPF8(x) {m_ZF = ((uint8_t)(x)==0); m_SF = ((x)&0x80) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } +#define SetSZPF16(x) {m_ZF = ((uint16_t)(x)==0); m_SF = ((x)&0x8000) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } +#define SetSZPF32(x) {m_ZF = ((uint32_t)(x)==0); m_SF = ((x)&0x80000000) ? 1 : 0; m_PF = i386_parity_table[x & 0xFF]; } #define MMX(n) (*((MMX_REG *)(&m_x87_reg[(n)].low))) #define XMM(n) m_sse_reg[(n)] @@ -362,7 +362,7 @@ extern MODRM_TABLE i386_MODRM_table[256]; /***********************************************************************************/ -UINT32 i386_device::i386_translate(int segment, UINT32 ip, int rwn) +uint32_t i386_device::i386_translate(int segment, uint32_t ip, int rwn) { // TODO: segment limit access size, execution permission, handle exception thrown from exception handler if(PROTECTED_MODE && !V8086_MODE && (rwn != -1)) @@ -381,7 +381,7 @@ UINT32 i386_device::i386_translate(int segment, UINT32 ip, int rwn) #define VTLB_FLAG_DIRTY 0x100 -vtlb_entry i386_device::get_permissions(UINT32 pte, int wp) +vtlb_entry i386_device::get_permissions(uint32_t pte, int wp) { vtlb_entry ret = VTLB_READ_ALLOWED | ((pte & 4) ? VTLB_USER_READ_ALLOWED : 0); if(!wp) @@ -393,10 +393,10 @@ vtlb_entry i386_device::get_permissions(UINT32 pte, int wp) bool i386_device::i386_translate_address(int intention, offs_t *address, vtlb_entry *entry) { - UINT32 a = *address; - UINT32 pdbr = m_cr[3] & 0xfffff000; - UINT32 directory = (a >> 22) & 0x3ff; - UINT32 table = (a >> 12) & 0x3ff; + uint32_t a = *address; + uint32_t pdbr = m_cr[3] & 0xfffff000; + uint32_t directory = (a >> 22) & 0x3ff; + uint32_t table = (a >> 12) & 0x3ff; vtlb_entry perm = 0; bool ret; bool user = (intention & TRANSLATE_USER_MASK) ? true : false; @@ -410,7 +410,7 @@ bool i386_device::i386_translate_address(int intention, offs_t *address, vtlb_en return true; } - UINT32 page_dir = m_program->read_dword(pdbr + directory * 4); + uint32_t page_dir = m_program->read_dword(pdbr + directory * 4); if(page_dir & 1) { if ((page_dir & 0x80) && (m_cr[4] & 0x10)) @@ -439,7 +439,7 @@ bool i386_device::i386_translate_address(int intention, offs_t *address, vtlb_en } else { - UINT32 page_entry = m_program->read_dword((page_dir & 0xfffff000) + (table * 4)); + uint32_t page_entry = m_program->read_dword((page_dir & 0xfffff000) + (table * 4)); if(!(page_entry & 1)) ret = false; else @@ -481,20 +481,20 @@ bool i386_device::i386_translate_address(int intention, offs_t *address, vtlb_en //#define TEST_TLB -int i386_device::translate_address(int pl, int type, UINT32 *address, UINT32 *error) +int i386_device::translate_address(int pl, int type, uint32_t *address, uint32_t *error) { if(!(m_cr[0] & 0x80000000)) // Some (very few) old OS's won't work with this return TRUE; const vtlb_entry *table = vtlb_table(); - UINT32 index = *address >> 12; + uint32_t index = *address >> 12; vtlb_entry entry = table[index]; if(type == TRANSLATE_FETCH) type = TRANSLATE_READ; if(pl == 3) type |= TRANSLATE_USER_MASK; #ifdef TEST_TLB - UINT32 test_addr = *address; + uint32_t test_addr = *address; #endif if(!(entry & VTLB_FLAG_VALID) || ((type & TRANSLATE_WRITE) && !(entry & VTLB_FLAG_DIRTY))) @@ -523,22 +523,22 @@ int i386_device::translate_address(int pl, int type, UINT32 *address, UINT32 *er return TRUE; } -void i386_device::CHANGE_PC(UINT32 pc) +void i386_device::CHANGE_PC(uint32_t pc) { m_pc = i386_translate(CS, pc, -1 ); } -void i386_device::NEAR_BRANCH(INT32 offs) +void i386_device::NEAR_BRANCH(int32_t offs) { /* TODO: limit */ m_eip += offs; m_pc += offs; } -UINT8 i386_device::FETCH() +uint8_t i386_device::FETCH() { - UINT8 value; - UINT32 address = m_pc, error; + uint8_t value; + uint32_t address = m_pc, error; if(!translate_address(m_CPL,TRANSLATE_FETCH,&address,&error)) PF_THROW(error); @@ -552,10 +552,10 @@ UINT8 i386_device::FETCH() m_pc++; return value; } -UINT16 i386_device::FETCH16() +uint16_t i386_device::FETCH16() { - UINT16 value; - UINT32 address = m_pc, error; + uint16_t value; + uint32_t address = m_pc, error; if( !WORD_ALIGNED(address) ) { /* Unaligned read */ value = (FETCH() << 0); @@ -570,10 +570,10 @@ UINT16 i386_device::FETCH16() } return value; } -UINT32 i386_device::FETCH32() +uint32_t i386_device::FETCH32() { - UINT32 value; - UINT32 address = m_pc, error; + uint32_t value; + uint32_t address = m_pc, error; if( !DWORD_ALIGNED(m_pc) ) { /* Unaligned read */ value = (FETCH() << 0); @@ -592,9 +592,9 @@ UINT32 i386_device::FETCH32() return value; } -UINT8 i386_device::READ8(UINT32 ea) +uint8_t i386_device::READ8(uint32_t ea) { - UINT32 address = ea, error; + uint32_t address = ea, error; if(!translate_address(m_CPL,TRANSLATE_READ,&address, &error)) PF_THROW(error); @@ -602,10 +602,10 @@ UINT8 i386_device::READ8(UINT32 ea) address &= m_a20_mask; return m_program->read_byte(address); } -UINT16 i386_device::READ16(UINT32 ea) +uint16_t i386_device::READ16(uint32_t ea) { - UINT16 value; - UINT32 address = ea, error; + uint16_t value; + uint32_t address = ea, error; if( !WORD_ALIGNED(ea) ) { /* Unaligned read */ value = (READ8( address+0 ) << 0); @@ -619,10 +619,10 @@ UINT16 i386_device::READ16(UINT32 ea) } return value; } -UINT32 i386_device::READ32(UINT32 ea) +uint32_t i386_device::READ32(uint32_t ea) { - UINT32 value; - UINT32 address = ea, error; + uint32_t value; + uint32_t address = ea, error; if( !DWORD_ALIGNED(ea) ) { /* Unaligned read */ value = (READ8( address+0 ) << 0); @@ -639,33 +639,33 @@ UINT32 i386_device::READ32(UINT32 ea) return value; } -UINT64 i386_device::READ64(UINT32 ea) +uint64_t i386_device::READ64(uint32_t ea) { - UINT64 value; - UINT32 address = ea, error; + uint64_t value; + uint32_t address = ea, error; if( !QWORD_ALIGNED(ea) ) { /* Unaligned read */ - value = (((UINT64) READ8( address+0 )) << 0); - value |= (((UINT64) READ8( address+1 )) << 8); - value |= (((UINT64) READ8( address+2 )) << 16); - value |= (((UINT64) READ8( address+3 )) << 24); - value |= (((UINT64) READ8( address+4 )) << 32); - value |= (((UINT64) READ8( address+5 )) << 40); - value |= (((UINT64) READ8( address+6 )) << 48); - value |= (((UINT64) READ8( address+7 )) << 56); + value = (((uint64_t) READ8( address+0 )) << 0); + value |= (((uint64_t) READ8( address+1 )) << 8); + value |= (((uint64_t) READ8( address+2 )) << 16); + value |= (((uint64_t) READ8( address+3 )) << 24); + value |= (((uint64_t) READ8( address+4 )) << 32); + value |= (((uint64_t) READ8( address+5 )) << 40); + value |= (((uint64_t) READ8( address+6 )) << 48); + value |= (((uint64_t) READ8( address+7 )) << 56); } else { if(!translate_address(m_CPL,TRANSLATE_READ,&address,&error)) PF_THROW(error); address &= m_a20_mask; - value = (((UINT64) m_program->read_dword( address+0 )) << 0); - value |= (((UINT64) m_program->read_dword( address+4 )) << 32); + value = (((uint64_t) m_program->read_dword( address+0 )) << 0); + value |= (((uint64_t) m_program->read_dword( address+4 )) << 32); } return value; } -UINT8 i386_device::READ8PL0(UINT32 ea) +uint8_t i386_device::READ8PL0(uint32_t ea) { - UINT32 address = ea, error; + uint32_t address = ea, error; if(!translate_address(0,TRANSLATE_READ,&address,&error)) PF_THROW(error); @@ -673,10 +673,10 @@ UINT8 i386_device::READ8PL0(UINT32 ea) address &= m_a20_mask; return m_program->read_byte(address); } -UINT16 i386_device::READ16PL0(UINT32 ea) +uint16_t i386_device::READ16PL0(uint32_t ea) { - UINT16 value; - UINT32 address = ea, error; + uint16_t value; + uint32_t address = ea, error; if( !WORD_ALIGNED(ea) ) { /* Unaligned read */ value = (READ8PL0( address+0 ) << 0); @@ -691,10 +691,10 @@ UINT16 i386_device::READ16PL0(UINT32 ea) return value; } -UINT32 i386_device::READ32PL0(UINT32 ea) +uint32_t i386_device::READ32PL0(uint32_t ea) { - UINT32 value; - UINT32 address = ea, error; + uint32_t value; + uint32_t address = ea, error; if( !DWORD_ALIGNED(ea) ) { /* Unaligned read */ value = (READ8PL0( address+0 ) << 0); @@ -711,16 +711,16 @@ UINT32 i386_device::READ32PL0(UINT32 ea) return value; } -void i386_device::WRITE_TEST(UINT32 ea) +void i386_device::WRITE_TEST(uint32_t ea) { - UINT32 address = ea, error; + uint32_t address = ea, error; if(!translate_address(m_CPL,TRANSLATE_WRITE,&address,&error)) PF_THROW(error); } -void i386_device::WRITE8(UINT32 ea, UINT8 value) +void i386_device::WRITE8(uint32_t ea, uint8_t value) { - UINT32 address = ea, error; + uint32_t address = ea, error; if(!translate_address(m_CPL,TRANSLATE_WRITE,&address,&error)) PF_THROW(error); @@ -728,9 +728,9 @@ void i386_device::WRITE8(UINT32 ea, UINT8 value) address &= m_a20_mask; m_program->write_byte(address, value); } -void i386_device::WRITE16(UINT32 ea, UINT16 value) +void i386_device::WRITE16(uint32_t ea, uint16_t value) { - UINT32 address = ea, error; + uint32_t address = ea, error; if( !WORD_ALIGNED(ea) ) { /* Unaligned write */ WRITE8( address+0, value & 0xff ); @@ -743,9 +743,9 @@ void i386_device::WRITE16(UINT32 ea, UINT16 value) m_program->write_word(address, value); } } -void i386_device::WRITE32(UINT32 ea, UINT32 value) +void i386_device::WRITE32(uint32_t ea, uint32_t value) { - UINT32 address = ea, error; + uint32_t address = ea, error; if( !DWORD_ALIGNED(ea) ) { /* Unaligned write */ WRITE8( address+0, value & 0xff ); @@ -761,9 +761,9 @@ void i386_device::WRITE32(UINT32 ea, UINT32 value) } } -void i386_device::WRITE64(UINT32 ea, UINT64 value) +void i386_device::WRITE64(uint32_t ea, uint64_t value) { - UINT32 address = ea, error; + uint32_t address = ea, error; if( !QWORD_ALIGNED(ea) ) { /* Unaligned write */ WRITE8( address+0, value & 0xff ); @@ -786,193 +786,193 @@ void i386_device::WRITE64(UINT32 ea, UINT64 value) /***********************************************************************************/ -UINT8 i386_device::OR8(UINT8 dst, UINT8 src) +uint8_t i386_device::OR8(uint8_t dst, uint8_t src) { - UINT8 res = dst | src; + uint8_t res = dst | src; m_CF = m_OF = 0; SetSZPF8(res); return res; } -UINT16 i386_device::OR16(UINT16 dst, UINT16 src) +uint16_t i386_device::OR16(uint16_t dst, uint16_t src) { - UINT16 res = dst | src; + uint16_t res = dst | src; m_CF = m_OF = 0; SetSZPF16(res); return res; } -UINT32 i386_device::OR32(UINT32 dst, UINT32 src) +uint32_t i386_device::OR32(uint32_t dst, uint32_t src) { - UINT32 res = dst | src; + uint32_t res = dst | src; m_CF = m_OF = 0; SetSZPF32(res); return res; } -UINT8 i386_device::AND8(UINT8 dst, UINT8 src) +uint8_t i386_device::AND8(uint8_t dst, uint8_t src) { - UINT8 res = dst & src; + uint8_t res = dst & src; m_CF = m_OF = 0; SetSZPF8(res); return res; } -UINT16 i386_device::AND16(UINT16 dst, UINT16 src) +uint16_t i386_device::AND16(uint16_t dst, uint16_t src) { - UINT16 res = dst & src; + uint16_t res = dst & src; m_CF = m_OF = 0; SetSZPF16(res); return res; } -UINT32 i386_device::AND32(UINT32 dst, UINT32 src) +uint32_t i386_device::AND32(uint32_t dst, uint32_t src) { - UINT32 res = dst & src; + uint32_t res = dst & src; m_CF = m_OF = 0; SetSZPF32(res); return res; } -UINT8 i386_device::XOR8(UINT8 dst, UINT8 src) +uint8_t i386_device::XOR8(uint8_t dst, uint8_t src) { - UINT8 res = dst ^ src; + uint8_t res = dst ^ src; m_CF = m_OF = 0; SetSZPF8(res); return res; } -UINT16 i386_device::XOR16(UINT16 dst, UINT16 src) +uint16_t i386_device::XOR16(uint16_t dst, uint16_t src) { - UINT16 res = dst ^ src; + uint16_t res = dst ^ src; m_CF = m_OF = 0; SetSZPF16(res); return res; } -UINT32 i386_device::XOR32(UINT32 dst, UINT32 src) +uint32_t i386_device::XOR32(uint32_t dst, uint32_t src) { - UINT32 res = dst ^ src; + uint32_t res = dst ^ src; m_CF = m_OF = 0; SetSZPF32(res); return res; } #define SUB8(dst, src) SBB8(dst, src, 0) -UINT8 i386_device::SBB8(UINT8 dst, UINT8 src, UINT8 b) +uint8_t i386_device::SBB8(uint8_t dst, uint8_t src, uint8_t b) { - UINT16 res = (UINT16)dst - (UINT16)src - (UINT8)b; + uint16_t res = (uint16_t)dst - (uint16_t)src - (uint8_t)b; SetCF8(res); SetOF_Sub8(res,src,dst); SetAF(res,src,dst); SetSZPF8(res); - return (UINT8)res; + return (uint8_t)res; } #define SUB16(dst, src) SBB16(dst, src, 0) -UINT16 i386_device::SBB16(UINT16 dst, UINT16 src, UINT16 b) +uint16_t i386_device::SBB16(uint16_t dst, uint16_t src, uint16_t b) { - UINT32 res = (UINT32)dst - (UINT32)src - (UINT32)b; + uint32_t res = (uint32_t)dst - (uint32_t)src - (uint32_t)b; SetCF16(res); SetOF_Sub16(res,src,dst); SetAF(res,src,dst); SetSZPF16(res); - return (UINT16)res; + return (uint16_t)res; } #define SUB32(dst, src) SBB32(dst, src, 0) -UINT32 i386_device::SBB32(UINT32 dst, UINT32 src, UINT32 b) +uint32_t i386_device::SBB32(uint32_t dst, uint32_t src, uint32_t b) { - UINT64 res = (UINT64)dst - (UINT64)src - (UINT64) b; + uint64_t res = (uint64_t)dst - (uint64_t)src - (uint64_t) b; SetCF32(res); SetOF_Sub32(res,src,dst); SetAF(res,src,dst); SetSZPF32(res); - return (UINT32)res; + return (uint32_t)res; } #define ADD8(dst, src) ADC8(dst, src, 0) -UINT8 i386_device::ADC8(UINT8 dst, UINT8 src, UINT8 c) +uint8_t i386_device::ADC8(uint8_t dst, uint8_t src, uint8_t c) { - UINT16 res = (UINT16)dst + (UINT16)src + (UINT16)c; + uint16_t res = (uint16_t)dst + (uint16_t)src + (uint16_t)c; SetCF8(res); SetOF_Add8(res,src,dst); SetAF(res,src,dst); SetSZPF8(res); - return (UINT8)res; + return (uint8_t)res; } #define ADD16(dst, src) ADC16(dst, src, 0) -UINT16 i386_device::ADC16(UINT16 dst, UINT16 src, UINT8 c) +uint16_t i386_device::ADC16(uint16_t dst, uint16_t src, uint8_t c) { - UINT32 res = (UINT32)dst + (UINT32)src + (UINT32)c; + uint32_t res = (uint32_t)dst + (uint32_t)src + (uint32_t)c; SetCF16(res); SetOF_Add16(res,src,dst); SetAF(res,src,dst); SetSZPF16(res); - return (UINT16)res; + return (uint16_t)res; } #define ADD32(dst, src) ADC32(dst, src, 0) -UINT32 i386_device::ADC32(UINT32 dst, UINT32 src, UINT32 c) +uint32_t i386_device::ADC32(uint32_t dst, uint32_t src, uint32_t c) { - UINT64 res = (UINT64)dst + (UINT64)src + (UINT64) c; + uint64_t res = (uint64_t)dst + (uint64_t)src + (uint64_t) c; SetCF32(res); SetOF_Add32(res,src,dst); SetAF(res,src,dst); SetSZPF32(res); - return (UINT32)res; + return (uint32_t)res; } -UINT8 i386_device::INC8(UINT8 dst) +uint8_t i386_device::INC8(uint8_t dst) { - UINT16 res = (UINT16)dst + 1; + uint16_t res = (uint16_t)dst + 1; SetOF_Add8(res,1,dst); SetAF(res,1,dst); SetSZPF8(res); - return (UINT8)res; + return (uint8_t)res; } -UINT16 i386_device::INC16(UINT16 dst) +uint16_t i386_device::INC16(uint16_t dst) { - UINT32 res = (UINT32)dst + 1; + uint32_t res = (uint32_t)dst + 1; SetOF_Add16(res,1,dst); SetAF(res,1,dst); SetSZPF16(res); - return (UINT16)res; + return (uint16_t)res; } -UINT32 i386_device::INC32(UINT32 dst) +uint32_t i386_device::INC32(uint32_t dst) { - UINT64 res = (UINT64)dst + 1; + uint64_t res = (uint64_t)dst + 1; SetOF_Add32(res,1,dst); SetAF(res,1,dst); SetSZPF32(res); - return (UINT32)res; + return (uint32_t)res; } -UINT8 i386_device::DEC8(UINT8 dst) +uint8_t i386_device::DEC8(uint8_t dst) { - UINT16 res = (UINT16)dst - 1; + uint16_t res = (uint16_t)dst - 1; SetOF_Sub8(res,1,dst); SetAF(res,1,dst); SetSZPF8(res); - return (UINT8)res; + return (uint8_t)res; } -UINT16 i386_device::DEC16(UINT16 dst) +uint16_t i386_device::DEC16(uint16_t dst) { - UINT32 res = (UINT32)dst - 1; + uint32_t res = (uint32_t)dst - 1; SetOF_Sub16(res,1,dst); SetAF(res,1,dst); SetSZPF16(res); - return (UINT16)res; + return (uint16_t)res; } -UINT32 i386_device::DEC32(UINT32 dst) +uint32_t i386_device::DEC32(uint32_t dst) { - UINT64 res = (UINT64)dst - 1; + uint64_t res = (uint64_t)dst - 1; SetOF_Sub32(res,1,dst); SetAF(res,1,dst); SetSZPF32(res); - return (UINT32)res; + return (uint32_t)res; } -void i386_device::PUSH16(UINT16 value) +void i386_device::PUSH16(uint16_t value) { - UINT32 ea, new_esp; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) - 2; ea = i386_translate(SS, new_esp, 1); @@ -985,9 +985,9 @@ void i386_device::PUSH16(UINT16 value) REG16(SP) = new_esp; } } -void i386_device::PUSH32(UINT32 value) +void i386_device::PUSH32(uint32_t value) { - UINT32 ea, new_esp; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) - 4; ea = i386_translate(SS, new_esp, 1); @@ -1001,9 +1001,9 @@ void i386_device::PUSH32(UINT32 value) } } -void i386_device::PUSH32SEG(UINT32 value) +void i386_device::PUSH32SEG(uint32_t value) { - UINT32 ea, new_esp; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) - 4; ea = i386_translate(SS, new_esp, 1); @@ -1017,19 +1017,19 @@ void i386_device::PUSH32SEG(UINT32 value) } } -void i386_device::PUSH8(UINT8 value) +void i386_device::PUSH8(uint8_t value) { if( m_operand_size ) { - PUSH32((INT32)(INT8)value); + PUSH32((int32_t)(int8_t)value); } else { - PUSH16((INT16)(INT8)value); + PUSH16((int16_t)(int8_t)value); } } -UINT8 i386_device::POP8() +uint8_t i386_device::POP8() { - UINT8 value; - UINT32 ea, new_esp; + uint8_t value; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) + 1; ea = i386_translate(SS, new_esp - 1, 0); @@ -1043,10 +1043,10 @@ UINT8 i386_device::POP8() } return value; } -UINT16 i386_device::POP16() +uint16_t i386_device::POP16() { - UINT16 value; - UINT32 ea, new_esp; + uint16_t value; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) + 2; ea = i386_translate(SS, new_esp - 2, 0); @@ -1060,10 +1060,10 @@ UINT16 i386_device::POP16() } return value; } -UINT32 i386_device::POP32() +uint32_t i386_device::POP32() { - UINT32 value; - UINT32 ea, new_esp; + uint32_t value; + uint32_t ea, new_esp; if( STACK_32BIT ) { new_esp = REG32(ESP) + 4; ea = i386_translate(SS, new_esp - 4, 0); @@ -1100,11 +1100,11 @@ void i386_device::BUMP_DI(int adjustment) I/O ACCESS ***********************************************************************************/ -void i386_device::check_ioperm(offs_t port, UINT8 mask) +void i386_device::check_ioperm(offs_t port, uint8_t mask) { - UINT8 IOPL, map; - UINT16 IOPB; - UINT32 address; + uint8_t IOPL, map; + uint16_t IOPB; + uint32_t address; if(!PROTECTED_MODE) return; @@ -1127,23 +1127,23 @@ void i386_device::check_ioperm(offs_t port, UINT8 mask) FAULT_THROW(FAULT_GP,0); } -UINT8 i386_device::READPORT8(offs_t port) +uint8_t i386_device::READPORT8(offs_t port) { check_ioperm(port, 1); return m_io->read_byte(port); } -void i386_device::WRITEPORT8(offs_t port, UINT8 value) +void i386_device::WRITEPORT8(offs_t port, uint8_t value) { check_ioperm(port, 1); m_io->write_byte(port, value); } -UINT16 i386_device::READPORT16(offs_t port) +uint16_t i386_device::READPORT16(offs_t port) { if (port & 1) { - UINT16 value = READPORT8(port); + uint16_t value = READPORT8(port); value |= (READPORT8(port + 1) << 8); return value; } @@ -1154,7 +1154,7 @@ UINT16 i386_device::READPORT16(offs_t port) } } -void i386_device::WRITEPORT16(offs_t port, UINT16 value) +void i386_device::WRITEPORT16(offs_t port, uint16_t value) { if (port & 1) { @@ -1168,11 +1168,11 @@ void i386_device::WRITEPORT16(offs_t port, UINT16 value) } } -UINT32 i386_device::READPORT32(offs_t port) +uint32_t i386_device::READPORT32(offs_t port) { if (port & 3) { - UINT32 value = READPORT8(port); + uint32_t value = READPORT8(port); value |= (READPORT8(port + 1) << 8); value |= (READPORT8(port + 2) << 16); value |= (READPORT8(port + 3) << 24); @@ -1185,7 +1185,7 @@ UINT32 i386_device::READPORT32(offs_t port) } } -void i386_device::WRITEPORT32(offs_t port, UINT32 value) +void i386_device::WRITEPORT32(offs_t port, uint32_t value) { if (port & 3) { @@ -1206,7 +1206,7 @@ void i386_device::WRITEPORT32(offs_t port, UINT32 value) ***********************************************************************************/ // Pentium MSR handling -UINT64 i386_device::pentium_msr_read(UINT32 offset,UINT8 *valid_msr) +uint64_t i386_device::pentium_msr_read(uint32_t offset,uint8_t *valid_msr) { switch(offset) { @@ -1249,7 +1249,7 @@ UINT64 i386_device::pentium_msr_read(UINT32 offset,UINT8 *valid_msr) return -1; } -void i386_device::pentium_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) +void i386_device::pentium_msr_write(uint32_t offset, uint64_t data, uint8_t *valid_msr) { switch(offset) { @@ -1288,14 +1288,14 @@ void i386_device::pentium_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr logerror("WRMSR: Writing test MSR %x", offset); break; } - logerror("WRMSR: invalid MSR write %08x (%08x%08x) at %08x\n",offset,(UINT32)(data >> 32),(UINT32)data,m_pc-2); + logerror("WRMSR: invalid MSR write %08x (%08x%08x) at %08x\n",offset,(uint32_t)(data >> 32),(uint32_t)data,m_pc-2); *valid_msr = 0; break; } } // P6 (Pentium Pro, Pentium II, Pentium III) MSR handling -UINT64 i386_device::p6_msr_read(UINT32 offset,UINT8 *valid_msr) +uint64_t i386_device::p6_msr_read(uint32_t offset,uint8_t *valid_msr) { switch(offset) { @@ -1328,7 +1328,7 @@ UINT64 i386_device::p6_msr_read(UINT32 offset,UINT8 *valid_msr) return -1; } -void i386_device::p6_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) +void i386_device::p6_msr_write(uint32_t offset, uint64_t data, uint8_t *valid_msr) { switch(offset) { @@ -1348,7 +1348,7 @@ void i386_device::p6_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) *valid_msr = 1; break; default: - logerror("WRMSR: unimplemented register called %08x (%08x%08x) at %08x\n",offset,(UINT32)(data >> 32),(UINT32)data,m_pc-2); + logerror("WRMSR: unimplemented register called %08x (%08x%08x) at %08x\n",offset,(uint32_t)(data >> 32),(uint32_t)data,m_pc-2); *valid_msr = 1; break; } @@ -1356,7 +1356,7 @@ void i386_device::p6_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) // PIV (Pentium 4+) -UINT64 i386_device::piv_msr_read(UINT32 offset,UINT8 *valid_msr) +uint64_t i386_device::piv_msr_read(uint32_t offset,uint8_t *valid_msr) { switch(offset) { @@ -1368,21 +1368,21 @@ UINT64 i386_device::piv_msr_read(UINT32 offset,UINT8 *valid_msr) return -1; } -void i386_device::piv_msr_write(UINT32 offset, UINT64 data, UINT8 *valid_msr) +void i386_device::piv_msr_write(uint32_t offset, uint64_t data, uint8_t *valid_msr) { switch(offset) { default: - logerror("WRMSR: unimplemented register called %08x (%08x%08x) at %08x\n",offset,(UINT32)(data >> 32),(UINT32)data,m_pc-2); + logerror("WRMSR: unimplemented register called %08x (%08x%08x) at %08x\n",offset,(uint32_t)(data >> 32),(uint32_t)data,m_pc-2); *valid_msr = 1; break; } } -UINT64 i386_device::MSR_READ(UINT32 offset,UINT8 *valid_msr) +uint64_t i386_device::MSR_READ(uint32_t offset,uint8_t *valid_msr) { - UINT64 res; - UINT8 cpu_type = (m_cpu_version >> 8) & 0x0f; + uint64_t res; + uint8_t cpu_type = (m_cpu_version >> 8) & 0x0f; *valid_msr = 0; @@ -1405,10 +1405,10 @@ UINT64 i386_device::MSR_READ(UINT32 offset,UINT8 *valid_msr) return res; } -void i386_device::MSR_WRITE(UINT32 offset, UINT64 data, UINT8 *valid_msr) +void i386_device::MSR_WRITE(uint32_t offset, uint64_t data, uint8_t *valid_msr) { *valid_msr = 0; - UINT8 cpu_type = (m_cpu_version >> 8) & 0x0f; + uint8_t cpu_type = (m_cpu_version >> 8) & 0x0f; switch(cpu_type) { diff --git a/src/devices/cpu/i386/i486ops.hxx b/src/devices/cpu/i386/i486ops.hxx index 8be406692d4..2db6a8eada0 100644 --- a/src/devices/cpu/i386/i486ops.hxx +++ b/src/devices/cpu/i386/i486ops.hxx @@ -48,10 +48,10 @@ void i386_device::i486_wbinvd() // Opcode 0x0f 09 void i386_device::i486_cmpxchg_rm8_r8() // Opcode 0x0f b0 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT8 dst = LOAD_RM8(modrm); - UINT8 src = LOAD_REG8(modrm); + uint8_t dst = LOAD_RM8(modrm); + uint8_t src = LOAD_REG8(modrm); if( REG8(AL) == dst ) { STORE_RM8(modrm, src); @@ -64,9 +64,9 @@ void i386_device::i486_cmpxchg_rm8_r8() // Opcode 0x0f b0 } } else { // TODO: Check write if needed - UINT32 ea = GetEA(modrm,0); - UINT8 dst = READ8(ea); - UINT8 src = LOAD_REG8(modrm); + uint32_t ea = GetEA(modrm,0); + uint8_t dst = READ8(ea); + uint8_t src = LOAD_REG8(modrm); if( REG8(AL) == dst ) { WRITE8(ea, src); @@ -82,10 +82,10 @@ void i386_device::i486_cmpxchg_rm8_r8() // Opcode 0x0f b0 void i386_device::i486_cmpxchg_rm16_r16() // Opcode 0x0f b1 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 src = LOAD_REG16(modrm); + uint16_t dst = LOAD_RM16(modrm); + uint16_t src = LOAD_REG16(modrm); if( REG16(AX) == dst ) { STORE_RM16(modrm, src); @@ -97,9 +97,9 @@ void i386_device::i486_cmpxchg_rm16_r16() // Opcode 0x0f b1 CYCLES(CYCLES_CMPXCHG_REG_REG_F); } } else { - UINT32 ea = GetEA(modrm,0); - UINT16 dst = READ16(ea); - UINT16 src = LOAD_REG16(modrm); + uint32_t ea = GetEA(modrm,0); + uint16_t dst = READ16(ea); + uint16_t src = LOAD_REG16(modrm); if( REG16(AX) == dst ) { WRITE16(ea, src); @@ -115,10 +115,10 @@ void i386_device::i486_cmpxchg_rm16_r16() // Opcode 0x0f b1 void i386_device::i486_cmpxchg_rm32_r32() // Opcode 0x0f b1 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 src = LOAD_REG32(modrm); + uint32_t dst = LOAD_RM32(modrm); + uint32_t src = LOAD_REG32(modrm); if( REG32(EAX) == dst ) { STORE_RM32(modrm, src); @@ -130,9 +130,9 @@ void i386_device::i486_cmpxchg_rm32_r32() // Opcode 0x0f b1 CYCLES(CYCLES_CMPXCHG_REG_REG_F); } } else { - UINT32 ea = GetEA(modrm,0); - UINT32 dst = READ32(ea); - UINT32 src = LOAD_REG32(modrm); + uint32_t ea = GetEA(modrm,0); + uint32_t dst = READ32(ea); + uint32_t src = LOAD_REG32(modrm); if( REG32(EAX) == dst ) { WRITE32(ea, src); @@ -148,17 +148,17 @@ void i386_device::i486_cmpxchg_rm32_r32() // Opcode 0x0f b1 void i386_device::i486_xadd_rm8_r8() // Opcode 0x0f c0 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT8 dst = LOAD_RM8(modrm); - UINT8 src = LOAD_REG8(modrm); + uint8_t dst = LOAD_RM8(modrm); + uint8_t src = LOAD_REG8(modrm); STORE_REG8(modrm, dst); STORE_RM8(modrm, dst + src); CYCLES(CYCLES_XADD_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT8 dst = READ8(ea); - UINT8 src = LOAD_REG8(modrm); + uint32_t ea = GetEA(modrm,1); + uint8_t dst = READ8(ea); + uint8_t src = LOAD_REG8(modrm); WRITE8(ea, dst + src); STORE_REG8(modrm, dst); CYCLES(CYCLES_XADD_REG_MEM); @@ -167,17 +167,17 @@ void i386_device::i486_xadd_rm8_r8() // Opcode 0x0f c0 void i386_device::i486_xadd_rm16_r16() // Opcode 0x0f c1 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 dst = LOAD_RM16(modrm); - UINT16 src = LOAD_REG16(modrm); + uint16_t dst = LOAD_RM16(modrm); + uint16_t src = LOAD_REG16(modrm); STORE_REG16(modrm, dst); STORE_RM16(modrm, dst + src); CYCLES(CYCLES_XADD_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT16 dst = READ16(ea); - UINT16 src = LOAD_REG16(modrm); + uint32_t ea = GetEA(modrm,1); + uint16_t dst = READ16(ea); + uint16_t src = LOAD_REG16(modrm); WRITE16(ea, dst + src); STORE_REG16(modrm, dst); CYCLES(CYCLES_XADD_REG_MEM); @@ -186,17 +186,17 @@ void i386_device::i486_xadd_rm16_r16() // Opcode 0x0f c1 void i386_device::i486_xadd_rm32_r32() // Opcode 0x0f c1 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 dst = LOAD_RM32(modrm); - UINT32 src = LOAD_REG32(modrm); + uint32_t dst = LOAD_RM32(modrm); + uint32_t src = LOAD_REG32(modrm); STORE_REG32(modrm, dst); STORE_RM32(modrm, dst + src); CYCLES(CYCLES_XADD_REG_REG); } else { - UINT32 ea = GetEA(modrm,1); - UINT32 dst = READ32(ea); - UINT32 src = LOAD_REG32(modrm); + uint32_t ea = GetEA(modrm,1); + uint32_t dst = READ32(ea); + uint32_t src = LOAD_REG32(modrm); WRITE32(ea, dst + src); STORE_REG32(modrm, dst); CYCLES(CYCLES_XADD_REG_MEM); @@ -205,9 +205,9 @@ void i386_device::i486_xadd_rm32_r32() // Opcode 0x0f c1 void i386_device::i486_group0F01_16() // Opcode 0x0f 01 { - UINT8 modrm = FETCH(); - UINT16 address; - UINT32 ea; + uint8_t modrm = FETCH(); + uint16_t address; + uint32_t ea; switch( (modrm >> 3) & 0x7 ) { @@ -284,7 +284,7 @@ void i386_device::i486_group0F01_16() // Opcode 0x0f 01 } case 6: /* LMSW */ { - UINT16 b; + uint16_t b; if(PROTECTED_MODE && m_CPL) FAULT(FAULT_GP,0) if( modrm >= 0xc0 ) { @@ -323,8 +323,8 @@ void i386_device::i486_group0F01_16() // Opcode 0x0f 01 void i386_device::i486_group0F01_32() // Opcode 0x0f 01 { - UINT8 modrm = FETCH(); - UINT32 address, ea; + uint8_t modrm = FETCH(); + uint32_t address, ea; switch( (modrm >> 3) & 0x7 ) { @@ -404,7 +404,7 @@ void i386_device::i486_group0F01_32() // Opcode 0x0f 01 { if(PROTECTED_MODE && m_CPL) FAULT(FAULT_GP,0) - UINT16 b; + uint16_t b; if( modrm >= 0xc0 ) { b = LOAD_RM16(modrm); CYCLES(CYCLES_LMSW_REG); @@ -491,10 +491,10 @@ void i386_device::i486_mov_cr_r32() // Opcode 0x0f 22 { if(PROTECTED_MODE && m_CPL) FAULT(FAULT_GP, 0); - UINT8 modrm = FETCH(); - UINT8 cr = (modrm >> 3) & 0x7; - UINT32 oldcr = m_cr[cr]; - UINT32 data = LOAD_RM32(modrm); + uint8_t modrm = FETCH(); + uint8_t cr = (modrm >> 3) & 0x7; + uint32_t oldcr = m_cr[cr]; + uint32_t data = LOAD_RM32(modrm); switch(cr) { case 0: diff --git a/src/devices/cpu/i386/pentops.hxx b/src/devices/cpu/i386/pentops.hxx index 3b8eec56499..00b706bd5f2 100644 --- a/src/devices/cpu/i386/pentops.hxx +++ b/src/devices/cpu/i386/pentops.hxx @@ -11,52 +11,52 @@ void i386_device::MMXPROLOG() m_x87_tw = 0; // tag word = 0 } -void i386_device::READMMX(UINT32 ea,MMX_REG &r) +void i386_device::READMMX(uint32_t ea,MMX_REG &r) { r.q=READ64(ea); } -void i386_device::WRITEMMX(UINT32 ea,MMX_REG &r) +void i386_device::WRITEMMX(uint32_t ea,MMX_REG &r) { WRITE64(ea, r.q); } -void i386_device::READXMM(UINT32 ea,XMM_REG &r) +void i386_device::READXMM(uint32_t ea,XMM_REG &r) { r.q[0]=READ64(ea); r.q[1]=READ64(ea+8); } -void i386_device::WRITEXMM(UINT32 ea,i386_device::XMM_REG &r) +void i386_device::WRITEXMM(uint32_t ea,i386_device::XMM_REG &r) { WRITE64(ea, r.q[0]); WRITE64(ea+8, r.q[1]); } -void i386_device::READXMM_LO64(UINT32 ea,i386_device::XMM_REG &r) +void i386_device::READXMM_LO64(uint32_t ea,i386_device::XMM_REG &r) { r.q[0]=READ64(ea); } -void i386_device::WRITEXMM_LO64(UINT32 ea,i386_device::XMM_REG &r) +void i386_device::WRITEXMM_LO64(uint32_t ea,i386_device::XMM_REG &r) { WRITE64(ea, r.q[0]); } -void i386_device::READXMM_HI64(UINT32 ea,i386_device::XMM_REG &r) +void i386_device::READXMM_HI64(uint32_t ea,i386_device::XMM_REG &r) { r.q[1]=READ64(ea); } -void i386_device::WRITEXMM_HI64(UINT32 ea,i386_device::XMM_REG &r) +void i386_device::WRITEXMM_HI64(uint32_t ea,i386_device::XMM_REG &r) { WRITE64(ea, r.q[1]); } void i386_device::pentium_rdmsr() // Opcode 0x0f 32 { - UINT64 data; - UINT8 valid_msr = 0; + uint64_t data; + uint8_t valid_msr = 0; data = MSR_READ(REG32(ECX),&valid_msr); REG32(EDX) = data >> 32; @@ -70,11 +70,11 @@ void i386_device::pentium_rdmsr() // Opcode 0x0f 32 void i386_device::pentium_wrmsr() // Opcode 0x0f 30 { - UINT64 data; - UINT8 valid_msr = 0; + uint64_t data; + uint8_t valid_msr = 0; - data = (UINT64)REG32(EAX); - data |= (UINT64)(REG32(EDX)) << 32; + data = (uint64_t)REG32(EAX); + data |= (uint64_t)(REG32(EDX)) << 32; MSR_WRITE(REG32(ECX),data,&valid_msr); @@ -86,9 +86,9 @@ void i386_device::pentium_wrmsr() // Opcode 0x0f 30 void i386_device::pentium_rdtsc() // Opcode 0x0f 31 { - UINT64 ts = m_tsc + (m_base_cycles - m_cycles); - REG32(EAX) = (UINT32)(ts); - REG32(EDX) = (UINT32)(ts >> 32); + uint64_t ts = m_tsc + (m_base_cycles - m_cycles); + REG32(EAX) = (uint32_t)(ts); + REG32(EDX) = (uint32_t)(ts >> 32); CYCLES(CYCLES_RDTSC); } @@ -100,7 +100,7 @@ void i386_device::pentium_ud2() // Opcode 0x0f 0b void i386_device::pentium_rsm() { - UINT32 smram_state = m_smbase + 0xfe00; + uint32_t smram_state = m_smbase + 0xfe00; if(!m_smm) { logerror("i386: Invalid RSM outside SMM at %08X\n", m_pc - 1); @@ -197,15 +197,15 @@ void i386_device::pentium_rsm() void i386_device::pentium_prefetch_m8() // Opcode 0x0f 18 { - UINT8 modrm = FETCH(); - UINT32 ea = GetEA(modrm,0); + uint8_t modrm = FETCH(); + uint32_t ea = GetEA(modrm,0); CYCLES(1+(ea & 1)); // TODO: correct cycle count } void i386_device::pentium_cmovo_r16_rm16() // Opcode 0x0f 40 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -218,7 +218,7 @@ void i386_device::pentium_cmovo_r16_rm16() // Opcode 0x0f 40 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_OF == 1) { src = READ16(ea); @@ -230,8 +230,8 @@ void i386_device::pentium_cmovo_r16_rm16() // Opcode 0x0f 40 void i386_device::pentium_cmovo_r32_rm32() // Opcode 0x0f 40 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -244,7 +244,7 @@ void i386_device::pentium_cmovo_r32_rm32() // Opcode 0x0f 40 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_OF == 1) { src = READ32(ea); @@ -256,8 +256,8 @@ void i386_device::pentium_cmovo_r32_rm32() // Opcode 0x0f 40 void i386_device::pentium_cmovno_r16_rm16() // Opcode 0x0f 41 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -270,7 +270,7 @@ void i386_device::pentium_cmovno_r16_rm16() // Opcode 0x0f 41 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_OF == 0) { src = READ16(ea); @@ -282,8 +282,8 @@ void i386_device::pentium_cmovno_r16_rm16() // Opcode 0x0f 41 void i386_device::pentium_cmovno_r32_rm32() // Opcode 0x0f 41 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -296,7 +296,7 @@ void i386_device::pentium_cmovno_r32_rm32() // Opcode 0x0f 41 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_OF == 0) { src = READ32(ea); @@ -308,8 +308,8 @@ void i386_device::pentium_cmovno_r32_rm32() // Opcode 0x0f 41 void i386_device::pentium_cmovb_r16_rm16() // Opcode 0x0f 42 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -322,7 +322,7 @@ void i386_device::pentium_cmovb_r16_rm16() // Opcode 0x0f 42 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_CF == 1) { src = READ16(ea); @@ -334,8 +334,8 @@ void i386_device::pentium_cmovb_r16_rm16() // Opcode 0x0f 42 void i386_device::pentium_cmovb_r32_rm32() // Opcode 0x0f 42 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -348,7 +348,7 @@ void i386_device::pentium_cmovb_r32_rm32() // Opcode 0x0f 42 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_CF == 1) { src = READ32(ea); @@ -360,8 +360,8 @@ void i386_device::pentium_cmovb_r32_rm32() // Opcode 0x0f 42 void i386_device::pentium_cmovae_r16_rm16() // Opcode 0x0f 43 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -374,7 +374,7 @@ void i386_device::pentium_cmovae_r16_rm16() // Opcode 0x0f 43 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_CF == 0) { src = READ16(ea); @@ -386,8 +386,8 @@ void i386_device::pentium_cmovae_r16_rm16() // Opcode 0x0f 43 void i386_device::pentium_cmovae_r32_rm32() // Opcode 0x0f 43 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -400,7 +400,7 @@ void i386_device::pentium_cmovae_r32_rm32() // Opcode 0x0f 43 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_CF == 0) { src = READ32(ea); @@ -412,8 +412,8 @@ void i386_device::pentium_cmovae_r32_rm32() // Opcode 0x0f 43 void i386_device::pentium_cmove_r16_rm16() // Opcode 0x0f 44 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -426,7 +426,7 @@ void i386_device::pentium_cmove_r16_rm16() // Opcode 0x0f 44 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_ZF == 1) { src = READ16(ea); @@ -438,8 +438,8 @@ void i386_device::pentium_cmove_r16_rm16() // Opcode 0x0f 44 void i386_device::pentium_cmove_r32_rm32() // Opcode 0x0f 44 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -452,7 +452,7 @@ void i386_device::pentium_cmove_r32_rm32() // Opcode 0x0f 44 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_ZF == 1) { src = READ32(ea); @@ -464,8 +464,8 @@ void i386_device::pentium_cmove_r32_rm32() // Opcode 0x0f 44 void i386_device::pentium_cmovne_r16_rm16() // Opcode 0x0f 45 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -478,7 +478,7 @@ void i386_device::pentium_cmovne_r16_rm16() // Opcode 0x0f 45 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_ZF == 0) { src = READ16(ea); @@ -490,8 +490,8 @@ void i386_device::pentium_cmovne_r16_rm16() // Opcode 0x0f 45 void i386_device::pentium_cmovne_r32_rm32() // Opcode 0x0f 45 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -504,7 +504,7 @@ void i386_device::pentium_cmovne_r32_rm32() // Opcode 0x0f 45 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_ZF == 0) { src = READ32(ea); @@ -516,8 +516,8 @@ void i386_device::pentium_cmovne_r32_rm32() // Opcode 0x0f 45 void i386_device::pentium_cmovbe_r16_rm16() // Opcode 0x0f 46 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -530,7 +530,7 @@ void i386_device::pentium_cmovbe_r16_rm16() // Opcode 0x0f 46 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if ((m_CF == 1) || (m_ZF == 1)) { src = READ16(ea); @@ -542,8 +542,8 @@ void i386_device::pentium_cmovbe_r16_rm16() // Opcode 0x0f 46 void i386_device::pentium_cmovbe_r32_rm32() // Opcode 0x0f 46 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -556,7 +556,7 @@ void i386_device::pentium_cmovbe_r32_rm32() // Opcode 0x0f 46 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if ((m_CF == 1) || (m_ZF == 1)) { src = READ32(ea); @@ -568,8 +568,8 @@ void i386_device::pentium_cmovbe_r32_rm32() // Opcode 0x0f 46 void i386_device::pentium_cmova_r16_rm16() // Opcode 0x0f 47 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -582,7 +582,7 @@ void i386_device::pentium_cmova_r16_rm16() // Opcode 0x0f 47 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if ((m_CF == 0) && (m_ZF == 0)) { src = READ16(ea); @@ -594,8 +594,8 @@ void i386_device::pentium_cmova_r16_rm16() // Opcode 0x0f 47 void i386_device::pentium_cmova_r32_rm32() // Opcode 0x0f 47 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -608,7 +608,7 @@ void i386_device::pentium_cmova_r32_rm32() // Opcode 0x0f 47 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if ((m_CF == 0) && (m_ZF == 0)) { src = READ32(ea); @@ -620,8 +620,8 @@ void i386_device::pentium_cmova_r32_rm32() // Opcode 0x0f 47 void i386_device::pentium_cmovs_r16_rm16() // Opcode 0x0f 48 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -634,7 +634,7 @@ void i386_device::pentium_cmovs_r16_rm16() // Opcode 0x0f 48 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_SF == 1) { src = READ16(ea); @@ -646,8 +646,8 @@ void i386_device::pentium_cmovs_r16_rm16() // Opcode 0x0f 48 void i386_device::pentium_cmovs_r32_rm32() // Opcode 0x0f 48 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -660,7 +660,7 @@ void i386_device::pentium_cmovs_r32_rm32() // Opcode 0x0f 48 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_SF == 1) { src = READ32(ea); @@ -672,8 +672,8 @@ void i386_device::pentium_cmovs_r32_rm32() // Opcode 0x0f 48 void i386_device::pentium_cmovns_r16_rm16() // Opcode 0x0f 49 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -686,7 +686,7 @@ void i386_device::pentium_cmovns_r16_rm16() // Opcode 0x0f 49 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_SF == 0) { src = READ16(ea); @@ -698,8 +698,8 @@ void i386_device::pentium_cmovns_r16_rm16() // Opcode 0x0f 49 void i386_device::pentium_cmovns_r32_rm32() // Opcode 0x0f 49 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -712,7 +712,7 @@ void i386_device::pentium_cmovns_r32_rm32() // Opcode 0x0f 49 } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_SF == 0) { src = READ32(ea); @@ -724,8 +724,8 @@ void i386_device::pentium_cmovns_r32_rm32() // Opcode 0x0f 49 void i386_device::pentium_cmovp_r16_rm16() // Opcode 0x0f 4a { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -738,7 +738,7 @@ void i386_device::pentium_cmovp_r16_rm16() // Opcode 0x0f 4a } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_PF == 1) { src = READ16(ea); @@ -750,8 +750,8 @@ void i386_device::pentium_cmovp_r16_rm16() // Opcode 0x0f 4a void i386_device::pentium_cmovp_r32_rm32() // Opcode 0x0f 4a { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -764,7 +764,7 @@ void i386_device::pentium_cmovp_r32_rm32() // Opcode 0x0f 4a } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_PF == 1) { src = READ32(ea); @@ -776,8 +776,8 @@ void i386_device::pentium_cmovp_r32_rm32() // Opcode 0x0f 4a void i386_device::pentium_cmovnp_r16_rm16() // Opcode 0x0f 4b { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -790,7 +790,7 @@ void i386_device::pentium_cmovnp_r16_rm16() // Opcode 0x0f 4b } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_PF == 0) { src = READ16(ea); @@ -802,8 +802,8 @@ void i386_device::pentium_cmovnp_r16_rm16() // Opcode 0x0f 4b void i386_device::pentium_cmovnp_r32_rm32() // Opcode 0x0f 4b { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -816,7 +816,7 @@ void i386_device::pentium_cmovnp_r32_rm32() // Opcode 0x0f 4b } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_PF == 0) { src = READ32(ea); @@ -828,8 +828,8 @@ void i386_device::pentium_cmovnp_r32_rm32() // Opcode 0x0f 4b void i386_device::pentium_cmovl_r16_rm16() // Opcode 0x0f 4c { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -842,7 +842,7 @@ void i386_device::pentium_cmovl_r16_rm16() // Opcode 0x0f 4c } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_SF != m_OF) { src = READ16(ea); @@ -854,8 +854,8 @@ void i386_device::pentium_cmovl_r16_rm16() // Opcode 0x0f 4c void i386_device::pentium_cmovl_r32_rm32() // Opcode 0x0f 4c { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -868,7 +868,7 @@ void i386_device::pentium_cmovl_r32_rm32() // Opcode 0x0f 4c } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_SF != m_OF) { src = READ32(ea); @@ -880,8 +880,8 @@ void i386_device::pentium_cmovl_r32_rm32() // Opcode 0x0f 4c void i386_device::pentium_cmovge_r16_rm16() // Opcode 0x0f 4d { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -894,7 +894,7 @@ void i386_device::pentium_cmovge_r16_rm16() // Opcode 0x0f 4d } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_SF == m_OF) { src = READ16(ea); @@ -906,8 +906,8 @@ void i386_device::pentium_cmovge_r16_rm16() // Opcode 0x0f 4d void i386_device::pentium_cmovge_r32_rm32() // Opcode 0x0f 4d { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -920,7 +920,7 @@ void i386_device::pentium_cmovge_r32_rm32() // Opcode 0x0f 4d } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if (m_SF == m_OF) { src = READ32(ea); @@ -932,8 +932,8 @@ void i386_device::pentium_cmovge_r32_rm32() // Opcode 0x0f 4d void i386_device::pentium_cmovle_r16_rm16() // Opcode 0x0f 4e { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -946,7 +946,7 @@ void i386_device::pentium_cmovle_r16_rm16() // Opcode 0x0f 4e } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if ((m_ZF == 1) || (m_SF != m_OF)) { src = READ16(ea); @@ -958,8 +958,8 @@ void i386_device::pentium_cmovle_r16_rm16() // Opcode 0x0f 4e void i386_device::pentium_cmovle_r32_rm32() // Opcode 0x0f 4e { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -972,7 +972,7 @@ void i386_device::pentium_cmovle_r32_rm32() // Opcode 0x0f 4e } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if ((m_ZF == 1) || (m_SF != m_OF)) { src = READ32(ea); @@ -984,8 +984,8 @@ void i386_device::pentium_cmovle_r32_rm32() // Opcode 0x0f 4e void i386_device::pentium_cmovg_r16_rm16() // Opcode 0x0f 4f { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -998,7 +998,7 @@ void i386_device::pentium_cmovg_r16_rm16() // Opcode 0x0f 4f } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if ((m_ZF == 0) && (m_SF == m_OF)) { src = READ16(ea); @@ -1010,8 +1010,8 @@ void i386_device::pentium_cmovg_r16_rm16() // Opcode 0x0f 4f void i386_device::pentium_cmovg_r32_rm32() // Opcode 0x0f 4f { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { @@ -1024,7 +1024,7 @@ void i386_device::pentium_cmovg_r32_rm32() // Opcode 0x0f 4f } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); if ((m_ZF == 0) && (m_SF == m_OF)) { src = READ32(ea); @@ -1036,13 +1036,13 @@ void i386_device::pentium_cmovg_r32_rm32() // Opcode 0x0f 4f void i386_device::pentium_movnti_m16_r16() // Opcode 0f c3 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { // since cache is not implemented - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITE16(ea,LOAD_RM16(modrm)); CYCLES(1); // TODO: correct cycle count } @@ -1050,13 +1050,13 @@ void i386_device::pentium_movnti_m16_r16() // Opcode 0f c3 void i386_device::pentium_movnti_m32_r32() // Opcode 0f c3 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { // since cache is not implemented - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITE32(ea,LOAD_RM32(modrm)); CYCLES(1); // TODO: correct cycle count } @@ -1083,22 +1083,22 @@ void i386_device::i386_cyrix_unknown() // Opcode 0x0f 74 void i386_device::pentium_cmpxchg8b_m64() // Opcode 0x0f c7 { - UINT8 modm = FETCH(); + uint8_t modm = FETCH(); if( modm >= 0xc0 ) { report_invalid_modrm("cmpxchg8b_m64", modm); } else { - UINT32 ea = GetEA(modm, 0); - UINT64 value = READ64(ea); - UINT64 edx_eax = (((UINT64) REG32(EDX)) << 32) | REG32(EAX); - UINT64 ecx_ebx = (((UINT64) REG32(ECX)) << 32) | REG32(EBX); + uint32_t ea = GetEA(modm, 0); + uint64_t value = READ64(ea); + uint64_t edx_eax = (((uint64_t) REG32(EDX)) << 32) | REG32(EAX); + uint64_t ecx_ebx = (((uint64_t) REG32(ECX)) << 32) | REG32(EBX); if( value == edx_eax ) { WRITE64(ea, ecx_ebx); m_ZF = 1; CYCLES(CYCLES_CMPXCHG_REG_MEM_T); } else { - REG32(EDX) = (UINT32) (value >> 32); - REG32(EAX) = (UINT32) (value >> 0); + REG32(EDX) = (uint32_t) (value >> 32); + REG32(EAX) = (uint32_t) (value >> 0); m_ZF = 0; CYCLES(CYCLES_CMPXCHG_REG_MEM_F); } @@ -1108,12 +1108,12 @@ void i386_device::pentium_cmpxchg8b_m64() // Opcode 0x0f c7 void i386_device::pentium_movntq_m64_r64() // Opcode 0f e7 { //MMXPROLOG(); // TODO: check if needed - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { CYCLES(1); // unsupported } else { // since cache is not implemented - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEMMX(ea, MMX((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -1122,8 +1122,8 @@ void i386_device::pentium_movntq_m64_r64() // Opcode 0f e7 void i386_device::pentium_maskmovq_r64_r64() // Opcode 0f f7 { int s,m,n; - UINT8 modm = FETCH(); - UINT32 ea = GetEA(7, 0); // ds:di/edi/rdi register + uint8_t modm = FETCH(); + uint32_t ea = GetEA(7, 0); // ds:di/edi/rdi register MMXPROLOG(); s=(modm >> 3) & 7; m=modm & 7; @@ -1135,8 +1135,8 @@ void i386_device::pentium_maskmovq_r64_r64() // Opcode 0f f7 void i386_device::sse_maskmovdqu_r128_r128() // Opcode 66 0f f7 { int s,m,n; - UINT8 modm = FETCH(); - UINT32 ea = GetEA(7, 0); // ds:di/edi/rdi register + uint8_t modm = FETCH(); + uint32_t ea = GetEA(7, 0); // ds:di/edi/rdi register s=(modm >> 3) & 7; m=modm & 7; for (n=0;n < 16;n++) @@ -1146,14 +1146,14 @@ void i386_device::sse_maskmovdqu_r128_r128() // Opcode 66 0f f7 void i386_device::pentium_popcnt_r16_rm16() // Opcode f3 0f b8 { - UINT16 src; - UINT8 modrm = FETCH(); + uint16_t src; + uint8_t modrm = FETCH(); int n,count; if( modrm >= 0xc0 ) { src = LOAD_RM16(modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ16(ea); } count=0; @@ -1167,14 +1167,14 @@ void i386_device::pentium_popcnt_r16_rm16() // Opcode f3 0f b8 void i386_device::pentium_popcnt_r32_rm32() // Opcode f3 0f b8 { - UINT32 src; - UINT8 modrm = FETCH(); + uint32_t src; + uint8_t modrm = FETCH(); int n,count; if( modrm >= 0xc0 ) { src = LOAD_RM32(modrm); } else { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); src = READ32(ea); } count=0; @@ -1200,46 +1200,46 @@ void i386_device::pentium_tzcnt_r32_rm32() // TODO: actually implement TZCNT } -static inline INT8 SaturatedSignedWordToSignedByte(INT16 word) +static inline int8_t SaturatedSignedWordToSignedByte(int16_t word) { if (word > 127) return 127; if (word < -128) return -128; - return (INT8)word; + return (int8_t)word; } -static inline UINT8 SaturatedSignedWordToUnsignedByte(INT16 word) +static inline uint8_t SaturatedSignedWordToUnsignedByte(int16_t word) { if (word > 255) return 255; if (word < 0) return 0; - return (UINT8)word; + return (uint8_t)word; } -static inline INT16 SaturatedSignedDwordToSignedWord(INT32 dword) +static inline int16_t SaturatedSignedDwordToSignedWord(int32_t dword) { if (dword > 32767) return 32767; if (dword < -32768) return -32768; - return (INT16)dword; + return (int16_t)dword; } -static inline UINT16 SaturatedSignedDwordToUnsignedWord(INT32 dword) +static inline uint16_t SaturatedSignedDwordToUnsignedWord(int32_t dword) { if (dword > 65535) return 65535; if (dword < 0) return 0; - return (UINT16)dword; + return (uint16_t)dword; } void i386_device::mmx_group_0f71() // Opcode 0f 71 { - UINT8 modm = FETCH(); - UINT8 imm8 = FETCH(); + uint8_t modm = FETCH(); + uint8_t imm8 = FETCH(); MMXPROLOG(); if( modm >= 0xc0 ) { switch ( (modm & 0x38) >> 3 ) @@ -1270,8 +1270,8 @@ void i386_device::mmx_group_0f71() // Opcode 0f 71 void i386_device::sse_group_660f71() // Opcode 66 0f 71 { - UINT8 modm = FETCH(); - UINT8 imm8 = FETCH(); + uint8_t modm = FETCH(); + uint8_t imm8 = FETCH(); if (modm >= 0xc0) { switch ((modm & 0x38) >> 3) { @@ -1295,8 +1295,8 @@ void i386_device::sse_group_660f71() // Opcode 66 0f 71 void i386_device::mmx_group_0f72() // Opcode 0f 72 { - UINT8 modm = FETCH(); - UINT8 imm8 = FETCH(); + uint8_t modm = FETCH(); + uint8_t imm8 = FETCH(); MMXPROLOG(); if( modm >= 0xc0 ) { switch ( (modm & 0x38) >> 3 ) @@ -1321,8 +1321,8 @@ void i386_device::mmx_group_0f72() // Opcode 0f 72 void i386_device::sse_group_660f72() // Opcode 66 0f 72 { - UINT8 modm = FETCH(); - UINT8 imm8 = FETCH(); + uint8_t modm = FETCH(); + uint8_t imm8 = FETCH(); if (modm >= 0xc0) { switch ((modm & 0x38) >> 3) { @@ -1346,8 +1346,8 @@ void i386_device::sse_group_660f72() // Opcode 66 0f 72 void i386_device::mmx_group_0f73() // Opcode 0f 73 { - UINT8 modm = FETCH(); - UINT8 imm8 = FETCH(); + uint8_t modm = FETCH(); + uint8_t imm8 = FETCH(); MMXPROLOG(); if( modm >= 0xc0 ) { switch ( (modm & 0x38) >> 3 ) @@ -1366,9 +1366,9 @@ void i386_device::mmx_group_0f73() // Opcode 0f 73 void i386_device::sse_group_660f73() // Opcode 66 0f 73 { - UINT64 t0; - UINT8 modm = FETCH(); - UINT8 imm8 = FETCH(); + uint64_t t0; + uint8_t modm = FETCH(); + uint8_t imm8 = FETCH(); if (modm >= 0xc0) { switch ((modm & 0x38) >> 3) { @@ -1428,7 +1428,7 @@ void i386_device::sse_group_660f73() // Opcode 66 0f 73 void i386_device::mmx_psrlw_r64_rm64() // Opcode 0f d1 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)MMX(modrm & 7).q; MMX((modrm >> 3) & 0x7).w[0]=MMX((modrm >> 3) & 0x7).w[0] >> count; @@ -1437,7 +1437,7 @@ void i386_device::mmx_psrlw_r64_rm64() // Opcode 0f d1 MMX((modrm >> 3) & 0x7).w[3]=MMX((modrm >> 3) & 0x7).w[3] >> count; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); int count=(int)src.q; MMX((modrm >> 3) & 0x7).w[0]=MMX((modrm >> 3) & 0x7).w[0] >> count; @@ -1451,14 +1451,14 @@ void i386_device::mmx_psrlw_r64_rm64() // Opcode 0f d1 void i386_device::mmx_psrld_r64_rm64() // Opcode 0f d2 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)MMX(modrm & 7).q; MMX((modrm >> 3) & 0x7).d[0]=MMX((modrm >> 3) & 0x7).d[0] >> count; MMX((modrm >> 3) & 0x7).d[1]=MMX((modrm >> 3) & 0x7).d[1] >> count; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); int count=(int)src.q; MMX((modrm >> 3) & 0x7).d[0]=MMX((modrm >> 3) & 0x7).d[0] >> count; @@ -1470,13 +1470,13 @@ void i386_device::mmx_psrld_r64_rm64() // Opcode 0f d2 void i386_device::mmx_psrlq_r64_rm64() // Opcode 0f d3 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)MMX(modrm & 7).q; MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q >> count; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); int count=(int)src.q; MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q >> count; @@ -1487,12 +1487,12 @@ void i386_device::mmx_psrlq_r64_rm64() // Opcode 0f d3 void i386_device::mmx_paddq_r64_rm64() // Opcode 0f d4 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q+MMX(modrm & 7).q; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q+src.q; } @@ -1502,20 +1502,20 @@ void i386_device::mmx_paddq_r64_rm64() // Opcode 0f d4 void i386_device::mmx_pmullw_r64_rm64() // Opcode 0f d5 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - MMX((modrm >> 3) & 0x7).w[0]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[0]*(INT32)MMX(modrm & 7).s[0]) & 0xffff; - MMX((modrm >> 3) & 0x7).w[1]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[1]*(INT32)MMX(modrm & 7).s[1]) & 0xffff; - MMX((modrm >> 3) & 0x7).w[2]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[2]*(INT32)MMX(modrm & 7).s[2]) & 0xffff; - MMX((modrm >> 3) & 0x7).w[3]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[3]*(INT32)MMX(modrm & 7).s[3]) & 0xffff; + MMX((modrm >> 3) & 0x7).w[0]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[0]*(int32_t)MMX(modrm & 7).s[0]) & 0xffff; + MMX((modrm >> 3) & 0x7).w[1]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[1]*(int32_t)MMX(modrm & 7).s[1]) & 0xffff; + MMX((modrm >> 3) & 0x7).w[2]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[2]*(int32_t)MMX(modrm & 7).s[2]) & 0xffff; + MMX((modrm >> 3) & 0x7).w[3]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[3]*(int32_t)MMX(modrm & 7).s[3]) & 0xffff; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); - MMX((modrm >> 3) & 0x7).w[0]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[0]*(INT32)src.s[0]) & 0xffff; - MMX((modrm >> 3) & 0x7).w[1]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[1]*(INT32)src.s[1]) & 0xffff; - MMX((modrm >> 3) & 0x7).w[2]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[2]*(INT32)src.s[2]) & 0xffff; - MMX((modrm >> 3) & 0x7).w[3]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[3]*(INT32)src.s[3]) & 0xffff; + MMX((modrm >> 3) & 0x7).w[0]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[0]*(int32_t)src.s[0]) & 0xffff; + MMX((modrm >> 3) & 0x7).w[1]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[1]*(int32_t)src.s[1]) & 0xffff; + MMX((modrm >> 3) & 0x7).w[2]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[2]*(int32_t)src.s[2]) & 0xffff; + MMX((modrm >> 3) & 0x7).w[3]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[3]*(int32_t)src.s[3]) & 0xffff; } CYCLES(1); // TODO: correct cycle count } @@ -1524,13 +1524,13 @@ void i386_device::mmx_psubusb_r64_rm64() // Opcode 0f d8 { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n]=MMX((modrm >> 3) & 0x7).b[n] < MMX(modrm & 7).b[n] ? 0 : MMX((modrm >> 3) & 0x7).b[n]-MMX(modrm & 7).b[n]; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n]=MMX((modrm >> 3) & 0x7).b[n] < src.b[n] ? 0 : MMX((modrm >> 3) & 0x7).b[n]-src.b[n]; @@ -1542,13 +1542,13 @@ void i386_device::mmx_psubusw_r64_rm64() // Opcode 0f d9 { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).w[n]=MMX((modrm >> 3) & 0x7).w[n] < MMX(modrm & 7).w[n] ? 0 : MMX((modrm >> 3) & 0x7).w[n]-MMX(modrm & 7).w[n]; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).w[n]=MMX((modrm >> 3) & 0x7).w[n] < src.w[n] ? 0 : MMX((modrm >> 3) & 0x7).w[n]-src.w[n]; @@ -1559,12 +1559,12 @@ void i386_device::mmx_psubusw_r64_rm64() // Opcode 0f d9 void i386_device::mmx_pand_r64_rm64() // Opcode 0f db { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q & MMX(modrm & 7).q; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q & src.q; } @@ -1575,13 +1575,13 @@ void i386_device::mmx_paddusb_r64_rm64() // Opcode 0f dc { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n]=MMX((modrm >> 3) & 0x7).b[n] > (0xff-MMX(modrm & 7).b[n]) ? 0xff : MMX((modrm >> 3) & 0x7).b[n]+MMX(modrm & 7).b[n]; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n]=MMX((modrm >> 3) & 0x7).b[n] > (0xff-src.b[n]) ? 0xff : MMX((modrm >> 3) & 0x7).b[n]+src.b[n]; @@ -1593,13 +1593,13 @@ void i386_device::mmx_paddusw_r64_rm64() // Opcode 0f dd { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).w[n]=MMX((modrm >> 3) & 0x7).w[n] > (0xffff-MMX(modrm & 7).w[n]) ? 0xffff : MMX((modrm >> 3) & 0x7).w[n]+MMX(modrm & 7).w[n]; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).w[n]=MMX((modrm >> 3) & 0x7).w[n] > (0xffff-src.w[n]) ? 0xffff : MMX((modrm >> 3) & 0x7).w[n]+src.w[n]; @@ -1610,12 +1610,12 @@ void i386_device::mmx_paddusw_r64_rm64() // Opcode 0f dd void i386_device::mmx_pandn_r64_rm64() // Opcode 0f df { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).q=(~MMX((modrm >> 3) & 0x7).q) & MMX(modrm & 7).q; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); MMX((modrm >> 3) & 0x7).q=(~MMX((modrm >> 3) & 0x7).q) & src.q; } @@ -1625,7 +1625,7 @@ void i386_device::mmx_pandn_r64_rm64() // Opcode 0f df void i386_device::mmx_psraw_r64_rm64() // Opcode 0f e1 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)MMX(modrm & 7).q; MMX((modrm >> 3) & 0x7).s[0]=MMX((modrm >> 3) & 0x7).s[0] >> count; @@ -1634,7 +1634,7 @@ void i386_device::mmx_psraw_r64_rm64() // Opcode 0f e1 MMX((modrm >> 3) & 0x7).s[3]=MMX((modrm >> 3) & 0x7).s[3] >> count; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); int count=(int)src.q; MMX((modrm >> 3) & 0x7).s[0]=MMX((modrm >> 3) & 0x7).s[0] >> count; @@ -1648,14 +1648,14 @@ void i386_device::mmx_psraw_r64_rm64() // Opcode 0f e1 void i386_device::mmx_psrad_r64_rm64() // Opcode 0f e2 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)MMX(modrm & 7).q; MMX((modrm >> 3) & 0x7).i[0]=MMX((modrm >> 3) & 0x7).i[0] >> count; MMX((modrm >> 3) & 0x7).i[1]=MMX((modrm >> 3) & 0x7).i[1] >> count; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); int count=(int)src.q; MMX((modrm >> 3) & 0x7).i[0]=MMX((modrm >> 3) & 0x7).i[0] >> count; @@ -1667,20 +1667,20 @@ void i386_device::mmx_psrad_r64_rm64() // Opcode 0f e2 void i386_device::mmx_pmulhw_r64_rm64() // Opcode 0f e5 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - MMX((modrm >> 3) & 0x7).w[0]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[0]*(INT32)MMX(modrm & 7).s[0]) >> 16; - MMX((modrm >> 3) & 0x7).w[1]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[1]*(INT32)MMX(modrm & 7).s[1]) >> 16; - MMX((modrm >> 3) & 0x7).w[2]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[2]*(INT32)MMX(modrm & 7).s[2]) >> 16; - MMX((modrm >> 3) & 0x7).w[3]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[3]*(INT32)MMX(modrm & 7).s[3]) >> 16; + MMX((modrm >> 3) & 0x7).w[0]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[0]*(int32_t)MMX(modrm & 7).s[0]) >> 16; + MMX((modrm >> 3) & 0x7).w[1]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[1]*(int32_t)MMX(modrm & 7).s[1]) >> 16; + MMX((modrm >> 3) & 0x7).w[2]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[2]*(int32_t)MMX(modrm & 7).s[2]) >> 16; + MMX((modrm >> 3) & 0x7).w[3]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[3]*(int32_t)MMX(modrm & 7).s[3]) >> 16; } else { MMX_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, src); - MMX((modrm >> 3) & 0x7).w[0]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[0]*(INT32)src.s[0]) >> 16; - MMX((modrm >> 3) & 0x7).w[1]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[1]*(INT32)src.s[1]) >> 16; - MMX((modrm >> 3) & 0x7).w[2]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[2]*(INT32)src.s[2]) >> 16; - MMX((modrm >> 3) & 0x7).w[3]=(UINT32)((INT32)MMX((modrm >> 3) & 0x7).s[3]*(INT32)src.s[3]) >> 16; + MMX((modrm >> 3) & 0x7).w[0]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[0]*(int32_t)src.s[0]) >> 16; + MMX((modrm >> 3) & 0x7).w[1]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[1]*(int32_t)src.s[1]) >> 16; + MMX((modrm >> 3) & 0x7).w[2]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[2]*(int32_t)src.s[2]) >> 16; + MMX((modrm >> 3) & 0x7).w[3]=(uint32_t)((int32_t)MMX((modrm >> 3) & 0x7).s[3]*(int32_t)src.s[3]) >> 16; } CYCLES(1); // TODO: correct cycle count } @@ -1689,16 +1689,16 @@ void i386_device::mmx_psubsb_r64_rm64() // Opcode 0f e8 { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 8;n++) - MMX((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((INT16)MMX((modrm >> 3) & 0x7).c[n] - (INT16)MMX(modrm & 7).c[n]); + MMX((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)MMX((modrm >> 3) & 0x7).c[n] - (int16_t)MMX(modrm & 7).c[n]); } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 8;n++) - MMX((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((INT16)MMX((modrm >> 3) & 0x7).c[n] - (INT16)s.c[n]); + MMX((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)MMX((modrm >> 3) & 0x7).c[n] - (int16_t)s.c[n]); } CYCLES(1); // TODO: correct cycle count } @@ -1707,16 +1707,16 @@ void i386_device::mmx_psubsw_r64_rm64() // Opcode 0f e9 { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 4;n++) - MMX((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((INT32)MMX((modrm >> 3) & 0x7).s[n] - (INT32)MMX(modrm & 7).s[n]); + MMX((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)MMX((modrm >> 3) & 0x7).s[n] - (int32_t)MMX(modrm & 7).s[n]); } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 4;n++) - MMX((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((INT32)MMX((modrm >> 3) & 0x7).s[n] - (INT32)s.s[n]); + MMX((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)MMX((modrm >> 3) & 0x7).s[n] - (int32_t)s.s[n]); } CYCLES(1); // TODO: correct cycle count } @@ -1724,12 +1724,12 @@ void i386_device::mmx_psubsw_r64_rm64() // Opcode 0f e9 void i386_device::mmx_por_r64_rm64() // Opcode 0f eb { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q | MMX(modrm & 7).q; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q | s.q; } @@ -1740,16 +1740,16 @@ void i386_device::mmx_paddsb_r64_rm64() // Opcode 0f ec { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 8;n++) - MMX((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((INT16)MMX((modrm >> 3) & 0x7).c[n] + (INT16)MMX(modrm & 7).c[n]); + MMX((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)MMX((modrm >> 3) & 0x7).c[n] + (int16_t)MMX(modrm & 7).c[n]); } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 8;n++) - MMX((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((INT16)MMX((modrm >> 3) & 0x7).c[n] + (INT16)s.c[n]); + MMX((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)MMX((modrm >> 3) & 0x7).c[n] + (int16_t)s.c[n]); } CYCLES(1); // TODO: correct cycle count } @@ -1758,16 +1758,16 @@ void i386_device::mmx_paddsw_r64_rm64() // Opcode 0f ed { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 4;n++) - MMX((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((INT32)MMX((modrm >> 3) & 0x7).s[n] + (INT32)MMX(modrm & 7).s[n]); + MMX((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)MMX((modrm >> 3) & 0x7).s[n] + (int32_t)MMX(modrm & 7).s[n]); } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 4;n++) - MMX((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((INT32)MMX((modrm >> 3) & 0x7).s[n] + (INT32)s.s[n]); + MMX((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)MMX((modrm >> 3) & 0x7).s[n] + (int32_t)s.s[n]); } CYCLES(1); // TODO: correct cycle count } @@ -1775,12 +1775,12 @@ void i386_device::mmx_paddsw_r64_rm64() // Opcode 0f ed void i386_device::mmx_pxor_r64_rm64() // Opcode 0f ef { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q ^ MMX(modrm & 7).q; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q ^ s.q; } @@ -1790,7 +1790,7 @@ void i386_device::mmx_pxor_r64_rm64() // Opcode 0f ef void i386_device::mmx_psllw_r64_rm64() // Opcode 0f f1 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)MMX(modrm & 7).q; MMX((modrm >> 3) & 0x7).w[0]=MMX((modrm >> 3) & 0x7).w[0] << count; @@ -1799,7 +1799,7 @@ void i386_device::mmx_psllw_r64_rm64() // Opcode 0f f1 MMX((modrm >> 3) & 0x7).w[3]=MMX((modrm >> 3) & 0x7).w[3] << count; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); int count=(int)s.q; MMX((modrm >> 3) & 0x7).w[0]=MMX((modrm >> 3) & 0x7).w[0] << count; @@ -1813,14 +1813,14 @@ void i386_device::mmx_psllw_r64_rm64() // Opcode 0f f1 void i386_device::mmx_pslld_r64_rm64() // Opcode 0f f2 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)MMX(modrm & 7).q; MMX((modrm >> 3) & 0x7).d[0]=MMX((modrm >> 3) & 0x7).d[0] << count; MMX((modrm >> 3) & 0x7).d[1]=MMX((modrm >> 3) & 0x7).d[1] << count; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); int count=(int)s.q; MMX((modrm >> 3) & 0x7).d[0]=MMX((modrm >> 3) & 0x7).d[0] << count; @@ -1832,13 +1832,13 @@ void i386_device::mmx_pslld_r64_rm64() // Opcode 0f f2 void i386_device::mmx_psllq_r64_rm64() // Opcode 0f f3 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)MMX(modrm & 7).q; MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q << count; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); int count=(int)s.q; MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q << count; @@ -1849,20 +1849,20 @@ void i386_device::mmx_psllq_r64_rm64() // Opcode 0f f3 void i386_device::mmx_pmaddwd_r64_rm64() // Opcode 0f f5 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - MMX((modrm >> 3) & 0x7).i[0]=(INT32)MMX((modrm >> 3) & 0x7).s[0]*(INT32)MMX(modrm & 7).s[0]+ - (INT32)MMX((modrm >> 3) & 0x7).s[1]*(INT32)MMX(modrm & 7).s[1]; - MMX((modrm >> 3) & 0x7).i[1]=(INT32)MMX((modrm >> 3) & 0x7).s[2]*(INT32)MMX(modrm & 7).s[2]+ - (INT32)MMX((modrm >> 3) & 0x7).s[3]*(INT32)MMX(modrm & 7).s[3]; + MMX((modrm >> 3) & 0x7).i[0]=(int32_t)MMX((modrm >> 3) & 0x7).s[0]*(int32_t)MMX(modrm & 7).s[0]+ + (int32_t)MMX((modrm >> 3) & 0x7).s[1]*(int32_t)MMX(modrm & 7).s[1]; + MMX((modrm >> 3) & 0x7).i[1]=(int32_t)MMX((modrm >> 3) & 0x7).s[2]*(int32_t)MMX(modrm & 7).s[2]+ + (int32_t)MMX((modrm >> 3) & 0x7).s[3]*(int32_t)MMX(modrm & 7).s[3]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); - MMX((modrm >> 3) & 0x7).i[0]=(INT32)MMX((modrm >> 3) & 0x7).s[0]*(INT32)s.s[0]+ - (INT32)MMX((modrm >> 3) & 0x7).s[1]*(INT32)s.s[1]; - MMX((modrm >> 3) & 0x7).i[1]=(INT32)MMX((modrm >> 3) & 0x7).s[2]*(INT32)s.s[2]+ - (INT32)MMX((modrm >> 3) & 0x7).s[3]*(INT32)s.s[3]; + MMX((modrm >> 3) & 0x7).i[0]=(int32_t)MMX((modrm >> 3) & 0x7).s[0]*(int32_t)s.s[0]+ + (int32_t)MMX((modrm >> 3) & 0x7).s[1]*(int32_t)s.s[1]; + MMX((modrm >> 3) & 0x7).i[1]=(int32_t)MMX((modrm >> 3) & 0x7).s[2]*(int32_t)s.s[2]+ + (int32_t)MMX((modrm >> 3) & 0x7).s[3]*(int32_t)s.s[3]; } CYCLES(1); // TODO: correct cycle count } @@ -1871,13 +1871,13 @@ void i386_device::mmx_psubb_r64_rm64() // Opcode 0f f8 { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n]=MMX((modrm >> 3) & 0x7).b[n] - MMX(modrm & 7).b[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n]=MMX((modrm >> 3) & 0x7).b[n] - s.b[n]; @@ -1889,13 +1889,13 @@ void i386_device::mmx_psubw_r64_rm64() // Opcode 0f f9 { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).w[n]=MMX((modrm >> 3) & 0x7).w[n] - MMX(modrm & 7).w[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).w[n]=MMX((modrm >> 3) & 0x7).w[n] - s.w[n]; @@ -1907,13 +1907,13 @@ void i386_device::mmx_psubd_r64_rm64() // Opcode 0f fa { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 2;n++) MMX((modrm >> 3) & 0x7).d[n]=MMX((modrm >> 3) & 0x7).d[n] - MMX(modrm & 7).d[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 2;n++) MMX((modrm >> 3) & 0x7).d[n]=MMX((modrm >> 3) & 0x7).d[n] - s.d[n]; @@ -1925,13 +1925,13 @@ void i386_device::mmx_paddb_r64_rm64() // Opcode 0f fc { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n]=MMX((modrm >> 3) & 0x7).b[n] + MMX(modrm & 7).b[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n]=MMX((modrm >> 3) & 0x7).b[n] + s.b[n]; @@ -1943,13 +1943,13 @@ void i386_device::mmx_paddw_r64_rm64() // Opcode 0f fd { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).w[n]=MMX((modrm >> 3) & 0x7).w[n] + MMX(modrm & 7).w[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).w[n]=MMX((modrm >> 3) & 0x7).w[n] + s.w[n]; @@ -1961,13 +1961,13 @@ void i386_device::mmx_paddd_r64_rm64() // Opcode 0f fe { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 2;n++) MMX((modrm >> 3) & 0x7).d[n]=MMX((modrm >> 3) & 0x7).d[n] + MMX(modrm & 7).d[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 2;n++) MMX((modrm >> 3) & 0x7).d[n]=MMX((modrm >> 3) & 0x7).d[n] + s.d[n]; @@ -1984,10 +1984,10 @@ void i386_device::mmx_emms() // Opcode 0f 77 void i386_device::i386_cyrix_svdc() // Opcode 0f 78 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm < 0xc0 ) { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); int index = (modrm >> 3) & 7; int limit; switch (index) @@ -2048,14 +2048,14 @@ void i386_device::i386_cyrix_svdc() // Opcode 0f 78 void i386_device::i386_cyrix_rsdc() // Opcode 0f 79 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm < 0xc0 ) { - UINT32 ea = GetEA(modrm,0); + uint32_t ea = GetEA(modrm,0); int index = (modrm >> 3) & 7; - UINT16 flags; - UINT32 base; - UINT32 limit; + uint16_t flags; + uint32_t base; + uint32_t limit; switch (index) { case 0: @@ -2117,11 +2117,11 @@ void i386_device::i386_cyrix_svldt() // Opcode 0f 7a { if ( PROTECTED_MODE && !V8086_MODE ) { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( !(modrm & 0xf8) ) { - UINT32 ea = GetEA(modrm,0); - UINT32 limit = m_ldtr.limit; + uint32_t ea = GetEA(modrm,0); + uint32_t limit = m_ldtr.limit; if (m_ldtr.flags & 0x8000) //G bit { @@ -2149,13 +2149,13 @@ void i386_device::i386_cyrix_rsldt() // Opcode 0f 7b if(m_CPL) FAULT(FAULT_GP,0) - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( !(modrm & 0xf8) ) { - UINT32 ea = GetEA(modrm,0); - UINT16 flags = READ16(ea + 5); - UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); - UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16); + uint32_t ea = GetEA(modrm,0); + uint16_t flags = READ16(ea + 5); + uint32_t base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); + uint32_t limit = READ16(ea + 0) | ((flags & 3) << 16); I386_SREG seg; if (flags & 0x8000) //G bit @@ -2182,11 +2182,11 @@ void i386_device::i386_cyrix_svts() // Opcode 0f 7c { if ( PROTECTED_MODE ) { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( !(modrm & 0xf8) ) { - UINT32 ea = GetEA(modrm,0); - UINT32 limit = m_task.limit; + uint32_t ea = GetEA(modrm,0); + uint32_t limit = m_task.limit; if (m_task.flags & 0x8000) //G bit { @@ -2213,13 +2213,13 @@ void i386_device::i386_cyrix_rsts() // Opcode 0f 7d if(m_CPL) FAULT(FAULT_GP,0) - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( !(modrm & 0xf8) ) { - UINT32 ea = GetEA(modrm,0); - UINT16 flags = READ16(ea + 5); - UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); - UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16); + uint32_t ea = GetEA(modrm,0); + uint16_t flags = READ16(ea + 5); + uint32_t base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); + uint32_t limit = READ16(ea + 0) | ((flags & 3) << 16); if (flags & 0x8000) //G bit { @@ -2241,11 +2241,11 @@ void i386_device::i386_cyrix_rsts() // Opcode 0f 7d void i386_device::mmx_movd_r64_rm32() // Opcode 0f 6e { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).d[0]=LOAD_RM32(modrm); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); MMX((modrm >> 3) & 0x7).d[0]=READ32(ea); } MMX((modrm >> 3) & 0x7).d[1]=0; @@ -2255,11 +2255,11 @@ void i386_device::mmx_movd_r64_rm32() // Opcode 0f 6e void i386_device::mmx_movq_r64_rm64() // Opcode 0f 6f { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).l=MMX(modrm & 0x7).l; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, MMX((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -2268,11 +2268,11 @@ void i386_device::mmx_movq_r64_rm64() // Opcode 0f 6f void i386_device::mmx_movd_rm32_r64() // Opcode 0f 7e { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { STORE_RM32(modrm, MMX((modrm >> 3) & 0x7).d[0]); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITE32(ea, MMX((modrm >> 3) & 0x7).d[0]); } CYCLES(1); // TODO: correct cycle count @@ -2281,11 +2281,11 @@ void i386_device::mmx_movd_rm32_r64() // Opcode 0f 7e void i386_device::mmx_movq_rm64_r64() // Opcode 0f 7f { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX(modrm & 0x7)=MMX((modrm >> 3) & 0x7); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEMMX(ea, MMX((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -2295,7 +2295,7 @@ void i386_device::mmx_pcmpeqb_r64_rm64() // Opcode 0f 74 { int c; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2305,7 +2305,7 @@ void i386_device::mmx_pcmpeqb_r64_rm64() // Opcode 0f 74 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (c=0;c <= 7;c++) MMX(d).b[c]=(MMX(d).b[c] == s.b[c]) ? 0xff : 0; @@ -2316,7 +2316,7 @@ void i386_device::mmx_pcmpeqb_r64_rm64() // Opcode 0f 74 void i386_device::mmx_pcmpeqw_r64_rm64() // Opcode 0f 75 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2328,7 +2328,7 @@ void i386_device::mmx_pcmpeqw_r64_rm64() // Opcode 0f 75 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); MMX(d).w[0]=(MMX(d).w[0] == s.w[0]) ? 0xffff : 0; MMX(d).w[1]=(MMX(d).w[1] == s.w[1]) ? 0xffff : 0; @@ -2341,7 +2341,7 @@ void i386_device::mmx_pcmpeqw_r64_rm64() // Opcode 0f 75 void i386_device::mmx_pcmpeqd_r64_rm64() // Opcode 0f 76 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2351,7 +2351,7 @@ void i386_device::mmx_pcmpeqd_r64_rm64() // Opcode 0f 76 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); MMX(d).d[0]=(MMX(d).d[0] == s.d[0]) ? 0xffffffff : 0; MMX(d).d[1]=(MMX(d).d[1] == s.d[1]) ? 0xffffffff : 0; @@ -2362,11 +2362,11 @@ void i386_device::mmx_pcmpeqd_r64_rm64() // Opcode 0f 76 void i386_device::mmx_pshufw_r64_rm64_i8() // Opcode 0f 70 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX_REG t; int s,d; - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); s=modrm & 0x7; d=(modrm >> 3) & 0x7; t.q=MMX(s).q; @@ -2377,8 +2377,8 @@ void i386_device::mmx_pshufw_r64_rm64_i8() // Opcode 0f 70 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); READMMX(ea, s); MMX(d).w[0]=s.w[imm8 & 3]; MMX(d).w[1]=s.w[(imm8 >> 2) & 3]; @@ -2390,7 +2390,7 @@ void i386_device::mmx_pshufw_r64_rm64_i8() // Opcode 0f 70 void i386_device::sse_punpcklbw_r128_rm128() // Opcode 66 0f 60 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { XMM_REG xd,xs; int s, d; @@ -2418,7 +2418,7 @@ void i386_device::sse_punpcklbw_r128_rm128() // Opcode 66 0f 60 else { XMM_REG xd, xs; int d = (modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); xd.l[0] = XMM(d).l[0]; xs.q[0] = READ64(ea); for (int n = 0; n < 8; n++) { @@ -2431,7 +2431,7 @@ void i386_device::sse_punpcklbw_r128_rm128() // Opcode 66 0f 60 void i386_device::sse_punpcklwd_r128_rm128() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { XMM_REG xd, xs; int s, d; @@ -2447,7 +2447,7 @@ void i386_device::sse_punpcklwd_r128_rm128() else { XMM_REG xd, xs; int d = (modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); xd.l[0] = XMM(d).l[0]; xs.q[0] = READ64(ea); for (int n = 0; n < 4; n++) { @@ -2460,7 +2460,7 @@ void i386_device::sse_punpcklwd_r128_rm128() void i386_device::sse_punpckldq_r128_rm128() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { XMM_REG xd, xs; int s, d; @@ -2476,7 +2476,7 @@ void i386_device::sse_punpckldq_r128_rm128() else { XMM_REG xd, xs; int d = (modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); xd.l[0] = XMM(d).l[0]; xs.q[0] = READ64(ea); for (int n = 0; n < 2; n++) { @@ -2489,7 +2489,7 @@ void i386_device::sse_punpckldq_r128_rm128() void i386_device::sse_punpcklqdq_r128_rm128() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { XMM_REG xd, xs; int s, d; @@ -2503,7 +2503,7 @@ void i386_device::sse_punpcklqdq_r128_rm128() else { XMM_REG xd, xs; int d = (modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); xd.l[0] = XMM(d).l[0]; xs.q[0] = READ64(ea); XMM(d).q[0] = xd.q[0]; @@ -2515,9 +2515,9 @@ void i386_device::sse_punpcklqdq_r128_rm128() void i386_device::mmx_punpcklbw_r64_r64m32() // Opcode 0f 60 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 t; + uint32_t t; int s,d; s=modrm & 0x7; d=(modrm >> 3) & 0x7; @@ -2531,9 +2531,9 @@ void i386_device::mmx_punpcklbw_r64_r64m32() // Opcode 0f 60 MMX(d).b[6]=(t >> 24) & 0xff; MMX(d).b[7]=MMX(s).b[3]; } else { - UINT32 s,t; + uint32_t s,t; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); s = READ32(ea); t=MMX(d).d[0]; MMX(d).b[0]=t & 0xff; @@ -2551,9 +2551,9 @@ void i386_device::mmx_punpcklbw_r64_r64m32() // Opcode 0f 60 void i386_device::mmx_punpcklwd_r64_r64m32() // Opcode 0f 61 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT16 t; + uint16_t t; int s,d; s=modrm & 0x7; d=(modrm >> 3) & 0x7; @@ -2563,10 +2563,10 @@ void i386_device::mmx_punpcklwd_r64_r64m32() // Opcode 0f 61 MMX(d).w[2]=t; MMX(d).w[3]=MMX(s).w[1]; } else { - UINT32 s; - UINT16 t; + uint32_t s; + uint16_t t; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); s = READ32(ea); t=MMX(d).w[1]; MMX(d).w[0]=MMX(d).w[0]; @@ -2580,7 +2580,7 @@ void i386_device::mmx_punpcklwd_r64_r64m32() // Opcode 0f 61 void i386_device::mmx_punpckldq_r64_r64m32() // Opcode 0f 62 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2588,9 +2588,9 @@ void i386_device::mmx_punpckldq_r64_r64m32() // Opcode 0f 62 MMX(d).d[0]=MMX(d).d[0]; MMX(d).d[1]=MMX(s).d[0]; } else { - UINT32 s; + uint32_t s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); s = READ32(ea); MMX(d).d[0]=MMX(d).d[0]; MMX(d).d[1]=s; @@ -2601,7 +2601,7 @@ void i386_device::mmx_punpckldq_r64_r64m32() // Opcode 0f 62 void i386_device::mmx_packsswb_r64_rm64() // Opcode 0f 63 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2617,7 +2617,7 @@ void i386_device::mmx_packsswb_r64_rm64() // Opcode 0f 63 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); MMX(d).c[0]=SaturatedSignedWordToSignedByte(MMX(d).s[0]); MMX(d).c[1]=SaturatedSignedWordToSignedByte(MMX(d).s[1]); @@ -2635,7 +2635,7 @@ void i386_device::mmx_pcmpgtb_r64_rm64() // Opcode 0f 64 { int c; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2645,7 +2645,7 @@ void i386_device::mmx_pcmpgtb_r64_rm64() // Opcode 0f 64 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (c=0;c <= 7;c++) MMX(d).b[c]=(MMX(d).c[c] > s.c[c]) ? 0xff : 0; @@ -2657,7 +2657,7 @@ void i386_device::mmx_pcmpgtw_r64_rm64() // Opcode 0f 65 { int c; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2667,7 +2667,7 @@ void i386_device::mmx_pcmpgtw_r64_rm64() // Opcode 0f 65 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (c=0;c <= 3;c++) MMX(d).w[c]=(MMX(d).s[c] > s.s[c]) ? 0xffff : 0; @@ -2679,7 +2679,7 @@ void i386_device::mmx_pcmpgtd_r64_rm64() // Opcode 0f 66 { int c; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2689,7 +2689,7 @@ void i386_device::mmx_pcmpgtd_r64_rm64() // Opcode 0f 66 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (c=0;c <= 1;c++) MMX(d).d[c]=(MMX(d).i[c] > s.i[c]) ? 0xffffffff : 0; @@ -2700,7 +2700,7 @@ void i386_device::mmx_pcmpgtd_r64_rm64() // Opcode 0f 66 void i386_device::mmx_packuswb_r64_rm64() // Opcode 0f 67 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX_REG ds, sd; int s,d; @@ -2719,7 +2719,7 @@ void i386_device::mmx_packuswb_r64_rm64() // Opcode 0f 67 } else { MMX_REG s,t; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); t.q = MMX(d).q; MMX(d).b[0]=SaturatedSignedWordToUnsignedByte(t.s[0]); @@ -2737,7 +2737,7 @@ void i386_device::mmx_packuswb_r64_rm64() // Opcode 0f 67 void i386_device::mmx_punpckhbw_r64_rm64() // Opcode 0f 68 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2753,7 +2753,7 @@ void i386_device::mmx_punpckhbw_r64_rm64() // Opcode 0f 68 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); MMX(d).b[0]=MMX(d).b[4]; MMX(d).b[1]=s.b[4]; @@ -2770,7 +2770,7 @@ void i386_device::mmx_punpckhbw_r64_rm64() // Opcode 0f 68 void i386_device::mmx_punpckhwd_r64_rm64() // Opcode 0f 69 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2782,7 +2782,7 @@ void i386_device::mmx_punpckhwd_r64_rm64() // Opcode 0f 69 } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); MMX(d).w[0]=MMX(d).w[2]; MMX(d).w[1]=s.w[2]; @@ -2795,7 +2795,7 @@ void i386_device::mmx_punpckhwd_r64_rm64() // Opcode 0f 69 void i386_device::mmx_punpckhdq_r64_rm64() // Opcode 0f 6a { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -2805,7 +2805,7 @@ void i386_device::mmx_punpckhdq_r64_rm64() // Opcode 0f 6a } else { MMX_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); MMX(d).d[0]=MMX(d).d[1]; MMX(d).d[1]=s.d[1]; @@ -2816,10 +2816,10 @@ void i386_device::mmx_punpckhdq_r64_rm64() // Opcode 0f 6a void i386_device::mmx_packssdw_r64_rm64() // Opcode 0f 6b { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; - INT32 t1, t2, t3, t4; + int32_t t1, t2, t3, t4; s=modrm & 0x7; d=(modrm >> 3) & 0x7; t1 = MMX(d).i[0]; @@ -2833,9 +2833,9 @@ void i386_device::mmx_packssdw_r64_rm64() // Opcode 0f 6b } else { MMX_REG s; - INT32 t1, t2; + int32_t t1, t2; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); t1 = MMX(d).i[0]; t2 = MMX(d).i[1]; @@ -2849,7 +2849,7 @@ void i386_device::mmx_packssdw_r64_rm64() // Opcode 0f 6b void i386_device::sse_group_0fae() // Opcode 0f ae { - UINT8 modm = FETCH(); + uint8_t modm = FETCH(); if( modm == 0xf8 ) { logerror("Unemulated SFENCE opcode called\n"); CYCLES(1); // sfence instruction @@ -2858,7 +2858,7 @@ void i386_device::sse_group_0fae() // Opcode 0f ae } else if( modm == 0xe8 ) { CYCLES(1); // lfence instruction } else if( modm < 0xc0 ) { - UINT32 ea; + uint32_t ea; switch ( (modm & 0x38) >> 3 ) { case 2: // ldmxcsr m32 @@ -2882,32 +2882,32 @@ void i386_device::sse_group_0fae() // Opcode 0f ae void i386_device::sse_cvttps2dq_r128_rm128() // Opcode f3 0f 5b { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - XMM((modrm >> 3) & 0x7).i[0]=(INT32)XMM(modrm & 0x7).f[0]; - XMM((modrm >> 3) & 0x7).i[1]=(INT32)XMM(modrm & 0x7).f[1]; - XMM((modrm >> 3) & 0x7).i[2]=(INT32)XMM(modrm & 0x7).f[2]; - XMM((modrm >> 3) & 0x7).i[3]=(INT32)XMM(modrm & 0x7).f[3]; + XMM((modrm >> 3) & 0x7).i[0]=(int32_t)XMM(modrm & 0x7).f[0]; + XMM((modrm >> 3) & 0x7).i[1]=(int32_t)XMM(modrm & 0x7).f[1]; + XMM((modrm >> 3) & 0x7).i[2]=(int32_t)XMM(modrm & 0x7).f[2]; + XMM((modrm >> 3) & 0x7).i[3]=(int32_t)XMM(modrm & 0x7).f[3]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); - XMM((modrm >> 3) & 0x7).i[0]=(INT32)src.f[0]; - XMM((modrm >> 3) & 0x7).i[1]=(INT32)src.f[1]; - XMM((modrm >> 3) & 0x7).i[2]=(INT32)src.f[2]; - XMM((modrm >> 3) & 0x7).i[3]=(INT32)src.f[3]; + XMM((modrm >> 3) & 0x7).i[0]=(int32_t)src.f[0]; + XMM((modrm >> 3) & 0x7).i[1]=(int32_t)src.f[1]; + XMM((modrm >> 3) & 0x7).i[2]=(int32_t)src.f[2]; + XMM((modrm >> 3) & 0x7).i[3]=(int32_t)src.f[3]; } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_cvtss2sd_r128_r128m32() // Opcode f3 0f 5a { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM(modrm & 0x7).f[0]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); s.d[0] = READ32(ea); XMM((modrm >> 3) & 0x7).f64[0] = s.f[0]; } @@ -2916,58 +2916,58 @@ void i386_device::sse_cvtss2sd_r128_r128m32() // Opcode f3 0f 5a void i386_device::sse_cvttss2si_r32_r128m32() // Opcode f3 0f 2c { - INT32 src; - UINT8 modrm = FETCH(); // get mordm byte + int32_t src; + uint8_t modrm = FETCH(); // get mordm byte if( modrm >= 0xc0 ) { // if bits 7-6 are 11 the source is a xmm register (low doubleword) - src = (INT32)XMM(modrm & 0x7).f[0^NATIVE_ENDIAN_VALUE_LE_BE(0,1)]; + src = (int32_t)XMM(modrm & 0x7).f[0^NATIVE_ENDIAN_VALUE_LE_BE(0,1)]; } else { // otherwise is a memory address XMM_REG t; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); t.d[0] = READ32(ea); - src = (INT32)t.f[0]; + src = (int32_t)t.f[0]; } - STORE_REG32(modrm, (UINT32)src); + STORE_REG32(modrm, (uint32_t)src); CYCLES(1); // TODO: correct cycle count } void i386_device::sse_cvtss2si_r32_r128m32() // Opcode f3 0f 2d { - INT32 src; - UINT8 modrm = FETCH(); + int32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - src = (INT32)XMM(modrm & 0x7).f[0]; + src = (int32_t)XMM(modrm & 0x7).f[0]; } else { XMM_REG t; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); t.d[0] = READ32(ea); - src = (INT32)t.f[0]; + src = (int32_t)t.f[0]; } - STORE_REG32(modrm, (UINT32)src); + STORE_REG32(modrm, (uint32_t)src); CYCLES(1); // TODO: correct cycle count } void i386_device::sse_cvtsi2ss_r128_rm32() // Opcode f3 0f 2a { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - XMM((modrm >> 3) & 0x7).f[0] = (INT32)LOAD_RM32(modrm); + XMM((modrm >> 3) & 0x7).f[0] = (int32_t)LOAD_RM32(modrm); } else { - UINT32 ea = GetEA(modrm, 0); - XMM((modrm >> 3) & 0x7).f[0] = (INT32)READ32(ea); + uint32_t ea = GetEA(modrm, 0); + XMM((modrm >> 3) & 0x7).f[0] = (int32_t)READ32(ea); } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_cvtpi2ps_r128_rm64() // Opcode 0f 2a { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); MMXPROLOG(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = (float)MMX(modrm & 0x7).i[0]; XMM((modrm >> 3) & 0x7).f[1] = (float)MMX(modrm & 0x7).i[1]; } else { MMX_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, r); XMM((modrm >> 3) & 0x7).f[0] = (float)r.i[0]; XMM((modrm >> 3) & 0x7).f[1] = (float)r.i[1]; @@ -2977,14 +2977,14 @@ void i386_device::sse_cvtpi2ps_r128_rm64() // Opcode 0f 2a void i386_device::sse_cvttps2pi_r64_r128m64() // Opcode 0f 2c { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); MMXPROLOG(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).i[0] = XMM(modrm & 0x7).f[0]; MMX((modrm >> 3) & 0x7).i[1] = XMM(modrm & 0x7).f[1]; } else { XMM_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, r); XMM((modrm >> 3) & 0x7).i[0] = r.f[0]; XMM((modrm >> 3) & 0x7).i[1] = r.f[1]; @@ -2994,14 +2994,14 @@ void i386_device::sse_cvttps2pi_r64_r128m64() // Opcode 0f 2c void i386_device::sse_cvtps2pi_r64_r128m64() // Opcode 0f 2d { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); MMXPROLOG(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).i[0] = XMM(modrm & 0x7).f[0]; MMX((modrm >> 3) & 0x7).i[1] = XMM(modrm & 0x7).f[1]; } else { XMM_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, r); XMM((modrm >> 3) & 0x7).i[0] = r.f[0]; XMM((modrm >> 3) & 0x7).i[1] = r.f[1]; @@ -3011,13 +3011,13 @@ void i386_device::sse_cvtps2pi_r64_r128m64() // Opcode 0f 2d void i386_device::sse_cvtps2pd_r128_r128m64() // Opcode 0f 5a { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = (double)XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f64[1] = (double)XMM(modrm & 0x7).f[1]; } else { MMX_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, r); XMM((modrm >> 3) & 0x7).f64[0] = (double)r.f[0]; XMM((modrm >> 3) & 0x7).f64[1] = (double)r.f[1]; @@ -3027,7 +3027,7 @@ void i386_device::sse_cvtps2pd_r128_r128m64() // Opcode 0f 5a void i386_device::sse_cvtdq2ps_r128_rm128() // Opcode 0f 5b { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = (float)XMM(modrm & 0x7).i[0]; XMM((modrm >> 3) & 0x7).f[1] = (float)XMM(modrm & 0x7).i[1]; @@ -3035,7 +3035,7 @@ void i386_device::sse_cvtdq2ps_r128_rm128() // Opcode 0f 5b XMM((modrm >> 3) & 0x7).f[3] = (float)XMM(modrm & 0x7).i[3]; } else { XMM_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, r); XMM((modrm >> 3) & 0x7).f[0] = (float)r.i[0]; XMM((modrm >> 3) & 0x7).f[1] = (float)r.i[1]; @@ -3047,13 +3047,13 @@ void i386_device::sse_cvtdq2ps_r128_rm128() // Opcode 0f 5b void i386_device::sse_cvtdq2pd_r128_r128m64() // Opcode f3 0f e6 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = (double)XMM(modrm & 0x7).i[0]; XMM((modrm >> 3) & 0x7).f64[1] = (double)XMM(modrm & 0x7).i[1]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); XMM((modrm >> 3) & 0x7).f64[0] = (double)s.i[0]; XMM((modrm >> 3) & 0x7).f64[1] = (double)s.i[1]; @@ -3063,11 +3063,11 @@ void i386_device::sse_cvtdq2pd_r128_r128m64() // Opcode f3 0f e6 void i386_device::sse_movss_r128_rm128() // Opcode f3 0f 10 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).d[0] = XMM(modrm & 0x7).d[0]; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); XMM((modrm >> 3) & 0x7).d[0] = READ32(ea); } CYCLES(1); // TODO: correct cycle count @@ -3075,11 +3075,11 @@ void i386_device::sse_movss_r128_rm128() // Opcode f3 0f 10 void i386_device::sse_movss_rm128_r128() // Opcode f3 0f 11 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM(modrm & 0x7).d[0] = XMM((modrm >> 3) & 0x7).d[0]; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITE32(ea, XMM((modrm >> 3) & 0x7).d[0]); } CYCLES(1); // TODO: correct cycle count @@ -3087,7 +3087,7 @@ void i386_device::sse_movss_rm128_r128() // Opcode f3 0f 11 void i386_device::sse_movsldup_r128_rm128() // Opcode f3 0f 12 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).d[0] = XMM(modrm & 0x7).d[0]; XMM((modrm >> 3) & 0x7).d[1] = XMM(modrm & 0x7).d[0]; @@ -3095,7 +3095,7 @@ void i386_device::sse_movsldup_r128_rm128() // Opcode f3 0f 12 XMM((modrm >> 3) & 0x7).d[3] = XMM(modrm & 0x7).d[2]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).d[0] = src.d[0]; XMM((modrm >> 3) & 0x7).d[1] = src.d[0]; @@ -3107,7 +3107,7 @@ void i386_device::sse_movsldup_r128_rm128() // Opcode f3 0f 12 void i386_device::sse_movshdup_r128_rm128() // Opcode f3 0f 16 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).d[0] = XMM(modrm & 0x7).d[1]; XMM((modrm >> 3) & 0x7).d[1] = XMM(modrm & 0x7).d[1]; @@ -3115,7 +3115,7 @@ void i386_device::sse_movshdup_r128_rm128() // Opcode f3 0f 16 XMM((modrm >> 3) & 0x7).d[3] = XMM(modrm & 0x7).d[3]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).d[0] = src.d[1]; XMM((modrm >> 3) & 0x7).d[1] = src.d[1]; @@ -3127,11 +3127,11 @@ void i386_device::sse_movshdup_r128_rm128() // Opcode f3 0f 16 void i386_device::sse_movaps_r128_rm128() // Opcode 0f 28 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7) = XMM(modrm & 0x7); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, XMM((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -3139,11 +3139,11 @@ void i386_device::sse_movaps_r128_rm128() // Opcode 0f 28 void i386_device::sse_movaps_rm128_r128() // Opcode 0f 29 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM(modrm & 0x7) = XMM((modrm >> 3) & 0x7); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM(ea, XMM((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -3151,11 +3151,11 @@ void i386_device::sse_movaps_rm128_r128() // Opcode 0f 29 void i386_device::sse_movups_r128_rm128() // Opcode 0f 10 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7) = XMM(modrm & 0x7); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, XMM((modrm >> 3) & 0x7)); // address does not need to be 16-byte aligned } CYCLES(1); // TODO: correct cycle count @@ -3163,11 +3163,11 @@ void i386_device::sse_movups_r128_rm128() // Opcode 0f 10 void i386_device::sse_movupd_r128_rm128() // Opcode 66 0f 10 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7) = XMM(modrm & 0x7); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, XMM((modrm >> 3) & 0x7)); // address does not need to be 16-byte aligned } CYCLES(1); // TODO: correct cycle count @@ -3175,11 +3175,11 @@ void i386_device::sse_movupd_r128_rm128() // Opcode 66 0f 10 void i386_device::sse_movups_rm128_r128() // Opcode 0f 11 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM(modrm & 0x7) = XMM((modrm >> 3) & 0x7); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM(ea, XMM((modrm >> 3) & 0x7)); // address does not need to be 16-byte aligned } CYCLES(1); // TODO: correct cycle count @@ -3187,11 +3187,11 @@ void i386_device::sse_movups_rm128_r128() // Opcode 0f 11 void i386_device::sse_movupd_rm128_r128() // Opcode 66 0f 11 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM(modrm & 0x7) = XMM((modrm >> 3) & 0x7); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM(ea, XMM((modrm >> 3) & 0x7)); // address does not need to be 16-byte aligned } CYCLES(1); // TODO: correct cycle count @@ -3199,14 +3199,14 @@ void i386_device::sse_movupd_rm128_r128() // Opcode 66 0f 11 void i386_device::sse_movlps_r128_m64() // Opcode 0f 12 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // MOVHLPS opcode XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[1]; CYCLES(1); // TODO: correct cycle count } else { // MOVLPS opcode - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM_LO64(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -3214,12 +3214,12 @@ void i386_device::sse_movlps_r128_m64() // Opcode 0f 12 void i386_device::sse_movlpd_r128_m64() // Opcode 66 0f 12 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { CYCLES(1); // TODO: correct cycle count } else { // MOVLPS opcode - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM_LO64(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -3227,12 +3227,12 @@ void i386_device::sse_movlpd_r128_m64() // Opcode 66 0f 12 void i386_device::sse_movlps_m64_r128() // Opcode 0f 13 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM_LO64(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -3240,12 +3240,12 @@ void i386_device::sse_movlps_m64_r128() // Opcode 0f 13 void i386_device::sse_movlpd_m64_r128() // Opcode 66 0f 13 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM_LO64(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -3253,14 +3253,14 @@ void i386_device::sse_movlpd_m64_r128() // Opcode 66 0f 13 void i386_device::sse_movhps_r128_m64() // Opcode 0f 16 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // MOVLHPS opcode XMM((modrm >> 3) & 0x7).q[1] = XMM(modrm & 0x7).q[0]; CYCLES(1); // TODO: correct cycle count } else { // MOVHPS opcode - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM_HI64(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -3268,13 +3268,13 @@ void i386_device::sse_movhps_r128_m64() // Opcode 0f 16 void i386_device::sse_movhpd_r128_m64() // Opcode 66 0f 16 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { // MOVHPS opcode - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM_HI64(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -3282,12 +3282,12 @@ void i386_device::sse_movhpd_r128_m64() // Opcode 66 0f 16 void i386_device::sse_movhps_m64_r128() // Opcode 0f 17 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM_HI64(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -3295,12 +3295,12 @@ void i386_device::sse_movhps_m64_r128() // Opcode 0f 17 void i386_device::sse_movhpd_m64_r128() // Opcode 66 0f 17 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM_HI64(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -3308,13 +3308,13 @@ void i386_device::sse_movhpd_m64_r128() // Opcode 66 0f 17 void i386_device::sse_movntps_m128_r128() // Opcode 0f 2b { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { // since cache is not implemented - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -3322,7 +3322,7 @@ void i386_device::sse_movntps_m128_r128() // Opcode 0f 2b void i386_device::sse_movmskps_r16_r128() // Opcode 0f 50 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int b; b=(XMM(modrm & 0x7).d[0] >> 31) & 1; @@ -3336,7 +3336,7 @@ void i386_device::sse_movmskps_r16_r128() // Opcode 0f 50 void i386_device::sse_movmskps_r32_r128() // Opcode 0f 50 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int b; b=(XMM(modrm & 0x7).d[0] >> 31) & 1; @@ -3350,7 +3350,7 @@ void i386_device::sse_movmskps_r32_r128() // Opcode 0f 50 void i386_device::sse_movmskpd_r32_r128() // Opcode 66 0f 50 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int b; b=(XMM(modrm & 0x7).q[0] >> 63) & 1; @@ -3363,7 +3363,7 @@ void i386_device::sse_movmskpd_r32_r128() // Opcode 66 0f 50 void i386_device::sse_movq2dq_r128_r64() // Opcode f3 0f d6 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = MMX(modrm & 7).q; XMM((modrm >> 3) & 0x7).q[1] = 0; @@ -3374,12 +3374,12 @@ void i386_device::sse_movq2dq_r128_r64() // Opcode f3 0f d6 void i386_device::sse_movdqu_r128_rm128() // Opcode f3 0f 6f { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM(modrm & 0x7).q[1]; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, XMM((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -3388,12 +3388,12 @@ void i386_device::sse_movdqu_r128_rm128() // Opcode f3 0f 6f void i386_device::sse_movdqu_rm128_r128() // Opcode f3 0f 7f { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM(modrm & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0]; XMM(modrm & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1]; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM(ea, XMM((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -3401,12 +3401,12 @@ void i386_device::sse_movdqu_rm128_r128() // Opcode f3 0f 7f void i386_device::sse_movd_m128_rm32() // Opcode 66 0f 6e { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { XMM((modrm >> 3) & 0x7).d[0] = LOAD_RM32(modrm); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); XMM((modrm >> 3) & 0x7).d[0] = READ32(ea); } XMM((modrm >> 3) & 0x7).d[1] = 0; @@ -3416,13 +3416,13 @@ void i386_device::sse_movd_m128_rm32() // Opcode 66 0f 6e void i386_device::sse_movdqa_m128_rm128() // Opcode 66 0f 6f { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM(modrm & 0x7).q[1]; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, XMM((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -3431,12 +3431,12 @@ void i386_device::sse_movdqa_m128_rm128() // Opcode 66 0f 6f void i386_device::sse_movq_r128_r128m64() // Opcode f3 0f 7e { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = 0; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); XMM((modrm >> 3) & 0x7).q[0] = READ64(ea); XMM((modrm >> 3) & 0x7).q[1] = 0; } @@ -3445,12 +3445,12 @@ void i386_device::sse_movq_r128_r128m64() // Opcode f3 0f 7e void i386_device::sse_movd_rm32_r128() // Opcode 66 0f 7e { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { STORE_RM32(modrm, XMM((modrm >> 3) & 0x7).d[0]); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITE32(ea, XMM((modrm >> 3) & 0x7).d[0]); } CYCLES(1); // TODO: correct cycle count @@ -3458,13 +3458,13 @@ void i386_device::sse_movd_rm32_r128() // Opcode 66 0f 7e void i386_device::sse_movdqa_rm128_r128() // Opcode 66 0f 7f { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { XMM(modrm & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0]; XMM(modrm & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1]; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM(ea, XMM((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -3473,7 +3473,7 @@ void i386_device::sse_movdqa_rm128_r128() // Opcode 66 0f 7f void i386_device::sse_pmovmskb_r16_r64() // Opcode 0f d7 { //MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int b; b=(MMX(modrm & 0x7).b[0] >> 7) & 1; @@ -3492,7 +3492,7 @@ void i386_device::sse_pmovmskb_r16_r64() // Opcode 0f d7 void i386_device::sse_pmovmskb_r32_r64() // Opcode 0f d7 { //MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int b; b=(MMX(modrm & 0x7).b[0] >> 7) & 1; @@ -3510,9 +3510,9 @@ void i386_device::sse_pmovmskb_r32_r64() // Opcode 0f d7 void i386_device::sse_pmovmskb_r32_r128() // Opcode 66 0f d7 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT32 b; + uint32_t b; b=(XMM(modrm & 0x7).b[0] >> 7) & 1; b=b | ((XMM(modrm & 0x7).b[1] >> 6) & 2); b=b | ((XMM(modrm & 0x7).b[2] >> 5) & 4); @@ -3536,7 +3536,7 @@ void i386_device::sse_pmovmskb_r32_r128() // Opcode 66 0f d7 void i386_device::sse_xorps() // Opcode 0f 57 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).d[0] = XMM((modrm >> 3) & 0x7).d[0] ^ XMM(modrm & 0x7).d[0]; XMM((modrm >> 3) & 0x7).d[1] = XMM((modrm >> 3) & 0x7).d[1] ^ XMM(modrm & 0x7).d[1]; @@ -3544,7 +3544,7 @@ void i386_device::sse_xorps() // Opcode 0f 57 XMM((modrm >> 3) & 0x7).d[3] = XMM((modrm >> 3) & 0x7).d[3] ^ XMM(modrm & 0x7).d[3]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).d[0] = XMM((modrm >> 3) & 0x7).d[0] ^ src.d[0]; XMM((modrm >> 3) & 0x7).d[1] = XMM((modrm >> 3) & 0x7).d[1] ^ src.d[1]; @@ -3556,13 +3556,13 @@ void i386_device::sse_xorps() // Opcode 0f 57 void i386_device::sse_xorpd_r128_rm128() // Opcode 66 0f 57 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] ^ XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] ^ XMM(modrm & 0x7).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] ^ src.q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] ^ src.q[1]; @@ -3572,7 +3572,7 @@ void i386_device::sse_xorpd_r128_rm128() // Opcode 66 0f 57 void i386_device::sse_addps() // Opcode 0f 58 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] + XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] + XMM(modrm & 0x7).f[1]; @@ -3580,7 +3580,7 @@ void i386_device::sse_addps() // Opcode 0f 58 XMM((modrm >> 3) & 0x7).f[3] = XMM((modrm >> 3) & 0x7).f[3] + XMM(modrm & 0x7).f[3]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] + src.f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] + src.f[1]; @@ -3592,7 +3592,7 @@ void i386_device::sse_addps() // Opcode 0f 58 void i386_device::sse_sqrtps_r128_rm128() // Opcode 0f 51 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sqrt(XMM(modrm & 0x7).f[0]); XMM((modrm >> 3) & 0x7).f[1] = sqrt(XMM(modrm & 0x7).f[1]); @@ -3600,7 +3600,7 @@ void i386_device::sse_sqrtps_r128_rm128() // Opcode 0f 51 XMM((modrm >> 3) & 0x7).f[3] = sqrt(XMM(modrm & 0x7).f[3]); } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = sqrt(src.f[0]); XMM((modrm >> 3) & 0x7).f[1] = sqrt(src.f[1]); @@ -3612,7 +3612,7 @@ void i386_device::sse_sqrtps_r128_rm128() // Opcode 0f 51 void i386_device::sse_rsqrtps_r128_rm128() // Opcode 0f 52 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = 1.0 / sqrt(XMM(modrm & 0x7).f[0]); XMM((modrm >> 3) & 0x7).f[1] = 1.0 / sqrt(XMM(modrm & 0x7).f[1]); @@ -3620,7 +3620,7 @@ void i386_device::sse_rsqrtps_r128_rm128() // Opcode 0f 52 XMM((modrm >> 3) & 0x7).f[3] = 1.0 / sqrt(XMM(modrm & 0x7).f[3]); } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = 1.0 / sqrt(src.f[0]); XMM((modrm >> 3) & 0x7).f[1] = 1.0 / sqrt(src.f[1]); @@ -3632,7 +3632,7 @@ void i386_device::sse_rsqrtps_r128_rm128() // Opcode 0f 52 void i386_device::sse_rcpps_r128_rm128() // Opcode 0f 53 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = 1.0f / XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = 1.0f / XMM(modrm & 0x7).f[1]; @@ -3640,7 +3640,7 @@ void i386_device::sse_rcpps_r128_rm128() // Opcode 0f 53 XMM((modrm >> 3) & 0x7).f[3] = 1.0f / XMM(modrm & 0x7).f[3]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = 1.0f / src.f[0]; XMM((modrm >> 3) & 0x7).f[1] = 1.0f / src.f[1]; @@ -3652,13 +3652,13 @@ void i386_device::sse_rcpps_r128_rm128() // Opcode 0f 53 void i386_device::sse_andps_r128_rm128() // Opcode 0f 54 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] & XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] & XMM(modrm & 0x7).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] & src.q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] & src.q[1]; @@ -3668,13 +3668,13 @@ void i386_device::sse_andps_r128_rm128() // Opcode 0f 54 void i386_device::sse_andpd_r128_rm128() // Opcode 66 0f 54 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] & XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] & XMM(modrm & 0x7).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] & src.q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] & src.q[1]; @@ -3684,13 +3684,13 @@ void i386_device::sse_andpd_r128_rm128() // Opcode 66 0f 54 void i386_device::sse_andnps_r128_rm128() // Opcode 0f 55 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = ~(XMM((modrm >> 3) & 0x7).q[0]) & XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = ~(XMM((modrm >> 3) & 0x7).q[1]) & XMM(modrm & 0x7).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).q[0] = ~(XMM((modrm >> 3) & 0x7).q[0]) & src.q[0]; XMM((modrm >> 3) & 0x7).q[1] = ~(XMM((modrm >> 3) & 0x7).q[1]) & src.q[1]; @@ -3700,13 +3700,13 @@ void i386_device::sse_andnps_r128_rm128() // Opcode 0f 55 void i386_device::sse_andnpd_r128_rm128() // Opcode 66 0f 55 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = ~(XMM((modrm >> 3) & 0x7).q[0]) & XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = ~(XMM((modrm >> 3) & 0x7).q[1]) & XMM(modrm & 0x7).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).q[0] = ~(XMM((modrm >> 3) & 0x7).q[0]) & src.q[0]; XMM((modrm >> 3) & 0x7).q[1] = ~(XMM((modrm >> 3) & 0x7).q[1]) & src.q[1]; @@ -3716,13 +3716,13 @@ void i386_device::sse_andnpd_r128_rm128() // Opcode 66 0f 55 void i386_device::sse_orps_r128_rm128() // Opcode 0f 56 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] | XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] | XMM(modrm & 0x7).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] | src.q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] | src.q[1]; @@ -3732,13 +3732,13 @@ void i386_device::sse_orps_r128_rm128() // Opcode 0f 56 void i386_device::sse_orpd_r128_rm128() // Opcode 66 0f 56 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] | XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] | XMM(modrm & 0x7).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] | src.q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] | src.q[1]; @@ -3748,7 +3748,7 @@ void i386_device::sse_orpd_r128_rm128() // Opcode 66 0f 56 void i386_device::sse_mulps() // Opcode 0f 59 ???? { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] * XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] * XMM(modrm & 0x7).f[1]; @@ -3756,7 +3756,7 @@ void i386_device::sse_mulps() // Opcode 0f 59 ???? XMM((modrm >> 3) & 0x7).f[3] = XMM((modrm >> 3) & 0x7).f[3] * XMM(modrm & 0x7).f[3]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] * src.f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] * src.f[1]; @@ -3768,7 +3768,7 @@ void i386_device::sse_mulps() // Opcode 0f 59 ???? void i386_device::sse_subps() // Opcode 0f 5c { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] - XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] - XMM(modrm & 0x7).f[1]; @@ -3776,7 +3776,7 @@ void i386_device::sse_subps() // Opcode 0f 5c XMM((modrm >> 3) & 0x7).f[3] = XMM((modrm >> 3) & 0x7).f[3] - XMM(modrm & 0x7).f[3]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] - src.f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] - src.f[1]; @@ -3814,7 +3814,7 @@ static inline double sse_min_double(double src1, double src2) void i386_device::sse_minps() // Opcode 0f 5d { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sse_min_single(XMM((modrm >> 3) & 0x7).f[0], XMM(modrm & 0x7).f[0]); XMM((modrm >> 3) & 0x7).f[1] = sse_min_single(XMM((modrm >> 3) & 0x7).f[1], XMM(modrm & 0x7).f[1]); @@ -3822,7 +3822,7 @@ void i386_device::sse_minps() // Opcode 0f 5d XMM((modrm >> 3) & 0x7).f[3] = sse_min_single(XMM((modrm >> 3) & 0x7).f[3], XMM(modrm & 0x7).f[3]); } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = sse_min_single(XMM((modrm >> 3) & 0x7).f[0], src.f[0]); XMM((modrm >> 3) & 0x7).f[1] = sse_min_single(XMM((modrm >> 3) & 0x7).f[1], src.f[1]); @@ -3834,7 +3834,7 @@ void i386_device::sse_minps() // Opcode 0f 5d void i386_device::sse_divps() // Opcode 0f 5e { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] / XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] / XMM(modrm & 0x7).f[1]; @@ -3842,7 +3842,7 @@ void i386_device::sse_divps() // Opcode 0f 5e XMM((modrm >> 3) & 0x7).f[3] = XMM((modrm >> 3) & 0x7).f[3] / XMM(modrm & 0x7).f[3]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] / src.f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] / src.f[1]; @@ -3880,7 +3880,7 @@ static inline double sse_max_double(double src1, double src2) void i386_device::sse_maxps() // Opcode 0f 5f { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sse_max_single(XMM((modrm >> 3) & 0x7).f[0], XMM(modrm & 0x7).f[0]); XMM((modrm >> 3) & 0x7).f[1] = sse_max_single(XMM((modrm >> 3) & 0x7).f[1], XMM(modrm & 0x7).f[1]); @@ -3888,7 +3888,7 @@ void i386_device::sse_maxps() // Opcode 0f 5f XMM((modrm >> 3) & 0x7).f[3] = sse_max_single(XMM((modrm >> 3) & 0x7).f[3], XMM(modrm & 0x7).f[3]); } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = sse_max_single(XMM((modrm >> 3) & 0x7).f[0], src.f[0]); XMM((modrm >> 3) & 0x7).f[1] = sse_max_single(XMM((modrm >> 3) & 0x7).f[1], src.f[1]); @@ -3900,12 +3900,12 @@ void i386_device::sse_maxps() // Opcode 0f 5f void i386_device::sse_maxss_r128_r128m32() // Opcode f3 0f 5f { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sse_max_single(XMM((modrm >> 3) & 0x7).f[0], XMM(modrm & 0x7).f[0]); } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); src.d[0]=READ32(ea); XMM((modrm >> 3) & 0x7).f[0] = sse_max_single(XMM((modrm >> 3) & 0x7).f[0], src.f[0]); } @@ -3914,12 +3914,12 @@ void i386_device::sse_maxss_r128_r128m32() // Opcode f3 0f 5f void i386_device::sse_addss() // Opcode f3 0f 58 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] + XMM(modrm & 0x7).f[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] + src.f[0]; } @@ -3928,12 +3928,12 @@ void i386_device::sse_addss() // Opcode f3 0f 58 void i386_device::sse_subss() // Opcode f3 0f 5c { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] - XMM(modrm & 0x7).f[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] - src.f[0]; } @@ -3942,12 +3942,12 @@ void i386_device::sse_subss() // Opcode f3 0f 5c void i386_device::sse_mulss() // Opcode f3 0f 5e { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] * XMM(modrm & 0x7).f[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] * src.f[0]; } @@ -3956,12 +3956,12 @@ void i386_device::sse_mulss() // Opcode f3 0f 5e void i386_device::sse_divss() // Opcode 0f 59 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] / XMM(modrm & 0x7).f[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] / src.f[0]; } @@ -3970,12 +3970,12 @@ void i386_device::sse_divss() // Opcode 0f 59 void i386_device::sse_rcpss_r128_r128m32() // Opcode f3 0f 53 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = 1.0f / XMM(modrm & 0x7).f[0]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); s.d[0]=READ32(ea); XMM((modrm >> 3) & 0x7).f[0] = 1.0f / s.f[0]; } @@ -3984,12 +3984,12 @@ void i386_device::sse_rcpss_r128_r128m32() // Opcode f3 0f 53 void i386_device::sse_sqrtss_r128_r128m32() // Opcode f3 0f 51 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sqrt(XMM(modrm & 0x7).f[0]); } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); s.d[0]=READ32(ea); XMM((modrm >> 3) & 0x7).f[0] = sqrt(s.f[0]); } @@ -3998,12 +3998,12 @@ void i386_device::sse_sqrtss_r128_r128m32() // Opcode f3 0f 51 void i386_device::sse_rsqrtss_r128_r128m32() // Opcode f3 0f 52 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = 1.0 / sqrt(XMM(modrm & 0x7).f[0]); } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); s.d[0]=READ32(ea); XMM((modrm >> 3) & 0x7).f[0] = 1.0 / sqrt(s.f[0]); } @@ -4012,12 +4012,12 @@ void i386_device::sse_rsqrtss_r128_r128m32() // Opcode f3 0f 52 void i386_device::sse_minss_r128_r128m32() // Opcode f3 0f 5d { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] < XMM(modrm & 0x7).f[0] ? XMM((modrm >> 3) & 0x7).f[0] : XMM(modrm & 0x7).f[0]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); s.d[0] = READ32(ea); XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] < s.f[0] ? XMM((modrm >> 3) & 0x7).f[0] : s.f[0]; } @@ -4027,13 +4027,13 @@ void i386_device::sse_minss_r128_r128m32() // Opcode f3 0f 5d void i386_device::sse_comiss_r128_r128m32() // Opcode 0f 2f { float32 a,b; - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { a = XMM((modrm >> 3) & 0x7).d[0]; b = XMM(modrm & 0x7).d[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); a = XMM((modrm >> 3) & 0x7).d[0]; b = src.d[0]; @@ -4064,13 +4064,13 @@ void i386_device::sse_comiss_r128_r128m32() // Opcode 0f 2f void i386_device::sse_comisd_r128_r128m64() // Opcode 66 0f 2f { float64 a,b; - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { a = XMM((modrm >> 3) & 0x7).q[0]; b = XMM(modrm & 0x7).q[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); a = XMM((modrm >> 3) & 0x7).q[0]; b = src.q[0]; @@ -4101,13 +4101,13 @@ void i386_device::sse_comisd_r128_r128m64() // Opcode 66 0f 2f void i386_device::sse_ucomiss_r128_r128m32() // Opcode 0f 2e { float32 a,b; - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { a = XMM((modrm >> 3) & 0x7).d[0]; b = XMM(modrm & 0x7).d[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); a = XMM((modrm >> 3) & 0x7).d[0]; b = src.d[0]; @@ -4138,13 +4138,13 @@ void i386_device::sse_ucomiss_r128_r128m32() // Opcode 0f 2e void i386_device::sse_ucomisd_r128_r128m64() // Opcode 66 0f 2e { float64 a,b; - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { a = XMM((modrm >> 3) & 0x7).q[0]; b = XMM(modrm & 0x7).q[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); a = XMM((modrm >> 3) & 0x7).q[0]; b = src.q[0]; @@ -4174,8 +4174,8 @@ void i386_device::sse_ucomisd_r128_r128m64() // Opcode 66 0f 2e void i386_device::sse_shufps() // Opcode 0f c6 { - UINT8 modrm = FETCH(); - UINT8 sel = FETCH(); + uint8_t modrm = FETCH(); + uint8_t sel = FETCH(); int m1,m2,m3,m4; int s,d; m1=sel & 3; @@ -4185,7 +4185,7 @@ void i386_device::sse_shufps() // Opcode 0f c6 s=modrm & 0x7; d=(modrm >> 3) & 0x7; if( modrm >= 0xc0 ) { - UINT32 t1,t2,t3,t4; + uint32_t t1,t2,t3,t4; t1=XMM(d).d[m1]; t2=XMM(d).d[m2]; t3=XMM(s).d[m3]; @@ -4195,9 +4195,9 @@ void i386_device::sse_shufps() // Opcode 0f c6 XMM(d).d[2]=t3; XMM(d).d[3]=t4; } else { - UINT32 t1,t2; + uint32_t t1,t2; XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); t1=XMM(d).d[m1]; t2=XMM(d).d[m2]; @@ -4211,8 +4211,8 @@ void i386_device::sse_shufps() // Opcode 0f c6 void i386_device::sse_shufpd_r128_rm128_i8() // Opcode 66 0f c6 { - UINT8 modrm = FETCH(); - UINT8 sel = FETCH(); + uint8_t modrm = FETCH(); + uint8_t sel = FETCH(); int m1,m2; int s,d; m1=sel & 1; @@ -4220,15 +4220,15 @@ void i386_device::sse_shufpd_r128_rm128_i8() // Opcode 66 0f c6 s=modrm & 0x7; d=(modrm >> 3) & 0x7; if( modrm >= 0xc0 ) { - UINT64 t1,t2; + uint64_t t1,t2; t1=XMM(d).q[m1]; t2=XMM(s).q[m2]; XMM(d).q[0]=t1; XMM(d).q[1]=t2; } else { - UINT64 t1; + uint64_t t1; XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); t1=XMM(d).q[m1]; XMM(d).q[0]=t1; @@ -4239,9 +4239,9 @@ void i386_device::sse_shufpd_r128_rm128_i8() // Opcode 66 0f c6 void i386_device::sse_unpcklps_r128_rm128() // Opcode 0f 14 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); int s,d; - UINT32 t1, t2, t3, t4; + uint32_t t1, t2, t3, t4; s=modrm & 0x7; d=(modrm >> 3) & 0x7; if( modrm >= 0xc0 ) { @@ -4255,7 +4255,7 @@ void i386_device::sse_unpcklps_r128_rm128() // Opcode 0f 14 XMM(d).d[0]=t4; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); t2 = XMM(d).d[1]; XMM(d).d[3]=src.d[1]; @@ -4267,7 +4267,7 @@ void i386_device::sse_unpcklps_r128_rm128() // Opcode 0f 14 void i386_device::sse_unpcklpd_r128_rm128() // Opcode 66 0f 14 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); int s,d; s=modrm & 0x7; d=(modrm >> 3) & 0x7; @@ -4276,7 +4276,7 @@ void i386_device::sse_unpcklpd_r128_rm128() // Opcode 66 0f 14 XMM(d).q[0]=XMM(d).q[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM(d).q[1]=src.q[0]; XMM(d).q[0]=XMM(d).q[0]; @@ -4286,9 +4286,9 @@ void i386_device::sse_unpcklpd_r128_rm128() // Opcode 66 0f 14 void i386_device::sse_unpckhps_r128_rm128() // Opcode 0f 15 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); int s,d; - UINT32 t1, t2, t3, t4; + uint32_t t1, t2, t3, t4; s=modrm & 0x7; d=(modrm >> 3) & 0x7; if( modrm >= 0xc0 ) { @@ -4302,7 +4302,7 @@ void i386_device::sse_unpckhps_r128_rm128() // Opcode 0f 15 XMM(d).d[3]=t4; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); t1 = XMM(d).d[2]; t2 = XMM(d).d[3]; @@ -4316,7 +4316,7 @@ void i386_device::sse_unpckhps_r128_rm128() // Opcode 0f 15 void i386_device::sse_unpckhpd_r128_rm128() // Opcode 66 0f 15 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); int s,d; s=modrm & 0x7; d=(modrm >> 3) & 0x7; @@ -4325,7 +4325,7 @@ void i386_device::sse_unpckhpd_r128_rm128() // Opcode 66 0f 15 XMM(d).q[1]=XMM(s).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM(d).q[0]=XMM(d).q[1]; XMM(d).q[1]=src.q[1]; @@ -4357,7 +4357,7 @@ static inline bool sse_isdoubleunordered(double op1, double op2) return !((op1 != op1) || (op1 != op2)); } -void i386_device::sse_predicate_compare_single(UINT8 imm8, XMM_REG d, XMM_REG s) +void i386_device::sse_predicate_compare_single(uint8_t imm8, XMM_REG d, XMM_REG s) { switch (imm8 & 7) { @@ -4412,7 +4412,7 @@ void i386_device::sse_predicate_compare_single(UINT8 imm8, XMM_REG d, XMM_REG s) } } -void i386_device::sse_predicate_compare_double(UINT8 imm8, XMM_REG d, XMM_REG s) +void i386_device::sse_predicate_compare_double(uint8_t imm8, XMM_REG d, XMM_REG s) { switch (imm8 & 7) { @@ -4451,7 +4451,7 @@ void i386_device::sse_predicate_compare_double(UINT8 imm8, XMM_REG d, XMM_REG s) } } -void i386_device::sse_predicate_compare_single_scalar(UINT8 imm8, XMM_REG d, XMM_REG s) +void i386_device::sse_predicate_compare_single_scalar(uint8_t imm8, XMM_REG d, XMM_REG s) { switch (imm8 & 7) { @@ -4482,7 +4482,7 @@ void i386_device::sse_predicate_compare_single_scalar(UINT8 imm8, XMM_REG d, XMM } } -void i386_device::sse_predicate_compare_double_scalar(UINT8 imm8, XMM_REG d, XMM_REG s) +void i386_device::sse_predicate_compare_double_scalar(uint8_t imm8, XMM_REG d, XMM_REG s) { switch (imm8 & 7) { @@ -4515,18 +4515,18 @@ void i386_device::sse_predicate_compare_double_scalar(UINT8 imm8, XMM_REG d, XMM void i386_device::sse_cmpps_r128_rm128_i8() // Opcode 0f c2 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); s=modrm & 0x7; d=(modrm >> 3) & 0x7; sse_predicate_compare_single(imm8, XMM(d), XMM(s)); } else { int d; XMM_REG s; - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); READXMM(ea, s); d=(modrm >> 3) & 0x7; sse_predicate_compare_single(imm8, XMM(d), s); @@ -4536,18 +4536,18 @@ void i386_device::sse_cmpps_r128_rm128_i8() // Opcode 0f c2 void i386_device::sse_cmppd_r128_rm128_i8() // Opcode 66 0f c2 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); s=modrm & 0x7; d=(modrm >> 3) & 0x7; sse_predicate_compare_double(imm8, XMM(d), XMM(s)); } else { int d; XMM_REG s; - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); READXMM(ea, s); d=(modrm >> 3) & 0x7; sse_predicate_compare_double(imm8, XMM(d), s); @@ -4557,18 +4557,18 @@ void i386_device::sse_cmppd_r128_rm128_i8() // Opcode 66 0f c2 void i386_device::sse_cmpss_r128_r128m32_i8() // Opcode f3 0f c2 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); s=modrm & 0x7; d=(modrm >> 3) & 0x7; sse_predicate_compare_single_scalar(imm8, XMM(d), XMM(s)); } else { int d; XMM_REG s; - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); s.d[0]=READ32(ea); d=(modrm >> 3) & 0x7; sse_predicate_compare_single_scalar(imm8, XMM(d), s); @@ -4579,18 +4579,18 @@ void i386_device::sse_cmpss_r128_r128m32_i8() // Opcode f3 0f c2 void i386_device::sse_pinsrw_r64_r16m16_i8() // Opcode 0f c4, 16bit register { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT8 imm8 = FETCH(); - UINT16 v = LOAD_RM16(modrm); + uint8_t imm8 = FETCH(); + uint16_t v = LOAD_RM16(modrm); if (m_xmm_operand_size) XMM((modrm >> 3) & 0x7).w[imm8 & 7] = v; else MMX((modrm >> 3) & 0x7).w[imm8 & 3] = v; } else { - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); - UINT16 v = READ16(ea); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); + uint16_t v = READ16(ea); if (m_xmm_operand_size) XMM((modrm >> 3) & 0x7).w[imm8 & 7] = v; else @@ -4602,15 +4602,15 @@ void i386_device::sse_pinsrw_r64_r16m16_i8() // Opcode 0f c4, 16bit register void i386_device::sse_pinsrw_r64_r32m16_i8() // Opcode 0f c4, 32bit register { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT8 imm8 = FETCH(); - UINT16 v = (UINT16)LOAD_RM32(modrm); + uint8_t imm8 = FETCH(); + uint16_t v = (uint16_t)LOAD_RM32(modrm); MMX((modrm >> 3) & 0x7).w[imm8 & 3] = v; } else { - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); - UINT16 v = READ16(ea); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); + uint16_t v = READ16(ea); MMX((modrm >> 3) & 0x7).w[imm8 & 3] = v; } CYCLES(1); // TODO: correct cycle count @@ -4618,16 +4618,16 @@ void i386_device::sse_pinsrw_r64_r32m16_i8() // Opcode 0f c4, 32bit register void i386_device::sse_pinsrw_r128_r32m16_i8() // Opcode 66 0f c4 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { - UINT8 imm8 = FETCH(); - UINT16 v = (UINT16)LOAD_RM32(modrm); + uint8_t imm8 = FETCH(); + uint16_t v = (uint16_t)LOAD_RM32(modrm); XMM((modrm >> 3) & 0x7).w[imm8 & 7] = v; } else { - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); - UINT16 v = READ16(ea); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); + uint16_t v = READ16(ea); XMM((modrm >> 3) & 0x7).w[imm8 & 7] = v; } CYCLES(1); // TODO: correct cycle count @@ -4636,15 +4636,15 @@ void i386_device::sse_pinsrw_r128_r32m16_i8() // Opcode 66 0f c4 void i386_device::sse_pextrw_r16_r64_i8() // Opcode 0f c5 { //MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); if (m_xmm_operand_size) STORE_REG16(modrm, XMM(modrm & 0x7).w[imm8 & 7]); else STORE_REG16(modrm, MMX(modrm & 0x7).w[imm8 & 3]); } else { - //UINT8 imm8 = FETCH(); + //uint8_t imm8 = FETCH(); report_invalid_modrm("pextrw_r16_r64_i8", modrm); } CYCLES(1); // TODO: correct cycle count @@ -4653,12 +4653,12 @@ void i386_device::sse_pextrw_r16_r64_i8() // Opcode 0f c5 void i386_device::sse_pextrw_r32_r64_i8() // Opcode 0f c5 { //MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); STORE_REG32(modrm, MMX(modrm & 0x7).w[imm8 & 3]); } else { - //UINT8 imm8 = FETCH(); + //uint8_t imm8 = FETCH(); report_invalid_modrm("pextrw_r32_r64_i8", modrm); } CYCLES(1); // TODO: correct cycle count @@ -4666,13 +4666,13 @@ void i386_device::sse_pextrw_r32_r64_i8() // Opcode 0f c5 void i386_device::sse_pextrw_reg_r128_i8() // Opcode 66 0f c5 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); STORE_REG32(modrm, XMM(modrm & 0x7).w[imm8 & 7]); } else { - //UINT8 imm8 = FETCH(); + //uint8_t imm8 = FETCH(); report_invalid_modrm("sse_pextrw_reg_r128_i8", modrm); } CYCLES(1); // TODO: correct cycle count @@ -4682,13 +4682,13 @@ void i386_device::sse_pminub_r64_rm64() // Opcode 0f da { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n] = MMX((modrm >> 3) & 0x7).b[n] < MMX(modrm & 0x7).b[n] ? MMX((modrm >> 3) & 0x7).b[n] : MMX(modrm & 0x7).b[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n] = MMX((modrm >> 3) & 0x7).b[n] < s.b[n] ? MMX((modrm >> 3) & 0x7).b[n] : s.b[n]; @@ -4698,13 +4698,13 @@ void i386_device::sse_pminub_r64_rm64() // Opcode 0f da void i386_device::sse_pminub_r128_rm128() // Opcode 66 0f da { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n] = XMM((modrm >> 3) & 0x7).b[n] < XMM(modrm & 0x7).b[n] ? XMM((modrm >> 3) & 0x7).b[n] : XMM(modrm & 0x7).b[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n] = XMM((modrm >> 3) & 0x7).b[n] < s.b[n] ? XMM((modrm >> 3) & 0x7).b[n] : s.b[n]; @@ -4716,13 +4716,13 @@ void i386_device::sse_pmaxub_r64_rm64() // Opcode 0f de { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n] = MMX((modrm >> 3) & 0x7).b[n] > MMX(modrm & 0x7).b[n] ? MMX((modrm >> 3) & 0x7).b[n] : MMX(modrm & 0x7).b[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 8;n++) MMX((modrm >> 3) & 0x7).b[n] = MMX((modrm >> 3) & 0x7).b[n] > s.b[n] ? MMX((modrm >> 3) & 0x7).b[n] : s.b[n]; @@ -4734,16 +4734,16 @@ void i386_device::sse_pavgb_r64_rm64() // Opcode 0f e0 { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 8;n++) - MMX((modrm >> 3) & 0x7).b[n] = ((UINT16)MMX((modrm >> 3) & 0x7).b[n] + (UINT16)MMX(modrm & 0x7).b[n] + 1) >> 1; + MMX((modrm >> 3) & 0x7).b[n] = ((uint16_t)MMX((modrm >> 3) & 0x7).b[n] + (uint16_t)MMX(modrm & 0x7).b[n] + 1) >> 1; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 8;n++) - MMX((modrm >> 3) & 0x7).b[n] = ((UINT16)MMX((modrm >> 3) & 0x7).b[n] + (UINT16)s.b[n] + 1) >> 1; + MMX((modrm >> 3) & 0x7).b[n] = ((uint16_t)MMX((modrm >> 3) & 0x7).b[n] + (uint16_t)s.b[n] + 1) >> 1; } CYCLES(1); // TODO: correct cycle count } @@ -4752,16 +4752,16 @@ void i386_device::sse_pavgw_r64_rm64() // Opcode 0f e3 { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 4;n++) - MMX((modrm >> 3) & 0x7).w[n] = ((UINT32)MMX((modrm >> 3) & 0x7).w[n] + (UINT32)MMX(modrm & 0x7).w[n] + 1) >> 1; + MMX((modrm >> 3) & 0x7).w[n] = ((uint32_t)MMX((modrm >> 3) & 0x7).w[n] + (uint32_t)MMX(modrm & 0x7).w[n] + 1) >> 1; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 4;n++) - MMX((modrm >> 3) & 0x7).w[n] = ((UINT32)MMX((modrm >> 3) & 0x7).w[n] + (UINT32)s.w[n] + 1) >> 1; + MMX((modrm >> 3) & 0x7).w[n] = ((uint32_t)MMX((modrm >> 3) & 0x7).w[n] + (uint32_t)s.w[n] + 1) >> 1; } CYCLES(1); // TODO: correct cycle count } @@ -4769,20 +4769,20 @@ void i386_device::sse_pavgw_r64_rm64() // Opcode 0f e3 void i386_device::sse_pmulhuw_r64_rm64() // Opcode 0f e4 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - MMX((modrm >> 3) & 0x7).w[0]=((UINT32)MMX((modrm >> 3) & 0x7).w[0]*(UINT32)MMX(modrm & 7).w[0]) >> 16; - MMX((modrm >> 3) & 0x7).w[1]=((UINT32)MMX((modrm >> 3) & 0x7).w[1]*(UINT32)MMX(modrm & 7).w[1]) >> 16; - MMX((modrm >> 3) & 0x7).w[2]=((UINT32)MMX((modrm >> 3) & 0x7).w[2]*(UINT32)MMX(modrm & 7).w[2]) >> 16; - MMX((modrm >> 3) & 0x7).w[3]=((UINT32)MMX((modrm >> 3) & 0x7).w[3]*(UINT32)MMX(modrm & 7).w[3]) >> 16; + MMX((modrm >> 3) & 0x7).w[0]=((uint32_t)MMX((modrm >> 3) & 0x7).w[0]*(uint32_t)MMX(modrm & 7).w[0]) >> 16; + MMX((modrm >> 3) & 0x7).w[1]=((uint32_t)MMX((modrm >> 3) & 0x7).w[1]*(uint32_t)MMX(modrm & 7).w[1]) >> 16; + MMX((modrm >> 3) & 0x7).w[2]=((uint32_t)MMX((modrm >> 3) & 0x7).w[2]*(uint32_t)MMX(modrm & 7).w[2]) >> 16; + MMX((modrm >> 3) & 0x7).w[3]=((uint32_t)MMX((modrm >> 3) & 0x7).w[3]*(uint32_t)MMX(modrm & 7).w[3]) >> 16; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); - MMX((modrm >> 3) & 0x7).w[0]=((UINT32)MMX((modrm >> 3) & 0x7).w[0]*(UINT32)s.w[0]) >> 16; - MMX((modrm >> 3) & 0x7).w[1]=((UINT32)MMX((modrm >> 3) & 0x7).w[1]*(UINT32)s.w[1]) >> 16; - MMX((modrm >> 3) & 0x7).w[2]=((UINT32)MMX((modrm >> 3) & 0x7).w[2]*(UINT32)s.w[2]) >> 16; - MMX((modrm >> 3) & 0x7).w[3]=((UINT32)MMX((modrm >> 3) & 0x7).w[3]*(UINT32)s.w[3]) >> 16; + MMX((modrm >> 3) & 0x7).w[0]=((uint32_t)MMX((modrm >> 3) & 0x7).w[0]*(uint32_t)s.w[0]) >> 16; + MMX((modrm >> 3) & 0x7).w[1]=((uint32_t)MMX((modrm >> 3) & 0x7).w[1]*(uint32_t)s.w[1]) >> 16; + MMX((modrm >> 3) & 0x7).w[2]=((uint32_t)MMX((modrm >> 3) & 0x7).w[2]*(uint32_t)s.w[2]) >> 16; + MMX((modrm >> 3) & 0x7).w[3]=((uint32_t)MMX((modrm >> 3) & 0x7).w[3]*(uint32_t)s.w[3]) >> 16; } CYCLES(1); // TODO: correct cycle count } @@ -4791,13 +4791,13 @@ void i386_device::sse_pminsw_r64_rm64() // Opcode 0f ea { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).s[n] = MMX((modrm >> 3) & 0x7).s[n] < MMX(modrm & 0x7).s[n] ? MMX((modrm >> 3) & 0x7).s[n] : MMX(modrm & 0x7).s[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).s[n] = MMX((modrm >> 3) & 0x7).s[n] < s.s[n] ? MMX((modrm >> 3) & 0x7).s[n] : s.s[n]; @@ -4809,13 +4809,13 @@ void i386_device::sse_pmaxsw_r64_rm64() // Opcode 0f ee { int n; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).s[n] = MMX((modrm >> 3) & 0x7).s[n] > MMX(modrm & 0x7).s[n] ? MMX((modrm >> 3) & 0x7).s[n] : MMX(modrm & 0x7).s[n]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); for (n=0;n < 4;n++) MMX((modrm >> 3) & 0x7).s[n] = MMX((modrm >> 3) & 0x7).s[n] > s.s[n] ? MMX((modrm >> 3) & 0x7).s[n] : s.s[n]; @@ -4826,30 +4826,30 @@ void i386_device::sse_pmaxsw_r64_rm64() // Opcode 0f ee void i386_device::sse_pmuludq_r64_rm64() // Opcode 0f f4 { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - MMX((modrm >> 3) & 0x7).q = (UINT64)MMX((modrm >> 3) & 0x7).d[0] * (UINT64)MMX(modrm & 0x7).d[0]; + MMX((modrm >> 3) & 0x7).q = (uint64_t)MMX((modrm >> 3) & 0x7).d[0] * (uint64_t)MMX(modrm & 0x7).d[0]; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); - MMX((modrm >> 3) & 0x7).q = (UINT64)MMX((modrm >> 3) & 0x7).d[0] * (UINT64)s.d[0]; + MMX((modrm >> 3) & 0x7).q = (uint64_t)MMX((modrm >> 3) & 0x7).d[0] * (uint64_t)s.d[0]; } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_pmuludq_r128_rm128() // Opcode 66 0f f4 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - XMM((modrm >> 3) & 0x7).q[0] = (UINT64)XMM((modrm >> 3) & 0x7).d[0] * (UINT64)XMM(modrm & 0x7).d[0]; - XMM((modrm >> 3) & 0x7).q[1] = (UINT64)XMM((modrm >> 3) & 0x7).d[2] * (UINT64)XMM(modrm & 0x7).d[2]; + XMM((modrm >> 3) & 0x7).q[0] = (uint64_t)XMM((modrm >> 3) & 0x7).d[0] * (uint64_t)XMM(modrm & 0x7).d[0]; + XMM((modrm >> 3) & 0x7).q[1] = (uint64_t)XMM((modrm >> 3) & 0x7).d[2] * (uint64_t)XMM(modrm & 0x7).d[2]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); - XMM((modrm >> 3) & 0x7).q[0] = (UINT64)XMM((modrm >> 3) & 0x7).d[0] * (UINT64)s.d[0]; - XMM((modrm >> 3) & 0x7).q[1] = (UINT64)XMM((modrm >> 3) & 0x7).d[2] * (UINT64)s.d[2]; + XMM((modrm >> 3) & 0x7).q[0] = (uint64_t)XMM((modrm >> 3) & 0x7).d[0] * (uint64_t)s.d[0]; + XMM((modrm >> 3) & 0x7).q[1] = (uint64_t)XMM((modrm >> 3) & 0x7).d[2] * (uint64_t)s.d[2]; } CYCLES(1); // TODO: correct cycle count } @@ -4857,22 +4857,22 @@ void i386_device::sse_pmuludq_r128_rm128() // Opcode 66 0f f4 void i386_device::sse_psadbw_r64_rm64() // Opcode 0f f6 { int n; - INT32 temp; + int32_t temp; MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { temp=0; for (n=0;n < 8;n++) - temp += abs((INT32)MMX((modrm >> 3) & 0x7).b[n] - (INT32)MMX(modrm & 0x7).b[n]); - MMX((modrm >> 3) & 0x7).l=(UINT64)temp & 0xffff; + temp += abs((int32_t)MMX((modrm >> 3) & 0x7).b[n] - (int32_t)MMX(modrm & 0x7).b[n]); + MMX((modrm >> 3) & 0x7).l=(uint64_t)temp & 0xffff; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); temp=0; for (n=0;n < 8;n++) - temp += abs((INT32)MMX((modrm >> 3) & 0x7).b[n] - (INT32)s.b[n]); - MMX((modrm >> 3) & 0x7).l=(UINT64)temp & 0xffff; + temp += abs((int32_t)MMX((modrm >> 3) & 0x7).b[n] - (int32_t)s.b[n]); + MMX((modrm >> 3) & 0x7).l=(uint64_t)temp & 0xffff; } CYCLES(1); // TODO: correct cycle count } @@ -4880,12 +4880,12 @@ void i386_device::sse_psadbw_r64_rm64() // Opcode 0f f6 void i386_device::sse_psubq_r64_rm64() // Opcode 0f fb { MMXPROLOG(); - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q - MMX(modrm & 7).q; } else { MMX_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, s); MMX((modrm >> 3) & 0x7).q=MMX((modrm >> 3) & 0x7).q - s.q; } @@ -4894,13 +4894,13 @@ void i386_device::sse_psubq_r64_rm64() // Opcode 0f fb void i386_device::sse_psubq_r128_rm128() // Opcode 66 0f fb { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] - XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] - XMM(modrm & 7).q[1]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] - s.q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] - s.q[1]; @@ -4910,11 +4910,11 @@ void i386_device::sse_psubq_r128_rm128() // Opcode 66 0f fb void i386_device::sse_pshufd_r128_rm128_i8() // Opcode 66 0f 70 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM_REG t; int s,d; - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); s=modrm & 0x7; d=(modrm >> 3) & 0x7; t.q[0]=XMM(s).q[0]; @@ -4926,8 +4926,8 @@ void i386_device::sse_pshufd_r128_rm128_i8() // Opcode 66 0f 70 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); READXMM(ea, s); XMM(d).d[0]=s.d[(imm8 & 3)]; XMM(d).d[1]=s.d[((imm8 >> 2) & 3)]; @@ -4939,11 +4939,11 @@ void i386_device::sse_pshufd_r128_rm128_i8() // Opcode 66 0f 70 void i386_device::sse_pshuflw_r128_rm128_i8() // Opcode f2 0f 70 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM_REG t; int s,d; - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); s=modrm & 0x7; d=(modrm >> 3) & 0x7; t.q[0]=XMM(s).q[0]; @@ -4955,8 +4955,8 @@ void i386_device::sse_pshuflw_r128_rm128_i8() // Opcode f2 0f 70 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); READXMM(ea, s); XMM(d).q[1]=s.q[1]; XMM(d).w[0]=s.w[imm8 & 3]; @@ -4969,11 +4969,11 @@ void i386_device::sse_pshuflw_r128_rm128_i8() // Opcode f2 0f 70 void i386_device::sse_pshufhw_r128_rm128_i8() // Opcode f3 0f 70 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM_REG t; int s,d; - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); s=modrm & 0x7; d=(modrm >> 3) & 0x7; t.q[0]=XMM(s).q[1]; @@ -4985,8 +4985,8 @@ void i386_device::sse_pshufhw_r128_rm128_i8() // Opcode f3 0f 70 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); READXMM(ea, s); XMM(d).q[0]=s.q[0]; XMM(d).w[4]=s.w[4 + (imm8 & 3)]; @@ -4999,7 +4999,7 @@ void i386_device::sse_pshufhw_r128_rm128_i8() // Opcode f3 0f 70 void i386_device::sse_packsswb_r128_rm128() // Opcode 66 0f 63 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { XMM_REG t; int s, d; @@ -5015,7 +5015,7 @@ void i386_device::sse_packsswb_r128_rm128() // Opcode 66 0f 63 else { XMM_REG s; int d = (modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n = 0; n < 8; n++) XMM(d).c[n] = SaturatedSignedWordToSignedByte(XMM(d).s[n]); @@ -5027,7 +5027,7 @@ void i386_device::sse_packsswb_r128_rm128() // Opcode 66 0f 63 void i386_device::sse_packssdw_r128_rm128() // Opcode 66 0f 6b { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if (modrm >= 0xc0) { XMM_REG t; int s, d; @@ -5047,7 +5047,7 @@ void i386_device::sse_packssdw_r128_rm128() // Opcode 66 0f 6b else { XMM_REG s; int d = (modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); XMM(d).s[0] = SaturatedSignedDwordToSignedWord(XMM(d).i[0]); XMM(d).s[1] = SaturatedSignedDwordToSignedWord(XMM(d).i[1]); @@ -5063,7 +5063,7 @@ void i386_device::sse_packssdw_r128_rm128() // Opcode 66 0f 6b void i386_device::sse_pcmpgtb_r128_rm128() // Opcode 66 0f 64 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5073,7 +5073,7 @@ void i386_device::sse_pcmpgtb_r128_rm128() // Opcode 66 0f 64 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int c=0;c <= 15;c++) XMM(d).b[c]=(XMM(d).c[c] > s.c[c]) ? 0xff : 0; @@ -5083,7 +5083,7 @@ void i386_device::sse_pcmpgtb_r128_rm128() // Opcode 66 0f 64 void i386_device::sse_pcmpgtw_r128_rm128() // Opcode 66 0f 65 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5093,7 +5093,7 @@ void i386_device::sse_pcmpgtw_r128_rm128() // Opcode 66 0f 65 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int c=0;c <= 7;c++) XMM(d).w[c]=(XMM(d).s[c] > s.s[c]) ? 0xffff : 0; @@ -5103,7 +5103,7 @@ void i386_device::sse_pcmpgtw_r128_rm128() // Opcode 66 0f 65 void i386_device::sse_pcmpgtd_r128_rm128() // Opcode 66 0f 66 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5113,7 +5113,7 @@ void i386_device::sse_pcmpgtd_r128_rm128() // Opcode 66 0f 66 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int c=0;c <= 3;c++) XMM(d).d[c]=(XMM(d).i[c] > s.i[c]) ? 0xffffffff : 0; @@ -5123,7 +5123,7 @@ void i386_device::sse_pcmpgtd_r128_rm128() // Opcode 66 0f 66 void i386_device::sse_packuswb_r128_rm128() // Opcode 66 0f 67 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5138,7 +5138,7 @@ void i386_device::sse_packuswb_r128_rm128() // Opcode 66 0f 67 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n = 0; n < 8;n++) XMM(d).b[n]=SaturatedSignedWordToUnsignedByte(XMM(d).s[n]); @@ -5150,7 +5150,7 @@ void i386_device::sse_packuswb_r128_rm128() // Opcode 66 0f 67 void i386_device::sse_punpckhbw_r128_rm128() // Opcode 66 0f 68 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5164,7 +5164,7 @@ void i386_device::sse_punpckhbw_r128_rm128() // Opcode 66 0f 68 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n = 0; n < 16; n += 2) { XMM(d).b[n]=XMM(d).b[8+(n >> 1)]; @@ -5176,7 +5176,7 @@ void i386_device::sse_punpckhbw_r128_rm128() // Opcode 66 0f 68 void i386_device::sse_punpckhwd_r128_rm128() // Opcode 66 0f 69 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5190,7 +5190,7 @@ void i386_device::sse_punpckhwd_r128_rm128() // Opcode 66 0f 69 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n = 0; n < 8; n += 2) { XMM(d).w[n]=XMM(d).w[4+(n >> 1)]; @@ -5202,7 +5202,7 @@ void i386_device::sse_punpckhwd_r128_rm128() // Opcode 66 0f 69 void i386_device::sse_unpckhdq_r128_rm128() // Opcode 66 0f 6a { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5216,7 +5216,7 @@ void i386_device::sse_unpckhdq_r128_rm128() // Opcode 66 0f 6a } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); XMM(d).d[0]=XMM(d).d[2]; XMM(d).d[1]=s.d[2]; @@ -5228,7 +5228,7 @@ void i386_device::sse_unpckhdq_r128_rm128() // Opcode 66 0f 6a void i386_device::sse_punpckhqdq_r128_rm128() // Opcode 66 0f 6d { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5240,7 +5240,7 @@ void i386_device::sse_punpckhqdq_r128_rm128() // Opcode 66 0f 6d } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); XMM(d).q[0]=XMM(d).q[1]; XMM(d).q[1]=s.q[1]; @@ -5250,7 +5250,7 @@ void i386_device::sse_punpckhqdq_r128_rm128() // Opcode 66 0f 6d void i386_device::sse_pcmpeqb_r128_rm128() // Opcode 66 0f 74 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5260,7 +5260,7 @@ void i386_device::sse_pcmpeqb_r128_rm128() // Opcode 66 0f 74 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int c=0;c <= 15;c++) XMM(d).b[c]=(XMM(d).c[c] == s.c[c]) ? 0xff : 0; @@ -5270,7 +5270,7 @@ void i386_device::sse_pcmpeqb_r128_rm128() // Opcode 66 0f 74 void i386_device::sse_pcmpeqw_r128_rm128() // Opcode 66 0f 75 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5280,7 +5280,7 @@ void i386_device::sse_pcmpeqw_r128_rm128() // Opcode 66 0f 75 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int c=0;c <= 7;c++) XMM(d).w[c]=(XMM(d).s[c] == s.s[c]) ? 0xffff : 0; @@ -5290,7 +5290,7 @@ void i386_device::sse_pcmpeqw_r128_rm128() // Opcode 66 0f 75 void i386_device::sse_pcmpeqd_r128_rm128() // Opcode 66 0f 76 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5300,7 +5300,7 @@ void i386_device::sse_pcmpeqd_r128_rm128() // Opcode 66 0f 76 } else { XMM_REG s; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int c=0;c <= 3;c++) XMM(d).d[c]=(XMM(d).i[c] == s.i[c]) ? 0xffffffff : 0; @@ -5310,7 +5310,7 @@ void i386_device::sse_pcmpeqd_r128_rm128() // Opcode 66 0f 76 void i386_device::sse_paddq_r128_rm128() // Opcode 66 0f d4 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5320,7 +5320,7 @@ void i386_device::sse_paddq_r128_rm128() // Opcode 66 0f d4 } else { XMM_REG src; int d=(modrm >> 3) & 0x7; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM(d).q[0]=XMM(d).q[0]+src.q[0]; XMM(d).q[1]=XMM(d).q[1]+src.q[1]; @@ -5330,34 +5330,34 @@ void i386_device::sse_paddq_r128_rm128() // Opcode 66 0f d4 void i386_device::sse_pmullw_r128_rm128() // Opcode 66 0f d5 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; d=(modrm >> 3) & 0x7; for (int n = 0; n < 8;n++) - XMM(d).w[n]=(UINT32)((INT32)XMM(d).s[n]*(INT32)XMM(s).s[n]) & 0xffff; + XMM(d).w[n]=(uint32_t)((int32_t)XMM(d).s[n]*(int32_t)XMM(s).s[n]) & 0xffff; } else { XMM_REG src; int d; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); d=(modrm >> 3) & 0x7; for (int n = 0; n < 8;n++) - XMM(d).w[n]=(UINT32)((INT32)XMM(d).s[n]*(INT32)src.s[n]) & 0xffff; + XMM(d).w[n]=(uint32_t)((int32_t)XMM(d).s[n]*(int32_t)src.s[n]) & 0xffff; } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_paddb_r128_rm128() // Opcode 66 0f fc { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] + XMM(modrm & 7).b[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] + s.b[n]; @@ -5367,13 +5367,13 @@ void i386_device::sse_paddb_r128_rm128() // Opcode 66 0f fc void i386_device::sse_paddw_r128_rm128() // Opcode 66 0f fd { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] + XMM(modrm & 7).w[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] + s.w[n]; @@ -5383,13 +5383,13 @@ void i386_device::sse_paddw_r128_rm128() // Opcode 66 0f fd void i386_device::sse_paddd_r128_rm128() // Opcode 66 0f fe { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 4;n++) XMM((modrm >> 3) & 0x7).d[n]=XMM((modrm >> 3) & 0x7).d[n] + XMM(modrm & 7).d[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 4;n++) XMM((modrm >> 3) & 0x7).d[n]=XMM((modrm >> 3) & 0x7).d[n] + s.d[n]; @@ -5399,13 +5399,13 @@ void i386_device::sse_paddd_r128_rm128() // Opcode 66 0f fe void i386_device::sse_psubusb_r128_rm128() // Opcode 66 0f d8 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] < XMM(modrm & 7).b[n] ? 0 : XMM((modrm >> 3) & 0x7).b[n]-XMM(modrm & 7).b[n]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] < src.b[n] ? 0 : XMM((modrm >> 3) & 0x7).b[n]-src.b[n]; @@ -5415,13 +5415,13 @@ void i386_device::sse_psubusb_r128_rm128() // Opcode 66 0f d8 void i386_device::sse_psubusw_r128_rm128() // Opcode 66 0f d9 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] < XMM(modrm & 7).w[n] ? 0 : XMM((modrm >> 3) & 0x7).w[n]-XMM(modrm & 7).w[n]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] < src.w[n] ? 0 : XMM((modrm >> 3) & 0x7).w[n]-src.w[n]; @@ -5431,13 +5431,13 @@ void i386_device::sse_psubusw_r128_rm128() // Opcode 66 0f d9 void i386_device::sse_pand_r128_rm128() // Opcode 66 0f db { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] & XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] & XMM(modrm & 7).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] & src.q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] & src.q[1]; @@ -5447,13 +5447,13 @@ void i386_device::sse_pand_r128_rm128() // Opcode 66 0f db void i386_device::sse_pandn_r128_rm128() // Opcode 66 0f df { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=(~XMM((modrm >> 3) & 0x7).q[0]) & XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=(~XMM((modrm >> 3) & 0x7).q[1]) & XMM(modrm & 7).q[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).q[0]=(~XMM((modrm >> 3) & 0x7).q[0]) & src.q[0]; XMM((modrm >> 3) & 0x7).q[1]=(~XMM((modrm >> 3) & 0x7).q[1]) & src.q[1]; @@ -5463,13 +5463,13 @@ void i386_device::sse_pandn_r128_rm128() // Opcode 66 0f df void i386_device::sse_paddusb_r128_rm128() // Opcode 66 0f dc { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] > (0xff-XMM(modrm & 7).b[n]) ? 0xff : XMM((modrm >> 3) & 0x7).b[n]+XMM(modrm & 7).b[n]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] > (0xff-src.b[n]) ? 0xff : XMM((modrm >> 3) & 0x7).b[n]+src.b[n]; @@ -5479,13 +5479,13 @@ void i386_device::sse_paddusb_r128_rm128() // Opcode 66 0f dc void i386_device::sse_paddusw_r128_rm128() // Opcode 66 0f dd { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] > (0xffff-XMM(modrm & 7).w[n]) ? 0xffff : XMM((modrm >> 3) & 0x7).w[n]+XMM(modrm & 7).w[n]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] > (0xffff-src.w[n]) ? 0xffff : XMM((modrm >> 3) & 0x7).w[n]+src.w[n]; @@ -5495,13 +5495,13 @@ void i386_device::sse_paddusw_r128_rm128() // Opcode 66 0f dd void i386_device::sse_pmaxub_r128_rm128() // Opcode 66 0f de { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n] = XMM((modrm >> 3) & 0x7).b[n] > XMM(modrm & 0x7).b[n] ? XMM((modrm >> 3) & 0x7).b[n] : XMM(modrm & 0x7).b[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n] = XMM((modrm >> 3) & 0x7).b[n] > s.b[n] ? XMM((modrm >> 3) & 0x7).b[n] : s.b[n]; @@ -5511,77 +5511,77 @@ void i386_device::sse_pmaxub_r128_rm128() // Opcode 66 0f de void i386_device::sse_pmulhuw_r128_rm128() // Opcode 66 0f e4 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).w[n]=((UINT32)XMM((modrm >> 3) & 0x7).w[n]*(UINT32)XMM(modrm & 7).w[n]) >> 16; + XMM((modrm >> 3) & 0x7).w[n]=((uint32_t)XMM((modrm >> 3) & 0x7).w[n]*(uint32_t)XMM(modrm & 7).w[n]) >> 16; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).w[n]=((UINT32)XMM((modrm >> 3) & 0x7).w[n]*(UINT32)s.w[n]) >> 16; + XMM((modrm >> 3) & 0x7).w[n]=((uint32_t)XMM((modrm >> 3) & 0x7).w[n]*(uint32_t)s.w[n]) >> 16; } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_pmulhw_r128_rm128() // Opcode 66 0f e5 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).w[n]=(UINT32)((INT32)XMM((modrm >> 3) & 0x7).s[n]*(INT32)XMM(modrm & 7).s[n]) >> 16; + XMM((modrm >> 3) & 0x7).w[n]=(uint32_t)((int32_t)XMM((modrm >> 3) & 0x7).s[n]*(int32_t)XMM(modrm & 7).s[n]) >> 16; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).w[n]=(UINT32)((INT32)XMM((modrm >> 3) & 0x7).s[n]*(INT32)src.s[n]) >> 16; + XMM((modrm >> 3) & 0x7).w[n]=(uint32_t)((int32_t)XMM((modrm >> 3) & 0x7).s[n]*(int32_t)src.s[n]) >> 16; } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_psubsb_r128_rm128() // Opcode 66 0f e8 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) - XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((INT16)XMM((modrm >> 3) & 0x7).c[n] - (INT16)XMM(modrm & 7).c[n]); + XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)XMM((modrm >> 3) & 0x7).c[n] - (int16_t)XMM(modrm & 7).c[n]); } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 16;n++) - XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((INT16)XMM((modrm >> 3) & 0x7).c[n] - (INT16)s.c[n]); + XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)XMM((modrm >> 3) & 0x7).c[n] - (int16_t)s.c[n]); } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_psubsw_r128_rm128() // Opcode 66 0f e9 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((INT32)XMM((modrm >> 3) & 0x7).s[n] - (INT32)XMM(modrm & 7).s[n]); + XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)XMM((modrm >> 3) & 0x7).s[n] - (int32_t)XMM(modrm & 7).s[n]); } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((INT32)XMM((modrm >> 3) & 0x7).s[n] - (INT32)s.s[n]); + XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)XMM((modrm >> 3) & 0x7).s[n] - (int32_t)s.s[n]); } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_pminsw_r128_rm128() // Opcode 66 0f ea { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).s[n] = XMM((modrm >> 3) & 0x7).s[n] < XMM(modrm & 0x7).s[n] ? XMM((modrm >> 3) & 0x7).s[n] : XMM(modrm & 0x7).s[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).s[n] = XMM((modrm >> 3) & 0x7).s[n] < s.s[n] ? XMM((modrm >> 3) & 0x7).s[n] : s.s[n]; @@ -5591,13 +5591,13 @@ void i386_device::sse_pminsw_r128_rm128() // Opcode 66 0f ea void i386_device::sse_pmaxsw_r128_rm128() // Opcode 66 0f ee { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).s[n] = XMM((modrm >> 3) & 0x7).s[n] > XMM(modrm & 0x7).s[n] ? XMM((modrm >> 3) & 0x7).s[n] : XMM(modrm & 0x7).s[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).s[n] = XMM((modrm >> 3) & 0x7).s[n] > s.s[n] ? XMM((modrm >> 3) & 0x7).s[n] : s.s[n]; @@ -5607,45 +5607,45 @@ void i386_device::sse_pmaxsw_r128_rm128() // Opcode 66 0f ee void i386_device::sse_paddsb_r128_rm128() // Opcode 66 0f ec { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) - XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((INT16)XMM((modrm >> 3) & 0x7).c[n] + (INT16)XMM(modrm & 7).c[n]); + XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)XMM((modrm >> 3) & 0x7).c[n] + (int16_t)XMM(modrm & 7).c[n]); } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 16;n++) - XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((INT16)XMM((modrm >> 3) & 0x7).c[n] + (INT16)s.c[n]); + XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)XMM((modrm >> 3) & 0x7).c[n] + (int16_t)s.c[n]); } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_paddsw_r128_rm128() // Opcode 66 0f ed { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((INT32)XMM((modrm >> 3) & 0x7).s[n] + (INT32)XMM(modrm & 7).s[n]); + XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)XMM((modrm >> 3) & 0x7).s[n] + (int32_t)XMM(modrm & 7).s[n]); } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((INT32)XMM((modrm >> 3) & 0x7).s[n] + (INT32)s.s[n]); + XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)XMM((modrm >> 3) & 0x7).s[n] + (int32_t)s.s[n]); } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_por_r128_rm128() // Opcode 66 0f eb { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] | XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] | XMM(modrm & 7).q[1]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] | s.q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] | s.q[1]; @@ -5655,13 +5655,13 @@ void i386_device::sse_por_r128_rm128() // Opcode 66 0f eb void i386_device::sse_pxor_r128_rm128() // Opcode 66 0f ef { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] ^ XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] ^ XMM(modrm & 7).q[1]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] ^ s.q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] ^ s.q[1]; @@ -5671,31 +5671,31 @@ void i386_device::sse_pxor_r128_rm128() // Opcode 66 0f ef void i386_device::sse_pmaddwd_r128_rm128() // Opcode 66 0f f5 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 4;n++) - XMM((modrm >> 3) & 0x7).i[n]=(INT32)XMM((modrm >> 3) & 0x7).s[n]*(INT32)XMM(modrm & 7).s[n]+ - (INT32)XMM((modrm >> 3) & 0x7).s[n]*(INT32)XMM(modrm & 7).s[n]; + XMM((modrm >> 3) & 0x7).i[n]=(int32_t)XMM((modrm >> 3) & 0x7).s[n]*(int32_t)XMM(modrm & 7).s[n]+ + (int32_t)XMM((modrm >> 3) & 0x7).s[n]*(int32_t)XMM(modrm & 7).s[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 4;n++) - XMM((modrm >> 3) & 0x7).i[n]=(INT32)XMM((modrm >> 3) & 0x7).s[n]*(INT32)s.s[n]+ - (INT32)XMM((modrm >> 3) & 0x7).s[n]*(INT32)s.s[n]; + XMM((modrm >> 3) & 0x7).i[n]=(int32_t)XMM((modrm >> 3) & 0x7).s[n]*(int32_t)s.s[n]+ + (int32_t)XMM((modrm >> 3) & 0x7).s[n]*(int32_t)s.s[n]; } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_psubb_r128_rm128() // Opcode 66 0f f8 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] - XMM(modrm & 7).b[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] - s.b[n]; @@ -5705,13 +5705,13 @@ void i386_device::sse_psubb_r128_rm128() // Opcode 66 0f f8 void i386_device::sse_psubw_r128_rm128() // Opcode 66 0f f9 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] - XMM(modrm & 7).w[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] - s.w[n]; @@ -5721,13 +5721,13 @@ void i386_device::sse_psubw_r128_rm128() // Opcode 66 0f f9 void i386_device::sse_psubd_r128_rm128() // Opcode 66 0f fa { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 4;n++) XMM((modrm >> 3) & 0x7).d[n]=XMM((modrm >> 3) & 0x7).d[n] - XMM(modrm & 7).d[n]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 4;n++) XMM((modrm >> 3) & 0x7).d[n]=XMM((modrm >> 3) & 0x7).d[n] - s.d[n]; @@ -5737,75 +5737,75 @@ void i386_device::sse_psubd_r128_rm128() // Opcode 66 0f fa void i386_device::sse_psadbw_r128_rm128() // Opcode 66 0f f6 { - INT32 temp; - UINT8 modrm = FETCH(); + int32_t temp; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { temp=0; for (int n=0;n < 8;n++) - temp += abs((INT32)XMM((modrm >> 3) & 0x7).b[n] - (INT32)XMM(modrm & 0x7).b[n]); - XMM((modrm >> 3) & 0x7).l[0]=(UINT64)temp & 0xffff; + temp += abs((int32_t)XMM((modrm >> 3) & 0x7).b[n] - (int32_t)XMM(modrm & 0x7).b[n]); + XMM((modrm >> 3) & 0x7).l[0]=(uint64_t)temp & 0xffff; temp=0; for (int n=8;n < 16;n++) - temp += abs((INT32)XMM((modrm >> 3) & 0x7).b[n] - (INT32)XMM(modrm & 0x7).b[n]); - XMM((modrm >> 3) & 0x7).l[1]=(UINT64)temp & 0xffff; + temp += abs((int32_t)XMM((modrm >> 3) & 0x7).b[n] - (int32_t)XMM(modrm & 0x7).b[n]); + XMM((modrm >> 3) & 0x7).l[1]=(uint64_t)temp & 0xffff; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); temp=0; for (int n=0;n < 8;n++) - temp += abs((INT32)XMM((modrm >> 3) & 0x7).b[n] - (INT32)s.b[n]); - XMM((modrm >> 3) & 0x7).l[0]=(UINT64)temp & 0xffff; + temp += abs((int32_t)XMM((modrm >> 3) & 0x7).b[n] - (int32_t)s.b[n]); + XMM((modrm >> 3) & 0x7).l[0]=(uint64_t)temp & 0xffff; temp=0; for (int n=8;n < 16;n++) - temp += abs((INT32)XMM((modrm >> 3) & 0x7).b[n] - (INT32)s.b[n]); - XMM((modrm >> 3) & 0x7).l[1]=(UINT64)temp & 0xffff; + temp += abs((int32_t)XMM((modrm >> 3) & 0x7).b[n] - (int32_t)s.b[n]); + XMM((modrm >> 3) & 0x7).l[1]=(uint64_t)temp & 0xffff; } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_pavgb_r128_rm128() // Opcode 66 0f e0 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) - XMM((modrm >> 3) & 0x7).b[n] = ((UINT16)XMM((modrm >> 3) & 0x7).b[n] + (UINT16)XMM(modrm & 0x7).b[n] + 1) >> 1; + XMM((modrm >> 3) & 0x7).b[n] = ((uint16_t)XMM((modrm >> 3) & 0x7).b[n] + (uint16_t)XMM(modrm & 0x7).b[n] + 1) >> 1; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 16;n++) - XMM((modrm >> 3) & 0x7).b[n] = ((UINT16)XMM((modrm >> 3) & 0x7).b[n] + (UINT16)s.b[n] + 1) >> 1; + XMM((modrm >> 3) & 0x7).b[n] = ((uint16_t)XMM((modrm >> 3) & 0x7).b[n] + (uint16_t)s.b[n] + 1) >> 1; } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_pavgw_r128_rm128() // Opcode 66 0f e3 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).w[n] = ((UINT32)XMM((modrm >> 3) & 0x7).w[n] + (UINT32)XMM(modrm & 0x7).w[n] + 1) >> 1; + XMM((modrm >> 3) & 0x7).w[n] = ((uint32_t)XMM((modrm >> 3) & 0x7).w[n] + (uint32_t)XMM(modrm & 0x7).w[n] + 1) >> 1; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); for (int n=0;n < 8;n++) - XMM((modrm >> 3) & 0x7).w[n] = ((UINT32)XMM((modrm >> 3) & 0x7).w[n] + (UINT32)s.w[n] + 1) >> 1; + XMM((modrm >> 3) & 0x7).w[n] = ((uint32_t)XMM((modrm >> 3) & 0x7).w[n] + (uint32_t)s.w[n] + 1) >> 1; } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_psrlw_r128_rm128() // Opcode 66 0f d1 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; for (int n=0; n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] >> count; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); int count=(int)src.q[0]; for (int n=0; n < 8;n++) @@ -5816,7 +5816,7 @@ void i386_device::sse_psrlw_r128_rm128() // Opcode 66 0f d1 void i386_device::sse_psrld_r128_rm128() // Opcode 66 0f d2 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).d[0]=XMM((modrm >> 3) & 0x7).d[0] >> count; @@ -5825,7 +5825,7 @@ void i386_device::sse_psrld_r128_rm128() // Opcode 66 0f d2 XMM((modrm >> 3) & 0x7).d[3]=XMM((modrm >> 3) & 0x7).d[3] >> count; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); int count=(int)src.q[0]; XMM((modrm >> 3) & 0x7).d[0]=XMM((modrm >> 3) & 0x7).d[0] >> count; @@ -5838,14 +5838,14 @@ void i386_device::sse_psrld_r128_rm128() // Opcode 66 0f d2 void i386_device::sse_psrlq_r128_rm128() // Opcode 66 0f d3 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] >> count; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] >> count; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); int count=(int)src.q[0]; XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] >> count; @@ -5856,14 +5856,14 @@ void i386_device::sse_psrlq_r128_rm128() // Opcode 66 0f d3 void i386_device::sse_psllw_r128_rm128() // Opcode 66 0f f1 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; for (int n=0; n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] << count; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); int count=(int)s.q[0]; for (int n=0; n < 8;n++) @@ -5874,7 +5874,7 @@ void i386_device::sse_psllw_r128_rm128() // Opcode 66 0f f1 void i386_device::sse_pslld_r128_rm128() // Opcode 66 0f f2 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).d[0]=XMM((modrm >> 3) & 0x7).d[0] << count; @@ -5883,7 +5883,7 @@ void i386_device::sse_pslld_r128_rm128() // Opcode 66 0f f2 XMM((modrm >> 3) & 0x7).d[3]=XMM((modrm >> 3) & 0x7).d[3] << count; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); int count=(int)s.q[0]; XMM((modrm >> 3) & 0x7).d[0]=XMM((modrm >> 3) & 0x7).d[0] << count; @@ -5896,14 +5896,14 @@ void i386_device::sse_pslld_r128_rm128() // Opcode 66 0f f2 void i386_device::sse_psllq_r128_rm128() // Opcode 66 0f f3 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] << count; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] << count; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, s); int count=(int)s.q[0]; XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] << count; @@ -5914,14 +5914,14 @@ void i386_device::sse_psllq_r128_rm128() // Opcode 66 0f f3 void i386_device::sse_psraw_r128_rm128() // Opcode 66 0f e1 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; for (int n=0; n < 8;n++) XMM((modrm >> 3) & 0x7).s[n]=XMM((modrm >> 3) & 0x7).s[n] >> count; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); int count=(int)src.q[0]; for (int n=0; n < 8;n++) @@ -5932,7 +5932,7 @@ void i386_device::sse_psraw_r128_rm128() // Opcode 66 0f e1 void i386_device::sse_psrad_r128_rm128() // Opcode 66 0f e2 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).i[0]=XMM((modrm >> 3) & 0x7).i[0] >> count; @@ -5941,7 +5941,7 @@ void i386_device::sse_psrad_r128_rm128() // Opcode 66 0f e2 XMM((modrm >> 3) & 0x7).i[3]=XMM((modrm >> 3) & 0x7).i[3] >> count; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); int count=(int)src.q[0]; XMM((modrm >> 3) & 0x7).i[0]=XMM((modrm >> 3) & 0x7).i[0] >> count; @@ -5954,12 +5954,12 @@ void i386_device::sse_psrad_r128_rm128() // Opcode 66 0f e2 void i386_device::sse_movntdq_m128_r128() // Opcode 66 0f e7 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { CYCLES(1); // unsupported } else { // since cache is not implemented - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -5967,17 +5967,17 @@ void i386_device::sse_movntdq_m128_r128() // Opcode 66 0f e7 void i386_device::sse_cvttpd2dq_r128_rm128() // Opcode 66 0f e6 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - XMM((modrm >> 3) & 0x7).i[0]=(INT32)XMM((modrm >> 3) & 0x7).f64[0]; - XMM((modrm >> 3) & 0x7).i[1]=(INT32)XMM((modrm >> 3) & 0x7).f64[1]; + XMM((modrm >> 3) & 0x7).i[0]=(int32_t)XMM((modrm >> 3) & 0x7).f64[0]; + XMM((modrm >> 3) & 0x7).i[1]=(int32_t)XMM((modrm >> 3) & 0x7).f64[1]; XMM((modrm >> 3) & 0x7).q[1] = 0; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); - XMM((modrm >> 3) & 0x7).i[0]=(INT32)src.f64[0]; - XMM((modrm >> 3) & 0x7).i[1]=(INT32)src.f64[1]; + XMM((modrm >> 3) & 0x7).i[0]=(int32_t)src.f64[0]; + XMM((modrm >> 3) & 0x7).i[1]=(int32_t)src.f64[1]; XMM((modrm >> 3) & 0x7).q[1] = 0; } CYCLES(1); // TODO: correct cycle count @@ -5985,12 +5985,12 @@ void i386_device::sse_cvttpd2dq_r128_rm128() // Opcode 66 0f e6 void i386_device::sse_movq_r128m64_r128() // Opcode 66 0f d6 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM(modrm & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0]; XMM(modrm & 0x7).q[1] = 0; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITE64(ea, XMM((modrm >> 3) & 0x7).q[0]); } CYCLES(1); // TODO: correct cycle count @@ -5998,7 +5998,7 @@ void i386_device::sse_movq_r128m64_r128() // Opcode 66 0f d6 void i386_device::sse_addsubpd_r128_rm128() // Opcode 66 0f d0 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s, d; s=modrm & 0x7; @@ -6008,7 +6008,7 @@ void i386_device::sse_addsubpd_r128_rm128() // Opcode 66 0f d0 } else { XMM_REG src; int d; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); d=(modrm >> 3) & 0x7; READXMM(ea, src); XMM(d).f64[0]=XMM(d).f64[0]-src.f64[0]; @@ -6019,7 +6019,7 @@ void i386_device::sse_addsubpd_r128_rm128() // Opcode 66 0f d0 void i386_device::sse_haddpd_r128_rm128() // Opcode 66 0f 7c { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s, d; s=modrm & 0x7; @@ -6029,7 +6029,7 @@ void i386_device::sse_haddpd_r128_rm128() // Opcode 66 0f 7c } else { XMM_REG src; int d; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); d=(modrm >> 3) & 0x7; READXMM(ea, src); XMM(d).f64[0]=XMM(d).f64[0]+XMM(d).f64[1]; @@ -6040,7 +6040,7 @@ void i386_device::sse_haddpd_r128_rm128() // Opcode 66 0f 7c void i386_device::sse_hsubpd_r128_rm128() // Opcode 66 0f 7d { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s, d; s=modrm & 0x7; @@ -6050,7 +6050,7 @@ void i386_device::sse_hsubpd_r128_rm128() // Opcode 66 0f 7d } else { XMM_REG src; int d; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); d=(modrm >> 3) & 0x7; READXMM(ea, src); XMM(d).f64[0]=XMM(d).f64[0]-XMM(d).f64[1]; @@ -6061,7 +6061,7 @@ void i386_device::sse_hsubpd_r128_rm128() // Opcode 66 0f 7d void i386_device::sse_sqrtpd_r128_rm128() // Opcode 66 0f 51 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s, d; s=modrm & 0x7; @@ -6071,7 +6071,7 @@ void i386_device::sse_sqrtpd_r128_rm128() // Opcode 66 0f 51 } else { XMM_REG src; int d; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); d=(modrm >> 3) & 0x7; READXMM(ea, src); XMM(d).f64[0]=sqrt(src.f64[0]); @@ -6082,14 +6082,14 @@ void i386_device::sse_sqrtpd_r128_rm128() // Opcode 66 0f 51 void i386_device::sse_cvtpi2pd_r128_rm64() // Opcode 66 0f 2a { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { MMXPROLOG(); XMM((modrm >> 3) & 0x7).f64[0] = (double)MMX(modrm & 0x7).i[0]; XMM((modrm >> 3) & 0x7).f64[1] = (double)MMX(modrm & 0x7).i[1]; } else { MMX_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READMMX(ea, r); XMM((modrm >> 3) & 0x7).f64[0] = (double)r.i[0]; XMM((modrm >> 3) & 0x7).f64[1] = (double)r.i[1]; @@ -6099,14 +6099,14 @@ void i386_device::sse_cvtpi2pd_r128_rm64() // Opcode 66 0f 2a void i386_device::sse_cvttpd2pi_r64_rm128() // Opcode 66 0f 2c { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); MMXPROLOG(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).i[0] = XMM(modrm & 0x7).f64[0]; MMX((modrm >> 3) & 0x7).i[1] = XMM(modrm & 0x7).f64[1]; } else { XMM_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, r); MMX((modrm >> 3) & 0x7).i[0] = r.f64[0]; MMX((modrm >> 3) & 0x7).i[1] = r.f64[1]; @@ -6116,14 +6116,14 @@ void i386_device::sse_cvttpd2pi_r64_rm128() // Opcode 66 0f 2c void i386_device::sse_cvtpd2pi_r64_rm128() // Opcode 66 0f 2d { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); MMXPROLOG(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).i[0] = XMM(modrm & 0x7).f64[0]; MMX((modrm >> 3) & 0x7).i[1] = XMM(modrm & 0x7).f64[1]; } else { XMM_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, r); MMX((modrm >> 3) & 0x7).i[0] = r.f64[0]; MMX((modrm >> 3) & 0x7).i[1] = r.f64[1]; @@ -6133,14 +6133,14 @@ void i386_device::sse_cvtpd2pi_r64_rm128() // Opcode 66 0f 2d void i386_device::sse_cvtpd2ps_r128_rm128() // Opcode 66 0f 5a { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = (float)XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f[1] = (float)XMM(modrm & 0x7).f64[1]; XMM((modrm >> 3) & 0x7).q[1] = 0; } else { XMM_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, r); XMM((modrm >> 3) & 0x7).f[0] = (float)r.f64[0]; XMM((modrm >> 3) & 0x7).f[1] = (float)r.f64[1]; @@ -6151,7 +6151,7 @@ void i386_device::sse_cvtpd2ps_r128_rm128() // Opcode 66 0f 5a void i386_device::sse_cvtps2dq_r128_rm128() // Opcode 66 0f 5b { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).i[0] = XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).i[1] = XMM(modrm & 0x7).f[1]; @@ -6159,7 +6159,7 @@ void i386_device::sse_cvtps2dq_r128_rm128() // Opcode 66 0f 5b XMM((modrm >> 3) & 0x7).i[3] = XMM(modrm & 0x7).f[3]; } else { XMM_REG r; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, r); XMM((modrm >> 3) & 0x7).i[0] = r.f[0]; XMM((modrm >> 3) & 0x7).i[1] = r.f[1]; @@ -6171,13 +6171,13 @@ void i386_device::sse_cvtps2dq_r128_rm128() // Opcode 66 0f 5b void i386_device::sse_addpd_r128_rm128() // Opcode 66 0f 58 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] + XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] + XMM(modrm & 0x7).f64[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] + src.f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] + src.f64[1]; @@ -6187,13 +6187,13 @@ void i386_device::sse_addpd_r128_rm128() // Opcode 66 0f 58 void i386_device::sse_mulpd_r128_rm128() // Opcode 66 0f 59 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] * XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] * XMM(modrm & 0x7).f64[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] * src.f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] * src.f64[1]; @@ -6203,13 +6203,13 @@ void i386_device::sse_mulpd_r128_rm128() // Opcode 66 0f 59 void i386_device::sse_subpd_r128_rm128() // Opcode 66 0f 5c { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] - XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] - XMM(modrm & 0x7).f64[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] - src.f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] - src.f64[1]; @@ -6219,13 +6219,13 @@ void i386_device::sse_subpd_r128_rm128() // Opcode 66 0f 5c void i386_device::sse_minpd_r128_rm128() // Opcode 66 0f 5d { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = sse_min_double(XMM((modrm >> 3) & 0x7).f64[0], XMM(modrm & 0x7).f64[0]); XMM((modrm >> 3) & 0x7).f64[1] = sse_min_double(XMM((modrm >> 3) & 0x7).f64[1], XMM(modrm & 0x7).f64[1]); } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = sse_min_double(XMM((modrm >> 3) & 0x7).f64[0], src.f64[0]); XMM((modrm >> 3) & 0x7).f64[1] = sse_min_double(XMM((modrm >> 3) & 0x7).f64[1], src.f64[1]); @@ -6235,13 +6235,13 @@ void i386_device::sse_minpd_r128_rm128() // Opcode 66 0f 5d void i386_device::sse_divpd_r128_rm128() // Opcode 66 0f 5e { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] / XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] / XMM(modrm & 0x7).f64[1]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] / src.f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] / src.f64[1]; @@ -6251,13 +6251,13 @@ void i386_device::sse_divpd_r128_rm128() // Opcode 66 0f 5e void i386_device::sse_maxpd_r128_rm128() // Opcode 66 0f 5f { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = sse_max_double(XMM((modrm >> 3) & 0x7).f64[0], XMM(modrm & 0x7).f64[0]); XMM((modrm >> 3) & 0x7).f64[1] = sse_max_double(XMM((modrm >> 3) & 0x7).f64[1], XMM(modrm & 0x7).f64[1]); } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = sse_max_double(XMM((modrm >> 3) & 0x7).f64[0], src.f64[0]); XMM((modrm >> 3) & 0x7).f64[1] = sse_max_double(XMM((modrm >> 3) & 0x7).f64[1], src.f64[1]); @@ -6267,13 +6267,13 @@ void i386_device::sse_maxpd_r128_rm128() // Opcode 66 0f 5f void i386_device::sse_movntpd_m128_r128() // Opcode 66 0f 2b { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { // since cache is not implemented - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM(ea, XMM((modrm >> 3) & 0x7)); CYCLES(1); // TODO: correct cycle count } @@ -6281,11 +6281,11 @@ void i386_device::sse_movntpd_m128_r128() // Opcode 66 0f 2b void i386_device::sse_movapd_r128_rm128() // Opcode 66 0f 28 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7) = XMM(modrm & 0x7); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, XMM((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -6293,11 +6293,11 @@ void i386_device::sse_movapd_r128_rm128() // Opcode 66 0f 28 void i386_device::sse_movapd_rm128_r128() // Opcode 66 0f 29 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM(modrm & 0x7) = XMM((modrm >> 3) & 0x7); } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM(ea, XMM((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -6305,11 +6305,11 @@ void i386_device::sse_movapd_rm128_r128() // Opcode 66 0f 29 void i386_device::sse_movsd_r128_r128m64() // Opcode f2 0f 10 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM_LO64(ea, XMM((modrm >> 3) & 0x7)); XMM((modrm >> 3) & 0x7).q[1] = 0; } @@ -6318,11 +6318,11 @@ void i386_device::sse_movsd_r128_r128m64() // Opcode f2 0f 10 void i386_device::sse_movsd_r128m64_r128() // Opcode f2 0f 11 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM(modrm & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0]; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); WRITEXMM_LO64(ea, XMM((modrm >> 3) & 0x7)); } CYCLES(1); // TODO: correct cycle count @@ -6330,12 +6330,12 @@ void i386_device::sse_movsd_r128m64_r128() // Opcode f2 0f 11 void i386_device::sse_movddup_r128_r128m64() // Opcode f2 0f 12 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[0]; } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM_LO64(ea, XMM((modrm >> 3) & 0x7)); XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[0]; } @@ -6344,51 +6344,51 @@ void i386_device::sse_movddup_r128_r128m64() // Opcode f2 0f 12 void i386_device::sse_cvtsi2sd_r128_rm32() // Opcode f2 0f 2a { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - XMM((modrm >> 3) & 0x7).f64[0] = (INT32)LOAD_RM32(modrm); + XMM((modrm >> 3) & 0x7).f64[0] = (int32_t)LOAD_RM32(modrm); } else { - UINT32 ea = GetEA(modrm, 0); - XMM((modrm >> 3) & 0x7).f64[0] = (INT32)READ32(ea); + uint32_t ea = GetEA(modrm, 0); + XMM((modrm >> 3) & 0x7).f64[0] = (int32_t)READ32(ea); } CYCLES(1); // TODO: correct cycle count } void i386_device::sse_cvttsd2si_r32_r128m64() // Opcode f2 0f 2c { - INT32 src; - UINT8 modrm = FETCH(); + int32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - src = (INT32)XMM(modrm & 0x7).f64[0]; + src = (int32_t)XMM(modrm & 0x7).f64[0]; } else { // otherwise is a memory address XMM_REG t; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM_LO64(ea, t); - src = (INT32)t.f64[0]; + src = (int32_t)t.f64[0]; } - STORE_REG32(modrm, (UINT32)src); + STORE_REG32(modrm, (uint32_t)src); CYCLES(1); // TODO: correct cycle count } void i386_device::sse_cvtsd2si_r32_r128m64() // Opcode f2 0f 2d { - INT32 src; - UINT8 modrm = FETCH(); + int32_t src; + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - src = (INT32)XMM(modrm & 0x7).f64[0]; + src = (int32_t)XMM(modrm & 0x7).f64[0]; } else { // otherwise is a memory address XMM_REG t; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM_LO64(ea, t); - src = (INT32)t.f64[0]; + src = (int32_t)t.f64[0]; } - STORE_REG32(modrm, (UINT32)src); + STORE_REG32(modrm, (uint32_t)src); CYCLES(1); // TODO: correct cycle count } void i386_device::sse_sqrtsd_r128_r128m64() // Opcode f2 0f 51 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s, d; s=modrm & 0x7; @@ -6397,7 +6397,7 @@ void i386_device::sse_sqrtsd_r128_r128m64() // Opcode f2 0f 51 } else { XMM_REG src; int d; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); d=(modrm >> 3) & 0x7; READXMM(ea, src); XMM(d).f64[0]=sqrt(src.f64[0]); @@ -6407,12 +6407,12 @@ void i386_device::sse_sqrtsd_r128_r128m64() // Opcode f2 0f 51 void i386_device::sse_addsd_r128_r128m64() // Opcode f2 0f 58 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] + XMM(modrm & 0x7).f64[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] + src.f64[0]; } @@ -6421,12 +6421,12 @@ void i386_device::sse_addsd_r128_r128m64() // Opcode f2 0f 58 void i386_device::sse_mulsd_r128_r128m64() // Opcode f2 0f 59 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] * XMM(modrm & 0x7).f64[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] * src.f64[0]; } @@ -6435,12 +6435,12 @@ void i386_device::sse_mulsd_r128_r128m64() // Opcode f2 0f 59 void i386_device::sse_cvtsd2ss_r128_r128m64() // Opcode f2 0f 5a { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM(modrm & 0x7).f64[0]; } else { XMM_REG s; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM_LO64(ea, s); XMM((modrm >> 3) & 0x7).f[0] = s.f64[0]; } @@ -6449,12 +6449,12 @@ void i386_device::sse_cvtsd2ss_r128_r128m64() // Opcode f2 0f 5a void i386_device::sse_subsd_r128_r128m64() // Opcode f2 0f 5c { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] - XMM(modrm & 0x7).f64[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] - src.f64[0]; } @@ -6463,12 +6463,12 @@ void i386_device::sse_subsd_r128_r128m64() // Opcode f2 0f 5c void i386_device::sse_minsd_r128_r128m64() // Opcode f2 0f 5d { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = sse_min_double(XMM((modrm >> 3) & 0x7).f64[0], XMM(modrm & 0x7).f64[0]); } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = sse_min_double(XMM((modrm >> 3) & 0x7).f64[0], src.f64[0]); } @@ -6477,12 +6477,12 @@ void i386_device::sse_minsd_r128_r128m64() // Opcode f2 0f 5d void i386_device::sse_divsd_r128_r128m64() // Opcode f2 0f 5e { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] / XMM(modrm & 0x7).f64[0]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] / src.f64[0]; } @@ -6491,12 +6491,12 @@ void i386_device::sse_divsd_r128_r128m64() // Opcode f2 0f 5e void i386_device::sse_maxsd_r128_r128m64() // Opcode f2 0f 5f { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = sse_max_double(XMM((modrm >> 3) & 0x7).f64[0], XMM(modrm & 0x7).f64[0]); } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f64[0] = sse_max_double(XMM((modrm >> 3) & 0x7).f64[0], src.f64[0]); } @@ -6505,7 +6505,7 @@ void i386_device::sse_maxsd_r128_r128m64() // Opcode f2 0f 5f void i386_device::sse_haddps_r128_rm128() // Opcode f2 0f 7c { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s, d; float f1, f2, f3, f4; @@ -6523,7 +6523,7 @@ void i386_device::sse_haddps_r128_rm128() // Opcode f2 0f 7c XMM_REG src; int d; float f1, f2; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); d=(modrm >> 3) & 0x7; READXMM(ea, src); f1=XMM(d).f[0]+XMM(d).f[1]; @@ -6538,7 +6538,7 @@ void i386_device::sse_haddps_r128_rm128() // Opcode f2 0f 7c void i386_device::sse_hsubps_r128_rm128() // Opcode f2 0f 7d { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s, d; float f1, f2, f3, f4; @@ -6556,7 +6556,7 @@ void i386_device::sse_hsubps_r128_rm128() // Opcode f2 0f 7d XMM_REG src; int d; float f1, f2; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); d=(modrm >> 3) & 0x7; READXMM(ea, src); f1=XMM(d).f[0]-XMM(d).f[1]; @@ -6571,18 +6571,18 @@ void i386_device::sse_hsubps_r128_rm128() // Opcode f2 0f 7d void i386_device::sse_cmpsd_r128_r128m64_i8() // Opcode f2 0f c2 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int s,d; - UINT8 imm8 = FETCH(); + uint8_t imm8 = FETCH(); s=modrm & 0x7; d=(modrm >> 3) & 0x7; sse_predicate_compare_double_scalar(imm8, XMM(d), XMM(s)); } else { int d; XMM_REG s; - UINT32 ea = GetEA(modrm, 0); - UINT8 imm8 = FETCH(); + uint32_t ea = GetEA(modrm, 0); + uint8_t imm8 = FETCH(); READXMM_LO64(ea, s); d=(modrm >> 3) & 0x7; sse_predicate_compare_double_scalar(imm8, XMM(d), s); @@ -6592,7 +6592,7 @@ void i386_device::sse_cmpsd_r128_r128m64_i8() // Opcode f2 0f c2 void i386_device::sse_addsubps_r128_rm128() // Opcode f2 0f d0 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0]=XMM((modrm >> 3) & 0x7).f[0] - XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1]=XMM((modrm >> 3) & 0x7).f[1] + XMM(modrm & 0x7).f[1]; @@ -6600,7 +6600,7 @@ void i386_device::sse_addsubps_r128_rm128() // Opcode f2 0f d0 XMM((modrm >> 3) & 0x7).f[3]=XMM((modrm >> 3) & 0x7).f[3] + XMM(modrm & 0x7).f[3]; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); XMM((modrm >> 3) & 0x7).f[0]=XMM((modrm >> 3) & 0x7).f[0] - src.f[0]; XMM((modrm >> 3) & 0x7).f[1]=XMM((modrm >> 3) & 0x7).f[1] + src.f[1]; @@ -6612,7 +6612,7 @@ void i386_device::sse_addsubps_r128_rm128() // Opcode f2 0f d0 void i386_device::sse_movdq2q_r64_r128() // Opcode f2 0f d6 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); MMXPROLOG(); if( modrm >= 0xc0 ) { MMX((modrm >> 3) & 0x7).q = XMM(modrm & 0x7).q[0]; @@ -6625,17 +6625,17 @@ void i386_device::sse_movdq2q_r64_r128() // Opcode f2 0f d6 void i386_device::sse_cvtpd2dq_r128_rm128() // Opcode f2 0f e6 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { - XMM((modrm >> 3) & 0x7).i[0]=(INT32)XMM((modrm >> 3) & 0x7).f64[0]; - XMM((modrm >> 3) & 0x7).i[1]=(INT32)XMM((modrm >> 3) & 0x7).f64[1]; + XMM((modrm >> 3) & 0x7).i[0]=(int32_t)XMM((modrm >> 3) & 0x7).f64[0]; + XMM((modrm >> 3) & 0x7).i[1]=(int32_t)XMM((modrm >> 3) & 0x7).f64[1]; XMM((modrm >> 3) & 0x7).q[1] = 0; } else { XMM_REG src; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, src); - XMM((modrm >> 3) & 0x7).i[0]=(INT32)src.f64[0]; - XMM((modrm >> 3) & 0x7).i[1]=(INT32)src.f64[1]; + XMM((modrm >> 3) & 0x7).i[0]=(int32_t)src.f64[0]; + XMM((modrm >> 3) & 0x7).i[1]=(int32_t)src.f64[1]; XMM((modrm >> 3) & 0x7).q[1] = 0; } CYCLES(1); // TODO: correct cycle count @@ -6643,12 +6643,12 @@ void i386_device::sse_cvtpd2dq_r128_rm128() // Opcode f2 0f e6 void i386_device::sse_lddqu_r128_m128() // Opcode f2 0f f0 { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count } else { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); READXMM(ea, XMM((modrm >> 3) & 0x7)); } } diff --git a/src/devices/cpu/i386/x87ops.hxx b/src/devices/cpu/i386/x87ops.hxx index 1cc44e7b92f..505890f113c 100644 --- a/src/devices/cpu/i386/x87ops.hxx +++ b/src/devices/cpu/i386/x87ops.hxx @@ -153,16 +153,16 @@ static inline floatx80 floatx80_abs(floatx80 fx) static inline double fx80_to_double(floatx80 fx) { - UINT64 d = floatx80_to_float64(fx); + uint64_t d = floatx80_to_float64(fx); return *(double*)&d; } static inline floatx80 double_to_fx80(double in) { - return float64_to_floatx80(*(UINT64*)&in); + return float64_to_floatx80(*(uint64_t*)&in); } -floatx80 i386_device::READ80(UINT32 ea) +floatx80 i386_device::READ80(uint32_t ea) { floatx80 t; @@ -172,7 +172,7 @@ floatx80 i386_device::READ80(UINT32 ea) return t; } -void i386_device::WRITE80(UINT32 ea, floatx80 t) +void i386_device::WRITE80(uint32_t ea, floatx80 t) { WRITE64(ea, t.low); WRITE16(ea + 8, t.high); @@ -320,7 +320,7 @@ int i386_device::x87_check_exceptions() return 1; } -void i386_device::x87_write_cw(UINT16 cw) +void i386_device::x87_write_cw(uint16_t cw) { m_x87_cw = cw; @@ -481,11 +481,11 @@ floatx80 i386_device::x87_div(floatx80 a, floatx80 b) * *************************************/ -void i386_device::x87_fadd_m32real(UINT8 modrm) +void i386_device::x87_fadd_m32real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -493,7 +493,7 @@ void i386_device::x87_fadd_m32real(UINT8 modrm) } else { - UINT32 m32real = READ32(ea); + uint32_t m32real = READ32(ea); floatx80 a = ST(0); floatx80 b = float32_to_floatx80(m32real); @@ -516,11 +516,11 @@ void i386_device::x87_fadd_m32real(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fadd_m64real(UINT8 modrm) +void i386_device::x87_fadd_m64real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -528,7 +528,7 @@ void i386_device::x87_fadd_m64real(UINT8 modrm) } else { - UINT64 m64real = READ64(ea); + uint64_t m64real = READ64(ea); floatx80 a = ST(0); floatx80 b = float64_to_floatx80(m64real); @@ -551,7 +551,7 @@ void i386_device::x87_fadd_m64real(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fadd_st_sti(UINT8 modrm) +void i386_device::x87_fadd_st_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -584,7 +584,7 @@ void i386_device::x87_fadd_st_sti(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fadd_sti_st(UINT8 modrm) +void i386_device::x87_fadd_sti_st(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -617,7 +617,7 @@ void i386_device::x87_fadd_sti_st(UINT8 modrm) CYCLES(8); } -void i386_device::x87_faddp(UINT8 modrm) +void i386_device::x87_faddp(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -653,11 +653,11 @@ void i386_device::x87_faddp(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fiadd_m32int(UINT8 modrm) +void i386_device::x87_fiadd_m32int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -665,7 +665,7 @@ void i386_device::x87_fiadd_m32int(UINT8 modrm) } else { - INT32 m32int = READ32(ea); + int32_t m32int = READ32(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m32int); @@ -688,11 +688,11 @@ void i386_device::x87_fiadd_m32int(UINT8 modrm) CYCLES(19); } -void i386_device::x87_fiadd_m16int(UINT8 modrm) +void i386_device::x87_fiadd_m16int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -700,7 +700,7 @@ void i386_device::x87_fiadd_m16int(UINT8 modrm) } else { - INT16 m16int = READ16(ea); + int16_t m16int = READ16(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m16int); @@ -730,11 +730,11 @@ void i386_device::x87_fiadd_m16int(UINT8 modrm) * *************************************/ -void i386_device::x87_fsub_m32real(UINT8 modrm) +void i386_device::x87_fsub_m32real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -742,7 +742,7 @@ void i386_device::x87_fsub_m32real(UINT8 modrm) } else { - UINT32 m32real = READ32(ea); + uint32_t m32real = READ32(ea); floatx80 a = ST(0); floatx80 b = float32_to_floatx80(m32real); @@ -765,11 +765,11 @@ void i386_device::x87_fsub_m32real(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fsub_m64real(UINT8 modrm) +void i386_device::x87_fsub_m64real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -777,7 +777,7 @@ void i386_device::x87_fsub_m64real(UINT8 modrm) } else { - UINT64 m64real = READ64(ea); + uint64_t m64real = READ64(ea); floatx80 a = ST(0); floatx80 b = float64_to_floatx80(m64real); @@ -800,7 +800,7 @@ void i386_device::x87_fsub_m64real(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fsub_st_sti(UINT8 modrm) +void i386_device::x87_fsub_st_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -833,7 +833,7 @@ void i386_device::x87_fsub_st_sti(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fsub_sti_st(UINT8 modrm) +void i386_device::x87_fsub_sti_st(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -866,7 +866,7 @@ void i386_device::x87_fsub_sti_st(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fsubp(UINT8 modrm) +void i386_device::x87_fsubp(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -902,11 +902,11 @@ void i386_device::x87_fsubp(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fisub_m32int(UINT8 modrm) +void i386_device::x87_fisub_m32int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -914,7 +914,7 @@ void i386_device::x87_fisub_m32int(UINT8 modrm) } else { - INT32 m32int = READ32(ea); + int32_t m32int = READ32(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m32int); @@ -937,11 +937,11 @@ void i386_device::x87_fisub_m32int(UINT8 modrm) CYCLES(19); } -void i386_device::x87_fisub_m16int(UINT8 modrm) +void i386_device::x87_fisub_m16int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -949,7 +949,7 @@ void i386_device::x87_fisub_m16int(UINT8 modrm) } else { - INT16 m16int = READ16(ea); + int16_t m16int = READ16(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m16int); @@ -979,11 +979,11 @@ void i386_device::x87_fisub_m16int(UINT8 modrm) * *************************************/ -void i386_device::x87_fsubr_m32real(UINT8 modrm) +void i386_device::x87_fsubr_m32real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -991,7 +991,7 @@ void i386_device::x87_fsubr_m32real(UINT8 modrm) } else { - UINT32 m32real = READ32(ea); + uint32_t m32real = READ32(ea); floatx80 a = float32_to_floatx80(m32real); floatx80 b = ST(0); @@ -1014,11 +1014,11 @@ void i386_device::x87_fsubr_m32real(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fsubr_m64real(UINT8 modrm) +void i386_device::x87_fsubr_m64real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1026,7 +1026,7 @@ void i386_device::x87_fsubr_m64real(UINT8 modrm) } else { - UINT64 m64real = READ64(ea); + uint64_t m64real = READ64(ea); floatx80 a = float64_to_floatx80(m64real); floatx80 b = ST(0); @@ -1049,7 +1049,7 @@ void i386_device::x87_fsubr_m64real(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fsubr_st_sti(UINT8 modrm) +void i386_device::x87_fsubr_st_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -1082,7 +1082,7 @@ void i386_device::x87_fsubr_st_sti(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fsubr_sti_st(UINT8 modrm) +void i386_device::x87_fsubr_sti_st(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -1115,7 +1115,7 @@ void i386_device::x87_fsubr_sti_st(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fsubrp(UINT8 modrm) +void i386_device::x87_fsubrp(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -1151,11 +1151,11 @@ void i386_device::x87_fsubrp(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fisubr_m32int(UINT8 modrm) +void i386_device::x87_fisubr_m32int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1163,7 +1163,7 @@ void i386_device::x87_fisubr_m32int(UINT8 modrm) } else { - INT32 m32int = READ32(ea); + int32_t m32int = READ32(ea); floatx80 a = int32_to_floatx80(m32int); floatx80 b = ST(0); @@ -1186,11 +1186,11 @@ void i386_device::x87_fisubr_m32int(UINT8 modrm) CYCLES(19); } -void i386_device::x87_fisubr_m16int(UINT8 modrm) +void i386_device::x87_fisubr_m16int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1198,7 +1198,7 @@ void i386_device::x87_fisubr_m16int(UINT8 modrm) } else { - INT16 m16int = READ16(ea); + int16_t m16int = READ16(ea); floatx80 a = int32_to_floatx80(m16int); floatx80 b = ST(0); @@ -1228,11 +1228,11 @@ void i386_device::x87_fisubr_m16int(UINT8 modrm) * *************************************/ -void i386_device::x87_fdiv_m32real(UINT8 modrm) +void i386_device::x87_fdiv_m32real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1240,7 +1240,7 @@ void i386_device::x87_fdiv_m32real(UINT8 modrm) } else { - UINT32 m32real = READ32(ea); + uint32_t m32real = READ32(ea); floatx80 a = ST(0); floatx80 b = float32_to_floatx80(m32real); @@ -1263,11 +1263,11 @@ void i386_device::x87_fdiv_m32real(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fdiv_m64real(UINT8 modrm) +void i386_device::x87_fdiv_m64real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1275,7 +1275,7 @@ void i386_device::x87_fdiv_m64real(UINT8 modrm) } else { - UINT64 m64real = READ64(ea); + uint64_t m64real = READ64(ea); floatx80 a = ST(0); floatx80 b = float64_to_floatx80(m64real); @@ -1298,7 +1298,7 @@ void i386_device::x87_fdiv_m64real(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fdiv_st_sti(UINT8 modrm) +void i386_device::x87_fdiv_st_sti(uint8_t modrm) { int i = modrm & 7; floatx80 result; @@ -1333,7 +1333,7 @@ void i386_device::x87_fdiv_st_sti(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fdiv_sti_st(UINT8 modrm) +void i386_device::x87_fdiv_sti_st(uint8_t modrm) { int i = modrm & 7; floatx80 result; @@ -1368,7 +1368,7 @@ void i386_device::x87_fdiv_sti_st(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fdivp(UINT8 modrm) +void i386_device::x87_fdivp(uint8_t modrm) { int i = modrm & 7; floatx80 result; @@ -1404,11 +1404,11 @@ void i386_device::x87_fdivp(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fidiv_m32int(UINT8 modrm) +void i386_device::x87_fidiv_m32int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1416,7 +1416,7 @@ void i386_device::x87_fidiv_m32int(UINT8 modrm) } else { - INT32 m32int = READ32(ea); + int32_t m32int = READ32(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m32int); @@ -1439,11 +1439,11 @@ void i386_device::x87_fidiv_m32int(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fidiv_m16int(UINT8 modrm) +void i386_device::x87_fidiv_m16int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1451,7 +1451,7 @@ void i386_device::x87_fidiv_m16int(UINT8 modrm) } else { - INT16 m16int = READ32(ea); + int16_t m16int = READ32(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m16int); @@ -1481,11 +1481,11 @@ void i386_device::x87_fidiv_m16int(UINT8 modrm) * *************************************/ -void i386_device::x87_fdivr_m32real(UINT8 modrm) +void i386_device::x87_fdivr_m32real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1493,7 +1493,7 @@ void i386_device::x87_fdivr_m32real(UINT8 modrm) } else { - UINT32 m32real = READ32(ea); + uint32_t m32real = READ32(ea); floatx80 a = float32_to_floatx80(m32real); floatx80 b = ST(0); @@ -1516,11 +1516,11 @@ void i386_device::x87_fdivr_m32real(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fdivr_m64real(UINT8 modrm) +void i386_device::x87_fdivr_m64real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1528,7 +1528,7 @@ void i386_device::x87_fdivr_m64real(UINT8 modrm) } else { - UINT64 m64real = READ64(ea); + uint64_t m64real = READ64(ea); floatx80 a = float64_to_floatx80(m64real); floatx80 b = ST(0); @@ -1551,7 +1551,7 @@ void i386_device::x87_fdivr_m64real(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fdivr_st_sti(UINT8 modrm) +void i386_device::x87_fdivr_st_sti(uint8_t modrm) { int i = modrm & 7; floatx80 result; @@ -1586,7 +1586,7 @@ void i386_device::x87_fdivr_st_sti(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fdivr_sti_st(UINT8 modrm) +void i386_device::x87_fdivr_sti_st(uint8_t modrm) { int i = modrm & 7; floatx80 result; @@ -1621,7 +1621,7 @@ void i386_device::x87_fdivr_sti_st(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fdivrp(UINT8 modrm) +void i386_device::x87_fdivrp(uint8_t modrm) { int i = modrm & 7; floatx80 result; @@ -1658,11 +1658,11 @@ void i386_device::x87_fdivrp(UINT8 modrm) } -void i386_device::x87_fidivr_m32int(UINT8 modrm) +void i386_device::x87_fidivr_m32int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1670,7 +1670,7 @@ void i386_device::x87_fidivr_m32int(UINT8 modrm) } else { - INT32 m32int = READ32(ea); + int32_t m32int = READ32(ea); floatx80 a = int32_to_floatx80(m32int); floatx80 b = ST(0); @@ -1693,11 +1693,11 @@ void i386_device::x87_fidivr_m32int(UINT8 modrm) CYCLES(73); } -void i386_device::x87_fidivr_m16int(UINT8 modrm) +void i386_device::x87_fidivr_m16int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1705,7 +1705,7 @@ void i386_device::x87_fidivr_m16int(UINT8 modrm) } else { - INT16 m16int = READ32(ea); + int16_t m16int = READ32(ea); floatx80 a = int32_to_floatx80(m16int); floatx80 b = ST(0); @@ -1735,11 +1735,11 @@ void i386_device::x87_fidivr_m16int(UINT8 modrm) * *************************************/ -void i386_device::x87_fmul_m32real(UINT8 modrm) +void i386_device::x87_fmul_m32real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1747,7 +1747,7 @@ void i386_device::x87_fmul_m32real(UINT8 modrm) } else { - UINT32 m32real = READ32(ea); + uint32_t m32real = READ32(ea); floatx80 a = ST(0); floatx80 b = float32_to_floatx80(m32real); @@ -1769,11 +1769,11 @@ void i386_device::x87_fmul_m32real(UINT8 modrm) CYCLES(11); } -void i386_device::x87_fmul_m64real(UINT8 modrm) +void i386_device::x87_fmul_m64real(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1781,7 +1781,7 @@ void i386_device::x87_fmul_m64real(UINT8 modrm) } else { - UINT64 m64real = READ64(ea); + uint64_t m64real = READ64(ea); floatx80 a = ST(0); floatx80 b = float64_to_floatx80(m64real); @@ -1803,7 +1803,7 @@ void i386_device::x87_fmul_m64real(UINT8 modrm) CYCLES(14); } -void i386_device::x87_fmul_st_sti(UINT8 modrm) +void i386_device::x87_fmul_st_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -1835,7 +1835,7 @@ void i386_device::x87_fmul_st_sti(UINT8 modrm) CYCLES(16); } -void i386_device::x87_fmul_sti_st(UINT8 modrm) +void i386_device::x87_fmul_sti_st(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -1867,7 +1867,7 @@ void i386_device::x87_fmul_sti_st(UINT8 modrm) CYCLES(16); } -void i386_device::x87_fmulp(UINT8 modrm) +void i386_device::x87_fmulp(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -1902,11 +1902,11 @@ void i386_device::x87_fmulp(UINT8 modrm) CYCLES(16); } -void i386_device::x87_fimul_m32int(UINT8 modrm) +void i386_device::x87_fimul_m32int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1914,7 +1914,7 @@ void i386_device::x87_fimul_m32int(UINT8 modrm) } else { - INT32 m32int = READ32(ea); + int32_t m32int = READ32(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m32int); @@ -1936,11 +1936,11 @@ void i386_device::x87_fimul_m32int(UINT8 modrm) CYCLES(22); } -void i386_device::x87_fimul_m16int(UINT8 modrm) +void i386_device::x87_fimul_m16int(uint8_t modrm) { floatx80 result; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -1948,7 +1948,7 @@ void i386_device::x87_fimul_m16int(UINT8 modrm) } else { - INT16 m16int = READ16(ea); + int16_t m16int = READ16(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m16int); @@ -1976,7 +1976,7 @@ void i386_device::x87_fimul_m16int(UINT8 modrm) * *************************************/ -void i386_device::x87_fcmovb_sti(UINT8 modrm) +void i386_device::x87_fcmovb_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -2000,7 +2000,7 @@ void i386_device::x87_fcmovb_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcmove_sti(UINT8 modrm) +void i386_device::x87_fcmove_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -2024,7 +2024,7 @@ void i386_device::x87_fcmove_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcmovbe_sti(UINT8 modrm) +void i386_device::x87_fcmovbe_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -2048,7 +2048,7 @@ void i386_device::x87_fcmovbe_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcmovu_sti(UINT8 modrm) +void i386_device::x87_fcmovu_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -2072,7 +2072,7 @@ void i386_device::x87_fcmovu_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcmovnb_sti(UINT8 modrm) +void i386_device::x87_fcmovnb_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -2096,7 +2096,7 @@ void i386_device::x87_fcmovnb_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcmovne_sti(UINT8 modrm) +void i386_device::x87_fcmovne_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -2120,7 +2120,7 @@ void i386_device::x87_fcmovne_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcmovnbe_sti(UINT8 modrm) +void i386_device::x87_fcmovnbe_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -2144,7 +2144,7 @@ void i386_device::x87_fcmovnbe_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcmovnu_sti(UINT8 modrm) +void i386_device::x87_fcmovnu_sti(uint8_t modrm) { floatx80 result; int i = modrm & 7; @@ -2174,7 +2174,7 @@ void i386_device::x87_fcmovnu_sti(UINT8 modrm) * *************************************/ -void i386_device::x87_fprem(UINT8 modrm) +void i386_device::x87_fprem(uint8_t modrm) { floatx80 result; @@ -2228,7 +2228,7 @@ void i386_device::x87_fprem(UINT8 modrm) CYCLES(84); } -void i386_device::x87_fprem1(UINT8 modrm) +void i386_device::x87_fprem1(uint8_t modrm) { floatx80 result; @@ -2254,7 +2254,7 @@ void i386_device::x87_fprem1(UINT8 modrm) CYCLES(94); } -void i386_device::x87_fsqrt(UINT8 modrm) +void i386_device::x87_fsqrt(uint8_t modrm) { floatx80 result; @@ -2291,7 +2291,7 @@ void i386_device::x87_fsqrt(UINT8 modrm) * *************************************/ -void i386_device::x87_f2xm1(UINT8 modrm) +void i386_device::x87_f2xm1(uint8_t modrm) { floatx80 result; @@ -2316,7 +2316,7 @@ void i386_device::x87_f2xm1(UINT8 modrm) CYCLES(242); } -void i386_device::x87_fyl2x(UINT8 modrm) +void i386_device::x87_fyl2x(uint8_t modrm) { floatx80 result; @@ -2353,7 +2353,7 @@ void i386_device::x87_fyl2x(UINT8 modrm) CYCLES(250); } -void i386_device::x87_fyl2xp1(UINT8 modrm) +void i386_device::x87_fyl2xp1(uint8_t modrm) { floatx80 result; @@ -2382,7 +2382,7 @@ void i386_device::x87_fyl2xp1(UINT8 modrm) CYCLES(313); } -void i386_device::x87_fptan(UINT8 modrm) +void i386_device::x87_fptan(uint8_t modrm) { floatx80 result1, result2; @@ -2427,7 +2427,7 @@ void i386_device::x87_fptan(UINT8 modrm) CYCLES(244); } -void i386_device::x87_fpatan(UINT8 modrm) +void i386_device::x87_fpatan(uint8_t modrm) { floatx80 result; @@ -2452,7 +2452,7 @@ void i386_device::x87_fpatan(UINT8 modrm) CYCLES(289); } -void i386_device::x87_fsin(UINT8 modrm) +void i386_device::x87_fsin(uint8_t modrm) { floatx80 result; @@ -2485,7 +2485,7 @@ void i386_device::x87_fsin(UINT8 modrm) CYCLES(241); } -void i386_device::x87_fcos(UINT8 modrm) +void i386_device::x87_fcos(uint8_t modrm) { floatx80 result; @@ -2518,7 +2518,7 @@ void i386_device::x87_fcos(UINT8 modrm) CYCLES(241); } -void i386_device::x87_fsincos(UINT8 modrm) +void i386_device::x87_fsincos(uint8_t modrm) { floatx80 s_result, c_result; @@ -2573,14 +2573,14 @@ void i386_device::x87_fsincos(UINT8 modrm) * *************************************/ -void i386_device::x87_fld_m32real(UINT8 modrm) +void i386_device::x87_fld_m32real(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (x87_dec_stack()) { - UINT32 m32real = READ32(ea); + uint32_t m32real = READ32(ea); value = float32_to_floatx80(m32real); @@ -2603,14 +2603,14 @@ void i386_device::x87_fld_m32real(UINT8 modrm) CYCLES(3); } -void i386_device::x87_fld_m64real(UINT8 modrm) +void i386_device::x87_fld_m64real(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (x87_dec_stack()) { - UINT64 m64real = READ64(ea); + uint64_t m64real = READ64(ea); value = float64_to_floatx80(m64real); @@ -2633,11 +2633,11 @@ void i386_device::x87_fld_m64real(UINT8 modrm) CYCLES(3); } -void i386_device::x87_fld_m80real(UINT8 modrm) +void i386_device::x87_fld_m80real(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (x87_dec_stack()) { m_x87_sw &= ~X87_SW_C1; @@ -2654,7 +2654,7 @@ void i386_device::x87_fld_m80real(UINT8 modrm) CYCLES(6); } -void i386_device::x87_fld_sti(UINT8 modrm) +void i386_device::x87_fld_sti(uint8_t modrm) { floatx80 value; @@ -2674,11 +2674,11 @@ void i386_device::x87_fld_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fild_m16int(UINT8 modrm) +void i386_device::x87_fild_m16int(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (!x87_dec_stack()) { value = fx80_inan; @@ -2687,7 +2687,7 @@ void i386_device::x87_fild_m16int(UINT8 modrm) { m_x87_sw &= ~X87_SW_C1; - INT16 m16int = READ16(ea); + int16_t m16int = READ16(ea); value = int32_to_floatx80(m16int); } @@ -2697,11 +2697,11 @@ void i386_device::x87_fild_m16int(UINT8 modrm) CYCLES(13); } -void i386_device::x87_fild_m32int(UINT8 modrm) +void i386_device::x87_fild_m32int(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (!x87_dec_stack()) { value = fx80_inan; @@ -2710,7 +2710,7 @@ void i386_device::x87_fild_m32int(UINT8 modrm) { m_x87_sw &= ~X87_SW_C1; - INT32 m32int = READ32(ea); + int32_t m32int = READ32(ea); value = int32_to_floatx80(m32int); } @@ -2720,11 +2720,11 @@ void i386_device::x87_fild_m32int(UINT8 modrm) CYCLES(9); } -void i386_device::x87_fild_m64int(UINT8 modrm) +void i386_device::x87_fild_m64int(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (!x87_dec_stack()) { value = fx80_inan; @@ -2733,7 +2733,7 @@ void i386_device::x87_fild_m64int(UINT8 modrm) { m_x87_sw &= ~X87_SW_C1; - INT64 m64int = READ64(ea); + int64_t m64int = READ64(ea); value = int64_to_floatx80(m64int); } @@ -2743,11 +2743,11 @@ void i386_device::x87_fild_m64int(UINT8 modrm) CYCLES(10); } -void i386_device::x87_fbld(UINT8 modrm) +void i386_device::x87_fbld(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (!x87_dec_stack()) { value = fx80_inan; @@ -2756,8 +2756,8 @@ void i386_device::x87_fbld(UINT8 modrm) { m_x87_sw &= ~X87_SW_C1; - UINT64 m64val = 0; - UINT16 sign; + uint64_t m64val = 0; + uint16_t sign; value = READ80(ea); @@ -2788,11 +2788,11 @@ void i386_device::x87_fbld(UINT8 modrm) * *************************************/ -void i386_device::x87_fst_m32real(UINT8 modrm) +void i386_device::x87_fst_m32real(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2806,18 +2806,18 @@ void i386_device::x87_fst_m32real(UINT8 modrm) if (x87_check_exceptions()) { - UINT32 m32real = floatx80_to_float32(value); + uint32_t m32real = floatx80_to_float32(value); WRITE32(ea, m32real); } CYCLES(7); } -void i386_device::x87_fst_m64real(UINT8 modrm) +void i386_device::x87_fst_m64real(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2831,14 +2831,14 @@ void i386_device::x87_fst_m64real(UINT8 modrm) if (x87_check_exceptions()) { - UINT64 m64real = floatx80_to_float64(value); + uint64_t m64real = floatx80_to_float64(value); WRITE64(ea, m64real); } CYCLES(8); } -void i386_device::x87_fst_sti(UINT8 modrm) +void i386_device::x87_fst_sti(uint8_t modrm) { int i = modrm & 7; floatx80 value; @@ -2860,11 +2860,11 @@ void i386_device::x87_fst_sti(UINT8 modrm) CYCLES(3); } -void i386_device::x87_fstp_m32real(UINT8 modrm) +void i386_device::x87_fstp_m32real(uint8_t modrm) { floatx80 value; - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -2878,7 +2878,7 @@ void i386_device::x87_fstp_m32real(UINT8 modrm) if (x87_check_exceptions()) { - UINT32 m32real = floatx80_to_float32(value); + uint32_t m32real = floatx80_to_float32(value); WRITE32(ea, m32real); x87_inc_stack(); } @@ -2886,7 +2886,7 @@ void i386_device::x87_fstp_m32real(UINT8 modrm) CYCLES(7); } -void i386_device::x87_fstp_m64real(UINT8 modrm) +void i386_device::x87_fstp_m64real(uint8_t modrm) { floatx80 value; @@ -2902,10 +2902,10 @@ void i386_device::x87_fstp_m64real(UINT8 modrm) } - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (x87_check_exceptions()) { - UINT64 m64real = floatx80_to_float64(value); + uint64_t m64real = floatx80_to_float64(value); WRITE64(ea, m64real); x87_inc_stack(); } @@ -2913,7 +2913,7 @@ void i386_device::x87_fstp_m64real(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fstp_m80real(UINT8 modrm) +void i386_device::x87_fstp_m80real(uint8_t modrm) { floatx80 value; @@ -2928,7 +2928,7 @@ void i386_device::x87_fstp_m80real(UINT8 modrm) value = ST(0); } - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (x87_check_exceptions()) { WRITE80(ea, value); @@ -2938,7 +2938,7 @@ void i386_device::x87_fstp_m80real(UINT8 modrm) CYCLES(6); } -void i386_device::x87_fstp_sti(UINT8 modrm) +void i386_device::x87_fstp_sti(uint8_t modrm) { int i = modrm & 7; floatx80 value; @@ -2963,9 +2963,9 @@ void i386_device::x87_fstp_sti(UINT8 modrm) CYCLES(3); } -void i386_device::x87_fist_m16int(UINT8 modrm) +void i386_device::x87_fist_m16int(uint8_t modrm) { - INT16 m16int; + int16_t m16int; if (X87_IS_ST_EMPTY(0)) { @@ -2987,7 +2987,7 @@ void i386_device::x87_fist_m16int(UINT8 modrm) m16int = -32768; } - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (x87_check_exceptions()) { WRITE16(ea, m16int); @@ -2996,9 +2996,9 @@ void i386_device::x87_fist_m16int(UINT8 modrm) CYCLES(29); } -void i386_device::x87_fist_m32int(UINT8 modrm) +void i386_device::x87_fist_m32int(uint8_t modrm) { - INT32 m32int; + int32_t m32int; if (X87_IS_ST_EMPTY(0)) { @@ -3020,7 +3020,7 @@ void i386_device::x87_fist_m32int(UINT8 modrm) m32int = 0x80000000; } - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (x87_check_exceptions()) { WRITE32(ea, m32int); @@ -3029,14 +3029,14 @@ void i386_device::x87_fist_m32int(UINT8 modrm) CYCLES(28); } -void i386_device::x87_fistp_m16int(UINT8 modrm) +void i386_device::x87_fistp_m16int(uint8_t modrm) { - INT16 m16int; + int16_t m16int; if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); - m16int = (UINT16)0x8000; + m16int = (uint16_t)0x8000; } else { @@ -3050,10 +3050,10 @@ void i386_device::x87_fistp_m16int(UINT8 modrm) if (!floatx80_lt(fx80, lowerLim) && floatx80_le(fx80, upperLim)) m16int = floatx80_to_int32(fx80); else - m16int = (UINT16)0x8000; + m16int = (uint16_t)0x8000; } - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (x87_check_exceptions()) { WRITE16(ea, m16int); @@ -3063,9 +3063,9 @@ void i386_device::x87_fistp_m16int(UINT8 modrm) CYCLES(29); } -void i386_device::x87_fistp_m32int(UINT8 modrm) +void i386_device::x87_fistp_m32int(uint8_t modrm) { - INT32 m32int; + int32_t m32int; if (X87_IS_ST_EMPTY(0)) { @@ -3087,7 +3087,7 @@ void i386_device::x87_fistp_m32int(UINT8 modrm) m32int = 0x80000000; } - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (x87_check_exceptions()) { WRITE32(ea, m32int); @@ -3097,9 +3097,9 @@ void i386_device::x87_fistp_m32int(UINT8 modrm) CYCLES(29); } -void i386_device::x87_fistp_m64int(UINT8 modrm) +void i386_device::x87_fistp_m64int(uint8_t modrm) { - INT64 m64int; + int64_t m64int; if (X87_IS_ST_EMPTY(0)) { @@ -3121,7 +3121,7 @@ void i386_device::x87_fistp_m64int(UINT8 modrm) m64int = U64(0x8000000000000000); } - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (x87_check_exceptions()) { WRITE64(ea, m64int); @@ -3131,7 +3131,7 @@ void i386_device::x87_fistp_m64int(UINT8 modrm) CYCLES(29); } -void i386_device::x87_fbstp(UINT8 modrm) +void i386_device::x87_fbstp(uint8_t modrm) { floatx80 result; @@ -3142,7 +3142,7 @@ void i386_device::x87_fbstp(UINT8 modrm) } else { - UINT64 u64 = floatx80_to_int64(floatx80_abs(ST(0))); + uint64_t u64 = floatx80_to_int64(floatx80_abs(ST(0))); result.low = 0; for (int i = 0; i < 64; i += 4) @@ -3156,7 +3156,7 @@ void i386_device::x87_fbstp(UINT8 modrm) result.high |= ST(0).high & 0x8000; } - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); if (x87_check_exceptions()) { WRITE80(ea, result); @@ -3173,7 +3173,7 @@ void i386_device::x87_fbstp(UINT8 modrm) * *************************************/ -void i386_device::x87_fld1(UINT8 modrm) +void i386_device::x87_fld1(uint8_t modrm) { floatx80 value; int tag; @@ -3199,7 +3199,7 @@ void i386_device::x87_fld1(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fldl2t(UINT8 modrm) +void i386_device::x87_fldl2t(uint8_t modrm) { floatx80 value; int tag; @@ -3231,7 +3231,7 @@ void i386_device::x87_fldl2t(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fldl2e(UINT8 modrm) +void i386_device::x87_fldl2e(uint8_t modrm) { floatx80 value; int tag; @@ -3264,7 +3264,7 @@ void i386_device::x87_fldl2e(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fldpi(UINT8 modrm) +void i386_device::x87_fldpi(uint8_t modrm) { floatx80 value; int tag; @@ -3297,7 +3297,7 @@ void i386_device::x87_fldpi(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fldlg2(UINT8 modrm) +void i386_device::x87_fldlg2(uint8_t modrm) { floatx80 value; int tag; @@ -3330,7 +3330,7 @@ void i386_device::x87_fldlg2(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fldln2(UINT8 modrm) +void i386_device::x87_fldln2(uint8_t modrm) { floatx80 value; int tag; @@ -3363,7 +3363,7 @@ void i386_device::x87_fldln2(UINT8 modrm) CYCLES(8); } -void i386_device::x87_fldz(UINT8 modrm) +void i386_device::x87_fldz(uint8_t modrm) { floatx80 value; int tag; @@ -3396,12 +3396,12 @@ void i386_device::x87_fldz(UINT8 modrm) * *************************************/ -void i386_device::x87_fnop(UINT8 modrm) +void i386_device::x87_fnop(uint8_t modrm) { CYCLES(3); } -void i386_device::x87_fchs(UINT8 modrm) +void i386_device::x87_fchs(uint8_t modrm) { floatx80 value; @@ -3424,7 +3424,7 @@ void i386_device::x87_fchs(UINT8 modrm) CYCLES(6); } -void i386_device::x87_fabs(UINT8 modrm) +void i386_device::x87_fabs(uint8_t modrm) { floatx80 value; @@ -3447,7 +3447,7 @@ void i386_device::x87_fabs(UINT8 modrm) CYCLES(6); } -void i386_device::x87_fscale(UINT8 modrm) +void i386_device::x87_fscale(uint8_t modrm) { floatx80 value; @@ -3462,18 +3462,18 @@ void i386_device::x87_fscale(UINT8 modrm) value = ST(0); // Set the rounding mode to truncate - UINT16 old_cw = m_x87_cw; - UINT16 new_cw = (old_cw & ~(X87_CW_RC_MASK << X87_CW_RC_SHIFT)) | (X87_CW_RC_ZERO << X87_CW_RC_SHIFT); + uint16_t old_cw = m_x87_cw; + uint16_t new_cw = (old_cw & ~(X87_CW_RC_MASK << X87_CW_RC_SHIFT)) | (X87_CW_RC_ZERO << X87_CW_RC_SHIFT); x87_write_cw(new_cw); // Interpret ST(1) as an integer - UINT32 st1 = floatx80_to_int32(floatx80_round_to_int(ST(1))); + uint32_t st1 = floatx80_to_int32(floatx80_round_to_int(ST(1))); // Restore the rounding mode x87_write_cw(old_cw); // Get the unbiased exponent of ST(0) - INT16 exp = (ST(0).high & 0x7fff) - 0x3fff; + int16_t exp = (ST(0).high & 0x7fff) - 0x3fff; // Calculate the new exponent exp = (exp + st1 + 0x3fff) & 0x7fff; @@ -3488,7 +3488,7 @@ void i386_device::x87_fscale(UINT8 modrm) CYCLES(31); } -void i386_device::x87_frndint(UINT8 modrm) +void i386_device::x87_frndint(uint8_t modrm) { floatx80 value; @@ -3510,7 +3510,7 @@ void i386_device::x87_frndint(UINT8 modrm) CYCLES(21); } -void i386_device::x87_fxtract(UINT8 modrm) +void i386_device::x87_fxtract(uint8_t modrm) { floatx80 sig80, exp80; @@ -3563,7 +3563,7 @@ void i386_device::x87_fxtract(UINT8 modrm) * *************************************/ -void i386_device::x87_ftst(UINT8 modrm) +void i386_device::x87_ftst(uint8_t modrm) { if (X87_IS_ST_EMPTY(0)) { @@ -3594,7 +3594,7 @@ void i386_device::x87_ftst(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fxam(UINT8 modrm) +void i386_device::x87_fxam(uint8_t modrm) { floatx80 value = ST(0); @@ -3628,9 +3628,9 @@ void i386_device::x87_fxam(UINT8 modrm) CYCLES(8); } -void i386_device::x87_ficom_m16int(UINT8 modrm) +void i386_device::x87_ficom_m16int(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3640,7 +3640,7 @@ void i386_device::x87_ficom_m16int(UINT8 modrm) { m_x87_sw &= ~(X87_SW_C3 | X87_SW_C2 | X87_SW_C1 | X87_SW_C0); - INT16 m16int = READ16(ea); + int16_t m16int = READ16(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m16int); @@ -3665,9 +3665,9 @@ void i386_device::x87_ficom_m16int(UINT8 modrm) CYCLES(16); } -void i386_device::x87_ficom_m32int(UINT8 modrm) +void i386_device::x87_ficom_m32int(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3677,7 +3677,7 @@ void i386_device::x87_ficom_m32int(UINT8 modrm) { m_x87_sw &= ~(X87_SW_C3 | X87_SW_C2 | X87_SW_C1 | X87_SW_C0); - INT32 m32int = READ32(ea); + int32_t m32int = READ32(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m32int); @@ -3702,9 +3702,9 @@ void i386_device::x87_ficom_m32int(UINT8 modrm) CYCLES(15); } -void i386_device::x87_ficomp_m16int(UINT8 modrm) +void i386_device::x87_ficomp_m16int(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3714,7 +3714,7 @@ void i386_device::x87_ficomp_m16int(UINT8 modrm) { m_x87_sw &= ~(X87_SW_C3 | X87_SW_C2 | X87_SW_C1 | X87_SW_C0); - INT16 m16int = READ16(ea); + int16_t m16int = READ16(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m16int); @@ -3740,9 +3740,9 @@ void i386_device::x87_ficomp_m16int(UINT8 modrm) CYCLES(16); } -void i386_device::x87_ficomp_m32int(UINT8 modrm) +void i386_device::x87_ficomp_m32int(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3752,7 +3752,7 @@ void i386_device::x87_ficomp_m32int(UINT8 modrm) { m_x87_sw &= ~(X87_SW_C3 | X87_SW_C2 | X87_SW_C1 | X87_SW_C0); - INT32 m32int = READ32(ea); + int32_t m32int = READ32(ea); floatx80 a = ST(0); floatx80 b = int32_to_floatx80(m32int); @@ -3779,9 +3779,9 @@ void i386_device::x87_ficomp_m32int(UINT8 modrm) } -void i386_device::x87_fcom_m32real(UINT8 modrm) +void i386_device::x87_fcom_m32real(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3791,7 +3791,7 @@ void i386_device::x87_fcom_m32real(UINT8 modrm) { m_x87_sw &= ~(X87_SW_C3 | X87_SW_C2 | X87_SW_C1 | X87_SW_C0); - UINT32 m32real = READ32(ea); + uint32_t m32real = READ32(ea); floatx80 a = ST(0); floatx80 b = float32_to_floatx80(m32real); @@ -3816,9 +3816,9 @@ void i386_device::x87_fcom_m32real(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcom_m64real(UINT8 modrm) +void i386_device::x87_fcom_m64real(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3828,7 +3828,7 @@ void i386_device::x87_fcom_m64real(UINT8 modrm) { m_x87_sw &= ~(X87_SW_C3 | X87_SW_C2 | X87_SW_C1 | X87_SW_C0); - UINT64 m64real = READ64(ea); + uint64_t m64real = READ64(ea); floatx80 a = ST(0); floatx80 b = float64_to_floatx80(m64real); @@ -3853,7 +3853,7 @@ void i386_device::x87_fcom_m64real(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcom_sti(UINT8 modrm) +void i386_device::x87_fcom_sti(uint8_t modrm) { int i = modrm & 7; @@ -3889,9 +3889,9 @@ void i386_device::x87_fcom_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcomp_m32real(UINT8 modrm) +void i386_device::x87_fcomp_m32real(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3901,7 +3901,7 @@ void i386_device::x87_fcomp_m32real(UINT8 modrm) { m_x87_sw &= ~(X87_SW_C3 | X87_SW_C2 | X87_SW_C1 | X87_SW_C0); - UINT32 m32real = READ32(ea); + uint32_t m32real = READ32(ea); floatx80 a = ST(0); floatx80 b = float32_to_floatx80(m32real); @@ -3927,9 +3927,9 @@ void i386_device::x87_fcomp_m32real(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcomp_m64real(UINT8 modrm) +void i386_device::x87_fcomp_m64real(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (X87_IS_ST_EMPTY(0)) { x87_set_stack_underflow(); @@ -3939,7 +3939,7 @@ void i386_device::x87_fcomp_m64real(UINT8 modrm) { m_x87_sw &= ~(X87_SW_C3 | X87_SW_C2 | X87_SW_C1 | X87_SW_C0); - UINT64 m64real = READ64(ea); + uint64_t m64real = READ64(ea); floatx80 a = ST(0); floatx80 b = float64_to_floatx80(m64real); @@ -3965,7 +3965,7 @@ void i386_device::x87_fcomp_m64real(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcomp_sti(UINT8 modrm) +void i386_device::x87_fcomp_sti(uint8_t modrm) { int i = modrm & 7; @@ -4002,7 +4002,7 @@ void i386_device::x87_fcomp_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fcomi_sti(UINT8 modrm) +void i386_device::x87_fcomi_sti(uint8_t modrm) { int i = modrm & 7; @@ -4046,7 +4046,7 @@ void i386_device::x87_fcomi_sti(UINT8 modrm) CYCLES(4); // TODO: correct cycle count } -void i386_device::x87_fcomip_sti(UINT8 modrm) +void i386_device::x87_fcomip_sti(uint8_t modrm) { int i = modrm & 7; @@ -4091,7 +4091,7 @@ void i386_device::x87_fcomip_sti(UINT8 modrm) CYCLES(4); // TODO: correct cycle count } -void i386_device::x87_fucomi_sti(UINT8 modrm) +void i386_device::x87_fucomi_sti(uint8_t modrm) { int i = modrm & 7; @@ -4141,7 +4141,7 @@ void i386_device::x87_fucomi_sti(UINT8 modrm) CYCLES(4); // TODO: correct cycle count } -void i386_device::x87_fucomip_sti(UINT8 modrm) +void i386_device::x87_fucomip_sti(uint8_t modrm) { int i = modrm & 7; @@ -4192,7 +4192,7 @@ void i386_device::x87_fucomip_sti(UINT8 modrm) CYCLES(4); // TODO: correct cycle count } -void i386_device::x87_fcompp(UINT8 modrm) +void i386_device::x87_fcompp(uint8_t modrm) { if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) { @@ -4237,7 +4237,7 @@ void i386_device::x87_fcompp(UINT8 modrm) * *************************************/ -void i386_device::x87_fucom_sti(UINT8 modrm) +void i386_device::x87_fucom_sti(uint8_t modrm) { int i = modrm & 7; @@ -4275,7 +4275,7 @@ void i386_device::x87_fucom_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fucomp_sti(UINT8 modrm) +void i386_device::x87_fucomp_sti(uint8_t modrm) { int i = modrm & 7; @@ -4314,7 +4314,7 @@ void i386_device::x87_fucomp_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fucompp(UINT8 modrm) +void i386_device::x87_fucompp(uint8_t modrm) { if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) { @@ -4361,7 +4361,7 @@ void i386_device::x87_fucompp(UINT8 modrm) * *************************************/ -void i386_device::x87_fdecstp(UINT8 modrm) +void i386_device::x87_fdecstp(uint8_t modrm) { m_x87_sw &= ~X87_SW_C1; @@ -4371,7 +4371,7 @@ void i386_device::x87_fdecstp(UINT8 modrm) CYCLES(3); } -void i386_device::x87_fincstp(UINT8 modrm) +void i386_device::x87_fincstp(uint8_t modrm) { m_x87_sw &= ~X87_SW_C1; @@ -4381,31 +4381,31 @@ void i386_device::x87_fincstp(UINT8 modrm) CYCLES(3); } -void i386_device::x87_fclex(UINT8 modrm) +void i386_device::x87_fclex(uint8_t modrm) { m_x87_sw &= ~0x80ff; CYCLES(7); } -void i386_device::x87_ffree(UINT8 modrm) +void i386_device::x87_ffree(uint8_t modrm) { x87_set_tag(ST_TO_PHYS(modrm & 7), X87_TW_EMPTY); CYCLES(3); } -void i386_device::x87_finit(UINT8 modrm) +void i386_device::x87_finit(uint8_t modrm) { x87_reset(); CYCLES(17); } -void i386_device::x87_fldcw(UINT8 modrm) +void i386_device::x87_fldcw(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); - UINT16 cw = READ16(ea); + uint32_t ea = GetEA(modrm, 0); + uint16_t cw = READ16(ea); x87_write_cw(cw); @@ -4414,18 +4414,18 @@ void i386_device::x87_fldcw(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fstcw(UINT8 modrm) +void i386_device::x87_fstcw(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); WRITE16(ea, m_x87_cw); CYCLES(3); } -void i386_device::x87_fldenv(UINT8 modrm) +void i386_device::x87_fldenv(uint8_t modrm) { // TODO: Pointers and selectors - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); if (m_operand_size) { @@ -4447,9 +4447,9 @@ void i386_device::x87_fldenv(UINT8 modrm) CYCLES((m_cr[0] & 1) ? 34 : 44); } -void i386_device::x87_fstenv(UINT8 modrm) +void i386_device::x87_fstenv(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); // TODO: Pointers and selectors switch((m_cr[0] & 1)|(m_operand_size & 1)<<1) @@ -4496,9 +4496,9 @@ void i386_device::x87_fstenv(UINT8 modrm) CYCLES((m_cr[0] & 1) ? 56 : 67); } -void i386_device::x87_fsave(UINT8 modrm) +void i386_device::x87_fsave(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); // TODO: Pointers and selectors switch((m_cr[0] & 1)|(m_operand_size & 1)<<1) @@ -4552,9 +4552,9 @@ void i386_device::x87_fsave(UINT8 modrm) CYCLES((m_cr[0] & 1) ? 56 : 67); } -void i386_device::x87_frstor(UINT8 modrm) +void i386_device::x87_frstor(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 0); + uint32_t ea = GetEA(modrm, 0); // TODO: Pointers and selectors switch((m_cr[0] & 1)|(m_operand_size & 1)<<1) @@ -4608,7 +4608,7 @@ void i386_device::x87_frstor(UINT8 modrm) CYCLES((m_cr[0] & 1) ? 34 : 44); } -void i386_device::x87_fxch(UINT8 modrm) +void i386_device::x87_fxch(uint8_t modrm) { if (X87_IS_ST_EMPTY(0) || X87_IS_ST_EMPTY(1)) x87_set_stack_underflow(); @@ -4628,7 +4628,7 @@ void i386_device::x87_fxch(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fxch_sti(UINT8 modrm) +void i386_device::x87_fxch_sti(uint8_t modrm) { int i = modrm & 7; @@ -4660,23 +4660,23 @@ void i386_device::x87_fxch_sti(UINT8 modrm) CYCLES(4); } -void i386_device::x87_fstsw_ax(UINT8 modrm) +void i386_device::x87_fstsw_ax(uint8_t modrm) { REG16(AX) = m_x87_sw; CYCLES(3); } -void i386_device::x87_fstsw_m2byte(UINT8 modrm) +void i386_device::x87_fstsw_m2byte(uint8_t modrm) { - UINT32 ea = GetEA(modrm, 1); + uint32_t ea = GetEA(modrm, 1); WRITE16(ea, m_x87_sw); CYCLES(3); } -void i386_device::x87_invalid(UINT8 modrm) +void i386_device::x87_invalid(uint8_t modrm) { // TODO fatalerror("x87 invalid instruction (PC:%.4x)\n", m_pc); @@ -4692,49 +4692,49 @@ void i386_device::x87_invalid(UINT8 modrm) void i386_device::i386_x87_group_d8() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); (this->*m_opcode_table_x87_d8[modrm])(modrm); } void i386_device::i386_x87_group_d9() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); (this->*m_opcode_table_x87_d9[modrm])(modrm); } void i386_device::i386_x87_group_da() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); (this->*m_opcode_table_x87_da[modrm])(modrm); } void i386_device::i386_x87_group_db() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); (this->*m_opcode_table_x87_db[modrm])(modrm); } void i386_device::i386_x87_group_dc() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); (this->*m_opcode_table_x87_dc[modrm])(modrm); } void i386_device::i386_x87_group_dd() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); (this->*m_opcode_table_x87_dd[modrm])(modrm); } void i386_device::i386_x87_group_de() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); (this->*m_opcode_table_x87_de[modrm])(modrm); } void i386_device::i386_x87_group_df() { - UINT8 modrm = FETCH(); + uint8_t modrm = FETCH(); (this->*m_opcode_table_x87_df[modrm])(modrm); } diff --git a/src/devices/cpu/i4004/4004dasm.cpp b/src/devices/cpu/i4004/4004dasm.cpp index 2e76c14b3b5..e6aa5e78ee3 100644 --- a/src/devices/cpu/i4004/4004dasm.cpp +++ b/src/devices/cpu/i4004/4004dasm.cpp @@ -15,10 +15,10 @@ CPU_DISASSEMBLE( i4004 ) { - UINT32 flags = 0; - UINT8 op; + uint32_t flags = 0; + uint8_t op; unsigned PC = pc; - UINT16 page = PC & 0x0f00; + uint16_t page = PC & 0x0f00; switch (op = OP(pc++)) { case 0x00: sprintf (buffer,"nop"); break; diff --git a/src/devices/cpu/i4004/i4004.cpp b/src/devices/cpu/i4004/i4004.cpp index ce67670a007..d0db65e6d63 100644 --- a/src/devices/cpu/i4004/i4004.cpp +++ b/src/devices/cpu/i4004/i4004.cpp @@ -12,7 +12,7 @@ #include "i4004.h" -static const UINT8 kbp_table[] = { 0x00,0x01,0x02,0x0f,0x03,0x0f,0x0f,0x0f,0x04,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f }; +static const uint8_t kbp_table[] = { 0x00,0x01,0x02,0x0f,0x03,0x0f,0x0f,0x0f,0x04,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f }; /*************************************************************************** @@ -24,7 +24,7 @@ static const UINT8 kbp_table[] = { 0x00,0x01,0x02,0x0f,0x03,0x0f,0x0f,0x0f,0x04, const device_type I4004 = &device_creator; -i4004_cpu_device::i4004_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i4004_cpu_device::i4004_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, I4004, "Intel I4004", tag, owner, clock, "i4004", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 6, 0) @@ -36,75 +36,75 @@ i4004_cpu_device::i4004_cpu_device(const machine_config &mconfig, const char *ta } -UINT8 i4004_cpu_device::ROP() +uint8_t i4004_cpu_device::ROP() { - UINT8 retVal = m_direct->read_byte(GET_PC.w.l); + uint8_t retVal = m_direct->read_byte(GET_PC.w.l); GET_PC.w.l = (GET_PC.w.l + 1) & 0x0fff; m_PC = GET_PC; return retVal; } -UINT8 i4004_cpu_device::READ_ROM() +uint8_t i4004_cpu_device::READ_ROM() { return m_direct->read_byte((GET_PC.w.l & 0x0f00) | m_R[0]); } void i4004_cpu_device::WPM() { - UINT8 t = (m_program->read_byte(m_RAM.d) << 4) | m_A; + uint8_t t = (m_program->read_byte(m_RAM.d) << 4) | m_A; m_program->write_byte((GET_PC.w.l & 0x0f00) | m_RAM.d, t); } -UINT8 i4004_cpu_device::ARG() +uint8_t i4004_cpu_device::ARG() { - UINT8 retVal = m_direct->read_byte(GET_PC.w.l); + uint8_t retVal = m_direct->read_byte(GET_PC.w.l); GET_PC.w.l = (GET_PC.w.l + 1) & 0x0fff; m_PC = GET_PC; return retVal; } -UINT8 i4004_cpu_device::RM() +uint8_t i4004_cpu_device::RM() { return m_data->read_byte(m_RAM.d) & 0x0f; } -UINT8 i4004_cpu_device::RMS(UINT32 a) +uint8_t i4004_cpu_device::RMS(uint32_t a) { return m_data->read_byte((m_RAM.d & 0xff0) + a) >> 4; } -void i4004_cpu_device::WM(UINT8 v) +void i4004_cpu_device::WM(uint8_t v) { - UINT8 t = m_data->read_byte(m_RAM.d); + uint8_t t = m_data->read_byte(m_RAM.d); m_data->write_byte(m_RAM.d, (t & 0xf0) | v); } -void i4004_cpu_device::WMP(UINT8 v) +void i4004_cpu_device::WMP(uint8_t v) { m_io->write_byte((m_RAM.d >> 6) | 0x10, v & 0x0f); } -void i4004_cpu_device::WMS(UINT32 a, UINT8 v) +void i4004_cpu_device::WMS(uint32_t a, uint8_t v) { - UINT8 t = m_data->read_byte((m_RAM.d & 0xff0) + a); + uint8_t t = m_data->read_byte((m_RAM.d & 0xff0) + a); m_data->write_byte((m_RAM.d & 0xff0) + a, (t & 0x0f) | (v<<4)); } -UINT8 i4004_cpu_device::RIO() +uint8_t i4004_cpu_device::RIO() { return m_io->read_byte(m_RAM.b.l >> 4) & 0x0f; } -void i4004_cpu_device::WIO(UINT8 v) +void i4004_cpu_device::WIO(uint8_t v) { m_io->write_byte(m_RAM.b.l >> 4, v & 0x0f); } -UINT8 i4004_cpu_device::GET_REG(UINT8 num) +uint8_t i4004_cpu_device::GET_REG(uint8_t num) { - UINT8 r = m_R[num>>1]; + uint8_t r = m_R[num>>1]; if (num & 1) { return r & 0x0f; } else { @@ -112,7 +112,7 @@ UINT8 i4004_cpu_device::GET_REG(UINT8 num) } } -void i4004_cpu_device::SET_REG(UINT8 num, UINT8 val) +void i4004_cpu_device::SET_REG(uint8_t num, uint8_t val) { if (num & 1) { m_R[num>>1] = (m_R[num>>1] & 0xf0) + (val & 0x0f); @@ -132,7 +132,7 @@ void i4004_cpu_device::POP_STACK() m_pc_pos = (m_pc_pos - 1) & m_addr_mask; } -void i4004_cpu_device::set_test(UINT8 val) +void i4004_cpu_device::set_test(uint8_t val) { m_TEST = val; } @@ -150,13 +150,13 @@ void i4004_cpu_device::execute_one(int opcode) case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: /* JCN */ { - UINT8 arg = ARG(); + uint8_t arg = ARG(); - UINT8 C1 = BIT(opcode,3); - UINT8 C2 = BIT(opcode,2); - UINT8 C3 = BIT(opcode,1); - UINT8 C4 = BIT(opcode,0); - UINT8 JUMP = (((m_A == 0) ? 1 : 0) & C2) | ((m_C) & C3) | ((m_TEST ^ 1) & C4); + uint8_t C1 = BIT(opcode,3); + uint8_t C2 = BIT(opcode,2); + uint8_t C3 = BIT(opcode,1); + uint8_t C4 = BIT(opcode,0); + uint8_t JUMP = (((m_A == 0) ? 1 : 0) & C2) | ((m_C) & C3) | ((m_TEST ^ 1) & C4); m_icount -= 8; if(((C1 ^ 1) & JUMP) | (C1 & (JUMP ^ 1))) { @@ -197,7 +197,7 @@ void i4004_cpu_device::execute_one(int opcode) case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: /* JMS */ { - UINT16 newPC = ((opcode & 0x0f) << 8) | ARG(); + uint16_t newPC = ((opcode & 0x0f) << 8) | ARG(); m_icount -= 8; PUSH_STACK(); GET_PC.w.l = newPC; @@ -215,8 +215,8 @@ void i4004_cpu_device::execute_one(int opcode) case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: /* ISZ */ { - UINT8 val = (GET_REG(opcode & 0x0f) + 1) & 0xf; - UINT16 addr = ARG(); + uint8_t val = (GET_REG(opcode & 0x0f) + 1) & 0xf; + uint16_t addr = ARG(); m_icount -= 8; SET_REG(opcode & 0x0f, val); if (val!=0) { @@ -230,7 +230,7 @@ void i4004_cpu_device::execute_one(int opcode) case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: /* ADD */ { - UINT8 acc = m_A + GET_REG(opcode & 0x0f) + m_C; + uint8_t acc = m_A + GET_REG(opcode & 0x0f) + m_C; m_A = acc & 0x0f; m_C = (acc >> 4) & 1; } @@ -240,7 +240,7 @@ void i4004_cpu_device::execute_one(int opcode) case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: /* SUB */ { - UINT8 acc = m_A + (GET_REG(opcode & 0x0f) ^ 0x0f) + (m_C ^ 1); + uint8_t acc = m_A + (GET_REG(opcode & 0x0f) ^ 0x0f) + (m_C ^ 1); m_A = acc & 0x0f; m_C = (acc >> 4) & 1; } @@ -256,7 +256,7 @@ void i4004_cpu_device::execute_one(int opcode) case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: /* XCH */ { - UINT8 temp = m_A; + uint8_t temp = m_A; m_A = GET_REG(opcode & 0x0f); SET_REG(opcode & 0x0f, temp); } @@ -353,7 +353,7 @@ void i4004_cpu_device::execute_one(int opcode) break; case 0xf6: /* RAR */ { - UINT8 c = m_A & 1; + uint8_t c = m_A & 1; m_A = (m_A >> 1) | (m_C << 3); m_C = c; } @@ -522,7 +522,7 @@ void i4004_cpu_device::state_string_export(const device_state_entry &entry, std: } } -offs_t i4004_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i4004_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i4004 ); return CPU_DISASSEMBLE_NAME(i4004)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/i4004/i4004.h b/src/devices/cpu/i4004/i4004.h index c2e887c6e0d..1b875f10aee 100644 --- a/src/devices/cpu/i4004/i4004.h +++ b/src/devices/cpu/i4004/i4004.h @@ -25,9 +25,9 @@ class i4004_cpu_device : public cpu_device { public: // construction/destruction - i4004_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + i4004_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); - void set_test(UINT8 val); + void set_test(uint8_t val); protected: // device-level overrides @@ -35,8 +35,8 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 8; } - virtual UINT32 execute_max_cycles() const override { return 16; } + virtual uint32_t execute_min_cycles() const override { return 8; } + virtual uint32_t execute_max_cycles() const override { return 16; } virtual void execute_run() override; // device_memory_interface overrides @@ -57,23 +57,23 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - UINT8 ROP(); - UINT8 READ_ROM(); + uint8_t ROP(); + uint8_t READ_ROM(); void WPM(); - UINT8 ARG(); - UINT8 RM(); - UINT8 RMS(UINT32 a); - void WM(UINT8 v); - void WMP(UINT8 v); - void WMS(UINT32 a, UINT8 v); - UINT8 RIO(); - void WIO(UINT8 v); - UINT8 GET_REG(UINT8 num); - void SET_REG(UINT8 num, UINT8 val); + uint8_t ARG(); + uint8_t RM(); + uint8_t RMS(uint32_t a); + void WM(uint8_t v); + void WMP(uint8_t v); + void WMS(uint32_t a, uint8_t v); + uint8_t RIO(); + void WIO(uint8_t v); + uint8_t GET_REG(uint8_t num); + void SET_REG(uint8_t num, uint8_t val); void PUSH_STACK(); void POP_STACK(); void execute_one(int opcode); @@ -82,14 +82,14 @@ protected: address_space_config m_io_config; address_space_config m_data_config; - UINT8 m_A; // Accumulator - UINT8 m_R[8]; + uint8_t m_A; // Accumulator + uint8_t m_R[8]; PAIR m_ADDR[4]; // Address registers PAIR m_RAM; - UINT8 m_C; // Carry flag - UINT8 m_TEST; // Test PIN status + uint8_t m_C; // Carry flag + uint8_t m_TEST; // Test PIN status PAIR m_PC; // It is in fact one of ADDR regs - UINT8 m_flags; // used for I/O only + uint8_t m_flags; // used for I/O only address_space *m_program; direct_read_data *m_direct; diff --git a/src/devices/cpu/i8008/8008dasm.cpp b/src/devices/cpu/i8008/8008dasm.cpp index d5f1e082d5e..39615eb4f26 100644 --- a/src/devices/cpu/i8008/8008dasm.cpp +++ b/src/devices/cpu/i8008/8008dasm.cpp @@ -18,9 +18,9 @@ static const char flag_names[] = { 'c', 'z', 's', 'p' }; CPU_DISASSEMBLE( i8008 ) { - UINT32 flags = 0; + uint32_t flags = 0; unsigned PC = pc; - UINT8 op = OP(pc++); + uint8_t op = OP(pc++); switch (op >> 6) { case 0x03: // starting with 11 diff --git a/src/devices/cpu/i8008/i8008.cpp b/src/devices/cpu/i8008/i8008.cpp index c8e1f74195b..a323ed077c4 100644 --- a/src/devices/cpu/i8008/i8008.cpp +++ b/src/devices/cpu/i8008/i8008.cpp @@ -33,7 +33,7 @@ const device_type I8008 = &device_creator; //------------------------------------------------- // i8008_device - constructor //------------------------------------------------- -i8008_device::i8008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8008_device::i8008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, I8008, "i8008", tag, owner, clock, "i8008", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 8, 14), m_io_config("io", ENDIANNESS_LITTLE, 8, 8), @@ -102,7 +102,7 @@ void i8008_device::device_start() void i8008_device::init_tables (void) { int i; - UINT8 p; + uint8_t p; for (i = 0; i < 256; i++) { p = 0; @@ -206,7 +206,7 @@ void i8008_device::state_string_export(const device_state_entry &entry, std::str // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 i8008_device::disasm_min_opcode_bytes() const +uint32_t i8008_device::disasm_min_opcode_bytes() const { return 1; } @@ -216,7 +216,7 @@ UINT32 i8008_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 i8008_device::disasm_max_opcode_bytes() const +uint32_t i8008_device::disasm_max_opcode_bytes() const { return 3; } @@ -226,7 +226,7 @@ UINT32 i8008_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t i8008_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i8008_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i8008 ); return CPU_DISASSEMBLE_NAME(i8008)(this, buffer, pc, oprom, opram, options); @@ -241,7 +241,7 @@ offs_t i8008_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 i8008_device::execute_min_cycles() const +uint32_t i8008_device::execute_min_cycles() const { return 8; } @@ -251,7 +251,7 @@ UINT32 i8008_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 i8008_device::execute_max_cycles() const +uint32_t i8008_device::execute_max_cycles() const { return 16; } @@ -281,7 +281,7 @@ void i8008_device::execute_run() } while (m_icount > 0); } -inline void i8008_device::illegal(UINT8 opcode) +inline void i8008_device::illegal(uint8_t opcode) { if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) { @@ -302,7 +302,7 @@ void i8008_device::take_interrupt() inline void i8008_device::execute_one(int opcode) { - UINT16 tmp; + uint16_t tmp; switch (opcode >> 6) { @@ -618,17 +618,17 @@ inline void i8008_device::pop_stack() m_pc_pos = (m_pc_pos - 1) & 7; } -inline UINT8 i8008_device::rop() +inline uint8_t i8008_device::rop() { - UINT8 retVal = m_direct->read_byte(GET_PC.w.l); + uint8_t retVal = m_direct->read_byte(GET_PC.w.l); GET_PC.w.l = (GET_PC.w.l + 1) & 0x3fff; m_PC = GET_PC; return retVal; } -inline UINT8 i8008_device::get_reg(UINT8 reg) +inline uint8_t i8008_device::get_reg(uint8_t reg) { - UINT8 retVal; + uint8_t retVal; switch(reg) { case 0 : retVal = m_A; break; case 1 : retVal = m_B; break; @@ -642,7 +642,7 @@ inline UINT8 i8008_device::get_reg(UINT8 reg) return retVal; } -inline void i8008_device::set_reg(UINT8 reg, UINT8 val) +inline void i8008_device::set_reg(uint8_t reg, uint8_t val) { switch(reg) { case 0 : m_A = val; break; @@ -656,25 +656,25 @@ inline void i8008_device::set_reg(UINT8 reg, UINT8 val) } } -inline UINT8 i8008_device::arg() +inline uint8_t i8008_device::arg() { - UINT8 retVal = m_direct->read_byte(GET_PC.w.l); + uint8_t retVal = m_direct->read_byte(GET_PC.w.l); GET_PC.w.l = (GET_PC.w.l + 1) & 0x3fff; m_PC = GET_PC; return retVal; } -inline void i8008_device::update_flags(UINT8 val) +inline void i8008_device::update_flags(uint8_t val) { m_ZF = (val == 0) ? 1 : 0; m_SF = (val & 0x80) ? 1 : 0; m_PF = m_PARITY[val]; } -inline UINT8 i8008_device::do_condition(UINT8 val) +inline uint8_t i8008_device::do_condition(uint8_t val) { - UINT8 v = (val >> 5) & 1; - UINT8 cond = 0; + uint8_t v = (val >> 5) & 1; + uint8_t cond = 0; switch((val>> 3) & 0x03) { case 0 : if (m_CF==v) cond = 1; @@ -692,9 +692,9 @@ inline UINT8 i8008_device::do_condition(UINT8 val) return cond; } -inline UINT16 i8008_device::get_addr() +inline uint16_t i8008_device::get_addr() { - UINT8 lo = arg(); - UINT8 hi = arg(); + uint8_t lo = arg(); + uint8_t hi = arg(); return ((hi & 0x3f) << 8) + lo; } diff --git a/src/devices/cpu/i8008/i8008.h b/src/devices/cpu/i8008/i8008.h index 14fcf28d0dc..4ba000f3fe9 100644 --- a/src/devices/cpu/i8008/i8008.h +++ b/src/devices/cpu/i8008/i8008.h @@ -25,7 +25,7 @@ class i8008_device : public cpu_device { public: // construction/destruction - i8008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -33,8 +33,8 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -48,22 +48,22 @@ protected: // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void execute_one(int opcode); void push_stack(); void pop_stack(); - UINT8 rop(); - UINT8 get_reg(UINT8 reg); - void set_reg(UINT8 reg, UINT8 val); - UINT8 arg(); - void update_flags(UINT8 val); - UINT8 do_condition(UINT8 val); - UINT16 get_addr(); - void illegal(UINT8 opcode); + uint8_t rop(); + uint8_t get_reg(uint8_t reg); + void set_reg(uint8_t reg, uint8_t val); + uint8_t arg(); + void update_flags(uint8_t val); + uint8_t do_condition(uint8_t val); + uint16_t get_addr(); + void illegal(uint8_t opcode); void take_interrupt(); void init_tables(void); @@ -74,19 +74,19 @@ protected: const address_space_config m_program_config; const address_space_config m_io_config; - UINT8 m_A,m_B,m_C,m_D,m_E,m_H,m_L; + uint8_t m_A,m_B,m_C,m_D,m_E,m_H,m_L; PAIR m_PC; // It is in fact one of ADDR regs PAIR m_ADDR[8]; // Address registers - UINT8 m_CF; // Carry flag - UINT8 m_ZF; // Zero flag - UINT8 m_SF; // Sign flag - UINT8 m_PF; // Parity flag - UINT8 m_HALT; - UINT8 m_flags; // temporary I/O only + uint8_t m_CF; // Carry flag + uint8_t m_ZF; // Zero flag + uint8_t m_SF; // Sign flag + uint8_t m_PF; // Parity flag + uint8_t m_HALT; + uint8_t m_flags; // temporary I/O only - UINT8 m_irq_state; + uint8_t m_irq_state; - UINT8 m_PARITY[256]; + uint8_t m_PARITY[256]; address_space *m_program; address_space *m_io; diff --git a/src/devices/cpu/i8085/8085dasm.cpp b/src/devices/cpu/i8085/8085dasm.cpp index e68bdfac337..515899a79e2 100644 --- a/src/devices/cpu/i8085/8085dasm.cpp +++ b/src/devices/cpu/i8085/8085dasm.cpp @@ -20,8 +20,8 @@ CPU_DISASSEMBLE( i8085 ) { - UINT32 flags = 0; - UINT8 op; + uint32_t flags = 0; + uint8_t op; unsigned PC = pc; switch (op = OP(pc++)) { diff --git a/src/devices/cpu/i8085/i8085.cpp b/src/devices/cpu/i8085/i8085.cpp index 5fc63d50987..b28ebab7380 100644 --- a/src/devices/cpu/i8085/i8085.cpp +++ b/src/devices/cpu/i8085/i8085.cpp @@ -128,7 +128,7 @@ ***************************************************************************/ /* cycles lookup */ -const UINT8 i8085a_cpu_device::lut_cycles_8080[256]={ +const uint8_t i8085a_cpu_device::lut_cycles_8080[256]={ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ 4, 10,7, 5, 5, 5, 7, 4, 4, 10,7, 5, 5, 5, 7, 4, /* 1 */ 4, 10,7, 5, 5, 5, 7, 4, 4, 10,7, 5, 5, 5, 7, 4, @@ -146,7 +146,7 @@ const UINT8 i8085a_cpu_device::lut_cycles_8080[256]={ /* D */ 5, 10,10,10,11,11,7, 11,5, 10,10,10,11,11,7, 11, /* E */ 5, 10,10,18,11,11,7, 11,5, 5, 10,5, 11,11,7, 11, /* F */ 5, 10,10,4, 11,11,7, 11,5, 5, 10,4, 11,11,7, 11 }; -const UINT8 i8085a_cpu_device::lut_cycles_8085[256]={ +const uint8_t i8085a_cpu_device::lut_cycles_8085[256]={ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ 4, 10,7, 6, 4, 4, 7, 4, 10,10,7, 6, 4, 4, 7, 4, /* 1 */ 7, 10,7, 6, 4, 4, 7, 4, 10,10,7, 6, 4, 4, 7, 4, @@ -182,7 +182,7 @@ const device_type I8080A = &device_creator; const device_type I8085A = &device_creator; -i8085a_cpu_device::i8085a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8085a_cpu_device::i8085a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, I8085A, "8085A", tag, owner, clock, "i8085a", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 8, 0) @@ -195,7 +195,7 @@ i8085a_cpu_device::i8085a_cpu_device(const machine_config &mconfig, const char * } -i8085a_cpu_device::i8085a_cpu_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, int cputype) +i8085a_cpu_device::i8085a_cpu_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, int cputype) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 8, 0) @@ -208,13 +208,13 @@ i8085a_cpu_device::i8085a_cpu_device(const machine_config &mconfig, device_type } -i8080_cpu_device::i8080_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8080_cpu_device::i8080_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8085a_cpu_device(mconfig, I8080, "8080", tag, owner, clock, "i8080", __FILE__, CPUTYPE_8080) { } -i8080a_cpu_device::i8080a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8080a_cpu_device::i8080a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8085a_cpu_device(mconfig, I8080A, "8080A", tag, owner, clock, "i8080a", __FILE__, CPUTYPE_8080) { } @@ -250,7 +250,7 @@ void i8085a_cpu_device::set_inte(int state) } -void i8085a_cpu_device::set_status(UINT8 status) +void i8085a_cpu_device::set_status(uint8_t status) { if (status != m_STATUS) m_out_status_func(status); @@ -259,9 +259,9 @@ void i8085a_cpu_device::set_status(UINT8 status) } -UINT8 i8085a_cpu_device::get_rim_value() +uint8_t i8085a_cpu_device::get_rim_value() { - UINT8 result = m_IM; + uint8_t result = m_IM; int sid = m_in_sid_func(); /* copy live RST5.5 and RST6.5 states */ @@ -290,20 +290,20 @@ void i8085a_cpu_device::break_halt_for_interrupt() } -UINT8 i8085a_cpu_device::ROP() +uint8_t i8085a_cpu_device::ROP() { set_status(0xa2); // instruction fetch return m_direct->read_byte(m_PC.w.l++); } -UINT8 i8085a_cpu_device::ARG() +uint8_t i8085a_cpu_device::ARG() { return m_direct->read_byte(m_PC.w.l++); } -UINT16 i8085a_cpu_device::ARG16() +uint16_t i8085a_cpu_device::ARG16() { - UINT16 w; + uint16_t w; w = m_direct->read_byte(m_PC.d); m_PC.w.l++; w += m_direct->read_byte(m_PC.d) << 8; @@ -311,13 +311,13 @@ UINT16 i8085a_cpu_device::ARG16() return w; } -UINT8 i8085a_cpu_device::RM(UINT32 a) +uint8_t i8085a_cpu_device::RM(uint32_t a) { set_status(0x82); // memory read return m_program->read_byte(a); } -void i8085a_cpu_device::WM(UINT32 a, UINT8 v) +void i8085a_cpu_device::WM(uint32_t a, uint8_t v) { set_status(0x00); // memory write m_program->write_byte(a, v); @@ -395,7 +395,7 @@ void i8085a_cpu_device::check_for_interrupts() /* followed by classic INTR */ else if (m_irq_state[I8085_INTR_LINE] && (m_IM & IM_IE)) { - UINT32 vector; + uint32_t vector; /* break out of HALT state and call the IRQ ack callback */ break_halt_for_interrupt(); @@ -872,7 +872,7 @@ void i8085a_cpu_device::execute_run() void i8085a_cpu_device::init_tables() { - UINT8 zs; + uint8_t zs; int i, p; for (i = 0; i < 256; i++) { @@ -1094,7 +1094,7 @@ void i8085a_cpu_device::execute_set_input(int irqline, int state) } -offs_t i8085a_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i8085a_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i8085 ); return CPU_DISASSEMBLE_NAME(i8085)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/i8085/i8085.h b/src/devices/cpu/i8085/i8085.h index dfd1b8a9e02..c1e8c33e70b 100644 --- a/src/devices/cpu/i8085/i8085.h +++ b/src/devices/cpu/i8085/i8085.h @@ -53,8 +53,8 @@ class i8085a_cpu_device : public cpu_device { public: // construction/destruction - i8085a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - i8085a_cpu_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, int cputype); + i8085a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + i8085a_cpu_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, int cputype); // static configuration helpers template static devcb_base &set_out_status_func(device_t &device, _Object object) { return downcast(device).m_out_status_func.set_callback(object); } @@ -68,14 +68,14 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 4; } - virtual UINT32 execute_max_cycles() const override { return 16; } - virtual UINT32 execute_input_lines() const override { return 4; } - virtual UINT32 execute_default_irq_vector() const override { return 0xff; } + virtual uint32_t execute_min_cycles() const override { return 4; } + virtual uint32_t execute_max_cycles() const override { return 16; } + virtual uint32_t execute_input_lines() const override { return 4; } + virtual uint32_t execute_default_irq_vector() const override { return 0xff; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 2 - 1) / 2; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 2); } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 2 - 1) / 2; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : nullptr ); } @@ -86,9 +86,9 @@ protected: virtual void state_import(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 3; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 3; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -101,16 +101,16 @@ private: int m_cputype; /* 0 8080, 1 8085A */ PAIR m_PC,m_SP,m_AF,m_BC,m_DE,m_HL,m_WZ; - UINT8 m_HALT; - UINT8 m_IM; /* interrupt mask (8085A only) */ - UINT8 m_STATUS; /* status word */ + uint8_t m_HALT; + uint8_t m_IM; /* interrupt mask (8085A only) */ + uint8_t m_STATUS; /* status word */ - UINT8 m_after_ei; /* post-EI processing; starts at 2, check for ints at 0 */ - UINT8 m_nmi_state; /* raw NMI line state */ - UINT8 m_irq_state[4]; /* raw IRQ line states */ - UINT8 m_trap_pending; /* TRAP interrupt latched? */ - UINT8 m_trap_im_copy; /* copy of IM register when TRAP was taken */ - UINT8 m_sod_state; /* state of the SOD line */ + uint8_t m_after_ei; /* post-EI processing; starts at 2, check for ints at 0 */ + uint8_t m_nmi_state; /* raw NMI line state */ + uint8_t m_irq_state[4]; /* raw IRQ line states */ + uint8_t m_trap_pending; /* TRAP interrupt latched? */ + uint8_t m_trap_im_copy; /* copy of IM register when TRAP was taken */ + uint8_t m_sod_state; /* state of the SOD line */ bool m_ietemp; /* import/export temp space */ @@ -120,23 +120,23 @@ private: int m_icount; /* cycles lookup */ - static const UINT8 lut_cycles_8080[256]; - static const UINT8 lut_cycles_8085[256]; - UINT8 lut_cycles[256]; + static const uint8_t lut_cycles_8080[256]; + static const uint8_t lut_cycles_8085[256]; + uint8_t lut_cycles[256]; /* flags lookup */ - UINT8 ZS[256]; - UINT8 ZSP[256]; + uint8_t ZS[256]; + uint8_t ZSP[256]; void set_sod(int state); void set_inte(int state); - void set_status(UINT8 status); - UINT8 get_rim_value(); + void set_status(uint8_t status); + uint8_t get_rim_value(); void break_halt_for_interrupt(); - UINT8 ROP(); - UINT8 ARG(); - UINT16 ARG16(); - UINT8 RM(UINT32 a); - void WM(UINT32 a, UINT8 v); + uint8_t ROP(); + uint8_t ARG(); + uint16_t ARG16(); + uint8_t RM(uint32_t a); + void WM(uint32_t a, uint8_t v); void check_for_interrupts(); void execute_one(int opcode); void init_tables(); @@ -148,12 +148,12 @@ class i8080_cpu_device : public i8085a_cpu_device { public: // construction/destruction - i8080_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8080_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual UINT32 execute_input_lines() const override { return 1; } - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return clocks; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return cycles; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return clocks; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return cycles; } }; @@ -161,12 +161,12 @@ class i8080a_cpu_device : public i8085a_cpu_device { public: // construction/destruction - i8080a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8080a_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual UINT32 execute_input_lines() const override { return 1; } - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return clocks; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return cycles; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return clocks; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return cycles; } }; diff --git a/src/devices/cpu/i8085/i8085cpu.h b/src/devices/cpu/i8085/i8085cpu.h index 2f47c34f989..a41e96f06c7 100644 --- a/src/devices/cpu/i8085/i8085cpu.h +++ b/src/devices/cpu/i8085/i8085cpu.h @@ -66,11 +66,11 @@ /* logical */ #define M_ORA(R) m_AF.b.h|=R; m_AF.b.l=ZSP[m_AF.b.h] #define M_XRA(R) m_AF.b.h^=R; m_AF.b.l=ZSP[m_AF.b.h] -#define M_ANA(R) {UINT8 hc = ((m_AF.b.h | R)<<1) & HF; m_AF.b.h&=R; m_AF.b.l=ZSP[m_AF.b.h]; if(IS_8085()) { m_AF.b.l |= HF; } else {m_AF.b.l |= hc; } } +#define M_ANA(R) {uint8_t hc = ((m_AF.b.h | R)<<1) & HF; m_AF.b.h&=R; m_AF.b.l=ZSP[m_AF.b.h]; if(IS_8085()) { m_AF.b.l |= HF; } else {m_AF.b.l |= hc; } } /* increase / decrease */ -#define M_INR(R) {UINT8 hc = ((R & 0x0f) == 0x0f) ? HF : 0; ++R; m_AF.b.l= (m_AF.b.l & CF ) | ZSP[R] | hc; } -#define M_DCR(R) {UINT8 hc = ((R & 0x0f) != 0x00) ? HF : 0; --R; m_AF.b.l= (m_AF.b.l & CF ) | ZSP[R] | hc | VF; } +#define M_INR(R) {uint8_t hc = ((R & 0x0f) == 0x0f) ? HF : 0; ++R; m_AF.b.l= (m_AF.b.l & CF ) | ZSP[R] | hc; } +#define M_DCR(R) {uint8_t hc = ((R & 0x0f) != 0x00) ? HF : 0; --R; m_AF.b.l= (m_AF.b.l & CF ) | ZSP[R] | hc | VF; } /* arithmetic */ #define M_ADD(R) { \ @@ -162,7 +162,7 @@ { \ if (cc) \ { \ - UINT16 a = ARG16(); \ + uint16_t a = ARG16(); \ m_icount -= (IS_8085()) ? 7 : 6 ; \ M_PUSH(PC); \ m_PC.d = a; \ diff --git a/src/devices/cpu/i8089/i8089.cpp b/src/devices/cpu/i8089/i8089.cpp index b817e5d109d..2b20984c061 100644 --- a/src/devices/cpu/i8089/i8089.cpp +++ b/src/devices/cpu/i8089/i8089.cpp @@ -32,7 +32,7 @@ const device_type I8089 = &device_creator; // i8089_device - constructor //------------------------------------------------- -i8089_device::i8089_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +i8089_device::i8089_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, I8089, "I8089", tag, owner, clock, "i8089", __FILE__), m_icount(0), m_ch1(*this, "1"), @@ -148,7 +148,7 @@ const address_space_config *i8089_device::memory_space_config(address_spacenum s // disasm_disassemble - disassembler //------------------------------------------------- -offs_t i8089_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i8089_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(i8089); return CPU_DISASSEMBLE_NAME(i8089)(this, buffer, pc, oprom, opram, options); @@ -243,8 +243,8 @@ void i8089_device::initialize() m_sysbus = m_mem->read_byte(0xffff6); // get system configuration block address - UINT16 scb_offset = read_word(0, 0xffff8); - UINT16 scb_segment = read_word(0, 0xffffa); + uint16_t scb_offset = read_word(0, 0xffff8); + uint16_t scb_segment = read_word(0, 0xffffa); m_scb = ((scb_segment << 4) + scb_offset) & 0x0fffff; // get system operation command @@ -252,8 +252,8 @@ void i8089_device::initialize() m_master = !m_sel; // get control block address - UINT16 cb_offset = read_word(0, m_scb + 2); - UINT16 cb_segment = read_word(0, m_scb + 4); + uint16_t cb_offset = read_word(0, m_scb + 2); + uint16_t cb_segment = read_word(0, m_scb + 4); offs_t cb_address = ((cb_segment << 4) + cb_offset) & 0x0fffff; // initialize channels @@ -261,7 +261,7 @@ void i8089_device::initialize() m_ch2->set_reg(i8089_channel::CP, cb_address + 8); // clear busy - UINT16 ccw = read_word(0, cb_address); + uint16_t ccw = read_word(0, cb_address); write_word(0, cb_address, ccw & 0x00ff); // done @@ -280,14 +280,14 @@ void i8089_device::initialize() } } -UINT8 i8089_device::read_byte(bool space, offs_t address) +uint8_t i8089_device::read_byte(bool space, offs_t address) { return (space ? m_io : m_mem)->read_byte(address); } -UINT16 i8089_device::read_word(bool space, offs_t address) +uint16_t i8089_device::read_word(bool space, offs_t address) { - UINT16 data; + uint16_t data; address_space *aspace = (space ? m_io : m_mem); if (sysbus_width() && WORD_ALIGNED(address)) @@ -303,12 +303,12 @@ UINT16 i8089_device::read_word(bool space, offs_t address) return data; } -void i8089_device::write_byte(bool space, offs_t address, UINT8 data) +void i8089_device::write_byte(bool space, offs_t address, uint8_t data) { (space ? m_io : m_mem)->write_byte(address, data); } -void i8089_device::write_word(bool space, offs_t address, UINT16 data) +void i8089_device::write_word(bool space, offs_t address, uint16_t data) { address_space *aspace = (space ? m_io : m_mem); diff --git a/src/devices/cpu/i8089/i8089.h b/src/devices/cpu/i8089/i8089.h index e4100b8fa94..0231f6c3b8a 100644 --- a/src/devices/cpu/i8089/i8089.h +++ b/src/devices/cpu/i8089/i8089.h @@ -44,14 +44,14 @@ class i8089_device : public cpu_device public: // construction/destruction - i8089_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8089_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // callbacks template void set_sintr1_callback(_sintr1 sintr1) { m_write_sintr1.set_callback(sintr1); } template void set_sintr2_callback(_sintr2 sintr2) { m_write_sintr2.set_callback(sintr2); } // static configuration helpers - static void set_databus_width(device_t &device, UINT8 databus_width) { downcast(device).m_databus_width = databus_width; } + static void set_databus_width(device_t &device, uint8_t databus_width) { downcast(device).m_databus_width = databus_width; } // input lines DECLARE_WRITE_LINE_MEMBER( ca_w ); @@ -83,9 +83,9 @@ protected: address_space_config m_io_config; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 7; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 7; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; @@ -98,10 +98,10 @@ private: bool remotebus_width() const { return BIT(m_soc, 0); } bool request_grant() const { return BIT(m_soc, 1); } - UINT8 read_byte(bool space, offs_t address); - UINT16 read_word(bool space, offs_t address); - void write_byte(bool space, offs_t address, UINT8 data); - void write_word(bool space, offs_t address, UINT16 data); + uint8_t read_byte(bool space, offs_t address); + uint16_t read_word(bool space, offs_t address); + void write_byte(bool space, offs_t address, uint8_t data); + void write_word(bool space, offs_t address, uint16_t data); required_device m_ch1; required_device m_ch2; @@ -111,7 +111,7 @@ private: void initialize(); - UINT8 m_databus_width; + uint8_t m_databus_width; address_space *m_mem; address_space *m_io; @@ -134,9 +134,9 @@ private: }; // system configuration - UINT8 m_sysbus; + uint8_t m_sysbus; offs_t m_scb; - UINT8 m_soc; + uint8_t m_soc; bool m_initialized; bool m_master; diff --git a/src/devices/cpu/i8089/i8089_channel.cpp b/src/devices/cpu/i8089/i8089_channel.cpp index 932d59ff229..1b8d86d2b53 100644 --- a/src/devices/cpu/i8089/i8089_channel.cpp +++ b/src/devices/cpu/i8089/i8089_channel.cpp @@ -48,7 +48,7 @@ const device_type I8089_CHANNEL = &device_creator; // i8089_channel - constructor //------------------------------------------------- -i8089_channel::i8089_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +i8089_channel::i8089_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8089_CHANNEL, "Intel 8089 I/O Channel", tag, owner, clock, "i8089_channel", __FILE__), m_write_sintr(*this), m_iop(nullptr), @@ -109,7 +109,7 @@ void i8089_channel::device_reset() // IMPLEMENTATION //************************************************************************** -void i8089_channel::set_reg(int reg, UINT32 value, int tag) +void i8089_channel::set_reg(int reg, uint32_t value, int tag) { if((reg == BC) || (reg == IX) || (reg == CC) || (reg == MC)) { @@ -141,27 +141,27 @@ int i8089_channel::chan_prio() { return m_prio; } bool i8089_channel::chained() { return CC_CHAIN; } bool i8089_channel::lock() { return CC_LOCK; } -INT16 i8089_channel::displacement(int wb) +int16_t i8089_channel::displacement(int wb) { - INT16 displacement = 0; + int16_t displacement = 0; if (wb == 1) { - displacement = (INT16)((INT8)m_iop->read_byte(m_r[TP].t, m_r[TP].w)); + displacement = (int16_t)((int8_t)m_iop->read_byte(m_r[TP].t, m_r[TP].w)); set_reg(TP, m_r[TP].w + 1); } else if (wb == 2) { - displacement = (INT16)m_iop->read_word(m_r[TP].t, m_r[TP].w); + displacement = (int16_t)m_iop->read_word(m_r[TP].t, m_r[TP].w); set_reg(TP, m_r[TP].w + 2); } return displacement; } -UINT32 i8089_channel::offset(int aa, int mm, int w) +uint32_t i8089_channel::offset(int aa, int mm, int w) { - UINT32 offset = 0; + uint32_t offset = 0; switch(aa) { case 0: @@ -182,16 +182,16 @@ UINT32 i8089_channel::offset(int aa, int mm, int w) return offset & 0xfffff; } -INT8 i8089_channel::imm8() +int8_t i8089_channel::imm8() { - INT8 imm8 = (INT8)m_iop->read_byte(m_r[TP].t, m_r[TP].w); + int8_t imm8 = (int8_t)m_iop->read_byte(m_r[TP].t, m_r[TP].w); set_reg(TP, m_r[TP].w + 1); return imm8; } -INT16 i8089_channel::imm16() +int16_t i8089_channel::imm16() { - INT16 imm16 = (INT16)m_iop->read_word(m_r[TP].t, m_r[TP].w); + int16_t imm16 = (int16_t)m_iop->read_word(m_r[TP].t, m_r[TP].w); set_reg(TP, m_r[TP].w + 2); return imm16; } @@ -414,12 +414,12 @@ int i8089_channel::execute_run() m_prio = chained() ? PRIO_PROG_CHAIN : PRIO_PROG; // fetch first two instruction bytes - UINT16 op = m_iop->read_word(m_r[TP].t, m_r[TP].w); + uint16_t op = m_iop->read_word(m_r[TP].t, m_r[TP].w); set_reg(TP, m_r[TP].w + 2); // extract parameters - UINT8 params = op & 0xff; - UINT8 opcode = (op >> 8) & 0xff; + uint8_t params = op & 0xff; + uint8_t opcode = (op >> 8) & 0xff; int brp = (params >> 5) & 0x07; int wb = (params >> 3) & 0x03; @@ -431,8 +431,8 @@ int i8089_channel::execute_run() // fix-up so we can use our register array if (mm == BC) mm = PP; - UINT32 o; - UINT16 off, seg; + uint32_t o; + uint16_t off, seg; switch (opc) { @@ -448,8 +448,8 @@ int i8089_channel::execute_run() break; case 0x02: // lpdi - off = (UINT16)imm16(); - seg = (UINT16)imm16(); + off = (uint16_t)imm16(); + seg = (uint16_t)imm16(); lpdi(brp, seg, off); break; @@ -526,7 +526,7 @@ int i8089_channel::execute_run() case 0x24: // mov(b) m, m { o = offset(aa, mm, w); - UINT16 op2 = m_iop->read_word(m_r[TP].t, m_r[TP].w); + uint16_t op2 = m_iop->read_word(m_r[TP].t, m_r[TP].w); set_reg(TP, m_r[TP].w + 2); int mm2 = (op2 >> 8) & 0x03; @@ -538,7 +538,7 @@ int i8089_channel::execute_run() case 0x25: // tsl m, i, d { o = offset(aa, mm, w); - INT8 i = imm8(); + int8_t i = imm8(); tsl(mm, i, imm8(), o); break; } @@ -676,7 +676,7 @@ int i8089_channel::execute_run() return m_icount; } -void i8089_channel::examine_ccw(UINT8 ccw) +void i8089_channel::examine_ccw(uint8_t ccw) { // priority and bus load limit, bit 7 and 5 m_r[PSW].w = (m_r[PSW].w & 0x5f) | (ccw & 0xa0); @@ -701,7 +701,7 @@ void i8089_channel::examine_ccw(UINT8 ccw) void i8089_channel::attention() { // examine control byte - UINT8 ccw = m_iop->read_byte(m_r[CP].t, m_r[CP].w); + uint8_t ccw = m_iop->read_byte(m_r[CP].t, m_r[CP].w); switch (ccw & 0x07) { @@ -729,7 +729,7 @@ void i8089_channel::attention() lpd(PP, CP, m_r[CP].w + 2); movp_pm(TP, PP, m_r[PP].w); - movbi_mi(CP, (INT8) 0xff, m_r[CP].w + 1); + movbi_mi(CP, (int8_t) 0xff, m_r[CP].w + 1); m_r[TP].t = 1; m_r[PSW].w |= 1 << 2; @@ -761,7 +761,7 @@ void i8089_channel::attention() lpd(PP, CP, m_r[CP].w + 2); lpd(TP, PP, m_r[PP].w); - movbi_mi(CP, (INT8) 0xff, m_r[CP].w + 1); + movbi_mi(CP, (int8_t) 0xff, m_r[CP].w + 1); m_r[PSW].w |= 1 << 2; m_prio = chained() ? PRIO_PROG_CHAIN : PRIO_PROG; @@ -790,7 +790,7 @@ void i8089_channel::attention() // restore task pointer and parameter block movp_pm(TP, PP, m_r[PP].w); movb_rm(PSW, PP, m_r[PP].w + 3); - movbi_mi(CP, (INT8) 0xff, m_r[CP].w + 1); + movbi_mi(CP, (int8_t) 0xff, m_r[CP].w + 1); m_r[PSW].w |= 1 << 2; m_prio = chained() ? PRIO_PROG_CHAIN : PRIO_PROG; diff --git a/src/devices/cpu/i8089/i8089_channel.h b/src/devices/cpu/i8089/i8089_channel.h index 569112e41e8..e95975c28c3 100644 --- a/src/devices/cpu/i8089/i8089_channel.h +++ b/src/devices/cpu/i8089/i8089_channel.h @@ -39,12 +39,12 @@ class i8089_channel : public device_t { public: // construction/destruction - i8089_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8089_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_sintr_callback(_sintr sintr) { m_write_sintr.set_callback(sintr); } // set register - void set_reg(int reg, UINT32 value, int tag = -1); + void set_reg(int reg, uint32_t value, int tag = -1); int execute_run(); void attention(); @@ -83,7 +83,7 @@ public: struct { - UINT32 w; // 20-bit address + uint32_t w; // 20-bit address bool t; // tag-bit } m_r[11]; @@ -100,19 +100,19 @@ private: void add_mr(int m, int r, int o); void addb_rm(int r, int m, int o); void addb_mr(int m, int r, int o); - void addbi_ri(int r, INT8 i); - void addbi_mi(int m, INT8 i, int o); - void addi_ri(int r, INT16 i); - void addi_mi(int m, INT16 i, int o); + void addbi_ri(int r, int8_t i); + void addbi_mi(int m, int8_t i, int o); + void addi_ri(int r, int16_t i); + void addi_mi(int m, int16_t i, int o); void and_rm(int r, int m, int o); void and_mr(int m, int r, int o); void andb_rm(int r, int m, int o); void andb_mr(int m, int r, int o); - void andbi_ri(int r, INT8 i); - void andbi_mi(int m, INT8 i, int o); - void andi_ri(int r, INT16 i); - void andi_mi(int m, INT16 i, int o); - void call(int m, INT16 d, int o); + void andbi_ri(int r, int8_t i); + void andbi_mi(int m, int8_t i, int o); + void andi_ri(int r, int16_t i); + void andi_mi(int m, int16_t i, int o); + void call(int m, int16_t d, int o); void clr(int m, int b, int o); void dec_r(int r); void dec_m(int m, int o); @@ -121,16 +121,16 @@ private: void inc_r(int r); void inc_m(int m, int o); void incb(int m, int o); - void jbt(int m, int b, INT16 d, int o); - void jmce(int m, INT16 d, int o); - void jmcne(int m, INT16 d, int o); - void jnbt(int m, int b, INT16 d, int o); - void jnz_r(int r, INT16 d); - void jnz_m(int m, INT16 d, int o); - void jnzb(int m, INT16 d, int o); - void jz_r(int r, INT16 d); - void jz_m(int m, INT16 d, int o); - void jzb(int m, INT16 d, int o); + void jbt(int m, int b, int16_t d, int o); + void jmce(int m, int16_t d, int o); + void jmcne(int m, int16_t d, int o); + void jnbt(int m, int b, int16_t d, int o); + void jnz_r(int r, int16_t d); + void jnz_m(int m, int16_t d, int o); + void jnzb(int m, int16_t d, int o); + void jz_r(int r, int16_t d); + void jz_m(int m, int16_t d, int o); + void jzb(int m, int16_t d, int o); void lpd(int p, int m, int o); void lpdi(int p, int s, int o); void mov_mr(int m, int r, int o); @@ -139,10 +139,10 @@ private: void movb_mr(int m, int r, int o); void movb_rm(int r, int m, int o); void movb_mm(int m1, int m2, int o1, int o2); - void movbi_ri(int r, INT8 i); - void movbi_mi(int m, INT8 i, int o); - void movi_ri(int r, INT16 i); - void movi_mi(int m, INT16 i, int o); + void movbi_ri(int r, int8_t i); + void movbi_mi(int m, int8_t i, int o); + void movi_ri(int r, int16_t i); + void movi_mi(int m, int16_t i, int o); void movp_mp(int m, int p, int o); void movp_pm(int p, int m, int o); void nop(); @@ -155,24 +155,24 @@ private: void or_mr(int m, int r, int o); void orb_rm(int r, int m, int o); void orb_mr(int m, int r, int o); - void orbi_ri(int r, INT8 i); - void orbi_mi(int m, INT8 i, int o); - void ori_ri(int r, INT16 i); - void ori_mi(int m, INT16 i, int o); + void orbi_ri(int r, int8_t i); + void orbi_mi(int m, int8_t i, int o); + void ori_ri(int r, int16_t i); + void ori_mi(int m, int16_t i, int o); void setb(int m, int b, int o); void sintr(); - void tsl(int m, INT8 i, INT8 d, int o); + void tsl(int m, int8_t i, int8_t d, int o); void wid(int s, int d); void xfer(); void invalid(int opc); // instruction fetch - INT16 displacement(int wb); - UINT32 offset(int aa, int mm, int w); - INT8 imm8(); - INT16 imm16(); + int16_t displacement(int wb); + uint32_t offset(int aa, int mm, int w); + int8_t imm8(); + int16_t imm16(); - void examine_ccw(UINT8 ccw); + void examine_ccw(uint8_t ccw); devcb_write_line m_write_sintr; @@ -184,7 +184,7 @@ private: void terminate_dma(int offset); bool m_xfer_pending; - UINT16 m_dma_value; + uint16_t m_dma_value; int m_dma_state; bool m_drq; diff --git a/src/devices/cpu/i8089/i8089_dasm.cpp b/src/devices/cpu/i8089/i8089_dasm.cpp index 2aa959485a3..ccfbadf2c58 100644 --- a/src/devices/cpu/i8089/i8089_dasm.cpp +++ b/src/devices/cpu/i8089/i8089_dasm.cpp @@ -13,7 +13,7 @@ class i8089_instruction { public: - i8089_instruction(offs_t pc, const UINT8 *oprom) : + i8089_instruction(offs_t pc, const uint8_t *oprom) : m_oprom(oprom), m_ppc(pc), m_pc(0), m_flags(DASMFLAG_SUPPORTED) { // instruction @@ -37,7 +37,7 @@ public: int flags() const { return m_flags; } private: - const UINT8 *m_oprom; + const uint8_t *m_oprom; char m_buffer[256]; char m_offset[100]; @@ -72,23 +72,23 @@ private: }; // fetch 1-byte value - UINT8 fetch_value8() + uint8_t fetch_value8() { - UINT8 i = m_oprom[m_pc]; + uint8_t i = m_oprom[m_pc]; m_pc += 1; return i; } // fetch 2-byte value - UINT16 fetch_value16() + uint16_t fetch_value16() { - UINT16 i = m_oprom[m_pc] | m_oprom[m_pc + 1] << 8; + uint16_t i = m_oprom[m_pc] | m_oprom[m_pc + 1] << 8; m_pc += 2; return i; } // fetch a 1 or 2 byte immediate value - UINT16 fetch_immediate() + uint16_t fetch_immediate() { return (m_wb & 1) ? fetch_value8() : fetch_value16(); } @@ -139,11 +139,11 @@ private: // jump register void inst_jr(const char *instr8, const char *instr16) { - UINT16 i = fetch_immediate(); + uint16_t i = fetch_immediate(); if (m_mm == 0 && m_w == 0 && m_wb == 1) - sprintf(m_buffer, "%s %s, %05x", instr8, m_reg[m_brp], m_ppc + m_pc + (INT8) i); + sprintf(m_buffer, "%s %s, %05x", instr8, m_reg[m_brp], m_ppc + m_pc + (int8_t) i); else if (m_mm == 0 && m_w == 0 && m_wb == 2) - sprintf(m_buffer, "%s %s, %05x", instr16, m_reg[m_brp], m_ppc + m_pc + (INT16) i); + sprintf(m_buffer, "%s %s, %05x", instr16, m_reg[m_brp], m_ppc + m_pc + (int16_t) i); else invalid(); } @@ -171,11 +171,11 @@ private: void inst_jm(const char *jump8short, const char *jump8long) { offset(); - UINT16 i = fetch_immediate(); + uint16_t i = fetch_immediate(); if (m_w == 0 && m_wb == 1 && m_brp == 0) - sprintf(m_buffer, "%s %s, %05x", jump8short, m_offset, m_ppc + m_pc + (INT8) i); + sprintf(m_buffer, "%s %s, %05x", jump8short, m_offset, m_ppc + m_pc + (int8_t) i); else if (m_w == 0 && m_wb == 2 && m_brp == 0) - sprintf(m_buffer, "%s %s, %05x", jump8long, m_offset, m_ppc + m_pc + (INT16) i); + sprintf(m_buffer, "%s %s, %05x", jump8long, m_offset, m_ppc + m_pc + (int16_t) i); else invalid(); } @@ -184,11 +184,11 @@ private: void inst_jmb(const char *jump8short, const char *jump8long) { offset(); - UINT16 i = fetch_immediate(); + uint16_t i = fetch_immediate(); if (m_w == 0 && m_wb == 1) - sprintf(m_buffer, "%s %s, %d, %05x", jump8short, m_offset, m_brp, m_ppc + m_pc + (INT8) i); + sprintf(m_buffer, "%s %s, %d, %05x", jump8short, m_offset, m_brp, m_ppc + m_pc + (int8_t) i); else if (m_w == 0 && m_wb == 2) - sprintf(m_buffer, "%s %s, %d, %05x", jump8long, m_offset, m_brp, m_ppc + m_pc + (INT16) i); + sprintf(m_buffer, "%s %s, %d, %05x", jump8long, m_offset, m_brp, m_ppc + m_pc + (int16_t) i); else invalid(); } @@ -229,15 +229,15 @@ private: void inst_j16(const char *jump8short, const char *jump16short, const char *jump8long, const char *jump16long) { offset(); - UINT16 i = fetch_immediate(); + uint16_t i = fetch_immediate(); if (m_w == 0 && m_wb == 1) - sprintf(m_buffer, "%s %s, %05x", jump8short, m_offset, m_ppc + m_pc + (INT8) i); + sprintf(m_buffer, "%s %s, %05x", jump8short, m_offset, m_ppc + m_pc + (int8_t) i); else if (m_w == 1 && m_wb == 1) - sprintf(m_buffer, "%s %s, %05x", jump16short, m_offset, m_ppc + m_pc + (INT8) i); + sprintf(m_buffer, "%s %s, %05x", jump16short, m_offset, m_ppc + m_pc + (int8_t) i); else if (m_w == 0 && m_wb == 2) - sprintf(m_buffer, "%s %s, %05x", jump8long, m_offset, m_ppc + m_pc + (INT16) i); + sprintf(m_buffer, "%s %s, %05x", jump8long, m_offset, m_ppc + m_pc + (int16_t) i); else if (m_w == 1 && m_wb == 2) - sprintf(m_buffer, "%s %s, %05x", jump16long, m_offset, m_ppc + m_pc + (INT16) i); + sprintf(m_buffer, "%s %s, %05x", jump16long, m_offset, m_ppc + m_pc + (int16_t) i); else invalid(); } @@ -298,8 +298,8 @@ private: case 0x02: if (m_w == 1 && m_aa == 0 && m_wb == 2) { - UINT16 offs = fetch_immediate(); - UINT16 segm = fetch_immediate(); + uint16_t offs = fetch_immediate(); + uint16_t segm = fetch_immediate(); sprintf(m_buffer, "lpdi %s, %05x", m_reg[m_brp], ((segm << 4) + offs) & 0xfffff); } else @@ -309,12 +309,12 @@ private: case 0x08: if (m_mm == 0) { - UINT16 i = fetch_immediate(); + uint16_t i = fetch_immediate(); if (m_w == 0 && m_aa == 0 && m_wb == 1 && m_brp == TP) - sprintf(m_buffer, "jmp %05x", m_ppc + m_pc + (INT8) i); + sprintf(m_buffer, "jmp %05x", m_ppc + m_pc + (int8_t) i); else if (m_w == 1 && m_aa == 0 && m_wb == 2 && m_brp == TP) - sprintf(m_buffer, "ljmp %05x", m_ppc + m_pc + (INT16) i); + sprintf(m_buffer, "ljmp %05x", m_ppc + m_pc + (int16_t) i); else if (m_w == 0 && m_wb == 1) sprintf(m_buffer, "addbi %s, %02x", m_reg[m_brp], i); else if (m_w == 1 && m_wb == 2) @@ -371,8 +371,8 @@ private: if (m_w == 0 && m_wb == 3 && m_brp == 0) { offset(); - UINT16 i = fetch_immediate(); - int displacement = (INT8) fetch_immediate(); + uint16_t i = fetch_immediate(); + int displacement = (int8_t) fetch_immediate(); sprintf(m_buffer, "tsl %s, %02x, %05x", m_offset, i, m_ppc + m_pc + displacement); } else @@ -385,12 +385,12 @@ private: if (m_w == 1 && m_brp == TP && (m_wb == 1 || m_wb == 2)) { offset(); - UINT16 i = fetch_immediate(); + uint16_t i = fetch_immediate(); if (m_wb == 1) - sprintf(m_buffer, "call %s, %05x", m_offset, m_ppc + m_pc + (INT8) i); + sprintf(m_buffer, "call %s, %05x", m_offset, m_ppc + m_pc + (int8_t) i); else if (m_wb == 2) - sprintf(m_buffer, "lcall %s, %05x", m_offset, m_ppc + m_pc + (INT16) i); + sprintf(m_buffer, "lcall %s, %05x", m_offset, m_ppc + m_pc + (int16_t) i); m_flags |= DASMFLAG_STEP_OVER; } diff --git a/src/devices/cpu/i8089/i8089_ops.cpp b/src/devices/cpu/i8089/i8089_ops.cpp index 09c8f5cd037..4b20052014e 100644 --- a/src/devices/cpu/i8089/i8089_ops.cpp +++ b/src/devices/cpu/i8089/i8089_ops.cpp @@ -13,8 +13,8 @@ #define UNIMPLEMENTED logerror("%s('%s'): unimplemented opcode: %s\n", shortname(), tag(), __FUNCTION__); -#define LWR(m, o) ((INT16)m_iop->read_word(m_r[m].t, o)) -#define LBR(m, o) ((INT8)m_iop->read_byte(m_r[m].t, o)) +#define LWR(m, o) ((int16_t)m_iop->read_word(m_r[m].t, o)) +#define LBR(m, o) ((int8_t)m_iop->read_byte(m_r[m].t, o)) #define SWR(m, o, d) (m_iop->write_word(m_r[m].t, o, d)) #define SBR(m, o, d) (m_iop->write_byte(m_r[m].t, o, d)) @@ -38,22 +38,22 @@ void i8089_channel::addb_mr(int m, int r, int o) SBR(m, o, LBR(m, o) + m_r[r].w); } -void i8089_channel::addbi_ri(int r, INT8 i) +void i8089_channel::addbi_ri(int r, int8_t i) { set_reg(r, m_r[r].w + i); } -void i8089_channel::addbi_mi(int m, INT8 i, int o) +void i8089_channel::addbi_mi(int m, int8_t i, int o) { SBR(m, o, LBR(m, o) + i); } -void i8089_channel::addi_ri(int r, INT16 i) +void i8089_channel::addi_ri(int r, int16_t i) { set_reg(r, m_r[r].w + i); } -void i8089_channel::addi_mi(int m, INT16 i, int o) +void i8089_channel::addi_mi(int m, int16_t i, int o) { SWR(m, o, LWR(m, o) + i); } @@ -70,7 +70,7 @@ void i8089_channel::and_mr(int m, int r, int o) void i8089_channel::andb_rm(int r, int m, int o) { - set_reg(r, m_r[r].w & (INT16)LBR(m, o)); + set_reg(r, m_r[r].w & (int16_t)LBR(m, o)); } void i8089_channel::andb_mr(int m, int r, int o) @@ -78,27 +78,27 @@ void i8089_channel::andb_mr(int m, int r, int o) SBR(m, o, LBR(m, o) & m_r[r].w); } -void i8089_channel::andbi_ri(int r, INT8 i) +void i8089_channel::andbi_ri(int r, int8_t i) { - set_reg(r, m_r[r].w & (INT16)i); + set_reg(r, m_r[r].w & (int16_t)i); } -void i8089_channel::andbi_mi(int m, INT8 i, int o) +void i8089_channel::andbi_mi(int m, int8_t i, int o) { SBR(m, o, LBR(m, o) & i); } -void i8089_channel::andi_ri(int r, INT16 i) +void i8089_channel::andi_ri(int r, int16_t i) { set_reg(r, m_r[r].w & i); } -void i8089_channel::andi_mi(int m, INT16 i, int o) +void i8089_channel::andi_mi(int m, int16_t i, int o) { SWR(m, o, LWR(m, o) & i); } -void i8089_channel::call(int m, INT16 d, int o) +void i8089_channel::call(int m, int16_t d, int o) { movp_mp(m, TP, o); set_reg(TP, m_r[TP].w + d); @@ -148,62 +148,62 @@ void i8089_channel::incb(int m, int o) SBR(m, o, LBR(m, o) + 1); } -void i8089_channel::jbt(int m, int b, INT16 d, int o) +void i8089_channel::jbt(int m, int b, int16_t d, int o) { if(LBR(m, o) & (1<> 8))) set_reg(TP, m_r[TP].w + d); } -void i8089_channel::jmcne(int m, INT16 d, int o) +void i8089_channel::jmcne(int m, int16_t d, int o) { if((LBR(m, o) ^ (m_r[MC].w & 0xff)) & (m_r[MC].w >> 8)) set_reg(TP, m_r[TP].w + d); } -void i8089_channel::jnbt(int m, int b, INT16 d, int o) +void i8089_channel::jnbt(int m, int b, int16_t d, int o) { if(!(LBR(m, o) & (1<read_word(m_r[m].t, o); - UINT16 segment = m_iop->read_word(m_r[m].t, o + 2); + uint16_t offset = m_iop->read_word(m_r[m].t, o); + uint16_t segment = m_iop->read_word(m_r[m].t, o + 2); set_reg(p, ((segment << 4) + offset) & 0xfffff, 0); } @@ -232,7 +232,7 @@ void i8089_channel::mov_mr(int m, int r, int o) void i8089_channel::mov_rm(int r, int m, int o) { - set_reg(r, (INT32)LWR(m, o), 1); + set_reg(r, (int32_t)LWR(m, o), 1); } void i8089_channel::mov_mm(int m1, int m2, int o1, int o2) @@ -249,37 +249,37 @@ void i8089_channel::movb_mr(int m, int r, int o) // move memory byte to register void i8089_channel::movb_rm(int r, int m, int o) { - UINT8 byte = m_iop->read_byte(m_r[m].t, o); + uint8_t byte = m_iop->read_byte(m_r[m].t, o); set_reg(r, (BIT(byte, 7) ? 0xfff00 : 0x00000) | byte, 1); } // move memory byte to memory byte void i8089_channel::movb_mm(int m1, int m2, int o1, int o2) { - UINT8 byte = m_iop->read_byte(m_r[m1].t, o1); + uint8_t byte = m_iop->read_byte(m_r[m1].t, o1); m_iop->write_byte(m_r[m2].t, o2, byte); } // move immediate byte to register -void i8089_channel::movbi_ri(int r, INT8 i) +void i8089_channel::movbi_ri(int r, int8_t i) { set_reg(r, (BIT(i, 7) ? 0xfff00 : 0x00000) | (i & 0xff), 1); } // move immediate byte to memory byte -void i8089_channel::movbi_mi(int m, INT8 i, int o) +void i8089_channel::movbi_mi(int m, int8_t i, int o) { m_iop->write_byte(m_r[m].t, o, i & 0xff); } // move immediate word to register -void i8089_channel::movi_ri(int r, INT16 i) +void i8089_channel::movi_ri(int r, int16_t i) { set_reg(r, (BIT(i, 15) ? 0xf0000 : 0x00000) | (i & 0xffff), 1); } // move immediate word to memory word -void i8089_channel::movi_mi(int m, INT16 i, int o) +void i8089_channel::movi_mi(int m, int16_t i, int o) { m_iop->write_word(m_r[m].t, o, (BIT(i, 15) ? 0xf0000 : 0x00000) | (i & 0xffff)); } @@ -294,8 +294,8 @@ void i8089_channel::movp_mp(int m, int p, int o) // move memory to pointer (restore) void i8089_channel::movp_pm(int p, int m, int o) { - UINT16 offset = m_iop->read_word(m_r[m].t, o); - UINT16 segment = m_iop->read_byte(m_r[m].t, o + 2); + uint16_t offset = m_iop->read_word(m_r[m].t, o); + uint16_t segment = m_iop->read_byte(m_r[m].t, o + 2); set_reg(p, (((segment & 0xf0) << 12) + offset) & 0xfffff, segment >> 3 & 0x01); } @@ -317,7 +317,7 @@ void i8089_channel::not_m(int m, int o) void i8089_channel::not_rm(int r, int m, int o) { - set_reg(r, ~(INT32)LWR(m, o)); + set_reg(r, ~(int32_t)LWR(m, o)); } void i8089_channel::notb_m(int m, int o) @@ -327,7 +327,7 @@ void i8089_channel::notb_m(int m, int o) void i8089_channel::notb_rm(int r, int m, int o) { - set_reg(r, ~(INT32)LBR(m, o)); + set_reg(r, ~(int32_t)LBR(m, o)); } void i8089_channel::or_rm(int r, int m, int o) @@ -342,7 +342,7 @@ void i8089_channel::or_mr(int m, int r, int o) void i8089_channel::orb_rm(int r, int m, int o) { - set_reg(r, m_r[r].w | (INT16)LBR(m, o)); + set_reg(r, m_r[r].w | (int16_t)LBR(m, o)); } void i8089_channel::orb_mr(int m, int r, int o) @@ -350,22 +350,22 @@ void i8089_channel::orb_mr(int m, int r, int o) SBR(m, o, LBR(m, o) | m_r[r].w); } -void i8089_channel::orbi_ri(int r, INT8 i) +void i8089_channel::orbi_ri(int r, int8_t i) { - set_reg(r, m_r[r].w | (INT16)i); + set_reg(r, m_r[r].w | (int16_t)i); } -void i8089_channel::orbi_mi(int m, INT8 i, int o) +void i8089_channel::orbi_mi(int m, int8_t i, int o) { SBR(m, o, LBR(m, o) | i); } -void i8089_channel::ori_ri(int r, INT16 i) +void i8089_channel::ori_ri(int r, int16_t i) { set_reg(r, m_r[r].w | i); } -void i8089_channel::ori_mi(int m, INT16 i, int o) +void i8089_channel::ori_mi(int m, int16_t i, int o) { SWR(m, o, LWR(m, o) | i); } @@ -386,7 +386,7 @@ void i8089_channel::sintr() } } -void i8089_channel::tsl(int m, INT8 i, INT8 d, int o) +void i8089_channel::tsl(int m, int8_t i, int8_t d, int o) { if(LBR(m, o)) set_reg(TP, m_r[TP].w + d); diff --git a/src/devices/cpu/i86/i186.cpp b/src/devices/cpu/i86/i186.cpp index 00f3356f05d..9bfa8780c73 100644 --- a/src/devices/cpu/i86/i186.cpp +++ b/src/devices/cpu/i86/i186.cpp @@ -45,7 +45,7 @@ #define BYTE_WORD 0x0001 /* these come from the Intel 80186 datasheet */ -const UINT8 i80186_cpu_device::m_i80186_timing[] = +const uint8_t i80186_cpu_device::m_i80186_timing[] = { 45,28, /* exception, IRET */ 0, 2, 4, 3, /* INTs */ @@ -120,7 +120,7 @@ const UINT8 i80186_cpu_device::m_i80186_timing[] = const device_type I80186 = &device_creator; const device_type I80188 = &device_creator; -i80188_cpu_device::i80188_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i80188_cpu_device::i80188_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i80186_cpu_device(mconfig, I80188, "I80188", tag, owner, clock, "i80188", __FILE__, 8) { memcpy(m_timing, m_i80186_timing, sizeof(m_i80186_timing)); @@ -128,7 +128,7 @@ i80188_cpu_device::i80188_cpu_device(const machine_config &mconfig, const char * static_set_irq_acknowledge_callback(*this, device_irq_acknowledge_delegate(FUNC(i80186_cpu_device::int_callback), this)); } -i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8086_common_cpu_device(mconfig, I80186, "I80186", tag, owner, clock, "i80186", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, 20, 0) , m_io_config("io", ENDIANNESS_LITTLE, 16, 16, 0) @@ -142,7 +142,7 @@ i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, const char * static_set_irq_acknowledge_callback(*this, device_irq_acknowledge_delegate(FUNC(i80186_cpu_device::int_callback), this)); } -i80186_cpu_device::i80186_cpu_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, int data_bus_size) +i80186_cpu_device::i80186_cpu_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, int data_bus_size) : i8086_common_cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, data_bus_size, 20, 0) , m_io_config("io", ENDIANNESS_LITTLE, data_bus_size, 16, 0) @@ -153,16 +153,16 @@ i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, device_type { } -UINT8 i80186_cpu_device::fetch_op() +uint8_t i80186_cpu_device::fetch_op() { - UINT8 data = m_direct->read_byte(pc(), m_fetch_xor); + uint8_t data = m_direct->read_byte(pc(), m_fetch_xor); m_ip++; return data; } -UINT8 i80186_cpu_device::fetch() +uint8_t i80186_cpu_device::fetch() { - UINT8 data = m_direct->read_byte(pc(), m_fetch_xor); + uint8_t data = m_direct->read_byte(pc(), m_fetch_xor); m_ip++; return data; } @@ -228,13 +228,13 @@ void i80186_cpu_device::execute_run() debugger_instruction_hook( this, pc() ); - UINT8 op = fetch_op(); + uint8_t op = fetch_op(); switch(op) { case 0x60: // i_pusha { - UINT32 tmp = m_regs.w[SP]; + uint32_t tmp = m_regs.w[SP]; PUSH(m_regs.w[AX]); PUSH(m_regs.w[CX]); @@ -262,7 +262,7 @@ void i80186_cpu_device::execute_run() case 0x62: // i_bound { - UINT32 low,high,tmp; + uint32_t low,high,tmp; m_modrm = fetch(); low = GetRMWord(); high = GetnextRMWord(); @@ -281,28 +281,28 @@ void i80186_cpu_device::execute_run() case 0x69: // i_imul_d16 { - UINT32 tmp; + uint32_t tmp; DEF_r16w(); tmp = fetch_word(); - m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)tmp); - m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1); + m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)tmp); + m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1); RegWord(m_dst); CLKM(IMUL_RRI16, IMUL_RMI16); } break; case 0x6a: // i_push_d8 - PUSH( (UINT16)((INT16)((INT8)fetch())) ); + PUSH( (uint16_t)((int16_t)((int8_t)fetch())) ); CLK(PUSH_IMM); break; case 0x6b: // i_imul_d8 { - UINT32 src2; + uint32_t src2; DEF_r16w(); - src2= (UINT16)((INT16)((INT8)fetch())); - m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)src2); - m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1); + src2= (uint16_t)((int16_t)((int8_t)fetch())); + m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)src2); + m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1); RegWord(m_dst); CLKM(IMUL_RRI8, IMUL_RMI8); } @@ -350,7 +350,7 @@ void i80186_cpu_device::execute_run() case 0xc0: // i_rotshft_bd8 { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMByte(); m_dst = m_src; @@ -376,7 +376,7 @@ void i80186_cpu_device::execute_run() case 0xc1: // i_rotshft_wd8 { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMWord(); m_dst = m_src; @@ -402,8 +402,8 @@ void i80186_cpu_device::execute_run() case 0xc8: // i_enter { - UINT16 nb = fetch(); - UINT32 level; + uint16_t nb = fetch(); + uint32_t level; nb |= fetch() << 8; level = fetch(); @@ -432,7 +432,7 @@ void i80186_cpu_device::execute_run() case 0xd2: // i_rotshft_bcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMByte(); @@ -459,7 +459,7 @@ void i80186_cpu_device::execute_run() case 0xd3: // i_rotshft_wcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMWord(); @@ -510,8 +510,8 @@ void i80186_cpu_device::execute_run() case 0xf3: { bool pass = false; - UINT8 next = repx_op(); - UINT16 c = m_regs.w[CX]; + uint8_t next = repx_op(); + uint16_t c = m_regs.w[CX]; switch (next) { @@ -653,23 +653,23 @@ void i80186_cpu_device::device_reset() } } -UINT8 i80186_cpu_device::read_port_byte(UINT16 port) +uint8_t i80186_cpu_device::read_port_byte(uint16_t port) { if(!(m_reloc & 0x1000) && (port >> 8) == (m_reloc & 0xff)) { - UINT16 ret = internal_port_r(*m_io, (port >> 1) - ((m_reloc & 0xff) << 7), (port & 1) ? 0xff00 : 0x00ff); + uint16_t ret = internal_port_r(*m_io, (port >> 1) - ((m_reloc & 0xff) << 7), (port & 1) ? 0xff00 : 0x00ff); return (port & 1) ? (ret >> 8) : (ret & 0xff); } return m_io->read_byte(port); } -UINT16 i80186_cpu_device::read_port_word(UINT16 port) +uint16_t i80186_cpu_device::read_port_word(uint16_t port) { if(!(m_reloc & 0x1000) && (port >> 8) == (m_reloc & 0xff)) { if(port & 1) { - UINT8 low = read_port_byte(port); + uint8_t low = read_port_byte(port); return read_port_byte(port + 1) << 8 | low; } return internal_port_r(*m_io, (port >> 1) - ((m_reloc & 0xff) << 7)); @@ -677,7 +677,7 @@ UINT16 i80186_cpu_device::read_port_word(UINT16 port) return m_io->read_word_unaligned(port); } -void i80186_cpu_device::write_port_byte(UINT16 port, UINT8 data) +void i80186_cpu_device::write_port_byte(uint16_t port, uint8_t data) { if(!(m_reloc & 0x1000) && (port >> 8) == (m_reloc & 0xff)) internal_port_w(*m_io, (port >> 1) - ((m_reloc & 0xff) << 7), (port & 1) ? (data << 8) : data, (port & 1) ? 0xff00 : 0x00ff); @@ -685,7 +685,7 @@ void i80186_cpu_device::write_port_byte(UINT16 port, UINT8 data) m_io->write_byte(port, data); } -void i80186_cpu_device::write_port_word(UINT16 port, UINT16 data) +void i80186_cpu_device::write_port_word(uint16_t port, uint16_t data) { if(!(m_reloc & 0x1000) && (port >> 8) == (m_reloc & 0xff)) { @@ -708,9 +708,9 @@ void i80186_cpu_device::write_port_word(UINT16 port, UINT16 data) *************************************/ IRQ_CALLBACK_MEMBER(i80186_cpu_device::int_callback) { - UINT8 vector; - UINT16 old; - UINT16 oldreq; + uint8_t vector; + uint16_t old; + uint16_t oldreq; if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", machine().time().as_double(), m_intr.poll_status & 0x1f); @@ -943,7 +943,7 @@ void i80186_cpu_device::handle_eoi(int data) } /* Trigger an external interrupt, optionally supplying the vector to take */ -void i80186_cpu_device::external_int(UINT16 intno, int state) +void i80186_cpu_device::external_int(uint16_t intno, int state) { if (!(m_intr.ext_state & (1 << intno)) == !state) return; @@ -1135,7 +1135,7 @@ void i80186_cpu_device::internal_timer_update(int which, int new_count, int new_ if (new_control != -1) { int diff; - UINT16 resbits = (which == 2) ? 0x1fde : 0x1fc0; + uint16_t resbits = (which == 2) ? 0x1fde : 0x1fc0; /* merge back in the bits we don't modify */ new_control = (new_control & ~resbits) | (t->control & resbits); @@ -1231,9 +1231,9 @@ void i80186_cpu_device::drq_callback(int which) { dma_state *dma = &m_dma[which]; - UINT16 dma_word; - UINT8 dma_byte; - UINT8 incdec_size; + uint16_t dma_word; + uint8_t dma_byte; + uint8_t incdec_size; if (LOG_DMA>1) logerror("Control=%04X, src=%05X, dest=%05X, count=%04X\n",dma->control,dma->source,dma->dest,dma->count); @@ -1693,8 +1693,8 @@ WRITE16_MEMBER(i80186_cpu_device::internal_port_w) if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X\n", pc(), data); if ((data & 0x1fff) != (m_reloc & 0x1fff)) { - UINT32 newmap = (data & 0xfff) << 8; - UINT32 oldmap = (m_reloc & 0xfff) << 8; + uint32_t newmap = (data & 0xfff) << 8; + uint32_t oldmap = (m_reloc & 0xfff) << 8; if (!(data & 0x1000) || ((data & 0x1000) && (m_reloc & 0x1000))) m_program->unmap_readwrite(oldmap, oldmap + 0xff); if (data & 0x1000) // TODO: make work with 80188 if needed diff --git a/src/devices/cpu/i86/i186.h b/src/devices/cpu/i86/i186.h index cff4c9f8606..bfc4f14cb07 100644 --- a/src/devices/cpu/i86/i186.h +++ b/src/devices/cpu/i86/i186.h @@ -13,8 +13,8 @@ class i80186_cpu_device : public i8086_common_cpu_device { public: // construction/destruction - i80186_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - i80186_cpu_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, int data_bus_size); + i80186_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + i80186_cpu_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, int data_bus_size); template static devcb_base &static_set_read_slave_ack_callback(device_t &device, _Object object) { return downcast(device).m_read_slave_ack_func.set_callback(object); } template static devcb_base &static_set_chip_select_callback(device_t &device, _Object object) { return downcast(device).m_out_chip_select_func.set_callback(object); } @@ -36,28 +36,28 @@ public: protected: // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks / 2); } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 2); } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks / 2); } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } virtual void execute_run() override; 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 UINT32 execute_input_lines() const override { return 1; } - virtual UINT8 fetch_op() override; - virtual UINT8 fetch() override; - UINT32 pc() { return m_pc = (m_sregs[CS] << 4) + m_ip; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint8_t fetch_op() override; + virtual uint8_t fetch() override; + uint32_t pc() { return m_pc = (m_sregs[CS] << 4) + m_ip; } - virtual UINT8 read_port_byte(UINT16 port) override; - virtual UINT16 read_port_word(UINT16 port) override; - virtual void write_port_byte(UINT16 port, UINT8 data) override; - virtual void write_port_word(UINT16 port, UINT16 data) override; + virtual uint8_t read_port_byte(uint16_t port) override; + virtual uint16_t read_port_word(uint16_t port) override; + virtual void write_port_byte(uint16_t port, uint8_t data) override; + virtual void write_port_word(uint16_t port, uint16_t data) override; - static const UINT8 m_i80186_timing[200]; + static const uint8_t m_i80186_timing[200]; private: void update_interrupt_state(); void handle_eoi(int data); - void external_int(UINT16 intno, int state); + void external_int(uint16_t intno, int state); void internal_timer_sync(int which); void internal_timer_update(int which, int new_count, int new_maxA, int new_maxB, int new_control); void update_dma_control(int which, int new_control); @@ -68,45 +68,45 @@ private: struct mem_state { - UINT16 lower; - UINT16 upper; - UINT16 middle; - UINT16 middle_size; - UINT16 peripheral; + uint16_t lower; + uint16_t upper; + uint16_t middle; + uint16_t middle_size; + uint16_t peripheral; }; struct timer_state { - UINT16 control; - UINT16 maxA; - UINT16 maxB; + uint16_t control; + uint16_t maxA; + uint16_t maxB; bool active_count; - UINT16 count; + uint16_t count; emu_timer *int_timer; }; struct dma_state { bool drq_state; - UINT32 source; - UINT32 dest; - UINT16 count; - UINT16 control; + uint32_t source; + uint32_t dest; + uint16_t count; + uint16_t control; }; struct intr_state { - UINT8 pending; - UINT16 ack_mask; - UINT16 priority_mask; - UINT16 in_service; - UINT16 request; - UINT16 status; - UINT16 poll_status; - UINT16 timer; - UINT16 dma[2]; - UINT16 ext[4]; - UINT8 ext_state; + uint8_t pending; + uint16_t ack_mask; + uint16_t priority_mask; + uint16_t in_service; + uint16_t request; + uint16_t status; + uint16_t poll_status; + uint16_t timer; + uint16_t dma[2]; + uint16_t ext[4]; + uint8_t ext_state; }; timer_state m_timer[3]; @@ -118,7 +118,7 @@ private: static const device_timer_id TIMER_INT1 = 1; static const device_timer_id TIMER_INT2 = 2; - UINT16 m_reloc; + uint16_t m_reloc; address_space_config m_program_config; address_space_config m_io_config; @@ -133,7 +133,7 @@ class i80188_cpu_device : public i80186_cpu_device { public: // construction/destruction - i80188_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i80188_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; #define MCFG_80186_IRQ_SLAVE_ACK(_devcb) \ diff --git a/src/devices/cpu/i86/i286.cpp b/src/devices/cpu/i86/i286.cpp index d7743897d35..e6358a2f88b 100644 --- a/src/devices/cpu/i86/i286.cpp +++ b/src/devices/cpu/i86/i286.cpp @@ -92,7 +92,7 @@ /* these come from the 80286 timings in OPCODE.LST */ /* many of these numbers are suspect TODO: add protmode insns*/ -const UINT8 i80286_cpu_device::m_i80286_timing[] = +const uint8_t i80286_cpu_device::m_i80286_timing[] = { 23,17, /* exception, IRET */ 0, 2, 3, 1, /* INTs */ @@ -166,7 +166,7 @@ const UINT8 i80286_cpu_device::m_i80286_timing[] = const device_type I80286 = &device_creator; -i80286_cpu_device::i80286_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i80286_cpu_device::i80286_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8086_common_cpu_device(mconfig, I80286, "I80286", tag, owner, clock, "i80286", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0) , m_io_config("io", ENDIANNESS_LITTLE, 16, 16, 0) @@ -289,7 +289,7 @@ void i80286_cpu_device::state_string_export(const device_state_entry &entry, std case STATE_GENFLAGS: { - UINT16 flags = CompressFlags(); + uint16_t flags = CompressFlags(); str = string_format("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", flags & 0x8000 ? '0':'.', flags & 0x4000 ? 'N':'.', @@ -353,10 +353,10 @@ void i80286_cpu_device::execute_set_input(int inptnum, int state) // of the nvram. if yes, after init, it sets the stack pointer to the value in 0040:0067 // in the bios data segment then pops es and ds off that stack, does popa then a far ret. -void i80286_cpu_device::trap(UINT32 error) +void i80286_cpu_device::trap(uint32_t error) { int error_code = error & 0xffff; - UINT16 number = error >> 16; + uint16_t number = error >> 16; if(error_code == 0xffff) error_code = -1; m_ip = m_prev_ip; @@ -383,7 +383,7 @@ void i80286_cpu_device::trap(UINT32 error) interrupt_descriptor(number,1,-1); } } - catch(UINT32 e) + catch(uint32_t e) { trap(e); } @@ -395,10 +395,10 @@ void i80286_cpu_device::trap(UINT32 error) m_trap_level = 0; } -UINT32 i80286_cpu_device::selector_address(UINT16 sel) +uint32_t i80286_cpu_device::selector_address(uint16_t sel) { - UINT32 base; - UINT16 limit; + uint32_t base; + uint16_t limit; if(TBL(sel)) { base = m_ldtr.base; @@ -412,7 +412,7 @@ UINT32 i80286_cpu_device::selector_address(UINT16 sel) return ((IDX(sel) >= limit) || !IDXTBL(sel) ? -1 : base + IDX(sel)); } -int i80286_cpu_device::verify(UINT16 selector, int operation, UINT8 rights, bool valid) +int i80286_cpu_device::verify(uint16_t selector, int operation, uint8_t rights, bool valid) { if(!IDXTBL(selector) && !valid) return FAULT_GP; @@ -439,7 +439,7 @@ int i80286_cpu_device::verify(UINT16 selector, int operation, UINT8 rights, bool void i80286_cpu_device::pop_seg(int reg) { - UINT16 sel; + uint16_t sel; if(PM) check_permission(SS, m_regs.w[SP], 2, I8086_READ); sel = read_word(m_base[SS] + m_regs.w[SP]); @@ -447,13 +447,13 @@ void i80286_cpu_device::pop_seg(int reg) m_regs.w[SP] += 2; } -void i80286_cpu_device::data_descriptor(int reg, UINT16 selector, int cpl, UINT32 trap, UINT16 offset, int size) +void i80286_cpu_device::data_descriptor(int reg, uint16_t selector, int cpl, uint32_t trap, uint16_t offset, int size) { if(PM) { - UINT16 desc[3]; - UINT8 r; - UINT32 addr; + uint16_t desc[3]; + uint8_t r; + uint32_t addr; if((reg != SS) && !IDXTBL(selector)) { m_sregs[reg] = 0; @@ -522,16 +522,16 @@ void i80286_cpu_device::data_descriptor(int reg, UINT16 selector, int cpl, UINT3 m_valid[reg] = 1; } -void i80286_cpu_device::data_descriptor(int reg, UINT16 selector) +void i80286_cpu_device::data_descriptor(int reg, uint16_t selector) { data_descriptor(reg, selector, CPL, TRAP(FAULT_GP,IDXTBL(selector))); } -void i80286_cpu_device::switch_task(UINT16 ntask, int type) +void i80286_cpu_device::switch_task(uint16_t ntask, int type) { - UINT16 ndesc[3], desc[3], ntss[22], otss[22], flags; - UINT8 r, lr; - UINT32 naddr, oaddr, ldtaddr; + uint16_t ndesc[3], desc[3], ntss[22], otss[22], flags; + uint8_t r, lr; + uint32_t naddr, oaddr, ldtaddr; int i; logerror("i286: %06x This program uses TSSs, how rare. Please report this to the developers.\n", pc()); @@ -658,7 +658,7 @@ void i80286_cpu_device::switch_task(UINT16 ntask, int type) { code_descriptor(ntss[TSS_CS], ntss[TSS_IP], 0); } - catch (UINT32 e) + catch (uint32_t e) { int error_code = e & 0xffff; if(error_code == FAULT_GP) @@ -670,13 +670,13 @@ void i80286_cpu_device::switch_task(UINT16 ntask, int type) data_descriptor(DS, ntss[TSS_DS], CPL, TRAP(FAULT_TS, IDXTBL(ntss[TSS_DS]))); } -void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate) +void i80286_cpu_device::code_descriptor(uint16_t selector, uint16_t offset, int gate) { if(PM) { - UINT16 desc[3]; - UINT8 r; - UINT32 addr; + uint16_t desc[3]; + uint8_t r; + uint32_t addr; if((addr = selector_address(selector)) == -1) throw TRAP(FAULT_GP, IDXTBL(selector)); @@ -715,7 +715,7 @@ void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate } else { // systemdescriptor - UINT16 gatesel = GATESEL(desc); + uint16_t gatesel = GATESEL(desc); if(!gate) throw TRAP(FAULT_GP, IDXTBL(selector)); // tss cs must be segment @@ -728,7 +728,7 @@ void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate { case CALLGATE: { - UINT16 gatedesc[3]; + uint16_t gatedesc[3]; if((addr = selector_address(gatesel)) == -1) throw TRAP(FAULT_GP, IDXTBL(gatesel)); @@ -750,8 +750,8 @@ void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate if (!CONF(r) && (DPL(r) < CPL)) { // inner call - UINT16 tss_ss, tss_sp, oldss, oldsp; - UINT32 oldstk; + uint16_t tss_ss, tss_sp, oldss, oldsp; + uint32_t oldstk; int i; if(gate == NT_JMP) throw TRAP(FAULT_GP, IDXTBL(gatesel)); // can't jmp to inner @@ -814,8 +814,8 @@ void i80286_cpu_device::code_descriptor(UINT16 selector, UINT16 offset, int gate void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) { - UINT16 desc[3], gatesel, flags = CompressFlags(); - UINT8 r; + uint16_t desc[3], gatesel, flags = CompressFlags(); + uint8_t r; hwint = hwint ? 1 : 0; if(number == -1) @@ -832,8 +832,8 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) PUSH(flags & ~0xf000); m_TF = m_IF = 0; - UINT16 dest_off = read_word(number * 4 + 0); - UINT16 dest_seg = read_word(number * 4 + 2); + uint16_t dest_off = read_word(number * 4 + 0); + uint16_t dest_seg = read_word(number * 4 + 2); PUSH(m_sregs[CS]); PUSH(m_ip); @@ -862,7 +862,7 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) { switch_task(gatesel, NT_CALL); } - catch (UINT32 e) + catch (uint32_t e) { throw e + hwint; } @@ -874,8 +874,8 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) case INTGATE: case TRAPGATE: { - UINT16 gatedesc[3]; - UINT32 addr; + uint16_t gatedesc[3]; + uint32_t addr; if((addr = selector_address(gatesel)) == -1) throw TRAP(FAULT_GP, (IDXTBL(gatesel) + hwint)); @@ -896,7 +896,7 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) if(!CONF(r) && (DPL(r) < CPL)) { // inner call - UINT16 tss_ss, tss_sp, oldss, oldsp; + uint16_t tss_ss, tss_sp, oldss, oldsp; tss_ss = read_word(m_tr.base + TSS_SS0 * 2 + (DPL(r) * 4)); tss_sp = read_word(m_tr.base + TSS_SP0 * 2 + (DPL(r) * 4)); @@ -933,37 +933,37 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) } } -UINT8 i80286_cpu_device::read_port_byte(UINT16 port) +uint8_t i80286_cpu_device::read_port_byte(uint16_t port) { if(PM && (CPL > m_IOPL)) throw TRAP(FAULT_GP, 0); return m_io->read_byte(port); } -UINT16 i80286_cpu_device::read_port_word(UINT16 port) +uint16_t i80286_cpu_device::read_port_word(uint16_t port) { if(PM && (CPL > m_IOPL)) throw TRAP(FAULT_GP, 0); return m_io->read_word_unaligned(port); } -void i80286_cpu_device::write_port_byte(UINT16 port, UINT8 data) +void i80286_cpu_device::write_port_byte(uint16_t port, uint8_t data) { if(PM && (CPL > m_IOPL)) throw TRAP(FAULT_GP, 0); m_io->write_byte(port, data); } -void i80286_cpu_device::write_port_word(UINT16 port, UINT16 data) +void i80286_cpu_device::write_port_word(uint16_t port, uint16_t data) { if(PM && (CPL > m_IOPL)) throw TRAP(FAULT_GP, 0); m_io->write_word_unaligned(port, data); } -UINT8 i80286_cpu_device::fetch_op() +uint8_t i80286_cpu_device::fetch_op() { - UINT8 data; + uint8_t data; if(m_ip > m_limit[CS]) throw TRAP(FAULT_GP, 0); @@ -972,9 +972,9 @@ UINT8 i80286_cpu_device::fetch_op() return data; } -UINT8 i80286_cpu_device::fetch() +uint8_t i80286_cpu_device::fetch() { - UINT8 data; + uint8_t data; if(m_ip > m_limit[CS]) throw TRAP(FAULT_GP, 0); @@ -983,7 +983,7 @@ UINT8 i80286_cpu_device::fetch() return data; } -UINT32 i80286_cpu_device::calc_addr(int seg, UINT16 offset, int size, int op, bool override) +uint32_t i80286_cpu_device::calc_addr(int seg, uint16_t offset, int size, int op, bool override) { seg = (m_seg_prefix && (seg==DS || seg==SS) && override) ? m_prefix_seg : seg; if(op != I8086_NONE) @@ -1055,7 +1055,7 @@ void i80286_cpu_device::execute_run() debugger_instruction_hook( this, pc() & m_amask ); - UINT8 op = fetch_op(); + uint8_t op = fetch_op(); switch(op) { @@ -1067,15 +1067,15 @@ void i80286_cpu_device::execute_run() case 0x0f: { unsigned next = fetch_op(); - UINT16 desc[3], tmp, msw, sel; - UINT8 r; - UINT32 addr; + uint16_t desc[3], tmp, msw, sel; + uint8_t r; + uint32_t addr; switch (next) { case 0: if(!PM) - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); m_modrm = fetch(); switch (m_modrm & 0x38) { @@ -1168,15 +1168,15 @@ void i80286_cpu_device::execute_run() break; default: - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; case 1: { - UINT32 ea; + uint32_t ea; m_modrm = fetch(); if((m_modrm >= 0xc0) && (m_modrm < 0xe0)) - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); switch (m_modrm & 0x38) { case 0: /* sgdt */ @@ -1215,13 +1215,13 @@ void i80286_cpu_device::execute_run() m_msw = (m_msw & 1) | msw; break; default: - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; } case 2: /* LAR */ if(!PM) - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); m_modrm = fetch_op(); tmp = GetRMWord(); if((addr = selector_address(tmp)) == -1) @@ -1244,7 +1244,7 @@ void i80286_cpu_device::execute_run() break; case 3: /* LSL */ if(!PM) - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); m_modrm = fetch_op(); tmp = GetRMWord(); if((addr = selector_address(tmp)) == -1) @@ -1309,7 +1309,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } m_msw &= ~8; break; default: - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; } @@ -1333,7 +1333,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x60: // i_pusha { check_permission(SS, m_regs.w[SP]-16, 16, I8086_WRITE); - UINT32 tmp = m_regs.w[SP]; + uint32_t tmp = m_regs.w[SP]; PUSH(m_regs.w[AX]); PUSH(m_regs.w[CX]); PUSH(m_regs.w[DX]); @@ -1361,7 +1361,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x62: // i_bound { - UINT32 low,high,tmp; + uint32_t low,high,tmp; m_modrm = fetch(); low = GetRMWord(); high = GetnextRMWord(); @@ -1375,8 +1375,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x63: // arpl { - UINT16 tmp, source; - if (!PM) throw TRAP(FAULT_UD,(UINT16)-1); + uint16_t tmp, source; + if (!PM) throw TRAP(FAULT_UD,(uint16_t)-1); m_modrm=fetch_op(); tmp=GetRMWord(); @@ -1399,28 +1399,28 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x69: // i_imul_d16 { - UINT32 tmp; + uint32_t tmp; DEF_r16w(); tmp = fetch_word(); - m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)tmp); - m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1); + m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)tmp); + m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1); RegWord(m_dst); CLKM(IMUL_RRI16, IMUL_RMI16); } break; case 0x6a: // i_push_d8 - PUSH( (UINT16)((INT16)((INT8)fetch())) ); + PUSH( (uint16_t)((int16_t)((int8_t)fetch())) ); CLK(PUSH_IMM); break; case 0x6b: // i_imul_d8 { - UINT32 src2; + uint32_t src2; DEF_r16w(); - src2= (UINT16)((INT16)((INT8)fetch())); - m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)src2); - m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1); + src2= (uint16_t)((int16_t)((int8_t)fetch())); + m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)src2); + m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1); RegWord(m_dst); CLKM(IMUL_RRI8, IMUL_RMI8); } @@ -1447,7 +1447,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } if((m_modrm & 0x38) > 0x18) { logerror("%s: %06x: Mov Sreg - Invalid register\n", tag(), pc()); - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } PutRMWord(m_sregs[(m_modrm & 0x38) >> 3]); CLKM(MOV_RS,MOV_MS); @@ -1471,14 +1471,14 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } break; default: logerror("%s: %06x: Mov Sreg - Invalid register\n", tag(), pc()); - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; case 0x8f: // i_popw { m_modrm = fetch(); - UINT16 tmp = read_word(calc_addr(SS, m_regs.w[SP], 2, I8086_READ, false)); + uint16_t tmp = read_word(calc_addr(SS, m_regs.w[SP], 2, I8086_READ, false)); PutRMWord( tmp ); m_regs.w[SP] += 2; CLKM(POP_R16,POP_M16); @@ -1487,10 +1487,10 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x9a: // i_call_far { - UINT16 cs = m_sregs[CS]; - UINT16 tmp = fetch_word(); - UINT16 tmp2 = fetch_word(); - UINT16 ip = m_ip; + uint16_t cs = m_sregs[CS]; + uint16_t tmp = fetch_word(); + uint16_t tmp2 = fetch_word(); + uint16_t ip = m_ip; code_descriptor(tmp2, tmp, NT_CALL); PUSH(cs); PUSH(ip); @@ -1500,13 +1500,13 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x9b: // i_wait if((m_msw & 0x0a) == 0x0a) - throw TRAP(FAULT_NM, (UINT16)-1); + throw TRAP(FAULT_NM, (uint16_t)-1); CLK(WAIT); break; case 0x9c: // pushf { - UINT16 flags = CompressFlags(); + uint16_t flags = CompressFlags(); if(!PM) flags &= ~0xf000; PUSH(flags); @@ -1516,7 +1516,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0x9d: // popf { - UINT16 flags; + uint16_t flags; flags = POP(); CLK(POPF); load_flags(flags, CPL); @@ -1525,7 +1525,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xc0: // i_rotshft_bd8 { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMByte(); m_dst = m_src; @@ -1551,7 +1551,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xc1: // i_rotshft_wd8 { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMWord(); m_dst = m_src; @@ -1579,8 +1579,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } { m_modrm = fetch(); if(m_modrm >= 0xc0) - throw TRAP(FAULT_UD, (UINT16)-1); - UINT16 tmp = GetRMWord(); + throw TRAP(FAULT_UD, (uint16_t)-1); + uint16_t tmp = GetRMWord(); data_descriptor(ES, GetnextRMWord()); RegWord(tmp); CLK(LOAD_PTR); @@ -1591,8 +1591,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } { m_modrm = fetch(); if(m_modrm >= 0xc0) - throw TRAP(FAULT_UD, (UINT16)-1); - UINT16 tmp = GetRMWord(); + throw TRAP(FAULT_UD, (uint16_t)-1); + uint16_t tmp = GetRMWord(); data_descriptor(DS, GetnextRMWord()); RegWord(tmp); CLK(LOAD_PTR); @@ -1601,8 +1601,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xc8: // i_enter { - UINT16 nb = fetch(); - UINT32 level; + uint16_t nb = fetch(); + uint32_t level; nb |= fetch() << 8; level = fetch(); @@ -1644,7 +1644,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xcf: // iret { int oldcpl = (PM) ? CPL : 0; - UINT16 flags = far_return(1, 0); + uint16_t flags = far_return(1, 0); CLK(IRET); load_flags(flags, oldcpl); break; @@ -1652,7 +1652,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xd2: // i_rotshft_bcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMByte(); @@ -1679,7 +1679,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xd3: // i_rotshft_wcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMWord(); @@ -1713,7 +1713,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xde: case 0xdf: if((m_msw & 8) || (m_msw & 4)) - throw TRAP(FAULT_NM, (UINT16)-1); + throw TRAP(FAULT_NM, (uint16_t)-1); m_modrm = fetch(); GetRMByte(); CLK(NOP); @@ -1723,8 +1723,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xea: // i_jmp_far { - UINT16 tmp = fetch_word(); - UINT16 tmp1 = fetch_word(); + uint16_t tmp = fetch_word(); + uint16_t tmp1 = fetch_word(); code_descriptor(tmp1, tmp, NT_JMP); CLK(JMP_FAR); break; @@ -1761,7 +1761,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xff: // i_ffpre { - UINT32 tmp, tmp1; + uint32_t tmp, tmp1; m_modrm = fetch(); tmp = GetRMWord(); switch ( m_modrm & 0x38 ) @@ -1789,7 +1789,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } break; case 0x18: /* CALL FAR */ { - UINT16 ip = m_ip; + uint16_t ip = m_ip; tmp1 = m_sregs[CS]; code_descriptor(GetnextRMWord(), tmp, NT_CALL); PUSH(tmp1); @@ -1811,7 +1811,7 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } break; default: logerror("%s: %06x: FF Pre with unimplemented mod\n", tag(), pc()); - throw TRAP(FAULT_UD,(UINT16)-1); + throw TRAP(FAULT_UD,(uint16_t)-1); } } break; @@ -1820,8 +1820,8 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } case 0xf3: { bool pass = false; - UINT8 next = repx_op(); - UINT16 c = m_regs.w[CX]; + uint8_t next = repx_op(); + uint16_t c = m_regs.w[CX]; switch (next) { @@ -1848,12 +1848,12 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } m_icount -= 10; // UD fault timing? logerror("%s: %06x: Invalid Opcode %02x\n", tag(), pc(), op); m_ip = m_prev_ip; - throw TRAP(FAULT_UD, (UINT16)-1); + throw TRAP(FAULT_UD, (uint16_t)-1); } break; } } - catch(UINT32 e) + catch(uint32_t e) { trap(e); } @@ -1861,13 +1861,13 @@ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } } -void i80286_cpu_device::load_flags(UINT16 flags, int cpl) +void i80286_cpu_device::load_flags(uint16_t flags, int cpl) { - UINT16 oldflags = CompressFlags(); + uint16_t oldflags = CompressFlags(); flags &= ~0x8000; if(PM && cpl) { - UINT16 mask = 0x3000; + uint16_t mask = 0x3000; if(cpl > m_IOPL) mask |= 0x200; flags &= ~mask; @@ -1881,9 +1881,9 @@ void i80286_cpu_device::load_flags(UINT16 flags, int cpl) m_fire_trap = 1; } -UINT16 i80286_cpu_device::far_return(int iret, int bytes) +uint16_t i80286_cpu_device::far_return(int iret, int bytes) { - UINT16 sel, off, flags = 0; + uint16_t sel, off, flags = 0; int spaddr; if(PM && m_NT && iret) @@ -1904,7 +1904,7 @@ UINT16 i80286_cpu_device::far_return(int iret, int bytes) if(PM) { - UINT16 desc[3], newsp, newss; + uint16_t desc[3], newsp, newss; int addr, r; if((addr = selector_address(sel)) == -1) @@ -1970,10 +1970,10 @@ UINT16 i80286_cpu_device::far_return(int iret, int bytes) return flags; } -void i80286_cpu_device::check_permission(UINT8 check_seg, UINT32 offset, UINT16 size, int operation) +void i80286_cpu_device::check_permission(uint8_t check_seg, uint32_t offset, uint16_t size, int operation) { int trap; - UINT8 rights; + uint8_t rights; if(PM) { rights = m_rights[check_seg]; diff --git a/src/devices/cpu/i86/i286.h b/src/devices/cpu/i86/i286.h index 8df1bf43d94..ea47badb7fc 100644 --- a/src/devices/cpu/i86/i286.h +++ b/src/devices/cpu/i86/i286.h @@ -64,12 +64,12 @@ class i80286_cpu_device : public i8086_common_cpu_device { public: // construction/destruction - i80286_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i80286_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : nullptr ); } - typedef delegate a20_cb; + typedef delegate a20_cb; static void static_set_a20_callback(device_t &device, a20_cb object) { downcast(device).m_a20_callback = object; } template static devcb_base &static_set_shutdown_callback(device_t &device, _Object object) { return downcast(device).m_out_shutdown_func.set_callback(object); } @@ -78,60 +78,60 @@ protected: virtual void device_reset() override; virtual void device_start() override; virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_set_input(int inputnum, int state) override; bool memory_translate(address_spacenum spacenum, int intention, offs_t &address) override; - virtual void interrupt(int int_num, int trap = 1) override { if(trap) throw TRAP(int_num, (UINT16)-1); else interrupt_descriptor(int_num, 0, 0); } - virtual UINT8 read_port_byte(UINT16 port) override; - virtual UINT16 read_port_word(UINT16 port) override; - virtual void write_port_byte(UINT16 port, UINT8 data) override; - virtual void write_port_word(UINT16 port, UINT16 data) override; + virtual void interrupt(int int_num, int trap = 1) override { if(trap) throw TRAP(int_num, (uint16_t)-1); else interrupt_descriptor(int_num, 0, 0); } + virtual uint8_t read_port_byte(uint16_t port) override; + virtual uint16_t read_port_word(uint16_t port) override; + virtual void write_port_byte(uint16_t port, uint8_t data) override; + virtual void write_port_word(uint16_t port, uint16_t data) override; // Executing instructions - virtual UINT8 fetch_op() override; - virtual UINT8 fetch() override; - virtual UINT32 calc_addr(int seg, UINT16 offset, int size, int op, bool override = true) override; + virtual uint8_t fetch_op() override; + virtual uint8_t fetch() override; + virtual uint32_t calc_addr(int seg, uint16_t offset, int size, int op, bool override = true) override; private: - void check_permission(UINT8 check_seg, UINT32 offset, UINT16 size, int operation); - void code_descriptor(UINT16 selector, UINT16 offset, int gate); - void data_descriptor(int reg, UINT16 selector); - void data_descriptor(int reg, UINT16 selector, int cpl, UINT32 trap, UINT16 offset = 0, int size = 0); - UINT16 far_return(int iret, int bytes); + void check_permission(uint8_t check_seg, uint32_t offset, uint16_t size, int operation); + void code_descriptor(uint16_t selector, uint16_t offset, int gate); + void data_descriptor(int reg, uint16_t selector); + void data_descriptor(int reg, uint16_t selector, int cpl, uint32_t trap, uint16_t offset = 0, int size = 0); + uint16_t far_return(int iret, int bytes); void interrupt_descriptor(int number, int hwint, int error); - void load_flags(UINT16 flags, int cpl); + void load_flags(uint16_t flags, int cpl); void pop_seg(int reg); - UINT32 selector_address(UINT16 sel); - void switch_task(UINT16 ntask, int type); - void trap(UINT32 error); - int verify(UINT16 selector, int operation, UINT8 rights, bool valid); - UINT32 pc() { return m_pc = m_base[CS] + m_ip; } + uint32_t selector_address(uint16_t sel); + void switch_task(uint16_t ntask, int type); + void trap(uint32_t error); + int verify(uint16_t selector, int operation, uint8_t rights, bool valid); + uint32_t pc() { return m_pc = m_base[CS] + m_ip; } int m_trap_level; - UINT16 m_msw; - UINT32 m_base[4]; - UINT16 m_limit[4]; - UINT8 m_rights[4]; + uint16_t m_msw; + uint32_t m_base[4]; + uint16_t m_limit[4]; + uint8_t m_rights[4]; bool m_valid[4]; - UINT32 m_amask; + uint32_t m_amask; struct { - UINT32 base; - UINT16 limit; + uint32_t base; + uint16_t limit; } m_gdtr, m_idtr; struct { - UINT16 sel; - UINT32 base; - UINT16 limit; - UINT8 rights; + uint16_t sel; + uint32_t base; + uint16_t limit; + uint8_t rights; } m_ldtr, m_tr; - UINT32 TRAP(UINT16 fault, UINT16 code) { return ((((UINT32)fault&0xffff)<<16)|(code&0xffff)); } + uint32_t TRAP(uint16_t fault, uint16_t code) { return ((((uint32_t)fault&0xffff)<<16)|(code&0xffff)); } address_space_config m_program_config; address_space_config m_io_config; - static const UINT8 m_i80286_timing[200]; + static const uint8_t m_i80286_timing[200]; enum { FAULT_DE = 0, diff --git a/src/devices/cpu/i86/i86.cpp b/src/devices/cpu/i86/i86.cpp index ae68d66b66e..77566cbd9aa 100644 --- a/src/devices/cpu/i86/i86.cpp +++ b/src/devices/cpu/i86/i86.cpp @@ -18,7 +18,7 @@ #define I8086_NMI_INT_VECTOR 2 -const UINT8 i8086_cpu_device::m_i8086_timing[] = +const uint8_t i8086_cpu_device::m_i8086_timing[] = { 51,32, /* exception, IRET */ 2, 0, 4, 2, /* INTs */ @@ -90,14 +90,14 @@ const UINT8 i8086_cpu_device::m_i8086_timing[] = const device_type I8086 = &device_creator; const device_type I8088 = &device_creator; -i8088_cpu_device::i8088_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8088_cpu_device::i8088_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8086_cpu_device(mconfig, I8088, "I8088", tag, owner, clock, "i8088", __FILE__, 8) { memcpy(m_timing, m_i8086_timing, sizeof(m_i8086_timing)); m_fetch_xor = 0; } -i8086_cpu_device::i8086_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8086_cpu_device::i8086_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8086_common_cpu_device(mconfig, I8086, "I8086", tag, owner, clock, "i8086", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, 20, 0) , m_io_config("io", ENDIANNESS_LITTLE, 16, 16, 0) @@ -106,24 +106,24 @@ i8086_cpu_device::i8086_cpu_device(const machine_config &mconfig, const char *ta m_fetch_xor = BYTE_XOR_LE(0); } -i8086_cpu_device::i8086_cpu_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, int data_bus_size) +i8086_cpu_device::i8086_cpu_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, int data_bus_size) : i8086_common_cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, data_bus_size, 20, 0) , m_io_config("io", ENDIANNESS_LITTLE, data_bus_size, 16, 0) { } -UINT8 i8086_cpu_device::fetch_op() +uint8_t i8086_cpu_device::fetch_op() { - UINT8 data; + uint8_t data; data = m_direct->read_byte(pc(), m_fetch_xor); m_ip++; return data; } -UINT8 i8086_cpu_device::fetch() +uint8_t i8086_cpu_device::fetch() { - UINT8 data; + uint8_t data; data = m_direct->read_byte(pc(), m_fetch_xor); m_ip++; return data; @@ -189,7 +189,7 @@ void i8086_cpu_device::execute_run() debugger_instruction_hook( this, pc() ); } - UINT8 op = fetch_op(); + uint8_t op = fetch_op(); switch(op) { @@ -200,7 +200,7 @@ void i8086_cpu_device::execute_run() case 0xd2: // i_rotshft_bcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMByte(); @@ -227,7 +227,7 @@ void i8086_cpu_device::execute_run() case 0xd3: // i_rotshft_wcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMWord(); @@ -277,7 +277,7 @@ void i8086_cpu_device::device_start() state_add(STATE_GENPCBASE, "CURPC", m_pc).callexport().formatstr("%05X"); } -i8086_common_cpu_device::i8086_common_cpu_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) +i8086_common_cpu_device::i8086_common_cpu_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_ip(0) , m_TF(0) @@ -293,23 +293,23 @@ i8086_common_cpu_device::i8086_common_cpu_device(const machine_config &mconfig, static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH }; /* Set up parity lookup table. */ - for (UINT16 i = 0;i < 256; i++) + for (uint16_t i = 0;i < 256; i++) { - UINT16 c = 0; - for (UINT16 j = i; j > 0; j >>= 1) + uint16_t c = 0; + for (uint16_t j = i; j > 0; j >>= 1) { if (j & 1) c++; } m_parity_table[i] = !(c & 1); } - for (UINT16 i = 0; i < 256; i++) + for (uint16_t i = 0; i < 256; i++) { m_Mod_RM.reg.b[i] = reg_name[(i & 0x38) >> 3]; m_Mod_RM.reg.w[i] = (WREGS) ( (i & 0x38) >> 3) ; } - for (UINT16 i = 0xc0; i < 0x100; i++) + for (uint16_t i = 0xc0; i < 0x100; i++) { m_Mod_RM.RM.w[i] = (WREGS)( i & 7 ); m_Mod_RM.RM.b[i] = (BREGS)reg_name[i & 7]; @@ -330,7 +330,7 @@ void i8086_common_cpu_device::state_string_export(const device_state_entry &entr case STATE_GENFLAGS: { - UINT16 flags = CompressFlags(); + uint16_t flags = CompressFlags(); str = string_format("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", flags & 0x8000 ? '1':'.', flags & 0x4000 ? '1':'.', @@ -466,8 +466,8 @@ void i8086_common_cpu_device::interrupt(int int_num, int trap) m_pending_irq &= ~INT_IRQ; } - UINT16 dest_off = read_word( int_num * 4 + 0 ); - UINT16 dest_seg = read_word( int_num * 4 + 2 ); + uint16_t dest_off = read_word( int_num * 4 + 0 ); + uint16_t dest_seg = read_word( int_num * 4 + 2 ); PUSH(m_sregs[CS]); PUSH(m_ip); @@ -508,33 +508,33 @@ void i8086_common_cpu_device::execute_set_input( int inptnum, int state ) } } -offs_t i8086_common_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i8086_common_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { - extern int i386_dasm_one(char *buffer, offs_t eip, const UINT8 *oprom, int mode); + extern int i386_dasm_one(char *buffer, offs_t eip, const uint8_t *oprom, int mode); return i386_dasm_one(buffer, pc, oprom, 1); } -UINT8 i8086_common_cpu_device::read_port_byte(UINT16 port) +uint8_t i8086_common_cpu_device::read_port_byte(uint16_t port) { return m_io->read_byte(port); } -UINT16 i8086_common_cpu_device::read_port_word(UINT16 port) +uint16_t i8086_common_cpu_device::read_port_word(uint16_t port) { return m_io->read_word_unaligned(port); } -void i8086_common_cpu_device::write_port_byte(UINT16 port, UINT8 data) +void i8086_common_cpu_device::write_port_byte(uint16_t port, uint8_t data) { m_io->write_byte(port, data); } -void i8086_common_cpu_device::write_port_word(UINT16 port, UINT16 data) +void i8086_common_cpu_device::write_port_word(uint16_t port, uint16_t data) { m_io->write_word_unaligned(port, data); } -UINT32 i8086_common_cpu_device::calc_addr(int seg, UINT16 offset, int size, int op, bool override) +uint32_t i8086_common_cpu_device::calc_addr(int seg, uint16_t offset, int size, int op, bool override) { if ( m_seg_prefix && (seg==DS || seg==SS) && override ) { @@ -546,7 +546,7 @@ UINT32 i8086_common_cpu_device::calc_addr(int seg, UINT16 offset, int size, int } } -bool i8086_common_cpu_device::common_op(UINT8 op) +bool i8086_common_cpu_device::common_op(uint8_t op) { switch(op) { @@ -653,7 +653,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) { DEF_br8(); m_src += CF ? 1 : 0; - UINT32 tmpcf = ADDB(); + uint32_t tmpcf = ADDB(); PutbackRMByte(m_dst); set_CFB(tmpcf); CLKM(ALU_RR8,ALU_MR8); @@ -663,7 +663,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) { DEF_wr16(); m_src += CF ? 1 : 0; - UINT32 tmpcf = ADDX(); + uint32_t tmpcf = ADDX(); PutbackRMWord(m_dst); set_CFW(tmpcf); CLKM(ALU_RR16,ALU_MR16); @@ -715,7 +715,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x18: // i_sbb_br8 { - UINT32 tmpcf; + uint32_t tmpcf; DEF_br8(); m_src += CF ? 1 : 0; tmpcf = SUBB(); @@ -727,7 +727,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x19: // i_sbb_wr16 { - UINT32 tmpcf; + uint32_t tmpcf; DEF_wr16(); m_src += CF ? 1 : 0; tmpcf = SUBX(); @@ -1243,7 +1243,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x80: // i_80pre { - UINT32 tmpcf; + uint32_t tmpcf; m_modrm = fetch(); m_dst = GetRMByte(); m_src = fetch(); @@ -1267,7 +1267,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x81: // i_81pre { - UINT32 tmpcf; + uint32_t tmpcf; m_modrm = fetch(); m_dst = GetRMWord(); m_src = fetch_word(); @@ -1291,10 +1291,10 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x82: // i_82pre { - UINT32 tmpcf; + uint32_t tmpcf; m_modrm = fetch(); m_dst = GetRMByte(); - m_src = (INT8)fetch(); + m_src = (int8_t)fetch(); if (m_modrm >=0xc0 ) { CLK(ALU_RI8); } else if ((m_modrm & 0x38)==0x38) { CLK(ALU_MI8_RO); } else { CLK(ALU_MI8); } @@ -1315,10 +1315,10 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x83: // i_83pre { - UINT32 tmpcf; + uint32_t tmpcf; m_modrm = fetch(); m_dst = GetRMWord(); - m_src = (UINT16)((INT16)((INT8)fetch())); + m_src = (uint16_t)((int16_t)((int8_t)fetch())); if (m_modrm >=0xc0 ) { CLK(ALU_R16I8); } else if ((m_modrm & 0x38)==0x38) { CLK(ALU_M16I8_RO); } else { CLK(ALU_M16I8); } @@ -1471,8 +1471,8 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x9a: // i_call_far { - UINT16 tmp = fetch_word(); - UINT16 tmp2 = fetch_word(); + uint16_t tmp = fetch_word(); + uint16_t tmp2 = fetch_word(); PUSH(m_sregs[CS]); PUSH(m_ip); m_ip = tmp; @@ -1503,7 +1503,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x9e: // i_sahf { - UINT32 tmp = (CompressFlags() & 0xff00) | (m_regs.b[AH] & 0xd5); + uint32_t tmp = (CompressFlags() & 0xff00) | (m_regs.b[AH] & 0xd5); ExpandFlags(tmp); CLK(SAHF); } @@ -1517,7 +1517,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xa0: // i_mov_aldisp { - UINT32 addr = fetch_word(); + uint32_t addr = fetch_word(); m_regs.b[AL] = GetMemB(DS, addr); CLK(MOV_AM8); } @@ -1525,7 +1525,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xa1: // i_mov_axdisp { - UINT32 addr = fetch_word(); + uint32_t addr = fetch_word(); m_regs.w[AX] = GetMemW(DS, addr); CLK(MOV_AM16); } @@ -1533,7 +1533,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xa2: // i_mov_dispal { - UINT32 addr = fetch_word(); + uint32_t addr = fetch_word(); PutMemB(DS, addr, m_regs.b[AL]); CLK(MOV_MA8); } @@ -1541,7 +1541,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xa3: // i_mov_dispax { - UINT32 addr = fetch_word(); + uint32_t addr = fetch_word(); PutMemW(DS, addr, m_regs.w[AX]); CLK(MOV_MA16); } @@ -1693,7 +1693,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xc0: // 0xc0 is 0xc2 - see (*) case 0xc2: // i_ret_d16 { - UINT32 count = fetch_word(); + uint32_t count = fetch_word(); m_ip = POP(); m_regs.w[SP] += count; CLK(RET_NEAR_IMM); @@ -1735,7 +1735,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xc8: // 0xc8 = 0xca - see (*) case 0xca: // i_retf_d16 { - UINT32 count = fetch_word(); + uint32_t count = fetch_word(); m_ip = POP(); m_sregs[CS] = POP(); m_regs.w[SP] += count; @@ -1815,7 +1815,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xd4: // i_aam { - UINT8 base = fetch(); + uint8_t base = fetch(); if(!base) { interrupt(0); @@ -1830,7 +1830,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xd5: // i_aad { - UINT8 base = fetch(); + uint8_t base = fetch(); m_regs.b[AL] = m_regs.b[AH] * base + m_regs.b[AL]; m_regs.b[AH] = 0; set_SZPF_Byte(m_regs.b[AL]); @@ -1865,7 +1865,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xe0: // i_loopne { - INT8 disp = (INT8)fetch(); + int8_t disp = (int8_t)fetch(); m_regs.w[CX]--; if (!ZF && m_regs.w[CX]) @@ -1880,7 +1880,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xe1: // i_loope { - INT8 disp = (INT8)fetch(); + int8_t disp = (int8_t)fetch(); m_regs.w[CX]--; if (ZF && m_regs.w[CX]) @@ -1895,7 +1895,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xe2: // i_loop { - INT8 disp = (INT8)fetch(); + int8_t disp = (int8_t)fetch(); m_regs.w[CX]--; if (m_regs.w[CX]) @@ -1910,7 +1910,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xe3: // i_jcxz { - INT8 disp = (INT8)fetch(); + int8_t disp = (int8_t)fetch(); if (m_regs.w[CX] == 0) { @@ -1931,7 +1931,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xe5: // i_inax { - UINT8 port = fetch(); + uint8_t port = fetch(); m_regs.w[AX] = read_port_word(port); CLK(IN_IMM16); @@ -1945,7 +1945,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xe7: // i_outax { - UINT8 port = fetch(); + uint8_t port = fetch(); write_port_word(port, m_regs.w[AX]); CLK(OUT_IMM16); @@ -1955,7 +1955,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xe8: // i_call_d16 { - INT16 tmp = (INT16)fetch_word(); + int16_t tmp = (int16_t)fetch_word(); PUSH(m_ip); m_ip = m_ip + tmp; @@ -1965,7 +1965,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xe9: // i_jmp_d16 { - INT16 offset = (INT16)fetch_word(); + int16_t offset = (int16_t)fetch_word(); m_ip += offset; CLK(JMP_NEAR); } @@ -1973,8 +1973,8 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xea: // i_jmp_far { - UINT16 tmp = fetch_word(); - UINT16 tmp1 = fetch_word(); + uint16_t tmp = fetch_word(); + uint16_t tmp1 = fetch_word(); m_sregs[CS] = tmp1; m_ip = tmp; @@ -1984,14 +1984,14 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xeb: // i_jmp_d8 { - int tmp = (int)((INT8)fetch()); + int tmp = (int)((int8_t)fetch()); CLK(JMP_SHORT); if (tmp==-2 && m_no_interrupt==0 && (m_pending_irq==0) && m_icount>0) { m_icount%=12; /* cycle skip */ } - m_ip = (UINT16)(m_ip+tmp); + m_ip = (uint16_t)(m_ip+tmp); } break; @@ -2002,7 +2002,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xed: // i_inaxdx { - UINT32 port = m_regs.w[DX]; + uint32_t port = m_regs.w[DX]; m_regs.w[AX] = read_port_word(port); CLK(IN_DX16); @@ -2016,7 +2016,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xef: // i_outdxax { - UINT32 port = m_regs.w[DX]; + uint32_t port = m_regs.w[DX]; write_port_word(port, m_regs.w[AX]); CLK(OUT_DX16); @@ -2035,8 +2035,8 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xf2: // i_repne { bool invalid = false; - UINT8 next = repx_op(); - UINT16 c = m_regs.w[CX]; + uint8_t next = repx_op(); + uint16_t c = m_regs.w[CX]; switch (next) { @@ -2068,8 +2068,8 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xf3: // i_repe { bool invalid = false; - UINT8 next = repx_op(); - UINT16 c = m_regs.w[CX]; + uint8_t next = repx_op(); + uint16_t c = m_regs.w[CX]; switch (next) { @@ -2111,9 +2111,9 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xf6: // i_f6pre { - UINT32 tmp; - UINT32 uresult,uresult2; - INT32 result,result2; + uint32_t tmp; + uint32_t uresult,uresult2; + int32_t result,result2; m_modrm = fetch(); tmp = GetRMByte(); @@ -2139,14 +2139,14 @@ bool i8086_common_cpu_device::common_op(UINT8 op) break; case 0x20: /* MUL */ uresult = m_regs.b[AL] * tmp; - m_regs.w[AX] = (UINT16)uresult; + m_regs.w[AX] = (uint16_t)uresult; m_CarryVal = m_OverVal = (m_regs.b[AH]!=0) ? 1 : 0; set_ZF(m_regs.w[AX]); CLKM(MUL_R8,MUL_M8); break; case 0x28: /* IMUL */ - result = (INT16)((INT8)m_regs.b[AL])*(INT16)((INT8)tmp); - m_regs.w[AX] = (UINT16)result; + result = (int16_t)((int8_t)m_regs.b[AL])*(int16_t)((int8_t)tmp); + m_regs.w[AX] = (uint16_t)result; m_CarryVal = m_OverVal = (m_regs.b[AH]!=0) ? 1 : 0; set_ZF(m_regs.w[AX]); CLKM(IMUL_R8,IMUL_M8); @@ -2175,9 +2175,9 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x38: /* IDIV */ if (tmp) { - result = (INT16)m_regs.w[AX]; - result2 = result % (INT16)((INT8)tmp); - if ((result /= (INT16)((INT8)tmp)) > 0xff) + result = (int16_t)m_regs.w[AX]; + result2 = result % (int16_t)((int8_t)tmp); + if ((result /= (int16_t)((int8_t)tmp)) > 0xff) { interrupt(0); } @@ -2200,9 +2200,9 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xf7: // i_f7pre { - UINT32 tmp,tmp2; - UINT32 uresult,uresult2; - INT32 result,result2; + uint32_t tmp,tmp2; + uint32_t uresult,uresult2; + int32_t result,result2; m_modrm = fetch(); tmp = GetRMWord(); @@ -2230,13 +2230,13 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x20: /* MUL */ uresult = m_regs.w[AX]*tmp; m_regs.w[AX] = uresult & 0xffff; - m_regs.w[DX] = ((UINT32)uresult)>>16; + m_regs.w[DX] = ((uint32_t)uresult)>>16; m_CarryVal = m_OverVal = (m_regs.w[DX] != 0) ? 1 : 0; set_ZF(m_regs.w[AX] | m_regs.w[DX]); CLKM(MUL_R16,MUL_M16); break; case 0x28: /* IMUL */ - result = (INT32)((INT16)m_regs.w[AX]) * (INT32)((INT16)tmp); + result = (int32_t)((int16_t)m_regs.w[AX]) * (int32_t)((int16_t)tmp); m_regs.w[AX] = result & 0xffff; m_regs.w[DX] = result >> 16; m_CarryVal = m_OverVal = (m_regs.w[DX] != 0) ? 1 : 0; @@ -2246,7 +2246,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x30: /* DIV */ if (tmp) { - uresult = (((UINT32)m_regs.w[DX]) << 16) | m_regs.w[AX]; + uresult = (((uint32_t)m_regs.w[DX]) << 16) | m_regs.w[AX]; uresult2 = uresult % tmp; if ((uresult /= tmp) > 0xffff) { @@ -2267,9 +2267,9 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0x38: /* IDIV */ if (tmp) { - result = ((UINT32)m_regs.w[DX] << 16) + m_regs.w[AX]; - result2 = result % (INT32)((INT16)tmp); - if ((result /= (INT32)((INT16)tmp)) > 0xffff) + result = ((uint32_t)m_regs.w[DX] << 16) + m_regs.w[AX]; + result2 = result % (int32_t)((int16_t)tmp); + if ((result /= (int32_t)((int16_t)tmp)) > 0xffff) { interrupt(0); } @@ -2322,7 +2322,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xfe: // i_fepre { - UINT32 tmp, tmp1; + uint32_t tmp, tmp1; m_modrm = fetch(); tmp = GetRMByte(); switch ( m_modrm & 0x38 ) @@ -2352,7 +2352,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op) case 0xff: // i_ffpre { - UINT32 tmp, tmp1; + uint32_t tmp, tmp1; m_modrm = fetch(); tmp = GetRMWord(); switch ( m_modrm & 0x38 ) diff --git a/src/devices/cpu/i86/i86.h b/src/devices/cpu/i86/i86.h index f268c3c1671..6004158d8c1 100644 --- a/src/devices/cpu/i86/i86.h +++ b/src/devices/cpu/i86/i86.h @@ -31,7 +31,7 @@ class i8086_common_cpu_device : public cpu_device { public: // construction/destruction - i8086_common_cpu_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); + i8086_common_cpu_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_lock_handler(device_t &device, _Object object) { return downcast(device).m_lock_handler.set_callback(object); } @@ -117,60 +117,60 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 50; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 50; } virtual void execute_set_input(int inputnum, int state) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; virtual void interrupt(int int_num, int trap = 1); - virtual bool common_op(UINT8 op); + virtual bool common_op(uint8_t op); // Accessing memory and io - inline UINT8 read_byte(UINT32 addr); - inline UINT16 read_word(UINT32 addr); - inline void write_byte(UINT32 addr, UINT8 data); - inline void write_word(UINT32 addr, UINT16 data); - virtual UINT8 read_port_byte(UINT16 port); - virtual UINT16 read_port_word(UINT16 port); - virtual void write_port_byte(UINT16 port, UINT8 data); - virtual void write_port_word(UINT16 port, UINT16 data); + inline uint8_t read_byte(uint32_t addr); + inline uint16_t read_word(uint32_t addr); + inline void write_byte(uint32_t addr, uint8_t data); + inline void write_word(uint32_t addr, uint16_t data); + virtual uint8_t read_port_byte(uint16_t port); + virtual uint16_t read_port_word(uint16_t port); + virtual void write_port_byte(uint16_t port, uint8_t data); + virtual void write_port_word(uint16_t port, uint16_t data); // Executing instructions - virtual UINT8 fetch_op() = 0; - virtual UINT8 fetch() = 0; - inline UINT16 fetch_word(); - inline UINT8 repx_op(); + virtual uint8_t fetch_op() = 0; + virtual uint8_t fetch() = 0; + inline uint16_t fetch_word(); + inline uint8_t repx_op(); // Cycles passed while executing instructions - inline void CLK(UINT8 op); - inline void CLKM(UINT8 op_reg, UINT8 op_mem); + inline void CLK(uint8_t op); + inline void CLKM(uint8_t op_reg, uint8_t op_mem); // Memory handling while executing instructions - virtual UINT32 calc_addr(int seg, UINT16 offset, int size, int op, bool override = true); - inline UINT32 get_ea(int size, int op); - inline void PutbackRMByte(UINT8 data); - inline void PutbackRMWord(UINT16 data); - inline void RegByte(UINT8 data); - inline void RegWord(UINT16 data); - inline UINT8 RegByte(); - inline UINT16 RegWord(); - inline UINT16 GetRMWord(); - inline UINT16 GetnextRMWord(); - inline UINT8 GetRMByte(); - inline void PutMemB(int seg, UINT16 offset, UINT8 data); - inline void PutMemW(int seg, UINT16 offset, UINT16 data); - inline UINT8 GetMemB(int seg, UINT16 offset); - inline UINT16 GetMemW(int seg, UINT16 offset); + virtual uint32_t calc_addr(int seg, uint16_t offset, int size, int op, bool override = true); + inline uint32_t get_ea(int size, int op); + inline void PutbackRMByte(uint8_t data); + inline void PutbackRMWord(uint16_t data); + inline void RegByte(uint8_t data); + inline void RegWord(uint16_t data); + inline uint8_t RegByte(); + inline uint16_t RegWord(); + inline uint16_t GetRMWord(); + inline uint16_t GetnextRMWord(); + inline uint8_t GetRMByte(); + inline void PutMemB(int seg, uint16_t offset, uint8_t data); + inline void PutMemW(int seg, uint16_t offset, uint16_t data); + inline uint8_t GetMemB(int seg, uint16_t offset); + inline uint16_t GetMemW(int seg, uint16_t offset); inline void PutImmRMWord(); - inline void PutRMWord(UINT16 val); - inline void PutRMByte(UINT8 val); + inline void PutRMWord(uint16_t val); + inline void PutRMByte(uint8_t val); inline void PutImmRMByte(); inline void DEF_br8(); inline void DEF_wr16(); @@ -180,20 +180,20 @@ protected: inline void DEF_axd16(); // Flags - inline void set_CFB(UINT32 x); - inline void set_CFW(UINT32 x); - inline void set_AF(UINT32 x,UINT32 y,UINT32 z); - inline void set_SF(UINT32 x); - inline void set_ZF(UINT32 x); - inline void set_PF(UINT32 x); - inline void set_SZPF_Byte(UINT32 x); - inline void set_SZPF_Word(UINT32 x); - inline void set_OFW_Add(UINT32 x,UINT32 y,UINT32 z); - inline void set_OFB_Add(UINT32 x,UINT32 y,UINT32 z); - inline void set_OFW_Sub(UINT32 x,UINT32 y,UINT32 z); - inline void set_OFB_Sub(UINT32 x,UINT32 y,UINT32 z); - inline UINT16 CompressFlags() const; - inline void ExpandFlags(UINT16 f); + inline void set_CFB(uint32_t x); + inline void set_CFW(uint32_t x); + inline void set_AF(uint32_t x,uint32_t y,uint32_t z); + inline void set_SF(uint32_t x); + inline void set_ZF(uint32_t x); + inline void set_PF(uint32_t x); + inline void set_SZPF_Byte(uint32_t x); + inline void set_SZPF_Word(uint32_t x); + inline void set_OFW_Add(uint32_t x,uint32_t y,uint32_t z); + inline void set_OFB_Add(uint32_t x,uint32_t y,uint32_t z); + inline void set_OFW_Sub(uint32_t x,uint32_t y,uint32_t z); + inline void set_OFB_Sub(uint32_t x,uint32_t y,uint32_t z); + inline uint16_t CompressFlags() const; + inline void ExpandFlags(uint16_t f); // rep instructions inline void i_insb(); @@ -213,10 +213,10 @@ protected: inline void i_popf(); // sub implementations - inline UINT32 ADDB(); - inline UINT32 ADDX(); - inline UINT32 SUBB(); - inline UINT32 SUBX(); + inline uint32_t ADDB(); + inline uint32_t ADDX(); + inline uint32_t SUBB(); + inline uint32_t SUBX(); inline void ORB(); inline void ORW(); inline void ANDB(); @@ -231,27 +231,27 @@ protected: inline void ROLC_WORD(); inline void RORC_BYTE(); inline void RORC_WORD(); - inline void SHL_BYTE(UINT8 c); - inline void SHL_WORD(UINT8 c); - inline void SHR_BYTE(UINT8 c); - inline void SHR_WORD(UINT8 c); - inline void SHRA_BYTE(UINT8 c); - inline void SHRA_WORD(UINT8 c); - inline void XchgAXReg(UINT8 reg); - inline void IncWordReg(UINT8 reg); - inline void DecWordReg(UINT8 reg); - inline void PUSH(UINT16 data); - inline UINT16 POP(); + inline void SHL_BYTE(uint8_t c); + inline void SHL_WORD(uint8_t c); + inline void SHR_BYTE(uint8_t c); + inline void SHR_WORD(uint8_t c); + inline void SHRA_BYTE(uint8_t c); + inline void SHRA_WORD(uint8_t c); + inline void XchgAXReg(uint8_t reg); + inline void IncWordReg(uint8_t reg); + inline void DecWordReg(uint8_t reg); + inline void PUSH(uint16_t data); + inline uint16_t POP(); inline void JMP(bool cond); - inline void ADJ4(INT8 param1, INT8 param2); - inline void ADJB(INT8 param1, INT8 param2); + inline void ADJ4(int8_t param1, int8_t param2); + inline void ADJB(int8_t param1, int8_t param2); protected: union { /* eight general registers */ - UINT16 w[8]; /* viewed as 16 bits registers */ - UINT8 b[16]; /* or as 8 bit registers */ + uint16_t w[8]; /* viewed as 16 bits registers */ + uint8_t b[16]; /* or as 8 bit registers */ } m_regs; enum BREGS { @@ -280,22 +280,22 @@ protected: I8086_NONE }; - UINT16 m_sregs[4]; + uint16_t m_sregs[4]; - UINT16 m_ip; - UINT16 m_prev_ip; + uint16_t m_ip; + uint16_t m_prev_ip; - INT32 m_SignVal; - UINT32 m_AuxVal, m_OverVal, m_ZeroVal, m_CarryVal, m_ParityVal; /* 0 or non-0 valued flags */ - UINT8 m_TF, m_IF, m_DF; /* 0 or 1 valued flags */ - UINT8 m_IOPL, m_NT, m_MF; - UINT32 m_int_vector; - UINT32 m_pending_irq; - UINT32 m_nmi_state; - UINT32 m_irq_state; - UINT8 m_no_interrupt; - UINT8 m_fire_trap; - UINT8 m_test_state; + int32_t m_SignVal; + uint32_t m_AuxVal, m_OverVal, m_ZeroVal, m_CarryVal, m_ParityVal; /* 0 or non-0 valued flags */ + uint8_t m_TF, m_IF, m_DF; /* 0 or 1 valued flags */ + uint8_t m_IOPL, m_NT, m_MF; + uint32_t m_int_vector; + uint32_t m_pending_irq; + uint32_t m_nmi_state; + uint32_t m_irq_state; + uint8_t m_no_interrupt; + uint8_t m_fire_trap; + uint8_t m_test_state; address_space *m_program; direct_read_data *m_direct; @@ -303,22 +303,22 @@ protected: offs_t m_fetch_xor; int m_icount; - UINT32 m_prefix_seg; /* the latest prefix segment */ + uint32_t m_prefix_seg; /* the latest prefix segment */ bool m_seg_prefix; /* prefix segment indicator */ bool m_seg_prefix_next; /* prefix segment for next instruction */ - UINT32 m_ea; - UINT16 m_eo; - UINT16 m_e16; + uint32_t m_ea; + uint16_t m_eo; + uint16_t m_e16; // Used during execution of instructions - UINT8 m_modrm; - UINT32 m_dst; - UINT32 m_src; - UINT32 m_pc; + uint8_t m_modrm; + uint32_t m_dst; + uint32_t m_src; + uint32_t m_pc; // Lookup tables - UINT8 m_parity_table[256]; + uint8_t m_parity_table[256]; struct { struct { int w[256]; @@ -330,7 +330,7 @@ protected: } RM; } m_Mod_RM; - UINT8 m_timing[200]; + uint8_t m_timing[200]; bool m_halt; bool m_lock; @@ -341,8 +341,8 @@ class i8086_cpu_device : public i8086_common_cpu_device { public: // construction/destruction - i8086_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - i8086_cpu_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, int data_bus_size); + i8086_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + i8086_cpu_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, int data_bus_size); // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : nullptr ); } @@ -350,21 +350,21 @@ public: protected: virtual void execute_run() override; virtual void device_start() override; - virtual UINT32 execute_input_lines() const override { return 1; } - virtual UINT8 fetch_op() override; - virtual UINT8 fetch() override; - UINT32 pc() { return m_pc = (m_sregs[CS] << 4) + m_ip; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint8_t fetch_op() override; + virtual uint8_t fetch() override; + uint32_t pc() { return m_pc = (m_sregs[CS] << 4) + m_ip; } address_space_config m_program_config; address_space_config m_io_config; - static const UINT8 m_i8086_timing[200]; + static const uint8_t m_i8086_timing[200]; }; class i8088_cpu_device : public i8086_cpu_device { public: // construction/destruction - i8088_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8088_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/i86/i86inline.h b/src/devices/cpu/i86/i86inline.h index 8a9ad703fec..13dd366aa92 100644 --- a/src/devices/cpu/i86/i86inline.h +++ b/src/devices/cpu/i86/i86inline.h @@ -5,7 +5,7 @@ #define CF (m_CarryVal!=0) #define SF (m_SignVal<0) #define ZF (m_ZeroVal==0) -#define PF m_parity_table[(UINT8)m_ParityVal] +#define PF m_parity_table[(uint8_t)m_ParityVal] #define AF (m_AuxVal!=0) #define OF (m_OverVal!=0) @@ -15,37 +15,37 @@ #define INT_IRQ 0x01 #define NMI_IRQ 0x02 -UINT8 i8086_common_cpu_device::read_byte(UINT32 addr) +uint8_t i8086_common_cpu_device::read_byte(uint32_t addr) { return m_program->read_byte(addr); } -UINT16 i8086_common_cpu_device::read_word(UINT32 addr) +uint16_t i8086_common_cpu_device::read_word(uint32_t addr) { return m_program->read_word_unaligned(addr); } -void i8086_common_cpu_device::write_byte(UINT32 addr, UINT8 data) +void i8086_common_cpu_device::write_byte(uint32_t addr, uint8_t data) { m_program->write_byte(addr, data); } -void i8086_common_cpu_device::write_word(UINT32 addr, UINT16 data) +void i8086_common_cpu_device::write_word(uint32_t addr, uint16_t data) { m_program->write_word_unaligned(addr, data); } -inline UINT16 i8086_common_cpu_device::fetch_word() +inline uint16_t i8086_common_cpu_device::fetch_word() { - UINT16 data = fetch(); + uint16_t data = fetch(); data |= ( fetch() << 8 ); return data; } -inline UINT8 i8086_common_cpu_device::repx_op() +inline uint8_t i8086_common_cpu_device::repx_op() { - UINT8 next = fetch_op(); + uint8_t next = fetch_op(); bool seg_prefix = false; int seg = 0; @@ -82,19 +82,19 @@ inline UINT8 i8086_common_cpu_device::repx_op() } -inline void i8086_common_cpu_device::CLK(UINT8 op) +inline void i8086_common_cpu_device::CLK(uint8_t op) { m_icount -= m_timing[op]; } -inline void i8086_common_cpu_device::CLKM(UINT8 op_reg, UINT8 op_mem) +inline void i8086_common_cpu_device::CLKM(uint8_t op_reg, uint8_t op_mem) { m_icount -= ( m_modrm >= 0xc0 ) ? m_timing[op_reg] : m_timing[op_mem]; } -inline UINT32 i8086_common_cpu_device::get_ea(int size, int op) +inline uint32_t i8086_common_cpu_device::get_ea(int size, int op) { switch( m_modrm & 0xc7 ) { @@ -141,91 +141,91 @@ inline UINT32 i8086_common_cpu_device::get_ea(int size, int op) case 0x40: m_icount -= 11; - m_eo = m_regs.w[BX] + m_regs.w[SI] + (INT8)fetch(); + m_eo = m_regs.w[BX] + m_regs.w[SI] + (int8_t)fetch(); m_ea = calc_addr(DS, m_eo, size, op); break; case 0x41: m_icount -= 12; - m_eo = m_regs.w[BX] + m_regs.w[DI] + (INT8)fetch(); + m_eo = m_regs.w[BX] + m_regs.w[DI] + (int8_t)fetch(); m_ea = calc_addr(DS, m_eo, size, op); break; case 0x42: m_icount -= 12; - m_eo = m_regs.w[BP] + m_regs.w[SI] + (INT8)fetch(); + m_eo = m_regs.w[BP] + m_regs.w[SI] + (int8_t)fetch(); m_ea = calc_addr(SS, m_eo, size, op); break; case 0x43: m_icount -= 11; - m_eo = m_regs.w[BP] + m_regs.w[DI] + (INT8)fetch(); + m_eo = m_regs.w[BP] + m_regs.w[DI] + (int8_t)fetch(); m_ea = calc_addr(SS, m_eo, size, op); break; case 0x44: m_icount -= 9; - m_eo = m_regs.w[SI] + (INT8)fetch(); + m_eo = m_regs.w[SI] + (int8_t)fetch(); m_ea = calc_addr(DS, m_eo, size, op); break; case 0x45: m_icount -= 9; - m_eo = m_regs.w[DI] + (INT8)fetch(); + m_eo = m_regs.w[DI] + (int8_t)fetch(); m_ea = calc_addr(DS, m_eo, size, op); break; case 0x46: m_icount -= 9; - m_eo = m_regs.w[BP] + (INT8)fetch(); + m_eo = m_regs.w[BP] + (int8_t)fetch(); m_ea = calc_addr(SS, m_eo, size, op); break; case 0x47: m_icount -= 9; - m_eo = m_regs.w[BX] + (INT8)fetch(); + m_eo = m_regs.w[BX] + (int8_t)fetch(); m_ea = calc_addr(DS, m_eo, size, op); break; case 0x80: m_icount -= 11; m_e16 = fetch_word(); - m_eo = m_regs.w[BX] + m_regs.w[SI] + (INT16)m_e16; + m_eo = m_regs.w[BX] + m_regs.w[SI] + (int16_t)m_e16; m_ea = calc_addr(DS, m_eo, size, op); break; case 0x81: m_icount -= 12; m_e16 = fetch_word(); - m_eo = m_regs.w[BX] + m_regs.w[DI] + (INT16)m_e16; + m_eo = m_regs.w[BX] + m_regs.w[DI] + (int16_t)m_e16; m_ea = calc_addr(DS, m_eo, size, op); break; case 0x82: m_icount -= 11; m_e16 = fetch_word(); - m_eo = m_regs.w[BP] + m_regs.w[SI] + (INT16)m_e16; + m_eo = m_regs.w[BP] + m_regs.w[SI] + (int16_t)m_e16; m_ea = calc_addr(SS, m_eo, size, op); break; case 0x83: m_icount -= 11; m_e16 = fetch_word(); - m_eo = m_regs.w[BP] + m_regs.w[DI] + (INT16)m_e16; + m_eo = m_regs.w[BP] + m_regs.w[DI] + (int16_t)m_e16; m_ea = calc_addr(SS, m_eo, size, op); break; case 0x84: m_icount -= 9; m_e16 = fetch_word(); - m_eo = m_regs.w[SI] + (INT16)m_e16; + m_eo = m_regs.w[SI] + (int16_t)m_e16; m_ea = calc_addr(DS, m_eo, size, op); break; case 0x85: m_icount -= 9; m_e16 = fetch_word(); - m_eo = m_regs.w[DI] + (INT16)m_e16; + m_eo = m_regs.w[DI] + (int16_t)m_e16; m_ea = calc_addr(DS, m_eo, size, op); break; case 0x86: m_icount -= 9; m_e16 = fetch_word(); - m_eo = m_regs.w[BP] + (INT16)m_e16; + m_eo = m_regs.w[BP] + (int16_t)m_e16; m_ea = calc_addr(SS, m_eo, size, op); break; case 0x87: m_icount -= 9; m_e16 = fetch_word(); - m_eo = m_regs.w[BX] + (INT16)m_e16; + m_eo = m_regs.w[BX] + (int16_t)m_e16; m_ea = calc_addr(DS, m_eo, size, op); break; } @@ -234,7 +234,7 @@ inline UINT32 i8086_common_cpu_device::get_ea(int size, int op) } -inline void i8086_common_cpu_device::PutbackRMByte(UINT8 data) +inline void i8086_common_cpu_device::PutbackRMByte(uint8_t data) { if ( m_modrm >= 0xc0 ) { @@ -247,7 +247,7 @@ inline void i8086_common_cpu_device::PutbackRMByte(UINT8 data) } -inline void i8086_common_cpu_device::PutbackRMWord(UINT16 data) +inline void i8086_common_cpu_device::PutbackRMWord(uint16_t data) { if ( m_modrm >= 0xc0 ) { @@ -267,12 +267,12 @@ inline void i8086_common_cpu_device::PutImmRMWord() } else { - UINT32 addr = get_ea(2, I8086_WRITE); + uint32_t addr = get_ea(2, I8086_WRITE); write_word( addr, fetch_word() ); } } -inline void i8086_common_cpu_device::PutRMWord(UINT16 val) +inline void i8086_common_cpu_device::PutRMWord(uint16_t val) { if ( m_modrm >= 0xc0 ) { @@ -285,7 +285,7 @@ inline void i8086_common_cpu_device::PutRMWord(UINT16 val) } -inline void i8086_common_cpu_device::PutRMByte(UINT8 val) +inline void i8086_common_cpu_device::PutRMByte(uint8_t val) { if ( m_modrm >= 0xc0 ) { @@ -306,7 +306,7 @@ inline void i8086_common_cpu_device::PutImmRMByte() } else { - UINT32 addr = get_ea(1, I8086_WRITE); + uint32_t addr = get_ea(1, I8086_WRITE); write_byte( addr, fetch() ); } } @@ -359,31 +359,31 @@ inline void i8086_common_cpu_device::DEF_axd16() -inline void i8086_common_cpu_device::RegByte(UINT8 data) +inline void i8086_common_cpu_device::RegByte(uint8_t data) { m_regs.b[ m_Mod_RM.reg.b[ m_modrm ] ] = data; } -inline void i8086_common_cpu_device::RegWord(UINT16 data) +inline void i8086_common_cpu_device::RegWord(uint16_t data) { m_regs.w[ m_Mod_RM.reg.w[ m_modrm ] ] = data; } -inline UINT8 i8086_common_cpu_device::RegByte() +inline uint8_t i8086_common_cpu_device::RegByte() { return m_regs.b[ m_Mod_RM.reg.b[ m_modrm ] ]; } -inline UINT16 i8086_common_cpu_device::RegWord() +inline uint16_t i8086_common_cpu_device::RegWord() { return m_regs.w[ m_Mod_RM.reg.w[ m_modrm ] ]; } -inline UINT16 i8086_common_cpu_device::GetRMWord() +inline uint16_t i8086_common_cpu_device::GetRMWord() { if ( m_modrm >= 0xc0 ) { @@ -396,15 +396,15 @@ inline UINT16 i8086_common_cpu_device::GetRMWord() } -inline UINT16 i8086_common_cpu_device::GetnextRMWord() +inline uint16_t i8086_common_cpu_device::GetnextRMWord() { - UINT32 addr = ( m_ea & ~0xffff ) | ( ( m_ea + 2 ) & 0xffff ); + uint32_t addr = ( m_ea & ~0xffff ) | ( ( m_ea + 2 ) & 0xffff ); return read_word( addr ); } -inline UINT8 i8086_common_cpu_device::GetRMByte() +inline uint8_t i8086_common_cpu_device::GetRMByte() { if ( m_modrm >= 0xc0 ) { @@ -417,25 +417,25 @@ inline UINT8 i8086_common_cpu_device::GetRMByte() } -inline void i8086_common_cpu_device::PutMemB(int seg, UINT16 offset, UINT8 data) +inline void i8086_common_cpu_device::PutMemB(int seg, uint16_t offset, uint8_t data) { write_byte( calc_addr(seg, offset, 1, I8086_WRITE), data); } -inline void i8086_common_cpu_device::PutMemW(int seg, UINT16 offset, UINT16 data) +inline void i8086_common_cpu_device::PutMemW(int seg, uint16_t offset, uint16_t data) { write_word( calc_addr( seg, offset, 2, I8086_WRITE), data); } -inline UINT8 i8086_common_cpu_device::GetMemB(int seg, UINT16 offset) +inline uint8_t i8086_common_cpu_device::GetMemB(int seg, uint16_t offset) { return read_byte( calc_addr(seg, offset, 1, I8086_READ) ); } -inline UINT16 i8086_common_cpu_device::GetMemW(int seg, UINT16 offset) +inline uint16_t i8086_common_cpu_device::GetMemW(int seg, uint16_t offset) { return read_word( calc_addr(seg, offset, 2, I8086_READ) ); } @@ -443,68 +443,68 @@ inline UINT16 i8086_common_cpu_device::GetMemW(int seg, UINT16 offset) // Setting flags -inline void i8086_common_cpu_device::set_CFB(UINT32 x) +inline void i8086_common_cpu_device::set_CFB(uint32_t x) { m_CarryVal = x & 0x100; } -inline void i8086_common_cpu_device::set_CFW(UINT32 x) +inline void i8086_common_cpu_device::set_CFW(uint32_t x) { m_CarryVal = x & 0x10000; } -inline void i8086_common_cpu_device::set_AF(UINT32 x,UINT32 y,UINT32 z) +inline void i8086_common_cpu_device::set_AF(uint32_t x,uint32_t y,uint32_t z) { m_AuxVal = (x ^ (y ^ z)) & 0x10; } -inline void i8086_common_cpu_device::set_SF(UINT32 x) +inline void i8086_common_cpu_device::set_SF(uint32_t x) { m_SignVal = x; } -inline void i8086_common_cpu_device::set_ZF(UINT32 x) +inline void i8086_common_cpu_device::set_ZF(uint32_t x) { m_ZeroVal = x; } -inline void i8086_common_cpu_device::set_PF(UINT32 x) +inline void i8086_common_cpu_device::set_PF(uint32_t x) { m_ParityVal = x; } -inline void i8086_common_cpu_device::set_SZPF_Byte(UINT32 x) +inline void i8086_common_cpu_device::set_SZPF_Byte(uint32_t x) { - m_SignVal = m_ZeroVal = m_ParityVal = (INT8)x; + m_SignVal = m_ZeroVal = m_ParityVal = (int8_t)x; } -inline void i8086_common_cpu_device::set_SZPF_Word(UINT32 x) +inline void i8086_common_cpu_device::set_SZPF_Word(uint32_t x) { - m_SignVal = m_ZeroVal = m_ParityVal = (INT16)x; + m_SignVal = m_ZeroVal = m_ParityVal = (int16_t)x; } -inline void i8086_common_cpu_device::set_OFW_Add(UINT32 x,UINT32 y,UINT32 z) +inline void i8086_common_cpu_device::set_OFW_Add(uint32_t x,uint32_t y,uint32_t z) { m_OverVal = (x ^ y) & (x ^ z) & 0x8000; } -inline void i8086_common_cpu_device::set_OFB_Add(UINT32 x,UINT32 y,UINT32 z) +inline void i8086_common_cpu_device::set_OFB_Add(uint32_t x,uint32_t y,uint32_t z) { m_OverVal = (x ^ y) & (x ^ z) & 0x80; } -inline void i8086_common_cpu_device::set_OFW_Sub(UINT32 x,UINT32 y,UINT32 z) +inline void i8086_common_cpu_device::set_OFW_Sub(uint32_t x,uint32_t y,uint32_t z) { m_OverVal = (z ^ y) & (z ^ x) & 0x8000; } -inline void i8086_common_cpu_device::set_OFB_Sub(UINT32 x,UINT32 y,UINT32 z) +inline void i8086_common_cpu_device::set_OFB_Sub(uint32_t x,uint32_t y,uint32_t z) { m_OverVal = (z ^ y) & (z ^ x) & 0x80; } -inline UINT16 i8086_common_cpu_device::CompressFlags() const +inline uint16_t i8086_common_cpu_device::CompressFlags() const { return (CF ? 1 : 0) | (1 << 1) @@ -521,7 +521,7 @@ inline UINT16 i8086_common_cpu_device::CompressFlags() const | (m_MF << 15); } -inline void i8086_common_cpu_device::ExpandFlags(UINT16 f) +inline void i8086_common_cpu_device::ExpandFlags(uint16_t f) { m_CarryVal = (f) & 1; m_ParityVal = !((f) & 4); @@ -539,7 +539,7 @@ inline void i8086_common_cpu_device::ExpandFlags(UINT16 f) inline void i8086_common_cpu_device::i_insb() { - UINT32 ea = calc_addr(ES, m_regs.w[DI], 1, I8086_WRITE); + uint32_t ea = calc_addr(ES, m_regs.w[DI], 1, I8086_WRITE); write_byte(ea, read_port_byte(m_regs.w[DX])); m_regs.w[DI] += -2 * m_DF + 1; CLK(IN_IMM8); @@ -547,7 +547,7 @@ inline void i8086_common_cpu_device::i_insb() inline void i8086_common_cpu_device::i_insw() { - UINT32 ea = calc_addr(ES, m_regs.w[DI], 2, I8086_WRITE); + uint32_t ea = calc_addr(ES, m_regs.w[DI], 2, I8086_WRITE); write_word(ea, read_port_word(m_regs.w[DX])); m_regs.w[DI] += -4 * m_DF + 2; CLK(IN_IMM16); @@ -569,7 +569,7 @@ inline void i8086_common_cpu_device::i_outsw() inline void i8086_common_cpu_device::i_movsb() { - UINT8 tmp = GetMemB( DS, m_regs.w[SI] ); + uint8_t tmp = GetMemB( DS, m_regs.w[SI] ); PutMemB( ES, m_regs.w[DI], tmp); m_regs.w[DI] += -2 * m_DF + 1; m_regs.w[SI] += -2 * m_DF + 1; @@ -578,7 +578,7 @@ inline void i8086_common_cpu_device::i_movsb() inline void i8086_common_cpu_device::i_movsw() { - UINT16 tmp = GetMemW( DS, m_regs.w[SI] ); + uint16_t tmp = GetMemW( DS, m_regs.w[SI] ); PutMemW( ES, m_regs.w[DI], tmp ); m_regs.w[DI] += -4 * m_DF + 2; m_regs.w[SI] += -4 * m_DF + 2; @@ -654,7 +654,7 @@ inline void i8086_common_cpu_device::i_scasw() inline void i8086_common_cpu_device::i_popf() { - UINT32 tmp = POP(); + uint32_t tmp = POP(); ExpandFlags(tmp | 0xf000); CLK(POPF); @@ -665,9 +665,9 @@ inline void i8086_common_cpu_device::i_popf() } -inline UINT32 i8086_common_cpu_device::ADDB() +inline uint32_t i8086_common_cpu_device::ADDB() { - UINT32 res = m_dst + m_src; + uint32_t res = m_dst + m_src; set_OFB_Add(res,m_src,m_dst); set_AF(res,m_src,m_dst); @@ -677,9 +677,9 @@ inline UINT32 i8086_common_cpu_device::ADDB() } -inline UINT32 i8086_common_cpu_device::ADDX() +inline uint32_t i8086_common_cpu_device::ADDX() { - UINT32 res = m_dst + m_src; + uint32_t res = m_dst + m_src; set_OFW_Add(res,m_src,m_dst); set_AF(res,m_src,m_dst); @@ -689,9 +689,9 @@ inline UINT32 i8086_common_cpu_device::ADDX() } -inline UINT32 i8086_common_cpu_device::SUBB() +inline uint32_t i8086_common_cpu_device::SUBB() { - UINT32 res = m_dst - m_src; + uint32_t res = m_dst - m_src; set_OFB_Sub(res,m_src,m_dst); set_AF(res,m_src,m_dst); @@ -701,9 +701,9 @@ inline UINT32 i8086_common_cpu_device::SUBB() } -inline UINT32 i8086_common_cpu_device::SUBX() +inline uint32_t i8086_common_cpu_device::SUBX() { - UINT32 res = m_dst - m_src; + uint32_t res = m_dst - m_src; set_OFW_Sub(res,m_src,m_dst); set_AF(res,m_src,m_dst); @@ -811,7 +811,7 @@ inline void i8086_common_cpu_device::RORC_WORD() m_dst >>= 1; } -inline void i8086_common_cpu_device::SHL_BYTE(UINT8 c) +inline void i8086_common_cpu_device::SHL_BYTE(uint8_t c) { while (c--) m_dst <<= 1; @@ -821,7 +821,7 @@ inline void i8086_common_cpu_device::SHL_BYTE(UINT8 c) PutbackRMByte(m_dst); } -inline void i8086_common_cpu_device::SHL_WORD(UINT8 c) +inline void i8086_common_cpu_device::SHL_WORD(uint8_t c) { while (c--) m_dst <<= 1; @@ -831,7 +831,7 @@ inline void i8086_common_cpu_device::SHL_WORD(UINT8 c) PutbackRMWord(m_dst); } -inline void i8086_common_cpu_device::SHR_BYTE(UINT8 c) +inline void i8086_common_cpu_device::SHR_BYTE(uint8_t c) { while (c--) { @@ -843,7 +843,7 @@ inline void i8086_common_cpu_device::SHR_BYTE(UINT8 c) PutbackRMByte(m_dst); } -inline void i8086_common_cpu_device::SHR_WORD(UINT8 c) +inline void i8086_common_cpu_device::SHR_WORD(uint8_t c) { while (c--) { @@ -855,24 +855,24 @@ inline void i8086_common_cpu_device::SHR_WORD(UINT8 c) PutbackRMWord(m_dst); } -inline void i8086_common_cpu_device::SHRA_BYTE(UINT8 c) +inline void i8086_common_cpu_device::SHRA_BYTE(uint8_t c) { while (c--) { m_CarryVal = m_dst & 0x01; - m_dst = ((INT8) m_dst) >> 1; + m_dst = ((int8_t) m_dst) >> 1; } set_SZPF_Byte(m_dst); PutbackRMByte(m_dst); } -inline void i8086_common_cpu_device::SHRA_WORD(UINT8 c) +inline void i8086_common_cpu_device::SHRA_WORD(uint8_t c) { while (c--) { m_CarryVal = m_dst & 0x01; - m_dst = ((INT16) m_dst) >> 1; + m_dst = ((int16_t) m_dst) >> 1; } set_SZPF_Word(m_dst); @@ -880,19 +880,19 @@ inline void i8086_common_cpu_device::SHRA_WORD(UINT8 c) } -inline void i8086_common_cpu_device::XchgAXReg(UINT8 reg) +inline void i8086_common_cpu_device::XchgAXReg(uint8_t reg) { - UINT16 tmp = m_regs.w[reg]; + uint16_t tmp = m_regs.w[reg]; m_regs.w[reg] = m_regs.w[AX]; m_regs.w[AX] = tmp; } -inline void i8086_common_cpu_device::IncWordReg(UINT8 reg) +inline void i8086_common_cpu_device::IncWordReg(uint8_t reg) { - UINT32 tmp = m_regs.w[reg]; - UINT32 tmp1 = tmp+1; + uint32_t tmp = m_regs.w[reg]; + uint32_t tmp1 = tmp+1; m_OverVal = (tmp == 0x7fff); set_AF(tmp1,tmp,1); @@ -901,10 +901,10 @@ inline void i8086_common_cpu_device::IncWordReg(UINT8 reg) } -inline void i8086_common_cpu_device::DecWordReg(UINT8 reg) +inline void i8086_common_cpu_device::DecWordReg(uint8_t reg) { - UINT32 tmp = m_regs.w[reg]; - UINT32 tmp1 = tmp-1; + uint32_t tmp = m_regs.w[reg]; + uint32_t tmp1 = tmp-1; m_OverVal = (tmp == 0x8000); set_AF(tmp1,tmp,1); @@ -913,16 +913,16 @@ inline void i8086_common_cpu_device::DecWordReg(UINT8 reg) } -inline void i8086_common_cpu_device::PUSH(UINT16 data) +inline void i8086_common_cpu_device::PUSH(uint16_t data) { write_word(calc_addr(SS, m_regs.w[SP] - 2, 2, I8086_WRITE, false), data); m_regs.w[SP] -= 2; } -inline UINT16 i8086_common_cpu_device::POP() +inline uint16_t i8086_common_cpu_device::POP() { - UINT16 data = read_word(calc_addr(SS, m_regs.w[SP], 2, I8086_READ, false)); + uint16_t data = read_word(calc_addr(SS, m_regs.w[SP], 2, I8086_READ, false)); m_regs.w[SP] += 2; return data; @@ -931,7 +931,7 @@ inline UINT16 i8086_common_cpu_device::POP() inline void i8086_common_cpu_device::JMP(bool cond) { - int rel = (int)((INT8)fetch()); + int rel = (int)((int8_t)fetch()); if (cond) { @@ -943,11 +943,11 @@ inline void i8086_common_cpu_device::JMP(bool cond) } -inline void i8086_common_cpu_device::ADJ4(INT8 param1,INT8 param2) +inline void i8086_common_cpu_device::ADJ4(int8_t param1,int8_t param2) { if (AF || ((m_regs.b[AL] & 0xf) > 9)) { - UINT16 tmp; + uint16_t tmp; tmp = m_regs.b[AL] + param1; m_regs.b[AL] = tmp; m_AuxVal = 1; @@ -962,7 +962,7 @@ inline void i8086_common_cpu_device::ADJ4(INT8 param1,INT8 param2) } -inline void i8086_common_cpu_device::ADJB(INT8 param1, INT8 param2) +inline void i8086_common_cpu_device::ADJB(int8_t param1, int8_t param2) { if (AF || ((m_regs.b[AL] & 0xf) > 9)) { diff --git a/src/devices/cpu/i860/i860.cpp b/src/devices/cpu/i860/i860.cpp index 96ad4e967c9..fff1efec75a 100644 --- a/src/devices/cpu/i860/i860.cpp +++ b/src/devices/cpu/i860/i860.cpp @@ -34,7 +34,7 @@ enum { const device_type I860 = &device_creator; -i860_cpu_device::i860_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i860_cpu_device::i860_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, I860, "i860XR", tag, owner, clock, "i860xr", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 64, 32, 0), m_pc(0), m_merge(0), m_pin_bus_hold(0), m_pin_reset(0), m_exiting_readmem(0), m_exiting_ifetch(0), m_pc_updated(0), m_pending_trap(0), m_fir_gets_trap_addr(0), m_single_stepping(0), m_program(nullptr), m_icount(0) { @@ -225,7 +225,7 @@ void i860_cpu_device::device_reset() } -offs_t i860_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i860_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i860 ); return CPU_DISASSEMBLE_NAME(i860)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/i860/i860.h b/src/devices/cpu/i860/i860.h index 248cab2d4ba..0eec3c055a0 100644 --- a/src/devices/cpu/i860/i860.h +++ b/src/devices/cpu/i860/i860.h @@ -48,7 +48,7 @@ class i860_cpu_device : public cpu_device { public: // construction/destruction - i860_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i860_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); /* This is the external interface for asserting an external interrupt to the i860. */ @@ -67,9 +67,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 8; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 8; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -80,26 +80,26 @@ protected: void state_import(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; /* Integer registers (32 x 32-bits). */ - UINT32 m_iregs[32]; + uint32_t m_iregs[32]; /* Floating point registers (32 x 32-bits, 16 x 64 bits, or 8 x 128 bits). When referenced as pairs or quads, the higher numbered registers are the upper bits. E.g., double precision f0 is f1:f0. */ - UINT8 m_frg[32 * 4]; + uint8_t m_frg[32 * 4]; /* Control registers (6 x 32-bits). */ - UINT32 m_cregs[6]; + uint32_t m_cregs[6]; /* Program counter (1 x 32-bits). Reset starts at pc=0xffffff00. */ - UINT32 m_pc; + uint32_t m_pc; /* Special registers (4 x 64-bits). */ union @@ -107,7 +107,7 @@ private: float s; double d; } m_KR, m_KI, m_T; - UINT64 m_merge; + uint64_t m_merge; /* The adder pipeline, always 3 stages. */ struct @@ -202,91 +202,91 @@ private: address_space *m_program; int m_icount; // For debugger - UINT32 m_freg[32]; - - void writememi_emu (UINT32 addr, int size, UINT32 data); - void fp_readmem_emu (UINT32 addr, int size, UINT8 *dest); - void fp_writemem_emu (UINT32 addr, int size, UINT8 *data, UINT32 wmask); - void unrecog_opcode (UINT32 pc, UINT32 insn); - void insn_ld_ctrl (UINT32 insn); - void insn_st_ctrl (UINT32 insn); - void insn_ldx (UINT32 insn); - void insn_stx (UINT32 insn); - void insn_fsty (UINT32 insn); - void insn_fldy (UINT32 insn); - void insn_pstd (UINT32 insn); - void insn_ixfr (UINT32 insn); - void insn_addu (UINT32 insn); - void insn_addu_imm (UINT32 insn); - void insn_adds (UINT32 insn); - void insn_adds_imm (UINT32 insn); - void insn_subu (UINT32 insn); - void insn_subu_imm (UINT32 insn); - void insn_subs (UINT32 insn); - void insn_subs_imm (UINT32 insn); - void insn_shl (UINT32 insn); - void insn_shl_imm (UINT32 insn); - void insn_shr (UINT32 insn); - void insn_shr_imm (UINT32 insn); - void insn_shra (UINT32 insn); - void insn_shra_imm (UINT32 insn); - void insn_shrd (UINT32 insn); - void insn_and (UINT32 insn); - void insn_and_imm (UINT32 insn); - void insn_andh_imm (UINT32 insn); - void insn_andnot (UINT32 insn); - void insn_andnot_imm (UINT32 insn); - void insn_andnoth_imm (UINT32 insn); - void insn_or (UINT32 insn); - void insn_or_imm (UINT32 insn); - void insn_orh_imm (UINT32 insn); - void insn_xor (UINT32 insn); - void insn_xor_imm (UINT32 insn); - void insn_xorh_imm (UINT32 insn); - void insn_trap (UINT32 insn); - void insn_intovr (UINT32 insn); - void insn_bte (UINT32 insn); - void insn_bte_imm (UINT32 insn); - void insn_btne (UINT32 insn); - void insn_btne_imm (UINT32 insn); - void insn_bc (UINT32 insn); - void insn_bnc (UINT32 insn); - void insn_bct (UINT32 insn); - void insn_bnct (UINT32 insn); - void insn_call (UINT32 insn); - void insn_br (UINT32 insn); - void insn_bri (UINT32 insn); - void insn_calli (UINT32 insn); - void insn_bla (UINT32 insn); - void insn_flush (UINT32 insn); - void insn_fmul (UINT32 insn); - void insn_fmlow (UINT32 insn); - void insn_fadd_sub (UINT32 insn); - void insn_dualop (UINT32 insn); - void insn_frcp (UINT32 insn); - void insn_frsqr (UINT32 insn); - void insn_fxfr (UINT32 insn); - void insn_ftrunc (UINT32 insn); - void insn_famov (UINT32 insn); - void insn_fiadd_sub (UINT32 insn); - void insn_fcmp (UINT32 insn); - void insn_fzchk (UINT32 insn); - void insn_form (UINT32 insn); - void insn_faddp (UINT32 insn); - void insn_faddz (UINT32 insn); - void decode_exec (UINT32 insn, UINT32 non_shadow); + uint32_t m_freg[32]; + + void writememi_emu (uint32_t addr, int size, uint32_t data); + void fp_readmem_emu (uint32_t addr, int size, uint8_t *dest); + void fp_writemem_emu (uint32_t addr, int size, uint8_t *data, uint32_t wmask); + void unrecog_opcode (uint32_t pc, uint32_t insn); + void insn_ld_ctrl (uint32_t insn); + void insn_st_ctrl (uint32_t insn); + void insn_ldx (uint32_t insn); + void insn_stx (uint32_t insn); + void insn_fsty (uint32_t insn); + void insn_fldy (uint32_t insn); + void insn_pstd (uint32_t insn); + void insn_ixfr (uint32_t insn); + void insn_addu (uint32_t insn); + void insn_addu_imm (uint32_t insn); + void insn_adds (uint32_t insn); + void insn_adds_imm (uint32_t insn); + void insn_subu (uint32_t insn); + void insn_subu_imm (uint32_t insn); + void insn_subs (uint32_t insn); + void insn_subs_imm (uint32_t insn); + void insn_shl (uint32_t insn); + void insn_shl_imm (uint32_t insn); + void insn_shr (uint32_t insn); + void insn_shr_imm (uint32_t insn); + void insn_shra (uint32_t insn); + void insn_shra_imm (uint32_t insn); + void insn_shrd (uint32_t insn); + void insn_and (uint32_t insn); + void insn_and_imm (uint32_t insn); + void insn_andh_imm (uint32_t insn); + void insn_andnot (uint32_t insn); + void insn_andnot_imm (uint32_t insn); + void insn_andnoth_imm (uint32_t insn); + void insn_or (uint32_t insn); + void insn_or_imm (uint32_t insn); + void insn_orh_imm (uint32_t insn); + void insn_xor (uint32_t insn); + void insn_xor_imm (uint32_t insn); + void insn_xorh_imm (uint32_t insn); + void insn_trap (uint32_t insn); + void insn_intovr (uint32_t insn); + void insn_bte (uint32_t insn); + void insn_bte_imm (uint32_t insn); + void insn_btne (uint32_t insn); + void insn_btne_imm (uint32_t insn); + void insn_bc (uint32_t insn); + void insn_bnc (uint32_t insn); + void insn_bct (uint32_t insn); + void insn_bnct (uint32_t insn); + void insn_call (uint32_t insn); + void insn_br (uint32_t insn); + void insn_bri (uint32_t insn); + void insn_calli (uint32_t insn); + void insn_bla (uint32_t insn); + void insn_flush (uint32_t insn); + void insn_fmul (uint32_t insn); + void insn_fmlow (uint32_t insn); + void insn_fadd_sub (uint32_t insn); + void insn_dualop (uint32_t insn); + void insn_frcp (uint32_t insn); + void insn_frsqr (uint32_t insn); + void insn_fxfr (uint32_t insn); + void insn_ftrunc (uint32_t insn); + void insn_famov (uint32_t insn); + void insn_fiadd_sub (uint32_t insn); + void insn_fcmp (uint32_t insn); + void insn_fzchk (uint32_t insn); + void insn_form (uint32_t insn); + void insn_faddp (uint32_t insn); + void insn_faddz (uint32_t insn); + void decode_exec (uint32_t insn, uint32_t non_shadow); float get_fregval_s (int fr); double get_fregval_d (int fr); void set_fregval_s (int fr, float s); void set_fregval_d (int fr, double d); - int has_delay_slot(UINT32 insn); - UINT32 ifetch (UINT32 pc); - UINT32 get_address_translation (UINT32 vaddr, int is_dataref, int is_write); - UINT32 readmemi_emu (UINT32 addr, int size); - float get_fval_from_optype_s (UINT32 insn, int optype); - double get_fval_from_optype_d (UINT32 insn, int optype); - - typedef void (i860_cpu_device::*insn_func)(UINT32); + int has_delay_slot(uint32_t insn); + uint32_t ifetch (uint32_t pc); + uint32_t get_address_translation (uint32_t vaddr, int is_dataref, int is_write); + uint32_t readmemi_emu (uint32_t addr, int size); + float get_fval_from_optype_s (uint32_t insn, int optype); + double get_fval_from_optype_d (uint32_t insn, int optype); + + typedef void (i860_cpu_device::*insn_func)(uint32_t); struct decode_tbl_t { /* Execute function for this opcode. */ diff --git a/src/devices/cpu/i860/i860dasm.cpp b/src/devices/cpu/i860/i860dasm.cpp index 60c83a5fec0..03d24e2d2a8 100644 --- a/src/devices/cpu/i860/i860dasm.cpp +++ b/src/devices/cpu/i860/i860dasm.cpp @@ -3,43 +3,43 @@ #include "i860.h" /* Sub-group decoders */ -static void i860_dasm_core_dasm(const UINT32 op, char* buffer); -static void i860_dasm_floating_point_dasm(const UINT32 op, char* buffer); -static void i860_dasm_CTRL_dasm(const UINT32 op, char* buffer); +static void i860_dasm_core_dasm(const uint32_t op, char* buffer); +static void i860_dasm_floating_point_dasm(const uint32_t op, char* buffer); +static void i860_dasm_CTRL_dasm(const uint32_t op, char* buffer); /* REG-Format Opcodes*/ -static void i860_dasm_ldx(const UINT32 op, char* buffer); -static void i860_dasm_stx(const UINT32 op, char* buffer); -static void i860_dasm_ixfr(const UINT32 op, char* buffer); -static void i860_dasm_fid_fst(const UINT32 op, char* buffer); -static void i860_dasm_flush(const UINT32 op, char* buffer); -static void i860_dasm_pstd(const UINT32 op, char* buffer); -static void i860_dasm_ldc_sdc(const UINT32 op, char* buffer); -static void i860_dasm_bri(const UINT32 op, char* buffer); -static void i860_dasm_trap(const UINT32 op, char* buffer); -static void i860_dasm_bte_btne(const UINT32 op, char* buffer); -static void i860_dasm_pfidy(const UINT32 op, char* buffer); -static void i860_dasm_addu_subu(const UINT32 op, char* buffer); -static void i860_dasm_shl_shr(const UINT32 op, char* buffer); -static void i860_dasm_shrd(const UINT32 op, char* buffer); -static void i860_dasm_bla(const UINT32 op, char* buffer); -static void i860_dasm_shra(const UINT32 op, char* buffer); -static void i860_dasm_and_andh(const UINT32 op, char* buffer); -static void i860_dasm_andnot_andnoth(const UINT32 op, char* buffer); -static void i860_dasm_or_orh(const UINT32 op, char* buffer); -static void i860_dasm_xor_xorh(const UINT32 op, char* buffer); +static void i860_dasm_ldx(const uint32_t op, char* buffer); +static void i860_dasm_stx(const uint32_t op, char* buffer); +static void i860_dasm_ixfr(const uint32_t op, char* buffer); +static void i860_dasm_fid_fst(const uint32_t op, char* buffer); +static void i860_dasm_flush(const uint32_t op, char* buffer); +static void i860_dasm_pstd(const uint32_t op, char* buffer); +static void i860_dasm_ldc_sdc(const uint32_t op, char* buffer); +static void i860_dasm_bri(const uint32_t op, char* buffer); +static void i860_dasm_trap(const uint32_t op, char* buffer); +static void i860_dasm_bte_btne(const uint32_t op, char* buffer); +static void i860_dasm_pfidy(const uint32_t op, char* buffer); +static void i860_dasm_addu_subu(const uint32_t op, char* buffer); +static void i860_dasm_shl_shr(const uint32_t op, char* buffer); +static void i860_dasm_shrd(const uint32_t op, char* buffer); +static void i860_dasm_bla(const uint32_t op, char* buffer); +static void i860_dasm_shra(const uint32_t op, char* buffer); +static void i860_dasm_and_andh(const uint32_t op, char* buffer); +static void i860_dasm_andnot_andnoth(const uint32_t op, char* buffer); +static void i860_dasm_or_orh(const uint32_t op, char* buffer); +static void i860_dasm_xor_xorh(const uint32_t op, char* buffer); /* CORE Escape Opcodes */ -static void i860_dasm_CORE_lock(const UINT32 op, char* buffer); -static void i860_dasm_CORE_calli(const UINT32 op, char* buffer); -static void i860_dasm_CORE_intovr(const UINT32 op, char* buffer); -static void i860_dasm_CORE_unlock(const UINT32 op, char* buffer); +static void i860_dasm_CORE_lock(const uint32_t op, char* buffer); +static void i860_dasm_CORE_calli(const uint32_t op, char* buffer); +static void i860_dasm_CORE_intovr(const uint32_t op, char* buffer); +static void i860_dasm_CORE_unlock(const uint32_t op, char* buffer); /* CTRL-Format Opcodes */ -static void i860_dasm_CTRL_br(const UINT32 op, char* buffer); -static void i860_dasm_CTRL_call(const UINT32 op, char* buffer); -static void i860_dasm_CTRL_bc_bct(const UINT32 op, char* buffer); -static void i860_dasm_CTRL_bnc_bnct(const UINT32 op, char* buffer); +static void i860_dasm_CTRL_br(const uint32_t op, char* buffer); +static void i860_dasm_CTRL_call(const uint32_t op, char* buffer); +static void i860_dasm_CTRL_bc_bct(const uint32_t op, char* buffer); +static void i860_dasm_CTRL_bnc_bnct(const uint32_t op, char* buffer); /* Floating-Point Instructions */ @@ -49,13 +49,13 @@ CPU_DISASSEMBLE( i860 ) char tempB[1024] = ""; /* Little Endian */ - const UINT32 op = (oprom[3] << 24) | (oprom[2] << 16) | (oprom[1] << 8) | (oprom[0] << 0); - //const UINT32 op = (oprom[2] << 24) | (oprom[3] << 16) | (oprom[0] << 8) | (oprom[1] << 0); /* Mixed Endian */ - //const UINT32 op = (oprom[0] << 24) | (oprom[1] << 16) | (oprom[2] << 8) | (oprom[3] << 0); /* Big Endian */ - //const UINT32 op = (oprom[1] << 24) | (oprom[0] << 16) | (oprom[3] << 8) | (oprom[2] << 0); /* Mixed Endian */ + const uint32_t op = (oprom[3] << 24) | (oprom[2] << 16) | (oprom[1] << 8) | (oprom[0] << 0); + //const uint32_t op = (oprom[2] << 24) | (oprom[3] << 16) | (oprom[0] << 8) | (oprom[1] << 0); /* Mixed Endian */ + //const uint32_t op = (oprom[0] << 24) | (oprom[1] << 16) | (oprom[2] << 8) | (oprom[3] << 0); /* Big Endian */ + //const uint32_t op = (oprom[1] << 24) | (oprom[0] << 16) | (oprom[3] << 8) | (oprom[2] << 0); /* Mixed Endian */ /* The opcode is the top 6 bits */ - UINT8 opcode = (op >> 26) & 0x3f; + uint8_t opcode = (op >> 26) & 0x3f; /* DEBUG - print this out if you feel things are going a bit wonky */ // sprintf(buffer, "%08x : oo %02x", op, opcode); @@ -172,9 +172,9 @@ CPU_DISASSEMBLE( i860 ) /**********************/ /* Sub-group decoders */ /**********************/ -static void i860_dasm_core_dasm(const UINT32 op, char* buffer) +static void i860_dasm_core_dasm(const uint32_t op, char* buffer) { - //UINT8 src1 = (op >> 11) & 0x0000001f; + //uint8_t src1 = (op >> 11) & 0x0000001f; /* Reserved bits must be set to 0 */ if ( (op & 0x000007e0) || (op & 0x03ff0000) ) @@ -194,14 +194,14 @@ static void i860_dasm_core_dasm(const UINT32 op, char* buffer) } } -static void i860_dasm_floating_point_dasm(const UINT32 op, char* buffer) +static void i860_dasm_floating_point_dasm(const uint32_t op, char* buffer) { sprintf(buffer, "[[F-P unit]]"); } -static void i860_dasm_CTRL_dasm(const UINT32 op, char* buffer) +static void i860_dasm_CTRL_dasm(const uint32_t op, char* buffer) { - UINT8 opc = (op >> 26) & 0x07; + uint8_t opc = (op >> 26) & 0x07; switch(opc) { @@ -218,108 +218,108 @@ static void i860_dasm_CTRL_dasm(const UINT32 op, char* buffer) /*********************/ /* REG-Format Opcodes*/ /*********************/ -static void i860_dasm_ldx(const UINT32 op, char* buffer) +static void i860_dasm_ldx(const uint32_t op, char* buffer) { sprintf(buffer, "ldx"); } -static void i860_dasm_stx(const UINT32 op, char* buffer) +static void i860_dasm_stx(const uint32_t op, char* buffer) { sprintf(buffer, "stx"); } -static void i860_dasm_ixfr(const UINT32 op, char* buffer) +static void i860_dasm_ixfr(const uint32_t op, char* buffer) { -// UINT16 val = op & 0x7ff; -// UINT8 opc = (op >> 26) & 0x3f; -// UINT8 src2 = (op >> 21) & 0x1f; -// UINT8 dest = (op >> 16) & 0x1f; -// UINT8 src1 = (op >> 11) & 0x1f; +// uint16_t val = op & 0x7ff; +// uint8_t opc = (op >> 26) & 0x3f; +// uint8_t src2 = (op >> 21) & 0x1f; +// uint8_t dest = (op >> 16) & 0x1f; +// uint8_t src1 = (op >> 11) & 0x1f; sprintf(buffer, "ixfr"); } -static void i860_dasm_fid_fst(const UINT32 op, char* buffer) +static void i860_dasm_fid_fst(const uint32_t op, char* buffer) { sprintf(buffer, "fst"); } -static void i860_dasm_flush(const UINT32 op, char* buffer) +static void i860_dasm_flush(const uint32_t op, char* buffer) { sprintf(buffer, "flush"); } -static void i860_dasm_pstd(const UINT32 op, char* buffer) +static void i860_dasm_pstd(const uint32_t op, char* buffer) { sprintf(buffer, "pstd"); } -static void i860_dasm_ldc_sdc(const UINT32 op, char* buffer) +static void i860_dasm_ldc_sdc(const uint32_t op, char* buffer) { sprintf(buffer, "ldc, sdc"); } -static void i860_dasm_bri(const UINT32 op, char* buffer) +static void i860_dasm_bri(const uint32_t op, char* buffer) { sprintf(buffer, "bri"); } -static void i860_dasm_trap(const UINT32 op, char* buffer) +static void i860_dasm_trap(const uint32_t op, char* buffer) { sprintf(buffer, "trap"); } -static void i860_dasm_bte_btne(const UINT32 op, char* buffer) +static void i860_dasm_bte_btne(const uint32_t op, char* buffer) { sprintf(buffer, "bte, btne"); } -static void i860_dasm_pfidy(const UINT32 op, char* buffer) +static void i860_dasm_pfidy(const uint32_t op, char* buffer) { sprintf(buffer, "pfidy"); } -static void i860_dasm_addu_subu(const UINT32 op, char* buffer) +static void i860_dasm_addu_subu(const uint32_t op, char* buffer) { sprintf(buffer, "addu, subu"); } -static void i860_dasm_shl_shr(const UINT32 op, char* buffer) +static void i860_dasm_shl_shr(const uint32_t op, char* buffer) { sprintf(buffer, "shl, shr"); } -static void i860_dasm_shrd(const UINT32 op, char* buffer) +static void i860_dasm_shrd(const uint32_t op, char* buffer) { sprintf(buffer, "shrd"); } -static void i860_dasm_bla(const UINT32 op, char* buffer) +static void i860_dasm_bla(const uint32_t op, char* buffer) { sprintf(buffer, "bla"); } -static void i860_dasm_shra(const UINT32 op, char* buffer) +static void i860_dasm_shra(const uint32_t op, char* buffer) { sprintf(buffer, "shra"); } -static void i860_dasm_and_andh(const UINT32 op, char* buffer) +static void i860_dasm_and_andh(const uint32_t op, char* buffer) { sprintf(buffer, "and, andh"); } -static void i860_dasm_andnot_andnoth(const UINT32 op, char* buffer) +static void i860_dasm_andnot_andnoth(const uint32_t op, char* buffer) { sprintf(buffer, "andnot, andnoth"); } -static void i860_dasm_or_orh(const UINT32 op, char* buffer) +static void i860_dasm_or_orh(const uint32_t op, char* buffer) { sprintf(buffer, "or, orh"); } -static void i860_dasm_xor_xorh(const UINT32 op, char* buffer) +static void i860_dasm_xor_xorh(const uint32_t op, char* buffer) { sprintf(buffer, "xor, xorh"); } @@ -328,22 +328,22 @@ static void i860_dasm_xor_xorh(const UINT32 op, char* buffer) /***********************/ /* CORE Escape Opcodes */ /***********************/ -static void i860_dasm_CORE_lock(const UINT32 op, char* buffer) +static void i860_dasm_CORE_lock(const uint32_t op, char* buffer) { sprintf(buffer, "lock"); } -static void i860_dasm_CORE_calli(const UINT32 op, char* buffer) +static void i860_dasm_CORE_calli(const uint32_t op, char* buffer) { sprintf(buffer, "calli"); } -static void i860_dasm_CORE_intovr(const UINT32 op, char* buffer) +static void i860_dasm_CORE_intovr(const uint32_t op, char* buffer) { sprintf(buffer, "intovr"); } -static void i860_dasm_CORE_unlock(const UINT32 op, char* buffer) +static void i860_dasm_CORE_unlock(const uint32_t op, char* buffer) { sprintf(buffer, "unlock"); } @@ -352,22 +352,22 @@ static void i860_dasm_CORE_unlock(const UINT32 op, char* buffer) /***********************/ /* CTRL-Format Opcodes */ /***********************/ -static void i860_dasm_CTRL_br(const UINT32 op, char* buffer) +static void i860_dasm_CTRL_br(const uint32_t op, char* buffer) { sprintf(buffer, "br"); } -static void i860_dasm_CTRL_call(const UINT32 op, char* buffer) +static void i860_dasm_CTRL_call(const uint32_t op, char* buffer) { sprintf(buffer, "call"); } -static void i860_dasm_CTRL_bc_bct(const UINT32 op, char* buffer) +static void i860_dasm_CTRL_bc_bct(const uint32_t op, char* buffer) { sprintf(buffer, "bct"); } -static void i860_dasm_CTRL_bnc_bnct(const UINT32 op, char* buffer) +static void i860_dasm_CTRL_bnc_bnct(const uint32_t op, char* buffer) { sprintf(buffer, "bnct"); } diff --git a/src/devices/cpu/i860/i860dec.hxx b/src/devices/cpu/i860/i860dec.hxx index 4600af7a0b8..c33f2d0b7e8 100644 --- a/src/devices/cpu/i860/i860dec.hxx +++ b/src/devices/cpu/i860/i860dec.hxx @@ -60,13 +60,13 @@ enum { /* TODO: THESE WILL BE REPLACED BY MAME FUNCTIONS #define BYTE_REV32(t) \ do { \ - (t) = ((UINT32)(t) >> 16) | ((UINT32)(t) << 16); \ - (t) = (((UINT32)(t) >> 8) & 0x00ff00ff) | (((UINT32)(t) << 8) & 0xff00ff00); \ + (t) = ((uint32_t)(t) >> 16) | ((uint32_t)(t) << 16); \ + (t) = (((uint32_t)(t) >> 8) & 0x00ff00ff) | (((uint32_t)(t) << 8) & 0xff00ff00); \ } while (0); #define BYTE_REV16(t) \ do { \ - (t) = (((UINT16)(t) >> 8) & 0x00ff) | (((UINT16)(t) << 8) & 0xff00); \ + (t) = (((uint16_t)(t) >> 8) & 0x00ff) | (((uint16_t)(t) << 8) & 0xff00); \ } while (0); #endif */ @@ -79,12 +79,12 @@ enum { float i860_cpu_device::get_fregval_s (int fr) { float f; - UINT32 x; - UINT8 *tp; + uint32_t x; + uint8_t *tp; fr = 31 - fr; - tp = (UINT8 *)(&m_frg[fr * 4]); - x = ((UINT32)tp[0] << 24) | ((UINT32)tp[1] << 16) | - ((UINT32)tp[2] << 8) | ((UINT32)tp[3]); + tp = (uint8_t *)(&m_frg[fr * 4]); + x = ((uint32_t)tp[0] << 24) | ((uint32_t)tp[1] << 16) | + ((uint32_t)tp[2] << 8) | ((uint32_t)tp[3]); f = *(float *)(&x); return f; } @@ -92,27 +92,27 @@ float i860_cpu_device::get_fregval_s (int fr) double i860_cpu_device::get_fregval_d (int fr) { double d; - UINT64 x; - UINT8 *tp; + uint64_t x; + uint8_t *tp; fr = 31 - (fr + 1); - tp = (UINT8 *)(&m_frg[fr * 4]); - x = ((UINT64)tp[0] << 56) | ((UINT64)tp[1] << 48) | - ((UINT64)tp[2] << 40) | ((UINT64)tp[3] << 32) | - ((UINT64)tp[4] << 24) | ((UINT64)tp[5] << 16) | - ((UINT64)tp[6] << 8) | ((UINT64)tp[7]); + tp = (uint8_t *)(&m_frg[fr * 4]); + x = ((uint64_t)tp[0] << 56) | ((uint64_t)tp[1] << 48) | + ((uint64_t)tp[2] << 40) | ((uint64_t)tp[3] << 32) | + ((uint64_t)tp[4] << 24) | ((uint64_t)tp[5] << 16) | + ((uint64_t)tp[6] << 8) | ((uint64_t)tp[7]); d = *(double *)(&x); return d; } void i860_cpu_device::set_fregval_s (int fr, float s) { - UINT8 *f = (UINT8 *)&s; - UINT8 *tp; + uint8_t *f = (uint8_t *)&s; + uint8_t *tp; int newfr = 31 - fr; float jj = s; - tp = (UINT8 *)(&m_frg[newfr * 4]); + tp = (uint8_t *)(&m_frg[newfr * 4]); - f = (UINT8 *)(&jj); + f = (uint8_t *)(&jj); if (fr == 0 || fr == 1) { tp[0] = 0; tp[1] = 0; tp[2] = 0; tp[3] = 0; @@ -129,13 +129,13 @@ void i860_cpu_device::set_fregval_s (int fr, float s) void i860_cpu_device::set_fregval_d (int fr, double d) { - UINT8 *f = (UINT8 *)&d; - UINT8 *tp; + uint8_t *f = (uint8_t *)&d; + uint8_t *tp; int newfr = 31 - (fr + 1); double jj = d; - tp = (UINT8 *)(&m_frg[newfr * 4]); + tp = (uint8_t *)(&m_frg[newfr * 4]); - f = (UINT8 *)(&jj); + f = (uint8_t *)(&jj); if (fr == 0) { @@ -280,7 +280,7 @@ void i860_cpu_device::set_fregval_d (int fr, double d) #define SET_FSR_SE(val) (m_cregs[CR_FSR] = (m_cregs[CR_FSR] & ~(1 << 8)) | (((val) & 1) << 8)) -int i860_cpu_device::has_delay_slot(UINT32 insn) +int i860_cpu_device::has_delay_slot(uint32_t insn) { int opc = (insn >> 26) & 0x3f; if (opc == 0x10 || opc == 0x1a || opc == 0x1b || opc == 0x1d || @@ -329,10 +329,10 @@ void i860_cpu_device::i860_gen_interrupt() /* Fetch instructions from instruction cache. Note: The instruction cache is not implemented for MAME version, this just fetches and returns 1 instruction from memory. */ -UINT32 i860_cpu_device::ifetch (UINT32 pc) +uint32_t i860_cpu_device::ifetch (uint32_t pc) { - UINT32 phys_pc = 0; - UINT32 w1 = 0; + uint32_t phys_pc = 0; + uint32_t w1 = 0; /* If virtual mode, get translation. */ if (GET_DIRBASE_ATE ()) @@ -368,21 +368,21 @@ UINT32 i860_cpu_device::ifetch (UINT32 pc) Page tables must always be in memory (not cached). So the routine here only accesses memory. */ -UINT32 i860_cpu_device::get_address_translation (UINT32 vaddr, int is_dataref, int is_write) +uint32_t i860_cpu_device::get_address_translation (uint32_t vaddr, int is_dataref, int is_write) { - UINT32 vdir = (vaddr >> 22) & 0x3ff; - UINT32 vpage = (vaddr >> 12) & 0x3ff; - UINT32 voffset = vaddr & 0xfff; - UINT32 dtb = (m_cregs[CR_DIRBASE]) & 0xfffff000; - UINT32 pg_dir_entry_a = 0; - UINT32 pg_dir_entry = 0; - UINT32 pg_tbl_entry_a = 0; - UINT32 pg_tbl_entry = 0; - UINT32 pfa1 = 0; - UINT32 pfa2 = 0; - UINT32 ret = 0; - UINT32 ttpde = 0; - UINT32 ttpte = 0; + uint32_t vdir = (vaddr >> 22) & 0x3ff; + uint32_t vpage = (vaddr >> 12) & 0x3ff; + uint32_t voffset = vaddr & 0xfff; + uint32_t dtb = (m_cregs[CR_DIRBASE]) & 0xfffff000; + uint32_t pg_dir_entry_a = 0; + uint32_t pg_dir_entry = 0; + uint32_t pg_tbl_entry_a = 0; + uint32_t pg_tbl_entry = 0; + uint32_t pfa1 = 0; + uint32_t pfa2 = 0; + uint32_t ret = 0; + uint32_t ttpde = 0; + uint32_t ttpte = 0; assert (GET_DIRBASE_ATE ()); @@ -514,7 +514,7 @@ UINT32 i860_cpu_device::get_address_translation (UINT32 vaddr, int is_dataref, i /* Read memory emulation. addr = address to read. size = size of read in bytes. */ -UINT32 i860_cpu_device::readmemi_emu (UINT32 addr, int size) +uint32_t i860_cpu_device::readmemi_emu (uint32_t addr, int size) { #ifdef TRACE_RDWR_MEM fprintf (stderr, "readmemi_emu: (ATE=%d) addr = 0x%08x, size = %d\n", @@ -524,7 +524,7 @@ UINT32 i860_cpu_device::readmemi_emu (UINT32 addr, int size) /* If virtual mode, do translation. */ if (GET_DIRBASE_ATE ()) { - UINT32 phys = get_address_translation (addr, 1 /* is_dataref */, 0 /* is_write */); + uint32_t phys = get_address_translation (addr, 1 /* is_dataref */, 0 /* is_write */); if (m_pending_trap && (GET_PSR_IAT () || GET_PSR_DAT ())) { #ifdef TRACE_PAGE_FAULT @@ -548,12 +548,12 @@ UINT32 i860_cpu_device::readmemi_emu (UINT32 addr, int size) /* Now do the actual read. */ if (size == 1) { - UINT32 ret = m_program->read_byte(addr); + uint32_t ret = m_program->read_byte(addr); return ret & 0xff; } else if (size == 2) { - UINT32 ret = m_program->read_word(addr); + uint32_t ret = m_program->read_word(addr); #ifdef HOST_MSB BYTE_REV16 (ret); #endif @@ -561,7 +561,7 @@ UINT32 i860_cpu_device::readmemi_emu (UINT32 addr, int size) } else if (size == 4) { - UINT32 ret = m_program->read_dword(addr); + uint32_t ret = m_program->read_dword(addr); #ifdef HOST_MSB BYTE_REV32 (ret); #endif @@ -578,7 +578,7 @@ UINT32 i860_cpu_device::readmemi_emu (UINT32 addr, int size) addr = address to write. size = size of write in bytes. data = data to write. */ -void i860_cpu_device::writememi_emu (UINT32 addr, int size, UINT32 data) +void i860_cpu_device::writememi_emu (uint32_t addr, int size, uint32_t data) { #ifdef TRACE_RDWR_MEM fprintf (stderr, "writememi_emu: (ATE=%d) addr = 0x%08x, size = %d, data = 0x%08x\n", @@ -588,7 +588,7 @@ void i860_cpu_device::writememi_emu (UINT32 addr, int size, UINT32 data) /* If virtual mode, do translation. */ if (GET_DIRBASE_ATE ()) { - UINT32 phys = get_address_translation (addr, 1 /* is_dataref */, 1 /* is_write */); + uint32_t phys = get_address_translation (addr, 1 /* is_dataref */, 1 /* is_write */); if (m_pending_trap && (GET_PSR_IAT () || GET_PSR_DAT ())) { #ifdef TRACE_PAGE_FAULT @@ -635,7 +635,7 @@ void i860_cpu_device::writememi_emu (UINT32 addr, int size, UINT32 data) addr = address to read. size = size of read in bytes. dest = memory to put read data. */ -void i860_cpu_device::fp_readmem_emu (UINT32 addr, int size, UINT8 *dest) +void i860_cpu_device::fp_readmem_emu (uint32_t addr, int size, uint8_t *dest) { #ifdef TRACE_RDWR_MEM fprintf (stderr, "fp_readmem_emu: (ATE=%d) addr = 0x%08x, size = %d\n", @@ -647,7 +647,7 @@ void i860_cpu_device::fp_readmem_emu (UINT32 addr, int size, UINT8 *dest) /* If virtual mode, do translation. */ if (GET_DIRBASE_ATE ()) { - UINT32 phys = get_address_translation (addr, 1 /* is_dataref */, 0 /* is_write */); + uint32_t phys = get_address_translation (addr, 1 /* is_dataref */, 0 /* is_write */); if (m_pending_trap && (GET_PSR_IAT () || GET_PSR_DAT ())) { #ifdef TRACE_PAGE_FAULT @@ -702,7 +702,7 @@ void i860_cpu_device::fp_readmem_emu (UINT32 addr, int size, UINT8 *dest) size = size of read in bytes. data = pointer to the data. wmask = bit mask of bytes to write (only for pst.d). */ -void i860_cpu_device::fp_writemem_emu (UINT32 addr, int size, UINT8 *data, UINT32 wmask) +void i860_cpu_device::fp_writemem_emu (uint32_t addr, int size, uint8_t *data, uint32_t wmask) { #ifdef TRACE_RDWR_MEM fprintf (stderr, "fp_writemem_emu: (ATE=%d) addr = 0x%08x, size = %d\n", @@ -714,7 +714,7 @@ void i860_cpu_device::fp_writemem_emu (UINT32 addr, int size, UINT8 *data, UINT3 /* If virtual mode, do translation. */ if (GET_DIRBASE_ATE ()) { - UINT32 phys = get_address_translation (addr, 1 /* is_dataref */, 1 /* is_write */); + uint32_t phys = get_address_translation (addr, 1 /* is_dataref */, 1 /* is_write */); if (m_pending_trap && GET_PSR_DAT ()) { #ifdef TRACE_PAGE_FAULT @@ -743,7 +743,7 @@ void i860_cpu_device::fp_writemem_emu (UINT32 addr, int size, UINT8 *data, UINT3 m_program->write_byte(addr+1, data[2]); m_program->write_byte(addr+0, data[3]); #else - UINT32 ddd = (data[3]) | (data[2] << 8) | (data[1] << 16) |(data[0] << 24); + uint32_t ddd = (data[3]) | (data[2] << 8) | (data[1] << 16) |(data[0] << 24); m_program->write_dword(addr+0, ddd); #endif } @@ -801,10 +801,10 @@ void i860_cpu_device::dump_pipe (int type) { if (m_A[i].stat.arp) fprintf (stderr, "[%dd] 0x%016llx ", i + 1, - *(UINT64 *)(&m_A[i].val.d)); + *(uint64_t *)(&m_A[i].val.d)); else fprintf (stderr, "[%ds] 0x%08x ", i + 1, - *(UINT32 *)(&m_A[i].val.s)); + *(uint32_t *)(&m_A[i].val.s)); } fprintf (stderr, "\n"); } @@ -818,10 +818,10 @@ void i860_cpu_device::dump_pipe (int type) { if (m_M[i].stat.mrp) fprintf (stderr, "[%dd] 0x%016llx ", i + 1, - *(UINT64 *)(&m_M[i].val.d)); + *(uint64_t *)(&m_M[i].val.d)); else fprintf (stderr, "[%ds] 0x%08x ", i + 1, - *(UINT32 *)(&m_M[i].val.s)); + *(uint32_t *)(&m_M[i].val.s)); } fprintf (stderr, "\n"); } @@ -834,10 +834,10 @@ void i860_cpu_device::dump_pipe (int type) { if (m_L[i].stat.lrp) fprintf (stderr, "[%dd] 0x%016llx ", i + 1, - *(UINT64 *)(&m_L[i].val.d)); + *(uint64_t *)(&m_L[i].val.d)); else fprintf (stderr, "[%ds] 0x%08x ", i + 1, - *(UINT32 *)(&m_L[i].val.s)); + *(uint32_t *)(&m_L[i].val.s)); } fprintf (stderr, "\n"); } @@ -848,10 +848,10 @@ void i860_cpu_device::dump_pipe (int type) fprintf (stderr, " I: "); if (m_G.stat.irp) fprintf (stderr, "[1d] 0x%016llx\n", - *(UINT64 *)(&m_G.val.d)); + *(uint64_t *)(&m_G.val.d)); else fprintf (stderr, "[1s] 0x%08x\n", - *(UINT32 *)(&m_G.val.s)); + *(uint32_t *)(&m_G.val.s)); } } @@ -876,7 +876,7 @@ void i860_cpu_device::dump_state (i860s *cpustate) float ff = get_fregval_s (rn); if ((rn % 4) == 0) fprintf (stderr, "\n"); - fprintf (stderr, "%%f%-3d: 0x%08x ", rn, *(UINT32 *)&ff); + fprintf (stderr, "%%f%-3d: 0x%08x ", rn, *(uint32_t *)&ff); } fprintf (stderr, "\n"); @@ -896,26 +896,26 @@ void i860_cpu_device::dump_state (i860s *cpustate) #endif /* Sign extend N-bit number. */ -static inline INT32 sign_ext (UINT32 x, int n) +static inline int32_t sign_ext (uint32_t x, int n) { - INT32 t; + int32_t t; t = x >> (n - 1); t = ((-t) << n) | x; return t; } -void i860_cpu_device::unrecog_opcode (UINT32 pc, UINT32 insn) +void i860_cpu_device::unrecog_opcode (uint32_t pc, uint32_t insn) { fprintf (stderr, "0x%08x: 0x%08x (unrecognized opcode)\n", pc, insn); } /* Execute "ld.c csrc2,idest" instruction. */ -void i860_cpu_device::insn_ld_ctrl (UINT32 insn) +void i860_cpu_device::insn_ld_ctrl (uint32_t insn) { - UINT32 csrc2 = get_creg (insn); - UINT32 idest = get_idest (insn); + uint32_t csrc2 = get_creg (insn); + uint32_t idest = get_idest (insn); #ifdef TRACE_UNDEFINED_I860 if (csrc2 > 5) @@ -946,10 +946,10 @@ void i860_cpu_device::insn_ld_ctrl (UINT32 insn) /* Execute "st.c isrc1,csrc2" instruction. */ -void i860_cpu_device::insn_st_ctrl (UINT32 insn) +void i860_cpu_device::insn_st_ctrl (uint32_t insn) { - UINT32 csrc2 = get_creg (insn); - UINT32 isrc1 = get_isrc1 (insn); + uint32_t csrc2 = get_creg (insn); + uint32_t isrc1 = get_isrc1 (insn); #ifdef TRACE_UNDEFINED_I860 if (csrc2 > 5) @@ -980,7 +980,7 @@ void i860_cpu_device::insn_st_ctrl (UINT32 insn) /* Update the register -- unless it is fir which cannot be updated. */ if (csrc2 == CR_EPSR) { - UINT32 enew = 0, tmp = 0; + uint32_t enew = 0, tmp = 0; /* Make sure unchangeable EPSR bits stay unchanged (DCS, stepping, and type). Also, some bits are only writeable in supervisor mode. */ @@ -1001,8 +1001,8 @@ void i860_cpu_device::insn_st_ctrl (UINT32 insn) /* Some PSR bits are only writeable in supervisor mode. */ if (GET_PSR_U ()) { - UINT32 enew = get_iregval (isrc1) & ~PSR_SUPERVISOR_ONLY_MASK; - UINT32 tmp = m_cregs[CR_PSR] & PSR_SUPERVISOR_ONLY_MASK; + uint32_t enew = get_iregval (isrc1) & ~PSR_SUPERVISOR_ONLY_MASK; + uint32_t tmp = m_cregs[CR_PSR] & PSR_SUPERVISOR_ONLY_MASK; m_cregs[CR_PSR] = enew | tmp; } else @@ -1011,8 +1011,8 @@ void i860_cpu_device::insn_st_ctrl (UINT32 insn) else if (csrc2 == CR_FSR) { /* I believe that only 21..17, 8..5, and 3..0 should be updated. */ - UINT32 enew = get_iregval (isrc1) & 0x003e01ef; - UINT32 tmp = m_cregs[CR_FSR] & ~0x003e01ef; + uint32_t enew = get_iregval (isrc1) & 0x003e01ef; + uint32_t tmp = m_cregs[CR_FSR] & ~0x003e01ef; m_cregs[CR_FSR] = enew | tmp; } else if (csrc2 != CR_FIR) @@ -1022,13 +1022,13 @@ void i860_cpu_device::insn_st_ctrl (UINT32 insn) /* Execute "ld.{s,b,l} isrc1(isrc2),idest" or "ld.{s,b,l} #const(isrc2),idest". */ -void i860_cpu_device::insn_ldx (UINT32 insn) +void i860_cpu_device::insn_ldx (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - INT32 immsrc1 = sign_ext (get_imm16 (insn), 16); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 eff = 0; + uint32_t isrc1 = get_isrc1 (insn); + int32_t immsrc1 = sign_ext (get_imm16 (insn), 16); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t eff = 0; /* Operand size, in bytes. */ int sizes[4] = { 1, 1, 2, 4}; int size = 0; @@ -1045,7 +1045,7 @@ void i860_cpu_device::insn_ldx (UINT32 insn) { /* Chop off lower bits of displacement. */ immsrc1 &= ~(size - 1); - eff = (UINT32)(immsrc1 + (INT32)(get_iregval (isrc2))); + eff = (uint32_t)(immsrc1 + (int32_t)(get_iregval (isrc2))); } else eff = get_iregval (isrc1) + get_iregval (isrc2); @@ -1068,7 +1068,7 @@ void i860_cpu_device::insn_ldx (UINT32 insn) is the target register). */ if (size < 4) { - UINT32 readval = sign_ext (readmemi_emu (eff, size), size * 8); + uint32_t readval = sign_ext (readmemi_emu (eff, size), size * 8); /* Do not update register on page fault. */ if (m_exiting_readmem) { @@ -1078,7 +1078,7 @@ void i860_cpu_device::insn_ldx (UINT32 insn) } else { - UINT32 readval = readmemi_emu (eff, size); + uint32_t readval = readmemi_emu (eff, size); /* Do not update register on page fault. */ if (m_exiting_readmem) { @@ -1092,12 +1092,12 @@ void i860_cpu_device::insn_ldx (UINT32 insn) /* Execute "st.x isrc1ni,#const(isrc2)" instruction (there is no (reg + reg form). Store uses the split immediate, not the normal 16-bit immediate as in ld.x. */ -void i860_cpu_device::insn_stx (UINT32 insn) +void i860_cpu_device::insn_stx (uint32_t insn) { - INT32 immsrc = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); - UINT32 isrc1 = get_isrc1 (insn); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 eff = 0; + int32_t immsrc = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); + uint32_t isrc1 = get_isrc1 (insn); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t eff = 0; /* Operand size, in bytes. */ int sizes[4] = { 1, 1, 2, 4}; int size = 0; @@ -1109,7 +1109,7 @@ void i860_cpu_device::insn_stx (UINT32 insn) /* Get effective address. Chop off lower bits of displacement. */ immsrc &= ~(size - 1); - eff = (UINT32)(immsrc + (INT32)get_iregval (isrc2)); + eff = (uint32_t)(immsrc + (int32_t)get_iregval (isrc2)); /* Write data (value of reg isrc1) to memory at eff. */ writememi_emu (eff, size, get_iregval (isrc1)); @@ -1121,13 +1121,13 @@ void i860_cpu_device::insn_stx (UINT32 insn) /* Execute "fst.y fdest,isrc1(isrc2)", "fst.y fdest,isrc1(isrc2)++", "fst.y fdest,#const(isrc2)" or "fst.y fdest,#const(isrc2)++" instruction. */ -void i860_cpu_device::insn_fsty (UINT32 insn) +void i860_cpu_device::insn_fsty (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - INT32 immsrc1 = sign_ext (get_imm16 (insn), 16); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 fdest = get_fdest (insn); - UINT32 eff = 0; + uint32_t isrc1 = get_isrc1 (insn); + int32_t immsrc1 = sign_ext (get_imm16 (insn), 16); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t fdest = get_fdest (insn); + uint32_t eff = 0; /* Operand size, in bytes. */ int sizes[4] = { 8, 4, 16, 4}; int size = 0; @@ -1148,7 +1148,7 @@ void i860_cpu_device::insn_fsty (UINT32 insn) { /* Chop off lower bits of displacement. */ immsrc1 &= ~(size - 1); - eff = (UINT32)(immsrc1 + (INT32)(get_iregval (isrc2))); + eff = (uint32_t)(immsrc1 + (int32_t)(get_iregval (isrc2))); } else eff = get_iregval (isrc1) + get_iregval (isrc2); @@ -1181,11 +1181,11 @@ void i860_cpu_device::insn_fsty (UINT32 insn) /* Write data (value of freg fdest) to memory at eff. */ if (size == 4) - fp_writemem_emu (eff, size, (UINT8 *)(&m_frg[4 * (31 - fdest)]), 0xff); + fp_writemem_emu (eff, size, (uint8_t *)(&m_frg[4 * (31 - fdest)]), 0xff); else if (size == 8) - fp_writemem_emu (eff, size, (UINT8 *)(&m_frg[4 * (31 - (fdest + 1))]), 0xff); + fp_writemem_emu (eff, size, (uint8_t *)(&m_frg[4 * (31 - (fdest + 1))]), 0xff); else - fp_writemem_emu (eff, size, (UINT8 *)(&m_frg[4 * (31 - (fdest + 3))]), 0xff); + fp_writemem_emu (eff, size, (uint8_t *)(&m_frg[4 * (31 - (fdest + 3))]), 0xff); } @@ -1193,13 +1193,13 @@ void i860_cpu_device::insn_fsty (UINT32 insn) /* Execute "fld.y isrc1(isrc2),fdest", "fld.y isrc1(isrc2)++,idest", "fld.y #const(isrc2),fdest" or "fld.y #const(isrc2)++,idest". Where y = {l,d,q}. Note, there is no pfld.q, though. */ -void i860_cpu_device::insn_fldy (UINT32 insn) +void i860_cpu_device::insn_fldy (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - INT32 immsrc1 = sign_ext (get_imm16 (insn), 16); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 fdest = get_fdest (insn); - UINT32 eff = 0; + uint32_t isrc1 = get_isrc1 (insn); + int32_t immsrc1 = sign_ext (get_imm16 (insn), 16); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t fdest = get_fdest (insn); + uint32_t eff = 0; /* Operand size, in bytes. */ int sizes[4] = { 8, 4, 16, 4}; int size = 0; @@ -1228,7 +1228,7 @@ void i860_cpu_device::insn_fldy (UINT32 insn) { /* Chop off lower bits of displacement. */ immsrc1 &= ~(size - 1); - eff = (UINT32)(immsrc1 + (INT32)(get_iregval (isrc2))); + eff = (uint32_t)(immsrc1 + (int32_t)(get_iregval (isrc2))); } else eff = get_iregval (isrc1) + get_iregval (isrc2); @@ -1269,11 +1269,11 @@ void i860_cpu_device::insn_fldy (UINT32 insn) if (fdest > 1) { if (size == 4) - fp_readmem_emu (eff, size, (UINT8 *)&(m_frg[4 * (31 - fdest)])); + fp_readmem_emu (eff, size, (uint8_t *)&(m_frg[4 * (31 - fdest)])); else if (size == 8) - fp_readmem_emu (eff, size, (UINT8 *)&(m_frg[4 * (31 - (fdest + 1))])); + fp_readmem_emu (eff, size, (uint8_t *)&(m_frg[4 * (31 - (fdest + 1))])); else if (size == 16) - fp_readmem_emu (eff, size, (UINT8 *)&(m_frg[4 * (31 - (fdest + 3))])); + fp_readmem_emu (eff, size, (uint8_t *)&(m_frg[4 * (31 - (fdest + 3))])); } } else @@ -1282,7 +1282,7 @@ void i860_cpu_device::insn_fldy (UINT32 insn) for any traps before updating the pipeline. The pipeline must stay unaffected after a trap so that the instruction can be properly restarted. */ - UINT8 bebuf[8]; + uint8_t bebuf[8]; fp_readmem_emu (eff, size, bebuf); if (m_pending_trap && m_exiting_readmem) goto ab_op; @@ -1307,7 +1307,7 @@ void i860_cpu_device::insn_fldy (UINT32 insn) m_L[1] = m_L[0]; if (size == 8) { - UINT8 *t = (UINT8 *)&(m_L[0].val.d); + uint8_t *t = (uint8_t *)&(m_L[0].val.d); #ifndef HOST_MSB t[7] = bebuf[0]; t[6] = bebuf[1]; t[5] = bebuf[2]; t[4] = bebuf[3]; t[3] = bebuf[4]; t[2] = bebuf[5]; t[1] = bebuf[6]; t[0] = bebuf[7]; @@ -1319,7 +1319,7 @@ void i860_cpu_device::insn_fldy (UINT32 insn) } else { - UINT8 *t = (UINT8 *)&(m_L[0].val.s); + uint8_t *t = (uint8_t *)&(m_L[0].val.s); #ifndef HOST_MSB t[3] = bebuf[0]; t[2] = bebuf[1]; t[1] = bebuf[2]; t[0] = bebuf[3]; #else @@ -1335,17 +1335,17 @@ void i860_cpu_device::insn_fldy (UINT32 insn) /* Execute "pst.d fdest,#const(isrc2)" or "fst.d fdest,#const(isrc2)++" instruction. */ -void i860_cpu_device::insn_pstd (UINT32 insn) +void i860_cpu_device::insn_pstd (uint32_t insn) { - INT32 immsrc1 = sign_ext (get_imm16 (insn), 16); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 fdest = get_fdest (insn); - UINT32 eff = 0; + int32_t immsrc1 = sign_ext (get_imm16 (insn), 16); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t fdest = get_fdest (insn); + uint32_t eff = 0; int auto_inc = (insn & 1); - UINT8 *bebuf = nullptr; + uint8_t *bebuf = nullptr; int pm = GET_PSR_PM (); int i; - UINT32 wmask; + uint32_t wmask; int orig_pm = pm; /* Get the pixel size, where: @@ -1371,7 +1371,7 @@ void i860_cpu_device::insn_pstd (UINT32 insn) /* Get effective address. Chop off lower bits of displacement. */ immsrc1 &= ~(8 - 1); - eff = (UINT32)(immsrc1 + (INT32)(get_iregval (isrc2))); + eff = (uint32_t)(immsrc1 + (int32_t)(get_iregval (isrc2))); #ifdef TRACE_UNALIGNED_MEM if (eff & (8 - 1)) @@ -1429,17 +1429,17 @@ void i860_cpu_device::insn_pstd (UINT32 insn) } orig_pm <<= 1; } - bebuf = (UINT8 *)(&m_frg[4 * (31 - (fdest + 1))]); + bebuf = (uint8_t *)(&m_frg[4 * (31 - (fdest + 1))]); fp_writemem_emu (eff, 8, bebuf, wmask); } /* Execute "ixfr isrc1ni,fdest" instruction. */ -void i860_cpu_device::insn_ixfr (UINT32 insn) +void i860_cpu_device::insn_ixfr (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - UINT32 fdest = get_fdest (insn); - UINT32 iv = 0; + uint32_t isrc1 = get_isrc1 (insn); + uint32_t fdest = get_fdest (insn); + uint32_t iv = 0; /* This is a bit-pattern transfer, not a conversion. */ iv = get_iregval (isrc1); @@ -1448,13 +1448,13 @@ void i860_cpu_device::insn_ixfr (UINT32 insn) /* Execute "addu isrc1,isrc2,idest". */ -void i860_cpu_device::insn_addu (UINT32 insn) +void i860_cpu_device::insn_addu (uint32_t insn) { - UINT32 src1val; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 tmp_dest_val = 0; - UINT64 tmp = 0; + uint32_t src1val; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t tmp_dest_val = 0; + uint64_t tmp = 0; src1val = get_iregval (get_isrc1 (insn)); @@ -1468,7 +1468,7 @@ void i860_cpu_device::insn_addu (UINT32 insn) OF = bit 31 carry CC = bit 31 carry. */ - tmp = (UINT64)src1val + (UINT64)(get_iregval (isrc2)); + tmp = (uint64_t)src1val + (uint64_t)(get_iregval (isrc2)); if ((tmp >> 32) & 1) { SET_PSR_CC (1); @@ -1486,13 +1486,13 @@ void i860_cpu_device::insn_addu (UINT32 insn) /* Execute "addu #const,isrc2,idest". */ -void i860_cpu_device::insn_addu_imm (UINT32 insn) +void i860_cpu_device::insn_addu_imm (uint32_t insn) { - UINT32 src1val; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 tmp_dest_val = 0; - UINT64 tmp = 0; + uint32_t src1val; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t tmp_dest_val = 0; + uint64_t tmp = 0; src1val = sign_ext (get_imm16 (insn), 16); @@ -1506,7 +1506,7 @@ void i860_cpu_device::insn_addu_imm (UINT32 insn) OF = bit 31 carry CC = bit 31 carry. */ - tmp = (UINT64)src1val + (UINT64)(get_iregval (isrc2)); + tmp = (uint64_t)src1val + (uint64_t)(get_iregval (isrc2)); if ((tmp >> 32) & 1) { SET_PSR_CC (1); @@ -1524,12 +1524,12 @@ void i860_cpu_device::insn_addu_imm (UINT32 insn) /* Execute "adds isrc1,isrc2,idest". */ -void i860_cpu_device::insn_adds (UINT32 insn) +void i860_cpu_device::insn_adds (uint32_t insn) { - UINT32 src1val; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 tmp_dest_val = 0; + uint32_t src1val; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t tmp_dest_val = 0; int sa, sb, sres; src1val = get_iregval (get_isrc1 (insn)); @@ -1553,7 +1553,7 @@ void i860_cpu_device::insn_adds (UINT32 insn) else SET_EPSR_OF (0); - if ((INT32)get_iregval (isrc2) < -(INT32)(src1val)) + if ((int32_t)get_iregval (isrc2) < -(int32_t)(src1val)) SET_PSR_CC (1); else SET_PSR_CC (0); @@ -1564,12 +1564,12 @@ void i860_cpu_device::insn_adds (UINT32 insn) /* Execute "adds #const,isrc2,idest". */ -void i860_cpu_device::insn_adds_imm (UINT32 insn) +void i860_cpu_device::insn_adds_imm (uint32_t insn) { - UINT32 src1val; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 tmp_dest_val = 0; + uint32_t src1val; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t tmp_dest_val = 0; int sa, sb, sres; src1val = sign_ext (get_imm16 (insn), 16); @@ -1593,7 +1593,7 @@ void i860_cpu_device::insn_adds_imm (UINT32 insn) else SET_EPSR_OF (0); - if ((INT32)get_iregval (isrc2) < -(INT32)(src1val)) + if ((int32_t)get_iregval (isrc2) < -(int32_t)(src1val)) SET_PSR_CC (1); else SET_PSR_CC (0); @@ -1604,12 +1604,12 @@ void i860_cpu_device::insn_adds_imm (UINT32 insn) /* Execute "subu isrc1,isrc2,idest". */ -void i860_cpu_device::insn_subu (UINT32 insn) +void i860_cpu_device::insn_subu (uint32_t insn) { - UINT32 src1val; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 tmp_dest_val = 0; + uint32_t src1val; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t tmp_dest_val = 0; src1val = get_iregval (get_isrc1 (insn)); @@ -1625,7 +1625,7 @@ void i860_cpu_device::insn_subu (UINT32 insn) (i.e. CC set if isrc2 <= isrc1 CC clear if isrc2 > isrc1 */ - if ((UINT32)get_iregval (isrc2) <= (UINT32)src1val) + if ((uint32_t)get_iregval (isrc2) <= (uint32_t)src1val) { SET_PSR_CC (1); SET_EPSR_OF (0); @@ -1642,12 +1642,12 @@ void i860_cpu_device::insn_subu (UINT32 insn) /* Execute "subu #const,isrc2,idest". */ -void i860_cpu_device::insn_subu_imm (UINT32 insn) +void i860_cpu_device::insn_subu_imm (uint32_t insn) { - UINT32 src1val; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 tmp_dest_val = 0; + uint32_t src1val; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t tmp_dest_val = 0; src1val = sign_ext (get_imm16 (insn), 16); @@ -1663,7 +1663,7 @@ void i860_cpu_device::insn_subu_imm (UINT32 insn) (i.e. CC set if isrc2 <= isrc1 CC clear if isrc2 > isrc1 */ - if ((UINT32)get_iregval (isrc2) <= (UINT32)src1val) + if ((uint32_t)get_iregval (isrc2) <= (uint32_t)src1val) { SET_PSR_CC (1); SET_EPSR_OF (0); @@ -1680,12 +1680,12 @@ void i860_cpu_device::insn_subu_imm (UINT32 insn) /* Execute "subs isrc1,isrc2,idest". */ -void i860_cpu_device::insn_subs (UINT32 insn) +void i860_cpu_device::insn_subs (uint32_t insn) { - UINT32 src1val; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 tmp_dest_val = 0; + uint32_t src1val; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t tmp_dest_val = 0; int sa, sb, sres; src1val = get_iregval (get_isrc1 (insn)); @@ -1709,7 +1709,7 @@ void i860_cpu_device::insn_subs (UINT32 insn) else SET_EPSR_OF (0); - if ((INT32)get_iregval (isrc2) > (INT32)(src1val)) + if ((int32_t)get_iregval (isrc2) > (int32_t)(src1val)) SET_PSR_CC (1); else SET_PSR_CC (0); @@ -1720,12 +1720,12 @@ void i860_cpu_device::insn_subs (UINT32 insn) /* Execute "subs #const,isrc2,idest". */ -void i860_cpu_device::insn_subs_imm (UINT32 insn) +void i860_cpu_device::insn_subs_imm (uint32_t insn) { - UINT32 src1val; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 tmp_dest_val = 0; + uint32_t src1val; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t tmp_dest_val = 0; int sa, sb, sres; src1val = sign_ext (get_imm16 (insn), 16); @@ -1749,7 +1749,7 @@ void i860_cpu_device::insn_subs_imm (UINT32 insn) else SET_EPSR_OF (0); - if ((INT32)get_iregval (isrc2) > (INT32)(src1val)) + if ((int32_t)get_iregval (isrc2) > (int32_t)(src1val)) SET_PSR_CC (1); else SET_PSR_CC (0); @@ -1760,11 +1760,11 @@ void i860_cpu_device::insn_subs_imm (UINT32 insn) /* Execute "shl isrc1,isrc2,idest". */ -void i860_cpu_device::insn_shl (UINT32 insn) +void i860_cpu_device::insn_shl (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); src1val = get_iregval (get_isrc1 (insn)); set_iregval (idest, get_iregval (isrc2) << src1val); @@ -1772,11 +1772,11 @@ void i860_cpu_device::insn_shl (UINT32 insn) /* Execute "shl #const,isrc2,idest". */ -void i860_cpu_device::insn_shl_imm (UINT32 insn) +void i860_cpu_device::insn_shl_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); src1val = sign_ext (get_imm16 (insn), 16); set_iregval (idest, get_iregval (isrc2) << src1val); @@ -1784,15 +1784,15 @@ void i860_cpu_device::insn_shl_imm (UINT32 insn) /* Execute "shr isrc1,isrc2,idest". */ -void i860_cpu_device::insn_shr (UINT32 insn) +void i860_cpu_device::insn_shr (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); src1val = get_iregval (get_isrc1 (insn)); - /* The iregs array is UINT32, so this is a logical shift. */ + /* The iregs array is uint32_t, so this is a logical shift. */ set_iregval (idest, get_iregval (isrc2) >> src1val); /* shr also sets the SC in psr (shift count). */ @@ -1801,15 +1801,15 @@ void i860_cpu_device::insn_shr (UINT32 insn) /* Execute "shr #const,isrc2,idest". */ -void i860_cpu_device::insn_shr_imm (UINT32 insn) +void i860_cpu_device::insn_shr_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); src1val = sign_ext (get_imm16 (insn), 16); - /* The iregs array is UINT32, so this is a logical shift. */ + /* The iregs array is uint32_t, so this is a logical shift. */ set_iregval (idest, get_iregval (isrc2) >> src1val); /* shr also sets the SC in psr (shift count). */ @@ -1818,41 +1818,41 @@ void i860_cpu_device::insn_shr_imm (UINT32 insn) /* Execute "shra isrc1,isrc2,idest". */ -void i860_cpu_device::insn_shra (UINT32 insn) +void i860_cpu_device::insn_shra (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); src1val = get_iregval (get_isrc1 (insn)); - /* The iregs array is UINT32, so cast isrc2 to get arithmetic shift. */ - set_iregval (idest, (INT32)get_iregval (isrc2) >> src1val); + /* The iregs array is uint32_t, so cast isrc2 to get arithmetic shift. */ + set_iregval (idest, (int32_t)get_iregval (isrc2) >> src1val); } /* Execute "shra #const,isrc2,idest". */ -void i860_cpu_device::insn_shra_imm (UINT32 insn) +void i860_cpu_device::insn_shra_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); src1val = sign_ext (get_imm16 (insn), 16); - /* The iregs array is UINT32, so cast isrc2 to get arithmetic shift. */ - set_iregval (idest, (INT32)get_iregval (isrc2) >> src1val); + /* The iregs array is uint32_t, so cast isrc2 to get arithmetic shift. */ + set_iregval (idest, (int32_t)get_iregval (isrc2) >> src1val); } /* Execute "shrd isrc1ni,isrc2,idest" instruction. */ -void i860_cpu_device::insn_shrd (UINT32 insn) +void i860_cpu_device::insn_shrd (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 sc = GET_PSR_SC (); - UINT32 tmp; + uint32_t isrc1 = get_isrc1 (insn); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t sc = GET_PSR_SC (); + uint32_t tmp; /* Do the operation: idest = low_32(isrc1ni:isrc2 >> sc). */ @@ -1868,12 +1868,12 @@ void i860_cpu_device::insn_shrd (UINT32 insn) /* Execute "and isrc1,isrc2,idest". */ -void i860_cpu_device::insn_and (UINT32 insn) +void i860_cpu_device::insn_and (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t isrc1 = get_isrc1 (insn); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ res = get_iregval (isrc1) & get_iregval (isrc2); @@ -1889,12 +1889,12 @@ void i860_cpu_device::insn_and (UINT32 insn) /* Execute "and #const,isrc2,idest". */ -void i860_cpu_device::insn_and_imm (UINT32 insn) +void i860_cpu_device::insn_and_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ src1val = get_imm16 (insn); @@ -1911,12 +1911,12 @@ void i860_cpu_device::insn_and_imm (UINT32 insn) /* Execute "andh #const,isrc2,idest". */ -void i860_cpu_device::insn_andh_imm (UINT32 insn) +void i860_cpu_device::insn_andh_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ src1val = get_imm16 (insn); @@ -1933,12 +1933,12 @@ void i860_cpu_device::insn_andh_imm (UINT32 insn) /* Execute "andnot isrc1,isrc2,idest". */ -void i860_cpu_device::insn_andnot (UINT32 insn) +void i860_cpu_device::insn_andnot (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t isrc1 = get_isrc1 (insn); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ res = (~get_iregval (isrc1)) & get_iregval (isrc2); @@ -1954,12 +1954,12 @@ void i860_cpu_device::insn_andnot (UINT32 insn) /* Execute "andnot #const,isrc2,idest". */ -void i860_cpu_device::insn_andnot_imm (UINT32 insn) +void i860_cpu_device::insn_andnot_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ src1val = get_imm16 (insn); @@ -1976,12 +1976,12 @@ void i860_cpu_device::insn_andnot_imm (UINT32 insn) /* Execute "andnoth #const,isrc2,idest". */ -void i860_cpu_device::insn_andnoth_imm (UINT32 insn) +void i860_cpu_device::insn_andnoth_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ src1val = get_imm16 (insn); @@ -1998,12 +1998,12 @@ void i860_cpu_device::insn_andnoth_imm (UINT32 insn) /* Execute "or isrc1,isrc2,idest". */ -void i860_cpu_device::insn_or (UINT32 insn) +void i860_cpu_device::insn_or (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t isrc1 = get_isrc1 (insn); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ res = get_iregval (isrc1) | get_iregval (isrc2); @@ -2019,12 +2019,12 @@ void i860_cpu_device::insn_or (UINT32 insn) /* Execute "or #const,isrc2,idest". */ -void i860_cpu_device::insn_or_imm (UINT32 insn) +void i860_cpu_device::insn_or_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ src1val = get_imm16 (insn); @@ -2041,12 +2041,12 @@ void i860_cpu_device::insn_or_imm (UINT32 insn) /* Execute "orh #const,isrc2,idest". */ -void i860_cpu_device::insn_orh_imm (UINT32 insn) +void i860_cpu_device::insn_orh_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ src1val = get_imm16 (insn); @@ -2063,12 +2063,12 @@ void i860_cpu_device::insn_orh_imm (UINT32 insn) /* Execute "xor isrc1,isrc2,idest". */ -void i860_cpu_device::insn_xor (UINT32 insn) +void i860_cpu_device::insn_xor (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t isrc1 = get_isrc1 (insn); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ res = get_iregval (isrc1) ^ get_iregval (isrc2); @@ -2084,12 +2084,12 @@ void i860_cpu_device::insn_xor (UINT32 insn) /* Execute "xor #const,isrc2,idest". */ -void i860_cpu_device::insn_xor_imm (UINT32 insn) +void i860_cpu_device::insn_xor_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ src1val = get_imm16 (insn); @@ -2106,12 +2106,12 @@ void i860_cpu_device::insn_xor_imm (UINT32 insn) /* Execute "xorh #const,isrc2,idest". */ -void i860_cpu_device::insn_xorh_imm (UINT32 insn) +void i860_cpu_device::insn_xorh_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 idest = get_idest (insn); - UINT32 res = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t idest = get_idest (insn); + uint32_t res = 0; /* Do the operation. */ src1val = get_imm16 (insn); @@ -2128,7 +2128,7 @@ void i860_cpu_device::insn_xorh_imm (UINT32 insn) /* Execute "trap isrc1ni,isrc2,idest" instruction. */ -void i860_cpu_device::insn_trap (UINT32 insn) +void i860_cpu_device::insn_trap (uint32_t insn) { SET_PSR_IT (1); m_pending_trap = 1; @@ -2136,7 +2136,7 @@ void i860_cpu_device::insn_trap (UINT32 insn) /* Execute "intovr" instruction. */ -void i860_cpu_device::insn_intovr (UINT32 insn) +void i860_cpu_device::insn_intovr (uint32_t insn) { if (GET_EPSR_OF ()) { @@ -2147,19 +2147,19 @@ void i860_cpu_device::insn_intovr (UINT32 insn) /* Execute "bte isrc1,isrc2,sbroff". */ -void i860_cpu_device::insn_bte (UINT32 insn) +void i860_cpu_device::insn_bte (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 target_addr = 0; - INT32 sbroff = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t target_addr = 0; + int32_t sbroff = 0; int res = 0; src1val = get_iregval (get_isrc1 (insn)); /* Compute the target address from the sbroff field. */ sbroff = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); - target_addr = (INT32)m_pc + 4 + (sbroff << 2); + target_addr = (int32_t)m_pc + 4 + (sbroff << 2); /* Determine comparison result. */ res = (src1val == get_iregval (isrc2)); @@ -2175,19 +2175,19 @@ void i860_cpu_device::insn_bte (UINT32 insn) /* Execute "bte #const5,isrc2,sbroff". */ -void i860_cpu_device::insn_bte_imm (UINT32 insn) +void i860_cpu_device::insn_bte_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 target_addr = 0; - INT32 sbroff = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t target_addr = 0; + int32_t sbroff = 0; int res = 0; src1val = (insn >> 11) & 0x1f; /* 5-bit field, zero-extended. */ /* Compute the target address from the sbroff field. */ sbroff = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); - target_addr = (INT32)m_pc + 4 + (sbroff << 2); + target_addr = (int32_t)m_pc + 4 + (sbroff << 2); /* Determine comparison result. */ res = (src1val == get_iregval (isrc2)); @@ -2203,19 +2203,19 @@ void i860_cpu_device::insn_bte_imm (UINT32 insn) /* Execute "btne isrc1,isrc2,sbroff". */ -void i860_cpu_device::insn_btne (UINT32 insn) +void i860_cpu_device::insn_btne (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 target_addr = 0; - INT32 sbroff = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t target_addr = 0; + int32_t sbroff = 0; int res = 0; src1val = get_iregval (get_isrc1 (insn)); /* Compute the target address from the sbroff field. */ sbroff = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); - target_addr = (INT32)m_pc + 4 + (sbroff << 2); + target_addr = (int32_t)m_pc + 4 + (sbroff << 2); /* Determine comparison result. */ res = (src1val != get_iregval (isrc2)); @@ -2231,19 +2231,19 @@ void i860_cpu_device::insn_btne (UINT32 insn) /* Execute "btne #const5,isrc2,sbroff". */ -void i860_cpu_device::insn_btne_imm (UINT32 insn) +void i860_cpu_device::insn_btne_imm (uint32_t insn) { - UINT32 src1val = 0; - UINT32 isrc2 = get_isrc2 (insn); - UINT32 target_addr = 0; - INT32 sbroff = 0; + uint32_t src1val = 0; + uint32_t isrc2 = get_isrc2 (insn); + uint32_t target_addr = 0; + int32_t sbroff = 0; int res = 0; src1val = (insn >> 11) & 0x1f; /* 5-bit field, zero-extended. */ /* Compute the target address from the sbroff field. */ sbroff = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); - target_addr = (INT32)m_pc + 4 + (sbroff << 2); + target_addr = (int32_t)m_pc + 4 + (sbroff << 2); /* Determine comparison result. */ res = (src1val != get_iregval (isrc2)); @@ -2259,15 +2259,15 @@ void i860_cpu_device::insn_btne_imm (UINT32 insn) /* Execute "bc lbroff" instruction. */ -void i860_cpu_device::insn_bc (UINT32 insn) +void i860_cpu_device::insn_bc (uint32_t insn) { - UINT32 target_addr = 0; - INT32 lbroff = 0; + uint32_t target_addr = 0; + int32_t lbroff = 0; int res = 0; /* Compute the target address from the lbroff field. */ lbroff = sign_ext ((insn & 0x03ffffff), 26); - target_addr = (INT32)m_pc + 4 + (lbroff << 2); + target_addr = (int32_t)m_pc + 4 + (lbroff << 2); /* Determine comparison result. */ res = (GET_PSR_CC () == 1); @@ -2283,15 +2283,15 @@ void i860_cpu_device::insn_bc (UINT32 insn) /* Execute "bnc lbroff" instruction. */ -void i860_cpu_device::insn_bnc (UINT32 insn) +void i860_cpu_device::insn_bnc (uint32_t insn) { - UINT32 target_addr = 0; - INT32 lbroff = 0; + uint32_t target_addr = 0; + int32_t lbroff = 0; int res = 0; /* Compute the target address from the lbroff field. */ lbroff = sign_ext ((insn & 0x03ffffff), 26); - target_addr = (INT32)m_pc + 4 + (lbroff << 2); + target_addr = (int32_t)m_pc + 4 + (lbroff << 2); /* Determine comparison result. */ res = (GET_PSR_CC () == 0); @@ -2308,16 +2308,16 @@ void i860_cpu_device::insn_bnc (UINT32 insn) /* Execute "bc.t lbroff" instruction. */ -void i860_cpu_device::insn_bct (UINT32 insn) +void i860_cpu_device::insn_bct (uint32_t insn) { - UINT32 target_addr = 0; - INT32 lbroff = 0; + uint32_t target_addr = 0; + int32_t lbroff = 0; int res = 0; - UINT32 orig_pc = m_pc; + uint32_t orig_pc = m_pc; /* Compute the target address from the lbroff field. */ lbroff = sign_ext ((insn & 0x03ffffff), 26); - target_addr = (INT32)m_pc + 4 + (lbroff << 2); + target_addr = (int32_t)m_pc + 4 + (lbroff << 2); /* Determine comparison result. */ res = (GET_PSR_CC () == 1); @@ -2352,16 +2352,16 @@ void i860_cpu_device::insn_bct (UINT32 insn) /* Execute "bnc.t lbroff" instruction. */ -void i860_cpu_device::insn_bnct (UINT32 insn) +void i860_cpu_device::insn_bnct (uint32_t insn) { - UINT32 target_addr = 0; - INT32 lbroff = 0; + uint32_t target_addr = 0; + int32_t lbroff = 0; int res = 0; - UINT32 orig_pc = m_pc; + uint32_t orig_pc = m_pc; /* Compute the target address from the lbroff field. */ lbroff = sign_ext ((insn & 0x03ffffff), 26); - target_addr = (INT32)m_pc + 4 + (lbroff << 2); + target_addr = (int32_t)m_pc + 4 + (lbroff << 2); /* Determine comparison result. */ res = (GET_PSR_CC () == 0); @@ -2396,15 +2396,15 @@ void i860_cpu_device::insn_bnct (UINT32 insn) /* Execute "call lbroff" instruction. */ -void i860_cpu_device::insn_call (UINT32 insn) +void i860_cpu_device::insn_call (uint32_t insn) { - UINT32 target_addr = 0; - INT32 lbroff = 0; - UINT32 orig_pc = m_pc; + uint32_t target_addr = 0; + int32_t lbroff = 0; + uint32_t orig_pc = m_pc; /* Compute the target address from the lbroff field. */ lbroff = sign_ext ((insn & 0x03ffffff), 26); - target_addr = (INT32)m_pc + 4 + (lbroff << 2); + target_addr = (int32_t)m_pc + 4 + (lbroff << 2); /* Execute the delay slot instruction. */ m_pc += 4; @@ -2428,15 +2428,15 @@ void i860_cpu_device::insn_call (UINT32 insn) /* Execute "br lbroff". */ -void i860_cpu_device::insn_br (UINT32 insn) +void i860_cpu_device::insn_br (uint32_t insn) { - UINT32 target_addr = 0; - INT32 lbroff = 0; - UINT32 orig_pc = m_pc; + uint32_t target_addr = 0; + int32_t lbroff = 0; + uint32_t orig_pc = m_pc; /* Compute the target address from the lbroff field. */ lbroff = sign_ext ((insn & 0x03ffffff), 26); - target_addr = (INT32)m_pc + 4 + (lbroff << 2); + target_addr = (int32_t)m_pc + 4 + (lbroff << 2); /* Execute the delay slot instruction. */ m_pc += 4; @@ -2459,12 +2459,12 @@ void i860_cpu_device::insn_br (UINT32 insn) /* Execute "bri isrc1ni" instruction. Note: I didn't merge this code with calli because bri must do a lot of flag manipulation if any trap bits are set. */ -void i860_cpu_device::insn_bri (UINT32 insn) +void i860_cpu_device::insn_bri (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - UINT32 orig_pc = m_pc; - UINT32 orig_psr = m_cregs[CR_PSR]; - UINT32 orig_src1_val = get_iregval (isrc1); + uint32_t isrc1 = get_isrc1 (insn); + uint32_t orig_pc = m_pc; + uint32_t orig_psr = m_cregs[CR_PSR]; + uint32_t orig_src1_val = get_iregval (isrc1); #if 1 /* TURBO. */ m_cregs[CR_PSR] &= ~PSR_ALL_TRAP_BITS_MASK; @@ -2504,11 +2504,11 @@ void i860_cpu_device::insn_bri (UINT32 insn) } /* Execute "calli isrc1ni" instruction. */ -void i860_cpu_device::insn_calli (UINT32 insn) +void i860_cpu_device::insn_calli (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - UINT32 orig_pc = m_pc; - UINT32 orig_src1_val = get_iregval (isrc1); + uint32_t isrc1 = get_isrc1 (insn); + uint32_t orig_pc = m_pc; + uint32_t orig_src1_val = get_iregval (isrc1); #ifdef TRACE_UNDEFINED_I860 /* Check for undefined behavior. */ @@ -2542,15 +2542,15 @@ void i860_cpu_device::insn_calli (UINT32 insn) /* Execute "bla isrc1ni,isrc2,sbroff" instruction. */ -void i860_cpu_device::insn_bla (UINT32 insn) +void i860_cpu_device::insn_bla (uint32_t insn) { - UINT32 isrc1 = get_isrc1 (insn); - UINT32 isrc2 = get_isrc2 (insn); - UINT32 target_addr = 0; - INT32 sbroff = 0; + uint32_t isrc1 = get_isrc1 (insn); + uint32_t isrc2 = get_isrc2 (insn); + uint32_t target_addr = 0; + int32_t sbroff = 0; int lcc_tmp = 0; - UINT32 orig_pc = m_pc; - UINT32 orig_isrc2val = get_iregval (isrc2); + uint32_t orig_pc = m_pc; + uint32_t orig_isrc2val = get_iregval (isrc2); #ifdef TRACE_UNDEFINED_I860 /* Check for undefined behavior. */ @@ -2564,10 +2564,10 @@ void i860_cpu_device::insn_bla (UINT32 insn) /* Compute the target address from the sbroff field. */ sbroff = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); - target_addr = (INT32)m_pc + 4 + (sbroff << 2); + target_addr = (int32_t)m_pc + 4 + (sbroff << 2); /* Determine comparison result based on opcode. */ - lcc_tmp = ((INT32)get_iregval (isrc2) >= -(INT32)get_iregval (isrc1)); + lcc_tmp = ((int32_t)get_iregval (isrc2) >= -(int32_t)get_iregval (isrc1)); set_iregval (isrc2, get_iregval (isrc1) + orig_isrc2val); @@ -2597,12 +2597,12 @@ void i860_cpu_device::insn_bla (UINT32 insn) /* Execute "flush #const(isrc2)" or "flush #const(isrc2)++" instruction. */ -void i860_cpu_device::insn_flush (UINT32 insn) +void i860_cpu_device::insn_flush (uint32_t insn) { - UINT32 src1val = sign_ext (get_imm16 (insn), 16); - UINT32 isrc2 = get_isrc2 (insn); + uint32_t src1val = sign_ext (get_imm16 (insn), 16); + uint32_t isrc2 = get_isrc2 (insn); int auto_inc = (insn & 1); - UINT32 eff = 0; + uint32_t eff = 0; /* Technically, idest should be encoded as r0 because idest is undefined after the instruction. We don't currently @@ -2635,11 +2635,11 @@ void i860_cpu_device::insn_flush (UINT32 insn) The pfmul3.dd differs from pfmul.dd in that it treats the pipeline as 3 stages, even though it is a double precision multiply. */ -void i860_cpu_device::insn_fmul (UINT32 insn) +void i860_cpu_device::insn_fmul (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int src_prec = insn & 0x100; /* 1 = double, 0 = single. */ int res_prec = insn & 0x080; /* 1 = double, 0 = single. */ int piped = insn & 0x400; /* 1 = pipelined, 0 = scalar. */ @@ -2771,17 +2771,17 @@ void i860_cpu_device::insn_fmul (UINT32 insn) /* Execute "fmlow.dd fsrc1,fsrc2,fdest" instruction. */ -void i860_cpu_device::insn_fmlow (UINT32 insn) +void i860_cpu_device::insn_fmlow (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); double v1 = get_fregval_d (fsrc1); double v2 = get_fregval_d (fsrc2); - INT64 i1 = *(UINT64 *)&v1; - INT64 i2 = *(UINT64 *)&v2; - INT64 tmp = 0; + int64_t i1 = *(uint64_t *)&v1; + int64_t i2 = *(uint64_t *)&v2; + int64_t tmp = 0; /* Only .dd is valid for fmlow. */ if ((insn & 0x180) != 0x180) @@ -2804,11 +2804,11 @@ void i860_cpu_device::insn_fmlow (UINT32 insn) /* Execute [p]fadd.{ss,sd,dd} fsrc1,fsrc2,fdest (.ds disallowed above). */ -void i860_cpu_device::insn_fadd_sub (UINT32 insn) +void i860_cpu_device::insn_fadd_sub (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int src_prec = insn & 0x100; /* 1 = double, 0 = single. */ int res_prec = insn & 0x080; /* 1 = double, 0 = single. */ int piped = insn & 0x400; /* 1 = pipelined, 0 = scalar. */ @@ -2969,11 +2969,11 @@ static const struct /* 1111 */ { OP_SRC1, OP_SRC2, OP_T, OP_APIPE|FLAGM, 0, 0} }; -float i860_cpu_device::get_fval_from_optype_s (UINT32 insn, int optype) +float i860_cpu_device::get_fval_from_optype_s (uint32_t insn, int optype) { float retval = 0.0; - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); optype &= ~FLAGM; switch (optype) @@ -3008,11 +3008,11 @@ float i860_cpu_device::get_fval_from_optype_s (UINT32 insn, int optype) } -double i860_cpu_device::get_fval_from_optype_d (UINT32 insn, int optype) +double i860_cpu_device::get_fval_from_optype_d (uint32_t insn, int optype) { double retval = 0.0; - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); optype &= ~FLAGM; switch (optype) @@ -3057,11 +3057,11 @@ double i860_cpu_device::get_fval_from_optype_d (UINT32 insn, int optype) floating point operations. The S bit denotes the precision of the multiplication source, while the R bit denotes the precision of the addition source as well as precision of all results. */ -void i860_cpu_device::insn_dualop (UINT32 insn) +void i860_cpu_device::insn_dualop (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int src_prec = insn & 0x100; /* 1 = double, 0 = single. */ int res_prec = insn & 0x080; /* 1 = double, 0 = single. */ int is_pfam = insn & 0x400; /* 1 = pfam, 0 = pfmam. */ @@ -3318,10 +3318,10 @@ void i860_cpu_device::insn_dualop (UINT32 insn) /* Execute frcp.{ss,sd,dd} fsrc2,fdest (.ds disallowed above). */ -void i860_cpu_device::insn_frcp (UINT32 insn) +void i860_cpu_device::insn_frcp (uint32_t insn) { - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int src_prec = insn & 0x100; /* 1 = double, 0 = single. */ int res_prec = insn & 0x080; /* 1 = double, 0 = single. */ @@ -3347,9 +3347,9 @@ void i860_cpu_device::insn_frcp (UINT32 insn) /* Real i860 isn't a precise as a real divide, but this should be okay. */ SET_FSR_SE (0); - *((UINT64 *)&v) &= 0xfffff00000000000ULL; + *((uint64_t *)&v) &= 0xfffff00000000000ULL; res = (double)1.0/v; - *((UINT64 *)&res) &= 0xfffff00000000000ULL; + *((uint64_t *)&res) &= 0xfffff00000000000ULL; if (res_prec) set_fregval_d (fdest, res); else @@ -3376,9 +3376,9 @@ void i860_cpu_device::insn_frcp (UINT32 insn) /* Real i860 isn't a precise as a real divide, but this should be okay. */ SET_FSR_SE (0); - *((UINT32 *)&v) &= 0xffff8000; + *((uint32_t *)&v) &= 0xffff8000; res = (float)1.0/v; - *((UINT32 *)&res) &= 0xffff8000; + *((uint32_t *)&res) &= 0xffff8000; if (res_prec) set_fregval_d (fdest, (double)res); else @@ -3389,10 +3389,10 @@ void i860_cpu_device::insn_frcp (UINT32 insn) /* Execute frsqr.{ss,sd,dd} fsrc2,fdest (.ds disallowed above). */ -void i860_cpu_device::insn_frsqr (UINT32 insn) +void i860_cpu_device::insn_frsqr (uint32_t insn) { - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int src_prec = insn & 0x100; /* 1 = double, 0 = single. */ int res_prec = insn & 0x080; /* 1 = double, 0 = single. */ @@ -3430,9 +3430,9 @@ void i860_cpu_device::insn_frsqr (UINT32 insn) else { SET_FSR_SE (0); - *((UINT64 *)&v) &= 0xfffff00000000000ULL; + *((uint64_t *)&v) &= 0xfffff00000000000ULL; res = (double)1.0/sqrt (v); - *((UINT64 *)&res) &= 0xfffff00000000000ULL; + *((uint64_t *)&res) &= 0xfffff00000000000ULL; if (res_prec) set_fregval_d (fdest, res); else @@ -3457,10 +3457,10 @@ void i860_cpu_device::insn_frsqr (UINT32 insn) else { SET_FSR_SE (0); - *((UINT32 *)&v) &= 0xffff8000; + *((uint32_t *)&v) &= 0xffff8000; // FIXME: shouldn't this be 1.0f / sqrtf(v) ? res = (float) (1.0/sqrt (v)); - *((UINT32 *)&res) &= 0xffff8000; + *((uint32_t *)&res) &= 0xffff8000; if (res_prec) set_fregval_d (fdest, (double)res); else @@ -3471,15 +3471,15 @@ void i860_cpu_device::insn_frsqr (UINT32 insn) /* Execute fxfr fsrc1,idest. */ -void i860_cpu_device::insn_fxfr (UINT32 insn) +void i860_cpu_device::insn_fxfr (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 idest = get_idest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t idest = get_idest (insn); float fv = 0; /* This is a bit-pattern transfer, not a conversion. */ fv = get_fregval_s (fsrc1); - set_iregval (idest, *(UINT32 *)&fv); + set_iregval (idest, *(uint32_t *)&fv); } @@ -3491,10 +3491,10 @@ void i860_cpu_device::insn_fxfr (UINT32 insn) results. Inconsistent. Update: The vendor SVR4 assembler does not accept .ss combination, so the latter sentence above appears to be the correct way. */ -void i860_cpu_device::insn_ftrunc (UINT32 insn) +void i860_cpu_device::insn_ftrunc (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fdest = get_fdest (insn); int src_prec = insn & 0x100; /* 1 = double, 0 = single. */ int res_prec = insn & 0x080; /* 1 = double, 0 = single. */ int piped = insn & 0x400; /* 1 = pipelined, 0 = scalar. */ @@ -3512,7 +3512,7 @@ void i860_cpu_device::insn_ftrunc (UINT32 insn) if (src_prec) { double v1 = get_fregval_d (fsrc1); - INT32 iv = (INT32)v1; + int32_t iv = (int32_t)v1; /* We always write a single, since the lower 32-bits of fdest get the result (and the even numbered reg is the lower). */ set_fregval_s (fdest, *(float *)&iv); @@ -3520,7 +3520,7 @@ void i860_cpu_device::insn_ftrunc (UINT32 insn) else { float v1 = get_fregval_s (fsrc1); - INT32 iv = (INT32)v1; + int32_t iv = (int32_t)v1; /* We always write a single, since the lower 32-bits of fdest get the result (and the even numbered reg is the lower). */ set_fregval_s (fdest, *(float *)&iv); @@ -3540,10 +3540,10 @@ void i860_cpu_device::insn_ftrunc (UINT32 insn) /* Execute [p]famov.{ss,sd,ds,dd} fsrc1,fdest. */ -void i860_cpu_device::insn_famov (UINT32 insn) +void i860_cpu_device::insn_famov (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fdest = get_fdest (insn); int src_prec = insn & 0x100; /* 1 = double, 0 = single. */ int res_prec = insn & 0x080; /* 1 = double, 0 = single. */ int piped = insn & 0x400; /* 1 = pipelined, 0 = scalar. */ @@ -3617,11 +3617,11 @@ void i860_cpu_device::insn_famov (UINT32 insn) /* Execute [p]fiadd/sub.{ss,dd} fsrc1,fsrc2,fdest. */ -void i860_cpu_device::insn_fiadd_sub (UINT32 insn) +void i860_cpu_device::insn_fiadd_sub (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int src_prec = insn & 0x100; /* 1 = double, 0 = single. */ int res_prec = insn & 0x080; /* 1 = double, 0 = single. */ int piped = insn & 0x400; /* 1 = pipelined, 0 = scalar. */ @@ -3643,9 +3643,9 @@ void i860_cpu_device::insn_fiadd_sub (UINT32 insn) { double v1 = get_fregval_d (fsrc1); double v2 = get_fregval_d (fsrc2); - UINT64 iv1 = *(UINT64 *)&v1; - UINT64 iv2 = *(UINT64 *)&v2; - UINT64 r; + uint64_t iv1 = *(uint64_t *)&v1; + uint64_t iv2 = *(uint64_t *)&v2; + uint64_t r; if (is_sub) r = iv1 - iv2; else @@ -3659,13 +3659,13 @@ void i860_cpu_device::insn_fiadd_sub (UINT32 insn) { float v1 = get_fregval_s (fsrc1); float v2 = get_fregval_s (fsrc2); - UINT64 iv1 = (UINT64)(*(UINT32 *)&v1); - UINT64 iv2 = (UINT64)(*(UINT32 *)&v2); - UINT32 r; + uint64_t iv1 = (uint64_t)(*(uint32_t *)&v1); + uint64_t iv2 = (uint64_t)(*(uint32_t *)&v2); + uint32_t r; if (is_sub) - r = (UINT32)(iv1 - iv2); + r = (uint32_t)(iv1 - iv2); else - r = (UINT32)(iv1 + iv2); + r = (uint32_t)(iv1 + iv2); if (res_prec) assert (0); /* .sd not allowed. */ else @@ -3717,11 +3717,11 @@ void i860_cpu_device::insn_fiadd_sub (UINT32 insn) /* Execute pf{gt,le,eq}.{ss,dd} fsrc1,fsrc2,fdest. Opcode pfgt has R bit cleared; pfle has R bit set. */ -void i860_cpu_device::insn_fcmp (UINT32 insn) +void i860_cpu_device::insn_fcmp (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int src_prec = insn & 0x100; /* 1 = double, 0 = single. */ double dbl_tmp_dest = 0.0; double sgl_tmp_dest = 0.0; @@ -3796,20 +3796,20 @@ void i860_cpu_device::insn_fcmp (UINT32 insn) /* Execute [p]fzchk{l,s} fsrc1,fsrc2,fdest. The fzchk instructions have S and R bits set. */ -void i860_cpu_device::insn_fzchk (UINT32 insn) +void i860_cpu_device::insn_fzchk (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int piped = insn & 0x400; /* 1 = pipelined, 0 = scalar. */ int is_fzchks = insn & 8; /* 1 = fzchks, 0 = fzchkl. */ double dbl_tmp_dest = 0.0; int i; double v1 = get_fregval_d (fsrc1); double v2 = get_fregval_d (fsrc2); - UINT64 iv1 = *(UINT64 *)&v1; - UINT64 iv2 = *(UINT64 *)&v2; - UINT64 r = 0; + uint64_t iv1 = *(uint64_t *)&v1; + uint64_t iv2 = *(uint64_t *)&v2; + uint64_t r = 0; char pm = GET_PSR_PM (); /* Check for S and R bits set. */ @@ -3827,16 +3827,16 @@ void i860_cpu_device::insn_fzchk (UINT32 insn) pm = (pm >> 4) & 0x0f; for (i = 3; i >= 0; i--) { - UINT16 ps1 = (iv1 >> (i * 16)) & 0xffff; - UINT16 ps2 = (iv2 >> (i * 16)) & 0xffff; + uint16_t ps1 = (iv1 >> (i * 16)) & 0xffff; + uint16_t ps2 = (iv2 >> (i * 16)) & 0xffff; if (ps2 <= ps1) { - r |= ((UINT64)ps2 << (i * 16)); + r |= ((uint64_t)ps2 << (i * 16)); pm |= (1 << (7 - (3 - i))); } else { - r |= ((UINT64)ps1 << (i * 16)); + r |= ((uint64_t)ps1 << (i * 16)); pm &= ~(1 << (7 - (3 - i))); } } @@ -3846,16 +3846,16 @@ void i860_cpu_device::insn_fzchk (UINT32 insn) pm = (pm >> 2) & 0x3f; for (i = 1; i >= 0; i--) { - UINT32 ps1 = (iv1 >> (i * 32)) & 0xffffffff; - UINT32 ps2 = (iv2 >> (i * 32)) & 0xffffffff; + uint32_t ps1 = (iv1 >> (i * 32)) & 0xffffffff; + uint32_t ps2 = (iv2 >> (i * 32)) & 0xffffffff; if (ps2 <= ps1) { - r |= ((UINT64)ps2 << (i * 32)); + r |= ((uint64_t)ps2 << (i * 32)); pm |= (1 << (7 - (1 - i))); } else { - r |= ((UINT64)ps1 << (i * 32)); + r |= ((uint64_t)ps1 << (i * 32)); pm &= ~(1 << (7 - (1 - i))); } } @@ -3892,14 +3892,14 @@ void i860_cpu_device::insn_fzchk (UINT32 insn) /* Execute [p]form.dd fsrc1,fdest. The form.dd instructions have S and R bits set. */ -void i860_cpu_device::insn_form (UINT32 insn) +void i860_cpu_device::insn_form (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fdest = get_fdest (insn); int piped = insn & 0x400; /* 1 = pipelined, 0 = scalar. */ double dbl_tmp_dest = 0.0; double v1 = get_fregval_d (fsrc1); - UINT64 iv1 = *(UINT64 *)&v1; + uint64_t iv1 = *(uint64_t *)&v1; /* Check for S and R bits set. */ if ((insn & 0x180) != 0x180) @@ -3938,18 +3938,18 @@ void i860_cpu_device::insn_form (UINT32 insn) /* Execute [p]faddp fsrc1,fsrc2,fdest. */ -void i860_cpu_device::insn_faddp (UINT32 insn) +void i860_cpu_device::insn_faddp (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int piped = insn & 0x400; /* 1 = pipelined, 0 = scalar. */ double dbl_tmp_dest = 0.0; double v1 = get_fregval_d (fsrc1); double v2 = get_fregval_d (fsrc2); - UINT64 iv1 = *(UINT64 *)&v1; - UINT64 iv2 = *(UINT64 *)&v2; - UINT64 r = 0; + uint64_t iv1 = *(uint64_t *)&v1; + uint64_t iv2 = *(uint64_t *)&v2; + uint64_t r = 0; int ps = GET_PSR_PS (); r = iv1 + iv2; @@ -4003,18 +4003,18 @@ void i860_cpu_device::insn_faddp (UINT32 insn) /* Execute [p]faddz fsrc1,fsrc2,fdest. */ -void i860_cpu_device::insn_faddz (UINT32 insn) +void i860_cpu_device::insn_faddz (uint32_t insn) { - UINT32 fsrc1 = get_fsrc1 (insn); - UINT32 fsrc2 = get_fsrc2 (insn); - UINT32 fdest = get_fdest (insn); + uint32_t fsrc1 = get_fsrc1 (insn); + uint32_t fsrc2 = get_fsrc2 (insn); + uint32_t fdest = get_fdest (insn); int piped = insn & 0x400; /* 1 = pipelined, 0 = scalar. */ double dbl_tmp_dest = 0.0; double v1 = get_fregval_d (fsrc1); double v2 = get_fregval_d (fsrc2); - UINT64 iv1 = *(UINT64 *)&v1; - UINT64 iv2 = *(UINT64 *)&v2; - UINT64 r = 0; + uint64_t iv1 = *(uint64_t *)&v1; + uint64_t iv2 = *(uint64_t *)&v2; + uint64_t r = 0; r = iv1 + iv2; dbl_tmp_dest = *(double *)&r; @@ -4283,7 +4283,7 @@ const i860_cpu_device::decode_tbl_t i860_cpu_device::fp_decode_tbl[128] = { * insn = instruction at the current PC to execute. * non_shadow = This insn is not in the shadow of a delayed branch). */ -void i860_cpu_device::decode_exec (UINT32 insn, UINT32 non_shadow) +void i860_cpu_device::decode_exec (uint32_t insn, uint32_t non_shadow) { int upper_6bits = (insn >> 26) & 0x3f; char flags = 0; @@ -4428,7 +4428,7 @@ void i860_cpu_device::execute_run() /* Decode and execute loop. */ while (m_icount > 0) { - UINT32 savepc = m_pc; + uint32_t savepc = m_pc; m_pc_updated = 0; m_pending_trap = 0; @@ -4507,14 +4507,14 @@ extern unsigned disasm_i860 (char *buf, unsigned int pc, unsigned int insn); /* Disassemble `len' instructions starting at `addr'. */ -void i860_cpu_device::disasm (UINT32 addr, int len) +void i860_cpu_device::disasm (uint32_t addr, int len) { - UINT32 insn; + uint32_t insn; int j; for (j = 0; j < len; j++) { char buf[256]; - UINT32 phys_addr = addr; + uint32_t phys_addr = addr; if (GET_DIRBASE_ATE ()) phys_addr = get_address_translation (addr, 1 /* is_dataref */, 0 /* is_write */); @@ -4537,9 +4537,9 @@ void i860_cpu_device::disasm (UINT32 addr, int len) /* Dump `len' bytes starting at `addr'. */ -void i860_cpu_device::dbg_db (UINT32 addr, int len) +void i860_cpu_device::dbg_db (uint32_t addr, int len) { - UINT8 b[16]; + uint8_t b[16]; int i; /* This will always dump a multiple of 16 bytes, even if 'len' isn't. */ while (len > 0) @@ -4549,7 +4549,7 @@ void i860_cpu_device::dbg_db (UINT32 addr, int len) fprintf (stderr, "0x%08x: ", addr); for (i = 0; i < 16; i++) { - UINT32 phys_addr = addr; + uint32_t phys_addr = addr; if (GET_DIRBASE_ATE ()) phys_addr = get_address_translation (addr, 1 /* is_dataref */, 0 /* is_write */); @@ -4575,8 +4575,8 @@ void i860_cpu_device::dbg_db (UINT32 addr, int len) void debugger (i860s *cpustate) { char buf[256]; - UINT32 curr_disasm = m_pc; - UINT32 curr_dumpdb = 0; + uint32_t curr_disasm = m_pc; + uint32_t curr_dumpdb = 0; int c = 0; if (m_single_stepping > 1 && m_single_stepping != m_pc) @@ -4658,7 +4658,7 @@ void debugger (i860s *cpustate) } else if (buf[0] == 'x' && buf[1] == '0') { - UINT32 v; + uint32_t v; sscanf (buf + 1, "%x", &v); if (GET_DIRBASE_ATE ()) fprintf (stderr, "vma 0x%08x ==> phys 0x%08x\n", v, diff --git a/src/devices/cpu/i860/i860dis.cpp b/src/devices/cpu/i860/i860dis.cpp index d35c3d33973..71f6469d282 100644 --- a/src/devices/cpu/i860/i860dis.cpp +++ b/src/devices/cpu/i860/i860dis.cpp @@ -33,9 +33,9 @@ static const char *const cr2str[] = /* Sign extend N-bit number. */ -static INT32 sign_ext(UINT32 x, int n) +static int32_t sign_ext(uint32_t x, int n) { - INT32 t; + int32_t t; t = x >> (n - 1); t = ((-t) << n) | x; return t; @@ -44,7 +44,7 @@ static INT32 sign_ext(UINT32 x, int n) /* Basic integer 3-address register format: * mnemonic %rs1,%rs2,%rd */ -static void int_12d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_12d(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { /* Possibly prefix shrd with 'd.' */ if (((insn & 0xfc000000) == 0xb0000000) && (insn & 0x200)) @@ -58,14 +58,14 @@ static void int_12d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Basic integer 3-address imm16 format: * mnemonic #imm16,%rs2,%rd */ -static void int_i2d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_i2d(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { /* Sign extend the 16-bit immediate. Print as hex for the bitwise operations. */ int upper_6bits = (insn >> 26) & 0x3f; if (upper_6bits >= 0x30 && upper_6bits <= 0x3f) sprintf(buf, "%s\t0x%04x,%%r%d,%%r%d", mnemonic, - (UINT32)(get_imm16 (insn)), get_isrc2 (insn), get_idest (insn)); + (uint32_t)(get_imm16 (insn)), get_isrc2 (insn), get_idest (insn)); else sprintf(buf, "%s\t%d,%%r%d,%%r%d", mnemonic, sign_ext(get_imm16 (insn), 16), get_isrc2 (insn), get_idest (insn)); @@ -73,21 +73,21 @@ static void int_i2d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Integer (mixed) 2-address isrc1ni,fdest. */ -static void int_1d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_1d(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { sprintf(buf, "%s\t%%r%d,%%f%d", mnemonic, get_isrc1 (insn), get_fdest (insn)); } /* Integer (mixed) 2-address csrc2,idest. */ -static void int_cd(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_cd(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { sprintf(buf, "%s\t%%%s,%%r%d", mnemonic, cr2str[get_creg (insn)], get_idest (insn)); } /* Integer (mixed) 2-address isrc1,csrc2. */ -static void int_1c(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_1c(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { sprintf(buf, "%s\t%%r%d,%%%s", mnemonic, get_isrc1(insn), cr2str[get_creg (insn)]); } @@ -95,7 +95,7 @@ static void int_1c(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Integer 1-address register format: * mnemonic %rs1 */ -static void int_1(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_1(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { sprintf(buf, "%s\t%%r%d", mnemonic, get_isrc1 (insn)); } @@ -103,7 +103,7 @@ static void int_1(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Integer no-address register format: * mnemonic */ -static void int_0(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_0(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { sprintf(buf, "%s", mnemonic); } @@ -111,7 +111,7 @@ static void int_0(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Basic floating-point 3-address register format: * mnemonic %fs1,%fs2,%fd */ -static void flop_12d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void flop_12d(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { const char *const suffix[4] = { "ss", "sd", "ds", "dd" }; const char *prefix_d, *prefix_p; @@ -165,7 +165,7 @@ static void flop_12d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Floating-point 2-address register format: * mnemonic %fs1,%fd */ -static void flop_1d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void flop_1d(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { const char *const suffix[4] = { "ss", "sd", "ds", "dd" }; const char *prefix_d, *prefix_p; @@ -179,7 +179,7 @@ static void flop_1d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Floating-point 2-address register format: * mnemonic %fs2,%fd */ -static void flop_2d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void flop_2d(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { const char *const suffix[4] = { "ss", "sd", "ds", "dd" }; const char *prefix_d; @@ -192,7 +192,7 @@ static void flop_2d(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Floating-point (mixed) 2-address register format: * fxfr fsrc1,idest. */ -static void flop_fxfr(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void flop_fxfr(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { const char *prefix_d = (insn & 0x200) ? "d." : ""; sprintf(buf, "%s%s\t%%f%d,%%r%d", prefix_d, mnemonic, get_fsrc1 (insn), @@ -202,48 +202,48 @@ static void flop_fxfr(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Branch with reg,reg,sbroff format: * mnemonic %rs1,%rs2,sbroff */ -static void int_12S(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_12S(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { - INT32 sbroff = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); - INT32 rel = (INT32)pc + (sbroff << 2) + 4; + int32_t sbroff = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); + int32_t rel = (int32_t)pc + (sbroff << 2) + 4; sprintf(buf, "%s\t%%r%d,%%r%d,0x%08x", mnemonic, get_isrc1 (insn), - get_isrc2 (insn), (UINT32)rel); + get_isrc2 (insn), (uint32_t)rel); } /* Branch with #const5,reg,sbroff format: * mnemonic #const5,%rs2,sbroff */ -static void int_i2S(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_i2S(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { - INT32 sbroff = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); - INT32 rel = (INT32)pc + (sbroff << 2) + 4; + int32_t sbroff = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); + int32_t rel = (int32_t)pc + (sbroff << 2) + 4; sprintf(buf, "%s\t%d,%%r%d,0x%08x", mnemonic, ((insn >> 11) & 0x1f), - get_isrc2 (insn), (UINT32)rel); + get_isrc2 (insn), (uint32_t)rel); } /* Branch with lbroff format: * mnemonic lbroff */ -static void int_L(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_L(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { - INT32 lbroff = sign_ext ((insn & 0x03ffffff), 26); - INT32 rel = (INT32)pc + (lbroff << 2) + 4; + int32_t lbroff = sign_ext ((insn & 0x03ffffff), 26); + int32_t rel = (int32_t)pc + (lbroff << 2) + 4; - sprintf(buf, "%s\t0x%08x", mnemonic, (UINT32)rel); + sprintf(buf, "%s\t0x%08x", mnemonic, (uint32_t)rel); } /* Integer load. * ld.{b,s,l} isrc1(isrc2),idest * ld.{b,s,l} #const(isrc2),idest */ -static void int_ldx(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_ldx(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { /* Operand size, in bytes. */ int sizes[4] = { 1, 1, 2, 4 }; const char *const suffix[4] = { "b", "b", "s", "l" }; - UINT32 idx; + uint32_t idx; /* Bits 28 and 0 determine the operand size. */ idx = ((insn >> 27) & 2) | (insn & 1); @@ -252,7 +252,7 @@ static void int_ldx(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) if (insn & 0x04000000) { /* Chop off lower bits of displacement. */ - INT32 immsrc1 = sign_ext (get_imm16 (insn), 16); + int32_t immsrc1 = sign_ext (get_imm16 (insn), 16); int size = sizes[idx]; immsrc1 &= ~(size - 1); sprintf(buf, "%s%s\t%d(%%r%d),%%r%d", mnemonic, suffix[idx], @@ -265,14 +265,14 @@ static void int_ldx(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* Integer store: st.b isrc1ni,#const(isrc2) */ -static void int_stx(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_stx(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { /* Operand size, in bytes. */ int sizes[4] = { 1, 1, 2, 4 }; const char *const suffix[4] = { "b", "b", "s", "l" }; int idx; int size; - INT32 immsrc = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); + int32_t immsrc = sign_ext ((((insn >> 5) & 0xf800) | (insn & 0x07ff)), 16); /* Bits 28 and 0 determine the operand size. */ idx = ((insn >> 27) & 2) | (insn & 1); @@ -291,9 +291,9 @@ static void int_stx(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) * "fst.y fdest,isrc1(isrc2)", "fst.y fdest,isrc1(isrc2)++", * "fst.y fdest,#const(isrc2)" or "fst.y fdest,#const(isrc2)++" * Where y = {l,d,q}. Note, there is no pfld.q, though. */ -static void int_fldst(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_fldst(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { - INT32 immsrc1 = sign_ext (get_imm16 (insn), 16); + int32_t immsrc1 = sign_ext (get_imm16 (insn), 16); /* Operand size, in bytes. */ int sizes[4] = { 8, 4, 16, 4 }; const char *const suffix[4] = { "d", "l", "q", "l" }; @@ -353,10 +353,10 @@ static void int_fldst(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) /* flush #const(isrc2)[++]. */ -static void int_flush(char *buf, char *mnemonic, UINT32 pc, UINT32 insn) +static void int_flush(char *buf, char *mnemonic, uint32_t pc, uint32_t insn) { const char *const auto_suff[2] = { "", "++" }; - INT32 immsrc = sign_ext (get_imm16 (insn), 16); + int32_t immsrc = sign_ext (get_imm16 (insn), 16); immsrc &= ~(16-1); sprintf(buf, "%s\t%d(%%r%d)%s", mnemonic, immsrc, get_isrc2 (insn), auto_suff[(insn & 1)]); @@ -375,7 +375,7 @@ struct decode_tbl_t { /* Disassembly function for this opcode. Call with buffer, mnemonic, pc, insn. */ - void (*insn_dis)(char *, char *, UINT32, UINT32); + void (*insn_dis)(char *, char *, uint32_t, uint32_t); /* Flags for this opcode. */ char flags; @@ -645,7 +645,7 @@ static void i860_dasm_tab_replacer(char* buf, int tab_size) CPU_DISASSEMBLE( i860 ) { - UINT32 insn = (oprom[0] << 0) | + uint32_t insn = (oprom[0] << 0) | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); diff --git a/src/devices/cpu/i960/i960.cpp b/src/devices/cpu/i960/i960.cpp index 3e74c2e676a..4be6f937e42 100644 --- a/src/devices/cpu/i960/i960.cpp +++ b/src/devices/cpu/i960/i960.cpp @@ -16,7 +16,7 @@ CPU_DISASSEMBLE( i960 ); const device_type I960 = &device_creator; -i960_cpu_device::i960_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i960_cpu_device::i960_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, I960, "i960kb", tag, owner, clock, "i960kb", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0), m_rcache_pos(0), m_SAT(0), m_PRCB(0), m_PC(0), m_AC(0), m_IP(0), m_PIP(0), m_ICR(0), m_bursting(0), m_immediate_irq(0), m_immediate_vector(0), m_immediate_pri(0), m_program(nullptr), m_direct(nullptr), m_icount(0) @@ -24,7 +24,7 @@ i960_cpu_device::i960_cpu_device(const machine_config &mconfig, const char *tag, } -UINT32 i960_cpu_device::i960_read_dword_unaligned(UINT32 address) +uint32_t i960_cpu_device::i960_read_dword_unaligned(uint32_t address) { if (!DWORD_ALIGNED(address)) return m_program->read_byte(address) | m_program->read_byte(address+1)<<8 | m_program->read_byte(address+2)<<16 | m_program->read_byte(address+3)<<24; @@ -32,7 +32,7 @@ UINT32 i960_cpu_device::i960_read_dword_unaligned(UINT32 address) return m_program->read_dword(address); } -UINT16 i960_cpu_device::i960_read_word_unaligned(UINT32 address) +uint16_t i960_cpu_device::i960_read_word_unaligned(uint32_t address) { if (!WORD_ALIGNED(address)) return m_program->read_byte(address) | m_program->read_byte(address+1)<<8; @@ -40,7 +40,7 @@ UINT16 i960_cpu_device::i960_read_word_unaligned(UINT32 address) return m_program->read_word(address); } -void i960_cpu_device::i960_write_dword_unaligned(UINT32 address, UINT32 data) +void i960_cpu_device::i960_write_dword_unaligned(uint32_t address, uint32_t data) { if (!DWORD_ALIGNED(address)) { @@ -55,7 +55,7 @@ void i960_cpu_device::i960_write_dword_unaligned(UINT32 address, UINT32 data) } } -void i960_cpu_device::i960_write_word_unaligned(UINT32 address, UINT16 data) +void i960_cpu_device::i960_write_word_unaligned(uint32_t address, uint16_t data) { if (!WORD_ALIGNED(address)) { @@ -68,9 +68,9 @@ void i960_cpu_device::i960_write_word_unaligned(UINT32 address, UINT16 data) } } -void i960_cpu_device::send_iac(UINT32 adr) +void i960_cpu_device::send_iac(uint32_t adr) { - UINT32 iac[4]; + uint32_t iac[4]; iac[0] = m_program->read_dword(adr); iac[1] = m_program->read_dword(adr+4); iac[2] = m_program->read_dword(adr+8); @@ -87,11 +87,11 @@ void i960_cpu_device::send_iac(UINT32 adr) } } -UINT32 i960_cpu_device::get_ea(UINT32 opcode) +uint32_t i960_cpu_device::get_ea(uint32_t opcode) { int abase = (opcode >> 14) & 0x1f; if(!(opcode & 0x00001000)) { // MEMA - UINT32 offset = opcode & 0x1fff; + uint32_t offset = opcode & 0x1fff; if(!(opcode & 0x2000)) return offset; else @@ -100,7 +100,7 @@ UINT32 i960_cpu_device::get_ea(UINT32 opcode) int index = opcode & 0x1f; int scale = (opcode >> 7) & 0x7; int mode = (opcode >> 10) & 0xf; - UINT32 ret; + uint32_t ret; switch(mode) { case 0x4: @@ -135,7 +135,7 @@ UINT32 i960_cpu_device::get_ea(UINT32 opcode) } } -UINT32 i960_cpu_device::get_1_ri(UINT32 opcode) +uint32_t i960_cpu_device::get_1_ri(uint32_t opcode) { if(!(opcode & 0x00000800)) return m_r[opcode & 0x1f]; @@ -143,7 +143,7 @@ UINT32 i960_cpu_device::get_1_ri(UINT32 opcode) return opcode & 0x1f; } -UINT32 i960_cpu_device::get_2_ri(UINT32 opcode) +uint32_t i960_cpu_device::get_2_ri(uint32_t opcode) { if(!(opcode & 0x00001000)) return m_r[(opcode>>14) & 0x1f]; @@ -151,15 +151,15 @@ UINT32 i960_cpu_device::get_2_ri(UINT32 opcode) return (opcode>>14) & 0x1f; } -UINT64 i960_cpu_device::get_2_ri64(UINT32 opcode) +uint64_t i960_cpu_device::get_2_ri64(uint32_t opcode) { if(!(opcode & 0x00001000)) - return m_r[(opcode>>14) & 0x1f] | ((UINT64)m_r[((opcode>>14) & 0x1f)+1]<<32); + return m_r[(opcode>>14) & 0x1f] | ((uint64_t)m_r[((opcode>>14) & 0x1f)+1]<<32); else return (opcode>>14) & 0x1f; } -void i960_cpu_device::set_ri(UINT32 opcode, UINT32 val) +void i960_cpu_device::set_ri(uint32_t opcode, uint32_t val) { if(!(opcode & 0x00002000)) m_r[(opcode>>19) & 0x1f] = val; @@ -168,7 +168,7 @@ void i960_cpu_device::set_ri(UINT32 opcode, UINT32 val) } } -void i960_cpu_device::set_ri2(UINT32 opcode, UINT32 val, UINT32 val2) +void i960_cpu_device::set_ri2(uint32_t opcode, uint32_t val, uint32_t val2) { if(!(opcode & 0x00002000)) { @@ -180,7 +180,7 @@ void i960_cpu_device::set_ri2(UINT32 opcode, UINT32 val, UINT32 val2) } } -void i960_cpu_device::set_ri64(UINT32 opcode, UINT64 val) +void i960_cpu_device::set_ri64(uint32_t opcode, uint64_t val) { if(!(opcode & 0x00002000)) { m_r[(opcode>>19) & 0x1f] = val; @@ -189,7 +189,7 @@ void i960_cpu_device::set_ri64(UINT32 opcode, UINT64 val) fatalerror("I960: %x: set_ri64 on literal?\n", m_PIP); } -double i960_cpu_device::get_1_rif(UINT32 opcode) +double i960_cpu_device::get_1_rif(uint32_t opcode) { if(!(opcode & 0x00000800)) return u2f(m_r[opcode & 0x1f]); @@ -203,7 +203,7 @@ double i960_cpu_device::get_1_rif(UINT32 opcode) } } -double i960_cpu_device::get_2_rif(UINT32 opcode) +double i960_cpu_device::get_2_rif(uint32_t opcode) { if(!(opcode & 0x00001000)) return u2f(m_r[(opcode>>14) & 0x1f]); @@ -217,7 +217,7 @@ double i960_cpu_device::get_2_rif(UINT32 opcode) } } -void i960_cpu_device::set_rif(UINT32 opcode, double val) +void i960_cpu_device::set_rif(uint32_t opcode, double val) { if(!(opcode & 0x00002000)) m_r[(opcode>>19) & 0x1f] = f2u(val); @@ -227,11 +227,11 @@ void i960_cpu_device::set_rif(UINT32 opcode, double val) fatalerror("I960: %x: set_rif on literal?\n", m_PIP); } -double i960_cpu_device::get_1_rifl(UINT32 opcode) +double i960_cpu_device::get_1_rifl(uint32_t opcode) { if(!(opcode & 0x00000800)) { - UINT64 v = m_r[opcode & 0x1e]; - v |= ((UINT64)(m_r[(opcode & 0x1e)+1]))<<32; + uint64_t v = m_r[opcode & 0x1e]; + v |= ((uint64_t)(m_r[(opcode & 0x1e)+1]))<<32; return u2d(v); } else { int idx = opcode & 0x1f; @@ -243,11 +243,11 @@ double i960_cpu_device::get_1_rifl(UINT32 opcode) } } -double i960_cpu_device::get_2_rifl(UINT32 opcode) +double i960_cpu_device::get_2_rifl(uint32_t opcode) { if(!(opcode & 0x00001000)) { - UINT64 v = m_r[(opcode >> 14) & 0x1e]; - v |= ((UINT64)(m_r[((opcode>>14) & 0x1e)+1]))<<32; + uint64_t v = m_r[(opcode >> 14) & 0x1e]; + v |= ((uint64_t)(m_r[((opcode>>14) & 0x1e)+1]))<<32; return u2d(v); } else { int idx = (opcode>>14) & 0x1f; @@ -259,10 +259,10 @@ double i960_cpu_device::get_2_rifl(UINT32 opcode) } } -void i960_cpu_device::set_rifl(UINT32 opcode, double val) +void i960_cpu_device::set_rifl(uint32_t opcode, double val) { if(!(opcode & 0x00002000)) { - UINT64 v = d2u(val); + uint64_t v = d2u(val); m_r[(opcode>>19) & 0x1e] = v; m_r[((opcode>>19) & 0x1e)+1] = v>>32; } else if(!(opcode & 0x00e00000)) @@ -271,7 +271,7 @@ void i960_cpu_device::set_rifl(UINT32 opcode, double val) fatalerror("I960: %x: set_rifl on literal?\n", m_PIP); } -UINT32 i960_cpu_device::get_1_ci(UINT32 opcode) +uint32_t i960_cpu_device::get_1_ci(uint32_t opcode) { if(!(opcode & 0x00002000)) return m_r[(opcode >> 19) & 0x1f]; @@ -279,30 +279,30 @@ UINT32 i960_cpu_device::get_1_ci(UINT32 opcode) return (opcode >> 19) & 0x1f; } -UINT32 i960_cpu_device::get_2_ci(UINT32 opcode) +uint32_t i960_cpu_device::get_2_ci(uint32_t opcode) { return m_r[(opcode >> 14) & 0x1f]; } -UINT32 i960_cpu_device::get_disp(UINT32 opcode) +uint32_t i960_cpu_device::get_disp(uint32_t opcode) { - UINT32 disp; + uint32_t disp; disp = opcode & 0xffffff; if(disp & 0x00800000) disp |= 0xff000000; return disp-4; } -UINT32 i960_cpu_device::get_disp_s(UINT32 opcode) +uint32_t i960_cpu_device::get_disp_s(uint32_t opcode) { - UINT32 disp; + uint32_t disp; disp = opcode & 0x1fff; if(disp & 0x00001000) disp |= 0xffffe000; return disp-4; } -void i960_cpu_device::cmp_s(INT32 v1, INT32 v2) +void i960_cpu_device::cmp_s(int32_t v1, int32_t v2) { m_AC &= ~7; if(v1>19) & 0x1f] = 1; @@ -382,7 +382,7 @@ void i960_cpu_device::take_interrupt(int vector, int lvl) int int_tab = m_program->read_dword(m_PRCB+20); // interrupt table int int_SP = m_program->read_dword(m_PRCB+24); // interrupt stack int SP; - UINT32 IRQV; + uint32_t IRQV; IRQV = m_program->read_dword(int_tab + 36 + (vector-8)*4); @@ -419,7 +419,7 @@ void i960_cpu_device::check_irqs() int pending_pri; int lvl, irq, take = -1; int vword; - static const UINT32 lvlmask[4] = { 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }; + static const uint32_t lvlmask[4] = { 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }; pending_pri = m_program->read_dword(int_tab); // read pending priorities @@ -477,10 +477,10 @@ void i960_cpu_device::check_irqs() } } -void i960_cpu_device::do_call(UINT32 adr, int type, UINT32 stack) +void i960_cpu_device::do_call(uint32_t adr, int type, uint32_t stack) { int i; - UINT32 FP; + uint32_t FP; // call and callx take 9 cycles base m_icount -= 9; @@ -499,7 +499,7 @@ void i960_cpu_device::do_call(UINT32 adr, int type, UINT32 stack) } else // a cache entry is available, use it { - memcpy(&m_rcache[m_rcache_pos][0], m_r, 0x10 * sizeof(UINT32)); + memcpy(&m_rcache[m_rcache_pos][0], m_r, 0x10 * sizeof(uint32_t)); m_rcache_frame_addr[m_rcache_pos] = m_r[I960_FP] & ~0x3f; } m_rcache_pos++; @@ -542,7 +542,7 @@ void i960_cpu_device::do_ret_0() } else { - memcpy(m_r, m_rcache[m_rcache_pos], 0x10*sizeof(UINT32)); + memcpy(m_r, m_rcache[m_rcache_pos], 0x10*sizeof(uint32_t)); } // osd_printf_debug("RET (type %d): FP %x, %x => %x, rcache_pos %d\n", type, m_r[I960_FP], m_IP, m_r[I960_RIP], m_rcache_pos); @@ -551,7 +551,7 @@ void i960_cpu_device::do_ret_0() void i960_cpu_device::do_ret() { - UINT32 x, y; + uint32_t x, y; m_icount -= 7; switch(m_r[I960_PFP] & 7) { case 0: @@ -575,9 +575,9 @@ void i960_cpu_device::do_ret() } } -void i960_cpu_device::execute_op(UINT32 opcode) +void i960_cpu_device::execute_op(uint32_t opcode) { - UINT32 t1, t2; + uint32_t t1, t2; double t1f, t2f; switch(opcode >> 24) { @@ -960,11 +960,11 @@ void i960_cpu_device::execute_op(UINT32 opcode) m_icount--; t1 = get_1_ri(opcode); t2 = get_2_ri(opcode); - if(((INT32)t2) < 0) { + if(((int32_t)t2) < 0) { if(t2 & ((1<>t1)+1); + set_ri(opcode, (((int32_t)t2)>>t1)+1); else - set_ri(opcode, ((INT32)t2)>>t1); + set_ri(opcode, ((int32_t)t2)>>t1); } else set_ri(opcode, t2>>t1); break; @@ -973,7 +973,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) m_icount--; t1 = get_1_ri(opcode); t2 = get_2_ri(opcode); - set_ri(opcode, ((INT32)t2)>>t1); + set_ri(opcode, ((int32_t)t2)>>t1); break; case 0xc: // shlo @@ -1088,7 +1088,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) switch((opcode >> 7) & 0xf) { case 0x0: // addc { - UINT64 res; + uint64_t res; m_icount -= 2; t1 = get_1_ri(opcode); @@ -1098,7 +1098,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) m_AC &= ~0x3; // clear C and V // set carry - m_AC |= ((res) & (((UINT64)1) << 32)) ? 0x2 : 0; + m_AC |= ((res) & (((uint64_t)1) << 32)) ? 0x2 : 0; // set overflow m_AC |= (((res) ^ (t1)) & ((res) ^ (t2)) & 0x80000000) ? 1: 0; } @@ -1106,7 +1106,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 0x2: // subc { - UINT64 res; + uint64_t res; m_icount -= 2; t1 = get_1_ri(opcode); @@ -1116,7 +1116,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) m_AC &= ~0x3; // clear C and V // set carry - m_AC |= ((res) & (((UINT64)1) << 32)) ? 0x2 : 0; + m_AC |= ((res) & (((uint64_t)1) << 32)) ? 0x2 : 0; // set overflow m_AC |= (((t2) ^ (t1)) & ((t2) ^ (res)) & 0x80000000) ? 1 : 0; } @@ -1149,7 +1149,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) t1 = opcode & 0x1f; m_r[t2] = m_r[t2+1] = t1; } else - memcpy(m_r+t2, m_r+(opcode & 0x1f), 2*sizeof(UINT32)); + memcpy(m_r+t2, m_r+(opcode & 0x1f), 2*sizeof(uint32_t)); break; default: @@ -1166,7 +1166,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) t1 = opcode & 0x1f; m_r[t2] = m_r[t2+1] = m_r[t2+2]= t1; } else - memcpy(m_r+t2, m_r+(opcode & 0x1f), 3*sizeof(UINT32)); + memcpy(m_r+t2, m_r+(opcode & 0x1f), 3*sizeof(uint32_t)); break; default: @@ -1183,7 +1183,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) t1 = opcode & 0x1f; m_r[t2] = m_r[t2+1] = m_r[t2+2] = m_r[t2+3] = t1; } else - memcpy(m_r+t2, m_r+(opcode & 0x1f), 4*sizeof(UINT32)); + memcpy(m_r+t2, m_r+(opcode & 0x1f), 4*sizeof(uint32_t)); break; default: @@ -1229,7 +1229,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) switch((opcode >> 7) & 0xf) { case 0x0: // spanbit { - UINT32 res = 0xffffffff; + uint32_t res = 0xffffffff; int i; m_icount -= 10; @@ -1253,7 +1253,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 0x1: // scanbit { - UINT32 res = 0xffffffff; + uint32_t res = 0xffffffff; int i; m_icount -= 10; @@ -1316,7 +1316,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) for (i = 0; i < 0x10; i++) { - m_program->write_dword(m_rcache_frame_addr[t1] + (i * sizeof(UINT32)), m_rcache[t1][i]); + m_program->write_dword(m_rcache_frame_addr[t1] + (i * sizeof(uint32_t)), m_rcache[t1][i]); } } m_rcache_pos = 0; @@ -1334,13 +1334,13 @@ void i960_cpu_device::execute_op(UINT32 opcode) t1 = get_1_ri(opcode); t2 = get_2_ri(opcode); - set_ri64(opcode, (INT64)t1 * (INT64)t2); + set_ri64(opcode, (int64_t)t1 * (int64_t)t2); break; case 0x1: // ediv m_icount -= 37; { - UINT64 src1, src2; + uint64_t src1, src2; src1 = get_1_ri(opcode); src2 = get_2_ri64(opcode); @@ -1352,27 +1352,27 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 0x4: // cvtir m_icount -= 30; t1 = get_1_ri(opcode); - set_rif(opcode, (double)(INT32)t1); + set_rif(opcode, (double)(int32_t)t1); break; case 0x5: // cvtilr m_icount -= 30; t1 = get_1_ri(opcode); - set_rifl(opcode, (double)(INT32)t1); + set_rifl(opcode, (double)(int32_t)t1); break; case 0x6: // scalerl m_icount -= 30; t1 = get_1_ri(opcode); t2f = get_2_rifl(opcode); - set_rifl(opcode, t2f * pow(2.0, (double)(INT32)t1)); + set_rifl(opcode, t2f * pow(2.0, (double)(int32_t)t1)); break; case 0x7: // scaler m_icount -= 30; t1 = get_1_ri(opcode); t2f = get_2_rif(opcode); - set_rif(opcode, t2f * pow(2.0, (double)(INT32)t1)); + set_rif(opcode, t2f * pow(2.0, (double)(int32_t)t1)); break; default: @@ -1424,7 +1424,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 0xb: // roundr { - INT32 st1 = get_1_rif(opcode); + int32_t st1 = get_1_rif(opcode); m_icount -= 69; set_rif(opcode, (double)st1); } @@ -1495,7 +1495,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 0xb: // roundrl { - INT32 st1 = get_1_rifl(opcode); + int32_t st1 = get_1_rifl(opcode); m_icount -= 70; set_rifl(opcode, (double)st1); } @@ -1539,19 +1539,19 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 2: t2f = ceil(t1f); break; case 3: t2f = t1f; break; } - set_ri(opcode, (INT32)t2f); + set_ri(opcode, (int32_t)t2f); break; case 0x2: // cvtzri m_icount -= 43; t1f = get_1_rif(opcode); - set_ri(opcode, (INT32)t1f); + set_ri(opcode, (int32_t)t1f); break; case 0x3: // cvtzril m_icount -= 44; t1f = get_1_rif(opcode); - set_ri64(opcode, (INT64)t1f); + set_ri64(opcode, (int64_t)t1f); break; case 0x9: // movr @@ -1582,22 +1582,22 @@ void i960_cpu_device::execute_op(UINT32 opcode) switch((opcode >> 7) & 0xf) { case 0x1: // movre { - UINT32 *src=nullptr, *dst=nullptr; + uint32_t *src=nullptr, *dst=nullptr; m_icount -= 8; if(!(opcode & 0x00000800)) { - src = (UINT32 *)&m_r[opcode & 0x1e]; + src = (uint32_t *)&m_r[opcode & 0x1e]; } else { int idx = opcode & 0x1f; if(idx < 4) - src = (UINT32 *)&m_fp[idx]; + src = (uint32_t *)&m_fp[idx]; } if(!(opcode & 0x00002000)) { - dst = (UINT32 *)&m_r[(opcode>>19) & 0x1e]; + dst = (uint32_t *)&m_r[(opcode>>19) & 0x1e]; } else if(!(opcode & 0x00e00000)) - dst = (UINT32 *)&m_fp[(opcode>>19) & 3]; + dst = (uint32_t *)&m_fp[(opcode>>19) & 3]; dst[0] = src[0]; dst[1] = src[1]; @@ -1656,21 +1656,21 @@ void i960_cpu_device::execute_op(UINT32 opcode) m_icount -= 18; t1 = get_1_ri(opcode); t2 = get_2_ri(opcode); - set_ri(opcode, ((INT32)t2)*((INT32)t1)); + set_ri(opcode, ((int32_t)t2)*((int32_t)t1)); break; case 0x8: // remi m_icount -= 37; t1 = get_1_ri(opcode); t2 = get_2_ri(opcode); - set_ri(opcode, ((INT32)t2)%((INT32)t1)); + set_ri(opcode, ((int32_t)t2)%((int32_t)t1)); break; case 0x9:{// modi - INT32 src1, src2, dst; + int32_t src1, src2, dst; m_icount -= 37; - src1 = (INT32)get_1_ri(opcode); - src2 = (INT32)get_2_ri(opcode); + src1 = (int32_t)get_1_ri(opcode); + src2 = (int32_t)get_2_ri(opcode); dst = src2 - ((src2/src1)*src1); if(((src2*src1) < 0) && (dst != 0)) dst += src1; @@ -1682,7 +1682,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) m_icount -= 37; t1 = get_1_ri(opcode); t2 = get_2_ri(opcode); - set_ri(opcode, ((INT32)t2)/((INT32)t1)); + set_ri(opcode, ((int32_t)t2)/((int32_t)t1)); break; default: @@ -1898,7 +1898,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 0xc0: // ldib m_icount -= 4; - m_r[(opcode>>19)&0x1f] = (INT8)m_program->read_byte(get_ea(opcode)); + m_r[(opcode>>19)&0x1f] = (int8_t)m_program->read_byte(get_ea(opcode)); break; case 0xc2: // stib @@ -1908,7 +1908,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) case 0xc8: // ldis m_icount -= 4; - m_r[(opcode>>19)&0x1f] = (INT16)i960_read_word_unaligned(get_ea(opcode)); + m_r[(opcode>>19)&0x1f] = (int16_t)i960_read_word_unaligned(get_ea(opcode)); break; case 0xca: // stis @@ -1924,7 +1924,7 @@ void i960_cpu_device::execute_op(UINT32 opcode) void i960_cpu_device::execute_run() { - UINT32 opcode; + uint32_t opcode; check_irqs(); while(m_icount > 0) { @@ -1946,7 +1946,7 @@ void i960_cpu_device::execute_set_input(int irqline, int state) int cpu_pri = (m_PC>>16)&0x1f; int vector =0; int priority; - UINT32 pend, word, wordofs; + uint32_t pend, word, wordofs; // We support the 4 external IRQ lines in "normal" mode only. // The i960's interrupt support is a bit more complete than that, @@ -2117,7 +2117,7 @@ void i960_cpu_device::device_reset() } -offs_t i960_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i960_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i960 ); return CPU_DISASSEMBLE_NAME(i960)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/i960/i960.h b/src/devices/cpu/i960/i960.h index 3f26fbb46d1..a7ebe01bfd0 100644 --- a/src/devices/cpu/i960/i960.h +++ b/src/devices/cpu/i960/i960.h @@ -70,7 +70,7 @@ class i960_cpu_device : public cpu_device { public: // construction/destruction - i960_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i960_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // call from any read/write handler for a memory area that can't be bursted // on the real hardware (e.g. Model 2's interrupt control registers) @@ -84,10 +84,10 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } /* ???? TODO: Exact timing unknown */ - virtual UINT32 execute_max_cycles() const override { return 1; } /* ???? TODO: Exact timing unknown */ - virtual UINT32 execute_input_lines() const override { return 4; } - virtual UINT32 execute_default_irq_vector() const override { return 0xffffffff; } + virtual uint32_t execute_min_cycles() const override { return 1; } /* ???? TODO: Exact timing unknown */ + virtual uint32_t execute_max_cycles() const override { return 1; } /* ???? TODO: Exact timing unknown */ + virtual uint32_t execute_input_lines() const override { return 4; } + virtual uint32_t execute_default_irq_vector() const override { return 0xffffffff; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -98,29 +98,29 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; - UINT32 m_r[0x20]; - UINT32 m_rcache[I960_RCACHE_SIZE][0x10]; - UINT32 m_rcache_frame_addr[I960_RCACHE_SIZE]; + uint32_t m_r[0x20]; + uint32_t m_rcache[I960_RCACHE_SIZE][0x10]; + uint32_t m_rcache_frame_addr[I960_RCACHE_SIZE]; // rcache_pos = how deep in the stack we are. 0-(I960_RCACHE_SIZE-1) means in-cache. // I960_RCACHE_SIZE or greater means out of cache, must save to memory. - INT32 m_rcache_pos; + int32_t m_rcache_pos; double m_fp[4]; - UINT32 m_SAT; - UINT32 m_PRCB; - UINT32 m_PC; - UINT32 m_AC; - UINT32 m_IP; - UINT32 m_PIP; - UINT32 m_ICR; + uint32_t m_SAT; + uint32_t m_PRCB; + uint32_t m_PC; + uint32_t m_AC; + uint32_t m_IP; + uint32_t m_PIP; + uint32_t m_ICR; int m_bursting; int m_immediate_irq; @@ -132,40 +132,40 @@ private: int m_icount; - UINT32 i960_read_dword_unaligned(UINT32 address); - UINT16 i960_read_word_unaligned(UINT32 address); - void i960_write_dword_unaligned(UINT32 address, UINT32 data); - void i960_write_word_unaligned(UINT32 address, UINT16 data); - void send_iac(UINT32 adr); - UINT32 get_ea(UINT32 opcode); - UINT32 get_1_ri(UINT32 opcode); - UINT32 get_2_ri(UINT32 opcode); - UINT64 get_2_ri64(UINT32 opcode); - void set_ri(UINT32 opcode, UINT32 val); - void set_ri2(UINT32 opcode, UINT32 val, UINT32 val2); - void set_ri64(UINT32 opcode, UINT64 val); - double get_1_rif(UINT32 opcode); - double get_2_rif(UINT32 opcode); - void set_rif(UINT32 opcode, double val); - double get_1_rifl(UINT32 opcode); - double get_2_rifl(UINT32 opcode); - void set_rifl(UINT32 opcode, double val); - UINT32 get_1_ci(UINT32 opcode); - UINT32 get_2_ci(UINT32 opcode); - UINT32 get_disp(UINT32 opcode); - UINT32 get_disp_s(UINT32 opcode); - void cmp_s(INT32 v1, INT32 v2); - void cmp_u(UINT32 v1, UINT32 v2); - void concmp_s(INT32 v1, INT32 v2); - void concmp_u(UINT32 v1, UINT32 v2); + uint32_t i960_read_dword_unaligned(uint32_t address); + uint16_t i960_read_word_unaligned(uint32_t address); + void i960_write_dword_unaligned(uint32_t address, uint32_t data); + void i960_write_word_unaligned(uint32_t address, uint16_t data); + void send_iac(uint32_t adr); + uint32_t get_ea(uint32_t opcode); + uint32_t get_1_ri(uint32_t opcode); + uint32_t get_2_ri(uint32_t opcode); + uint64_t get_2_ri64(uint32_t opcode); + void set_ri(uint32_t opcode, uint32_t val); + void set_ri2(uint32_t opcode, uint32_t val, uint32_t val2); + void set_ri64(uint32_t opcode, uint64_t val); + double get_1_rif(uint32_t opcode); + double get_2_rif(uint32_t opcode); + void set_rif(uint32_t opcode, double val); + double get_1_rifl(uint32_t opcode); + double get_2_rifl(uint32_t opcode); + void set_rifl(uint32_t opcode, double val); + uint32_t get_1_ci(uint32_t opcode); + uint32_t get_2_ci(uint32_t opcode); + uint32_t get_disp(uint32_t opcode); + uint32_t get_disp_s(uint32_t opcode); + void cmp_s(int32_t v1, int32_t v2); + void cmp_u(uint32_t v1, uint32_t v2); + void concmp_s(int32_t v1, int32_t v2); + void concmp_u(uint32_t v1, uint32_t v2); void cmp_d(double v1, double v2); - void bxx(UINT32 opcode, int mask); - void bxx_s(UINT32 opcode, int mask); - void test(UINT32 opcode, int mask); - void execute_op(UINT32 opcode); + void bxx(uint32_t opcode, int mask); + void bxx_s(uint32_t opcode, int mask); + void test(uint32_t opcode, int mask); + void execute_op(uint32_t opcode); void take_interrupt(int vector, int lvl); void check_irqs(); - void do_call(UINT32 adr, int type, UINT32 stack); + void do_call(uint32_t adr, int type, uint32_t stack); void do_ret_0(); void do_ret(); }; diff --git a/src/devices/cpu/i960/i960dis.h b/src/devices/cpu/i960/i960dis.h index 6ad878ee119..3012b50ed06 100644 --- a/src/devices/cpu/i960/i960dis.h +++ b/src/devices/cpu/i960/i960dis.h @@ -8,8 +8,8 @@ struct disassemble_t char *buffer; // output buffer unsigned long IP; unsigned long IPinc; - const UINT8 *oprom; - UINT32 disflags; + const uint8_t *oprom; + uint32_t disflags; }; #endif /* __I960DIS_H__ */ diff --git a/src/devices/cpu/ie15/ie15.cpp b/src/devices/cpu/ie15/ie15.cpp index 7d4d3a9a32a..37b2e648eba 100644 --- a/src/devices/cpu/ie15/ie15.cpp +++ b/src/devices/cpu/ie15/ie15.cpp @@ -28,7 +28,7 @@ const device_type IE15 = &device_creator; //------------------------------------------------- // ie15_device - constructor //------------------------------------------------- -ie15_device::ie15_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ie15_device::ie15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, IE15, "ie15", tag, owner, clock, "ie15_cpu", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 8, 14), m_io_config("io", ENDIANNESS_LITTLE, 8, 8), m_A(0), m_CF(0), m_ZF(0), m_RF(0), m_flags(0), @@ -151,7 +151,7 @@ void ie15_device::state_string_export(const device_state_entry &entry, std::stri // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 ie15_device::disasm_min_opcode_bytes() const +uint32_t ie15_device::disasm_min_opcode_bytes() const { return 1; } @@ -161,7 +161,7 @@ UINT32 ie15_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 ie15_device::disasm_max_opcode_bytes() const +uint32_t ie15_device::disasm_max_opcode_bytes() const { return 2; } @@ -171,7 +171,7 @@ UINT32 ie15_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t ie15_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t ie15_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( ie15 ); return CPU_DISASSEMBLE_NAME(ie15)(nullptr, buffer, pc, oprom, opram, 0); @@ -186,7 +186,7 @@ offs_t ie15_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 ie15_device::execute_min_cycles() const +uint32_t ie15_device::execute_min_cycles() const { return 1; } @@ -196,7 +196,7 @@ UINT32 ie15_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 ie15_device::execute_max_cycles() const +uint32_t ie15_device::execute_max_cycles() const { return 1; } @@ -214,7 +214,7 @@ void ie15_device::execute_run() } while (m_icount > 0); } -inline void ie15_device::illegal(UINT8 opcode) +inline void ie15_device::illegal(uint8_t opcode) { if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) { @@ -227,7 +227,7 @@ inline void ie15_device::illegal(UINT8 opcode) // XXX what if ldc was at 0x_ff? inline void ie15_device::execute_one(int opcode) { - UINT16 tmp; + uint16_t tmp; m_icount -= 1; @@ -412,45 +412,45 @@ inline void ie15_device::execute_one(int opcode) INLINE FUNCTIONS ***************************************************************************/ -inline UINT8 ie15_device::rop() +inline uint8_t ie15_device::rop() { - UINT8 retVal = m_direct->read_byte(m_PC.w.l); + uint8_t retVal = m_direct->read_byte(m_PC.w.l); m_PC.w.l = (m_PC.w.l + 1) & 0x0fff; return retVal; } -inline UINT8 ie15_device::arg() +inline uint8_t ie15_device::arg() { - UINT8 retVal = m_direct->read_byte(m_PC.w.l); + uint8_t retVal = m_direct->read_byte(m_PC.w.l); return retVal; } -inline UINT8 ie15_device::get_reg_lo(UINT8 reg) +inline uint8_t ie15_device::get_reg_lo(uint8_t reg) { - UINT16 tmp = m_RF ? m_REGS[16 + reg] : m_REGS[reg]; + uint16_t tmp = m_RF ? m_REGS[16 + reg] : m_REGS[reg]; return tmp & 255; } -inline UINT16 ie15_device::get_reg(UINT8 reg) +inline uint16_t ie15_device::get_reg(uint8_t reg) { return m_RF ? m_REGS[16 + reg] : m_REGS[reg]; } -inline void ie15_device::set_reg(UINT8 reg, UINT16 val) +inline void ie15_device::set_reg(uint8_t reg, uint16_t val) { (m_RF ? m_REGS[16 + reg] : m_REGS[reg]) = val; } -inline void ie15_device::update_flags(UINT8 val) +inline void ie15_device::update_flags(uint8_t val) { m_ZF = (val == 0xff) ? 1 : 0; } -inline UINT8 ie15_device::do_condition(UINT8 val) +inline uint8_t ie15_device::do_condition(uint8_t val) { - UINT8 v = (val >> 5) & 1; - UINT8 cond = 0; + uint8_t v = (val >> 5) & 1; + uint8_t cond = 0; switch((val>> 3) & 0x03) { case 0 : if (m_CF==v) cond = 1; @@ -462,8 +462,8 @@ inline UINT8 ie15_device::do_condition(UINT8 val) return cond; } -inline UINT16 ie15_device::get_addr(UINT8 val) +inline uint16_t ie15_device::get_addr(uint8_t val) { - UINT8 lo = arg(); + uint8_t lo = arg(); return ((val & 0x0f) << 8) + lo + 1; } diff --git a/src/devices/cpu/ie15/ie15.h b/src/devices/cpu/ie15/ie15.h index 5f5d4786ba9..823dd8f27b6 100644 --- a/src/devices/cpu/ie15/ie15.h +++ b/src/devices/cpu/ie15/ie15.h @@ -27,7 +27,7 @@ class ie15_device : public cpu_device { public: // construction/destruction - ie15_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ie15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -35,8 +35,8 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; virtual void execute_run() override; // device_memory_interface overrides @@ -48,21 +48,21 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void execute_one(int opcode); - UINT8 rop(); - UINT8 get_reg_lo(UINT8 reg); - UINT16 get_reg(UINT8 reg); - void set_reg(UINT8 reg, UINT16 val); - UINT8 arg(); - void update_flags(UINT8 val); - UINT8 do_condition(UINT8 val); - UINT16 get_addr(UINT8 val); - void illegal(UINT8 opcode); + uint8_t rop(); + uint8_t get_reg_lo(uint8_t reg); + uint16_t get_reg(uint8_t reg); + void set_reg(uint8_t reg, uint16_t val); + uint8_t arg(); + void update_flags(uint8_t val); + uint8_t do_condition(uint8_t val); + uint16_t get_addr(uint8_t val); + void illegal(uint8_t opcode); int m_icount; @@ -70,13 +70,13 @@ protected: const address_space_config m_program_config; const address_space_config m_io_config; - UINT8 m_A; + uint8_t m_A; PAIR m_PC; - UINT16 m_REGS[32]; // General registers (2 pages of 16) - UINT8 m_CF; // Carry flag - UINT8 m_ZF; // Zero flag - UINT8 m_RF; // Current register page - UINT8 m_flags; // temporary I/O only + uint16_t m_REGS[32]; // General registers (2 pages of 16) + uint8_t m_CF; // Carry flag + uint8_t m_ZF; // Zero flag + uint8_t m_RF; // Current register page + uint8_t m_flags; // temporary I/O only address_space *m_program; address_space *m_io; diff --git a/src/devices/cpu/ie15/ie15dasm.cpp b/src/devices/cpu/ie15/ie15dasm.cpp index 3f21fb977e0..536497b9db0 100644 --- a/src/devices/cpu/ie15/ie15dasm.cpp +++ b/src/devices/cpu/ie15/ie15dasm.cpp @@ -7,8 +7,8 @@ CPU_DISASSEMBLE( ie15 ) { - UINT32 flags = 0; - UINT8 op; + uint32_t flags = 0; + uint8_t op; unsigned PC = pc; op = OP(pc++); diff --git a/src/devices/cpu/jaguar/jagdasm.cpp b/src/devices/cpu/jaguar/jagdasm.cpp index a12145c23c8..2b65353c0f3 100644 --- a/src/devices/cpu/jaguar/jagdasm.cpp +++ b/src/devices/cpu/jaguar/jagdasm.cpp @@ -23,7 +23,7 @@ STATIC VARIABLES ***************************************************************************/ -static const UINT8 convert_zero[32] = +static const uint8_t convert_zero[32] = { 32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 }; static const char *const condition[32] = @@ -69,7 +69,7 @@ static const char *const condition[32] = CODE CODE ***************************************************************************/ -static inline char *signed_16bit(INT16 val) +static inline char *signed_16bit(int16_t val) { static char temp[10]; if (val < 0) @@ -79,9 +79,9 @@ static inline char *signed_16bit(INT16 val) return temp; } -static unsigned dasmjag(int variant, char *buffer, unsigned pc, const UINT8 *oprom) +static unsigned dasmjag(int variant, char *buffer, unsigned pc, const uint8_t *oprom) { - UINT32 flags = 0; + uint32_t flags = 0; int op = ROPCODE(0); int reg1 = (op >> 5) & 31; int reg2 = op & 31; @@ -121,7 +121,7 @@ static unsigned dasmjag(int variant, char *buffer, unsigned pc, const UINT8 *opr case 28: sprintf(buffer, "ror r%d,r%d", reg1, reg2); break; case 29: sprintf(buffer, "rorq $%x,r%d", convert_zero[reg1], reg2); break; case 30: sprintf(buffer, "cmp r%d,r%d", reg1, reg2); break; - case 31: sprintf(buffer, "cmpq %s,r%d", signed_16bit((INT16)(reg1 << 11) >> 11), reg2);break; + case 31: sprintf(buffer, "cmpq %s,r%d", signed_16bit((int16_t)(reg1 << 11) >> 11), reg2);break; case 32: if (variant == JAGUAR_VARIANT_GPU) sprintf(buffer, "sat8 r%d", reg2); else @@ -159,7 +159,7 @@ static unsigned dasmjag(int variant, char *buffer, unsigned pc, const UINT8 *opr case 50: sprintf(buffer, "store r%d,(r15+$%x)", reg2, convert_zero[reg1]*4);break; case 51: sprintf(buffer, "move pc,r%d", reg2); break; case 52: sprintf(buffer, "jump %s(r%d)", condition[reg2], reg1); break; - case 53: sprintf(buffer, "jr %s%08X", condition[reg2], pc + ((INT8)(reg1 << 3) >> 2)); break; + case 53: sprintf(buffer, "jr %s%08X", condition[reg2], pc + ((int8_t)(reg1 << 3) >> 2)); break; case 54: sprintf(buffer, "mmult r%d,r%d", reg1, reg2); break; case 55: sprintf(buffer, "mtoi r%d,r%d", reg1, reg2); break; case 56: sprintf(buffer, "normi r%d,r%d", reg1, reg2); break; diff --git a/src/devices/cpu/jaguar/jaguar.cpp b/src/devices/cpu/jaguar/jaguar.cpp index d6d7524dcc7..2906245858d 100644 --- a/src/devices/cpu/jaguar/jaguar.cpp +++ b/src/devices/cpu/jaguar/jaguar.cpp @@ -46,9 +46,9 @@ #define CLR_ZN() (FLAGS &= ~(ZFLAG | NFLAG)) #define CLR_ZNC() (FLAGS &= ~(CFLAG | ZFLAG | NFLAG)) #define SET_Z(r) (FLAGS |= ((r) == 0)) -#define SET_C_ADD(a,b) (FLAGS |= ((UINT32)(b) > (UINT32)(~(a))) << 1) -#define SET_C_SUB(a,b) (FLAGS |= ((UINT32)(b) > (UINT32)(a)) << 1) -#define SET_N(r) (FLAGS |= (((UINT32)(r) >> 29) & 4)) +#define SET_C_ADD(a,b) (FLAGS |= ((uint32_t)(b) > (uint32_t)(~(a))) << 1) +#define SET_C_SUB(a,b) (FLAGS |= ((uint32_t)(b) > (uint32_t)(a)) << 1) +#define SET_N(r) (FLAGS |= (((uint32_t)(r) >> 29) & 4)) #define SET_ZN(r) SET_N(r); SET_Z(r) #define SET_ZNC_ADD(a,b,r) SET_N(r); SET_Z(r); SET_C_ADD(a,b) #define SET_ZNC_SUB(a,b,r) SET_N(r); SET_Z(r); SET_C_SUB(a,b) @@ -78,7 +78,7 @@ PRIVATE GLOBAL VARIABLES ***************************************************************************/ -const UINT32 jaguar_cpu_device::convert_zero[32] = +const uint32_t jaguar_cpu_device::convert_zero[32] = { 32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 }; @@ -140,7 +140,7 @@ const device_type JAGUARGPU = &device_creator; const device_type JAGUARDSP = &device_creator; -jaguar_cpu_device::jaguar_cpu_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, bool isdsp) +jaguar_cpu_device::jaguar_cpu_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, bool isdsp) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 32, 24, 0) , m_isdsp(isdsp) @@ -162,13 +162,13 @@ jaguar_cpu_device::jaguar_cpu_device(const machine_config &mconfig, device_type } -jaguargpu_cpu_device::jaguargpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +jaguargpu_cpu_device::jaguargpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : jaguar_cpu_device(mconfig, JAGUARGPU, "Jaguar GPU", tag, owner, clock, "jaguargpu", __FILE__, false) { } -jaguardsp_cpu_device::jaguardsp_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +jaguardsp_cpu_device::jaguardsp_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : jaguar_cpu_device(mconfig, JAGUARDSP, "Jaguar DSP", tag, owner, clock, "jaguardsp", __FILE__, true) { } @@ -176,7 +176,7 @@ jaguardsp_cpu_device::jaguardsp_cpu_device(const machine_config &mconfig, const void jaguar_cpu_device::update_register_banks() { - UINT32 temp; + uint32_t temp; int i, bank; /* pick the bank */ @@ -288,7 +288,7 @@ void jaguar_cpu_device::init_tables() } /* fill in the mirror table */ - mirror_table = std::make_unique(65536); + mirror_table = std::make_unique(65536); for (i = 0; i < 65536; i++) mirror_table[i] = ((i >> 15) & 0x0001) | ((i >> 13) & 0x0002) | ((i >> 11) & 0x0004) | ((i >> 9) & 0x0008) | @@ -300,7 +300,7 @@ void jaguar_cpu_device::init_tables() ((i << 13) & 0x4000) | ((i << 15) & 0x8000); /* fill in the condition table */ - condition_table = std::make_unique(32 * 8); + condition_table = std::make_unique(32 * 8); for (i = 0; i < 8; i++) for (j = 0; j < 32; j++) { @@ -466,7 +466,7 @@ void jaguargpu_cpu_device::execute_run() /* core execution loop */ do { - UINT32 op; + uint32_t op; /* debugging */ //if (PC < 0xf03000 || PC > 0xf04000) { fatalerror("GPU: PC = %06X (ppc = %06X)\n", PC, m_ppc); } @@ -503,7 +503,7 @@ void jaguardsp_cpu_device::execute_run() /* core execution loop */ do { - UINT32 op; + uint32_t op; /* debugging */ //if (PC < 0xf1b000 || PC > 0xf1d000) { fatalerror(stderr, "DSP: PC = %06X\n", PC); } @@ -527,10 +527,10 @@ void jaguardsp_cpu_device::execute_run() OPCODES ***************************************************************************/ -void jaguar_cpu_device::abs_rn(UINT16 op) +void jaguar_cpu_device::abs_rn(uint16_t op) { int dreg = op & 31; - UINT32 res = m_r[dreg]; + uint32_t res = m_r[dreg]; CLR_ZNC(); if (res & 0x80000000) { @@ -540,121 +540,121 @@ void jaguar_cpu_device::abs_rn(UINT16 op) SET_Z(res); } -void jaguar_cpu_device::add_rn_rn(UINT16 op) +void jaguar_cpu_device::add_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 + r1; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 + r1; m_r[dreg] = res; CLR_ZNC(); SET_ZNC_ADD(r2, r1, res); } -void jaguar_cpu_device::addc_rn_rn(UINT16 op) +void jaguar_cpu_device::addc_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 c = ((FLAGS >> 1) & 1); - UINT32 res = r2 + r1 + c; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t c = ((FLAGS >> 1) & 1); + uint32_t res = r2 + r1 + c; m_r[dreg] = res; CLR_ZNC(); SET_ZNC_ADD(r2, r1 + c, res); } -void jaguar_cpu_device::addq_n_rn(UINT16 op) +void jaguar_cpu_device::addq_n_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 + r1; + uint32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 + r1; m_r[dreg] = res; CLR_ZNC(); SET_ZNC_ADD(r2, r1, res); } -void jaguar_cpu_device::addqmod_n_rn(UINT16 op) /* DSP only */ +void jaguar_cpu_device::addqmod_n_rn(uint16_t op) /* DSP only */ { int dreg = op & 31; - UINT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 + r1; + uint32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 + r1; res = (res & ~m_ctrl[D_MOD]) | (r2 & ~m_ctrl[D_MOD]); m_r[dreg] = res; CLR_ZNC(); SET_ZNC_ADD(r2, r1, res); } -void jaguar_cpu_device::addqt_n_rn(UINT16 op) +void jaguar_cpu_device::addqt_n_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 + r1; + uint32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 + r1; m_r[dreg] = res; } -void jaguar_cpu_device::and_rn_rn(UINT16 op) +void jaguar_cpu_device::and_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 & r1; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 & r1; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::bclr_n_rn(UINT16 op) +void jaguar_cpu_device::bclr_n_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = (op >> 5) & 31; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 & ~(1 << r1); + uint32_t r1 = (op >> 5) & 31; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 & ~(1 << r1); m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::bset_n_rn(UINT16 op) +void jaguar_cpu_device::bset_n_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = (op >> 5) & 31; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 | (1 << r1); + uint32_t r1 = (op >> 5) & 31; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 | (1 << r1); m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::btst_n_rn(UINT16 op) +void jaguar_cpu_device::btst_n_rn(uint16_t op) { - UINT32 r1 = (op >> 5) & 31; - UINT32 r2 = m_r[op & 31]; + uint32_t r1 = (op >> 5) & 31; + uint32_t r2 = m_r[op & 31]; CLR_Z(); FLAGS |= (~r2 >> r1) & 1; } -void jaguar_cpu_device::cmp_rn_rn(UINT16 op) +void jaguar_cpu_device::cmp_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[op & 31]; - UINT32 res = r2 - r1; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[op & 31]; + uint32_t res = r2 - r1; CLR_ZNC(); SET_ZNC_SUB(r2, r1, res); } -void jaguar_cpu_device::cmpq_n_rn(UINT16 op) +void jaguar_cpu_device::cmpq_n_rn(uint16_t op) { - UINT32 r1 = (INT8)(op >> 2) >> 3; - UINT32 r2 = m_r[op & 31]; - UINT32 res = r2 - r1; + uint32_t r1 = (int8_t)(op >> 2) >> 3; + uint32_t r2 = m_r[op & 31]; + uint32_t res = r2 - r1; CLR_ZNC(); SET_ZNC_SUB(r2, r1, res); } -void jaguar_cpu_device::div_rn_rn(UINT16 op) +void jaguar_cpu_device::div_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; if (r1) { if (m_ctrl[D_DIVCTRL] & 1) { - m_r[dreg] = ((UINT64)r2 << 16) / r1; - m_ctrl[D_REMAINDER] = ((UINT64)r2 << 16) % r1; + m_r[dreg] = ((uint64_t)r2 << 16) / r1; + m_ctrl[D_REMAINDER] = ((uint64_t)r2 << 16) % r1; } else { @@ -666,35 +666,35 @@ void jaguar_cpu_device::div_rn_rn(UINT16 op) m_r[dreg] = 0xffffffff; } -void jaguar_cpu_device::illegal(UINT16 op) +void jaguar_cpu_device::illegal(uint16_t op) { } -void jaguar_cpu_device::imacn_rn_rn(UINT16 op) +void jaguar_cpu_device::imacn_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[op & 31]; - m_accum += (INT64)((INT16)r1 * (INT16)r2); + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[op & 31]; + m_accum += (int64_t)((int16_t)r1 * (int16_t)r2); logerror("Unexpected IMACN instruction!\n"); } -void jaguar_cpu_device::imult_rn_rn(UINT16 op) +void jaguar_cpu_device::imult_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = (INT16)r1 * (INT16)r2; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = (int16_t)r1 * (int16_t)r2; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::imultn_rn_rn(UINT16 op) +void jaguar_cpu_device::imultn_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = (INT16)r1 * (INT16)r2; - m_accum = (INT32)res; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = (int16_t)r1 * (int16_t)r2; + m_accum = (int32_t)res; CLR_ZN(); SET_ZN(res); op = ROPCODE(PC); @@ -702,23 +702,23 @@ void jaguar_cpu_device::imultn_rn_rn(UINT16 op) { r1 = m_r[(op >> 5) & 31]; r2 = m_r[op & 31]; - m_accum += (INT64)((INT16)r1 * (INT16)r2); + m_accum += (int64_t)((int16_t)r1 * (int16_t)r2); PC += 2; op = ROPCODE(PC); } if ((op >> 10) == 19) { PC += 2; - m_r[op & 31] = (UINT32)m_accum; + m_r[op & 31] = (uint32_t)m_accum; } } -void jaguar_cpu_device::jr_cc_n(UINT16 op) +void jaguar_cpu_device::jr_cc_n(uint16_t op) { if (CONDITION(op & 31)) { - INT32 r1 = (INT8)((op >> 2) & 0xf8) >> 2; - UINT32 newpc = PC + r1; + int32_t r1 = (int8_t)((op >> 2) & 0xf8) >> 2; + uint32_t newpc = PC + r1; debugger_instruction_hook(this, PC); op = ROPCODE(PC); PC = newpc; @@ -728,14 +728,14 @@ void jaguar_cpu_device::jr_cc_n(UINT16 op) } } -void jaguar_cpu_device::jump_cc_rn(UINT16 op) +void jaguar_cpu_device::jump_cc_rn(uint16_t op) { if (CONDITION(op & 31)) { - UINT8 reg = (op >> 5) & 31; + uint8_t reg = (op >> 5) & 31; /* special kludge for risky code in the cojag DSP interrupt handlers */ - UINT32 newpc = (m_icount == m_bankswitch_icount) ? m_a[reg] : m_r[reg]; + uint32_t newpc = (m_icount == m_bankswitch_icount) ? m_a[reg] : m_r[reg]; debugger_instruction_hook(this, PC); op = ROPCODE(PC); PC = newpc; @@ -745,39 +745,39 @@ void jaguar_cpu_device::jump_cc_rn(UINT16 op) } } -void jaguar_cpu_device::load_rn_rn(UINT16 op) +void jaguar_cpu_device::load_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; m_r[op & 31] = READLONG(r1); } -void jaguar_cpu_device::load_r14n_rn(UINT16 op) +void jaguar_cpu_device::load_r14n_rn(uint16_t op) { - UINT32 r1 = convert_zero[(op >> 5) & 31]; + uint32_t r1 = convert_zero[(op >> 5) & 31]; m_r[op & 31] = READLONG(m_r[14] + 4 * r1); } -void jaguar_cpu_device::load_r15n_rn(UINT16 op) +void jaguar_cpu_device::load_r15n_rn(uint16_t op) { - UINT32 r1 = convert_zero[(op >> 5) & 31]; + uint32_t r1 = convert_zero[(op >> 5) & 31]; m_r[op & 31] = READLONG(m_r[15] + 4 * r1); } -void jaguar_cpu_device::load_r14rn_rn(UINT16 op) +void jaguar_cpu_device::load_r14rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; m_r[op & 31] = READLONG(m_r[14] + r1); } -void jaguar_cpu_device::load_r15rn_rn(UINT16 op) +void jaguar_cpu_device::load_r15rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; m_r[op & 31] = READLONG(m_r[15] + r1); } -void jaguar_cpu_device::loadb_rn_rn(UINT16 op) +void jaguar_cpu_device::loadb_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; if (r1 >= m_internal_ram_start && r1 <= m_internal_ram_end) { m_r[op & 31] = READLONG(r1 & ~3); @@ -788,9 +788,9 @@ void jaguar_cpu_device::loadb_rn_rn(UINT16 op) } } -void jaguar_cpu_device::loadw_rn_rn(UINT16 op) +void jaguar_cpu_device::loadw_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; if (r1 >= m_internal_ram_start && r1 <= m_internal_ram_end) { m_r[op & 31] = READLONG(r1 & ~3); @@ -801,9 +801,9 @@ void jaguar_cpu_device::loadw_rn_rn(UINT16 op) } } -void jaguar_cpu_device::loadp_rn_rn(UINT16 op) /* GPU only */ +void jaguar_cpu_device::loadp_rn_rn(uint16_t op) /* GPU only */ { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; if (r1 >= m_internal_ram_start && r1 <= m_internal_ram_end) { m_r[op & 31] = READLONG(r1 & ~3); @@ -815,29 +815,29 @@ void jaguar_cpu_device::loadp_rn_rn(UINT16 op) /* GPU only */ } } -void jaguar_cpu_device::mirror_rn(UINT16 op) /* DSP only */ +void jaguar_cpu_device::mirror_rn(uint16_t op) /* DSP only */ { int dreg = op & 31; - UINT32 r1 = m_r[dreg]; - UINT32 res = (mirror_table[r1 & 0xffff] << 16) | mirror_table[r1 >> 16]; + uint32_t r1 = m_r[dreg]; + uint32_t res = (mirror_table[r1 & 0xffff] << 16) | mirror_table[r1 >> 16]; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::mmult_rn_rn(UINT16 op) +void jaguar_cpu_device::mmult_rn_rn(uint16_t op) { int count = m_ctrl[G_MTXC] & 15, i; int sreg = (op >> 5) & 31; int dreg = op & 31; - UINT32 addr = m_ctrl[G_MTXA]; - INT64 accum = 0; - UINT32 res; + uint32_t addr = m_ctrl[G_MTXA]; + int64_t accum = 0; + uint32_t res; if (!(m_ctrl[G_MTXC] & 0x10)) { for (i = 0; i < count; i++) { - accum += (INT16)(m_b1[sreg + i/2] >> (16 * ((i & 1) ^ 1))) * (INT16)READWORD(addr); + accum += (int16_t)(m_b1[sreg + i/2] >> (16 * ((i & 1) ^ 1))) * (int16_t)READWORD(addr); addr += 2; } } @@ -845,79 +845,79 @@ void jaguar_cpu_device::mmult_rn_rn(UINT16 op) { for (i = 0; i < count; i++) { - accum += (INT16)(m_b1[sreg + i/2] >> (16 * ((i & 1) ^ 1))) * (INT16)READWORD(addr); + accum += (int16_t)(m_b1[sreg + i/2] >> (16 * ((i & 1) ^ 1))) * (int16_t)READWORD(addr); addr += 2 * count; } } - m_r[dreg] = res = (UINT32)accum; + m_r[dreg] = res = (uint32_t)accum; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::move_rn_rn(UINT16 op) +void jaguar_cpu_device::move_rn_rn(uint16_t op) { m_r[op & 31] = m_r[(op >> 5) & 31]; } -void jaguar_cpu_device::move_pc_rn(UINT16 op) +void jaguar_cpu_device::move_pc_rn(uint16_t op) { m_r[op & 31] = m_ppc; } -void jaguar_cpu_device::movefa_rn_rn(UINT16 op) +void jaguar_cpu_device::movefa_rn_rn(uint16_t op) { m_r[op & 31] = m_a[(op >> 5) & 31]; } -void jaguar_cpu_device::movei_n_rn(UINT16 op) +void jaguar_cpu_device::movei_n_rn(uint16_t op) { - UINT32 res = ROPCODE(PC) | (ROPCODE(PC + 2) << 16); + uint32_t res = ROPCODE(PC) | (ROPCODE(PC + 2) << 16); PC += 4; m_r[op & 31] = res; } -void jaguar_cpu_device::moveq_n_rn(UINT16 op) +void jaguar_cpu_device::moveq_n_rn(uint16_t op) { m_r[op & 31] = (op >> 5) & 31; } -void jaguar_cpu_device::moveta_rn_rn(UINT16 op) +void jaguar_cpu_device::moveta_rn_rn(uint16_t op) { m_a[op & 31] = m_r[(op >> 5) & 31]; } -void jaguar_cpu_device::mtoi_rn_rn(UINT16 op) +void jaguar_cpu_device::mtoi_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; - m_r[op & 31] = (((INT32)r1 >> 8) & 0xff800000) | (r1 & 0x007fffff); + uint32_t r1 = m_r[(op >> 5) & 31]; + m_r[op & 31] = (((int32_t)r1 >> 8) & 0xff800000) | (r1 & 0x007fffff); } -void jaguar_cpu_device::mult_rn_rn(UINT16 op) +void jaguar_cpu_device::mult_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = (UINT16)r1 * (UINT16)r2; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = (uint16_t)r1 * (uint16_t)r2; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::neg_rn(UINT16 op) +void jaguar_cpu_device::neg_rn(uint16_t op) { int dreg = op & 31; - UINT32 r2 = m_r[dreg]; - UINT32 res = -r2; + uint32_t r2 = m_r[dreg]; + uint32_t res = -r2; m_r[dreg] = res; CLR_ZNC(); SET_ZNC_SUB(0, r2, res); } -void jaguar_cpu_device::nop(UINT16 op) +void jaguar_cpu_device::nop(uint16_t op) { } -void jaguar_cpu_device::normi_rn_rn(UINT16 op) +void jaguar_cpu_device::normi_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 res = 0; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t res = 0; if (r1 != 0) { while ((r1 & 0xffc00000) == 0) @@ -935,30 +935,30 @@ void jaguar_cpu_device::normi_rn_rn(UINT16 op) CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::not_rn(UINT16 op) +void jaguar_cpu_device::not_rn(uint16_t op) { int dreg = op & 31; - UINT32 res = ~m_r[dreg]; + uint32_t res = ~m_r[dreg]; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::or_rn_rn(UINT16 op) +void jaguar_cpu_device::or_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r1 | r2; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r1 | r2; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::pack_rn(UINT16 op) /* GPU only */ +void jaguar_cpu_device::pack_rn(uint16_t op) /* GPU only */ { int dreg = op & 31; int pack = (op >> 5) & 31; - UINT32 r2 = m_r[dreg]; - UINT32 res; + uint32_t r2 = m_r[dreg]; + uint32_t res; if (pack == 0) /* PACK */ res = ((r2 >> 10) & 0xf000) | ((r2 >> 5) & 0x0f00) | (r2 & 0xff); else /* UNPACK */ @@ -966,83 +966,83 @@ void jaguar_cpu_device::pack_rn(UINT16 op) /* GPU only */ m_r[dreg] = res; } -void jaguar_cpu_device::resmac_rn(UINT16 op) +void jaguar_cpu_device::resmac_rn(uint16_t op) { - m_r[op & 31] = (UINT32)m_accum; + m_r[op & 31] = (uint32_t)m_accum; } -void jaguar_cpu_device::ror_rn_rn(UINT16 op) +void jaguar_cpu_device::ror_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31] & 31; - UINT32 r2 = m_r[dreg]; - UINT32 res = (r2 >> r1) | (r2 << (32 - r1)); + uint32_t r1 = m_r[(op >> 5) & 31] & 31; + uint32_t r2 = m_r[dreg]; + uint32_t res = (r2 >> r1) | (r2 << (32 - r1)); m_r[dreg] = res; CLR_ZNC(); SET_ZN(res); FLAGS |= (r2 >> 30) & 2; } -void jaguar_cpu_device::rorq_n_rn(UINT16 op) +void jaguar_cpu_device::rorq_n_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = (r2 >> r1) | (r2 << (32 - r1)); + uint32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = (r2 >> r1) | (r2 << (32 - r1)); m_r[dreg] = res; CLR_ZNC(); SET_ZN(res); FLAGS |= (r2 >> 30) & 2; } -void jaguar_cpu_device::sat8_rn(UINT16 op) /* GPU only */ +void jaguar_cpu_device::sat8_rn(uint16_t op) /* GPU only */ { int dreg = op & 31; - INT32 r2 = m_r[dreg]; - UINT32 res = (r2 < 0) ? 0 : (r2 > 255) ? 255 : r2; + int32_t r2 = m_r[dreg]; + uint32_t res = (r2 < 0) ? 0 : (r2 > 255) ? 255 : r2; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::sat16_rn(UINT16 op) /* GPU only */ +void jaguar_cpu_device::sat16_rn(uint16_t op) /* GPU only */ { int dreg = op & 31; - INT32 r2 = m_r[dreg]; - UINT32 res = (r2 < 0) ? 0 : (r2 > 65535) ? 65535 : r2; + int32_t r2 = m_r[dreg]; + uint32_t res = (r2 < 0) ? 0 : (r2 > 65535) ? 65535 : r2; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::sat16s_rn(UINT16 op) /* DSP only */ +void jaguar_cpu_device::sat16s_rn(uint16_t op) /* DSP only */ { int dreg = op & 31; - INT32 r2 = m_r[dreg]; - UINT32 res = (r2 < -32768) ? -32768 : (r2 > 32767) ? 32767 : r2; + int32_t r2 = m_r[dreg]; + uint32_t res = (r2 < -32768) ? -32768 : (r2 > 32767) ? 32767 : r2; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::sat24_rn(UINT16 op) /* GPU only */ +void jaguar_cpu_device::sat24_rn(uint16_t op) /* GPU only */ { int dreg = op & 31; - INT32 r2 = m_r[dreg]; - UINT32 res = (r2 < 0) ? 0 : (r2 > 16777215) ? 16777215 : r2; + int32_t r2 = m_r[dreg]; + uint32_t res = (r2 < 0) ? 0 : (r2 > 16777215) ? 16777215 : r2; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::sat32s_rn(UINT16 op) /* DSP only */ +void jaguar_cpu_device::sat32s_rn(uint16_t op) /* DSP only */ { int dreg = op & 31; - INT32 r2 = (UINT32)m_r[dreg]; - INT32 temp = m_accum >> 32; - UINT32 res = (temp < -1) ? (INT32)0x80000000 : (temp > 0) ? (INT32)0x7fffffff : r2; + int32_t r2 = (uint32_t)m_r[dreg]; + int32_t temp = m_accum >> 32; + uint32_t res = (temp < -1) ? (int32_t)0x80000000 : (temp > 0) ? (int32_t)0x7fffffff : r2; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } -void jaguar_cpu_device::sh_rn_rn(UINT16 op) +void jaguar_cpu_device::sh_rn_rn(uint16_t op) { int dreg = op & 31; - INT32 r1 = (INT32)m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res; + int32_t r1 = (int32_t)m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res; CLR_ZNC(); if (r1 < 0) @@ -1059,12 +1059,12 @@ void jaguar_cpu_device::sh_rn_rn(UINT16 op) SET_ZN(res); } -void jaguar_cpu_device::sha_rn_rn(UINT16 op) +void jaguar_cpu_device::sha_rn_rn(uint16_t op) { int dreg = op & 31; - INT32 r1 = (INT32)m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res; + int32_t r1 = (int32_t)m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res; CLR_ZNC(); if (r1 < 0) @@ -1074,76 +1074,76 @@ void jaguar_cpu_device::sha_rn_rn(UINT16 op) } else { - res = (r1 >= 32) ? ((INT32)r2 >> 31) : ((INT32)r2 >> r1); + res = (r1 >= 32) ? ((int32_t)r2 >> 31) : ((int32_t)r2 >> r1); FLAGS |= (r2 << 1) & 2; } m_r[dreg] = res; SET_ZN(res); } -void jaguar_cpu_device::sharq_n_rn(UINT16 op) +void jaguar_cpu_device::sharq_n_rn(uint16_t op) { int dreg = op & 31; - INT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = (INT32)r2 >> r1; + int32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = (int32_t)r2 >> r1; m_r[dreg] = res; CLR_ZNC(); SET_ZN(res); FLAGS |= (r2 << 1) & 2; } -void jaguar_cpu_device::shlq_n_rn(UINT16 op) +void jaguar_cpu_device::shlq_n_rn(uint16_t op) { int dreg = op & 31; - INT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 << (32 - r1); + int32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 << (32 - r1); m_r[dreg] = res; CLR_ZNC(); SET_ZN(res); FLAGS |= (r2 >> 30) & 2; } -void jaguar_cpu_device::shrq_n_rn(UINT16 op) +void jaguar_cpu_device::shrq_n_rn(uint16_t op) { int dreg = op & 31; - INT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 >> r1; + int32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 >> r1; m_r[dreg] = res; CLR_ZNC(); SET_ZN(res); FLAGS |= (r2 << 1) & 2; } -void jaguar_cpu_device::store_rn_rn(UINT16 op) +void jaguar_cpu_device::store_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; WRITELONG(r1, m_r[op & 31]); } -void jaguar_cpu_device::store_rn_r14n(UINT16 op) +void jaguar_cpu_device::store_rn_r14n(uint16_t op) { - UINT32 r1 = convert_zero[(op >> 5) & 31]; + uint32_t r1 = convert_zero[(op >> 5) & 31]; WRITELONG(m_r[14] + r1 * 4, m_r[op & 31]); } -void jaguar_cpu_device::store_rn_r15n(UINT16 op) +void jaguar_cpu_device::store_rn_r15n(uint16_t op) { - UINT32 r1 = convert_zero[(op >> 5) & 31]; + uint32_t r1 = convert_zero[(op >> 5) & 31]; WRITELONG(m_r[15] + r1 * 4, m_r[op & 31]); } -void jaguar_cpu_device::store_rn_r14rn(UINT16 op) +void jaguar_cpu_device::store_rn_r14rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; WRITELONG(m_r[14] + r1, m_r[op & 31]); } -void jaguar_cpu_device::store_rn_r15rn(UINT16 op) +void jaguar_cpu_device::store_rn_r15rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; WRITELONG(m_r[15] + r1, m_r[op & 31]); } -void jaguar_cpu_device::storeb_rn_rn(UINT16 op) +void jaguar_cpu_device::storeb_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; if (r1 >= m_internal_ram_start && r1 <= m_internal_ram_end) { WRITELONG(r1 & ~3, m_r[op & 31]); @@ -1154,9 +1154,9 @@ void jaguar_cpu_device::storeb_rn_rn(UINT16 op) } } -void jaguar_cpu_device::storew_rn_rn(UINT16 op) +void jaguar_cpu_device::storew_rn_rn(uint16_t op) { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; if (r1 >= m_internal_ram_start && r1 <= m_internal_ram_end) { WRITELONG(r1 & ~3, m_r[op & 31]); @@ -1167,9 +1167,9 @@ void jaguar_cpu_device::storew_rn_rn(UINT16 op) } } -void jaguar_cpu_device::storep_rn_rn(UINT16 op) /* GPU only */ +void jaguar_cpu_device::storep_rn_rn(uint16_t op) /* GPU only */ { - UINT32 r1 = m_r[(op >> 5) & 31]; + uint32_t r1 = m_r[(op >> 5) & 31]; if (r1 >= m_internal_ram_start && r1 <= m_internal_ram_end) { WRITELONG(r1 & ~3, m_r[op & 31]); @@ -1181,63 +1181,63 @@ void jaguar_cpu_device::storep_rn_rn(UINT16 op) /* GPU only */ } } -void jaguar_cpu_device::sub_rn_rn(UINT16 op) +void jaguar_cpu_device::sub_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 - r1; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 - r1; m_r[dreg] = res; CLR_ZNC(); SET_ZNC_SUB(r2, r1, res); } -void jaguar_cpu_device::subc_rn_rn(UINT16 op) +void jaguar_cpu_device::subc_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 c = ((FLAGS >> 1) & 1); - UINT32 res = r2 - r1 - c; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t c = ((FLAGS >> 1) & 1); + uint32_t res = r2 - r1 - c; m_r[dreg] = res; CLR_ZNC(); SET_ZNC_SUB(r2, r1 + c, res); } -void jaguar_cpu_device::subq_n_rn(UINT16 op) +void jaguar_cpu_device::subq_n_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 - r1; + uint32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 - r1; m_r[dreg] = res; CLR_ZNC(); SET_ZNC_SUB(r2, r1, res); } -void jaguar_cpu_device::subqmod_n_rn(UINT16 op) /* DSP only */ +void jaguar_cpu_device::subqmod_n_rn(uint16_t op) /* DSP only */ { int dreg = op & 31; - UINT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 - r1; + uint32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 - r1; res = (res & ~m_ctrl[D_MOD]) | (r2 & ~m_ctrl[D_MOD]); m_r[dreg] = res; CLR_ZNC(); SET_ZNC_SUB(r2, r1, res); } -void jaguar_cpu_device::subqt_n_rn(UINT16 op) +void jaguar_cpu_device::subqt_n_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = convert_zero[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r2 - r1; + uint32_t r1 = convert_zero[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r2 - r1; m_r[dreg] = res; } -void jaguar_cpu_device::xor_rn_rn(UINT16 op) +void jaguar_cpu_device::xor_rn_rn(uint16_t op) { int dreg = op & 31; - UINT32 r1 = m_r[(op >> 5) & 31]; - UINT32 r2 = m_r[dreg]; - UINT32 res = r1 ^ r2; + uint32_t r1 = m_r[(op >> 5) & 31]; + uint32_t r2 = m_r[dreg]; + uint32_t res = r1 ^ r2; m_r[dreg] = res; CLR_ZN(); SET_ZN(res); } @@ -1258,7 +1258,7 @@ READ32_MEMBER( jaguargpu_cpu_device::ctrl_r ) WRITE32_MEMBER( jaguargpu_cpu_device::ctrl_w ) { - UINT32 oldval, newval; + uint32_t oldval, newval; if (LOG_GPU_IO && offset != G_HIDATA) logerror("GPU write register @ F021%02X = %08X\n", offset * 4, data); @@ -1352,7 +1352,7 @@ READ32_MEMBER( jaguardsp_cpu_device::ctrl_r ) WRITE32_MEMBER( jaguardsp_cpu_device::ctrl_w ) { - UINT32 oldval, newval; + uint32_t oldval, newval; if (LOG_DSP_IO && offset != D_FLAGS) logerror("DSP write register @ F1A1%02X = %08X\n", offset * 4, data); @@ -1430,14 +1430,14 @@ WRITE32_MEMBER( jaguardsp_cpu_device::ctrl_w ) } -offs_t jaguargpu_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t jaguargpu_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( jaguargpu ); return CPU_DISASSEMBLE_NAME(jaguargpu)(this, buffer, pc, oprom, opram, options); } -offs_t jaguardsp_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t jaguardsp_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( jaguardsp ); return CPU_DISASSEMBLE_NAME(jaguardsp)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/jaguar/jaguar.h b/src/devices/cpu/jaguar/jaguar.h index cc2e8938961..85fec3fe40e 100644 --- a/src/devices/cpu/jaguar/jaguar.h +++ b/src/devices/cpu/jaguar/jaguar.h @@ -103,7 +103,7 @@ class jaguar_cpu_device : public cpu_device { public: // construction/destruction - jaguar_cpu_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, bool isdsp); + jaguar_cpu_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, bool isdsp); ~jaguar_cpu_device(); // static configuration helpers @@ -118,9 +118,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 5; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 5; } virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface overrides @@ -130,21 +130,21 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 6; } + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 6; } address_space_config m_program_config; /* core registers */ - UINT32 m_r[32]; - UINT32 m_a[32]; - UINT32 * m_b0; - UINT32 * m_b1; + uint32_t m_r[32]; + uint32_t m_a[32]; + uint32_t * m_b0; + uint32_t * m_b1; /* control registers */ - UINT32 m_ctrl[G_CTRLMAX]; - UINT32 m_ppc; - UINT64 m_accum; + uint32_t m_ctrl[G_CTRLMAX]; + uint32_t m_ppc; + uint64_t m_accum; /* internal stuff */ bool m_isdsp; @@ -154,92 +154,92 @@ protected: address_space *m_program; direct_read_data *m_direct; - UINT32 m_internal_ram_start; - UINT32 m_internal_ram_end; + uint32_t m_internal_ram_start; + uint32_t m_internal_ram_end; - typedef void (jaguar_cpu_device::*op_func)(UINT16 op); + typedef void (jaguar_cpu_device::*op_func)(uint16_t op); static const op_func gpu_op_table[64]; static const op_func dsp_op_table[64]; - static const UINT32 convert_zero[32]; + static const uint32_t convert_zero[32]; bool m_tables_referenced; - UINT32 table_refcount; - std::unique_ptr mirror_table; - std::unique_ptr condition_table; + uint32_t table_refcount; + std::unique_ptr mirror_table; + std::unique_ptr condition_table; const op_func *m_table; - void abs_rn(UINT16 op); - void add_rn_rn(UINT16 op); - void addc_rn_rn(UINT16 op); - void addq_n_rn(UINT16 op); - void addqmod_n_rn(UINT16 op); /* DSP only */ - void addqt_n_rn(UINT16 op); - void and_rn_rn(UINT16 op); - void bclr_n_rn(UINT16 op); - void bset_n_rn(UINT16 op); - void btst_n_rn(UINT16 op); - void cmp_rn_rn(UINT16 op); - void cmpq_n_rn(UINT16 op); - void div_rn_rn(UINT16 op); - void illegal(UINT16 op); - void imacn_rn_rn(UINT16 op); - void imult_rn_rn(UINT16 op); - void imultn_rn_rn(UINT16 op); - void jr_cc_n(UINT16 op); - void jump_cc_rn(UINT16 op); - void load_rn_rn(UINT16 op); - void load_r14n_rn(UINT16 op); - void load_r15n_rn(UINT16 op); - void load_r14rn_rn(UINT16 op); - void load_r15rn_rn(UINT16 op); - void loadb_rn_rn(UINT16 op); - void loadw_rn_rn(UINT16 op); - void loadp_rn_rn(UINT16 op); /* GPU only */ - void mirror_rn(UINT16 op); /* DSP only */ - void mmult_rn_rn(UINT16 op); - void move_rn_rn(UINT16 op); - void move_pc_rn(UINT16 op); - void movefa_rn_rn(UINT16 op); - void movei_n_rn(UINT16 op); - void moveq_n_rn(UINT16 op); - void moveta_rn_rn(UINT16 op); - void mtoi_rn_rn(UINT16 op); - void mult_rn_rn(UINT16 op); - void neg_rn(UINT16 op); - void nop(UINT16 op); - void normi_rn_rn(UINT16 op); - void not_rn(UINT16 op); - void or_rn_rn(UINT16 op); - void pack_rn(UINT16 op); /* GPU only */ - void resmac_rn(UINT16 op); - void ror_rn_rn(UINT16 op); - void rorq_n_rn(UINT16 op); - void sat8_rn(UINT16 op); /* GPU only */ - void sat16_rn(UINT16 op); /* GPU only */ - void sat16s_rn(UINT16 op); /* DSP only */ - void sat24_rn(UINT16 op); /* GPU only */ - void sat32s_rn(UINT16 op); /* DSP only */ - void sh_rn_rn(UINT16 op); - void sha_rn_rn(UINT16 op); - void sharq_n_rn(UINT16 op); - void shlq_n_rn(UINT16 op); - void shrq_n_rn(UINT16 op); - void store_rn_rn(UINT16 op); - void store_rn_r14n(UINT16 op); - void store_rn_r15n(UINT16 op); - void store_rn_r14rn(UINT16 op); - void store_rn_r15rn(UINT16 op); - void storeb_rn_rn(UINT16 op); - void storew_rn_rn(UINT16 op); - void storep_rn_rn(UINT16 op); /* GPU only */ - void sub_rn_rn(UINT16 op); - void subc_rn_rn(UINT16 op); - void subq_n_rn(UINT16 op); - void subqmod_n_rn(UINT16 op); /* DSP only */ - void subqt_n_rn(UINT16 op); - void xor_rn_rn(UINT16 op); + void abs_rn(uint16_t op); + void add_rn_rn(uint16_t op); + void addc_rn_rn(uint16_t op); + void addq_n_rn(uint16_t op); + void addqmod_n_rn(uint16_t op); /* DSP only */ + void addqt_n_rn(uint16_t op); + void and_rn_rn(uint16_t op); + void bclr_n_rn(uint16_t op); + void bset_n_rn(uint16_t op); + void btst_n_rn(uint16_t op); + void cmp_rn_rn(uint16_t op); + void cmpq_n_rn(uint16_t op); + void div_rn_rn(uint16_t op); + void illegal(uint16_t op); + void imacn_rn_rn(uint16_t op); + void imult_rn_rn(uint16_t op); + void imultn_rn_rn(uint16_t op); + void jr_cc_n(uint16_t op); + void jump_cc_rn(uint16_t op); + void load_rn_rn(uint16_t op); + void load_r14n_rn(uint16_t op); + void load_r15n_rn(uint16_t op); + void load_r14rn_rn(uint16_t op); + void load_r15rn_rn(uint16_t op); + void loadb_rn_rn(uint16_t op); + void loadw_rn_rn(uint16_t op); + void loadp_rn_rn(uint16_t op); /* GPU only */ + void mirror_rn(uint16_t op); /* DSP only */ + void mmult_rn_rn(uint16_t op); + void move_rn_rn(uint16_t op); + void move_pc_rn(uint16_t op); + void movefa_rn_rn(uint16_t op); + void movei_n_rn(uint16_t op); + void moveq_n_rn(uint16_t op); + void moveta_rn_rn(uint16_t op); + void mtoi_rn_rn(uint16_t op); + void mult_rn_rn(uint16_t op); + void neg_rn(uint16_t op); + void nop(uint16_t op); + void normi_rn_rn(uint16_t op); + void not_rn(uint16_t op); + void or_rn_rn(uint16_t op); + void pack_rn(uint16_t op); /* GPU only */ + void resmac_rn(uint16_t op); + void ror_rn_rn(uint16_t op); + void rorq_n_rn(uint16_t op); + void sat8_rn(uint16_t op); /* GPU only */ + void sat16_rn(uint16_t op); /* GPU only */ + void sat16s_rn(uint16_t op); /* DSP only */ + void sat24_rn(uint16_t op); /* GPU only */ + void sat32s_rn(uint16_t op); /* DSP only */ + void sh_rn_rn(uint16_t op); + void sha_rn_rn(uint16_t op); + void sharq_n_rn(uint16_t op); + void shlq_n_rn(uint16_t op); + void shrq_n_rn(uint16_t op); + void store_rn_rn(uint16_t op); + void store_rn_r14n(uint16_t op); + void store_rn_r15n(uint16_t op); + void store_rn_r14rn(uint16_t op); + void store_rn_r15rn(uint16_t op); + void storeb_rn_rn(uint16_t op); + void storew_rn_rn(uint16_t op); + void storep_rn_rn(uint16_t op); /* GPU only */ + void sub_rn_rn(uint16_t op); + void subc_rn_rn(uint16_t op); + void subq_n_rn(uint16_t op); + void subqmod_n_rn(uint16_t op); /* DSP only */ + void subqt_n_rn(uint16_t op); + void xor_rn_rn(uint16_t op); void update_register_banks(); void check_irqs(); void init_tables(); @@ -251,14 +251,14 @@ class jaguargpu_cpu_device : public jaguar_cpu_device { public: // construction/destruction - jaguargpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + jaguargpu_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE32_MEMBER(ctrl_w) override; DECLARE_READ32_MEMBER(ctrl_r) override; protected: virtual void execute_run() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; @@ -266,16 +266,16 @@ class jaguardsp_cpu_device : public jaguar_cpu_device { public: // construction/destruction - jaguardsp_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + jaguardsp_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE32_MEMBER(ctrl_w) override; DECLARE_READ32_MEMBER(ctrl_r) override; protected: - virtual UINT32 execute_input_lines() const override { return 6; } + virtual uint32_t execute_input_lines() const override { return 6; } virtual void execute_run() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; diff --git a/src/devices/cpu/lc8670/lc8670.cpp b/src/devices/cpu/lc8670/lc8670.cpp index 9ea32374479..71e674c9221 100644 --- a/src/devices/cpu/lc8670/lc8670.cpp +++ b/src/devices/cpu/lc8670/lc8670.cpp @@ -144,7 +144,7 @@ const lc8670_cpu_device::op_handler lc8670_cpu_device::s_opcode_table[] = // IRQ vectors //************************************************************************** -const UINT16 lc8670_cpu_device::s_irq_vectors[] = +const uint16_t lc8670_cpu_device::s_irq_vectors[] = { 0x0000, 0x0003, 0x000b, 0x0013, 0x001b, 0x0023, 0x002b, 0x0033, 0x003b, 0x0043, 0x004b, 0x004f, 0x0052, 0x0055, 0x005a, 0x005d @@ -170,7 +170,7 @@ ADDRESS_MAP_END // lc8670_cpu_device - constructor //------------------------------------------------- -lc8670_cpu_device::lc8670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lc8670_cpu_device::lc8670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, LC8670, "Sanyo LC8670", tag, owner, clock, "lc8670", __FILE__), m_program_config("program", ENDIANNESS_BIG, 8, 16, 0), m_data_config("data", ENDIANNESS_BIG, 8, 9, 0, ADDRESS_MAP_NAME(lc8670_internal_map)), @@ -554,7 +554,7 @@ void lc8670_cpu_device::execute_set_input(int inputnum, int state) // screen_update - handle updating the screen //------------------------------------------------- -UINT32 lc8670_cpu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t lc8670_cpu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_lcd_update_func) return m_lcd_update_func(*this, bitmap, cliprect, m_xram, (REG_MCR & 0x08) && (REG_VCCR & 0x80), REG_STAD); @@ -575,7 +575,7 @@ void lc8670_cpu_device::check_irqs() if (m_irq_flag && !m_after_reti) { int irq = 0; - UINT8 priority = 0; + uint8_t priority = 0; // highest priority IRQ if (!(REG_IE & 0x01) && (m_irq_flag & 0x02)) @@ -663,8 +663,8 @@ void lc8670_cpu_device::base_timer_tick() { if (REG_BTCR & 0x40) { - UINT16 base_counter_l = m_base_timer[0] + 1; - UINT16 base_counter_h = m_base_timer[1]; + uint16_t base_counter_l = m_base_timer[0] + 1; + uint16_t base_counter_h = m_base_timer[1]; if (REG_BTCR & 0x80) // 6-bit mode base_counter_h++; @@ -724,7 +724,7 @@ void lc8670_cpu_device::base_timer_tick() void lc8670_cpu_device::timer0_prescaler_tick() { - UINT16 prescaler = m_timer0_prescaler + 1; + uint16_t prescaler = m_timer0_prescaler + 1; if (prescaler & 0x100) { if (LOG_TIMERS) logerror("%s: timer0 prescaler overflow\n", tag()); @@ -755,7 +755,7 @@ void lc8670_cpu_device::timer0_tick(bool ext_line) // 16-bit timer/counter mode if ((REG_T0CNT & 0xc0) == 0xc0 && (((REG_T0CNT & 0x10) && ext_line) || (!(REG_T0CNT & 0x10) && !ext_line))) { - UINT32 timer0 = ((m_timer0[1] << 8) | m_timer0[0]) + 1; + uint32_t timer0 = ((m_timer0[1] << 8) | m_timer0[0]) + 1; if (timer0 & 0x10000) { @@ -778,7 +778,7 @@ void lc8670_cpu_device::timer0_tick(bool ext_line) // 8-bit timer/counter mode if ((REG_T0CNT & 0x40) && (((REG_T0CNT & 0x10) && ext_line) || (!(REG_T0CNT & 0x10) && !ext_line))) { - UINT16 timer0l = m_timer0[0] + 1; + uint16_t timer0l = m_timer0[0] + 1; if (timer0l & 0x100) { @@ -795,7 +795,7 @@ void lc8670_cpu_device::timer0_tick(bool ext_line) } if ((REG_T0CNT & 0x80) && !ext_line) { - UINT16 timer0h = m_timer0[1] + 1; + uint16_t timer0h = m_timer0[1] + 1; if (timer0h & 0x100) { if (LOG_TIMERS) logerror("%s: timer0 high overflow, IRQ: %d\n", tag(), BIT(REG_T0CNT,3)); @@ -826,10 +826,10 @@ void lc8670_cpu_device::timer1_tick() if (REG_T1CNT & 0x40) { // 16-bit timer mode - UINT16 timer1l = m_timer1[0] + (REG_T1CNT & 0x80 ? 1 : 2); + uint16_t timer1l = m_timer1[0] + (REG_T1CNT & 0x80 ? 1 : 2); if (timer1l & 0x100) { - UINT16 timer1h = m_timer1[1] + 1; + uint16_t timer1h = m_timer1[1] + 1; m_timer1[0] = REG_T1LR; REG_T1CNT |= 0x04; @@ -857,7 +857,7 @@ void lc8670_cpu_device::timer1_tick() // 8-bit timer/pulse generator mode if (REG_T1CNT & 0x40) { - UINT16 timer1l = m_timer1[0] + 1; + uint16_t timer1l = m_timer1[0] + 1; if (timer1l == m_timer1_comparator[0]) update_port1(m_p1_data | 0x80); @@ -878,7 +878,7 @@ void lc8670_cpu_device::timer1_tick() } if (REG_T1CNT & 0x80) { - UINT16 timer1h = m_timer1[1] + 1; + uint16_t timer1h = m_timer1[1] + 1; if (timer1h & 0x100) { @@ -916,7 +916,7 @@ READ8_MEMBER(lc8670_cpu_device::xram_r) { if (!(REG_VCCR & 0x40) || space.debugger_access()) // XRAM access enabled { - UINT8 * xram_bank = m_xram + (REG_XBNK & 0x03) * 0x60; + uint8_t * xram_bank = m_xram + (REG_XBNK & 0x03) * 0x60; switch(REG_XBNK & 0x03) { @@ -939,7 +939,7 @@ WRITE8_MEMBER(lc8670_cpu_device::xram_w) { if (!(REG_VCCR & 0x40) || space.debugger_access()) // XRAM access enabled { - UINT8 * xram_bank = m_xram + (REG_XBNK & 0x03) * 0x60; + uint8_t * xram_bank = m_xram + (REG_XBNK & 0x03) * 0x60; switch(REG_XBNK & 0x03) { @@ -976,10 +976,10 @@ READ8_MEMBER(lc8670_cpu_device::regs_r) return m_io->read_byte(LC8670_PORT7) | 0xf0; // 4-bit read-only port case 0x66: { - UINT8 data = m_vtrbf[((REG_VRMAD2<<8) | REG_VRMAD1) & 0x1ff]; + uint8_t data = m_vtrbf[((REG_VRMAD2<<8) | REG_VRMAD1) & 0x1ff]; if (!space.debugger_access() && (REG_VSEL & 0x10)) { - UINT16 vrmad = (REG_VRMAD1 | (REG_VRMAD2<<8)) + 1; + uint16_t vrmad = (REG_VRMAD1 | (REG_VRMAD2<<8)) + 1; REG_VRMAD1 = vrmad & 0xff; REG_VRMAD2 = (vrmad >> 8) & 0x01; } @@ -1046,7 +1046,7 @@ WRITE8_MEMBER(lc8670_cpu_device::regs_w) m_vtrbf[((REG_VRMAD2<<8) | REG_VRMAD1) & 0x1ff] = data; if (!space.debugger_access() && (REG_VSEL & 0x10)) { - UINT16 vrmad = (REG_VRMAD1 | (REG_VRMAD2<<8)) + 1; + uint16_t vrmad = (REG_VRMAD1 | (REG_VRMAD2<<8)) + 1; REG_VRMAD1 = vrmad & 0xff; REG_VRMAD2 = (vrmad >> 8) & 0x01; } @@ -1070,26 +1070,26 @@ WRITE8_MEMBER(lc8670_cpu_device::regs_w) // HELPERS //************************************************************************** -inline UINT8 lc8670_cpu_device::fetch() +inline uint8_t lc8670_cpu_device::fetch() { - UINT8 data = m_direct->read_byte(m_pc); + uint8_t data = m_direct->read_byte(m_pc); set_pc(m_pc + 1); return data; } -inline UINT8 lc8670_cpu_device::read_data(UINT16 offset) +inline uint8_t lc8670_cpu_device::read_data(uint16_t offset) { return m_data->read_byte(offset); } -inline void lc8670_cpu_device::write_data(UINT16 offset, UINT8 data) +inline void lc8670_cpu_device::write_data(uint16_t offset, uint8_t data) { m_data->write_byte(offset, data); } -inline UINT8 lc8670_cpu_device::read_data_latch(UINT16 offset) +inline uint8_t lc8670_cpu_device::read_data_latch(uint16_t offset) { if (offset == 0x144) return REG_P1; @@ -1099,7 +1099,7 @@ inline UINT8 lc8670_cpu_device::read_data_latch(UINT16 offset) return read_data(offset); } -inline void lc8670_cpu_device::write_data_latch(UINT16 offset, UINT8 data) +inline void lc8670_cpu_device::write_data_latch(uint16_t offset, uint8_t data) { if (offset == 0x144) REG_P1 = data; @@ -1109,34 +1109,34 @@ inline void lc8670_cpu_device::write_data_latch(UINT16 offset, UINT8 data) write_data(offset, data); } -inline void lc8670_cpu_device::update_port1(UINT8 data) +inline void lc8670_cpu_device::update_port1(uint8_t data) { m_p1_data = data; m_io->write_byte(LC8670_PORT1, ((REG_P1 | (m_p1_data & REG_P1FCR)) & REG_P1DDR) | (m_io->read_byte(LC8670_PORT1) & (REG_P1DDR ^ 0xff))); } -inline void lc8670_cpu_device::set_pc(UINT16 new_pc) +inline void lc8670_cpu_device::set_pc(uint16_t new_pc) { m_pc = new_pc; } -inline void lc8670_cpu_device::push(UINT8 data) +inline void lc8670_cpu_device::push(uint8_t data) { REG_SP++; m_mram[REG_SP] = data; } -inline UINT8 lc8670_cpu_device::pop() +inline uint8_t lc8670_cpu_device::pop() { - UINT8 data = m_mram[REG_SP]; + uint8_t data = m_mram[REG_SP]; REG_SP--; return data; } -inline UINT16 lc8670_cpu_device::get_addr() +inline uint16_t lc8670_cpu_device::get_addr() { int mode = m_op & 0x0f; - UINT16 addr; + uint16_t addr; if (mode > 0x01 && mode <= 0x03) addr = GET_D9; @@ -1148,10 +1148,10 @@ inline UINT16 lc8670_cpu_device::get_addr() return addr; } -inline UINT8 lc8670_cpu_device::get_data() +inline uint8_t lc8670_cpu_device::get_data() { int mode = m_op & 0x0f; - UINT8 data; + uint8_t data; if (mode == 0x01) data = GET_I8; @@ -1163,7 +1163,7 @@ inline UINT8 lc8670_cpu_device::get_data() inline void lc8670_cpu_device::change_clock_source() { - UINT32 new_clock = 0; + uint32_t new_clock = 0; switch(REG_OCR & 0x30) { @@ -1187,7 +1187,7 @@ inline void lc8670_cpu_device::change_clock_source() inline void lc8670_cpu_device::check_p_flag() { - UINT8 p_plag = 0; + uint8_t p_plag = 0; for(int i=0; i<8; i++) p_plag ^= BIT(REG_A, i); @@ -1216,7 +1216,7 @@ inline void lc8670_cpu_device::set_irq_flag(int source) m_irq_flag |= 1<>0) & 0xff); push((m_pc>>8) & 0xff); @@ -1278,7 +1278,7 @@ int lc8670_cpu_device::op_call() int lc8670_cpu_device::op_callr() { - UINT16 r16 = fetch(); + uint16_t r16 = fetch(); r16 |= fetch()<<8; push((m_pc>>0) & 0xff); @@ -1290,7 +1290,7 @@ int lc8670_cpu_device::op_callr() int lc8670_cpu_device::op_brf() { - UINT16 r16 = fetch(); + uint16_t r16 = fetch(); r16 |= fetch()<<8; set_pc(m_pc - 1 + r16); @@ -1306,7 +1306,7 @@ int lc8670_cpu_device::op_st() int lc8670_cpu_device::op_callf() { - UINT16 a16 = fetch()<<8; + uint16_t a16 = fetch()<<8; a16 |= fetch(); push((m_pc>>0) & 0xff); @@ -1318,7 +1318,7 @@ int lc8670_cpu_device::op_callf() int lc8670_cpu_device::op_jmpf() { - UINT16 a16 = fetch()<<8; + uint16_t a16 = fetch()<<8; a16 |= fetch(); set_pc(a16); @@ -1329,8 +1329,8 @@ int lc8670_cpu_device::op_jmpf() int lc8670_cpu_device::op_mov() { - UINT16 addr = get_addr(); - UINT8 i8 = GET_I8; + uint16_t addr = get_addr(); + uint8_t i8 = GET_I8; write_data(addr, i8); return 1; @@ -1338,7 +1338,7 @@ int lc8670_cpu_device::op_mov() int lc8670_cpu_device::op_jmp() { - UINT16 new_pc = GET_A12; + uint16_t new_pc = GET_A12; set_pc((m_pc & 0xf000) | new_pc); return 2; @@ -1346,7 +1346,7 @@ int lc8670_cpu_device::op_jmp() int lc8670_cpu_device::op_mul() { - UINT32 res = REG_B * ((REG_A<<8) | REG_C); + uint32_t res = REG_B * ((REG_A<<8) | REG_C); REG_A = (res>>8) & 0xff; REG_B = (res>>16) & 0xff; @@ -1361,8 +1361,8 @@ int lc8670_cpu_device::op_mul() int lc8670_cpu_device::op_be() { - UINT8 data = get_data(); - UINT8 r8 = GET_R8; + uint8_t data = get_data(); + uint8_t r8 = GET_R8; if (REG_A == data) set_pc(m_pc + SIGNED(r8)); @@ -1374,9 +1374,9 @@ int lc8670_cpu_device::op_be() int lc8670_cpu_device::op_be_ri() { - UINT8 data = get_data(); - UINT8 i8 = GET_I8; - UINT8 r8 = GET_R8; + uint8_t data = get_data(); + uint8_t i8 = GET_I8; + uint8_t r8 = GET_R8; if (i8 == data) set_pc(m_pc + SIGNED(r8)); @@ -1389,11 +1389,11 @@ int lc8670_cpu_device::op_be_ri() int lc8670_cpu_device::op_div() { - UINT32 res, mod; + uint32_t res, mod; if (REG_B != 0) { - UINT16 v = ((REG_A<<8) | REG_C); + uint16_t v = ((REG_A<<8) | REG_C); res = v / REG_B; mod = v % REG_B; @@ -1416,8 +1416,8 @@ int lc8670_cpu_device::op_div() int lc8670_cpu_device::op_bne() { - UINT8 data = get_data(); - UINT8 r8 = GET_R8; + uint8_t data = get_data(); + uint8_t r8 = GET_R8; if (REG_A != data) set_pc(m_pc + SIGNED(r8)); @@ -1429,9 +1429,9 @@ int lc8670_cpu_device::op_bne() int lc8670_cpu_device::op_bne_ri() { - UINT8 data = get_data(); - UINT8 i8 = GET_I8; - UINT8 r8 = GET_R8; + uint8_t data = get_data(); + uint8_t i8 = GET_I8; + uint8_t r8 = GET_R8; if (i8 != data) set_pc(m_pc + SIGNED(r8)); @@ -1443,7 +1443,7 @@ int lc8670_cpu_device::op_bne_ri() int lc8670_cpu_device::op_ldf() { - UINT16 addr = REG_TRL | (REG_TRH<<8); + uint16_t addr = REG_TRL | (REG_TRH<<8); m_bankswitch_func(REG_FPR & 0x01 ? 2 : 1); REG_A = m_program->read_byte(addr); @@ -1455,7 +1455,7 @@ int lc8670_cpu_device::op_ldf() int lc8670_cpu_device::op_stf() { - UINT16 addr = REG_TRL | (REG_TRH<<8); + uint16_t addr = REG_TRL | (REG_TRH<<8); m_bankswitch_func(REG_FPR & 0x01 ? 2 : 1); m_program->write_byte(addr, REG_A); @@ -1466,9 +1466,9 @@ int lc8670_cpu_device::op_stf() int lc8670_cpu_device::op_dbnz() { - UINT16 addr = get_addr(); - UINT8 r8 = GET_R8; - UINT8 data = read_data_latch(addr) - 1; + uint16_t addr = get_addr(); + uint8_t r8 = GET_R8; + uint8_t data = read_data_latch(addr) - 1; write_data_latch(addr, data); @@ -1480,10 +1480,10 @@ int lc8670_cpu_device::op_dbnz() int lc8670_cpu_device::op_bpc() { - UINT8 b3 = GET_B3; - UINT16 d9 = GET_D9B3; - UINT8 r8 = GET_R8; - UINT8 data = read_data_latch(d9); + uint8_t b3 = GET_B3; + uint16_t d9 = GET_D9B3; + uint8_t r8 = GET_R8; + uint8_t data = read_data_latch(d9); if (data & (1< 0xff ? 1 : 0); SET_AC(((REG_A & 0x0f) + (data & 0x0f)) > 0x0f ? 1 : 0); @@ -1569,9 +1569,9 @@ int lc8670_cpu_device::op_add() int lc8670_cpu_device::op_bn() { - UINT8 b3 = GET_B3; - UINT16 d9 = GET_D9B3; - UINT8 r8 = GET_R8; + uint8_t b3 = GET_B3; + uint16_t d9 = GET_D9B3; + uint8_t r8 = GET_R8; if (!(read_data(d9) & (1< 0xff ? 1 : 0); SET_AC(((REG_A & 0x0f) + (data & 0x0f) + GET_CY) > 0x0f ? 1 : 0); @@ -1606,7 +1606,7 @@ int lc8670_cpu_device::op_addc() int lc8670_cpu_device::op_ret() { - UINT16 new_pc = pop()<<8; + uint16_t new_pc = pop()<<8; new_pc |= pop(); set_pc(new_pc); @@ -1615,8 +1615,8 @@ int lc8670_cpu_device::op_ret() int lc8670_cpu_device::op_sub() { - UINT8 data = get_data(); - INT32 res = (REG_A - data); + uint8_t data = get_data(); + int32_t res = (REG_A - data); SET_CY(res < 0x00 ? 1 : 0); SET_AC(((REG_A & 0x0f) - (data & 0x0f)) < 0x00 ? 1 : 0); @@ -1630,8 +1630,8 @@ int lc8670_cpu_device::op_sub() int lc8670_cpu_device::op_not1() { - UINT16 d9 = GET_D9B3; - UINT8 data = read_data_latch(d9); + uint16_t d9 = GET_D9B3; + uint8_t data = read_data_latch(d9); data ^= (1<>1) | (GET_CY ? 0x80 : 0x00); + uint8_t a = (REG_A>>1) | (GET_CY ? 0x80 : 0x00); SET_CY(BIT(REG_A,0)); REG_A = a; @@ -1749,8 +1749,8 @@ int lc8670_cpu_device::op_and() int lc8670_cpu_device::op_set1() { - UINT16 d9 = GET_D9B3; - UINT8 data = read_data_latch(d9); + uint16_t d9 = GET_D9B3; + uint8_t data = read_data_latch(d9); data |= (1<(device).m_clocks[_source] = _clock; } + static void static_set_cpu_clock(device_t &device, int _source, uint32_t _clock) { downcast(device).m_clocks[_source] = _clock; } static void static_set_lcd_update_cb(device_t &device, lc8670_lcd_update _cb) { downcast(device).m_lcd_update_func = _cb; } template static devcb_base & static_set_bankswitch_cb(device_t &device, _Object object) { return downcast(device).m_bankswitch_func.set_callback(object); } @@ -102,9 +102,9 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 7; } - virtual UINT32 execute_input_lines() const override { return 4; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 7; } + virtual uint32_t execute_input_lines() const override { return 4; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -116,34 +116,34 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: // helpers - inline UINT8 fetch(); - inline void push(UINT8 data); - inline UINT8 pop(); - inline UINT8 read_data(UINT16 offset); - inline void write_data(UINT16 offset, UINT8 data); - inline UINT8 read_data_latch(UINT16 offset); - inline void write_data_latch(UINT16 offset, UINT8 data); - inline void update_port1(UINT8 data); - inline void set_pc(UINT16 new_pc); - inline UINT8 get_data(); - inline UINT16 get_addr(); + inline uint8_t fetch(); + inline void push(uint8_t data); + inline uint8_t pop(); + inline uint8_t read_data(uint16_t offset); + inline void write_data(uint16_t offset, uint8_t data); + inline uint8_t read_data_latch(uint16_t offset); + inline void write_data_latch(uint16_t offset, uint8_t data); + inline void update_port1(uint8_t data); + inline void set_pc(uint16_t new_pc); + inline uint8_t get_data(); + inline uint16_t get_addr(); inline void change_clock_source(); inline void check_p_flag(); inline void check_p3int(); inline void set_irq_flag(int source); - int decode_op(UINT8 op); + int decode_op(uint8_t op); void check_irqs(); void timer0_prescaler_tick(); void timer0_tick(bool ext_line = false); void timer1_tick(); void base_timer_tick(); - static void dasm_arg(UINT8 op, char *buffer, offs_t pc, int arg, const UINT8 *oprom, int &pos); + static void dasm_arg(uint8_t op, char *buffer, offs_t pc, int arg, const uint8_t *oprom, int &pos); // opcodes handlers int op_nop(); @@ -212,32 +212,32 @@ private: // internal state int m_icount; - UINT16 m_pc; - UINT16 m_ppc; - UINT8 m_op; - UINT8 m_sfr[0x80]; // special function registers - UINT8 m_mram[0x200]; // main RAM - UINT8 m_xram[0xc6]; // XRAM - UINT8 m_vtrbf[0x200]; // work RAM - UINT16 m_irq_flag; - UINT8 m_irq_lev; + uint16_t m_pc; + uint16_t m_ppc; + uint8_t m_op; + uint8_t m_sfr[0x80]; // special function registers + uint8_t m_mram[0x200]; // main RAM + uint8_t m_xram[0xc6]; // XRAM + uint8_t m_vtrbf[0x200]; // work RAM + uint16_t m_irq_flag; + uint8_t m_irq_lev; bool m_after_reti; - UINT8 m_p1_data; - UINT8 m_timer0_prescaler; - UINT8 m_timer0[2]; - UINT8 m_timer1[2]; - UINT8 m_timer1_comparator[2]; - UINT8 m_base_timer[2]; + uint8_t m_p1_data; + uint8_t m_timer0_prescaler; + uint8_t m_timer0[2]; + uint8_t m_timer1[2]; + uint8_t m_timer1_comparator[2]; + uint8_t m_base_timer[2]; bool m_clock_changed; int m_input_lines[4]; // configuration - UINT32 m_clocks[3]; // clock sources + uint32_t m_clocks[3]; // clock sources devcb_write8 m_bankswitch_func; // bankswitch CB lc8670_lcd_update m_lcd_update_func; // LCD update CB // interrupts vectors - static const UINT16 s_irq_vectors[16]; + static const uint16_t s_irq_vectors[16]; // opcodes table typedef int (lc8670_cpu_device::*op_handler)(); @@ -264,8 +264,8 @@ private: struct dasm_entry { const char *str; - UINT8 arg1; - UINT8 arg2; + uint8_t arg1; + uint8_t arg2; bool inv; }; static const dasm_entry s_dasm_table[80]; diff --git a/src/devices/cpu/lc8670/lc8670dsm.cpp b/src/devices/cpu/lc8670/lc8670dsm.cpp index 45985ea6e5f..af2672a88bc 100644 --- a/src/devices/cpu/lc8670/lc8670dsm.cpp +++ b/src/devices/cpu/lc8670/lc8670dsm.cpp @@ -94,7 +94,7 @@ const lc8670_cpu_device::dasm_entry lc8670_cpu_device::s_dasm_table[] = { "SET1", OP_D9B3, OP_NULL, 0 }, }; -void lc8670_cpu_device::dasm_arg(UINT8 op, char *buffer, offs_t pc, int arg, const UINT8 *oprom, int &pos) +void lc8670_cpu_device::dasm_arg(uint8_t op, char *buffer, offs_t pc, int arg, const uint8_t *oprom, int &pos) { switch( arg ) { @@ -151,12 +151,12 @@ void lc8670_cpu_device::dasm_arg(UINT8 op, char *buffer, offs_t pc, int arg, con // helper function //------------------------------------------------- -offs_t lc8670_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t lc8670_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { int pos = 0; char arg1[16], arg2[16]; - UINT8 op = oprom[pos++]; + uint8_t op = oprom[pos++]; int op_idx = decode_op(op); const dasm_entry *inst = &s_dasm_table[op_idx]; diff --git a/src/devices/cpu/lh5801/5801dasm.cpp b/src/devices/cpu/lh5801/5801dasm.cpp index 11fb6d38f4e..c6583b2cadd 100644 --- a/src/devices/cpu/lh5801/5801dasm.cpp +++ b/src/devices/cpu/lh5801/5801dasm.cpp @@ -667,7 +667,7 @@ CPU_DISASSEMBLE( lh5801 ) { int pos = 0; int oper; - UINT16 absolut; + uint16_t absolut; const Entry *entry; int temp; diff --git a/src/devices/cpu/lh5801/5801tbl.hxx b/src/devices/cpu/lh5801/5801tbl.hxx index 98a8d7b1d02..4e48c8c9092 100644 --- a/src/devices/cpu/lh5801/5801tbl.hxx +++ b/src/devices/cpu/lh5801/5801tbl.hxx @@ -6,7 +6,7 @@ (decrement, compare the same) (like in the m6502 processors) */ -UINT8 lh5801_cpu_device::lh5801_add_generic(int left, int right, int carry) +uint8_t lh5801_cpu_device::lh5801_add_generic(int left, int right, int carry) { int res=left+right+carry; int v,c; @@ -23,21 +23,21 @@ UINT8 lh5801_cpu_device::lh5801_add_generic(int left, int right, int carry) return res; } -UINT16 lh5801_cpu_device::lh5801_readop_word() +uint16_t lh5801_cpu_device::lh5801_readop_word() { - UINT16 r; + uint16_t r; r=m_direct->read_byte(P++)<<8; r|=m_direct->read_byte(P++); return r; } -void lh5801_cpu_device::lh5801_adc(UINT8 data) +void lh5801_cpu_device::lh5801_adc(uint8_t data) { m_a=lh5801_add_generic(m_a,data,m_t&C); } -void lh5801_cpu_device::lh5801_add_mem(address_space &space, int addr, UINT8 data) +void lh5801_cpu_device::lh5801_add_mem(address_space &space, int addr, uint8_t data) { int v=lh5801_add_generic(space.read_byte(addr),data,0); space.write_byte(addr,v); @@ -51,20 +51,20 @@ void lh5801_cpu_device::lh5801_adr(PAIR *reg) } } -void lh5801_cpu_device::lh5801_sbc(UINT8 data) +void lh5801_cpu_device::lh5801_sbc(uint8_t data) { m_a=lh5801_add_generic(m_a,data^0xff,m_t&C); } -void lh5801_cpu_device::lh5801_cpa(UINT8 a, UINT8 b) +void lh5801_cpu_device::lh5801_cpa(uint8_t a, uint8_t b) { lh5801_add_generic(a, b^0xff, 1); } -UINT8 lh5801_cpu_device::lh5801_decimaladd_generic(int left, int right, int carry) +uint8_t lh5801_cpu_device::lh5801_decimaladd_generic(int left, int right, int carry) { int res=lh5801_add_generic(left, right, carry); - UINT8 da; + uint8_t da; //DA values taken from official documentation if (!(m_t&C) && !(m_t&H)) @@ -79,25 +79,25 @@ UINT8 lh5801_cpu_device::lh5801_decimaladd_generic(int left, int right, int carr return res + da; } -void lh5801_cpu_device::lh5801_dca(UINT8 data) +void lh5801_cpu_device::lh5801_dca(uint8_t data) { m_a += 0x66; //taken from official documentation m_a=lh5801_decimaladd_generic(m_a, data, m_t&C); } -void lh5801_cpu_device::lh5801_dcs(UINT8 data) +void lh5801_cpu_device::lh5801_dcs(uint8_t data) { m_a=lh5801_decimaladd_generic(m_a, data^0xff, m_t&C); } -void lh5801_cpu_device::lh5801_and(UINT8 data) +void lh5801_cpu_device::lh5801_and(uint8_t data) { m_a&=data; m_t&=~Z; if (!m_a) m_t|=Z; } -void lh5801_cpu_device::lh5801_and_mem(address_space &space, int addr, UINT8 data) +void lh5801_cpu_device::lh5801_and_mem(address_space &space, int addr, uint8_t data) { data&=space.read_byte(addr); m_t&=~Z; @@ -105,27 +105,27 @@ void lh5801_cpu_device::lh5801_and_mem(address_space &space, int addr, UINT8 dat space.write_byte(addr,data); } -void lh5801_cpu_device::lh5801_bit(UINT8 a, UINT8 b) +void lh5801_cpu_device::lh5801_bit(uint8_t a, uint8_t b) { m_t&=~Z; if (!(a&b)) m_t|=Z; } -void lh5801_cpu_device::lh5801_eor(UINT8 data) +void lh5801_cpu_device::lh5801_eor(uint8_t data) { m_a^=data; m_t&=~Z; if (!m_a) m_t|=Z; } -void lh5801_cpu_device::lh5801_ora(UINT8 data) +void lh5801_cpu_device::lh5801_ora(uint8_t data) { m_a|=data; m_t&=~Z; if (!m_a) m_t|=Z; } -void lh5801_cpu_device::lh5801_ora_mem(address_space &space, int addr, UINT8 data) +void lh5801_cpu_device::lh5801_ora_mem(address_space &space, int addr, uint8_t data) { data|=space.read_byte(addr); m_t&=~Z; @@ -133,7 +133,7 @@ void lh5801_cpu_device::lh5801_ora_mem(address_space &space, int addr, UINT8 dat space.write_byte(addr,data); } -void lh5801_cpu_device::lh5801_lda(UINT8 data) +void lh5801_cpu_device::lh5801_lda(uint8_t data) { m_a=data; m_t&=~Z; @@ -166,12 +166,12 @@ void lh5801_cpu_device::lh5801_sin(PAIR *reg) m_program->write_byte(reg->w.l++, m_a); } -void lh5801_cpu_device::lh5801_dec(UINT8 *adr) +void lh5801_cpu_device::lh5801_dec(uint8_t *adr) { *adr=lh5801_add_generic(*adr,0xff,0); } -void lh5801_cpu_device::lh5801_inc(UINT8 *adr) +void lh5801_cpu_device::lh5801_inc(uint8_t *adr) { *adr=lh5801_add_generic(*adr,1,0); } @@ -203,25 +203,25 @@ void lh5801_cpu_device::lh5801_rti() m_t=m_program->read_byte(++S); } -void lh5801_cpu_device::lh5801_push(UINT8 data) +void lh5801_cpu_device::lh5801_push(uint8_t data) { m_program->write_byte(S--, data); } -void lh5801_cpu_device::lh5801_push_word(UINT16 data) +void lh5801_cpu_device::lh5801_push_word(uint16_t data) { m_program->write_byte(S--, data&0xff); m_program->write_byte(S--, data>>8); } -void lh5801_cpu_device::lh5801_jmp(UINT16 adr) +void lh5801_cpu_device::lh5801_jmp(uint16_t adr) { P=adr; } void lh5801_cpu_device::lh5801_branch_plus(int doit) { - UINT8 t=m_direct->read_byte(P++); + uint8_t t=m_direct->read_byte(P++); if (doit) { m_icount-=3; P+=t; @@ -230,7 +230,7 @@ void lh5801_cpu_device::lh5801_branch_plus(int doit) void lh5801_cpu_device::lh5801_branch_minus(int doit) { - UINT8 t=m_direct->read_byte(P++); + uint8_t t=m_direct->read_byte(P++); if (doit) { m_icount-=3; P-=t; @@ -239,7 +239,7 @@ void lh5801_cpu_device::lh5801_branch_minus(int doit) void lh5801_cpu_device::lh5801_lop() { - UINT8 t=m_direct->read_byte(P++); + uint8_t t=m_direct->read_byte(P++); m_icount-=8; if (UL--) { m_icount-=3; @@ -249,7 +249,7 @@ void lh5801_cpu_device::lh5801_lop() void lh5801_cpu_device::lh5801_sjp() { - UINT16 n=lh5801_readop_word(); + uint16_t n=lh5801_readop_word(); lh5801_push_word(P); P=n; } @@ -267,14 +267,14 @@ void lh5801_cpu_device::lh5801_vector(int doit, int nr) void lh5801_cpu_device::lh5801_aex() { - UINT8 t=m_a; + uint8_t t=m_a; m_a=(t<<4)|(t>>4); // flags? } void lh5801_cpu_device::lh5801_drl(address_space &space, int adr) { - UINT16 t=m_a|(space.read_byte(adr)<<8); + uint16_t t=m_a|(space.read_byte(adr)<<8); m_a=t>>8; space.write_byte(adr,t>>4); @@ -282,7 +282,7 @@ void lh5801_cpu_device::lh5801_drl(address_space &space, int adr) void lh5801_cpu_device::lh5801_drr(address_space &space, int adr) { - UINT16 t=space.read_byte(adr)|(m_a<<8); + uint16_t t=space.read_byte(adr)|(m_a<<8); m_a=t; space.write_byte(adr,t>>4); diff --git a/src/devices/cpu/lh5801/lh5801.cpp b/src/devices/cpu/lh5801/lh5801.cpp index 072dbf932a5..67a09e2ae51 100644 --- a/src/devices/cpu/lh5801/lh5801.cpp +++ b/src/devices/cpu/lh5801/lh5801.cpp @@ -65,7 +65,7 @@ enum const device_type LH5801 = &device_creator; -lh5801_cpu_device::lh5801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lh5801_cpu_device::lh5801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, LH5801, "LH5801", tag, owner, clock, "lh5801", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0) @@ -248,7 +248,7 @@ void lh5801_cpu_device::execute_set_input(int irqline, int state) } } -offs_t lh5801_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t lh5801_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( lh5801 ); return CPU_DISASSEMBLE_NAME(lh5801)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/lh5801/lh5801.h b/src/devices/cpu/lh5801/lh5801.h index fe6f3c44f63..6df2bb06a37 100644 --- a/src/devices/cpu/lh5801/lh5801.h +++ b/src/devices/cpu/lh5801/lh5801.h @@ -68,7 +68,7 @@ class lh5801_cpu_device : public cpu_device { public: // construction/destruction - lh5801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lh5801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_in_func(device_t &device, _Object object) { return downcast(device).m_in_func.set_callback(object); } @@ -79,10 +79,10 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 2; } - virtual UINT32 execute_max_cycles() const override { return 19; } - virtual UINT32 execute_input_lines() const override { return 2; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 2; } + virtual uint32_t execute_max_cycles() const override { return 19; } + virtual uint32_t execute_input_lines() const override { return 2; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -93,9 +93,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 5; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 5; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -114,18 +114,18 @@ private: PAIR m_y; int m_tm; //9 bit - UINT8 m_t, m_a; + uint8_t m_t, m_a; int m_bf; int m_dp; int m_pu; int m_pv; - UINT16 m_oldpc; + uint16_t m_oldpc; int m_irq_state; - UINT8 m_ir_flipflop[3]; //interrupt request flipflop: IR0, IR1, IR2 + uint8_t m_ir_flipflop[3]; //interrupt request flipflop: IR0, IR1, IR2 int m_lines_status[2]; //MI and NMI lines status int m_idle; @@ -134,36 +134,36 @@ private: void check_irq(); void lh5801_instruction_fd(); void lh5801_instruction(); - UINT8 lh5801_add_generic(int left, int right, int carry); - UINT16 lh5801_readop_word(); - void lh5801_adc(UINT8 data); - void lh5801_add_mem(address_space &space, int addr, UINT8 data); + uint8_t lh5801_add_generic(int left, int right, int carry); + uint16_t lh5801_readop_word(); + void lh5801_adc(uint8_t data); + void lh5801_add_mem(address_space &space, int addr, uint8_t data); void lh5801_adr(PAIR *reg); - void lh5801_sbc(UINT8 data); - void lh5801_cpa(UINT8 a, UINT8 b); - UINT8 lh5801_decimaladd_generic(int left, int right, int carry); - void lh5801_dca(UINT8 data); - void lh5801_dcs(UINT8 data); - void lh5801_and(UINT8 data); - void lh5801_and_mem(address_space &space, int addr, UINT8 data); - void lh5801_bit(UINT8 a, UINT8 b); - void lh5801_eor(UINT8 data); - void lh5801_ora(UINT8 data); - void lh5801_ora_mem(address_space &space, int addr, UINT8 data); - void lh5801_lda(UINT8 data); + void lh5801_sbc(uint8_t data); + void lh5801_cpa(uint8_t a, uint8_t b); + uint8_t lh5801_decimaladd_generic(int left, int right, int carry); + void lh5801_dca(uint8_t data); + void lh5801_dcs(uint8_t data); + void lh5801_and(uint8_t data); + void lh5801_and_mem(address_space &space, int addr, uint8_t data); + void lh5801_bit(uint8_t a, uint8_t b); + void lh5801_eor(uint8_t data); + void lh5801_ora(uint8_t data); + void lh5801_ora_mem(address_space &space, int addr, uint8_t data); + void lh5801_lda(uint8_t data); void lh5801_lde(PAIR *reg); void lh5801_sde(PAIR *reg); void lh5801_lin(PAIR *reg); void lh5801_sin(PAIR *reg); - void lh5801_dec(UINT8 *adr); - void lh5801_inc(UINT8 *adr); + void lh5801_dec(uint8_t *adr); + void lh5801_inc(uint8_t *adr); void lh5801_pop(); void lh5801_pop_word(PAIR *reg); void lh5801_rtn(); void lh5801_rti(); - void lh5801_push(UINT8 data); - void lh5801_push_word(UINT16 data); - void lh5801_jmp(UINT16 adr); + void lh5801_push(uint8_t data); + void lh5801_push_word(uint16_t data); + void lh5801_jmp(uint16_t adr); void lh5801_branch_plus(int doit); void lh5801_branch_minus(int doit); void lh5801_lop(); diff --git a/src/devices/cpu/lr35902/lr35902.cpp b/src/devices/cpu/lr35902/lr35902.cpp index d86c490179f..d5fcb710c46 100644 --- a/src/devices/cpu/lr35902/lr35902.cpp +++ b/src/devices/cpu/lr35902/lr35902.cpp @@ -63,7 +63,7 @@ enum lr35902_flag const device_type LR35902 = &device_creator; -lr35902_cpu_device::lr35902_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lr35902_cpu_device::lr35902_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, LR35902, "LR35902", tag, owner, clock, "lr35902", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0) , m_A(0) @@ -91,37 +91,37 @@ lr35902_cpu_device::lr35902_cpu_device(const machine_config &mconfig, const char /* Memory functions */ /****************************************************************************/ -inline void lr35902_cpu_device::cycles_passed(UINT8 cycles) +inline void lr35902_cpu_device::cycles_passed(uint8_t cycles) { m_icount -= cycles / m_gb_speed; m_timer_func( cycles ); } -inline UINT8 lr35902_cpu_device::mem_read_byte( UINT16 addr ) +inline uint8_t lr35902_cpu_device::mem_read_byte( uint16_t addr ) { - UINT8 data = m_program->read_byte( addr ); + uint8_t data = m_program->read_byte( addr ); cycles_passed( 4 ); return data; } -inline void lr35902_cpu_device::mem_write_byte( UINT16 addr, UINT8 data ) +inline void lr35902_cpu_device::mem_write_byte( uint16_t addr, uint8_t data ) { m_program->write_byte( addr, data ); cycles_passed( 4 ); } -inline UINT16 lr35902_cpu_device::mem_read_word( UINT16 addr ) +inline uint16_t lr35902_cpu_device::mem_read_word( uint16_t addr ) { - UINT16 data = mem_read_byte( addr ); + uint16_t data = mem_read_byte( addr ); data |= ( mem_read_byte( addr + 1 ) << 8 ); return data; } -inline void lr35902_cpu_device::mem_write_word( UINT16 addr, UINT16 data ) +inline void lr35902_cpu_device::mem_write_word( uint16_t addr, uint16_t data ) { mem_write_byte( addr, data & 0xFF ); mem_write_byte( addr + 1, data >> 8 ); @@ -226,7 +226,7 @@ void lr35902_cpu_device::device_reset() } -offs_t lr35902_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t lr35902_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( lr35902 ); return CPU_DISASSEMBLE_NAME(lr35902)(this, buffer, pc, oprom, opram, options); @@ -235,7 +235,7 @@ offs_t lr35902_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UIN void lr35902_cpu_device::check_interrupts() { - UINT8 irq = m_IE & m_IF; + uint8_t irq = m_IE & m_IF; /* Interrupts should be taken after the first instruction after an EI instruction */ if (m_handle_ei_delay) { @@ -345,7 +345,7 @@ void lr35902_cpu_device::execute_run() else { if ( m_execution_state ) { - UINT8 x; + uint8_t x; /* Execute instruction */ switch( m_op ) { #include "opc_main.hxx" @@ -391,13 +391,13 @@ void lr35902_cpu_device::execute_set_input( int inptnum, int state ) } -UINT8 lr35902_cpu_device::get_speed() +uint8_t lr35902_cpu_device::get_speed() { return 0x7E | ( ( m_gb_speed - 1 ) << 7 ) | m_gb_speed_change_pending; } -void lr35902_cpu_device::set_speed( UINT8 speed_request ) +void lr35902_cpu_device::set_speed( uint8_t speed_request ) { m_gb_speed_change_pending = speed_request & 0x01; } diff --git a/src/devices/cpu/lr35902/lr35902.h b/src/devices/cpu/lr35902/lr35902.h index 326247c6ad8..4288eac51dc 100644 --- a/src/devices/cpu/lr35902/lr35902.h +++ b/src/devices/cpu/lr35902/lr35902.h @@ -37,23 +37,23 @@ class lr35902_cpu_device : public cpu_device { public: // construction/destruction - lr35902_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + lr35902_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); // static configuration helpers template static devcb_base &set_timer_cb(device_t &device, _Object object) { return downcast(device).m_timer_func.set_callback(object); } template static devcb_base &set_incdec16_cb(device_t &device, _Object object) { return downcast(device).m_incdec16_func.set_callback(object); } static void set_halt_bug(device_t &device) { downcast(device).m_has_halt_bug = true; } - UINT8 get_speed(); - void set_speed(UINT8 speed_request); + uint8_t get_speed(); + void set_speed(uint8_t speed_request); - inline UINT8 get_ie() { return m_IE; } - inline void set_ie(UINT8 data) { m_IE = data; } + inline uint8_t get_ie() { return m_IE; } + inline void set_ie(uint8_t data) { m_IE = data; } - inline UINT8 get_if() { return m_IF; } - inline void set_if(UINT8 data) { m_IF = data; } + inline uint8_t get_if() { return m_IF; } + inline void set_if(uint8_t data) { m_IF = data; } - inline void dma_cycles_to_burn(UINT16 cycles_to_burn) { m_dma_cycles_to_burn += cycles_to_burn; } + inline void dma_cycles_to_burn(uint16_t cycles_to_burn) { m_dma_cycles_to_burn += cycles_to_burn; } // Needed for some gameboy operation which needs to read the results // of setting an input during the currently running timeslice. @@ -77,9 +77,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 16; } - virtual UINT32 execute_input_lines() const override { return 5; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 16; } + virtual uint32_t execute_input_lines() const override { return 5; } virtual void execute_run() override; // device_memory_interface overrides @@ -89,34 +89,34 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; - - inline void cycles_passed(UINT8 cycles); - inline UINT8 mem_read_byte(UINT16 addr); - inline void mem_write_byte(UINT16 addr, UINT8 data); - inline UINT16 mem_read_word(UINT16 addr); - inline void mem_write_word(UINT16 addr, UINT16 data); + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; + + inline void cycles_passed(uint8_t cycles); + inline uint8_t mem_read_byte(uint16_t addr); + inline void mem_write_byte(uint16_t addr, uint8_t data); + inline uint16_t mem_read_word(uint16_t addr); + inline void mem_write_word(uint16_t addr, uint16_t data); inline void check_interrupts(); address_space_config m_program_config; - UINT8 m_A; - UINT8 m_F; - UINT8 m_B; - UINT8 m_C; - UINT8 m_D; - UINT8 m_E; - UINT8 m_H; - UINT8 m_L; + uint8_t m_A; + uint8_t m_F; + uint8_t m_B; + uint8_t m_C; + uint8_t m_D; + uint8_t m_E; + uint8_t m_H; + uint8_t m_L; - UINT16 m_SP; - UINT16 m_PC; + uint16_t m_SP; + uint16_t m_PC; /* Interrupt related */ - UINT8 m_IE; - UINT8 m_IF; + uint8_t m_IE; + uint8_t m_IF; int m_irq_state; bool m_handle_ei_delay; lr35902_cpu_device *m_device; @@ -125,14 +125,14 @@ protected: /* Fetch & execute related */ int m_execution_state; - UINT8 m_op; + uint8_t m_op; /* Others */ int m_gb_speed; int m_gb_speed_change_pending; int m_enable; bool m_has_halt_bug; - UINT32 m_dma_cycles_to_burn; + uint32_t m_dma_cycles_to_burn; bool m_entering_halt; /* Callbacks */ diff --git a/src/devices/cpu/lr35902/lr35902d.cpp b/src/devices/cpu/lr35902/lr35902d.cpp index a41b789eddd..09ee836c287 100644 --- a/src/devices/cpu/lr35902/lr35902d.cpp +++ b/src/devices/cpu/lr35902/lr35902d.cpp @@ -36,7 +36,7 @@ static const char *const s_mnemonic[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 s_flags[] = { +static const uint32_t s_flags[] = { 0 ,0 ,0 ,0 ,_OVER,0 ,0 , 0 ,0 ,0 ,0 ,0 ,0 ,_OVER, 0 ,0 ,0 ,0 ,0 ,0 ,0 , @@ -48,7 +48,7 @@ static const UINT32 s_flags[] = { struct lr35902dasm { - UINT8 mnemonic; + uint8_t mnemonic; const char *arguments; }; @@ -195,9 +195,9 @@ CPU_DISASSEMBLE( lr35902 ) const lr35902dasm *d; const char /* *symbol,*/ *src; char *dst; - INT8 offset; - UINT8 op, op1; - UINT16 ea; + int8_t offset; + uint8_t op, op1; + uint16_t ea; int pos = 0; dst = buffer; @@ -251,7 +251,7 @@ CPU_DISASSEMBLE( lr35902 ) dst += sprintf( dst, "$%04X", ea ); break; case 'O': /* Offset relative to PC */ - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; dst += sprintf( dst, "$%04X", pc + offset + 2 ); break; case 'V': /* Restart vector */ diff --git a/src/devices/cpu/lr35902/opc_cb.hxx b/src/devices/cpu/lr35902/opc_cb.hxx index 19470be9f3c..3677450bc59 100644 --- a/src/devices/cpu/lr35902/opc_cb.hxx +++ b/src/devices/cpu/lr35902/opc_cb.hxx @@ -2,8 +2,8 @@ // copyright-holders:Wilbert Pol #define RLC_8BIT(x) \ { \ - UINT8 f; \ - (x)=(UINT8)(((x)<<1)|((x)>>7)); \ + uint8_t f; \ + (x)=(uint8_t)(((x)<<1)|((x)>>7)); \ if( (x)&1 ) \ f=FLAG_C; \ else \ @@ -15,9 +15,9 @@ #define RL_8BIT(x) \ { \ - UINT8 r; \ + uint8_t r; \ r=((x)&0x80)?FLAG_C:0; \ - (x)=(UINT8)(((x)<<1)|((m_F&FLAG_C)?1:0)); \ + (x)=(uint8_t)(((x)<<1)|((m_F&FLAG_C)?1:0)); \ if( (x)==0 ) \ r|=FLAG_Z; \ m_F=r; \ @@ -25,8 +25,8 @@ #define RRC_8BIT(x) \ { \ - UINT8 f; \ - (x)=(UINT8)(((x)>>1)|((x)<<7)); \ + uint8_t f; \ + (x)=(uint8_t)(((x)>>1)|((x)<<7)); \ if( (x)&0x80 ) \ f=FLAG_C; \ else \ @@ -38,9 +38,9 @@ #define RR_8BIT(x) \ { \ - UINT8 r; \ + uint8_t r; \ r=((x)&1)?FLAG_C:0; \ - (x)=(UINT8)(((x)>>1)|((m_F&FLAG_C)?0x80:0)); \ + (x)=(uint8_t)(((x)>>1)|((m_F&FLAG_C)?0x80:0)); \ if( (x)==0 ) \ r|=FLAG_Z; \ m_F=r; \ @@ -48,7 +48,7 @@ #define SLA_8BIT(x) \ { \ - UINT8 f; \ + uint8_t f; \ if( (x)&0x80 ) \ f=FLAG_C; \ else \ @@ -61,19 +61,19 @@ #define SRA_8BIT(x) \ { \ - UINT8 f; \ + uint8_t f; \ if( (x)&1 ) \ f=FLAG_C; \ else \ f=0; \ - (x)=(UINT8)(((char)(x))>>1); \ + (x)=(uint8_t)(((char)(x))>>1); \ if( (x)==0 ) \ f|=FLAG_Z; \ m_F=f; \ } #define SWAP_8BIT(x) \ - (x)=(UINT8)(((x)>>4)|((x)<<4)); \ + (x)=(uint8_t)(((x)>>4)|((x)<<4)); \ if( (x)==0 ) \ m_F=FLAG_Z; \ else \ @@ -82,7 +82,7 @@ #define SRL_8BIT(x) \ { \ - UINT8 f; \ + uint8_t f; \ if( (x)&1 ) \ f=FLAG_C; \ else \ @@ -95,9 +95,9 @@ #define BIT_8BIT(n,x) \ if( (x)&(1<<(n)) ) \ - m_F=(UINT8)(FLAG_H|(m_F&FLAG_C)); \ + m_F=(uint8_t)(FLAG_H|(m_F&FLAG_C)); \ else \ - m_F=(UINT8)(FLAG_Z|FLAG_H|(m_F&FLAG_C)); + m_F=(uint8_t)(FLAG_Z|FLAG_H|(m_F&FLAG_C)); #define RES_8BIT(n,x) (x)&=~(1<<(n)); @@ -138,7 +138,7 @@ case 0x05: case 0x06: /* RLC (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr ); RLC_8BIT (x) @@ -183,7 +183,7 @@ case 0x0D: case 0x0E: /* RRC (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RRC_8BIT (x) @@ -228,7 +228,7 @@ case 0x15: case 0x16: /* RL (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RL_8BIT (x) @@ -273,7 +273,7 @@ case 0x1D: case 0x1E: /* RR (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RR_8BIT (x) @@ -318,7 +318,7 @@ case 0x25: case 0x26: /* SLA (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SLA_8BIT (x) @@ -363,7 +363,7 @@ case 0x2D: case 0x2E: /* SRA (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SRA_8BIT (x) @@ -408,7 +408,7 @@ case 0x35: case 0x36: /* SWAP (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SWAP_8BIT (x) @@ -453,7 +453,7 @@ case 0x3D: case 0x3E: /* SRL (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SRL_8BIT (x) @@ -498,7 +498,7 @@ case 0x45: case 0x46: /* BIT 0,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); BIT_8BIT (0, x) @@ -542,7 +542,7 @@ case 0x4D: case 0x4E: /* BIT 1,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); BIT_8BIT (1, x) @@ -586,7 +586,7 @@ case 0x55: case 0x56: /* BIT 2,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); BIT_8BIT (2, x) @@ -630,7 +630,7 @@ case 0x5D: case 0x5E: /* BIT 3,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); BIT_8BIT (3, x) @@ -674,7 +674,7 @@ case 0x65: case 0x66: /* BIT 4,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); BIT_8BIT (4, x) @@ -718,7 +718,7 @@ case 0x6D: case 0x6E: /* BIT 5,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); BIT_8BIT (5, x) @@ -762,7 +762,7 @@ case 0x75: case 0x76: /* BIT 6,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); BIT_8BIT (6, x) @@ -806,7 +806,7 @@ case 0x7D: case 0x7E: /* BIT 7,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); BIT_8BIT (7, x) @@ -850,7 +850,7 @@ case 0x85: case 0x86: /* RES 0,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RES_8BIT (0, x) @@ -895,7 +895,7 @@ case 0x8D: case 0x8E: /* RES 1,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RES_8BIT (1, x) @@ -940,7 +940,7 @@ case 0x95: case 0x96: /* RES 2,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RES_8BIT (2, x) @@ -985,7 +985,7 @@ case 0x9D: case 0x9E: /* RES 3,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RES_8BIT (3, x) @@ -1030,7 +1030,7 @@ case 0xA5: case 0xA6: /* RES 4,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RES_8BIT (4, x) @@ -1075,7 +1075,7 @@ case 0xAD: case 0xAE: /* RES 5,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RES_8BIT (5, x) @@ -1120,7 +1120,7 @@ case 0xB5: case 0xB6: /* RES 6,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RES_8BIT (6, x) @@ -1165,7 +1165,7 @@ case 0xBD: case 0xBE: /* RES 7,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); RES_8BIT (7, x) @@ -1210,7 +1210,7 @@ case 0xC5: case 0xC6: /* SET 0,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SET_8BIT (0, x) @@ -1255,7 +1255,7 @@ case 0xCD: case 0xCE: /* SET 1,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SET_8BIT (1, x) @@ -1300,7 +1300,7 @@ case 0xD5: case 0xD6: /* SET 2,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SET_8BIT (2, x) @@ -1345,7 +1345,7 @@ case 0xDD: case 0xDE: /* SET 3,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SET_8BIT (3, x) @@ -1390,7 +1390,7 @@ case 0xE5: case 0xE6: /* SET 4,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SET_8BIT (4, x) @@ -1435,7 +1435,7 @@ case 0xED: case 0xEE: /* SET 5,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SET_8BIT (5, x) @@ -1480,7 +1480,7 @@ case 0xF5: case 0xF6: /* SET 6,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SET_8BIT (6, x) @@ -1525,7 +1525,7 @@ case 0xFD: case 0xFE: /* SET 7,(HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; + uint16_t addr = ( m_H << 8 ) | m_L; x = mem_read_byte( addr); SET_8BIT (7, x) diff --git a/src/devices/cpu/lr35902/opc_main.hxx b/src/devices/cpu/lr35902/opc_main.hxx index 029ba822427..e86a48992e8 100644 --- a/src/devices/cpu/lr35902/opc_main.hxx +++ b/src/devices/cpu/lr35902/opc_main.hxx @@ -2,10 +2,10 @@ // copyright-holders:Wilbert Pol #define INC_8BIT(x) \ { \ - UINT8 r,f; \ + uint8_t r,f; \ x++; \ r=(x); \ - f=(UINT8)(m_F&FLAG_C); \ + f=(uint8_t)(m_F&FLAG_C); \ if( r==0 ) f|=FLAG_Z; \ if( (r&0xF)==0 ) f|=FLAG_H; \ m_F=f; \ @@ -13,10 +13,10 @@ #define DEC_8BIT(x) \ { \ - UINT8 r,f; \ + uint8_t r,f; \ x--; \ r=(x); \ - f=(UINT8)((m_F&FLAG_C)|FLAG_N); \ + f=(uint8_t)((m_F&FLAG_C)|FLAG_N); \ if( r==0 ) f|=FLAG_Z; \ if( (r&0xF)==0xF ) f|=FLAG_H; \ m_F=f; \ @@ -24,25 +24,25 @@ #define INC_16BIT(x,y) \ { \ - UINT16 r = x << 8 | y; \ + uint16_t r = x << 8 | y; \ if (++y == 0) x++; \ m_incdec16_func(r << 16 | x << 8 | y); \ } #define DEC_16BIT(x,y) \ { \ - UINT16 r = x << 8 | y; \ + uint16_t r = x << 8 | y; \ if (--y == 0xff) x--; \ m_incdec16_func(r << 16 | x << 8 | y); \ } #define ADD_HL_RR(x) \ { \ - UINT32 r1,r2; \ - UINT8 f; \ + uint32_t r1,r2; \ + uint8_t f; \ r1=((m_H<<8)|m_L)+(x); \ r2=(((m_H<<8)|m_L)&0xFFF)+((x)&0xFFF); \ - f=(UINT8)(m_F&FLAG_Z); \ + f=(uint8_t)(m_F&FLAG_Z); \ if( r1>0xFFFF ) f|=FLAG_C; \ if( r2>0x0FFF ) f|=FLAG_H; \ m_L = r1; \ @@ -52,12 +52,12 @@ #define ADD_A_X(x) \ { \ - UINT16 r1,r2; \ - UINT8 f; \ - r1=(UINT16)((m_A&0xF)+((x)&0xF)); \ - r2=(UINT16)(m_A+(x)); \ - m_A=(UINT8)r2; \ - if( ((UINT8)r2)==0 ) f=FLAG_Z; \ + uint16_t r1,r2; \ + uint8_t f; \ + r1=(uint16_t)((m_A&0xF)+((x)&0xF)); \ + r2=(uint16_t)(m_A+(x)); \ + m_A=(uint8_t)r2; \ + if( ((uint8_t)r2)==0 ) f=FLAG_Z; \ else f=0; \ if( r2>0xFF ) f|=FLAG_C; \ if( r1>0xF ) f|=FLAG_H; \ @@ -66,12 +66,12 @@ #define SUB_A_X(x) \ { \ - UINT16 r1,r2; \ - UINT8 f; \ - r1=(UINT16)((m_A&0xF)-((x)&0xF)); \ - r2=(UINT16)(m_A-(x)); \ - m_A=(UINT8)r2; \ - if( ((UINT8)r2)==0 ) f=FLAG_N|FLAG_Z; \ + uint16_t r1,r2; \ + uint8_t f; \ + r1=(uint16_t)((m_A&0xF)-((x)&0xF)); \ + r2=(uint16_t)(m_A-(x)); \ + m_A=(uint8_t)r2; \ + if( ((uint8_t)r2)==0 ) f=FLAG_N|FLAG_Z; \ else f=FLAG_N; \ if( r2>0xFF ) f|=FLAG_C; \ if( r1>0xF ) f|=FLAG_H; \ @@ -80,11 +80,11 @@ #define CP_A_X(x) \ { \ - UINT16 r1,r2; \ - UINT8 f; \ - r1=(UINT16)((m_A&0xF)-((x)&0xF)); \ - r2=(UINT16)(m_A-(x)); \ - if( ((UINT8)r2)==0 ) f=FLAG_N|FLAG_Z; \ + uint16_t r1,r2; \ + uint8_t f; \ + r1=(uint16_t)((m_A&0xF)-((x)&0xF)); \ + r2=(uint16_t)(m_A-(x)); \ + if( ((uint8_t)r2)==0 ) f=FLAG_N|FLAG_Z; \ else f=FLAG_N; \ if( r2>0xFF ) f|=FLAG_C; \ if( r1>0xF ) f|=FLAG_H; \ @@ -93,12 +93,12 @@ #define SBC_A_X(x) \ { \ - UINT16 r1,r2; \ - UINT8 f; \ - r1=(UINT16)((m_A&0xF)-((x)&0xF)-((m_F&FLAG_C)?1:0)); \ - r2=(UINT16)(m_A-(x)-((m_F&FLAG_C)?1:0)); \ - m_A=(UINT8)r2; \ - if( ((UINT8)r2)==0 ) f=FLAG_N|FLAG_Z; \ + uint16_t r1,r2; \ + uint8_t f; \ + r1=(uint16_t)((m_A&0xF)-((x)&0xF)-((m_F&FLAG_C)?1:0)); \ + r2=(uint16_t)(m_A-(x)-((m_F&FLAG_C)?1:0)); \ + m_A=(uint8_t)r2; \ + if( ((uint8_t)r2)==0 ) f=FLAG_N|FLAG_Z; \ else f=FLAG_N; \ if( r2>0xFF ) f|=FLAG_C; \ if( r1>0xF ) f|=FLAG_H; \ @@ -107,11 +107,11 @@ #define ADC_A_X(x) \ { \ - UINT16 r1,r2; \ - UINT8 f; \ - r1=(UINT16)((m_A&0xF)+((x)&0xF)+((m_F&FLAG_C)?1:0)); \ - r2=(UINT16)(m_A+(x)+((m_F&FLAG_C)?1:0)); \ - if( (m_A=(UINT8)r2)==0 ) f=FLAG_Z; \ + uint16_t r1,r2; \ + uint8_t f; \ + r1=(uint16_t)((m_A&0xF)+((x)&0xF)+((m_F&FLAG_C)?1:0)); \ + r2=(uint16_t)(m_A+(x)+((m_F&FLAG_C)?1:0)); \ + if( (m_A=(uint8_t)r2)==0 ) f=FLAG_Z; \ else f=0; \ if( r2>0xFF ) f|=FLAG_C; \ if( r1>0xF ) f|=FLAG_H; \ @@ -179,7 +179,7 @@ case 0x06: /* LD B,n8 */ case 0x07: /* RLCA */ - m_A = (UINT8) ((m_A << 1) | (m_A >> 7)); + m_A = (uint8_t) ((m_A << 1) | (m_A >> 7)); if (m_A & 1) { m_F = FLAG_C; @@ -221,7 +221,7 @@ case 0x0E: /* LD C,n8 */ break; case 0x0F: /* RRCA */ - m_A = (UINT8) ((m_A >> 1) | (m_A << 7)); + m_A = (uint8_t) ((m_A >> 1) | (m_A << 7)); m_F = 0; if (m_A & 0x80) { @@ -235,7 +235,7 @@ case 0x10: /* STOP */ { // Quite a lot of time for a simple input clock change... // And still not all speedchange related tests are passing. - UINT32 cycles = ( 2 * 45 + 1 ) * 65536 + 8; + uint32_t cycles = ( 2 * 45 + 1 ) * 65536 + 8; do { cycles_passed(128); @@ -274,12 +274,12 @@ case 0x17: /* RLA */ x = (m_A & 0x80) ? FLAG_C : 0; - m_A = (UINT8) ((m_A << 1) | ((m_F & FLAG_C) ? 1 : 0)); + m_A = (uint8_t) ((m_A << 1) | ((m_F & FLAG_C) ? 1 : 0)); m_F = x; break; case 0x18: /* JR n8 */ { - INT8 offset; + int8_t offset; offset = mem_read_byte( m_PC++ ); m_PC += offset; @@ -314,12 +314,12 @@ case 0x1F: /* RRA */ x = (m_A & 1) ? FLAG_C : 0; - m_A = (UINT8) ((m_A >> 1) | ((m_F & FLAG_C) ? 0x80 : 0)); + m_A = (uint8_t) ((m_A >> 1) | ((m_F & FLAG_C) ? 0x80 : 0)); m_F = x; break; case 0x20: /* JR NZ,n8 */ { - INT8 offset = mem_read_byte( m_PC++ ); + int8_t offset = mem_read_byte( m_PC++ ); if (! (m_F & FLAG_Z) ) { m_PC += offset; @@ -379,7 +379,7 @@ case 0x27: /* DAA */ break; case 0x28: /* JR Z,n8 */ { - INT8 offset = mem_read_byte( m_PC++ ); + int8_t offset = mem_read_byte( m_PC++ ); if (m_F & FLAG_Z) { @@ -419,7 +419,7 @@ case 0x2F: /* CPL */ break; case 0x30: /* JR NC,n8 */ { - INT8 offset = mem_read_byte( m_PC++ ); + int8_t offset = mem_read_byte( m_PC++ ); if ( ! (m_F & FLAG_C) ) { @@ -443,10 +443,10 @@ case 0x33: /* INC SP */ break; case 0x34: /* INC (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; - UINT8 r, f; + uint16_t addr = ( m_H << 8 ) | m_L; + uint8_t r, f; - f = (UINT8) (m_F & FLAG_C); + f = (uint8_t) (m_F & FLAG_C); r = mem_read_byte( addr ); r += 1; mem_write_byte( addr, r ); @@ -462,10 +462,10 @@ case 0x34: /* INC (HL) */ break; case 0x35: /* DEC (HL) */ { - UINT16 addr = ( m_H << 8 ) | m_L; - UINT8 r, f; + uint16_t addr = ( m_H << 8 ) | m_L; + uint8_t r, f; - f = (UINT8) ((m_F & FLAG_C) | FLAG_N); + f = (uint8_t) ((m_F & FLAG_C) | FLAG_N); r = mem_read_byte( addr ); r -= 1; mem_write_byte( addr, r ); @@ -481,17 +481,17 @@ case 0x35: /* DEC (HL) */ break; case 0x36: /* LD (HL),n8 */ { - UINT8 v = mem_read_byte( m_PC++ ); + uint8_t v = mem_read_byte( m_PC++ ); mem_write_byte( ( m_H << 8 ) | m_L, v ); } break; case 0x37: /* SCF */ - m_F = (UINT8) ((m_F & FLAG_Z) | FLAG_C); + m_F = (uint8_t) ((m_F & FLAG_Z) | FLAG_C); break; case 0x38: /* JR C,n8 */ { - INT8 offset = mem_read_byte( m_PC++ ); + int8_t offset = mem_read_byte( m_PC++ ); if (m_F & FLAG_C) { @@ -526,7 +526,7 @@ case 0x3E: /* LD A,n8 */ break; case 0x3F: /* CCF */ - m_F = (UINT8) ((m_F & FLAG_Z) | ((m_F & FLAG_C) ? 0 : FLAG_C)); + m_F = (uint8_t) ((m_F & FLAG_Z) | ((m_F & FLAG_C) ? 0 : FLAG_C)); break; case 0x40: /* LD B,B */ break; @@ -1055,7 +1055,7 @@ case 0xC1: /* POP BC */ break; case 0xC2: /* JP NZ,n16 */ { - UINT16 addr = mem_read_word( m_PC ); + uint16_t addr = mem_read_word( m_PC ); m_PC += 2; if ( ! (m_F & FLAG_Z) ) @@ -1071,7 +1071,7 @@ case 0xC3: /* JP n16 */ break; case 0xC4: /* CALL NZ,n16 */ { - UINT16 addr = mem_read_word( m_PC ); + uint16_t addr = mem_read_word( m_PC ); m_PC += 2; if ( ! (m_F & FLAG_Z) ) @@ -1115,7 +1115,7 @@ case 0xC9: /* RET */ break; case 0xCA: /* JP Z,n16 */ { - UINT16 addr = mem_read_word( m_PC ); + uint16_t addr = mem_read_word( m_PC ); m_PC += 2; if (m_F & FLAG_Z) @@ -1134,7 +1134,7 @@ case 0xCB: /* PREFIX! */ break; case 0xCC: /* CALL Z,n16 */ { - UINT16 addr = mem_read_word( m_PC ); + uint16_t addr = mem_read_word( m_PC ); m_PC += 2; if (m_F & FLAG_Z) @@ -1148,7 +1148,7 @@ case 0xCC: /* CALL Z,n16 */ break; case 0xCD: /* CALL n16 */ { - UINT16 addr = mem_read_word( m_PC ); + uint16_t addr = mem_read_word( m_PC ); m_PC += 2; // Internal delay @@ -1183,7 +1183,7 @@ case 0xD1: /* POP DE */ break; case 0xD2: /* JP NC,n16 */ { - UINT16 addr = mem_read_word( m_PC ); + uint16_t addr = mem_read_word( m_PC ); m_PC += 2; if ( ! (m_F & FLAG_C) ) @@ -1195,7 +1195,7 @@ case 0xD2: /* JP NC,n16 */ break; case 0xD4: /* CALL NC,n16 */ { - UINT16 addr = mem_read_word( m_PC ); + uint16_t addr = mem_read_word( m_PC ); m_PC += 2; if ( ! (m_F & FLAG_C) ) @@ -1240,7 +1240,7 @@ case 0xD9: /* RETI */ break; case 0xDA: /* JP C,n16 */ { - UINT16 addr = mem_read_word( m_PC ); + uint16_t addr = mem_read_word( m_PC ); m_PC += 2; if (m_F & FLAG_C) @@ -1252,7 +1252,7 @@ case 0xDA: /* JP C,n16 */ break; case 0xDC: /* CALL C,n16 */ { - UINT16 addr = mem_read_word( m_PC ); + uint16_t addr = mem_read_word( m_PC ); m_PC += 2; if (m_F & FLAG_C) @@ -1277,7 +1277,7 @@ case 0xDF: /* RST $18 */ break; case 0xE0: /* LD ($FF00+n8),A */ { - UINT8 v = mem_read_byte( m_PC++ ); + uint8_t v = mem_read_byte( m_PC++ ); mem_write_byte( 0xFF00 + v, m_A ); } break; @@ -1313,11 +1313,11 @@ case 0xE8: /* ADD SP,n8 */ */ { - INT32 n; + int32_t n; - n = (INT8) mem_read_byte( m_PC++ ); + n = (int8_t) mem_read_byte( m_PC++ ); - if ( ( m_SP & 0xFF ) + (UINT8)(n & 0xFF) > 0xFF ) + if ( ( m_SP & 0xFF ) + (uint8_t)(n & 0xFF) > 0xFF ) { m_F = FLAG_C; } @@ -1331,7 +1331,7 @@ case 0xE8: /* ADD SP,n8 */ m_F |= FLAG_H; } - m_SP = (UINT16) ( m_SP + n ); + m_SP = (uint16_t) ( m_SP + n ); } cycles_passed( 8 ); break; @@ -1356,7 +1356,7 @@ case 0xEF: /* RST $28 */ break; case 0xF0: /* LD A,($FF00+n8) */ { - UINT8 v = mem_read_byte( m_PC++ ); + uint8_t v = mem_read_byte( m_PC++ ); m_A = mem_read_byte( 0xFF00 + v ); } break; @@ -1391,7 +1391,7 @@ case 0xF7: /* RST $30 */ break; case 0xF8: /* LD HL,SP+n8 */ /* - * n = one UINT8 signed immediate value. + * n = one uint8_t signed immediate value. * Flags affected: * Z - Reset. * N - Reset. @@ -1401,11 +1401,11 @@ case 0xF8: /* LD HL,SP+n8 */ */ { - INT32 n; + int32_t n; - n = (INT8) mem_read_byte( m_PC++ ); + n = (int8_t) mem_read_byte( m_PC++ ); - if ( ( m_SP & 0xFF ) + (UINT8)(n & 0xFF) > 0xFF ) + if ( ( m_SP & 0xFF ) + (uint8_t)(n & 0xFF) > 0xFF ) { m_F = FLAG_C; } @@ -1419,7 +1419,7 @@ case 0xF8: /* LD HL,SP+n8 */ m_F |= FLAG_H; } - UINT16 res = m_SP + n; + uint16_t res = m_SP + n; m_L = res & 0xFF; m_H = res >> 8; diff --git a/src/devices/cpu/m37710/m37710.cpp b/src/devices/cpu/m37710/m37710.cpp index ffaa7f46f05..ea4356f6a26 100644 --- a/src/devices/cpu/m37710/m37710.cpp +++ b/src/devices/cpu/m37710/m37710.cpp @@ -94,7 +94,7 @@ ADDRESS_MAP_END // many other combinations of RAM and ROM size exist -m37710_cpu_device::m37710_cpu_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, address_map_delegate map_delegate) +m37710_cpu_device::m37710_cpu_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, address_map_delegate map_delegate) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, map_delegate) , m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0) @@ -102,25 +102,25 @@ m37710_cpu_device::m37710_cpu_device(const machine_config &mconfig, device_type } -m37702m2_device::m37702m2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m37702m2_device::m37702m2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m37710_cpu_device(mconfig, M37702M2, "M37702M2", tag, owner, clock, "m37702m2", __FILE__, address_map_delegate(FUNC(m37702m2_device::map), this)) { } -m37702m2_device::m37702m2_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) +m37702m2_device::m37702m2_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) : m37710_cpu_device(mconfig, type, name, tag, owner, clock, shortname, source, address_map_delegate(FUNC(m37702m2_device::map), this)) { } -m37702s1_device::m37702s1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m37702s1_device::m37702s1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m37710_cpu_device(mconfig, M37702S1, "M37702S1", tag, owner, clock, "m37702s1", __FILE__, address_map_delegate(FUNC(m37702s1_device::map), this)) { } -m37710s4_device::m37710s4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m37710s4_device::m37710s4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m37710_cpu_device(mconfig, M37710S4, "M37710S4", tag, owner, clock, "m37710s4", __FILE__, address_map_delegate(FUNC(m37710s4_device::map), this)) { } @@ -458,9 +458,9 @@ void m37710_cpu_device::m37710_recalc_timer(int timer) } } -UINT8 m37710_cpu_device::m37710_internal_r(int offset) +uint8_t m37710_cpu_device::m37710_internal_r(int offset) { - UINT8 d; + uint8_t d; #if M37710_DEBUG if (offset > 1) @@ -567,11 +567,11 @@ UINT8 m37710_cpu_device::m37710_internal_r(int offset) return m_m37710_regs[offset]; } -void m37710_cpu_device::m37710_internal_w(int offset, UINT8 data) +void m37710_cpu_device::m37710_internal_w(int offset, uint8_t data) { int i; - UINT8 prevdata; - UINT8 d; + uint8_t prevdata; + uint8_t d; #if M37710_DEBUG if (offset != 0x60) // filter out watchdog @@ -661,7 +661,7 @@ void m37710_cpu_device::m37710_internal_w(int offset, UINT8 data) READ16_MEMBER( m37710_cpu_device::m37710_internal_word_r ) { - UINT16 ret = 0; + uint16_t ret = 0; if (mem_mask & 0x00ff) ret |= m37710_internal_r(offset*2); @@ -943,7 +943,7 @@ CPU_DISASSEMBLE( m37710 ) } -offs_t m37710_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m37710_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return m7700_disassemble(buffer, (pc&0xffff), pc>>16, oprom, FLAG_M, FLAG_X); } @@ -1183,7 +1183,7 @@ void m37710_cpu_device::execute_set_input(int inputnum, int state) } -void m37710_cpu_device::m37710i_set_execution_mode(UINT32 mode) +void m37710_cpu_device::m37710i_set_execution_mode(uint32_t mode) { m_opcodes = m37710i_opcodes[mode]; m_opcodes42 = m37710i_opcodes2[mode]; @@ -1199,7 +1199,7 @@ void m37710_cpu_device::m37710i_set_execution_mode(UINT32 mode) /* =============================== INTERRUPTS ============================= */ /* ======================================================================== */ -void m37710_cpu_device::m37710i_interrupt_software(UINT32 vector) +void m37710_cpu_device::m37710i_interrupt_software(uint32_t vector) { CLK(13); m37710i_push_8(REG_PB>>16); diff --git a/src/devices/cpu/m37710/m37710.h b/src/devices/cpu/m37710/m37710.h index e88408e527a..32ec57ee04a 100644 --- a/src/devices/cpu/m37710/m37710.h +++ b/src/devices/cpu/m37710/m37710.h @@ -94,7 +94,7 @@ class m37710_cpu_device : public cpu_device { public: // construction/destruction - m37710_cpu_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, address_map_delegate map_delegate); + m37710_cpu_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, address_map_delegate map_delegate); DECLARE_READ16_MEMBER( m37710_internal_word_r ); DECLARE_WRITE16_MEMBER( m37710_internal_word_w ); @@ -105,9 +105,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 20; /* rough guess */ } - virtual UINT32 execute_input_lines() const override { return M37710_LINE_MAX; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 20; /* rough guess */ } + virtual uint32_t execute_input_lines() const override { return M37710_LINE_MAX; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -120,71 +120,71 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 6; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 6; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; address_space_config m_io_config; - UINT32 m_a; /* Accumulator */ - UINT32 m_b; /* holds high byte of accumulator */ - UINT32 m_ba; /* Secondary Accumulator */ - UINT32 m_bb; /* holds high byte of secondary accumulator */ - UINT32 m_x; /* Index Register X */ - UINT32 m_y; /* Index Register Y */ - UINT32 m_xh; /* holds high byte of x */ - UINT32 m_yh; /* holds high byte of y */ - UINT32 m_s; /* Stack Pointer */ - UINT32 m_pc; /* Program Counter */ - UINT32 m_ppc; /* Previous Program Counter */ - UINT32 m_pb; /* Program Bank (shifted left 16) */ - UINT32 m_db; /* Data Bank (shifted left 16) */ - UINT32 m_d; /* Direct Register */ - UINT32 m_flag_e; /* Emulation Mode Flag */ - UINT32 m_flag_m; /* Memory/Accumulator Select Flag */ - UINT32 m_flag_x; /* Index Select Flag */ - UINT32 m_flag_n; /* Negative Flag */ - UINT32 m_flag_v; /* Overflow Flag */ - UINT32 m_flag_d; /* Decimal Mode Flag */ - UINT32 m_flag_i; /* Interrupt Mask Flag */ - UINT32 m_flag_z; /* Zero Flag (inverted) */ - UINT32 m_flag_c; /* Carry Flag */ - UINT32 m_line_irq; /* Bitmask of pending IRQs */ - UINT32 m_ipl; /* Interrupt priority level (top of PSW) */ - UINT32 m_ir; /* Instruction Register */ - UINT32 m_im; /* Immediate load value */ - UINT32 m_im2; /* Immediate load target */ - UINT32 m_im3; /* Immediate load target */ - UINT32 m_im4; /* Immediate load target */ - UINT32 m_irq_delay; /* delay 1 instruction before checking irq */ - UINT32 m_irq_level; /* irq level */ + uint32_t m_a; /* Accumulator */ + uint32_t m_b; /* holds high byte of accumulator */ + uint32_t m_ba; /* Secondary Accumulator */ + uint32_t m_bb; /* holds high byte of secondary accumulator */ + uint32_t m_x; /* Index Register X */ + uint32_t m_y; /* Index Register Y */ + uint32_t m_xh; /* holds high byte of x */ + uint32_t m_yh; /* holds high byte of y */ + uint32_t m_s; /* Stack Pointer */ + uint32_t m_pc; /* Program Counter */ + uint32_t m_ppc; /* Previous Program Counter */ + uint32_t m_pb; /* Program Bank (shifted left 16) */ + uint32_t m_db; /* Data Bank (shifted left 16) */ + uint32_t m_d; /* Direct Register */ + uint32_t m_flag_e; /* Emulation Mode Flag */ + uint32_t m_flag_m; /* Memory/Accumulator Select Flag */ + uint32_t m_flag_x; /* Index Select Flag */ + uint32_t m_flag_n; /* Negative Flag */ + uint32_t m_flag_v; /* Overflow Flag */ + uint32_t m_flag_d; /* Decimal Mode Flag */ + uint32_t m_flag_i; /* Interrupt Mask Flag */ + uint32_t m_flag_z; /* Zero Flag (inverted) */ + uint32_t m_flag_c; /* Carry Flag */ + uint32_t m_line_irq; /* Bitmask of pending IRQs */ + uint32_t m_ipl; /* Interrupt priority level (top of PSW) */ + uint32_t m_ir; /* Instruction Register */ + uint32_t m_im; /* Immediate load value */ + uint32_t m_im2; /* Immediate load target */ + uint32_t m_im3; /* Immediate load target */ + uint32_t m_im4; /* Immediate load target */ + uint32_t m_irq_delay; /* delay 1 instruction before checking irq */ + uint32_t m_irq_level; /* irq level */ int m_ICount; /* cycle count */ - UINT32 m_source; /* temp register */ - UINT32 m_destination; /* temp register */ + uint32_t m_source; /* temp register */ + uint32_t m_destination; /* temp register */ address_space *m_program; direct_read_data *m_direct; address_space *m_io; - UINT32 m_stopped; /* Sets how the CPU is stopped */ + uint32_t m_stopped; /* Sets how the CPU is stopped */ // on-board peripheral stuff - UINT8 m_m37710_regs[128]; + uint8_t m_m37710_regs[128]; attotime m_reload[8]; emu_timer *m_timers[8]; // for debugger - UINT32 m_debugger_pc; - UINT32 m_debugger_pb; - UINT32 m_debugger_db; - UINT32 m_debugger_p; - UINT32 m_debugger_a; - UINT32 m_debugger_b; + uint32_t m_debugger_pc; + uint32_t m_debugger_pb; + uint32_t m_debugger_db; + uint32_t m_debugger_p; + uint32_t m_debugger_a; + uint32_t m_debugger_b; // Statics typedef void (m37710_cpu_device::*opcode_func)(); - typedef UINT32 (m37710_cpu_device::*get_reg_func)(int regnum); - typedef void (m37710_cpu_device::*set_reg_func)(int regnum, UINT32 val); + typedef uint32_t (m37710_cpu_device::*get_reg_func)(int regnum); + typedef void (m37710_cpu_device::*set_reg_func)(int regnum, uint32_t val); typedef void (m37710_cpu_device::*set_line_func)(int line, int state); typedef int (m37710_cpu_device::*execute_func)(int cycles); @@ -221,20 +221,20 @@ private: execute_func m_execute; // Implementation - void m37710i_set_execution_mode(UINT32 mode); + void m37710i_set_execution_mode(uint32_t mode); TIMER_CALLBACK_MEMBER( m37710_timer_cb ); void m37710_external_tick(int timer, int state); void m37710_recalc_timer(int timer); - UINT8 m37710_internal_r(int offset); - void m37710_internal_w(int offset, UINT8 data); - UINT32 m37710i_get_reg_M0X0(int regnum); - UINT32 m37710i_get_reg_M0X1(int regnum); - UINT32 m37710i_get_reg_M1X0(int regnum); - UINT32 m37710i_get_reg_M1X1(int regnum); - void m37710i_set_reg_M0X0(int regnum, UINT32 val); - void m37710i_set_reg_M0X1(int regnum, UINT32 val); - void m37710i_set_reg_M1X0(int regnum, UINT32 val); - void m37710i_set_reg_M1X1(int regnum, UINT32 val); + uint8_t m37710_internal_r(int offset); + void m37710_internal_w(int offset, uint8_t data); + uint32_t m37710i_get_reg_M0X0(int regnum); + uint32_t m37710i_get_reg_M0X1(int regnum); + uint32_t m37710i_get_reg_M1X0(int regnum); + uint32_t m37710i_get_reg_M1X1(int regnum); + void m37710i_set_reg_M0X0(int regnum, uint32_t val); + void m37710i_set_reg_M0X1(int regnum, uint32_t val); + void m37710i_set_reg_M1X0(int regnum, uint32_t val); + void m37710i_set_reg_M1X1(int regnum, uint32_t val); void m37710i_set_line_M0X0(int line, int state); void m37710i_set_line_M0X1(int line, int state); void m37710i_set_line_M1X0(int line, int state); @@ -251,61 +251,61 @@ private: void m37710_set_reg(int regnum, unsigned value); void m37710_set_irq_line(int line, int state); void m37710_restore_state(); - UINT32 m37710i_read_8_normal(UINT32 address); - UINT32 m37710i_read_8_immediate(UINT32 address); - UINT32 m37710i_read_8_direct(UINT32 address); - void m37710i_write_8_normal(UINT32 address, UINT32 value); - void m37710i_write_8_direct(UINT32 address, UINT32 value); - UINT32 m37710i_read_16_normal(UINT32 address); - UINT32 m37710i_read_16_immediate(UINT32 address); - UINT32 m37710i_read_16_direct(UINT32 address); - void m37710i_write_16_normal(UINT32 address, UINT32 value); - void m37710i_write_16_direct(UINT32 address, UINT32 value); - UINT32 m37710i_read_24_normal(UINT32 address); - UINT32 m37710i_read_24_immediate(UINT32 address); - UINT32 m37710i_read_24_direct(UINT32 address); - void m37710i_push_8(UINT32 value); - UINT32 m37710i_pull_8(); - void m37710i_push_16(UINT32 value); - UINT32 m37710i_pull_16(); - void m37710i_push_24(UINT32 value); - UINT32 m37710i_pull_24(); - void m37710i_jump_16(UINT32 address); - void m37710i_jump_24(UINT32 address); - void m37710i_branch_8(UINT32 offset); - void m37710i_branch_16(UINT32 offset); - UINT32 m37710i_get_reg_p(); - void m37710i_set_reg_ipl(UINT32 value); - void m37710i_interrupt_software(UINT32 vector); - void m37710i_set_flag_m0x0(UINT32 value); - void m37710i_set_flag_m0x1(UINT32 value); - void m37710i_set_flag_m1x0(UINT32 value); - void m37710i_set_flag_m1x1(UINT32 value); - void m37710i_set_reg_p_m0x0(UINT32 value); - void m37710i_set_reg_p_m0x1(UINT32 value); - void m37710i_set_reg_p_m1x0(UINT32 value); - void m37710i_set_reg_p_m1x1(UINT32 value); - UINT32 EA_IMM8(); - UINT32 EA_IMM16(); - UINT32 EA_IMM24(); - UINT32 EA_D(); - UINT32 EA_A(); - UINT32 EA_AL(); - UINT32 EA_DX(); - UINT32 EA_DY(); - UINT32 EA_AX(); - UINT32 EA_ALX(); - UINT32 EA_AY(); - UINT32 EA_DI(); - UINT32 EA_DLI(); - UINT32 EA_AI(); - UINT32 EA_ALI(); - UINT32 EA_DXI(); - UINT32 EA_DIY(); - UINT32 EA_DLIY(); - UINT32 EA_AXI(); - UINT32 EA_S(); - UINT32 EA_SIY(); + uint32_t m37710i_read_8_normal(uint32_t address); + uint32_t m37710i_read_8_immediate(uint32_t address); + uint32_t m37710i_read_8_direct(uint32_t address); + void m37710i_write_8_normal(uint32_t address, uint32_t value); + void m37710i_write_8_direct(uint32_t address, uint32_t value); + uint32_t m37710i_read_16_normal(uint32_t address); + uint32_t m37710i_read_16_immediate(uint32_t address); + uint32_t m37710i_read_16_direct(uint32_t address); + void m37710i_write_16_normal(uint32_t address, uint32_t value); + void m37710i_write_16_direct(uint32_t address, uint32_t value); + uint32_t m37710i_read_24_normal(uint32_t address); + uint32_t m37710i_read_24_immediate(uint32_t address); + uint32_t m37710i_read_24_direct(uint32_t address); + void m37710i_push_8(uint32_t value); + uint32_t m37710i_pull_8(); + void m37710i_push_16(uint32_t value); + uint32_t m37710i_pull_16(); + void m37710i_push_24(uint32_t value); + uint32_t m37710i_pull_24(); + void m37710i_jump_16(uint32_t address); + void m37710i_jump_24(uint32_t address); + void m37710i_branch_8(uint32_t offset); + void m37710i_branch_16(uint32_t offset); + uint32_t m37710i_get_reg_p(); + void m37710i_set_reg_ipl(uint32_t value); + void m37710i_interrupt_software(uint32_t vector); + void m37710i_set_flag_m0x0(uint32_t value); + void m37710i_set_flag_m0x1(uint32_t value); + void m37710i_set_flag_m1x0(uint32_t value); + void m37710i_set_flag_m1x1(uint32_t value); + void m37710i_set_reg_p_m0x0(uint32_t value); + void m37710i_set_reg_p_m0x1(uint32_t value); + void m37710i_set_reg_p_m1x0(uint32_t value); + void m37710i_set_reg_p_m1x1(uint32_t value); + uint32_t EA_IMM8(); + uint32_t EA_IMM16(); + uint32_t EA_IMM24(); + uint32_t EA_D(); + uint32_t EA_A(); + uint32_t EA_AL(); + uint32_t EA_DX(); + uint32_t EA_DY(); + uint32_t EA_AX(); + uint32_t EA_ALX(); + uint32_t EA_AY(); + uint32_t EA_DI(); + uint32_t EA_DLI(); + uint32_t EA_AI(); + uint32_t EA_ALI(); + uint32_t EA_DXI(); + uint32_t EA_DIY(); + uint32_t EA_DLIY(); + uint32_t EA_AXI(); + uint32_t EA_S(); + uint32_t EA_SIY(); void m37710i_00_M0X0(); void m37710i_01_M0X0(); void m37710i_02_M0X0(); @@ -2014,7 +2014,7 @@ class m37702s1_device : public m37710_cpu_device { public: // construction/destruction - m37702s1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m37702s1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: DECLARE_ADDRESS_MAP(map, 16); }; @@ -2023,8 +2023,8 @@ class m37702m2_device : public m37710_cpu_device { public: // construction/destruction - m37702m2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m37702m2_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); + m37702m2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m37702m2_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: DECLARE_ADDRESS_MAP(map, 16); }; @@ -2033,7 +2033,7 @@ class m37710s4_device : public m37710_cpu_device { public: // construction/destruction - m37710s4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m37710s4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: DECLARE_ADDRESS_MAP(map, 16); }; diff --git a/src/devices/cpu/m37710/m37710il.h b/src/devices/cpu/m37710/m37710il.h index eb79f0fddd6..92e3fc6765f 100644 --- a/src/devices/cpu/m37710/m37710il.h +++ b/src/devices/cpu/m37710/m37710il.h @@ -10,37 +10,37 @@ /* ================================= MEMORY =============================== */ /* ======================================================================== */ -inline UINT32 m37710_cpu_device::m37710i_read_8_normal(UINT32 address) +inline uint32_t m37710_cpu_device::m37710i_read_8_normal(uint32_t address) { return m37710_read_8(address); } -inline UINT32 m37710_cpu_device::m37710i_read_8_immediate(UINT32 address) +inline uint32_t m37710_cpu_device::m37710i_read_8_immediate(uint32_t address) { return m37710_read_8_immediate(address); } -inline UINT32 m37710_cpu_device::m37710i_read_8_direct(UINT32 address) +inline uint32_t m37710_cpu_device::m37710i_read_8_direct(uint32_t address) { return m37710_read_8(address); } -inline void m37710_cpu_device::m37710i_write_8_normal(UINT32 address, UINT32 value) +inline void m37710_cpu_device::m37710i_write_8_normal(uint32_t address, uint32_t value) { m37710_write_8(address, value); } -inline void m37710_cpu_device::m37710i_write_8_direct(UINT32 address, UINT32 value) +inline void m37710_cpu_device::m37710i_write_8_direct(uint32_t address, uint32_t value) { m37710_write_8(address, value); } -inline UINT32 m37710_cpu_device::m37710i_read_16_normal(UINT32 address) +inline uint32_t m37710_cpu_device::m37710i_read_16_normal(uint32_t address) { return m37710_read_16(address); } -inline UINT32 m37710_cpu_device::m37710i_read_16_immediate(UINT32 address) +inline uint32_t m37710_cpu_device::m37710i_read_16_immediate(uint32_t address) { if (!WORD_ALIGNED(address)) return m37710_read_8_immediate(address) | (m37710_read_8_immediate(address+1)<<8); @@ -48,22 +48,22 @@ inline UINT32 m37710_cpu_device::m37710i_read_16_immediate(UINT32 address) return m37710_read_16_immediate(address); } -inline UINT32 m37710_cpu_device::m37710i_read_16_direct(UINT32 address) +inline uint32_t m37710_cpu_device::m37710i_read_16_direct(uint32_t address) { return m37710_read_16(address); } -inline void m37710_cpu_device::m37710i_write_16_normal(UINT32 address, UINT32 value) +inline void m37710_cpu_device::m37710i_write_16_normal(uint32_t address, uint32_t value) { m37710_write_16(address, value); } -inline void m37710_cpu_device::m37710i_write_16_direct(UINT32 address, UINT32 value) +inline void m37710_cpu_device::m37710i_write_16_direct(uint32_t address, uint32_t value) { m37710_write_16(address, value); } -inline UINT32 m37710_cpu_device::m37710i_read_24_normal(UINT32 address) +inline uint32_t m37710_cpu_device::m37710i_read_24_normal(uint32_t address) { if (!WORD_ALIGNED(address)) return m37710_read_8(address) | (m37710_read_16(address+1)<<8); @@ -71,7 +71,7 @@ inline UINT32 m37710_cpu_device::m37710i_read_24_normal(UINT32 address) return m37710_read_16(address) | (m37710_read_8(address+2)<<16); } -inline UINT32 m37710_cpu_device::m37710i_read_24_immediate(UINT32 address) +inline uint32_t m37710_cpu_device::m37710i_read_24_immediate(uint32_t address) { if (!WORD_ALIGNED(address)) return m37710_read_8_immediate(address) | (m37710_read_16_immediate(address+1)<<8); @@ -79,7 +79,7 @@ inline UINT32 m37710_cpu_device::m37710i_read_24_immediate(UINT32 address) return m37710_read_16_immediate(address) | (m37710_read_8_immediate(address+2)<<16); } -inline UINT32 m37710_cpu_device::m37710i_read_24_direct(UINT32 address) +inline uint32_t m37710_cpu_device::m37710i_read_24_direct(uint32_t address) { if (!WORD_ALIGNED(address)) return m37710_read_8(address) | (m37710_read_16(address+1)<<8); @@ -92,40 +92,40 @@ inline UINT32 m37710_cpu_device::m37710i_read_24_direct(UINT32 address) /* ================================= STACK ================================ */ /* ======================================================================== */ -inline void m37710_cpu_device::m37710i_push_8(UINT32 value) +inline void m37710_cpu_device::m37710i_push_8(uint32_t value) { m37710_write_8(REG_S, value); REG_S = MAKE_UINT_16(REG_S-1); } -inline UINT32 m37710_cpu_device::m37710i_pull_8() +inline uint32_t m37710_cpu_device::m37710i_pull_8() { REG_S = MAKE_UINT_16(REG_S+1); return m37710_read_8(REG_S); } -inline void m37710_cpu_device::m37710i_push_16(UINT32 value) +inline void m37710_cpu_device::m37710i_push_16(uint32_t value) { m37710i_push_8(value>>8); m37710i_push_8(value); } -inline UINT32 m37710_cpu_device::m37710i_pull_16() +inline uint32_t m37710_cpu_device::m37710i_pull_16() { - UINT32 res = m37710i_pull_8(); + uint32_t res = m37710i_pull_8(); return res | (m37710i_pull_8() << 8); } -inline void m37710_cpu_device::m37710i_push_24(UINT32 value) +inline void m37710_cpu_device::m37710i_push_24(uint32_t value) { m37710i_push_8(value>>16); m37710i_push_8((value>>8)); m37710i_push_8(value); } -inline UINT32 m37710_cpu_device::m37710i_pull_24() +inline uint32_t m37710_cpu_device::m37710i_pull_24() { - UINT32 res = m37710i_pull_8(); + uint32_t res = m37710i_pull_8(); res |= m37710i_pull_8() << 8; return res | (m37710i_pull_8() << 16); } @@ -135,23 +135,23 @@ inline UINT32 m37710_cpu_device::m37710i_pull_24() /* ============================ PROGRAM COUNTER =========================== */ /* ======================================================================== */ -inline void m37710_cpu_device::m37710i_jump_16(UINT32 address) +inline void m37710_cpu_device::m37710i_jump_16(uint32_t address) { REG_PC = MAKE_UINT_16(address); } -inline void m37710_cpu_device::m37710i_jump_24(UINT32 address) +inline void m37710_cpu_device::m37710i_jump_24(uint32_t address) { REG_PB = address&0xff0000; REG_PC = MAKE_UINT_16(address); } -inline void m37710_cpu_device::m37710i_branch_8(UINT32 offset) +inline void m37710_cpu_device::m37710i_branch_8(uint32_t offset) { REG_PC = MAKE_UINT_16(REG_PC + MAKE_INT_8(offset)); } -inline void m37710_cpu_device::m37710i_branch_16(UINT32 offset) +inline void m37710_cpu_device::m37710i_branch_16(uint32_t offset) { REG_PC = MAKE_UINT_16(REG_PC + offset); } @@ -161,7 +161,7 @@ inline void m37710_cpu_device::m37710i_branch_16(UINT32 offset) /* ============================ STATUS REGISTER =========================== */ /* ======================================================================== */ -inline UINT32 m37710_cpu_device::m37710i_get_reg_p() +inline uint32_t m37710_cpu_device::m37710i_get_reg_p() { return (FLAG_N&0x80) | ((FLAG_V>>1)&0x40) | @@ -173,7 +173,7 @@ inline UINT32 m37710_cpu_device::m37710i_get_reg_p() ((FLAG_C>>8)&1); } -inline void m37710_cpu_device::m37710i_set_reg_ipl(UINT32 value) +inline void m37710_cpu_device::m37710i_set_reg_ipl(uint32_t value) { m_ipl = value & 7; } @@ -183,26 +183,26 @@ inline void m37710_cpu_device::m37710i_set_reg_ipl(UINT32 value) /* ============================= ADDRESS MODES ============================ */ /* ======================================================================== */ -inline UINT32 m37710_cpu_device::EA_IMM8() {REG_PC += 1; return REG_PB | MAKE_UINT_16(REG_PC-1);} -inline UINT32 m37710_cpu_device::EA_IMM16() {REG_PC += 2; return REG_PB | MAKE_UINT_16(REG_PC-2);} -inline UINT32 m37710_cpu_device::EA_IMM24() {REG_PC += 3; return REG_PB | MAKE_UINT_16(REG_PC-3);} -inline UINT32 m37710_cpu_device::EA_D() {if(MAKE_UINT_8(REG_D)) CLK(1); return MAKE_UINT_16(REG_D + OPER_8_IMM());} -inline UINT32 m37710_cpu_device::EA_A() {return REG_DB | OPER_16_IMM();} -inline UINT32 m37710_cpu_device::EA_AL() {return OPER_24_IMM();} -inline UINT32 m37710_cpu_device::EA_DX() {return MAKE_UINT_16(REG_D + OPER_8_IMM() + REG_X);} -inline UINT32 m37710_cpu_device::EA_DY() {return MAKE_UINT_16(REG_D + OPER_8_IMM() + REG_Y);} -inline UINT32 m37710_cpu_device::EA_AX() {UINT32 tmp = EA_A(); if((tmp^(tmp+REG_X))&0xff00) CLK(1); return tmp + REG_X;} -inline UINT32 m37710_cpu_device::EA_ALX() {return EA_AL() + REG_X;} -inline UINT32 m37710_cpu_device::EA_AY() {UINT32 tmp = EA_A(); if((tmp^(tmp+REG_X))&0xff00) CLK(1); return tmp + REG_Y;} -inline UINT32 m37710_cpu_device::EA_DI() {return REG_DB | OPER_16_D();} -inline UINT32 m37710_cpu_device::EA_DLI() {return OPER_24_D();} -inline UINT32 m37710_cpu_device::EA_AI() {return read_16_A(OPER_16_IMM());} -inline UINT32 m37710_cpu_device::EA_ALI() {return OPER_24_A();} -inline UINT32 m37710_cpu_device::EA_DXI() {return REG_DB | OPER_16_DX();} -inline UINT32 m37710_cpu_device::EA_DIY() {UINT32 tmp = REG_DB | OPER_16_D(); if((tmp^(tmp+REG_X))&0xff00) CLK(1); return tmp + REG_Y;} -inline UINT32 m37710_cpu_device::EA_DLIY() {return OPER_24_D() + REG_Y;} -inline UINT32 m37710_cpu_device::EA_AXI() {return read_16_AXI(MAKE_UINT_16(OPER_16_IMM() + REG_X));} -inline UINT32 m37710_cpu_device::EA_S() {return MAKE_UINT_16(REG_S + OPER_8_IMM());} -inline UINT32 m37710_cpu_device::EA_SIY() {return MAKE_UINT_16(read_16_SIY(REG_S + OPER_8_IMM()) + REG_Y) | REG_DB;} +inline uint32_t m37710_cpu_device::EA_IMM8() {REG_PC += 1; return REG_PB | MAKE_UINT_16(REG_PC-1);} +inline uint32_t m37710_cpu_device::EA_IMM16() {REG_PC += 2; return REG_PB | MAKE_UINT_16(REG_PC-2);} +inline uint32_t m37710_cpu_device::EA_IMM24() {REG_PC += 3; return REG_PB | MAKE_UINT_16(REG_PC-3);} +inline uint32_t m37710_cpu_device::EA_D() {if(MAKE_UINT_8(REG_D)) CLK(1); return MAKE_UINT_16(REG_D + OPER_8_IMM());} +inline uint32_t m37710_cpu_device::EA_A() {return REG_DB | OPER_16_IMM();} +inline uint32_t m37710_cpu_device::EA_AL() {return OPER_24_IMM();} +inline uint32_t m37710_cpu_device::EA_DX() {return MAKE_UINT_16(REG_D + OPER_8_IMM() + REG_X);} +inline uint32_t m37710_cpu_device::EA_DY() {return MAKE_UINT_16(REG_D + OPER_8_IMM() + REG_Y);} +inline uint32_t m37710_cpu_device::EA_AX() {uint32_t tmp = EA_A(); if((tmp^(tmp+REG_X))&0xff00) CLK(1); return tmp + REG_X;} +inline uint32_t m37710_cpu_device::EA_ALX() {return EA_AL() + REG_X;} +inline uint32_t m37710_cpu_device::EA_AY() {uint32_t tmp = EA_A(); if((tmp^(tmp+REG_X))&0xff00) CLK(1); return tmp + REG_Y;} +inline uint32_t m37710_cpu_device::EA_DI() {return REG_DB | OPER_16_D();} +inline uint32_t m37710_cpu_device::EA_DLI() {return OPER_24_D();} +inline uint32_t m37710_cpu_device::EA_AI() {return read_16_A(OPER_16_IMM());} +inline uint32_t m37710_cpu_device::EA_ALI() {return OPER_24_A();} +inline uint32_t m37710_cpu_device::EA_DXI() {return REG_DB | OPER_16_DX();} +inline uint32_t m37710_cpu_device::EA_DIY() {uint32_t tmp = REG_DB | OPER_16_D(); if((tmp^(tmp+REG_X))&0xff00) CLK(1); return tmp + REG_Y;} +inline uint32_t m37710_cpu_device::EA_DLIY() {return OPER_24_D() + REG_Y;} +inline uint32_t m37710_cpu_device::EA_AXI() {return read_16_AXI(MAKE_UINT_16(OPER_16_IMM() + REG_X));} +inline uint32_t m37710_cpu_device::EA_S() {return MAKE_UINT_16(REG_S + OPER_8_IMM());} +inline uint32_t m37710_cpu_device::EA_SIY() {return MAKE_UINT_16(read_16_SIY(REG_S + OPER_8_IMM()) + REG_Y) | REG_DB;} #endif /* __M37710IL_H__ */ diff --git a/src/devices/cpu/m37710/m37710op.h b/src/devices/cpu/m37710/m37710op.h index 03e29580323..268ef277f18 100644 --- a/src/devices/cpu/m37710/m37710op.h +++ b/src/devices/cpu/m37710/m37710op.h @@ -38,7 +38,7 @@ /* note: difference from 65816. when switching to 8-bit X/Y, X and Y are *not* truncated to 8 bits! */ -void m37710_cpu_device::m37710i_set_flag_mx(UINT32 value) +void m37710_cpu_device::m37710i_set_flag_mx(uint32_t value) { #if FLAG_SET_M if(!(value & FLAGPOS_M)) @@ -82,7 +82,7 @@ void m37710_cpu_device::m37710i_set_flag_mx(UINT32 value) } -void m37710_cpu_device::m37710i_set_reg_p(UINT32 value) +void m37710_cpu_device::m37710i_set_reg_p(uint32_t value) { FLAG_N = value; FLAG_V = value << 1; @@ -235,12 +235,12 @@ void m37710_cpu_device::m37710i_set_reg_p(UINT32 value) #define OP_MPY(MODE) \ CLK(CLK_OP + CLK_R8 + CLK_##MODE + 14); \ SRC = OPER_8_##MODE(); \ - { UINT16 temp = SRC * (REG_A&0xff); REG_A = temp & 0xff; REG_BA = (temp>>8)&0xff; FLAG_Z = temp; FLAG_N = (temp & 0x8000) ? 1 : 0; FLAG_C = 0; } + { uint16_t temp = SRC * (REG_A&0xff); REG_A = temp & 0xff; REG_BA = (temp>>8)&0xff; FLAG_Z = temp; FLAG_N = (temp & 0x8000) ? 1 : 0; FLAG_C = 0; } #else #define OP_MPY(MODE) \ CLK(CLK_OP + CLK_R16 + CLK_##MODE + 14+8); \ SRC = OPER_16_##MODE(); \ - { UINT32 temp = SRC * REG_A; REG_A = temp & 0xffff; REG_BA = (temp>>16)&0xffff; FLAG_Z = temp; FLAG_N = (temp & 0x80000000) ? 1 : 0; FLAG_C = 0; } + { uint32_t temp = SRC * REG_A; REG_A = temp & 0xffff; REG_BA = (temp>>16)&0xffff; FLAG_Z = temp; FLAG_N = (temp & 0x80000000) ? 1 : 0; FLAG_C = 0; } #endif /* M37710 Divide */ @@ -252,7 +252,7 @@ void m37710_cpu_device::m37710i_set_reg_p(UINT32 value) DST = OPER_8_##MODE(); \ if (DST != 0) \ { \ - UINT16 tempa = SRC / DST; UINT16 tempb = SRC % DST; \ + uint16_t tempa = SRC / DST; uint16_t tempb = SRC % DST; \ FLAG_V = ((tempa | tempb) & 0xff00) ? VFLAG_SET : 0; \ FLAG_C = FLAG_V ? CFLAG_SET : 0; \ if (!FLAG_V) { FLAG_N = (tempa & 0x80) ? 1 : 0; } \ @@ -266,7 +266,7 @@ void m37710_cpu_device::m37710i_set_reg_p(UINT32 value) DST = OPER_16_##MODE(); \ if (DST != 0) \ { \ - UINT32 tempa = SRC / DST; UINT32 tempb = SRC % DST; \ + uint32_t tempa = SRC / DST; uint32_t tempb = SRC % DST; \ FLAG_V = ((tempa | tempb) & 0xffff0000) ? VFLAG_SET : 0; \ FLAG_C = FLAG_V ? CFLAG_SET : 0; \ if (!FLAG_V) { FLAG_N = (tempa & 0x8000) ? 1 : 0; } \ @@ -2539,7 +2539,7 @@ TABLE_FUNCTION(void, set_line, (int line, int state)) /* Get a register from the CPU core */ -TABLE_FUNCTION(UINT32, get_reg, (int regnum)) +TABLE_FUNCTION(uint32_t, get_reg, (int regnum)) { switch(regnum) { @@ -2559,7 +2559,7 @@ TABLE_FUNCTION(UINT32, get_reg, (int regnum)) return 0; } -TABLE_FUNCTION(void, set_reg, (int regnum, UINT32 val)) +TABLE_FUNCTION(void, set_reg, (int regnum, uint32_t val)) { switch(regnum) { diff --git a/src/devices/cpu/m37710/m7700ds.cpp b/src/devices/cpu/m37710/m7700ds.cpp index b53980bd939..6e463dded1b 100644 --- a/src/devices/cpu/m37710/m7700ds.cpp +++ b/src/devices/cpu/m37710/m7700ds.cpp @@ -348,18 +348,18 @@ const m7700_opcode_struct m7700_opcode_struct::s_opcodes_prefix89[256] = } // anonymous namespace -static inline unsigned int read_8(const UINT8 *oprom, unsigned int offset) +static inline unsigned int read_8(const uint8_t *oprom, unsigned int offset) { return oprom[offset]; } -static inline unsigned int read_16(const UINT8 *oprom, unsigned int offset) +static inline unsigned int read_16(const uint8_t *oprom, unsigned int offset) { unsigned int val = read_8(oprom, offset); return val | (read_8(oprom, offset+1)<<8); } -static inline unsigned int read_24(const UINT8 *oprom, unsigned int offset) +static inline unsigned int read_24(const uint8_t *oprom, unsigned int offset) { unsigned int val = read_8(oprom, offset); val |= (read_8(oprom, offset+1)<<8); @@ -395,7 +395,7 @@ static inline char* int_16_str(unsigned int val) } -int m7700_disassemble(char* buff, unsigned int pc, unsigned int pb, const UINT8 *oprom, int m_flag, int x_flag) +int m7700_disassemble(char* buff, unsigned int pc, unsigned int pb, const uint8_t *oprom, int m_flag, int x_flag) { unsigned int instruction; const m7700_opcode_struct *opcode; @@ -405,7 +405,7 @@ int m7700_disassemble(char* buff, unsigned int pc, unsigned int pb, const UINT8 int length = 1; unsigned int address; //unsigned int start; - UINT32 flags = 0; + uint32_t flags = 0; pb <<= 16; address = pc | pb; diff --git a/src/devices/cpu/m37710/m7700ds.h b/src/devices/cpu/m37710/m7700ds.h index c0af0846b72..80706b0a624 100644 --- a/src/devices/cpu/m37710/m7700ds.h +++ b/src/devices/cpu/m37710/m7700ds.h @@ -18,6 +18,6 @@ All rights reserved. */ -int m7700_disassemble(char* buff, unsigned int pc, unsigned int pb, const UINT8 *oprom, int m_flag, int x_flag); +int m7700_disassemble(char* buff, unsigned int pc, unsigned int pb, const uint8_t *oprom, int m_flag, int x_flag); #endif /* __M7700DS_H__ */ diff --git a/src/devices/cpu/m6502/deco16.cpp b/src/devices/cpu/m6502/deco16.cpp index 30ae298daa6..482c7b1c0b7 100644 --- a/src/devices/cpu/m6502/deco16.cpp +++ b/src/devices/cpu/m6502/deco16.cpp @@ -15,14 +15,14 @@ const device_type DECO16 = &device_creator; -deco16_device::deco16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +deco16_device::deco16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, DECO16, "DECO16", tag, owner, clock, "deco16", __FILE__), io(nullptr), io_config("io", ENDIANNESS_LITTLE, 8, 16) { } -offs_t deco16_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t deco16_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } diff --git a/src/devices/cpu/m6502/deco16.h b/src/devices/cpu/m6502/deco16.h index 134b1e3aae4..3afc7af081f 100644 --- a/src/devices/cpu/m6502/deco16.h +++ b/src/devices/cpu/m6502/deco16.h @@ -15,11 +15,11 @@ class deco16_device : public m6502_device { public: - deco16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + deco16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; diff --git a/src/devices/cpu/m6502/m3745x.cpp b/src/devices/cpu/m6502/m3745x.cpp index a7f40fa7ada..22de70eec42 100644 --- a/src/devices/cpu/m6502/m3745x.cpp +++ b/src/devices/cpu/m6502/m3745x.cpp @@ -37,7 +37,7 @@ const device_type M37450 = &device_creator; //------------------------------------------------- // m3745x_device - constructor //------------------------------------------------- -m3745x_device::m3745x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map, const char *shortname, const char *source) : +m3745x_device::m3745x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map, const char *shortname, const char *source) : m740_device(mconfig, type, name, tag, owner, clock, "m3745x", source), m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, internal_map), read_p3(*this), @@ -201,7 +201,7 @@ void m3745x_device::execute_set_input(int inputnum, int state) void m3745x_device::recalc_irqs() { - UINT16 all_ints; + uint16_t all_ints; int static const irq_lines[16] = { -1, -1, -1, M740_INT11_LINE, M740_INT12_LINE, M740_INT13_LINE, -1, -1, @@ -246,7 +246,7 @@ void m3745x_device::recalc_irqs() m_last_all_ints = all_ints; } -void m3745x_device::send_port(address_space &space, UINT8 offset, UINT8 data) +void m3745x_device::send_port(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -268,9 +268,9 @@ void m3745x_device::send_port(address_space &space, UINT8 offset, UINT8 data) } } -UINT8 m3745x_device::read_port(UINT8 offset) +uint8_t m3745x_device::read_port(uint8_t offset) { - UINT8 incoming = 0; + uint8_t incoming = 0; switch (offset) { @@ -417,7 +417,7 @@ WRITE8_MEMBER(m3745x_device::intregs_w) READ8_MEMBER(m3745x_device::adc_r) { - UINT8 rv = 0; + uint8_t rv = 0; switch (offset) { @@ -498,12 +498,12 @@ static ADDRESS_MAP_START( m37450_map, AS_PROGRAM, 8, m37450_device ) AM_RANGE(0x0100, 0x01ff) AM_RAM ADDRESS_MAP_END -m37450_device::m37450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m37450_device::m37450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m3745x_device(mconfig, M37450, "Mitsubishi M37450", tag, owner, clock, ADDRESS_MAP_NAME(m37450_map), "m3745x", __FILE__) { } -m37450_device::m37450_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) : +m37450_device::m37450_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) : m3745x_device(mconfig, type, name, tag, owner, clock, ADDRESS_MAP_NAME(m37450_map), shortname, source) { } diff --git a/src/devices/cpu/m6502/m3745x.h b/src/devices/cpu/m6502/m3745x.h index 0ddc69d099d..6b85aee9c20 100644 --- a/src/devices/cpu/m6502/m3745x.h +++ b/src/devices/cpu/m6502/m3745x.h @@ -61,7 +61,7 @@ public: }; // construction/destruction - m3745x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map, const char *shortname, const char *source); + m3745x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map, const char *shortname, const char *source); const address_space_config m_program_config; @@ -117,7 +117,7 @@ public: DECLARE_READ8_MEMBER(intregs_r); DECLARE_WRITE8_MEMBER(intregs_w); - bool are_port_bits_output(UINT8 port, UINT8 mask) { return ((m_ddrs[port] & mask) == mask) ? true : false; } + bool are_port_bits_output(uint8_t port, uint8_t mask) { return ((m_ddrs[port] & mask) == mask) ? true : false; } protected: // device-level overrides @@ -127,15 +127,15 @@ protected: virtual void execute_set_input(int inputnum, int state) override; virtual const address_space_config *memory_space_config(address_spacenum spacenum) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : nullptr; } - void send_port(address_space &space, UINT8 offset, UINT8 data); - UINT8 read_port(UINT8 offset); + void send_port(address_space &space, uint8_t offset, uint8_t data); + uint8_t read_port(uint8_t offset); void recalc_irqs(); - UINT8 m_ports[6], m_ddrs[6]; - UINT8 m_intreq1, m_intreq2, m_intctrl1, m_intctrl2; - UINT8 m_adctrl; - UINT16 m_last_all_ints; + uint8_t m_ports[6], m_ddrs[6]; + uint8_t m_intreq1, m_intreq2, m_intctrl1, m_intctrl2; + uint8_t m_adctrl; + uint16_t m_last_all_ints; private: emu_timer *m_timers[NUM_TIMERS]; @@ -144,8 +144,8 @@ private: class m37450_device : public m3745x_device { public: - m37450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m37450_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); + m37450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m37450_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); }; extern const device_type M37450; diff --git a/src/devices/cpu/m6502/m4510.cpp b/src/devices/cpu/m6502/m4510.cpp index 1b52ef569c8..bfb89dbcdc8 100644 --- a/src/devices/cpu/m6502/m4510.cpp +++ b/src/devices/cpu/m6502/m4510.cpp @@ -13,7 +13,7 @@ const device_type M4510 = &device_creator; -m4510_device::m4510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m4510_device::m4510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m65ce02_device(mconfig, M4510, "M4510", tag, owner, clock, "m4510", __FILE__), map_enable(0), nomap(false) @@ -26,7 +26,7 @@ m4510_device::m4510_device(const machine_config &mconfig, const char *tag, devic sprogram_config.m_page_shift = 13; } -offs_t m4510_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m4510_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } @@ -71,22 +71,22 @@ m4510_device::mi_4510_normal::mi_4510_normal(m4510_device *_base) base = _base; } -UINT8 m4510_device::mi_4510_normal::read(UINT16 adr) +uint8_t m4510_device::mi_4510_normal::read(uint16_t adr) { return program->read_byte(base->map(adr)); } -UINT8 m4510_device::mi_4510_normal::read_sync(UINT16 adr) +uint8_t m4510_device::mi_4510_normal::read_sync(uint16_t adr) { return sdirect->read_byte(base->map(adr)); } -UINT8 m4510_device::mi_4510_normal::read_arg(UINT16 adr) +uint8_t m4510_device::mi_4510_normal::read_arg(uint16_t adr) { return direct->read_byte(base->map(adr)); } -void m4510_device::mi_4510_normal::write(UINT16 adr, UINT8 val) +void m4510_device::mi_4510_normal::write(uint16_t adr, uint8_t val) { program->write_byte(base->map(adr), val); } @@ -95,12 +95,12 @@ m4510_device::mi_4510_nd::mi_4510_nd(m4510_device *_base) : mi_4510_normal(_base { } -UINT8 m4510_device::mi_4510_nd::read_sync(UINT16 adr) +uint8_t m4510_device::mi_4510_nd::read_sync(uint16_t adr) { return sprogram->read_byte(base->map(adr)); } -UINT8 m4510_device::mi_4510_nd::read_arg(UINT16 adr) +uint8_t m4510_device::mi_4510_nd::read_arg(uint16_t adr) { return program->read_byte(base->map(adr)); } diff --git a/src/devices/cpu/m6502/m4510.h b/src/devices/cpu/m6502/m4510.h index f6a8f904863..97629581531 100644 --- a/src/devices/cpu/m6502/m4510.h +++ b/src/devices/cpu/m6502/m4510.h @@ -15,19 +15,19 @@ class m4510_device : public m65ce02_device { public: - m4510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m4510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; bool get_nomap() const { return nomap; } protected: - UINT32 map_offset[2]; - UINT8 map_enable; + uint32_t map_offset[2]; + uint8_t map_enable; bool nomap; class mi_4510_normal : public memory_interface { @@ -36,25 +36,25 @@ protected: mi_4510_normal(m4510_device *base); virtual ~mi_4510_normal() {} - virtual UINT8 read(UINT16 adr) override; - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; + virtual uint8_t read(uint16_t adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; }; class mi_4510_nd : public mi_4510_normal { public: mi_4510_nd(m4510_device *base); virtual ~mi_4510_nd() {} - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; }; virtual void device_start() override; virtual void device_reset() override; virtual bool memory_translate(address_spacenum spacenum, int intention, offs_t &address) override; - inline UINT32 map(UINT16 adr) { + inline uint32_t map(uint16_t adr) { if(map_enable & (1 << (adr >> 13))) { nomap = false; return adr + map_offset[adr >> 15]; diff --git a/src/devices/cpu/m6502/m5074x.cpp b/src/devices/cpu/m6502/m5074x.cpp index 965e8866467..a486691c678 100644 --- a/src/devices/cpu/m6502/m5074x.cpp +++ b/src/devices/cpu/m6502/m5074x.cpp @@ -39,7 +39,7 @@ const device_type M50741 = &device_creator; //------------------------------------------------- // m5074x_device - constructor //------------------------------------------------- -m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map, const char *shortname, const char *source) : +m5074x_device::m5074x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map, const char *shortname, const char *source) : m740_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_LITTLE, 8, 13, 0, internal_map), read_p0(*this), @@ -189,7 +189,7 @@ void m5074x_device::execute_set_input(int inputnum, int state) void m5074x_device::recalc_irqs() { - UINT8 all_ints = 0; + uint8_t all_ints = 0; if ((m_intctrl & (IRQ_CNTRREQ|IRQ_CNTRENA)) == (IRQ_CNTRREQ|IRQ_CNTRENA)) { @@ -280,7 +280,7 @@ void m5074x_device::recalc_timer(int timer) } } -void m5074x_device::send_port(address_space &space, UINT8 offset, UINT8 data) +void m5074x_device::send_port(address_space &space, uint8_t offset, uint8_t data) { switch (offset) { @@ -302,9 +302,9 @@ void m5074x_device::send_port(address_space &space, UINT8 offset, UINT8 data) } } -UINT8 m5074x_device::read_port(UINT8 offset) +uint8_t m5074x_device::read_port(uint8_t offset) { - UINT8 incoming = 0; + uint8_t incoming = 0; switch (offset) { @@ -489,12 +489,12 @@ static ADDRESS_MAP_START( m50740_map, AS_PROGRAM, 8, m50740_device ) AM_RANGE(0x1400, 0x1fff) AM_ROM AM_REGION(M5074X_INTERNAL_ROM_REGION, 0) ADDRESS_MAP_END -m50740_device::m50740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m50740_device::m50740_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m5074x_device(mconfig, M50740, "Mitsubishi M50740", tag, owner, clock, ADDRESS_MAP_NAME(m50740_map), "m50740", __FILE__) { } -m50740_device::m50740_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) : +m50740_device::m50740_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) : m5074x_device(mconfig, type, name, tag, owner, clock, ADDRESS_MAP_NAME(m50740_map), shortname, source) { } @@ -507,12 +507,12 @@ static ADDRESS_MAP_START( m50741_map, AS_PROGRAM, 8, m50741_device ) AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("internal", 0) ADDRESS_MAP_END -m50741_device::m50741_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m50741_device::m50741_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m5074x_device(mconfig, M50740, "Mitsubishi M50741", tag, owner, clock, ADDRESS_MAP_NAME(m50741_map), "m50741", __FILE__) { } -m50741_device::m50741_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) : +m50741_device::m50741_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) : m5074x_device(mconfig, type, name, tag, owner, clock, ADDRESS_MAP_NAME(m50741_map), shortname, source) { } diff --git a/src/devices/cpu/m6502/m5074x.h b/src/devices/cpu/m6502/m5074x.h index 79de50f63fb..0486a243a24 100644 --- a/src/devices/cpu/m6502/m5074x.h +++ b/src/devices/cpu/m6502/m5074x.h @@ -72,7 +72,7 @@ class m5074x_device : public m740_device public: // construction/destruction - m5074x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map, const char *shortname, const char *source); + m5074x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal_map, const char *shortname, const char *source); const address_space_config m_program_config; @@ -93,7 +93,7 @@ public: DECLARE_READ8_MEMBER(tmrirq_r); DECLARE_WRITE8_MEMBER(tmrirq_w); - bool are_port_bits_output(UINT8 port, UINT8 mask) { return ((m_ddrs[port] & mask) == mask) ? true : false; } + bool are_port_bits_output(uint8_t port, uint8_t mask) { return ((m_ddrs[port] & mask) == mask) ? true : false; } protected: // device-level overrides @@ -103,17 +103,17 @@ protected: virtual void execute_set_input(int inputnum, int state) override; virtual const address_space_config *memory_space_config(address_spacenum spacenum) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : nullptr; } - void send_port(address_space &space, UINT8 offset, UINT8 data); - UINT8 read_port(UINT8 offset); + void send_port(address_space &space, uint8_t offset, uint8_t data); + uint8_t read_port(uint8_t offset); void recalc_irqs(); void recalc_timer(int timer); - UINT8 m_ports[6], m_ddrs[6]; - UINT8 m_intctrl, m_tmrctrl; - UINT8 m_tmr12pre, m_tmr1, m_tmr2, m_tmrxpre, m_tmrx; - UINT8 m_tmr1latch, m_tmr2latch, m_tmrxlatch; - UINT8 m_last_all_ints; + uint8_t m_ports[6], m_ddrs[6]; + uint8_t m_intctrl, m_tmrctrl; + uint8_t m_tmr12pre, m_tmr1, m_tmr2, m_tmrxpre, m_tmrx; + uint8_t m_tmr1latch, m_tmr2latch, m_tmrxlatch; + uint8_t m_last_all_ints; private: emu_timer *m_timers[NUM_TIMERS]; @@ -122,15 +122,15 @@ private: class m50740_device : public m5074x_device { public: - m50740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m50740_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); + m50740_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m50740_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); }; class m50741_device : public m5074x_device { public: - m50741_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m50741_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); + m50741_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m50741_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); }; extern const device_type M50740; diff --git a/src/devices/cpu/m6502/m6502.cpp b/src/devices/cpu/m6502/m6502.cpp index 6fa76704731..1194273fae3 100644 --- a/src/devices/cpu/m6502/m6502.cpp +++ b/src/devices/cpu/m6502/m6502.cpp @@ -14,7 +14,7 @@ const device_type M6502 = &device_creator; -m6502_device::m6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m6502_device::m6502_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, M6502, "M6502", tag, owner, clock, "m6502", __FILE__), sync_w(*this), program_config("program", ENDIANNESS_LITTLE, 8, 16), @@ -24,7 +24,7 @@ m6502_device::m6502_device(const machine_config &mconfig, const char *tag, devic direct_disabled = false; } -m6502_device::m6502_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) : +m6502_device::m6502_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), sync_w(*this), program_config("program", ENDIANNESS_LITTLE, 8, 16), @@ -126,30 +126,30 @@ void m6502_device::device_reset() } -UINT32 m6502_device::execute_min_cycles() const +uint32_t m6502_device::execute_min_cycles() const { return 1; } -UINT32 m6502_device::execute_max_cycles() const +uint32_t m6502_device::execute_max_cycles() const { return 10; } -UINT32 m6502_device::execute_input_lines() const +uint32_t m6502_device::execute_input_lines() const { return NMI_LINE+1; } -void m6502_device::do_adc_d(UINT8 val) +void m6502_device::do_adc_d(uint8_t val) { - UINT8 c = P & F_C ? 1 : 0; + uint8_t c = P & F_C ? 1 : 0; P &= ~(F_N|F_V|F_Z|F_C); - UINT8 al = (A & 15) + (val & 15) + c; + uint8_t al = (A & 15) + (val & 15) + c; if(al > 9) al += 6; - UINT8 ah = (A >> 4) + (val >> 4) + (al > 15); - if(!UINT8(A + val + c)) + uint8_t ah = (A >> 4) + (val >> 4) + (al > 15); + if(!uint8_t(A + val + c)) P |= F_Z; else if(ah & 8) P |= F_N; @@ -162,14 +162,14 @@ void m6502_device::do_adc_d(UINT8 val) A = (ah << 4) | (al & 15); } -void m6502_device::do_adc_nd(UINT8 val) +void m6502_device::do_adc_nd(uint8_t val) { - UINT16 sum; + uint16_t sum; sum = A + val + (P & F_C ? 1 : 0); P &= ~(F_N|F_V|F_Z|F_C); - if(!UINT8(sum)) + if(!uint8_t(sum)) P |= F_Z; - else if(INT8(sum) < 0) + else if(int8_t(sum) < 0) P |= F_N; if(~(A^val) & (A^sum) & 0x80) P |= F_V; @@ -178,7 +178,7 @@ void m6502_device::do_adc_nd(UINT8 val) A = sum; } -void m6502_device::do_adc(UINT8 val) +void m6502_device::do_adc(uint8_t val) { if(P & F_D) do_adc_d(val); @@ -195,7 +195,7 @@ void m6502_device::do_arr_nd() A |= 0x80; if(!A) P |= F_Z; - else if(INT8(A)<0) + else if(int8_t(A)<0) P |= F_N; if(A & 0x40) P |= F_V|F_C; @@ -208,12 +208,12 @@ void m6502_device::do_arr_d() // The adc/ror interaction gives an extremely weird result bool c = P & F_C; P &= ~(F_N|F_Z|F_C|F_V); - UINT8 a = A >> 1; + uint8_t a = A >> 1; if(c) a |= 0x80; if(!a) P |= F_Z; - else if(INT8(a) < 0) + else if(int8_t(a) < 0) P |= F_N; if((a ^ A) & 0x40) P |= F_V; @@ -236,28 +236,28 @@ void m6502_device::do_arr() do_arr_nd(); } -void m6502_device::do_cmp(UINT8 val1, UINT8 val2) +void m6502_device::do_cmp(uint8_t val1, uint8_t val2) { P &= ~(F_N|F_Z|F_C); - UINT16 r = val1-val2; + uint16_t r = val1-val2; if(!r) P |= F_Z; - else if(INT8(r) < 0) + else if(int8_t(r) < 0) P |= F_N; if(!(r & 0xff00)) P |= F_C; } -void m6502_device::do_sbc_d(UINT8 val) +void m6502_device::do_sbc_d(uint8_t val) { - UINT8 c = P & F_C ? 0 : 1; + uint8_t c = P & F_C ? 0 : 1; P &= ~(F_N|F_V|F_Z|F_C); - UINT16 diff = A - val - c; - UINT8 al = (A & 15) - (val & 15) - c; - if(INT8(al) < 0) + uint16_t diff = A - val - c; + uint8_t al = (A & 15) - (val & 15) - c; + if(int8_t(al) < 0) al -= 6; - UINT8 ah = (A >> 4) - (val >> 4) - (INT8(al) < 0); - if(!UINT8(diff)) + uint8_t ah = (A >> 4) - (val >> 4) - (int8_t(al) < 0); + if(!uint8_t(diff)) P |= F_Z; else if(diff & 0x80) P |= F_N; @@ -265,18 +265,18 @@ void m6502_device::do_sbc_d(UINT8 val) P |= F_V; if(!(diff & 0xff00)) P |= F_C; - if(INT8(ah) < 0) + if(int8_t(ah) < 0) ah -= 6; A = (ah << 4) | (al & 15); } -void m6502_device::do_sbc_nd(UINT8 val) +void m6502_device::do_sbc_nd(uint8_t val) { - UINT16 diff = A - val - (P & F_C ? 0 : 1); + uint16_t diff = A - val - (P & F_C ? 0 : 1); P &= ~(F_N|F_V|F_Z|F_C); - if(!UINT8(diff)) + if(!uint8_t(diff)) P |= F_Z; - else if(INT8(diff) < 0) + else if(int8_t(diff) < 0) P |= F_N; if((A^val) & (A^diff) & 0x80) P |= F_V; @@ -285,7 +285,7 @@ void m6502_device::do_sbc_nd(UINT8 val) A = diff; } -void m6502_device::do_sbc(UINT8 val) +void m6502_device::do_sbc(uint8_t val) { if(P & F_D) do_sbc_d(val); @@ -293,10 +293,10 @@ void m6502_device::do_sbc(UINT8 val) do_sbc_nd(val); } -void m6502_device::do_bit(UINT8 val) +void m6502_device::do_bit(uint8_t val) { P &= ~(F_N|F_Z|F_V); - UINT8 r = A & val; + uint8_t r = A & val; if(!r) P |= F_Z; if(val & 0x80) @@ -305,20 +305,20 @@ void m6502_device::do_bit(UINT8 val) P |= F_V; } -UINT8 m6502_device::do_asl(UINT8 v) +uint8_t m6502_device::do_asl(uint8_t v) { P &= ~(F_N|F_Z|F_C); - UINT8 r = v<<1; + uint8_t r = v<<1; if(!r) P |= F_Z; - else if(INT8(r) < 0) + else if(int8_t(r) < 0) P |= F_N; if(v & 0x80) P |= F_C; return r; } -UINT8 m6502_device::do_lsr(UINT8 v) +uint8_t m6502_device::do_lsr(uint8_t v) { P &= ~(F_N|F_Z|F_C); if(v & 1) @@ -329,7 +329,7 @@ UINT8 m6502_device::do_lsr(UINT8 v) return v; } -UINT8 m6502_device::do_ror(UINT8 v) +uint8_t m6502_device::do_ror(uint8_t v) { bool c = P & F_C; P &= ~(F_N|F_Z|F_C); @@ -340,12 +340,12 @@ UINT8 m6502_device::do_ror(UINT8 v) v |= 0x80; if(!v) P |= F_Z; - else if(INT8(v)<0) + else if(int8_t(v)<0) P |= F_N; return v; } -UINT8 m6502_device::do_rol(UINT8 v) +uint8_t m6502_device::do_rol(uint8_t v) { bool c = P & F_C; P &= ~(F_N|F_Z|F_C); @@ -356,12 +356,12 @@ UINT8 m6502_device::do_rol(UINT8 v) v |= 0x01; if(!v) P |= F_Z; - else if(INT8(v)<0) + else if(int8_t(v)<0) P |= F_N; return v; } -UINT8 m6502_device::do_asr(UINT8 v) +uint8_t m6502_device::do_asr(uint8_t v) { P &= ~(F_N|F_Z|F_C); if(v & 1) @@ -456,20 +456,20 @@ void m6502_device::state_string_export(const device_state_entry &entry, std::str } -UINT32 m6502_device::disasm_min_opcode_bytes() const +uint32_t m6502_device::disasm_min_opcode_bytes() const { return 1; } -UINT32 m6502_device::disasm_max_opcode_bytes() const +uint32_t m6502_device::disasm_max_opcode_bytes() const { return 4; } -offs_t m6502_device::disassemble_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *table) +offs_t m6502_device::disassemble_generic(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options, const disasm_entry *table) { const disasm_entry &e = table[oprom[0] | inst_state_base]; - UINT32 flags = e.flags | DASMFLAG_SUPPORTED; + uint32_t flags = e.flags | DASMFLAG_SUPPORTED; buffer += sprintf(buffer, "%s", e.opcode); switch(e.mode) { @@ -557,17 +557,17 @@ offs_t m6502_device::disassemble_generic(char *buffer, offs_t pc, const UINT8 *o break; case DASM_rel: - sprintf(buffer, " $%04x", (pc & 0xf0000) | UINT16(pc + 2 + INT8(opram[1]))); + sprintf(buffer, " $%04x", (pc & 0xf0000) | uint16_t(pc + 2 + int8_t(opram[1]))); flags |= 2; break; case DASM_rw2: - sprintf(buffer, " $%04x", (pc & 0xf0000) | UINT16(pc + 2 + INT16((opram[2] << 8) | opram[1]))); + sprintf(buffer, " $%04x", (pc & 0xf0000) | uint16_t(pc + 2 + int16_t((opram[2] << 8) | opram[1]))); flags |= 3; break; case DASM_zpb: - sprintf(buffer, "%d $%02x, $%04x", (oprom[0] >> 4) & 7, opram[1], (pc & 0xf0000) | UINT16(pc + 3 + INT8(opram[2]))); + sprintf(buffer, "%d $%02x, $%04x", (oprom[0] >> 4) & 7, opram[1], (pc & 0xf0000) | uint16_t(pc + 3 + int8_t(opram[2]))); flags |= 3; break; @@ -607,12 +607,12 @@ offs_t m6502_device::disassemble_generic(char *buffer, offs_t pc, const UINT8 *o break; case DASM_bzr: - sprintf(buffer, " %d, $%02x, $%04x", (opram[0] >> 5) & 7, opram[1], (pc & 0xf0000) | UINT16(pc + 3 + INT8(opram[2]))); + sprintf(buffer, " %d, $%02x, $%04x", (opram[0] >> 5) & 7, opram[1], (pc & 0xf0000) | uint16_t(pc + 3 + int8_t(opram[2]))); flags |= 3; break; case DASM_bar: - sprintf(buffer, " %d, a, $%04x", (opram[0] >> 5) & 7, (pc & 0xf0000) | UINT16(pc + 3 + INT8(opram[1]))); + sprintf(buffer, " %d, a, $%04x", (opram[0] >> 5) & 7, (pc & 0xf0000) | uint16_t(pc + 3 + int8_t(opram[1]))); flags |= 2; break; @@ -655,7 +655,7 @@ void m6502_device::prefetch_noirq() PC++; } -void m6502_device::set_nz(UINT8 v) +void m6502_device::set_nz(uint8_t v) { P &= ~(F_Z|F_N); if(v & 0x80) @@ -664,50 +664,50 @@ void m6502_device::set_nz(UINT8 v) P |= F_Z; } -offs_t m6502_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6502_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } -UINT8 m6502_device::memory_interface::read_9(UINT16 adr) +uint8_t m6502_device::memory_interface::read_9(uint16_t adr) { return read(adr); } -void m6502_device::memory_interface::write_9(UINT16 adr, UINT8 val) +void m6502_device::memory_interface::write_9(uint16_t adr, uint8_t val) { write(adr, val); } -UINT8 m6502_device::mi_default_normal::read(UINT16 adr) +uint8_t m6502_device::mi_default_normal::read(uint16_t adr) { return program->read_byte(adr); } -UINT8 m6502_device::mi_default_normal::read_sync(UINT16 adr) +uint8_t m6502_device::mi_default_normal::read_sync(uint16_t adr) { return sdirect->read_byte(adr); } -UINT8 m6502_device::mi_default_normal::read_arg(UINT16 adr) +uint8_t m6502_device::mi_default_normal::read_arg(uint16_t adr) { return direct->read_byte(adr); } -void m6502_device::mi_default_normal::write(UINT16 adr, UINT8 val) +void m6502_device::mi_default_normal::write(uint16_t adr, uint8_t val) { program->write_byte(adr, val); } -UINT8 m6502_device::mi_default_nd::read_sync(UINT16 adr) +uint8_t m6502_device::mi_default_nd::read_sync(uint16_t adr) { return sprogram->read_byte(adr); } -UINT8 m6502_device::mi_default_nd::read_arg(UINT16 adr) +uint8_t m6502_device::mi_default_nd::read_arg(uint16_t adr) { return program->read_byte(adr); } diff --git a/src/devices/cpu/m6502/m6502.h b/src/devices/cpu/m6502/m6502.h index d09554a3dff..167b643ac94 100644 --- a/src/devices/cpu/m6502/m6502.h +++ b/src/devices/cpu/m6502/m6502.h @@ -26,8 +26,8 @@ public: V_LINE = INPUT_LINE_IRQ0 + 16 }; - m6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m6502_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); + m6502_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m6502_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); bool get_sync() const { return sync; } void disable_direct() { direct_disabled = true; } @@ -43,28 +43,28 @@ protected: direct_read_data *direct, *sdirect; virtual ~memory_interface() {} - virtual UINT8 read(UINT16 adr) = 0; - virtual UINT8 read_9(UINT16 adr); - virtual UINT8 read_sync(UINT16 adr) = 0; - virtual UINT8 read_arg(UINT16 adr) = 0; - virtual void write(UINT16 adr, UINT8 val) = 0; - virtual void write_9(UINT16 adr, UINT8 val); + virtual uint8_t read(uint16_t adr) = 0; + virtual uint8_t read_9(uint16_t adr); + virtual uint8_t read_sync(uint16_t adr) = 0; + virtual uint8_t read_arg(uint16_t adr) = 0; + virtual void write(uint16_t adr, uint8_t val) = 0; + virtual void write_9(uint16_t adr, uint8_t val); }; class mi_default_normal : public memory_interface { public: virtual ~mi_default_normal() {} - virtual UINT8 read(UINT16 adr) override; - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; + virtual uint8_t read(uint16_t adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; }; class mi_default_nd : public mi_default_normal { public: virtual ~mi_default_nd() {} - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; }; struct disasm_entry { @@ -129,9 +129,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -144,23 +144,23 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config program_config, sprogram_config; - UINT16 PPC; /* previous program counter */ - UINT16 NPC; /* next start-of-instruction program counter */ - UINT16 PC; /* program counter */ - UINT16 SP; /* stack pointer (always 100 - 1FF) */ - UINT16 TMP; /* temporary internal values */ - UINT8 TMP2; /* another temporary internal value, 8 bits this time */ - UINT8 A; /* Accumulator */ - UINT8 X; /* X index register */ - UINT8 Y; /* Y index register */ - UINT8 P; /* Processor status */ - UINT8 IR; /* Prefetched instruction register */ + uint16_t PPC; /* previous program counter */ + uint16_t NPC; /* next start-of-instruction program counter */ + uint16_t PC; /* program counter */ + uint16_t SP; /* stack pointer (always 100 - 1FF) */ + uint16_t TMP; /* temporary internal values */ + uint8_t TMP2; /* another temporary internal value, 8 bits this time */ + uint8_t A; /* Accumulator */ + uint8_t X; /* X index register */ + uint8_t Y; /* Y index register */ + uint8_t P; /* Processor status */ + uint8_t IR; /* Prefetched instruction register */ int inst_state_base; /* Current instruction bank */ memory_interface *mintf; @@ -171,46 +171,46 @@ protected: static const disasm_entry disasm_entries[0x100]; - offs_t disassemble_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *table); - UINT8 read(UINT16 adr) { return mintf->read(adr); } - UINT8 read_9(UINT16 adr) { return mintf->read_9(adr); } - void write(UINT16 adr, UINT8 val) { mintf->write(adr, val); } - void write_9(UINT16 adr, UINT8 val) { mintf->write_9(adr, val); } - UINT8 read_arg(UINT16 adr) { return mintf->read_arg(adr); } - UINT8 read_pc() { return mintf->read_arg(PC++); } - UINT8 read_pc_noinc() { return mintf->read_arg(PC); } + offs_t disassemble_generic(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options, const disasm_entry *table); + uint8_t read(uint16_t adr) { return mintf->read(adr); } + uint8_t read_9(uint16_t adr) { return mintf->read_9(adr); } + void write(uint16_t adr, uint8_t val) { mintf->write(adr, val); } + void write_9(uint16_t adr, uint8_t val) { mintf->write_9(adr, val); } + uint8_t read_arg(uint16_t adr) { return mintf->read_arg(adr); } + uint8_t read_pc() { return mintf->read_arg(PC++); } + uint8_t read_pc_noinc() { return mintf->read_arg(PC); } void prefetch(); void prefetch_noirq(); - void set_nz(UINT8 v); + void set_nz(uint8_t v); virtual void do_exec_full(); virtual void do_exec_partial(); // inline helpers - static inline bool page_changing(UINT16 base, int delta) { return ((base + delta) ^ base) & 0xff00; } - static inline UINT16 set_l(UINT16 base, UINT8 val) { return (base & 0xff00) | val; } - static inline UINT16 set_h(UINT16 base, UINT8 val) { return (base & 0x00ff) | (val << 8); } + static inline bool page_changing(uint16_t base, int delta) { return ((base + delta) ^ base) & 0xff00; } + static inline uint16_t set_l(uint16_t base, uint8_t val) { return (base & 0xff00) | val; } + static inline uint16_t set_h(uint16_t base, uint8_t val) { return (base & 0x00ff) | (val << 8); } inline void dec_SP() { SP = set_l(SP, SP-1); } inline void inc_SP() { SP = set_l(SP, SP+1); } - void do_adc_d(UINT8 val); - void do_adc_nd(UINT8 val); - void do_sbc_d(UINT8 val); - void do_sbc_nd(UINT8 val); + void do_adc_d(uint8_t val); + void do_adc_nd(uint8_t val); + void do_sbc_d(uint8_t val); + void do_sbc_nd(uint8_t val); void do_arr_d(); void do_arr_nd(); - void do_adc(UINT8 val); - void do_cmp(UINT8 val1, UINT8 val2); - void do_sbc(UINT8 val); - void do_bit(UINT8 val); + void do_adc(uint8_t val); + void do_cmp(uint8_t val1, uint8_t val2); + void do_sbc(uint8_t val); + void do_bit(uint8_t val); void do_arr(); - UINT8 do_asl(UINT8 v); - UINT8 do_lsr(UINT8 v); - UINT8 do_ror(UINT8 v); - UINT8 do_rol(UINT8 v); - UINT8 do_asr(UINT8 v); + uint8_t do_asl(uint8_t v); + uint8_t do_lsr(uint8_t v); + uint8_t do_ror(uint8_t v); + uint8_t do_rol(uint8_t v); + uint8_t do_asr(uint8_t v); #define O(o) void o ## _full(); void o ## _partial() diff --git a/src/devices/cpu/m6502/m6504.cpp b/src/devices/cpu/m6502/m6504.cpp index f2ae2c4b6d9..a2a2f006d1b 100644 --- a/src/devices/cpu/m6502/m6504.cpp +++ b/src/devices/cpu/m6502/m6504.cpp @@ -13,7 +13,7 @@ const device_type M6504 = &device_creator; -m6504_device::m6504_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m6504_device::m6504_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, M6504, "M6504", tag, owner, clock, "m6504", __FILE__) { program_config.m_addrbus_width = 13; @@ -30,32 +30,32 @@ void m6504_device::device_start() init(); } -UINT8 m6504_device::mi_6504_normal::read(UINT16 adr) +uint8_t m6504_device::mi_6504_normal::read(uint16_t adr) { return program->read_byte(adr & 0x1fff); } -UINT8 m6504_device::mi_6504_normal::read_sync(UINT16 adr) +uint8_t m6504_device::mi_6504_normal::read_sync(uint16_t adr) { return sdirect->read_byte(adr & 0x1fff); } -UINT8 m6504_device::mi_6504_normal::read_arg(UINT16 adr) +uint8_t m6504_device::mi_6504_normal::read_arg(uint16_t adr) { return direct->read_byte(adr & 0x1fff); } -void m6504_device::mi_6504_normal::write(UINT16 adr, UINT8 val) +void m6504_device::mi_6504_normal::write(uint16_t adr, uint8_t val) { program->write_byte(adr & 0x1fff, val); } -UINT8 m6504_device::mi_6504_nd::read_sync(UINT16 adr) +uint8_t m6504_device::mi_6504_nd::read_sync(uint16_t adr) { return sprogram->read_byte(adr & 0x1fff); } -UINT8 m6504_device::mi_6504_nd::read_arg(UINT16 adr) +uint8_t m6504_device::mi_6504_nd::read_arg(uint16_t adr) { return program->read_byte(adr & 0x1fff); } diff --git a/src/devices/cpu/m6502/m6504.h b/src/devices/cpu/m6502/m6504.h index 6a4e4f5f9df..fdd15ff46a6 100644 --- a/src/devices/cpu/m6502/m6504.h +++ b/src/devices/cpu/m6502/m6504.h @@ -15,23 +15,23 @@ class m6504_device : public m6502_device { public: - m6504_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m6504_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: class mi_6504_normal : public memory_interface { public: virtual ~mi_6504_normal() {} - virtual UINT8 read(UINT16 adr) override; - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; + virtual uint8_t read(uint16_t adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; }; class mi_6504_nd : public mi_6504_normal { public: virtual ~mi_6504_nd() {} - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; }; virtual void device_start() override; diff --git a/src/devices/cpu/m6502/m6507.cpp b/src/devices/cpu/m6502/m6507.cpp index 0f561b17e62..85855f75aab 100644 --- a/src/devices/cpu/m6502/m6507.cpp +++ b/src/devices/cpu/m6502/m6507.cpp @@ -13,7 +13,7 @@ const device_type M6507 = &device_creator; -m6507_device::m6507_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m6507_device::m6507_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, M6507, "M6507", tag, owner, clock, "m6507", __FILE__) { program_config.m_addrbus_width = 13; @@ -30,32 +30,32 @@ void m6507_device::device_start() init(); } -UINT8 m6507_device::mi_6507_normal::read(UINT16 adr) +uint8_t m6507_device::mi_6507_normal::read(uint16_t adr) { return program->read_byte(adr & 0x1fff); } -UINT8 m6507_device::mi_6507_normal::read_sync(UINT16 adr) +uint8_t m6507_device::mi_6507_normal::read_sync(uint16_t adr) { return sdirect->read_byte(adr & 0x1fff); } -UINT8 m6507_device::mi_6507_normal::read_arg(UINT16 adr) +uint8_t m6507_device::mi_6507_normal::read_arg(uint16_t adr) { return direct->read_byte(adr & 0x1fff); } -void m6507_device::mi_6507_normal::write(UINT16 adr, UINT8 val) +void m6507_device::mi_6507_normal::write(uint16_t adr, uint8_t val) { program->write_byte(adr & 0x1fff, val); } -UINT8 m6507_device::mi_6507_nd::read_sync(UINT16 adr) +uint8_t m6507_device::mi_6507_nd::read_sync(uint16_t adr) { return sprogram->read_byte(adr & 0x1fff); } -UINT8 m6507_device::mi_6507_nd::read_arg(UINT16 adr) +uint8_t m6507_device::mi_6507_nd::read_arg(uint16_t adr) { return program->read_byte(adr & 0x1fff); } diff --git a/src/devices/cpu/m6502/m6507.h b/src/devices/cpu/m6502/m6507.h index b349b9f8bb7..256f1e4c8bb 100644 --- a/src/devices/cpu/m6502/m6507.h +++ b/src/devices/cpu/m6502/m6507.h @@ -15,23 +15,23 @@ class m6507_device : public m6502_device { public: - m6507_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m6507_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: class mi_6507_normal : public memory_interface { public: virtual ~mi_6507_normal() {} - virtual UINT8 read(UINT16 adr) override; - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; + virtual uint8_t read(uint16_t adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; }; class mi_6507_nd : public mi_6507_normal { public: virtual ~mi_6507_nd() {} - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; }; virtual void device_start() override; diff --git a/src/devices/cpu/m6502/m6509.cpp b/src/devices/cpu/m6502/m6509.cpp index 6d955a7edec..459021a9bc6 100644 --- a/src/devices/cpu/m6502/m6509.cpp +++ b/src/devices/cpu/m6502/m6509.cpp @@ -13,7 +13,7 @@ const device_type M6509 = &device_creator; -m6509_device::m6509_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m6509_device::m6509_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, M6509, "M6509", tag, owner, clock, "m6509", __FILE__), XPC(0), bank_i(0), bank_y(0) { program_config.m_addrbus_width = 20; @@ -54,7 +54,7 @@ void m6509_device::state_export(const device_state_entry &entry) } } -offs_t m6509_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6509_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } @@ -65,9 +65,9 @@ m6509_device::mi_6509_normal::mi_6509_normal(m6509_device *_base) base = _base; } -UINT8 m6509_device::mi_6509_normal::read(UINT16 adr) +uint8_t m6509_device::mi_6509_normal::read(uint16_t adr) { - UINT8 res = program->read_byte(base->adr_in_bank_i(adr)); + uint8_t res = program->read_byte(base->adr_in_bank_i(adr)); if(adr == 0x0000) res = base->bank_i_r(); else if(adr == 0x0001) @@ -75,9 +75,9 @@ UINT8 m6509_device::mi_6509_normal::read(UINT16 adr) return res; } -UINT8 m6509_device::mi_6509_normal::read_sync(UINT16 adr) +uint8_t m6509_device::mi_6509_normal::read_sync(uint16_t adr) { - UINT8 res = sdirect->read_byte(base->adr_in_bank_i(adr)); + uint8_t res = sdirect->read_byte(base->adr_in_bank_i(adr)); if(adr == 0x0000) res = base->bank_i_r(); else if(adr == 0x0001) @@ -85,9 +85,9 @@ UINT8 m6509_device::mi_6509_normal::read_sync(UINT16 adr) return res; } -UINT8 m6509_device::mi_6509_normal::read_arg(UINT16 adr) +uint8_t m6509_device::mi_6509_normal::read_arg(uint16_t adr) { - UINT8 res = direct->read_byte(base->adr_in_bank_i(adr)); + uint8_t res = direct->read_byte(base->adr_in_bank_i(adr)); if(adr == 0x0000) res = base->bank_i_r(); else if(adr == 0x0001) @@ -95,9 +95,9 @@ UINT8 m6509_device::mi_6509_normal::read_arg(UINT16 adr) return res; } -UINT8 m6509_device::mi_6509_normal::read_9(UINT16 adr) +uint8_t m6509_device::mi_6509_normal::read_9(uint16_t adr) { - UINT8 res = program->read_byte(base->adr_in_bank_y(adr)); + uint8_t res = program->read_byte(base->adr_in_bank_y(adr)); if(adr == 0x0000) res = base->bank_i_r(); else if(adr == 0x0001) @@ -105,7 +105,7 @@ UINT8 m6509_device::mi_6509_normal::read_9(UINT16 adr) return res; } -void m6509_device::mi_6509_normal::write(UINT16 adr, UINT8 val) +void m6509_device::mi_6509_normal::write(uint16_t adr, uint8_t val) { program->write_byte(base->adr_in_bank_i(adr), val); if(adr == 0x0000) @@ -114,7 +114,7 @@ void m6509_device::mi_6509_normal::write(UINT16 adr, UINT8 val) base->bank_y_w(val); } -void m6509_device::mi_6509_normal::write_9(UINT16 adr, UINT8 val) +void m6509_device::mi_6509_normal::write_9(uint16_t adr, uint8_t val) { program->write_byte(base->adr_in_bank_y(adr), val); if(adr == 0x0000) @@ -127,9 +127,9 @@ m6509_device::mi_6509_nd::mi_6509_nd(m6509_device *_base) : mi_6509_normal(_base { } -UINT8 m6509_device::mi_6509_nd::read_sync(UINT16 adr) +uint8_t m6509_device::mi_6509_nd::read_sync(uint16_t adr) { - UINT8 res = sprogram->read_byte(base->adr_in_bank_i(adr)); + uint8_t res = sprogram->read_byte(base->adr_in_bank_i(adr)); if(adr == 0x0000) res = base->bank_i_r(); else if(adr == 0x0001) @@ -137,9 +137,9 @@ UINT8 m6509_device::mi_6509_nd::read_sync(UINT16 adr) return res; } -UINT8 m6509_device::mi_6509_nd::read_arg(UINT16 adr) +uint8_t m6509_device::mi_6509_nd::read_arg(uint16_t adr) { - UINT8 res = program->read_byte(base->adr_in_bank_i(adr)); + uint8_t res = program->read_byte(base->adr_in_bank_i(adr)); if(adr == 0x0000) res = base->bank_i_r(); else if(adr == 0x0001) diff --git a/src/devices/cpu/m6502/m6509.h b/src/devices/cpu/m6502/m6509.h index 803afcff0e9..ec9e8e6690a 100644 --- a/src/devices/cpu/m6502/m6509.h +++ b/src/devices/cpu/m6502/m6509.h @@ -15,11 +15,11 @@ class m6509_device : public m6502_device { public: - m6509_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m6509_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; @@ -30,37 +30,37 @@ protected: mi_6509_normal(m6509_device *base); virtual ~mi_6509_normal() {} - virtual UINT8 read(UINT16 adr) override; - virtual UINT8 read_9(UINT16 adr) override; - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; - virtual void write_9(UINT16 adr, UINT8 val) override; + virtual uint8_t read(uint16_t adr) override; + virtual uint8_t read_9(uint16_t adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; + virtual void write_9(uint16_t adr, uint8_t val) override; }; class mi_6509_nd : public mi_6509_normal { public: mi_6509_nd(m6509_device *base); virtual ~mi_6509_nd() {} - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; }; virtual void device_start() override; virtual void device_reset() override; virtual void state_export(const device_state_entry &entry) override; - UINT32 XPC; + uint32_t XPC; - UINT8 bank_i, bank_y; + uint8_t bank_i, bank_y; - UINT8 bank_i_r() { return bank_i; } - UINT8 bank_y_r() { return bank_y; } - void bank_i_w(UINT8 data) { bank_i = data; } - void bank_y_w(UINT8 data) { bank_y = data; } + uint8_t bank_i_r() { return bank_i; } + uint8_t bank_y_r() { return bank_y; } + void bank_i_w(uint8_t data) { bank_i = data; } + void bank_y_w(uint8_t data) { bank_y = data; } - UINT32 adr_in_bank_i(UINT16 adr) { return adr | ((bank_i & 0xf) << 16); } - UINT32 adr_in_bank_y(UINT16 adr) { return adr | ((bank_y & 0xf) << 16); } + uint32_t adr_in_bank_i(uint16_t adr) { return adr | ((bank_i & 0xf) << 16); } + uint32_t adr_in_bank_y(uint16_t adr) { return adr | ((bank_y & 0xf) << 16); } #define O(o) void o ## _full(); void o ## _partial() diff --git a/src/devices/cpu/m6502/m6510.cpp b/src/devices/cpu/m6502/m6510.cpp index 32ee2d6d4e0..26d881438f2 100644 --- a/src/devices/cpu/m6502/m6510.cpp +++ b/src/devices/cpu/m6502/m6510.cpp @@ -13,7 +13,7 @@ const device_type M6510 = &device_creator; -m6510_device::m6510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m6510_device::m6510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, M6510, "M6510", tag, owner, clock, "m6510", __FILE__), read_port(*this), write_port(*this), dir(0), port(0), drive(0) @@ -22,7 +22,7 @@ m6510_device::m6510_device(const machine_config &mconfig, const char *tag, devic floating = 0x00; } -m6510_device::m6510_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) : +m6510_device::m6510_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) : m6502_device(mconfig, type, name, tag, owner, clock, shortname, source), read_port(*this), write_port(*this), dir(0), port(0), drive(0) @@ -31,13 +31,13 @@ m6510_device::m6510_device(const machine_config &mconfig, device_type type, cons floating = 0x00; } -void m6510_device::set_pulls(UINT8 _pullup, UINT8 _floating) +void m6510_device::set_pulls(uint8_t _pullup, uint8_t _floating) { pullup = _pullup; floating = _floating; } -offs_t m6510_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6510_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } @@ -76,28 +76,28 @@ void m6510_device::update_port() write_port((port & dir) | (pullup & ~dir)); } -UINT8 m6510_device::get_port() +uint8_t m6510_device::get_port() { return (port & dir) | (pullup & ~dir); } -UINT8 m6510_device::dir_r() +uint8_t m6510_device::dir_r() { return dir; } -UINT8 m6510_device::port_r() +uint8_t m6510_device::port_r() { return ((read_port() | (floating & drive)) & ~dir) | (port & dir); } -void m6510_device::dir_w(UINT8 data) +void m6510_device::dir_w(uint8_t data) { dir = data; update_port(); } -void m6510_device::port_w(UINT8 data) +void m6510_device::port_w(uint8_t data) { port = data; update_port(); @@ -109,9 +109,9 @@ m6510_device::mi_6510_normal::mi_6510_normal(m6510_device *_base) base = _base; } -UINT8 m6510_device::mi_6510_normal::read(UINT16 adr) +uint8_t m6510_device::mi_6510_normal::read(uint16_t adr) { - UINT8 res = program->read_byte(adr); + uint8_t res = program->read_byte(adr); if(adr == 0x0000) res = base->dir_r(); else if(adr == 0x0001) @@ -119,9 +119,9 @@ UINT8 m6510_device::mi_6510_normal::read(UINT16 adr) return res; } -UINT8 m6510_device::mi_6510_normal::read_sync(UINT16 adr) +uint8_t m6510_device::mi_6510_normal::read_sync(uint16_t adr) { - UINT8 res = sdirect->read_byte(adr); + uint8_t res = sdirect->read_byte(adr); if(adr == 0x0000) res = base->dir_r(); else if(adr == 0x0001) @@ -129,9 +129,9 @@ UINT8 m6510_device::mi_6510_normal::read_sync(UINT16 adr) return res; } -UINT8 m6510_device::mi_6510_normal::read_arg(UINT16 adr) +uint8_t m6510_device::mi_6510_normal::read_arg(uint16_t adr) { - UINT8 res = direct->read_byte(adr); + uint8_t res = direct->read_byte(adr); if(adr == 0x0000) res = base->dir_r(); else if(adr == 0x0001) @@ -139,7 +139,7 @@ UINT8 m6510_device::mi_6510_normal::read_arg(UINT16 adr) return res; } -void m6510_device::mi_6510_normal::write(UINT16 adr, UINT8 val) +void m6510_device::mi_6510_normal::write(uint16_t adr, uint8_t val) { program->write_byte(adr, val); if(adr == 0x0000) @@ -152,9 +152,9 @@ m6510_device::mi_6510_nd::mi_6510_nd(m6510_device *_base) : mi_6510_normal(_base { } -UINT8 m6510_device::mi_6510_nd::read_sync(UINT16 adr) +uint8_t m6510_device::mi_6510_nd::read_sync(uint16_t adr) { - UINT8 res = sprogram->read_byte(adr); + uint8_t res = sprogram->read_byte(adr); if(adr == 0x0000) res = base->dir_r(); else if(adr == 0x0001) @@ -162,9 +162,9 @@ UINT8 m6510_device::mi_6510_nd::read_sync(UINT16 adr) return res; } -UINT8 m6510_device::mi_6510_nd::read_arg(UINT16 adr) +uint8_t m6510_device::mi_6510_nd::read_arg(uint16_t adr) { - UINT8 res = program->read_byte(adr); + uint8_t res = program->read_byte(adr); if(adr == 0x0000) res = base->dir_r(); else if(adr == 0x0001) diff --git a/src/devices/cpu/m6502/m6510.h b/src/devices/cpu/m6502/m6510.h index dbd0132baff..101d6bb2c71 100644 --- a/src/devices/cpu/m6502/m6510.h +++ b/src/devices/cpu/m6502/m6510.h @@ -21,11 +21,11 @@ class m6510_device : public m6502_device { public: - m6510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m6510_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); + m6510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m6510_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); - UINT8 get_port(); - void set_pulls(UINT8 pullup, UINT8 pulldown); + uint8_t get_port(); + void set_pulls(uint8_t pullup, uint8_t pulldown); template void set_callbacks(_read rd, _write wr) { read_port.set_callback(rd); @@ -34,7 +34,7 @@ public: static const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; @@ -45,32 +45,32 @@ protected: mi_6510_normal(m6510_device *base); virtual ~mi_6510_normal() {} - virtual UINT8 read(UINT16 adr) override; - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; + virtual uint8_t read(uint16_t adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; }; class mi_6510_nd : public mi_6510_normal { public: mi_6510_nd(m6510_device *base); virtual ~mi_6510_nd() {} - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; }; devcb_read8 read_port; devcb_write8 write_port; - UINT8 pullup, floating, dir, port, drive; + uint8_t pullup, floating, dir, port, drive; virtual void device_start() override; virtual void device_reset() override; - UINT8 dir_r(); - void dir_w(UINT8 data); - UINT8 port_r(); - void port_w(UINT8 data); + uint8_t dir_r(); + void dir_w(uint8_t data); + uint8_t port_r(); + void port_w(uint8_t data); void update_port(); diff --git a/src/devices/cpu/m6502/m6510t.cpp b/src/devices/cpu/m6502/m6510t.cpp index 7e8a34c6f20..6b9bb1f16ad 100644 --- a/src/devices/cpu/m6502/m6510t.cpp +++ b/src/devices/cpu/m6502/m6510t.cpp @@ -13,7 +13,7 @@ const device_type M6510T = &device_creator; -m6510t_device::m6510t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m6510t_device::m6510t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6510_device(mconfig, M6510T, "M6510T", tag, owner, clock, "m6510t", __FILE__) { } diff --git a/src/devices/cpu/m6502/m6510t.h b/src/devices/cpu/m6502/m6510t.h index f580ed6aef3..e27fe97ea98 100644 --- a/src/devices/cpu/m6502/m6510t.h +++ b/src/devices/cpu/m6502/m6510t.h @@ -21,7 +21,7 @@ class m6510t_device : public m6510_device { public: - m6510t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m6510t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; enum { diff --git a/src/devices/cpu/m6502/m65c02.cpp b/src/devices/cpu/m6502/m65c02.cpp index 8af7e663e8b..1fe8882c63c 100644 --- a/src/devices/cpu/m6502/m65c02.cpp +++ b/src/devices/cpu/m6502/m65c02.cpp @@ -14,17 +14,17 @@ const device_type M65C02 = &device_creator; -m65c02_device::m65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m65c02_device::m65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, M65C02, "M65C02", tag, owner, clock, "mc65c02", __FILE__) { } -m65c02_device::m65c02_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) : +m65c02_device::m65c02_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) : m6502_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -offs_t m65c02_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m65c02_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } diff --git a/src/devices/cpu/m6502/m65c02.h b/src/devices/cpu/m6502/m65c02.h index 6a929368512..ff1dbc0c780 100644 --- a/src/devices/cpu/m6502/m65c02.h +++ b/src/devices/cpu/m6502/m65c02.h @@ -16,12 +16,12 @@ class m65c02_device : public m6502_device { public: - m65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m65c02_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); + m65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m65c02_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 const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; diff --git a/src/devices/cpu/m6502/m65ce02.cpp b/src/devices/cpu/m6502/m65ce02.cpp index 50b7dcb2129..ce19861f70c 100644 --- a/src/devices/cpu/m6502/m65ce02.cpp +++ b/src/devices/cpu/m6502/m65ce02.cpp @@ -13,17 +13,17 @@ const device_type M65CE02 = &device_creator; -m65ce02_device::m65ce02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m65ce02_device::m65ce02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m65c02_device(mconfig, M65CE02, "M65CE02", tag, owner, clock, "m65ce02", __FILE__), TMP3(0), Z(0), B(0) { } -m65ce02_device::m65ce02_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) : +m65ce02_device::m65ce02_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) : m65c02_device(mconfig, type, name, tag, owner, clock, shortname, source), TMP3(0), Z(0), B(0) { } -offs_t m65ce02_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m65ce02_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } diff --git a/src/devices/cpu/m6502/m65ce02.h b/src/devices/cpu/m6502/m65ce02.h index d0d457d313c..2046975d103 100644 --- a/src/devices/cpu/m6502/m65ce02.h +++ b/src/devices/cpu/m6502/m65ce02.h @@ -15,19 +15,19 @@ class m65ce02_device : public m65c02_device { public: - m65ce02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m65ce02_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); + m65ce02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m65ce02_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 const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; protected: - UINT16 TMP3; /* temporary internal values */ - UINT8 Z; /* Z index register */ - UINT16 B; /* Zero page base address (always xx00) */ + uint16_t TMP3; /* temporary internal values */ + uint8_t Z; /* Z index register */ + uint16_t B; /* Zero page base address (always xx00) */ virtual void init() override; virtual void device_start() override; diff --git a/src/devices/cpu/m6502/m65sc02.cpp b/src/devices/cpu/m6502/m65sc02.cpp index f61bc63cf7f..e340fc0ca44 100644 --- a/src/devices/cpu/m6502/m65sc02.cpp +++ b/src/devices/cpu/m6502/m65sc02.cpp @@ -13,7 +13,7 @@ const device_type M65SC02 = &device_creator; -m65sc02_device::m65sc02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m65sc02_device::m65sc02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : r65c02_device(mconfig, M65SC02, "M65SC02", tag, owner, clock, "m65sc02", __FILE__) { } diff --git a/src/devices/cpu/m6502/m65sc02.h b/src/devices/cpu/m6502/m65sc02.h index f754fc3de89..13e91a3d0e1 100644 --- a/src/devices/cpu/m6502/m65sc02.h +++ b/src/devices/cpu/m6502/m65sc02.h @@ -15,7 +15,7 @@ class m65sc02_device : public r65c02_device { public: - m65sc02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m65sc02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; enum { diff --git a/src/devices/cpu/m6502/m740.cpp b/src/devices/cpu/m6502/m740.cpp index 3659a773ef5..005446487db 100644 --- a/src/devices/cpu/m6502/m740.cpp +++ b/src/devices/cpu/m6502/m740.cpp @@ -13,17 +13,17 @@ const device_type M740 = &device_creator; -m740_device::m740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m740_device::m740_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, M740, "M740", tag, owner, clock, "m740", __FILE__), m_irq_multiplex(0), m_irq_vector(0) { } -m740_device::m740_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) : +m740_device::m740_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) : m6502_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_multiplex(0), m_irq_vector(0) { } -offs_t m740_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m740_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } @@ -70,33 +70,33 @@ void m740_device::state_string_export(const device_state_entry &entry, std::stri } } -UINT8 m740_device::do_clb(UINT8 in, UINT8 bit) +uint8_t m740_device::do_clb(uint8_t in, uint8_t bit) { return in & ~(1<>4); } -void m740_device::do_sbc_dt(UINT8 val) +void m740_device::do_sbc_dt(uint8_t val) { - UINT8 c = P & F_C ? 0 : 1; + uint8_t c = P & F_C ? 0 : 1; P &= ~(F_N|F_V|F_Z|F_C); - UINT16 diff = TMP2 - val - c; - UINT8 al = (TMP2 & 15) - (val & 15) - c; - if(INT8(al) < 0) + uint16_t diff = TMP2 - val - c; + uint8_t al = (TMP2 & 15) - (val & 15) - c; + if(int8_t(al) < 0) al -= 6; - UINT8 ah = (TMP2 >> 4) - (val >> 4) - (INT8(al) < 0); - if(!UINT8(diff)) + uint8_t ah = (TMP2 >> 4) - (val >> 4) - (int8_t(al) < 0); + if(!uint8_t(diff)) P |= F_Z; else if(diff & 0x80) P |= F_N; @@ -104,18 +104,18 @@ void m740_device::do_sbc_dt(UINT8 val) P |= F_V; if(!(diff & 0xff00)) P |= F_C; - if(INT8(ah) < 0) + if(int8_t(ah) < 0) ah -= 6; TMP2 = (ah << 4) | (al & 15); } -void m740_device::do_sbc_ndt(UINT8 val) +void m740_device::do_sbc_ndt(uint8_t val) { - UINT16 diff = TMP2 - val - (P & F_C ? 0 : 1); + uint16_t diff = TMP2 - val - (P & F_C ? 0 : 1); P &= ~(F_N|F_V|F_Z|F_C); - if(!UINT8(diff)) + if(!uint8_t(diff)) P |= F_Z; - else if(INT8(diff) < 0) + else if(int8_t(diff) < 0) P |= F_N; if((TMP2^val) & (TMP2^diff) & 0x80) P |= F_V; @@ -124,7 +124,7 @@ void m740_device::do_sbc_ndt(UINT8 val) TMP2 = diff; } -void m740_device::do_sbct(UINT8 val) +void m740_device::do_sbct(uint8_t val) { if(P & F_D) do_sbc_dt(val); @@ -132,15 +132,15 @@ void m740_device::do_sbct(UINT8 val) do_sbc_ndt(val); } -void m740_device::do_adc_dt(UINT8 val) +void m740_device::do_adc_dt(uint8_t val) { - UINT8 c = P & F_C ? 1 : 0; + uint8_t c = P & F_C ? 1 : 0; P &= ~(F_N|F_V|F_Z|F_C); - UINT8 al = (TMP2 & 15) + (val & 15) + c; + uint8_t al = (TMP2 & 15) + (val & 15) + c; if(al > 9) al += 6; - UINT8 ah = (TMP2 >> 4) + (val >> 4) + (al > 15); - if(!UINT8(TMP2 + val + c)) + uint8_t ah = (TMP2 >> 4) + (val >> 4) + (al > 15); + if(!uint8_t(TMP2 + val + c)) P |= F_Z; else if(ah & 8) P |= F_N; @@ -153,14 +153,14 @@ void m740_device::do_adc_dt(UINT8 val) TMP2 = (ah << 4) | (al & 15); } -void m740_device::do_adc_ndt(UINT8 val) +void m740_device::do_adc_ndt(uint8_t val) { - UINT16 sum; + uint16_t sum; sum = TMP2 + val + (P & F_C ? 1 : 0); P &= ~(F_N|F_V|F_Z|F_C); - if(!UINT8(sum)) + if(!uint8_t(sum)) P |= F_Z; - else if(INT8(sum) < 0) + else if(int8_t(sum) < 0) P |= F_N; if(~(TMP2^val) & (TMP2^sum) & 0x80) P |= F_V; @@ -169,7 +169,7 @@ void m740_device::do_adc_ndt(UINT8 val) TMP2 = sum; } -void m740_device::do_adct(UINT8 val) +void m740_device::do_adct(uint8_t val) { if(P & F_D) do_adc_dt(val); @@ -231,7 +231,7 @@ void m740_device::set_irq_line(int line, int state) { if (m_irq_multiplex & (1 << i)) { - m_irq_vector = 0xfffc - (UINT16)(2 * i); + m_irq_vector = 0xfffc - (uint16_t)(2 * i); break; } } diff --git a/src/devices/cpu/m6502/m740.h b/src/devices/cpu/m6502/m740.h index 7f312b256cd..214cede5edc 100644 --- a/src/devices/cpu/m6502/m740.h +++ b/src/devices/cpu/m6502/m740.h @@ -36,8 +36,8 @@ public: M740_SET_OVERFLOW = m6502_device::V_LINE }; - m740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m740_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); + m740_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m740_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; @@ -46,7 +46,7 @@ public: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; virtual void execute_set_input(int inputnum, int state) override; @@ -54,15 +54,15 @@ public: protected: #define O(o) void o ## _full(); void o ## _partial() - UINT8 do_clb(UINT8 in, UINT8 bit); - UINT8 do_seb(UINT8 in, UINT8 bit); - UINT8 do_rrf(UINT8 in); - void do_sbc_dt(UINT8 val); - void do_sbc_ndt(UINT8 val); - void do_sbct(UINT8 val); - void do_adc_dt(UINT8 val); - void do_adc_ndt(UINT8 val); - void do_adct(UINT8 val); + uint8_t do_clb(uint8_t in, uint8_t bit); + uint8_t do_seb(uint8_t in, uint8_t bit); + uint8_t do_rrf(uint8_t in); + void do_sbc_dt(uint8_t val); + void do_sbc_ndt(uint8_t val); + void do_sbct(uint8_t val); + void do_adc_dt(uint8_t val); + void do_adc_ndt(uint8_t val); + void do_adct(uint8_t val); // m740 opcodes O(brk740_imp); @@ -94,8 +94,8 @@ protected: #undef O - UINT32 m_irq_multiplex; - UINT16 m_irq_vector; + uint32_t m_irq_multiplex; + uint16_t m_irq_vector; void set_irq_line(int line, int state); }; diff --git a/src/devices/cpu/m6502/m7501.cpp b/src/devices/cpu/m6502/m7501.cpp index 83bc290a172..54e7bdb7456 100644 --- a/src/devices/cpu/m6502/m7501.cpp +++ b/src/devices/cpu/m6502/m7501.cpp @@ -13,7 +13,7 @@ const device_type M7501 = &device_creator; -m7501_device::m7501_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m7501_device::m7501_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6510_device(mconfig, M7501, "M7501", tag, owner, clock, "m7501", __FILE__) { } diff --git a/src/devices/cpu/m6502/m7501.h b/src/devices/cpu/m6502/m7501.h index 7ded4caffe2..7912d3af0de 100644 --- a/src/devices/cpu/m6502/m7501.h +++ b/src/devices/cpu/m6502/m7501.h @@ -21,7 +21,7 @@ class m7501_device : public m6510_device { public: - m7501_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m7501_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; enum { diff --git a/src/devices/cpu/m6502/m8502.cpp b/src/devices/cpu/m6502/m8502.cpp index a967d03d74c..97d66d4431c 100644 --- a/src/devices/cpu/m6502/m8502.cpp +++ b/src/devices/cpu/m6502/m8502.cpp @@ -13,7 +13,7 @@ const device_type M8502 = &device_creator; -m8502_device::m8502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +m8502_device::m8502_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6510_device(mconfig, M8502, "M8502", tag, owner, clock, "m8502", __FILE__) { } diff --git a/src/devices/cpu/m6502/m8502.h b/src/devices/cpu/m6502/m8502.h index 1969ba6ffad..4967f8379bc 100644 --- a/src/devices/cpu/m6502/m8502.h +++ b/src/devices/cpu/m6502/m8502.h @@ -21,7 +21,7 @@ class m8502_device : public m6510_device { public: - m8502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m8502_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; enum { diff --git a/src/devices/cpu/m6502/n2a03.cpp b/src/devices/cpu/m6502/n2a03.cpp index 0f58f837f00..fb237cee295 100644 --- a/src/devices/cpu/m6502/n2a03.cpp +++ b/src/devices/cpu/m6502/n2a03.cpp @@ -49,14 +49,14 @@ ADDRESS_MAP_END -n2a03_device::n2a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +n2a03_device::n2a03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, N2A03, "N2A03", tag, owner, clock, "n2a03", __FILE__), m_apu(*this, "nesapu"), m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(n2a03_map)) { } -offs_t n2a03_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t n2a03_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } @@ -76,42 +76,42 @@ void n2a03_device::device_start() init(); } -UINT8 n2a03_device::mi_2a03_normal::read(UINT16 adr) +uint8_t n2a03_device::mi_2a03_normal::read(uint16_t adr) { return program->read_byte(adr); } -UINT8 n2a03_device::mi_2a03_normal::read_sync(UINT16 adr) +uint8_t n2a03_device::mi_2a03_normal::read_sync(uint16_t adr) { return sdirect->read_byte(adr); } -UINT8 n2a03_device::mi_2a03_normal::read_arg(UINT16 adr) +uint8_t n2a03_device::mi_2a03_normal::read_arg(uint16_t adr) { return direct->read_byte(adr); } -void n2a03_device::mi_2a03_normal::write(UINT16 adr, UINT8 val) +void n2a03_device::mi_2a03_normal::write(uint16_t adr, uint8_t val) { program->write_byte(adr, val); } -UINT8 n2a03_device::mi_2a03_nd::read(UINT16 adr) +uint8_t n2a03_device::mi_2a03_nd::read(uint16_t adr) { return program->read_byte(adr); } -UINT8 n2a03_device::mi_2a03_nd::read_sync(UINT16 adr) +uint8_t n2a03_device::mi_2a03_nd::read_sync(uint16_t adr) { return sprogram->read_byte(adr); } -UINT8 n2a03_device::mi_2a03_nd::read_arg(UINT16 adr) +uint8_t n2a03_device::mi_2a03_nd::read_arg(uint16_t adr) { return program->read_byte(adr); } -void n2a03_device::mi_2a03_nd::write(UINT16 adr, UINT8 val) +void n2a03_device::mi_2a03_nd::write(uint16_t adr, uint8_t val) { program->write_byte(adr, val); } diff --git a/src/devices/cpu/m6502/n2a03.h b/src/devices/cpu/m6502/n2a03.h index 57c8f6b43cd..9d01b5b6f83 100644 --- a/src/devices/cpu/m6502/n2a03.h +++ b/src/devices/cpu/m6502/n2a03.h @@ -16,13 +16,13 @@ class n2a03_device : public m6502_device { public: - n2a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + n2a03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_apu; static const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; virtual void device_clock_changed() override; @@ -36,19 +36,19 @@ protected: class mi_2a03_normal : public memory_interface { public: virtual ~mi_2a03_normal() {} - virtual UINT8 read(UINT16 adr) override; - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; + virtual uint8_t read(uint16_t adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; }; class mi_2a03_nd : public memory_interface { public: virtual ~mi_2a03_nd() {} - virtual UINT8 read(UINT16 adr) override; - virtual UINT8 read_sync(UINT16 adr) override; - virtual UINT8 read_arg(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; + virtual uint8_t read(uint16_t adr) override; + virtual uint8_t read_sync(uint16_t adr) override; + virtual uint8_t read_arg(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; }; virtual void device_start() override; diff --git a/src/devices/cpu/m6502/om6502.lst b/src/devices/cpu/m6502/om6502.lst index 93026a1fc8b..404eb1b6aad 100644 --- a/src/devices/cpu/m6502/om6502.lst +++ b/src/devices/cpu/m6502/om6502.lst @@ -66,7 +66,7 @@ adc_zpg adc_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); do_adc(TMP); prefetch(); @@ -134,7 +134,7 @@ and_zpg and_zpx TMP = read_pc(); read(TMP); - A &= read(UINT8(TMP+X)); + A &= read(uint8_t(TMP+X)); set_nz(A); prefetch(); @@ -174,7 +174,7 @@ asl_zpg asl_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2 = do_asl(TMP2); @@ -185,10 +185,10 @@ bcc_rel TMP = read_pc(); if(!(P & F_C)) { read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -196,10 +196,10 @@ bcs_rel TMP = read_pc(); if(P & F_C) { read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -207,10 +207,10 @@ beq_rel TMP = read_pc(); if(P & F_Z) { read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -229,10 +229,10 @@ bmi_rel TMP = read_pc(); if(P & F_N) { read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -240,10 +240,10 @@ bne_rel TMP = read_pc(); if(!(P & F_Z)) { read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -251,10 +251,10 @@ bpl_rel TMP = read_pc(); if(!(P & F_N)) { read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -291,10 +291,10 @@ bvc_rel TMP = read_pc(); if(!(P & F_V)) { read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -302,10 +302,10 @@ bvs_rel TMP = read_pc(); if(P & F_V) { read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -391,7 +391,7 @@ cmp_zpg cmp_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); do_cmp(A, TMP); prefetch(); @@ -465,7 +465,7 @@ dec_zpg dec_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2--; @@ -549,7 +549,7 @@ eor_zpg eor_zpx TMP = read_pc(); read(TMP); - A ^= read(UINT8(TMP+X)); + A ^= read(uint8_t(TMP+X)); set_nz(A); prefetch(); @@ -587,7 +587,7 @@ inc_zpg inc_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2++; @@ -693,7 +693,7 @@ lda_zpg lda_zpx TMP = read_pc(); read(TMP); - A = read(UINT8(TMP+X)); + A = read(uint8_t(TMP+X)); set_nz(A); prefetch(); @@ -728,7 +728,7 @@ ldx_zpg ldx_zpy TMP = read_pc(); read(TMP); - X = read(UINT8(TMP+Y)); + X = read(uint8_t(TMP+Y)); set_nz(X); prefetch(); @@ -764,7 +764,7 @@ ldy_zpg ldy_zpx TMP = read_pc(); read(TMP); - Y = read(UINT8(TMP+X)); + Y = read(uint8_t(TMP+X)); set_nz(Y); prefetch(); @@ -804,7 +804,7 @@ lsr_zpg lsr_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2 = do_lsr(TMP2); @@ -879,7 +879,7 @@ ora_zpg ora_zpx TMP = read_pc(); read(TMP); - A |= read(UINT8(TMP+X)); + A |= read(uint8_t(TMP+X)); set_nz(A); prefetch(); @@ -947,7 +947,7 @@ rol_zpg rol_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2 = do_rol(TMP2); @@ -990,7 +990,7 @@ ror_zpg ror_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2 = do_ror(TMP2); @@ -1080,7 +1080,7 @@ sbc_zpg sbc_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); do_sbc(TMP); prefetch(); @@ -1144,7 +1144,7 @@ sta_zpg sta_zpx TMP = read_pc(); read(TMP); - write(UINT8(TMP+X), A); + write(uint8_t(TMP+X), A); prefetch(); stx_aba @@ -1161,7 +1161,7 @@ stx_zpg stx_zpy TMP = read_pc(); read(TMP); - write(UINT8(TMP+Y), X); + write(uint8_t(TMP+Y), X); prefetch(); sty_aba @@ -1178,7 +1178,7 @@ sty_zpg sty_zpx TMP = read_pc(); read(TMP); - write(UINT8(TMP+X), Y); + write(uint8_t(TMP+X), Y); prefetch(); tax_imp @@ -1297,7 +1297,7 @@ dcp_zpg dcp_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2--; @@ -1377,7 +1377,7 @@ isb_zpg isb_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2++; @@ -1431,7 +1431,7 @@ lax_zpg lax_zpy TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+Y); + TMP = uint8_t(TMP+Y); A = X = read(TMP); set_nz(A); prefetch(); @@ -1514,7 +1514,7 @@ rla_zpg rla_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2 = do_rol(TMP2); @@ -1595,7 +1595,7 @@ rra_zpg rra_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2 = do_ror(TMP2); @@ -1629,7 +1629,7 @@ sax_zpg sax_zpy TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+Y); + TMP = uint8_t(TMP+Y); TMP2 = A & X; write(TMP, TMP2); prefetch(); @@ -1785,7 +1785,7 @@ slo_zpg slo_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2 = do_asl(TMP2); @@ -1872,7 +1872,7 @@ sre_zpg sre_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2 = do_lsr(TMP2); @@ -1952,7 +1952,7 @@ nop_zpg nop_zpx TMP = read_pc(); read(TMP); - read(UINT8(TMP+X)); + read(uint8_t(TMP+X)); prefetch(); # system killers diff --git a/src/devices/cpu/m6502/om65c02.lst b/src/devices/cpu/m6502/om65c02.lst index c2536d2c11d..6f72fe7e29a 100644 --- a/src/devices/cpu/m6502/om65c02.lst +++ b/src/devices/cpu/m6502/om65c02.lst @@ -103,7 +103,7 @@ adc_c_zpi adc_c_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); do_adc(TMP); if(P & F_D) { read_pc_noinc(); @@ -139,7 +139,7 @@ bbr_zpb TMP = read_pc(); read_pc_noinc(); if(!(TMP2 & (1 << ((inst_state >> 4) & 7)))) { - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -150,7 +150,7 @@ bbs_zpb TMP = read_pc(); read_pc_noinc(); if(TMP2 & (1 << ((inst_state >> 4) & 7))) { - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -175,17 +175,17 @@ bit_imm bit_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); do_bit(TMP); prefetch(); bra_rel TMP = read_pc(); read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); brk_c_imp @@ -474,7 +474,7 @@ sbc_c_zpi sbc_c_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); do_sbc(TMP); if(P & F_D) { read_pc_noinc(); @@ -524,7 +524,7 @@ stz_zpg stz_zpx TMP = read_pc(); read(TMP); - write(UINT8(TMP+X), 0x00); + write(uint8_t(TMP+X), 0x00); prefetch(); trb_aba diff --git a/src/devices/cpu/m6502/om65ce02.lst b/src/devices/cpu/m6502/om65ce02.lst index f5b6beebc9a..85648fd610d 100644 --- a/src/devices/cpu/m6502/om65ce02.lst +++ b/src/devices/cpu/m6502/om65ce02.lst @@ -79,7 +79,7 @@ adc_ce_zpg adc_ce_zpx TMP = read_pc(); - TMP = read(B|UINT8(TMP+X)); + TMP = read(B|uint8_t(TMP+X)); do_adc(TMP); if(P & F_D) set_nz(A); @@ -137,7 +137,7 @@ and_ce_zpg and_ce_zpx TMP = read_pc(); - A &= read(B|UINT8(TMP+X)); + A &= read(B|uint8_t(TMP+X)); set_nz(A); prefetch(); @@ -171,7 +171,7 @@ asl_ce_zpg asl_ce_zpx TMP = read_pc(); - TMP = B|UINT8(TMP+X); + TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); TMP2 = do_asl(TMP2); write(TMP, TMP2); @@ -190,7 +190,7 @@ asr_zpg asr_zpx TMP = read_pc(); - TMP = B|UINT8(TMP+X); + TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); TMP2 = do_asr(TMP2); write(TMP, TMP2); @@ -225,7 +225,7 @@ bbr_ce_zpb TMP2 = read(TMP); TMP = read_pc(); if(!(TMP2 & (1 << ((inst_state >> 4) & 7)))) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bbs_ce_zpb @@ -234,13 +234,13 @@ bbs_ce_zpb TMP2 = read(TMP); TMP = read_pc(); if(TMP2 & (1 << ((inst_state >> 4) & 7))) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bcc_ce_rel TMP = read_pc(); if(!(P & F_C)) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bcc_rw2 @@ -253,7 +253,7 @@ bcc_rw2 bcs_ce_rel TMP = read_pc(); if(P & F_C) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bcs_rw2 @@ -266,7 +266,7 @@ bcs_rw2 beq_ce_rel TMP = read_pc(); if(P & F_Z) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); beq_rw2 @@ -295,14 +295,14 @@ bit_ce_zpg bit_ce_zpx TMP = read_pc(); - TMP = read(B|UINT8(TMP+X)); + TMP = read(B|uint8_t(TMP+X)); do_bit(TMP); prefetch(); bmi_ce_rel TMP = read_pc(); if(P & F_N) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bmi_rw2 @@ -315,7 +315,7 @@ bmi_rw2 bne_ce_rel TMP = read_pc(); if(!(P & F_Z)) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bne_rw2 @@ -328,7 +328,7 @@ bne_rw2 bpl_ce_rel TMP = read_pc(); if(!(P & F_N)) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bpl_rw2 @@ -340,7 +340,7 @@ bpl_rw2 bra_ce_rel TMP = read_pc(); - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bra_rw2 @@ -387,7 +387,7 @@ bsr_rw2 bvc_ce_rel TMP = read_pc(); if(!(P & F_V)) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bvc_rw2 @@ -400,7 +400,7 @@ bvc_rw2 bvs_ce_rel TMP = read_pc(); if(P & F_V) - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); bvs_rw2 @@ -482,7 +482,7 @@ cmp_ce_zpg cmp_ce_zpx TMP = read_pc(); read(TMP); - TMP = read(B|UINT8(TMP+X)); + TMP = read(B|uint8_t(TMP+X)); do_cmp(A, TMP); prefetch(); @@ -550,7 +550,7 @@ dec_ce_zpg dec_ce_zpx TMP = read_pc(); - TMP = B|UINT8(TMP+X); + TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); TMP2--; set_nz(TMP2); @@ -641,7 +641,7 @@ eor_ce_zpg eor_ce_zpx TMP = read_pc(); - A ^= read(B|UINT8(TMP+X)); + A ^= read(B|uint8_t(TMP+X)); set_nz(A); prefetch(); @@ -679,7 +679,7 @@ inc_ce_zpg inc_ce_zpx TMP = read_pc(); - TMP = B|UINT8(TMP+X); + TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); TMP2++; set_nz(TMP2); @@ -830,7 +830,7 @@ lda_ce_zpg lda_ce_zpx TMP = read_pc(); - A = read(B|UINT8(TMP+X)); + A = read(B|uint8_t(TMP+X)); set_nz(A); prefetch(); @@ -849,7 +849,7 @@ ldx_ce_zpg ldx_ce_zpy TMP = read_pc(); - X = read(B|UINT8(TMP+Y)); + X = read(B|uint8_t(TMP+Y)); set_nz(X); prefetch(); @@ -869,7 +869,7 @@ ldy_ce_zpg ldy_ce_zpx TMP = read_pc(); - Y = read(B|UINT8(TMP+X)); + Y = read(B|uint8_t(TMP+X)); set_nz(Y); prefetch(); @@ -923,7 +923,7 @@ lsr_ce_zpg lsr_ce_zpx TMP = read_pc(); - TMP = B|UINT8(TMP+X); + TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); TMP2 = do_lsr(TMP2); write(TMP, TMP2); @@ -987,7 +987,7 @@ ora_ce_zpg ora_ce_zpx TMP = read_pc(); - A |= read(B|UINT8(TMP+X)); + A |= read(B|uint8_t(TMP+X)); set_nz(A); prefetch(); @@ -1114,7 +1114,7 @@ rol_ce_zpg rol_ce_zpx TMP = read_pc(); - TMP = B|UINT8(TMP+X); + TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); TMP2 = do_rol(TMP2); write(TMP, TMP2); @@ -1150,7 +1150,7 @@ ror_ce_zpg ror_ce_zpx TMP = read_pc(); - TMP = B|UINT8(TMP+X); + TMP = B|uint8_t(TMP+X); TMP2 = read(TMP); TMP2 = do_ror(TMP2); write(TMP, TMP2); @@ -1287,7 +1287,7 @@ sbc_ce_zpg sbc_ce_zpx TMP = read_pc(); read(TMP); - TMP = read(B|UINT8(TMP+X)); + TMP = read(B|uint8_t(TMP+X)); do_sbc(TMP); if(P & F_D) set_nz(A); @@ -1374,7 +1374,7 @@ sta_ce_zpg sta_ce_zpx TMP = read_pc(); - write(B|UINT8(TMP+X), A); + write(B|uint8_t(TMP+X), A); prefetch(); stx_aby @@ -1390,7 +1390,7 @@ stx_ce_zpg stx_ce_zpy TMP = read_pc(); - write(B|UINT8(TMP+Y), X); + write(B|uint8_t(TMP+Y), X); prefetch(); sty_abx @@ -1406,7 +1406,7 @@ sty_ce_zpg sty_ce_zpx TMP = read_pc(); - write(B|UINT8(TMP+X), Y); + write(B|uint8_t(TMP+X), Y); prefetch(); stz_ce_aba @@ -1428,7 +1428,7 @@ stz_ce_zpg stz_ce_zpx TMP = read_pc(); - write(B|UINT8(TMP+X), Z); + write(B|uint8_t(TMP+X), Z); prefetch(); tab_imp diff --git a/src/devices/cpu/m6502/om740.lst b/src/devices/cpu/m6502/om740.lst index f5ea32d49dc..0d84ca7cb5d 100644 --- a/src/devices/cpu/m6502/om740.lst +++ b/src/devices/cpu/m6502/om740.lst @@ -60,7 +60,7 @@ bbc_bzr TMP = read_pc(); read_pc_noinc(); if(!(TMP2 & (1 << ((IR>>5) & 7)))) { - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -70,7 +70,7 @@ bbs_bzr TMP = read_pc(); read_pc_noinc(); if(TMP2 & (1 << ((IR>>5) & 7))) { - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -78,7 +78,7 @@ bbc_bar TMP = read_pc(); read_pc_noinc(); if(!(A & (1 << ((IR>>5) & 7)))) { - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -86,7 +86,7 @@ bbs_bar TMP = read_pc(); read_pc_noinc(); if(A & (1 << ((IR>>5) & 7))) { - PC += INT8(TMP); + PC += int8_t(TMP); } prefetch(); @@ -100,10 +100,10 @@ rrf_zpg bra_rel TMP = read_pc(); read_pc_noinc(); - if(page_changing(PC, INT8(TMP))) { - read_arg(set_l(PC, PC+INT8(TMP))); + if(page_changing(PC, int8_t(TMP))) { + read_arg(set_l(PC, PC+int8_t(TMP))); } - PC += INT8(TMP); + PC += int8_t(TMP); prefetch(); jmp_zpi @@ -226,7 +226,7 @@ adct_zpg adct_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); TMP2 = read(X); do_adct(TMP); write(X, TMP2); @@ -311,7 +311,7 @@ andt_zpx TMP = read_pc(); read(TMP); TMP2 = read(X); - TMP2 &= read(UINT8(TMP+X)); + TMP2 &= read(uint8_t(TMP+X)); set_nz(TMP2); write(X, TMP2); prefetch(); @@ -393,7 +393,7 @@ cmpt_zpg cmpt_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); TMP2 = read(X); do_cmp(TMP2, TMP); prefetch(); @@ -491,7 +491,7 @@ eort_zpx TMP = read_pc(); read(TMP); TMP2 = read(X); - TMP2 ^= read(UINT8(TMP+X)); + TMP2 ^= read(uint8_t(TMP+X)); set_nz(TMP2); write(X, TMP2); prefetch(); @@ -579,7 +579,7 @@ ldt_zpg ldt_zpx TMP = read_pc(); read(TMP); - TMP2 = read(UINT8(TMP+X)); + TMP2 = read(uint8_t(TMP+X)); set_nz(TMP2); write(X, TMP2); prefetch(); @@ -663,7 +663,7 @@ ort_zpx TMP = read_pc(); read(TMP); TMP2 = read(X); - TMP2 |= read(UINT8(TMP+X)); + TMP2 |= read(uint8_t(TMP+X)); set_nz(TMP2); write(X, TMP2); prefetch(); @@ -744,7 +744,7 @@ sbct_zpg sbct_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); TMP2 = read(X); do_sbct(TMP); write(X, TMP2); diff --git a/src/devices/cpu/m6502/on2a03.lst b/src/devices/cpu/m6502/on2a03.lst index 2719f7c6ad2..096c5f08211 100644 --- a/src/devices/cpu/m6502/on2a03.lst +++ b/src/devices/cpu/m6502/on2a03.lst @@ -63,7 +63,7 @@ adc_nd_zpg adc_nd_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); do_adc_nd(TMP); prefetch(); @@ -144,7 +144,7 @@ rra_nd_zpg rra_nd_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2 = do_ror(TMP2); @@ -214,7 +214,7 @@ sbc_nd_zpg sbc_nd_zpx TMP = read_pc(); read(TMP); - TMP = read(UINT8(TMP+X)); + TMP = read(uint8_t(TMP+X)); do_sbc_nd(TMP); prefetch(); @@ -290,7 +290,7 @@ isb_nd_zpg isb_nd_zpx TMP = read_pc(); read(TMP); - TMP = UINT8(TMP+X); + TMP = uint8_t(TMP+X); TMP2 = read(TMP); write(TMP, TMP2); TMP2++; diff --git a/src/devices/cpu/m6502/r65c02.cpp b/src/devices/cpu/m6502/r65c02.cpp index 7aca4506731..fe0c4826a83 100644 --- a/src/devices/cpu/m6502/r65c02.cpp +++ b/src/devices/cpu/m6502/r65c02.cpp @@ -13,17 +13,17 @@ const device_type R65C02 = &device_creator; -r65c02_device::r65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +r65c02_device::r65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m65c02_device(mconfig, R65C02, "R65C02", tag, owner, clock, "r65c02", __FILE__) { } -r65c02_device::r65c02_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) : +r65c02_device::r65c02_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) : m65c02_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -offs_t r65c02_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t r65c02_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disassemble_generic(buffer, pc, oprom, opram, options, disasm_entries); } diff --git a/src/devices/cpu/m6502/r65c02.h b/src/devices/cpu/m6502/r65c02.h index 75077aab749..d25b1facf40 100644 --- a/src/devices/cpu/m6502/r65c02.h +++ b/src/devices/cpu/m6502/r65c02.h @@ -15,12 +15,12 @@ class r65c02_device : public m65c02_device { public: - r65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - r65c02_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); + r65c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + r65c02_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 const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; }; diff --git a/src/devices/cpu/m6800/6800dasm.cpp b/src/devices/cpu/m6800/6800dasm.cpp index 2e94ef3b62d..483f0abc353 100644 --- a/src/devices/cpu/m6800/6800dasm.cpp +++ b/src/devices/cpu/m6800/6800dasm.cpp @@ -84,7 +84,7 @@ static const char *const op_name_str[] = { * 2 invalid opcode for 1:6800/6802/6808, 2:6801/6803, 4:HD63701 */ -static const UINT8 table[0x104][3] = { +static const uint8_t table[0x104][3] = { {ill, inh,7},{nop, inh,0},{ill, inh,7},{ill, inh,7},/* 00 */ {lsrd,inh,1},{asld,inh,1},{tap, inh,0},{tpa, inh,0}, {inx, inh,0},{dex, inh,0},{clv, inh,0},{sev, inh,0}, @@ -166,12 +166,12 @@ static const UINT8 table[0x104][3] = { #define ARG2 opram[2] #define ARGW (opram[1]<<8) + opram[2] -static unsigned Dasm680x (int subtype, char *buf, unsigned pc, const UINT8 *oprom, const UINT8 *opram) +static unsigned Dasm680x (int subtype, char *buf, unsigned pc, const uint8_t *oprom, const uint8_t *opram) { - UINT32 flags = 0; + uint32_t flags = 0; int invalid_mask; int code = OP; - UINT8 opcode, args, invalid; + uint8_t opcode, args, invalid; switch( subtype ) { @@ -218,7 +218,7 @@ static unsigned Dasm680x (int subtype, char *buf, unsigned pc, const UINT8 *opro switch( args ) { case rel: /* relative */ - sprintf (buf, "$%04X", pc + (INT8)ARG1 + 2); + sprintf (buf, "$%04X", pc + (int8_t)ARG1 + 2); return 2 | flags | DASMFLAG_SUPPORTED; case imb: /* immediate (byte) */ sprintf (buf, "#$%02X", ARG1); diff --git a/src/devices/cpu/m6800/6800ops.hxx b/src/devices/cpu/m6800/6800ops.hxx index 2138103bd41..a931d29b0b5 100644 --- a/src/devices/cpu/m6800/6800ops.hxx +++ b/src/devices/cpu/m6800/6800ops.hxx @@ -44,7 +44,7 @@ OP_HANDLER( nop ) /* $04 LSRD inherent -0*-* */ OP_HANDLER( lsrd ) { - UINT16 t; + uint16_t t; CLR_NZC; t = D; CC|=(t&0x0001); t>>=1; SET_Z16(t); D=t; } @@ -53,7 +53,7 @@ OP_HANDLER( lsrd ) OP_HANDLER( asld ) { int r; - UINT16 t; + uint16_t t; t = D; r=t<<1; CLR_NZVC; SET_FLAGS16(t,t,r); D=r; @@ -130,7 +130,7 @@ OP_HANDLER( sei ) /* $10 SBA inherent -**** */ OP_HANDLER( sba ) { - UINT16 t; + uint16_t t; t=A-B; CLR_NZVC; SET_FLAGS8(A,B,t); A=t; @@ -139,7 +139,7 @@ OP_HANDLER( sba ) /* $11 CBA inherent -**** */ OP_HANDLER( cba ) { - UINT16 t; + uint16_t t; t=A-B; CLR_NZVC; SET_FLAGS8(A,B,t); } @@ -178,7 +178,7 @@ OP_HANDLER( tba ) /* $18 XGDX inherent ----- */ /* HD63701YO only */ OP_HANDLER( xgdx ) { - UINT16 t = X; + uint16_t t = X; X = D; D=t; } @@ -186,15 +186,15 @@ OP_HANDLER( xgdx ) /* $19 DAA inherent (A) -**0* */ OP_HANDLER( daa ) { - UINT8 msn, lsn; - UINT16 t, cf = 0; + uint8_t msn, lsn; + uint16_t t, cf = 0; msn=A & 0xf0; lsn=A & 0x0f; if( lsn>0x09 || CC&0x20 ) cf |= 0x06; if( msn>0x80 && lsn>0x09 ) cf |= 0x60; if( msn>0x90 || CC&0x01 ) cf |= 0x60; t = cf + A; CLR_NZV; /* keep carry from previous operation */ - SET_NZ8((UINT8)t); SET_C8(t); + SET_NZ8((uint8_t)t); SET_C8(t); A = t; } @@ -211,7 +211,7 @@ OP_HANDLER( slp ) /* $1b ABA inherent ***** */ OP_HANDLER( aba ) { - UINT16 t; + uint16_t t; t=A+B; CLR_HNZVC; SET_FLAGS8(A,B,t); SET_H(A,B,t); A=t; @@ -228,13 +228,13 @@ OP_HANDLER( aba ) /* $20 BRA relative ----- */ OP_HANDLER( bra ) { - UINT8 t; + uint8_t t; IMMBYTE(t); PC+=SIGNED(t); } /* $21 BRN relative ----- */ -static UINT8 m6800_brn_t; // hack around GCC 4.6 error because we need the side effects of IMMBYTE +static uint8_t m6800_brn_t; // hack around GCC 4.6 error because we need the side effects of IMMBYTE OP_HANDLER( brn ) { IMMBYTE(m6800_brn_t); @@ -243,98 +243,98 @@ OP_HANDLER( brn ) /* $22 BHI relative ----- */ OP_HANDLER( bhi ) { - UINT8 t; + uint8_t t; BRANCH(!(CC&0x05)); } /* $23 BLS relative ----- */ OP_HANDLER( bls ) { - UINT8 t; + uint8_t t; BRANCH(CC&0x05); } /* $24 BCC relative ----- */ OP_HANDLER( bcc ) { - UINT8 t; + uint8_t t; BRANCH(!(CC&0x01)); } /* $25 BCS relative ----- */ OP_HANDLER( bcs ) { - UINT8 t; + uint8_t t; BRANCH(CC&0x01); } /* $26 BNE relative ----- */ OP_HANDLER( bne ) { - UINT8 t; + uint8_t t; BRANCH(!(CC&0x04)); } /* $27 BEQ relative ----- */ OP_HANDLER( beq ) { - UINT8 t; + uint8_t t; BRANCH(CC&0x04); } /* $28 BVC relative ----- */ OP_HANDLER( bvc ) { - UINT8 t; + uint8_t t; BRANCH(!(CC&0x02)); } /* $29 BVS relative ----- */ OP_HANDLER( bvs ) { - UINT8 t; + uint8_t t; BRANCH(CC&0x02); } /* $2a BPL relative ----- */ OP_HANDLER( bpl ) { - UINT8 t; + uint8_t t; BRANCH(!(CC&0x08)); } /* $2b BMI relative ----- */ OP_HANDLER( bmi ) { - UINT8 t; + uint8_t t; BRANCH(CC&0x08); } /* $2c BGE relative ----- */ OP_HANDLER( bge ) { - UINT8 t; + uint8_t t; BRANCH(!NXORV); } /* $2d BLT relative ----- */ OP_HANDLER( blt ) { - UINT8 t; + uint8_t t; BRANCH(NXORV); } /* $2e BGT relative ----- */ OP_HANDLER( bgt ) { - UINT8 t; + uint8_t t; BRANCH(!(NXORV||CC&0x04)); } /* $2f BLE relative ----- */ OP_HANDLER( ble ) { - UINT8 t; + uint8_t t; BRANCH(NXORV||CC&0x04); } @@ -424,7 +424,7 @@ OP_HANDLER( pshx ) /* $3d MUL inherent --*-@ */ OP_HANDLER( mul ) { - UINT16 t; + uint16_t t; t=A*B; CLR_C; if(t&0x80) SEC; @@ -463,7 +463,7 @@ OP_HANDLER( swi ) /* $40 NEGA inherent ?**** */ OP_HANDLER( nega ) { - UINT16 r; + uint16_t r; r=-A; CLR_NZVC; SET_FLAGS8(0,A,r); A=r; @@ -492,7 +492,7 @@ OP_HANDLER( lsra ) /* $46 RORA inherent -**-* */ OP_HANDLER( rora ) { - UINT8 r; + uint8_t r; r=(CC&0x01)<<7; CLR_NZC; CC|=(A&0x01); r |= A>>1; SET_NZ8(r); @@ -510,7 +510,7 @@ OP_HANDLER( asra ) /* $48 ASLA inherent ?**** */ OP_HANDLER( asla ) { - UINT16 r; + uint16_t r; r=A<<1; CLR_NZVC; SET_FLAGS8(A,A,r); A=r; @@ -519,7 +519,7 @@ OP_HANDLER( asla ) /* $49 ROLA inherent -**** */ OP_HANDLER( rola ) { - UINT16 t,r; + uint16_t t,r; t = A; r = CC&0x01; r |= t<<1; CLR_NZVC; SET_FLAGS8(t,t,r); A=r; @@ -559,7 +559,7 @@ OP_HANDLER( clra ) /* $50 NEGB inherent ?**** */ OP_HANDLER( negb ) { - UINT16 r; + uint16_t r; r=-B; CLR_NZVC; SET_FLAGS8(0,B,r); B=r; @@ -588,7 +588,7 @@ OP_HANDLER( lsrb ) /* $56 RORB inherent -**-* */ OP_HANDLER( rorb ) { - UINT8 r; + uint8_t r; r=(CC&0x01)<<7; CLR_NZC; CC|=(B&0x01); r |= B>>1; SET_NZ8(r); @@ -606,7 +606,7 @@ OP_HANDLER( asrb ) /* $58 ASLB inherent ?**** */ OP_HANDLER( aslb ) { - UINT16 r; + uint16_t r; r=B<<1; CLR_NZVC; SET_FLAGS8(B,B,r); B=r; @@ -615,7 +615,7 @@ OP_HANDLER( aslb ) /* $59 ROLB inherent -**** */ OP_HANDLER( rolb ) { - UINT16 t,r; + uint16_t t,r; t = B; r = CC&0x01; r |= t<<1; CLR_NZVC; SET_FLAGS8(t,t,r); B=r; @@ -655,7 +655,7 @@ OP_HANDLER( clrb ) /* $60 NEG indexed ?**** */ OP_HANDLER( neg_ix ) { - UINT16 r,t; + uint16_t r,t; IDXBYTE(t); r=-t; CLR_NZVC; SET_FLAGS8(0,t,r); WM(EAD,r); @@ -664,7 +664,7 @@ OP_HANDLER( neg_ix ) /* $61 AIM --**0- */ /* HD63701YO only */ OP_HANDLER( aim_ix ) { - UINT8 t, r; + uint8_t t, r; IMMBYTE(t); IDXBYTE(r); r &= t; @@ -675,7 +675,7 @@ OP_HANDLER( aim_ix ) /* $62 OIM --**0- */ /* HD63701YO only */ OP_HANDLER( oim_ix ) { - UINT8 t, r; + uint8_t t, r; IMMBYTE(t); IDXBYTE(r); r |= t; @@ -686,7 +686,7 @@ OP_HANDLER( oim_ix ) /* $63 COM indexed -**01 */ OP_HANDLER( com_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); t = ~t; CLR_NZV; SET_NZ8(t); SEC; WM(EAD,t); @@ -695,7 +695,7 @@ OP_HANDLER( com_ix ) /* $64 LSR indexed -0*-* */ OP_HANDLER( lsr_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); CLR_NZC; CC|=(t&0x01); t>>=1; SET_Z8(t); WM(EAD,t); @@ -704,7 +704,7 @@ OP_HANDLER( lsr_ix ) /* $65 EIM --**0- */ /* HD63701YO only */ OP_HANDLER( eim_ix ) { - UINT8 t, r; + uint8_t t, r; IMMBYTE(t); IDXBYTE(r); r ^= t; @@ -715,7 +715,7 @@ OP_HANDLER( eim_ix ) /* $66 ROR indexed -**-* */ OP_HANDLER( ror_ix ) { - UINT8 t,r; + uint8_t t,r; IDXBYTE(t); r=(CC&0x01)<<7; CLR_NZC; CC|=(t&0x01); r |= t>>1; SET_NZ8(r); @@ -725,7 +725,7 @@ OP_HANDLER( ror_ix ) /* $67 ASR indexed ?**-* */ OP_HANDLER( asr_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); CLR_NZC; CC|=(t&0x01); t>>=1; t|=((t&0x40)<<1); SET_NZ8(t); @@ -735,7 +735,7 @@ OP_HANDLER( asr_ix ) /* $68 ASL indexed ?**** */ OP_HANDLER( asl_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r=t<<1; CLR_NZVC; SET_FLAGS8(t,t,r); WM(EAD,r); @@ -744,7 +744,7 @@ OP_HANDLER( asl_ix ) /* $69 ROL indexed -**** */ OP_HANDLER( rol_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = CC&0x01; r |= t<<1; CLR_NZVC; SET_FLAGS8(t,t,r); WM(EAD,r); @@ -753,7 +753,7 @@ OP_HANDLER( rol_ix ) /* $6a DEC indexed -***- */ OP_HANDLER( dec_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); --t; CLR_NZV; SET_FLAGS8D(t); WM(EAD,t); @@ -762,7 +762,7 @@ OP_HANDLER( dec_ix ) /* $6b TIM --**0- */ /* HD63701YO only */ OP_HANDLER( tim_ix ) { - UINT8 t, r; + uint8_t t, r; IMMBYTE(t); IDXBYTE(r); r &= t; @@ -772,7 +772,7 @@ OP_HANDLER( tim_ix ) /* $6c INC indexed -***- */ OP_HANDLER( inc_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); ++t; CLR_NZV; SET_FLAGS8I(t); WM(EAD,t); @@ -781,7 +781,7 @@ OP_HANDLER( inc_ix ) /* $6d TST indexed -**0- */ OP_HANDLER( tst_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); CLR_NZVC; SET_NZ8(t); } @@ -801,7 +801,7 @@ OP_HANDLER( clr_ix ) /* $70 NEG extended ?**** */ OP_HANDLER( neg_ex ) { - UINT16 r,t; + uint16_t r,t; EXTBYTE(t); r=-t; CLR_NZVC; SET_FLAGS8(0,t,r); WM(EAD,r); @@ -810,7 +810,7 @@ OP_HANDLER( neg_ex ) /* $71 AIM --**0- */ /* HD63701YO only */ OP_HANDLER( aim_di ) { - UINT8 t, r; + uint8_t t, r; IMMBYTE(t); DIRBYTE(r); r &= t; @@ -821,7 +821,7 @@ OP_HANDLER( aim_di ) /* $72 OIM --**0- */ /* HD63701YO only */ OP_HANDLER( oim_di ) { - UINT8 t, r; + uint8_t t, r; IMMBYTE(t); DIRBYTE(r); r |= t; @@ -832,7 +832,7 @@ OP_HANDLER( oim_di ) /* $73 COM extended -**01 */ OP_HANDLER( com_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); t = ~t; CLR_NZV; SET_NZ8(t); SEC; WM(EAD,t); @@ -841,7 +841,7 @@ OP_HANDLER( com_ex ) /* $74 LSR extended -0*-* */ OP_HANDLER( lsr_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); CLR_NZC; CC|=(t&0x01); @@ -853,7 +853,7 @@ OP_HANDLER( lsr_ex ) /* $75 EIM --**0- */ /* HD63701YO only */ OP_HANDLER( eim_di ) { - UINT8 t, r; + uint8_t t, r; IMMBYTE(t); DIRBYTE(r); r ^= t; @@ -864,7 +864,7 @@ OP_HANDLER( eim_di ) /* $76 ROR extended -**-* */ OP_HANDLER( ror_ex ) { - UINT8 t,r; + uint8_t t,r; EXTBYTE(t); r=(CC&0x01)<<7; CLR_NZC; CC|=(t&0x01); r |= t>>1; SET_NZ8(r); @@ -874,7 +874,7 @@ OP_HANDLER( ror_ex ) /* $77 ASR extended ?**-* */ OP_HANDLER( asr_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); CLR_NZC; CC|=(t&0x01); t>>=1; t|=((t&0x40)<<1); SET_NZ8(t); @@ -884,7 +884,7 @@ OP_HANDLER( asr_ex ) /* $78 ASL extended ?**** */ OP_HANDLER( asl_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r=t<<1; CLR_NZVC; SET_FLAGS8(t,t,r); WM(EAD,r); @@ -893,7 +893,7 @@ OP_HANDLER( asl_ex ) /* $79 ROL extended -**** */ OP_HANDLER( rol_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = CC&0x01; r |= t<<1; CLR_NZVC; SET_FLAGS8(t,t,r); WM(EAD,r); @@ -902,7 +902,7 @@ OP_HANDLER( rol_ex ) /* $7a DEC extended -***- */ OP_HANDLER( dec_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); --t; CLR_NZV; SET_FLAGS8D(t); WM(EAD,t); @@ -911,7 +911,7 @@ OP_HANDLER( dec_ex ) /* $7b TIM --**0- */ /* HD63701YO only */ OP_HANDLER( tim_di ) { - UINT8 t, r; + uint8_t t, r; IMMBYTE(t); DIRBYTE(r); r &= t; @@ -921,7 +921,7 @@ OP_HANDLER( tim_di ) /* $7c INC extended -***- */ OP_HANDLER( inc_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); ++t; CLR_NZV; SET_FLAGS8I(t); WM(EAD,t); @@ -930,7 +930,7 @@ OP_HANDLER( inc_ex ) /* $7d TST extended -**0- */ OP_HANDLER( tst_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); CLR_NZVC; SET_NZ8(t); } @@ -950,7 +950,7 @@ OP_HANDLER( clr_ex ) /* $80 SUBA immediate ?**** */ OP_HANDLER( suba_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A-t; CLR_NZVC; SET_FLAGS8(A,t,r); A = r; @@ -959,7 +959,7 @@ OP_HANDLER( suba_im ) /* $81 CMPA immediate ?**** */ OP_HANDLER( cmpa_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A-t; CLR_NZVC; SET_FLAGS8(A,t,r); } @@ -967,7 +967,7 @@ OP_HANDLER( cmpa_im ) /* $82 SBCA immediate ?**** */ OP_HANDLER( sbca_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A-t-(CC&0x01); CLR_NZVC; SET_FLAGS8(A,t,r); A = r; @@ -976,7 +976,7 @@ OP_HANDLER( sbca_im ) /* $83 SUBD immediate -**** */ OP_HANDLER( subd_im ) { - UINT32 r,d; + uint32_t r,d; PAIR b; IMMWORD(b); d = D; @@ -989,7 +989,7 @@ OP_HANDLER( subd_im ) /* $84 ANDA immediate -**0- */ OP_HANDLER( anda_im ) { - UINT8 t; + uint8_t t; IMMBYTE(t); A &= t; CLR_NZV; SET_NZ8(A); } @@ -997,7 +997,7 @@ OP_HANDLER( anda_im ) /* $85 BITA immediate -**0- */ OP_HANDLER( bita_im ) { - UINT8 t,r; + uint8_t t,r; IMMBYTE(t); r = A&t; CLR_NZV; SET_NZ8(r); } @@ -1020,7 +1020,7 @@ OP_HANDLER( sta_im ) /* $88 EORA immediate -**0- */ OP_HANDLER( eora_im ) { - UINT8 t; + uint8_t t; IMMBYTE(t); A ^= t; CLR_NZV; SET_NZ8(A); } @@ -1028,7 +1028,7 @@ OP_HANDLER( eora_im ) /* $89 ADCA immediate ***** */ OP_HANDLER( adca_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A+t+(CC&0x01); CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); A = r; @@ -1037,7 +1037,7 @@ OP_HANDLER( adca_im ) /* $8a ORA immediate -**0- */ OP_HANDLER( ora_im ) { - UINT8 t; + uint8_t t; IMMBYTE(t); A |= t; CLR_NZV; SET_NZ8(A); } @@ -1045,7 +1045,7 @@ OP_HANDLER( ora_im ) /* $8b ADDA immediate ***** */ OP_HANDLER( adda_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A+t; CLR_HNZVC; SET_FLAGS8(A,t,r); SET_H(A,t,r); A = r; @@ -1067,7 +1067,7 @@ OP_HANDLER( cmpx_im ) /* $8c CPX immediate -**** (6803) */ OP_HANDLER( cpx_im ) { - UINT32 r,d; + uint32_t r,d; PAIR b; IMMWORD(b); d = X; @@ -1079,7 +1079,7 @@ OP_HANDLER( cpx_im ) /* $8d BSR ----- */ OP_HANDLER( bsr ) { - UINT8 t; + uint8_t t; IMMBYTE(t); PUSHWORD(pPC); PC += SIGNED(t); @@ -1105,7 +1105,7 @@ OP_HANDLER( sts_im ) /* $90 SUBA direct ?**** */ OP_HANDLER( suba_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A-t; CLR_NZVC; SET_FLAGS8(A,t,r); A = r; @@ -1114,7 +1114,7 @@ OP_HANDLER( suba_di ) /* $91 CMPA direct ?**** */ OP_HANDLER( cmpa_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A-t; CLR_NZVC; SET_FLAGS8(A,t,r); } @@ -1122,7 +1122,7 @@ OP_HANDLER( cmpa_di ) /* $92 SBCA direct ?**** */ OP_HANDLER( sbca_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A-t-(CC&0x01); CLR_NZVC; SET_FLAGS8(A,t,r); A = r; @@ -1131,7 +1131,7 @@ OP_HANDLER( sbca_di ) /* $93 SUBD direct -**** */ OP_HANDLER( subd_di ) { - UINT32 r,d; + uint32_t r,d; PAIR b; DIRWORD(b); d = D; @@ -1144,7 +1144,7 @@ OP_HANDLER( subd_di ) /* $94 ANDA direct -**0- */ OP_HANDLER( anda_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); A &= t; CLR_NZV; SET_NZ8(A); } @@ -1152,7 +1152,7 @@ OP_HANDLER( anda_di ) /* $95 BITA direct -**0- */ OP_HANDLER( bita_di ) { - UINT8 t,r; + uint8_t t,r; DIRBYTE(t); r = A&t; CLR_NZV; SET_NZ8(r); } @@ -1177,7 +1177,7 @@ OP_HANDLER( sta_di ) /* $98 EORA direct -**0- */ OP_HANDLER( eora_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); A ^= t; CLR_NZV; @@ -1187,7 +1187,7 @@ OP_HANDLER( eora_di ) /* $99 ADCA direct ***** */ OP_HANDLER( adca_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A+t+(CC&0x01); CLR_HNZVC; @@ -1199,7 +1199,7 @@ OP_HANDLER( adca_di ) /* $9a ORA direct -**0- */ OP_HANDLER( ora_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); A |= t; CLR_NZV; @@ -1209,7 +1209,7 @@ OP_HANDLER( ora_di ) /* $9b ADDA direct ***** */ OP_HANDLER( adda_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A + t; CLR_HNZVC; @@ -1234,7 +1234,7 @@ OP_HANDLER( cmpx_di ) /* $9c CPX direct -**** (6803) */ OP_HANDLER( cpx_di ) { - UINT32 r,d; + uint32_t r,d; PAIR b; DIRWORD(b); d = X; @@ -1271,7 +1271,7 @@ OP_HANDLER( sts_di ) /* $a0 SUBA indexed ?**** */ OP_HANDLER( suba_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A - t; CLR_NZVC; @@ -1282,7 +1282,7 @@ OP_HANDLER( suba_ix ) /* $a1 CMPA indexed ?**** */ OP_HANDLER( cmpa_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A - t; CLR_NZVC; @@ -1292,7 +1292,7 @@ OP_HANDLER( cmpa_ix ) /* $a2 SBCA indexed ?**** */ OP_HANDLER( sbca_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A - t - (CC&0x01); CLR_NZVC; @@ -1303,7 +1303,7 @@ OP_HANDLER( sbca_ix ) /* $a3 SUBD indexed -**** */ OP_HANDLER( subd_ix ) { - UINT32 r,d; + uint32_t r,d; PAIR b; IDXWORD(b); d = D; @@ -1316,7 +1316,7 @@ OP_HANDLER( subd_ix ) /* $a4 ANDA indexed -**0- */ OP_HANDLER( anda_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); A &= t; CLR_NZV; SET_NZ8(A); @@ -1325,7 +1325,7 @@ OP_HANDLER( anda_ix ) /* $a5 BITA indexed -**0- */ OP_HANDLER( bita_ix ) { - UINT8 t,r; + uint8_t t,r; IDXBYTE(t); r = A&t; CLR_NZV; SET_NZ8(r); @@ -1351,7 +1351,7 @@ OP_HANDLER( sta_ix ) /* $a8 EORA indexed -**0- */ OP_HANDLER( eora_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); A ^= t; CLR_NZV; @@ -1361,7 +1361,7 @@ OP_HANDLER( eora_ix ) /* $a9 ADCA indexed ***** */ OP_HANDLER( adca_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A + t + (CC&0x01); CLR_HNZVC; @@ -1373,7 +1373,7 @@ OP_HANDLER( adca_ix ) /* $aa ORA indexed -**0- */ OP_HANDLER( ora_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); A |= t; CLR_NZV; @@ -1383,7 +1383,7 @@ OP_HANDLER( ora_ix ) /* $ab ADDA indexed ***** */ OP_HANDLER( adda_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A+t; CLR_HNZVC; @@ -1408,7 +1408,7 @@ OP_HANDLER( cmpx_ix ) /* $ac CPX indexed -**** (6803)*/ OP_HANDLER( cpx_ix ) { - UINT32 r,d; + uint32_t r,d; PAIR b; IDXWORD(b); d = X; @@ -1445,7 +1445,7 @@ OP_HANDLER( sts_ix ) /* $b0 SUBA extended ?**** */ OP_HANDLER( suba_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A - t; CLR_NZVC; @@ -1456,7 +1456,7 @@ OP_HANDLER( suba_ex ) /* $b1 CMPA extended ?**** */ OP_HANDLER( cmpa_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A-t; CLR_NZVC; @@ -1466,7 +1466,7 @@ OP_HANDLER( cmpa_ex ) /* $b2 SBCA extended ?**** */ OP_HANDLER( sbca_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A-t-(CC&0x01); CLR_NZVC; @@ -1477,7 +1477,7 @@ OP_HANDLER( sbca_ex ) /* $b3 SUBD extended -**** */ OP_HANDLER( subd_ex ) { - UINT32 r,d; + uint32_t r,d; PAIR b; EXTWORD(b); d = D; @@ -1490,7 +1490,7 @@ OP_HANDLER( subd_ex ) /* $b4 ANDA extended -**0- */ OP_HANDLER( anda_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); A &= t; CLR_NZV; @@ -1500,7 +1500,7 @@ OP_HANDLER( anda_ex ) /* $b5 BITA extended -**0- */ OP_HANDLER( bita_ex ) { - UINT8 t,r; + uint8_t t,r; EXTBYTE(t); r = A&t; CLR_NZV; @@ -1527,7 +1527,7 @@ OP_HANDLER( sta_ex ) /* $b8 EORA extended -**0- */ OP_HANDLER( eora_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); A ^= t; CLR_NZV; @@ -1537,7 +1537,7 @@ OP_HANDLER( eora_ex ) /* $b9 ADCA extended ***** */ OP_HANDLER( adca_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A+t+(CC&0x01); CLR_HNZVC; @@ -1549,7 +1549,7 @@ OP_HANDLER( adca_ex ) /* $ba ORA extended -**0- */ OP_HANDLER( ora_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); A |= t; CLR_NZV; @@ -1559,7 +1559,7 @@ OP_HANDLER( ora_ex ) /* $bb ADDA extended ***** */ OP_HANDLER( adda_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A+t; CLR_HNZVC; @@ -1584,7 +1584,7 @@ OP_HANDLER( cmpx_ex ) /* $bc CPX extended -**** (6803) */ OP_HANDLER( cpx_ex ) { - UINT32 r,d; + uint32_t r,d; PAIR b; EXTWORD(b); d = X; @@ -1621,7 +1621,7 @@ OP_HANDLER( sts_ex ) /* $c0 SUBB immediate ?**** */ OP_HANDLER( subb_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = B-t; CLR_NZVC; @@ -1632,7 +1632,7 @@ OP_HANDLER( subb_im ) /* $c1 CMPB immediate ?**** */ OP_HANDLER( cmpb_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = B-t; CLR_NZVC; @@ -1642,7 +1642,7 @@ OP_HANDLER( cmpb_im ) /* $c2 SBCB immediate ?**** */ OP_HANDLER( sbcb_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = B-t-(CC&0x01); CLR_NZVC; @@ -1653,7 +1653,7 @@ OP_HANDLER( sbcb_im ) /* $c3 ADDD immediate -**** */ OP_HANDLER( addd_im ) { - UINT32 r,d; + uint32_t r,d; PAIR b; IMMWORD(b); d = D; @@ -1666,7 +1666,7 @@ OP_HANDLER( addd_im ) /* $c4 ANDB immediate -**0- */ OP_HANDLER( andb_im ) { - UINT8 t; + uint8_t t; IMMBYTE(t); B &= t; CLR_NZV; @@ -1676,7 +1676,7 @@ OP_HANDLER( andb_im ) /* $c5 BITB immediate -**0- */ OP_HANDLER( bitb_im ) { - UINT8 t,r; + uint8_t t,r; IMMBYTE(t); r = B&t; CLR_NZV; @@ -1704,7 +1704,7 @@ OP_HANDLER( stb_im ) /* $c8 EORB immediate -**0- */ OP_HANDLER( eorb_im ) { - UINT8 t; + uint8_t t; IMMBYTE(t); B ^= t; CLR_NZV; @@ -1714,7 +1714,7 @@ OP_HANDLER( eorb_im ) /* $c9 ADCB immediate ***** */ OP_HANDLER( adcb_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = B+t+(CC&0x01); CLR_HNZVC; @@ -1726,7 +1726,7 @@ OP_HANDLER( adcb_im ) /* $ca ORB immediate -**0- */ OP_HANDLER( orb_im ) { - UINT8 t; + uint8_t t; IMMBYTE(t); B |= t; CLR_NZV; @@ -1736,7 +1736,7 @@ OP_HANDLER( orb_im ) /* $cb ADDB immediate ***** */ OP_HANDLER( addb_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = B+t; CLR_HNZVC; @@ -1783,7 +1783,7 @@ OP_HANDLER( stx_im ) /* $d0 SUBB direct ?**** */ OP_HANDLER( subb_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = B-t; CLR_NZVC; @@ -1794,7 +1794,7 @@ OP_HANDLER( subb_di ) /* $d1 CMPB direct ?**** */ OP_HANDLER( cmpb_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = B-t; CLR_NZVC; @@ -1804,7 +1804,7 @@ OP_HANDLER( cmpb_di ) /* $d2 SBCB direct ?**** */ OP_HANDLER( sbcb_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = B-t-(CC&0x01); CLR_NZVC; @@ -1815,7 +1815,7 @@ OP_HANDLER( sbcb_di ) /* $d3 ADDD direct -**** */ OP_HANDLER( addd_di ) { - UINT32 r,d; + uint32_t r,d; PAIR b; DIRWORD(b); d = D; @@ -1828,7 +1828,7 @@ OP_HANDLER( addd_di ) /* $d4 ANDB direct -**0- */ OP_HANDLER( andb_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); B &= t; CLR_NZV; @@ -1838,7 +1838,7 @@ OP_HANDLER( andb_di ) /* $d5 BITB direct -**0- */ OP_HANDLER( bitb_di ) { - UINT8 t,r; + uint8_t t,r; DIRBYTE(t); r = B&t; CLR_NZV; @@ -1865,7 +1865,7 @@ OP_HANDLER( stb_di ) /* $d8 EORB direct -**0- */ OP_HANDLER( eorb_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); B ^= t; CLR_NZV; @@ -1875,7 +1875,7 @@ OP_HANDLER( eorb_di ) /* $d9 ADCB direct ***** */ OP_HANDLER( adcb_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = B+t+(CC&0x01); CLR_HNZVC; @@ -1887,7 +1887,7 @@ OP_HANDLER( adcb_di ) /* $da ORB direct -**0- */ OP_HANDLER( orb_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); B |= t; CLR_NZV; @@ -1897,7 +1897,7 @@ OP_HANDLER( orb_di ) /* $db ADDB direct ***** */ OP_HANDLER( addb_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = B+t; CLR_HNZVC; @@ -1943,7 +1943,7 @@ OP_HANDLER( stx_di ) /* $e0 SUBB indexed ?**** */ OP_HANDLER( subb_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = B-t; CLR_NZVC; @@ -1954,7 +1954,7 @@ OP_HANDLER( subb_ix ) /* $e1 CMPB indexed ?**** */ OP_HANDLER( cmpb_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = B-t; CLR_NZVC; @@ -1964,7 +1964,7 @@ OP_HANDLER( cmpb_ix ) /* $e2 SBCB indexed ?**** */ OP_HANDLER( sbcb_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = B-t-(CC&0x01); CLR_NZVC; @@ -1975,7 +1975,7 @@ OP_HANDLER( sbcb_ix ) /* $e3 ADDD indexed -**** */ OP_HANDLER( addd_ix ) { - UINT32 r,d; + uint32_t r,d; PAIR b; IDXWORD(b); d = D; @@ -1988,7 +1988,7 @@ OP_HANDLER( addd_ix ) /* $e4 ANDB indexed -**0- */ OP_HANDLER( andb_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); B &= t; CLR_NZV; @@ -1998,7 +1998,7 @@ OP_HANDLER( andb_ix ) /* $e5 BITB indexed -**0- */ OP_HANDLER( bitb_ix ) { - UINT8 t,r; + uint8_t t,r; IDXBYTE(t); r = B&t; CLR_NZV; @@ -2025,7 +2025,7 @@ OP_HANDLER( stb_ix ) /* $e8 EORB indexed -**0- */ OP_HANDLER( eorb_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); B ^= t; CLR_NZV; @@ -2035,7 +2035,7 @@ OP_HANDLER( eorb_ix ) /* $e9 ADCB indexed ***** */ OP_HANDLER( adcb_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = B+t+(CC&0x01); CLR_HNZVC; @@ -2047,7 +2047,7 @@ OP_HANDLER( adcb_ix ) /* $ea ORB indexed -**0- */ OP_HANDLER( orb_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); B |= t; CLR_NZV; @@ -2057,7 +2057,7 @@ OP_HANDLER( orb_ix ) /* $eb ADDB indexed ***** */ OP_HANDLER( addb_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = B+t; CLR_HNZVC; @@ -2078,7 +2078,7 @@ OP_HANDLER( ldd_ix ) // actually this is ADDX, causes garbage in nightgal.cpp otherwise OP_HANDLER( adcx_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = X+t; CLR_HNZVC; @@ -2116,7 +2116,7 @@ OP_HANDLER( stx_ix ) /* $f0 SUBB extended ?**** */ OP_HANDLER( subb_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = B-t; CLR_NZVC; @@ -2127,7 +2127,7 @@ OP_HANDLER( subb_ex ) /* $f1 CMPB extended ?**** */ OP_HANDLER( cmpb_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = B-t; CLR_NZVC; @@ -2137,7 +2137,7 @@ OP_HANDLER( cmpb_ex ) /* $f2 SBCB extended ?**** */ OP_HANDLER( sbcb_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = B-t-(CC&0x01); CLR_NZVC; @@ -2148,7 +2148,7 @@ OP_HANDLER( sbcb_ex ) /* $f3 ADDD extended -**** */ OP_HANDLER( addd_ex ) { - UINT32 r,d; + uint32_t r,d; PAIR b; EXTWORD(b); d = D; @@ -2161,7 +2161,7 @@ OP_HANDLER( addd_ex ) /* $f4 ANDB extended -**0- */ OP_HANDLER( andb_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); B &= t; CLR_NZV; @@ -2171,7 +2171,7 @@ OP_HANDLER( andb_ex ) /* $f5 BITB extended -**0- */ OP_HANDLER( bitb_ex ) { - UINT8 t,r; + uint8_t t,r; EXTBYTE(t); r = B & t; CLR_NZV; @@ -2198,7 +2198,7 @@ OP_HANDLER( stb_ex ) /* $f8 EORB extended -**0- */ OP_HANDLER( eorb_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); B ^= t; CLR_NZV; @@ -2208,7 +2208,7 @@ OP_HANDLER( eorb_ex ) /* $f9 ADCB extended ***** */ OP_HANDLER( adcb_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = B+t+(CC&0x01); CLR_HNZVC; @@ -2220,7 +2220,7 @@ OP_HANDLER( adcb_ex ) /* $fa ORB extended -**0- */ OP_HANDLER( orb_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); B |= t; CLR_NZV; @@ -2230,7 +2230,7 @@ OP_HANDLER( orb_ex ) /* $fb ADDB extended ***** */ OP_HANDLER( addb_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = B+t; CLR_HNZVC; @@ -2250,7 +2250,7 @@ OP_HANDLER( ldd_ex ) /* $fc ADDX extended -**** NSC8105 only. Flags are a guess */ OP_HANDLER( addx_ex ) { - UINT32 r,d; + uint32_t r,d; PAIR b; EXTWORD(b); d = X; @@ -2290,8 +2290,8 @@ OP_HANDLER( stx_ex ) // $bb - $mask & [X + $disp8] OP_HANDLER( btst_ix ) { - UINT8 val; - UINT8 mask = M_RDOP_ARG(PCD); + uint8_t val; + uint8_t mask = M_RDOP_ARG(PCD); {EA=X+(M_RDOP_ARG(PCD+1));PC+=2;} val = RM(EAD) & mask; CLR_NZVC; SET_NZ8(val); @@ -2301,7 +2301,7 @@ OP_HANDLER( btst_ix ) OP_HANDLER( stx_nsc ) { IMM8; - UINT8 val = RM(EAD); + uint8_t val = RM(EAD); IMM8; EA = X + RM(EAD); CLR_NZV; diff --git a/src/devices/cpu/m6800/m6800.cpp b/src/devices/cpu/m6800/m6800.cpp index c874a6c177a..11109fbe59a 100644 --- a/src/devices/cpu/m6800/m6800.cpp +++ b/src/devices/cpu/m6800/m6800.cpp @@ -14,9 +14,9 @@ 6809 Microcomputer Programming & Interfacing with Experiments" by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits + System dependencies: uint16_t must be 16 bit unsigned int + uint8_t must be 8 bit unsigned int + uint32_t must be more than 16 bits arrays up to 65536 bytes must be supported machine must be twos complement @@ -141,7 +141,7 @@ static void hd63701_trap_pc(); #define EA m_ea.w.l /* point of next timer event */ -static UINT32 timer_next; +static uint32_t timer_next; /* memory interface */ @@ -284,7 +284,7 @@ enum /* operate one instruction for */ #define ONE_MORE_INSN() { \ - UINT8 ireg; \ + uint8_t ireg; \ pPPC = pPC; \ debugger_instruction_hook(this, PCD); \ ireg=M_RDOP(PCD); \ @@ -306,8 +306,8 @@ enum /* macros for CC -- CC bits affected should be reset before calling */ #define SET_Z(a) if(!(a))SEZ -#define SET_Z8(a) SET_Z((UINT8)(a)) -#define SET_Z16(a) SET_Z((UINT16)(a)) +#define SET_Z8(a) SET_Z((uint8_t)(a)) +#define SET_Z16(a) SET_Z((uint16_t)(a)) #define SET_N8(a) CC|=(((a)&0x80)>>4) #define SET_N16(a) CC|=(((a)&0x8000)>>12) #define SET_H(a,b,r) CC|=((((a)^(b)^(r))&0x10)<<1) @@ -316,7 +316,7 @@ enum #define SET_V8(a,b,r) CC|=((((a)^(b)^(r)^((r)>>1))&0x80)>>6) #define SET_V16(a,b,r) CC|=((((a)^(b)^(r)^((r)>>1))&0x8000)>>14) -const UINT8 m6800_cpu_device::flags8i[256]= /* increment */ +const uint8_t m6800_cpu_device::flags8i[256]= /* increment */ { 0x04,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, @@ -337,7 +337,7 @@ const UINT8 m6800_cpu_device::flags8i[256]= /* increment */ }; -const UINT8 m6800_cpu_device::flags8d[256]= /* decrement */ +const uint8_t m6800_cpu_device::flags8d[256]= /* decrement */ { 0x04,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, @@ -366,15 +366,15 @@ const UINT8 m6800_cpu_device::flags8d[256]= /* decrement */ #define SET_FLAGS8(a,b,r) {SET_N8(r);SET_Z8(r);SET_V8(a,b,r);SET_C8(r);} #define SET_FLAGS16(a,b,r) {SET_N16(r);SET_Z16(r);SET_V16(a,b,r);SET_C16(r);} -/* for treating an UINT8 as a signed INT16 */ -#define SIGNED(b) ((INT16)(b&0x80?b|0xff00:b)) +/* for treating an uint8_t as a signed int16_t */ +#define SIGNED(b) ((int16_t)(b&0x80?b|0xff00:b)) /* Macros for addressing modes */ #define DIRECT IMMBYTE(EAD) #define IMM8 EA=PC++ #define IMM16 {EA=PC;PC+=2;} #define EXTENDED IMMWORD(m_ea) -#define INDEXED {EA=X+(UINT8)M_RDOP_ARG(PCD);PC++;} +#define INDEXED {EA=X+(uint8_t)M_RDOP_ARG(PCD);PC++;} /* macros to set status flags */ #if defined(SEC) @@ -422,7 +422,7 @@ const UINT8 m6800_cpu_device::flags8d[256]= /* decrement */ /* Note: don't use 0 cycles here for invalid opcodes so that we don't */ /* hang in an infinite loop if we hit one */ #define XX 5 // invalid opcode unknown cc -const UINT8 m6800_cpu_device::cycles_6800[256] = +const uint8_t m6800_cpu_device::cycles_6800[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /*0*/ XX, 2,XX,XX,XX,XX, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, @@ -443,7 +443,7 @@ const UINT8 m6800_cpu_device::cycles_6800[256] = /*F*/ 4, 4, 4,XX, 4, 4, 4, 5, 4, 4, 4, 4,XX,XX, 5, 6 }; -const UINT8 m6800_cpu_device::cycles_6803[256] = +const uint8_t m6800_cpu_device::cycles_6803[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /*0*/ XX, 2,XX,XX, 3, 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, @@ -464,7 +464,7 @@ const UINT8 m6800_cpu_device::cycles_6803[256] = /*F*/ 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 }; -const UINT8 m6800_cpu_device::cycles_63701[256] = +const uint8_t m6800_cpu_device::cycles_63701[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /*0*/ XX, 1,XX,XX, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -485,7 +485,7 @@ const UINT8 m6800_cpu_device::cycles_63701[256] = /*F*/ 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 }; -const UINT8 m6800_cpu_device::cycles_nsc8105[256] = +const uint8_t m6800_cpu_device::cycles_nsc8105[256] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /*0*/ 5,XX, 2,XX,XX, 2,XX, 2, 4, 2, 4, 2, 2, 2, 2, 2, @@ -532,7 +532,7 @@ const device_type HD6303R = &device_creator; const device_type HD6303Y = &device_creator; -m6800_cpu_device::m6800_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m6800_cpu_device::m6800_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, M6800, "M6800", tag, owner, clock, "m6800", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0) , m_decrypted_opcodes_config("program", ENDIANNESS_BIG, 8, 16, 0) @@ -546,7 +546,7 @@ m6800_cpu_device::m6800_cpu_device(const machine_config &mconfig, const char *ta m_clock_divider = 1; } -m6800_cpu_device::m6800_cpu_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, bool has_io, int clock_divider, const op_func *insn, const UINT8 *cycles, address_map_constructor internal) +m6800_cpu_device::m6800_cpu_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, bool has_io, int clock_divider, const op_func *insn, const uint8_t *cycles, address_map_constructor internal) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, internal) , m_decrypted_opcodes_config("program", ENDIANNESS_BIG, 8, 16, 0) @@ -560,22 +560,22 @@ m6800_cpu_device::m6800_cpu_device(const machine_config &mconfig, device_type ty m_clock_divider = clock_divider; } -m6801_cpu_device::m6801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m6801_cpu_device::m6801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6800_cpu_device(mconfig, M6801, "M6801", tag, owner, clock, "m6801", __FILE__, true, 4, m6803_insn, cycles_6803) { } -m6801_cpu_device::m6801_cpu_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, const op_func *insn, const UINT8 *cycles, address_map_constructor internal) +m6801_cpu_device::m6801_cpu_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, const op_func *insn, const uint8_t *cycles, address_map_constructor internal) : m6800_cpu_device(mconfig, type, name, tag, owner, clock, shortname, source, true, 4, insn, cycles, internal) { } -m6802_cpu_device::m6802_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m6802_cpu_device::m6802_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6800_cpu_device(mconfig, M6802, "M6802", tag, owner, clock, "m6802", __FILE__, false, 4, m6800_insn, cycles_6800) { } -m6802_cpu_device::m6802_cpu_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, const op_func *insn, const UINT8 *cycles) +m6802_cpu_device::m6802_cpu_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, const op_func *insn, const uint8_t *cycles) : m6800_cpu_device(mconfig, type, name, tag, owner, clock, shortname, source, false, 4, insn, cycles) { } @@ -587,42 +587,42 @@ static ADDRESS_MAP_START(m6803_mem, AS_PROGRAM, 8, m6800_cpu_device) ADDRESS_MAP_END -m6803_cpu_device::m6803_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m6803_cpu_device::m6803_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6801_cpu_device(mconfig, M6803, "M6803", tag, owner, clock, "m6803", __FILE__, m6803_insn, cycles_6803, ADDRESS_MAP_NAME(m6803_mem)) { } -m6808_cpu_device::m6808_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m6808_cpu_device::m6808_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6802_cpu_device(mconfig, M6808, "M6808", tag, owner, clock, "m6808", __FILE__, m6800_insn, cycles_6800) { } -hd6301_cpu_device::hd6301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd6301_cpu_device::hd6301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6801_cpu_device(mconfig, HD6301, "HD6301", tag, owner, clock, "hd6301", __FILE__, hd63701_insn, cycles_63701) { } -hd6301_cpu_device::hd6301_cpu_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) +hd6301_cpu_device::hd6301_cpu_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) : m6801_cpu_device(mconfig, type, name, tag, owner, clock, shortname, source, hd63701_insn, cycles_63701) { } -hd63701_cpu_device::hd63701_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd63701_cpu_device::hd63701_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6801_cpu_device(mconfig, HD63701, "HD63701", tag, owner, clock, "hd63701", __FILE__, hd63701_insn, cycles_63701) { } -nsc8105_cpu_device::nsc8105_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nsc8105_cpu_device::nsc8105_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6802_cpu_device(mconfig, NSC8105, "NSC8105", tag, owner, clock, "nsc8105", __FILE__, nsc8105_insn, cycles_nsc8105) { } -hd6303r_cpu_device::hd6303r_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd6303r_cpu_device::hd6303r_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hd6301_cpu_device(mconfig, HD6303R, "HD6303R", tag, owner, clock, "hd6303r", __FILE__) { } -hd6303y_cpu_device::hd6303y_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd6303y_cpu_device::hd6303y_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hd6301_cpu_device(mconfig, HD6303Y, "HD6303Y", tag, owner, clock, "hd6303y", __FILE__) { } @@ -639,20 +639,20 @@ const address_space_config *m6800_cpu_device::memory_space_config(address_spacen } -UINT32 m6800_cpu_device::RM16(UINT32 Addr ) +uint32_t m6800_cpu_device::RM16(uint32_t Addr ) { - UINT32 result = RM(Addr) << 8; + uint32_t result = RM(Addr) << 8; return result | RM((Addr+1)&0xffff); } -void m6800_cpu_device::WM16(UINT32 Addr, PAIR *p ) +void m6800_cpu_device::WM16(uint32_t Addr, PAIR *p ) { WM( Addr, p->b.h ); WM( (Addr+1)&0xffff, p->b.l ); } /* IRQ enter */ -void m6800_cpu_device::enter_interrupt(const char *message,UINT16 irq_vector) +void m6800_cpu_device::enter_interrupt(const char *message,uint16_t irq_vector) { LOG((message, tag())); if( m_wai_state & (M6800_WAI|M6800_SLP) ) @@ -784,7 +784,7 @@ void m6800_cpu_device::increment_counter(int amount) check_timer_event(); } -void m6800_cpu_device::set_rmcr(UINT8 data) +void m6800_cpu_device::set_rmcr(uint8_t data) { if (m_rmcr == data) return; @@ -819,8 +819,8 @@ void m6800_cpu_device::write_port2() { if (!m_port2_written) return; - UINT8 data = m_port2_data; - UINT8 ddr = m_port2_ddr & 0x1f; + uint8_t data = m_port2_data; + uint8_t ddr = m_port2_ddr & 0x1f; if ((ddr != 0x1f) && ddr) { @@ -1256,7 +1256,7 @@ void m6800_cpu_device::execute_set_input(int irqline, int state) ****************************************************************************/ void m6800_cpu_device::execute_run() { - UINT8 ireg; + uint8_t ireg; CHECK_IRQ_LINES(); /* HJB 990417 */ @@ -1304,7 +1304,7 @@ void m6800_cpu_device::set_os3(int state) READ8_MEMBER( m6800_cpu_device::m6801_io_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -1752,56 +1752,56 @@ void m6801_cpu_device::m6801_clock_serial() } } -offs_t m6800_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6800_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( m6800 ); return CPU_DISASSEMBLE_NAME(m6800)(this, buffer, pc, oprom, opram, options); } -offs_t m6801_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6801_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( m6801 ); return CPU_DISASSEMBLE_NAME(m6801)(this, buffer, pc, oprom, opram, options); } -offs_t m6802_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6802_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( m6802 ); return CPU_DISASSEMBLE_NAME(m6802)(this, buffer, pc, oprom, opram, options); } -offs_t m6803_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6803_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( m6803 ); return CPU_DISASSEMBLE_NAME(m6803)(this, buffer, pc, oprom, opram, options); } -offs_t m6808_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6808_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( m6808 ); return CPU_DISASSEMBLE_NAME(m6808)(this, buffer, pc, oprom, opram, options); } -offs_t hd6301_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hd6301_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( hd6301 ); return CPU_DISASSEMBLE_NAME(hd6301)(this, buffer, pc, oprom, opram, options); } -offs_t hd63701_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hd63701_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( hd63701 ); return CPU_DISASSEMBLE_NAME(hd63701)(this, buffer, pc, oprom, opram, options); } -offs_t nsc8105_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t nsc8105_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( nsc8105 ); return CPU_DISASSEMBLE_NAME(nsc8105)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/m6800/m6800.h b/src/devices/cpu/m6800/m6800.h index 0ad47280bf3..c51a2741c7a 100644 --- a/src/devices/cpu/m6800/m6800.h +++ b/src/devices/cpu/m6800/m6800.h @@ -77,8 +77,8 @@ public: typedef void (m6800_cpu_device::*op_func)(); // construction/destruction - m6800_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m6800_cpu_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, bool has_io, int clock_divider, const m6800_cpu_device::op_func *insn, const UINT8 *cycles, address_map_constructor internal = nullptr); + m6800_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m6800_cpu_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, bool has_io, int clock_divider, const m6800_cpu_device::op_func *insn, const uint8_t *cycles, address_map_constructor internal = nullptr); // static configuration helpers template static devcb_base &set_out_sc2_func(device_t &device, _Object object) { return downcast(device).m_out_sc2_func.set_callback(object); } @@ -93,10 +93,10 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 12; } - virtual UINT32 execute_input_lines() const override { return 2; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 12; } + virtual uint32_t execute_input_lines() const override { return 2; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -107,9 +107,9 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; address_space_config m_decrypted_opcodes_config; @@ -124,12 +124,12 @@ protected: PAIR m_s; /* Stack pointer */ PAIR m_x; /* Index register */ PAIR m_d; /* Accumulators */ - UINT8 m_cc; /* Condition codes */ - UINT8 m_wai_state; /* WAI opcode state ,(or sleep opcode state) */ - UINT8 m_nmi_state; /* NMI line state */ - UINT8 m_nmi_pending; /* NMI pending */ - UINT8 m_irq_state[3]; /* IRQ line state [IRQ1,TIN,SC1] */ - UINT8 m_ic_eddge; /* InputCapture eddge , b.0=fall,b.1=raise */ + uint8_t m_cc; /* Condition codes */ + uint8_t m_wai_state; /* WAI opcode state ,(or sleep opcode state) */ + uint8_t m_nmi_state; /* NMI line state */ + uint8_t m_nmi_pending; /* NMI pending */ + uint8_t m_irq_state[3]; /* IRQ line state [IRQ1,TIN,SC1] */ + uint8_t m_ic_eddge; /* InputCapture eddge , b.0=fall,b.1=raise */ int m_sc1_state; /* Memory spaces */ @@ -138,29 +138,29 @@ protected: address_space *m_io; const op_func *m_insn; - const UINT8 *m_cycles; /* clock cycle of instruction table */ + const uint8_t *m_cycles; /* clock cycle of instruction table */ /* internal registers */ - UINT8 m_port1_ddr; - UINT8 m_port2_ddr; - UINT8 m_port3_ddr; - UINT8 m_port4_ddr; - UINT8 m_port1_data; - UINT8 m_port2_data; - UINT8 m_port3_data; - UINT8 m_port4_data; - UINT8 m_p3csr; // Port 3 Control/Status Register - UINT8 m_tcsr; /* Timer Control and Status Register */ - UINT8 m_pending_tcsr; /* pending IRQ flag for clear IRQflag process */ - UINT8 m_irq2; /* IRQ2 flags */ - UINT8 m_ram_ctrl; + uint8_t m_port1_ddr; + uint8_t m_port2_ddr; + uint8_t m_port3_ddr; + uint8_t m_port4_ddr; + uint8_t m_port1_data; + uint8_t m_port2_data; + uint8_t m_port3_data; + uint8_t m_port4_data; + uint8_t m_p3csr; // Port 3 Control/Status Register + uint8_t m_tcsr; /* Timer Control and Status Register */ + uint8_t m_pending_tcsr; /* pending IRQ flag for clear IRQflag process */ + uint8_t m_irq2; /* IRQ2 flags */ + uint8_t m_ram_ctrl; PAIR m_counter; /* free running counter */ PAIR m_output_compare; /* output compare */ - UINT16 m_input_capture; /* input capture */ + uint16_t m_input_capture; /* input capture */ int m_p3csr_is3_flag_read; int m_port3_latched; int m_clock_divider; - UINT8 m_trcsr, m_rmcr, m_rdr, m_tdr, m_rsr, m_tsr; + uint8_t m_trcsr, m_rmcr, m_rdr, m_tdr, m_rsr, m_tsr; int m_rxbits, m_txbits, m_txstate, m_trcsr_read_tdre, m_trcsr_read_orfe, m_trcsr_read_rdrf, m_tx, m_ext_serclock; bool m_use_ext_serclock; int m_port2_written; @@ -172,25 +172,25 @@ protected: emu_timer *m_sci_timer; PAIR m_ea; /* effective address */ - static const UINT8 flags8i[256]; - static const UINT8 flags8d[256]; - static const UINT8 cycles_6800[256]; - static const UINT8 cycles_6803[256]; - static const UINT8 cycles_63701[256]; - static const UINT8 cycles_nsc8105[256]; + static const uint8_t flags8i[256]; + static const uint8_t flags8d[256]; + static const uint8_t cycles_6800[256]; + static const uint8_t cycles_6803[256]; + static const uint8_t cycles_63701[256]; + static const uint8_t cycles_nsc8105[256]; static const op_func m6800_insn[256]; static const op_func m6803_insn[256]; static const op_func hd63701_insn[256]; static const op_func nsc8105_insn[256]; - UINT32 RM16(UINT32 Addr ); - void WM16(UINT32 Addr, PAIR *p ); - void enter_interrupt(const char *message,UINT16 irq_vector); + uint32_t RM16(uint32_t Addr ); + void WM16(uint32_t Addr, PAIR *p ); + void enter_interrupt(const char *message,uint16_t irq_vector); void m6800_check_irq2(); void CHECK_IRQ_LINES(); void check_timer_event(); void increment_counter(int amount); - void set_rmcr(UINT8 data); + void set_rmcr(uint8_t data); void write_port2(); int m6800_rx(); void serial_transmit(); @@ -451,79 +451,79 @@ protected: class m6801_cpu_device : public m6800_cpu_device { public: - m6801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m6801_cpu_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, const m6800_cpu_device::op_func *insn, const UINT8 *cycles, address_map_constructor internal = nullptr); + m6801_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m6801_cpu_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, const m6800_cpu_device::op_func *insn, const uint8_t *cycles, address_map_constructor internal = nullptr); void m6801_clock_serial(); protected: - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; class m6802_cpu_device : public m6800_cpu_device { public: - m6802_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m6802_cpu_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, const m6800_cpu_device::op_func *insn, const UINT8 *cycles); + m6802_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m6802_cpu_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, const m6800_cpu_device::op_func *insn, const uint8_t *cycles); protected: - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; class m6803_cpu_device : public m6801_cpu_device { public: - m6803_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m6803_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; class m6808_cpu_device : public m6802_cpu_device { public: - m6808_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m6808_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; class hd6301_cpu_device : public m6801_cpu_device { public: - hd6301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - hd6301_cpu_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); + hd6301_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + hd6301_cpu_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: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; class hd63701_cpu_device : public m6801_cpu_device { public: - hd63701_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd63701_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; class nsc8105_cpu_device : public m6802_cpu_device { public: - nsc8105_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nsc8105_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; @@ -534,7 +534,7 @@ protected: class hd6303r_cpu_device : public hd6301_cpu_device { public: - hd6303r_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd6303r_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -546,7 +546,7 @@ public: class hd6303y_cpu_device : public hd6301_cpu_device { public: - hd6303y_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd6303y_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/m68000/m68000.h b/src/devices/cpu/m68000/m68000.h index 1840d27e5a0..61c0af7a228 100644 --- a/src/devices/cpu/m68000/m68000.h +++ b/src/devices/cpu/m68000/m68000.h @@ -121,30 +121,30 @@ class m68000_base_device : public cpu_device public: // construction/destruction - m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, const char *shortname, const char *source); + m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t prg_address_bits, const char *shortname, const char *source); - m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source); + m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source); - m68000_base_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68000_base_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void presave(); void postload(); void clear_all(void); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 10; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 10; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 4; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_input_lines() const override { return 8; }; // number of input lines + virtual uint32_t execute_min_cycles() const override { return 4; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_input_lines() const override { return 8; }; // number of input lines virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -165,47 +165,47 @@ public: void set_cmpild_callback(write32_delegate callback); void set_rte_callback(write_line_delegate callback); void set_tas_write_callback(write8_delegate callback); - UINT16 get_fc(); + uint16_t get_fc(); void set_hmmu_enable(int enable); void set_instruction_hook(read32_delegate ihook); - void set_buserror_details(UINT32 fault_addr, UINT8 rw, UINT8 fc); + void set_buserror_details(uint32_t fault_addr, uint8_t rw, uint8_t fc); public: - UINT32 cpu_type; /* CPU Type: 68000, 68008, 68010, 68EC020, 68020, 68EC030, 68030, 68EC040, or 68040 */ -// UINT32 dasm_type; /* disassembly type */ - UINT32 dar[16]; /* Data and Address Registers */ - UINT32 ppc; /* Previous program counter */ - UINT32 pc; /* Program Counter */ - UINT32 sp[7]; /* User, Interrupt, and Master Stack Pointers */ - UINT32 vbr; /* Vector Base Register (m68010+) */ - UINT32 sfc; /* Source Function Code Register (m68010+) */ - UINT32 dfc; /* Destination Function Code Register (m68010+) */ - UINT32 cacr; /* Cache Control Register (m68020, unemulated) */ - UINT32 caar; /* Cache Address Register (m68020, unemulated) */ - UINT32 ir; /* Instruction Register */ + uint32_t cpu_type; /* CPU Type: 68000, 68008, 68010, 68EC020, 68020, 68EC030, 68030, 68EC040, or 68040 */ +// uint32_t dasm_type; /* disassembly type */ + uint32_t dar[16]; /* Data and Address Registers */ + uint32_t ppc; /* Previous program counter */ + uint32_t pc; /* Program Counter */ + uint32_t sp[7]; /* User, Interrupt, and Master Stack Pointers */ + uint32_t vbr; /* Vector Base Register (m68010+) */ + uint32_t sfc; /* Source Function Code Register (m68010+) */ + uint32_t dfc; /* Destination Function Code Register (m68010+) */ + uint32_t cacr; /* Cache Control Register (m68020, unemulated) */ + uint32_t caar; /* Cache Address Register (m68020, unemulated) */ + uint32_t ir; /* Instruction Register */ floatx80 fpr[8]; /* FPU Data Register (m68030/040) */ - UINT32 fpiar; /* FPU Instruction Address Register (m68040) */ - UINT32 fpsr; /* FPU Status Register (m68040) */ - UINT32 fpcr; /* FPU Control Register (m68040) */ - UINT32 t1_flag; /* Trace 1 */ - UINT32 t0_flag; /* Trace 0 */ - UINT32 s_flag; /* Supervisor */ - UINT32 m_flag; /* Master/Interrupt state */ - UINT32 x_flag; /* Extend */ - UINT32 n_flag; /* Negative */ - UINT32 not_z_flag; /* Zero, inverted for speedups */ - UINT32 v_flag; /* Overflow */ - UINT32 c_flag; /* Carry */ - UINT32 int_mask; /* I0-I2 */ - UINT32 int_level; /* State of interrupt pins IPL0-IPL2 -- ASG: changed from ints_pending */ - UINT32 stopped; /* Stopped state */ - UINT32 pref_addr; /* Last prefetch address */ - UINT32 pref_data; /* Data in the prefetch queue */ - UINT32 sr_mask; /* Implemented status register bits */ - UINT32 instr_mode; /* Stores whether we are in instruction mode or group 0/1 exception mode */ - UINT32 run_mode; /* Stores whether we are processing a reset, bus error, address error, or something else */ + uint32_t fpiar; /* FPU Instruction Address Register (m68040) */ + uint32_t fpsr; /* FPU Status Register (m68040) */ + uint32_t fpcr; /* FPU Control Register (m68040) */ + uint32_t t1_flag; /* Trace 1 */ + uint32_t t0_flag; /* Trace 0 */ + uint32_t s_flag; /* Supervisor */ + uint32_t m_flag; /* Master/Interrupt state */ + uint32_t x_flag; /* Extend */ + uint32_t n_flag; /* Negative */ + uint32_t not_z_flag; /* Zero, inverted for speedups */ + uint32_t v_flag; /* Overflow */ + uint32_t c_flag; /* Carry */ + uint32_t int_mask; /* I0-I2 */ + uint32_t int_level; /* State of interrupt pins IPL0-IPL2 -- ASG: changed from ints_pending */ + uint32_t stopped; /* Stopped state */ + uint32_t pref_addr; /* Last prefetch address */ + uint32_t pref_data; /* Data in the prefetch queue */ + uint32_t sr_mask; /* Implemented status register bits */ + uint32_t instr_mode; /* Stores whether we are in instruction mode or group 0/1 exception mode */ + uint32_t run_mode; /* Stores whether we are processing a reset, bus error, address error, or something else */ int has_pmmu; /* Indicates if a PMMU available (yes on 030, 040, no on EC030) */ int has_hmmu; /* Indicates if an Apple HMMU is available in place of the 68851 (020 only) */ int pmmu_enabled; /* Indicates if the PMMU is enabled */ @@ -214,34 +214,34 @@ public: int fpu_just_reset; /* Indicates the FPU was just reset */ /* Clocks required for instructions / exceptions */ - UINT32 cyc_bcc_notake_b; - UINT32 cyc_bcc_notake_w; - UINT32 cyc_dbcc_f_noexp; - UINT32 cyc_dbcc_f_exp; - UINT32 cyc_scc_r_true; - UINT32 cyc_movem_w; - UINT32 cyc_movem_l; - UINT32 cyc_shift; - UINT32 cyc_reset; + uint32_t cyc_bcc_notake_b; + uint32_t cyc_bcc_notake_w; + uint32_t cyc_dbcc_f_noexp; + uint32_t cyc_dbcc_f_exp; + uint32_t cyc_scc_r_true; + uint32_t cyc_movem_w; + uint32_t cyc_movem_l; + uint32_t cyc_shift; + uint32_t cyc_reset; int initial_cycles; int remaining_cycles; /* Number of clocks remaining */ int reset_cycles; - UINT32 tracing; + uint32_t tracing; int m_address_error; - UINT32 aerr_address; - UINT32 aerr_write_mode; - UINT32 aerr_fc; + uint32_t aerr_address; + uint32_t aerr_write_mode; + uint32_t aerr_fc; /* Virtual IRQ lines state */ - UINT32 virq_state; - UINT32 nmi_pending; + uint32_t virq_state; + uint32_t nmi_pending; void (**jump_table)(m68000_base_device *m68k); - const UINT8* cyc_instruction; - const UINT8* cyc_exception; + const uint8_t* cyc_instruction; + const uint8_t* cyc_exception; /* Callbacks to host */ device_irq_acknowledge_delegate int_ack_callback; /* Interrupt Acknowledge */ @@ -257,13 +257,13 @@ public: /* Redirect memory calls */ - typedef delegate m68k_read8_delegate; - typedef delegate m68k_readimm16_delegate; - typedef delegate m68k_read16_delegate; - typedef delegate m68k_read32_delegate; - typedef delegate m68k_write8_delegate; - typedef delegate m68k_write16_delegate; - typedef delegate m68k_write32_delegate; + typedef delegate m68k_read8_delegate; + typedef delegate m68k_readimm16_delegate; + typedef delegate m68k_read16_delegate; + typedef delegate m68k_read32_delegate; + typedef delegate m68k_write8_delegate; + typedef delegate m68k_write16_delegate; + typedef delegate m68k_write32_delegate; // class m68k_memory_interface // { @@ -284,27 +284,27 @@ public: m68k_write32_delegate write32; private: - UINT16 m68008_read_immediate_16(offs_t address); - UINT16 read_immediate_16(offs_t address); - UINT16 simple_read_immediate_16(offs_t address); - - void m68000_write_byte(offs_t address, UINT8 data); - - UINT8 read_byte_32_mmu(offs_t address); - void write_byte_32_mmu(offs_t address, UINT8 data); - UINT16 read_immediate_16_mmu(offs_t address); - UINT16 readword_d32_mmu(offs_t address); - void writeword_d32_mmu(offs_t address, UINT16 data); - UINT32 readlong_d32_mmu(offs_t address); - void writelong_d32_mmu(offs_t address, UINT32 data); - - UINT8 read_byte_32_hmmu(offs_t address); - void write_byte_32_hmmu(offs_t address, UINT8 data); - UINT16 read_immediate_16_hmmu(offs_t address); - UINT16 readword_d32_hmmu(offs_t address); - void writeword_d32_hmmu(offs_t address, UINT16 data); - UINT32 readlong_d32_hmmu(offs_t address); - void writelong_d32_hmmu(offs_t address, UINT32 data); + uint16_t m68008_read_immediate_16(offs_t address); + uint16_t read_immediate_16(offs_t address); + uint16_t simple_read_immediate_16(offs_t address); + + void m68000_write_byte(offs_t address, uint8_t data); + + uint8_t read_byte_32_mmu(offs_t address); + void write_byte_32_mmu(offs_t address, uint8_t data); + uint16_t read_immediate_16_mmu(offs_t address); + uint16_t readword_d32_mmu(offs_t address); + void writeword_d32_mmu(offs_t address, uint16_t data); + uint32_t readlong_d32_mmu(offs_t address); + void writelong_d32_mmu(offs_t address, uint32_t data); + + uint8_t read_byte_32_hmmu(offs_t address); + void write_byte_32_hmmu(offs_t address, uint8_t data); + uint16_t read_immediate_16_hmmu(offs_t address); + uint16_t readword_d32_hmmu(offs_t address); + void writeword_d32_hmmu(offs_t address, uint16_t data); + uint32_t readlong_d32_hmmu(offs_t address); + void writelong_d32_hmmu(offs_t address, uint32_t data); // m68000_base_device *m_cpustate; // }; @@ -315,37 +315,37 @@ public: address_space *m_space, *m_ospace; direct_read_data *m_direct, *m_odirect; - UINT32 iotemp; + uint32_t iotemp; /* save state data */ - UINT16 save_sr; - UINT8 save_stopped; - UINT8 save_halted; + uint16_t save_sr; + uint8_t save_stopped; + uint8_t save_halted; /* PMMU registers */ - UINT32 mmu_crp_aptr, mmu_crp_limit; - UINT32 mmu_srp_aptr, mmu_srp_limit; - UINT32 mmu_urp_aptr; /* 040 only */ - UINT32 mmu_tc; - UINT16 mmu_sr; - UINT32 mmu_sr_040; - UINT32 mmu_atc_tag[MMU_ATC_ENTRIES], mmu_atc_data[MMU_ATC_ENTRIES]; - UINT32 mmu_atc_rr; - UINT32 mmu_tt0, mmu_tt1; - UINT32 mmu_itt0, mmu_itt1, mmu_dtt0, mmu_dtt1; - UINT32 mmu_acr0, mmu_acr1, mmu_acr2, mmu_acr3; - UINT32 mmu_last_page_entry, mmu_last_page_entry_addr; - - UINT16 mmu_tmp_sr; /* temporary hack: status code for ptest and to handle write protection */ - UINT16 mmu_tmp_fc; /* temporary hack: function code for the mmu (moves) */ - UINT16 mmu_tmp_rw; /* temporary hack: read/write (1/0) for the mmu */ - UINT32 mmu_tmp_buserror_address; /* temporary hack: (first) bus error address */ - UINT16 mmu_tmp_buserror_occurred; /* temporary hack: flag that bus error has occurred from mmu */ - UINT16 mmu_tmp_buserror_fc; /* temporary hack: (first) bus error fc */ - UINT16 mmu_tmp_buserror_rw; /* temporary hack: (first) bus error rw */ - - UINT32 ic_address[M68K_IC_SIZE]; /* instruction cache address data */ - UINT32 ic_data[M68K_IC_SIZE]; /* instruction cache content data */ + uint32_t mmu_crp_aptr, mmu_crp_limit; + uint32_t mmu_srp_aptr, mmu_srp_limit; + uint32_t mmu_urp_aptr; /* 040 only */ + uint32_t mmu_tc; + uint16_t mmu_sr; + uint32_t mmu_sr_040; + uint32_t mmu_atc_tag[MMU_ATC_ENTRIES], mmu_atc_data[MMU_ATC_ENTRIES]; + uint32_t mmu_atc_rr; + uint32_t mmu_tt0, mmu_tt1; + uint32_t mmu_itt0, mmu_itt1, mmu_dtt0, mmu_dtt1; + uint32_t mmu_acr0, mmu_acr1, mmu_acr2, mmu_acr3; + uint32_t mmu_last_page_entry, mmu_last_page_entry_addr; + + uint16_t mmu_tmp_sr; /* temporary hack: status code for ptest and to handle write protection */ + uint16_t mmu_tmp_fc; /* temporary hack: function code for the mmu (moves) */ + uint16_t mmu_tmp_rw; /* temporary hack: read/write (1/0) for the mmu */ + uint32_t mmu_tmp_buserror_address; /* temporary hack: (first) bus error address */ + uint16_t mmu_tmp_buserror_occurred; /* temporary hack: flag that bus error has occurred from mmu */ + uint16_t mmu_tmp_buserror_fc; /* temporary hack: (first) bus error fc */ + uint16_t mmu_tmp_buserror_rw; /* temporary hack: (first) bus error rw */ + + uint32_t ic_address[M68K_IC_SIZE]; /* instruction cache address data */ + uint32_t ic_data[M68K_IC_SIZE]; /* instruction cache content data */ bool ic_valid[M68K_IC_SIZE]; /* instruction cache valid flags */ @@ -379,7 +379,7 @@ public: void init_cpu_coldfire(void); - void m68ki_exception_interrupt(m68000_base_device *m68k, UINT32 int_level); + void m68ki_exception_interrupt(m68000_base_device *m68k, uint32_t int_level); void reset_cpu(void); inline void cpu_execute(void); @@ -399,22 +399,22 @@ class m68000_device : public m68000_base_device { public: // construction/destruction - m68000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - m68000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + m68000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m68000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); - m68000_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source); + m68000_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 10; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 10; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 4; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 4; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -424,16 +424,16 @@ class m68301_device : public m68000_base_device { public: // construction/destruction - m68301_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 10; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 10; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 4; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 4; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -446,16 +446,16 @@ class m68008_device : public m68000_base_device { public: // construction/destruction - m68008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 10; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 10; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 4; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 4; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -465,16 +465,16 @@ class m68008plcc_device : public m68000_base_device { public: // construction/destruction - m68008plcc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68008plcc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 10; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 10; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 4; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 4; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -484,16 +484,16 @@ class m68010_device : public m68000_base_device { public: // construction/destruction - m68010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 10; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 10; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 4; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 4; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -503,16 +503,16 @@ class m68ec020_device : public m68000_base_device { public: // construction/destruction - m68ec020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68ec020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -522,16 +522,16 @@ class m68020_device : public m68000_base_device { public: // construction/destruction - m68020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -541,16 +541,16 @@ class m68020fpu_device : public m68000_base_device { public: // construction/destruction - m68020fpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68020fpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -560,16 +560,16 @@ class m68020pmmu_device : public m68000_base_device { public: // construction/destruction - m68020pmmu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68020pmmu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -579,16 +579,16 @@ class m68020hmmu_device : public m68000_base_device { public: // construction/destruction - m68020hmmu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68020hmmu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; virtual bool memory_translate(address_spacenum space, int intention, offs_t &address) override; @@ -600,16 +600,16 @@ class m68ec030_device : public m68000_base_device { public: // construction/destruction - m68ec030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68ec030_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -619,16 +619,16 @@ class m68030_device : public m68000_base_device { public: // construction/destruction - m68030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68030_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -638,16 +638,16 @@ class m68ec040_device : public m68000_base_device { public: // construction/destruction - m68ec040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68ec040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -657,16 +657,16 @@ class m68lc040_device : public m68000_base_device { public: // construction/destruction - m68lc040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68lc040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -676,16 +676,16 @@ class m68040_device : public m68000_base_device { public: // construction/destruction - m68040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -695,16 +695,16 @@ class scc68070_device : public m68000_base_device { public: // construction/destruction - scc68070_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc68070_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 10; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 10; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 4; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 4; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -717,19 +717,19 @@ class fscpu32_device : public m68000_base_device { public: // construction/destruction - fscpu32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fscpu32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - fscpu32_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source); + fscpu32_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides virtual void device_start() override; @@ -741,16 +741,16 @@ class mcf5206e_device : public m68000_base_device { public: // construction/destruction - mcf5206e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mcf5206e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; }; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; }; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT32 execute_min_cycles() const override { return 2; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 2; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device-level overrides diff --git a/src/devices/cpu/m68000/m68k_in.cpp b/src/devices/cpu/m68000/m68k_in.cpp index df98a736226..36800d226b3 100644 --- a/src/devices/cpu/m68000/m68k_in.cpp +++ b/src/devices/cpu/m68000/m68k_in.cpp @@ -925,10 +925,10 @@ M68KMAKE_OP(040fpu1, 32, ., .) M68KMAKE_OP(abcd, 8, rr, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = DY(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = DY(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ @@ -951,10 +951,10 @@ M68KMAKE_OP(abcd, 8, rr, .) M68KMAKE_OP(abcd, 8, mm, ax7) { - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea = EA_A7_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea = EA_A7_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ @@ -977,10 +977,10 @@ M68KMAKE_OP(abcd, 8, mm, ax7) M68KMAKE_OP(abcd, 8, mm, ay7) { - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea = EA_AX_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea = EA_AX_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ @@ -1003,10 +1003,10 @@ M68KMAKE_OP(abcd, 8, mm, ay7) M68KMAKE_OP(abcd, 8, mm, axy7) { - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea = EA_A7_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea = EA_A7_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ @@ -1029,10 +1029,10 @@ M68KMAKE_OP(abcd, 8, mm, axy7) M68KMAKE_OP(abcd, 8, mm, .) { - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea = EA_AX_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea = EA_AX_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ @@ -1055,10 +1055,10 @@ M68KMAKE_OP(abcd, 8, mm, .) M68KMAKE_OP(add, 8, er, d) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = src + dst; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1071,10 +1071,10 @@ M68KMAKE_OP(add, 8, er, d) M68KMAKE_OP(add, 8, er, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = M68KMAKE_GET_OPER_AY_8; - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = src + dst; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = M68KMAKE_GET_OPER_AY_8; + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1087,10 +1087,10 @@ M68KMAKE_OP(add, 8, er, .) M68KMAKE_OP(add, 16, er, d) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src + dst; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1103,10 +1103,10 @@ M68KMAKE_OP(add, 16, er, d) M68KMAKE_OP(add, 16, er, a) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src + dst; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1119,10 +1119,10 @@ M68KMAKE_OP(add, 16, er, a) M68KMAKE_OP(add, 16, er, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = M68KMAKE_GET_OPER_AY_16; - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src + dst; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = M68KMAKE_GET_OPER_AY_16; + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1135,10 +1135,10 @@ M68KMAKE_OP(add, 16, er, .) M68KMAKE_OP(add, 32, er, d) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = DY(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = src + dst; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = DY(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->v_flag = VFLAG_ADD_32(src, dst, res); @@ -1151,10 +1151,10 @@ M68KMAKE_OP(add, 32, er, d) M68KMAKE_OP(add, 32, er, a) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = AY(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = src + dst; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = AY(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->v_flag = VFLAG_ADD_32(src, dst, res); @@ -1167,10 +1167,10 @@ M68KMAKE_OP(add, 32, er, a) M68KMAKE_OP(add, 32, er, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = M68KMAKE_GET_OPER_AY_32; - UINT32 dst = *r_dst; - UINT32 res = src + dst; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = M68KMAKE_GET_OPER_AY_32; + uint32_t dst = *r_dst; + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->v_flag = VFLAG_ADD_32(src, dst, res); @@ -1183,10 +1183,10 @@ M68KMAKE_OP(add, 32, er, .) M68KMAKE_OP(add, 8, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = MASK_OUT_ABOVE_8(DX(mc68kcpu)); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = src + dst; + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = MASK_OUT_ABOVE_8(DX(mc68kcpu)); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1199,10 +1199,10 @@ M68KMAKE_OP(add, 8, re, .) M68KMAKE_OP(add, 16, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = MASK_OUT_ABOVE_16(DX(mc68kcpu)); - UINT32 dst = m68ki_read_16((mc68kcpu), ea); - UINT32 res = src + dst; + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = MASK_OUT_ABOVE_16(DX(mc68kcpu)); + uint32_t dst = m68ki_read_16((mc68kcpu), ea); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1215,10 +1215,10 @@ M68KMAKE_OP(add, 16, re, .) M68KMAKE_OP(add, 32, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 src = DX(mc68kcpu); - UINT32 dst = m68ki_read_32((mc68kcpu), ea); - UINT32 res = src + dst; + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t src = DX(mc68kcpu); + uint32_t dst = m68ki_read_32((mc68kcpu), ea); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->v_flag = VFLAG_ADD_32(src, dst, res); @@ -1231,7 +1231,7 @@ M68KMAKE_OP(add, 32, re, .) M68KMAKE_OP(adda, 16, ., d) { - UINT32* r_dst = &AX(mc68kcpu); + uint32_t* r_dst = &AX(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(DY(mc68kcpu))); } @@ -1239,7 +1239,7 @@ M68KMAKE_OP(adda, 16, ., d) M68KMAKE_OP(adda, 16, ., a) { - UINT32* r_dst = &AX(mc68kcpu); + uint32_t* r_dst = &AX(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(AY(mc68kcpu))); } @@ -1247,8 +1247,8 @@ M68KMAKE_OP(adda, 16, ., a) M68KMAKE_OP(adda, 16, ., .) { - UINT32* r_dst = &AX(mc68kcpu); - UINT32 src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); + uint32_t* r_dst = &AX(mc68kcpu); + uint32_t src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); *r_dst = MASK_OUT_ABOVE_32(*r_dst + src); } @@ -1256,7 +1256,7 @@ M68KMAKE_OP(adda, 16, ., .) M68KMAKE_OP(adda, 32, ., d) { - UINT32* r_dst = &AX(mc68kcpu); + uint32_t* r_dst = &AX(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst + DY(mc68kcpu)); } @@ -1264,7 +1264,7 @@ M68KMAKE_OP(adda, 32, ., d) M68KMAKE_OP(adda, 32, ., a) { - UINT32* r_dst = &AX(mc68kcpu); + uint32_t* r_dst = &AX(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst + AY(mc68kcpu)); } @@ -1272,8 +1272,8 @@ M68KMAKE_OP(adda, 32, ., a) M68KMAKE_OP(adda, 32, ., .) { - UINT32* r_dst = &AX(mc68kcpu); - UINT32 src = M68KMAKE_GET_OPER_AY_32; + uint32_t* r_dst = &AX(mc68kcpu); + uint32_t src = M68KMAKE_GET_OPER_AY_32; *r_dst = MASK_OUT_ABOVE_32(*r_dst + src); } @@ -1281,10 +1281,10 @@ M68KMAKE_OP(adda, 32, ., .) M68KMAKE_OP(addi, 8, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = src + dst; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1297,10 +1297,10 @@ M68KMAKE_OP(addi, 8, ., d) M68KMAKE_OP(addi, 8, ., .) { - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = src + dst; + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1313,10 +1313,10 @@ M68KMAKE_OP(addi, 8, ., .) M68KMAKE_OP(addi, 16, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src + dst; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1329,10 +1329,10 @@ M68KMAKE_OP(addi, 16, ., d) M68KMAKE_OP(addi, 16, ., .) { - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 dst = m68ki_read_16((mc68kcpu), ea); - UINT32 res = src + dst; + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t dst = m68ki_read_16((mc68kcpu), ea); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1345,10 +1345,10 @@ M68KMAKE_OP(addi, 16, ., .) M68KMAKE_OP(addi, 32, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = src + dst; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->v_flag = VFLAG_ADD_32(src, dst, res); @@ -1361,10 +1361,10 @@ M68KMAKE_OP(addi, 32, ., d) M68KMAKE_OP(addi, 32, ., .) { - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 dst = m68ki_read_32((mc68kcpu), ea); - UINT32 res = src + dst; + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t dst = m68ki_read_32((mc68kcpu), ea); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->v_flag = VFLAG_ADD_32(src, dst, res); @@ -1377,10 +1377,10 @@ M68KMAKE_OP(addi, 32, ., .) M68KMAKE_OP(addq, 8, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = src + dst; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1393,10 +1393,10 @@ M68KMAKE_OP(addq, 8, ., d) M68KMAKE_OP(addq, 8, ., .) { - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = src + dst; + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1409,10 +1409,10 @@ M68KMAKE_OP(addq, 8, ., .) M68KMAKE_OP(addq, 16, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src + dst; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1425,7 +1425,7 @@ M68KMAKE_OP(addq, 16, ., d) M68KMAKE_OP(addq, 16, ., a) { - UINT32* r_dst = &AY(mc68kcpu); + uint32_t* r_dst = &AY(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst + ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1); } @@ -1433,10 +1433,10 @@ M68KMAKE_OP(addq, 16, ., a) M68KMAKE_OP(addq, 16, ., .) { - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 dst = m68ki_read_16((mc68kcpu), ea); - UINT32 res = src + dst; + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t dst = m68ki_read_16((mc68kcpu), ea); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1449,10 +1449,10 @@ M68KMAKE_OP(addq, 16, ., .) M68KMAKE_OP(addq, 32, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 dst = *r_dst; - UINT32 res = src + dst; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t dst = *r_dst; + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->v_flag = VFLAG_ADD_32(src, dst, res); @@ -1465,7 +1465,7 @@ M68KMAKE_OP(addq, 32, ., d) M68KMAKE_OP(addq, 32, ., a) { - UINT32* r_dst = &AY(mc68kcpu); + uint32_t* r_dst = &AY(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst + ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1); } @@ -1473,10 +1473,10 @@ M68KMAKE_OP(addq, 32, ., a) M68KMAKE_OP(addq, 32, ., .) { - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 dst = m68ki_read_32((mc68kcpu), ea); - UINT32 res = src + dst; + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t dst = m68ki_read_32((mc68kcpu), ea); + uint32_t res = src + dst; (mc68kcpu)->n_flag = NFLAG_32(res); @@ -1490,10 +1490,10 @@ M68KMAKE_OP(addq, 32, ., .) M68KMAKE_OP(addx, 8, rr, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = src + dst + XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = src + dst + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1508,10 +1508,10 @@ M68KMAKE_OP(addx, 8, rr, .) M68KMAKE_OP(addx, 16, rr, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src + dst + XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src + dst + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1526,10 +1526,10 @@ M68KMAKE_OP(addx, 16, rr, .) M68KMAKE_OP(addx, 32, rr, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = DY(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = src + dst + XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = DY(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = src + dst + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->v_flag = VFLAG_ADD_32(src, dst, res); @@ -1544,10 +1544,10 @@ M68KMAKE_OP(addx, 32, rr, .) M68KMAKE_OP(addx, 8, mm, ax7) { - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea = EA_A7_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = src + dst + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea = EA_A7_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = src + dst + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1562,10 +1562,10 @@ M68KMAKE_OP(addx, 8, mm, ax7) M68KMAKE_OP(addx, 8, mm, ay7) { - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea = EA_AX_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = src + dst + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea = EA_AX_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = src + dst + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1580,10 +1580,10 @@ M68KMAKE_OP(addx, 8, mm, ay7) M68KMAKE_OP(addx, 8, mm, axy7) { - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea = EA_A7_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = src + dst + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea = EA_A7_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = src + dst + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1598,10 +1598,10 @@ M68KMAKE_OP(addx, 8, mm, axy7) M68KMAKE_OP(addx, 8, mm, .) { - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea = EA_AX_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = src + dst + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea = EA_AX_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = src + dst + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->v_flag = VFLAG_ADD_8(src, dst, res); @@ -1616,10 +1616,10 @@ M68KMAKE_OP(addx, 8, mm, .) M68KMAKE_OP(addx, 16, mm, .) { - UINT32 src = OPER_AY_PD_16(mc68kcpu); - UINT32 ea = EA_AX_PD_16(mc68kcpu); - UINT32 dst = m68ki_read_16((mc68kcpu), ea); - UINT32 res = src + dst + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_16(mc68kcpu); + uint32_t ea = EA_AX_PD_16(mc68kcpu); + uint32_t dst = m68ki_read_16((mc68kcpu), ea); + uint32_t res = src + dst + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->v_flag = VFLAG_ADD_16(src, dst, res); @@ -1634,10 +1634,10 @@ M68KMAKE_OP(addx, 16, mm, .) M68KMAKE_OP(addx, 32, mm, .) { - UINT32 src = OPER_AY_PD_32(mc68kcpu); - UINT32 ea = EA_AX_PD_32(mc68kcpu); - UINT32 dst = m68ki_read_32((mc68kcpu), ea); - UINT32 res = src + dst + XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_32(mc68kcpu); + uint32_t ea = EA_AX_PD_32(mc68kcpu); + uint32_t dst = m68ki_read_32((mc68kcpu), ea); + uint32_t res = src + dst + XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->v_flag = VFLAG_ADD_32(src, dst, res); @@ -1712,8 +1712,8 @@ M68KMAKE_OP(and, 32, er, .) M68KMAKE_OP(and, 8, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 res = DX(mc68kcpu) & m68ki_read_8((mc68kcpu), ea); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t res = DX(mc68kcpu) & m68ki_read_8((mc68kcpu), ea); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->c_flag = CFLAG_CLEAR; @@ -1726,8 +1726,8 @@ M68KMAKE_OP(and, 8, re, .) M68KMAKE_OP(and, 16, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 res = DX(mc68kcpu) & m68ki_read_16((mc68kcpu), ea); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t res = DX(mc68kcpu) & m68ki_read_16((mc68kcpu), ea); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->c_flag = CFLAG_CLEAR; @@ -1740,8 +1740,8 @@ M68KMAKE_OP(and, 16, re, .) M68KMAKE_OP(and, 32, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 res = DX(mc68kcpu) & m68ki_read_32((mc68kcpu), ea); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t res = DX(mc68kcpu) & m68ki_read_32((mc68kcpu), ea); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -1764,9 +1764,9 @@ M68KMAKE_OP(andi, 8, ., d) M68KMAKE_OP(andi, 8, ., .) { - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 res = src & m68ki_read_8((mc68kcpu), ea); + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t res = src & m68ki_read_8((mc68kcpu), ea); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -1789,9 +1789,9 @@ M68KMAKE_OP(andi, 16, ., d) M68KMAKE_OP(andi, 16, ., .) { - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 res = src & m68ki_read_16((mc68kcpu), ea); + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t res = src & m68ki_read_16((mc68kcpu), ea); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -1814,9 +1814,9 @@ M68KMAKE_OP(andi, 32, ., d) M68KMAKE_OP(andi, 32, ., .) { - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 res = src & m68ki_read_32((mc68kcpu), ea); + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t res = src & m68ki_read_32((mc68kcpu), ea); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -1837,7 +1837,7 @@ M68KMAKE_OP(andi, 16, tos, .) { if((mc68kcpu)->s_flag) { - UINT32 src = OPER_I_16(mc68kcpu); + uint32_t src = OPER_I_16(mc68kcpu); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_set_sr((mc68kcpu), m68ki_get_sr(mc68kcpu) & src); return; @@ -1848,10 +1848,10 @@ M68KMAKE_OP(andi, 16, tos, .) M68KMAKE_OP(asr, 8, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = src >> shift; if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -1870,10 +1870,10 @@ M68KMAKE_OP(asr, 8, s, .) M68KMAKE_OP(asr, 16, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src >> shift; if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -1892,10 +1892,10 @@ M68KMAKE_OP(asr, 16, s, .) M68KMAKE_OP(asr, 32, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = *r_dst; - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = *r_dst; + uint32_t res = src >> shift; if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -1914,10 +1914,10 @@ M68KMAKE_OP(asr, 32, s, .) M68KMAKE_OP(asr, 8, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = src >> shift; if(shift != 0) { @@ -1966,10 +1966,10 @@ M68KMAKE_OP(asr, 8, r, .) M68KMAKE_OP(asr, 16, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src >> shift; if(shift != 0) { @@ -2018,10 +2018,10 @@ M68KMAKE_OP(asr, 16, r, .) M68KMAKE_OP(asr, 32, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = *r_dst; - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = *r_dst; + uint32_t res = src >> shift; if(shift != 0) { @@ -2070,9 +2070,9 @@ M68KMAKE_OP(asr, 32, r, .) M68KMAKE_OP(asr, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = src >> 1; + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = src >> 1; if(GET_MSB_16(src)) res |= 0x8000; @@ -2088,10 +2088,10 @@ M68KMAKE_OP(asr, 16, ., .) M68KMAKE_OP(asl, 8, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = MASK_OUT_ABOVE_8(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = MASK_OUT_ABOVE_8(src << shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -2108,10 +2108,10 @@ M68KMAKE_OP(asl, 8, s, .) M68KMAKE_OP(asl, 16, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = MASK_OUT_ABOVE_16(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = MASK_OUT_ABOVE_16(src << shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -2128,10 +2128,10 @@ M68KMAKE_OP(asl, 16, s, .) M68KMAKE_OP(asl, 32, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = *r_dst; - UINT32 res = MASK_OUT_ABOVE_32(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = *r_dst; + uint32_t res = MASK_OUT_ABOVE_32(src << shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -2148,10 +2148,10 @@ M68KMAKE_OP(asl, 32, s, .) M68KMAKE_OP(asl, 8, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = MASK_OUT_ABOVE_8(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = MASK_OUT_ABOVE_8(src << shift); if(shift != 0) { @@ -2185,10 +2185,10 @@ M68KMAKE_OP(asl, 8, r, .) M68KMAKE_OP(asl, 16, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = MASK_OUT_ABOVE_16(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = MASK_OUT_ABOVE_16(src << shift); if(shift != 0) { @@ -2222,10 +2222,10 @@ M68KMAKE_OP(asl, 16, r, .) M68KMAKE_OP(asl, 32, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = *r_dst; - UINT32 res = MASK_OUT_ABOVE_32(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = *r_dst; + uint32_t res = MASK_OUT_ABOVE_32(src << shift); if(shift != 0) { @@ -2259,9 +2259,9 @@ M68KMAKE_OP(asl, 32, r, .) M68KMAKE_OP(asl, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = MASK_OUT_ABOVE_16(src << 1); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = MASK_OUT_ABOVE_16(src << 1); m68ki_write_16((mc68kcpu), ea, res); @@ -2289,7 +2289,7 @@ M68KMAKE_OP(bcc, 16, ., .) { if(M68KMAKE_CC) { - UINT32 offset = OPER_I_16(mc68kcpu); + uint32_t offset = OPER_I_16(mc68kcpu); REG_PC(mc68kcpu) -= 2; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_branch_16((mc68kcpu), offset); @@ -2306,7 +2306,7 @@ M68KMAKE_OP(bcc, 32, ., .) { if(M68KMAKE_CC) { - UINT32 offset = OPER_I_32(mc68kcpu); + uint32_t offset = OPER_I_32(mc68kcpu); REG_PC(mc68kcpu) -= 4; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_branch_32((mc68kcpu), offset); @@ -2330,8 +2330,8 @@ M68KMAKE_OP(bcc, 32, ., .) M68KMAKE_OP(bchg, 32, r, d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 mask = 1 << (DX(mc68kcpu) & 0x1f); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t mask = 1 << (DX(mc68kcpu) & 0x1f); (mc68kcpu)->not_z_flag = *r_dst & mask; *r_dst ^= mask; @@ -2340,9 +2340,9 @@ M68KMAKE_OP(bchg, 32, r, d) M68KMAKE_OP(bchg, 8, r, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = m68ki_read_8((mc68kcpu), ea); - UINT32 mask = 1 << (DX(mc68kcpu) & 7); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = m68ki_read_8((mc68kcpu), ea); + uint32_t mask = 1 << (DX(mc68kcpu) & 7); (mc68kcpu)->not_z_flag = src & mask; m68ki_write_8((mc68kcpu), ea, src ^ mask); @@ -2351,8 +2351,8 @@ M68KMAKE_OP(bchg, 8, r, .) M68KMAKE_OP(bchg, 32, s, d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 mask = 1 << (OPER_I_8(mc68kcpu) & 0x1f); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t mask = 1 << (OPER_I_8(mc68kcpu) & 0x1f); (mc68kcpu)->not_z_flag = *r_dst & mask; *r_dst ^= mask; @@ -2361,9 +2361,9 @@ M68KMAKE_OP(bchg, 32, s, d) M68KMAKE_OP(bchg, 8, s, .) { - UINT32 mask = 1 << (OPER_I_8(mc68kcpu) & 7); - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = m68ki_read_8((mc68kcpu), ea); + uint32_t mask = 1 << (OPER_I_8(mc68kcpu) & 7); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = m68ki_read_8((mc68kcpu), ea); (mc68kcpu)->not_z_flag = src & mask; m68ki_write_8((mc68kcpu), ea, src ^ mask); @@ -2372,8 +2372,8 @@ M68KMAKE_OP(bchg, 8, s, .) M68KMAKE_OP(bclr, 32, r, d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 mask = 1 << (DX(mc68kcpu) & 0x1f); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t mask = 1 << (DX(mc68kcpu) & 0x1f); (mc68kcpu)->not_z_flag = *r_dst & mask; *r_dst &= ~mask; @@ -2382,9 +2382,9 @@ M68KMAKE_OP(bclr, 32, r, d) M68KMAKE_OP(bclr, 8, r, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = m68ki_read_8((mc68kcpu), ea); - UINT32 mask = 1 << (DX(mc68kcpu) & 7); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = m68ki_read_8((mc68kcpu), ea); + uint32_t mask = 1 << (DX(mc68kcpu) & 7); (mc68kcpu)->not_z_flag = src & mask; m68ki_write_8((mc68kcpu), ea, src & ~mask); @@ -2393,8 +2393,8 @@ M68KMAKE_OP(bclr, 8, r, .) M68KMAKE_OP(bclr, 32, s, d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 mask = 1 << (OPER_I_8(mc68kcpu) & 0x1f); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t mask = 1 << (OPER_I_8(mc68kcpu) & 0x1f); (mc68kcpu)->not_z_flag = *r_dst & mask; *r_dst &= ~mask; @@ -2403,9 +2403,9 @@ M68KMAKE_OP(bclr, 32, s, d) M68KMAKE_OP(bclr, 8, s, .) { - UINT32 mask = 1 << (OPER_I_8(mc68kcpu) & 7); - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = m68ki_read_8((mc68kcpu), ea); + uint32_t mask = 1 << (OPER_I_8(mc68kcpu) & 7); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = m68ki_read_8((mc68kcpu), ea); (mc68kcpu)->not_z_flag = src & mask; m68ki_write_8((mc68kcpu), ea, src & ~mask); @@ -2416,11 +2416,11 @@ M68KMAKE_OP(bfchg, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32* data = &DY(mc68kcpu); - UINT64 mask; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t* data = &DY(mc68kcpu); + uint64_t mask; if(BIT_B(word2)) @@ -2451,15 +2451,15 @@ M68KMAKE_OP(bfchg, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - INT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32 mask_base; - UINT32 data_long; - UINT32 mask_long; - UINT32 data_byte = 0; - UINT32 mask_byte = 0; - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t word2 = OPER_I_16(mc68kcpu); + int32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t mask_base; + uint32_t data_long; + uint32_t mask_long; + uint32_t data_byte = 0; + uint32_t mask_byte = 0; + uint32_t ea = M68KMAKE_GET_EA_AY_8; if(BIT_B(word2)) @@ -2505,11 +2505,11 @@ M68KMAKE_OP(bfclr, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32* data = &DY(mc68kcpu); - UINT64 mask; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t* data = &DY(mc68kcpu); + uint64_t mask; if(BIT_B(word2)) @@ -2542,15 +2542,15 @@ M68KMAKE_OP(bfclr, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - INT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32 mask_base; - UINT32 data_long; - UINT32 mask_long; - UINT32 data_byte = 0; - UINT32 mask_byte = 0; - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t word2 = OPER_I_16(mc68kcpu); + int32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t mask_base; + uint32_t data_long; + uint32_t mask_long; + uint32_t data_byte = 0; + uint32_t mask_byte = 0; + uint32_t ea = M68KMAKE_GET_EA_AY_8; if(BIT_B(word2)) @@ -2596,10 +2596,10 @@ M68KMAKE_OP(bfexts, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT64 data = DY(mc68kcpu); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint64_t data = DY(mc68kcpu); if(BIT_B(word2)) @@ -2630,11 +2630,11 @@ M68KMAKE_OP(bfexts, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - INT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32 data; - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t word2 = OPER_I_16(mc68kcpu); + int32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t data; + uint32_t ea = M68KMAKE_GET_EA_AY_8; if(BIT_B(word2)) @@ -2682,10 +2682,10 @@ M68KMAKE_OP(bfextu, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT64 data = DY(mc68kcpu); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint64_t data = DY(mc68kcpu); if(BIT_B(word2)) @@ -2716,11 +2716,11 @@ M68KMAKE_OP(bfextu, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - INT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32 data; - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t word2 = OPER_I_16(mc68kcpu); + int32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t data; + uint32_t ea = M68KMAKE_GET_EA_AY_8; if(BIT_B(word2)) @@ -2767,11 +2767,11 @@ M68KMAKE_OP(bfffo, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT64 data = DY(mc68kcpu); - UINT32 bit; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint64_t data = DY(mc68kcpu); + uint32_t bit; if(BIT_B(word2)) @@ -2805,13 +2805,13 @@ M68KMAKE_OP(bfffo, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - INT32 offset = (word2>>6)&31; - INT32 local_offset; - UINT32 width = word2; - UINT32 data; - UINT32 bit; - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t word2 = OPER_I_16(mc68kcpu); + int32_t offset = (word2>>6)&31; + int32_t local_offset; + uint32_t width = word2; + uint32_t data; + uint32_t bit; + uint32_t ea = M68KMAKE_GET_EA_AY_8; if(BIT_B(word2)) @@ -2857,12 +2857,12 @@ M68KMAKE_OP(bfins, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32* data = &DY(mc68kcpu); - UINT64 mask; - UINT64 insert = REG_D(mc68kcpu)[(word2>>12)&7]; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t* data = &DY(mc68kcpu); + uint64_t mask; + uint64_t insert = REG_D(mc68kcpu)[(word2>>12)&7]; if(BIT_B(word2)) @@ -2899,18 +2899,18 @@ M68KMAKE_OP(bfins, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - INT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32 insert_base = REG_D(mc68kcpu)[(word2>>12)&7]; - UINT32 insert_long; - UINT32 insert_byte; - UINT32 mask_base; - UINT32 data_long; - UINT32 mask_long; - UINT32 data_byte = 0; - UINT32 mask_byte = 0; - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t word2 = OPER_I_16(mc68kcpu); + int32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t insert_base = REG_D(mc68kcpu)[(word2>>12)&7]; + uint32_t insert_long; + uint32_t insert_byte; + uint32_t mask_base; + uint32_t data_long; + uint32_t mask_long; + uint32_t data_byte = 0; + uint32_t mask_byte = 0; + uint32_t ea = M68KMAKE_GET_EA_AY_8; if(BIT_B(word2)) @@ -2975,11 +2975,11 @@ M68KMAKE_OP(bfset, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32* data = &DY(mc68kcpu); - UINT64 mask; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t* data = &DY(mc68kcpu); + uint64_t mask; if(BIT_B(word2)) @@ -3012,15 +3012,15 @@ M68KMAKE_OP(bfset, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - INT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32 mask_base; - UINT32 data_long; - UINT32 mask_long; - UINT32 data_byte = 0; - UINT32 mask_byte = 0; - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t word2 = OPER_I_16(mc68kcpu); + int32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t mask_base; + uint32_t data_long; + uint32_t mask_long; + uint32_t data_byte = 0; + uint32_t mask_byte = 0; + uint32_t ea = M68KMAKE_GET_EA_AY_8; if(BIT_B(word2)) offset = MAKE_INT_32(REG_D(mc68kcpu)[offset&7]); @@ -3065,11 +3065,11 @@ M68KMAKE_OP(bftst, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32* data = &DY(mc68kcpu); - UINT64 mask; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t* data = &DY(mc68kcpu); + uint64_t mask; if(BIT_B(word2)) @@ -3100,15 +3100,15 @@ M68KMAKE_OP(bftst, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - INT32 offset = (word2>>6)&31; - UINT32 width = word2; - UINT32 mask_base; - UINT32 data_long; - UINT32 mask_long; - UINT32 data_byte = 0; - UINT32 mask_byte = 0; - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t word2 = OPER_I_16(mc68kcpu); + int32_t offset = (word2>>6)&31; + uint32_t width = word2; + uint32_t mask_base; + uint32_t data_long; + uint32_t mask_long; + uint32_t data_byte = 0; + uint32_t mask_byte = 0; + uint32_t ea = M68KMAKE_GET_EA_AY_8; if(BIT_B(word2)) offset = MAKE_INT_32(REG_D(mc68kcpu)[offset&7]); @@ -3169,7 +3169,7 @@ M68KMAKE_OP(bra, 8, ., .) M68KMAKE_OP(bra, 16, ., .) { - UINT32 offset = OPER_I_16(mc68kcpu); + uint32_t offset = OPER_I_16(mc68kcpu); REG_PC(mc68kcpu) -= 2; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_branch_16((mc68kcpu), offset); @@ -3182,7 +3182,7 @@ M68KMAKE_OP(bra, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 offset = OPER_I_32(mc68kcpu); + uint32_t offset = OPER_I_32(mc68kcpu); REG_PC(mc68kcpu) -= 4; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_branch_32((mc68kcpu), offset); @@ -3202,8 +3202,8 @@ M68KMAKE_OP(bra, 32, ., .) M68KMAKE_OP(bset, 32, r, d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 mask = 1 << (DX(mc68kcpu) & 0x1f); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t mask = 1 << (DX(mc68kcpu) & 0x1f); (mc68kcpu)->not_z_flag = *r_dst & mask; *r_dst |= mask; @@ -3212,9 +3212,9 @@ M68KMAKE_OP(bset, 32, r, d) M68KMAKE_OP(bset, 8, r, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = m68ki_read_8((mc68kcpu), ea); - UINT32 mask = 1 << (DX(mc68kcpu) & 7); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = m68ki_read_8((mc68kcpu), ea); + uint32_t mask = 1 << (DX(mc68kcpu) & 7); (mc68kcpu)->not_z_flag = src & mask; m68ki_write_8((mc68kcpu), ea, src | mask); @@ -3223,8 +3223,8 @@ M68KMAKE_OP(bset, 8, r, .) M68KMAKE_OP(bset, 32, s, d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 mask = 1 << (OPER_I_8(mc68kcpu) & 0x1f); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t mask = 1 << (OPER_I_8(mc68kcpu) & 0x1f); (mc68kcpu)->not_z_flag = *r_dst & mask; *r_dst |= mask; @@ -3233,9 +3233,9 @@ M68KMAKE_OP(bset, 32, s, d) M68KMAKE_OP(bset, 8, s, .) { - UINT32 mask = 1 << (OPER_I_8(mc68kcpu) & 7); - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = m68ki_read_8((mc68kcpu), ea); + uint32_t mask = 1 << (OPER_I_8(mc68kcpu) & 7); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = m68ki_read_8((mc68kcpu), ea); (mc68kcpu)->not_z_flag = src & mask; m68ki_write_8((mc68kcpu), ea, src | mask); @@ -3252,7 +3252,7 @@ M68KMAKE_OP(bsr, 8, ., .) M68KMAKE_OP(bsr, 16, ., .) { - UINT32 offset = OPER_I_16(mc68kcpu); + uint32_t offset = OPER_I_16(mc68kcpu); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_push_32((mc68kcpu), REG_PC(mc68kcpu)); REG_PC(mc68kcpu) -= 2; @@ -3264,7 +3264,7 @@ M68KMAKE_OP(bsr, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 offset = OPER_I_32(mc68kcpu); + uint32_t offset = OPER_I_32(mc68kcpu); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_push_32((mc68kcpu), REG_PC(mc68kcpu)); REG_PC(mc68kcpu) -= 4; @@ -3300,7 +3300,7 @@ M68KMAKE_OP(btst, 32, s, d) M68KMAKE_OP(btst, 8, s, .) { - UINT32 bit = OPER_I_8(mc68kcpu) & 7; + uint32_t bit = OPER_I_8(mc68kcpu) & 7; (mc68kcpu)->not_z_flag = M68KMAKE_GET_OPER_AY_8 & (1 << bit); } @@ -3311,7 +3311,7 @@ M68KMAKE_OP(callm, 32, ., .) /* note: watch out for pcrelative modes */ if(CPU_TYPE_IS_020_VARIANT((mc68kcpu)->cpu_type)) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; + uint32_t ea = M68KMAKE_GET_EA_AY_32; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ REG_PC(mc68kcpu) += 2; @@ -3328,11 +3328,11 @@ M68KMAKE_OP(cas, 8, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 dest = m68ki_read_8((mc68kcpu), ea); - UINT32* compare = ®_D(mc68kcpu)[word2 & 7]; - UINT32 res = dest - MASK_OUT_ABOVE_8(*compare); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t dest = m68ki_read_8((mc68kcpu), ea); + uint32_t* compare = ®_D(mc68kcpu)[word2 & 7]; + uint32_t res = dest - MASK_OUT_ABOVE_8(*compare); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ (mc68kcpu)->n_flag = NFLAG_8(res); @@ -3357,11 +3357,11 @@ M68KMAKE_OP(cas, 16, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 dest = m68ki_read_16((mc68kcpu), ea); - UINT32* compare = ®_D(mc68kcpu)[word2 & 7]; - UINT32 res = dest - MASK_OUT_ABOVE_16(*compare); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t dest = m68ki_read_16((mc68kcpu), ea); + uint32_t* compare = ®_D(mc68kcpu)[word2 & 7]; + uint32_t res = dest - MASK_OUT_ABOVE_16(*compare); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ (mc68kcpu)->n_flag = NFLAG_16(res); @@ -3386,11 +3386,11 @@ M68KMAKE_OP(cas, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 dest = m68ki_read_32((mc68kcpu), ea); - UINT32* compare = ®_D(mc68kcpu)[word2 & 7]; - UINT32 res = dest - *compare; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t dest = m68ki_read_32((mc68kcpu), ea); + uint32_t* compare = ®_D(mc68kcpu)[word2 & 7]; + uint32_t res = dest - *compare; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ (mc68kcpu)->n_flag = NFLAG_32(res); @@ -3415,15 +3415,15 @@ M68KMAKE_OP(cas2, 16, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_32(mc68kcpu); - UINT32* compare1 = ®_D(mc68kcpu)[(word2 >> 16) & 7]; - UINT32 ea1 = REG_DA(mc68kcpu)[(word2 >> 28) & 15]; - UINT32 dest1 = m68ki_read_16((mc68kcpu), ea1); - UINT32 res1 = dest1 - MASK_OUT_ABOVE_16(*compare1); - UINT32* compare2 = ®_D(mc68kcpu)[word2 & 7]; - UINT32 ea2 = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; - UINT32 dest2 = m68ki_read_16((mc68kcpu), ea2); - UINT32 res2; + uint32_t word2 = OPER_I_32(mc68kcpu); + uint32_t* compare1 = ®_D(mc68kcpu)[(word2 >> 16) & 7]; + uint32_t ea1 = REG_DA(mc68kcpu)[(word2 >> 28) & 15]; + uint32_t dest1 = m68ki_read_16((mc68kcpu), ea1); + uint32_t res1 = dest1 - MASK_OUT_ABOVE_16(*compare1); + uint32_t* compare2 = ®_D(mc68kcpu)[word2 & 7]; + uint32_t ea2 = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; + uint32_t dest2 = m68ki_read_16((mc68kcpu), ea2); + uint32_t res2; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ (mc68kcpu)->n_flag = NFLAG_16(res1); @@ -3460,15 +3460,15 @@ M68KMAKE_OP(cas2, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_32(mc68kcpu); - UINT32* compare1 = ®_D(mc68kcpu)[(word2 >> 16) & 7]; - UINT32 ea1 = REG_DA(mc68kcpu)[(word2 >> 28) & 15]; - UINT32 dest1 = m68ki_read_32((mc68kcpu), ea1); - UINT32 res1 = dest1 - *compare1; - UINT32* compare2 = ®_D(mc68kcpu)[word2 & 7]; - UINT32 ea2 = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; - UINT32 dest2 = m68ki_read_32((mc68kcpu), ea2); - UINT32 res2; + uint32_t word2 = OPER_I_32(mc68kcpu); + uint32_t* compare1 = ®_D(mc68kcpu)[(word2 >> 16) & 7]; + uint32_t ea1 = REG_DA(mc68kcpu)[(word2 >> 28) & 15]; + uint32_t dest1 = m68ki_read_32((mc68kcpu), ea1); + uint32_t res1 = dest1 - *compare1; + uint32_t* compare2 = ®_D(mc68kcpu)[word2 & 7]; + uint32_t ea2 = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; + uint32_t dest2 = m68ki_read_32((mc68kcpu), ea2); + uint32_t res2; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ (mc68kcpu)->n_flag = NFLAG_32(res1); @@ -3503,8 +3503,8 @@ M68KMAKE_OP(cas2, 32, ., .) M68KMAKE_OP(chk, 16, ., d) { - INT32 src = MAKE_INT_16(DX(mc68kcpu)); - INT32 bound = MAKE_INT_16(DY(mc68kcpu)); + int32_t src = MAKE_INT_16(DX(mc68kcpu)); + int32_t bound = MAKE_INT_16(DY(mc68kcpu)); (mc68kcpu)->not_z_flag = ZFLAG_16(src); /* Undocumented */ (mc68kcpu)->v_flag = VFLAG_CLEAR; /* Undocumented */ @@ -3521,8 +3521,8 @@ M68KMAKE_OP(chk, 16, ., d) M68KMAKE_OP(chk, 16, ., .) { - INT32 src = MAKE_INT_16(DX(mc68kcpu)); - INT32 bound = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); + int32_t src = MAKE_INT_16(DX(mc68kcpu)); + int32_t bound = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); (mc68kcpu)->not_z_flag = ZFLAG_16(src); /* Undocumented */ (mc68kcpu)->v_flag = VFLAG_CLEAR; /* Undocumented */ @@ -3541,8 +3541,8 @@ M68KMAKE_OP(chk, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - INT32 src = MAKE_INT_32(DX(mc68kcpu)); - INT32 bound = MAKE_INT_32(DY(mc68kcpu)); + int32_t src = MAKE_INT_32(DX(mc68kcpu)); + int32_t bound = MAKE_INT_32(DY(mc68kcpu)); (mc68kcpu)->not_z_flag = ZFLAG_32(src); /* Undocumented */ (mc68kcpu)->v_flag = VFLAG_CLEAR; /* Undocumented */ @@ -3564,8 +3564,8 @@ M68KMAKE_OP(chk, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - INT32 src = MAKE_INT_32(DX(mc68kcpu)); - INT32 bound = MAKE_INT_32(M68KMAKE_GET_OPER_AY_32); + int32_t src = MAKE_INT_32(DX(mc68kcpu)); + int32_t bound = MAKE_INT_32(M68KMAKE_GET_OPER_AY_32); (mc68kcpu)->not_z_flag = ZFLAG_32(src); /* Undocumented */ (mc68kcpu)->v_flag = VFLAG_CLEAR; /* Undocumented */ @@ -3587,11 +3587,11 @@ M68KMAKE_OP(chk2cmp2, 8, ., pcdi) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xff; - UINT32 ea = EA_PCDI_8(mc68kcpu); - UINT32 lower_bound = m68ki_read_pcrel_8((mc68kcpu), ea); - UINT32 upper_bound = m68ki_read_pcrel_8((mc68kcpu), ea + 1); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xff; + uint32_t ea = EA_PCDI_8(mc68kcpu); + uint32_t lower_bound = m68ki_read_pcrel_8((mc68kcpu), ea); + uint32_t upper_bound = m68ki_read_pcrel_8((mc68kcpu), ea + 1); if(!BIT_F(word2)) (mc68kcpu)->c_flag = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound); @@ -3618,11 +3618,11 @@ M68KMAKE_OP(chk2cmp2, 8, ., pcix) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xff; - UINT32 ea = EA_PCIX_8(mc68kcpu); - UINT32 lower_bound = m68ki_read_pcrel_8((mc68kcpu), ea); - UINT32 upper_bound = m68ki_read_pcrel_8((mc68kcpu), ea + 1); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xff; + uint32_t ea = EA_PCIX_8(mc68kcpu); + uint32_t lower_bound = m68ki_read_pcrel_8((mc68kcpu), ea); + uint32_t upper_bound = m68ki_read_pcrel_8((mc68kcpu), ea + 1); if(!BIT_F(word2)) (mc68kcpu)->c_flag = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound); @@ -3649,11 +3649,11 @@ M68KMAKE_OP(chk2cmp2, 8, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xff; - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 lower_bound = m68ki_read_8((mc68kcpu), ea); - UINT32 upper_bound = m68ki_read_8((mc68kcpu), ea + 1); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xff; + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t lower_bound = m68ki_read_8((mc68kcpu), ea); + uint32_t upper_bound = m68ki_read_8((mc68kcpu), ea + 1); if(!BIT_F(word2)) (mc68kcpu)->c_flag = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound); @@ -3680,11 +3680,11 @@ M68KMAKE_OP(chk2cmp2, 16, ., pcdi) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xffff; - UINT32 ea = EA_PCDI_16(mc68kcpu); - UINT32 lower_bound = m68ki_read_pcrel_16((mc68kcpu), ea); - UINT32 upper_bound = m68ki_read_pcrel_16((mc68kcpu), ea + 2); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xffff; + uint32_t ea = EA_PCDI_16(mc68kcpu); + uint32_t lower_bound = m68ki_read_pcrel_16((mc68kcpu), ea); + uint32_t upper_bound = m68ki_read_pcrel_16((mc68kcpu), ea + 2); if(!BIT_F(word2)) (mc68kcpu)->c_flag = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound); @@ -3716,11 +3716,11 @@ M68KMAKE_OP(chk2cmp2, 16, ., pcix) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xffff; - UINT32 ea = EA_PCIX_16(mc68kcpu); - UINT32 lower_bound = m68ki_read_pcrel_16((mc68kcpu), ea); - UINT32 upper_bound = m68ki_read_pcrel_16((mc68kcpu), ea + 2); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xffff; + uint32_t ea = EA_PCIX_16(mc68kcpu); + uint32_t lower_bound = m68ki_read_pcrel_16((mc68kcpu), ea); + uint32_t upper_bound = m68ki_read_pcrel_16((mc68kcpu), ea + 2); if(!BIT_F(word2)) (mc68kcpu)->c_flag = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound); @@ -3752,11 +3752,11 @@ M68KMAKE_OP(chk2cmp2, 16, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xffff; - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 lower_bound = m68ki_read_16((mc68kcpu), ea); - UINT32 upper_bound = m68ki_read_16((mc68kcpu), ea + 2); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]&0xffff; + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t lower_bound = m68ki_read_16((mc68kcpu), ea); + uint32_t upper_bound = m68ki_read_16((mc68kcpu), ea + 2); if(!BIT_F(word2)) (mc68kcpu)->c_flag = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound); @@ -3789,11 +3789,11 @@ M68KMAKE_OP(chk2cmp2, 32, ., pcdi) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; - UINT32 ea = EA_PCDI_32(mc68kcpu); - UINT32 lower_bound = m68ki_read_pcrel_32((mc68kcpu), ea); - UINT32 upper_bound = m68ki_read_pcrel_32((mc68kcpu), ea + 4); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; + uint32_t ea = EA_PCDI_32(mc68kcpu); + uint32_t lower_bound = m68ki_read_pcrel_32((mc68kcpu), ea); + uint32_t upper_bound = m68ki_read_pcrel_32((mc68kcpu), ea + 4); (mc68kcpu)->c_flag = compare - lower_bound; (mc68kcpu)->not_z_flag = !((upper_bound==compare) | (lower_bound==compare)); @@ -3819,11 +3819,11 @@ M68KMAKE_OP(chk2cmp2, 32, ., pcix) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; - UINT32 ea = EA_PCIX_32(mc68kcpu); - UINT32 lower_bound = m68ki_read_pcrel_32((mc68kcpu), ea); - UINT32 upper_bound = m68ki_read_pcrel_32((mc68kcpu), ea + 4); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; + uint32_t ea = EA_PCIX_32(mc68kcpu); + uint32_t lower_bound = m68ki_read_pcrel_32((mc68kcpu), ea); + uint32_t upper_bound = m68ki_read_pcrel_32((mc68kcpu), ea + 4); (mc68kcpu)->c_flag = compare - lower_bound; (mc68kcpu)->not_z_flag = !((upper_bound==compare) | (lower_bound==compare)); @@ -3849,11 +3849,11 @@ M68KMAKE_OP(chk2cmp2, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 lower_bound = m68ki_read_32((mc68kcpu), ea); - UINT32 upper_bound = m68ki_read_32((mc68kcpu), ea + 4); + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t compare = REG_DA(mc68kcpu)[(word2 >> 12) & 15]; + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t lower_bound = m68ki_read_32((mc68kcpu), ea); + uint32_t upper_bound = m68ki_read_32((mc68kcpu), ea + 4); (mc68kcpu)->c_flag = compare - lower_bound; (mc68kcpu)->not_z_flag = !((upper_bound==compare) | (lower_bound==compare)); @@ -3888,7 +3888,7 @@ M68KMAKE_OP(clr, 8, ., d) M68KMAKE_OP(clr, 8, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t ea = M68KMAKE_GET_EA_AY_8; if(CPU_TYPE_IS_000((mc68kcpu)->cpu_type)) { @@ -3917,7 +3917,7 @@ M68KMAKE_OP(clr, 16, ., d) M68KMAKE_OP(clr, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; + uint32_t ea = M68KMAKE_GET_EA_AY_16; if(CPU_TYPE_IS_000((mc68kcpu)->cpu_type)) { @@ -3946,7 +3946,7 @@ M68KMAKE_OP(clr, 32, ., d) M68KMAKE_OP(clr, 32, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; + uint32_t ea = M68KMAKE_GET_EA_AY_32; if(CPU_TYPE_IS_000((mc68kcpu)->cpu_type)) { @@ -3964,9 +3964,9 @@ M68KMAKE_OP(clr, 32, ., .) M68KMAKE_OP(cmp, 8, ., d) { - UINT32 src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_8(DX(mc68kcpu)); - UINT32 res = dst - src; + uint32_t src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_8(DX(mc68kcpu)); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -3977,9 +3977,9 @@ M68KMAKE_OP(cmp, 8, ., d) M68KMAKE_OP(cmp, 8, ., .) { - UINT32 src = M68KMAKE_GET_OPER_AY_8; - UINT32 dst = MASK_OUT_ABOVE_8(DX(mc68kcpu)); - UINT32 res = dst - src; + uint32_t src = M68KMAKE_GET_OPER_AY_8; + uint32_t dst = MASK_OUT_ABOVE_8(DX(mc68kcpu)); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -3990,9 +3990,9 @@ M68KMAKE_OP(cmp, 8, ., .) M68KMAKE_OP(cmp, 16, ., d) { - UINT32 src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_16(DX(mc68kcpu)); - UINT32 res = dst - src; + uint32_t src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_16(DX(mc68kcpu)); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -4003,9 +4003,9 @@ M68KMAKE_OP(cmp, 16, ., d) M68KMAKE_OP(cmp, 16, ., a) { - UINT32 src = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_16(DX(mc68kcpu)); - UINT32 res = dst - src; + uint32_t src = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_16(DX(mc68kcpu)); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -4016,9 +4016,9 @@ M68KMAKE_OP(cmp, 16, ., a) M68KMAKE_OP(cmp, 16, ., .) { - UINT32 src = M68KMAKE_GET_OPER_AY_16; - UINT32 dst = MASK_OUT_ABOVE_16(DX(mc68kcpu)); - UINT32 res = dst - src; + uint32_t src = M68KMAKE_GET_OPER_AY_16; + uint32_t dst = MASK_OUT_ABOVE_16(DX(mc68kcpu)); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -4029,9 +4029,9 @@ M68KMAKE_OP(cmp, 16, ., .) M68KMAKE_OP(cmp, 32, ., d) { - UINT32 src = DY(mc68kcpu); - UINT32 dst = DX(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = DY(mc68kcpu); + uint32_t dst = DX(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4042,9 +4042,9 @@ M68KMAKE_OP(cmp, 32, ., d) M68KMAKE_OP(cmp, 32, ., a) { - UINT32 src = AY(mc68kcpu); - UINT32 dst = DX(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = AY(mc68kcpu); + uint32_t dst = DX(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4055,9 +4055,9 @@ M68KMAKE_OP(cmp, 32, ., a) M68KMAKE_OP(cmp, 32, ., .) { - UINT32 src = M68KMAKE_GET_OPER_AY_32; - UINT32 dst = DX(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = M68KMAKE_GET_OPER_AY_32; + uint32_t dst = DX(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4068,9 +4068,9 @@ M68KMAKE_OP(cmp, 32, ., .) M68KMAKE_OP(cmpa, 16, ., d) { - UINT32 src = MAKE_INT_16(DY(mc68kcpu)); - UINT32 dst = AX(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = MAKE_INT_16(DY(mc68kcpu)); + uint32_t dst = AX(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4081,9 +4081,9 @@ M68KMAKE_OP(cmpa, 16, ., d) M68KMAKE_OP(cmpa, 16, ., a) { - UINT32 src = MAKE_INT_16(AY(mc68kcpu)); - UINT32 dst = AX(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = MAKE_INT_16(AY(mc68kcpu)); + uint32_t dst = AX(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4094,9 +4094,9 @@ M68KMAKE_OP(cmpa, 16, ., a) M68KMAKE_OP(cmpa, 16, ., .) { - UINT32 src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); - UINT32 dst = AX(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); + uint32_t dst = AX(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4107,9 +4107,9 @@ M68KMAKE_OP(cmpa, 16, ., .) M68KMAKE_OP(cmpa, 32, ., d) { - UINT32 src = DY(mc68kcpu); - UINT32 dst = AX(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = DY(mc68kcpu); + uint32_t dst = AX(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4120,9 +4120,9 @@ M68KMAKE_OP(cmpa, 32, ., d) M68KMAKE_OP(cmpa, 32, ., a) { - UINT32 src = AY(mc68kcpu); - UINT32 dst = AX(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = AY(mc68kcpu); + uint32_t dst = AX(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4133,9 +4133,9 @@ M68KMAKE_OP(cmpa, 32, ., a) M68KMAKE_OP(cmpa, 32, ., .) { - UINT32 src = M68KMAKE_GET_OPER_AY_32; - UINT32 dst = AX(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = M68KMAKE_GET_OPER_AY_32; + uint32_t dst = AX(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4146,9 +4146,9 @@ M68KMAKE_OP(cmpa, 32, ., .) M68KMAKE_OP(cmpi, 8, ., d) { - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 dst = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 res = dst - src; + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t dst = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -4159,9 +4159,9 @@ M68KMAKE_OP(cmpi, 8, ., d) M68KMAKE_OP(cmpi, 8, ., .) { - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 dst = M68KMAKE_GET_OPER_AY_8; - UINT32 res = dst - src; + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t dst = M68KMAKE_GET_OPER_AY_8; + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -4174,9 +4174,9 @@ M68KMAKE_OP(cmpi, 8, ., pcdi) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 dst = OPER_PCDI_8(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t dst = OPER_PCDI_8(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -4192,9 +4192,9 @@ M68KMAKE_OP(cmpi, 8, ., pcix) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 dst = OPER_PCIX_8(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t dst = OPER_PCIX_8(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -4208,9 +4208,9 @@ M68KMAKE_OP(cmpi, 8, ., pcix) M68KMAKE_OP(cmpi, 16, ., d) { - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 dst = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 res = dst - src; + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t dst = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -4221,9 +4221,9 @@ M68KMAKE_OP(cmpi, 16, ., d) M68KMAKE_OP(cmpi, 16, ., .) { - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 dst = M68KMAKE_GET_OPER_AY_16; - UINT32 res = dst - src; + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t dst = M68KMAKE_GET_OPER_AY_16; + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -4236,9 +4236,9 @@ M68KMAKE_OP(cmpi, 16, ., pcdi) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 dst = OPER_PCDI_16(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t dst = OPER_PCDI_16(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -4254,9 +4254,9 @@ M68KMAKE_OP(cmpi, 16, ., pcix) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 dst = OPER_PCIX_16(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t dst = OPER_PCIX_16(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -4270,9 +4270,9 @@ M68KMAKE_OP(cmpi, 16, ., pcix) M68KMAKE_OP(cmpi, 32, ., d) { - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 dst = DY(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t dst = DY(mc68kcpu); + uint32_t res = dst - src; if (!(mc68kcpu)->cmpild_instr_callback.isnull()) ((mc68kcpu)->cmpild_instr_callback)(*(mc68kcpu)->program, (mc68kcpu)->ir & 7, src, 0xffffffff); @@ -4286,9 +4286,9 @@ M68KMAKE_OP(cmpi, 32, ., d) M68KMAKE_OP(cmpi, 32, ., .) { - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 dst = M68KMAKE_GET_OPER_AY_32; - UINT32 res = dst - src; + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t dst = M68KMAKE_GET_OPER_AY_32; + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4301,9 +4301,9 @@ M68KMAKE_OP(cmpi, 32, ., pcdi) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 dst = OPER_PCDI_32(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t dst = OPER_PCDI_32(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4319,9 +4319,9 @@ M68KMAKE_OP(cmpi, 32, ., pcix) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 dst = OPER_PCIX_32(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t dst = OPER_PCIX_32(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4335,9 +4335,9 @@ M68KMAKE_OP(cmpi, 32, ., pcix) M68KMAKE_OP(cmpm, 8, ., ax7) { - UINT32 src = OPER_AY_PI_8(mc68kcpu); - UINT32 dst = OPER_A7_PI_8(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_AY_PI_8(mc68kcpu); + uint32_t dst = OPER_A7_PI_8(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -4348,9 +4348,9 @@ M68KMAKE_OP(cmpm, 8, ., ax7) M68KMAKE_OP(cmpm, 8, ., ay7) { - UINT32 src = OPER_A7_PI_8(mc68kcpu); - UINT32 dst = OPER_AX_PI_8(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_A7_PI_8(mc68kcpu); + uint32_t dst = OPER_AX_PI_8(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -4361,9 +4361,9 @@ M68KMAKE_OP(cmpm, 8, ., ay7) M68KMAKE_OP(cmpm, 8, ., axy7) { - UINT32 src = OPER_A7_PI_8(mc68kcpu); - UINT32 dst = OPER_A7_PI_8(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_A7_PI_8(mc68kcpu); + uint32_t dst = OPER_A7_PI_8(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -4374,9 +4374,9 @@ M68KMAKE_OP(cmpm, 8, ., axy7) M68KMAKE_OP(cmpm, 8, ., .) { - UINT32 src = OPER_AY_PI_8(mc68kcpu); - UINT32 dst = OPER_AX_PI_8(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_AY_PI_8(mc68kcpu); + uint32_t dst = OPER_AX_PI_8(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -4387,9 +4387,9 @@ M68KMAKE_OP(cmpm, 8, ., .) M68KMAKE_OP(cmpm, 16, ., .) { - UINT32 src = OPER_AY_PI_16(mc68kcpu); - UINT32 dst = OPER_AX_PI_16(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_AY_PI_16(mc68kcpu); + uint32_t dst = OPER_AX_PI_16(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -4400,9 +4400,9 @@ M68KMAKE_OP(cmpm, 16, ., .) M68KMAKE_OP(cmpm, 32, ., .) { - UINT32 src = OPER_AY_PI_32(mc68kcpu); - UINT32 dst = OPER_AX_PI_32(mc68kcpu); - UINT32 res = dst - src; + uint32_t src = OPER_AY_PI_32(mc68kcpu); + uint32_t dst = OPER_AX_PI_32(mc68kcpu); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -4488,13 +4488,13 @@ M68KMAKE_OP(dbt, 16, ., .) M68KMAKE_OP(dbf, 16, ., .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = MASK_OUT_ABOVE_16(*r_dst - 1); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(*r_dst - 1); *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; if(res != 0xffff) { - UINT32 offset = OPER_I_16(mc68kcpu); + uint32_t offset = OPER_I_16(mc68kcpu); REG_PC(mc68kcpu) -= 2; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_branch_16((mc68kcpu), offset); @@ -4510,13 +4510,13 @@ M68KMAKE_OP(dbcc, 16, ., .) { if(M68KMAKE_NOT_CC) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = MASK_OUT_ABOVE_16(*r_dst - 1); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(*r_dst - 1); *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; if(res != 0xffff) { - UINT32 offset = OPER_I_16(mc68kcpu); + uint32_t offset = OPER_I_16(mc68kcpu); REG_PC(mc68kcpu) -= 2; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_branch_16((mc68kcpu), offset); @@ -4533,14 +4533,14 @@ M68KMAKE_OP(dbcc, 16, ., .) M68KMAKE_OP(divs, 16, ., d) { - UINT32* r_dst = &DX(mc68kcpu); - INT32 src = MAKE_INT_16(DY(mc68kcpu)); - INT32 quotient; - INT32 remainder; + uint32_t* r_dst = &DX(mc68kcpu); + int32_t src = MAKE_INT_16(DY(mc68kcpu)); + int32_t quotient; + int32_t remainder; if(src != 0) { - if((UINT32)*r_dst == 0x80000000 && src == -1) + if((uint32_t)*r_dst == 0x80000000 && src == -1) { (mc68kcpu)->not_z_flag = 0; (mc68kcpu)->n_flag = NFLAG_CLEAR; @@ -4571,14 +4571,14 @@ M68KMAKE_OP(divs, 16, ., d) M68KMAKE_OP(divs, 16, ., .) { - UINT32* r_dst = &DX(mc68kcpu); - INT32 src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); - INT32 quotient; - INT32 remainder; + uint32_t* r_dst = &DX(mc68kcpu); + int32_t src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); + int32_t quotient; + int32_t remainder; if(src != 0) { - if((UINT32)*r_dst == 0x80000000 && src == -1) + if((uint32_t)*r_dst == 0x80000000 && src == -1) { (mc68kcpu)->not_z_flag = 0; (mc68kcpu)->n_flag = NFLAG_CLEAR; @@ -4609,13 +4609,13 @@ M68KMAKE_OP(divs, 16, ., .) M68KMAKE_OP(divu, 16, ., d) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); if(src != 0) { - UINT32 quotient = *r_dst / src; - UINT32 remainder = *r_dst % src; + uint32_t quotient = *r_dst / src; + uint32_t remainder = *r_dst % src; if(quotient < 0x10000) { @@ -4635,13 +4635,13 @@ M68KMAKE_OP(divu, 16, ., d) M68KMAKE_OP(divu, 16, ., .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = M68KMAKE_GET_OPER_AY_16; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = M68KMAKE_GET_OPER_AY_16; if(src != 0) { - UINT32 quotient = *r_dst / src; - UINT32 remainder = *r_dst % src; + uint32_t quotient = *r_dst / src; + uint32_t remainder = *r_dst % src; if(quotient < 0x10000) { @@ -4663,11 +4663,11 @@ M68KMAKE_OP(divl, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT64 divisor = DY(mc68kcpu); - UINT64 dividend = 0; - UINT64 quotient = 0; - UINT64 remainder = 0; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint64_t divisor = DY(mc68kcpu); + uint64_t dividend = 0; + uint64_t quotient = 0; + uint64_t remainder = 0; if(divisor != 0) { @@ -4679,9 +4679,9 @@ M68KMAKE_OP(divl, 32, ., d) if(BIT_B(word2)) /* signed */ { - quotient = (UINT64)((INT64)dividend / (INT64)((INT32)divisor)); - remainder = (UINT64)((INT64)dividend % (INT64)((INT32)divisor)); - if((INT64)quotient != (INT64)((INT32)quotient)) + quotient = (uint64_t)((int64_t)dividend / (int64_t)((int32_t)divisor)); + remainder = (uint64_t)((int64_t)dividend % (int64_t)((int32_t)divisor)); + if((int64_t)quotient != (int64_t)((int32_t)quotient)) { (mc68kcpu)->v_flag = VFLAG_SET; return; @@ -4703,8 +4703,8 @@ M68KMAKE_OP(divl, 32, ., d) dividend = REG_D(mc68kcpu)[(word2 >> 12) & 7]; if(BIT_B(word2)) /* signed */ { - quotient = (UINT64)((INT64)((INT32)dividend) / (INT64)((INT32)divisor)); - remainder = (UINT64)((INT64)((INT32)dividend) % (INT64)((INT32)divisor)); + quotient = (uint64_t)((int64_t)((int32_t)dividend) / (int64_t)((int32_t)divisor)); + remainder = (uint64_t)((int64_t)((int32_t)dividend) % (int64_t)((int32_t)divisor)); } else /* unsigned */ { @@ -4733,11 +4733,11 @@ M68KMAKE_OP(divl, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT64 divisor = M68KMAKE_GET_OPER_AY_32; - UINT64 dividend = 0; - UINT64 quotient = 0; - UINT64 remainder = 0; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint64_t divisor = M68KMAKE_GET_OPER_AY_32; + uint64_t dividend = 0; + uint64_t quotient = 0; + uint64_t remainder = 0; if(divisor != 0) { @@ -4749,9 +4749,9 @@ M68KMAKE_OP(divl, 32, ., .) if(BIT_B(word2)) /* signed */ { - quotient = (UINT64)((INT64)dividend / (INT64)((INT32)divisor)); - remainder = (UINT64)((INT64)dividend % (INT64)((INT32)divisor)); - if((INT64)quotient != (INT64)((INT32)quotient)) + quotient = (uint64_t)((int64_t)dividend / (int64_t)((int32_t)divisor)); + remainder = (uint64_t)((int64_t)dividend % (int64_t)((int32_t)divisor)); + if((int64_t)quotient != (int64_t)((int32_t)quotient)) { (mc68kcpu)->v_flag = VFLAG_SET; return; @@ -4773,8 +4773,8 @@ M68KMAKE_OP(divl, 32, ., .) dividend = REG_D(mc68kcpu)[(word2 >> 12) & 7]; if(BIT_B(word2)) /* signed */ { - quotient = (UINT64)((INT64)((INT32)dividend) / (INT64)((INT32)divisor)); - remainder = (UINT64)((INT64)((INT32)dividend) % (INT64)((INT32)divisor)); + quotient = (uint64_t)((int64_t)((int32_t)dividend) / (int64_t)((int32_t)divisor)); + remainder = (uint64_t)((int64_t)((int32_t)dividend) % (int64_t)((int32_t)divisor)); } else /* unsigned */ { @@ -4801,7 +4801,7 @@ M68KMAKE_OP(divl, 32, ., .) M68KMAKE_OP(eor, 8, ., d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu) ^= MASK_OUT_ABOVE_8(DX(mc68kcpu))); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu) ^= MASK_OUT_ABOVE_8(DX(mc68kcpu))); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -4812,8 +4812,8 @@ M68KMAKE_OP(eor, 8, ., d) M68KMAKE_OP(eor, 8, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 res = MASK_OUT_ABOVE_8(DX(mc68kcpu) ^ m68ki_read_8((mc68kcpu), ea)); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t res = MASK_OUT_ABOVE_8(DX(mc68kcpu) ^ m68ki_read_8((mc68kcpu), ea)); m68ki_write_8((mc68kcpu), ea, res); @@ -4826,7 +4826,7 @@ M68KMAKE_OP(eor, 8, ., .) M68KMAKE_OP(eor, 16, ., d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu) ^= MASK_OUT_ABOVE_16(DX(mc68kcpu))); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu) ^= MASK_OUT_ABOVE_16(DX(mc68kcpu))); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -4837,8 +4837,8 @@ M68KMAKE_OP(eor, 16, ., d) M68KMAKE_OP(eor, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 res = MASK_OUT_ABOVE_16(DX(mc68kcpu) ^ m68ki_read_16((mc68kcpu), ea)); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t res = MASK_OUT_ABOVE_16(DX(mc68kcpu) ^ m68ki_read_16((mc68kcpu), ea)); m68ki_write_16((mc68kcpu), ea, res); @@ -4851,7 +4851,7 @@ M68KMAKE_OP(eor, 16, ., .) M68KMAKE_OP(eor, 32, ., d) { - UINT32 res = DY(mc68kcpu) ^= DX(mc68kcpu); + uint32_t res = DY(mc68kcpu) ^= DX(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -4862,8 +4862,8 @@ M68KMAKE_OP(eor, 32, ., d) M68KMAKE_OP(eor, 32, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 res = DX(mc68kcpu) ^ m68ki_read_32((mc68kcpu), ea); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t res = DX(mc68kcpu) ^ m68ki_read_32((mc68kcpu), ea); m68ki_write_32((mc68kcpu), ea, res); @@ -4876,7 +4876,7 @@ M68KMAKE_OP(eor, 32, ., .) M68KMAKE_OP(eori, 8, ., d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu) ^= OPER_I_8(mc68kcpu)); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu) ^= OPER_I_8(mc68kcpu)); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -4887,9 +4887,9 @@ M68KMAKE_OP(eori, 8, ., d) M68KMAKE_OP(eori, 8, ., .) { - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 res = src ^ m68ki_read_8((mc68kcpu), ea); + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t res = src ^ m68ki_read_8((mc68kcpu), ea); m68ki_write_8((mc68kcpu), ea, res); @@ -4902,7 +4902,7 @@ M68KMAKE_OP(eori, 8, ., .) M68KMAKE_OP(eori, 16, ., d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu) ^= OPER_I_16(mc68kcpu)); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu) ^= OPER_I_16(mc68kcpu)); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -4913,9 +4913,9 @@ M68KMAKE_OP(eori, 16, ., d) M68KMAKE_OP(eori, 16, ., .) { - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 res = src ^ m68ki_read_16((mc68kcpu), ea); + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t res = src ^ m68ki_read_16((mc68kcpu), ea); m68ki_write_16((mc68kcpu), ea, res); @@ -4928,7 +4928,7 @@ M68KMAKE_OP(eori, 16, ., .) M68KMAKE_OP(eori, 32, ., d) { - UINT32 res = DY(mc68kcpu) ^= OPER_I_32(mc68kcpu); + uint32_t res = DY(mc68kcpu) ^= OPER_I_32(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -4939,9 +4939,9 @@ M68KMAKE_OP(eori, 32, ., d) M68KMAKE_OP(eori, 32, ., .) { - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 res = src ^ m68ki_read_32((mc68kcpu), ea); + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t res = src ^ m68ki_read_32((mc68kcpu), ea); m68ki_write_32((mc68kcpu), ea, res); @@ -4962,7 +4962,7 @@ M68KMAKE_OP(eori, 16, tos, .) { if((mc68kcpu)->s_flag) { - UINT32 src = OPER_I_16(mc68kcpu); + uint32_t src = OPER_I_16(mc68kcpu); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_set_sr((mc68kcpu), m68ki_get_sr(mc68kcpu) ^ src); return; @@ -4973,9 +4973,9 @@ M68KMAKE_OP(eori, 16, tos, .) M68KMAKE_OP(exg, 32, dd, .) { - UINT32* reg_a = &DX(mc68kcpu); - UINT32* reg_b = &DY(mc68kcpu); - UINT32 tmp = *reg_a; + uint32_t* reg_a = &DX(mc68kcpu); + uint32_t* reg_b = &DY(mc68kcpu); + uint32_t tmp = *reg_a; *reg_a = *reg_b; *reg_b = tmp; } @@ -4983,9 +4983,9 @@ M68KMAKE_OP(exg, 32, dd, .) M68KMAKE_OP(exg, 32, aa, .) { - UINT32* reg_a = &AX(mc68kcpu); - UINT32* reg_b = &AY(mc68kcpu); - UINT32 tmp = *reg_a; + uint32_t* reg_a = &AX(mc68kcpu); + uint32_t* reg_b = &AY(mc68kcpu); + uint32_t tmp = *reg_a; *reg_a = *reg_b; *reg_b = tmp; } @@ -4993,9 +4993,9 @@ M68KMAKE_OP(exg, 32, aa, .) M68KMAKE_OP(exg, 32, da, .) { - UINT32* reg_a = &DX(mc68kcpu); - UINT32* reg_b = &AY(mc68kcpu); - UINT32 tmp = *reg_a; + uint32_t* reg_a = &DX(mc68kcpu); + uint32_t* reg_b = &AY(mc68kcpu); + uint32_t tmp = *reg_a; *reg_a = *reg_b; *reg_b = tmp; } @@ -5003,7 +5003,7 @@ M68KMAKE_OP(exg, 32, da, .) M68KMAKE_OP(ext, 16, ., .) { - UINT32* r_dst = &DY(mc68kcpu); + uint32_t* r_dst = &DY(mc68kcpu); *r_dst = MASK_OUT_BELOW_16(*r_dst) | MASK_OUT_ABOVE_8(*r_dst) | (GET_MSB_8(*r_dst) ? 0xff00 : 0); @@ -5016,7 +5016,7 @@ M68KMAKE_OP(ext, 16, ., .) M68KMAKE_OP(ext, 32, ., .) { - UINT32* r_dst = &DY(mc68kcpu); + uint32_t* r_dst = &DY(mc68kcpu); *r_dst = MASK_OUT_ABOVE_16(*r_dst) | (GET_MSB_16(*r_dst) ? 0xffff0000 : 0); @@ -5031,7 +5031,7 @@ M68KMAKE_OP(extb, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32* r_dst = &DY(mc68kcpu); + uint32_t* r_dst = &DY(mc68kcpu); *r_dst = MASK_OUT_ABOVE_8(*r_dst) | (GET_MSB_8(*r_dst) ? 0xffffff00 : 0); @@ -5061,7 +5061,7 @@ M68KMAKE_OP(jmp, 32, ., .) M68KMAKE_OP(jsr, 32, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; + uint32_t ea = M68KMAKE_GET_EA_AY_32; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_push_32((mc68kcpu), REG_PC(mc68kcpu)); m68ki_jump((mc68kcpu), ea); @@ -5084,7 +5084,7 @@ M68KMAKE_OP(link, 16, ., a7) M68KMAKE_OP(link, 16, ., .) { - UINT32* r_dst = &AY(mc68kcpu); + uint32_t* r_dst = &AY(mc68kcpu); m68ki_push_32((mc68kcpu), *r_dst); *r_dst = REG_A(mc68kcpu)[7]; @@ -5109,7 +5109,7 @@ M68KMAKE_OP(link, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32* r_dst = &AY(mc68kcpu); + uint32_t* r_dst = &AY(mc68kcpu); m68ki_push_32((mc68kcpu), *r_dst); *r_dst = REG_A(mc68kcpu)[7]; @@ -5122,10 +5122,10 @@ M68KMAKE_OP(link, 32, ., .) M68KMAKE_OP(lsr, 8, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = src >> shift; if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -5141,10 +5141,10 @@ M68KMAKE_OP(lsr, 8, s, .) M68KMAKE_OP(lsr, 16, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src >> shift; if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -5160,10 +5160,10 @@ M68KMAKE_OP(lsr, 16, s, .) M68KMAKE_OP(lsr, 32, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = *r_dst; - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = *r_dst; + uint32_t res = src >> shift; if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -5179,10 +5179,10 @@ M68KMAKE_OP(lsr, 32, s, .) M68KMAKE_OP(lsr, 8, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = src >> shift; if(shift != 0) { @@ -5216,10 +5216,10 @@ M68KMAKE_OP(lsr, 8, r, .) M68KMAKE_OP(lsr, 16, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = src >> shift; if(shift != 0) { @@ -5253,10 +5253,10 @@ M68KMAKE_OP(lsr, 16, r, .) M68KMAKE_OP(lsr, 32, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = *r_dst; - UINT32 res = src >> shift; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = *r_dst; + uint32_t res = src >> shift; if(shift != 0) { @@ -5289,9 +5289,9 @@ M68KMAKE_OP(lsr, 32, r, .) M68KMAKE_OP(lsr, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = src >> 1; + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = src >> 1; m68ki_write_16((mc68kcpu), ea, res); @@ -5304,10 +5304,10 @@ M68KMAKE_OP(lsr, 16, ., .) M68KMAKE_OP(lsl, 8, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = MASK_OUT_ABOVE_8(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = MASK_OUT_ABOVE_8(src << shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -5323,10 +5323,10 @@ M68KMAKE_OP(lsl, 8, s, .) M68KMAKE_OP(lsl, 16, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = MASK_OUT_ABOVE_16(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = MASK_OUT_ABOVE_16(src << shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -5342,10 +5342,10 @@ M68KMAKE_OP(lsl, 16, s, .) M68KMAKE_OP(lsl, 32, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = *r_dst; - UINT32 res = MASK_OUT_ABOVE_32(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = *r_dst; + uint32_t res = MASK_OUT_ABOVE_32(src << shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -5361,10 +5361,10 @@ M68KMAKE_OP(lsl, 32, s, .) M68KMAKE_OP(lsl, 8, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = MASK_OUT_ABOVE_8(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = MASK_OUT_ABOVE_8(src << shift); if(shift != 0) { @@ -5398,10 +5398,10 @@ M68KMAKE_OP(lsl, 8, r, .) M68KMAKE_OP(lsl, 16, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = MASK_OUT_ABOVE_16(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = MASK_OUT_ABOVE_16(src << shift); if(shift != 0) { @@ -5435,10 +5435,10 @@ M68KMAKE_OP(lsl, 16, r, .) M68KMAKE_OP(lsl, 32, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = DX(mc68kcpu) & 0x3f; - UINT32 src = *r_dst; - UINT32 res = MASK_OUT_ABOVE_32(src << shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = DX(mc68kcpu) & 0x3f; + uint32_t src = *r_dst; + uint32_t res = MASK_OUT_ABOVE_32(src << shift); if(shift != 0) { @@ -5471,9 +5471,9 @@ M68KMAKE_OP(lsl, 32, r, .) M68KMAKE_OP(lsl, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = MASK_OUT_ABOVE_16(src << 1); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = MASK_OUT_ABOVE_16(src << 1); m68ki_write_16((mc68kcpu), ea, res); @@ -5486,8 +5486,8 @@ M68KMAKE_OP(lsl, 16, ., .) M68KMAKE_OP(move, 8, d, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32* r_dst = &DX(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; @@ -5500,8 +5500,8 @@ M68KMAKE_OP(move, 8, d, d) M68KMAKE_OP(move, 8, d, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32* r_dst = &DX(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; @@ -5514,8 +5514,8 @@ M68KMAKE_OP(move, 8, d, .) M68KMAKE_OP(move, 8, ai, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 ea = EA_AX_AI_8(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t ea = EA_AX_AI_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5528,8 +5528,8 @@ M68KMAKE_OP(move, 8, ai, d) M68KMAKE_OP(move, 8, ai, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32 ea = EA_AX_AI_8(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t ea = EA_AX_AI_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5542,8 +5542,8 @@ M68KMAKE_OP(move, 8, ai, .) M68KMAKE_OP(move, 8, pi7, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 ea = EA_A7_PI_8(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t ea = EA_A7_PI_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5556,8 +5556,8 @@ M68KMAKE_OP(move, 8, pi7, d) M68KMAKE_OP(move, 8, pi, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 ea = EA_AX_PI_8(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t ea = EA_AX_PI_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5570,8 +5570,8 @@ M68KMAKE_OP(move, 8, pi, d) M68KMAKE_OP(move, 8, pi7, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32 ea = EA_A7_PI_8(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t ea = EA_A7_PI_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5584,8 +5584,8 @@ M68KMAKE_OP(move, 8, pi7, .) M68KMAKE_OP(move, 8, pi, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32 ea = EA_AX_PI_8(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t ea = EA_AX_PI_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5598,8 +5598,8 @@ M68KMAKE_OP(move, 8, pi, .) M68KMAKE_OP(move, 8, pd7, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 ea = EA_A7_PD_8(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t ea = EA_A7_PD_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5612,8 +5612,8 @@ M68KMAKE_OP(move, 8, pd7, d) M68KMAKE_OP(move, 8, pd, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 ea = EA_AX_PD_8(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t ea = EA_AX_PD_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5626,8 +5626,8 @@ M68KMAKE_OP(move, 8, pd, d) M68KMAKE_OP(move, 8, pd7, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32 ea = EA_A7_PD_8(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t ea = EA_A7_PD_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5640,8 +5640,8 @@ M68KMAKE_OP(move, 8, pd7, .) M68KMAKE_OP(move, 8, pd, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32 ea = EA_AX_PD_8(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t ea = EA_AX_PD_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5654,8 +5654,8 @@ M68KMAKE_OP(move, 8, pd, .) M68KMAKE_OP(move, 8, di, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 ea = EA_AX_DI_8(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t ea = EA_AX_DI_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5668,8 +5668,8 @@ M68KMAKE_OP(move, 8, di, d) M68KMAKE_OP(move, 8, di, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32 ea = EA_AX_DI_8(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t ea = EA_AX_DI_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5682,8 +5682,8 @@ M68KMAKE_OP(move, 8, di, .) M68KMAKE_OP(move, 8, ix, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 ea = EA_AX_IX_8(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t ea = EA_AX_IX_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5696,8 +5696,8 @@ M68KMAKE_OP(move, 8, ix, d) M68KMAKE_OP(move, 8, ix, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32 ea = EA_AX_IX_8(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t ea = EA_AX_IX_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5710,8 +5710,8 @@ M68KMAKE_OP(move, 8, ix, .) M68KMAKE_OP(move, 8, aw, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 ea = EA_AW_8(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t ea = EA_AW_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5724,8 +5724,8 @@ M68KMAKE_OP(move, 8, aw, d) M68KMAKE_OP(move, 8, aw, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32 ea = EA_AW_8(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t ea = EA_AW_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5738,8 +5738,8 @@ M68KMAKE_OP(move, 8, aw, .) M68KMAKE_OP(move, 8, al, d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 ea = EA_AL_8(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t ea = EA_AL_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5752,8 +5752,8 @@ M68KMAKE_OP(move, 8, al, d) M68KMAKE_OP(move, 8, al, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; - UINT32 ea = EA_AL_8(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_8; + uint32_t ea = EA_AL_8(mc68kcpu); m68ki_write_8((mc68kcpu), ea, res); @@ -5766,8 +5766,8 @@ M68KMAKE_OP(move, 8, al, .) M68KMAKE_OP(move, 16, d, d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32* r_dst = &DX(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; @@ -5780,8 +5780,8 @@ M68KMAKE_OP(move, 16, d, d) M68KMAKE_OP(move, 16, d, a) { - UINT32 res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32* r_dst = &DX(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; @@ -5794,8 +5794,8 @@ M68KMAKE_OP(move, 16, d, a) M68KMAKE_OP(move, 16, d, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_16; - UINT32* r_dst = &DX(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_16; + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; @@ -5808,8 +5808,8 @@ M68KMAKE_OP(move, 16, d, .) M68KMAKE_OP(move, 16, ai, d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 ea = EA_AX_AI_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t ea = EA_AX_AI_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5822,8 +5822,8 @@ M68KMAKE_OP(move, 16, ai, d) M68KMAKE_OP(move, 16, ai, a) { - UINT32 res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 ea = EA_AX_AI_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t ea = EA_AX_AI_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5836,8 +5836,8 @@ M68KMAKE_OP(move, 16, ai, a) M68KMAKE_OP(move, 16, ai, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_16; - UINT32 ea = EA_AX_AI_16(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_16; + uint32_t ea = EA_AX_AI_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5850,8 +5850,8 @@ M68KMAKE_OP(move, 16, ai, .) M68KMAKE_OP(move, 16, pi, d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 ea = EA_AX_PI_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t ea = EA_AX_PI_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5864,8 +5864,8 @@ M68KMAKE_OP(move, 16, pi, d) M68KMAKE_OP(move, 16, pi, a) { - UINT32 res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 ea = EA_AX_PI_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t ea = EA_AX_PI_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5878,8 +5878,8 @@ M68KMAKE_OP(move, 16, pi, a) M68KMAKE_OP(move, 16, pi, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_16; - UINT32 ea = EA_AX_PI_16(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_16; + uint32_t ea = EA_AX_PI_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5892,8 +5892,8 @@ M68KMAKE_OP(move, 16, pi, .) M68KMAKE_OP(move, 16, pd, d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 ea = EA_AX_PD_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t ea = EA_AX_PD_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5906,8 +5906,8 @@ M68KMAKE_OP(move, 16, pd, d) M68KMAKE_OP(move, 16, pd, a) { - UINT32 res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 ea = EA_AX_PD_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t ea = EA_AX_PD_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5920,8 +5920,8 @@ M68KMAKE_OP(move, 16, pd, a) M68KMAKE_OP(move, 16, pd, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_16; - UINT32 ea = EA_AX_PD_16(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_16; + uint32_t ea = EA_AX_PD_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5934,8 +5934,8 @@ M68KMAKE_OP(move, 16, pd, .) M68KMAKE_OP(move, 16, di, d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 ea = EA_AX_DI_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t ea = EA_AX_DI_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5948,8 +5948,8 @@ M68KMAKE_OP(move, 16, di, d) M68KMAKE_OP(move, 16, di, a) { - UINT32 res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 ea = EA_AX_DI_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t ea = EA_AX_DI_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5962,8 +5962,8 @@ M68KMAKE_OP(move, 16, di, a) M68KMAKE_OP(move, 16, di, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_16; - UINT32 ea = EA_AX_DI_16(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_16; + uint32_t ea = EA_AX_DI_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5976,8 +5976,8 @@ M68KMAKE_OP(move, 16, di, .) M68KMAKE_OP(move, 16, ix, d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 ea = EA_AX_IX_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t ea = EA_AX_IX_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -5990,8 +5990,8 @@ M68KMAKE_OP(move, 16, ix, d) M68KMAKE_OP(move, 16, ix, a) { - UINT32 res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 ea = EA_AX_IX_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t ea = EA_AX_IX_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -6004,8 +6004,8 @@ M68KMAKE_OP(move, 16, ix, a) M68KMAKE_OP(move, 16, ix, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_16; - UINT32 ea = EA_AX_IX_16(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_16; + uint32_t ea = EA_AX_IX_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -6018,8 +6018,8 @@ M68KMAKE_OP(move, 16, ix, .) M68KMAKE_OP(move, 16, aw, d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 ea = EA_AW_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t ea = EA_AW_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -6032,8 +6032,8 @@ M68KMAKE_OP(move, 16, aw, d) M68KMAKE_OP(move, 16, aw, a) { - UINT32 res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 ea = EA_AW_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t ea = EA_AW_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -6046,8 +6046,8 @@ M68KMAKE_OP(move, 16, aw, a) M68KMAKE_OP(move, 16, aw, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_16; - UINT32 ea = EA_AW_16(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_16; + uint32_t ea = EA_AW_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -6060,8 +6060,8 @@ M68KMAKE_OP(move, 16, aw, .) M68KMAKE_OP(move, 16, al, d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 ea = EA_AL_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t ea = EA_AL_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -6074,8 +6074,8 @@ M68KMAKE_OP(move, 16, al, d) M68KMAKE_OP(move, 16, al, a) { - UINT32 res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 ea = EA_AL_16(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t ea = EA_AL_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -6088,8 +6088,8 @@ M68KMAKE_OP(move, 16, al, a) M68KMAKE_OP(move, 16, al, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_16; - UINT32 ea = EA_AL_16(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_16; + uint32_t ea = EA_AL_16(mc68kcpu); m68ki_write_16((mc68kcpu), ea, res); @@ -6102,8 +6102,8 @@ M68KMAKE_OP(move, 16, al, .) M68KMAKE_OP(move, 32, d, d) { - UINT32 res = DY(mc68kcpu); - UINT32* r_dst = &DX(mc68kcpu); + uint32_t res = DY(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = res; @@ -6116,8 +6116,8 @@ M68KMAKE_OP(move, 32, d, d) M68KMAKE_OP(move, 32, d, a) { - UINT32 res = AY(mc68kcpu); - UINT32* r_dst = &DX(mc68kcpu); + uint32_t res = AY(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = res; @@ -6130,8 +6130,8 @@ M68KMAKE_OP(move, 32, d, a) M68KMAKE_OP(move, 32, d, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_32; - UINT32* r_dst = &DX(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_32; + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = res; @@ -6144,8 +6144,8 @@ M68KMAKE_OP(move, 32, d, .) M68KMAKE_OP(move, 32, ai, d) { - UINT32 res = DY(mc68kcpu); - UINT32 ea = EA_AX_AI_32(mc68kcpu); + uint32_t res = DY(mc68kcpu); + uint32_t ea = EA_AX_AI_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6158,8 +6158,8 @@ M68KMAKE_OP(move, 32, ai, d) M68KMAKE_OP(move, 32, ai, a) { - UINT32 res = AY(mc68kcpu); - UINT32 ea = EA_AX_AI_32(mc68kcpu); + uint32_t res = AY(mc68kcpu); + uint32_t ea = EA_AX_AI_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6172,8 +6172,8 @@ M68KMAKE_OP(move, 32, ai, a) M68KMAKE_OP(move, 32, ai, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_32; - UINT32 ea = EA_AX_AI_32(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_32; + uint32_t ea = EA_AX_AI_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6186,8 +6186,8 @@ M68KMAKE_OP(move, 32, ai, .) M68KMAKE_OP(move, 32, pi, d) { - UINT32 res = DY(mc68kcpu); - UINT32 ea = EA_AX_PI_32(mc68kcpu); + uint32_t res = DY(mc68kcpu); + uint32_t ea = EA_AX_PI_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6200,8 +6200,8 @@ M68KMAKE_OP(move, 32, pi, d) M68KMAKE_OP(move, 32, pi, a) { - UINT32 res = AY(mc68kcpu); - UINT32 ea = EA_AX_PI_32(mc68kcpu); + uint32_t res = AY(mc68kcpu); + uint32_t ea = EA_AX_PI_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6214,8 +6214,8 @@ M68KMAKE_OP(move, 32, pi, a) M68KMAKE_OP(move, 32, pi, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_32; - UINT32 ea = EA_AX_PI_32(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_32; + uint32_t ea = EA_AX_PI_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6228,8 +6228,8 @@ M68KMAKE_OP(move, 32, pi, .) M68KMAKE_OP(move, 32, pd, d) { - UINT32 res = DY(mc68kcpu); - UINT32 ea = EA_AX_PD_32(mc68kcpu); + uint32_t res = DY(mc68kcpu); + uint32_t ea = EA_AX_PD_32(mc68kcpu); m68ki_write_16((mc68kcpu), ea+2, res & 0xFFFF ); m68ki_write_16((mc68kcpu), ea, (res >> 16) & 0xFFFF ); @@ -6243,8 +6243,8 @@ M68KMAKE_OP(move, 32, pd, d) M68KMAKE_OP(move, 32, pd, a) { - UINT32 res = AY(mc68kcpu); - UINT32 ea = EA_AX_PD_32(mc68kcpu); + uint32_t res = AY(mc68kcpu); + uint32_t ea = EA_AX_PD_32(mc68kcpu); m68ki_write_16((mc68kcpu), ea+2, res & 0xFFFF ); m68ki_write_16((mc68kcpu), ea, (res >> 16) & 0xFFFF ); @@ -6258,8 +6258,8 @@ M68KMAKE_OP(move, 32, pd, a) M68KMAKE_OP(move, 32, pd, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_32; - UINT32 ea = EA_AX_PD_32(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_32; + uint32_t ea = EA_AX_PD_32(mc68kcpu); m68ki_write_16((mc68kcpu), ea+2, res & 0xFFFF ); m68ki_write_16((mc68kcpu), ea, (res >> 16) & 0xFFFF ); @@ -6273,8 +6273,8 @@ M68KMAKE_OP(move, 32, pd, .) M68KMAKE_OP(move, 32, di, d) { - UINT32 res = DY(mc68kcpu); - UINT32 ea = EA_AX_DI_32(mc68kcpu); + uint32_t res = DY(mc68kcpu); + uint32_t ea = EA_AX_DI_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6287,8 +6287,8 @@ M68KMAKE_OP(move, 32, di, d) M68KMAKE_OP(move, 32, di, a) { - UINT32 res = AY(mc68kcpu); - UINT32 ea = EA_AX_DI_32(mc68kcpu); + uint32_t res = AY(mc68kcpu); + uint32_t ea = EA_AX_DI_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6301,8 +6301,8 @@ M68KMAKE_OP(move, 32, di, a) M68KMAKE_OP(move, 32, di, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_32; - UINT32 ea = EA_AX_DI_32(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_32; + uint32_t ea = EA_AX_DI_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6315,8 +6315,8 @@ M68KMAKE_OP(move, 32, di, .) M68KMAKE_OP(move, 32, ix, d) { - UINT32 res = DY(mc68kcpu); - UINT32 ea = EA_AX_IX_32(mc68kcpu); + uint32_t res = DY(mc68kcpu); + uint32_t ea = EA_AX_IX_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6329,8 +6329,8 @@ M68KMAKE_OP(move, 32, ix, d) M68KMAKE_OP(move, 32, ix, a) { - UINT32 res = AY(mc68kcpu); - UINT32 ea = EA_AX_IX_32(mc68kcpu); + uint32_t res = AY(mc68kcpu); + uint32_t ea = EA_AX_IX_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6343,8 +6343,8 @@ M68KMAKE_OP(move, 32, ix, a) M68KMAKE_OP(move, 32, ix, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_32; - UINT32 ea = EA_AX_IX_32(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_32; + uint32_t ea = EA_AX_IX_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6357,8 +6357,8 @@ M68KMAKE_OP(move, 32, ix, .) M68KMAKE_OP(move, 32, aw, d) { - UINT32 res = DY(mc68kcpu); - UINT32 ea = EA_AW_32(mc68kcpu); + uint32_t res = DY(mc68kcpu); + uint32_t ea = EA_AW_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6371,8 +6371,8 @@ M68KMAKE_OP(move, 32, aw, d) M68KMAKE_OP(move, 32, aw, a) { - UINT32 res = AY(mc68kcpu); - UINT32 ea = EA_AW_32(mc68kcpu); + uint32_t res = AY(mc68kcpu); + uint32_t ea = EA_AW_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6385,8 +6385,8 @@ M68KMAKE_OP(move, 32, aw, a) M68KMAKE_OP(move, 32, aw, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_32; - UINT32 ea = EA_AW_32(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_32; + uint32_t ea = EA_AW_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6399,8 +6399,8 @@ M68KMAKE_OP(move, 32, aw, .) M68KMAKE_OP(move, 32, al, d) { - UINT32 res = DY(mc68kcpu); - UINT32 ea = EA_AL_32(mc68kcpu); + uint32_t res = DY(mc68kcpu); + uint32_t ea = EA_AL_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6413,8 +6413,8 @@ M68KMAKE_OP(move, 32, al, d) M68KMAKE_OP(move, 32, al, a) { - UINT32 res = AY(mc68kcpu); - UINT32 ea = EA_AL_32(mc68kcpu); + uint32_t res = AY(mc68kcpu); + uint32_t ea = EA_AL_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6427,8 +6427,8 @@ M68KMAKE_OP(move, 32, al, a) M68KMAKE_OP(move, 32, al, .) { - UINT32 res = M68KMAKE_GET_OPER_AY_32; - UINT32 ea = EA_AL_32(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_32; + uint32_t ea = EA_AL_32(mc68kcpu); m68ki_write_32((mc68kcpu), ea, res); @@ -6524,7 +6524,7 @@ M68KMAKE_OP(move, 16, frs, .) { if(CPU_TYPE_IS_000((mc68kcpu)->cpu_type) || (mc68kcpu)->s_flag) /* NS990408 */ { - UINT32 ea = M68KMAKE_GET_EA_AY_16; + uint32_t ea = M68KMAKE_GET_EA_AY_16; m68ki_write_16((mc68kcpu), ea, m68ki_get_sr(mc68kcpu)); return; } @@ -6547,7 +6547,7 @@ M68KMAKE_OP(move, 16, tos, .) { if((mc68kcpu)->s_flag) { - UINT32 new_sr = M68KMAKE_GET_OPER_AY_16; + uint32_t new_sr = M68KMAKE_GET_OPER_AY_16; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_set_sr((mc68kcpu), new_sr); return; @@ -6585,7 +6585,7 @@ M68KMAKE_OP(movec, 32, cr, .) { if((mc68kcpu)->s_flag) { - UINT32 word2 = OPER_I_16(mc68kcpu); + uint32_t word2 = OPER_I_16(mc68kcpu); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ switch (word2 & 0xfff) @@ -6799,7 +6799,7 @@ M68KMAKE_OP(movec, 32, rc, .) { if((mc68kcpu)->s_flag) { - UINT32 word2 = OPER_I_16(mc68kcpu); + uint32_t word2 = OPER_I_16(mc68kcpu); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ switch (word2 & 0xfff) @@ -7049,10 +7049,10 @@ M68KMAKE_OP(movec, 32, rc, .) M68KMAKE_OP(movem, 16, re, pd) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = AY(mc68kcpu); - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = AY(mc68kcpu); + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7069,10 +7069,10 @@ M68KMAKE_OP(movem, 16, re, pd) M68KMAKE_OP(movem, 16, re, .) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7088,10 +7088,10 @@ M68KMAKE_OP(movem, 16, re, .) M68KMAKE_OP(movem, 32, re, pd) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = AY(mc68kcpu); - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = AY(mc68kcpu); + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7109,10 +7109,10 @@ M68KMAKE_OP(movem, 32, re, pd) M68KMAKE_OP(movem, 32, re, .) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7128,10 +7128,10 @@ M68KMAKE_OP(movem, 32, re, .) M68KMAKE_OP(movem, 16, er, pi) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = AY(mc68kcpu); - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = AY(mc68kcpu); + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7148,10 +7148,10 @@ M68KMAKE_OP(movem, 16, er, pi) M68KMAKE_OP(movem, 16, er, pcdi) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = EA_PCDI_16(mc68kcpu); - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = EA_PCDI_16(mc68kcpu); + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7167,10 +7167,10 @@ M68KMAKE_OP(movem, 16, er, pcdi) M68KMAKE_OP(movem, 16, er, pcix) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = EA_PCIX_16(mc68kcpu); - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = EA_PCIX_16(mc68kcpu); + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7186,10 +7186,10 @@ M68KMAKE_OP(movem, 16, er, pcix) M68KMAKE_OP(movem, 16, er, .) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7205,10 +7205,10 @@ M68KMAKE_OP(movem, 16, er, .) M68KMAKE_OP(movem, 32, er, pi) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = AY(mc68kcpu); - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = AY(mc68kcpu); + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7225,10 +7225,10 @@ M68KMAKE_OP(movem, 32, er, pi) M68KMAKE_OP(movem, 32, er, pcdi) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = EA_PCDI_32(mc68kcpu); - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = EA_PCDI_32(mc68kcpu); + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7244,10 +7244,10 @@ M68KMAKE_OP(movem, 32, er, pcdi) M68KMAKE_OP(movem, 32, er, pcix) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = EA_PCIX_32(mc68kcpu); - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = EA_PCIX_32(mc68kcpu); + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7263,10 +7263,10 @@ M68KMAKE_OP(movem, 32, er, pcix) M68KMAKE_OP(movem, 32, er, .) { - UINT32 i = 0; - UINT32 register_list = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 count = 0; + uint32_t i = 0; + uint32_t register_list = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t count = 0; for(; i < 16; i++) if(register_list & (1 << i)) @@ -7282,8 +7282,8 @@ M68KMAKE_OP(movem, 32, er, .) M68KMAKE_OP(movep, 16, re, .) { - UINT32 ea = EA_AY_DI_16(mc68kcpu); - UINT32 src = DX(mc68kcpu); + uint32_t ea = EA_AY_DI_16(mc68kcpu); + uint32_t src = DX(mc68kcpu); m68ki_write_8((mc68kcpu), ea, MASK_OUT_ABOVE_8(src >> 8)); m68ki_write_8((mc68kcpu), ea += 2, MASK_OUT_ABOVE_8(src)); @@ -7292,8 +7292,8 @@ M68KMAKE_OP(movep, 16, re, .) M68KMAKE_OP(movep, 32, re, .) { - UINT32 ea = EA_AY_DI_32(mc68kcpu); - UINT32 src = DX(mc68kcpu); + uint32_t ea = EA_AY_DI_32(mc68kcpu); + uint32_t src = DX(mc68kcpu); m68ki_write_8((mc68kcpu), ea, MASK_OUT_ABOVE_8(src >> 24)); m68ki_write_8((mc68kcpu), ea += 2, MASK_OUT_ABOVE_8(src >> 16)); @@ -7304,8 +7304,8 @@ M68KMAKE_OP(movep, 32, re, .) M68KMAKE_OP(movep, 16, er, .) { - UINT32 ea = EA_AY_DI_16(mc68kcpu); - UINT32* r_dst = &DX(mc68kcpu); + uint32_t ea = EA_AY_DI_16(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = MASK_OUT_BELOW_16(*r_dst) | ((m68ki_read_8((mc68kcpu), ea) << 8) + m68ki_read_8((mc68kcpu), ea + 2)); } @@ -7313,7 +7313,7 @@ M68KMAKE_OP(movep, 16, er, .) M68KMAKE_OP(movep, 32, er, .) { - UINT32 ea = EA_AY_DI_32(mc68kcpu); + uint32_t ea = EA_AY_DI_32(mc68kcpu); DX(mc68kcpu) = (m68ki_read_8((mc68kcpu), ea) << 24) + (m68ki_read_8((mc68kcpu), ea + 2) << 16) + (m68ki_read_8((mc68kcpu), ea + 4) << 8) + m68ki_read_8((mc68kcpu), ea + 6); @@ -7326,8 +7326,8 @@ M68KMAKE_OP(moves, 8, ., .) { if((mc68kcpu)->s_flag) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_8; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_8; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ if(BIT_B(word2)) /* Register to memory */ @@ -7361,8 +7361,8 @@ M68KMAKE_OP(moves, 16, ., .) { if((mc68kcpu)->s_flag) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_16; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ if(BIT_B(word2)) /* Register to memory */ @@ -7396,8 +7396,8 @@ M68KMAKE_OP(moves, 32, ., .) { if((mc68kcpu)->s_flag) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_32; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ if(BIT_B(word2)) /* Register to memory */ @@ -7422,7 +7422,7 @@ M68KMAKE_OP(moves, 32, ., .) M68KMAKE_OP(moveq, 32, ., .) { - UINT32 res = DX(mc68kcpu) = MAKE_INT_8(MASK_OUT_ABOVE_8((mc68kcpu)->ir)); + uint32_t res = DX(mc68kcpu) = MAKE_INT_8(MASK_OUT_ABOVE_8((mc68kcpu)->ir)); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -7433,7 +7433,7 @@ M68KMAKE_OP(moveq, 32, ., .) M68KMAKE_OP(move16, 32, ., .) { - UINT16 w2 = OPER_I_16(mc68kcpu); + uint16_t w2 = OPER_I_16(mc68kcpu); int ax = (mc68kcpu)->ir & 7; int ay = (w2 >> 12) & 7; m68ki_write_32((mc68kcpu), REG_A(mc68kcpu)[ay], m68ki_read_32((mc68kcpu), REG_A(mc68kcpu)[ax])); @@ -7448,8 +7448,8 @@ M68KMAKE_OP(move16, 32, ., .) M68KMAKE_OP(muls, 16, ., d) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 res = MASK_OUT_ABOVE_32(MAKE_INT_16(DY(mc68kcpu)) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_32(MAKE_INT_16(DY(mc68kcpu)) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); *r_dst = res; @@ -7462,8 +7462,8 @@ M68KMAKE_OP(muls, 16, ., d) M68KMAKE_OP(muls, 16, ., .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 res = MASK_OUT_ABOVE_32(MAKE_INT_16(M68KMAKE_GET_OPER_AY_16) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_32(MAKE_INT_16(M68KMAKE_GET_OPER_AY_16) * MAKE_INT_16(MASK_OUT_ABOVE_16(*r_dst))); *r_dst = res; @@ -7476,8 +7476,8 @@ M68KMAKE_OP(muls, 16, ., .) M68KMAKE_OP(mulu, 16, ., d) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)) * MASK_OUT_ABOVE_16(*r_dst); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)) * MASK_OUT_ABOVE_16(*r_dst); *r_dst = res; @@ -7490,8 +7490,8 @@ M68KMAKE_OP(mulu, 16, ., d) M68KMAKE_OP(mulu, 16, ., .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 res = M68KMAKE_GET_OPER_AY_16 * MASK_OUT_ABOVE_16(*r_dst); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t res = M68KMAKE_GET_OPER_AY_16 * MASK_OUT_ABOVE_16(*r_dst); *r_dst = res; @@ -7506,21 +7506,21 @@ M68KMAKE_OP(mull, 32, ., d) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT64 src = DY(mc68kcpu); - UINT64 dst = REG_D(mc68kcpu)[(word2 >> 12) & 7]; - UINT64 res; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint64_t src = DY(mc68kcpu); + uint64_t dst = REG_D(mc68kcpu)[(word2 >> 12) & 7]; + uint64_t res; (mc68kcpu)->c_flag = CFLAG_CLEAR; if(BIT_B(word2)) /* signed */ { - res = (INT64)((INT32)src) * (INT64)((INT32)dst); + res = (int64_t)((int32_t)src) * (int64_t)((int32_t)dst); if(!BIT_A(word2)) { (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); (mc68kcpu)->n_flag = NFLAG_32(res); - (mc68kcpu)->v_flag = ((INT64)res != (INT32)res)<<7; + (mc68kcpu)->v_flag = ((int64_t)res != (int32_t)res)<<7; REG_D(mc68kcpu)[(word2 >> 12) & 7] = (mc68kcpu)->not_z_flag; return; } @@ -7556,21 +7556,21 @@ M68KMAKE_OP(mull, 32, ., .) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 word2 = OPER_I_16(mc68kcpu); - UINT64 src = M68KMAKE_GET_OPER_AY_32; - UINT64 dst = REG_D(mc68kcpu)[(word2 >> 12) & 7]; - UINT64 res; + uint32_t word2 = OPER_I_16(mc68kcpu); + uint64_t src = M68KMAKE_GET_OPER_AY_32; + uint64_t dst = REG_D(mc68kcpu)[(word2 >> 12) & 7]; + uint64_t res; (mc68kcpu)->c_flag = CFLAG_CLEAR; if(BIT_B(word2)) /* signed */ { - res = (INT64)((INT32)src) * (INT64)((INT32)dst); + res = (int64_t)((int32_t)src) * (int64_t)((int32_t)dst); if(!BIT_A(word2)) { (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); (mc68kcpu)->n_flag = NFLAG_32(res); - (mc68kcpu)->v_flag = ((INT64)res != (INT32)res)<<7; + (mc68kcpu)->v_flag = ((int64_t)res != (int32_t)res)<<7; REG_D(mc68kcpu)[(word2 >> 12) & 7] = (mc68kcpu)->not_z_flag; return; } @@ -7604,9 +7604,9 @@ M68KMAKE_OP(mull, 32, ., .) M68KMAKE_OP(nbcd, 8, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1(mc68kcpu)); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1(mc68kcpu)); if(res != 0x9a) { @@ -7637,9 +7637,9 @@ M68KMAKE_OP(nbcd, 8, ., d) M68KMAKE_OP(nbcd, 8, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1(mc68kcpu)); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1(mc68kcpu)); if(res != 0x9a) { @@ -7670,8 +7670,8 @@ M68KMAKE_OP(nbcd, 8, ., .) M68KMAKE_OP(neg, 8, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = 0 - MASK_OUT_ABOVE_8(*r_dst); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = 0 - MASK_OUT_ABOVE_8(*r_dst); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->c_flag = (mc68kcpu)->x_flag = CFLAG_8(res); @@ -7684,9 +7684,9 @@ M68KMAKE_OP(neg, 8, ., d) M68KMAKE_OP(neg, 8, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = m68ki_read_8((mc68kcpu), ea); - UINT32 res = 0 - src; + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = m68ki_read_8((mc68kcpu), ea); + uint32_t res = 0 - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->c_flag = (mc68kcpu)->x_flag = CFLAG_8(res); @@ -7699,8 +7699,8 @@ M68KMAKE_OP(neg, 8, ., .) M68KMAKE_OP(neg, 16, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = 0 - MASK_OUT_ABOVE_16(*r_dst); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = 0 - MASK_OUT_ABOVE_16(*r_dst); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->c_flag = (mc68kcpu)->x_flag = CFLAG_16(res); @@ -7713,9 +7713,9 @@ M68KMAKE_OP(neg, 16, ., d) M68KMAKE_OP(neg, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = 0 - src; + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = 0 - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->c_flag = (mc68kcpu)->x_flag = CFLAG_16(res); @@ -7728,8 +7728,8 @@ M68KMAKE_OP(neg, 16, ., .) M68KMAKE_OP(neg, 32, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = 0 - *r_dst; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = 0 - *r_dst; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->c_flag = (mc68kcpu)->x_flag = CFLAG_SUB_32(*r_dst, 0, res); @@ -7742,9 +7742,9 @@ M68KMAKE_OP(neg, 32, ., d) M68KMAKE_OP(neg, 32, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 src = m68ki_read_32((mc68kcpu), ea); - UINT32 res = 0 - src; + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t src = m68ki_read_32((mc68kcpu), ea); + uint32_t res = 0 - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->c_flag = (mc68kcpu)->x_flag = CFLAG_SUB_32(src, 0, res); @@ -7757,8 +7757,8 @@ M68KMAKE_OP(neg, 32, ., .) M68KMAKE_OP(negx, 8, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = 0 - MASK_OUT_ABOVE_8(*r_dst) - XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = 0 - MASK_OUT_ABOVE_8(*r_dst) - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_8(res); @@ -7773,9 +7773,9 @@ M68KMAKE_OP(negx, 8, ., d) M68KMAKE_OP(negx, 8, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = m68ki_read_8((mc68kcpu), ea); - UINT32 res = 0 - src - XFLAG_AS_1(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = m68ki_read_8((mc68kcpu), ea); + uint32_t res = 0 - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_8(res); @@ -7790,8 +7790,8 @@ M68KMAKE_OP(negx, 8, ., .) M68KMAKE_OP(negx, 16, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = 0 - MASK_OUT_ABOVE_16(*r_dst) - XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = 0 - MASK_OUT_ABOVE_16(*r_dst) - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_16(res); @@ -7806,9 +7806,9 @@ M68KMAKE_OP(negx, 16, ., d) M68KMAKE_OP(negx, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_16(res); @@ -7823,8 +7823,8 @@ M68KMAKE_OP(negx, 16, ., .) M68KMAKE_OP(negx, 32, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = 0 - MASK_OUT_ABOVE_32(*r_dst) - XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = 0 - MASK_OUT_ABOVE_32(*r_dst) - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_SUB_32(*r_dst, 0, res); @@ -7839,9 +7839,9 @@ M68KMAKE_OP(negx, 32, ., d) M68KMAKE_OP(negx, 32, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 src = m68ki_read_32((mc68kcpu), ea); - UINT32 res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t src = m68ki_read_32((mc68kcpu), ea); + uint32_t res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_SUB_32(src, 0, res); @@ -7862,8 +7862,8 @@ M68KMAKE_OP(nop, 0, ., .) M68KMAKE_OP(not, 8, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = MASK_OUT_ABOVE_8(~*r_dst); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_8(~*r_dst); *r_dst = MASK_OUT_BELOW_8(*r_dst) | res; @@ -7876,8 +7876,8 @@ M68KMAKE_OP(not, 8, ., d) M68KMAKE_OP(not, 8, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 res = MASK_OUT_ABOVE_8(~m68ki_read_8((mc68kcpu), ea)); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t res = MASK_OUT_ABOVE_8(~m68ki_read_8((mc68kcpu), ea)); m68ki_write_8((mc68kcpu), ea, res); @@ -7890,8 +7890,8 @@ M68KMAKE_OP(not, 8, ., .) M68KMAKE_OP(not, 16, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = MASK_OUT_ABOVE_16(~*r_dst); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = MASK_OUT_ABOVE_16(~*r_dst); *r_dst = MASK_OUT_BELOW_16(*r_dst) | res; @@ -7904,8 +7904,8 @@ M68KMAKE_OP(not, 16, ., d) M68KMAKE_OP(not, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 res = MASK_OUT_ABOVE_16(~m68ki_read_16((mc68kcpu), ea)); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t res = MASK_OUT_ABOVE_16(~m68ki_read_16((mc68kcpu), ea)); m68ki_write_16((mc68kcpu), ea, res); @@ -7918,8 +7918,8 @@ M68KMAKE_OP(not, 16, ., .) M68KMAKE_OP(not, 32, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 res = *r_dst = MASK_OUT_ABOVE_32(~*r_dst); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t res = *r_dst = MASK_OUT_ABOVE_32(~*r_dst); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -7930,8 +7930,8 @@ M68KMAKE_OP(not, 32, ., d) M68KMAKE_OP(not, 32, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 res = MASK_OUT_ABOVE_32(~m68ki_read_32((mc68kcpu), ea)); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t res = MASK_OUT_ABOVE_32(~m68ki_read_32((mc68kcpu), ea)); m68ki_write_32((mc68kcpu), ea, res); @@ -7944,7 +7944,7 @@ M68KMAKE_OP(not, 32, ., .) M68KMAKE_OP(or, 8, er, d) { - UINT32 res = MASK_OUT_ABOVE_8((DX(mc68kcpu) |= MASK_OUT_ABOVE_8(DY(mc68kcpu)))); + uint32_t res = MASK_OUT_ABOVE_8((DX(mc68kcpu) |= MASK_OUT_ABOVE_8(DY(mc68kcpu)))); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -7955,7 +7955,7 @@ M68KMAKE_OP(or, 8, er, d) M68KMAKE_OP(or, 8, er, .) { - UINT32 res = MASK_OUT_ABOVE_8((DX(mc68kcpu) |= M68KMAKE_GET_OPER_AY_8)); + uint32_t res = MASK_OUT_ABOVE_8((DX(mc68kcpu) |= M68KMAKE_GET_OPER_AY_8)); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -7966,7 +7966,7 @@ M68KMAKE_OP(or, 8, er, .) M68KMAKE_OP(or, 16, er, d) { - UINT32 res = MASK_OUT_ABOVE_16((DX(mc68kcpu) |= MASK_OUT_ABOVE_16(DY(mc68kcpu)))); + uint32_t res = MASK_OUT_ABOVE_16((DX(mc68kcpu) |= MASK_OUT_ABOVE_16(DY(mc68kcpu)))); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -7977,7 +7977,7 @@ M68KMAKE_OP(or, 16, er, d) M68KMAKE_OP(or, 16, er, .) { - UINT32 res = MASK_OUT_ABOVE_16((DX(mc68kcpu) |= M68KMAKE_GET_OPER_AY_16)); + uint32_t res = MASK_OUT_ABOVE_16((DX(mc68kcpu) |= M68KMAKE_GET_OPER_AY_16)); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -7988,7 +7988,7 @@ M68KMAKE_OP(or, 16, er, .) M68KMAKE_OP(or, 32, er, d) { - UINT32 res = DX(mc68kcpu) |= DY(mc68kcpu); + uint32_t res = DX(mc68kcpu) |= DY(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -7999,7 +7999,7 @@ M68KMAKE_OP(or, 32, er, d) M68KMAKE_OP(or, 32, er, .) { - UINT32 res = DX(mc68kcpu) |= M68KMAKE_GET_OPER_AY_32; + uint32_t res = DX(mc68kcpu) |= M68KMAKE_GET_OPER_AY_32; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -8010,8 +8010,8 @@ M68KMAKE_OP(or, 32, er, .) M68KMAKE_OP(or, 8, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 res = MASK_OUT_ABOVE_8(DX(mc68kcpu) | m68ki_read_8((mc68kcpu), ea)); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t res = MASK_OUT_ABOVE_8(DX(mc68kcpu) | m68ki_read_8((mc68kcpu), ea)); m68ki_write_8((mc68kcpu), ea, res); @@ -8024,8 +8024,8 @@ M68KMAKE_OP(or, 8, re, .) M68KMAKE_OP(or, 16, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 res = MASK_OUT_ABOVE_16(DX(mc68kcpu) | m68ki_read_16((mc68kcpu), ea)); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t res = MASK_OUT_ABOVE_16(DX(mc68kcpu) | m68ki_read_16((mc68kcpu), ea)); m68ki_write_16((mc68kcpu), ea, res); @@ -8038,8 +8038,8 @@ M68KMAKE_OP(or, 16, re, .) M68KMAKE_OP(or, 32, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 res = DX(mc68kcpu) | m68ki_read_32((mc68kcpu), ea); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t res = DX(mc68kcpu) | m68ki_read_32((mc68kcpu), ea); m68ki_write_32((mc68kcpu), ea, res); @@ -8052,7 +8052,7 @@ M68KMAKE_OP(or, 32, re, .) M68KMAKE_OP(ori, 8, ., d) { - UINT32 res = MASK_OUT_ABOVE_8((DY(mc68kcpu) |= OPER_I_8(mc68kcpu))); + uint32_t res = MASK_OUT_ABOVE_8((DY(mc68kcpu) |= OPER_I_8(mc68kcpu))); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -8063,9 +8063,9 @@ M68KMAKE_OP(ori, 8, ., d) M68KMAKE_OP(ori, 8, ., .) { - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 res = MASK_OUT_ABOVE_8(src | m68ki_read_8((mc68kcpu), ea)); + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t res = MASK_OUT_ABOVE_8(src | m68ki_read_8((mc68kcpu), ea)); m68ki_write_8((mc68kcpu), ea, res); @@ -8078,7 +8078,7 @@ M68KMAKE_OP(ori, 8, ., .) M68KMAKE_OP(ori, 16, ., d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu) |= OPER_I_16(mc68kcpu)); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu) |= OPER_I_16(mc68kcpu)); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -8089,9 +8089,9 @@ M68KMAKE_OP(ori, 16, ., d) M68KMAKE_OP(ori, 16, ., .) { - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 res = MASK_OUT_ABOVE_16(src | m68ki_read_16((mc68kcpu), ea)); + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t res = MASK_OUT_ABOVE_16(src | m68ki_read_16((mc68kcpu), ea)); m68ki_write_16((mc68kcpu), ea, res); @@ -8104,7 +8104,7 @@ M68KMAKE_OP(ori, 16, ., .) M68KMAKE_OP(ori, 32, ., d) { - UINT32 res = DY(mc68kcpu) |= OPER_I_32(mc68kcpu); + uint32_t res = DY(mc68kcpu) |= OPER_I_32(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -8115,9 +8115,9 @@ M68KMAKE_OP(ori, 32, ., d) M68KMAKE_OP(ori, 32, ., .) { - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 res = src | m68ki_read_32((mc68kcpu), ea); + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t res = src | m68ki_read_32((mc68kcpu), ea); m68ki_write_32((mc68kcpu), ea, res); @@ -8138,7 +8138,7 @@ M68KMAKE_OP(ori, 16, tos, .) { if((mc68kcpu)->s_flag) { - UINT32 src = OPER_I_16(mc68kcpu); + uint32_t src = OPER_I_16(mc68kcpu); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ m68ki_set_sr((mc68kcpu), m68ki_get_sr(mc68kcpu) | src); return; @@ -8152,8 +8152,8 @@ M68KMAKE_OP(pack, 16, rr, .) if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { /* Note: DX(mc68kcpu) and DY(mc68kcpu) are reversed in Motorola's docs */ - UINT32 src = DY(mc68kcpu) + OPER_I_16(mc68kcpu); - UINT32* r_dst = &DX(mc68kcpu); + uint32_t src = DY(mc68kcpu) + OPER_I_16(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = MASK_OUT_BELOW_8(*r_dst) | ((src >> 4) & 0x00f0) | (src & 0x000f); return; @@ -8167,8 +8167,8 @@ M68KMAKE_OP(pack, 16, mm, ax7) if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { /* Note: AX and AY are reversed in Motorola's docs */ - UINT32 ea_src = EA_AY_PD_8(mc68kcpu); - UINT32 src = m68ki_read_8((mc68kcpu), ea_src); + uint32_t ea_src = EA_AY_PD_8(mc68kcpu); + uint32_t src = m68ki_read_8((mc68kcpu), ea_src); ea_src = EA_AY_PD_8(mc68kcpu); src = ((src << 8) | m68ki_read_8((mc68kcpu), ea_src)) + OPER_I_16(mc68kcpu); @@ -8184,8 +8184,8 @@ M68KMAKE_OP(pack, 16, mm, ay7) if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { /* Note: AX and AY are reversed in Motorola's docs */ - UINT32 ea_src = EA_A7_PD_8(mc68kcpu); - UINT32 src = m68ki_read_8((mc68kcpu), ea_src); + uint32_t ea_src = EA_A7_PD_8(mc68kcpu); + uint32_t src = m68ki_read_8((mc68kcpu), ea_src); ea_src = EA_A7_PD_8(mc68kcpu); src = ((src << 8) | m68ki_read_8((mc68kcpu), ea_src)) + OPER_I_16(mc68kcpu); @@ -8200,8 +8200,8 @@ M68KMAKE_OP(pack, 16, mm, axy7) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 ea_src = EA_A7_PD_8(mc68kcpu); - UINT32 src = m68ki_read_8((mc68kcpu), ea_src); + uint32_t ea_src = EA_A7_PD_8(mc68kcpu); + uint32_t src = m68ki_read_8((mc68kcpu), ea_src); ea_src = EA_A7_PD_8(mc68kcpu); src = ((src << 8) | m68ki_read_8((mc68kcpu), ea_src)) + OPER_I_16(mc68kcpu); @@ -8217,8 +8217,8 @@ M68KMAKE_OP(pack, 16, mm, .) if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { /* Note: AX and AY are reversed in Motorola's docs */ - UINT32 ea_src = EA_AY_PD_8(mc68kcpu); - UINT32 src = m68ki_read_8((mc68kcpu), ea_src); + uint32_t ea_src = EA_AY_PD_8(mc68kcpu); + uint32_t src = m68ki_read_8((mc68kcpu), ea_src); ea_src = EA_AY_PD_8(mc68kcpu); src = ((src << 8) | m68ki_read_8((mc68kcpu), ea_src)) + OPER_I_16(mc68kcpu); @@ -8231,7 +8231,7 @@ M68KMAKE_OP(pack, 16, mm, .) M68KMAKE_OP(pea, 32, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; + uint32_t ea = M68KMAKE_GET_EA_AY_32; m68ki_push_32((mc68kcpu), ea); } @@ -8296,11 +8296,11 @@ M68KMAKE_OP(reset, 0, ., .) M68KMAKE_OP(ror, 8, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 shift = orig_shift & 7; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = ROR_8(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t shift = orig_shift & 7; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = ROR_8(src, shift); if(orig_shift != 0) (mc68kcpu)->remaining_cycles -= orig_shift<<(mc68kcpu)->cyc_shift; @@ -8316,10 +8316,10 @@ M68KMAKE_OP(ror, 8, s, .) M68KMAKE_OP(ror, 16, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = ROR_16(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = ROR_16(src, shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8335,10 +8335,10 @@ M68KMAKE_OP(ror, 16, s, .) M68KMAKE_OP(ror, 32, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT64 src = *r_dst; - UINT32 res = ROR_32(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint64_t src = *r_dst; + uint32_t res = ROR_32(src, shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8354,11 +8354,11 @@ M68KMAKE_OP(ror, 32, s, .) M68KMAKE_OP(ror, 8, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; - UINT32 shift = orig_shift & 7; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = ROR_8(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t shift = orig_shift & 7; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = ROR_8(src, shift); if(orig_shift != 0) { @@ -8381,11 +8381,11 @@ M68KMAKE_OP(ror, 8, r, .) M68KMAKE_OP(ror, 16, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; - UINT32 shift = orig_shift & 15; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = ROR_16(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t shift = orig_shift & 15; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = ROR_16(src, shift); if(orig_shift != 0) { @@ -8408,11 +8408,11 @@ M68KMAKE_OP(ror, 16, r, .) M68KMAKE_OP(ror, 32, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; - UINT32 shift = orig_shift & 31; - UINT64 src = *r_dst; - UINT32 res = ROR_32(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t shift = orig_shift & 31; + uint64_t src = *r_dst; + uint32_t res = ROR_32(src, shift); if(orig_shift != 0) { @@ -8435,9 +8435,9 @@ M68KMAKE_OP(ror, 32, r, .) M68KMAKE_OP(ror, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = ROR_16(src, 1); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = ROR_16(src, 1); m68ki_write_16((mc68kcpu), ea, res); @@ -8450,11 +8450,11 @@ M68KMAKE_OP(ror, 16, ., .) M68KMAKE_OP(rol, 8, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 shift = orig_shift & 7; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = ROL_8(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t shift = orig_shift & 7; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = ROL_8(src, shift); if(orig_shift != 0) (mc68kcpu)->remaining_cycles -= orig_shift<<(mc68kcpu)->cyc_shift; @@ -8470,10 +8470,10 @@ M68KMAKE_OP(rol, 8, s, .) M68KMAKE_OP(rol, 16, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = ROL_16(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = ROL_16(src, shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8489,10 +8489,10 @@ M68KMAKE_OP(rol, 16, s, .) M68KMAKE_OP(rol, 32, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT64 src = *r_dst; - UINT32 res = ROL_32(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint64_t src = *r_dst; + uint32_t res = ROL_32(src, shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8508,11 +8508,11 @@ M68KMAKE_OP(rol, 32, s, .) M68KMAKE_OP(rol, 8, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; - UINT32 shift = orig_shift & 7; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = ROL_8(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t shift = orig_shift & 7; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = ROL_8(src, shift); if(orig_shift != 0) { @@ -8543,11 +8543,11 @@ M68KMAKE_OP(rol, 8, r, .) M68KMAKE_OP(rol, 16, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; - UINT32 shift = orig_shift & 15; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = MASK_OUT_ABOVE_16(ROL_16(src, shift)); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t shift = orig_shift & 15; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = MASK_OUT_ABOVE_16(ROL_16(src, shift)); if(orig_shift != 0) { @@ -8578,11 +8578,11 @@ M68KMAKE_OP(rol, 16, r, .) M68KMAKE_OP(rol, 32, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; - UINT32 shift = orig_shift & 31; - UINT64 src = *r_dst; - UINT32 res = ROL_32(src, shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t shift = orig_shift & 31; + uint64_t src = *r_dst; + uint32_t res = ROL_32(src, shift); if(orig_shift != 0) { @@ -8606,9 +8606,9 @@ M68KMAKE_OP(rol, 32, r, .) M68KMAKE_OP(rol, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = MASK_OUT_ABOVE_16(ROL_16(src, 1)); m68ki_write_16((mc68kcpu), ea, res); @@ -8621,10 +8621,10 @@ M68KMAKE_OP(rol, 16, ., .) M68KMAKE_OP(roxr, 8, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = ROR_9(src | (XFLAG_AS_1(mc68kcpu) << 8), shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = ROR_9(src | (XFLAG_AS_1(mc68kcpu) << 8), shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8642,10 +8642,10 @@ M68KMAKE_OP(roxr, 8, s, .) M68KMAKE_OP(roxr, 16, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = ROR_17(src | (XFLAG_AS_1(mc68kcpu) << 16), shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = ROR_17(src | (XFLAG_AS_1(mc68kcpu) << 16), shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8663,10 +8663,10 @@ M68KMAKE_OP(roxr, 16, s, .) M68KMAKE_OP(roxr, 32, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT64 src = *r_dst; - UINT64 res = src | (((UINT64)XFLAG_AS_1(mc68kcpu)) << 32); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint64_t src = *r_dst; + uint64_t res = src | (((uint64_t)XFLAG_AS_1(mc68kcpu)) << 32); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8686,14 +8686,14 @@ M68KMAKE_OP(roxr, 32, s, .) M68KMAKE_OP(roxr, 8, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; if(orig_shift != 0) { - UINT32 shift = orig_shift % 9; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = ROR_9(src | (XFLAG_AS_1(mc68kcpu) << 8), shift); + uint32_t shift = orig_shift % 9; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = ROR_9(src | (XFLAG_AS_1(mc68kcpu) << 8), shift); (mc68kcpu)->remaining_cycles -= orig_shift<<(mc68kcpu)->cyc_shift; @@ -8716,14 +8716,14 @@ M68KMAKE_OP(roxr, 8, r, .) M68KMAKE_OP(roxr, 16, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; if(orig_shift != 0) { - UINT32 shift = orig_shift % 17; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = ROR_17(src | (XFLAG_AS_1(mc68kcpu) << 16), shift); + uint32_t shift = orig_shift % 17; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = ROR_17(src | (XFLAG_AS_1(mc68kcpu) << 16), shift); (mc68kcpu)->remaining_cycles -= orig_shift<<(mc68kcpu)->cyc_shift; @@ -8746,14 +8746,14 @@ M68KMAKE_OP(roxr, 16, r, .) M68KMAKE_OP(roxr, 32, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; if(orig_shift != 0) { - UINT32 shift = orig_shift % 33; - UINT64 src = *r_dst; - UINT64 res = src | (((UINT64)XFLAG_AS_1(mc68kcpu)) << 32); + uint32_t shift = orig_shift % 33; + uint64_t src = *r_dst; + uint64_t res = src | (((uint64_t)XFLAG_AS_1(mc68kcpu)) << 32); res = ROR_33_64(res, shift); @@ -8778,9 +8778,9 @@ M68KMAKE_OP(roxr, 32, r, .) M68KMAKE_OP(roxr, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = ROR_17(src | (XFLAG_AS_1(mc68kcpu) << 16), 1); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = ROR_17(src | (XFLAG_AS_1(mc68kcpu) << 16), 1); (mc68kcpu)->c_flag = (mc68kcpu)->x_flag = res >> 8; res = MASK_OUT_ABOVE_16(res); @@ -8795,10 +8795,10 @@ M68KMAKE_OP(roxr, 16, ., .) M68KMAKE_OP(roxl, 8, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = ROL_9(src | (XFLAG_AS_1(mc68kcpu) << 8), shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = ROL_9(src | (XFLAG_AS_1(mc68kcpu) << 8), shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8816,10 +8816,10 @@ M68KMAKE_OP(roxl, 8, s, .) M68KMAKE_OP(roxl, 16, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = ROL_17(src | (XFLAG_AS_1(mc68kcpu) << 16), shift); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = ROL_17(src | (XFLAG_AS_1(mc68kcpu) << 16), shift); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8837,10 +8837,10 @@ M68KMAKE_OP(roxl, 16, s, .) M68KMAKE_OP(roxl, 32, s, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT64 src = *r_dst; - UINT64 res = src | (((UINT64)XFLAG_AS_1(mc68kcpu)) << 32); + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t shift = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint64_t src = *r_dst; + uint64_t res = src | (((uint64_t)XFLAG_AS_1(mc68kcpu)) << 32); if(shift != 0) (mc68kcpu)->remaining_cycles -= shift<<(mc68kcpu)->cyc_shift; @@ -8860,15 +8860,15 @@ M68KMAKE_OP(roxl, 32, s, .) M68KMAKE_OP(roxl, 8, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; if(orig_shift != 0) { - UINT32 shift = orig_shift % 9; - UINT32 src = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = ROL_9(src | (XFLAG_AS_1(mc68kcpu) << 8), shift); + uint32_t shift = orig_shift % 9; + uint32_t src = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = ROL_9(src | (XFLAG_AS_1(mc68kcpu) << 8), shift); (mc68kcpu)->remaining_cycles -= orig_shift<<(mc68kcpu)->cyc_shift; @@ -8891,14 +8891,14 @@ M68KMAKE_OP(roxl, 8, r, .) M68KMAKE_OP(roxl, 16, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; if(orig_shift != 0) { - UINT32 shift = orig_shift % 17; - UINT32 src = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = ROL_17(src | (XFLAG_AS_1(mc68kcpu) << 16), shift); + uint32_t shift = orig_shift % 17; + uint32_t src = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = ROL_17(src | (XFLAG_AS_1(mc68kcpu) << 16), shift); (mc68kcpu)->remaining_cycles -= orig_shift<<(mc68kcpu)->cyc_shift; @@ -8921,14 +8921,14 @@ M68KMAKE_OP(roxl, 16, r, .) M68KMAKE_OP(roxl, 32, r, .) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 orig_shift = DX(mc68kcpu) & 0x3f; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t orig_shift = DX(mc68kcpu) & 0x3f; if(orig_shift != 0) { - UINT32 shift = orig_shift % 33; - UINT64 src = *r_dst; - UINT64 res = src | (((UINT64)XFLAG_AS_1(mc68kcpu)) << 32); + uint32_t shift = orig_shift % 33; + uint64_t src = *r_dst; + uint64_t res = src | (((uint64_t)XFLAG_AS_1(mc68kcpu)) << 32); res = ROL_33_64(res, shift); @@ -8953,9 +8953,9 @@ M68KMAKE_OP(roxl, 32, r, .) M68KMAKE_OP(roxl, 16, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = m68ki_read_16((mc68kcpu), ea); - UINT32 res = ROL_17(src | (XFLAG_AS_1(mc68kcpu) << 16), 1); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = m68ki_read_16((mc68kcpu), ea); + uint32_t res = ROL_17(src | (XFLAG_AS_1(mc68kcpu) << 16), 1); (mc68kcpu)->c_flag = (mc68kcpu)->x_flag = res >> 8; res = MASK_OUT_ABOVE_16(res); @@ -8972,7 +8972,7 @@ M68KMAKE_OP(rtd, 32, ., .) { if(CPU_TYPE_IS_010_PLUS((mc68kcpu)->cpu_type)) { - UINT32 new_pc = m68ki_pull_32(mc68kcpu); + uint32_t new_pc = m68ki_pull_32(mc68kcpu); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ REG_A(mc68kcpu)[7] = MASK_OUT_ABOVE_32(REG_A(mc68kcpu)[7] + MAKE_INT_16(OPER_I_16(mc68kcpu))); @@ -8987,9 +8987,9 @@ M68KMAKE_OP(rte, 32, ., .) { if((mc68kcpu)->s_flag) { - UINT32 new_sr; - UINT32 new_pc; - UINT32 format_word; + uint32_t new_sr; + uint32_t new_pc; + uint32_t format_word; if (!(mc68kcpu)->rte_instr_callback.isnull()) ((mc68kcpu)->rte_instr_callback)(1); @@ -9177,10 +9177,10 @@ M68KMAKE_OP(rts, 32, ., .) M68KMAKE_OP(sbcd, 8, rr, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = DY(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = DY(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); // (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ (mc68kcpu)->v_flag = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to assume cleared. */ @@ -9209,10 +9209,10 @@ M68KMAKE_OP(sbcd, 8, rr, .) M68KMAKE_OP(sbcd, 8, mm, ax7) { - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea = EA_A7_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea = EA_A7_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); // (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ (mc68kcpu)->v_flag = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */ @@ -9241,10 +9241,10 @@ M68KMAKE_OP(sbcd, 8, mm, ax7) M68KMAKE_OP(sbcd, 8, mm, ay7) { - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea = EA_AX_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea = EA_AX_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); // (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ (mc68kcpu)->v_flag = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */ @@ -9273,10 +9273,10 @@ M68KMAKE_OP(sbcd, 8, mm, ay7) M68KMAKE_OP(sbcd, 8, mm, axy7) { - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea = EA_A7_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea = EA_A7_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); // (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ (mc68kcpu)->v_flag = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */ @@ -9305,10 +9305,10 @@ M68KMAKE_OP(sbcd, 8, mm, axy7) M68KMAKE_OP(sbcd, 8, mm, .) { - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea = EA_AX_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea = EA_AX_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1(mc68kcpu); // (mc68kcpu)->v_flag = ~res; /* Undefined V behavior */ (mc68kcpu)->v_flag = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */ @@ -9381,7 +9381,7 @@ M68KMAKE_OP(stop, 0, ., .) { if((mc68kcpu)->s_flag) { - UINT32 new_sr = OPER_I_16(mc68kcpu); + uint32_t new_sr = OPER_I_16(mc68kcpu); m68ki_trace_t0(mc68kcpu); /* auto-disable (see m68kcpu.h) */ (mc68kcpu)->stopped |= STOP_LEVEL_STOP; m68ki_set_sr((mc68kcpu), new_sr); @@ -9394,10 +9394,10 @@ M68KMAKE_OP(stop, 0, ., .) M68KMAKE_OP(sub, 8, er, d) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = dst - src; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_8(res); @@ -9410,10 +9410,10 @@ M68KMAKE_OP(sub, 8, er, d) M68KMAKE_OP(sub, 8, er, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = M68KMAKE_GET_OPER_AY_8; - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = dst - src; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = M68KMAKE_GET_OPER_AY_8; + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_8(res); @@ -9426,10 +9426,10 @@ M68KMAKE_OP(sub, 8, er, .) M68KMAKE_OP(sub, 16, er, d) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = dst - src; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_16(res); @@ -9442,10 +9442,10 @@ M68KMAKE_OP(sub, 16, er, d) M68KMAKE_OP(sub, 16, er, a) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_16(AY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = dst - src; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_16(AY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_16(res); @@ -9458,10 +9458,10 @@ M68KMAKE_OP(sub, 16, er, a) M68KMAKE_OP(sub, 16, er, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = M68KMAKE_GET_OPER_AY_16; - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = dst - src; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = M68KMAKE_GET_OPER_AY_16; + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_16(res); @@ -9474,10 +9474,10 @@ M68KMAKE_OP(sub, 16, er, .) M68KMAKE_OP(sub, 32, er, d) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = DY(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = dst - src; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = DY(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_SUB_32(src, dst, res); @@ -9490,10 +9490,10 @@ M68KMAKE_OP(sub, 32, er, d) M68KMAKE_OP(sub, 32, er, a) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = AY(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = dst - src; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = AY(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_SUB_32(src, dst, res); @@ -9506,10 +9506,10 @@ M68KMAKE_OP(sub, 32, er, a) M68KMAKE_OP(sub, 32, er, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = M68KMAKE_GET_OPER_AY_32; - UINT32 dst = *r_dst; - UINT32 res = dst - src; + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = M68KMAKE_GET_OPER_AY_32; + uint32_t dst = *r_dst; + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_SUB_32(src, dst, res); @@ -9522,10 +9522,10 @@ M68KMAKE_OP(sub, 32, er, .) M68KMAKE_OP(sub, 8, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 src = MASK_OUT_ABOVE_8(DX(mc68kcpu)); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = dst - src; + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t src = MASK_OUT_ABOVE_8(DX(mc68kcpu)); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -9538,10 +9538,10 @@ M68KMAKE_OP(sub, 8, re, .) M68KMAKE_OP(sub, 16, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 src = MASK_OUT_ABOVE_16(DX(mc68kcpu)); - UINT32 dst = m68ki_read_16((mc68kcpu), ea); - UINT32 res = dst - src; + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t src = MASK_OUT_ABOVE_16(DX(mc68kcpu)); + uint32_t dst = m68ki_read_16((mc68kcpu), ea); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -9554,10 +9554,10 @@ M68KMAKE_OP(sub, 16, re, .) M68KMAKE_OP(sub, 32, re, .) { - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 src = DX(mc68kcpu); - UINT32 dst = m68ki_read_32((mc68kcpu), ea); - UINT32 res = dst - src; + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t src = DX(mc68kcpu); + uint32_t dst = m68ki_read_32((mc68kcpu), ea); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -9570,7 +9570,7 @@ M68KMAKE_OP(sub, 32, re, .) M68KMAKE_OP(suba, 16, ., d) { - UINT32* r_dst = &AX(mc68kcpu); + uint32_t* r_dst = &AX(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(DY(mc68kcpu))); } @@ -9578,7 +9578,7 @@ M68KMAKE_OP(suba, 16, ., d) M68KMAKE_OP(suba, 16, ., a) { - UINT32* r_dst = &AX(mc68kcpu); + uint32_t* r_dst = &AX(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(AY(mc68kcpu))); } @@ -9586,8 +9586,8 @@ M68KMAKE_OP(suba, 16, ., a) M68KMAKE_OP(suba, 16, ., .) { - UINT32* r_dst = &AX(mc68kcpu); - UINT32 src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); + uint32_t* r_dst = &AX(mc68kcpu); + uint32_t src = MAKE_INT_16(M68KMAKE_GET_OPER_AY_16); *r_dst = MASK_OUT_ABOVE_32(*r_dst - src); } @@ -9595,7 +9595,7 @@ M68KMAKE_OP(suba, 16, ., .) M68KMAKE_OP(suba, 32, ., d) { - UINT32* r_dst = &AX(mc68kcpu); + uint32_t* r_dst = &AX(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst - DY(mc68kcpu)); } @@ -9603,7 +9603,7 @@ M68KMAKE_OP(suba, 32, ., d) M68KMAKE_OP(suba, 32, ., a) { - UINT32* r_dst = &AX(mc68kcpu); + uint32_t* r_dst = &AX(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst - AY(mc68kcpu)); } @@ -9611,8 +9611,8 @@ M68KMAKE_OP(suba, 32, ., a) M68KMAKE_OP(suba, 32, ., .) { - UINT32* r_dst = &AX(mc68kcpu); - UINT32 src = M68KMAKE_GET_OPER_AY_32; + uint32_t* r_dst = &AX(mc68kcpu); + uint32_t src = M68KMAKE_GET_OPER_AY_32; *r_dst = MASK_OUT_ABOVE_32(*r_dst - src); } @@ -9620,10 +9620,10 @@ M68KMAKE_OP(suba, 32, ., .) M68KMAKE_OP(subi, 8, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = dst - src; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -9636,10 +9636,10 @@ M68KMAKE_OP(subi, 8, ., d) M68KMAKE_OP(subi, 8, ., .) { - UINT32 src = OPER_I_8(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = dst - src; + uint32_t src = OPER_I_8(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -9652,10 +9652,10 @@ M68KMAKE_OP(subi, 8, ., .) M68KMAKE_OP(subi, 16, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = dst - src; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -9668,10 +9668,10 @@ M68KMAKE_OP(subi, 16, ., d) M68KMAKE_OP(subi, 16, ., .) { - UINT32 src = OPER_I_16(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 dst = m68ki_read_16((mc68kcpu), ea); - UINT32 res = dst - src; + uint32_t src = OPER_I_16(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t dst = m68ki_read_16((mc68kcpu), ea); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -9684,10 +9684,10 @@ M68KMAKE_OP(subi, 16, ., .) M68KMAKE_OP(subi, 32, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = dst - src; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -9700,10 +9700,10 @@ M68KMAKE_OP(subi, 32, ., d) M68KMAKE_OP(subi, 32, ., .) { - UINT32 src = OPER_I_32(mc68kcpu); - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 dst = m68ki_read_32((mc68kcpu), ea); - UINT32 res = dst - src; + uint32_t src = OPER_I_32(mc68kcpu); + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t dst = m68ki_read_32((mc68kcpu), ea); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -9716,10 +9716,10 @@ M68KMAKE_OP(subi, 32, ., .) M68KMAKE_OP(subq, 8, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = dst - src; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -9732,10 +9732,10 @@ M68KMAKE_OP(subq, 8, ., d) M68KMAKE_OP(subq, 8, ., .) { - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = dst - src; + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(res); @@ -9748,10 +9748,10 @@ M68KMAKE_OP(subq, 8, ., .) M68KMAKE_OP(subq, 16, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = dst - src; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -9764,7 +9764,7 @@ M68KMAKE_OP(subq, 16, ., d) M68KMAKE_OP(subq, 16, ., a) { - UINT32* r_dst = &AY(mc68kcpu); + uint32_t* r_dst = &AY(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst - (((((mc68kcpu)->ir >> 9) - 1) & 7) + 1)); } @@ -9772,10 +9772,10 @@ M68KMAKE_OP(subq, 16, ., a) M68KMAKE_OP(subq, 16, ., .) { - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 ea = M68KMAKE_GET_EA_AY_16; - UINT32 dst = m68ki_read_16((mc68kcpu), ea); - UINT32 res = dst - src; + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t ea = M68KMAKE_GET_EA_AY_16; + uint32_t dst = m68ki_read_16((mc68kcpu), ea); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_16(res); @@ -9788,10 +9788,10 @@ M68KMAKE_OP(subq, 16, ., .) M68KMAKE_OP(subq, 32, ., d) { - UINT32* r_dst = &DY(mc68kcpu); - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 dst = *r_dst; - UINT32 res = dst - src; + uint32_t* r_dst = &DY(mc68kcpu); + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t dst = *r_dst; + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -9804,7 +9804,7 @@ M68KMAKE_OP(subq, 32, ., d) M68KMAKE_OP(subq, 32, ., a) { - UINT32* r_dst = &AY(mc68kcpu); + uint32_t* r_dst = &AY(mc68kcpu); *r_dst = MASK_OUT_ABOVE_32(*r_dst - (((((mc68kcpu)->ir >> 9) - 1) & 7) + 1)); } @@ -9812,10 +9812,10 @@ M68KMAKE_OP(subq, 32, ., a) M68KMAKE_OP(subq, 32, ., .) { - UINT32 src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; - UINT32 ea = M68KMAKE_GET_EA_AY_32; - UINT32 dst = m68ki_read_32((mc68kcpu), ea); - UINT32 res = dst - src; + uint32_t src = ((((mc68kcpu)->ir >> 9) - 1) & 7) + 1; + uint32_t ea = M68KMAKE_GET_EA_AY_32; + uint32_t dst = m68ki_read_32((mc68kcpu), ea); + uint32_t res = dst - src; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(res); @@ -9828,10 +9828,10 @@ M68KMAKE_OP(subq, 32, ., .) M68KMAKE_OP(subx, 8, rr, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_8(*r_dst); - UINT32 res = dst - src - XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_8(*r_dst); + uint32_t res = dst - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_8(res); @@ -9846,10 +9846,10 @@ M68KMAKE_OP(subx, 8, rr, .) M68KMAKE_OP(subx, 16, rr, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); - UINT32 dst = MASK_OUT_ABOVE_16(*r_dst); - UINT32 res = dst - src - XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t dst = MASK_OUT_ABOVE_16(*r_dst); + uint32_t res = dst - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_16(res); @@ -9864,10 +9864,10 @@ M68KMAKE_OP(subx, 16, rr, .) M68KMAKE_OP(subx, 32, rr, .) { - UINT32* r_dst = &DX(mc68kcpu); - UINT32 src = DY(mc68kcpu); - UINT32 dst = *r_dst; - UINT32 res = dst - src - XFLAG_AS_1(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); + uint32_t src = DY(mc68kcpu); + uint32_t dst = *r_dst; + uint32_t res = dst - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_SUB_32(src, dst, res); @@ -9882,10 +9882,10 @@ M68KMAKE_OP(subx, 32, rr, .) M68KMAKE_OP(subx, 8, mm, ax7) { - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea = EA_A7_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = dst - src - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea = EA_A7_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = dst - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_8(res); @@ -9900,10 +9900,10 @@ M68KMAKE_OP(subx, 8, mm, ax7) M68KMAKE_OP(subx, 8, mm, ay7) { - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea = EA_AX_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = dst - src - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea = EA_AX_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = dst - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_8(res); @@ -9918,10 +9918,10 @@ M68KMAKE_OP(subx, 8, mm, ay7) M68KMAKE_OP(subx, 8, mm, axy7) { - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea = EA_A7_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = dst - src - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea = EA_A7_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = dst - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_8(res); @@ -9936,10 +9936,10 @@ M68KMAKE_OP(subx, 8, mm, axy7) M68KMAKE_OP(subx, 8, mm, .) { - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea = EA_AX_PD_8(mc68kcpu); - UINT32 dst = m68ki_read_8((mc68kcpu), ea); - UINT32 res = dst - src - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea = EA_AX_PD_8(mc68kcpu); + uint32_t dst = m68ki_read_8((mc68kcpu), ea); + uint32_t res = dst - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_8(res); @@ -9954,10 +9954,10 @@ M68KMAKE_OP(subx, 8, mm, .) M68KMAKE_OP(subx, 16, mm, .) { - UINT32 src = OPER_AY_PD_16(mc68kcpu); - UINT32 ea = EA_AX_PD_16(mc68kcpu); - UINT32 dst = m68ki_read_16((mc68kcpu), ea); - UINT32 res = dst - src - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_16(mc68kcpu); + uint32_t ea = EA_AX_PD_16(mc68kcpu); + uint32_t dst = m68ki_read_16((mc68kcpu), ea); + uint32_t res = dst - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_16(res); @@ -9972,10 +9972,10 @@ M68KMAKE_OP(subx, 16, mm, .) M68KMAKE_OP(subx, 32, mm, .) { - UINT32 src = OPER_AY_PD_32(mc68kcpu); - UINT32 ea = EA_AX_PD_32(mc68kcpu); - UINT32 dst = m68ki_read_32((mc68kcpu), ea); - UINT32 res = dst - src - XFLAG_AS_1(mc68kcpu); + uint32_t src = OPER_AY_PD_32(mc68kcpu); + uint32_t ea = EA_AX_PD_32(mc68kcpu); + uint32_t dst = m68ki_read_32((mc68kcpu), ea); + uint32_t res = dst - src - XFLAG_AS_1(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->x_flag = (mc68kcpu)->c_flag = CFLAG_SUB_32(src, dst, res); @@ -9990,7 +9990,7 @@ M68KMAKE_OP(subx, 32, mm, .) M68KMAKE_OP(swap, 32, ., .) { - UINT32* r_dst = &DY(mc68kcpu); + uint32_t* r_dst = &DY(mc68kcpu); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_32(*r_dst<<16); *r_dst = (*r_dst>>16) | (mc68kcpu)->not_z_flag; @@ -10004,7 +10004,7 @@ M68KMAKE_OP(swap, 32, ., .) M68KMAKE_OP(tas, 8, ., d) { - UINT32* r_dst = &DY(mc68kcpu); + uint32_t* r_dst = &DY(mc68kcpu); (mc68kcpu)->not_z_flag = MASK_OUT_ABOVE_8(*r_dst); (mc68kcpu)->n_flag = NFLAG_8(*r_dst); @@ -10016,8 +10016,8 @@ M68KMAKE_OP(tas, 8, ., d) M68KMAKE_OP(tas, 8, ., .) { - UINT32 ea = M68KMAKE_GET_EA_AY_8; - UINT32 dst = m68ki_read_8((mc68kcpu), ea); + uint32_t ea = M68KMAKE_GET_EA_AY_8; + uint32_t dst = m68ki_read_8((mc68kcpu), ea); (mc68kcpu)->not_z_flag = dst; (mc68kcpu)->n_flag = NFLAG_8(dst); @@ -10164,7 +10164,7 @@ M68KMAKE_OP(trapv, 0, ., .) M68KMAKE_OP(tst, 8, ., d) { - UINT32 res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); + uint32_t res = MASK_OUT_ABOVE_8(DY(mc68kcpu)); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -10175,7 +10175,7 @@ M68KMAKE_OP(tst, 8, ., d) M68KMAKE_OP(tst, 8, ., .) { - UINT32 res = M68KMAKE_GET_OPER_AY_8; + uint32_t res = M68KMAKE_GET_OPER_AY_8; (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -10188,7 +10188,7 @@ M68KMAKE_OP(tst, 8, ., pcdi) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = OPER_PCDI_8(mc68kcpu); + uint32_t res = OPER_PCDI_8(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -10204,7 +10204,7 @@ M68KMAKE_OP(tst, 8, ., pcix) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = OPER_PCIX_8(mc68kcpu); + uint32_t res = OPER_PCIX_8(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -10220,7 +10220,7 @@ M68KMAKE_OP(tst, 8, ., i) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = OPER_I_8(mc68kcpu); + uint32_t res = OPER_I_8(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_8(res); (mc68kcpu)->not_z_flag = res; @@ -10234,7 +10234,7 @@ M68KMAKE_OP(tst, 8, ., i) M68KMAKE_OP(tst, 16, ., d) { - UINT32 res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); + uint32_t res = MASK_OUT_ABOVE_16(DY(mc68kcpu)); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -10247,7 +10247,7 @@ M68KMAKE_OP(tst, 16, ., a) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = MAKE_INT_16(AY(mc68kcpu)); + uint32_t res = MAKE_INT_16(AY(mc68kcpu)); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -10261,7 +10261,7 @@ M68KMAKE_OP(tst, 16, ., a) M68KMAKE_OP(tst, 16, ., .) { - UINT32 res = M68KMAKE_GET_OPER_AY_16; + uint32_t res = M68KMAKE_GET_OPER_AY_16; (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -10274,7 +10274,7 @@ M68KMAKE_OP(tst, 16, ., pcdi) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = OPER_PCDI_16(mc68kcpu); + uint32_t res = OPER_PCDI_16(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -10290,7 +10290,7 @@ M68KMAKE_OP(tst, 16, ., pcix) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = OPER_PCIX_16(mc68kcpu); + uint32_t res = OPER_PCIX_16(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -10306,7 +10306,7 @@ M68KMAKE_OP(tst, 16, ., i) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = OPER_I_16(mc68kcpu); + uint32_t res = OPER_I_16(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_16(res); (mc68kcpu)->not_z_flag = res; @@ -10320,7 +10320,7 @@ M68KMAKE_OP(tst, 16, ., i) M68KMAKE_OP(tst, 32, ., d) { - UINT32 res = DY(mc68kcpu); + uint32_t res = DY(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -10333,7 +10333,7 @@ M68KMAKE_OP(tst, 32, ., a) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = AY(mc68kcpu); + uint32_t res = AY(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -10347,7 +10347,7 @@ M68KMAKE_OP(tst, 32, ., a) M68KMAKE_OP(tst, 32, ., .) { - UINT32 res = M68KMAKE_GET_OPER_AY_32; + uint32_t res = M68KMAKE_GET_OPER_AY_32; (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -10360,7 +10360,7 @@ M68KMAKE_OP(tst, 32, ., pcdi) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = OPER_PCDI_32(mc68kcpu); + uint32_t res = OPER_PCDI_32(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -10376,7 +10376,7 @@ M68KMAKE_OP(tst, 32, ., pcix) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = OPER_PCIX_32(mc68kcpu); + uint32_t res = OPER_PCIX_32(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -10392,7 +10392,7 @@ M68KMAKE_OP(tst, 32, ., i) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 res = OPER_I_32(mc68kcpu); + uint32_t res = OPER_I_32(mc68kcpu); (mc68kcpu)->n_flag = NFLAG_32(res); (mc68kcpu)->not_z_flag = res; @@ -10412,7 +10412,7 @@ M68KMAKE_OP(unlk, 32, ., a7) M68KMAKE_OP(unlk, 32, ., .) { - UINT32* r_dst = &AY(mc68kcpu); + uint32_t* r_dst = &AY(mc68kcpu); REG_A(mc68kcpu)[7] = *r_dst; *r_dst = m68ki_pull_32(mc68kcpu); @@ -10424,8 +10424,8 @@ M68KMAKE_OP(unpk, 16, rr, .) if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { /* Note: DX(mc68kcpu) and DY(mc68kcpu) are reversed in Motorola's docs */ - UINT32 src = DY(mc68kcpu); - UINT32* r_dst = &DX(mc68kcpu); + uint32_t src = DY(mc68kcpu); + uint32_t* r_dst = &DX(mc68kcpu); *r_dst = MASK_OUT_BELOW_16(*r_dst) | (((((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(mc68kcpu)) & 0xffff); return; @@ -10439,8 +10439,8 @@ M68KMAKE_OP(unpk, 16, mm, ax7) if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { /* Note: AX and AY are reversed in Motorola's docs */ - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea_dst; + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea_dst; src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(mc68kcpu); ea_dst = EA_A7_PD_8(mc68kcpu); @@ -10458,8 +10458,8 @@ M68KMAKE_OP(unpk, 16, mm, ay7) if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { /* Note: AX and AY are reversed in Motorola's docs */ - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea_dst; + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea_dst; src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(mc68kcpu); ea_dst = EA_AX_PD_8(mc68kcpu); @@ -10476,8 +10476,8 @@ M68KMAKE_OP(unpk, 16, mm, axy7) { if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { - UINT32 src = OPER_A7_PD_8(mc68kcpu); - UINT32 ea_dst; + uint32_t src = OPER_A7_PD_8(mc68kcpu); + uint32_t ea_dst; src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(mc68kcpu); ea_dst = EA_A7_PD_8(mc68kcpu); @@ -10495,8 +10495,8 @@ M68KMAKE_OP(unpk, 16, mm, .) if(CPU_TYPE_IS_EC020_PLUS((mc68kcpu)->cpu_type)) { /* Note: AX and AY are reversed in Motorola's docs */ - UINT32 src = OPER_AY_PD_8(mc68kcpu); - UINT32 ea_dst; + uint32_t src = OPER_AY_PD_8(mc68kcpu); + uint32_t ea_dst; src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16(mc68kcpu); ea_dst = EA_AX_PD_8(mc68kcpu); @@ -10513,9 +10513,9 @@ M68KMAKE_OP(cinv, 32, ., .) { if(CPU_TYPE_IS_040_PLUS((mc68kcpu)->cpu_type)) { - UINT16 ir = mc68kcpu->ir; - UINT8 cache = (ir >> 6) & 3; -// UINT8 scope = (ir >> 3) & 3; + uint16_t ir = mc68kcpu->ir; + uint8_t cache = (ir >> 6) & 3; +// uint8_t scope = (ir >> 3) & 3; // mc68kcpu->logerror("68040 %s: pc=%08x ir=%04x cache=%d scope=%d register=%d\n", ir & 0x0020 ? "cpush" : "cinv", REG_PPC(mc68kcpu), ir, cache, scope, ir & 7); switch (cache) { diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp index b142337ae42..8bacd096a35 100644 --- a/src/devices/cpu/m68000/m68kcpu.cpp +++ b/src/devices/cpu/m68000/m68kcpu.cpp @@ -41,7 +41,7 @@ extern void m68881_mmu_ops(m68000_base_device *m68k); /* ======================================================================== */ /* Used by shift & rotate instructions */ -const UINT8 m68ki_shift_8_table[65] = +const uint8_t m68ki_shift_8_table[65] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -50,7 +50,7 @@ const UINT8 m68ki_shift_8_table[65] = 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -const UINT16 m68ki_shift_16_table[65] = +const uint16_t m68ki_shift_16_table[65] = { 0x0000, 0x8000, 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00, 0xff80, 0xffc0, 0xffe0, 0xfff0, 0xfff8, 0xfffc, 0xfffe, 0xffff, 0xffff, @@ -61,7 +61,7 @@ const UINT16 m68ki_shift_16_table[65] = 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; -const UINT32 m68ki_shift_32_table[65] = +const uint32_t m68ki_shift_32_table[65] = { 0x00000000, 0x80000000, 0xc0000000, 0xe0000000, 0xf0000000, 0xf8000000, 0xfc000000, 0xfe000000, 0xff000000, 0xff800000, 0xffc00000, 0xffe00000, @@ -80,7 +80,7 @@ const UINT32 m68ki_shift_32_table[65] = /* Number of clock cycles to use for exception processing. * I used 4 for any vectors that are undocumented for processing times. */ -const UINT8 m68ki_exception_cycle_table[7][256] = +const uint8_t m68ki_exception_cycle_table[7][256] = { { /* 000 */ 40, /* 0: Reset - Initial Stack Pointer */ @@ -595,7 +595,7 @@ const UINT8 m68ki_exception_cycle_table[7][256] = }, }; -const UINT8 m68ki_ea_idx_cycle_table[64] = +const uint8_t m68ki_ea_idx_cycle_table[64] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ..01.000 no memory indirect, base nullptr */ @@ -637,9 +637,9 @@ const UINT8 m68ki_ea_idx_cycle_table[64] = static void set_irq_line(m68000_base_device *m68k, int irqline, int state) { - UINT32 old_level = m68k->int_level; - UINT32 vstate = m68k->virq_state; - UINT32 blevel; + uint32_t old_level = m68k->int_level; + uint32_t vstate = m68k->virq_state; + uint32_t blevel; if(state == ASSERT_LINE) vstate |= 1 << irqline; @@ -676,7 +676,7 @@ void m68000_base_device::postload() static void m68k_cause_bus_error(m68000_base_device *m68k) { - UINT32 sr; + uint32_t sr; sr = m68ki_init_exception(m68k); @@ -712,9 +712,9 @@ bool m68000_base_device::memory_translate(address_spacenum space, int intention, if ((space == AS_PROGRAM) && ((pmmu_enabled) || (CPU_TYPE_IS_040_PLUS(cpu_type)))) { // FIXME: mmu_tmp_sr will be overwritten in pmmu_translate_addr_with_fc - UINT16 temp_mmu_tmp_sr = mmu_tmp_sr; + uint16_t temp_mmu_tmp_sr = mmu_tmp_sr; int mode = s_flag ? FUNCTION_CODE_SUPERVISOR_PROGRAM : FUNCTION_CODE_USER_PROGRAM; -// UINT32 va=address; +// uint32_t va=address; if (CPU_TYPE_IS_040_PLUS(cpu_type)) { @@ -822,7 +822,7 @@ inline void m68000_base_device::cpu_execute(void) run_mode = RUN_MODE_NORMAL; // save CPU address registers values at start of instruction int i; - UINT32 tmp_dar[16]; + uint32_t tmp_dar[16]; for (i = 15; i >= 0; i--) { @@ -842,7 +842,7 @@ inline void m68000_base_device::cpu_execute(void) if (mmu_tmp_buserror_occurred) { - UINT32 sr; + uint32_t sr; mmu_tmp_buserror_occurred = 0; @@ -916,7 +916,7 @@ inline void m68000_base_device::cpu_execute(void) void m68000_base_device::init_cpu_common(void) { - static UINT32 emulation_initialized = 0; + static uint32_t emulation_initialized = 0; //this = device;//deviceparam; program = &space(AS_PROGRAM); @@ -1140,7 +1140,7 @@ void m68000_base_device::state_export(const device_state_entry &entry) void m68000_base_device::state_string_export(const device_state_entry &entry, std::string &str) const { - UINT16 sr; + uint16_t sr; switch (entry.index()) { @@ -1217,7 +1217,7 @@ void m68000_base_device::set_instruction_hook(read32_delegate ihook) * 8-bit data memory interface ****************************************************************************/ -UINT16 m68000_base_device::m68008_read_immediate_16(offs_t address) +uint16_t m68000_base_device::m68008_read_immediate_16(offs_t address) { return (m_odirect->read_byte(address) << 8) | (m_odirect->read_byte(address + 1)); } @@ -1244,19 +1244,19 @@ void m68000_base_device::init8(address_space &space, address_space &ospace) * 16-bit data memory interface ****************************************************************************/ -UINT16 m68000_base_device::read_immediate_16(offs_t address) +uint16_t m68000_base_device::read_immediate_16(offs_t address) { return m_odirect->read_word((address), opcode_xor); } -UINT16 m68000_base_device::simple_read_immediate_16(offs_t address) +uint16_t m68000_base_device::simple_read_immediate_16(offs_t address) { return m_odirect->read_word(address); } -void m68000_base_device::m68000_write_byte(offs_t address, UINT8 data) +void m68000_base_device::m68000_write_byte(offs_t address, uint8_t data) { - static const UINT16 masks[] = {0xff00, 0x00ff}; + static const uint16_t masks[] = {0xff00, 0x00ff}; m_space->write_word(address & ~1, data | (data << 8), masks[address & 1]); } @@ -1306,7 +1306,7 @@ void m68000_base_device::init32(address_space &space, address_space &ospace) } /* interface for 32-bit data bus with PMMU (68EC020, 68020) */ -UINT8 m68000_base_device::read_byte_32_mmu(offs_t address) +uint8_t m68000_base_device::read_byte_32_mmu(offs_t address) { if (pmmu_enabled) { @@ -1319,7 +1319,7 @@ UINT8 m68000_base_device::read_byte_32_mmu(offs_t address) return m_space->read_byte(address); } -void m68000_base_device::write_byte_32_mmu(offs_t address, UINT8 data) +void m68000_base_device::write_byte_32_mmu(offs_t address, uint8_t data) { if (pmmu_enabled) { @@ -1332,7 +1332,7 @@ void m68000_base_device::write_byte_32_mmu(offs_t address, UINT8 data) m_space->write_byte(address, data); } -UINT16 m68000_base_device::read_immediate_16_mmu(offs_t address) +uint16_t m68000_base_device::read_immediate_16_mmu(offs_t address) { if (pmmu_enabled) { @@ -1346,19 +1346,19 @@ UINT16 m68000_base_device::read_immediate_16_mmu(offs_t address) } /* potentially misaligned 16-bit reads with a 32-bit data bus (and 24-bit address bus) */ -UINT16 m68000_base_device::readword_d32_mmu(offs_t address) +uint16_t m68000_base_device::readword_d32_mmu(offs_t address) { - UINT16 result; + uint16_t result; if (pmmu_enabled) { - UINT32 address0 = pmmu_translate_addr(this, address); + uint32_t address0 = pmmu_translate_addr(this, address); if (mmu_tmp_buserror_occurred) { return ~0; } else if (WORD_ALIGNED(address)) { return m_space->read_word(address0); } else { - UINT32 address1 = pmmu_translate_addr(this, address + 1); + uint32_t address1 = pmmu_translate_addr(this, address + 1); if (mmu_tmp_buserror_occurred) { return ~0; } else { @@ -1375,18 +1375,18 @@ UINT16 m68000_base_device::readword_d32_mmu(offs_t address) } /* potentially misaligned 16-bit writes with a 32-bit data bus (and 24-bit address bus) */ -void m68000_base_device::writeword_d32_mmu(offs_t address, UINT16 data) +void m68000_base_device::writeword_d32_mmu(offs_t address, uint16_t data) { if (pmmu_enabled) { - UINT32 address0 = pmmu_translate_addr(this, address); + uint32_t address0 = pmmu_translate_addr(this, address); if (mmu_tmp_buserror_occurred) { return; } else if (WORD_ALIGNED(address)) { m_space->write_word(address0, data); return; } else { - UINT32 address1 = pmmu_translate_addr(this, address + 1); + uint32_t address1 = pmmu_translate_addr(this, address + 1); if (mmu_tmp_buserror_occurred) { return; } else { @@ -1407,13 +1407,13 @@ void m68000_base_device::writeword_d32_mmu(offs_t address, UINT16 data) } /* potentially misaligned 32-bit reads with a 32-bit data bus (and 24-bit address bus) */ -UINT32 m68000_base_device::readlong_d32_mmu(offs_t address) +uint32_t m68000_base_device::readlong_d32_mmu(offs_t address) { - UINT32 result; + uint32_t result; if (pmmu_enabled) { - UINT32 address0 = pmmu_translate_addr(this, address); + uint32_t address0 = pmmu_translate_addr(this, address); if (mmu_tmp_buserror_occurred) { return ~0; } else if ((address +3) & 0xfc) { @@ -1422,15 +1422,15 @@ UINT32 m68000_base_device::readlong_d32_mmu(offs_t address) } else if (DWORD_ALIGNED(address)) { // 0 return m_space->read_dword(address0); } else { - UINT32 address2 = pmmu_translate_addr(this, address+2); + uint32_t address2 = pmmu_translate_addr(this, address+2); if (mmu_tmp_buserror_occurred) { return ~0; } else if (WORD_ALIGNED(address)) { // 2 result = m_space->read_word(address0) << 16; return result | m_space->read_word(address2); } else { - UINT32 address1 = pmmu_translate_addr(this, address+1); - UINT32 address3 = pmmu_translate_addr(this, address+3); + uint32_t address1 = pmmu_translate_addr(this, address+1); + uint32_t address3 = pmmu_translate_addr(this, address+3); if (mmu_tmp_buserror_occurred) { return ~0; } else { @@ -1455,11 +1455,11 @@ UINT32 m68000_base_device::readlong_d32_mmu(offs_t address) } /* potentially misaligned 32-bit writes with a 32-bit data bus (and 24-bit address bus) */ -void m68000_base_device::writelong_d32_mmu(offs_t address, UINT32 data) +void m68000_base_device::writelong_d32_mmu(offs_t address, uint32_t data) { if (pmmu_enabled) { - UINT32 address0 = pmmu_translate_addr(this, address); + uint32_t address0 = pmmu_translate_addr(this, address); if (mmu_tmp_buserror_occurred) { return; } else if ((address +3) & 0xfc) { @@ -1469,7 +1469,7 @@ void m68000_base_device::writelong_d32_mmu(offs_t address, UINT32 data) m_space->write_dword(address0, data); return; } else { - UINT32 address2 = pmmu_translate_addr(this, address+2); + uint32_t address2 = pmmu_translate_addr(this, address+2); if (mmu_tmp_buserror_occurred) { return; } else if (WORD_ALIGNED(address)) { // 2 @@ -1477,8 +1477,8 @@ void m68000_base_device::writelong_d32_mmu(offs_t address, UINT32 data) m_space->write_word(address2, data); return; } else { - UINT32 address1 = pmmu_translate_addr(this, address+1); - UINT32 address3 = pmmu_translate_addr(this, address+3); + uint32_t address1 = pmmu_translate_addr(this, address+1); + uint32_t address3 = pmmu_translate_addr(this, address+3); if (mmu_tmp_buserror_occurred) { return; } else { @@ -1526,7 +1526,7 @@ void m68000_base_device::init32mmu(address_space &space, address_space &ospace) /* interface for 32-bit data bus with PMMU (68EC020, 68020) */ -UINT8 m68000_base_device::read_byte_32_hmmu(offs_t address) +uint8_t m68000_base_device::read_byte_32_hmmu(offs_t address) { if (hmmu_enabled) { @@ -1536,7 +1536,7 @@ UINT8 m68000_base_device::read_byte_32_hmmu(offs_t address) return m_space->read_byte(address); } -void m68000_base_device::write_byte_32_hmmu(offs_t address, UINT8 data) +void m68000_base_device::write_byte_32_hmmu(offs_t address, uint8_t data) { if (hmmu_enabled) { @@ -1546,7 +1546,7 @@ void m68000_base_device::write_byte_32_hmmu(offs_t address, UINT8 data) m_space->write_byte(address, data); } -UINT16 m68000_base_device::read_immediate_16_hmmu(offs_t address) +uint16_t m68000_base_device::read_immediate_16_hmmu(offs_t address) { if (hmmu_enabled) { @@ -1557,9 +1557,9 @@ UINT16 m68000_base_device::read_immediate_16_hmmu(offs_t address) } /* potentially misaligned 16-bit reads with a 32-bit data bus (and 24-bit address bus) */ -UINT16 m68000_base_device::readword_d32_hmmu(offs_t address) +uint16_t m68000_base_device::readword_d32_hmmu(offs_t address) { - UINT16 result; + uint16_t result; if (hmmu_enabled) { @@ -1573,7 +1573,7 @@ UINT16 m68000_base_device::readword_d32_hmmu(offs_t address) } /* potentially misaligned 16-bit writes with a 32-bit data bus (and 24-bit address bus) */ -void m68000_base_device::writeword_d32_hmmu(offs_t address, UINT16 data) +void m68000_base_device::writeword_d32_hmmu(offs_t address, uint16_t data) { if (hmmu_enabled) { @@ -1590,9 +1590,9 @@ void m68000_base_device::writeword_d32_hmmu(offs_t address, UINT16 data) } /* potentially misaligned 32-bit reads with a 32-bit data bus (and 24-bit address bus) */ -UINT32 m68000_base_device::readlong_d32_hmmu(offs_t address) +uint32_t m68000_base_device::readlong_d32_hmmu(offs_t address) { - UINT32 result; + uint32_t result; if (hmmu_enabled) { @@ -1612,7 +1612,7 @@ UINT32 m68000_base_device::readlong_d32_hmmu(offs_t address) } /* potentially misaligned 32-bit writes with a 32-bit data bus (and 24-bit address bus) */ -void m68000_base_device::writelong_d32_hmmu(offs_t address, UINT32 data) +void m68000_base_device::writelong_d32_hmmu(offs_t address, uint32_t data) { if (hmmu_enabled) { @@ -1660,7 +1660,7 @@ void m68000_base_device::set_reset_callback(write_line_delegate callback) // fault_addr = address to indicate fault at // rw = 0 for read, 1 for write // fc = 3-bit function code of access (usually you'd just put what m68k_get_fc() returns here) -void m68000_base_device::set_buserror_details(UINT32 fault_addr, UINT8 rw, UINT8 fc) +void m68000_base_device::set_buserror_details(uint32_t fault_addr, uint8_t rw, uint8_t fc) { aerr_address = fault_addr; aerr_write_mode = rw; @@ -1682,7 +1682,7 @@ void m68000_base_device::set_tas_write_callback(write8_delegate callback) tas_write_callback = callback; } -UINT16 m68000_base_device::get_fc() +uint16_t m68000_base_device::get_fc() { return mmu_tmp_fc; } @@ -1693,7 +1693,7 @@ UINT16 m68000_base_device::get_fc() void m68000_base_device::define_state(void) { - UINT32 addrmask = (cpu_type & MASK_24BIT_SPACE) ? 0xffffff : 0xffffffff; + uint32_t addrmask = (cpu_type & MASK_24BIT_SPACE) ? 0xffffff : 0xffffffff; state_add(STATE_GENPC, "PC", pc).mask(addrmask).callimport(); state_add(STATE_GENPCBASE, "CURPC", ppc).mask(addrmask).callimport().noshow(); @@ -2178,33 +2178,33 @@ CPU_DISASSEMBLE( dasm_coldfire ) return m68k_disassemble_raw(buffer, pc, oprom, opram, M68K_CPU_TYPE_COLDFIRE); } -offs_t m68000_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); } -offs_t m68000_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); } -offs_t m68301_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); } -offs_t m68008_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68008)(this, buffer, pc, oprom, opram, options); } -offs_t m68008plcc_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68008)(this, buffer, pc, oprom, opram, options); } -offs_t m68010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68010)(this, buffer, pc, oprom, opram, options); } -offs_t m68ec020_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } -offs_t m68020_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } -offs_t m68020fpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } -offs_t m68020pmmu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } -offs_t m68020hmmu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } -offs_t m68ec030_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68ec030)(this, buffer, pc, oprom, opram, options); } -offs_t m68030_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68030)(this, buffer, pc, oprom, opram, options); } -offs_t m68ec040_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68ec040)(this, buffer, pc, oprom, opram, options); } -offs_t m68lc040_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68lc040)(this, buffer, pc, oprom, opram, options); } -offs_t m68040_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68040)(this, buffer, pc, oprom, opram, options); } -offs_t scc68070_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); } -offs_t fscpu32_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_fscpu32)(this, buffer, pc, oprom, opram, options); } -offs_t mcf5206e_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_coldfire)(this, buffer, pc, oprom, opram, options); } +offs_t m68000_base_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); } +offs_t m68000_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); } +offs_t m68301_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); } +offs_t m68008_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68008)(this, buffer, pc, oprom, opram, options); } +offs_t m68008plcc_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68008)(this, buffer, pc, oprom, opram, options); } +offs_t m68010_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68010)(this, buffer, pc, oprom, opram, options); } +offs_t m68ec020_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } +offs_t m68020_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } +offs_t m68020fpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } +offs_t m68020pmmu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } +offs_t m68020hmmu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); } +offs_t m68ec030_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68ec030)(this, buffer, pc, oprom, opram, options); } +offs_t m68030_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68030)(this, buffer, pc, oprom, opram, options); } +offs_t m68ec040_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68ec040)(this, buffer, pc, oprom, opram, options); } +offs_t m68lc040_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68lc040)(this, buffer, pc, oprom, opram, options); } +offs_t m68040_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68040)(this, buffer, pc, oprom, opram, options); } +offs_t scc68070_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); } +offs_t fscpu32_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_fscpu32)(this, buffer, pc, oprom, opram, options); } +offs_t mcf5206e_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(dasm_coldfire)(this, buffer, pc, oprom, opram, options); } /* Service an interrupt request and start exception processing */ -void m68000_base_device::m68ki_exception_interrupt(m68000_base_device *m68k, UINT32 int_level) +void m68000_base_device::m68ki_exception_interrupt(m68000_base_device *m68k, uint32_t int_level) { - UINT32 vector; - UINT32 sr; - UINT32 new_pc; + uint32_t vector; + uint32_t sr; + uint32_t new_pc; if(CPU_TYPE_IS_000(cpu_type)) { @@ -2267,7 +2267,7 @@ const device_type M68K = &device_creator; // h6280_device - constructor //------------------------------------------------- -m68000_base_device::m68000_base_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68000_base_device::m68000_base_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, M68K, "M68K", tag, owner, clock, "m68k", __FILE__), m_program_config("program", ENDIANNESS_BIG, 16, 24), m_oprogram_config("decrypted_opcodes", ENDIANNESS_BIG, 16, 24) @@ -2278,8 +2278,8 @@ m68000_base_device::m68000_base_device(const machine_config &mconfig, const char -m68000_base_device::m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source) +m68000_base_device::m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_BIG, prg_data_width, prg_address_bits, 0, internal_map), m_oprogram_config("decrypted_opcodes", ENDIANNESS_BIG, prg_data_width, prg_address_bits, 0, internal_map) @@ -2288,8 +2288,8 @@ m68000_base_device::m68000_base_device(const machine_config &mconfig, const char } -m68000_base_device::m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, const char *shortname, const char *source) +m68000_base_device::m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t prg_address_bits, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_BIG, prg_data_width, prg_address_bits), m_oprogram_config("decrypted_opcodes", ENDIANNESS_BIG, prg_data_width, prg_address_bits) @@ -2504,12 +2504,12 @@ const device_type SCC68070 = &device_creator; const device_type FSCPU32 = &device_creator; const device_type MCF5206E = &device_creator; -m68000_device::m68000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68000_device::m68000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68000", tag, owner, clock, M68000, 16,24, "m68000", __FILE__) { } -m68000_device::m68000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +m68000_device::m68000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : m68000_base_device(mconfig, "M68000", tag, owner, clock, M68000, 16,24, shortname, source) { } @@ -2519,8 +2519,8 @@ void m68000_device::device_start() init_cpu_m68000(); } -m68000_device::m68000_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source) +m68000_device::m68000_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source) : m68000_base_device(mconfig, name, tag, owner, clock, type, prg_data_width, prg_address_bits, internal_map, shortname, source) { } @@ -2529,7 +2529,7 @@ m68000_device::m68000_device(const machine_config &mconfig, const char *name, co -m68301_device::m68301_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68301_device::m68301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68301", tag, owner, clock, M68301, 16,24, "m68301", __FILE__) { } @@ -2547,7 +2547,7 @@ void m68301_device::device_start() /* m68008_device */ -m68008_device::m68008_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68008_device::m68008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68008", tag, owner, clock, M68008, 8,20, "m68008", __FILE__) { } @@ -2558,7 +2558,7 @@ void m68008_device::device_start() } -m68008plcc_device::m68008plcc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68008plcc_device::m68008plcc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68008PLCC", tag, owner, clock, M68008, 8,22, "m68008plcc", __FILE__) { } @@ -2570,7 +2570,7 @@ void m68008plcc_device::device_start() -m68010_device::m68010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68010_device::m68010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68010", tag, owner, clock, M68010, 16,24, "m68010", __FILE__) { } @@ -2582,7 +2582,7 @@ void m68010_device::device_start() -m68020_device::m68020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68020_device::m68020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68020", tag, owner, clock, M68020, 32,32, "m68020", __FILE__) { } @@ -2593,7 +2593,7 @@ void m68020_device::device_start() } -m68020fpu_device::m68020fpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68020fpu_device::m68020fpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68020FPU", tag, owner, clock, M68020, 32,32, "m68020fpu", __FILE__) { } @@ -2604,7 +2604,7 @@ void m68020fpu_device::device_start() } // 68020 with 68851 PMMU -m68020pmmu_device::m68020pmmu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68020pmmu_device::m68020pmmu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68020PMMU", tag, owner, clock, M68020PMMU, 32,32, "m68020pmmu", __FILE__) { } @@ -2629,7 +2629,7 @@ bool m68020hmmu_device::memory_translate(address_spacenum space, int intention, // 68020 with Apple HMMU & 68881 FPU // case CPUINFO_FCT_TRANSLATE: info->translate = CPU_TRANSLATE_NAME(m68khmmu); break; -m68020hmmu_device::m68020hmmu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68020hmmu_device::m68020hmmu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68020HMMU", tag, owner, clock, M68020HMMU, 32,32, "m68020hmmu", __FILE__) { } @@ -2640,7 +2640,7 @@ void m68020hmmu_device::device_start() } -m68ec020_device::m68ec020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68ec020_device::m68ec020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68EC020", tag, owner, clock, M68EC020, 32,24, "m68ec020", __FILE__) { } @@ -2650,7 +2650,7 @@ void m68ec020_device::device_start() init_cpu_m68ec020(); } -m68030_device::m68030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68030_device::m68030_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68030", tag, owner, clock, M68030, 32,32, "m68030", __FILE__) { } @@ -2660,7 +2660,7 @@ void m68030_device::device_start() init_cpu_m68030(); } -m68ec030_device::m68ec030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68ec030_device::m68ec030_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68EC030", tag, owner, clock, M68EC030, 32,32, "m68ec030", __FILE__) { } @@ -2670,7 +2670,7 @@ void m68ec030_device::device_start() init_cpu_m68ec030(); } -m68040_device::m68040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68040_device::m68040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68040", tag, owner, clock, M68040, 32,32, "m68040", __FILE__) { } @@ -2683,7 +2683,7 @@ void m68040_device::device_start() -m68ec040_device::m68ec040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68ec040_device::m68ec040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68EC040", tag, owner, clock, M68EC040, 32,32, "m68ec040", __FILE__) { } @@ -2695,7 +2695,7 @@ void m68ec040_device::device_start() -m68lc040_device::m68lc040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68lc040_device::m68lc040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "M68LC040", tag, owner, clock, M68LC040, 32,32, "m68lc040", __FILE__) { } @@ -2706,7 +2706,7 @@ void m68lc040_device::device_start() } -scc68070_device::scc68070_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scc68070_device::scc68070_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "SCC68070", tag, owner, clock, SCC68070, 16,32, "scc68070", __FILE__) { } @@ -2717,13 +2717,13 @@ void scc68070_device::device_start() } -fscpu32_device::fscpu32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fscpu32_device::fscpu32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "Freescale CPU32 Core", tag, owner, clock, FSCPU32, 32,32, "fscpu32", __FILE__) { } -fscpu32_device::fscpu32_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, - const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source) +fscpu32_device::fscpu32_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, + const device_type type, uint32_t prg_data_width, uint32_t prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source) : m68000_base_device(mconfig, name, tag, owner, clock, type, prg_data_width, prg_address_bits, internal_map, shortname, source) { } @@ -2736,7 +2736,7 @@ void fscpu32_device::device_start() -mcf5206e_device::mcf5206e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mcf5206e_device::mcf5206e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_base_device(mconfig, "MCF5206E", tag, owner, clock, MCF5206E, 32,32, "mcf5206e", __FILE__) { } diff --git a/src/devices/cpu/m68000/m68kcpu.h b/src/devices/cpu/m68000/m68kcpu.h index 7860298988f..e452ece67ec 100644 --- a/src/devices/cpu/m68000/m68kcpu.h +++ b/src/devices/cpu/m68000/m68kcpu.h @@ -36,9 +36,9 @@ class m68000_base_device; /* ======================================================================== */ /* Check for > 32bit sizes */ -#define MAKE_INT_8(A) (INT8)(A) -#define MAKE_INT_16(A) (INT16)(A) -#define MAKE_INT_32(A) (INT32)(A) +#define MAKE_INT_8(A) (int8_t)(A) +#define MAKE_INT_16(A) (int16_t)(A) +#define MAKE_INT_32(A) (int32_t)(A) /* ======================================================================== */ @@ -475,7 +475,7 @@ class m68000_base_device; union fp_reg { - UINT64 i; + uint64_t i; double f; }; @@ -489,117 +489,117 @@ public: -extern const UINT8 m68ki_shift_8_table[]; -extern const UINT16 m68ki_shift_16_table[]; -extern const UINT32 m68ki_shift_32_table[]; -extern const UINT8 m68ki_exception_cycle_table[][256]; -extern const UINT8 m68ki_ea_idx_cycle_table[]; +extern const uint8_t m68ki_shift_8_table[]; +extern const uint16_t m68ki_shift_16_table[]; +extern const uint32_t m68ki_shift_32_table[]; +extern const uint8_t m68ki_exception_cycle_table[][256]; +extern const uint8_t m68ki_ea_idx_cycle_table[]; /* Read data immediately after the program counter */ -static inline UINT32 m68ki_read_imm_16(m68000_base_device *m68k); -static inline UINT32 m68ki_read_imm_32(m68000_base_device *m68k); +static inline uint32_t m68ki_read_imm_16(m68000_base_device *m68k); +static inline uint32_t m68ki_read_imm_32(m68000_base_device *m68k); /* Read data with specific function code */ -static inline UINT32 m68ki_read_8_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc); -static inline UINT32 m68ki_read_16_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc); -static inline UINT32 m68ki_read_32_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc); +static inline uint32_t m68ki_read_8_fc (m68000_base_device *m68k, uint32_t address, uint32_t fc); +static inline uint32_t m68ki_read_16_fc (m68000_base_device *m68k, uint32_t address, uint32_t fc); +static inline uint32_t m68ki_read_32_fc (m68000_base_device *m68k, uint32_t address, uint32_t fc); /* Write data with specific function code */ -static inline void m68ki_write_8_fc (m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); -static inline void m68ki_write_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); -static inline void m68ki_write_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); -static inline void m68ki_write_32_pd_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value); +static inline void m68ki_write_8_fc (m68000_base_device *m68k, uint32_t address, uint32_t fc, uint32_t value); +static inline void m68ki_write_16_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc, uint32_t value); +static inline void m68ki_write_32_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc, uint32_t value); +static inline void m68ki_write_32_pd_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc, uint32_t value); /* Indexed and PC-relative ea fetching */ -static inline UINT32 m68ki_get_ea_pcdi(m68000_base_device *m68k); -static inline UINT32 m68ki_get_ea_pcix(m68000_base_device *m68k); -static inline UINT32 m68ki_get_ea_ix(m68000_base_device *m68k, UINT32 An); +static inline uint32_t m68ki_get_ea_pcdi(m68000_base_device *m68k); +static inline uint32_t m68ki_get_ea_pcix(m68000_base_device *m68k); +static inline uint32_t m68ki_get_ea_ix(m68000_base_device *m68k, uint32_t An); /* Operand fetching */ -static inline UINT32 OPER_AY_AI_8(m68000_base_device *m68k); -static inline UINT32 OPER_AY_AI_16(m68000_base_device *m68k); -static inline UINT32 OPER_AY_AI_32(m68000_base_device *m68k); -static inline UINT32 OPER_AY_PI_8(m68000_base_device *m68k); -static inline UINT32 OPER_AY_PI_16(m68000_base_device *m68k); -static inline UINT32 OPER_AY_PI_32(m68000_base_device *m68k); -static inline UINT32 OPER_AY_PD_8(m68000_base_device *m68k); -static inline UINT32 OPER_AY_PD_16(m68000_base_device *m68k); -static inline UINT32 OPER_AY_PD_32(m68000_base_device *m68k); -static inline UINT32 OPER_AY_DI_8(m68000_base_device *m68k); -static inline UINT32 OPER_AY_DI_16(m68000_base_device *m68k); -static inline UINT32 OPER_AY_DI_32(m68000_base_device *m68k); -static inline UINT32 OPER_AY_IX_8(m68000_base_device *m68k); -static inline UINT32 OPER_AY_IX_16(m68000_base_device *m68k); -static inline UINT32 OPER_AY_IX_32(m68000_base_device *m68k); - -static inline UINT32 OPER_AX_AI_8(m68000_base_device *m68k); -static inline UINT32 OPER_AX_AI_16(m68000_base_device *m68k); -static inline UINT32 OPER_AX_AI_32(m68000_base_device *m68k); -static inline UINT32 OPER_AX_PI_8(m68000_base_device *m68k); -static inline UINT32 OPER_AX_PI_16(m68000_base_device *m68k); -static inline UINT32 OPER_AX_PI_32(m68000_base_device *m68k); -static inline UINT32 OPER_AX_PD_8(m68000_base_device *m68k); -static inline UINT32 OPER_AX_PD_16(m68000_base_device *m68k); -static inline UINT32 OPER_AX_PD_32(m68000_base_device *m68k); -static inline UINT32 OPER_AX_DI_8(m68000_base_device *m68k); -static inline UINT32 OPER_AX_DI_16(m68000_base_device *m68k); -static inline UINT32 OPER_AX_DI_32(m68000_base_device *m68k); -static inline UINT32 OPER_AX_IX_8(m68000_base_device *m68k); -static inline UINT32 OPER_AX_IX_16(m68000_base_device *m68k); -static inline UINT32 OPER_AX_IX_32(m68000_base_device *m68k); - -static inline UINT32 OPER_A7_PI_8(m68000_base_device *m68k); -static inline UINT32 OPER_A7_PD_8(m68000_base_device *m68k); - -static inline UINT32 OPER_AW_8(m68000_base_device *m68k); -static inline UINT32 OPER_AW_16(m68000_base_device *m68k); -static inline UINT32 OPER_AW_32(m68000_base_device *m68k); -static inline UINT32 OPER_AL_8(m68000_base_device *m68k); -static inline UINT32 OPER_AL_16(m68000_base_device *m68k); -static inline UINT32 OPER_AL_32(m68000_base_device *m68k); -static inline UINT32 OPER_PCDI_8(m68000_base_device *m68k); -static inline UINT32 OPER_PCDI_16(m68000_base_device *m68k); -static inline UINT32 OPER_PCDI_32(m68000_base_device *m68k); -static inline UINT32 OPER_PCIX_8(m68000_base_device *m68k); -static inline UINT32 OPER_PCIX_16(m68000_base_device *m68k); -static inline UINT32 OPER_PCIX_32(m68000_base_device *m68k); +static inline uint32_t OPER_AY_AI_8(m68000_base_device *m68k); +static inline uint32_t OPER_AY_AI_16(m68000_base_device *m68k); +static inline uint32_t OPER_AY_AI_32(m68000_base_device *m68k); +static inline uint32_t OPER_AY_PI_8(m68000_base_device *m68k); +static inline uint32_t OPER_AY_PI_16(m68000_base_device *m68k); +static inline uint32_t OPER_AY_PI_32(m68000_base_device *m68k); +static inline uint32_t OPER_AY_PD_8(m68000_base_device *m68k); +static inline uint32_t OPER_AY_PD_16(m68000_base_device *m68k); +static inline uint32_t OPER_AY_PD_32(m68000_base_device *m68k); +static inline uint32_t OPER_AY_DI_8(m68000_base_device *m68k); +static inline uint32_t OPER_AY_DI_16(m68000_base_device *m68k); +static inline uint32_t OPER_AY_DI_32(m68000_base_device *m68k); +static inline uint32_t OPER_AY_IX_8(m68000_base_device *m68k); +static inline uint32_t OPER_AY_IX_16(m68000_base_device *m68k); +static inline uint32_t OPER_AY_IX_32(m68000_base_device *m68k); + +static inline uint32_t OPER_AX_AI_8(m68000_base_device *m68k); +static inline uint32_t OPER_AX_AI_16(m68000_base_device *m68k); +static inline uint32_t OPER_AX_AI_32(m68000_base_device *m68k); +static inline uint32_t OPER_AX_PI_8(m68000_base_device *m68k); +static inline uint32_t OPER_AX_PI_16(m68000_base_device *m68k); +static inline uint32_t OPER_AX_PI_32(m68000_base_device *m68k); +static inline uint32_t OPER_AX_PD_8(m68000_base_device *m68k); +static inline uint32_t OPER_AX_PD_16(m68000_base_device *m68k); +static inline uint32_t OPER_AX_PD_32(m68000_base_device *m68k); +static inline uint32_t OPER_AX_DI_8(m68000_base_device *m68k); +static inline uint32_t OPER_AX_DI_16(m68000_base_device *m68k); +static inline uint32_t OPER_AX_DI_32(m68000_base_device *m68k); +static inline uint32_t OPER_AX_IX_8(m68000_base_device *m68k); +static inline uint32_t OPER_AX_IX_16(m68000_base_device *m68k); +static inline uint32_t OPER_AX_IX_32(m68000_base_device *m68k); + +static inline uint32_t OPER_A7_PI_8(m68000_base_device *m68k); +static inline uint32_t OPER_A7_PD_8(m68000_base_device *m68k); + +static inline uint32_t OPER_AW_8(m68000_base_device *m68k); +static inline uint32_t OPER_AW_16(m68000_base_device *m68k); +static inline uint32_t OPER_AW_32(m68000_base_device *m68k); +static inline uint32_t OPER_AL_8(m68000_base_device *m68k); +static inline uint32_t OPER_AL_16(m68000_base_device *m68k); +static inline uint32_t OPER_AL_32(m68000_base_device *m68k); +static inline uint32_t OPER_PCDI_8(m68000_base_device *m68k); +static inline uint32_t OPER_PCDI_16(m68000_base_device *m68k); +static inline uint32_t OPER_PCDI_32(m68000_base_device *m68k); +static inline uint32_t OPER_PCIX_8(m68000_base_device *m68k); +static inline uint32_t OPER_PCIX_16(m68000_base_device *m68k); +static inline uint32_t OPER_PCIX_32(m68000_base_device *m68k); /* Stack operations */ -static inline void m68ki_push_16(m68000_base_device *m68k, UINT32 value); -static inline void m68ki_push_32(m68000_base_device *m68k, UINT32 value); -static inline UINT32 m68ki_pull_16(m68000_base_device *m68k); -static inline UINT32 m68ki_pull_32(m68000_base_device *m68k); +static inline void m68ki_push_16(m68000_base_device *m68k, uint32_t value); +static inline void m68ki_push_32(m68000_base_device *m68k, uint32_t value); +static inline uint32_t m68ki_pull_16(m68000_base_device *m68k); +static inline uint32_t m68ki_pull_32(m68000_base_device *m68k); /* Program flow operations */ -static inline void m68ki_jump(m68000_base_device *m68k, UINT32 new_pc); -static inline void m68ki_jump_vector(m68000_base_device *m68k, UINT32 vector); -static inline void m68ki_branch_8(m68000_base_device *m68k, UINT32 offset); -static inline void m68ki_branch_16(m68000_base_device *m68k, UINT32 offset); -static inline void m68ki_branch_32(m68000_base_device *m68k, UINT32 offset); +static inline void m68ki_jump(m68000_base_device *m68k, uint32_t new_pc); +static inline void m68ki_jump_vector(m68000_base_device *m68k, uint32_t vector); +static inline void m68ki_branch_8(m68000_base_device *m68k, uint32_t offset); +static inline void m68ki_branch_16(m68000_base_device *m68k, uint32_t offset); +static inline void m68ki_branch_32(m68000_base_device *m68k, uint32_t offset); /* Status register operations. */ -static inline void m68ki_set_s_flag(m68000_base_device *m68k, UINT32 value); /* Only bit 2 of value should be set (i.e. 4 or 0) */ -static inline void m68ki_set_sm_flag(m68000_base_device *m68k, UINT32 value); /* only bits 1 and 2 of value should be set */ -static inline void m68ki_set_ccr(m68000_base_device *m68k, UINT32 value); /* set the condition code register */ -static inline void m68ki_set_sr(m68000_base_device *m68k, UINT32 value); /* set the status register */ -static inline void m68ki_set_sr_noint(m68000_base_device *m68k, UINT32 value); /* set the status register */ +static inline void m68ki_set_s_flag(m68000_base_device *m68k, uint32_t value); /* Only bit 2 of value should be set (i.e. 4 or 0) */ +static inline void m68ki_set_sm_flag(m68000_base_device *m68k, uint32_t value); /* only bits 1 and 2 of value should be set */ +static inline void m68ki_set_ccr(m68000_base_device *m68k, uint32_t value); /* set the condition code register */ +static inline void m68ki_set_sr(m68000_base_device *m68k, uint32_t value); /* set the status register */ +static inline void m68ki_set_sr_noint(m68000_base_device *m68k, uint32_t value); /* set the status register */ /* Exception processing */ -static inline UINT32 m68ki_init_exception(m68000_base_device *m68k); /* Initial exception processing */ +static inline uint32_t m68ki_init_exception(m68000_base_device *m68k); /* Initial exception processing */ -static inline void m68ki_stack_frame_3word(m68000_base_device *m68k, UINT32 pc, UINT32 sr); /* Stack various frame types */ -static inline void m68ki_stack_frame_buserr(m68000_base_device *m68k, UINT32 sr); +static inline void m68ki_stack_frame_3word(m68000_base_device *m68k, uint32_t pc, uint32_t sr); /* Stack various frame types */ +static inline void m68ki_stack_frame_buserr(m68000_base_device *m68k, uint32_t sr); -static inline void m68ki_stack_frame_0000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector); -static inline void m68ki_stack_frame_0001(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector); -static inline void m68ki_stack_frame_0010(m68000_base_device *m68k, UINT32 sr, UINT32 vector); -static inline void m68ki_stack_frame_1000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector); -static inline void m68ki_stack_frame_1010(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address); -static inline void m68ki_stack_frame_1011(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address); -static inline void m68ki_stack_frame_0111(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address, bool in_mmu); +static inline void m68ki_stack_frame_0000(m68000_base_device *m68k, uint32_t pc, uint32_t sr, uint32_t vector); +static inline void m68ki_stack_frame_0001(m68000_base_device *m68k, uint32_t pc, uint32_t sr, uint32_t vector); +static inline void m68ki_stack_frame_0010(m68000_base_device *m68k, uint32_t sr, uint32_t vector); +static inline void m68ki_stack_frame_1000(m68000_base_device *m68k, uint32_t pc, uint32_t sr, uint32_t vector); +static inline void m68ki_stack_frame_1010(m68000_base_device *m68k, uint32_t sr, uint32_t vector, uint32_t pc, uint32_t fault_address); +static inline void m68ki_stack_frame_1011(m68000_base_device *m68k, uint32_t sr, uint32_t vector, uint32_t pc, uint32_t fault_address); +static inline void m68ki_stack_frame_0111(m68000_base_device *m68k, uint32_t sr, uint32_t vector, uint32_t pc, uint32_t fault_address, bool in_mmu); -static inline void m68ki_exception_trap(m68000_base_device *m68k, UINT32 vector); -static inline void m68ki_exception_trapN(m68000_base_device *m68k, UINT32 vector); +static inline void m68ki_exception_trap(m68000_base_device *m68k, uint32_t vector); +static inline void m68ki_exception_trapN(m68000_base_device *m68k, uint32_t vector); static inline void m68ki_exception_trace(m68000_base_device *m68k); static inline void m68ki_exception_privilege_violation(m68000_base_device *m68k); static inline void m68ki_exception_1010(m68000_base_device *m68k); @@ -676,20 +676,20 @@ static inline void m68ki_ic_clear(m68000_base_device *m68k) // read immediate word using the instruction cache -static inline UINT32 m68ki_ic_readimm16(m68000_base_device *m68k, UINT32 address) +static inline uint32_t m68ki_ic_readimm16(m68000_base_device *m68k, uint32_t address) { if (m68k->cacr & M68K_CACR_EI) { // 68020 series I-cache (MC68020 User's Manual, Section 4 - On-Chip Cache Memory) if (m68k->cpu_type & (CPU_TYPE_EC020 | CPU_TYPE_020)) { - UINT32 tag = (address >> 8) | (m68k->s_flag ? 0x1000000 : 0); + uint32_t tag = (address >> 8) | (m68k->s_flag ? 0x1000000 : 0); int idx = (address >> 2) & 0x3f; // 1-of-64 select // do a cache fill if the line is invalid or the tags don't match if ((!m68k->ic_valid[idx]) || (m68k->ic_address[idx] != tag)) { - UINT32 data = m68k->read32(address & ~3); + uint32_t data = m68k->read32(address & ~3); // printf("m68k: doing cache fill at %08x (tag %08x idx %d)\n", address, tag, idx); @@ -725,9 +725,9 @@ static inline UINT32 m68ki_ic_readimm16(m68000_base_device *m68k, UINT32 address /* Handles all immediate reads, does address error check, function code setting, * and prefetching if they are enabled in m68kconf.h */ -static inline UINT32 m68ki_read_imm_16(m68000_base_device *m68k) +static inline uint32_t m68ki_read_imm_16(m68000_base_device *m68k) { - UINT32 result; + uint32_t result; m68k->mmu_tmp_fc = m68k->s_flag | FUNCTION_CODE_USER_PROGRAM; m68k->mmu_tmp_rw = 1; @@ -752,9 +752,9 @@ static inline UINT32 m68ki_read_imm_16(m68000_base_device *m68k) return result; } -static inline UINT32 m68ki_read_imm_32(m68000_base_device *m68k) +static inline uint32_t m68ki_read_imm_32(m68000_base_device *m68k) { - UINT32 temp_val; + uint32_t temp_val; m68k->mmu_tmp_fc = m68k->s_flag | FUNCTION_CODE_USER_PROGRAM; m68k->mmu_tmp_rw = 1; @@ -789,13 +789,13 @@ static inline UINT32 m68ki_read_imm_32(m68000_base_device *m68k) * These functions will also check for address error and set the function * code if they are enabled in m68kconf.h. */ -static inline UINT32 m68ki_read_8_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc) +static inline uint32_t m68ki_read_8_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc) { m68k->mmu_tmp_fc = fc; m68k->mmu_tmp_rw = 1; return m68k->/*memory.*/read8(address); } -static inline UINT32 m68ki_read_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc) +static inline uint32_t m68ki_read_16_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -805,7 +805,7 @@ static inline UINT32 m68ki_read_16_fc(m68000_base_device *m68k, UINT32 address, m68k->mmu_tmp_rw = 1; return m68k->/*memory.*/read16(address); } -static inline UINT32 m68ki_read_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc) +static inline uint32_t m68ki_read_32_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -816,13 +816,13 @@ static inline UINT32 m68ki_read_32_fc(m68000_base_device *m68k, UINT32 address, return m68k->/*memory.*/read32(address); } -static inline void m68ki_write_8_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) +static inline void m68ki_write_8_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc, uint32_t value) { m68k->mmu_tmp_fc = fc; m68k->mmu_tmp_rw = 0; m68k->/*memory.*/write8(address, value); } -static inline void m68ki_write_16_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) +static inline void m68ki_write_16_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc, uint32_t value) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -832,7 +832,7 @@ static inline void m68ki_write_16_fc(m68000_base_device *m68k, UINT32 address, U m68k->mmu_tmp_rw = 0; m68k->/*memory.*/write16(address, value); } -static inline void m68ki_write_32_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) +static inline void m68ki_write_32_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc, uint32_t value) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -848,7 +848,7 @@ static inline void m68ki_write_32_fc(m68000_base_device *m68k, UINT32 address, U * A real 68k first writes the high word to [address+2], and then writes the * low word to [address]. */ -static inline void m68ki_write_32_pd_fc(m68000_base_device *m68k, UINT32 address, UINT32 fc, UINT32 value) +static inline void m68ki_write_32_pd_fc(m68000_base_device *m68k, uint32_t address, uint32_t fc, uint32_t value) { if (CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -866,14 +866,14 @@ static inline void m68ki_write_32_pd_fc(m68000_base_device *m68k, UINT32 address /* The program counter relative addressing modes cause operands to be * retrieved from program space, not data space. */ -static inline UINT32 m68ki_get_ea_pcdi(m68000_base_device *m68k) +static inline uint32_t m68ki_get_ea_pcdi(m68000_base_device *m68k) { - UINT32 old_pc = REG_PC(m68k); + uint32_t old_pc = REG_PC(m68k); return old_pc + MAKE_INT_16(m68ki_read_imm_16(m68k)); } -static inline UINT32 m68ki_get_ea_pcix(m68000_base_device *m68k) +static inline uint32_t m68ki_get_ea_pcix(m68000_base_device *m68k) { return m68ki_get_ea_ix(m68k, REG_PC(m68k)); } @@ -920,13 +920,13 @@ static inline UINT32 m68ki_get_ea_pcix(m68000_base_device *m68k) * 1 011 mem indir with long outer * 1 100-111 reserved */ -static inline UINT32 m68ki_get_ea_ix(m68000_base_device *m68k, UINT32 An) +static inline uint32_t m68ki_get_ea_ix(m68000_base_device *m68k, uint32_t An) { /* An = base register */ - UINT32 extension = m68ki_read_imm_16(m68k); - UINT32 Xn = 0; /* Index register */ - UINT32 bd = 0; /* Base Displacement */ - UINT32 od = 0; /* Outer Displacement */ + uint32_t extension = m68ki_read_imm_16(m68k); + uint32_t Xn = 0; /* Index register */ + uint32_t bd = 0; /* Base Displacement */ + uint32_t od = 0; /* Outer Displacement */ if(CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -993,78 +993,78 @@ static inline UINT32 m68ki_get_ea_ix(m68000_base_device *m68k, UINT32 An) /* Fetch operands */ -static inline UINT32 OPER_AY_AI_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_AI_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AY_AI_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_AI_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AY_AI_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_AI_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_AY_PI_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_PI_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AY_PI_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_PI_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AY_PI_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_PI_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_AY_PD_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_PD_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AY_PD_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_PD_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AY_PD_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_PD_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_AY_DI_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_DI_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AY_DI_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_DI_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AY_DI_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_DI_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_AY_IX_8(m68000_base_device *m68k) {UINT32 ea = EA_AY_IX_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AY_IX_16(m68000_base_device *m68k) {UINT32 ea = EA_AY_IX_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AY_IX_32(m68000_base_device *m68k) {UINT32 ea = EA_AY_IX_32(m68k); return m68ki_read_32(m68k, ea);} - -static inline UINT32 OPER_AX_AI_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_AI_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AX_AI_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_AI_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AX_AI_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_AI_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_AX_PI_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_PI_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AX_PI_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_PI_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AX_PI_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_PI_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_AX_PD_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_PD_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AX_PD_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_PD_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AX_PD_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_PD_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_AX_DI_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_DI_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AX_DI_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_DI_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AX_DI_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_DI_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_AX_IX_8(m68000_base_device *m68k) {UINT32 ea = EA_AX_IX_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AX_IX_16(m68000_base_device *m68k) {UINT32 ea = EA_AX_IX_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AX_IX_32(m68000_base_device *m68k) {UINT32 ea = EA_AX_IX_32(m68k); return m68ki_read_32(m68k, ea);} - -static inline UINT32 OPER_A7_PI_8(m68000_base_device *m68k) {UINT32 ea = EA_A7_PI_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_A7_PD_8(m68000_base_device *m68k) {UINT32 ea = EA_A7_PD_8(m68k); return m68ki_read_8(m68k, ea); } - -static inline UINT32 OPER_AW_8(m68000_base_device *m68k) {UINT32 ea = EA_AW_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AW_16(m68000_base_device *m68k) {UINT32 ea = EA_AW_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AW_32(m68000_base_device *m68k) {UINT32 ea = EA_AW_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_AL_8(m68000_base_device *m68k) {UINT32 ea = EA_AL_8(m68k); return m68ki_read_8(m68k, ea); } -static inline UINT32 OPER_AL_16(m68000_base_device *m68k) {UINT32 ea = EA_AL_16(m68k); return m68ki_read_16(m68k, ea);} -static inline UINT32 OPER_AL_32(m68000_base_device *m68k) {UINT32 ea = EA_AL_32(m68k); return m68ki_read_32(m68k, ea);} -static inline UINT32 OPER_PCDI_8(m68000_base_device *m68k) {UINT32 ea = EA_PCDI_8(m68k); return m68ki_read_pcrel_8(m68k, ea); } -static inline UINT32 OPER_PCDI_16(m68000_base_device *m68k) {UINT32 ea = EA_PCDI_16(m68k); return m68ki_read_pcrel_16(m68k, ea);} -static inline UINT32 OPER_PCDI_32(m68000_base_device *m68k) {UINT32 ea = EA_PCDI_32(m68k); return m68ki_read_pcrel_32(m68k, ea);} -static inline UINT32 OPER_PCIX_8(m68000_base_device *m68k) {UINT32 ea = EA_PCIX_8(m68k); return m68ki_read_pcrel_8(m68k, ea); } -static inline UINT32 OPER_PCIX_16(m68000_base_device *m68k) {UINT32 ea = EA_PCIX_16(m68k); return m68ki_read_pcrel_16(m68k, ea);} -static inline UINT32 OPER_PCIX_32(m68000_base_device *m68k) {UINT32 ea = EA_PCIX_32(m68k); return m68ki_read_pcrel_32(m68k, ea);} +static inline uint32_t OPER_AY_AI_8(m68000_base_device *m68k) {uint32_t ea = EA_AY_AI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AY_AI_16(m68000_base_device *m68k) {uint32_t ea = EA_AY_AI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AY_AI_32(m68000_base_device *m68k) {uint32_t ea = EA_AY_AI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_AY_PI_8(m68000_base_device *m68k) {uint32_t ea = EA_AY_PI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AY_PI_16(m68000_base_device *m68k) {uint32_t ea = EA_AY_PI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AY_PI_32(m68000_base_device *m68k) {uint32_t ea = EA_AY_PI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_AY_PD_8(m68000_base_device *m68k) {uint32_t ea = EA_AY_PD_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AY_PD_16(m68000_base_device *m68k) {uint32_t ea = EA_AY_PD_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AY_PD_32(m68000_base_device *m68k) {uint32_t ea = EA_AY_PD_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_AY_DI_8(m68000_base_device *m68k) {uint32_t ea = EA_AY_DI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AY_DI_16(m68000_base_device *m68k) {uint32_t ea = EA_AY_DI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AY_DI_32(m68000_base_device *m68k) {uint32_t ea = EA_AY_DI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_AY_IX_8(m68000_base_device *m68k) {uint32_t ea = EA_AY_IX_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AY_IX_16(m68000_base_device *m68k) {uint32_t ea = EA_AY_IX_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AY_IX_32(m68000_base_device *m68k) {uint32_t ea = EA_AY_IX_32(m68k); return m68ki_read_32(m68k, ea);} + +static inline uint32_t OPER_AX_AI_8(m68000_base_device *m68k) {uint32_t ea = EA_AX_AI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AX_AI_16(m68000_base_device *m68k) {uint32_t ea = EA_AX_AI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AX_AI_32(m68000_base_device *m68k) {uint32_t ea = EA_AX_AI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_AX_PI_8(m68000_base_device *m68k) {uint32_t ea = EA_AX_PI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AX_PI_16(m68000_base_device *m68k) {uint32_t ea = EA_AX_PI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AX_PI_32(m68000_base_device *m68k) {uint32_t ea = EA_AX_PI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_AX_PD_8(m68000_base_device *m68k) {uint32_t ea = EA_AX_PD_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AX_PD_16(m68000_base_device *m68k) {uint32_t ea = EA_AX_PD_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AX_PD_32(m68000_base_device *m68k) {uint32_t ea = EA_AX_PD_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_AX_DI_8(m68000_base_device *m68k) {uint32_t ea = EA_AX_DI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AX_DI_16(m68000_base_device *m68k) {uint32_t ea = EA_AX_DI_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AX_DI_32(m68000_base_device *m68k) {uint32_t ea = EA_AX_DI_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_AX_IX_8(m68000_base_device *m68k) {uint32_t ea = EA_AX_IX_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AX_IX_16(m68000_base_device *m68k) {uint32_t ea = EA_AX_IX_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AX_IX_32(m68000_base_device *m68k) {uint32_t ea = EA_AX_IX_32(m68k); return m68ki_read_32(m68k, ea);} + +static inline uint32_t OPER_A7_PI_8(m68000_base_device *m68k) {uint32_t ea = EA_A7_PI_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_A7_PD_8(m68000_base_device *m68k) {uint32_t ea = EA_A7_PD_8(m68k); return m68ki_read_8(m68k, ea); } + +static inline uint32_t OPER_AW_8(m68000_base_device *m68k) {uint32_t ea = EA_AW_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AW_16(m68000_base_device *m68k) {uint32_t ea = EA_AW_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AW_32(m68000_base_device *m68k) {uint32_t ea = EA_AW_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_AL_8(m68000_base_device *m68k) {uint32_t ea = EA_AL_8(m68k); return m68ki_read_8(m68k, ea); } +static inline uint32_t OPER_AL_16(m68000_base_device *m68k) {uint32_t ea = EA_AL_16(m68k); return m68ki_read_16(m68k, ea);} +static inline uint32_t OPER_AL_32(m68000_base_device *m68k) {uint32_t ea = EA_AL_32(m68k); return m68ki_read_32(m68k, ea);} +static inline uint32_t OPER_PCDI_8(m68000_base_device *m68k) {uint32_t ea = EA_PCDI_8(m68k); return m68ki_read_pcrel_8(m68k, ea); } +static inline uint32_t OPER_PCDI_16(m68000_base_device *m68k) {uint32_t ea = EA_PCDI_16(m68k); return m68ki_read_pcrel_16(m68k, ea);} +static inline uint32_t OPER_PCDI_32(m68000_base_device *m68k) {uint32_t ea = EA_PCDI_32(m68k); return m68ki_read_pcrel_32(m68k, ea);} +static inline uint32_t OPER_PCIX_8(m68000_base_device *m68k) {uint32_t ea = EA_PCIX_8(m68k); return m68ki_read_pcrel_8(m68k, ea); } +static inline uint32_t OPER_PCIX_16(m68000_base_device *m68k) {uint32_t ea = EA_PCIX_16(m68k); return m68ki_read_pcrel_16(m68k, ea);} +static inline uint32_t OPER_PCIX_32(m68000_base_device *m68k) {uint32_t ea = EA_PCIX_32(m68k); return m68ki_read_pcrel_32(m68k, ea);} /* ---------------------------- Stack Functions --------------------------- */ /* Push/pull data from the stack */ -static inline void m68ki_push_16(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_push_16(m68000_base_device *m68k, uint32_t value) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) - 2); m68ki_write_16(m68k, REG_SP(m68k), value); } -static inline void m68ki_push_32(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_push_32(m68000_base_device *m68k, uint32_t value) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) - 4); m68ki_write_32(m68k, REG_SP(m68k), value); } -static inline UINT32 m68ki_pull_16(m68000_base_device *m68k) +static inline uint32_t m68ki_pull_16(m68000_base_device *m68k) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) + 2); return m68ki_read_16(m68k, REG_SP(m68k)-2); } -static inline UINT32 m68ki_pull_32(m68000_base_device *m68k) +static inline uint32_t m68ki_pull_32(m68000_base_device *m68k) { REG_SP(m68k) = MASK_OUT_ABOVE_32(REG_SP(m68k) + 4); return m68ki_read_32(m68k, REG_SP(m68k)-4); @@ -1101,12 +1101,12 @@ static inline void m68ki_fake_pull_32(m68000_base_device *m68k) * These functions will also call the pc_changed callback if it was enabled * in m68kconf.h. */ -static inline void m68ki_jump(m68000_base_device *m68k, UINT32 new_pc) +static inline void m68ki_jump(m68000_base_device *m68k, uint32_t new_pc) { REG_PC(m68k) = new_pc; } -static inline void m68ki_jump_vector(m68000_base_device *m68k, UINT32 vector) +static inline void m68ki_jump_vector(m68000_base_device *m68k, uint32_t vector) { REG_PC(m68k) = (vector<<2) + m68k->vbr; REG_PC(m68k) = m68ki_read_data_32(m68k, REG_PC(m68k)); @@ -1118,17 +1118,17 @@ static inline void m68ki_jump_vector(m68000_base_device *m68k, UINT32 vector) * So far I've found no problems with not calling pc_changed for 8 or 16 * bit branches. */ -static inline void m68ki_branch_8(m68000_base_device *m68k, UINT32 offset) +static inline void m68ki_branch_8(m68000_base_device *m68k, uint32_t offset) { REG_PC(m68k) += MAKE_INT_8(offset); } -static inline void m68ki_branch_16(m68000_base_device *m68k, UINT32 offset) +static inline void m68ki_branch_16(m68000_base_device *m68k, uint32_t offset) { REG_PC(m68k) += MAKE_INT_16(offset); } -static inline void m68ki_branch_32(m68000_base_device *m68k, UINT32 offset) +static inline void m68ki_branch_32(m68000_base_device *m68k, uint32_t offset) { REG_PC(m68k) += offset; } @@ -1140,7 +1140,7 @@ static inline void m68ki_branch_32(m68000_base_device *m68k, UINT32 offset) /* Set the S flag and change the active stack pointer. * Note that value MUST be 4 or 0. */ -static inline void m68ki_set_s_flag(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_s_flag(m68000_base_device *m68k, uint32_t value) { /* Backup the old stack pointer */ REG_SP_BASE(m68k)[m68k->s_flag | ((m68k->s_flag>>1) & m68k->m_flag)] = REG_SP(m68k); @@ -1153,7 +1153,7 @@ static inline void m68ki_set_s_flag(m68000_base_device *m68k, UINT32 value) /* Set the S and M flags and change the active stack pointer. * Note that value MUST be 0, 2, 4, or 6 (bit2 = S, bit1 = M). */ -static inline void m68ki_set_sm_flag(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sm_flag(m68000_base_device *m68k, uint32_t value) { /* Backup the old stack pointer */ REG_SP_BASE(m68k)[m68k->s_flag | ((m68k->s_flag>>1) & m68k->m_flag)] = REG_SP(m68k); @@ -1165,7 +1165,7 @@ static inline void m68ki_set_sm_flag(m68000_base_device *m68k, UINT32 value) } /* Set the S and M flags. Don't touch the stack pointer. */ -static inline void m68ki_set_sm_flag_nosp(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sm_flag_nosp(m68000_base_device *m68k, uint32_t value) { /* Set the S and M flags */ m68k->s_flag = value & SFLAG_SET; @@ -1174,7 +1174,7 @@ static inline void m68ki_set_sm_flag_nosp(m68000_base_device *m68k, UINT32 value /* Set the condition code register */ -static inline void m68ki_set_ccr(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_ccr(m68000_base_device *m68k, uint32_t value) { m68k->x_flag = BIT_4(value) << 4; m68k->n_flag = BIT_3(value) << 4; @@ -1184,7 +1184,7 @@ static inline void m68ki_set_ccr(m68000_base_device *m68k, UINT32 value) } /* Set the status register but don't check for interrupts */ -static inline void m68ki_set_sr_noint(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sr_noint(m68000_base_device *m68k, uint32_t value) { /* Mask out the "unimplemented" bits */ value &= m68k->sr_mask; @@ -1200,7 +1200,7 @@ static inline void m68ki_set_sr_noint(m68000_base_device *m68k, UINT32 value) /* Set the status register but don't check for interrupts nor * change the stack pointer */ -static inline void m68ki_set_sr_noint_nosp(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sr_noint_nosp(m68000_base_device *m68k, uint32_t value) { /* Mask out the "unimplemented" bits */ value &= m68k->sr_mask; @@ -1214,7 +1214,7 @@ static inline void m68ki_set_sr_noint_nosp(m68000_base_device *m68k, UINT32 valu } /* Set the status register and check for interrupts */ -static inline void m68ki_set_sr(m68000_base_device *m68k, UINT32 value) +static inline void m68ki_set_sr(m68000_base_device *m68k, uint32_t value) { m68ki_set_sr_noint(m68k, value); m68ki_check_interrupts(m68k); @@ -1224,10 +1224,10 @@ static inline void m68ki_set_sr(m68000_base_device *m68k, UINT32 value) /* ------------------------- Exception Processing ------------------------- */ /* Initiate exception processing */ -static inline UINT32 m68ki_init_exception(m68000_base_device *m68k) +static inline uint32_t m68ki_init_exception(m68000_base_device *m68k) { /* Save the old status register */ - UINT32 sr = m68ki_get_sr(m68k); + uint32_t sr = m68ki_get_sr(m68k); /* Turn off trace flag, clear pending traces */ m68k->t1_flag = m68k->t0_flag = 0; @@ -1239,7 +1239,7 @@ static inline UINT32 m68ki_init_exception(m68000_base_device *m68k) } /* 3 word stack frame (68000 only) */ -static inline void m68ki_stack_frame_3word(m68000_base_device *m68k, UINT32 pc, UINT32 sr) +static inline void m68ki_stack_frame_3word(m68000_base_device *m68k, uint32_t pc, uint32_t sr) { m68ki_push_32(m68k, pc); m68ki_push_16(m68k, sr); @@ -1248,7 +1248,7 @@ static inline void m68ki_stack_frame_3word(m68000_base_device *m68k, UINT32 pc, /* Format 0 stack frame. * This is the standard stack frame for 68010+. */ -static inline void m68ki_stack_frame_0000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector) +static inline void m68ki_stack_frame_0000(m68000_base_device *m68k, uint32_t pc, uint32_t sr, uint32_t vector) { /* Stack a 3-word frame if we are 68000 */ if(m68k->cpu_type == CPU_TYPE_000 || m68k->cpu_type == CPU_TYPE_008) @@ -1264,7 +1264,7 @@ static inline void m68ki_stack_frame_0000(m68000_base_device *m68k, UINT32 pc, U /* Format 1 stack frame (68020). * For 68020, this is the 4 word throwaway frame. */ -static inline void m68ki_stack_frame_0001(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector) +static inline void m68ki_stack_frame_0001(m68000_base_device *m68k, uint32_t pc, uint32_t sr, uint32_t vector) { m68ki_push_16(m68k, 0x1000 | (vector<<2)); m68ki_push_32(m68k, pc); @@ -1274,7 +1274,7 @@ static inline void m68ki_stack_frame_0001(m68000_base_device *m68k, UINT32 pc, U /* Format 2 stack frame. * This is used only by 68020 for trap exceptions. */ -static inline void m68ki_stack_frame_0010(m68000_base_device *m68k, UINT32 sr, UINT32 vector) +static inline void m68ki_stack_frame_0010(m68000_base_device *m68k, uint32_t sr, uint32_t vector) { m68ki_push_32(m68k, REG_PPC(m68k)); m68ki_push_16(m68k, 0x2000 | (vector<<2)); @@ -1285,7 +1285,7 @@ static inline void m68ki_stack_frame_0010(m68000_base_device *m68k, UINT32 sr, U /* Bus error stack frame (68000 only). */ -static inline void m68ki_stack_frame_buserr(m68000_base_device *m68k, UINT32 sr) +static inline void m68ki_stack_frame_buserr(m68000_base_device *m68k, uint32_t sr) { m68ki_push_32(m68k, REG_PC(m68k)); m68ki_push_16(m68k, sr); @@ -1302,7 +1302,7 @@ static inline void m68ki_stack_frame_buserr(m68000_base_device *m68k, UINT32 sr) /* Format 8 stack frame (68010). * 68010 only. This is the 29 word bus/address error frame. */ -static inline void m68ki_stack_frame_1000(m68000_base_device *m68k, UINT32 pc, UINT32 sr, UINT32 vector) +static inline void m68ki_stack_frame_1000(m68000_base_device *m68k, uint32_t pc, uint32_t sr, uint32_t vector) { /* VERSION * NUMBER @@ -1356,7 +1356,7 @@ static inline void m68ki_stack_frame_1000(m68000_base_device *m68k, UINT32 pc, U * if the error happens at an instruction boundary. * PC stacked is address of next instruction. */ -static inline void m68ki_stack_frame_1010(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address) +static inline void m68ki_stack_frame_1010(m68000_base_device *m68k, uint32_t sr, uint32_t vector, uint32_t pc, uint32_t fault_address) { int orig_rw = m68k->mmu_tmp_buserror_rw; // this gets splatted by the following pushes, so save it now int orig_fc = m68k->mmu_tmp_buserror_fc; @@ -1408,7 +1408,7 @@ static inline void m68ki_stack_frame_1010(m68000_base_device *m68k, UINT32 sr, U * if the error happens during instruction execution. * PC stacked is address of instruction in progress. */ -static inline void m68ki_stack_frame_1011(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address) +static inline void m68ki_stack_frame_1011(m68000_base_device *m68k, uint32_t sr, uint32_t vector, uint32_t pc, uint32_t fault_address) { int orig_rw = m68k->mmu_tmp_buserror_rw; // this gets splatted by the following pushes, so save it now int orig_fc = m68k->mmu_tmp_buserror_fc; @@ -1482,7 +1482,7 @@ static inline void m68ki_stack_frame_1011(m68000_base_device *m68k, UINT32 sr, U * This is used by the 68040 for bus fault and mmu trap * 30 words */ -static inline void m68ki_stack_frame_0111(m68000_base_device *m68k, UINT32 sr, UINT32 vector, UINT32 pc, UINT32 fault_address, bool in_mmu) +static inline void m68ki_stack_frame_0111(m68000_base_device *m68k, uint32_t sr, uint32_t vector, uint32_t pc, uint32_t fault_address, bool in_mmu) { int orig_rw = m68k->mmu_tmp_buserror_rw; // this gets splatted by the following pushes, so save it now int orig_fc = m68k->mmu_tmp_buserror_fc; @@ -1525,9 +1525,9 @@ static inline void m68ki_stack_frame_0111(m68000_base_device *m68k, UINT32 sr, U /* Used for Group 2 exceptions. * These stack a type 2 frame on the 020. */ -static inline void m68ki_exception_trap(m68000_base_device *m68k, UINT32 vector) +static inline void m68ki_exception_trap(m68000_base_device *m68k, uint32_t vector) { - UINT32 sr = m68ki_init_exception(m68k); + uint32_t sr = m68ki_init_exception(m68k); if(CPU_TYPE_IS_010_LESS(m68k->cpu_type)) m68ki_stack_frame_0000(m68k, REG_PC(m68k), sr, vector); @@ -1541,9 +1541,9 @@ static inline void m68ki_exception_trap(m68000_base_device *m68k, UINT32 vector) } /* Trap#n stacks a 0 frame but behaves like group2 otherwise */ -static inline void m68ki_exception_trapN(m68000_base_device *m68k, UINT32 vector) +static inline void m68ki_exception_trapN(m68000_base_device *m68k, uint32_t vector) { - UINT32 sr = m68ki_init_exception(m68k); + uint32_t sr = m68ki_init_exception(m68k); m68ki_stack_frame_0000(m68k, REG_PC(m68k), sr, vector); m68ki_jump_vector(m68k, vector); @@ -1554,7 +1554,7 @@ static inline void m68ki_exception_trapN(m68000_base_device *m68k, UINT32 vector /* Exception for trace mode */ static inline void m68ki_exception_trace(m68000_base_device *m68k) { - UINT32 sr = m68ki_init_exception(m68k); + uint32_t sr = m68ki_init_exception(m68k); if(CPU_TYPE_IS_010_LESS(m68k->cpu_type)) { @@ -1579,7 +1579,7 @@ static inline void m68ki_exception_trace(m68000_base_device *m68k) /* Exception for privilege violation */ static inline void m68ki_exception_privilege_violation(m68000_base_device *m68k) { - UINT32 sr = m68ki_init_exception(m68k); + uint32_t sr = m68ki_init_exception(m68k); if(CPU_TYPE_IS_000(m68k->cpu_type)) { @@ -1596,7 +1596,7 @@ static inline void m68ki_exception_privilege_violation(m68000_base_device *m68k) /* Exception for A-Line instructions */ static inline void m68ki_exception_1010(m68000_base_device *m68k) { - UINT32 sr; + uint32_t sr; sr = m68ki_init_exception(m68k); m68ki_stack_frame_0000(m68k, REG_PPC(m68k), sr, EXCEPTION_1010); @@ -1609,7 +1609,7 @@ static inline void m68ki_exception_1010(m68000_base_device *m68k) /* Exception for F-Line instructions */ static inline void m68ki_exception_1111(m68000_base_device *m68k) { - UINT32 sr; + uint32_t sr; sr = m68ki_init_exception(m68k); m68ki_stack_frame_0000(m68k, REG_PPC(m68k), sr, EXCEPTION_1111); @@ -1622,7 +1622,7 @@ static inline void m68ki_exception_1111(m68000_base_device *m68k) /* Exception for illegal instructions */ static inline void m68ki_exception_illegal(m68000_base_device *m68k) { - UINT32 sr; + uint32_t sr; sr = m68ki_init_exception(m68k); @@ -1641,7 +1641,7 @@ static inline void m68ki_exception_illegal(m68000_base_device *m68k) /* Exception for format errror in RTE */ static inline void m68ki_exception_format_error(m68000_base_device *m68k) { - UINT32 sr = m68ki_init_exception(m68k); + uint32_t sr = m68ki_init_exception(m68k); m68ki_stack_frame_0000(m68k, REG_PC(m68k), sr, EXCEPTION_FORMAT_ERROR); m68ki_jump_vector(m68k, EXCEPTION_FORMAT_ERROR); @@ -1652,7 +1652,7 @@ static inline void m68ki_exception_format_error(m68000_base_device *m68k) /* Exception for address error */ static inline void m68ki_exception_address_error(m68000_base_device *m68k) { - UINT32 sr = m68ki_init_exception(m68k); + uint32_t sr = m68ki_init_exception(m68k); /* If we were processing a bus error, address error, or reset, * this is a catastrophic failure. diff --git a/src/devices/cpu/m68000/m68kdasm.cpp b/src/devices/cpu/m68000/m68kdasm.cpp index c48d128bc40..8f9e9987cb8 100644 --- a/src/devices/cpu/m68000/m68kdasm.cpp +++ b/src/devices/cpu/m68000/m68kdasm.cpp @@ -31,8 +31,8 @@ /* ======================================================================== */ /* unsigned int and int must be at least 32 bits wide */ -#undef UINT32 -#define UINT32 unsigned int +#undef uint32_t +#define uint32_t unsigned int /* Bit Isolation Functions */ #define BIT_0(A) ((A) & 0x00000001) @@ -127,14 +127,14 @@ /* ======================================================================== */ /* Read data at the PC and increment PC */ -UINT32 read_imm_8(void); -UINT32 read_imm_16(void); -UINT32 read_imm_32(void); +uint32_t read_imm_8(void); +uint32_t read_imm_16(void); +uint32_t read_imm_32(void); /* Read data at the PC but don't imcrement the PC */ -UINT32 peek_imm_8(void); -UINT32 peek_imm_16(void); -UINT32 peek_imm_32(void); +uint32_t peek_imm_8(void); +uint32_t peek_imm_16(void); +uint32_t peek_imm_32(void); /* make signed integers 100% portably */ static int make_int_8(int value); @@ -142,20 +142,20 @@ static int make_int_16(int value); static int make_int_32(int value); /* make a string of a hex value */ -static char* make_signed_hex_str_8(UINT32 val); -static char* make_signed_hex_str_16(UINT32 val); -static char* make_signed_hex_str_32(UINT32 val); +static char* make_signed_hex_str_8(uint32_t val); +static char* make_signed_hex_str_16(uint32_t val); +static char* make_signed_hex_str_32(uint32_t val); /* make string of ea mode */ -static char* get_ea_mode_str(UINT32 instruction, UINT32 size); +static char* get_ea_mode_str(uint32_t instruction, uint32_t size); -char* get_ea_mode_str_8(UINT32 instruction); -char* get_ea_mode_str_16(UINT32 instruction); -char* get_ea_mode_str_32(UINT32 instruction); +char* get_ea_mode_str_8(uint32_t instruction); +char* get_ea_mode_str_16(uint32_t instruction); +char* get_ea_mode_str_32(uint32_t instruction); /* make string of immediate value */ -static char* get_imm_str_s(UINT32 size); -static char* get_imm_str_u(UINT32 size); +static char* get_imm_str_s(uint32_t size); +static char* get_imm_str_u(uint32_t size); char* get_imm_str_s8(void); char* get_imm_str_s16(void); @@ -163,16 +163,16 @@ char* get_imm_str_s32(void); /* Stuff to build the opcode handler jump table */ static void build_opcode_table(void); -static int valid_ea(UINT32 opcode, UINT32 mask); +static int valid_ea(uint32_t opcode, uint32_t mask); static int DECL_SPEC compare_nof_true_bits(const void *aptr, const void *bptr); /* used to build opcode handler jump table */ struct opcode_struct { void (*opcode_handler)(void); /* handler function */ - UINT32 mask; /* mask on opcode */ - UINT32 match; /* what to match after masking */ - UINT32 ea_mask; /* what ea modes are allowed */ + uint32_t mask; /* mask on opcode */ + uint32_t match; /* what to match after masking */ + uint32_t ea_mask; /* what ea modes are allowed */ }; @@ -188,17 +188,17 @@ static int g_initialized = 0; static char g_dasm_str[100]; /* string to hold disassembly */ static char g_helper_str[100]; /* string to hold helpful info */ -static UINT32 g_cpu_pc; /* program counter */ -static UINT32 g_cpu_ir; /* instruction register */ -static UINT32 g_cpu_type; -static UINT32 g_opcode_type; +static uint32_t g_cpu_pc; /* program counter */ +static uint32_t g_cpu_ir; /* instruction register */ +static uint32_t g_cpu_type; +static uint32_t g_opcode_type; static const unsigned char* g_rawop; -static UINT32 g_rawbasepc; +static uint32_t g_rawbasepc; /* used by ops like asr, ror, addq, etc */ -static const UINT32 g_3bit_qdata_table[8] = {8, 1, 2, 3, 4, 5, 6, 7}; +static const uint32_t g_3bit_qdata_table[8] = {8, 1, 2, 3, 4, 5, 6, 7}; -static const UINT32 g_5bit_data_table[32] = +static const uint32_t g_5bit_data_table[32] = { 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 @@ -243,26 +243,26 @@ static const char *const g_mmucond[16] = return; \ } -static UINT32 dasm_read_imm_8(UINT32 advance) +static uint32_t dasm_read_imm_8(uint32_t advance) { - UINT32 result; + uint32_t result; result = g_rawop[g_cpu_pc + 1 - g_rawbasepc]; g_cpu_pc += advance; return result; } -static UINT32 dasm_read_imm_16(UINT32 advance) +static uint32_t dasm_read_imm_16(uint32_t advance) { - UINT32 result; + uint32_t result; result = (g_rawop[g_cpu_pc + 0 - g_rawbasepc] << 8) | g_rawop[g_cpu_pc + 1 - g_rawbasepc]; g_cpu_pc += advance; return result; } -static UINT32 dasm_read_imm_32(UINT32 advance) +static uint32_t dasm_read_imm_32(uint32_t advance) { - UINT32 result; + uint32_t result; result = (g_rawop[g_cpu_pc + 0 - g_rawbasepc] << 24) | (g_rawop[g_cpu_pc + 1 - g_rawbasepc] << 16) | (g_rawop[g_cpu_pc + 2 - g_rawbasepc] << 8) | @@ -315,7 +315,7 @@ static int make_int_32(int value) } /* Get string representation of hex values */ -static char* make_signed_hex_str_8(UINT32 val) +static char* make_signed_hex_str_8(uint32_t val) { static char str[20]; @@ -331,7 +331,7 @@ static char* make_signed_hex_str_8(UINT32 val) return str; } -static char* make_signed_hex_str_16(UINT32 val) +static char* make_signed_hex_str_16(uint32_t val) { static char str[20]; @@ -347,7 +347,7 @@ static char* make_signed_hex_str_16(UINT32 val) return str; } -static char* make_signed_hex_str_32(UINT32 val) +static char* make_signed_hex_str_32(uint32_t val) { static char str[20]; @@ -365,7 +365,7 @@ static char* make_signed_hex_str_32(UINT32 val) /* make string of immediate value */ -static char* get_imm_str_s(UINT32 size) +static char* get_imm_str_s(uint32_t size) { static char str[15]; if(size == 0) @@ -377,7 +377,7 @@ static char* get_imm_str_s(UINT32 size) return str; } -static char* get_imm_str_u(UINT32 size) +static char* get_imm_str_u(uint32_t size) { static char str[15]; if(size == 0) @@ -390,20 +390,20 @@ static char* get_imm_str_u(UINT32 size) } /* Make string of effective address mode */ -static char* get_ea_mode_str(UINT32 instruction, UINT32 size) +static char* get_ea_mode_str(uint32_t instruction, uint32_t size) { static char b1[64]; static char b2[64]; static char* mode = b2; - UINT32 extension; - UINT32 base; - UINT32 outer; + uint32_t extension; + uint32_t base; + uint32_t outer; char base_reg[4]; char index_reg[8]; - UINT32 preindex; - UINT32 postindex; - UINT32 comma = 0; - UINT32 temp_value; + uint32_t preindex; + uint32_t postindex; + uint32_t comma = 0; + uint32_t temp_value; char invalid_mode = 0; /* Switch buffers so we don't clobber on a double-call to this function */ @@ -953,19 +953,19 @@ static void d68000_asl_ea(void) static void d68000_bcc_8(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "b%-2s $%x", g_cc[(g_cpu_ir>>8)&0xf], temp_pc + make_int_8(g_cpu_ir)); } static void d68000_bcc_16(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "b%-2s $%x", g_cc[(g_cpu_ir>>8)&0xf], temp_pc + make_int_16(read_imm_16())); } static void d68020_bcc_32(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; LIMIT_CPU_TYPES(M68020_PLUS); sprintf(g_dasm_str, "b%-2s $%x; (2+)", g_cc[(g_cpu_ir>>8)&0xf], temp_pc + read_imm_32()); } @@ -1000,7 +1000,7 @@ static void d68010_bkpt(void) static void d68020_bfchg(void) { - UINT32 extension; + uint32_t extension; char offset[3]; char width[3]; @@ -1021,7 +1021,7 @@ static void d68020_bfchg(void) static void d68020_bfclr(void) { - UINT32 extension; + uint32_t extension; char offset[3]; char width[3]; @@ -1042,7 +1042,7 @@ static void d68020_bfclr(void) static void d68020_bfexts(void) { - UINT32 extension; + uint32_t extension; char offset[3]; char width[3]; @@ -1063,7 +1063,7 @@ static void d68020_bfexts(void) static void d68020_bfextu(void) { - UINT32 extension; + uint32_t extension; char offset[3]; char width[3]; @@ -1084,7 +1084,7 @@ static void d68020_bfextu(void) static void d68020_bfffo(void) { - UINT32 extension; + uint32_t extension; char offset[3]; char width[3]; @@ -1105,7 +1105,7 @@ static void d68020_bfffo(void) static void d68020_bfins(void) { - UINT32 extension; + uint32_t extension; char offset[3]; char width[3]; @@ -1126,7 +1126,7 @@ static void d68020_bfins(void) static void d68020_bfset(void) { - UINT32 extension; + uint32_t extension; char offset[3]; char width[3]; @@ -1147,7 +1147,7 @@ static void d68020_bfset(void) static void d68020_bftst(void) { - UINT32 extension; + uint32_t extension; char offset[3]; char width[3]; @@ -1168,19 +1168,19 @@ static void d68020_bftst(void) static void d68000_bra_8(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "bra $%x", temp_pc + make_int_8(g_cpu_ir)); } static void d68000_bra_16(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "bra $%x", temp_pc + make_int_16(read_imm_16())); } static void d68020_bra_32(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; LIMIT_CPU_TYPES(M68020_PLUS); sprintf(g_dasm_str, "bra $%x; (2+)", temp_pc + read_imm_32()); } @@ -1198,21 +1198,21 @@ static void d68000_bset_s(void) static void d68000_bsr_8(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "bsr $%x", temp_pc + make_int_8(g_cpu_ir)); SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); } static void d68000_bsr_16(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "bsr $%x", temp_pc + make_int_16(read_imm_16())); SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); } static void d68020_bsr_32(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; LIMIT_CPU_TYPES(M68020_PLUS); sprintf(g_dasm_str, "bsr $%x; (2+)", temp_pc + read_imm_32()); SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); @@ -1240,7 +1240,7 @@ static void d68020_callm(void) static void d68020_cas_8(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); sprintf(g_dasm_str, "cas.b D%d, D%d, %s; (2+)", extension&7, (extension>>8)&7, get_ea_mode_str_8(g_cpu_ir)); @@ -1248,7 +1248,7 @@ static void d68020_cas_8(void) static void d68020_cas_16(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); sprintf(g_dasm_str, "cas.w D%d, D%d, %s; (2+)", extension&7, (extension>>8)&7, get_ea_mode_str_16(g_cpu_ir)); @@ -1256,7 +1256,7 @@ static void d68020_cas_16(void) static void d68020_cas_32(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); sprintf(g_dasm_str, "cas.l D%d, D%d, %s; (2+)", extension&7, (extension>>8)&7, get_ea_mode_str_32(g_cpu_ir)); @@ -1270,7 +1270,7 @@ f e d c b a 9 8 7 6 5 4 3 2 1 0 DARn2 0 0 0 Du2 0 0 0 Dc2 */ - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_32(); sprintf(g_dasm_str, "cas2.w D%d:D%d:D%d:D%d, (%c%d):(%c%d); (2+)", @@ -1281,7 +1281,7 @@ f e d c b a 9 8 7 6 5 4 3 2 1 0 static void d68020_cas2_32(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_32(); sprintf(g_dasm_str, "cas2.l D%d:D%d:D%d:D%d, (%c%d):(%c%d); (2+)", @@ -1305,7 +1305,7 @@ static void d68020_chk_32(void) static void d68020_chk2_cmp2_8(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); sprintf(g_dasm_str, "%s.b %s, %c%d; (2+)", BIT_B(extension) ? "chk2" : "cmp2", get_ea_mode_str_8(g_cpu_ir), BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); @@ -1313,7 +1313,7 @@ static void d68020_chk2_cmp2_8(void) static void d68020_chk2_cmp2_16(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); sprintf(g_dasm_str, "%s.w %s, %c%d; (2+)", BIT_B(extension) ? "chk2" : "cmp2", get_ea_mode_str_16(g_cpu_ir), BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); @@ -1321,7 +1321,7 @@ static void d68020_chk2_cmp2_16(void) static void d68020_chk2_cmp2_32(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); sprintf(g_dasm_str, "%s.l %s, %c%d; (2+)", BIT_B(extension) ? "chk2" : "cmp2", get_ea_mode_str_32(g_cpu_ir), BIT_F(extension) ? 'A' : 'D', (extension>>12)&7); @@ -1475,8 +1475,8 @@ static void d68000_cmpm_32(void) static void d68020_cpbcc_16(void) { - UINT32 extension; - UINT32 new_pc = g_cpu_pc; + uint32_t extension; + uint32_t new_pc = g_cpu_pc; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); new_pc += make_int_16(read_imm_16()); @@ -1485,8 +1485,8 @@ static void d68020_cpbcc_16(void) static void d68020_cpbcc_32(void) { - UINT32 extension; - UINT32 new_pc = g_cpu_pc; + uint32_t extension; + uint32_t new_pc = g_cpu_pc; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); new_pc += read_imm_32(); @@ -1495,9 +1495,9 @@ static void d68020_cpbcc_32(void) static void d68020_cpdbcc(void) { - UINT32 extension1; - UINT32 extension2; - UINT32 new_pc = g_cpu_pc; + uint32_t extension1; + uint32_t extension2; + uint32_t new_pc = g_cpu_pc; LIMIT_CPU_TYPES(M68020_PLUS); extension1 = read_imm_16(); extension2 = read_imm_16(); @@ -1539,8 +1539,8 @@ static void d68020_cpsave(void) static void d68020_cpscc(void) { - UINT32 extension1; - UINT32 extension2; + uint32_t extension1; + uint32_t extension2; LIMIT_CPU_TYPES(M68020_PLUS); extension1 = read_imm_16(); extension2 = read_imm_16(); @@ -1549,8 +1549,8 @@ static void d68020_cpscc(void) static void d68020_cptrapcc_0(void) { - UINT32 extension1; - UINT32 extension2; + uint32_t extension1; + uint32_t extension2; LIMIT_CPU_TYPES(M68020_PLUS); extension1 = read_imm_16(); extension2 = read_imm_16(); @@ -1559,8 +1559,8 @@ static void d68020_cptrapcc_0(void) static void d68020_cptrapcc_16(void) { - UINT32 extension1; - UINT32 extension2; + uint32_t extension1; + uint32_t extension2; LIMIT_CPU_TYPES(M68020_PLUS); extension1 = read_imm_16(); extension2 = read_imm_16(); @@ -1569,8 +1569,8 @@ static void d68020_cptrapcc_16(void) static void d68020_cptrapcc_32(void) { - UINT32 extension1; - UINT32 extension2; + uint32_t extension1; + uint32_t extension2; LIMIT_CPU_TYPES(M68020_PLUS); extension1 = read_imm_16(); extension2 = read_imm_16(); @@ -1601,14 +1601,14 @@ static void d68040_cpush(void) static void d68000_dbra(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "dbra D%d, $%x", g_cpu_ir & 7, temp_pc + make_int_16(read_imm_16())); SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); } static void d68000_dbcc(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "db%-2s D%d, $%x", g_cc[(g_cpu_ir>>8)&0xf], g_cpu_ir & 7, temp_pc + make_int_16(read_imm_16())); SET_OPCODE_FLAGS(DASMFLAG_STEP_OVER); } @@ -1625,7 +1625,7 @@ static void d68000_divu(void) static void d68020_divl(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); @@ -1713,8 +1713,8 @@ static void d68020_extb_32(void) static void d68881_ftrap(void) { - UINT16 w2, w3; - UINT32 l2; + uint16_t w2, w3; + uint32_t l2; LIMIT_CPU_TYPES(M68020_PLUS); w2 = read_imm_16(); @@ -1745,7 +1745,7 @@ static void d68040_fpu(void) }; char mnemonic[40]; - UINT32 w2, src, dst_reg; + uint32_t w2, src, dst_reg; LIMIT_CPU_TYPES(M68020_PLUS); w2 = read_imm_16(); @@ -2108,7 +2108,7 @@ static void d68000_move_to_usp(void) static void d68010_movec(void) { - UINT32 extension; + uint32_t extension; const char* reg_name; const char* processor; LIMIT_CPU_TYPES(M68010_PLUS); @@ -2257,11 +2257,11 @@ static void d68010_movec(void) static void d68000_movem_pd_16(void) { - UINT32 data = read_imm_16(); + uint32_t data = read_imm_16(); char buffer[40]; - UINT32 first; - UINT32 run_length; - UINT32 i; + uint32_t first; + uint32_t run_length; + uint32_t i; buffer[0] = 0; for(i=0;i<8;i++) @@ -2305,11 +2305,11 @@ static void d68000_movem_pd_16(void) static void d68000_movem_pd_32(void) { - UINT32 data = read_imm_16(); + uint32_t data = read_imm_16(); char buffer[40]; - UINT32 first; - UINT32 run_length; - UINT32 i; + uint32_t first; + uint32_t run_length; + uint32_t i; buffer[0] = 0; for(i=0;i<8;i++) @@ -2353,11 +2353,11 @@ static void d68000_movem_pd_32(void) static void d68000_movem_er_16(void) { - UINT32 data = read_imm_16(); + uint32_t data = read_imm_16(); char buffer[40]; - UINT32 first; - UINT32 run_length; - UINT32 i; + uint32_t first; + uint32_t run_length; + uint32_t i; buffer[0] = 0; for(i=0;i<8;i++) @@ -2401,11 +2401,11 @@ static void d68000_movem_er_16(void) static void d68000_movem_er_32(void) { - UINT32 data = read_imm_16(); + uint32_t data = read_imm_16(); char buffer[40]; - UINT32 first; - UINT32 run_length; - UINT32 i; + uint32_t first; + uint32_t run_length; + uint32_t i; buffer[0] = 0; for(i=0;i<8;i++) @@ -2449,11 +2449,11 @@ static void d68000_movem_er_32(void) static void d68000_movem_re_16(void) { - UINT32 data = read_imm_16(); + uint32_t data = read_imm_16(); char buffer[40]; - UINT32 first; - UINT32 run_length; - UINT32 i; + uint32_t first; + uint32_t run_length; + uint32_t i; buffer[0] = 0; for(i=0;i<8;i++) @@ -2497,11 +2497,11 @@ static void d68000_movem_re_16(void) static void d68000_movem_re_32(void) { - UINT32 data = read_imm_16(); + uint32_t data = read_imm_16(); char buffer[40]; - UINT32 first; - UINT32 run_length; - UINT32 i; + uint32_t first; + uint32_t run_length; + uint32_t i; buffer[0] = 0; for(i=0;i<8;i++) @@ -2565,7 +2565,7 @@ static void d68000_movep_er_32(void) static void d68010_moves_8(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68010_PLUS); extension = read_imm_16(); if(BIT_B(extension)) @@ -2576,7 +2576,7 @@ static void d68010_moves_8(void) static void d68010_moves_16(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68010_PLUS); extension = read_imm_16(); if(BIT_B(extension)) @@ -2587,7 +2587,7 @@ static void d68010_moves_16(void) static void d68010_moves_32(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68010_PLUS); extension = read_imm_16(); if(BIT_B(extension)) @@ -2643,7 +2643,7 @@ static void d68000_mulu(void) static void d68020_mull(void) { - UINT32 extension; + uint32_t extension; LIMIT_CPU_TYPES(M68020_PLUS); extension = read_imm_16(); @@ -3252,7 +3252,7 @@ static void d68020_unpk_mm(void) static void d68851_p000(void) { char* str; - UINT16 modes = read_imm_16(); + uint16_t modes = read_imm_16(); // do this after fetching the second PMOVE word so we properly get the 3rd if necessary str = get_ea_mode_str_32(g_cpu_ir); @@ -3346,22 +3346,22 @@ static void d68851_p000(void) static void d68851_pbcc16(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "pb%s %x", g_mmucond[g_cpu_ir&0xf], temp_pc + make_int_16(read_imm_16())); } static void d68851_pbcc32(void) { - UINT32 temp_pc = g_cpu_pc; + uint32_t temp_pc = g_cpu_pc; sprintf(g_dasm_str, "pb%s %x", g_mmucond[g_cpu_ir&0xf], temp_pc + make_int_32(read_imm_32())); } static void d68851_pdbcc(void) { - UINT32 temp_pc = g_cpu_pc; - UINT16 modes = read_imm_16(); + uint32_t temp_pc = g_cpu_pc; + uint16_t modes = read_imm_16(); sprintf(g_dasm_str, "pb%s %x", g_mmucond[modes&0xf], temp_pc + make_int_16(read_imm_16())); } @@ -3376,16 +3376,16 @@ static void d68851_p001(void) static void d68040_fbcc_16() { LIMIT_CPU_TYPES(M68030_PLUS); - UINT32 temp_pc = g_cpu_pc; - INT16 disp = make_int_16(read_imm_16()); + uint32_t temp_pc = g_cpu_pc; + int16_t disp = make_int_16(read_imm_16()); sprintf(g_dasm_str, "fb%-s $%x", g_cpcc[g_cpu_ir & 0x3f], temp_pc + disp); } static void d68040_fbcc_32() { LIMIT_CPU_TYPES(M68030_PLUS); - UINT32 temp_pc = g_cpu_pc; - UINT32 disp = read_imm_32(); + uint32_t temp_pc = g_cpu_pc; + uint32_t disp = read_imm_32(); sprintf(g_dasm_str, "fb%-s $%x", g_cpcc[g_cpu_ir & 0x3f], temp_pc + disp); } @@ -3723,7 +3723,7 @@ static const opcode_struct g_opcode_info[] = }; /* Check if opcode is using a valid ea mode */ -static int valid_ea(UINT32 opcode, UINT32 mask) +static int valid_ea(uint32_t opcode, uint32_t mask) { if(mask == 0) return 1; @@ -3769,8 +3769,8 @@ static int valid_ea(UINT32 opcode, UINT32 mask) /* Used by qsort */ static int DECL_SPEC compare_nof_true_bits(const void *aptr, const void *bptr) { - UINT32 a = ((const opcode_struct*)aptr)->mask; - UINT32 b = ((const opcode_struct*)bptr)->mask; + uint32_t a = ((const opcode_struct*)aptr)->mask; + uint32_t b = ((const opcode_struct*)bptr)->mask; a = ((a & 0xAAAA) >> 1) + (a & 0x5555); a = ((a & 0xCCCC) >> 2) + (a & 0x3333); @@ -3788,8 +3788,8 @@ static int DECL_SPEC compare_nof_true_bits(const void *aptr, const void *bptr) /* build the opcode handler jump table */ static void build_opcode_table(void) { - UINT32 i; - UINT32 opcode; + uint32_t i; + uint32_t opcode; opcode_struct* ostruct; opcode_struct opcode_info[ARRAY_LENGTH(g_opcode_info)]; diff --git a/src/devices/cpu/m68000/m68kfpu.hxx b/src/devices/cpu/m68000/m68kfpu.hxx index 5c0d884311e..9c11acd5fb8 100644 --- a/src/devices/cpu/m68000/m68kfpu.hxx +++ b/src/devices/cpu/m68000/m68kfpu.hxx @@ -17,7 +17,7 @@ extern flag floatx80_is_nan( floatx80 a ); // masks for packed dwords, positive k-factor -static const UINT32 pkmask2[18] = +static const uint32_t pkmask2[18] = { 0xffffffff, 0, 0xf0000000, 0xff000000, 0xfff00000, 0xffff0000, 0xfffff000, 0xffffff00, 0xfffffff0, 0xffffffff, @@ -25,7 +25,7 @@ static const UINT32 pkmask2[18] = 0xffffffff, 0xffffffff, 0xffffffff }; -static const UINT32 pkmask3[18] = +static const uint32_t pkmask3[18] = { 0xffffffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xf0000000, 0xff000000, 0xfff00000, 0xffff0000, @@ -34,7 +34,7 @@ static const UINT32 pkmask3[18] = static inline double fx80_to_double(floatx80 fx) { - UINT64 d; + uint64_t d; double *foo; foo = (double *)&d; @@ -46,17 +46,17 @@ static inline double fx80_to_double(floatx80 fx) static inline floatx80 double_to_fx80(double in) { - UINT64 *d; + uint64_t *d; - d = (UINT64 *)∈ + d = (uint64_t *)∈ return float64_to_floatx80(*d); } -static inline floatx80 load_extended_float80(m68000_base_device *m68k, UINT32 ea) +static inline floatx80 load_extended_float80(m68000_base_device *m68k, uint32_t ea) { - UINT32 d1,d2; - UINT16 d3; + uint32_t d1,d2; + uint16_t d3; floatx80 fp; d3 = m68ki_read_16(m68k, ea); @@ -64,12 +64,12 @@ static inline floatx80 load_extended_float80(m68000_base_device *m68k, UINT32 ea d2 = m68ki_read_32(m68k, ea+8); fp.high = d3; - fp.low = ((UINT64)d1<<32) | (d2 & 0xffffffff); + fp.low = ((uint64_t)d1<<32) | (d2 & 0xffffffff); return fp; } -static inline void store_extended_float80(m68000_base_device *m68k, UINT32 ea, floatx80 fpr) +static inline void store_extended_float80(m68000_base_device *m68k, uint32_t ea, floatx80 fpr) { m68ki_write_16(m68k, ea+0, fpr.high); m68ki_write_16(m68k, ea+2, 0); @@ -77,9 +77,9 @@ static inline void store_extended_float80(m68000_base_device *m68k, UINT32 ea, f m68ki_write_32(m68k, ea+8, fpr.low&0xffffffff); } -static inline floatx80 load_pack_float80(m68000_base_device *m68k, UINT32 ea) +static inline floatx80 load_pack_float80(m68000_base_device *m68k, uint32_t ea) { - UINT32 dw1, dw2, dw3; + uint32_t dw1, dw2, dw3; floatx80 result; double tmp; char str[128], *ch; @@ -128,9 +128,9 @@ static inline floatx80 load_pack_float80(m68000_base_device *m68k, UINT32 ea) return result; } -static inline void store_pack_float80(m68000_base_device *m68k, UINT32 ea, int k, floatx80 fpr) +static inline void store_pack_float80(m68000_base_device *m68k, uint32_t ea, int k, floatx80 fpr) { - UINT32 dw1, dw2, dw3; + uint32_t dw1, dw2, dw3; char str[128], *ch; int i, j, exp; @@ -262,9 +262,9 @@ static inline void store_pack_float80(m68000_base_device *m68k, UINT32 ea, int k static inline void SET_CONDITION_CODES(m68000_base_device *m68k, floatx80 reg) { -// UINT64 *regi; +// uint64_t *regi; -// regi = (UINT64 *)® +// regi = (uint64_t *)® REG_FPSR(m68k) &= ~(FPCC_N|FPCC_Z|FPCC_I|FPCC_NAN); @@ -355,7 +355,7 @@ static inline int TEST_CONDITION(m68000_base_device *m68k, int condition) return r; } -static UINT8 READ_EA_8(m68000_base_device *m68k, int ea) +static uint8_t READ_EA_8(m68000_base_device *m68k, int ea) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); @@ -368,27 +368,27 @@ static UINT8 READ_EA_8(m68000_base_device *m68k, int ea) } case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; return m68ki_read_8(m68k, ea); } case 3: // (An)+ { - UINT32 ea = EA_AY_PI_8(m68k); + uint32_t ea = EA_AY_PI_8(m68k); return m68ki_read_8(m68k, ea); } case 4: // -(An) { - UINT32 ea = EA_AY_PD_8(m68k); + uint32_t ea = EA_AY_PD_8(m68k); return m68ki_read_8(m68k, ea); } case 5: // (d16, An) { - UINT32 ea = EA_AY_DI_8(m68k); + uint32_t ea = EA_AY_DI_8(m68k); return m68ki_read_8(m68k, ea); } case 6: // (An) + (Xn) + d8 { - UINT32 ea = EA_AY_IX_8(m68k); + uint32_t ea = EA_AY_IX_8(m68k); return m68ki_read_8(m68k, ea); } case 7: @@ -397,24 +397,24 @@ static UINT8 READ_EA_8(m68000_base_device *m68k, int ea) { case 0: // (xxx).W { - UINT32 ea = (UINT32)OPER_I_16(m68k); + uint32_t ea = (uint32_t)OPER_I_16(m68k); return m68ki_read_8(m68k, ea); } case 1: // (xxx).L { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; return m68ki_read_8(m68k, ea); } case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_8(m68k); + uint32_t ea = EA_PCDI_8(m68k); return m68ki_read_8(m68k, ea); } case 3: // (PC) + (Xn) + d8 { - UINT32 ea = EA_PCIX_8(m68k); + uint32_t ea = EA_PCIX_8(m68k); return m68ki_read_8(m68k, ea); } case 4: // # @@ -431,7 +431,7 @@ static UINT8 READ_EA_8(m68000_base_device *m68k, int ea) return 0; } -static UINT16 READ_EA_16(m68000_base_device *m68k, int ea) +static uint16_t READ_EA_16(m68000_base_device *m68k, int ea) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); @@ -440,31 +440,31 @@ static UINT16 READ_EA_16(m68000_base_device *m68k, int ea) { case 0: // Dn { - return (UINT16)(REG_D(m68k)[reg]); + return (uint16_t)(REG_D(m68k)[reg]); } case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; return m68ki_read_16(m68k, ea); } case 3: // (An)+ { - UINT32 ea = EA_AY_PI_16(m68k); + uint32_t ea = EA_AY_PI_16(m68k); return m68ki_read_16(m68k, ea); } case 4: // -(An) { - UINT32 ea = EA_AY_PD_16(m68k); + uint32_t ea = EA_AY_PD_16(m68k); return m68ki_read_16(m68k, ea); } case 5: // (d16, An) { - UINT32 ea = EA_AY_DI_16(m68k); + uint32_t ea = EA_AY_DI_16(m68k); return m68ki_read_16(m68k, ea); } case 6: // (An) + (Xn) + d8 { - UINT32 ea = EA_AY_IX_16(m68k); + uint32_t ea = EA_AY_IX_16(m68k); return m68ki_read_16(m68k, ea); } case 7: @@ -473,24 +473,24 @@ static UINT16 READ_EA_16(m68000_base_device *m68k, int ea) { case 0: // (xxx).W { - UINT32 ea = (UINT32)OPER_I_16(m68k); + uint32_t ea = (uint32_t)OPER_I_16(m68k); return m68ki_read_16(m68k, ea); } case 1: // (xxx).L { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; return m68ki_read_16(m68k, ea); } case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_16(m68k); + uint32_t ea = EA_PCDI_16(m68k); return m68ki_read_16(m68k, ea); } case 3: // (PC) + (Xn) + d8 { - UINT32 ea = EA_PCIX_16(m68k); + uint32_t ea = EA_PCIX_16(m68k); return m68ki_read_16(m68k, ea); } case 4: // # @@ -508,7 +508,7 @@ static UINT16 READ_EA_16(m68000_base_device *m68k, int ea) return 0; } -static UINT32 READ_EA_32(m68000_base_device *m68k, int ea) +static uint32_t READ_EA_32(m68000_base_device *m68k, int ea) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); @@ -521,27 +521,27 @@ static UINT32 READ_EA_32(m68000_base_device *m68k, int ea) } case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; return m68ki_read_32(m68k, ea); } case 3: // (An)+ { - UINT32 ea = EA_AY_PI_32(m68k); + uint32_t ea = EA_AY_PI_32(m68k); return m68ki_read_32(m68k, ea); } case 4: // -(An) { - UINT32 ea = EA_AY_PD_32(m68k); + uint32_t ea = EA_AY_PD_32(m68k); return m68ki_read_32(m68k, ea); } case 5: // (d16, An) { - UINT32 ea = EA_AY_DI_32(m68k); + uint32_t ea = EA_AY_DI_32(m68k); return m68ki_read_32(m68k, ea); } case 6: // (An) + (Xn) + d8 { - UINT32 ea = EA_AY_IX_32(m68k); + uint32_t ea = EA_AY_IX_32(m68k); return m68ki_read_32(m68k, ea); } case 7: @@ -550,24 +550,24 @@ static UINT32 READ_EA_32(m68000_base_device *m68k, int ea) { case 0: // (xxx).W { - UINT32 ea = (UINT32)OPER_I_16(m68k); + uint32_t ea = (uint32_t)OPER_I_16(m68k); return m68ki_read_32(m68k, ea); } case 1: // (xxx).L { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; return m68ki_read_32(m68k, ea); } case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_32(m68k); + uint32_t ea = EA_PCDI_32(m68k); return m68ki_read_32(m68k, ea); } case 3: // (PC) + (Xn) + d8 { - UINT32 ea = EA_PCIX_32(m68k); + uint32_t ea = EA_PCIX_32(m68k); return m68ki_read_32(m68k, ea); } case 4: // # @@ -583,50 +583,50 @@ static UINT32 READ_EA_32(m68000_base_device *m68k, int ea) return 0; } -static UINT64 READ_EA_64(m68000_base_device *m68k, int ea) +static uint64_t READ_EA_64(m68000_base_device *m68k, int ea) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); - UINT32 h1, h2; + uint32_t h1, h2; switch (mode) { case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; h1 = m68ki_read_32(m68k, ea+0); h2 = m68ki_read_32(m68k, ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); + return (uint64_t)(h1) << 32 | (uint64_t)(h2); } case 3: // (An)+ { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; REG_A(m68k)[reg] += 8; h1 = m68ki_read_32(m68k, ea+0); h2 = m68ki_read_32(m68k, ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); + return (uint64_t)(h1) << 32 | (uint64_t)(h2); } case 4: // -(An) { - UINT32 ea = REG_A(m68k)[reg]-8; + uint32_t ea = REG_A(m68k)[reg]-8; REG_A(m68k)[reg] -= 8; h1 = m68ki_read_32(m68k, ea+0); h2 = m68ki_read_32(m68k, ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); + return (uint64_t)(h1) << 32 | (uint64_t)(h2); } case 5: // (d16, An) { - UINT32 ea = EA_AY_DI_32(m68k); + uint32_t ea = EA_AY_DI_32(m68k); h1 = m68ki_read_32(m68k, ea+0); h2 = m68ki_read_32(m68k, ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); + return (uint64_t)(h1) << 32 | (uint64_t)(h2); } case 6: // (An) + (Xn) + d8 { - UINT32 ea = EA_AY_IX_32(m68k); + uint32_t ea = EA_AY_IX_32(m68k); h1 = m68ki_read_32(m68k, ea+0); h2 = m68ki_read_32(m68k, ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); + return (uint64_t)(h1) << 32 | (uint64_t)(h2); } case 7: { @@ -634,30 +634,30 @@ static UINT64 READ_EA_64(m68000_base_device *m68k, int ea) { case 1: // (xxx).L { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; - return (UINT64)(m68ki_read_32(m68k, ea)) << 32 | (UINT64)(m68ki_read_32(m68k, ea+4)); + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; + return (uint64_t)(m68ki_read_32(m68k, ea)) << 32 | (uint64_t)(m68ki_read_32(m68k, ea+4)); } case 3: // (PC) + (Xn) + d8 { - UINT32 ea = EA_PCIX_32(m68k); + uint32_t ea = EA_PCIX_32(m68k); h1 = m68ki_read_32(m68k, ea+0); h2 = m68ki_read_32(m68k, ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); + return (uint64_t)(h1) << 32 | (uint64_t)(h2); } case 4: // # { h1 = OPER_I_32(m68k); h2 = OPER_I_32(m68k); - return (UINT64)(h1) << 32 | (UINT64)(h2); + return (uint64_t)(h1) << 32 | (uint64_t)(h2); } case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_32(m68k); + uint32_t ea = EA_PCDI_32(m68k); h1 = m68ki_read_32(m68k, ea+0); h2 = m68ki_read_32(m68k, ea+4); - return (UINT64)(h1) << 32 | (UINT64)(h2); + return (uint64_t)(h1) << 32 | (uint64_t)(h2); } default: fatalerror("M68kFPU: READ_EA_64: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC(m68k)); } @@ -680,21 +680,21 @@ static floatx80 READ_EA_FPE(m68000_base_device *m68k, int ea) { case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; fpr = load_extended_float80(m68k, ea); break; } case 3: // (An)+ { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; REG_A(m68k)[reg] += 12; fpr = load_extended_float80(m68k, ea); break; } case 4: // -(An) { - UINT32 ea = REG_A(m68k)[reg]-12; + uint32_t ea = REG_A(m68k)[reg]-12; REG_A(m68k)[reg] -= 12; fpr = load_extended_float80(m68k, ea); break; @@ -702,14 +702,14 @@ static floatx80 READ_EA_FPE(m68000_base_device *m68k, int ea) case 5: // (d16, An) { // FIXME: will fail for fmovem - UINT32 ea = EA_AY_DI_32(m68k); + uint32_t ea = EA_AY_DI_32(m68k); fpr = load_extended_float80(m68k, ea); break; } case 6: // (An) + (Xn) + d8 { // FIXME: will fail for fmovem - UINT32 ea = EA_AY_IX_32(m68k); + uint32_t ea = EA_AY_IX_32(m68k); fpr = load_extended_float80(m68k, ea); break; } @@ -720,23 +720,23 @@ static floatx80 READ_EA_FPE(m68000_base_device *m68k, int ea) { case 1: // (xxx) { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; fpr = load_extended_float80(m68k, ea); } break; case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_32(m68k); + uint32_t ea = EA_PCDI_32(m68k); fpr = load_extended_float80(m68k, ea); } break; case 3: // (d16,PC,Dx.w) { - UINT32 ea = EA_PCIX_32(m68k); + uint32_t ea = EA_PCIX_32(m68k); fpr = load_extended_float80(m68k, ea); } break; @@ -764,14 +764,14 @@ static floatx80 READ_EA_PACK(m68000_base_device *m68k, int ea) { case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; fpr = load_pack_float80(m68k, ea); break; } case 3: // (An)+ { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; REG_A(m68k)[reg] += 12; fpr = load_pack_float80(m68k, ea); break; @@ -783,7 +783,7 @@ static floatx80 READ_EA_PACK(m68000_base_device *m68k, int ea) { case 3: // (d16,PC,Dx.w) { - UINT32 ea = EA_PCIX_32(m68k); + uint32_t ea = EA_PCIX_32(m68k); fpr = load_pack_float80(m68k, ea); } break; @@ -801,7 +801,7 @@ static floatx80 READ_EA_PACK(m68000_base_device *m68k, int ea) return fpr; } -static void WRITE_EA_8(m68000_base_device *m68k, int ea, UINT8 data) +static void WRITE_EA_8(m68000_base_device *m68k, int ea, uint8_t data) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); @@ -815,31 +815,31 @@ static void WRITE_EA_8(m68000_base_device *m68k, int ea, UINT8 data) } case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; m68ki_write_8(m68k, ea, data); break; } case 3: // (An)+ { - UINT32 ea = EA_AY_PI_8(m68k); + uint32_t ea = EA_AY_PI_8(m68k); m68ki_write_8(m68k, ea, data); break; } case 4: // -(An) { - UINT32 ea = EA_AY_PD_8(m68k); + uint32_t ea = EA_AY_PD_8(m68k); m68ki_write_8(m68k, ea, data); break; } case 5: // (d16, An) { - UINT32 ea = EA_AY_DI_8(m68k); + uint32_t ea = EA_AY_DI_8(m68k); m68ki_write_8(m68k, ea, data); break; } case 6: // (An) + (Xn) + d8 { - UINT32 ea = EA_AY_IX_8(m68k); + uint32_t ea = EA_AY_IX_8(m68k); m68ki_write_8(m68k, ea, data); break; } @@ -849,15 +849,15 @@ static void WRITE_EA_8(m68000_base_device *m68k, int ea, UINT8 data) { case 1: // (xxx).B { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; m68ki_write_8(m68k, ea, data); break; } case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_16(m68k); + uint32_t ea = EA_PCDI_16(m68k); m68ki_write_8(m68k, ea, data); break; } @@ -869,7 +869,7 @@ static void WRITE_EA_8(m68000_base_device *m68k, int ea, UINT8 data) } } -static void WRITE_EA_16(m68000_base_device *m68k, int ea, UINT16 data) +static void WRITE_EA_16(m68000_base_device *m68k, int ea, uint16_t data) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); @@ -883,31 +883,31 @@ static void WRITE_EA_16(m68000_base_device *m68k, int ea, UINT16 data) } case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; m68ki_write_16(m68k, ea, data); break; } case 3: // (An)+ { - UINT32 ea = EA_AY_PI_16(m68k); + uint32_t ea = EA_AY_PI_16(m68k); m68ki_write_16(m68k, ea, data); break; } case 4: // -(An) { - UINT32 ea = EA_AY_PD_16(m68k); + uint32_t ea = EA_AY_PD_16(m68k); m68ki_write_16(m68k, ea, data); break; } case 5: // (d16, An) { - UINT32 ea = EA_AY_DI_16(m68k); + uint32_t ea = EA_AY_DI_16(m68k); m68ki_write_16(m68k, ea, data); break; } case 6: // (An) + (Xn) + d8 { - UINT32 ea = EA_AY_IX_16(m68k); + uint32_t ea = EA_AY_IX_16(m68k); m68ki_write_16(m68k, ea, data); break; } @@ -917,15 +917,15 @@ static void WRITE_EA_16(m68000_base_device *m68k, int ea, UINT16 data) { case 1: // (xxx).W { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; m68ki_write_16(m68k, ea, data); break; } case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_16(m68k); + uint32_t ea = EA_PCDI_16(m68k); m68ki_write_16(m68k, ea, data); break; } @@ -937,7 +937,7 @@ static void WRITE_EA_16(m68000_base_device *m68k, int ea, UINT16 data) } } -static void WRITE_EA_32(m68000_base_device *m68k, int ea, UINT32 data) +static void WRITE_EA_32(m68000_base_device *m68k, int ea, uint32_t data) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); @@ -956,31 +956,31 @@ static void WRITE_EA_32(m68000_base_device *m68k, int ea, UINT32 data) } case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; m68ki_write_32(m68k, ea, data); break; } case 3: // (An)+ { - UINT32 ea = EA_AY_PI_32(m68k); + uint32_t ea = EA_AY_PI_32(m68k); m68ki_write_32(m68k, ea, data); break; } case 4: // -(An) { - UINT32 ea = EA_AY_PD_32(m68k); + uint32_t ea = EA_AY_PD_32(m68k); m68ki_write_32(m68k, ea, data); break; } case 5: // (d16, An) { - UINT32 ea = EA_AY_DI_32(m68k); + uint32_t ea = EA_AY_DI_32(m68k); m68ki_write_32(m68k, ea, data); break; } case 6: // (An) + (Xn) + d8 { - UINT32 ea = EA_AY_IX_32(m68k); + uint32_t ea = EA_AY_IX_32(m68k); m68ki_write_32(m68k, ea, data); break; } @@ -990,21 +990,21 @@ static void WRITE_EA_32(m68000_base_device *m68k, int ea, UINT32 data) { case 0: // (xxx).W { - UINT32 ea = OPER_I_16(m68k); + uint32_t ea = OPER_I_16(m68k); m68ki_write_32(m68k, ea, data); break; } case 1: // (xxx).L { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; m68ki_write_32(m68k, ea, data); break; } case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_32(m68k); + uint32_t ea = EA_PCDI_32(m68k); m68ki_write_32(m68k, ea, data); break; } @@ -1016,7 +1016,7 @@ static void WRITE_EA_32(m68000_base_device *m68k, int ea, UINT32 data) } } -static void WRITE_EA_64(m68000_base_device *m68k, int ea, UINT64 data) +static void WRITE_EA_64(m68000_base_device *m68k, int ea, uint64_t data) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); @@ -1025,40 +1025,40 @@ static void WRITE_EA_64(m68000_base_device *m68k, int ea, UINT64 data) { case 2: // (An) { - UINT32 ea = REG_A(m68k)[reg]; - m68ki_write_32(m68k, ea, (UINT32)(data >> 32)); - m68ki_write_32(m68k, ea+4, (UINT32)(data)); + uint32_t ea = REG_A(m68k)[reg]; + m68ki_write_32(m68k, ea, (uint32_t)(data >> 32)); + m68ki_write_32(m68k, ea+4, (uint32_t)(data)); break; } case 3: // (An)+ { - UINT32 ea = REG_A(m68k)[reg]; + uint32_t ea = REG_A(m68k)[reg]; REG_A(m68k)[reg] += 8; - m68ki_write_32(m68k, ea+0, (UINT32)(data >> 32)); - m68ki_write_32(m68k, ea+4, (UINT32)(data)); + m68ki_write_32(m68k, ea+0, (uint32_t)(data >> 32)); + m68ki_write_32(m68k, ea+4, (uint32_t)(data)); break; } case 4: // -(An) { - UINT32 ea; + uint32_t ea; REG_A(m68k)[reg] -= 8; ea = REG_A(m68k)[reg]; - m68ki_write_32(m68k, ea+0, (UINT32)(data >> 32)); - m68ki_write_32(m68k, ea+4, (UINT32)(data)); + m68ki_write_32(m68k, ea+0, (uint32_t)(data >> 32)); + m68ki_write_32(m68k, ea+4, (uint32_t)(data)); break; } case 5: // (d16, An) { - UINT32 ea = EA_AY_DI_32(m68k); - m68ki_write_32(m68k, ea+0, (UINT32)(data >> 32)); - m68ki_write_32(m68k, ea+4, (UINT32)(data)); + uint32_t ea = EA_AY_DI_32(m68k); + m68ki_write_32(m68k, ea+0, (uint32_t)(data >> 32)); + m68ki_write_32(m68k, ea+4, (uint32_t)(data)); break; } case 6: // (An) + (Xn) + d8 { - UINT32 ea = EA_AY_IX_32(m68k); - m68ki_write_32(m68k, ea+0, (UINT32)(data >> 32)); - m68ki_write_32(m68k, ea+4, (UINT32)(data)); + uint32_t ea = EA_AY_IX_32(m68k); + m68ki_write_32(m68k, ea+0, (uint32_t)(data >> 32)); + m68ki_write_32(m68k, ea+4, (uint32_t)(data)); break; } case 7: @@ -1067,25 +1067,25 @@ static void WRITE_EA_64(m68000_base_device *m68k, int ea, UINT64 data) { case 1: // (xxx).L { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; - m68ki_write_32(m68k, ea+0, (UINT32)(data >> 32)); - m68ki_write_32(m68k, ea+4, (UINT32)(data)); + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; + m68ki_write_32(m68k, ea+0, (uint32_t)(data >> 32)); + m68ki_write_32(m68k, ea+4, (uint32_t)(data)); break; } case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_32(m68k); - m68ki_write_32(m68k, ea+0, (UINT32)(data >> 32)); - m68ki_write_32(m68k, ea+4, (UINT32)(data)); + uint32_t ea = EA_PCDI_32(m68k); + m68ki_write_32(m68k, ea+0, (uint32_t)(data >> 32)); + m68ki_write_32(m68k, ea+4, (uint32_t)(data)); break; } default: fatalerror("M68kFPU: WRITE_EA_64: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC(m68k)); } break; } - default: fatalerror("M68kFPU: WRITE_EA_64: unhandled mode %d, reg %d, data %08X%08X at %08X\n", mode, reg, (UINT32)(data >> 32), (UINT32)(data), REG_PC(m68k)); + default: fatalerror("M68kFPU: WRITE_EA_64: unhandled mode %d, reg %d, data %08X%08X at %08X\n", mode, reg, (uint32_t)(data >> 32), (uint32_t)(data), REG_PC(m68k)); } } @@ -1098,7 +1098,7 @@ static void WRITE_EA_FPE(m68000_base_device *m68k, int ea, floatx80 fpr) { case 2: // (An) { - UINT32 ea; + uint32_t ea; ea = REG_A(m68k)[reg]; store_extended_float80(m68k, ea, fpr); break; @@ -1106,7 +1106,7 @@ static void WRITE_EA_FPE(m68000_base_device *m68k, int ea, floatx80 fpr) case 3: // (An)+ { - UINT32 ea; + uint32_t ea; ea = REG_A(m68k)[reg]; store_extended_float80(m68k, ea, fpr); REG_A(m68k)[reg] += 12; @@ -1115,7 +1115,7 @@ static void WRITE_EA_FPE(m68000_base_device *m68k, int ea, floatx80 fpr) case 4: // -(An) { - UINT32 ea; + uint32_t ea; REG_A(m68k)[reg] -= 12; ea = REG_A(m68k)[reg]; store_extended_float80(m68k, ea, fpr); @@ -1142,7 +1142,7 @@ static void WRITE_EA_PACK(m68000_base_device *m68k, int ea, int k, floatx80 fpr) { case 2: // (An) { - UINT32 ea; + uint32_t ea; ea = REG_A(m68k)[reg]; store_pack_float80(m68k, ea, k, fpr); break; @@ -1150,7 +1150,7 @@ static void WRITE_EA_PACK(m68000_base_device *m68k, int ea, int k, floatx80 fpr) case 3: // (An)+ { - UINT32 ea; + uint32_t ea; ea = REG_A(m68k)[reg]; store_pack_float80(m68k, ea, k, fpr); REG_A(m68k)[reg] += 12; @@ -1159,7 +1159,7 @@ static void WRITE_EA_PACK(m68000_base_device *m68k, int ea, int k, floatx80 fpr) case 4: // -(An) { - UINT32 ea; + uint32_t ea; REG_A(m68k)[reg] -= 12; ea = REG_A(m68k)[reg]; store_pack_float80(m68k, ea, k, fpr); @@ -1177,7 +1177,7 @@ static void WRITE_EA_PACK(m68000_base_device *m68k, int ea, int k, floatx80 fpr) } } -static void fpgen_rm_reg(m68000_base_device *m68k, UINT16 w2) +static void fpgen_rm_reg(m68000_base_device *m68k, uint16_t w2) { int ea = m68k->ir & 0x3f; int rm = (w2 >> 14) & 0x1; @@ -1194,13 +1194,13 @@ static void fpgen_rm_reg(m68000_base_device *m68k, UINT16 w2) { case 0: // Long-Word Integer { - INT32 d = READ_EA_32(m68k, ea); + int32_t d = READ_EA_32(m68k, ea); source = int32_to_floatx80(d); break; } case 1: // Single-precision Real { - UINT32 d = READ_EA_32(m68k, ea); + uint32_t d = READ_EA_32(m68k, ea); source = float32_to_floatx80(d); break; } @@ -1216,21 +1216,21 @@ static void fpgen_rm_reg(m68000_base_device *m68k, UINT16 w2) } case 4: // Word Integer { - INT16 d = READ_EA_16(m68k, ea); - source = int32_to_floatx80((INT32)d); + int16_t d = READ_EA_16(m68k, ea); + source = int32_to_floatx80((int32_t)d); break; } case 5: // Double-precision Real { - UINT64 d = READ_EA_64(m68k, ea); + uint64_t d = READ_EA_64(m68k, ea); source = float64_to_floatx80(d); break; } case 6: // Byte Integer { - INT8 d = READ_EA_8(m68k, ea); - source = int32_to_floatx80((INT32)d); + int8_t d = READ_EA_8(m68k, ea); + source = int32_to_floatx80((int32_t)d); break; } case 7: // FMOVECR load from constant ROM @@ -1263,7 +1263,7 @@ static void fpgen_rm_reg(m68000_base_device *m68k, UINT16 w2) break; case 0xf: // 0.0 - source = int32_to_floatx80((INT32)0); + source = int32_to_floatx80((int32_t)0); break; case 0x30: // ln(2) @@ -1277,26 +1277,26 @@ static void fpgen_rm_reg(m68000_base_device *m68k, UINT16 w2) break; case 0x32: // 1 (or 100? manuals are unclear, but 1 would make more sense) - source = int32_to_floatx80((INT32)1); + source = int32_to_floatx80((int32_t)1); break; case 0x33: // 10^1 - source = int32_to_floatx80((INT32)10); + source = int32_to_floatx80((int32_t)10); break; case 0x34: // 10^2 - source = int32_to_floatx80((INT32)10*10); + source = int32_to_floatx80((int32_t)10*10); break; case 0x35: // 10^4 - source = int32_to_floatx80((INT32)1000*10); + source = int32_to_floatx80((int32_t)1000*10); break; case 0x36: // 1.0e8 - source = int32_to_floatx80((INT32)10000000*10); + source = int32_to_floatx80((int32_t)10000000*10); break; - case 0x37: // 1.0e16 - can't get the right precision from INT32 so go "direct" with constants from h/w + case 0x37: // 1.0e16 - can't get the right precision from int32_t so go "direct" with constants from h/w source.high = 0x4034; source.low = U64(0x8e1bc9bf04000000); break; @@ -1372,14 +1372,14 @@ static void fpgen_rm_reg(m68000_base_device *m68k, UINT16 w2) } case 0x01: // FINT { - INT32 temp; + int32_t temp; temp = floatx80_to_int32(source); REG_FP(m68k)[dst] = int32_to_floatx80(temp); break; } case 0x03: // FINTRZ { - INT32 temp; + int32_t temp; temp = floatx80_to_int32_round_to_zero(source); REG_FP(m68k)[dst] = int32_to_floatx80(temp); break; @@ -1461,7 +1461,7 @@ static void fpgen_rm_reg(m68000_base_device *m68k, UINT16 w2) } case 0x1e: // FGETEXP { - INT16 temp2; + int16_t temp2; temp2 = source.high; // get the exponent temp2 -= 0x3fff; // take off the bias @@ -1549,7 +1549,7 @@ static void fpgen_rm_reg(m68000_base_device *m68k, UINT16 w2) } } -static void fmove_reg_mem(m68000_base_device *m68k, UINT16 w2) +static void fmove_reg_mem(m68000_base_device *m68k, uint16_t w2) { int ea = m68k->ir & 0x3f; int src = (w2 >> 7) & 0x7; @@ -1560,13 +1560,13 @@ static void fmove_reg_mem(m68000_base_device *m68k, UINT16 w2) { case 0: // Long-Word Integer { - INT32 d = (INT32)floatx80_to_int32(REG_FP(m68k)[src]); + int32_t d = (int32_t)floatx80_to_int32(REG_FP(m68k)[src]); WRITE_EA_32(m68k, ea, d); break; } case 1: // Single-precision Real { - UINT32 d = floatx80_to_float32(REG_FP(m68k)[src]); + uint32_t d = floatx80_to_float32(REG_FP(m68k)[src]); WRITE_EA_32(m68k, ea, d); break; } @@ -1589,12 +1589,12 @@ static void fmove_reg_mem(m68000_base_device *m68k, UINT16 w2) { REG_FPSR(m68k) |= FPES_OE | FPAE_IOP; } - WRITE_EA_16(m68k, ea, (INT16)value); + WRITE_EA_16(m68k, ea, (int16_t)value); break; } case 5: // Double-precision Real { - UINT64 d; + uint64_t d; d = floatx80_to_float64(REG_FP(m68k)[src]); @@ -1608,7 +1608,7 @@ static void fmove_reg_mem(m68000_base_device *m68k, UINT16 w2) { REG_FPSR(m68k) |= FPES_OE | FPAE_IOP; } - WRITE_EA_8(m68k, ea, (INT8) value); + WRITE_EA_8(m68k, ea, (int8_t) value); break; } case 7: // Packed-decimal Real with Dynamic K-factor @@ -1621,7 +1621,7 @@ static void fmove_reg_mem(m68000_base_device *m68k, UINT16 w2) m68k->remaining_cycles -= 12; } -static void fmove_fpcr(m68000_base_device *m68k, UINT16 w2) +static void fmove_fpcr(m68000_base_device *m68k, uint16_t w2) { int ea = m68k->ir & 0x3f; int dir = (w2 >> 13) & 0x1; @@ -1630,7 +1630,7 @@ static void fmove_fpcr(m68000_base_device *m68k, UINT16 w2) if ((mode == 5) || (mode == 6)) { - UINT32 address = 0xffffffff; // force a bus error if this doesn't get assigned + uint32_t address = 0xffffffff; // force a bus error if this doesn't get assigned if (mode == 5) { @@ -1721,7 +1721,7 @@ static void fmove_fpcr(m68000_base_device *m68k, UINT16 w2) m68k->remaining_cycles -= 10; } -static void fmovem(m68000_base_device *m68k, UINT16 w2) +static void fmovem(m68000_base_device *m68k, uint16_t w2) { int i; int ea = m68k->ir & 0x3f; @@ -1729,7 +1729,7 @@ static void fmovem(m68000_base_device *m68k, UINT16 w2) int mode = (w2 >> 11) & 0x3; int reglist = w2 & 0xff; - UINT32 mem_addr = 0; + uint32_t mem_addr = 0; switch (ea >> 3) { case 5: // (d16, An) @@ -1838,7 +1838,7 @@ static void fmovem(m68000_base_device *m68k, UINT16 w2) static void fscc(m68000_base_device *m68k) { int ea = m68k->ir & 0x3f; - int condition = (INT16)(OPER_I_16(m68k)); + int condition = (int16_t)(OPER_I_16(m68k)); WRITE_EA_8(m68k, ea, TEST_CONDITION(m68k, condition) ? 0xff : 0); m68k->remaining_cycles -= 7; // ??? @@ -1846,10 +1846,10 @@ static void fscc(m68000_base_device *m68k) static void fbcc16(m68000_base_device *m68k) { - INT32 offset; + int32_t offset; int condition = m68k->ir & 0x3f; - offset = (INT16)(OPER_I_16(m68k)); + offset = (int16_t)(OPER_I_16(m68k)); // TODO: condition and jump!!! if (TEST_CONDITION(m68k, condition)) @@ -1863,7 +1863,7 @@ static void fbcc16(m68000_base_device *m68k) static void fbcc32(m68000_base_device *m68k) { - INT32 offset; + int32_t offset; int condition = m68k->ir & 0x3f; offset = OPER_I_32(m68k); @@ -1887,7 +1887,7 @@ void m68040_fpu_op0(m68000_base_device *m68k) { case 0: { - UINT16 w2 = OPER_I_16(m68k); + uint16_t w2 = OPER_I_16(m68k); switch ((w2 >> 13) & 0x7) { case 0x0: // FPU ALU FP, FP @@ -1950,7 +1950,7 @@ void m68040_fpu_op0(m68000_base_device *m68k) } } -static int perform_fsave(m68000_base_device *m68k, UINT32 addr, int inc) +static int perform_fsave(m68000_base_device *m68k, uint32_t addr, int inc) { if(m68k->cpu_type & CPU_TYPE_040) { @@ -2010,7 +2010,7 @@ static void do_frestore_null(m68000_base_device *m68k) m68k->fpu_just_reset = 1; } -static void m68040_do_fsave(m68000_base_device *m68k, UINT32 addr, int reg, int inc) +static void m68040_do_fsave(m68000_base_device *m68k, uint32_t addr, int reg, int inc) { if (m68k->fpu_just_reset) { @@ -2025,10 +2025,10 @@ static void m68040_do_fsave(m68000_base_device *m68k, UINT32 addr, int reg, int } } -static void m68040_do_frestore(m68000_base_device *m68k, UINT32 addr, int reg) +static void m68040_do_frestore(m68000_base_device *m68k, uint32_t addr, int reg) { bool m40 = m68k->cpu_type & CPU_TYPE_040; - UINT32 temp = m68ki_read_32(m68k, addr); + uint32_t temp = m68ki_read_32(m68k, addr); // check for nullptr frame if (temp & 0xff000000) @@ -2068,7 +2068,7 @@ void m68040_fpu_op1(m68000_base_device *m68k) int ea = m68k->ir & 0x3f; int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); - UINT32 addr; + uint32_t addr; switch ((m68k->ir >> 6) & 0x3) { @@ -2177,7 +2177,7 @@ void m68040_fpu_op1(m68000_base_device *m68k) void m68881_ftrap(m68000_base_device *m68k) { - UINT16 w2 = OPER_I_16(m68k); + uint16_t w2 = OPER_I_16(m68k); // now check the condition if (TEST_CONDITION(m68k, w2 & 0x3f)) diff --git a/src/devices/cpu/m68000/m68kmmu.h b/src/devices/cpu/m68000/m68kmmu.h index 7c3649c134b..d477b31f187 100644 --- a/src/devices/cpu/m68000/m68kmmu.h +++ b/src/devices/cpu/m68000/m68kmmu.h @@ -46,7 +46,7 @@ #define M68K_MMU_TC_SRE 0x02000000 /* decodes the effective address */ -static UINT32 DECODE_EA_32(m68000_base_device *m68k, int ea) +static uint32_t DECODE_EA_32(m68000_base_device *m68k, int ea) { int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); @@ -59,17 +59,17 @@ static UINT32 DECODE_EA_32(m68000_base_device *m68k, int ea) } case 3: // (An)+ { - UINT32 ea = EA_AY_PI_32(m68k); + uint32_t ea = EA_AY_PI_32(m68k); return ea; } case 5: // (d16, An) { - UINT32 ea = EA_AY_DI_32(m68k); + uint32_t ea = EA_AY_DI_32(m68k); return ea; } case 6: // (An) + (Xn) + d8 { - UINT32 ea = EA_AY_IX_32(m68k); + uint32_t ea = EA_AY_IX_32(m68k); return ea; } case 7: @@ -78,19 +78,19 @@ static UINT32 DECODE_EA_32(m68000_base_device *m68k, int ea) { case 0: // (xxx).W { - UINT32 ea = (UINT32)OPER_I_16(m68k); + uint32_t ea = (uint32_t)OPER_I_16(m68k); return ea; } case 1: // (xxx).L { - UINT32 d1 = OPER_I_16(m68k); - UINT32 d2 = OPER_I_16(m68k); - UINT32 ea = (d1 << 16) | d2; + uint32_t d1 = OPER_I_16(m68k); + uint32_t d2 = OPER_I_16(m68k); + uint32_t ea = (d1 << 16) | d2; return ea; } case 2: // (d16, PC) { - UINT32 ea = EA_PCDI_32(m68k); + uint32_t ea = EA_PCDI_32(m68k); return ea; } default: fatalerror("m68k: DECODE_EA_32: unhandled mode %d, reg %d at %08X\n", mode, reg, REG_PC(m68k)); @@ -105,14 +105,14 @@ static UINT32 DECODE_EA_32(m68000_base_device *m68k, int ea) /* pmmu_atc_add: adds this address to the ATC */ -void pmmu_atc_add(m68000_base_device *m68k, UINT32 logical, UINT32 physical, int fc) +void pmmu_atc_add(m68000_base_device *m68k, uint32_t logical, uint32_t physical, int fc) { int i, found; // get page size (i.e. # of bits to ignore); is 10 for Apollo int ps = (m68k->mmu_tc >> 20) & 0xf; // Note: exact emulation would use (logical >> ps) << (ps-8) - UINT32 atc_tag = M68K_MMU_ATC_VALID | ((fc &7) << 24)| logical >> ps; + uint32_t atc_tag = M68K_MMU_ATC_VALID | ((fc &7) << 24)| logical >> ps; // first see if this is already in the cache for (i = 0; i < MMU_ATC_ENTRIES; i++) @@ -176,10 +176,10 @@ void pmmu_atc_flush(m68000_base_device *m68k) } -static inline UINT32 get_dt2_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 ptest) +static inline uint32_t get_dt2_table_entry(m68000_base_device *m68k, uint32_t tptr, uint8_t ptest) { - UINT32 tbl_entry = m68k->program->read_dword(tptr); - UINT32 dt = tbl_entry & M68K_MMU_DF_DT; + uint32_t tbl_entry = m68k->program->read_dword(tptr); + uint32_t dt = tbl_entry & M68K_MMU_DF_DT; m68k->mmu_tmp_sr |= tbl_entry & 0x0004 ? M68K_MMU_SR_WRITE_PROTECT : 0; @@ -198,11 +198,11 @@ static inline UINT32 get_dt2_table_entry(m68000_base_device *m68k, UINT32 tptr, return tbl_entry; } -static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, UINT8 fc, UINT8 ptest) +static inline uint32_t get_dt3_table_entry(m68000_base_device *m68k, uint32_t tptr, uint8_t fc, uint8_t ptest) { - UINT32 tbl_entry2 = m68k->program->read_dword(tptr); - UINT32 tbl_entry = m68k->program->read_dword(tptr + 4); - UINT32 dt = tbl_entry2 & M68K_MMU_DF_DT; + uint32_t tbl_entry2 = m68k->program->read_dword(tptr); + uint32_t tbl_entry = m68k->program->read_dword(tptr + 4); + uint32_t dt = tbl_entry2 & M68K_MMU_DF_DT; m68k->mmu_tmp_sr |= ((tbl_entry2 & 0x0100) && !(fc & 4)) ? M68K_MMU_SR_SUPERVISOR_ONLY : 0; m68k->mmu_tmp_sr |= tbl_entry2 & 0x0004 ? M68K_MMU_SR_WRITE_PROTECT : 0; @@ -226,17 +226,17 @@ static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, /* pmmu_translate_addr_with_fc: perform 68851/68030-style PMMU address translation */ -/*static inline*/ static UINT32 pmmu_translate_addr_with_fc(m68000_base_device *m68k, UINT32 addr_in, UINT8 fc, UINT8 ptest) +/*static inline*/ static uint32_t pmmu_translate_addr_with_fc(m68000_base_device *m68k, uint32_t addr_in, uint8_t fc, uint8_t ptest) { - UINT32 addr_out, tbl_entry = 0, tamode = 0, tbmode = 0, tcmode = 0; - UINT32 root_aptr, root_limit, tofs, ps, is, abits, bbits, cbits; - UINT32 resolved, tptr, shift, last_entry_ptr; + uint32_t addr_out, tbl_entry = 0, tamode = 0, tbmode = 0, tcmode = 0; + uint32_t root_aptr, root_limit, tofs, ps, is, abits, bbits, cbits; + uint32_t resolved, tptr, shift, last_entry_ptr; int i; - UINT32 atc_tag; + uint32_t atc_tag; // int verbose = 0; -// static UINT32 pmmu_access_count = 0; -// static UINT32 pmmu_atc_count = 0; +// static uint32_t pmmu_access_count = 0; +// static uint32_t pmmu_atc_count = 0; resolved = 0; addr_out = addr_in; @@ -250,8 +250,8 @@ static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, if (m68k->mmu_tt0 & 0x8000) { // transparent translation register 0 enabled - UINT32 address_base = m68k->mmu_tt0 & 0xff000000; - UINT32 address_mask = ((m68k->mmu_tt0 << 8) & 0xff000000) ^ 0xff000000; + uint32_t address_base = m68k->mmu_tt0 & 0xff000000; + uint32_t address_mask = ((m68k->mmu_tt0 << 8) & 0xff000000) ^ 0xff000000; if ((addr_in & address_mask) == address_base && (fc & ~m68k->mmu_tt0) == ((m68k->mmu_tt0 >> 4) & 7)) { // printf("PMMU: pc=%x TT0 fc=%x addr_in=%08x address_mask=%08x address_base=%08x\n", m68k->ppc, fc, addr_in, address_mask, address_base); @@ -262,8 +262,8 @@ static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, if (m68k->mmu_tt1 & 0x8000) { // transparent translation register 1 enabled - UINT32 address_base = m68k->mmu_tt1 & 0xff000000; - UINT32 address_mask = ((m68k->mmu_tt1 << 8) & 0xff000000) ^ 0xff000000; + uint32_t address_base = m68k->mmu_tt1 & 0xff000000; + uint32_t address_mask = ((m68k->mmu_tt1 << 8) & 0xff000000) ^ 0xff000000; if ((addr_in & address_mask) == address_base && (fc & ~m68k->mmu_tt1) == ((m68k->mmu_tt1 >> 4) & 7)) { // printf("PMMU: pc=%x TT1 fc=%x addr_in=%08x address_mask=%08x address_base=%08x\n", m68k->ppc, fc, addr_in, address_mask, address_base); @@ -525,9 +525,9 @@ static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, // FC bits: 2 = supervisor, 1 = program, 0 = data // the 68040 is a subset of the 68851 and 68030 PMMUs - the page table sizes are fixed, there is no early termination, etc, etc. -/*static inline*/ static UINT32 pmmu_translate_addr_with_fc_040(m68000_base_device *m68k, UINT32 addr_in, UINT8 fc, UINT8 ptest) +/*static inline*/ static uint32_t pmmu_translate_addr_with_fc_040(m68000_base_device *m68k, uint32_t addr_in, uint8_t fc, uint8_t ptest) { - UINT32 addr_out, tt0, tt1; + uint32_t addr_out, tt0, tt1; addr_out = addr_in; m68k->mmu_tmp_sr = 0; @@ -554,7 +554,7 @@ static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, { static int fcmask[4] = { 4, 4, 0, 0 }; static int fcmatch[4] = { 0, 4, 0, 0 }; - UINT32 mask = (tt0>>16) & 0xff; + uint32_t mask = (tt0>>16) & 0xff; mask ^= 0xff; mask <<= 24; @@ -579,7 +579,7 @@ static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, { static int fcmask[4] = { 4, 4, 0, 0 }; static int fcmatch[4] = { 0, 4, 0, 0 }; - UINT32 mask = (tt1>>16) & 0xff; + uint32_t mask = (tt1>>16) & 0xff; mask ^= 0xff; mask <<= 24; @@ -602,11 +602,11 @@ static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, if (m68k->pmmu_enabled) { - UINT32 root_idx = (addr_in>>25) & 0x7f; - UINT32 ptr_idx = (addr_in>>18) & 0x7f; - UINT32 page_idx, page; - UINT32 root_ptr, pointer_ptr, page_ptr; - UINT32 root_entry, pointer_entry, page_entry; + uint32_t root_idx = (addr_in>>25) & 0x7f; + uint32_t ptr_idx = (addr_in>>18) & 0x7f; + uint32_t page_idx, page; + uint32_t root_ptr, pointer_ptr, page_ptr; + uint32_t root_entry, pointer_entry, page_entry; // select supervisor or user root pointer if (fc & 4) @@ -809,9 +809,9 @@ static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, /* pmmu_translate_addr: perform 68851/68030-style PMMU address translation */ -/*static inline*/ static UINT32 pmmu_translate_addr(m68000_base_device *m68k, UINT32 addr_in) +/*static inline*/ static uint32_t pmmu_translate_addr(m68000_base_device *m68k, uint32_t addr_in) { - UINT32 addr_out; + uint32_t addr_out; if (CPU_TYPE_IS_040_PLUS(m68k->cpu_type)) { @@ -837,9 +837,9 @@ static inline UINT32 get_dt3_table_entry(m68000_base_device *m68k, UINT32 tptr, void m68881_mmu_ops(m68000_base_device *m68k) { - UINT16 modes; - UINT32 ea = m68k->ir & 0x3f; - UINT64 temp64; + uint16_t modes; + uint32_t ea = m68k->ir & 0x3f; + uint64_t temp64; // catch the 2 "weird" encodings up front (PBcc) @@ -867,8 +867,8 @@ void m68881_mmu_ops(m68000_base_device *m68k) if ((modes & 0xfde0) == 0x2000) // PLOAD { - UINT32 ltmp = DECODE_EA_32(m68k, ea); - UINT32 ptmp; + uint32_t ltmp = DECODE_EA_32(m68k, ea); + uint32_t ptmp; ptmp = ltmp; if (m68k->pmmu_enabled) @@ -910,9 +910,9 @@ void m68881_mmu_ops(m68000_base_device *m68k) } else if ((modes & 0xe000) == 0x8000) // PTEST { - UINT32 v_addr = DECODE_EA_32(m68k, ea); - UINT32 p_addr; - UINT32 fc = modes & 0x1f; + uint32_t v_addr = DECODE_EA_32(m68k, ea); + uint32_t p_addr; + uint32_t fc = modes & 0x1f; switch (fc >> 3) { case 0: fc = fc == 0 ? m68k->sfc : m68k->dfc; @@ -969,12 +969,12 @@ void m68881_mmu_ops(m68000_base_device *m68k) break; case 0x12: // supervisor root pointer - WRITE_EA_64(m68k, ea, (UINT64)m68k->mmu_srp_limit<<32 | (UINT64)m68k->mmu_srp_aptr); + WRITE_EA_64(m68k, ea, (uint64_t)m68k->mmu_srp_limit<<32 | (uint64_t)m68k->mmu_srp_aptr); // printf("PMMU: pc=%x PMOVE from SRP limit = %08x, aptr = %08x\n", REG_PPC(m68k), m68k->mmu_srp_limit, m68k->mmu_srp_aptr); break; case 0x13: // CPU root pointer - WRITE_EA_64(m68k, ea, (UINT64)m68k->mmu_crp_limit<<32 | (UINT64)m68k->mmu_crp_aptr); + WRITE_EA_64(m68k, ea, (uint64_t)m68k->mmu_crp_limit<<32 | (uint64_t)m68k->mmu_crp_aptr); // printf("PMMU: pc=%x PMOVE from CRP limit = %08x, aptr = %08x\n", REG_PPC(m68k), m68k->mmu_crp_limit, m68k->mmu_crp_aptr); break; @@ -990,7 +990,7 @@ void m68881_mmu_ops(m68000_base_device *m68k) { case 0: { - UINT32 temp = READ_EA_32(m68k, ea); + uint32_t temp = READ_EA_32(m68k, ea); if (((modes>>10) & 7) == 2) { @@ -1057,7 +1057,7 @@ void m68881_mmu_ops(m68000_base_device *m68k) if (m68k->cpu_type == CPU_TYPE_020) { // DomainOS on Apollo DN3000 will only reset this to 0 - UINT16 mmu_ac = READ_EA_16(m68k, ea); + uint16_t mmu_ac = READ_EA_16(m68k, ea); if (mmu_ac != 0) { printf("680x0 PMMU: pc=%x PMOVE to mmu_ac=%08x\n", @@ -1075,7 +1075,7 @@ void m68881_mmu_ops(m68000_base_device *m68k) case 3: // MMU status { - UINT32 temp = READ_EA_32(m68k, ea); + uint32_t temp = READ_EA_32(m68k, ea); printf("680x0: unsupported PMOVE %x to MMU status, PC %x\n", temp, m68k->pc); } break; @@ -1111,9 +1111,9 @@ void m68881_mmu_ops(m68000_base_device *m68k) /* Apple HMMU translation is much simpler */ -static inline UINT32 hmmu_translate_addr(m68000_base_device *m68k, UINT32 addr_in) +static inline uint32_t hmmu_translate_addr(m68000_base_device *m68k, uint32_t addr_in) { - UINT32 addr_out; + uint32_t addr_out; addr_out = addr_in; diff --git a/src/devices/cpu/m6805/6805dasm.cpp b/src/devices/cpu/m6805/6805dasm.cpp index 9471d976924..13425c5d148 100644 --- a/src/devices/cpu/m6805/6805dasm.cpp +++ b/src/devices/cpu/m6805/6805dasm.cpp @@ -163,8 +163,8 @@ static const char *const opcode_strings[0x0100] = CPU_DISASSEMBLE( m6805 ) { int code, bit; - UINT16 ea; - UINT32 flags = 0; + uint16_t ea; + uint32_t flags = 0; code = oprom[0]; @@ -179,14 +179,14 @@ CPU_DISASSEMBLE( m6805 ) { case _btr: /* bit test and relative branch */ bit = (code >> 1) & 7; - sprintf (buffer, "%d,$%02X,$%03X", bit, opram[1], pc + 3 + (INT8)opram[2]); + sprintf (buffer, "%d,$%02X,$%03X", bit, opram[1], pc + 3 + (int8_t)opram[2]); return 3 | flags | DASMFLAG_SUPPORTED; case _bit: /* bit test */ bit = (code >> 1) & 7; sprintf (buffer, "%d,$%03X", bit, opram[1]); return 2 | flags | DASMFLAG_SUPPORTED; case _rel: /* relative */ - sprintf (buffer, "$%03X", pc + 2 + (INT8)opram[1]); + sprintf (buffer, "$%03X", pc + 2 + (int8_t)opram[1]); return 2 | flags | DASMFLAG_SUPPORTED; case _imm: /* immediate */ sprintf (buffer, "#$%02X", opram[1]); diff --git a/src/devices/cpu/m6805/6805ops.hxx b/src/devices/cpu/m6805/6805ops.hxx index c6761982c96..93244876243 100644 --- a/src/devices/cpu/m6805/6805ops.hxx +++ b/src/devices/cpu/m6805/6805ops.hxx @@ -17,7 +17,7 @@ HNZC #define OP_HANDLER(_name) void m6805_base_device::_name() #define DERIVED_OP_HANDLER(_arch,_name) void _arch##_device::_name() -#define OP_HANDLER_BIT(_name) void m6805_base_device::_name(UINT8 bit) +#define OP_HANDLER_BIT(_name) void m6805_base_device::_name(uint8_t bit) OP_HANDLER( illegal ) { @@ -27,7 +27,7 @@ OP_HANDLER( illegal ) /* $00/$02/$04/$06/$08/$0A/$0C/$0E BRSET direct,relative ---- */ OP_HANDLER_BIT( brset ) { - UINT8 t,r; + uint8_t t,r; DIRBYTE(r); IMMBYTE(t); @@ -42,7 +42,7 @@ OP_HANDLER_BIT( brset ) /* $01/$03/$05/$07/$09/$0B/$0D/$0F BRCLR direct,relative ---- */ OP_HANDLER_BIT( brclr ) { - UINT8 t,r; + uint8_t t,r; DIRBYTE(r); IMMBYTE(t); @@ -57,7 +57,7 @@ OP_HANDLER_BIT( brclr ) /* $10/$12/$14/$16/$18/$1A/$1C/$1E BSET direct ---- */ OP_HANDLER_BIT( bset ) { - UINT8 t,r; + uint8_t t,r; DIRBYTE(t); r=t|bit; WM(EAD,r); } @@ -65,7 +65,7 @@ OP_HANDLER_BIT( bset ) /* $11/$13/$15/$17/$19/$1B/$1D/$1F BCLR direct ---- */ OP_HANDLER_BIT( bclr) { - UINT8 t,r; + uint8_t t,r; DIRBYTE(t); r=t&(~bit); WM(EAD,r); } @@ -73,7 +73,7 @@ OP_HANDLER_BIT( bclr) /* $20 BRA relative ---- */ OP_HANDLER( bra ) { - UINT8 t; + uint8_t t; IMMBYTE(t); PC+=SIGNED(t); } @@ -181,8 +181,8 @@ DERIVED_OP_HANDLER( hd63705, bih ) /* $30 NEG direct -*** */ OP_HANDLER( neg_di ) { - UINT8 t; - UINT16 r; + uint8_t t; + uint16_t r; DIRBYTE(t); r=-t; CLR_NZC; @@ -197,7 +197,7 @@ OP_HANDLER( neg_di ) /* $33 COM direct -**1 */ OP_HANDLER( com_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); t = ~t; CLR_NZ; @@ -209,7 +209,7 @@ OP_HANDLER( com_di ) /* $34 LSR direct -0** */ OP_HANDLER( lsr_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); CLR_NZC; CC |= (t&0x01); @@ -223,7 +223,7 @@ OP_HANDLER( lsr_di ) /* $36 ROR direct -*** */ OP_HANDLER( ror_di ) { - UINT8 t,r; + uint8_t t,r; DIRBYTE(t); r = (CC & 0x01) << 7; CLR_NZC; @@ -236,7 +236,7 @@ OP_HANDLER( ror_di ) /* $37 ASR direct ?*** */ OP_HANDLER( asr_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); CLR_NZC; CC|=(t&0x01); t>>=1; t|=((t&0x40)<<1); @@ -247,8 +247,8 @@ OP_HANDLER( asr_di ) /* $38 LSL direct ?*** */ OP_HANDLER( lsl_di ) { - UINT8 t; - UINT16 r; + uint8_t t; + uint16_t r; DIRBYTE(t); r = t << 1; CLR_NZC; @@ -259,7 +259,7 @@ OP_HANDLER( lsl_di ) /* $39 ROL direct -*** */ OP_HANDLER( rol_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = CC & 0x01; r |= t << 1; @@ -271,7 +271,7 @@ OP_HANDLER( rol_di ) /* $3a DEC direct -**- */ OP_HANDLER( dec_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); --t; CLR_NZ; SET_FLAGS8D(t); @@ -283,7 +283,7 @@ OP_HANDLER( dec_di ) /* $3c INC direct -**- */ OP_HANDLER( inc_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); ++t; CLR_NZ; SET_FLAGS8I(t); @@ -293,7 +293,7 @@ OP_HANDLER( inc_di ) /* $3d TST direct -**- */ OP_HANDLER( tst_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); CLR_NZ; SET_NZ8(t); } @@ -311,7 +311,7 @@ OP_HANDLER( clr_di ) /* $40 NEGA inherent ?*** */ OP_HANDLER( nega ) { - UINT16 r; + uint16_t r; r = -A; CLR_NZC; SET_FLAGS8(0,A,r); A = r; @@ -344,7 +344,7 @@ OP_HANDLER( lsra ) /* $46 RORA inherent -*** */ OP_HANDLER( rora ) { - UINT8 r; + uint8_t r; r = (CC & 0x01) << 7; CLR_NZC; CC |= (A & 0x01); @@ -365,7 +365,7 @@ OP_HANDLER( asra ) /* $48 LSLA inherent ?*** */ OP_HANDLER( lsla ) { - UINT16 r; + uint16_t r; r = A << 1; CLR_NZC; SET_FLAGS8(A,A,r); @@ -375,7 +375,7 @@ OP_HANDLER( lsla ) /* $49 ROLA inherent -*** */ OP_HANDLER( rola ) { - UINT16 t,r; + uint16_t t,r; t = A; r = CC & 0x01; r |= t << 1; @@ -422,7 +422,7 @@ OP_HANDLER( clra ) /* $50 NEGX inherent ?*** */ OP_HANDLER( negx ) { - UINT16 r; + uint16_t r; r = -X; CLR_NZC; SET_FLAGS8(0,X,r); @@ -456,7 +456,7 @@ OP_HANDLER( lsrx ) /* $56 RORX inherent -*** */ OP_HANDLER( rorx ) { - UINT8 r; + uint8_t r; r = (CC & 0x01) << 7; CLR_NZC; CC |= (X & 0x01); @@ -477,7 +477,7 @@ OP_HANDLER( asrx ) /* $58 ASLX inherent ?*** */ OP_HANDLER( aslx ) { - UINT16 r; + uint16_t r; r = X << 1; CLR_NZC; SET_FLAGS8(X,X,r); @@ -487,7 +487,7 @@ OP_HANDLER( aslx ) /* $59 ROLX inherent -*** */ OP_HANDLER( rolx ) { - UINT16 t,r; + uint16_t t,r; t = X; r = CC & 0x01; r |= t<<1; @@ -534,8 +534,8 @@ OP_HANDLER( clrx ) /* $60 NEG indexed, 1 byte offset -*** */ OP_HANDLER( neg_ix1 ) { - UINT8 t; - UINT16 r; + uint8_t t; + uint16_t r; IDX1BYTE(t); r=-t; CLR_NZC; SET_FLAGS8(0,t,r); WM(EAD,r); @@ -548,7 +548,7 @@ OP_HANDLER( neg_ix1 ) /* $63 COM indexed, 1 byte offset -**1 */ OP_HANDLER( com_ix1 ) { - UINT8 t; + uint8_t t; IDX1BYTE(t); t = ~t; CLR_NZ; SET_NZ8(t); SEC; WM(EAD,t); @@ -557,7 +557,7 @@ OP_HANDLER( com_ix1 ) /* $64 LSR indexed, 1 byte offset -0** */ OP_HANDLER( lsr_ix1 ) { - UINT8 t; + uint8_t t; IDX1BYTE(t); CLR_NZC; CC |= (t & 0x01); @@ -571,7 +571,7 @@ OP_HANDLER( lsr_ix1 ) /* $66 ROR indexed, 1 byte offset -*** */ OP_HANDLER( ror_ix1 ) { - UINT8 t,r; + uint8_t t,r; IDX1BYTE(t); r = (CC & 0x01) << 7; CLR_NZC; @@ -584,7 +584,7 @@ OP_HANDLER( ror_ix1 ) /* $67 ASR indexed, 1 byte offset ?*** */ OP_HANDLER( asr_ix1 ) { - UINT8 t; + uint8_t t; IDX1BYTE(t); CLR_NZC; CC|=(t&0x01); t>>=1; t|=((t&0x40)<<1); @@ -595,8 +595,8 @@ OP_HANDLER( asr_ix1 ) /* $68 LSL indexed, 1 byte offset ?*** */ OP_HANDLER( lsl_ix1 ) { - UINT8 t; - UINT16 r; + uint8_t t; + uint16_t r; IDX1BYTE(t); r = t << 1; CLR_NZC; @@ -607,7 +607,7 @@ OP_HANDLER( lsl_ix1 ) /* $69 ROL indexed, 1 byte offset -*** */ OP_HANDLER( rol_ix1 ) { - UINT16 t,r; + uint16_t t,r; IDX1BYTE(t); r = CC & 0x01; r |= t << 1; @@ -619,7 +619,7 @@ OP_HANDLER( rol_ix1 ) /* $6a DEC indexed, 1 byte offset -**- */ OP_HANDLER( dec_ix1 ) { - UINT8 t; + uint8_t t; IDX1BYTE(t); --t; CLR_NZ; SET_FLAGS8D(t); @@ -631,7 +631,7 @@ OP_HANDLER( dec_ix1 ) /* $6c INC indexed, 1 byte offset -**- */ OP_HANDLER( inc_ix1 ) { - UINT8 t; + uint8_t t; IDX1BYTE(t); ++t; CLR_NZ; SET_FLAGS8I(t); @@ -641,7 +641,7 @@ OP_HANDLER( inc_ix1 ) /* $6d TST indexed, 1 byte offset -**- */ OP_HANDLER( tst_ix1 ) { - UINT8 t; + uint8_t t; IDX1BYTE(t); CLR_NZ; SET_NZ8(t); } @@ -659,8 +659,8 @@ OP_HANDLER( clr_ix1 ) /* $70 NEG indexed -*** */ OP_HANDLER( neg_ix ) { - UINT8 t; - UINT16 r; + uint8_t t; + uint16_t r; IDXBYTE(t); r=-t; CLR_NZC; SET_FLAGS8(0,t,r); WM(EAD,r); @@ -673,7 +673,7 @@ OP_HANDLER( neg_ix ) /* $73 COM indexed -**1 */ OP_HANDLER( com_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); t = ~t; CLR_NZ; SET_NZ8(t); SEC; WM(EAD,t); @@ -682,7 +682,7 @@ OP_HANDLER( com_ix ) /* $74 LSR indexed -0** */ OP_HANDLER( lsr_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); CLR_NZC; CC |= (t & 0x01); @@ -696,7 +696,7 @@ OP_HANDLER( lsr_ix ) /* $76 ROR indexed -*** */ OP_HANDLER( ror_ix ) { - UINT8 t,r; + uint8_t t,r; IDXBYTE(t); r = (CC & 0x01) << 7; CLR_NZC; @@ -709,7 +709,7 @@ OP_HANDLER( ror_ix ) /* $77 ASR indexed ?*** */ OP_HANDLER( asr_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); CLR_NZC; CC |= (t & 0x01); @@ -721,8 +721,8 @@ OP_HANDLER( asr_ix ) /* $78 LSL indexed ?*** */ OP_HANDLER( lsl_ix ) { - UINT8 t; - UINT16 r; + uint8_t t; + uint16_t r; IDXBYTE(t); r=t<<1; CLR_NZC; SET_FLAGS8(t,t,r); WM(EAD,r); @@ -731,7 +731,7 @@ OP_HANDLER( lsl_ix ) /* $79 ROL indexed -*** */ OP_HANDLER( rol_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = CC & 0x01; r |= t << 1; @@ -743,7 +743,7 @@ OP_HANDLER( rol_ix ) /* $7a DEC indexed -**- */ OP_HANDLER( dec_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); --t; CLR_NZ; SET_FLAGS8D(t); @@ -755,7 +755,7 @@ OP_HANDLER( dec_ix ) /* $7c INC indexed -**- */ OP_HANDLER( inc_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); ++t; CLR_NZ; SET_FLAGS8I(t); @@ -765,7 +765,7 @@ OP_HANDLER( inc_ix ) /* $7d TST indexed -**- */ OP_HANDLER( tst_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); CLR_NZ; SET_NZ8(t); } @@ -897,7 +897,7 @@ OP_HANDLER( txa ) /* $a0 SUBA immediate ?*** */ OP_HANDLER( suba_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A - t; CLR_NZC; @@ -908,7 +908,7 @@ OP_HANDLER( suba_im ) /* $a1 CMPA immediate ?*** */ OP_HANDLER( cmpa_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A - t; CLR_NZC; @@ -918,7 +918,7 @@ OP_HANDLER( cmpa_im ) /* $a2 SBCA immediate ?*** */ OP_HANDLER( sbca_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A - t - (CC & 0x01); CLR_NZC; @@ -929,7 +929,7 @@ OP_HANDLER( sbca_im ) /* $a3 CPX immediate -*** */ OP_HANDLER( cpx_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = X - t; CLR_NZC; @@ -939,7 +939,7 @@ OP_HANDLER( cpx_im ) /* $a4 ANDA immediate -**- */ OP_HANDLER( anda_im ) { - UINT8 t; + uint8_t t; IMMBYTE(t); A &= t; CLR_NZ; @@ -949,7 +949,7 @@ OP_HANDLER( anda_im ) /* $a5 BITA immediate -**- */ OP_HANDLER( bita_im ) { - UINT8 t,r; + uint8_t t,r; IMMBYTE(t); r = A & t; CLR_NZ; @@ -969,7 +969,7 @@ OP_HANDLER( lda_im ) /* $a8 EORA immediate -**- */ OP_HANDLER( eora_im ) { - UINT8 t; + uint8_t t; IMMBYTE(t); A ^= t; CLR_NZ; @@ -979,7 +979,7 @@ OP_HANDLER( eora_im ) /* $a9 ADCA immediate **** */ OP_HANDLER( adca_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A + t + (CC & 0x01); CLR_HNZC; @@ -991,7 +991,7 @@ OP_HANDLER( adca_im ) /* $aa ORA immediate -**- */ OP_HANDLER( ora_im ) { - UINT8 t; + uint8_t t; IMMBYTE(t); A |= t; CLR_NZ; @@ -1001,7 +1001,7 @@ OP_HANDLER( ora_im ) /* $ab ADDA immediate **** */ OP_HANDLER( adda_im ) { - UINT16 t,r; + uint16_t t,r; IMMBYTE(t); r = A + t; CLR_HNZC; @@ -1015,7 +1015,7 @@ OP_HANDLER( adda_im ) /* $ad BSR ---- */ OP_HANDLER( bsr ) { - UINT8 t; + uint8_t t; IMMBYTE(t); PUSHWORD(m_pc); PC += SIGNED(t); @@ -1034,7 +1034,7 @@ OP_HANDLER( ldx_im ) /* $b0 SUBA direct ?*** */ OP_HANDLER( suba_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A - t; CLR_NZC; @@ -1045,7 +1045,7 @@ OP_HANDLER( suba_di ) /* $b1 CMPA direct ?*** */ OP_HANDLER( cmpa_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A - t; CLR_NZC; @@ -1055,7 +1055,7 @@ OP_HANDLER( cmpa_di ) /* $b2 SBCA direct ?*** */ OP_HANDLER( sbca_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A - t - (CC & 0x01); CLR_NZC; @@ -1066,7 +1066,7 @@ OP_HANDLER( sbca_di ) /* $b3 CPX direct -*** */ OP_HANDLER( cpx_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = X - t; CLR_NZC; @@ -1076,7 +1076,7 @@ OP_HANDLER( cpx_di ) /* $b4 ANDA direct -**- */ OP_HANDLER( anda_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); A &= t; CLR_NZ; @@ -1086,7 +1086,7 @@ OP_HANDLER( anda_di ) /* $b5 BITA direct -**- */ OP_HANDLER( bita_di ) { - UINT8 t,r; + uint8_t t,r; DIRBYTE(t); r = A & t; CLR_NZ; @@ -1113,7 +1113,7 @@ OP_HANDLER( sta_di ) /* $b8 EORA direct -**- */ OP_HANDLER( eora_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); A ^= t; CLR_NZ; @@ -1123,7 +1123,7 @@ OP_HANDLER( eora_di ) /* $b9 ADCA direct **** */ OP_HANDLER( adca_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A + t + (CC & 0x01); CLR_HNZC; @@ -1135,7 +1135,7 @@ OP_HANDLER( adca_di ) /* $ba ORA direct -**- */ OP_HANDLER( ora_di ) { - UINT8 t; + uint8_t t; DIRBYTE(t); A |= t; CLR_NZ; @@ -1145,7 +1145,7 @@ OP_HANDLER( ora_di ) /* $bb ADDA direct **** */ OP_HANDLER( adda_di ) { - UINT16 t,r; + uint16_t t,r; DIRBYTE(t); r = A + t; CLR_HNZC; @@ -1189,7 +1189,7 @@ OP_HANDLER( stx_di ) /* $c0 SUBA extended ?*** */ OP_HANDLER( suba_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A - t; CLR_NZC; @@ -1200,7 +1200,7 @@ OP_HANDLER( suba_ex ) /* $c1 CMPA extended ?*** */ OP_HANDLER( cmpa_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A - t; CLR_NZC; @@ -1210,7 +1210,7 @@ OP_HANDLER( cmpa_ex ) /* $c2 SBCA extended ?*** */ OP_HANDLER( sbca_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A - t - (CC & 0x01); CLR_NZC; @@ -1221,7 +1221,7 @@ OP_HANDLER( sbca_ex ) /* $c3 CPX extended -*** */ OP_HANDLER( cpx_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = X - t; CLR_NZC; @@ -1231,7 +1231,7 @@ OP_HANDLER( cpx_ex ) /* $c4 ANDA extended -**- */ OP_HANDLER( anda_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); A &= t; CLR_NZ; @@ -1241,7 +1241,7 @@ OP_HANDLER( anda_ex ) /* $c5 BITA extended -**- */ OP_HANDLER( bita_ex ) { - UINT8 t,r; + uint8_t t,r; EXTBYTE(t); r = A & t; CLR_NZ; @@ -1268,7 +1268,7 @@ OP_HANDLER( sta_ex ) /* $c8 EORA extended -**- */ OP_HANDLER( eora_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); A ^= t; CLR_NZ; @@ -1278,7 +1278,7 @@ OP_HANDLER( eora_ex ) /* $c9 ADCA extended **** */ OP_HANDLER( adca_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A + t + (CC & 0x01); CLR_HNZC; @@ -1290,7 +1290,7 @@ OP_HANDLER( adca_ex ) /* $ca ORA extended -**- */ OP_HANDLER( ora_ex ) { - UINT8 t; + uint8_t t; EXTBYTE(t); A |= t; CLR_NZ; @@ -1300,7 +1300,7 @@ OP_HANDLER( ora_ex ) /* $cb ADDA extended **** */ OP_HANDLER( adda_ex ) { - UINT16 t,r; + uint16_t t,r; EXTBYTE(t); r = A + t; CLR_HNZC; @@ -1344,7 +1344,7 @@ OP_HANDLER( stx_ex ) /* $d0 SUBA indexed, 2 byte offset ?*** */ OP_HANDLER( suba_ix2 ) { - UINT16 t,r; + uint16_t t,r; IDX2BYTE(t); r = A - t; CLR_NZC; @@ -1355,7 +1355,7 @@ OP_HANDLER( suba_ix2 ) /* $d1 CMPA indexed, 2 byte offset ?*** */ OP_HANDLER( cmpa_ix2 ) { - UINT16 t,r; + uint16_t t,r; IDX2BYTE(t); r = A - t; CLR_NZC; @@ -1365,7 +1365,7 @@ OP_HANDLER( cmpa_ix2 ) /* $d2 SBCA indexed, 2 byte offset ?*** */ OP_HANDLER( sbca_ix2 ) { - UINT16 t,r; + uint16_t t,r; IDX2BYTE(t); r = A - t - (CC & 0x01); CLR_NZC; @@ -1376,7 +1376,7 @@ OP_HANDLER( sbca_ix2 ) /* $d3 CPX indexed, 2 byte offset -*** */ OP_HANDLER( cpx_ix2 ) { - UINT16 t,r; + uint16_t t,r; IDX2BYTE(t); r = X - t; CLR_NZC; @@ -1386,7 +1386,7 @@ OP_HANDLER( cpx_ix2 ) /* $d4 ANDA indexed, 2 byte offset -**- */ OP_HANDLER( anda_ix2 ) { - UINT8 t; + uint8_t t; IDX2BYTE(t); A &= t; CLR_NZ; @@ -1396,7 +1396,7 @@ OP_HANDLER( anda_ix2 ) /* $d5 BITA indexed, 2 byte offset -**- */ OP_HANDLER( bita_ix2 ) { - UINT8 t,r; + uint8_t t,r; IDX2BYTE(t); r = A & t; CLR_NZ; @@ -1423,7 +1423,7 @@ OP_HANDLER( sta_ix2 ) /* $d8 EORA indexed, 2 byte offset -**- */ OP_HANDLER( eora_ix2 ) { - UINT8 t; + uint8_t t; IDX2BYTE(t); A ^= t; CLR_NZ; @@ -1433,7 +1433,7 @@ OP_HANDLER( eora_ix2 ) /* $d9 ADCA indexed, 2 byte offset **** */ OP_HANDLER( adca_ix2 ) { - UINT16 t,r; + uint16_t t,r; IDX2BYTE(t); r = A + t + (CC & 0x01); CLR_HNZC; @@ -1445,7 +1445,7 @@ OP_HANDLER( adca_ix2 ) /* $da ORA indexed, 2 byte offset -**- */ OP_HANDLER( ora_ix2 ) { - UINT8 t; + uint8_t t; IDX2BYTE(t); A |= t; CLR_NZ; @@ -1455,7 +1455,7 @@ OP_HANDLER( ora_ix2 ) /* $db ADDA indexed, 2 byte offset **** */ OP_HANDLER( adda_ix2 ) { - UINT16 t,r; + uint16_t t,r; IDX2BYTE(t); r = A + t; CLR_HNZC; @@ -1499,7 +1499,7 @@ OP_HANDLER( stx_ix2 ) /* $e0 SUBA indexed, 1 byte offset ?*** */ OP_HANDLER( suba_ix1 ) { - UINT16 t,r; + uint16_t t,r; IDX1BYTE(t); r = A - t; CLR_NZC; @@ -1510,7 +1510,7 @@ OP_HANDLER( suba_ix1 ) /* $e1 CMPA indexed, 1 byte offset ?*** */ OP_HANDLER( cmpa_ix1 ) { - UINT16 t,r; + uint16_t t,r; IDX1BYTE(t); r = A - t; CLR_NZC; @@ -1520,7 +1520,7 @@ OP_HANDLER( cmpa_ix1 ) /* $e2 SBCA indexed, 1 byte offset ?*** */ OP_HANDLER( sbca_ix1 ) { - UINT16 t,r; + uint16_t t,r; IDX1BYTE(t); r = A - t - (CC & 0x01); CLR_NZC; @@ -1531,7 +1531,7 @@ OP_HANDLER( sbca_ix1 ) /* $e3 CPX indexed, 1 byte offset -*** */ OP_HANDLER( cpx_ix1 ) { - UINT16 t,r; + uint16_t t,r; IDX1BYTE(t); r = X - t; CLR_NZC; @@ -1541,7 +1541,7 @@ OP_HANDLER( cpx_ix1 ) /* $e4 ANDA indexed, 1 byte offset -**- */ OP_HANDLER( anda_ix1 ) { - UINT8 t; + uint8_t t; IDX1BYTE(t); A &= t; CLR_NZ; @@ -1551,7 +1551,7 @@ OP_HANDLER( anda_ix1 ) /* $e5 BITA indexed, 1 byte offset -**- */ OP_HANDLER( bita_ix1 ) { - UINT8 t,r; + uint8_t t,r; IDX1BYTE(t); r = A & t; CLR_NZ; @@ -1578,7 +1578,7 @@ OP_HANDLER( sta_ix1 ) /* $e8 EORA indexed, 1 byte offset -**- */ OP_HANDLER( eora_ix1 ) { - UINT8 t; + uint8_t t; IDX1BYTE(t); A ^= t; CLR_NZ; @@ -1588,7 +1588,7 @@ OP_HANDLER( eora_ix1 ) /* $e9 ADCA indexed, 1 byte offset **** */ OP_HANDLER( adca_ix1 ) { - UINT16 t,r; + uint16_t t,r; IDX1BYTE(t); r = A + t + (CC & 0x01); CLR_HNZC; @@ -1600,7 +1600,7 @@ OP_HANDLER( adca_ix1 ) /* $ea ORA indexed, 1 byte offset -**- */ OP_HANDLER( ora_ix1 ) { - UINT8 t; + uint8_t t; IDX1BYTE(t); A |= t; CLR_NZ; @@ -1610,7 +1610,7 @@ OP_HANDLER( ora_ix1 ) /* $eb ADDA indexed, 1 byte offset **** */ OP_HANDLER( adda_ix1 ) { - UINT16 t,r; + uint16_t t,r; IDX1BYTE(t); r = A + t; CLR_HNZC; @@ -1654,7 +1654,7 @@ OP_HANDLER( stx_ix1 ) /* $f0 SUBA indexed ?*** */ OP_HANDLER( suba_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A - t; CLR_NZC; @@ -1665,7 +1665,7 @@ OP_HANDLER( suba_ix ) /* $f1 CMPA indexed ?*** */ OP_HANDLER( cmpa_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A - t; CLR_NZC; @@ -1675,7 +1675,7 @@ OP_HANDLER( cmpa_ix ) /* $f2 SBCA indexed ?*** */ OP_HANDLER( sbca_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A - t - (CC & 0x01); CLR_NZC; @@ -1686,7 +1686,7 @@ OP_HANDLER( sbca_ix ) /* $f3 CPX indexed -*** */ OP_HANDLER( cpx_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = X - t; CLR_NZC; @@ -1696,7 +1696,7 @@ OP_HANDLER( cpx_ix ) /* $f4 ANDA indexed -**- */ OP_HANDLER( anda_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); A &= t; CLR_NZ; @@ -1706,7 +1706,7 @@ OP_HANDLER( anda_ix ) /* $f5 BITA indexed -**- */ OP_HANDLER( bita_ix ) { - UINT8 t,r; + uint8_t t,r; IDXBYTE(t); r = A & t; CLR_NZ; @@ -1733,7 +1733,7 @@ OP_HANDLER( sta_ix ) /* $f8 EORA indexed -**- */ OP_HANDLER( eora_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); A ^= t; CLR_NZ; @@ -1743,7 +1743,7 @@ OP_HANDLER( eora_ix ) /* $f9 ADCA indexed **** */ OP_HANDLER( adca_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A + t + (CC & 0x01); CLR_HNZC; @@ -1755,7 +1755,7 @@ OP_HANDLER( adca_ix ) /* $fa ORA indexed -**- */ OP_HANDLER( ora_ix ) { - UINT8 t; + uint8_t t; IDXBYTE(t); A |= t; CLR_NZ; @@ -1765,7 +1765,7 @@ OP_HANDLER( ora_ix ) /* $fb ADDA indexed **** */ OP_HANDLER( adda_ix ) { - UINT16 t,r; + uint16_t t,r; IDXBYTE(t); r = A + t; CLR_HNZC; diff --git a/src/devices/cpu/m6805/m6805.cpp b/src/devices/cpu/m6805/m6805.cpp index c95f45d32df..8e7b6b963f8 100644 --- a/src/devices/cpu/m6805/m6805.cpp +++ b/src/devices/cpu/m6805/m6805.cpp @@ -14,9 +14,9 @@ 6809 Microcomputer Programming & Interfacing with Experiments" by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits + System dependencies: uint16_t must be 16 bit unsigned int + uint8_t must be 8 bit unsigned int + uint32_t must be more than 16 bits arrays up to 65536 bytes must be supported machine must be twos complement @@ -111,12 +111,12 @@ /* macros for CC -- CC bits affected should be reset before calling */ #define SET_Z(a) if(!a)SEZ -#define SET_Z8(a) SET_Z((UINT8)a) +#define SET_Z8(a) SET_Z((uint8_t)a) #define SET_N8(a) CC|=((a&0x80)>>5) #define SET_H(a,b,r) CC|=((a^b^r)&0x10) #define SET_C8(a) CC|=((a&0x100)>>8) -const UINT8 m6805_base_device::m_flags8i[256]= /* increment */ +const uint8_t m6805_base_device::m_flags8i[256]= /* increment */ { 0x02,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, @@ -136,7 +136,7 @@ const UINT8 m6805_base_device::m_flags8i[256]= /* increment */ 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04 }; -const UINT8 m6805_base_device::m_flags8d[256]= /* decrement */ +const uint8_t m6805_base_device::m_flags8d[256]= /* decrement */ { 0x02,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, @@ -162,8 +162,8 @@ const UINT8 m6805_base_device::m_flags8d[256]= /* decrement */ #define SET_NZ8(a) {SET_N8(a); SET_Z(a);} #define SET_FLAGS8(a,b,r) {SET_N8(r); SET_Z8(r); SET_C8(r);} -/* for treating an unsigned UINT8 as a signed INT16 */ -#define SIGNED(b) ((INT16)(b & 0x80 ? b | 0xff00 : b)) +/* for treating an unsigned uint8_t as a signed int16_t */ +#define SIGNED(b) ((int16_t)(b & 0x80 ? b | 0xff00 : b)) /* Macros for addressing modes */ #define DIRECT EAD=0; IMMBYTE(m_ea.b.l) @@ -195,10 +195,10 @@ const UINT8 m6805_base_device::m_flags8d[256]= /* decrement */ #define IDX1BYTE(b) {INDEXED1; b = RM(EAD);} #define IDX2BYTE(b) {INDEXED2; b = RM(EAD);} /* Macros for branch instructions */ -#define BRANCH(f) { UINT8 t; IMMBYTE(t); if(f) { PC += SIGNED(t); } } +#define BRANCH(f) { uint8_t t; IMMBYTE(t); if(f) { PC += SIGNED(t); } } /* what they say it is ... */ -const UINT8 m6805_base_device::m_cycles1[] = +const uint8_t m6805_base_device::m_cycles1[] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /*0*/ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, @@ -223,7 +223,7 @@ const UINT8 m6805_base_device::m_cycles1[] = /* pre-clear a PAIR union; clearing h2 and h3 only might be faster? */ #define CLEAR_PAIR(p) p->d = 0 -void m6805_base_device::rd_s_handler_b(UINT8 *b) +void m6805_base_device::rd_s_handler_b(uint8_t *b) { SP_INC; *b = RM( S ); @@ -238,7 +238,7 @@ void m6805_base_device::rd_s_handler_w(PAIR *p) p->b.l = RM( S ); } -void m6805_base_device::wr_s_handler_b(UINT8 *b) +void m6805_base_device::wr_s_handler_b(uint8_t *b) { WM( S, *b ); SP_DEC; @@ -252,7 +252,7 @@ void m6805_base_device::wr_s_handler_w(PAIR *p) SP_DEC; } -void m6805_base_device::RM16(UINT32 addr, PAIR *p) +void m6805_base_device::RM16(uint32_t addr, PAIR *p) { CLEAR_PAIR(p); p->b.h = RM(addr); @@ -409,7 +409,7 @@ void m6805_base_device::interrupt() // m6809_base_device - constructor //------------------------------------------------- -m6805_base_device::m6805_base_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, const device_type type, const char *name, UINT32 addr_width, const char *shortname, const char *source) +m6805_base_device::m6805_base_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, const device_type type, const char *name, uint32_t addr_width, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_BIG, 8, addr_width) { @@ -518,7 +518,7 @@ void m6805_base_device::state_string_export(const device_state_entry &entry, std // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 m6805_base_device::disasm_min_opcode_bytes() const +uint32_t m6805_base_device::disasm_min_opcode_bytes() const { return 1; } @@ -529,7 +529,7 @@ UINT32 m6805_base_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 m6805_base_device::disasm_max_opcode_bytes() const +uint32_t m6805_base_device::disasm_max_opcode_bytes() const { return 3; } @@ -540,7 +540,7 @@ UINT32 m6805_base_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t m6805_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6805_base_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( m6805 ); return CPU_DISASSEMBLE_NAME(m6805)(this, buffer, pc, oprom, opram, options); @@ -569,7 +569,7 @@ void m6805_device::execute_set_input(int inputnum, int state) // clock into cycles per second //------------------------------------------------- -UINT64 m6805_base_device::execute_clocks_to_cycles(UINT64 clocks) const +uint64_t m6805_base_device::execute_clocks_to_cycles(uint64_t clocks) const { return (clocks + 3) / 4; } @@ -580,7 +580,7 @@ UINT64 m6805_base_device::execute_clocks_to_cycles(UINT64 clocks) const // count back to raw clocks //------------------------------------------------- -UINT64 m6805_base_device::execute_cycles_to_clocks(UINT64 cycles) const +uint64_t m6805_base_device::execute_cycles_to_clocks(uint64_t cycles) const { return cycles * 4; } @@ -591,7 +591,7 @@ UINT64 m6805_base_device::execute_cycles_to_clocks(UINT64 cycles) const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 m6805_base_device::execute_min_cycles() const +uint32_t m6805_base_device::execute_min_cycles() const { return 2; } @@ -602,7 +602,7 @@ UINT32 m6805_base_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 m6805_base_device::execute_max_cycles() const +uint32_t m6805_base_device::execute_max_cycles() const { return 10; } @@ -613,7 +613,7 @@ UINT32 m6805_base_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 m6805_base_device::execute_input_lines() const +uint32_t m6805_base_device::execute_input_lines() const { return 9; } @@ -622,7 +622,7 @@ UINT32 m6805_base_device::execute_input_lines() const /* execute instructions on this CPU until icount expires */ void m6805_base_device::execute_run() { - UINT8 ireg; + uint8_t ireg; S = SP_ADJUST( S ); /* Taken from CPU_SET_CONTEXT when pointer'afying */ diff --git a/src/devices/cpu/m6805/m6805.h b/src/devices/cpu/m6805/m6805.h index 40fd8b3db9b..3b146d98ae1 100644 --- a/src/devices/cpu/m6805/m6805.h +++ b/src/devices/cpu/m6805/m6805.h @@ -26,7 +26,7 @@ class m6805_base_device : public cpu_device { public: // construction/destruction - m6805_base_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, const device_type type, const char *name, UINT32 addr_width, const char *shortname, const char *source); + m6805_base_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, const device_type type, const char *name, uint32_t addr_width, const char *shortname, const char *source); protected: // device-level overrides @@ -34,42 +34,42 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override = 0; - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override; - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override; + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; private: // opcode/condition tables - static const UINT8 m_flags8i[256]; - static const UINT8 m_flags8d[256]; - static const UINT8 m_cycles1[256]; + static const uint8_t m_flags8i[256]; + static const uint8_t m_flags8d[256]; + static const uint8_t m_cycles1[256]; protected: - void rd_s_handler_b(UINT8 *b); + void rd_s_handler_b(uint8_t *b); void rd_s_handler_w(PAIR *p); - void wr_s_handler_b(UINT8 *b); + void wr_s_handler_b(uint8_t *b); void wr_s_handler_w(PAIR *p); - void RM16(UINT32 addr, PAIR *p); + void RM16(uint32_t addr, PAIR *p); - void brset(UINT8 bit); - void brclr(UINT8 bit); - void bset(UINT8 bit); - void bclr(UINT8 bit); + void brset(uint8_t bit); + void brclr(uint8_t bit); + void bset(uint8_t bit); + void bclr(uint8_t bit); void bra(); void brn(); @@ -267,15 +267,15 @@ protected: // CPU registers PAIR m_ea; /* effective address */ - UINT32 m_sp_mask; /* Stack pointer address mask */ - UINT32 m_sp_low; /* Stack pointer low water mark (or floor) */ + uint32_t m_sp_mask; /* Stack pointer address mask */ + uint32_t m_sp_low; /* Stack pointer low water mark (or floor) */ PAIR m_pc; /* Program counter */ PAIR m_s; /* Stack pointer */ - UINT8 m_a; /* Accumulator */ - UINT8 m_x; /* Index register */ - UINT8 m_cc; /* Condition codes */ + uint8_t m_a; /* Accumulator */ + uint8_t m_x; /* Index register */ + uint8_t m_cc; /* Condition codes */ - UINT16 m_pending_interrupts; /* MB */ + uint16_t m_pending_interrupts; /* MB */ int m_irq_state[9]; /* KW Additional lines for HD63705 */ int m_nmi_state; @@ -294,7 +294,7 @@ class m6805_device : public m6805_base_device { public: // construction/destruction - m6805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + m6805_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6805_base_device(mconfig, tag, owner, clock, M6805, "M6805", 12, "m6805", __FILE__) { } protected: @@ -307,7 +307,7 @@ class m68hc05eg_device : public m6805_base_device { public: // construction/destruction - m68hc05eg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + m68hc05eg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6805_base_device(mconfig, tag, owner, clock, M68HC05EG, "M68HC05EG", 13, "m68hc05eg", __FILE__) { } protected: @@ -325,7 +325,7 @@ class m68705_device : public m6805_base_device { public: // construction/destruction - m68705_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + m68705_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6805_base_device(mconfig, tag, owner, clock, M68705, "M68705", 12, "m68705", __FILE__) { } protected: @@ -343,7 +343,7 @@ class hd63705_device : public m6805_base_device { public: // construction/destruction - hd63705_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + hd63705_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6805_base_device(mconfig, tag, owner, clock, HD63705, "HD63705", 16, "hd63705", __FILE__) { } protected: diff --git a/src/devices/cpu/m6809/6309dasm.cpp b/src/devices/cpu/m6809/6309dasm.cpp index 47637e22472..16f4c3b1752 100644 --- a/src/devices/cpu/m6809/6309dasm.cpp +++ b/src/devices/cpu/m6809/6309dasm.cpp @@ -29,10 +29,10 @@ // Opcode structure struct opcodeinfo { - UINT8 opcode; // 8-bit opcode value - UINT8 length; // Opcode length in bytes + uint8_t opcode; // 8-bit opcode value + uint8_t length; // Opcode length in bytes char name[6]; // Opcode name - UINT8 mode; // Addressing mode + uint8_t mode; // Addressing mode unsigned flags; // Disassembly flags }; @@ -608,8 +608,8 @@ static const char *const tfm_s[] = { "%s+,%s+", "%s-,%s-", "%s+,%s", "%s,%s+" }; CPU_DISASSEMBLE( hd6309 ) { - UINT8 opcode, mode, pb, pbm, reg; - const UINT8 *operandarray; + uint8_t opcode, mode, pb, pbm, reg; + const uint8_t *operandarray; unsigned int ea, flags; int numoperands, offset, indirect; @@ -712,12 +712,12 @@ CPU_DISASSEMBLE( hd6309 ) break; case REL: - offset = (INT8)operandarray[0]; + offset = (int8_t)operandarray[0]; buffer += sprintf(buffer, "$%04X", (pc + offset) & 0xffff); break; case LREL: - offset = (INT16)((operandarray[0] << 8) + operandarray[1]); + offset = (int16_t)((operandarray[0] << 8) + operandarray[1]); buffer += sprintf(buffer, "$%04X", (pc + offset) & 0xffff); break; @@ -766,7 +766,7 @@ CPU_DISASSEMBLE( hd6309 ) buffer += sprintf(buffer, ",W"); break; case 0x01: - offset = (INT16)((opram[p+0] << 8) + opram[p+1]); + offset = (int16_t)((opram[p+0] << 8) + opram[p+1]); p += 2; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%04X,W", (offset < 0) ? -offset : offset); @@ -815,14 +815,14 @@ CPU_DISASSEMBLE( hd6309 ) break; case 0x88: // (+/- 7 bit offset),R - offset = (INT8)opram[p++]; + offset = (int8_t)opram[p++]; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%02X,", (offset < 0) ? -offset : offset); buffer += sprintf(buffer, "%s", hd6309_regs[reg]); break; case 0x89: // (+/- 15 bit offset),R - offset = (INT16)((opram[p+0] << 8) + opram[p+1]); + offset = (int16_t)((opram[p+0] << 8) + opram[p+1]); p += 2; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%04X,", (offset < 0) ? -offset : offset); @@ -838,13 +838,13 @@ CPU_DISASSEMBLE( hd6309 ) break; case 0x8c: // (+/- 7 bit offset),PC - offset = (INT8)opram[p++]; + offset = (int8_t)opram[p++]; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%02X,PC", (offset < 0) ? -offset : offset); break; case 0x8d: // (+/- 15 bit offset),PC - offset = (INT16)((opram[p+0] << 8) + opram[p+1]); + offset = (int16_t)((opram[p+0] << 8) + opram[p+1]); p += 2; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%04X,PC", (offset < 0) ? -offset : offset); @@ -857,7 +857,7 @@ CPU_DISASSEMBLE( hd6309 ) case 0x8f: // address or operations relative to W if (indirect) { - ea = (UINT16)((opram[p+0] << 8) + opram[p+1]); + ea = (uint16_t)((opram[p+0] << 8) + opram[p+1]); p += 2; buffer += sprintf(buffer, "$%04X", ea); break; @@ -870,7 +870,7 @@ CPU_DISASSEMBLE( hd6309 ) buffer += sprintf(buffer, ",W"); break; case 0x01: - offset = (INT16)((opram[p+0] << 8) + opram[p+1]); + offset = (int16_t)((opram[p+0] << 8) + opram[p+1]); p += 2; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%04X,W", (offset < 0) ? -offset : offset); diff --git a/src/devices/cpu/m6809/6809dasm.cpp b/src/devices/cpu/m6809/6809dasm.cpp index b2f3f44a7bb..971abc9b2a8 100644 --- a/src/devices/cpu/m6809/6809dasm.cpp +++ b/src/devices/cpu/m6809/6809dasm.cpp @@ -25,10 +25,10 @@ // Opcode structure struct opcodeinfo { - UINT8 opcode; // 8-bit opcode value - UINT8 length; // Opcode length in bytes + uint8_t opcode; // 8-bit opcode value + uint8_t length; // Opcode length in bytes char name[6]; // Opcode name - UINT8 mode; // Addressing mode + uint8_t mode; // Addressing mode unsigned flags; // Disassembly flags }; @@ -368,8 +368,8 @@ static const char *const m6809_regs_te[16] = CPU_DISASSEMBLE( m6809 ) { - UINT8 opcode, mode, pb, pbm, reg; - const UINT8 *operandarray; + uint8_t opcode, mode, pb, pbm, reg; + const uint8_t *operandarray; unsigned int ea, flags; int numoperands, offset, indirect; int i, p = 0, page = 0, opcode_found; @@ -467,12 +467,12 @@ CPU_DISASSEMBLE( m6809 ) break; case REL: - offset = (INT8)operandarray[0]; + offset = (int8_t)operandarray[0]; buffer += sprintf(buffer, "$%04X", (pc + offset) & 0xffff); break; case LREL: - offset = (INT16)((operandarray[0] << 8) + operandarray[1]); + offset = (int16_t)((operandarray[0] << 8) + operandarray[1]); buffer += sprintf(buffer, "$%04X", (pc + offset) & 0xffff); break; @@ -532,14 +532,14 @@ CPU_DISASSEMBLE( m6809 ) break; case 0x88: // (+/- 7 bit offset),R - offset = (INT8)opram[p++]; + offset = (int8_t)opram[p++]; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%02X,", (offset < 0) ? -offset : offset); buffer += sprintf(buffer, "%s", m6809_regs[reg]); break; case 0x89: // (+/- 15 bit offset),R - offset = (INT16)((opram[p+0] << 8) + opram[p+1]); + offset = (int16_t)((opram[p+0] << 8) + opram[p+1]); p += 2; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%04X,", (offset < 0) ? -offset : offset); @@ -555,13 +555,13 @@ CPU_DISASSEMBLE( m6809 ) break; case 0x8c: // (+/- 7 bit offset),PC - offset = (INT8)opram[p++]; + offset = (int8_t)opram[p++]; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%02X,PC", (offset < 0) ? -offset : offset); break; case 0x8d: // (+/- 15 bit offset),PC - offset = (INT16)((opram[p+0] << 8) + opram[p+1]); + offset = (int16_t)((opram[p+0] << 8) + opram[p+1]); p += 2; buffer += sprintf(buffer, "%s", (offset < 0) ? "-" : ""); buffer += sprintf(buffer, "$%04X,PC", (offset < 0) ? -offset : offset); @@ -572,7 +572,7 @@ CPU_DISASSEMBLE( m6809 ) break; case 0x8f: // address - ea = (UINT16)((opram[p+0] << 8) + opram[p+1]); + ea = (uint16_t)((opram[p+0] << 8) + opram[p+1]); p += 2; buffer += sprintf(buffer, "$%04X", ea); break; diff --git a/src/devices/cpu/m6809/base6x09.ops b/src/devices/cpu/m6809/base6x09.ops index c9fccad7d38..8a36ecf2b78 100644 --- a/src/devices/cpu/m6809/base6x09.ops +++ b/src/devices/cpu/m6809/base6x09.ops @@ -50,7 +50,7 @@ INTERRUPT_VECTOR: NEG8: @m_temp.b.l = read_operand(); - m_temp.b.l = set_flags(CC_NZVC, (UINT8)0, m_temp.b.l, -m_temp.b.l); + m_temp.b.l = set_flags(CC_NZVC, (uint8_t)0, m_temp.b.l, -m_temp.b.l); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(m_temp.b.l); return; @@ -59,7 +59,7 @@ COM8: @m_temp.b.l = read_operand(); m_cc &= ~CC_V; m_cc |= CC_C; - m_temp.b.l = set_flags(CC_NZ, (UINT8) ~m_temp.b.l); + m_temp.b.l = set_flags(CC_NZ, (uint8_t) ~m_temp.b.l); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(m_temp.b.l); return; @@ -68,14 +68,14 @@ LSR8: @m_temp.b.l = read_operand(); m_cc &= ~CC_C; m_cc |= (m_temp.b.l & 1) ? CC_C : 0; - m_temp.b.l = set_flags(CC_NZ, m_temp.b.l >> 1); + m_temp.b.l = set_flags(CC_NZ, m_temp.b.l >> 1); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(m_temp.b.l); return; ROR8: @m_temp.b.l = read_operand(); - m_temp.b.l = set_flags(CC_NZ, rotate_right(m_temp.b.l)); + m_temp.b.l = set_flags(CC_NZ, rotate_right(m_temp.b.l)); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(m_temp.b.l); return; @@ -84,35 +84,35 @@ ASR8: @m_temp.b.l = read_operand(); m_cc &= ~CC_NZC; m_cc |= (m_temp.b.l & 1) ? CC_C : 0; - m_temp.b.l = set_flags(CC_NZ, ((INT8) m_temp.b.l) >> 1); + m_temp.b.l = set_flags(CC_NZ, ((int8_t) m_temp.b.l) >> 1); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(m_temp.b.l); return; ASL8: @m_temp.b.l = read_operand(); - m_temp.b.l = set_flags(CC_NZVC, m_temp.b.l, m_temp.b.l, m_temp.b.l << 1); + m_temp.b.l = set_flags(CC_NZVC, m_temp.b.l, m_temp.b.l, m_temp.b.l << 1); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(m_temp.b.l); return; ROL8: @m_temp.b.l = read_operand(); - m_temp.b.l = set_flags(CC_NZV, m_temp.b.l, m_temp.b.l, rotate_left(m_temp.b.l)); + m_temp.b.l = set_flags(CC_NZV, m_temp.b.l, m_temp.b.l, rotate_left(m_temp.b.l)); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(m_temp.b.l); return; DEC8: @m_temp.b.l = read_operand(); - m_temp.b.l = set_flags(CC_NZV, m_temp.b.l, 1, m_temp.b.l - 1); + m_temp.b.l = set_flags(CC_NZV, m_temp.b.l, 1, m_temp.b.l - 1); @eat(hd6309_native_mode() && is_register_addressing_mode() ? 0 : 1); @write_operand(m_temp.b.l); return; INC8: @m_temp.b.l = read_operand(); - m_temp.b.l = set_flags(CC_NZV, m_temp.b.l, 1, m_temp.b.l + 1); + m_temp.b.l = set_flags(CC_NZV, m_temp.b.l, 1, m_temp.b.l + 1); @eat(hd6309_native_mode() && is_register_addressing_mode() ? 0 : 1); @write_operand(m_temp.b.l); return; @@ -139,7 +139,7 @@ CLR8: NEG16: m_temp.b.h = read_operand(0); m_temp.b.l = read_operand(1); - m_temp.w = set_flags(CC_NZVC, (UINT16)0, m_temp.w, -m_temp.w); + m_temp.w = set_flags(CC_NZVC, (uint16_t)0, m_temp.w, -m_temp.w); eat(hd6309_native_mode() ? 0 : 1); write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); @@ -150,7 +150,7 @@ LSR16: @m_temp.b.l = read_operand(1); m_cc &= ~CC_C; m_cc |= (m_temp.w & 1) ? CC_C : 0; - m_temp.w = set_flags(CC_NZ, m_temp.w >> 1); + m_temp.w = set_flags(CC_NZ, m_temp.w >> 1); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); @@ -159,7 +159,7 @@ LSR16: ROR16: @m_temp.b.h = read_operand(0); @m_temp.b.l = read_operand(1); - m_temp.w = set_flags(CC_NZ, rotate_right(m_temp.w)); + m_temp.w = set_flags(CC_NZ, rotate_right(m_temp.w)); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); @@ -170,7 +170,7 @@ ASR16: @m_temp.b.l = read_operand(1); m_cc &= ~CC_NZC; m_cc |= (m_temp.w & 1) ? CC_C : 0; - m_temp.w = set_flags(CC_NZ, ((INT16) m_temp.w) >> 1); + m_temp.w = set_flags(CC_NZ, ((int16_t) m_temp.w) >> 1); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); @@ -179,7 +179,7 @@ ASR16: ASL16: @m_temp.b.h = read_operand(0); @m_temp.b.l = read_operand(1); - m_temp.w = set_flags(CC_NZVC, m_temp.w, m_temp.w, m_temp.w << 1); + m_temp.w = set_flags(CC_NZVC, m_temp.w, m_temp.w, m_temp.w << 1); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); @@ -188,7 +188,7 @@ ASL16: ROL16: @m_temp.b.h = read_operand(0); @m_temp.b.l = read_operand(1); - m_temp.w = set_flags(CC_NZV, rotate_left(m_temp.w)); + m_temp.w = set_flags(CC_NZV, rotate_left(m_temp.w)); @eat(hd6309_native_mode() ? 0 : 1); @write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); @@ -197,7 +197,7 @@ ROL16: DEC16: m_temp.b.h = read_operand(0); m_temp.b.l = read_operand(1); - m_temp.w = set_flags(CC_NZVC, m_temp.w, 1, m_temp.w - 1); + m_temp.w = set_flags(CC_NZVC, m_temp.w, 1, m_temp.w - 1); eat(hd6309_native_mode() ? 0 : 1); write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); @@ -206,7 +206,7 @@ DEC16: INC16: m_temp.b.h = read_operand(0); m_temp.b.l = read_operand(1); - m_temp.w = set_flags(CC_NZVC, m_temp.w, 1, m_temp.w + 1); + m_temp.w = set_flags(CC_NZVC, m_temp.w, 1, m_temp.w + 1); eat(hd6309_native_mode() ? 0 : 1); write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); @@ -239,33 +239,33 @@ CMP8: return; SBC8: - m_temp.w = (UINT16)read_operand() + (m_cc & CC_C ? 1 : 0); + m_temp.w = (uint16_t)read_operand() + (m_cc & CC_C ? 1 : 0); regop8() = set_flags(CC_NZVC, regop8(), m_temp.b.l, regop8() - m_temp.w); return; AND8: m_cc &= ~CC_V; - regop8() = set_flags(CC_NZ, (UINT8)0, regop8(), regop8() & read_operand()); + regop8() = set_flags(CC_NZ, (uint8_t)0, regop8(), regop8() & read_operand()); return; BIT8: m_cc &= ~CC_V; - set_flags(CC_NZ, (UINT8)0, regop8(), regop8() & read_operand()); + set_flags(CC_NZ, (uint8_t)0, regop8(), regop8() & read_operand()); return; EOR8: m_cc &= ~CC_V; - regop8() = set_flags(CC_NZ, (UINT8)0, regop8(), regop8() ^ read_operand()); + regop8() = set_flags(CC_NZ, (uint8_t)0, regop8(), regop8() ^ read_operand()); return; ADC8: - m_temp.w = (UINT16)read_operand() + (m_cc & CC_C ? 1 : 0); + m_temp.w = (uint16_t)read_operand() + (m_cc & CC_C ? 1 : 0); regop8() = set_flags(add8_sets_h() ? CC_HNZVC : CC_NZVC, regop8(), m_temp.b.l, regop8() + m_temp.w); return; OR8: m_cc &= ~CC_V; - regop8() = set_flags(CC_NZ, (UINT8)0, regop8(), regop8() | read_operand()); + regop8() = set_flags(CC_NZ, (uint8_t)0, regop8(), regop8() | read_operand()); return; ADD8: @@ -356,7 +356,7 @@ ANDCC: return; SEX: - m_q.r.d = set_flags(CC_NZ, (INT8) m_q.r.b); + m_q.r.d = set_flags(CC_NZ, (int8_t) m_q.r.b); eat(hd6309_native_mode() ? 0 : 1); return; @@ -365,7 +365,7 @@ BRANCH: eat(1); if (branch_taken()) { - m_pc.w += (INT8) m_temp.b.l; + m_pc.w += (int8_t) m_temp.b.l; } return; @@ -382,14 +382,14 @@ LBRANCH: BSR: @m_temp.b.l = read_opcode_arg(); - m_ea.w = m_pc.w + (INT8) m_temp.b.l; + m_ea.w = m_pc.w + (int8_t) m_temp.b.l; @eat(hd6309_native_mode() ? 2 : 3); goto GOTO_SUBROUTINE; LBSR: @m_temp.b.h = read_opcode_arg(); @m_temp.b.l = read_opcode_arg(); - m_ea.w = m_pc.w + (INT16) m_temp.w; + m_ea.w = m_pc.w + (int16_t) m_temp.w; @eat(hd6309_native_mode() ? 2 : 4); goto GOTO_SUBROUTINE; @@ -528,7 +528,7 @@ SOFTWARE_INTERRUPT: goto INTERRUPT_VECTOR; DIRECT: - @set_ea(((UINT16)m_dp << 8) | read_opcode_arg()); + @set_ea(((uint16_t)m_dp << 8) | read_opcode_arg()); @eat(hd6309_native_mode() ? 0 : 1); return; diff --git a/src/devices/cpu/m6809/hd6309.cpp b/src/devices/cpu/m6809/hd6309.cpp index 213464d90dc..ef9ff98f4f2 100644 --- a/src/devices/cpu/m6809/hd6309.cpp +++ b/src/devices/cpu/m6809/hd6309.cpp @@ -19,9 +19,9 @@ 6809 Microcomputer Programming & Interfacing with Experiments" by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits + System dependencies: uint16_t must be 16 bit unsigned int + uint8_t must be 8 bit unsigned int + uint32_t must be more than 16 bits arrays up to 65536 bytes must be supported machine must be twos complement @@ -131,7 +131,7 @@ const device_type HD6309 = &device_creator; // hd6309_device - constructor //------------------------------------------------- -hd6309_device::hd6309_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +hd6309_device::hd6309_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6809_base_device(mconfig, "HD6309", tag, owner, clock, HD6309, 4, "hd6309", __FILE__), m_md(0), m_temp_im(0) @@ -289,7 +289,7 @@ void hd6309_device::device_post_load() // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 hd6309_device::disasm_min_opcode_bytes() const +uint32_t hd6309_device::disasm_min_opcode_bytes() const { return 1; } @@ -301,7 +301,7 @@ UINT32 hd6309_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 hd6309_device::disasm_max_opcode_bytes() const +uint32_t hd6309_device::disasm_max_opcode_bytes() const { return 5; } @@ -313,7 +313,7 @@ UINT32 hd6309_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t hd6309_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t hd6309_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( hd6309 ); return CPU_DISASSEMBLE_NAME(hd6309)(this, buffer, pc, oprom, opram, options); @@ -325,7 +325,7 @@ offs_t hd6309_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o // read_operand //------------------------------------------------- -inline UINT8 hd6309_device::read_operand() +inline uint8_t hd6309_device::read_operand() { switch(m_addressing_mode) { @@ -344,7 +344,7 @@ inline UINT8 hd6309_device::read_operand() // read_operand //------------------------------------------------- -inline UINT8 hd6309_device::read_operand(int ordinal) +inline uint8_t hd6309_device::read_operand(int ordinal) { switch(m_addressing_mode) { @@ -368,7 +368,7 @@ inline UINT8 hd6309_device::read_operand(int ordinal) // write_operand //------------------------------------------------- -inline void hd6309_device::write_operand(UINT8 data) +inline void hd6309_device::write_operand(uint8_t data) { switch(m_addressing_mode) { @@ -387,7 +387,7 @@ inline void hd6309_device::write_operand(UINT8 data) // write_operand //------------------------------------------------- -inline void hd6309_device::write_operand(int ordinal, UINT8 data) +inline void hd6309_device::write_operand(int ordinal, uint8_t data) { switch(m_addressing_mode) { @@ -410,7 +410,7 @@ inline void hd6309_device::write_operand(int ordinal, UINT8 data) // bittest_register //------------------------------------------------- -inline UINT8 &hd6309_device::bittest_register() +inline uint8_t &hd6309_device::bittest_register() { switch(m_temp_im & 0xC0) { @@ -460,9 +460,9 @@ inline void hd6309_device::bittest_set(bool result) // read_exgtfr_register //------------------------------------------------- -inline m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_register(UINT8 reg) +inline m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_register(uint8_t reg) { - UINT16 value; + uint16_t value; switch(reg & 0x0F) { @@ -474,20 +474,20 @@ inline m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_register(UI case 5: value = m_pc.w; break; // PC case 6: value = m_q.r.w; break; // W case 7: value = m_v.w; break; // V - case 8: value = ((UINT16) m_q.r.a) << 8 | m_q.r.a; break; // A - case 9: value = ((UINT16) m_q.r.b) << 8 | m_q.r.b; break; // B - case 10: value = ((UINT16) m_cc) << 8 | m_cc; break; // CC - case 11: value = ((UINT16) m_dp) << 8 | m_dp; break; // DP + case 8: value = ((uint16_t) m_q.r.a) << 8 | m_q.r.a; break; // A + case 9: value = ((uint16_t) m_q.r.b) << 8 | m_q.r.b; break; // B + case 10: value = ((uint16_t) m_cc) << 8 | m_cc; break; // CC + case 11: value = ((uint16_t) m_dp) << 8 | m_dp; break; // DP case 12: value = 0; break; // 0 case 13: value = 0; break; // 0 - case 14: value = ((UINT16) m_q.r.e) << 8 | m_q.r.e; break; // E - case 15: value = ((UINT16) m_q.r.f) << 8 | m_q.r.f; break; // F + case 14: value = ((uint16_t) m_q.r.e) << 8 | m_q.r.e; break; // E + case 15: value = ((uint16_t) m_q.r.f) << 8 | m_q.r.f; break; // F default: fatalerror("Should not reach here"); } exgtfr_register result; - result.byte_value = (UINT8)value; + result.byte_value = (uint8_t)value; result.word_value = value; return result; } @@ -498,7 +498,7 @@ inline m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_register(UI // write_exgtfr_register //------------------------------------------------- -inline void hd6309_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value) +inline void hd6309_device::write_exgtfr_register(uint8_t reg, m6809_base_device::exgtfr_register value) { switch(reg & 0x0F) { @@ -510,14 +510,14 @@ inline void hd6309_device::write_exgtfr_register(UINT8 reg, m6809_base_device::e case 5: m_pc.w = value.word_value; break; // PC case 6: m_q.r.w = value.word_value; break; // W case 7: m_v.w = value.word_value; break; // V - case 8: m_q.r.a = (UINT8) (value.word_value >> 8); break; // A - case 9: m_q.r.b = (UINT8) (value.word_value >> 0); break; // B - case 10: m_cc = (UINT8) (value.word_value >> 0); break; // CC - case 11: m_dp = (UINT8) (value.word_value >> 8); break; // DP + case 8: m_q.r.a = (uint8_t) (value.word_value >> 8); break; // A + case 9: m_q.r.b = (uint8_t) (value.word_value >> 0); break; // B + case 10: m_cc = (uint8_t) (value.word_value >> 0); break; // CC + case 11: m_dp = (uint8_t) (value.word_value >> 8); break; // DP case 12: break; // 0 case 13: break; // 0 - case 14: m_q.r.e = (UINT8) (value.word_value >> 8); break; // E - case 15: m_q.r.f = (UINT8) (value.word_value >> 0); break; // F + case 14: m_q.r.e = (uint8_t) (value.word_value >> 8); break; // E + case 15: m_q.r.f = (uint8_t) (value.word_value >> 0); break; // F default: fatalerror("Should not reach here"); } @@ -529,7 +529,7 @@ inline void hd6309_device::write_exgtfr_register(UINT8 reg, m6809_base_device::e // tfr_read //------------------------------------------------- -inline bool hd6309_device::tfr_read(UINT8 opcode, UINT8 arg, UINT8 &data) +inline bool hd6309_device::tfr_read(uint8_t opcode, uint8_t arg, uint8_t &data) { PAIR16 *reg; @@ -562,7 +562,7 @@ inline bool hd6309_device::tfr_read(UINT8 opcode, UINT8 arg, UINT8 &data) // tfr_write //------------------------------------------------- -inline bool hd6309_device::tfr_write(UINT8 opcode, UINT8 arg, UINT8 data) +inline bool hd6309_device::tfr_write(uint8_t opcode, uint8_t arg, uint8_t data) { PAIR16 *reg; @@ -597,7 +597,7 @@ inline bool hd6309_device::tfr_write(UINT8 opcode, UINT8 arg, UINT8 data) void hd6309_device::register_register_op() { - UINT8 operand = read_opcode_arg(); + uint8_t operand = read_opcode_arg(); // if the 8/16 bit values are mismatched, we need to promote bool promote = ((operand & 0x80) ? true : false) != ((operand & 0x08) ? true : false); @@ -661,9 +661,9 @@ void hd6309_device::register_register_op() void hd6309_device::muld() { - UINT32 result; - result = ((INT16) m_q.r.d) * ((INT16) m_temp.w); - m_q.q = (set_flags(CC_NZ, result)); + uint32_t result; + result = ((int16_t) m_q.r.d) * ((int16_t) m_temp.w); + m_q.q = (set_flags(CC_NZ, result)); m_cc &= ~CC_VC; } @@ -674,21 +674,21 @@ void hd6309_device::muld() bool hd6309_device::divq() { - INT32 result; + int32_t result; // check for divide by zero if (m_temp.w == 0) return false; - INT32 q = m_q.q; - INT32 old_q = q; + int32_t q = m_q.q; + int32_t old_q = q; // do the divide/modulo - result = q / (INT16) m_temp.w; - m_q.r.d = q % (INT16) m_temp.w; + result = q / (int16_t) m_temp.w; + m_q.r.d = q % (int16_t) m_temp.w; // set NZ condition codes - m_q.r.w = set_flags(CC_NZ, result); + m_q.r.w = set_flags(CC_NZ, result); // set C condition code if (m_q.r.w & 0x0001) @@ -732,15 +732,15 @@ bool hd6309_device::divd() if (m_temp.b.l == 0) return false; - INT16 old_d = m_q.r.d; - INT16 result; + int16_t old_d = m_q.r.d; + int16_t result; // do the divide/modulo - result = ((INT16) m_q.r.d) / (INT8) m_temp.b.l; - m_q.r.a = ((INT16) m_q.r.d) % (INT8) m_temp.b.l; + result = ((int16_t) m_q.r.d) / (int8_t) m_temp.b.l; + m_q.r.a = ((int16_t) m_q.r.d) % (int8_t) m_temp.b.l; // set NZ condition codes - m_q.r.b = set_flags(CC_NZ, result); + m_q.r.b = set_flags(CC_NZ, result); // set C condition code if (m_q.r.b & 0x01) @@ -756,7 +756,7 @@ bool hd6309_device::divd() if ((result > 256 ) || (result < -255 )) { // hard overflow - division is aborted - set_flags(CC_NZ, old_d); + set_flags(CC_NZ, old_d); m_q.r.d = abs(old_d); } } diff --git a/src/devices/cpu/m6809/hd6309.h b/src/devices/cpu/m6809/hd6309.h index 762dac4737b..852f03d2d0d 100644 --- a/src/devices/cpu/m6809/hd6309.h +++ b/src/devices/cpu/m6809/hd6309.h @@ -29,7 +29,7 @@ class hd6309_device : public m6809_base_device { public: // construction/destruction - hd6309_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd6309_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -42,9 +42,9 @@ protected: virtual void execute_run() override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual bool is_6809() override { return false; }; @@ -76,23 +76,23 @@ private: // CPU registers PAIR16 m_v; - UINT8 m_md; + uint8_t m_md; // other state - UINT8 m_temp_im; + uint8_t m_temp_im; // operand reading/writing - UINT8 read_operand(); - UINT8 read_operand(int ordinal); - void write_operand(UINT8 data); - void write_operand(int ordinal, UINT8 data); + uint8_t read_operand(); + uint8_t read_operand(int ordinal); + void write_operand(uint8_t data); + void write_operand(int ordinal, uint8_t data); // interrupt registers bool firq_saves_entire_state() { return m_md & 0x02; } - UINT16 entire_state_registers() { return hd6309_native_mode() ? 0x3FF : 0xFF; } + uint16_t entire_state_registers() { return hd6309_native_mode() ? 0x3FF : 0xFF; } // bit tests - UINT8 &bittest_register(); + uint8_t &bittest_register(); bool bittest_source(); bool bittest_dest(); void bittest_set(bool result); @@ -106,10 +106,10 @@ private: void set_e() { m_addressing_mode = ADDRESSING_MODE_REGISTER_E; } void set_f() { m_addressing_mode = ADDRESSING_MODE_REGISTER_F; } void set_w() { m_addressing_mode = ADDRESSING_MODE_REGISTER_W; } - exgtfr_register read_exgtfr_register(UINT8 reg); - void write_exgtfr_register(UINT8 reg, exgtfr_register value); - bool tfr_read(UINT8 opcode, UINT8 arg, UINT8 &data); - bool tfr_write(UINT8 opcode, UINT8 arg, UINT8 data); + exgtfr_register read_exgtfr_register(uint8_t reg); + void write_exgtfr_register(uint8_t reg, exgtfr_register value); + bool tfr_read(uint8_t opcode, uint8_t arg, uint8_t &data); + bool tfr_write(uint8_t opcode, uint8_t arg, uint8_t data); bool add8_sets_h() { return (m_opcode & 0xFE) != 0x30; } void register_register_op(); bool hd6309_native_mode() { return m_md & 0x01; } diff --git a/src/devices/cpu/m6809/hd6309.ops b/src/devices/cpu/m6809/hd6309.ops index db04e99d981..9752460175b 100644 --- a/src/devices/cpu/m6809/hd6309.ops +++ b/src/devices/cpu/m6809/hd6309.ops @@ -673,19 +673,19 @@ INDEXED: case 0x05: case 0x25: case 0x45: case 0x65: case 0x15: case 0x35: case 0x55: case 0x75: - m_temp.w = ireg() + (INT8) m_q.r.b; + m_temp.w = ireg() + (int8_t) m_q.r.b; eat(2); break; case 0x06: case 0x26: case 0x46: case 0x66: case 0x16: case 0x36: case 0x56: case 0x76: - m_temp.w = ireg() + (INT8) m_q.r.a; + m_temp.w = ireg() + (int8_t) m_q.r.a; eat(2); break; case 0x08: case 0x28: case 0x48: case 0x68: case 0x18: case 0x38: case 0x58: case 0x78: - @m_temp.w = ireg() + (INT8) read_opcode_arg(); + @m_temp.w = ireg() + (int8_t) read_opcode_arg(); eat(1); break; @@ -706,7 +706,7 @@ INDEXED: case 0x0C: case 0x2C: case 0x4C: case 0x6C: case 0x1C: case 0x3C: case 0x5C: case 0x7C: @m_temp.b.l = read_opcode_arg(); - m_temp.w = m_pc.w + (INT8) m_temp.b.l; + m_temp.w = m_pc.w + (int8_t) m_temp.b.l; eat(1); break; @@ -714,7 +714,7 @@ INDEXED: case 0x1D: case 0x3D: case 0x5D: case 0x7D: @m_temp.b.h = read_opcode_arg(); @m_temp.b.l = read_opcode_arg(); - m_temp.w = m_pc.w + (INT16) m_temp.w; + m_temp.w = m_pc.w + (int16_t) m_temp.w; eat((hd6309_native_mode() && !(m_opcode & 0x10)) ? 2 : 4); break; @@ -727,14 +727,14 @@ INDEXED: case 0x07: case 0x27: case 0x47: case 0x67: case 0x17: case 0x37: case 0x57: case 0x77: // 6309 specific mode - m_temp.w = ireg() + (INT8) m_q.r.e; + m_temp.w = ireg() + (int8_t) m_q.r.e; eat(2); break; case 0x0A: case 0x2A: case 0x4A: case 0x6A: case 0x1A: case 0x3A: case 0x5A: case 0x7A: // 6309 specific mode - m_temp.w = ireg() + (INT8) m_q.r.f; + m_temp.w = ireg() + (int8_t) m_q.r.f; eat(2); break; @@ -789,7 +789,7 @@ INDEXED: else { // 5-bit offset - m_temp.w = ireg() + (INT8) ((m_opcode & 0x0F) | (m_opcode & 0x10 ? 0xF0 : 0x00)); + m_temp.w = ireg() + (int8_t) ((m_opcode & 0x0F) | (m_opcode & 0x10 ? 0xF0 : 0x00)); eat(2); } @set_ea(m_temp.w); @@ -797,7 +797,7 @@ INDEXED: EXG: { - UINT8 param = read_opcode_arg(); + uint8_t param = read_opcode_arg(); exgtfr_register reg1 = read_exgtfr_register(param >> 4); exgtfr_register reg2 = read_exgtfr_register(param >> 0); write_exgtfr_register(param >> 4, reg2); @@ -808,7 +808,7 @@ EXG: TFR: { - UINT8 param = read_opcode_arg(); + uint8_t param = read_opcode_arg(); exgtfr_register reg = read_exgtfr_register(param >> 4); write_exgtfr_register(param >> 0, reg); } @@ -839,7 +839,7 @@ LDQ: @m_q.r.b = read_operand(1); @m_q.r.e = read_operand(2); @m_q.r.f = read_operand(3); - set_flags(CC_NZV, m_q.q); + set_flags(CC_NZV, m_q.q); return; STQ: @@ -847,13 +847,13 @@ STQ: @write_operand(1, m_q.r.b); @write_operand(2, m_q.r.e); @write_operand(3, m_q.r.f); - set_flags(CC_NZV, m_q.q); + set_flags(CC_NZV, m_q.q); return; OIM: @m_temp.b.l = read_operand(); m_cc &= ~CC_V; - m_temp.b.l = set_flags(CC_NZ, (UINT8)0, m_temp.b.l, m_temp.b.l | m_temp_im); + m_temp.b.l = set_flags(CC_NZ, (uint8_t)0, m_temp.b.l, m_temp.b.l | m_temp_im); @eat(1); // this is just a guess @write_operand(m_temp.b.l); return; @@ -861,7 +861,7 @@ OIM: AIM: @m_temp.b.l = read_operand(); m_cc &= ~CC_V; - m_temp.b.l = set_flags(CC_NZ, (UINT8)0, m_temp.b.l, m_temp.b.l & m_temp_im); + m_temp.b.l = set_flags(CC_NZ, (uint8_t)0, m_temp.b.l, m_temp.b.l & m_temp_im); @eat(1); // this is just a guess @write_operand(m_temp.b.l); return; @@ -869,7 +869,7 @@ AIM: EIM: @m_temp.b.l = read_operand(); m_cc &= ~CC_V; - m_temp.b.l = set_flags(CC_NZ, (UINT8)0, m_temp.b.l, m_temp.b.l ^ m_temp_im); + m_temp.b.l = set_flags(CC_NZ, (uint8_t)0, m_temp.b.l, m_temp.b.l ^ m_temp_im); @eat(1); // this is just a guess @write_operand(m_temp.b.l); return; @@ -877,7 +877,7 @@ EIM: TIM: @m_temp.b.l = read_operand(); m_cc &= ~CC_V; - m_temp.b.l = set_flags(CC_NZ, (UINT8)0, m_temp.b.l, m_temp.b.l & m_temp_im); + m_temp.b.l = set_flags(CC_NZ, (uint8_t)0, m_temp.b.l, m_temp.b.l & m_temp_im); @eat(2); // this is just a guess return; @@ -926,7 +926,7 @@ COM16: m_temp.b.l = read_operand(1); m_cc &= ~CC_V; m_cc |= CC_C; - m_temp.w = set_flags(CC_NZ, (UINT16) ~m_temp.w); + m_temp.w = set_flags(CC_NZ, (uint16_t) ~m_temp.w); eat(hd6309_native_mode() ? 0 : 1); write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); @@ -950,28 +950,28 @@ AND16: @m_temp.b.h = read_operand(0); @m_temp.b.l = read_operand(1); m_cc &= ~CC_V; - regop16().w = set_flags(CC_NZ, (UINT16)0, regop16().w, regop16().w & m_temp.w); + regop16().w = set_flags(CC_NZ, (uint16_t)0, regop16().w, regop16().w & m_temp.w); return; BIT16: @m_temp.b.h = read_operand(0); @m_temp.b.l = read_operand(1); m_cc &= ~CC_V; - set_flags(CC_NZ, (UINT16)0, regop16().w, regop16().w & m_temp.w); + set_flags(CC_NZ, (uint16_t)0, regop16().w, regop16().w & m_temp.w); return; OR16: @m_temp.b.h = read_operand(0); @m_temp.b.l = read_operand(1); m_cc &= ~CC_V; - regop16().w = set_flags(CC_NZ, (UINT16)0, regop16().w, regop16().w | m_temp.w); + regop16().w = set_flags(CC_NZ, (uint16_t)0, regop16().w, regop16().w | m_temp.w); return; EOR16: @m_temp.b.h = read_operand(0); @m_temp.b.l = read_operand(1); m_cc &= ~CC_V; - regop16().w = set_flags(CC_NZ, (UINT16)0, regop16().w, regop16().w ^ m_temp.w); + regop16().w = set_flags(CC_NZ, (uint16_t)0, regop16().w, regop16().w ^ m_temp.w); return; PSHSW: @@ -1079,7 +1079,7 @@ DIVD: return; SEXW: - m_q.r.d = set_flags(CC_N, (m_q.r.w & 0x8000) ? 0xFFFF : 0x0000); + m_q.r.d = set_flags(CC_N, (m_q.r.w & 0x8000) ? 0xFFFF : 0x0000); if ((m_q.r.d == 0x0000) && (m_q.r.w == 0x0000)) m_cc |= CC_Z; else diff --git a/src/devices/cpu/m6809/konami.cpp b/src/devices/cpu/m6809/konami.cpp index f8db9587678..8762d358635 100644 --- a/src/devices/cpu/m6809/konami.cpp +++ b/src/devices/cpu/m6809/konami.cpp @@ -18,9 +18,9 @@ 6809 Microcomputer Programming & Interfacing with Experiments" by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits + System dependencies: uint16_t must be 16 bit unsigned int + uint8_t must be 8 bit unsigned int + uint32_t must be more than 16 bits arrays up to 65536 bytes must be supported machine must be twos complement @@ -84,7 +84,7 @@ const device_type KONAMI = &device_creator; // konami_cpu_device - constructor //------------------------------------------------- -konami_cpu_device::konami_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +konami_cpu_device::konami_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6809_base_device(mconfig, "KONAMI CPU", tag, owner, clock, KONAMI, 1, "konami_cpu", __FILE__), m_set_lines(*this) { @@ -109,7 +109,7 @@ void konami_cpu_device::device_start() // helper function //------------------------------------------------- -offs_t konami_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t konami_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( konami ); return CPU_DISASSEMBLE_NAME(konami)(this, buffer, pc, oprom, opram, options); @@ -120,7 +120,7 @@ offs_t konami_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT // read_operand //------------------------------------------------- -inline UINT8 konami_cpu_device::read_operand() +inline uint8_t konami_cpu_device::read_operand() { return super::read_operand(); } @@ -130,7 +130,7 @@ inline UINT8 konami_cpu_device::read_operand() // read_operand //------------------------------------------------- -inline UINT8 konami_cpu_device::read_operand(int ordinal) +inline uint8_t konami_cpu_device::read_operand(int ordinal) { switch(m_addressing_mode) { @@ -146,7 +146,7 @@ inline UINT8 konami_cpu_device::read_operand(int ordinal) // write_operand //------------------------------------------------- -inline void konami_cpu_device::write_operand(UINT8 data) +inline void konami_cpu_device::write_operand(uint8_t data) { super::write_operand(data); } @@ -157,7 +157,7 @@ inline void konami_cpu_device::write_operand(UINT8 data) // write_operand //------------------------------------------------- -inline void konami_cpu_device::write_operand(int ordinal, UINT8 data) +inline void konami_cpu_device::write_operand(int ordinal, uint8_t data) { switch(m_addressing_mode) { @@ -173,7 +173,7 @@ inline void konami_cpu_device::write_operand(int ordinal, UINT8 data) // ireg //------------------------------------------------- -inline UINT16 &konami_cpu_device::ireg() +inline uint16_t &konami_cpu_device::ireg() { switch(m_opcode & 0x70) { @@ -194,7 +194,7 @@ inline UINT16 &konami_cpu_device::ireg() // read_exgtfr_register //------------------------------------------------- -inline m6809_base_device::exgtfr_register konami_cpu_device::read_exgtfr_register(UINT8 reg) +inline m6809_base_device::exgtfr_register konami_cpu_device::read_exgtfr_register(uint8_t reg) { exgtfr_register result; result.word_value = 0x00FF; @@ -208,7 +208,7 @@ inline m6809_base_device::exgtfr_register konami_cpu_device::read_exgtfr_registe case 4: result.word_value = m_s.w; break; // S case 5: result.word_value = m_u.w; break; // U } - result.byte_value = (UINT8) result.word_value; + result.byte_value = (uint8_t) result.word_value; return result; } @@ -217,7 +217,7 @@ inline m6809_base_device::exgtfr_register konami_cpu_device::read_exgtfr_registe // write_exgtfr_register //------------------------------------------------- -inline void konami_cpu_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value) +inline void konami_cpu_device::write_exgtfr_register(uint8_t reg, m6809_base_device::exgtfr_register value) { switch(reg & 0x07) { @@ -235,7 +235,7 @@ inline void konami_cpu_device::write_exgtfr_register(UINT8 reg, m6809_base_devic // safe_shift_right //------------------------------------------------- -template T konami_cpu_device::safe_shift_right(T value, UINT32 shift) +template T konami_cpu_device::safe_shift_right(T value, uint32_t shift) { T result; @@ -254,7 +254,7 @@ template T konami_cpu_device::safe_shift_right(T value, UINT32 shift) // safe_shift_right_unsigned //------------------------------------------------- -template T konami_cpu_device::safe_shift_right_unsigned(T value, UINT32 shift) +template T konami_cpu_device::safe_shift_right_unsigned(T value, uint32_t shift) { T result; @@ -270,7 +270,7 @@ template T konami_cpu_device::safe_shift_right_unsigned(T value, UINT32 // safe_shift_left //------------------------------------------------- -template T konami_cpu_device::safe_shift_left(T value, UINT32 shift) +template T konami_cpu_device::safe_shift_left(T value, uint32_t shift) { T result; @@ -292,14 +292,14 @@ inline void konami_cpu_device::lmul() PAIR result; // do the multiply - result.d = (UINT32)m_x.w * m_y.w; + result.d = (uint32_t)m_x.w * m_y.w; // set the result registers m_x.w = result.w.h; m_y.w = result.w.l; // set Z flag - set_flags(CC_Z, result.d); + set_flags(CC_Z, result.d); // set C flag if (result.d & 0x8000) @@ -315,8 +315,8 @@ inline void konami_cpu_device::lmul() inline void konami_cpu_device::divx() { - UINT16 result; - UINT8 remainder; + uint16_t result; + uint8_t remainder; if (m_q.r.b != 0) { @@ -331,7 +331,7 @@ inline void konami_cpu_device::divx() } // set results and Z flag - m_x.w = set_flags(CC_Z, result); + m_x.w = set_flags(CC_Z, result); m_q.r.b = remainder; // set C flag @@ -346,7 +346,7 @@ inline void konami_cpu_device::divx() // set_lines //------------------------------------------------- -void konami_cpu_device::set_lines(UINT8 data) +void konami_cpu_device::set_lines(uint8_t data) { if (!m_set_lines.isnull()) m_set_lines((offs_t)0, data); diff --git a/src/devices/cpu/m6809/konami.h b/src/devices/cpu/m6809/konami.h index 957a4c4d3e5..ca42bbfb666 100644 --- a/src/devices/cpu/m6809/konami.h +++ b/src/devices/cpu/m6809/konami.h @@ -33,7 +33,7 @@ class konami_cpu_device : public m6809_base_device { public: // construction/destruction - konami_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + konami_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration template static devcb_base &set_line_callback(device_t &device, _Object object) { return downcast(device).m_set_lines.set_callback(object); } @@ -46,7 +46,7 @@ protected: virtual void execute_run() override; // device_disasm_interface overrides - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: typedef m6809_base_device super; @@ -55,23 +55,23 @@ private: devcb_write8 m_set_lines; // konami-specific addressing modes - UINT16 &ireg(); - UINT8 read_operand(); - UINT8 read_operand(int ordinal); - void write_operand(UINT8 data); - void write_operand(int ordinal, UINT8 data); - exgtfr_register read_exgtfr_register(UINT8 reg); - void write_exgtfr_register(UINT8 reg, exgtfr_register value); + uint16_t &ireg(); + uint8_t read_operand(); + uint8_t read_operand(int ordinal); + void write_operand(uint8_t data); + void write_operand(int ordinal, uint8_t data); + exgtfr_register read_exgtfr_register(uint8_t reg); + void write_exgtfr_register(uint8_t reg, exgtfr_register value); // instructions void lmul(); void divx(); // miscellaneous - template T safe_shift_right(T value, UINT32 shift); - template T safe_shift_right_unsigned(T value, UINT32 shift); - template T safe_shift_left(T value, UINT32 shift); - void set_lines(UINT8 data); + template T safe_shift_right(T value, uint32_t shift); + template T safe_shift_right_unsigned(T value, uint32_t shift); + template T safe_shift_left(T value, uint32_t shift); + void set_lines(uint8_t data); void execute_one(); }; diff --git a/src/devices/cpu/m6809/konami.ops b/src/devices/cpu/m6809/konami.ops index f5a159621fc..d2df5273c00 100644 --- a/src/devices/cpu/m6809/konami.ops +++ b/src/devices/cpu/m6809/konami.ops @@ -372,7 +372,7 @@ INDEXED: // postbyte offset m_ea.w = ireg(); // need to do this now because ireg() might be PC @m_temp.b.l = read_opcode_arg(); - m_temp.w = m_ea.w + (INT8) m_temp.b.l; + m_temp.w = m_ea.w + (int8_t) m_temp.b.l; eat(1); break; @@ -381,7 +381,7 @@ INDEXED: m_ea.w = ireg(); // need to do this now because ireg() might be PC @m_temp.b.h = read_opcode_arg(); @m_temp.b.l = read_opcode_arg(); - m_temp.w = m_ea.w + (INT16) m_temp.w; + m_temp.w = m_ea.w + (int16_t) m_temp.w; eat(2); break; @@ -397,19 +397,19 @@ INDEXED: case 0xA0: case 0xB0: case 0xD0: case 0xE0: case 0xF0: // relative to register A - m_temp.w = ireg() + (INT8) m_q.r.a; + m_temp.w = ireg() + (int8_t) m_q.r.a; @eat(1); break; case 0xA1: case 0xB1: case 0xD1: case 0xE1: case 0xF1: // relative to register B - m_temp.w = ireg() + (INT8) m_q.r.b; + m_temp.w = ireg() + (int8_t) m_q.r.b; @eat(1); break; case 0xA7: case 0xB7: case 0xD7: case 0xE7: case 0xF7: // relative to register D - m_temp.w = ireg() + (INT16) m_q.r.d; + m_temp.w = ireg() + (int16_t) m_q.r.d; @eat(4); break; @@ -434,7 +434,7 @@ INDEXED: EXG: { // konami's EXG instruction differs enough from 6809 to fork the code - UINT8 param = read_opcode_arg(); + uint8_t param = read_opcode_arg(); exgtfr_register reg1 = read_exgtfr_register(param >> 0); exgtfr_register reg2 = read_exgtfr_register(param >> 4); write_exgtfr_register(param >> 0, reg2); @@ -446,7 +446,7 @@ EXG: TFR: { // konami's TFR instruction differs enough from 6809 to fork the code - UINT8 param = read_opcode_arg(); + uint8_t param = read_opcode_arg(); exgtfr_register reg = read_exgtfr_register(param >> 0); write_exgtfr_register(param >> 4, reg); } @@ -499,14 +499,14 @@ BSET2: DECXJNZ: // not sure if this affects V? - m_x.w = set_flags(CC_NZV, m_x.w, 1, m_x.w - 1); + m_x.w = set_flags(CC_NZV, m_x.w, 1, m_x.w - 1); @eat(1); set_cond(cond_ne()); goto BRANCH; DECBJNZ: // not sure if this affects V? - m_q.r.b = set_flags(CC_NZV, m_q.r.b, 1, m_q.r.b - 1); + m_q.r.b = set_flags(CC_NZV, m_q.r.b, 1, m_q.r.b - 1); @eat(1); set_cond(cond_ne()); goto BRANCH; @@ -521,7 +521,7 @@ LSRD: else m_cc &= ~CC_C; - m_q.r.d = set_flags(CC_NZ, safe_shift_right_unsigned(m_q.r.d, m_temp.b.l)); + m_q.r.d = set_flags(CC_NZ, safe_shift_right_unsigned(m_q.r.d, m_temp.b.l)); } eat(1); return; @@ -536,7 +536,7 @@ ASLD: else m_cc &= ~CC_C; - m_q.r.d = set_flags(CC_NZV, safe_shift_left(m_q.r.d, m_temp.b.l)); + m_q.r.d = set_flags(CC_NZV, safe_shift_left(m_q.r.d, m_temp.b.l)); } eat(1); return; @@ -551,7 +551,7 @@ ASRD: else m_cc &= ~CC_C; - m_q.r.d = set_flags(CC_NZ, safe_shift_right(m_q.r.d, m_temp.b.l)); + m_q.r.d = set_flags(CC_NZ, safe_shift_right(m_q.r.d, m_temp.b.l)); } eat(1); return; @@ -561,7 +561,7 @@ ROLD: // doing this as a loop is lame while(m_temp.b.l--) - m_temp.w = set_flags(CC_NZ, rotate_left(m_temp.w)); + m_temp.w = set_flags(CC_NZ, rotate_left(m_temp.w)); eat(1); return; @@ -571,14 +571,14 @@ RORD: // doing this as a loop is lame while(m_temp.b.l--) - m_temp.w = set_flags(CC_NZ, rotate_right(m_temp.w)); + m_temp.w = set_flags(CC_NZ, rotate_right(m_temp.w)); eat(1); return; ABS8: @m_temp.b.l = read_operand(); - m_temp.b.l = set_flags(CC_NZVC, 0, m_temp.b.l, ((INT8) m_temp.b.l) >= 0 ? m_temp.b.l : -m_temp.b.l); + m_temp.b.l = set_flags(CC_NZVC, 0, m_temp.b.l, ((int8_t) m_temp.b.l) >= 0 ? m_temp.b.l : -m_temp.b.l); @eat(1); write_operand(m_temp.b.l); return; @@ -586,7 +586,7 @@ ABS8: ABS16: @m_temp.b.h = read_operand(0); @m_temp.b.l = read_operand(1); - m_temp.w = set_flags(CC_NZVC, 0, m_temp.w, ((INT16) m_temp.w) >= 0 ? m_temp.w : -m_temp.w); + m_temp.w = set_flags(CC_NZVC, 0, m_temp.w, ((int16_t) m_temp.w) >= 0 ? m_temp.w : -m_temp.w); @eat(1); @write_operand(0, m_temp.b.h); write_operand(1, m_temp.b.l); diff --git a/src/devices/cpu/m6809/m6809.cpp b/src/devices/cpu/m6809/m6809.cpp index 693480cd940..db0cbee9a3c 100644 --- a/src/devices/cpu/m6809/m6809.cpp +++ b/src/devices/cpu/m6809/m6809.cpp @@ -14,9 +14,9 @@ 6809 Microcomputer Programming & Interfacing with Experiments" by Andrew C. Staugaard, Jr.; Howard W. Sams & Co., Inc. - System dependencies: UINT16 must be 16 bit unsigned int - UINT8 must be 8 bit unsigned int - UINT32 must be more than 16 bits + System dependencies: uint16_t must be 16 bit unsigned int + uint8_t must be 8 bit unsigned int + uint32_t must be more than 16 bits arrays up to 65536 bytes must be supported machine must be twos complement @@ -111,7 +111,7 @@ const device_type M6809E = &device_creator; // m6809_base_device - constructor //------------------------------------------------- -m6809_base_device::m6809_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, const device_type type, int divider, const char *shortname, const char *source) +m6809_base_device::m6809_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, const device_type type, int divider, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_lic_func(*this), m_program_config("program", ENDIANNESS_BIG, 8, 16), @@ -351,7 +351,7 @@ void m6809_base_device::state_string_export(const device_state_entry &entry, std // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 m6809_base_device::disasm_min_opcode_bytes() const +uint32_t m6809_base_device::disasm_min_opcode_bytes() const { return 1; } @@ -362,7 +362,7 @@ UINT32 m6809_base_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 m6809_base_device::disasm_max_opcode_bytes() const +uint32_t m6809_base_device::disasm_max_opcode_bytes() const { return 5; } @@ -373,7 +373,7 @@ UINT32 m6809_base_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t m6809_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m6809_base_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( m6809 ); return CPU_DISASSEMBLE_NAME(m6809)(this, buffer, pc, oprom, opram, options); @@ -389,7 +389,7 @@ offs_t m6809_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT // clock into cycles per second //------------------------------------------------- -UINT64 m6809_base_device::execute_clocks_to_cycles(UINT64 clocks) const +uint64_t m6809_base_device::execute_clocks_to_cycles(uint64_t clocks) const { return (clocks + m_clock_divider - 1) / m_clock_divider; } @@ -400,7 +400,7 @@ UINT64 m6809_base_device::execute_clocks_to_cycles(UINT64 clocks) const // count back to raw clocks //------------------------------------------------- -UINT64 m6809_base_device::execute_cycles_to_clocks(UINT64 cycles) const +uint64_t m6809_base_device::execute_cycles_to_clocks(uint64_t cycles) const { return cycles * m_clock_divider; } @@ -411,7 +411,7 @@ UINT64 m6809_base_device::execute_cycles_to_clocks(UINT64 cycles) const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 m6809_base_device::execute_min_cycles() const +uint32_t m6809_base_device::execute_min_cycles() const { return 1; } @@ -422,7 +422,7 @@ UINT32 m6809_base_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 m6809_base_device::execute_max_cycles() const +uint32_t m6809_base_device::execute_max_cycles() const { return 19; } @@ -433,7 +433,7 @@ UINT32 m6809_base_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 m6809_base_device::execute_input_lines() const +uint32_t m6809_base_device::execute_input_lines() const { return 3; } @@ -490,7 +490,7 @@ const char *m6809_base_device::inputnum_string(int inputnum) // read_exgtfr_register //------------------------------------------------- -m6809_base_device::exgtfr_register m6809_base_device::read_exgtfr_register(UINT8 reg) +m6809_base_device::exgtfr_register m6809_base_device::read_exgtfr_register(uint8_t reg) { exgtfr_register result; result.byte_value = 0xFF; @@ -517,7 +517,7 @@ m6809_base_device::exgtfr_register m6809_base_device::read_exgtfr_register(UINT8 // write_exgtfr_register //------------------------------------------------- -void m6809_base_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value) +void m6809_base_device::write_exgtfr_register(uint8_t reg, m6809_base_device::exgtfr_register value) { switch(reg & 0x0F) { @@ -573,23 +573,23 @@ void m6809_base_device::execute_run() } -UINT8 m6809_base_device::mi_default::read(UINT16 adr) +uint8_t m6809_base_device::mi_default::read(uint16_t adr) { return m_program->read_byte(adr); } -UINT8 m6809_base_device::mi_default::read_opcode(UINT16 adr) +uint8_t m6809_base_device::mi_default::read_opcode(uint16_t adr) { return m_sdirect->read_byte(adr); } -UINT8 m6809_base_device::mi_default::read_opcode_arg(UINT16 adr) +uint8_t m6809_base_device::mi_default::read_opcode_arg(uint16_t adr) { return m_direct->read_byte(adr); } -void m6809_base_device::mi_default::write(UINT16 adr, UINT8 val) +void m6809_base_device::mi_default::write(uint16_t adr, uint8_t val) { m_program->write_byte(adr, val); } @@ -600,7 +600,7 @@ void m6809_base_device::mi_default::write(UINT16 adr, UINT8 val) // m6809_device //------------------------------------------------- -m6809_device::m6809_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m6809_device::m6809_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6809_base_device(mconfig, "M6809", tag, owner, clock, M6809, 1, "m6809", __FILE__) { } @@ -611,7 +611,7 @@ m6809_device::m6809_device(const machine_config &mconfig, const char *tag, devic // m6809e_device //------------------------------------------------- -m6809e_device::m6809e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m6809e_device::m6809e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6809_base_device(mconfig, "M6809E", tag, owner, clock, M6809E, 4, "m6809e", __FILE__) { } diff --git a/src/devices/cpu/m6809/m6809.h b/src/devices/cpu/m6809/m6809.h index d2124afc277..b9b6c365f35 100644 --- a/src/devices/cpu/m6809/m6809.h +++ b/src/devices/cpu/m6809/m6809.h @@ -32,7 +32,7 @@ class m6809_base_device : public cpu_device { public: // construction/destruction - m6809_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock, const device_type type, int divider, const char *shortname, const char *source); + m6809_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, uint32_t clock, const device_type type, int divider, const char *shortname, const char *source); protected: class memory_interface { @@ -41,19 +41,19 @@ protected: direct_read_data *m_direct, *m_sdirect; virtual ~memory_interface() {} - virtual UINT8 read(UINT16 adr) = 0; - virtual UINT8 read_opcode(UINT16 adr) = 0; - virtual UINT8 read_opcode_arg(UINT16 adr) = 0; - virtual void write(UINT16 adr, UINT8 val) = 0; + virtual uint8_t read(uint16_t adr) = 0; + virtual uint8_t read_opcode(uint16_t adr) = 0; + virtual uint8_t read_opcode_arg(uint16_t adr) = 0; + virtual void write(uint16_t adr, uint8_t val) = 0; }; class mi_default : public memory_interface { public: virtual ~mi_default() {} - virtual UINT8 read(UINT16 adr) override; - virtual UINT8 read_opcode(UINT16 adr) override; - virtual UINT8 read_opcode_arg(UINT16 adr) override; - virtual void write(UINT16 adr, UINT8 val) override; + virtual uint8_t read(uint16_t adr) override; + virtual uint8_t read_opcode(uint16_t adr) override; + virtual uint8_t read_opcode_arg(uint16_t adr) override; + virtual void write(uint16_t adr, uint8_t val) override; }; // device-level overrides @@ -63,21 +63,21 @@ protected: virtual void device_post_load() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override; - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override; + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_import(const device_state_entry &entry) override; @@ -98,8 +98,8 @@ protected: // register transfer struct exgtfr_register { - UINT8 byte_value; - UINT16 word_value; + uint8_t byte_value; + uint16_t word_value; }; // flag bits in the cc register @@ -144,19 +144,19 @@ protected: #ifdef LSB_FIRST union { - struct { UINT8 f, e, b, a; }; - struct { UINT16 w, d; }; + struct { uint8_t f, e, b, a; }; + struct { uint16_t w, d; }; } r; struct { PAIR16 w, d; } p; #else union { - struct { UINT8 a, b, e, f; }; - struct { UINT16 d, w; }; + struct { uint8_t a, b, e, f; }; + struct { uint16_t d, w; }; } r; struct { PAIR16 d, w; } p; #endif - UINT32 q; + uint32_t q; }; // Memory interface @@ -168,13 +168,13 @@ protected: M6809Q m_q; // accumulator a and b (plus e and f on 6309) PAIR16 m_x, m_y; // index registers PAIR16 m_u, m_s; // stack pointers - UINT8 m_dp; // direct page register - UINT8 m_cc; + uint8_t m_dp; // direct page register + uint8_t m_cc; PAIR16 m_temp; - UINT8 m_opcode; + uint8_t m_opcode; // other internal state - UINT8 * m_reg8; + uint8_t * m_reg8; PAIR16 * m_reg16; int m_reg; bool m_nmi_line; @@ -194,41 +194,41 @@ protected: void eat_remaining(); // read a byte from given memory location - inline UINT8 read_memory(UINT16 address) { eat(1); return m_mintf->read(address); } + inline uint8_t read_memory(uint16_t address) { eat(1); return m_mintf->read(address); } // write a byte to given memory location - inline void write_memory(UINT16 address, UINT8 data) { eat(1); m_mintf->write(address, data); } + inline void write_memory(uint16_t address, uint8_t data) { eat(1); m_mintf->write(address, data); } // read_opcode() is like read_memory() except it is used for reading opcodes. In the case of a system // with memory mapped I/O, this function can be used to greatly speed up emulation. - inline UINT8 read_opcode(UINT16 address) { eat(1); return m_mintf->read_opcode(address); } + inline uint8_t read_opcode(uint16_t address) { eat(1); return m_mintf->read_opcode(address); } // read_opcode_arg() is identical to read_opcode() except it is used for reading opcode arguments. This // difference can be used to support systems that use different encoding mechanisms for opcodes // and opcode arguments. - inline UINT8 read_opcode_arg(UINT16 address) { eat(1); return m_mintf->read_opcode_arg(address); } + inline uint8_t read_opcode_arg(uint16_t address) { eat(1); return m_mintf->read_opcode_arg(address); } // read_opcode() and bump the program counter - inline UINT8 read_opcode() { return read_opcode(m_pc.w++); } - inline UINT8 read_opcode_arg() { return read_opcode_arg(m_pc.w++); } + inline uint8_t read_opcode() { return read_opcode(m_pc.w++); } + inline uint8_t read_opcode_arg() { return read_opcode_arg(m_pc.w++); } - // state stack - implemented as a UINT32 - void push_state(UINT8 state) { m_state = (m_state << 8) | state; } - UINT8 pop_state() { UINT8 result = (UINT8) m_state; m_state >>= 8; return result; } + // state stack - implemented as a uint32_t + void push_state(uint8_t state) { m_state = (m_state << 8) | state; } + uint8_t pop_state() { uint8_t result = (uint8_t) m_state; m_state >>= 8; return result; } void reset_state() { m_state = 0; } // effective address reading/writing - UINT8 read_ea() { return read_memory(m_ea.w); } - void write_ea(UINT8 data) { write_memory(m_ea.w, data); } - void set_ea(UINT16 ea) { m_ea.w = ea; m_addressing_mode = ADDRESSING_MODE_EA; } - void set_ea_h(UINT8 ea_h) { m_ea.b.h = ea_h; } - void set_ea_l(UINT8 ea_l) { m_ea.b.l = ea_l; m_addressing_mode = ADDRESSING_MODE_EA; } + uint8_t read_ea() { return read_memory(m_ea.w); } + void write_ea(uint8_t data) { write_memory(m_ea.w, data); } + void set_ea(uint16_t ea) { m_ea.w = ea; m_addressing_mode = ADDRESSING_MODE_EA; } + void set_ea_h(uint8_t ea_h) { m_ea.b.h = ea_h; } + void set_ea_l(uint8_t ea_l) { m_ea.b.l = ea_l; m_addressing_mode = ADDRESSING_MODE_EA; } // operand reading/writing - UINT8 read_operand(); - UINT8 read_operand(int ordinal); - void write_operand(UINT8 data); - void write_operand(int ordinal, UINT8 data); + uint8_t read_operand(); + uint8_t read_operand(int ordinal); + void write_operand(uint8_t data); + void write_operand(int ordinal, uint8_t data); // instructions void daa(); @@ -237,25 +237,25 @@ protected: // miscellaneous void nop() { } template T rotate_right(T value); - template UINT32 rotate_left(T value); + template uint32_t rotate_left(T value); void set_a() { m_addressing_mode = ADDRESSING_MODE_REGISTER_A; } void set_b() { m_addressing_mode = ADDRESSING_MODE_REGISTER_B; } void set_d() { m_addressing_mode = ADDRESSING_MODE_REGISTER_D; } void set_imm() { m_addressing_mode = ADDRESSING_MODE_IMMEDIATE; } - void set_regop8(UINT8 ®) { m_reg8 = ® m_reg16 = nullptr; } + void set_regop8(uint8_t ®) { m_reg8 = ® m_reg16 = nullptr; } void set_regop16(PAIR16 ®) { m_reg16 = ® m_reg8 = nullptr; } - UINT8 ®op8() { assert(m_reg8 != nullptr); return *m_reg8; } + uint8_t ®op8() { assert(m_reg8 != nullptr); return *m_reg8; } PAIR16 ®op16() { assert(m_reg16 != nullptr); return *m_reg16; } bool is_register_register_op_16_bit() { return m_reg16 != nullptr; } bool add8_sets_h() { return true; } bool hd6309_native_mode() { return false; } // index reg - UINT16 &ireg(); + uint16_t &ireg(); // flags - template T set_flags(UINT8 mask, T a, T b, UINT32 r); - template T set_flags(UINT8 mask, T r); + template T set_flags(uint8_t mask, T a, T b, uint32_t r); + template T set_flags(uint8_t mask, T r); // branch conditions inline bool cond_hi() { return !(m_cc & CC_ZC); } // BHI/BLS @@ -270,15 +270,15 @@ protected: // interrupt registers bool firq_saves_entire_state() { return false; } - UINT16 partial_state_registers() { return 0x81; } - UINT16 entire_state_registers() { return 0xFF; } + uint16_t partial_state_registers() { return 0x81; } + uint16_t entire_state_registers() { return 0xFF; } // miscellaneous - inline exgtfr_register read_exgtfr_register(UINT8 reg); - inline void write_exgtfr_register(UINT8 reg, exgtfr_register value); + inline exgtfr_register read_exgtfr_register(uint8_t reg); + inline void write_exgtfr_register(uint8_t reg, exgtfr_register value); bool is_register_addressing_mode(); bool is_ea_addressing_mode() { return m_addressing_mode == ADDRESSING_MODE_EA; } - UINT16 get_pending_interrupt(); + uint16_t get_pending_interrupt(); void log_illegal(); private: @@ -287,7 +287,7 @@ private: const address_space_config m_sprogram_config; // other state - UINT32 m_state; + uint32_t m_state; bool m_cond; // incidentals @@ -304,7 +304,7 @@ class m6809_device : public m6809_base_device { public: // construction/destruction - m6809_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m6809_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // ======================> m6809e_device @@ -317,7 +317,7 @@ class m6809e_device : public m6809_base_device { public: // construction/destruction - m6809e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m6809e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_lic_cb(device_t &device, _Object object) { return downcast(device).m_lic_func.set_callback(object); } diff --git a/src/devices/cpu/m6809/m6809.ops b/src/devices/cpu/m6809/m6809.ops index 7c554a3bac9..125be180ce5 100644 --- a/src/devices/cpu/m6809/m6809.ops +++ b/src/devices/cpu/m6809/m6809.ops @@ -479,19 +479,19 @@ INDEXED: case 0x05: case 0x25: case 0x45: case 0x65: case 0x15: case 0x35: case 0x55: case 0x75: - m_temp.w = ireg() + (INT8) m_q.r.b; + m_temp.w = ireg() + (int8_t) m_q.r.b; eat(2); break; case 0x06: case 0x26: case 0x46: case 0x66: case 0x16: case 0x36: case 0x56: case 0x76: - m_temp.w = ireg() + (INT8) m_q.r.a; + m_temp.w = ireg() + (int8_t) m_q.r.a; eat(2); break; case 0x08: case 0x28: case 0x48: case 0x68: case 0x18: case 0x38: case 0x58: case 0x78: - @m_temp.w = ireg() + (INT8) read_opcode_arg(); + @m_temp.w = ireg() + (int8_t) read_opcode_arg(); eat(1); break; @@ -512,7 +512,7 @@ INDEXED: case 0x0C: case 0x2C: case 0x4C: case 0x6C: case 0x1C: case 0x3C: case 0x5C: case 0x7C: @m_temp.b.l = read_opcode_arg(); - m_temp.w = m_pc.w + (INT8) m_temp.b.l; + m_temp.w = m_pc.w + (int8_t) m_temp.b.l; eat(1); break; @@ -520,7 +520,7 @@ INDEXED: case 0x1D: case 0x3D: case 0x5D: case 0x7D: @m_temp.b.h = read_opcode_arg(); @m_temp.b.l = read_opcode_arg(); - m_temp.w = m_pc.w + (INT16) m_temp.w; + m_temp.w = m_pc.w + (int16_t) m_temp.w; eat(4); break; @@ -548,7 +548,7 @@ INDEXED: else { // 5-bit offset - m_temp.w = ireg() + (INT8) ((m_opcode & 0x0F) | (m_opcode & 0x10 ? 0xF0 : 0x00)); + m_temp.w = ireg() + (int8_t) ((m_opcode & 0x0F) | (m_opcode & 0x10 ? 0xF0 : 0x00)); eat(2); } @set_ea(m_temp.w); @@ -556,7 +556,7 @@ INDEXED: EXG: { - UINT8 param = read_opcode_arg(); + uint8_t param = read_opcode_arg(); exgtfr_register reg1 = read_exgtfr_register(param >> 4); exgtfr_register reg2 = read_exgtfr_register(param >> 0); write_exgtfr_register(param >> 4, reg2); @@ -567,7 +567,7 @@ EXG: TFR: { - UINT8 param = read_opcode_arg(); + uint8_t param = read_opcode_arg(); exgtfr_register reg = read_exgtfr_register(param >> 4); write_exgtfr_register(param >> 0, reg); if ((param & 0x0F) == 4) { diff --git a/src/devices/cpu/m6809/m6809inl.h b/src/devices/cpu/m6809/m6809inl.h index 88c282319c2..71bd4f22ec9 100644 --- a/src/devices/cpu/m6809/m6809inl.h +++ b/src/devices/cpu/m6809/m6809inl.h @@ -40,12 +40,12 @@ inline ATTR_FORCE_INLINE T m6809_base_device::rotate_right(T value) //------------------------------------------------- template -inline ATTR_FORCE_INLINE UINT32 m6809_base_device::rotate_left(T value) +inline ATTR_FORCE_INLINE uint32_t m6809_base_device::rotate_left(T value) { T high_bit = ((T) 1) << (sizeof(T) * 8 - 1); bool new_carry = (value & high_bit) ? true : false; - UINT32 new_value = value; + uint32_t new_value = value; new_value <<= 1; if (m_cc & CC_C) @@ -65,7 +65,7 @@ inline ATTR_FORCE_INLINE UINT32 m6809_base_device::rotate_left(T value) // read_operand //------------------------------------------------- -inline ATTR_FORCE_INLINE UINT8 m6809_base_device::read_operand() +inline ATTR_FORCE_INLINE uint8_t m6809_base_device::read_operand() { switch(m_addressing_mode) { @@ -82,7 +82,7 @@ inline ATTR_FORCE_INLINE UINT8 m6809_base_device::read_operand() // read_operand //------------------------------------------------- -inline ATTR_FORCE_INLINE UINT8 m6809_base_device::read_operand(int ordinal) +inline ATTR_FORCE_INLINE uint8_t m6809_base_device::read_operand(int ordinal) { switch(m_addressing_mode) { @@ -97,7 +97,7 @@ inline ATTR_FORCE_INLINE UINT8 m6809_base_device::read_operand(int ordinal) // write_operand //------------------------------------------------- -inline ATTR_FORCE_INLINE void m6809_base_device::write_operand(UINT8 data) +inline ATTR_FORCE_INLINE void m6809_base_device::write_operand(uint8_t data) { switch(m_addressing_mode) { @@ -114,7 +114,7 @@ inline ATTR_FORCE_INLINE void m6809_base_device::write_operand(UINT8 data) // write_operand //------------------------------------------------- -inline ATTR_FORCE_INLINE void m6809_base_device::write_operand(int ordinal, UINT8 data) +inline ATTR_FORCE_INLINE void m6809_base_device::write_operand(int ordinal, uint8_t data) { switch(m_addressing_mode) { @@ -131,9 +131,9 @@ inline ATTR_FORCE_INLINE void m6809_base_device::write_operand(int ordinal, UINT inline ATTR_FORCE_INLINE void m6809_base_device::daa() { - UINT16 t, cf = 0; - UINT8 msn = m_q.r.a & 0xF0; - UINT8 lsn = m_q.r.a & 0x0F; + uint16_t t, cf = 0; + uint8_t msn = m_q.r.a & 0xF0; + uint8_t lsn = m_q.r.a & 0x0F; // compute the carry if (lsn > 0x09 || m_cc & CC_H) cf |= 0x06; @@ -148,7 +148,7 @@ inline ATTR_FORCE_INLINE void m6809_base_device::daa() m_cc |= CC_C; // and put it back into A - m_q.r.a = set_flags(CC_NZ, (UINT8) t); + m_q.r.a = set_flags(CC_NZ, (uint8_t) t); } @@ -159,7 +159,7 @@ inline ATTR_FORCE_INLINE void m6809_base_device::daa() inline ATTR_FORCE_INLINE void m6809_base_device::mul() { // perform multiply - UINT16 result = ((UINT16) m_q.r.a) * ((UINT16) m_q.r.b); + uint16_t result = ((uint16_t) m_q.r.a) * ((uint16_t) m_q.r.b); // set result and Z flag m_q.r.d = set_flags(CC_Z, result); @@ -176,7 +176,7 @@ inline ATTR_FORCE_INLINE void m6809_base_device::mul() // ireg //------------------------------------------------- -inline ATTR_FORCE_INLINE UINT16 &m6809_base_device::ireg() +inline ATTR_FORCE_INLINE uint16_t &m6809_base_device::ireg() { switch(m_opcode & 0x60) { @@ -196,7 +196,7 @@ inline ATTR_FORCE_INLINE UINT16 &m6809_base_device::ireg() //------------------------------------------------- template -inline T m6809_base_device::set_flags(UINT8 mask, T a, T b, UINT32 r) +inline T m6809_base_device::set_flags(uint8_t mask, T a, T b, uint32_t r) { T hi_bit = (T) (1 << (sizeof(T) * 8 - 1)); @@ -220,7 +220,7 @@ inline T m6809_base_device::set_flags(UINT8 mask, T a, T b, UINT32 r) //------------------------------------------------- template -inline T m6809_base_device::set_flags(UINT8 mask, T r) +inline T m6809_base_device::set_flags(uint8_t mask, T r) { return set_flags(mask, (T)0, r, r); } @@ -233,7 +233,7 @@ inline T m6809_base_device::set_flags(UINT8 mask, T r) inline void m6809_base_device::eat_remaining() { // we do this in order to be nice to people debugging - UINT16 real_pc = m_pc.w; + uint16_t real_pc = m_pc.w; eat(m_icount); @@ -260,7 +260,7 @@ inline bool m6809_base_device::is_register_addressing_mode() // get_pending_interrupt //------------------------------------------------- -inline UINT16 m6809_base_device::get_pending_interrupt() +inline uint16_t m6809_base_device::get_pending_interrupt() { if (m_nmi_asserted) return VECTOR_NMI; diff --git a/src/devices/cpu/mb86233/mb86233.cpp b/src/devices/cpu/mb86233/mb86233.cpp index cf4d0ff7da9..f8be4ec3af9 100644 --- a/src/devices/cpu/mb86233/mb86233.cpp +++ b/src/devices/cpu/mb86233/mb86233.cpp @@ -23,7 +23,7 @@ const device_type MB86233 = &device_creator; -mb86233_cpu_device::mb86233_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb86233_cpu_device::mb86233_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, MB86233, "MB86233", tag, owner, clock, "mb86233", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, -2) , m_data_config("data", ENDIANNESS_LITTLE, 32, 32, 0), m_pc(0), m_reps(0), m_pcsp(0), m_eb(0), m_shift(0), m_repcnt(0), m_sr(0), @@ -37,7 +37,7 @@ mb86233_cpu_device::mb86233_cpu_device(const machine_config &mconfig, const char } -offs_t mb86233_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t mb86233_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( mb86233 ); return CPU_DISASSEMBLE_NAME(mb86233)(this, buffer, pc, oprom, opram, options); @@ -105,10 +105,10 @@ void mb86233_cpu_device::device_start() if ( m_tablergn ) { - m_Tables = (UINT32*) machine().root_device().memregion(m_tablergn)->base(); + m_Tables = (uint32_t*) machine().root_device().memregion(m_tablergn)->base(); } - memset( m_RAM, 0, 2 * 0x200 * sizeof(UINT32) ); + memset( m_RAM, 0, 2 * 0x200 * sizeof(uint32_t) ); m_ARAM = &m_RAM[0]; m_BRAM = &m_RAM[0x200]; @@ -205,7 +205,7 @@ void mb86233_cpu_device::FLAGSF( float v ) GETSR() |= SIGN_FLAG; } -void mb86233_cpu_device::FLAGSI( UINT32 v ) +void mb86233_cpu_device::FLAGSI( uint32_t v ) { GETSR() &= ~(ZERO_FLAG|SIGN_FLAG); @@ -222,7 +222,7 @@ void mb86233_cpu_device::FLAGSI( UINT32 v ) Condition Codes ***************************************************************************/ -int mb86233_cpu_device::COND( UINT32 cond ) +int mb86233_cpu_device::COND( uint32_t cond ) { switch( cond ) { @@ -272,7 +272,7 @@ int mb86233_cpu_device::COND( UINT32 cond ) ALU ***************************************************************************/ -void mb86233_cpu_device::ALU( UINT32 alu) +void mb86233_cpu_device::ALU( uint32_t alu) { float ftmp; @@ -369,7 +369,7 @@ void mb86233_cpu_device::ALU( UINT32 alu) //case 0: GETD().i = floor(GETD().f+0.5f); break; //case 1: GETD().i = ceil(GETD().f); break; case 2: GETD().i = floor(GETD().f); break; // Manx TT - case 3: GETD().i = (INT32)GETD().f; break; + case 3: GETD().i = (int32_t)GETD().f; break; default: popmessage("TGP uses D = int(D) with FPU control = %02x, contact MAMEdev",m_fpucontrol>>1); break; } @@ -438,7 +438,7 @@ void mb86233_cpu_device::ALU( UINT32 alu) Memory Access ***************************************************************************/ -UINT32 mb86233_cpu_device::ScaleExp(unsigned int v,int scale) +uint32_t mb86233_cpu_device::ScaleExp(unsigned int v,int scale) { int exp=(v>>23)&0xff; exp+=scale; @@ -447,17 +447,17 @@ UINT32 mb86233_cpu_device::ScaleExp(unsigned int v,int scale) } -UINT32 mb86233_cpu_device::GETEXTERNAL( UINT32 EB, UINT32 offset ) +uint32_t mb86233_cpu_device::GETEXTERNAL( uint32_t EB, uint32_t offset ) { - UINT32 addr; + uint32_t addr; if ( EB == 0 && offset >= 0x20 && offset <= 0x2f ) /* TGP Tables in ROM - FIXME - */ { if(offset>=0x20 && offset<=0x23) //SIN from value at RAM(0x20) in 0x4000/PI steps { - UINT32 r; - UINT32 value=GETEXTPORT()[0x20]; - UINT32 off; + uint32_t r; + uint32_t value=GETEXTPORT()[0x20]; + uint32_t off; value+=(offset-0x20)<<14; off=value&0x3fff; if((value&0x7fff)==0) @@ -557,9 +557,9 @@ UINT32 mb86233_cpu_device::GETEXTERNAL( UINT32 EB, UINT32 offset ) if(offset==0x28) { - UINT32 offset=(GETEXTPORT()[0x28]>>10)&0x1fff; - UINT32 value=m_Tables[offset*2+0x20000/4]; - UINT32 srcexp=(GETEXTPORT()[0x28]>>23)&0xff; + uint32_t offset=(GETEXTPORT()[0x28]>>10)&0x1fff; + uint32_t value=m_Tables[offset*2+0x20000/4]; + uint32_t srcexp=(GETEXTPORT()[0x28]>>23)&0xff; value&=0x7FFFFFFF; @@ -567,9 +567,9 @@ UINT32 mb86233_cpu_device::GETEXTERNAL( UINT32 EB, UINT32 offset ) } if(offset==0x29) { - UINT32 offset=(GETEXTPORT()[0x28]>>10)&0x1fff; - UINT32 value=m_Tables[offset*2+(0x20000/4)+1]; - UINT32 srcexp=(GETEXTPORT()[0x28]>>23)&0xff; + uint32_t offset=(GETEXTPORT()[0x28]>>10)&0x1fff; + uint32_t value=m_Tables[offset*2+(0x20000/4)+1]; + uint32_t srcexp=(GETEXTPORT()[0x28]>>23)&0xff; value&=0x7FFFFFFF; if(GETEXTPORT()[0x28]&(1<<31)) @@ -579,9 +579,9 @@ UINT32 mb86233_cpu_device::GETEXTERNAL( UINT32 EB, UINT32 offset ) } if(offset==0x2a) { - UINT32 offset=((GETEXTPORT()[0x2a]>>11)&0x1fff)^0x1000; - UINT32 value=m_Tables[offset*2+0x30000/4]; - UINT32 srcexp=(GETEXTPORT()[0x2a]>>24)&0x7f; + uint32_t offset=((GETEXTPORT()[0x2a]>>11)&0x1fff)^0x1000; + uint32_t value=m_Tables[offset*2+0x30000/4]; + uint32_t srcexp=(GETEXTPORT()[0x2a]>>24)&0x7f; value&=0x7FFFFFFF; @@ -589,9 +589,9 @@ UINT32 mb86233_cpu_device::GETEXTERNAL( UINT32 EB, UINT32 offset ) } if(offset==0x2b) { - UINT32 offset=((GETEXTPORT()[0x2a]>>11)&0x1fff)^0x1000; - UINT32 value=m_Tables[offset*2+(0x30000/4)+1]; - UINT32 srcexp=(GETEXTPORT()[0x2a]>>24)&0x7f; + uint32_t offset=((GETEXTPORT()[0x2a]>>11)&0x1fff)^0x1000; + uint32_t value=m_Tables[offset*2+(0x30000/4)+1]; + uint32_t srcexp=(GETEXTPORT()[0x2a]>>24)&0x7f; value&=0x7FFFFFFF; if(GETEXTPORT()[0x2a]&(1<<31)) @@ -608,9 +608,9 @@ UINT32 mb86233_cpu_device::GETEXTERNAL( UINT32 EB, UINT32 offset ) return RDMEM(addr); } -void mb86233_cpu_device::SETEXTERNAL( UINT32 EB, UINT32 offset, UINT32 value ) +void mb86233_cpu_device::SETEXTERNAL( uint32_t EB, uint32_t offset, uint32_t value ) { - UINT32 addr; + uint32_t addr; if ( EB == 0 && offset >= 0x20 && offset <= 0x2f ) /* TGP Tables in ROM - FIXME - */ { @@ -641,9 +641,9 @@ void mb86233_cpu_device::SETEXTERNAL( UINT32 EB, UINT32 offset, UINT32 value ) Register Access ***************************************************************************/ -UINT32 mb86233_cpu_device::GETREGS( UINT32 reg, int source ) +uint32_t mb86233_cpu_device::GETREGS( uint32_t reg, int source ) { - UINT32 mode = ( reg >> 6 ) & 0x07; + uint32_t mode = ( reg >> 6 ) & 0x07; reg &= 0x3f; @@ -725,7 +725,7 @@ UINT32 mb86233_cpu_device::GETREGS( UINT32 reg, int source ) } else if ( mode == 2 ) /* Indexed */ { - UINT32 addr = reg & 0x1f; + uint32_t addr = reg & 0x1f; if ( source ) { @@ -746,7 +746,7 @@ UINT32 mb86233_cpu_device::GETREGS( UINT32 reg, int source ) } else if( mode == 6 ) /* Indexed with postop */ { - UINT32 addr = 0; + uint32_t addr = 0; if ( source ) { @@ -789,7 +789,7 @@ UINT32 mb86233_cpu_device::GETREGS( UINT32 reg, int source ) //return 0; } -void mb86233_cpu_device::SETREGS( UINT32 reg, UINT32 val ) +void mb86233_cpu_device::SETREGS( uint32_t reg, uint32_t val ) { int mode = ( reg >> 6) & 0x07; @@ -903,9 +903,9 @@ void mb86233_cpu_device::SETREGS( UINT32 reg, UINT32 val ) Addressing Modes ***************************************************************************/ -UINT32 mb86233_cpu_device::INDIRECT( UINT32 reg, int source ) +uint32_t mb86233_cpu_device::INDIRECT( uint32_t reg, int source ) { - UINT32 mode = ( reg >> 6 ) & 0x07; + uint32_t mode = ( reg >> 6 ) & 0x07; if ( mode == 0 || mode == 1 || mode == 3 ) { @@ -913,7 +913,7 @@ UINT32 mb86233_cpu_device::INDIRECT( UINT32 reg, int source ) } else if ( mode == 2 ) { - UINT32 addr = reg & 0x3f; + uint32_t addr = reg & 0x3f; if ( source ) { @@ -934,7 +934,7 @@ UINT32 mb86233_cpu_device::INDIRECT( UINT32 reg, int source ) } else if ( mode == 6 || mode == 7 ) { - UINT32 addr = 0; + uint32_t addr = 0; if ( source ) { @@ -992,8 +992,8 @@ void mb86233_cpu_device::execute_run() { while( m_icount > 0 ) { - UINT32 val; - UINT32 opcode; + uint32_t val; + uint32_t opcode; debugger_instruction_hook(this, GETPC()); @@ -1005,10 +1005,10 @@ void mb86233_cpu_device::execute_run() { case 0x00: /* dual move */ { - UINT32 r1 = opcode & 0x1ff; - UINT32 r2 = ( opcode >> 9 ) & 0x7f; - UINT32 alu = ( opcode >> 21 ) & 0x1f; - UINT32 op = ( opcode >> 16 ) & 0x1f; + uint32_t r1 = opcode & 0x1ff; + uint32_t r2 = ( opcode >> 9 ) & 0x7f; + uint32_t alu = ( opcode >> 21 ) & 0x1f; + uint32_t op = ( opcode >> 16 ) & 0x1f; ALU( alu ); @@ -1058,10 +1058,10 @@ void mb86233_cpu_device::execute_run() case 0x7: /* LD/MOV */ { - UINT32 r1 = opcode & 0x1ff; - UINT32 r2 = ( opcode >> 9 ) & 0x7f; - UINT32 alu = ( opcode >> 21 ) & 0x1f; - UINT32 op = ( opcode >> 16 ) & 0x1f; + uint32_t r1 = opcode & 0x1ff; + uint32_t r2 = ( opcode >> 9 ) & 0x7f; + uint32_t alu = ( opcode >> 21 ) & 0x1f; + uint32_t op = ( opcode >> 16 ) & 0x1f; switch( op ) { @@ -1175,7 +1175,7 @@ void mb86233_cpu_device::execute_run() case 0x1e: /* External->Reg */ { - UINT32 offset; + uint32_t offset; if ( (( r2 >> 6 ) & 7) == 1 ) { @@ -1227,7 +1227,7 @@ void mb86233_cpu_device::execute_run() case 0x17: /* External r2-> RAMInd r3 */ { - UINT32 offset; + uint32_t offset; offset = INDIRECT(r1,1); @@ -1238,7 +1238,7 @@ void mb86233_cpu_device::execute_run() break; case 0x14: { - UINT32 offset; + uint32_t offset; offset = INDIRECT(r1,1); @@ -1256,7 +1256,7 @@ void mb86233_cpu_device::execute_run() case 0x0d: /* CONTROL? */ { - UINT32 sub = (opcode>>16) & 0xff; + uint32_t sub = (opcode>>16) & 0xff; switch(sub) { @@ -1274,8 +1274,8 @@ void mb86233_cpu_device::execute_run() case 0x0e: /* LDIMM24 */ { - UINT32 sub = (opcode>>24) & 0x03; - UINT32 imm = opcode & 0xffffff; + uint32_t sub = (opcode>>24) & 0x03; + uint32_t imm = opcode & 0xffffff; /* sign extend 24->32 */ if ( imm & 0x800000 ) @@ -1304,14 +1304,14 @@ void mb86233_cpu_device::execute_run() case 0x0f: /* REP/CLEAR/FLAGS */ { - UINT32 alu = ( opcode >> 20 ) & 0x1f; - UINT32 sub2 = ( opcode >> 16 ) & 0x0f; + uint32_t alu = ( opcode >> 20 ) & 0x1f; + uint32_t sub2 = ( opcode >> 16 ) & 0x0f; ALU(alu); if( sub2 == 0x00 ) /* CLEAR reg */ { - UINT32 reg = opcode & 0x1f; + uint32_t reg = opcode & 0x1f; switch( reg ) { @@ -1330,7 +1330,7 @@ void mb86233_cpu_device::execute_run() } else if ( sub2 == 0x04 ) /* REP xxx */ { - UINT32 sub3 = ( opcode >> 12 ) & 0x0f; + uint32_t sub3 = ( opcode >> 12 ) & 0x0f; if ( sub3 == 0 ) { @@ -1360,8 +1360,8 @@ void mb86233_cpu_device::execute_run() case 0x10: /* LDIMM rx */ { - UINT32 sub = (opcode>>24) & 0x03; - UINT32 imm = opcode & 0xffff; + uint32_t sub = (opcode>>24) & 0x03; + uint32_t imm = opcode & 0xffff; GETGPR(sub) = imm; } @@ -1369,8 +1369,8 @@ void mb86233_cpu_device::execute_run() case 0x13: /* LDIMM r1x */ { - UINT32 sub = (opcode>>24) & 0x03; - UINT32 imm = opcode & 0xffffff; + uint32_t sub = (opcode>>24) & 0x03; + uint32_t imm = opcode & 0xffffff; if ( sub == 0 ) /* R12 */ GETGPR(12) = imm; @@ -1383,8 +1383,8 @@ void mb86233_cpu_device::execute_run() case 0x14: /* LDIMM m,e */ { - UINT32 sub = (opcode>>24) & 0x03; - UINT32 imm = opcode & 0xffffff; + uint32_t sub = (opcode>>24) & 0x03; + uint32_t imm = opcode & 0xffffff; if ( sub == 0 ) /* A */ { @@ -1409,8 +1409,8 @@ void mb86233_cpu_device::execute_run() case 0x15: /* LDIMM m,e */ { - UINT32 sub = (opcode>>24) & 0x03; - UINT32 imm = opcode & 0xffffff; + uint32_t sub = (opcode>>24) & 0x03; + uint32_t imm = opcode & 0xffffff; if ( sub == 0 ) /* B.e again? */ { @@ -1437,8 +1437,8 @@ void mb86233_cpu_device::execute_run() case 0x16: /* LDIMM m,e */ { - UINT32 sub = (opcode>>24) & 0x03; - UINT32 imm = opcode & 0xffffff; + uint32_t sub = (opcode>>24) & 0x03; + uint32_t imm = opcode & 0xffffff; if ( sub == 1 ) /* clear + D.m */ { @@ -1463,8 +1463,8 @@ void mb86233_cpu_device::execute_run() case 0x17: /* LDIMM special reg */ { - UINT32 sub = (opcode>>24) & 0x03; - UINT32 imm = opcode & 0xffffff; + uint32_t sub = (opcode>>24) & 0x03; + uint32_t imm = opcode & 0xffffff; if ( sub == 0x03 ) { @@ -1479,8 +1479,8 @@ void mb86233_cpu_device::execute_run() case 0x18: /* LDIMM external reg */ { - UINT32 sub = (opcode>>24) & 0x03; - UINT32 imm = opcode & 0xffffff; + uint32_t sub = (opcode>>24) & 0x03; + uint32_t imm = opcode & 0xffffff; if ( sub == 0x03 ) { @@ -1495,8 +1495,8 @@ void mb86233_cpu_device::execute_run() case 0x1d: //LDIMM to Rep regs { - UINT32 sub = (opcode>>24)&0x3; - UINT32 imm = opcode&0xffffff; + uint32_t sub = (opcode>>24)&0x3; + uint32_t imm = opcode&0xffffff; if(sub == 0x00) { GETREPCNT() = imm; @@ -1510,9 +1510,9 @@ void mb86233_cpu_device::execute_run() case 0x2f: /* Conditional Branches */ { - UINT32 cond = ( opcode >> 20 ) & 0x1f; - UINT32 subtype = ( opcode >> 16 ) & 0x0f; - UINT32 data = opcode & 0xffff; + uint32_t cond = ( opcode >> 20 ) & 0x1f; + uint32_t subtype = ( opcode >> 16 ) & 0x0f; + uint32_t data = opcode & 0xffff; if( COND( cond) ) { @@ -1574,9 +1574,9 @@ void mb86233_cpu_device::execute_run() case 0x3f: /* Inverse Conditional Branches */ { - UINT32 cond = ( opcode >> 20 ) & 0x1f; - UINT32 subtype = ( opcode >> 16 ) & 0x0f; - UINT32 data = opcode & 0xffff; + uint32_t cond = ( opcode >> 20 ) & 0x1f; + uint32_t subtype = ( opcode >> 16 ) & 0x0f; + uint32_t data = opcode & 0xffff; if( !COND( cond) ) { diff --git a/src/devices/cpu/mb86233/mb86233.h b/src/devices/cpu/mb86233/mb86233.h index 26fc5b3e9f6..b95d7948593 100644 --- a/src/devices/cpu/mb86233/mb86233.h +++ b/src/devices/cpu/mb86233/mb86233.h @@ -51,7 +51,7 @@ class mb86233_cpu_device : public cpu_device { public: // construction/destruction - mb86233_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb86233_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_fifo_read_cb(device_t &device, _Object object) { return downcast(device).m_fifo_read_cb.set_callback(object); } @@ -65,9 +65,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -77,9 +77,9 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -87,28 +87,28 @@ private: union MB86233_REG { - INT32 i; - UINT32 u; + int32_t i; + uint32_t u; float f; }; - UINT16 m_pc; + uint16_t m_pc; MB86233_REG m_a; MB86233_REG m_b; MB86233_REG m_d; MB86233_REG m_p; - UINT16 m_reps; - UINT16 m_pcs[4]; - UINT8 m_pcsp; - UINT32 m_eb; - UINT32 m_shift; - UINT32 m_repcnt; - UINT16 m_sr; - UINT8 m_fpucontrol; + uint16_t m_reps; + uint16_t m_pcs[4]; + uint8_t m_pcsp; + uint32_t m_eb; + uint32_t m_shift; + uint32_t m_repcnt; + uint16_t m_sr; + uint8_t m_fpucontrol; - UINT32 m_gpr[16]; - UINT32 m_extport[0x30]; + uint32_t m_gpr[16]; + uint32_t m_extport[0x30]; address_space *m_program; direct_read_data *m_direct; @@ -122,20 +122,20 @@ private: const char *m_tablergn; /* internal RAM */ - UINT32 m_RAM[2 * 0x200]; - UINT32 *m_ARAM, *m_BRAM; - UINT32 *m_Tables; + uint32_t m_RAM[2 * 0x200]; + uint32_t *m_ARAM, *m_BRAM; + uint32_t *m_Tables; void FLAGSF( float v ); - void FLAGSI( UINT32 v ); - int COND( UINT32 cond ); - void ALU( UINT32 alu); - UINT32 ScaleExp(unsigned int v,int scale); - UINT32 GETEXTERNAL( UINT32 EB, UINT32 offset ); - void SETEXTERNAL( UINT32 EB, UINT32 offset, UINT32 value ); - UINT32 GETREGS( UINT32 reg, int source ); - void SETREGS( UINT32 reg, UINT32 val ); - UINT32 INDIRECT( UINT32 reg, int source ); + void FLAGSI( uint32_t v ); + int COND( uint32_t cond ); + void ALU( uint32_t alu); + uint32_t ScaleExp(unsigned int v,int scale); + uint32_t GETEXTERNAL( uint32_t EB, uint32_t offset ); + void SETEXTERNAL( uint32_t EB, uint32_t offset, uint32_t value ); + uint32_t GETREGS( uint32_t reg, int source ); + void SETREGS( uint32_t reg, uint32_t val ); + uint32_t INDIRECT( uint32_t reg, int source ); }; diff --git a/src/devices/cpu/mb86233/mb86233d.cpp b/src/devices/cpu/mb86233/mb86233d.cpp index f75053c07ff..db830e7463d 100644 --- a/src/devices/cpu/mb86233/mb86233d.cpp +++ b/src/devices/cpu/mb86233/mb86233d.cpp @@ -47,7 +47,7 @@ static char * COND(unsigned int cond) return buf; } -static char * REGS( UINT32 reg, int IsSource ) +static char * REGS( uint32_t reg, int IsSource ) { static char bufs[4][256]; static int bufindex = 0; @@ -194,7 +194,7 @@ static char * REGS( UINT32 reg, int IsSource ) return buf; } -static char * INDIRECT( UINT32 reg, int IsSource ) +static char * INDIRECT( uint32_t reg, int IsSource ) { static char bufs[4][256]; static int bufindex = 0; @@ -261,7 +261,7 @@ static char * INDIRECT( UINT32 reg, int IsSource ) } -static char * ALU( UINT32 alu) +static char * ALU( uint32_t alu) { static char bufs[4][256]; static int bufindex = 0; @@ -375,19 +375,19 @@ static char * ALU( UINT32 alu) return buf; } -static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) +static unsigned dasm_mb86233(char *buffer, uint32_t opcode ) { char *p = buffer; - UINT32 grp = ( opcode >> 26 ) & 0x3f; + uint32_t grp = ( opcode >> 26 ) & 0x3f; switch( grp ) { case 0x0: /* Dual move */ { - UINT32 r1=opcode & 0x1ff; - UINT32 r2=(opcode>>9) & 0x7f; - UINT32 alu=(opcode>>21) & 0x1f; - UINT32 op=(opcode>>16) & 0x1f; + uint32_t r1=opcode & 0x1ff; + uint32_t r2=(opcode>>9) & 0x7f; + uint32_t alu=(opcode>>21) & 0x1f; + uint32_t op=(opcode>>16) & 0x1f; if ( alu != 0 ) p += sprintf(p, "%s, ", ALU(alu) ); @@ -419,10 +419,10 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x7: /* LD/MOV */ { - UINT32 r1=opcode & 0x1ff; - UINT32 r2=(opcode>>9) & 0x7f; - UINT32 alu=(opcode>>21) & 0x1f; - UINT32 op=(opcode>>16) & 0x1f; + uint32_t r1=opcode & 0x1ff; + uint32_t r2=(opcode>>9) & 0x7f; + uint32_t alu=(opcode>>21) & 0x1f; + uint32_t op=(opcode>>16) & 0x1f; if ( alu != 0 ) { @@ -541,7 +541,7 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x0e: /* Load 24 bit val */ { - UINT32 sub=(opcode>>24)&0x3; + uint32_t sub=(opcode>>24)&0x3; static const char regs[4] = { 'p', 'a', 'b', 'd' }; p += sprintf(p,"LDIMM24 0x%X->%c",opcode&0xffffff, regs[sub]); @@ -550,8 +550,8 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x0f: /* repeat */ { - UINT32 alu = ( opcode >> 20 ) & 0x1f; - UINT32 sub2 = ( opcode >> 16 ) & 0x0f; + uint32_t alu = ( opcode >> 20 ) & 0x1f; + uint32_t sub2 = ( opcode >> 16 ) & 0x0f; if ( alu != 0 ) p += sprintf(p, "%s, ", ALU(alu) ); @@ -584,8 +584,8 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x10: { - UINT32 dst=(opcode>>24)&0xf; - UINT32 imm=(opcode)&0xFFFF; + uint32_t dst=(opcode>>24)&0xf; + uint32_t imm=(opcode)&0xFFFF; if ( dst <= 3 ) p += sprintf(p,"LDIMM 0x%x->r%d",imm,dst); @@ -596,7 +596,7 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x13: { - UINT32 sub = ( opcode >> 24 ) & 0x03; + uint32_t sub = ( opcode >> 24 ) & 0x03; p += sprintf(p,"LDIMM 0x%X->",opcode&0xffffff); @@ -608,7 +608,7 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x14: { - UINT32 sub = ( opcode >> 24 ) & 0x03; + uint32_t sub = ( opcode >> 24 ) & 0x03; p += sprintf(p,"LDIMM 0x%X->",opcode&0xffffff); @@ -621,7 +621,7 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x15: { - UINT32 sub = ( opcode >> 24 ) & 0x03; + uint32_t sub = ( opcode >> 24 ) & 0x03; p += sprintf(p,"LDIMM 0x%X->",opcode&0xffffff); @@ -634,7 +634,7 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x16: { - UINT32 sub = ( opcode >> 24 ) & 0x03; + uint32_t sub = ( opcode >> 24 ) & 0x03; p += sprintf(p,"LDIMM 0x%X->",opcode&0xffffff); @@ -646,7 +646,7 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x17: { - UINT32 sub = ( opcode >> 24 ) & 0x03; + uint32_t sub = ( opcode >> 24 ) & 0x03; p += sprintf(p,"LDIMM 0x%X->",opcode&0xffffff); @@ -657,7 +657,7 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x18: { - UINT32 sub = ( opcode >> 24 ) & 0x03; + uint32_t sub = ( opcode >> 24 ) & 0x03; p += sprintf(p,"LDIMM24 0x%X->",opcode&0xffffff); @@ -668,9 +668,9 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x2f: { - UINT32 cond = ( opcode >> 20 ) & 0x1f; - UINT32 subtype = ( opcode >> 16 ) & 0x0f; - UINT32 data = opcode & 0xffff; + uint32_t cond = ( opcode >> 20 ) & 0x1f; + uint32_t subtype = ( opcode >> 16 ) & 0x0f; + uint32_t data = opcode & 0xffff; switch( subtype ) { @@ -719,9 +719,9 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) case 0x3f: { - UINT32 cond = ( opcode >> 20 ) & 0x1f; - UINT32 subtype = ( opcode >> 16 ) & 0x0f; - UINT32 data = opcode & 0xffff; + uint32_t cond = ( opcode >> 20 ) & 0x1f; + uint32_t subtype = ( opcode >> 16 ) & 0x0f; + uint32_t data = opcode & 0xffff; switch( subtype ) { @@ -778,7 +778,7 @@ static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) CPU_DISASSEMBLE( mb86233 ) { - UINT32 op = *(UINT32 *)oprom; + uint32_t op = *(uint32_t *)oprom; op = little_endianize_int32(op); return dasm_mb86233(buffer, op); } diff --git a/src/devices/cpu/mb86235/mb86235.cpp b/src/devices/cpu/mb86235/mb86235.cpp index 9ab306bb96f..b765614d074 100644 --- a/src/devices/cpu/mb86235/mb86235.cpp +++ b/src/devices/cpu/mb86235/mb86235.cpp @@ -39,7 +39,7 @@ void mb86235_cpu_device::mb86235_illegal() /* Execute cycles */ void mb86235_cpu_device::execute_run() { - UINT32 opcode; + uint32_t opcode; do { @@ -102,7 +102,7 @@ void mb86235_cpu_device::execute_set_input(int irqline, int state) } #endif -mb86235_cpu_device::mb86235_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb86235_cpu_device::mb86235_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, MB86235, "MB86235", tag, owner, clock, "mb86235", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 64, 32, -3) { @@ -123,7 +123,7 @@ void mb86235_cpu_device::state_string_export(const device_state_entry &entry, st } } -offs_t mb86235_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t mb86235_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( mb86235 ); return CPU_DISASSEMBLE_NAME(mb86235)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/mb86235/mb86235.h b/src/devices/cpu/mb86235/mb86235.h index 35f586c7290..7531607688c 100644 --- a/src/devices/cpu/mb86235/mb86235.h +++ b/src/devices/cpu/mb86235/mb86235.h @@ -24,7 +24,7 @@ class mb86235_cpu_device : public cpu_device { public: // construction/destruction - mb86235_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + mb86235_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); protected: // device-level overrides @@ -32,9 +32,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 7; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 7; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; //virtual void execute_set_input(int inputnum, int state); @@ -45,15 +45,15 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 8; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 8; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; - UINT8 m_pc; /* registers */ - UINT8 m_flags; /* flags */ + uint8_t m_pc; /* registers */ + uint8_t m_flags; /* flags */ address_space *m_program; int m_icount; diff --git a/src/devices/cpu/mb86235/mb86235d.cpp b/src/devices/cpu/mb86235/mb86235d.cpp index 640fef9bccf..9b5597cbfdd 100644 --- a/src/devices/cpu/mb86235/mb86235d.cpp +++ b/src/devices/cpu/mb86235/mb86235d.cpp @@ -114,12 +114,12 @@ static char* get_ea(int md, int arx, int ary, int disp) return buffer; } -static char* dasm_alu_mul(UINT64 opcode, bool twoop) +static char* dasm_alu_mul(uint64_t opcode, bool twoop) { static char buffer[80]; char *p = buffer; - int ma = (opcode & ((UINT64)(1) << 41)) ? 1 : 0; + int ma = (opcode & ((uint64_t)(1) << 41)) ? 1 : 0; int o = (opcode >> 42) & 0x1f; int i2 = (opcode >> 47) & 0x1f; int i1 = (opcode >> 52) & 0xf; @@ -203,7 +203,7 @@ static char* dasm_alu_mul(UINT64 opcode, bool twoop) int mi2 = (opcode >> 32) & 0x1f; int mi1 = (opcode >> 37) & 0xf; int mo = (opcode >> 27) & 0x1f; - if (opcode & ((UINT64)(1) << 41)) + if (opcode & ((uint64_t)(1) << 41)) p += sprintf(p, " : FMUL %s, %s, %s", mi1_field[mi1], mi2_field[mi2], mo_field[mo]); else p += sprintf(p, " : MUL %s, %s, %s", mi1_field[mi1], mi2_field[mi2], mo_field[mo]); @@ -212,7 +212,7 @@ static char* dasm_alu_mul(UINT64 opcode, bool twoop) { if (ma == 0) { - if (opcode & ((UINT64)(1) << 56)) + if (opcode & ((uint64_t)(1) << 56)) p += sprintf(p, "FMUL %s, %s, %s", mi1_field[i1], mi2_field[i2], mo_field[o]); else p += sprintf(p, "MUL %s, %s, %s", mi1_field[i1], mi2_field[i2], mo_field[o]); @@ -222,7 +222,7 @@ static char* dasm_alu_mul(UINT64 opcode, bool twoop) return buffer; } -static char* dasm_control(UINT32 pc, UINT64 opcode) +static char* dasm_control(uint32_t pc, uint64_t opcode) { static char buffer[80]; char *p = buffer; @@ -287,10 +287,10 @@ static char* dasm_control(UINT32 pc, UINT64 opcode) p += sprintf(p, "DBLP %04X", pc + rel12); break; case 0x14: - p += sprintf(p, "DBBC AR%d:%d, %04X", (UINT32)((opcode >> 13) & 7), (UINT32)((opcode >> 16) & 0xf), pc + rel12); + p += sprintf(p, "DBBC AR%d:%d, %04X", (uint32_t)((opcode >> 13) & 7), (uint32_t)((opcode >> 16) & 0xf), pc + rel12); break; case 0x15: - p += sprintf(p, "DBBS AR%d:%d, %04X", (UINT32)((opcode >> 13) & 7), (UINT32)((opcode >> 16) & 0xf), pc + rel12); + p += sprintf(p, "DBBS AR%d:%d, %04X", (uint32_t)((opcode >> 13) & 7), (uint32_t)((opcode >> 16) & 0xf), pc + rel12); break; case 0x1b: p += sprintf(p, "DRET"); @@ -343,7 +343,7 @@ static char* dasm_control(UINT32 pc, UINT64 opcode) return buffer; } -static char* dasm_double_xfer1(UINT64 opcode) +static char* dasm_double_xfer1(uint64_t opcode) { static char buffer[80]; char *p = buffer; @@ -428,7 +428,7 @@ static char* dasm_double_xfer1(UINT64 opcode) return buffer; } -static char* dasm_xfer1(UINT64 opcode) +static char* dasm_xfer1(uint64_t opcode) { static char buffer[80]; char *p = buffer; @@ -445,7 +445,7 @@ static char* dasm_xfer1(UINT64 opcode) { if (sr == 0x58) { - p += sprintf(p, "MOV1 #%03X, %s", (UINT32)(opcode & 0xfff), regname[dr]); + p += sprintf(p, "MOV1 #%03X, %s", (uint32_t)(opcode & 0xfff), regname[dr]); } else { @@ -527,7 +527,7 @@ static char* dasm_xfer1(UINT64 opcode) return buffer; } -static char* double_xfer2_field(int sd, UINT32 field) +static char* double_xfer2_field(int sd, uint32_t field) { static char buffer[40]; char *p = buffer; @@ -600,7 +600,7 @@ static char* double_xfer2_field(int sd, UINT32 field) return buffer; } -static char* dasm_double_xfer2(UINT64 opcode) +static char* dasm_double_xfer2(uint64_t opcode) { static char buffer[80]; char *p = buffer; @@ -648,7 +648,7 @@ static char* dasm_double_xfer2(UINT64 opcode) return buffer; } -static char* dasm_xfer2(UINT64 opcode) +static char* dasm_xfer2(uint64_t opcode) { static char buffer[80]; char *p = buffer; @@ -668,7 +668,7 @@ static char* dasm_xfer2(UINT64 opcode) { if (sr == 0x58) { - p += sprintf(p, "MOV2 #%06X, %s", (UINT32)(opcode & 0xffffff), regname[dr]); + p += sprintf(p, "MOV2 #%06X, %s", (uint32_t)(opcode & 0xffffff), regname[dr]); } else { @@ -729,7 +729,7 @@ static char* dasm_xfer2(UINT64 opcode) { if (sr == 0x58) { - p += sprintf(p, "MOV4 #%06X, ICDTR%d", (UINT32)(opcode & 0xffffff), dr & 7); + p += sprintf(p, "MOV4 #%06X, ICDTR%d", (uint32_t)(opcode & 0xffffff), dr & 7); } else { @@ -760,12 +760,12 @@ static char* dasm_xfer2(UINT64 opcode) return buffer; } -static char* dasm_xfer3(UINT64 opcode) +static char* dasm_xfer3(uint64_t opcode) { static char buffer[80]; char *p = buffer; - UINT32 imm = (UINT32)(opcode >> 27); + uint32_t imm = (uint32_t)(opcode >> 27); int dr = (opcode >> 19) & 0x7f; int disp = (opcode >> 7) & 0xfff; int ary = (opcode >> 4) & 7; @@ -790,7 +790,7 @@ static char* dasm_xfer3(UINT64 opcode) return buffer; } -static unsigned dasm_mb86235(char *buffer, UINT32 pc, UINT64 opcode) +static unsigned dasm_mb86235(char *buffer, uint32_t pc, uint64_t opcode) { char *p = buffer; @@ -832,7 +832,7 @@ static unsigned dasm_mb86235(char *buffer, UINT32 pc, UINT64 opcode) CPU_DISASSEMBLE( mb86235 ) { - UINT64 op = *(UINT64*)oprom; + uint64_t op = *(uint64_t*)oprom; op = little_endianize_int64(op); return dasm_mb86235(buffer, pc, op); diff --git a/src/devices/cpu/mb88xx/mb88dasm.cpp b/src/devices/cpu/mb88xx/mb88dasm.cpp index 49bf547ccd4..eab49fd4bc8 100644 --- a/src/devices/cpu/mb88xx/mb88dasm.cpp +++ b/src/devices/cpu/mb88xx/mb88dasm.cpp @@ -16,8 +16,8 @@ CPU_DISASSEMBLE( mb88 ) { unsigned startpc = pc; - UINT8 op = oprom[pc++ - startpc]; - UINT8 arg = oprom[pc - startpc]; + uint8_t op = oprom[pc++ - startpc]; + uint8_t arg = oprom[pc - startpc]; switch( op ) { diff --git a/src/devices/cpu/mb88xx/mb88xx.cpp b/src/devices/cpu/mb88xx/mb88xx.cpp index 1f1a84217bf..2be8354d9f9 100644 --- a/src/devices/cpu/mb88xx/mb88xx.cpp +++ b/src/devices/cpu/mb88xx/mb88xx.cpp @@ -109,7 +109,7 @@ static ADDRESS_MAP_START(data_7bit, AS_DATA, 8, mb88_cpu_device) ADDRESS_MAP_END -mb88_cpu_device::mb88_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb88_cpu_device::mb88_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, MB88, "MB88xx", tag, owner, clock, "mb88xx", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 8, 11, 0) , m_data_config("data", ENDIANNESS_BIG, 8, 7, 0) @@ -119,7 +119,7 @@ mb88_cpu_device::mb88_cpu_device(const machine_config &mconfig, const char *tag, } -mb88_cpu_device::mb88_cpu_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, int program_width, int data_width) +mb88_cpu_device::mb88_cpu_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, int program_width, int data_width) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 8, program_width, 0, ( (program_width == 9) ? ADDRESS_MAP_NAME(program_9bit) : (program_width == 10) ? ADDRESS_MAP_NAME(program_10bit) : ADDRESS_MAP_NAME(program_11bit) ) ) , m_data_config("data", ENDIANNESS_BIG, 8, data_width, 0, ( (data_width == 4) ? ADDRESS_MAP_NAME(data_4bit) : (data_width == 5) ? ADDRESS_MAP_NAME(data_5bit) : (data_width == 6) ? ADDRESS_MAP_NAME(data_6bit) : ADDRESS_MAP_NAME(data_7bit) ) ) @@ -128,42 +128,42 @@ mb88_cpu_device::mb88_cpu_device(const machine_config &mconfig, device_type type { } -mb88201_cpu_device::mb88201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb88201_cpu_device::mb88201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mb88_cpu_device(mconfig, MB88201, "MB88201", tag, owner, clock, "mb88201", __FILE__, 9, 4) { } -mb88202_cpu_device::mb88202_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb88202_cpu_device::mb88202_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mb88_cpu_device(mconfig, MB88202, "MB88202", tag, owner, clock, "mb88202", __FILE__, 10, 5) { } -mb8841_cpu_device::mb8841_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb8841_cpu_device::mb8841_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mb88_cpu_device(mconfig, MB8841, "MB8841", tag, owner, clock, "mb8841", __FILE__, 11, 7) { } -mb8842_cpu_device::mb8842_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb8842_cpu_device::mb8842_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mb88_cpu_device(mconfig, MB8842, "MB8842", tag, owner, clock, "mb8842", __FILE__, 11, 7) { } -mb8843_cpu_device::mb8843_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb8843_cpu_device::mb8843_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mb88_cpu_device(mconfig, MB8843, "MB8843", tag, owner, clock, "mb8843", __FILE__, 10, 6) { } -mb8844_cpu_device::mb8844_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb8844_cpu_device::mb8844_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mb88_cpu_device(mconfig, MB8844, "MB8844", tag, owner, clock, "mb8844", __FILE__, 10, 6) { } -offs_t mb88_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t mb88_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( mb88 ); return CPU_DISASSEMBLE_NAME(mb88)(this, buffer, pc, oprom, opram, options); @@ -364,7 +364,7 @@ void mb88_cpu_device::execute_set_input(int inputnum, int state) m_nf = (state != CLEAR_LINE) ? 1 : 0; } -void mb88_cpu_device::update_pio_enable( UINT8 newpio ) +void mb88_cpu_device::update_pio_enable( uint8_t newpio ) { /* if the serial state has changed, configure the timer */ if ((m_pio ^ newpio) & 0x30) @@ -460,7 +460,7 @@ void mb88_cpu_device::execute_run() { while (m_icount > 0) { - UINT8 opcode, arg, oc; + uint8_t opcode, arg, oc; /* fetch the opcode */ debugger_instruction_hook(this, GETPC()); diff --git a/src/devices/cpu/mb88xx/mb88xx.h b/src/devices/cpu/mb88xx/mb88xx.h index 3eae8a92427..911574ce092 100644 --- a/src/devices/cpu/mb88xx/mb88xx.h +++ b/src/devices/cpu/mb88xx/mb88xx.h @@ -64,11 +64,11 @@ class mb88_cpu_device : public cpu_device { public: // construction/destruction - mb88_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - mb88_cpu_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, int program_width, int data_width); + mb88_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mb88_cpu_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, int program_width, int data_width); // static configuration helpers - static void set_pla(device_t &device, UINT8 *pla) { downcast(device).m_PLA = pla; } + static void set_pla(device_t &device, uint8_t *pla) { downcast(device).m_PLA = pla; } DECLARE_WRITE_LINE_MEMBER( clock_w ); @@ -78,13 +78,13 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 3; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 3; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 6 - 1) / 6; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 6); } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 6 - 1) / 6; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 6); } // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_DATA) ? &m_data_config : ( (spacenum == AS_IO) ? &m_io_config : nullptr ) ); } @@ -95,48 +95,48 @@ protected: virtual void state_export(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; address_space_config m_data_config; address_space_config m_io_config; - UINT8 m_PC; /* Program Counter: 6 bits */ - UINT8 m_PA; /* Page Address: 4 bits */ - UINT16 m_SP[4]; /* Stack is 4*10 bit addresses deep, but we also use 3 top bits per address to store flags during irq */ - UINT8 m_SI; /* Stack index: 2 bits */ - UINT8 m_A; /* Accumulator: 4 bits */ - UINT8 m_X; /* Index X: 4 bits */ - UINT8 m_Y; /* Index Y: 4 bits */ - UINT8 m_st; /* State flag: 1 bit */ - UINT8 m_zf; /* Zero flag: 1 bit */ - UINT8 m_cf; /* Carry flag: 1 bit */ - UINT8 m_vf; /* Timer overflow flag: 1 bit */ - UINT8 m_sf; /* Serial Full/Empty flag: 1 bit */ - UINT8 m_nf; /* Interrupt flag: 1 bit */ + uint8_t m_PC; /* Program Counter: 6 bits */ + uint8_t m_PA; /* Page Address: 4 bits */ + uint16_t m_SP[4]; /* Stack is 4*10 bit addresses deep, but we also use 3 top bits per address to store flags during irq */ + uint8_t m_SI; /* Stack index: 2 bits */ + uint8_t m_A; /* Accumulator: 4 bits */ + uint8_t m_X; /* Index X: 4 bits */ + uint8_t m_Y; /* Index Y: 4 bits */ + uint8_t m_st; /* State flag: 1 bit */ + uint8_t m_zf; /* Zero flag: 1 bit */ + uint8_t m_cf; /* Carry flag: 1 bit */ + uint8_t m_vf; /* Timer overflow flag: 1 bit */ + uint8_t m_sf; /* Serial Full/Empty flag: 1 bit */ + uint8_t m_nf; /* Interrupt flag: 1 bit */ /* Peripheral Control */ - UINT8 m_pio; /* Peripheral enable bits: 8 bits */ + uint8_t m_pio; /* Peripheral enable bits: 8 bits */ /* Timer registers */ - UINT8 m_TH; /* Timer High: 4 bits */ - UINT8 m_TL; /* Timer Low: 4 bits */ - UINT8 m_TP; /* Timer Prescale: 6 bits? */ - UINT8 m_ctr; /* current external counter value */ + uint8_t m_TH; /* Timer High: 4 bits */ + uint8_t m_TL; /* Timer Low: 4 bits */ + uint8_t m_TP; /* Timer Prescale: 6 bits? */ + uint8_t m_ctr; /* current external counter value */ /* Serial registers */ - UINT8 m_SB; /* Serial buffer: 4 bits */ - UINT16 m_SBcount; /* number of bits received */ + uint8_t m_SB; /* Serial buffer: 4 bits */ + uint16_t m_SBcount; /* number of bits received */ emu_timer *m_serial; /* PLA configuration */ - UINT8 * m_PLA; + uint8_t * m_PLA; /* IRQ handling */ - UINT8 m_pending_interrupt; + uint8_t m_pending_interrupt; address_space *m_program; direct_read_data *m_direct; @@ -145,12 +145,12 @@ private: int m_icount; // For the debugger - UINT16 m_debugger_pc; - UINT8 m_debugger_flags; + uint16_t m_debugger_pc; + uint8_t m_debugger_flags; TIMER_CALLBACK_MEMBER( serial_timer ); int pla( int inA, int inB ); - void update_pio_enable( UINT8 newpio ); + void update_pio_enable( uint8_t newpio ); void increment_timer(); void update_pio( int cycles ); @@ -161,7 +161,7 @@ class mb88201_cpu_device : public mb88_cpu_device { public: // construction/destruction - mb88201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb88201_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -169,7 +169,7 @@ class mb88202_cpu_device : public mb88_cpu_device { public: // construction/destruction - mb88202_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb88202_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -177,7 +177,7 @@ class mb8841_cpu_device : public mb88_cpu_device { public: // construction/destruction - mb8841_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8841_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -185,7 +185,7 @@ class mb8842_cpu_device : public mb88_cpu_device { public: // construction/destruction - mb8842_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8842_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -193,7 +193,7 @@ class mb8843_cpu_device : public mb88_cpu_device { public: // construction/destruction - mb8843_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8843_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -201,7 +201,7 @@ class mb8844_cpu_device : public mb88_cpu_device { public: // construction/destruction - mb8844_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8844_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/mc68hc11/hc11dasm.cpp b/src/devices/cpu/mc68hc11/hc11dasm.cpp index 2594634671f..a696c9069ad 100644 --- a/src/devices/cpu/mc68hc11/hc11dasm.cpp +++ b/src/devices/cpu/mc68hc11/hc11dasm.cpp @@ -1153,7 +1153,7 @@ static const M68HC11_OPCODE opcode_table_page4[256] = /*****************************************************************************/ static char *output; -static const UINT8 *rombase; +static const uint8_t *rombase; static void ATTR_PRINTF(1,2) print(const char *fmt, ...) { @@ -1164,26 +1164,26 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) va_end(vl); } -static UINT8 fetch(void) +static uint8_t fetch(void) { return *rombase++; } -static UINT16 fetch16(void) +static uint16_t fetch16(void) { - UINT16 w; + uint16_t w; w = (rombase[0] << 8) | rombase[1]; rombase+=2; return w; } -static UINT32 decode_opcode(UINT32 pc, const M68HC11_OPCODE *op_table) +static uint32_t decode_opcode(uint32_t pc, const M68HC11_OPCODE *op_table) { - UINT8 imm8, mask; - INT8 rel8; - UINT16 imm16; - UINT8 op2; - UINT32 flags = 0; + uint8_t imm8, mask; + int8_t rel8; + uint16_t imm16; + uint8_t op2; + uint32_t flags = 0; if (!strcmp(op_table->mnemonic, "jsr") || !strcmp(op_table->mnemonic, "bsr")) flags = DASMFLAG_STEP_OVER; @@ -1286,8 +1286,8 @@ static UINT32 decode_opcode(UINT32 pc, const M68HC11_OPCODE *op_table) CPU_DISASSEMBLE( hc11 ) { - UINT32 flags; - UINT8 opcode; + uint32_t flags; + uint8_t opcode; output = buffer; rombase = oprom; diff --git a/src/devices/cpu/mc68hc11/hc11ops.hxx b/src/devices/cpu/mc68hc11/hc11ops.hxx index cb71a839c2f..8aaac54c641 100644 --- a/src/devices/cpu/mc68hc11/hc11ops.hxx +++ b/src/devices/cpu/mc68hc11/hc11ops.hxx @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Ville Linde, Angelo Salese, hap -#define SET_Z8(r) (m_ccr |= ((UINT8)r == 0) ? CC_Z : 0) -#define SET_Z16(r) (m_ccr |= ((UINT16)r == 0) ? CC_Z : 0) +#define SET_Z8(r) (m_ccr |= ((uint8_t)r == 0) ? CC_Z : 0) +#define SET_Z16(r) (m_ccr |= ((uint16_t)r == 0) ? CC_Z : 0) #define SET_N8(r) (m_ccr |= (r & 0x80) ? CC_N : 0) #define SET_N16(r) (m_ccr |= (r & 0x8000) ? CC_N : 0) #define SET_V_ADD8(r,s,d) (m_ccr |= (((r) ^ (s)) & ((r) ^ (d)) & 0x80) ? CC_V : 0) @@ -37,25 +37,25 @@ void mc68hc11_cpu_device::SET_PC(int pc) m_pc = pc; } -void mc68hc11_cpu_device::PUSH8(UINT8 value) +void mc68hc11_cpu_device::PUSH8(uint8_t value) { WRITE8(m_sp--, value); } -void mc68hc11_cpu_device::PUSH16(UINT16 value) +void mc68hc11_cpu_device::PUSH16(uint16_t value) { WRITE8(m_sp--, (value >> 0) & 0xff); WRITE8(m_sp--, (value >> 8) & 0xff); } -UINT8 mc68hc11_cpu_device::POP8() +uint8_t mc68hc11_cpu_device::POP8() { return READ8(++m_sp); } -UINT16 mc68hc11_cpu_device::POP16() +uint16_t mc68hc11_cpu_device::POP16() { - UINT16 r = 0; + uint16_t r = 0; r |= (READ8(++m_sp) << 8); r |= (READ8(++m_sp) << 0); return r; @@ -68,14 +68,14 @@ UINT16 mc68hc11_cpu_device::POP16() /* ABA 0x1B */ void HC11OP(aba)() { - UINT16 r = REG_A + REG_B; + uint16_t r = REG_A + REG_B; CLEAR_HNZVC(); SET_H(r, REG_B, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, REG_B, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(2); } @@ -99,79 +99,79 @@ void HC11OP(aby)() /* ADCA IMM 0x89 */ void HC11OP(adca_imm)() { - UINT8 i = FETCH(); - UINT16 r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); + uint8_t i = FETCH(); + uint16_t r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(2); } /* ADCA DIR 0x99 */ void HC11OP(adca_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT16 r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint16_t r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(3); } /* ADCA EXT 0xB9 */ void HC11OP(adca_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT16 r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint16_t r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(4); } /* ADCA IND, X 0xA9 */ void HC11OP(adca_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT16 r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint16_t r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(4); } /* ADCA IND, Y 0x18, 0xA9 */ void HC11OP(adca_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT16 r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint16_t r = REG_A + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(5); } @@ -179,79 +179,79 @@ void HC11OP(adca_indy)() /* ADCB IMM 0xC9 */ void HC11OP(adcb_imm)() { - UINT8 i = FETCH(); - UINT16 r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); + uint8_t i = FETCH(); + uint16_t r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(2); } /* ADCB DIR 0xD9 */ void HC11OP(adcb_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT16 r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint16_t r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(3); } /* ADCB EXT 0xF9 */ void HC11OP(adcb_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT16 r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint16_t r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(4); } /* ADCB IND, X 0xE9 */ void HC11OP(adcb_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT16 r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint16_t r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(4); } /* ADCB IND, Y 0x18, 0xE9 */ void HC11OP(adcb_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT16 r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint16_t r = REG_B + i + ((m_ccr & CC_C) ? 1 : 0); CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(5); } @@ -259,79 +259,79 @@ void HC11OP(adcb_indy)() /* ADDA IMM 0x8B */ void HC11OP(adda_imm)() { - UINT8 i = FETCH(); - UINT16 r = REG_A + i; + uint8_t i = FETCH(); + uint16_t r = REG_A + i; CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(2); } /* ADDA DIR 0x9B */ void HC11OP(adda_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT16 r = REG_A + i; + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint16_t r = REG_A + i; CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(3); } /* ADDA EXT 0xBB */ void HC11OP(adda_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT16 r = REG_A + i; + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint16_t r = REG_A + i; CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(4); } /* ADDA IND, X 0xAB */ void HC11OP(adda_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT16 r = REG_A + i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint16_t r = REG_A + i; CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(4); } /* ADDA IND, Y 0x18, 0xAB */ void HC11OP(adda_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT16 r = REG_A + i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint16_t r = REG_A + i; CLEAR_HNZVC(); SET_H(r, i, REG_A); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(5); } @@ -339,79 +339,79 @@ void HC11OP(adda_indy)() /* ADDB IMM 0xCB */ void HC11OP(addb_imm)() { - UINT8 i = FETCH(); - UINT16 r = REG_B + i; + uint8_t i = FETCH(); + uint16_t r = REG_B + i; CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(2); } /* ADDB DIR 0xDB */ void HC11OP(addb_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT16 r = REG_B + i; + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint16_t r = REG_B + i; CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(3); } /* ADDB EXT 0xFB */ void HC11OP(addb_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT16 r = REG_B + i; + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint16_t r = REG_B + i; CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(4); } /* ADDB IND, X 0xEB */ void HC11OP(addb_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT16 r = REG_B + i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint16_t r = REG_B + i; CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(4); } /* ADDB IND, Y 0x18, 0xEB */ void HC11OP(addb_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT16 r = REG_B + i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint16_t r = REG_B + i; CLEAR_HNZVC(); SET_H(r, i, REG_B); SET_N8(r); SET_Z8(r); SET_V_ADD8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(5); } @@ -419,74 +419,74 @@ void HC11OP(addb_indy)() /* ADDD IMM 0xC3 */ void HC11OP(addd_imm)() { - UINT16 i = FETCH16(); - UINT32 r = REG_D + i; + uint16_t i = FETCH16(); + uint32_t r = REG_D + i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_ADD16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(4); } /* ADDD DIR 0xD3 */ void HC11OP(addd_dir)() { - UINT8 d = FETCH(); - UINT16 i = READ16(d); - UINT32 r = REG_D + i; + uint8_t d = FETCH(); + uint16_t i = READ16(d); + uint32_t r = REG_D + i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_ADD16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(5); } /* ADDD EXT 0xF3 */ void HC11OP(addd_ext)() { - UINT16 adr = FETCH16(); - UINT16 i = READ16(adr); - UINT32 r = REG_D + i; + uint16_t adr = FETCH16(); + uint16_t i = READ16(adr); + uint32_t r = REG_D + i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_ADD16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(6); } /* ADDD IND, X 0xE3 */ void HC11OP(addd_indx)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_ix + offset); - UINT32 r = REG_D + i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_ix + offset); + uint32_t r = REG_D + i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_ADD16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(6); } /* ADDD IND, Y 0x18, 0xE3 */ void HC11OP(addd_indy)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_iy + offset); - UINT32 r = REG_D + i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_iy + offset); + uint32_t r = REG_D + i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_ADD16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(7); } @@ -494,7 +494,7 @@ void HC11OP(addd_indy)() /* ANDA IMM 0x84 */ void HC11OP(anda_imm)() { - UINT8 i = FETCH(); + uint8_t i = FETCH(); CLEAR_NZV(); REG_A &= i; SET_N8(REG_A); @@ -505,8 +505,8 @@ void HC11OP(anda_imm)() /* ANDA DIR 0x94 */ void HC11OP(anda_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); + uint8_t d = FETCH(); + uint8_t i = READ8(d); CLEAR_NZV(); REG_A &= i; SET_N8(REG_A); @@ -517,8 +517,8 @@ void HC11OP(anda_dir)() /* ANDA EXT 0xB4 */ void HC11OP(anda_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); CLEAR_NZV(); REG_A &= i; SET_N8(REG_A); @@ -529,8 +529,8 @@ void HC11OP(anda_ext)() /* ANDA IND, X 0xA4 */ void HC11OP(anda_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); CLEAR_NZV(); REG_A &= i; SET_N8(REG_A); @@ -541,8 +541,8 @@ void HC11OP(anda_indx)() /* ANDA IND, Y 0x18, 0xA4 */ void HC11OP(anda_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); CLEAR_NZV(); REG_A &= i; SET_N8(REG_A); @@ -554,7 +554,7 @@ void HC11OP(anda_indy)() /* ANDB IMM 0xC4 */ void HC11OP(andb_imm)() { - UINT8 i = FETCH(); + uint8_t i = FETCH(); CLEAR_NZV(); REG_B &= i; SET_N8(REG_B); @@ -565,8 +565,8 @@ void HC11OP(andb_imm)() /* ANDB DIR 0xD4 */ void HC11OP(andb_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); + uint8_t d = FETCH(); + uint8_t i = READ8(d); CLEAR_NZV(); REG_B &= i; SET_N8(REG_B); @@ -577,8 +577,8 @@ void HC11OP(andb_dir)() /* ANDB EXT 0xF4 */ void HC11OP(andb_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); CLEAR_NZV(); REG_B &= i; SET_N8(REG_B); @@ -589,8 +589,8 @@ void HC11OP(andb_ext)() /* ANDB IND, X 0xE4 */ void HC11OP(andb_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); CLEAR_NZV(); REG_B &= i; SET_N8(REG_B); @@ -601,8 +601,8 @@ void HC11OP(andb_indx)() /* ANDB IND, Y 0x18, 0xE4 */ void HC11OP(andb_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); CLEAR_NZV(); REG_B &= i; SET_N8(REG_B); @@ -613,10 +613,10 @@ void HC11OP(andb_indy)() /* ASLA 0x48 */ void HC11OP(asla)() { - UINT16 r = REG_A << 1; + uint16_t r = REG_A << 1; CLEAR_NZVC(); SET_C8(r); - REG_A = (UINT16)(r); + REG_A = (uint16_t)(r); SET_N8(REG_A); SET_Z8(REG_A); @@ -632,10 +632,10 @@ void HC11OP(asla)() /* ASLB 0x58 */ void HC11OP(aslb)() { - UINT16 r = REG_B << 1; + uint16_t r = REG_B << 1; CLEAR_NZVC(); SET_C8(r); - REG_B = (UINT16)(r); + REG_B = (uint16_t)(r); SET_N8(REG_B); SET_Z8(REG_B); @@ -651,9 +651,9 @@ void HC11OP(aslb)() /* ASL EXT 0x78 */ void HC11OP(asl_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT16 r = i << 1; + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint16_t r = i << 1; CLEAR_NZVC(); SET_C8(r); WRITE8(adr, r); @@ -672,8 +672,8 @@ void HC11OP(asl_ext)() /* BITA IMM 0x85 */ void HC11OP(bita_imm)() { - UINT8 i = FETCH(); - UINT8 r = REG_A & i; + uint8_t i = FETCH(); + uint8_t r = REG_A & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -683,9 +683,9 @@ void HC11OP(bita_imm)() /* BITA DIR 0x95 */ void HC11OP(bita_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT8 r = REG_A & i; + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint8_t r = REG_A & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -695,9 +695,9 @@ void HC11OP(bita_dir)() /* BITA EXT 0xB5 */ void HC11OP(bita_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT8 r = REG_A & i; + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint8_t r = REG_A & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -707,9 +707,9 @@ void HC11OP(bita_ext)() /* BITA IND, X 0xA5 */ void HC11OP(bita_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT8 r = REG_A & i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint8_t r = REG_A & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -719,9 +719,9 @@ void HC11OP(bita_indx)() /* BITA IND, Y 0x18, 0xA5 */ void HC11OP(bita_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT8 r = REG_A & i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint8_t r = REG_A & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -732,8 +732,8 @@ void HC11OP(bita_indy)() /* BITB IMM 0xC5 */ void HC11OP(bitb_imm)() { - UINT8 i = FETCH(); - UINT8 r = REG_B & i; + uint8_t i = FETCH(); + uint8_t r = REG_B & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -743,9 +743,9 @@ void HC11OP(bitb_imm)() /* BITB DIR 0xD5 */ void HC11OP(bitb_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT8 r = REG_B & i; + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint8_t r = REG_B & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -755,9 +755,9 @@ void HC11OP(bitb_dir)() /* BITB EXT 0xF5 */ void HC11OP(bitb_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT8 r = REG_B & i; + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint8_t r = REG_B & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -767,9 +767,9 @@ void HC11OP(bitb_ext)() /* BITB IND, X 0xE5 */ void HC11OP(bitb_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT8 r = REG_B & i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint8_t r = REG_B & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -779,9 +779,9 @@ void HC11OP(bitb_indx)() /* BITB IND, Y 0x18, 0xE5 */ void HC11OP(bitb_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT8 r = REG_B & i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint8_t r = REG_B & i; CLEAR_NZV(); SET_N8(r); SET_Z8(r); @@ -791,7 +791,7 @@ void HC11OP(bitb_indy)() /* BCC 0x24 */ void HC11OP(bcc)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if ((m_ccr & CC_C) == 0) /* Branch if C flag clear */ { SET_PC(m_ppc + rel + 2); @@ -802,9 +802,9 @@ void HC11OP(bcc)() /* BCLR DIR 0x15 */ void HC11OP(bclr_dir)() { - UINT8 d = FETCH(); - UINT8 mask = FETCH(); - UINT8 r = READ8(d) & ~mask; + uint8_t d = FETCH(); + uint8_t mask = FETCH(); + uint8_t r = READ8(d) & ~mask; WRITE8(d, r); CLEAR_NZV(); SET_N8(r); @@ -815,9 +815,9 @@ void HC11OP(bclr_dir)() /* BCLR INDX 0x1d */ void HC11OP(bclr_indx)() { - UINT8 offset = FETCH(); - UINT8 mask = FETCH(); - UINT8 r = READ8(m_ix + offset) & ~mask; + uint8_t offset = FETCH(); + uint8_t mask = FETCH(); + uint8_t r = READ8(m_ix + offset) & ~mask; WRITE8(m_ix + offset, r); CLEAR_NZV(); SET_N8(r); @@ -829,7 +829,7 @@ void HC11OP(bclr_indx)() /* BCS 0x25 */ void HC11OP(bcs)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if (m_ccr & CC_C) /* Branch if C flag set */ { SET_PC(m_ppc + rel + 2); @@ -841,7 +841,7 @@ void HC11OP(bcs)() /* BEQ 0x27 */ void HC11OP(beq)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if (m_ccr & CC_Z) /* Branch if Z flag set */ { SET_PC(m_ppc + rel + 2); @@ -853,7 +853,7 @@ void HC11OP(beq)() /* BHI 0x22 */ void HC11OP(bhi)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if (((m_ccr & CC_C) == 0) && ((m_ccr & CC_Z) == 0)) /* Branch if C and Z flag clear */ { SET_PC(m_ppc + rel + 2); @@ -865,7 +865,7 @@ void HC11OP(bhi)() /* BNE 0x26 */ void HC11OP(bne)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if ((m_ccr & CC_Z) == 0) /* Branch if Z flag clear */ { SET_PC(m_ppc + rel + 2); @@ -877,9 +877,9 @@ void HC11OP(bne)() /* BLE 0x2F */ void HC11OP(ble)() { - UINT8 n = (m_ccr & CC_N) ? 1 : 0; - UINT8 v = (m_ccr & CC_V) ? 1 : 0; - INT8 rel = FETCH(); + uint8_t n = (m_ccr & CC_N) ? 1 : 0; + uint8_t v = (m_ccr & CC_V) ? 1 : 0; + int8_t rel = FETCH(); if ((m_ccr & CC_Z) || (n ^ v)) /* Branch if Z flag set or (N ^ V) */ { SET_PC(m_ppc + rel + 2); @@ -890,7 +890,7 @@ void HC11OP(ble)() /* BLS 0x23 */ void HC11OP(bls)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if (m_ccr & CC_C || m_ccr & CC_Z) /* Branch if C or Z flag set */ { SET_PC(m_ppc + rel + 2); @@ -901,7 +901,7 @@ void HC11OP(bls)() /* BMI 0x2B */ void HC11OP(bmi)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if (m_ccr & CC_N) /* Branch if N flag set */ { SET_PC(m_ppc + rel + 2); @@ -912,7 +912,7 @@ void HC11OP(bmi)() /* BPL 0x2A */ void HC11OP(bpl)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if ((m_ccr & CC_N) == 0) /* Branch if N flag clear */ { SET_PC(m_ppc + rel + 2); @@ -924,7 +924,7 @@ void HC11OP(bpl)() /* BRA 0x20 */ void HC11OP(bra)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); SET_PC(m_ppc + rel + 2); CYCLES(3); } @@ -932,10 +932,10 @@ void HC11OP(bra)() /* BRCLR DIR 0x13 */ void HC11OP(brclr_dir)() { - UINT8 d = FETCH(); - UINT8 mask = FETCH(); - INT8 rel = FETCH(); - UINT8 i = READ8(d); + uint8_t d = FETCH(); + uint8_t mask = FETCH(); + int8_t rel = FETCH(); + uint8_t i = READ8(d); if ((i & mask) == 0) { @@ -949,10 +949,10 @@ void HC11OP(brclr_dir)() /* BRCLR INDX 0x1F */ void HC11OP(brclr_indx)() { - UINT8 offset = FETCH(); - UINT8 mask = FETCH(); - INT8 rel = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t mask = FETCH(); + int8_t rel = FETCH(); + uint8_t i = READ8(m_ix + offset); if ((i & mask) == 0) { @@ -965,10 +965,10 @@ void HC11OP(brclr_indx)() /* BRSET DIR 0x12 */ void HC11OP(brset_dir)() { - UINT8 d = FETCH(); - UINT8 mask = FETCH(); - INT8 rel = FETCH(); - UINT8 i = READ8(d); + uint8_t d = FETCH(); + uint8_t mask = FETCH(); + int8_t rel = FETCH(); + uint8_t i = READ8(d); if(i & mask) { @@ -982,10 +982,10 @@ void HC11OP(brset_dir)() /* BRSET INDX 0x1E */ void HC11OP(brset_indx)() { - UINT8 offset = FETCH(); - UINT8 mask = FETCH(); - INT8 rel = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t mask = FETCH(); + int8_t rel = FETCH(); + uint8_t i = READ8(m_ix + offset); if ((~i & mask) == 0) { @@ -1007,9 +1007,9 @@ void HC11OP(brn)() /* BSET DIR 0x14 */ void HC11OP(bset_dir)() { - UINT8 d = FETCH(); - UINT8 mask = FETCH(); - UINT8 r = READ8(d) | mask; + uint8_t d = FETCH(); + uint8_t mask = FETCH(); + uint8_t r = READ8(d) | mask; WRITE8(d, r); CLEAR_NZV(); SET_N8(r); @@ -1020,9 +1020,9 @@ void HC11OP(bset_dir)() /* BSET INDX 0x1c */ void HC11OP(bset_indx)() { - UINT8 offset = FETCH(); - UINT8 mask = FETCH(); - UINT8 r = READ8(m_ix + offset) | mask; + uint8_t offset = FETCH(); + uint8_t mask = FETCH(); + uint8_t r = READ8(m_ix + offset) | mask; WRITE8(m_ix + offset, r); CLEAR_NZV(); SET_N8(r); @@ -1034,8 +1034,8 @@ void HC11OP(bset_indx)() /* BSR 0x8D */ void HC11OP(bsr)() { - INT8 rel = FETCH(); - UINT16 rt_adr = m_pc; + int8_t rel = FETCH(); + uint16_t rt_adr = m_pc; PUSH16(rt_adr); SET_PC(m_ppc + rel + 2); CYCLES(6); @@ -1044,7 +1044,7 @@ void HC11OP(bsr)() /* BVC 0x28 */ void HC11OP(bvc)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if ((m_ccr & CC_V) == 0) /* Branch if V flag clear */ { SET_PC(m_ppc + rel + 2); @@ -1055,7 +1055,7 @@ void HC11OP(bvc)() /* BVS 0x29 */ void HC11OP(bvs)() { - INT8 rel = FETCH(); + int8_t rel = FETCH(); if (m_ccr & CC_V) /* Branch if V flag set */ { SET_PC(m_ppc + rel + 2); @@ -1066,7 +1066,7 @@ void HC11OP(bvs)() /* CBA 0x11 */ void HC11OP(cba)() { - UINT16 r = REG_A - REG_B; + uint16_t r = REG_A - REG_B; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1112,7 +1112,7 @@ void HC11OP(clrb)() /* CLR EXT 0x7F */ void HC11OP(clr_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); WRITE8(adr, 0); CLEAR_NZVC(); SET_ZFLAG(); @@ -1122,7 +1122,7 @@ void HC11OP(clr_ext)() /* CLR IND, X 0x6F */ void HC11OP(clr_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); WRITE8(m_ix + offset, 0); CLEAR_NZVC(); SET_ZFLAG(); @@ -1132,7 +1132,7 @@ void HC11OP(clr_indx)() /* CLR IND, Y 0x18, 0x6F */ void HC11OP(clr_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); WRITE8(m_iy + offset, 0); CLEAR_NZVC(); SET_ZFLAG(); @@ -1151,8 +1151,8 @@ void HC11OP(clv)() /* CMPA IMM 0x81 */ void HC11OP(cmpa_imm)() { - UINT8 i = FETCH(); - UINT16 r = REG_A - i; + uint8_t i = FETCH(); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1164,9 +1164,9 @@ void HC11OP(cmpa_imm)() /* CMPA DIR 0x91 */ void HC11OP(cmpa_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT16 r = REG_A - i; + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1178,9 +1178,9 @@ void HC11OP(cmpa_dir)() /* CMPA EXT 0xB1 */ void HC11OP(cmpa_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT16 r = REG_A - i; + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1192,9 +1192,9 @@ void HC11OP(cmpa_ext)() /* CMPA IND, X 0xA1 */ void HC11OP(cmpa_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT16 r = REG_A - i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1206,9 +1206,9 @@ void HC11OP(cmpa_indx)() /* CMPA IND, Y 0x18, 0xA1 */ void HC11OP(cmpa_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT16 r = REG_A - i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1221,8 +1221,8 @@ void HC11OP(cmpa_indy)() /* CMPB IMM 0xC1 */ void HC11OP(cmpb_imm)() { - UINT8 i = FETCH(); - UINT16 r = REG_B - i; + uint8_t i = FETCH(); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1234,9 +1234,9 @@ void HC11OP(cmpb_imm)() /* CMPB DIR 0xD1 */ void HC11OP(cmpb_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT16 r = REG_B - i; + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1248,9 +1248,9 @@ void HC11OP(cmpb_dir)() /* CMPB EXT 0xF1 */ void HC11OP(cmpb_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT16 r = REG_B - i; + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1262,9 +1262,9 @@ void HC11OP(cmpb_ext)() /* CMPB IND, X 0xE1 */ void HC11OP(cmpb_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT16 r = REG_B - i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1276,9 +1276,9 @@ void HC11OP(cmpb_indx)() /* CMPB IND, Y 0x18, 0xE1 */ void HC11OP(cmpb_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT16 r = REG_B - i; + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1291,7 +1291,7 @@ void HC11OP(cmpb_indy)() /* COMA , 0x43 */ void HC11OP(coma)() { - UINT16 r = 0xff - REG_A; + uint16_t r = 0xff - REG_A; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1304,7 +1304,7 @@ void HC11OP(coma)() /* COMB , 0x53 */ void HC11OP(comb)() { - UINT16 r = 0xff - REG_B; + uint16_t r = 0xff - REG_B; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); @@ -1317,8 +1317,8 @@ void HC11OP(comb)() /* CPD IMM 0x1A, 0x83 */ void HC11OP(cpd_imm)() { - UINT16 i = FETCH16(); - UINT32 r = REG_D - i; + uint16_t i = FETCH16(); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1330,9 +1330,9 @@ void HC11OP(cpd_imm)() /* CPD DIR 0x1A, 0x93 */ void HC11OP(cpd_dir)() { - UINT8 d = FETCH(); - UINT16 i = READ16(d); - UINT32 r = REG_D - i; + uint8_t d = FETCH(); + uint16_t i = READ16(d); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1344,9 +1344,9 @@ void HC11OP(cpd_dir)() /* CPD EXT 0x1A, 0xB3 */ void HC11OP(cpd_ext)() { - UINT16 adr = FETCH16(); - UINT16 i = READ16(adr); - UINT32 r = REG_D - i; + uint16_t adr = FETCH16(); + uint16_t i = READ16(adr); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1358,9 +1358,9 @@ void HC11OP(cpd_ext)() /* CPD IND, X 0x1A, 0xA3 */ void HC11OP(cpd_indx)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_ix + offset); - UINT32 r = REG_D - i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_ix + offset); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1372,9 +1372,9 @@ void HC11OP(cpd_indx)() /* CPD IND, Y 0xCD, 0xA3 */ void HC11OP(cpd_indy)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_iy + offset); - UINT32 r = REG_D - i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_iy + offset); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1387,8 +1387,8 @@ void HC11OP(cpd_indy)() /* CPX IMM 0x8C */ void HC11OP(cpx_imm)() { - UINT16 i = FETCH16(); - UINT32 r = m_ix - i; + uint16_t i = FETCH16(); + uint32_t r = m_ix - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1400,9 +1400,9 @@ void HC11OP(cpx_imm)() /* CPX DIR 0x9C */ void HC11OP(cpx_dir)() { - UINT8 d = FETCH(); - UINT16 i = READ16(d); - UINT32 r = m_ix - i; + uint8_t d = FETCH(); + uint16_t i = READ16(d); + uint32_t r = m_ix - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1414,9 +1414,9 @@ void HC11OP(cpx_dir)() /* CPX EXT 0xBC */ void HC11OP(cpx_ext)() { - UINT16 adr = FETCH16(); - UINT16 i = READ16(adr); - UINT32 r = m_ix - i; + uint16_t adr = FETCH16(); + uint16_t i = READ16(adr); + uint32_t r = m_ix - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1428,9 +1428,9 @@ void HC11OP(cpx_ext)() /* CPX IND, X 0xAC */ void HC11OP(cpx_indx)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_ix + offset); - UINT32 r = m_ix - i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_ix + offset); + uint32_t r = m_ix - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1442,9 +1442,9 @@ void HC11OP(cpx_indx)() /* CPX IND, Y 0xCD, 0xAC */ void HC11OP(cpx_indy)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_iy + offset); - UINT32 r = m_ix - i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_iy + offset); + uint32_t r = m_ix - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1456,8 +1456,8 @@ void HC11OP(cpx_indy)() /* CPY IMM 0x18, 0x8C */ void HC11OP(cpy_imm)() { - UINT16 i = FETCH16(); - UINT32 r = m_iy - i; + uint16_t i = FETCH16(); + uint32_t r = m_iy - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1469,9 +1469,9 @@ void HC11OP(cpy_imm)() /* CPY DIR 0x18 0x9C */ void HC11OP(cpy_dir)() { - UINT8 d = FETCH(); - UINT16 i = READ16(d); - UINT32 r = m_iy - i; + uint8_t d = FETCH(); + uint16_t i = READ16(d); + uint32_t r = m_iy - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1483,9 +1483,9 @@ void HC11OP(cpy_dir)() /* CPY EXT 0x18 0xBC */ void HC11OP(cpy_ext)() { - UINT16 adr = FETCH16(); - UINT16 i = READ16(adr); - UINT32 r = m_iy - i; + uint16_t adr = FETCH16(); + uint16_t i = READ16(adr); + uint32_t r = m_iy - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1497,9 +1497,9 @@ void HC11OP(cpy_ext)() /* CPY IND, X 0x1A 0xAC */ void HC11OP(cpy_indx)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_ix + offset); - UINT32 r = m_iy - i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_ix + offset); + uint32_t r = m_iy - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1511,9 +1511,9 @@ void HC11OP(cpy_indx)() /* CPY IND, Y 0x18 0xAC */ void HC11OP(cpy_indy)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_iy + offset); - UINT32 r = m_iy - i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_iy + offset); + uint32_t r = m_iy - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); @@ -1549,8 +1549,8 @@ void HC11OP(decb)() /* DEC EXT 0x7A */ void HC11OP(dec_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); CLEAR_NZV(); if (i == 0x80) @@ -1565,8 +1565,8 @@ void HC11OP(dec_ext)() /* DEC INDX 0x6A */ void HC11OP(dec_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); CLEAR_NZV(); if (i == 0x80) @@ -1581,8 +1581,8 @@ void HC11OP(dec_indx)() /* DEC INDY 0x18 0x6A */ void HC11OP(dec_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); CLEAR_NZV(); if (i == 0x80) @@ -1617,7 +1617,7 @@ void HC11OP(dey)() /* EORA IMM 0x88 */ void HC11OP(eora_imm)() { - UINT8 i = FETCH(); + uint8_t i = FETCH(); CLEAR_NZV(); REG_A ^= i; SET_N8(REG_A); @@ -1628,8 +1628,8 @@ void HC11OP(eora_imm)() /* EORA DIR 0x98 */ void HC11OP(eora_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); + uint8_t d = FETCH(); + uint8_t i = READ8(d); CLEAR_NZV(); REG_A ^= i; SET_N8(REG_A); @@ -1640,8 +1640,8 @@ void HC11OP(eora_dir)() /* EORA EXT 0xB8 */ void HC11OP(eora_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); CLEAR_NZV(); REG_A ^= i; SET_N8(REG_A); @@ -1652,8 +1652,8 @@ void HC11OP(eora_ext)() /* EORA IND, X 0xA8 */ void HC11OP(eora_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); CLEAR_NZV(); REG_A ^= i; SET_N8(REG_A); @@ -1664,8 +1664,8 @@ void HC11OP(eora_indx)() /* EORA IND, Y 0x18, 0xA8 */ void HC11OP(eora_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); CLEAR_NZV(); REG_A ^= i; SET_N8(REG_A); @@ -1677,7 +1677,7 @@ void HC11OP(eora_indy)() /* EORB IMM 0xC8 */ void HC11OP(eorb_imm)() { - UINT8 i = FETCH(); + uint8_t i = FETCH(); CLEAR_NZV(); REG_B ^= i; SET_N8(REG_B); @@ -1688,8 +1688,8 @@ void HC11OP(eorb_imm)() /* EORB DIR 0xD8 */ void HC11OP(eorb_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); + uint8_t d = FETCH(); + uint8_t i = READ8(d); CLEAR_NZV(); REG_B ^= i; SET_N8(REG_B); @@ -1700,8 +1700,8 @@ void HC11OP(eorb_dir)() /* EORB EXT 0xF8 */ void HC11OP(eorb_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); CLEAR_NZV(); REG_B ^= i; SET_N8(REG_B); @@ -1712,8 +1712,8 @@ void HC11OP(eorb_ext)() /* EORB IND, X 0xE8 */ void HC11OP(eorb_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); CLEAR_NZV(); REG_B ^= i; SET_N8(REG_B); @@ -1724,8 +1724,8 @@ void HC11OP(eorb_indx)() /* EORB IND, Y 0x18, 0xE8 */ void HC11OP(eorb_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); CLEAR_NZV(); REG_B ^= i; SET_N8(REG_B); @@ -1736,10 +1736,10 @@ void HC11OP(eorb_indy)() /* IDIV 0x02 */ void HC11OP(idiv)() { - UINT16 numerator = REG_D; - UINT16 denominator = m_ix; - UINT16 remainder; - UINT16 result; + uint16_t numerator = REG_D; + uint16_t denominator = m_ix; + uint16_t remainder; + uint16_t result; CLEAR_ZVC(); if(denominator == 0) // divide by zero behaviour @@ -1788,8 +1788,8 @@ void HC11OP(incb)() /* INC EXT 0x7C */ void HC11OP(inc_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); CLEAR_NZV(); if (i == 0x7f) @@ -1804,8 +1804,8 @@ void HC11OP(inc_ext)() /* INC INDX 0x6C */ void HC11OP(inc_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); CLEAR_NZV(); if (i == 0x7f) @@ -1821,8 +1821,8 @@ void HC11OP(inc_indx)() /* INC INDY 0x18 0x6C */ void HC11OP(inc_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); CLEAR_NZV(); if (i == 0x7f) @@ -1856,7 +1856,7 @@ void HC11OP(iny)() /* JMP IND X 0x6E */ void HC11OP(jmp_indx)() { - UINT16 adr = FETCH(); + uint16_t adr = FETCH(); SET_PC(m_ix + adr); CYCLES(3); } @@ -1864,7 +1864,7 @@ void HC11OP(jmp_indx)() /* JMP IND Y 0x18 0x6E */ void HC11OP(jmp_indy)() { - UINT16 adr = FETCH(); + uint16_t adr = FETCH(); SET_PC(m_iy + adr); CYCLES(4); } @@ -1872,7 +1872,7 @@ void HC11OP(jmp_indy)() /* JMP EXT 0x7E */ void HC11OP(jmp_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); SET_PC(adr); CYCLES(3); } @@ -1881,8 +1881,8 @@ void HC11OP(jmp_ext)() /* JSR DIR 0x9D */ void HC11OP(jsr_dir)() { - UINT8 i = FETCH(); - UINT16 rt_adr = m_pc; + uint8_t i = FETCH(); + uint16_t rt_adr = m_pc; PUSH16(rt_adr); SET_PC(i); CYCLES(5); @@ -1891,8 +1891,8 @@ void HC11OP(jsr_dir)() /* JSR EXT 0xBD */ void HC11OP(jsr_ext)() { - UINT16 adr = FETCH16(); - UINT16 rt_adr = m_pc; + uint16_t adr = FETCH16(); + uint16_t rt_adr = m_pc; PUSH16(rt_adr); SET_PC(adr); CYCLES(6); @@ -1901,8 +1901,8 @@ void HC11OP(jsr_ext)() /* JSR IND, X 0xAD */ void HC11OP(jsr_indx)() { - UINT8 offset = FETCH(); - UINT16 rt_adr = m_pc; + uint8_t offset = FETCH(); + uint16_t rt_adr = m_pc; PUSH16(rt_adr); SET_PC(m_ix + offset); CYCLES(6); @@ -1911,8 +1911,8 @@ void HC11OP(jsr_indx)() /* JSR IND, Y 0x18, 0xAD */ void HC11OP(jsr_indy)() { - UINT8 offset = FETCH(); - UINT16 rt_adr = m_pc; + uint8_t offset = FETCH(); + uint16_t rt_adr = m_pc; PUSH16(rt_adr); SET_PC(m_iy + offset); CYCLES(6); @@ -1932,7 +1932,7 @@ void HC11OP(ldaa_imm)() /* LDAA DIR 0x96 */ void HC11OP(ldaa_dir)() { - UINT8 d = FETCH(); + uint8_t d = FETCH(); CLEAR_NZV(); REG_A = READ8(d); SET_N8(REG_A); @@ -1943,7 +1943,7 @@ void HC11OP(ldaa_dir)() /* LDAA EXT 0xB6 */ void HC11OP(ldaa_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); CLEAR_NZV(); REG_A = READ8(adr); SET_N8(REG_A); @@ -1954,7 +1954,7 @@ void HC11OP(ldaa_ext)() /* LDAA IND, X 0xA6 */ void HC11OP(ldaa_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); REG_A = READ8(m_ix + offset); SET_N8(REG_A); @@ -1965,7 +1965,7 @@ void HC11OP(ldaa_indx)() /* LDAA IND, Y 0x18, 0xA6 */ void HC11OP(ldaa_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); REG_A = READ8(m_iy + offset); SET_N8(REG_A); @@ -1986,7 +1986,7 @@ void HC11OP(ldab_imm)() /* LDAB DIR 0xD6 */ void HC11OP(ldab_dir)() { - UINT8 d = FETCH(); + uint8_t d = FETCH(); CLEAR_NZV(); REG_B = READ8(d); SET_N8(REG_B); @@ -1997,7 +1997,7 @@ void HC11OP(ldab_dir)() /* LDAB EXT 0xF6 */ void HC11OP(ldab_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); CLEAR_NZV(); REG_B = READ8(adr); SET_N8(REG_B); @@ -2008,7 +2008,7 @@ void HC11OP(ldab_ext)() /* LDAB IND, X 0xE6 */ void HC11OP(ldab_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); REG_B = READ8(m_ix + offset); SET_N8(REG_B); @@ -2019,7 +2019,7 @@ void HC11OP(ldab_indx)() /* LDAB IND, Y 0x18, 0xE6 */ void HC11OP(ldab_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); REG_B = READ8(m_iy + offset); SET_N8(REG_B); @@ -2041,7 +2041,7 @@ void HC11OP(ldd_imm)() /* LDD DIR 0xDC */ void HC11OP(ldd_dir)() { - UINT8 d = FETCH(); + uint8_t d = FETCH(); CLEAR_NZV(); REG_D = READ16(d); SET_N16(REG_D); @@ -2052,7 +2052,7 @@ void HC11OP(ldd_dir)() /* LDD EXT 0xFC */ void HC11OP(ldd_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); CLEAR_NZV(); REG_D = READ16(adr); SET_N16(REG_D); @@ -2063,7 +2063,7 @@ void HC11OP(ldd_ext)() /* LDD IND, X 0xEC */ void HC11OP(ldd_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); REG_D = READ16(m_ix + offset); SET_N16(REG_D); @@ -2074,7 +2074,7 @@ void HC11OP(ldd_indx)() /* LDD IND, Y 0x18, 0xEC */ void HC11OP(ldd_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); REG_D = READ16(m_iy + offset); SET_N16(REG_D); @@ -2096,7 +2096,7 @@ void HC11OP(lds_imm)() /* LDS DIR 0x9E */ void HC11OP(lds_dir)() { - UINT8 i = FETCH(); + uint8_t i = FETCH(); CLEAR_NZV(); m_sp = READ16(i); SET_N16(m_sp); @@ -2107,7 +2107,7 @@ void HC11OP(lds_dir)() /* LDS EXT 0xBE */ void HC11OP(lds_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); CLEAR_NZV(); m_sp = READ16(adr); SET_N16(m_sp); @@ -2118,7 +2118,7 @@ void HC11OP(lds_ext)() /* LDS IND, X 0xAE */ void HC11OP(lds_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); m_sp = READ16(m_ix + offset); SET_N16(m_sp); @@ -2129,7 +2129,7 @@ void HC11OP(lds_indx)() /* LDS IND, Y 0x18, 0xAE */ void HC11OP(lds_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); m_sp = READ16(m_iy + offset); SET_N16(m_sp); @@ -2151,7 +2151,7 @@ void HC11OP(ldx_imm)() /* LDX DIR 0xDE */ void HC11OP(ldx_dir)() { - UINT8 d = FETCH(); + uint8_t d = FETCH(); CLEAR_NZV(); m_ix = READ16(d); SET_N16(m_ix); @@ -2162,7 +2162,7 @@ void HC11OP(ldx_dir)() /* LDX EXT 0xFE */ void HC11OP(ldx_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); CLEAR_NZV(); m_ix = READ16(adr); SET_N16(m_ix); @@ -2173,7 +2173,7 @@ void HC11OP(ldx_ext)() /* LDX IND, X 0xEE */ void HC11OP(ldx_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); m_ix = READ16(m_ix + offset); SET_N16(m_ix); @@ -2184,7 +2184,7 @@ void HC11OP(ldx_indx)() /* LDX IND, Y 0xCD, 0xEE */ void HC11OP(ldx_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); m_ix = READ16(m_iy + offset); SET_N16(m_ix); @@ -2206,7 +2206,7 @@ void HC11OP(ldy_imm)() /* LDY DIR 0x18, 0xDE */ void HC11OP(ldy_dir)() { - UINT8 d = FETCH(); + uint8_t d = FETCH(); CLEAR_NZV(); m_iy = READ16(d); SET_N16(m_iy); @@ -2217,7 +2217,7 @@ void HC11OP(ldy_dir)() /* LDY EXT 0x18, 0xFE */ void HC11OP(ldy_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); CLEAR_NZV(); m_iy = READ16(adr); SET_N16(m_iy); @@ -2228,7 +2228,7 @@ void HC11OP(ldy_ext)() /* LDY IND, X 0x1A, 0xEE */ void HC11OP(ldy_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); m_iy = READ16(m_ix + offset); SET_N16(m_iy); @@ -2239,7 +2239,7 @@ void HC11OP(ldy_indx)() /* LDY IND, Y 0x18, 0xEE */ void HC11OP(ldy_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); m_iy = READ16(m_iy + offset); SET_N16(m_iy); @@ -2250,10 +2250,10 @@ void HC11OP(ldy_indy)() /* LSLD 0x05 */ void HC11OP(lsld)() { - UINT32 r = REG_D << 1; + uint32_t r = REG_D << 1; CLEAR_NZVC(); SET_C16(r); - REG_D = (UINT16)(r); + REG_D = (uint16_t)(r); SET_N16(REG_D); SET_Z16(REG_D); @@ -2269,10 +2269,10 @@ void HC11OP(lsld)() /* LSRA 0x44 */ void HC11OP(lsra)() { - UINT16 r = REG_A >> 1; + uint16_t r = REG_A >> 1; CLEAR_NZVC(); m_ccr |= (REG_A & 1) ? CC_C : 0; - REG_A = (UINT8)(r); + REG_A = (uint8_t)(r); m_ccr |= ((m_ccr & CC_C)) ? CC_V : 0; SET_Z8(REG_A); @@ -2282,10 +2282,10 @@ void HC11OP(lsra)() /* LSRB 0x54 */ void HC11OP(lsrb)() { - UINT16 r = REG_B >> 1; + uint16_t r = REG_B >> 1; CLEAR_NZVC(); m_ccr |= (REG_B & 1) ? CC_C : 0; - REG_B = (UINT8)(r); + REG_B = (uint8_t)(r); m_ccr |= ((m_ccr & CC_C)) ? CC_V : 0; SET_Z8(REG_B); @@ -2295,10 +2295,10 @@ void HC11OP(lsrb)() /* LSRD 0x04 */ void HC11OP(lsrd)() { - UINT32 r = REG_D >> 1; + uint32_t r = REG_D >> 1; CLEAR_NZVC(); m_ccr |= (REG_D & 1) ? CC_C : 0; - REG_D = (UINT16)(r); + REG_D = (uint16_t)(r); m_ccr |= ((m_ccr & CC_C)) ? CC_V : 0; SET_N16(REG_D); @@ -2344,8 +2344,8 @@ void HC11OP(negb)() /* NEG EXT 0x70 */ void HC11OP(neg_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = 0x00 - READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = 0x00 - READ8(adr); CLEAR_NZVC(); SET_N8(i); SET_Z8(i); @@ -2359,8 +2359,8 @@ void HC11OP(neg_ext)() /* NEG INDX 0x60 */ void HC11OP(neg_indx)() { - UINT16 offset = FETCH(); - UINT8 i = 0x00 - READ8(m_ix + offset); + uint16_t offset = FETCH(); + uint8_t i = 0x00 - READ8(m_ix + offset); CLEAR_NZVC(); SET_N8(i); SET_Z8(i); @@ -2374,8 +2374,8 @@ void HC11OP(neg_indx)() /* NEG INDY 0x18 0x60 */ void HC11OP(neg_indy)() { - UINT16 offset = FETCH(); - UINT8 i = 0x00 - READ8(m_iy + offset); + uint16_t offset = FETCH(); + uint8_t i = 0x00 - READ8(m_iy + offset); CLEAR_NZVC(); SET_N8(i); SET_Z8(i); @@ -2402,7 +2402,7 @@ void HC11OP(psha)() /* ORAA IMM 0x8A */ void HC11OP(oraa_imm)() { - UINT8 i = FETCH(); + uint8_t i = FETCH(); CLEAR_NZV(); REG_A |= i; SET_N8(REG_A); @@ -2413,8 +2413,8 @@ void HC11OP(oraa_imm)() /* ORAA DIR 0x9A */ void HC11OP(oraa_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); + uint8_t d = FETCH(); + uint8_t i = READ8(d); CLEAR_NZV(); REG_A |= i; SET_N8(REG_A); @@ -2425,8 +2425,8 @@ void HC11OP(oraa_dir)() /* ORAA EXT 0xBA */ void HC11OP(oraa_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); CLEAR_NZV(); REG_A |= i; SET_N8(REG_A); @@ -2437,8 +2437,8 @@ void HC11OP(oraa_ext)() /* ORAA IND, X 0xAA */ void HC11OP(oraa_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); CLEAR_NZV(); REG_A |= i; SET_N8(REG_A); @@ -2449,8 +2449,8 @@ void HC11OP(oraa_indx)() /* ORAA IND, Y 0x18, 0xAA */ void HC11OP(oraa_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); CLEAR_NZV(); REG_A |= i; SET_N8(REG_A); @@ -2462,7 +2462,7 @@ void HC11OP(oraa_indy)() /* ORAB IMM 0xCA */ void HC11OP(orab_imm)() { - UINT8 i = FETCH(); + uint8_t i = FETCH(); CLEAR_NZV(); REG_B |= i; SET_N8(REG_B); @@ -2473,8 +2473,8 @@ void HC11OP(orab_imm)() /* ORAB DIR 0xDA */ void HC11OP(orab_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); + uint8_t d = FETCH(); + uint8_t i = READ8(d); CLEAR_NZV(); REG_B |= i; SET_N8(REG_B); @@ -2485,8 +2485,8 @@ void HC11OP(orab_dir)() /* ORAB EXT 0xFA */ void HC11OP(orab_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); CLEAR_NZV(); REG_B |= i; SET_N8(REG_B); @@ -2497,8 +2497,8 @@ void HC11OP(orab_ext)() /* ORAB IND, X 0xEA */ void HC11OP(orab_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); CLEAR_NZV(); REG_B |= i; SET_N8(REG_B); @@ -2509,8 +2509,8 @@ void HC11OP(orab_indx)() /* ORAB IND, Y 0x18, 0xEA */ void HC11OP(orab_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); CLEAR_NZV(); REG_B |= i; SET_N8(REG_B); @@ -2577,10 +2577,10 @@ void HC11OP(puly)() /* ROLA 0x49 */ void HC11OP(rola)() { - UINT16 r = ((REG_A & 0x7f) << 1) | ((m_ccr & CC_C) ? 1 : 0); + uint16_t r = ((REG_A & 0x7f) << 1) | ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); m_ccr |= (REG_A & 0x80) ? CC_C : 0; - REG_A = (UINT8)(r); + REG_A = (uint8_t)(r); SET_N8(REG_A); SET_Z8(REG_A); @@ -2596,10 +2596,10 @@ void HC11OP(rola)() /* ROLB 0x59 */ void HC11OP(rolb)() { - UINT16 r = ((REG_B & 0x7f) << 1) | ((m_ccr & CC_C) ? 1 : 0); + uint16_t r = ((REG_B & 0x7f) << 1) | ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); m_ccr |= (REG_B & 0x80) ? CC_C : 0; - REG_B = (UINT8)(r); + REG_B = (uint8_t)(r); SET_N8(REG_B); SET_Z8(REG_B); @@ -2615,9 +2615,9 @@ void HC11OP(rolb)() /* ROL EXT 0x79 */ void HC11OP(rol_ext)() { - UINT16 adr = FETCH16(); - UINT8 r = READ8(adr); - UINT8 c = (r & 0x80); + uint16_t adr = FETCH16(); + uint8_t r = READ8(adr); + uint8_t c = (r & 0x80); r = ((r & 0x7f) << 1) | ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); m_ccr |= (c & 0x80) ? CC_C : 0; @@ -2637,9 +2637,9 @@ void HC11OP(rol_ext)() /* ROL INDX 0x69 */ void HC11OP(rol_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT8 c = (i & 0x80); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint8_t c = (i & 0x80); i = ((i & 0x7f) << 1) | ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); m_ccr |= (c & 0x80) ? CC_C : 0; @@ -2659,9 +2659,9 @@ void HC11OP(rol_indx)() /* ROL INDY 0x18 0x69 */ void HC11OP(rol_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT8 c = (i & 0x80); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint8_t c = (i & 0x80); i = ((i & 0x7f) << 1) | ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); m_ccr |= (c & 0x80) ? CC_C : 0; @@ -2682,10 +2682,10 @@ void HC11OP(rol_indy)() /* RORA 0x46 */ void HC11OP(rora)() { - UINT16 r = ((REG_A & 0xfe) >> 1) | ((m_ccr & CC_C) ? 0x80 : 0); + uint16_t r = ((REG_A & 0xfe) >> 1) | ((m_ccr & CC_C) ? 0x80 : 0); CLEAR_NZVC(); m_ccr |= (REG_A & 1) ? CC_C : 0; - REG_A = (UINT8)(r); + REG_A = (uint8_t)(r); SET_N8(REG_A); SET_Z8(REG_A); @@ -2701,10 +2701,10 @@ void HC11OP(rora)() /* RORB 0x56 */ void HC11OP(rorb)() { - UINT16 r = ((REG_B & 0xfe) >> 1) | ((m_ccr & CC_C) ? 0x80 : 0); + uint16_t r = ((REG_B & 0xfe) >> 1) | ((m_ccr & CC_C) ? 0x80 : 0); CLEAR_NZVC(); m_ccr |= (REG_B & 1) ? CC_C : 0; - REG_B = (UINT8)(r); + REG_B = (uint8_t)(r); SET_N8(REG_B); SET_Z8(REG_B); @@ -2720,8 +2720,8 @@ void HC11OP(rorb)() /* RTI 0x3B */ void HC11OP(rti)() { - UINT16 rt_adr; - UINT8 x_flag = m_ccr & CC_X; + uint16_t rt_adr; + uint8_t x_flag = m_ccr & CC_X; m_ccr = POP8(); if(x_flag == 0 && m_ccr & CC_X) //X flag cannot do a 0->1 transition with this instruction. m_ccr &= ~CC_X; @@ -2737,7 +2737,7 @@ void HC11OP(rti)() /* RTS 0x39 */ void HC11OP(rts)() { - UINT16 rt_adr = POP16(); + uint16_t rt_adr = POP16(); SET_PC(rt_adr); CYCLES(5); } @@ -2746,13 +2746,13 @@ void HC11OP(rts)() /* SBA 0x10 */ void HC11OP(sba)() { - UINT16 r = REG_A - REG_B; + uint16_t r = REG_A - REG_B; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, REG_B, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(2); } @@ -2760,88 +2760,88 @@ void HC11OP(sba)() /* SBCA IMM 0x82 */ void HC11OP(sbca_imm)() { - UINT8 i = FETCH(); - UINT16 r = (REG_A - i) - ((m_ccr & CC_C) ? 1 : 0); + uint8_t i = FETCH(); + uint16_t r = (REG_A - i) - ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(2); } /* SBCA IND, X 0xA2 */ void HC11OP(sbca_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT16 r = (REG_A - i) - ((m_ccr & CC_C) ? 1 : 0); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint16_t r = (REG_A - i) - ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(4); } /* SBCA IND, Y 0x18, 0xA2 */ void HC11OP(sbca_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT16 r = (REG_A - i) - ((m_ccr & CC_C) ? 1 : 0); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint16_t r = (REG_A - i) - ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(5); } /* SBCB IMM 0xC2 */ void HC11OP(sbcb_imm)() { - UINT8 i = FETCH(); - UINT16 r = (REG_B - i) - ((m_ccr & CC_C) ? 1 : 0); + uint8_t i = FETCH(); + uint16_t r = (REG_B - i) - ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(2); } /* SBCB IND, X 0xE2 */ void HC11OP(sbcb_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); - UINT16 r = (REG_B - i) - ((m_ccr & CC_C) ? 1 : 0); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); + uint16_t r = (REG_B - i) - ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(4); } /* SBCB IND, Y 0x18, 0xE2 */ void HC11OP(sbcb_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); - UINT16 r = (REG_B - i) - ((m_ccr & CC_C) ? 1 : 0); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); + uint16_t r = (REG_B - i) - ((m_ccr & CC_C) ? 1 : 0); CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(5); } @@ -2869,7 +2869,7 @@ void HC11OP(sev)() /* STAA DIR 0x97 */ void HC11OP(staa_dir)() { - UINT8 d = FETCH(); + uint8_t d = FETCH(); CLEAR_NZV(); SET_N8(REG_A); SET_Z8(REG_A); @@ -2880,7 +2880,7 @@ void HC11OP(staa_dir)() /* STAA EXT 0xB7 */ void HC11OP(staa_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); CLEAR_NZV(); SET_N8(REG_A); SET_Z8(REG_A); @@ -2891,7 +2891,7 @@ void HC11OP(staa_ext)() /* STAA IND, X 0xA7 */ void HC11OP(staa_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); SET_N8(REG_A); SET_Z8(REG_A); @@ -2902,7 +2902,7 @@ void HC11OP(staa_indx)() /* STAA IND, Y 0x18, 0xA7 */ void HC11OP(staa_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); SET_N8(REG_A); SET_Z8(REG_A); @@ -2913,7 +2913,7 @@ void HC11OP(staa_indy)() /* STAB DIR 0xD7 */ void HC11OP(stab_dir)() { - UINT8 d = FETCH(); + uint8_t d = FETCH(); CLEAR_NZV(); SET_N8(REG_B); SET_Z8(REG_B); @@ -2924,7 +2924,7 @@ void HC11OP(stab_dir)() /* STAB EXT 0xF7 */ void HC11OP(stab_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); CLEAR_NZV(); SET_N8(REG_B); SET_Z8(REG_B); @@ -2935,7 +2935,7 @@ void HC11OP(stab_ext)() /* STAB IND, X 0xE7 */ void HC11OP(stab_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); SET_N8(REG_B); SET_Z8(REG_B); @@ -2946,7 +2946,7 @@ void HC11OP(stab_indx)() /* STAB IND, Y 0x18, 0xE7 */ void HC11OP(stab_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); SET_N8(REG_B); SET_Z8(REG_B); @@ -2958,7 +2958,7 @@ void HC11OP(stab_indy)() /* STD DIR 0xDD */ void HC11OP(std_dir)() { - UINT8 d = FETCH(); + uint8_t d = FETCH(); CLEAR_NZV(); WRITE16(d, REG_D); SET_N16(REG_D); @@ -2969,7 +2969,7 @@ void HC11OP(std_dir)() /* STD EXT 0xFD */ void HC11OP(std_ext)() { - UINT16 adr = FETCH16(); + uint16_t adr = FETCH16(); CLEAR_NZV(); WRITE16(adr, REG_D); SET_N16(REG_D); @@ -2980,7 +2980,7 @@ void HC11OP(std_ext)() /* STD IND, X 0xED */ void HC11OP(std_indx)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); WRITE16(m_ix + offset, REG_D); SET_N16(REG_D); @@ -2991,7 +2991,7 @@ void HC11OP(std_indx)() /* STD IND, Y 0x18, 0xED */ void HC11OP(std_indy)() { - UINT8 offset = FETCH(); + uint8_t offset = FETCH(); CLEAR_NZV(); WRITE16(m_iy + offset, REG_D); SET_N16(REG_D); @@ -3002,8 +3002,8 @@ void HC11OP(std_indy)() /* STS DIR 0x9F */ void HC11OP(sts_dir)() { - UINT8 d = FETCH(); - UINT16 r = m_sp; + uint8_t d = FETCH(); + uint16_t r = m_sp; CLEAR_NZV(); WRITE8(d, (r & 0xff00) >> 8); WRITE8(d + 1, (r & 0xff)); @@ -3016,8 +3016,8 @@ void HC11OP(sts_dir)() /* STX DIR 0xDF */ void HC11OP(stx_dir)() { - UINT8 adr = FETCH(); - UINT16 r = m_ix; + uint8_t adr = FETCH(); + uint16_t r = m_ix; CLEAR_NZV(); WRITE8(adr, (r & 0xff00) >> 8); WRITE8(adr + 1, (r & 0xff)); @@ -3029,8 +3029,8 @@ void HC11OP(stx_dir)() /* STX EXT 0xFF */ void HC11OP(stx_ext)() { - UINT16 adr = FETCH16(); - UINT16 r = m_ix; + uint16_t adr = FETCH16(); + uint16_t r = m_ix; CLEAR_NZV(); WRITE8(adr, (r & 0xff00) >> 8); WRITE8(adr + 1, (r & 0xff)); @@ -3043,8 +3043,8 @@ void HC11OP(stx_ext)() /* STX INDX 0xEF */ void HC11OP(stx_indx)() { - UINT16 adr = FETCH(); - UINT16 r = m_ix; + uint16_t adr = FETCH(); + uint16_t r = m_ix; CLEAR_NZV(); WRITE8(m_ix + adr, (r & 0xff00) >> 8); WRITE8(m_ix + adr + 1, (r & 0xff)); @@ -3057,8 +3057,8 @@ void HC11OP(stx_indx)() /* STX INDY 0xCD 0xEF */ void HC11OP(stx_indy)() { - UINT16 adr = FETCH(); - UINT16 r = m_ix; + uint16_t adr = FETCH(); + uint16_t r = m_ix; CLEAR_NZV(); WRITE8(m_iy + adr, (r & 0xff00) >> 8); WRITE8(m_iy + adr + 1, (r & 0xff)); @@ -3070,8 +3070,8 @@ void HC11OP(stx_indy)() /* STY DIR 0x18 0xDF */ void HC11OP(sty_dir)() { - UINT8 adr = FETCH(); - UINT16 r = m_iy; + uint8_t adr = FETCH(); + uint16_t r = m_iy; CLEAR_NZV(); WRITE8(adr, (r & 0xff00) >> 8); WRITE8(adr + 1, (r & 0xff)); @@ -3084,8 +3084,8 @@ void HC11OP(sty_dir)() /* STY EXT 0x18 0xFF */ void HC11OP(sty_ext)() { - UINT16 adr = FETCH16(); - UINT16 r = m_iy; + uint16_t adr = FETCH16(); + uint16_t r = m_iy; CLEAR_NZV(); WRITE8(adr, (r & 0xff00) >> 8); WRITE8(adr + 1, (r & 0xff)); @@ -3097,8 +3097,8 @@ void HC11OP(sty_ext)() /* STY INDX 0x1A 0xEF */ void HC11OP(sty_indx)() { - UINT16 adr = FETCH(); - UINT16 r = m_iy; + uint16_t adr = FETCH(); + uint16_t r = m_iy; CLEAR_NZV(); WRITE8(m_ix + adr, (r & 0xff00) >> 8); WRITE8(m_ix + adr + 1, (r & 0xff)); @@ -3110,8 +3110,8 @@ void HC11OP(sty_indx)() /* STY INDY 0x18 0xEF */ void HC11OP(sty_indy)() { - UINT16 adr = FETCH(); - UINT16 r = m_iy; + uint16_t adr = FETCH(); + uint16_t r = m_iy; CLEAR_NZV(); WRITE8(m_iy + adr, (r & 0xff00) >> 8); WRITE8(m_iy + adr + 1, (r & 0xff)); @@ -3145,14 +3145,14 @@ void HC11OP(stop)() /* SUBA IMM 0x80 */ void HC11OP(suba_imm)() { - UINT8 i = FETCH(); - UINT16 r = REG_A - i; + uint8_t i = FETCH(); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(2); } @@ -3160,15 +3160,15 @@ void HC11OP(suba_imm)() /* SUBA DIR 0xd0 */ void HC11OP(suba_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT16 r = REG_A - i; + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(3); } @@ -3176,15 +3176,15 @@ void HC11OP(suba_dir)() /* SUBA EXT 0xE0 */ void HC11OP(suba_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT16 r = REG_A - i; + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(4); } @@ -3192,15 +3192,15 @@ void HC11OP(suba_ext)() /* SUBA INDX 0xA0 */ void HC11OP(suba_indx)() { - UINT16 adr = FETCH(); - UINT8 i = READ8(m_ix + adr); - UINT16 r = REG_A - i; + uint16_t adr = FETCH(); + uint8_t i = READ8(m_ix + adr); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(4); } @@ -3208,15 +3208,15 @@ void HC11OP(suba_indx)() /* SUBA INDY 0x18 0xA0 */ void HC11OP(suba_indy)() { - UINT16 adr = FETCH(); - UINT8 i = READ8(m_iy + adr); - UINT16 r = REG_A - i; + uint16_t adr = FETCH(); + uint8_t i = READ8(m_iy + adr); + uint16_t r = REG_A - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_A); SET_C8(r); - REG_A = (UINT8)r; + REG_A = (uint8_t)r; CYCLES(5); } @@ -3224,14 +3224,14 @@ void HC11OP(suba_indy)() /* SUBB IMM 0xC0 */ void HC11OP(subb_imm)() { - UINT8 i = FETCH(); - UINT16 r = REG_B - i; + uint8_t i = FETCH(); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(2); } @@ -3239,15 +3239,15 @@ void HC11OP(subb_imm)() /* SUBB DIR 0xD0 */ void HC11OP(subb_dir)() { - UINT8 d = FETCH(); - UINT8 i = READ8(d); - UINT16 r = REG_B - i; + uint8_t d = FETCH(); + uint8_t i = READ8(d); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(3); } @@ -3255,15 +3255,15 @@ void HC11OP(subb_dir)() /* SUBB EXT 0xF0 */ void HC11OP(subb_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); - UINT16 r = REG_B - i; + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(4); } @@ -3271,111 +3271,111 @@ void HC11OP(subb_ext)() /* SUBB INDX 0xE0 */ void HC11OP(subb_indx)() { - UINT16 adr = FETCH(); - UINT8 i = READ8(m_ix + adr); - UINT16 r = REG_B - i; + uint16_t adr = FETCH(); + uint8_t i = READ8(m_ix + adr); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(4); } /* SUBB INDY 0x18 0xE0 */ void HC11OP(subb_indy)() { - UINT16 adr = FETCH(); - UINT8 i = READ8(m_iy + adr); - UINT16 r = REG_B - i; + uint16_t adr = FETCH(); + uint8_t i = READ8(m_iy + adr); + uint16_t r = REG_B - i; CLEAR_NZVC(); SET_N8(r); SET_Z8(r); SET_V_SUB8(r, i, REG_B); SET_C8(r); - REG_B = (UINT8)r; + REG_B = (uint8_t)r; CYCLES(5); } /* SUBD IMM 0x83 */ void HC11OP(subd_imm)() { - UINT16 i = FETCH16(); - UINT32 r = REG_D - i; + uint16_t i = FETCH16(); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_SUB16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(4); } /* SUBD DIR 0x93 */ void HC11OP(subd_dir)() { - UINT8 d = FETCH(); - UINT16 i = READ16(d); - UINT32 r = REG_D - i; + uint8_t d = FETCH(); + uint16_t i = READ16(d); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_SUB16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(5); } /* SUBD EXT 0xB3 */ void HC11OP(subd_ext)() { - UINT16 addr = FETCH16(); - UINT16 i = READ16(addr); - UINT32 r = REG_D - i; + uint16_t addr = FETCH16(); + uint16_t i = READ16(addr); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_SUB16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(6); } /* SUBD INDX 0xA3 */ void HC11OP(subd_indx)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_ix + offset); - UINT32 r = REG_D - i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_ix + offset); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_SUB16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(6); } /* SUBD INDY 0x18 0xA3 */ void HC11OP(subd_indy)() { - UINT8 offset = FETCH(); - UINT16 i = READ16(m_iy + offset); - UINT32 r = REG_D - i; + uint8_t offset = FETCH(); + uint16_t i = READ16(m_iy + offset); + uint32_t r = REG_D - i; CLEAR_NZVC(); SET_N16(r); SET_Z16(r); SET_V_SUB16(r, i, REG_D); SET_C16(r); - REG_D = (UINT16)r; + REG_D = (uint16_t)r; CYCLES(7); } /* SWI 0x3F */ void HC11OP(swi)() { - UINT16 pc_vector; + uint16_t pc_vector; //m_pc++; PUSH16(m_pc); PUSH16(m_iy); @@ -3402,7 +3402,7 @@ void HC11OP(tab)() /* TAP 0x06 */ void HC11OP(tap)() { - UINT8 x_flag = m_ccr & CC_X; + uint8_t x_flag = m_ccr & CC_X; m_ccr = REG_A; if(x_flag == 0 && m_ccr & CC_X) //X flag cannot do a 0->1 transition with this instruction. m_ccr &= ~CC_X; @@ -3462,8 +3462,8 @@ void HC11OP(tstb)() /* TST EXT 0x7D */ void HC11OP(tst_ext)() { - UINT16 adr = FETCH16(); - UINT8 i = READ8(adr); + uint16_t adr = FETCH16(); + uint8_t i = READ8(adr); CLEAR_NZVC(); SET_N8(i); SET_Z8(i); @@ -3473,8 +3473,8 @@ void HC11OP(tst_ext)() /* TST IND, X 0x6D */ void HC11OP(tst_indx)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_ix + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_ix + offset); CLEAR_NZVC(); SET_N8(i); SET_Z8(i); @@ -3484,8 +3484,8 @@ void HC11OP(tst_indx)() /* TST IND, Y 0x18, 0x6D */ void HC11OP(tst_indy)() { - UINT8 offset = FETCH(); - UINT8 i = READ8(m_iy + offset); + uint8_t offset = FETCH(); + uint8_t i = READ8(m_iy + offset); CLEAR_NZVC(); SET_N8(i); SET_Z8(i); @@ -3550,7 +3550,7 @@ void HC11OP(wai)() /* XGDX 0x8F */ void HC11OP(xgdx)() { - UINT16 tmp = REG_D; + uint16_t tmp = REG_D; REG_D = m_ix; m_ix = tmp; CYCLES(3); @@ -3560,7 +3560,7 @@ void HC11OP(xgdx)() /* XGDY 0x18, 0x8F */ void HC11OP(xgdy)() { - UINT16 tmp = REG_D; + uint16_t tmp = REG_D; REG_D = m_iy; m_iy = tmp; CYCLES(4); @@ -3570,19 +3570,19 @@ void HC11OP(xgdy)() void HC11OP(page2)() { - UINT8 op2 = FETCH(); + uint8_t op2 = FETCH(); (this->*hc11_optable_page2[op2])(); } void HC11OP(page3)() { - UINT8 op2 = FETCH(); + uint8_t op2 = FETCH(); (this->*hc11_optable_page3[op2])(); } void HC11OP(page4)() { - UINT8 op2 = FETCH(); + uint8_t op2 = FETCH(); (this->*hc11_optable_page4[op2])(); } diff --git a/src/devices/cpu/mc68hc11/mc68hc11.cpp b/src/devices/cpu/mc68hc11/mc68hc11.cpp index 4a3c3970be8..fe6f5988d73 100644 --- a/src/devices/cpu/mc68hc11/mc68hc11.cpp +++ b/src/devices/cpu/mc68hc11/mc68hc11.cpp @@ -42,7 +42,7 @@ static const int div_tab[4] = { 1, 4, 8, 16 }; const device_type MC68HC11 = &device_creator; -mc68hc11_cpu_device::mc68hc11_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc68hc11_cpu_device::mc68hc11_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, MC68HC11, "MC68HC11", tag, owner, clock, "mc68hc11", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0 ) , m_io_config("io", ENDIANNESS_LITTLE, 8, 8, 0) @@ -54,7 +54,7 @@ mc68hc11_cpu_device::mc68hc11_cpu_device(const machine_config &mconfig, const ch } -offs_t mc68hc11_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t mc68hc11_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( hc11 ); return CPU_DISASSEMBLE_NAME(hc11)(this, buffer, pc, oprom, opram, options); @@ -66,7 +66,7 @@ offs_t mc68hc11_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UI /*****************************************************************************/ /* Internal registers */ -UINT8 mc68hc11_cpu_device::hc11_regs_r(UINT32 address) +uint8_t mc68hc11_cpu_device::hc11_regs_r(uint32_t address) { int reg = address & 0xff; @@ -180,7 +180,7 @@ UINT8 mc68hc11_cpu_device::hc11_regs_r(UINT32 address) return 0; // Dummy } -void mc68hc11_cpu_device::hc11_regs_w(UINT32 address, UINT8 value) +void mc68hc11_cpu_device::hc11_regs_w(uint32_t address, uint8_t value) { int reg = address & 0xff; @@ -298,20 +298,20 @@ void mc68hc11_cpu_device::hc11_regs_w(UINT32 address, UINT8 value) /*****************************************************************************/ -UINT8 mc68hc11_cpu_device::FETCH() +uint8_t mc68hc11_cpu_device::FETCH() { return m_direct->read_byte(m_pc++); } -UINT16 mc68hc11_cpu_device::FETCH16() +uint16_t mc68hc11_cpu_device::FETCH16() { - UINT16 w; + uint16_t w; w = (m_direct->read_byte(m_pc) << 8) | (m_direct->read_byte(m_pc+1)); m_pc += 2; return w; } -UINT8 mc68hc11_cpu_device::READ8(UINT32 address) +uint8_t mc68hc11_cpu_device::READ8(uint32_t address) { if(address >= m_reg_position && address < m_reg_position+(m_has_extended_io ? 0x100 : 0x40)) { @@ -324,7 +324,7 @@ UINT8 mc68hc11_cpu_device::READ8(UINT32 address) return m_program->read_byte(address); } -void mc68hc11_cpu_device::WRITE8(UINT32 address, UINT8 value) +void mc68hc11_cpu_device::WRITE8(uint32_t address, uint8_t value) { if(address >= m_reg_position && address < m_reg_position+(m_has_extended_io ? 0x100 : 0x40)) { @@ -339,12 +339,12 @@ void mc68hc11_cpu_device::WRITE8(UINT32 address, UINT8 value) m_program->write_byte(address, value); } -UINT16 mc68hc11_cpu_device::READ16(UINT32 address) +uint16_t mc68hc11_cpu_device::READ16(uint32_t address) { return (READ8(address) << 8) | (READ8(address+1)); } -void mc68hc11_cpu_device::WRITE16(UINT32 address, UINT16 value) +void mc68hc11_cpu_device::WRITE16(uint32_t address, uint16_t value) { WRITE8(address+0, (value >> 8) & 0xff); WRITE8(address+1, (value >> 0) & 0xff); @@ -511,7 +511,7 @@ void mc68hc11_cpu_device::check_irq_lines() { if( m_irq_state[MC68HC11_IRQ_LINE]!=CLEAR_LINE && (!(m_ccr & CC_I)) ) { - UINT16 pc_vector; + uint16_t pc_vector; if(m_wait_state == 0) { @@ -533,12 +533,12 @@ void mc68hc11_cpu_device::check_irq_lines() /* check timers here */ { int divider = div_tab[m_pr & 3]; - UINT64 cur_time = total_cycles(); - UINT32 add = (cur_time - m_frc_base) / divider; + uint64_t cur_time = total_cycles(); + uint32_t add = (cur_time - m_frc_base) / divider; if (add > 0) { - for(UINT32 i=0;i 0) { - UINT8 op; + uint8_t op; check_irq_lines(); diff --git a/src/devices/cpu/mc68hc11/mc68hc11.h b/src/devices/cpu/mc68hc11/mc68hc11.h index e6d4f3e21fe..7105a97f987 100644 --- a/src/devices/cpu/mc68hc11/mc68hc11.h +++ b/src/devices/cpu/mc68hc11/mc68hc11.h @@ -42,7 +42,7 @@ class mc68hc11_cpu_device : public cpu_device { public: // construction/destruction - mc68hc11_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc68hc11_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O enable flag static void set_has_extended_io(device_t &device, int has_extended_io) { downcast(device).m_has_extended_io = has_extended_io; } @@ -56,10 +56,10 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 41; } - virtual UINT32 execute_input_lines() const override { return 2; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 41; } + virtual uint32_t execute_input_lines() const override { return 2; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -73,9 +73,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 5; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 5; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -84,27 +84,27 @@ private: union { struct { #ifdef LSB_FIRST - UINT8 b; - UINT8 a; + uint8_t b; + uint8_t a; #else - UINT8 a; - UINT8 b; + uint8_t a; + uint8_t b; #endif } d8; - UINT16 d16; + uint16_t d16; } m_d; - UINT16 m_ix; - UINT16 m_iy; - UINT16 m_sp; - UINT16 m_pc; - UINT16 m_ppc; - UINT8 m_ccr; + uint16_t m_ix; + uint16_t m_iy; + uint16_t m_sp; + uint16_t m_pc; + uint16_t m_ppc; + uint8_t m_ccr; - UINT8 m_adctl; + uint8_t m_adctl; int m_ad_channel; - UINT8 m_irq_state[2]; + uint8_t m_irq_state[2]; direct_read_data *m_direct; address_space *m_program; address_space *m_io; @@ -112,23 +112,23 @@ private: int m_ram_position; int m_reg_position; - std::vector m_internal_ram; + std::vector m_internal_ram; int m_has_extended_io; // extended I/O enable flag int m_internal_ram_size; int m_init_value; - UINT8 m_wait_state; - UINT8 m_stop_state; + uint8_t m_wait_state; + uint8_t m_stop_state; - UINT8 m_tflg1; - UINT8 m_tmsk1; - UINT16 m_toc1; - UINT16 m_tcnt; -// UINT8 m_por; - UINT8 m_pr; + uint8_t m_tflg1; + uint8_t m_tmsk1; + uint16_t m_toc1; + uint16_t m_tcnt; +// uint8_t m_por; + uint8_t m_pr; - UINT64 m_frc_base; + uint64_t m_frc_base; typedef void (mc68hc11_cpu_device::*ophandler)(); struct hc11_opcode_list_struct @@ -144,20 +144,20 @@ private: ophandler hc11_optable_page3[256]; ophandler hc11_optable_page4[256]; - UINT8 hc11_regs_r(UINT32 address); - void hc11_regs_w(UINT32 address, UINT8 value); - UINT8 FETCH(); - UINT16 FETCH16(); - UINT8 READ8(UINT32 address); - void WRITE8(UINT32 address, UINT8 value); - UINT16 READ16(UINT32 address); - void WRITE16(UINT32 address, UINT16 value); + uint8_t hc11_regs_r(uint32_t address); + void hc11_regs_w(uint32_t address, uint8_t value); + uint8_t FETCH(); + uint16_t FETCH16(); + uint8_t READ8(uint32_t address); + void WRITE8(uint32_t address, uint8_t value); + uint16_t READ16(uint32_t address); + void WRITE16(uint32_t address, uint16_t value); void CYCLES(int cycles); void SET_PC(int pc); - void PUSH8(UINT8 value); - void PUSH16(UINT16 value); - UINT8 POP8(); - UINT16 POP16(); + void PUSH8(uint8_t value); + void PUSH16(uint16_t value); + uint8_t POP8(); + uint16_t POP16(); void hc11_aba(); void hc11_abx(); void hc11_aby(); diff --git a/src/devices/cpu/mcs48/mcs48.cpp b/src/devices/cpu/mcs48/mcs48.cpp index b21cae01394..88b4185cf0a 100644 --- a/src/devices/cpu/mcs48/mcs48.cpp +++ b/src/devices/cpu/mcs48/mcs48.cpp @@ -200,7 +200,7 @@ static ADDRESS_MAP_START(data_8bit, AS_DATA, 8, mcs48_cpu_device) ADDRESS_MAP_END -mcs48_cpu_device::mcs48_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int rom_size, int ram_size, UINT8 feature_mask) +mcs48_cpu_device::mcs48_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int rom_size, int ram_size, uint8_t feature_mask) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0 , ( ( rom_size == 1024 ) ? ADDRESS_MAP_NAME(program_10bit) : ( ( rom_size == 2048 ) ? ADDRESS_MAP_NAME(program_11bit) : ( ( rom_size == 4096 ) ? ADDRESS_MAP_NAME(program_12bit) : nullptr ) ) )) @@ -223,115 +223,115 @@ mcs48_cpu_device::mcs48_cpu_device(const machine_config &mconfig, device_type ty } } -i8021_device::i8021_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8021_device::i8021_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8021, "I8021", tag, owner, clock, "i8021", 1024, 64) { } -i8022_device::i8022_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8022_device::i8022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8022, "I8022", tag, owner, clock, "i8022", 2048, 128) { } -i8035_device::i8035_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8035_device::i8035_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8035, "I8035", tag, owner, clock, "i8035", 0, 64) { } -i8048_device::i8048_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8048_device::i8048_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8048, "I8048", tag, owner, clock, "i8048", 1024, 64) { } -i8648_device::i8648_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8648_device::i8648_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8648, "I8648", tag, owner, clock, "i8648", 1024, 64) { } -i8748_device::i8748_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8748_device::i8748_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8748, "I8748", tag, owner, clock, "i8748", 1024, 64) { } -i8039_device::i8039_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8039_device::i8039_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8039, "I8039", tag, owner, clock, "i8039", 0, 128) { } -i8049_device::i8049_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8049_device::i8049_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8049, "I8049", tag, owner, clock, "i8049", 2048, 128) { } -i8749_device::i8749_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8749_device::i8749_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8749, "I8749", tag, owner, clock, "i8749", 2048, 128) { } -i8040_device::i8040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8040_device::i8040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8040, "I8040", tag, owner, clock, "i8040", 0, 256) { } -i8050_device::i8050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8050_device::i8050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, I8050, "I8050", tag, owner, clock, "i8050", 4096, 256) { } -mb8884_device::mb8884_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb8884_device::mb8884_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, MB8884, "MB8884", tag, owner, clock, "mb8884", 0, 64) { } -n7751_device::n7751_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +n7751_device::n7751_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, N7751, "N7751", tag, owner, clock, "n7751", 1024, 64) { } -m58715_device::m58715_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m58715_device::m58715_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs48_cpu_device(mconfig, M58715, "M58715", tag, owner, clock, "m58715", 2048, 128) { } -upi41_cpu_device::upi41_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int rom_size, int ram_size) +upi41_cpu_device::upi41_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int rom_size, int ram_size) : mcs48_cpu_device(mconfig, type, name, tag, owner, clock, shortname, rom_size, ram_size, UPI41_FEATURE) { } -i8041_device::i8041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8041_device::i8041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upi41_cpu_device(mconfig, I8041, "I8041", tag, owner, clock, "i8041", 1024, 128) { } -i8741_device::i8741_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8741_device::i8741_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upi41_cpu_device(mconfig, I8741, "I8741", tag, owner, clock, "i8741", 1024, 128) { } -i8042_device::i8042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8042_device::i8042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upi41_cpu_device(mconfig, I8042, "I8042", tag, owner, clock, "i8042", 2048, 256) { } -i8242_device::i8242_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8242_device::i8242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upi41_cpu_device(mconfig, I8242, "I8242", tag, owner, clock, "i8242", 2048, 256) { } -i8742_device::i8742_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8742_device::i8742_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upi41_cpu_device(mconfig, I8742, "I8742", tag, owner, clock, "i8742", 2048, 256) { } -offs_t mcs48_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t mcs48_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( mcs48 ); return CPU_DISASSEMBLE_NAME(mcs48)(this, buffer, pc, oprom, opram, options); } -offs_t upi41_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t upi41_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( upi41 ); return CPU_DISASSEMBLE_NAME(upi41)(this, buffer, pc, oprom, opram, options); @@ -345,7 +345,7 @@ offs_t upi41_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 opcode_fetch - fetch an opcode byte -------------------------------------------------*/ -UINT8 mcs48_cpu_device::opcode_fetch() +uint8_t mcs48_cpu_device::opcode_fetch() { return m_direct->read_byte(m_pc++); } @@ -356,7 +356,7 @@ UINT8 mcs48_cpu_device::opcode_fetch() byte -------------------------------------------------*/ -UINT8 mcs48_cpu_device::argument_fetch() +uint8_t mcs48_cpu_device::argument_fetch() { return m_direct->read_byte(m_pc++); } @@ -369,7 +369,7 @@ UINT8 mcs48_cpu_device::argument_fetch() void mcs48_cpu_device::update_regptr() { - m_regptr = (UINT8 *)m_data->get_write_ptr((m_psw & B_FLAG) ? 24 : 0); + m_regptr = (uint8_t *)m_data->get_write_ptr((m_psw & B_FLAG) ? 24 : 0); } @@ -380,7 +380,7 @@ void mcs48_cpu_device::update_regptr() void mcs48_cpu_device::push_pc_psw() { - UINT8 sp = m_psw & 0x07; + uint8_t sp = m_psw & 0x07; ram_w(8 + 2*sp, m_pc); ram_w(9 + 2*sp, ((m_pc >> 8) & 0x0f) | (m_psw & 0xf0)); m_psw = (m_psw & 0xf8) | ((sp + 1) & 0x07); @@ -394,7 +394,7 @@ void mcs48_cpu_device::push_pc_psw() void mcs48_cpu_device::pull_pc_psw() { - UINT8 sp = (m_psw - 1) & 0x07; + uint8_t sp = (m_psw - 1) & 0x07; m_pc = ram_r(8 + 2*sp); m_pc |= ram_r(9 + 2*sp) << 8; m_psw = ((m_pc >> 8) & 0xf0) | 0x08 | sp; @@ -410,7 +410,7 @@ void mcs48_cpu_device::pull_pc_psw() void mcs48_cpu_device::pull_pc() { - UINT8 sp = (m_psw - 1) & 0x07; + uint8_t sp = (m_psw - 1) & 0x07; m_pc = ram_r(8 + 2*sp); m_pc |= ram_r(9 + 2*sp) << 8; m_pc &= 0xfff; @@ -423,10 +423,10 @@ void mcs48_cpu_device::pull_pc() instruction -------------------------------------------------*/ -void mcs48_cpu_device::execute_add(UINT8 dat) +void mcs48_cpu_device::execute_add(uint8_t dat) { - UINT16 temp = m_a + dat; - UINT16 temp4 = (m_a & 0x0f) + (dat & 0x0f); + uint16_t temp = m_a + dat; + uint16_t temp4 = (m_a & 0x0f) + (dat & 0x0f); m_psw &= ~(C_FLAG | A_FLAG); m_psw |= (temp4 << 2) & A_FLAG; @@ -440,11 +440,11 @@ void mcs48_cpu_device::execute_add(UINT8 dat) instruction -------------------------------------------------*/ -void mcs48_cpu_device::execute_addc(UINT8 dat) +void mcs48_cpu_device::execute_addc(uint8_t dat) { - UINT8 carryin = (m_psw & C_FLAG) >> 7; - UINT16 temp = m_a + dat + carryin; - UINT16 temp4 = (m_a & 0x0f) + (dat & 0x0f) + carryin; + uint8_t carryin = (m_psw & C_FLAG) >> 7; + uint16_t temp = m_a + dat + carryin; + uint16_t temp4 = (m_a & 0x0f) + (dat & 0x0f) + carryin; m_psw &= ~(C_FLAG | A_FLAG); m_psw |= (temp4 << 2) & A_FLAG; @@ -458,9 +458,9 @@ void mcs48_cpu_device::execute_addc(UINT8 dat) instruction -------------------------------------------------*/ -void mcs48_cpu_device::execute_jmp(UINT16 address) +void mcs48_cpu_device::execute_jmp(uint16_t address) { - UINT16 a11 = (m_irq_in_progress) ? 0 : m_a11; + uint16_t a11 = (m_irq_in_progress) ? 0 : m_a11; m_pc = address | a11; } @@ -470,7 +470,7 @@ void mcs48_cpu_device::execute_jmp(UINT16 address) instruction -------------------------------------------------*/ -void mcs48_cpu_device::execute_call(UINT16 address) +void mcs48_cpu_device::execute_call(uint16_t address) { push_pc_psw(); execute_jmp(address); @@ -482,9 +482,9 @@ void mcs48_cpu_device::execute_call(UINT16 address) conditional jump instruction -------------------------------------------------*/ -void mcs48_cpu_device::execute_jcc(UINT8 result) +void mcs48_cpu_device::execute_jcc(uint8_t result) { - UINT8 offset = argument_fetch(); + uint8_t offset = argument_fetch(); if (result != 0) m_pc = ((m_pc - 1) & 0xf00) | offset; } @@ -495,9 +495,9 @@ void mcs48_cpu_device::execute_jcc(UINT8 result) code can directly affect -------------------------------------------------*/ -UINT8 mcs48_cpu_device::p2_mask() +uint8_t mcs48_cpu_device::p2_mask() { - UINT8 result = 0xff; + uint8_t result = 0xff; if ((m_feature_mask & UPI41_FEATURE) == 0) return result; if (m_flags_enabled) @@ -513,7 +513,7 @@ UINT8 mcs48_cpu_device::p2_mask() the 8243 expander chip -------------------------------------------------*/ -void mcs48_cpu_device::expander_operation(UINT8 operation, UINT8 port) +void mcs48_cpu_device::expander_operation(uint8_t operation, uint8_t port) { /* put opcode/data on low 4 bits of P2 */ port_w(2, m_p2 = (m_p2 & 0xf0) | (operation << 2) | (port & 3)); @@ -803,7 +803,7 @@ OPHANDLER( orld_p7_a ) { expander_operation(MCS48_EXPANDER_OP_OR, 7); retur OPHANDLER( outl_bus_a ) { bus_w(m_a); return 2; } OPHANDLER( outl_p1_a ) { port_w(1, m_p1 = m_a); return 2; } -OPHANDLER( outl_p2_a ) { UINT8 mask = p2_mask(); port_w(2, m_p2 = (m_p2 & ~mask) | (m_a & mask)); return 2; } +OPHANDLER( outl_p2_a ) { uint8_t mask = p2_mask(); port_w(2, m_p2 = (m_p2 & ~mask) | (m_a & mask)); return 2; } OPHANDLER( out_dbb_a ) { /* copy to the DBBO and update the bit in STS */ @@ -828,10 +828,10 @@ OPHANDLER( retr ) } OPHANDLER( rl_a ) { m_a = (m_a << 1) | (m_a >> 7); return 1; } -OPHANDLER( rlc_a ) { UINT8 newc = m_a & C_FLAG; m_a = (m_a << 1) | (m_psw >> 7); m_psw = (m_psw & ~C_FLAG) | newc; return 1; } +OPHANDLER( rlc_a ) { uint8_t newc = m_a & C_FLAG; m_a = (m_a << 1) | (m_psw >> 7); m_psw = (m_psw & ~C_FLAG) | newc; return 1; } OPHANDLER( rr_a ) { m_a = (m_a >> 1) | (m_a << 7); return 1; } -OPHANDLER( rrc_a ) { UINT8 newc = (m_a << 7) & C_FLAG; m_a = (m_a >> 1) | (m_psw & C_FLAG); m_psw = (m_psw & ~C_FLAG) | newc; return 1; } +OPHANDLER( rrc_a ) { uint8_t newc = (m_a << 7) & C_FLAG; m_a = (m_a >> 1) | (m_psw & C_FLAG); m_psw = (m_psw & ~C_FLAG) | newc; return 1; } OPHANDLER( sel_mb0 ) { m_a11 = 0x000; return 1; } OPHANDLER( sel_mb1 ) { m_a11 = 0x800; return 1; } @@ -846,19 +846,19 @@ OPHANDLER( strt_t ) { m_timecount_enabled = TIMER_ENABLED; m_prescaler = OPHANDLER( swap_a ) { m_a = (m_a << 4) | (m_a >> 4); return 1; } -OPHANDLER( xch_a_r0 ) { UINT8 tmp = m_a; m_a = R0; R0 = tmp; return 1; } -OPHANDLER( xch_a_r1 ) { UINT8 tmp = m_a; m_a = R1; R1 = tmp; return 1; } -OPHANDLER( xch_a_r2 ) { UINT8 tmp = m_a; m_a = R2; R2 = tmp; return 1; } -OPHANDLER( xch_a_r3 ) { UINT8 tmp = m_a; m_a = R3; R3 = tmp; return 1; } -OPHANDLER( xch_a_r4 ) { UINT8 tmp = m_a; m_a = R4; R4 = tmp; return 1; } -OPHANDLER( xch_a_r5 ) { UINT8 tmp = m_a; m_a = R5; R5 = tmp; return 1; } -OPHANDLER( xch_a_r6 ) { UINT8 tmp = m_a; m_a = R6; R6 = tmp; return 1; } -OPHANDLER( xch_a_r7 ) { UINT8 tmp = m_a; m_a = R7; R7 = tmp; return 1; } -OPHANDLER( xch_a_xr0 ) { UINT8 tmp = m_a; m_a = ram_r(R0); ram_w(R0, tmp); return 1; } -OPHANDLER( xch_a_xr1 ) { UINT8 tmp = m_a; m_a = ram_r(R1); ram_w(R1, tmp); return 1; } +OPHANDLER( xch_a_r0 ) { uint8_t tmp = m_a; m_a = R0; R0 = tmp; return 1; } +OPHANDLER( xch_a_r1 ) { uint8_t tmp = m_a; m_a = R1; R1 = tmp; return 1; } +OPHANDLER( xch_a_r2 ) { uint8_t tmp = m_a; m_a = R2; R2 = tmp; return 1; } +OPHANDLER( xch_a_r3 ) { uint8_t tmp = m_a; m_a = R3; R3 = tmp; return 1; } +OPHANDLER( xch_a_r4 ) { uint8_t tmp = m_a; m_a = R4; R4 = tmp; return 1; } +OPHANDLER( xch_a_r5 ) { uint8_t tmp = m_a; m_a = R5; R5 = tmp; return 1; } +OPHANDLER( xch_a_r6 ) { uint8_t tmp = m_a; m_a = R6; R6 = tmp; return 1; } +OPHANDLER( xch_a_r7 ) { uint8_t tmp = m_a; m_a = R7; R7 = tmp; return 1; } +OPHANDLER( xch_a_xr0 ) { uint8_t tmp = m_a; m_a = ram_r(R0); ram_w(R0, tmp); return 1; } +OPHANDLER( xch_a_xr1 ) { uint8_t tmp = m_a; m_a = ram_r(R1); ram_w(R1, tmp); return 1; } -OPHANDLER( xchd_a_xr0 ) { UINT8 oldram = ram_r(R0); ram_w(R0, (oldram & 0xf0) | (m_a & 0x0f)); m_a = (m_a & 0xf0) | (oldram & 0x0f); return 1; } -OPHANDLER( xchd_a_xr1 ) { UINT8 oldram = ram_r(R1); ram_w(R1, (oldram & 0xf0) | (m_a & 0x0f)); m_a = (m_a & 0xf0) | (oldram & 0x0f); return 1; } +OPHANDLER( xchd_a_xr0 ) { uint8_t oldram = ram_r(R0); ram_w(R0, (oldram & 0xf0) | (m_a & 0x0f)); m_a = (m_a & 0xf0) | (oldram & 0x0f); return 1; } +OPHANDLER( xchd_a_xr1 ) { uint8_t oldram = ram_r(R1); ram_w(R1, (oldram & 0xf0) | (m_a & 0x0f)); m_a = (m_a & 0xf0) | (oldram & 0x0f); return 1; } OPHANDLER( xrl_a_r0 ) { m_a ^= R0; return 1; } OPHANDLER( xrl_a_r1 ) { m_a ^= R1; return 1; } @@ -1108,7 +1108,7 @@ void mcs48_cpu_device::burn_cycles(int count) /* if the timer is enabled, accumulate prescaler cycles */ if (m_timecount_enabled & TIMER_ENABLED) { - UINT8 oldtimer = m_timer; + uint8_t oldtimer = m_timer; m_prescaler += count; m_timer += m_prescaler >> 5; m_prescaler &= 0x1f; @@ -1212,8 +1212,8 @@ READ8_MEMBER( upi41_cpu_device::upi41_master_r ) TIMER_CALLBACK_MEMBER( upi41_cpu_device::master_callback ) { - UINT8 a0 = (param >> 8) & 1; - UINT8 data = param; + uint8_t a0 = (param >> 8) & 1; + uint8_t data = param; /* data always goes to the input buffer */ m_dbbi = data; diff --git a/src/devices/cpu/mcs48/mcs48.h b/src/devices/cpu/mcs48/mcs48.h index 83f4d4bd4e0..81e5b85fc29 100644 --- a/src/devices/cpu/mcs48/mcs48.h +++ b/src/devices/cpu/mcs48/mcs48.h @@ -121,7 +121,7 @@ class mcs48_cpu_device : public cpu_device { public: // construction/destruction - mcs48_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int rom_size, int ram_size, UINT8 feature_mask = 0); + mcs48_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int rom_size, int ram_size, uint8_t feature_mask = 0); protected: // device-level overrides @@ -129,12 +129,12 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 15 - 1) / 15; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 15); } - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 3; } - virtual UINT32 execute_input_lines() const override { return 2; } - virtual UINT32 execute_default_irq_vector() const override { return MCS48_INPUT_IRQ; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 15 - 1) / 15; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 15); } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 3; } + virtual uint32_t execute_input_lines() const override { return 2; } + virtual uint32_t execute_default_irq_vector() const override { return MCS48_INPUT_IRQ; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -150,42 +150,42 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; protected: address_space_config m_program_config; address_space_config m_data_config; address_space_config m_io_config; - UINT16 m_prevpc; /* 16-bit previous program counter */ - UINT16 m_pc; /* 16-bit program counter */ - - UINT8 m_a; /* 8-bit accumulator */ - UINT8 * m_regptr; /* pointer to r0-r7 */ - UINT8 m_psw; /* 8-bit psw */ - UINT8 m_p1; /* 8-bit latched port 1 */ - UINT8 m_p2; /* 8-bit latched port 2 */ - UINT8 m_ea; /* 1-bit latched ea input */ - UINT8 m_timer; /* 8-bit timer */ - UINT8 m_prescaler; /* 5-bit timer prescaler */ - UINT8 m_t1_history; /* 8-bit history of the T1 input */ - UINT8 m_sts; /* 8-bit status register (UPI-41 only, except for F1) */ - UINT8 m_dbbi; /* 8-bit input data buffer (UPI-41 only) */ - UINT8 m_dbbo; /* 8-bit output data buffer (UPI-41 only) */ - - UINT8 m_irq_state; /* TRUE if an IRQ is pending */ - UINT8 m_irq_in_progress; /* TRUE if an IRQ is in progress */ - UINT8 m_timer_overflow; /* TRUE on a timer overflow; cleared by taking interrupt */ - UINT8 m_timer_flag; /* TRUE on a timer overflow; cleared on JTF */ - UINT8 m_tirq_enabled; /* TRUE if the timer IRQ is enabled */ - UINT8 m_xirq_enabled; /* TRUE if the external IRQ is enabled */ - UINT8 m_timecount_enabled; /* bitmask of timer/counter enabled */ - UINT8 m_flags_enabled; /* TRUE if I/O flags have been enabled (UPI-41 only) */ - UINT8 m_dma_enabled; /* TRUE if DMA has been enabled (UPI-41 only) */ - - UINT16 m_a11; /* A11 value, either 0x000 or 0x800 */ + uint16_t m_prevpc; /* 16-bit previous program counter */ + uint16_t m_pc; /* 16-bit program counter */ + + uint8_t m_a; /* 8-bit accumulator */ + uint8_t * m_regptr; /* pointer to r0-r7 */ + uint8_t m_psw; /* 8-bit psw */ + uint8_t m_p1; /* 8-bit latched port 1 */ + uint8_t m_p2; /* 8-bit latched port 2 */ + uint8_t m_ea; /* 1-bit latched ea input */ + uint8_t m_timer; /* 8-bit timer */ + uint8_t m_prescaler; /* 5-bit timer prescaler */ + uint8_t m_t1_history; /* 8-bit history of the T1 input */ + uint8_t m_sts; /* 8-bit status register (UPI-41 only, except for F1) */ + uint8_t m_dbbi; /* 8-bit input data buffer (UPI-41 only) */ + uint8_t m_dbbo; /* 8-bit output data buffer (UPI-41 only) */ + + uint8_t m_irq_state; /* TRUE if an IRQ is pending */ + uint8_t m_irq_in_progress; /* TRUE if an IRQ is in progress */ + uint8_t m_timer_overflow; /* TRUE on a timer overflow; cleared by taking interrupt */ + uint8_t m_timer_flag; /* TRUE on a timer overflow; cleared on JTF */ + uint8_t m_tirq_enabled; /* TRUE if the timer IRQ is enabled */ + uint8_t m_xirq_enabled; /* TRUE if the external IRQ is enabled */ + uint8_t m_timecount_enabled; /* bitmask of timer/counter enabled */ + uint8_t m_flags_enabled; /* TRUE if I/O flags have been enabled (UPI-41 only) */ + uint8_t m_dma_enabled; /* TRUE if DMA has been enabled (UPI-41 only) */ + + uint16_t m_a11; /* A11 value, either 0x000 or 0x800 */ int m_icount; @@ -195,27 +195,27 @@ protected: address_space *m_data; address_space *m_io; - UINT8 m_feature_mask; /* processor feature flags */ - UINT16 m_int_rom_size; /* internal rom size */ + uint8_t m_feature_mask; /* processor feature flags */ + uint16_t m_int_rom_size; /* internal rom size */ - UINT8 m_rtemp; /* temporary for import/export */ + uint8_t m_rtemp; /* temporary for import/export */ typedef int (mcs48_cpu_device::*mcs48_ophandler)(); static const mcs48_ophandler s_opcode_table[256]; - UINT8 opcode_fetch(); - UINT8 argument_fetch(); + uint8_t opcode_fetch(); + uint8_t argument_fetch(); void update_regptr(); void push_pc_psw(); void pull_pc_psw(); void pull_pc(); - void execute_add(UINT8 dat); - void execute_addc(UINT8 dat); - void execute_jmp(UINT16 address); - void execute_call(UINT16 address); - void execute_jcc(UINT8 result); - UINT8 p2_mask(); - void expander_operation(UINT8 operation, UINT8 port); + void execute_add(uint8_t dat); + void execute_addc(uint8_t dat); + void execute_jmp(uint16_t address); + void execute_call(uint16_t address); + void execute_jcc(uint8_t result); + uint8_t p2_mask(); + void expander_operation(uint8_t operation, uint8_t port); int check_irqs(); void burn_cycles(int count); @@ -478,108 +478,108 @@ class i8021_device : public mcs48_cpu_device { public: // construction/destruction - i8021_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8021_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 30 - 1) / 30; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 30); } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 30 - 1) / 30; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 30); } }; class i8022_device : public mcs48_cpu_device { public: // construction/destruction - i8022_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 30 - 1) / 30; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 30); } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 30 - 1) / 30; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 30); } }; class i8035_device : public mcs48_cpu_device { public: // construction/destruction - i8035_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8035_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8048_device : public mcs48_cpu_device { public: // construction/destruction - i8048_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8048_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8648_device : public mcs48_cpu_device { public: // construction/destruction - i8648_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8648_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8748_device : public mcs48_cpu_device { public: // construction/destruction - i8748_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8748_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8039_device : public mcs48_cpu_device { public: // construction/destruction - i8039_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8039_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8049_device : public mcs48_cpu_device { public: // construction/destruction - i8049_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8049_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8749_device : public mcs48_cpu_device { public: // construction/destruction - i8749_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8749_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8040_device : public mcs48_cpu_device { public: // construction/destruction - i8040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8050_device : public mcs48_cpu_device { public: // construction/destruction - i8050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mb8884_device : public mcs48_cpu_device { public: // construction/destruction - mb8884_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8884_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class n7751_device : public mcs48_cpu_device { public: // construction/destruction - n7751_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + n7751_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class m58715_device : public mcs48_cpu_device { public: // construction/destruction - m58715_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m58715_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -587,14 +587,14 @@ class upi41_cpu_device : public mcs48_cpu_device { public: // construction/destruction - upi41_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int rom_size, int ram_size); + upi41_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int rom_size, int ram_size); /* functions for talking to the input/output buffers on the UPI41-class chips */ DECLARE_READ8_MEMBER(upi41_master_r); DECLARE_WRITE8_MEMBER(upi41_master_w); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; TIMER_CALLBACK_MEMBER( master_callback ); }; @@ -603,35 +603,35 @@ class i8041_device : public upi41_cpu_device { public: // construction/destruction - i8041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8741_device : public upi41_cpu_device { public: // construction/destruction - i8741_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8741_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8042_device : public upi41_cpu_device { public: // construction/destruction - i8042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8242_device : public upi41_cpu_device { public: // construction/destruction - i8242_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8742_device : public upi41_cpu_device { public: // construction/destruction - i8742_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8742_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/mcs48/mcs48dsm.cpp b/src/devices/cpu/mcs48/mcs48dsm.cpp index dd63846ab57..15a74946ff0 100644 --- a/src/devices/cpu/mcs48/mcs48dsm.cpp +++ b/src/devices/cpu/mcs48/mcs48dsm.cpp @@ -12,10 +12,10 @@ #include "emu.h" -static UINT32 common_dasm(device_t *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int upi41) +static uint32_t common_dasm(device_t *device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int upi41) { - const UINT8 *startram = opram; - UINT32 flags = 0; + const uint8_t *startram = opram; + uint32_t flags = 0; opram++; switch (*oprom++) diff --git a/src/devices/cpu/mcs51/mcs51.cpp b/src/devices/cpu/mcs51/mcs51.cpp index d90623369a3..19a6434a319 100644 --- a/src/devices/cpu/mcs51/mcs51.cpp +++ b/src/devices/cpu/mcs51/mcs51.cpp @@ -260,7 +260,7 @@ static ADDRESS_MAP_START(data_8bit, AS_DATA, 8, mcs51_cpu_device) ADDRESS_MAP_END -mcs51_cpu_device::mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, UINT8 features) +mcs51_cpu_device::mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, uint8_t features) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0 , ( ( program_width == 12 ) ? ADDRESS_MAP_NAME(program_12bit) : ( ( program_width == 13 ) ? ADDRESS_MAP_NAME(program_13bit) : nullptr ) )) @@ -286,91 +286,91 @@ mcs51_cpu_device::mcs51_cpu_device(const machine_config &mconfig, device_type ty } -i8031_device::i8031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8031_device::i8031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs51_cpu_device(mconfig, I8031, "I8031", tag, owner, clock, "i8031", 0, 7) { } -i8051_device::i8051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8051_device::i8051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs51_cpu_device(mconfig, I8051, "I8051", tag, owner, clock, "i8051", 12, 7) { } -i8751_device::i8751_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8751_device::i8751_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs51_cpu_device(mconfig, I8751, "I8751", tag, owner, clock, "i8751", 12, 7) { } -i8052_device::i8052_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, UINT8 features) +i8052_device::i8052_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, uint8_t features) : mcs51_cpu_device(mconfig, type, name, tag, owner, clock, shortname, program_width, data_width, features | FEATURE_I8052) { m_num_interrupts = 6; } -i8052_device::i8052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8052_device::i8052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs51_cpu_device(mconfig, I8052, "I8052", tag, owner, clock, "i8052", 13, 8, FEATURE_I8052) { m_num_interrupts = 6; } -i8032_device::i8032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8032_device::i8032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8052_device(mconfig, I8032, "I8032", tag, owner, clock, "i8032", 0, 8) { } -i8752_device::i8752_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8752_device::i8752_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8052_device(mconfig, I8752, "I8752", tag, owner, clock, "i8752", 13, 8) { } -i80c31_device::i80c31_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i80c31_device::i80c31_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8052_device(mconfig, I80C31, "I80C31", tag, owner, clock, "i80c31", 0, 7) { } -i80c51_device::i80c51_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, UINT8 features) +i80c51_device::i80c51_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, uint8_t features) : mcs51_cpu_device(mconfig, type, name, tag, owner, clock, shortname, program_width, data_width, features | FEATURE_CMOS) { } -i80c51_device::i80c51_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i80c51_device::i80c51_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs51_cpu_device(mconfig, I80C51, "I80C51", tag, owner, clock, "i80c51", 12, 7) { } -i87c51_device::i87c51_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i87c51_device::i87c51_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i80c51_device(mconfig, I87C51, "I87C51", tag, owner, clock, "i87c51", 12, 7) { } -i80c52_device::i80c52_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, UINT8 features) +i80c52_device::i80c52_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, uint8_t features) : i8052_device(mconfig, type, name, tag, owner, clock, shortname, program_width, data_width, features | FEATURE_I80C52 | FEATURE_CMOS) { } -i80c52_device::i80c52_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i80c52_device::i80c52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8052_device(mconfig, I80C52, "I80C52", tag, owner, clock, "i80C52", 13, 8, FEATURE_I80C52 | FEATURE_CMOS) { } -i80c32_device::i80c32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i80c32_device::i80c32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i80c52_device(mconfig, I80C32, "I80C32", tag, owner, clock, "i80c32", 0, 8) { } -i87c52_device::i87c52_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i87c52_device::i87c52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i80c52_device(mconfig, I87C52, "I87C52", tag, owner, clock, "i87c52", 13, 8) { } -at89c4051_device::at89c4051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +at89c4051_device::at89c4051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i80c51_device(mconfig, AT89C4051, "AT89C4051", tag, owner, clock, "at89c4051", 12, 7) { } -ds5002fp_device::ds5002fp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds5002fp_device::ds5002fp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mcs51_cpu_device(mconfig, DS5002FP, "DS5002FP", tag, owner, clock, "ds5002fp", 12, 7, FEATURE_DS5002FP | FEATURE_CMOS) { } @@ -385,10 +385,10 @@ ds5002fp_device::ds5002fp_device(const machine_config &mconfig, const char *tag, #define ROP_ARG(pc) m_direct->read_byte(pc) /* Read a byte from External Code Memory (Usually Program Rom(s) Space) */ -#define CODEMEM_R(a) (UINT8)m_program->read_byte(a) +#define CODEMEM_R(a) (uint8_t)m_program->read_byte(a) /* Read/Write a byte from/to External Data Memory (Usually RAM or other I/O) */ -#define DATAMEM_R(a) (UINT8)m_io->read_byte(a) +#define DATAMEM_R(a) (uint8_t)m_io->read_byte(a) #define DATAMEM_W(a,v) m_io->write_byte(a, v) /* Read/Write a byte from/to the Internal RAM */ @@ -398,8 +398,8 @@ ds5002fp_device::ds5002fp_device(const machine_config &mconfig, const char *tag, /* Read/Write a byte from/to the Internal RAM indirectly */ /* (called from indirect addressing) */ -UINT8 mcs51_cpu_device::iram_iread(offs_t a) { return (a <= m_ram_mask) ? m_data->read_byte(a) : 0xff; } -void mcs51_cpu_device::iram_iwrite(offs_t a, UINT8 d) { if (a <= m_ram_mask) m_data->write_byte(a, d); } +uint8_t mcs51_cpu_device::iram_iread(offs_t a) { return (a <= m_ram_mask) ? m_data->read_byte(a) : 0xff; } +void mcs51_cpu_device::iram_iwrite(offs_t a, uint8_t d) { if (a <= m_ram_mask) m_data->write_byte(a, d); } #define IRAM_IR(a) iram_iread(a) #define IRAM_IW(a, d) iram_iwrite(a, d) @@ -413,7 +413,7 @@ void mcs51_cpu_device::iram_iwrite(offs_t a, UINT8 d) { if (a <= m_ram_mask) m_d #define BIT_W(a,v) bit_address_w(a, v) /* Input/Output a byte from given I/O port */ -#define IN(port) ((UINT8)m_io->read_byte(port)) +#define IN(port) ((uint8_t)m_io->read_byte(port)) #define OUT(port,value) m_io->write_byte(port,value) @@ -434,10 +434,10 @@ void mcs51_cpu_device::iram_iwrite(offs_t a, UINT8 d) { if (a <= m_ram_mask) m_d #define ACC SFR_A(ADDR_ACC) #define PSW SFR_A(ADDR_PSW) -#define P0 ((const UINT8) SFR_A(ADDR_P0)) -#define P1 ((const UINT8) SFR_A(ADDR_P1)) -#define P2 ((const UINT8) SFR_A(ADDR_P2)) -#define P3 ((const UINT8) SFR_A(ADDR_P3)) +#define P0 ((const uint8_t) SFR_A(ADDR_P0)) +#define P1 ((const uint8_t) SFR_A(ADDR_P1)) +#define P2 ((const uint8_t) SFR_A(ADDR_P2)) +#define P3 ((const uint8_t) SFR_A(ADDR_P3)) #define SP SFR_A(ADDR_SP) #define DPL SFR_A(ADDR_DPL) @@ -728,14 +728,14 @@ void mcs51_cpu_device::clear_current_irq() LOG(("New: %d %02x\n", m_cur_irq_prio, m_irq_active)); } -UINT8 mcs51_cpu_device::r_acc() { return SFR_A(ADDR_ACC); } +uint8_t mcs51_cpu_device::r_acc() { return SFR_A(ADDR_ACC); } -UINT8 mcs51_cpu_device::r_psw() { return SFR_A(ADDR_PSW); } +uint8_t mcs51_cpu_device::r_psw() { return SFR_A(ADDR_PSW); } void mcs51_cpu_device::update_ptrs() { - m_internal_ram = (UINT8 *)m_data->get_write_ptr(0x00); - m_sfr_ram = (UINT8 *)m_data->get_write_ptr(0x100); + m_internal_ram = (uint8_t *)m_data->get_write_ptr(0x00); + m_sfr_ram = (uint8_t *)m_data->get_write_ptr(0x100); } @@ -773,9 +773,9 @@ void mcs51_cpu_device::update_ptrs() offs_t mcs51_cpu_device::external_ram_iaddr(offs_t offset, offs_t mem_mask) { /* Memory Range (RG1 and RG0 @ MCON and RPCTL registers) */ - static const UINT16 ds5002fp_ranges[4] = { 0x1fff, 0x3fff, 0x7fff, 0xffff }; + static const uint16_t ds5002fp_ranges[4] = { 0x1fff, 0x3fff, 0x7fff, 0xffff }; /* Memory Partition Table (RG1 & RG0 @ MCON & RPCTL registers) */ - static const UINT32 ds5002fp_partitions[16] = { + static const uint32_t ds5002fp_partitions[16] = { 0x0000, 0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x6000, 0x7000, 0x8000, 0x9000, 0xa000, 0xb000, 0xc000, 0xd000, 0xe000, 0x10000 }; @@ -800,12 +800,12 @@ offs_t mcs51_cpu_device::external_ram_iaddr(offs_t offset, offs_t mem_mask) /* Internal ram read/write */ -UINT8 mcs51_cpu_device::iram_read(size_t offset) +uint8_t mcs51_cpu_device::iram_read(size_t offset) { return (((offset) < 0x80) ? m_data->read_byte(offset) : sfr_read(offset)); } -void mcs51_cpu_device::iram_write(size_t offset, UINT8 data) +void mcs51_cpu_device::iram_write(size_t offset, uint8_t data) { if ((offset) < 0x80) m_data->write_byte(offset, data); @@ -816,7 +816,7 @@ void mcs51_cpu_device::iram_write(size_t offset, UINT8 data) /*Push the current PC to the stack*/ void mcs51_cpu_device::push_pc() { - UINT8 tmpSP = SP+1; //Grab and Increment Stack Pointer + uint8_t tmpSP = SP+1; //Grab and Increment Stack Pointer IRAM_IW(tmpSP, (PC & 0xff)); //Store low byte of PC to Internal Ram (Use IRAM_IW to store stack above 128 bytes) tmpSP++; // "" SP = tmpSP; // "" @@ -826,7 +826,7 @@ void mcs51_cpu_device::push_pc() /*Pop the current PC off the stack and into the pc*/ void mcs51_cpu_device::pop_pc() { - UINT8 tmpSP = SP; //Grab Stack Pointer + uint8_t tmpSP = SP; //Grab Stack Pointer PC = (IRAM_IR(tmpSP--) & 0xff) << 8; //Store hi byte to PC (must use IRAM_IR to access stack pointing above 128 bytes) PC = PC | IRAM_IR(tmpSP--); //Store lo byte to PC (must use IRAM_IR to access stack pointing above 128 bytes) SP = tmpSP; //Decrement Stack Pointer @@ -836,9 +836,9 @@ void mcs51_cpu_device::pop_pc() void mcs51_cpu_device::set_parity() { //This flag will be set when the accumulator contains an odd # of bits set.. - UINT8 p = 0; + uint8_t p = 0; int i; - UINT8 a = ACC; + uint8_t a = ACC; for (i=0; i<8; i++) { //Test for each of the 8 bits in the ACC! p ^= (a & 1); @@ -848,10 +848,10 @@ void mcs51_cpu_device::set_parity() SET_P(p & 1); } -UINT8 mcs51_cpu_device::bit_address_r(UINT8 offset) +uint8_t mcs51_cpu_device::bit_address_r(uint8_t offset) { - UINT8 word; - UINT8 mask; + uint8_t word; + uint8_t mask; int bit_pos; int distance; /* distance between bit addressable words */ /* 1 for normal bits, 8 for sfr bit addresses */ @@ -875,12 +875,12 @@ UINT8 mcs51_cpu_device::bit_address_r(UINT8 offset) } -void mcs51_cpu_device::bit_address_w(UINT8 offset, UINT8 bit) +void mcs51_cpu_device::bit_address_w(uint8_t offset, uint8_t bit) { int word; - UINT8 mask; + uint8_t mask; int bit_pos; - UINT8 result; + uint8_t result; int distance; /* User defined bit addresses 0x20-0x2f (values are 0x0-0x7f) */ @@ -907,10 +907,10 @@ void mcs51_cpu_device::bit_address_w(UINT8 offset, UINT8 bit) } } -void mcs51_cpu_device::do_add_flags(UINT8 a, UINT8 data, UINT8 c) +void mcs51_cpu_device::do_add_flags(uint8_t a, uint8_t data, uint8_t c) { - UINT16 result = a+data+c; - INT16 result1 = (INT8)a+(INT8)data+c; + uint16_t result = a+data+c; + int16_t result1 = (int8_t)a+(int8_t)data+c; SET_CY((result & 0x100) >> 8); result = (a&0x0f)+(data&0x0f)+c; @@ -918,10 +918,10 @@ void mcs51_cpu_device::do_add_flags(UINT8 a, UINT8 data, UINT8 c) SET_OV(result1 < -128 || result1 > 127); } -void mcs51_cpu_device::do_sub_flags(UINT8 a, UINT8 data, UINT8 c) +void mcs51_cpu_device::do_sub_flags(uint8_t a, uint8_t data, uint8_t c) { - UINT16 result = a-(data+c); - INT16 result1 = (INT8)a-(INT8)(data+c); + uint16_t result = a-(data+c); + int16_t result1 = (int8_t)a-(int8_t)(data+c); SET_CY((result & 0x100) >> 8); result = (a&0x0f)-((data&0x0f)+c); @@ -1004,11 +1004,11 @@ void mcs51_cpu_device::transmit_receive(int source) void mcs51_cpu_device::update_timer_t0(int cycles) { int mode = (GET_M0_1<<1) | GET_M0_0; - UINT32 count; + uint32_t count; if (GET_TR0) { - UINT32 delta; + uint32_t delta; /* counter / external input */ delta = GET_CT0 ? m_t0_cnt : cycles; @@ -1038,7 +1038,7 @@ void mcs51_cpu_device::update_timer_t0(int cycles) TL0 = count & 0xff; break; case 2: /* 8 Bit Autoreload */ - count = ((UINT32) TL0) + delta; + count = ((uint32_t) TL0) + delta; if ( count & 0xffffff00 ) /* Check for overflow */ { SET_TF0(1); @@ -1049,7 +1049,7 @@ void mcs51_cpu_device::update_timer_t0(int cycles) break; case 3: /* Split Timer 1 */ - count = ((UINT32) TL0) + delta; + count = ((uint32_t) TL0) + delta; if ( count & 0xffffff00 ) /* Check for overflow */ SET_TF0(1); TL0 = count & 0xff; /* Update new values of the counter */ @@ -1062,7 +1062,7 @@ void mcs51_cpu_device::update_timer_t0(int cycles) { case 3: /* Split Timer 2 */ - count = ((UINT32) TH0) + cycles; /* No gate control or counting !*/ + count = ((uint32_t) TH0) + cycles; /* No gate control or counting !*/ if ( count & 0xffffff00 ) /* Check for overflow */ SET_TF1(1); TH0 = count & 0xff; /* Update new values of the counter */ @@ -1089,16 +1089,16 @@ switching it into or out of Mode 3 or it can be assigned as a baud rate generato void mcs51_cpu_device::update_timer_t1(int cycles) { - UINT8 mode = (GET_M1_1<<1) | GET_M1_0; - UINT8 mode_0 = (GET_M0_1<<1) | GET_M0_0; - UINT32 count; + uint8_t mode = (GET_M1_1<<1) | GET_M1_0; + uint8_t mode_0 = (GET_M0_1<<1) | GET_M0_0; + uint32_t count; if (mode_0 != 3) { if (GET_TR1) { - UINT32 delta; - UINT32 overflow = 0; + uint32_t delta; + uint32_t overflow = 0; /* counter / external input */ delta = GET_CT1 ? m_t1_cnt : cycles; @@ -1126,7 +1126,7 @@ void mcs51_cpu_device::update_timer_t1(int cycles) TL1 = count & 0xff; break; case 2: /* 8 Bit Autoreload */ - count = ((UINT32) TL1) + delta; + count = ((uint32_t) TL1) + delta; overflow = count & 0xffffff00; /* Check for overflow */ if ( overflow ) { @@ -1148,8 +1148,8 @@ void mcs51_cpu_device::update_timer_t1(int cycles) } else { - UINT32 delta; - UINT32 overflow = 0; + uint32_t delta; + uint32_t overflow = 0; delta = cycles; /* taken, reset */ @@ -1170,7 +1170,7 @@ void mcs51_cpu_device::update_timer_t1(int cycles) TL1 = count & 0xff; break; case 2: /* 8 Bit Autoreload */ - count = ((UINT32) TL1) + delta; + count = ((uint32_t) TL1) + delta; overflow = count & 0xffffff00; /* Check for overflow */ if ( overflow ) { @@ -1197,7 +1197,7 @@ void mcs51_cpu_device::update_timer_t2(int cycles) int mode = ((GET_TCLK | GET_RCLK) << 1) | GET_CP; int delta = GET_CT2 ? m_t2_cnt : (mode & 2) ? cycles * (12/2) : cycles; - UINT32 count = ((TH2<<8) | TL2) + delta; + uint32_t count = ((TH2<<8) | TL2) + delta; m_t2_cnt = 0; switch (mode) @@ -1260,7 +1260,7 @@ void mcs51_cpu_device::update_timers(int cycles) //Set up to transmit data out of serial port //NOTE: Enable Serial Port Interrupt bit is NOT required to send/receive data! -void mcs51_cpu_device::serial_transmit(UINT8 data) +void mcs51_cpu_device::serial_transmit(uint8_t data) { int mode = (GET_SM0<<1) | GET_SM1; @@ -1315,7 +1315,7 @@ void mcs51_cpu_device::update_serial(int cycles) } /* Check and update status of serial port */ -void mcs51_cpu_device::update_irq_prio(UINT8 ipl, UINT8 iph) +void mcs51_cpu_device::update_irq_prio(uint8_t ipl, uint8_t iph) { int i; for (i=0; i<8; i++) @@ -1327,12 +1327,12 @@ void mcs51_cpu_device::update_irq_prio(UINT8 ipl, UINT8 iph) OPCODES ***************************************************************************/ -#define OPHANDLER( _name ) void mcs51_cpu_device::_name (UINT8 r) +#define OPHANDLER( _name ) void mcs51_cpu_device::_name (uint8_t r) #include "mcs51ops.hxx" -void mcs51_cpu_device::execute_op(UINT8 op) +void mcs51_cpu_device::execute_op(uint8_t op) { if (m_recalc_parity) { @@ -1658,7 +1658,7 @@ void mcs51_cpu_device::execute_op(UINT8 op) ***************************************************************************/ /* # of oscilations each opcode requires*/ -const UINT8 mcs51_cpu_device::mcs51_cycles[256] = { +const uint8_t mcs51_cpu_device::mcs51_cycles[256] = { 1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1696,10 +1696,10 @@ const UINT8 mcs51_cpu_device::mcs51_cycles[256] = { **********************************************************************************/ void mcs51_cpu_device::check_irqs() { - UINT8 ints = (GET_IE0 | (GET_TF0<<1) | (GET_IE1<<2) | (GET_TF1<<3) + uint8_t ints = (GET_IE0 | (GET_TF0<<1) | (GET_IE1<<2) | (GET_TF1<<3) | ((GET_RI|GET_TI)<<4)); - UINT8 int_vec = 0; - UINT8 int_mask; + uint8_t int_vec = 0; + uint8_t int_mask; int priority_request = -1; int i; @@ -1843,9 +1843,9 @@ void mcs51_cpu_device::execute_set_input(int irqline, int state) * for at least one cycle (12 states) * */ - UINT32 new_state = (m_last_line_state & ~(1 << irqline)) | ((state != CLEAR_LINE) << irqline); + uint32_t new_state = (m_last_line_state & ~(1 << irqline)) | ((state != CLEAR_LINE) << irqline); /* detect 0->1 transistions */ - UINT32 tr_state = (~m_last_line_state) & new_state; + uint32_t tr_state = (~m_last_line_state) & new_state; switch( irqline ) { @@ -1948,7 +1948,7 @@ void mcs51_cpu_device::execute_set_input(int irqline, int state) /* Execute cycles - returns number of cycles actually run */ void mcs51_cpu_device::execute_run() { - UINT8 op; + uint8_t op; update_ptrs(); @@ -2013,7 +2013,7 @@ void mcs51_cpu_device::execute_run() * MCS51/8051 Section ****************************************************************************/ -void mcs51_cpu_device::sfr_write(size_t offset, UINT8 data) +void mcs51_cpu_device::sfr_write(size_t offset, uint8_t data) { /* update register */ assert(offset >= 0x80 && offset <= 0xff); @@ -2045,14 +2045,14 @@ void mcs51_cpu_device::sfr_write(size_t offset, UINT8 data) case ADDR_SCON: break; default: - LOG(("mcs51 '%s': attemping to write to an invalid/non-implemented SFR address: %x at 0x%04x, data=%x\n", tag(), (UINT32)offset,PC,data)); + LOG(("mcs51 '%s': attemping to write to an invalid/non-implemented SFR address: %x at 0x%04x, data=%x\n", tag(), (uint32_t)offset,PC,data)); /* no write in this case according to manual */ return; } m_data->write_byte((size_t)offset | 0x100, data); } -UINT8 mcs51_cpu_device::sfr_read(size_t offset) +uint8_t mcs51_cpu_device::sfr_read(size_t offset) { assert(offset >= 0x80 && offset <= 0xff); @@ -2085,7 +2085,7 @@ UINT8 mcs51_cpu_device::sfr_read(size_t offset) return m_data->read_byte((size_t) offset | 0x100); /* Illegal or non-implemented sfr */ default: - LOG(("mcs51 '%s': attemping to read an invalid/non-implemented SFR address: %x at 0x%04x\n", tag(), (UINT32)offset,PC)); + LOG(("mcs51 '%s': attemping to read an invalid/non-implemented SFR address: %x at 0x%04x\n", tag(), (uint32_t)offset,PC)); /* according to the manual, the read may return random bits */ return 0xff; } @@ -2314,7 +2314,7 @@ void mcs51_cpu_device::device_reset() * 8052 Section ****************************************************************************/ -void i8052_device::sfr_write(size_t offset, UINT8 data) +void i8052_device::sfr_write(size_t offset, uint8_t data) { switch (offset) { @@ -2332,7 +2332,7 @@ void i8052_device::sfr_write(size_t offset, UINT8 data) } } -UINT8 i8052_device::sfr_read(size_t offset) +uint8_t i8052_device::sfr_read(size_t offset) { switch (offset) { @@ -2353,7 +2353,7 @@ UINT8 i8052_device::sfr_read(size_t offset) * 80C52 Section ****************************************************************************/ -void i80c52_device::sfr_write(size_t offset, UINT8 data) +void i80c52_device::sfr_write(size_t offset, uint8_t data) { switch (offset) { @@ -2375,7 +2375,7 @@ void i80c52_device::sfr_write(size_t offset, UINT8 data) m_data->write_byte((size_t) offset | 0x100, data); } -UINT8 i80c52_device::sfr_read(size_t offset) +uint8_t i80c52_device::sfr_read(size_t offset) { switch (offset) { @@ -2398,9 +2398,9 @@ UINT8 i80c52_device::sfr_read(size_t offset) #define DS5_LOGW(a, d) LOG(("ds5002fp '%s': write to " # a " register at 0x%04x, data=%x\n", tag(), PC, d)) #define DS5_LOGR(a, d) LOG(("ds5002fp '%s': read from " # a " register at 0x%04x\n", tag(), PC)) -UINT8 mcs51_cpu_device::ds5002fp_protected(size_t offset, UINT8 data, UINT8 ta_mask, UINT8 mask) +uint8_t mcs51_cpu_device::ds5002fp_protected(size_t offset, uint8_t data, uint8_t ta_mask, uint8_t mask) { - UINT8 is_timed_access; + uint8_t is_timed_access; is_timed_access = (m_ds5002fp.ta_window > 0) && (TA == 0x55); if (is_timed_access) @@ -2411,7 +2411,7 @@ UINT8 mcs51_cpu_device::ds5002fp_protected(size_t offset, UINT8 data, UINT8 ta_m return (m_sfr_ram[offset] & (~mask)) | (data & mask); } -void ds5002fp_device::sfr_write(size_t offset, UINT8 data) +void ds5002fp_device::sfr_write(size_t offset, uint8_t data) { switch (offset) { @@ -2440,7 +2440,7 @@ void ds5002fp_device::sfr_write(size_t offset, UINT8 data) m_data->write_byte((size_t) offset | 0x100, data); } -UINT8 ds5002fp_device::sfr_read(size_t offset) +uint8_t ds5002fp_device::sfr_read(size_t offset) { switch (offset) { @@ -2462,42 +2462,42 @@ UINT8 ds5002fp_device::sfr_read(size_t offset) } -offs_t mcs51_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t mcs51_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i8051 ); return CPU_DISASSEMBLE_NAME(i8051)(this, buffer, pc, oprom, opram, options); } -offs_t i8052_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i8052_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i8052 ); return CPU_DISASSEMBLE_NAME(i8052)(this, buffer, pc, oprom, opram, options); } -offs_t i80c31_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i80c31_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i80c51 ); return CPU_DISASSEMBLE_NAME(i80c51)(this, buffer, pc, oprom, opram, options); } -offs_t i80c51_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i80c51_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i80c51 ); return CPU_DISASSEMBLE_NAME(i80c51)(this, buffer, pc, oprom, opram, options); } -offs_t i80c52_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i80c52_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( i80c52 ); return CPU_DISASSEMBLE_NAME(i80c52)(this, buffer, pc, oprom, opram, options); } -offs_t ds5002fp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t ds5002fp_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( ds5002fp ); return CPU_DISASSEMBLE_NAME(ds5002fp)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/mcs51/mcs51.h b/src/devices/cpu/mcs51/mcs51.h index 7e9453b61fb..970ee46b531 100644 --- a/src/devices/cpu/mcs51/mcs51.h +++ b/src/devices/cpu/mcs51/mcs51.h @@ -84,10 +84,10 @@ class mcs51_cpu_device : public cpu_device { public: // construction/destruction - mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, UINT8 features = 0); + mcs51_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, uint8_t features = 0); // configuration helpers - static void set_port_forced_input(device_t &device, UINT8 port, UINT8 forced_input) { downcast(device).m_forced_inputs[port] = forced_input; } + static void set_port_forced_input(device_t &device, uint8_t port, uint8_t forced_input) { downcast(device).m_forced_inputs[port] = forced_input; } template static devcb_base & set_serial_rx_cb(device_t &device, _Object object) { return downcast(device).m_serial_rx_cb.set_callback(object); } template static devcb_base & set_serial_tx_cb(device_t &device, _Object object) { return downcast(device).m_serial_tx_cb.set_callback(object); } @@ -97,12 +97,12 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 12 - 1) / 12; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 12); } - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 20; } - virtual UINT32 execute_input_lines() const override { return 6; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 12 - 1) / 12; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 12); } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 20; } + virtual uint32_t execute_input_lines() const override { return 6; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -118,9 +118,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 5; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 5; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; protected: address_space_config m_program_config; @@ -128,46 +128,46 @@ protected: address_space_config m_io_config; //Internal stuff - UINT16 m_ppc; //previous pc - UINT16 m_pc; //current pc - UINT16 m_features; //features of this cpu - UINT8 m_rwm; //Signals that the current instruction is a read/write/modify instruction + uint16_t m_ppc; //previous pc + uint16_t m_pc; //current pc + uint16_t m_features; //features of this cpu + uint8_t m_rwm; //Signals that the current instruction is a read/write/modify instruction int m_inst_cycles; /* cycles for the current instruction */ int m_ram_mask; /* second ram bank for indirect access available ? */ int m_num_interrupts; /* number of interrupts supported */ int m_recalc_parity; /* recalculate parity before next instruction */ - UINT32 m_last_line_state; /* last state of input lines line */ + uint32_t m_last_line_state; /* last state of input lines line */ int m_t0_cnt; /* number of 0->1 transistions on T0 line */ int m_t1_cnt; /* number of 0->1 transistions on T1 line */ int m_t2_cnt; /* number of 0->1 transistions on T2 line */ int m_t2ex_cnt; /* number of 0->1 transistions on T2EX line */ int m_cur_irq_prio; /* Holds value of the current IRQ Priority Level; -1 if no irq */ - UINT8 m_irq_active; /* mask which irq levels are serviced */ - UINT8 m_irq_prio[8]; /* interrupt priority */ + uint8_t m_irq_active; /* mask which irq levels are serviced */ + uint8_t m_irq_prio[8]; /* interrupt priority */ - UINT8 m_forced_inputs[4]; /* allow read even if configured as output */ + uint8_t m_forced_inputs[4]; /* allow read even if configured as output */ int m_icount; struct mcs51_uart { - UINT8 data_out; //Data to send out - UINT8 bits_to_send; //How many bits left to send when transmitting out the serial port + uint8_t data_out; //Data to send out + uint8_t bits_to_send; //How many bits left to send when transmitting out the serial port int smod_div; /* signal divided by 2^SMOD */ int rx_clk; /* rx clock */ int tx_clk; /* tx clock */ - UINT8 delay_cycles; //Gross Hack; + uint8_t delay_cycles; //Gross Hack; } m_uart; /* internal uart */ /* Internal Ram */ - UINT8 *m_internal_ram; /* 128 RAM (8031/51) + 128 RAM in second bank (8032/52) */ - UINT8 *m_sfr_ram; /* 128 SFR - these are in 0x80 - 0xFF */ + uint8_t *m_internal_ram; /* 128 RAM (8031/51) + 128 RAM in second bank (8032/52) */ + uint8_t *m_sfr_ram; /* 128 SFR - these are in 0x80 - 0xFF */ /* SFR Callbacks */ - virtual void sfr_write(size_t offset, UINT8 data); - virtual UINT8 sfr_read(size_t offset); + virtual void sfr_write(size_t offset, uint8_t data); + virtual uint8_t sfr_read(size_t offset); /* Memory spaces */ address_space *m_program; @@ -181,161 +181,161 @@ protected: /* DS5002FP */ struct { - UINT8 previous_ta; /* Previous Timed Access value */ - UINT8 ta_window; /* Limed Access window */ - UINT8 range; /* Memory Range */ + uint8_t previous_ta; /* Previous Timed Access value */ + uint8_t ta_window; /* Limed Access window */ + uint8_t range; /* Memory Range */ /* Bootstrap Configuration */ - UINT8 mcon; /* bootstrap loader MCON register */ - UINT8 rpctl; /* bootstrap loader RPCTL register */ - UINT8 crc; /* bootstrap loader CRC register */ + uint8_t mcon; /* bootstrap loader MCON register */ + uint8_t rpctl; /* bootstrap loader RPCTL register */ + uint8_t crc; /* bootstrap loader CRC register */ } m_ds5002fp; // for the debugger - UINT8 m_rtemp; + uint8_t m_rtemp; - static const UINT8 mcs51_cycles[256]; + static const uint8_t mcs51_cycles[256]; - UINT8 iram_iread(offs_t a); - void iram_iwrite(offs_t a, UINT8 d); + uint8_t iram_iread(offs_t a); + void iram_iwrite(offs_t a, uint8_t d); void clear_current_irq(); - UINT8 r_acc(); - UINT8 r_psw(); + uint8_t r_acc(); + uint8_t r_psw(); void update_ptrs(); offs_t external_ram_iaddr(offs_t offset, offs_t mem_mask); - UINT8 iram_read(size_t offset); - void iram_write(size_t offset, UINT8 data); + uint8_t iram_read(size_t offset); + void iram_write(size_t offset, uint8_t data); void push_pc(); void pop_pc(); void set_parity(); - UINT8 bit_address_r(UINT8 offset); - void bit_address_w(UINT8 offset, UINT8 bit); - void do_add_flags(UINT8 a, UINT8 data, UINT8 c); - void do_sub_flags(UINT8 a, UINT8 data, UINT8 c); + uint8_t bit_address_r(uint8_t offset); + void bit_address_w(uint8_t offset, uint8_t bit); + void do_add_flags(uint8_t a, uint8_t data, uint8_t c); + void do_sub_flags(uint8_t a, uint8_t data, uint8_t c); void transmit_receive(int source); void update_timer_t0(int cycles); void update_timer_t1(int cycles); void update_timer_t2(int cycles); void update_timers(int cycles); - void serial_transmit(UINT8 data); + void serial_transmit(uint8_t data); void serial_receive(); void update_serial(int cycles); - void update_irq_prio(UINT8 ipl, UINT8 iph); - void execute_op(UINT8 op); + void update_irq_prio(uint8_t ipl, uint8_t iph); + void execute_op(uint8_t op); void check_irqs(); void burn_cycles(int cycles); - void acall(UINT8 r); - void add_a_byte(UINT8 r); - void add_a_mem(UINT8 r); - void add_a_ir(UINT8 r); - void add_a_r(UINT8 r); - void addc_a_byte(UINT8 r); - void addc_a_mem(UINT8 r); - void addc_a_ir(UINT8 r); - void addc_a_r(UINT8 r); - void ajmp(UINT8 r); - void anl_mem_a(UINT8 r); - void anl_mem_byte(UINT8 r); - void anl_a_byte(UINT8 r); - void anl_a_mem(UINT8 r); - void anl_a_ir(UINT8 r); - void anl_a_r(UINT8 r); - void anl_c_bitaddr(UINT8 r); - void anl_c_nbitaddr(UINT8 r); - void cjne_a_byte(UINT8 r); - void cjne_a_mem(UINT8 r); - void cjne_ir_byte(UINT8 r); - void cjne_r_byte(UINT8 r); - void clr_bitaddr(UINT8 r); - void clr_c(UINT8 r); - void clr_a(UINT8 r); - void cpl_bitaddr(UINT8 r); - void cpl_c(UINT8 r); - void cpl_a(UINT8 r); - void da_a(UINT8 r); - void dec_a(UINT8 r); - void dec_mem(UINT8 r); - void dec_ir(UINT8 r); - void dec_r(UINT8 r); - void div_ab(UINT8 r); - void djnz_mem(UINT8 r); - void djnz_r(UINT8 r); - void inc_a(UINT8 r); - void inc_mem(UINT8 r); - void inc_ir(UINT8 r); - void inc_r(UINT8 r); - void inc_dptr(UINT8 r); - void jb(UINT8 r); - void jbc(UINT8 r); - void jc(UINT8 r); - void jmp_iadptr(UINT8 r); - void jnb(UINT8 r); - void jnc(UINT8 r); - void jnz(UINT8 r); - void jz(UINT8 r); - void lcall(UINT8 r); - void ljmp(UINT8 r); - void mov_a_byte(UINT8 r); - void mov_a_mem(UINT8 r); - void mov_a_ir(UINT8 r); - void mov_a_r(UINT8 r); - void mov_mem_byte(UINT8 r); - void mov_mem_mem(UINT8 r); - void mov_ir_byte(UINT8 r); - void mov_r_byte(UINT8 r); - void mov_mem_ir(UINT8 r); - void mov_mem_r(UINT8 r); - void mov_dptr_byte(UINT8 r); - void mov_bitaddr_c(UINT8 r); - void mov_ir_mem(UINT8 r); - void mov_r_mem(UINT8 r); - void mov_mem_a(UINT8 r); - void mov_ir_a(UINT8 r); - void mov_r_a(UINT8 r); - void movc_a_iapc(UINT8 r); - void mov_c_bitaddr(UINT8 r); - void movc_a_iadptr(UINT8 r); - void movx_a_idptr(UINT8 r); - void movx_a_ir(UINT8 r); - void movx_idptr_a(UINT8 r); - void movx_ir_a(UINT8 r); - void mul_ab(UINT8 r); - void nop(UINT8 r); - void orl_mem_a(UINT8 r); - void orl_mem_byte(UINT8 r); - void orl_a_byte(UINT8 r); - void orl_a_mem(UINT8 r); - void orl_a_ir(UINT8 r); - void orl_a_r(UINT8 r); - void orl_c_bitaddr(UINT8 r); - void orl_c_nbitaddr(UINT8 r); - void pop(UINT8 r); - void push(UINT8 r); - void ret(UINT8 r); - void reti(UINT8 r); - void rl_a(UINT8 r); - void rlc_a(UINT8 r); - void rr_a(UINT8 r); - void rrc_a(UINT8 r); - void setb_c(UINT8 r); - void setb_bitaddr(UINT8 r); - void sjmp(UINT8 r); - void subb_a_byte(UINT8 r); - void subb_a_mem(UINT8 r); - void subb_a_ir(UINT8 r); - void subb_a_r(UINT8 r); - void swap_a(UINT8 r); - void xch_a_mem(UINT8 r); - void xch_a_ir(UINT8 r); - void xch_a_r(UINT8 r); - void xchd_a_ir(UINT8 r); - void xrl_mem_a(UINT8 r); - void xrl_mem_byte(UINT8 r); - void xrl_a_byte(UINT8 r); - void xrl_a_mem(UINT8 r); - void xrl_a_ir(UINT8 r); - void xrl_a_r(UINT8 r); - void illegal(UINT8 r); - UINT8 ds5002fp_protected(size_t offset, UINT8 data, UINT8 ta_mask, UINT8 mask); + void acall(uint8_t r); + void add_a_byte(uint8_t r); + void add_a_mem(uint8_t r); + void add_a_ir(uint8_t r); + void add_a_r(uint8_t r); + void addc_a_byte(uint8_t r); + void addc_a_mem(uint8_t r); + void addc_a_ir(uint8_t r); + void addc_a_r(uint8_t r); + void ajmp(uint8_t r); + void anl_mem_a(uint8_t r); + void anl_mem_byte(uint8_t r); + void anl_a_byte(uint8_t r); + void anl_a_mem(uint8_t r); + void anl_a_ir(uint8_t r); + void anl_a_r(uint8_t r); + void anl_c_bitaddr(uint8_t r); + void anl_c_nbitaddr(uint8_t r); + void cjne_a_byte(uint8_t r); + void cjne_a_mem(uint8_t r); + void cjne_ir_byte(uint8_t r); + void cjne_r_byte(uint8_t r); + void clr_bitaddr(uint8_t r); + void clr_c(uint8_t r); + void clr_a(uint8_t r); + void cpl_bitaddr(uint8_t r); + void cpl_c(uint8_t r); + void cpl_a(uint8_t r); + void da_a(uint8_t r); + void dec_a(uint8_t r); + void dec_mem(uint8_t r); + void dec_ir(uint8_t r); + void dec_r(uint8_t r); + void div_ab(uint8_t r); + void djnz_mem(uint8_t r); + void djnz_r(uint8_t r); + void inc_a(uint8_t r); + void inc_mem(uint8_t r); + void inc_ir(uint8_t r); + void inc_r(uint8_t r); + void inc_dptr(uint8_t r); + void jb(uint8_t r); + void jbc(uint8_t r); + void jc(uint8_t r); + void jmp_iadptr(uint8_t r); + void jnb(uint8_t r); + void jnc(uint8_t r); + void jnz(uint8_t r); + void jz(uint8_t r); + void lcall(uint8_t r); + void ljmp(uint8_t r); + void mov_a_byte(uint8_t r); + void mov_a_mem(uint8_t r); + void mov_a_ir(uint8_t r); + void mov_a_r(uint8_t r); + void mov_mem_byte(uint8_t r); + void mov_mem_mem(uint8_t r); + void mov_ir_byte(uint8_t r); + void mov_r_byte(uint8_t r); + void mov_mem_ir(uint8_t r); + void mov_mem_r(uint8_t r); + void mov_dptr_byte(uint8_t r); + void mov_bitaddr_c(uint8_t r); + void mov_ir_mem(uint8_t r); + void mov_r_mem(uint8_t r); + void mov_mem_a(uint8_t r); + void mov_ir_a(uint8_t r); + void mov_r_a(uint8_t r); + void movc_a_iapc(uint8_t r); + void mov_c_bitaddr(uint8_t r); + void movc_a_iadptr(uint8_t r); + void movx_a_idptr(uint8_t r); + void movx_a_ir(uint8_t r); + void movx_idptr_a(uint8_t r); + void movx_ir_a(uint8_t r); + void mul_ab(uint8_t r); + void nop(uint8_t r); + void orl_mem_a(uint8_t r); + void orl_mem_byte(uint8_t r); + void orl_a_byte(uint8_t r); + void orl_a_mem(uint8_t r); + void orl_a_ir(uint8_t r); + void orl_a_r(uint8_t r); + void orl_c_bitaddr(uint8_t r); + void orl_c_nbitaddr(uint8_t r); + void pop(uint8_t r); + void push(uint8_t r); + void ret(uint8_t r); + void reti(uint8_t r); + void rl_a(uint8_t r); + void rlc_a(uint8_t r); + void rr_a(uint8_t r); + void rrc_a(uint8_t r); + void setb_c(uint8_t r); + void setb_bitaddr(uint8_t r); + void sjmp(uint8_t r); + void subb_a_byte(uint8_t r); + void subb_a_mem(uint8_t r); + void subb_a_ir(uint8_t r); + void subb_a_r(uint8_t r); + void swap_a(uint8_t r); + void xch_a_mem(uint8_t r); + void xch_a_ir(uint8_t r); + void xch_a_r(uint8_t r); + void xchd_a_ir(uint8_t r); + void xrl_mem_a(uint8_t r); + void xrl_mem_byte(uint8_t r); + void xrl_a_byte(uint8_t r); + void xrl_a_mem(uint8_t r); + void xrl_a_ir(uint8_t r); + void xrl_a_r(uint8_t r); + void illegal(uint8_t r); + uint8_t ds5002fp_protected(size_t offset, uint8_t data, uint8_t ta_mask, uint8_t mask); }; @@ -367,21 +367,21 @@ class i8031_device : public mcs51_cpu_device { public: // construction/destruction - i8031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8051_device : public mcs51_cpu_device { public: // construction/destruction - i8051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8751_device : public mcs51_cpu_device { public: // construction/destruction - i8751_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8751_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -389,39 +389,39 @@ class i8052_device : public mcs51_cpu_device { public: // construction/destruction - i8052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - i8052_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, UINT8 features = 0); + i8052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + i8052_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, uint8_t features = 0); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; /* SFR Callbacks */ - virtual void sfr_write(size_t offset, UINT8 data) override; - virtual UINT8 sfr_read(size_t offset) override; + virtual void sfr_write(size_t offset, uint8_t data) override; + virtual uint8_t sfr_read(size_t offset) override; }; class i8032_device : public i8052_device { public: // construction/destruction - i8032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i8752_device : public i8052_device { public: // construction/destruction - i8752_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8752_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i80c31_device : public i8052_device { public: // construction/destruction - i80c31_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i80c31_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; @@ -429,18 +429,18 @@ class i80c51_device : public mcs51_cpu_device { public: // construction/destruction - i80c51_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - i80c51_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, UINT8 features = 0); + i80c51_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + i80c51_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, uint8_t features = 0); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; class i87c51_device : public i80c51_device { public: // construction/destruction - i87c51_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i87c51_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -448,36 +448,36 @@ class i80c52_device : public i8052_device { public: // construction/destruction - i80c52_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - i80c52_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, UINT8 features = 0); + i80c52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + i80c52_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, uint8_t features = 0); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; /* SFR Callbacks */ - virtual void sfr_write(size_t offset, UINT8 data) override; - virtual UINT8 sfr_read(size_t offset) override; + virtual void sfr_write(size_t offset, uint8_t data) override; + virtual uint8_t sfr_read(size_t offset) override; }; class i80c32_device : public i80c52_device { public: // construction/destruction - i80c32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i80c32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class i87c52_device : public i80c52_device { public: // construction/destruction - i87c52_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i87c52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class at89c4051_device : public i80c51_device { public: // construction/destruction - at89c4051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + at89c4051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; /* @@ -505,18 +505,18 @@ class ds5002fp_device : public mcs51_cpu_device { public: // construction/destruction - ds5002fp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds5002fp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_mcon(device_t &device, UINT8 mcon) { downcast(device).m_ds5002fp.mcon = mcon; } - static void set_rpctl(device_t &device, UINT8 rpctl) { downcast(device).m_ds5002fp.rpctl = rpctl; } - static void set_crc(device_t &device, UINT8 crc) { downcast(device).m_ds5002fp.crc = crc; } + static void set_mcon(device_t &device, uint8_t mcon) { downcast(device).m_ds5002fp.mcon = mcon; } + static void set_rpctl(device_t &device, uint8_t rpctl) { downcast(device).m_ds5002fp.rpctl = rpctl; } + static void set_crc(device_t &device, uint8_t crc) { downcast(device).m_ds5002fp.crc = crc; } protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; /* SFR Callbacks */ - virtual void sfr_write(size_t offset, UINT8 data) override; - virtual UINT8 sfr_read(size_t offset) override; + virtual void sfr_write(size_t offset, uint8_t data) override; + virtual uint8_t sfr_read(size_t offset) override; }; diff --git a/src/devices/cpu/mcs51/mcs51dasm.cpp b/src/devices/cpu/mcs51/mcs51dasm.cpp index 7e95aac2af6..83936dbab2a 100644 --- a/src/devices/cpu/mcs51/mcs51dasm.cpp +++ b/src/devices/cpu/mcs51/mcs51dasm.cpp @@ -271,7 +271,7 @@ static void init_mem_names(int feature_set, const char **mem_names) } -static const char *get_data_address( const char **mem_names, UINT8 arg ) +static const char *get_data_address( const char **mem_names, uint8_t arg ) { static char buffer_array[4][32]; static int whichbuf; @@ -284,7 +284,7 @@ static const char *get_data_address( const char **mem_names, UINT8 arg ) return buffer; } -static const char *get_bit_address( const char **mem_names, UINT8 arg ) +static const char *get_bit_address( const char **mem_names, uint8_t arg ) { static char buffer[32]; @@ -315,14 +315,14 @@ static const char *get_bit_address( const char **mem_names, UINT8 arg ) /*Just display the actual memory address for data & bit address access*/ -static const char *get_data_address( UINT8 arg ) +static const char *get_data_address( uint8_t arg ) { static char buffer[32]; sprintf(buffer,"$%02X",arg); return buffer; } -static const char *get_bit_address( UINT8 arg ) +static const char *get_bit_address( uint8_t arg ) { static char buffer[32]; sprintf(buffer,"$%02X",arg); @@ -331,14 +331,14 @@ static const char *get_bit_address( UINT8 arg ) #endif -static offs_t mcs51_dasm( const char **mem_names, char *dst, offs_t pc, const UINT8 *oprom, const UINT8 *opram) +static offs_t mcs51_dasm( const char **mem_names, char *dst, offs_t pc, const uint8_t *oprom, const uint8_t *opram) { - UINT32 flags = 0; + uint32_t flags = 0; unsigned PC = pc; const char *sym, *sym2; - UINT8 op, data; - UINT16 addr; - INT8 rel; + uint8_t op, data; + uint16_t addr; + int8_t rel; op = oprom[PC++ - pc]; switch( op ) diff --git a/src/devices/cpu/mcs51/mcs51ops.hxx b/src/devices/cpu/mcs51/mcs51ops.hxx index 0c1dec682ef..e3b89fe2d15 100644 --- a/src/devices/cpu/mcs51/mcs51ops.hxx +++ b/src/devices/cpu/mcs51/mcs51ops.hxx @@ -9,7 +9,7 @@ //ACALL code addr /* 1: aaa1 0001 */ OPHANDLER( acall ) { - UINT8 addr = ROP_ARG(PC++); //Grab code address byte + uint8_t addr = ROP_ARG(PC++); //Grab code address byte PUSH_PC(); //Save PC to the stack //Thanks Gerrit for help with this! :) PC = (PC & 0xf800) | ((r & 0xe0) << 3) | addr; @@ -18,8 +18,8 @@ OPHANDLER( acall ) //ADD A, #data /* 1: 0010 0100 */ OPHANDLER( add_a_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 result = ACC + data; //Add data to accumulator + uint8_t data = ROP_ARG(PC++); //Grab data + uint8_t result = ACC + data; //Add data to accumulator DO_ADD_FLAGS(ACC,data,0); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -27,9 +27,9 @@ OPHANDLER( add_a_byte ) //ADD A, data addr /* 1: 0010 0101 */ OPHANDLER( add_a_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - UINT8 result = ACC + data; //Add data to accumulator + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data from data address + uint8_t result = ACC + data; //Add data to accumulator DO_ADD_FLAGS(ACC,data,0); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -37,8 +37,8 @@ OPHANDLER( add_a_mem ) //ADD A, @R0/@R1 /* 1: 0010 011i */ OPHANDLER( add_a_ir ) { - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from memory pointed to by R0 or R1 - UINT8 result = ACC + data; //Add data to accumulator + uint8_t data = IRAM_IR(R_REG(r)); //Grab data from memory pointed to by R0 or R1 + uint8_t result = ACC + data; //Add data to accumulator DO_ADD_FLAGS(ACC,data,0); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -46,8 +46,8 @@ OPHANDLER( add_a_ir ) //ADD A, R0 to R7 /* 1: 0010 1rrr */ OPHANDLER( add_a_r ) { - UINT8 data = R_REG(r); //Grab data from R0 - R7 - UINT8 result = ACC + data; //Add data to accumulator + uint8_t data = R_REG(r); //Grab data from R0 - R7 + uint8_t result = ACC + data; //Add data to accumulator DO_ADD_FLAGS(ACC,data,0); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -55,8 +55,8 @@ OPHANDLER( add_a_r ) //ADDC A, #data /* 1: 0011 0100 */ OPHANDLER( addc_a_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 result = ACC + data + GET_CY; //Add data + carry flag to accumulator + uint8_t data = ROP_ARG(PC++); //Grab data + uint8_t result = ACC + data + GET_CY; //Add data + carry flag to accumulator DO_ADD_FLAGS(ACC,data,GET_CY); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -64,9 +64,9 @@ OPHANDLER( addc_a_byte ) //ADDC A, data addr /* 1: 0011 0101 */ OPHANDLER( addc_a_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - UINT8 result = ACC + data + GET_CY; //Add data + carry flag to accumulator + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data from data address + uint8_t result = ACC + data + GET_CY; //Add data + carry flag to accumulator DO_ADD_FLAGS(ACC,data,GET_CY); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -74,8 +74,8 @@ OPHANDLER( addc_a_mem ) //ADDC A, @R0/@R1 /* 1: 0011 011i */ OPHANDLER( addc_a_ir ) { - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from memory pointed to by R0 or R1 - UINT8 result = ACC + data + GET_CY; //Add data + carry flag to accumulator + uint8_t data = IRAM_IR(R_REG(r)); //Grab data from memory pointed to by R0 or R1 + uint8_t result = ACC + data + GET_CY; //Add data + carry flag to accumulator DO_ADD_FLAGS(ACC,data,GET_CY); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -83,8 +83,8 @@ OPHANDLER( addc_a_ir ) //ADDC A, R0 to R7 /* 1: 0011 1rrr */ OPHANDLER( addc_a_r ) { - UINT8 data = R_REG(r); //Grab data from R0 - R7 - UINT8 result = ACC + data + GET_CY; //Add data + carry flag to accumulator + uint8_t data = R_REG(r); //Grab data from R0 - R7 + uint8_t result = ACC + data + GET_CY; //Add data + carry flag to accumulator DO_ADD_FLAGS(ACC,data,GET_CY); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -92,7 +92,7 @@ OPHANDLER( addc_a_r ) //AJMP code addr /* 1: aaa0 0001 */ OPHANDLER( ajmp ) { - UINT8 addr = ROP_ARG(PC++); //Grab code address byte + uint8_t addr = ROP_ARG(PC++); //Grab code address byte //Thanks Gerrit for help with this! :) PC = (PC & 0xf800) | ((r & 0xe0) << 3) | addr; } @@ -100,46 +100,46 @@ OPHANDLER( ajmp ) //ANL data addr, A /* 1: 0101 0010 */ OPHANDLER( anl_mem_a ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data from data address IRAM_W(addr,data & ACC); //Set data address value to it's value Logical AND with ACC } //ANL data addr, #data /* 1: 0101 0011 */ OPHANDLER( anl_mem_byte ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 srcdata = IRAM_R(addr); //Grab data from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = ROP_ARG(PC++); //Grab data + uint8_t srcdata = IRAM_R(addr); //Grab data from data address IRAM_W(addr,srcdata & data); //Set data address value to it's value Logical AND with Data } //ANL A, #data /* 1: 0101 0100 */ OPHANDLER( anl_a_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data + uint8_t data = ROP_ARG(PC++); //Grab data SET_ACC(ACC & data); //Set ACC to value of ACC Logical AND with Data } //ANL A, data addr /* 1: 0101 0101 */ OPHANDLER( anl_a_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data from data address SET_ACC(ACC & data); //Set ACC to value of ACC Logical AND with Data } //ANL A, @RO/@R1 /* 1: 0101 011i */ OPHANDLER( anl_a_ir ) { - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from address R0 or R1 points to + uint8_t data = IRAM_IR(R_REG(r)); //Grab data from address R0 or R1 points to SET_ACC(ACC & data); //Set ACC to value of ACC Logical AND with Data } //ANL A, RO to R7 /* 1: 0101 1rrr */ OPHANDLER( anl_a_r ) { - UINT8 data = R_REG(r); //Grab data from R0 - R7 + uint8_t data = R_REG(r); //Grab data from R0 - R7 SET_ACC(ACC & data); //Set ACC to value of ACC Logical AND with Data } @@ -147,8 +147,8 @@ OPHANDLER( anl_a_r ) OPHANDLER( anl_c_bitaddr ) { int cy = GET_CY; - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 bit = BIT_R(addr); //Grab bit data from bit address + uint8_t addr = ROP_ARG(PC++); //Grab bit address + uint8_t bit = BIT_R(addr); //Grab bit data from bit address SET_CY( (cy & bit) ); //Set Carry flag to Carry Flag Value Logical AND with Bit } @@ -156,8 +156,8 @@ OPHANDLER( anl_c_bitaddr ) OPHANDLER( anl_c_nbitaddr ) { int cy = GET_CY; - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 bit = BIT_R(addr); //Grab bit data from bit address + uint8_t addr = ROP_ARG(PC++); //Grab bit address + uint8_t bit = BIT_R(addr); //Grab bit data from bit address bit = ((~bit)&1); //Complement bit SET_CY( (cy & bit) ); //Set Carry flag to Carry Flag Value Logical AND with Complemented Bit } @@ -165,8 +165,8 @@ OPHANDLER( anl_c_nbitaddr ) //CJNE A, #data, code addr /* 1: 1011 0100 */ OPHANDLER( cjne_a_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + uint8_t data = ROP_ARG(PC++); //Grab data + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address if(ACC != data) //Jump if values are not equal { @@ -180,9 +180,9 @@ OPHANDLER( cjne_a_byte ) //CJNE A, data addr, code addr /* 1: 1011 0101 */ OPHANDLER( cjne_a_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - UINT8 data = IRAM_R(addr); //Pull value from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address + uint8_t data = IRAM_R(addr); //Pull value from data address if(ACC != data) //Jump if values are not equal { @@ -196,9 +196,9 @@ OPHANDLER( cjne_a_mem ) //CJNE @R0/@R1, #data, code addr /* 1: 1011 011i */ OPHANDLER( cjne_ir_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - UINT8 srcdata = IRAM_IR(R_REG(r)); //Grab value pointed to by R0 or R1 + uint8_t data = ROP_ARG(PC++); //Grab data + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address + uint8_t srcdata = IRAM_IR(R_REG(r)); //Grab value pointed to by R0 or R1 if(srcdata != data) //Jump if values are not equal { @@ -212,9 +212,9 @@ OPHANDLER( cjne_ir_byte ) //CJNE R0 to R7, #data, code addr /* 1: 1011 1rrr */ OPHANDLER( cjne_r_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address - UINT8 srcdata = R_REG(r); //Grab value of R0 - R7 + uint8_t data = ROP_ARG(PC++); //Grab data + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address + uint8_t srcdata = R_REG(r); //Grab value of R0 - R7 if(srcdata != data) //Jump if values are not equal { @@ -228,7 +228,7 @@ OPHANDLER( cjne_r_byte ) //CLR bit addr /* 1: 1100 0010 */ OPHANDLER( clr_bitaddr ) { - UINT8 addr = ROP_ARG(PC++); //Grab bit address + uint8_t addr = ROP_ARG(PC++); //Grab bit address BIT_W(addr,0); //Clear bit at specified bit address } @@ -247,22 +247,22 @@ OPHANDLER( clr_a ) //CPL bit addr /* 1: 1011 0010 */ OPHANDLER( cpl_bitaddr ) { - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 data = (~BIT_R(addr))&1; + uint8_t addr = ROP_ARG(PC++); //Grab bit address + uint8_t data = (~BIT_R(addr))&1; BIT_W(addr,data); //Complement bit at specified bit address } //CPL C /* 1: 1011 0011 */ OPHANDLER( cpl_c ) { - UINT8 bit = (~GET_CY)&1; //Complement Carry Flag + uint8_t bit = (~GET_CY)&1; //Complement Carry Flag SET_CY(bit); } //CPL A /* 1: 1111 0100 */ OPHANDLER( cpl_a ) { - UINT8 data = ((~ACC)&0xff); + uint8_t data = ((~ACC)&0xff); SET_ACC(data); //Complement Accumulator } @@ -277,7 +277,7 @@ OPHANDLER( da_a ) If the carry is set, OR the four high bits 4-7 exceed nine, six is added to the value of these bits. The carry flag will be set if the result is > 0x99, but not cleared otherwise */ - UINT16 new_acc = ACC & 0xff; + uint16_t new_acc = ACC & 0xff; if(GET_AC || (new_acc & 0x0f) > 0x09) new_acc += 0x06; if(GET_CY || ((new_acc & 0xf0) > 0x90) || (new_acc & ~0xff)) @@ -296,15 +296,15 @@ OPHANDLER( dec_a ) //DEC data addr /* 1: 0001 0101 */ OPHANDLER( dec_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); IRAM_W(addr,data-1); } //DEC @R0/@R1 /* 1: 0001 011i */ OPHANDLER( dec_ir ) { - UINT8 data = IRAM_IR(R_REG(r)); + uint8_t data = IRAM_IR(R_REG(r)); IRAM_W(R_REG(r),data-1); } @@ -340,8 +340,8 @@ OPHANDLER( div_ab ) //DJNZ data addr, code addr /* 1: 1101 0101 */ OPHANDLER( djnz_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + uint8_t addr = ROP_ARG(PC++); //Grab data address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address IRAM_W(addr,IRAM_R(addr) - 1); //Decrement value contained at data address if(IRAM_R(addr) != 0) //Branch if contents of data address is not 0 { @@ -352,7 +352,7 @@ OPHANDLER( djnz_mem ) //DJNZ R0 to R7,code addr /* 1: 1101 1rrr */ OPHANDLER( djnz_r ) { - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address SET_REG(r ,R_REG(r) - 1); //Decrement value if(R_REG(r) != 0) //Branch if contents of R0 - R7 is not 0 { @@ -369,37 +369,37 @@ OPHANDLER( inc_a ) //INC data addr /* 1: 0000 0101 */ OPHANDLER( inc_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); IRAM_W(addr,data+1); } //INC @R0/@R1 /* 1: 0000 011i */ OPHANDLER( inc_ir ) { - UINT8 data = IRAM_IR(R_REG(r)); + uint8_t data = IRAM_IR(R_REG(r)); IRAM_W(R_REG(r),data+1); } //INC R0 to R7 /* 1: 0000 1rrr */ OPHANDLER( inc_r ) { - UINT8 data = R_REG(r); + uint8_t data = R_REG(r); SET_REG(r, data + 1); } //INC DPTR /* 1: 1010 0011 */ OPHANDLER( inc_dptr ) { - UINT16 dptr = (DPTR)+1; + uint16_t dptr = (DPTR)+1; SET_DPTR(dptr); } //JB bit addr, code addr /* 1: 0010 0000 */ OPHANDLER( jb ) { - UINT8 addr = ROP_ARG(PC++); //Grab bit address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + uint8_t addr = ROP_ARG(PC++); //Grab bit address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address if(BIT_R(addr)) //If bit set at specified bit address, jump { PC = PC + rel_addr; @@ -409,8 +409,8 @@ OPHANDLER( jb ) //JBC bit addr, code addr /* 1: 0001 0000 */ OPHANDLER( jbc ) { - UINT8 addr = ROP_ARG(PC++); //Grab bit address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + uint8_t addr = ROP_ARG(PC++); //Grab bit address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address if(BIT_R(addr)) { //If bit set at specified bit address, jump PC = PC + rel_addr; BIT_W(addr,0); //Clear Bit also @@ -420,7 +420,7 @@ OPHANDLER( jbc ) //JC code addr /* 1: 0100 0000 */ OPHANDLER( jc ) { - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address if(GET_CY) //Jump if Carry Flag Set { PC = PC + rel_addr; @@ -436,8 +436,8 @@ OPHANDLER( jmp_iadptr ) //JNB bit addr, code addr /* 1: 0011 0000 */ OPHANDLER( jnb ) { - UINT8 addr = ROP_ARG(PC++); //Grab bit address - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + uint8_t addr = ROP_ARG(PC++); //Grab bit address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address if(!BIT_R(addr)) //If bit NOT set at specified bit address, jump { PC = PC + rel_addr; @@ -447,7 +447,7 @@ OPHANDLER( jnb ) //JNC code addr /* 1: 0101 0000 */ OPHANDLER( jnc ) { - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address if(!GET_CY) //Jump if Carry Flag not set { PC = PC + rel_addr; @@ -457,7 +457,7 @@ OPHANDLER( jnc ) //JNZ code addr /* 1: 0111 0000 */ OPHANDLER( jnz ) { - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address if(ACC != 0) //Branch if ACC is not 0 { PC = PC+rel_addr; @@ -467,7 +467,7 @@ OPHANDLER( jnz ) //JZ code addr /* 1: 0110 0000 */ OPHANDLER( jz ) { - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address if(ACC == 0) //Branch if ACC is 0 { PC = PC+rel_addr; @@ -477,33 +477,33 @@ OPHANDLER( jz ) //LCALL code addr /* 1: 0001 0010 */ OPHANDLER( lcall ) { - UINT8 addr_hi, addr_lo; + uint8_t addr_hi, addr_lo; addr_hi = ROP_ARG(PC++); addr_lo = ROP_ARG(PC++); PUSH_PC(); - PC = (UINT16)((addr_hi<<8) | addr_lo); + PC = (uint16_t)((addr_hi<<8) | addr_lo); } //LJMP code addr /* 1: 0000 0010 */ OPHANDLER( ljmp ) { - UINT8 addr_hi, addr_lo; + uint8_t addr_hi, addr_lo; addr_hi = ROP_ARG(PC++); addr_lo = ROP_ARG(PC++); - PC = (UINT16)((addr_hi<<8) | addr_lo); + PC = (uint16_t)((addr_hi<<8) | addr_lo); } //MOV A, #data /* 1: 0111 0100 */ OPHANDLER( mov_a_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data + uint8_t data = ROP_ARG(PC++); //Grab data SET_ACC(data); //Store data to ACC } //MOV A, data addr /* 1: 1110 0101 */ OPHANDLER( mov_a_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address + uint8_t addr = ROP_ARG(PC++); //Grab data address SET_ACC(IRAM_R(addr)); //Store contents of data address to ACC } @@ -522,8 +522,8 @@ OPHANDLER( mov_a_r ) //MOV data addr, #data /* 1: 0111 0101 */ OPHANDLER( mov_mem_byte ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = ROP_ARG(PC++); //Grab data + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = ROP_ARG(PC++); //Grab data IRAM_W(addr,data); //Store data to data address location } @@ -531,7 +531,7 @@ OPHANDLER( mov_mem_byte ) OPHANDLER( mov_mem_mem ) { //1st address is src, 2nd is dst, but the mov command works as mov dst,src) - UINT8 src,dst; + uint8_t src,dst; src = ROP_ARG(PC++); //Grab source data address dst = ROP_ARG(PC++); //Grab destination data address IRAM_W(dst,IRAM_R(src)); //Read source address contents and store to destination address @@ -540,65 +540,65 @@ OPHANDLER( mov_mem_mem ) //MOV @R0/@R1, #data /* 1: 0111 011i */ OPHANDLER( mov_ir_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data + uint8_t data = ROP_ARG(PC++); //Grab data IRAM_IW(R_REG(r),data); //Store data to address pointed by R0 or R1 } //MOV R0 to R7, #data /* 1: 0111 1rrr */ OPHANDLER( mov_r_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data + uint8_t data = ROP_ARG(PC++); //Grab data SET_REG(r, data); //Store to R0 - R7 } //MOV data addr, @R0/@R1 /* 1: 1000 011i */ OPHANDLER( mov_mem_ir ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address + uint8_t addr = ROP_ARG(PC++); //Grab data address IRAM_W(addr,IRAM_IR(R_REG(r))); //Store contents pointed to by R0 or R1 to data address } //MOV data addr,R0 to R7 /* 1: 1000 1rrr */ OPHANDLER( mov_mem_r ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address + uint8_t addr = ROP_ARG(PC++); //Grab data address IRAM_W(addr,R_REG(r)); //Store contents of R0 - R7 to data address } //MOV DPTR, #data16 /* 1: 1001 0000 */ OPHANDLER( mov_dptr_byte ) { - UINT8 data_hi, data_lo; + uint8_t data_hi, data_lo; data_hi = ROP_ARG(PC++); //Grab hi byte data_lo = ROP_ARG(PC++); //Grab lo byte - SET_DPTR((UINT16)((data_hi<<8)|data_lo)); //Store to DPTR + SET_DPTR((uint16_t)((data_hi<<8)|data_lo)); //Store to DPTR } //MOV bit addr, C /* 1: 1001 0010 */ OPHANDLER( mov_bitaddr_c ) { - UINT8 addr = ROP_ARG(PC++); //Grab bit address + uint8_t addr = ROP_ARG(PC++); //Grab bit address BIT_W(addr,GET_CY); //Store Carry Flag to Bit Address } //MOV @R0/@R1, data addr /* 1: 1010 011i */ OPHANDLER( mov_ir_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address + uint8_t addr = ROP_ARG(PC++); //Grab data address IRAM_IW(R_REG(r),IRAM_R(addr)); //Store data from data address to address pointed to by R0 or R1 } //MOV R0 to R7, data addr /* 1: 1010 1rrr */ OPHANDLER( mov_r_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address + uint8_t addr = ROP_ARG(PC++); //Grab data address SET_REG(r, IRAM_R(addr)); //Store to R0 - R7 } //MOV data addr, A /* 1: 1111 0101 */ OPHANDLER( mov_mem_a ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address + uint8_t addr = ROP_ARG(PC++); //Grab data address IRAM_W(addr,ACC); //Store A to data address } @@ -617,7 +617,7 @@ OPHANDLER( mov_r_a ) //MOVC A, @A + PC /* 1: 1000 0011 */ OPHANDLER( movc_a_iapc ) { - UINT8 data; + uint8_t data; data = CODEMEM_R(ACC+PC); //Move a byte from CODE(Program) Memory and store to ACC SET_ACC(data); } @@ -625,14 +625,14 @@ OPHANDLER( movc_a_iapc ) //MOV C, bit addr /* 1: 1010 0010 */ OPHANDLER( mov_c_bitaddr ) { - UINT8 addr = ROP_ARG(PC++); //Grab bit address + uint8_t addr = ROP_ARG(PC++); //Grab bit address SET_CY( (BIT_R(addr)) ); //Store Bit from Bit Address to Carry Flag } //MOVC A, @A + DPTR /* 1: 1001 0011 */ OPHANDLER( movc_a_iadptr ) { - UINT8 data; + uint8_t data; data = CODEMEM_R(ACC + DPTR); //Move a byte from CODE(Program) Memory and store to ACC SET_ACC(data); } @@ -641,9 +641,9 @@ OPHANDLER( movc_a_iadptr ) //(Move External Ram 16 bit address to A) OPHANDLER( movx_a_idptr ) { -// UINT8 byte = DATAMEM_R(R_DPTR); //Grab 1 byte from External DATA memory pointed to by dptr - UINT32 addr = ERAM_ADDR(DPTR, 0xFFFF); - UINT8 byte = DATAMEM_R(addr); //Grab 1 byte from External DATA memory pointed to by dptr +// uint8_t byte = DATAMEM_R(R_DPTR); //Grab 1 byte from External DATA memory pointed to by dptr + uint32_t addr = ERAM_ADDR(DPTR, 0xFFFF); + uint8_t byte = DATAMEM_R(addr); //Grab 1 byte from External DATA memory pointed to by dptr SET_ACC(byte); //Store to ACC } @@ -651,8 +651,8 @@ OPHANDLER( movx_a_idptr ) //(Move External Ram 8 bit address to A) OPHANDLER( movx_a_ir ) { - UINT32 addr = ERAM_ADDR(R_REG(r),0xFF); //Grab address by reading location pointed to by R0 or R1 - UINT8 byte = DATAMEM_R(addr); //Grab 1 byte from External DATA memory pointed to by address + uint32_t addr = ERAM_ADDR(R_REG(r),0xFF); //Grab address by reading location pointed to by R0 or R1 + uint8_t byte = DATAMEM_R(addr); //Grab 1 byte from External DATA memory pointed to by address SET_ACC(byte); //Store to ACC } @@ -661,7 +661,7 @@ OPHANDLER( movx_a_ir ) OPHANDLER( movx_idptr_a ) { // DATAMEM_W(R_DPTR, ACC); //Store ACC to External DATA memory address pointed to by DPTR - UINT32 addr = ERAM_ADDR(DPTR, 0xFFFF); + uint32_t addr = ERAM_ADDR(DPTR, 0xFFFF); DATAMEM_W(addr, ACC); //Store ACC to External DATA memory address pointed to by DPTR } @@ -669,17 +669,17 @@ OPHANDLER( movx_idptr_a ) //(Move A to External Ram 8 bit address) OPHANDLER( movx_ir_a ) { - UINT32 addr = ERAM_ADDR(R_REG(r),0xFF); //Grab address by reading location pointed to by R0 or R1 + uint32_t addr = ERAM_ADDR(R_REG(r),0xFF); //Grab address by reading location pointed to by R0 or R1 DATAMEM_W(addr, ACC); //Store ACC to External DATA memory address } //MUL AB /* 1: 1010 0100 */ OPHANDLER( mul_ab ) { - UINT16 result = ACC * B; + uint16_t result = ACC * B; //A gets lo bits, B gets hi bits of result - B = (UINT8) ((result & 0xFF00) >> 8); - SET_ACC((UINT8)(result & 0x00FF)); + B = (uint8_t) ((result & 0xFF00) >> 8); + SET_ACC((uint8_t)(result & 0x00FF)); //Set flags SET_OV( ((result & 0x100) >> 8) ); //Set/Clear Overflow Flag if result > 255 SET_CY(0); //Carry Flag always cleared @@ -693,46 +693,46 @@ OPHANDLER( nop ) //ORL data addr, A /* 1: 0100 0010 */ OPHANDLER( orl_mem_a ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data from data address IRAM_W(addr,data | ACC); //Set data address value to it's value Logical OR with ACC } //ORL data addr, #data /* 1: 0100 0011 */ OPHANDLER( orl_mem_byte ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 srcdata = IRAM_R(addr); //Grab data from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = ROP_ARG(PC++); //Grab data + uint8_t srcdata = IRAM_R(addr); //Grab data from data address IRAM_W(addr,srcdata | data); //Set data address value to it's value Logical OR with Data } //ORL A, #data /* 1: 0100 0100 */ OPHANDLER( orl_a_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data + uint8_t data = ROP_ARG(PC++); //Grab data SET_ACC(ACC | data); //Set ACC to value of ACC Logical OR with Data } //ORL A, data addr /* 1: 0100 0101 */ OPHANDLER( orl_a_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data from data address SET_ACC(ACC | data); //Set ACC to value of ACC Logical OR with Data } //ORL A, @RO/@R1 /* 1: 0100 011i */ OPHANDLER( orl_a_ir ) { - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from address R0 or R1 points to + uint8_t data = IRAM_IR(R_REG(r)); //Grab data from address R0 or R1 points to SET_ACC(ACC | data); //Set ACC to value of ACC Logical OR with Data } //ORL A, RO to R7 /* 1: 0100 1rrr */ OPHANDLER( orl_a_r ) { - UINT8 data = R_REG(r); //Grab data from R0 - R7 + uint8_t data = R_REG(r); //Grab data from R0 - R7 SET_ACC(ACC | data); //Set ACC to value of ACC Logical OR with Data } @@ -740,8 +740,8 @@ OPHANDLER( orl_a_r ) OPHANDLER( orl_c_bitaddr ) { int cy = GET_CY; - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 bit = BIT_R(addr); //Grab bit data from bit address + uint8_t addr = ROP_ARG(PC++); //Grab bit address + uint8_t bit = BIT_R(addr); //Grab bit data from bit address SET_CY( (cy | bit) ); //Set Carry flag to Carry Flag Value Logical OR with Bit } @@ -749,8 +749,8 @@ OPHANDLER( orl_c_bitaddr ) OPHANDLER( orl_c_nbitaddr ) { int cy = GET_CY; - UINT8 addr = ROP_ARG(PC++); //Grab bit address - UINT8 bit = BIT_R(addr); //Grab bit data from bit address + uint8_t addr = ROP_ARG(PC++); //Grab bit address + uint8_t bit = BIT_R(addr); //Grab bit data from bit address bit = ((~bit)&1); //Complement bit SET_CY( (cy | bit) ); //Set Carry flag to Carry Flag Value Logical OR with Complemented Bit } @@ -758,7 +758,7 @@ OPHANDLER( orl_c_nbitaddr ) //POP data addr /* 1: 1101 0000 */ OPHANDLER( pop ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address + uint8_t addr = ROP_ARG(PC++); //Grab data address IRAM_W(addr, IRAM_IR(SP)); //Store to contents of data addr, data pointed to by Stack - IRAM_IR needed to access upper 128 bytes of stack //IRAM_IW(addr, IRAM_IR(R_SP)); //Store to contents of data addr, data pointed to by Stack - doesn't work, sfr's are not restored this way and it's not an indirect access anyway SP = SP-1; //Decrement SP @@ -767,8 +767,8 @@ OPHANDLER( pop ) //PUSH data addr /* 1: 1100 0000 */ OPHANDLER( push ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 tmpSP = SP+1; //Grab and Increment Stack Pointer + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t tmpSP = SP+1; //Grab and Increment Stack Pointer SP = tmpSP; // "" IRAM_IW(tmpSP, IRAM_R(addr)); //Store to stack contents of data address - IRAM_IW needed to store to upper 128 bytes of stack, however, can't use IRAM_IR because that won't store the sfrs and it's not an indirect access anyway } @@ -833,22 +833,22 @@ OPHANDLER( setb_c ) //SETB bit addr /* 1: 1101 0010 */ OPHANDLER( setb_bitaddr ) { - UINT8 addr = ROP_ARG(PC++); //Grab bit address + uint8_t addr = ROP_ARG(PC++); //Grab bit address BIT_W(addr,1); //Set Bit at Bit Address } //SJMP code addr /* 1: 1000 0000 */ OPHANDLER( sjmp ) { - INT8 rel_addr = ROP_ARG(PC++); //Grab relative code address + int8_t rel_addr = ROP_ARG(PC++); //Grab relative code address PC = PC + rel_addr; //Update PC } //SUBB A, #data /* 1: 1001 0100 */ OPHANDLER( subb_a_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator + uint8_t data = ROP_ARG(PC++); //Grab data + uint8_t result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator DO_SUB_FLAGS(ACC,data,GET_CY); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC @@ -857,9 +857,9 @@ OPHANDLER( subb_a_byte ) //SUBB A, data addr /* 1: 1001 0101 */ OPHANDLER( subb_a_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address - UINT8 result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data from data address + uint8_t result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator DO_SUB_FLAGS(ACC,data,GET_CY); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -867,8 +867,8 @@ OPHANDLER( subb_a_mem ) //SUBB A, @R0/@R1 /* 1: 1001 011i */ OPHANDLER( subb_a_ir ) { - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from memory pointed to by R0 or R1 - UINT8 result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator + uint8_t data = IRAM_IR(R_REG(r)); //Grab data from memory pointed to by R0 or R1 + uint8_t result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator DO_SUB_FLAGS(ACC,data,GET_CY); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -876,8 +876,8 @@ OPHANDLER( subb_a_ir ) //SUBB A, R0 to R7 /* 1: 1001 1rrr */ OPHANDLER( subb_a_r ) { - UINT8 data = R_REG(r); //Grab data from R0 - R7 - UINT8 result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator + uint8_t data = R_REG(r); //Grab data from R0 - R7 + uint8_t result = ACC - data - GET_CY; //Subtract data & carry flag from accumulator DO_SUB_FLAGS(ACC,data,GET_CY); //Set Flags SET_ACC(result); //Store 8 bit result of addtion in ACC } @@ -885,7 +885,7 @@ OPHANDLER( subb_a_r ) //SWAP A /* 1: 1100 0100 */ OPHANDLER( swap_a ) { - UINT8 a_nib_lo, a_nib_hi; + uint8_t a_nib_lo, a_nib_hi; a_nib_hi = (ACC & 0x0f) << 4; //Grab lo byte of ACC and move to hi a_nib_lo = (ACC & 0xf0) >> 4; //Grab hi byte of ACC and move to lo SET_ACC( a_nib_hi | a_nib_lo); @@ -894,9 +894,9 @@ OPHANDLER( swap_a ) //XCH A, data addr /* 1: 1100 0101 */ OPHANDLER( xch_a_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data - UINT8 oldACC = ACC; //Hold value of ACC + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data + uint8_t oldACC = ACC; //Hold value of ACC SET_ACC(data); //Sets ACC to data IRAM_W(addr,oldACC); //Sets data address to old value of ACC } @@ -904,8 +904,8 @@ OPHANDLER( xch_a_mem ) //XCH A, @RO/@R1 /* 1: 1100 011i */ OPHANDLER( xch_a_ir ) { - UINT8 data = IRAM_IR(R_REG(r)); //Grab data pointed to by R0 or R1 - UINT8 oldACC = ACC; //Hold value of ACC + uint8_t data = IRAM_IR(R_REG(r)); //Grab data pointed to by R0 or R1 + uint8_t oldACC = ACC; //Hold value of ACC SET_ACC(data); //Sets ACC to data IRAM_W(R_REG(r),oldACC); //Sets data address to old value of ACC } @@ -913,8 +913,8 @@ OPHANDLER( xch_a_ir ) //XCH A, RO to R7 /* 1: 1100 1rrr */ OPHANDLER( xch_a_r ) { - UINT8 data = R_REG(r); //Grab data from R0-R7 - UINT8 oldACC = ACC; //Hold value of ACC + uint8_t data = R_REG(r); //Grab data from R0-R7 + uint8_t oldACC = ACC; //Hold value of ACC SET_ACC(data); //Sets ACC to data SET_REG(r, oldACC); //Sets data address to old value of ACC } @@ -922,7 +922,7 @@ OPHANDLER( xch_a_r ) //XCHD A, @R0/@R1 /* 1: 1101 011i */ OPHANDLER( xchd_a_ir ) { - UINT8 acc, ir_data; + uint8_t acc, ir_data; ir_data = IRAM_IR(R_REG(r)); //Grab data pointed to by R0 or R1 acc = ACC; //Grab ACC value SET_ACC( (acc & 0xf0) | (ir_data & 0x0f) ); //Set ACC to lower nibble of data pointed to by R0 or R1 @@ -932,46 +932,46 @@ OPHANDLER( xchd_a_ir ) //XRL data addr, A /* 1: 0110 0010 */ OPHANDLER( xrl_mem_a ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data from data address IRAM_W(addr,data ^ ACC); //Set data address value to it's value Logical XOR with ACC } //XRL data addr, #data /* 1: 0110 0011 */ OPHANDLER( xrl_mem_byte ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = ROP_ARG(PC++); //Grab data - UINT8 srcdata = IRAM_R(addr); //Grab data from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = ROP_ARG(PC++); //Grab data + uint8_t srcdata = IRAM_R(addr); //Grab data from data address IRAM_W(addr,srcdata ^ data); //Set data address value to it's value Logical XOR with Data } //XRL A, #data /* 1: 0110 0100 */ OPHANDLER( xrl_a_byte ) { - UINT8 data = ROP_ARG(PC++); //Grab data + uint8_t data = ROP_ARG(PC++); //Grab data SET_ACC(ACC ^ data); //Set ACC to value of ACC Logical XOR with Data } //XRL A, data addr /* 1: 0110 0101 */ OPHANDLER( xrl_a_mem ) { - UINT8 addr = ROP_ARG(PC++); //Grab data address - UINT8 data = IRAM_R(addr); //Grab data from data address + uint8_t addr = ROP_ARG(PC++); //Grab data address + uint8_t data = IRAM_R(addr); //Grab data from data address SET_ACC(ACC ^ data); //Set ACC to value of ACC Logical XOR with Data } //XRL A, @R0/@R1 /* 1: 0110 011i */ OPHANDLER( xrl_a_ir ) { - UINT8 data = IRAM_IR(R_REG(r)); //Grab data from address R0 or R1 points to + uint8_t data = IRAM_IR(R_REG(r)); //Grab data from address R0 or R1 points to SET_ACC(ACC ^ data); //Set ACC to value of ACC Logical XOR with Data } //XRL A, R0 to R7 /* 1: 0110 1rrr */ OPHANDLER( xrl_a_r ) { - UINT8 data = R_REG(r); //Grab data from R0 - R7 + uint8_t data = R_REG(r); //Grab data from R0 - R7 SET_ACC(ACC ^ data); //Set ACC to value of ACC Logical XOR with Data } diff --git a/src/devices/cpu/mcs96/i8x9x.cpp b/src/devices/cpu/mcs96/i8x9x.cpp index a0616c0b223..f75fdec4f8c 100644 --- a/src/devices/cpu/mcs96/i8x9x.cpp +++ b/src/devices/cpu/mcs96/i8x9x.cpp @@ -11,14 +11,14 @@ #include "emu.h" #include "i8x9x.h" -i8x9x_device::i8x9x_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) : +i8x9x_device::i8x9x_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) : mcs96_device(mconfig, type, name, tag, owner, clock, 8, "i8x9x", __FILE__), io_config("io", ENDIANNESS_LITTLE, 16, 16, -1), io(nullptr), base_timer2(0), ad_done(0), hso_command(0), ad_command(0), hso_time(0), ad_result(0), ios0(0), ios1(0), ioc0(0), ioc1(0), sbuf(0), sp_stat(0), serial_send_buf(0), serial_send_timer(0) { } -offs_t i8x9x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i8x9x_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disasm_generic(buffer, pc, oprom, opram, options, disasm_entries); } @@ -67,14 +67,14 @@ void i8x9x_device::commit_hso_cam() hso_cam_hold.time = hso_time; } -void i8x9x_device::ad_start(UINT64 current_time) +void i8x9x_device::ad_start(uint64_t current_time) { ad_result = (io->read_word(2*((ad_command & 7) + A0)) << 6) | 8 | (ad_command & 7); ad_done = current_time + 88; internal_update(current_time); } -void i8x9x_device::serial_send(UINT8 data) +void i8x9x_device::serial_send(uint8_t data) { serial_send_buf = data; serial_send_timer = total_cycles() + 9600; @@ -89,7 +89,7 @@ void i8x9x_device::serial_send_done() check_irq(); } -void i8x9x_device::io_w8(UINT8 adr, UINT8 data) +void i8x9x_device::io_w8(uint8_t adr, uint8_t data) { switch(adr) { case 0x02: @@ -154,7 +154,7 @@ void i8x9x_device::io_w8(UINT8 adr, UINT8 data) return; } -void i8x9x_device::io_w16(UINT8 adr, UINT16 data) +void i8x9x_device::io_w16(uint8_t adr, uint16_t data) { switch(adr) { case 0: @@ -171,7 +171,7 @@ void i8x9x_device::io_w16(UINT8 adr, UINT16 data) return; } -UINT8 i8x9x_device::io_r8(UINT8 adr) +uint8_t i8x9x_device::io_r8(uint8_t adr) { switch(adr) { case 0x00: @@ -224,7 +224,7 @@ UINT8 i8x9x_device::io_r8(UINT8 adr) case 0x10: return io->read_word(P2*2); case 0x11: { - UINT8 res = sp_stat; + uint8_t res = sp_stat; sp_stat &= 0x80; logerror("%s: read sp stat %02x (%04x)\n", tag(), res, PPC); return res; @@ -233,7 +233,7 @@ UINT8 i8x9x_device::io_r8(UINT8 adr) logerror("%s: read ios 0 %02x (%04x)\n", tag(), ios0, PPC); return ios0; case 0x16: { - UINT8 res = ios1; + uint8_t res = ios1; ios1 = ios1 & 0xc0; return res; } @@ -243,7 +243,7 @@ UINT8 i8x9x_device::io_r8(UINT8 adr) } } -UINT16 i8x9x_device::io_r16(UINT8 adr) +uint16_t i8x9x_device::io_r16(uint8_t adr) { switch(adr) { case 0x00: @@ -267,7 +267,7 @@ void i8x9x_device::do_exec_partial() { } -void i8x9x_device::serial_w(UINT8 val) +void i8x9x_device::serial_w(uint8_t val) { sbuf = val; sp_stat |= 0x40; @@ -275,24 +275,24 @@ void i8x9x_device::serial_w(UINT8 val) check_irq(); } -UINT16 i8x9x_device::timer_value(int timer, UINT64 current_time) const +uint16_t i8x9x_device::timer_value(int timer, uint64_t current_time) const { if(timer == 2) current_time -= base_timer2; return current_time >> 3; } -UINT64 i8x9x_device::timer_time_until(int timer, UINT64 current_time, UINT16 timer_value) const +uint64_t i8x9x_device::timer_time_until(int timer, uint64_t current_time, uint16_t timer_value) const { - UINT64 timer_base = timer == 2 ? base_timer2 : 0; - UINT64 delta = (current_time - timer_base) >> 3; - UINT32 tdelta = UINT16(timer_value - delta); + uint64_t timer_base = timer == 2 ? base_timer2 : 0; + uint64_t delta = (current_time - timer_base) >> 3; + uint32_t tdelta = uint16_t(timer_value - delta); if(!tdelta) tdelta = 0x10000; return timer_base + ((delta + tdelta) << 3); } -void i8x9x_device::trigger_cam(int id, UINT64 current_time) +void i8x9x_device::trigger_cam(int id, uint64_t current_time) { hso_cam_entry &cam = hso_info[id]; cam.active = false; @@ -309,15 +309,15 @@ void i8x9x_device::trigger_cam(int id, UINT64 current_time) } } -void i8x9x_device::internal_update(UINT64 current_time) +void i8x9x_device::internal_update(uint64_t current_time) { - UINT16 current_timer1 = timer_value(1, current_time); - UINT16 current_timer2 = timer_value(2, current_time); + uint16_t current_timer1 = timer_value(1, current_time); + uint16_t current_timer2 = timer_value(2, current_time); for(int i=0; i<8; i++) if(hso_info[i].active) { - UINT8 cmd = hso_info[i].command; - UINT16 t = hso_info[i].time; + uint8_t cmd = hso_info[i].command; + uint16_t t = hso_info[i].time; if(((cmd & 0x40) && t == current_timer2) || (!(cmd & 0x40) && t == current_timer1)) { if(cmd != 0x18 && cmd != 0x19) @@ -335,7 +335,7 @@ void i8x9x_device::internal_update(UINT64 current_time) if(current_time == serial_send_timer) serial_send_done(); - UINT64 event_time = 0; + uint64_t event_time = 0; for(int i=0; i<8; i++) { if(!hso_info[i].active && hso_cam_hold.active) { hso_info[i] = hso_cam_hold; @@ -343,7 +343,7 @@ void i8x9x_device::internal_update(UINT64 current_time) logerror("%s: hso cam %02x %04x in slot %d from hold\n", tag(), hso_cam_hold.command, hso_cam_hold.time, i); } if(hso_info[i].active) { - UINT64 new_time = timer_time_until(hso_info[i].command & 0x40 ? 2 : 1, current_time, hso_info[i].time); + uint64_t new_time = timer_time_until(hso_info[i].command & 0x40 ? 2 : 1, current_time, hso_info[i].time); if(!event_time || new_time < event_time) event_time = new_time; } @@ -358,12 +358,12 @@ void i8x9x_device::internal_update(UINT64 current_time) recompute_bcount(event_time); } -c8095_device::c8095_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c8095_device::c8095_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8x9x_device(mconfig, C8095, "C8095", tag, owner, clock, "c8095", __FILE__) { } -p8098_device::p8098_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +p8098_device::p8098_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8x9x_device(mconfig, P8098, "P8098", tag, owner, clock, "p8098", __FILE__) { } diff --git a/src/devices/cpu/mcs96/i8x9x.h b/src/devices/cpu/mcs96/i8x9x.h index f71dc2f6b24..099618e94f1 100644 --- a/src/devices/cpu/mcs96/i8x9x.h +++ b/src/devices/cpu/mcs96/i8x9x.h @@ -21,9 +21,9 @@ public: P0, P1, P2 }; - i8x9x_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); + i8x9x_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); - void serial_w(UINT8 val); + void serial_w(uint8_t val); protected: virtual void device_start() override; @@ -32,14 +32,14 @@ protected: static const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; - virtual void internal_update(UINT64 current_time) override; - virtual void io_w8(UINT8 adr, UINT8 data) override; - virtual void io_w16(UINT8 adr, UINT16 data) override; - virtual UINT8 io_r8(UINT8 adr) override; - virtual UINT16 io_r16(UINT8 adr) override; + virtual void internal_update(uint64_t current_time) override; + virtual void io_w8(uint8_t adr, uint8_t data) override; + virtual void io_w16(uint8_t adr, uint16_t data) override; + virtual uint8_t io_r8(uint8_t adr) override; + virtual uint16_t io_r16(uint8_t adr) override; private: enum { @@ -55,8 +55,8 @@ private: struct hso_cam_entry { bool active; - UINT8 command; - UINT16 time; + uint8_t command; + uint16_t time; }; address_space_config io_config; @@ -65,31 +65,31 @@ private: hso_cam_entry hso_info[8]; hso_cam_entry hso_cam_hold; - UINT64 base_timer2, ad_done; - UINT8 hso_command, ad_command; - UINT16 hso_time, ad_result; - UINT8 ios0, ios1, ioc0, ioc1; - UINT8 sbuf, sp_stat; - UINT8 serial_send_buf; - UINT64 serial_send_timer; + uint64_t base_timer2, ad_done; + uint8_t hso_command, ad_command; + uint16_t hso_time, ad_result; + uint8_t ios0, ios1, ioc0, ioc1; + uint8_t sbuf, sp_stat; + uint8_t serial_send_buf; + uint64_t serial_send_timer; - UINT16 timer_value(int timer, UINT64 current_time) const; - UINT64 timer_time_until(int timer, UINT64 current_time, UINT16 timer_value) const; + uint16_t timer_value(int timer, uint64_t current_time) const; + uint64_t timer_time_until(int timer, uint64_t current_time, uint16_t timer_value) const; void commit_hso_cam(); - void trigger_cam(int id, UINT64 current_time); - void ad_start(UINT64 current_time); - void serial_send(UINT8 data); + void trigger_cam(int id, uint64_t current_time); + void ad_start(uint64_t current_time); + void serial_send(uint8_t data); void serial_send_done(); }; class c8095_device : public i8x9x_device { public: - c8095_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c8095_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class p8098_device : public i8x9x_device { public: - p8098_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + p8098_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type C8095; diff --git a/src/devices/cpu/mcs96/i8xc196.cpp b/src/devices/cpu/mcs96/i8xc196.cpp index ee1bcc229ce..5d814f7e272 100644 --- a/src/devices/cpu/mcs96/i8xc196.cpp +++ b/src/devices/cpu/mcs96/i8xc196.cpp @@ -11,17 +11,17 @@ #include "emu.h" #include "i8xc196.h" -i8xc196_device::i8xc196_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) : +i8xc196_device::i8xc196_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) : mcs96_device(mconfig, type, name, tag, owner, clock, 16, shortname, source) { } -offs_t i8xc196_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t i8xc196_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return disasm_generic(buffer, pc, oprom, opram, options, disasm_entries); } -void i8xc196_device::io_w8(UINT8 adr, UINT8 data) +void i8xc196_device::io_w8(uint8_t adr, uint8_t data) { switch(adr) { case 0: @@ -34,7 +34,7 @@ void i8xc196_device::io_w8(UINT8 adr, UINT8 data) return; } -void i8xc196_device::io_w16(UINT8 adr, UINT16 data) +void i8xc196_device::io_w16(uint8_t adr, uint16_t data) { switch(adr) { case 0: @@ -47,7 +47,7 @@ void i8xc196_device::io_w16(UINT8 adr, UINT16 data) return; } -UINT8 i8xc196_device::io_r8(UINT8 adr) +uint8_t i8xc196_device::io_r8(uint8_t adr) { switch(adr) { case 0x00: @@ -55,16 +55,16 @@ UINT8 i8xc196_device::io_r8(UINT8 adr) case 0x01: return 0x00; } - UINT8 data = 0x00; + uint8_t data = 0x00; logerror("%s: io_r8 %02x, %02x (%04x)\n", tag(), adr, data, PPC); return data; } -UINT16 i8xc196_device::io_r16(UINT8 adr) +uint16_t i8xc196_device::io_r16(uint8_t adr) { if(adr < 2) return 0x0000; - UINT16 data = 0x0000; + uint16_t data = 0x0000; logerror("%s: io_r16 %02x, %04x (%04x)\n", tag(), adr, data, PPC); return data; } diff --git a/src/devices/cpu/mcs96/i8xc196.h b/src/devices/cpu/mcs96/i8xc196.h index 746224a39f7..eeaf580aa64 100644 --- a/src/devices/cpu/mcs96/i8xc196.h +++ b/src/devices/cpu/mcs96/i8xc196.h @@ -15,18 +15,18 @@ class i8xc196_device : public mcs96_device { public: - i8xc196_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); + i8xc196_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 const disasm_entry disasm_entries[0x100]; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void do_exec_full() override; virtual void do_exec_partial() override; - virtual void io_w8(UINT8 adr, UINT8 data) override; - virtual void io_w16(UINT8 adr, UINT16 data) override; - virtual UINT8 io_r8(UINT8 adr) override; - virtual UINT16 io_r16(UINT8 adr) override; + virtual void io_w8(uint8_t adr, uint8_t data) override; + virtual void io_w16(uint8_t adr, uint16_t data) override; + virtual uint8_t io_r8(uint8_t adr) override; + virtual uint16_t io_r16(uint8_t adr) override; #define O(o) void o ## _196_full(); void o ## _196_partial() diff --git a/src/devices/cpu/mcs96/mcs96.cpp b/src/devices/cpu/mcs96/mcs96.cpp index 4e30df62c07..1711caaec32 100644 --- a/src/devices/cpu/mcs96/mcs96.cpp +++ b/src/devices/cpu/mcs96/mcs96.cpp @@ -12,7 +12,7 @@ #include "debugger.h" #include "mcs96.h" -mcs96_device::mcs96_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int data_width, const char *shortname, const char *source) : +mcs96_device::mcs96_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int data_width, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), program_config("program", ENDIANNESS_LITTLE, data_width, 16), program(nullptr), direct(nullptr), icount(0), bcount(0), inst_state(0), cycles_scaling(0), pending_irq(0), PC(0), PPC(0), PSW(0), OP1(0), OP2(0), OP3(0), OPI(0), TMP(0), irq_requested(false) @@ -51,22 +51,22 @@ void mcs96_device::device_reset() inst_state = STATE_FETCH; } -UINT32 mcs96_device::execute_min_cycles() const +uint32_t mcs96_device::execute_min_cycles() const { return 4; } -UINT32 mcs96_device::execute_max_cycles() const +uint32_t mcs96_device::execute_max_cycles() const { return 33; } -UINT32 mcs96_device::execute_input_lines() const +uint32_t mcs96_device::execute_input_lines() const { return 1; } -void mcs96_device::recompute_bcount(UINT64 event_time) +void mcs96_device::recompute_bcount(uint64_t event_time) { if(!event_time || event_time >= total_cycles() + icount) { bcount = 0; @@ -153,7 +153,7 @@ void mcs96_device::state_string_export(const device_state_entry &entry, std::str } } -std::string mcs96_device::regname(UINT8 reg) +std::string mcs96_device::regname(uint8_t reg) { char res[32]; switch(reg) { @@ -172,7 +172,7 @@ std::string mcs96_device::regname(UINT8 reg) return res; } -offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *entries) +offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options, const disasm_entry *entries) { bool prefix_fe = false; int off = 0; @@ -183,7 +183,7 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, oprom++; } const disasm_entry &e = entries[oprom[0]]; - UINT32 flags = e.flags | DASMFLAG_SUPPORTED; + uint32_t flags = e.flags | DASMFLAG_SUPPORTED; buffer += sprintf(buffer, "%s", prefix_fe ? e.opcode_fe : e.opcode); switch(e.mode) { @@ -413,17 +413,17 @@ offs_t mcs96_device::disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, return flags+off; } -UINT32 mcs96_device::disasm_min_opcode_bytes() const +uint32_t mcs96_device::disasm_min_opcode_bytes() const { return 1; } -UINT32 mcs96_device::disasm_max_opcode_bytes() const +uint32_t mcs96_device::disasm_max_opcode_bytes() const { return 7; } -void mcs96_device::io_w8(UINT8 adr, UINT8 data) +void mcs96_device::io_w8(uint8_t adr, uint8_t data) { switch(adr) { case 0x02: @@ -478,7 +478,7 @@ void mcs96_device::io_w8(UINT8 adr, UINT8 data) return; } -void mcs96_device::io_w16(UINT8 adr, UINT16 data) +void mcs96_device::io_w16(uint8_t adr, uint16_t data) { switch(adr) { case 0: @@ -494,7 +494,7 @@ void mcs96_device::io_w16(UINT8 adr, UINT16 data) return; } -UINT8 mcs96_device::io_r8(UINT8 adr) +uint8_t mcs96_device::io_r8(uint8_t adr) { switch(adr) { case 0x00: @@ -504,26 +504,26 @@ UINT8 mcs96_device::io_r8(UINT8 adr) case 0x08: return PSW; } - UINT8 data = 0x00; + uint8_t data = 0x00; logerror("%s: io_r8 %02x, %02x (%04x)\n", tag(), adr, data, PPC); return data; } -UINT16 mcs96_device::io_r16(UINT8 adr) +uint16_t mcs96_device::io_r16(uint8_t adr) { if(adr < 2) return 0x0000; - UINT16 data = 0x0000; + uint16_t data = 0x0000; logerror("%s: io_r16 %02x, %04x (%04x)\n", tag(), adr, data, PPC); return data; } -void mcs96_device::reg_w8(UINT8 adr, UINT8 data) +void mcs96_device::reg_w8(uint8_t adr, uint8_t data) { if(adr < 0x18) io_w8(adr, data); else { - UINT16 &r = R[(adr - 0x18) >> 1]; + uint16_t &r = R[(adr - 0x18) >> 1]; if(adr & 0x01) r = (r & 0x00ff) | (data << 8); else @@ -531,7 +531,7 @@ void mcs96_device::reg_w8(UINT8 adr, UINT8 data) } } -void mcs96_device::reg_w16(UINT8 adr, UINT16 data) +void mcs96_device::reg_w16(uint8_t adr, uint16_t data) { adr &= 0xfe; if(adr < 0x18) @@ -540,19 +540,19 @@ void mcs96_device::reg_w16(UINT8 adr, UINT16 data) R[(adr-0x18) >> 1] = data; } -UINT8 mcs96_device::reg_r8(UINT8 adr) +uint8_t mcs96_device::reg_r8(uint8_t adr) { if(adr < 0x18) return io_r8(adr); - UINT16 data = R[(adr - 0x18) >> 1]; + uint16_t data = R[(adr - 0x18) >> 1]; if(adr & 0x01) return data >> 8; else return data; } -UINT16 mcs96_device::reg_r16(UINT8 adr) +uint16_t mcs96_device::reg_r16(uint8_t adr) { adr &= 0xfe; if(adr < 0x18) @@ -561,12 +561,12 @@ UINT16 mcs96_device::reg_r16(UINT8 adr) return R[(adr-0x18) >> 1]; } -void mcs96_device::any_w8(UINT16 adr, UINT8 data) +void mcs96_device::any_w8(uint16_t adr, uint8_t data) { if(adr < 0x18) io_w8(adr, data); else if(adr < 0x100) { - UINT16 &r = R[(adr - 0x18) >> 1]; + uint16_t &r = R[(adr - 0x18) >> 1]; if(adr & 0x01) r = (r & 0x00ff) | (data << 8); else @@ -575,7 +575,7 @@ void mcs96_device::any_w8(UINT16 adr, UINT8 data) program->write_byte(adr, data); } -void mcs96_device::any_w16(UINT16 adr, UINT16 data) +void mcs96_device::any_w16(uint16_t adr, uint16_t data) { adr &= 0xfffe; if(adr < 0x18) @@ -586,12 +586,12 @@ void mcs96_device::any_w16(UINT16 adr, UINT16 data) program->write_word(adr, data); } -UINT8 mcs96_device::any_r8(UINT16 adr) +uint8_t mcs96_device::any_r8(uint16_t adr) { if(adr < 0x18) return io_r8(adr); else if(adr < 0x100) { - UINT16 data = R[(adr - 0x18) >> 1]; + uint16_t data = R[(adr - 0x18) >> 1]; if(adr & 0x01) return data >> 8; else @@ -600,7 +600,7 @@ UINT8 mcs96_device::any_r8(UINT16 adr) return program->read_byte(adr); } -UINT16 mcs96_device::any_r16(UINT16 adr) +uint16_t mcs96_device::any_r16(uint16_t adr) { adr &= 0xfffe; if(adr < 0x18) @@ -611,13 +611,13 @@ UINT16 mcs96_device::any_r16(UINT16 adr) return program->read_word(adr); } -UINT8 mcs96_device::do_addb(UINT8 v1, UINT8 v2) +uint8_t mcs96_device::do_addb(uint8_t v1, uint8_t v2) { - UINT16 sum = v1+v2; + uint16_t sum = v1+v2; PSW &= ~(F_Z|F_N|F_C|F_V); - if(!UINT8(sum)) + if(!uint8_t(sum)) PSW |= F_Z; - else if(INT8(sum) < 0) + else if(int8_t(sum) < 0) PSW |= F_N; if(~(v1^v2) & (v1^sum) & 0x80) PSW |= F_V|F_VT; @@ -626,13 +626,13 @@ UINT8 mcs96_device::do_addb(UINT8 v1, UINT8 v2) return sum; } -UINT16 mcs96_device::do_add(UINT16 v1, UINT16 v2) +uint16_t mcs96_device::do_add(uint16_t v1, uint16_t v2) { - UINT32 sum = v1+v2; + uint32_t sum = v1+v2; PSW &= ~(F_Z|F_N|F_C|F_V); - if(!UINT16(sum)) + if(!uint16_t(sum)) PSW |= F_Z; - else if(INT16(sum) < 0) + else if(int16_t(sum) < 0) PSW |= F_N; if(~(v1^v2) & (v1^sum) & 0x8000) PSW |= F_V|F_VT; @@ -641,13 +641,13 @@ UINT16 mcs96_device::do_add(UINT16 v1, UINT16 v2) return sum; } -UINT8 mcs96_device::do_subb(UINT8 v1, UINT8 v2) +uint8_t mcs96_device::do_subb(uint8_t v1, uint8_t v2) { - UINT16 diff = v1 - v2; + uint16_t diff = v1 - v2; PSW &= ~(F_N|F_V|F_Z|F_C); - if(!UINT8(diff)) + if(!uint8_t(diff)) PSW |= F_Z; - else if(INT8(diff) < 0) + else if(int8_t(diff) < 0) PSW |= F_N; if((v1^v2) & (v1^diff) & 0x80) PSW |= F_V; @@ -656,13 +656,13 @@ UINT8 mcs96_device::do_subb(UINT8 v1, UINT8 v2) return diff; } -UINT16 mcs96_device::do_sub(UINT16 v1, UINT16 v2) +uint16_t mcs96_device::do_sub(uint16_t v1, uint16_t v2) { - UINT32 diff = v1 - v2; + uint32_t diff = v1 - v2; PSW &= ~(F_N|F_V|F_Z|F_C); - if(!UINT16(diff)) + if(!uint16_t(diff)) PSW |= F_Z; - else if(INT16(diff) < 0) + else if(int16_t(diff) < 0) PSW |= F_N; if((v1^v2) & (v1^diff) & 0x8000) PSW |= F_V; @@ -671,13 +671,13 @@ UINT16 mcs96_device::do_sub(UINT16 v1, UINT16 v2) return diff; } -UINT8 mcs96_device::do_addcb(UINT8 v1, UINT8 v2) +uint8_t mcs96_device::do_addcb(uint8_t v1, uint8_t v2) { - UINT16 sum = v1+v2+(PSW & F_C ? 1 : 0); + uint16_t sum = v1+v2+(PSW & F_C ? 1 : 0); PSW &= ~(F_Z|F_N|F_C|F_V); - if(!UINT8(sum)) + if(!uint8_t(sum)) PSW |= F_Z; - else if(INT8(sum) < 0) + else if(int8_t(sum) < 0) PSW |= F_N; if(~(v1^v2) & (v1^sum) & 0x80) PSW |= F_V|F_VT; @@ -686,13 +686,13 @@ UINT8 mcs96_device::do_addcb(UINT8 v1, UINT8 v2) return sum; } -UINT16 mcs96_device::do_addc(UINT16 v1, UINT16 v2) +uint16_t mcs96_device::do_addc(uint16_t v1, uint16_t v2) { - UINT32 sum = v1+v2+(PSW & F_C ? 1 : 0); + uint32_t sum = v1+v2+(PSW & F_C ? 1 : 0); PSW &= ~(F_Z|F_N|F_C|F_V); - if(!UINT16(sum)) + if(!uint16_t(sum)) PSW |= F_Z; - else if(INT16(sum) < 0) + else if(int16_t(sum) < 0) PSW |= F_N; if(~(v1^v2) & (v1^sum) & 0x8000) PSW |= F_V|F_VT; @@ -701,13 +701,13 @@ UINT16 mcs96_device::do_addc(UINT16 v1, UINT16 v2) return sum; } -UINT8 mcs96_device::do_subcb(UINT8 v1, UINT8 v2) +uint8_t mcs96_device::do_subcb(uint8_t v1, uint8_t v2) { - UINT16 diff = v1 - v2 - (PSW & F_C ? 0 : 1); + uint16_t diff = v1 - v2 - (PSW & F_C ? 0 : 1); PSW &= ~(F_N|F_V|F_Z|F_C); - if(!UINT8(diff)) + if(!uint8_t(diff)) PSW |= F_Z; - else if(INT8(diff) < 0) + else if(int8_t(diff) < 0) PSW |= F_N; if((v1^v2) & (v1^diff) & 0x80) PSW |= F_V; @@ -716,13 +716,13 @@ UINT8 mcs96_device::do_subcb(UINT8 v1, UINT8 v2) return diff; } -UINT16 mcs96_device::do_subc(UINT16 v1, UINT16 v2) +uint16_t mcs96_device::do_subc(uint16_t v1, uint16_t v2) { - UINT32 diff = v1 - v2 - (PSW & F_C ? 0 : 1); + uint32_t diff = v1 - v2 - (PSW & F_C ? 0 : 1); PSW &= ~(F_N|F_V|F_Z|F_C); - if(!UINT16(diff)) + if(!uint16_t(diff)) PSW |= F_Z; - else if(INT16(diff) < 0) + else if(int16_t(diff) < 0) PSW |= F_N; if((v1^v2) & (v1^diff) & 0x8000) PSW |= F_V; @@ -731,21 +731,21 @@ UINT16 mcs96_device::do_subc(UINT16 v1, UINT16 v2) return diff; } -void mcs96_device::set_nz8(UINT8 v) +void mcs96_device::set_nz8(uint8_t v) { PSW &= ~(F_N|F_V|F_Z|F_C); if(!v) PSW |= F_Z; - else if(INT8(v) < 0) + else if(int8_t(v) < 0) PSW |= F_N; } -void mcs96_device::set_nz16(UINT16 v) +void mcs96_device::set_nz16(uint16_t v) { PSW &= ~(F_N|F_V|F_Z|F_C); if(!v) PSW |= F_Z; - else if(INT16(v) < 0) + else if(int16_t(v) < 0) PSW |= F_N; } diff --git a/src/devices/cpu/mcs96/mcs96.h b/src/devices/cpu/mcs96/mcs96.h index 0111361899c..2f372cdab5b 100644 --- a/src/devices/cpu/mcs96/mcs96.h +++ b/src/devices/cpu/mcs96/mcs96.h @@ -17,7 +17,7 @@ public: EXINT_LINE = 1 }; - mcs96_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int data_width, const char *shortname, const char *source); + mcs96_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int data_width, const char *shortname, const char *source); protected: enum { @@ -73,9 +73,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -88,61 +88,61 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_generic(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options, const disasm_entry *entries); + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_generic(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options, const disasm_entry *entries); address_space_config program_config; address_space *program; direct_read_data *direct; int icount, bcount, inst_state, cycles_scaling; - UINT8 pending_irq; - UINT16 PC, PPC, PSW; - UINT16 OP1; - UINT8 OP2, OP3, OPI; - UINT32 TMP; - UINT16 R[0x74]; + uint8_t pending_irq; + uint16_t PC, PPC, PSW; + uint16_t OP1; + uint8_t OP2, OP3, OPI; + uint32_t TMP; + uint16_t R[0x74]; bool irq_requested; virtual void do_exec_full() = 0; virtual void do_exec_partial() = 0; - virtual void internal_update(UINT64 current_time) = 0; - virtual void io_w8(UINT8 adr, UINT8 data) = 0; - virtual void io_w16(UINT8 adr, UINT16 data) = 0; - virtual UINT8 io_r8(UINT8 adr) = 0; - virtual UINT16 io_r16(UINT8 adr) = 0; + virtual void internal_update(uint64_t current_time) = 0; + virtual void io_w8(uint8_t adr, uint8_t data) = 0; + virtual void io_w16(uint8_t adr, uint16_t data) = 0; + virtual uint8_t io_r8(uint8_t adr) = 0; + virtual uint16_t io_r16(uint8_t adr) = 0; - void recompute_bcount(UINT64 event_time); - static std::string regname(UINT8 reg); + void recompute_bcount(uint64_t event_time); + static std::string regname(uint8_t reg); inline void next(int cycles) { icount -= cycles_scaling*cycles; inst_state = STATE_FETCH; } inline void next_noirq(int cycles) { icount -= cycles_scaling*cycles; inst_state = STATE_FETCH_NOIRQ; } void check_irq(); - inline UINT8 read_pc() { return direct->read_byte(PC++); } + inline uint8_t read_pc() { return direct->read_byte(PC++); } - void reg_w8(UINT8 adr, UINT8 data); - void reg_w16(UINT8 adr, UINT16 data); - void any_w8(UINT16 adr, UINT8 data); - void any_w16(UINT16 adr, UINT16 data); + void reg_w8(uint8_t adr, uint8_t data); + void reg_w16(uint8_t adr, uint16_t data); + void any_w8(uint16_t adr, uint8_t data); + void any_w16(uint16_t adr, uint16_t data); - UINT8 reg_r8(UINT8 adr); - UINT16 reg_r16(UINT8 adr); - UINT8 any_r8(UINT16 adr); - UINT16 any_r16(UINT16 adr); + uint8_t reg_r8(uint8_t adr); + uint16_t reg_r16(uint8_t adr); + uint8_t any_r8(uint16_t adr); + uint16_t any_r16(uint16_t adr); - UINT8 do_addb(UINT8 v1, UINT8 v2); - UINT16 do_add(UINT16 v1, UINT16 v2); - UINT8 do_subb(UINT8 v1, UINT8 v2); - UINT16 do_sub(UINT16 v1, UINT16 v2); + uint8_t do_addb(uint8_t v1, uint8_t v2); + uint16_t do_add(uint16_t v1, uint16_t v2); + uint8_t do_subb(uint8_t v1, uint8_t v2); + uint16_t do_sub(uint16_t v1, uint16_t v2); - UINT8 do_addcb(UINT8 v1, UINT8 v2); - UINT16 do_addc(UINT16 v1, UINT16 v2); - UINT8 do_subcb(UINT8 v1, UINT8 v2); - UINT16 do_subc(UINT16 v1, UINT16 v2); + uint8_t do_addcb(uint8_t v1, uint8_t v2); + uint16_t do_addc(uint16_t v1, uint16_t v2); + uint8_t do_subcb(uint8_t v1, uint8_t v2); + uint16_t do_subc(uint16_t v1, uint16_t v2); - void set_nz8(UINT8 v); - void set_nz16(UINT16 v); + void set_nz8(uint8_t v); + void set_nz16(uint16_t v); #define O(o) void o ## _full(); void o ## _partial() diff --git a/src/devices/cpu/mcs96/mcs96ops.lst b/src/devices/cpu/mcs96/mcs96ops.lst index 3c2516ae54a..062b70706bf 100644 --- a/src/devices/cpu/mcs96/mcs96ops.lst +++ b/src/devices/cpu/mcs96/mcs96ops.lst @@ -37,7 +37,7 @@ fetch_noirq inst_state = OP1; eadr rel8 - OP1 = INT8(read_pc()); + OP1 = int8_t(read_pc()); eadr rel11 OP1 = read_pc(); @@ -51,11 +51,11 @@ eadr rel16 eadr rrel8 OP2 = read_pc(); - OP1 = INT8(read_pc()); + OP1 = int8_t(read_pc()); eadr brrel8 OP2 = read_pc(); - OP1 = INT8(read_pc()); + OP1 = int8_t(read_pc()); eadr direct_1 OP1 = read_pc(); @@ -134,7 +134,7 @@ eadr indexed_1 OPI &= 0xfe; OP1 |= read_pc() << 8; } else - OP1 = INT8(OP1); + OP1 = int8_t(OP1); if(OPI) { OP1 += reg_r16(OPI); } @@ -196,7 +196,7 @@ macro post_indexed $cycles1 $cycles2 06 ext direct_1 OP1 &= 0xfc; - TMP = INT16(reg_r16(OP1)); + TMP = int16_t(reg_r16(OP1)); set_nz16(TMP); reg_w16(OP1+2, TMP >> 16); next(4); @@ -216,10 +216,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 16 && (TMP & (0x0001 << (OP1-1)))) PSW |= F_C; - TMP = UINT16(TMP) >> OP1; + TMP = uint16_t(TMP) >> OP1; if(!TMP) PSW |= F_Z; - else if(INT16(TMP) < 0) + else if(int16_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -234,10 +234,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 16 && (TMP & (0x8000 >> (OP1-1)))) PSW |= F_C; - TMP = UINT16(TMP << OP1); + TMP = uint16_t(TMP << OP1); if(!TMP) PSW |= F_Z; - else if(INT16(TMP) < 0) + else if(int16_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -252,10 +252,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 16 && (TMP & (0x0001 << (OP1-1)))) PSW |= F_C; - TMP = INT16(TMP) >> OP1; + TMP = int16_t(TMP) >> OP1; if(!TMP) PSW |= F_Z; - else if(INT16(TMP) < 0) + else if(int16_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -275,7 +275,7 @@ macro post_indexed $cycles1 $cycles2 TMP = TMP >> OP1; if(!TMP) PSW |= F_Z; - else if(INT32(TMP) < 0) + else if(int32_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -296,7 +296,7 @@ macro post_indexed $cycles1 $cycles2 TMP = TMP << OP1; if(!TMP) PSW |= F_Z; - else if(INT32(TMP) < 0) + else if(int32_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -314,10 +314,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && (TMP & (0x00000001 << (OP1-1)))) PSW |= F_C; - TMP = INT32(TMP) >> OP1; + TMP = int32_t(TMP) >> OP1; if(!TMP) PSW |= F_Z; - else if(INT32(TMP) < 0) + else if(int32_t(TMP) < 0) PSW |= F_N; reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -327,7 +327,7 @@ macro post_indexed $cycles1 $cycles2 OP2 &= 0xfc; TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2) << 16; - for(OP3 = 0; OP3 < 31 && INT32(TMP) >= 0; OP3++); + for(OP3 = 0; OP3 < 31 && int32_t(TMP) >= 0; OP3++); PSW &= ~(F_Z|F_N|F_C); if(!TMP) PSW |= F_Z; @@ -360,7 +360,7 @@ macro post_indexed $cycles1 $cycles2 16 extb direct_1 OP1 &= 0xfe; - TMP = INT8(reg_r8(OP1)); + TMP = int8_t(reg_r8(OP1)); set_nz8(TMP); reg_w16(OP1, TMP); next(4); @@ -380,10 +380,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 8 && (TMP & (0x01 << (OP1-1)))) PSW |= F_C; - TMP = UINT8(TMP) >> OP1; + TMP = uint8_t(TMP) >> OP1; if(!TMP) PSW |= F_Z; - else if(INT8(TMP) < 0) + else if(int8_t(TMP) < 0) PSW |= F_N; reg_w8(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -398,10 +398,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 8 && (TMP & (0x80 >> (OP1-1)))) PSW |= F_C; - TMP = UINT8(TMP << OP1); + TMP = uint8_t(TMP << OP1); if(!TMP) PSW |= F_Z; - else if(INT8(TMP) < 0) + else if(int8_t(TMP) < 0) PSW |= F_N; reg_w8(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -416,10 +416,10 @@ macro post_indexed $cycles1 $cycles2 PSW |= F_ST; if(OP1 >= 1 && OP1 <= 8 && (TMP & (0x01 << (OP1-1)))) PSW |= F_C; - TMP = UINT8(INT8(TMP) >> OP1); + TMP = uint8_t(int8_t(TMP) >> OP1); if(!TMP) PSW |= F_Z; - else if(INT8(TMP) < 0) + else if(int8_t(TMP) < 0) PSW |= F_N; reg_w8(OP2, TMP); next(OP1 ? 7+OP1 : 8); @@ -560,14 +560,14 @@ macro post_indexed $cycles1 $cycles2 fe4c mul direct_3 TMP = reg_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); OP3 &= 0xfc; reg_w16(OP3, TMP); reg_w16(OP3+2, TMP >> 16); next(30); fe4d mul immed_3w - TMP = INT16(OP1) * INT16(reg_r16(OP2)); + TMP = int16_t(OP1) * int16_t(reg_r16(OP2)); OP3 &= 0xfc; reg_w16(OP3, TMP); reg_w16(OP3+2, TMP >> 16); @@ -575,7 +575,7 @@ fe4d mul immed_3w fe4e mul indirect_3 TMP = any_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); OP3 &= 0xfc; reg_w16(OP3, TMP); reg_w16(OP3+2, TMP >> 16); @@ -583,7 +583,7 @@ fe4e mul indirect_3 fe4f mul indexed_3 TMP = any_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); OP3 &= 0xfc; reg_w16(OP3, TMP); reg_w16(OP3+2, TMP >> 16); @@ -687,24 +687,24 @@ fe4f mul indexed_3 fe5c mulb direct_3 TMP = reg_r8(OP1); - TMP = INT8(reg_r8(OP2)) * INT8(TMP); + TMP = int8_t(reg_r8(OP2)) * int8_t(TMP); reg_w16(OP3, TMP); next(22); fe5d mulb immed_3b - TMP = INT8(OP1) * INT8(reg_r8(OP2)); + TMP = int8_t(OP1) * int8_t(reg_r8(OP2)); reg_w16(OP3, TMP); next(22); fe5e mulb indirect_3 TMP = any_r8(OP1); - TMP = INT8(reg_r8(OP2)) * INT8(TMP); + TMP = int8_t(reg_r8(OP2)) * int8_t(TMP); reg_w16(OP3, TMP); post_indirect 1 24 25 // +5 when external fe5f mulb indexed_3 TMP = any_r8(OP1); - TMP = INT8(reg_r8(OP2)) * INT8(TMP); + TMP = int8_t(reg_r8(OP2)) * int8_t(TMP); reg_w16(OP3, TMP); post_indexed 24 25 // +5 when external @@ -815,14 +815,14 @@ fe5f mulb indexed_3 fe6c mul direct_2 OP2 &= 0xfc; TMP = reg_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); next(29); fe6d mul immed_2w OP2 &= 0xfc; - TMP = INT16(OP1) * INT16(reg_r16(OP2)); + TMP = int16_t(OP1) * int16_t(reg_r16(OP2)); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); next(30); @@ -830,7 +830,7 @@ fe6d mul immed_2w fe6e mul indirect_2 OP2 &= 0xfc; TMP = any_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); post_indirect 2 31 32 // +5 when external @@ -838,7 +838,7 @@ fe6e mul indirect_2 fe6f mul indexed_2 OP2 &= 0xfc; TMP = any_r16(OP1); - TMP = INT16(reg_r16(OP2)) * INT16(TMP); + TMP = int16_t(reg_r16(OP2)) * int16_t(TMP); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); post_indexed 31 32 // +5 when external @@ -946,27 +946,27 @@ fe6f mul indexed_2 fe7c mulb direct_2 OP2 &= 0xfe; TMP = reg_r8(OP1); - TMP = INT8(reg_r16(OP2)) * INT8(TMP); + TMP = int8_t(reg_r16(OP2)) * int8_t(TMP); reg_w16(OP2, TMP); next(21); fe7d mulb immed_2b OP2 &= 0xfe; - TMP = INT8(OP1) * INT8(reg_r8(OP2)); + TMP = int8_t(OP1) * int8_t(reg_r8(OP2)); reg_w16(OP2, TMP); next(21); fe7e mulb indirect_2 OP2 &= 0xfe; TMP = any_r8(OP1); - TMP = INT8(reg_r8(OP2)) * INT8(TMP); + TMP = int8_t(reg_r8(OP2)) * int8_t(TMP); reg_w16(OP2, TMP); post_indirect 1 23 24 // +5 when external fe7f mulb indexed_2 OP2 &= 0xfe; TMP = any_r16(OP1); - TMP = INT8(reg_r16(OP2)) * INT8(TMP); + TMP = int8_t(reg_r16(OP2)) * int8_t(TMP); reg_w16(OP2, TMP); post_indexed 23 24 // +5 when external @@ -1050,7 +1050,7 @@ fe7f mulb indexed_2 if(OP1) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - UINT32 TMP2 = TMP / OP1; + uint32_t TMP2 = TMP / OP1; if(TMP2 > 65535) PSW |= F_V|F_VT; TMP = TMP % OP1; @@ -1066,7 +1066,7 @@ fe7f mulb indexed_2 if(OP1) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - UINT32 TMP2 = TMP / OP1; + uint32_t TMP2 = TMP / OP1; if(TMP2 > 65535) PSW |= F_V|F_VT; TMP = TMP % OP1; @@ -1079,11 +1079,11 @@ fe7f mulb indexed_2 8e divu indirect_2 OP2 &= 0xfc; PSW &= ~F_V; - UINT32 d = any_r16(OP1); + uint32_t d = any_r16(OP1); if(d) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - UINT32 TMP2 = TMP / d; + uint32_t TMP2 = TMP / d; if(TMP2 > 65535) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1096,11 +1096,11 @@ fe7f mulb indexed_2 8f divu indexed_2 OP2 &= 0xfc; PSW &= ~F_V; - UINT32 d = any_r16(OP1); + uint32_t d = any_r16(OP1); if(d) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - UINT32 TMP2 = TMP / d; + uint32_t TMP2 = TMP / d; if(TMP2 > 65535) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1117,10 +1117,10 @@ fe8c div direct_2 if(OP1) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - INT32 TMP2 = INT32(TMP) / INT16(OP1); + int32_t TMP2 = int32_t(TMP) / int16_t(OP1); if(TMP2 > 32767 || TMP2 < -32768) PSW |= F_V|F_VT; - TMP = TMP % INT16(OP1); + TMP = TMP % int16_t(OP1); TMP = (TMP2 & 0xffff) | ((TMP & 0xffff) << 16); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -1133,10 +1133,10 @@ fe8d div immed_2w if(OP1) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - INT32 TMP2 = INT32(TMP) / INT16(OP1); + int32_t TMP2 = int32_t(TMP) / int16_t(OP1); if(TMP2 > 32767 || TMP2 < -32768) PSW |= F_V|F_VT; - TMP = TMP % INT16(OP1); + TMP = TMP % int16_t(OP1); TMP = (TMP2 & 0xffff) | ((TMP & 0xffff) << 16); reg_w16(OP2, TMP); reg_w16(OP2+2, TMP >> 16); @@ -1146,11 +1146,11 @@ fe8d div immed_2w fe8e div indirect_2 OP2 &= 0xfc; PSW &= ~F_V; - INT32 d = INT16(any_r16(OP1)); + int32_t d = int16_t(any_r16(OP1)); if(d) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - INT32 TMP2 = INT32(TMP) / d; + int32_t TMP2 = int32_t(TMP) / d; if(TMP2 > 32767 || TMP2 < -32768) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1163,11 +1163,11 @@ fe8e div indirect_2 fe8f div indexed_2 OP2 &= 0xfc; PSW &= ~F_V; - INT32 d = INT16(any_r16(OP1)); + int32_t d = int16_t(any_r16(OP1)); if(d) { TMP = reg_r16(OP2); TMP |= reg_r16(OP2+2); - INT32 TMP2 = INT32(TMP) / d; + int32_t TMP2 = int32_t(TMP) / d; if(TMP2 > 32767 || TMP2 < -32768) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1255,7 +1255,7 @@ fe8f div indexed_2 OP1 = reg_r8(OP1); if(OP1) { TMP = reg_r16(OP2); - UINT32 TMP2 = TMP / OP1; + uint32_t TMP2 = TMP / OP1; if(TMP2 > 255) PSW |= F_V|F_VT; TMP = TMP % OP1; @@ -1268,7 +1268,7 @@ fe8f div indexed_2 PSW &= ~F_V; if(OP1) { TMP = reg_r16(OP2); - UINT32 TMP2 = TMP / OP1; + uint32_t TMP2 = TMP / OP1; if(TMP2 > 255) PSW |= F_V|F_VT; TMP = TMP % OP1; @@ -1279,10 +1279,10 @@ fe8f div indexed_2 9e divub indirect_2 PSW &= ~F_V; - UINT32 d = any_r8(OP1); + uint32_t d = any_r8(OP1); if(d) { TMP = reg_r16(OP2); - UINT32 TMP2 = TMP / d; + uint32_t TMP2 = TMP / d; if(TMP2 > 255) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1293,10 +1293,10 @@ fe8f div indexed_2 9f divub indexed_2 PSW &= ~F_V; - UINT32 d = any_r8(OP1); + uint32_t d = any_r8(OP1); if(d) { TMP = reg_r16(OP2); - UINT32 TMP2 = TMP / d; + uint32_t TMP2 = TMP / d; if(TMP2 > 255) PSW |= F_V|F_VT; TMP = TMP % d; @@ -1310,10 +1310,10 @@ fe9c divb direct_2 OP1 = reg_r8(OP1); if(OP1) { TMP = reg_r16(OP2); - UINT32 TMP2 = INT16(TMP) / INT8(OP1); - if(INT16(TMP2) > 127 || INT16(TMP2) < -128) + uint32_t TMP2 = int16_t(TMP) / int8_t(OP1); + if(int16_t(TMP2) > 127 || int16_t(TMP2) < -128) PSW |= F_V|F_VT; - TMP = INT16(TMP) % INT8(OP1); + TMP = int16_t(TMP) % int8_t(OP1); TMP = (TMP2 & 0xff) | ((TMP & 0xff) << 8); reg_w16(OP2, TMP); } @@ -1323,10 +1323,10 @@ fe9d divb immed_2b PSW &= ~F_V; if(OP1) { TMP = reg_r16(OP2); - UINT32 TMP2 = INT16(TMP) / INT8(OP1); - if(INT16(TMP2) > 127 || INT16(TMP2) < -128) + uint32_t TMP2 = int16_t(TMP) / int8_t(OP1); + if(int16_t(TMP2) > 127 || int16_t(TMP2) < -128) PSW |= F_V|F_VT; - TMP = INT16(TMP) % INT8(OP1); + TMP = int16_t(TMP) % int8_t(OP1); TMP = (TMP2 & 0xff) | ((TMP & 0xff) << 8); reg_w16(OP2, TMP); } @@ -1334,13 +1334,13 @@ fe9d divb immed_2b fe9e divb indirect_2 PSW &= ~F_V; - INT32 d = INT8(any_r8(OP1)); + int32_t d = int8_t(any_r8(OP1)); if(d) { TMP = reg_r16(OP2); - UINT32 TMP2 = INT16(TMP) / d; - if(INT16(TMP2) > 127 || INT16(TMP2) < -128) + uint32_t TMP2 = int16_t(TMP) / d; + if(int16_t(TMP2) > 127 || int16_t(TMP2) < -128) PSW |= F_V|F_VT; - TMP = INT16(TMP) % d; + TMP = int16_t(TMP) % d; TMP = (TMP2 & 0xff) | ((TMP & 0xff) << 8); reg_w16(OP2, TMP); } @@ -1348,13 +1348,13 @@ fe9e divb indirect_2 fe9f divb indexed_2 PSW &= ~F_V; - INT32 d = INT8(any_r8(OP1)); + int32_t d = int8_t(any_r8(OP1)); if(d) { TMP = reg_r16(OP2); - UINT32 TMP2 = INT16(TMP) / d; - if(INT16(TMP2) > 127 || INT16(TMP2) < -128) + uint32_t TMP2 = int16_t(TMP) / d; + if(int16_t(TMP2) > 127 || int16_t(TMP2) < -128) PSW |= F_V|F_VT; - TMP = INT16(TMP) % d; + TMP = int16_t(TMP) % d; TMP = (TMP2 & 0xff) | ((TMP & 0xff) << 8); reg_w16(OP2, TMP); } @@ -1423,19 +1423,19 @@ ab subc indexed_2 post_indexed 6 7 // +5 when external ac ldbze direct_2 - reg_w16(OP2, UINT8(reg_r8(OP1))); + reg_w16(OP2, uint8_t(reg_r8(OP1))); next(4); ad ldbze immed_2b - reg_w16(OP2, UINT8(OP1)); + reg_w16(OP2, uint8_t(OP1)); next(4); ae ldbze indirect_2 - reg_w16(OP2, UINT8(any_r8(OP1))); + reg_w16(OP2, uint8_t(any_r8(OP1))); post_indirect 1 6 7 // +5 when external af ldbze indexed_2 - reg_w16(OP2, UINT8(any_r8(OP1))); + reg_w16(OP2, uint8_t(any_r8(OP1))); post_indexed 6 7 // +5 when external b0 ldb direct_2 @@ -1501,19 +1501,19 @@ bb subcb indexed_2 post_indexed 6 7 // +5 when external bc ldbse direct_2 - reg_w16(OP2, INT8(reg_r8(OP1))); + reg_w16(OP2, int8_t(reg_r8(OP1))); next(4); bd ldbse immed_2b - reg_w16(OP2, INT8(OP1)); + reg_w16(OP2, int8_t(OP1)); next(4); be ldbse indirect_2 - reg_w16(OP2, INT8(any_r8(OP1))); + reg_w16(OP2, int8_t(any_r8(OP1))); post_indirect 1 6 7 // +5 when external bf ldbse indexed_2 - reg_w16(OP2, INT8(any_r8(OP1))); + reg_w16(OP2, int8_t(any_r8(OP1))); post_indexed 6 7 // +5 when external c0 st direct_2 @@ -1752,7 +1752,7 @@ df je rel8 e0 djnz rrel8 TMP = reg_r8(OP2); - TMP = UINT8(TMP-1); + TMP = uint8_t(TMP-1); reg_w8(OP2, TMP); if(TMP) { PC += OP1; diff --git a/src/devices/cpu/melps4/m58846.cpp b/src/devices/cpu/melps4/m58846.cpp index c109c28b446..b96f479fdd9 100644 --- a/src/devices/cpu/melps4/m58846.cpp +++ b/src/devices/cpu/melps4/m58846.cpp @@ -24,13 +24,13 @@ ADDRESS_MAP_END // device definitions -m58846_device::m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m58846_device::m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : melps4_cpu_device(mconfig, M58846, "M58846", tag, owner, clock, 11, ADDRESS_MAP_NAME(program_2kx9), 7, ADDRESS_MAP_NAME(data_128x4), 12 /* number of D pins */, 2 /* subroutine page */, 1 /* interrupt page */, "m58846", __FILE__), m_timer(nullptr) { } // disasm -offs_t m58846_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t m58846_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(m58846); return CPU_DISASSEMBLE_NAME(m58846)(this, buffer, pc, oprom, opram, options); @@ -99,7 +99,7 @@ void m58846_device::device_timer(emu_timer &timer, device_timer_id id, int param reset_timer(); } -void m58846_device::write_v(UINT8 data) +void m58846_device::write_v(uint8_t data) { // d0: enable timer 1 irq // d1: enable timer 2 irq? (TODO) diff --git a/src/devices/cpu/melps4/m58846.h b/src/devices/cpu/melps4/m58846.h index 9d56cf9e216..0e754b1eafb 100644 --- a/src/devices/cpu/melps4/m58846.h +++ b/src/devices/cpu/melps4/m58846.h @@ -17,7 +17,7 @@ class m58846_device : public melps4_cpu_device { public: - m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -28,11 +28,11 @@ protected: virtual void execute_one() override; // device_disasm_interface overrides - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // timers virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void write_v(UINT8 data) override; + virtual void write_v(uint8_t data) override; emu_timer *m_timer; void reset_timer(); diff --git a/src/devices/cpu/melps4/melps4.cpp b/src/devices/cpu/melps4/melps4.cpp index a3f204e3ada..d1cd36cda32 100644 --- a/src/devices/cpu/melps4/melps4.cpp +++ b/src/devices/cpu/melps4/melps4.cpp @@ -247,7 +247,7 @@ void melps4_cpu_device::device_reset() // i/o handling //------------------------------------------------- -UINT8 melps4_cpu_device::read_gen_port(int port) +uint8_t melps4_cpu_device::read_gen_port(int port) { // input generic port switch (port) @@ -264,7 +264,7 @@ UINT8 melps4_cpu_device::read_gen_port(int port) return 0; } -void melps4_cpu_device::write_gen_port(int port, UINT8 data) +void melps4_cpu_device::write_gen_port(int port, uint8_t data) { // output generic port switch (port) @@ -293,7 +293,7 @@ int melps4_cpu_device::read_d_pin(int bit) { // read port D, return state of selected pin bit &= 0xf; - UINT16 d = (m_port_d | m_read_d(bit, 0xffff)) & m_d_mask; + uint16_t d = (m_port_d | m_read_d(bit, 0xffff)) & m_d_mask; return d >> bit & 1; } diff --git a/src/devices/cpu/melps4/melps4.h b/src/devices/cpu/melps4/melps4.h index b0aa67fd6d4..d7668d35fb6 100644 --- a/src/devices/cpu/melps4/melps4.h +++ b/src/devices/cpu/melps4/melps4.h @@ -101,7 +101,7 @@ class melps4_cpu_device : public cpu_device { public: // construction/destruction - melps4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, int d_pins, UINT8 sm_page, UINT8 int_page, const char *shortname, const char *source) + melps4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, int d_pins, uint8_t sm_page, uint8_t int_page, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 16, prgwidth, -1, program) , m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data) @@ -145,11 +145,11 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 6 - 1) / 6; } // 6 t-states per machine cycle - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 6); } // " - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1+1; } // max opcode cycles + interrupt duration - virtual UINT32 execute_input_lines() const override { return 3; } // up to 3 (some internal) + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 6 - 1) / 6; } // 6 t-states per machine cycle + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 6); } // " + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1+1; } // max opcode cycles + interrupt duration + virtual uint32_t execute_input_lines() const override { return 3; } // up to 3 (some internal) virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; virtual void execute_one(); @@ -158,8 +158,8 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; address_space_config m_program_config; @@ -177,32 +177,32 @@ protected: int m_d_pins; // number of D port pins and bitmask: 11 on '40,'41,'42,'44, 8 on '43, 12 on '45,'46, 16 on '47 int m_d_mask; // " - UINT8 m_sm_page; // subroutine default page: 14 on '40 to '44, 2 on '45,'46, 0 on '47 - UINT8 m_int_page; // interrupt routine page: 12 on '40 to '44, 1 on '45,'46, 2 on '47 - UINT8 m_xami_mask; // mask option for XAMI opcode on '40,'41,'45 (0xf for others) - UINT16 m_sp_mask; // SP opcode location(middle 4 bits): 7 on '40 to '46, 3 on '47 - UINT16 m_ba_op; // BA opcode location: 1 on '40 to '46, N/A on '47 - UINT8 m_stack_levels; // 3 levels on MELPS 4, 12 levels on MELPS 41/42 + uint8_t m_sm_page; // subroutine default page: 14 on '40 to '44, 2 on '45,'46, 0 on '47 + uint8_t m_int_page; // interrupt routine page: 12 on '40 to '44, 1 on '45,'46, 2 on '47 + uint8_t m_xami_mask; // mask option for XAMI opcode on '40,'41,'45 (0xf for others) + uint16_t m_sp_mask; // SP opcode location(middle 4 bits): 7 on '40 to '46, 3 on '47 + uint16_t m_ba_op; // BA opcode location: 1 on '40 to '46, N/A on '47 + uint8_t m_stack_levels; // 3 levels on MELPS 4, 12 levels on MELPS 41/42 // internal state, misc regs - UINT16 m_pc; // program counter (11 or 10-bit) - UINT16 m_prev_pc; - UINT16 m_stack[12]; // callstack (SK0-SKx, same size as PC) - UINT16 m_op; - UINT16 m_prev_op; - UINT8 m_bitmask; // opcode bit argument - - UINT16 m_port_d; // last written port data - UINT8 m_port_s; // " - UINT8 m_port_f; // " - UINT8 m_port_t; // " + uint16_t m_pc; // program counter (11 or 10-bit) + uint16_t m_prev_pc; + uint16_t m_stack[12]; // callstack (SK0-SKx, same size as PC) + uint16_t m_op; + uint16_t m_prev_op; + uint8_t m_bitmask; // opcode bit argument + + uint16_t m_port_d; // last written port data + uint8_t m_port_s; // " + uint8_t m_port_f; // " + uint8_t m_port_t; // " bool m_sm, m_sms; // subroutine mode flag + irq stack bool m_ba_flag; // temp flag indicates BA opcode was executed - UINT8 m_sp_param; // temp register holding SP opcode parameter - UINT8 m_cps; // DP,CY or DP',CY' selected + uint8_t m_sp_param; // temp register holding SP opcode parameter + uint8_t m_cps; // DP,CY or DP',CY' selected bool m_skip; // skip next opcode - UINT8 m_inte; // interrupt enable flag + uint8_t m_inte; // interrupt enable flag int m_intp; // external interrupt polarity ('40 to '44) bool m_irqflag[3]; // irq flags: exf, 1f, 2f (external, timer 1, timer 2) int m_int_state; // INT pin state @@ -210,24 +210,24 @@ protected: bool m_prohibit_irq; // interrupt is prohibited during certain opcodes bool m_possible_irq; // indicate that irq needs to be rechecked - UINT8 m_tmr_count[2]; // timer active count - UINT8 m_tmr_reload; // timer(2) auto reload + uint8_t m_tmr_count[2]; // timer active count + uint8_t m_tmr_reload; // timer(2) auto reload bool m_tmr_irq_enabled[2]; // work registers (unless specified, each is 4-bit) - UINT8 m_a; // accumulator - UINT8 m_b; // generic - UINT8 m_e; // 8-bit register, hold data for S output - UINT8 m_y, m_y2; // RAM index Y, Y' (Z.XX.YYYY is DP aka Data Pointer) - UINT8 m_x, m_x2; // RAM index X, X', 2-bit - UINT8 m_z, m_z2; // RAM index Z, Z', 1-bit, optional - UINT8 m_cy, m_cy2; // carry flag(s) - - UINT8 m_h; // A/D converter H or generic - UINT8 m_l; // A/D converter L or generic - UINT8 m_c; // A/D converter counter - UINT8 m_v; // timer control V - UINT8 m_w; // timer control W + uint8_t m_a; // accumulator + uint8_t m_b; // generic + uint8_t m_e; // 8-bit register, hold data for S output + uint8_t m_y, m_y2; // RAM index Y, Y' (Z.XX.YYYY is DP aka Data Pointer) + uint8_t m_x, m_x2; // RAM index X, X', 2-bit + uint8_t m_z, m_z2; // RAM index Z, Z', 1-bit, optional + uint8_t m_cy, m_cy2; // carry flag(s) + + uint8_t m_h; // A/D converter H or generic + uint8_t m_l; // A/D converter L or generic + uint8_t m_c; // A/D converter counter + uint8_t m_v; // timer control V + uint8_t m_w; // timer control W // i/o handlers devcb_read16 m_read_k; @@ -243,19 +243,19 @@ protected: devcb_write_line m_write_t; virtual void write_t_in(int state) { m_t_in_state = state; } - virtual void write_v(UINT8 data) { m_v = data; } - virtual void write_w(UINT8 data) { m_w = data; } + virtual void write_v(uint8_t data) { m_v = data; } + virtual void write_w(uint8_t data) { m_w = data; } virtual void do_interrupt(int which); virtual void check_interrupt(); - UINT8 read_gen_port(int port); - void write_gen_port(int port, UINT8 data); + uint8_t read_gen_port(int port); + void write_gen_port(int port, uint8_t data); int read_d_pin(int bit); void write_d_pin(int bit, int state); // misc internal helpers - UINT8 ram_r(); - void ram_w(UINT8 data); + uint8_t ram_r(); + void ram_w(uint8_t data); void pop_pc(); void push_pc(); diff --git a/src/devices/cpu/melps4/melps4d.cpp b/src/devices/cpu/melps4/melps4d.cpp index 4c2ca2fd9d4..5d6981ec25e 100644 --- a/src/devices/cpu/melps4/melps4d.cpp +++ b/src/devices/cpu/melps4/melps4d.cpp @@ -46,7 +46,7 @@ static const char *const em_name[] = }; // number of bits per opcode parameter -static const UINT8 em_bits[] = +static const uint8_t em_bits[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -64,7 +64,7 @@ static const UINT8 em_bits[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 em_flags[] = +static const uint32_t em_flags[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -83,7 +83,7 @@ static const UINT32 em_flags[] = // M58846 disasm -static const UINT8 m58846_opmap[0xc0] = +static const uint8_t m58846_opmap[0xc0] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F em_NOP, em_BA, em_INY, em_DEY, em_DI, em_EI, em_RU, em_SU, 0, em_TABE, em_AM, em_OSE, em_TYA, 0, 0, em_CMA, // 0x @@ -102,11 +102,11 @@ static const UINT8 m58846_opmap[0xc0] = CPU_DISASSEMBLE(m58846) { - UINT16 op = (oprom[0] | oprom[1] << 8) & 0x1ff; + uint16_t op = (oprom[0] | oprom[1] << 8) & 0x1ff; char *dst = buffer; // get opcode - UINT8 instr; + uint8_t instr; if (op >= 0x180) instr = em_B; else if (op >= 0x100) @@ -119,18 +119,18 @@ CPU_DISASSEMBLE(m58846) dst += sprintf(dst, "%-6s", em_name[instr]); // get immediate param - UINT8 bits = em_bits[instr]; + uint8_t bits = em_bits[instr]; // special case for LXY x,y if (instr == em_LXY) { - UINT8 x = op >> 4 & 3; - UINT8 y = op & 0xf; + uint8_t x = op >> 4 & 3; + uint8_t y = op & 0xf; dst += sprintf(dst, " %d,%d", x, y); } else if (bits > 0) { - UINT8 param = op & ((1 << bits) - 1); + uint8_t param = op & ((1 << bits) - 1); if (bits > 4) dst += sprintf(dst, " $%02X", param); else diff --git a/src/devices/cpu/melps4/melps4op.cpp b/src/devices/cpu/melps4/melps4op.cpp index 4f77764a66b..44d17ae2d4c 100644 --- a/src/devices/cpu/melps4/melps4op.cpp +++ b/src/devices/cpu/melps4/melps4op.cpp @@ -8,15 +8,15 @@ // internal helpers -inline UINT8 melps4_cpu_device::ram_r() +inline uint8_t melps4_cpu_device::ram_r() { - UINT8 address = (m_z << 6 | m_x << 4 | m_y) & m_datamask; + uint8_t address = (m_z << 6 | m_x << 4 | m_y) & m_datamask; return m_data->read_byte(address) & 0xf; } -inline void melps4_cpu_device::ram_w(UINT8 data) +inline void melps4_cpu_device::ram_w(uint8_t data) { - UINT8 address = (m_z << 6 | m_x << 4 | m_y) & m_datamask; + uint8_t address = (m_z << 6 | m_x << 4 | m_y) & m_datamask; m_data->write_byte(address, data & 0xf); } @@ -134,7 +134,7 @@ void melps4_cpu_device::op_lcps() m_cps = m_op & 1; // swap registers - UINT8 x, y, z, cy; + uint8_t x, y, z, cy; x = m_x; y = m_y; z = m_z; @@ -171,7 +171,7 @@ void melps4_cpu_device::op_tam() void melps4_cpu_device::op_xam() { // XAM j: exchange RAM with A, xor X with j - UINT8 a = m_a; + uint8_t a = m_a; m_a = ram_r(); ram_w(a); m_x ^= m_op & 3; @@ -227,7 +227,7 @@ void melps4_cpu_device::op_amcs() void melps4_cpu_device::op_a() { // A n: add immediate to A, skip next on no carry (except when n=6) - UINT8 n = m_op & 0xf; + uint8_t n = m_op & 0xf; m_a += n; m_skip = !(m_a & 0x10 || n == 6); m_a &= 0xf; @@ -260,7 +260,7 @@ void melps4_cpu_device::op_cma() void melps4_cpu_device::op_rl() { // RL(undocumented): rotate A left through carry - UINT8 c = m_a >> 3 & 1; + uint8_t c = m_a >> 3 & 1; m_a = (m_a << 1 | m_cy) & 0xf; m_cy = c; } @@ -268,7 +268,7 @@ void melps4_cpu_device::op_rl() void melps4_cpu_device::op_rr() { // RR(undocumented): rotate A right through carry - UINT8 c = m_a & 1; + uint8_t c = m_a & 1; m_a = m_a >> 1 | m_cy << 3; m_cy = c; } @@ -333,7 +333,7 @@ void melps4_cpu_device::op_taj() void melps4_cpu_device::op_xal() { // XAL: exchange A with L - UINT8 a = m_a; + uint8_t a = m_a; m_a = m_l; m_l = a; } @@ -341,7 +341,7 @@ void melps4_cpu_device::op_xal() void melps4_cpu_device::op_xah() { // XAH: exchange A with H - UINT8 a = m_a; + uint8_t a = m_a; m_a = m_h; m_h = a; } @@ -362,7 +362,7 @@ void melps4_cpu_device::op_dec() void melps4_cpu_device::op_shl() { // SHL: set bit in L or H designated by C - UINT8 mask = 1 << (m_c & 3); + uint8_t mask = 1 << (m_c & 3); if (m_c & 4) m_h |= mask; else @@ -372,7 +372,7 @@ void melps4_cpu_device::op_shl() void melps4_cpu_device::op_rhl() { // RHL: reset bit in L or H designated by C - UINT8 mask = 1 << (m_c & 3); + uint8_t mask = 1 << (m_c & 3); if (m_c & 4) m_h &= ~mask; else @@ -498,7 +498,7 @@ void melps4_cpu_device::op_b() // - short call: subroutine page // - short jump: current page, or sub. page + 1 when in sub. mode // - long jump/call(B/BM preceded by SP): temp SP register - UINT8 page = m_pc >> 7; + uint8_t page = m_pc >> 7; if ((m_prev_op & ~0xf) == m_sp_mask) { m_sm = false; diff --git a/src/devices/cpu/minx/minx.cpp b/src/devices/cpu/minx/minx.cpp index f5bcc222d1d..4ec4a344371 100644 --- a/src/devices/cpu/minx/minx.cpp +++ b/src/devices/cpu/minx/minx.cpp @@ -75,20 +75,20 @@ TODO: const device_type MINX = &device_creator; -minx_cpu_device::minx_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +minx_cpu_device::minx_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, MINX, "Nintendo Minx", tag, owner, clock, "minx", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 8, 24, 0) { } -UINT16 minx_cpu_device::rd16( UINT32 offset ) +uint16_t minx_cpu_device::rd16( uint32_t offset ) { return RD( offset ) | ( RD( offset + 1 ) << 8 ); } -void minx_cpu_device::wr16( UINT32 offset, UINT16 data ) +void minx_cpu_device::wr16( uint32_t offset, uint16_t data ) { WR( offset, ( data & 0x00FF ) ); WR( offset + 1, ( data >> 8 ) ); @@ -156,17 +156,17 @@ void minx_cpu_device::device_reset() } -UINT8 minx_cpu_device::rdop() +uint8_t minx_cpu_device::rdop() { - UINT8 op = RD( GET_MINX_PC ); + uint8_t op = RD( GET_MINX_PC ); m_PC++; return op; } -UINT16 minx_cpu_device::rdop16() +uint16_t minx_cpu_device::rdop16() { - UINT16 op = rdop(); + uint16_t op = rdop(); op = op | ( rdop() << 8 ); return op; } @@ -228,7 +228,7 @@ void minx_cpu_device::execute_set_input(int inputnum, int state) } -offs_t minx_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t minx_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( minx ); return CPU_DISASSEMBLE_NAME(minx)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/minx/minx.h b/src/devices/cpu/minx/minx.h index a31db6ab7a0..ca0c18692ff 100644 --- a/src/devices/cpu/minx/minx.h +++ b/src/devices/cpu/minx/minx.h @@ -18,7 +18,7 @@ class minx_cpu_device : public cpu_device { public: // construction/destruction - minx_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + minx_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -26,9 +26,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 4; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 4; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -39,70 +39,70 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 5; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 5; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; - UINT16 m_PC; - UINT16 m_SP; - UINT16 m_BA; - UINT16 m_HL; - UINT16 m_X; - UINT16 m_Y; - UINT8 m_U; - UINT8 m_V; - UINT8 m_F; - UINT8 m_E; - UINT8 m_N; - UINT8 m_I; - UINT8 m_XI; - UINT8 m_YI; - UINT8 m_halted; - UINT8 m_interrupt_pending; + uint16_t m_PC; + uint16_t m_SP; + uint16_t m_BA; + uint16_t m_HL; + uint16_t m_X; + uint16_t m_Y; + uint8_t m_U; + uint8_t m_V; + uint8_t m_F; + uint8_t m_E; + uint8_t m_N; + uint8_t m_I; + uint8_t m_XI; + uint8_t m_YI; + uint8_t m_halted; + uint8_t m_interrupt_pending; address_space *m_program; int m_icount; // For debugger - UINT32 m_curpc; - UINT16 m_flags; - - UINT16 rd16( UINT32 offset ); - void wr16( UINT32 offset, UINT16 data ); - UINT8 rdop(); - UINT16 rdop16(); - UINT8 ADD8( UINT8 arg1, UINT8 arg2 ); - UINT16 ADD16( UINT16 arg1, UINT16 arg2 ); - UINT8 ADDC8( UINT8 arg1, UINT8 arg2 ); - UINT16 ADDC16( UINT16 arg1, UINT16 arg2 ); - UINT8 INC8( UINT8 arg ); - UINT16 INC16( UINT16 arg ); - UINT8 SUB8( UINT8 arg1, UINT8 arg2 ); - UINT16 SUB16( UINT16 arg1, UINT16 arg2 ); - UINT8 SUBC8( UINT8 arg1, UINT8 arg2 ); - UINT16 SUBC16( UINT16 arg1, UINT16 arg2 ); - UINT8 DEC8( UINT8 arg ); - UINT16 DEC16( UINT16 arg ); - UINT8 AND8( UINT8 arg1, UINT8 arg2 ); - UINT8 OR8( UINT8 arg1, UINT8 arg2 ); - UINT8 XOR8( UINT8 arg1, UINT8 arg2 ); - UINT8 NOT8( UINT8 arg ); - UINT8 NEG8( UINT8 arg ); - UINT8 SAL8( UINT8 arg ); - UINT8 SAR8( UINT8 arg ); - UINT8 SHL8( UINT8 arg ); - UINT8 SHR8( UINT8 arg ); - UINT8 ROLC8( UINT8 arg ); - UINT8 RORC8( UINT8 arg ); - UINT8 ROL8( UINT8 arg ); - UINT8 ROR8( UINT8 arg ); - void PUSH8( UINT8 arg ); - void PUSH16( UINT16 arg ); - UINT8 POP8(); - UINT16 POP16(); - void JMP( UINT16 arg ); - void CALL( UINT16 arg ); + uint32_t m_curpc; + uint16_t m_flags; + + uint16_t rd16( uint32_t offset ); + void wr16( uint32_t offset, uint16_t data ); + uint8_t rdop(); + uint16_t rdop16(); + uint8_t ADD8( uint8_t arg1, uint8_t arg2 ); + uint16_t ADD16( uint16_t arg1, uint16_t arg2 ); + uint8_t ADDC8( uint8_t arg1, uint8_t arg2 ); + uint16_t ADDC16( uint16_t arg1, uint16_t arg2 ); + uint8_t INC8( uint8_t arg ); + uint16_t INC16( uint16_t arg ); + uint8_t SUB8( uint8_t arg1, uint8_t arg2 ); + uint16_t SUB16( uint16_t arg1, uint16_t arg2 ); + uint8_t SUBC8( uint8_t arg1, uint8_t arg2 ); + uint16_t SUBC16( uint16_t arg1, uint16_t arg2 ); + uint8_t DEC8( uint8_t arg ); + uint16_t DEC16( uint16_t arg ); + uint8_t AND8( uint8_t arg1, uint8_t arg2 ); + uint8_t OR8( uint8_t arg1, uint8_t arg2 ); + uint8_t XOR8( uint8_t arg1, uint8_t arg2 ); + uint8_t NOT8( uint8_t arg ); + uint8_t NEG8( uint8_t arg ); + uint8_t SAL8( uint8_t arg ); + uint8_t SAR8( uint8_t arg ); + uint8_t SHL8( uint8_t arg ); + uint8_t SHR8( uint8_t arg ); + uint8_t ROLC8( uint8_t arg ); + uint8_t RORC8( uint8_t arg ); + uint8_t ROL8( uint8_t arg ); + uint8_t ROR8( uint8_t arg ); + void PUSH8( uint8_t arg ); + void PUSH16( uint16_t arg ); + uint8_t POP8(); + uint16_t POP16(); + void JMP( uint16_t arg ); + void CALL( uint16_t arg ); void execute_one(); void execute_one_ce(); diff --git a/src/devices/cpu/minx/minxd.cpp b/src/devices/cpu/minx/minxd.cpp index 31f4a1f51d7..73001e9ec90 100644 --- a/src/devices/cpu/minx/minxd.cpp +++ b/src/devices/cpu/minx/minxd.cpp @@ -79,7 +79,7 @@ static const char *const s_mnemonic[] = { #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 s_flags[] = { +static const uint32_t s_flags[] = { 0, 0, 0, 0, 0, 0, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, _OVER, @@ -94,9 +94,9 @@ static const UINT32 s_flags[] = { }; struct minxdasm { - UINT8 mnemonic; - UINT8 argument1; - UINT8 argument2; + uint8_t mnemonic; + uint8_t argument1; + uint8_t argument2; }; static const minxdasm mnemonic[256] = { @@ -423,9 +423,9 @@ case OP1: dst += sprintf( dst, "%c$%02X", fill, op1 ); break; CPU_DISASSEMBLE( minx ) { const minxdasm *instr; - UINT8 op, op1; - INT8 ofs8; - UINT16 ea; + uint8_t op, op1; + int8_t ofs8; + uint16_t ea; int pos = 0; char *dst = buffer; diff --git a/src/devices/cpu/minx/minxfunc.h b/src/devices/cpu/minx/minxfunc.h index 45478bc6667..adcc2d93641 100644 --- a/src/devices/cpu/minx/minxfunc.h +++ b/src/devices/cpu/minx/minxfunc.h @@ -1,8 +1,8 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol -UINT8 minx_cpu_device::ADD8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::ADD8( uint8_t arg1, uint8_t arg2 ) { - UINT32 res = arg1 + arg2; + uint32_t res = arg1 + arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ^ 0x80 ) & ( arg2 ^ res ) & 0x80 ) ? FLAG_O : 0 ) @@ -13,9 +13,9 @@ UINT8 minx_cpu_device::ADD8( UINT8 arg1, UINT8 arg2 ) } -UINT16 minx_cpu_device::ADD16( UINT16 arg1, UINT16 arg2 ) +uint16_t minx_cpu_device::ADD16( uint16_t arg1, uint16_t arg2 ) { - UINT32 res = arg1 + arg2; + uint32_t res = arg1 + arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x8000 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ^ 0x8000 ) & ( arg2 ^ res ) & 0x8000 ) ? FLAG_O : 0 ) @@ -26,9 +26,9 @@ UINT16 minx_cpu_device::ADD16( UINT16 arg1, UINT16 arg2 ) } -UINT8 minx_cpu_device::ADDC8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::ADDC8( uint8_t arg1, uint8_t arg2 ) { - UINT32 res = arg1 + arg2 + ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint32_t res = arg1 + arg2 + ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ^ 0x80 ) & ( arg2 ^ res ) & 0x80 ) ? FLAG_O : 0 ) @@ -39,9 +39,9 @@ UINT8 minx_cpu_device::ADDC8( UINT8 arg1, UINT8 arg2 ) } -UINT16 minx_cpu_device::ADDC16( UINT16 arg1, UINT16 arg2 ) +uint16_t minx_cpu_device::ADDC16( uint16_t arg1, uint16_t arg2 ) { - UINT32 res = arg1 + arg2 + ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint32_t res = arg1 + arg2 + ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x8000 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ^ 0x8000 ) & ( arg2 ^ res ) & 0x8000 ) ? FLAG_O : 0 ) @@ -52,10 +52,10 @@ UINT16 minx_cpu_device::ADDC16( UINT16 arg1, UINT16 arg2 ) } -UINT8 minx_cpu_device::INC8( UINT8 arg ) +uint8_t minx_cpu_device::INC8( uint8_t arg ) { - UINT8 old_F = m_F; - UINT8 res = ADD8( arg, 1 ); + uint8_t old_F = m_F; + uint8_t res = ADD8( arg, 1 ); m_F = ( old_F & ~ ( FLAG_Z ) ) | ( ( res ) ? 0 : FLAG_Z ) ; @@ -63,10 +63,10 @@ UINT8 minx_cpu_device::INC8( UINT8 arg ) } -UINT16 minx_cpu_device::INC16( UINT16 arg ) +uint16_t minx_cpu_device::INC16( uint16_t arg ) { - UINT8 old_F = m_F; - UINT16 res = ADD16( arg, 1 ); + uint8_t old_F = m_F; + uint16_t res = ADD16( arg, 1 ); m_F = ( old_F & ~ ( FLAG_Z ) ) | ( ( res ) ? 0 : FLAG_Z ) ; @@ -74,9 +74,9 @@ UINT16 minx_cpu_device::INC16( UINT16 arg ) } -UINT8 minx_cpu_device::SUB8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::SUB8( uint8_t arg1, uint8_t arg2 ) { - UINT32 res = arg1 - arg2; + uint32_t res = arg1 - arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ) & ( arg1 ^ res ) & 0x80 ) ? FLAG_O : 0 ) @@ -87,9 +87,9 @@ UINT8 minx_cpu_device::SUB8( UINT8 arg1, UINT8 arg2 ) } -UINT16 minx_cpu_device::SUB16( UINT16 arg1, UINT16 arg2 ) +uint16_t minx_cpu_device::SUB16( uint16_t arg1, uint16_t arg2 ) { - UINT32 res = arg1 - arg2; + uint32_t res = arg1 - arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x8000 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ) & ( arg1 ^ res ) & 0x8000 ) ? FLAG_O : 0 ) @@ -100,9 +100,9 @@ UINT16 minx_cpu_device::SUB16( UINT16 arg1, UINT16 arg2 ) } -UINT8 minx_cpu_device::SUBC8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::SUBC8( uint8_t arg1, uint8_t arg2 ) { - UINT32 res = arg1 - arg2 - ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint32_t res = arg1 - arg2 - ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ) & ( arg1 ^ res ) & 0x80 ) ? FLAG_O : 0 ) @@ -113,9 +113,9 @@ UINT8 minx_cpu_device::SUBC8( UINT8 arg1, UINT8 arg2 ) } -UINT16 minx_cpu_device::SUBC16( UINT16 arg1, UINT16 arg2 ) +uint16_t minx_cpu_device::SUBC16( uint16_t arg1, uint16_t arg2 ) { - UINT32 res = arg1 - arg2 - ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint32_t res = arg1 - arg2 - ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x8000 ) ? FLAG_S : 0 ) | ( ( ( arg2 ^ arg1 ) & ( arg1 ^ res ) & 0x8000 ) ? FLAG_O : 0 ) @@ -126,10 +126,10 @@ UINT16 minx_cpu_device::SUBC16( UINT16 arg1, UINT16 arg2 ) } -UINT8 minx_cpu_device::DEC8( UINT8 arg ) +uint8_t minx_cpu_device::DEC8( uint8_t arg ) { - UINT8 old_F = m_F; - UINT8 res = SUB8( arg, 1 ); + uint8_t old_F = m_F; + uint8_t res = SUB8( arg, 1 ); m_F = ( old_F & ~ ( FLAG_Z ) ) | ( ( res ) ? 0 : FLAG_Z ) ; @@ -137,10 +137,10 @@ UINT8 minx_cpu_device::DEC8( UINT8 arg ) } -UINT16 minx_cpu_device::DEC16( UINT16 arg ) +uint16_t minx_cpu_device::DEC16( uint16_t arg ) { - UINT8 old_F = m_F; - UINT16 res = SUB16( arg, 1 ); + uint8_t old_F = m_F; + uint16_t res = SUB16( arg, 1 ); m_F = ( old_F & ~ ( FLAG_Z ) ) | ( ( res ) ? 0 : FLAG_Z ) ; @@ -148,9 +148,9 @@ UINT16 minx_cpu_device::DEC16( UINT16 arg ) } -UINT8 minx_cpu_device::AND8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::AND8( uint8_t arg1, uint8_t arg2 ) { - UINT8 res = arg1 & arg2; + uint8_t res = arg1 & arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -159,9 +159,9 @@ UINT8 minx_cpu_device::AND8( UINT8 arg1, UINT8 arg2 ) } -UINT8 minx_cpu_device::OR8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::OR8( uint8_t arg1, uint8_t arg2 ) { - UINT8 res = arg1 | arg2; + uint8_t res = arg1 | arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -170,9 +170,9 @@ UINT8 minx_cpu_device::OR8( UINT8 arg1, UINT8 arg2 ) } -UINT8 minx_cpu_device::XOR8( UINT8 arg1, UINT8 arg2 ) +uint8_t minx_cpu_device::XOR8( uint8_t arg1, uint8_t arg2 ) { - UINT8 res = arg1 ^ arg2; + uint8_t res = arg1 ^ arg2; m_F = ( m_F & ~ ( FLAG_S | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -181,9 +181,9 @@ UINT8 minx_cpu_device::XOR8( UINT8 arg1, UINT8 arg2 ) } -UINT8 minx_cpu_device::NOT8( UINT8 arg ) +uint8_t minx_cpu_device::NOT8( uint8_t arg ) { - UINT8 res = ~arg; + uint8_t res = ~arg; m_F = ( m_F & ~ ( FLAG_S | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -192,9 +192,9 @@ UINT8 minx_cpu_device::NOT8( UINT8 arg ) } -UINT8 minx_cpu_device::NEG8( UINT8 arg ) +uint8_t minx_cpu_device::NEG8( uint8_t arg ) { - UINT8 res = -arg; + uint8_t res = -arg; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( res ) ? 0 : FLAG_Z ) @@ -203,9 +203,9 @@ UINT8 minx_cpu_device::NEG8( UINT8 arg ) } -UINT8 minx_cpu_device::SAL8( UINT8 arg ) +uint8_t minx_cpu_device::SAL8( uint8_t arg ) { - UINT16 res = arg << 1; + uint16_t res = arg << 1; m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg != 0 && res == 0 ) ? FLAG_O : 0 ) @@ -216,9 +216,9 @@ UINT8 minx_cpu_device::SAL8( UINT8 arg ) } -UINT8 minx_cpu_device::SAR8( UINT8 arg ) +uint8_t minx_cpu_device::SAR8( uint8_t arg ) { - UINT16 res = ( arg >> 1 ) | ( arg & 0x80 ); + uint16_t res = ( arg >> 1 ) | ( arg & 0x80 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_O | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg != 0x80 && res == 0x80 ) ? FLAG_O : 0 ) @@ -229,9 +229,9 @@ UINT8 minx_cpu_device::SAR8( UINT8 arg ) } -UINT8 minx_cpu_device::SHL8( UINT8 arg ) +uint8_t minx_cpu_device::SHL8( uint8_t arg ) { - UINT16 res = arg << 1; + uint16_t res = arg << 1; m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x80 ) ? FLAG_C : 0 ) @@ -241,9 +241,9 @@ UINT8 minx_cpu_device::SHL8( UINT8 arg ) } -UINT8 minx_cpu_device::SHR8( UINT8 arg ) +uint8_t minx_cpu_device::SHR8( uint8_t arg ) { - UINT16 res = arg >> 1; + uint16_t res = arg >> 1; m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x01 ) ? FLAG_C : 0 ) @@ -253,9 +253,9 @@ UINT8 minx_cpu_device::SHR8( UINT8 arg ) } -UINT8 minx_cpu_device::ROLC8( UINT8 arg ) +uint8_t minx_cpu_device::ROLC8( uint8_t arg ) { - UINT16 res = ( arg << 1 ) | ( ( m_F & FLAG_C ) ? 1 : 0 ); + uint16_t res = ( arg << 1 ) | ( ( m_F & FLAG_C ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x80 ) ? FLAG_C : 0 ) @@ -265,9 +265,9 @@ UINT8 minx_cpu_device::ROLC8( UINT8 arg ) } -UINT8 minx_cpu_device::RORC8( UINT8 arg ) +uint8_t minx_cpu_device::RORC8( uint8_t arg ) { - UINT16 res = ( arg >> 1 ) | ( ( m_F & FLAG_C ) ? 0x80 : 0 ); + uint16_t res = ( arg >> 1 ) | ( ( m_F & FLAG_C ) ? 0x80 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x01 ) ? FLAG_C : 0 ) @@ -277,9 +277,9 @@ UINT8 minx_cpu_device::RORC8( UINT8 arg ) } -UINT8 minx_cpu_device::ROL8( UINT8 arg ) +uint8_t minx_cpu_device::ROL8( uint8_t arg ) { - UINT16 res = ( arg << 1 ) | ( ( arg & 0x80 ) ? 1 : 0 ); + uint16_t res = ( arg << 1 ) | ( ( arg & 0x80 ) ? 1 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x80 ) ? FLAG_C : 0 ) @@ -289,9 +289,9 @@ UINT8 minx_cpu_device::ROL8( UINT8 arg ) } -UINT8 minx_cpu_device::ROR8( UINT8 arg ) +uint8_t minx_cpu_device::ROR8( uint8_t arg ) { - UINT16 res = ( arg >> 1 ) | ( ( arg & 0x01 ) ? 0x80 : 0 ); + uint16_t res = ( arg >> 1 ) | ( ( arg & 0x01 ) ? 0x80 : 0 ); m_F = ( m_F & ~ ( FLAG_S | FLAG_C | FLAG_Z ) ) | ( ( res & 0x80 ) ? FLAG_S : 0 ) | ( ( arg & 0x01 ) ? FLAG_C : 0 ) @@ -301,42 +301,42 @@ UINT8 minx_cpu_device::ROR8( UINT8 arg ) } -void minx_cpu_device::PUSH8( UINT8 arg ) +void minx_cpu_device::PUSH8( uint8_t arg ) { m_SP = m_SP - 1; WR( m_SP, arg ); } -void minx_cpu_device::PUSH16( UINT16 arg ) +void minx_cpu_device::PUSH16( uint16_t arg ) { PUSH8( arg >> 8 ); PUSH8( arg & 0x00FF ); } -UINT8 minx_cpu_device::POP8() +uint8_t minx_cpu_device::POP8() { - UINT8 res = RD( m_SP ); + uint8_t res = RD( m_SP ); m_SP = m_SP + 1; return res; } -UINT16 minx_cpu_device::POP16() +uint16_t minx_cpu_device::POP16() { return POP8() | ( POP8() << 8 ); } -void minx_cpu_device::JMP( UINT16 arg ) +void minx_cpu_device::JMP( uint16_t arg ) { m_V = m_U; m_PC = arg; } -void minx_cpu_device::CALL( UINT16 arg ) +void minx_cpu_device::CALL( uint16_t arg ) { PUSH8( m_V ); PUSH16( m_PC ); @@ -344,21 +344,21 @@ void minx_cpu_device::CALL( UINT16 arg ) } -#define AD1_IHL UINT32 addr1 = ( m_I << 16 ) | m_HL -#define AD1_IN8 UINT32 addr1 = ( m_I << 16 ) | ( m_N << 8 ) | rdop() -#define AD1_I16 UINT32 addr1 = ( m_I << 16 ) | rdop16() -#define AD1_XIX UINT32 addr1 = ( m_XI << 16 ) | m_X -#define AD1_YIY UINT32 addr1 = ( m_YI << 16 ) | m_Y -#define AD1_X8 UINT32 addr1 = ( m_XI << 16 ) | ( m_X + rdop() ) -#define AD1_Y8 UINT32 addr1 = ( m_YI << 16 ) | ( m_Y + rdop() ) -#define AD1_XL UINT32 addr1 = ( m_XI << 16 ) | ( m_X + ( m_HL & 0x00FF ) ) -#define AD1_YL UINT32 addr1 = ( m_YI << 16 ) | ( m_Y + ( m_HL & 0x00FF ) ) -#define AD2_IHL UINT32 addr2 = ( m_I << 16 ) | m_HL -#define AD2_IN8 UINT32 addr2 = ( m_I << 16 ) | ( m_N << 8 ) | rdop() -#define AD2_I16 UINT32 addr2 = ( m_I << 16 ) | rdop(); addr2 |= ( rdop() << 8 ) -#define AD2_XIX UINT32 addr2 = ( m_XI << 16 ) | m_X -#define AD2_YIY UINT32 addr2 = ( m_YI << 16 ) | m_Y -#define AD2_X8 UINT32 addr2 = ( m_XI << 16 ) | ( m_X + rdop() ) -#define AD2_Y8 UINT32 addr2 = ( m_YI << 16 ) | ( m_Y + rdop() ) -#define AD2_XL UINT32 addr2 = ( m_XI << 16 ) | ( m_X + ( m_HL & 0x00FF ) ) -#define AD2_YL UINT32 addr2 = ( m_YI << 16 ) | ( m_Y + ( m_HL & 0x00FF ) ) +#define AD1_IHL uint32_t addr1 = ( m_I << 16 ) | m_HL +#define AD1_IN8 uint32_t addr1 = ( m_I << 16 ) | ( m_N << 8 ) | rdop() +#define AD1_I16 uint32_t addr1 = ( m_I << 16 ) | rdop16() +#define AD1_XIX uint32_t addr1 = ( m_XI << 16 ) | m_X +#define AD1_YIY uint32_t addr1 = ( m_YI << 16 ) | m_Y +#define AD1_X8 uint32_t addr1 = ( m_XI << 16 ) | ( m_X + rdop() ) +#define AD1_Y8 uint32_t addr1 = ( m_YI << 16 ) | ( m_Y + rdop() ) +#define AD1_XL uint32_t addr1 = ( m_XI << 16 ) | ( m_X + ( m_HL & 0x00FF ) ) +#define AD1_YL uint32_t addr1 = ( m_YI << 16 ) | ( m_Y + ( m_HL & 0x00FF ) ) +#define AD2_IHL uint32_t addr2 = ( m_I << 16 ) | m_HL +#define AD2_IN8 uint32_t addr2 = ( m_I << 16 ) | ( m_N << 8 ) | rdop() +#define AD2_I16 uint32_t addr2 = ( m_I << 16 ) | rdop(); addr2 |= ( rdop() << 8 ) +#define AD2_XIX uint32_t addr2 = ( m_XI << 16 ) | m_X +#define AD2_YIY uint32_t addr2 = ( m_YI << 16 ) | m_Y +#define AD2_X8 uint32_t addr2 = ( m_XI << 16 ) | ( m_X + rdop() ) +#define AD2_Y8 uint32_t addr2 = ( m_YI << 16 ) | ( m_Y + rdop() ) +#define AD2_XL uint32_t addr2 = ( m_XI << 16 ) | ( m_X + ( m_HL & 0x00FF ) ) +#define AD2_YL uint32_t addr2 = ( m_YI << 16 ) | ( m_Y + ( m_HL & 0x00FF ) ) diff --git a/src/devices/cpu/minx/minxopce.h b/src/devices/cpu/minx/minxopce.h index ec0198273e3..2d44decf802 100644 --- a/src/devices/cpu/minx/minxopce.h +++ b/src/devices/cpu/minx/minxopce.h @@ -3,7 +3,7 @@ void minx_cpu_device::execute_one_ce() { - const UINT8 opcode = rdop(); + const uint8_t opcode = rdop(); switch (opcode) { @@ -469,70 +469,70 @@ void minx_cpu_device::execute_one_ce() case 0xDF: { /* illegal operation? */ } break; - case 0xE0: { INT8 d8 = rdop(); if ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_S ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_O ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE0: { int8_t d8 = rdop(); if ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_S ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_O ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE1: { INT8 d8 = rdop(); if ( ( m_F & FLAG_Z ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_S ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_O ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE1: { int8_t d8 = rdop(); if ( ( m_F & FLAG_Z ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_S ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_O ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE2: { INT8 d8 = rdop(); if ( !( m_F & FLAG_Z ) && ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == 0 ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == ( FLAG_S | FLAG_O ) ) ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE2: { int8_t d8 = rdop(); if ( !( m_F & FLAG_Z ) && ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == 0 ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == ( FLAG_S | FLAG_O ) ) ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE3: { INT8 d8 = rdop(); if ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == 0 ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == ( FLAG_S | FLAG_O ) ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE3: { int8_t d8 = rdop(); if ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == 0 ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == ( FLAG_S | FLAG_O ) ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE4: { INT8 d8 = rdop(); if ( ( m_F & FLAG_O ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE4: { int8_t d8 = rdop(); if ( ( m_F & FLAG_O ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE5: { INT8 d8 = rdop(); if ( ! ( m_F & FLAG_O ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE5: { int8_t d8 = rdop(); if ( ! ( m_F & FLAG_O ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE6: { INT8 d8 = rdop(); if ( ! ( m_F & FLAG_S ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE6: { int8_t d8 = rdop(); if ( ! ( m_F & FLAG_S ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE7: { INT8 d8 = rdop(); if ( ( m_F & FLAG_S ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE7: { int8_t d8 = rdop(); if ( ( m_F & FLAG_S ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE8: { INT8 d8 = rdop(); if ( ! ( m_E & EXEC_X0 ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE8: { int8_t d8 = rdop(); if ( ! ( m_E & EXEC_X0 ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE9: { INT8 d8 = rdop(); if ( ! ( m_E & EXEC_X1 ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE9: { int8_t d8 = rdop(); if ( ! ( m_E & EXEC_X1 ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xEA: { INT8 d8 = rdop(); if ( ! ( m_E & EXEC_X2 ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xEA: { int8_t d8 = rdop(); if ( ! ( m_E & EXEC_X2 ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xEB: { INT8 d8 = rdop(); if ( ! ( m_E & EXEC_DZ ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xEB: { int8_t d8 = rdop(); if ( ! ( m_E & EXEC_DZ ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xEC: { INT8 d8 = rdop(); if ( ( m_E & EXEC_X0 ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xEC: { int8_t d8 = rdop(); if ( ( m_E & EXEC_X0 ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xED: { INT8 d8 = rdop(); if ( ( m_E & EXEC_X1 ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xED: { int8_t d8 = rdop(); if ( ( m_E & EXEC_X1 ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xEE: { INT8 d8 = rdop(); if ( ( m_E & EXEC_X2 ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xEE: { int8_t d8 = rdop(); if ( ( m_E & EXEC_X2 ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xEF: { INT8 d8 = rdop(); if ( ( m_E & EXEC_DZ ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xEF: { int8_t d8 = rdop(); if ( ( m_E & EXEC_DZ ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xF0: { INT8 d8 = rdop(); if ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_S ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_O ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xF0: { int8_t d8 = rdop(); if ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_S ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_O ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xF1: { INT8 d8 = rdop(); if ( ( m_F & FLAG_Z ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_S ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_O ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xF1: { int8_t d8 = rdop(); if ( ( m_F & FLAG_Z ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_S ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == FLAG_O ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xF2: { INT8 d8 = rdop(); if ( !( m_F & FLAG_Z ) && ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == 0 ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == ( FLAG_S | FLAG_O ) ) ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xF2: { int8_t d8 = rdop(); if ( !( m_F & FLAG_Z ) && ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == 0 ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == ( FLAG_S | FLAG_O ) ) ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xF3: { INT8 d8 = rdop(); if ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == 0 ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == ( FLAG_S | FLAG_O ) ) ) { CALL( m_PC + d8 - 1 ); } } + case 0xF3: { int8_t d8 = rdop(); if ( ( ( m_F & ( FLAG_S | FLAG_O ) ) == 0 ) || ( ( m_F & ( FLAG_S | FLAG_O ) ) == ( FLAG_S | FLAG_O ) ) ) { CALL( m_PC + d8 - 1 ); } } break; - case 0xF4: { INT8 d8 = rdop(); if ( ( m_F & FLAG_O ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xF4: { int8_t d8 = rdop(); if ( ( m_F & FLAG_O ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xF5: { INT8 d8 = rdop(); if ( ! ( m_F & FLAG_O ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xF5: { int8_t d8 = rdop(); if ( ! ( m_F & FLAG_O ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xF6: { INT8 d8 = rdop(); if ( ! ( m_F & FLAG_S ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xF6: { int8_t d8 = rdop(); if ( ! ( m_F & FLAG_S ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xF7: { INT8 d8 = rdop(); if ( ( m_F & FLAG_S ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xF7: { int8_t d8 = rdop(); if ( ( m_F & FLAG_S ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xF8: { INT8 d8 = rdop(); if ( ! ( m_E & EXEC_X0 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xF8: { int8_t d8 = rdop(); if ( ! ( m_E & EXEC_X0 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xF9: { INT8 d8 = rdop(); if ( ! ( m_E & EXEC_X1 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xF9: { int8_t d8 = rdop(); if ( ! ( m_E & EXEC_X1 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xFA: { INT8 d8 = rdop(); if ( ! ( m_E & EXEC_X2 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xFA: { int8_t d8 = rdop(); if ( ! ( m_E & EXEC_X2 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xFB: { INT8 d8 = rdop(); if ( ! ( m_E & EXEC_DZ ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xFB: { int8_t d8 = rdop(); if ( ! ( m_E & EXEC_DZ ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xFC: { INT8 d8 = rdop(); if ( ( m_E & EXEC_X0 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xFC: { int8_t d8 = rdop(); if ( ( m_E & EXEC_X0 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xFD: { INT8 d8 = rdop(); if ( ( m_E & EXEC_X1 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xFD: { int8_t d8 = rdop(); if ( ( m_E & EXEC_X1 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xFE: { INT8 d8 = rdop(); if ( ( m_E & EXEC_X2 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xFE: { int8_t d8 = rdop(); if ( ( m_E & EXEC_X2 ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xFF: { INT8 d8 = rdop(); if ( ( m_E & EXEC_DZ ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xFF: { int8_t d8 = rdop(); if ( ( m_E & EXEC_DZ ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; } diff --git a/src/devices/cpu/minx/minxopcf.h b/src/devices/cpu/minx/minxopcf.h index f81d991304a..adaf357784a 100644 --- a/src/devices/cpu/minx/minxopcf.h +++ b/src/devices/cpu/minx/minxopcf.h @@ -3,7 +3,7 @@ void minx_cpu_device::execute_one_cf() { - const UINT8 opcode = rdop(); + const uint8_t opcode = rdop(); switch (opcode) { @@ -238,21 +238,21 @@ void minx_cpu_device::execute_one_cf() case 0x6F: { /* illegal instruction? */ } break; - case 0x70: { UINT8 ofs8 = rdop(); m_BA = rd16( m_SP + ofs8 ); } + case 0x70: { uint8_t ofs8 = rdop(); m_BA = rd16( m_SP + ofs8 ); } break; - case 0x71: { UINT8 ofs8 = rdop(); m_HL = rd16( m_SP + ofs8 ); } + case 0x71: { uint8_t ofs8 = rdop(); m_HL = rd16( m_SP + ofs8 ); } break; - case 0x72: { UINT8 ofs8 = rdop(); m_X = rd16( m_SP + ofs8 ); } + case 0x72: { uint8_t ofs8 = rdop(); m_X = rd16( m_SP + ofs8 ); } break; - case 0x73: { UINT8 ofs8 = rdop(); m_Y = rd16( m_SP + ofs8 ); } + case 0x73: { uint8_t ofs8 = rdop(); m_Y = rd16( m_SP + ofs8 ); } break; - case 0x74: { UINT8 ofs8 = rdop(); wr16( m_SP + ofs8, m_BA ); } + case 0x74: { uint8_t ofs8 = rdop(); wr16( m_SP + ofs8, m_BA ); } break; - case 0x75: { UINT8 ofs8 = rdop(); wr16( m_SP + ofs8, m_HL ); } + case 0x75: { uint8_t ofs8 = rdop(); wr16( m_SP + ofs8, m_HL ); } break; - case 0x76: { UINT8 ofs8 = rdop(); wr16( m_SP + ofs8, m_X ); } + case 0x76: { uint8_t ofs8 = rdop(); wr16( m_SP + ofs8, m_X ); } break; - case 0x77: { UINT8 ofs8 = rdop(); wr16( m_SP + ofs8, m_Y ); } + case 0x77: { uint8_t ofs8 = rdop(); wr16( m_SP + ofs8, m_Y ); } break; case 0x78: { AD2_I16; m_SP = rd16( addr2 ); } break; diff --git a/src/devices/cpu/minx/minxops.h b/src/devices/cpu/minx/minxops.h index b19e733deb2..9a5829d3841 100644 --- a/src/devices/cpu/minx/minxops.h +++ b/src/devices/cpu/minx/minxops.h @@ -3,7 +3,7 @@ void minx_cpu_device::execute_one() { - const UINT8 opcode = rdop(); + const uint8_t opcode = rdop(); switch (opcode) { @@ -370,21 +370,21 @@ void minx_cpu_device::execute_one() case 0xAF: { m_F = POP8(); } break; - case 0xB0: { UINT8 op = rdop(); m_BA = ( m_BA & 0xFF00 ) | op; } + case 0xB0: { uint8_t op = rdop(); m_BA = ( m_BA & 0xFF00 ) | op; } break; - case 0xB1: { UINT8 op = rdop(); m_BA = ( m_BA & 0x00FF ) | ( op << 8 ); } + case 0xB1: { uint8_t op = rdop(); m_BA = ( m_BA & 0x00FF ) | ( op << 8 ); } break; - case 0xB2: { UINT8 op = rdop(); m_HL = ( m_HL & 0xFF00 ) | op; } + case 0xB2: { uint8_t op = rdop(); m_HL = ( m_HL & 0xFF00 ) | op; } break; - case 0xB3: { UINT8 op = rdop(); m_HL = ( m_HL & 0x00FF ) | ( op << 8 ); } + case 0xB3: { uint8_t op = rdop(); m_HL = ( m_HL & 0x00FF ) | ( op << 8 ); } break; - case 0xB4: { UINT8 op = rdop(); m_N = op; } + case 0xB4: { uint8_t op = rdop(); m_N = op; } break; - case 0xB5: { AD1_IHL; UINT8 op = rdop(); WR( addr1, op); } + case 0xB5: { AD1_IHL; uint8_t op = rdop(); WR( addr1, op); } break; - case 0xB6: { AD1_XIX; UINT8 op = rdop(); WR( addr1, op ); } + case 0xB6: { AD1_XIX; uint8_t op = rdop(); WR( addr1, op ); } break; - case 0xB7: { AD1_YIY; UINT8 op = rdop(); WR( addr1, op ); } + case 0xB7: { AD1_YIY; uint8_t op = rdop(); WR( addr1, op ); } break; case 0xB8: { AD2_I16; m_BA = rd16( addr2 ); } break; @@ -419,17 +419,17 @@ void minx_cpu_device::execute_one() break; case 0xC7: { m_Y = rdop16(); } break; - case 0xC8: { UINT16 t = m_BA; m_BA = m_HL; m_HL = t; } + case 0xC8: { uint16_t t = m_BA; m_BA = m_HL; m_HL = t; } break; - case 0xC9: { UINT16 t = m_BA; m_BA = m_X; m_X = t; } + case 0xC9: { uint16_t t = m_BA; m_BA = m_X; m_X = t; } break; - case 0xCA: { UINT16 t = m_BA; m_BA = m_Y; m_Y = t; } + case 0xCA: { uint16_t t = m_BA; m_BA = m_Y; m_Y = t; } break; - case 0xCB: { UINT16 t = m_BA; m_BA = m_SP; m_SP = t; } + case 0xCB: { uint16_t t = m_BA; m_BA = m_SP; m_SP = t; } break; case 0xCC: { m_BA = ( m_BA >> 8 ) | ( ( m_BA & 0x00FF ) << 8 ); } break; - case 0xCD: { UINT8 t; AD2_IHL; t = RD( addr2 ); WR( addr2, ( m_BA & 0x00FF ) ); m_BA = ( m_BA & 0xFF00 ) | t; } + case 0xCD: { uint8_t t; AD2_IHL; t = RD( addr2 ); WR( addr2, ( m_BA & 0x00FF ) ); m_BA = ( m_BA & 0xFF00 ) | t; } break; case 0xCE: { execute_one_ce(); } break; @@ -469,54 +469,54 @@ void minx_cpu_device::execute_one() case 0xDF: { m_BA = ( ( m_BA & 0x0080 ) ? 0xFF00 : 0x0000 ) | ( m_BA & 0x000F ); } break; - case 0xE0: { INT8 d8 = rdop(); if ( m_F & FLAG_C ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xE0: { int8_t d8 = rdop(); if ( m_F & FLAG_C ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xE1: { INT8 d8 = rdop(); if ( ! ( m_F & FLAG_C ) ) { CALL( m_PC + d8- 1 ); m_icount -= 12; } } + case 0xE1: { int8_t d8 = rdop(); if ( ! ( m_F & FLAG_C ) ) { CALL( m_PC + d8- 1 ); m_icount -= 12; } } break; - case 0xE2: { INT8 d8 = rdop(); if ( m_F & FLAG_Z ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xE2: { int8_t d8 = rdop(); if ( m_F & FLAG_Z ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xE3: { INT8 d8 = rdop(); if ( ! ( m_F & FLAG_Z ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } + case 0xE3: { int8_t d8 = rdop(); if ( ! ( m_F & FLAG_Z ) ) { CALL( m_PC + d8 - 1 ); m_icount -= 12; } } break; - case 0xE4: { INT8 d8 = rdop(); if ( m_F & FLAG_C ) { JMP( m_PC + d8 - 1 ); } } + case 0xE4: { int8_t d8 = rdop(); if ( m_F & FLAG_C ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE5: { INT8 d8 = rdop(); if ( ! ( m_F & FLAG_C ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE5: { int8_t d8 = rdop(); if ( ! ( m_F & FLAG_C ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE6: { INT8 d8 = rdop(); if ( m_F & FLAG_Z ) { JMP( m_PC + d8 - 1 ); } } + case 0xE6: { int8_t d8 = rdop(); if ( m_F & FLAG_Z ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE7: { INT8 d8 = rdop(); if ( ! ( m_F & FLAG_Z ) ) { JMP( m_PC + d8 - 1 ); } } + case 0xE7: { int8_t d8 = rdop(); if ( ! ( m_F & FLAG_Z ) ) { JMP( m_PC + d8 - 1 ); } } break; - case 0xE8: { UINT16 d16 = rdop16(); if ( m_F & FLAG_C ) { CALL( m_PC + d16 - 1 ); m_icount -= 12; } } + case 0xE8: { uint16_t d16 = rdop16(); if ( m_F & FLAG_C ) { CALL( m_PC + d16 - 1 ); m_icount -= 12; } } break; - case 0xE9: { UINT16 d16 = rdop16(); if ( ! ( m_F & FLAG_C ) ) { CALL( m_PC + d16 - 1 ); m_icount -= 12; } } + case 0xE9: { uint16_t d16 = rdop16(); if ( ! ( m_F & FLAG_C ) ) { CALL( m_PC + d16 - 1 ); m_icount -= 12; } } break; - case 0xEA: { UINT16 d16 = rdop16(); if ( m_F & FLAG_Z ) { CALL( m_PC + d16 - 1 ); m_icount -= 12; } } + case 0xEA: { uint16_t d16 = rdop16(); if ( m_F & FLAG_Z ) { CALL( m_PC + d16 - 1 ); m_icount -= 12; } } break; - case 0xEB: { UINT16 d16 = rdop16(); if ( ! ( m_F & FLAG_Z ) ) { CALL( m_PC + d16 - 1 ); m_icount -= 12; } } + case 0xEB: { uint16_t d16 = rdop16(); if ( ! ( m_F & FLAG_Z ) ) { CALL( m_PC + d16 - 1 ); m_icount -= 12; } } break; - case 0xEC: { UINT16 d16 = rdop16(); if ( m_F & FLAG_C ) { JMP( m_PC + d16 - 1 ); } } + case 0xEC: { uint16_t d16 = rdop16(); if ( m_F & FLAG_C ) { JMP( m_PC + d16 - 1 ); } } break; - case 0xED: { UINT16 d16 = rdop16(); if ( ! ( m_F & FLAG_C ) ) { JMP( m_PC + d16 - 1 ); } } + case 0xED: { uint16_t d16 = rdop16(); if ( ! ( m_F & FLAG_C ) ) { JMP( m_PC + d16 - 1 ); } } break; - case 0xEE: { UINT16 d16 = rdop16(); if ( m_F & FLAG_Z ) { JMP( m_PC + d16 - 1 ); } } + case 0xEE: { uint16_t d16 = rdop16(); if ( m_F & FLAG_Z ) { JMP( m_PC + d16 - 1 ); } } break; - case 0xEF: { UINT16 d16 = rdop16(); if ( ! ( m_F & FLAG_Z ) ) { JMP( m_PC + d16 - 1 ); } } + case 0xEF: { uint16_t d16 = rdop16(); if ( ! ( m_F & FLAG_Z ) ) { JMP( m_PC + d16 - 1 ); } } break; - case 0xF0: { INT8 d8 = rdop(); CALL( m_PC + d8 - 1 ); } + case 0xF0: { int8_t d8 = rdop(); CALL( m_PC + d8 - 1 ); } break; - case 0xF1: { INT8 d8 = rdop(); JMP( m_PC + d8 - 1 ); } + case 0xF1: { int8_t d8 = rdop(); JMP( m_PC + d8 - 1 ); } break; - case 0xF2: { UINT16 d16 = rdop16(); CALL( m_PC + d16 - 1 ); } + case 0xF2: { uint16_t d16 = rdop16(); CALL( m_PC + d16 - 1 ); } break; - case 0xF3: { UINT16 d16 = rdop16(); JMP( m_PC + d16 - 1 ); } + case 0xF3: { uint16_t d16 = rdop16(); JMP( m_PC + d16 - 1 ); } break; case 0xF4: { JMP( m_HL ); } break; - case 0xF5: { INT8 d8 = rdop(); m_BA = m_BA - 0x0100; if ( m_BA & 0xFF00 ) { JMP( m_PC + d8 - 1 ); } } + case 0xF5: { int8_t d8 = rdop(); m_BA = m_BA - 0x0100; if ( m_BA & 0xFF00 ) { JMP( m_PC + d8 - 1 ); } } break; case 0xF6: { m_BA = ( m_BA & 0xFF00 ) | ( ( m_BA & 0x00F0 ) >> 4 ) | ( ( m_BA & 0x000F ) << 4 ); } break; - case 0xF7: { UINT8 d; AD1_IHL; d = RD( addr1 ); WR( addr1, ( ( d & 0xF0 ) >> 4 ) | ( ( d & 0x0F ) << 4 ) ); } + case 0xF7: { uint8_t d; AD1_IHL; d = RD( addr1 ); WR( addr1, ( ( d & 0xF0 ) >> 4 ) | ( ( d & 0x0F ) << 4 ) ); } break; case 0xF8: { m_PC = POP16(); m_V = POP8(); m_U = m_V; } break; @@ -526,9 +526,9 @@ void minx_cpu_device::execute_one() break; case 0xFB: { AD1_I16; CALL( rd16( addr1 ) ); } break; - case 0xFC: { UINT8 i = rdop() & 0xFE; CALL( rd16( i ) ); PUSH8( m_F ); } + case 0xFC: { uint8_t i = rdop() & 0xFE; CALL( rd16( i ) ); PUSH8( m_F ); } break; - case 0xFD: { UINT8 i = rdop() & 0xFE; JMP( rd16( i ) ); /* PUSH8( m_F );?? */ } + case 0xFD: { uint8_t i = rdop() & 0xFE; JMP( rd16( i ) ); /* PUSH8( m_F );?? */ } break; case 0xFE: { /* illegal operation? */ } break; diff --git a/src/devices/cpu/mips/mips3.cpp b/src/devices/cpu/mips/mips3.cpp index d146b70863d..fd174f6dccb 100644 --- a/src/devices/cpu/mips/mips3.cpp +++ b/src/devices/cpu/mips/mips3.cpp @@ -20,9 +20,9 @@ HELPER MACROS ***************************************************************************/ -#define RSVAL32 ((UINT32)m_core->r[RSREG]) -#define RTVAL32 ((UINT32)m_core->r[RTREG]) -#define RDVAL32 ((UINT32)m_core->r[RDREG]) +#define RSVAL32 ((uint32_t)m_core->r[RSREG]) +#define RTVAL32 ((uint32_t)m_core->r[RTREG]) +#define RDVAL32 ((uint32_t)m_core->r[RDREG]) #define RSVAL64 (m_core->r[RSREG]) #define RTVAL64 (m_core->r[RTREG]) @@ -32,8 +32,8 @@ #define FTVALS_FR0 (((float *)&m_core->cpr[1][FTREG])[BYTE_XOR_LE(0)]) #define FSVALS_FR0 (((float *)&m_core->cpr[1][FSREG])[BYTE_XOR_LE(0)]) #define FDVALS_FR0 (((float *)&m_core->cpr[1][FDREG])[BYTE_XOR_LE(0)]) -#define FSVALW_FR0 (((UINT32 *)&m_core->cpr[1][FSREG])[BYTE_XOR_LE(0)]) -#define FDVALW_FR0 (((UINT32 *)&m_core->cpr[1][FDREG])[BYTE_XOR_LE(0)]) +#define FSVALW_FR0 (((uint32_t *)&m_core->cpr[1][FSREG])[BYTE_XOR_LE(0)]) +#define FDVALW_FR0 (((uint32_t *)&m_core->cpr[1][FDREG])[BYTE_XOR_LE(0)]) #define LFRVALD_FR0 (u2d(get_cop1_reg64(FRREG))) #define LFTVALD_FR0 (u2d(get_cop1_reg64(FTREG))) @@ -53,24 +53,24 @@ #define FTVALS_FR1 (((float *)&m_core->cpr[1][FTREG])[BYTE_XOR_LE(0)]) #define FSVALS_FR1 (((float *)&m_core->cpr[1][FSREG])[BYTE_XOR_LE(0)]) #define FDVALS_FR1 (((float *)&m_core->cpr[1][FDREG])[BYTE_XOR_LE(0)]) -#define FSVALW_FR1 (((UINT32 *)&m_core->cpr[1][FSREG])[BYTE_XOR_LE(0)]) -#define FDVALW_FR1 (((UINT32 *)&m_core->cpr[1][FDREG])[BYTE_XOR_LE(0)]) +#define FSVALW_FR1 (((uint32_t *)&m_core->cpr[1][FSREG])[BYTE_XOR_LE(0)]) +#define FDVALW_FR1 (((uint32_t *)&m_core->cpr[1][FDREG])[BYTE_XOR_LE(0)]) #define FRVALD_FR1 (*(double *)&m_core->cpr[1][FRREG]) #define FTVALD_FR1 (*(double *)&m_core->cpr[1][FTREG]) #define FSVALD_FR1 (*(double *)&m_core->cpr[1][FSREG]) #define FDVALD_FR1 (*(double *)&m_core->cpr[1][FDREG]) -#define FSVALL_FR1 (*(UINT64 *)&m_core->cpr[1][FSREG]) -#define FDVALL_FR1 (*(UINT64 *)&m_core->cpr[1][FDREG]) +#define FSVALL_FR1 (*(uint64_t *)&m_core->cpr[1][FSREG]) +#define FDVALL_FR1 (*(uint64_t *)&m_core->cpr[1][FDREG]) #define ADDPC(x) m_nextpc = m_core->pc + ((x) << 2) #define ABSPC(x) m_nextpc = (m_core->pc & 0xf0000000) | ((x) << 2) -#define ABSPCL(x,l) { m_nextpc = (m_core->pc & 0xf0000000) | ((x) << 2); m_core->r[l] = (INT32)(m_core->pc + 4); } +#define ABSPCL(x,l) { m_nextpc = (m_core->pc & 0xf0000000) | ((x) << 2); m_core->r[l] = (int32_t)(m_core->pc + 4); } #define SETPC(x) m_nextpc = (x) -#define SETPCL(x,l) { m_nextpc = (x); m_core->r[l] = (INT32)(m_core->pc + 4); } +#define SETPCL(x,l) { m_nextpc = (x); m_core->r[l] = (int32_t)(m_core->pc + 4); } -#define HIVAL (UINT32)m_core->r[REG_HI] -#define LOVAL (UINT32)m_core->r[REG_LO] +#define HIVAL (uint32_t)m_core->r[REG_HI] +#define LOVAL (uint32_t)m_core->r[REG_LO] #define HIVAL64 m_core->r[REG_HI] #define LOVAL64 m_core->r[REG_LO] #define SR m_core->cpr[0][COP0_Status] @@ -87,10 +87,10 @@ -static const UINT8 fcc_shift[8] = { 23, 25, 26, 27, 28, 29, 30, 31 }; +static const uint8_t fcc_shift[8] = { 23, 25, 26, 27, 28, 29, 30, 31 }; /* lookup table for FP modes */ -static const UINT8 fpmode_source[4] = +static const uint8_t fpmode_source[4] = { uml::ROUND_ROUND, uml::ROUND_TRUNC, @@ -124,7 +124,7 @@ const device_type RM7000LE = &device_creator; // VR4300 and VR5432 have 4 fewer PFN bits, and only 32 TLB entries -mips3_device::mips3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, mips3_flavor flavor, endianness_t endianness) +mips3_device::mips3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, mips3_flavor flavor, endianness_t endianness) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , device_vtlb_interface(mconfig, *this, AS_PROGRAM) , m_program_config("program", endianness, 32, 32, 0, 32, MIPS3_MIN_PAGE_SHIFT) @@ -217,7 +217,7 @@ void mips3_device::device_stop() void mips3_device::generate_exception(int exception, int backup) { - UINT32 offset = 0x180; + uint32_t offset = 0x180; /* useful for catching exceptions: @@ -269,7 +269,7 @@ void mips3_device::generate_exception(int exception, int backup) /* most exceptions go to offset 0x180, except for TLB stuff */ if (exception >= EXCEPTION_TLBMOD && exception <= EXCEPTION_TLBSTORE) { - osd_printf_debug("TLB miss @ %08X\n", (UINT32)m_core->cpr[0][COP0_BadVAddr]); + osd_printf_debug("TLB miss @ %08X\n", (uint32_t)m_core->cpr[0][COP0_BadVAddr]); } m_core->pc += offset; @@ -277,7 +277,7 @@ void mips3_device::generate_exception(int exception, int backup) useful for tracking interrupts if ((CAUSE & 0x7f) == 0) - logerror("Took interrupt -- Cause = %08X, PC = %08X\n", (UINT32)CAUSE, m_core->pc); + logerror("Took interrupt -- Cause = %08X, PC = %08X\n", (uint32_t)CAUSE, m_core->pc); */ } @@ -294,7 +294,7 @@ void mips3_device::generate_tlb_exception(int exception, offs_t address) } -void mips3_device::invalid_instruction(UINT32 op) +void mips3_device::invalid_instruction(uint32_t op) { generate_exception(EXCEPTION_INVALIDOP, 1); } @@ -337,7 +337,7 @@ void mips3_device::device_start() /* allocate a timer for the compare interrupt */ m_compare_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mips3_device::compare_int_callback), this)); - UINT32 flags = 0; + uint32_t flags = 0; /* initialize the UML generator */ m_drcuml = std::make_unique(*this, m_cache, flags, 8, 32, 2); @@ -963,10 +963,10 @@ bool mips3_device::memory_translate(address_spacenum spacenum, int intention, of } -offs_t mips3_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t mips3_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { - extern unsigned dasmmips3(char *, unsigned, UINT32); - UINT32 op = *(UINT32 *)oprom; + extern unsigned dasmmips3(char *, unsigned, uint32_t); + uint32_t op = *(uint32_t *)oprom; if (m_bigendian) op = big_endianize_int32(op); else @@ -980,12 +980,12 @@ offs_t mips3_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op TLB HANDLING ***************************************************************************/ -inline bool mips3_device::RBYTE(offs_t address, UINT32 *result) +inline bool mips3_device::RBYTE(offs_t address, uint32_t *result) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { - const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + const uint32_t tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) { if (tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) @@ -1013,12 +1013,12 @@ inline bool mips3_device::RBYTE(offs_t address, UINT32 *result) return true; } -inline bool mips3_device::RHALF(offs_t address, UINT32 *result) +inline bool mips3_device::RHALF(offs_t address, uint32_t *result) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { - const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + const uint32_t tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) { if (tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) @@ -1046,12 +1046,12 @@ inline bool mips3_device::RHALF(offs_t address, UINT32 *result) return true; } -inline bool mips3_device::RWORD(offs_t address, UINT32 *result) +inline bool mips3_device::RWORD(offs_t address, uint32_t *result) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { - const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + const uint32_t tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) { if (tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) @@ -1079,9 +1079,9 @@ inline bool mips3_device::RWORD(offs_t address, UINT32 *result) return true; } -inline bool mips3_device::RWORD_MASKED(offs_t address, UINT32 *result, UINT32 mem_mask) +inline bool mips3_device::RWORD_MASKED(offs_t address, uint32_t *result, uint32_t mem_mask) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { *result = (*m_memory.read_dword_masked)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), mem_mask); @@ -1102,9 +1102,9 @@ inline bool mips3_device::RWORD_MASKED(offs_t address, UINT32 *result, UINT32 me return true; } -inline bool mips3_device::RDOUBLE(offs_t address, UINT64 *result) +inline bool mips3_device::RDOUBLE(offs_t address, uint64_t *result) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { *result = (*m_memory.read_qword)(*m_program, (tlbval & ~0xfff) | (address & 0xfff)); @@ -1125,9 +1125,9 @@ inline bool mips3_device::RDOUBLE(offs_t address, UINT64 *result) return true; } -inline bool mips3_device::RDOUBLE_MASKED(offs_t address, UINT64 *result, UINT64 mem_mask) +inline bool mips3_device::RDOUBLE_MASKED(offs_t address, uint64_t *result, uint64_t mem_mask) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_READ_ALLOWED) { *result = (*m_memory.read_qword_masked)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), mem_mask); @@ -1148,12 +1148,12 @@ inline bool mips3_device::RDOUBLE_MASKED(offs_t address, UINT64 *result, UINT64 return true; } -inline void mips3_device::WBYTE(offs_t address, UINT8 data) +inline void mips3_device::WBYTE(offs_t address, uint8_t data) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { - const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + const uint32_t tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) { if (m_fastram[ramnum].readonly == TRUE || tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) @@ -1182,12 +1182,12 @@ inline void mips3_device::WBYTE(offs_t address, UINT8 data) } } -inline void mips3_device::WHALF(offs_t address, UINT16 data) +inline void mips3_device::WHALF(offs_t address, uint16_t data) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { - const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + const uint32_t tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) { if (m_fastram[ramnum].readonly == TRUE || tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) @@ -1216,12 +1216,12 @@ inline void mips3_device::WHALF(offs_t address, UINT16 data) } } -inline void mips3_device::WWORD(offs_t address, UINT32 data) +inline void mips3_device::WWORD(offs_t address, uint32_t data) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { - const UINT32 tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); + const uint32_t tlbaddress = (tlbval & ~0xfff) | (address & 0xfff); for (int ramnum = 0; ramnum < m_fastram_select; ramnum++) { if (m_fastram[ramnum].readonly == TRUE || tlbaddress < m_fastram[ramnum].start || tlbaddress > m_fastram[ramnum].end) @@ -1250,9 +1250,9 @@ inline void mips3_device::WWORD(offs_t address, UINT32 data) } } -inline void mips3_device::WWORD_MASKED(offs_t address, UINT32 data, UINT32 mem_mask) +inline void mips3_device::WWORD_MASKED(offs_t address, uint32_t data, uint32_t mem_mask) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { (*m_memory.write_dword_masked)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data, mem_mask); @@ -1274,9 +1274,9 @@ inline void mips3_device::WWORD_MASKED(offs_t address, UINT32 data, UINT32 mem_m } } -inline void mips3_device::WDOUBLE(offs_t address, UINT64 data) +inline void mips3_device::WDOUBLE(offs_t address, uint64_t data) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { (*m_memory.write_qword)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data); @@ -1298,9 +1298,9 @@ inline void mips3_device::WDOUBLE(offs_t address, UINT64 data) } } -inline void mips3_device::WDOUBLE_MASKED(offs_t address, UINT64 data, UINT64 mem_mask) +inline void mips3_device::WDOUBLE_MASKED(offs_t address, uint64_t data, uint64_t mem_mask) { - const UINT32 tlbval = vtlb_table()[address >> 12]; + const uint32_t tlbval = vtlb_table()[address >> 12]; if (tlbval & VTLB_WRITE_ALLOWED) { (*m_memory.write_qword_masked)(*m_program, (tlbval & ~0xfff) | (address & 0xfff), data, mem_mask); @@ -1328,7 +1328,7 @@ inline void mips3_device::WDOUBLE_MASKED(offs_t address, UINT64 data, UINT64 mem COP0 (SYSTEM) EXECUTION HANDLING ***************************************************************************/ -UINT64 mips3_device::get_cop0_reg(int idx) +uint64_t mips3_device::get_cop0_reg(int idx) { if (idx == COP0_Count) { @@ -1338,7 +1338,7 @@ UINT64 mips3_device::get_cop0_reg(int idx) m_core->icount -= MIPS3_COUNT_READ_CYCLES; else m_core->icount = 0; - return (UINT32)((total_cycles() - m_core->count_zero_time) / 2); + return (uint32_t)((total_cycles() - m_core->count_zero_time) / 2); } else if (idx == COP0_Cause) { @@ -1361,7 +1361,7 @@ UINT64 mips3_device::get_cop0_reg(int idx) return m_core->cpr[0][idx]; } -void mips3_device::set_cop0_reg(int idx, UINT64 val) +void mips3_device::set_cop0_reg(int idx, uint64_t val) { switch (idx) { @@ -1382,7 +1382,7 @@ void mips3_device::set_cop0_reg(int idx, UINT64 val) case COP0_Status: { /* update interrupts and cycle counting */ - UINT32 diff = m_core->cpr[0][idx] ^ val; + uint32_t diff = m_core->cpr[0][idx] ^ val; // if (val & 0xe0) // fatalerror("System set 64-bit addressing mode, SR=%08X\n", val); m_core->cpr[0][idx] = val; @@ -1394,7 +1394,7 @@ void mips3_device::set_cop0_reg(int idx, UINT64 val) case COP0_Count: m_core->cpr[0][idx] = val; - m_core->count_zero_time = total_cycles() - ((UINT64)(UINT32)val * 2); + m_core->count_zero_time = total_cycles() - ((uint64_t)(uint32_t)val * 2); mips3com_update_cycle_counting(); break; @@ -1428,17 +1428,17 @@ void mips3_device::set_cop0_reg(int idx, UINT64 val) } } -inline UINT64 mips3_device::get_cop0_creg(int idx) +inline uint64_t mips3_device::get_cop0_creg(int idx) { return m_core->ccr[0][idx]; } -inline void mips3_device::set_cop0_creg(int idx, UINT64 val) +inline void mips3_device::set_cop0_creg(int idx, uint64_t val) { m_core->ccr[0][idx] = val; } -void mips3_device::handle_cop0(UINT32 op) +void mips3_device::handle_cop0(uint32_t op) { if ((SR & SR_KSU_MASK) != SR_KSU_KERNEL && !(SR & SR_COP0)) { @@ -1449,9 +1449,9 @@ void mips3_device::handle_cop0(UINT32 op) switch (RSREG) { - case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (INT32)get_cop0_reg(RDREG); break; + case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop0_reg(RDREG); break; case 0x01: /* DMFCz */ if (RTREG) RTVAL64 = get_cop0_reg(RDREG); break; - case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (INT32)get_cop0_creg(RDREG); break; + case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop0_creg(RDREG); break; case 0x04: /* MTCz */ set_cop0_reg(RDREG, RTVAL32); break; case 0x05: /* DMTCz */ set_cop0_reg(RDREG, RTVAL64); break; case 0x06: /* CTCz */ set_cop0_creg(RDREG, RTVAL32); break; @@ -1515,42 +1515,42 @@ void mips3_device::handle_cop0(UINT32 op) COP1 (FPU) EXECUTION HANDLING ***************************************************************************/ -inline UINT32 mips3_device::get_cop1_reg32(int idx) +inline uint32_t mips3_device::get_cop1_reg32(int idx) { return m_core->cpr[1][idx]; } -inline UINT64 mips3_device::get_cop1_reg64(int idx) +inline uint64_t mips3_device::get_cop1_reg64(int idx) { if (IS_FR0) - return (UINT64(((UINT32 *)&m_core->cpr[1][(idx&0x1E) + 1])[BYTE_XOR_LE(0)])) << 32 - | (UINT64(((UINT32 *)&m_core->cpr[1][idx&0x1E])[BYTE_XOR_LE(0)])); + return (uint64_t(((uint32_t *)&m_core->cpr[1][(idx&0x1E) + 1])[BYTE_XOR_LE(0)])) << 32 + | (uint64_t(((uint32_t *)&m_core->cpr[1][idx&0x1E])[BYTE_XOR_LE(0)])); else return m_core->cpr[1][idx]; } -inline void mips3_device::set_cop1_reg32(int idx, UINT32 val) +inline void mips3_device::set_cop1_reg32(int idx, uint32_t val) { m_core->cpr[1][idx] = val; } -inline void mips3_device::set_cop1_reg64(int idx, UINT64 val) +inline void mips3_device::set_cop1_reg64(int idx, uint64_t val) { if (IS_FR0) { - ((UINT32 *)&m_core->cpr[1][idx&0x1E])[BYTE_XOR_LE(0)] = val & 0xFFFFFFFF; - ((UINT32 *)&m_core->cpr[1][(idx&0x1E) + 1])[BYTE_XOR_LE(0)] = val >> 32; + ((uint32_t *)&m_core->cpr[1][idx&0x1E])[BYTE_XOR_LE(0)] = val & 0xFFFFFFFF; + ((uint32_t *)&m_core->cpr[1][(idx&0x1E) + 1])[BYTE_XOR_LE(0)] = val >> 32; } else { m_core->cpr[1][idx] = val; } } -inline UINT64 mips3_device::get_cop1_creg(int idx) +inline uint64_t mips3_device::get_cop1_creg(int idx) { if (idx == 31) { - UINT32 result = m_core->ccr[1][31] & ~0xfe800000; + uint32_t result = m_core->ccr[1][31] & ~0xfe800000; int i; for (i = 0; i < 8; i++) @@ -1561,7 +1561,7 @@ inline UINT64 mips3_device::get_cop1_creg(int idx) return m_core->ccr[1][idx]; } -inline void mips3_device::set_cop1_creg(int idx, UINT64 val) +inline void mips3_device::set_cop1_creg(int idx, uint64_t val) { m_core->ccr[1][idx] = val; if (idx == 31) @@ -1573,7 +1573,7 @@ inline void mips3_device::set_cop1_creg(int idx, UINT64 val) } } -void mips3_device::handle_cop1_fr0(UINT32 op) +void mips3_device::handle_cop1_fr0(uint32_t op) { double dtemp; @@ -1588,9 +1588,9 @@ void mips3_device::handle_cop1_fr0(UINT32 op) switch (RSREG) { - case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (INT32)get_cop1_reg32(RDREG); break; + case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop1_reg32(RDREG); break; case 0x01: /* DMFCz */ if (RTREG) RTVAL64 = get_cop1_reg64(RDREG); break; - case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (INT32)get_cop1_creg(RDREG); break; + case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop1_creg(RDREG); break; case 0x04: /* MTCz */ set_cop1_reg32(RDREG, RTVAL32); break; case 0x05: /* DMTCz */ set_cop1_reg64(RDREG, RTVAL64); break; case 0x06: /* CTCz */ set_cop1_creg(RDREG, RTVAL32); break; @@ -1670,7 +1670,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) temp = ceil(temp - 0.5); else temp = floor(temp + 0.5); - SFDVALL_FR0((INT64)temp); + SFDVALL_FR0((int64_t)temp); } else /* ROUND.L.D */ { @@ -1679,7 +1679,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) temp = ceil(temp - 0.5); else temp = floor(temp + 0.5); - SFDVALL_FR0((INT64)temp); + SFDVALL_FR0((int64_t)temp); } break; @@ -1691,7 +1691,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) temp = ceil(temp); else temp = floor(temp); - SFDVALL_FR0((INT64)temp); + SFDVALL_FR0((int64_t)temp); } else /* TRUNC.L.D */ { @@ -1700,7 +1700,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) temp = ceil(temp); else temp = floor(temp); - SFDVALL_FR0((INT64)temp); + SFDVALL_FR0((int64_t)temp); } break; @@ -1709,7 +1709,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) dtemp = ceil(FSVALS_FR0); else /* CEIL.L.D */ dtemp = ceil(LFSVALD_FR0); - SFDVALL_FR0((INT64)dtemp); + SFDVALL_FR0((int64_t)dtemp); break; case 0x0b: @@ -1717,7 +1717,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) dtemp = floor(FSVALS_FR0); else /* FLOOR.L.D */ dtemp = floor(LFSVALD_FR0); - SFDVALL_FR0((INT64)dtemp); + SFDVALL_FR0((int64_t)dtemp); break; case 0x0c: @@ -1728,7 +1728,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) dtemp = ceil(dtemp - 0.5); else dtemp = floor(dtemp + 0.5); - FDVALW_FR0 = (INT32)dtemp; + FDVALW_FR0 = (int32_t)dtemp; } else /* ROUND.W.D */ { @@ -1737,7 +1737,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) dtemp = ceil(dtemp - 0.5); else dtemp = floor(dtemp + 0.5); - FDVALW_FR0 = (INT32)dtemp; + FDVALW_FR0 = (int32_t)dtemp; } break; @@ -1749,7 +1749,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) dtemp = ceil(dtemp); else dtemp = floor(dtemp); - FDVALW_FR0 = (INT32)dtemp; + FDVALW_FR0 = (int32_t)dtemp; } else /* TRUNC.W.D */ { @@ -1758,7 +1758,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) dtemp = ceil(dtemp); else dtemp = floor(dtemp); - FDVALW_FR0 = (INT32)dtemp; + FDVALW_FR0 = (int32_t)dtemp; } break; @@ -1767,7 +1767,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) dtemp = ceil(FSVALS_FR0); else /* CEIL.W.D */ dtemp = ceil(LFSVALD_FR0); - FDVALW_FR0 = (INT32)dtemp; + FDVALW_FR0 = (int32_t)dtemp; break; case 0x0f: @@ -1775,7 +1775,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) dtemp = floor(FSVALS_FR0); else /* FLOOR.W.D */ dtemp = floor(LFSVALD_FR0); - FDVALW_FR0 = (INT32)dtemp; + FDVALW_FR0 = (int32_t)dtemp; break; case 0x11: /* R5000 */ @@ -1826,9 +1826,9 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_INTEGRAL(op)) { if (IS_SINGLE(op)) /* CVT.S.W */ - FDVALS_FR0 = (INT32)FSVALW_FR0; + FDVALS_FR0 = (int32_t)FSVALW_FR0; else /* CVT.S.L */ - FDVALS_FR0 = (INT64)LFSVALL_FR0; + FDVALS_FR0 = (int64_t)LFSVALL_FR0; } else /* CVT.S.D */ FDVALS_FR0 = LFSVALD_FR0; @@ -1838,9 +1838,9 @@ void mips3_device::handle_cop1_fr0(UINT32 op) if (IS_INTEGRAL(op)) { if (IS_SINGLE(op)) /* CVT.D.W */ - SFDVALD_FR0((INT32)FSVALW_FR0); + SFDVALD_FR0((int32_t)FSVALW_FR0); else /* CVT.D.L */ - SFDVALD_FR0((INT64)LFSVALL_FR0); + SFDVALD_FR0((int64_t)LFSVALL_FR0); } else /* CVT.D.S */ SFDVALD_FR0(FSVALS_FR0); @@ -1848,16 +1848,16 @@ void mips3_device::handle_cop1_fr0(UINT32 op) case 0x24: if (IS_SINGLE(op)) /* CVT.W.S */ - FDVALW_FR0 = (INT32)FSVALS_FR0; + FDVALW_FR0 = (int32_t)FSVALS_FR0; else - FDVALW_FR0 = (INT32)LFSVALD_FR0; + FDVALW_FR0 = (int32_t)LFSVALD_FR0; break; case 0x25: if (IS_SINGLE(op)) /* CVT.L.S */ - SFDVALL_FR0((INT64)FSVALS_FR0); + SFDVALL_FR0((int64_t)FSVALS_FR0); else /* CVT.L.D */ - SFDVALL_FR0((INT64)LFSVALD_FR0); + SFDVALL_FR0((int64_t)LFSVALD_FR0); break; case 0x30: @@ -1933,7 +1933,7 @@ void mips3_device::handle_cop1_fr0(UINT32 op) } -void mips3_device::handle_cop1_fr1(UINT32 op) +void mips3_device::handle_cop1_fr1(uint32_t op) { double dtemp; @@ -1948,9 +1948,9 @@ void mips3_device::handle_cop1_fr1(UINT32 op) switch (RSREG) { - case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (INT32)get_cop1_reg32(RDREG); break; + case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop1_reg32(RDREG); break; case 0x01: /* DMFCz */ if (RTREG) RTVAL64 = get_cop1_reg64(RDREG); break; - case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (INT32)get_cop1_creg(RDREG); break; + case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop1_creg(RDREG); break; case 0x04: /* MTCz */ set_cop1_reg32(RDREG, RTVAL32); break; case 0x05: /* DMTCz */ set_cop1_reg64(RDREG, RTVAL64); break; case 0x06: /* CTCz */ set_cop1_creg(RDREG, RTVAL32); break; @@ -2030,7 +2030,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) temp = ceil(temp - 0.5); else temp = floor(temp + 0.5); - FDVALL_FR1 = (INT64)temp; + FDVALL_FR1 = (int64_t)temp; } else /* ROUND.L.D */ { @@ -2039,7 +2039,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) temp = ceil(temp - 0.5); else temp = floor(temp + 0.5); - FDVALL_FR1 = (INT64)temp; + FDVALL_FR1 = (int64_t)temp; } break; @@ -2051,7 +2051,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) temp = ceil(temp); else temp = floor(temp); - FDVALL_FR1 = (INT64)temp; + FDVALL_FR1 = (int64_t)temp; } else /* TRUNC.L.D */ { @@ -2060,7 +2060,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) temp = ceil(temp); else temp = floor(temp); - FDVALL_FR1 = (INT64)temp; + FDVALL_FR1 = (int64_t)temp; } break; @@ -2069,7 +2069,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) dtemp = ceil(FSVALS_FR1); else /* CEIL.L.D */ dtemp = ceil(FSVALD_FR1); - FDVALL_FR1 = (INT64)dtemp; + FDVALL_FR1 = (int64_t)dtemp; break; case 0x0b: @@ -2077,7 +2077,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) dtemp = floor(FSVALS_FR1); else /* FLOOR.L.D */ dtemp = floor(FSVALD_FR1); - FDVALL_FR1 = (INT64)dtemp; + FDVALL_FR1 = (int64_t)dtemp; break; case 0x0c: @@ -2088,7 +2088,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) dtemp = ceil(dtemp - 0.5); else dtemp = floor(dtemp + 0.5); - FDVALW_FR1 = (INT32)dtemp; + FDVALW_FR1 = (int32_t)dtemp; } else /* ROUND.W.D */ { @@ -2097,7 +2097,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) dtemp = ceil(dtemp - 0.5); else dtemp = floor(dtemp + 0.5); - FDVALW_FR1 = (INT32)dtemp; + FDVALW_FR1 = (int32_t)dtemp; } break; @@ -2109,7 +2109,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) dtemp = ceil(dtemp); else dtemp = floor(dtemp); - FDVALW_FR1 = (INT32)dtemp; + FDVALW_FR1 = (int32_t)dtemp; } else /* TRUNC.W.D */ { @@ -2118,7 +2118,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) dtemp = ceil(dtemp); else dtemp = floor(dtemp); - FDVALW_FR1 = (INT32)dtemp; + FDVALW_FR1 = (int32_t)dtemp; } break; @@ -2127,7 +2127,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) dtemp = ceil(FSVALS_FR1); else /* CEIL.W.D */ dtemp = ceil(FSVALD_FR1); - FDVALW_FR1 = (INT32)dtemp; + FDVALW_FR1 = (int32_t)dtemp; break; case 0x0f: @@ -2135,7 +2135,7 @@ void mips3_device::handle_cop1_fr1(UINT32 op) dtemp = floor(FSVALS_FR1); else /* FLOOR.W.D */ dtemp = floor(FSVALD_FR1); - FDVALW_FR1 = (INT32)dtemp; + FDVALW_FR1 = (int32_t)dtemp; break; case 0x11: /* R5000 */ @@ -2186,9 +2186,9 @@ void mips3_device::handle_cop1_fr1(UINT32 op) if (IS_INTEGRAL(op)) { if (IS_SINGLE(op)) /* CVT.S.W */ - FDVALS_FR1 = (INT32)FSVALW_FR1; + FDVALS_FR1 = (int32_t)FSVALW_FR1; else /* CVT.S.L */ - FDVALS_FR1 = (INT64)FSVALL_FR1; + FDVALS_FR1 = (int64_t)FSVALL_FR1; } else /* CVT.S.D */ FDVALS_FR1 = FSVALD_FR1; @@ -2198,9 +2198,9 @@ void mips3_device::handle_cop1_fr1(UINT32 op) if (IS_INTEGRAL(op)) { if (IS_SINGLE(op)) /* CVT.D.W */ - FDVALD_FR1 = (INT32)FSVALW_FR1; + FDVALD_FR1 = (int32_t)FSVALW_FR1; else /* CVT.D.L */ - FDVALD_FR1 = (INT64)FSVALL_FR1; + FDVALD_FR1 = (int64_t)FSVALL_FR1; } else /* CVT.D.S */ FDVALD_FR1 = FSVALS_FR1; @@ -2208,16 +2208,16 @@ void mips3_device::handle_cop1_fr1(UINT32 op) case 0x24: if (IS_SINGLE(op)) /* CVT.W.S */ - FDVALW_FR1 = (INT32)FSVALS_FR1; + FDVALW_FR1 = (int32_t)FSVALS_FR1; else - FDVALW_FR1 = (INT32)FSVALD_FR1; + FDVALW_FR1 = (int32_t)FSVALD_FR1; break; case 0x25: if (IS_SINGLE(op)) /* CVT.L.S */ - FDVALL_FR1 = (INT64)FSVALS_FR1; + FDVALL_FR1 = (int64_t)FSVALS_FR1; else /* CVT.L.D */ - FDVALL_FR1 = (INT64)FSVALD_FR1; + FDVALL_FR1 = (int64_t)FSVALD_FR1; break; case 0x30: @@ -2298,10 +2298,10 @@ void mips3_device::handle_cop1_fr1(UINT32 op) COP1X (FPU EXTRA) EXECUTION HANDLING ***************************************************************************/ -void mips3_device::handle_cop1x_fr0(UINT32 op) +void mips3_device::handle_cop1x_fr0(uint32_t op) { - UINT64 temp64; - UINT32 temp; + uint64_t temp64; + uint32_t temp; if (!(SR & SR_COP1)) { @@ -2377,10 +2377,10 @@ void mips3_device::handle_cop1x_fr0(UINT32 op) } } -void mips3_device::handle_cop1x_fr1(UINT32 op) +void mips3_device::handle_cop1x_fr1(uint32_t op) { - UINT64 temp64; - UINT32 temp; + uint64_t temp64; + uint32_t temp; if (!(SR & SR_COP1)) { @@ -2462,27 +2462,27 @@ void mips3_device::handle_cop1x_fr1(UINT32 op) COP2 (CUSTOM) EXECUTION HANDLING ***************************************************************************/ -inline UINT64 mips3_device::get_cop2_reg(int idx) +inline uint64_t mips3_device::get_cop2_reg(int idx) { return m_core->cpr[2][idx]; } -inline void mips3_device::set_cop2_reg(int idx, UINT64 val) +inline void mips3_device::set_cop2_reg(int idx, uint64_t val) { m_core->cpr[2][idx] = val; } -inline UINT64 mips3_device::get_cop2_creg(int idx) +inline uint64_t mips3_device::get_cop2_creg(int idx) { return m_core->ccr[2][idx]; } -inline void mips3_device::set_cop2_creg(int idx, UINT64 val) +inline void mips3_device::set_cop2_creg(int idx, uint64_t val) { m_core->ccr[2][idx] = val; } -void mips3_device::handle_cop2(UINT32 op) +void mips3_device::handle_cop2(uint32_t op) { if (!(SR & SR_COP2)) { @@ -2493,9 +2493,9 @@ void mips3_device::handle_cop2(UINT32 op) switch (RSREG) { - case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (INT32)get_cop2_reg(RDREG); break; + case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop2_reg(RDREG); break; case 0x01: /* DMFCz */ if (RTREG) RTVAL64 = get_cop2_reg(RDREG); break; - case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (INT32)get_cop2_creg(RDREG); break; + case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop2_creg(RDREG); break; case 0x04: /* MTCz */ set_cop2_reg(RDREG, RTVAL32); break; case 0x05: /* DMTCz */ set_cop2_reg(RDREG, RTVAL64); break; case 0x06: /* CTCz */ set_cop2_creg(RDREG, RTVAL32); break; @@ -2535,39 +2535,39 @@ void mips3_device::handle_cop2(UINT32 op) CORE EXECUTION LOOP ***************************************************************************/ -void mips3_device::handle_regimm(UINT32 op) +void mips3_device::handle_regimm(uint32_t op) { switch (RTREG) { - case 0x00: /* BLTZ */ if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); break; - case 0x01: /* BGEZ */ if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); break; - case 0x02: /* BLTZL */ if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; - case 0x03: /* BGEZL */ if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; - case 0x08: /* TGEI */ if ((INT64)RSVAL64 >= SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x00: /* BLTZ */ if ((int64_t)RSVAL64 < 0) ADDPC(SIMMVAL); break; + case 0x01: /* BGEZ */ if ((int64_t)RSVAL64 >= 0) ADDPC(SIMMVAL); break; + case 0x02: /* BLTZL */ if ((int64_t)RSVAL64 < 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; + case 0x03: /* BGEZL */ if ((int64_t)RSVAL64 >= 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; + case 0x08: /* TGEI */ if ((int64_t)RSVAL64 >= SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; case 0x09: /* TGEIU */ if (RSVAL64 >= UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x0a: /* TLTI */ if ((INT64)RSVAL64 < SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x0a: /* TLTI */ if ((int64_t)RSVAL64 < SIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; case 0x0b: /* TLTIU */ if (RSVAL64 >= UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; case 0x0c: /* TEQI */ if (RSVAL64 == UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; case 0x0e: /* TNEI */ if (RSVAL64 != UIMMVAL) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x10: /* BLTZAL */ m_core->r[31] = (INT32)(m_core->pc + 4); if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); break; - case 0x11: /* BGEZAL */ m_core->r[31] = (INT32)(m_core->pc + 4); if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); break; - case 0x12: /* BLTZALL */ m_core->r[31] = (INT32)(m_core->pc + 4); if ((INT64)RSVAL64 < 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; - case 0x13: /* BGEZALL */ m_core->r[31] = (INT32)(m_core->pc + 4); if ((INT64)RSVAL64 >= 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; + case 0x10: /* BLTZAL */ m_core->r[31] = (int32_t)(m_core->pc + 4); if ((int64_t)RSVAL64 < 0) ADDPC(SIMMVAL); break; + case 0x11: /* BGEZAL */ m_core->r[31] = (int32_t)(m_core->pc + 4); if ((int64_t)RSVAL64 >= 0) ADDPC(SIMMVAL); break; + case 0x12: /* BLTZALL */ m_core->r[31] = (int32_t)(m_core->pc + 4); if ((int64_t)RSVAL64 < 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; + case 0x13: /* BGEZALL */ m_core->r[31] = (int32_t)(m_core->pc + 4); if ((int64_t)RSVAL64 >= 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; default: /* ??? */ invalid_instruction(op); break; } } -void mips3_device::handle_special(UINT32 op) +void mips3_device::handle_special(uint32_t op) { switch (op & 63) { - case 0x00: /* SLL */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 << SHIFT); break; + case 0x00: /* SLL */ if (RDREG) RDVAL64 = (int32_t)(RTVAL32 << SHIFT); break; case 0x01: /* MOVF - R5000*/if (RDREG && GET_FCC((op >> 18) & 7) == ((op >> 16) & 1)) RDVAL64 = RSVAL64; break; - case 0x02: /* SRL */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 >> SHIFT); break; - case 0x03: /* SRA */ if (RDREG) RDVAL64 = (INT32)RTVAL32 >> SHIFT; break; - case 0x04: /* SLLV */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 << (RSVAL32 & 31)); break; - case 0x06: /* SRLV */ if (RDREG) RDVAL64 = (INT32)(RTVAL32 >> (RSVAL32 & 31)); break; - case 0x07: /* SRAV */ if (RDREG) RDVAL64 = (INT32)RTVAL32 >> (RSVAL32 & 31); break; + case 0x02: /* SRL */ if (RDREG) RDVAL64 = (int32_t)(RTVAL32 >> SHIFT); break; + case 0x03: /* SRA */ if (RDREG) RDVAL64 = (int32_t)RTVAL32 >> SHIFT; break; + case 0x04: /* SLLV */ if (RDREG) RDVAL64 = (int32_t)(RTVAL32 << (RSVAL32 & 31)); break; + case 0x06: /* SRLV */ if (RDREG) RDVAL64 = (int32_t)(RTVAL32 >> (RSVAL32 & 31)); break; + case 0x07: /* SRAV */ if (RDREG) RDVAL64 = (int32_t)RTVAL32 >> (RSVAL32 & 31); break; case 0x08: /* JR */ SETPC(RSVAL32); break; case 0x09: /* JALR */ SETPCL(RSVAL32,RDREG); break; case 0x0a: /* MOVZ - R5000 */if (RTVAL64 == 0) { if (RDREG) RDVAL64 = RSVAL64; } break; @@ -2581,76 +2581,76 @@ void mips3_device::handle_special(UINT32 op) case 0x13: /* MTLO */ LOVAL64 = RSVAL64; break; case 0x14: /* DSLLV */ if (RDREG) RDVAL64 = RTVAL64 << (RSVAL32 & 63); break; case 0x16: /* DSRLV */ if (RDREG) RDVAL64 = RTVAL64 >> (RSVAL32 & 63); break; - case 0x17: /* DSRAV */ if (RDREG) RDVAL64 = (INT64)RTVAL64 >> (RSVAL32 & 63); break; + case 0x17: /* DSRAV */ if (RDREG) RDVAL64 = (int64_t)RTVAL64 >> (RSVAL32 & 63); break; case 0x18: /* MULT */ { - UINT64 temp64 = (INT64)(INT32)RSVAL32 * (INT64)(INT32)RTVAL32; - LOVAL64 = (INT32)temp64; - HIVAL64 = (INT32)(temp64 >> 32); + uint64_t temp64 = (int64_t)(int32_t)RSVAL32 * (int64_t)(int32_t)RTVAL32; + LOVAL64 = (int32_t)temp64; + HIVAL64 = (int32_t)(temp64 >> 32); m_core->icount -= 3; break; } case 0x19: /* MULTU */ { - UINT64 temp64 = (UINT64)RSVAL32 * (UINT64)RTVAL32; - LOVAL64 = (INT32)temp64; - HIVAL64 = (INT32)(temp64 >> 32); + uint64_t temp64 = (uint64_t)RSVAL32 * (uint64_t)RTVAL32; + LOVAL64 = (int32_t)temp64; + HIVAL64 = (int32_t)(temp64 >> 32); m_core->icount -= 3; break; } case 0x1a: /* DIV */ if (RTVAL32) { - LOVAL64 = (INT32)((INT32)RSVAL32 / (INT32)RTVAL32); - HIVAL64 = (INT32)((INT32)RSVAL32 % (INT32)RTVAL32); + LOVAL64 = (int32_t)((int32_t)RSVAL32 / (int32_t)RTVAL32); + HIVAL64 = (int32_t)((int32_t)RSVAL32 % (int32_t)RTVAL32); } m_core->icount -= 35; break; case 0x1b: /* DIVU */ if (RTVAL32) { - LOVAL64 = (INT32)(RSVAL32 / RTVAL32); - HIVAL64 = (INT32)(RSVAL32 % RTVAL32); + LOVAL64 = (int32_t)(RSVAL32 / RTVAL32); + HIVAL64 = (int32_t)(RSVAL32 % RTVAL32); } m_core->icount -= 35; break; case 0x1c: /* DMULT */ { - INT64 rshi = (INT32)(RSVAL64 >> 32); - INT64 rthi = (INT32)(RTVAL64 >> 32); - INT64 rslo = (UINT32)RSVAL64; - INT64 rtlo = (UINT32)RTVAL64; - INT64 mid_prods = (rshi * rtlo) + (rslo * rthi); - UINT64 lo_prod = (rslo * rtlo); - INT64 hi_prod = (rshi * rthi); + int64_t rshi = (int32_t)(RSVAL64 >> 32); + int64_t rthi = (int32_t)(RTVAL64 >> 32); + int64_t rslo = (uint32_t)RSVAL64; + int64_t rtlo = (uint32_t)RTVAL64; + int64_t mid_prods = (rshi * rtlo) + (rslo * rthi); + uint64_t lo_prod = (rslo * rtlo); + int64_t hi_prod = (rshi * rthi); mid_prods += lo_prod >> 32; HIVAL64 = hi_prod + (mid_prods >> 32); - LOVAL64 = (UINT32)lo_prod + (mid_prods << 32); + LOVAL64 = (uint32_t)lo_prod + (mid_prods << 32); m_core->icount -= 7; break; } case 0x1d: /* DMULTU */ { - UINT64 rshi = (INT32)(RSVAL64 >> 32); - UINT64 rthi = (INT32)(RTVAL64 >> 32); - UINT64 rslo = (UINT32)RSVAL64; - UINT64 rtlo = (UINT32)RTVAL64; - UINT64 mid_prods = (rshi * rtlo) + (rslo * rthi); - UINT64 lo_prod = (rslo * rtlo); - UINT64 hi_prod = (rshi * rthi); + uint64_t rshi = (int32_t)(RSVAL64 >> 32); + uint64_t rthi = (int32_t)(RTVAL64 >> 32); + uint64_t rslo = (uint32_t)RSVAL64; + uint64_t rtlo = (uint32_t)RTVAL64; + uint64_t mid_prods = (rshi * rtlo) + (rslo * rthi); + uint64_t lo_prod = (rslo * rtlo); + uint64_t hi_prod = (rshi * rthi); mid_prods += lo_prod >> 32; HIVAL64 = hi_prod + (mid_prods >> 32); - LOVAL64 = (UINT32)lo_prod + (mid_prods << 32); + LOVAL64 = (uint32_t)lo_prod + (mid_prods << 32); m_core->icount -= 7; break; } case 0x1e: /* DDIV */ if (RTVAL64) { - LOVAL64 = (INT64)RSVAL64 / (INT64)RTVAL64; - HIVAL64 = (INT64)RSVAL64 % (INT64)RTVAL64; + LOVAL64 = (int64_t)RSVAL64 / (int64_t)RTVAL64; + HIVAL64 = (int64_t)RSVAL64 % (int64_t)RTVAL64; } m_core->icount -= 67; break; @@ -2664,20 +2664,20 @@ void mips3_device::handle_special(UINT32 op) break; case 0x20: /* ADD */ if (ENABLE_OVERFLOWS && RSVAL32 > ~RTVAL32) generate_exception(EXCEPTION_OVERFLOW, 1); - else if (RDREG) RDVAL64 = (INT32)(RSVAL32 + RTVAL32); + else if (RDREG) RDVAL64 = (int32_t)(RSVAL32 + RTVAL32); break; - case 0x21: /* ADDU */ if (RDREG) RDVAL64 = (INT32)(RSVAL32 + RTVAL32); break; + case 0x21: /* ADDU */ if (RDREG) RDVAL64 = (int32_t)(RSVAL32 + RTVAL32); break; case 0x22: /* SUB */ if (ENABLE_OVERFLOWS && RSVAL32 < RTVAL32) generate_exception(EXCEPTION_OVERFLOW, 1); - else if (RDREG) RDVAL64 = (INT32)(RSVAL32 - RTVAL32); + else if (RDREG) RDVAL64 = (int32_t)(RSVAL32 - RTVAL32); break; - case 0x23: /* SUBU */ if (RDREG) RDVAL64 = (INT32)(RSVAL32 - RTVAL32); break; + case 0x23: /* SUBU */ if (RDREG) RDVAL64 = (int32_t)(RSVAL32 - RTVAL32); break; case 0x24: /* AND */ if (RDREG) RDVAL64 = RSVAL64 & RTVAL64; break; case 0x25: /* OR */ if (RDREG) RDVAL64 = RSVAL64 | RTVAL64; break; case 0x26: /* XOR */ if (RDREG) RDVAL64 = RSVAL64 ^ RTVAL64; break; case 0x27: /* NOR */ if (RDREG) RDVAL64 = ~(RSVAL64 | RTVAL64); break; - case 0x2a: /* SLT */ if (RDREG) RDVAL64 = (INT64)RSVAL64 < (INT64)RTVAL64; break; - case 0x2b: /* SLTU */ if (RDREG) RDVAL64 = (UINT64)RSVAL64 < (UINT64)RTVAL64; break; + case 0x2a: /* SLT */ if (RDREG) RDVAL64 = (int64_t)RSVAL64 < (int64_t)RTVAL64; break; + case 0x2b: /* SLTU */ if (RDREG) RDVAL64 = (uint64_t)RSVAL64 < (uint64_t)RTVAL64; break; case 0x2c: /* DADD */ if (ENABLE_OVERFLOWS && RSVAL64 > ~RTVAL64) generate_exception(EXCEPTION_OVERFLOW, 1); else if (RDREG) RDVAL64 = RSVAL64 + RTVAL64; @@ -2688,23 +2688,23 @@ void mips3_device::handle_special(UINT32 op) else if (RDREG) RDVAL64 = RSVAL64 - RTVAL64; break; case 0x2f: /* DSUBU */ if (RDREG) RDVAL64 = RSVAL64 - RTVAL64; break; - case 0x30: /* TGE */ if ((INT64)RSVAL64 >= (INT64)RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x30: /* TGE */ if ((int64_t)RSVAL64 >= (int64_t)RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; case 0x31: /* TGEU */ if (RSVAL64 >= RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; - case 0x32: /* TLT */ if ((INT64)RSVAL64 < (INT64)RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; + case 0x32: /* TLT */ if ((int64_t)RSVAL64 < (int64_t)RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; case 0x33: /* TLTU */ if (RSVAL64 < RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; case 0x34: /* TEQ */ if (RSVAL64 == RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; case 0x36: /* TNE */ if (RSVAL64 != RTVAL64) generate_exception(EXCEPTION_TRAP, 1); break; case 0x38: /* DSLL */ if (RDREG) RDVAL64 = RTVAL64 << SHIFT; break; case 0x3a: /* DSRL */ if (RDREG) RDVAL64 = RTVAL64 >> SHIFT; break; - case 0x3b: /* DSRA */ if (RDREG) RDVAL64 = (INT64)RTVAL64 >> SHIFT; break; + case 0x3b: /* DSRA */ if (RDREG) RDVAL64 = (int64_t)RTVAL64 >> SHIFT; break; case 0x3c: /* DSLL32 */ if (RDREG) RDVAL64 = RTVAL64 << (SHIFT + 32); break; case 0x3e: /* DSRL32 */ if (RDREG) RDVAL64 = RTVAL64 >> (SHIFT + 32); break; - case 0x3f: /* DSRA32 */ if (RDREG) RDVAL64 = (INT64)RTVAL64 >> (SHIFT + 32); break; + case 0x3f: /* DSRA32 */ if (RDREG) RDVAL64 = (int64_t)RTVAL64 >> (SHIFT + 32); break; default: /* ??? */ invalid_instruction(op); break; } } -void mips3_device::burn_cycles(INT32 cycles) +void mips3_device::burn_cycles(int32_t cycles) { execute_burn(cycles); } @@ -2758,9 +2758,9 @@ void mips3_device::execute_run() /* core execution loop */ do { - UINT32 op; - UINT64 temp64 = 0; - UINT32 temp; + uint32_t op; + uint64_t temp64 = 0; + uint32_t temp; /* debugging */ m_ppc = m_core->pc; @@ -2802,19 +2802,19 @@ void mips3_device::execute_run() case 0x03: /* JAL */ ABSPCL(LIMMVAL,31); break; case 0x04: /* BEQ */ if (RSVAL64 == RTVAL64) ADDPC(SIMMVAL); break; case 0x05: /* BNE */ if (RSVAL64 != RTVAL64) ADDPC(SIMMVAL); break; - case 0x06: /* BLEZ */ if ((INT64)RSVAL64 <= 0) ADDPC(SIMMVAL); break; - case 0x07: /* BGTZ */ if ((INT64)RSVAL64 > 0) ADDPC(SIMMVAL); break; + case 0x06: /* BLEZ */ if ((int64_t)RSVAL64 <= 0) ADDPC(SIMMVAL); break; + case 0x07: /* BGTZ */ if ((int64_t)RSVAL64 > 0) ADDPC(SIMMVAL); break; case 0x08: /* ADDI */ if (ENABLE_OVERFLOWS && RSVAL32 > ~SIMMVAL) generate_exception(EXCEPTION_OVERFLOW, 1); - else if (RTREG) RTVAL64 = (INT32)(RSVAL32 + SIMMVAL); + else if (RTREG) RTVAL64 = (int32_t)(RSVAL32 + SIMMVAL); break; - case 0x09: /* ADDIU */ if (RTREG) RTVAL64 = (INT32)(RSVAL32 + SIMMVAL); break; - case 0x0a: /* SLTI */ if (RTREG) RTVAL64 = (INT64)RSVAL64 < (INT64)SIMMVAL; break; - case 0x0b: /* SLTIU */ if (RTREG) RTVAL64 = (UINT64)RSVAL64 < (UINT64)SIMMVAL; break; + case 0x09: /* ADDIU */ if (RTREG) RTVAL64 = (int32_t)(RSVAL32 + SIMMVAL); break; + case 0x0a: /* SLTI */ if (RTREG) RTVAL64 = (int64_t)RSVAL64 < (int64_t)SIMMVAL; break; + case 0x0b: /* SLTIU */ if (RTREG) RTVAL64 = (uint64_t)RSVAL64 < (uint64_t)SIMMVAL; break; case 0x0c: /* ANDI */ if (RTREG) RTVAL64 = RSVAL64 & UIMMVAL; break; case 0x0d: /* ORI */ if (RTREG) RTVAL64 = RSVAL64 | UIMMVAL; break; case 0x0e: /* XORI */ if (RTREG) RTVAL64 = RSVAL64 ^ UIMMVAL; break; - case 0x0f: /* LUI */ if (RTREG) RTVAL64 = (INT32)(UIMMVAL << 16); break; + case 0x0f: /* LUI */ if (RTREG) RTVAL64 = (int32_t)(UIMMVAL << 16); break; case 0x10: /* COP0 */ handle_cop0(op); break; case 0x11: /* COP1 */ if (IS_FR0) @@ -2831,33 +2831,33 @@ void mips3_device::execute_run() break; case 0x14: /* BEQL */ if (RSVAL64 == RTVAL64) ADDPC(SIMMVAL); else m_core->pc += 4; break; case 0x15: /* BNEL */ if (RSVAL64 != RTVAL64) ADDPC(SIMMVAL); else m_core->pc += 4; break; - case 0x16: /* BLEZL */ if ((INT64)RSVAL64 <= 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; - case 0x17: /* BGTZL */ if ((INT64)RSVAL64 > 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; + case 0x16: /* BLEZL */ if ((int64_t)RSVAL64 <= 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; + case 0x17: /* BGTZL */ if ((int64_t)RSVAL64 > 0) ADDPC(SIMMVAL); else m_core->pc += 4; break; case 0x18: /* DADDI */ - if (ENABLE_OVERFLOWS && (INT64)RSVAL64 > ~SIMMVAL) generate_exception(EXCEPTION_OVERFLOW, 1); - else if (RTREG) RTVAL64 = RSVAL64 + (INT64)SIMMVAL; + if (ENABLE_OVERFLOWS && (int64_t)RSVAL64 > ~SIMMVAL) generate_exception(EXCEPTION_OVERFLOW, 1); + else if (RTREG) RTVAL64 = RSVAL64 + (int64_t)SIMMVAL; break; - case 0x19: /* DADDIU */ if (RTREG) RTVAL64 = RSVAL64 + (UINT64)SIMMVAL; break; + case 0x19: /* DADDIU */ if (RTREG) RTVAL64 = RSVAL64 + (uint64_t)SIMMVAL; break; case 0x1a: /* LDL */ (this->*m_ldl)(op); break; case 0x1b: /* LDR */ (this->*m_ldr)(op); break; case 0x1c: /* IDT-specific opcodes: mad/madu/mul on R4640/4650, msub on RC32364 */ switch (op & 0x1f) { case 2: /* MUL */ - RDVAL64 = (INT32)((INT32)RSVAL32 * (INT32)RTVAL32); + RDVAL64 = (int32_t)((int32_t)RSVAL32 * (int32_t)RTVAL32); m_core->icount -= 3; break; default: invalid_instruction(op); } break; - case 0x20: /* LB */ if (RBYTE(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (INT8)temp; break; - case 0x21: /* LH */ if (RHALF(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (INT16)temp; break; + case 0x20: /* LB */ if (RBYTE(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (int8_t)temp; break; + case 0x21: /* LH */ if (RHALF(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (int16_t)temp; break; case 0x22: /* LWL */ (this->*m_lwl)(op); break; - case 0x23: /* LW */ if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (INT32)temp; break; - case 0x24: /* LBU */ if (RBYTE(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT8)temp; break; - case 0x25: /* LHU */ if (RHALF(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT16)temp; break; + case 0x23: /* LW */ if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (int32_t)temp; break; + case 0x24: /* LBU */ if (RBYTE(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (uint8_t)temp; break; + case 0x25: /* LHU */ if (RHALF(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (uint16_t)temp; break; case 0x26: /* LWR */ (this->*m_lwr)(op); break; - case 0x27: /* LWU */ if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT32)temp; break; + case 0x27: /* LWU */ if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (uint32_t)temp; break; case 0x28: /* SB */ WBYTE(SIMMVAL+RSVAL32, RTVAL32); break; case 0x29: /* SH */ WHALF(SIMMVAL+RSVAL32, RTVAL32); break; case 0x2a: /* SWL */ (this->*m_swl)(op); break; @@ -2866,7 +2866,7 @@ void mips3_device::execute_run() case 0x2d: /* SDR */ (this->*m_sdr)(op); break; case 0x2e: /* SWR */ (this->*m_swr)(op); break; case 0x2f: /* CACHE */ /* effective no-op */ break; - case 0x30: /* LL */ if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (UINT32)temp; m_ll_value = RTVAL32; break; + case 0x30: /* LL */ if (RWORD(SIMMVAL+RSVAL32, &temp) && RTREG) RTVAL64 = (uint32_t)temp; m_ll_value = RTVAL32; break; case 0x31: /* LWC1 */ if (!(SR & SR_COP1)) { @@ -2897,11 +2897,11 @@ void mips3_device::execute_run() if (temp == m_ll_value) { WWORD(SIMMVAL+RSVAL32, RTVAL32); - RTVAL64 = (UINT32)1; + RTVAL64 = (uint32_t)1; } else { - RTVAL64 = (UINT32)0; + RTVAL64 = (uint32_t)0; } } break; @@ -2958,156 +2958,156 @@ void mips3_device::execute_run() COMPLEX OPCODE IMPLEMENTATIONS ***************************************************************************/ -void mips3_device::lwl_be(UINT32 op) +void mips3_device::lwl_be(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (offs & 3); - UINT32 mask = 0xffffffffUL << shift; - UINT32 temp; + uint32_t mask = 0xffffffffUL << shift; + uint32_t temp; if (RWORD_MASKED(offs & ~3, &temp, mask >> shift) && RTREG) - RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp << shift)); + RTVAL64 = (int32_t)((RTVAL32 & ~mask) | (temp << shift)); } -void mips3_device::lwr_be(UINT32 op) +void mips3_device::lwr_be(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (~offs & 3); - UINT32 mask = 0xffffffffUL >> shift; - UINT32 temp; + uint32_t mask = 0xffffffffUL >> shift; + uint32_t temp; if (RWORD_MASKED(offs & ~3, &temp, mask << shift) && RTREG) - RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp >> shift)); + RTVAL64 = (int32_t)((RTVAL32 & ~mask) | (temp >> shift)); } -void mips3_device::ldl_be(UINT32 op) +void mips3_device::ldl_be(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (offs & 7); - UINT64 mask = U64(0xffffffffffffffff) << shift; - UINT64 temp; + uint64_t mask = U64(0xffffffffffffffff) << shift; + uint64_t temp; if (RDOUBLE_MASKED(offs & ~7, &temp, mask >> shift) && RTREG) RTVAL64 = (RTVAL64 & ~mask) | (temp << shift); } -void mips3_device::ldr_be(UINT32 op) +void mips3_device::ldr_be(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (~offs & 7); - UINT64 mask = U64(0xffffffffffffffff) >> shift; - UINT64 temp; + uint64_t mask = U64(0xffffffffffffffff) >> shift; + uint64_t temp; if (RDOUBLE_MASKED(offs & ~7, &temp, mask << shift) && RTREG) RTVAL64 = (RTVAL64 & ~mask) | (temp >> shift); } -void mips3_device::swl_be(UINT32 op) +void mips3_device::swl_be(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (offs & 3); - UINT32 mask = 0xffffffffUL >> shift; + uint32_t mask = 0xffffffffUL >> shift; WWORD_MASKED(offs & ~3, RTVAL32 >> shift, mask); } -void mips3_device::swr_be(UINT32 op) +void mips3_device::swr_be(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (~offs & 3); - UINT32 mask = 0xffffffffUL << shift; + uint32_t mask = 0xffffffffUL << shift; WWORD_MASKED(offs & ~3, RTVAL32 << shift, mask); } -void mips3_device::sdl_be(UINT32 op) +void mips3_device::sdl_be(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (offs & 7); - UINT64 mask = U64(0xffffffffffffffff) >> shift; + uint64_t mask = U64(0xffffffffffffffff) >> shift; WDOUBLE_MASKED(offs & ~7, RTVAL64 >> shift, mask); } -void mips3_device::sdr_be(UINT32 op) +void mips3_device::sdr_be(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (~offs & 7); - UINT64 mask = U64(0xffffffffffffffff) << shift; + uint64_t mask = U64(0xffffffffffffffff) << shift; WDOUBLE_MASKED(offs & ~7, RTVAL64 << shift, mask); } -void mips3_device::lwl_le(UINT32 op) +void mips3_device::lwl_le(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (~offs & 3); - UINT32 mask = 0xffffffffUL << shift; - UINT32 temp; + uint32_t mask = 0xffffffffUL << shift; + uint32_t temp; if (RWORD_MASKED(offs & ~3, &temp, mask >> shift) && RTREG) - RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp << shift)); + RTVAL64 = (int32_t)((RTVAL32 & ~mask) | (temp << shift)); } -void mips3_device::lwr_le(UINT32 op) +void mips3_device::lwr_le(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (offs & 3); - UINT32 mask = 0xffffffffUL >> shift; - UINT32 temp; + uint32_t mask = 0xffffffffUL >> shift; + uint32_t temp; if (RWORD_MASKED(offs & ~3, &temp, mask << shift) && RTREG) - RTVAL64 = (INT32)((RTVAL32 & ~mask) | (temp >> shift)); + RTVAL64 = (int32_t)((RTVAL32 & ~mask) | (temp >> shift)); } -void mips3_device::ldl_le(UINT32 op) +void mips3_device::ldl_le(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (~offs & 7); - UINT64 mask = U64(0xffffffffffffffff) << shift; - UINT64 temp; + uint64_t mask = U64(0xffffffffffffffff) << shift; + uint64_t temp; if (RDOUBLE_MASKED(offs & ~7, &temp, mask >> shift) && RTREG) RTVAL64 = (RTVAL64 & ~mask) | (temp << shift); } -void mips3_device::ldr_le(UINT32 op) +void mips3_device::ldr_le(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (offs & 7); - UINT64 mask = U64(0xffffffffffffffff) >> shift; - UINT64 temp; + uint64_t mask = U64(0xffffffffffffffff) >> shift; + uint64_t temp; if (RDOUBLE_MASKED(offs & ~7, &temp, mask << shift) && RTREG) RTVAL64 = (RTVAL64 & ~mask) | (temp >> shift); } -void mips3_device::swl_le(UINT32 op) +void mips3_device::swl_le(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (~offs & 3); - UINT32 mask = 0xffffffffUL >> shift; + uint32_t mask = 0xffffffffUL >> shift; WWORD_MASKED(offs & ~3, RTVAL32 >> shift, mask); } -void mips3_device::swr_le(UINT32 op) +void mips3_device::swr_le(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (offs & 3); - UINT32 mask = 0xffffffffUL << shift; + uint32_t mask = 0xffffffffUL << shift; WWORD_MASKED(offs & ~3, RTVAL32 << shift, mask); } -void mips3_device::sdl_le(UINT32 op) +void mips3_device::sdl_le(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (~offs & 7); - UINT64 mask = U64(0xffffffffffffffff) >> shift; + uint64_t mask = U64(0xffffffffffffffff) >> shift; WDOUBLE_MASKED(offs & ~7, RTVAL64 >> shift, mask); } -void mips3_device::sdr_le(UINT32 op) +void mips3_device::sdr_le(uint32_t op) { offs_t offs = SIMMVAL + RSVAL32; int shift = 8 * (offs & 7); - UINT64 mask = U64(0xffffffffffffffff) << shift; + uint64_t mask = U64(0xffffffffffffffff) << shift; WDOUBLE_MASKED(offs & ~7, RTVAL64 << shift, mask); } diff --git a/src/devices/cpu/mips/mips3.h b/src/devices/cpu/mips/mips3.h index fff9044f472..247b21bd993 100644 --- a/src/devices/cpu/mips/mips3.h +++ b/src/devices/cpu/mips/mips3.h @@ -217,17 +217,17 @@ enum /* MIPS3 TLB entry */ struct mips3_tlb_entry { - UINT64 page_mask; - UINT64 entry_hi; - UINT64 entry_lo[2]; + uint64_t page_mask; + uint64_t entry_hi; + uint64_t entry_lo[2]; }; /* internal compiler state */ struct compiler_state { - UINT32 cycles; /* accumulated cycles */ - UINT8 checkints; /* need to check interrupts before next instruction */ - UINT8 checksoftints; /* need to check software interrupts before next instruction */ + uint32_t cycles; /* accumulated cycles */ + uint8_t checkints; /* need to check interrupts before next instruction */ + uint8_t checksoftints; /* need to check software interrupts before next instruction */ uml::code_label labelnum; /* index for local labels */ }; @@ -269,19 +269,19 @@ protected: public: // construction/destruction - mips3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, mips3_flavor flavor, endianness_t endiannes); + mips3_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, mips3_flavor flavor, endianness_t endiannes); static void set_icache_size(device_t &device, size_t icache_size) { downcast(device).c_icache_size = icache_size; } static void set_dcache_size(device_t &device, size_t dcache_size) { downcast(device).c_dcache_size = dcache_size; } - static void set_system_clock(device_t &device, UINT32 system_clock) { downcast(device).c_system_clock = system_clock; } + static void set_system_clock(device_t &device, uint32_t system_clock) { downcast(device).c_system_clock = system_clock; } TIMER_CALLBACK_MEMBER(compare_int_callback); - void add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base); - void clear_fastram(UINT32 select_start); - void mips3drc_set_options(UINT32 options); - void mips3drc_add_hotspot(offs_t pc, UINT32 opcode, UINT32 cycles); - void burn_cycles(INT32 cycles); + void add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base); + void clear_fastram(uint32_t select_start); + void mips3drc_set_options(uint32_t options); + void mips3drc_add_hotspot(offs_t pc, uint32_t opcode, uint32_t cycles); + void burn_cycles(int32_t cycles); protected: // device-level overrides @@ -290,12 +290,12 @@ protected: virtual void device_stop() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 40; } - virtual UINT32 execute_input_lines() const override { return 6; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 40; } + virtual uint32_t execute_input_lines() const override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - virtual void execute_burn(INT32 cycles) override { m_totalcycles += cycles; } + virtual void execute_burn(int32_t cycles) override { m_totalcycles += cycles; } // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : nullptr; } @@ -306,35 +306,35 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: struct internal_mips3_state { /* core registers */ - UINT32 pc; + uint32_t pc; int icount; - UINT64 r[35]; + uint64_t r[35]; /* COP registers */ - UINT64 cpr[3][32]; - UINT64 ccr[3][32]; - UINT32 llbit; + uint64_t cpr[3][32]; + uint64_t ccr[3][32]; + uint32_t llbit; - UINT32 mode; /* current global mode */ + uint32_t mode; /* current global mode */ /* parameters for subroutines */ - UINT64 numcycles; /* return value from gettotalcycles */ + uint64_t numcycles; /* return value from gettotalcycles */ const char * format; /* format string for print_debug */ - UINT32 arg0; /* print_debug argument 1 */ - UINT32 arg1; /* print_debug argument 2 */ + uint32_t arg0; /* print_debug argument 1 */ + uint32_t arg1; /* print_debug argument 2 */ - UINT64 count_zero_time; - UINT32 compare_armed; - UINT32 jmpdest; /* destination jump target */ + uint64_t count_zero_time; + uint32_t compare_armed; + uint32_t jmpdest; /* destination jump target */ }; @@ -345,19 +345,19 @@ private: internal_mips3_state *m_core; /* internal stuff */ - UINT32 m_ppc; - UINT32 m_nextpc; - UINT32 m_pcbase; - UINT8 m_cf[4][8]; + uint32_t m_ppc; + uint32_t m_nextpc; + uint32_t m_pcbase; + uint8_t m_cf[4][8]; bool m_delayslot; int m_op; int m_interrupt_cycles; - UINT32 m_ll_value; - UINT64 m_lld_value; - UINT32 m_badcop_value; + uint32_t m_ll_value; + uint64_t m_lld_value; + uint32_t m_badcop_value; /* endian-dependent load/store */ - typedef void (mips3_device::*loadstore_func)(UINT32 op); + typedef void (mips3_device::*loadstore_func)(uint32_t op); loadstore_func m_lwl; loadstore_func m_lwr; loadstore_func m_swl; @@ -369,18 +369,18 @@ private: address_space *m_program; direct_read_data *m_direct; - UINT32 c_system_clock; - UINT32 m_cpu_clock; + uint32_t c_system_clock; + uint32_t m_cpu_clock; emu_timer * m_compare_int_timer; /* derived info based on flavor */ - UINT32 m_pfnmask; - UINT8 m_tlbentries; + uint32_t m_pfnmask; + uint8_t m_tlbentries; /* memory accesses */ bool m_bigendian; - UINT32 m_byte_xor; - UINT32 m_word_xor; + uint32_t m_byte_xor; + uint32_t m_word_xor; data_accessors m_memory; /* cache memory */ @@ -391,31 +391,31 @@ private: mips3_tlb_entry m_tlb[MIPS3_MAX_TLB_ENTRIES]; /* fast RAM */ - UINT32 m_fastram_select; + uint32_t m_fastram_select; struct { offs_t start; /* start of the RAM block */ offs_t end; /* end of the RAM block */ - UINT8 readonly; /* TRUE if read-only */ + uint8_t readonly; /* TRUE if read-only */ void * base; /* base in memory where the RAM lives */ - UINT8 * offset_base8; /* base in memory where the RAM lives, 8-bit pointer, with the start offset pre-applied */ - UINT16 * offset_base16; /* base in memory where the RAM lives, 16-bit pointer, with the start offset pre-applied */ - UINT32 * offset_base32; /* base in memory where the RAM lives, 32-bit pointer, with the start offset pre-applied */ + uint8_t * offset_base8; /* base in memory where the RAM lives, 8-bit pointer, with the start offset pre-applied */ + uint16_t * offset_base16; /* base in memory where the RAM lives, 16-bit pointer, with the start offset pre-applied */ + uint32_t * offset_base32; /* base in memory where the RAM lives, 32-bit pointer, with the start offset pre-applied */ } m_fastram[MIPS3_MAX_FASTRAM]; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; /* core state */ drc_cache m_cache; /* pointer to the DRC code cache */ std::unique_ptr m_drcuml; /* DRC UML generator state */ std::unique_ptr m_drcfe; /* pointer to the DRC front-end state */ - UINT32 m_drcoptions; /* configurable DRC options */ + uint32_t m_drcoptions; /* configurable DRC options */ /* internal stuff */ - UINT8 m_cache_dirty; /* true if we need to flush the cache */ + uint8_t m_cache_dirty; /* true if we need to flush the cache */ /* tables */ - UINT8 m_fpmode[4]; /* FPU mode table */ + uint8_t m_fpmode[4]; /* FPU mode table */ /* register mappings */ uml::parameter m_regmap[34]; /* parameter to register mappings for all 32 integer registers */ @@ -442,19 +442,19 @@ private: uml::code_handle * m_exception_norecover[18/*EXCEPTION_COUNT*/]; /* array of no-recover exception handlers */ /* hotspots */ - UINT32 m_hotspot_select; + uint32_t m_hotspot_select; struct { offs_t pc; /* PC to consider */ - UINT32 opcode; /* required opcode at that PC */ - UINT32 cycles; /* number of cycles to eat when hit */ + uint32_t opcode; /* required opcode at that PC */ + uint32_t cycles; /* number of cycles to eat when hit */ } m_hotspot[MIPS3_MAX_HOTSPOTS]; bool m_isdrc; void generate_exception(int exception, int backup); void generate_tlb_exception(int exception, offs_t address); - void invalid_instruction(UINT32 op); + void invalid_instruction(uint32_t op); void check_irqs(); public: void mips3com_update_cycle_counting(); @@ -464,71 +464,71 @@ public: void mips3com_tlbwr(); void mips3com_tlbp(); private: - UINT32 compute_config_register(); - UINT32 compute_prid_register(); + uint32_t compute_config_register(); + uint32_t compute_prid_register(); void tlb_map_entry(int tlbindex); void tlb_write_common(int tlbindex); - bool RBYTE(offs_t address, UINT32 *result); - bool RHALF(offs_t address, UINT32 *result); - bool RWORD(offs_t address, UINT32 *result); - bool RWORD_MASKED(offs_t address, UINT32 *result, UINT32 mem_mask); - bool RDOUBLE(offs_t address, UINT64 *result); - bool RDOUBLE_MASKED(offs_t address, UINT64 *result, UINT64 mem_mask); - void WBYTE(offs_t address, UINT8 data); - void WHALF(offs_t address, UINT16 data); - void WWORD(offs_t address, UINT32 data); - void WWORD_MASKED(offs_t address, UINT32 data, UINT32 mem_mask); - void WDOUBLE(offs_t address, UINT64 data); - void WDOUBLE_MASKED(offs_t address, UINT64 data, UINT64 mem_mask); - - UINT64 get_cop0_reg(int idx); - void set_cop0_reg(int idx, UINT64 val); - UINT64 get_cop0_creg(int idx); - void set_cop0_creg(int idx, UINT64 val); - void handle_cop0(UINT32 op); - - UINT32 get_cop1_reg32(int idx); - UINT64 get_cop1_reg64(int idx); - void set_cop1_reg32(int idx, UINT32 val); - void set_cop1_reg64(int idx, UINT64 val); - UINT64 get_cop1_creg(int idx); - void set_cop1_creg(int idx, UINT64 val); - void handle_cop1_fr0(UINT32 op); - void handle_cop1_fr1(UINT32 op); - void handle_cop1x_fr0(UINT32 op); - void handle_cop1x_fr1(UINT32 op); - - UINT64 get_cop2_reg(int idx); - void set_cop2_reg(int idx, UINT64 val); - UINT64 get_cop2_creg(int idx); - void set_cop2_creg(int idx, UINT64 val); - void handle_cop2(UINT32 op); - - void handle_special(UINT32 op); - void handle_regimm(UINT32 op); - - void lwl_be(UINT32 op); - void lwr_be(UINT32 op); - void ldl_be(UINT32 op); - void ldr_be(UINT32 op); - void swl_be(UINT32 op); - void swr_be(UINT32 op); - void sdl_be(UINT32 op); - void sdr_be(UINT32 op); - void lwl_le(UINT32 op); - void lwr_le(UINT32 op); - void ldl_le(UINT32 op); - void ldr_le(UINT32 op); - void swl_le(UINT32 op); - void swr_le(UINT32 op); - void sdl_le(UINT32 op); - void sdr_le(UINT32 op); + bool RBYTE(offs_t address, uint32_t *result); + bool RHALF(offs_t address, uint32_t *result); + bool RWORD(offs_t address, uint32_t *result); + bool RWORD_MASKED(offs_t address, uint32_t *result, uint32_t mem_mask); + bool RDOUBLE(offs_t address, uint64_t *result); + bool RDOUBLE_MASKED(offs_t address, uint64_t *result, uint64_t mem_mask); + void WBYTE(offs_t address, uint8_t data); + void WHALF(offs_t address, uint16_t data); + void WWORD(offs_t address, uint32_t data); + void WWORD_MASKED(offs_t address, uint32_t data, uint32_t mem_mask); + void WDOUBLE(offs_t address, uint64_t data); + void WDOUBLE_MASKED(offs_t address, uint64_t data, uint64_t mem_mask); + + uint64_t get_cop0_reg(int idx); + void set_cop0_reg(int idx, uint64_t val); + uint64_t get_cop0_creg(int idx); + void set_cop0_creg(int idx, uint64_t val); + void handle_cop0(uint32_t op); + + uint32_t get_cop1_reg32(int idx); + uint64_t get_cop1_reg64(int idx); + void set_cop1_reg32(int idx, uint32_t val); + void set_cop1_reg64(int idx, uint64_t val); + uint64_t get_cop1_creg(int idx); + void set_cop1_creg(int idx, uint64_t val); + void handle_cop1_fr0(uint32_t op); + void handle_cop1_fr1(uint32_t op); + void handle_cop1x_fr0(uint32_t op); + void handle_cop1x_fr1(uint32_t op); + + uint64_t get_cop2_reg(int idx); + void set_cop2_reg(int idx, uint64_t val); + uint64_t get_cop2_creg(int idx); + void set_cop2_creg(int idx, uint64_t val); + void handle_cop2(uint32_t op); + + void handle_special(uint32_t op); + void handle_regimm(uint32_t op); + + void lwl_be(uint32_t op); + void lwr_be(uint32_t op); + void ldl_be(uint32_t op); + void ldr_be(uint32_t op); + void swl_be(uint32_t op); + void swr_be(uint32_t op); + void sdl_be(uint32_t op); + void sdr_be(uint32_t op); + void lwl_le(uint32_t op); + void lwr_le(uint32_t op); + void ldl_le(uint32_t op); + void ldr_le(uint32_t op); + void swl_le(uint32_t op); + void swr_le(uint32_t op); + void sdl_le(uint32_t op); + void sdr_le(uint32_t op); void load_fast_iregs(drcuml_block *block); void save_fast_iregs(drcuml_block *block); void code_flush_cache(); - void code_compile_block(UINT8 mode, offs_t pc); + void code_compile_block(uint8_t mode, offs_t pc); public: void func_get_cycles(); void func_printf_exception(); @@ -540,29 +540,29 @@ private: void static_generate_nocode_handler(); void static_generate_out_of_cycles(); void static_generate_tlb_mismatch(); - void static_generate_exception(UINT8 exception, int recover, const char *name); + void static_generate_exception(uint8_t exception, int recover, const char *name); void static_generate_memory_accessor(int mode, int size, int iswrite, int ismasked, const char *name, uml::code_handle **handleptr); void generate_update_mode(drcuml_block *block); void generate_update_cycles(drcuml_block *block, compiler_state *compiler, uml::parameter param, int allow_exception); void generate_checksum_block(drcuml_block *block, compiler_state *compiler, const opcode_desc *seqhead, const opcode_desc *seqlast); void generate_sequence_instruction(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); - void generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 linkreg); + void generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t linkreg); int generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_special(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_regimm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_idt(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); - int generate_set_cop0_reg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 reg); - int generate_get_cop0_reg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 reg); + int generate_set_cop0_reg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t reg); + int generate_get_cop0_reg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t reg); int generate_cop0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_cop1_fr0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_cop1_fr1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); - void generate_get_cop1_reg64(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const UINT32 reg, const uml::parameter& param); - void generate_get_cop1_reg64_d2i(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const UINT32 reg, const uml::parameter& param); - void generate_set_cop1_reg64(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const UINT32 reg, const uml::parameter& param); - void generate_set_cop1_reg64_i2d(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const UINT32 reg, const uml::parameter& param); + void generate_get_cop1_reg64(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const uint32_t reg, const uml::parameter& param); + void generate_get_cop1_reg64_d2i(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const uint32_t reg, const uml::parameter& param); + void generate_set_cop1_reg64(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const uint32_t reg, const uml::parameter& param); + void generate_set_cop1_reg64_i2d(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const uint32_t reg, const uml::parameter& param); int generate_cop1x_fr0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_cop1x_fr1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); @@ -570,9 +570,9 @@ private: void check_cop1_access(drcuml_block *block); void generate_badcop(drcuml_block *block, const int cop); - void log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 op); - const char *log_desc_flags_to_string(UINT32 flags); - void log_register_list(drcuml_state *drcuml, const char *string, const UINT32 *reglist, const UINT32 *regnostarlist); + void log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint32_t op); + const char *log_desc_flags_to_string(uint32_t flags); + void log_register_list(drcuml_state *drcuml, const char *string, const uint32_t *reglist, const uint32_t *regnostarlist); void log_opcode_desc(drcuml_state *drcuml, const opcode_desc *desclist, int indent); }; @@ -582,7 +582,7 @@ class vr4300be_device : public mips3_device { public: // construction/destruction - vr4300be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + vr4300be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, VR4300BE, "VR4300 (big)", tag, owner, clock, "vr4300be", MIPS3_TYPE_VR4300, ENDIANNESS_BIG) { } }; @@ -591,7 +591,7 @@ class vr4300le_device : public mips3_device { public: // construction/destruction - vr4300le_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + vr4300le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, VR4300LE, "VR4300 (little)", tag, owner, clock, "vr4300le", MIPS3_TYPE_VR4300, ENDIANNESS_LITTLE) { } }; @@ -600,7 +600,7 @@ class vr4310be_device : public mips3_device { public: // construction/destruction - vr4310be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + vr4310be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, VR4310BE, "VR4310 (big)", tag, owner, clock, "vr4310be", MIPS3_TYPE_VR4300, ENDIANNESS_BIG) { } }; @@ -609,7 +609,7 @@ class vr4310le_device : public mips3_device { public: // construction/destruction - vr4310le_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + vr4310le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, VR4310LE, "VR4310 (little)", tag, owner, clock, "vr4310le", MIPS3_TYPE_VR4300, ENDIANNESS_LITTLE) { } }; @@ -618,7 +618,7 @@ class r4600be_device : public mips3_device { public: // construction/destruction - r4600be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + r4600be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, R4600BE, "R4600 (big)", tag, owner, clock, "r4600be", MIPS3_TYPE_R4600, ENDIANNESS_BIG) { } }; @@ -627,7 +627,7 @@ class r4600le_device : public mips3_device { public: // construction/destruction - r4600le_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + r4600le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, R4600LE, "R4600 (little)", tag, owner, clock, "r4600le", MIPS3_TYPE_R4600, ENDIANNESS_LITTLE) { } }; @@ -636,7 +636,7 @@ class r4650be_device : public mips3_device { public: // construction/destruction - r4650be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + r4650be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, R4650BE, "IDT R4650 (big)", tag, owner, clock, "r4650be", MIPS3_TYPE_R4650, ENDIANNESS_BIG) { } }; @@ -645,7 +645,7 @@ class r4650le_device : public mips3_device { public: // construction/destruction - r4650le_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + r4650le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, R4650LE, "IDT R4650 (little)", tag, owner, clock, "r4650le", MIPS3_TYPE_R4650, ENDIANNESS_LITTLE) { } }; @@ -654,7 +654,7 @@ class r4700be_device : public mips3_device { public: // construction/destruction - r4700be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + r4700be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, R4700BE, "R4700 (big)", tag, owner, clock, "r4700be", MIPS3_TYPE_R4700, ENDIANNESS_BIG) { } }; @@ -663,7 +663,7 @@ class r4700le_device : public mips3_device { public: // construction/destruction - r4700le_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + r4700le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, R4700LE, "R4700 (little)", tag, owner, clock, "r4700le", MIPS3_TYPE_R4700, ENDIANNESS_LITTLE) { } }; @@ -672,7 +672,7 @@ class r5000be_device : public mips3_device { public: // construction/destruction - r5000be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + r5000be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, R5000BE, "R5000 (big)", tag, owner, clock, "r5000be", MIPS3_TYPE_R5000, ENDIANNESS_BIG) { } }; @@ -681,7 +681,7 @@ class r5000le_device : public mips3_device { public: // construction/destruction - r5000le_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + r5000le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, R5000LE, "R5000 (little)", tag, owner, clock, "r5000le", MIPS3_TYPE_R5000, ENDIANNESS_LITTLE) { } }; @@ -690,7 +690,7 @@ class qed5271be_device : public mips3_device { public: // construction/destruction - qed5271be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + qed5271be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, QED5271BE, "QED5271 (big)", tag, owner, clock, "qed5271be", MIPS3_TYPE_QED5271, ENDIANNESS_BIG) { } }; @@ -699,7 +699,7 @@ class qed5271le_device : public mips3_device { public: // construction/destruction - qed5271le_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + qed5271le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, QED5271LE, "QED5271 (little)", tag, owner, clock, "qed5271le", MIPS3_TYPE_QED5271, ENDIANNESS_LITTLE) { } }; @@ -708,7 +708,7 @@ class rm7000be_device : public mips3_device { public: // construction/destruction - rm7000be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + rm7000be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, RM7000BE, "RM7000 (big)", tag, owner, clock, "rm7000be", MIPS3_TYPE_RM7000, ENDIANNESS_BIG) { } }; @@ -717,7 +717,7 @@ class rm7000le_device : public mips3_device { public: // construction/destruction - rm7000le_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + rm7000le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mips3_device(mconfig, RM7000LE, "RM7000 (little)", tag, owner, clock, "rm7000le", MIPS3_TYPE_RM7000, ENDIANNESS_LITTLE) { } }; @@ -728,7 +728,7 @@ class mips3_frontend : public drc_frontend { public: // construction/destruction - mips3_frontend(mips3_device *mips3, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); + mips3_frontend(mips3_device *mips3, uint32_t window_start, uint32_t window_end, uint32_t max_sequence); protected: // required overrides @@ -736,13 +736,13 @@ protected: private: // internal helpers - bool describe_special(UINT32 op, opcode_desc &desc); - bool describe_regimm(UINT32 op, opcode_desc &desc); - bool describe_idt(UINT32 op, opcode_desc &desc); - bool describe_cop0(UINT32 op, opcode_desc &desc); - bool describe_cop1(UINT32 op, opcode_desc &desc); - bool describe_cop1x(UINT32 op, opcode_desc &desc); - bool describe_cop2(UINT32 op, opcode_desc &desc); + bool describe_special(uint32_t op, opcode_desc &desc); + bool describe_regimm(uint32_t op, opcode_desc &desc); + bool describe_idt(uint32_t op, opcode_desc &desc); + bool describe_cop0(uint32_t op, opcode_desc &desc); + bool describe_cop1(uint32_t op, opcode_desc &desc); + bool describe_cop1x(uint32_t op, opcode_desc &desc); + bool describe_cop2(uint32_t op, opcode_desc &desc); // internal state mips3_device *m_mips3; diff --git a/src/devices/cpu/mips/mips3com.cpp b/src/devices/cpu/mips/mips3com.cpp index 48b9a4ece76..8da695c4833 100644 --- a/src/devices/cpu/mips/mips3com.cpp +++ b/src/devices/cpu/mips/mips3com.cpp @@ -29,7 +29,7 @@ static void tlb_entry_log_half(mips3_tlb_entry *entry, int tlbindex, int which); TLB entry matches the provided ASID -------------------------------------------------*/ -static inline int tlb_entry_matches_asid(const mips3_tlb_entry *entry, UINT8 asid) +static inline int tlb_entry_matches_asid(const mips3_tlb_entry *entry, uint8_t asid) { return (entry->entry_hi & 0xff) == asid; } @@ -72,11 +72,11 @@ void mips3_device::mips3com_update_cycle_counting() /* modify the timer to go off */ if (m_core->compare_armed) { - UINT32 count = (total_cycles() - m_core->count_zero_time) / 2; - UINT32 compare = m_core->cpr[0][COP0_Compare]; - UINT32 delta = compare - count; + uint32_t count = (total_cycles() - m_core->count_zero_time) / 2; + uint32_t compare = m_core->cpr[0][COP0_Compare]; + uint32_t delta = compare - count; m_core->compare_armed = 0; - attotime newtime = cycles_to_attotime((UINT64)delta * 2); + attotime newtime = cycles_to_attotime((uint64_t)delta * 2); m_compare_int_timer->adjust(newtime); return; } @@ -108,7 +108,7 @@ void mips3_device::mips3com_asid_changed() void mips3_device::mips3com_tlbr() { - UINT32 tlbindex = m_core->cpr[0][COP0_Index] & 0x3f; + uint32_t tlbindex = m_core->cpr[0][COP0_Index] & 0x3f; /* only handle entries within the TLB */ if (tlbindex < m_tlbentries) @@ -141,9 +141,9 @@ void mips3_device::mips3com_tlbwi() void mips3_device::mips3com_tlbwr() { - UINT32 wired = m_core->cpr[0][COP0_Wired] & 0x3f; - UINT32 unwired = m_tlbentries - wired; - UINT32 tlbindex = m_tlbentries - 1; + uint32_t wired = m_core->cpr[0][COP0_Wired] & 0x3f; + uint32_t unwired = m_tlbentries - wired; + uint32_t tlbindex = m_tlbentries - 1; /* "random" is based off of the current cycle counting through the non-wired pages */ if (unwired > 0) @@ -160,13 +160,13 @@ void mips3_device::mips3com_tlbwr() void mips3_device::mips3com_tlbp() { - UINT32 tlbindex; + uint32_t tlbindex; /* iterate over TLB entries */ for (tlbindex = 0; tlbindex < m_tlbentries; tlbindex++) { mips3_tlb_entry *entry = &m_tlb[tlbindex]; - UINT64 mask = ~((entry->page_mask >> 13) & 0xfff) << 13; + uint64_t mask = ~((entry->page_mask >> 13) & 0xfff) << 13; /* if the relevant bits of EntryHi match the relevant bits of the TLB */ if ((entry->entry_hi & mask) == (m_core->cpr[0][COP0_EntryHi] & mask)) @@ -207,10 +207,10 @@ TIMER_CALLBACK_MEMBER( mips3_device::compare_int_callback ) of the config register -------------------------------------------------*/ -UINT32 mips3_device::compute_config_register() +uint32_t mips3_device::compute_config_register() { /* set the cache line size to 32 bytes */ - UINT32 configreg = 0x00026030; + uint32_t configreg = 0x00026030; int divisor; // NEC VR series does not use a 100% compatible COP0/TLB implementation @@ -280,7 +280,7 @@ UINT32 mips3_device::compute_config_register() of the PRId register -------------------------------------------------*/ -UINT32 mips3_device::compute_prid_register() +uint32_t mips3_device::compute_prid_register() { switch (m_flavor) { @@ -318,7 +318,7 @@ void mips3_device::tlb_map_entry(int tlbindex) { int current_asid = m_core->cpr[0][COP0_EntryHi] & 0xff; mips3_tlb_entry *entry = &m_tlb[tlbindex]; - UINT32 count, vpn; + uint32_t count, vpn; int which; /* the ASID doesn't match the current ASID, and if the page isn't global, unmap it from the TLB */ @@ -344,10 +344,10 @@ void mips3_device::tlb_map_entry(int tlbindex) /* loop over both the even and odd pages */ for (which = 0; which < 2; which++) { - UINT32 effvpn = vpn + count * which; - UINT64 lo = entry->entry_lo[which]; - UINT32 pfn; - UINT32 flags = 0; + uint32_t effvpn = vpn + count * which; + uint64_t lo = entry->entry_lo[which]; + uint32_t pfn; + uint32_t flags = 0; /* compute physical page index */ pfn = (lo >> 6) & m_pfnmask; @@ -412,21 +412,21 @@ static void tlb_entry_log_half(mips3_tlb_entry *entry, int tlbindex, int which) { if (PRINTF_TLB) { - UINT64 hi = entry->entry_hi; - UINT64 lo = entry->entry_lo[which]; - UINT32 vpn = (((hi >> 13) & 0x07ffffff) << 1); - UINT32 asid = hi & 0xff; - UINT32 r = (hi >> 62) & 3; - UINT32 pfn = (lo >> 6) & 0x00ffffff; - UINT32 c = (lo >> 3) & 7; - UINT32 pagesize = (((entry->page_mask >> 13) & 0xfff) + 1) << MIPS3_MIN_PAGE_SHIFT; - UINT64 vaddr = (UINT64)vpn * MIPS3_MIN_PAGE_SIZE; - UINT64 paddr = (UINT64)pfn * MIPS3_MIN_PAGE_SIZE; + uint64_t hi = entry->entry_hi; + uint64_t lo = entry->entry_lo[which]; + uint32_t vpn = (((hi >> 13) & 0x07ffffff) << 1); + uint32_t asid = hi & 0xff; + uint32_t r = (hi >> 62) & 3; + uint32_t pfn = (lo >> 6) & 0x00ffffff; + uint32_t c = (lo >> 3) & 7; + uint32_t pagesize = (((entry->page_mask >> 13) & 0xfff) + 1) << MIPS3_MIN_PAGE_SHIFT; + uint64_t vaddr = (uint64_t)vpn * MIPS3_MIN_PAGE_SIZE; + uint64_t paddr = (uint64_t)pfn * MIPS3_MIN_PAGE_SIZE; vaddr += pagesize * which; printf("index=%08X pagesize=%08X vaddr=%08X%08X paddr=%08X%08X asid=%02X r=%X c=%X dvg=%c%c%c\n", - tlbindex, pagesize, (UINT32)(vaddr >> 32), (UINT32)vaddr, (UINT32)(paddr >> 32), (UINT32)paddr, + tlbindex, pagesize, (uint32_t)(vaddr >> 32), (uint32_t)vaddr, (uint32_t)(paddr >> 32), (uint32_t)paddr, asid, r, c, (lo & 4) ? 'd' : '.', (lo & 2) ? 'v' : '.', (lo & 1) ? 'g' : '.'); } } diff --git a/src/devices/cpu/mips/mips3com.h b/src/devices/cpu/mips/mips3com.h index 20facae78d0..677289a7763 100644 --- a/src/devices/cpu/mips/mips3com.h +++ b/src/devices/cpu/mips/mips3com.h @@ -59,7 +59,7 @@ -#define LOPTR(x) ((UINT32 *)(x) + NATIVE_ENDIAN_VALUE_LE_BE(0,1)) +#define LOPTR(x) ((uint32_t *)(x) + NATIVE_ENDIAN_VALUE_LE_BE(0,1)) /*************************************************************************** @@ -182,8 +182,8 @@ #define IS_FLOAT(o) (((o) & (1 << 23)) == 0) #define IS_INTEGRAL(o) (((o) & (1 << 23)) != 0) -#define SIMMVAL ((INT16)op) -#define UIMMVAL ((UINT16)op) +#define SIMMVAL ((int16_t)op) +#define UIMMVAL ((uint16_t)op) #define LIMMVAL (op & 0x03ffffff) diff --git a/src/devices/cpu/mips/mips3drc.cpp b/src/devices/cpu/mips/mips3drc.cpp index e3156b53f10..4d1de76e309 100644 --- a/src/devices/cpu/mips/mips3drc.cpp +++ b/src/devices/cpu/mips/mips3drc.cpp @@ -31,7 +31,7 @@ #include "cpu/drcuml.h" #include "cpu/drcumlsh.h" -extern unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op); +extern unsigned dasmmips3(char *buffer, unsigned pc, uint32_t op); using namespace uml; @@ -79,7 +79,7 @@ using namespace uml; #define FDVALD_FR1 mem((double *)&m_core->cpr[1][FDREG]) #define FCCSHIFT(which) fcc_shift[(m_flavor < MIPS3_TYPE_MIPS_IV) ? 0 : ((which) & 7)] -#define FCCMASK(which) ((UINT32)(1 << FCCSHIFT(which))) +#define FCCMASK(which) ((uint32_t)(1 << FCCSHIFT(which))) @@ -97,7 +97,7 @@ static void cfunc_printf_probe(void *param); ***************************************************************************/ /* bit indexes for various FCCs */ -static const UINT8 fcc_shift[8] = { 23, 25, 26, 27, 28, 29, 30, 31 }; +static const uint8_t fcc_shift[8] = { 23, 25, 26, 27, 28, 29, 30, 31 }; /*************************************************************************** @@ -109,7 +109,7 @@ static const UINT8 fcc_shift[8] = { 23, 25, 26, 27, 28, 29, 30, 31 }; descriptor -------------------------------------------------*/ -static inline UINT32 epc(const opcode_desc *desc) +static inline uint32_t epc(const opcode_desc *desc) { return (desc->flags & OPFLAG_IN_DELAY_SLOT) ? (desc->pc - 3) : desc->pc; } @@ -166,7 +166,7 @@ inline void mips3_device::save_fast_iregs(drcuml_block *block) mips3drc_set_options - configure DRC options -------------------------------------------------*/ -void mips3_device::mips3drc_set_options(UINT32 options) +void mips3_device::mips3drc_set_options(uint32_t options) { if (!allow_drc()) return; m_drcoptions = options; @@ -176,7 +176,7 @@ void mips3_device::mips3drc_set_options(UINT32 options) mips3drc_clears_fastram - clears fastram region starting at index select_start -------------------------------------------------*/ -void mips3_device::clear_fastram(UINT32 select_start) +void mips3_device::clear_fastram(uint32_t select_start) { for (int i=select_start; inext()) { const opcode_desc *curdesc; - UINT32 nextpc; + uint32_t nextpc; /* add a code log entry */ if (drcuml->logging()) @@ -463,7 +463,7 @@ static void cfunc_get_cycles(void *param) void mips3_device::func_printf_exception() { - printf("Exception: EPC=%08X Cause=%08X BadVAddr=%08X Jmp=%08X\n", (UINT32)m_core->cpr[0][COP0_EPC], (UINT32)m_core->cpr[0][COP0_Cause], (UINT32)m_core->cpr[0][COP0_BadVAddr], m_core->pc); + printf("Exception: EPC=%08X Cause=%08X BadVAddr=%08X Jmp=%08X\n", (uint32_t)m_core->cpr[0][COP0_EPC], (uint32_t)m_core->cpr[0][COP0_Cause], (uint32_t)m_core->cpr[0][COP0_BadVAddr], m_core->pc); func_printf_probe(); } @@ -497,47 +497,47 @@ void mips3_device::func_printf_probe() { printf(" PC=%08X r1=%08X%08X r2=%08X%08X r3=%08X%08X\n", m_core->pc, - (UINT32)(m_core->r[1] >> 32), (UINT32)m_core->r[1], - (UINT32)(m_core->r[2] >> 32), (UINT32)m_core->r[2], - (UINT32)(m_core->r[3] >> 32), (UINT32)m_core->r[3]); + (uint32_t)(m_core->r[1] >> 32), (uint32_t)m_core->r[1], + (uint32_t)(m_core->r[2] >> 32), (uint32_t)m_core->r[2], + (uint32_t)(m_core->r[3] >> 32), (uint32_t)m_core->r[3]); printf(" r4=%08X%08X r5=%08X%08X r6=%08X%08X r7=%08X%08X\n", - (UINT32)(m_core->r[4] >> 32), (UINT32)m_core->r[4], - (UINT32)(m_core->r[5] >> 32), (UINT32)m_core->r[5], - (UINT32)(m_core->r[6] >> 32), (UINT32)m_core->r[6], - (UINT32)(m_core->r[7] >> 32), (UINT32)m_core->r[7]); + (uint32_t)(m_core->r[4] >> 32), (uint32_t)m_core->r[4], + (uint32_t)(m_core->r[5] >> 32), (uint32_t)m_core->r[5], + (uint32_t)(m_core->r[6] >> 32), (uint32_t)m_core->r[6], + (uint32_t)(m_core->r[7] >> 32), (uint32_t)m_core->r[7]); printf(" r8=%08X%08X r9=%08X%08X r10=%08X%08X r11=%08X%08X\n", - (UINT32)(m_core->r[8] >> 32), (UINT32)m_core->r[8], - (UINT32)(m_core->r[9] >> 32), (UINT32)m_core->r[9], - (UINT32)(m_core->r[10] >> 32), (UINT32)m_core->r[10], - (UINT32)(m_core->r[11] >> 32), (UINT32)m_core->r[11]); + (uint32_t)(m_core->r[8] >> 32), (uint32_t)m_core->r[8], + (uint32_t)(m_core->r[9] >> 32), (uint32_t)m_core->r[9], + (uint32_t)(m_core->r[10] >> 32), (uint32_t)m_core->r[10], + (uint32_t)(m_core->r[11] >> 32), (uint32_t)m_core->r[11]); printf("r12=%08X%08X r13=%08X%08X r14=%08X%08X r15=%08X%08X\n", - (UINT32)(m_core->r[12] >> 32), (UINT32)m_core->r[12], - (UINT32)(m_core->r[13] >> 32), (UINT32)m_core->r[13], - (UINT32)(m_core->r[14] >> 32), (UINT32)m_core->r[14], - (UINT32)(m_core->r[15] >> 32), (UINT32)m_core->r[15]); + (uint32_t)(m_core->r[12] >> 32), (uint32_t)m_core->r[12], + (uint32_t)(m_core->r[13] >> 32), (uint32_t)m_core->r[13], + (uint32_t)(m_core->r[14] >> 32), (uint32_t)m_core->r[14], + (uint32_t)(m_core->r[15] >> 32), (uint32_t)m_core->r[15]); printf("r16=%08X%08X r17=%08X%08X r18=%08X%08X r19=%08X%08X\n", - (UINT32)(m_core->r[16] >> 32), (UINT32)m_core->r[16], - (UINT32)(m_core->r[17] >> 32), (UINT32)m_core->r[17], - (UINT32)(m_core->r[18] >> 32), (UINT32)m_core->r[18], - (UINT32)(m_core->r[19] >> 32), (UINT32)m_core->r[19]); + (uint32_t)(m_core->r[16] >> 32), (uint32_t)m_core->r[16], + (uint32_t)(m_core->r[17] >> 32), (uint32_t)m_core->r[17], + (uint32_t)(m_core->r[18] >> 32), (uint32_t)m_core->r[18], + (uint32_t)(m_core->r[19] >> 32), (uint32_t)m_core->r[19]); printf("r20=%08X%08X r21=%08X%08X r22=%08X%08X r23=%08X%08X\n", - (UINT32)(m_core->r[20] >> 32), (UINT32)m_core->r[20], - (UINT32)(m_core->r[21] >> 32), (UINT32)m_core->r[21], - (UINT32)(m_core->r[22] >> 32), (UINT32)m_core->r[22], - (UINT32)(m_core->r[23] >> 32), (UINT32)m_core->r[23]); + (uint32_t)(m_core->r[20] >> 32), (uint32_t)m_core->r[20], + (uint32_t)(m_core->r[21] >> 32), (uint32_t)m_core->r[21], + (uint32_t)(m_core->r[22] >> 32), (uint32_t)m_core->r[22], + (uint32_t)(m_core->r[23] >> 32), (uint32_t)m_core->r[23]); printf("r24=%08X%08X r25=%08X%08X r26=%08X%08X r27=%08X%08X\n", - (UINT32)(m_core->r[24] >> 32), (UINT32)m_core->r[24], - (UINT32)(m_core->r[25] >> 32), (UINT32)m_core->r[25], - (UINT32)(m_core->r[26] >> 32), (UINT32)m_core->r[26], - (UINT32)(m_core->r[27] >> 32), (UINT32)m_core->r[27]); + (uint32_t)(m_core->r[24] >> 32), (uint32_t)m_core->r[24], + (uint32_t)(m_core->r[25] >> 32), (uint32_t)m_core->r[25], + (uint32_t)(m_core->r[26] >> 32), (uint32_t)m_core->r[26], + (uint32_t)(m_core->r[27] >> 32), (uint32_t)m_core->r[27]); printf("r28=%08X%08X r29=%08X%08X r30=%08X%08X r31=%08X%08X\n", - (UINT32)(m_core->r[28] >> 32), (UINT32)m_core->r[28], - (UINT32)(m_core->r[29] >> 32), (UINT32)m_core->r[29], - (UINT32)(m_core->r[30] >> 32), (UINT32)m_core->r[30], - (UINT32)(m_core->r[31] >> 32), (UINT32)m_core->r[31]); + (uint32_t)(m_core->r[28] >> 32), (uint32_t)m_core->r[28], + (uint32_t)(m_core->r[29] >> 32), (uint32_t)m_core->r[29], + (uint32_t)(m_core->r[30] >> 32), (uint32_t)m_core->r[30], + (uint32_t)(m_core->r[31] >> 32), (uint32_t)m_core->r[31]); printf(" hi=%08X%08X lo=%08X%08X\n", - (UINT32)(m_core->r[REG_HI] >> 32), (UINT32)m_core->r[REG_HI], - (UINT32)(m_core->r[REG_LO] >> 32), (UINT32)m_core->r[REG_LO]); + (uint32_t)(m_core->r[REG_HI] >> 32), (uint32_t)m_core->r[REG_HI], + (uint32_t)(m_core->r[REG_LO] >> 32), (uint32_t)m_core->r[REG_LO]); } static void cfunc_printf_probe(void *param) @@ -552,7 +552,7 @@ static void cfunc_printf_probe(void *param) void mips3_device::func_unimplemented() { - UINT32 opcode = m_core->arg0; + uint32_t opcode = m_core->arg0; fatalerror("PC=%08X: Unimplemented op %08X (%02X,%02X)\n", m_core->pc, opcode, opcode >> 26, opcode & 0x3f); } @@ -719,11 +719,11 @@ void mips3_device::static_generate_tlb_mismatch() exception handler -------------------------------------------------*/ -void mips3_device::static_generate_exception(UINT8 exception, int recover, const char *name) +void mips3_device::static_generate_exception(uint8_t exception, int recover, const char *name) { code_handle *&exception_handle = recover ? m_exception[exception] : m_exception_norecover[exception]; drcuml_state *drcuml = m_drcuml.get(); - UINT32 offset = 0x180; + uint32_t offset = 0x180; code_label next = 1; code_label skip = 2; drcuml_block *block; @@ -868,8 +868,8 @@ void mips3_device::static_generate_memory_accessor(int mode, int size, int iswri for (ramnum = 0; ramnum < MIPS3_MAX_FASTRAM; ramnum++) if (m_fastram[ramnum].base != nullptr && (!iswrite || !m_fastram[ramnum].readonly)) { - void *fastbase = (UINT8 *)m_fastram[ramnum].base - m_fastram[ramnum].start; - UINT32 skip = label++; + void *fastbase = (uint8_t *)m_fastram[ramnum].base - m_fastram[ramnum].start; + uint32_t skip = label++; if (m_fastram[ramnum].end != 0xffffffff) { UML_CMP(block, I0, m_fastram[ramnum].end); // cmp i0,end @@ -1114,7 +1114,7 @@ void mips3_device::generate_checksum_block(drcuml_block *block, compiler_state * { if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) { - UINT32 sum = seqhead->opptr.l[0]; + uint32_t sum = seqhead->opptr.l[0]; void *base = m_direct->read_ptr(seqhead->physpc); UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword @@ -1146,7 +1146,7 @@ void mips3_device::generate_checksum_block(drcuml_block *block, compiler_state * UML_EXHc(block, COND_NE, *m_nocode, epc(seqhead)); // exne nocode,seqhead->pc } #else - UINT32 sum = 0; + uint32_t sum = 0; void *base = m_direct->read_ptr(seqhead->physpc); UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword sum += seqhead->opptr.l[0]; @@ -1299,10 +1299,10 @@ void mips3_device::generate_sequence_instruction(drcuml_block *block, compiler_s generate_delay_slot_and_branch ------------------------------------------------------------------*/ -void mips3_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 linkreg) +void mips3_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t linkreg) { compiler_state compiler_temp = *compiler; - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; /* fetch the target register if dynamic, in case it is modified by the delay slot */ if (desc->targetpc == BRANCH_TARGET_DYNAMIC) @@ -1314,7 +1314,7 @@ void mips3_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_ /* set the link if needed -- before the delay slot */ if (linkreg != 0) { - UML_DMOV(block, R64(linkreg), (INT32)(desc->pc + 8)); // dmov ,desc->pc + 8 + UML_DMOV(block, R64(linkreg), (int32_t)(desc->pc + 8)); // dmov ,desc->pc + 8 } /* compile the delay slot using temporary compiler state */ @@ -1356,8 +1356,8 @@ void mips3_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_ int mips3_device::generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = op >> 26; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = op >> 26; code_label skip; switch (opswitch) @@ -1624,12 +1624,12 @@ int mips3_device::generate_opcode(drcuml_block *block, compiler_state *compiler, UML_AND(block, I0, I0, ~7); // and i0,i0,~7 if (!m_bigendian) UML_XOR(block, I1, I1, 0x38); // xor i1,i1,0x38 - UML_DSHR(block, I2, (UINT64)~0, I1); // dshr i2,~0,i1 + UML_DSHR(block, I2, (uint64_t)~0, I1); // dshr i2,~0,i1 UML_CALLH(block, *m_read64mask[m_core->mode >> 1]); // callh read64mask if (RTREG != 0) { - UML_DSHL(block, I2, (UINT64)~0, I1); // dshl i2,~0,i1 + UML_DSHL(block, I2, (uint64_t)~0, I1); // dshl i2,~0,i1 UML_DROLINS(block, R64(RTREG), I0, I1, I2); // drolins ,i0,i1,i2 } if (!in_delay_slot) @@ -1642,11 +1642,11 @@ int mips3_device::generate_opcode(drcuml_block *block, compiler_state *compiler, UML_AND(block, I0, I0, ~7); // and i0,i0,~7 if (m_bigendian) UML_XOR(block, I1, I1, 0x38); // xor i1,i1,0x38 - UML_DSHL(block, I2, (UINT64)~0, I1); // dshl i2,~0,i1 + UML_DSHL(block, I2, (uint64_t)~0, I1); // dshl i2,~0,i1 UML_CALLH(block, *m_read64mask[m_core->mode >> 1]); // callh read64mask if (RTREG != 0) { - UML_DSHR(block, I2, (UINT64)~0, I1); // dshr i2,~0,i1 + UML_DSHR(block, I2, (uint64_t)~0, I1); // dshr i2,~0,i1 UML_SUB(block, I1, 64, I1); // sub i1,64,i1 UML_DROLINS(block, R64(RTREG), I0, I1, I2); // drolins ,i0,i1,i2 } @@ -1784,7 +1784,7 @@ int mips3_device::generate_opcode(drcuml_block *block, compiler_state *compiler, UML_DMOV(block, I1, R64(RTREG)); // dmov i1, if (!m_bigendian) UML_XOR(block, I3, I3, 0x38); // xor i3,i3,0x38 - UML_DSHR(block, I2, (UINT64)~0, I3); // dshr i2,~0,i3 + UML_DSHR(block, I2, (uint64_t)~0, I3); // dshr i2,~0,i3 UML_DSHR(block, I1, I1, I3); // dshr i1,i1,i3 UML_CALLH(block, *m_write64mask[m_core->mode >> 1]);// callh write64mask @@ -1799,7 +1799,7 @@ int mips3_device::generate_opcode(drcuml_block *block, compiler_state *compiler, UML_DMOV(block, I1, R64(RTREG)); // dmov i1, if (m_bigendian) UML_XOR(block, I3, I3, 0x38); // xor i3,i3,0x38 - UML_DSHL(block, I2, (UINT64)~0, I3); // dshl i2,~0,i3 + UML_DSHL(block, I2, (uint64_t)~0, I3); // dshl i2,~0,i3 UML_DSHL(block, I1, I1, I3); // dshl i1,i1,i3 UML_CALLH(block, *m_write64mask[m_core->mode >> 1]);// callh write64mask @@ -1889,8 +1889,8 @@ int mips3_device::generate_opcode(drcuml_block *block, compiler_state *compiler, int mips3_device::generate_special(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = op & 63; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = op & 63; switch (opswitch) { @@ -2138,7 +2138,7 @@ int mips3_device::generate_special(drcuml_block *block, compiler_state *compiler if (RDREG != 0) { UML_DOR(block, I0, R64(RSREG), R64(RTREG)); // dor i0,, - UML_DXOR(block, R64(RDREG), I0, (UINT64)~0); // dxor ,i0,~0 + UML_DXOR(block, R64(RDREG), I0, (uint64_t)~0); // dxor ,i0,~0 } return TRUE; @@ -2282,8 +2282,8 @@ int mips3_device::generate_special(drcuml_block *block, compiler_state *compiler int mips3_device::generate_regimm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = RTREG; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = RTREG; code_label skip; switch (opswitch) @@ -2294,7 +2294,7 @@ int mips3_device::generate_regimm(drcuml_block *block, compiler_state *compiler, case 0x12: /* BLTZALL */ if (opswitch & 0x10) { - UML_DMOV(block, R64(31), (INT32)(desc->pc + 8)); + UML_DMOV(block, R64(31), (int32_t)(desc->pc + 8)); } if (RSREG != 0) { @@ -2312,7 +2312,7 @@ int mips3_device::generate_regimm(drcuml_block *block, compiler_state *compiler, case 0x13: /* BGEZALL */ if (opswitch & 0x10) { - UML_DMOV(block, R64(31), (INT32)(desc->pc + 8)); + UML_DMOV(block, R64(31), (int32_t)(desc->pc + 8)); } if (RSREG != 0) @@ -2369,8 +2369,8 @@ int mips3_device::generate_regimm(drcuml_block *block, compiler_state *compiler, int mips3_device::generate_idt(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = op & 0x1f; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = op & 0x1f; /* only enabled on IDT processors */ if (m_flavor != MIPS3_TYPE_R4650) @@ -2417,7 +2417,7 @@ int mips3_device::generate_idt(drcuml_block *block, compiler_state *compiler, co handle special COP0 registers -------------------------------------------------*/ -int mips3_device::generate_set_cop0_reg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 reg) +int mips3_device::generate_set_cop0_reg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t reg) { int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); code_label link; @@ -2491,7 +2491,7 @@ int mips3_device::generate_set_cop0_reg(drcuml_block *block, compiler_state *com read special COP0 registers -------------------------------------------------*/ -int mips3_device::generate_get_cop0_reg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 reg) +int mips3_device::generate_get_cop0_reg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t reg) { code_label link1, link2; @@ -2559,8 +2559,8 @@ void mips3_device::check_cop0_access(drcuml_block *block) int mips3_device::generate_cop0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = RSREG; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = RSREG; int skip; /* generate an exception if COP0 is disabled unless we are in kernel mode */ @@ -2691,7 +2691,7 @@ void mips3_device::check_cop1_access(drcuml_block *block) } } -void mips3_device::generate_get_cop1_reg64_d2i(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const UINT32 reg, const uml::parameter& param) +void mips3_device::generate_get_cop1_reg64_d2i(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const uint32_t reg, const uml::parameter& param) { if ((m_core->mode & 1) == 0) { @@ -2707,7 +2707,7 @@ void mips3_device::generate_get_cop1_reg64_d2i(drcuml_block *block, compiler_sta } } -void mips3_device::generate_get_cop1_reg64(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const UINT32 reg, const uml::parameter& param) +void mips3_device::generate_get_cop1_reg64(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const uint32_t reg, const uml::parameter& param) { if ((m_core->mode & 1) == 0) { @@ -2723,7 +2723,7 @@ void mips3_device::generate_get_cop1_reg64(drcuml_block *block, compiler_state * } } -void mips3_device::generate_set_cop1_reg64(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const UINT32 reg, const uml::parameter& param) +void mips3_device::generate_set_cop1_reg64(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const uint32_t reg, const uml::parameter& param) { if ((m_core->mode & 1) == 0) { @@ -2740,7 +2740,7 @@ void mips3_device::generate_set_cop1_reg64(drcuml_block *block, compiler_state * } } -void mips3_device::generate_set_cop1_reg64_i2d(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const UINT32 reg, const uml::parameter& param) +void mips3_device::generate_set_cop1_reg64_i2d(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, const uint32_t reg, const uml::parameter& param) { if ((m_core->mode & 1) == 0) { @@ -2763,7 +2763,7 @@ void mips3_device::generate_set_cop1_reg64_i2d(drcuml_block *block, compiler_sta int mips3_device::generate_cop1_fr0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; code_label skip; condition_t condition; @@ -3349,7 +3349,7 @@ int mips3_device::generate_cop1_fr0(drcuml_block *block, compiler_state *compile int mips3_device::generate_cop1_fr1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; code_label skip; condition_t condition; @@ -3732,7 +3732,7 @@ int mips3_device::generate_cop1_fr1(drcuml_block *block, compiler_state *compile int mips3_device::generate_cop1x_fr0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; check_cop1_access(block); @@ -3845,7 +3845,7 @@ int mips3_device::generate_cop1x_fr0(drcuml_block *block, compiler_state *compil int mips3_device::generate_cop1x_fr1(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; check_cop1_access(block); @@ -3945,7 +3945,7 @@ int mips3_device::generate_cop1x_fr1(drcuml_block *block, compiler_state *compil including disassembly of a MIPS instruction -------------------------------------------------*/ -void mips3_device::log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 op) +void mips3_device::log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint32_t op) { if (m_drcuml->logging()) { @@ -3962,7 +3962,7 @@ void mips3_device::log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 flags -------------------------------------------------*/ -const char *mips3_device::log_desc_flags_to_string(UINT32 flags) +const char *mips3_device::log_desc_flags_to_string(uint32_t flags) { static char tempbuf[30]; char *dest = tempbuf; @@ -4016,7 +4016,7 @@ const char *mips3_device::log_desc_flags_to_string(UINT32 flags) log_register_list - log a list of GPR registers -------------------------------------------------*/ -void mips3_device::log_register_list(drcuml_state *drcuml, const char *string, const UINT32 *reglist, const UINT32 *regnostarlist) +void mips3_device::log_register_list(drcuml_state *drcuml, const char *string, const uint32_t *reglist, const uint32_t *regnostarlist) { int count = 0; int regnum; diff --git a/src/devices/cpu/mips/mips3dsm.cpp b/src/devices/cpu/mips/mips3dsm.cpp index 0eca3d73c54..8c9442f05ff 100644 --- a/src/devices/cpu/mips/mips3dsm.cpp +++ b/src/devices/cpu/mips/mips3dsm.cpp @@ -101,7 +101,7 @@ static const char *const ccreg[4][32] = CODE CODE ***************************************************************************/ -static inline char *signed_16bit(INT16 val) +static inline char *signed_16bit(int16_t val) { static char temp[10]; if (val < 0) @@ -111,11 +111,11 @@ static inline char *signed_16bit(INT16 val) return temp; } -static UINT32 dasm_cop0(UINT32 pc, UINT32 op, char *buffer) +static uint32_t dasm_cop0(uint32_t pc, uint32_t op, char *buffer) { int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; - UINT32 flags = 0; + uint32_t flags = 0; switch ((op >> 21) & 31) { @@ -128,8 +128,8 @@ static UINT32 dasm_cop0(UINT32 pc, UINT32 op, char *buffer) case 0x08: /* BC */ switch (rt) { - case 0x00: sprintf(buffer, "bc0f $%08x", pc + 4 + ((INT16)op << 2)); break; - case 0x01: sprintf(buffer, "bc0t $%08x", pc + 4 + ((INT16)op << 2)); break; + case 0x00: sprintf(buffer, "bc0f $%08x", pc + 4 + ((int16_t)op << 2)); break; + case 0x01: sprintf(buffer, "bc0t $%08x", pc + 4 + ((int16_t)op << 2)); break; case 0x02: sprintf(buffer, "bc0fl [invalid]"); break; case 0x03: sprintf(buffer, "bc0tl [invalid]"); break; default: sprintf(buffer, "dc.l $%08x [invalid]", op); break; @@ -167,7 +167,7 @@ static UINT32 dasm_cop0(UINT32 pc, UINT32 op, char *buffer) return flags; } -static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer) +static uint32_t dasm_cop1(uint32_t pc, uint32_t op, char *buffer) { static const char *const format_table[] = { @@ -180,7 +180,7 @@ static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer) int fd = (op >> 6) & 31; int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; - UINT32 flags = 0; + uint32_t flags = 0; switch ((op >> 21) & 31) { @@ -193,10 +193,10 @@ static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer) case 0x08: /* BC */ switch (rt & 3) { - case 0x00: sprintf(buffer, "bc1f $%08x,%d", pc + 4 + ((INT16)op << 2), (op >> 18) & 7); break; - case 0x01: sprintf(buffer, "bc1t $%08x,%d", pc + 4 + ((INT16)op << 2), (op >> 18) & 7); break; - case 0x02: sprintf(buffer, "bc1fl $%08x,%d", pc + 4 + ((INT16)op << 2), (op >> 18) & 7); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; - case 0x03: sprintf(buffer, "bc1tl $%08x,%d", pc + 4 + ((INT16)op << 2), (op >> 18) & 7); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x00: sprintf(buffer, "bc1f $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); break; + case 0x01: sprintf(buffer, "bc1t $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); break; + case 0x02: sprintf(buffer, "bc1fl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x03: sprintf(buffer, "bc1tl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; } break; default: /* COP */ @@ -250,7 +250,7 @@ static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer) return flags; } -static UINT32 dasm_cop1x(UINT32 pc, UINT32 op, char *buffer) +static uint32_t dasm_cop1x(uint32_t pc, uint32_t op, char *buffer) { static const char *const format3_table[] = { @@ -264,7 +264,7 @@ static UINT32 dasm_cop1x(UINT32 pc, UINT32 op, char *buffer) int rs = (op >> 21) & 31; int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; - UINT32 flags = 0; + uint32_t flags = 0; switch (op & 0x3f) { @@ -310,11 +310,11 @@ static UINT32 dasm_cop1x(UINT32 pc, UINT32 op, char *buffer) return flags; } -static UINT32 dasm_cop2(UINT32 pc, UINT32 op, char *buffer) +static uint32_t dasm_cop2(uint32_t pc, uint32_t op, char *buffer) { int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; - UINT32 flags = 0; + uint32_t flags = 0; switch ((op >> 21) & 31) { @@ -327,8 +327,8 @@ static UINT32 dasm_cop2(UINT32 pc, UINT32 op, char *buffer) case 0x08: /* BC */ switch (rt) { - case 0x00: sprintf(buffer, "bc2f $%08x", pc + 4 + ((INT16)op << 2)); break; - case 0x01: sprintf(buffer, "bc2t $%08x", pc + 4 + ((INT16)op << 2)); break; + case 0x00: sprintf(buffer, "bc2f $%08x", pc + 4 + ((int16_t)op << 2)); break; + case 0x01: sprintf(buffer, "bc2t $%08x", pc + 4 + ((int16_t)op << 2)); break; case 0x02: sprintf(buffer, "bc2fl [invalid]"); break; case 0x03: sprintf(buffer, "bc2tl [invalid]"); break; default: sprintf(buffer, "dc.l $%08x [invalid]", op); break; @@ -357,13 +357,13 @@ static UINT32 dasm_cop2(UINT32 pc, UINT32 op, char *buffer) return flags; } -unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op) +unsigned dasmmips3(char *buffer, unsigned pc, uint32_t op) { int rs = (op >> 21) & 31; int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; int shift = (op >> 6) & 31; - UINT32 flags = 0; + uint32_t flags = 0; switch (op >> 26) { @@ -441,20 +441,20 @@ unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op) case 0x01: /* REGIMM */ switch ((op >> 16) & 31) { - case 0x00: sprintf(buffer, "bltz %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; - case 0x01: sprintf(buffer, "bgez %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; - case 0x02: sprintf(buffer, "bltzl %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; - case 0x03: sprintf(buffer, "bgezl %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; + case 0x00: sprintf(buffer, "bltz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x01: sprintf(buffer, "bgez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x02: sprintf(buffer, "bltzl %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x03: sprintf(buffer, "bgezl %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; case 0x08: sprintf(buffer, "tgei %s,%s", reg[rs], signed_16bit(op)); flags = DASMFLAG_STEP_OVER; break; case 0x09: sprintf(buffer, "tgeiu %s,%s", reg[rs], signed_16bit(op)); flags = DASMFLAG_STEP_OVER; break; case 0x0a: sprintf(buffer, "tlti %s,%s", reg[rs], signed_16bit(op)); flags = DASMFLAG_STEP_OVER; break; case 0x0b: sprintf(buffer, "tltiu %s,%s", reg[rs], signed_16bit(op)); flags = DASMFLAG_STEP_OVER; break; case 0x0c: sprintf(buffer, "teqi %s,%s", reg[rs], signed_16bit(op)); flags = DASMFLAG_STEP_OVER; break; case 0x0e: sprintf(buffer, "tnei %s,%s", reg[rs], signed_16bit(op)); flags = DASMFLAG_STEP_OVER; break; - case 0x10: sprintf(buffer, "bltzal %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; - case 0x11: sprintf(buffer, "bgezal %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; - case 0x12: sprintf(buffer, "bltzall %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; - case 0x13: sprintf(buffer, "bgezall %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x10: sprintf(buffer, "bltzal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x11: sprintf(buffer, "bgezal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x12: sprintf(buffer, "bltzall %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x13: sprintf(buffer, "bgezall %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; default: sprintf(buffer, "dc.l $%08x [invalid]", op); break; } break; @@ -462,29 +462,29 @@ unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op) case 0x02: sprintf(buffer, "j $%08x", (pc & 0xf0000000) | ((op & 0x03ffffff) << 2)); break; case 0x03: sprintf(buffer, "jal $%08x", (pc & 0xf0000000) | ((op & 0x03ffffff) << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; case 0x04: if (rs == 0 && rt == 0) - sprintf(buffer, "b $%08x", pc + 4 + ((INT16)op << 2)); + sprintf(buffer, "b $%08x", pc + 4 + ((int16_t)op << 2)); else - sprintf(buffer, "beq %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2)); + sprintf(buffer, "beq %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2)); break; - case 0x05: sprintf(buffer, "bne %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; - case 0x06: sprintf(buffer, "blez %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; - case 0x07: sprintf(buffer, "bgtz %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; + case 0x05: sprintf(buffer, "bne %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2));break; + case 0x06: sprintf(buffer, "blez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x07: sprintf(buffer, "bgtz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; case 0x08: sprintf(buffer, "addi %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x09: sprintf(buffer, "addiu %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x0a: sprintf(buffer, "slti %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x0b: sprintf(buffer, "sltiu %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; - case 0x0c: sprintf(buffer, "andi %s,%s,$%04x", reg[rt], reg[rs], (UINT16)op); break; - case 0x0d: sprintf(buffer, "ori %s,%s,$%04x", reg[rt], reg[rs], (UINT16)op); break; - case 0x0e: sprintf(buffer, "xori %s,%s,$%04x", reg[rt], reg[rs], (UINT16)op); break; - case 0x0f: sprintf(buffer, "lui %s,$%04x", reg[rt], (UINT16)op); break; + case 0x0c: sprintf(buffer, "andi %s,%s,$%04x", reg[rt], reg[rs], (uint16_t)op); break; + case 0x0d: sprintf(buffer, "ori %s,%s,$%04x", reg[rt], reg[rs], (uint16_t)op); break; + case 0x0e: sprintf(buffer, "xori %s,%s,$%04x", reg[rt], reg[rs], (uint16_t)op); break; + case 0x0f: sprintf(buffer, "lui %s,$%04x", reg[rt], (uint16_t)op); break; case 0x10: flags = dasm_cop0(pc, op, buffer); break; case 0x11: flags = dasm_cop1(pc, op, buffer); break; case 0x12: flags = dasm_cop2(pc, op, buffer); break; case 0x13: flags = dasm_cop1x(pc, op, buffer); break; - case 0x14: sprintf(buffer, "beql %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; - case 0x15: sprintf(buffer, "bnel %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; - case 0x16: sprintf(buffer, "blezl %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; - case 0x17: sprintf(buffer, "bgtzl %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; + case 0x14: sprintf(buffer, "beql %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2));break; + case 0x15: sprintf(buffer, "bnel %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2));break; + case 0x16: sprintf(buffer, "blezl %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2));break; + case 0x17: sprintf(buffer, "bgtzl %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2));break; case 0x18: sprintf(buffer, "daddi %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x19: sprintf(buffer, "daddiu %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x1a: sprintf(buffer, "ldl %s,%s(%s)", reg[rt], signed_16bit(op), reg[rs]); break; @@ -538,7 +538,7 @@ unsigned dasmmips3(char *buffer, unsigned pc, UINT32 op) CPU_DISASSEMBLE( mips3be ) { - UINT32 op = *(UINT32 *)oprom; + uint32_t op = *(uint32_t *)oprom; op = big_endianize_int32(op); return dasmmips3(buffer, pc, op); } @@ -546,7 +546,7 @@ CPU_DISASSEMBLE( mips3be ) CPU_DISASSEMBLE( mips3le ) { - UINT32 op = *(UINT32 *)oprom; + uint32_t op = *(uint32_t *)oprom; op = little_endianize_int32(op); return dasmmips3(buffer, pc, op); } diff --git a/src/devices/cpu/mips/mips3fe.cpp b/src/devices/cpu/mips/mips3fe.cpp index 42055c39e24..a530d026c75 100644 --- a/src/devices/cpu/mips/mips3fe.cpp +++ b/src/devices/cpu/mips/mips3fe.cpp @@ -21,7 +21,7 @@ // mips3_frontend - constructor //------------------------------------------------- -mips3_frontend::mips3_frontend(mips3_device *mips3, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) +mips3_frontend::mips3_frontend(mips3_device *mips3, uint32_t window_start, uint32_t window_end, uint32_t max_sequence) : drc_frontend(*mips3, window_start, window_end, max_sequence), m_mips3(mips3) { @@ -35,7 +35,7 @@ mips3_frontend::mips3_frontend(mips3_device *mips3, UINT32 window_start, UINT32 bool mips3_frontend::describe(opcode_desc &desc, const opcode_desc *prev) { - UINT32 op, opswitch; + uint32_t op, opswitch; // compute the physical PC assert((desc.physpc & 3) == 0); @@ -230,7 +230,7 @@ bool mips3_frontend::describe(opcode_desc &desc, const opcode_desc *prev) // single instruction in the 'special' group //------------------------------------------------- -bool mips3_frontend::describe_special(UINT32 op, opcode_desc &desc) +bool mips3_frontend::describe_special(uint32_t op, opcode_desc &desc) { switch (op & 63) { @@ -381,7 +381,7 @@ bool mips3_frontend::describe_special(UINT32 op, opcode_desc &desc) // single instruction in the 'regimm' group //------------------------------------------------- -bool mips3_frontend::describe_regimm(UINT32 op, opcode_desc &desc) +bool mips3_frontend::describe_regimm(uint32_t op, opcode_desc &desc) { switch (RTREG) { @@ -438,7 +438,7 @@ bool mips3_frontend::describe_regimm(UINT32 op, opcode_desc &desc) // instruction in the IDT-specific group //------------------------------------------------- -bool mips3_frontend::describe_idt(UINT32 op, opcode_desc &desc) +bool mips3_frontend::describe_idt(uint32_t op, opcode_desc &desc) { // only on the R4650 if (m_mips3->m_flavor != mips3_device::MIPS3_TYPE_R4650) @@ -469,7 +469,7 @@ bool mips3_frontend::describe_idt(UINT32 op, opcode_desc &desc) // single instruction in the COP0 group //------------------------------------------------- -bool mips3_frontend::describe_cop0(UINT32 op, opcode_desc &desc) +bool mips3_frontend::describe_cop0(uint32_t op, opcode_desc &desc) { // any COP0 instruction can potentially cause an exception desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; @@ -544,7 +544,7 @@ bool mips3_frontend::describe_cop0(UINT32 op, opcode_desc &desc) // single instruction in the COP1 group //------------------------------------------------- -bool mips3_frontend::describe_cop1(UINT32 op, opcode_desc &desc) +bool mips3_frontend::describe_cop1(uint32_t op, opcode_desc &desc) { // any COP1 instruction can potentially cause an exception // desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; @@ -662,7 +662,7 @@ bool mips3_frontend::describe_cop1(UINT32 op, opcode_desc &desc) // single instruction in the COP1X group //------------------------------------------------- -bool mips3_frontend::describe_cop1x(UINT32 op, opcode_desc &desc) +bool mips3_frontend::describe_cop1x(uint32_t op, opcode_desc &desc) { // any COP1 instruction can potentially cause an exception // desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; @@ -705,7 +705,7 @@ bool mips3_frontend::describe_cop1x(UINT32 op, opcode_desc &desc) // single instruction in the COP2 group //------------------------------------------------- -bool mips3_frontend::describe_cop2(UINT32 op, opcode_desc &desc) +bool mips3_frontend::describe_cop2(uint32_t op, opcode_desc &desc) { // any COP2 instruction can potentially cause an exception desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; diff --git a/src/devices/cpu/mips/r3000.cpp b/src/devices/cpu/mips/r3000.cpp index 9eec18d9de2..2e37da309a0 100644 --- a/src/devices/cpu/mips/r3000.cpp +++ b/src/devices/cpu/mips/r3000.cpp @@ -86,8 +86,8 @@ #define RTVAL m_r[RTREG] #define RDVAL m_r[RDREG] -#define SIMMVAL ((INT16)m_op) -#define UIMMVAL ((UINT16)m_op) +#define SIMMVAL ((int16_t)m_op) +#define UIMMVAL ((uint16_t)m_op) #define LIMMVAL (m_op & 0x03ffffff) #define ADDPC(x) do { m_nextpc = m_pc + ((x) << 2); } while (0) @@ -124,7 +124,7 @@ const device_type R3081 = &device_creator; // r3000_device - constructor //------------------------------------------------- -r3000_device::r3000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, chip_type chiptype, const char *shortname, const char *source) +r3000_device::r3000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, chip_type chiptype, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config_be("program", ENDIANNESS_BIG, 32, 29), m_program_config_le("program", ENDIANNESS_LITTLE, 32, 29), @@ -169,7 +169,7 @@ r3000_device::~r3000_device() // r3041_device - constructor //------------------------------------------------- -r3041_device::r3041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +r3041_device::r3041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : r3000_device(mconfig, R3041, "R3041", tag, owner, clock, CHIP_TYPE_R3041, "r3041", __FILE__) { } @@ -177,7 +177,7 @@ r3041_device::r3041_device(const machine_config &mconfig, const char *tag, devic // r3051_device - constructor //------------------------------------------------- -r3051_device::r3051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +r3051_device::r3051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : r3000_device(mconfig, R3051, "R3051", tag, owner, clock, CHIP_TYPE_R3051, "r3051", __FILE__) { } @@ -185,7 +185,7 @@ r3051_device::r3051_device(const machine_config &mconfig, const char *tag, devic // r3052_device - constructor //------------------------------------------------- -r3052_device::r3052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +r3052_device::r3052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : r3000_device(mconfig, R3052, "R3052", tag, owner, clock, CHIP_TYPE_R3052, "r3052", __FILE__) { } @@ -193,7 +193,7 @@ r3052_device::r3052_device(const machine_config &mconfig, const char *tag, devic // r3071_device - constructor //------------------------------------------------- -r3071_device::r3071_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +r3071_device::r3071_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : r3000_device(mconfig, R3071, "R3071", tag, owner, clock, CHIP_TYPE_R3071, "r3071", __FILE__) { } @@ -201,7 +201,7 @@ r3071_device::r3071_device(const machine_config &mconfig, const char *tag, devic // r3081_device - constructor //------------------------------------------------- -r3081_device::r3081_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +r3081_device::r3081_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : r3000_device(mconfig, R3081, "R3081", tag, owner, clock, CHIP_TYPE_R3081, "r3081", __FILE__) { } @@ -458,7 +458,7 @@ void r3000_device::state_string_export(const device_state_entry &entry, std::str // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 r3000_device::disasm_min_opcode_bytes() const +uint32_t r3000_device::disasm_min_opcode_bytes() const { return 4; } @@ -469,7 +469,7 @@ UINT32 r3000_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 r3000_device::disasm_max_opcode_bytes() const +uint32_t r3000_device::disasm_max_opcode_bytes() const { return 4; } @@ -480,7 +480,7 @@ UINT32 r3000_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t r3000_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t r3000_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( r3000le ); extern CPU_DISASSEMBLE( r3000be ); @@ -496,37 +496,37 @@ offs_t r3000_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op MEMORY ACCESSORS ***************************************************************************/ -inline UINT32 r3000_device::readop(offs_t pc) +inline uint32_t r3000_device::readop(offs_t pc) { return m_direct->read_dword(pc); } -UINT8 r3000_device::readmem(offs_t offset) +uint8_t r3000_device::readmem(offs_t offset) { return m_program->read_byte(offset); } -UINT16 r3000_device::readmem_word(offs_t offset) +uint16_t r3000_device::readmem_word(offs_t offset) { return m_program->read_word(offset); } -UINT32 r3000_device::readmem_dword(offs_t offset) +uint32_t r3000_device::readmem_dword(offs_t offset) { return m_program->read_dword(offset); } -void r3000_device::writemem(offs_t offset, UINT8 data) +void r3000_device::writemem(offs_t offset, uint8_t data) { m_program->write_byte(offset, data); } -void r3000_device::writemem_word(offs_t offset, UINT16 data) +void r3000_device::writemem_word(offs_t offset, uint16_t data) { m_program->write_word(offset, data); } -void r3000_device::writemem_dword(offs_t offset, UINT32 data) +void r3000_device::writemem_dword(offs_t offset, uint32_t data) { m_program->write_dword(offset, data); } @@ -536,43 +536,43 @@ void r3000_device::writemem_dword(offs_t offset, UINT32 data) BIG ENDIAN CACHE I/O ***************************************************************************/ -UINT8 r3000_device::readcache_be(offs_t offset) +uint8_t r3000_device::readcache_be(offs_t offset) { offset &= 0x1fffffff; return (offset * 4 < m_cache_size) ? m_cache[BYTE4_XOR_BE(offset)] : 0xff; } -UINT16 r3000_device::readcache_be_word(offs_t offset) +uint16_t r3000_device::readcache_be_word(offs_t offset) { offset &= 0x1fffffff; - return (offset * 4 < m_cache_size) ? *(UINT16 *)&m_cache[WORD_XOR_BE(offset)] : 0xffff; + return (offset * 4 < m_cache_size) ? *(uint16_t *)&m_cache[WORD_XOR_BE(offset)] : 0xffff; } -UINT32 r3000_device::readcache_be_dword(offs_t offset) +uint32_t r3000_device::readcache_be_dword(offs_t offset) { offset &= 0x1fffffff; - return (offset * 4 < m_cache_size) ? *(UINT32 *)&m_cache[offset] : 0xffffffff; + return (offset * 4 < m_cache_size) ? *(uint32_t *)&m_cache[offset] : 0xffffffff; } -void r3000_device::writecache_be(offs_t offset, UINT8 data) +void r3000_device::writecache_be(offs_t offset, uint8_t data) { offset &= 0x1fffffff; if (offset * 4 < m_cache_size) m_cache[BYTE4_XOR_BE(offset)] = data; } -void r3000_device::writecache_be_word(offs_t offset, UINT16 data) +void r3000_device::writecache_be_word(offs_t offset, uint16_t data) { offset &= 0x1fffffff; - if (offset * 4 < m_cache_size) *(UINT16 *)&m_cache[WORD_XOR_BE(offset)] = data; + if (offset * 4 < m_cache_size) *(uint16_t *)&m_cache[WORD_XOR_BE(offset)] = data; } -void r3000_device::writecache_be_dword(offs_t offset, UINT32 data) +void r3000_device::writecache_be_dword(offs_t offset, uint32_t data) { offset &= 0x1fffffff; - if (offset * 4 < m_cache_size) *(UINT32 *)&m_cache[offset] = data; + if (offset * 4 < m_cache_size) *(uint32_t *)&m_cache[offset] = data; } -UINT8 r3000_device::readcache_le(offs_t offset) +uint8_t r3000_device::readcache_le(offs_t offset) { offset &= 0x1fffffff; return (offset * 4 < m_cache_size) ? m_cache[BYTE4_XOR_LE(offset)] : 0xff; @@ -583,34 +583,34 @@ UINT8 r3000_device::readcache_le(offs_t offset) LITTLE ENDIAN CACHE I/O ***************************************************************************/ -UINT16 r3000_device::readcache_le_word(offs_t offset) +uint16_t r3000_device::readcache_le_word(offs_t offset) { offset &= 0x1fffffff; - return (offset * 4 < m_cache_size) ? *(UINT16 *)&m_cache[WORD_XOR_LE(offset)] : 0xffff; + return (offset * 4 < m_cache_size) ? *(uint16_t *)&m_cache[WORD_XOR_LE(offset)] : 0xffff; } -UINT32 r3000_device::readcache_le_dword(offs_t offset) +uint32_t r3000_device::readcache_le_dword(offs_t offset) { offset &= 0x1fffffff; - return (offset * 4 < m_cache_size) ? *(UINT32 *)&m_cache[offset] : 0xffffffff; + return (offset * 4 < m_cache_size) ? *(uint32_t *)&m_cache[offset] : 0xffffffff; } -void r3000_device::writecache_le(offs_t offset, UINT8 data) +void r3000_device::writecache_le(offs_t offset, uint8_t data) { offset &= 0x1fffffff; if (offset * 4 < m_cache_size) m_cache[BYTE4_XOR_LE(offset)] = data; } -void r3000_device::writecache_le_word(offs_t offset, UINT16 data) +void r3000_device::writecache_le_word(offs_t offset, uint16_t data) { offset &= 0x1fffffff; - if (offset * 4 < m_cache_size) *(UINT16 *)&m_cache[WORD_XOR_LE(offset)] = data; + if (offset * 4 < m_cache_size) *(uint16_t *)&m_cache[WORD_XOR_LE(offset)] = data; } -void r3000_device::writecache_le_dword(offs_t offset, UINT32 data) +void r3000_device::writecache_le_dword(offs_t offset, uint32_t data) { offset &= 0x1fffffff; - if (offset * 4 < m_cache_size) *(UINT32 *)&m_cache[offset] = data; + if (offset * 4 < m_cache_size) *(uint32_t *)&m_cache[offset] = data; } @@ -680,12 +680,12 @@ void r3000_device::set_irq_line(int irqline, int state) COP0 (SYSTEM) EXECUTION HANDLING ***************************************************************************/ -inline UINT32 r3000_device::get_cop0_reg(int idx) +inline uint32_t r3000_device::get_cop0_reg(int idx) { return m_cpr[0][idx]; } -inline void r3000_device::set_cop0_reg(int idx, UINT32 val) +inline void r3000_device::set_cop0_reg(int idx, uint32_t val) { if (idx == COP0_Cause) { @@ -696,8 +696,8 @@ inline void r3000_device::set_cop0_reg(int idx, UINT32 val) } else if (idx == COP0_Status) { - UINT32 oldsr = m_cpr[0][idx]; - UINT32 diff = oldsr ^ val; + uint32_t oldsr = m_cpr[0][idx]; + uint32_t diff = oldsr ^ val; // handle cache isolation if (diff & SR_IsC) @@ -725,12 +725,12 @@ inline void r3000_device::set_cop0_reg(int idx, UINT32 val) m_cpr[0][idx] = val; } -inline UINT32 r3000_device::get_cop0_creg(int idx) +inline uint32_t r3000_device::get_cop0_creg(int idx) { return m_ccr[0][idx]; } -inline void r3000_device::set_cop0_creg(int idx, UINT32 val) +inline void r3000_device::set_cop0_creg(int idx, uint32_t val) { m_ccr[0][idx] = val; } @@ -792,22 +792,22 @@ inline void r3000_device::handle_cop0() COP1 (FPU) EXECUTION HANDLING ***************************************************************************/ -inline UINT32 r3000_device::get_cop1_reg(int idx) +inline uint32_t r3000_device::get_cop1_reg(int idx) { return m_cpr[1][idx]; } -inline void r3000_device::set_cop1_reg(int idx, UINT32 val) +inline void r3000_device::set_cop1_reg(int idx, uint32_t val) { m_cpr[1][idx] = val; } -inline UINT32 r3000_device::get_cop1_creg(int idx) +inline uint32_t r3000_device::get_cop1_creg(int idx) { return m_ccr[1][idx]; } -inline void r3000_device::set_cop1_creg(int idx, UINT32 val) +inline void r3000_device::set_cop1_creg(int idx, uint32_t val) { m_ccr[1][idx] = val; } @@ -860,22 +860,22 @@ inline void r3000_device::handle_cop1() COP2 (CUSTOM) EXECUTION HANDLING ***************************************************************************/ -inline UINT32 r3000_device::get_cop2_reg(int idx) +inline uint32_t r3000_device::get_cop2_reg(int idx) { return m_cpr[2][idx]; } -inline void r3000_device::set_cop2_reg(int idx, UINT32 val) +inline void r3000_device::set_cop2_reg(int idx, uint32_t val) { m_cpr[2][idx] = val; } -inline UINT32 r3000_device::get_cop2_creg(int idx) +inline uint32_t r3000_device::get_cop2_creg(int idx) { return m_ccr[2][idx]; } -inline void r3000_device::set_cop2_creg(int idx, UINT32 val) +inline void r3000_device::set_cop2_creg(int idx, uint32_t val) { m_ccr[2][idx] = val; } @@ -926,22 +926,22 @@ inline void r3000_device::handle_cop2() COP3 (CUSTOM) EXECUTION HANDLING ***************************************************************************/ -inline UINT32 r3000_device::get_cop3_reg(int idx) +inline uint32_t r3000_device::get_cop3_reg(int idx) { return m_cpr[3][idx]; } -inline void r3000_device::set_cop3_reg(int idx, UINT32 val) +inline void r3000_device::set_cop3_reg(int idx, uint32_t val) { m_cpr[3][idx] = val; } -inline UINT32 r3000_device::get_cop3_creg(int idx) +inline uint32_t r3000_device::get_cop3_creg(int idx) { return m_ccr[3][idx]; } -inline void r3000_device::set_cop3_creg(int idx, UINT32 val) +inline void r3000_device::set_cop3_creg(int idx, uint32_t val) { m_ccr[3][idx] = val; } @@ -997,7 +997,7 @@ inline void r3000_device::handle_cop3() // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 r3000_device::execute_min_cycles() const +uint32_t r3000_device::execute_min_cycles() const { return 1; } @@ -1008,7 +1008,7 @@ UINT32 r3000_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 r3000_device::execute_max_cycles() const +uint32_t r3000_device::execute_max_cycles() const { return 40; } @@ -1019,7 +1019,7 @@ UINT32 r3000_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 r3000_device::execute_input_lines() const +uint32_t r3000_device::execute_input_lines() const { return 6; } @@ -1051,7 +1051,7 @@ void r3000_device::execute_run() // core execution loop do { - UINT64 temp64; + uint64_t temp64; int temp; // debugging @@ -1078,10 +1078,10 @@ void r3000_device::execute_run() { case 0x00: /* SLL */ if (RDREG) RDVAL = RTVAL << SHIFT; break; case 0x02: /* SRL */ if (RDREG) RDVAL = RTVAL >> SHIFT; break; - case 0x03: /* SRA */ if (RDREG) RDVAL = (INT32)RTVAL >> SHIFT; break; + case 0x03: /* SRA */ if (RDREG) RDVAL = (int32_t)RTVAL >> SHIFT; break; case 0x04: /* SLLV */ if (RDREG) RDVAL = RTVAL << (RSVAL & 31); break; case 0x06: /* SRLV */ if (RDREG) RDVAL = RTVAL >> (RSVAL & 31); break; - case 0x07: /* SRAV */ if (RDREG) RDVAL = (INT32)RTVAL >> (RSVAL & 31); break; + case 0x07: /* SRAV */ if (RDREG) RDVAL = (int32_t)RTVAL >> (RSVAL & 31); break; case 0x08: /* JR */ SETPC(RSVAL); break; case 0x09: /* JALR */ SETPCL(RSVAL, RDREG); break; case 0x0c: /* SYSCALL */ generate_exception(EXCEPTION_SYSCALL); break; @@ -1092,22 +1092,22 @@ void r3000_device::execute_run() case 0x12: /* MFLO */ if (RDREG) RDVAL = m_lo; break; case 0x13: /* MTLO */ m_lo = RSVAL; break; case 0x18: /* MULT */ - temp64 = (INT64)(INT32)RSVAL * (INT64)(INT32)RTVAL; - m_lo = (UINT32)temp64; - m_hi = (UINT32)(temp64 >> 32); + temp64 = (int64_t)(int32_t)RSVAL * (int64_t)(int32_t)RTVAL; + m_lo = (uint32_t)temp64; + m_hi = (uint32_t)(temp64 >> 32); m_icount -= 11; break; case 0x19: /* MULTU */ - temp64 = (UINT64)RSVAL * (UINT64)RTVAL; - m_lo = (UINT32)temp64; - m_hi = (UINT32)(temp64 >> 32); + temp64 = (uint64_t)RSVAL * (uint64_t)RTVAL; + m_lo = (uint32_t)temp64; + m_hi = (uint32_t)(temp64 >> 32); m_icount -= 11; break; case 0x1a: /* DIV */ if (RTVAL) { - m_lo = (INT32)RSVAL / (INT32)RTVAL; - m_hi = (INT32)RSVAL % (INT32)RTVAL; + m_lo = (int32_t)RSVAL / (int32_t)RTVAL; + m_hi = (int32_t)RSVAL % (int32_t)RTVAL; } m_icount -= 34; break; @@ -1133,8 +1133,8 @@ void r3000_device::execute_run() case 0x25: /* OR */ if (RDREG) RDVAL = RSVAL | RTVAL; break; case 0x26: /* XOR */ if (RDREG) RDVAL = RSVAL ^ RTVAL; break; case 0x27: /* NOR */ if (RDREG) RDVAL = ~(RSVAL | RTVAL); break; - case 0x2a: /* SLT */ if (RDREG) RDVAL = (INT32)RSVAL < (INT32)RTVAL; break; - case 0x2b: /* SLTU */ if (RDREG) RDVAL = (UINT32)RSVAL < (UINT32)RTVAL; break; + case 0x2a: /* SLT */ if (RDREG) RDVAL = (int32_t)RSVAL < (int32_t)RTVAL; break; + case 0x2b: /* SLTU */ if (RDREG) RDVAL = (uint32_t)RSVAL < (uint32_t)RTVAL; break; case 0x30: /* TEQ */ invalid_instruction(); break; case 0x31: /* TGEU */ invalid_instruction(); break; case 0x32: /* TLT */ invalid_instruction(); break; @@ -1148,8 +1148,8 @@ void r3000_device::execute_run() case 0x01: /* REGIMM */ switch (RTREG) { - case 0x00: /* BLTZ */ if ((INT32)RSVAL < 0) ADDPC(SIMMVAL); break; - case 0x01: /* BGEZ */ if ((INT32)RSVAL >= 0) ADDPC(SIMMVAL); break; + case 0x00: /* BLTZ */ if ((int32_t)RSVAL < 0) ADDPC(SIMMVAL); break; + case 0x01: /* BGEZ */ if ((int32_t)RSVAL >= 0) ADDPC(SIMMVAL); break; case 0x02: /* BLTZL */ invalid_instruction(); break; case 0x03: /* BGEZL */ invalid_instruction(); break; case 0x08: /* TGEI */ invalid_instruction(); break; @@ -1158,8 +1158,8 @@ void r3000_device::execute_run() case 0x0b: /* TLTIU */ invalid_instruction(); break; case 0x0c: /* TEQI */ invalid_instruction(); break; case 0x0e: /* TNEI */ invalid_instruction(); break; - case 0x10: /* BLTZAL */ if ((INT32)RSVAL < 0) ADDPCL(SIMMVAL,31); break; - case 0x11: /* BGEZAL */ if ((INT32)RSVAL >= 0) ADDPCL(SIMMVAL,31); break; + case 0x10: /* BLTZAL */ if ((int32_t)RSVAL < 0) ADDPCL(SIMMVAL,31); break; + case 0x11: /* BGEZAL */ if ((int32_t)RSVAL >= 0) ADDPCL(SIMMVAL,31); break; case 0x12: /* BLTZALL */ invalid_instruction(); break; case 0x13: /* BGEZALL */ invalid_instruction(); break; default: /* ??? */ invalid_instruction(); break; @@ -1170,15 +1170,15 @@ void r3000_device::execute_run() case 0x03: /* JAL */ ABSPCL(LIMMVAL,31); break; case 0x04: /* BEQ */ if (RSVAL == RTVAL) ADDPC(SIMMVAL); break; case 0x05: /* BNE */ if (RSVAL != RTVAL) ADDPC(SIMMVAL); break; - case 0x06: /* BLEZ */ if ((INT32)RSVAL <= 0) ADDPC(SIMMVAL); break; - case 0x07: /* BGTZ */ if ((INT32)RSVAL > 0) ADDPC(SIMMVAL); break; + case 0x06: /* BLEZ */ if ((int32_t)RSVAL <= 0) ADDPC(SIMMVAL); break; + case 0x07: /* BGTZ */ if ((int32_t)RSVAL > 0) ADDPC(SIMMVAL); break; case 0x08: /* ADDI */ if (ENABLE_OVERFLOWS && RSVAL > ~SIMMVAL) generate_exception(EXCEPTION_OVERFLOW); else if (RTREG) RTVAL = RSVAL + SIMMVAL; break; case 0x09: /* ADDIU */ if (RTREG) RTVAL = RSVAL + SIMMVAL; break; - case 0x0a: /* SLTI */ if (RTREG) RTVAL = (INT32)RSVAL < (INT32)SIMMVAL; break; - case 0x0b: /* SLTIU */ if (RTREG) RTVAL = (UINT32)RSVAL < (UINT32)SIMMVAL; break; + case 0x0a: /* SLTI */ if (RTREG) RTVAL = (int32_t)RSVAL < (int32_t)SIMMVAL; break; + case 0x0b: /* SLTIU */ if (RTREG) RTVAL = (uint32_t)RSVAL < (uint32_t)SIMMVAL; break; case 0x0c: /* ANDI */ if (RTREG) RTVAL = RSVAL & UIMMVAL; break; case 0x0d: /* ORI */ if (RTREG) RTVAL = RSVAL | UIMMVAL; break; case 0x0e: /* XORI */ if (RTREG) RTVAL = RSVAL ^ UIMMVAL; break; @@ -1191,12 +1191,12 @@ void r3000_device::execute_run() case 0x15: /* BNEL */ invalid_instruction(); break; case 0x16: /* BLEZL */ invalid_instruction(); break; case 0x17: /* BGTZL */ invalid_instruction(); break; - case 0x20: /* LB */ temp = RBYTE(SIMMVAL+RSVAL); if (RTREG) RTVAL = (INT8)temp; break; - case 0x21: /* LH */ temp = RWORD(SIMMVAL+RSVAL); if (RTREG) RTVAL = (INT16)temp; break; + case 0x20: /* LB */ temp = RBYTE(SIMMVAL+RSVAL); if (RTREG) RTVAL = (int8_t)temp; break; + case 0x21: /* LH */ temp = RWORD(SIMMVAL+RSVAL); if (RTREG) RTVAL = (int16_t)temp; break; case 0x22: /* LWL */ (*this.*m_lwl)(); break; case 0x23: /* LW */ temp = RLONG(SIMMVAL+RSVAL); if (RTREG) RTVAL = temp; break; - case 0x24: /* LBU */ temp = RBYTE(SIMMVAL+RSVAL); if (RTREG) RTVAL = (UINT8)temp; break; - case 0x25: /* LHU */ temp = RWORD(SIMMVAL+RSVAL); if (RTREG) RTVAL = (UINT16)temp; break; + case 0x24: /* LBU */ temp = RBYTE(SIMMVAL+RSVAL); if (RTREG) RTVAL = (uint8_t)temp; break; + case 0x25: /* LHU */ temp = RWORD(SIMMVAL+RSVAL); if (RTREG) RTVAL = (uint16_t)temp; break; case 0x26: /* LWR */ (*this.*m_lwr)(); break; case 0x28: /* SB */ WBYTE(SIMMVAL+RSVAL, RTVAL); break; case 0x29: /* SH */ WWORD(SIMMVAL+RSVAL, RTVAL); break; @@ -1238,7 +1238,7 @@ void r3000_device::execute_run() void r3000_device::lwl_be() { offs_t offs = SIMMVAL + RSVAL; - UINT32 temp = RLONG(offs & ~3); + uint32_t temp = RLONG(offs & ~3); if (RTREG) { if (!(offs & 3)) RTVAL = temp; @@ -1253,7 +1253,7 @@ void r3000_device::lwl_be() void r3000_device::lwr_be() { offs_t offs = SIMMVAL + RSVAL; - UINT32 temp = RLONG(offs & ~3); + uint32_t temp = RLONG(offs & ~3); if (RTREG) { if ((offs & 3) == 3) RTVAL = temp; @@ -1271,7 +1271,7 @@ void r3000_device::swl_be() if (!(offs & 3)) WLONG(offs, RTVAL); else { - UINT32 temp = RLONG(offs & ~3); + uint32_t temp = RLONG(offs & ~3); int shift = 8 * (offs & 3); WLONG(offs & ~3, (temp & (0xffffff00 << (24 - shift))) | (RTVAL >> shift)); } @@ -1284,7 +1284,7 @@ void r3000_device::swr_be() if ((offs & 3) == 3) WLONG(offs & ~3, RTVAL); else { - UINT32 temp = RLONG(offs & ~3); + uint32_t temp = RLONG(offs & ~3); int shift = 8 * (offs & 3); WLONG(offs & ~3, (temp & (0x00ffffff >> shift)) | (RTVAL << (24 - shift))); } @@ -1295,7 +1295,7 @@ void r3000_device::swr_be() void r3000_device::lwl_le() { offs_t offs = SIMMVAL + RSVAL; - UINT32 temp = RLONG(offs & ~3); + uint32_t temp = RLONG(offs & ~3); if (RTREG) { if (!(offs & 3)) RTVAL = temp; @@ -1310,7 +1310,7 @@ void r3000_device::lwl_le() void r3000_device::lwr_le() { offs_t offs = SIMMVAL + RSVAL; - UINT32 temp = RLONG(offs & ~3); + uint32_t temp = RLONG(offs & ~3); if (RTREG) { if ((offs & 3) == 3) RTVAL = temp; @@ -1328,7 +1328,7 @@ void r3000_device::swl_le() if (!(offs & 3)) WLONG(offs, RTVAL); else { - UINT32 temp = RLONG(offs & ~3); + uint32_t temp = RLONG(offs & ~3); int shift = 8 * (offs & 3); WLONG(offs & ~3, (temp & (0x00ffffff >> (24 - shift))) | (RTVAL << shift)); } @@ -1340,7 +1340,7 @@ void r3000_device::swr_le() if ((offs & 3) == 3) WLONG(offs & ~3, RTVAL); else { - UINT32 temp = RLONG(offs & ~3); + uint32_t temp = RLONG(offs & ~3); int shift = 8 * (offs & 3); WLONG(offs & ~3, (temp & (0xffffff00 << shift)) | (RTVAL >> (24 - shift))); } diff --git a/src/devices/cpu/mips/r3000.h b/src/devices/cpu/mips/r3000.h index a7541eaab85..138e6fc2a6f 100644 --- a/src/devices/cpu/mips/r3000.h +++ b/src/devices/cpu/mips/r3000.h @@ -77,7 +77,7 @@ protected: }; // construction/destruction - r3000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, chip_type chiptype, const char *shortname, const char *source); + r3000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, chip_type chiptype, const char *shortname, const char *source); virtual ~r3000_device(); public: @@ -114,9 +114,9 @@ protected: virtual void device_post_load() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -129,42 +129,42 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // memory accessors struct r3000_data_accessors { - UINT8 (r3000_device::*m_read_byte)(offs_t byteaddress); - UINT16 (r3000_device::*m_read_word)(offs_t byteaddress); - UINT32 (r3000_device::*m_read_dword)(offs_t byteaddress); - void (r3000_device::*m_write_byte)(offs_t byteaddress, UINT8 data); - void (r3000_device::*m_write_word)(offs_t byteaddress, UINT16 data); - void (r3000_device::*m_write_dword)(offs_t byteaddress, UINT32 data); + uint8_t (r3000_device::*m_read_byte)(offs_t byteaddress); + uint16_t (r3000_device::*m_read_word)(offs_t byteaddress); + uint32_t (r3000_device::*m_read_dword)(offs_t byteaddress); + void (r3000_device::*m_write_byte)(offs_t byteaddress, uint8_t data); + void (r3000_device::*m_write_word)(offs_t byteaddress, uint16_t data); + void (r3000_device::*m_write_dword)(offs_t byteaddress, uint32_t data); }; - UINT32 readop(offs_t pc); - UINT8 readmem(offs_t offset); - UINT16 readmem_word(offs_t offset); - UINT32 readmem_dword(offs_t offset); - void writemem(offs_t offset, UINT8 data); - void writemem_word(offs_t offset, UINT16 data); - void writemem_dword(offs_t offset, UINT32 data); - - UINT8 readcache_be(offs_t offset); - UINT16 readcache_be_word(offs_t offset); - UINT32 readcache_be_dword(offs_t offset); - void writecache_be(offs_t offset, UINT8 data); - void writecache_be_word(offs_t offset, UINT16 data); - void writecache_be_dword(offs_t offset, UINT32 data); - - UINT8 readcache_le(offs_t offset); - UINT16 readcache_le_word(offs_t offset); - UINT32 readcache_le_dword(offs_t offset); - void writecache_le(offs_t offset, UINT8 data); - void writecache_le_word(offs_t offset, UINT16 data); - void writecache_le_dword(offs_t offset, UINT32 data); + uint32_t readop(offs_t pc); + uint8_t readmem(offs_t offset); + uint16_t readmem_word(offs_t offset); + uint32_t readmem_dword(offs_t offset); + void writemem(offs_t offset, uint8_t data); + void writemem_word(offs_t offset, uint16_t data); + void writemem_dword(offs_t offset, uint32_t data); + + uint8_t readcache_be(offs_t offset); + uint16_t readcache_be_word(offs_t offset); + uint32_t readcache_be_dword(offs_t offset); + void writecache_be(offs_t offset, uint8_t data); + void writecache_be_word(offs_t offset, uint16_t data); + void writecache_be_dword(offs_t offset, uint32_t data); + + uint8_t readcache_le(offs_t offset); + uint16_t readcache_le_word(offs_t offset); + uint32_t readcache_le_dword(offs_t offset); + void writecache_le(offs_t offset, uint8_t data); + void writecache_le_word(offs_t offset, uint16_t data); + void writecache_le_dword(offs_t offset, uint32_t data); // interrupts void generate_exception(int exception); @@ -173,28 +173,28 @@ protected: void invalid_instruction(); // instructions - UINT32 get_cop0_reg(int idx); - void set_cop0_reg(int idx, UINT32 val); - UINT32 get_cop0_creg(int idx); - void set_cop0_creg(int idx, UINT32 val); + uint32_t get_cop0_reg(int idx); + void set_cop0_reg(int idx, uint32_t val); + uint32_t get_cop0_creg(int idx); + void set_cop0_creg(int idx, uint32_t val); void handle_cop0(); - UINT32 get_cop1_reg(int idx); - void set_cop1_reg(int idx, UINT32 val); - UINT32 get_cop1_creg(int idx); - void set_cop1_creg(int idx, UINT32 val); + uint32_t get_cop1_reg(int idx); + void set_cop1_reg(int idx, uint32_t val); + uint32_t get_cop1_creg(int idx); + void set_cop1_creg(int idx, uint32_t val); void handle_cop1(); - UINT32 get_cop2_reg(int idx); - void set_cop2_reg(int idx, UINT32 val); - UINT32 get_cop2_creg(int idx); - void set_cop2_creg(int idx, UINT32 val); + uint32_t get_cop2_reg(int idx); + void set_cop2_reg(int idx, uint32_t val); + uint32_t get_cop2_creg(int idx); + void set_cop2_creg(int idx, uint32_t val); void handle_cop2(); - UINT32 get_cop3_reg(int idx); - void set_cop3_reg(int idx, UINT32 val); - UINT32 get_cop3_creg(int idx); - void set_cop3_creg(int idx, UINT32 val); + uint32_t get_cop3_reg(int idx); + void set_cop3_reg(int idx, uint32_t val); + uint32_t get_cop3_creg(int idx); + void set_cop3_creg(int idx, uint32_t val); void handle_cop3(); // complex opcodes @@ -220,19 +220,19 @@ protected: endianness_t m_endianness; // core registers - UINT32 m_pc; - UINT32 m_nextpc; - UINT32 m_hi; - UINT32 m_lo; - UINT32 m_r[32]; + uint32_t m_pc; + uint32_t m_nextpc; + uint32_t m_hi; + uint32_t m_lo; + uint32_t m_r[32]; // COP registers - UINT32 m_cpr[4][32]; - UINT32 m_ccr[4][32]; + uint32_t m_cpr[4][32]; + uint32_t m_ccr[4][32]; // internal stuff - UINT32 m_ppc; - UINT32 m_op; + uint32_t m_ppc; + uint32_t m_op; int m_icount; int m_interrupt_cycles; @@ -248,9 +248,9 @@ protected: r3000_data_accessors m_cache_hand; // cache memory - UINT32 * m_cache; - std::vector m_icache; - std::vector m_dcache; + uint32_t * m_cache; + std::vector m_icache; + std::vector m_dcache; size_t m_cache_size; size_t m_icache_size; size_t m_dcache_size; @@ -268,7 +268,7 @@ protected: class r3041_device : public r3000_device { public: - r3041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + r3041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -277,7 +277,7 @@ public: class r3051_device : public r3000_device { public: - r3051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + r3051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -286,7 +286,7 @@ public: class r3052_device : public r3000_device { public: - r3052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + r3052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -295,7 +295,7 @@ public: class r3071_device : public r3000_device { public: - r3071_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + r3071_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -304,7 +304,7 @@ public: class r3081_device : public r3000_device { public: - r3081_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + r3081_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/mips/r3kdasm.cpp b/src/devices/cpu/mips/r3kdasm.cpp index 01cf1ad7599..af74627865d 100644 --- a/src/devices/cpu/mips/r3kdasm.cpp +++ b/src/devices/cpu/mips/r3kdasm.cpp @@ -82,7 +82,7 @@ static const char *const ccreg[4][32] = CODE CODE ***************************************************************************/ -static inline char *signed_16bit(INT16 val) +static inline char *signed_16bit(int16_t val) { static char temp[10]; if (val < 0) @@ -92,11 +92,11 @@ static inline char *signed_16bit(INT16 val) return temp; } -static UINT32 dasm_cop(UINT32 pc, int cop, UINT32 op, char *buffer) +static uint32_t dasm_cop(uint32_t pc, int cop, uint32_t op, char *buffer) { int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; - UINT32 flags = 0; + uint32_t flags = 0; switch ((op >> 21) & 31) { @@ -107,8 +107,8 @@ static UINT32 dasm_cop(UINT32 pc, int cop, UINT32 op, char *buffer) case 0x08: /* BC */ switch (rt) { - case 0x00: sprintf(buffer, "bc%df $%08x", cop, pc + 4 + ((INT16)op << 2)); break; - case 0x01: sprintf(buffer, "bc%dt $%08x", cop, pc + 4 + ((INT16)op << 2)); break; + case 0x00: sprintf(buffer, "bc%df $%08x", cop, pc + 4 + ((int16_t)op << 2)); break; + case 0x01: sprintf(buffer, "bc%dt $%08x", cop, pc + 4 + ((int16_t)op << 2)); break; case 0x02: sprintf(buffer, "bc%dfl [invalid]", cop); break; case 0x03: sprintf(buffer, "bc%dtl [invalid]", cop); break; default: sprintf(buffer, "dc.l $%08x [invalid]", op); break; @@ -152,7 +152,7 @@ static UINT32 dasm_cop(UINT32 pc, int cop, UINT32 op, char *buffer) return flags; } -static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer) +static uint32_t dasm_cop1(uint32_t pc, uint32_t op, char *buffer) { static const char *const format_table[] = { @@ -165,7 +165,7 @@ static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer) int fd = (op >> 6) & 31; int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; - UINT32 flags = 0; + uint32_t flags = 0; switch ((op >> 21) & 31) { @@ -178,10 +178,10 @@ static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer) case 0x08: /* BC */ switch (rt & 3) { - case 0x00: sprintf(buffer, "bc1f $%08x,%d", pc + 4 + ((INT16)op << 2), (op >> 18) & 7); break; - case 0x01: sprintf(buffer, "bc1t $%08x,%d", pc + 4 + ((INT16)op << 2), (op >> 18) & 7); break; - case 0x02: sprintf(buffer, "bc1fl $%08x,%d", pc + 4 + ((INT16)op << 2), (op >> 18) & 7); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; - case 0x03: sprintf(buffer, "bc1tl $%08x,%d", pc + 4 + ((INT16)op << 2), (op >> 18) & 7); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x00: sprintf(buffer, "bc1f $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); break; + case 0x01: sprintf(buffer, "bc1t $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); break; + case 0x02: sprintf(buffer, "bc1fl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x03: sprintf(buffer, "bc1tl $%08x,%d", pc + 4 + ((int16_t)op << 2), (op >> 18) & 7); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; } break; default: /* COP */ @@ -235,13 +235,13 @@ static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer) return flags; } -static unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) +static unsigned dasmr3k(char *buffer, unsigned pc, uint32_t op) { int rs = (op >> 21) & 31; int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; int shift = (op >> 6) & 31; - UINT32 flags = 0; + uint32_t flags = 0; switch (op >> 26) { @@ -299,8 +299,8 @@ static unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) case 0x01: /* REGIMM */ switch ((op >> 16) & 31) { - case 0x00: sprintf(buffer, "bltz %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; - case 0x01: sprintf(buffer, "bgez %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; + case 0x00: sprintf(buffer, "bltz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x01: sprintf(buffer, "bgez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; case 0x02: sprintf(buffer, "bltzl [invalid]"); break; case 0x03: sprintf(buffer, "bgezl [invalid]"); break; case 0x08: sprintf(buffer, "tgei [invalid]"); break; @@ -309,8 +309,8 @@ static unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) case 0x0b: sprintf(buffer, "tltiu [invalid]"); break; case 0x0c: sprintf(buffer, "teqi [invalid]"); break; case 0x0e: sprintf(buffer, "tnei [invalid]"); break; - case 0x10: sprintf(buffer, "bltzal %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; - case 0x11: sprintf(buffer, "bgezal %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x10: sprintf(buffer, "bltzal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; + case 0x11: sprintf(buffer, "bgezal %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; case 0x12: sprintf(buffer, "bltzall [invalid]"); break; case 0x13: sprintf(buffer, "bgezall [invalid]"); break; default: sprintf(buffer, "dc.l $%08x [invalid]", op); break; @@ -320,21 +320,21 @@ static unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) case 0x02: sprintf(buffer, "j $%08x", (pc & 0xf0000000) | ((op & 0x0fffffff) << 2)); break; case 0x03: sprintf(buffer, "jal $%08x", (pc & 0xf0000000) | ((op & 0x0fffffff) << 2)); flags = DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); break; case 0x04: if (rs == 0 && rt == 0) - sprintf(buffer, "b $%08x", pc + 4 + ((INT16)op << 2)); + sprintf(buffer, "b $%08x", pc + 4 + ((int16_t)op << 2)); else - sprintf(buffer, "beq %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2)); + sprintf(buffer, "beq %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2)); break; - case 0x05: sprintf(buffer, "bne %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((INT16)op << 2));break; - case 0x06: sprintf(buffer, "blez %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; - case 0x07: sprintf(buffer, "bgtz %s,$%08x", reg[rs], pc + 4 + ((INT16)op << 2)); break; + case 0x05: sprintf(buffer, "bne %s,%s,$%08x", reg[rs], reg[rt], pc + 4 + ((int16_t)op << 2));break; + case 0x06: sprintf(buffer, "blez %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x07: sprintf(buffer, "bgtz %s,$%08x", reg[rs], pc + 4 + ((int16_t)op << 2)); break; case 0x08: sprintf(buffer, "addi %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x09: sprintf(buffer, "addiu %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x0a: sprintf(buffer, "slti %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; case 0x0b: sprintf(buffer, "sltiu %s,%s,%s", reg[rt], reg[rs], signed_16bit(op)); break; - case 0x0c: sprintf(buffer, "andi %s,%s,$%04x", reg[rt], reg[rs], (UINT16)op); break; - case 0x0d: sprintf(buffer, "ori %s,%s,$%04x", reg[rt], reg[rs], (UINT16)op); break; - case 0x0e: sprintf(buffer, "xori %s,%s,$%04x", reg[rt], reg[rs], (UINT16)op); break; - case 0x0f: sprintf(buffer, "lui %s,$%04x", reg[rt], (UINT16)op); break; + case 0x0c: sprintf(buffer, "andi %s,%s,$%04x", reg[rt], reg[rs], (uint16_t)op); break; + case 0x0d: sprintf(buffer, "ori %s,%s,$%04x", reg[rt], reg[rs], (uint16_t)op); break; + case 0x0e: sprintf(buffer, "xori %s,%s,$%04x", reg[rt], reg[rs], (uint16_t)op); break; + case 0x0f: sprintf(buffer, "lui %s,$%04x", reg[rt], (uint16_t)op); break; case 0x10: flags = dasm_cop(pc, 0, op, buffer); break; case 0x11: flags = dasm_cop1(pc, op, buffer); break; case 0x12: flags = dasm_cop(pc, 2, op, buffer); break; @@ -380,7 +380,7 @@ static unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) CPU_DISASSEMBLE( r3000be ) { - UINT32 op = *(UINT32 *)oprom; + uint32_t op = *(uint32_t *)oprom; op = big_endianize_int32(op); return dasmr3k(buffer, pc, op); } @@ -388,7 +388,7 @@ CPU_DISASSEMBLE( r3000be ) CPU_DISASSEMBLE( r3000le ) { - UINT32 op = *(UINT32 *)oprom; + uint32_t op = *(uint32_t *)oprom; op = little_endianize_int32(op); return dasmr3k(buffer, pc, op); } diff --git a/src/devices/cpu/mn10200/mn10200.cpp b/src/devices/cpu/mn10200/mn10200.cpp index 604b73c0cbf..6f43d7f3f13 100644 --- a/src/devices/cpu/mn10200/mn10200.cpp +++ b/src/devices/cpu/mn10200/mn10200.cpp @@ -45,7 +45,7 @@ ADDRESS_MAP_END // device definitions -mn1020012a_device::mn1020012a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mn1020012a_device::mn1020012a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mn10200_device(mconfig, MN1020012A, "MN1020012A", tag, owner, clock, ADDRESS_MAP_NAME(mn1020012a_internal_map), "mn1020012a", __FILE__) { } @@ -72,7 +72,7 @@ void mn10200_device::state_string_export(const device_state_entry &entry, std::s } } -offs_t mn10200_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t mn10200_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( mn10200 ); return CPU_DISASSEMBLE_NAME(mn10200)(this, buffer, pc, oprom, opram, options); @@ -328,7 +328,7 @@ void mn10200_device::check_ext_irq() void mn10200_device::execute_set_input(int irqnum, int state) { // take an external IRQ - assert(((UINT32)irqnum) < MN10200_MAX_EXT_IRQ); + assert(((uint32_t)irqnum) < MN10200_MAX_EXT_IRQ); int pin = state ? 0 : 1; int old = m_p4 >> irqnum & 1; @@ -449,15 +449,15 @@ TIMER_CALLBACK_MEMBER( mn10200_device::simple_timer_cb ) // opcode helpers //------------------------------------------------- -void mn10200_device::illegal(UINT8 prefix, UINT8 op) +void mn10200_device::illegal(uint8_t prefix, uint8_t op) { logerror("MN10200: illegal opcode %x %x @ PC=%x\n", prefix, op, m_pc); m_nmicr |= 2; } -UINT32 mn10200_device::do_add(UINT32 a, UINT32 b, UINT32 c) +uint32_t mn10200_device::do_add(uint32_t a, uint32_t b, uint32_t c) { - UINT32 r = (a & 0xffffff) + (b & 0xffffff) + c; + uint32_t r = (a & 0xffffff) + (b & 0xffffff) + c; m_psw &= 0xff00; if ((a^r) & (b^r) & 0x00800000) @@ -480,9 +480,9 @@ UINT32 mn10200_device::do_add(UINT32 a, UINT32 b, UINT32 c) return r; } -UINT32 mn10200_device::do_sub(UINT32 a, UINT32 b, UINT32 c) +uint32_t mn10200_device::do_sub(uint32_t a, uint32_t b, uint32_t c) { - UINT32 r = (a & 0xffffff) - (b & 0xffffff) - c; + uint32_t r = (a & 0xffffff) - (b & 0xffffff) - c; m_psw &= 0xff00; if ((a^b) & (a^r) & 0x00800000) @@ -505,7 +505,7 @@ UINT32 mn10200_device::do_sub(UINT32 a, UINT32 b, UINT32 c) return r; } -void mn10200_device::test_nz16(UINT16 v) +void mn10200_device::test_nz16(uint16_t v) { m_psw &= 0xfff0; if (v & 0x8000) @@ -514,7 +514,7 @@ void mn10200_device::test_nz16(UINT16 v) m_psw |= FLAG_ZF; } -void mn10200_device::do_jsr(UINT32 to, UINT32 ret) +void mn10200_device::do_jsr(uint32_t to, uint32_t ret) { m_a[3] -= 4; write_mem24(m_a[3], ret); @@ -526,7 +526,7 @@ void mn10200_device::do_branch(int condition) if (condition) { m_cycles -= 1; - change_pc(m_pc + (INT8)read_arg8(m_pc)); + change_pc(m_pc + (int8_t)read_arg8(m_pc)); } } @@ -550,7 +550,7 @@ void mn10200_device::execute_run() debugger_instruction_hook(this, m_pc); m_cycles -= 1; - UINT8 op = read_arg8(m_pc); + uint8_t op = read_arg8(m_pc); m_pc += 1; // main opcodes @@ -571,7 +571,7 @@ void mn10200_device::execute_run() // mov (an), dm case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: - m_d[op&3] = (INT16)read_mem16(m_a[op>>2&3]); + m_d[op&3] = (int16_t)read_mem16(m_a[op>>2&3]); break; // movbu (an), dm @@ -583,7 +583,7 @@ void mn10200_device::execute_run() // mov dm, (d8, an) case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: - write_mem16((m_a[op>>2&3] + (INT8)read_arg8(m_pc)), m_d[op&3]); + write_mem16((m_a[op>>2&3] + (int8_t)read_arg8(m_pc)), m_d[op&3]); m_pc += 1; break; @@ -591,14 +591,14 @@ void mn10200_device::execute_run() case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: m_cycles -= 1; - write_mem24((m_a[op>>2&3] + (INT8)read_arg8(m_pc)), m_a[op&3]); + write_mem24((m_a[op>>2&3] + (int8_t)read_arg8(m_pc)), m_a[op&3]); m_pc += 1; break; // mov (d8, an), dm case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: - m_d[op&3] = (INT16)read_mem16(m_a[op>>2&3] + (INT8)read_arg8(m_pc)); + m_d[op&3] = (int16_t)read_mem16(m_a[op>>2&3] + (int8_t)read_arg8(m_pc)); m_pc += 1; break; @@ -606,7 +606,7 @@ void mn10200_device::execute_run() case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: m_cycles -= 1; - m_a[op&3] = read_mem24(m_a[op>>2&3] + (INT8)read_arg8(m_pc)); + m_a[op&3] = read_mem24(m_a[op>>2&3] + (int8_t)read_arg8(m_pc)); m_pc += 1; break; @@ -618,7 +618,7 @@ void mn10200_device::execute_run() // mov imm8, dn case 0x80: case 0x85: case 0x8a: case 0x8f: - m_d[op&3] = (INT8)read_arg8(m_pc); + m_d[op&3] = (int8_t)read_arg8(m_pc); m_pc += 1; break; @@ -636,22 +636,22 @@ void mn10200_device::execute_run() // extx dn case 0xb0: case 0xb1: case 0xb2: case 0xb3: - m_d[op&3] = (INT16)m_d[op&3]; + m_d[op&3] = (int16_t)m_d[op&3]; break; // extxu dn case 0xb4: case 0xb5: case 0xb6: case 0xb7: - m_d[op&3] = (UINT16)m_d[op&3]; + m_d[op&3] = (uint16_t)m_d[op&3]; break; // extxb dn case 0xb8: case 0xb9: case 0xba: case 0xbb: - m_d[op&3] = (INT8)m_d[op&3]; + m_d[op&3] = (int8_t)m_d[op&3]; break; // extxbu dn case 0xbc: case 0xbd: case 0xbe: case 0xbf: - m_d[op&3] = (UINT8)m_d[op&3]; + m_d[op&3] = (uint8_t)m_d[op&3]; break; // mov dn, (abs16) @@ -668,7 +668,7 @@ void mn10200_device::execute_run() // mov (abs16), dn case 0xc8: case 0xc9: case 0xca: case 0xcb: - m_d[op&3] = (INT16)read_mem16(read_arg16(m_pc)); + m_d[op&3] = (int16_t)read_mem16(read_arg16(m_pc)); m_pc += 2; break; @@ -680,19 +680,19 @@ void mn10200_device::execute_run() // add imm8, an case 0xd0: case 0xd1: case 0xd2: case 0xd3: - m_a[op&3] = do_add(m_a[op&3], (INT8)read_arg8(m_pc)); + m_a[op&3] = do_add(m_a[op&3], (int8_t)read_arg8(m_pc)); m_pc += 1; break; // add imm8, dn case 0xd4: case 0xd5: case 0xd6: case 0xd7: - m_d[op&3] = do_add(m_d[op&3], (INT8)read_arg8(m_pc)); + m_d[op&3] = do_add(m_d[op&3], (int8_t)read_arg8(m_pc)); m_pc += 1; break; // cmp imm8, dn case 0xd8: case 0xd9: case 0xda: case 0xdb: - do_sub(m_d[op&3], (INT8)read_arg8(m_pc)); + do_sub(m_d[op&3], (int8_t)read_arg8(m_pc)); m_pc += 1; break; @@ -789,20 +789,20 @@ void mn10200_device::execute_run() // mov imm16, dn case 0xf8: case 0xf9: case 0xfa: case 0xfb: - m_d[op&3] = (INT16)read_arg16(m_pc); + m_d[op&3] = (int16_t)read_arg16(m_pc); m_pc += 2; break; // jmp label16 case 0xfc: m_cycles -= 1; - change_pc(m_pc + 2 + (INT16)read_arg16(m_pc)); + change_pc(m_pc + 2 + (int16_t)read_arg16(m_pc)); break; // jsr label16 case 0xfd: m_cycles -= 3; - do_jsr(m_pc + 2 + (INT16)read_arg16(m_pc), m_pc + 2); + do_jsr(m_pc + 2 + (int16_t)read_arg16(m_pc), m_pc + 2); break; // rts @@ -844,7 +844,7 @@ void mn10200_device::execute_run() case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: { m_cycles -= 3; - UINT8 v = read_mem8(m_a[op>>2&3]); + uint8_t v = read_mem8(m_a[op>>2&3]); test_nz16(v & m_d[op&3]); write_mem8(m_a[op>>2&3], v | m_d[op&3]); break; @@ -855,7 +855,7 @@ void mn10200_device::execute_run() case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: { m_cycles -= 3; - UINT8 v = read_mem8(m_a[op>>2&3]); + uint8_t v = read_mem8(m_a[op>>2&3]); test_nz16(v & m_d[op&3]); write_mem8(m_a[op>>2&3], v & ~m_d[op&3]); break; @@ -870,7 +870,7 @@ void mn10200_device::execute_run() case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: - m_d[op&3] = (INT8)read_mem8(m_a[op>>2&3] + m_d[op>>4&3]); + m_d[op&3] = (int8_t)read_mem8(m_a[op>>2&3] + m_d[op>>4&3]); break; // movbu (di, an), dm @@ -922,7 +922,7 @@ void mn10200_device::execute_run() // mov (di, an), dm case 0x40: - m_d[op&3] = (INT16)read_mem16(m_a[op>>2&3] + m_d[op>>4&3]); + m_d[op&3] = (int16_t)read_mem16(m_a[op>>2&3] + m_d[op>>4&3]); break; // mov am, (di, an) @@ -991,7 +991,7 @@ void mn10200_device::execute_run() // addc dn, dm case 0x80: { - UINT16 mask0 = ~FLAG_ZF | (m_psw & FLAG_ZF); + uint16_t mask0 = ~FLAG_ZF | (m_psw & FLAG_ZF); m_d[op&3] = do_add(m_d[op&3], m_d[op>>2&3], (m_psw & FLAG_CF) ? 1 : 0); m_psw &= mask0; // ZF can only be set if it was set before the operation break; @@ -1000,7 +1000,7 @@ void mn10200_device::execute_run() // subc dn, dm case 0x90: { - UINT16 mask0 = ~FLAG_ZF | (m_psw & FLAG_ZF); + uint16_t mask0 = ~FLAG_ZF | (m_psw & FLAG_ZF); m_d[op&3] = do_sub(m_d[op&3], m_d[op>>2&3], (m_psw & FLAG_CF) ? 1 : 0); m_psw &= mask0; // ZF can only be set if it was set before the operation break; @@ -1064,7 +1064,7 @@ void mn10200_device::execute_run() // rol dn case 0x30: case 0x31: case 0x32: case 0x33: { - UINT32 d = m_d[op&3]; + uint32_t d = m_d[op&3]; test_nz16(m_d[op&3] = (d & 0xff0000) | ((d << 1) & 0x00fffe) | ((m_psw & FLAG_CF) ? 1 : 0)); if (d & 0x8000) m_psw |= FLAG_CF; @@ -1074,7 +1074,7 @@ void mn10200_device::execute_run() // ror dn case 0x34: case 0x35: case 0x36: case 0x37: { - UINT32 d = m_d[op&3]; + uint32_t d = m_d[op&3]; test_nz16(m_d[op&3] = (d & 0xff0000) | ((d >> 1) & 0x007fff) | ((m_psw & FLAG_CF) ? 0x8000 : 0)); if (d & 1) m_psw |= FLAG_CF; @@ -1084,7 +1084,7 @@ void mn10200_device::execute_run() // asr dn case 0x38: case 0x39: case 0x3a: case 0x3b: { - UINT32 d = m_d[op&3]; + uint32_t d = m_d[op&3]; test_nz16(m_d[op&3] = (d & 0xff8000) | ((d >> 1) & 0x007fff)); if (d & 1) m_psw |= FLAG_CF; @@ -1094,7 +1094,7 @@ void mn10200_device::execute_run() // lsr dn case 0x3c: case 0x3d: case 0x3e: case 0x3f: { - UINT32 d = m_d[op&3]; + uint32_t d = m_d[op&3]; test_nz16(m_d[op&3] = (d & 0xff0000) | ((d >> 1) & 0x007fff)); if (d & 1) m_psw |= FLAG_CF; @@ -1106,7 +1106,7 @@ void mn10200_device::execute_run() case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: { m_cycles -= 10; - UINT32 res = ((INT16)m_d[op&3]) * ((INT16)m_d[op>>2&3]); + uint32_t res = ((int16_t)m_d[op&3]) * ((int16_t)m_d[op>>2&3]); m_d[op&3] = res & 0xffffff; m_psw &= 0xff00; // f4 is undefined if (res & 0x80000000) @@ -1122,7 +1122,7 @@ void mn10200_device::execute_run() case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: { m_cycles -= 10; - UINT32 res = ((UINT16)m_d[op&3]) * ((UINT16)m_d[op>>2&3]); + uint32_t res = ((uint16_t)m_d[op&3]) * ((uint16_t)m_d[op>>2&3]); m_d[op&3] = res & 0xffffff; m_psw &= 0xff00; // f4 is undefined if (res & 0x80000000) @@ -1137,12 +1137,12 @@ void mn10200_device::execute_run() case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: { - UINT32 n, d, q, r; + uint32_t n, d, q, r; m_cycles -= 11; m_psw &= 0xff00; // f7 may be undefined - n = (m_mdr << 16) | (UINT16)m_d[op&3]; - d = (UINT16)m_d[op>>2&3]; + n = (m_mdr << 16) | (uint16_t)m_d[op&3]; + d = (uint16_t)m_d[op>>2&3]; if (d == 0) { // divide by 0 @@ -1308,7 +1308,7 @@ void mn10200_device::execute_run() // mov (d24, an), dm case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: - m_d[op&3] = (INT16)read_mem16(m_a[op>>2&3] + read_arg24(m_pc)); + m_d[op&3] = (int16_t)read_mem16(m_a[op>>2&3] + read_arg24(m_pc)); break; // movbu (d24, an), dm @@ -1320,7 +1320,7 @@ void mn10200_device::execute_run() // movb (d24, an), dm case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: - m_d[op&3] = (INT8)read_mem8(m_a[op>>2&3] + read_arg24(m_pc)); + m_d[op&3] = (int8_t)read_mem8(m_a[op>>2&3] + read_arg24(m_pc)); break; // movx (d24, an), dm @@ -1332,12 +1332,12 @@ void mn10200_device::execute_run() // mov (abs24), dn case 0xc0: case 0xc1: case 0xc2: case 0xc3: - m_d[op&3] = (INT16)read_mem16(read_arg24(m_pc)); + m_d[op&3] = (int16_t)read_mem16(read_arg24(m_pc)); break; // movb (abs24), dn case 0xc4: case 0xc5: case 0xc6: case 0xc7: - m_d[op&3] = (INT8)read_mem8(read_arg24(m_pc)); + m_d[op&3] = (int8_t)read_mem8(read_arg24(m_pc)); break; // movbu (abs24), dn @@ -1405,39 +1405,39 @@ void mn10200_device::execute_run() // addnf imm8, an case 0x0c: case 0x0d: case 0x0e: case 0x0f: - m_a[op&3] = m_a[op&3] + (INT8)read_arg8(m_pc); + m_a[op&3] = m_a[op&3] + (int8_t)read_arg8(m_pc); break; // movb dm, (d8, an) case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: - write_mem8(m_a[op>>2&3] + (INT8)read_arg8(m_pc), m_d[op&3]); + write_mem8(m_a[op>>2&3] + (int8_t)read_arg8(m_pc), m_d[op&3]); break; // movb (d8, an), dm case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: - m_d[op&3] = (INT8)read_mem8(m_a[op>>2&3] + (INT8)read_arg8(m_pc)); + m_d[op&3] = (int8_t)read_mem8(m_a[op>>2&3] + (int8_t)read_arg8(m_pc)); break; // movbu (d8, an), dm case 0x30: case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: - m_d[op&3] = read_mem8(m_a[op>>2&3] + (INT8)read_arg8(m_pc)); + m_d[op&3] = read_mem8(m_a[op>>2&3] + (int8_t)read_arg8(m_pc)); break; // movx dm, (d8, an) case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: m_cycles -= 1; - write_mem24(m_a[op>>2&3] + (INT8)read_arg8(m_pc), m_d[op&3]); + write_mem24(m_a[op>>2&3] + (int8_t)read_arg8(m_pc), m_d[op&3]); break; // movx (d8, an), dm case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: m_cycles -= 1; - m_d[op&3] = read_mem24(m_a[op>>2&3] + (INT8)read_arg8(m_pc)); + m_d[op&3] = read_mem24(m_a[op>>2&3] + (int8_t)read_arg8(m_pc)); break; // bltx label8 @@ -1560,12 +1560,12 @@ void mn10200_device::execute_run() // add imm16, an case 0x08: case 0x09: case 0x0a: case 0x0b: - m_a[op&3] = do_add(m_a[op&3], (INT16)read_arg16(m_pc)); + m_a[op&3] = do_add(m_a[op&3], (int16_t)read_arg16(m_pc)); break; // sub imm16, an case 0x0c: case 0x0d: case 0x0e: case 0x0f: - m_a[op&3] = do_sub(m_a[op&3], (INT16)read_arg16(m_pc)); + m_a[op&3] = do_sub(m_a[op&3], (int16_t)read_arg16(m_pc)); break; // and imm16, psw @@ -1583,12 +1583,12 @@ void mn10200_device::execute_run() // add imm16, dn case 0x18: case 0x19: case 0x1a: case 0x1b: - m_d[op&3] = do_add(m_d[op&3], (INT16)read_arg16(m_pc)); + m_d[op&3] = do_add(m_d[op&3], (int16_t)read_arg16(m_pc)); break; // sub imm16, dn case 0x1c: case 0x1d: case 0x1e: case 0x1f: - m_d[op&3] = do_sub(m_d[op&3], (INT16)read_arg16(m_pc)); + m_d[op&3] = do_sub(m_d[op&3], (int16_t)read_arg16(m_pc)); break; // mov an, (abs16) @@ -1610,7 +1610,7 @@ void mn10200_device::execute_run() // cmp imm16, dn case 0x48: case 0x49: case 0x4a: case 0x4b: - do_sub(m_d[op&3], (INT16)read_arg16(m_pc)); + do_sub(m_d[op&3], (int16_t)read_arg16(m_pc)); break; // xor imm16, dn @@ -1621,59 +1621,59 @@ void mn10200_device::execute_run() // movbu (d16, an), dm case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: - m_d[op&3] = read_mem8(m_a[op>>2&3] + (INT16)read_arg16(m_pc)); + m_d[op&3] = read_mem8(m_a[op>>2&3] + (int16_t)read_arg16(m_pc)); break; // movx dm, (d16, an) case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: m_cycles -= 1; - write_mem24(m_a[op>>2&3] + (INT16)read_arg16(m_pc), m_d[op&3]); + write_mem24(m_a[op>>2&3] + (int16_t)read_arg16(m_pc), m_d[op&3]); break; // movx (d16, an), dm case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: m_cycles -= 1; - m_d[op&3] = read_mem24(m_a[op>>2&3] + (INT16)read_arg16(m_pc)); + m_d[op&3] = read_mem24(m_a[op>>2&3] + (int16_t)read_arg16(m_pc)); break; // mov dm, (d16, an) case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: - write_mem16(m_a[op>>2&3] + (INT16)read_arg16(m_pc), m_d[op&3]); + write_mem16(m_a[op>>2&3] + (int16_t)read_arg16(m_pc), m_d[op&3]); break; // movb dm, (d16, an) case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f: - write_mem8(m_a[op>>2&3] + (INT16)read_arg16(m_pc), m_d[op&3]); + write_mem8(m_a[op>>2&3] + (int16_t)read_arg16(m_pc), m_d[op&3]); break; // mov am, (d16, an) case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: m_cycles -= 1; - write_mem24(m_a[op>>2&3] + (INT16)read_arg16(m_pc), m_a[op&3]); + write_mem24(m_a[op>>2&3] + (int16_t)read_arg16(m_pc), m_a[op&3]); break; // mov (d16, an), am case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf: m_cycles -= 1; - m_a[op&3] = read_mem24(m_a[op>>2&3] + (INT16)read_arg16(m_pc)); + m_a[op&3] = read_mem24(m_a[op>>2&3] + (int16_t)read_arg16(m_pc)); break; // mov (d16, an), dm case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: - m_d[op&3] = (INT16)read_mem16(m_a[op>>2&3] + (INT16)read_arg16(m_pc)); + m_d[op&3] = (int16_t)read_mem16(m_a[op>>2&3] + (int16_t)read_arg16(m_pc)); break; // movb (d16, an), dm case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: case 0xd8: case 0xd9: case 0xda: case 0xdb: case 0xdc: case 0xdd: case 0xde: case 0xdf: - m_d[op&3] = (INT8)read_mem8(m_a[op>>2&3] + (INT16)read_arg16(m_pc)); + m_d[op&3] = (int8_t)read_mem8(m_a[op>>2&3] + (int16_t)read_arg16(m_pc)); break; default: diff --git a/src/devices/cpu/mn10200/mn10200.h b/src/devices/cpu/mn10200/mn10200.h index 38073fb8e27..100eb03a2b8 100644 --- a/src/devices/cpu/mn10200/mn10200.h +++ b/src/devices/cpu/mn10200/mn10200.h @@ -46,7 +46,7 @@ class mn10200_device : public cpu_device { public: // construction/destruction - mn10200_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor program, const char *shortname, const char *source) + mn10200_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, address_map_constructor program, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, program), m_program(nullptr) , m_read_port0(*this), m_read_port1(*this), m_read_port2(*this), m_read_port3(*this), m_read_port4(*this) @@ -76,11 +76,11 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 2 - 1) / 2; } // internal /2 divider - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 2); } // internal /2 divider - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 13+7; } // max opcode cycles + interrupt duration - virtual UINT32 execute_input_lines() const override { return 4; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 2 - 1) / 2; } // internal /2 divider + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } // internal /2 divider + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 13+7; } // max opcode cycles + interrupt duration + virtual uint32_t execute_input_lines() const override { return 4; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -91,9 +91,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 7; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 7; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -106,24 +106,24 @@ private: int m_cycles; // The UINT32s are really UINT24 - UINT32 m_pc; - UINT32 m_d[4]; - UINT32 m_a[4]; - UINT16 m_psw; - UINT16 m_mdr; + uint32_t m_pc; + uint32_t m_d[4]; + uint32_t m_a[4]; + uint16_t m_psw; + uint16_t m_mdr; // interrupts void take_irq(int level, int group); void check_irq(); void check_ext_irq(); - UINT8 m_icrl[MN10200_NUM_IRQ_GROUPS]; - UINT8 m_icrh[MN10200_NUM_IRQ_GROUPS]; + uint8_t m_icrl[MN10200_NUM_IRQ_GROUPS]; + uint8_t m_icrh[MN10200_NUM_IRQ_GROUPS]; - UINT8 m_nmicr; - UINT8 m_iagr; - UINT8 m_extmdl; - UINT8 m_extmdh; + uint8_t m_nmicr; + uint8_t m_iagr; + uint8_t m_extmdl; + uint8_t m_extmdh; bool m_possible_irq; // timers @@ -137,70 +137,70 @@ private: struct { - UINT8 mode; - UINT8 base; - UINT8 cur; + uint8_t mode; + uint8_t base; + uint8_t cur; } m_simple_timer[MN10200_NUM_TIMERS_8BIT]; struct { - UINT8 mode; - UINT8 base; - UINT8 cur; + uint8_t mode; + uint8_t base; + uint8_t cur; } m_prescaler[MN10200_NUM_PRESCALERS]; // dma struct { - UINT32 adr; - UINT32 count; - UINT16 iadr; - UINT8 ctrll; - UINT8 ctrlh; - UINT8 irq; + uint32_t adr; + uint32_t count; + uint16_t iadr; + uint8_t ctrll; + uint8_t ctrlh; + uint8_t irq; } m_dma[8]; // serial struct { - UINT8 ctrll; - UINT8 ctrlh; - UINT8 buf; + uint8_t ctrll; + uint8_t ctrlh; + uint8_t buf; } m_serial[2]; // ports - UINT8 m_pplul; - UINT8 m_ppluh; - UINT8 m_p3md; - UINT8 m_p4; + uint8_t m_pplul; + uint8_t m_ppluh; + uint8_t m_p3md; + uint8_t m_p4; struct { - UINT8 out; - UINT8 dir; + uint8_t out; + uint8_t dir; } m_port[4]; // internal read/write - inline UINT8 read_arg8(UINT32 address) { return m_program->read_byte(address); } - inline UINT16 read_arg16(UINT32 address) { return m_program->read_byte(address) | m_program->read_byte(address + 1) << 8; } - inline UINT32 read_arg24(UINT32 address) { return m_program->read_byte(address) | m_program->read_byte(address + 1) << 8 | m_program->read_byte(address + 2) << 16; } + inline uint8_t read_arg8(uint32_t address) { return m_program->read_byte(address); } + inline uint16_t read_arg16(uint32_t address) { return m_program->read_byte(address) | m_program->read_byte(address + 1) << 8; } + inline uint32_t read_arg24(uint32_t address) { return m_program->read_byte(address) | m_program->read_byte(address + 1) << 8 | m_program->read_byte(address + 2) << 16; } - inline UINT8 read_mem8(UINT32 address) { return m_program->read_byte(address); } - inline UINT16 read_mem16(UINT32 address) { return m_program->read_word(address & ~1); } - inline UINT32 read_mem24(UINT32 address) { return m_program->read_word(address & ~1) | m_program->read_byte((address & ~1) + 2) << 16; } + inline uint8_t read_mem8(uint32_t address) { return m_program->read_byte(address); } + inline uint16_t read_mem16(uint32_t address) { return m_program->read_word(address & ~1); } + inline uint32_t read_mem24(uint32_t address) { return m_program->read_word(address & ~1) | m_program->read_byte((address & ~1) + 2) << 16; } - inline void write_mem8(UINT32 address, UINT8 data) { m_program->write_byte(address, data); } - inline void write_mem16(UINT32 address, UINT16 data) { m_program->write_word(address & ~1, data); } - inline void write_mem24(UINT32 address, UINT32 data) { m_program->write_word(address & ~1, data); m_program->write_byte((address & ~1) + 2, data >> 16); } + inline void write_mem8(uint32_t address, uint8_t data) { m_program->write_byte(address, data); } + inline void write_mem16(uint32_t address, uint16_t data) { m_program->write_word(address & ~1, data); } + inline void write_mem24(uint32_t address, uint32_t data) { m_program->write_word(address & ~1, data); m_program->write_byte((address & ~1) + 2, data >> 16); } - inline void change_pc(UINT32 pc) { m_pc = pc & 0xffffff; } + inline void change_pc(uint32_t pc) { m_pc = pc & 0xffffff; } // opcode helpers - void illegal(UINT8 prefix, UINT8 op); - UINT32 do_add(UINT32 a, UINT32 b, UINT32 c = 0); - UINT32 do_sub(UINT32 a, UINT32 b, UINT32 c = 0); - void test_nz16(UINT16 v); - void do_jsr(UINT32 to, UINT32 ret); + void illegal(uint8_t prefix, uint8_t op); + uint32_t do_add(uint32_t a, uint32_t b, uint32_t c = 0); + uint32_t do_sub(uint32_t a, uint32_t b, uint32_t c = 0); + void test_nz16(uint16_t v); + void do_jsr(uint32_t to, uint32_t ret); void do_branch(int condition = 1); }; @@ -208,7 +208,7 @@ private: class mn1020012a_device : public mn10200_device { public: - mn1020012a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mn1020012a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/mn10200/mn102dis.cpp b/src/devices/cpu/mn10200/mn102dis.cpp index c3b09b0ed93..8a03ea5dec8 100644 --- a/src/devices/cpu/mn10200/mn102dis.cpp +++ b/src/devices/cpu/mn10200/mn102dis.cpp @@ -8,55 +8,55 @@ #include -static const UINT8 *sOpROM; // current opROM pointer -static UINT32 sBasePC; +static const uint8_t *sOpROM; // current opROM pointer +static uint32_t sBasePC; -static UINT8 program_read_byte(offs_t pc) +static uint8_t program_read_byte(offs_t pc) { return sOpROM[pc - sBasePC]; } -static UINT32 r16u(offs_t pc) +static uint32_t r16u(offs_t pc) { return sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8); } -static INT32 r16s(offs_t pc) +static int32_t r16s(offs_t pc) { - return (INT16)(sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8)); + return (int16_t)(sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8)); } -static UINT32 r24u(offs_t pc) +static uint32_t r24u(offs_t pc) { return sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8) | (sOpROM[pc - sBasePC + 2]<<16); } -static INT32 r24s(offs_t pc) +static int32_t r24s(offs_t pc) { - return sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8) | ((INT8)sOpROM[pc - sBasePC + 2]<<16); + return sOpROM[pc - sBasePC] | (sOpROM[pc - sBasePC + 1]<<8) | ((int8_t)sOpROM[pc - sBasePC + 2]<<16); } -static const char *i8str(INT8 v) +static const char *i8str(int8_t v) { static char res[0x10]; if(v>=0) sprintf(res, "$%x", v); else - sprintf(res, "-$%x", (UINT8)(-v)); + sprintf(res, "-$%x", (uint8_t)(-v)); return res; } -static const char *i16str(INT16 v) +static const char *i16str(int16_t v) { static char res[0x10]; if(v>=0) sprintf(res, "$%x", v); else - sprintf(res, "-$%x", (UINT16)(-v)); + sprintf(res, "-$%x", (uint16_t)(-v)); return res; } -static const char *i24str(INT32 v) +static const char *i24str(int32_t v) { static char res[0x10]; if(v>=0) @@ -67,9 +67,9 @@ static const char *i24str(INT32 v) } -static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) +static int mn102_disassemble(char *buffer, uint32_t pc, const uint8_t *oprom) { - UINT8 opcode; + uint8_t opcode; sOpROM = oprom; sBasePC = pc; @@ -185,47 +185,47 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) return 3; case 0xe0: - sprintf(buffer, "blt $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "blt $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xe1: - sprintf(buffer, "bgt $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "bgt $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xe2: - sprintf(buffer, "bge $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "bge $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xe3: - sprintf(buffer, "ble $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "ble $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xe4: - sprintf(buffer, "bcs $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "bcs $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xe5: - sprintf(buffer, "bhi $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "bhi $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xe6: - sprintf(buffer, "bcc $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "bcc $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xe7: - sprintf(buffer, "bls $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "bls $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xe8: - sprintf(buffer, "beq $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "beq $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xe9: - sprintf(buffer, "bne $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "bne $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xea: - sprintf(buffer, "bra $%x", (pc+2+(INT8)program_read_byte(pc+1)) & 0xffffff); + sprintf(buffer, "bra $%x", (pc+2+(int8_t)program_read_byte(pc+1)) & 0xffffff); return 2; case 0xeb: @@ -470,12 +470,12 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) { case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: sprintf(buffer, "tbz ($%x) %d, $%x", r24u(pc+3), opcode & 7, - (pc+7+(INT8)program_read_byte(pc+6)) & 0xffffff); + (pc+7+(int8_t)program_read_byte(pc+6)) & 0xffffff); return 7; case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: sprintf(buffer, "tbnz ($%x) %d, $%x", r24u(pc+3), opcode & 7, - (pc+7+(INT8)program_read_byte(pc+6)) & 0xffffff); + (pc+7+(int8_t)program_read_byte(pc+6)) & 0xffffff); return 7; case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: @@ -497,7 +497,7 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: sprintf(buffer, "tbz (%s, a%d) %d, $%x", i8str(program_read_byte(pc+3)), 2+((opcode>>3)&1), opcode & 7, - (pc+5+(INT8)program_read_byte(pc+4)) & 0xffffff); + (pc+5+(int8_t)program_read_byte(pc+4)) & 0xffffff); return 5; case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: @@ -508,7 +508,7 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: sprintf(buffer, "tbnz (%s, a%d) %d, $%x", i8str(program_read_byte(pc+3)), 2+((opcode>>3)&1), opcode & 7, - (pc+5+(INT8)program_read_byte(pc+4)) & 0xffffff); + (pc+5+(int8_t)program_read_byte(pc+4)) & 0xffffff); return 5; case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: @@ -707,7 +707,7 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: { - UINT8 opcode2 = program_read_byte(pc+2); + uint8_t opcode2 = program_read_byte(pc+2); switch(opcode2) { case 0x00: @@ -731,7 +731,7 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: { - UINT8 opcode2 = program_read_byte(pc+2); + uint8_t opcode2 = program_read_byte(pc+2); switch(opcode2) { case 0x10: @@ -751,7 +751,7 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: case 0x8a: case 0x8b: case 0x8c: case 0x8d: case 0x8e: case 0x8f: sprintf(buffer, "tbz (%s, a%d) %d, $%x", i8str(program_read_byte(pc+2)), (opcode>>3)&1, opcode & 7, - (pc+4+(INT8)program_read_byte(pc+3)) & 0xffffff); + (pc+4+(int8_t)program_read_byte(pc+3)) & 0xffffff); return 4; case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97: @@ -762,7 +762,7 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7: case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf: sprintf(buffer, "tbnz (%s, a%d) %d, $%x", i8str(program_read_byte(pc+2)), (opcode>>3)&1, opcode & 7, - (pc+4+(INT8)program_read_byte(pc+3)) & 0xffffff); + (pc+4+(int8_t)program_read_byte(pc+3)) & 0xffffff); return 4; case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7: @@ -772,12 +772,12 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) case 0xc0: case 0xc1: case 0xc2: case 0xc3: case 0xc4: case 0xc5: case 0xc6: case 0xc7: sprintf(buffer, "tbz ($%x) %d, $%x", r16u(pc+2), opcode & 7, - (pc+5+(INT8)program_read_byte(pc+4)) & 0xffffff); + (pc+5+(int8_t)program_read_byte(pc+4)) & 0xffffff); return 5; case 0xc8: case 0xc9: case 0xca: case 0xcb: case 0xcc: case 0xcd: case 0xce: case 0xcf: sprintf(buffer, "tbnz ($%x) %d, $%x", r16u(pc+2), opcode & 7, - (pc+5+(INT8)program_read_byte(pc+4)) & 0xffffff); + (pc+5+(int8_t)program_read_byte(pc+4)) & 0xffffff); return 5; case 0xd0: case 0xd1: case 0xd2: case 0xd3: case 0xd4: case 0xd5: case 0xd6: case 0xd7: @@ -789,64 +789,64 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) return 4; case 0xe0: - sprintf(buffer, "bltx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bltx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xe1: - sprintf(buffer, "bgtx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bgtx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xe2: - sprintf(buffer, "bgex $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bgex $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xe3: - sprintf(buffer, "blex $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "blex $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xe4: - sprintf(buffer, "bcsx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bcsx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xe5: - sprintf(buffer, "bhix $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bhix $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xe6: - sprintf(buffer, "bccx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bccx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xe7: - sprintf(buffer, "blsx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "blsx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xe8: - sprintf(buffer, "beqx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "beqx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xe9: - sprintf(buffer, "bnex $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bnex $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xec: - sprintf(buffer, "bvcx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bvcx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xed: - sprintf(buffer, "bvsx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bvsx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xee: - sprintf(buffer, "bncx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bncx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xef: - sprintf(buffer, "bnsx $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bnsx $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: { - UINT8 opcode2 = program_read_byte(pc+2); + uint8_t opcode2 = program_read_byte(pc+2); switch(opcode2) { case 0x04: @@ -871,19 +871,19 @@ static int mn102_disassemble(char *buffer, UINT32 pc, const UINT8 *oprom) } case 0xfc: - sprintf(buffer, "bvc $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bvc $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xfd: - sprintf(buffer, "bvs $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bvs $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xfe: - sprintf(buffer, "bnc $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bnc $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; case 0xff: - sprintf(buffer, "bns $%x", (pc+3+(INT8)program_read_byte(pc+2)) & 0xffffff); + sprintf(buffer, "bns $%x", (pc+3+(int8_t)program_read_byte(pc+2)) & 0xffffff); return 3; default: diff --git a/src/devices/cpu/nec/nec.cpp b/src/devices/cpu/nec/nec.cpp index 6738a89f467..33c68acbd69 100644 --- a/src/devices/cpu/nec/nec.cpp +++ b/src/devices/cpu/nec/nec.cpp @@ -107,10 +107,10 @@ #include "emu.h" #include "debugger.h" -typedef UINT8 BOOLEAN; -typedef UINT8 BYTE; -typedef UINT16 WORD; -typedef UINT32 DWORD; +typedef uint8_t BOOLEAN; +typedef uint8_t BYTE; +typedef uint16_t WORD; +typedef uint32_t DWORD; #include "nec.h" #include "necpriv.h" @@ -122,7 +122,7 @@ const device_type V33A =&device_creator; -nec_common_device::nec_common_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, bool is_16bit, offs_t fetch_xor, UINT8 prefetch_size, UINT8 prefetch_cycles, UINT32 chip_type) +nec_common_device::nec_common_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, bool is_16bit, offs_t fetch_xor, uint8_t prefetch_size, uint8_t prefetch_cycles, uint32_t chip_type) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, is_16bit ? 16 : 8, 20, 0) , m_io_config("io", ENDIANNESS_LITTLE, is_16bit ? 16 : 8, 16, 0) @@ -134,13 +134,13 @@ nec_common_device::nec_common_device(const machine_config &mconfig, device_type } -v20_device::v20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v20_device::v20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nec_common_device(mconfig, V20, "V20", tag, owner, clock, "v20", __FILE__, false, 0, 4, 4, V20_TYPE) { } -v30_device::v30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v30_device::v30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nec_common_device(mconfig, V30, "V30", tag, owner, clock, "v30", __FILE__, true, BYTE_XOR_LE(0), 6, 2, V30_TYPE) { } @@ -149,19 +149,19 @@ v30_device::v30_device(const machine_config &mconfig, const char *tag, device_t /* FIXME: Need information about prefetch size and cycles for V33. * complete guess below, nbbatman will not work * properly without. */ -v33_device::v33_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v33_device::v33_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nec_common_device(mconfig, V33, "V33", tag, owner, clock, "v33", __FILE__, true, BYTE_XOR_LE(0), 6, 1, V33_TYPE) { } -v33a_device::v33a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v33a_device::v33a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nec_common_device(mconfig, V33A, "V33A", tag, owner, clock, "v33A", __FILE__, true, BYTE_XOR_LE(0), 6, 1, V33_TYPE) { } -offs_t nec_common_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t nec_common_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( nec ); return CPU_DISASSEMBLE_NAME(nec)(this, buffer, pc, oprom, opram, options); @@ -207,15 +207,15 @@ void nec_common_device::do_prefetch(int previous_ICount) } -UINT8 nec_common_device::fetch() +uint8_t nec_common_device::fetch() { prefetch(); return m_direct->read_byte((Sreg(PS)<<4)+m_ip++, m_fetch_xor); } -UINT16 nec_common_device::fetchword() +uint16_t nec_common_device::fetchword() { - UINT16 r = FETCH(); + uint16_t r = FETCH(); r |= (FETCH()<<8); return r; } @@ -225,9 +225,9 @@ UINT16 nec_common_device::fetchword() #include "necea.h" #include "necmodrm.h" -static UINT8 parity_table[256]; +static uint8_t parity_table[256]; -UINT8 nec_common_device::fetchop() +uint8_t nec_common_device::fetchop() { prefetch(); return m_direct->read_byte(( Sreg(PS)<<4)+m_ip++, m_fetch_xor); @@ -269,7 +269,7 @@ void nec_common_device::device_reset() void nec_common_device::nec_interrupt(unsigned int_num, int/*INTSOURCES*/ source) { - UINT32 dest_seg, dest_off; + uint32_t dest_seg, dest_off; i_pushf(); m_TF = m_IF = 0; @@ -304,7 +304,7 @@ void nec_common_device::external_int() { /* the actual vector is retrieved after pushing flags */ /* and clearing the IF */ - nec_interrupt((UINT32)-1, INT_IRQ); + nec_interrupt((uint32_t)-1, INT_IRQ); m_irq_state = CLEAR_LINE; m_pending_irq &= ~INT_IRQ; } @@ -440,7 +440,7 @@ void nec_common_device::device_start() void nec_common_device::state_string_export(const device_state_entry &entry, std::string &str) const { - UINT16 flags = CompressFlags(); + uint16_t flags = CompressFlags(); switch (entry.index()) { diff --git a/src/devices/cpu/nec/nec.h b/src/devices/cpu/nec/nec.h index c0c1fa82327..5d696eb417b 100644 --- a/src/devices/cpu/nec/nec.h +++ b/src/devices/cpu/nec/nec.h @@ -23,7 +23,7 @@ class nec_common_device : public cpu_device { public: // construction/destruction - nec_common_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, bool is_16bit, offs_t fetch_xor, UINT8 prefetch_size, UINT8 prefetch_cycles, UINT32 chip_type); + nec_common_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, bool is_16bit, offs_t fetch_xor, uint8_t prefetch_size, uint8_t prefetch_cycles, uint32_t chip_type); protected: // device-level overrides @@ -31,10 +31,10 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 80; } - virtual UINT32 execute_input_lines() const override { return 1; } - virtual UINT32 execute_default_irq_vector() const override { return 0xff; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 80; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint32_t execute_default_irq_vector() const override { return 0xff; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -47,9 +47,9 @@ protected: virtual void state_export(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -58,66 +58,66 @@ private: /* NEC registers */ union necbasicregs { /* eight general registers */ - UINT16 w[8]; /* viewed as 16 bits registers */ - UINT8 b[16]; /* or as 8 bit registers */ + uint16_t w[8]; /* viewed as 16 bits registers */ + uint8_t b[16]; /* or as 8 bit registers */ }; necbasicregs m_regs; offs_t m_fetch_xor; - UINT16 m_sregs[4]; + uint16_t m_sregs[4]; - UINT16 m_ip; + uint16_t m_ip; /* PSW flags */ - INT32 m_SignVal; - UINT32 m_AuxVal; /* 0 or non-0 valued flags */ - UINT32 m_OverVal; - UINT32 m_ZeroVal; - UINT32 m_CarryVal; - UINT32 m_ParityVal; - UINT8 m_TF; /* 0 or 1 valued flags */ - UINT8 m_IF; - UINT8 m_DF; - UINT8 m_MF; + int32_t m_SignVal; + uint32_t m_AuxVal; /* 0 or non-0 valued flags */ + uint32_t m_OverVal; + uint32_t m_ZeroVal; + uint32_t m_CarryVal; + uint32_t m_ParityVal; + uint8_t m_TF; /* 0 or 1 valued flags */ + uint8_t m_IF; + uint8_t m_DF; + uint8_t m_MF; /* interrupt related */ - UINT32 m_pending_irq; - UINT32 m_nmi_state; - UINT32 m_irq_state; - UINT32 m_poll_state; - UINT8 m_no_interrupt; - UINT8 m_halted; + uint32_t m_pending_irq; + uint32_t m_nmi_state; + uint32_t m_irq_state; + uint32_t m_poll_state; + uint8_t m_no_interrupt; + uint8_t m_halted; address_space *m_program; direct_read_data *m_direct; address_space *m_io; int m_icount; - UINT8 m_prefetch_size; - UINT8 m_prefetch_cycles; - INT8 m_prefetch_count; - UINT8 m_prefetch_reset; - UINT32 m_chip_type; + uint8_t m_prefetch_size; + uint8_t m_prefetch_cycles; + int8_t m_prefetch_count; + uint8_t m_prefetch_reset; + uint32_t m_chip_type; - UINT32 m_prefix_base; /* base address of the latest prefix segment */ - UINT8 m_seg_prefix; /* prefix segment indicator */ + uint32_t m_prefix_base; /* base address of the latest prefix segment */ + uint8_t m_seg_prefix; /* prefix segment indicator */ - UINT32 m_EA; - UINT16 m_EO; - UINT16 m_E16; + uint32_t m_EA; + uint16_t m_EO; + uint16_t m_E16; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; typedef void (nec_common_device::*nec_ophandler)(); - typedef UINT32 (nec_common_device::*nec_eahandler)(); + typedef uint32_t (nec_common_device::*nec_eahandler)(); static const nec_ophandler s_nec_instruction[256]; static const nec_eahandler s_GetEA[192]; inline void prefetch(); void do_prefetch(int previous_ICount); - inline UINT8 fetch(); - inline UINT16 fetchword(); - UINT8 fetchop(); + inline uint8_t fetch(); + inline uint16_t fetchword(); + uint8_t fetchop(); void nec_interrupt(unsigned int_num, int source); void nec_trap(); void external_int(); @@ -369,57 +369,57 @@ union necbasicregs void i_ffpre(); void i_wait(); - UINT32 EA_000(); - UINT32 EA_001(); - UINT32 EA_002(); - UINT32 EA_003(); - UINT32 EA_004(); - UINT32 EA_005(); - UINT32 EA_006(); - UINT32 EA_007(); - UINT32 EA_100(); - UINT32 EA_101(); - UINT32 EA_102(); - UINT32 EA_103(); - UINT32 EA_104(); - UINT32 EA_105(); - UINT32 EA_106(); - UINT32 EA_107(); - UINT32 EA_200(); - UINT32 EA_201(); - UINT32 EA_202(); - UINT32 EA_203(); - UINT32 EA_204(); - UINT32 EA_205(); - UINT32 EA_206(); - UINT32 EA_207(); + uint32_t EA_000(); + uint32_t EA_001(); + uint32_t EA_002(); + uint32_t EA_003(); + uint32_t EA_004(); + uint32_t EA_005(); + uint32_t EA_006(); + uint32_t EA_007(); + uint32_t EA_100(); + uint32_t EA_101(); + uint32_t EA_102(); + uint32_t EA_103(); + uint32_t EA_104(); + uint32_t EA_105(); + uint32_t EA_106(); + uint32_t EA_107(); + uint32_t EA_200(); + uint32_t EA_201(); + uint32_t EA_202(); + uint32_t EA_203(); + uint32_t EA_204(); + uint32_t EA_205(); + uint32_t EA_206(); + uint32_t EA_207(); }; class v20_device : public nec_common_device { public: - v20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class v30_device : public nec_common_device { public: - v30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class v33_device : public nec_common_device { public: - v33_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v33_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class v33a_device : public nec_common_device { public: - v33a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v33a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/nec/necdasm.cpp b/src/devices/cpu/nec/necdasm.cpp index cd326436fd4..1b80daf4eda 100644 --- a/src/devices/cpu/nec/necdasm.cpp +++ b/src/devices/cpu/nec/necdasm.cpp @@ -9,7 +9,7 @@ #include "emu.h" -static const UINT8 *Iconfig; +static const uint8_t *Iconfig; enum { @@ -67,10 +67,10 @@ enum struct NEC_I386_OPCODE { char mnemonic[32]; - UINT32 flags; - UINT32 param1; - UINT32 param2; - UINT32 param3; + uint32_t flags; + uint32_t param1; + uint32_t param2; + uint32_t param3; offs_t dasm_flags; }; @@ -79,8 +79,8 @@ struct NEC_GROUP_OP { const NEC_I386_OPCODE *opcode; }; -static const UINT8 *opcode_ptr; -static const UINT8 *opcode_ptr_base; +static const uint8_t *opcode_ptr; +static const uint8_t *opcode_ptr_base; static const NEC_I386_OPCODE necv_opcode_table1[256] = { @@ -864,9 +864,9 @@ static const char *const nec_sfreg[256] = "???", "???", "???", "???", "ispr", "???", "???", "idb" }; -static UINT32 pc; -static UINT8 modrm; -static UINT32 segment; +static uint32_t pc; +static uint8_t modrm; +static uint32_t segment; static offs_t dasm_flags; static char modrm_string[256]; @@ -875,7 +875,7 @@ static char modrm_string[256]; #define MAX_LENGTH 8 -static inline UINT8 FETCH(void) +static inline uint8_t FETCH(void) { if ((opcode_ptr - opcode_ptr_base) + 1 > MAX_LENGTH) return 0xff; @@ -884,9 +884,9 @@ static inline UINT8 FETCH(void) } #if 0 -static inline UINT16 FETCH16(void) +static inline uint16_t FETCH16(void) { - UINT16 d; + uint16_t d; if ((opcode_ptr - opcode_ptr_base) + 2 > MAX_LENGTH) return 0xffff; d = opcode_ptr[0] | (opcode_ptr[1] << 8); @@ -896,7 +896,7 @@ static inline UINT16 FETCH16(void) } #endif -static inline UINT8 FETCHD(void) +static inline uint8_t FETCHD(void) { if ((opcode_ptr - opcode_ptr_base) + 1 > MAX_LENGTH) return 0xff; @@ -904,9 +904,9 @@ static inline UINT8 FETCHD(void) return *opcode_ptr++; } -static inline UINT16 FETCHD16(void) +static inline uint16_t FETCHD16(void) { - UINT16 d; + uint16_t d; if ((opcode_ptr - opcode_ptr_base) + 2 > MAX_LENGTH) return 0xffff; d = opcode_ptr[0] | (opcode_ptr[1] << 8); @@ -915,7 +915,7 @@ static inline UINT16 FETCHD16(void) return d; } -static char *hexstring(UINT32 value, int digits) +static char *hexstring(uint32_t value, int digits) { static char buffer[20]; buffer[0] = '0'; @@ -926,7 +926,7 @@ static char *hexstring(UINT32 value, int digits) return (buffer[1] >= '0' && buffer[1] <= '9') ? &buffer[1] : &buffer[0]; } -static char *shexstring(UINT32 value, int digits, int always) +static char *shexstring(uint32_t value, int digits, int always) { static char buffer[20]; if (value >= 0x80000000) @@ -940,9 +940,9 @@ static char *shexstring(UINT32 value, int digits, int always) static void handle_modrm(char* s) { - INT8 disp8; - INT16 disp16; - UINT8 mod, rm; + int8_t disp8; + int16_t disp16; + uint8_t mod, rm; modrm = FETCHD(); mod = (modrm >> 6) & 0x3; @@ -971,7 +971,7 @@ static void handle_modrm(char* s) case 6: if( mod == 0 ) { disp16 = FETCHD16(); - s += sprintf( s, "%s", hexstring((unsigned) (UINT16) disp16, 0) ); + s += sprintf( s, "%s", hexstring((unsigned) (uint16_t) disp16, 0) ); } else { s += sprintf( s, "bp" ); } @@ -980,22 +980,22 @@ static void handle_modrm(char* s) } if( mod == 1 ) { disp8 = FETCHD(); - s += sprintf( s, "%s", shexstring((INT32)disp8, 0, TRUE) ); + s += sprintf( s, "%s", shexstring((int32_t)disp8, 0, TRUE) ); } else if( mod == 2 ) { disp16 = FETCHD16(); - s += sprintf( s, "%s", shexstring((INT32)disp16, 0, TRUE) ); + s += sprintf( s, "%s", shexstring((int32_t)disp16, 0, TRUE) ); } s += sprintf( s, "]" ); } -static char* handle_param(char* s, UINT32 param) +static char* handle_param(char* s, uint32_t param) { - UINT8 i8; - UINT16 i16; - UINT16 ptr; - UINT32 addr; - INT8 d8; - INT16 d16; + uint8_t i8; + uint16_t i16; + uint16_t ptr; + uint32_t addr; + int8_t d8; + int16_t d16; switch(param) { @@ -1049,17 +1049,17 @@ static char* handle_param(char* s, UINT32 param) case PARAM_I8: i8 = FETCHD(); - s += sprintf( s, "%s", shexstring((INT8)i8, 0, FALSE) ); + s += sprintf( s, "%s", shexstring((int8_t)i8, 0, FALSE) ); break; case PARAM_I16: i16 = FETCHD16(); - s += sprintf( s, "%s", shexstring((INT16)i16, 0, FALSE) ); + s += sprintf( s, "%s", shexstring((int16_t)i16, 0, FALSE) ); break; case PARAM_UI8: i8 = FETCHD(); - s += sprintf( s, "%s", shexstring((UINT8)i8, 0, FALSE) ); + s += sprintf( s, "%s", shexstring((uint8_t)i8, 0, FALSE) ); break; case PARAM_IMM: @@ -1132,7 +1132,7 @@ static char* handle_param(char* s, UINT32 param) return s; } -static void handle_fpu(char *s, UINT8 op1, UINT8 op2) +static void handle_fpu(char *s, uint8_t op1, uint8_t op2) { switch (op1 & 0x7) { @@ -1507,10 +1507,10 @@ static void handle_fpu(char *s, UINT8 op1, UINT8 op2) } } -static void decode_opcode(char *s, const NEC_I386_OPCODE *op, UINT8 op1 ) +static void decode_opcode(char *s, const NEC_I386_OPCODE *op, uint8_t op1 ) { int i; - UINT8 op2; + uint8_t op2; switch( op->flags ) { @@ -1579,9 +1579,9 @@ handle_unknown: sprintf(s, "???"); } -int necv_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom, const UINT8 *decryption_table) +int necv_dasm_one(char *buffer, uint32_t eip, const uint8_t *oprom, const uint8_t *decryption_table) { - UINT8 op; + uint8_t op; Iconfig = decryption_table; opcode_ptr = opcode_ptr_base = oprom; diff --git a/src/devices/cpu/nec/necea.h b/src/devices/cpu/nec/necea.h index 2633637304a..1a20c0cdf54 100644 --- a/src/devices/cpu/nec/necea.h +++ b/src/devices/cpu/nec/necea.h @@ -1,32 +1,32 @@ // license:BSD-3-Clause // copyright-holders:Bryan McPhail -UINT32 nec_common_device::EA_000() { m_EO=Wreg(BW)+Wreg(IX); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_001() { m_EO=Wreg(BW)+Wreg(IY); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_002() { m_EO=Wreg(BP)+Wreg(IX); m_EA=DefaultBase(SS)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_003() { m_EO=Wreg(BP)+Wreg(IY); m_EA=DefaultBase(SS)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_004() { m_EO=Wreg(IX); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_005() { m_EO=Wreg(IY); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_006() { m_EO=FETCH(); m_EO+=FETCH()<<8; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_007() { m_EO=Wreg(BW); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_000() { m_EO=Wreg(BW)+Wreg(IX); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_001() { m_EO=Wreg(BW)+Wreg(IY); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_002() { m_EO=Wreg(BP)+Wreg(IX); m_EA=DefaultBase(SS)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_003() { m_EO=Wreg(BP)+Wreg(IY); m_EA=DefaultBase(SS)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_004() { m_EO=Wreg(IX); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_005() { m_EO=Wreg(IY); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_006() { m_EO=FETCH(); m_EO+=FETCH()<<8; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_007() { m_EO=Wreg(BW); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_100() { m_EO=(Wreg(BW)+Wreg(IX)+(INT8)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_101() { m_EO=(Wreg(BW)+Wreg(IY)+(INT8)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_102() { m_EO=(Wreg(BP)+Wreg(IX)+(INT8)FETCH()); m_EA=DefaultBase(SS)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_103() { m_EO=(Wreg(BP)+Wreg(IY)+(INT8)FETCH()); m_EA=DefaultBase(SS)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_104() { m_EO=(Wreg(IX)+(INT8)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_105() { m_EO=(Wreg(IY)+(INT8)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_106() { m_EO=(Wreg(BP)+(INT8)FETCH()); m_EA=DefaultBase(SS)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_107() { m_EO=(Wreg(BW)+(INT8)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_100() { m_EO=(Wreg(BW)+Wreg(IX)+(int8_t)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_101() { m_EO=(Wreg(BW)+Wreg(IY)+(int8_t)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_102() { m_EO=(Wreg(BP)+Wreg(IX)+(int8_t)FETCH()); m_EA=DefaultBase(SS)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_103() { m_EO=(Wreg(BP)+Wreg(IY)+(int8_t)FETCH()); m_EA=DefaultBase(SS)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_104() { m_EO=(Wreg(IX)+(int8_t)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_105() { m_EO=(Wreg(IY)+(int8_t)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_106() { m_EO=(Wreg(BP)+(int8_t)FETCH()); m_EA=DefaultBase(SS)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_107() { m_EO=(Wreg(BW)+(int8_t)FETCH()); m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_200() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BW)+Wreg(IX)+(INT16)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_201() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BW)+Wreg(IY)+(INT16)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_202() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BP)+Wreg(IX)+(INT16)m_E16; m_EA=DefaultBase(SS)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_203() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BP)+Wreg(IY)+(INT16)m_E16; m_EA=DefaultBase(SS)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_204() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(IX)+(INT16)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_205() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(IY)+(INT16)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_206() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BP)+(INT16)m_E16; m_EA=DefaultBase(SS)+m_EO; return m_EA; } -UINT32 nec_common_device::EA_207() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BW)+(INT16)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_200() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BW)+Wreg(IX)+(int16_t)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_201() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BW)+Wreg(IY)+(int16_t)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_202() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BP)+Wreg(IX)+(int16_t)m_E16; m_EA=DefaultBase(SS)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_203() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BP)+Wreg(IY)+(int16_t)m_E16; m_EA=DefaultBase(SS)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_204() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(IX)+(int16_t)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_205() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(IY)+(int16_t)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_206() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BP)+(int16_t)m_E16; m_EA=DefaultBase(SS)+m_EO; return m_EA; } +uint32_t nec_common_device::EA_207() { m_E16=FETCH(); m_E16+=FETCH()<<8; m_EO=Wreg(BW)+(int16_t)m_E16; m_EA=DefaultBase(DS0)+m_EO; return m_EA; } const nec_common_device::nec_eahandler nec_common_device::s_GetEA[192]= { diff --git a/src/devices/cpu/nec/necinstr.hxx b/src/devices/cpu/nec/necinstr.hxx index 9fc2d9cef5f..bcb56273eaa 100644 --- a/src/devices/cpu/nec/necinstr.hxx +++ b/src/devices/cpu/nec/necinstr.hxx @@ -18,7 +18,7 @@ OP( 0x0b, i_or_r16w ) { DEF_r16w; ORW; RegWord(ModRM)=dst; CLKR(15, OP( 0x0c, i_or_ald8 ) { DEF_ald8; ORB; Breg(AL)=dst; CLKS(4,4,2); } OP( 0x0d, i_or_axd16 ) { DEF_axd16; ORW; Wreg(AW)=dst; CLKS(4,4,2); } OP( 0x0e, i_push_cs ) { PUSH(Sreg(PS)); CLKS(12,8,3); } -OP( 0x0f, i_pre_nec ) { UINT32 ModRM, tmp, tmp2; +OP( 0x0f, i_pre_nec ) { uint32_t ModRM, tmp, tmp2; switch (FETCH()) { case 0x10 : BITOP_BYTE; CLKS(3,3,4); tmp2 = Breg(CL) & 0x7; m_ZeroVal = (tmp & (1<> 15 != 0) && (((INT32)dst) >> 15 != -1); RegWord(ModRM)=(WORD)dst; m_icount-=(ModRM >=0xc0 )?38:47;} -OP( 0x6a, i_push_d8 ) { UINT32 tmp = (WORD)((INT16)((INT8)FETCH())); PUSH(tmp); CLKW(11,11,5,11,7,3,Wreg(SP)); } -OP( 0x6b, i_imul_d8 ) { UINT32 src2; DEF_r16w; src2= (WORD)((INT16)((INT8)FETCH())); dst = (INT32)((INT16)src)*(INT32)((INT16)src2); m_CarryVal = m_OverVal = (((INT32)dst) >> 15 != 0) && (((INT32)dst) >> 15 != -1); RegWord(ModRM)=(WORD)dst; m_icount-=(ModRM >=0xc0 )?31:39; } +OP( 0x68, i_push_d16 ) { uint32_t tmp; tmp = FETCHWORD(); PUSH(tmp); CLKW(12,12,5,12,8,5,Wreg(SP)); } +OP( 0x69, i_imul_d16 ) { uint32_t tmp; DEF_r16w; tmp = FETCHWORD(); dst = (int32_t)((int16_t)src)*(int32_t)((int16_t)tmp); m_CarryVal = m_OverVal = (((int32_t)dst) >> 15 != 0) && (((int32_t)dst) >> 15 != -1); RegWord(ModRM)=(WORD)dst; m_icount-=(ModRM >=0xc0 )?38:47;} +OP( 0x6a, i_push_d8 ) { uint32_t tmp = (WORD)((int16_t)((int8_t)FETCH())); PUSH(tmp); CLKW(11,11,5,11,7,3,Wreg(SP)); } +OP( 0x6b, i_imul_d8 ) { uint32_t src2; DEF_r16w; src2= (WORD)((int16_t)((int8_t)FETCH())); dst = (int32_t)((int16_t)src)*(int32_t)((int16_t)src2); m_CarryVal = m_OverVal = (((int32_t)dst) >> 15 != 0) && (((int32_t)dst) >> 15 != -1); RegWord(ModRM)=(WORD)dst; m_icount-=(ModRM >=0xc0 )?31:39; } OP( 0x6c, i_insb ) { PutMemB(DS1,Wreg(IY),read_port_byte(Wreg(DW))); Wreg(IY)+= -2 * m_DF + 1; CLK(8); } OP( 0x6d, i_insw ) { PutMemW(DS1,Wreg(IY),read_port_word(Wreg(DW))); Wreg(IY)+= -4 * m_DF + 2; CLKS(18,10,8); } OP( 0x6e, i_outsb ) { write_port_byte(Wreg(DW),GetMemB(DS0,Wreg(IX))); Wreg(IX)+= -2 * m_DF + 1; CLK(8); } @@ -260,7 +260,7 @@ OP( 0x7d, i_jnl ) { JMP((ZF)||(SF==OF)); CLKS(4,4,3); } OP( 0x7e, i_jle ) { JMP((ZF)||(SF!=OF)); CLKS(4,4,3); } OP( 0x7f, i_jnle ) { JMP((SF==OF)&&(!ZF)); CLKS(4,4,3); } -OP( 0x80, i_80pre ) { UINT32 dst, src; GetModRM; dst = GetRMByte(ModRM); src = FETCH(); +OP( 0x80, i_80pre ) { uint32_t dst, src; GetModRM; dst = GetRMByte(ModRM); src = FETCH(); if (ModRM >=0xc0 ) CLKS(4,4,2) else if ((ModRM & 0x38)==0x38) CLKS(13,13,6) else CLKS(18,18,7) switch (ModRM & 0x38) { case 0x00: ADDB; PutbackRMByte(ModRM,dst); break; @@ -274,7 +274,7 @@ OP( 0x80, i_80pre ) { UINT32 dst, src; GetModRM; dst = GetRMByte(ModRM); src = } } -OP( 0x81, i_81pre ) { UINT32 dst, src; GetModRM; dst = GetRMWord(ModRM); src = FETCH(); src+= (FETCH() << 8); +OP( 0x81, i_81pre ) { uint32_t dst, src; GetModRM; dst = GetRMWord(ModRM); src = FETCH(); src+= (FETCH() << 8); if (ModRM >=0xc0 ) CLKS(4,4,2) else if ((ModRM & 0x38)==0x38) CLKW(17,17,8,17,13,6,m_EA) else CLKW(26,26,11,26,18,7,m_EA) switch (ModRM & 0x38) { case 0x00: ADDW; PutbackRMWord(ModRM,dst); break; @@ -288,7 +288,7 @@ OP( 0x81, i_81pre ) { UINT32 dst, src; GetModRM; dst = GetRMWord(ModRM); src = } } -OP( 0x82, i_82pre ) { UINT32 dst, src; GetModRM; dst = GetRMByte(ModRM); src = (BYTE)((INT8)FETCH()); +OP( 0x82, i_82pre ) { uint32_t dst, src; GetModRM; dst = GetRMByte(ModRM); src = (BYTE)((int8_t)FETCH()); if (ModRM >=0xc0 ) CLKS(4,4,2) else if ((ModRM & 0x38)==0x38) CLKS(13,13,6) else CLKS(18,18,7) switch (ModRM & 0x38) { case 0x00: ADDB; PutbackRMByte(ModRM,dst); break; @@ -302,7 +302,7 @@ OP( 0x82, i_82pre ) { UINT32 dst, src; GetModRM; dst = GetRMByte(ModRM); src = } } -OP( 0x83, i_83pre ) { UINT32 dst, src; GetModRM; dst = GetRMWord(ModRM); src = (WORD)((INT16)((INT8)FETCH())); +OP( 0x83, i_83pre ) { uint32_t dst, src; GetModRM; dst = GetRMWord(ModRM); src = (WORD)((int16_t)((int8_t)FETCH())); if (ModRM >=0xc0 ) CLKS(4,4,2) else if ((ModRM & 0x38)==0x38) CLKW(17,17,8,17,13,6,m_EA) else CLKW(26,26,11,26,18,7,m_EA) switch (ModRM & 0x38) { case 0x00: ADDW; PutbackRMWord(ModRM,dst); break; @@ -321,10 +321,10 @@ OP( 0x85, i_test_wr16 ) { DEF_wr16; ANDW; CLKR(14,14,8,14,10,6,2,m_EA); } OP( 0x86, i_xchg_br8 ) { DEF_br8; RegByte(ModRM)=dst; PutbackRMByte(ModRM,src); CLKM(3,3,3,16,18,8); } OP( 0x87, i_xchg_wr16 ) { DEF_wr16; RegWord(ModRM)=dst; PutbackRMWord(ModRM,src); CLKR(24,24,12,24,16,8,3,m_EA); } -OP( 0x88, i_mov_br8 ) { UINT8 src; GetModRM; src = RegByte(ModRM); PutRMByte(ModRM,src); CLKM(2,2,2,9,9,3); } -OP( 0x89, i_mov_wr16 ) { UINT16 src; GetModRM; src = RegWord(ModRM); PutRMWord(ModRM,src); CLKR(13,13,5,13,9,3,2,m_EA); } -OP( 0x8a, i_mov_r8b ) { UINT8 src; GetModRM; src = GetRMByte(ModRM); RegByte(ModRM)=src; CLKM(2,2,2,11,11,5); } -OP( 0x8b, i_mov_r16w ) { UINT16 src; GetModRM; src = GetRMWord(ModRM); RegWord(ModRM)=src; CLKR(15,15,7,15,11,5,2,m_EA); } +OP( 0x88, i_mov_br8 ) { uint8_t src; GetModRM; src = RegByte(ModRM); PutRMByte(ModRM,src); CLKM(2,2,2,9,9,3); } +OP( 0x89, i_mov_wr16 ) { uint16_t src; GetModRM; src = RegWord(ModRM); PutRMWord(ModRM,src); CLKR(13,13,5,13,9,3,2,m_EA); } +OP( 0x8a, i_mov_r8b ) { uint8_t src; GetModRM; src = GetRMByte(ModRM); RegByte(ModRM)=src; CLKM(2,2,2,11,11,5); } +OP( 0x8b, i_mov_r16w ) { uint16_t src; GetModRM; src = GetRMWord(ModRM); RegWord(ModRM)=src; CLKR(15,15,7,15,11,5,2,m_EA); } OP( 0x8c, i_mov_wsreg ) { GetModRM; switch (ModRM & 0x38) { case 0x00: PutRMWord(ModRM,Sreg(DS1)); CLKR(14,14,5,14,10,3,2,m_EA); break; @@ -334,8 +334,8 @@ OP( 0x8c, i_mov_wsreg ) { GetModRM; default: logerror("%06x: MOV Sreg - Invalid register\n",PC()); } } -OP( 0x8d, i_lea ) { UINT16 ModRM = FETCH(); (void)(this->*s_GetEA[ModRM])(); RegWord(ModRM)=m_EO; CLKS(4,4,2); } -OP( 0x8e, i_mov_sregw ) { UINT16 src; GetModRM; src = GetRMWord(ModRM); CLKR(15,15,7,15,11,5,2,m_EA); +OP( 0x8d, i_lea ) { uint16_t ModRM = FETCH(); (void)(this->*s_GetEA[ModRM])(); RegWord(ModRM)=m_EO; CLKS(4,4,2); } +OP( 0x8e, i_mov_sregw ) { uint16_t src; GetModRM; src = GetRMWord(ModRM); CLKR(15,15,7,15,11,5,2,m_EA); switch (ModRM & 0x38) { case 0x00: Sreg(DS1) = src; break; /* mov es,ew */ case 0x08: Sreg(PS) = src; break; /* mov cs,ew */ @@ -345,7 +345,7 @@ OP( 0x8e, i_mov_sregw ) { UINT16 src; GetModRM; src = GetRMWord(ModRM); CLKR(15, } m_no_interrupt=1; } -OP( 0x8f, i_popw ) { UINT16 tmp; GetModRM; POP(tmp); PutRMWord(ModRM,tmp); m_icount-=21; } +OP( 0x8f, i_popw ) { uint16_t tmp; GetModRM; POP(tmp); PutRMWord(ModRM,tmp); m_icount-=21; } OP( 0x90, i_nop ) { CLK(3); /* { if (m_MF == 0) printf("90 -> %06x: \n",PC()); } */ } OP( 0x91, i_xchg_axcx ) { XchgAWReg(CW); CLK(3); } OP( 0x92, i_xchg_axdx ) { XchgAWReg(DW); CLK(3); } @@ -357,21 +357,21 @@ OP( 0x97, i_xchg_axdi ) { XchgAWReg(IY); CLK(3); } OP( 0x98, i_cbw ) { Breg(AH) = (Breg(AL) & 0x80) ? 0xff : 0; CLK(2); } OP( 0x99, i_cwd ) { Wreg(DW) = (Breg(AH) & 0x80) ? 0xffff : 0; CLK(4); } -OP( 0x9a, i_call_far ) { UINT32 tmp, tmp2; tmp = FETCHWORD(); tmp2 = FETCHWORD(); PUSH(Sreg(PS)); PUSH(m_ip); m_ip = (WORD)tmp; Sreg(PS) = (WORD)tmp2; CHANGE_PC; CLKW(29,29,13,29,21,9,Wreg(SP)); } +OP( 0x9a, i_call_far ) { uint32_t tmp, tmp2; tmp = FETCHWORD(); tmp2 = FETCHWORD(); PUSH(Sreg(PS)); PUSH(m_ip); m_ip = (WORD)tmp; Sreg(PS) = (WORD)tmp2; CHANGE_PC; CLKW(29,29,13,29,21,9,Wreg(SP)); } OP( 0x9b, i_wait ) { if (!m_poll_state) m_ip--; CLK(5); } -OP( 0x9c, i_pushf ) { UINT16 tmp = CompressFlags(); PUSH( tmp ); CLKS(12,8,3); } -OP( 0x9d, i_popf ) { UINT32 tmp; POP(tmp); ExpandFlags(tmp); CLKS(12,8,5); if (m_TF) nec_trap(); } -OP( 0x9e, i_sahf ) { UINT32 tmp = (CompressFlags() & 0xff00) | (Breg(AH) & 0xd5); ExpandFlags(tmp); CLKS(3,3,2); } +OP( 0x9c, i_pushf ) { uint16_t tmp = CompressFlags(); PUSH( tmp ); CLKS(12,8,3); } +OP( 0x9d, i_popf ) { uint32_t tmp; POP(tmp); ExpandFlags(tmp); CLKS(12,8,5); if (m_TF) nec_trap(); } +OP( 0x9e, i_sahf ) { uint32_t tmp = (CompressFlags() & 0xff00) | (Breg(AH) & 0xd5); ExpandFlags(tmp); CLKS(3,3,2); } OP( 0x9f, i_lahf ) { Breg(AH) = CompressFlags() & 0xff; CLKS(3,3,2); } -OP( 0xa0, i_mov_aldisp ) { UINT32 addr; addr = FETCHWORD(); Breg(AL) = GetMemB(DS0, addr); CLKS(10,10,5); } -OP( 0xa1, i_mov_axdisp ) { UINT32 addr; addr = FETCHWORD(); Wreg(AW) = GetMemW(DS0, addr); CLKW(14,14,7,14,10,5,addr); } -OP( 0xa2, i_mov_dispal ) { UINT32 addr; addr = FETCHWORD(); PutMemB(DS0, addr, Breg(AL)); CLKS(9,9,3); } -OP( 0xa3, i_mov_dispax ) { UINT32 addr; addr = FETCHWORD(); PutMemW(DS0, addr, Wreg(AW)); CLKW(13,13,5,13,9,3,addr); } -OP( 0xa4, i_movsb ) { UINT32 tmp = GetMemB(DS0,Wreg(IX)); PutMemB(DS1,Wreg(IY), tmp); Wreg(IY) += -2 * m_DF + 1; Wreg(IX) += -2 * m_DF + 1; CLKS(8,8,6); } -OP( 0xa5, i_movsw ) { UINT32 tmp = GetMemW(DS0,Wreg(IX)); PutMemW(DS1,Wreg(IY), tmp); Wreg(IY) += -4 * m_DF + 2; Wreg(IX) += -4 * m_DF + 2; CLKS(16,16,10); } -OP( 0xa6, i_cmpsb ) { UINT32 src = GetMemB(DS1, Wreg(IY)); UINT32 dst = GetMemB(DS0, Wreg(IX)); SUBB; Wreg(IY) += -2 * m_DF + 1; Wreg(IX) += -2 * m_DF + 1; CLKS(14,14,14); } -OP( 0xa7, i_cmpsw ) { UINT32 src = GetMemW(DS1, Wreg(IY)); UINT32 dst = GetMemW(DS0, Wreg(IX)); SUBW; Wreg(IY) += -4 * m_DF + 2; Wreg(IX) += -4 * m_DF + 2; CLKS(14,14,14); } +OP( 0xa0, i_mov_aldisp ) { uint32_t addr; addr = FETCHWORD(); Breg(AL) = GetMemB(DS0, addr); CLKS(10,10,5); } +OP( 0xa1, i_mov_axdisp ) { uint32_t addr; addr = FETCHWORD(); Wreg(AW) = GetMemW(DS0, addr); CLKW(14,14,7,14,10,5,addr); } +OP( 0xa2, i_mov_dispal ) { uint32_t addr; addr = FETCHWORD(); PutMemB(DS0, addr, Breg(AL)); CLKS(9,9,3); } +OP( 0xa3, i_mov_dispax ) { uint32_t addr; addr = FETCHWORD(); PutMemW(DS0, addr, Wreg(AW)); CLKW(13,13,5,13,9,3,addr); } +OP( 0xa4, i_movsb ) { uint32_t tmp = GetMemB(DS0,Wreg(IX)); PutMemB(DS1,Wreg(IY), tmp); Wreg(IY) += -2 * m_DF + 1; Wreg(IX) += -2 * m_DF + 1; CLKS(8,8,6); } +OP( 0xa5, i_movsw ) { uint32_t tmp = GetMemW(DS0,Wreg(IX)); PutMemW(DS1,Wreg(IY), tmp); Wreg(IY) += -4 * m_DF + 2; Wreg(IX) += -4 * m_DF + 2; CLKS(16,16,10); } +OP( 0xa6, i_cmpsb ) { uint32_t src = GetMemB(DS1, Wreg(IY)); uint32_t dst = GetMemB(DS0, Wreg(IX)); SUBB; Wreg(IY) += -2 * m_DF + 1; Wreg(IX) += -2 * m_DF + 1; CLKS(14,14,14); } +OP( 0xa7, i_cmpsw ) { uint32_t src = GetMemW(DS1, Wreg(IY)); uint32_t dst = GetMemW(DS0, Wreg(IX)); SUBW; Wreg(IY) += -4 * m_DF + 2; Wreg(IX) += -4 * m_DF + 2; CLKS(14,14,14); } OP( 0xa8, i_test_ald8 ) { DEF_ald8; ANDB; CLKS(4,4,2); } OP( 0xa9, i_test_axd16 ) { DEF_axd16; ANDW; CLKS(4,4,2); } @@ -379,8 +379,8 @@ OP( 0xaa, i_stosb ) { PutMemB(DS1,Wreg(IY),Breg(AL)); Wreg(IY) += -2 * m_D OP( 0xab, i_stosw ) { PutMemW(DS1,Wreg(IY),Wreg(AW)); Wreg(IY) += -4 * m_DF + 2; CLKW(8,8,5,8,4,3,Wreg(IY)); } OP( 0xac, i_lodsb ) { Breg(AL) = GetMemB(DS0,Wreg(IX)); Wreg(IX) += -2 * m_DF + 1; CLKS(4,4,3); } OP( 0xad, i_lodsw ) { Wreg(AW) = GetMemW(DS0,Wreg(IX)); Wreg(IX) += -4 * m_DF + 2; CLKW(8,8,5,8,4,3,Wreg(IX)); } -OP( 0xae, i_scasb ) { UINT32 src = GetMemB(DS1, Wreg(IY)); UINT32 dst = Breg(AL); SUBB; Wreg(IY) += -2 * m_DF + 1; CLKS(4,4,3); } -OP( 0xaf, i_scasw ) { UINT32 src = GetMemW(DS1, Wreg(IY)); UINT32 dst = Wreg(AW); SUBW; Wreg(IY) += -4 * m_DF + 2; CLKW(8,8,5,8,4,3,Wreg(IY)); } +OP( 0xae, i_scasb ) { uint32_t src = GetMemB(DS1, Wreg(IY)); uint32_t dst = Breg(AL); SUBB; Wreg(IY) += -2 * m_DF + 1; CLKS(4,4,3); } +OP( 0xaf, i_scasw ) { uint32_t src = GetMemW(DS1, Wreg(IY)); uint32_t dst = Wreg(AW); SUBW; Wreg(IY) += -4 * m_DF + 2; CLKW(8,8,5,8,4,3,Wreg(IY)); } OP( 0xb0, i_mov_ald8 ) { Breg(AL) = FETCH(); CLKS(4,4,2); } OP( 0xb1, i_mov_cld8 ) { Breg(CL) = FETCH(); CLKS(4,4,2); } @@ -401,7 +401,7 @@ OP( 0xbe, i_mov_sid16 ) { Wreg(IX) = FETCHWORD(); CLKS(4,4,2); } OP( 0xbf, i_mov_did16 ) { Wreg(IY) = FETCHWORD(); CLKS(4,4,2); } OP( 0xc0, i_rotshft_bd8 ) { - UINT32 src, dst; UINT8 c; + uint32_t src, dst; uint8_t c; GetModRM; src = (unsigned)GetRMByte(ModRM); dst=src; c=FETCH(); CLKM(7,7,2,19,19,6); @@ -418,7 +418,7 @@ OP( 0xc0, i_rotshft_bd8 ) { } OP( 0xc1, i_rotshft_wd8 ) { - UINT32 src, dst; UINT8 c; + uint32_t src, dst; uint8_t c; GetModRM; src = (unsigned)GetRMWord(ModRM); dst=src; c=FETCH(); CLKM(7,7,2,27,19,6); @@ -434,7 +434,7 @@ OP( 0xc1, i_rotshft_wd8 ) { } } -OP( 0xc2, i_ret_d16 ) { UINT32 count = FETCH(); count += FETCH() << 8; POP(m_ip); Wreg(SP)+=count; CHANGE_PC; CLKS(24,24,10); } +OP( 0xc2, i_ret_d16 ) { uint32_t count = FETCH(); count += FETCH() << 8; POP(m_ip); Wreg(SP)+=count; CHANGE_PC; CLKS(24,24,10); } OP( 0xc3, i_ret ) { POP(m_ip); CHANGE_PC; CLKS(19,19,10); } OP( 0xc4, i_les_dw ) { GetModRM; WORD tmp = GetRMWord(ModRM); RegWord(ModRM)=tmp; Sreg(DS1) = GetnextRMWord; CLKW(26,26,14,26,18,10,m_EA); } OP( 0xc5, i_lds_dw ) { GetModRM; WORD tmp = GetRMWord(ModRM); RegWord(ModRM)=tmp; Sreg(DS0) = GetnextRMWord; CLKW(26,26,14,26,18,10,m_EA); } @@ -442,8 +442,8 @@ OP( 0xc6, i_mov_bd8 ) { GetModRM; PutImmRMByte(ModRM); m_icount-=(ModRM >=0xc0 OP( 0xc7, i_mov_wd16 ) { GetModRM; PutImmRMWord(ModRM); m_icount-=(ModRM >=0xc0 )?4:15; } OP( 0xc8, i_enter ) { - UINT32 nb = FETCH(); - UINT32 i,level; + uint32_t nb = FETCH(); + uint32_t i,level; m_icount-=23; nb += FETCH() << 8; @@ -462,7 +462,7 @@ OP( 0xc9, i_leave ) { POP(Wreg(BP)); m_icount-=8; } -OP( 0xca, i_retf_d16 ) { UINT32 count = FETCH(); count += FETCH() << 8; POP(m_ip); POP(Sreg(PS)); Wreg(SP)+=count; CHANGE_PC; CLKS(32,32,16); } +OP( 0xca, i_retf_d16 ) { uint32_t count = FETCH(); count += FETCH() << 8; POP(m_ip); POP(Sreg(PS)); Wreg(SP)+=count; CHANGE_PC; CLKS(32,32,16); } OP( 0xcb, i_retf ) { POP(m_ip); POP(Sreg(PS)); CHANGE_PC; CLKS(29,29,16); } OP( 0xcc, i_int3 ) { nec_interrupt(3, BRK); CLKS(50,50,24); } OP( 0xcd, i_int ) { nec_interrupt(FETCH(), BRK); CLKS(50,50,24); } @@ -470,7 +470,7 @@ OP( 0xce, i_into ) { if (OF) { nec_interrupt(NEC_BRKV_VECTOR, BRK); CLKS(52 OP( 0xcf, i_iret ) { POP(m_ip); POP(Sreg(PS)); i_popf(); CHANGE_PC; CLKS(39,39,19); } OP( 0xd0, i_rotshft_b ) { - UINT32 src, dst; GetModRM; src = (UINT32)GetRMByte(ModRM); dst=src; + uint32_t src, dst; GetModRM; src = (uint32_t)GetRMByte(ModRM); dst=src; CLKM(6,6,2,16,16,7); switch (ModRM & 0x38) { case 0x00: ROL_BYTE; PutbackRMByte(ModRM,(BYTE)dst); m_OverVal = (src^dst)&0x80; break; @@ -485,7 +485,7 @@ OP( 0xd0, i_rotshft_b ) { } OP( 0xd1, i_rotshft_w ) { - UINT32 src, dst; GetModRM; src = (UINT32)GetRMWord(ModRM); dst=src; + uint32_t src, dst; GetModRM; src = (uint32_t)GetRMWord(ModRM); dst=src; CLKM(6,6,2,24,16,7); switch (ModRM & 0x38) { case 0x00: ROL_WORD; PutbackRMWord(ModRM,(WORD)dst); m_OverVal = (src^dst)&0x8000; break; @@ -500,7 +500,7 @@ OP( 0xd1, i_rotshft_w ) { } OP( 0xd2, i_rotshft_bcl ) { - UINT32 src, dst; UINT8 c; GetModRM; src = (UINT32)GetRMByte(ModRM); dst=src; + uint32_t src, dst; uint8_t c; GetModRM; src = (uint32_t)GetRMByte(ModRM); dst=src; c=Breg(CL); CLKM(7,7,2,19,19,6); if (c) switch (ModRM & 0x38) { @@ -516,7 +516,7 @@ OP( 0xd2, i_rotshft_bcl ) { } OP( 0xd3, i_rotshft_wcl ) { - UINT32 src, dst; UINT8 c; GetModRM; src = (UINT32)GetRMWord(ModRM); dst=src; + uint32_t src, dst; uint8_t c; GetModRM; src = (uint32_t)GetRMWord(ModRM); dst=src; c=Breg(CL); CLKM(7,7,2,27,19,6); if (c) switch (ModRM & 0x38) { @@ -534,29 +534,29 @@ OP( 0xd3, i_rotshft_wcl ) { OP( 0xd4, i_aam ) { FETCH(); Breg(AH) = Breg(AL) / 10; Breg(AL) %= 10; SetSZPF_Word(Wreg(AW)); CLKS(15,15,12); } OP( 0xd5, i_aad ) { FETCH(); Breg(AL) = Breg(AH) * 10 + Breg(AL); Breg(AH) = 0; SetSZPF_Byte(Breg(AL)); CLKS(7,7,8); } OP( 0xd6, i_setalc ) { Breg(AL) = (CF)?0xff:0x00; m_icount-=3; logerror("%06x: Undefined opcode (SETALC)\n",PC()); } -OP( 0xd7, i_trans ) { UINT32 dest = (Wreg(BW)+Breg(AL))&0xffff; Breg(AL) = GetMemB(DS0, dest); CLKS(9,9,5); } +OP( 0xd7, i_trans ) { uint32_t dest = (Wreg(BW)+Breg(AL))&0xffff; Breg(AL) = GetMemB(DS0, dest); CLKS(9,9,5); } OP( 0xd8, i_fpo ) { GetModRM; GetRMByte(ModRM); m_icount-=2; logerror("%06x: Unimplemented floating point control %04x\n",PC(),ModRM); } -OP( 0xe0, i_loopne ) { INT8 disp = (INT8)FETCH(); Wreg(CW)--; if (!ZF && Wreg(CW)) { m_ip = (WORD)(m_ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } -OP( 0xe1, i_loope ) { INT8 disp = (INT8)FETCH(); Wreg(CW)--; if ( ZF && Wreg(CW)) { m_ip = (WORD)(m_ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } -OP( 0xe2, i_loop ) { INT8 disp = (INT8)FETCH(); Wreg(CW)--; if (Wreg(CW)) { m_ip = (WORD)(m_ip+disp); /*CHANGE_PC;*/ CLKS(13,13,6); } else CLKS(5,5,3); } -OP( 0xe3, i_jcxz ) { INT8 disp = (INT8)FETCH(); if (Wreg(CW) == 0) { m_ip = (WORD)(m_ip+disp); /*CHANGE_PC;*/ CLKS(13,13,6); } else CLKS(5,5,3); } -OP( 0xe4, i_inal ) { UINT8 port = FETCH(); Breg(AL) = read_port_byte(port); CLKS(9,9,5); } -OP( 0xe5, i_inax ) { UINT8 port = FETCH(); Wreg(AW) = read_port_word(port); CLKW(13,13,7,13,9,5,port); } -OP( 0xe6, i_outal ) { UINT8 port = FETCH(); write_port_byte(port, Breg(AL)); CLKS(8,8,3); } -OP( 0xe7, i_outax ) { UINT8 port = FETCH(); write_port_word(port, Wreg(AW)); CLKW(12,12,5,12,8,3,port); } - -OP( 0xe8, i_call_d16 ) { UINT32 tmp; tmp = FETCHWORD(); PUSH(m_ip); m_ip = (WORD)(m_ip+(INT16)tmp); CHANGE_PC; m_icount-=24; } -OP( 0xe9, i_jmp_d16 ) { UINT32 tmp; tmp = FETCHWORD(); m_ip = (WORD)(m_ip+(INT16)tmp); CHANGE_PC; m_icount-=15; } -OP( 0xea, i_jmp_far ) { UINT32 tmp,tmp1; tmp = FETCHWORD(); tmp1 = FETCHWORD(); Sreg(PS) = (WORD)tmp1; m_ip = (WORD)tmp; CHANGE_PC; m_icount-=27; } -OP( 0xeb, i_jmp_d8 ) { int tmp = (int)((INT8)FETCH()); m_icount-=12; m_ip = (WORD)(m_ip+tmp); } +OP( 0xe0, i_loopne ) { int8_t disp = (int8_t)FETCH(); Wreg(CW)--; if (!ZF && Wreg(CW)) { m_ip = (WORD)(m_ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } +OP( 0xe1, i_loope ) { int8_t disp = (int8_t)FETCH(); Wreg(CW)--; if ( ZF && Wreg(CW)) { m_ip = (WORD)(m_ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } +OP( 0xe2, i_loop ) { int8_t disp = (int8_t)FETCH(); Wreg(CW)--; if (Wreg(CW)) { m_ip = (WORD)(m_ip+disp); /*CHANGE_PC;*/ CLKS(13,13,6); } else CLKS(5,5,3); } +OP( 0xe3, i_jcxz ) { int8_t disp = (int8_t)FETCH(); if (Wreg(CW) == 0) { m_ip = (WORD)(m_ip+disp); /*CHANGE_PC;*/ CLKS(13,13,6); } else CLKS(5,5,3); } +OP( 0xe4, i_inal ) { uint8_t port = FETCH(); Breg(AL) = read_port_byte(port); CLKS(9,9,5); } +OP( 0xe5, i_inax ) { uint8_t port = FETCH(); Wreg(AW) = read_port_word(port); CLKW(13,13,7,13,9,5,port); } +OP( 0xe6, i_outal ) { uint8_t port = FETCH(); write_port_byte(port, Breg(AL)); CLKS(8,8,3); } +OP( 0xe7, i_outax ) { uint8_t port = FETCH(); write_port_word(port, Wreg(AW)); CLKW(12,12,5,12,8,3,port); } + +OP( 0xe8, i_call_d16 ) { uint32_t tmp; tmp = FETCHWORD(); PUSH(m_ip); m_ip = (WORD)(m_ip+(int16_t)tmp); CHANGE_PC; m_icount-=24; } +OP( 0xe9, i_jmp_d16 ) { uint32_t tmp; tmp = FETCHWORD(); m_ip = (WORD)(m_ip+(int16_t)tmp); CHANGE_PC; m_icount-=15; } +OP( 0xea, i_jmp_far ) { uint32_t tmp,tmp1; tmp = FETCHWORD(); tmp1 = FETCHWORD(); Sreg(PS) = (WORD)tmp1; m_ip = (WORD)tmp; CHANGE_PC; m_icount-=27; } +OP( 0xeb, i_jmp_d8 ) { int tmp = (int)((int8_t)FETCH()); m_icount-=12; m_ip = (WORD)(m_ip+tmp); } OP( 0xec, i_inaldx ) { Breg(AL) = read_port_byte(Wreg(DW)); CLKS(8,8,5);} OP( 0xed, i_inaxdx ) { Wreg(AW) = read_port_word(Wreg(DW)); CLKW(12,12,7,12,8,5,Wreg(DW)); } OP( 0xee, i_outdxal ) { write_port_byte(Wreg(DW), Breg(AL)); CLKS(8,8,3); } OP( 0xef, i_outdxax ) { write_port_word(Wreg(DW), Wreg(AW)); CLKW(12,12,5,12,8,3,Wreg(DW)); } OP( 0xf0, i_lock ) { logerror("%06x: Warning - BUSLOCK\n",PC()); m_no_interrupt=1; CLK(2); } -OP( 0xf2, i_repne ) { UINT32 next = fetchop(); UINT16 c = Wreg(CW); +OP( 0xf2, i_repne ) { uint32_t next = fetchop(); uint16_t c = Wreg(CW); switch(next) { /* Segments */ case 0x26: m_seg_prefix=TRUE; m_prefix_base=Sreg(DS1)<<4; next = fetchop(); CLK(2); break; case 0x2e: m_seg_prefix=TRUE; m_prefix_base=Sreg(PS)<<4; next = fetchop(); CLK(2); break; @@ -583,7 +583,7 @@ OP( 0xf2, i_repne ) { UINT32 next = fetchop(); UINT16 c = Wreg(CW); } m_seg_prefix=FALSE; } -OP( 0xf3, i_repe ) { UINT32 next = fetchop(); UINT16 c = Wreg(CW); +OP( 0xf3, i_repe ) { uint32_t next = fetchop(); uint16_t c = Wreg(CW); switch(next) { /* Segments */ case 0x26: m_seg_prefix=TRUE; m_prefix_base=Sreg(DS1)<<4; next = fetchop(); CLK(2); break; case 0x2e: m_seg_prefix=TRUE; m_prefix_base=Sreg(PS)<<4; next = fetchop(); CLK(2); break; @@ -612,7 +612,7 @@ OP( 0xf3, i_repe ) { UINT32 next = fetchop(); UINT16 c = Wreg(CW); } OP( 0xf4, i_hlt ) { logerror("%06x: HALT\n",PC()); m_halted=1; m_icount=0; } OP( 0xf5, i_cmc ) { m_CarryVal = !CF; CLK(2); } -OP( 0xf6, i_f6pre ) { UINT32 tmp; UINT32 uresult,uresult2; INT32 result,result2; +OP( 0xf6, i_f6pre ) { uint32_t tmp; uint32_t uresult,uresult2; int32_t result,result2; GetModRM; tmp = GetRMByte(ModRM); switch (ModRM & 0x38) { case 0x00: tmp &= FETCH(); m_CarryVal = m_OverVal = 0; SetSZPF_Byte(tmp); m_icount-=(ModRM >=0xc0 )?4:11; break; /* TEST */ @@ -620,21 +620,21 @@ OP( 0xf6, i_f6pre ) { UINT32 tmp; UINT32 uresult,uresult2; INT32 result,result2; case 0x10: PutbackRMByte(ModRM,~tmp); m_icount-=(ModRM >=0xc0 )?2:16; break; /* NOT */ case 0x18: m_CarryVal=(tmp!=0); tmp=(~tmp)+1; SetSZPF_Byte(tmp); PutbackRMByte(ModRM,tmp&0xff); m_icount-=(ModRM >=0xc0 )?2:16; break; /* NEG */ case 0x20: uresult = Breg(AL)*tmp; Wreg(AW)=(WORD)uresult; m_CarryVal=m_OverVal=(Breg(AH)!=0); m_icount-=(ModRM >=0xc0 )?30:36; break; /* MULU */ - case 0x28: result = (INT16)((INT8)Breg(AL))*(INT16)((INT8)tmp); Wreg(AW)=(WORD)result; m_CarryVal=m_OverVal=(Breg(AH)!=0); m_icount-=(ModRM >=0xc0 )?30:36; break; /* MUL */ + case 0x28: result = (int16_t)((int8_t)Breg(AL))*(int16_t)((int8_t)tmp); Wreg(AW)=(WORD)result; m_CarryVal=m_OverVal=(Breg(AH)!=0); m_icount-=(ModRM >=0xc0 )?30:36; break; /* MUL */ case 0x30: if (tmp) { DIVUB; } else nec_interrupt(NEC_DIVIDE_VECTOR, BRK); m_icount-=(ModRM >=0xc0 )?43:53; break; case 0x38: if (tmp) { DIVB; } else nec_interrupt(NEC_DIVIDE_VECTOR, BRK); m_icount-=(ModRM >=0xc0 )?43:53; break; } } -OP( 0xf7, i_f7pre ) { UINT32 tmp,tmp2; UINT32 uresult,uresult2; INT32 result,result2; +OP( 0xf7, i_f7pre ) { uint32_t tmp,tmp2; uint32_t uresult,uresult2; int32_t result,result2; GetModRM; tmp = GetRMWord(ModRM); switch (ModRM & 0x38) { case 0x00: tmp2 = FETCHWORD(); tmp &= tmp2; m_CarryVal = m_OverVal = 0; SetSZPF_Word(tmp); m_icount-=(ModRM >=0xc0 )?4:11; break; /* TEST */ case 0x08: logerror("%06x: Undefined opcode 0xf7 0x08\n",PC()); break; case 0x10: PutbackRMWord(ModRM,~tmp); m_icount-=(ModRM >=0xc0 )?2:16; break; /* NOT */ case 0x18: m_CarryVal=(tmp!=0); tmp=(~tmp)+1; SetSZPF_Word(tmp); PutbackRMWord(ModRM,tmp&0xffff); m_icount-=(ModRM >=0xc0 )?2:16; break; /* NEG */ - case 0x20: uresult = Wreg(AW)*tmp; Wreg(AW)=uresult&0xffff; Wreg(DW)=((UINT32)uresult)>>16; m_CarryVal=m_OverVal=(Wreg(DW)!=0); m_icount-=(ModRM >=0xc0 )?30:36; break; /* MULU */ - case 0x28: result = (INT32)((INT16)Wreg(AW))*(INT32)((INT16)tmp); Wreg(AW)=result&0xffff; Wreg(DW)=result>>16; m_CarryVal=m_OverVal=(Wreg(DW)!=0); m_icount-=(ModRM >=0xc0 )?30:36; break; /* MUL */ + case 0x20: uresult = Wreg(AW)*tmp; Wreg(AW)=uresult&0xffff; Wreg(DW)=((uint32_t)uresult)>>16; m_CarryVal=m_OverVal=(Wreg(DW)!=0); m_icount-=(ModRM >=0xc0 )?30:36; break; /* MULU */ + case 0x28: result = (int32_t)((int16_t)Wreg(AW))*(int32_t)((int16_t)tmp); Wreg(AW)=result&0xffff; Wreg(DW)=result>>16; m_CarryVal=m_OverVal=(Wreg(DW)!=0); m_icount-=(ModRM >=0xc0 )?30:36; break; /* MUL */ case 0x30: if (tmp) { DIVUW; } else nec_interrupt(NEC_DIVIDE_VECTOR, BRK); m_icount-=(ModRM >=0xc0 )?43:53; break; case 0x38: if (tmp) { DIVW; } else nec_interrupt(NEC_DIVIDE_VECTOR, BRK); m_icount-=(ModRM >=0xc0 )?43:53; break; } @@ -646,14 +646,14 @@ OP( 0xfa, i_di ) { SetIF(0); CLK(2); } OP( 0xfb, i_ei ) { SetIF(1); CLK(2); } OP( 0xfc, i_cld ) { SetDF(0); CLK(2); } OP( 0xfd, i_std ) { SetDF(1); CLK(2); } -OP( 0xfe, i_fepre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMByte(ModRM); +OP( 0xfe, i_fepre ) { uint32_t tmp, tmp1; GetModRM; tmp=GetRMByte(ModRM); switch(ModRM & 0x38) { case 0x00: tmp1 = tmp+1; m_OverVal = (tmp==0x7f); SetAF(tmp1,tmp,1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM,(BYTE)tmp1); CLKM(2,2,2,16,16,7); break; /* INC */ case 0x08: tmp1 = tmp-1; m_OverVal = (tmp==0x80); SetAF(tmp1,tmp,1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM,(BYTE)tmp1); CLKM(2,2,2,16,16,7); break; /* DEC */ default: logerror("%06x: FE Pre with unimplemented mod\n",PC()); } } -OP( 0xff, i_ffpre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMWord(ModRM); +OP( 0xff, i_ffpre ) { uint32_t tmp, tmp1; GetModRM; tmp=GetRMWord(ModRM); switch(ModRM & 0x38) { case 0x00: tmp1 = tmp+1; m_OverVal = (tmp==0x7fff); SetAF(tmp1,tmp,1); SetSZPF_Word(tmp1); PutbackRMWord(ModRM,(WORD)tmp1); CLKM(2,2,2,24,16,7); break; /* INC */ case 0x08: tmp1 = tmp-1; m_OverVal = (tmp==0x8000); SetAF(tmp1,tmp,1); SetSZPF_Word(tmp1); PutbackRMWord(ModRM,(WORD)tmp1); CLKM(2,2,2,24,16,7); break; /* DEC */ diff --git a/src/devices/cpu/nec/necmacro.h b/src/devices/cpu/nec/necmacro.h index a6091f34eba..c97f487cc2c 100644 --- a/src/devices/cpu/nec/necmacro.h +++ b/src/devices/cpu/nec/necmacro.h @@ -14,19 +14,19 @@ #define SetZF(x) (m_ZeroVal = (x)) #define SetPF(x) (m_ParityVal = (x)) -#define SetSZPF_Byte(x) (m_SignVal=m_ZeroVal=m_ParityVal=(INT8)(x)) -#define SetSZPF_Word(x) (m_SignVal=m_ZeroVal=m_ParityVal=(INT16)(x)) +#define SetSZPF_Byte(x) (m_SignVal=m_ZeroVal=m_ParityVal=(int8_t)(x)) +#define SetSZPF_Word(x) (m_SignVal=m_ZeroVal=m_ParityVal=(int16_t)(x)) #define SetOFW_Add(x,y,z) (m_OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x8000) #define SetOFB_Add(x,y,z) (m_OverVal = ((x) ^ (y)) & ((x) ^ (z)) & 0x80) #define SetOFW_Sub(x,y,z) (m_OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x8000) #define SetOFB_Sub(x,y,z) (m_OverVal = ((z) ^ (y)) & ((z) ^ (x)) & 0x80) -#define ADDB { UINT32 res=dst+src; SetCFB(res); SetOFB_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } -#define ADDW { UINT32 res=dst+src; SetCFW(res); SetOFW_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } +#define ADDB { uint32_t res=dst+src; SetCFB(res); SetOFB_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } +#define ADDW { uint32_t res=dst+src; SetCFW(res); SetOFW_Add(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } -#define SUBB { UINT32 res=dst-src; SetCFB(res); SetOFB_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } -#define SUBW { UINT32 res=dst-src; SetCFW(res); SetOFW_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } +#define SUBB { uint32_t res=dst-src; SetCFB(res); SetOFB_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Byte(res); dst=(BYTE)res; } +#define SUBW { uint32_t res=dst-src; SetCFW(res); SetOFW_Sub(res,src,dst); SetAF(res,src,dst); SetSZPF_Word(res); dst=(WORD)res; } #define ORB dst|=src; m_CarryVal=m_OverVal=m_AuxVal=0; SetSZPF_Byte(dst) #define ORW dst|=src; m_CarryVal=m_OverVal=m_AuxVal=0; SetSZPF_Word(dst) @@ -56,10 +56,10 @@ #define JMP(flag) \ int tmp; \ EMPTY_PREFETCH(); \ - tmp = (int)((INT8)FETCH()); \ + tmp = (int)((int8_t)FETCH()); \ if (flag) \ { \ - static const UINT8 table[3]={3,10,10}; \ + static const uint8_t table[3]={3,10,10}; \ m_ip = (WORD)(m_ip+tmp); \ m_icount-=table[m_chip_type/8]; \ CHANGE_PC; \ @@ -69,7 +69,7 @@ #define ADJ4(param1,param2) \ if (AF || ((Breg(AL) & 0xf) > 9)) \ { \ - UINT16 tmp; \ + uint16_t tmp; \ tmp = Breg(AL) + param1; \ Breg(AL) = tmp; \ m_AuxVal = 1; \ @@ -141,8 +141,8 @@ #define SHL_WORD(c) m_icount-=c; dst <<= c; SetCFW(dst); SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) #define SHR_BYTE(c) m_icount-=c; dst >>= c-1; m_CarryVal = dst & 0x1; dst >>= 1; SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) #define SHR_WORD(c) m_icount-=c; dst >>= c-1; m_CarryVal = dst & 0x1; dst >>= 1; SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) -#define SHRA_BYTE(c) m_icount-=c; dst = ((INT8)dst) >> (c-1); m_CarryVal = dst & 0x1; dst = ((INT8)((BYTE)dst)) >> 1; SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) -#define SHRA_WORD(c) m_icount-=c; dst = ((INT16)dst) >> (c-1); m_CarryVal = dst & 0x1; dst = ((INT16)((WORD)dst)) >> 1; SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) +#define SHRA_BYTE(c) m_icount-=c; dst = ((int8_t)dst) >> (c-1); m_CarryVal = dst & 0x1; dst = ((int8_t)((BYTE)dst)) >> 1; SetSZPF_Byte(dst); PutbackRMByte(ModRM,(BYTE)dst) +#define SHRA_WORD(c) m_icount-=c; dst = ((int16_t)dst) >> (c-1); m_CarryVal = dst & 0x1; dst = ((int16_t)((WORD)dst)) >> 1; SetSZPF_Word(dst); PutbackRMWord(ModRM,(WORD)dst) #define DIVUB \ uresult = Wreg(AW); \ @@ -155,9 +155,9 @@ } #define DIVB \ - result = (INT16)Wreg(AW); \ - result2 = result % (INT16)((INT8)tmp); \ - if ((result /= (INT16)((INT8)tmp)) > 0xff) { \ + result = (int16_t)Wreg(AW); \ + result2 = result % (int16_t)((int8_t)tmp); \ + if ((result /= (int16_t)((int8_t)tmp)) > 0xff) { \ nec_interrupt(NEC_DIVIDE_VECTOR, BRK); break; \ } else { \ Breg(AL) = result; \ @@ -165,7 +165,7 @@ } #define DIVUW \ - uresult = (((UINT32)Wreg(DW)) << 16) | Wreg(AW);\ + uresult = (((uint32_t)Wreg(DW)) << 16) | Wreg(AW);\ uresult2 = uresult % tmp; \ if ((uresult /= tmp) > 0xffff) { \ nec_interrupt(NEC_DIVIDE_VECTOR, BRK); break; \ @@ -175,9 +175,9 @@ } #define DIVW \ - result = ((UINT32)Wreg(DW) << 16) + Wreg(AW); \ - result2 = result % (INT32)((INT16)tmp); \ - if ((result /= (INT32)((INT16)tmp)) > 0xffff) { \ + result = ((uint32_t)Wreg(DW) << 16) + Wreg(AW); \ + result2 = result % (int32_t)((int16_t)tmp); \ + if ((result /= (int32_t)((int16_t)tmp)) > 0xffff) { \ nec_interrupt(NEC_DIVIDE_VECTOR, BRK); break; \ } else { \ Wreg(AW)=result; \ @@ -189,7 +189,7 @@ int count = (Breg(CL)+1)/2; \ unsigned di = Wreg(IY); \ unsigned si = Wreg(IX); \ - static const UINT8 table[3]={18,19,19}; \ + static const uint8_t table[3]={18,19,19}; \ if (m_seg_prefix) logerror("%06x: Warning: seg_prefix defined for add4s\n",PC()); \ m_ZeroVal = m_CarryVal = 0; \ for (i=0;i>m_chip_type)&0x7f; } -#define CLKW(v20o,v30o,v33o,v20e,v30e,v33e,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; m_icount-=(addr&1)?((ocount>>m_chip_type)&0x7f):((ecount>>m_chip_type)&0x7f); } -#define CLKM(v20,v30,v33,v20m,v30m,v33m) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33, mcount=(v20m<<16)|(v30m<<8)|v33m; m_icount-=( ModRM >=0xc0 )?((ccount>>m_chip_type)&0x7f):((mcount>>m_chip_type)&0x7f); } -#define CLKR(v20o,v30o,v33o,v20e,v30e,v33e,vall,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; if (ModRM >=0xc0) m_icount-=vall; else m_icount-=(addr&1)?((ocount>>m_chip_type)&0x7f):((ecount>>m_chip_type)&0x7f); } +#define CLKS(v20,v30,v33) { const uint32_t ccount=(v20<<16)|(v30<<8)|v33; m_icount-=(ccount>>m_chip_type)&0x7f; } +#define CLKW(v20o,v30o,v33o,v20e,v30e,v33e,addr) { const uint32_t ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; m_icount-=(addr&1)?((ocount>>m_chip_type)&0x7f):((ecount>>m_chip_type)&0x7f); } +#define CLKM(v20,v30,v33,v20m,v30m,v33m) { const uint32_t ccount=(v20<<16)|(v30<<8)|v33, mcount=(v20m<<16)|(v30m<<8)|v33m; m_icount-=( ModRM >=0xc0 )?((ccount>>m_chip_type)&0x7f):((mcount>>m_chip_type)&0x7f); } +#define CLKR(v20o,v30o,v33o,v20e,v30e,v33e,vall,addr) { const uint32_t ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; if (ModRM >=0xc0) m_icount-=vall; else m_icount-=(addr&1)?((ocount>>m_chip_type)&0x7f):((ecount>>m_chip_type)&0x7f); } /************************************************************************/ #define CompressFlags() (WORD)(int(CF) | 0x02 | (int(PF) << 2) | (int(AF) << 4) | (int(ZF) << 6) \ diff --git a/src/devices/cpu/nec/v25.cpp b/src/devices/cpu/nec/v25.cpp index f67897dd3d2..6c19555718c 100644 --- a/src/devices/cpu/nec/v25.cpp +++ b/src/devices/cpu/nec/v25.cpp @@ -37,10 +37,10 @@ #include "emu.h" #include "debugger.h" -typedef UINT8 BOOLEAN; -typedef UINT8 BYTE; -typedef UINT16 WORD; -typedef UINT32 DWORD; +typedef uint8_t BOOLEAN; +typedef uint8_t BYTE; +typedef uint16_t WORD; +typedef uint32_t DWORD; #include "v25.h" #include "v25priv.h" @@ -49,7 +49,7 @@ const device_type V25 = &device_creator; const device_type V35 = &device_creator; -v25_common_device::v25_common_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, bool is_16bit, offs_t fetch_xor, UINT8 prefetch_size, UINT8 prefetch_cycles, UINT32 chip_type) +v25_common_device::v25_common_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, bool is_16bit, offs_t fetch_xor, uint8_t prefetch_size, uint8_t prefetch_cycles, uint32_t chip_type) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, is_16bit ? 16 : 8, 20, 0) , m_io_config("io", ENDIANNESS_LITTLE, is_16bit ? 16 : 8, 16, 0) @@ -70,13 +70,13 @@ v25_common_device::v25_common_device(const machine_config &mconfig, device_type } -v25_device::v25_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v25_device::v25_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : v25_common_device(mconfig, V25, "V25", tag, owner, clock, "v25", false, 0, 4, 4, V20_TYPE) { } -v35_device::v35_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v35_device::v35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : v25_common_device(mconfig, V35, "V35", tag, owner, clock, "v35", true, BYTE_XOR_LE(0), 6, 2, V30_TYPE) { } @@ -126,15 +126,15 @@ void v25_common_device::do_prefetch(int previous_ICount) } -UINT8 v25_common_device::fetch() +uint8_t v25_common_device::fetch() { prefetch(); return m_direct->read_byte((Sreg(PS)<<4)+m_ip++, m_fetch_xor); } -UINT16 v25_common_device::fetchword() +uint16_t v25_common_device::fetchword() { - UINT16 r = FETCH(); + uint16_t r = FETCH(); r |= (FETCH()<<8); return r; } @@ -146,11 +146,11 @@ UINT16 v25_common_device::fetchword() #include "necea.h" #include "necmodrm.h" -static UINT8 parity_table[256]; +static uint8_t parity_table[256]; -UINT8 v25_common_device::fetchop() +uint8_t v25_common_device::fetchop() { - UINT8 ret; + uint8_t ret; prefetch(); ret = m_direct->read_byte(( Sreg(PS)<<4)+m_ip++, m_fetch_xor); @@ -230,7 +230,7 @@ void v25_common_device::device_reset() void v25_common_device::nec_interrupt(unsigned int_num, int /*INTSOURCES*/ source) { - UINT32 dest_seg, dest_off; + uint32_t dest_seg, dest_off; i_pushf(); m_TF = m_IF = 0; @@ -358,7 +358,7 @@ void v25_common_device::external_int() { /* the actual vector is retrieved after pushing flags */ /* and clearing the IF */ - nec_interrupt((UINT32)-1, INT_IRQ); + nec_interrupt((uint32_t)-1, INT_IRQ); m_irq_state = CLEAR_LINE; m_pending_irq &= ~INT_IRQ; } @@ -411,9 +411,9 @@ void v25_common_device::execute_set_input(int irqline, int state) } } -offs_t v25_common_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t v25_common_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { - extern int necv_dasm_one(char *buffer, UINT32 eip, const UINT8 *oprom, const UINT8 *decryption_table); + extern int necv_dasm_one(char *buffer, uint32_t eip, const uint8_t *oprom, const uint8_t *decryption_table); return necv_dasm_one(buffer, pc, oprom, m_v25v35_decryptiontable); } @@ -544,7 +544,7 @@ void v25_common_device::device_start() void v25_common_device::state_string_export(const device_state_entry &entry, std::string &str) const { - UINT16 flags = CompressFlags(); + uint16_t flags = CompressFlags(); switch (entry.index()) { diff --git a/src/devices/cpu/nec/v25.h b/src/devices/cpu/nec/v25.h index f170ad03b8f..28815e16609 100644 --- a/src/devices/cpu/nec/v25.h +++ b/src/devices/cpu/nec/v25.h @@ -49,10 +49,10 @@ class v25_common_device : public cpu_device { public: // construction/destruction - v25_common_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, bool is_16bit, offs_t fetch_xor, UINT8 prefetch_size, UINT8 prefetch_cycles, UINT32 chip_type); + v25_common_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, bool is_16bit, offs_t fetch_xor, uint8_t prefetch_size, uint8_t prefetch_cycles, uint32_t chip_type); // static configuration helpers - static void set_decryption_table(device_t &device, const UINT8 *decryption_table) { downcast(device).m_v25v35_decryptiontable = decryption_table; } + static void set_decryption_table(device_t &device, const uint8_t *decryption_table) { downcast(device).m_v25v35_decryptiontable = decryption_table; } template static devcb_base & set_pt_in_cb(device_t &device, _Object object) { return downcast(device).m_pt_in.set_callback(object); } template static devcb_base & set_p0_in_cb(device_t &device, _Object object) { return downcast(device).m_p0_in.set_callback(object); } @@ -72,12 +72,12 @@ protected: virtual void device_post_load() override { notify_clock_changed(); } // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return clocks / m_PCK; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return cycles * m_PCK; } - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 80; } - virtual UINT32 execute_input_lines() const override { return 1; } - virtual UINT32 execute_default_irq_vector() const override { return 0xff; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return clocks / m_PCK; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return cycles * m_PCK; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 80; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint32_t execute_default_irq_vector() const override { return 0xff; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -90,9 +90,9 @@ protected: virtual void state_export(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -101,43 +101,43 @@ private: /* internal RAM and register banks */ union internalram { - UINT16 w[128]; - UINT8 b[256]; + uint16_t w[128]; + uint8_t b[256]; }; internalram m_ram; offs_t m_fetch_xor; - UINT16 m_ip; + uint16_t m_ip; /* PSW flags */ - INT32 m_SignVal; - UINT32 m_AuxVal, m_OverVal, m_ZeroVal, m_CarryVal, m_ParityVal; /* 0 or non-0 valued flags */ - UINT8 m_IBRK, m_F0, m_F1, m_TF, m_IF, m_DF, m_MF; /* 0 or 1 valued flags */ - UINT8 m_RBW, m_RBB; /* current register bank base, preshifted for word and byte registers */ + int32_t m_SignVal; + uint32_t m_AuxVal, m_OverVal, m_ZeroVal, m_CarryVal, m_ParityVal; /* 0 or non-0 valued flags */ + uint8_t m_IBRK, m_F0, m_F1, m_TF, m_IF, m_DF, m_MF; /* 0 or 1 valued flags */ + uint8_t m_RBW, m_RBB; /* current register bank base, preshifted for word and byte registers */ /* interrupt related */ - UINT32 m_pending_irq; - UINT32 m_unmasked_irq; - UINT32 m_bankswitch_irq; - UINT8 m_priority_inttu, m_priority_intd, m_priority_intp, m_priority_ints0, m_priority_ints1; - UINT8 m_IRQS, m_ISPR; - UINT32 m_nmi_state; - UINT32 m_irq_state; - UINT32 m_poll_state; - UINT32 m_mode_state; - UINT32 m_intp_state[3]; - UINT8 m_no_interrupt; - UINT8 m_halted; + uint32_t m_pending_irq; + uint32_t m_unmasked_irq; + uint32_t m_bankswitch_irq; + uint8_t m_priority_inttu, m_priority_intd, m_priority_intp, m_priority_ints0, m_priority_ints1; + uint8_t m_IRQS, m_ISPR; + uint32_t m_nmi_state; + uint32_t m_irq_state; + uint32_t m_poll_state; + uint32_t m_mode_state; + uint32_t m_intp_state[3]; + uint8_t m_no_interrupt; + uint8_t m_halted; /* timer related */ - UINT16 m_TM0, m_MD0, m_TM1, m_MD1; - UINT8 m_TMC0, m_TMC1; + uint16_t m_TM0, m_MD0, m_TM1, m_MD1; + uint8_t m_TMC0, m_TMC1; emu_timer *m_timers[4]; /* system control */ - UINT8 m_RAMEN, m_TB, m_PCK; /* PRC register */ - UINT32 m_IDB; + uint8_t m_RAMEN, m_TB, m_PCK; /* PRC register */ + uint32_t m_IDB; address_space *m_program; direct_read_data *m_direct; @@ -154,47 +154,47 @@ union internalram devcb_write8 m_p1_out; devcb_write8 m_p2_out; - UINT8 m_prefetch_size; - UINT8 m_prefetch_cycles; - INT8 m_prefetch_count; - UINT8 m_prefetch_reset; - UINT32 m_chip_type; + uint8_t m_prefetch_size; + uint8_t m_prefetch_cycles; + int8_t m_prefetch_count; + uint8_t m_prefetch_reset; + uint32_t m_chip_type; - UINT32 m_prefix_base; /* base address of the latest prefix segment */ - UINT8 m_seg_prefix; /* prefix segment indicator */ + uint32_t m_prefix_base; /* base address of the latest prefix segment */ + uint8_t m_seg_prefix; /* prefix segment indicator */ - UINT32 m_EA; - UINT16 m_EO; - UINT16 m_E16; + uint32_t m_EA; + uint16_t m_EO; + uint16_t m_E16; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; - const UINT8 *m_v25v35_decryptiontable; // internal decryption table + const uint8_t *m_v25v35_decryptiontable; // internal decryption table typedef void (v25_common_device::*nec_ophandler)(); - typedef UINT32 (v25_common_device::*nec_eahandler)(); + typedef uint32_t (v25_common_device::*nec_eahandler)(); static const nec_ophandler s_nec_instruction[256]; static const nec_eahandler s_GetEA[192]; inline void prefetch(); void do_prefetch(int previous_ICount); - inline UINT8 fetch(); - inline UINT16 fetchword(); - inline UINT8 fetchop(); + inline uint8_t fetch(); + inline uint16_t fetchword(); + inline uint8_t fetchop(); void nec_interrupt(unsigned int_num, int /*INTSOURCES*/ source); void nec_bankswitch(unsigned bank_num); void nec_trap(); void external_int(); - UINT8 read_irqcontrol(int /*INTSOURCES*/ source, UINT8 priority); - UINT8 read_sfr(unsigned o); - UINT16 read_sfr_word(unsigned o); - void write_irqcontrol(int /*INTSOURCES*/ source, UINT8 d); - void write_sfr(unsigned o, UINT8 d); - void write_sfr_word(unsigned o, UINT16 d); - UINT8 v25_read_byte(unsigned a); - UINT16 v25_read_word(unsigned a); - void v25_write_byte(unsigned a, UINT8 d); - void v25_write_word(unsigned a, UINT16 d); + uint8_t read_irqcontrol(int /*INTSOURCES*/ source, uint8_t priority); + uint8_t read_sfr(unsigned o); + uint16_t read_sfr_word(unsigned o); + void write_irqcontrol(int /*INTSOURCES*/ source, uint8_t d); + void write_sfr(unsigned o, uint8_t d); + void write_sfr_word(unsigned o, uint16_t d); + uint8_t v25_read_byte(unsigned a); + uint16_t v25_read_word(unsigned a); + void v25_write_byte(unsigned a, uint8_t d); + void v25_write_word(unsigned a, uint16_t d); void i_add_br8(); void i_add_wr16(); @@ -446,44 +446,44 @@ union internalram void i_brkn(); void i_brks(); - UINT32 EA_000(); - UINT32 EA_001(); - UINT32 EA_002(); - UINT32 EA_003(); - UINT32 EA_004(); - UINT32 EA_005(); - UINT32 EA_006(); - UINT32 EA_007(); - UINT32 EA_100(); - UINT32 EA_101(); - UINT32 EA_102(); - UINT32 EA_103(); - UINT32 EA_104(); - UINT32 EA_105(); - UINT32 EA_106(); - UINT32 EA_107(); - UINT32 EA_200(); - UINT32 EA_201(); - UINT32 EA_202(); - UINT32 EA_203(); - UINT32 EA_204(); - UINT32 EA_205(); - UINT32 EA_206(); - UINT32 EA_207(); + uint32_t EA_000(); + uint32_t EA_001(); + uint32_t EA_002(); + uint32_t EA_003(); + uint32_t EA_004(); + uint32_t EA_005(); + uint32_t EA_006(); + uint32_t EA_007(); + uint32_t EA_100(); + uint32_t EA_101(); + uint32_t EA_102(); + uint32_t EA_103(); + uint32_t EA_104(); + uint32_t EA_105(); + uint32_t EA_106(); + uint32_t EA_107(); + uint32_t EA_200(); + uint32_t EA_201(); + uint32_t EA_202(); + uint32_t EA_203(); + uint32_t EA_204(); + uint32_t EA_205(); + uint32_t EA_206(); + uint32_t EA_207(); }; class v25_device : public v25_common_device { public: - v25_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v25_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class v35_device : public v25_common_device { public: - v35_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/nec/v25instr.hxx b/src/devices/cpu/nec/v25instr.hxx index bd11b0626a8..881f2044aae 100644 --- a/src/devices/cpu/nec/v25instr.hxx +++ b/src/devices/cpu/nec/v25instr.hxx @@ -42,7 +42,7 @@ } \ } -OP( 0x0f, i_pre_v25 ) { UINT32 ModRM, tmp, tmp2; +OP( 0x0f, i_pre_v25 ) { uint32_t ModRM, tmp, tmp2; switch (FETCH()) { case 0x10 : BITOP_BYTE; CLKS(3,3,4); tmp2 = Breg(CL) & 0x7; m_ZeroVal = (tmp & (1<>m_chip_type)&0x7f; } -#define CLKW(v20o,v30o,v33o,v20e,v30e,v33e,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; m_icount-=(addr&1)?((ocount>>m_chip_type)&0x7f):((ecount>>m_chip_type)&0x7f); } -#define CLKM(v20,v30,v33,v20m,v30m,v33m) { const UINT32 ccount=(v20<<16)|(v30<<8)|v33, mcount=(v20m<<16)|(v30m<<8)|v33m; m_icount-=( ModRM >=0xc0 )?((ccount>>m_chip_type)&0x7f):((mcount>>m_chip_type)&0x7f); } -#define CLKR(v20o,v30o,v33o,v20e,v30e,v33e,vall,addr) { const UINT32 ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; if (ModRM >=0xc0) m_icount-=vall; else m_icount-=(addr&1)?((ocount>>m_chip_type)&0x7f):((ecount>>m_chip_type)&0x7f); } +#define CLKS(v20,v30,v33) { const uint32_t ccount=(v20<<16)|(v30<<8)|v33; m_icount-=(ccount>>m_chip_type)&0x7f; } +#define CLKW(v20o,v30o,v33o,v20e,v30e,v33e,addr) { const uint32_t ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; m_icount-=(addr&1)?((ocount>>m_chip_type)&0x7f):((ecount>>m_chip_type)&0x7f); } +#define CLKM(v20,v30,v33,v20m,v30m,v33m) { const uint32_t ccount=(v20<<16)|(v30<<8)|v33, mcount=(v20m<<16)|(v30m<<8)|v33m; m_icount-=( ModRM >=0xc0 )?((ccount>>m_chip_type)&0x7f):((mcount>>m_chip_type)&0x7f); } +#define CLKR(v20o,v30o,v33o,v20e,v30e,v33e,vall,addr) { const uint32_t ocount=(v20o<<16)|(v30o<<8)|v33o, ecount=(v20e<<16)|(v30e<<8)|v33e; if (ModRM >=0xc0) m_icount-=vall; else m_icount-=(addr&1)?((ocount>>m_chip_type)&0x7f):((ecount>>m_chip_type)&0x7f); } /************************************************************************/ #define CompressFlags() (WORD)(CF | (m_IBRK << 1) | (PF << 2) | (m_F0 << 3) | (AF << 4) \ diff --git a/src/devices/cpu/nec/v25sfr.cpp b/src/devices/cpu/nec/v25sfr.cpp index ea80ca4aa1f..788ab419b29 100644 --- a/src/devices/cpu/nec/v25sfr.cpp +++ b/src/devices/cpu/nec/v25sfr.cpp @@ -10,7 +10,7 @@ #include "v25.h" #include "v25priv.h" -UINT8 v25_common_device::read_irqcontrol(int /*INTSOURCES*/ source, UINT8 priority) +uint8_t v25_common_device::read_irqcontrol(int /*INTSOURCES*/ source, uint8_t priority) { return (((m_pending_irq & source) ? 0x80 : 0x00) | ((m_unmasked_irq & source) ? 0x00 : 0x40) @@ -18,9 +18,9 @@ UINT8 v25_common_device::read_irqcontrol(int /*INTSOURCES*/ source, UINT8 priori | priority); } -UINT8 v25_common_device::read_sfr(unsigned o) +uint8_t v25_common_device::read_sfr(unsigned o) { - UINT8 ret; + uint8_t ret; switch(o) { @@ -109,9 +109,9 @@ UINT8 v25_common_device::read_sfr(unsigned o) return ret; } -UINT16 v25_common_device::read_sfr_word(unsigned o) +uint16_t v25_common_device::read_sfr_word(unsigned o) { - UINT16 ret; + uint16_t ret; switch(o) { @@ -137,7 +137,7 @@ UINT16 v25_common_device::read_sfr_word(unsigned o) return ret; } -void v25_common_device::write_irqcontrol(int /*INTSOURCES*/ source, UINT8 d) +void v25_common_device::write_irqcontrol(int /*INTSOURCES*/ source, uint8_t d) { if(d & 0x80) m_pending_irq |= source; @@ -158,7 +158,7 @@ void v25_common_device::write_irqcontrol(int /*INTSOURCES*/ source, UINT8 d) m_bankswitch_irq &= ~source; } -void v25_common_device::write_sfr(unsigned o, UINT8 d) +void v25_common_device::write_sfr(unsigned o, uint8_t d) { int tmp; attotime time; @@ -284,7 +284,7 @@ void v25_common_device::write_sfr(unsigned o, UINT8 d) } } -void v25_common_device::write_sfr_word(unsigned o, UINT16 d) +void v25_common_device::write_sfr_word(unsigned o, uint16_t d) { switch(o) { @@ -306,7 +306,7 @@ void v25_common_device::write_sfr_word(unsigned o, UINT16 d) } } -UINT8 v25_common_device::v25_read_byte(unsigned a) +uint8_t v25_common_device::v25_read_byte(unsigned a) { if((a & 0xFFE00) == m_IDB || a == 0xFFFFF) { @@ -322,7 +322,7 @@ UINT8 v25_common_device::v25_read_byte(unsigned a) return m_program->read_byte(a); } -UINT16 v25_common_device::v25_read_word(unsigned a) +uint16_t v25_common_device::v25_read_word(unsigned a) { if( a & 1 ) return (v25_read_byte(a) | (v25_read_byte(a + 1) << 8)); @@ -344,7 +344,7 @@ UINT16 v25_common_device::v25_read_word(unsigned a) return m_program->read_word(a); } -void v25_common_device::v25_write_byte(unsigned a, UINT8 d) +void v25_common_device::v25_write_byte(unsigned a, uint8_t d) { if((a & 0xFFE00) == m_IDB || a == 0xFFFFF) { @@ -366,7 +366,7 @@ void v25_common_device::v25_write_byte(unsigned a, UINT8 d) m_program->write_byte(a, d); } -void v25_common_device::v25_write_word(unsigned a, UINT16 d) +void v25_common_device::v25_write_word(unsigned a, uint16_t d) { if( a & 1 ) { diff --git a/src/devices/cpu/nec/v53.cpp b/src/devices/cpu/nec/v53.cpp index 23e0dec6991..8ae50d4595e 100644 --- a/src/devices/cpu/nec/v53.cpp +++ b/src/devices/cpu/nec/v53.cpp @@ -234,7 +234,7 @@ void v53_base_device::install_peripheral_io() if (m_OPSEL & 0x01) // DMA Unit available { - UINT16 base = (m_OPHA << 8) | m_DULA; + uint16_t base = (m_OPHA << 8) | m_DULA; base &= 0xfffe; if (m_SCTL & 0x02) // uPD71037 mode @@ -254,7 +254,7 @@ void v53_base_device::install_peripheral_io() if (m_OPSEL & 0x02) // Interupt Control Unit available { - UINT16 base = (m_OPHA << 8) | m_IULA; + uint16_t base = (m_OPHA << 8) | m_IULA; base &= 0xfffe; if (IOAG) // 8-bit @@ -268,7 +268,7 @@ void v53_base_device::install_peripheral_io() if (m_OPSEL & 0x04) // Timer Control Unit available { - UINT16 base = (m_OPHA << 8) | m_TULA; + uint16_t base = (m_OPHA << 8) | m_TULA; //printf("installing TCU to %04x\n", base); base &= 0xfffe; @@ -286,7 +286,7 @@ void v53_base_device::install_peripheral_io() if (m_OPSEL & 0x08) // Serial Control Unit available { - UINT16 base = (m_OPHA << 8) | m_SULA; + uint16_t base = (m_OPHA << 8) | m_SULA; base &= 0xfffe; if (IOAG) // 8-bit @@ -526,7 +526,7 @@ machine_config_constructor v53_base_device::device_mconfig_additions() const } -v53_base_device::v53_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, offs_t fetch_xor, UINT8 prefetch_size, UINT8 prefetch_cycles, UINT32 chip_type) +v53_base_device::v53_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, offs_t fetch_xor, uint8_t prefetch_size, uint8_t prefetch_cycles, uint32_t chip_type) : nec_common_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__, true, fetch_xor, prefetch_size, prefetch_cycles, chip_type), m_io_space_config( "io", ENDIANNESS_LITTLE, 16, 16, 0, ADDRESS_MAP_NAME( v53_internal_port_map ) ), m_v53tcu(*this, "pit"), @@ -566,13 +566,13 @@ v53_base_device::v53_base_device(const machine_config &mconfig, device_type type } -v53_device::v53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v53_device::v53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : v53_base_device(mconfig, V53, "V53", tag, owner, clock, "v53", BYTE_XOR_LE(0), 6, 1, V33_TYPE) { } -v53a_device::v53a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v53a_device::v53a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : v53_base_device(mconfig, V53A, "V53A", tag, owner, clock, "v53a", BYTE_XOR_LE(0), 6, 1, V33_TYPE) { } diff --git a/src/devices/cpu/nec/v53.h b/src/devices/cpu/nec/v53.h index 6afdd1c4f39..2f1f58d8361 100644 --- a/src/devices/cpu/nec/v53.h +++ b/src/devices/cpu/nec/v53.h @@ -107,7 +107,7 @@ class v53_base_device : public nec_common_device { public: - v53_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, offs_t fetch_xor, UINT8 prefetch_size, UINT8 prefetch_cycles, UINT32 chip_type); + v53_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, offs_t fetch_xor, uint8_t prefetch_size, uint8_t prefetch_cycles, uint32_t chip_type); DECLARE_WRITE8_MEMBER(BSEL_w); DECLARE_WRITE8_MEMBER(BADR_w); @@ -131,19 +131,19 @@ public: DECLARE_WRITE8_MEMBER(OPSEL_w); DECLARE_WRITE8_MEMBER(SCTL_w); - UINT8 m_SCTL; - UINT8 m_OPSEL; + uint8_t m_SCTL; + uint8_t m_OPSEL; - UINT8 m_SULA; - UINT8 m_TULA; - UINT8 m_IULA; - UINT8 m_DULA; - UINT8 m_OPHA; + uint8_t m_SULA; + uint8_t m_TULA; + uint8_t m_IULA; + uint8_t m_DULA; + uint8_t m_OPHA; // SCU DECLARE_READ8_MEMBER(scu_simk_r); DECLARE_WRITE8_MEMBER(scu_simk_w); - UINT8 m_simk; + uint8_t m_simk; template static devcb_base &set_txd_handler(device_t &device, _Object object) { return downcast(device).m_txd_handler.set_callback(object); } template static devcb_base &set_dtr_handler(device_t &device, _Object object) { return downcast(device).m_dtr_handler.set_callback(object); } template static devcb_base &set_rts_handler(device_t &device, _Object object) { return downcast(device).m_rts_handler.set_callback(object); } @@ -296,13 +296,13 @@ protected: class v53_device : public v53_base_device { public: - v53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class v53a_device : public v53_base_device { public: - v53a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v53a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type V53; diff --git a/src/devices/cpu/patinhofeio/patinho_feio.cpp b/src/devices/cpu/patinhofeio/patinho_feio.cpp index d0d45db77ee..ceeab59fcc4 100644 --- a/src/devices/cpu/patinhofeio/patinho_feio.cpp +++ b/src/devices/cpu/patinhofeio/patinho_feio.cpp @@ -32,7 +32,7 @@ #define ADDRESS_MASK_4K 0xFFF #define INCREMENT_PC_4K (PC = (PC+1) & ADDRESS_MASK_4K) -void patinho_feio_cpu_device::set_flag(UINT8 flag, bool state){ +void patinho_feio_cpu_device::set_flag(uint8_t flag, bool state){ if (state){ FLAGS |= flag; } else { @@ -56,7 +56,7 @@ static ADDRESS_MAP_START(prog_8bit, AS_PROGRAM, 8, patinho_feio_cpu_device) AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("internalram") ADDRESS_MAP_END -patinho_feio_cpu_device::patinho_feio_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +patinho_feio_cpu_device::patinho_feio_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, PATINHO_FEIO, "PATINHO FEIO", tag, owner, clock, "patinho_feio_cpu", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, ADDRESS_MAP_NAME(prog_8bit)), m_icount(0), @@ -69,7 +69,7 @@ patinho_feio_cpu_device::patinho_feio_cpu_device(const machine_config &mconfig, { } -UINT16 patinho_feio_cpu_device::read_panel_keys_register(){ +uint16_t patinho_feio_cpu_device::read_panel_keys_register(){ if (!m_rc_read_cb.isnull()) m_rc = m_rc_read_cb(0); else @@ -78,7 +78,7 @@ UINT16 patinho_feio_cpu_device::read_panel_keys_register(){ return m_rc; } -void patinho_feio_cpu_device::transfer_byte_from_external_device(UINT8 channel, UINT8 data){ +void patinho_feio_cpu_device::transfer_byte_from_external_device(uint8_t channel, uint8_t data){ m_iodev_incoming_byte[channel] = data; m_iodev_status[channel] = IODEV_READY; m_iodev_control[channel] = NO_REQUEST; @@ -171,7 +171,7 @@ void patinho_feio_cpu_device::execute_run() { if (!m_run){ if (!m_buttons_read_cb.isnull()){ - UINT16 buttons = m_buttons_read_cb(0); + uint16_t buttons = m_buttons_read_cb(0); if (buttons & BUTTON_PARTIDA){ /* "startup" button */ switch (m_mode){ @@ -230,8 +230,8 @@ void patinho_feio_cpu_device::execute_instruction() case 0xD8: //SOMI="Soma Imediato": // Add an immediate into the accumulator - set_flag(V, ((((INT16) ACC) + ((INT16) READ_BYTE_PATINHO(PC))) >> 8)); - set_flag(T, ((((INT8) (ACC & 0x7F)) + ((INT8) (READ_BYTE_PATINHO(PC) & 0x7F))) >> 7) == V); + set_flag(V, ((((int16_t) ACC) + ((int16_t) READ_BYTE_PATINHO(PC))) >> 8)); + set_flag(T, ((((int8_t) (ACC & 0x7F)) + ((int8_t) (READ_BYTE_PATINHO(PC) & 0x7F))) >> 7) == V); ACC += READ_BYTE_PATINHO(PC); INCREMENT_PC_4K; return; @@ -775,7 +775,7 @@ void patinho_feio_cpu_device::execute_instruction() printf("unimplemented opcode: 0x%02X\n", m_opcode); } -offs_t patinho_feio_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t patinho_feio_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( patinho_feio ); return CPU_DISASSEMBLE_NAME(patinho_feio)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h index 122211bc35a..b10d3b7f0b1 100644 --- a/src/devices/cpu/patinhofeio/patinhofeio_cpu.h +++ b/src/devices/cpu/patinhofeio/patinhofeio_cpu.h @@ -51,7 +51,7 @@ enum class patinho_feio_cpu_device : public cpu_device { public: // construction/destruction - patinho_feio_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + patinho_feio_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); template static devcb_base &set_rc_read_callback(device_t &device, _Object object) { return downcast(device).m_rc_read_cb.set_callback(object); } template static devcb_base &set_buttons_read_callback(device_t &device, _Object object) { return downcast(device).m_buttons_read_cb.set_callback(object); } @@ -59,14 +59,14 @@ public: template static devcb_base &set_iodev_write_callback(device_t &device, int devnumber, _Object object) { return downcast(device).m_iodev_write_cb[devnumber].set_callback(object); } template static devcb_base &set_iodev_status_callback(device_t &device, int devnumber, _Object object) { return downcast(device).m_iodev_status_cb[devnumber].set_callback(object); } - void transfer_byte_from_external_device(UINT8 channel, UINT8 data); - void set_iodev_status(UINT8 channel, bool status) { + void transfer_byte_from_external_device(uint8_t channel, uint8_t data); + void set_iodev_status(uint8_t channel, bool status) { m_iodev_status[channel] = status; } protected: virtual void execute_run() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; @@ -97,10 +97,10 @@ protected: bool m_iodev_status[16]; /* 8-bit registers for receiving data from peripherals */ - UINT8 m_iodev_incoming_byte[16]; + uint8_t m_iodev_incoming_byte[16]; /* 8-bit registers for sending data to peripherals */ - UINT8 m_iodev_outgoing_byte[16]; + uint8_t m_iodev_outgoing_byte[16]; int m_flags; // V = "Vai um" (Carry flag) @@ -116,27 +116,27 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : nullptr; } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } private: void execute_instruction(); void compute_effective_address(unsigned int addr); - void set_flag(UINT8 flag, bool state); - UINT16 read_panel_keys_register(); + void set_flag(uint8_t flag, bool state); + uint16_t read_panel_keys_register(); devcb_read16 m_rc_read_cb; devcb_read16 m_buttons_read_cb; devcb_read8 m_iodev_read_cb[16]; devcb_write8 m_iodev_write_cb[16]; devcb_read8 m_iodev_status_cb[16]; - UINT8 m_mode; + uint8_t m_mode; }; extern const device_type PATINHO_FEIO; diff --git a/src/devices/cpu/pdp1/pdp1.cpp b/src/devices/cpu/pdp1/pdp1.cpp index ded99a2d80d..ef7e5524399 100644 --- a/src/devices/cpu/pdp1/pdp1.cpp +++ b/src/devices/cpu/pdp1/pdp1.cpp @@ -380,7 +380,7 @@ const device_type PDP1 = &device_creator; -pdp1_device::pdp1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pdp1_device::pdp1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, PDP1, "PDP1", tag, owner, clock, "pdp1_cpu", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 32, 18, 0) { @@ -412,7 +412,7 @@ void pdp1_device::device_config_complete() } -offs_t pdp1_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t pdp1_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( pdp1 ); return CPU_DISASSEMBLE_NAME(pdp1)(this, buffer, pc, oprom, opram, options); @@ -772,7 +772,7 @@ void pdp1_device::device_reset() except cal and jda, and with the addition of jmp and jsp) * 2 for memory reference instructions */ -static const UINT8 instruction_kind[32] = +static const uint8_t instruction_kind[32] = { /* and ior xor xct cal/jda */ 0, 3, 3, 3, 3, 0, 0, 2, diff --git a/src/devices/cpu/pdp1/pdp1.h b/src/devices/cpu/pdp1/pdp1.h index f6d742a2a4e..a17c2d37858 100644 --- a/src/devices/cpu/pdp1/pdp1.h +++ b/src/devices/cpu/pdp1/pdp1.h @@ -79,7 +79,7 @@ class pdp1_device : public cpu_device { public: // construction/destruction - pdp1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pdp1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_reset_param(device_t &device, const pdp1_reset_param_t *param) { downcast(device).m_reset_param = param; } @@ -97,9 +97,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 5; } - virtual UINT32 execute_max_cycles() const override { return 31; } - virtual UINT32 execute_input_lines() const override { return 16; } + virtual uint32_t execute_min_cycles() const override { return 5; } + virtual uint32_t execute_max_cycles() const override { return 31; } + virtual uint32_t execute_input_lines() const override { return 16; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -112,15 +112,15 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; /* processor registers */ - UINT32 m_pc; /* program counter (12, 15 or 16 bits) */ + uint32_t m_pc; /* program counter (12, 15 or 16 bits) */ int m_ir; /* basic operation code of current instruction (5 bits) */ int m_mb; /* memory buffer (used for holding the current instruction only) (18 bits) */ int m_ma; /* memory address (12, 15 or 16 bits) */ @@ -153,11 +153,11 @@ private: unsigned int m_ios; /* i-o synchronizer: set on i-o operation completion */ /* sequence break system */ - UINT16 m_irq_state; /* mirrors the state of the interrupt pins */ - UINT16 m_b1; /* interrupt enable */ - UINT16 m_b2; /* interrupt pulse request pending - asynchronous with computer operation (set by pulses on irq_state, cleared when interrupt is taken) */ - /*UINT16 m_b3;*/ /* interrupt request pending - synchronous with computer operation (logical or of irq_state and b2???) */ - UINT16 m_b4; /* interrupt in progress */ + uint16_t m_irq_state; /* mirrors the state of the interrupt pins */ + uint16_t m_b1; /* interrupt enable */ + uint16_t m_b2; /* interrupt pulse request pending - asynchronous with computer operation (set by pulses on irq_state, cleared when interrupt is taken) */ + /*uint16_t m_b3;*/ /* interrupt request pending - synchronous with computer operation (logical or of irq_state and b2???) */ + uint16_t m_b4; /* interrupt in progress */ /* additional emulator state variables */ int m_rim_step; /* current step in rim execution */ @@ -187,7 +187,7 @@ private: address_space *m_program; int m_icount; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; void field_interrupt(); void execute_instruction(); diff --git a/src/devices/cpu/pdp1/tx0.cpp b/src/devices/cpu/pdp1/tx0.cpp index 1f6ee61e6cd..25830f4cbb5 100644 --- a/src/devices/cpu/pdp1/tx0.cpp +++ b/src/devices/cpu/pdp1/tx0.cpp @@ -44,7 +44,7 @@ const device_type TX0_8KW = &device_creator; const device_type TX0_64KW = &device_creator; -tx0_device::tx0_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, int addr_bits, int address_mask, int ir_mask) +tx0_device::tx0_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, int addr_bits, int address_mask, int ir_mask) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 32, addr_bits , -2), m_mbr(0), m_ac(0), m_mar(0), m_pc(0), m_ir(0), m_lr(0), m_xr(0), m_pf(0), m_tbr(0), m_tac(0), m_cm_sel(0), m_lr_sel(0), m_gbl_cm_sel(0), m_stop_cyc0(0), m_stop_cyc1(0), m_run(0), m_rim(0), m_cycle(0), m_ioh(0), m_ios(0), m_rim_step(0) @@ -64,13 +64,13 @@ tx0_device::tx0_device(const machine_config &mconfig, device_type type, const ch m_program_config.m_is_octal = true; } -tx0_8kw_device::tx0_8kw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tx0_8kw_device::tx0_8kw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tx0_device(mconfig, TX0_8KW, "TX-0 8KW", tag, owner, clock, "tx0_8w_cpu", __FILE__, 13, ADDRESS_MASK_8KW, 037) { } -tx0_64kw_device::tx0_64kw_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tx0_64kw_device::tx0_64kw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tx0_device(mconfig, TX0_64KW, "TX-0 64KW", tag, owner, clock, "tx0_64kw_cpu", __FILE__, 16, ADDRESS_MASK_64KW, 03) { } @@ -1068,14 +1068,14 @@ void tx0_device::io_complete() } -offs_t tx0_8kw_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tx0_8kw_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tx0_8kw ); return CPU_DISASSEMBLE_NAME(tx0_8kw)(this, buffer, pc, oprom, opram, options); } -offs_t tx0_64kw_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tx0_64kw_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tx0_64kw ); return CPU_DISASSEMBLE_NAME(tx0_64kw)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/pdp1/tx0.h b/src/devices/cpu/pdp1/tx0.h index 73d7d7705f1..3893cd88e27 100644 --- a/src/devices/cpu/pdp1/tx0.h +++ b/src/devices/cpu/pdp1/tx0.h @@ -38,7 +38,7 @@ class tx0_device : public cpu_device { public: // construction/destruction - tx0_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, int addr_bits, int address_mask, int ir_mask); + tx0_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, int addr_bits, int address_mask, int ir_mask); // static configuration helpers template static devcb_base &set_cpy_cb(device_t &device, _Object object) { return downcast(device).m_cpy_handler.set_callback(object); } @@ -61,15 +61,15 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 3; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 3; } // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : nullptr; } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } protected: address_space_config m_program_config; @@ -88,8 +88,8 @@ protected: int m_tbr; /* toggle switch buffer register (18 bits) */ int m_tac; /* toggle switch accumulator (18 bits) */ int m_tss[16]; /* toggle switch storage (18 bits * 16) */ - UINT16 m_cm_sel; /* individual cm select (1 bit * 16) */ - UINT16 m_lr_sel; /* individual lr select (1 bit * 16) */ + uint16_t m_cm_sel; /* individual cm select (1 bit * 16) */ + uint16_t m_lr_sel; /* individual lr select (1 bit * 16) */ unsigned int m_gbl_cm_sel;/* global cm select (1 bit) */ unsigned int m_stop_cyc0; /* stop on cycle 0 */ unsigned int m_stop_cyc1; /* stop on cycle 1 */ @@ -147,11 +147,11 @@ class tx0_8kw_device : public tx0_device { public: // construction/destruction - tx0_8kw_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + tx0_8kw_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); protected: virtual void execute_run() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: void execute_instruction_8kw(); @@ -162,11 +162,11 @@ class tx0_64kw_device : public tx0_device { public: // construction/destruction - tx0_64kw_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + tx0_64kw_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); protected: virtual void execute_run() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: void execute_instruction_64kw(); diff --git a/src/devices/cpu/pdp8/pdp8.cpp b/src/devices/cpu/pdp8/pdp8.cpp index 747bea2ffb9..8946932b147 100644 --- a/src/devices/cpu/pdp8/pdp8.cpp +++ b/src/devices/cpu/pdp8/pdp8.cpp @@ -50,7 +50,7 @@ const device_type PDP8CPU = &device_creator; // pdp8_device - constructor //------------------------------------------------- -pdp8_device::pdp8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pdp8_device::pdp8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, PDP8CPU, "PDP8CPU", tag, owner, clock, "pdp8_cpu", __FILE__), m_program_config("program", ENDIANNESS_BIG, 12, 12), m_pc(0), @@ -152,7 +152,7 @@ void pdp8_device::state_string_export(const device_state_entry &entry, std::stri // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 pdp8_device::disasm_min_opcode_bytes() const +uint32_t pdp8_device::disasm_min_opcode_bytes() const { return 2; } @@ -163,7 +163,7 @@ UINT32 pdp8_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 pdp8_device::disasm_max_opcode_bytes() const +uint32_t pdp8_device::disasm_max_opcode_bytes() const { return 2; } @@ -174,7 +174,7 @@ UINT32 pdp8_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t pdp8_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t pdp8_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( pdp8 ); return CPU_DISASSEMBLE_NAME(pdp8)(this, buffer, pc, oprom, opram, options); @@ -190,7 +190,7 @@ offs_t pdp8_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 pdp8_device::execute_min_cycles() const +uint32_t pdp8_device::execute_min_cycles() const { return 1; // TODO } @@ -201,7 +201,7 @@ UINT32 pdp8_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 pdp8_device::execute_max_cycles() const +uint32_t pdp8_device::execute_max_cycles() const { return 3; // TODO } @@ -212,7 +212,7 @@ UINT32 pdp8_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 pdp8_device::execute_input_lines() const +uint32_t pdp8_device::execute_input_lines() const { return 0; // TODO } @@ -242,7 +242,7 @@ void pdp8_device::execute_run() debugger_instruction_hook(this, m_pc); - UINT16 op = m_program->read_word(m_pc); + uint16_t op = m_program->read_word(m_pc); --m_icount; } diff --git a/src/devices/cpu/pdp8/pdp8.h b/src/devices/cpu/pdp8/pdp8.h index 66f04682d7e..55958cb2029 100644 --- a/src/devices/cpu/pdp8/pdp8.h +++ b/src/devices/cpu/pdp8/pdp8.h @@ -22,7 +22,7 @@ class pdp8_device : public cpu_device { public: // construction/destruction - pdp8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pdp8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -30,9 +30,9 @@ public: virtual void device_stop() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -40,9 +40,9 @@ public: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; @@ -73,13 +73,13 @@ public: }; private: // CPU registers - UINT16 m_pc; - UINT16 m_ac; - UINT16 m_mb; - UINT16 m_ma; - UINT16 m_sr; - UINT8 m_l; - UINT8 m_ir; + uint16_t m_pc; + uint16_t m_ac; + uint16_t m_mb; + uint16_t m_ma; + uint16_t m_sr; + uint8_t m_l; + uint8_t m_ir; bool m_halt; // other internal states diff --git a/src/devices/cpu/pdp8/pdp8dasm.cpp b/src/devices/cpu/pdp8/pdp8dasm.cpp index 01dc3621ffa..cfaadfb78e3 100644 --- a/src/devices/cpu/pdp8/pdp8dasm.cpp +++ b/src/devices/cpu/pdp8/pdp8dasm.cpp @@ -10,12 +10,12 @@ static char *output; -offs_t pdp8_dasm_one(char *buffer, offs_t pc, UINT16 op) +offs_t pdp8_dasm_one(char *buffer, offs_t pc, uint16_t op) { - UINT8 opcode = (op >> 011) & 07; - UINT16 current_page = pc & 07600; - UINT16 zero_addr = op & 0177; - UINT16 current_addr = current_page | zero_addr; + uint8_t opcode = (op >> 011) & 07; + uint16_t current_page = pc & 07600; + uint16_t zero_addr = op & 0177; + uint16_t current_addr = current_page | zero_addr; bool indirect = (op & 0400) ? true : false; bool zero_page = (op & 0200) ? false : true; @@ -168,7 +168,7 @@ offs_t pdp8_dasm_one(char *buffer, offs_t pc, UINT16 op) CPU_DISASSEMBLE( pdp8 ) { - UINT16 op = (*(UINT8 *)(opram + 0) << 8) | - (*(UINT8 *)(opram + 1) << 0); + uint16_t op = (*(uint8_t *)(opram + 0) << 8) | + (*(uint8_t *)(opram + 1) << 0); return pdp8_dasm_one(buffer, pc, op); } diff --git a/src/devices/cpu/pic16c5x/16c5xdsm.cpp b/src/devices/cpu/pic16c5x/16c5xdsm.cpp index d3fdab5af8d..b7bc3c5da72 100644 --- a/src/devices/cpu/pic16c5x/16c5xdsm.cpp +++ b/src/devices/cpu/pic16c5x/16c5xdsm.cpp @@ -26,8 +26,8 @@ #include "emu.h" #include -static const UINT8 *rombase; -static const UINT8 *rambase; +static const uint8_t *rombase; +static const uint8_t *rambase; static offs_t pcbase; #define READOP16(A) (rombase[(A) - pcbase] | (rombase[(A) + 1 - pcbase] << 8)) #define READARG16(A) (rambase[(A) - pcbase] | (rambase[(A) + 1 - pcbase] << 8)) @@ -135,7 +135,7 @@ static void InitDasm16C5x(void) fatalerror("not enough bits in encoding '%s %s' %d\n", ops[0],ops[1],bit); } - while (isspace((UINT8)*p)) p++; + while (isspace((uint8_t)*p)) p++; if (*p) Op[i].extcode = *p; Op[i].bits = bits; Op[i].mask = mask; @@ -159,7 +159,7 @@ CPU_DISASSEMBLE( pic16c5x ) int bit; //char *buffertmp; const char *cp; /* character pointer in OpFormats */ - UINT32 flags = 0; + uint32_t flags = 0; rombase = oprom; rambase = opram; diff --git a/src/devices/cpu/pic16c5x/pic16c5x.cpp b/src/devices/cpu/pic16c5x/pic16c5x.cpp index 3a4193db730..48a683eaed7 100644 --- a/src/devices/cpu/pic16c5x/pic16c5x.cpp +++ b/src/devices/cpu/pic16c5x/pic16c5x.cpp @@ -106,7 +106,7 @@ static ADDRESS_MAP_START( pic16c5x_ram_7, AS_DATA, 8, pic16c5x_device ) ADDRESS_MAP_END -pic16c5x_device::pic16c5x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, int picmodel) +pic16c5x_device::pic16c5x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, int picmodel) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, program_width, -1 , ( ( program_width == 9 ) ? ADDRESS_MAP_NAME(pic16c5x_rom_9) : ( ( program_width == 10 ) ? ADDRESS_MAP_NAME(pic16c5x_rom_10) : ADDRESS_MAP_NAME(pic16c5x_rom_11) ))) @@ -127,33 +127,33 @@ pic16c5x_device::pic16c5x_device(const machine_config &mconfig, device_type type } -pic16c54_device::pic16c54_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c54_device::pic16c54_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c5x_device(mconfig, PIC16C54, "PIC16C54", tag, owner, clock, "pic16c54", 9, 5, 0x16C54) { } -pic16c55_device::pic16c55_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c55_device::pic16c55_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c5x_device(mconfig, PIC16C55, "PIC16C55", tag, owner, clock, "pic16c55", 9, 5, 0x16C55) { } -pic16c56_device::pic16c56_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c56_device::pic16c56_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c5x_device(mconfig, PIC16C56, "PIC16C56", tag, owner, clock, "pic16c56", 10, 5, 0x16C56) { } -pic16c57_device::pic16c57_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c57_device::pic16c57_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c5x_device(mconfig, PIC16C57, "PIC16C57", tag, owner, clock, "pic16c57", 11, 7, 0x16C57) { } -pic16c58_device::pic16c58_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c58_device::pic16c58_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c5x_device(mconfig, PIC16C58, "PIC16C58", tag, owner, clock, "pic16c58", 11, 7, 0x16C58) { } -offs_t pic16c5x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t pic16c5x_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( pic16c5x ); return CPU_DISASSEMBLE_NAME(pic16c5x)(this, buffer, pc, oprom, opram, options); @@ -162,13 +162,13 @@ offs_t pic16c5x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 void pic16c5x_device::update_internalram_ptr() { - m_internalram = (UINT8 *)m_data->get_write_ptr(0x00); + m_internalram = (uint8_t *)m_data->get_write_ptr(0x00); } #define PIC16C5x_RDOP(A) (m_direct->read_word((A)<<1)) -#define PIC16C5x_RAM_RDMEM(A) ((UINT8)m_data->read_byte(A)) +#define PIC16C5x_RAM_RDMEM(A) ((uint8_t)m_data->read_byte(A)) #define PIC16C5x_RAM_WRMEM(A,V) (m_data->write_byte(A,V)) #define M_RDRAM(A) (((A) < 8) ? m_internalram[A] : PIC16C5x_RAM_RDMEM(A)) @@ -240,7 +240,7 @@ void pic16c5x_device::update_internalram_ptr() * Shortcuts ************************************************************************/ -#define CLR(flagreg, flag) ( flagreg &= (UINT8)(~flag) ) +#define CLR(flagreg, flag) ( flagreg &= (uint8_t)(~flag) ) #define SET(flagreg, flag) ( flagreg |= flag ) @@ -259,7 +259,7 @@ void pic16c5x_device::CALCULATE_Z_FLAG() void pic16c5x_device::CALCULATE_ADD_CARRY() { - if ((UINT8)(m_old_data) > (UINT8)(m_ALU)) { + if ((uint8_t)(m_old_data) > (uint8_t)(m_ALU)) { SET(STATUS, C_FLAG); } else { @@ -269,7 +269,7 @@ void pic16c5x_device::CALCULATE_ADD_CARRY() void pic16c5x_device::CALCULATE_ADD_DIGITCARRY() { - if (((UINT8)(m_old_data) & 0x0f) > ((UINT8)(m_ALU) & 0x0f)) { + if (((uint8_t)(m_old_data) & 0x0f) > ((uint8_t)(m_ALU) & 0x0f)) { SET(STATUS, DC_FLAG); } else { @@ -279,7 +279,7 @@ void pic16c5x_device::CALCULATE_ADD_DIGITCARRY() void pic16c5x_device::CALCULATE_SUB_CARRY() { - if ((UINT8)(m_old_data) < (UINT8)(m_ALU)) { + if ((uint8_t)(m_old_data) < (uint8_t)(m_ALU)) { CLR(STATUS, C_FLAG); } else { @@ -289,7 +289,7 @@ void pic16c5x_device::CALCULATE_SUB_CARRY() void pic16c5x_device::CALCULATE_SUB_DIGITCARRY() { - if (((UINT8)(m_old_data) & 0x0f) < ((UINT8)(m_ALU) & 0x0f)) { + if (((uint8_t)(m_old_data) & 0x0f) < ((uint8_t)(m_ALU) & 0x0f)) { CLR(STATUS, DC_FLAG); } else { @@ -299,13 +299,13 @@ void pic16c5x_device::CALCULATE_SUB_DIGITCARRY() -UINT16 pic16c5x_device::POP_STACK() +uint16_t pic16c5x_device::POP_STACK() { - UINT16 data = m_STACK[1]; + uint16_t data = m_STACK[1]; m_STACK[1] = m_STACK[0]; return (data & ADDR_MASK); } -void pic16c5x_device::PUSH_STACK(UINT16 data) +void pic16c5x_device::PUSH_STACK(uint16_t data) { m_STACK[0] = m_STACK[1]; m_STACK[1] = (data & ADDR_MASK); @@ -313,9 +313,9 @@ void pic16c5x_device::PUSH_STACK(UINT16 data) -UINT8 pic16c5x_device::GET_REGFILE(offs_t addr) /* Read from internal memory */ +uint8_t pic16c5x_device::GET_REGFILE(offs_t addr) /* Read from internal memory */ { - UINT8 data; + uint8_t data; if (addr == 0) { /* Indirect addressing */ addr = (FSR & m_picRAMmask); @@ -332,21 +332,21 @@ UINT8 pic16c5x_device::GET_REGFILE(offs_t addr) /* Read from internal memory */ case 00: /* Not an actual register, so return 0 */ data = 0; break; - case 04: data = (FSR | (UINT8)(~m_picRAMmask)); + case 04: data = (FSR | (uint8_t)(~m_picRAMmask)); break; case 05: data = m_read_a(PIC16C5x_PORTA, 0xff); data &= m_TRISA; - data |= ((UINT8)(~m_TRISA) & PORTA); + data |= ((uint8_t)(~m_TRISA) & PORTA); data &= 0x0f; /* 4-bit port (only lower 4 bits used) */ break; case 06: data = m_read_b(PIC16C5x_PORTB, 0xff); data &= m_TRISB; - data |= ((UINT8)(~m_TRISB) & PORTB); + data |= ((uint8_t)(~m_TRISB) & PORTB); break; case 07: if ((m_picmodel == 0x16C55) || (m_picmodel == 0x16C57)) { data = m_read_c(PIC16C5x_PORTC, 0xff); data &= m_TRISC; - data |= ((UINT8)(~m_TRISC) & PORTC); + data |= ((uint8_t)(~m_TRISC) & PORTC); } else { /* PIC16C54, PIC16C56, PIC16C58 */ data = M_RDRAM(addr); @@ -358,7 +358,7 @@ UINT8 pic16c5x_device::GET_REGFILE(offs_t addr) /* Read from internal memory */ return data; } -void pic16c5x_device::STORE_REGFILE(offs_t addr, UINT8 data) /* Write to internal memory */ +void pic16c5x_device::STORE_REGFILE(offs_t addr, uint8_t data) /* Write to internal memory */ { if (addr == 0) { /* Indirect addressing */ addr = (FSR & m_picRAMmask); @@ -381,19 +381,19 @@ void pic16c5x_device::STORE_REGFILE(offs_t addr, UINT8 data) /* Write to inte case 02: PCL = data; m_PC = ((STATUS & PA_REG) << 4) | data; break; - case 03: STATUS &= (UINT8)(~PA_REG); STATUS |= (data & PA_REG); + case 03: STATUS &= (uint8_t)(~PA_REG); STATUS |= (data & PA_REG); break; - case 04: FSR = (data | (UINT8)(~m_picRAMmask)); + case 04: FSR = (data | (uint8_t)(~m_picRAMmask)); break; case 05: data &= 0x0f; /* 4-bit port (only lower 4 bits used) */ - m_write_a(PIC16C5x_PORTA, data & (UINT8)(~m_TRISA), 0xff); + m_write_a(PIC16C5x_PORTA, data & (uint8_t)(~m_TRISA), 0xff); PORTA = data; break; - case 06: m_write_b(PIC16C5x_PORTB, data & (UINT8)(~m_TRISB), 0xff); + case 06: m_write_b(PIC16C5x_PORTB, data & (uint8_t)(~m_TRISB), 0xff); PORTB = data; break; case 07: if ((m_picmodel == 0x16C55) || (m_picmodel == 0x16C57)) { - m_write_c(PIC16C5x_PORTC, data & (UINT8)(~m_TRISC), 0xff); + m_write_c(PIC16C5x_PORTC, data & (uint8_t)(~m_TRISC), 0xff); PORTC = data; } else { /* PIC16C54, PIC16C56, PIC16C58 */ @@ -406,7 +406,7 @@ void pic16c5x_device::STORE_REGFILE(offs_t addr, UINT8 data) /* Write to inte } -void pic16c5x_device::STORE_RESULT(offs_t addr, UINT8 data) +void pic16c5x_device::STORE_RESULT(offs_t addr, uint8_t data) { if (m_opcode.b.l & 0x20) { @@ -521,7 +521,7 @@ void pic16c5x_device::clrwdt() void pic16c5x_device::comf() { - m_ALU = (UINT8)(~(GET_REGFILE(ADDR))); + m_ALU = (uint8_t)(~(GET_REGFILE(ADDR))); STORE_RESULT(ADDR, m_ALU); CALCULATE_Z_FLAG(); } @@ -669,12 +669,12 @@ void pic16c5x_device::tris() switch(m_opcode.b.l & 0x7) { case 05: if (m_TRISA == m_W) break; - else { m_TRISA = m_W | 0xf0; m_write_a(PIC16C5x_PORTA, PORTA & (UINT8)(~m_TRISA) & 0x0f, 0xff); break; } + else { m_TRISA = m_W | 0xf0; m_write_a(PIC16C5x_PORTA, PORTA & (uint8_t)(~m_TRISA) & 0x0f, 0xff); break; } case 06: if (m_TRISB == m_W) break; - else { m_TRISB = m_W; m_write_b(PIC16C5x_PORTB, PORTB & (UINT8)(~m_TRISB), 0xff); break; } + else { m_TRISB = m_W; m_write_b(PIC16C5x_PORTB, PORTB & (uint8_t)(~m_TRISB), 0xff); break; } case 07: if ((m_picmodel == 0x16C55) || (m_picmodel == 0x16C57)) { if (m_TRISC == m_W) break; - else { m_TRISC = m_W; m_write_c(PIC16C5x_PORTC, PORTC & (UINT8)(~m_TRISC), 0xff); break; } + else { m_TRISC = m_W; m_write_c(PIC16C5x_PORTC, PORTC & (uint8_t)(~m_TRISC), 0xff); break; } } else { illegal(); break; @@ -890,7 +890,7 @@ void pic16c5x_device::state_import(const device_state_entry &entry) PORTC = m_debugger_temp; break; case PIC16C5x_FSR: - FSR = ((m_debugger_temp & m_picRAMmask) | (UINT8)(~m_picRAMmask)); + FSR = ((m_debugger_temp & m_picRAMmask) | (uint8_t)(~m_picRAMmask)); break; case PIC16C5x_PSCL: m_prescaler = m_debugger_temp; @@ -918,7 +918,7 @@ void pic16c5x_device::state_export(const device_state_entry &entry) m_debugger_temp = PORTC; break; case PIC16C5x_FSR: - m_debugger_temp = ((FSR) & m_picRAMmask) | (UINT8)(~m_picRAMmask); + m_debugger_temp = ((FSR) & m_picRAMmask) | (uint8_t)(~m_picRAMmask); break; } } @@ -961,7 +961,7 @@ void pic16c5x_device::pic16c5x_reset_regs() m_TRISC = 0xff; m_OPTION = (T0CS_FLAG | T0SE_FLAG | PSA_FLAG | PS_REG); PCL = 0xff; - FSR |= (UINT8)(~m_picRAMmask); + FSR |= (uint8_t)(~m_picRAMmask); PORTA &= 0x0f; m_prescaler = 0; m_delay_timer = 0; @@ -975,7 +975,7 @@ void pic16c5x_device::pic16c5x_soft_reset() pic16c5x_reset_regs(); } -void pic16c5x_device::pic16c5x_set_config(UINT16 data) +void pic16c5x_device::pic16c5x_set_config(uint16_t data) { logerror("Writing %04x to the PIC16C5x config register\n",data); m_temp_config = data; @@ -1005,7 +1005,7 @@ void pic16c5x_device::pic16c5x_update_watchdog(int counts) if ((m_opcode.w.l != 3) && (m_opcode.w.l != 4)) { - UINT16 old_WDT = m_WDT; + uint16_t old_WDT = m_WDT; m_WDT -= counts; @@ -1057,7 +1057,7 @@ void pic16c5x_device::pic16c5x_update_timer(int counts) void pic16c5x_device::execute_run() { - UINT8 T0_in; + uint8_t T0_in; update_internalram_ptr(); diff --git a/src/devices/cpu/pic16c5x/pic16c5x.h b/src/devices/cpu/pic16c5x/pic16c5x.h index c3d2480fd86..0ff240d9f8e 100644 --- a/src/devices/cpu/pic16c5x/pic16c5x.h +++ b/src/devices/cpu/pic16c5x/pic16c5x.h @@ -64,7 +64,7 @@ class pic16c5x_device : public cpu_device { public: // construction/destruction - pic16c5x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int data_width, int picmodel); + pic16c5x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int data_width, int picmodel); // static configuration helpers template static devcb_base &set_read_a_callback(device_t &device, _Object object) { return downcast(device).m_read_a.set_callback(object); } @@ -82,10 +82,10 @@ public: * during ROM programming, so should be called in the driver INIT, with * the value if known (available in HEX dumps of the ROM). */ - void pic16c5x_set_config(UINT16 data); + void pic16c5x_set_config(uint16_t data); // or with a macro - static void set_config_static(device_t &device, UINT16 data) { downcast(device).m_temp_config = data; } + static void set_config_static(device_t &device, uint16_t data) { downcast(device).m_temp_config = data; } protected: // device-level overrides @@ -100,12 +100,12 @@ protected: * times. (Each instruction cycle passes through 4 machine states). This * is handled by the cpu execution engine. */ - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } - virtual UINT32 execute_input_lines() const override { return 1; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -120,38 +120,38 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; address_space_config m_data_config; /******************** CPU Internal Registers *******************/ - UINT16 m_PC; - UINT16 m_PREVPC; /* previous program counter */ - UINT8 m_W; - UINT8 m_OPTION; - UINT16 m_CONFIG; - UINT8 m_ALU; - UINT16 m_WDT; - UINT8 m_TRISA; - UINT8 m_TRISB; - UINT8 m_TRISC; - UINT16 m_STACK[2]; - UINT16 m_prescaler; /* Note: this is really an 8-bit register */ + uint16_t m_PC; + uint16_t m_PREVPC; /* previous program counter */ + uint8_t m_W; + uint8_t m_OPTION; + uint16_t m_CONFIG; + uint8_t m_ALU; + uint16_t m_WDT; + uint8_t m_TRISA; + uint8_t m_TRISB; + uint8_t m_TRISC; + uint16_t m_STACK[2]; + uint16_t m_prescaler; /* Note: this is really an 8-bit register */ PAIR m_opcode; - UINT8 *m_internalram; + uint8_t *m_internalram; int m_icount; int m_reset_vector; int m_picmodel; int m_delay_timer; - UINT16 m_temp_config; - UINT8 m_old_T0; - INT8 m_old_data; - UINT8 m_picRAMmask; + uint16_t m_temp_config; + uint8_t m_old_T0; + int8_t m_old_data; + uint8_t m_picRAMmask; int m_inst_cycles; address_space *m_program; @@ -174,7 +174,7 @@ private: typedef void (pic16c5x_device::*pic16c5x_ophandler)(); struct pic16c5x_opcode { - UINT8 cycles; + uint8_t cycles; pic16c5x_ophandler function; }; static const pic16c5x_opcode s_opcode_main[256]; @@ -186,11 +186,11 @@ private: void CALCULATE_ADD_DIGITCARRY(); void CALCULATE_SUB_CARRY(); void CALCULATE_SUB_DIGITCARRY(); - UINT16 POP_STACK(); - void PUSH_STACK(UINT16 data); - UINT8 GET_REGFILE(offs_t addr); - void STORE_REGFILE(offs_t addr, UINT8 data); - void STORE_RESULT(offs_t addr, UINT8 data); + uint16_t POP_STACK(); + void PUSH_STACK(uint16_t data); + uint8_t GET_REGFILE(offs_t addr); + void STORE_REGFILE(offs_t addr, uint8_t data); + void STORE_RESULT(offs_t addr, uint8_t data); void illegal(); void addwf(); void andwf(); @@ -237,7 +237,7 @@ class pic16c54_device : public pic16c5x_device { public: // construction/destruction - pic16c54_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c54_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -245,7 +245,7 @@ class pic16c55_device : public pic16c5x_device { public: // construction/destruction - pic16c55_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c55_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -253,7 +253,7 @@ class pic16c56_device : public pic16c5x_device { public: // construction/destruction - pic16c56_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c56_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -261,7 +261,7 @@ class pic16c57_device : public pic16c5x_device { public: // construction/destruction - pic16c57_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c57_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -269,7 +269,7 @@ class pic16c58_device : public pic16c5x_device { public: // construction/destruction - pic16c58_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c58_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; #endif /* __PIC16C5X_H__ */ diff --git a/src/devices/cpu/pic16c62x/16c62xdsm.cpp b/src/devices/cpu/pic16c62x/16c62xdsm.cpp index bd1772f764b..580e7ea88c8 100644 --- a/src/devices/cpu/pic16c62x/16c62xdsm.cpp +++ b/src/devices/cpu/pic16c62x/16c62xdsm.cpp @@ -29,8 +29,8 @@ #include "emu.h" #include -static const UINT8 *rombase; -static const UINT8 *rambase; +static const uint8_t *rombase; +static const uint8_t *rambase; static offs_t pcbase; #define READOP16(A) (rombase[(A) - pcbase] | (rombase[(A) + 1 - pcbase] << 8)) #define READARG16(A) (rambase[(A) - pcbase] | (rambase[(A) + 1 - pcbase] << 8)) @@ -146,7 +146,7 @@ static void InitDasm16C5x(void) fatalerror("not enough bits in encoding '%s %s' %d\n", ops[0],ops[1],bit); } - while (isspace((UINT8)*p)) p++; + while (isspace((uint8_t)*p)) p++; if (*p) Op[i].extcode = *p; Op[i].bits = bits; Op[i].mask = mask; @@ -170,7 +170,7 @@ CPU_DISASSEMBLE( pic16c62x ) int bit; //char *buffertmp; const char *cp; /* character pointer in OpFormats */ - UINT32 flags = 0; + uint32_t flags = 0; rombase = oprom; rambase = opram; diff --git a/src/devices/cpu/pic16c62x/pic16c62x.cpp b/src/devices/cpu/pic16c62x/pic16c62x.cpp index baf29483185..a3b3c270690 100644 --- a/src/devices/cpu/pic16c62x/pic16c62x.cpp +++ b/src/devices/cpu/pic16c62x/pic16c62x.cpp @@ -113,7 +113,7 @@ static ADDRESS_MAP_START( pic16c62xa_ram, AS_DATA, 8, pic16c62x_device ) ADDRESS_MAP_END -pic16c62x_device::pic16c62x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int picmodel) +pic16c62x_device::pic16c62x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int picmodel) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, program_width, -1 , ( ( program_width == 9 ) ? ADDRESS_MAP_NAME(pic16c62x_rom_9) : ( ( program_width == 10 ) ? ADDRESS_MAP_NAME(pic16c62x_rom_10) : ADDRESS_MAP_NAME(pic16c62x_rom_11) ))) @@ -127,38 +127,38 @@ pic16c62x_device::pic16c62x_device(const machine_config &mconfig, device_type ty } -pic16c620_device::pic16c620_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c620_device::pic16c620_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c62x_device(mconfig, PIC16C620, "PIC16C620", tag, owner, clock, "pic16c620", 9, 0x16C620) { } -pic16c620a_device::pic16c620a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c620a_device::pic16c620a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c62x_device(mconfig, PIC16C620A, "PIC16C620A", tag, owner, clock, "pic16c620a", 9, 0x16C620A) { } -pic16c621_device::pic16c621_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c621_device::pic16c621_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c62x_device(mconfig, PIC16C621, "PIC16C621", tag, owner, clock, "pic16c621", 9, 0x16C621) { } -pic16c621a_device::pic16c621a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c621a_device::pic16c621a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c62x_device(mconfig, PIC16C621A, "PIC16C621A", tag, owner, clock, "pic16c621a", 9, 0x16C621A) { } -pic16c622_device::pic16c622_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c622_device::pic16c622_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c62x_device(mconfig, PIC16C622, "PIC16C622", tag, owner, clock, "pic16c622", 9, 0x16C622) { } -pic16c622a_device::pic16c622a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic16c622a_device::pic16c622a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pic16c62x_device(mconfig, PIC16C622A, "PIC16C622A", tag, owner, clock, "pic16c622a", 9, 0x16C622A) { } -offs_t pic16c62x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t pic16c62x_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( pic16c62x ); return CPU_DISASSEMBLE_NAME(pic16c62x)(this, buffer, pc, oprom, opram, options); @@ -167,13 +167,13 @@ offs_t pic16c62x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 void pic16c62x_device::update_internalram_ptr() { - m_internalram = (UINT8 *)m_data->get_write_ptr(0x00); + m_internalram = (uint8_t *)m_data->get_write_ptr(0x00); } #define PIC16C62x_RDOP(A) (m_direct->read_word((A)<<1)) -#define PIC16C62x_RAM_RDMEM(A) ((UINT8)m_data->read_byte(A)) +#define PIC16C62x_RAM_RDMEM(A) ((uint8_t)m_data->read_byte(A)) #define PIC16C62x_RAM_WRMEM(A,V) (m_data->write_byte(A,V)) -#define PIC16C62x_In(Port) ((UINT8)m_io->read_byte((Port))) +#define PIC16C62x_In(Port) ((uint8_t)m_io->read_byte((Port))) #define PIC16C62x_Out(Port,Value) (m_io->write_byte((Port),Value)) /************ Read the state of the T0 Clock input signal ************/ #define PIC16C62x_T0_In (m_io->read_byte(PIC16C62x_T0) >> 4) @@ -255,7 +255,7 @@ void pic16c62x_device::update_internalram_ptr() * Shortcuts ************************************************************************/ -#define CLR(flagreg, flag) ( flagreg &= (UINT8)(~flag) ) +#define CLR(flagreg, flag) ( flagreg &= (uint8_t)(~flag) ) #define SET(flagreg, flag) ( flagreg |= flag ) @@ -274,7 +274,7 @@ void pic16c62x_device::CALCULATE_Z_FLAG() void pic16c62x_device::CALCULATE_ADD_CARRY() { - if ((UINT8)(m_old_data) > (UINT8)(m_ALU)) { + if ((uint8_t)(m_old_data) > (uint8_t)(m_ALU)) { SET(STATUS, C_FLAG); } else { @@ -284,7 +284,7 @@ void pic16c62x_device::CALCULATE_ADD_CARRY() void pic16c62x_device::CALCULATE_ADD_DIGITCARRY() { - if (((UINT8)(m_old_data) & 0x0f) > ((UINT8)(m_ALU) & 0x0f)) { + if (((uint8_t)(m_old_data) & 0x0f) > ((uint8_t)(m_ALU) & 0x0f)) { SET(STATUS, DC_FLAG); } else { @@ -294,7 +294,7 @@ void pic16c62x_device::CALCULATE_ADD_DIGITCARRY() void pic16c62x_device::CALCULATE_SUB_CARRY() { - if ((UINT8)(m_old_data) < (UINT8)(m_ALU)) { + if ((uint8_t)(m_old_data) < (uint8_t)(m_ALU)) { CLR(STATUS, C_FLAG); } else { @@ -304,7 +304,7 @@ void pic16c62x_device::CALCULATE_SUB_CARRY() void pic16c62x_device::CALCULATE_SUB_DIGITCARRY() { - if (((UINT8)(m_old_data) & 0x0f) < ((UINT8)(m_ALU) & 0x0f)) { + if (((uint8_t)(m_old_data) & 0x0f) < ((uint8_t)(m_ALU) & 0x0f)) { CLR(STATUS, DC_FLAG); } else { @@ -313,9 +313,9 @@ void pic16c62x_device::CALCULATE_SUB_DIGITCARRY() } -UINT16 pic16c62x_device::POP_STACK() +uint16_t pic16c62x_device::POP_STACK() { - UINT16 data = m_STACK[7]; + uint16_t data = m_STACK[7]; m_STACK[7] = m_STACK[6]; m_STACK[6] = m_STACK[5]; m_STACK[5] = m_STACK[4]; @@ -325,7 +325,7 @@ UINT16 pic16c62x_device::POP_STACK() m_STACK[1] = m_STACK[0]; return (data & ADDR_MASK); } -void pic16c62x_device::PUSH_STACK(UINT16 data) +void pic16c62x_device::PUSH_STACK(uint16_t data) { m_STACK[0] = m_STACK[1]; m_STACK[1] = m_STACK[2]; @@ -339,9 +339,9 @@ void pic16c62x_device::PUSH_STACK(UINT16 data) -UINT8 pic16c62x_device::GET_REGFILE(offs_t addr) /* Read from internal memory */ +uint8_t pic16c62x_device::GET_REGFILE(offs_t addr) /* Read from internal memory */ { - UINT8 data; + uint8_t data; if (addr == 0) { /* Indirect addressing */ addr = (FSR & m_picRAMmask); @@ -362,16 +362,16 @@ UINT8 pic16c62x_device::GET_REGFILE(offs_t addr) /* Read from internal memory data = M_RDRAM(addr & 0x7f); break; case 0x84: - case 0x04: data = (FSR | (UINT8)(~m_picRAMmask)); + case 0x04: data = (FSR | (uint8_t)(~m_picRAMmask)); break; case 0x05: data = P_IN(0); data &= m_TRISA; - data |= ((UINT8)(~m_TRISA) & PORTA); + data |= ((uint8_t)(~m_TRISA) & PORTA); data &= 0x1f; /* 5-bit port (only lower 5 bits used) */ break; case 0x06: data = P_IN(1); data &= m_TRISB; - data |= ((UINT8)(~m_TRISB) & PORTB); + data |= ((uint8_t)(~m_TRISB) & PORTB); break; case 0x8a: case 0x0a: data = m_PCLATH; @@ -388,7 +388,7 @@ UINT8 pic16c62x_device::GET_REGFILE(offs_t addr) /* Read from internal memory return data; } -void pic16c62x_device::STORE_REGFILE(offs_t addr, UINT8 data) /* Write to internal memory */ +void pic16c62x_device::STORE_REGFILE(offs_t addr, uint8_t data) /* Write to internal memory */ { if (addr == 0) { /* Indirect addressing */ addr = (FSR & m_picRAMmask); @@ -408,15 +408,15 @@ void pic16c62x_device::STORE_REGFILE(offs_t addr, UINT8 data) /* Write to inte m_PC = (m_PCLATH << 8) | data; break; case 0x83: - case 0x03: STATUS &= (UINT8)(~(IRP_FLAG|RP1_FLAG|RP0_FLAG)); STATUS |= (data & (IRP_FLAG|RP1_FLAG|RP0_FLAG)); + case 0x03: STATUS &= (uint8_t)(~(IRP_FLAG|RP1_FLAG|RP0_FLAG)); STATUS |= (data & (IRP_FLAG|RP1_FLAG|RP0_FLAG)); break; case 0x84: - case 0x04: FSR = (data | (UINT8)(~m_picRAMmask)); + case 0x04: FSR = (data | (uint8_t)(~m_picRAMmask)); break; case 0x05: data &= 0x1f; /* 5-bit port (only lower 5 bits used) */ - P_OUT(0,data & (UINT8)(~m_TRISA)); PORTA = data; + P_OUT(0,data & (uint8_t)(~m_TRISA)); PORTA = data; break; - case 0x06: P_OUT(1,data & (UINT8)(~m_TRISB)); PORTB = data; + case 0x06: P_OUT(1,data & (uint8_t)(~m_TRISB)); PORTB = data; break; case 0x8a: case 0x0a: @@ -433,7 +433,7 @@ void pic16c62x_device::STORE_REGFILE(offs_t addr, UINT8 data) /* Write to inte { m_TRISA = data | 0xf0; P_OUT(2,m_TRISA); - P_OUT(0,PORTA & (UINT8)(~m_TRISA) & 0x0f); + P_OUT(0,PORTA & (uint8_t)(~m_TRISA) & 0x0f); M_WRTRAM(addr, data); } break; @@ -441,7 +441,7 @@ void pic16c62x_device::STORE_REGFILE(offs_t addr, UINT8 data) /* Write to inte { m_TRISB = data; P_OUT(3,m_TRISB); - P_OUT(1,PORTB & (UINT8)(~m_TRISB)); + P_OUT(1,PORTB & (uint8_t)(~m_TRISB)); M_WRTRAM(addr, data); } break; @@ -451,7 +451,7 @@ void pic16c62x_device::STORE_REGFILE(offs_t addr, UINT8 data) /* Write to inte } -void pic16c62x_device::STORE_RESULT(offs_t addr, UINT8 data) +void pic16c62x_device::STORE_RESULT(offs_t addr, uint8_t data) { if (m_opcode.b.l & 0x80) { @@ -575,7 +575,7 @@ void pic16c62x_device::clrwdt() void pic16c62x_device::comf() { - m_ALU = (UINT8)(~(GET_REGFILE(ADDR))); + m_ALU = (uint8_t)(~(GET_REGFILE(ADDR))); STORE_RESULT(ADDR, m_ALU); CALCULATE_Z_FLAG(); } @@ -960,7 +960,7 @@ void pic16c62x_device::state_import(const device_state_entry &entry) PORTB = m_debugger_temp; break; case PIC16C62x_FSR: - FSR = ((m_debugger_temp & m_picRAMmask) | (UINT8)(~m_picRAMmask)); + FSR = ((m_debugger_temp & m_picRAMmask) | (uint8_t)(~m_picRAMmask)); break; case PIC16C62x_PSCL: m_prescaler = m_debugger_temp; @@ -985,7 +985,7 @@ void pic16c62x_device::state_export(const device_state_entry &entry) m_debugger_temp = PORTB; break; case PIC16C62x_FSR: - m_debugger_temp = ((FSR) & m_picRAMmask) | (UINT8)(~m_picRAMmask); + m_debugger_temp = ((FSR) & m_picRAMmask) | (uint8_t)(~m_picRAMmask); break; } } @@ -1027,7 +1027,7 @@ void pic16c62x_device::pic16c62x_reset_regs() m_OPTION = 0xff; STATUS = 0x18; PCL = 0; - FSR |= (UINT8)(~m_picRAMmask); + FSR |= (uint8_t)(~m_picRAMmask); PORTA = 0; m_prescaler = 0; m_delay_timer = 0; @@ -1067,7 +1067,7 @@ void pic16c62x_device::pic16c62x_update_watchdog(int counts) if ((m_opcode.w.l != 0x64) && (m_opcode.w.l != 0x63)) { - UINT16 old_WDT = m_WDT; + uint16_t old_WDT = m_WDT; m_WDT -= counts; @@ -1119,7 +1119,7 @@ void pic16c62x_device::pic16c62x_update_timer(int counts) void pic16c62x_device::execute_run() { - UINT8 T0_in; + uint8_t T0_in; update_internalram_ptr(); diff --git a/src/devices/cpu/pic16c62x/pic16c62x.h b/src/devices/cpu/pic16c62x/pic16c62x.h index 7e8af51ca40..7321296cc9d 100644 --- a/src/devices/cpu/pic16c62x/pic16c62x.h +++ b/src/devices/cpu/pic16c62x/pic16c62x.h @@ -55,19 +55,19 @@ class pic16c62x_device : public cpu_device { public: // construction/destruction - pic16c62x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int program_width, int picmodel); + pic16c62x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int program_width, int picmodel); protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } - virtual UINT32 execute_input_lines() const override { return 1; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -82,9 +82,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -92,29 +92,29 @@ private: address_space_config m_io_config; /******************** CPU Internal Registers *******************/ - UINT16 m_PC; - UINT16 m_PREVPC; /* previous program counter */ - UINT8 m_W; - UINT8 m_PCLATH; /* 0a,8a */ - UINT8 m_OPTION; /* 81 */ - UINT16 m_CONFIG; - UINT8 m_ALU; - UINT16 m_WDT; - UINT8 m_TRISA; /* 85 */ - UINT8 m_TRISB; /* 86 */ - UINT16 m_STACK[8]; - UINT16 m_prescaler; /* Note: this is really an 8-bit register */ + uint16_t m_PC; + uint16_t m_PREVPC; /* previous program counter */ + uint8_t m_W; + uint8_t m_PCLATH; /* 0a,8a */ + uint8_t m_OPTION; /* 81 */ + uint16_t m_CONFIG; + uint8_t m_ALU; + uint16_t m_WDT; + uint8_t m_TRISA; /* 85 */ + uint8_t m_TRISB; /* 86 */ + uint16_t m_STACK[8]; + uint16_t m_prescaler; /* Note: this is really an 8-bit register */ PAIR m_opcode; - UINT8 *m_internalram; + uint8_t *m_internalram; int m_icount; int m_reset_vector; int m_picmodel; int m_delay_timer; - UINT16 m_temp_config; - UINT8 m_old_T0; - INT8 m_old_data; - UINT8 m_picRAMmask; + uint16_t m_temp_config; + uint8_t m_old_T0; + int8_t m_old_data; + uint8_t m_picRAMmask; int m_inst_cycles; address_space *m_program; @@ -129,7 +129,7 @@ private: typedef void (pic16c62x_device::*pic16c62x_ophandler)(); struct pic16c62x_opcode { - UINT8 cycles; + uint8_t cycles; pic16c62x_ophandler function; }; pic16c62x_opcode m_opcode_table[16384]; @@ -139,7 +139,7 @@ private: { char *format; pic16c62x_ophandler function; - UINT8 cycles; + uint8_t cycles; }; static const pic16c62x_instruction s_instructiontable[]; @@ -149,11 +149,11 @@ private: void CALCULATE_ADD_DIGITCARRY(); void CALCULATE_SUB_CARRY(); void CALCULATE_SUB_DIGITCARRY(); - UINT16 POP_STACK(); - void PUSH_STACK(UINT16 data); - UINT8 GET_REGFILE(offs_t addr); - void STORE_REGFILE(offs_t addr, UINT8 data); - void STORE_RESULT(offs_t addr, UINT8 data); + uint16_t POP_STACK(); + void PUSH_STACK(uint16_t data); + uint8_t GET_REGFILE(offs_t addr); + void STORE_REGFILE(offs_t addr, uint8_t data); + void STORE_RESULT(offs_t addr, uint8_t data); void illegal(); void addwf(); void addlw(); @@ -206,14 +206,14 @@ class pic16c620_device : public pic16c62x_device { public: // construction/destruction - pic16c620_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c620_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class pic16c620a_device : public pic16c62x_device { public: // construction/destruction - pic16c620a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c620a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; /* @@ -221,35 +221,35 @@ class pic16cr620a_device : public pic16c62x_device { public: // construction/destruction - pic16cr620a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16cr620a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }*/ class pic16c621_device : public pic16c62x_device { public: // construction/destruction - pic16c621_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c621_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class pic16c621a_device : public pic16c62x_device { public: // construction/destruction - pic16c621a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c621a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class pic16c622_device : public pic16c62x_device { public: // construction/destruction - pic16c622_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c622_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class pic16c622a_device : public pic16c62x_device { public: // construction/destruction - pic16c622a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic16c622a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/powerpc/ppc.h b/src/devices/cpu/powerpc/ppc.h index 3ebb74d1227..0951dfb6b56 100644 --- a/src/devices/cpu/powerpc/ppc.h +++ b/src/devices/cpu/powerpc/ppc.h @@ -211,15 +211,15 @@ protected: public: // construction/destruction - ppc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int address_bits, int data_bits, powerpc_flavor flavor, UINT32 cap, UINT32 tb_divisor, address_map_constructor internal_map); + ppc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int address_bits, int data_bits, powerpc_flavor flavor, uint32_t cap, uint32_t tb_divisor, address_map_constructor internal_map); - static void set_bus_frequency(device_t &device, UINT32 bus_frequency) { downcast(device).c_bus_frequency = bus_frequency; } + static void set_bus_frequency(device_t &device, uint32_t bus_frequency) { downcast(device).c_bus_frequency = bus_frequency; } void ppc_set_dcstore_callback(write32_delegate callback); - void ppcdrc_set_options(UINT32 options); - void ppcdrc_add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base); - void ppcdrc_add_hotspot(offs_t pc, UINT32 opcode, UINT32 cycles); + void ppcdrc_set_options(uint32_t options); + void ppcdrc_add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base); + void ppcdrc_add_hotspot(offs_t pc, uint32_t opcode, uint32_t cycles); TIMER_CALLBACK_MEMBER(decrementer_int_callback); TIMER_CALLBACK_MEMBER(ppc4xx_buffered_dma_callback); @@ -251,9 +251,9 @@ protected: virtual void device_stop() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 40; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 40; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -267,9 +267,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; /* exception types */ enum @@ -295,36 +295,36 @@ protected: address_space_config m_program_config; address_space *m_program; - UINT32 c_bus_frequency; + uint32_t c_bus_frequency; struct internal_ppc_state { - UINT32 pc; - UINT32 r[32]; + uint32_t pc; + uint32_t r[32]; double f[32]; - UINT32 cr[8]; - UINT32 fpscr; - UINT32 msr; - UINT32 xerso; - UINT32 sr[16]; - UINT32 spr[1024]; + uint32_t cr[8]; + uint32_t fpscr; + uint32_t msr; + uint32_t xerso; + uint32_t sr[16]; + uint32_t spr[1024]; int icount; - UINT32 mode; /* current global mode */ - UINT32 irq_pending; + uint32_t mode; /* current global mode */ + uint32_t irq_pending; /* parameters for calls */ - UINT32 param0; - UINT32 param1; + uint32_t param0; + uint32_t param1; /* PowerPC 603-specific state */ - UINT32 mmu603_cmp; - UINT32 mmu603_hash[2]; - UINT32 mmu603_r[4]; + uint32_t mmu603_cmp; + uint32_t mmu603_hash[2]; + uint32_t mmu603_r[4]; /* parameters for subroutines */ - UINT32 tempaddr; /* temporary address storage */ + uint32_t tempaddr; /* temporary address storage */ drcuml_ireg tempdata; /* temporary data storage */ - UINT32 updateaddr; /* update address storage */ - UINT32 swcount; /* counter for sw instructions */ + uint32_t updateaddr; /* update address storage */ + uint32_t swcount; /* counter for sw instructions */ const char * format; /* format string for printing */ - UINT32 arg0; /* print_debug argument 1 */ + uint32_t arg0; /* print_debug argument 1 */ double fp0; /* floating point 0 */ }; @@ -335,82 +335,82 @@ protected: int m_ppc_dec_trigger_cycle; int m_bus_freq_multiplier; - UINT32 m_npc; - UINT32 m_dcr[256]; - - UINT32 m_lr; - UINT32 m_ctr; - UINT32 m_xer; - UINT32 m_pvr; - UINT32 m_srr0; - UINT32 m_srr1; - UINT32 m_srr2; - UINT32 m_srr3; - UINT32 m_hid0; - UINT32 m_hid1; - UINT32 m_hid2; - UINT32 m_sdr1; - UINT32 m_sprg[4]; - - UINT32 m_dsisr; - UINT32 m_dar; - UINT32 m_ear; - UINT32 m_dmiss; - UINT32 m_dcmp; - UINT32 m_hash1; - UINT32 m_hash2; - UINT32 m_imiss; - UINT32 m_icmp; - UINT32 m_rpa; + uint32_t m_npc; + uint32_t m_dcr[256]; + + uint32_t m_lr; + uint32_t m_ctr; + uint32_t m_xer; + uint32_t m_pvr; + uint32_t m_srr0; + uint32_t m_srr1; + uint32_t m_srr2; + uint32_t m_srr3; + uint32_t m_hid0; + uint32_t m_hid1; + uint32_t m_hid2; + uint32_t m_sdr1; + uint32_t m_sprg[4]; + + uint32_t m_dsisr; + uint32_t m_dar; + uint32_t m_ear; + uint32_t m_dmiss; + uint32_t m_dcmp; + uint32_t m_hash1; + uint32_t m_hash2; + uint32_t m_imiss; + uint32_t m_icmp; + uint32_t m_rpa; struct BATENT { - UINT32 u; - UINT32 l; + uint32_t u; + uint32_t l; }; BATENT m_ibat[4]; BATENT m_dbat[4]; - UINT32 m_evpr; - UINT32 m_exier; - UINT32 m_exisr; - UINT32 m_bear; - UINT32 m_besr; - UINT32 m_iocr; - UINT32 m_br[8]; - UINT32 m_iabr; - UINT32 m_esr; - UINT32 m_iccr; - UINT32 m_dccr; - UINT32 m_pit; - UINT32 m_pit_counter; - UINT32 m_pit_int_enable; - UINT32 m_tsr; - UINT32 m_dbsr; - UINT32 m_sgr; - UINT32 m_pid; - UINT32 m_pbl1; - UINT32 m_pbl2; - UINT32 m_pbu1; - UINT32 m_pbu2; - UINT32 m_fit_bit; - UINT32 m_fit_int_enable; - UINT32 m_wdt_bit; - UINT32 m_wdt_int_enable; - UINT32 m_dac1; - UINT32 m_dac2; - UINT32 m_iac1; - UINT32 m_iac2; + uint32_t m_evpr; + uint32_t m_exier; + uint32_t m_exisr; + uint32_t m_bear; + uint32_t m_besr; + uint32_t m_iocr; + uint32_t m_br[8]; + uint32_t m_iabr; + uint32_t m_esr; + uint32_t m_iccr; + uint32_t m_dccr; + uint32_t m_pit; + uint32_t m_pit_counter; + uint32_t m_pit_int_enable; + uint32_t m_tsr; + uint32_t m_dbsr; + uint32_t m_sgr; + uint32_t m_pid; + uint32_t m_pbl1; + uint32_t m_pbl2; + uint32_t m_pbu1; + uint32_t m_pbu2; + uint32_t m_fit_bit; + uint32_t m_fit_int_enable; + uint32_t m_wdt_bit; + uint32_t m_wdt_int_enable; + uint32_t m_dac1; + uint32_t m_dac2; + uint32_t m_iac1; + uint32_t m_iac2; struct SPU_REGS { - UINT8 spls; - UINT8 sphs; - UINT16 brd; - UINT8 spctl; - UINT8 sprc; - UINT8 sptc; - UINT8 sprb; - UINT8 sptb; + uint8_t spls; + uint8_t sphs; + uint16_t brd; + uint8_t spctl; + uint8_t sprc; + uint8_t sptc; + uint8_t sprb; + uint8_t sptb; emu_timer *rx_timer; emu_timer *tx_timer; }; @@ -418,33 +418,33 @@ protected: SPU_REGS m_spu_old; struct DMA_REGS { - UINT32 cr; - UINT32 da; - UINT32 sa; - UINT32 ct; - UINT32 cc; + uint32_t cr; + uint32_t da; + uint32_t sa; + uint32_t ct; + uint32_t cc; }; DMA_REGS m_dma[4]; - UINT32 m_dmasr; + uint32_t m_dmasr; int m_reserved; - UINT32 m_reserved_address; + uint32_t m_reserved_address; int m_interrupt_pending; - UINT64 m_tb; /* 56-bit timebase register */ + uint64_t m_tb; /* 56-bit timebase register */ // STUFF added for the 6xx series - UINT32 m_dec, m_dec_frac; + uint32_t m_dec, m_dec_frac; union FPR { - UINT64 id; + uint64_t id; double fd; }; union FPR32 { - UINT32 i; + uint32_t i; float f; }; @@ -454,30 +454,30 @@ protected: int m_is602; /* PowerPC 602 specific registers */ - UINT32 m_lt; - UINT32 m_sp; - UINT32 m_tcr; - UINT32 m_ibr; - UINT32 m_esasrr; - UINT32 m_sebr; - UINT32 m_ser; + uint32_t m_lt; + uint32_t m_sp; + uint32_t m_tcr; + uint32_t m_ibr; + uint32_t m_esasrr; + uint32_t m_sebr; + uint32_t m_ser; /* architectural distinctions */ powerpc_flavor m_flavor; - UINT32 m_cap; - UINT8 m_cache_line_size; - UINT32 m_tb_divisor; + uint32_t m_cap; + uint8_t m_cache_line_size; + uint32_t m_tb_divisor; /* PowerPC 4xx-specific state */ /* PowerPC 4XX-specific serial port state */ struct ppc4xx_spu_state { - UINT8 regs[9]; - UINT8 txbuf; - UINT8 rxbuf; + uint8_t regs[9]; + uint8_t txbuf; + uint8_t rxbuf; emu_timer * timer; - UINT8 rxbuffer[256]; - UINT32 rxin, rxout; + uint8_t rxbuffer[256]; + uint32_t rxin, rxout; write8_delegate tx_cb; }; @@ -485,18 +485,18 @@ protected: emu_timer * m_fit_timer; emu_timer * m_pit_timer; emu_timer * m_wdog_timer; - UINT32 m_pit_reload; - UINT32 m_irqstate; + uint32_t m_pit_reload; + uint32_t m_irqstate; emu_timer * m_buffered_dma_timer[4]; int m_buffered_dma_rate[4]; /* internal stuff */ direct_read_data *m_direct; offs_t m_codexor; - UINT32 m_system_clock; - UINT32 m_cpu_clock; - UINT64 m_tb_zero_cycles; - UINT64 m_dec_zero_cycles; + uint32_t m_system_clock; + uint32_t m_cpu_clock; + uint64_t m_tb_zero_cycles; + uint64_t m_dec_zero_cycles; emu_timer * m_decrementer_int_timer; read32_delegate m_dcr_read_func; @@ -511,45 +511,45 @@ protected: #ifdef PPC_H_INCLUDED_FROM_PPC_C jmp_buf m_exception_jmpbuf; #endif - UINT8 (*m_ppcread8)(address_space &space, offs_t address); - UINT16 (*m_ppcread16)(address_space &space, offs_t address); - UINT32 (*m_ppcread32)(address_space &space, offs_t address); - UINT64 (*m_ppcread64)(address_space &space, offs_t address); - void (*m_ppcwrite8)(address_space &space, offs_t address, UINT8 data); - void (*m_ppcwrite16)(address_space &space, offs_t address, UINT16 data); - void (*m_ppcwrite32)(address_space &space, offs_t address, UINT32 data); - void (*m_ppcwrite64)(address_space &space, offs_t address, UINT64 data); - UINT16 (*m_ppcread16_unaligned)(address_space &space, offs_t address); - UINT32 (*m_ppcread32_unaligned)(address_space &space, offs_t address); - UINT64 (*m_ppcread64_unaligned)(address_space &space, offs_t address); - void (*m_ppcwrite16_unaligned)(address_space &space, offs_t address, UINT16 data); - void (*m_ppcwrite32_unaligned)(address_space &space, offs_t address, UINT32 data); - void (*m_ppcwrite64_unaligned)(address_space &space, offs_t address, UINT64 data); - - void (*m_optable19[1024])(UINT32); - void (*m_optable31[1024])(UINT32); - void (*m_optable59[1024])(UINT32); - void (*m_optable63[1024])(UINT32); - void (*m_optable[64])(UINT32); + uint8_t (*m_ppcread8)(address_space &space, offs_t address); + uint16_t (*m_ppcread16)(address_space &space, offs_t address); + uint32_t (*m_ppcread32)(address_space &space, offs_t address); + uint64_t (*m_ppcread64)(address_space &space, offs_t address); + void (*m_ppcwrite8)(address_space &space, offs_t address, uint8_t data); + void (*m_ppcwrite16)(address_space &space, offs_t address, uint16_t data); + void (*m_ppcwrite32)(address_space &space, offs_t address, uint32_t data); + void (*m_ppcwrite64)(address_space &space, offs_t address, uint64_t data); + uint16_t (*m_ppcread16_unaligned)(address_space &space, offs_t address); + uint32_t (*m_ppcread32_unaligned)(address_space &space, offs_t address); + uint64_t (*m_ppcread64_unaligned)(address_space &space, offs_t address); + void (*m_ppcwrite16_unaligned)(address_space &space, offs_t address, uint16_t data); + void (*m_ppcwrite32_unaligned)(address_space &space, offs_t address, uint32_t data); + void (*m_ppcwrite64_unaligned)(address_space &space, offs_t address, uint64_t data); + + void (*m_optable19[1024])(uint32_t); + void (*m_optable31[1024])(uint32_t); + void (*m_optable59[1024])(uint32_t); + void (*m_optable63[1024])(uint32_t); + void (*m_optable[64])(uint32_t); /* core state */ drc_cache m_cache; /* pointer to the DRC code cache */ std::unique_ptr m_drcuml; /* DRC UML generator state */ std::unique_ptr m_drcfe; /* pointer to the DRC front-end state */ - UINT32 m_drcoptions; /* configurable DRC options */ + uint32_t m_drcoptions; /* configurable DRC options */ /* parameters for subroutines */ - UINT32 m_arg1; /* print_debug argument 2 */ + uint32_t m_arg1; /* print_debug argument 2 */ /* tables */ - UINT8 m_fpmode[4]; /* FPU mode table */ - UINT8 m_sz_cr_table[32]; /* SZ CR table */ - UINT8 m_cmp_cr_table[32]; /* CMP CR table */ - UINT8 m_cmpl_cr_table[32]; /* CMPL CR table */ - UINT8 m_fcmp_cr_table[32]; /* FCMP CR table */ + uint8_t m_fpmode[4]; /* FPU mode table */ + uint8_t m_sz_cr_table[32]; /* SZ CR table */ + uint8_t m_cmp_cr_table[32]; /* CMP CR table */ + uint8_t m_cmpl_cr_table[32]; /* CMPL CR table */ + uint8_t m_fcmp_cr_table[32]; /* FCMP CR table */ /* internal stuff */ - UINT8 m_cache_dirty; /* true if we need to flush the cache */ + uint8_t m_cache_dirty; /* true if we need to flush the cache */ /* register mappings */ uml::parameter m_regmap[32]; /* parameter to register mappings for all 32 integer registers */ @@ -588,11 +588,11 @@ protected: { offs_t start; /* start of the RAM block */ offs_t end; /* end of the RAM block */ - UINT8 readonly; /* TRUE if read-only */ + uint8_t readonly; /* TRUE if read-only */ void * base; /* base in memory where the RAM lives */ }; - UINT32 m_fastram_select; + uint32_t m_fastram_select; fast_ram_info m_fastram[PPC_MAX_FASTRAM]; /* hotspots */ @@ -600,57 +600,57 @@ protected: struct hotspot_info { offs_t pc; /* PC to consider */ - UINT32 opcode; /* required opcode at that PC */ - UINT32 cycles; /* number of cycles to eat when hit */ + uint32_t opcode; /* required opcode at that PC */ + uint32_t cycles; /* number of cycles to eat when hit */ }; - UINT32 m_hotspot_select; + uint32_t m_hotspot_select; hotspot_info m_hotspot[PPC_MAX_HOTSPOTS]; - UINT64 m_debugger_temp; + uint64_t m_debugger_temp; /* internal compiler state */ struct compiler_state { - UINT32 cycles; /* accumulated cycles */ - UINT8 checkints; /* need to check interrupts before next instruction */ - UINT8 checksoftints; /* need to check software interrupts before next instruction */ + uint32_t cycles; /* accumulated cycles */ + uint8_t checkints; /* need to check interrupts before next instruction */ + uint8_t checksoftints; /* need to check software interrupts before next instruction */ uml::code_label labelnum; /* index for local labels */ }; - UINT32 get_cr(); - void set_cr(UINT32 value); - UINT32 get_xer(); - void set_xer(UINT32 value); - UINT64 get_timebase(); - void set_timebase(UINT64 newtb); - UINT32 get_decrementer(); - void set_decrementer(UINT32 newdec); - UINT32 ppccom_translate_address_internal(int intention, offs_t &address); - void ppc4xx_set_irq_line(UINT32 bitmask, int state); - int ppc4xx_get_irq_line(UINT32 bitmask); + uint32_t get_cr(); + void set_cr(uint32_t value); + uint32_t get_xer(); + void set_xer(uint32_t value); + uint64_t get_timebase(); + void set_timebase(uint64_t newtb); + uint32_t get_decrementer(); + void set_decrementer(uint32_t newdec); + uint32_t ppccom_translate_address_internal(int intention, offs_t &address); + void ppc4xx_set_irq_line(uint32_t bitmask, int state); + int ppc4xx_get_irq_line(uint32_t bitmask); void ppc4xx_dma_update_irq_states(); int ppc4xx_dma_decrement_count(int dmachan); - int ppc4xx_dma_fetch_transmit_byte(int dmachan, UINT8 *byte); - int ppc4xx_dma_handle_receive_byte(int dmachan, UINT8 byte); + int ppc4xx_dma_fetch_transmit_byte(int dmachan, uint8_t *byte); + int ppc4xx_dma_handle_receive_byte(int dmachan, uint8_t byte); void ppc4xx_dma_exec(int dmachan); void ppc4xx_spu_update_irq_states(); - void ppc4xx_spu_rx_data(UINT8 data); + void ppc4xx_spu_rx_data(uint8_t data); void ppc4xx_spu_timer_reset(); void alloc_handle(drcuml_state *drcuml, uml::code_handle **handleptr, const char *name); void load_fast_iregs(drcuml_block *block); void save_fast_iregs(drcuml_block *block); void load_fast_fregs(drcuml_block *block); void save_fast_fregs(drcuml_block *block); - UINT32 compute_rlw_mask(UINT8 mb, UINT8 me); - UINT32 compute_crf_mask(UINT8 crm); - UINT32 compute_spr(UINT32 spr); + uint32_t compute_rlw_mask(uint8_t mb, uint8_t me); + uint32_t compute_crf_mask(uint8_t crm); + uint32_t compute_spr(uint32_t spr); void code_flush_cache(); - void code_compile_block(UINT8 mode, offs_t pc); + void code_compile_block(uint8_t mode, offs_t pc); void static_generate_entry_point(); void static_generate_nocode_handler(); void static_generate_out_of_cycles(); void static_generate_tlb_mismatch(); - void static_generate_exception(UINT8 exception, int recover, const char *name); + void static_generate_exception(uint8_t exception, int recover, const char *name); void static_generate_memory_accessor(int mode, int size, int iswrite, int ismasked, const char *name, uml::code_handle *&handleptr, uml::code_handle *masked); void static_generate_swap_tgpr(); void static_generate_lsw_entries(int mode); @@ -659,19 +659,19 @@ protected: void generate_update_cycles(drcuml_block *block, compiler_state *compiler, uml::parameter param, int allow_exception); void generate_checksum_block(drcuml_block *block, compiler_state *compiler, const opcode_desc *seqhead, const opcode_desc *seqlast); void generate_sequence_instruction(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); - void generate_compute_flags(drcuml_block *block, const opcode_desc *desc, int updatecr, UINT32 xermask, int invertcarry); - void generate_shift_flags(drcuml_block *block, const opcode_desc *desc, UINT32 op); + void generate_compute_flags(drcuml_block *block, const opcode_desc *desc, int updatecr, uint32_t xermask, int invertcarry); + void generate_shift_flags(drcuml_block *block, const opcode_desc *desc, uint32_t op); void generate_fp_flags(drcuml_block *block, const opcode_desc *desc, int updatefprf); - void generate_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int source, UINT8 link); - void generate_branch_bo(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 bo, UINT32 bi, int source, int link); + void generate_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int source, uint8_t link); + void generate_branch_bo(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t bo, uint32_t bi, int source, int link); int generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_instruction_13(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_instruction_1f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_instruction_3b(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_instruction_3f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); - void log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 op); - const char *log_desc_flags_to_string(UINT32 flags); - void log_register_list(drcuml_state *drcuml, const char *string, const UINT32 *reglist, const UINT32 *regnostarlist); + void log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint32_t op); + const char *log_desc_flags_to_string(uint32_t flags); + void log_register_list(drcuml_state *drcuml, const char *string, const uint32_t *reglist, const uint32_t *regnostarlist); void log_opcode_desc(drcuml_state *drcuml, const opcode_desc *desclist, int indent); }; @@ -680,79 +680,79 @@ protected: //class ppc403_device : public ppc_device //{ //public: -// ppc403_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +// ppc403_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // //protected: -// virtual UINT32 execute_input_lines() const { return 8; } +// virtual uint32_t execute_input_lines() const { return 8; } //}; // // //class ppc405_device : public ppc_device //{ //public: -// ppc405_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +// ppc405_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // //protected: -// virtual UINT32 execute_input_lines() const { return 8; } +// virtual uint32_t execute_input_lines() const { return 8; } //}; class ppc603_device : public ppc_device { public: - ppc603_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ppc603_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ppc603e_device : public ppc_device { public: - ppc603e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ppc603e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ppc603r_device : public ppc_device { public: - ppc603r_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ppc603r_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ppc602_device : public ppc_device { public: - ppc602_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ppc602_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mpc8240_device : public ppc_device { public: - mpc8240_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mpc8240_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ppc601_device : public ppc_device { public: - ppc601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ppc601_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ppc604_device : public ppc_device { public: - ppc604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ppc604_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ppc4xx_device : public ppc_device { public: - ppc4xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, powerpc_flavor flavor, UINT32 cap, UINT32 tb_divisor); + ppc4xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, powerpc_flavor flavor, uint32_t cap, uint32_t tb_divisor); void ppc4xx_spu_set_tx_handler(write8_delegate callback); - void ppc4xx_spu_receive_byte(UINT8 byteval); + void ppc4xx_spu_receive_byte(uint8_t byteval); void ppc4xx_set_dma_read_handler(int channel, read32_delegate callback, int rate); void ppc4xx_set_dma_write_handler(int channel, write32_delegate callback, int rate); @@ -763,7 +763,7 @@ public: DECLARE_WRITE8_MEMBER( ppc4xx_spu_w ); protected: - virtual UINT32 execute_input_lines() const override { return 5; } + virtual uint32_t execute_input_lines() const override { return 5; } virtual void execute_set_input(int inputnum, int state) override; }; @@ -771,21 +771,21 @@ protected: class ppc403ga_device : public ppc4xx_device { public: - ppc403ga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ppc403ga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ppc403gcx_device : public ppc4xx_device { public: - ppc403gcx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ppc403gcx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ppc405gp_device : public ppc4xx_device { public: - ppc405gp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ppc405gp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/powerpc/ppc_dasm.cpp b/src/devices/cpu/powerpc/ppc_dasm.cpp index 25a79140193..28d8b5ce480 100644 --- a/src/devices/cpu/powerpc/ppc_dasm.cpp +++ b/src/devices/cpu/powerpc/ppc_dasm.cpp @@ -107,8 +107,8 @@ enum struct IDESCR { char mnem[32]; // mnemonic - UINT32 match; // bit pattern of instruction after it has been masked - UINT32 mask; // mask of variable fields (AND with ~mask to compare w/ + uint32_t match; // bit pattern of instruction after it has been masked + uint32_t mask; // mask of variable fields (AND with ~mask to compare w/ // bit pattern to determine a match) int format; // operand format int flags; // flags @@ -529,13 +529,13 @@ static void DCR(char *dest, int dcr_field) * unsigned 16-bit integer. */ -static void DecodeSigned16(char *outbuf, UINT32 op, int do_unsigned) +static void DecodeSigned16(char *outbuf, uint32_t op, int do_unsigned) { - INT16 s; + int16_t s; s = G_SIMM(op); if (do_unsigned) // sign extend to unsigned 32-bits - sprintf(outbuf, "0x%04X", (UINT32) s); + sprintf(outbuf, "0x%04X", (uint32_t) s); else // print as signed 16 bits { if (s < 0) @@ -554,9 +554,9 @@ static void DecodeSigned16(char *outbuf, UINT32 op, int do_unsigned) * Generate a mask from bit MB through ME (PPC-style backwards bit numbering.) */ -static UINT32 Mask(int mb, int me) +static uint32_t Mask(int mb, int me) { - UINT32 i, mask; + uint32_t i, mask; mb &= 31; me &= 31; @@ -582,7 +582,7 @@ static UINT32 Mask(int mb, int me) */ #if 0 -static int Check(UINT32 op, int flags) +static int Check(uint32_t op, int flags) { int nb, rt, ra; @@ -644,9 +644,9 @@ static int Check(UINT32 op, int flags) * otherwise 0 to indicate disassembly should carry on as normal. */ -static int Simplified(UINT32 op, UINT32 vpc, char *signed16, char *mnem, char *oprs) +static int Simplified(uint32_t op, uint32_t vpc, char *signed16, char *mnem, char *oprs) { - UINT32 value, disp; + uint32_t value, disp; value = G_SIMM(op); // value is fully sign-extended SIMM field if (value & 0x8000) @@ -835,10 +835,10 @@ static int Simplified(UINT32 op, UINT32 vpc, char *signed16, char *mnem, char *o return 1; } -offs_t ppc_dasm_one(char *buffer, UINT32 pc, UINT32 op) +offs_t ppc_dasm_one(char *buffer, uint32_t pc, uint32_t op) { char signed16[12]; - UINT32 disp; + uint32_t disp; int i,j; char mnem[200]; char oprs[200]; @@ -1022,7 +1022,7 @@ offs_t ppc_dasm_one(char *buffer, UINT32 pc, UINT32 op) if (G_RA(op)) sprintf(oprs, "r%d,%s(r%d)", G_RT(op), signed16, G_RA(op)); else - sprintf(oprs, "r%d,0x%08X", G_RT(op), (UINT32) ((INT16) G_D(op))); + sprintf(oprs, "r%d,0x%08X", G_RT(op), (uint32_t) ((int16_t) G_D(op))); break; case F_RT_D_RA: @@ -1033,7 +1033,7 @@ offs_t ppc_dasm_one(char *buffer, UINT32 pc, UINT32 op) if (G_RA(op)) sprintf(oprs, "f%d,%s(r%d)", G_RT(op), signed16, G_RA(op)); else - sprintf(oprs, "f%d,0x%08X", G_RT(op), (UINT32) ((INT16) G_D(op))); + sprintf(oprs, "f%d,0x%08X", G_RT(op), (uint32_t) ((int16_t) G_D(op))); break; case F_FRT_D_RA: @@ -1171,7 +1171,7 @@ offs_t ppc_dasm_one(char *buffer, UINT32 pc, UINT32 op) CPU_DISASSEMBLE( powerpc ) { - UINT32 op = *(UINT32 *)oprom; + uint32_t op = *(uint32_t *)oprom; op = big_endianize_int32(op); return ppc_dasm_one(buffer, pc, op); } diff --git a/src/devices/cpu/powerpc/ppccom.cpp b/src/devices/cpu/powerpc/ppccom.cpp index 42ba5708713..206535148ca 100644 --- a/src/devices/cpu/powerpc/ppccom.cpp +++ b/src/devices/cpu/powerpc/ppccom.cpp @@ -38,7 +38,7 @@ ***************************************************************************/ /* lookup table for FP modes */ -static const UINT8 fpmode_source[4] = +static const uint8_t fpmode_source[4] = { uml::ROUND_ROUND, uml::ROUND_TRUNC, @@ -47,7 +47,7 @@ static const UINT8 fpmode_source[4] = }; /* flag lookup table for SZ */ -static const UINT8 sz_cr_table_source[32] = +static const uint8_t sz_cr_table_source[32] = { /* ..... */ 0x4, /* ....C */ 0x4, @@ -84,7 +84,7 @@ static const UINT8 sz_cr_table_source[32] = }; /* flag lookup table for CMP */ -static const UINT8 cmp_cr_table_source[32] = +static const uint8_t cmp_cr_table_source[32] = { /* ..... */ 0x4, /* ....C */ 0x4, @@ -121,7 +121,7 @@ static const UINT8 cmp_cr_table_source[32] = }; /* flag lookup table for CMPL */ -static const UINT8 cmpl_cr_table_source[32] = +static const uint8_t cmpl_cr_table_source[32] = { /* ..... */ 0x4, /* ....C */ 0x8, @@ -158,7 +158,7 @@ static const UINT8 cmpl_cr_table_source[32] = }; /* flag lookup table for FCMP */ -static const UINT8 fcmp_cr_table_source[32] = +static const uint8_t fcmp_cr_table_source[32] = { /* ..... */ 0x4, /* ....C */ 0x8, @@ -207,7 +207,7 @@ const device_type PPC403GCX = &device_creator; const device_type PPC405GP = &device_creator; -ppc_device::ppc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int address_bits, int data_bits, powerpc_flavor flavor, UINT32 cap, UINT32 tb_divisor, address_map_constructor internal_map) +ppc_device::ppc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int address_bits, int data_bits, powerpc_flavor flavor, uint32_t cap, uint32_t tb_divisor, address_map_constructor internal_map) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , device_vtlb_interface(mconfig, *this, AS_PROGRAM) , m_program_config("program", ENDIANNESS_BIG, data_bits, address_bits, 0, internal_map) @@ -231,47 +231,47 @@ ppc_device::ppc_device(const machine_config &mconfig, device_type type, const ch set_vtlb_fixed_entries(PPC603_FIXED_TLB_ENTRIES); } -//ppc403_device::ppc403_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +//ppc403_device::ppc403_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) // : ppc_device(mconfig, PPC403, "PPC403", tag, owner, clock, "ppc403", 32?, 64?) //{ //} // -//ppc405_device::ppc405_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +//ppc405_device::ppc405_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) // : ppc_device(mconfig, PPC405, "PPC405", tag, owner, clock, "ppc405", 32?, 64?) //{ //} -ppc603_device::ppc603_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ppc603_device::ppc603_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc_device(mconfig, PPC603, "PowerPC 603", tag, owner, clock, "ppc603", 32, 64, PPC_MODEL_603, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, nullptr) { } -ppc603e_device::ppc603e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ppc603e_device::ppc603e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc_device(mconfig, PPC603E, "PowerPC 603e", tag, owner, clock, "ppc603e", 32, 64, PPC_MODEL_603E, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, nullptr) { } -ppc603r_device::ppc603r_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ppc603r_device::ppc603r_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc_device(mconfig, PPC603R, "PowerPC 603R", tag, owner, clock, "ppc603r", 32, 64, PPC_MODEL_603R, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, nullptr) { } -ppc602_device::ppc602_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ppc602_device::ppc602_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc_device(mconfig, PPC602, "PowerPC 602", tag, owner, clock, "ppc602", 32, 64, PPC_MODEL_602, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4, nullptr) { } -mpc8240_device::mpc8240_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mpc8240_device::mpc8240_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc_device(mconfig, MPC8240, "PowerPC MPC8240", tag, owner, clock, "mpc8240", 32, 64, PPC_MODEL_MPC8240, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_603_MMU, 4/* unknown */, nullptr) { } -ppc601_device::ppc601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ppc601_device::ppc601_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc_device(mconfig, PPC601, "PowerPC 601", tag, owner, clock, "ppc601", 32, 64, PPC_MODEL_601, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_MFIOC | PPCCAP_601BAT, 0/* no TB */, nullptr) { } -ppc604_device::ppc604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ppc604_device::ppc604_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc_device(mconfig, PPC604, "PowerPC 604", tag, owner, clock, "ppc604", 32, 64, PPC_MODEL_604, PPCCAP_OEA | PPCCAP_VEA | PPCCAP_FPU | PPCCAP_MISALIGNED | PPCCAP_604_MMU, 4, nullptr) { } @@ -280,22 +280,22 @@ static ADDRESS_MAP_START( internal_ppc4xx, AS_PROGRAM, 32, ppc4xx_device ) AM_RANGE(0x40000000, 0x4000000f) AM_READWRITE8(ppc4xx_spu_r, ppc4xx_spu_w, 0xffffffff) ADDRESS_MAP_END -ppc4xx_device::ppc4xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, powerpc_flavor flavor, UINT32 cap, UINT32 tb_divisor) +ppc4xx_device::ppc4xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, powerpc_flavor flavor, uint32_t cap, uint32_t tb_divisor) : ppc_device(mconfig, type, name, tag, owner, clock, shortname, 31, 32, flavor, cap, tb_divisor, ADDRESS_MAP_NAME(internal_ppc4xx)) { } -ppc403ga_device::ppc403ga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ppc403ga_device::ppc403ga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc4xx_device(mconfig, PPC403GA, "PowerPC 403GA", tag, owner, clock, "ppc403ga", PPC_MODEL_403GA, PPCCAP_4XX, 1) { } -ppc403gcx_device::ppc403gcx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ppc403gcx_device::ppc403gcx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc4xx_device(mconfig, PPC403GCX, "PowerPC 403GCX", tag, owner, clock, "ppc403gcx", PPC_MODEL_403GCX, PPCCAP_4XX, 1) { } -ppc405gp_device::ppc405gp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ppc405gp_device::ppc405gp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ppc4xx_device(mconfig, PPC405GP, "PowerPC 405GP", tag, owner, clock, "ppc405gp", PPC_MODEL_405GP, PPCCAP_4XX | PPCCAP_VEA, 1) { } @@ -311,7 +311,7 @@ ppc405gp_device::ppc405gp_device(const machine_config &mconfig, const char *tag, of access and the protection bits -------------------------------------------------*/ -static inline int page_access_allowed(int transtype, UINT8 key, UINT8 protbits) +static inline int page_access_allowed(int transtype, uint8_t key, uint8_t protbits) { if (key == 0) return (transtype == TRANSLATE_WRITE) ? (protbits != 3) : TRUE; @@ -324,7 +324,7 @@ static inline int page_access_allowed(int transtype, UINT8 key, UINT8 protbits) get_cr - return the current CR value -------------------------------------------------*/ -inline UINT32 ppc_device::get_cr() +inline uint32_t ppc_device::get_cr() { return ((m_core->cr[0] & 0x0f) << 28) | ((m_core->cr[1] & 0x0f) << 24) | @@ -341,7 +341,7 @@ inline UINT32 ppc_device::get_cr() set_cr - set the current CR value -------------------------------------------------*/ -inline void ppc_device::set_cr(UINT32 value) +inline void ppc_device::set_cr(uint32_t value) { m_core->cr[0] = value >> 28; m_core->cr[1] = value >> 24; @@ -358,7 +358,7 @@ inline void ppc_device::set_cr(UINT32 value) get_xer - return the current XER value -------------------------------------------------*/ -inline UINT32 ppc_device::get_xer() +inline uint32_t ppc_device::get_xer() { return m_core->spr[SPR_XER] | (m_core->xerso << 31); } @@ -368,7 +368,7 @@ inline UINT32 ppc_device::get_xer() set_xer - set the current XER value -------------------------------------------------*/ -inline void ppc_device::set_xer(UINT32 value) +inline void ppc_device::set_xer(uint32_t value) { m_core->spr[SPR_XER] = value & ~XER_SO; m_core->xerso = value >> 31; @@ -380,7 +380,7 @@ inline void ppc_device::set_xer(UINT32 value) value -------------------------------------------------*/ -inline UINT64 ppc_device::get_timebase() +inline uint64_t ppc_device::get_timebase() { if (!m_tb_divisor) { @@ -395,7 +395,7 @@ inline UINT64 ppc_device::get_timebase() set_timebase - set the timebase -------------------------------------------------*/ -inline void ppc_device::set_timebase(UINT64 newtb) +inline void ppc_device::set_timebase(uint64_t newtb) { m_tb_zero_cycles = total_cycles() - newtb * m_tb_divisor; } @@ -406,10 +406,10 @@ inline void ppc_device::set_timebase(UINT64 newtb) decrementer value -------------------------------------------------*/ -inline UINT32 ppc_device::get_decrementer() +inline uint32_t ppc_device::get_decrementer() { - INT64 cycles_until_zero = m_dec_zero_cycles - total_cycles(); - cycles_until_zero = std::max(cycles_until_zero, 0); + int64_t cycles_until_zero = m_dec_zero_cycles - total_cycles(); + cycles_until_zero = std::max(cycles_until_zero, 0); if (!m_tb_divisor) { @@ -424,10 +424,10 @@ inline UINT32 ppc_device::get_decrementer() set_decrementer - set the decremeter -------------------------------------------------*/ -inline void ppc_device::set_decrementer(UINT32 newdec) +inline void ppc_device::set_decrementer(uint32_t newdec) { - UINT64 cycles_until_done = ((UINT64)newdec + 1) * m_tb_divisor; - UINT32 curdec = get_decrementer(); + uint64_t cycles_until_done = ((uint64_t)newdec + 1) * m_tb_divisor; + uint32_t curdec = get_decrementer(); if (!m_tb_divisor) { @@ -436,16 +436,16 @@ inline void ppc_device::set_decrementer(UINT32 newdec) if (PRINTF_DECREMENTER) { - UINT64 total = total_cycles(); + uint64_t total = total_cycles(); osd_printf_debug("set_decrementer: olddec=%08X newdec=%08X divisor=%d totalcyc=%08X%08X timer=%08X%08X\n", curdec, newdec, m_tb_divisor, - (UINT32)(total >> 32), (UINT32)total, (UINT32)(cycles_until_done >> 32), (UINT32)cycles_until_done); + (uint32_t)(total >> 32), (uint32_t)total, (uint32_t)(cycles_until_done >> 32), (uint32_t)cycles_until_done); } m_dec_zero_cycles = total_cycles() + cycles_until_done; m_decrementer_int_timer->adjust(cycles_to_attotime(cycles_until_done)); - if ((INT32)curdec >= 0 && (INT32)newdec < 0) + if ((int32_t)curdec >= 0 && (int32_t)newdec < 0) m_core->irq_pending |= 0x02; } @@ -457,7 +457,7 @@ inline void ppc_device::set_decrementer(UINT32 newdec) static inline int is_nan_double(double x) { - UINT64 xi = *(UINT64*)&x; + uint64_t xi = *(uint64_t*)&x; return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) && ((xi & DOUBLE_FRAC) != DOUBLE_ZERO) ); } @@ -471,7 +471,7 @@ static inline int is_nan_double(double x) static inline int is_qnan_double(double x) { - UINT64 xi = *(UINT64*)&x; + uint64_t xi = *(uint64_t*)&x; return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) && ((xi & U64(0x0007fffffffffff)) == U64(0x000000000000000)) && ((xi & U64(0x000800000000000)) == U64(0x000800000000000)) ); @@ -486,7 +486,7 @@ static inline int is_qnan_double(double x) static inline int is_snan_double(double x) { - UINT64 xi = *(UINT64*)&x; + uint64_t xi = *(uint64_t*)&x; return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) && ((xi & DOUBLE_FRAC) != DOUBLE_ZERO) && ((xi & U64(0x0008000000000000)) == DOUBLE_ZERO) ); @@ -501,7 +501,7 @@ static inline int is_snan_double(double x) static inline int is_infinity_double(double x) { - UINT64 xi = *(UINT64*)&x; + uint64_t xi = *(uint64_t*)&x; return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) && ((xi & DOUBLE_FRAC) == DOUBLE_ZERO) ); } @@ -514,8 +514,8 @@ static inline int is_infinity_double(double x) static inline int is_normalized_double(double x) { - UINT64 exp; - UINT64 xi = *(UINT64*)&x; + uint64_t exp; + uint64_t xi = *(uint64_t*)&x; exp = (xi & DOUBLE_EXP) >> 52; return (exp >= 1) && (exp <= 2046); @@ -529,7 +529,7 @@ static inline int is_normalized_double(double x) static inline int is_denormalized_double(double x) { - UINT64 xi = *(UINT64*)&x; + uint64_t xi = *(uint64_t*)&x; return( ((xi & DOUBLE_EXP) == 0) && ((xi & DOUBLE_FRAC) != DOUBLE_ZERO) ); } @@ -541,7 +541,7 @@ static inline int is_denormalized_double(double x) static inline int sign_double(double x) { - UINT64 xi = *(UINT64*)&x; + uint64_t xi = *(uint64_t*)&x; return ((xi & DOUBLE_SIGN) != 0); } @@ -883,7 +883,7 @@ void ppc_device::device_start() m_icountptr = &m_core->icount; - UINT32 flags = 0; + uint32_t flags = 0; /* initialize the UML generator */ m_drcuml = std::make_unique(*this, m_cache, flags, 8, 32, 2); @@ -988,7 +988,7 @@ void ppc_device::state_export(const device_state_entry &entry) break; case PPC_TBL: - m_debugger_temp = (UINT32)get_timebase(); + m_debugger_temp = (uint32_t)get_timebase(); break; case PPC_DEC: @@ -1014,7 +1014,7 @@ void ppc_device::state_import(const device_state_entry &entry) break; case PPC_TBH: - set_timebase((get_timebase() & ~U64(0x00000000ffffffff)) | ((UINT64)(m_debugger_temp & 0x00ffffff) << 32)); + set_timebase((get_timebase() & ~U64(0x00000000ffffffff)) | ((uint64_t)(m_debugger_temp & 0x00ffffff) << 32)); break; case PPC_DEC: @@ -1232,10 +1232,10 @@ void ppc_device::device_reset() CPU -------------------------------------------------*/ -offs_t ppc_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t ppc_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { - extern offs_t ppc_dasm_one(char *buffer, UINT32 pc, UINT32 op); - UINT32 op = *(UINT32 *)oprom; + extern offs_t ppc_dasm_one(char *buffer, uint32_t pc, uint32_t op); + uint32_t op = *(uint32_t *)oprom; op = big_endianize_int32(op); return ppc_dasm_one(buffer, pc, op); } @@ -1266,13 +1266,13 @@ void ppc_device::ppccom_dcstore_callback() filling -------------------------------------------------*/ -UINT32 ppc_device::ppccom_translate_address_internal(int intention, offs_t &address) +uint32_t ppc_device::ppccom_translate_address_internal(int intention, offs_t &address) { int transpriv = ((intention & TRANSLATE_USER_MASK) == 0); // 1 for supervisor, 0 for user int transtype = intention & TRANSLATE_TYPE_MASK; offs_t hash, hashbase, hashmask; int batbase, batnum, hashnum; - UINT32 segreg; + uint32_t segreg; /* 4xx case: "TLB" really just caches writes and checks compare registers */ if (m_cap & PPCCAP_4XX) @@ -1309,8 +1309,8 @@ UINT32 ppc_device::ppccom_translate_address_internal(int intention, offs_t &addr { for (batnum = 0; batnum < 4; batnum++) { - UINT32 upper = m_core->spr[SPROEA_IBAT0U + 2*batnum + 0]; - UINT32 lower = m_core->spr[SPROEA_IBAT0U + 2*batnum + 1]; + uint32_t upper = m_core->spr[SPROEA_IBAT0U + 2*batnum + 0]; + uint32_t lower = m_core->spr[SPROEA_IBAT0U + 2*batnum + 1]; int privbit = ((intention & TRANSLATE_USER_MASK) == 0) ? 3 : 2; // printf("bat %d upper = %08x privbit %d\n", batnum, upper, privbit); @@ -1318,9 +1318,9 @@ UINT32 ppc_device::ppccom_translate_address_internal(int intention, offs_t &addr // is this pair valid? if (lower & 0x40) { - UINT32 mask = ((lower & 0x3f) << 17) ^ 0xfffe0000; - UINT32 addrout; - UINT32 key = (upper >> privbit) & 1; + uint32_t mask = ((lower & 0x3f) << 17) ^ 0xfffe0000; + uint32_t addrout; + uint32_t key = (upper >> privbit) & 1; /* check for a hit against this bucket */ if ((address & mask) == (upper & mask)) @@ -1345,17 +1345,17 @@ UINT32 ppc_device::ppccom_translate_address_internal(int intention, offs_t &addr for (batnum = 0; batnum < 4; batnum++) { - UINT32 upper = m_core->spr[batbase + 2*batnum + 0]; + uint32_t upper = m_core->spr[batbase + 2*batnum + 0]; /* check user/supervisor valid bit */ if ((upper >> transpriv) & 0x01) { - UINT32 mask = (~upper << 15) & 0xfffe0000; + uint32_t mask = (~upper << 15) & 0xfffe0000; /* check for a hit against this bucket */ if ((address & mask) == (upper & mask)) { - UINT32 lower = m_core->spr[batbase + 2*batnum + 1]; + uint32_t lower = m_core->spr[batbase + 2*batnum + 1]; /* verify protection; if we fail, return false and indicate a protection violation */ if (!page_access_allowed(transtype, 1, lower & 3)) @@ -1398,7 +1398,7 @@ UINT32 ppc_device::ppccom_translate_address_internal(int intention, offs_t &addr /* if we're simulating the 603 MMU, fill in the data and stop here */ if (m_cap & PPCCAP_603_MMU) { - UINT32 entry = vtlb_table()[address >> 12]; + uint32_t entry = vtlb_table()[address >> 12]; m_core->mmu603_cmp = 0x80000000 | ((segreg & 0xffffff) << 7) | (0 << 6) | ((address >> 22) & 0x3f); m_core->mmu603_hash[0] = hashbase | ((hash << 6) & hashmask); m_core->mmu603_hash[1] = hashbase | ((~hash << 6) & hashmask); @@ -1414,19 +1414,19 @@ UINT32 ppc_device::ppccom_translate_address_internal(int intention, offs_t &addr for (hashnum = 0; hashnum < 2; hashnum++) { offs_t ptegaddr = hashbase | ((hash << 6) & hashmask); - UINT32 *ptegptr = (UINT32 *)m_program->get_read_ptr(ptegaddr); + uint32_t *ptegptr = (uint32_t *)m_program->get_read_ptr(ptegaddr); /* should only have valid memory here, but make sure */ if (ptegptr != nullptr) { - UINT32 targetupper = 0x80000000 | ((segreg & 0xffffff) << 7) | (hashnum << 6) | ((address >> 22) & 0x3f); + uint32_t targetupper = 0x80000000 | ((segreg & 0xffffff) << 7) | (hashnum << 6) | ((address >> 22) & 0x3f); int ptenum; /* scan PTEs */ for (ptenum = 0; ptenum < 8; ptenum++) if (ptegptr[BYTE_XOR_BE(ptenum * 2)] == targetupper) { - UINT32 pteglower = ptegptr[BYTE_XOR_BE(ptenum * 2 + 1)]; + uint32_t pteglower = ptegptr[BYTE_XOR_BE(ptenum * 2 + 1)]; /* verify protection; if we fail, return false and indicate a protection violation */ if (!page_access_allowed(transtype, (segreg >> (29 + transpriv)) & 1, pteglower & 3)) @@ -1527,7 +1527,7 @@ void ppc_device::ppccom_execute_tlbia() void ppc_device::ppccom_execute_tlbl() { - UINT32 address = m_core->param0; + uint32_t address = m_core->param0; int isitlb = m_core->param1; vtlb_entry flags; int entrynum; @@ -1767,7 +1767,7 @@ void ppc_device::ppccom_execute_mtspr() set_timebase((get_timebase() & ~U64(0xffffffff00000000)) | m_core->param1); return; case SPR603_TBU_W: - set_timebase((get_timebase() & ~U64(0x00000000ffffffff)) | ((UINT64)m_core->param1 << 32)); + set_timebase((get_timebase() & ~U64(0x00000000ffffffff)) | ((uint64_t)m_core->param1 << 32)); return; } } @@ -1775,7 +1775,7 @@ void ppc_device::ppccom_execute_mtspr() /* handle 4XX SPRs */ if (m_cap & PPCCAP_4XX) { - UINT32 oldval = m_core->spr[m_core->param0]; + uint32_t oldval = m_core->spr[m_core->param0]; switch (m_core->param0) { /* write-through no-ops */ @@ -1826,7 +1826,7 @@ void ppc_device::ppccom_execute_mtspr() set_timebase((get_timebase() & ~U64(0x00ffffff00000000)) | m_core->param1); return; case SPR4XX_TBHI: - set_timebase((get_timebase() & ~U64(0x00000000ffffffff)) | ((UINT64)(m_core->param1 & 0x00ffffff) << 32)); + set_timebase((get_timebase() & ~U64(0x00000000ffffffff)) | ((uint64_t)(m_core->param1 & 0x00ffffff) << 32)); return; } } @@ -1905,7 +1905,7 @@ void ppc_device::ppccom_execute_mfdcr() void ppc_device::ppccom_execute_mtdcr() { - UINT8 oldval; + uint8_t oldval; /* handle various DCRs */ switch (m_core->param0) @@ -2000,7 +2000,7 @@ void ppc_device::ppccom_execute_mtdcr() void ppc_device::ppccom_update_fprf() { - UINT32 fprf; + uint32_t fprf; double f = m_core->f[m_core->param0]; if (is_qnan_double(f)) @@ -2052,13 +2052,13 @@ void ppc_device::ppccom_update_fprf() TIMER_CALLBACK_MEMBER( ppc_device::decrementer_int_callback ) { - UINT64 cycles_until_next; + uint64_t cycles_until_next; /* set the decrementer IRQ state */ m_core->irq_pending |= 0x02; /* advance by another full rev */ - m_dec_zero_cycles += (UINT64)m_tb_divisor << 32; + m_dec_zero_cycles += (uint64_t)m_tb_divisor << 32; cycles_until_next = m_dec_zero_cycles - total_cycles(); m_decrementer_int_timer->adjust(cycles_to_attotime(cycles_until_next)); } @@ -2121,10 +2121,10 @@ void ppc4xx_device::execute_set_input(int inputnum, int state) IRQ line management -------------------------------------------------*/ -void ppc_device::ppc4xx_set_irq_line(UINT32 bitmask, int state) +void ppc_device::ppc4xx_set_irq_line(uint32_t bitmask, int state) { - UINT32 oldstate = m_irqstate; - UINT32 levelmask; + uint32_t oldstate = m_irqstate; + uint32_t levelmask; /* set or clear the appropriate bit */ if (state != CLEAR_LINE) @@ -2161,7 +2161,7 @@ void ppc_device::ppc4xx_set_irq_line(UINT32 bitmask, int state) IRQ line state getter -------------------------------------------------*/ -int ppc_device::ppc4xx_get_irq_line(UINT32 bitmask) +int ppc_device::ppc4xx_get_irq_line(uint32_t bitmask) { return (m_irqstate & bitmask) ? ASSERT_LINE : CLEAR_LINE; } @@ -2215,7 +2215,7 @@ void ppc_device::ppc4xx_dma_update_irq_states() int ppc_device::ppc4xx_dma_decrement_count(int dmachan) { - UINT32 *dmaregs = &m_dcr[8 * dmachan]; + uint32_t *dmaregs = &m_dcr[8 * dmachan]; /* decrement the counter */ dmaregs[DCR4XX_DMACT0]--; @@ -2246,11 +2246,11 @@ int ppc_device::ppc4xx_dma_decrement_count(int dmachan) ppc4xx_dma_update_irq_states(); - INT64 numdata = dmaregs[DCR4XX_DMACT0]; + int64_t numdata = dmaregs[DCR4XX_DMACT0]; if (numdata == 0) numdata = 65536; - INT64 time = (numdata * 1000000) / m_buffered_dma_rate[dmachan]; + int64_t time = (numdata * 1000000) / m_buffered_dma_rate[dmachan]; m_buffered_dma_timer[dmachan]->adjust(attotime::from_usec(time), dmachan); } @@ -2276,10 +2276,10 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_buffered_dma_callback ) { int dmachan = param; - static const UINT8 dma_transfer_width[4] = { 1, 2, 4, 16 }; - UINT32 *dmaregs = &m_dcr[8 * dmachan]; - INT32 destinc; - UINT8 width; + static const uint8_t dma_transfer_width[4] = { 1, 2, 4, 16 }; + uint32_t *dmaregs = &m_dcr[8 * dmachan]; + int32_t destinc; + uint8_t width; width = dma_transfer_width[(dmaregs[DCR4XX_DMACR0] & PPC4XX_DMACR_PW_MASK) >> 26]; destinc = (dmaregs[DCR4XX_DMACR0] & PPC4XX_DMACR_DAI) ? width : 0; @@ -2294,7 +2294,7 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_buffered_dma_callback ) case 1: do { - UINT8 data = 0; + uint8_t data = 0; if (!m_ext_dma_read_cb[dmachan].isnull()) data = (m_ext_dma_read_cb[dmachan])(*m_program, 1, 0xffffffff); m_program->write_byte(dmaregs[DCR4XX_DMADA0], data); @@ -2306,7 +2306,7 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_buffered_dma_callback ) case 2: do { - UINT16 data = 0; + uint16_t data = 0; if (!m_ext_dma_read_cb[dmachan].isnull()) data = (m_ext_dma_read_cb[dmachan])(*m_program, 2, 0xffffffff); m_program->write_word(dmaregs[DCR4XX_DMADA0], data); @@ -2318,7 +2318,7 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_buffered_dma_callback ) case 4: do { - UINT32 data = 0; + uint32_t data = 0; if (!m_ext_dma_read_cb[dmachan].isnull()) data = (m_ext_dma_read_cb[dmachan])(*m_program, 4, 0xffffffff); m_program->write_dword(dmaregs[DCR4XX_DMADA0], data); @@ -2338,7 +2338,7 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_buffered_dma_callback ) case 1: do { - UINT8 data = m_program->read_byte(dmaregs[DCR4XX_DMADA0]); + uint8_t data = m_program->read_byte(dmaregs[DCR4XX_DMADA0]); if (!m_ext_dma_write_cb[dmachan].isnull()) (m_ext_dma_write_cb[dmachan])(*m_program, 1, data, 0xffffffff); dmaregs[DCR4XX_DMADA0] += destinc; @@ -2349,7 +2349,7 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_buffered_dma_callback ) case 2: do { - UINT16 data = m_program->read_word(dmaregs[DCR4XX_DMADA0]); + uint16_t data = m_program->read_word(dmaregs[DCR4XX_DMADA0]); if (!m_ext_dma_write_cb[dmachan].isnull()) (m_ext_dma_write_cb[dmachan])(*m_program, 2, data, 0xffffffff); dmaregs[DCR4XX_DMADA0] += destinc; @@ -2360,7 +2360,7 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_buffered_dma_callback ) case 4: do { - UINT32 data = m_program->read_dword(dmaregs[DCR4XX_DMADA0]); + uint32_t data = m_program->read_dword(dmaregs[DCR4XX_DMADA0]); if (!m_ext_dma_write_cb[dmachan].isnull()) (m_ext_dma_write_cb[dmachan])(*m_program, 4, data, 0xffffffff); dmaregs[DCR4XX_DMADA0] += destinc; @@ -2376,9 +2376,9 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_buffered_dma_callback ) to send to a peripheral -------------------------------------------------*/ -int ppc_device::ppc4xx_dma_fetch_transmit_byte(int dmachan, UINT8 *byte) +int ppc_device::ppc4xx_dma_fetch_transmit_byte(int dmachan, uint8_t *byte) { - UINT32 *dmaregs = &m_dcr[8 * dmachan]; + uint32_t *dmaregs = &m_dcr[8 * dmachan]; /* if the channel is not enabled, fail */ if (!(dmaregs[DCR4XX_DMACR0] & PPC4XX_DMACR_CE)) @@ -2400,9 +2400,9 @@ int ppc_device::ppc4xx_dma_fetch_transmit_byte(int dmachan, UINT8 *byte) transmitted by a peripheral -------------------------------------------------*/ -int ppc_device::ppc4xx_dma_handle_receive_byte(int dmachan, UINT8 byte) +int ppc_device::ppc4xx_dma_handle_receive_byte(int dmachan, uint8_t byte) { - UINT32 *dmaregs = &m_dcr[8 * dmachan]; + uint32_t *dmaregs = &m_dcr[8 * dmachan]; /* if the channel is not enabled, fail */ if (!(dmaregs[DCR4XX_DMACR0] & PPC4XX_DMACR_CE)) @@ -2426,10 +2426,10 @@ int ppc_device::ppc4xx_dma_handle_receive_byte(int dmachan, UINT8 byte) void ppc_device::ppc4xx_dma_exec(int dmachan) { - static const UINT8 dma_transfer_width[4] = { 1, 2, 4, 16 }; - UINT32 *dmaregs = &m_dcr[8 * dmachan]; - INT32 destinc, srcinc; - UINT8 width; + static const uint8_t dma_transfer_width[4] = { 1, 2, 4, 16 }; + uint32_t *dmaregs = &m_dcr[8 * dmachan]; + int32_t destinc, srcinc; + uint8_t width; /* skip if not enabled */ if (!(dmaregs[DCR4XX_DMACR0] & PPC4XX_DMACR_CE)) @@ -2448,11 +2448,11 @@ void ppc_device::ppc4xx_dma_exec(int dmachan) { /* buffered DMA with external peripheral */ - INT64 numdata = dmaregs[DCR4XX_DMACT0]; + int64_t numdata = dmaregs[DCR4XX_DMACT0]; if (numdata == 0) numdata = 65536; - INT64 time; + int64_t time; if (numdata > 100) { time = (numdata * 1000000) / m_buffered_dma_rate[dmachan]; @@ -2548,9 +2548,9 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_fit_callback ) /* update ourself for the next interval if we are enabled */ if (m_core->spr[SPR4XX_TCR] & PPC4XX_TCR_FIE) { - UINT32 timebase = get_timebase(); - UINT32 interval = 0x200 << (4 * ((m_core->spr[SPR4XX_TCR] & PPC4XX_TCR_FP_MASK) >> 24)); - UINT32 target = (timebase + interval) & ~(interval - 1); + uint32_t timebase = get_timebase(); + uint32_t interval = 0x200 << (4 * ((m_core->spr[SPR4XX_TCR] & PPC4XX_TCR_FP_MASK) >> 24)); + uint32_t target = (timebase + interval) & ~(interval - 1); m_fit_timer->adjust(cycles_to_attotime((target + 1 - timebase) / m_tb_divisor), TRUE); } @@ -2577,9 +2577,9 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_pit_callback ) forced to update, or we are in auto-reload mode */ if ((m_core->spr[SPR4XX_TCR] & PPC4XX_TCR_PIE) && m_pit_reload != 0 && (!param || (m_core->spr[SPR4XX_TCR] & PPC4XX_TCR_ARE))) { - UINT32 timebase = get_timebase(); - UINT32 interval = m_pit_reload; - UINT32 target = timebase + interval; + uint32_t timebase = get_timebase(); + uint32_t interval = m_pit_reload; + uint32_t target = timebase + interval; m_pit_timer->adjust(cycles_to_attotime((target + 1 - timebase) / m_tb_divisor), TRUE); } @@ -2626,9 +2626,9 @@ void ppc_device::ppc4xx_spu_update_irq_states() ppc4xx_spu_rx_data - serial port data receive -------------------------------------------------*/ -void ppc_device::ppc4xx_spu_rx_data(UINT8 data) +void ppc_device::ppc4xx_spu_rx_data(uint8_t data) { - UINT32 new_rxin; + uint32_t new_rxin; /* fail if we are going to overflow */ new_rxin = (m_spu.rxin + 1) % ARRAY_LENGTH(m_spu.rxbuffer); @@ -2648,7 +2648,7 @@ void ppc_device::ppc4xx_spu_rx_data(UINT8 data) void ppc_device::ppc4xx_spu_timer_reset() { - UINT8 enabled = (m_spu.regs[SPU4XX_RX_COMMAND] | m_spu.regs[SPU4XX_TX_COMMAND]) & 0x80; + uint8_t enabled = (m_spu.regs[SPU4XX_RX_COMMAND] | m_spu.regs[SPU4XX_TX_COMMAND]) & 0x80; /* if we're enabled, reset at the current baud rate */ if (enabled) @@ -2706,7 +2706,7 @@ TIMER_CALLBACK_MEMBER( ppc_device::ppc4xx_spu_callback ) if (m_spu.rxout != m_spu.rxin) { int operation = (m_spu.regs[SPU4XX_RX_COMMAND] >> 5) & 3; - UINT8 rxbyte; + uint8_t rxbyte; /* consume the byte and advance the out pointer */ rxbyte = m_spu.rxbuffer[m_spu.rxout]; @@ -2743,7 +2743,7 @@ updateirq: READ8_MEMBER( ppc4xx_device::ppc4xx_spu_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; switch (offset) { @@ -2769,7 +2769,7 @@ READ8_MEMBER( ppc4xx_device::ppc4xx_spu_r ) WRITE8_MEMBER( ppc4xx_device::ppc4xx_spu_w ) { - UINT8 oldstate, newstate; + uint8_t oldstate, newstate; if (PRINTF_SPU) printf("spu_w(%d) = %02X\n", offset, data); @@ -2841,7 +2841,7 @@ void ppc4xx_device::ppc4xx_spu_set_tx_handler(write8_delegate callback) specific serial byte receive -------------------------------------------------*/ -void ppc4xx_device::ppc4xx_spu_receive_byte(UINT8 byteval) +void ppc4xx_device::ppc4xx_spu_receive_byte(uint8_t byteval) { ppc4xx_spu_rx_data(byteval); } diff --git a/src/devices/cpu/powerpc/ppccom.h b/src/devices/cpu/powerpc/ppccom.h index b978aa4101b..45c75169136 100644 --- a/src/devices/cpu/powerpc/ppccom.h +++ b/src/devices/cpu/powerpc/ppccom.h @@ -429,11 +429,11 @@ enum * in with the passed value. */ -#define D_OP(op) (UINT32)((op & 0x3f) << 26) -#define D_XO(xo) (UINT32)((xo & 0x3ff) << 1) -#define D_RT(r) (UINT32)((r & 0x1f) << (31 - 10)) -#define D_RA(r) (UINT32)((r & 0x1f) << (31 - 15)) -#define D_UIMM(u) (UINT32)(u & 0xffff) +#define D_OP(op) (uint32_t)((op & 0x3f) << 26) +#define D_XO(xo) (uint32_t)((xo & 0x3ff) << 1) +#define D_RT(r) (uint32_t)((r & 0x1f) << (31 - 10)) +#define D_RA(r) (uint32_t)((r & 0x1f) << (31 - 15)) +#define D_UIMM(u) (uint32_t)(u & 0xffff) /* * Macros to Get Field Values diff --git a/src/devices/cpu/powerpc/ppcdrc.cpp b/src/devices/cpu/powerpc/ppcdrc.cpp index 47a8742a0af..837e23e4bd6 100644 --- a/src/devices/cpu/powerpc/ppcdrc.cpp +++ b/src/devices/cpu/powerpc/ppcdrc.cpp @@ -25,7 +25,7 @@ using namespace uml; -extern offs_t ppc_dasm_one(char *buffer, UINT32 pc, UINT32 op); +extern offs_t ppc_dasm_one(char *buffer, uint32_t pc, uint32_t op); @@ -176,7 +176,7 @@ void ppc_device::save_fast_fregs(drcuml_block *block) for an rlw* instruction -------------------------------------------------*/ -inline UINT32 ppc_device::compute_rlw_mask(UINT8 mb, UINT8 me) +inline uint32_t ppc_device::compute_rlw_mask(uint8_t mb, uint8_t me) { if (mb <= me) return (0xffffffff >> mb) & (0xffffffff << (31 - me)); @@ -190,9 +190,9 @@ inline UINT32 ppc_device::compute_rlw_mask(UINT8 mb, UINT8 me) for a mtcrf/mfcrf instruction -------------------------------------------------*/ -inline UINT32 ppc_device::compute_crf_mask(UINT8 crm) +inline uint32_t ppc_device::compute_crf_mask(uint8_t crm) { - UINT32 mask = 0; + uint32_t mask = 0; if (crm & 0x80) mask |= 0xf0000000; if (crm & 0x40) mask |= 0x0f000000; if (crm & 0x20) mask |= 0x00f00000; @@ -210,7 +210,7 @@ inline UINT32 ppc_device::compute_crf_mask(UINT8 crm) SPR field of an opcode -------------------------------------------------*/ -inline UINT32 ppc_device::compute_spr(UINT32 spr) +inline uint32_t ppc_device::compute_spr(uint32_t spr) { return ((spr >> 5) | (spr << 5)) & 0x3ff; } @@ -257,7 +257,7 @@ void ppc_device::execute_run() ppcdrc_set_options - configure DRC options -------------------------------------------------*/ -void ppc_device::ppcdrc_set_options(UINT32 options) +void ppc_device::ppcdrc_set_options(uint32_t options) { m_drcoptions = options; } @@ -268,7 +268,7 @@ void ppc_device::ppcdrc_set_options(UINT32 options) region -------------------------------------------------*/ -void ppc_device::ppcdrc_add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base) +void ppc_device::ppcdrc_add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base) { if (m_fastram_select < ARRAY_LENGTH(m_fastram)) { @@ -285,7 +285,7 @@ void ppc_device::ppcdrc_add_fastram(offs_t start, offs_t end, UINT8 readonly, vo ppcdrc_add_hotspot - add a new hotspot -------------------------------------------------*/ -void ppc_device::ppcdrc_add_hotspot(offs_t pc, UINT32 opcode, UINT32 cycles) +void ppc_device::ppcdrc_add_hotspot(offs_t pc, uint32_t opcode, uint32_t cycles) { if (m_hotspot_select < ARRAY_LENGTH(m_hotspot)) { @@ -378,7 +378,7 @@ void ppc_device::code_flush_cache() given mode at the specified pc -------------------------------------------------*/ -void ppc_device::code_compile_block(UINT8 mode, offs_t pc) +void ppc_device::code_compile_block(uint8_t mode, offs_t pc) { compiler_state compiler = { 0 }; const opcode_desc *seqhead, *seqlast; @@ -405,7 +405,7 @@ void ppc_device::code_compile_block(UINT8 mode, offs_t pc) for (seqhead = desclist; seqhead != nullptr; seqhead = seqlast->next()) { const opcode_desc *curdesc; - UINT32 nextpc; + uint32_t nextpc; /* add a code log entry */ if (m_drcuml->logging()) @@ -568,7 +568,7 @@ static void cfunc_unimplemented(void *param) void ppc_device::ppc_cfunc_unimplemented() { - UINT32 opcode = m_core->arg0; + uint32_t opcode = m_core->arg0; fatalerror("PC=%08X: Unimplemented op %08X\n", m_core->pc, opcode); } @@ -807,10 +807,10 @@ void ppc_device::static_generate_tlb_mismatch() exception handler -------------------------------------------------*/ -void ppc_device::static_generate_exception(UINT8 exception, int recover, const char *name) +void ppc_device::static_generate_exception(uint8_t exception, int recover, const char *name) { code_handle *&exception_handle = recover ? m_exception[exception] : m_exception_norecover[exception]; - UINT32 vector = exception << 8; + uint32_t vector = exception << 8; code_label label = 1; drcuml_block *block; @@ -838,8 +838,8 @@ void ppc_device::static_generate_exception(UINT8 exception, int recover, const c /* OEA handling of SRR exceptions */ if (m_cap & PPCCAP_OEA) { - UINT32 msrandmask = MSROEA_POW | MSR_EE | MSR_PR | MSROEA_FP | MSROEA_FE0 | MSROEA_SE | MSROEA_BE | MSROEA_FE1 | MSROEA_IR | MSROEA_DR | MSROEA_RI | MSR_LE; - UINT32 msrormask = 0; + uint32_t msrandmask = MSROEA_POW | MSR_EE | MSR_PR | MSROEA_FP | MSROEA_FE0 | MSROEA_SE | MSROEA_BE | MSROEA_FE1 | MSROEA_IR | MSROEA_DR | MSROEA_RI | MSR_LE; + uint32_t msrormask = 0; /* check registers to see the real source of our exception (EI exceptions only) */ UML_MOV(block, I3, vector); // mov i3,vector @@ -1048,7 +1048,7 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite { UML_SHR(block, I3, I0, 12); // shr i3,i0,12 UML_LOAD(block, I3, (void *)vtlb_table(), I3, SIZE_DWORD, SCALE_x4);// load i3,[vtlb],i3,dword - UML_TEST(block, I3, (UINT64)1 << translate_type); // test i3,1 << translate_type + UML_TEST(block, I3, (uint64_t)1 << translate_type); // test i3,1 << translate_type UML_JMPc(block, COND_Z, tlbmiss = label++); // jmp tlbmiss,z UML_LABEL(block, tlbreturn = label++); // tlbreturn: UML_ROLINS(block, I0, I3, 0, 0xfffff000); // rolins i0,i3,0,0xfffff000 @@ -1061,8 +1061,8 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite for (ramnum = 0; ramnum < PPC_MAX_FASTRAM; ramnum++) if (m_fastram[ramnum].base != nullptr && (!iswrite || !m_fastram[ramnum].readonly)) { - void *fastbase = (UINT8 *)m_fastram[ramnum].base - m_fastram[ramnum].start; - UINT32 skip = label++; + void *fastbase = (uint8_t *)m_fastram[ramnum].base - m_fastram[ramnum].start; + uint32_t skip = label++; if (m_fastram[ramnum].end != 0xffffffff) { @@ -1365,7 +1365,7 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite UML_CALLC(block, (c_function)cfunc_ppccom_tlb_fill, this); // callc tlbfill,ppc UML_SHR(block, I3, I0, 12); // shr i3,i0,12 UML_LOAD(block, I3, (void *)vtlb_table(), I3, SIZE_DWORD, SCALE_x4);// load i3,[vtlb],i3,dword - UML_TEST(block, I3, (UINT64)1 << translate_type); // test i3,1 << translate_type + UML_TEST(block, I3, (uint64_t)1 << translate_type); // test i3,1 << translate_type UML_JMPc(block, COND_NZ, tlbreturn); // jmp tlbreturn,nz /* 4XX case: protection exception */ @@ -1641,7 +1641,7 @@ void ppc_device::generate_checksum_block(drcuml_block *block, compiler_state *co UML_EXHc(block, COND_NE, *m_nocode, seqhead->pc); // exne nocode,seqhead->pc } #else - UINT32 sum = 0; + uint32_t sum = 0; void *base = m_direct->read_ptr(seqhead->physpc, m_codexor); UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,dword sum += seqhead->opptr.l[0]; @@ -1788,9 +1788,9 @@ void ppc_device::generate_sequence_instruction(drcuml_block *block, compiler_sta generate_compute_flags - compute CR0 and/or XER flags ------------------------------------------------------------------*/ -void ppc_device::generate_compute_flags(drcuml_block *block, const opcode_desc *desc, int updatecr, UINT32 xermask, int invertcarry) +void ppc_device::generate_compute_flags(drcuml_block *block, const opcode_desc *desc, int updatecr, uint32_t xermask, int invertcarry) { - UINT32 xerflags; + uint32_t xerflags; /* modify inputs based on required flags */ if (!DISABLE_FLAG_OPTIMIZATIONS) @@ -1859,7 +1859,7 @@ void ppc_device::generate_compute_flags(drcuml_block *block, const opcode_desc * generate_shift_flags - compute S/Z flags for shifts -------------------------------------------------------*/ -void ppc_device::generate_shift_flags(drcuml_block *block, const opcode_desc *desc, UINT32 op) +void ppc_device::generate_shift_flags(drcuml_block *block, const opcode_desc *desc, uint32_t op) { UML_CMP(block, R32(G_RA(op)), 0); // cmp ra, #0 UML_SETc(block, COND_Z, I1); // set Z, i1 @@ -1896,10 +1896,10 @@ void ppc_device::generate_fp_flags(drcuml_block *block, const opcode_desc *desc, branch -------------------------------------------------*/ -void ppc_device::generate_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int source, UINT8 link) +void ppc_device::generate_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int source, uint8_t link) { compiler_state compiler_temp = *compiler; - UINT32 *srcptr = &m_core->spr[source]; + uint32_t *srcptr = &m_core->spr[source]; /* set the link if needed */ if (link) @@ -1941,7 +1941,7 @@ void ppc_device::generate_branch(drcuml_block *block, compiler_state *compiler, branch based on the BO and BI fields -------------------------------------------------*/ -void ppc_device::generate_branch_bo(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 bo, UINT32 bi, int source, int link) +void ppc_device::generate_branch_bo(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t bo, uint32_t bi, int source, int link) { int skip = compiler->labelnum++; @@ -1967,8 +1967,8 @@ void ppc_device::generate_branch_bo(drcuml_block *block, compiler_state *compile int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 opswitch = op >> 26; + uint32_t op = desc->opptr.l[0]; + uint32_t opswitch = op >> 26; switch (opswitch) { @@ -1979,7 +1979,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return FALSE; case 0x03: /* TWI */ - UML_CMP(block, R32(G_RA(op)), (INT16)G_SIMM(op)); // cmp ra,simm + UML_CMP(block, R32(G_RA(op)), (int16_t)G_SIMM(op)); // cmp ra,simm if (G_TO(op) & 0x10) UML_EXHc(block, COND_L, *m_exception[EXCEPTION_PROGRAM], 0x20000);// exh program,0x20000,l if (G_TO(op) & 0x08) @@ -1993,12 +1993,12 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x07: /* MULLI */ - UML_MULS(block, R32(G_RD(op)), R32(G_RD(op)), R32(G_RA(op)), (INT16)G_SIMM(op)); + UML_MULS(block, R32(G_RD(op)), R32(G_RD(op)), R32(G_RA(op)), (int16_t)G_SIMM(op)); // muls rd,rd,ra,simm return TRUE; case 0x0e: /* ADDI */ - UML_ADD(block, R32(G_RD(op)), R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add rd,ra,simm + UML_ADD(block, R32(G_RD(op)), R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add rd,ra,simm return TRUE; case 0x0f: /* ADDIS */ @@ -2013,24 +2013,24 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x0b: /* CMPI */ - UML_CMP(block, R32(G_RA(op)), (INT16)G_SIMM(op)); // cmp ra,uimm + UML_CMP(block, R32(G_RA(op)), (int16_t)G_SIMM(op)); // cmp ra,uimm UML_GETFLGS(block, I0, FLAG_Z | FLAG_V | FLAG_C | FLAG_S); // getflgs i0,zvcs UML_LOAD(block, I0, m_cmp_cr_table, I0, SIZE_BYTE, SCALE_x1);// load i0,cmp_cr_table,i0,byte UML_OR(block, CR32(G_CRFD(op)), I0, XERSO32); // or [crn],i0,[xerso] return TRUE; case 0x08: /* SUBFIC */ - UML_SUB(block, R32(G_RD(op)), (INT16)G_SIMM(op), R32(G_RA(op))); // sub rd,simm,ra + UML_SUB(block, R32(G_RD(op)), (int16_t)G_SIMM(op), R32(G_RA(op))); // sub rd,simm,ra generate_compute_flags(block, desc, FALSE, XER_CA, TRUE); // return TRUE; case 0x0c: /* ADDIC */ - UML_ADD(block, R32(G_RD(op)), R32(G_RA(op)), (INT16)G_SIMM(op)); // add rd,ra,simm + UML_ADD(block, R32(G_RD(op)), R32(G_RA(op)), (int16_t)G_SIMM(op)); // add rd,ra,simm generate_compute_flags(block, desc, FALSE, XER_CA, FALSE); // return TRUE; case 0x0d: /* ADDIC. */ - UML_ADD(block, R32(G_RD(op)), R32(G_RA(op)), (INT16)G_SIMM(op)); // add rd,ra,simm + UML_ADD(block, R32(G_RD(op)), R32(G_RA(op)), (int16_t)G_SIMM(op)); // add rd,ra,simm generate_compute_flags(block, desc, TRUE, XER_CA, FALSE); // return TRUE; @@ -2101,7 +2101,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return generate_instruction_1f(block, compiler, desc); // case 0x22: /* LBZ */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_read8[m_core->mode]); // callh read8 UML_AND(block, R32(G_RD(op)), I0, 0xff); // and rd,i0,0xff @@ -2109,7 +2109,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x28: /* LHZ */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_read16[m_core->mode]); // callh read16 UML_AND(block, R32(G_RD(op)), I0, 0xffff); // and rd,i0,0xffff @@ -2117,7 +2117,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x2a: /* LHA */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_read16[m_core->mode]); // callh read16 UML_SEXT(block, R32(G_RD(op)), I0, SIZE_WORD); // sext rd,i0,word @@ -2125,7 +2125,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x20: /* LWZ */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_read32[m_core->mode]); // callh read32 UML_MOV(block, R32(G_RD(op)), I0); // mov rd,i0 @@ -2133,7 +2133,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x23: /* LBZU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) UML_CALLH(block, *m_read8[m_core->mode]); // callh read8 @@ -2143,7 +2143,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x29: /* LHZU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) UML_CALLH(block, *m_read16[m_core->mode]); // callh read16 @@ -2153,7 +2153,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x2b: /* LHAU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) UML_CALLH(block, *m_read16[m_core->mode]); // callh read16 @@ -2163,7 +2163,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x21: /* LWZU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) UML_CALLH(block, *m_read32[m_core->mode]); // callh read32 @@ -2173,7 +2173,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x26: /* STB */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_AND(block, I1, R32(G_RS(op)), 0xff); // and i1,rs,0xff UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_write8[m_core->mode]); // callh write8 @@ -2181,7 +2181,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x2c: /* STH */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_AND(block, I1, R32(G_RS(op)), 0xffff); // and i1,rs,0xffff UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_write16[m_core->mode]); // callh write16 @@ -2189,7 +2189,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x24: /* STW */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MOV(block, I1, R32(G_RS(op))); // mov i1,rs UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_write32[m_core->mode]); // callh write32 @@ -2197,7 +2197,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x27: /* STBU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_AND(block, I1, R32(G_RS(op)), 0xff); // and i1,rs,0xff UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) @@ -2207,7 +2207,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x2d: /* STHU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_AND(block, I1, R32(G_RS(op)), 0xffff); // and i1,rs,0xffff UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) @@ -2217,7 +2217,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x25: /* STWU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MOV(block, I1, R32(G_RS(op))); // mov i1,rs UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) @@ -2231,7 +2231,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c UML_MOV(block, mem(&m_core->tempaddr), R32Z(G_RA(op))); // mov [tempaddr],ra for (int regnum = G_RD(op); regnum < 32; regnum++) { - UML_ADD(block, I0, mem(&m_core->tempaddr), (INT16)G_SIMM(op) + 4 * (regnum - G_RD(op))); + UML_ADD(block, I0, mem(&m_core->tempaddr), (int16_t)G_SIMM(op) + 4 * (regnum - G_RD(op))); // add i0,[tempaddr],simm + 4*(regnum-rd) UML_CALLH(block, *m_read32align[m_core->mode]); // callh read32align UML_MOV(block, R32(regnum), I0); // mov regnum,i0 @@ -2244,7 +2244,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c UML_MOV(block, mem(&m_core->tempaddr), R32Z(G_RA(op))); // mov [tempaddr],ra for (int regnum = G_RS(op); regnum < 32; regnum++) { - UML_ADD(block, I0, mem(&m_core->tempaddr), (INT16)G_SIMM(op) + 4 * (regnum - G_RS(op))); + UML_ADD(block, I0, mem(&m_core->tempaddr), (int16_t)G_SIMM(op) + 4 * (regnum - G_RS(op))); // add i0,[tempaddr],simm + 4*(regnum-rs) UML_MOV(block, I1, R32(regnum)); // mov i1,regnum UML_CALLH(block, *m_write32align[m_core->mode]); // callh write32align @@ -2253,7 +2253,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x30: /* LFS */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_read32[m_core->mode]); // callh read32 UML_FSCOPYI(block, F0, I0); // fscopyi f0,i0 @@ -2262,7 +2262,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x32: /* LFD */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_read64[m_core->mode]); // callh read64 UML_FDCOPYI(block, F64(G_RD(op)), I0); // fdcopyi fd,i0 @@ -2270,7 +2270,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x31: /* LFSU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) UML_CALLH(block, *m_read32[m_core->mode]); // callh read32 @@ -2281,7 +2281,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x33: /* LFDU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) UML_CALLH(block, *m_read64[m_core->mode]); // callh read64 @@ -2291,7 +2291,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x34: /* STFS */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_FSFRFLT(block, F0, F64(G_RS(op)), SIZE_QWORD); // fsfrflt f0,fs,qword UML_ICOPYFS(block, I1, F0); // icopyfs i1,f0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) @@ -2300,7 +2300,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x36: /* STFD */ - UML_ADD(block, I0, R32Z(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32Z(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_ICOPYFD(block, I1, F64(G_RS(op))); // icopyfd i1,fs UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMM(op)); // mapvar dsisr,DSISR_IMM(op) UML_CALLH(block, *m_write64[m_core->mode]); // callh write64 @@ -2308,7 +2308,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x35: /* STFSU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_FSFRFLT(block, F0, F64(G_RS(op)), SIZE_QWORD); // fsfrflt f0,fs,qword UML_ICOPYFS(block, I1, F0); // icopyfs i1,f0 UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 @@ -2319,7 +2319,7 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 0x37: /* STFDU */ - UML_ADD(block, I0, R32(G_RA(op)), (INT16)G_SIMM(op)); // add i0,ra,simm + UML_ADD(block, I0, R32(G_RA(op)), (int16_t)G_SIMM(op)); // add i0,ra,simm UML_ICOPYFD(block, I1, F64(G_RS(op))); // icopyfd i1,fs UML_MOV(block, mem(&m_core->updateaddr), I0); // mov [updateaddr],i0 UML_MAPVAR(block, MAPVAR_DSISR, DSISR_IMMU(op)); // mapvar dsisr,DSISR_IMMU(op) @@ -2346,8 +2346,8 @@ int ppc_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c int ppc_device::generate_instruction_13(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 opswitch = (op >> 1) & 0x3ff; + uint32_t op = desc->opptr.l[0]; + uint32_t opswitch = (op >> 1) & 0x3ff; switch (opswitch) { @@ -2483,8 +2483,8 @@ int ppc_device::generate_instruction_13(drcuml_block *block, compiler_state *com int ppc_device::generate_instruction_1f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 opswitch = (op >> 1) & 0x3ff; + uint32_t op = desc->opptr.l[0]; + uint32_t opswitch = (op >> 1) & 0x3ff; int item; switch (opswitch) @@ -2564,7 +2564,7 @@ int ppc_device::generate_instruction_1f(drcuml_block *block, compiler_state *com case 0x0ea: /* ADDMEx */ case 0x2ea: /* ADDMEOx */ UML_CARRY(block, SPR32(SPR_XER), 29); // carry [xer],XER_CA - UML_ADDC(block, R32(G_RD(op)), R32(G_RA(op)), (UINT32)-1); // addc rd,ra,-1 + UML_ADDC(block, R32(G_RD(op)), R32(G_RA(op)), (uint32_t)-1); // addc rd,ra,-1 generate_compute_flags(block, desc, op & M_RC, XER_CA | ((op & M_OE) ? XER_OV : 0), FALSE); // return TRUE; @@ -2605,7 +2605,7 @@ int ppc_device::generate_instruction_1f(drcuml_block *block, compiler_state *com case 0x2e8: /* SUBFMEOx */ UML_XOR(block, I0, SPR32(SPR_XER), XER_CA); // xor i0,[xer],XER_CA UML_CARRY(block, I0, 29); // carry i0,XER_CA - UML_SUBB(block, R32(G_RD(op)), (UINT32)-1, R32(G_RA(op))); // subc rd,-1,ra + UML_SUBB(block, R32(G_RD(op)), (uint32_t)-1, R32(G_RA(op))); // subc rd,-1,ra generate_compute_flags(block, desc, op & M_RC, XER_CA | ((op & M_OE) ? XER_OV : 0), TRUE); // return TRUE; @@ -3283,7 +3283,7 @@ int ppc_device::generate_instruction_1f(drcuml_block *block, compiler_state *com case 0x153: /* MFSPR */ { - UINT32 spr = compute_spr(G_SPR(op)); + uint32_t spr = compute_spr(G_SPR(op)); if (spr == SPR_LR || spr == SPR_CTR || (spr >= SPROEA_SPRG0 && spr <= SPROEA_SPRG3)) UML_MOV(block, R32(G_RD(op)), SPR32(spr)); // mov rd,spr else if (spr == SPR_XER) @@ -3314,7 +3314,7 @@ int ppc_device::generate_instruction_1f(drcuml_block *block, compiler_state *com case 0x173: /* MFTB */ { - UINT32 tbr = compute_spr(G_SPR(op)); + uint32_t tbr = compute_spr(G_SPR(op)); if (tbr != SPRVEA_TBL_R && tbr != SPRVEA_TBU_R) return FALSE; generate_update_cycles(block, compiler, desc->pc, TRUE); // @@ -3350,7 +3350,7 @@ int ppc_device::generate_instruction_1f(drcuml_block *block, compiler_state *com case 0x1d3: /* MTSPR */ { - UINT32 spr = compute_spr(G_SPR(op)); + uint32_t spr = compute_spr(G_SPR(op)); if (spr == SPR_LR || spr == SPR_CTR || (spr >= SPROEA_SPRG0 && spr <= SPROEA_SPRG3)) UML_MOV(block, SPR32(spr), R32(G_RS(op))); // mov spr,rs else if (spr == SPR_XER) @@ -3406,7 +3406,7 @@ int ppc_device::generate_instruction_1f(drcuml_block *block, compiler_state *com case 0x143: /* MFDCR */ { - UINT32 spr = compute_spr(G_SPR(op)); + uint32_t spr = compute_spr(G_SPR(op)); assert(m_cap & PPCCAP_4XX); generate_update_cycles(block, compiler, desc->pc, TRUE); // UML_MOV(block, mem(&m_core->param0), spr); // mov [param0],spr @@ -3417,7 +3417,7 @@ int ppc_device::generate_instruction_1f(drcuml_block *block, compiler_state *com case 0x1c3: /* MTDCR */ { - UINT32 spr = compute_spr(G_SPR(op)); + uint32_t spr = compute_spr(G_SPR(op)); assert(m_cap & PPCCAP_4XX); generate_update_cycles(block, compiler, desc->pc, TRUE); // UML_MOV(block, mem(&m_core->param0), spr); // mov [param0],spr @@ -3464,8 +3464,8 @@ int ppc_device::generate_instruction_1f(drcuml_block *block, compiler_state *com int ppc_device::generate_instruction_3b(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 opswitch = (op >> 1) & 0x1f; + uint32_t op = desc->opptr.l[0]; + uint32_t opswitch = (op >> 1) & 0x1f; switch (opswitch) { @@ -3572,8 +3572,8 @@ int ppc_device::generate_instruction_3b(drcuml_block *block, compiler_state *com int ppc_device::generate_instruction_3f(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT32 opswitch = (op >> 1) & 0x3ff; + uint32_t op = desc->opptr.l[0]; + uint32_t opswitch = (op >> 1) & 0x3ff; if (opswitch & 0x10) { @@ -3745,7 +3745,7 @@ int ppc_device::generate_instruction_3f(drcuml_block *block, compiler_state *com including disassembly of a PowerPC instruction -------------------------------------------------*/ -void ppc_device::log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 op) +void ppc_device::log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint32_t op) { char buffer[100]; if (m_drcuml->logging()) @@ -3762,7 +3762,7 @@ void ppc_device::log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 o flags -------------------------------------------------*/ -const char *ppc_device::log_desc_flags_to_string(UINT32 flags) +const char *ppc_device::log_desc_flags_to_string(uint32_t flags) { static char tempbuf[30]; char *dest = tempbuf; @@ -3816,7 +3816,7 @@ const char *ppc_device::log_desc_flags_to_string(UINT32 flags) log_register_list - log a list of GPR registers -------------------------------------------------*/ -void ppc_device::log_register_list(drcuml_state *drcuml, const char *string, const UINT32 *reglist, const UINT32 *regnostarlist) +void ppc_device::log_register_list(drcuml_state *drcuml, const char *string, const uint32_t *reglist, const uint32_t *regnostarlist) { static const char *const crtext[4] = { "lt", "gt", "eq", "so" }; int count = 0; diff --git a/src/devices/cpu/powerpc/ppcfe.cpp b/src/devices/cpu/powerpc/ppcfe.cpp index 2ebf682ed4c..956fad03374 100644 --- a/src/devices/cpu/powerpc/ppcfe.cpp +++ b/src/devices/cpu/powerpc/ppcfe.cpp @@ -56,7 +56,7 @@ // ppc_frontend - constructor //------------------------------------------------- -ppc_frontend::ppc_frontend(ppc_device *ppc, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) +ppc_frontend::ppc_frontend(ppc_device *ppc, uint32_t window_start, uint32_t window_end, uint32_t max_sequence) : drc_frontend(*ppc, window_start, window_end, max_sequence), m_ppc(ppc) { @@ -70,7 +70,7 @@ ppc_frontend::ppc_frontend(ppc_device *ppc, UINT32 window_start, UINT32 window_e bool ppc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) { - UINT32 op, opswitch; + uint32_t op, opswitch; int regnum; // compute the physical PC @@ -166,7 +166,7 @@ bool ppc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; else desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; - desc.targetpc = (INT16)(G_BD(op) << 2) + ((op & M_AA) ? 0 : desc.pc); + desc.targetpc = (int16_t)(G_BD(op) << 2) + ((op & M_AA) ? 0 : desc.pc); if (desc.targetpc == desc.pc && desc.cycles == 0) desc.cycles = 1; return true; @@ -187,7 +187,7 @@ bool ppc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) if (op & M_LK) LR_MODIFIED(desc); desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; - desc.targetpc = ((INT32)(G_LI(op) << 8) >> 6) + ((op & M_AA) ? 0 : desc.pc); + desc.targetpc = ((int32_t)(G_LI(op) << 8) >> 6) + ((op & M_AA) ? 0 : desc.pc); // branch folding if (desc.targetpc != desc.pc) desc.cycles = 0; @@ -362,9 +362,9 @@ bool ppc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) 0x13 group -------------------------------------------------*/ -bool ppc_frontend::describe_13(UINT32 op, opcode_desc &desc, const opcode_desc *prev) +bool ppc_frontend::describe_13(uint32_t op, opcode_desc &desc, const opcode_desc *prev) { - UINT32 opswitch = (op >> 1) & 0x3ff; + uint32_t opswitch = (op >> 1) & 0x3ff; switch (opswitch) { @@ -463,9 +463,9 @@ bool ppc_frontend::describe_13(UINT32 op, opcode_desc &desc, const opcode_desc * 0x1f group -------------------------------------------------*/ -bool ppc_frontend::describe_1f(UINT32 op, opcode_desc &desc, const opcode_desc *prev) +bool ppc_frontend::describe_1f(uint32_t op, opcode_desc &desc, const opcode_desc *prev) { - UINT32 opswitch = (op >> 1) & 0x3ff; + uint32_t opswitch = (op >> 1) & 0x3ff; int spr, regnum; switch (opswitch) @@ -1162,9 +1162,9 @@ bool ppc_frontend::describe_1f(UINT32 op, opcode_desc &desc, const opcode_desc * 0x3b group -------------------------------------------------*/ -bool ppc_frontend::describe_3b(UINT32 op, opcode_desc &desc, const opcode_desc *prev) +bool ppc_frontend::describe_3b(uint32_t op, opcode_desc &desc, const opcode_desc *prev) { - UINT32 opswitch = (op >> 1) & 0x1f; + uint32_t opswitch = (op >> 1) & 0x1f; if (!(m_ppc->m_cap & PPCCAP_FPU)) return false; @@ -1238,9 +1238,9 @@ bool ppc_frontend::describe_3b(UINT32 op, opcode_desc &desc, const opcode_desc * 0x3f group -------------------------------------------------*/ -bool ppc_frontend::describe_3f(UINT32 op, opcode_desc &desc, const opcode_desc *prev) +bool ppc_frontend::describe_3f(uint32_t op, opcode_desc &desc, const opcode_desc *prev) { - UINT32 opswitch = (op >> 1) & 0x3ff; + uint32_t opswitch = (op >> 1) & 0x3ff; if (!(m_ppc->m_cap & PPCCAP_FPU)) return false; diff --git a/src/devices/cpu/powerpc/ppcfe.h b/src/devices/cpu/powerpc/ppcfe.h index 51a4bb86906..697cd9b2438 100644 --- a/src/devices/cpu/powerpc/ppcfe.h +++ b/src/devices/cpu/powerpc/ppcfe.h @@ -49,7 +49,7 @@ class ppc_frontend : public drc_frontend { public: // construction/destruction - ppc_frontend(ppc_device *ppc, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); + ppc_frontend(ppc_device *ppc, uint32_t window_start, uint32_t window_end, uint32_t max_sequence); protected: // required overrides @@ -57,17 +57,17 @@ protected: private: // inlines - UINT32 compute_spr(UINT32 spr) const { return ((spr >> 5) | (spr << 5)) & 0x3ff; } + uint32_t compute_spr(uint32_t spr) const { return ((spr >> 5) | (spr << 5)) & 0x3ff; } bool is_403_class() const { return (m_ppc->m_flavor == ppc_device::PPC_MODEL_403GA || m_ppc->m_flavor == ppc_device::PPC_MODEL_403GB || m_ppc->m_flavor == ppc_device::PPC_MODEL_403GC || m_ppc->m_flavor == ppc_device::PPC_MODEL_403GCX || m_ppc->m_flavor == ppc_device::PPC_MODEL_405GP); } bool is_601_class() const { return (m_ppc->m_flavor == ppc_device::PPC_MODEL_601); } bool is_602_class() const { return (m_ppc->m_flavor == ppc_device::PPC_MODEL_602); } bool is_603_class() const { return (m_ppc->m_flavor == ppc_device::PPC_MODEL_603 || m_ppc->m_flavor == ppc_device::PPC_MODEL_603E || m_ppc->m_flavor == ppc_device::PPC_MODEL_603EV || m_ppc->m_flavor == ppc_device::PPC_MODEL_603R); } // internal helpers - bool describe_13(UINT32 op, opcode_desc &desc, const opcode_desc *prev); - bool describe_1f(UINT32 op, opcode_desc &desc, const opcode_desc *prev); - bool describe_3b(UINT32 op, opcode_desc &desc, const opcode_desc *prev); - bool describe_3f(UINT32 op, opcode_desc &desc, const opcode_desc *prev); + bool describe_13(uint32_t op, opcode_desc &desc, const opcode_desc *prev); + bool describe_1f(uint32_t op, opcode_desc &desc, const opcode_desc *prev); + bool describe_3b(uint32_t op, opcode_desc &desc, const opcode_desc *prev); + bool describe_3f(uint32_t op, opcode_desc &desc, const opcode_desc *prev); // internal state ppc_device *m_ppc; diff --git a/src/devices/cpu/pps4/pps4.cpp b/src/devices/cpu/pps4/pps4.cpp index 7581097f2fa..a8f0a08e5cc 100644 --- a/src/devices/cpu/pps4/pps4.cpp +++ b/src/devices/cpu/pps4/pps4.cpp @@ -70,7 +70,7 @@ const device_type PPS4 = &device_creator; -pps4_device::pps4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pps4_device::pps4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, PPS4, "PPS4", tag, owner, clock, "pps4", __FILE__ ) , m_program_config("program", ENDIANNESS_LITTLE, 8, 12) , m_data_config("data", ENDIANNESS_LITTLE, 8, 12) // 4bit RAM @@ -82,9 +82,9 @@ pps4_device::pps4_device(const machine_config &mconfig, const char *tag, device_ * @brief pps4_device::M Return the memory at address B * @return ROM/RAM(B) */ -UINT8 pps4_device::M() +uint8_t pps4_device::M() { - UINT8 ret = m_data->read_byte(m_B & ~m_SAG); + uint8_t ret = m_data->read_byte(m_B & ~m_SAG); m_SAG = 0; return ret; } @@ -94,13 +94,13 @@ UINT8 pps4_device::M() * @brief pps4_device::W Write to the memory address at B * @return ROM/RAM(B) */ -void pps4_device::W(UINT8 data) +void pps4_device::W(uint8_t data) { m_data->write_byte(m_B & ~m_SAG, data); m_SAG = 0; } -offs_t pps4_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t pps4_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( pps4 ); return CPU_DISASSEMBLE_NAME(pps4)(this, buffer, pc, oprom, opram, options); @@ -113,9 +113,9 @@ offs_t pps4_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr * program counter is incremented. The icount is decremented. * @return m_I the next opcode */ -inline UINT8 pps4_device::ROP() +inline uint8_t pps4_device::ROP() { - const UINT8 op = m_direct->read_byte(m_P & 0xFFF); + const uint8_t op = m_direct->read_byte(m_P & 0xFFF); m_Ip = m_I1; // save previous opcode m_P = (m_P + 1) & 0xFFF; m_icount -= 1; @@ -129,9 +129,9 @@ inline UINT8 pps4_device::ROP() * icount is decremented. * @return m_I2 the next argument */ -inline UINT8 pps4_device::ARG() +inline uint8_t pps4_device::ARG() { - const UINT8 arg = m_direct->read_byte(m_P & 0xFFF); + const uint8_t arg = m_direct->read_byte(m_P & 0xFFF); m_P = (m_P + 1) & 0xFFF; m_icount -= 1; return arg; @@ -265,7 +265,7 @@ void pps4_device::iADCSK() */ void pps4_device::iADI() { - const UINT8 imm = ~m_I1 & 15; + const uint8_t imm = ~m_I1 & 15; m_A = m_A + imm; m_Skip = (m_A >> 4) & 1; m_A = m_A & 15; @@ -490,7 +490,7 @@ void pps4_device::iRF2() */ void pps4_device::iLD() { - const UINT16 i3c = ~m_I1 & 7; + const uint16_t i3c = ~m_I1 & 7; m_A = M(); m_B = m_B ^ (i3c << 4); } @@ -513,8 +513,8 @@ void pps4_device::iLD() */ void pps4_device::iEX() { - const UINT16 i3c = ~m_I1 & 7; - const UINT8 mem = M(); + const uint16_t i3c = ~m_I1 & 7; + const uint8_t mem = M(); W(m_A); m_A = mem; m_B = m_B ^ (i3c << 4); @@ -542,9 +542,9 @@ void pps4_device::iEX() */ void pps4_device::iEXD() { - const UINT8 i3c = ~m_I1 & 7; - const UINT8 mem = M(); - UINT8 bl = m_B & 15; + const uint8_t i3c = ~m_I1 & 7; + const uint8_t mem = M(); + uint8_t bl = m_B & 15; W(m_A); m_A = mem; m_B = m_B ^ (i3c << 4); @@ -696,7 +696,7 @@ void pps4_device::iLBUA() void pps4_device::iXABL() { // swap A and BL - UINT8 bl = m_B & 15; + uint8_t bl = m_B & 15; m_B = (m_B & ~15) | m_A; m_A = bl; } @@ -717,7 +717,7 @@ void pps4_device::iXABL() void pps4_device::iXBMX() { // swap X and BM - const UINT8 bm = (m_B >> 4) & 15; + const uint8_t bm = (m_B >> 4) & 15; m_B = (m_B & ~(15 << 4)) | (m_X << 4); m_X = bm; } @@ -786,7 +786,7 @@ void pps4_device::iXS() */ void pps4_device::iCYS() { - const UINT16 sa = (m_SA >> 4) | (m_A << 8); + const uint16_t sa = (m_SA >> 4) | (m_A << 8); m_A = m_SA & 15; m_SA = sa; } @@ -893,7 +893,7 @@ void pps4_device::iLBL() */ void pps4_device::iINCB() { - UINT8 bl = m_B & 15; + uint8_t bl = m_B & 15; bl = (bl + 1) & 15; if (0 == bl) { LOG(("%s: skip BL=%x\n", __FUNCTION__, bl)); @@ -919,7 +919,7 @@ void pps4_device::iINCB() */ void pps4_device::iDECB() { - UINT8 bl = m_B & 15; + uint8_t bl = m_B & 15; bl = (bl - 1) & 15; if (15 == bl) { LOG(("%s: skip BL=%x\n", __FUNCTION__, bl)); @@ -945,7 +945,7 @@ void pps4_device::iDECB() */ void pps4_device::iT() { - const UINT16 p = (m_P & ~63) | (m_I1 & 63); + const uint16_t p = (m_P & ~63) | (m_I1 & 63); LOG(("%s: P=%03x I=%02x -> P=%03x\n", __FUNCTION__, m_P, m_I1, p)); m_P = p; } @@ -1084,8 +1084,8 @@ void pps4_device::iSKZ() */ void pps4_device::iSKBI() { - const UINT8 i4 = m_I1 & 15; - const UINT8 bl = m_B & 15; + const uint8_t i4 = m_I1 & 15; + const uint8_t bl = m_B & 15; m_Skip = bl == i4 ? 1 : 0; } @@ -1195,7 +1195,7 @@ void pps4_device::iRTNSK() */ void pps4_device::iIOL() { - UINT8 ac = ((m_B & 15) << 4) | (~m_A & 15); + uint8_t ac = ((m_B & 15) << 4) | (~m_A & 15); m_I2 = ARG(); m_io->write_byte(m_I2, ac); LOG(("%s: port:%02x <- %x\n", __FUNCTION__, m_I2, ac)); diff --git a/src/devices/cpu/pps4/pps4.h b/src/devices/cpu/pps4/pps4.h index 4fee82b9328..224060efee1 100644 --- a/src/devices/cpu/pps4/pps4.h +++ b/src/devices/cpu/pps4/pps4.h @@ -38,7 +38,7 @@ class pps4_device : public cpu_device { public: // construction/destruction - pps4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pps4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -46,10 +46,10 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 3; } - virtual UINT32 execute_input_lines() const override { return 0; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 3; } + virtual uint32_t execute_input_lines() const override { return 0; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -62,9 +62,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -77,32 +77,32 @@ private: address_space *m_io; int m_icount; - UINT8 m_A; //!< Accumulator A(4:1) - UINT8 m_X; //!< X register X(4:1) - UINT16 m_P; //!< program counter P(12:1) - UINT16 m_SA; //!< Shift register SA(12:1) - UINT16 m_SB; //!< Shift register SB(12:1) - UINT8 m_Skip; //!< Skip next instruction - UINT16 m_SAG; //!< Special address generation mask - UINT16 m_B; //!< B register B(12:1) (BL, BM and BH) - UINT8 m_C; //!< Carry flip-flop - UINT8 m_FF1; //!< Flip-flop 1 - UINT8 m_FF2; //!< Flip-flop 2 - UINT8 m_I1; //!< Most recent instruction I(8:1) - UINT8 m_I2; //!< Most recent parameter I2(8:1) - UINT8 m_Ip; //!< Previous instruction I(8:1) + uint8_t m_A; //!< Accumulator A(4:1) + uint8_t m_X; //!< X register X(4:1) + uint16_t m_P; //!< program counter P(12:1) + uint16_t m_SA; //!< Shift register SA(12:1) + uint16_t m_SB; //!< Shift register SB(12:1) + uint8_t m_Skip; //!< Skip next instruction + uint16_t m_SAG; //!< Special address generation mask + uint16_t m_B; //!< B register B(12:1) (BL, BM and BH) + uint8_t m_C; //!< Carry flip-flop + uint8_t m_FF1; //!< Flip-flop 1 + uint8_t m_FF2; //!< Flip-flop 2 + uint8_t m_I1; //!< Most recent instruction I(8:1) + uint8_t m_I2; //!< Most recent parameter I2(8:1) + uint8_t m_Ip; //!< Previous instruction I(8:1) //! return memory at address B(12:1) - inline UINT8 M(); + inline uint8_t M(); //! write to memory at address B(12:1) - inline void W(UINT8 data); + inline void W(uint8_t data); //! return the next opcode (also in m_I) - inline UINT8 ROP(); + inline uint8_t ROP(); //! return the next argument (also in m_I2) - inline UINT8 ARG(); + inline uint8_t ARG(); void iAD(); //!< Add void iADC(); //!< Add with carry-in diff --git a/src/devices/cpu/pps4/pps4dasm.cpp b/src/devices/cpu/pps4/pps4dasm.cpp index cc7f3f488ae..410f7986a60 100644 --- a/src/devices/cpu/pps4/pps4dasm.cpp +++ b/src/devices/cpu/pps4/pps4dasm.cpp @@ -93,7 +93,7 @@ static const char *token_str[t_COUNT] = { "sag" /* special address generation */ }; -static const UINT16 table[] = { +static const uint16_t table[] = { /* 00 */ t_LBL | t_I8c, /* 01 */ t_TML | t_I4 | t_I8, /* 02 */ t_TML | t_I4 | t_I8, @@ -369,10 +369,10 @@ static const UINT16 table[] = { CPU_DISASSEMBLE( pps4 ) { - UINT32 flags = 0; + uint32_t flags = 0; unsigned PC = pc; - UINT8 op = OP(pc++); - UINT32 tok = table[op]; + uint8_t op = OP(pc++); + uint32_t tok = table[op]; char *dst = nullptr; if (0 == (tok & t_MASK)) { @@ -383,53 +383,53 @@ CPU_DISASSEMBLE( pps4 ) if (tok & t_I3c) { // 3 bit immediate, complemented - UINT8 i = ~op & 7; + uint8_t i = ~op & 7; if (0 != i) // only print if non-zero dst += sprintf(dst, "%x", i); } if (tok & t_I4) { // 4 bit immediate - UINT8 i = op & 15; + uint8_t i = op & 15; dst += sprintf(dst, "%x", i); } if (tok & t_I4c) { // 4 bit immediate, complemented - UINT8 i = ~op & 15; + uint8_t i = ~op & 15; dst += sprintf(dst, "%x", i); } if (tok & t_I4p) { // 4 bit immediate offset into page 3 - UINT8 i = op & 15; + uint8_t i = op & 15; dst += sprintf(dst, "[%x]", 0x0c0 | i); } if (tok & t_I6p) { // 6 bit immediate offset into current page - UINT8 i = op & 63; + uint8_t i = op & 63; dst += sprintf(dst, "%x", (PC & ~63) | i); } if (tok & t_I6i) { // 6 bit immediate offset into page 3 - UINT16 i6p3 = (3 << 6) | (op & 63); + uint16_t i6p3 = (3 << 6) | (op & 63); // 8 bit absolute offset at 0x0100 - UINT16 addr = (1 << 8) | 0; // ROM[ip3] can't be reached!? + uint16_t addr = (1 << 8) | 0; // ROM[ip3] can't be reached!? (void)addr; // avoid unused variable warning dst += sprintf(dst, "[%x]", i6p3); } if (tok & t_I8) { // 8 bit immediate I/O port address - UINT8 arg = ARG(pc++); + uint8_t arg = ARG(pc++); dst += sprintf(dst, "%02x", arg); } if (tok & t_I8c) { // 8 bit immediate offset into page - UINT16 arg = ~ARG(pc++) & 255; + uint16_t arg = ~ARG(pc++) & 255; dst += sprintf(dst, "%02x", arg); } diff --git a/src/devices/cpu/psx/dismips.cpp b/src/devices/cpu/psx/dismips.cpp index fa00556071b..bfbc3428c94 100644 --- a/src/devices/cpu/psx/dismips.cpp +++ b/src/devices/cpu/psx/dismips.cpp @@ -11,29 +11,29 @@ #include "psx.h" extern CPU_DISASSEMBLE( r3000le ); -extern unsigned dasmmips3(char *,unsigned, UINT32); +extern unsigned dasmmips3(char *,unsigned, uint32_t); static struct { - UINT8 id[ 8 ]; - UINT32 text; /* SCE only */ - UINT32 data; /* SCE only */ - UINT32 pc0; - UINT32 gp0; /* SCE only */ - UINT32 t_addr; - UINT32 t_size; - UINT32 d_addr; /* SCE only */ - UINT32 d_size; /* SCE only */ - UINT32 b_addr; /* SCE only */ - UINT32 b_size; /* SCE only */ - UINT32 s_addr; - UINT32 s_size; - UINT32 SavedSP; - UINT32 SavedFP; - UINT32 SavedGP; - UINT32 SavedRA; - UINT32 SavedS0; - UINT8 dummy[ 0x800 - 76 ]; + uint8_t id[ 8 ]; + uint32_t text; /* SCE only */ + uint32_t data; /* SCE only */ + uint32_t pc0; + uint32_t gp0; /* SCE only */ + uint32_t t_addr; + uint32_t t_size; + uint32_t d_addr; /* SCE only */ + uint32_t d_size; /* SCE only */ + uint32_t b_addr; /* SCE only */ + uint32_t b_size; /* SCE only */ + uint32_t s_addr; + uint32_t s_size; + uint32_t SavedSP; + uint32_t SavedFP; + uint32_t SavedGP; + uint32_t SavedRA; + uint32_t SavedS0; + uint8_t dummy[ 0x800 - 76 ]; } m_psxexe_header; #define FORMAT_BIN ( 0 ) @@ -43,9 +43,9 @@ static struct #define CPU_R3000 ( 1 ) #define CPU_R4000 ( 2 ) -static UINT8 *filebuf; -static UINT32 offset; -static UINT8 order[] = { 0, 1, 2, 3 }; +static uint8_t *filebuf; +static uint32_t offset; +static uint8_t order[] = { 0, 1, 2, 3 }; static const char *const Options[]= { @@ -70,19 +70,19 @@ static void usage (void) int main( int argc, char *argv[] ) { FILE *f; - UINT8 i; - UINT8 j; - UINT8 n; - UINT8 p; - UINT32 begin; - UINT32 end; - UINT32 filelen; - UINT32 len; - UINT32 pc; + uint8_t i; + uint8_t j; + uint8_t n; + uint8_t p; + uint32_t begin; + uint32_t end; + uint32_t filelen; + uint32_t len; + uint32_t pc; char buffer[ 80 ]; char *filename; - UINT32 format; - UINT32 cpu; + uint32_t format; + uint32_t cpu; filename = nullptr; begin = 0; @@ -255,7 +255,7 @@ int main( int argc, char *argv[] ) fseek (f,begin,SEEK_SET); len=(filelen>end)? (end-begin+1):(filelen-begin); - filebuf=(UINT8 *)malloc(len+16); + filebuf=(uint8_t *)malloc(len+16); if (!filebuf) { printf ("Memory allocation error\n"); @@ -275,10 +275,10 @@ int main( int argc, char *argv[] ) pc = 0; while( pc < len ) { - UINT8 op0 = filebuf[ pc + order[ 0 ] ]; - UINT8 op1 = filebuf[ pc + order[ 1 ] ]; - UINT8 op2 = filebuf[ pc + order[ 2 ] ]; - UINT8 op3 = filebuf[ pc + order[ 3 ] ]; + uint8_t op0 = filebuf[ pc + order[ 0 ] ]; + uint8_t op1 = filebuf[ pc + order[ 1 ] ]; + uint8_t op2 = filebuf[ pc + order[ 2 ] ]; + uint8_t op3 = filebuf[ pc + order[ 3 ] ]; filebuf[ pc + 0 ] = op0; filebuf[ pc + 1 ] = op1; filebuf[ pc + 2 ] = op2; @@ -299,15 +299,15 @@ int main( int argc, char *argv[] ) { cpu_device *device = nullptr; int options = 0; - UINT8 *opram = filebuf + pc; - UINT8 *oprom = opram; + uint8_t *opram = filebuf + pc; + uint8_t *oprom = opram; i = CPU_DISASSEMBLE_CALL( r3000le ); } break; case CPU_R4000: { - UINT8 *opram = filebuf + pc; - UINT32 op = ( opram[ 3 ] << 24 ) | ( opram[ 2 ] << 16 ) | ( opram[ 1 ] << 8 ) | ( opram[ 0 ] << 0 ); + uint8_t *opram = filebuf + pc; + uint32_t op = ( opram[ 3 ] << 24 ) | ( opram[ 2 ] << 16 ) | ( opram[ 1 ] << 8 ) | ( opram[ 0 ] << 0 ); i = dasmmips3( buffer, pc + offset, op ); } break; diff --git a/src/devices/cpu/psx/dma.cpp b/src/devices/cpu/psx/dma.cpp index f2f048c39ff..6a382689f40 100644 --- a/src/devices/cpu/psx/dma.cpp +++ b/src/devices/cpu/psx/dma.cpp @@ -27,7 +27,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, c const device_type PSX_DMA = &device_creator; -psxdma_device::psxdma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psxdma_device::psxdma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSX_DMA, "Sony PSX DMA", tag, owner, clock, "psxdma", __FILE__), m_ram( ), m_ramsize(0), m_dpcp(0), m_dicr(0), m_irq_handler(*this) { @@ -77,7 +77,7 @@ void psxdma_device::device_start() save_item( NAME(m_dicr) ); } -void psxdma_device::dma_start_timer( int index, UINT32 n_ticks ) +void psxdma_device::dma_start_timer( int index, uint32_t n_ticks ) { psx_dma_channel *dma = &m_channel[ index ]; @@ -135,11 +135,11 @@ void psxdma_device::dma_finished( int index ) if( dma->n_channelcontrol == 0x01000401 && index == 2 ) { - UINT32 n_size; - UINT32 n_total; - UINT32 n_address = ( dma->n_base & 0xffffff ); - UINT32 n_adrmask = m_ramsize - 1; - UINT32 n_nextaddress; + uint32_t n_size; + uint32_t n_total; + uint32_t n_address = ( dma->n_base & 0xffffff ); + uint32_t n_adrmask = m_ramsize - 1; + uint32_t n_nextaddress; if( n_address != 0xffffff ) { @@ -233,10 +233,10 @@ WRITE32_MEMBER( psxdma_device::write ) dma->n_channelcontrol = data; if( ( dma->n_channelcontrol & ( 1L << 0x18 ) ) != 0 && ( m_dpcp & ( 1 << ( 3 + ( index * 4 ) ) ) ) != 0 ) { - INT32 n_size; - UINT32 n_address; - UINT32 n_nextaddress; - UINT32 n_adrmask; + int32_t n_size; + uint32_t n_address; + uint32_t n_nextaddress; + uint32_t n_adrmask; n_adrmask = m_ramsize - 1; @@ -244,7 +244,7 @@ WRITE32_MEMBER( psxdma_device::write ) n_size = dma->n_blockcontrol; if( ( dma->n_channelcontrol & 0x200 ) != 0 ) { - UINT32 n_ba; + uint32_t n_ba; n_ba = dma->n_blockcontrol >> 16; if( n_ba == 0 ) { diff --git a/src/devices/cpu/psx/dma.h b/src/devices/cpu/psx/dma.h index e241dfac9ac..6a39a29ca5e 100644 --- a/src/devices/cpu/psx/dma.h +++ b/src/devices/cpu/psx/dma.h @@ -19,25 +19,25 @@ extern const device_type PSX_DMA; #define MCFG_PSX_DMA_IRQ_HANDLER(_devcb) \ devcb = &psxdma_device::set_irq_handler(*device, DEVCB_##_devcb); -typedef delegate psx_dma_read_delegate; -typedef delegate psx_dma_write_delegate; +typedef delegate psx_dma_read_delegate; +typedef delegate psx_dma_write_delegate; struct psx_dma_channel { - UINT32 n_base; - UINT32 n_blockcontrol; - UINT32 n_channelcontrol; + uint32_t n_base; + uint32_t n_blockcontrol; + uint32_t n_channelcontrol; emu_timer *timer; psx_dma_read_delegate fn_read; psx_dma_write_delegate fn_write; - UINT32 n_ticks; - UINT32 b_running; + uint32_t n_ticks; + uint32_t b_running; }; class psxdma_device : public device_t { public: - psxdma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psxdma_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); } @@ -48,7 +48,7 @@ public: DECLARE_WRITE32_MEMBER( write ); DECLARE_READ32_MEMBER( read ); - UINT32 *m_ram; + uint32_t *m_ram; size_t m_ramsize; protected: @@ -58,15 +58,15 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - void dma_start_timer( int n_channel, UINT32 n_ticks ); + void dma_start_timer( int n_channel, uint32_t n_ticks ); void dma_stop_timer( int n_channel ); void dma_timer_adjust( int n_channel ); void dma_interrupt_update(); void dma_finished( int n_channel ); psx_dma_channel m_channel[7]; - UINT32 m_dpcp; - UINT32 m_dicr; + uint32_t m_dpcp; + uint32_t m_dicr; devcb_write_line m_irq_handler; }; diff --git a/src/devices/cpu/psx/gte.cpp b/src/devices/cpu/psx/gte.cpp index fb3352737db..cec3214cb47 100644 --- a/src/devices/cpu/psx/gte.cpp +++ b/src/devices/cpu/psx/gte.cpp @@ -11,7 +11,7 @@ #include "gte.h" #if 0 -void ATTR_PRINTF(2,3) GTELOG( UINT32 pc, const char *a, ...) +void ATTR_PRINTF(2,3) GTELOG( uint32_t pc, const char *a, ...) { va_list va; char s_text[ 1024 ]; @@ -21,7 +21,7 @@ void ATTR_PRINTF(2,3) GTELOG( UINT32 pc, const char *a, ...) logerror( "%08x: GTE: %s\n", pc, s_text ); } #else -static inline void ATTR_PRINTF(2,3) GTELOG( UINT32 pc, const char *a, ...) {} +static inline void ATTR_PRINTF(2,3) GTELOG( uint32_t pc, const char *a, ...) {} #endif @@ -145,9 +145,9 @@ static inline void ATTR_PRINTF(2,3) GTELOG( UINT32 pc, const char *a, ...) {} #define CV2( n ) ( n < 3 ? m_cp2cr[ ( n << 3 ) + 6 ].sd : 0 ) #define CV3( n ) ( n < 3 ? m_cp2cr[ ( n << 3 ) + 7 ].sd : 0 ) -static UINT32 gte_leadingzerocount( UINT32 lzcs ) +static uint32_t gte_leadingzerocount( uint32_t lzcs ) { - UINT32 lzcr = 0; + uint32_t lzcr = 0; if( ( lzcs & 0x80000000 ) == 0 ) { @@ -163,7 +163,7 @@ static UINT32 gte_leadingzerocount( UINT32 lzcs ) return lzcr; } -INT32 gte::LIM( INT32 value, INT32 max, INT32 min, UINT32 flag ) +int32_t gte::LIM( int32_t value, int32_t max, int32_t min, uint32_t flag ) { if( value > max ) { @@ -178,7 +178,7 @@ INT32 gte::LIM( INT32 value, INT32 max, INT32 min, UINT32 flag ) return value; } -UINT32 gte::getcp2dr( UINT32 pc, int reg ) +uint32_t gte::getcp2dr( uint32_t pc, int reg ) { switch( reg ) { @@ -189,7 +189,7 @@ UINT32 gte::getcp2dr( UINT32 pc, int reg ) case 9: case 10: case 11: - m_cp2dr[ reg ].d = (INT32)m_cp2dr[ reg ].sw.l; + m_cp2dr[ reg ].d = (int32_t)m_cp2dr[ reg ].sw.l; break; case 7: @@ -197,7 +197,7 @@ UINT32 gte::getcp2dr( UINT32 pc, int reg ) case 17: case 18: case 19: - m_cp2dr[ reg ].d = (UINT32)m_cp2dr[ reg ].w.l; + m_cp2dr[ reg ].d = (uint32_t)m_cp2dr[ reg ].w.l; break; case 15: @@ -214,7 +214,7 @@ UINT32 gte::getcp2dr( UINT32 pc, int reg ) return m_cp2dr[ reg ].d; } -void gte::setcp2dr( UINT32 pc, int reg, UINT32 value ) +void gte::setcp2dr( uint32_t pc, int reg, uint32_t value ) { GTELOG( pc, "set CP2DR%u=%08x", reg, value ); @@ -243,14 +243,14 @@ void gte::setcp2dr( UINT32 pc, int reg, UINT32 value ) m_cp2dr[ reg ].d = value; } -UINT32 gte::getcp2cr( UINT32 pc, int reg ) +uint32_t gte::getcp2cr( uint32_t pc, int reg ) { GTELOG( pc, "get CP2CR%u=%08x", reg, m_cp2cr[ reg ].d ); return m_cp2cr[ reg ].d; } -void gte::setcp2cr( UINT32 pc, int reg, UINT32 value ) +void gte::setcp2cr( uint32_t pc, int reg, uint32_t value ) { GTELOG( pc, "set CP2CR%u=%08x", reg, value ); @@ -263,7 +263,7 @@ void gte::setcp2cr( UINT32 pc, int reg, UINT32 value ) case 27: case 29: case 30: - value = (INT32)(INT16) value; + value = (int32_t)(int16_t) value; break; case 31: @@ -278,7 +278,7 @@ void gte::setcp2cr( UINT32 pc, int reg, UINT32 value ) m_cp2cr[ reg ].d = value; } -static inline INT64 gte_shift( INT64 a, int sf ) +static inline int64_t gte_shift( int64_t a, int sf ) { if( sf > 0 ) { @@ -292,7 +292,7 @@ static inline INT64 gte_shift( INT64 a, int sf ) return a; } -INT32 gte::BOUNDS( int44 value, int max_flag, int min_flag ) +int32_t gte::BOUNDS( int44 value, int max_flag, int min_flag ) { if( value.positive_overflow() ) { @@ -307,11 +307,11 @@ INT32 gte::BOUNDS( int44 value, int max_flag, int min_flag ) return gte_shift( value.value(), m_sf ); } -static inline UINT32 gte_divide( UINT16 numerator, UINT16 denominator ) +static inline uint32_t gte_divide( uint16_t numerator, uint16_t denominator ) { if( numerator < ( denominator * 2 ) ) { - static UINT8 table[] = + static uint8_t table[] = { 0xff, 0xfd, 0xfb, 0xf9, 0xf7, 0xf5, 0xf3, 0xf1, 0xef, 0xee, 0xec, 0xea, 0xe8, 0xe6, 0xe4, 0xe3, 0xe1, 0xdf, 0xdd, 0xdc, 0xda, 0xd8, 0xd6, 0xd5, 0xd3, 0xd1, 0xd0, 0xce, 0xcd, 0xcb, 0xc9, 0xc8, @@ -337,9 +337,9 @@ static inline UINT32 gte_divide( UINT16 numerator, UINT16 denominator ) int r1 = ( denominator << shift ) & 0x7fff; int r2 = table[ ( ( r1 + 0x40 ) >> 7 ) ] + 0x101; int r3 = ( ( 0x80 - ( r2 * ( r1 + 0x8000 ) ) ) >> 8 ) & 0x1ffff; - UINT32 reciprocal = ( ( r2 * r3 ) + 0x80 ) >> 8; + uint32_t reciprocal = ( ( r2 * r3 ) + 0x80 ) >> 8; - return (UINT32)( ( ( (UINT64) reciprocal * ( numerator << shift ) ) + 0x8000 ) >> 16 ); + return (uint32_t)( ( ( (uint64_t) reciprocal * ( numerator << shift ) ) + 0x8000 ) >> 16 ); } return 0xffffffff; @@ -347,17 +347,17 @@ static inline UINT32 gte_divide( UINT16 numerator, UINT16 denominator ) /* Setting bits 12 & 19-22 in FLAG does not set bit 31 */ -INT32 gte::A1( int44 a ) { m_mac1 = a.value(); return BOUNDS( a, ( 1 << 31 ) | ( 1 << 30 ), ( 1 << 31 ) | ( 1 << 27 ) ); } -INT32 gte::A2( int44 a ) { m_mac2 = a.value(); return BOUNDS( a, ( 1 << 31 ) | ( 1 << 29 ), ( 1 << 31 ) | ( 1 << 26 ) ); } -INT32 gte::A3( int44 a ) { m_mac3 = a.value(); return BOUNDS( a, ( 1 << 31 ) | ( 1 << 28 ), ( 1 << 31 ) | ( 1 << 25 ) ); } -INT32 gte::Lm_B1( INT32 a, int lm ) { return LIM( a, 0x7fff, -0x8000 * !lm, ( 1 << 31 ) | ( 1 << 24 ) ); } -INT32 gte::Lm_B2( INT32 a, int lm ) { return LIM( a, 0x7fff, -0x8000 * !lm, ( 1 << 31 ) | ( 1 << 23 ) ); } -INT32 gte::Lm_B3( INT32 a, int lm ) { return LIM( a, 0x7fff, -0x8000 * !lm, ( 1 << 22 ) ); } +int32_t gte::A1( int44 a ) { m_mac1 = a.value(); return BOUNDS( a, ( 1 << 31 ) | ( 1 << 30 ), ( 1 << 31 ) | ( 1 << 27 ) ); } +int32_t gte::A2( int44 a ) { m_mac2 = a.value(); return BOUNDS( a, ( 1 << 31 ) | ( 1 << 29 ), ( 1 << 31 ) | ( 1 << 26 ) ); } +int32_t gte::A3( int44 a ) { m_mac3 = a.value(); return BOUNDS( a, ( 1 << 31 ) | ( 1 << 28 ), ( 1 << 31 ) | ( 1 << 25 ) ); } +int32_t gte::Lm_B1( int32_t a, int lm ) { return LIM( a, 0x7fff, -0x8000 * !lm, ( 1 << 31 ) | ( 1 << 24 ) ); } +int32_t gte::Lm_B2( int32_t a, int lm ) { return LIM( a, 0x7fff, -0x8000 * !lm, ( 1 << 31 ) | ( 1 << 23 ) ); } +int32_t gte::Lm_B3( int32_t a, int lm ) { return LIM( a, 0x7fff, -0x8000 * !lm, ( 1 << 22 ) ); } -INT32 gte::Lm_B3_sf( INT64 value, int sf, int lm ) +int32_t gte::Lm_B3_sf( int64_t value, int sf, int lm ) { - INT32 value_sf = gte_shift( value, sf ); - INT32 value_12 = gte_shift( value, 1 ); + int32_t value_sf = gte_shift( value, sf ); + int32_t value_12 = gte_shift( value, 1 ); int max = 0x7fff; int min = 0; if( lm == 0 ) @@ -382,12 +382,12 @@ INT32 gte::Lm_B3_sf( INT64 value, int sf, int lm ) return value_sf; } -INT32 gte::Lm_C1( INT32 a ) { return LIM( a, 0x00ff, 0x0000, ( 1 << 21 ) ); } -INT32 gte::Lm_C2( INT32 a ) { return LIM( a, 0x00ff, 0x0000, ( 1 << 20 ) ); } -INT32 gte::Lm_C3( INT32 a ) { return LIM( a, 0x00ff, 0x0000, ( 1 << 19 ) ); } -INT32 gte::Lm_D( INT64 a, int sf ) { return LIM( gte_shift( a, sf ), 0xffff, 0x0000, ( 1 << 31 ) | ( 1 << 18 ) ); } +int32_t gte::Lm_C1( int32_t a ) { return LIM( a, 0x00ff, 0x0000, ( 1 << 21 ) ); } +int32_t gte::Lm_C2( int32_t a ) { return LIM( a, 0x00ff, 0x0000, ( 1 << 20 ) ); } +int32_t gte::Lm_C3( int32_t a ) { return LIM( a, 0x00ff, 0x0000, ( 1 << 19 ) ); } +int32_t gte::Lm_D( int64_t a, int sf ) { return LIM( gte_shift( a, sf ), 0xffff, 0x0000, ( 1 << 31 ) | ( 1 << 18 ) ); } -UINT32 gte::Lm_E( UINT32 result ) +uint32_t gte::Lm_E( uint32_t result ) { if( result == 0xffffffff ) { @@ -403,7 +403,7 @@ UINT32 gte::Lm_E( UINT32 result ) return result; } -INT64 gte::F( INT64 a ) +int64_t gte::F( int64_t a ) { m_mac0 = a; @@ -412,7 +412,7 @@ INT64 gte::F( INT64 a ) FLAG |= ( 1 << 31 ) | ( 1 << 16 ); } - if( a < (INT32) -0x80000000 ) + if( a < (int32_t) -0x80000000 ) { FLAG |= ( 1 << 31 ) | ( 1 << 15 ); } @@ -420,7 +420,7 @@ INT64 gte::F( INT64 a ) return a; } -INT32 gte::Lm_G1( INT64 a ) +int32_t gte::Lm_G1( int64_t a ) { if( a > 0x3ff ) { @@ -437,7 +437,7 @@ INT32 gte::Lm_G1( INT64 a ) return a; } -INT32 gte::Lm_G2( INT64 a ) +int32_t gte::Lm_G2( int64_t a ) { if( a > 0x3ff ) { @@ -454,10 +454,10 @@ INT32 gte::Lm_G2( INT64 a ) return a; } -INT32 gte::Lm_H( INT64 value, int sf ) +int32_t gte::Lm_H( int64_t value, int sf ) { - INT64 value_sf = gte_shift( value, sf ); - INT32 value_12 = gte_shift( value, 1 ); + int64_t value_sf = gte_shift( value, sf ); + int32_t value_12 = gte_shift( value, 1 ); int max = 0x1000; int min = 0x0000; @@ -479,13 +479,13 @@ INT32 gte::Lm_H( INT64 value, int sf ) return value_12; } -int gte::docop2( UINT32 pc, int gteop ) +int gte::docop2( uint32_t pc, int gteop ) { int v; int lm; int cv; int mx; - INT32 h_over_sz3 = 0; + int32_t h_over_sz3 = 0; lm = GTE_LM( gteop ); m_sf = GTE_SF( gteop ); @@ -498,9 +498,9 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x01: GTELOG( pc, "%08x RTPS", gteop ); - MAC1 = A1( int44( (INT64) TRX << 12 ) + ( R11 * VX0 ) + ( R12 * VY0 ) + ( R13 * VZ0 ) ); - MAC2 = A2( int44( (INT64) TRY << 12 ) + ( R21 * VX0 ) + ( R22 * VY0 ) + ( R23 * VZ0 ) ); - MAC3 = A3( int44( (INT64) TRZ << 12 ) + ( R31 * VX0 ) + ( R32 * VY0 ) + ( R33 * VZ0 ) ); + MAC1 = A1( int44( (int64_t) TRX << 12 ) + ( R11 * VX0 ) + ( R12 * VY0 ) + ( R13 * VZ0 ) ); + MAC2 = A2( int44( (int64_t) TRY << 12 ) + ( R21 * VX0 ) + ( R22 * VY0 ) + ( R23 * VZ0 ) ); + MAC3 = A3( int44( (int64_t) TRZ << 12 ) + ( R31 * VX0 ) + ( R32 * VY0 ) + ( R33 * VZ0 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3_sf( m_mac3, m_sf, lm ); @@ -511,24 +511,24 @@ int gte::docop2( UINT32 pc, int gteop ) h_over_sz3 = Lm_E( gte_divide( H, SZ3 ) ); SXY0 = SXY1; SXY1 = SXY2; - SX2 = Lm_G1( F( (INT64) OFX + ( (INT64) IR1 * h_over_sz3 ) ) >> 16 ); - SY2 = Lm_G2( F( (INT64) OFY + ( (INT64) IR2 * h_over_sz3 ) ) >> 16 ); - MAC0 = F( (INT64) DQB + ( (INT64) DQA * h_over_sz3 ) ); + SX2 = Lm_G1( F( (int64_t) OFX + ( (int64_t) IR1 * h_over_sz3 ) ) >> 16 ); + SY2 = Lm_G2( F( (int64_t) OFY + ( (int64_t) IR2 * h_over_sz3 ) ) >> 16 ); + MAC0 = F( (int64_t) DQB + ( (int64_t) DQA * h_over_sz3 ) ); IR0 = Lm_H( m_mac0, 1 ); return 1; case 0x06: GTELOG( pc, "%08x NCLIP", gteop ); - MAC0 = F( (INT64) ( SX0 * SY1 ) + ( SX1 * SY2 ) + ( SX2 * SY0 ) - ( SX0 * SY2 ) - ( SX1 * SY0 ) - ( SX2 * SY1 ) ); + MAC0 = F( (int64_t) ( SX0 * SY1 ) + ( SX1 * SY2 ) + ( SX2 * SY0 ) - ( SX0 * SY2 ) - ( SX1 * SY0 ) - ( SX2 * SY1 ) ); return 1; case 0x0c: GTELOG( pc, "%08x OP", gteop ); - MAC1 = A1( (INT64) ( R22 * IR3 ) - ( R33 * IR2 ) ); - MAC2 = A2( (INT64) ( R33 * IR1 ) - ( R11 * IR3 ) ); - MAC3 = A3( (INT64) ( R11 * IR2 ) - ( R22 * IR1 ) ); + MAC1 = A1( (int64_t) ( R22 * IR3 ) - ( R33 * IR2 ) ); + MAC2 = A2( (int64_t) ( R33 * IR1 ) - ( R11 * IR3 ) ); + MAC3 = A3( (int64_t) ( R11 * IR2 ) - ( R22 * IR1 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -537,9 +537,9 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x10: GTELOG( pc, "%08x DPCS", gteop ); - MAC1 = A1( ( R << 16 ) + ( IR0 * Lm_B1( A1( ( (INT64) RFC << 12 ) - ( R << 16 ) ), 0 ) ) ); - MAC2 = A2( ( G << 16 ) + ( IR0 * Lm_B2( A2( ( (INT64) GFC << 12 ) - ( G << 16 ) ), 0 ) ) ); - MAC3 = A3( ( B << 16 ) + ( IR0 * Lm_B3( A3( ( (INT64) BFC << 12 ) - ( B << 16 ) ), 0 ) ) ); + MAC1 = A1( ( R << 16 ) + ( IR0 * Lm_B1( A1( ( (int64_t) RFC << 12 ) - ( R << 16 ) ), 0 ) ) ); + MAC2 = A2( ( G << 16 ) + ( IR0 * Lm_B2( A2( ( (int64_t) GFC << 12 ) - ( G << 16 ) ), 0 ) ) ); + MAC3 = A3( ( B << 16 ) + ( IR0 * Lm_B3( A3( ( (int64_t) BFC << 12 ) - ( B << 16 ) ), 0 ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -554,9 +554,9 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x11: GTELOG( pc, "%08x INTPL", gteop ); - MAC1 = A1( ( IR1 << 12 ) + ( IR0 * Lm_B1( A1( ( (INT64) RFC << 12 ) - ( IR1 << 12 ) ), 0 ) ) ); - MAC2 = A2( ( IR2 << 12 ) + ( IR0 * Lm_B2( A2( ( (INT64) GFC << 12 ) - ( IR2 << 12 ) ), 0 ) ) ); - MAC3 = A3( ( IR3 << 12 ) + ( IR0 * Lm_B3( A3( ( (INT64) BFC << 12 ) - ( IR3 << 12 ) ), 0 ) ) ); + MAC1 = A1( ( IR1 << 12 ) + ( IR0 * Lm_B1( A1( ( (int64_t) RFC << 12 ) - ( IR1 << 12 ) ), 0 ) ) ); + MAC2 = A2( ( IR2 << 12 ) + ( IR0 * Lm_B2( A2( ( (int64_t) GFC << 12 ) - ( IR2 << 12 ) ), 0 ) ) ); + MAC3 = A3( ( IR3 << 12 ) + ( IR0 * Lm_B3( A3( ( (int64_t) BFC << 12 ) - ( IR3 << 12 ) ), 0 ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -578,18 +578,18 @@ int gte::docop2( UINT32 pc, int gteop ) switch( cv ) { case 2: - MAC1 = A1( (INT64) ( MX12( mx ) * VY( v ) ) + ( MX13( mx ) * VZ( v ) ) ); - MAC2 = A2( (INT64) ( MX22( mx ) * VY( v ) ) + ( MX23( mx ) * VZ( v ) ) ); - MAC3 = A3( (INT64) ( MX32( mx ) * VY( v ) ) + ( MX33( mx ) * VZ( v ) ) ); - Lm_B1( A1( ( (INT64) CV1( cv ) << 12 ) + ( MX11( mx ) * VX( v ) ) ), 0 ); - Lm_B2( A2( ( (INT64) CV2( cv ) << 12 ) + ( MX21( mx ) * VX( v ) ) ), 0 ); - Lm_B3( A3( ( (INT64) CV3( cv ) << 12 ) + ( MX31( mx ) * VX( v ) ) ), 0 ); + MAC1 = A1( (int64_t) ( MX12( mx ) * VY( v ) ) + ( MX13( mx ) * VZ( v ) ) ); + MAC2 = A2( (int64_t) ( MX22( mx ) * VY( v ) ) + ( MX23( mx ) * VZ( v ) ) ); + MAC3 = A3( (int64_t) ( MX32( mx ) * VY( v ) ) + ( MX33( mx ) * VZ( v ) ) ); + Lm_B1( A1( ( (int64_t) CV1( cv ) << 12 ) + ( MX11( mx ) * VX( v ) ) ), 0 ); + Lm_B2( A2( ( (int64_t) CV2( cv ) << 12 ) + ( MX21( mx ) * VX( v ) ) ), 0 ); + Lm_B3( A3( ( (int64_t) CV3( cv ) << 12 ) + ( MX31( mx ) * VX( v ) ) ), 0 ); break; default: - MAC1 = A1( int44( (INT64) CV1( cv ) << 12 ) + ( MX11( mx ) * VX( v ) ) + ( MX12( mx ) * VY( v ) ) + ( MX13( mx ) * VZ( v ) ) ); - MAC2 = A2( int44( (INT64) CV2( cv ) << 12 ) + ( MX21( mx ) * VX( v ) ) + ( MX22( mx ) * VY( v ) ) + ( MX23( mx ) * VZ( v ) ) ); - MAC3 = A3( int44( (INT64) CV3( cv ) << 12 ) + ( MX31( mx ) * VX( v ) ) + ( MX32( mx ) * VY( v ) ) + ( MX33( mx ) * VZ( v ) ) ); + MAC1 = A1( int44( (int64_t) CV1( cv ) << 12 ) + ( MX11( mx ) * VX( v ) ) + ( MX12( mx ) * VY( v ) ) + ( MX13( mx ) * VZ( v ) ) ); + MAC2 = A2( int44( (int64_t) CV2( cv ) << 12 ) + ( MX21( mx ) * VX( v ) ) + ( MX22( mx ) * VY( v ) ) + ( MX23( mx ) * VZ( v ) ) ); + MAC3 = A3( int44( (int64_t) CV3( cv ) << 12 ) + ( MX31( mx ) * VX( v ) ) + ( MX32( mx ) * VY( v ) ) + ( MX33( mx ) * VZ( v ) ) ); break; } @@ -601,21 +601,21 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x13: GTELOG( pc, "%08x NCDS", gteop ); - MAC1 = A1( (INT64) ( L11 * VX0 ) + ( L12 * VY0 ) + ( L13 * VZ0 ) ); - MAC2 = A2( (INT64) ( L21 * VX0 ) + ( L22 * VY0 ) + ( L23 * VZ0 ) ); - MAC3 = A3( (INT64) ( L31 * VX0 ) + ( L32 * VY0 ) + ( L33 * VZ0 ) ); + MAC1 = A1( (int64_t) ( L11 * VX0 ) + ( L12 * VY0 ) + ( L13 * VZ0 ) ); + MAC2 = A2( (int64_t) ( L21 * VX0 ) + ( L22 * VY0 ) + ( L23 * VZ0 ) ); + MAC3 = A3( (int64_t) ( L31 * VX0 ) + ( L32 * VY0 ) + ( L33 * VZ0 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); - MAC1 = A1( int44( (INT64) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); - MAC2 = A2( int44( (INT64) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); - MAC3 = A3( int44( (INT64) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); + MAC1 = A1( int44( (int64_t) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); + MAC2 = A2( int44( (int64_t) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); + MAC3 = A3( int44( (int64_t) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); - MAC1 = A1( ( ( R << 4 ) * IR1 ) + ( IR0 * Lm_B1( A1( ( (INT64) RFC << 12 ) - ( ( R << 4 ) * IR1 ) ), 0 ) ) ); - MAC2 = A2( ( ( G << 4 ) * IR2 ) + ( IR0 * Lm_B2( A2( ( (INT64) GFC << 12 ) - ( ( G << 4 ) * IR2 ) ), 0 ) ) ); - MAC3 = A3( ( ( B << 4 ) * IR3 ) + ( IR0 * Lm_B3( A3( ( (INT64) BFC << 12 ) - ( ( B << 4 ) * IR3 ) ), 0 ) ) ); + MAC1 = A1( ( ( R << 4 ) * IR1 ) + ( IR0 * Lm_B1( A1( ( (int64_t) RFC << 12 ) - ( ( R << 4 ) * IR1 ) ), 0 ) ) ); + MAC2 = A2( ( ( G << 4 ) * IR2 ) + ( IR0 * Lm_B2( A2( ( (int64_t) GFC << 12 ) - ( ( G << 4 ) * IR2 ) ), 0 ) ) ); + MAC3 = A3( ( ( B << 4 ) * IR3 ) + ( IR0 * Lm_B3( A3( ( (int64_t) BFC << 12 ) - ( ( B << 4 ) * IR3 ) ), 0 ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -630,15 +630,15 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x14: GTELOG( pc, "%08x CDP", gteop ); - MAC1 = A1( int44( (INT64) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); - MAC2 = A2( int44( (INT64) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); - MAC3 = A3( int44( (INT64) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); + MAC1 = A1( int44( (int64_t) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); + MAC2 = A2( int44( (int64_t) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); + MAC3 = A3( int44( (int64_t) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); - MAC1 = A1( ( ( R << 4 ) * IR1 ) + ( IR0 * Lm_B1( A1( ( (INT64) RFC << 12 ) - ( ( R << 4 ) * IR1 ) ), 0 ) ) ); - MAC2 = A2( ( ( G << 4 ) * IR2 ) + ( IR0 * Lm_B2( A2( ( (INT64) GFC << 12 ) - ( ( G << 4 ) * IR2 ) ), 0 ) ) ); - MAC3 = A3( ( ( B << 4 ) * IR3 ) + ( IR0 * Lm_B3( A3( ( (INT64) BFC << 12 ) - ( ( B << 4 ) * IR3 ) ), 0 ) ) ); + MAC1 = A1( ( ( R << 4 ) * IR1 ) + ( IR0 * Lm_B1( A1( ( (int64_t) RFC << 12 ) - ( ( R << 4 ) * IR1 ) ), 0 ) ) ); + MAC2 = A2( ( ( G << 4 ) * IR2 ) + ( IR0 * Lm_B2( A2( ( (int64_t) GFC << 12 ) - ( ( G << 4 ) * IR2 ) ), 0 ) ) ); + MAC3 = A3( ( ( B << 4 ) * IR3 ) + ( IR0 * Lm_B3( A3( ( (int64_t) BFC << 12 ) - ( ( B << 4 ) * IR3 ) ), 0 ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -655,21 +655,21 @@ int gte::docop2( UINT32 pc, int gteop ) for( v = 0; v < 3; v++ ) { - MAC1 = A1( (INT64) ( L11 * VX( v ) ) + ( L12 * VY( v ) ) + ( L13 * VZ( v ) ) ); - MAC2 = A2( (INT64) ( L21 * VX( v ) ) + ( L22 * VY( v ) ) + ( L23 * VZ( v ) ) ); - MAC3 = A3( (INT64) ( L31 * VX( v ) ) + ( L32 * VY( v ) ) + ( L33 * VZ( v ) ) ); + MAC1 = A1( (int64_t) ( L11 * VX( v ) ) + ( L12 * VY( v ) ) + ( L13 * VZ( v ) ) ); + MAC2 = A2( (int64_t) ( L21 * VX( v ) ) + ( L22 * VY( v ) ) + ( L23 * VZ( v ) ) ); + MAC3 = A3( (int64_t) ( L31 * VX( v ) ) + ( L32 * VY( v ) ) + ( L33 * VZ( v ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); - MAC1 = A1( int44( (INT64) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); - MAC2 = A2( int44( (INT64) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); - MAC3 = A3( int44( (INT64) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); + MAC1 = A1( int44( (int64_t) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); + MAC2 = A2( int44( (int64_t) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); + MAC3 = A3( int44( (int64_t) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); - MAC1 = A1( ( ( R << 4 ) * IR1 ) + ( IR0 * Lm_B1( A1( ( (INT64) RFC << 12 ) - ( ( R << 4 ) * IR1 ) ), 0 ) ) ); - MAC2 = A2( ( ( G << 4 ) * IR2 ) + ( IR0 * Lm_B2( A2( ( (INT64) GFC << 12 ) - ( ( G << 4 ) * IR2 ) ), 0 ) ) ); - MAC3 = A3( ( ( B << 4 ) * IR3 ) + ( IR0 * Lm_B3( A3( ( (INT64) BFC << 12 ) - ( ( B << 4 ) * IR3 ) ), 0 ) ) ); + MAC1 = A1( ( ( R << 4 ) * IR1 ) + ( IR0 * Lm_B1( A1( ( (int64_t) RFC << 12 ) - ( ( R << 4 ) * IR1 ) ), 0 ) ) ); + MAC2 = A2( ( ( G << 4 ) * IR2 ) + ( IR0 * Lm_B2( A2( ( (int64_t) GFC << 12 ) - ( ( G << 4 ) * IR2 ) ), 0 ) ) ); + MAC3 = A3( ( ( B << 4 ) * IR3 ) + ( IR0 * Lm_B3( A3( ( (int64_t) BFC << 12 ) - ( ( B << 4 ) * IR3 ) ), 0 ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -685,15 +685,15 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x1b: GTELOG( pc, "%08x NCCS", gteop ); - MAC1 = A1( (INT64) ( L11 * VX0 ) + ( L12 * VY0 ) + ( L13 * VZ0 ) ); - MAC2 = A2( (INT64) ( L21 * VX0 ) + ( L22 * VY0 ) + ( L23 * VZ0 ) ); - MAC3 = A3( (INT64) ( L31 * VX0 ) + ( L32 * VY0 ) + ( L33 * VZ0 ) ); + MAC1 = A1( (int64_t) ( L11 * VX0 ) + ( L12 * VY0 ) + ( L13 * VZ0 ) ); + MAC2 = A2( (int64_t) ( L21 * VX0 ) + ( L22 * VY0 ) + ( L23 * VZ0 ) ); + MAC3 = A3( (int64_t) ( L31 * VX0 ) + ( L32 * VY0 ) + ( L33 * VZ0 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); - MAC1 = A1( int44( (INT64) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); - MAC2 = A2( int44( (INT64) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); - MAC3 = A3( int44( (INT64) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); + MAC1 = A1( int44( (int64_t) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); + MAC2 = A2( int44( (int64_t) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); + MAC3 = A3( int44( (int64_t) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -714,9 +714,9 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x1c: GTELOG( pc, "%08x CC", gteop ); - MAC1 = A1( int44( ( (INT64) RBK ) << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); - MAC2 = A2( int44( ( (INT64) GBK ) << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); - MAC3 = A3( int44( ( (INT64) BBK ) << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); + MAC1 = A1( int44( ( (int64_t) RBK ) << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); + MAC2 = A2( int44( ( (int64_t) GBK ) << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); + MAC3 = A3( int44( ( (int64_t) BBK ) << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -737,15 +737,15 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x1e: GTELOG( pc, "%08x NCS", gteop ); - MAC1 = A1( (INT64) ( L11 * VX0 ) + ( L12 * VY0 ) + ( L13 * VZ0 ) ); - MAC2 = A2( (INT64) ( L21 * VX0 ) + ( L22 * VY0 ) + ( L23 * VZ0 ) ); - MAC3 = A3( (INT64) ( L31 * VX0 ) + ( L32 * VY0 ) + ( L33 * VZ0 ) ); + MAC1 = A1( (int64_t) ( L11 * VX0 ) + ( L12 * VY0 ) + ( L13 * VZ0 ) ); + MAC2 = A2( (int64_t) ( L21 * VX0 ) + ( L22 * VY0 ) + ( L23 * VZ0 ) ); + MAC3 = A3( (int64_t) ( L31 * VX0 ) + ( L32 * VY0 ) + ( L33 * VZ0 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); - MAC1 = A1( int44( (INT64) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); - MAC2 = A2( int44( (INT64) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); - MAC3 = A3( int44( (INT64) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); + MAC1 = A1( int44( (int64_t) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); + MAC2 = A2( int44( (int64_t) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); + MAC3 = A3( int44( (int64_t) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -762,15 +762,15 @@ int gte::docop2( UINT32 pc, int gteop ) for( v = 0; v < 3; v++ ) { - MAC1 = A1( (INT64) ( L11 * VX( v ) ) + ( L12 * VY( v ) ) + ( L13 * VZ( v ) ) ); - MAC2 = A2( (INT64) ( L21 * VX( v ) ) + ( L22 * VY( v ) ) + ( L23 * VZ( v ) ) ); - MAC3 = A3( (INT64) ( L31 * VX( v ) ) + ( L32 * VY( v ) ) + ( L33 * VZ( v ) ) ); + MAC1 = A1( (int64_t) ( L11 * VX( v ) ) + ( L12 * VY( v ) ) + ( L13 * VZ( v ) ) ); + MAC2 = A2( (int64_t) ( L21 * VX( v ) ) + ( L22 * VY( v ) ) + ( L23 * VZ( v ) ) ); + MAC3 = A3( (int64_t) ( L31 * VX( v ) ) + ( L32 * VY( v ) ) + ( L33 * VZ( v ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); - MAC1 = A1( int44( (INT64) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); - MAC2 = A2( int44( (INT64) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); - MAC3 = A3( int44( (INT64) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); + MAC1 = A1( int44( (int64_t) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); + MAC2 = A2( int44( (int64_t) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); + MAC3 = A3( int44( (int64_t) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -798,9 +798,9 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x29: GTELOG( pc, "%08x DPCL", gteop ); - MAC1 = A1( ( ( R << 4 ) * IR1 ) + ( IR0 * Lm_B1( A1( ( (INT64) RFC << 12 ) - ( ( R << 4 ) * IR1 ) ), 0 ) ) ); - MAC2 = A2( ( ( G << 4 ) * IR2 ) + ( IR0 * Lm_B2( A2( ( (INT64) GFC << 12 ) - ( ( G << 4 ) * IR2 ) ), 0 ) ) ); - MAC3 = A3( ( ( B << 4 ) * IR3 ) + ( IR0 * Lm_B3( A3( ( (INT64) BFC << 12 ) - ( ( B << 4 ) * IR3 ) ), 0 ) ) ); + MAC1 = A1( ( ( R << 4 ) * IR1 ) + ( IR0 * Lm_B1( A1( ( (int64_t) RFC << 12 ) - ( ( R << 4 ) * IR1 ) ), 0 ) ) ); + MAC2 = A2( ( ( G << 4 ) * IR2 ) + ( IR0 * Lm_B2( A2( ( (int64_t) GFC << 12 ) - ( ( G << 4 ) * IR2 ) ), 0 ) ) ); + MAC3 = A3( ( ( B << 4 ) * IR3 ) + ( IR0 * Lm_B3( A3( ( (int64_t) BFC << 12 ) - ( ( B << 4 ) * IR3 ) ), 0 ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -817,9 +817,9 @@ int gte::docop2( UINT32 pc, int gteop ) for( v = 0; v < 3; v++ ) { - MAC1 = A1( ( R0 << 16 ) + ( IR0 * Lm_B1( A1( ( (INT64) RFC << 12 ) - ( R0 << 16 ) ), 0 ) ) ); - MAC2 = A2( ( G0 << 16 ) + ( IR0 * Lm_B2( A2( ( (INT64) GFC << 12 ) - ( G0 << 16 ) ), 0 ) ) ); - MAC3 = A3( ( B0 << 16 ) + ( IR0 * Lm_B3( A3( ( (INT64) BFC << 12 ) - ( B0 << 16 ) ), 0 ) ) ); + MAC1 = A1( ( R0 << 16 ) + ( IR0 * Lm_B1( A1( ( (int64_t) RFC << 12 ) - ( R0 << 16 ) ), 0 ) ) ); + MAC2 = A2( ( G0 << 16 ) + ( IR0 * Lm_B2( A2( ( (int64_t) GFC << 12 ) - ( G0 << 16 ) ), 0 ) ) ); + MAC3 = A3( ( B0 << 16 ) + ( IR0 * Lm_B3( A3( ( (int64_t) BFC << 12 ) - ( B0 << 16 ) ), 0 ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); @@ -835,14 +835,14 @@ int gte::docop2( UINT32 pc, int gteop ) case 0x2d: GTELOG( pc, "%08x AVSZ3", gteop ); - MAC0 = F( (INT64) ( ZSF3 * SZ1 ) + ( ZSF3 * SZ2 ) + ( ZSF3 * SZ3 ) ); + MAC0 = F( (int64_t) ( ZSF3 * SZ1 ) + ( ZSF3 * SZ2 ) + ( ZSF3 * SZ3 ) ); OTZ = Lm_D( m_mac0, 1 ); return 1; case 0x2e: GTELOG( pc, "%08x AVSZ4", gteop ); - MAC0 = F( (INT64) ( ZSF4 * SZ0 ) + ( ZSF4 * SZ1 ) + ( ZSF4 * SZ2 ) + ( ZSF4 * SZ3 ) ); + MAC0 = F( (int64_t) ( ZSF4 * SZ0 ) + ( ZSF4 * SZ1 ) + ( ZSF4 * SZ2 ) + ( ZSF4 * SZ3 ) ); OTZ = Lm_D( m_mac0, 1 ); return 1; @@ -851,9 +851,9 @@ int gte::docop2( UINT32 pc, int gteop ) for( v = 0; v < 3; v++ ) { - MAC1 = A1( int44( (INT64) TRX << 12 ) + ( R11 * VX( v ) ) + ( R12 * VY( v ) ) + ( R13 * VZ( v ) ) ); - MAC2 = A2( int44( (INT64) TRY << 12 ) + ( R21 * VX( v ) ) + ( R22 * VY( v ) ) + ( R23 * VZ( v ) ) ); - MAC3 = A3( int44( (INT64) TRZ << 12 ) + ( R31 * VX( v ) ) + ( R32 * VY( v ) ) + ( R33 * VZ( v ) ) ); + MAC1 = A1( int44( (int64_t) TRX << 12 ) + ( R11 * VX( v ) ) + ( R12 * VY( v ) ) + ( R13 * VZ( v ) ) ); + MAC2 = A2( int44( (int64_t) TRY << 12 ) + ( R21 * VX( v ) ) + ( R22 * VY( v ) ) + ( R23 * VZ( v ) ) ); + MAC3 = A3( int44( (int64_t) TRZ << 12 ) + ( R31 * VX( v ) ) + ( R32 * VY( v ) ) + ( R33 * VZ( v ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3_sf( m_mac3, m_sf, lm ); @@ -864,11 +864,11 @@ int gte::docop2( UINT32 pc, int gteop ) h_over_sz3 = Lm_E( gte_divide( H, SZ3 ) ); SXY0 = SXY1; SXY1 = SXY2; - SX2 = Lm_G1( F( (INT64) OFX + ( (INT64) IR1 * h_over_sz3 ) ) >> 16 ); - SY2 = Lm_G2( F( (INT64) OFY + ( (INT64) IR2 * h_over_sz3 ) ) >> 16 ); + SX2 = Lm_G1( F( (int64_t) OFX + ( (int64_t) IR1 * h_over_sz3 ) ) >> 16 ); + SY2 = Lm_G2( F( (int64_t) OFY + ( (int64_t) IR2 * h_over_sz3 ) ) >> 16 ); } - MAC0 = F( (INT64) DQB + ( (INT64) DQA * h_over_sz3 ) ); + MAC0 = F( (int64_t) DQB + ( (int64_t) DQA * h_over_sz3 ) ); IR0 = Lm_H( m_mac0, 1 ); return 1; @@ -911,15 +911,15 @@ int gte::docop2( UINT32 pc, int gteop ) for( v = 0; v < 3; v++ ) { - MAC1 = A1( (INT64) ( L11 * VX( v ) ) + ( L12 * VY( v ) ) + ( L13 * VZ( v ) ) ); - MAC2 = A2( (INT64) ( L21 * VX( v ) ) + ( L22 * VY( v ) ) + ( L23 * VZ( v ) ) ); - MAC3 = A3( (INT64) ( L31 * VX( v ) ) + ( L32 * VY( v ) ) + ( L33 * VZ( v ) ) ); + MAC1 = A1( (int64_t) ( L11 * VX( v ) ) + ( L12 * VY( v ) ) + ( L13 * VZ( v ) ) ); + MAC2 = A2( (int64_t) ( L21 * VX( v ) ) + ( L22 * VY( v ) ) + ( L23 * VZ( v ) ) ); + MAC3 = A3( (int64_t) ( L31 * VX( v ) ) + ( L32 * VY( v ) ) + ( L33 * VZ( v ) ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); - MAC1 = A1( int44( (INT64) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); - MAC2 = A2( int44( (INT64) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); - MAC3 = A3( int44( (INT64) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); + MAC1 = A1( int44( (int64_t) RBK << 12 ) + ( LR1 * IR1 ) + ( LR2 * IR2 ) + ( LR3 * IR3 ) ); + MAC2 = A2( int44( (int64_t) GBK << 12 ) + ( LG1 * IR1 ) + ( LG2 * IR2 ) + ( LG3 * IR3 ) ); + MAC3 = A3( int44( (int64_t) BBK << 12 ) + ( LB1 * IR1 ) + ( LB2 * IR2 ) + ( LB3 * IR3 ) ); IR1 = Lm_B1( MAC1, lm ); IR2 = Lm_B2( MAC2, lm ); IR3 = Lm_B3( MAC3, lm ); diff --git a/src/devices/cpu/psx/gte.h b/src/devices/cpu/psx/gte.h index 3a1ef18ba2d..9402c302035 100644 --- a/src/devices/cpu/psx/gte.h +++ b/src/devices/cpu/psx/gte.h @@ -31,33 +31,33 @@ public: PAIR m_cp2cr[ 32 ]; PAIR m_cp2dr[ 32 ]; - UINT32 getcp2dr( UINT32 pc, int reg ); - void setcp2dr( UINT32 pc, int reg, UINT32 value ); - UINT32 getcp2cr( UINT32 pc, int reg ); - void setcp2cr( UINT32 pc, int reg, UINT32 value ); - int docop2( UINT32 pc, int gteop ); + uint32_t getcp2dr( uint32_t pc, int reg ); + void setcp2dr( uint32_t pc, int reg, uint32_t value ); + uint32_t getcp2cr( uint32_t pc, int reg ); + void setcp2cr( uint32_t pc, int reg, uint32_t value ); + int docop2( uint32_t pc, int gteop ); protected: class int44 { public: - int44( INT64 value ) : + int44( int64_t value ) : m_value( value ), m_positive_overflow( value > S64( 0x7ffffffffff ) ), m_negative_overflow( value < S64( -0x80000000000 ) ) { } - int44( INT64 value, bool positive_overflow, bool negative_overflow ) : + int44( int64_t value, bool positive_overflow, bool negative_overflow ) : m_value( value ), m_positive_overflow( positive_overflow ), m_negative_overflow( negative_overflow ) { } - int44 operator+( INT64 add ) + int44 operator+( int64_t add ) { - INT64 value = ( ( m_value + add ) << 20 ) >> 20; + int64_t value = ( ( m_value + add ) << 20 ) >> 20; return int44( value, m_positive_overflow || ( value < 0 && m_value >= 0 && add >= 0 ), @@ -74,41 +74,41 @@ protected: return m_negative_overflow; } - INT64 value() + int64_t value() { return m_value; } private: - INT64 m_value; + int64_t m_value; bool m_positive_overflow; bool m_negative_overflow; }; - INT32 LIM( INT32 value, INT32 max, INT32 min, UINT32 flag ); - INT32 BOUNDS( int44 a, int max_flag, int min_flag ); - INT32 A1( int44 a ); - INT32 A2( int44 a ); - INT32 A3( int44 a ); - INT32 Lm_B1( INT32 a, int lm ); - INT32 Lm_B2( INT32 a, int lm ); - INT32 Lm_B3( INT32 a, int lm ); - INT32 Lm_B3_sf( INT64 value, int sf, int lm ); - INT32 Lm_C1( INT32 a ); - INT32 Lm_C2( INT32 a ); - INT32 Lm_C3( INT32 a ); - INT32 Lm_D( INT64 a, int sf ); - UINT32 Lm_E( UINT32 result ); - INT64 F( INT64 a ); - INT32 Lm_G1( INT64 a ); - INT32 Lm_G2( INT64 a ); - INT32 Lm_H( INT64 value, int sf ); + int32_t LIM( int32_t value, int32_t max, int32_t min, uint32_t flag ); + int32_t BOUNDS( int44 a, int max_flag, int min_flag ); + int32_t A1( int44 a ); + int32_t A2( int44 a ); + int32_t A3( int44 a ); + int32_t Lm_B1( int32_t a, int lm ); + int32_t Lm_B2( int32_t a, int lm ); + int32_t Lm_B3( int32_t a, int lm ); + int32_t Lm_B3_sf( int64_t value, int sf, int lm ); + int32_t Lm_C1( int32_t a ); + int32_t Lm_C2( int32_t a ); + int32_t Lm_C3( int32_t a ); + int32_t Lm_D( int64_t a, int sf ); + uint32_t Lm_E( uint32_t result ); + int64_t F( int64_t a ); + int32_t Lm_G1( int64_t a ); + int32_t Lm_G2( int64_t a ); + int32_t Lm_H( int64_t value, int sf ); int m_sf; - INT64 m_mac0; - INT64 m_mac1; - INT64 m_mac2; - INT64 m_mac3; + int64_t m_mac0; + int64_t m_mac1; + int64_t m_mac2; + int64_t m_mac3; }; #endif diff --git a/src/devices/cpu/psx/irq.cpp b/src/devices/cpu/psx/irq.cpp index 4a2293d758c..50ed189abc5 100644 --- a/src/devices/cpu/psx/irq.cpp +++ b/src/devices/cpu/psx/irq.cpp @@ -29,7 +29,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, c const device_type PSX_IRQ = &device_creator; -psxirq_device::psxirq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psxirq_device::psxirq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSX_IRQ, "Sony PSX IRQ", tag, owner, clock, "psxirq", __FILE__), n_irqdata(0), n_irqmask(0), m_irq_handler(*this) { @@ -56,7 +56,7 @@ void psxirq_device::device_start() save_item( NAME( n_irqmask ) ); } -void psxirq_device::set( UINT32 bitmask ) +void psxirq_device::set( uint32_t bitmask ) { verboselog( *this, 2, "psx_irq_set %08x\n", bitmask ); n_irqdata |= bitmask; diff --git a/src/devices/cpu/psx/irq.h b/src/devices/cpu/psx/irq.h index 69e95207230..7cc83e8cfb3 100644 --- a/src/devices/cpu/psx/irq.h +++ b/src/devices/cpu/psx/irq.h @@ -22,7 +22,7 @@ extern const device_type PSX_IRQ; class psxirq_device : public device_t { public: - psxirq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psxirq_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); } @@ -49,10 +49,10 @@ protected: private: void psx_irq_update( void ); - void set( UINT32 bitmask ); + void set( uint32_t bitmask ); - UINT32 n_irqdata; - UINT32 n_irqmask; + uint32_t n_irqdata; + uint32_t n_irqmask; devcb_write_line m_irq_handler; }; diff --git a/src/devices/cpu/psx/mdec.cpp b/src/devices/cpu/psx/mdec.cpp index 3c0148525d5..c91c50d1d43 100644 --- a/src/devices/cpu/psx/mdec.cpp +++ b/src/devices/cpu/psx/mdec.cpp @@ -30,7 +30,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, c const device_type PSX_MDEC = &device_creator; -psxmdec_device::psxmdec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +psxmdec_device::psxmdec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSX_MDEC, "Sony PSX MDEC", tag, owner, clock, "psxmdec", __FILE__), n_decoded(0), n_offset(0), n_0_command(0), n_0_address(0), n_0_size(0), n_1_command(0), n_1_status(0) { } @@ -83,18 +83,18 @@ void psxmdec_device::device_start() } #ifdef UNUSED_FUNCTION -static inline void psxwriteword( UINT32 *p_n_psxram, UINT32 n_address, UINT16 n_data ) +static inline void psxwriteword( uint32_t *p_n_psxram, uint32_t n_address, uint16_t n_data ) { - *( (UINT16 *)( (UINT8 *)p_n_psxram + WORD_XOR_LE( n_address ) ) ) = n_data; + *( (uint16_t *)( (uint8_t *)p_n_psxram + WORD_XOR_LE( n_address ) ) ) = n_data; } #endif -static inline UINT16 psxreadword( UINT32 *p_n_psxram, UINT32 n_address ) +static inline uint16_t psxreadword( uint32_t *p_n_psxram, uint32_t n_address ) { - return *( (UINT16 *)( (UINT8 *)p_n_psxram + WORD_XOR_LE( n_address ) ) ); + return *( (uint16_t *)( (uint8_t *)p_n_psxram + WORD_XOR_LE( n_address ) ) ); } -static const UINT32 m_p_n_mdec_zigzag[ DCTSIZE2 ] = +static const uint32_t m_p_n_mdec_zigzag[ DCTSIZE2 ] = { 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, @@ -108,11 +108,11 @@ static const UINT32 m_p_n_mdec_zigzag[ DCTSIZE2 ] = void psxmdec_device::mdec_cos_precalc() { - UINT32 n_x; - UINT32 n_y; - UINT32 n_u; - UINT32 n_v; - INT32 *p_n_precalc = p_n_cos_precalc; + uint32_t n_x; + uint32_t n_y; + uint32_t n_u; + uint32_t n_v; + int32_t *p_n_precalc = p_n_cos_precalc; for( n_y = 0; n_y < 8; n_y++ ) { @@ -131,18 +131,18 @@ void psxmdec_device::mdec_cos_precalc() } } -void psxmdec_device::mdec_idct( INT32 *p_n_src, INT32 *p_n_dst ) +void psxmdec_device::mdec_idct( int32_t *p_n_src, int32_t *p_n_dst ) { - INT32 *p_n_precalc = p_n_cos_precalc; + int32_t *p_n_precalc = p_n_cos_precalc; - for( UINT32 n_yx = 0; n_yx < DCTSIZE2; n_yx++ ) + for( uint32_t n_yx = 0; n_yx < DCTSIZE2; n_yx++ ) { - INT32 p_n_z[ 8 ]; - INT32 *p_n_data = p_n_src; + int32_t p_n_z[ 8 ]; + int32_t *p_n_data = p_n_src; memset( p_n_z, 0, sizeof( p_n_z ) ); - for( UINT32 n_vu = 0; n_vu < DCTSIZE2 / 8; n_vu++ ) + for( uint32_t n_vu = 0; n_vu < DCTSIZE2 / 8; n_vu++ ) { p_n_z[ 0 ] += p_n_data[ 0 ] * p_n_precalc[ 0 ]; p_n_z[ 1 ] += p_n_data[ 1 ] * p_n_precalc[ 1 ]; @@ -161,29 +161,29 @@ void psxmdec_device::mdec_idct( INT32 *p_n_src, INT32 *p_n_dst ) } } -static inline UINT16 mdec_unpack_run( UINT16 n_packed ) +static inline uint16_t mdec_unpack_run( uint16_t n_packed ) { return n_packed >> 10; } -static inline INT32 mdec_unpack_val( UINT16 n_packed ) +static inline int32_t mdec_unpack_val( uint16_t n_packed ) { - return ( ( (INT32)n_packed ) << 22 ) >> 22; + return ( ( (int32_t)n_packed ) << 22 ) >> 22; } -UINT32 psxmdec_device::mdec_unpack( UINT32 *p_n_psxram, UINT32 n_address ) +uint32_t psxmdec_device::mdec_unpack( uint32_t *p_n_psxram, uint32_t n_address ) { - UINT8 n_z; - INT32 n_qscale; - UINT16 n_packed; - INT32 *p_n_block; - INT32 p_n_unpacked[ 64 ]; - INT32 *p_n_q; + uint8_t n_z; + int32_t n_qscale; + uint16_t n_packed; + int32_t *p_n_block; + int32_t p_n_unpacked[ 64 ]; + int32_t *p_n_q; p_n_q = p_n_quantize_uv; p_n_block = m_p_n_unpacked; - for( UINT32 n_block = 0; n_block < 6; n_block++ ) + for( uint32_t n_block = 0; n_block < 6; n_block++ ) { memset( p_n_unpacked, 0, sizeof( p_n_unpacked ) ); @@ -224,42 +224,42 @@ UINT32 psxmdec_device::mdec_unpack( UINT32 *p_n_psxram, UINT32 n_address ) return n_address; } -static inline INT32 mdec_cr_to_r( INT32 n_cr ) +static inline int32_t mdec_cr_to_r( int32_t n_cr ) { return ( 1435 * n_cr ) >> 10; } -static inline INT32 mdec_cr_to_g( INT32 n_cr ) +static inline int32_t mdec_cr_to_g( int32_t n_cr ) { return ( -731 * n_cr ) >> 10; } -static inline INT32 mdec_cb_to_g( INT32 n_cb ) +static inline int32_t mdec_cb_to_g( int32_t n_cb ) { return ( -351 * n_cb ) >> 10; } -static inline INT32 mdec_cb_to_b( INT32 n_cb ) +static inline int32_t mdec_cb_to_b( int32_t n_cb ) { return ( 1814 * n_cb ) >> 10; } -UINT16 psxmdec_device::mdec_clamp_r5( INT32 n_r ) const +uint16_t psxmdec_device::mdec_clamp_r5( int32_t n_r ) const { return p_n_r5[ n_r + 128 + 256 ]; } -UINT16 psxmdec_device::mdec_clamp_g5( INT32 n_g ) const +uint16_t psxmdec_device::mdec_clamp_g5( int32_t n_g ) const { return p_n_g5[ n_g + 128 + 256 ]; } -UINT16 psxmdec_device::mdec_clamp_b5( INT32 n_b ) const +uint16_t psxmdec_device::mdec_clamp_b5( int32_t n_b ) const { return p_n_b5[ n_b + 128 + 256 ]; } -void psxmdec_device::mdec_makergb15( UINT32 n_address, INT32 n_r, INT32 n_g, INT32 n_b, INT32 *p_n_y, UINT16 n_stp ) +void psxmdec_device::mdec_makergb15( uint32_t n_address, int32_t n_r, int32_t n_g, int32_t n_b, int32_t *p_n_y, uint16_t n_stp ) { p_n_output[ WORD_XOR_LE( n_address + 0 ) / 2 ] = n_stp | mdec_clamp_r5( p_n_y[ 0 ] + n_r ) | @@ -274,18 +274,18 @@ void psxmdec_device::mdec_makergb15( UINT32 n_address, INT32 n_r, INT32 n_g, INT void psxmdec_device::mdec_yuv2_to_rgb15( void ) { - INT32 n_r; - INT32 n_g; - INT32 n_b; - INT32 n_cb; - INT32 n_cr; - INT32 *p_n_cb; - INT32 *p_n_cr; - INT32 *p_n_y; - UINT32 n_x; - UINT32 n_y; - UINT32 n_z; - UINT16 n_stp; + int32_t n_r; + int32_t n_g; + int32_t n_b; + int32_t n_cb; + int32_t n_cr; + int32_t *p_n_cb; + int32_t *p_n_cr; + int32_t *p_n_y; + uint32_t n_x; + uint32_t n_y; + uint32_t n_z; + uint16_t n_stp; int n_address = 0; if( ( n_0_command & ( 1L << 25 ) ) != 0 ) @@ -340,12 +340,12 @@ void psxmdec_device::mdec_yuv2_to_rgb15( void ) n_decoded = ( 16 * 16 ) / 2; } -UINT16 psxmdec_device::mdec_clamp8( INT32 n_r ) const +uint16_t psxmdec_device::mdec_clamp8( int32_t n_r ) const { return p_n_clamp8[ n_r + 128 + 256 ]; } -void psxmdec_device::mdec_makergb24( UINT32 n_address, INT32 n_r, INT32 n_g, INT32 n_b, INT32 *p_n_y, UINT32 n_stp ) +void psxmdec_device::mdec_makergb24( uint32_t n_address, int32_t n_r, int32_t n_g, int32_t n_b, int32_t *p_n_y, uint32_t n_stp ) { p_n_output[ WORD_XOR_LE( n_address + 0 ) / 2 ] = ( mdec_clamp8( p_n_y[ 0 ] + n_g ) << 8 ) | mdec_clamp8( p_n_y[ 0 ] + n_r ); p_n_output[ WORD_XOR_LE( n_address + 2 ) / 2 ] = ( mdec_clamp8( p_n_y[ 1 ] + n_r ) << 8 ) | mdec_clamp8( p_n_y[ 0 ] + n_b ); @@ -354,18 +354,18 @@ void psxmdec_device::mdec_makergb24( UINT32 n_address, INT32 n_r, INT32 n_g, INT void psxmdec_device::mdec_yuv2_to_rgb24( void ) { - INT32 n_r; - INT32 n_g; - INT32 n_b; - INT32 n_cb; - INT32 n_cr; - INT32 *p_n_cb; - INT32 *p_n_cr; - INT32 *p_n_y; - UINT32 n_x; - UINT32 n_y; - UINT32 n_z; - UINT32 n_stp; + int32_t n_r; + int32_t n_g; + int32_t n_b; + int32_t n_cb; + int32_t n_cr; + int32_t *p_n_cb; + int32_t *p_n_cr; + int32_t *p_n_y; + uint32_t n_x; + uint32_t n_y; + uint32_t n_z; + uint32_t n_stp; int n_address = 0; if( ( n_0_command & ( 1L << 25 ) ) != 0 ) @@ -420,7 +420,7 @@ void psxmdec_device::mdec_yuv2_to_rgb24( void ) n_decoded = ( 24 * 16 ) / 2; } -void psxmdec_device::dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void psxmdec_device::dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { int n_index; @@ -463,8 +463,8 @@ void psxmdec_device::dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_si n_index = 0; while( n_size > 0 ) { - p_n_cos[ n_index + 0 ] = (INT16)( ( p_n_psxram[ n_address / 4 ] >> 0 ) & 0xffff ); - p_n_cos[ n_index + 1 ] = (INT16)( ( p_n_psxram[ n_address / 4 ] >> 16 ) & 0xffff ); + p_n_cos[ n_index + 0 ] = (int16_t)( ( p_n_psxram[ n_address / 4 ] >> 0 ) & 0xffff ); + p_n_cos[ n_index + 1 ] = (int16_t)( ( p_n_psxram[ n_address / 4 ] >> 16 ) & 0xffff ); n_index += 2; n_address += 4; n_size--; @@ -477,10 +477,10 @@ void psxmdec_device::dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_si } } -void psxmdec_device::dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void psxmdec_device::dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { - UINT32 n_this; - UINT32 n_nextaddress; + uint32_t n_this; + uint32_t n_nextaddress; verboselog( *this, 2, "mdec1_read( %08x, %08x )\n", n_address, n_size ); if( ( n_0_command & ( 1L << 29 ) ) != 0 && n_0_size != 0 ) @@ -523,7 +523,7 @@ void psxmdec_device::dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_siz } n_decoded -= n_this; - memcpy( (UINT8 *)p_n_psxram + n_address, (UINT8 *)p_n_output + n_offset, n_this * 4 ); + memcpy( (uint8_t *)p_n_psxram + n_address, (uint8_t *)p_n_output + n_offset, n_this * 4 ); n_offset += n_this * 4; n_address += n_this * 4; n_size -= n_this; diff --git a/src/devices/cpu/psx/mdec.h b/src/devices/cpu/psx/mdec.h index e3065bacb95..7b237a51145 100644 --- a/src/devices/cpu/psx/mdec.h +++ b/src/devices/cpu/psx/mdec.h @@ -24,13 +24,13 @@ extern const device_type PSX_MDEC; class psxmdec_device : public device_t { public: - psxmdec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psxmdec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE32_MEMBER( write ); DECLARE_READ32_MEMBER( read ); - void dma_write( UINT32 *ram, UINT32 n_address, INT32 n_size ); - void dma_read( UINT32 *ram, UINT32 n_address, INT32 n_size ); + void dma_write( uint32_t *ram, uint32_t n_address, int32_t n_size ); + void dma_read( uint32_t *ram, uint32_t n_address, int32_t n_size ); protected: virtual void device_start() override; @@ -39,38 +39,38 @@ protected: private: void mdec_cos_precalc(); - void mdec_idct( INT32 *p_n_src, INT32 *p_n_dst ); - UINT32 mdec_unpack( UINT32 *ram, UINT32 n_address ); - UINT16 mdec_clamp_r5( INT32 n_r ) const; - UINT16 mdec_clamp_g5( INT32 n_g ) const; - UINT16 mdec_clamp_b5( INT32 n_b ) const; - UINT16 mdec_clamp8( INT32 n_r ) const; + void mdec_idct( int32_t *p_n_src, int32_t *p_n_dst ); + uint32_t mdec_unpack( uint32_t *ram, uint32_t n_address ); + uint16_t mdec_clamp_r5( int32_t n_r ) const; + uint16_t mdec_clamp_g5( int32_t n_g ) const; + uint16_t mdec_clamp_b5( int32_t n_b ) const; + uint16_t mdec_clamp8( int32_t n_r ) const; void mdec_yuv2_to_rgb15( void ); void mdec_yuv2_to_rgb24( void ); - void mdec_makergb15( UINT32 n_address, INT32 n_r, INT32 n_g, INT32 n_b, INT32 *p_n_y, UINT16 n_stp ); - void mdec_makergb24( UINT32 n_address, INT32 n_r, INT32 n_g, INT32 n_b, INT32 *p_n_y, UINT32 n_stp ); - - UINT32 n_decoded; - UINT32 n_offset; - UINT16 p_n_output[ 24 * 16 ]; - - INT32 p_n_quantize_y[ DCTSIZE2 ]; - INT32 p_n_quantize_uv[ DCTSIZE2 ]; - INT32 p_n_cos[ DCTSIZE2 ]; - INT32 p_n_cos_precalc[ DCTSIZE2 * DCTSIZE2 ]; - - UINT32 n_0_command; - UINT32 n_0_address; - UINT32 n_0_size; - UINT32 n_1_command; - UINT32 n_1_status; - - UINT16 p_n_clamp8[ 256 * 3 ]; - UINT16 p_n_r5[ 256 * 3 ]; - UINT16 p_n_g5[ 256 * 3 ]; - UINT16 p_n_b5[ 256 * 3 ]; - - INT32 m_p_n_unpacked[ DCTSIZE2 * 6 * 2 ]; + void mdec_makergb15( uint32_t n_address, int32_t n_r, int32_t n_g, int32_t n_b, int32_t *p_n_y, uint16_t n_stp ); + void mdec_makergb24( uint32_t n_address, int32_t n_r, int32_t n_g, int32_t n_b, int32_t *p_n_y, uint32_t n_stp ); + + uint32_t n_decoded; + uint32_t n_offset; + uint16_t p_n_output[ 24 * 16 ]; + + int32_t p_n_quantize_y[ DCTSIZE2 ]; + int32_t p_n_quantize_uv[ DCTSIZE2 ]; + int32_t p_n_cos[ DCTSIZE2 ]; + int32_t p_n_cos_precalc[ DCTSIZE2 * DCTSIZE2 ]; + + uint32_t n_0_command; + uint32_t n_0_address; + uint32_t n_0_size; + uint32_t n_1_command; + uint32_t n_1_status; + + uint16_t p_n_clamp8[ 256 * 3 ]; + uint16_t p_n_r5[ 256 * 3 ]; + uint16_t p_n_g5[ 256 * 3 ]; + uint16_t p_n_b5[ 256 * 3 ]; + + int32_t m_p_n_unpacked[ DCTSIZE2 * 6 * 2 ]; }; #endif diff --git a/src/devices/cpu/psx/psx.cpp b/src/devices/cpu/psx/psx.cpp index 9d4ff93c7f3..9584c58eb27 100644 --- a/src/devices/cpu/psx/psx.cpp +++ b/src/devices/cpu/psx/psx.cpp @@ -172,7 +172,7 @@ const device_type CXD8661R = &device_creator; const device_type CXD8606BQ = &device_creator; const device_type CXD8606CQ = &device_creator; -static const UINT32 mtc0_writemask[]= +static const uint32_t mtc0_writemask[]= { 0x00000000, /* !INDEX */ 0x00000000, /* !RANDOM */ @@ -217,7 +217,7 @@ WRITE32_MEMBER( psxcpu_device::exp_base_w ) m_exp_base = 0x1f000000 | ( m_exp_base & 0xffffff ); } -UINT32 psxcpu_device::exp_base() +uint32_t psxcpu_device::exp_base() { return m_exp_base; } @@ -241,7 +241,7 @@ READ32_MEMBER( psxcpu_device::ram_config_r ) WRITE32_MEMBER( psxcpu_device::ram_config_w ) { - UINT32 old = m_ram_config; + uint32_t old = m_ram_config; COMBINE_DATA( &m_ram_config ); // TODO: check byte writes @@ -258,7 +258,7 @@ READ32_MEMBER( psxcpu_device::rom_config_r ) WRITE32_MEMBER( psxcpu_device::rom_config_w ) { - UINT32 old = m_rom_config; + uint32_t old = m_rom_config; COMBINE_DATA( &m_rom_config ); // TODO: check byte writes @@ -287,7 +287,7 @@ READ32_MEMBER( psxcpu_device::biu_r ) WRITE32_MEMBER( psxcpu_device::biu_w ) { - UINT32 old = m_biu; + uint32_t old = m_biu; COMBINE_DATA( &m_biu ); // TODO: check byte writes @@ -303,15 +303,15 @@ void psxcpu_device::stop() debugger_instruction_hook( this, m_pc ); } -UINT32 psxcpu_device::cache_readword( UINT32 offset ) +uint32_t psxcpu_device::cache_readword( uint32_t offset ) { - UINT32 data = 0; + uint32_t data = 0; if( ( m_biu & BIU_TAG ) != 0 ) { if( ( m_biu & BIU_IS1 ) != 0 ) { - UINT32 tag = m_icacheTag[ ( offset / 16 ) % ( ICACHE_ENTRIES / 4 ) ]; + uint32_t tag = m_icacheTag[ ( offset / 16 ) % ( ICACHE_ENTRIES / 4 ) ]; data |= tag & TAG_VALID; if( ( ( tag ^ offset ) & TAG_MATCH_MASK ) == 0 ) @@ -339,7 +339,7 @@ UINT32 psxcpu_device::cache_readword( UINT32 offset ) return data; } -void psxcpu_device::cache_writeword( UINT32 offset, UINT32 data ) +void psxcpu_device::cache_writeword( uint32_t offset, uint32_t data ) { if( ( m_biu & BIU_TAG ) != 0 ) { @@ -369,7 +369,7 @@ void psxcpu_device::cache_writeword( UINT32 offset, UINT32 data ) } } -UINT8 psxcpu_device::readbyte( UINT32 address ) +uint8_t psxcpu_device::readbyte( uint32_t address ) { if( m_bus_attached ) { @@ -379,7 +379,7 @@ UINT8 psxcpu_device::readbyte( UINT32 address ) return cache_readword( address ) >> ( ( address & 3 ) * 8 ); } -UINT16 psxcpu_device::readhalf( UINT32 address ) +uint16_t psxcpu_device::readhalf( uint32_t address ) { if( m_bus_attached ) { @@ -389,7 +389,7 @@ UINT16 psxcpu_device::readhalf( UINT32 address ) return cache_readword( address ) >> ( ( address & 2 ) * 8 ); } -UINT32 psxcpu_device::readword( UINT32 address ) +uint32_t psxcpu_device::readword( uint32_t address ) { if( m_bus_attached ) { @@ -399,7 +399,7 @@ UINT32 psxcpu_device::readword( UINT32 address ) return cache_readword( address ); } -UINT32 psxcpu_device::readword_masked( UINT32 address, UINT32 mask ) +uint32_t psxcpu_device::readword_masked( uint32_t address, uint32_t mask ) { if( m_bus_attached ) { @@ -409,7 +409,7 @@ UINT32 psxcpu_device::readword_masked( UINT32 address, UINT32 mask ) return cache_readword( address ); } -void psxcpu_device::writeword( UINT32 address, UINT32 data ) +void psxcpu_device::writeword( uint32_t address, uint32_t data ) { if( m_bus_attached ) { @@ -421,7 +421,7 @@ void psxcpu_device::writeword( UINT32 address, UINT32 data ) } } -void psxcpu_device::writeword_masked( UINT32 address, UINT32 data, UINT32 mask ) +void psxcpu_device::writeword_masked( uint32_t address, uint32_t data, uint32_t mask ) { if( m_bus_attached ) { @@ -750,7 +750,7 @@ static const struct { 0x00, 0x00, nullptr } }; -UINT32 psxcpu_device::log_bioscall_parameter( int parm ) +uint32_t psxcpu_device::log_bioscall_parameter( int parm ) { if( parm < 4 ) { @@ -763,7 +763,7 @@ UINT32 psxcpu_device::log_bioscall_parameter( int parm ) const char *psxcpu_device::log_bioscall_string( int parm ) { int pos; - UINT32 address; + uint32_t address; static char string[ 1024 ]; address = log_bioscall_parameter( parm ); @@ -777,7 +777,7 @@ const char *psxcpu_device::log_bioscall_string( int parm ) for( ;; ) { - UINT8 c = readbyte( address ); + uint8_t c = readbyte( address ); if( c == 0 ) { break; @@ -872,7 +872,7 @@ void psxcpu_device::log_bioscall() { while( nbytes > 0 ) { - UINT8 c = readbyte( buffer ); + uint8_t c = readbyte( buffer ); putchar( c ); nbytes--; buffer++; @@ -959,13 +959,13 @@ void psxcpu_device::log_bioscall() { if( parm > 0 ) { - UINT32 format = log_bioscall_parameter( parm - 1 ); + uint32_t format = log_bioscall_parameter( parm - 1 ); const char *parmstr = nullptr; int percent = 0; for( ;; ) { - UINT8 c = readbyte( format ); + uint8_t c = readbyte( format ); if( c == 0 ) { break; @@ -1172,7 +1172,7 @@ void psxcpu_device::multiplier_update() { case MULTIPLIER_OPERATION_MULT: { - INT64 result = mul_32x32( (INT32)m_multiplier_operand1, (INT32)m_multiplier_operand2 ); + int64_t result = mul_32x32( (int32_t)m_multiplier_operand1, (int32_t)m_multiplier_operand2 ); m_lo = extract_64lo( result ); m_hi = extract_64hi( result ); } @@ -1180,7 +1180,7 @@ void psxcpu_device::multiplier_update() case MULTIPLIER_OPERATION_MULTU: { - UINT64 result = mulu_32x32( m_multiplier_operand1, m_multiplier_operand2 ); + uint64_t result = mulu_32x32( m_multiplier_operand1, m_multiplier_operand2 ); m_lo = extract_64lo( result ); m_hi = extract_64hi( result ); } @@ -1194,7 +1194,7 @@ void psxcpu_device::multiplier_update() } else if( m_multiplier_operand2 == 0 ) { - if( (INT32)m_multiplier_operand1 < 0 ) + if( (int32_t)m_multiplier_operand1 < 0 ) { m_lo = 1; } @@ -1207,8 +1207,8 @@ void psxcpu_device::multiplier_update() } else { - m_lo = (INT32)m_multiplier_operand1 / (INT32)m_multiplier_operand2; - m_hi = (INT32)m_multiplier_operand1 % (INT32)m_multiplier_operand2; + m_lo = (int32_t)m_multiplier_operand1 / (int32_t)m_multiplier_operand2; + m_hi = (int32_t)m_multiplier_operand1 % (int32_t)m_multiplier_operand2; } break; @@ -1229,7 +1229,7 @@ void psxcpu_device::multiplier_update() m_multiplier_operation = MULTIPLIER_OPERATION_IDLE; } -UINT32 psxcpu_device::get_hi() +uint32_t psxcpu_device::get_hi() { if( m_multiplier_operation != MULTIPLIER_OPERATION_IDLE ) { @@ -1239,7 +1239,7 @@ UINT32 psxcpu_device::get_hi() return m_hi; } -UINT32 psxcpu_device::get_lo() +uint32_t psxcpu_device::get_lo() { if( m_multiplier_operation != MULTIPLIER_OPERATION_IDLE ) { @@ -1363,8 +1363,8 @@ void psxcpu_device::update_ram_config() break; } - UINT32 ram_size = m_ram->size(); - UINT8 *pointer = m_ram->pointer(); + uint32_t ram_size = m_ram->size(); + uint8_t *pointer = m_ram->pointer(); if( ram_size > window_size ) { @@ -1398,8 +1398,8 @@ void psxcpu_device::update_rom_config() window_size = max_window_size; } - UINT32 rom_size = m_rom->bytes(); - UINT8 *pointer = m_rom->base(); + uint32_t rom_size = m_rom->bytes(); + uint8_t *pointer = m_rom->base(); if( rom_size > window_size ) { @@ -1470,7 +1470,7 @@ void psxcpu_device::fetch_next_op() { if( m_delayr == PSXCPU_DELAYR_PC ) { - UINT32 safepc = m_delayv & ~m_bad_word_address_mask; + uint32_t safepc = m_delayv & ~m_bad_word_address_mask; m_op = m_direct->read_dword( safepc ); } @@ -1509,7 +1509,7 @@ int psxcpu_device::advance_pc() return 1; } -void psxcpu_device::load( UINT32 reg, UINT32 value ) +void psxcpu_device::load( uint32_t reg, uint32_t value ) { advance_pc(); @@ -1519,7 +1519,7 @@ void psxcpu_device::load( UINT32 reg, UINT32 value ) } } -void psxcpu_device::delayed_load( UINT32 reg, UINT32 value ) +void psxcpu_device::delayed_load( uint32_t reg, uint32_t value ) { if( m_delayr == reg ) { @@ -1533,7 +1533,7 @@ void psxcpu_device::delayed_load( UINT32 reg, UINT32 value ) m_delayv = value; } -void psxcpu_device::branch( UINT32 address ) +void psxcpu_device::branch( uint32_t address ) { advance_pc(); @@ -1565,7 +1565,7 @@ void psxcpu_device::unconditional_branch() m_delayv = ( m_pc & 0xf0000000 ) + ( INS_TARGET( m_op ) << 2 ); } -void psxcpu_device::common_exception( int exception, UINT32 romOffset, UINT32 ramOffset ) +void psxcpu_device::common_exception( int exception, uint32_t romOffset, uint32_t ramOffset ) { int cause = ( exception << 2 ) | ( ( ( m_op >> 26 ) & 3 ) << 28 ); @@ -1658,19 +1658,19 @@ void psxcpu_device::store_bus_error_exception() common_exception( EXC_DBE, 0xbfc00180, 0x80000080 ); } -void psxcpu_device::load_bad_address( UINT32 address ) +void psxcpu_device::load_bad_address( uint32_t address ) { m_cp0r[ CP0_BADA ] = address; exception( EXC_ADEL ); } -void psxcpu_device::store_bad_address( UINT32 address ) +void psxcpu_device::store_bad_address( uint32_t address ) { m_cp0r[ CP0_BADA ] = address; exception( EXC_ADES ); } -int psxcpu_device::data_address_breakpoint( int dcic_rw, int dcic_status, UINT32 address ) +int psxcpu_device::data_address_breakpoint( int dcic_rw, int dcic_status, uint32_t address ) { if( address < 0x1f000000 || address > 0x1fffffff ) { @@ -1694,12 +1694,12 @@ int psxcpu_device::data_address_breakpoint( int dcic_rw, int dcic_status, UINT32 return 0; } -int psxcpu_device::load_data_address_breakpoint( UINT32 address ) +int psxcpu_device::load_data_address_breakpoint( uint32_t address ) { return data_address_breakpoint( DCIC_DR | DCIC_DAE, DCIC_DB | DCIC_DA | DCIC_R, address ); } -int psxcpu_device::store_data_address_breakpoint( UINT32 address ) +int psxcpu_device::store_data_address_breakpoint( uint32_t address ) { return data_address_breakpoint( DCIC_DW | DCIC_DAE, DCIC_DB | DCIC_DA | DCIC_W, address ); } @@ -1747,7 +1747,7 @@ ADDRESS_MAP_END // psxcpu_device - constructor //------------------------------------------------- -psxcpu_device::psxcpu_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 ) : +psxcpu_device::psxcpu_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 ) : cpu_device( mconfig, type, name, tag, owner, clock, shortname, source ), m_program_config( "program", ENDIANNESS_LITTLE, 32, 32, 0, ADDRESS_MAP_NAME( psxcpu_internal_map ) ), m_gpu_read_handler( *this ), @@ -1761,32 +1761,32 @@ psxcpu_device::psxcpu_device( const machine_config &mconfig, device_type type, c m_disable_rom_berr = false; } -cxd8530aq_device::cxd8530aq_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +cxd8530aq_device::cxd8530aq_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : psxcpu_device( mconfig, CXD8661R, "CXD8530AQ", tag, owner, clock, "cxd8530aq", __FILE__ ) { } -cxd8530bq_device::cxd8530bq_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +cxd8530bq_device::cxd8530bq_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : psxcpu_device( mconfig, CXD8661R, "CXD8530BQ", tag, owner, clock, "cxd8530bq", __FILE__ ) { } -cxd8530cq_device::cxd8530cq_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +cxd8530cq_device::cxd8530cq_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : psxcpu_device( mconfig, CXD8661R, "CXD8530CQ", tag, owner, clock, "cxd8530cq", __FILE__ ) { } -cxd8661r_device::cxd8661r_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +cxd8661r_device::cxd8661r_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : psxcpu_device( mconfig, CXD8661R, "CXD8661R", tag, owner, clock, "cxd8661r", __FILE__ ) { } -cxd8606bq_device::cxd8606bq_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +cxd8606bq_device::cxd8606bq_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : psxcpu_device( mconfig, CXD8606BQ, "CXD8606BQ", tag, owner, clock, "cxd8606bq", __FILE__ ) { } -cxd8606cq_device::cxd8606cq_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +cxd8606cq_device::cxd8606cq_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : psxcpu_device( mconfig, CXD8606CQ, "CXD8606CQ", tag, owner, clock, "cxd8606cq", __FILE__ ) { } @@ -1968,7 +1968,7 @@ void psxcpu_device::device_reset() /// TODO: get dma to access ram through the memory map? psxdma_device *psxdma = subdevice( "dma" ); - psxdma->m_ram = (UINT32 *)m_ram->pointer(); + psxdma->m_ram = (uint32_t *)m_ram->pointer(); psxdma->m_ramsize = m_ram->size(); m_delayr = 0; @@ -2052,13 +2052,13 @@ void psxcpu_device::state_string_export( const device_state_entry &entry, std::s // helper function //------------------------------------------------- -offs_t psxcpu_device::disasm_disassemble( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options ) +offs_t psxcpu_device::disasm_disassemble( char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options ) { return DasmPSXCPU( this, buffer, pc, opram ); } -UINT32 psxcpu_device::get_register_from_pipeline( int reg ) +uint32_t psxcpu_device::get_register_from_pipeline( int reg ) { if( m_delayr == reg ) { @@ -2082,7 +2082,7 @@ int psxcpu_device::cop0_usable() void psxcpu_device::lwc( int cop, int sr_cu ) { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = load_data_address_breakpoint( address ); if( ( m_cp0r[ CP0_SR ] & sr_cu ) == 0 ) @@ -2099,7 +2099,7 @@ void psxcpu_device::lwc( int cop, int sr_cu ) } else { - UINT32 data = readword( address ); + uint32_t data = readword( address ); if( m_berr ) { @@ -2135,7 +2135,7 @@ void psxcpu_device::lwc( int cop, int sr_cu ) void psxcpu_device::swc( int cop, int sr_cu ) { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = store_data_address_breakpoint( address ); if( ( m_cp0r[ CP0_SR ] & sr_cu ) == 0 ) @@ -2148,7 +2148,7 @@ void psxcpu_device::swc( int cop, int sr_cu ) } else { - UINT32 data = 0; + uint32_t data = 0; switch( cop ) { @@ -2239,7 +2239,7 @@ void psxcpu_device::bc( int cop, int sr_cu, int condition ) void psxcpu_device::execute_set_input( int inputnum, int state ) { - UINT32 ip; + uint32_t ip; switch( inputnum ) { @@ -2315,7 +2315,7 @@ void psxcpu_device::execute_run() break; case FUNCT_SRA: - load( INS_RD( m_op ), (INT32)m_r[ INS_RT( m_op ) ] >> INS_SHAMT( m_op ) ); + load( INS_RD( m_op ), (int32_t)m_r[ INS_RT( m_op ) ] >> INS_SHAMT( m_op ) ); break; case FUNCT_SLLV: @@ -2327,7 +2327,7 @@ void psxcpu_device::execute_run() break; case FUNCT_SRAV: - load( INS_RD( m_op ), (INT32)m_r[ INS_RT( m_op ) ] >> ( m_r[ INS_RS( m_op ) ] & 31 ) ); + load( INS_RD( m_op ), (int32_t)m_r[ INS_RT( m_op ) ] >> ( m_r[ INS_RS( m_op ) ] & 31 ) ); break; case FUNCT_JR: @@ -2391,8 +2391,8 @@ void psxcpu_device::execute_run() case FUNCT_ADD: { - UINT32 result = m_r[ INS_RS( m_op ) ] + m_r[ INS_RT( m_op ) ]; - if( (INT32)( ~( m_r[ INS_RS( m_op ) ] ^ m_r[ INS_RT( m_op ) ] ) & ( m_r[ INS_RS( m_op ) ] ^ result ) ) < 0 ) + uint32_t result = m_r[ INS_RS( m_op ) ] + m_r[ INS_RT( m_op ) ]; + if( (int32_t)( ~( m_r[ INS_RS( m_op ) ] ^ m_r[ INS_RT( m_op ) ] ) & ( m_r[ INS_RS( m_op ) ] ^ result ) ) < 0 ) { exception( EXC_OVF ); } @@ -2409,8 +2409,8 @@ void psxcpu_device::execute_run() case FUNCT_SUB: { - UINT32 result = m_r[ INS_RS( m_op ) ] - m_r[ INS_RT( m_op ) ]; - if( (INT32)( ( m_r[ INS_RS( m_op ) ] ^ m_r[ INS_RT( m_op ) ] ) & ( m_r[ INS_RS( m_op ) ] ^ result ) ) < 0 ) + uint32_t result = m_r[ INS_RS( m_op ) ] - m_r[ INS_RT( m_op ) ]; + if( (int32_t)( ( m_r[ INS_RS( m_op ) ] ^ m_r[ INS_RT( m_op ) ] ) & ( m_r[ INS_RS( m_op ) ] ^ result ) ) < 0 ) { exception( EXC_OVF ); } @@ -2442,7 +2442,7 @@ void psxcpu_device::execute_run() break; case FUNCT_SLT: - load( INS_RD( m_op ), (INT32)m_r[ INS_RS( m_op ) ] < (INT32)m_r[ INS_RT( m_op ) ] ); + load( INS_RD( m_op ), (int32_t)m_r[ INS_RS( m_op ) ] < (int32_t)m_r[ INS_RT( m_op ) ] ); break; case FUNCT_SLTU: @@ -2459,7 +2459,7 @@ void psxcpu_device::execute_run() switch( INS_RT_REGIMM( m_op ) ) { case RT_BLTZ: - conditional_branch( (INT32)m_r[ INS_RS( m_op ) ] < 0 ); + conditional_branch( (int32_t)m_r[ INS_RS( m_op ) ] < 0 ); if( INS_RT( m_op ) == RT_BLTZAL ) { @@ -2468,7 +2468,7 @@ void psxcpu_device::execute_run() break; case RT_BGEZ: - conditional_branch( (INT32)m_r[ INS_RS( m_op ) ] >= 0 ); + conditional_branch( (int32_t)m_r[ INS_RS( m_op ) ] >= 0 ); if( INS_RT( m_op ) == RT_BGEZAL ) { @@ -2496,18 +2496,18 @@ void psxcpu_device::execute_run() break; case OP_BLEZ: - conditional_branch( (INT32)m_r[ INS_RS( m_op ) ] < 0 || m_r[ INS_RS( m_op ) ] == m_r[ INS_RT( m_op ) ] ); + conditional_branch( (int32_t)m_r[ INS_RS( m_op ) ] < 0 || m_r[ INS_RS( m_op ) ] == m_r[ INS_RT( m_op ) ] ); break; case OP_BGTZ: - conditional_branch( (INT32)m_r[ INS_RS( m_op ) ] >= 0 && m_r[ INS_RS( m_op ) ] != m_r[ INS_RT( m_op ) ] ); + conditional_branch( (int32_t)m_r[ INS_RS( m_op ) ] >= 0 && m_r[ INS_RS( m_op ) ] != m_r[ INS_RT( m_op ) ] ); break; case OP_ADDI: { - UINT32 immediate = PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); - UINT32 result = m_r[ INS_RS( m_op ) ] + immediate; - if( (INT32)( ~( m_r[ INS_RS( m_op ) ] ^ immediate ) & ( m_r[ INS_RS( m_op ) ] ^ result ) ) < 0 ) + uint32_t immediate = PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t result = m_r[ INS_RS( m_op ) ] + immediate; + if( (int32_t)( ~( m_r[ INS_RS( m_op ) ] ^ immediate ) & ( m_r[ INS_RS( m_op ) ] ^ result ) ) < 0 ) { exception( EXC_OVF ); } @@ -2523,11 +2523,11 @@ void psxcpu_device::execute_run() break; case OP_SLTI: - load( INS_RT( m_op ), (INT32)m_r[ INS_RS( m_op ) ] < PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ) ); + load( INS_RT( m_op ), (int32_t)m_r[ INS_RS( m_op ) ] < PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ) ); break; case OP_SLTIU: - load( INS_RT( m_op ), m_r[ INS_RS( m_op ) ] < (UINT32)PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ) ); + load( INS_RT( m_op ), m_r[ INS_RS( m_op ) ] < (uint32_t)PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ) ); break; case OP_ANDI: @@ -2595,7 +2595,7 @@ void psxcpu_device::execute_run() { if( cop0_usable() ) { - UINT32 data = ( m_cp0r[ reg ] & ~mtc0_writemask[ reg ] ) | + uint32_t data = ( m_cp0r[ reg ] & ~mtc0_writemask[ reg ] ) | ( m_r[ INS_RT( m_op ) ] & mtc0_writemask[ reg ] ); advance_pc(); @@ -2824,7 +2824,7 @@ void psxcpu_device::execute_run() case OP_LB: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = load_data_address_breakpoint( address ); if( ( address & m_bad_byte_address_mask ) != 0 ) @@ -2837,7 +2837,7 @@ void psxcpu_device::execute_run() } else { - UINT32 data = PSXCPU_BYTE_EXTEND( readbyte( address ) ); + uint32_t data = PSXCPU_BYTE_EXTEND( readbyte( address ) ); if( m_berr ) { @@ -2853,7 +2853,7 @@ void psxcpu_device::execute_run() case OP_LH: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = load_data_address_breakpoint( address ); if( ( address & m_bad_half_address_mask ) != 0 ) @@ -2866,7 +2866,7 @@ void psxcpu_device::execute_run() } else { - UINT32 data = PSXCPU_WORD_EXTEND( readhalf( address ) ); + uint32_t data = PSXCPU_WORD_EXTEND( readhalf( address ) ); if( m_berr ) { @@ -2882,7 +2882,7 @@ void psxcpu_device::execute_run() case OP_LWL: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int load_type = address & 3; int breakpoint; @@ -2899,7 +2899,7 @@ void psxcpu_device::execute_run() } else { - UINT32 data = get_register_from_pipeline( INS_RT( m_op ) ); + uint32_t data = get_register_from_pipeline( INS_RT( m_op ) ); switch( load_type ) { @@ -2934,7 +2934,7 @@ void psxcpu_device::execute_run() case OP_LW: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = load_data_address_breakpoint( address ); if( ( address & m_bad_word_address_mask ) != 0 ) @@ -2947,7 +2947,7 @@ void psxcpu_device::execute_run() } else { - UINT32 data = readword( address ); + uint32_t data = readword( address ); if( m_berr ) { @@ -2963,7 +2963,7 @@ void psxcpu_device::execute_run() case OP_LBU: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = load_data_address_breakpoint( address ); if( ( address & m_bad_byte_address_mask ) != 0 ) @@ -2976,7 +2976,7 @@ void psxcpu_device::execute_run() } else { - UINT32 data = readbyte( address ); + uint32_t data = readbyte( address ); if( m_berr ) { @@ -2992,7 +2992,7 @@ void psxcpu_device::execute_run() case OP_LHU: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = load_data_address_breakpoint( address ); if( ( address & m_bad_half_address_mask ) != 0 ) @@ -3005,7 +3005,7 @@ void psxcpu_device::execute_run() } else { - UINT32 data = readhalf( address ); + uint32_t data = readhalf( address ); if( m_berr ) { @@ -3021,7 +3021,7 @@ void psxcpu_device::execute_run() case OP_LWR: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = load_data_address_breakpoint( address ); if( ( address & m_bad_byte_address_mask ) != 0 ) @@ -3034,7 +3034,7 @@ void psxcpu_device::execute_run() } else { - UINT32 data = get_register_from_pipeline( INS_RT( m_op ) ); + uint32_t data = get_register_from_pipeline( INS_RT( m_op ) ); switch( address & 3 ) { @@ -3069,7 +3069,7 @@ void psxcpu_device::execute_run() case OP_SB: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = store_data_address_breakpoint( address ); if( ( address & m_bad_byte_address_mask ) != 0 ) @@ -3099,7 +3099,7 @@ void psxcpu_device::execute_run() case OP_SH: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = store_data_address_breakpoint( address ); if( ( address & m_bad_half_address_mask ) != 0 ) @@ -3129,7 +3129,7 @@ void psxcpu_device::execute_run() case OP_SWL: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int save_type = address & 3; int breakpoint; @@ -3179,7 +3179,7 @@ void psxcpu_device::execute_run() case OP_SW: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = store_data_address_breakpoint( address ); if( ( address & m_bad_word_address_mask ) != 0 ) @@ -3208,7 +3208,7 @@ void psxcpu_device::execute_run() case OP_SWR: { - UINT32 address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); + uint32_t address = m_r[ INS_RS( m_op ) ] + PSXCPU_WORD_EXTEND( INS_IMMEDIATE( m_op ) ); int breakpoint = store_data_address_breakpoint( address ); if( ( address & m_bad_byte_address_mask ) != 0 ) @@ -3296,30 +3296,30 @@ void psxcpu_device::execute_run() } while( m_icount > 0 ); } -UINT32 psxcpu_device::getcp1dr( int reg ) +uint32_t psxcpu_device::getcp1dr( int reg ) { /* if a mtc/ctc precedes then this will get the value moved (which cop1 register is irrelevant). */ /* if a mfc/cfc follows then it will get the same value as this one. */ return m_program->read_dword( m_pc + 4 ); } -void psxcpu_device::setcp1dr( int reg, UINT32 value ) +void psxcpu_device::setcp1dr( int reg, uint32_t value ) { } -UINT32 psxcpu_device::getcp1cr( int reg ) +uint32_t psxcpu_device::getcp1cr( int reg ) { /* if a mtc/ctc precedes then this will get the value moved (which cop1 register is irrelevant). */ /* if a mfc/cfc follows then it will get the same value as this one. */ return m_program->read_dword( m_pc + 4 ); } -void psxcpu_device::setcp1cr( int reg, UINT32 value ) +void psxcpu_device::setcp1cr( int reg, uint32_t value ) { } -UINT32 psxcpu_device::getcp3dr( int reg ) +uint32_t psxcpu_device::getcp3dr( int reg ) { /* if you have mtc/ctc with an mfc/cfc directly afterwards then you get the value that was moved. */ /* if you have an lwc with an mfc/cfc somewhere after it then you get the value that is loaded */ @@ -3327,11 +3327,11 @@ UINT32 psxcpu_device::getcp3dr( int reg ) return m_program->read_dword( m_pc + 4 ); } -void psxcpu_device::setcp3dr( int reg, UINT32 value ) +void psxcpu_device::setcp3dr( int reg, uint32_t value ) { } -UINT32 psxcpu_device::getcp3cr( int reg ) +uint32_t psxcpu_device::getcp3cr( int reg ) { /* if you have mtc/ctc with an mfc/cfc directly afterwards then you get the value that was moved. */ /* if you have an lwc with an mfc/cfc somewhere after it then you get the value that is loaded */ @@ -3339,7 +3339,7 @@ UINT32 psxcpu_device::getcp3cr( int reg ) return m_program->read_dword( m_pc + 4 ); } -void psxcpu_device::setcp3cr( int reg, UINT32 value ) +void psxcpu_device::setcp3cr( int reg, uint32_t value ) { } diff --git a/src/devices/cpu/psx/psx.h b/src/devices/cpu/psx/psx.h index 98b15819f32..f08eedffc3a 100644 --- a/src/devices/cpu/psx/psx.h +++ b/src/devices/cpu/psx/psx.h @@ -140,10 +140,10 @@ class psxcpu_state public: virtual ~psxcpu_state() {}; - virtual UINT32 pc() = 0; - virtual UINT32 delayr() = 0; - virtual UINT32 delayv() = 0; - virtual UINT32 r(int i) = 0; + virtual uint32_t pc() = 0; + virtual uint32_t delayr() = 0; + virtual uint32_t delayv() = 0; + virtual uint32_t r(int i) = 0; }; // ======================> psxcpu_device @@ -167,7 +167,7 @@ public: DECLARE_WRITE32_MEMBER( berr_w ); DECLARE_READ32_MEMBER( berr_r ); - UINT32 exp_base(); + uint32_t exp_base(); DECLARE_WRITE32_MEMBER( exp_base_w ); DECLARE_READ32_MEMBER( exp_base_r ); @@ -200,7 +200,7 @@ public: void set_disable_rom_berr(bool mode); protected: - psxcpu_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); + psxcpu_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-level overrides virtual void device_start() override; @@ -209,11 +209,11 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 40; } - virtual UINT32 execute_input_lines() const override { return 6; } - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return ( clocks + 3 ) / 4; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return cycles * 4; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 40; } + virtual uint32_t execute_input_lines() const override { return 6; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return ( clocks + 3 ) / 4; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return cycles * 4; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -225,19 +225,19 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // CPU registers - UINT32 m_pc; - UINT32 m_r[ 32 ]; - UINT32 m_cp0r[ 16 ]; - UINT32 m_hi; - UINT32 m_lo; + uint32_t m_pc; + uint32_t m_r[ 32 ]; + uint32_t m_cp0r[ 16 ]; + uint32_t m_hi; + uint32_t m_lo; // internal stuff - UINT32 m_op; + uint32_t m_op; // address spaces const address_space_config m_program_config; @@ -246,36 +246,36 @@ protected: // other internal states int m_icount; - UINT32 m_com_delay; - UINT32 m_delayv; - UINT32 m_delayr; - UINT32 m_berr; - UINT32 m_biu; - UINT32 m_icacheTag[ ICACHE_ENTRIES / 4 ]; - UINT32 m_icache[ ICACHE_ENTRIES ]; - UINT32 m_dcache[ DCACHE_ENTRIES ]; + uint32_t m_com_delay; + uint32_t m_delayv; + uint32_t m_delayr; + uint32_t m_berr; + uint32_t m_biu; + uint32_t m_icacheTag[ ICACHE_ENTRIES / 4 ]; + uint32_t m_icache[ ICACHE_ENTRIES ]; + uint32_t m_dcache[ DCACHE_ENTRIES ]; int m_multiplier_operation; - UINT32 m_multiplier_operand1; - UINT32 m_multiplier_operand2; + uint32_t m_multiplier_operand1; + uint32_t m_multiplier_operand2; int m_bus_attached; - UINT32 m_bad_byte_address_mask; - UINT32 m_bad_half_address_mask; - UINT32 m_bad_word_address_mask; - UINT32 m_exp_base; - UINT32 m_exp_config; - UINT32 m_ram_config; - UINT32 m_rom_config; + uint32_t m_bad_byte_address_mask; + uint32_t m_bad_half_address_mask; + uint32_t m_bad_word_address_mask; + uint32_t m_exp_base; + uint32_t m_exp_config; + uint32_t m_ram_config; + uint32_t m_rom_config; void stop(); - UINT32 cache_readword( UINT32 offset ); - void cache_writeword( UINT32 offset, UINT32 data ); - UINT8 readbyte( UINT32 address ); - UINT16 readhalf( UINT32 address ); - UINT32 readword( UINT32 address ); - UINT32 readword_masked( UINT32 address, UINT32 mask ); - void writeword( UINT32 address, UINT32 data ); - void writeword_masked( UINT32 address, UINT32 data, UINT32 mask ); - UINT32 log_bioscall_parameter( int parm ); + uint32_t cache_readword( uint32_t offset ); + void cache_writeword( uint32_t offset, uint32_t data ); + uint8_t readbyte( uint32_t address ); + uint16_t readhalf( uint32_t address ); + uint32_t readword( uint32_t address ); + uint32_t readword_masked( uint32_t address, uint32_t mask ); + void writeword( uint32_t address, uint32_t data ); + void writeword_masked( uint32_t address, uint32_t data, uint32_t mask ); + uint32_t log_bioscall_parameter( int parm ); const char *log_bioscall_string( int parm ); const char *log_bioscall_hex( int parm ); const char *log_bioscall_char( int parm ); @@ -289,8 +289,8 @@ protected: void funct_div(); void funct_divu(); void multiplier_update(); - UINT32 get_hi(); - UINT32 get_lo(); + uint32_t get_hi(); + uint32_t get_lo(); int execute_unstoppable_instructions( int executeCop2 ); void update_address_masks(); void update_scratchpad(); @@ -301,37 +301,37 @@ protected: void set_pc( unsigned pc ); void fetch_next_op(); int advance_pc(); - void load( UINT32 reg, UINT32 value ); - void delayed_load( UINT32 reg, UINT32 value ); - void branch( UINT32 address ); + void load( uint32_t reg, uint32_t value ); + void delayed_load( uint32_t reg, uint32_t value ); + void branch( uint32_t address ); void conditional_branch( int takeBranch ); void unconditional_branch(); - void common_exception( int exception, UINT32 romOffset, UINT32 ramOffset ); + void common_exception( int exception, uint32_t romOffset, uint32_t ramOffset ); void exception( int exception ); void breakpoint_exception(); void fetch_bus_error_exception(); void load_bus_error_exception(); void store_bus_error_exception(); - void load_bad_address( UINT32 address ); - void store_bad_address( UINT32 address ); - int data_address_breakpoint( int dcic_rw, int dcic_status, UINT32 address ); - int load_data_address_breakpoint( UINT32 address ); - int store_data_address_breakpoint( UINT32 address ); + void load_bad_address( uint32_t address ); + void store_bad_address( uint32_t address ); + int data_address_breakpoint( int dcic_rw, int dcic_status, uint32_t address ); + int load_data_address_breakpoint( uint32_t address ); + int store_data_address_breakpoint( uint32_t address ); - UINT32 get_register_from_pipeline( int reg ); + uint32_t get_register_from_pipeline( int reg ); int cop0_usable(); void lwc( int cop, int sr_cu ); void swc( int cop, int sr_cu ); void bc( int cop, int sr_cu, int condition ); - UINT32 getcp1dr( int reg ); - void setcp1dr( int reg, UINT32 value ); - UINT32 getcp1cr( int reg ); - void setcp1cr( int reg, UINT32 value ); - UINT32 getcp3dr( int reg ); - void setcp3dr( int reg, UINT32 value ); - UINT32 getcp3cr( int reg ); - void setcp3cr( int reg, UINT32 value ); + uint32_t getcp1dr( int reg ); + void setcp1dr( int reg, uint32_t value ); + uint32_t getcp1cr( int reg ); + void setcp1cr( int reg, uint32_t value ); + uint32_t getcp3dr( int reg ); + void setcp3dr( int reg, uint32_t value ); + uint32_t getcp3cr( int reg ); + void setcp3cr( int reg, uint32_t value ); gte m_gte; @@ -347,52 +347,52 @@ protected: private: // disassembler interface - virtual UINT32 pc() override { return m_pc; } - virtual UINT32 delayr() override { return m_delayr; } - virtual UINT32 delayv() override { return m_delayv; } - virtual UINT32 r(int i) override { return m_r[ i ]; } + virtual uint32_t pc() override { return m_pc; } + virtual uint32_t delayr() override { return m_delayr; } + virtual uint32_t delayv() override { return m_delayv; } + virtual uint32_t r(int i) override { return m_r[ i ]; } }; class cxd8530aq_device : public psxcpu_device { public: // construction/destruction - cxd8530aq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8530aq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8530bq_device : public psxcpu_device { public: // construction/destruction - cxd8530bq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8530bq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8530cq_device : public psxcpu_device { public: // construction/destruction - cxd8530cq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8530cq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8661r_device : public psxcpu_device { public: // construction/destruction - cxd8661r_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8661r_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8606bq_device : public psxcpu_device { public: // construction/destruction - cxd8606bq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8606bq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8606cq_device : public psxcpu_device { public: // construction/destruction - cxd8606cq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8606cq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // device type definition @@ -408,8 +408,8 @@ extern const device_type CXD8606CQ; #define PSXCPU_DELAYR_PC ( 32 ) #define PSXCPU_DELAYR_NOTPC ( 33 ) -#define PSXCPU_BYTE_EXTEND( a ) ( (INT32)(INT8)a ) -#define PSXCPU_WORD_EXTEND( a ) ( (INT32)(INT16)a ) +#define PSXCPU_BYTE_EXTEND( a ) ( (int32_t)(int8_t)a ) +#define PSXCPU_WORD_EXTEND( a ) ( (int32_t)(int16_t)a ) #define INS_OP( op ) ( ( op >> 26 ) & 63 ) #define INS_RS( op ) ( ( op >> 21 ) & 31 ) @@ -522,6 +522,6 @@ extern const device_type CXD8606CQ; #define CF_TLBP ( 8 ) #define CF_RFE ( 16 ) -extern unsigned DasmPSXCPU( psxcpu_state *state, char *buffer, UINT32 pc, const UINT8 *opram ); +extern unsigned DasmPSXCPU( psxcpu_state *state, char *buffer, uint32_t pc, const uint8_t *opram ); #endif /* __PSXCPU_H__ */ diff --git a/src/devices/cpu/psx/psxdasm.cpp b/src/devices/cpu/psx/psxdasm.cpp index bfa1c546835..1eea78c11a3 100644 --- a/src/devices/cpu/psx/psxdasm.cpp +++ b/src/devices/cpu/psx/psxdasm.cpp @@ -9,7 +9,7 @@ #include "psx.h" #include "gte.h" -static char *make_signed_hex_str_16( UINT32 value ) +static char *make_signed_hex_str_16( uint32_t value ) { static char s_hex[ 20 ]; @@ -122,23 +122,23 @@ static const char *const s_gtelm[] = " lm=s16", " lm=u15" }; -static char *effective_address( psxcpu_state *state, UINT32 pc, UINT32 op ) +static char *effective_address( psxcpu_state *state, uint32_t pc, uint32_t op ) { static char s_address[ 30 ]; if( state != nullptr && state->pc() == pc ) { sprintf( s_address, "%s(%s) ; 0x%08x", make_signed_hex_str_16( INS_IMMEDIATE( op ) ), s_cpugenreg[ INS_RS( op ) ], - (UINT32)( state->r( INS_RS( op ) ) + (INT16)INS_IMMEDIATE( op ) ) ); + (uint32_t)( state->r( INS_RS( op ) ) + (int16_t)INS_IMMEDIATE( op ) ) ); return s_address; } sprintf( s_address, "%s(%s)", make_signed_hex_str_16( INS_IMMEDIATE( op ) ), s_cpugenreg[ INS_RS( op ) ] ); return s_address; } -static UINT32 relative_address( psxcpu_state *state, UINT32 pc, UINT32 op ) +static uint32_t relative_address( psxcpu_state *state, uint32_t pc, uint32_t op ) { - UINT32 nextpc = pc + 4; + uint32_t nextpc = pc + 4; if( state != nullptr && state->pc() == pc && state->delayr() == PSXCPU_DELAYR_PC ) { nextpc = state->delayv(); @@ -147,9 +147,9 @@ static UINT32 relative_address( psxcpu_state *state, UINT32 pc, UINT32 op ) return nextpc + ( PSXCPU_WORD_EXTEND( INS_IMMEDIATE( op ) ) << 2 ); } -static UINT32 jump_address( psxcpu_state *state, UINT32 pc, UINT32 op ) +static uint32_t jump_address( psxcpu_state *state, uint32_t pc, uint32_t op ) { - UINT32 nextpc = pc + 4; + uint32_t nextpc = pc + 4; if( state != nullptr && state->pc() == pc && state->delayr() == PSXCPU_DELAYR_PC ) { nextpc = state->delayv(); @@ -157,15 +157,15 @@ static UINT32 jump_address( psxcpu_state *state, UINT32 pc, UINT32 op ) return ( nextpc & 0xf0000000 ) + ( INS_TARGET( op ) << 2 ); } -static UINT32 fetch_op( const UINT8 *opram ) +static uint32_t fetch_op( const uint8_t *opram ) { return ( opram[ 3 ] << 24 ) | ( opram[ 2 ] << 16 ) | ( opram[ 1 ] << 8 ) | ( opram[ 0 ] << 0 ); } -static char *upper_address( UINT32 op, const UINT8 *opram ) +static char *upper_address( uint32_t op, const uint8_t *opram ) { static char s_address[ 20 ]; - UINT32 nextop = fetch_op( opram ); + uint32_t nextop = fetch_op( opram ); if( INS_OP( nextop ) == OP_ORI && INS_RT( op ) == INS_RS( nextop ) ) { @@ -173,7 +173,7 @@ static char *upper_address( UINT32 op, const UINT8 *opram ) } else if( INS_OP( nextop ) == OP_ADDIU && INS_RT( op ) == INS_RS( nextop ) ) { - sprintf( s_address, "$%04x ; 0x%08x", INS_IMMEDIATE( op ), ( INS_IMMEDIATE( op ) << 16 ) + (INT16) INS_IMMEDIATE( nextop ) ); + sprintf( s_address, "$%04x ; 0x%08x", INS_IMMEDIATE( op ), ( INS_IMMEDIATE( op ) << 16 ) + (int16_t) INS_IMMEDIATE( nextop ) ); } else { @@ -183,11 +183,11 @@ static char *upper_address( UINT32 op, const UINT8 *opram ) return s_address; } -unsigned DasmPSXCPU( psxcpu_state *state, char *buffer, UINT32 pc, const UINT8 *opram ) +unsigned DasmPSXCPU( psxcpu_state *state, char *buffer, uint32_t pc, const uint8_t *opram ) { - UINT32 op; - const UINT8 *oldopram; - UINT32 flags = 0; + uint32_t op; + const uint8_t *oldopram; + uint32_t flags = 0; oldopram = opram; op = fetch_op( opram ); diff --git a/src/devices/cpu/psx/rcnt.cpp b/src/devices/cpu/psx/rcnt.cpp index f3e34a7cff8..c54af348ade 100644 --- a/src/devices/cpu/psx/rcnt.cpp +++ b/src/devices/cpu/psx/rcnt.cpp @@ -26,7 +26,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, c const device_type PSX_RCNT = &device_creator; -psxrcnt_device::psxrcnt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psxrcnt_device::psxrcnt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PSX_RCNT, "Sony PSX RCNT", tag, owner, clock, "psxrcnt", __FILE__), m_irq0_handler(*this), m_irq1_handler(*this), @@ -118,7 +118,7 @@ READ32_MEMBER( psxrcnt_device::read ) { int n_counter = offset / 4; psx_root *root = &root_counter[ n_counter ]; - UINT32 data; + uint32_t data; switch( offset % 4 ) { @@ -139,7 +139,7 @@ READ32_MEMBER( psxrcnt_device::read ) return data; } -UINT64 psxrcnt_device::gettotalcycles( void ) +uint64_t psxrcnt_device::gettotalcycles( void ) { /* TODO: should return the start of the current tick. */ return ((cpu_device *)owner())->total_cycles() * 2; @@ -165,7 +165,7 @@ int psxrcnt_device::root_divider( int n_counter ) return 1; } -UINT16 psxrcnt_device::root_current( int n_counter ) +uint16_t psxrcnt_device::root_current( int n_counter ) { psx_root *root = &root_counter[ n_counter ]; @@ -175,7 +175,7 @@ UINT16 psxrcnt_device::root_current( int n_counter ) } else { - UINT64 n_current; + uint64_t n_current; n_current = gettotalcycles() - root->n_start; n_current /= root_divider( n_counter ); n_current += root->n_count; diff --git a/src/devices/cpu/psx/rcnt.h b/src/devices/cpu/psx/rcnt.h index b3b610ed8a8..69af108c44d 100644 --- a/src/devices/cpu/psx/rcnt.h +++ b/src/devices/cpu/psx/rcnt.h @@ -34,16 +34,16 @@ extern const device_type PSX_RCNT; struct psx_root { emu_timer *timer; - UINT16 n_count; - UINT16 n_mode; - UINT16 n_target; - UINT64 n_start; + uint16_t n_count; + uint16_t n_mode; + uint16_t n_target; + uint64_t n_start; }; class psxrcnt_device : public device_t { public: - psxrcnt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psxrcnt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_irq0_handler(device_t &device, _Object object) { return downcast(device).m_irq0_handler.set_callback(object); } @@ -62,9 +62,9 @@ protected: private: psx_root root_counter[ 3 ]; - UINT64 gettotalcycles( void ); + uint64_t gettotalcycles( void ); int root_divider( int n_counter ); - UINT16 root_current( int n_counter ); + uint16_t root_current( int n_counter ); int root_target( int n_counter ); void root_timer_adjust( int n_counter ); diff --git a/src/devices/cpu/psx/sio.cpp b/src/devices/cpu/psx/sio.cpp index ba057dd01e1..e3fe2924ea5 100644 --- a/src/devices/cpu/psx/sio.cpp +++ b/src/devices/cpu/psx/sio.cpp @@ -27,17 +27,17 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, c const device_type PSX_SIO0 = &device_creator; const device_type PSX_SIO1 = &device_creator; -psxsio0_device::psxsio0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psxsio0_device::psxsio0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psxsio_device(mconfig, PSX_SIO0, "Sony PSX SIO-0", tag, owner, clock, "psxsio0", __FILE__) { } -psxsio1_device::psxsio1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +psxsio1_device::psxsio1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psxsio_device(mconfig, PSX_SIO1, "Sony PSX SIO-1", tag, owner, clock, "psxsio1", __FILE__) { } -psxsio_device::psxsio_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) : +psxsio_device::psxsio_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_status(SIO_STATUS_TX_EMPTY | SIO_STATUS_TX_RDY), m_mode(0), m_control(0), m_baud(0), m_rxd(1), m_tx_data(0), m_rx_data(0), m_tx_shift(0), m_rx_shift(0), m_tx_bits(0), m_rx_bits(0), m_timer(nullptr), @@ -286,7 +286,7 @@ WRITE32_MEMBER( psxsio_device::write ) READ32_MEMBER( psxsio_device::read ) { - UINT32 data; + uint32_t data; switch( offset % 4 ) { diff --git a/src/devices/cpu/psx/sio.h b/src/devices/cpu/psx/sio.h index 93d8428bc9e..d8516b799e2 100644 --- a/src/devices/cpu/psx/sio.h +++ b/src/devices/cpu/psx/sio.h @@ -52,7 +52,7 @@ extern const device_type PSX_SIO1; class psxsio_device : public device_t { public: - psxsio_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); + psxsio_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_irq_handler(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } @@ -77,17 +77,17 @@ private: void sio_interrupt(); void sio_timer_adjust(); - UINT32 m_status; - UINT32 m_mode; - UINT32 m_control; - UINT32 m_baud; + uint32_t m_status; + uint32_t m_mode; + uint32_t m_control; + uint32_t m_baud; int m_rxd; - UINT32 m_tx_data; - UINT32 m_rx_data; - UINT32 m_tx_shift; - UINT32 m_rx_shift; - UINT32 m_tx_bits; - UINT32 m_rx_bits; + uint32_t m_tx_data; + uint32_t m_rx_data; + uint32_t m_tx_shift; + uint32_t m_rx_shift; + uint32_t m_tx_bits; + uint32_t m_rx_bits; emu_timer *m_timer; @@ -101,13 +101,13 @@ private: class psxsio0_device : public psxsio_device { public: - psxsio0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psxsio0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class psxsio1_device : public psxsio_device { public: - psxsio1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + psxsio1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; #endif diff --git a/src/devices/cpu/rsp/rsp.cpp b/src/devices/cpu/rsp/rsp.cpp index b3ddbda9686..98cef6ff670 100644 --- a/src/devices/cpu/rsp/rsp.cpp +++ b/src/devices/cpu/rsp/rsp.cpp @@ -23,20 +23,20 @@ const device_type RSP = &device_creator; #define RSP_TEST_SYNC 0 #define PRINT_VECREG(x) osd_printf_debug("V%d: %04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X\n", (x), \ - (UINT16)VREG_S((x),0), (UINT16)VREG_S((x),1), \ - (UINT16)VREG_S((x),2), (UINT16)VREG_S((x),3), \ - (UINT16)VREG_S((x),4), (UINT16)VREG_S((x),5), \ - (UINT16)VREG_S((x),6), (UINT16)VREG_S((x),7)) + (uint16_t)VREG_S((x),0), (uint16_t)VREG_S((x),1), \ + (uint16_t)VREG_S((x),2), (uint16_t)VREG_S((x),3), \ + (uint16_t)VREG_S((x),4), (uint16_t)VREG_S((x),5), \ + (uint16_t)VREG_S((x),6), (uint16_t)VREG_S((x),7)) #define PRINT_ACCUM(x) osd_printf_debug("A%d: %08X|%08X\n", (x), \ - (UINT32)( ( ACCUM(x) >> 32 ) & 0x00000000ffffffff ), \ - (UINT32)( ACCUM(x) & 0x00000000ffffffff )) + (uint32_t)( ( ACCUM(x) >> 32 ) & 0x00000000ffffffff ), \ + (uint32_t)( ACCUM(x) & 0x00000000ffffffff )) -extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); +extern offs_t rsp_dasm_one(char *buffer, offs_t pc, uint32_t op); -#define SIMM16 ((INT32)(INT16)(op)) -#define UIMM16 ((UINT16)(op)) +#define SIMM16 ((int32_t)(int16_t)(op)) +#define UIMM16 ((uint16_t)(op)) #define UIMM26 (op & 0x03ffffff) #define RSVAL (m_rsp_state->r[RSREG]) @@ -98,7 +98,7 @@ extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); #define CACHE_SIZE (32 * 1024 * 1024) -rsp_device::rsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rsp_device::rsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, RSP, "RSP", tag, owner, clock, "rsp", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 32, 32) , m_cache(CACHE_SIZE + sizeof(internal_rsp_state)) @@ -141,36 +141,36 @@ rsp_device::rsp_device(const machine_config &mconfig, const char *tag, device_t { } -offs_t rsp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t rsp_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( rsp ); return CPU_DISASSEMBLE_NAME( rsp )(this, buffer, pc, oprom, opram, options); } -void rsp_device::rsp_add_imem(UINT32 *base) +void rsp_device::rsp_add_imem(uint32_t *base) { m_imem32 = base; - m_imem16 = (UINT16*)base; - m_imem8 = (UINT8*)base; + m_imem16 = (uint16_t*)base; + m_imem8 = (uint8_t*)base; } -void rsp_device::rsp_add_dmem(UINT32 *base) +void rsp_device::rsp_add_dmem(uint32_t *base) { m_dmem32 = base; - m_dmem16 = (UINT16*)base; - m_dmem8 = (UINT8*)base; + m_dmem16 = (uint16_t*)base; + m_dmem8 = (uint8_t*)base; } -UINT8 rsp_device::DM_READ8(UINT32 address) +uint8_t rsp_device::DM_READ8(uint32_t address) { - UINT8 ret = m_dmem8[BYTE4_XOR_BE(address & 0xfff)]; + uint8_t ret = m_dmem8[BYTE4_XOR_BE(address & 0xfff)]; //printf("R8:%08x=%02x\n", address, ret); return ret; } -UINT16 rsp_device::DM_READ16(UINT32 address) +uint16_t rsp_device::DM_READ16(uint32_t address) { - UINT16 ret; + uint16_t ret; address &= 0xfff; ret = m_dmem8[BYTE4_XOR_BE(address)] << 8; ret |= m_dmem8[BYTE4_XOR_BE(address + 1)]; @@ -178,9 +178,9 @@ UINT16 rsp_device::DM_READ16(UINT32 address) return ret; } -UINT32 rsp_device::DM_READ32(UINT32 address) +uint32_t rsp_device::DM_READ32(uint32_t address) { - UINT32 ret; + uint32_t ret; address &= 0xfff; ret = m_dmem8[BYTE4_XOR_BE(address)] << 24; ret |= m_dmem8[BYTE4_XOR_BE(address + 1)] << 16; @@ -190,14 +190,14 @@ UINT32 rsp_device::DM_READ32(UINT32 address) return ret; } -void rsp_device::DM_WRITE8(UINT32 address, UINT8 data) +void rsp_device::DM_WRITE8(uint32_t address, uint8_t data) { address &= 0xfff; m_dmem8[BYTE4_XOR_BE(address)] = data; //printf("W8:%08x=%02x\n", address, data); } -void rsp_device::DM_WRITE16(UINT32 address, UINT16 data) +void rsp_device::DM_WRITE16(uint32_t address, uint16_t data) { address &= 0xfff; m_dmem8[BYTE4_XOR_BE(address)] = data >> 8; @@ -205,7 +205,7 @@ void rsp_device::DM_WRITE16(UINT32 address, UINT16 data) //printf("W16:%08x=%04x\n", address, data); } -void rsp_device::DM_WRITE32(UINT32 address, UINT32 data) +void rsp_device::DM_WRITE32(uint32_t address, uint32_t data) { address &= 0xfff; m_dmem8[BYTE4_XOR_BE(address)] = data >> 24; @@ -215,18 +215,18 @@ void rsp_device::DM_WRITE32(UINT32 address, UINT32 data) //printf("W32:%08x=%08x\n", address, data); } -UINT8 rsp_device::READ8(UINT32 address) +uint8_t rsp_device::READ8(uint32_t address) { - UINT8 ret; + uint8_t ret; address &= 0xfff; ret = m_program->read_byte(address); //printf("R8:%08x=%02x\n", address, ret); return ret; } -UINT16 rsp_device::READ16(UINT32 address) +uint16_t rsp_device::READ16(uint32_t address) { - UINT16 ret; + uint16_t ret; address &= 0xfff; ret = (m_program->read_byte(address) << 8) | (m_program->read_byte(address + 1) & 0xff); @@ -235,9 +235,9 @@ UINT16 rsp_device::READ16(UINT32 address) return ret; } -UINT32 rsp_device::READ32(UINT32 address) +uint32_t rsp_device::READ32(uint32_t address) { - UINT32 ret; + uint32_t ret; address &= 0xfff; ret = (m_program->read_byte(address) << 24) | @@ -249,14 +249,14 @@ UINT32 rsp_device::READ32(UINT32 address) return ret; } -void rsp_device::WRITE8(UINT32 address, UINT8 data) +void rsp_device::WRITE8(uint32_t address, uint8_t data) { address &= 0xfff; m_program->write_byte(address, data); //printf("W8:%08x=%02x\n", address, data); } -void rsp_device::WRITE16(UINT32 address, UINT16 data) +void rsp_device::WRITE16(uint32_t address, uint16_t data) { address &= 0xfff; @@ -265,7 +265,7 @@ void rsp_device::WRITE16(UINT32 address, UINT16 data) //printf("W16:%08x=%04x\n", address, data); } -void rsp_device::WRITE32(UINT32 address, UINT32 data) +void rsp_device::WRITE32(uint32_t address, uint32_t data) { address &= 0xfff; @@ -278,7 +278,7 @@ void rsp_device::WRITE32(UINT32 address, UINT32 data) /*****************************************************************************/ -UINT32 rsp_device::get_cop0_reg(int reg) +uint32_t rsp_device::get_cop0_reg(int reg) { reg &= 0xf; if (reg < 8) @@ -293,7 +293,7 @@ UINT32 rsp_device::get_cop0_reg(int reg) return 0; } -void rsp_device::set_cop0_reg(int reg, UINT32 data) +void rsp_device::set_cop0_reg(int reg, uint32_t data) { reg &= 0xf; if (reg < 8) @@ -306,7 +306,7 @@ void rsp_device::set_cop0_reg(int reg, UINT32 data) } } -void rsp_device::unimplemented_opcode(UINT32 op) +void rsp_device::unimplemented_opcode(uint32_t op) { if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) { @@ -324,7 +324,7 @@ void rsp_device::unimplemented_opcode(UINT32 op) for (i=0; i < 0x1000; i+=4) { - UINT32 opcode = ROPCODE(0x04001000 + i); + uint32_t opcode = ROPCODE(0x04001000 + i); rsp_dasm_one(string, 0x04001000 + i, opcode); fprintf(dasm, "%08X: %08X %s\n", 0x04001000 + i, opcode, string); } @@ -392,7 +392,7 @@ void rsp_device::device_start() m_step_count = 0; /* initialize the UML generator */ - UINT32 drc_flags = 0; + uint32_t drc_flags = 0; m_drcuml = std::make_unique(*this, m_cache, drc_flags, 8, 32, 2); /* add symbols for our stuff */ @@ -563,7 +563,7 @@ void rsp_device::device_stop() for (i=0; i < 0x1000; i+=4) { - UINT32 opcode = ROPCODE(0x04001000 + i); + uint32_t opcode = ROPCODE(0x04001000 + i); rsp_dasm_one(string, 0x04001000 + i, opcode); fprintf(dasm, "%08X: %08X %s\n", 0x04001000 + i, opcode, string); } @@ -623,7 +623,7 @@ void rsp_device::execute_run() m_ppc = m_rsp_state->pc; debugger_instruction_hook(this, m_rsp_state->pc); - UINT32 op = ROPCODE(m_rsp_state->pc); + uint32_t op = ROPCODE(m_rsp_state->pc); if (m_nextpc != ~0) { m_rsp_state->pc = m_nextpc; @@ -640,12 +640,12 @@ void rsp_device::execute_run() { switch (op & 0x3f) { - case 0x00: /* SLL */ if (RDREG) RDVAL = (UINT32)RTVAL << SHIFT; break; - case 0x02: /* SRL */ if (RDREG) RDVAL = (UINT32)RTVAL >> SHIFT; break; - case 0x03: /* SRA */ if (RDREG) RDVAL = (INT32)RTVAL >> SHIFT; break; - case 0x04: /* SLLV */ if (RDREG) RDVAL = (UINT32)RTVAL << (RSVAL & 0x1f); break; - case 0x06: /* SRLV */ if (RDREG) RDVAL = (UINT32)RTVAL >> (RSVAL & 0x1f); break; - case 0x07: /* SRAV */ if (RDREG) RDVAL = (INT32)RTVAL >> (RSVAL & 0x1f); break; + case 0x00: /* SLL */ if (RDREG) RDVAL = (uint32_t)RTVAL << SHIFT; break; + case 0x02: /* SRL */ if (RDREG) RDVAL = (uint32_t)RTVAL >> SHIFT; break; + case 0x03: /* SRA */ if (RDREG) RDVAL = (int32_t)RTVAL >> SHIFT; break; + case 0x04: /* SLLV */ if (RDREG) RDVAL = (uint32_t)RTVAL << (RSVAL & 0x1f); break; + case 0x06: /* SRLV */ if (RDREG) RDVAL = (uint32_t)RTVAL >> (RSVAL & 0x1f); break; + case 0x07: /* SRAV */ if (RDREG) RDVAL = (int32_t)RTVAL >> (RSVAL & 0x1f); break; case 0x08: /* JR */ JUMP_PC(RSVAL); break; case 0x09: /* JALR */ JUMP_PC_L(RSVAL, RDREG); break; case 0x0d: /* BREAK */ @@ -654,16 +654,16 @@ void rsp_device::execute_run() m_rsp_state->icount = std::min(m_rsp_state->icount, 1); break; } - case 0x20: /* ADD */ if (RDREG) RDVAL = (INT32)(RSVAL + RTVAL); break; - case 0x21: /* ADDU */ if (RDREG) RDVAL = (INT32)(RSVAL + RTVAL); break; - case 0x22: /* SUB */ if (RDREG) RDVAL = (INT32)(RSVAL - RTVAL); break; - case 0x23: /* SUBU */ if (RDREG) RDVAL = (INT32)(RSVAL - RTVAL); break; + case 0x20: /* ADD */ if (RDREG) RDVAL = (int32_t)(RSVAL + RTVAL); break; + case 0x21: /* ADDU */ if (RDREG) RDVAL = (int32_t)(RSVAL + RTVAL); break; + case 0x22: /* SUB */ if (RDREG) RDVAL = (int32_t)(RSVAL - RTVAL); break; + case 0x23: /* SUBU */ if (RDREG) RDVAL = (int32_t)(RSVAL - RTVAL); break; case 0x24: /* AND */ if (RDREG) RDVAL = RSVAL & RTVAL; break; case 0x25: /* OR */ if (RDREG) RDVAL = RSVAL | RTVAL; break; case 0x26: /* XOR */ if (RDREG) RDVAL = RSVAL ^ RTVAL; break; case 0x27: /* NOR */ if (RDREG) RDVAL = ~(RSVAL | RTVAL); break; - case 0x2a: /* SLT */ if (RDREG) RDVAL = (INT32)RSVAL < (INT32)RTVAL; break; - case 0x2b: /* SLTU */ if (RDREG) RDVAL = (UINT32)RSVAL < (UINT32)RTVAL; break; + case 0x2a: /* SLT */ if (RDREG) RDVAL = (int32_t)RSVAL < (int32_t)RTVAL; break; + case 0x2b: /* SLTU */ if (RDREG) RDVAL = (uint32_t)RSVAL < (uint32_t)RTVAL; break; default: unimplemented_opcode(op); break; } break; @@ -673,10 +673,10 @@ void rsp_device::execute_run() { switch (RTREG) { - case 0x00: /* BLTZ */ if ((INT32)(RSVAL) < 0) JUMP_REL(SIMM16); break; - case 0x01: /* BGEZ */ if ((INT32)(RSVAL) >= 0) JUMP_REL(SIMM16); break; - case 0x10: /* BLTZAL */ if ((INT32)(RSVAL) < 0) JUMP_REL_L(SIMM16, 31); break; - case 0x11: /* BGEZAL */ if ((INT32)(RSVAL) >= 0) JUMP_REL_L(SIMM16, 31); break; + case 0x00: /* BLTZ */ if ((int32_t)(RSVAL) < 0) JUMP_REL(SIMM16); break; + case 0x01: /* BGEZ */ if ((int32_t)(RSVAL) >= 0) JUMP_REL(SIMM16); break; + case 0x10: /* BLTZAL */ if ((int32_t)(RSVAL) < 0) JUMP_REL_L(SIMM16, 31); break; + case 0x11: /* BGEZAL */ if ((int32_t)(RSVAL) >= 0) JUMP_REL_L(SIMM16, 31); break; default: unimplemented_opcode(op); break; } break; @@ -686,12 +686,12 @@ void rsp_device::execute_run() case 0x03: /* JAL */ JUMP_ABS_L(UIMM26, 31); break; case 0x04: /* BEQ */ if (RSVAL == RTVAL) JUMP_REL(SIMM16); break; case 0x05: /* BNE */ if (RSVAL != RTVAL) JUMP_REL(SIMM16); break; - case 0x06: /* BLEZ */ if ((INT32)RSVAL <= 0) JUMP_REL(SIMM16); break; - case 0x07: /* BGTZ */ if ((INT32)RSVAL > 0) JUMP_REL(SIMM16); break; - case 0x08: /* ADDI */ if (RTREG) RTVAL = (INT32)(RSVAL + SIMM16); break; - case 0x09: /* ADDIU */ if (RTREG) RTVAL = (INT32)(RSVAL + SIMM16); break; - case 0x0a: /* SLTI */ if (RTREG) RTVAL = (INT32)(RSVAL) < ((INT32)SIMM16); break; - case 0x0b: /* SLTIU */ if (RTREG) RTVAL = (UINT32)(RSVAL) < (UINT32)((INT32)SIMM16); break; + case 0x06: /* BLEZ */ if ((int32_t)RSVAL <= 0) JUMP_REL(SIMM16); break; + case 0x07: /* BGTZ */ if ((int32_t)RSVAL > 0) JUMP_REL(SIMM16); break; + case 0x08: /* ADDI */ if (RTREG) RTVAL = (int32_t)(RSVAL + SIMM16); break; + case 0x09: /* ADDIU */ if (RTREG) RTVAL = (int32_t)(RSVAL + SIMM16); break; + case 0x0a: /* SLTI */ if (RTREG) RTVAL = (int32_t)(RSVAL) < ((int32_t)SIMM16); break; + case 0x0b: /* SLTIU */ if (RTREG) RTVAL = (uint32_t)(RSVAL) < (uint32_t)((int32_t)SIMM16); break; case 0x0c: /* ANDI */ if (RTREG) RTVAL = RSVAL & UIMM16; break; case 0x0d: /* ORI */ if (RTREG) RTVAL = RSVAL | UIMM16; break; case 0x0e: /* XORI */ if (RTREG) RTVAL = RSVAL ^ UIMM16; break; @@ -714,11 +714,11 @@ void rsp_device::execute_run() break; } - case 0x20: /* LB */ if (RTREG) RTVAL = (INT32)(INT8)READ8(RSVAL + SIMM16); break; - case 0x21: /* LH */ if (RTREG) RTVAL = (INT32)(INT16)READ16(RSVAL + SIMM16); break; + case 0x20: /* LB */ if (RTREG) RTVAL = (int32_t)(int8_t)READ8(RSVAL + SIMM16); break; + case 0x21: /* LH */ if (RTREG) RTVAL = (int32_t)(int16_t)READ16(RSVAL + SIMM16); break; case 0x23: /* LW */ if (RTREG) RTVAL = READ32(RSVAL + SIMM16); break; - case 0x24: /* LBU */ if (RTREG) RTVAL = (UINT8)READ8(RSVAL + SIMM16); break; - case 0x25: /* LHU */ if (RTREG) RTVAL = (UINT16)READ16(RSVAL + SIMM16); break; + case 0x24: /* LBU */ if (RTREG) RTVAL = (uint8_t)READ8(RSVAL + SIMM16); break; + case 0x25: /* LHU */ if (RTREG) RTVAL = (uint16_t)READ16(RSVAL + SIMM16); break; case 0x28: /* SB */ WRITE8(RSVAL + SIMM16, RTVAL); break; case 0x29: /* SH */ WRITE16(RSVAL + SIMM16, RTVAL); break; case 0x2b: /* SW */ WRITE32(RSVAL + SIMM16, RTVAL); break; @@ -735,7 +735,7 @@ void rsp_device::execute_run() if (LOG_INSTRUCTION_EXECUTION) { int i, l; - static UINT32 prev_regs[32]; + static uint32_t prev_regs[32]; char string[200]; rsp_dasm_one(string, m_ppc, op); diff --git a/src/devices/cpu/rsp/rsp.h b/src/devices/cpu/rsp/rsp.h index 93215bd0649..a00feb1c03b 100644 --- a/src/devices/cpu/rsp/rsp.h +++ b/src/devices/cpu/rsp/rsp.h @@ -88,8 +88,8 @@ enum #define IS_FLOAT(o) (((o) & (1 << 23)) == 0) #define IS_INTEGRAL(o) (((o) & (1 << 23)) != 0) -#define SIMMVAL ((INT16)op) -#define UIMMVAL ((UINT16)op) +#define SIMMVAL ((int16_t)op) +#define UIMMVAL ((uint16_t)op) #define LIMMVAL (op & 0x03ffffff) #define RSP_STATUS_HALT 0x0001 @@ -137,7 +137,7 @@ class rsp_device : public cpu_device public: // construction/destruction - rsp_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + rsp_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); void resolve_cb(); template static devcb_base &static_set_dp_reg_r_callback(device_t &device, _Object object) { return downcast(device).m_dp_reg_r_func.set_callback(object); } @@ -147,9 +147,9 @@ public: template static devcb_base &static_set_status_callback(device_t &device, _Object object) { return downcast(device).m_sp_set_status_func.set_callback(object); } void rspdrc_flush_drc_cache(); - void rspdrc_set_options(UINT32 options); - void rsp_add_dmem(UINT32 *base); - void rsp_add_imem(UINT32 *base); + void rspdrc_set_options(uint32_t options); + void rsp_add_dmem(uint32_t *base); + void rsp_add_imem(uint32_t *base); void ccfunc_read8(); void ccfunc_read16(); @@ -162,7 +162,7 @@ public: void ccfunc_sp_set_status_cb(); void ccfunc_unimplemented(); - UINT8* get_dmem() { return m_dmem8; } + uint8_t* get_dmem() { return m_dmem8; } protected: // device-level overrides @@ -171,10 +171,10 @@ protected: virtual void device_stop() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 1; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override { } @@ -187,18 +187,18 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - void unimplemented_opcode(UINT32 op); + void unimplemented_opcode(uint32_t op); /* internal compiler state */ struct compiler_state { - UINT32 cycles; /* accumulated cycles */ - UINT8 checkints; /* need to check interrupts before next instruction */ - UINT8 checksoftints; /* need to check software interrupts before next instruction */ + uint32_t cycles; /* accumulated cycles */ + uint8_t checkints; /* need to check interrupts before next instruction */ + uint8_t checksoftints; /* need to check software interrupts before next instruction */ uml::code_label labelnum; /* index for local labels */ }; @@ -210,7 +210,7 @@ private: { offs_t start; /* start of the RAM block */ offs_t end; /* end of the RAM block */ - UINT8 readonly; /* TRUE if read-only */ + uint8_t readonly; /* TRUE if read-only */ void * base; /* base in memory where the RAM lives */ }; @@ -218,16 +218,16 @@ private: drc_cache m_cache; /* pointer to the DRC code cache */ std::unique_ptr m_drcuml; /* DRC UML generator state */ std::unique_ptr m_drcfe; /* pointer to the DRC front-end state */ - UINT32 m_drcoptions; /* configurable DRC options */ + uint32_t m_drcoptions; /* configurable DRC options */ /* internal stuff */ - UINT8 m_cache_dirty; /* true if we need to flush the cache */ + uint8_t m_cache_dirty; /* true if we need to flush the cache */ /* parameters for subroutines */ - UINT64 m_numcycles; /* return value from gettotalcycles */ + uint64_t m_numcycles; /* return value from gettotalcycles */ const char * m_format; /* format string for print_debug */ - UINT32 m_arg2; /* print_debug argument 3 */ - UINT32 m_arg3; /* print_debug argument 4 */ + uint32_t m_arg2; /* print_debug argument 3 */ + uint32_t m_arg3; /* print_debug argument 4 */ /* register mappings */ uml::parameter m_regmap[34]; /* parameter to register mappings for all 32 integer registers */ @@ -245,11 +245,11 @@ private: struct internal_rsp_state { - UINT32 pc; - UINT32 r[35]; - UINT32 arg0; - UINT32 arg1; - UINT32 jmpdest; + uint32_t pc; + uint32_t r[35]; + uint32_t arg0; + uint32_t arg1; + uint32_t jmpdest; int icount; }; @@ -257,11 +257,11 @@ private: FILE *m_exec_output; - UINT32 m_sr; - UINT32 m_step_count; + uint32_t m_sr; + uint32_t m_step_count; - UINT32 m_ppc; - UINT32 m_nextpc; + uint32_t m_ppc; + uint32_t m_nextpc; address_space *m_program; protected: @@ -270,15 +270,15 @@ protected: private: std::unique_ptr m_cop2; - UINT32 *m_dmem32; - UINT16 *m_dmem16; - UINT8 *m_dmem8; + uint32_t *m_dmem32; + uint16_t *m_dmem16; + uint8_t *m_dmem8; - UINT32 *m_imem32; - UINT16 *m_imem16; - UINT8 *m_imem8; + uint32_t *m_imem32; + uint16_t *m_imem16; + uint8_t *m_imem8; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; bool m_isdrc; devcb_read32 m_dp_reg_r_func; @@ -287,22 +287,22 @@ private: devcb_write32 m_sp_reg_w_func; devcb_write32 m_sp_set_status_func; - UINT8 READ8(UINT32 address); - UINT16 READ16(UINT32 address); - UINT32 READ32(UINT32 address); - void WRITE8(UINT32 address, UINT8 data); - void WRITE16(UINT32 address, UINT16 data); - void WRITE32(UINT32 address, UINT32 data); - UINT32 get_cop0_reg(int reg); - void set_cop0_reg(int reg, UINT32 data); + uint8_t READ8(uint32_t address); + uint16_t READ16(uint32_t address); + uint32_t READ32(uint32_t address); + void WRITE8(uint32_t address, uint8_t data); + void WRITE16(uint32_t address, uint16_t data); + void WRITE32(uint32_t address, uint32_t data); + uint32_t get_cop0_reg(int reg); + void set_cop0_reg(int reg, uint32_t data); void load_fast_iregs(drcuml_block *block); void save_fast_iregs(drcuml_block *block); - UINT8 DM_READ8(UINT32 address); - UINT16 DM_READ16(UINT32 address); - UINT32 DM_READ32(UINT32 address); - void DM_WRITE8(UINT32 address, UINT8 data); - void DM_WRITE16(UINT32 address, UINT16 data); - void DM_WRITE32(UINT32 address, UINT32 data); + uint8_t DM_READ8(uint32_t address); + uint16_t DM_READ16(uint32_t address); + uint32_t DM_READ32(uint32_t address); + void DM_WRITE8(uint32_t address, uint8_t data); + void DM_WRITE16(uint32_t address, uint16_t data); + void DM_WRITE32(uint32_t address, uint32_t data); void rspcom_init(); void execute_run_drc(); void code_flush_cache(); @@ -314,13 +314,13 @@ private: void generate_update_cycles(drcuml_block *block, compiler_state *compiler, uml::parameter param, int allow_exception); void generate_checksum_block(drcuml_block *block, compiler_state *compiler, const opcode_desc *seqhead, const opcode_desc *seqlast); void generate_sequence_instruction(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); - void generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 linkreg); + void generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t linkreg); void generate_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_special(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_regimm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); int generate_cop0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); - void log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 op); + void log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint32_t op); }; diff --git a/src/devices/cpu/rsp/rsp_dasm.cpp b/src/devices/cpu/rsp/rsp_dasm.cpp index b430a43a75d..a16c3f1691c 100644 --- a/src/devices/cpu/rsp/rsp_dasm.cpp +++ b/src/devices/cpu/rsp/rsp_dasm.cpp @@ -57,10 +57,10 @@ static const char *const element2[16] = "00000000", "11111111", "22222222", "33333333", "44444444", "55555555", "66666666", "77777777" }; -static inline char *signed_imm16(UINT32 op) +static inline char *signed_imm16(uint32_t op) { static char temp[10]; - INT16 value = op & 0xffff; + int16_t value = op & 0xffff; if (value < 0) { @@ -85,7 +85,7 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) va_end(vl); } -static void disasm_cop0(UINT32 op) +static void disasm_cop0(uint32_t op) { int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; @@ -99,7 +99,7 @@ static void disasm_cop0(UINT32 op) } } -static void disasm_cop2(UINT32 op) +static void disasm_cop2(uint32_t op) { int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; @@ -186,7 +186,7 @@ static void disasm_cop2(UINT32 op) } } -static void disasm_lwc2(UINT32 op) +static void disasm_lwc2(uint32_t op) { int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; @@ -213,7 +213,7 @@ static void disasm_lwc2(UINT32 op) } } -static void disasm_swc2(UINT32 op) +static void disasm_swc2(uint32_t op) { int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; @@ -240,13 +240,13 @@ static void disasm_swc2(UINT32 op) } } -offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op) +offs_t rsp_dasm_one(char *buffer, offs_t pc, uint32_t op) { int rs = (op >> 21) & 31; int rt = (op >> 16) & 31; int rd = (op >> 11) & 31; int shift = (op >> 6) & 31; - UINT32 flags = 0; + uint32_t flags = 0; output = buffer; @@ -308,10 +308,10 @@ offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op) { switch ((op >> 16) & 0x1f) { - case 0x00: print("bltz %s, $%08X", reg[rs], pc + 4 + ((INT16)op << 2)); break; - case 0x01: print("bgez %s, $%08X", reg[rs], pc + 4 + ((INT16)op << 2)); break; - case 0x10: print("bltzal %s, $%08X", reg[rs], pc + 4 + ((INT16)op << 2)); break; - case 0x11: print("bgezal %s, $%08X", reg[rs], pc + 4 + ((INT16)op << 2)); break; + case 0x00: print("bltz %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x01: print("bgez %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x10: print("bltzal %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); break; + case 0x11: print("bgezal %s, $%08X", reg[rs], pc + 4 + ((int16_t)op << 2)); break; default: print("???"); break; } @@ -320,18 +320,18 @@ offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op) case 0x02: print("j $%08X", (op & 0x03ffffff) << 2); break; case 0x03: print("jal $%08X", (op & 0x03ffffff) << 2); break; - case 0x04: print("beq %s, %s, $%08X", reg[rs], reg[rt], pc + 4 + ((INT16)(op) << 2)); break; - case 0x05: print("bne %s, %s, $%08X", reg[rs], reg[rt], pc + 4 + ((INT16)(op) << 2)); break; - case 0x06: print("blez %s, $%08X", reg[rs], pc + 4 + ((INT16)(op) << 2)); break; - case 0x07: print("bgtz %s, $%08X", reg[rs], pc + 4 + ((INT16)(op) << 2)); break; + case 0x04: print("beq %s, %s, $%08X", reg[rs], reg[rt], pc + 4 + ((int16_t)(op) << 2)); break; + case 0x05: print("bne %s, %s, $%08X", reg[rs], reg[rt], pc + 4 + ((int16_t)(op) << 2)); break; + case 0x06: print("blez %s, $%08X", reg[rs], pc + 4 + ((int16_t)(op) << 2)); break; + case 0x07: print("bgtz %s, $%08X", reg[rs], pc + 4 + ((int16_t)(op) << 2)); break; case 0x08: print("addi %s, %s, %s", reg[rt], reg[rs], signed_imm16(op)); break; case 0x09: print("addiu %s, %s, %s", reg[rt], reg[rs], signed_imm16(op)); break; case 0x0a: print("slti %s, %s, %s", reg[rt], reg[rs], signed_imm16(op)); break; case 0x0b: print("sltiu %s, %s, %s", reg[rt], reg[rs], signed_imm16(op)); break; - case 0x0c: print("andi %s, %s, $%04X", reg[rt], reg[rs], (UINT16)(op)); break; - case 0x0d: print("ori %s, %s, $%04X", reg[rt], reg[rs], (UINT16)(op)); break; - case 0x0e: print("xori %s, %s, $%04X", reg[rt], reg[rs], (UINT16)(op)); break; - case 0x0f: print("lui %s, %s, $%04X", reg[rt], reg[rs], (UINT16)(op)); break; + case 0x0c: print("andi %s, %s, $%04X", reg[rt], reg[rs], (uint16_t)(op)); break; + case 0x0d: print("ori %s, %s, $%04X", reg[rt], reg[rs], (uint16_t)(op)); break; + case 0x0e: print("xori %s, %s, $%04X", reg[rt], reg[rs], (uint16_t)(op)); break; + case 0x0f: print("lui %s, %s, $%04X", reg[rt], reg[rs], (uint16_t)(op)); break; case 0x10: disasm_cop0(op); break; case 0x12: disasm_cop2(op); break; @@ -358,7 +358,7 @@ offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op) CPU_DISASSEMBLE( rsp ) { - UINT32 op = *(UINT32 *)opram; + uint32_t op = *(uint32_t *)opram; op = big_endianize_int32(op); return rsp_dasm_one(buffer, pc, op); } diff --git a/src/devices/cpu/rsp/rspcp2.cpp b/src/devices/cpu/rsp/rspcp2.cpp index ae5d2ade7e5..1c77230cda4 100644 --- a/src/devices/cpu/rsp/rspcp2.cpp +++ b/src/devices/cpu/rsp/rspcp2.cpp @@ -213,18 +213,18 @@ const rsp_cop2::vec_helpers_t rsp_cop2::m_vec_helpers = { #if !(defined(__SSSE3__) || defined(_MSC_VER)) // TODO: Highly optimized. More of a stopgap measure. -static inline rsp_vec_t sse2_pshufb(rsp_vec_t v, const UINT16 *keys) +static inline rsp_vec_t sse2_pshufb(rsp_vec_t v, const uint16_t *keys) { - UINT8 dest[16]; - UINT8 temp[16]; + uint8_t dest[16]; + uint8_t temp[16]; _mm_storeu_si128((rsp_vec_t *) temp, v); - for (UINT32 j = 0; j < 8; j++) + for (uint32_t j = 0; j < 8; j++) { - UINT16 key = keys[j]; - UINT8 key_hi = key >> 8; - UINT8 key_lo = key >> 0; + uint16_t key = keys[j]; + uint8_t key_hi = key >> 8; + uint8_t key_lo = key >> 0; dest[(j << 1) + 1] = key_hi == 0x80 ? 0x00 : temp[key_hi]; dest[(j << 1) + 0] = key_lo == 0x80 ? 0x00 : temp[key_lo]; @@ -233,25 +233,25 @@ static inline rsp_vec_t sse2_pshufb(rsp_vec_t v, const UINT16 *keys) return _mm_loadu_si128((rsp_vec_t *) dest); } -rsp_vec_t rsp_cop2::vec_load_and_shuffle_operand(const UINT16* src, UINT32 element) +rsp_vec_t rsp_cop2::vec_load_and_shuffle_operand(const uint16_t* src, uint32_t element) { if (element >= 8) // element => 0w ... 7w { - UINT16 word_lo; + uint16_t word_lo; memcpy(&word_lo, src + (element - 8), sizeof(word_lo)); - UINT64 dword = word_lo | ((UINT32) word_lo << 16); + uint64_t dword = word_lo | ((uint32_t) word_lo << 16); return _mm_shuffle_epi32(_mm_loadl_epi64((rsp_vec_t*) &dword), _MM_SHUFFLE(0,0,0,0)); } else if (element >= 4) // element => 0h ... 3h { - UINT16 word_lo; - UINT16 word_hi; + uint16_t word_lo; + uint16_t word_hi; memcpy(&word_hi, src + element - 0, sizeof(word_hi)); memcpy(&word_lo, src + element - 4, sizeof(word_lo)); - UINT64 dword = word_lo | ((UINT32) word_hi << 16); + uint64_t dword = word_lo | ((uint32_t) word_hi << 16); rsp_vec_t v = _mm_loadl_epi64((rsp_vec_t*) &dword); v = _mm_shufflelo_epi16(v, _MM_SHUFFLE(1,1,0,0)); @@ -277,7 +277,7 @@ rsp_vec_t rsp_cop2::vec_load_and_shuffle_operand(const UINT16* src, UINT32 eleme return vec_load_unshuffled_operand(src); } #else -rsp_vec_t rsp_cop2::vec_load_and_shuffle_operand(const UINT16* src, UINT32 element) +rsp_vec_t rsp_cop2::vec_load_and_shuffle_operand(const uint16_t* src, uint32_t element) { rsp_vec_t operand = _mm_load_si128((rsp_vec_t*) src); rsp_vec_t key = _mm_load_si128((rsp_vec_t*) m_vec_helpers.shuffle_keys[element]); @@ -294,16 +294,16 @@ rsp_vec_t rsp_cop2::vec_load_and_shuffle_operand(const UINT16* src, UINT32 eleme // wraparound. Do we just discard the data, as below, or does the // data effectively get rotated around the edge of the vector? // -void rsp_cop2::vec_load_group1(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm) +void rsp_cop2::vec_load_group1(uint32_t addr, uint32_t element, uint16_t *regp, rsp_vec_t reg, rsp_vec_t dqm) { - UINT32 offset = addr & 0x7; - UINT32 ror = offset - element; + uint32_t offset = addr & 0x7; + uint32_t ror = offset - element; // Always load in 8-byte chunks to emulate wraparound. rsp_vec_t data; if (offset) { - UINT32 aligned_addr_lo = addr & ~0x7; - UINT32 aligned_addr_hi = (aligned_addr_lo + 8) & 0xFFF; + uint32_t aligned_addr_lo = addr & ~0x7; + uint32_t aligned_addr_hi = (aligned_addr_lo + 8) & 0xFFF; data = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_lo)); rsp_vec_t temp = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_hi)); @@ -351,15 +351,15 @@ void rsp_cop2::vec_load_group1(UINT32 addr, UINT32 element, UINT16 *regp, rsp_ve // // TODO: Reverse-engineer what happens when element != 0. // -void rsp_cop2::vec_load_group2(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) { - UINT32 offset = addr & 0x7; +void rsp_cop2::vec_load_group2(uint32_t addr, uint32_t element, uint16_t *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) { + uint32_t offset = addr & 0x7; rsp_vec_t data; // Always load in 8-byte chunks to emulate wraparound. if (offset) { - UINT32 aligned_addr_lo = addr & ~0x7; - UINT32 aligned_addr_hi = (aligned_addr_lo + 8) & 0xFFF; - UINT64 datalow, datahigh; + uint32_t aligned_addr_lo = addr & ~0x7; + uint32_t aligned_addr_hi = (aligned_addr_lo + 8) & 0xFFF; + uint64_t datalow, datahigh; memcpy(&datalow, m_rsp.get_dmem() + aligned_addr_lo, sizeof(datalow)); memcpy(&datahigh, m_rsp.get_dmem() + aligned_addr_hi, sizeof(datahigh)); @@ -399,15 +399,15 @@ void rsp_cop2::vec_load_group2(UINT32 addr, UINT32 element, UINT16 *regp, rsp_ve // must wraparound (i.e., the address offset is small, starting // element is large). // -void rsp_cop2::vec_load_group4(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) +void rsp_cop2::vec_load_group4(uint32_t addr, uint32_t element, uint16_t *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) { - UINT32 aligned_addr = addr & 0xFF0; - UINT32 offset = addr & 0xF; - static UINT32 call_count = 0; + uint32_t aligned_addr = addr & 0xFF0; + uint32_t offset = addr & 0xF; + static uint32_t call_count = 0; rsp_vec_t data = _mm_load_si128((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr)); - UINT32 ror; + uint32_t ror; if (request_type == RSP_MEM_REQUEST_QUAD) { ror = 16 - element + offset; @@ -451,10 +451,10 @@ void rsp_cop2::vec_load_group4(UINT32 addr, UINT32 element, UINT16 *regp, rsp_ve // must wraparound. Do we just stop storing the data, or do we // continue storing from the front of the vector, as below? // -void rsp_cop2::vec_store_group1(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm) +void rsp_cop2::vec_store_group1(uint32_t addr, uint32_t element, uint16_t *regp, rsp_vec_t reg, rsp_vec_t dqm) { - UINT32 offset = addr & 0x7; - UINT32 ror = element - offset; + uint32_t offset = addr & 0x7; + uint32_t ror = element - offset; // Shift the DQM up to the point where we mux in the data. #if !(defined(__SSSE3__) || defined(_MSC_VER)) @@ -476,8 +476,8 @@ void rsp_cop2::vec_store_group1(UINT32 addr, UINT32 element, UINT16 *regp, rsp_v rsp_vec_t data; if (offset) { - UINT32 aligned_addr_lo = addr & ~0x7; - UINT32 aligned_addr_hi = (aligned_addr_lo + 8) & 0xFFF; + uint32_t aligned_addr_lo = addr & ~0x7; + uint32_t aligned_addr_hi = (aligned_addr_lo + 8) & 0xFFF; data = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_lo)); rsp_vec_t temp = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_hi)); @@ -525,7 +525,7 @@ void rsp_cop2::vec_store_group1(UINT32 addr, UINT32 element, UINT16 *regp, rsp_v // // TODO: Reverse-engineer what happens when element != 0. // -void rsp_cop2::vec_store_group2(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) { +void rsp_cop2::vec_store_group2(uint32_t addr, uint32_t element, uint16_t *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) { // "Pack" the data. if (request_type != RSP_MEM_REQUEST_PACK) { @@ -550,10 +550,10 @@ void rsp_cop2::vec_store_group2(UINT32 addr, UINT32 element, UINT16 *regp, rsp_v // SSE3+ accelerated stores for group IV. Byteswap 2-byte little-endian // vector back to big-endian. Stop storing at quadword boundaries. // -void rsp_cop2::vec_store_group4(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) { - UINT32 aligned_addr = addr & 0xFF0; - UINT32 offset = addr & 0xF; - UINT32 rol = offset; +void rsp_cop2::vec_store_group4(uint32_t addr, uint32_t element, uint16_t *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) { + uint32_t aligned_addr = addr & 0xFF0; + uint32_t offset = addr & 0xF; + uint32_t rol = offset; rsp_vec_t data = _mm_load_si128((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr)); @@ -587,7 +587,7 @@ void rsp_cop2::vec_store_group4(UINT32 addr, UINT32 element, UINT16 *regp, rsp_v } #endif -extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); +extern offs_t rsp_dasm_one(char *buffer, offs_t pc, uint32_t op); /*************************************************************************** Helpful Defines @@ -607,7 +607,7 @@ extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); #define VREG_L(reg, offset) m_v[(reg)].l[(offset)] #define R_VREG_B(reg, offset) m_v[(reg)].b[(offset)^1] -#define R_VREG_S(reg, offset) (INT16)m_v[(reg)].s[(offset)] +#define R_VREG_S(reg, offset) (int16_t)m_v[(reg)].s[(offset)] #define R_VREG_L(reg, offset) m_v[(reg)].l[(offset)] #define W_VREG_B(reg, offset, val) (m_v[(reg)].b[(offset)^1] = val) @@ -623,10 +623,10 @@ extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); #define CLIP2 4 #define ACCUM(x) m_accum[x].q -#define ACCUM_H(x) (UINT16)m_accum[x].w[3] -#define ACCUM_M(x) (UINT16)m_accum[x].w[2] -#define ACCUM_L(x) (UINT16)m_accum[x].w[1] -#define ACCUM_LL(x) (UINT16)m_accum[x].w[0] +#define ACCUM_H(x) (uint16_t)m_accum[x].w[3] +#define ACCUM_M(x) (uint16_t)m_accum[x].w[2] +#define ACCUM_L(x) (uint16_t)m_accum[x].w[1] +#define ACCUM_LL(x) (uint16_t)m_accum[x].w[0] #define SET_ACCUM_H(v, x) m_accum[x].w[3] = v; #define SET_ACCUM_M(v, x) m_accum[x].w[2] = v; @@ -751,100 +751,100 @@ void rsp_cop2::state_string_export(const int index, std::string &str) const switch (index) { case RSP_V0: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 0, 0), (UINT16)VREG_S( 0, 1), (UINT16)VREG_S( 0, 2), (UINT16)VREG_S( 0, 3), (UINT16)VREG_S( 0, 4), (UINT16)VREG_S( 0, 5), (UINT16)VREG_S( 0, 6), (UINT16)VREG_S( 0, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 0, 0), (uint16_t)VREG_S( 0, 1), (uint16_t)VREG_S( 0, 2), (uint16_t)VREG_S( 0, 3), (uint16_t)VREG_S( 0, 4), (uint16_t)VREG_S( 0, 5), (uint16_t)VREG_S( 0, 6), (uint16_t)VREG_S( 0, 7)); break; case RSP_V1: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 1, 0), (UINT16)VREG_S( 1, 1), (UINT16)VREG_S( 1, 2), (UINT16)VREG_S( 1, 3), (UINT16)VREG_S( 1, 4), (UINT16)VREG_S( 1, 5), (UINT16)VREG_S( 1, 6), (UINT16)VREG_S( 1, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 1, 0), (uint16_t)VREG_S( 1, 1), (uint16_t)VREG_S( 1, 2), (uint16_t)VREG_S( 1, 3), (uint16_t)VREG_S( 1, 4), (uint16_t)VREG_S( 1, 5), (uint16_t)VREG_S( 1, 6), (uint16_t)VREG_S( 1, 7)); break; case RSP_V2: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 2, 0), (UINT16)VREG_S( 2, 1), (UINT16)VREG_S( 2, 2), (UINT16)VREG_S( 2, 3), (UINT16)VREG_S( 2, 4), (UINT16)VREG_S( 2, 5), (UINT16)VREG_S( 2, 6), (UINT16)VREG_S( 2, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 2, 0), (uint16_t)VREG_S( 2, 1), (uint16_t)VREG_S( 2, 2), (uint16_t)VREG_S( 2, 3), (uint16_t)VREG_S( 2, 4), (uint16_t)VREG_S( 2, 5), (uint16_t)VREG_S( 2, 6), (uint16_t)VREG_S( 2, 7)); break; case RSP_V3: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 3, 0), (UINT16)VREG_S( 3, 1), (UINT16)VREG_S( 3, 2), (UINT16)VREG_S( 3, 3), (UINT16)VREG_S( 3, 4), (UINT16)VREG_S( 3, 5), (UINT16)VREG_S( 3, 6), (UINT16)VREG_S( 3, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 3, 0), (uint16_t)VREG_S( 3, 1), (uint16_t)VREG_S( 3, 2), (uint16_t)VREG_S( 3, 3), (uint16_t)VREG_S( 3, 4), (uint16_t)VREG_S( 3, 5), (uint16_t)VREG_S( 3, 6), (uint16_t)VREG_S( 3, 7)); break; case RSP_V4: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 4, 0), (UINT16)VREG_S( 4, 1), (UINT16)VREG_S( 4, 2), (UINT16)VREG_S( 4, 3), (UINT16)VREG_S( 4, 4), (UINT16)VREG_S( 4, 5), (UINT16)VREG_S( 4, 6), (UINT16)VREG_S( 4, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 4, 0), (uint16_t)VREG_S( 4, 1), (uint16_t)VREG_S( 4, 2), (uint16_t)VREG_S( 4, 3), (uint16_t)VREG_S( 4, 4), (uint16_t)VREG_S( 4, 5), (uint16_t)VREG_S( 4, 6), (uint16_t)VREG_S( 4, 7)); break; case RSP_V5: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 5, 0), (UINT16)VREG_S( 5, 1), (UINT16)VREG_S( 5, 2), (UINT16)VREG_S( 5, 3), (UINT16)VREG_S( 5, 4), (UINT16)VREG_S( 5, 5), (UINT16)VREG_S( 5, 6), (UINT16)VREG_S( 5, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 5, 0), (uint16_t)VREG_S( 5, 1), (uint16_t)VREG_S( 5, 2), (uint16_t)VREG_S( 5, 3), (uint16_t)VREG_S( 5, 4), (uint16_t)VREG_S( 5, 5), (uint16_t)VREG_S( 5, 6), (uint16_t)VREG_S( 5, 7)); break; case RSP_V6: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 6, 0), (UINT16)VREG_S( 6, 1), (UINT16)VREG_S( 6, 2), (UINT16)VREG_S( 6, 3), (UINT16)VREG_S( 6, 4), (UINT16)VREG_S( 6, 5), (UINT16)VREG_S( 6, 6), (UINT16)VREG_S( 6, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 6, 0), (uint16_t)VREG_S( 6, 1), (uint16_t)VREG_S( 6, 2), (uint16_t)VREG_S( 6, 3), (uint16_t)VREG_S( 6, 4), (uint16_t)VREG_S( 6, 5), (uint16_t)VREG_S( 6, 6), (uint16_t)VREG_S( 6, 7)); break; case RSP_V7: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 7, 0), (UINT16)VREG_S( 7, 1), (UINT16)VREG_S( 7, 2), (UINT16)VREG_S( 7, 3), (UINT16)VREG_S( 7, 4), (UINT16)VREG_S( 7, 5), (UINT16)VREG_S( 7, 6), (UINT16)VREG_S( 7, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 7, 0), (uint16_t)VREG_S( 7, 1), (uint16_t)VREG_S( 7, 2), (uint16_t)VREG_S( 7, 3), (uint16_t)VREG_S( 7, 4), (uint16_t)VREG_S( 7, 5), (uint16_t)VREG_S( 7, 6), (uint16_t)VREG_S( 7, 7)); break; case RSP_V8: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 8, 0), (UINT16)VREG_S( 8, 1), (UINT16)VREG_S( 8, 2), (UINT16)VREG_S( 8, 3), (UINT16)VREG_S( 8, 4), (UINT16)VREG_S( 8, 5), (UINT16)VREG_S( 8, 6), (UINT16)VREG_S( 8, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 8, 0), (uint16_t)VREG_S( 8, 1), (uint16_t)VREG_S( 8, 2), (uint16_t)VREG_S( 8, 3), (uint16_t)VREG_S( 8, 4), (uint16_t)VREG_S( 8, 5), (uint16_t)VREG_S( 8, 6), (uint16_t)VREG_S( 8, 7)); break; case RSP_V9: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 9, 0), (UINT16)VREG_S( 9, 1), (UINT16)VREG_S( 9, 2), (UINT16)VREG_S( 9, 3), (UINT16)VREG_S( 9, 4), (UINT16)VREG_S( 9, 5), (UINT16)VREG_S( 9, 6), (UINT16)VREG_S( 9, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 9, 0), (uint16_t)VREG_S( 9, 1), (uint16_t)VREG_S( 9, 2), (uint16_t)VREG_S( 9, 3), (uint16_t)VREG_S( 9, 4), (uint16_t)VREG_S( 9, 5), (uint16_t)VREG_S( 9, 6), (uint16_t)VREG_S( 9, 7)); break; case RSP_V10: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(10, 0), (UINT16)VREG_S(10, 1), (UINT16)VREG_S(10, 2), (UINT16)VREG_S(10, 3), (UINT16)VREG_S(10, 4), (UINT16)VREG_S(10, 5), (UINT16)VREG_S(10, 6), (UINT16)VREG_S(10, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(10, 0), (uint16_t)VREG_S(10, 1), (uint16_t)VREG_S(10, 2), (uint16_t)VREG_S(10, 3), (uint16_t)VREG_S(10, 4), (uint16_t)VREG_S(10, 5), (uint16_t)VREG_S(10, 6), (uint16_t)VREG_S(10, 7)); break; case RSP_V11: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(11, 0), (UINT16)VREG_S(11, 1), (UINT16)VREG_S(11, 2), (UINT16)VREG_S(11, 3), (UINT16)VREG_S(11, 4), (UINT16)VREG_S(11, 5), (UINT16)VREG_S(11, 6), (UINT16)VREG_S(11, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(11, 0), (uint16_t)VREG_S(11, 1), (uint16_t)VREG_S(11, 2), (uint16_t)VREG_S(11, 3), (uint16_t)VREG_S(11, 4), (uint16_t)VREG_S(11, 5), (uint16_t)VREG_S(11, 6), (uint16_t)VREG_S(11, 7)); break; case RSP_V12: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(12, 0), (UINT16)VREG_S(12, 1), (UINT16)VREG_S(12, 2), (UINT16)VREG_S(12, 3), (UINT16)VREG_S(12, 4), (UINT16)VREG_S(12, 5), (UINT16)VREG_S(12, 6), (UINT16)VREG_S(12, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(12, 0), (uint16_t)VREG_S(12, 1), (uint16_t)VREG_S(12, 2), (uint16_t)VREG_S(12, 3), (uint16_t)VREG_S(12, 4), (uint16_t)VREG_S(12, 5), (uint16_t)VREG_S(12, 6), (uint16_t)VREG_S(12, 7)); break; case RSP_V13: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(13, 0), (UINT16)VREG_S(13, 1), (UINT16)VREG_S(13, 2), (UINT16)VREG_S(13, 3), (UINT16)VREG_S(13, 4), (UINT16)VREG_S(13, 5), (UINT16)VREG_S(13, 6), (UINT16)VREG_S(13, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(13, 0), (uint16_t)VREG_S(13, 1), (uint16_t)VREG_S(13, 2), (uint16_t)VREG_S(13, 3), (uint16_t)VREG_S(13, 4), (uint16_t)VREG_S(13, 5), (uint16_t)VREG_S(13, 6), (uint16_t)VREG_S(13, 7)); break; case RSP_V14: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(14, 0), (UINT16)VREG_S(14, 1), (UINT16)VREG_S(14, 2), (UINT16)VREG_S(14, 3), (UINT16)VREG_S(14, 4), (UINT16)VREG_S(14, 5), (UINT16)VREG_S(14, 6), (UINT16)VREG_S(14, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(14, 0), (uint16_t)VREG_S(14, 1), (uint16_t)VREG_S(14, 2), (uint16_t)VREG_S(14, 3), (uint16_t)VREG_S(14, 4), (uint16_t)VREG_S(14, 5), (uint16_t)VREG_S(14, 6), (uint16_t)VREG_S(14, 7)); break; case RSP_V15: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(15, 0), (UINT16)VREG_S(15, 1), (UINT16)VREG_S(15, 2), (UINT16)VREG_S(15, 3), (UINT16)VREG_S(15, 4), (UINT16)VREG_S(15, 5), (UINT16)VREG_S(15, 6), (UINT16)VREG_S(15, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(15, 0), (uint16_t)VREG_S(15, 1), (uint16_t)VREG_S(15, 2), (uint16_t)VREG_S(15, 3), (uint16_t)VREG_S(15, 4), (uint16_t)VREG_S(15, 5), (uint16_t)VREG_S(15, 6), (uint16_t)VREG_S(15, 7)); break; case RSP_V16: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(16, 0), (UINT16)VREG_S(16, 1), (UINT16)VREG_S(16, 2), (UINT16)VREG_S(16, 3), (UINT16)VREG_S(16, 4), (UINT16)VREG_S(16, 5), (UINT16)VREG_S(16, 6), (UINT16)VREG_S(16, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(16, 0), (uint16_t)VREG_S(16, 1), (uint16_t)VREG_S(16, 2), (uint16_t)VREG_S(16, 3), (uint16_t)VREG_S(16, 4), (uint16_t)VREG_S(16, 5), (uint16_t)VREG_S(16, 6), (uint16_t)VREG_S(16, 7)); break; case RSP_V17: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(17, 0), (UINT16)VREG_S(17, 1), (UINT16)VREG_S(17, 2), (UINT16)VREG_S(17, 3), (UINT16)VREG_S(17, 4), (UINT16)VREG_S(17, 5), (UINT16)VREG_S(17, 6), (UINT16)VREG_S(17, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(17, 0), (uint16_t)VREG_S(17, 1), (uint16_t)VREG_S(17, 2), (uint16_t)VREG_S(17, 3), (uint16_t)VREG_S(17, 4), (uint16_t)VREG_S(17, 5), (uint16_t)VREG_S(17, 6), (uint16_t)VREG_S(17, 7)); break; case RSP_V18: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(18, 0), (UINT16)VREG_S(18, 1), (UINT16)VREG_S(18, 2), (UINT16)VREG_S(18, 3), (UINT16)VREG_S(18, 4), (UINT16)VREG_S(18, 5), (UINT16)VREG_S(18, 6), (UINT16)VREG_S(18, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(18, 0), (uint16_t)VREG_S(18, 1), (uint16_t)VREG_S(18, 2), (uint16_t)VREG_S(18, 3), (uint16_t)VREG_S(18, 4), (uint16_t)VREG_S(18, 5), (uint16_t)VREG_S(18, 6), (uint16_t)VREG_S(18, 7)); break; case RSP_V19: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(19, 0), (UINT16)VREG_S(19, 1), (UINT16)VREG_S(19, 2), (UINT16)VREG_S(19, 3), (UINT16)VREG_S(19, 4), (UINT16)VREG_S(19, 5), (UINT16)VREG_S(19, 6), (UINT16)VREG_S(19, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(19, 0), (uint16_t)VREG_S(19, 1), (uint16_t)VREG_S(19, 2), (uint16_t)VREG_S(19, 3), (uint16_t)VREG_S(19, 4), (uint16_t)VREG_S(19, 5), (uint16_t)VREG_S(19, 6), (uint16_t)VREG_S(19, 7)); break; case RSP_V20: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(20, 0), (UINT16)VREG_S(20, 1), (UINT16)VREG_S(20, 2), (UINT16)VREG_S(20, 3), (UINT16)VREG_S(20, 4), (UINT16)VREG_S(20, 5), (UINT16)VREG_S(20, 6), (UINT16)VREG_S(20, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(20, 0), (uint16_t)VREG_S(20, 1), (uint16_t)VREG_S(20, 2), (uint16_t)VREG_S(20, 3), (uint16_t)VREG_S(20, 4), (uint16_t)VREG_S(20, 5), (uint16_t)VREG_S(20, 6), (uint16_t)VREG_S(20, 7)); break; case RSP_V21: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(21, 0), (UINT16)VREG_S(21, 1), (UINT16)VREG_S(21, 2), (UINT16)VREG_S(21, 3), (UINT16)VREG_S(21, 4), (UINT16)VREG_S(21, 5), (UINT16)VREG_S(21, 6), (UINT16)VREG_S(21, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(21, 0), (uint16_t)VREG_S(21, 1), (uint16_t)VREG_S(21, 2), (uint16_t)VREG_S(21, 3), (uint16_t)VREG_S(21, 4), (uint16_t)VREG_S(21, 5), (uint16_t)VREG_S(21, 6), (uint16_t)VREG_S(21, 7)); break; case RSP_V22: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(22, 0), (UINT16)VREG_S(22, 1), (UINT16)VREG_S(22, 2), (UINT16)VREG_S(22, 3), (UINT16)VREG_S(22, 4), (UINT16)VREG_S(22, 5), (UINT16)VREG_S(22, 6), (UINT16)VREG_S(22, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(22, 0), (uint16_t)VREG_S(22, 1), (uint16_t)VREG_S(22, 2), (uint16_t)VREG_S(22, 3), (uint16_t)VREG_S(22, 4), (uint16_t)VREG_S(22, 5), (uint16_t)VREG_S(22, 6), (uint16_t)VREG_S(22, 7)); break; case RSP_V23: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(23, 0), (UINT16)VREG_S(23, 1), (UINT16)VREG_S(23, 2), (UINT16)VREG_S(23, 3), (UINT16)VREG_S(23, 4), (UINT16)VREG_S(23, 5), (UINT16)VREG_S(23, 6), (UINT16)VREG_S(23, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(23, 0), (uint16_t)VREG_S(23, 1), (uint16_t)VREG_S(23, 2), (uint16_t)VREG_S(23, 3), (uint16_t)VREG_S(23, 4), (uint16_t)VREG_S(23, 5), (uint16_t)VREG_S(23, 6), (uint16_t)VREG_S(23, 7)); break; case RSP_V24: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(24, 0), (UINT16)VREG_S(24, 1), (UINT16)VREG_S(24, 2), (UINT16)VREG_S(24, 3), (UINT16)VREG_S(24, 4), (UINT16)VREG_S(24, 5), (UINT16)VREG_S(24, 6), (UINT16)VREG_S(24, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(24, 0), (uint16_t)VREG_S(24, 1), (uint16_t)VREG_S(24, 2), (uint16_t)VREG_S(24, 3), (uint16_t)VREG_S(24, 4), (uint16_t)VREG_S(24, 5), (uint16_t)VREG_S(24, 6), (uint16_t)VREG_S(24, 7)); break; case RSP_V25: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(25, 0), (UINT16)VREG_S(25, 1), (UINT16)VREG_S(25, 2), (UINT16)VREG_S(25, 3), (UINT16)VREG_S(25, 4), (UINT16)VREG_S(25, 5), (UINT16)VREG_S(25, 6), (UINT16)VREG_S(25, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(25, 0), (uint16_t)VREG_S(25, 1), (uint16_t)VREG_S(25, 2), (uint16_t)VREG_S(25, 3), (uint16_t)VREG_S(25, 4), (uint16_t)VREG_S(25, 5), (uint16_t)VREG_S(25, 6), (uint16_t)VREG_S(25, 7)); break; case RSP_V26: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(26, 0), (UINT16)VREG_S(26, 1), (UINT16)VREG_S(26, 2), (UINT16)VREG_S(26, 3), (UINT16)VREG_S(26, 4), (UINT16)VREG_S(26, 5), (UINT16)VREG_S(26, 6), (UINT16)VREG_S(26, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(26, 0), (uint16_t)VREG_S(26, 1), (uint16_t)VREG_S(26, 2), (uint16_t)VREG_S(26, 3), (uint16_t)VREG_S(26, 4), (uint16_t)VREG_S(26, 5), (uint16_t)VREG_S(26, 6), (uint16_t)VREG_S(26, 7)); break; case RSP_V27: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(27, 0), (UINT16)VREG_S(27, 1), (UINT16)VREG_S(27, 2), (UINT16)VREG_S(27, 3), (UINT16)VREG_S(27, 4), (UINT16)VREG_S(27, 5), (UINT16)VREG_S(27, 6), (UINT16)VREG_S(27, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(27, 0), (uint16_t)VREG_S(27, 1), (uint16_t)VREG_S(27, 2), (uint16_t)VREG_S(27, 3), (uint16_t)VREG_S(27, 4), (uint16_t)VREG_S(27, 5), (uint16_t)VREG_S(27, 6), (uint16_t)VREG_S(27, 7)); break; case RSP_V28: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(28, 0), (UINT16)VREG_S(28, 1), (UINT16)VREG_S(28, 2), (UINT16)VREG_S(28, 3), (UINT16)VREG_S(28, 4), (UINT16)VREG_S(28, 5), (UINT16)VREG_S(28, 6), (UINT16)VREG_S(28, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(28, 0), (uint16_t)VREG_S(28, 1), (uint16_t)VREG_S(28, 2), (uint16_t)VREG_S(28, 3), (uint16_t)VREG_S(28, 4), (uint16_t)VREG_S(28, 5), (uint16_t)VREG_S(28, 6), (uint16_t)VREG_S(28, 7)); break; case RSP_V29: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(29, 0), (UINT16)VREG_S(29, 1), (UINT16)VREG_S(29, 2), (UINT16)VREG_S(29, 3), (UINT16)VREG_S(29, 4), (UINT16)VREG_S(29, 5), (UINT16)VREG_S(29, 6), (UINT16)VREG_S(29, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(29, 0), (uint16_t)VREG_S(29, 1), (uint16_t)VREG_S(29, 2), (uint16_t)VREG_S(29, 3), (uint16_t)VREG_S(29, 4), (uint16_t)VREG_S(29, 5), (uint16_t)VREG_S(29, 6), (uint16_t)VREG_S(29, 7)); break; case RSP_V30: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(30, 0), (UINT16)VREG_S(30, 1), (UINT16)VREG_S(30, 2), (UINT16)VREG_S(30, 3), (UINT16)VREG_S(30, 4), (UINT16)VREG_S(30, 5), (UINT16)VREG_S(30, 6), (UINT16)VREG_S(30, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(30, 0), (uint16_t)VREG_S(30, 1), (uint16_t)VREG_S(30, 2), (uint16_t)VREG_S(30, 3), (uint16_t)VREG_S(30, 4), (uint16_t)VREG_S(30, 5), (uint16_t)VREG_S(30, 6), (uint16_t)VREG_S(30, 7)); break; case RSP_V31: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(31, 0), (UINT16)VREG_S(31, 1), (UINT16)VREG_S(31, 2), (UINT16)VREG_S(31, 3), (UINT16)VREG_S(31, 4), (UINT16)VREG_S(31, 5), (UINT16)VREG_S(31, 6), (UINT16)VREG_S(31, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(31, 0), (uint16_t)VREG_S(31, 1), (uint16_t)VREG_S(31, 2), (uint16_t)VREG_S(31, 3), (uint16_t)VREG_S(31, 4), (uint16_t)VREG_S(31, 5), (uint16_t)VREG_S(31, 6), (uint16_t)VREG_S(31, 7)); break; } } @@ -853,12 +853,12 @@ void rsp_cop2::state_string_export(const int index, std::string &str) const Vector Load Instructions ***************************************************************************/ -void rsp_cop2::handle_lwc2(UINT32 op) +void rsp_cop2::handle_lwc2(uint32_t op) { int base = (op >> 21) & 0x1f; #if !USE_SIMD int i, end; - UINT32 ea; + uint32_t ea; int dest = (op >> 16) & 0x1f; int index = (op >> 7) & 0xf; int offset = (op & 0x7f); @@ -1157,24 +1157,24 @@ void rsp_cop2::handle_lwc2(UINT32 op) //printf("LTV "); #if 0 #else - INT32 index = (op >> 7) & 0xf; - INT32 offset = (op & 0x7f); + int32_t index = (op >> 7) & 0xf; + int32_t offset = (op & 0x7f); if (offset & 0x40) offset |= 0xffffffc0; - INT32 vs = (op >> 16) & 0x1f; - INT32 ve = vs + 8; + int32_t vs = (op >> 16) & 0x1f; + int32_t ve = vs + 8; if (ve > 32) ve = 32; - INT32 element; + int32_t element; if (index & 1) fatalerror("RSP: LTV: index = %d\n", index); - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); ea = ((ea + 8) & ~0xf) + (index & 1); - for (INT32 i = vs; i < ve; i++) + for (int32_t i = vs; i < ve; i++) { element = ((8 - (index >> 1) + (i-vs)) << 1); VREG_B(i, (element & 0xf)) = m_rsp.READ8(ea); @@ -1200,13 +1200,13 @@ void rsp_cop2::handle_lwc2(UINT32 op) Vector Store Instructions ***************************************************************************/ -void rsp_cop2::handle_swc2(UINT32 op) +void rsp_cop2::handle_swc2(uint32_t op) { int base = (op >> 21) & 0x1f; #if !USE_SIMD int i, end; int eaoffset; - UINT32 ea; + uint32_t ea; int dest = (op >> 16) & 0x1f; int index = (op >> 7) & 0xf; int offset = (op & 0x7f); @@ -1449,7 +1449,7 @@ void rsp_cop2::handle_swc2(UINT32 op) for (i=0; i < 8; i++) { - UINT8 d = ((VREG_B(dest, ((index + (i << 1) + 0) & 0xf))) << 1) | + uint8_t d = ((VREG_B(dest, ((index + (i << 1) + 0) & 0xf))) << 1) | ((VREG_B(dest, ((index + (i << 1) + 1) & 0xf))) >> 7); m_rsp.WRITE8(ea, d); @@ -1531,24 +1531,24 @@ void rsp_cop2::handle_swc2(UINT32 op) //printf("STV "); #if 0 #else - INT32 index = (op >> 7) & 0xf; - INT32 offset = (op & 0x7f); + int32_t index = (op >> 7) & 0xf; + int32_t offset = (op & 0x7f); if (offset & 0x40) offset |= 0xffffffc0; - INT32 vs = (op >> 16) & 0x1f; - INT32 ve = vs + 8; + int32_t vs = (op >> 16) & 0x1f; + int32_t ve = vs + 8; if (ve > 32) ve = 32; - INT32 element = 8 - (index >> 1); + int32_t element = 8 - (index >> 1); - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); - INT32 eaoffset = (ea & 0xf) + (element * 2); + int32_t eaoffset = (ea & 0xf) + (element * 2); ea &= ~0xf; - for (INT32 i = vs; i < ve; i++) + for (int32_t i = vs; i < ve; i++) { m_rsp.WRITE16(ea + (eaoffset & 0xf), VREG_S(i, element & 0x7)); eaoffset += 2; @@ -1571,17 +1571,17 @@ void rsp_cop2::handle_swc2(UINT32 op) Vector Accumulator Helpers ***************************************************************************/ -UINT16 rsp_cop2::SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 positive) +uint16_t rsp_cop2::SATURATE_ACCUM(int accum, int slice, uint16_t negative, uint16_t positive) { - if ((INT16)ACCUM_H(accum) < 0) + if ((int16_t)ACCUM_H(accum) < 0) { - if ((UINT16)(ACCUM_H(accum)) != 0xffff) + if ((uint16_t)(ACCUM_H(accum)) != 0xffff) { return negative; } else { - if ((INT16)ACCUM_M(accum) >= 0) + if ((int16_t)ACCUM_M(accum) >= 0) { return negative; } @@ -1600,13 +1600,13 @@ UINT16 rsp_cop2::SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 po } else { - if ((UINT16)(ACCUM_H(accum)) != 0) + if ((uint16_t)(ACCUM_H(accum)) != 0) { return positive; } else { - if ((INT16)ACCUM_M(accum) < 0) + if ((int16_t)ACCUM_M(accum) < 0) { return positive; } @@ -1631,7 +1631,7 @@ UINT16 rsp_cop2::SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 po Vector Opcodes ***************************************************************************/ -void rsp_cop2::handle_vector_ops(UINT32 op) +void rsp_cop2::handle_vector_ops(uint32_t op) { #if !USE_SIMD int i; @@ -1656,7 +1656,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MULF "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); @@ -1670,8 +1670,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); if (s1 == -32768 && s2 == -32768) { @@ -1683,11 +1683,11 @@ void rsp_cop2::handle_vector_ops(UINT32 op) } else { - INT64 r = s1 * s2 * 2; + int64_t r = s1 * s2 * 2; r += 0x8000; // rounding ? SET_ACCUM_H((r < 0) ? 0xffff : 0, i); // sign-extend to 48-bit - SET_ACCUM_M((INT16)(r >> 16), i); - SET_ACCUM_L((UINT16)(r), i); + SET_ACCUM_M((int16_t)(r >> 16), i); + SET_ACCUM_L((uint16_t)(r), i); m_vres[i] = ACCUM_M(i); } } @@ -1708,7 +1708,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MULU "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); @@ -1722,21 +1722,21 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT64 r = s1 * s2 * 2; + int64_t r = s1 * s2 * 2; r += 0x8000; // rounding ? - SET_ACCUM_H((UINT16)(r >> 32), i); - SET_ACCUM_M((UINT16)(r >> 16), i); - SET_ACCUM_L((UINT16)(r), i); + SET_ACCUM_H((uint16_t)(r >> 32), i); + SET_ACCUM_M((uint16_t)(r >> 16), i); + SET_ACCUM_L((uint16_t)(r), i); if (r < 0) { m_vres[i] = 0; } - else if (((INT16)(ACCUM_H(i)) ^ (INT16)(ACCUM_M(i))) < 0) + else if (((int16_t)(ACCUM_H(i)) ^ (int16_t)(ACCUM_M(i))) < 0) { m_vres[i] = -1; } @@ -1764,7 +1764,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MUDL "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; acc_lo = read_acc_lo(acc); @@ -1782,13 +1782,13 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - UINT32 s1 = (UINT32)(UINT16)VREG_S(VS1REG, i); - UINT32 s2 = (UINT32)(UINT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - UINT32 r = s1 * s2; + uint32_t s1 = (uint32_t)(uint16_t)VREG_S(VS1REG, i); + uint32_t s2 = (uint32_t)(uint16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + uint32_t r = s1 * s2; SET_ACCUM_H(0, i); SET_ACCUM_M(0, i); - SET_ACCUM_L((UINT16)(r >> 16), i); + SET_ACCUM_L((uint16_t)(r >> 16), i); m_vres[i] = ACCUM_L(i); } @@ -1811,7 +1811,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MUDM "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; acc_lo = read_acc_lo(acc); @@ -1829,13 +1829,13 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - INT32 s2 = (UINT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); // not sign-extended - INT32 r = s1 * s2; + int32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + int32_t s2 = (uint16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); // not sign-extended + int32_t r = s1 * s2; SET_ACCUM_H((r < 0) ? 0xffff : 0, i); // sign-extend to 48-bit - SET_ACCUM_M((INT16)(r >> 16), i); - SET_ACCUM_L((UINT16)(r), i); + SET_ACCUM_M((int16_t)(r >> 16), i); + SET_ACCUM_L((uint16_t)(r), i); m_vres[i] = ACCUM_M(i); } @@ -1859,7 +1859,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MUDN "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo = read_acc_lo(acc); rsp_vec_t acc_mid = read_acc_mid(acc); rsp_vec_t acc_hi = read_acc_hi(acc); @@ -1875,13 +1875,13 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - INT32 s1 = (UINT16)VREG_S(VS1REG, i); // not sign-extended - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT32 r = s1 * s2; + int32_t s1 = (uint16_t)VREG_S(VS1REG, i); // not sign-extended + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t r = s1 * s2; SET_ACCUM_H((r < 0) ? 0xffff : 0, i); // sign-extend to 48-bit - SET_ACCUM_M((INT16)(r >> 16), i); - SET_ACCUM_L((UINT16)(r), i); + SET_ACCUM_M((int16_t)(r >> 16), i); + SET_ACCUM_L((uint16_t)(r), i); m_vres[i] = ACCUM_L(i); } @@ -1904,7 +1904,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MUDH "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; acc_lo = read_acc_lo(acc); @@ -1922,17 +1922,17 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT32 r = s1 * s2; + int32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t r = s1 * s2; - SET_ACCUM_H((INT16)(r >> 16), i); - SET_ACCUM_M((UINT16)(r), i); + SET_ACCUM_H((int16_t)(r >> 16), i); + SET_ACCUM_M((uint16_t)(r), i); SET_ACCUM_L(0, i); if (r < -32768) r = -32768; if (r > 32767) r = 32767; - m_vres[i] = (INT16)(r); + m_vres[i] = (int16_t)(r); } WRITEBACK_RESULT(); #endif @@ -1952,7 +1952,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MACF "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; acc_lo = read_acc_lo(acc); @@ -1970,21 +1970,21 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT32 r = s1 * s2; + int32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t r = s1 * s2; - UINT64 q = (UINT64)(UINT16)ACCUM_LL(i); - q |= (((UINT64)(UINT16)ACCUM_L(i)) << 16); - q |= (((UINT64)(UINT16)ACCUM_M(i)) << 32); - q |= (((UINT64)(UINT16)ACCUM_H(i)) << 48); + uint64_t q = (uint64_t)(uint16_t)ACCUM_LL(i); + q |= (((uint64_t)(uint16_t)ACCUM_L(i)) << 16); + q |= (((uint64_t)(uint16_t)ACCUM_M(i)) << 32); + q |= (((uint64_t)(uint16_t)ACCUM_H(i)) << 48); - q += (INT64)(r) << 17; + q += (int64_t)(r) << 17; - SET_ACCUM_LL((UINT16)q, i); - SET_ACCUM_L((UINT16)(q >> 16), i); - SET_ACCUM_M((UINT16)(q >> 32), i); - SET_ACCUM_H((UINT16)(q >> 48), i); + SET_ACCUM_LL((uint16_t)q, i); + SET_ACCUM_L((uint16_t)(q >> 16), i); + SET_ACCUM_M((uint16_t)(q >> 32), i); + SET_ACCUM_H((uint16_t)(q >> 48), i); m_vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff); } @@ -2003,7 +2003,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MACU "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; acc_lo = read_acc_lo(acc); @@ -2021,17 +2021,17 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i = 0; i < 8; i++) { - INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT32 r1 = s1 * s2; - UINT32 r2 = (UINT16)ACCUM_L(i) + ((UINT16)(r1) * 2); - UINT32 r3 = (UINT16)ACCUM_M(i) + (UINT16)((r1 >> 16) * 2) + (UINT16)(r2 >> 16); + int32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t r1 = s1 * s2; + uint32_t r2 = (uint16_t)ACCUM_L(i) + ((uint16_t)(r1) * 2); + uint32_t r3 = (uint16_t)ACCUM_M(i) + (uint16_t)((r1 >> 16) * 2) + (uint16_t)(r2 >> 16); - SET_ACCUM_L((UINT16)(r2), i); - SET_ACCUM_M((UINT16)(r3), i); - SET_ACCUM_H(ACCUM_H(i) + (UINT16)(r3 >> 16) + (UINT16)(r1 >> 31), i); + SET_ACCUM_L((uint16_t)(r2), i); + SET_ACCUM_M((uint16_t)(r3), i); + SET_ACCUM_H(ACCUM_H(i) + (uint16_t)(r3 >> 16) + (uint16_t)(r1 >> 31), i); - if ((INT16)ACCUM_H(i) < 0) + if ((int16_t)ACCUM_H(i) < 0) { m_vres[i] = 0; } @@ -2043,7 +2043,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) } else { - if ((INT16)ACCUM_M(i) < 0) + if ((int16_t)ACCUM_M(i) < 0) { m_vres[i] = 0xffff; } @@ -2073,7 +2073,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MADL "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; acc_lo = read_acc_lo(acc); @@ -2091,15 +2091,15 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i = 0; i < 8; i++) { - UINT32 s1 = (UINT32)(UINT16)VREG_S(VS1REG, i); - UINT32 s2 = (UINT32)(UINT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - UINT32 r1 = s1 * s2; - UINT32 r2 = (UINT16)ACCUM_L(i) + (r1 >> 16); - UINT32 r3 = (UINT16)ACCUM_M(i) + (r2 >> 16); + uint32_t s1 = (uint32_t)(uint16_t)VREG_S(VS1REG, i); + uint32_t s2 = (uint32_t)(uint16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + uint32_t r1 = s1 * s2; + uint32_t r2 = (uint16_t)ACCUM_L(i) + (r1 >> 16); + uint32_t r3 = (uint16_t)ACCUM_M(i) + (r2 >> 16); - SET_ACCUM_L((UINT16)(r2), i); - SET_ACCUM_M((UINT16)(r3), i); - SET_ACCUM_H(ACCUM_H(i) + (INT16)(r3 >> 16), i); + SET_ACCUM_L((uint16_t)(r2), i); + SET_ACCUM_M((uint16_t)(r3), i); + SET_ACCUM_H(ACCUM_H(i) + (int16_t)(r3 >> 16), i); m_vres[i] = SATURATE_ACCUM(i, 0, 0x0000, 0xffff); } @@ -2122,7 +2122,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MADM "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; acc_lo = read_acc_lo(acc); @@ -2140,16 +2140,16 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - UINT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - UINT32 s2 = (UINT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); // not sign-extended - UINT32 r1 = s1 * s2; - UINT32 r2 = (UINT16)ACCUM_L(i) + (UINT16)(r1); - UINT32 r3 = (UINT16)ACCUM_M(i) + (r1 >> 16) + (r2 >> 16); - - SET_ACCUM_L((UINT16)(r2), i); - SET_ACCUM_M((UINT16)(r3), i); - SET_ACCUM_H(ACCUM_H(i) + (UINT16)(r3 >> 16), i); - if ((INT32)(r1) < 0) + uint32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + uint32_t s2 = (uint16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); // not sign-extended + uint32_t r1 = s1 * s2; + uint32_t r2 = (uint16_t)ACCUM_L(i) + (uint16_t)(r1); + uint32_t r3 = (uint16_t)ACCUM_M(i) + (r1 >> 16) + (r2 >> 16); + + SET_ACCUM_L((uint16_t)(r2), i); + SET_ACCUM_M((uint16_t)(r3), i); + SET_ACCUM_H(ACCUM_H(i) + (uint16_t)(r3 >> 16), i); + if ((int32_t)(r1) < 0) SET_ACCUM_H(ACCUM_H(i) - 1, i); m_vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff); @@ -2173,7 +2173,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MADN "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; acc_lo = read_acc_lo(acc); @@ -2191,19 +2191,19 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - INT32 s1 = (UINT16)VREG_S(VS1REG, i); // not sign-extended - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t s1 = (uint16_t)VREG_S(VS1REG, i); // not sign-extended + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); - UINT64 q = (UINT64)ACCUM_LL(i); - q |= (((UINT64)ACCUM_L(i)) << 16); - q |= (((UINT64)ACCUM_M(i)) << 32); - q |= (((UINT64)ACCUM_H(i)) << 48); - q += (INT64)(s1*s2) << 16; + uint64_t q = (uint64_t)ACCUM_LL(i); + q |= (((uint64_t)ACCUM_L(i)) << 16); + q |= (((uint64_t)ACCUM_M(i)) << 32); + q |= (((uint64_t)ACCUM_H(i)) << 48); + q += (int64_t)(s1*s2) << 16; - SET_ACCUM_LL((UINT16)q, i); - SET_ACCUM_L((UINT16)(q >> 16), i); - SET_ACCUM_M((UINT16)(q >> 32), i); - SET_ACCUM_H((UINT16)(q >> 48), i); + SET_ACCUM_LL((uint16_t)q, i); + SET_ACCUM_L((uint16_t)(q >> 16), i); + SET_ACCUM_M((uint16_t)(q >> 32), i); + SET_ACCUM_H((uint16_t)(q >> 48), i); m_vres[i] = SATURATE_ACCUM(i, 0, 0x0000, 0xffff); } @@ -2227,7 +2227,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MADH "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t acc_lo, acc_mid, acc_hi; acc_lo = read_acc_lo(acc); @@ -2245,15 +2245,15 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i = 0; i < 8; i++) { - INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT32 accum = (UINT32)(UINT16)ACCUM_M(i); - accum |= ((UINT32)((UINT16)ACCUM_H(i))) << 16; + int32_t accum = (uint32_t)(uint16_t)ACCUM_M(i); + accum |= ((uint32_t)((uint16_t)ACCUM_H(i))) << 16; accum += s1 * s2; - SET_ACCUM_H((UINT16)(accum >> 16), i); - SET_ACCUM_M((UINT16)accum, i); + SET_ACCUM_H((uint16_t)(accum >> 16), i); + SET_ACCUM_M((uint16_t)accum, i); m_vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff); } @@ -2278,7 +2278,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("ADD "); #if USE_SIMD rsp_vec_t acc_lo; - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t carry = read_vco_lo(m_flags[RSP_VCO].s); rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); @@ -2292,15 +2292,15 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT32 r = s1 + s2 + (CARRY_FLAG(i) != 0 ? 1 : 0); + int32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t r = s1 + s2 + (CARRY_FLAG(i) != 0 ? 1 : 0); - SET_ACCUM_L((INT16)(r), i); + SET_ACCUM_L((int16_t)(r), i); if (r > 32767) r = 32767; if (r < -32768) r = -32768; - m_vres[i] = (INT16)(r); + m_vres[i] = (int16_t)(r); } CLEAR_ZERO_FLAGS(); CLEAR_CARRY_FLAGS(); @@ -2324,7 +2324,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("SUB "); #if USE_SIMD rsp_vec_t acc_lo; - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t carry = read_vco_lo(m_flags[RSP_VCO].s); rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); @@ -2338,16 +2338,16 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i = 0; i < 8; i++) { - INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i); - INT32 s2 = (INT32)(INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT32 r = s1 - s2 - (CARRY_FLAG(i) != 0 ? 1 : 0); + int32_t s1 = (int32_t)(int16_t)VREG_S(VS1REG, i); + int32_t s2 = (int32_t)(int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t r = s1 - s2 - (CARRY_FLAG(i) != 0 ? 1 : 0); - SET_ACCUM_L((INT16)(r), i); + SET_ACCUM_L((int16_t)(r), i); if (r > 32767) r = 32767; if (r < -32768) r = -32768; - m_vres[i] = (INT16)(r); + m_vres[i] = (int16_t)(r); } CLEAR_ZERO_FLAGS(); CLEAR_CARRY_FLAGS(); @@ -2370,7 +2370,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("ABS "); #if USE_SIMD rsp_vec_t acc_lo; - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL); @@ -2381,8 +2381,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i=0; i < 8; i++) { - INT16 s1 = (INT16)VREG_S(VS1REG, i); - INT16 s2 = (INT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int16_t s1 = (int16_t)VREG_S(VS1REG, i); + int16_t s2 = (int16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); if (s1 < 0) { @@ -2425,7 +2425,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("ADDC "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t sn; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); @@ -2442,12 +2442,12 @@ void rsp_cop2::handle_vector_ops(UINT32 op) for (i=0; i < 8; i++) { - INT32 s1 = (UINT32)(UINT16)VREG_S(VS1REG, i); - INT32 s2 = (UINT32)(UINT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT32 r = s1 + s2; + int32_t s1 = (uint32_t)(uint16_t)VREG_S(VS1REG, i); + int32_t s2 = (uint32_t)(uint16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t r = s1 + s2; - m_vres[i] = (INT16)(r); - SET_ACCUM_L((INT16)(r), i); + m_vres[i] = (int16_t)(r); + SET_ACCUM_L((int16_t)(r), i); if (r & 0xffff0000) { @@ -2473,7 +2473,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("SUBC "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t eq, sn; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); @@ -2490,14 +2490,14 @@ void rsp_cop2::handle_vector_ops(UINT32 op) for (i=0; i < 8; i++) { - INT32 s1 = (UINT32)(UINT16)VREG_S(VS1REG, i); - INT32 s2 = (UINT32)(UINT16)VREG_S(VS2REG, VEC_EL_2(EL, i)); - INT32 r = s1 - s2; + int32_t s1 = (uint32_t)(uint16_t)VREG_S(VS1REG, i); + int32_t s2 = (uint32_t)(uint16_t)VREG_S(VS2REG, VEC_EL_2(EL, i)); + int32_t r = s1 - s2; - m_vres[i] = (INT16)(r); - SET_ACCUM_L((UINT16)(r), i); + m_vres[i] = (int16_t)(r); + SET_ACCUM_L((uint16_t)(r), i); - if ((UINT16)(r) != 0) + if ((uint16_t)(r) != 0) { SET_ZERO_FLAG(i); } @@ -2523,7 +2523,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("SAW "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; switch (EL) { case 8: @@ -2588,7 +2588,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("LT "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t le; rsp_vec_t eq = read_vco_hi(m_flags[RSP_VCO].s); @@ -2610,7 +2610,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) for (i=0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; s1 = VREG_S(VS1REG, i); s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); if (s1 < s2) @@ -2657,7 +2657,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("EQ "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t le; rsp_vec_t eq = read_vco_hi(m_flags[RSP_VCO].s); @@ -2679,8 +2679,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op) for (i = 0; i < 8; i++) { - INT16 s1 = VREG_S(VS1REG, i); - INT16 s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); + int16_t s1 = VREG_S(VS1REG, i); + int16_t s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); if ((s1 == s2) && ZERO_FLAG(i) == 0) { @@ -2714,7 +2714,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("NE "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t le; rsp_vec_t eq = read_vco_hi(m_flags[RSP_VCO].s); @@ -2736,8 +2736,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op) for (i = 0; i < 8; i++) { - INT16 s1 = VREG_S(VS1REG, i); - INT16 s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); + int16_t s1 = VREG_S(VS1REG, i); + int16_t s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); if (s1 != s2 || ZERO_FLAG(i) != 0) { @@ -2772,7 +2772,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("GE "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t le; rsp_vec_t eq = read_vco_hi(m_flags[RSP_VCO].s); @@ -2794,8 +2794,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op) for (i=0; i < 8; i++) { - INT16 s1 = VREG_S(VS1REG, i); - INT16 s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); + int16_t s1 = VREG_S(VS1REG, i); + int16_t s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); if ((s1 == s2 && (ZERO_FLAG(i) == 0 || CARRY_FLAG(i) == 0)) || s1 > s2) { @@ -2829,7 +2829,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("CL "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t ge = read_vcc_hi(m_flags[RSP_VCC].s); rsp_vec_t le = read_vcc_lo(m_flags[RSP_VCC].s); @@ -2850,8 +2850,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #else for (i = 0; i < 8; i++) { - INT16 s1 = VREG_S(VS1REG, i); - INT16 s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); + int16_t s1 = VREG_S(VS1REG, i); + int16_t s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); if (CARRY_FLAG(i) != 0) // vco_lo { @@ -2859,7 +2859,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) { if (COMPARE_FLAG(i) != 0) // vcc_lo { - SET_ACCUM_L(-(UINT16)s2, i); + SET_ACCUM_L(-(uint16_t)s2, i); } else { @@ -2870,27 +2870,27 @@ void rsp_cop2::handle_vector_ops(UINT32 op) { if (CLIP1_FLAG(i) != 0) // vce { - if (((UINT32)(UINT16)(s1) + (UINT32)(UINT16)(s2)) > 0x10000) + if (((uint32_t)(uint16_t)(s1) + (uint32_t)(uint16_t)(s2)) > 0x10000) { SET_ACCUM_L(s1, i); CLEAR_COMPARE_FLAG(i); } else { - SET_ACCUM_L(-((UINT16)s2), i); + SET_ACCUM_L(-((uint16_t)s2), i); SET_COMPARE_FLAG(i); } } else { - if (((UINT32)(UINT16)(s1) + (UINT32)(UINT16)(s2)) != 0) + if (((uint32_t)(uint16_t)(s1) + (uint32_t)(uint16_t)(s2)) != 0) { SET_ACCUM_L(s1, i); CLEAR_COMPARE_FLAG(i); } else { - SET_ACCUM_L(-((UINT16)s2), i); + SET_ACCUM_L(-((uint16_t)s2), i); SET_COMPARE_FLAG(i); } } @@ -2911,7 +2911,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) } else { - if (((INT32)(UINT16)s1 - (INT32)(UINT16)s2) >= 0) + if (((int32_t)(uint16_t)s1 - (int32_t)(uint16_t)s2) >= 0) { SET_ACCUM_L(s2, i); SET_CLIP2_FLAG(i); @@ -2946,7 +2946,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("CH "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t ge, le, sign, eq, vce; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); @@ -2966,12 +2966,12 @@ void rsp_cop2::handle_vector_ops(UINT32 op) CLEAR_CLIP1_FLAGS(); CLEAR_ZERO_FLAGS(); CLEAR_CLIP2_FLAGS(); - UINT32 vce; + uint32_t vce; for (i=0; i < 8; i++) { - INT16 s1 = VREG_S(VS1REG, i); - INT16 s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); + int16_t s1 = VREG_S(VS1REG, i); + int16_t s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); if ((s1 ^ s2) < 0) { @@ -2985,7 +2985,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) if (s1 + s2 <= 0) { SET_COMPARE_FLAG(i); - m_vres[i] = -((UINT16)s2); + m_vres[i] = -((uint16_t)s2); } else { @@ -3049,7 +3049,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("CR "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t ge, le; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); @@ -3072,10 +3072,10 @@ void rsp_cop2::handle_vector_ops(UINT32 op) for (i=0; i < 8; i++) { - INT16 s1 = VREG_S(VS1REG, i); - INT16 s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); + int16_t s1 = VREG_S(VS1REG, i); + int16_t s2 = VREG_S(VS2REG, VEC_EL_2(EL, i)); - if ((INT16)(s1 ^ s2) < 0) + if ((int16_t)(s1 ^ s2) < 0) { if (s2 < 0) { @@ -3083,7 +3083,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) } if ((s1 + s2) <= 0) { - SET_ACCUM_L(~((UINT16)s2), i); + SET_ACCUM_L(~((uint16_t)s2), i); SET_COMPARE_FLAG(i); } else @@ -3127,7 +3127,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("MRG "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t le = read_vcc_lo(m_flags[RSP_VCC].s); rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); @@ -3168,7 +3168,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("AND "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL); @@ -3198,7 +3198,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("NAND "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL); @@ -3228,7 +3228,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("OR "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL); @@ -3258,7 +3258,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("NOR "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL); @@ -3288,7 +3288,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("XOR "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL); @@ -3318,7 +3318,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) //printf("NXOR "); #if USE_SIMD - UINT16 *acc = m_acc.s; + uint16_t *acc = m_acc.s; rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s); rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL); @@ -3351,15 +3351,15 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #if USE_SIMD write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL)); - INT32 dp = op & m_dp_flag; + int32_t dp = op & m_dp_flag; m_dp_flag = 0; m_v[VDREG].v = vec_vrcp_vrsq(op, dp, VS2REG, EL, VDREG, VS1REG); #else - INT32 shifter = 0; + int32_t shifter = 0; - INT32 rec = (INT16)(VREG_S(VS2REG, EL & 7)); - INT32 datainput = (rec < 0) ? (-rec) : rec; + int32_t rec = (int16_t)(VREG_S(VS2REG, EL & 7)); + int32_t datainput = (rec < 0) ? (-rec) : rec; if (datainput) { for (i = 0; i < 32; i++) @@ -3376,9 +3376,9 @@ void rsp_cop2::handle_vector_ops(UINT32 op) shifter = 0x10; } - INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; - INT32 fetchval = rsp_divtable[address]; - INT32 temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); + int32_t address = ((datainput << shifter) & 0x7fc00000) >> 22; + int32_t fetchval = rsp_divtable[address]; + int32_t temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); if (rec < 0) { temp = ~temp; @@ -3396,7 +3396,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) m_reciprocal_res = rec; m_dp_allowed = 0; - VREG_S(VDREG, VS1REG & 7) = (UINT16)(rec & 0xffff); + VREG_S(VDREG, VS1REG & 7) = (uint16_t)(rec & 0xffff); for (i = 0; i < 8; i++) { @@ -3422,15 +3422,15 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #if USE_SIMD write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL)); - INT32 dp = op & m_dp_flag; + int32_t dp = op & m_dp_flag; m_dp_flag = 0; m_v[VDREG].v = vec_vrcp_vrsq(op, dp, VS2REG, EL, VDREG, VS1REG); #else - INT32 shifter = 0; + int32_t shifter = 0; - INT32 rec = (INT16)VREG_S(VS2REG, EL & 7); - INT32 datainput = rec; + int32_t rec = (int16_t)VREG_S(VS2REG, EL & 7); + int32_t datainput = rec; if (m_dp_allowed) { @@ -3466,9 +3466,9 @@ void rsp_cop2::handle_vector_ops(UINT32 op) } } - INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; - INT32 fetchval = rsp_divtable[address]; - INT32 temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); + int32_t address = ((datainput << shifter) & 0x7fc00000) >> 22; + int32_t fetchval = rsp_divtable[address]; + int32_t temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); temp ^= rec >> 31; if (!rec) @@ -3484,7 +3484,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) m_reciprocal_res = rec; m_dp_allowed = 0; - VREG_S(VDREG, VS1REG & 7) = (UINT16)(rec & 0xffff); + VREG_S(VDREG, VS1REG & 7) = (uint16_t)(rec & 0xffff); for (i = 0; i < 8; i++) { @@ -3521,7 +3521,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) SET_ACCUM_L(VREG_S(VS2REG, VEC_EL_2(EL, i)), i); } - VREG_S(VDREG, VS1REG & 7) = (INT16)(m_reciprocal_res >> 16); + VREG_S(VDREG, VS1REG & 7) = (int16_t)(m_reciprocal_res >> 16); #endif // @@ -3565,15 +3565,15 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #if USE_SIMD write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL)); - INT32 dp = op & m_dp_flag; + int32_t dp = op & m_dp_flag; m_dp_flag = 0; m_v[VDREG].v = vec_vrcp_vrsq(op, dp, VS2REG, EL, VDREG, VS1REG); #else - INT32 shifter = 0; + int32_t shifter = 0; - INT32 rec = (INT16)(VREG_S(VS2REG, EL & 7)); - INT32 datainput = (rec < 0) ? (-rec) : rec; + int32_t rec = (int16_t)(VREG_S(VS2REG, EL & 7)); + int32_t datainput = (rec < 0) ? (-rec) : rec; if (datainput) { for (i = 0; i < 32; i++) @@ -3590,11 +3590,11 @@ void rsp_cop2::handle_vector_ops(UINT32 op) shifter = 0x10; } - INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; + int32_t address = ((datainput << shifter) & 0x7fc00000) >> 22; address = ((address | 0x200) & 0x3fe) | (shifter & 1); - INT32 fetchval = rsp_divtable[address]; - INT32 temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); + int32_t fetchval = rsp_divtable[address]; + int32_t temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); if (rec < 0) { temp = ~temp; @@ -3612,7 +3612,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) m_reciprocal_res = rec; m_dp_allowed = 0; - VREG_S(VDREG, VS1REG & 7) = (UINT16)(rec & 0xffff); + VREG_S(VDREG, VS1REG & 7) = (uint16_t)(rec & 0xffff); for (i = 0; i < 8; i++) { @@ -3637,14 +3637,14 @@ void rsp_cop2::handle_vector_ops(UINT32 op) #if USE_SIMD write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL)); - INT32 dp = op & m_dp_flag; + int32_t dp = op & m_dp_flag; m_dp_flag = 0; m_v[VDREG].v = vec_vrcp_vrsq(op, dp, VS2REG, EL, VDREG, VS1REG); #else - INT32 shifter = 0; - INT32 rec = (INT16)VREG_S(VS2REG, EL & 7); - INT32 datainput = rec; + int32_t shifter = 0; + int32_t rec = (int16_t)VREG_S(VS2REG, EL & 7); + int32_t datainput = rec; if (m_dp_allowed) { @@ -3682,11 +3682,11 @@ void rsp_cop2::handle_vector_ops(UINT32 op) } } - INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; + int32_t address = ((datainput << shifter) & 0x7fc00000) >> 22; address = ((address | 0x200) & 0x3fe) | (shifter & 1); - INT32 fetchval = rsp_divtable[address]; - INT32 temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); + int32_t fetchval = rsp_divtable[address]; + int32_t temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); temp ^= rec >> 31; if (!rec) @@ -3702,7 +3702,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) m_reciprocal_res = rec; m_dp_allowed = 0; - VREG_S(VDREG, VS1REG & 7) = (UINT16)(rec & 0xffff); + VREG_S(VDREG, VS1REG & 7) = (uint16_t)(rec & 0xffff); for (i = 0; i < 8; i++) { @@ -3739,7 +3739,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) SET_ACCUM_L(VREG_S(VS2REG, VEC_EL_2(EL, i)), i); } - VREG_S(VDREG, VS1REG & 7) = (INT16)(m_reciprocal_res >> 16); // store high part + VREG_S(VDREG, VS1REG & 7) = (int16_t)(m_reciprocal_res >> 16); // store high part #endif // break; @@ -3766,7 +3766,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op) Vector Flag Reading/Writing ***************************************************************************/ -void rsp_cop2::handle_cop2(UINT32 op) +void rsp_cop2::handle_cop2(uint32_t op) { switch ((op >> 21) & 0x1f) { @@ -3779,9 +3779,9 @@ void rsp_cop2::handle_cop2(UINT32 op) // //printf("MFC2 "); int el = (op >> 7) & 0xf; - UINT16 b1 = VREG_B(RDREG, (el+0) & 0xf); - UINT16 b2 = VREG_B(RDREG, (el+1) & 0xf); - if (RTREG) RTVAL = (INT32)(INT16)((b1 << 8) | (b2)); + uint16_t b1 = VREG_B(RDREG, (el+0) & 0xf); + uint16_t b2 = VREG_B(RDREG, (el+1) & 0xf); + if (RTREG) RTVAL = (int32_t)(int16_t)((b1 << 8) | (b2)); break; } @@ -3796,7 +3796,7 @@ void rsp_cop2::handle_cop2(UINT32 op) if (RTREG) { #if USE_SIMD - INT32 src = RDREG & 3; + int32_t src = RDREG & 3; if (src == 3) { src = 2; } @@ -3885,14 +3885,14 @@ void rsp_cop2::handle_cop2(UINT32 op) case 0: case 1: case 2: - UINT16 r0 = (RTVAL & (1 << 0)) ? 0xffff : 0; - UINT16 r1 = (RTVAL & (1 << 1)) ? 0xffff : 0; - UINT16 r2 = (RTVAL & (1 << 2)) ? 0xffff : 0; - UINT16 r3 = (RTVAL & (1 << 3)) ? 0xffff : 0; - UINT16 r4 = (RTVAL & (1 << 4)) ? 0xffff : 0; - UINT16 r5 = (RTVAL & (1 << 5)) ? 0xffff : 0; - UINT16 r6 = (RTVAL & (1 << 6)) ? 0xffff : 0; - UINT16 r7 = (RTVAL & (1 << 7)) ? 0xffff : 0; + uint16_t r0 = (RTVAL & (1 << 0)) ? 0xffff : 0; + uint16_t r1 = (RTVAL & (1 << 1)) ? 0xffff : 0; + uint16_t r2 = (RTVAL & (1 << 2)) ? 0xffff : 0; + uint16_t r3 = (RTVAL & (1 << 3)) ? 0xffff : 0; + uint16_t r4 = (RTVAL & (1 << 4)) ? 0xffff : 0; + uint16_t r5 = (RTVAL & (1 << 5)) ? 0xffff : 0; + uint16_t r6 = (RTVAL & (1 << 6)) ? 0xffff : 0; + uint16_t r7 = (RTVAL & (1 << 7)) ? 0xffff : 0; m_flags[RDREG].__align[0] = _mm_set_epi16(r7, r6, r5, r4, r3, r2, r1, r0); r0 = (RTVAL & (1 << 8)) ? 0xffff : 0; r1 = (RTVAL & (1 << 9)) ? 0xffff : 0; @@ -3980,17 +3980,17 @@ void rsp_cop2::handle_cop2(UINT32 op) inline void rsp_cop2::mfc2() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int el = (op >> 7) & 0xf; - UINT16 b1 = VREG_B(VS1REG, (el+0) & 0xf); - UINT16 b2 = VREG_B(VS1REG, (el+1) & 0xf); - if (RTREG) RTVAL = (INT32)(INT16)((b1 << 8) | (b2)); + uint16_t b1 = VREG_B(VS1REG, (el+0) & 0xf); + uint16_t b2 = VREG_B(VS1REG, (el+1) & 0xf); + if (RTREG) RTVAL = (int32_t)(int16_t)((b1 << 8) | (b2)); } inline void rsp_cop2::cfc2() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; if (RTREG) { switch(RDREG) @@ -4049,7 +4049,7 @@ inline void rsp_cop2::cfc2() inline void rsp_cop2::mtc2() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int el = (op >> 7) & 0xf; VREG_B(VS1REG, (el+0) & 0xf) = (RTVAL >> 8) & 0xff; VREG_B(VS1REG, (el+1) & 0xf) = (RTVAL >> 0) & 0xff; @@ -4057,7 +4057,7 @@ inline void rsp_cop2::mtc2() inline void rsp_cop2::ctc2() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; switch(RDREG) { case 0: @@ -4163,14 +4163,14 @@ void rsp_cop2::log_instruction_execution() if (m_v[i].d[0] != prev_vecs[i].d[0] || m_v[i].d[1] != prev_vecs[i].d[1]) { fprintf(m_rsp.m_exec_output, "V%d: %04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X ", i, - (UINT16)VREG_S(i,0), (UINT16)VREG_S(i,1), (UINT16)VREG_S(i,2), (UINT16)VREG_S(i,3), (UINT16)VREG_S(i,4), (UINT16)VREG_S(i,5), (UINT16)VREG_S(i,6), (UINT16)VREG_S(i,7)); + (uint16_t)VREG_S(i,0), (uint16_t)VREG_S(i,1), (uint16_t)VREG_S(i,2), (uint16_t)VREG_S(i,3), (uint16_t)VREG_S(i,4), (uint16_t)VREG_S(i,5), (uint16_t)VREG_S(i,6), (uint16_t)VREG_S(i,7)); } prev_vecs[i].d[0] = m_v[i].d[0]; prev_vecs[i].d[1] = m_v[i].d[1]; } } -void rsp_cop2::dump(UINT32 op) +void rsp_cop2::dump(uint32_t op) { printf("%08x ", op); for (int i = 0; i < 32; i++) @@ -4207,7 +4207,7 @@ void rsp_cop2::dump(UINT32 op) void rsp_cop2::dump_dmem() { - UINT8* dmem = m_rsp.get_dmem(); + uint8_t* dmem = m_rsp.get_dmem(); printf("\n"); for (int i = 0; i < 0x1000; i += 32) { diff --git a/src/devices/cpu/rsp/rspcp2.h b/src/devices/cpu/rsp/rspcp2.h index 9eb0bb37fdc..5f477963940 100644 --- a/src/devices/cpu/rsp/rspcp2.h +++ b/src/devices/cpu/rsp/rspcp2.h @@ -56,10 +56,10 @@ typedef __m128i rsp_vec_t; union VECTOR_REG { - UINT64 d[2]; - UINT32 l[4]; - UINT16 s[8]; - UINT8 b[16]; + uint64_t d[2]; + uint32_t l[4]; + uint16_t s[8]; + uint8_t b[16]; #if USE_SIMD rsp_vec_t v; #endif @@ -67,9 +67,9 @@ union VECTOR_REG union ACCUMULATOR_REG { - UINT64 q; - UINT32 l[2]; - UINT16 w[4]; + uint64_t q; + uint32_t l[2]; + uint16_t w[4]; }; struct compiler_state; @@ -163,29 +163,29 @@ public: virtual void mtc2(); virtual void ctc2(); - virtual void handle_cop2(UINT32 op); + virtual void handle_cop2(uint32_t op); void log_instruction_execution(); virtual void cfunc_unimplemented_opcode() { } - void dump(UINT32 op); + void dump(uint32_t op); void dump_dmem(); protected: virtual int generate_vector_opcode(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc) { return TRUE; } - UINT16 SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 positive); + uint16_t SATURATE_ACCUM(int accum, int slice, uint16_t negative, uint16_t positive); // Data that needs to be stored close to the generated DRC code struct internal_rspcop2_state { - UINT32 op; + uint32_t op; }; internal_rspcop2_state *m_rspcop2_state; rsp_device& m_rsp; running_machine& m_machine; - UINT32 m_vres[8]; /* used for temporary vector results */ + uint32_t m_vres[8]; /* used for temporary vector results */ #if USE_SIMD __align16 VECTOR_REG m_v[32]; @@ -193,11 +193,11 @@ protected: VECTOR_REG m_v[32]; #endif ACCUMULATOR_REG m_accum[8]; - UINT16 m_vflag[6][8]; + uint16_t m_vflag[6][8]; - INT32 m_reciprocal_res; - UINT32 m_reciprocal_high; - INT32 m_dp_allowed; + int32_t m_reciprocal_res; + uint32_t m_reciprocal_high; + int32_t m_dp_allowed; #if USE_SIMD enum rsp_flags_t { @@ -226,60 +226,60 @@ protected: union aligned_rsp_1vect_t { rsp_vec_t __align; - UINT16 s[8]; + uint16_t s[8]; }; union aligned_rsp_2vect_t { rsp_vec_t __align[2]; - UINT16 s[16]; + uint16_t s[16]; }; union aligned_rsp_3vect_t { rsp_vec_t __align[3]; - UINT16 s[24]; + uint16_t s[24]; }; __align16 aligned_rsp_1vect_t m_vdqm; __align16 aligned_rsp_2vect_t m_flags[3]; __align16 aligned_rsp_3vect_t m_acc; - UINT32 m_dp_flag; + uint32_t m_dp_flag; typedef struct { rsp_vec_t dummy_for_alignment; - const UINT16 logic_mask[2][8]; - const UINT16 vrsq_mask_table[8][8]; - const UINT16 shuffle_keys[16][8]; - const UINT16 sll_b2l_keys[16][8]; - const UINT16 sll_l2b_keys[16][8]; - const UINT16 srl_b2l_keys[16][8]; - const UINT16 ror_b2l_keys[16][8]; - const UINT16 rol_l2b_keys[16][8]; - const UINT16 ror_l2b_keys[16][8]; - const UINT16 qr_lut[16][8]; - const UINT16 bdls_lut[4][4]; - const UINT16 word_reverse[8]; + const uint16_t logic_mask[2][8]; + const uint16_t vrsq_mask_table[8][8]; + const uint16_t shuffle_keys[16][8]; + const uint16_t sll_b2l_keys[16][8]; + const uint16_t sll_l2b_keys[16][8]; + const uint16_t srl_b2l_keys[16][8]; + const uint16_t ror_b2l_keys[16][8]; + const uint16_t rol_l2b_keys[16][8]; + const uint16_t ror_l2b_keys[16][8]; + const uint16_t qr_lut[16][8]; + const uint16_t bdls_lut[4][4]; + const uint16_t word_reverse[8]; } vec_helpers_t; static const vec_helpers_t m_vec_helpers; - rsp_vec_t vec_load_and_shuffle_operand(const UINT16* src, UINT32 element); - static inline UINT32 sign_extend_6(INT32 i) { + rsp_vec_t vec_load_and_shuffle_operand(const uint16_t* src, uint32_t element); + static inline uint32_t sign_extend_6(int32_t i) { return ((i << (32 - 7)) >> (32 - 7)) & 0xfff; } static inline rsp_vec_t vec_load_unshuffled_operand(const void* src) { return _mm_load_si128((rsp_vec_t*) src); } - static inline void vec_write_operand(UINT16* dest, rsp_vec_t src) + static inline void vec_write_operand(uint16_t* dest, rsp_vec_t src) { _mm_store_si128((rsp_vec_t*) dest, src); } - static inline rsp_vec_t read_acc_lo(const UINT16* acc) + static inline rsp_vec_t read_acc_lo(const uint16_t* acc) { return vec_load_unshuffled_operand(acc + sizeof(rsp_vec_t)); } - static inline rsp_vec_t read_acc_mid(const UINT16* acc) + static inline rsp_vec_t read_acc_mid(const uint16_t* acc) { return vec_load_unshuffled_operand(acc + (sizeof(rsp_vec_t) >> 1)); } @@ -287,60 +287,60 @@ protected: { return vec_load_unshuffled_operand(acc); } - static inline rsp_vec_t read_vcc_lo(const UINT16 *vcc) + static inline rsp_vec_t read_vcc_lo(const uint16_t *vcc) { return vec_load_unshuffled_operand(vcc + (sizeof(rsp_vec_t) >> 1)); } - static inline rsp_vec_t read_vcc_hi(const UINT16 *vcc) + static inline rsp_vec_t read_vcc_hi(const uint16_t *vcc) { return vec_load_unshuffled_operand(vcc); } - static inline rsp_vec_t read_vco_lo(const UINT16 *vco) + static inline rsp_vec_t read_vco_lo(const uint16_t *vco) { return vec_load_unshuffled_operand(vco + (sizeof(rsp_vec_t) >> 1)); } - static inline rsp_vec_t read_vco_hi(const UINT16 *vco) + static inline rsp_vec_t read_vco_hi(const uint16_t *vco) { return vec_load_unshuffled_operand(vco); } - static inline rsp_vec_t read_vce(const UINT16 *vce) + static inline rsp_vec_t read_vce(const uint16_t *vce) { return vec_load_unshuffled_operand(vce + (sizeof(rsp_vec_t) >> 1)); } - static inline void write_acc_lo(UINT16 *acc, rsp_vec_t acc_lo) + static inline void write_acc_lo(uint16_t *acc, rsp_vec_t acc_lo) { return vec_write_operand(acc + sizeof(rsp_vec_t), acc_lo); } - static inline void write_acc_mid(UINT16 *acc, rsp_vec_t acc_mid) + static inline void write_acc_mid(uint16_t *acc, rsp_vec_t acc_mid) { return vec_write_operand(acc + (sizeof(rsp_vec_t) >> 1), acc_mid); } - static inline void write_acc_hi(UINT16 *acc, rsp_vec_t acc_hi) + static inline void write_acc_hi(uint16_t *acc, rsp_vec_t acc_hi) { return vec_write_operand(acc, acc_hi); } - static inline void write_vcc_lo(UINT16 *vcc, rsp_vec_t vcc_lo) + static inline void write_vcc_lo(uint16_t *vcc, rsp_vec_t vcc_lo) { return vec_write_operand(vcc + (sizeof(rsp_vec_t) >> 1), vcc_lo); } - static inline void write_vcc_hi(UINT16 *vcc, rsp_vec_t vcc_hi) + static inline void write_vcc_hi(uint16_t *vcc, rsp_vec_t vcc_hi) { return vec_write_operand(vcc, vcc_hi); } - static inline void write_vco_lo(UINT16 *vcc, rsp_vec_t vco_lo) + static inline void write_vco_lo(uint16_t *vcc, rsp_vec_t vco_lo) { return vec_write_operand(vcc + (sizeof(rsp_vec_t) >> 1), vco_lo); } - static inline void write_vco_hi(UINT16 *vcc, rsp_vec_t vco_hi) + static inline void write_vco_hi(uint16_t *vcc, rsp_vec_t vco_hi) { return vec_write_operand(vcc, vco_hi); } - static inline void write_vce(UINT16 *vce, rsp_vec_t vce_r) + static inline void write_vce(uint16_t *vce, rsp_vec_t vce_r) { return vec_write_operand(vce + (sizeof(rsp_vec_t) >> 1), vce_r); } - static inline INT16 get_flags(const UINT16 *flags) + static inline int16_t get_flags(const uint16_t *flags) { return _mm_movemask_epi8(_mm_packs_epi16(_mm_load_si128((rsp_vec_t*) (flags + (sizeof(rsp_vec_t) >> 1))), _mm_load_si128((rsp_vec_t*) flags))); } @@ -350,12 +350,12 @@ protected: return _mm_setzero_si128(); } - void vec_load_group1(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm); - void vec_load_group2(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); - void vec_load_group4(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); - void vec_store_group1(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm); - void vec_store_group2(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); - void vec_store_group4(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); + void vec_load_group1(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm); + void vec_load_group2(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); + void vec_load_group4(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); + void vec_store_group1(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm); + void vec_store_group2(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); + void vec_store_group4(uint32_t addr, uint32_t element, uint16_t* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type); #include "clamp.h" #include "vabs.h" @@ -385,12 +385,12 @@ protected: #endif private: - void handle_lwc2(UINT32 op); - void handle_swc2(UINT32 op); - void handle_vector_ops(UINT32 op); + void handle_lwc2(uint32_t op); + void handle_swc2(uint32_t op); + void handle_vector_ops(uint32_t op); - UINT32 m_div_in; - UINT32 m_div_out; + uint32_t m_div_in; + uint32_t m_div_out; }; #endif /* __RSPCP2_H__ */ diff --git a/src/devices/cpu/rsp/rspcp2d.cpp b/src/devices/cpu/rsp/rspcp2d.cpp index cdcfb175f47..7efb3f34b12 100644 --- a/src/devices/cpu/rsp/rspcp2d.cpp +++ b/src/devices/cpu/rsp/rspcp2d.cpp @@ -19,7 +19,7 @@ using namespace uml; -extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); +extern offs_t rsp_dasm_one(char *buffer, offs_t pc, uint32_t op); /*************************************************************************** Helpful Defines @@ -36,7 +36,7 @@ extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); #define VREG_B(reg, offset) m_v[(reg)].b[(offset)^1] #define W_VREG_S(reg, offset) m_v[(reg)].s[(offset)] -#define VREG_S(reg, offset) (INT16)m_v[(reg)].s[(offset)] +#define VREG_S(reg, offset) (int16_t)m_v[(reg)].s[(offset)] #define VEC_EL_2(x,z) (vector_elements_2[(x)][(z)]) @@ -53,10 +53,10 @@ static void cfunc_cfc2(void *param); static void cfunc_mtc2(void *param); static void cfunc_ctc2(void *param); -#define ACCUM_H(x) (UINT16)m_accum[x].w[3] -#define ACCUM_M(x) (UINT16)m_accum[x].w[2] -#define ACCUM_L(x) (UINT16)m_accum[x].w[1] -#define ACCUM_LL(x) (UINT16)m_accum[x].w[0] +#define ACCUM_H(x) (uint16_t)m_accum[x].w[3] +#define ACCUM_M(x) (uint16_t)m_accum[x].w[2] +#define ACCUM_L(x) (uint16_t)m_accum[x].w[1] +#define ACCUM_LL(x) (uint16_t)m_accum[x].w[0] #define ACCUM(x) m_accum[x].q #define SET_ACCUM_H(v, x) m_accum[x].w[3] = v; @@ -132,7 +132,7 @@ static const int vector_elements_2[16][8] = void rsp_cop2_drc::cfunc_unimplemented_opcode() { - const UINT32 ppc = m_rsp.m_ppc; + const uint32_t ppc = m_rsp.m_ppc; if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0) { char string[200]; @@ -152,100 +152,100 @@ void rsp_cop2_drc::state_string_export(const int index, std::string &str) const switch (index) { case RSP_V0: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 0, 0), (UINT16)VREG_S( 0, 1), (UINT16)VREG_S( 0, 2), (UINT16)VREG_S( 0, 3), (UINT16)VREG_S( 0, 4), (UINT16)VREG_S( 0, 5), (UINT16)VREG_S( 0, 6), (UINT16)VREG_S( 0, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 0, 0), (uint16_t)VREG_S( 0, 1), (uint16_t)VREG_S( 0, 2), (uint16_t)VREG_S( 0, 3), (uint16_t)VREG_S( 0, 4), (uint16_t)VREG_S( 0, 5), (uint16_t)VREG_S( 0, 6), (uint16_t)VREG_S( 0, 7)); break; case RSP_V1: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 1, 0), (UINT16)VREG_S( 1, 1), (UINT16)VREG_S( 1, 2), (UINT16)VREG_S( 1, 3), (UINT16)VREG_S( 1, 4), (UINT16)VREG_S( 1, 5), (UINT16)VREG_S( 1, 6), (UINT16)VREG_S( 1, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 1, 0), (uint16_t)VREG_S( 1, 1), (uint16_t)VREG_S( 1, 2), (uint16_t)VREG_S( 1, 3), (uint16_t)VREG_S( 1, 4), (uint16_t)VREG_S( 1, 5), (uint16_t)VREG_S( 1, 6), (uint16_t)VREG_S( 1, 7)); break; case RSP_V2: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 2, 0), (UINT16)VREG_S( 2, 1), (UINT16)VREG_S( 2, 2), (UINT16)VREG_S( 2, 3), (UINT16)VREG_S( 2, 4), (UINT16)VREG_S( 2, 5), (UINT16)VREG_S( 2, 6), (UINT16)VREG_S( 2, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 2, 0), (uint16_t)VREG_S( 2, 1), (uint16_t)VREG_S( 2, 2), (uint16_t)VREG_S( 2, 3), (uint16_t)VREG_S( 2, 4), (uint16_t)VREG_S( 2, 5), (uint16_t)VREG_S( 2, 6), (uint16_t)VREG_S( 2, 7)); break; case RSP_V3: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 3, 0), (UINT16)VREG_S( 3, 1), (UINT16)VREG_S( 3, 2), (UINT16)VREG_S( 3, 3), (UINT16)VREG_S( 3, 4), (UINT16)VREG_S( 3, 5), (UINT16)VREG_S( 3, 6), (UINT16)VREG_S( 3, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 3, 0), (uint16_t)VREG_S( 3, 1), (uint16_t)VREG_S( 3, 2), (uint16_t)VREG_S( 3, 3), (uint16_t)VREG_S( 3, 4), (uint16_t)VREG_S( 3, 5), (uint16_t)VREG_S( 3, 6), (uint16_t)VREG_S( 3, 7)); break; case RSP_V4: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 4, 0), (UINT16)VREG_S( 4, 1), (UINT16)VREG_S( 4, 2), (UINT16)VREG_S( 4, 3), (UINT16)VREG_S( 4, 4), (UINT16)VREG_S( 4, 5), (UINT16)VREG_S( 4, 6), (UINT16)VREG_S( 4, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 4, 0), (uint16_t)VREG_S( 4, 1), (uint16_t)VREG_S( 4, 2), (uint16_t)VREG_S( 4, 3), (uint16_t)VREG_S( 4, 4), (uint16_t)VREG_S( 4, 5), (uint16_t)VREG_S( 4, 6), (uint16_t)VREG_S( 4, 7)); break; case RSP_V5: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 5, 0), (UINT16)VREG_S( 5, 1), (UINT16)VREG_S( 5, 2), (UINT16)VREG_S( 5, 3), (UINT16)VREG_S( 5, 4), (UINT16)VREG_S( 5, 5), (UINT16)VREG_S( 5, 6), (UINT16)VREG_S( 5, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 5, 0), (uint16_t)VREG_S( 5, 1), (uint16_t)VREG_S( 5, 2), (uint16_t)VREG_S( 5, 3), (uint16_t)VREG_S( 5, 4), (uint16_t)VREG_S( 5, 5), (uint16_t)VREG_S( 5, 6), (uint16_t)VREG_S( 5, 7)); break; case RSP_V6: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 6, 0), (UINT16)VREG_S( 6, 1), (UINT16)VREG_S( 6, 2), (UINT16)VREG_S( 6, 3), (UINT16)VREG_S( 6, 4), (UINT16)VREG_S( 6, 5), (UINT16)VREG_S( 6, 6), (UINT16)VREG_S( 6, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 6, 0), (uint16_t)VREG_S( 6, 1), (uint16_t)VREG_S( 6, 2), (uint16_t)VREG_S( 6, 3), (uint16_t)VREG_S( 6, 4), (uint16_t)VREG_S( 6, 5), (uint16_t)VREG_S( 6, 6), (uint16_t)VREG_S( 6, 7)); break; case RSP_V7: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 7, 0), (UINT16)VREG_S( 7, 1), (UINT16)VREG_S( 7, 2), (UINT16)VREG_S( 7, 3), (UINT16)VREG_S( 7, 4), (UINT16)VREG_S( 7, 5), (UINT16)VREG_S( 7, 6), (UINT16)VREG_S( 7, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 7, 0), (uint16_t)VREG_S( 7, 1), (uint16_t)VREG_S( 7, 2), (uint16_t)VREG_S( 7, 3), (uint16_t)VREG_S( 7, 4), (uint16_t)VREG_S( 7, 5), (uint16_t)VREG_S( 7, 6), (uint16_t)VREG_S( 7, 7)); break; case RSP_V8: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 8, 0), (UINT16)VREG_S( 8, 1), (UINT16)VREG_S( 8, 2), (UINT16)VREG_S( 8, 3), (UINT16)VREG_S( 8, 4), (UINT16)VREG_S( 8, 5), (UINT16)VREG_S( 8, 6), (UINT16)VREG_S( 8, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 8, 0), (uint16_t)VREG_S( 8, 1), (uint16_t)VREG_S( 8, 2), (uint16_t)VREG_S( 8, 3), (uint16_t)VREG_S( 8, 4), (uint16_t)VREG_S( 8, 5), (uint16_t)VREG_S( 8, 6), (uint16_t)VREG_S( 8, 7)); break; case RSP_V9: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S( 9, 0), (UINT16)VREG_S( 9, 1), (UINT16)VREG_S( 9, 2), (UINT16)VREG_S( 9, 3), (UINT16)VREG_S( 9, 4), (UINT16)VREG_S( 9, 5), (UINT16)VREG_S( 9, 6), (UINT16)VREG_S( 9, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S( 9, 0), (uint16_t)VREG_S( 9, 1), (uint16_t)VREG_S( 9, 2), (uint16_t)VREG_S( 9, 3), (uint16_t)VREG_S( 9, 4), (uint16_t)VREG_S( 9, 5), (uint16_t)VREG_S( 9, 6), (uint16_t)VREG_S( 9, 7)); break; case RSP_V10: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(10, 0), (UINT16)VREG_S(10, 1), (UINT16)VREG_S(10, 2), (UINT16)VREG_S(10, 3), (UINT16)VREG_S(10, 4), (UINT16)VREG_S(10, 5), (UINT16)VREG_S(10, 6), (UINT16)VREG_S(10, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(10, 0), (uint16_t)VREG_S(10, 1), (uint16_t)VREG_S(10, 2), (uint16_t)VREG_S(10, 3), (uint16_t)VREG_S(10, 4), (uint16_t)VREG_S(10, 5), (uint16_t)VREG_S(10, 6), (uint16_t)VREG_S(10, 7)); break; case RSP_V11: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(11, 0), (UINT16)VREG_S(11, 1), (UINT16)VREG_S(11, 2), (UINT16)VREG_S(11, 3), (UINT16)VREG_S(11, 4), (UINT16)VREG_S(11, 5), (UINT16)VREG_S(11, 6), (UINT16)VREG_S(11, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(11, 0), (uint16_t)VREG_S(11, 1), (uint16_t)VREG_S(11, 2), (uint16_t)VREG_S(11, 3), (uint16_t)VREG_S(11, 4), (uint16_t)VREG_S(11, 5), (uint16_t)VREG_S(11, 6), (uint16_t)VREG_S(11, 7)); break; case RSP_V12: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(12, 0), (UINT16)VREG_S(12, 1), (UINT16)VREG_S(12, 2), (UINT16)VREG_S(12, 3), (UINT16)VREG_S(12, 4), (UINT16)VREG_S(12, 5), (UINT16)VREG_S(12, 6), (UINT16)VREG_S(12, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(12, 0), (uint16_t)VREG_S(12, 1), (uint16_t)VREG_S(12, 2), (uint16_t)VREG_S(12, 3), (uint16_t)VREG_S(12, 4), (uint16_t)VREG_S(12, 5), (uint16_t)VREG_S(12, 6), (uint16_t)VREG_S(12, 7)); break; case RSP_V13: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(13, 0), (UINT16)VREG_S(13, 1), (UINT16)VREG_S(13, 2), (UINT16)VREG_S(13, 3), (UINT16)VREG_S(13, 4), (UINT16)VREG_S(13, 5), (UINT16)VREG_S(13, 6), (UINT16)VREG_S(13, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(13, 0), (uint16_t)VREG_S(13, 1), (uint16_t)VREG_S(13, 2), (uint16_t)VREG_S(13, 3), (uint16_t)VREG_S(13, 4), (uint16_t)VREG_S(13, 5), (uint16_t)VREG_S(13, 6), (uint16_t)VREG_S(13, 7)); break; case RSP_V14: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(14, 0), (UINT16)VREG_S(14, 1), (UINT16)VREG_S(14, 2), (UINT16)VREG_S(14, 3), (UINT16)VREG_S(14, 4), (UINT16)VREG_S(14, 5), (UINT16)VREG_S(14, 6), (UINT16)VREG_S(14, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(14, 0), (uint16_t)VREG_S(14, 1), (uint16_t)VREG_S(14, 2), (uint16_t)VREG_S(14, 3), (uint16_t)VREG_S(14, 4), (uint16_t)VREG_S(14, 5), (uint16_t)VREG_S(14, 6), (uint16_t)VREG_S(14, 7)); break; case RSP_V15: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(15, 0), (UINT16)VREG_S(15, 1), (UINT16)VREG_S(15, 2), (UINT16)VREG_S(15, 3), (UINT16)VREG_S(15, 4), (UINT16)VREG_S(15, 5), (UINT16)VREG_S(15, 6), (UINT16)VREG_S(15, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(15, 0), (uint16_t)VREG_S(15, 1), (uint16_t)VREG_S(15, 2), (uint16_t)VREG_S(15, 3), (uint16_t)VREG_S(15, 4), (uint16_t)VREG_S(15, 5), (uint16_t)VREG_S(15, 6), (uint16_t)VREG_S(15, 7)); break; case RSP_V16: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(16, 0), (UINT16)VREG_S(16, 1), (UINT16)VREG_S(16, 2), (UINT16)VREG_S(16, 3), (UINT16)VREG_S(16, 4), (UINT16)VREG_S(16, 5), (UINT16)VREG_S(16, 6), (UINT16)VREG_S(16, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(16, 0), (uint16_t)VREG_S(16, 1), (uint16_t)VREG_S(16, 2), (uint16_t)VREG_S(16, 3), (uint16_t)VREG_S(16, 4), (uint16_t)VREG_S(16, 5), (uint16_t)VREG_S(16, 6), (uint16_t)VREG_S(16, 7)); break; case RSP_V17: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(17, 0), (UINT16)VREG_S(17, 1), (UINT16)VREG_S(17, 2), (UINT16)VREG_S(17, 3), (UINT16)VREG_S(17, 4), (UINT16)VREG_S(17, 5), (UINT16)VREG_S(17, 6), (UINT16)VREG_S(17, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(17, 0), (uint16_t)VREG_S(17, 1), (uint16_t)VREG_S(17, 2), (uint16_t)VREG_S(17, 3), (uint16_t)VREG_S(17, 4), (uint16_t)VREG_S(17, 5), (uint16_t)VREG_S(17, 6), (uint16_t)VREG_S(17, 7)); break; case RSP_V18: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(18, 0), (UINT16)VREG_S(18, 1), (UINT16)VREG_S(18, 2), (UINT16)VREG_S(18, 3), (UINT16)VREG_S(18, 4), (UINT16)VREG_S(18, 5), (UINT16)VREG_S(18, 6), (UINT16)VREG_S(18, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(18, 0), (uint16_t)VREG_S(18, 1), (uint16_t)VREG_S(18, 2), (uint16_t)VREG_S(18, 3), (uint16_t)VREG_S(18, 4), (uint16_t)VREG_S(18, 5), (uint16_t)VREG_S(18, 6), (uint16_t)VREG_S(18, 7)); break; case RSP_V19: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(19, 0), (UINT16)VREG_S(19, 1), (UINT16)VREG_S(19, 2), (UINT16)VREG_S(19, 3), (UINT16)VREG_S(19, 4), (UINT16)VREG_S(19, 5), (UINT16)VREG_S(19, 6), (UINT16)VREG_S(19, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(19, 0), (uint16_t)VREG_S(19, 1), (uint16_t)VREG_S(19, 2), (uint16_t)VREG_S(19, 3), (uint16_t)VREG_S(19, 4), (uint16_t)VREG_S(19, 5), (uint16_t)VREG_S(19, 6), (uint16_t)VREG_S(19, 7)); break; case RSP_V20: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(20, 0), (UINT16)VREG_S(20, 1), (UINT16)VREG_S(20, 2), (UINT16)VREG_S(20, 3), (UINT16)VREG_S(20, 4), (UINT16)VREG_S(20, 5), (UINT16)VREG_S(20, 6), (UINT16)VREG_S(20, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(20, 0), (uint16_t)VREG_S(20, 1), (uint16_t)VREG_S(20, 2), (uint16_t)VREG_S(20, 3), (uint16_t)VREG_S(20, 4), (uint16_t)VREG_S(20, 5), (uint16_t)VREG_S(20, 6), (uint16_t)VREG_S(20, 7)); break; case RSP_V21: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(21, 0), (UINT16)VREG_S(21, 1), (UINT16)VREG_S(21, 2), (UINT16)VREG_S(21, 3), (UINT16)VREG_S(21, 4), (UINT16)VREG_S(21, 5), (UINT16)VREG_S(21, 6), (UINT16)VREG_S(21, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(21, 0), (uint16_t)VREG_S(21, 1), (uint16_t)VREG_S(21, 2), (uint16_t)VREG_S(21, 3), (uint16_t)VREG_S(21, 4), (uint16_t)VREG_S(21, 5), (uint16_t)VREG_S(21, 6), (uint16_t)VREG_S(21, 7)); break; case RSP_V22: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(22, 0), (UINT16)VREG_S(22, 1), (UINT16)VREG_S(22, 2), (UINT16)VREG_S(22, 3), (UINT16)VREG_S(22, 4), (UINT16)VREG_S(22, 5), (UINT16)VREG_S(22, 6), (UINT16)VREG_S(22, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(22, 0), (uint16_t)VREG_S(22, 1), (uint16_t)VREG_S(22, 2), (uint16_t)VREG_S(22, 3), (uint16_t)VREG_S(22, 4), (uint16_t)VREG_S(22, 5), (uint16_t)VREG_S(22, 6), (uint16_t)VREG_S(22, 7)); break; case RSP_V23: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(23, 0), (UINT16)VREG_S(23, 1), (UINT16)VREG_S(23, 2), (UINT16)VREG_S(23, 3), (UINT16)VREG_S(23, 4), (UINT16)VREG_S(23, 5), (UINT16)VREG_S(23, 6), (UINT16)VREG_S(23, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(23, 0), (uint16_t)VREG_S(23, 1), (uint16_t)VREG_S(23, 2), (uint16_t)VREG_S(23, 3), (uint16_t)VREG_S(23, 4), (uint16_t)VREG_S(23, 5), (uint16_t)VREG_S(23, 6), (uint16_t)VREG_S(23, 7)); break; case RSP_V24: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(24, 0), (UINT16)VREG_S(24, 1), (UINT16)VREG_S(24, 2), (UINT16)VREG_S(24, 3), (UINT16)VREG_S(24, 4), (UINT16)VREG_S(24, 5), (UINT16)VREG_S(24, 6), (UINT16)VREG_S(24, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(24, 0), (uint16_t)VREG_S(24, 1), (uint16_t)VREG_S(24, 2), (uint16_t)VREG_S(24, 3), (uint16_t)VREG_S(24, 4), (uint16_t)VREG_S(24, 5), (uint16_t)VREG_S(24, 6), (uint16_t)VREG_S(24, 7)); break; case RSP_V25: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(25, 0), (UINT16)VREG_S(25, 1), (UINT16)VREG_S(25, 2), (UINT16)VREG_S(25, 3), (UINT16)VREG_S(25, 4), (UINT16)VREG_S(25, 5), (UINT16)VREG_S(25, 6), (UINT16)VREG_S(25, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(25, 0), (uint16_t)VREG_S(25, 1), (uint16_t)VREG_S(25, 2), (uint16_t)VREG_S(25, 3), (uint16_t)VREG_S(25, 4), (uint16_t)VREG_S(25, 5), (uint16_t)VREG_S(25, 6), (uint16_t)VREG_S(25, 7)); break; case RSP_V26: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(26, 0), (UINT16)VREG_S(26, 1), (UINT16)VREG_S(26, 2), (UINT16)VREG_S(26, 3), (UINT16)VREG_S(26, 4), (UINT16)VREG_S(26, 5), (UINT16)VREG_S(26, 6), (UINT16)VREG_S(26, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(26, 0), (uint16_t)VREG_S(26, 1), (uint16_t)VREG_S(26, 2), (uint16_t)VREG_S(26, 3), (uint16_t)VREG_S(26, 4), (uint16_t)VREG_S(26, 5), (uint16_t)VREG_S(26, 6), (uint16_t)VREG_S(26, 7)); break; case RSP_V27: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(27, 0), (UINT16)VREG_S(27, 1), (UINT16)VREG_S(27, 2), (UINT16)VREG_S(27, 3), (UINT16)VREG_S(27, 4), (UINT16)VREG_S(27, 5), (UINT16)VREG_S(27, 6), (UINT16)VREG_S(27, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(27, 0), (uint16_t)VREG_S(27, 1), (uint16_t)VREG_S(27, 2), (uint16_t)VREG_S(27, 3), (uint16_t)VREG_S(27, 4), (uint16_t)VREG_S(27, 5), (uint16_t)VREG_S(27, 6), (uint16_t)VREG_S(27, 7)); break; case RSP_V28: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(28, 0), (UINT16)VREG_S(28, 1), (UINT16)VREG_S(28, 2), (UINT16)VREG_S(28, 3), (UINT16)VREG_S(28, 4), (UINT16)VREG_S(28, 5), (UINT16)VREG_S(28, 6), (UINT16)VREG_S(28, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(28, 0), (uint16_t)VREG_S(28, 1), (uint16_t)VREG_S(28, 2), (uint16_t)VREG_S(28, 3), (uint16_t)VREG_S(28, 4), (uint16_t)VREG_S(28, 5), (uint16_t)VREG_S(28, 6), (uint16_t)VREG_S(28, 7)); break; case RSP_V29: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(29, 0), (UINT16)VREG_S(29, 1), (UINT16)VREG_S(29, 2), (UINT16)VREG_S(29, 3), (UINT16)VREG_S(29, 4), (UINT16)VREG_S(29, 5), (UINT16)VREG_S(29, 6), (UINT16)VREG_S(29, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(29, 0), (uint16_t)VREG_S(29, 1), (uint16_t)VREG_S(29, 2), (uint16_t)VREG_S(29, 3), (uint16_t)VREG_S(29, 4), (uint16_t)VREG_S(29, 5), (uint16_t)VREG_S(29, 6), (uint16_t)VREG_S(29, 7)); break; case RSP_V30: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(30, 0), (UINT16)VREG_S(30, 1), (UINT16)VREG_S(30, 2), (UINT16)VREG_S(30, 3), (UINT16)VREG_S(30, 4), (UINT16)VREG_S(30, 5), (UINT16)VREG_S(30, 6), (UINT16)VREG_S(30, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(30, 0), (uint16_t)VREG_S(30, 1), (uint16_t)VREG_S(30, 2), (uint16_t)VREG_S(30, 3), (uint16_t)VREG_S(30, 4), (uint16_t)VREG_S(30, 5), (uint16_t)VREG_S(30, 6), (uint16_t)VREG_S(30, 7)); break; case RSP_V31: - str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)VREG_S(31, 0), (UINT16)VREG_S(31, 1), (UINT16)VREG_S(31, 2), (UINT16)VREG_S(31, 3), (UINT16)VREG_S(31, 4), (UINT16)VREG_S(31, 5), (UINT16)VREG_S(31, 6), (UINT16)VREG_S(31, 7)); + str = string_format("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (uint16_t)VREG_S(31, 0), (uint16_t)VREG_S(31, 1), (uint16_t)VREG_S(31, 2), (uint16_t)VREG_S(31, 3), (uint16_t)VREG_S(31, 4), (uint16_t)VREG_S(31, 5), (uint16_t)VREG_S(31, 6), (uint16_t)VREG_S(31, 7)); break; } } @@ -266,9 +266,9 @@ void rsp_cop2_drc::state_string_export(const int index, std::string &str) const void rsp_cop2_drc::lbv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; - UINT32 ea; + uint32_t ea; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -299,7 +299,7 @@ static void cfunc_lbv(void *param) void rsp_cop2_drc::lsv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xe; @@ -309,7 +309,7 @@ void rsp_cop2_drc::lsv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 2) : (offset * 2); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 2) : (offset * 2); int end = index + 2; for (int i = index; i < end; i++) { @@ -335,8 +335,8 @@ static void cfunc_lsv(void *param) void rsp_cop2_drc::llv() { - UINT32 op = m_rspcop2_state->op; - UINT32 ea; + uint32_t op = m_rspcop2_state->op; + uint32_t ea; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xc; @@ -374,8 +374,8 @@ static void cfunc_llv(void *param) void rsp_cop2_drc::ldv() { - UINT32 op = m_rspcop2_state->op; - UINT32 ea; + uint32_t op = m_rspcop2_state->op; + uint32_t ea; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0x8; @@ -413,7 +413,7 @@ static void cfunc_ldv(void *param) void rsp_cop2_drc::lqv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int offset = (op & 0x7f); @@ -422,7 +422,7 @@ void rsp_cop2_drc::lqv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); int end = 16 - (ea & 0xf); if (end > 16) end = 16; @@ -451,7 +451,7 @@ static void cfunc_lqv(void *param) void rsp_cop2_drc::lrv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -461,7 +461,7 @@ void rsp_cop2_drc::lrv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); index = 16 - ((ea & 0xf) - index); ea &= ~0xf; @@ -490,7 +490,7 @@ static void cfunc_lrv(void *param) void rsp_cop2_drc::lpv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -500,7 +500,7 @@ void rsp_cop2_drc::lpv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); for (int i = 0; i < 8; i++) { @@ -525,7 +525,7 @@ static void cfunc_lpv(void *param) void rsp_cop2_drc::luv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -535,7 +535,7 @@ void rsp_cop2_drc::luv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); for (int i = 0; i < 8; i++) { @@ -560,7 +560,7 @@ static void cfunc_luv(void *param) void rsp_cop2_drc::lhv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -570,7 +570,7 @@ void rsp_cop2_drc::lhv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); for (int i = 0; i < 8; i++) { @@ -594,7 +594,7 @@ static void cfunc_lhv(void *param) void rsp_cop2_drc::lfv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -604,7 +604,7 @@ void rsp_cop2_drc::lfv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); // not sure what happens if 16-byte boundary is crossed... @@ -635,7 +635,7 @@ static void cfunc_lfv(void *param) void rsp_cop2_drc::lwv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -645,7 +645,7 @@ void rsp_cop2_drc::lwv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); int end = (16 - index) + 16; for (int i = (16 - index); i < end; i++) @@ -672,7 +672,7 @@ static void cfunc_lwv(void *param) void rsp_cop2_drc::ltv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -689,7 +689,7 @@ void rsp_cop2_drc::ltv() int element; - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); ea = ((ea + 8) & ~0xf) + (index & 1); for (int i = vs; i < ve; i++) @@ -709,7 +709,7 @@ static void cfunc_ltv(void *param) int rsp_cop2_drc::generate_lwc2(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; int offset = (op & 0x7f); if (offset & 0x40) { @@ -799,7 +799,7 @@ int rsp_cop2_drc::generate_lwc2(drcuml_block *block, rsp_device::compiler_state void rsp_cop2_drc::sbv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -809,7 +809,7 @@ void rsp_cop2_drc::sbv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + offset : offset; + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + offset : offset; m_rsp.DM_WRITE8(ea, VREG_B(dest, index)); } @@ -830,7 +830,7 @@ static void cfunc_sbv(void *param) void rsp_cop2_drc::ssv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -840,7 +840,7 @@ void rsp_cop2_drc::ssv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 2) : (offset * 2); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 2) : (offset * 2); int end = index + 2; for (int i = index; i < end; i++) @@ -867,7 +867,7 @@ static void cfunc_ssv(void *param) void rsp_cop2_drc::slv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -877,7 +877,7 @@ void rsp_cop2_drc::slv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 4) : (offset * 4); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 4) : (offset * 4); int end = index + 4; for (int i = index; i < end; i++) @@ -904,7 +904,7 @@ static void cfunc_slv(void *param) void rsp_cop2_drc::sdv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0x8; @@ -913,7 +913,7 @@ void rsp_cop2_drc::sdv() { offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); int end = index + 8; for (int i = index; i < end; i++) @@ -940,7 +940,7 @@ static void cfunc_sdv(void *param) void rsp_cop2_drc::sqv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -950,7 +950,7 @@ void rsp_cop2_drc::sqv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); int end = index + (16 - (ea & 0xf)); for (int i=index; i < end; i++) { @@ -976,7 +976,7 @@ static void cfunc_sqv(void *param) void rsp_cop2_drc::srv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -986,7 +986,7 @@ void rsp_cop2_drc::srv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); int end = index + (ea & 0xf); int o = (16 - (ea & 0xf)) & 0xf; @@ -1016,7 +1016,7 @@ static void cfunc_srv(void *param) void rsp_cop2_drc::spv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1026,7 +1026,7 @@ void rsp_cop2_drc::spv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); int end = index + 8; for (int i=index; i < end; i++) { @@ -1059,7 +1059,7 @@ static void cfunc_spv(void *param) void rsp_cop2_drc::suv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1069,7 +1069,7 @@ void rsp_cop2_drc::suv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8); int end = index + 8; for (int i=index; i < end; i++) { @@ -1102,7 +1102,7 @@ static void cfunc_suv(void *param) void rsp_cop2_drc::shv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1112,11 +1112,11 @@ void rsp_cop2_drc::shv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); for (int i=0; i < 8; i++) { int element = index + (i << 1); - UINT8 d = (VREG_B(dest, (element & 0xf)) << 1) | + uint8_t d = (VREG_B(dest, (element & 0xf)) << 1) | (VREG_B(dest, ((element + 1) & 0xf)) >> 7); m_rsp.DM_WRITE8(ea, d); ea += 2; @@ -1140,7 +1140,7 @@ static void cfunc_shv(void *param) void rsp_cop2_drc::sfv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1150,7 +1150,7 @@ void rsp_cop2_drc::sfv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); int eaoffset = ea & 0xf; ea &= ~0xf; @@ -1181,7 +1181,7 @@ static void cfunc_sfv(void *param) void rsp_cop2_drc::swv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1191,7 +1191,7 @@ void rsp_cop2_drc::swv() offset |= 0xffffffc0; } - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); int eaoffset = ea & 0xf; ea &= ~0xf; @@ -1220,7 +1220,7 @@ static void cfunc_swv(void *param) void rsp_cop2_drc::stv() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int dest = (op >> 16) & 0x1f; int base = (op >> 21) & 0x1f; int index = (op >> 7) & 0xf; @@ -1240,7 +1240,7 @@ void rsp_cop2_drc::stv() int element = 8 - (index >> 1); - UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); + uint32_t ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16); int eaoffset = (ea & 0xf) + (element * 2); ea &= ~0xf; @@ -1259,7 +1259,7 @@ static void cfunc_stv(void *param) int rsp_cop2_drc::generate_swc2(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; int offset = (op & 0x7f); if (offset & 0x40) { @@ -1356,11 +1356,11 @@ void rsp_cop2_drc::vmulf() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (INT32)(INT16)w1; - INT32 s2 = (INT32)(INT16)w2; + int32_t s1 = (int32_t)(int16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; if (s1 == -32768 && s2 == -32768) { @@ -1370,7 +1370,7 @@ void rsp_cop2_drc::vmulf() } else { - ACCUM(i) = (INT64)(s1 * s2 * 2 + 0x8000) << 16; // rounding? + ACCUM(i) = (int64_t)(s1 * s2 * 2 + 0x8000) << 16; // rounding? m_vres[i] = ACCUM_M(i); } } @@ -1397,13 +1397,13 @@ void rsp_cop2_drc::vmulu() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (INT32)(INT16)w1; - INT32 s2 = (INT32)(INT16)w2; + int32_t s1 = (int32_t)(int16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; - INT64 r = s1 * s2 * 2 + 0x8000; // rounding? + int64_t r = s1 * s2 * 2 + 0x8000; // rounding? ACCUM(i) = r << 16; @@ -1411,7 +1411,7 @@ void rsp_cop2_drc::vmulu() { m_vres[i] = 0; } - else if (((INT16)(ACCUM_H(i)) ^ (INT16)(ACCUM_M(i))) < 0) + else if (((int16_t)(ACCUM_H(i)) ^ (int16_t)(ACCUM_M(i))) < 0) { m_vres[i] = -1; } @@ -1446,11 +1446,11 @@ void rsp_cop2_drc::vmudl() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - UINT32 s1 = (UINT32)(UINT16)w1; - UINT32 s2 = (UINT32)(UINT16)w2; + uint32_t s1 = (uint32_t)(uint16_t)w1; + uint32_t s2 = (uint32_t)(uint16_t)w2; ACCUM(i) = s1 * s2; @@ -1482,13 +1482,13 @@ void rsp_cop2_drc::vmudm() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (INT32)(INT16)w1; - INT32 s2 = (UINT16)w2; + int32_t s1 = (int32_t)(int16_t)w1; + int32_t s2 = (uint16_t)w2; - ACCUM(i) = (INT64)(s1 * s2) << 16; + ACCUM(i) = (int64_t)(s1 * s2) << 16; m_vres[i] = ACCUM_M(i); } @@ -1518,17 +1518,17 @@ void rsp_cop2_drc::vmudn() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (UINT16)w1; - INT32 s2 = (INT32)(INT16)w2; + int32_t s1 = (uint16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; - INT32 r = s1 * s2; + int32_t r = s1 * s2; - ACCUM(i) = (INT64)(s1 * s2) << 16; + ACCUM(i) = (int64_t)(s1 * s2) << 16; - m_vres[i] = (UINT16)(r); + m_vres[i] = (uint16_t)(r); } WRITEBACK_RESULT(); } @@ -1556,19 +1556,19 @@ void rsp_cop2_drc::vmudh() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (INT32)(INT16)w1; - INT32 s2 = (INT32)(INT16)w2; + int32_t s1 = (int32_t)(int16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; - INT32 r = s1 * s2; + int32_t r = s1 * s2; - ACCUM(i) = (INT64)r << 32; + ACCUM(i) = (int64_t)r << 32; if (r < -32768) r = -32768; if (r > 32767) r = 32767; - m_vres[i] = (INT16)(r); + m_vres[i] = (int16_t)(r); } WRITEBACK_RESULT(); } @@ -1593,13 +1593,13 @@ void rsp_cop2_drc::vmacf() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (INT32)(INT16)w1; - INT32 s2 = (INT32)(INT16)w2; + int32_t s1 = (int32_t)(int16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; - ACCUM(i) += (INT64)(s1 * s2 * 2) << 16; + ACCUM(i) += (int64_t)(s1 * s2 * 2) << 16; m_vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff); } @@ -1626,15 +1626,15 @@ void rsp_cop2_drc::vmacu() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (INT32)(INT16)w1; - INT32 s2 = (INT32)(INT16)w2; + int32_t s1 = (int32_t)(int16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; - ACCUM(i) += (INT64)(s1 * s2 * 2) << 16; + ACCUM(i) += (int64_t)(s1 * s2 * 2) << 16; - if ((INT16)ACCUM_H(i) < 0) + if ((int16_t)ACCUM_H(i) < 0) { m_vres[i] = 0; } @@ -1642,13 +1642,13 @@ void rsp_cop2_drc::vmacu() { if (ACCUM_H(i) != 0) { - m_vres[i] = (INT16)0xffff; + m_vres[i] = (int16_t)0xffff; } else { - if ((INT16)ACCUM_M(i) < 0) + if ((int16_t)ACCUM_M(i) < 0) { - m_vres[i] = (INT16)0xffff; + m_vres[i] = (int16_t)0xffff; } else { @@ -1683,11 +1683,11 @@ void rsp_cop2_drc::vmadl() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - UINT32 s1 = w1; - UINT32 s2 = w2; + uint32_t s1 = w1; + uint32_t s2 = w2; ACCUM(i) += (s1 * s2) & 0xffff0000; @@ -1711,13 +1711,13 @@ void rsp_cop2_drc::vmadm() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - UINT32 s1 = (INT32)(INT16)w1; - UINT32 s2 = (UINT16)w2; + uint32_t s1 = (int32_t)(int16_t)w1; + uint32_t s2 = (uint16_t)w2; - ACCUM(i) += (INT64)(INT32)(s1 * s2) << 16; + ACCUM(i) += (int64_t)(int32_t)(s1 * s2) << 16; m_vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff); } @@ -1739,13 +1739,13 @@ void rsp_cop2_drc::vmadn() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (UINT16)w1; - INT32 s2 = (INT32)(INT16)w2; + int32_t s1 = (uint16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; - ACCUM(i) += (INT64)(s1 * s2) << 16; + ACCUM(i) += (int64_t)(s1 * s2) << 16; m_vres[i] = SATURATE_ACCUM(i, 0, 0x0000, 0xffff); } @@ -1775,13 +1775,13 @@ void rsp_cop2_drc::vmadh() for (int i = 0; i < 8; i++) { - INT16 w1, w2; + int16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (INT32)(INT16)w1; - INT32 s2 = (INT32)(INT16)w2; + int32_t s1 = (int32_t)(int16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; - ACCUM(i) += (INT64)(s1 * s2) << 32; + ACCUM(i) += (int64_t)(s1 * s2) << 32; m_vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff); } @@ -1808,18 +1808,18 @@ void rsp_cop2_drc::vadd() for (int i = 0; i < 8; i++) { - INT16 w1, w2; + int16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (INT32)(INT16)w1; - INT32 s2 = (INT32)(INT16)w2; - INT32 r = s1 + s2 + (((CARRY_FLAG(i)) != 0) ? 1 : 0); + int32_t s1 = (int32_t)(int16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; + int32_t r = s1 + s2 + (((CARRY_FLAG(i)) != 0) ? 1 : 0); - SET_ACCUM_L((INT16)(r), i); + SET_ACCUM_L((int16_t)(r), i); if (r > 32767) r = 32767; if (r < -32768) r = -32768; - m_vres[i] = (INT16)(r); + m_vres[i] = (int16_t)(r); } CLEAR_ZERO_FLAGS(); CLEAR_CARRY_FLAGS(); @@ -1848,19 +1848,19 @@ void rsp_cop2_drc::vsub() for (int i = 0; i < 8; i++) { - INT16 w1, w2; + int16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (INT32)(INT16)w1; - INT32 s2 = (INT32)(INT16)w2; - INT32 r = s1 - s2 - (((CARRY_FLAG(i)) != 0) ? 1 : 0); + int32_t s1 = (int32_t)(int16_t)w1; + int32_t s2 = (int32_t)(int16_t)w2; + int32_t r = s1 - s2 - (((CARRY_FLAG(i)) != 0) ? 1 : 0); - SET_ACCUM_L((INT16)(r), i); + SET_ACCUM_L((int16_t)(r), i); if (r > 32767) r = 32767; if (r < -32768) r = -32768; - m_vres[i] = (INT16)(r); + m_vres[i] = (int16_t)(r); } CLEAR_ZERO_FLAGS(); CLEAR_CARRY_FLAGS(); @@ -1888,7 +1888,7 @@ void rsp_cop2_drc::vabs() for (int i = 0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); @@ -1942,15 +1942,15 @@ void rsp_cop2_drc::vaddc() for (int i = 0; i < 8; i++) { - INT16 w1, w2; + int16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (UINT32)(UINT16)w1; - INT32 s2 = (UINT32)(UINT16)w2; - INT32 r = s1 + s2; + int32_t s1 = (uint32_t)(uint16_t)w1; + int32_t s2 = (uint32_t)(uint16_t)w2; + int32_t r = s1 + s2; - m_vres[i] = (INT16)(r); - SET_ACCUM_L((INT16)r, i); + m_vres[i] = (int16_t)(r); + SET_ACCUM_L((int16_t)r, i); if (r & 0xffff0000) { @@ -1985,17 +1985,17 @@ void rsp_cop2_drc::vsubc() for (int i = 0; i < 8; i++) { - INT16 w1, w2; + int16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - INT32 s1 = (UINT32)(UINT16)w1; - INT32 s2 = (UINT32)(UINT16)w2; - INT32 r = s1 - s2; + int32_t s1 = (uint32_t)(uint16_t)w1; + int32_t s2 = (uint32_t)(uint16_t)w2; + int32_t r = s1 - s2; - m_vres[i] = (INT16)(r); - SET_ACCUM_L((UINT16)r, i); + m_vres[i] = (int16_t)(r); + SET_ACCUM_L((uint16_t)r, i); - if ((UINT16)(r) != 0) + if ((uint16_t)(r) != 0) { SET_ZERO_FLAG(i); } @@ -2029,17 +2029,17 @@ void rsp_cop2_drc::vaddb() for (int i = 0; i < 8; i++) { - UINT16 w1, w2; + uint16_t w1, w2; GET_VS1(w1, i); GET_VS2(w2, i); - UINT8 hb1 = w1 >> 8; - UINT8 lb1 = w1 & 0xff; - UINT8 hb2 = w2 >> 8; - UINT8 lb2 = w2 & 0xff; + uint8_t hb1 = w1 >> 8; + uint8_t lb1 = w1 & 0xff; + uint8_t hb2 = w2 >> 8; + uint8_t lb2 = w2 & 0xff; - UINT16 hs = hb1 + hb2 + round; - UINT16 ls = lb1 + lb2 + round; + uint16_t hs = hb1 + hb2 + round; + uint16_t ls = lb1 + lb2 + round; SET_ACCUM_L((hs << 8) | ls, i); @@ -2137,7 +2137,7 @@ void rsp_cop2_drc::vlt() for (int i = 0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); @@ -2195,7 +2195,7 @@ void rsp_cop2_drc::veq() for (int i = 0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); @@ -2242,7 +2242,7 @@ void rsp_cop2_drc::vne() for (int i = 0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); @@ -2289,7 +2289,7 @@ void rsp_cop2_drc::vge() for (int i = 0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); if ((s1 == s2 && (ZERO_FLAG(i) == 0 || CARRY_FLAG(i) == 0)) || s1 > s2) @@ -2331,7 +2331,7 @@ void rsp_cop2_drc::vcl() for (int i = 0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); @@ -2341,7 +2341,7 @@ void rsp_cop2_drc::vcl() { if (COMPARE_FLAG(i) != 0) { - SET_ACCUM_L(-(UINT16)s2, i); + SET_ACCUM_L(-(uint16_t)s2, i); } else { @@ -2352,27 +2352,27 @@ void rsp_cop2_drc::vcl() { if (CLIP1_FLAG(i) != 0) { - if (((UINT32)(UINT16)(s1) + (UINT32)(UINT16)(s2)) > 0x10000) + if (((uint32_t)(uint16_t)(s1) + (uint32_t)(uint16_t)(s2)) > 0x10000) { SET_ACCUM_L(s1, i); CLEAR_COMPARE_FLAG(i); } else { - SET_ACCUM_L(-((UINT16)s2), i); + SET_ACCUM_L(-((uint16_t)s2), i); SET_COMPARE_FLAG(i); } } else { - if (((UINT32)(UINT16)(s1) + (UINT32)(UINT16)(s2)) != 0) + if (((uint32_t)(uint16_t)(s1) + (uint32_t)(uint16_t)(s2)) != 0) { SET_ACCUM_L(s1, i); CLEAR_COMPARE_FLAG(i); } else { - SET_ACCUM_L(-((UINT16)s2), i); + SET_ACCUM_L(-((uint16_t)s2), i); SET_COMPARE_FLAG(i); } } @@ -2393,7 +2393,7 @@ void rsp_cop2_drc::vcl() } else { - if (((INT32)(UINT16)s1 - (INT32)(UINT16)s2) >= 0) + if (((int32_t)(uint16_t)s1 - (int32_t)(uint16_t)s2) >= 0) { SET_ACCUM_L(s2, i); SET_CLIP2_FLAG(i); @@ -2438,10 +2438,10 @@ void rsp_cop2_drc::vch() CLEAR_ZERO_FLAGS(); CLEAR_CLIP2_FLAGS(); - UINT32 vce; + uint32_t vce; for (int i = 0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); @@ -2457,7 +2457,7 @@ void rsp_cop2_drc::vch() if ((s1 + s2) <= 0) { SET_COMPARE_FLAG(i); - m_vres[i] = -((UINT16)s2); + m_vres[i] = -((uint16_t)s2); } else { @@ -2527,11 +2527,11 @@ void rsp_cop2_drc::vcr() for (int i = 0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); - if ((INT16)(s1 ^ s2) < 0) + if ((int16_t)(s1 ^ s2) < 0) { if (s2 < 0) { @@ -2539,7 +2539,7 @@ void rsp_cop2_drc::vcr() } if ((s1 + s2) <= 0) { - SET_ACCUM_L(~((UINT16)s2), i); + SET_ACCUM_L(~((uint16_t)s2), i); SET_COMPARE_FLAG(i); } else @@ -2590,7 +2590,7 @@ void rsp_cop2_drc::vmrg() for (int i = 0; i < 8; i++) { - INT16 s1, s2; + int16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); if (COMPARE_FLAG(i) != 0) @@ -2628,7 +2628,7 @@ void rsp_cop2_drc::vand() for (int i = 0; i < 8; i++) { - UINT16 s1, s2; + uint16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); m_vres[i] = s1 & s2; @@ -2658,7 +2658,7 @@ void rsp_cop2_drc::vnand() for (int i = 0; i < 8; i++) { - UINT16 s1, s2; + uint16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); m_vres[i] = ~((s1 & s2)); @@ -2688,7 +2688,7 @@ void rsp_cop2_drc::vor() for (int i = 0; i < 8; i++) { - UINT16 s1, s2; + uint16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); m_vres[i] = s1 | s2; @@ -2718,7 +2718,7 @@ void rsp_cop2_drc::vnor() for (int i = 0; i < 8; i++) { - UINT16 s1, s2; + uint16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); m_vres[i] = ~(s1 | s2); @@ -2748,7 +2748,7 @@ void rsp_cop2_drc::vxor() for (int i = 0; i < 8; i++) { - UINT16 s1, s2; + uint16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); m_vres[i] = s1 ^ s2; @@ -2778,7 +2778,7 @@ void rsp_cop2_drc::vnxor() for (int i = 0; i < 8; i++) { - UINT16 s1, s2; + uint16_t s1, s2; GET_VS1(s1, i); GET_VS2(s2, i); m_vres[i] = ~(s1 ^ s2); @@ -2806,9 +2806,9 @@ void rsp_cop2_drc::vrcp() { CACHE_VALUES(); - INT32 shifter = 0; - INT32 rec = (INT16)(VREG_S(vs2reg, el & 7)); - INT32 datainput = (rec < 0) ? (-rec) : rec; + int32_t shifter = 0; + int32_t rec = (int16_t)(VREG_S(vs2reg, el & 7)); + int32_t datainput = (rec < 0) ? (-rec) : rec; if (datainput) { for (int i = 0; i < 32; i++) @@ -2825,9 +2825,9 @@ void rsp_cop2_drc::vrcp() shifter = 0x10; } - INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; - INT32 fetchval = rsp_divtable[address]; - INT32 temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); + int32_t address = ((datainput << shifter) & 0x7fc00000) >> 22; + int32_t fetchval = rsp_divtable[address]; + int32_t temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); if (rec < 0) { temp = ~temp; @@ -2845,7 +2845,7 @@ void rsp_cop2_drc::vrcp() m_reciprocal_res = rec; m_dp_allowed = 0; - W_VREG_S(vdreg, vs1reg & 7) = (UINT16)rec; + W_VREG_S(vdreg, vs1reg & 7) = (uint16_t)rec; for (int i = 0; i < 8; i++) { SET_ACCUM_L(VREG_S(vs2reg, VEC_EL_2(el, i)), i); @@ -2871,9 +2871,9 @@ void rsp_cop2_drc::vrcpl() { CACHE_VALUES(); - INT32 shifter = 0; - INT32 rec = (INT16)VREG_S(vs2reg, el & 7); - INT32 datainput = rec; + int32_t shifter = 0; + int32_t rec = (int16_t)VREG_S(vs2reg, el & 7); + int32_t datainput = rec; if (m_dp_allowed) { @@ -2911,9 +2911,9 @@ void rsp_cop2_drc::vrcpl() } } - UINT32 address = (datainput << shifter) >> 22; - INT32 fetchval = rsp_divtable[address & 0x1ff]; - INT32 temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); + uint32_t address = (datainput << shifter) >> 22; + int32_t fetchval = rsp_divtable[address & 0x1ff]; + int32_t temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f); temp ^= rec >> 31; if (!rec) @@ -2929,7 +2929,7 @@ void rsp_cop2_drc::vrcpl() m_reciprocal_res = rec; m_dp_allowed = 0; - W_VREG_S(vdreg, vs1reg & 7) = (UINT16)rec; + W_VREG_S(vdreg, vs1reg & 7) = (uint16_t)rec; for (int i = 0; i < 8; i++) { @@ -2964,7 +2964,7 @@ void rsp_cop2_drc::vrcph() SET_ACCUM_L(VREG_S(vs2reg, VEC_EL_2(el, i)), i); } - W_VREG_S(vdreg, vs1reg & 7) = (INT16)(m_reciprocal_res >> 16); + W_VREG_S(vdreg, vs1reg & 7) = (int16_t)(m_reciprocal_res >> 16); } static void cfunc_vrcph(void *param) @@ -3012,9 +3012,9 @@ void rsp_cop2_drc::vrsq() { CACHE_VALUES(); - INT32 shifter = 0; - INT32 rec = (INT16)VREG_S(vs2reg, el & 7); - INT32 datainput = (rec < 0) ? (-rec) : (rec); + int32_t shifter = 0; + int32_t rec = (int16_t)VREG_S(vs2reg, el & 7); + int32_t datainput = (rec < 0) ? (-rec) : (rec); if (rec < 0) { @@ -3044,11 +3044,11 @@ void rsp_cop2_drc::vrsq() shifter = 0; } - INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; + int32_t address = ((datainput << shifter) & 0x7fc00000) >> 22; address = ((address | 0x200) & 0x3fe) | (shifter & 1); - INT32 fetchval = rsp_divtable[address]; - INT32 temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); + int32_t fetchval = rsp_divtable[address]; + int32_t temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); if (rec < 0) { temp = ~temp; @@ -3117,7 +3117,7 @@ void rsp_cop2_drc::vrsq() } rec = temp; - W_VREG_S(vdreg, vs1reg & 7) = (UINT16)rec; + W_VREG_S(vdreg, vs1reg & 7) = (uint16_t)rec; for (int i = 0; i < 8; i++) { SET_ACCUM_L(VREG_S(vs2reg, VEC_EL_2(el, i)), i); @@ -3143,9 +3143,9 @@ void rsp_cop2_drc::vrsql() { CACHE_VALUES(); - INT32 shifter = 0; - INT32 rec = (INT16)VREG_S(vs2reg, el & 7); - INT32 datainput = rec; + int32_t shifter = 0; + int32_t rec = (int16_t)VREG_S(vs2reg, el & 7); + int32_t datainput = rec; if (m_dp_allowed) { @@ -3183,11 +3183,11 @@ void rsp_cop2_drc::vrsql() } } - INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22; + int32_t address = ((datainput << shifter) & 0x7fc00000) >> 22; address = ((address | 0x200) & 0x3fe) | (shifter & 1); - INT32 fetchval = rsp_divtable[address]; - INT32 temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); + int32_t fetchval = rsp_divtable[address]; + int32_t temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1); temp ^= rec >> 31; if (!rec) @@ -3203,7 +3203,7 @@ void rsp_cop2_drc::vrsql() m_reciprocal_res = rec; m_dp_allowed = 0; - W_VREG_S(vdreg, vs1reg & 7) = (UINT16)(rec & 0xffff); + W_VREG_S(vdreg, vs1reg & 7) = (uint16_t)(rec & 0xffff); for (int i = 0; i < 8; i++) { SET_ACCUM_L(VREG_S(vs2reg, VEC_EL_2(el, i)), i); @@ -3237,7 +3237,7 @@ void rsp_cop2_drc::vrsqh() SET_ACCUM_L(VREG_S(vs2reg, VEC_EL_2(el, i)), i); } - W_VREG_S(vdreg, vs1reg & 7) = (INT16)(m_reciprocal_res >> 16); // store high part + W_VREG_S(vdreg, vs1reg & 7) = (int16_t)(m_reciprocal_res >> 16); // store high part } static void cfunc_vrsqh(void *param) @@ -3253,7 +3253,7 @@ static void cfunc_vrsqh(void *param) int rsp_cop2_drc::generate_vector_opcode(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; // Opcode legend: // E = VS2 element type // S = VS1, Source vector 1 @@ -3495,12 +3495,12 @@ int rsp_cop2_drc::generate_vector_opcode(drcuml_block *block, rsp_device::compil void rsp_cop2_drc::mfc2() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int el = (op >> 7) & 0xf; - UINT16 b1 = VREG_B(VS1REG, (el+0) & 0xf); - UINT16 b2 = VREG_B(VS1REG, (el+1) & 0xf); - if (RTREG) RTVAL = (INT32)(INT16)((b1 << 8) | (b2)); + uint16_t b1 = VREG_B(VS1REG, (el+0) & 0xf); + uint16_t b2 = VREG_B(VS1REG, (el+1) & 0xf); + if (RTREG) RTVAL = (int32_t)(int16_t)((b1 << 8) | (b2)); } static void cfunc_mfc2(void *param) @@ -3510,7 +3510,7 @@ static void cfunc_mfc2(void *param) void rsp_cop2_drc::cfc2() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; if (RTREG) { switch(RDREG) @@ -3575,7 +3575,7 @@ static void cfunc_cfc2(void *param) void rsp_cop2_drc::mtc2() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; int el = (op >> 7) & 0xf; VREG_B(VS1REG, (el+0) & 0xf) = (RTVAL >> 8) & 0xff; VREG_B(VS1REG, (el+1) & 0xf) = (RTVAL >> 0) & 0xff; @@ -3589,7 +3589,7 @@ static void cfunc_mtc2(void *param) void rsp_cop2_drc::ctc2() { - UINT32 op = m_rspcop2_state->op; + uint32_t op = m_rspcop2_state->op; switch(RDREG) { case 0: @@ -3697,8 +3697,8 @@ static void cfunc_ctc2(void *param) int rsp_cop2_drc::generate_cop2(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = RSREG; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = RSREG; switch (opswitch) { diff --git a/src/devices/cpu/rsp/rspdiv.h b/src/devices/cpu/rsp/rspdiv.h index 67e4afacd01..0a63fc4e3ee 100644 --- a/src/devices/cpu/rsp/rspdiv.h +++ b/src/devices/cpu/rsp/rspdiv.h @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz -static const UINT16 rsp_divtable[1024] = +static const uint16_t rsp_divtable[1024] = { 0xffff, 0xff00, diff --git a/src/devices/cpu/rsp/rspdrc.cpp b/src/devices/cpu/rsp/rspdrc.cpp index f6d15435b7f..9849c07a71f 100644 --- a/src/devices/cpu/rsp/rspdrc.cpp +++ b/src/devices/cpu/rsp/rspdrc.cpp @@ -31,7 +31,7 @@ using namespace uml; CPU_DISASSEMBLE( rsp ); -extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); +extern offs_t rsp_dasm_one(char *buffer, offs_t pc, uint32_t op); /*************************************************************************** CONSTANTS @@ -64,7 +64,7 @@ extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); descriptor -------------------------------------------------*/ -static inline UINT32 epc(const opcode_desc *desc) +static inline uint32_t epc(const opcode_desc *desc) { return ((desc->flags & OPFLAG_IN_DELAY_SLOT) ? (desc->pc - 3) : desc->pc) | 0x1000; } @@ -181,7 +181,7 @@ static void cfunc_write32(void *param) rspdrc_set_options - configure DRC options -------------------------------------------------*/ -void rsp_device::rspdrc_set_options(UINT32 options) +void rsp_device::rspdrc_set_options(uint32_t options) { if (!allow_drc()) return; m_drcoptions = options; @@ -221,7 +221,7 @@ static void cfunc_get_cop0_reg(void *param) inline void rsp_device::ccfunc_set_cop0_reg() { int reg = m_rsp_state->arg0; - UINT32 data = m_rsp_state->arg1; + uint32_t data = m_rsp_state->arg1; if (reg >= 0 && reg < 8) { @@ -374,7 +374,7 @@ void rsp_device::code_compile_block(offs_t pc) for (seqhead = desclist; seqhead != nullptr; seqhead = seqlast->next()) { const opcode_desc *curdesc; - UINT32 nextpc; + uint32_t nextpc; /* add a code log entry */ if (drcuml->logging()) @@ -458,7 +458,7 @@ void rsp_device::code_compile_block(offs_t pc) inline void rsp_device::ccfunc_unimplemented() { - UINT32 opcode = m_rsp_state->arg0; + uint32_t opcode = m_rsp_state->arg0; fatalerror("PC=%08X: Unimplemented op %08X (%02X,%02X)\n", m_rsp_state->pc, opcode, opcode >> 26, opcode & 0x3f); } @@ -667,7 +667,7 @@ void rsp_device::generate_checksum_block(drcuml_block *block, compiler_state *co { if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) { - UINT32 sum = seqhead->opptr.l[0]; + uint32_t sum = seqhead->opptr.l[0]; void *base = m_direct->read_ptr(seqhead->physpc | 0x1000); UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword @@ -689,7 +689,7 @@ void rsp_device::generate_checksum_block(drcuml_block *block, compiler_state *co /* full verification; sum up everything */ else { - UINT32 sum = 0; + uint32_t sum = 0; void *base = m_direct->read_ptr(seqhead->physpc | 0x1000); UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword sum += seqhead->opptr.l[0]; @@ -800,10 +800,10 @@ void rsp_device::generate_branch(drcuml_block *block, compiler_state *compiler, generate_delay_slot_and_branch ------------------------------------------------------------------*/ -void rsp_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT8 linkreg) +void rsp_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint8_t linkreg) { compiler_state compiler_temp = *compiler; - UINT32 op = desc->opptr.l[0]; + uint32_t op = desc->opptr.l[0]; /* fetch the target register if dynamic, in case it is modified by the delay slot */ if (desc->targetpc == BRANCH_TARGET_DYNAMIC) @@ -815,7 +815,7 @@ void rsp_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_st /* set the link if needed -- before the delay slot */ if (linkreg != 0) { - UML_MOV(block, R32(linkreg), (INT32)(desc->pc + 8)); // mov ,desc->pc + 8 + UML_MOV(block, R32(linkreg), (int32_t)(desc->pc + 8)); // mov ,desc->pc + 8 } /* compile the delay slot using temporary compiler state */ @@ -835,8 +835,8 @@ void rsp_device::generate_delay_slot_and_branch(drcuml_block *block, compiler_st int rsp_device::generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = op >> 26; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = op >> 26; code_label skip; switch (opswitch) @@ -1045,8 +1045,8 @@ int rsp_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c int rsp_device::generate_special(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = op & 63; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = op & 63; //code_label skip; switch (opswitch) @@ -1140,7 +1140,7 @@ int rsp_device::generate_special(drcuml_block *block, compiler_state *compiler, if (RDREG != 0) { UML_OR(block, I0, R32(RSREG), R32(RTREG)); // dor i0,, - UML_XOR(block, R32(RDREG), I0, (UINT64)~0); // dxor ,i0,~0 + UML_XOR(block, R32(RDREG), I0, (uint64_t)~0); // dxor ,i0,~0 } return TRUE; @@ -1200,8 +1200,8 @@ int rsp_device::generate_special(drcuml_block *block, compiler_state *compiler, int rsp_device::generate_regimm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = RTREG; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = RTREG; code_label skip; switch (opswitch) @@ -1243,8 +1243,8 @@ int rsp_device::generate_regimm(drcuml_block *block, compiler_state *compiler, c int rsp_device::generate_cop0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT32 op = desc->opptr.l[0]; - UINT8 opswitch = RSREG; + uint32_t op = desc->opptr.l[0]; + uint8_t opswitch = RSREG; switch (opswitch) { @@ -1281,7 +1281,7 @@ int rsp_device::generate_cop0(drcuml_block *block, compiler_state *compiler, con including disassembly of a RSP instruction -------------------------------------------------*/ -void rsp_device::log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 op) +void rsp_device::log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint32_t op) { if (m_drcuml->logging()) { diff --git a/src/devices/cpu/rsp/rspfe.cpp b/src/devices/cpu/rsp/rspfe.cpp index 7a80fb6347b..c86ed6f5298 100644 --- a/src/devices/cpu/rsp/rspfe.cpp +++ b/src/devices/cpu/rsp/rspfe.cpp @@ -20,7 +20,7 @@ // rsp_frontend - constructor //------------------------------------------------- -rsp_frontend::rsp_frontend(rsp_device &rsp, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) +rsp_frontend::rsp_frontend(rsp_device &rsp, uint32_t window_start, uint32_t window_end, uint32_t max_sequence) : drc_frontend(rsp, window_start, window_end, max_sequence), m_rsp(rsp) { @@ -34,7 +34,7 @@ rsp_frontend::rsp_frontend(rsp_device &rsp, UINT32 window_start, UINT32 window_e bool rsp_frontend::describe(opcode_desc &desc, const opcode_desc *prev) { - UINT32 op, opswitch; + uint32_t op, opswitch; // fetch the opcode op = desc.opptr.l[0] = m_rsp.m_direct->read_dword(desc.physpc | 0x1000); @@ -157,7 +157,7 @@ bool rsp_frontend::describe(opcode_desc &desc, const opcode_desc *prev) // single instruction in the 'special' group //------------------------------------------------- -bool rsp_frontend::describe_special(UINT32 op, opcode_desc &desc) +bool rsp_frontend::describe_special(uint32_t op, opcode_desc &desc) { switch (op & 63) { @@ -219,7 +219,7 @@ bool rsp_frontend::describe_special(UINT32 op, opcode_desc &desc) // single instruction in the 'regimm' group //------------------------------------------------- -bool rsp_frontend::describe_regimm(UINT32 op, opcode_desc &desc) +bool rsp_frontend::describe_regimm(uint32_t op, opcode_desc &desc) { switch (RTREG) { @@ -262,7 +262,7 @@ bool rsp_frontend::describe_regimm(UINT32 op, opcode_desc &desc) // single instruction in the COP0 group //------------------------------------------------- -bool rsp_frontend::describe_cop0(UINT32 op, opcode_desc &desc) +bool rsp_frontend::describe_cop0(uint32_t op, opcode_desc &desc) { switch (RSREG) { @@ -287,7 +287,7 @@ bool rsp_frontend::describe_cop0(UINT32 op, opcode_desc &desc) // single instruction in the COP2 group //------------------------------------------------- -bool rsp_frontend::describe_cop2(UINT32 op, opcode_desc &desc) +bool rsp_frontend::describe_cop2(uint32_t op, opcode_desc &desc) { switch (RSREG) { diff --git a/src/devices/cpu/rsp/rspfe.h b/src/devices/cpu/rsp/rspfe.h index 52f5a64243e..d292d9f4225 100644 --- a/src/devices/cpu/rsp/rspfe.h +++ b/src/devices/cpu/rsp/rspfe.h @@ -34,7 +34,7 @@ class rsp_frontend : public drc_frontend { public: // construction/destruction - rsp_frontend(rsp_device &rsp, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); + rsp_frontend(rsp_device &rsp, uint32_t window_start, uint32_t window_end, uint32_t max_sequence); protected: // required overrides @@ -42,10 +42,10 @@ protected: private: // internal helpers - bool describe_special(UINT32 op, opcode_desc &desc); - bool describe_regimm(UINT32 op, opcode_desc &desc); - bool describe_cop0(UINT32 op, opcode_desc &desc); - bool describe_cop2(UINT32 op, opcode_desc &desc); + bool describe_special(uint32_t op, opcode_desc &desc); + bool describe_regimm(uint32_t op, opcode_desc &desc); + bool describe_cop0(uint32_t op, opcode_desc &desc); + bool describe_cop2(uint32_t op, opcode_desc &desc); // internal state rsp_device &m_rsp; diff --git a/src/devices/cpu/rsp/vand.h b/src/devices/cpu/rsp/vand.h index 4349227fdd3..8f638330e2a 100644 --- a/src/devices/cpu/rsp/vand.h +++ b/src/devices/cpu/rsp/vand.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vand_vnand(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt) { +inline rsp_vec_t vec_vand_vnand(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt) { rsp_vec_t vmask = _mm_load_si128((rsp_vec_t *) m_vec_helpers.logic_mask[iw & 0x1]); rsp_vec_t vd = _mm_and_si128(vs, vt); diff --git a/src/devices/cpu/rsp/vcmp.h b/src/devices/cpu/rsp/vcmp.h index 7ae4dc4c444..7838322d26e 100644 --- a/src/devices/cpu/rsp/vcmp.h +++ b/src/devices/cpu/rsp/vcmp.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_veq_vge_vlt_vne(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *le, rsp_vec_t eq, rsp_vec_t sign) +inline rsp_vec_t vec_veq_vge_vlt_vne(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *le, rsp_vec_t eq, rsp_vec_t sign) { rsp_vec_t equal = _mm_cmpeq_epi16(vs, vt); diff --git a/src/devices/cpu/rsp/vdivh.h b/src/devices/cpu/rsp/vdivh.h index 286aa8a3ca7..5bd4093f6b4 100644 --- a/src/devices/cpu/rsp/vdivh.h +++ b/src/devices/cpu/rsp/vdivh.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vdivh(UINT32 src, UINT32 e, UINT32 dest, UINT32 de) +inline rsp_vec_t vec_vdivh(uint32_t src, uint32_t e, uint32_t dest, uint32_t de) { // Get the element from VT. m_div_in = m_v[src].s[e & 0x7]; diff --git a/src/devices/cpu/rsp/vldst.h b/src/devices/cpu/rsp/vldst.h index 4a38af029d4..fadc8be63c0 100644 --- a/src/devices/cpu/rsp/vldst.h +++ b/src/devices/cpu/rsp/vldst.h @@ -2,14 +2,14 @@ // copyright-holders:Tyler J. Stachecki,Ryan Holtz // LBV, LDV, LLV, LSV, SBV, SDV, SLV, SSV -inline void vec_lbdlsv_sbdlsv(UINT32 iw, UINT32 rs) +inline void vec_lbdlsv_sbdlsv(uint32_t iw, uint32_t rs) { - const UINT32 shift_and_idx = (iw >> 11) & 0x3; + const uint32_t shift_and_idx = (iw >> 11) & 0x3; rsp_vec_t dqm = _mm_loadl_epi64((rsp_vec_t *) (m_vec_helpers.bdls_lut[shift_and_idx])); - const UINT32 addr = (rs + (sign_extend_6(iw) << shift_and_idx)) & 0xfff; - const UINT32 element = (iw >> 7) & 0xf; - UINT16* regp = m_v[(iw >> 16) & 0x1f].s; + const uint32_t addr = (rs + (sign_extend_6(iw) << shift_and_idx)) & 0xfff; + const uint32_t element = (iw >> 7) & 0xf; + uint16_t* regp = m_v[(iw >> 16) & 0x1f].s; if (iw >> 29 & 0x1) { @@ -22,7 +22,7 @@ inline void vec_lbdlsv_sbdlsv(UINT32 iw, UINT32 rs) } // LPV, LUV, SPV, SUV -inline void vec_lfhpuv_sfhpuv(UINT32 iw, UINT32 rs) +inline void vec_lfhpuv_sfhpuv(uint32_t iw, uint32_t rs) { static const enum rsp_mem_request_type fhpu_type_lut[4] = { RSP_MEM_REQUEST_PACK, @@ -31,9 +31,9 @@ inline void vec_lfhpuv_sfhpuv(UINT32 iw, UINT32 rs) RSP_MEM_REQUEST_FOURTH }; - const UINT32 addr = (rs + (sign_extend_6(iw) << 3)) & 0xfff; - const UINT32 element = (iw >> 7) & 0xf; - UINT16* regp = m_v[(iw >> 16) & 0x1f].s; + const uint32_t addr = (rs + (sign_extend_6(iw) << 3)) & 0xfff; + const uint32_t element = (iw >> 7) & 0xf; + uint16_t* regp = m_v[(iw >> 16) & 0x1f].s; rsp_mem_request_type request_type = fhpu_type_lut[((iw >> 11) & 0x1f) - 6]; if ((iw >> 29) & 0x1) @@ -47,13 +47,13 @@ inline void vec_lfhpuv_sfhpuv(UINT32 iw, UINT32 rs) } // LQV, LRV, SQV, SRV -inline void vec_lqrv_sqrv(UINT32 iw, UINT32 rs) +inline void vec_lqrv_sqrv(uint32_t iw, uint32_t rs) { rs &= 0xfff; - const UINT32 addr = rs + (sign_extend_6(iw) << 4); - const UINT32 element = (iw >> 7) & 0xf; - UINT16* regp = m_v[(iw >> 16) & 0x1f].s; + const uint32_t addr = rs + (sign_extend_6(iw) << 4); + const uint32_t element = (iw >> 7) & 0xf; + uint16_t* regp = m_v[(iw >> 16) & 0x1f].s; memcpy(m_vdqm.s, m_vec_helpers.qr_lut[addr & 0xf], sizeof(m_vdqm.s)); diff --git a/src/devices/cpu/rsp/vmac.h b/src/devices/cpu/rsp/vmac.h index ecf921a261c..ade43511daa 100644 --- a/src/devices/cpu/rsp/vmac.h +++ b/src/devices/cpu/rsp/vmac.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vmacf_vmacu(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_mid, rsp_vec_t *acc_hi) +inline rsp_vec_t vec_vmacf_vmacu(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_mid, rsp_vec_t *acc_hi) { // Get the product and shift it over // being sure to save the carries. diff --git a/src/devices/cpu/rsp/vmov.h b/src/devices/cpu/rsp/vmov.h index 10a7b1df85f..59e02e8b118 100644 --- a/src/devices/cpu/rsp/vmov.h +++ b/src/devices/cpu/rsp/vmov.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vmov(UINT32 src, UINT32 e, UINT32 dest, UINT32 de) +inline rsp_vec_t vec_vmov(uint32_t src, uint32_t e, uint32_t dest, uint32_t de) { // Get the element from VT and write out the upper part of the result. m_v[dest].s[de & 0x7] = m_v[src].s[e & 0x7]; diff --git a/src/devices/cpu/rsp/vmul.h b/src/devices/cpu/rsp/vmul.h index c8bfc1bbb14..dc09e81768a 100644 --- a/src/devices/cpu/rsp/vmul.h +++ b/src/devices/cpu/rsp/vmul.h @@ -5,7 +5,7 @@ // TODO: CHECK ME. // -inline rsp_vec_t vec_vmulf_vmulu(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) +inline rsp_vec_t vec_vmulf_vmulu(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) { rsp_vec_t lo = _mm_mullo_epi16(vs, vt); rsp_vec_t round = _mm_cmpeq_epi16(zero, zero); diff --git a/src/devices/cpu/rsp/vmulh.h b/src/devices/cpu/rsp/vmulh.h index aaccf9d41b3..6265961f5a0 100644 --- a/src/devices/cpu/rsp/vmulh.h +++ b/src/devices/cpu/rsp/vmulh.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vmadh_vmudh(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) +inline rsp_vec_t vec_vmadh_vmudh(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) { rsp_vec_t lo = _mm_mullo_epi16(vs, vt); rsp_vec_t hi = _mm_mulhi_epi16(vs, vt); diff --git a/src/devices/cpu/rsp/vmull.h b/src/devices/cpu/rsp/vmull.h index 2052d537aa8..e54399b01da 100644 --- a/src/devices/cpu/rsp/vmull.h +++ b/src/devices/cpu/rsp/vmull.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vmadl_vmudl(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) +inline rsp_vec_t vec_vmadl_vmudl(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) { rsp_vec_t hi = _mm_mulhi_epu16(vs, vt); diff --git a/src/devices/cpu/rsp/vmulm.h b/src/devices/cpu/rsp/vmulm.h index 0319a2f6dcc..df76833ed0c 100644 --- a/src/devices/cpu/rsp/vmulm.h +++ b/src/devices/cpu/rsp/vmulm.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vmadm_vmudm(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) +inline rsp_vec_t vec_vmadm_vmudm(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) { rsp_vec_t lo = _mm_mullo_epi16(vs, vt); rsp_vec_t hi = _mm_mulhi_epu16(vs, vt); diff --git a/src/devices/cpu/rsp/vmuln.h b/src/devices/cpu/rsp/vmuln.h index b9e012622fc..07453b631a8 100644 --- a/src/devices/cpu/rsp/vmuln.h +++ b/src/devices/cpu/rsp/vmuln.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vmadn_vmudn(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) +inline rsp_vec_t vec_vmadn_vmudn(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi) { rsp_vec_t lo = _mm_mullo_epi16(vs, vt); rsp_vec_t hi = _mm_mulhi_epu16(vs, vt); diff --git a/src/devices/cpu/rsp/vor.h b/src/devices/cpu/rsp/vor.h index 9f946df7ca9..07cbb57164c 100644 --- a/src/devices/cpu/rsp/vor.h +++ b/src/devices/cpu/rsp/vor.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vor_vnor(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt) +inline rsp_vec_t vec_vor_vnor(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt) { rsp_vec_t vmask = _mm_load_si128((rsp_vec_t *) m_vec_helpers.logic_mask[iw & 0x1]); diff --git a/src/devices/cpu/rsp/vrcpsq.h b/src/devices/cpu/rsp/vrcpsq.h index 930d8237853..4897e536193 100644 --- a/src/devices/cpu/rsp/vrcpsq.h +++ b/src/devices/cpu/rsp/vrcpsq.h @@ -1,17 +1,17 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vrcp_vrsq(UINT32 iw, INT32 dp, UINT32 src, UINT32 e, UINT32 dest, UINT32 de) +inline rsp_vec_t vec_vrcp_vrsq(uint32_t iw, int32_t dp, uint32_t src, uint32_t e, uint32_t dest, uint32_t de) { // Get the element from VT. - INT16 vt = m_v[src].s[e & 0x7]; + int16_t vt = m_v[src].s[e & 0x7]; - UINT32 dp_input = ((UINT32) m_div_in << 16) | (UINT16) vt; - UINT32 sp_input = vt; + uint32_t dp_input = ((uint32_t) m_div_in << 16) | (uint16_t) vt; + uint32_t sp_input = vt; - INT32 input = (dp) ? dp_input : sp_input; - INT32 input_mask = input >> 31; - INT32 data = input ^ input_mask; + int32_t input = (dp) ? dp_input : sp_input; + int32_t input_mask = input >> 31; + int32_t data = input ^ input_mask; if (input > -32768) { @@ -19,7 +19,7 @@ inline rsp_vec_t vec_vrcp_vrsq(UINT32 iw, INT32 dp, UINT32 src, UINT32 e, UINT32 } // Handle edge cases. - INT32 result; + int32_t result; if (data == 0) { result = 0x7fffffff; @@ -30,8 +30,8 @@ inline rsp_vec_t vec_vrcp_vrsq(UINT32 iw, INT32 dp, UINT32 src, UINT32 e, UINT32 } else // Main case: compute the reciprocal. { - UINT32 shift = count_leading_zeros(data); - UINT32 idx = (((UINT64) data << shift) & 0x7FC00000) >> 22; + uint32_t shift = count_leading_zeros(data); + uint32_t idx = (((uint64_t) data << shift) & 0x7FC00000) >> 22; if (iw & 0x4) // VRSQ { diff --git a/src/devices/cpu/rsp/vrsq.h b/src/devices/cpu/rsp/vrsq.h index f657bc42554..d4bdb190fec 100644 --- a/src/devices/cpu/rsp/vrsq.h +++ b/src/devices/cpu/rsp/vrsq.h @@ -1,17 +1,17 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -rsp_vec_t vec_vrsq(INT32 dp, UINT32 src, UINT32 e, UINT32 dest, UINT32 de) +rsp_vec_t vec_vrsq(int32_t dp, uint32_t src, uint32_t e, uint32_t dest, uint32_t de) { // Get the element from VT. - INT16 vt = m_v[src].s[e & 0x7]; + int16_t vt = m_v[src].s[e & 0x7]; - UINT32 dp_input = ((UINT32) m_div_in << 16) | (UINT16) vt; - UINT32 sp_input = vt; + uint32_t dp_input = ((uint32_t) m_div_in << 16) | (uint16_t) vt; + uint32_t sp_input = vt; - INT32 input = (dp) ? dp_input : sp_input; - INT32 input_mask = input >> 31; - INT32 data = input ^ input_mask; + int32_t input = (dp) ? dp_input : sp_input; + int32_t input_mask = input >> 31; + int32_t data = input ^ input_mask; if (input > -32768) { @@ -19,7 +19,7 @@ rsp_vec_t vec_vrsq(INT32 dp, UINT32 src, UINT32 e, UINT32 dest, UINT32 de) } // Handle edge cases. - INT32 result; + int32_t result; if (data == 0) { result = 0x7fffffff; @@ -30,9 +30,9 @@ rsp_vec_t vec_vrsq(INT32 dp, UINT32 src, UINT32 e, UINT32 dest, UINT32 de) } else // Main case: compute the reciprocal. { - UINT32 shift = count_leading_zeros(data); + uint32_t shift = count_leading_zeros(data); - UINT32 idx = (((UINT64) data << shift) & 0x7fc00000) >> 22; + uint32_t idx = (((uint64_t) data << shift) & 0x7fc00000) >> 22; idx = ((idx | 0x200) & 0x3fe) | (shift % 2); result = rsp_divtable[idx]; @@ -47,9 +47,9 @@ rsp_vec_t vec_vrsq(INT32 dp, UINT32 src, UINT32 e, UINT32 dest, UINT32 de) return vec_load_unshuffled_operand(m_v[dest].s); } -rsp_vec_t vec_vrsqh(UINT32 src, UINT32 e, UINT32 dest, UINT32 de) +rsp_vec_t vec_vrsqh(uint32_t src, uint32_t e, uint32_t dest, uint32_t de) { - INT16 elements[8]; + int16_t elements[8]; // Get the element from VT. memcpy(elements, &m_v[src], sizeof(rsp_vec_t)); diff --git a/src/devices/cpu/rsp/vxor.h b/src/devices/cpu/rsp/vxor.h index b11e1b96bc1..9f7f62853c5 100644 --- a/src/devices/cpu/rsp/vxor.h +++ b/src/devices/cpu/rsp/vxor.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Tyler J. Stachecki,Ryan Holtz -inline rsp_vec_t vec_vxor_vnxor(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt) +inline rsp_vec_t vec_vxor_vnxor(uint32_t iw, rsp_vec_t vs, rsp_vec_t vt) { rsp_vec_t vmask = _mm_load_si128((rsp_vec_t *) m_vec_helpers.logic_mask[iw & 0x1]); diff --git a/src/devices/cpu/s2650/2650dasm.cpp b/src/devices/cpu/s2650/2650dasm.cpp index a7bd56d406d..9540224e39f 100644 --- a/src/devices/cpu/s2650/2650dasm.cpp +++ b/src/devices/cpu/s2650/2650dasm.cpp @@ -11,7 +11,7 @@ #include "emu.h" -static const UINT8 *rambase; +static const uint8_t *rambase; static offs_t pcbase; #define readarg(A) (rambase[(A) - pcbase]) @@ -223,7 +223,7 @@ static char *ADR(int pc) /* disassemble one instruction at PC into buff. return byte size of instr */ CPU_DISASSEMBLE( s2650 ) { - UINT32 flags = 0; + uint32_t flags = 0; int PC = pc; int op = oprom[0]; int rv = op & 3; diff --git a/src/devices/cpu/s2650/s2650.cpp b/src/devices/cpu/s2650/s2650.cpp index 1071d896350..6844a1ee510 100644 --- a/src/devices/cpu/s2650/s2650.cpp +++ b/src/devices/cpu/s2650/s2650.cpp @@ -29,7 +29,7 @@ const device_type S2650 = &device_creator; -s2650_device::s2650_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s2650_device::s2650_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, S2650, "S2650", tag, owner, clock, "s2650", __FILE__ ) , m_program_config("program", ENDIANNESS_LITTLE, 8, 15) , m_io_config("io", ENDIANNESS_LITTLE, 8, 9) @@ -42,7 +42,7 @@ s2650_device::s2650_device(const machine_config &mconfig, const char *tag, devic } -offs_t s2650_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t s2650_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( s2650 ); return CPU_DISASSEMBLE_NAME(s2650)(this, buffer, pc, oprom, opram, options); @@ -50,7 +50,7 @@ offs_t s2650_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op /* condition code changes for a byte */ -static const UINT8 ccc[0x200] = { +static const uint8_t ccc[0x200] = { 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, @@ -148,21 +148,21 @@ static const int S2650_relative[0x100] = ***************************************************************/ #define RDMEM(addr) m_program->read_byte(addr) -inline void s2650_device::set_psu(UINT8 new_val) +inline void s2650_device::set_psu(uint8_t new_val) { - UINT8 old = m_psu; + uint8_t old = m_psu; m_psu = new_val; if ((new_val ^ old) & FO) m_flag_handler((new_val & FO) ? 1 : 0); } -inline UINT8 s2650_device::get_sp() +inline uint8_t s2650_device::get_sp() { return (m_psu & SP); } -inline void s2650_device::set_sp(UINT8 new_sp) +inline void s2650_device::set_sp(uint8_t new_sp) { m_psu = (m_psu & ~SP) | (new_sp & SP); } @@ -230,9 +230,9 @@ inline int s2650_device::check_irq_line() * ROP * read next opcode ***************************************************************/ -inline UINT8 s2650_device::ROP() +inline uint8_t s2650_device::ROP() { - UINT8 result = m_direct->read_byte(m_page + m_iar); + uint8_t result = m_direct->read_byte(m_page + m_iar); m_iar = (m_iar + 1) & PMSK; return result; } @@ -241,9 +241,9 @@ inline UINT8 s2650_device::ROP() * ARG * read next opcode argument ***************************************************************/ -inline UINT8 s2650_device::ARG() +inline uint8_t s2650_device::ARG() { - UINT8 result = m_direct->read_byte(m_page + m_iar); + uint8_t result = m_direct->read_byte(m_page + m_iar); m_iar = (m_iar + 1) & PMSK; return result; } @@ -254,7 +254,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define _REL_EA(page) \ { \ - UINT8 hr = ARG(); /* get 'holding register' */ \ + uint8_t hr = ARG(); /* get 'holding register' */ \ /* build effective address within current 8K page */ \ m_ea = page + ((m_iar + S2650_relative[hr]) & PMSK); \ if (hr & 0x80) { /* indirect bit set ? */ \ @@ -273,7 +273,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define _REL_ZERO(page) \ { \ - UINT8 hr = ARG(); /* get 'holding register' */ \ + uint8_t hr = ARG(); /* get 'holding register' */ \ /* build effective address from 0 */ \ m_ea = (S2650_relative[hr] & PMSK); \ if (hr & 0x80) { /* indirect bit set ? */ \ @@ -292,7 +292,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define _ABS_EA() \ { \ - UINT8 hr, dr; \ + uint8_t hr, dr; \ hr = ARG(); /* get 'holding register' */ \ dr = ARG(); /* get 'data bus register' */ \ /* build effective address within current 8K page */ \ @@ -334,7 +334,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define _BRA_EA() \ { \ - UINT8 hr, dr; \ + uint8_t hr, dr; \ hr = ARG(); /* get 'holding register' */ \ dr = ARG(); /* get 'data bus register' */ \ /* build address in 32K address space */ \ @@ -357,7 +357,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define SWAP_REGS \ { \ - UINT8 tmp; \ + uint8_t tmp; \ tmp = m_reg[1]; \ m_reg[1] = m_reg[4]; \ m_reg[4] = tmp; \ @@ -568,10 +568,10 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_ADD(dest,_source) \ { \ - UINT8 source = _source; \ - UINT8 before = dest; \ + uint8_t source = _source; \ + uint8_t before = dest; \ /* add source; carry only if WC is set */ \ - UINT16 res = dest + source + ((m_psl >> 3) & m_psl & C); \ + uint16_t res = dest + source + ((m_psl >> 3) & m_psl & C); \ m_psl &= ~(C | OVF | IDC); \ if(res & 0x100) m_psl |= C; \ dest = res & 0xff; \ @@ -586,10 +586,10 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_SUB(dest,_source) \ { \ - UINT8 source = _source; \ - UINT8 before = dest; \ + uint8_t source = _source; \ + uint8_t before = dest; \ /* subtract source; borrow only if WC is set */ \ - UINT16 res = dest - source - ((m_psl >> 3) & (m_psl ^ C) & C); \ + uint16_t res = dest - source - ((m_psl >> 3) & (m_psl ^ C) & C); \ m_psl &= ~(C | OVF | IDC); \ if((res & 0x100)==0) m_psl |= C; \ dest = res & 0xff; \ @@ -606,8 +606,8 @@ inline UINT8 s2650_device::ARG() { \ int d; \ m_psl &= ~CC; \ - if (m_psl & COM) d = (UINT8)reg - (UINT8)val; \ - else d = (INT8)reg - (INT8)val; \ + if (m_psl & COM) d = (uint8_t)reg - (uint8_t)val; \ + else d = (int8_t)reg - (int8_t)val; \ if( d < 0 ) m_psl |= 0x80; \ else \ if( d > 0 ) m_psl |= 0x40; \ @@ -630,10 +630,10 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_RRL(dest) \ { \ - UINT8 before = dest; \ + uint8_t before = dest; \ if( m_psl & WC ) \ { \ - UINT8 c = m_psl & C; \ + uint8_t c = m_psl & C; \ m_psl &= ~(C + IDC); \ dest = (before << 1) | c; \ m_psl |= (before >> 7) + (dest & IDC); \ @@ -653,10 +653,10 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_RRR(dest) \ { \ - UINT8 before = dest; \ + uint8_t before = dest; \ if (m_psl & WC) \ { \ - UINT8 c = m_psl & C; \ + uint8_t c = m_psl & C; \ m_psl &= ~(C + IDC); \ dest = (before >> 1) | (c << 7); \ m_psl |= (before & C) + (dest & IDC); \ @@ -694,7 +694,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_CPSU() \ { \ - UINT8 cpsu = ARG(); \ + uint8_t cpsu = ARG(); \ set_psu(m_psu & ~cpsu); \ m_icount -= check_irq_line(); \ } @@ -705,7 +705,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_CPSL() \ { \ - UINT8 cpsl = ARG(); \ + uint8_t cpsl = ARG(); \ /* select other register set now ? */ \ if( (cpsl & RS) && (m_psl & RS) ) \ SWAP_REGS; \ @@ -719,7 +719,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_PPSU() \ { \ - UINT8 ppsu = (ARG() & ~PSU34) & ~SI; \ + uint8_t ppsu = (ARG() & ~PSU34) & ~SI; \ set_psu(m_psu | ppsu); \ } @@ -729,7 +729,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_PPSL() \ { \ - UINT8 ppsl = ARG(); \ + uint8_t ppsl = ARG(); \ /* select 2nd register set now ? */ \ if ((ppsl & RS) && !(m_psl & RS)) \ SWAP_REGS; \ @@ -742,8 +742,8 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_TPSU() \ { \ - UINT8 tpsu = ARG(); \ - UINT8 rpsu = (m_psu | (m_io->read_byte(S2650_SENSE_PORT) ? SI : 0)); \ + uint8_t tpsu = ARG(); \ + uint8_t rpsu = (m_psu | (m_io->read_byte(S2650_SENSE_PORT) ? SI : 0)); \ m_psl &= ~CC; \ if( (rpsu & tpsu) != tpsu ) \ m_psl |= 0x80; \ @@ -755,7 +755,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_TPSL() \ { \ - UINT8 tpsl = ARG(); \ + uint8_t tpsl = ARG(); \ if( (m_psl & tpsl) != tpsl ) \ m_psl = (m_psl & ~CC) | 0x80; \ else \ @@ -768,7 +768,7 @@ inline UINT8 s2650_device::ARG() ***************************************************************/ #define M_TMI(value) \ { \ - UINT8 tmi = ARG(); \ + uint8_t tmi = ARG(); \ m_psl &= ~CC; \ if( (value & tmi) != tmi ) \ m_psl |= 0x80; \ diff --git a/src/devices/cpu/s2650/s2650.h b/src/devices/cpu/s2650/s2650.h index 9448d203733..8b7f36479f3 100644 --- a/src/devices/cpu/s2650/s2650.h +++ b/src/devices/cpu/s2650/s2650.h @@ -38,7 +38,7 @@ class s2650_device : public cpu_device { public: // construction/destruction - s2650_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s2650_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_flag_handler(device_t &device, _Object object) { return downcast(device).m_flag_handler.set_callback(object); } @@ -50,10 +50,10 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 5; } - virtual UINT32 execute_max_cycles() const override { return 13; } - virtual UINT32 execute_input_lines() const override { return 2; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 5; } + virtual uint32_t execute_max_cycles() const override { return 13; } + virtual uint32_t execute_input_lines() const override { return 2; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -69,9 +69,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 3; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 3; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -80,18 +80,18 @@ private: devcb_write_line m_flag_handler; devcb_write_line m_intack_handler; - UINT16 m_ppc; /* previous program counter (page + iar) */ - UINT16 m_page; /* 8K page select register (A14..A13) */ - UINT16 m_iar; /* instruction address register (A12..A0) */ - UINT16 m_ea; /* effective address (A14..A0) */ - UINT8 m_psl; /* processor status lower */ - UINT8 m_psu; /* processor status upper */ - UINT8 m_r; /* absolute addressing dst/src register */ - UINT8 m_reg[7]; /* 7 general purpose registers */ - UINT8 m_halt; /* 1 if cpu is halted */ - UINT8 m_ir; /* instruction register */ - UINT16 m_ras[8]; /* 8 return address stack entries */ - UINT8 m_irq_state; + uint16_t m_ppc; /* previous program counter (page + iar) */ + uint16_t m_page; /* 8K page select register (A14..A13) */ + uint16_t m_iar; /* instruction address register (A12..A0) */ + uint16_t m_ea; /* effective address (A14..A0) */ + uint8_t m_psl; /* processor status lower */ + uint8_t m_psu; /* processor status upper */ + uint8_t m_r; /* absolute addressing dst/src register */ + uint8_t m_reg[7]; /* 7 general purpose registers */ + uint8_t m_halt; /* 1 if cpu is halted */ + uint8_t m_ir; /* instruction register */ + uint16_t m_ras[8]; /* 8 return address stack entries */ + uint8_t m_irq_state; int m_icount; address_space *m_program; @@ -99,14 +99,14 @@ private: address_space *m_io; // For debugger - UINT16 m_debugger_temp; + uint16_t m_debugger_temp; - inline void set_psu(UINT8 new_val); - inline UINT8 get_sp(); - inline void set_sp(UINT8 new_sp); + inline void set_psu(uint8_t new_val); + inline uint8_t get_sp(); + inline void set_sp(uint8_t new_sp); inline int check_irq_line(); - inline UINT8 ROP(); - inline UINT8 ARG(); + inline uint8_t ROP(); + inline uint8_t ARG(); void s2650_set_flag(int state); int s2650_get_flag(); void s2650_set_sense(int state); diff --git a/src/devices/cpu/saturn/satops.hxx b/src/devices/cpu/saturn/satops.hxx index 8f7420584e3..3d279da8e2f 100644 --- a/src/devices/cpu/saturn/satops.hxx +++ b/src/devices/cpu/saturn/satops.hxx @@ -7,7 +7,7 @@ int saturn_device::READ_OP() { - UINT8 data; + uint8_t data; m_icount-=3; data=m_direct->read_byte(m_pc); saturn_assert(data<0x10); @@ -17,7 +17,7 @@ int saturn_device::READ_OP() int saturn_device::READ_OP_ARG() { - UINT8 data; + uint8_t data; m_icount-=3; data=m_direct->read_byte(m_pc); saturn_assert(data<0x10); @@ -32,9 +32,9 @@ int saturn_device::READ_OP_ARG8() return n0|(n1<<4); } -INT8 saturn_device::READ_OP_DIS8() +int8_t saturn_device::READ_OP_DIS8() { - return (INT8)READ_OP_ARG8(); + return (int8_t)READ_OP_ARG8(); } int saturn_device::READ_OP_ARG12() @@ -61,9 +61,9 @@ int saturn_device::READ_OP_ARG16() return n0|(n1<<4)|(n2<<8)|(n3<<12); } -INT16 saturn_device::READ_OP_DIS16() +int16_t saturn_device::READ_OP_DIS16() { - return (INT16)READ_OP_ARG16(); + return (int16_t)READ_OP_ARG16(); } int saturn_device::READ_OP_ARG20() @@ -76,9 +76,9 @@ int saturn_device::READ_OP_ARG20() return n0|(n1<<4)|(n2<<8)|(n3<<12)|(n4<<16); } -int saturn_device::READ_NIBBLE(UINT32 adr) +int saturn_device::READ_NIBBLE(uint32_t adr) { - UINT8 data; + uint8_t data; m_icount-=3; data=m_program->read_byte(adr&0xfffff); saturn_assert(data<0x10); @@ -86,14 +86,14 @@ int saturn_device::READ_NIBBLE(UINT32 adr) return data; } -int saturn_device::READ_8(UINT32 adr) +int saturn_device::READ_8(uint32_t adr) { int n0=READ_NIBBLE(adr); int n1=READ_NIBBLE(adr+1); return n0|(n1<<4); } -int saturn_device::READ_12(UINT32 adr) +int saturn_device::READ_12(uint32_t adr) { int n0=READ_NIBBLE(adr); int n1=READ_NIBBLE(adr+1); @@ -101,7 +101,7 @@ int saturn_device::READ_12(UINT32 adr) return n0|(n1<<4)|(n2<<8); } -int saturn_device::READ_16(UINT32 adr) +int saturn_device::READ_16(uint32_t adr) { int n0=READ_NIBBLE(adr); int n1=READ_NIBBLE(adr+1); @@ -110,7 +110,7 @@ int saturn_device::READ_16(UINT32 adr) return n0|(n1<<4)|(n2<<8)|(n3<<12); } -int saturn_device::READ_20(UINT32 adr) +int saturn_device::READ_20(uint32_t adr) { int n0=READ_NIBBLE(adr); int n1=READ_NIBBLE(adr+1); @@ -120,7 +120,7 @@ int saturn_device::READ_20(UINT32 adr) return n0|(n1<<4)|(n2<<8)|(n3<<12)|(n4<<16); } -void saturn_device::WRITE_NIBBLE(UINT32 adr, UINT8 nib) +void saturn_device::WRITE_NIBBLE(uint32_t adr, uint8_t nib) { m_icount-=3; saturn_assert(nib<0x10); @@ -186,15 +186,15 @@ void saturn_device::S64_WRITE_A(int r, int v) -UINT32 saturn_device::saturn_pop() +uint32_t saturn_device::saturn_pop() { - UINT32 temp=m_rstk[0]; + uint32_t temp=m_rstk[0]; memmove(m_rstk, m_rstk+1, sizeof(m_rstk)-sizeof(m_rstk[0])); m_rstk[7]=0; return temp; } -void saturn_device::saturn_push(UINT32 adr) +void saturn_device::saturn_push(uint32_t adr) { memmove(m_rstk+1, m_rstk, sizeof(m_rstk)-sizeof(m_rstk[0])); m_rstk[0]=adr; @@ -806,7 +806,7 @@ void saturn_device::saturn_clear(int reg, int begin, int count) void saturn_device::saturn_exchange(int left, int begin, int count, int right) { int i; - UINT8 temp; + uint8_t temp; saturn_assert(left>=0 && left<9); saturn_assert(right>=0 && right<9); saturn_assert(begin>=0 && count>0 && begin+count<=16); @@ -859,7 +859,7 @@ void saturn_device::saturn_add(int reg, int begin, int count, int right) } } -void saturn_device::saturn_add_const(int reg, int begin, int count, UINT8 right) +void saturn_device::saturn_add_const(int reg, int begin, int count, uint8_t right) { int i, t; int base=m_decimal?10:16; diff --git a/src/devices/cpu/saturn/saturn.cpp b/src/devices/cpu/saturn/saturn.cpp index 159d2ecd037..3f3f05b05bd 100644 --- a/src/devices/cpu/saturn/saturn.cpp +++ b/src/devices/cpu/saturn/saturn.cpp @@ -42,7 +42,7 @@ const device_type SATURN = &device_creator; -saturn_device::saturn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saturn_device::saturn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SATURN, "HP Saturn", tag, owner, clock, "saturn_cpu", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0) , m_out_func(*this) @@ -58,7 +58,7 @@ saturn_device::saturn_device(const machine_config &mconfig, const char *tag, dev } -offs_t saturn_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t saturn_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( saturn ); return CPU_DISASSEMBLE_NAME(saturn)(this, buffer, pc, oprom, opram, options); @@ -394,7 +394,7 @@ void saturn_device::execute_set_input(int inputnum, int state) } -void saturn_device::IntReg64(Saturn64 r, INT64 d) +void saturn_device::IntReg64(Saturn64 r, int64_t d) { int i; for (i=0; i<16; i++) @@ -402,11 +402,11 @@ void saturn_device::IntReg64(Saturn64 r, INT64 d) } -INT64 saturn_device::Reg64Int(Saturn64 r) +int64_t saturn_device::Reg64Int(Saturn64 r) { - INT64 x = 0; + int64_t x = 0; int i; for (i=0; i<16; i++) - x |= (INT64) r[i] << (4*i); + x |= (int64_t) r[i] << (4*i); return x; } diff --git a/src/devices/cpu/saturn/saturn.h b/src/devices/cpu/saturn/saturn.h index 28de3e41910..c12dfd98418 100644 --- a/src/devices/cpu/saturn/saturn.h +++ b/src/devices/cpu/saturn/saturn.h @@ -76,7 +76,7 @@ class saturn_device : public cpu_device { public: // construction/destruction - saturn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saturn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_out_func(device_t &device, _Object object) { return downcast(device).m_out_func.set_callback(object); } @@ -94,9 +94,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 2; } - virtual UINT32 execute_max_cycles() const override { return 21; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 2; } + virtual uint32_t execute_max_cycles() const override { return 21; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -109,9 +109,9 @@ protected: virtual void state_export(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 20; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 20; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -126,60 +126,60 @@ private: devcb_write_line m_rsi_func; // 64 bit, unpacked (one nibble per byte) -typedef UINT8 Saturn64[16]; +typedef uint8_t Saturn64[16]; Saturn64 m_reg[9]; //r0,r1,r2,r3,r4,a,b,c,d - UINT32 m_d[2], m_pc, m_oldpc, m_rstk[8]; // 20 bit, packed addresses + uint32_t m_d[2], m_pc, m_oldpc, m_rstk[8]; // 20 bit, packed addresses - UINT8 m_p; // 4 bit pointer + uint8_t m_p; // 4 bit pointer - UINT16 m_out; // 12 bit (packed) - UINT8 m_carry, m_decimal; - UINT16 m_st; // status 16 bit + uint16_t m_out; // 12 bit (packed) + uint8_t m_carry, m_decimal; + uint16_t m_st; // status 16 bit - UINT8 m_hst; // hardware status 4 bit + uint8_t m_hst; // hardware status 4 bit - UINT8 m_nmi_state; - UINT8 m_irq_state; - UINT8 m_irq_enable; /* INTON / INTOFF */ - UINT8 m_in_irq; /* already servicing IRQ */ - UINT8 m_pending_irq; /* IRQ is pending */ - UINT8 m_sleeping; /* low-consumption state */ + uint8_t m_nmi_state; + uint8_t m_irq_state; + uint8_t m_irq_enable; /* INTON / INTOFF */ + uint8_t m_in_irq; /* already servicing IRQ */ + uint8_t m_pending_irq; /* IRQ is pending */ + uint8_t m_sleeping; /* low-consumption state */ int m_monitor_id; int m_monitor_in; address_space *m_program; direct_read_data *m_direct; int m_icount; - INT64 m_debugger_temp; + int64_t m_debugger_temp; void saturn_take_irq(); - void IntReg64(Saturn64 r, INT64 d); - INT64 Reg64Int(Saturn64 r); + void IntReg64(Saturn64 r, int64_t d); + int64_t Reg64Int(Saturn64 r); inline int READ_OP(); inline int READ_OP_ARG(); inline int READ_OP_ARG8(); - inline INT8 READ_OP_DIS8(); + inline int8_t READ_OP_DIS8(); inline int READ_OP_ARG12(); inline int READ_OP_DIS12(); inline int READ_OP_ARG16(); - inline INT16 READ_OP_DIS16(); + inline int16_t READ_OP_DIS16(); inline int READ_OP_ARG20(); - inline int READ_NIBBLE(UINT32 adr); - inline int READ_8(UINT32 adr); - inline int READ_12(UINT32 adr); - inline int READ_16(UINT32 adr); - inline int READ_20(UINT32 adr); - inline void WRITE_NIBBLE(UINT32 adr, UINT8 nib); + inline int READ_NIBBLE(uint32_t adr); + inline int READ_8(uint32_t adr); + inline int READ_12(uint32_t adr); + inline int READ_16(uint32_t adr); + inline int READ_20(uint32_t adr); + inline void WRITE_NIBBLE(uint32_t adr, uint8_t nib); inline int S64_READ_X(int r); inline int S64_READ_WORD(int r); inline int S64_READ_A(int r); inline void S64_WRITE_X(int r, int v); inline void S64_WRITE_WORD(int r, int v); inline void S64_WRITE_A(int r, int v); - inline UINT32 saturn_pop(); - inline void saturn_push(UINT32 adr); + inline uint32_t saturn_pop(); + inline void saturn_push(uint32_t adr); inline void saturn_interrupt_on(); inline void saturn_interrupt_off(); inline void saturn_reset_interrupt(); @@ -258,7 +258,7 @@ typedef UINT8 Saturn64[16]; inline void saturn_exchange(int left, int begin, int count, int right); inline void saturn_copy(int dest, int begin, int count, int src); inline void saturn_add(int reg, int begin, int count, int right); - inline void saturn_add_const(int reg, int begin, int count, UINT8 right); + inline void saturn_add_const(int reg, int begin, int count, uint8_t right); inline void saturn_sub(int reg, int begin, int count, int right); inline void saturn_sub_const(int reg, int begin, int count, int right); inline void saturn_sub2(int reg, int begin, int count, int right); diff --git a/src/devices/cpu/saturn/saturnds.cpp b/src/devices/cpu/saturn/saturnds.cpp index 5b6adcf0c24..e41be2a2d7f 100644 --- a/src/devices/cpu/saturn/saturnds.cpp +++ b/src/devices/cpu/saturn/saturnds.cpp @@ -45,13 +45,13 @@ static const char *const adr_a[]= static const char number_2_hex[]= { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; -#define SATURN_PEEKOP_DIS8(v) v = (INT8)( oprom[pos] | ( oprom[pos+1] << 4 ) ); pos+= 2; +#define SATURN_PEEKOP_DIS8(v) v = (int8_t)( oprom[pos] | ( oprom[pos+1] << 4 ) ); pos+= 2; #define SATURN_PEEKOP_DIS12(v) v = oprom[pos] | ( oprom[pos+1] << 4 ) | ( oprom[pos+2] << 8 ); \ pos += 3; \ if ( v & 0x0800 ) v = -0x1000 + v; -#define SATURN_PEEKOP_DIS16(v) v = (INT16)( oprom[pos] | ( oprom[pos+1] << 4 ) | ( oprom[pos+2] << 8 ) | ( oprom[pos+3] << 12 ) ); pos += 4; +#define SATURN_PEEKOP_DIS16(v) v = (int16_t)( oprom[pos] | ( oprom[pos+1] << 4 ) | ( oprom[pos+2] << 8 ) | ( oprom[pos+3] << 12 ) ); pos += 4; #define SATURN_PEEKOP_ADR(v) v = oprom[pos] | ( oprom[pos+1] << 4 ) | ( oprom[pos+2] << 8 ) | ( oprom[pos+3] << 12 ) | ( oprom[pos+4] << 16 ); pos += 5; diff --git a/src/devices/cpu/sc61860/sc61860.cpp b/src/devices/cpu/sc61860/sc61860.cpp index 7491412d74d..e22bc422270 100644 --- a/src/devices/cpu/sc61860/sc61860.cpp +++ b/src/devices/cpu/sc61860/sc61860.cpp @@ -49,7 +49,7 @@ const device_type SC61860 = &device_creator; -sc61860_device::sc61860_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sc61860_device::sc61860_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SC61860, "SC61860", tag, owner, clock, "sc61860", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0) , m_reset(*this) @@ -64,14 +64,14 @@ sc61860_device::sc61860_device(const machine_config &mconfig, const char *tag, d } -offs_t sc61860_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t sc61860_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( sc61860 ); return CPU_DISASSEMBLE_NAME(sc61860)(this, buffer, pc, oprom, opram, options); } -UINT8 *sc61860_device::internal_ram() +uint8_t *sc61860_device::internal_ram() { return m_ram; } diff --git a/src/devices/cpu/sc61860/sc61860.h b/src/devices/cpu/sc61860/sc61860.h index 855d0d91e21..d8f993a60f4 100644 --- a/src/devices/cpu/sc61860/sc61860.h +++ b/src/devices/cpu/sc61860/sc61860.h @@ -72,7 +72,7 @@ class sc61860_device : public cpu_device { public: // construction/destruction - sc61860_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sc61860_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_reset_cb(device_t &device, _Object object) { return downcast(device).m_reset.set_callback(object); } @@ -85,7 +85,7 @@ public: template static devcb_base &set_outc_cb(device_t &device, _Object object) { return downcast(device).m_outc.set_callback(object); } /* this is though for power on/off of the sharps */ - UINT8 *internal_ram(); + uint8_t *internal_ram(); TIMER_CALLBACK_MEMBER(sc61860_2ms_tick); @@ -95,9 +95,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 2; } - virtual UINT32 execute_max_cycles() const override { return 4; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 2; } + virtual uint32_t execute_max_cycles() const override { return 4; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -109,9 +109,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -125,11 +125,11 @@ private: devcb_write8 m_outb; devcb_write8 m_outc; - UINT8 m_p, m_q, m_r; //7 bits only? + uint8_t m_p, m_q, m_r; //7 bits only? - UINT8 m_c; // port c, used for HLT. - UINT8 m_d, m_h; - UINT16 m_oldpc, m_pc, m_dp; + uint8_t m_c; // port c, used for HLT. + uint8_t m_d, m_h; + uint16_t m_oldpc, m_pc, m_dp; int m_carry, m_zero; @@ -138,23 +138,23 @@ private: address_space *m_program; direct_read_data *m_direct; int m_icount; - UINT8 m_ram[0x100]; // internal special ram, should be 0x60, 0x100 to avoid memory corruption for now - - UINT32 m_debugger_temp; - - inline UINT8 READ_OP(); - inline UINT8 READ_OP_ARG(); - inline UINT16 READ_OP_ARG_WORD(); - inline UINT8 READ_BYTE(UINT16 adr); - inline void WRITE_BYTE(UINT16 a, UINT8 v); - inline UINT8 READ_RAM(int r); - inline void WRITE_RAM(int r, UINT8 v); - inline void PUSH(UINT8 v); - inline UINT8 POP(); - inline void sc61860_load_imm(int r, UINT8 v); + uint8_t m_ram[0x100]; // internal special ram, should be 0x60, 0x100 to avoid memory corruption for now + + uint32_t m_debugger_temp; + + inline uint8_t READ_OP(); + inline uint8_t READ_OP_ARG(); + inline uint16_t READ_OP_ARG_WORD(); + inline uint8_t READ_BYTE(uint16_t adr); + inline void WRITE_BYTE(uint16_t a, uint8_t v); + inline uint8_t READ_RAM(int r); + inline void WRITE_RAM(int r, uint8_t v); + inline void PUSH(uint8_t v); + inline uint8_t POP(); + inline void sc61860_load_imm(int r, uint8_t v); inline void sc61860_load(); - inline void sc61860_load_imm_p(UINT8 v); - inline void sc61860_load_imm_q(UINT8 v); + inline void sc61860_load_imm_p(uint8_t v); + inline void sc61860_load_imm_q(uint8_t v); inline void sc61860_load_r(); inline void sc61860_load_ext(int r); inline void sc61860_load_dp(); @@ -164,11 +164,11 @@ private: inline void sc61860_store_r(); inline void sc61860_store_ext(int r); inline void sc61860_exam(int a, int b); - inline void sc61860_test(int reg, UINT8 value); + inline void sc61860_test(int reg, uint8_t value); inline void sc61860_test_ext(); - inline void sc61860_and(int reg, UINT8 value); + inline void sc61860_and(int reg, uint8_t value); inline void sc61860_and_ext(); - inline void sc61860_or(int reg, UINT8 value); + inline void sc61860_or(int reg, uint8_t value); inline void sc61860_or_ext(); inline void sc61860_rotate_right(); inline void sc61860_rotate_left(); @@ -177,18 +177,18 @@ private: inline void sc61860_inc_p(); inline void sc61860_dec(int reg); inline void sc61860_dec_p(); - inline void sc61860_add(int reg, UINT8 value); + inline void sc61860_add(int reg, uint8_t value); inline void sc61860_add_carry(); inline void sc61860_add_word(); - inline void sc61860_sub(int reg, UINT8 value); + inline void sc61860_sub(int reg, uint8_t value); inline void sc61860_sub_carry(); inline void sc61860_sub_word(); - inline void sc61860_cmp(int reg, UINT8 value); + inline void sc61860_cmp(int reg, uint8_t value); inline void sc61860_pop(); inline void sc61860_push(); inline void sc61860_prepare_table_call(); inline void sc61860_execute_table_call(); - inline void sc61860_call(UINT16 adr); + inline void sc61860_call(uint16_t adr); inline void sc61860_return(); inline void sc61860_jump(int yes); inline void sc61860_jump_rel_plus(int yes); diff --git a/src/devices/cpu/sc61860/scdasm.cpp b/src/devices/cpu/sc61860/scdasm.cpp index ad35c1f2f1b..c49ad9c77b4 100644 --- a/src/devices/cpu/sc61860/scdasm.cpp +++ b/src/devices/cpu/sc61860/scdasm.cpp @@ -154,10 +154,10 @@ static const struct { const char *mnemonic; Adr adr; } table[]={ CPU_DISASSEMBLE( sc61860 ) { - const UINT8 *base_oprom = oprom; + const uint8_t *base_oprom = oprom; int oper=*(oprom++); int t; - UINT16 adr; + uint16_t adr; switch(oper&0xc0) { case 0x80: diff --git a/src/devices/cpu/sc61860/scops.hxx b/src/devices/cpu/sc61860/scops.hxx index 7bc5b05c987..55c0d72d8ef 100644 --- a/src/devices/cpu/sc61860/scops.hxx +++ b/src/devices/cpu/sc61860/scops.hxx @@ -16,57 +16,57 @@ * *****************************************************************************/ -UINT8 sc61860_device::READ_OP() +uint8_t sc61860_device::READ_OP() { return m_direct->read_byte(m_pc++); } -UINT8 sc61860_device::READ_OP_ARG() +uint8_t sc61860_device::READ_OP_ARG() { return m_direct->read_byte(m_pc++); } -UINT16 sc61860_device::READ_OP_ARG_WORD() +uint16_t sc61860_device::READ_OP_ARG_WORD() { - UINT16 t=m_direct->read_byte(m_pc++)<<8; + uint16_t t=m_direct->read_byte(m_pc++)<<8; t|=m_direct->read_byte(m_pc++); return t; } -UINT8 sc61860_device::READ_BYTE(UINT16 adr) +uint8_t sc61860_device::READ_BYTE(uint16_t adr) { return m_program->read_byte(adr); } -void sc61860_device::WRITE_BYTE(UINT16 a, UINT8 v) +void sc61860_device::WRITE_BYTE(uint16_t a, uint8_t v) { m_program->write_byte(a, v); } -UINT8 sc61860_device::READ_RAM(int r) +uint8_t sc61860_device::READ_RAM(int r) { return m_ram[r]; } -void sc61860_device::WRITE_RAM(int r, UINT8 v) +void sc61860_device::WRITE_RAM(int r, uint8_t v) { m_ram[r] = v; } -void sc61860_device::PUSH(UINT8 v) +void sc61860_device::PUSH(uint8_t v) { m_r--; WRITE_RAM(m_r, v); } -UINT8 sc61860_device::POP() +uint8_t sc61860_device::POP() { - UINT8 t = READ_RAM(m_r); + uint8_t t = READ_RAM(m_r); m_r++; return t; } -void sc61860_device::sc61860_load_imm(int r, UINT8 v) +void sc61860_device::sc61860_load_imm(int r, uint8_t v) { WRITE_RAM(r, v); } @@ -76,12 +76,12 @@ void sc61860_device::sc61860_load() WRITE_RAM(A, READ_RAM(m_p)); } -void sc61860_device::sc61860_load_imm_p(UINT8 v) +void sc61860_device::sc61860_load_imm_p(uint8_t v) { m_p=v&0x7f; } -void sc61860_device::sc61860_load_imm_q(UINT8 v) +void sc61860_device::sc61860_load_imm_q(uint8_t v) { m_q=v&0x7f; } @@ -128,12 +128,12 @@ void sc61860_device::sc61860_store_ext(int r) void sc61860_device::sc61860_exam(int a, int b) { - UINT8 t = READ_RAM(a); + uint8_t t = READ_RAM(a); WRITE_RAM(a, READ_RAM(b)); WRITE_RAM(b, t); } -void sc61860_device::sc61860_test(int reg, UINT8 value) +void sc61860_device::sc61860_test(int reg, uint8_t value) { m_zero=(READ_RAM(reg) & value)==0; } @@ -143,30 +143,30 @@ void sc61860_device::sc61860_test_ext() m_zero=(READ_BYTE(m_dp)&READ_OP_ARG())==0; } -void sc61860_device::sc61860_and(int reg, UINT8 value) +void sc61860_device::sc61860_and(int reg, uint8_t value) { - UINT8 t = READ_RAM(reg) & value; + uint8_t t = READ_RAM(reg) & value; WRITE_RAM(reg, t); m_zero=t==0; } void sc61860_device::sc61860_and_ext() { - UINT8 t = READ_BYTE(m_dp) & READ_OP_ARG(); + uint8_t t = READ_BYTE(m_dp) & READ_OP_ARG(); m_zero=t==0; WRITE_BYTE(m_dp, t); } -void sc61860_device::sc61860_or(int reg, UINT8 value) +void sc61860_device::sc61860_or(int reg, uint8_t value) { - UINT8 t = READ_RAM(reg) | value; + uint8_t t = READ_RAM(reg) | value; WRITE_RAM(reg, t); m_zero=t==0; } void sc61860_device::sc61860_or_ext() { - UINT8 t=READ_BYTE(m_dp)|READ_OP_ARG(); + uint8_t t=READ_BYTE(m_dp)|READ_OP_ARG(); m_zero=t==0; WRITE_BYTE(m_dp, t); } @@ -196,7 +196,7 @@ void sc61860_device::sc61860_swap() // q=reg sideeffect void sc61860_device::sc61860_inc(int reg) { - UINT8 t = READ_RAM(reg) + 1; + uint8_t t = READ_RAM(reg) + 1; m_q=reg; WRITE_RAM(reg, t); m_zero=t==0; @@ -211,7 +211,7 @@ void sc61860_device::sc61860_inc_p() // q=reg sideeffect void sc61860_device::sc61860_dec(int reg) { - UINT8 t = READ_RAM(reg) - 1; + uint8_t t = READ_RAM(reg) - 1; m_q=reg; WRITE_RAM(reg, t); m_zero=t==0; @@ -223,7 +223,7 @@ void sc61860_device::sc61860_dec_p() m_p--; } -void sc61860_device::sc61860_add(int reg, UINT8 value) +void sc61860_device::sc61860_add(int reg, uint8_t value) { int t = READ_RAM(reg) + value; WRITE_RAM(reg, t); @@ -254,7 +254,7 @@ void sc61860_device::sc61860_add_word() } -void sc61860_device::sc61860_sub(int reg, UINT8 value) +void sc61860_device::sc61860_sub(int reg, uint8_t value) { int t = READ_RAM(reg) - value; WRITE_RAM(reg, t); @@ -285,7 +285,7 @@ void sc61860_device::sc61860_sub_word() m_carry=t2<0; } -void sc61860_device::sc61860_cmp(int reg, UINT8 value) +void sc61860_device::sc61860_cmp(int reg, uint8_t value) { int t = READ_RAM(reg) - value; m_zero=t==0; @@ -327,7 +327,7 @@ void sc61860_device::sc61860_execute_table_call() } -void sc61860_device::sc61860_call(UINT16 adr) +void sc61860_device::sc61860_call(uint16_t adr) { PUSH(m_pc>>8); PUSH(m_pc&0xff); @@ -336,14 +336,14 @@ void sc61860_device::sc61860_call(UINT16 adr) void sc61860_device::sc61860_return() { - UINT16 t=POP(); + uint16_t t=POP(); t|=POP()<<8; m_pc=t; } void sc61860_device::sc61860_jump(int yes) { - UINT16 adr = READ_OP_ARG_WORD(); + uint16_t adr = READ_OP_ARG_WORD(); if (yes) { m_pc=adr; } @@ -351,7 +351,7 @@ void sc61860_device::sc61860_jump(int yes) void sc61860_device::sc61860_jump_rel_plus(int yes) { - UINT16 adr = m_pc + READ_OP_ARG(); + uint16_t adr = m_pc + READ_OP_ARG(); if (yes) { m_pc=adr; m_icount-=3; @@ -360,7 +360,7 @@ void sc61860_device::sc61860_jump_rel_plus(int yes) void sc61860_device::sc61860_jump_rel_minus(int yes) { - UINT16 adr = m_pc - READ_OP_ARG(); + uint16_t adr = m_pc - READ_OP_ARG(); if (yes) { m_pc=adr; m_icount-=3; @@ -369,8 +369,8 @@ void sc61860_device::sc61860_jump_rel_minus(int yes) void sc61860_device::sc61860_loop() { - UINT16 adr = m_pc - READ_OP_ARG(); - UINT8 t = READ_RAM(m_r) - 1; + uint16_t adr = m_pc - READ_OP_ARG(); + uint8_t t = READ_RAM(m_r) - 1; WRITE_RAM(m_r, t); m_zero=t==0; m_carry=t==0xff; @@ -482,7 +482,7 @@ void sc61860_device::sc61860_test_special() // p-=I+1 sideeffect void sc61860_device::sc61860_add_bcd_a() { - UINT8 help = READ_RAM(A); + uint8_t help = READ_RAM(A); int i, hlp, hlp1 = 0; m_zero=1; for (i=0; i <= READ_RAM(I); i++) { @@ -529,7 +529,7 @@ void sc61860_device::sc61860_add_bcd() // p-=I+1 sideeffect void sc61860_device::sc61860_sub_bcd_a() { - UINT8 help = READ_RAM(A); + uint8_t help = READ_RAM(A); int i, hlp, hlp1 = 0; m_zero=1; for (i=0; i <= READ_RAM(I); i++) { @@ -601,8 +601,8 @@ void sc61860_device::sc61860_shift_right_nibble() // q=reg+1 sideeffect void sc61860_device::sc61860_inc_load_dp(int reg) { - UINT8 t = READ_RAM(reg) + 1; - UINT8 t2 = READ_RAM(reg + 1); + uint8_t t = READ_RAM(reg) + 1; + uint8_t t2 = READ_RAM(reg + 1); WRITE_RAM(reg, t); if (t == 0) { t2++; WRITE_RAM(reg + 1, t2); } m_dp=t|(t2<<8); @@ -612,8 +612,8 @@ void sc61860_device::sc61860_inc_load_dp(int reg) // q=reg+1 sideeffect void sc61860_device::sc61860_dec_load_dp(int reg) { - UINT8 t = READ_RAM(reg) - 1; - UINT8 t2 = READ_RAM(reg + 1); + uint8_t t = READ_RAM(reg) - 1; + uint8_t t2 = READ_RAM(reg + 1); WRITE_RAM(reg, t); if (t == 0xff) { t2--; WRITE_RAM(reg + 1, t2); } m_dp=t|(t2<<8); @@ -697,7 +697,7 @@ void sc61860_device::sc61860_copy_int(int count) { int i; for (i=0; i<=count; i++) { - UINT8 t = READ_BYTE((READ_RAM(A)|(READ_RAM(B)<<8))); /* internal rom! */ + uint8_t t = READ_BYTE((READ_RAM(A)|(READ_RAM(B)<<8))); /* internal rom! */ WRITE_RAM(m_p, t); m_p++; if (i!=count) { @@ -715,7 +715,7 @@ void sc61860_device::sc61860_copy_int(int count) void sc61860_device::sc61860_exchange(int count) { int i; - UINT8 t; + uint8_t t; for (i=0; i<=count; i++) { t = READ_RAM(m_p); WRITE_RAM(m_p, READ_RAM(m_q)); @@ -729,7 +729,7 @@ void sc61860_device::sc61860_exchange(int count) void sc61860_device::sc61860_exchange_ext(int count) { int i; - UINT8 t; + uint8_t t; for (i=0; i<=count; i++) { t = READ_RAM(m_p); WRITE_RAM(m_p, READ_BYTE(m_dp)); @@ -750,7 +750,7 @@ void sc61860_device::sc61860_wait_x(int level) if (!m_x.isnull()) { for (c=READ_RAM(I); c>=0; c--) { - UINT8 t = (READ_RAM(m_p)+1)&0x7f; + uint8_t t = (READ_RAM(m_p)+1)&0x7f; WRITE_RAM(m_p, t); m_zero=m_x(); m_icount-=4; diff --git a/src/devices/cpu/scmp/scmp.cpp b/src/devices/cpu/scmp/scmp.cpp index 2671dc9cf5a..04f7023ac62 100644 --- a/src/devices/cpu/scmp/scmp.cpp +++ b/src/devices/cpu/scmp/scmp.cpp @@ -21,7 +21,7 @@ const device_type SCMP = &device_creator; const device_type INS8060 = &device_creator; -scmp_device::scmp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scmp_device::scmp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SCMP, "INS 8050 SC/MP", tag, owner, clock, "ins8050", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0), m_AC(0), m_ER(0), m_SR(0), m_program(nullptr), m_direct(nullptr), m_icount(0) , m_flag_out_func(*this) @@ -34,7 +34,7 @@ scmp_device::scmp_device(const machine_config &mconfig, const char *tag, device_ } -scmp_device::scmp_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) +scmp_device::scmp_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0), m_AC(0), m_ER(0), m_SR(0), m_program(nullptr), m_direct(nullptr), m_icount(0) , m_flag_out_func(*this) @@ -47,52 +47,52 @@ scmp_device::scmp_device(const machine_config &mconfig, device_type type, const } -ins8060_device::ins8060_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ins8060_device::ins8060_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : scmp_device(mconfig, INS8060, "INS 8060 SC/MP II", tag, owner, clock, "ins8060", __FILE__) { } -offs_t scmp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t scmp_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( scmp ); return CPU_DISASSEMBLE_NAME(scmp)(this, buffer, pc, oprom, opram, options); } -UINT16 scmp_device::ADD12(UINT16 addr, INT8 val) +uint16_t scmp_device::ADD12(uint16_t addr, int8_t val) { return ((addr + val) & 0x0fff) | (addr & 0xf000); } -UINT8 scmp_device::ROP() +uint8_t scmp_device::ROP() { - UINT16 pc = m_PC.w.l; + uint16_t pc = m_PC.w.l; m_PC.w.l = ADD12(m_PC.w.l,1); return m_direct->read_byte( pc); } -UINT8 scmp_device::ARG() +uint8_t scmp_device::ARG() { - UINT16 pc = m_PC.w.l; + uint16_t pc = m_PC.w.l; m_PC.w.l = ADD12(m_PC.w.l,1); return m_direct->read_byte(pc); } -UINT8 scmp_device::RM(UINT32 a) +uint8_t scmp_device::RM(uint32_t a) { return m_program->read_byte(a); } -void scmp_device::WM(UINT32 a, UINT8 v) +void scmp_device::WM(uint32_t a, uint8_t v) { m_program->write_byte(a, v); } -void scmp_device::illegal(UINT8 opcode) +void scmp_device::illegal(uint8_t opcode) { #if VERBOSE - UINT16 pc = m_PC.w.l; + uint16_t pc = m_PC.w.l; LOG(("SC/MP illegal instruction %04X $%02X\n", pc-1, opcode)); #endif } @@ -108,10 +108,10 @@ PAIR *scmp_device::GET_PTR_REG(int num) } } -void scmp_device::BIN_ADD(UINT8 val) +void scmp_device::BIN_ADD(uint8_t val) { - UINT16 tmp = m_AC + val + ((m_SR >> 7) & 1); - UINT8 ov = (((m_AC & 0x80)==(val & 0x80)) && ((m_AC & 0x80)!=(tmp & 0x80))) ? 0x40 : 0x00; + uint16_t tmp = m_AC + val + ((m_SR >> 7) & 1); + uint8_t ov = (((m_AC & 0x80)==(val & 0x80)) && ((m_AC & 0x80)!=(tmp & 0x80))) ? 0x40 : 0x00; m_AC = tmp & 0xff; m_SR &= 0x3f; // clear CY/L and OV flag @@ -119,28 +119,28 @@ void scmp_device::BIN_ADD(UINT8 val) m_SR |= ov; } -void scmp_device::DEC_ADD(UINT8 val) +void scmp_device::DEC_ADD(uint8_t val) { - UINT16 tmp = m_AC + val + ((m_SR >> 7) & 1); + uint16_t tmp = m_AC + val + ((m_SR >> 7) & 1); if ((tmp & 0x0f) > 9) tmp +=6; m_AC = tmp % 0xa0; m_SR &= 0x7f; // clear CY/L flag m_SR |= (tmp > 0x99) ? 0x80 : 0x00; } -UINT16 scmp_device::GET_ADDR(UINT8 code) +uint16_t scmp_device::GET_ADDR(uint8_t code) { - UINT16 addr; - INT8 offset; - UINT16 retVal = 0; - UINT16 ptr = GET_PTR_REG(code & 0x03)->w.l; + uint16_t addr; + int8_t offset; + uint16_t retVal = 0; + uint16_t ptr = GET_PTR_REG(code & 0x03)->w.l; - UINT8 arg = ARG(); + uint8_t arg = ARG(); if (arg == 0x80) { offset = m_ER; } else { if (arg & 0x80) { - offset = (INT8)arg; + offset = (int8_t)arg; } else { offset = arg; } @@ -172,8 +172,8 @@ UINT16 scmp_device::GET_ADDR(UINT8 code) void scmp_device::execute_one(int opcode) { - UINT8 tmp; - UINT8 ptr = opcode & 3; + uint8_t tmp; + uint8_t ptr = opcode & 3; if (BIT(opcode,7)) { // two bytes instructions switch (opcode) @@ -231,7 +231,7 @@ void scmp_device::execute_one(int opcode) case 0xa8 : case 0xa9 : case 0xaa : case 0xab : // IDL { - UINT16 addr = GET_ADDR(opcode); + uint16_t addr = GET_ADDR(opcode); m_icount -= 22; m_AC = RM(addr) + 1; WM(addr,m_AC); @@ -240,7 +240,7 @@ void scmp_device::execute_one(int opcode) case 0xb8 : case 0xb9 : case 0xba : case 0xbb : // DLD { - UINT16 addr = GET_ADDR(opcode); + uint16_t addr = GET_ADDR(opcode); m_icount -= 22; m_AC = RM(addr) - 1; WM(addr,m_AC); @@ -278,14 +278,14 @@ void scmp_device::execute_one(int opcode) // Transfer Instructions case 0x90 : case 0x91 : case 0x92 : case 0x93 :// JMP m_icount -= 11; - m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(INT8)ARG()); + m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)ARG()); break; case 0x94 : case 0x95 : case 0x96 : case 0x97 : // JP m_icount -= 9; tmp = ARG(); if (!(m_AC & 0x80)) { - m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(INT8)tmp); + m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)tmp); m_icount -= 2; } break; @@ -294,7 +294,7 @@ void scmp_device::execute_one(int opcode) m_icount -= 9; tmp = ARG(); if (!m_AC) { - m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(INT8)tmp); + m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)tmp); m_icount -= 2; } break; @@ -303,14 +303,14 @@ void scmp_device::execute_one(int opcode) m_icount -= 9; tmp = ARG(); if (m_AC) { - m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(INT8)tmp); + m_PC.w.l = ADD12(GET_PTR_REG(ptr)->w.l,(int8_t)tmp); m_icount -= 2; } break; // Double-Byte Miscellaneous Instructions case 0x8f: // DLY tmp = ARG(); - m_icount -= 13 + (m_AC * 2) + (((UINT32)tmp) << 1) + (((UINT32)tmp) << 9); + m_icount -= 13 + (m_AC * 2) + (((uint32_t)tmp) << 1) + (((uint32_t)tmp) << 9); m_AC = 0xff; break; // Others are illegal @@ -374,7 +374,7 @@ void scmp_device::execute_one(int opcode) case 0x3c: case 0x3d :case 0x3e: case 0x3f: // XPPC { - UINT16 tmp16 = ADD12(m_PC.w.l,-1); // Since PC is incremented we need to fix it + uint16_t tmp16 = ADD12(m_PC.w.l,-1); // Since PC is incremented we need to fix it m_icount -= 7; m_PC.w.l = GET_PTR_REG(ptr)->w.l; GET_PTR_REG(ptr)->w.l = tmp16; @@ -459,7 +459,7 @@ void scmp_device::execute_one(int opcode) ***************************************************************************/ void scmp_device::take_interrupt() { - UINT16 tmp = ADD12(m_PC.w.l,-1); // We fix PC so at return it goes to current location + uint16_t tmp = ADD12(m_PC.w.l,-1); // We fix PC so at return it goes to current location m_SR &= 0xf7; // clear IE flag m_icount -= 8; // assumption diff --git a/src/devices/cpu/scmp/scmp.h b/src/devices/cpu/scmp/scmp.h index 11aec711060..5e115f778b1 100644 --- a/src/devices/cpu/scmp/scmp.h +++ b/src/devices/cpu/scmp/scmp.h @@ -27,8 +27,8 @@ class scmp_device : public cpu_device { public: // construction/destruction - scmp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - scmp_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); + scmp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + scmp_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_flag_out_cb(device_t &device, _Object object) { return downcast(device).m_flag_out_func.set_callback(object); } @@ -44,9 +44,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 5; } - virtual UINT32 execute_max_cycles() const override { return 131593; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 5; } + virtual uint32_t execute_max_cycles() const override { return 131593; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -56,9 +56,9 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -67,9 +67,9 @@ private: PAIR m_P1; PAIR m_P2; PAIR m_P3; - UINT8 m_AC; - UINT8 m_ER; - UINT8 m_SR; + uint8_t m_AC; + uint8_t m_ER; + uint8_t m_SR; address_space *m_program; direct_read_data *m_direct; @@ -82,16 +82,16 @@ private: devcb_read_line m_senseb_func; devcb_write_line m_halt_func; - inline UINT16 ADD12(UINT16 addr, INT8 val); - inline UINT8 ROP(); - inline UINT8 ARG(); - inline UINT8 RM(UINT32 a); - inline void WM(UINT32 a, UINT8 v); - inline void illegal(UINT8 opcode); + inline uint16_t ADD12(uint16_t addr, int8_t val); + inline uint8_t ROP(); + inline uint8_t ARG(); + inline uint8_t RM(uint32_t a); + inline void WM(uint32_t a, uint8_t v); + inline void illegal(uint8_t opcode); inline PAIR *GET_PTR_REG(int num); - inline void BIN_ADD(UINT8 val); - inline void DEC_ADD(UINT8 val); - inline UINT16 GET_ADDR(UINT8 code); + inline void BIN_ADD(uint8_t val); + inline void DEC_ADD(uint8_t val); + inline uint16_t GET_ADDR(uint8_t code); void execute_one(int opcode); void take_interrupt(); @@ -102,11 +102,11 @@ class ins8060_device : public scmp_device { public: // construction/destruction - ins8060_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ins8060_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 2 - 1) / 2; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 2); } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 2 - 1) / 2; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } }; diff --git a/src/devices/cpu/scmp/scmpdasm.cpp b/src/devices/cpu/scmp/scmpdasm.cpp index f8bcc491ce4..07ddec17e67 100644 --- a/src/devices/cpu/scmp/scmpdasm.cpp +++ b/src/devices/cpu/scmp/scmpdasm.cpp @@ -16,14 +16,14 @@ CPU_DISASSEMBLE( scmp ) { unsigned PC = pc; - UINT8 op = OP(pc++); - UINT8 ptr = op & 3; + uint8_t op = OP(pc++); + uint8_t ptr = op & 3; if (BIT(op,7)) { // two bytes instructions char as[10]; char aspr[10]; - UINT8 arg = ARG(pc); pc++; + uint8_t arg = ARG(pc); pc++; if (arg==0x80) { sprintf(as,"E"); } else { diff --git a/src/devices/cpu/score/score.cpp b/src/devices/cpu/score/score.cpp index f9ae1e5d291..cafaf73eaa0 100644 --- a/src/devices/cpu/score/score.cpp +++ b/src/devices/cpu/score/score.cpp @@ -52,7 +52,7 @@ const score7_cpu_device::op_handler score7_cpu_device::s_opcode16_table[8] = // score7_cpu_device - constructor //------------------------------------------------- -score7_cpu_device::score7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +score7_cpu_device::score7_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SCORE7, "S+core 7", tag, owner, clock, "score7", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0), m_pc(0), @@ -173,7 +173,7 @@ void score7_cpu_device::execute_run() check_irq(); - UINT32 op = fetch(); + uint32_t op = fetch(); switch(((op>>30) & 2) | ((op>>15) & 1)) { @@ -231,7 +231,7 @@ void score7_cpu_device::execute_set_input(int inputnum, int state) //************************************************************************** -bool score7_cpu_device::check_condition_branch(UINT8 bc) +bool score7_cpu_device::check_condition_branch(uint8_t bc) { if ((bc & 0x0f) == 14) // CNT>0, CNT-- { @@ -246,7 +246,7 @@ bool score7_cpu_device::check_condition_branch(UINT8 bc) return check_condition(bc); } -bool score7_cpu_device::check_condition(UINT8 bc) +bool score7_cpu_device::check_condition(uint8_t bc) { switch(bc & 0x0f) { @@ -271,44 +271,44 @@ bool score7_cpu_device::check_condition(UINT8 bc) return false; } -INT32 score7_cpu_device::sign_extend(UINT32 data, UINT8 len) +int32_t score7_cpu_device::sign_extend(uint32_t data, uint8_t len) { data &= (1 << len) - 1; - UINT32 sign = 1 << (len - 1); + uint32_t sign = 1 << (len - 1); return (data ^ sign) - sign; } -UINT32 score7_cpu_device::fetch() +uint32_t score7_cpu_device::fetch() { return m_direct->read_dword(m_pc & ~3); } -UINT8 score7_cpu_device::read_byte(offs_t offset) +uint8_t score7_cpu_device::read_byte(offs_t offset) { return m_program->read_byte(offset); } -UINT16 score7_cpu_device::read_word(offs_t offset) +uint16_t score7_cpu_device::read_word(offs_t offset) { return m_program->read_word(offset & ~1); } -UINT32 score7_cpu_device::read_dword(offs_t offset) +uint32_t score7_cpu_device::read_dword(offs_t offset) { return m_program->read_dword(offset & ~3); } -void score7_cpu_device::write_byte(offs_t offset, UINT8 data) +void score7_cpu_device::write_byte(offs_t offset, uint8_t data) { m_program->write_byte(offset, data); } -void score7_cpu_device::write_word(offs_t offset, UINT16 data) +void score7_cpu_device::write_word(offs_t offset, uint16_t data) { m_program->write_word(offset & ~1, data); } -void score7_cpu_device::write_dword(offs_t offset, UINT32 data) +void score7_cpu_device::write_dword(offs_t offset, uint32_t data) { m_program->write_dword(offset & ~3, data); } @@ -330,7 +330,7 @@ void score7_cpu_device::check_irq() } } -void score7_cpu_device::gen_exception(int cause, UINT32 param) +void score7_cpu_device::gen_exception(int cause, uint32_t param) { debugger_exception_hook(this, cause); @@ -376,11 +376,11 @@ void score7_cpu_device::gen_exception(int cause, UINT32 param) void score7_cpu_device::op_specialform() { - UINT8 ra = GET_S_RA(m_op); - UINT8 rb = GET_S_RB(m_op); - UINT8 rd = GET_S_RD(m_op); - UINT8 cu = GET_S_CU(m_op); - UINT32 r; + uint8_t ra = GET_S_RA(m_op); + uint8_t rb = GET_S_RB(m_op); + uint8_t rd = GET_S_RD(m_op); + uint8_t cu = GET_S_CU(m_op); + uint32_t r; switch(GET_S_FUNC6(m_op)) { @@ -599,18 +599,18 @@ void score7_cpu_device::op_specialform() break; case 0x20: // mul { - INT64 a = (INT32)m_gpr[ra]; - INT64 b = (INT32)m_gpr[rb]; - UINT64 d = a * b; + int64_t a = (int32_t)m_gpr[ra]; + int64_t b = (int32_t)m_gpr[rb]; + uint64_t d = a * b; REG_CEL = d & 0xffffffff; REG_CEH = (d >> 32) & 0xffffffff; break; } case 0x21: // mulu { - UINT64 a = (UINT32)m_gpr[ra]; - UINT64 b = (UINT32)m_gpr[rb]; - UINT64 d = a * b; + uint64_t a = (uint32_t)m_gpr[ra]; + uint64_t b = (uint32_t)m_gpr[rb]; + uint64_t d = a * b; REG_CEL = d & 0xffffffff; REG_CEH = (d >> 32) & 0xffffffff; break; @@ -618,8 +618,8 @@ void score7_cpu_device::op_specialform() case 0x22: // div if (m_gpr[rb]) { - INT32 a = (INT32)m_gpr[ra]; - INT32 b = (INT32)m_gpr[rb]; + int32_t a = (int32_t)m_gpr[ra]; + int32_t b = (int32_t)m_gpr[rb]; REG_CEL = a / b; REG_CEH = a % b; } @@ -631,8 +631,8 @@ void score7_cpu_device::op_specialform() case 0x23: // divu if (m_gpr[rb]) { - UINT32 a = (UINT32)m_gpr[ra]; - UINT32 b = (UINT32)m_gpr[rb]; + uint32_t a = (uint32_t)m_gpr[ra]; + uint32_t b = (uint32_t)m_gpr[rb]; REG_CEL = a / b; REG_CEH = a % b; } @@ -754,11 +754,11 @@ void score7_cpu_device::op_specialform() void score7_cpu_device::op_iform1() { - UINT8 rd = GET_I_RD(m_op); - UINT32 imm16 = GET_I_IMM16(m_op); - INT32 simm16 = sign_extend(imm16, 16); - UINT8 cu = GET_I_CU(m_op); - UINT32 r; + uint8_t rd = GET_I_RD(m_op); + uint32_t imm16 = GET_I_IMM16(m_op); + int32_t simm16 = sign_extend(imm16, 16); + uint8_t cu = GET_I_CU(m_op); + uint32_t r; switch(GET_I_FUNC3(m_op)) { @@ -768,8 +768,8 @@ void score7_cpu_device::op_iform1() { CHECK_Z(r); CHECK_N(r); - CHECK_V_ADD(m_gpr[rd], (UINT32)simm16, r); - CHECK_C_ADD(m_gpr[rd], (UINT32)simm16); + CHECK_V_ADD(m_gpr[rd], (uint32_t)simm16, r); + CHECK_C_ADD(m_gpr[rd], (uint32_t)simm16); } m_gpr[rd] = r; break; @@ -779,8 +779,8 @@ void score7_cpu_device::op_iform1() r = m_gpr[rd] - simm16; CHECK_Z(r); CHECK_N(r); - CHECK_V_SUB(m_gpr[rd], (UINT32)simm16, r); - CHECK_C_SUB(m_gpr[rd], (UINT32)simm16); + CHECK_V_SUB(m_gpr[rd], (uint32_t)simm16, r); + CHECK_C_SUB(m_gpr[rd], (uint32_t)simm16); } break; case 4: // andi @@ -817,8 +817,8 @@ void score7_cpu_device::op_jump() void score7_cpu_device::op_rixform1() { - UINT8 ra = GET_RIX_RA(m_op); - UINT8 rd = GET_RIX_RD(m_op); + uint8_t ra = GET_RIX_RA(m_op); + uint8_t rd = GET_RIX_RD(m_op); // pre-increment m_gpr[ra] += sign_extend(GET_RIX_IMM12(m_op), 12); @@ -856,7 +856,7 @@ void score7_cpu_device::op_branch() { if (check_condition_branch(GET_BC_BC(m_op))) { - INT32 disp = sign_extend(GET_BC_DISP19(m_op), 19) << 1; + int32_t disp = sign_extend(GET_BC_DISP19(m_op), 19) << 1; if (GET_BC_LK(m_op)) REG_LNK = m_pc; @@ -866,11 +866,11 @@ void score7_cpu_device::op_branch() void score7_cpu_device::op_iform2() { - UINT8 rd = GET_I_RD(m_op); - UINT32 imm16 = GET_I_IMM16(m_op) << 16; - INT32 simm16 = (INT32)imm16; - UINT8 cu = GET_I_CU(m_op); - UINT32 r; + uint8_t rd = GET_I_RD(m_op); + uint32_t imm16 = GET_I_IMM16(m_op) << 16; + int32_t simm16 = (int32_t)imm16; + uint8_t cu = GET_I_CU(m_op); + uint32_t r; switch(GET_I_FUNC3(m_op)) { @@ -925,8 +925,8 @@ void score7_cpu_device::op_crform() if ((REG_PSR & 0x08) && !(REG_PSR & 0x10000000)) return; - UINT8 cr = GET_CR_CR(m_op); - UINT8 rd = GET_CR_RD(m_op); + uint8_t cr = GET_CR_CR(m_op); + uint8_t rd = GET_CR_RD(m_op); switch(GET_CR_OP(m_op)) { @@ -951,8 +951,8 @@ void score7_cpu_device::op_crform() void score7_cpu_device::op_rixform2() { - UINT8 ra = GET_RIX_RA(m_op); - UINT8 rd = GET_RIX_RD(m_op); + uint8_t ra = GET_RIX_RA(m_op); + uint8_t rd = GET_RIX_RD(m_op); switch(GET_RIX_FUNC3(m_op)) { @@ -988,27 +988,27 @@ void score7_cpu_device::op_rixform2() void score7_cpu_device::op_addri() { - UINT8 ra = GET_RI_RA(m_op); - UINT8 rd = GET_RI_RD(m_op); - INT32 simm14 = sign_extend(GET_RI_IMM14(m_op), 14); - UINT8 cu = GET_RI_CU(m_op); + uint8_t ra = GET_RI_RA(m_op); + uint8_t rd = GET_RI_RD(m_op); + int32_t simm14 = sign_extend(GET_RI_IMM14(m_op), 14); + uint8_t cu = GET_RI_CU(m_op); - UINT32 r = m_gpr[ra] + simm14; + uint32_t r = m_gpr[ra] + simm14; if (cu) { CHECK_Z(r); CHECK_N(r); - CHECK_V_ADD(m_gpr[ra], (UINT32)simm14, r); - CHECK_C_ADD(m_gpr[ra], (UINT32)simm14); + CHECK_V_ADD(m_gpr[ra], (uint32_t)simm14, r); + CHECK_C_ADD(m_gpr[ra], (uint32_t)simm14); } m_gpr[rd] = r; } void score7_cpu_device::op_andri() { - UINT8 ra = GET_RI_RA(m_op); - UINT8 rd = GET_RI_RD(m_op); - UINT32 imm14 = GET_RI_IMM14(m_op); + uint8_t ra = GET_RI_RA(m_op); + uint8_t rd = GET_RI_RD(m_op); + uint32_t imm14 = GET_RI_IMM14(m_op); m_gpr[rd] = m_gpr[ra] & imm14; @@ -1021,9 +1021,9 @@ void score7_cpu_device::op_andri() void score7_cpu_device::op_orri() { - UINT8 ra = GET_RI_RA(m_op); - UINT8 rd = GET_RI_RD(m_op); - UINT32 imm14 = GET_RI_IMM14(m_op); + uint8_t ra = GET_RI_RA(m_op); + uint8_t rd = GET_RI_RD(m_op); + uint32_t imm14 = GET_RI_IMM14(m_op); m_gpr[rd] = m_gpr[ra] | imm14; @@ -1036,72 +1036,72 @@ void score7_cpu_device::op_orri() void score7_cpu_device::op_lw() { - UINT8 rd = GET_LS_RD(m_op); - UINT8 ra = GET_LS_RA(m_op); - INT32 simm15 = sign_extend(GET_LS_IMM15(m_op), 15); + uint8_t rd = GET_LS_RD(m_op); + uint8_t ra = GET_LS_RA(m_op); + int32_t simm15 = sign_extend(GET_LS_IMM15(m_op), 15); m_gpr[rd] = read_dword(m_gpr[ra] + simm15); } void score7_cpu_device::op_lh() { - UINT8 rd = GET_LS_RD(m_op); - UINT8 ra = GET_LS_RA(m_op); - INT32 simm15 = sign_extend(GET_LS_IMM15(m_op), 15); + uint8_t rd = GET_LS_RD(m_op); + uint8_t ra = GET_LS_RA(m_op); + int32_t simm15 = sign_extend(GET_LS_IMM15(m_op), 15); m_gpr[rd] = sign_extend(read_word(m_gpr[ra] + simm15), 16); } void score7_cpu_device::op_lhu() { - UINT8 rd = GET_LS_RD(m_op); - UINT8 ra = GET_LS_RA(m_op); - INT32 simm15 = sign_extend(GET_LS_IMM15(m_op), 15); + uint8_t rd = GET_LS_RD(m_op); + uint8_t ra = GET_LS_RA(m_op); + int32_t simm15 = sign_extend(GET_LS_IMM15(m_op), 15); m_gpr[rd] = read_word(m_gpr[ra] + simm15); } void score7_cpu_device::op_lb() { - UINT8 rd = GET_LS_RD(m_op); - UINT8 ra = GET_LS_RA(m_op); - INT32 simm15 = sign_extend(GET_LS_IMM15(m_op), 15); + uint8_t rd = GET_LS_RD(m_op); + uint8_t ra = GET_LS_RA(m_op); + int32_t simm15 = sign_extend(GET_LS_IMM15(m_op), 15); m_gpr[rd] = sign_extend(read_byte(m_gpr[ra] + simm15), 8); } void score7_cpu_device::op_sw() { - UINT8 rd = GET_LS_RD(m_op); - UINT8 ra = GET_LS_RA(m_op); - INT32 simm15 = sign_extend(GET_LS_IMM15(m_op), 15); + uint8_t rd = GET_LS_RD(m_op); + uint8_t ra = GET_LS_RA(m_op); + int32_t simm15 = sign_extend(GET_LS_IMM15(m_op), 15); write_dword(m_gpr[ra] + simm15, m_gpr[rd]); } void score7_cpu_device::op_sh() { - UINT8 rd = GET_LS_RD(m_op); - UINT8 ra = GET_LS_RA(m_op); - INT32 simm15 = sign_extend(GET_LS_IMM15(m_op), 15); + uint8_t rd = GET_LS_RD(m_op); + uint8_t ra = GET_LS_RA(m_op); + int32_t simm15 = sign_extend(GET_LS_IMM15(m_op), 15); write_word(m_gpr[ra] + simm15, m_gpr[rd] & 0xffff); } void score7_cpu_device::op_lbu() { - UINT8 rd = GET_LS_RD(m_op); - UINT8 ra = GET_LS_RA(m_op); - INT32 simm15 = sign_extend(GET_LS_IMM15(m_op), 15); + uint8_t rd = GET_LS_RD(m_op); + uint8_t ra = GET_LS_RA(m_op); + int32_t simm15 = sign_extend(GET_LS_IMM15(m_op), 15); m_gpr[rd] = read_byte(m_gpr[ra] + simm15); } void score7_cpu_device::op_sb() { - UINT8 rd = GET_LS_RD(m_op); - UINT8 ra = GET_LS_RA(m_op); - INT32 simm15 = sign_extend(GET_LS_IMM15(m_op), 15); + uint8_t rd = GET_LS_RD(m_op); + uint8_t ra = GET_LS_RA(m_op); + int32_t simm15 = sign_extend(GET_LS_IMM15(m_op), 15); write_byte(m_gpr[ra] + simm15, m_gpr[rd] & 0xff); } @@ -1123,8 +1123,8 @@ void score7_cpu_device::op_cenew() void score7_cpu_device::op_rform1() { - UINT8 rd = GET_R_RD(m_op); - UINT8 ra = GET_R_RA(m_op); + uint8_t rd = GET_R_RD(m_op); + uint8_t ra = GET_R_RA(m_op); switch(GET_R_FUNC4(m_op)) { @@ -1160,9 +1160,9 @@ void score7_cpu_device::op_rform1() void score7_cpu_device::op_rform2() { - UINT8 rd = GET_R_RD(m_op); - UINT8 ra = GET_R_RA(m_op); - UINT32 r; + uint8_t rd = GET_R_RD(m_op); + uint8_t ra = GET_R_RA(m_op); + uint32_t r; switch(GET_R_FUNC4(m_op)) { @@ -1266,8 +1266,8 @@ void score7_cpu_device::op_ldiu() void score7_cpu_device::op_iform1a() { - UINT8 rd = GET_I16_RD(m_op); - UINT8 imm5 = GET_I16_IMM5(m_op); + uint8_t rd = GET_I16_RD(m_op); + uint8_t imm5 = GET_I16_IMM5(m_op); switch(GET_I16_FUNC3(m_op)) { @@ -1308,8 +1308,8 @@ void score7_cpu_device::op_iform1a() void score7_cpu_device::op_iform1b() { - UINT8 rd = GET_I16_RD(m_op); - UINT16 imm5 = GET_I16_IMM5(m_op); + uint8_t rd = GET_I16_RD(m_op); + uint16_t imm5 = GET_I16_IMM5(m_op); switch(GET_I16_FUNC3(m_op)) { diff --git a/src/devices/cpu/score/score.h b/src/devices/cpu/score/score.h index ba7058196f8..be2456f3f59 100644 --- a/src/devices/cpu/score/score.h +++ b/src/devices/cpu/score/score.h @@ -33,16 +33,16 @@ class score7_cpu_device : public cpu_device { public: // construction/destruction - score7_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + score7_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 64; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 64; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -53,28 +53,28 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: // helpers - bool check_condition_branch(UINT8 bc); - bool check_condition(UINT8 bc); - INT32 sign_extend(UINT32 data, UINT8 len); - UINT32 fetch(); - UINT8 read_byte(offs_t offset); - UINT16 read_word(offs_t offset); - UINT32 read_dword(offs_t offset); - void write_byte(offs_t offset, UINT8 data); - void write_word(offs_t offset, UINT16 data); - void write_dword(offs_t offset, UINT32 data); + bool check_condition_branch(uint8_t bc); + bool check_condition(uint8_t bc); + int32_t sign_extend(uint32_t data, uint8_t len); + uint32_t fetch(); + uint8_t read_byte(offs_t offset); + uint16_t read_word(offs_t offset); + uint32_t read_dword(offs_t offset); + void write_byte(offs_t offset, uint8_t data); + void write_word(offs_t offset, uint16_t data); + void write_dword(offs_t offset, uint32_t data); void check_irq(); - void gen_exception(int cause, UINT32 param = 0); + void gen_exception(int cause, uint32_t param = 0); - offs_t disasm(char *buffer, offs_t pc, UINT32 opcode); - char *disasm32(char *buffer, offs_t pc, UINT32 opcode); - char *disasm16(char *buffer, offs_t pc, UINT16 opcode); + offs_t disasm(char *buffer, offs_t pc, uint32_t opcode); + char *disasm32(char *buffer, offs_t pc, uint32_t opcode); + char *disasm16(char *buffer, offs_t pc, uint16_t opcode); void unemulated_op(const char * op); // 32-bit opcodes @@ -117,13 +117,13 @@ private: // internal state int m_icount; - UINT32 m_pc; - UINT32 m_ppc; - UINT32 m_op; - UINT32 m_gpr[0x20]; - UINT32 m_cr[0x20]; - UINT32 m_sr[3]; - UINT32 m_ce[2]; + uint32_t m_pc; + uint32_t m_ppc; + uint32_t m_op; + uint32_t m_gpr[0x20]; + uint32_t m_cr[0x20]; + uint32_t m_sr[3]; + uint32_t m_ce[2]; bool m_pending_interrupt[64]; // opcodes tables diff --git a/src/devices/cpu/score/scoredsm.cpp b/src/devices/cpu/score/scoredsm.cpp index 9537278f883..0ca0ff77b5e 100644 --- a/src/devices/cpu/score/scoredsm.cpp +++ b/src/devices/cpu/score/scoredsm.cpp @@ -23,15 +23,15 @@ const char *const score7_cpu_device::m_i1b_op[8] = { "lwp", "lhp", "", "lbup", const char *const score7_cpu_device::m_cr_op[2] = { "mtcr", "mfcr" }; -char *score7_cpu_device::disasm32(char *buffer, offs_t pc, UINT32 opcode) +char *score7_cpu_device::disasm32(char *buffer, offs_t pc, uint32_t opcode) { switch((opcode >> 25) & 0x1f) { case 0x00: // Special-form { - UINT8 ra = GET_S_RA(opcode); - UINT8 rb = GET_S_RB(opcode); - UINT8 rd = GET_S_RD(opcode); + uint8_t ra = GET_S_RA(opcode); + uint8_t rb = GET_S_RB(opcode); + uint8_t rd = GET_S_RD(opcode); const char *cu = GET_S_CU(opcode) ? ".c": ""; const char *lk = GET_S_LK(opcode) ? "l": ""; @@ -180,14 +180,14 @@ char *score7_cpu_device::disasm32(char *buffer, offs_t pc, UINT32 opcode) return buffer; } -char *score7_cpu_device::disasm16(char *buffer, offs_t pc, UINT16 opcode) +char *score7_cpu_device::disasm16(char *buffer, offs_t pc, uint16_t opcode) { switch((opcode >> 12) & 0x07) { case 0x00: // R-form-1 { - UINT8 rd = GET_R_RD(opcode); - UINT8 ra = GET_R_RA(opcode); + uint8_t rd = GET_R_RD(opcode); + uint8_t ra = GET_R_RA(opcode); switch(GET_R_FUNC4(opcode)) { @@ -256,9 +256,9 @@ char *score7_cpu_device::disasm16(char *buffer, offs_t pc, UINT16 opcode) return buffer; } -offs_t score7_cpu_device::disasm(char *buffer, offs_t pc, UINT32 opcode) +offs_t score7_cpu_device::disasm(char *buffer, offs_t pc, uint32_t opcode) { - UINT8 p = (pc & 0x02) ? 0 : (((opcode>>30) & 2) | ((opcode>>15) & 1)); + uint8_t p = (pc & 0x02) ? 0 : (((opcode>>30) & 2) | ((opcode>>15) & 1)); switch(p) { @@ -286,9 +286,9 @@ offs_t score7_cpu_device::disasm(char *buffer, offs_t pc, UINT32 opcode) // helper function //------------------------------------------------- -offs_t score7_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t score7_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { - UINT32 opcode = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); + uint32_t opcode = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); return disasm(buffer, pc, opcode); } diff --git a/src/devices/cpu/score/scorem.h b/src/devices/cpu/score/scorem.h index 0f809e817fe..c9752d59ff8 100644 --- a/src/devices/cpu/score/scorem.h +++ b/src/devices/cpu/score/scorem.h @@ -91,11 +91,11 @@ #define SET_T(f) if (f) REG_CR |= FLAG_T; else REG_CR &= ~FLAG_T; #define CHECK_Z(r) SET_Z((r)==0) -#define CHECK_N(r) SET_N((INT32)(r) < 0) +#define CHECK_N(r) SET_N((int32_t)(r) < 0) #define CHECK_C_ADD(a,b) SET_C((a) > (0xffffffffu - (b))) #define CHECK_C_SUB(a,b) SET_C((a) >= (b)) -#define CHECK_V_ADD(a,b,d) SET_V((INT32)(((a) ^ (d)) & ((b) ^ (d))) < 0) -#define CHECK_V_SUB(a,b,d) SET_V((INT32)(((a) ^ (b)) & ((a) ^ (d))) < 0) +#define CHECK_V_ADD(a,b,d) SET_V((int32_t)(((a) ^ (d)) & ((b) ^ (d))) < 0) +#define CHECK_V_SUB(a,b,d) SET_V((int32_t)(((a) ^ (b)) & ((a) ^ (d))) < 0) // registers diff --git a/src/devices/cpu/scudsp/scudsp.cpp b/src/devices/cpu/scudsp/scudsp.cpp index d4e393c8ac3..24880437d21 100644 --- a/src/devices/cpu/scudsp/scudsp.cpp +++ b/src/devices/cpu/scudsp/scudsp.cpp @@ -128,7 +128,7 @@ const device_type SCUDSP = &device_creator; #define scudsp_readmem(A,MD) m_data->read_dword((A | (MD << 6)) << 2) #define scudsp_writemem(A,MD,B) m_data->write_dword((A | (MD << 6)) << 2, B) -UINT32 scudsp_cpu_device::scudsp_get_source_mem_reg_value( UINT32 mode ) +uint32_t scudsp_cpu_device::scudsp_get_source_mem_reg_value( uint32_t mode ) { if ( mode < 0x8 ) { @@ -139,17 +139,17 @@ UINT32 scudsp_cpu_device::scudsp_get_source_mem_reg_value( UINT32 mode ) switch( mode ) { case 0x9: - return (UINT32)((m_alu & U64(0x00000000ffffffff)) >> 0); + return (uint32_t)((m_alu & U64(0x00000000ffffffff)) >> 0); case 0xA: - return (UINT32)((m_alu & U64(0x0000ffffffff0000)) >> 16); + return (uint32_t)((m_alu & U64(0x0000ffffffff0000)) >> 16); } } return 0; } -UINT32 scudsp_cpu_device::scudsp_get_source_mem_value(UINT8 mode) +uint32_t scudsp_cpu_device::scudsp_get_source_mem_value(uint8_t mode) { - UINT32 value = 0; + uint32_t value = 0; switch( mode ) { @@ -186,7 +186,7 @@ UINT32 scudsp_cpu_device::scudsp_get_source_mem_value(UINT8 mode) return value; } -void scudsp_cpu_device::scudsp_set_dest_mem_reg( UINT32 mode, UINT32 value ) +void scudsp_cpu_device::scudsp_set_dest_mem_reg( uint32_t mode, uint32_t value ) { switch( mode ) { @@ -244,7 +244,7 @@ void scudsp_cpu_device::scudsp_set_dest_mem_reg( UINT32 mode, UINT32 value ) } } -void scudsp_cpu_device::scudsp_set_dest_mem_reg_2( UINT32 mode, UINT32 value ) +void scudsp_cpu_device::scudsp_set_dest_mem_reg_2( uint32_t mode, uint32_t value ) { if ( mode < 0xb ) { @@ -263,9 +263,9 @@ void scudsp_cpu_device::scudsp_set_dest_mem_reg_2( UINT32 mode, UINT32 value ) } } -UINT32 scudsp_cpu_device::scudsp_compute_condition( UINT32 condition ) +uint32_t scudsp_cpu_device::scudsp_compute_condition( uint32_t condition ) { - UINT32 result = 0; + uint32_t result = 0; switch( condition & 0xf ) { @@ -293,7 +293,7 @@ UINT32 scudsp_cpu_device::scudsp_compute_condition( UINT32 condition ) return result; } -void scudsp_cpu_device::scudsp_set_dest_dma_mem( UINT32 memcode, UINT32 value, UINT32 counter ) +void scudsp_cpu_device::scudsp_set_dest_dma_mem( uint32_t memcode, uint32_t value, uint32_t counter ) { if ( memcode < 4 ) { @@ -321,7 +321,7 @@ void scudsp_cpu_device::scudsp_set_dest_dma_mem( UINT32 memcode, UINT32 value, U } } -UINT32 scudsp_cpu_device::scudsp_get_mem_source_dma( UINT32 memcode, UINT32 counter ) +uint32_t scudsp_cpu_device::scudsp_get_mem_source_dma( uint32_t memcode, uint32_t counter ) { switch( memcode & 0x3 ) { @@ -345,7 +345,7 @@ READ32_MEMBER( scudsp_cpu_device::program_control_r ) WRITE32_MEMBER( scudsp_cpu_device::program_control_w ) { - UINT32 oldval, newval; + uint32_t oldval, newval; oldval = (m_flags & 0xffffff00) | (m_pc & 0xff); newval = oldval; @@ -382,7 +382,7 @@ WRITE32_MEMBER( scudsp_cpu_device::ram_address_control_w ) READ32_MEMBER( scudsp_cpu_device::ram_address_r ) { - UINT32 data; + uint32_t data; data = scudsp_get_source_mem_value( ((m_ra & 0xc0) >> 6) + 4 ); @@ -394,10 +394,10 @@ WRITE32_MEMBER( scudsp_cpu_device::ram_address_w ) scudsp_set_dest_mem_reg( (m_ra & 0xc0) >> 6, data ); } -void scudsp_cpu_device::scudsp_operation(UINT32 opcode) +void scudsp_cpu_device::scudsp_operation(uint32_t opcode) { - INT64 i1,i2; - INT32 i3; + int64_t i1,i2; + int32_t i3; int update_ct[4] = {0,0,0,0}; int dsp_mem; @@ -409,14 +409,14 @@ void scudsp_cpu_device::scudsp_operation(UINT32 opcode) break; case 0x1: /* AND */ i3 = m_acl.si & m_pl.si; - m_alu = (UINT64)(UINT32)i3; + m_alu = (uint64_t)(uint32_t)i3; SET_Z(i3 == 0); SET_C(0); SET_S(i3 < 0); break; case 0x2: /* OR */ i3 = m_acl.si | m_pl.si; - m_alu = (UINT64)(UINT32)i3; + m_alu = (uint64_t)(uint32_t)i3; SET_C(0); SET_S(i3 < 0); /* TODO: Croc and some early Psygnosis games wants Z to be 1 when the result of this one is negative. @@ -427,14 +427,14 @@ void scudsp_cpu_device::scudsp_operation(UINT32 opcode) break; case 0x3: /* XOR */ i3 = m_acl.si ^ m_pl.si; - m_alu = (UINT64)(UINT32)i3; + m_alu = (uint64_t)(uint32_t)i3; SET_Z(i3 == 0); SET_C(0); SET_S(i3 < 0); break; case 0x4: /* ADD */ i3 = m_acl.si + m_pl.si; - m_alu = (UINT64)(UINT32)i3; + m_alu = (uint64_t)(uint32_t)i3; //SET_Z(i3 == 0); SET_Z( (i3 & S64(0xffffffffffff)) == 0 ); //SET_S(i3 < 0); @@ -444,15 +444,15 @@ void scudsp_cpu_device::scudsp_operation(UINT32 opcode) break; case 0x5: /* SUB */ i3 = m_acl.si - m_pl.si; - m_alu = (UINT64)(UINT32)i3; + m_alu = (uint64_t)(uint32_t)i3; SET_Z(i3 == 0); SET_C(i3 & S64(0x100000000)); SET_S(i3 < 0); SET_V(((m_pl.si) ^ (m_acl.si)) & ((m_pl.si) ^ (i3)) & 0x80000000); break; case 0x6: /* AD2 */ - i1 = concat_64((INT32)m_ph.si,m_pl.si); - i2 = concat_64((INT32)m_ach.si,m_acl.si); + i1 = concat_64((int32_t)m_ph.si,m_pl.si); + i2 = concat_64((int32_t)m_ach.si,m_acl.si); m_alu = i1 + i2; SET_Z((m_alu & S64(0xffffffffffff)) == 0); SET_S((m_alu & S64(0x800000000000)) > 0); @@ -464,28 +464,28 @@ void scudsp_cpu_device::scudsp_operation(UINT32 opcode) break; case 0x8: /* SR */ i3 = (m_acl.si >> 1) | (m_acl.si & 0x80000000);/*MSB does not change*/ - m_alu = (UINT64)(UINT32)i3; + m_alu = (uint64_t)(uint32_t)i3; SET_Z(i3 == 0); SET_S(i3 < 0); SET_C(m_acl.ui & 0x80000000); break; case 0x9: /* RR */ i3 = ((m_acl.ui >> 1) & 0x7fffffff) | ((m_acl.ui << 31) & 0x80000000); - m_alu = (UINT64)(UINT32)i3; + m_alu = (uint64_t)(uint32_t)i3; SET_Z( i3 == 0 ); SET_S( i3 < 0 ); SET_C( m_acl.ui & 0x1 ); break; case 0xa: /* SL */ i3 = m_acl.si << 1; - m_alu = (UINT64)(UINT32)i3; + m_alu = (uint64_t)(uint32_t)i3; SET_Z( i3 == 0 ); SET_S( i3 < 0 ); SET_C( m_acl.ui & 0x80000000 ); break; case 0xB: /* RL */ i3 = ((m_acl.si << 1) & 0xfffffffe) | ((m_acl.si >> 31) & 0x1); - m_alu = (UINT64)(UINT32)i3; + m_alu = (uint64_t)(uint32_t)i3; SET_Z( i3 == 0 ); SET_S( i3 < 0 ); SET_C( m_acl.ui & 0x80000000 ); @@ -523,8 +523,8 @@ void scudsp_cpu_device::scudsp_operation(UINT32 opcode) case 0x1: /* NOP ? */ break; case 0x2: /* MOV MUL,P */ - m_ph.ui = (UINT16)((m_mul & U64(0x0000ffff00000000)) >> 32); - m_pl.ui = (UINT32)((m_mul & U64(0x00000000ffffffff)) >> 0); + m_ph.ui = (uint16_t)((m_mul & U64(0x0000ffff00000000)) >> 32); + m_pl.ui = (uint32_t)((m_mul & U64(0x00000000ffffffff)) >> 0); break; case 0x3: /* MOV [s],P */ dsp_mem = (opcode & 0x700000) >> 20; @@ -560,8 +560,8 @@ void scudsp_cpu_device::scudsp_operation(UINT32 opcode) m_ach.ui = 0; break; case 0x2: /* MOV ALU,A */ - m_ach.ui = (UINT16)((m_alu & U64(0x0000ffff00000000)) >> 32); - m_acl.ui = (UINT32)((m_alu & U64(0x00000000ffffffff)) >> 0); + m_ach.ui = (uint16_t)((m_alu & U64(0x0000ffff00000000)) >> 32); + m_acl.ui = (uint32_t)((m_alu & U64(0x00000000ffffffff)) >> 0); break; case 0x3: /* MOV [s], A */ dsp_mem = (opcode & 0x1C000 ) >> 14; @@ -588,7 +588,7 @@ void scudsp_cpu_device::scudsp_operation(UINT32 opcode) case 0x0: /* NOP */ break; case 0x1: /* MOV SImm,[d] */ - scudsp_set_dest_mem_reg( (opcode & 0xf00) >> 8, (INT32)(INT8)(opcode & 0xff) ); + scudsp_set_dest_mem_reg( (opcode & 0xf00) >> 8, (int32_t)(int8_t)(opcode & 0xff) ); break; case 0x2: /* ??? */ @@ -601,9 +601,9 @@ void scudsp_cpu_device::scudsp_operation(UINT32 opcode) m_icount -= 1; } -void scudsp_cpu_device::scudsp_move_immediate( UINT32 opcode ) +void scudsp_cpu_device::scudsp_move_immediate( uint32_t opcode ) { - UINT32 value; + uint32_t value; if ( opcode & 0x2000000 ) { @@ -623,12 +623,12 @@ void scudsp_cpu_device::scudsp_move_immediate( UINT32 opcode ) m_icount -= 1; } -void scudsp_cpu_device::scudsp_dma( UINT32 opcode ) +void scudsp_cpu_device::scudsp_dma( uint32_t opcode ) { - UINT8 hold = (opcode & 0x4000) >> 14; - UINT32 add = (opcode & 0x38000) >> 15; - UINT32 dir_from_D0 = (opcode & 0x1000 ) >> 12; - UINT32 dsp_mem = (opcode & 0x300) >> 8; + uint8_t hold = (opcode & 0x4000) >> 14; + uint32_t add = (opcode & 0x38000) >> 15; + uint32_t dir_from_D0 = (opcode & 0x1000 ) >> 12; + uint32_t dsp_mem = (opcode & 0x300) >> 8; T0F_1; @@ -676,7 +676,7 @@ void scudsp_cpu_device::scudsp_dma( UINT32 opcode ) /* HACK ALERT: It looks like that scheduling craps out the m_dma parameters, why this happens I don't know ... */ #if INSTA_DMA { - UINT32 data; + uint32_t data; if ( m_dma.dir == 0 ) { for(m_dma.count = 0;m_dma.count < m_dma.size; m_dma.count++) @@ -726,7 +726,7 @@ void scudsp_cpu_device::scudsp_dma( UINT32 opcode ) m_icount -= 1; } -void scudsp_cpu_device::scudsp_jump( UINT32 opcode ) +void scudsp_cpu_device::scudsp_jump( uint32_t opcode ) { if ( opcode & 0x3f80000 ) { @@ -745,7 +745,7 @@ void scudsp_cpu_device::scudsp_jump( UINT32 opcode ) m_icount -= 1; } -void scudsp_cpu_device::scudsp_loop(UINT32 opcode) +void scudsp_cpu_device::scudsp_loop(uint32_t opcode) { if ( opcode & 0x8000000 ) { @@ -770,7 +770,7 @@ void scudsp_cpu_device::scudsp_loop(UINT32 opcode) m_icount -= 1; } -void scudsp_cpu_device::scudsp_end(UINT32 opcode) +void scudsp_cpu_device::scudsp_end(uint32_t opcode) { if(opcode & 0x08000000) { @@ -784,7 +784,7 @@ void scudsp_cpu_device::scudsp_end(UINT32 opcode) m_icount -= 1; } -void scudsp_cpu_device::scudsp_illegal(UINT32 opcode) +void scudsp_cpu_device::scudsp_illegal(uint32_t opcode) { fatalerror("scudsp illegal opcode at 0x%04x\n", m_pc); m_icount -= 1; @@ -792,7 +792,7 @@ void scudsp_cpu_device::scudsp_illegal(UINT32 opcode) void scudsp_cpu_device::scudsp_exec_dma() { - UINT32 data; + uint32_t data; if ( m_dma.dir == 0 ) { data = (m_in_dma_cb(m_dma.src)<<16) | m_in_dma_cb(m_dma.src+2); @@ -833,7 +833,7 @@ void scudsp_cpu_device::scudsp_exec_dma() /* Execute cycles */ void scudsp_cpu_device::execute_run() { - UINT32 opcode; + uint32_t opcode; do { @@ -884,7 +884,7 @@ void scudsp_cpu_device::execute_run() if ( m_update_mul == 1 ) { - m_mul = (INT64)m_rx.si * (INT64)m_ry.si; + m_mul = (int64_t)m_rx.si * (int64_t)m_ry.si; m_update_mul = 0; } @@ -1000,7 +1000,7 @@ void scudsp_cpu_device::execute_set_input(int irqline, int state) } } -scudsp_cpu_device::scudsp_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scudsp_cpu_device::scudsp_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SCUDSP, "SCUDSP", tag, owner, clock, "scudsp", __FILE__) , m_out_irq_cb(*this) , m_in_dma_cb(*this) @@ -1033,7 +1033,7 @@ void scudsp_cpu_device::state_string_export(const device_state_entry &entry, std } -offs_t scudsp_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t scudsp_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( scudsp ); return CPU_DISASSEMBLE_NAME(scudsp)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/scudsp/scudsp.h b/src/devices/cpu/scudsp/scudsp.h index a5827b05e41..423cf1df2f0 100644 --- a/src/devices/cpu/scudsp/scudsp.h +++ b/src/devices/cpu/scudsp/scudsp.h @@ -49,20 +49,20 @@ enum #define SCUDSP_RESET INPUT_LINE_RESET /* Non-Maskable */ union SCUDSPREG32 { - INT32 si; - UINT32 ui; + int32_t si; + uint32_t ui; }; union SCUDSPREG16 { - INT16 si; - UINT16 ui; + int16_t si; + uint16_t ui; }; class scudsp_cpu_device : public cpu_device { public: // construction/destruction - scudsp_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + scudsp_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); template static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_cb.set_callback(object); } template static devcb_base &set_in_dma_callback(device_t &device, _Object object) { return downcast(device).m_in_dma_cb.set_callback(object); } @@ -86,9 +86,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 7; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 7; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -99,9 +99,9 @@ protected: void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; devcb_write_line m_out_irq_cb; devcb_read16 m_in_dma_cb; @@ -111,47 +111,47 @@ private: address_space_config m_program_config; address_space_config m_data_config; - UINT8 m_pc; /* registers */ - UINT32 m_flags; /* flags */ - UINT8 m_ra; - UINT8 m_ct0,m_ct1,m_ct2,m_ct3; - UINT8 m_delay; /* Delay */ - UINT8 m_top; /*Jump Command memory*/ - UINT16 m_lop; /*Counter Register*/ /*12-bits*/ + uint8_t m_pc; /* registers */ + uint32_t m_flags; /* flags */ + uint8_t m_ra; + uint8_t m_ct0,m_ct1,m_ct2,m_ct3; + uint8_t m_delay; /* Delay */ + uint8_t m_top; /*Jump Command memory*/ + uint16_t m_lop; /*Counter Register*/ /*12-bits*/ SCUDSPREG32 m_rx; /*X-Bus register*/ - INT64 m_mul; /*Multiplier register*//*48-bits*/ + int64_t m_mul; /*Multiplier register*//*48-bits*/ SCUDSPREG32 m_ry; /*Y-Bus register*/ - INT64 m_alu; /*ALU register*/ /*48-bits*/ + int64_t m_alu; /*ALU register*/ /*48-bits*/ SCUDSPREG16 m_ph; /*ALU high register*/ SCUDSPREG32 m_pl; /*ALU low register*/ SCUDSPREG16 m_ach; /*ALU external high register*/ SCUDSPREG32 m_acl; /*ALU external low register*/ - UINT32 m_ra0,m_wa0; /*DSP DMA registers*/ + uint32_t m_ra0,m_wa0; /*DSP DMA registers*/ struct{ - UINT32 src, dst; - UINT16 add; - UINT16 size, update, ex, dir, count; + uint32_t src, dst; + uint16_t add; + uint16_t size, update, ex, dir, count; }m_dma; address_space *m_program; address_space *m_data; int m_icount; - UINT8 m_update_mul; - - UINT32 scudsp_get_source_mem_reg_value( UINT32 mode ); - UINT32 scudsp_get_source_mem_value(UINT8 mode); - void scudsp_set_dest_mem_reg( UINT32 mode, UINT32 value ); - void scudsp_set_dest_mem_reg_2( UINT32 mode, UINT32 value ); - UINT32 scudsp_compute_condition( UINT32 condition ); - UINT32 scudsp_get_mem_source_dma( UINT32 memcode, UINT32 counter ); - void scudsp_set_dest_dma_mem( UINT32 memcode, UINT32 value, UINT32 counter ); - - void scudsp_illegal(UINT32 opcode); - void scudsp_operation(UINT32 opcode); - void scudsp_move_immediate(UINT32 opcode); - void scudsp_dma(UINT32 opcode); - void scudsp_jump(UINT32 opcode); - void scudsp_loop(UINT32 opcode); - void scudsp_end(UINT32 opcode); + uint8_t m_update_mul; + + uint32_t scudsp_get_source_mem_reg_value( uint32_t mode ); + uint32_t scudsp_get_source_mem_value(uint8_t mode); + void scudsp_set_dest_mem_reg( uint32_t mode, uint32_t value ); + void scudsp_set_dest_mem_reg_2( uint32_t mode, uint32_t value ); + uint32_t scudsp_compute_condition( uint32_t condition ); + uint32_t scudsp_get_mem_source_dma( uint32_t memcode, uint32_t counter ); + void scudsp_set_dest_dma_mem( uint32_t memcode, uint32_t value, uint32_t counter ); + + void scudsp_illegal(uint32_t opcode); + void scudsp_operation(uint32_t opcode); + void scudsp_move_immediate(uint32_t opcode); + void scudsp_dma(uint32_t opcode); + void scudsp_jump(uint32_t opcode); + void scudsp_loop(uint32_t opcode); + void scudsp_end(uint32_t opcode); void scudsp_exec_dma(); }; diff --git a/src/devices/cpu/scudsp/scudspdasm.cpp b/src/devices/cpu/scudsp/scudspdasm.cpp index d5e79a2cbd7..007e55f6e67 100644 --- a/src/devices/cpu/scudsp/scudspdasm.cpp +++ b/src/devices/cpu/scudsp/scudspdasm.cpp @@ -135,7 +135,7 @@ static const char *const DMA_Command[] = }; -static void scudsp_dasm_prefix( const char* format, char* buffer, UINT32 *data ) +static void scudsp_dasm_prefix( const char* format, char* buffer, uint32_t *data ) { for ( ; *format; format++ ) { @@ -239,12 +239,12 @@ static void scudsp_dasm_prefix( const char* format, char* buffer, UINT32 *data ) CPU_DISASSEMBLE( scudsp ) { - UINT32 op = oprom[0]<<24|oprom[1]<<16|oprom[2]<<8|oprom[3]<<0; + uint32_t op = oprom[0]<<24|oprom[1]<<16|oprom[2]<<8|oprom[3]<<0; unsigned size = 1; // const char *sym, *sym2; char *my_buffer = buffer; char temp_buffer[64]; - UINT32 data[4]; + uint32_t data[4]; switch( op >> 30 ) { diff --git a/src/devices/cpu/se3208/se3208.cpp b/src/devices/cpu/se3208/se3208.cpp index 8889d1def61..aea03b94669 100644 --- a/src/devices/cpu/se3208/se3208.cpp +++ b/src/devices/cpu/se3208/se3208.cpp @@ -36,7 +36,7 @@ #define SEX(bits,val) ((val)&(1<<(bits-1))?((val)|(~((1<; -se3208_device::se3208_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +se3208_device::se3208_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SE3208, "SE3208", tag, owner, clock, "se3208", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0), m_PC(0), m_SR(0), m_SP(0), m_ER(0), m_PPC(0), m_program(nullptr), m_direct(nullptr), m_IRQ(0), m_NMI(0), m_icount(0) { } -UINT32 se3208_device::read_dword_unaligned(address_space &space, UINT32 address) +uint32_t se3208_device::read_dword_unaligned(address_space &space, uint32_t address) { if (DWORD_ALIGNED(address)) return space.read_dword(address); @@ -67,7 +67,7 @@ UINT32 se3208_device::read_dword_unaligned(address_space &space, UINT32 address) } } -UINT16 se3208_device::read_word_unaligned(address_space &space, UINT32 address) +uint16_t se3208_device::read_word_unaligned(address_space &space, uint32_t address) { if (!WORD_ALIGNED(address)) return space.read_byte(address) | space.read_byte(address+1)<<8; @@ -75,7 +75,7 @@ UINT16 se3208_device::read_word_unaligned(address_space &space, UINT32 address) return space.read_word(address); } -void se3208_device::write_dword_unaligned(address_space &space, UINT32 address, UINT32 data) +void se3208_device::write_dword_unaligned(address_space &space, uint32_t address, uint32_t data) { if (DWORD_ALIGNED(address)) space.write_dword(address, data); @@ -92,7 +92,7 @@ void se3208_device::write_dword_unaligned(address_space &space, UINT32 address, } -void se3208_device::write_word_unaligned(address_space &space, UINT32 address, UINT16 data) +void se3208_device::write_word_unaligned(address_space &space, uint32_t address, uint16_t data) { if (!WORD_ALIGNED(address)) { @@ -106,41 +106,41 @@ void se3208_device::write_word_unaligned(address_space &space, UINT32 address, U } -UINT8 se3208_device::SE3208_Read8(UINT32 addr) +uint8_t se3208_device::SE3208_Read8(uint32_t addr) { return m_program->read_byte(addr); } -UINT16 se3208_device::SE3208_Read16(UINT32 addr) +uint16_t se3208_device::SE3208_Read16(uint32_t addr) { return read_word_unaligned(*m_program,addr); } -UINT32 se3208_device::SE3208_Read32(UINT32 addr) +uint32_t se3208_device::SE3208_Read32(uint32_t addr) { return read_dword_unaligned(*m_program,addr); } -void se3208_device::SE3208_Write8(UINT32 addr,UINT8 val) +void se3208_device::SE3208_Write8(uint32_t addr,uint8_t val) { m_program->write_byte(addr,val); } -void se3208_device::SE3208_Write16(UINT32 addr,UINT16 val) +void se3208_device::SE3208_Write16(uint32_t addr,uint16_t val) { write_word_unaligned(*m_program,addr,val); } -void se3208_device::SE3208_Write32(UINT32 addr,UINT32 val) +void se3208_device::SE3208_Write32(uint32_t addr,uint32_t val) { write_dword_unaligned(*m_program,addr,val); } -UINT32 se3208_device::AddWithFlags(UINT32 a,UINT32 b) +uint32_t se3208_device::AddWithFlags(uint32_t a,uint32_t b) { - UINT32 r=a+b; + uint32_t r=a+b; CLRFLAG(FLAG_Z|FLAG_C|FLAG_V|FLAG_S); if(!r) SETFLAG(FLAG_Z); @@ -153,9 +153,9 @@ UINT32 se3208_device::AddWithFlags(UINT32 a,UINT32 b) return r; } -UINT32 se3208_device::SubWithFlags(UINT32 a,UINT32 b) //a-b +uint32_t se3208_device::SubWithFlags(uint32_t a,uint32_t b) //a-b { - UINT32 r=a-b; + uint32_t r=a-b; CLRFLAG(FLAG_Z|FLAG_C|FLAG_V|FLAG_S); if(!r) SETFLAG(FLAG_Z); @@ -168,10 +168,10 @@ UINT32 se3208_device::SubWithFlags(UINT32 a,UINT32 b) //a-b return r; } -UINT32 se3208_device::AdcWithFlags(UINT32 a,UINT32 b) +uint32_t se3208_device::AdcWithFlags(uint32_t a,uint32_t b) { - UINT32 C=(m_SR&FLAG_C)?1:0; - UINT32 r=a+b+C; + uint32_t C=(m_SR&FLAG_C)?1:0; + uint32_t r=a+b+C; CLRFLAG(FLAG_Z|FLAG_C|FLAG_V|FLAG_S); if(!r) SETFLAG(FLAG_Z); @@ -185,10 +185,10 @@ UINT32 se3208_device::AdcWithFlags(UINT32 a,UINT32 b) } -UINT32 se3208_device::SbcWithFlags(UINT32 a,UINT32 b) +uint32_t se3208_device::SbcWithFlags(uint32_t a,uint32_t b) { - UINT32 C=(m_SR&FLAG_C)?1:0; - UINT32 r=a-b-C; + uint32_t C=(m_SR&FLAG_C)?1:0; + uint32_t r=a-b-C; CLRFLAG(FLAG_Z|FLAG_C|FLAG_V|FLAG_S); if(!r) SETFLAG(FLAG_Z); @@ -201,21 +201,21 @@ UINT32 se3208_device::SbcWithFlags(UINT32 a,UINT32 b) return r; } -UINT32 se3208_device::MulWithFlags(UINT32 a,UINT32 b) +uint32_t se3208_device::MulWithFlags(uint32_t a,uint32_t b) { - INT64 r=(INT64) a*(INT64) b; + int64_t r=(int64_t) a*(int64_t) b; CLRFLAG(FLAG_V); if(r>>32) SETFLAG(FLAG_V); - return (UINT32) (r&0xffffffff); + return (uint32_t) (r&0xffffffff); } -UINT32 se3208_device::NegWithFlags(UINT32 a) +uint32_t se3208_device::NegWithFlags(uint32_t a) { return SubWithFlags(0,a); } -UINT32 se3208_device::AsrWithFlags(UINT32 Val, UINT8 By) +uint32_t se3208_device::AsrWithFlags(uint32_t Val, uint8_t By) { signed int v=(signed int) Val; v>>=By; @@ -226,12 +226,12 @@ UINT32 se3208_device::AsrWithFlags(UINT32 Val, UINT8 By) SETFLAG(FLAG_S); if(Val&(1<<(By-1))) SETFLAG(FLAG_C); - return (UINT32) v; + return (uint32_t) v; } -UINT32 se3208_device::LsrWithFlags(UINT32 Val, UINT8 By) +uint32_t se3208_device::LsrWithFlags(uint32_t Val, uint8_t By) { - UINT32 v=Val; + uint32_t v=Val; v>>=By; CLRFLAG(FLAG_Z|FLAG_C|FLAG_V|FLAG_S); if(!v) @@ -243,9 +243,9 @@ UINT32 se3208_device::LsrWithFlags(UINT32 Val, UINT8 By) return v; } -UINT32 se3208_device::AslWithFlags(UINT32 Val, UINT8 By) +uint32_t se3208_device::AslWithFlags(uint32_t Val, uint8_t By) { - UINT32 v=Val; + uint32_t v=Val; v<<=By; CLRFLAG(FLAG_Z|FLAG_C|FLAG_V|FLAG_S); if(!v) @@ -265,10 +265,10 @@ INST(INVALIDOP) INST(LDB) { - UINT32 Offset=EXTRACT(Opcode,0,4); - UINT32 Index=EXTRACT(Opcode,5,7); - UINT32 SrcDst=EXTRACT(Opcode,8,10); - UINT32 Val; + uint32_t Offset=EXTRACT(Opcode,0,4); + uint32_t Index=EXTRACT(Opcode,5,7); + uint32_t SrcDst=EXTRACT(Opcode,8,10); + uint32_t Val; if(Index) Index=m_R[Index]; @@ -286,9 +286,9 @@ INST(LDB) INST(STB) { - UINT32 Offset=EXTRACT(Opcode,0,4); - UINT32 Index=EXTRACT(Opcode,5,7); - UINT32 SrcDst=EXTRACT(Opcode,8,10); + uint32_t Offset=EXTRACT(Opcode,0,4); + uint32_t Index=EXTRACT(Opcode,5,7); + uint32_t SrcDst=EXTRACT(Opcode,8,10); if(Index) Index=m_R[Index]; @@ -305,10 +305,10 @@ INST(STB) INST(LDS) { - UINT32 Offset=EXTRACT(Opcode,0,4); - UINT32 Index=EXTRACT(Opcode,5,7); - UINT32 SrcDst=EXTRACT(Opcode,8,10); - UINT32 Val; + uint32_t Offset=EXTRACT(Opcode,0,4); + uint32_t Index=EXTRACT(Opcode,5,7); + uint32_t SrcDst=EXTRACT(Opcode,8,10); + uint32_t Val; Offset<<=1; @@ -328,9 +328,9 @@ INST(LDS) INST(STS) { - UINT32 Offset=EXTRACT(Opcode,0,4); - UINT32 Index=EXTRACT(Opcode,5,7); - UINT32 SrcDst=EXTRACT(Opcode,8,10); + uint32_t Offset=EXTRACT(Opcode,0,4); + uint32_t Index=EXTRACT(Opcode,5,7); + uint32_t SrcDst=EXTRACT(Opcode,8,10); Offset<<=1; @@ -349,9 +349,9 @@ INST(STS) INST(LD) { - UINT32 Offset=EXTRACT(Opcode,0,4); - UINT32 Index=EXTRACT(Opcode,5,7); - UINT32 SrcDst=EXTRACT(Opcode,8,10); + uint32_t Offset=EXTRACT(Opcode,0,4); + uint32_t Index=EXTRACT(Opcode,5,7); + uint32_t SrcDst=EXTRACT(Opcode,8,10); Offset<<=2; @@ -370,9 +370,9 @@ INST(LD) INST(ST) { - UINT32 Offset=EXTRACT(Opcode,0,4); - UINT32 Index=EXTRACT(Opcode,5,7); - UINT32 SrcDst=EXTRACT(Opcode,8,10); + uint32_t Offset=EXTRACT(Opcode,0,4); + uint32_t Index=EXTRACT(Opcode,5,7); + uint32_t SrcDst=EXTRACT(Opcode,8,10); Offset<<=2; @@ -391,10 +391,10 @@ INST(ST) INST(LDBU) { - UINT32 Offset=EXTRACT(Opcode,0,4); - UINT32 Index=EXTRACT(Opcode,5,7); - UINT32 SrcDst=EXTRACT(Opcode,8,10); - UINT32 Val; + uint32_t Offset=EXTRACT(Opcode,0,4); + uint32_t Index=EXTRACT(Opcode,5,7); + uint32_t SrcDst=EXTRACT(Opcode,8,10); + uint32_t Val; if(Index) Index=m_R[Index]; @@ -412,10 +412,10 @@ INST(LDBU) INST(LDSU) { - UINT32 Offset=EXTRACT(Opcode,0,4); - UINT32 Index=EXTRACT(Opcode,5,7); - UINT32 SrcDst=EXTRACT(Opcode,8,10); - UINT32 Val; + uint32_t Offset=EXTRACT(Opcode,0,4); + uint32_t Index=EXTRACT(Opcode,5,7); + uint32_t SrcDst=EXTRACT(Opcode,8,10); + uint32_t Val; Offset<<=1; @@ -436,7 +436,7 @@ INST(LDSU) INST(LERI) { - UINT32 Imm=EXTRACT(Opcode,0,13); + uint32_t Imm=EXTRACT(Opcode,0,13); if(TESTFLAG(FLAG_E)) m_ER=(EXTRACT(m_ER,0,17)<<14)|Imm; else @@ -448,9 +448,9 @@ INST(LERI) INST(LDSP) { - UINT32 Offset=EXTRACT(Opcode,0,7); - UINT32 Index=m_SP; - UINT32 SrcDst=EXTRACT(Opcode,8,10); + uint32_t Offset=EXTRACT(Opcode,0,7); + uint32_t Index=m_SP; + uint32_t SrcDst=EXTRACT(Opcode,8,10); Offset<<=2; @@ -464,9 +464,9 @@ INST(LDSP) INST(STSP) { - UINT32 Offset=EXTRACT(Opcode,0,7); - UINT32 Index=m_SP; - UINT32 SrcDst=EXTRACT(Opcode,8,10); + uint32_t Offset=EXTRACT(Opcode,0,7); + uint32_t Index=m_SP; + uint32_t SrcDst=EXTRACT(Opcode,8,10); Offset<<=2; @@ -478,22 +478,22 @@ INST(STSP) CLRFLAG(FLAG_E); } -void se3208_device::PushVal(UINT32 Val) +void se3208_device::PushVal(uint32_t Val) { m_SP-=4; SE3208_Write32(m_SP,Val); } -UINT32 se3208_device::PopVal() +uint32_t se3208_device::PopVal() { - UINT32 Val=SE3208_Read32(m_SP); + uint32_t Val=SE3208_Read32(m_SP); m_SP+=4; return Val; } INST(PUSH) { - UINT32 Set=EXTRACT(Opcode,0,10); + uint32_t Set=EXTRACT(Opcode,0,10); if(Set&(1<<10)) PushVal(m_PC); if(Set&(1<<9)) @@ -520,7 +520,7 @@ INST(PUSH) INST(POP) { - UINT32 Set=EXTRACT(Opcode,0,10); + uint32_t Set=EXTRACT(Opcode,0,10); if(Set&(1<<0)) m_R[0]=PopVal(); if(Set&(1<<1)) @@ -549,8 +549,8 @@ INST(POP) INST(LEATOSP) { - UINT32 Offset=EXTRACT(Opcode,9,12); - UINT32 Index=EXTRACT(Opcode,3,5); + uint32_t Offset=EXTRACT(Opcode,9,12); + uint32_t Index=EXTRACT(Opcode,3,5); if(Index) Index=m_R[Index]; @@ -569,8 +569,8 @@ INST(LEATOSP) INST(LEAFROMSP) { - UINT32 Offset=EXTRACT(Opcode,9,12); - UINT32 Index=EXTRACT(Opcode,3,5); + uint32_t Offset=EXTRACT(Opcode,9,12); + uint32_t Index=EXTRACT(Opcode,3,5); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,27)<<4)|(Offset&0xf); @@ -584,7 +584,7 @@ INST(LEAFROMSP) INST(LEASPTOSP) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); Offset<<=2; @@ -600,16 +600,16 @@ INST(LEASPTOSP) INST(MOV) { - UINT32 Src=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,9,11); + uint32_t Src=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,9,11); m_R[Dst]=m_R[Src]; } INST(LDI) { - UINT32 Dst=EXTRACT(Opcode,8,10); - UINT32 Imm=EXTRACT(Opcode,0,7); + uint32_t Dst=EXTRACT(Opcode,8,10); + uint32_t Imm=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -623,10 +623,10 @@ INST(LDI) INST(LDBSP) { - UINT32 Offset=EXTRACT(Opcode,0,3); - UINT32 Index=m_SP; - UINT32 SrcDst=EXTRACT(Opcode,4,6); - UINT32 Val; + uint32_t Offset=EXTRACT(Opcode,0,3); + uint32_t Index=m_SP; + uint32_t SrcDst=EXTRACT(Opcode,4,6); + uint32_t Val; if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,27)<<4)|(Offset&0xf); @@ -639,9 +639,9 @@ INST(LDBSP) INST(STBSP) { - UINT32 Offset=EXTRACT(Opcode,0,3); - UINT32 Index=m_SP; - UINT32 SrcDst=EXTRACT(Opcode,4,6); + uint32_t Offset=EXTRACT(Opcode,0,3); + uint32_t Index=m_SP; + uint32_t SrcDst=EXTRACT(Opcode,4,6); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,27)<<4)|(Offset&0xf); @@ -653,10 +653,10 @@ INST(STBSP) INST(LDSSP) { - UINT32 Offset=EXTRACT(Opcode,0,3); - UINT32 Index=m_SP; - UINT32 SrcDst=EXTRACT(Opcode,4,6); - UINT32 Val; + uint32_t Offset=EXTRACT(Opcode,0,3); + uint32_t Index=m_SP; + uint32_t SrcDst=EXTRACT(Opcode,4,6); + uint32_t Val; Offset<<=1; @@ -671,9 +671,9 @@ INST(LDSSP) INST(STSSP) { - UINT32 Offset=EXTRACT(Opcode,0,3); - UINT32 Index=m_SP; - UINT32 SrcDst=EXTRACT(Opcode,4,6); + uint32_t Offset=EXTRACT(Opcode,0,3); + uint32_t Index=m_SP; + uint32_t SrcDst=EXTRACT(Opcode,4,6); Offset<<=1; @@ -687,10 +687,10 @@ INST(STSSP) INST(LDBUSP) { - UINT32 Offset=EXTRACT(Opcode,0,3); - UINT32 Index=m_SP; - UINT32 SrcDst=EXTRACT(Opcode,4,6); - UINT32 Val; + uint32_t Offset=EXTRACT(Opcode,0,3); + uint32_t Index=m_SP; + uint32_t SrcDst=EXTRACT(Opcode,4,6); + uint32_t Val; if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,27)<<4)|(Offset&0xf); @@ -703,10 +703,10 @@ INST(LDBUSP) INST(LDSUSP) { - UINT32 Offset=EXTRACT(Opcode,0,3); - UINT32 Index=m_SP; - UINT32 SrcDst=EXTRACT(Opcode,4,6); - UINT32 Val; + uint32_t Offset=EXTRACT(Opcode,0,3); + uint32_t Index=m_SP; + uint32_t SrcDst=EXTRACT(Opcode,4,6); + uint32_t Val; Offset<<=1; @@ -721,9 +721,9 @@ INST(LDSUSP) INST(ADDI) { - UINT32 Imm=EXTRACT(Opcode,9,12); - UINT32 Src=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,9,12); + uint32_t Src=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -737,9 +737,9 @@ INST(ADDI) INST(SUBI) { - UINT32 Imm=EXTRACT(Opcode,9,12); - UINT32 Src=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,9,12); + uint32_t Src=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -753,9 +753,9 @@ INST(SUBI) INST(ADCI) { - UINT32 Imm=EXTRACT(Opcode,9,12); - UINT32 Src=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,9,12); + uint32_t Src=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -769,9 +769,9 @@ INST(ADCI) INST(SBCI) { - UINT32 Imm=EXTRACT(Opcode,9,12); - UINT32 Src=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,9,12); + uint32_t Src=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -785,9 +785,9 @@ INST(SBCI) INST(ANDI) { - UINT32 Imm=EXTRACT(Opcode,9,12); - UINT32 Src=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,9,12); + uint32_t Src=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -805,9 +805,9 @@ INST(ANDI) INST(ORI) { - UINT32 Imm=EXTRACT(Opcode,9,12); - UINT32 Src=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,9,12); + uint32_t Src=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -825,9 +825,9 @@ INST(ORI) INST(XORI) { - UINT32 Imm=EXTRACT(Opcode,9,12); - UINT32 Src=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,9,12); + uint32_t Src=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -845,8 +845,8 @@ INST(XORI) INST(CMPI) { - UINT32 Imm=EXTRACT(Opcode,9,12); - UINT32 Src=EXTRACT(Opcode,3,5); + uint32_t Imm=EXTRACT(Opcode,9,12); + uint32_t Src=EXTRACT(Opcode,3,5); if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -860,9 +860,9 @@ INST(CMPI) INST(TSTI) { - UINT32 Imm=EXTRACT(Opcode,9,12); - UINT32 Src=EXTRACT(Opcode,3,5); - UINT32 Dst; + uint32_t Imm=EXTRACT(Opcode,9,12); + uint32_t Src=EXTRACT(Opcode,3,5); + uint32_t Dst; if(TESTFLAG(FLAG_E)) Imm=(EXTRACT(m_ER,0,27)<<4)|(Imm&0xf); @@ -880,45 +880,45 @@ INST(TSTI) INST(ADD) { - UINT32 Src2=EXTRACT(Opcode,9,11); - UINT32 Src1=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Src2=EXTRACT(Opcode,9,11); + uint32_t Src1=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); m_R[Dst]=AddWithFlags(m_R[Src1],m_R[Src2]); } INST(SUB) { - UINT32 Src2=EXTRACT(Opcode,9,11); - UINT32 Src1=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Src2=EXTRACT(Opcode,9,11); + uint32_t Src1=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); m_R[Dst]=SubWithFlags(m_R[Src1],m_R[Src2]); } INST(ADC) { - UINT32 Src2=EXTRACT(Opcode,9,11); - UINT32 Src1=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Src2=EXTRACT(Opcode,9,11); + uint32_t Src1=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); m_R[Dst]=AdcWithFlags(m_R[Src1],m_R[Src2]); } INST(SBC) { - UINT32 Src2=EXTRACT(Opcode,9,11); - UINT32 Src1=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Src2=EXTRACT(Opcode,9,11); + uint32_t Src1=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); m_R[Dst]=SbcWithFlags(m_R[Src1],m_R[Src2]); } INST(AND) { - UINT32 Src2=EXTRACT(Opcode,9,11); - UINT32 Src1=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Src2=EXTRACT(Opcode,9,11); + uint32_t Src1=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); m_R[Dst]=m_R[Src1]&m_R[Src2]; @@ -931,9 +931,9 @@ INST(AND) INST(OR) { - UINT32 Src2=EXTRACT(Opcode,9,11); - UINT32 Src1=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Src2=EXTRACT(Opcode,9,11); + uint32_t Src1=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); m_R[Dst]=m_R[Src1]|m_R[Src2]; @@ -947,9 +947,9 @@ INST(OR) INST(XOR) { - UINT32 Src2=EXTRACT(Opcode,9,11); - UINT32 Src1=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Src2=EXTRACT(Opcode,9,11); + uint32_t Src1=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); m_R[Dst]=m_R[Src1]^m_R[Src2]; @@ -963,17 +963,17 @@ INST(XOR) INST(CMP) { - UINT32 Src2=EXTRACT(Opcode,9,11); - UINT32 Src1=EXTRACT(Opcode,3,5); + uint32_t Src2=EXTRACT(Opcode,9,11); + uint32_t Src1=EXTRACT(Opcode,3,5); SubWithFlags(m_R[Src1],m_R[Src2]); } INST(TST) { - UINT32 Src2=EXTRACT(Opcode,9,11); - UINT32 Src1=EXTRACT(Opcode,3,5); - UINT32 Dst; + uint32_t Src2=EXTRACT(Opcode,9,11); + uint32_t Src1=EXTRACT(Opcode,3,5); + uint32_t Dst; Dst=m_R[Src1]&m_R[Src2]; @@ -986,9 +986,9 @@ INST(TST) INST(MULS) { - UINT32 Src2=EXTRACT(Opcode,6,8); - UINT32 Src1=EXTRACT(Opcode,3,5); - UINT32 Dst=EXTRACT(Opcode,0,2); + uint32_t Src2=EXTRACT(Opcode,6,8); + uint32_t Src1=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,0,2); m_R[Dst]=MulWithFlags(m_R[Src1],m_R[Src2]); @@ -997,15 +997,15 @@ INST(MULS) INST(NEG) { - UINT32 Dst=EXTRACT(Opcode,9,11); - UINT32 Src=EXTRACT(Opcode,3,5); + uint32_t Dst=EXTRACT(Opcode,9,11); + uint32_t Src=EXTRACT(Opcode,3,5); m_R[Dst]=NegWithFlags(m_R[Src]); } INST(CALL) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1020,7 +1020,7 @@ INST(CALL) INST(JV) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1039,7 +1039,7 @@ INST(JV) INST(JNV) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1057,7 +1057,7 @@ INST(JNV) INST(JC) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1075,7 +1075,7 @@ INST(JC) INST(JNC) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1093,7 +1093,7 @@ INST(JNC) INST(JP) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1111,7 +1111,7 @@ INST(JP) INST(JM) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1129,7 +1129,7 @@ INST(JM) INST(JNZ) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1147,7 +1147,7 @@ INST(JNZ) INST(JZ) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1165,9 +1165,9 @@ INST(JZ) INST(JGE) { - UINT32 Offset=EXTRACT(Opcode,0,7); - UINT32 S=TESTFLAG(FLAG_S)?1:0; - UINT32 V=TESTFLAG(FLAG_V)?1:0; + uint32_t Offset=EXTRACT(Opcode,0,7); + uint32_t S=TESTFLAG(FLAG_S)?1:0; + uint32_t V=TESTFLAG(FLAG_V)?1:0; if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1185,9 +1185,9 @@ INST(JGE) INST(JLE) { - UINT32 Offset=EXTRACT(Opcode,0,7); - UINT32 S=TESTFLAG(FLAG_S)?1:0; - UINT32 V=TESTFLAG(FLAG_V)?1:0; + uint32_t Offset=EXTRACT(Opcode,0,7); + uint32_t S=TESTFLAG(FLAG_S)?1:0; + uint32_t V=TESTFLAG(FLAG_V)?1:0; if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1204,7 +1204,7 @@ INST(JLE) INST(JHI) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1222,7 +1222,7 @@ INST(JHI) INST(JLS) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1240,9 +1240,9 @@ INST(JLS) INST(JGT) { - UINT32 Offset=EXTRACT(Opcode,0,7); - UINT32 S=TESTFLAG(FLAG_S)?1:0; - UINT32 V=TESTFLAG(FLAG_V)?1:0; + uint32_t Offset=EXTRACT(Opcode,0,7); + uint32_t S=TESTFLAG(FLAG_S)?1:0; + uint32_t V=TESTFLAG(FLAG_V)?1:0; if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1260,9 +1260,9 @@ INST(JGT) INST(JLT) { - UINT32 Offset=EXTRACT(Opcode,0,7); - UINT32 S=TESTFLAG(FLAG_S)?1:0; - UINT32 V=TESTFLAG(FLAG_V)?1:0; + uint32_t Offset=EXTRACT(Opcode,0,7); + uint32_t S=TESTFLAG(FLAG_S)?1:0; + uint32_t V=TESTFLAG(FLAG_V)?1:0; if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1282,7 +1282,7 @@ INST(JLT) INST(JMP) { - UINT32 Offset=EXTRACT(Opcode,0,7); + uint32_t Offset=EXTRACT(Opcode,0,7); if(TESTFLAG(FLAG_E)) Offset=(EXTRACT(m_ER,0,22)<<8)|Offset; @@ -1298,7 +1298,7 @@ INST(JMP) INST(JR) { - UINT32 Src=EXTRACT(Opcode,0,3); + uint32_t Src=EXTRACT(Opcode,0,3); m_PC=m_R[Src]-2; @@ -1307,7 +1307,7 @@ INST(JR) INST(CALLR) { - UINT32 Src=EXTRACT(Opcode,0,3); + uint32_t Src=EXTRACT(Opcode,0,3); PushVal(m_PC+2); m_PC=m_R[Src]-2; @@ -1316,10 +1316,10 @@ INST(CALLR) INST(ASR) { - UINT32 CS=Opcode&(1<<10); - UINT32 Dst=EXTRACT(Opcode,0,2); - UINT32 Imm=EXTRACT(Opcode,5,9); - UINT32 Cnt=EXTRACT(Opcode,5,7); + uint32_t CS=Opcode&(1<<10); + uint32_t Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,5,9); + uint32_t Cnt=EXTRACT(Opcode,5,7); if(CS) m_R[Dst]=AsrWithFlags(m_R[Dst],m_R[Cnt]&0x1f); @@ -1331,10 +1331,10 @@ INST(ASR) INST(LSR) { - UINT32 CS=Opcode&(1<<10); - UINT32 Dst=EXTRACT(Opcode,0,2); - UINT32 Imm=EXTRACT(Opcode,5,9); - UINT32 Cnt=EXTRACT(Opcode,5,7); + uint32_t CS=Opcode&(1<<10); + uint32_t Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,5,9); + uint32_t Cnt=EXTRACT(Opcode,5,7); if(CS) m_R[Dst]=LsrWithFlags(m_R[Dst],m_R[Cnt]&0x1f); @@ -1346,10 +1346,10 @@ INST(LSR) INST(ASL) { - UINT32 CS=Opcode&(1<<10); - UINT32 Dst=EXTRACT(Opcode,0,2); - UINT32 Imm=EXTRACT(Opcode,5,9); - UINT32 Cnt=EXTRACT(Opcode,5,7); + uint32_t CS=Opcode&(1<<10); + uint32_t Dst=EXTRACT(Opcode,0,2); + uint32_t Imm=EXTRACT(Opcode,5,9); + uint32_t Cnt=EXTRACT(Opcode,5,7); if(CS) m_R[Dst]=AslWithFlags(m_R[Dst],m_R[Cnt]&0x1f); @@ -1361,8 +1361,8 @@ INST(ASL) INST(EXTB) { - UINT32 Dst=EXTRACT(Opcode,0,3); - UINT32 Val=m_R[Dst]; + uint32_t Dst=EXTRACT(Opcode,0,3); + uint32_t Val=m_R[Dst]; m_R[Dst]=SEX8(Val); @@ -1376,8 +1376,8 @@ INST(EXTB) INST(EXTS) { - UINT32 Dst=EXTRACT(Opcode,0,3); - UINT32 Val=m_R[Dst]; + uint32_t Dst=EXTRACT(Opcode,0,3); + uint32_t Val=m_R[Dst]; m_R[Dst]=SEX16(Val); @@ -1390,21 +1390,21 @@ INST(EXTS) INST(SET) { - UINT32 Imm=EXTRACT(Opcode,0,3); + uint32_t Imm=EXTRACT(Opcode,0,3); m_SR|=(1<read_word(m_PC, WORD_XOR_LE(0)); + uint16_t Opcode=m_direct->read_word(m_PC, WORD_XOR_LE(0)); m_PPC = m_PC; debugger_instruction_hook(this, m_PC); @@ -1838,7 +1838,7 @@ void se3208_device::execute_set_input( int line, int state ) m_IRQ=state; } -offs_t se3208_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t se3208_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( se3208 ); return CPU_DISASSEMBLE_NAME(se3208)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/se3208/se3208.h b/src/devices/cpu/se3208/se3208.h index fbed0d6452b..a4fac45e1dd 100644 --- a/src/devices/cpu/se3208/se3208.h +++ b/src/devices/cpu/se3208/se3208.h @@ -14,7 +14,7 @@ class se3208_device : public cpu_device { public: // construction/destruction - se3208_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + se3208_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -22,9 +22,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -35,131 +35,131 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; //GPR - UINT32 m_R[8]; + uint32_t m_R[8]; //SPR - UINT32 m_PC; - UINT32 m_SR; - UINT32 m_SP; - UINT32 m_ER; - UINT32 m_PPC; + uint32_t m_PC; + uint32_t m_SR; + uint32_t m_SP; + uint32_t m_ER; + uint32_t m_PPC; address_space *m_program; direct_read_data *m_direct; - UINT8 m_IRQ; - UINT8 m_NMI; + uint8_t m_IRQ; + uint8_t m_NMI; int m_icount; - inline UINT32 read_dword_unaligned(address_space &space, UINT32 address); - inline UINT16 read_word_unaligned(address_space &space, UINT32 address); - inline void write_dword_unaligned(address_space &space, UINT32 address, UINT32 data); - inline void write_word_unaligned(address_space &space, UINT32 address, UINT16 data); - inline UINT8 SE3208_Read8(UINT32 addr); - inline UINT16 SE3208_Read16(UINT32 addr); - inline UINT32 SE3208_Read32(UINT32 addr); - inline void SE3208_Write8(UINT32 addr,UINT8 val); - inline void SE3208_Write16(UINT32 addr,UINT16 val); - inline void SE3208_Write32(UINT32 addr,UINT32 val); - inline UINT32 AddWithFlags(UINT32 a,UINT32 b); - inline UINT32 SubWithFlags(UINT32 a,UINT32 b); - inline UINT32 AdcWithFlags(UINT32 a,UINT32 b); - inline UINT32 SbcWithFlags(UINT32 a,UINT32 b); - inline UINT32 MulWithFlags(UINT32 a,UINT32 b); - inline UINT32 NegWithFlags(UINT32 a); - inline UINT32 AsrWithFlags(UINT32 Val, UINT8 By); - inline UINT32 LsrWithFlags(UINT32 Val, UINT8 By); - inline UINT32 AslWithFlags(UINT32 Val, UINT8 By); - inline void PushVal(UINT32 Val); - inline UINT32 PopVal(); - - typedef void (se3208_device::*_OP)(UINT16 Opcode); + inline uint32_t read_dword_unaligned(address_space &space, uint32_t address); + inline uint16_t read_word_unaligned(address_space &space, uint32_t address); + inline void write_dword_unaligned(address_space &space, uint32_t address, uint32_t data); + inline void write_word_unaligned(address_space &space, uint32_t address, uint16_t data); + inline uint8_t SE3208_Read8(uint32_t addr); + inline uint16_t SE3208_Read16(uint32_t addr); + inline uint32_t SE3208_Read32(uint32_t addr); + inline void SE3208_Write8(uint32_t addr,uint8_t val); + inline void SE3208_Write16(uint32_t addr,uint16_t val); + inline void SE3208_Write32(uint32_t addr,uint32_t val); + inline uint32_t AddWithFlags(uint32_t a,uint32_t b); + inline uint32_t SubWithFlags(uint32_t a,uint32_t b); + inline uint32_t AdcWithFlags(uint32_t a,uint32_t b); + inline uint32_t SbcWithFlags(uint32_t a,uint32_t b); + inline uint32_t MulWithFlags(uint32_t a,uint32_t b); + inline uint32_t NegWithFlags(uint32_t a); + inline uint32_t AsrWithFlags(uint32_t Val, uint8_t By); + inline uint32_t LsrWithFlags(uint32_t Val, uint8_t By); + inline uint32_t AslWithFlags(uint32_t Val, uint8_t By); + inline void PushVal(uint32_t Val); + inline uint32_t PopVal(); + + typedef void (se3208_device::*_OP)(uint16_t Opcode); _OP OpTable[0x10000]; - void INVALIDOP(UINT16 Opcode); - void LDB(UINT16 Opcode); - void STB(UINT16 Opcode); - void LDS(UINT16 Opcode); - void STS(UINT16 Opcode); - void LD(UINT16 Opcode); - void ST(UINT16 Opcode); - void LDBU(UINT16 Opcode); - void LDSU(UINT16 Opcode); - void LERI(UINT16 Opcode); - void LDSP(UINT16 Opcode); - void STSP(UINT16 Opcode); - void PUSH(UINT16 Opcode); - void POP(UINT16 Opcode); - void LEATOSP(UINT16 Opcode); - void LEAFROMSP(UINT16 Opcode); - void LEASPTOSP(UINT16 Opcode); - void MOV(UINT16 Opcode); - void LDI(UINT16 Opcode); - void LDBSP(UINT16 Opcode); - void STBSP(UINT16 Opcode); - void LDSSP(UINT16 Opcode); - void STSSP(UINT16 Opcode); - void LDBUSP(UINT16 Opcode); - void LDSUSP(UINT16 Opcode); - void ADDI(UINT16 Opcode); - void SUBI(UINT16 Opcode); - void ADCI(UINT16 Opcode); - void SBCI(UINT16 Opcode); - void ANDI(UINT16 Opcode); - void ORI(UINT16 Opcode); - void XORI(UINT16 Opcode); - void CMPI(UINT16 Opcode); - void TSTI(UINT16 Opcode); - void ADD(UINT16 Opcode); - void SUB(UINT16 Opcode); - void ADC(UINT16 Opcode); - void SBC(UINT16 Opcode); - void AND(UINT16 Opcode); - void OR(UINT16 Opcode); - void XOR(UINT16 Opcode); - void CMP(UINT16 Opcode); - void TST(UINT16 Opcode); - void MULS(UINT16 Opcode); - void NEG(UINT16 Opcode); - void CALL(UINT16 Opcode); - void JV(UINT16 Opcode); - void JNV(UINT16 Opcode); - void JC(UINT16 Opcode); - void JNC(UINT16 Opcode); - void JP(UINT16 Opcode); - void JM(UINT16 Opcode); - void JNZ(UINT16 Opcode); - void JZ(UINT16 Opcode); - void JGE(UINT16 Opcode); - void JLE(UINT16 Opcode); - void JHI(UINT16 Opcode); - void JLS(UINT16 Opcode); - void JGT(UINT16 Opcode); - void JLT(UINT16 Opcode); - void JMP(UINT16 Opcode); - void JR(UINT16 Opcode); - void CALLR(UINT16 Opcode); - void ASR(UINT16 Opcode); - void LSR(UINT16 Opcode); - void ASL(UINT16 Opcode); - void EXTB(UINT16 Opcode); - void EXTS(UINT16 Opcode); - void SET(UINT16 Opcode); - void CLR(UINT16 Opcode); - void SWI(UINT16 Opcode); - void HALT(UINT16 Opcode); - void MVTC(UINT16 Opcode); - void MVFC(UINT16 Opcode); + void INVALIDOP(uint16_t Opcode); + void LDB(uint16_t Opcode); + void STB(uint16_t Opcode); + void LDS(uint16_t Opcode); + void STS(uint16_t Opcode); + void LD(uint16_t Opcode); + void ST(uint16_t Opcode); + void LDBU(uint16_t Opcode); + void LDSU(uint16_t Opcode); + void LERI(uint16_t Opcode); + void LDSP(uint16_t Opcode); + void STSP(uint16_t Opcode); + void PUSH(uint16_t Opcode); + void POP(uint16_t Opcode); + void LEATOSP(uint16_t Opcode); + void LEAFROMSP(uint16_t Opcode); + void LEASPTOSP(uint16_t Opcode); + void MOV(uint16_t Opcode); + void LDI(uint16_t Opcode); + void LDBSP(uint16_t Opcode); + void STBSP(uint16_t Opcode); + void LDSSP(uint16_t Opcode); + void STSSP(uint16_t Opcode); + void LDBUSP(uint16_t Opcode); + void LDSUSP(uint16_t Opcode); + void ADDI(uint16_t Opcode); + void SUBI(uint16_t Opcode); + void ADCI(uint16_t Opcode); + void SBCI(uint16_t Opcode); + void ANDI(uint16_t Opcode); + void ORI(uint16_t Opcode); + void XORI(uint16_t Opcode); + void CMPI(uint16_t Opcode); + void TSTI(uint16_t Opcode); + void ADD(uint16_t Opcode); + void SUB(uint16_t Opcode); + void ADC(uint16_t Opcode); + void SBC(uint16_t Opcode); + void AND(uint16_t Opcode); + void OR(uint16_t Opcode); + void XOR(uint16_t Opcode); + void CMP(uint16_t Opcode); + void TST(uint16_t Opcode); + void MULS(uint16_t Opcode); + void NEG(uint16_t Opcode); + void CALL(uint16_t Opcode); + void JV(uint16_t Opcode); + void JNV(uint16_t Opcode); + void JC(uint16_t Opcode); + void JNC(uint16_t Opcode); + void JP(uint16_t Opcode); + void JM(uint16_t Opcode); + void JNZ(uint16_t Opcode); + void JZ(uint16_t Opcode); + void JGE(uint16_t Opcode); + void JLE(uint16_t Opcode); + void JHI(uint16_t Opcode); + void JLS(uint16_t Opcode); + void JGT(uint16_t Opcode); + void JLT(uint16_t Opcode); + void JMP(uint16_t Opcode); + void JR(uint16_t Opcode); + void CALLR(uint16_t Opcode); + void ASR(uint16_t Opcode); + void LSR(uint16_t Opcode); + void ASL(uint16_t Opcode); + void EXTB(uint16_t Opcode); + void EXTS(uint16_t Opcode); + void SET(uint16_t Opcode); + void CLR(uint16_t Opcode); + void SWI(uint16_t Opcode); + void HALT(uint16_t Opcode); + void MVTC(uint16_t Opcode); + void MVFC(uint16_t Opcode); void BuildTable(void); - _OP DecodeOp(UINT16 Opcode); + _OP DecodeOp(uint16_t Opcode); void SE3208_NMI(); void SE3208_Interrupt(); diff --git a/src/devices/cpu/se3208/se3208dis.cpp b/src/devices/cpu/se3208/se3208dis.cpp index 9de811f846a..3640f0193b4 100644 --- a/src/devices/cpu/se3208/se3208dis.cpp +++ b/src/devices/cpu/se3208/se3208dis.cpp @@ -7,9 +7,9 @@ static struct { - UINT32 PC; - UINT32 SR; - UINT32 ER; + uint32_t PC; + uint32_t SR; + uint32_t ER; } Context; #define FLAG_E 0x0800 @@ -25,8 +25,8 @@ static struct #define ZEX16(val) ((val)&0xFFFF) #define SEX(bits,val) ((val)&(1<<(bits-1))?((val)|(~((1<read_byte(A & AM); @@ -270,7 +270,7 @@ UINT8 sh2_device::RB(offs_t A) return m_program->read_byte(A); } -UINT16 sh2_device::RW(offs_t A) +uint16_t sh2_device::RW(offs_t A) { if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000) return m_program->read_word(A & AM); @@ -278,7 +278,7 @@ UINT16 sh2_device::RW(offs_t A) return m_program->read_word(A); } -UINT32 sh2_device::RL(offs_t A) +uint32_t sh2_device::RL(offs_t A) { /* 0x20000000 no Cache */ /* 0x00000000 read thru Cache if CE bit is 1 */ @@ -288,7 +288,7 @@ UINT32 sh2_device::RL(offs_t A) return m_program->read_dword(A); } -void sh2_device::WB(offs_t A, UINT8 V) +void sh2_device::WB(offs_t A, uint8_t V) { if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000) { @@ -299,7 +299,7 @@ void sh2_device::WB(offs_t A, UINT8 V) m_program->write_byte(A,V); } -void sh2_device::WW(offs_t A, UINT16 V) +void sh2_device::WW(offs_t A, uint16_t V) { if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000) { @@ -310,7 +310,7 @@ void sh2_device::WW(offs_t A, UINT16 V) m_program->write_word(A,V); } -void sh2_device::WL(offs_t A, UINT32 V) +void sh2_device::WL(offs_t A, uint32_t V) { if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000) { @@ -327,7 +327,7 @@ void sh2_device::WL(offs_t A, UINT32 V) * 0011 nnnn mmmm 1100 1 - * ADD Rm,Rn */ -void sh2_device::ADD(UINT32 m, UINT32 n) +void sh2_device::ADD(uint32_t m, uint32_t n) { m_sh2_state->r[n] += m_sh2_state->r[m]; } @@ -336,18 +336,18 @@ void sh2_device::ADD(UINT32 m, UINT32 n) * 0111 nnnn iiii iiii 1 - * ADD #imm,Rn */ -void sh2_device::ADDI(UINT32 i, UINT32 n) +void sh2_device::ADDI(uint32_t i, uint32_t n) { - m_sh2_state->r[n] += (INT32)(INT16)(INT8)i; + m_sh2_state->r[n] += (int32_t)(int16_t)(int8_t)i; } /* code cycles t-bit * 0011 nnnn mmmm 1110 1 carry * ADDC Rm,Rn */ -void sh2_device::ADDC(UINT32 m, UINT32 n) +void sh2_device::ADDC(uint32_t m, uint32_t n) { - UINT32 tmp0, tmp1; + uint32_t tmp0, tmp1; tmp1 = m_sh2_state->r[n] + m_sh2_state->r[m]; tmp0 = m_sh2_state->r[n]; @@ -364,21 +364,21 @@ void sh2_device::ADDC(UINT32 m, UINT32 n) * 0011 nnnn mmmm 1111 1 overflow * ADDV Rm,Rn */ -void sh2_device::ADDV(UINT32 m, UINT32 n) +void sh2_device::ADDV(uint32_t m, uint32_t n) { - INT32 dest, src, ans; + int32_t dest, src, ans; - if ((INT32) m_sh2_state->r[n] >= 0) + if ((int32_t) m_sh2_state->r[n] >= 0) dest = 0; else dest = 1; - if ((INT32) m_sh2_state->r[m] >= 0) + if ((int32_t) m_sh2_state->r[m] >= 0) src = 0; else src = 1; src += dest; m_sh2_state->r[n] += m_sh2_state->r[m]; - if ((INT32) m_sh2_state->r[n] >= 0) + if ((int32_t) m_sh2_state->r[n] >= 0) ans = 0; else ans = 1; @@ -398,7 +398,7 @@ void sh2_device::ADDV(UINT32 m, UINT32 n) * 0010 nnnn mmmm 1001 1 - * AND Rm,Rn */ -void sh2_device::AND(UINT32 m, UINT32 n) +void sh2_device::AND(uint32_t m, uint32_t n) { m_sh2_state->r[n] &= m_sh2_state->r[m]; } @@ -408,7 +408,7 @@ void sh2_device::AND(UINT32 m, UINT32 n) * 1100 1001 iiii iiii 1 - * AND #imm,R0 */ -void sh2_device::ANDI(UINT32 i) +void sh2_device::ANDI(uint32_t i) { m_sh2_state->r[0] &= i; } @@ -417,9 +417,9 @@ void sh2_device::ANDI(UINT32 i) * 1100 1101 iiii iiii 1 - * AND.B #imm,@(R0,GBR) */ -void sh2_device::ANDM(UINT32 i) +void sh2_device::ANDM(uint32_t i) { - UINT32 temp; + uint32_t temp; m_sh2_state->ea = m_sh2_state->gbr + m_sh2_state->r[0]; temp = i & RB( m_sh2_state->ea ); @@ -431,11 +431,11 @@ void sh2_device::ANDM(UINT32 i) * 1000 1011 dddd dddd 3/1 - * BF disp8 */ -void sh2_device::BF(UINT32 d) +void sh2_device::BF(uint32_t d) { if ((m_sh2_state->sr & T) == 0) { - INT32 disp = ((INT32)d << 24) >> 24; + int32_t disp = ((int32_t)d << 24) >> 24; m_sh2_state->pc = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2; m_sh2_state->icount -= 2; } @@ -445,11 +445,11 @@ void sh2_device::BF(UINT32 d) * 1000 1111 dddd dddd 3/1 - * BFS disp8 */ -void sh2_device::BFS(UINT32 d) +void sh2_device::BFS(uint32_t d) { if ((m_sh2_state->sr & T) == 0) { - INT32 disp = ((INT32)d << 24) >> 24; + int32_t disp = ((int32_t)d << 24) >> 24; m_delay = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2; m_sh2_state->icount--; } @@ -459,14 +459,14 @@ void sh2_device::BFS(UINT32 d) * 1010 dddd dddd dddd 2 - * BRA disp12 */ -void sh2_device::BRA(UINT32 d) +void sh2_device::BRA(uint32_t d) { - INT32 disp = ((INT32)d << 20) >> 20; + int32_t disp = ((int32_t)d << 20) >> 20; #if BUSY_LOOP_HACKS if (disp == -2) { - UINT32 next_opcode = RW(m_sh2_state->pc & AM); + uint32_t next_opcode = RW(m_sh2_state->pc & AM); /* BRA $ * NOP */ @@ -482,7 +482,7 @@ void sh2_device::BRA(UINT32 d) * 0000 mmmm 0010 0011 2 - * BRAF Rm */ -void sh2_device::BRAF(UINT32 m) +void sh2_device::BRAF(uint32_t m) { m_delay = m_sh2_state->pc + m_sh2_state->r[m] + 2; m_sh2_state->icount--; @@ -492,9 +492,9 @@ void sh2_device::BRAF(UINT32 m) * 1011 dddd dddd dddd 2 - * BSR disp12 */ -void sh2_device::BSR(UINT32 d) +void sh2_device::BSR(uint32_t d) { - INT32 disp = ((INT32)d << 20) >> 20; + int32_t disp = ((int32_t)d << 20) >> 20; m_sh2_state->pr = m_sh2_state->pc + 2; m_delay = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2; @@ -505,7 +505,7 @@ void sh2_device::BSR(UINT32 d) * 0000 mmmm 0000 0011 2 - * BSRF Rm */ -void sh2_device::BSRF(UINT32 m) +void sh2_device::BSRF(uint32_t m) { m_sh2_state->pr = m_sh2_state->pc + 2; m_delay = m_sh2_state->pc + m_sh2_state->r[m] + 2; @@ -516,11 +516,11 @@ void sh2_device::BSRF(UINT32 m) * 1000 1001 dddd dddd 3/1 - * BT disp8 */ -void sh2_device::BT(UINT32 d) +void sh2_device::BT(uint32_t d) { if ((m_sh2_state->sr & T) != 0) { - INT32 disp = ((INT32)d << 24) >> 24; + int32_t disp = ((int32_t)d << 24) >> 24; m_sh2_state->pc = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2; m_sh2_state->icount -= 2; } @@ -530,11 +530,11 @@ void sh2_device::BT(UINT32 d) * 1000 1101 dddd dddd 2/1 - * BTS disp8 */ -void sh2_device::BTS(UINT32 d) +void sh2_device::BTS(uint32_t d) { if ((m_sh2_state->sr & T) != 0) { - INT32 disp = ((INT32)d << 24) >> 24; + int32_t disp = ((int32_t)d << 24) >> 24; m_delay = m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2; m_sh2_state->icount--; } @@ -563,7 +563,7 @@ void sh2_device::CLRT() * 0011 nnnn mmmm 0000 1 comparison result * CMP_EQ Rm,Rn */ -void sh2_device::CMPEQ(UINT32 m, UINT32 n) +void sh2_device::CMPEQ(uint32_t m, uint32_t n) { if (m_sh2_state->r[n] == m_sh2_state->r[m]) m_sh2_state->sr |= T; @@ -575,9 +575,9 @@ void sh2_device::CMPEQ(UINT32 m, UINT32 n) * 0011 nnnn mmmm 0011 1 comparison result * CMP_GE Rm,Rn */ -void sh2_device::CMPGE(UINT32 m, UINT32 n) +void sh2_device::CMPGE(uint32_t m, uint32_t n) { - if ((INT32) m_sh2_state->r[n] >= (INT32) m_sh2_state->r[m]) + if ((int32_t) m_sh2_state->r[n] >= (int32_t) m_sh2_state->r[m]) m_sh2_state->sr |= T; else m_sh2_state->sr &= ~T; @@ -587,9 +587,9 @@ void sh2_device::CMPGE(UINT32 m, UINT32 n) * 0011 nnnn mmmm 0111 1 comparison result * CMP_GT Rm,Rn */ -void sh2_device::CMPGT(UINT32 m, UINT32 n) +void sh2_device::CMPGT(uint32_t m, uint32_t n) { - if ((INT32) m_sh2_state->r[n] > (INT32) m_sh2_state->r[m]) + if ((int32_t) m_sh2_state->r[n] > (int32_t) m_sh2_state->r[m]) m_sh2_state->sr |= T; else m_sh2_state->sr &= ~T; @@ -599,9 +599,9 @@ void sh2_device::CMPGT(UINT32 m, UINT32 n) * 0011 nnnn mmmm 0110 1 comparison result * CMP_HI Rm,Rn */ -void sh2_device::CMPHI(UINT32 m, UINT32 n) +void sh2_device::CMPHI(uint32_t m, uint32_t n) { - if ((UINT32) m_sh2_state->r[n] > (UINT32) m_sh2_state->r[m]) + if ((uint32_t) m_sh2_state->r[n] > (uint32_t) m_sh2_state->r[m]) m_sh2_state->sr |= T; else m_sh2_state->sr &= ~T; @@ -611,9 +611,9 @@ void sh2_device::CMPHI(UINT32 m, UINT32 n) * 0011 nnnn mmmm 0010 1 comparison result * CMP_HS Rm,Rn */ -void sh2_device::CMPHS(UINT32 m, UINT32 n) +void sh2_device::CMPHS(uint32_t m, uint32_t n) { - if ((UINT32) m_sh2_state->r[n] >= (UINT32) m_sh2_state->r[m]) + if ((uint32_t) m_sh2_state->r[n] >= (uint32_t) m_sh2_state->r[m]) m_sh2_state->sr |= T; else m_sh2_state->sr &= ~T; @@ -624,9 +624,9 @@ void sh2_device::CMPHS(UINT32 m, UINT32 n) * 0100 nnnn 0001 0101 1 comparison result * CMP_PL Rn */ -void sh2_device::CMPPL(UINT32 n) +void sh2_device::CMPPL(uint32_t n) { - if ((INT32) m_sh2_state->r[n] > 0) + if ((int32_t) m_sh2_state->r[n] > 0) m_sh2_state->sr |= T; else m_sh2_state->sr &= ~T; @@ -636,9 +636,9 @@ void sh2_device::CMPPL(UINT32 n) * 0100 nnnn 0001 0001 1 comparison result * CMP_PZ Rn */ -void sh2_device::CMPPZ(UINT32 n) +void sh2_device::CMPPZ(uint32_t n) { - if ((INT32) m_sh2_state->r[n] >= 0) + if ((int32_t) m_sh2_state->r[n] >= 0) m_sh2_state->sr |= T; else m_sh2_state->sr &= ~T; @@ -648,10 +648,10 @@ void sh2_device::CMPPZ(UINT32 n) * 0010 nnnn mmmm 1100 1 comparison result * CMP_STR Rm,Rn */ -void sh2_device::CMPSTR(UINT32 m, UINT32 n) +void sh2_device::CMPSTR(uint32_t m, uint32_t n) { - UINT32 temp; - INT32 HH, HL, LH, LL; + uint32_t temp; + int32_t HH, HL, LH, LL; temp = m_sh2_state->r[n] ^ m_sh2_state->r[m]; HH = (temp >> 24) & 0xff; HL = (temp >> 16) & 0xff; @@ -668,9 +668,9 @@ void sh2_device::CMPSTR(UINT32 m, UINT32 n) * 1000 1000 iiii iiii 1 comparison result * CMP/EQ #imm,R0 */ -void sh2_device::CMPIM(UINT32 i) +void sh2_device::CMPIM(uint32_t i) { - UINT32 imm = (UINT32)(INT32)(INT16)(INT8)i; + uint32_t imm = (uint32_t)(int32_t)(int16_t)(int8_t)i; if (m_sh2_state->r[0] == imm) m_sh2_state->sr |= T; @@ -682,7 +682,7 @@ void sh2_device::CMPIM(UINT32 i) * 0010 nnnn mmmm 0111 1 calculation result * DIV0S Rm,Rn */ -void sh2_device::DIV0S(UINT32 m, UINT32 n) +void sh2_device::DIV0S(uint32_t m, uint32_t n) { if ((m_sh2_state->r[n] & 0x80000000) == 0) m_sh2_state->sr &= ~Q; @@ -711,10 +711,10 @@ void sh2_device::DIV0U() * 0011 nnnn mmmm 0100 1 calculation result * DIV1 Rm,Rn */ -void sh2_device::DIV1(UINT32 m, UINT32 n) +void sh2_device::DIV1(uint32_t m, uint32_t n) { - UINT32 tmp0; - UINT32 old_q; + uint32_t tmp0; + uint32_t old_q; old_q = m_sh2_state->sr & Q; if (0x80000000 & m_sh2_state->r[n]) @@ -803,24 +803,24 @@ void sh2_device::DIV1(UINT32 m, UINT32 n) } /* DMULS.L Rm,Rn */ -void sh2_device::DMULS(UINT32 m, UINT32 n) +void sh2_device::DMULS(uint32_t m, uint32_t n) { - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; - INT32 tempm, tempn, fnLmL; + uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2; + uint32_t temp0, temp1, temp2, temp3; + int32_t tempm, tempn, fnLmL; - tempn = (INT32) m_sh2_state->r[n]; - tempm = (INT32) m_sh2_state->r[m]; + tempn = (int32_t) m_sh2_state->r[n]; + tempm = (int32_t) m_sh2_state->r[m]; if (tempn < 0) tempn = 0 - tempn; if (tempm < 0) tempm = 0 - tempm; - if ((INT32) (m_sh2_state->r[n] ^ m_sh2_state->r[m]) < 0) + if ((int32_t) (m_sh2_state->r[n] ^ m_sh2_state->r[m]) < 0) fnLmL = -1; else fnLmL = 0; - temp1 = (UINT32) tempn; - temp2 = (UINT32) tempm; + temp1 = (uint32_t) tempn; + temp2 = (uint32_t) tempm; RnL = temp1 & 0x0000ffff; RnH = (temp1 >> 16) & 0x0000ffff; RmL = temp2 & 0x0000ffff; @@ -852,10 +852,10 @@ void sh2_device::DMULS(UINT32 m, UINT32 n) } /* DMULU.L Rm,Rn */ -void sh2_device::DMULU(UINT32 m, UINT32 n) +void sh2_device::DMULU(uint32_t m, uint32_t n) { - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; + uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2; + uint32_t temp0, temp1, temp2, temp3; RnL = m_sh2_state->r[n] & 0x0000ffff; RnH = (m_sh2_state->r[n] >> 16) & 0x0000ffff; @@ -880,7 +880,7 @@ void sh2_device::DMULU(UINT32 m, UINT32 n) } /* DT Rn */ -void sh2_device::DT(UINT32 n) +void sh2_device::DT(uint32_t n) { m_sh2_state->r[n]--; if (m_sh2_state->r[n] == 0) @@ -889,7 +889,7 @@ void sh2_device::DT(UINT32 n) m_sh2_state->sr &= ~T; #if BUSY_LOOP_HACKS { - UINT32 next_opcode = RW(m_sh2_state->pc & AM); + uint32_t next_opcode = RW(m_sh2_state->pc & AM); /* DT Rn * BF $-2 */ @@ -906,25 +906,25 @@ void sh2_device::DT(UINT32 n) } /* EXTS.B Rm,Rn */ -void sh2_device::EXTSB(UINT32 m, UINT32 n) +void sh2_device::EXTSB(uint32_t m, uint32_t n) { - m_sh2_state->r[n] = ((INT32)m_sh2_state->r[m] << 24) >> 24; + m_sh2_state->r[n] = ((int32_t)m_sh2_state->r[m] << 24) >> 24; } /* EXTS.W Rm,Rn */ -void sh2_device::EXTSW(UINT32 m, UINT32 n) +void sh2_device::EXTSW(uint32_t m, uint32_t n) { - m_sh2_state->r[n] = ((INT32)m_sh2_state->r[m] << 16) >> 16; + m_sh2_state->r[n] = ((int32_t)m_sh2_state->r[m] << 16) >> 16; } /* EXTU.B Rm,Rn */ -void sh2_device::EXTUB(UINT32 m, UINT32 n) +void sh2_device::EXTUB(uint32_t m, uint32_t n) { m_sh2_state->r[n] = m_sh2_state->r[m] & 0x000000ff; } /* EXTU.W Rm,Rn */ -void sh2_device::EXTUW(UINT32 m, UINT32 n) +void sh2_device::EXTUW(uint32_t m, uint32_t n) { m_sh2_state->r[n] = m_sh2_state->r[m] & 0x0000ffff; } @@ -947,14 +947,14 @@ void sh2_device::ILLEGAL() /* JMP @Rm */ -void sh2_device::JMP(UINT32 m) +void sh2_device::JMP(uint32_t m) { m_delay = m_sh2_state->ea = m_sh2_state->r[m]; m_sh2_state->icount--; } /* JSR @Rm */ -void sh2_device::JSR(UINT32 m) +void sh2_device::JSR(uint32_t m) { m_sh2_state->pr = m_sh2_state->pc + 2; m_delay = m_sh2_state->ea = m_sh2_state->r[m]; @@ -963,26 +963,26 @@ void sh2_device::JSR(UINT32 m) /* LDC Rm,SR */ -void sh2_device::LDCSR(UINT32 m) +void sh2_device::LDCSR(uint32_t m) { m_sh2_state->sr = m_sh2_state->r[m] & FLAGS; m_test_irq = 1; } /* LDC Rm,GBR */ -void sh2_device::LDCGBR(UINT32 m) +void sh2_device::LDCGBR(uint32_t m) { m_sh2_state->gbr = m_sh2_state->r[m]; } /* LDC Rm,VBR */ -void sh2_device::LDCVBR(UINT32 m) +void sh2_device::LDCVBR(uint32_t m) { m_sh2_state->vbr = m_sh2_state->r[m]; } /* LDC.L @Rm+,SR */ -void sh2_device::LDCMSR(UINT32 m) +void sh2_device::LDCMSR(uint32_t m) { m_sh2_state->ea = m_sh2_state->r[m]; m_sh2_state->sr = RL( m_sh2_state->ea ) & FLAGS; @@ -992,7 +992,7 @@ void sh2_device::LDCMSR(UINT32 m) } /* LDC.L @Rm+,GBR */ -void sh2_device::LDCMGBR(UINT32 m) +void sh2_device::LDCMGBR(uint32_t m) { m_sh2_state->ea = m_sh2_state->r[m]; m_sh2_state->gbr = RL( m_sh2_state->ea ); @@ -1001,7 +1001,7 @@ void sh2_device::LDCMGBR(UINT32 m) } /* LDC.L @Rm+,VBR */ -void sh2_device::LDCMVBR(UINT32 m) +void sh2_device::LDCMVBR(uint32_t m) { m_sh2_state->ea = m_sh2_state->r[m]; m_sh2_state->vbr = RL( m_sh2_state->ea ); @@ -1010,25 +1010,25 @@ void sh2_device::LDCMVBR(UINT32 m) } /* LDS Rm,MACH */ -void sh2_device::LDSMACH(UINT32 m) +void sh2_device::LDSMACH(uint32_t m) { m_sh2_state->mach = m_sh2_state->r[m]; } /* LDS Rm,MACL */ -void sh2_device::LDSMACL(UINT32 m) +void sh2_device::LDSMACL(uint32_t m) { m_sh2_state->macl = m_sh2_state->r[m]; } /* LDS Rm,PR */ -void sh2_device::LDSPR(UINT32 m) +void sh2_device::LDSPR(uint32_t m) { m_sh2_state->pr = m_sh2_state->r[m]; } /* LDS.L @Rm+,MACH */ -void sh2_device::LDSMMACH(UINT32 m) +void sh2_device::LDSMMACH(uint32_t m) { m_sh2_state->ea = m_sh2_state->r[m]; m_sh2_state->mach = RL( m_sh2_state->ea ); @@ -1036,7 +1036,7 @@ void sh2_device::LDSMMACH(UINT32 m) } /* LDS.L @Rm+,MACL */ -void sh2_device::LDSMMACL(UINT32 m) +void sh2_device::LDSMMACL(uint32_t m) { m_sh2_state->ea = m_sh2_state->r[m]; m_sh2_state->macl = RL( m_sh2_state->ea ); @@ -1044,7 +1044,7 @@ void sh2_device::LDSMMACL(UINT32 m) } /* LDS.L @Rm+,PR */ -void sh2_device::LDSMPR(UINT32 m) +void sh2_device::LDSMPR(uint32_t m) { m_sh2_state->ea = m_sh2_state->r[m]; m_sh2_state->pr = RL( m_sh2_state->ea ); @@ -1052,17 +1052,17 @@ void sh2_device::LDSMPR(UINT32 m) } /* MAC.L @Rm+,@Rn+ */ -void sh2_device::MAC_L(UINT32 m, UINT32 n) +void sh2_device::MAC_L(uint32_t m, uint32_t n) { - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; - INT32 tempm, tempn, fnLmL; + uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2; + uint32_t temp0, temp1, temp2, temp3; + int32_t tempm, tempn, fnLmL; - tempn = (INT32) RL( m_sh2_state->r[n] ); + tempn = (int32_t) RL( m_sh2_state->r[n] ); m_sh2_state->r[n] += 4; - tempm = (INT32) RL( m_sh2_state->r[m] ); + tempm = (int32_t) RL( m_sh2_state->r[m] ); m_sh2_state->r[m] += 4; - if ((INT32) (tempn ^ tempm) < 0) + if ((int32_t) (tempn ^ tempm) < 0) fnLmL = -1; else fnLmL = 0; @@ -1070,8 +1070,8 @@ void sh2_device::MAC_L(UINT32 m, UINT32 n) tempn = 0 - tempn; if (tempm < 0) tempm = 0 - tempm; - temp1 = (UINT32) tempn; - temp2 = (UINT32) tempm; + temp1 = (uint32_t) tempn; + temp2 = (uint32_t) tempm; RnL = temp1 & 0x0000ffff; RnH = (temp1 >> 16) & 0x0000ffff; RmL = temp2 & 0x0000ffff; @@ -1103,12 +1103,12 @@ void sh2_device::MAC_L(UINT32 m, UINT32 n) if (m_sh2_state->macl > Res0) Res2++; Res2 += (m_sh2_state->mach & 0x0000ffff); - if (((INT32) Res2 < 0) && (Res2 < 0xffff8000)) + if (((int32_t) Res2 < 0) && (Res2 < 0xffff8000)) { Res2 = 0x00008000; Res0 = 0x00000000; } - else if (((INT32) Res2 > 0) && (Res2 > 0x00007fff)) + else if (((int32_t) Res2 > 0) && (Res2 > 0x00007fff)) { Res2 = 0x00007fff; Res0 = 0xffffffff; @@ -1129,22 +1129,22 @@ void sh2_device::MAC_L(UINT32 m, UINT32 n) } /* MAC.W @Rm+,@Rn+ */ -void sh2_device::MAC_W(UINT32 m, UINT32 n) +void sh2_device::MAC_W(uint32_t m, uint32_t n) { - INT32 tempm, tempn, dest, src, ans; - UINT32 templ; + int32_t tempm, tempn, dest, src, ans; + uint32_t templ; - tempn = (INT32) RW( m_sh2_state->r[n] ); + tempn = (int32_t) RW( m_sh2_state->r[n] ); m_sh2_state->r[n] += 2; - tempm = (INT32) RW( m_sh2_state->r[m] ); + tempm = (int32_t) RW( m_sh2_state->r[m] ); m_sh2_state->r[m] += 2; templ = m_sh2_state->macl; - tempm = ((INT32) (short) tempn * (INT32) (short) tempm); - if ((INT32) m_sh2_state->macl >= 0) + tempm = ((int32_t) (short) tempn * (int32_t) (short) tempm); + if ((int32_t) m_sh2_state->macl >= 0) dest = 0; else dest = 1; - if ((INT32) tempm >= 0) + if ((int32_t) tempm >= 0) { src = 0; tempn = 0; @@ -1156,7 +1156,7 @@ void sh2_device::MAC_W(UINT32 m, UINT32 n) } src += dest; m_sh2_state->macl += tempm; - if ((INT32) m_sh2_state->macl >= 0) + if ((int32_t) m_sh2_state->macl >= 0) ans = 0; else ans = 1; @@ -1181,99 +1181,99 @@ void sh2_device::MAC_W(UINT32 m, UINT32 n) } /* MOV Rm,Rn */ -void sh2_device::MOV(UINT32 m, UINT32 n) +void sh2_device::MOV(uint32_t m, uint32_t n) { m_sh2_state->r[n] = m_sh2_state->r[m]; } /* MOV.B Rm,@Rn */ -void sh2_device::MOVBS(UINT32 m, UINT32 n) +void sh2_device::MOVBS(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[n]; WB( m_sh2_state->ea, m_sh2_state->r[m] & 0x000000ff); } /* MOV.W Rm,@Rn */ -void sh2_device::MOVWS(UINT32 m, UINT32 n) +void sh2_device::MOVWS(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[n]; WW( m_sh2_state->ea, m_sh2_state->r[m] & 0x0000ffff); } /* MOV.L Rm,@Rn */ -void sh2_device::MOVLS(UINT32 m, UINT32 n) +void sh2_device::MOVLS(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[n]; WL( m_sh2_state->ea, m_sh2_state->r[m] ); } /* MOV.B @Rm,Rn */ -void sh2_device::MOVBL(UINT32 m, UINT32 n) +void sh2_device::MOVBL(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[m]; - m_sh2_state->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->ea ); + m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->ea ); } /* MOV.W @Rm,Rn */ -void sh2_device::MOVWL(UINT32 m, UINT32 n) +void sh2_device::MOVWL(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[m]; - m_sh2_state->r[n] = (UINT32)(INT32)(INT16) RW( m_sh2_state->ea ); + m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->ea ); } /* MOV.L @Rm,Rn */ -void sh2_device::MOVLL(UINT32 m, UINT32 n) +void sh2_device::MOVLL(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[m]; m_sh2_state->r[n] = RL( m_sh2_state->ea ); } /* MOV.B Rm,@-Rn */ -void sh2_device::MOVBM(UINT32 m, UINT32 n) +void sh2_device::MOVBM(uint32_t m, uint32_t n) { /* SMG : bug fix, was reading m_sh2_state->r[n] */ - UINT32 data = m_sh2_state->r[m] & 0x000000ff; + uint32_t data = m_sh2_state->r[m] & 0x000000ff; m_sh2_state->r[n] -= 1; WB( m_sh2_state->r[n], data ); } /* MOV.W Rm,@-Rn */ -void sh2_device::MOVWM(UINT32 m, UINT32 n) +void sh2_device::MOVWM(uint32_t m, uint32_t n) { - UINT32 data = m_sh2_state->r[m] & 0x0000ffff; + uint32_t data = m_sh2_state->r[m] & 0x0000ffff; m_sh2_state->r[n] -= 2; WW( m_sh2_state->r[n], data ); } /* MOV.L Rm,@-Rn */ -void sh2_device::MOVLM(UINT32 m, UINT32 n) +void sh2_device::MOVLM(uint32_t m, uint32_t n) { - UINT32 data = m_sh2_state->r[m]; + uint32_t data = m_sh2_state->r[m]; m_sh2_state->r[n] -= 4; WL( m_sh2_state->r[n], data ); } /* MOV.B @Rm+,Rn */ -void sh2_device::MOVBP(UINT32 m, UINT32 n) +void sh2_device::MOVBP(uint32_t m, uint32_t n) { - m_sh2_state->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->r[m] ); + m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->r[m] ); if (n != m) m_sh2_state->r[m] += 1; } /* MOV.W @Rm+,Rn */ -void sh2_device::MOVWP(UINT32 m, UINT32 n) +void sh2_device::MOVWP(uint32_t m, uint32_t n) { - m_sh2_state->r[n] = (UINT32)(INT32)(INT16) RW( m_sh2_state->r[m] ); + m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->r[m] ); if (n != m) m_sh2_state->r[m] += 2; } /* MOV.L @Rm+,Rn */ -void sh2_device::MOVLP(UINT32 m, UINT32 n) +void sh2_device::MOVLP(uint32_t m, uint32_t n) { m_sh2_state->r[n] = RL( m_sh2_state->r[m] ); if (n != m) @@ -1281,208 +1281,208 @@ void sh2_device::MOVLP(UINT32 m, UINT32 n) } /* MOV.B Rm,@(R0,Rn) */ -void sh2_device::MOVBS0(UINT32 m, UINT32 n) +void sh2_device::MOVBS0(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[n] + m_sh2_state->r[0]; WB( m_sh2_state->ea, m_sh2_state->r[m] & 0x000000ff ); } /* MOV.W Rm,@(R0,Rn) */ -void sh2_device::MOVWS0(UINT32 m, UINT32 n) +void sh2_device::MOVWS0(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[n] + m_sh2_state->r[0]; WW( m_sh2_state->ea, m_sh2_state->r[m] & 0x0000ffff ); } /* MOV.L Rm,@(R0,Rn) */ -void sh2_device::MOVLS0(UINT32 m, UINT32 n) +void sh2_device::MOVLS0(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[n] + m_sh2_state->r[0]; WL( m_sh2_state->ea, m_sh2_state->r[m] ); } /* MOV.B @(R0,Rm),Rn */ -void sh2_device::MOVBL0(UINT32 m, UINT32 n) +void sh2_device::MOVBL0(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[m] + m_sh2_state->r[0]; - m_sh2_state->r[n] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->ea ); + m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->ea ); } /* MOV.W @(R0,Rm),Rn */ -void sh2_device::MOVWL0(UINT32 m, UINT32 n) +void sh2_device::MOVWL0(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[m] + m_sh2_state->r[0]; - m_sh2_state->r[n] = (UINT32)(INT32)(INT16) RW( m_sh2_state->ea ); + m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->ea ); } /* MOV.L @(R0,Rm),Rn */ -void sh2_device::MOVLL0(UINT32 m, UINT32 n) +void sh2_device::MOVLL0(uint32_t m, uint32_t n) { m_sh2_state->ea = m_sh2_state->r[m] + m_sh2_state->r[0]; m_sh2_state->r[n] = RL( m_sh2_state->ea ); } /* MOV #imm,Rn */ -void sh2_device::MOVI(UINT32 i, UINT32 n) +void sh2_device::MOVI(uint32_t i, uint32_t n) { - m_sh2_state->r[n] = (UINT32)(INT32)(INT16)(INT8) i; + m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t)(int8_t) i; } /* MOV.W @(disp8,PC),Rn */ -void sh2_device::MOVWI(UINT32 d, UINT32 n) +void sh2_device::MOVWI(uint32_t d, uint32_t n) { - UINT32 disp = d & 0xff; + uint32_t disp = d & 0xff; m_sh2_state->ea = m_sh2_state->pc + disp * 2 + 2; - m_sh2_state->r[n] = (UINT32)(INT32)(INT16) RW( m_sh2_state->ea ); + m_sh2_state->r[n] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->ea ); } /* MOV.L @(disp8,PC),Rn */ -void sh2_device::MOVLI(UINT32 d, UINT32 n) +void sh2_device::MOVLI(uint32_t d, uint32_t n) { - UINT32 disp = d & 0xff; + uint32_t disp = d & 0xff; m_sh2_state->ea = ((m_sh2_state->pc + 2) & ~3) + disp * 4; m_sh2_state->r[n] = RL( m_sh2_state->ea ); } /* MOV.B @(disp8,GBR),R0 */ -void sh2_device::MOVBLG(UINT32 d) +void sh2_device::MOVBLG(uint32_t d) { - UINT32 disp = d & 0xff; + uint32_t disp = d & 0xff; m_sh2_state->ea = m_sh2_state->gbr + disp; - m_sh2_state->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->ea ); + m_sh2_state->r[0] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->ea ); } /* MOV.W @(disp8,GBR),R0 */ -void sh2_device::MOVWLG(UINT32 d) +void sh2_device::MOVWLG(uint32_t d) { - UINT32 disp = d & 0xff; + uint32_t disp = d & 0xff; m_sh2_state->ea = m_sh2_state->gbr + disp * 2; - m_sh2_state->r[0] = (INT32)(INT16) RW( m_sh2_state->ea ); + m_sh2_state->r[0] = (int32_t)(int16_t) RW( m_sh2_state->ea ); } /* MOV.L @(disp8,GBR),R0 */ -void sh2_device::MOVLLG(UINT32 d) +void sh2_device::MOVLLG(uint32_t d) { - UINT32 disp = d & 0xff; + uint32_t disp = d & 0xff; m_sh2_state->ea = m_sh2_state->gbr + disp * 4; m_sh2_state->r[0] = RL( m_sh2_state->ea ); } /* MOV.B R0,@(disp8,GBR) */ -void sh2_device::MOVBSG(UINT32 d) +void sh2_device::MOVBSG(uint32_t d) { - UINT32 disp = d & 0xff; + uint32_t disp = d & 0xff; m_sh2_state->ea = m_sh2_state->gbr + disp; WB( m_sh2_state->ea, m_sh2_state->r[0] & 0x000000ff ); } /* MOV.W R0,@(disp8,GBR) */ -void sh2_device::MOVWSG(UINT32 d) +void sh2_device::MOVWSG(uint32_t d) { - UINT32 disp = d & 0xff; + uint32_t disp = d & 0xff; m_sh2_state->ea = m_sh2_state->gbr + disp * 2; WW( m_sh2_state->ea, m_sh2_state->r[0] & 0x0000ffff ); } /* MOV.L R0,@(disp8,GBR) */ -void sh2_device::MOVLSG(UINT32 d) +void sh2_device::MOVLSG(uint32_t d) { - UINT32 disp = d & 0xff; + uint32_t disp = d & 0xff; m_sh2_state->ea = m_sh2_state->gbr + disp * 4; WL( m_sh2_state->ea, m_sh2_state->r[0] ); } /* MOV.B R0,@(disp4,Rn) */ -void sh2_device::MOVBS4(UINT32 d, UINT32 n) +void sh2_device::MOVBS4(uint32_t d, uint32_t n) { - UINT32 disp = d & 0x0f; + uint32_t disp = d & 0x0f; m_sh2_state->ea = m_sh2_state->r[n] + disp; WB( m_sh2_state->ea, m_sh2_state->r[0] & 0x000000ff ); } /* MOV.W R0,@(disp4,Rn) */ -void sh2_device::MOVWS4(UINT32 d, UINT32 n) +void sh2_device::MOVWS4(uint32_t d, uint32_t n) { - UINT32 disp = d & 0x0f; + uint32_t disp = d & 0x0f; m_sh2_state->ea = m_sh2_state->r[n] + disp * 2; WW( m_sh2_state->ea, m_sh2_state->r[0] & 0x0000ffff ); } /* MOV.L Rm,@(disp4,Rn) */ -void sh2_device::MOVLS4(UINT32 m, UINT32 d, UINT32 n) +void sh2_device::MOVLS4(uint32_t m, uint32_t d, uint32_t n) { - UINT32 disp = d & 0x0f; + uint32_t disp = d & 0x0f; m_sh2_state->ea = m_sh2_state->r[n] + disp * 4; WL( m_sh2_state->ea, m_sh2_state->r[m] ); } /* MOV.B @(disp4,Rm),R0 */ -void sh2_device::MOVBL4(UINT32 m, UINT32 d) +void sh2_device::MOVBL4(uint32_t m, uint32_t d) { - UINT32 disp = d & 0x0f; + uint32_t disp = d & 0x0f; m_sh2_state->ea = m_sh2_state->r[m] + disp; - m_sh2_state->r[0] = (UINT32)(INT32)(INT16)(INT8) RB( m_sh2_state->ea ); + m_sh2_state->r[0] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_sh2_state->ea ); } /* MOV.W @(disp4,Rm),R0 */ -void sh2_device::MOVWL4(UINT32 m, UINT32 d) +void sh2_device::MOVWL4(uint32_t m, uint32_t d) { - UINT32 disp = d & 0x0f; + uint32_t disp = d & 0x0f; m_sh2_state->ea = m_sh2_state->r[m] + disp * 2; - m_sh2_state->r[0] = (UINT32)(INT32)(INT16) RW( m_sh2_state->ea ); + m_sh2_state->r[0] = (uint32_t)(int32_t)(int16_t) RW( m_sh2_state->ea ); } /* MOV.L @(disp4,Rm),Rn */ -void sh2_device::MOVLL4(UINT32 m, UINT32 d, UINT32 n) +void sh2_device::MOVLL4(uint32_t m, uint32_t d, uint32_t n) { - UINT32 disp = d & 0x0f; + uint32_t disp = d & 0x0f; m_sh2_state->ea = m_sh2_state->r[m] + disp * 4; m_sh2_state->r[n] = RL( m_sh2_state->ea ); } /* MOVA @(disp8,PC),R0 */ -void sh2_device::MOVA(UINT32 d) +void sh2_device::MOVA(uint32_t d) { - UINT32 disp = d & 0xff; + uint32_t disp = d & 0xff; m_sh2_state->ea = ((m_sh2_state->pc + 2) & ~3) + disp * 4; m_sh2_state->r[0] = m_sh2_state->ea; } /* MOVT Rn */ -void sh2_device::MOVT(UINT32 n) +void sh2_device::MOVT(uint32_t n) { m_sh2_state->r[n] = m_sh2_state->sr & T; } /* MUL.L Rm,Rn */ -void sh2_device::MULL(UINT32 m, UINT32 n) +void sh2_device::MULL(uint32_t m, uint32_t n) { m_sh2_state->macl = m_sh2_state->r[n] * m_sh2_state->r[m]; m_sh2_state->icount--; } /* MULS Rm,Rn */ -void sh2_device::MULS(UINT32 m, UINT32 n) +void sh2_device::MULS(uint32_t m, uint32_t n) { - m_sh2_state->macl = (INT16) m_sh2_state->r[n] * (INT16) m_sh2_state->r[m]; + m_sh2_state->macl = (int16_t) m_sh2_state->r[n] * (int16_t) m_sh2_state->r[m]; } /* MULU Rm,Rn */ -void sh2_device::MULU(UINT32 m, UINT32 n) +void sh2_device::MULU(uint32_t m, uint32_t n) { - m_sh2_state->macl = (UINT16) m_sh2_state->r[n] * (UINT16) m_sh2_state->r[m]; + m_sh2_state->macl = (uint16_t) m_sh2_state->r[n] * (uint16_t) m_sh2_state->r[m]; } /* NEG Rm,Rn */ -void sh2_device::NEG(UINT32 m, UINT32 n) +void sh2_device::NEG(uint32_t m, uint32_t n) { m_sh2_state->r[n] = 0 - m_sh2_state->r[m]; } /* NEGC Rm,Rn */ -void sh2_device::NEGC(UINT32 m, UINT32 n) +void sh2_device::NEGC(uint32_t m, uint32_t n) { - UINT32 temp; + uint32_t temp; temp = m_sh2_state->r[m]; m_sh2_state->r[n] = -temp - (m_sh2_state->sr & T); @@ -1498,27 +1498,27 @@ void sh2_device::NOP(void) } /* NOT Rm,Rn */ -void sh2_device::NOT(UINT32 m, UINT32 n) +void sh2_device::NOT(uint32_t m, uint32_t n) { m_sh2_state->r[n] = ~m_sh2_state->r[m]; } /* OR Rm,Rn */ -void sh2_device::OR(UINT32 m, UINT32 n) +void sh2_device::OR(uint32_t m, uint32_t n) { m_sh2_state->r[n] |= m_sh2_state->r[m]; } /* OR #imm,R0 */ -void sh2_device::ORI(UINT32 i) +void sh2_device::ORI(uint32_t i) { m_sh2_state->r[0] |= i; } /* OR.B #imm,@(R0,GBR) */ -void sh2_device::ORM(UINT32 i) +void sh2_device::ORM(uint32_t i) { - UINT32 temp; + uint32_t temp; m_sh2_state->ea = m_sh2_state->gbr + m_sh2_state->r[0]; temp = RB( m_sh2_state->ea ); @@ -1528,9 +1528,9 @@ void sh2_device::ORM(UINT32 i) } /* ROTCL Rn */ -void sh2_device::ROTCL(UINT32 n) +void sh2_device::ROTCL(uint32_t n) { - UINT32 temp; + uint32_t temp; temp = (m_sh2_state->r[n] >> 31) & T; m_sh2_state->r[n] = (m_sh2_state->r[n] << 1) | (m_sh2_state->sr & T); @@ -1538,9 +1538,9 @@ void sh2_device::ROTCL(UINT32 n) } /* ROTCR Rn */ -void sh2_device::ROTCR(UINT32 n) +void sh2_device::ROTCR(uint32_t n) { - UINT32 temp; + uint32_t temp; temp = (m_sh2_state->sr & T) << 31; if (m_sh2_state->r[n] & T) m_sh2_state->sr |= T; @@ -1550,14 +1550,14 @@ void sh2_device::ROTCR(UINT32 n) } /* ROTL Rn */ -void sh2_device::ROTL(UINT32 n) +void sh2_device::ROTL(uint32_t n) { m_sh2_state->sr = (m_sh2_state->sr & ~T) | ((m_sh2_state->r[n] >> 31) & T); m_sh2_state->r[n] = (m_sh2_state->r[n] << 1) | (m_sh2_state->r[n] >> 31); } /* ROTR Rn */ -void sh2_device::ROTR(UINT32 n) +void sh2_device::ROTR(uint32_t n) { m_sh2_state->sr = (m_sh2_state->sr & ~T) | (m_sh2_state->r[n] & T); m_sh2_state->r[n] = (m_sh2_state->r[n] >> 1) | (m_sh2_state->r[n] << 31); @@ -1590,65 +1590,65 @@ void sh2_device::SETT() } /* SHAL Rn (same as SHLL) */ -void sh2_device::SHAL(UINT32 n) +void sh2_device::SHAL(uint32_t n) { m_sh2_state->sr = (m_sh2_state->sr & ~T) | ((m_sh2_state->r[n] >> 31) & T); m_sh2_state->r[n] <<= 1; } /* SHAR Rn */ -void sh2_device::SHAR(UINT32 n) +void sh2_device::SHAR(uint32_t n) { m_sh2_state->sr = (m_sh2_state->sr & ~T) | (m_sh2_state->r[n] & T); - m_sh2_state->r[n] = (UINT32)((INT32)m_sh2_state->r[n] >> 1); + m_sh2_state->r[n] = (uint32_t)((int32_t)m_sh2_state->r[n] >> 1); } /* SHLL Rn (same as SHAL) */ -void sh2_device::SHLL(UINT32 n) +void sh2_device::SHLL(uint32_t n) { m_sh2_state->sr = (m_sh2_state->sr & ~T) | ((m_sh2_state->r[n] >> 31) & T); m_sh2_state->r[n] <<= 1; } /* SHLL2 Rn */ -void sh2_device::SHLL2(UINT32 n) +void sh2_device::SHLL2(uint32_t n) { m_sh2_state->r[n] <<= 2; } /* SHLL8 Rn */ -void sh2_device::SHLL8(UINT32 n) +void sh2_device::SHLL8(uint32_t n) { m_sh2_state->r[n] <<= 8; } /* SHLL16 Rn */ -void sh2_device::SHLL16(UINT32 n) +void sh2_device::SHLL16(uint32_t n) { m_sh2_state->r[n] <<= 16; } /* SHLR Rn */ -void sh2_device::SHLR(UINT32 n) +void sh2_device::SHLR(uint32_t n) { m_sh2_state->sr = (m_sh2_state->sr & ~T) | (m_sh2_state->r[n] & T); m_sh2_state->r[n] >>= 1; } /* SHLR2 Rn */ -void sh2_device::SHLR2(UINT32 n) +void sh2_device::SHLR2(uint32_t n) { m_sh2_state->r[n] >>= 2; } /* SHLR8 Rn */ -void sh2_device::SHLR8(UINT32 n) +void sh2_device::SHLR8(uint32_t n) { m_sh2_state->r[n] >>= 8; } /* SHLR16 Rn */ -void sh2_device::SHLR16(UINT32 n) +void sh2_device::SHLR16(uint32_t n) { m_sh2_state->r[n] >>= 16; } @@ -1667,25 +1667,25 @@ void sh2_device::SLEEP() } /* STC SR,Rn */ -void sh2_device::STCSR(UINT32 n) +void sh2_device::STCSR(uint32_t n) { m_sh2_state->r[n] = m_sh2_state->sr; } /* STC GBR,Rn */ -void sh2_device::STCGBR(UINT32 n) +void sh2_device::STCGBR(uint32_t n) { m_sh2_state->r[n] = m_sh2_state->gbr; } /* STC VBR,Rn */ -void sh2_device::STCVBR(UINT32 n) +void sh2_device::STCVBR(uint32_t n) { m_sh2_state->r[n] = m_sh2_state->vbr; } /* STC.L SR,@-Rn */ -void sh2_device::STCMSR(UINT32 n) +void sh2_device::STCMSR(uint32_t n) { m_sh2_state->r[n] -= 4; m_sh2_state->ea = m_sh2_state->r[n]; @@ -1694,7 +1694,7 @@ void sh2_device::STCMSR(UINT32 n) } /* STC.L GBR,@-Rn */ -void sh2_device::STCMGBR(UINT32 n) +void sh2_device::STCMGBR(uint32_t n) { m_sh2_state->r[n] -= 4; m_sh2_state->ea = m_sh2_state->r[n]; @@ -1703,7 +1703,7 @@ void sh2_device::STCMGBR(UINT32 n) } /* STC.L VBR,@-Rn */ -void sh2_device::STCMVBR(UINT32 n) +void sh2_device::STCMVBR(uint32_t n) { m_sh2_state->r[n] -= 4; m_sh2_state->ea = m_sh2_state->r[n]; @@ -1712,25 +1712,25 @@ void sh2_device::STCMVBR(UINT32 n) } /* STS MACH,Rn */ -void sh2_device::STSMACH(UINT32 n) +void sh2_device::STSMACH(uint32_t n) { m_sh2_state->r[n] = m_sh2_state->mach; } /* STS MACL,Rn */ -void sh2_device::STSMACL(UINT32 n) +void sh2_device::STSMACL(uint32_t n) { m_sh2_state->r[n] = m_sh2_state->macl; } /* STS PR,Rn */ -void sh2_device::STSPR(UINT32 n) +void sh2_device::STSPR(uint32_t n) { m_sh2_state->r[n] = m_sh2_state->pr; } /* STS.L MACH,@-Rn */ -void sh2_device::STSMMACH(UINT32 n) +void sh2_device::STSMMACH(uint32_t n) { m_sh2_state->r[n] -= 4; m_sh2_state->ea = m_sh2_state->r[n]; @@ -1738,7 +1738,7 @@ void sh2_device::STSMMACH(UINT32 n) } /* STS.L MACL,@-Rn */ -void sh2_device::STSMMACL(UINT32 n) +void sh2_device::STSMMACL(uint32_t n) { m_sh2_state->r[n] -= 4; m_sh2_state->ea = m_sh2_state->r[n]; @@ -1746,7 +1746,7 @@ void sh2_device::STSMMACL(UINT32 n) } /* STS.L PR,@-Rn */ -void sh2_device::STSMPR(UINT32 n) +void sh2_device::STSMPR(uint32_t n) { m_sh2_state->r[n] -= 4; m_sh2_state->ea = m_sh2_state->r[n]; @@ -1754,15 +1754,15 @@ void sh2_device::STSMPR(UINT32 n) } /* SUB Rm,Rn */ -void sh2_device::SUB(UINT32 m, UINT32 n) +void sh2_device::SUB(uint32_t m, uint32_t n) { m_sh2_state->r[n] -= m_sh2_state->r[m]; } /* SUBC Rm,Rn */ -void sh2_device::SUBC(UINT32 m, UINT32 n) +void sh2_device::SUBC(uint32_t m, uint32_t n) { - UINT32 tmp0, tmp1; + uint32_t tmp0, tmp1; tmp1 = m_sh2_state->r[n] - m_sh2_state->r[m]; tmp0 = m_sh2_state->r[n]; @@ -1776,21 +1776,21 @@ void sh2_device::SUBC(UINT32 m, UINT32 n) } /* SUBV Rm,Rn */ -void sh2_device::SUBV(UINT32 m, UINT32 n) +void sh2_device::SUBV(uint32_t m, uint32_t n) { - INT32 dest, src, ans; + int32_t dest, src, ans; - if ((INT32) m_sh2_state->r[n] >= 0) + if ((int32_t) m_sh2_state->r[n] >= 0) dest = 0; else dest = 1; - if ((INT32) m_sh2_state->r[m] >= 0) + if ((int32_t) m_sh2_state->r[m] >= 0) src = 0; else src = 1; src += dest; m_sh2_state->r[n] -= m_sh2_state->r[m]; - if ((INT32) m_sh2_state->r[n] >= 0) + if ((int32_t) m_sh2_state->r[n] >= 0) ans = 0; else ans = 1; @@ -1807,9 +1807,9 @@ void sh2_device::SUBV(UINT32 m, UINT32 n) } /* SWAP.B Rm,Rn */ -void sh2_device::SWAPB(UINT32 m, UINT32 n) +void sh2_device::SWAPB(uint32_t m, uint32_t n) { - UINT32 temp0, temp1; + uint32_t temp0, temp1; temp0 = m_sh2_state->r[m] & 0xffff0000; temp1 = (m_sh2_state->r[m] & 0x000000ff) << 8; @@ -1818,18 +1818,18 @@ void sh2_device::SWAPB(UINT32 m, UINT32 n) } /* SWAP.W Rm,Rn */ -void sh2_device::SWAPW(UINT32 m, UINT32 n) +void sh2_device::SWAPW(uint32_t m, uint32_t n) { - UINT32 temp; + uint32_t temp; temp = (m_sh2_state->r[m] >> 16) & 0x0000ffff; m_sh2_state->r[n] = (m_sh2_state->r[m] << 16) | temp; } /* TAS.B @Rn */ -void sh2_device::TAS(UINT32 n) +void sh2_device::TAS(uint32_t n) { - UINT32 temp; + uint32_t temp; m_sh2_state->ea = m_sh2_state->r[n]; /* Bus Lock enable */ temp = RB( m_sh2_state->ea ); @@ -1844,9 +1844,9 @@ void sh2_device::TAS(UINT32 n) } /* TRAPA #imm */ -void sh2_device::TRAPA(UINT32 i) +void sh2_device::TRAPA(uint32_t i) { - UINT32 imm = i & 0xff; + uint32_t imm = i & 0xff; m_sh2_state->ea = m_sh2_state->vbr + imm * 4; @@ -1861,7 +1861,7 @@ void sh2_device::TRAPA(UINT32 i) } /* TST Rm,Rn */ -void sh2_device::TST(UINT32 m, UINT32 n) +void sh2_device::TST(uint32_t m, uint32_t n) { if ((m_sh2_state->r[n] & m_sh2_state->r[m]) == 0) m_sh2_state->sr |= T; @@ -1870,9 +1870,9 @@ void sh2_device::TST(UINT32 m, UINT32 n) } /* TST #imm,R0 */ -void sh2_device::TSTI(UINT32 i) +void sh2_device::TSTI(uint32_t i) { - UINT32 imm = i & 0xff; + uint32_t imm = i & 0xff; if ((imm & m_sh2_state->r[0]) == 0) m_sh2_state->sr |= T; @@ -1881,9 +1881,9 @@ void sh2_device::TSTI(UINT32 i) } /* TST.B #imm,@(R0,GBR) */ -void sh2_device::TSTM(UINT32 i) +void sh2_device::TSTM(uint32_t i) { - UINT32 imm = i & 0xff; + uint32_t imm = i & 0xff; m_sh2_state->ea = m_sh2_state->gbr + m_sh2_state->r[0]; if ((imm & RB( m_sh2_state->ea )) == 0) @@ -1894,23 +1894,23 @@ void sh2_device::TSTM(UINT32 i) } /* XOR Rm,Rn */ -void sh2_device::XOR(UINT32 m, UINT32 n) +void sh2_device::XOR(uint32_t m, uint32_t n) { m_sh2_state->r[n] ^= m_sh2_state->r[m]; } /* XOR #imm,R0 */ -void sh2_device::XORI(UINT32 i) +void sh2_device::XORI(uint32_t i) { - UINT32 imm = i & 0xff; + uint32_t imm = i & 0xff; m_sh2_state->r[0] ^= imm; } /* XOR.B #imm,@(R0,GBR) */ -void sh2_device::XORM(UINT32 i) +void sh2_device::XORM(uint32_t i) { - UINT32 imm = i & 0xff; - UINT32 temp; + uint32_t imm = i & 0xff; + uint32_t temp; m_sh2_state->ea = m_sh2_state->gbr + m_sh2_state->r[0]; temp = RB( m_sh2_state->ea ); @@ -1920,9 +1920,9 @@ void sh2_device::XORM(UINT32 i) } /* XTRCT Rm,Rn */ -void sh2_device::XTRCT(UINT32 m, UINT32 n) +void sh2_device::XTRCT(uint32_t m, uint32_t n) { - UINT32 temp; + uint32_t temp; temp = (m_sh2_state->r[m] << 16) & 0xffff0000; m_sh2_state->r[n] = (m_sh2_state->r[n] >> 16) & 0x0000ffff; @@ -1933,7 +1933,7 @@ void sh2_device::XTRCT(UINT32 m, UINT32 n) * OPCODE DISPATCHERS *****************************************************************************/ -void sh2_device::op0000(UINT16 opcode) +void sh2_device::op0000(uint16_t opcode) { switch (opcode & 0x3F) { @@ -2010,12 +2010,12 @@ void sh2_device::op0000(UINT16 opcode) } } -void sh2_device::op0001(UINT16 opcode) +void sh2_device::op0001(uint16_t opcode) { MOVLS4(Rm, opcode & 0x0f, Rn); } -void sh2_device::op0010(UINT16 opcode) +void sh2_device::op0010(uint16_t opcode) { switch (opcode & 15) { @@ -2038,7 +2038,7 @@ void sh2_device::op0010(UINT16 opcode) } } -void sh2_device::op0011(UINT16 opcode) +void sh2_device::op0011(uint16_t opcode) { switch (opcode & 15) { @@ -2061,7 +2061,7 @@ void sh2_device::op0011(UINT16 opcode) } } -void sh2_device::op0100(UINT16 opcode) +void sh2_device::op0100(uint16_t opcode) { switch (opcode & 0x3F) { @@ -2136,12 +2136,12 @@ void sh2_device::op0100(UINT16 opcode) } } -void sh2_device::op0101(UINT16 opcode) +void sh2_device::op0101(uint16_t opcode) { MOVLL4(Rm, opcode & 0x0f, Rn); } -void sh2_device::op0110(UINT16 opcode) +void sh2_device::op0110(uint16_t opcode) { switch (opcode & 15) { @@ -2164,12 +2164,12 @@ void sh2_device::op0110(UINT16 opcode) } } -void sh2_device::op0111(UINT16 opcode) +void sh2_device::op0111(uint16_t opcode) { ADDI(opcode & 0xff, Rn); } -void sh2_device::op1000(UINT16 opcode) +void sh2_device::op1000(uint16_t opcode) { switch ( opcode & (15<<8) ) { @@ -2193,22 +2193,22 @@ void sh2_device::op1000(UINT16 opcode) } -void sh2_device::op1001(UINT16 opcode) +void sh2_device::op1001(uint16_t opcode) { MOVWI(opcode & 0xff, Rn); } -void sh2_device::op1010(UINT16 opcode) +void sh2_device::op1010(uint16_t opcode) { BRA(opcode & 0xfff); } -void sh2_device::op1011(UINT16 opcode) +void sh2_device::op1011(uint16_t opcode) { BSR(opcode & 0xfff); } -void sh2_device::op1100(UINT16 opcode) +void sh2_device::op1100(uint16_t opcode) { switch (opcode & (15<<8)) { @@ -2231,17 +2231,17 @@ void sh2_device::op1100(UINT16 opcode) } } -void sh2_device::op1101(UINT16 opcode) +void sh2_device::op1101(uint16_t opcode) { MOVLI(opcode & 0xff, Rn); } -void sh2_device::op1110(UINT16 opcode) +void sh2_device::op1110(uint16_t opcode) { MOVI(opcode & 0xff, Rn); } -void sh2_device::op1111(UINT16 opcode) +void sh2_device::op1111(uint16_t opcode) { ILLEGAL(); } @@ -2307,7 +2307,7 @@ void sh2_device::execute_run() do { - UINT32 opcode; + uint32_t opcode; debugger_instruction_hook(this, m_sh2_state->pc); @@ -2516,7 +2516,7 @@ void sh2_device::device_start() m_pcfsel = 0; /* initialize the UML generator */ - UINT32 flags = 0; + uint32_t flags = 0; m_drcuml = std::make_unique(*this, m_cache, flags, 1, 32, 1); /* add symbols for our stuff */ diff --git a/src/devices/cpu/sh2/sh2.h b/src/devices/cpu/sh2/sh2.h index 081b31f6cf1..dad81c972ec 100644 --- a/src/devices/cpu/sh2/sh2.h +++ b/src/devices/cpu/sh2/sh2.h @@ -48,14 +48,14 @@ enum }; -typedef device_delegate sh2_dma_kludge_delegate; -#define SH2_DMA_KLUDGE_CB(name) int name(UINT32 src, UINT32 dst, UINT32 data, int size) +typedef device_delegate sh2_dma_kludge_delegate; +#define SH2_DMA_KLUDGE_CB(name) int name(uint32_t src, uint32_t dst, uint32_t data, int size) -typedef device_delegate sh2_dma_fifo_data_available_delegate; -#define SH2_DMA_FIFO_DATA_AVAILABLE_CB(name) int name(UINT32 src, UINT32 dst, UINT32 data, int size) +typedef device_delegate sh2_dma_fifo_data_available_delegate; +#define SH2_DMA_FIFO_DATA_AVAILABLE_CB(name) int name(uint32_t src, uint32_t dst, uint32_t data, int size) -typedef device_delegate sh2_ftcsr_read_delegate; -#define SH2_FTCSR_READ_CB(name) void name(UINT32 data) +typedef device_delegate sh2_ftcsr_read_delegate; +#define SH2_FTCSR_READ_CB(name) void name(uint32_t data) #define MCFG_SH2_IS_SLAVE(_slave) \ @@ -92,8 +92,8 @@ class sh2_device : public cpu_device public: // construction/destruction - sh2_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); - sh2_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, int cpu_type,address_map_constructor internal_map, int addrlines); + sh2_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); + sh2_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, int cpu_type,address_map_constructor internal_map, int addrlines); static void set_is_slave(device_t &device, int slave) { downcast(device).m_is_slave = slave; } static void set_dma_kludge_callback(device_t &device, sh2_dma_kludge_delegate callback) { downcast(device).m_dma_kludge_cb = callback; } @@ -105,9 +105,9 @@ public: DECLARE_READ32_MEMBER(sh2_internal_a5); void sh2_set_frt_input(int state); - void sh2drc_set_options(UINT32 options); + void sh2drc_set_options(uint32_t options); void sh2drc_add_pcflush(offs_t address); - void sh2drc_add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base); + void sh2drc_add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base); void sh2_notify_dma_data_available(); @@ -118,10 +118,10 @@ protected: virtual void device_stop() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 4; } - virtual UINT32 execute_input_lines() const override { return 16; } - virtual UINT32 execute_default_irq_vector() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 4; } + virtual uint32_t execute_input_lines() const override { return 16; } + virtual uint32_t execute_default_irq_vector() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -133,9 +133,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space *m_program, *m_decrypted_program; private: @@ -144,31 +144,31 @@ private: // Data that needs to be stored close to the generated DRC code struct internal_sh2_state { - UINT32 pc; - UINT32 pr; - UINT32 sr; - UINT32 gbr; - UINT32 vbr; - UINT32 mach; - UINT32 macl; - UINT32 r[16]; - UINT32 ea; - UINT32 pending_irq; - UINT32 pending_nmi; - INT32 irqline; - UINT32 evec; // exception vector for DRC - UINT32 irqsr; // IRQ-time old SR for DRC - UINT32 target; // target for jmp/jsr/etc so the delay slot can't kill it + uint32_t pc; + uint32_t pr; + uint32_t sr; + uint32_t gbr; + uint32_t vbr; + uint32_t mach; + uint32_t macl; + uint32_t r[16]; + uint32_t ea; + uint32_t pending_irq; + uint32_t pending_nmi; + int32_t irqline; + uint32_t evec; // exception vector for DRC + uint32_t irqsr; // IRQ-time old SR for DRC + uint32_t target; // target for jmp/jsr/etc so the delay slot can't kill it int internal_irq_level; int icount; - UINT8 sleep_mode; - UINT32 arg0; /* print_debug argument 1 */ + uint8_t sleep_mode; + uint32_t arg0; /* print_debug argument 1 */ }; - UINT32 m_delay; - UINT32 m_cpu_off; - UINT32 m_dvsr, m_dvdnth, m_dvdntl, m_dvcr; - UINT32 m_test_irq; + uint32_t m_delay; + uint32_t m_cpu_off; + uint32_t m_dvsr, m_dvdnth, m_dvdntl, m_dvcr; + uint32_t m_test_irq; struct { int irq_vector; @@ -179,19 +179,19 @@ private: int m_pcfsel; // last pcflush entry set int m_maxpcfsel; // highest valid pcflush entry - UINT32 m_pcflushes[16]; // pcflush entries + uint32_t m_pcflushes[16]; // pcflush entries - INT8 m_irq_line_state[17]; + int8_t m_irq_line_state[17]; protected: direct_read_data *m_direct; private: address_space *m_internal; - UINT32 m_m[0x200/4]; - INT8 m_nmi_line_state; + uint32_t m_m[0x200/4]; + int8_t m_nmi_line_state; - UINT16 m_frc; - UINT16 m_ocra, m_ocrb, m_icr; - UINT64 m_frc_base; + uint16_t m_frc; + uint16_t m_ocra, m_ocrb, m_icr; + uint64_t m_frc_base; int m_frt_input; int m_internal_irq_vector; @@ -199,17 +199,17 @@ private: emu_timer *m_timer; emu_timer *m_dma_current_active_timer[2]; int m_dma_timer_active[2]; - UINT8 m_dma_irq[2]; + uint8_t m_dma_irq[2]; int m_active_dma_incs[2]; int m_active_dma_incd[2]; int m_active_dma_size[2]; int m_active_dma_steal[2]; - UINT32 m_active_dma_src[2]; - UINT32 m_active_dma_dst[2]; - UINT32 m_active_dma_count[2]; - UINT16 m_wtcnt; - UINT8 m_wtcsr; + uint32_t m_active_dma_src[2]; + uint32_t m_active_dma_dst[2]; + uint32_t m_active_dma_count[2]; + uint16_t m_wtcnt; + uint8_t m_wtcsr; int m_is_slave, m_cpu_type; sh2_dma_kludge_delegate m_dma_kludge_cb; @@ -219,17 +219,17 @@ private: drc_cache m_cache; /* pointer to the DRC code cache */ std::unique_ptr m_drcuml; /* DRC UML generator state */ std::unique_ptr m_drcfe; /* pointer to the DRC front-end state */ - UINT32 m_drcoptions; /* configurable DRC options */ + uint32_t m_drcoptions; /* configurable DRC options */ internal_sh2_state *m_sh2_state; /* internal stuff */ - UINT8 m_cache_dirty; /* true if we need to flush the cache */ + uint8_t m_cache_dirty; /* true if we need to flush the cache */ /* parameters for subroutines */ - UINT64 m_numcycles; /* return value from gettotalcycles */ - UINT32 m_arg1; /* print_debug argument 2 */ - UINT32 m_irq; /* irq we're taking */ + uint64_t m_numcycles; /* return value from gettotalcycles */ + uint32_t m_arg1; /* print_debug argument 2 */ + uint32_t m_irq; /* irq we're taking */ /* register mappings */ uml::parameter m_regmap[16]; /* parameter to register mappings for all 16 integer registers */ @@ -247,182 +247,182 @@ private: uml::code_handle * m_out_of_cycles; /* out of cycles exception handler */ /* fast RAM */ - UINT32 m_fastram_select; + uint32_t m_fastram_select; struct { offs_t start; /* start of the RAM block */ offs_t end; /* end of the RAM block */ - UINT8 readonly; /* TRUE if read-only */ + uint8_t readonly; /* TRUE if read-only */ void * base; /* base in memory where the RAM lives */ } m_fastram[SH2_MAX_FASTRAM]; - UINT32 m_debugger_temp; - - inline UINT8 RB(offs_t A); - inline UINT16 RW(offs_t A); - inline UINT32 RL(offs_t A); - inline void WB(offs_t A, UINT8 V); - inline void WW(offs_t A, UINT16 V); - inline void WL(offs_t A, UINT32 V); - inline void ADD(UINT32 m, UINT32 n); - inline void ADDI(UINT32 i, UINT32 n); - inline void ADDC(UINT32 m, UINT32 n); - inline void ADDV(UINT32 m, UINT32 n); - inline void AND(UINT32 m, UINT32 n); - inline void ANDI(UINT32 i); - inline void ANDM(UINT32 i); - inline void BF(UINT32 d); - inline void BFS(UINT32 d); - inline void BRA(UINT32 d); - inline void BRAF(UINT32 m); - inline void BSR(UINT32 d); - inline void BSRF(UINT32 m); - inline void BT(UINT32 d); - inline void BTS(UINT32 d); + uint32_t m_debugger_temp; + + inline uint8_t RB(offs_t A); + inline uint16_t RW(offs_t A); + inline uint32_t RL(offs_t A); + inline void WB(offs_t A, uint8_t V); + inline void WW(offs_t A, uint16_t V); + inline void WL(offs_t A, uint32_t V); + inline void ADD(uint32_t m, uint32_t n); + inline void ADDI(uint32_t i, uint32_t n); + inline void ADDC(uint32_t m, uint32_t n); + inline void ADDV(uint32_t m, uint32_t n); + inline void AND(uint32_t m, uint32_t n); + inline void ANDI(uint32_t i); + inline void ANDM(uint32_t i); + inline void BF(uint32_t d); + inline void BFS(uint32_t d); + inline void BRA(uint32_t d); + inline void BRAF(uint32_t m); + inline void BSR(uint32_t d); + inline void BSRF(uint32_t m); + inline void BT(uint32_t d); + inline void BTS(uint32_t d); inline void CLRMAC(); inline void CLRT(); - inline void CMPEQ(UINT32 m, UINT32 n); - inline void CMPGE(UINT32 m, UINT32 n); - inline void CMPGT(UINT32 m, UINT32 n); - inline void CMPHI(UINT32 m, UINT32 n); - inline void CMPHS(UINT32 m, UINT32 n); - inline void CMPPL(UINT32 n); - inline void CMPPZ(UINT32 n); - inline void CMPSTR(UINT32 m, UINT32 n); - inline void CMPIM(UINT32 i); - inline void DIV0S(UINT32 m, UINT32 n); + inline void CMPEQ(uint32_t m, uint32_t n); + inline void CMPGE(uint32_t m, uint32_t n); + inline void CMPGT(uint32_t m, uint32_t n); + inline void CMPHI(uint32_t m, uint32_t n); + inline void CMPHS(uint32_t m, uint32_t n); + inline void CMPPL(uint32_t n); + inline void CMPPZ(uint32_t n); + inline void CMPSTR(uint32_t m, uint32_t n); + inline void CMPIM(uint32_t i); + inline void DIV0S(uint32_t m, uint32_t n); inline void DIV0U(); - inline void DIV1(UINT32 m, UINT32 n); - inline void DMULS(UINT32 m, UINT32 n); - inline void DMULU(UINT32 m, UINT32 n); - inline void DT(UINT32 n); - inline void EXTSB(UINT32 m, UINT32 n); - inline void EXTSW(UINT32 m, UINT32 n); - inline void EXTUB(UINT32 m, UINT32 n); - inline void EXTUW(UINT32 m, UINT32 n); + inline void DIV1(uint32_t m, uint32_t n); + inline void DMULS(uint32_t m, uint32_t n); + inline void DMULU(uint32_t m, uint32_t n); + inline void DT(uint32_t n); + inline void EXTSB(uint32_t m, uint32_t n); + inline void EXTSW(uint32_t m, uint32_t n); + inline void EXTUB(uint32_t m, uint32_t n); + inline void EXTUW(uint32_t m, uint32_t n); inline void ILLEGAL(); - inline void JMP(UINT32 m); - inline void JSR(UINT32 m); - inline void LDCSR(UINT32 m); - inline void LDCGBR(UINT32 m); - inline void LDCVBR(UINT32 m); - inline void LDCMSR(UINT32 m); - inline void LDCMGBR(UINT32 m); - inline void LDCMVBR(UINT32 m); - inline void LDSMACH(UINT32 m); - inline void LDSMACL(UINT32 m); - inline void LDSPR(UINT32 m); - inline void LDSMMACH(UINT32 m); - inline void LDSMMACL(UINT32 m); - inline void LDSMPR(UINT32 m); - inline void MAC_L(UINT32 m, UINT32 n); - inline void MAC_W(UINT32 m, UINT32 n); - inline void MOV(UINT32 m, UINT32 n); - inline void MOVBS(UINT32 m, UINT32 n); - inline void MOVWS(UINT32 m, UINT32 n); - inline void MOVLS(UINT32 m, UINT32 n); - inline void MOVBL(UINT32 m, UINT32 n); - inline void MOVWL(UINT32 m, UINT32 n); - inline void MOVLL(UINT32 m, UINT32 n); - inline void MOVBM(UINT32 m, UINT32 n); - inline void MOVWM(UINT32 m, UINT32 n); - inline void MOVLM(UINT32 m, UINT32 n); - inline void MOVBP(UINT32 m, UINT32 n); - inline void MOVWP(UINT32 m, UINT32 n); - inline void MOVLP(UINT32 m, UINT32 n); - inline void MOVBS0(UINT32 m, UINT32 n); - inline void MOVWS0(UINT32 m, UINT32 n); - inline void MOVLS0(UINT32 m, UINT32 n); - inline void MOVBL0(UINT32 m, UINT32 n); - inline void MOVWL0(UINT32 m, UINT32 n); - inline void MOVLL0(UINT32 m, UINT32 n); - inline void MOVI(UINT32 i, UINT32 n); - inline void MOVWI(UINT32 d, UINT32 n); - inline void MOVLI(UINT32 d, UINT32 n); - inline void MOVBLG(UINT32 d); - inline void MOVWLG(UINT32 d); - inline void MOVLLG(UINT32 d); - inline void MOVBSG(UINT32 d); - inline void MOVWSG(UINT32 d); - inline void MOVLSG(UINT32 d); - inline void MOVBS4(UINT32 d, UINT32 n); - inline void MOVWS4(UINT32 d, UINT32 n); - inline void MOVLS4(UINT32 m, UINT32 d, UINT32 n); - inline void MOVBL4(UINT32 m, UINT32 d); - inline void MOVWL4(UINT32 m, UINT32 d); - inline void MOVLL4(UINT32 m, UINT32 d, UINT32 n); - inline void MOVA(UINT32 d); - inline void MOVT(UINT32 n); - inline void MULL(UINT32 m, UINT32 n); - inline void MULS(UINT32 m, UINT32 n); - inline void MULU(UINT32 m, UINT32 n); - inline void NEG(UINT32 m, UINT32 n); - inline void NEGC(UINT32 m, UINT32 n); + inline void JMP(uint32_t m); + inline void JSR(uint32_t m); + inline void LDCSR(uint32_t m); + inline void LDCGBR(uint32_t m); + inline void LDCVBR(uint32_t m); + inline void LDCMSR(uint32_t m); + inline void LDCMGBR(uint32_t m); + inline void LDCMVBR(uint32_t m); + inline void LDSMACH(uint32_t m); + inline void LDSMACL(uint32_t m); + inline void LDSPR(uint32_t m); + inline void LDSMMACH(uint32_t m); + inline void LDSMMACL(uint32_t m); + inline void LDSMPR(uint32_t m); + inline void MAC_L(uint32_t m, uint32_t n); + inline void MAC_W(uint32_t m, uint32_t n); + inline void MOV(uint32_t m, uint32_t n); + inline void MOVBS(uint32_t m, uint32_t n); + inline void MOVWS(uint32_t m, uint32_t n); + inline void MOVLS(uint32_t m, uint32_t n); + inline void MOVBL(uint32_t m, uint32_t n); + inline void MOVWL(uint32_t m, uint32_t n); + inline void MOVLL(uint32_t m, uint32_t n); + inline void MOVBM(uint32_t m, uint32_t n); + inline void MOVWM(uint32_t m, uint32_t n); + inline void MOVLM(uint32_t m, uint32_t n); + inline void MOVBP(uint32_t m, uint32_t n); + inline void MOVWP(uint32_t m, uint32_t n); + inline void MOVLP(uint32_t m, uint32_t n); + inline void MOVBS0(uint32_t m, uint32_t n); + inline void MOVWS0(uint32_t m, uint32_t n); + inline void MOVLS0(uint32_t m, uint32_t n); + inline void MOVBL0(uint32_t m, uint32_t n); + inline void MOVWL0(uint32_t m, uint32_t n); + inline void MOVLL0(uint32_t m, uint32_t n); + inline void MOVI(uint32_t i, uint32_t n); + inline void MOVWI(uint32_t d, uint32_t n); + inline void MOVLI(uint32_t d, uint32_t n); + inline void MOVBLG(uint32_t d); + inline void MOVWLG(uint32_t d); + inline void MOVLLG(uint32_t d); + inline void MOVBSG(uint32_t d); + inline void MOVWSG(uint32_t d); + inline void MOVLSG(uint32_t d); + inline void MOVBS4(uint32_t d, uint32_t n); + inline void MOVWS4(uint32_t d, uint32_t n); + inline void MOVLS4(uint32_t m, uint32_t d, uint32_t n); + inline void MOVBL4(uint32_t m, uint32_t d); + inline void MOVWL4(uint32_t m, uint32_t d); + inline void MOVLL4(uint32_t m, uint32_t d, uint32_t n); + inline void MOVA(uint32_t d); + inline void MOVT(uint32_t n); + inline void MULL(uint32_t m, uint32_t n); + inline void MULS(uint32_t m, uint32_t n); + inline void MULU(uint32_t m, uint32_t n); + inline void NEG(uint32_t m, uint32_t n); + inline void NEGC(uint32_t m, uint32_t n); inline void NOP(void); - inline void NOT(UINT32 m, UINT32 n); - inline void OR(UINT32 m, UINT32 n); - inline void ORI(UINT32 i); - inline void ORM(UINT32 i); - inline void ROTCL(UINT32 n); - inline void ROTCR(UINT32 n); - inline void ROTL(UINT32 n); - inline void ROTR(UINT32 n); + inline void NOT(uint32_t m, uint32_t n); + inline void OR(uint32_t m, uint32_t n); + inline void ORI(uint32_t i); + inline void ORM(uint32_t i); + inline void ROTCL(uint32_t n); + inline void ROTCR(uint32_t n); + inline void ROTL(uint32_t n); + inline void ROTR(uint32_t n); inline void RTE(); inline void RTS(); inline void SETT(); - inline void SHAL(UINT32 n); - inline void SHAR(UINT32 n); - inline void SHLL(UINT32 n); - inline void SHLL2(UINT32 n); - inline void SHLL8(UINT32 n); - inline void SHLL16(UINT32 n); - inline void SHLR(UINT32 n); - inline void SHLR2(UINT32 n); - inline void SHLR8(UINT32 n); - inline void SHLR16(UINT32 n); + inline void SHAL(uint32_t n); + inline void SHAR(uint32_t n); + inline void SHLL(uint32_t n); + inline void SHLL2(uint32_t n); + inline void SHLL8(uint32_t n); + inline void SHLL16(uint32_t n); + inline void SHLR(uint32_t n); + inline void SHLR2(uint32_t n); + inline void SHLR8(uint32_t n); + inline void SHLR16(uint32_t n); inline void SLEEP(); - inline void STCSR(UINT32 n); - inline void STCGBR(UINT32 n); - inline void STCVBR(UINT32 n); - inline void STCMSR(UINT32 n); - inline void STCMGBR(UINT32 n); - inline void STCMVBR(UINT32 n); - inline void STSMACH(UINT32 n); - inline void STSMACL(UINT32 n); - inline void STSPR(UINT32 n); - inline void STSMMACH(UINT32 n); - inline void STSMMACL(UINT32 n); - inline void STSMPR(UINT32 n); - inline void SUB(UINT32 m, UINT32 n); - inline void SUBC(UINT32 m, UINT32 n); - inline void SUBV(UINT32 m, UINT32 n); - inline void SWAPB(UINT32 m, UINT32 n); - inline void SWAPW(UINT32 m, UINT32 n); - inline void TAS(UINT32 n); - inline void TRAPA(UINT32 i); - inline void TST(UINT32 m, UINT32 n); - inline void TSTI(UINT32 i); - inline void TSTM(UINT32 i); - inline void XOR(UINT32 m, UINT32 n); - inline void XORI(UINT32 i); - inline void XORM(UINT32 i); - inline void XTRCT(UINT32 m, UINT32 n); - inline void op0000(UINT16 opcode); - inline void op0001(UINT16 opcode); - inline void op0010(UINT16 opcode); - inline void op0011(UINT16 opcode); - inline void op0100(UINT16 opcode); - inline void op0101(UINT16 opcode); - inline void op0110(UINT16 opcode); - inline void op0111(UINT16 opcode); - inline void op1000(UINT16 opcode); - inline void op1001(UINT16 opcode); - inline void op1010(UINT16 opcode); - inline void op1011(UINT16 opcode); - inline void op1100(UINT16 opcode); - inline void op1101(UINT16 opcode); - inline void op1110(UINT16 opcode); - inline void op1111(UINT16 opcode); + inline void STCSR(uint32_t n); + inline void STCGBR(uint32_t n); + inline void STCVBR(uint32_t n); + inline void STCMSR(uint32_t n); + inline void STCMGBR(uint32_t n); + inline void STCMVBR(uint32_t n); + inline void STSMACH(uint32_t n); + inline void STSMACL(uint32_t n); + inline void STSPR(uint32_t n); + inline void STSMMACH(uint32_t n); + inline void STSMMACL(uint32_t n); + inline void STSMPR(uint32_t n); + inline void SUB(uint32_t m, uint32_t n); + inline void SUBC(uint32_t m, uint32_t n); + inline void SUBV(uint32_t m, uint32_t n); + inline void SWAPB(uint32_t m, uint32_t n); + inline void SWAPW(uint32_t m, uint32_t n); + inline void TAS(uint32_t n); + inline void TRAPA(uint32_t i); + inline void TST(uint32_t m, uint32_t n); + inline void TSTI(uint32_t i); + inline void TSTM(uint32_t i); + inline void XOR(uint32_t m, uint32_t n); + inline void XORI(uint32_t i); + inline void XORM(uint32_t i); + inline void XTRCT(uint32_t m, uint32_t n); + inline void op0000(uint16_t opcode); + inline void op0001(uint16_t opcode); + inline void op0010(uint16_t opcode); + inline void op0011(uint16_t opcode); + inline void op0100(uint16_t opcode); + inline void op0101(uint16_t opcode); + inline void op0110(uint16_t opcode); + inline void op0111(uint16_t opcode); + inline void op1000(uint16_t opcode); + inline void op1001(uint16_t opcode); + inline void op1010(uint16_t opcode); + inline void op1011(uint16_t opcode); + inline void op1100(uint16_t opcode); + inline void op1101(uint16_t opcode); + inline void op1110(uint16_t opcode); + inline void op1111(uint16_t opcode); TIMER_CALLBACK_MEMBER( sh2_timer_callback ); TIMER_CALLBACK_MEMBER( sh2_dma_current_active_callback ); void sh2_timer_resync(); @@ -435,39 +435,39 @@ private: /* internal compiler state */ struct compiler_state { - UINT32 cycles; /* accumulated cycles */ - UINT8 checkints; /* need to check interrupts before next instruction */ + uint32_t cycles; /* accumulated cycles */ + uint8_t checkints; /* need to check interrupts before next instruction */ uml::code_label labelnum; /* index for local labels */ }; - inline UINT32 epc(const opcode_desc *desc); + inline uint32_t epc(const opcode_desc *desc); inline void alloc_handle(drcuml_state *drcuml, uml::code_handle **handleptr, const char *name); inline void load_fast_iregs(drcuml_block *block); inline void save_fast_iregs(drcuml_block *block); void code_flush_cache(); void execute_run_drc(); - void code_compile_block(UINT8 mode, offs_t pc); + void code_compile_block(uint8_t mode, offs_t pc); void static_generate_entry_point(); void static_generate_nocode_handler(); void static_generate_out_of_cycles(); void static_generate_memory_accessor(int size, int iswrite, const char *name, uml::code_handle **handleptr); - const char *log_desc_flags_to_string(UINT32 flags); - void log_register_list(drcuml_state *drcuml, const char *string, const UINT32 *reglist, const UINT32 *regnostarlist); + const char *log_desc_flags_to_string(uint32_t flags); + void log_register_list(drcuml_state *drcuml, const char *string, const uint32_t *reglist, const uint32_t *regnostarlist); void log_opcode_desc(drcuml_state *drcuml, const opcode_desc *desclist, int indent); - void log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 op); + void log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint32_t op); void generate_update_cycles(drcuml_block *block, compiler_state *compiler, uml::parameter param, int allow_exception); void generate_checksum_block(drcuml_block *block, compiler_state *compiler, const opcode_desc *seqhead, const opcode_desc *seqlast); - void generate_sequence_instruction(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 ovrpc); - void generate_delay_slot(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 ovrpc); - int generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 ovrpc); - int generate_group_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc); - int generate_group_2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc); - int generate_group_3(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, UINT32 ovrpc); - int generate_group_4(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc); - int generate_group_6(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc); - int generate_group_8(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc); - int generate_group_12(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc); + void generate_sequence_instruction(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t ovrpc); + void generate_delay_slot(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t ovrpc); + int generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t ovrpc); + int generate_group_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc); + int generate_group_2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc); + int generate_group_3(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, uint32_t ovrpc); + int generate_group_4(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc); + int generate_group_6(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc); + int generate_group_8(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc); + int generate_group_12(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc); public: void func_printf_probe(); @@ -484,7 +484,7 @@ class sh2a_device : public sh2_device { public: // construction/destruction - sh2a_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + sh2a_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); DECLARE_READ32_MEMBER(dma_sar0_r); DECLARE_WRITE32_MEMBER(dma_sar0_w); @@ -501,15 +501,15 @@ public: void sh7032_dma_exec(int ch); private: - UINT16 m_sh7021_regs[0x200]; + uint16_t m_sh7021_regs[0x200]; struct { - UINT32 sar; /**< Source Address Register */ - UINT32 dar; /**< Destination Address Register */ - UINT16 tcr; /**< Transfer Count Register */ - UINT16 chcr; /**< Channel Control Register */ + uint32_t sar; /**< Source Address Register */ + uint32_t dar; /**< Destination Address Register */ + uint16_t tcr; /**< Transfer Count Register */ + uint16_t chcr; /**< Channel Control Register */ } m_dma[4]; - UINT16 m_dmaor; /**< DMA Operation Register (status flags) */ + uint16_t m_dmaor; /**< DMA Operation Register (status flags) */ }; @@ -517,31 +517,31 @@ class sh1_device : public sh2_device { public: // construction/destruction - sh1_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + sh1_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); DECLARE_READ16_MEMBER(sh7032_r); DECLARE_WRITE16_MEMBER(sh7032_w); private: - UINT16 m_sh7032_regs[0x200]; + uint16_t m_sh7032_regs[0x200]; }; class sh2_frontend : public drc_frontend { public: - sh2_frontend(sh2_device *device, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); + sh2_frontend(sh2_device *device, uint32_t window_start, uint32_t window_end, uint32_t max_sequence); protected: virtual bool describe(opcode_desc &desc, const opcode_desc *prev) override; private: - bool describe_group_0(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_2(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_3(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_4(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_6(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_8(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_12(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); + bool describe_group_0(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_2(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_3(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_4(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_6(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_8(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_12(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); sh2_device *m_sh2; }; diff --git a/src/devices/cpu/sh2/sh2comn.cpp b/src/devices/cpu/sh2/sh2comn.cpp index b5d8e43aaa3..a3a15262490 100644 --- a/src/devices/cpu/sh2/sh2comn.cpp +++ b/src/devices/cpu/sh2/sh2comn.cpp @@ -23,8 +23,8 @@ static const int div_tab[4] = { 3, 5, 7, 0 }; void sh2_device::sh2_timer_resync() { int divider = div_tab[(m_m[5] >> 8) & 3]; - UINT64 cur_time = total_cycles(); - UINT64 add = (cur_time - m_frc_base) >> divider; + uint64_t cur_time = total_cycles(); + uint64_t add = (cur_time - m_frc_base) >> divider; if (add > 0) { @@ -38,19 +38,19 @@ void sh2_device::sh2_timer_resync() void sh2_device::sh2_timer_activate() { int max_delta = 0xfffff; - UINT16 frc; + uint16_t frc; m_timer->adjust(attotime::never); frc = m_frc; if(!(m_m[4] & OCFA)) { - UINT16 delta = m_ocra - frc; + uint16_t delta = m_ocra - frc; if(delta < max_delta) max_delta = delta; } if(!(m_m[4] & OCFB) && (m_ocra <= m_ocrb || !(m_m[4] & 0x010000))) { - UINT16 delta = m_ocrb - frc; + uint16_t delta = m_ocrb - frc; if(delta < max_delta) max_delta = delta; } @@ -75,7 +75,7 @@ void sh2_device::sh2_timer_activate() TIMER_CALLBACK_MEMBER( sh2_device::sh2_timer_callback ) { - UINT16 frc; + uint16_t frc; sh2_timer_resync(); @@ -144,9 +144,9 @@ void sh2_device::sh2_notify_dma_data_available() void sh2_device::sh2_do_dma(int dma) { - UINT32 dmadata; + uint32_t dmadata; - UINT32 tempsrc, tempdst; + uint32_t tempsrc, tempdst; if (m_active_dma_count[dma] > 0) { @@ -465,7 +465,7 @@ void sh2_device::sh2_dmac_check(int dma) WRITE32_MEMBER( sh2_device::sh7604_w ) { - UINT32 old; + uint32_t old; old = m_m[offset]; COMBINE_DATA(m_m+offset); @@ -582,8 +582,8 @@ WRITE32_MEMBER( sh2_device::sh7604_w ) break; case 0x41: // DVDNT { - INT32 a = m_m[0x41]; - INT32 b = m_m[0x40]; + int32_t a = m_m[0x41]; + int32_t b = m_m[0x40]; LOG(("SH2 '%s' div+mod %d/%d\n", tag(), a, b)); if (b) { @@ -610,13 +610,13 @@ WRITE32_MEMBER( sh2_device::sh7604_w ) break; case 0x45: // DVDNTL { - INT64 a = m_m[0x45] | ((UINT64)(m_m[0x44]) << 32); - INT64 b = (INT32)m_m[0x40]; + int64_t a = m_m[0x45] | ((uint64_t)(m_m[0x44]) << 32); + int64_t b = (int32_t)m_m[0x40]; LOG(("SH2 '%s' div+mod %d/%d\n", tag(), a, b)); if (b) { - INT64 q = a / b; - if (q != (INT32)q) + int64_t q = a / b; + if (q != (int32_t)q) { m_m[0x42] |= 0x00010000; m_m[0x45] = 0x7fffffff; @@ -891,7 +891,7 @@ void sh2_device::sh2_exception(const char *message, int irqline) void sh2a_device::sh7032_dma_exec(int ch) { const short dma_word_size[4] = { 0, +1, -1, 0 }; - UINT8 rs = (m_dma[ch].chcr >> 8) & 0xf; /**< Resource Select bits */ + uint8_t rs = (m_dma[ch].chcr >> 8) & 0xf; /**< Resource Select bits */ if(rs != 0xc) // Auto-Request { logerror("Warning: SH7032 DMA enables non auto-request transfer\n"); @@ -903,14 +903,14 @@ void sh2a_device::sh7032_dma_exec(int ch) return; printf("%08x %08x %04x\n",m_dma[ch].sar,m_dma[ch].dar,m_dma[ch].chcr); - UINT8 dm = (m_dma[ch].chcr >> 14) & 3; /**< Destination Address Mode bits */ - UINT8 sm = (m_dma[ch].chcr >> 12) & 3; /**< Source Address Mode bits */ + uint8_t dm = (m_dma[ch].chcr >> 14) & 3; /**< Destination Address Mode bits */ + uint8_t sm = (m_dma[ch].chcr >> 12) & 3; /**< Source Address Mode bits */ bool ts = (m_dma[ch].chcr & 8); /**< Transfer Size bit */ int src_word_size = dma_word_size[sm] * ((ts == true) ? 2 : 1); int dst_word_size = dma_word_size[dm] * ((ts == true) ? 2 : 1); - UINT32 src_addr = m_dma[ch].sar; - UINT32 dst_addr = m_dma[ch].dar; - UINT32 size_index = m_dma[ch].tcr; + uint32_t src_addr = m_dma[ch].sar; + uint32_t dst_addr = m_dma[ch].dar; + uint32_t size_index = m_dma[ch].tcr; if(size_index == 0) size_index = 0x10000; diff --git a/src/devices/cpu/sh2/sh2dasm.cpp b/src/devices/cpu/sh2/sh2dasm.cpp index e37611b9d28..30cb8fdb98d 100644 --- a/src/devices/cpu/sh2/sh2dasm.cpp +++ b/src/devices/cpu/sh2/sh2dasm.cpp @@ -4,8 +4,8 @@ #include "debugger.h" #include "sh2.h" -#define SIGNX8(x) (((INT32)(x) << 24) >> 24) -#define SIGNX12(x) (((INT32)(x) << 20) >> 20) +#define SIGNX8(x) (((int32_t)(x) << 24) >> 24) +#define SIGNX12(x) (((int32_t)(x) << 20) >> 20) #define Rn ((opcode >> 8) & 15) #define Rm ((opcode >> 4) & 15) @@ -15,9 +15,9 @@ static const char *const regname[16] = { "R8", "R9", "R10","R11","R12","R13","R14","SP" }; -static UINT32 op0000(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0000(char *buffer, uint32_t pc, uint16_t opcode) { - UINT32 flags = 0; + uint32_t flags = 0; switch(opcode & 0x3f) { case 0x02: @@ -129,13 +129,13 @@ static UINT32 op0000(char *buffer, UINT32 pc, UINT16 opcode) return flags; } -static UINT32 op0001(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0001(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "MOV.L %s,@($%02X,%s)", regname[Rm], (opcode & 15) * 4, regname[Rn]); return 0; } -static UINT32 op0010(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0010(char *buffer, uint32_t pc, uint16_t opcode) { switch (opcode & 15) { @@ -191,7 +191,7 @@ static UINT32 op0010(char *buffer, UINT32 pc, UINT16 opcode) return 0; } -static UINT32 op0011(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0011(char *buffer, uint32_t pc, uint16_t opcode) { switch (opcode & 15) { @@ -247,9 +247,9 @@ static UINT32 op0011(char *buffer, UINT32 pc, UINT16 opcode) return 0; } -static UINT32 op0100(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0100(char *buffer, uint32_t pc, uint16_t opcode) { - UINT32 flags = 0; + uint32_t flags = 0; switch(opcode & 0x3F) { case 0x00: @@ -376,13 +376,13 @@ static UINT32 op0100(char *buffer, UINT32 pc, UINT16 opcode) return flags; } -static UINT32 op0101(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0101(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "MOV.L @($%02X,%s),%s", (opcode & 15) * 4, regname[Rm], regname[Rn]); return 0; } -static UINT32 op0110(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0110(char *buffer, uint32_t pc, uint16_t opcode) { switch(opcode & 0xF) @@ -439,13 +439,13 @@ static UINT32 op0110(char *buffer, UINT32 pc, UINT16 opcode) return 0; } -static UINT32 op0111(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0111(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "ADD #$%02X,%s", opcode & 0xff, regname[Rn]); return 0; } -static UINT32 op1000(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1000(char *buffer, uint32_t pc, uint16_t opcode) { switch((opcode >> 8) & 15) { @@ -482,27 +482,27 @@ static UINT32 op1000(char *buffer, UINT32 pc, UINT16 opcode) return 0; } -static UINT32 op1001(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1001(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "MOV.W @($%04X,PC),%s [%08X]", (opcode & 0xff) * 2, regname[Rn], pc+((opcode & 0xff) * 2)+2); return 0; } -static UINT32 op1010(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1010(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "BRA $%08X", SIGNX12(opcode & 0xfff) * 2 + pc + 2); return 0; } -static UINT32 op1011(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1011(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "BSR $%08X", SIGNX12(opcode & 0xfff) * 2 + pc + 2); return DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); } -static UINT32 op1100(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1100(char *buffer, uint32_t pc, uint16_t opcode) { - UINT32 flags = 0; + uint32_t flags = 0; switch((opcode >> 8) & 15) { case 0: @@ -558,27 +558,27 @@ static UINT32 op1100(char *buffer, UINT32 pc, UINT16 opcode) return flags; } -static UINT32 op1101(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1101(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "MOV.L @($%02X,PC),%s [%08X]", (opcode * 4) & 0xff, regname[Rn], ((pc + 2) & ~3) + (opcode & 0xff) * 4); return 0; } -static UINT32 op1110(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1110(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "MOV #$%02X,%s", (opcode & 0xff), regname[Rn]); return 0; } -static UINT32 op1111(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1111(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "unknown $%04X", opcode); return 0; } -unsigned DasmSH2(char *buffer, unsigned pc, UINT16 opcode) +unsigned DasmSH2(char *buffer, unsigned pc, uint16_t opcode) { - UINT32 flags; + uint32_t flags; pc += 2; diff --git a/src/devices/cpu/sh2/sh2drc.cpp b/src/devices/cpu/sh2/sh2drc.cpp index e7b2460198a..a77d48664e9 100644 --- a/src/devices/cpu/sh2/sh2drc.cpp +++ b/src/devices/cpu/sh2/sh2drc.cpp @@ -12,7 +12,7 @@ #include "sh2.h" #include "sh2comn.h" -extern unsigned DasmSH2(char *buffer, unsigned pc, UINT16 opcode); +extern unsigned DasmSH2(char *buffer, unsigned pc, uint16_t opcode); using namespace uml; @@ -62,7 +62,7 @@ using namespace uml; descriptor -------------------------------------------------*/ -UINT32 sh2_device::epc(const opcode_desc *desc) +uint32_t sh2_device::epc(const opcode_desc *desc) { return (desc->flags & OPFLAG_IN_DELAY_SLOT) ? (desc->pc - 1) : desc->pc; } @@ -127,36 +127,36 @@ static void cfunc_printf_probe(void *param) void sh2_device::func_printf_probe() { - UINT32 pc = m_sh2_state->pc; + uint32_t pc = m_sh2_state->pc; printf(" PC=%08X r0=%08X r1=%08X r2=%08X\n", pc, - (UINT32)m_sh2_state->r[0], - (UINT32)m_sh2_state->r[1], - (UINT32)m_sh2_state->r[2]); + (uint32_t)m_sh2_state->r[0], + (uint32_t)m_sh2_state->r[1], + (uint32_t)m_sh2_state->r[2]); printf(" r3=%08X r4=%08X r5=%08X r6=%08X\n", - (UINT32)m_sh2_state->r[3], - (UINT32)m_sh2_state->r[4], - (UINT32)m_sh2_state->r[5], - (UINT32)m_sh2_state->r[6]); + (uint32_t)m_sh2_state->r[3], + (uint32_t)m_sh2_state->r[4], + (uint32_t)m_sh2_state->r[5], + (uint32_t)m_sh2_state->r[6]); printf(" r7=%08X r8=%08X r9=%08X r10=%08X\n", - (UINT32)m_sh2_state->r[7], - (UINT32)m_sh2_state->r[8], - (UINT32)m_sh2_state->r[9], - (UINT32)m_sh2_state->r[10]); + (uint32_t)m_sh2_state->r[7], + (uint32_t)m_sh2_state->r[8], + (uint32_t)m_sh2_state->r[9], + (uint32_t)m_sh2_state->r[10]); printf(" r11=%08X r12=%08X r13=%08X r14=%08X\n", - (UINT32)m_sh2_state->r[11], - (UINT32)m_sh2_state->r[12], - (UINT32)m_sh2_state->r[13], - (UINT32)m_sh2_state->r[14]); + (uint32_t)m_sh2_state->r[11], + (uint32_t)m_sh2_state->r[12], + (uint32_t)m_sh2_state->r[13], + (uint32_t)m_sh2_state->r[14]); printf(" r15=%08X macl=%08X mach=%08X gbr=%08X\n", - (UINT32)m_sh2_state->r[15], - (UINT32)m_sh2_state->macl, - (UINT32)m_sh2_state->mach, - (UINT32)m_sh2_state->gbr); + (uint32_t)m_sh2_state->r[15], + (uint32_t)m_sh2_state->macl, + (uint32_t)m_sh2_state->mach, + (uint32_t)m_sh2_state->gbr); printf(" evec %x irqsr %x pc=%08x\n", - (UINT32)m_sh2_state->evec, - (UINT32)m_sh2_state->irqsr, (UINT32)m_sh2_state->pc); + (uint32_t)m_sh2_state->evec, + (uint32_t)m_sh2_state->irqsr, (uint32_t)m_sh2_state->pc); } /*------------------------------------------------- @@ -202,9 +202,9 @@ static void cfunc_MAC_W(void *param) void sh2_device::func_MAC_W() { - INT32 tempm, tempn, dest, src, ans; - UINT32 templ; - UINT16 opcode; + int32_t tempm, tempn, dest, src, ans; + uint32_t templ; + uint16_t opcode; int n, m; // recover the opcode @@ -214,17 +214,17 @@ void sh2_device::func_MAC_W() n = Rn; m = Rm; - tempn = (INT32) RW( m_sh2_state->r[n] ); + tempn = (int32_t) RW( m_sh2_state->r[n] ); m_sh2_state->r[n] += 2; - tempm = (INT32) RW( m_sh2_state->r[m] ); + tempm = (int32_t) RW( m_sh2_state->r[m] ); m_sh2_state->r[m] += 2; templ = m_sh2_state->macl; - tempm = ((INT32) (short) tempn * (INT32) (short) tempm); - if ((INT32) m_sh2_state->macl >= 0) + tempm = ((int32_t) (short) tempn * (int32_t) (short) tempm); + if ((int32_t) m_sh2_state->macl >= 0) dest = 0; else dest = 1; - if ((INT32) tempm >= 0) + if ((int32_t) tempm >= 0) { src = 0; tempn = 0; @@ -236,7 +236,7 @@ void sh2_device::func_MAC_W() } src += dest; m_sh2_state->macl += tempm; - if ((INT32) m_sh2_state->macl >= 0) + if ((int32_t) m_sh2_state->macl >= 0) ans = 0; else ans = 1; @@ -289,10 +289,10 @@ static void cfunc_MAC_L(void *param) void sh2_device::func_MAC_L() { - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; - INT32 tempm, tempn, fnLmL; - UINT16 opcode; + uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2; + uint32_t temp0, temp1, temp2, temp3; + int32_t tempm, tempn, fnLmL; + uint16_t opcode; int n, m; // recover the opcode @@ -302,11 +302,11 @@ void sh2_device::func_MAC_L() n = Rn; m = Rm; - tempn = (INT32) RL( m_sh2_state->r[n] ); + tempn = (int32_t) RL( m_sh2_state->r[n] ); m_sh2_state->r[n] += 4; - tempm = (INT32) RL( m_sh2_state->r[m] ); + tempm = (int32_t) RL( m_sh2_state->r[m] ); m_sh2_state->r[m] += 4; - if ((INT32) (tempn ^ tempm) < 0) + if ((int32_t) (tempn ^ tempm) < 0) fnLmL = -1; else fnLmL = 0; @@ -314,8 +314,8 @@ void sh2_device::func_MAC_L() tempn = 0 - tempn; if (tempm < 0) tempm = 0 - tempm; - temp1 = (UINT32) tempn; - temp2 = (UINT32) tempm; + temp1 = (uint32_t) tempn; + temp2 = (uint32_t) tempm; RnL = temp1 & 0x0000ffff; RnH = (temp1 >> 16) & 0x0000ffff; RmL = temp2 & 0x0000ffff; @@ -347,12 +347,12 @@ void sh2_device::func_MAC_L() if (m_sh2_state->macl > Res0) Res2++; Res2 += (m_sh2_state->mach & 0x0000ffff); - if (((INT32) Res2 < 0) && (Res2 < 0xffff8000)) + if (((int32_t) Res2 < 0) && (Res2 < 0xffff8000)) { Res2 = 0x00008000; Res0 = 0x00000000; } - else if (((INT32) Res2 > 0) && (Res2 > 0x00007fff)) + else if (((int32_t) Res2 > 0) && (Res2 > 0x00007fff)) { Res2 = 0x00007fff; Res0 = 0xffffffff; @@ -381,9 +381,9 @@ static void cfunc_DIV1(void *param) void sh2_device::func_DIV1() { - UINT32 tmp0; - UINT32 old_q; - UINT16 opcode; + uint32_t tmp0; + uint32_t old_q; + uint16_t opcode; int n, m; // recover the opcode @@ -490,8 +490,8 @@ static void cfunc_ADDV(void *param) void sh2_device::func_ADDV() { - INT32 dest, src, ans; - UINT16 opcode; + int32_t dest, src, ans; + uint16_t opcode; int n, m; // recover the opcode @@ -501,17 +501,17 @@ void sh2_device::func_ADDV() n = Rn; m = Rm; - if ((INT32) m_sh2_state->r[n] >= 0) + if ((int32_t) m_sh2_state->r[n] >= 0) dest = 0; else dest = 1; - if ((INT32) m_sh2_state->r[m] >= 0) + if ((int32_t) m_sh2_state->r[m] >= 0) src = 0; else src = 1; src += dest; m_sh2_state->r[n] += m_sh2_state->r[m]; - if ((INT32) m_sh2_state->r[n] >= 0) + if ((int32_t) m_sh2_state->r[n] >= 0) ans = 0; else ans = 1; @@ -537,8 +537,8 @@ static void cfunc_SUBV(void *param) void sh2_device::func_SUBV() { - INT32 dest, src, ans; - UINT16 opcode; + int32_t dest, src, ans; + uint16_t opcode; int n, m; // recover the opcode @@ -548,17 +548,17 @@ void sh2_device::func_SUBV() n = Rn; m = Rm; - if ((INT32) m_sh2_state->r[n] >= 0) + if ((int32_t) m_sh2_state->r[n] >= 0) dest = 0; else dest = 1; - if ((INT32) m_sh2_state->r[m] >= 0) + if ((int32_t) m_sh2_state->r[m] >= 0) src = 0; else src = 1; src += dest; m_sh2_state->r[n] -= m_sh2_state->r[m]; - if ((INT32) m_sh2_state->r[n] >= 0) + if ((int32_t) m_sh2_state->r[n] >= 0) ans = 0; else ans = 1; @@ -662,7 +662,7 @@ void sh2_device::execute_run_drc() given mode at the specified pc -------------------------------------------------*/ -void sh2_device::code_compile_block(UINT8 mode, offs_t pc) +void sh2_device::code_compile_block(uint8_t mode, offs_t pc) { drcuml_state *drcuml = m_drcuml.get(); compiler_state compiler = { 0 }; @@ -690,7 +690,7 @@ void sh2_device::code_compile_block(UINT8 mode, offs_t pc) for (seqhead = desclist; seqhead != nullptr; seqhead = seqlast->next()) { const opcode_desc *curdesc; - UINT32 nextpc; + uint32_t nextpc; /* add a code log entry */ if (drcuml->logging()) @@ -938,8 +938,8 @@ void sh2_device::static_generate_memory_accessor(int size, int iswrite, const ch { if (elem.base != nullptr && (!iswrite || !elem.readonly)) { - void *fastbase = (UINT8 *)elem.base - elem.start; - UINT32 skip = label++; + void *fastbase = (uint8_t *)elem.base - elem.start; + uint32_t skip = label++; if (elem.end != 0xffffffff) { UML_CMP(block, I0, elem.end); // cmp i0,end @@ -1038,7 +1038,7 @@ void sh2_device::static_generate_memory_accessor(int size, int iswrite, const ch flags -------------------------------------------------*/ -const char *sh2_device::log_desc_flags_to_string(UINT32 flags) +const char *sh2_device::log_desc_flags_to_string(uint32_t flags) { static char tempbuf[30]; char *dest = tempbuf; @@ -1092,7 +1092,7 @@ const char *sh2_device::log_desc_flags_to_string(UINT32 flags) log_register_list - log a list of GPR registers -------------------------------------------------*/ -void sh2_device::log_register_list(drcuml_state *drcuml, const char *string, const UINT32 *reglist, const UINT32 *regnostarlist) +void sh2_device::log_register_list(drcuml_state *drcuml, const char *string, const uint32_t *reglist, const uint32_t *regnostarlist) { int count = 0; int regnum; @@ -1205,7 +1205,7 @@ void sh2_device::log_opcode_desc(drcuml_state *drcuml, const opcode_desc *descli including disassembly of an SH2 instruction -------------------------------------------------*/ -void sh2_device::log_add_disasm_comment(drcuml_block *block, UINT32 pc, UINT32 op) +void sh2_device::log_add_disasm_comment(drcuml_block *block, uint32_t pc, uint32_t op) { if (m_drcuml->logging()) { @@ -1329,7 +1329,7 @@ void sh2_device::generate_checksum_block(drcuml_block *block, compiler_state *co UML_EXHc(block, COND_NE, *m_nocode, epc(seqhead)); // exne nocode,seqhead->pc } #else - UINT32 sum = 0; + uint32_t sum = 0; void *base = m_direct->read_ptr(seqhead->physpc, SH2_CODE_XOR(0)); UML_LOAD(block, I0, base, 0, SIZE_WORD, SCALE_x4); // load i0,base,word sum += seqhead->opptr.w[0]; @@ -1353,7 +1353,7 @@ void sh2_device::generate_checksum_block(drcuml_block *block, compiler_state *co for a single instruction in a sequence -------------------------------------------------*/ -void sh2_device::generate_sequence_instruction(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 ovrpc) +void sh2_device::generate_sequence_instruction(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t ovrpc) { offs_t expc; @@ -1438,7 +1438,7 @@ void sh2_device::generate_sequence_instruction(drcuml_block *block, compiler_sta generate_delay_slot ------------------------------------------------------------------*/ -void sh2_device::generate_delay_slot(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 ovrpc) +void sh2_device::generate_delay_slot(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t ovrpc) { compiler_state compiler_temp = *compiler; @@ -1455,12 +1455,12 @@ void sh2_device::generate_delay_slot(drcuml_block *block, compiler_state *compil opcode -------------------------------------------------*/ -int sh2_device::generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 ovrpc) +int sh2_device::generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t ovrpc) { - UINT32 scratch, scratch2; - INT32 disp; - UINT16 opcode = desc->opptr.w[0]; - UINT8 opswitch = opcode >> 12; + uint32_t scratch, scratch2; + int32_t disp; + uint16_t opcode = desc->opptr.w[0]; + uint8_t opswitch = opcode >> 12; int in_delay_slot = ((desc->flags & OPFLAG_IN_DELAY_SLOT) != 0); switch (opswitch) @@ -1502,7 +1502,7 @@ int sh2_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c case 7: // ADDI scratch = opcode & 0xff; - scratch2 = (UINT32)(INT32)(INT16)(INT8)scratch; + scratch2 = (uint32_t)(int32_t)(int16_t)(int8_t)scratch; UML_ADD(block, R32(Rn), R32(Rn), scratch2); // add Rn, Rn, scratch2 return TRUE; @@ -1528,7 +1528,7 @@ int sh2_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c } else { - scratch2 = (UINT32)(INT32)(INT16) RW(scratch); + scratch2 = (uint32_t)(int32_t)(int16_t) RW(scratch); UML_MOV(block, R32(Rn), scratch2); // mov Rn, scratch2 } @@ -1537,7 +1537,7 @@ int sh2_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return TRUE; case 10: // BRA - disp = ((INT32)opcode << 20) >> 20; + disp = ((int32_t)opcode << 20) >> 20; m_sh2_state->ea = (desc->pc + 2) + disp * 2 + 2; // m_sh2_state->ea = pc+4 + disp*2 + 2 generate_delay_slot(block, compiler, desc, m_sh2_state->ea-2); @@ -1551,7 +1551,7 @@ int sh2_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c // do this before running the delay slot UML_ADD(block, mem(&m_sh2_state->pr), desc->pc, 4); // add m_pr, desc->pc, #4 (skip the current insn & delay slot) - disp = ((INT32)opcode << 20) >> 20; + disp = ((int32_t)opcode << 20) >> 20; m_sh2_state->ea = (desc->pc + 2) + disp * 2 + 2; // m_sh2_state->ea = pc+4 + disp*2 + 2 generate_delay_slot(block, compiler, desc, m_sh2_state->ea-2); @@ -1591,7 +1591,7 @@ int sh2_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c case 14: // MOVI scratch = opcode & 0xff; - scratch2 = (UINT32)(INT32)(INT16)(INT8)scratch; + scratch2 = (uint32_t)(int32_t)(int16_t)(int8_t)scratch; UML_MOV(block, R32(Rn), scratch2); return TRUE; @@ -1602,7 +1602,7 @@ int sh2_device::generate_opcode(drcuml_block *block, compiler_state *compiler, c return FALSE; } -int sh2_device::generate_group_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc) +int sh2_device::generate_group_0(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc) { switch (opcode & 0x3F) { @@ -1849,7 +1849,7 @@ int sh2_device::generate_group_0(drcuml_block *block, compiler_state *compiler, return FALSE; } -int sh2_device::generate_group_2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc) +int sh2_device::generate_group_2(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc) { switch (opcode & 15) { @@ -2018,7 +2018,7 @@ int sh2_device::generate_group_2(drcuml_block *block, compiler_state *compiler, return FALSE; } -int sh2_device::generate_group_3(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, UINT32 ovrpc) +int sh2_device::generate_group_3(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, uint32_t ovrpc) { switch (opcode & 15) { @@ -2130,7 +2130,7 @@ int sh2_device::generate_group_3(drcuml_block *block, compiler_state *compiler, return FALSE; } -int sh2_device::generate_group_4(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc) +int sh2_device::generate_group_4(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc) { switch (opcode & 0x3F) { @@ -2495,7 +2495,7 @@ int sh2_device::generate_group_4(drcuml_block *block, compiler_state *compiler, return FALSE; } -int sh2_device::generate_group_6(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc) +int sh2_device::generate_group_6(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc) { switch (opcode & 15) { @@ -2625,10 +2625,10 @@ int sh2_device::generate_group_6(drcuml_block *block, compiler_state *compiler, return FALSE; } -int sh2_device::generate_group_8(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc) +int sh2_device::generate_group_8(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc) { - INT32 disp; - UINT32 udisp; + int32_t disp; + uint32_t udisp; code_label templabel; switch ( opcode & (15<<8) ) @@ -2701,7 +2701,7 @@ int sh2_device::generate_group_8(drcuml_block *block, compiler_state *compiler, UML_TEST(block, mem(&m_sh2_state->sr), T); // test m_sh2_state->sr, T UML_JMPc(block, COND_Z, compiler->labelnum); // jz compiler->labelnum - disp = ((INT32)opcode << 24) >> 24; + disp = ((int32_t)opcode << 24) >> 24; m_sh2_state->ea = (desc->pc + 2) + disp * 2 + 2; // m_sh2_state->ea = destination generate_update_cycles(block, compiler, m_sh2_state->ea, TRUE); // @@ -2714,7 +2714,7 @@ int sh2_device::generate_group_8(drcuml_block *block, compiler_state *compiler, UML_TEST(block, mem(&m_sh2_state->sr), T); // test m_sh2_state->sr, T UML_JMPc(block, COND_NZ, compiler->labelnum); // jnz compiler->labelnum - disp = ((INT32)opcode << 24) >> 24; + disp = ((int32_t)opcode << 24) >> 24; m_sh2_state->ea = (desc->pc + 2) + disp * 2 + 2; // m_sh2_state->ea = destination generate_update_cycles(block, compiler, m_sh2_state->ea, TRUE); // @@ -2729,7 +2729,7 @@ int sh2_device::generate_group_8(drcuml_block *block, compiler_state *compiler, UML_TEST(block, mem(&m_sh2_state->sr), T); // test m_sh2_state->sr, T UML_JMPc(block, COND_Z, compiler->labelnum); // jz compiler->labelnum - disp = ((INT32)opcode << 24) >> 24; + disp = ((int32_t)opcode << 24) >> 24; m_sh2_state->ea = (desc->pc + 2) + disp * 2 + 2; // m_sh2_state->ea = destination templabel = compiler->labelnum; // save our label @@ -2750,7 +2750,7 @@ int sh2_device::generate_group_8(drcuml_block *block, compiler_state *compiler, UML_TEST(block, mem(&m_sh2_state->sr), T); // test m_sh2_state->sr, T UML_JMPc(block, COND_NZ, compiler->labelnum); // jnz compiler->labelnum - disp = ((INT32)opcode << 24) >> 24; + disp = ((int32_t)opcode << 24) >> 24; m_sh2_state->ea = (desc->pc + 2) + disp * 2 + 2; // m_sh2_state->ea = destination templabel = compiler->labelnum; // save our label @@ -2769,9 +2769,9 @@ int sh2_device::generate_group_8(drcuml_block *block, compiler_state *compiler, return FALSE; } -int sh2_device::generate_group_12(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT16 opcode, int in_delay_slot, UINT32 ovrpc) +int sh2_device::generate_group_12(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint16_t opcode, int in_delay_slot, uint32_t ovrpc) { - UINT32 scratch; + uint32_t scratch; switch (opcode & (15<<8)) { @@ -2943,7 +2943,7 @@ int sh2_device::generate_group_12(drcuml_block *block, compiler_state *compiler, sh2drc_set_options - configure DRC options -------------------------------------------------*/ -void sh2_device::sh2drc_set_options(UINT32 options) +void sh2_device::sh2drc_set_options(uint32_t options) { if (!allow_drc()) return; m_drcoptions = options; @@ -2969,7 +2969,7 @@ void sh2_device::sh2drc_add_pcflush(offs_t address) region -------------------------------------------------*/ -void sh2_device::sh2drc_add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base) +void sh2_device::sh2drc_add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base) { if (m_fastram_select < ARRAY_LENGTH(m_fastram)) { diff --git a/src/devices/cpu/sh2/sh2fe.cpp b/src/devices/cpu/sh2/sh2fe.cpp index 8ea8ccb82d3..f6b409a0cd5 100644 --- a/src/devices/cpu/sh2/sh2fe.cpp +++ b/src/devices/cpu/sh2/sh2fe.cpp @@ -18,7 +18,7 @@ INSTRUCTION PARSERS ***************************************************************************/ -sh2_frontend::sh2_frontend(sh2_device *device, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) +sh2_frontend::sh2_frontend(sh2_device *device, uint32_t window_start, uint32_t window_end, uint32_t max_sequence) : drc_frontend(*device, window_start, window_end, max_sequence) , m_sh2(device) { @@ -31,7 +31,7 @@ sh2_frontend::sh2_frontend(sh2_device *device, UINT32 window_start, UINT32 windo bool sh2_frontend::describe(opcode_desc &desc, const opcode_desc *prev) { - UINT16 opcode; + uint16_t opcode; /* fetch the opcode */ opcode = desc.opptr.w[0] = m_sh2->m_direct->read_word(desc.physpc, SH2_CODE_XOR(0)); @@ -86,7 +86,7 @@ bool sh2_frontend::describe(opcode_desc &desc, const opcode_desc *prev) // (intentional fallthrough - BSR is BRA with the addition of PR = the return address) case 10: // BRA { - INT32 disp = ((INT32)opcode << 20) >> 20; + int32_t disp = ((int32_t)opcode << 20) >> 20; desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; desc.targetpc = (desc.pc + 2) + disp * 2 + 2; @@ -114,7 +114,7 @@ bool sh2_frontend::describe(opcode_desc &desc, const opcode_desc *prev) return false; } -bool sh2_frontend::describe_group_0(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode) +bool sh2_frontend::describe_group_0(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode) { switch (opcode & 0x3F) { @@ -283,7 +283,7 @@ bool sh2_frontend::describe_group_0(opcode_desc &desc, const opcode_desc *prev, return false; } -bool sh2_frontend::describe_group_2(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode) +bool sh2_frontend::describe_group_2(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode) { switch (opcode & 15) { @@ -331,7 +331,7 @@ bool sh2_frontend::describe_group_2(opcode_desc &desc, const opcode_desc *prev, return false; } -bool sh2_frontend::describe_group_3(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode) +bool sh2_frontend::describe_group_3(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode) { switch (opcode & 15) { @@ -380,7 +380,7 @@ bool sh2_frontend::describe_group_3(opcode_desc &desc, const opcode_desc *prev, return false; } -bool sh2_frontend::describe_group_4(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode) +bool sh2_frontend::describe_group_4(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode) { switch (opcode & 0x3F) { @@ -610,7 +610,7 @@ bool sh2_frontend::describe_group_4(opcode_desc &desc, const opcode_desc *prev, return false; } -bool sh2_frontend::describe_group_6(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode) +bool sh2_frontend::describe_group_6(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode) { switch (opcode & 15) { @@ -651,9 +651,9 @@ bool sh2_frontend::describe_group_6(opcode_desc &desc, const opcode_desc *prev, return false; } -bool sh2_frontend::describe_group_8(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode) +bool sh2_frontend::describe_group_8(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode) { - INT32 disp; + int32_t disp; switch ( opcode & (15<<8) ) { @@ -689,7 +689,7 @@ bool sh2_frontend::describe_group_8(opcode_desc &desc, const opcode_desc *prev, case 11<< 8: // BF(opcode & 0xff); desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; desc.cycles = 3; - disp = ((INT32)opcode << 24) >> 24; + disp = ((int32_t)opcode << 24) >> 24; desc.targetpc = (desc.pc + 2) + disp * 2 + 2; return true; @@ -697,7 +697,7 @@ bool sh2_frontend::describe_group_8(opcode_desc &desc, const opcode_desc *prev, case 15<< 8: // BFS(opcode & 0xff); desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; desc.cycles = 2; - disp = ((INT32)opcode << 24) >> 24; + disp = ((int32_t)opcode << 24) >> 24; desc.targetpc = (desc.pc + 2) + disp * 2 + 2; desc.delayslots = 1; return true; @@ -706,7 +706,7 @@ bool sh2_frontend::describe_group_8(opcode_desc &desc, const opcode_desc *prev, return false; } -bool sh2_frontend::describe_group_12(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode) +bool sh2_frontend::describe_group_12(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode) { switch (opcode & (15<<8)) { diff --git a/src/devices/cpu/sh2/sh7604_bus.cpp b/src/devices/cpu/sh2/sh7604_bus.cpp index 19b0df01740..aa170a7f23e 100644 --- a/src/devices/cpu/sh2/sh7604_bus.cpp +++ b/src/devices/cpu/sh2/sh7604_bus.cpp @@ -108,7 +108,7 @@ ADDRESS_MAP_END // sh7604_bus_device - constructor //------------------------------------------------- -sh7604_bus_device::sh7604_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sh7604_bus_device::sh7604_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SH7604_BUS, "sh7604_bus_longname", tag, owner, clock, "sh7604_bus", __FILE__), device_memory_interface(mconfig, *this), m_space_config("regs", ENDIANNESS_BIG, 16, 4, 0, nullptr, *ADDRESS_MAP_NAME(bus_regs)) diff --git a/src/devices/cpu/sh2/sh7604_bus.h b/src/devices/cpu/sh2/sh7604_bus.h index df796fa371f..0ad5c13e47d 100644 --- a/src/devices/cpu/sh2/sh7604_bus.h +++ b/src/devices/cpu/sh2/sh7604_bus.h @@ -31,7 +31,7 @@ class sh7604_bus_device : public device_t, { public: // construction/destruction - sh7604_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sh7604_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE32_MEMBER( write ); @@ -62,12 +62,12 @@ private: bool m_is_slave; const address_space_config m_space_config; - UINT16 m_bcr1; - UINT16 m_bcr2; - UINT16 m_wcr; - UINT16 m_mcr; - UINT16 m_rtcsr; - UINT16 m_rtcor; + uint16_t m_bcr1; + uint16_t m_bcr2; + uint16_t m_wcr; + uint16_t m_mcr; + uint16_t m_rtcsr; + uint16_t m_rtcor; }; diff --git a/src/devices/cpu/sh2/sh7604_sci.cpp b/src/devices/cpu/sh2/sh7604_sci.cpp index 21b06b7bc7c..6d50707e6f1 100644 --- a/src/devices/cpu/sh2/sh7604_sci.cpp +++ b/src/devices/cpu/sh2/sh7604_sci.cpp @@ -112,7 +112,7 @@ ADDRESS_MAP_END // sh7604_sci_device - constructor //------------------------------------------------- -sh7604_sci_device::sh7604_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sh7604_sci_device::sh7604_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SH7604_SCI, "sh7604_sci_longname", tag, owner, clock, "sh7604_sci", __FILE__), device_memory_interface(mconfig, *this), m_space_config("regs", ENDIANNESS_BIG, 8, 4, 0, nullptr, *ADDRESS_MAP_NAME(sci_regs)) diff --git a/src/devices/cpu/sh2/sh7604_sci.h b/src/devices/cpu/sh2/sh7604_sci.h index 66e364f0cfe..2969ed1f88d 100644 --- a/src/devices/cpu/sh2/sh7604_sci.h +++ b/src/devices/cpu/sh2/sh7604_sci.h @@ -42,7 +42,7 @@ class sh7604_sci_device : public device_t, { public: // construction/destruction - sh7604_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sh7604_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE8_MEMBER( write ); @@ -69,10 +69,10 @@ protected: virtual void device_reset() override; private: const address_space_config m_space_config; - UINT8 m_smr; - UINT8 m_scr; - UINT8 m_ssr; - UINT8 m_brr; + uint8_t m_smr; + uint8_t m_scr; + uint8_t m_ssr; + uint8_t m_brr; }; diff --git a/src/devices/cpu/sh2/sh7604_wdt.cpp b/src/devices/cpu/sh2/sh7604_wdt.cpp index 722a7d59db2..9222a8c88cf 100644 --- a/src/devices/cpu/sh2/sh7604_wdt.cpp +++ b/src/devices/cpu/sh2/sh7604_wdt.cpp @@ -38,7 +38,7 @@ ADDRESS_MAP_END // sh7604_wdt_device - constructor //------------------------------------------------- -sh7604_wdt_device::sh7604_wdt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sh7604_wdt_device::sh7604_wdt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SH7604_WDT, "sh7604_wdt_longname", tag, owner, clock, "sh7604_wdt", __FILE__), device_memory_interface(mconfig, *this), m_space_config("regs", ENDIANNESS_BIG, 8, 4, 0, nullptr, *ADDRESS_MAP_NAME(wdt_regs)) @@ -76,7 +76,7 @@ READ8_MEMBER( sh7604_wdt_device::read ) WRITE16_MEMBER( sh7604_wdt_device::write ) { - UINT8 id_param = data >> 8; + uint8_t id_param = data >> 8; switch(id_param) { case 0xa5: space.write_byte(offset*2+0,data & 0xff); break; diff --git a/src/devices/cpu/sh2/sh7604_wdt.h b/src/devices/cpu/sh2/sh7604_wdt.h index e9d69f00227..e77dd9e37d6 100644 --- a/src/devices/cpu/sh2/sh7604_wdt.h +++ b/src/devices/cpu/sh2/sh7604_wdt.h @@ -31,7 +31,7 @@ class sh7604_wdt_device : public device_t, { public: // construction/destruction - sh7604_wdt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sh7604_wdt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE16_MEMBER( write ); diff --git a/src/devices/cpu/sh4/sh3comn.cpp b/src/devices/cpu/sh4/sh3comn.cpp index 1fcacaa9165..4a50e748eb9 100644 --- a/src/devices/cpu/sh4/sh3comn.cpp +++ b/src/devices/cpu/sh4/sh3comn.cpp @@ -75,7 +75,7 @@ WRITE32_MEMBER( sh3_base_device::sh3_internal_high_w ) READ32_MEMBER( sh3_base_device::sh3_internal_high_r ) { - UINT32 ret = 0; + uint32_t ret = 0; switch (offset) { @@ -378,7 +378,7 @@ WRITE32_MEMBER( sh3_base_device::sh3_internal_w ) { if (offset<0x1000) { - //UINT32 old = m_sh3internal_lower[offset]; + //uint32_t old = m_sh3internal_lower[offset]; COMBINE_DATA(&m_sh3internal_lower[offset]); switch (offset) diff --git a/src/devices/cpu/sh4/sh4.cpp b/src/devices/cpu/sh4/sh4.cpp index e716512ae6d..481566905a1 100644 --- a/src/devices/cpu/sh4/sh4.cpp +++ b/src/devices/cpu/sh4/sh4.cpp @@ -33,7 +33,7 @@ #include "sh4tmu.h" #if SH4_USE_FASTRAM_OPTIMIZATION -void sh34_base_device::add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base) +void sh34_base_device::add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base) { if (m_fastram_select < ARRAY_LENGTH(m_fastram)) { @@ -45,7 +45,7 @@ void sh34_base_device::add_fastram(offs_t start, offs_t end, UINT8 readonly, voi } } #else -void sh34_base_device::add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base) +void sh34_base_device::add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base) { } #endif @@ -85,7 +85,7 @@ static ADDRESS_MAP_START( sh3_internal_map, AS_PROGRAM, 64, sh3_base_device ) ADDRESS_MAP_END -sh34_base_device::sh34_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, endianness_t endianness, address_map_constructor internal) +sh34_base_device::sh34_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, endianness_t endianness, address_map_constructor internal) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , m_program_config("program", endianness, 64, 32, 0, internal) , m_io_config("io", endianness, 64, 8) @@ -113,45 +113,45 @@ sh34_base_device::sh34_base_device(const machine_config &mconfig, device_type ty } -sh3_base_device::sh3_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, endianness_t endianness) +sh3_base_device::sh3_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, endianness_t endianness) : sh34_base_device(mconfig, type, name, tag, owner, clock, shortname, endianness, ADDRESS_MAP_NAME(sh3_internal_map)) { m_cpu_type = CPU_TYPE_SH3; } -sh4_base_device::sh4_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, endianness_t endianness) +sh4_base_device::sh4_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, endianness_t endianness) : sh34_base_device(mconfig, type, name, tag, owner, clock, shortname, endianness, ADDRESS_MAP_NAME(sh4_internal_map)) { m_cpu_type = CPU_TYPE_SH4; } -sh3_device::sh3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sh3_device::sh3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sh3_base_device(mconfig, SH3LE, "SH-3 (little)", tag, owner, clock, "sh3", ENDIANNESS_LITTLE) { } -sh3be_device::sh3be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sh3be_device::sh3be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sh3_base_device(mconfig, SH3BE, "SH-3 (big)", tag, owner, clock, "sh3be", ENDIANNESS_BIG) { } -sh4_device::sh4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sh4_device::sh4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sh4_base_device(mconfig, SH4LE, "SH-4 (little)", tag, owner, clock, "sh4", ENDIANNESS_LITTLE) { } -sh4be_device::sh4be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sh4be_device::sh4be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sh4_base_device(mconfig, SH4BE, "SH-4 (big)", tag, owner, clock, "sh4be", ENDIANNESS_BIG) { } -offs_t sh34_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t sh34_base_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( sh4 ); @@ -159,7 +159,7 @@ offs_t sh34_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 } -offs_t sh3be_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t sh3be_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( sh4be ); @@ -167,7 +167,7 @@ offs_t sh3be_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op } -offs_t sh4be_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t sh4be_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( sh4be ); @@ -176,7 +176,7 @@ offs_t sh4be_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op /* Called for unimplemented opcodes */ -void sh34_base_device::TODO(const UINT16 opcode) +void sh34_base_device::TODO(const uint16_t opcode) { } @@ -198,7 +198,7 @@ if ((m_fpscr & PR) == 1) int data_type_of(int n) { -UINT32 abs; +uint32_t abs; abs = m_fr[n] & 0x7fffffff; if ((m_fpscr & PR) == 0) { /* Single-precision */ @@ -258,7 +258,7 @@ UINT32 abs; } #endif -inline UINT8 sh34_base_device::RB(offs_t A) +inline uint8_t sh34_base_device::RB(offs_t A) { if (A >= 0xe0000000) return m_program->read_byte(A); @@ -271,7 +271,7 @@ inline UINT8 sh34_base_device::RB(offs_t A) { continue; } - UINT8 *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; + uint8_t *fastbase = (uint8_t*)m_fastram[ramnum].base - m_fastram[ramnum].start; return fastbase[_A ^ m_byte_xor]; } return m_program->read_byte(_A); @@ -281,7 +281,7 @@ inline UINT8 sh34_base_device::RB(offs_t A) } -inline UINT16 sh34_base_device::RW(offs_t A) +inline uint16_t sh34_base_device::RW(offs_t A) { if (A >= 0xe0000000) return m_program->read_word(A); @@ -294,8 +294,8 @@ inline UINT16 sh34_base_device::RW(offs_t A) { continue; } - UINT8 *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; - return ((UINT16*)fastbase)[(_A ^ m_word_xor) >> 1]; + uint8_t *fastbase = (uint8_t*)m_fastram[ramnum].base - m_fastram[ramnum].start; + return ((uint16_t*)fastbase)[(_A ^ m_word_xor) >> 1]; } return m_program->read_word(_A); #else @@ -304,7 +304,7 @@ inline UINT16 sh34_base_device::RW(offs_t A) } -inline UINT32 sh34_base_device::RL(offs_t A) +inline uint32_t sh34_base_device::RL(offs_t A) { if (A >= 0xe0000000) return m_program->read_dword(A); @@ -317,8 +317,8 @@ inline UINT32 sh34_base_device::RL(offs_t A) { continue; } - UINT8 *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; - return ((UINT32*)fastbase)[(_A^m_dword_xor) >> 2]; + uint8_t *fastbase = (uint8_t*)m_fastram[ramnum].base - m_fastram[ramnum].start; + return ((uint32_t*)fastbase)[(_A^m_dword_xor) >> 2]; } return m_program->read_dword(_A); #else @@ -327,7 +327,7 @@ inline UINT32 sh34_base_device::RL(offs_t A) } -inline void sh34_base_device::WB(offs_t A, UINT8 V) +inline void sh34_base_device::WB(offs_t A, uint8_t V) { if (A >= 0xe0000000) { @@ -342,7 +342,7 @@ inline void sh34_base_device::WB(offs_t A, UINT8 V) { continue; } - UINT8 *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; + uint8_t *fastbase = (uint8_t*)m_fastram[ramnum].base - m_fastram[ramnum].start; fastbase[_A ^ m_byte_xor] = V; return; } @@ -353,7 +353,7 @@ inline void sh34_base_device::WB(offs_t A, UINT8 V) } -inline void sh34_base_device::WW(offs_t A, UINT16 V) +inline void sh34_base_device::WW(offs_t A, uint16_t V) { if (A >= 0xe0000000) { @@ -368,8 +368,8 @@ inline void sh34_base_device::WW(offs_t A, UINT16 V) { continue; } - void *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; - ((UINT16*)fastbase)[(_A ^ m_word_xor) >> 1] = V; + void *fastbase = (uint8_t*)m_fastram[ramnum].base - m_fastram[ramnum].start; + ((uint16_t*)fastbase)[(_A ^ m_word_xor) >> 1] = V; return; } m_program->write_word(_A,V); @@ -379,7 +379,7 @@ inline void sh34_base_device::WW(offs_t A, UINT16 V) } -inline void sh34_base_device::WL(offs_t A, UINT32 V) +inline void sh34_base_device::WL(offs_t A, uint32_t V) { if (A >= 0xe0000000) { @@ -394,8 +394,8 @@ inline void sh34_base_device::WL(offs_t A, UINT32 V) { continue; } - void *fastbase = (UINT8*)m_fastram[ramnum].base - m_fastram[ramnum].start; - ((UINT32*)fastbase)[(_A ^ m_dword_xor) >> 2] = V; + void *fastbase = (uint8_t*)m_fastram[ramnum].base - m_fastram[ramnum].start; + ((uint32_t*)fastbase)[(_A ^ m_dword_xor) >> 2] = V; return; } m_program->write_dword(_A,V); @@ -408,7 +408,7 @@ inline void sh34_base_device::WL(offs_t A, UINT32 V) * 0011 nnnn mmmm 1100 1 - * ADD Rm,Rn */ -inline void sh34_base_device::ADD(const UINT16 opcode) +inline void sh34_base_device::ADD(const uint16_t opcode) { m_r[Rn] += m_r[Rm]; } @@ -417,19 +417,19 @@ inline void sh34_base_device::ADD(const UINT16 opcode) * 0111 nnnn iiii iiii 1 - * ADD #imm,Rn */ -inline void sh34_base_device::ADDI(const UINT16 opcode) +inline void sh34_base_device::ADDI(const uint16_t opcode) { - m_r[Rn] += (INT32)(INT16)(INT8)(opcode&0xff); + m_r[Rn] += (int32_t)(int16_t)(int8_t)(opcode&0xff); } /* code cycles t-bit * 0011 nnnn mmmm 1110 1 carry * ADDC Rm,Rn */ -inline void sh34_base_device::ADDC(const UINT16 opcode) +inline void sh34_base_device::ADDC(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; - UINT32 tmp0, tmp1; + uint32_t m = Rm; uint32_t n = Rn; + uint32_t tmp0, tmp1; tmp1 = m_r[n] + m_r[m]; tmp0 = m_r[n]; @@ -446,22 +446,22 @@ inline void sh34_base_device::ADDC(const UINT16 opcode) * 0011 nnnn mmmm 1111 1 overflow * ADDV Rm,Rn */ -inline void sh34_base_device::ADDV(const UINT16 opcode) +inline void sh34_base_device::ADDV(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; - INT32 dest, src, ans; + uint32_t m = Rm; uint32_t n = Rn; + int32_t dest, src, ans; - if ((INT32) m_r[n] >= 0) + if ((int32_t) m_r[n] >= 0) dest = 0; else dest = 1; - if ((INT32) m_r[m] >= 0) + if ((int32_t) m_r[m] >= 0) src = 0; else src = 1; src += dest; m_r[n] += m_r[m]; - if ((INT32) m_r[n] >= 0) + if ((int32_t) m_r[n] >= 0) ans = 0; else ans = 1; @@ -481,7 +481,7 @@ inline void sh34_base_device::ADDV(const UINT16 opcode) * 0010 nnnn mmmm 1001 1 - * AND Rm,Rn */ -inline void sh34_base_device::AND(const UINT16 opcode) +inline void sh34_base_device::AND(const uint16_t opcode) { m_r[Rn] &= m_r[Rm]; } @@ -491,7 +491,7 @@ inline void sh34_base_device::AND(const UINT16 opcode) * 1100 1001 iiii iiii 1 - * AND #imm,R0 */ -inline void sh34_base_device::ANDI(const UINT16 opcode) +inline void sh34_base_device::ANDI(const uint16_t opcode) { m_r[0] &= (opcode&0xff); } @@ -500,9 +500,9 @@ inline void sh34_base_device::ANDI(const UINT16 opcode) * 1100 1101 iiii iiii 1 - * AND.B #imm,@(R0,GBR) */ -inline void sh34_base_device::ANDM(const UINT16 opcode) +inline void sh34_base_device::ANDM(const uint16_t opcode) { - UINT32 temp; + uint32_t temp; m_ea = m_gbr + m_r[0]; temp = (opcode&0xff) & RB( m_ea ); @@ -514,11 +514,11 @@ inline void sh34_base_device::ANDM(const UINT16 opcode) * 1000 1011 dddd dddd 3/1 - * BF disp8 */ -inline void sh34_base_device::BF(const UINT16 opcode) +inline void sh34_base_device::BF(const uint16_t opcode) { if ((m_sr & T) == 0) { - INT32 disp = ((INT32)(opcode&0xff) << 24) >> 24; + int32_t disp = ((int32_t)(opcode&0xff) << 24) >> 24; m_pc = m_ea = m_pc + disp * 2 + 2; m_sh4_icount -= 2; } @@ -528,11 +528,11 @@ inline void sh34_base_device::BF(const UINT16 opcode) * 1000 1111 dddd dddd 3/1 - * BFS disp8 */ -inline void sh34_base_device::BFS(const UINT16 opcode) +inline void sh34_base_device::BFS(const uint16_t opcode) { if ((m_sr & T) == 0) { - INT32 disp = ((INT32)(opcode&0xff) << 24) >> 24; + int32_t disp = ((int32_t)(opcode&0xff) << 24) >> 24; m_delay = m_ea = m_pc + disp * 2 + 2; m_sh4_icount--; } @@ -542,14 +542,14 @@ inline void sh34_base_device::BFS(const UINT16 opcode) * 1010 dddd dddd dddd 2 - * BRA disp12 */ -inline void sh34_base_device::BRA(const UINT16 opcode) +inline void sh34_base_device::BRA(const uint16_t opcode) { - INT32 disp = ((INT32)(opcode&0xfff) << 20) >> 20; + int32_t disp = ((int32_t)(opcode&0xfff) << 20) >> 20; #if BUSY_LOOP_HACKS if (disp == -2) { - UINT32 next_opcode = RW(m_pc & AM); + uint32_t next_opcode = RW(m_pc & AM); /* BRA $ * NOP */ @@ -565,7 +565,7 @@ inline void sh34_base_device::BRA(const UINT16 opcode) * 0000 mmmm 0010 0011 2 - * BRAF Rm */ -inline void sh34_base_device::BRAF(const UINT16 opcode) +inline void sh34_base_device::BRAF(const uint16_t opcode) { m_delay = m_pc + m_r[Rn] + 2; m_sh4_icount--; @@ -575,9 +575,9 @@ inline void sh34_base_device::BRAF(const UINT16 opcode) * 1011 dddd dddd dddd 2 - * BSR disp12 */ -inline void sh34_base_device::BSR(const UINT16 opcode) +inline void sh34_base_device::BSR(const uint16_t opcode) { - INT32 disp = ((INT32)(opcode&0xfff) << 20) >> 20; + int32_t disp = ((int32_t)(opcode&0xfff) << 20) >> 20; m_pr = m_pc + 2; m_delay = m_ea = m_pc + disp * 2 + 2; @@ -588,7 +588,7 @@ inline void sh34_base_device::BSR(const UINT16 opcode) * 0000 mmmm 0000 0011 2 - * BSRF Rm */ -inline void sh34_base_device::BSRF(const UINT16 opcode) +inline void sh34_base_device::BSRF(const uint16_t opcode) { m_pr = m_pc + 2; m_delay = m_pc + m_r[Rn] + 2; @@ -599,11 +599,11 @@ inline void sh34_base_device::BSRF(const UINT16 opcode) * 1000 1001 dddd dddd 3/1 - * BT disp8 */ -inline void sh34_base_device::BT(const UINT16 opcode) +inline void sh34_base_device::BT(const uint16_t opcode) { if ((m_sr & T) != 0) { - INT32 disp = ((INT32)(opcode&0xff) << 24) >> 24; + int32_t disp = ((int32_t)(opcode&0xff) << 24) >> 24; m_pc = m_ea = m_pc + disp * 2 + 2; m_sh4_icount -= 2; } @@ -613,11 +613,11 @@ inline void sh34_base_device::BT(const UINT16 opcode) * 1000 1101 dddd dddd 2/1 - * BTS disp8 */ -inline void sh34_base_device::BTS(const UINT16 opcode) +inline void sh34_base_device::BTS(const uint16_t opcode) { if ((m_sr & T) != 0) { - INT32 disp = ((INT32)(opcode&0xff) << 24) >> 24; + int32_t disp = ((int32_t)(opcode&0xff) << 24) >> 24; m_delay = m_ea = m_pc + disp * 2 + 2; m_sh4_icount--; } @@ -627,7 +627,7 @@ inline void sh34_base_device::BTS(const UINT16 opcode) * 0000 0000 0010 1000 1 - * CLRMAC */ -inline void sh34_base_device::CLRMAC(const UINT16 opcode) +inline void sh34_base_device::CLRMAC(const uint16_t opcode) { m_mach = 0; m_macl = 0; @@ -637,7 +637,7 @@ inline void sh34_base_device::CLRMAC(const UINT16 opcode) * 0000 0000 0000 1000 1 - * CLRT */ -inline void sh34_base_device::CLRT(const UINT16 opcode) +inline void sh34_base_device::CLRT(const uint16_t opcode) { m_sr &= ~T; } @@ -646,7 +646,7 @@ inline void sh34_base_device::CLRT(const UINT16 opcode) * 0011 nnnn mmmm 0000 1 comparison result * CMP_EQ Rm,Rn */ -inline void sh34_base_device::CMPEQ(const UINT16 opcode) +inline void sh34_base_device::CMPEQ(const uint16_t opcode) { if (m_r[Rn] == m_r[Rm]) m_sr |= T; @@ -658,9 +658,9 @@ inline void sh34_base_device::CMPEQ(const UINT16 opcode) * 0011 nnnn mmmm 0011 1 comparison result * CMP_GE Rm,Rn */ -inline void sh34_base_device::CMPGE(const UINT16 opcode) +inline void sh34_base_device::CMPGE(const uint16_t opcode) { - if ((INT32) m_r[Rn] >= (INT32) m_r[Rm]) + if ((int32_t) m_r[Rn] >= (int32_t) m_r[Rm]) m_sr |= T; else m_sr &= ~T; @@ -670,9 +670,9 @@ inline void sh34_base_device::CMPGE(const UINT16 opcode) * 0011 nnnn mmmm 0111 1 comparison result * CMP_GT Rm,Rn */ -inline void sh34_base_device::CMPGT(const UINT16 opcode) +inline void sh34_base_device::CMPGT(const uint16_t opcode) { - if ((INT32) m_r[Rn] > (INT32) m_r[Rm]) + if ((int32_t) m_r[Rn] > (int32_t) m_r[Rm]) m_sr |= T; else m_sr &= ~T; @@ -682,9 +682,9 @@ inline void sh34_base_device::CMPGT(const UINT16 opcode) * 0011 nnnn mmmm 0110 1 comparison result * CMP_HI Rm,Rn */ -inline void sh34_base_device::CMPHI(const UINT16 opcode) +inline void sh34_base_device::CMPHI(const uint16_t opcode) { - if ((UINT32) m_r[Rn] > (UINT32) m_r[Rm]) + if ((uint32_t) m_r[Rn] > (uint32_t) m_r[Rm]) m_sr |= T; else m_sr &= ~T; @@ -694,9 +694,9 @@ inline void sh34_base_device::CMPHI(const UINT16 opcode) * 0011 nnnn mmmm 0010 1 comparison result * CMP_HS Rm,Rn */ -inline void sh34_base_device::CMPHS(const UINT16 opcode) +inline void sh34_base_device::CMPHS(const uint16_t opcode) { - if ((UINT32) m_r[Rn] >= (UINT32) m_r[Rm]) + if ((uint32_t) m_r[Rn] >= (uint32_t) m_r[Rm]) m_sr |= T; else m_sr &= ~T; @@ -707,9 +707,9 @@ inline void sh34_base_device::CMPHS(const UINT16 opcode) * 0100 nnnn 0001 0101 1 comparison result * CMP_PL Rn */ -inline void sh34_base_device::CMPPL(const UINT16 opcode) +inline void sh34_base_device::CMPPL(const uint16_t opcode) { - if ((INT32) m_r[Rn] > 0) + if ((int32_t) m_r[Rn] > 0) m_sr |= T; else m_sr &= ~T; @@ -719,9 +719,9 @@ inline void sh34_base_device::CMPPL(const UINT16 opcode) * 0100 nnnn 0001 0001 1 comparison result * CMP_PZ Rn */ -inline void sh34_base_device::CMPPZ(const UINT16 opcode) +inline void sh34_base_device::CMPPZ(const uint16_t opcode) { - if ((INT32) m_r[Rn] >= 0) + if ((int32_t) m_r[Rn] >= 0) m_sr |= T; else m_sr &= ~T; @@ -731,10 +731,10 @@ inline void sh34_base_device::CMPPZ(const UINT16 opcode) * 0010 nnnn mmmm 1100 1 comparison result * CMP_STR Rm,Rn */ -inline void sh34_base_device::CMPSTR(const UINT16 opcode) +inline void sh34_base_device::CMPSTR(const uint16_t opcode) { - UINT32 temp; - INT32 HH, HL, LH, LL; + uint32_t temp; + int32_t HH, HL, LH, LL; temp = m_r[Rn] ^ m_r[Rm]; HH = (temp >> 24) & 0xff; HL = (temp >> 16) & 0xff; @@ -751,9 +751,9 @@ inline void sh34_base_device::CMPSTR(const UINT16 opcode) * 1000 1000 iiii iiii 1 comparison result * CMP/EQ #imm,R0 */ -inline void sh34_base_device::CMPIM(const UINT16 opcode) +inline void sh34_base_device::CMPIM(const uint16_t opcode) { - UINT32 imm = (UINT32)(INT32)(INT16)(INT8)(opcode&0xff); + uint32_t imm = (uint32_t)(int32_t)(int16_t)(int8_t)(opcode&0xff); if (m_r[0] == imm) m_sr |= T; @@ -765,9 +765,9 @@ inline void sh34_base_device::CMPIM(const UINT16 opcode) * 0010 nnnn mmmm 0111 1 calculation result * DIV0S Rm,Rn */ -inline void sh34_base_device::DIV0S(const UINT16 opcode) +inline void sh34_base_device::DIV0S(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if ((m_r[n] & 0x80000000) == 0) m_sr &= ~Q; @@ -787,7 +787,7 @@ inline void sh34_base_device::DIV0S(const UINT16 opcode) * 0000 0000 0001 1001 1 0 * DIV0U */ -inline void sh34_base_device::DIV0U(const UINT16 opcode) +inline void sh34_base_device::DIV0U(const uint16_t opcode) { m_sr &= ~(M | Q | T); } @@ -796,12 +796,12 @@ inline void sh34_base_device::DIV0U(const UINT16 opcode) * 0011 nnnn mmmm 0100 1 calculation result * DIV1 Rm,Rn */ -inline void sh34_base_device::DIV1(const UINT16 opcode) +inline void sh34_base_device::DIV1(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - UINT32 tmp0; - UINT32 old_q; + uint32_t tmp0; + uint32_t old_q; old_q = m_sr & Q; if (0x80000000 & m_r[n]) @@ -890,26 +890,26 @@ inline void sh34_base_device::DIV1(const UINT16 opcode) } /* DMULS.L Rm,Rn */ -inline void sh34_base_device::DMULS(const UINT16 opcode) +inline void sh34_base_device::DMULS(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; - INT32 tempm, tempn, fnLmL; + uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2; + uint32_t temp0, temp1, temp2, temp3; + int32_t tempm, tempn, fnLmL; - tempn = (INT32) m_r[n]; - tempm = (INT32) m_r[m]; + tempn = (int32_t) m_r[n]; + tempm = (int32_t) m_r[m]; if (tempn < 0) tempn = 0 - tempn; if (tempm < 0) tempm = 0 - tempm; - if ((INT32) (m_r[n] ^ m_r[m]) < 0) + if ((int32_t) (m_r[n] ^ m_r[m]) < 0) fnLmL = -1; else fnLmL = 0; - temp1 = (UINT32) tempn; - temp2 = (UINT32) tempm; + temp1 = (uint32_t) tempn; + temp2 = (uint32_t) tempm; RnL = temp1 & 0x0000ffff; RnH = (temp1 >> 16) & 0x0000ffff; RmL = temp2 & 0x0000ffff; @@ -941,12 +941,12 @@ inline void sh34_base_device::DMULS(const UINT16 opcode) } /* DMULU.L Rm,Rn */ -inline void sh34_base_device::DMULU(const UINT16 opcode) +inline void sh34_base_device::DMULU(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; + uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2; + uint32_t temp0, temp1, temp2, temp3; RnL = m_r[n] & 0x0000ffff; RnH = (m_r[n] >> 16) & 0x0000ffff; @@ -971,9 +971,9 @@ inline void sh34_base_device::DMULU(const UINT16 opcode) } /* DT Rn */ -inline void sh34_base_device::DT(const UINT16 opcode) +inline void sh34_base_device::DT(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n]--; if (m_r[n] == 0) @@ -982,7 +982,7 @@ inline void sh34_base_device::DT(const UINT16 opcode) m_sr &= ~T; #if BUSY_LOOP_HACKS { - UINT32 next_opcode = RW(m_pc & AM); + uint32_t next_opcode = RW(m_pc & AM); /* DT Rn * BF $-2 */ @@ -999,37 +999,37 @@ inline void sh34_base_device::DT(const UINT16 opcode) } /* EXTS.B Rm,Rn */ -inline void sh34_base_device::EXTSB(const UINT16 opcode) +inline void sh34_base_device::EXTSB(const uint16_t opcode) { - m_r[Rn] = ((INT32)m_r[Rm] << 24) >> 24; + m_r[Rn] = ((int32_t)m_r[Rm] << 24) >> 24; } /* EXTS.W Rm,Rn */ -inline void sh34_base_device::EXTSW(const UINT16 opcode) +inline void sh34_base_device::EXTSW(const uint16_t opcode) { - m_r[Rn] = ((INT32)m_r[Rm] << 16) >> 16; + m_r[Rn] = ((int32_t)m_r[Rm] << 16) >> 16; } /* EXTU.B Rm,Rn */ -inline void sh34_base_device::EXTUB(const UINT16 opcode) +inline void sh34_base_device::EXTUB(const uint16_t opcode) { m_r[Rn] = m_r[Rm] & 0x000000ff; } /* EXTU.W Rm,Rn */ -inline void sh34_base_device::EXTUW(const UINT16 opcode) +inline void sh34_base_device::EXTUW(const uint16_t opcode) { m_r[Rn] = m_r[Rm] & 0x0000ffff; } /* JMP @Rm */ -inline void sh34_base_device::JMP(const UINT16 opcode) +inline void sh34_base_device::JMP(const uint16_t opcode) { m_delay = m_ea = m_r[Rn]; } /* JSR @Rm */ -inline void sh34_base_device::JSR(const UINT16 opcode) +inline void sh34_base_device::JSR(const uint16_t opcode) { m_pr = m_pc + 2; m_delay = m_ea = m_r[Rn]; @@ -1038,9 +1038,9 @@ inline void sh34_base_device::JSR(const UINT16 opcode) /* LDC Rm,SR */ -inline void sh34_base_device::LDCSR(const UINT16 opcode) +inline void sh34_base_device::LDCSR(const uint16_t opcode) { - UINT32 reg; + uint32_t reg; reg = m_r[Rn]; if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) @@ -1052,21 +1052,21 @@ inline void sh34_base_device::LDCSR(const UINT16 opcode) } /* LDC Rm,GBR */ -inline void sh34_base_device::LDCGBR(const UINT16 opcode) +inline void sh34_base_device::LDCGBR(const uint16_t opcode) { m_gbr = m_r[Rn]; } /* LDC Rm,VBR */ -inline void sh34_base_device::LDCVBR(const UINT16 opcode) +inline void sh34_base_device::LDCVBR(const uint16_t opcode) { m_vbr = m_r[Rn]; } /* LDC.L @Rm+,SR */ -inline void sh34_base_device::LDCMSR(const UINT16 opcode) +inline void sh34_base_device::LDCMSR(const uint16_t opcode) { - UINT32 old; + uint32_t old; old = m_sr; m_ea = m_r[Rn]; @@ -1081,7 +1081,7 @@ inline void sh34_base_device::LDCMSR(const UINT16 opcode) } /* LDC.L @Rm+,GBR */ -inline void sh34_base_device::LDCMGBR(const UINT16 opcode) +inline void sh34_base_device::LDCMGBR(const uint16_t opcode) { m_ea = m_r[Rn]; m_gbr = RL(m_ea ); @@ -1090,7 +1090,7 @@ inline void sh34_base_device::LDCMGBR(const UINT16 opcode) } /* LDC.L @Rm+,VBR */ -inline void sh34_base_device::LDCMVBR(const UINT16 opcode) +inline void sh34_base_device::LDCMVBR(const uint16_t opcode) { m_ea = m_r[Rn]; m_vbr = RL(m_ea ); @@ -1099,25 +1099,25 @@ inline void sh34_base_device::LDCMVBR(const UINT16 opcode) } /* LDS Rm,MACH */ -inline void sh34_base_device::LDSMACH(const UINT16 opcode) +inline void sh34_base_device::LDSMACH(const uint16_t opcode) { m_mach = m_r[Rn]; } /* LDS Rm,MACL */ -inline void sh34_base_device::LDSMACL(const UINT16 opcode) +inline void sh34_base_device::LDSMACL(const uint16_t opcode) { m_macl = m_r[Rn]; } /* LDS Rm,PR */ -inline void sh34_base_device::LDSPR(const UINT16 opcode) +inline void sh34_base_device::LDSPR(const uint16_t opcode) { m_pr = m_r[Rn]; } /* LDS.L @Rm+,MACH */ -inline void sh34_base_device::LDSMMACH(const UINT16 opcode) +inline void sh34_base_device::LDSMMACH(const uint16_t opcode) { m_ea = m_r[Rn]; m_mach = RL(m_ea ); @@ -1125,7 +1125,7 @@ inline void sh34_base_device::LDSMMACH(const UINT16 opcode) } /* LDS.L @Rm+,MACL */ -inline void sh34_base_device::LDSMMACL(const UINT16 opcode) +inline void sh34_base_device::LDSMMACL(const uint16_t opcode) { m_ea = m_r[Rn]; m_macl = RL(m_ea ); @@ -1133,7 +1133,7 @@ inline void sh34_base_device::LDSMMACL(const UINT16 opcode) } /* LDS.L @Rm+,PR */ -inline void sh34_base_device::LDSMPR(const UINT16 opcode) +inline void sh34_base_device::LDSMPR(const uint16_t opcode) { m_ea = m_r[Rn]; m_pr = RL(m_ea ); @@ -1141,19 +1141,19 @@ inline void sh34_base_device::LDSMPR(const UINT16 opcode) } /* MAC.L @Rm+,@Rn+ */ -inline void sh34_base_device::MAC_L(const UINT16 opcode) +inline void sh34_base_device::MAC_L(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2; - UINT32 temp0, temp1, temp2, temp3; - INT32 tempm, tempn, fnLmL; + uint32_t RnL, RnH, RmL, RmH, Res0, Res1, Res2; + uint32_t temp0, temp1, temp2, temp3; + int32_t tempm, tempn, fnLmL; - tempn = (INT32) RL(m_r[n] ); + tempn = (int32_t) RL(m_r[n] ); m_r[n] += 4; - tempm = (INT32) RL(m_r[m] ); + tempm = (int32_t) RL(m_r[m] ); m_r[m] += 4; - if ((INT32) (tempn ^ tempm) < 0) + if ((int32_t) (tempn ^ tempm) < 0) fnLmL = -1; else fnLmL = 0; @@ -1161,8 +1161,8 @@ inline void sh34_base_device::MAC_L(const UINT16 opcode) tempn = 0 - tempn; if (tempm < 0) tempm = 0 - tempm; - temp1 = (UINT32) tempn; - temp2 = (UINT32) tempm; + temp1 = (uint32_t) tempn; + temp2 = (uint32_t) tempm; RnL = temp1 & 0x0000ffff; RnH = (temp1 >> 16) & 0x0000ffff; RmL = temp2 & 0x0000ffff; @@ -1194,12 +1194,12 @@ inline void sh34_base_device::MAC_L(const UINT16 opcode) if (m_macl > Res0) Res2++; Res2 += (m_mach & 0x0000ffff); - if (((INT32) Res2 < 0) && (Res2 < 0xffff8000)) + if (((int32_t) Res2 < 0) && (Res2 < 0xffff8000)) { Res2 = 0x00008000; Res0 = 0x00000000; } - else if (((INT32) Res2 > 0) && (Res2 > 0x00007fff)) + else if (((int32_t) Res2 > 0) && (Res2 > 0x00007fff)) { Res2 = 0x00007fff; Res0 = 0xffffffff; @@ -1220,24 +1220,24 @@ inline void sh34_base_device::MAC_L(const UINT16 opcode) } /* MAC.W @Rm+,@Rn+ */ -inline void sh34_base_device::MAC_W(const UINT16 opcode) +inline void sh34_base_device::MAC_W(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - INT32 tempm, tempn, dest, src, ans; - UINT32 templ; + int32_t tempm, tempn, dest, src, ans; + uint32_t templ; - tempn = (INT32) RW(m_r[n] ); + tempn = (int32_t) RW(m_r[n] ); m_r[n] += 2; - tempm = (INT32) RW(m_r[m] ); + tempm = (int32_t) RW(m_r[m] ); m_r[m] += 2; templ = m_macl; - tempm = ((INT32) (short) tempn * (INT32) (short) tempm); - if ((INT32) m_macl >= 0) + tempm = ((int32_t) (short) tempn * (int32_t) (short) tempm); + if ((int32_t) m_macl >= 0) dest = 0; else dest = 1; - if ((INT32) tempm >= 0) + if ((int32_t) tempm >= 0) { src = 0; tempn = 0; @@ -1249,7 +1249,7 @@ inline void sh34_base_device::MAC_W(const UINT16 opcode) } src += dest; m_macl += tempm; - if ((INT32) m_macl >= 0) + if ((int32_t) m_macl >= 0) ans = 0; else ans = 1; @@ -1274,104 +1274,104 @@ inline void sh34_base_device::MAC_W(const UINT16 opcode) } /* MOV Rm,Rn */ -inline void sh34_base_device::MOV(const UINT16 opcode) +inline void sh34_base_device::MOV(const uint16_t opcode) { m_r[Rn] = m_r[Rm]; } /* MOV.B Rm,@Rn */ -inline void sh34_base_device::MOVBS(const UINT16 opcode) +inline void sh34_base_device::MOVBS(const uint16_t opcode) { m_ea = m_r[Rn]; WB(m_ea, m_r[Rm] & 0x000000ff); } /* MOV.W Rm,@Rn */ -inline void sh34_base_device::MOVWS(const UINT16 opcode) +inline void sh34_base_device::MOVWS(const uint16_t opcode) { m_ea = m_r[Rn]; WW(m_ea, m_r[Rm] & 0x0000ffff); } /* MOV.L Rm,@Rn */ -inline void sh34_base_device::MOVLS(const UINT16 opcode) +inline void sh34_base_device::MOVLS(const uint16_t opcode) { m_ea = m_r[Rn]; WL(m_ea, m_r[Rm] ); } /* MOV.B @Rm,Rn */ -inline void sh34_base_device::MOVBL(const UINT16 opcode) +inline void sh34_base_device::MOVBL(const uint16_t opcode) { m_ea = m_r[Rm]; - m_r[Rn] = (UINT32)(INT32)(INT16)(INT8) RB( m_ea ); + m_r[Rn] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_ea ); } /* MOV.W @Rm,Rn */ -inline void sh34_base_device::MOVWL(const UINT16 opcode) +inline void sh34_base_device::MOVWL(const uint16_t opcode) { m_ea = m_r[Rm]; - m_r[Rn] = (UINT32)(INT32)(INT16) RW(m_ea ); + m_r[Rn] = (uint32_t)(int32_t)(int16_t) RW(m_ea ); } /* MOV.L @Rm,Rn */ -inline void sh34_base_device::MOVLL(const UINT16 opcode) +inline void sh34_base_device::MOVLL(const uint16_t opcode) { m_ea = m_r[Rm]; m_r[Rn] = RL(m_ea ); } /* MOV.B Rm,@-Rn */ -inline void sh34_base_device::MOVBM(const UINT16 opcode) +inline void sh34_base_device::MOVBM(const uint16_t opcode) { - UINT32 data = m_r[Rm] & 0x000000ff; + uint32_t data = m_r[Rm] & 0x000000ff; m_r[Rn] -= 1; WB(m_r[Rn], data ); } /* MOV.W Rm,@-Rn */ -inline void sh34_base_device::MOVWM(const UINT16 opcode) +inline void sh34_base_device::MOVWM(const uint16_t opcode) { - UINT32 data = m_r[Rm] & 0x0000ffff; + uint32_t data = m_r[Rm] & 0x0000ffff; m_r[Rn] -= 2; WW(m_r[Rn], data ); } /* MOV.L Rm,@-Rn */ -inline void sh34_base_device::MOVLM(const UINT16 opcode) +inline void sh34_base_device::MOVLM(const uint16_t opcode) { - UINT32 data = m_r[Rm]; + uint32_t data = m_r[Rm]; m_r[Rn] -= 4; WL(m_r[Rn], data ); } /* MOV.B @Rm+,Rn */ -inline void sh34_base_device::MOVBP(const UINT16 opcode) +inline void sh34_base_device::MOVBP(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - m_r[n] = (UINT32)(INT32)(INT16)(INT8) RB( m_r[m] ); + m_r[n] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_r[m] ); if (n != m) m_r[m] += 1; } /* MOV.W @Rm+,Rn */ -inline void sh34_base_device::MOVWP(const UINT16 opcode) +inline void sh34_base_device::MOVWP(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - m_r[n] = (UINT32)(INT32)(INT16) RW(m_r[m] ); + m_r[n] = (uint32_t)(int32_t)(int16_t) RW(m_r[m] ); if (n != m) m_r[m] += 2; } /* MOV.L @Rm+,Rn */ -inline void sh34_base_device::MOVLP(const UINT16 opcode) +inline void sh34_base_device::MOVLP(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; m_r[n] = RL(m_r[m] ); if (n != m) @@ -1379,208 +1379,208 @@ inline void sh34_base_device::MOVLP(const UINT16 opcode) } /* MOV.B Rm,@(R0,Rn) */ -inline void sh34_base_device::MOVBS0(const UINT16 opcode) +inline void sh34_base_device::MOVBS0(const uint16_t opcode) { m_ea = m_r[Rn] + m_r[0]; WB(m_ea, m_r[Rm] & 0x000000ff ); } /* MOV.W Rm,@(R0,Rn) */ -inline void sh34_base_device::MOVWS0(const UINT16 opcode) +inline void sh34_base_device::MOVWS0(const uint16_t opcode) { m_ea = m_r[Rn] + m_r[0]; WW(m_ea, m_r[Rm] & 0x0000ffff ); } /* MOV.L Rm,@(R0,Rn) */ -inline void sh34_base_device::MOVLS0(const UINT16 opcode) +inline void sh34_base_device::MOVLS0(const uint16_t opcode) { m_ea = m_r[Rn] + m_r[0]; WL(m_ea, m_r[Rm] ); } /* MOV.B @(R0,Rm),Rn */ -inline void sh34_base_device::MOVBL0(const UINT16 opcode) +inline void sh34_base_device::MOVBL0(const uint16_t opcode) { m_ea = m_r[Rm] + m_r[0]; - m_r[Rn] = (UINT32)(INT32)(INT16)(INT8) RB( m_ea ); + m_r[Rn] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_ea ); } /* MOV.W @(R0,Rm),Rn */ -inline void sh34_base_device::MOVWL0(const UINT16 opcode) +inline void sh34_base_device::MOVWL0(const uint16_t opcode) { m_ea = m_r[Rm] + m_r[0]; - m_r[Rn] = (UINT32)(INT32)(INT16) RW(m_ea ); + m_r[Rn] = (uint32_t)(int32_t)(int16_t) RW(m_ea ); } /* MOV.L @(R0,Rm),Rn */ -inline void sh34_base_device::MOVLL0(const UINT16 opcode) +inline void sh34_base_device::MOVLL0(const uint16_t opcode) { m_ea = m_r[Rm] + m_r[0]; m_r[Rn] = RL(m_ea ); } /* MOV #imm,Rn */ -inline void sh34_base_device::MOVI(const UINT16 opcode) +inline void sh34_base_device::MOVI(const uint16_t opcode) { - m_r[Rn] = (UINT32)(INT32)(INT16)(INT8)(opcode&0xff); + m_r[Rn] = (uint32_t)(int32_t)(int16_t)(int8_t)(opcode&0xff); } /* MOV.W @(disp8,PC),Rn */ -inline void sh34_base_device::MOVWI(const UINT16 opcode) +inline void sh34_base_device::MOVWI(const uint16_t opcode) { - UINT32 disp = opcode & 0xff; + uint32_t disp = opcode & 0xff; m_ea = m_pc + disp * 2 + 2; - m_r[Rn] = (UINT32)(INT32)(INT16) RW(m_ea ); + m_r[Rn] = (uint32_t)(int32_t)(int16_t) RW(m_ea ); } /* MOV.L @(disp8,PC),Rn */ -inline void sh34_base_device::MOVLI(const UINT16 opcode) +inline void sh34_base_device::MOVLI(const uint16_t opcode) { - UINT32 disp = opcode & 0xff; + uint32_t disp = opcode & 0xff; m_ea = ((m_pc + 2) & ~3) + disp * 4; m_r[Rn] = RL(m_ea ); } /* MOV.B @(disp8,GBR),R0 */ -inline void sh34_base_device::MOVBLG(const UINT16 opcode) +inline void sh34_base_device::MOVBLG(const uint16_t opcode) { - UINT32 disp = opcode & 0xff; + uint32_t disp = opcode & 0xff; m_ea = m_gbr + disp; - m_r[0] = (UINT32)(INT32)(INT16)(INT8) RB( m_ea ); + m_r[0] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_ea ); } /* MOV.W @(disp8,GBR),R0 */ -inline void sh34_base_device::MOVWLG(const UINT16 opcode) +inline void sh34_base_device::MOVWLG(const uint16_t opcode) { - UINT32 disp = opcode & 0xff; + uint32_t disp = opcode & 0xff; m_ea = m_gbr + disp * 2; - m_r[0] = (INT32)(INT16) RW(m_ea ); + m_r[0] = (int32_t)(int16_t) RW(m_ea ); } /* MOV.L @(disp8,GBR),R0 */ -inline void sh34_base_device::MOVLLG(const UINT16 opcode) +inline void sh34_base_device::MOVLLG(const uint16_t opcode) { - UINT32 disp = opcode & 0xff; + uint32_t disp = opcode & 0xff; m_ea = m_gbr + disp * 4; m_r[0] = RL(m_ea ); } /* MOV.B R0,@(disp8,GBR) */ -inline void sh34_base_device::MOVBSG(const UINT16 opcode) +inline void sh34_base_device::MOVBSG(const uint16_t opcode) { - UINT32 disp = opcode & 0xff; + uint32_t disp = opcode & 0xff; m_ea = m_gbr + disp; WB(m_ea, m_r[0] & 0x000000ff ); } /* MOV.W R0,@(disp8,GBR) */ -inline void sh34_base_device::MOVWSG(const UINT16 opcode) +inline void sh34_base_device::MOVWSG(const uint16_t opcode) { - UINT32 disp = opcode & 0xff; + uint32_t disp = opcode & 0xff; m_ea = m_gbr + disp * 2; WW(m_ea, m_r[0] & 0x0000ffff ); } /* MOV.L R0,@(disp8,GBR) */ -inline void sh34_base_device::MOVLSG(const UINT16 opcode) +inline void sh34_base_device::MOVLSG(const uint16_t opcode) { - UINT32 disp = opcode & 0xff; + uint32_t disp = opcode & 0xff; m_ea = m_gbr + disp * 4; WL(m_ea, m_r[0] ); } /* MOV.B R0,@(disp4,Rm) */ -inline void sh34_base_device::MOVBS4(const UINT16 opcode) +inline void sh34_base_device::MOVBS4(const uint16_t opcode) { - UINT32 disp = opcode & 0x0f; + uint32_t disp = opcode & 0x0f; m_ea = m_r[Rm] + disp; WB(m_ea, m_r[0] & 0x000000ff ); } /* MOV.W R0,@(disp4,Rm) */ -inline void sh34_base_device::MOVWS4(const UINT16 opcode) +inline void sh34_base_device::MOVWS4(const uint16_t opcode) { - UINT32 disp = opcode & 0x0f; + uint32_t disp = opcode & 0x0f; m_ea = m_r[Rm] + disp * 2; WW(m_ea, m_r[0] & 0x0000ffff ); } /* MOV.L Rm,@(disp4,Rn) */ -inline void sh34_base_device::MOVLS4(const UINT16 opcode) +inline void sh34_base_device::MOVLS4(const uint16_t opcode) { - UINT32 disp = opcode & 0x0f; + uint32_t disp = opcode & 0x0f; m_ea = m_r[Rn] + disp * 4; WL(m_ea, m_r[Rm] ); } /* MOV.B @(disp4,Rm),R0 */ -inline void sh34_base_device::MOVBL4(const UINT16 opcode) +inline void sh34_base_device::MOVBL4(const uint16_t opcode) { - UINT32 disp = opcode & 0x0f; + uint32_t disp = opcode & 0x0f; m_ea = m_r[Rm] + disp; - m_r[0] = (UINT32)(INT32)(INT16)(INT8) RB( m_ea ); + m_r[0] = (uint32_t)(int32_t)(int16_t)(int8_t) RB( m_ea ); } /* MOV.W @(disp4,Rm),R0 */ -inline void sh34_base_device::MOVWL4(const UINT16 opcode) +inline void sh34_base_device::MOVWL4(const uint16_t opcode) { - UINT32 disp = opcode & 0x0f; + uint32_t disp = opcode & 0x0f; m_ea = m_r[Rm] + disp * 2; - m_r[0] = (UINT32)(INT32)(INT16) RW(m_ea ); + m_r[0] = (uint32_t)(int32_t)(int16_t) RW(m_ea ); } /* MOV.L @(disp4,Rm),Rn */ -inline void sh34_base_device::MOVLL4(const UINT16 opcode) +inline void sh34_base_device::MOVLL4(const uint16_t opcode) { - UINT32 disp = opcode & 0x0f; + uint32_t disp = opcode & 0x0f; m_ea = m_r[Rm] + disp * 4; m_r[Rn] = RL(m_ea ); } /* MOVA @(disp8,PC),R0 */ -inline void sh34_base_device::MOVA(const UINT16 opcode) +inline void sh34_base_device::MOVA(const uint16_t opcode) { - UINT32 disp = opcode & 0xff; + uint32_t disp = opcode & 0xff; m_ea = ((m_pc + 2) & ~3) + disp * 4; m_r[0] = m_ea; } /* MOVT Rn */ -void sh34_base_device::MOVT(const UINT16 opcode) +void sh34_base_device::MOVT(const uint16_t opcode) { m_r[Rn] = m_sr & T; } /* MUL.L Rm,Rn */ -inline void sh34_base_device::MULL(const UINT16 opcode) +inline void sh34_base_device::MULL(const uint16_t opcode) { m_macl = m_r[Rn] * m_r[Rm]; m_sh4_icount--; } /* MULS Rm,Rn */ -inline void sh34_base_device::MULS(const UINT16 opcode) +inline void sh34_base_device::MULS(const uint16_t opcode) { - m_macl = (INT16) m_r[Rn] * (INT16) m_r[Rm]; + m_macl = (int16_t) m_r[Rn] * (int16_t) m_r[Rm]; } /* MULU Rm,Rn */ -inline void sh34_base_device::MULU(const UINT16 opcode) +inline void sh34_base_device::MULU(const uint16_t opcode) { - m_macl = (UINT16) m_r[Rn] * (UINT16) m_r[Rm]; + m_macl = (uint16_t) m_r[Rn] * (uint16_t) m_r[Rm]; } /* NEG Rm,Rn */ -inline void sh34_base_device::NEG(const UINT16 opcode) +inline void sh34_base_device::NEG(const uint16_t opcode) { m_r[Rn] = 0 - m_r[Rm]; } /* NEGC Rm,Rn */ -inline void sh34_base_device::NEGC(const UINT16 opcode) +inline void sh34_base_device::NEGC(const uint16_t opcode) { - UINT32 temp; + uint32_t temp; temp = m_r[Rm]; m_r[Rn] = -temp - (m_sr & T); @@ -1591,33 +1591,33 @@ inline void sh34_base_device::NEGC(const UINT16 opcode) } /* NOP */ -inline void sh34_base_device::NOP(const UINT16 opcode) +inline void sh34_base_device::NOP(const uint16_t opcode) { } /* NOT Rm,Rn */ -inline void sh34_base_device::NOT(const UINT16 opcode) +inline void sh34_base_device::NOT(const uint16_t opcode) { m_r[Rn] = ~m_r[Rm]; } /* OR Rm,Rn */ -inline void sh34_base_device::OR(const UINT16 opcode) +inline void sh34_base_device::OR(const uint16_t opcode) { m_r[Rn] |= m_r[Rm]; } /* OR #imm,R0 */ -inline void sh34_base_device::ORI(const UINT16 opcode) +inline void sh34_base_device::ORI(const uint16_t opcode) { m_r[0] |= (opcode&0xff); m_sh4_icount -= 2; } /* OR.B #imm,@(R0,GBR) */ -inline void sh34_base_device::ORM(const UINT16 opcode) +inline void sh34_base_device::ORM(const uint16_t opcode) { - UINT32 temp; + uint32_t temp; m_ea = m_gbr + m_r[0]; temp = RB( m_ea ); @@ -1626,11 +1626,11 @@ inline void sh34_base_device::ORM(const UINT16 opcode) } /* ROTCL Rn */ -inline void sh34_base_device::ROTCL(const UINT16 opcode) +inline void sh34_base_device::ROTCL(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; - UINT32 temp; + uint32_t temp; temp = (m_r[n] >> 31) & T; m_r[n] = (m_r[n] << 1) | (m_sr & T); @@ -1638,11 +1638,11 @@ inline void sh34_base_device::ROTCL(const UINT16 opcode) } /* ROTCR Rn */ -inline void sh34_base_device::ROTCR(const UINT16 opcode) +inline void sh34_base_device::ROTCR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; - UINT32 temp; + uint32_t temp; temp = (m_sr & T) << 31; if (m_r[n] & T) m_sr |= T; @@ -1652,25 +1652,25 @@ inline void sh34_base_device::ROTCR(const UINT16 opcode) } /* ROTL Rn */ -inline void sh34_base_device::ROTL(const UINT16 opcode) +inline void sh34_base_device::ROTL(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_sr = (m_sr & ~T) | ((m_r[n] >> 31) & T); m_r[n] = (m_r[n] << 1) | (m_r[n] >> 31); } /* ROTR Rn */ -inline void sh34_base_device::ROTR(const UINT16 opcode) +inline void sh34_base_device::ROTR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_sr = (m_sr & ~T) | (m_r[n] & T); m_r[n] = (m_r[n] >> 1) | (m_r[n] << 31); } /* RTE */ -inline void sh34_base_device::RTE(const UINT16 opcode) +inline void sh34_base_device::RTE(const uint16_t opcode) { m_delay = m_ea = m_spc; if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) @@ -1683,92 +1683,92 @@ inline void sh34_base_device::RTE(const UINT16 opcode) } /* RTS */ -inline void sh34_base_device::RTS(const UINT16 opcode) +inline void sh34_base_device::RTS(const uint16_t opcode) { m_delay = m_ea = m_pr; m_sh4_icount--; } /* SETT */ -inline void sh34_base_device::SETT(const UINT16 opcode) +inline void sh34_base_device::SETT(const uint16_t opcode) { m_sr |= T; } /* SHAL Rn (same as SHLL) */ -inline void sh34_base_device::SHAL(const UINT16 opcode) +inline void sh34_base_device::SHAL(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_sr = (m_sr & ~T) | ((m_r[n] >> 31) & T); m_r[n] <<= 1; } /* SHAR Rn */ -inline void sh34_base_device::SHAR(const UINT16 opcode) +inline void sh34_base_device::SHAR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_sr = (m_sr & ~T) | (m_r[n] & T); - m_r[n] = (UINT32)((INT32)m_r[n] >> 1); + m_r[n] = (uint32_t)((int32_t)m_r[n] >> 1); } /* SHLL Rn (same as SHAL) */ -inline void sh34_base_device::SHLL(const UINT16 opcode) +inline void sh34_base_device::SHLL(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_sr = (m_sr & ~T) | ((m_r[n] >> 31) & T); m_r[n] <<= 1; } /* SHLL2 Rn */ -inline void sh34_base_device::SHLL2(const UINT16 opcode) +inline void sh34_base_device::SHLL2(const uint16_t opcode) { m_r[Rn] <<= 2; } /* SHLL8 Rn */ -inline void sh34_base_device::SHLL8(const UINT16 opcode) +inline void sh34_base_device::SHLL8(const uint16_t opcode) { m_r[Rn] <<= 8; } /* SHLL16 Rn */ -inline void sh34_base_device::SHLL16(const UINT16 opcode) +inline void sh34_base_device::SHLL16(const uint16_t opcode) { m_r[Rn] <<= 16; } /* SHLR Rn */ -inline void sh34_base_device::SHLR(const UINT16 opcode) +inline void sh34_base_device::SHLR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_sr = (m_sr & ~T) | (m_r[n] & T); m_r[n] >>= 1; } /* SHLR2 Rn */ -inline void sh34_base_device::SHLR2(const UINT16 opcode) +inline void sh34_base_device::SHLR2(const uint16_t opcode) { m_r[Rn] >>= 2; } /* SHLR8 Rn */ -inline void sh34_base_device::SHLR8(const UINT16 opcode) +inline void sh34_base_device::SHLR8(const uint16_t opcode) { m_r[Rn] >>= 8; } /* SHLR16 Rn */ -inline void sh34_base_device::SHLR16(const UINT16 opcode) +inline void sh34_base_device::SHLR16(const uint16_t opcode) { m_r[Rn] >>= 16; } /* SLEEP */ -inline void sh34_base_device::SLEEP(const UINT16 opcode) +inline void sh34_base_device::SLEEP(const uint16_t opcode) { /* 0 = normal mode */ /* 1 = enters into power-down mode */ @@ -1784,27 +1784,27 @@ inline void sh34_base_device::SLEEP(const UINT16 opcode) } /* STC SR,Rn */ -inline void sh34_base_device::STCSR(const UINT16 opcode) +inline void sh34_base_device::STCSR(const uint16_t opcode) { m_r[Rn] = m_sr; } /* STC GBR,Rn */ -inline void sh34_base_device::STCGBR(const UINT16 opcode) +inline void sh34_base_device::STCGBR(const uint16_t opcode) { m_r[Rn] = m_gbr; } /* STC VBR,Rn */ -inline void sh34_base_device::STCVBR(const UINT16 opcode) +inline void sh34_base_device::STCVBR(const uint16_t opcode) { m_r[Rn] = m_vbr; } /* STC.L SR,@-Rn */ -inline void sh34_base_device::STCMSR(const UINT16 opcode) +inline void sh34_base_device::STCMSR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -1813,9 +1813,9 @@ inline void sh34_base_device::STCMSR(const UINT16 opcode) } /* STC.L GBR,@-Rn */ -inline void sh34_base_device::STCMGBR(const UINT16 opcode) +inline void sh34_base_device::STCMGBR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -1824,9 +1824,9 @@ inline void sh34_base_device::STCMGBR(const UINT16 opcode) } /* STC.L VBR,@-Rn */ -inline void sh34_base_device::STCMVBR(const UINT16 opcode) +inline void sh34_base_device::STCMVBR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -1835,27 +1835,27 @@ inline void sh34_base_device::STCMVBR(const UINT16 opcode) } /* STS MACH,Rn */ -inline void sh34_base_device::STSMACH(const UINT16 opcode) +inline void sh34_base_device::STSMACH(const uint16_t opcode) { m_r[Rn] = m_mach; } /* STS MACL,Rn */ -inline void sh34_base_device::STSMACL(const UINT16 opcode) +inline void sh34_base_device::STSMACL(const uint16_t opcode) { m_r[Rn] = m_macl; } /* STS PR,Rn */ -inline void sh34_base_device::STSPR(const UINT16 opcode) +inline void sh34_base_device::STSPR(const uint16_t opcode) { m_r[Rn] = m_pr; } /* STS.L MACH,@-Rn */ -inline void sh34_base_device::STSMMACH(const UINT16 opcode) +inline void sh34_base_device::STSMMACH(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -1863,9 +1863,9 @@ inline void sh34_base_device::STSMMACH(const UINT16 opcode) } /* STS.L MACL,@-Rn */ -inline void sh34_base_device::STSMMACL(const UINT16 opcode) +inline void sh34_base_device::STSMMACL(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -1873,9 +1873,9 @@ inline void sh34_base_device::STSMMACL(const UINT16 opcode) } /* STS.L PR,@-Rn */ -inline void sh34_base_device::STSMPR(const UINT16 opcode) +inline void sh34_base_device::STSMPR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -1883,17 +1883,17 @@ inline void sh34_base_device::STSMPR(const UINT16 opcode) } /* SUB Rm,Rn */ -inline void sh34_base_device::SUB(const UINT16 opcode) +inline void sh34_base_device::SUB(const uint16_t opcode) { m_r[Rn] -= m_r[Rm]; } /* SUBC Rm,Rn */ -inline void sh34_base_device::SUBC(const UINT16 opcode) +inline void sh34_base_device::SUBC(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - UINT32 tmp0, tmp1; + uint32_t tmp0, tmp1; tmp1 = m_r[n] - m_r[m]; tmp0 = m_r[n]; @@ -1907,23 +1907,23 @@ inline void sh34_base_device::SUBC(const UINT16 opcode) } /* SUBV Rm,Rn */ -inline void sh34_base_device::SUBV(const UINT16 opcode) +inline void sh34_base_device::SUBV(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - INT32 dest, src, ans; + int32_t dest, src, ans; - if ((INT32) m_r[n] >= 0) + if ((int32_t) m_r[n] >= 0) dest = 0; else dest = 1; - if ((INT32) m_r[m] >= 0) + if ((int32_t) m_r[m] >= 0) src = 0; else src = 1; src += dest; m_r[n] -= m_r[m]; - if ((INT32) m_r[n] >= 0) + if ((int32_t) m_r[n] >= 0) ans = 0; else ans = 1; @@ -1940,11 +1940,11 @@ inline void sh34_base_device::SUBV(const UINT16 opcode) } /* SWAP.B Rm,Rn */ -inline void sh34_base_device::SWAPB(const UINT16 opcode) +inline void sh34_base_device::SWAPB(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - UINT32 temp0, temp1; + uint32_t temp0, temp1; temp0 = m_r[m] & 0xffff0000; temp1 = (m_r[m] & 0x000000ff) << 8; @@ -1953,22 +1953,22 @@ inline void sh34_base_device::SWAPB(const UINT16 opcode) } /* SWAP.W Rm,Rn */ -inline void sh34_base_device::SWAPW(const UINT16 opcode) +inline void sh34_base_device::SWAPW(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - UINT32 temp; + uint32_t temp; temp = (m_r[m] >> 16) & 0x0000ffff; m_r[n] = (m_r[m] << 16) | temp; } /* TAS.B @Rn */ -inline void sh34_base_device::TAS(const UINT16 opcode) +inline void sh34_base_device::TAS(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; - UINT32 temp; + uint32_t temp; m_ea = m_r[n]; /* Bus Lock enable */ temp = RB( m_ea ); @@ -1983,9 +1983,9 @@ inline void sh34_base_device::TAS(const UINT16 opcode) } /* TRAPA #imm */ -inline void sh34_base_device::TRAPA(const UINT16 opcode) +inline void sh34_base_device::TRAPA(const uint16_t opcode) { - UINT32 imm = opcode & 0xff; + uint32_t imm = opcode & 0xff; if (m_cpu_type == CPU_TYPE_SH4) { @@ -2025,7 +2025,7 @@ inline void sh34_base_device::TRAPA(const UINT16 opcode) } /* TST Rm,Rn */ -inline void sh34_base_device::TST(const UINT16 opcode) +inline void sh34_base_device::TST(const uint16_t opcode) { if ((m_r[Rn] & m_r[Rm]) == 0) m_sr |= T; @@ -2034,9 +2034,9 @@ inline void sh34_base_device::TST(const UINT16 opcode) } /* TST #imm,R0 */ -inline void sh34_base_device::TSTI(const UINT16 opcode) +inline void sh34_base_device::TSTI(const uint16_t opcode) { - UINT32 imm = opcode & 0xff; + uint32_t imm = opcode & 0xff; if ((imm & m_r[0]) == 0) m_sr |= T; @@ -2045,9 +2045,9 @@ inline void sh34_base_device::TSTI(const UINT16 opcode) } /* TST.B #imm,@(R0,GBR) */ -inline void sh34_base_device::TSTM(const UINT16 opcode) +inline void sh34_base_device::TSTM(const uint16_t opcode) { - UINT32 imm = opcode & 0xff; + uint32_t imm = opcode & 0xff; m_ea = m_gbr + m_r[0]; if ((imm & RB( m_ea )) == 0) @@ -2058,23 +2058,23 @@ inline void sh34_base_device::TSTM(const UINT16 opcode) } /* XOR Rm,Rn */ -inline void sh34_base_device::XOR(const UINT16 opcode) +inline void sh34_base_device::XOR(const uint16_t opcode) { m_r[Rn] ^= m_r[Rm]; } /* XOR #imm,R0 */ -inline void sh34_base_device::XORI(const UINT16 opcode) +inline void sh34_base_device::XORI(const uint16_t opcode) { - UINT32 imm = opcode & 0xff; + uint32_t imm = opcode & 0xff; m_r[0] ^= imm; } /* XOR.B #imm,@(R0,GBR) */ -inline void sh34_base_device::XORM(const UINT16 opcode) +inline void sh34_base_device::XORM(const uint16_t opcode) { - UINT32 imm = opcode & 0xff; - UINT32 temp; + uint32_t imm = opcode & 0xff; + uint32_t temp; m_ea = m_gbr + m_r[0]; temp = RB( m_ea ); @@ -2084,11 +2084,11 @@ inline void sh34_base_device::XORM(const UINT16 opcode) } /* XTRCT Rm,Rn */ -inline void sh34_base_device::XTRCT(const UINT16 opcode) +inline void sh34_base_device::XTRCT(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; - UINT32 temp; + uint32_t temp; temp = (m_r[m] << 16) & 0xffff0000; m_r[n] = (m_r[n] >> 16) & 0x0000ffff; @@ -2096,53 +2096,53 @@ inline void sh34_base_device::XTRCT(const UINT16 opcode) } /* STC SSR,Rn */ -inline void sh34_base_device::STCSSR(const UINT16 opcode) +inline void sh34_base_device::STCSSR(const uint16_t opcode) { m_r[Rn] = m_ssr; } /* STC SPC,Rn */ -inline void sh34_base_device::STCSPC(const UINT16 opcode) +inline void sh34_base_device::STCSPC(const uint16_t opcode) { m_r[Rn] = m_spc; } /* STC SGR,Rn */ -inline void sh34_base_device::STCSGR(const UINT16 opcode) +inline void sh34_base_device::STCSGR(const uint16_t opcode) { m_r[Rn] = m_sgr; } /* STS FPUL,Rn */ -inline void sh34_base_device::STSFPUL(const UINT16 opcode) +inline void sh34_base_device::STSFPUL(const uint16_t opcode) { m_r[Rn] = m_fpul; } /* STS FPSCR,Rn */ -inline void sh34_base_device::STSFPSCR(const UINT16 opcode) +inline void sh34_base_device::STSFPSCR(const uint16_t opcode) { m_r[Rn] = m_fpscr & 0x003FFFFF; } /* STC DBR,Rn */ -inline void sh34_base_device::STCDBR(const UINT16 opcode) +inline void sh34_base_device::STCDBR(const uint16_t opcode) { m_r[Rn] = m_dbr; } /* STCRBANK Rm_BANK,Rn */ -inline void sh34_base_device::STCRBANK(const UINT16 opcode) +inline void sh34_base_device::STCRBANK(const uint16_t opcode) { - UINT32 m = Rm; + uint32_t m = Rm; m_r[Rn] = m_rbnk[m_sr&sRB ? 0 : 1][m & 7]; } /* STCMRBANK Rm_BANK,@-Rn */ -inline void sh34_base_device::STCMRBANK(const UINT16 opcode) +inline void sh34_base_device::STCMRBANK(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -2151,26 +2151,26 @@ inline void sh34_base_device::STCMRBANK(const UINT16 opcode) } /* MOVCA.L R0,@Rn */ -inline void sh34_base_device::MOVCAL(const UINT16 opcode) +inline void sh34_base_device::MOVCAL(const uint16_t opcode) { m_ea = m_r[Rn]; WL(m_ea, m_r[0] ); } -inline void sh34_base_device::CLRS(const UINT16 opcode) +inline void sh34_base_device::CLRS(const uint16_t opcode) { m_sr &= ~S; } -inline void sh34_base_device::SETS(const UINT16 opcode) +inline void sh34_base_device::SETS(const uint16_t opcode) { m_sr |= S; } /* STS.L SGR,@-Rn */ -inline void sh34_base_device::STCMSGR(const UINT16 opcode) +inline void sh34_base_device::STCMSGR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -2178,9 +2178,9 @@ inline void sh34_base_device::STCMSGR(const UINT16 opcode) } /* STS.L FPUL,@-Rn */ -inline void sh34_base_device::STSMFPUL(const UINT16 opcode) +inline void sh34_base_device::STSMFPUL(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -2188,9 +2188,9 @@ inline void sh34_base_device::STSMFPUL(const UINT16 opcode) } /* STS.L FPSCR,@-Rn */ -inline void sh34_base_device::STSMFPSCR(const UINT16 opcode) +inline void sh34_base_device::STSMFPSCR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -2198,9 +2198,9 @@ inline void sh34_base_device::STSMFPSCR(const UINT16 opcode) } /* STC.L DBR,@-Rn */ -inline void sh34_base_device::STCMDBR(const UINT16 opcode) +inline void sh34_base_device::STCMDBR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -2208,9 +2208,9 @@ inline void sh34_base_device::STCMDBR(const UINT16 opcode) } /* STC.L SSR,@-Rn */ -inline void sh34_base_device::STCMSSR(const UINT16 opcode) +inline void sh34_base_device::STCMSSR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -2218,9 +2218,9 @@ inline void sh34_base_device::STCMSSR(const UINT16 opcode) } /* STC.L SPC,@-Rn */ -inline void sh34_base_device::STCMSPC(const UINT16 opcode) +inline void sh34_base_device::STCMSPC(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; m_r[n] -= 4; m_ea = m_r[n]; @@ -2228,7 +2228,7 @@ inline void sh34_base_device::STCMSPC(const UINT16 opcode) } /* LDS.L @Rm+,FPUL */ -inline void sh34_base_device::LDSMFPUL(const UINT16 opcode) +inline void sh34_base_device::LDSMFPUL(const uint16_t opcode) { m_ea = m_r[Rn]; m_fpul = RL(m_ea ); @@ -2236,9 +2236,9 @@ inline void sh34_base_device::LDSMFPUL(const UINT16 opcode) } /* LDS.L @Rm+,FPSCR */ -inline void sh34_base_device::LDSMFPSCR(const UINT16 opcode) +inline void sh34_base_device::LDSMFPSCR(const uint16_t opcode) { - UINT32 s; + uint32_t s; s = m_fpscr; m_ea = m_r[Rn]; @@ -2256,7 +2256,7 @@ inline void sh34_base_device::LDSMFPSCR(const UINT16 opcode) } /* LDC.L @Rm+,DBR */ -inline void sh34_base_device::LDCMDBR(const UINT16 opcode) +inline void sh34_base_device::LDCMDBR(const uint16_t opcode) { m_ea = m_r[Rn]; m_dbr = RL(m_ea ); @@ -2264,9 +2264,9 @@ inline void sh34_base_device::LDCMDBR(const UINT16 opcode) } /* LDC.L @Rn+,Rm_BANK */ -inline void sh34_base_device::LDCMRBANK(const UINT16 opcode) +inline void sh34_base_device::LDCMRBANK(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; m_ea = m_r[n]; m_rbnk[m_sr&sRB ? 0 : 1][m & 7] = RL(m_ea ); @@ -2274,7 +2274,7 @@ inline void sh34_base_device::LDCMRBANK(const UINT16 opcode) } /* LDC.L @Rm+,SSR */ -inline void sh34_base_device::LDCMSSR(const UINT16 opcode) +inline void sh34_base_device::LDCMSSR(const uint16_t opcode) { m_ea = m_r[Rn]; m_ssr = RL(m_ea ); @@ -2282,7 +2282,7 @@ inline void sh34_base_device::LDCMSSR(const UINT16 opcode) } /* LDC.L @Rm+,SPC */ -inline void sh34_base_device::LDCMSPC(const UINT16 opcode) +inline void sh34_base_device::LDCMSPC(const uint16_t opcode) { m_ea = m_r[Rn]; m_spc = RL(m_ea ); @@ -2290,15 +2290,15 @@ inline void sh34_base_device::LDCMSPC(const UINT16 opcode) } /* LDS Rm,FPUL */ -inline void sh34_base_device::LDSFPUL(const UINT16 opcode) +inline void sh34_base_device::LDSFPUL(const uint16_t opcode) { m_fpul = m_r[Rn]; } /* LDS Rm,FPSCR */ -inline void sh34_base_device::LDSFPSCR(const UINT16 opcode) +inline void sh34_base_device::LDSFPSCR(const uint16_t opcode) { - UINT32 s; + uint32_t s; s = m_fpscr; m_fpscr = m_r[Rn] & 0x003FFFFF; @@ -2313,15 +2313,15 @@ inline void sh34_base_device::LDSFPSCR(const UINT16 opcode) } /* LDC Rm,DBR */ -inline void sh34_base_device::LDCDBR(const UINT16 opcode) +inline void sh34_base_device::LDCDBR(const uint16_t opcode) { m_dbr = m_r[Rn]; } /* SHAD Rm,Rn */ -inline void sh34_base_device::SHAD(const UINT16 opcode) +inline void sh34_base_device::SHAD(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if ((m_r[m] & 0x80000000) == 0) m_r[n] = m_r[n] << (m_r[m] & 0x1F); @@ -2331,13 +2331,13 @@ inline void sh34_base_device::SHAD(const UINT16 opcode) else m_r[n] = 0xFFFFFFFF; } else - m_r[n]=(INT32)m_r[n] >> ((~m_r[m] & 0x1F)+1); + m_r[n]=(int32_t)m_r[n] >> ((~m_r[m] & 0x1F)+1); } /* SHLD Rm,Rn */ -inline void sh34_base_device::SHLD(const UINT16 opcode) +inline void sh34_base_device::SHLD(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if ((m_r[m] & 0x80000000) == 0) m_r[n] = m_r[n] << (m_r[m] & 0x1F); @@ -2348,30 +2348,30 @@ inline void sh34_base_device::SHLD(const UINT16 opcode) } /* LDCRBANK Rn,Rm_BANK */ -inline void sh34_base_device::LDCRBANK(const UINT16 opcode) +inline void sh34_base_device::LDCRBANK(const uint16_t opcode) { - UINT32 m = Rm; + uint32_t m = Rm; m_rbnk[m_sr&sRB ? 0 : 1][m & 7] = m_r[Rn]; } /* LDC Rm,SSR */ -inline void sh34_base_device::LDCSSR(const UINT16 opcode) +inline void sh34_base_device::LDCSSR(const uint16_t opcode) { m_ssr = m_r[Rn]; } /* LDC Rm,SPC */ -inline void sh34_base_device::LDCSPC(const UINT16 opcode) +inline void sh34_base_device::LDCSPC(const uint16_t opcode) { m_spc = m_r[Rn]; } /* PREF @Rn */ -inline void sh34_base_device::PREFM(const UINT16 opcode) +inline void sh34_base_device::PREFM(const uint16_t opcode) { int a; - UINT32 addr,dest,sq; + uint32_t addr,dest,sq; addr = m_r[Rn]; // address if ((addr >= 0xE0000000) && (addr <= 0xE3FFFFFF)) @@ -2446,9 +2446,9 @@ inline void sh34_base_device::PREFM(const UINT16 opcode) /* FMOV @Rm+,DRn PR=0 SZ=1 1111nnn0mmmm1001 */ /* FMOV @Rm+,XDn PR=0 SZ=1 1111nnn1mmmm1001 */ /* FMOV @Rm+,XDn PR=1 1111nnn1mmmm1001 */ -inline void sh34_base_device::FMOVMRIFR(const UINT16 opcode) +inline void sh34_base_device::FMOVMRIFR(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2484,9 +2484,9 @@ inline void sh34_base_device::FMOVMRIFR(const UINT16 opcode) /* FMOV DRm,@Rn PR=0 SZ=1 1111nnnnmmm01010 */ /* FMOV XDm,@Rn PR=0 SZ=1 1111nnnnmmm11010 */ /* FMOV XDm,@Rn PR=1 1111nnnnmmm11010 */ -inline void sh34_base_device::FMOVFRMR(const UINT16 opcode) +inline void sh34_base_device::FMOVFRMR(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ m= m & 14; @@ -2516,9 +2516,9 @@ inline void sh34_base_device::FMOVFRMR(const UINT16 opcode) /* FMOV DRm,@-Rn PR=0 SZ=1 1111nnnnmmm01011 */ /* FMOV XDm,@-Rn PR=0 SZ=1 1111nnnnmmm11011 */ /* FMOV XDm,@-Rn PR=1 1111nnnnmmm11011 */ -inline void sh34_base_device::FMOVFRMDR(const UINT16 opcode) +inline void sh34_base_device::FMOVFRMDR(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ m= m & 14; @@ -2552,9 +2552,9 @@ inline void sh34_base_device::FMOVFRMDR(const UINT16 opcode) /* FMOV DRm,@(R0,Rn) PR=0 SZ=1 1111nnnnmmm00111 */ /* FMOV XDm,@(R0,Rn) PR=0 SZ=1 1111nnnnmmm10111 */ /* FMOV XDm,@(R0,Rn) PR=1 1111nnnnmmm10111 */ -inline void sh34_base_device::FMOVFRS0(const UINT16 opcode) +inline void sh34_base_device::FMOVFRS0(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ m= m & 14; @@ -2584,9 +2584,9 @@ inline void sh34_base_device::FMOVFRS0(const UINT16 opcode) /* FMOV @(R0,Rm),DRn PR=0 SZ=1 1111nnn0mmmm0110 */ /* FMOV @(R0,Rm),XDn PR=0 SZ=1 1111nnn1mmmm0110 */ /* FMOV @(R0,Rm),XDn PR=1 1111nnn1mmmm0110 */ -inline void sh34_base_device::FMOVS0FR(const UINT16 opcode) +inline void sh34_base_device::FMOVS0FR(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n= n & 14; @@ -2617,9 +2617,9 @@ inline void sh34_base_device::FMOVS0FR(const UINT16 opcode) /* FMOV @Rm,XDn PR=0 SZ=1 1111nnn1mmmm1000 */ /* FMOV @Rm,XDn PR=1 1111nnn1mmmm1000 */ /* FMOV @Rm,DRn PR=1 1111nnn0mmmm1000 */ -inline void sh34_base_device::FMOVMRFR(const UINT16 opcode) +inline void sh34_base_device::FMOVMRFR(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ if (n & 1) { @@ -2658,9 +2658,9 @@ inline void sh34_base_device::FMOVMRFR(const UINT16 opcode) /* FMOV XDm,DRn PR=1 XDm -> DRn 1111nnn0mmm11100 */ /* FMOV DRm,XDn PR=1 DRm -> XDn 1111nnn1mmm01100 */ /* FMOV XDm,XDn PR=1 XDm -> XDn 1111nnn1mmm11100 */ -inline void sh34_base_device::FMOVFR(const UINT16 opcode) +inline void sh34_base_device::FMOVFR(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if ((m_fpu_sz == 0) && (m_fpu_pr == 0)) /* SZ = 0 */ m_fr[n] = m_fr[m]; @@ -2686,25 +2686,25 @@ inline void sh34_base_device::FMOVFR(const UINT16 opcode) } /* FLDI1 FRn 1111nnnn10011101 */ -inline void sh34_base_device::FLDI1(const UINT16 opcode) +inline void sh34_base_device::FLDI1(const uint16_t opcode) { m_fr[Rn] = 0x3F800000; } /* FLDI0 FRn 1111nnnn10001101 */ -inline void sh34_base_device::FLDI0(const UINT16 opcode) +inline void sh34_base_device::FLDI0(const uint16_t opcode) { m_fr[Rn] = 0; } /* FLDS FRm,FPUL 1111mmmm00011101 */ -inline void sh34_base_device:: FLDS(const UINT16 opcode) +inline void sh34_base_device:: FLDS(const uint16_t opcode) { m_fpul = m_fr[Rn]; } /* FSTS FPUL,FRn 1111nnnn00001101 */ -inline void sh34_base_device:: FSTS(const UINT16 opcode) +inline void sh34_base_device:: FSTS(const uint16_t opcode) { m_fr[Rn] = m_fpul; } @@ -2725,44 +2725,44 @@ void sh34_base_device::FSCHG() /* FTRC FRm,FPUL PR=0 1111mmmm00111101 */ /* FTRC DRm,FPUL PR=1 1111mmm000111101 */ -inline void sh34_base_device::FTRC(const UINT16 opcode) +inline void sh34_base_device::FTRC(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ if(n & 1) fatalerror("SH-4: FTRC opcode used with n %d",n); n = n & 14; - *((INT32 *)&m_fpul) = (INT32)FP_RFD(n); + *((int32_t *)&m_fpul) = (int32_t)FP_RFD(n); } else { /* PR = 0 */ /* read m_fr[n] as float -> truncate -> fpul(32) */ - *((INT32 *)&m_fpul) = (INT32)FP_RFS(n); + *((int32_t *)&m_fpul) = (int32_t)FP_RFS(n); } } /* FLOAT FPUL,FRn PR=0 1111nnnn00101101 */ /* FLOAT FPUL,DRn PR=1 1111nnn000101101 */ -inline void sh34_base_device::FLOAT(const UINT16 opcode) +inline void sh34_base_device::FLOAT(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ if(n & 1) fatalerror("SH-4: FLOAT opcode used with n %d",n); n = n & 14; - FP_RFD(n) = (double)*((INT32 *)&m_fpul); + FP_RFD(n) = (double)*((int32_t *)&m_fpul); } else { /* PR = 0 */ - FP_RFS(n) = (float)*((INT32 *)&m_fpul); + FP_RFS(n) = (float)*((int32_t *)&m_fpul); } } /* FNEG FRn PR=0 1111nnnn01001101 */ /* FNEG DRn PR=1 1111nnn001001101 */ -inline void sh34_base_device::FNEG(const UINT16 opcode) +inline void sh34_base_device::FNEG(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ FP_RFD(n) = -FP_RFD(n); @@ -2773,9 +2773,9 @@ inline void sh34_base_device::FNEG(const UINT16 opcode) /* FABS FRn PR=0 1111nnnn01011101 */ /* FABS DRn PR=1 1111nnn001011101 */ -inline void sh34_base_device::FABS(const UINT16 opcode) +inline void sh34_base_device::FABS(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ #ifdef LSB_FIRST @@ -2792,9 +2792,9 @@ inline void sh34_base_device::FABS(const UINT16 opcode) /* FCMP/EQ FRm,FRn PR=0 1111nnnnmmmm0100 */ /* FCMP/EQ DRm,DRn PR=1 1111nnn0mmm00100 */ -inline void sh34_base_device::FCMP_EQ(const UINT16 opcode) +inline void sh34_base_device::FCMP_EQ(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2813,9 +2813,9 @@ inline void sh34_base_device::FCMP_EQ(const UINT16 opcode) /* FCMP/GT FRm,FRn PR=0 1111nnnnmmmm0101 */ /* FCMP/GT DRm,DRn PR=1 1111nnn0mmm00101 */ -inline void sh34_base_device::FCMP_GT(const UINT16 opcode) +inline void sh34_base_device::FCMP_GT(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2833,9 +2833,9 @@ inline void sh34_base_device::FCMP_GT(const UINT16 opcode) } /* FCNVDS DRm,FPUL PR=1 1111mmm010111101 */ -inline void sh34_base_device::FCNVDS(const UINT16 opcode) +inline void sh34_base_device::FCNVDS(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2846,9 +2846,9 @@ inline void sh34_base_device::FCNVDS(const UINT16 opcode) } /* FCNVSD FPUL, DRn PR=1 1111nnn010101101 */ -inline void sh34_base_device::FCNVSD(const UINT16 opcode) +inline void sh34_base_device::FCNVSD(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2858,9 +2858,9 @@ inline void sh34_base_device::FCNVSD(const UINT16 opcode) /* FADD FRm,FRn PR=0 1111nnnnmmmm0000 */ /* FADD DRm,DRn PR=1 1111nnn0mmm00000 */ -inline void sh34_base_device::FADD(const UINT16 opcode) +inline void sh34_base_device::FADD(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2873,9 +2873,9 @@ inline void sh34_base_device::FADD(const UINT16 opcode) /* FSUB FRm,FRn PR=0 1111nnnnmmmm0001 */ /* FSUB DRm,DRn PR=1 1111nnn0mmm00001 */ -inline void sh34_base_device::FSUB(const UINT16 opcode) +inline void sh34_base_device::FSUB(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2889,9 +2889,9 @@ inline void sh34_base_device::FSUB(const UINT16 opcode) /* FMUL FRm,FRn PR=0 1111nnnnmmmm0010 */ /* FMUL DRm,DRn PR=1 1111nnn0mmm00010 */ -inline void sh34_base_device::FMUL(const UINT16 opcode) +inline void sh34_base_device::FMUL(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2904,9 +2904,9 @@ inline void sh34_base_device::FMUL(const UINT16 opcode) /* FDIV FRm,FRn PR=0 1111nnnnmmmm0011 */ /* FDIV DRm,DRn PR=1 1111nnn0mmm00011 */ -inline void sh34_base_device::FDIV(const UINT16 opcode) +inline void sh34_base_device::FDIV(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2922,9 +2922,9 @@ inline void sh34_base_device::FDIV(const UINT16 opcode) } /* FMAC FR0,FRm,FRn PR=0 1111nnnnmmmm1110 */ -inline void sh34_base_device::FMAC(const UINT16 opcode) +inline void sh34_base_device::FMAC(const uint16_t opcode) { - UINT32 m = Rm; UINT32 n = Rn; + uint32_t m = Rm; uint32_t n = Rn; if (m_fpu_pr == 0) { /* PR = 0 */ FP_RFS(n) = (FP_RFS(0) * FP_RFS(m)) + FP_RFS(n); @@ -2933,9 +2933,9 @@ inline void sh34_base_device::FMAC(const UINT16 opcode) /* FSQRT FRn PR=0 1111nnnn01101101 */ /* FSQRT DRn PR=1 1111nnnn01101101 */ -inline void sh34_base_device::FSQRT(const UINT16 opcode) +inline void sh34_base_device::FSQRT(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; if (m_fpu_pr) { /* PR = 1 */ n = n & 14; @@ -2950,9 +2950,9 @@ inline void sh34_base_device::FSQRT(const UINT16 opcode) } /* FSRRA FRn PR=0 1111nnnn01111101 */ -inline void sh34_base_device::FSRRA(const UINT16 opcode) +inline void sh34_base_device::FSRRA(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; if (FP_RFS(n) < 0) return; @@ -2960,9 +2960,9 @@ inline void sh34_base_device::FSRRA(const UINT16 opcode) } /* FSSCA FPUL,FRn PR=0 1111nnn011111101 */ -void sh34_base_device::FSSCA(const UINT16 opcode) +void sh34_base_device::FSSCA(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; float angle; @@ -2972,11 +2972,11 @@ void sh34_base_device::FSSCA(const UINT16 opcode) } /* FIPR FVm,FVn PR=0 1111nnmm11101101 */ -inline void sh34_base_device::FIPR(const UINT16 opcode) +inline void sh34_base_device::FIPR(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; -UINT32 m; +uint32_t m; float ml[4]; int a; @@ -2988,9 +2988,9 @@ int a; } /* FTRV XMTRX,FVn PR=0 1111nn0111111101 */ -void sh34_base_device::FTRV(const UINT16 opcode) +void sh34_base_device::FTRV(const uint16_t opcode) { - UINT32 n = Rn; + uint32_t n = Rn; int i,j; float sum[4]; @@ -3005,7 +3005,7 @@ float sum[4]; FP_RFS(n + i) = sum[i]; } -inline void sh34_base_device::op1111_0xf13(const UINT16 opcode) +inline void sh34_base_device::op1111_0xf13(const uint16_t opcode) { if (opcode & 0x100) { if (opcode & 0x200) { @@ -3029,13 +3029,13 @@ inline void sh34_base_device::op1111_0xf13(const UINT16 opcode) } } -void sh34_base_device::dbreak(const UINT16 opcode) +void sh34_base_device::dbreak(const uint16_t opcode) { machine().debug_break(); } -inline void sh34_base_device::op1111_0x13(UINT16 opcode) +inline void sh34_base_device::op1111_0x13(uint16_t opcode) { switch((opcode >> 4) & 0x0f) { @@ -3187,7 +3187,7 @@ void sh4_base_device::device_reset() m_SH4_TCNT2 = 0xffffffff; } -inline void sh34_base_device::execute_one_0000(const UINT16 opcode) +inline void sh34_base_device::execute_one_0000(const uint16_t opcode) { switch(opcode & 0xff) { @@ -3466,7 +3466,7 @@ inline void sh34_base_device::execute_one_0000(const UINT16 opcode) } } -inline void sh34_base_device::execute_one_4000(const UINT16 opcode) +inline void sh34_base_device::execute_one_4000(const uint16_t opcode) { switch(opcode & 0xff) { @@ -3746,7 +3746,7 @@ inline void sh34_base_device::execute_one_4000(const UINT16 opcode) } -inline void sh34_base_device::execute_one(const UINT16 opcode) +inline void sh34_base_device::execute_one(const uint16_t opcode) { switch(opcode & 0xf000) { @@ -3939,7 +3939,7 @@ void sh34_base_device::execute_run() m_ppc = m_pc & AM; debugger_instruction_hook(this, m_pc & AM); - const UINT16 opcode = m_direct->read_word(m_pc & AM, WORD2_XOR_LE(0)); + const uint16_t opcode = m_direct->read_word(m_pc & AM, WORD2_XOR_LE(0)); if (m_delay) { @@ -3973,7 +3973,7 @@ void sh3be_device::execute_run() m_ppc = m_pc & AM; debugger_instruction_hook(this, m_pc & AM); - const UINT16 opcode = m_direct->read_word(m_pc & AM, WORD_XOR_LE(6)); + const uint16_t opcode = m_direct->read_word(m_pc & AM, WORD_XOR_LE(6)); if (m_delay) { @@ -4007,7 +4007,7 @@ void sh4be_device::execute_run() m_ppc = m_pc & AM; debugger_instruction_hook(this, m_pc & AM); - const UINT16 opcode = m_direct->read_word(m_pc & AM, WORD_XOR_LE(6)); + const uint16_t opcode = m_direct->read_word(m_pc & AM, WORD_XOR_LE(6)); if (m_delay) { @@ -4233,9 +4233,9 @@ void sh34_base_device::device_start() void sh34_base_device::state_import(const device_state_entry &entry) { #ifdef LSB_FIRST - UINT8 fpu_xor = m_fpu_pr; + uint8_t fpu_xor = m_fpu_pr; #else - UINT8 fpu_xor = 0; + uint8_t fpu_xor = 0; #endif switch (entry.index()) @@ -4394,9 +4394,9 @@ void sh34_base_device::state_export(const device_state_entry &entry) void sh34_base_device::state_string_export(const device_state_entry &entry, std::string &str) const { #ifdef LSB_FIRST - UINT8 fpu_xor = m_fpu_pr; + uint8_t fpu_xor = m_fpu_pr; #else - UINT8 fpu_xor = 0; + uint8_t fpu_xor = 0; #endif switch (entry.index()) diff --git a/src/devices/cpu/sh4/sh4.h b/src/devices/cpu/sh4/sh4.h index badaacd4558..0b8f33926f5 100644 --- a/src/devices/cpu/sh4/sh4.h +++ b/src/devices/cpu/sh4/sh4.h @@ -118,25 +118,25 @@ enum struct sh4_device_dma { - UINT32 length; - UINT32 size; + uint32_t length; + uint32_t size; void *buffer; int channel; }; struct sh4_ddt_dma { - UINT32 source; - UINT32 length; - UINT32 size; - UINT32 destination; + uint32_t source; + uint32_t length; + uint32_t size; + uint32_t destination; void *buffer; int direction; int channel; int mode; }; -typedef void (*sh4_ftcsr_callback)(UINT32); +typedef void (*sh4_ftcsr_callback)(uint32_t); #define MCFG_SH4_MD0(_md0) \ @@ -174,10 +174,10 @@ class sh34_base_device : public cpu_device { public: // construction/destruction - sh34_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, endianness_t endianness, address_map_constructor internal); + sh34_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, endianness_t endianness, address_map_constructor internal); //#if SH4_USE_FASTRAM_OPTIMIZATION - void add_fastram(offs_t start, offs_t end, UINT8 readonly, void *base); + void add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base); //#endif static void set_md0(device_t &device, int md0) { downcast(device).c_md0 = md0; } @@ -208,9 +208,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 4; } - virtual UINT32 execute_input_lines() const override { return 5; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 4; } + virtual uint32_t execute_input_lines() const override { return 5; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -223,9 +223,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; protected: address_space_config m_program_config; @@ -242,87 +242,87 @@ protected: int c_md8; int c_clock; - UINT32 m_ppc; - UINT32 m_pc; - UINT32 m_spc; - UINT32 m_pr; - UINT32 m_sr; - UINT32 m_ssr; - UINT32 m_gbr; - UINT32 m_vbr; - UINT32 m_mach; - UINT32 m_macl; - UINT32 m_r[16]; - UINT32 m_rbnk[2][8]; - UINT32 m_sgr; - UINT32 m_fr[16]; - UINT32 m_xf[16]; - UINT32 m_ea; - UINT32 m_delay; - UINT32 m_cpu_off; - UINT32 m_pending_irq; - UINT32 m_test_irq; - UINT32 m_fpscr; - UINT32 m_fpul; - UINT32 m_dbr; - - UINT32 m_exception_priority[128]; + uint32_t m_ppc; + uint32_t m_pc; + uint32_t m_spc; + uint32_t m_pr; + uint32_t m_sr; + uint32_t m_ssr; + uint32_t m_gbr; + uint32_t m_vbr; + uint32_t m_mach; + uint32_t m_macl; + uint32_t m_r[16]; + uint32_t m_rbnk[2][8]; + uint32_t m_sgr; + uint32_t m_fr[16]; + uint32_t m_xf[16]; + uint32_t m_ea; + uint32_t m_delay; + uint32_t m_cpu_off; + uint32_t m_pending_irq; + uint32_t m_test_irq; + uint32_t m_fpscr; + uint32_t m_fpul; + uint32_t m_dbr; + + uint32_t m_exception_priority[128]; int m_exception_requesting[128]; - INT8 m_irq_line_state[17]; + int8_t m_irq_line_state[17]; address_space *m_internal; address_space *m_program; direct_read_data *m_direct; address_space *m_io; // sh4 internal - UINT32 m_m[16384]; + uint32_t m_m[16384]; // timer regs handled manually for reuse - UINT32 m_SH4_TSTR; - UINT32 m_SH4_TCNT0; - UINT32 m_SH4_TCNT1; - UINT32 m_SH4_TCNT2; - UINT32 m_SH4_TCR0; - UINT32 m_SH4_TCR1; - UINT32 m_SH4_TCR2; - UINT32 m_SH4_TCOR0; - UINT32 m_SH4_TCOR1; - UINT32 m_SH4_TCOR2; - UINT32 m_SH4_TOCR; - UINT32 m_SH4_TCPR2; + uint32_t m_SH4_TSTR; + uint32_t m_SH4_TCNT0; + uint32_t m_SH4_TCNT1; + uint32_t m_SH4_TCNT2; + uint32_t m_SH4_TCR0; + uint32_t m_SH4_TCR1; + uint32_t m_SH4_TCR2; + uint32_t m_SH4_TCOR0; + uint32_t m_SH4_TCOR1; + uint32_t m_SH4_TCOR2; + uint32_t m_SH4_TOCR; + uint32_t m_SH4_TCPR2; // INTC regs - UINT32 m_SH4_IPRA; + uint32_t m_SH4_IPRA; - UINT32 m_SH4_IPRC; + uint32_t m_SH4_IPRC; // DMAC regs - UINT32 m_SH4_SAR0; - UINT32 m_SH4_SAR1; - UINT32 m_SH4_SAR2; - UINT32 m_SH4_SAR3; + uint32_t m_SH4_SAR0; + uint32_t m_SH4_SAR1; + uint32_t m_SH4_SAR2; + uint32_t m_SH4_SAR3; - UINT32 m_SH4_DAR0; - UINT32 m_SH4_DAR1; - UINT32 m_SH4_DAR2; - UINT32 m_SH4_DAR3; + uint32_t m_SH4_DAR0; + uint32_t m_SH4_DAR1; + uint32_t m_SH4_DAR2; + uint32_t m_SH4_DAR3; - UINT32 m_SH4_CHCR0; - UINT32 m_SH4_CHCR1; - UINT32 m_SH4_CHCR2; - UINT32 m_SH4_CHCR3; + uint32_t m_SH4_CHCR0; + uint32_t m_SH4_CHCR1; + uint32_t m_SH4_CHCR2; + uint32_t m_SH4_CHCR3; - UINT32 m_SH4_DMATCR0; - UINT32 m_SH4_DMATCR1; - UINT32 m_SH4_DMATCR2; - UINT32 m_SH4_DMATCR3; + uint32_t m_SH4_DMATCR0; + uint32_t m_SH4_DMATCR1; + uint32_t m_SH4_DMATCR2; + uint32_t m_SH4_DMATCR3; - UINT32 m_SH4_DMAOR; + uint32_t m_SH4_DMAOR; - INT8 m_nmi_line_state; + int8_t m_nmi_line_state; - UINT8 m_sleep_mode; + uint8_t m_sleep_mode; int m_frt_input; int m_irln; @@ -333,11 +333,11 @@ protected: emu_timer *m_refresh_timer; emu_timer *m_rtc_timer; emu_timer *m_timer[3]; - UINT32 m_refresh_timer_base; + uint32_t m_refresh_timer_base; int m_dma_timer_active[4]; - UINT32 m_dma_source[4]; - UINT32 m_dma_destination[4]; - UINT32 m_dma_count[4]; + uint32_t m_dma_source[4]; + uint32_t m_dma_destination[4]; + uint32_t m_dma_count[4]; int m_dma_wordsize[4]; int m_dma_source_increment[4]; int m_dma_destination_increment[4]; @@ -355,25 +355,25 @@ protected: int m_ioport4_pullup; int m_ioport4_direction; - void (*m_ftcsr_read_callback)(UINT32 data); + void (*m_ftcsr_read_callback)(uint32_t data); /* This MMU simulation is good for the simple remap used on Naomi GD-ROM SQ access *ONLY* */ - UINT32 m_sh4_tlb_address[64]; - UINT32 m_sh4_tlb_data[64]; - UINT8 m_sh4_mmu_enabled; + uint32_t m_sh4_tlb_address[64]; + uint32_t m_sh4_tlb_data[64]; + uint8_t m_sh4_mmu_enabled; int m_cpu_type; // sh3 internal - UINT32 m_sh3internal_upper[0x3000/4]; - UINT32 m_sh3internal_lower[0x1000]; + uint32_t m_sh3internal_upper[0x3000/4]; + uint32_t m_sh3internal_lower[0x1000]; - UINT64 m_debugger_temp; + uint64_t m_debugger_temp; - void execute_one_0000(const UINT16 opcode); - void execute_one_4000(const UINT16 opcode); - void execute_one(const UINT16 opcode); + void execute_one_0000(const uint16_t opcode); + void execute_one_4000(const uint16_t opcode); + void execute_one(const uint16_t opcode); inline void sh4_check_pending_irq(const char *message) // look for highest priority active exception and handle it { int a,irq,z; @@ -397,221 +397,221 @@ protected: } } - void TODO(const UINT16 opcode); - void WB(offs_t A, UINT8 V); - void WW(offs_t A, UINT16 V); - void WL(offs_t A, UINT32 V); - void ADD(const UINT16 opcode); - void ADDI(const UINT16 opcode); - void ADDC(const UINT16 opcode); - void ADDV(const UINT16 opcode); - void AND(const UINT16 opcode); - void ANDI(const UINT16 opcode); - void ANDM(const UINT16 opcode); - void BF(const UINT16 opcode); - void BFS(const UINT16 opcode); - void BRA(const UINT16 opcode); - void BRAF(const UINT16 opcode); - void BSR(const UINT16 opcode); - void BSRF(const UINT16 opcode); - void BT(const UINT16 opcode); - void BTS(const UINT16 opcode); - void CLRMAC(const UINT16 opcode); - void CLRT(const UINT16 opcode); - void CMPEQ(const UINT16 opcode); - void CMPGE(const UINT16 opcode); - void CMPGT(const UINT16 opcode); - void CMPHI(const UINT16 opcode); - void CMPHS(const UINT16 opcode); - void CMPPL(const UINT16 opcode); - void CMPPZ(const UINT16 opcode); - void CMPSTR(const UINT16 opcode); - void CMPIM(const UINT16 opcode); - void DIV0S(const UINT16 opcode); - void DIV0U(const UINT16 opcode); - void DIV1(const UINT16 opcode); - void DMULS(const UINT16 opcode); - void DMULU(const UINT16 opcode); - void DT(const UINT16 opcode); - void EXTSB(const UINT16 opcode); - void EXTSW(const UINT16 opcode); - void EXTUB(const UINT16 opcode); - void EXTUW(const UINT16 opcode); - void JMP(const UINT16 opcode); - void JSR(const UINT16 opcode); - void LDCSR(const UINT16 opcode); - void LDCGBR(const UINT16 opcode); - void LDCVBR(const UINT16 opcode); - void LDCMSR(const UINT16 opcode); - void LDCMGBR(const UINT16 opcode); - void LDCMVBR(const UINT16 opcode); - void LDSMACH(const UINT16 opcode); - void LDSMACL(const UINT16 opcode); - void LDSPR(const UINT16 opcode); - void LDSMMACH(const UINT16 opcode); - void LDSMMACL(const UINT16 opcode); - void LDSMPR(const UINT16 opcode); - void MAC_L(const UINT16 opcode); - void MAC_W(const UINT16 opcode); - void MOV(const UINT16 opcode); - void MOVBS(const UINT16 opcode); - void MOVWS(const UINT16 opcode); - void MOVLS(const UINT16 opcode); - void MOVBL(const UINT16 opcode); - void MOVWL(const UINT16 opcode); - void MOVLL(const UINT16 opcode); - void MOVBM(const UINT16 opcode); - void MOVWM(const UINT16 opcode); - void MOVLM(const UINT16 opcode); - void MOVBP(const UINT16 opcode); - void MOVWP(const UINT16 opcode); - void MOVLP(const UINT16 opcode); - void MOVBS0(const UINT16 opcode); - void MOVWS0(const UINT16 opcode); - void MOVLS0(const UINT16 opcode); - void MOVBL0(const UINT16 opcode); - void MOVWL0(const UINT16 opcode); - void MOVLL0(const UINT16 opcode); - void MOVI(const UINT16 opcode); - void MOVWI(const UINT16 opcode); - void MOVLI(const UINT16 opcode); - void MOVBLG(const UINT16 opcode); - void MOVWLG(const UINT16 opcode); - void MOVLLG(const UINT16 opcode); - void MOVBSG(const UINT16 opcode); - void MOVWSG(const UINT16 opcode); - void MOVLSG(const UINT16 opcode); - void MOVBS4(const UINT16 opcode); - void MOVWS4(const UINT16 opcode); - void MOVLS4(const UINT16 opcode); - void MOVBL4(const UINT16 opcode); - void MOVWL4(const UINT16 opcode); - void MOVLL4(const UINT16 opcode); - void MOVA(const UINT16 opcode); - void MOVT(const UINT16 opcode); - void MULL(const UINT16 opcode); - void MULS(const UINT16 opcode); - void MULU(const UINT16 opcode); - void NEG(const UINT16 opcode); - void NEGC(const UINT16 opcode); - void NOP(const UINT16 opcode); - void NOT(const UINT16 opcode); - void OR(const UINT16 opcode); - void ORI(const UINT16 opcode); - void ORM(const UINT16 opcode); - void ROTCL(const UINT16 opcode); - void ROTCR(const UINT16 opcode); - void ROTL(const UINT16 opcode); - void ROTR(const UINT16 opcode); - void RTE(const UINT16 opcode); - void RTS(const UINT16 opcode); - void SETT(const UINT16 opcode); - void SHAL(const UINT16 opcode); - void SHAR(const UINT16 opcode); - void SHLL(const UINT16 opcode); - void SHLL2(const UINT16 opcode); - void SHLL8(const UINT16 opcode); - void SHLL16(const UINT16 opcode); - void SHLR(const UINT16 opcode); - void SHLR2(const UINT16 opcode); - void SHLR8(const UINT16 opcode); - void SHLR16(const UINT16 opcode); - void SLEEP(const UINT16 opcode); - void STCSR(const UINT16 opcode); - void STCGBR(const UINT16 opcode); - void STCVBR(const UINT16 opcode); - void STCMSR(const UINT16 opcode); - void STCMGBR(const UINT16 opcode); - void STCMVBR(const UINT16 opcode); - void STSMACH(const UINT16 opcode); - void STSMACL(const UINT16 opcode); - void STSPR(const UINT16 opcode); - void STSMMACH(const UINT16 opcode); - void STSMMACL(const UINT16 opcode); - void STSMPR(const UINT16 opcode); - void SUB(const UINT16 opcode); - void SUBC(const UINT16 opcode); - void SUBV(const UINT16 opcode); - void SWAPB(const UINT16 opcode); - void SWAPW(const UINT16 opcode); - void TAS(const UINT16 opcode); - void TRAPA(const UINT16 opcode); - void TST(const UINT16 opcode); - void TSTI(const UINT16 opcode); - void TSTM(const UINT16 opcode); - void XOR(const UINT16 opcode); - void XORI(const UINT16 opcode); - void XORM(const UINT16 opcode); - void XTRCT(const UINT16 opcode); - void STCSSR(const UINT16 opcode); - void STCSPC(const UINT16 opcode); - void STCSGR(const UINT16 opcode); - void STSFPUL(const UINT16 opcode); - void STSFPSCR(const UINT16 opcode); - void STCDBR(const UINT16 opcode); - void STCRBANK(const UINT16 opcode); - void STCMRBANK(const UINT16 opcode); - void MOVCAL(const UINT16 opcode); - void CLRS(const UINT16 opcode); - void SETS(const UINT16 opcode); - void STCMSGR(const UINT16 opcode); - void STSMFPUL(const UINT16 opcode); - void STSMFPSCR(const UINT16 opcode); - void STCMDBR(const UINT16 opcode); - void STCMSSR(const UINT16 opcode); - void STCMSPC(const UINT16 opcode); - void LDSMFPUL(const UINT16 opcode); - void LDSMFPSCR(const UINT16 opcode); - void LDCMDBR(const UINT16 opcode); - void LDCMRBANK(const UINT16 opcode); - void LDCMSSR(const UINT16 opcode); - void LDCMSPC(const UINT16 opcode); - void LDSFPUL(const UINT16 opcode); - void LDSFPSCR(const UINT16 opcode); - void LDCDBR(const UINT16 opcode); - void SHAD(const UINT16 opcode); - void SHLD(const UINT16 opcode); - void LDCRBANK(const UINT16 opcode); - void LDCSSR(const UINT16 opcode); - void LDCSPC(const UINT16 opcode); - void PREFM(const UINT16 opcode); - void FMOVMRIFR(const UINT16 opcode); - void FMOVFRMR(const UINT16 opcode); - void FMOVFRMDR(const UINT16 opcode); - void FMOVFRS0(const UINT16 opcode); - void FMOVS0FR(const UINT16 opcode); - void FMOVMRFR(const UINT16 opcode); - void FMOVFR(const UINT16 opcode); - void FLDI1(const UINT16 opcode); - void FLDI0(const UINT16 opcode); - void FLDS(const UINT16 opcode); - void FSTS(const UINT16 opcode); + void TODO(const uint16_t opcode); + void WB(offs_t A, uint8_t V); + void WW(offs_t A, uint16_t V); + void WL(offs_t A, uint32_t V); + void ADD(const uint16_t opcode); + void ADDI(const uint16_t opcode); + void ADDC(const uint16_t opcode); + void ADDV(const uint16_t opcode); + void AND(const uint16_t opcode); + void ANDI(const uint16_t opcode); + void ANDM(const uint16_t opcode); + void BF(const uint16_t opcode); + void BFS(const uint16_t opcode); + void BRA(const uint16_t opcode); + void BRAF(const uint16_t opcode); + void BSR(const uint16_t opcode); + void BSRF(const uint16_t opcode); + void BT(const uint16_t opcode); + void BTS(const uint16_t opcode); + void CLRMAC(const uint16_t opcode); + void CLRT(const uint16_t opcode); + void CMPEQ(const uint16_t opcode); + void CMPGE(const uint16_t opcode); + void CMPGT(const uint16_t opcode); + void CMPHI(const uint16_t opcode); + void CMPHS(const uint16_t opcode); + void CMPPL(const uint16_t opcode); + void CMPPZ(const uint16_t opcode); + void CMPSTR(const uint16_t opcode); + void CMPIM(const uint16_t opcode); + void DIV0S(const uint16_t opcode); + void DIV0U(const uint16_t opcode); + void DIV1(const uint16_t opcode); + void DMULS(const uint16_t opcode); + void DMULU(const uint16_t opcode); + void DT(const uint16_t opcode); + void EXTSB(const uint16_t opcode); + void EXTSW(const uint16_t opcode); + void EXTUB(const uint16_t opcode); + void EXTUW(const uint16_t opcode); + void JMP(const uint16_t opcode); + void JSR(const uint16_t opcode); + void LDCSR(const uint16_t opcode); + void LDCGBR(const uint16_t opcode); + void LDCVBR(const uint16_t opcode); + void LDCMSR(const uint16_t opcode); + void LDCMGBR(const uint16_t opcode); + void LDCMVBR(const uint16_t opcode); + void LDSMACH(const uint16_t opcode); + void LDSMACL(const uint16_t opcode); + void LDSPR(const uint16_t opcode); + void LDSMMACH(const uint16_t opcode); + void LDSMMACL(const uint16_t opcode); + void LDSMPR(const uint16_t opcode); + void MAC_L(const uint16_t opcode); + void MAC_W(const uint16_t opcode); + void MOV(const uint16_t opcode); + void MOVBS(const uint16_t opcode); + void MOVWS(const uint16_t opcode); + void MOVLS(const uint16_t opcode); + void MOVBL(const uint16_t opcode); + void MOVWL(const uint16_t opcode); + void MOVLL(const uint16_t opcode); + void MOVBM(const uint16_t opcode); + void MOVWM(const uint16_t opcode); + void MOVLM(const uint16_t opcode); + void MOVBP(const uint16_t opcode); + void MOVWP(const uint16_t opcode); + void MOVLP(const uint16_t opcode); + void MOVBS0(const uint16_t opcode); + void MOVWS0(const uint16_t opcode); + void MOVLS0(const uint16_t opcode); + void MOVBL0(const uint16_t opcode); + void MOVWL0(const uint16_t opcode); + void MOVLL0(const uint16_t opcode); + void MOVI(const uint16_t opcode); + void MOVWI(const uint16_t opcode); + void MOVLI(const uint16_t opcode); + void MOVBLG(const uint16_t opcode); + void MOVWLG(const uint16_t opcode); + void MOVLLG(const uint16_t opcode); + void MOVBSG(const uint16_t opcode); + void MOVWSG(const uint16_t opcode); + void MOVLSG(const uint16_t opcode); + void MOVBS4(const uint16_t opcode); + void MOVWS4(const uint16_t opcode); + void MOVLS4(const uint16_t opcode); + void MOVBL4(const uint16_t opcode); + void MOVWL4(const uint16_t opcode); + void MOVLL4(const uint16_t opcode); + void MOVA(const uint16_t opcode); + void MOVT(const uint16_t opcode); + void MULL(const uint16_t opcode); + void MULS(const uint16_t opcode); + void MULU(const uint16_t opcode); + void NEG(const uint16_t opcode); + void NEGC(const uint16_t opcode); + void NOP(const uint16_t opcode); + void NOT(const uint16_t opcode); + void OR(const uint16_t opcode); + void ORI(const uint16_t opcode); + void ORM(const uint16_t opcode); + void ROTCL(const uint16_t opcode); + void ROTCR(const uint16_t opcode); + void ROTL(const uint16_t opcode); + void ROTR(const uint16_t opcode); + void RTE(const uint16_t opcode); + void RTS(const uint16_t opcode); + void SETT(const uint16_t opcode); + void SHAL(const uint16_t opcode); + void SHAR(const uint16_t opcode); + void SHLL(const uint16_t opcode); + void SHLL2(const uint16_t opcode); + void SHLL8(const uint16_t opcode); + void SHLL16(const uint16_t opcode); + void SHLR(const uint16_t opcode); + void SHLR2(const uint16_t opcode); + void SHLR8(const uint16_t opcode); + void SHLR16(const uint16_t opcode); + void SLEEP(const uint16_t opcode); + void STCSR(const uint16_t opcode); + void STCGBR(const uint16_t opcode); + void STCVBR(const uint16_t opcode); + void STCMSR(const uint16_t opcode); + void STCMGBR(const uint16_t opcode); + void STCMVBR(const uint16_t opcode); + void STSMACH(const uint16_t opcode); + void STSMACL(const uint16_t opcode); + void STSPR(const uint16_t opcode); + void STSMMACH(const uint16_t opcode); + void STSMMACL(const uint16_t opcode); + void STSMPR(const uint16_t opcode); + void SUB(const uint16_t opcode); + void SUBC(const uint16_t opcode); + void SUBV(const uint16_t opcode); + void SWAPB(const uint16_t opcode); + void SWAPW(const uint16_t opcode); + void TAS(const uint16_t opcode); + void TRAPA(const uint16_t opcode); + void TST(const uint16_t opcode); + void TSTI(const uint16_t opcode); + void TSTM(const uint16_t opcode); + void XOR(const uint16_t opcode); + void XORI(const uint16_t opcode); + void XORM(const uint16_t opcode); + void XTRCT(const uint16_t opcode); + void STCSSR(const uint16_t opcode); + void STCSPC(const uint16_t opcode); + void STCSGR(const uint16_t opcode); + void STSFPUL(const uint16_t opcode); + void STSFPSCR(const uint16_t opcode); + void STCDBR(const uint16_t opcode); + void STCRBANK(const uint16_t opcode); + void STCMRBANK(const uint16_t opcode); + void MOVCAL(const uint16_t opcode); + void CLRS(const uint16_t opcode); + void SETS(const uint16_t opcode); + void STCMSGR(const uint16_t opcode); + void STSMFPUL(const uint16_t opcode); + void STSMFPSCR(const uint16_t opcode); + void STCMDBR(const uint16_t opcode); + void STCMSSR(const uint16_t opcode); + void STCMSPC(const uint16_t opcode); + void LDSMFPUL(const uint16_t opcode); + void LDSMFPSCR(const uint16_t opcode); + void LDCMDBR(const uint16_t opcode); + void LDCMRBANK(const uint16_t opcode); + void LDCMSSR(const uint16_t opcode); + void LDCMSPC(const uint16_t opcode); + void LDSFPUL(const uint16_t opcode); + void LDSFPSCR(const uint16_t opcode); + void LDCDBR(const uint16_t opcode); + void SHAD(const uint16_t opcode); + void SHLD(const uint16_t opcode); + void LDCRBANK(const uint16_t opcode); + void LDCSSR(const uint16_t opcode); + void LDCSPC(const uint16_t opcode); + void PREFM(const uint16_t opcode); + void FMOVMRIFR(const uint16_t opcode); + void FMOVFRMR(const uint16_t opcode); + void FMOVFRMDR(const uint16_t opcode); + void FMOVFRS0(const uint16_t opcode); + void FMOVS0FR(const uint16_t opcode); + void FMOVMRFR(const uint16_t opcode); + void FMOVFR(const uint16_t opcode); + void FLDI1(const uint16_t opcode); + void FLDI0(const uint16_t opcode); + void FLDS(const uint16_t opcode); + void FSTS(const uint16_t opcode); void FRCHG(); void FSCHG(); - void FTRC(const UINT16 opcode); - void FLOAT(const UINT16 opcode); - void FNEG(const UINT16 opcode); - void FABS(const UINT16 opcode); - void FCMP_EQ(const UINT16 opcode); - void FCMP_GT(const UINT16 opcode); - void FCNVDS(const UINT16 opcode); - void FCNVSD(const UINT16 opcode); - void FADD(const UINT16 opcode); - void FSUB(const UINT16 opcode); - void FMUL(const UINT16 opcode); - void FDIV(const UINT16 opcode); - void FMAC(const UINT16 opcode); - void FSQRT(const UINT16 opcode); - void FSRRA(const UINT16 opcode); - void FSSCA(const UINT16 opcode); - void FIPR(const UINT16 opcode); - void FTRV(const UINT16 opcode); - void op1111_0xf13(const UINT16 opcode); - void dbreak(const UINT16 opcode); - void op1111_0x13(UINT16 opcode); - UINT8 RB(offs_t A); - UINT16 RW(offs_t A); - UINT32 RL(offs_t A); + void FTRC(const uint16_t opcode); + void FLOAT(const uint16_t opcode); + void FNEG(const uint16_t opcode); + void FABS(const uint16_t opcode); + void FCMP_EQ(const uint16_t opcode); + void FCMP_GT(const uint16_t opcode); + void FCNVDS(const uint16_t opcode); + void FCNVSD(const uint16_t opcode); + void FADD(const uint16_t opcode); + void FSUB(const uint16_t opcode); + void FMUL(const uint16_t opcode); + void FDIV(const uint16_t opcode); + void FMAC(const uint16_t opcode); + void FSQRT(const uint16_t opcode); + void FSRRA(const uint16_t opcode); + void FSSCA(const uint16_t opcode); + void FIPR(const uint16_t opcode); + void FTRV(const uint16_t opcode); + void op1111_0xf13(const uint16_t opcode); + void dbreak(const uint16_t opcode); + void op1111_0x13(uint16_t opcode); + uint8_t RB(offs_t A); + uint16_t RW(offs_t A); + uint32_t RL(offs_t A); void sh4_change_register_bank(int to); void sh4_swap_fp_registers(); void sh4_swap_fp_couples(); @@ -622,88 +622,88 @@ protected: void sh4_exception_unrequest(int exception); void sh4_exception_checkunrequest(int exception); void sh4_exception(const char *message, int exception); - UINT32 compute_ticks_refresh_timer(emu_timer *timer, int hertz, int base, int divisor); + uint32_t compute_ticks_refresh_timer(emu_timer *timer, int hertz, int base, int divisor); void sh4_refresh_timer_recompute(); void increment_rtc_time(int mode); void sh4_dmac_nmi(); - void sh4_handler_ipra_w(UINT32 data, UINT32 mem_mask); - UINT32 sh4_getsqremap(UINT32 address); + void sh4_handler_ipra_w(uint32_t data, uint32_t mem_mask); + uint32_t sh4_getsqremap(uint32_t address); void sh4_parse_configuration(); void sh4_timer_recompute(int which); - UINT32 sh4_handle_tcnt0_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tcnt1_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tcnt2_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tcor0_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tcor1_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tcor2_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tcr0_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tcr1_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tcr2_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tstr_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tocr_addr_r(UINT32 mem_mask); - UINT32 sh4_handle_tcpr2_addr_r(UINT32 mem_mask); - void sh4_handle_tstr_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcr0_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcr1_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcr2_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcor0_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcor1_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcor2_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcnt0_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcnt1_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcnt2_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tocr_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_tcpr2_addr_w(UINT32 data, UINT32 mem_mask); - int sh4_dma_transfer(int channel, int timermode, UINT32 chcr, UINT32 *sar, UINT32 *dar, UINT32 *dmatcr); - int sh4_dma_transfer_device(int channel, UINT32 chcr, UINT32 *sar, UINT32 *dar, UINT32 *dmatcr); + uint32_t sh4_handle_tcnt0_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tcnt1_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tcnt2_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tcor0_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tcor1_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tcor2_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tcr0_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tcr1_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tcr2_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tstr_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tocr_addr_r(uint32_t mem_mask); + uint32_t sh4_handle_tcpr2_addr_r(uint32_t mem_mask); + void sh4_handle_tstr_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcr0_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcr1_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcr2_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcor0_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcor1_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcor2_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcnt0_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcnt1_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcnt2_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tocr_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_tcpr2_addr_w(uint32_t data, uint32_t mem_mask); + int sh4_dma_transfer(int channel, int timermode, uint32_t chcr, uint32_t *sar, uint32_t *dar, uint32_t *dmatcr); + int sh4_dma_transfer_device(int channel, uint32_t chcr, uint32_t *sar, uint32_t *dar, uint32_t *dmatcr); void sh4_dmac_check(int channel); - void sh4_handle_sar0_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_sar1_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_sar2_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_sar3_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_dar0_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_dar1_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_dar2_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_dar3_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_dmatcr0_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_dmatcr1_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_dmatcr2_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_dmatcr3_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_chcr0_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_chcr1_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_chcr2_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_chcr3_addr_w(UINT32 data, UINT32 mem_mask); - void sh4_handle_dmaor_addr_w(UINT32 data, UINT32 mem_mask); - UINT32 sh4_handle_sar0_addr_r(UINT32 mem_mask) { return m_SH4_SAR0; } - UINT32 sh4_handle_sar1_addr_r(UINT32 mem_mask) { return m_SH4_SAR1; } - UINT32 sh4_handle_sar2_addr_r(UINT32 mem_mask) { return m_SH4_SAR2; } - UINT32 sh4_handle_sar3_addr_r(UINT32 mem_mask) { return m_SH4_SAR3; } - UINT32 sh4_handle_dar0_addr_r(UINT32 mem_mask) { return m_SH4_DAR0; } - UINT32 sh4_handle_dar1_addr_r(UINT32 mem_mask) { return m_SH4_DAR1; } - UINT32 sh4_handle_dar2_addr_r(UINT32 mem_mask) { return m_SH4_DAR2; } - UINT32 sh4_handle_dar3_addr_r(UINT32 mem_mask) { return m_SH4_DAR3; } - UINT32 sh4_handle_dmatcr0_addr_r(UINT32 mem_mask) { return m_SH4_DMATCR0; } - UINT32 sh4_handle_dmatcr1_addr_r(UINT32 mem_mask) { return m_SH4_DMATCR1; } - UINT32 sh4_handle_dmatcr2_addr_r(UINT32 mem_mask) { return m_SH4_DMATCR2; } - UINT32 sh4_handle_dmatcr3_addr_r(UINT32 mem_mask) { return m_SH4_DMATCR3; } - UINT32 sh4_handle_chcr0_addr_r(UINT32 mem_mask) { return m_SH4_CHCR0; } - UINT32 sh4_handle_chcr1_addr_r(UINT32 mem_mask) { return m_SH4_CHCR1; } - UINT32 sh4_handle_chcr2_addr_r(UINT32 mem_mask) { return m_SH4_CHCR2; } - UINT32 sh4_handle_chcr3_addr_r(UINT32 mem_mask) { return m_SH4_CHCR3; } - UINT32 sh4_handle_dmaor_addr_r(UINT32 mem_mask) { return m_SH4_DMAOR; } + void sh4_handle_sar0_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_sar1_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_sar2_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_sar3_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_dar0_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_dar1_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_dar2_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_dar3_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_dmatcr0_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_dmatcr1_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_dmatcr2_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_dmatcr3_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_chcr0_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_chcr1_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_chcr2_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_chcr3_addr_w(uint32_t data, uint32_t mem_mask); + void sh4_handle_dmaor_addr_w(uint32_t data, uint32_t mem_mask); + uint32_t sh4_handle_sar0_addr_r(uint32_t mem_mask) { return m_SH4_SAR0; } + uint32_t sh4_handle_sar1_addr_r(uint32_t mem_mask) { return m_SH4_SAR1; } + uint32_t sh4_handle_sar2_addr_r(uint32_t mem_mask) { return m_SH4_SAR2; } + uint32_t sh4_handle_sar3_addr_r(uint32_t mem_mask) { return m_SH4_SAR3; } + uint32_t sh4_handle_dar0_addr_r(uint32_t mem_mask) { return m_SH4_DAR0; } + uint32_t sh4_handle_dar1_addr_r(uint32_t mem_mask) { return m_SH4_DAR1; } + uint32_t sh4_handle_dar2_addr_r(uint32_t mem_mask) { return m_SH4_DAR2; } + uint32_t sh4_handle_dar3_addr_r(uint32_t mem_mask) { return m_SH4_DAR3; } + uint32_t sh4_handle_dmatcr0_addr_r(uint32_t mem_mask) { return m_SH4_DMATCR0; } + uint32_t sh4_handle_dmatcr1_addr_r(uint32_t mem_mask) { return m_SH4_DMATCR1; } + uint32_t sh4_handle_dmatcr2_addr_r(uint32_t mem_mask) { return m_SH4_DMATCR2; } + uint32_t sh4_handle_dmatcr3_addr_r(uint32_t mem_mask) { return m_SH4_DMATCR3; } + uint32_t sh4_handle_chcr0_addr_r(uint32_t mem_mask) { return m_SH4_CHCR0; } + uint32_t sh4_handle_chcr1_addr_r(uint32_t mem_mask) { return m_SH4_CHCR1; } + uint32_t sh4_handle_chcr2_addr_r(uint32_t mem_mask) { return m_SH4_CHCR2; } + uint32_t sh4_handle_chcr3_addr_r(uint32_t mem_mask) { return m_SH4_CHCR3; } + uint32_t sh4_handle_dmaor_addr_r(uint32_t mem_mask) { return m_SH4_DMAOR; } #if SH4_USE_FASTRAM_OPTIMIZATION /* fast RAM */ bool m_bigendian; - UINT32 m_byte_xor; - UINT32 m_word_xor; - UINT32 m_dword_xor; - UINT32 m_fastram_select; + uint32_t m_byte_xor; + uint32_t m_word_xor; + uint32_t m_dword_xor; + uint32_t m_fastram_select; struct { offs_t start; /* start of the RAM block */ offs_t end; /* end of the RAM block */ - UINT8 readonly; /* TRUE if read-only */ + uint8_t readonly; /* TRUE if read-only */ void * base; /* base in memory where the RAM lives */ } m_fastram[SH4_MAX_FASTRAM]; #endif @@ -714,7 +714,7 @@ class sh3_base_device : public sh34_base_device { public: // construction/destruction - sh3_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, endianness_t endianness); + sh3_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, endianness_t endianness); DECLARE_WRITE32_MEMBER( sh3_internal_w ); DECLARE_READ32_MEMBER( sh3_internal_r ); @@ -731,7 +731,7 @@ class sh4_base_device : public sh34_base_device { public: // construction/destruction - sh4_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, endianness_t endianness); + sh4_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, endianness_t endianness); DECLARE_WRITE32_MEMBER( sh4_internal_w ); DECLARE_READ32_MEMBER( sh4_internal_r ); @@ -747,36 +747,36 @@ protected: class sh3_device : public sh3_base_device { public: - sh3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sh3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sh3be_device : public sh3_base_device { public: - sh3be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sh3be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void execute_run() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; class sh4_device : public sh4_base_device { public: - sh4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sh4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sh4be_device : public sh4_base_device { public: - sh4be_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sh4be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void execute_run() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; @@ -797,7 +797,7 @@ extern const device_type SH4BE; #define SH4DRC_COMPATIBLE_OPTIONS (SH4DRC_STRICT_VERIFY | SH4DRC_FLUSH_PC | SH4DRC_STRICT_PCREL) #define SH4DRC_FASTEST_OPTIONS (0) -void sh4drc_set_options(device_t *device, UINT32 options); +void sh4drc_set_options(device_t *device, uint32_t options); void sh4drc_add_pcflush(device_t *device, offs_t address); #endif /* __SH4_H__ */ diff --git a/src/devices/cpu/sh4/sh4comn.cpp b/src/devices/cpu/sh4/sh4comn.cpp index 5052622e2d4..985413e4a73 100644 --- a/src/devices/cpu/sh4/sh4comn.cpp +++ b/src/devices/cpu/sh4/sh4comn.cpp @@ -22,7 +22,7 @@ static const int daysmonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 3 -static const UINT32 exception_priority_default[] = { +static const uint32_t exception_priority_default[] = { EXPPRI(1,1,0,0), /* Power-on Reset */ EXPPRI(1,2,0,1), /* Manual Reset */ EXPPRI(1,1,0,2), /* H-UDI Reset */ @@ -260,7 +260,7 @@ void sh34_base_device::sh4_change_register_bank(int to) void sh34_base_device::sh4_swap_fp_registers() { int s; - UINT32 z; + uint32_t z; for (s = 0;s <= 15;s++) { @@ -273,7 +273,7 @@ void sh34_base_device::sh4_swap_fp_registers() void sh34_base_device::sh4_swap_fp_couples() { int s; - UINT32 z; + uint32_t z; for (s = 0;s <= 15;s = s+2) { @@ -369,7 +369,7 @@ void sh34_base_device::sh4_exception_checkunrequest(int exception) void sh34_base_device::sh4_exception(const char *message, int exception) // handle exception { - UINT32 vector; + uint32_t vector; if (m_cpu_type == CPU_TYPE_SH4) @@ -462,17 +462,17 @@ void sh34_base_device::sh4_exception(const char *message, int exception) // hand } -UINT32 sh34_base_device::compute_ticks_refresh_timer(emu_timer *timer, int hertz, int base, int divisor) +uint32_t sh34_base_device::compute_ticks_refresh_timer(emu_timer *timer, int hertz, int base, int divisor) { // elapsed:total = x : ticks // x=elapsed*tics/total -> x=elapsed*(double)100000000/rtcnt_div[(m_m[RTCSR] >> 3) & 7] // ticks/total=ticks / ((rtcnt_div[(m_m[RTCSR] >> 3) & 7] * ticks) / 100000000)=1/((rtcnt_div[(m_m[RTCSR] >> 3) & 7] / 100000000)=100000000/rtcnt_div[(m_m[RTCSR] >> 3) & 7] - return base + (UINT32)((timer->elapsed().as_double() * (double)hertz) / (double)divisor); + return base + (uint32_t)((timer->elapsed().as_double() * (double)hertz) / (double)divisor); } void sh34_base_device::sh4_refresh_timer_recompute() { - UINT32 ticks; + uint32_t ticks; if (m_cpu_type != CPU_TYPE_SH4) fatalerror("sh4_refresh_timer_recompute uses m_m[] with SH3\n"); @@ -638,7 +638,7 @@ void sh34_base_device::sh4_dmac_nmi() // manage dma when nmi gets asserted } } -void sh34_base_device::sh4_handler_ipra_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handler_ipra_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_IPRA); /* 15 - 12 TMU0 */ @@ -665,13 +665,13 @@ void sh34_base_device::sh4_handler_ipra_w(UINT32 data, UINT32 mem_mask) WRITE32_MEMBER( sh4_base_device::sh4_internal_w ) { int a; - UINT32 addr = (offset << 2) + 0xfe000000; + uint32_t addr = (offset << 2) + 0xfe000000; offset = ((addr & 0xfc) >> 2) | ((addr & 0x1fe0000) >> 11); if (m_cpu_type != CPU_TYPE_SH4) fatalerror("sh4_internal_w uses m_m[] with SH3\n"); - UINT32 old = m_m[offset]; + uint32_t old = m_m[offset]; COMBINE_DATA(m_m+offset); // printf("sh4_internal_w: Write %08x (%x), %08x @ %08x\n", 0xfe000000+((offset & 0x3fc0) << 11)+((offset & 0x3f) << 2), offset, data, mem_mask); @@ -854,11 +854,11 @@ WRITE32_MEMBER( sh4_base_device::sh4_internal_w ) m_ioport16_direction &= 0xffff; m_ioport16_pullup = (m_ioport16_pullup | m_ioport16_direction) ^ 0xffff; if (m_m[BCR2] & 1) - m_io->write_dword(SH4_IOPORT_16, (UINT64)(m_m[PDTRA] & m_ioport16_direction) | ((UINT64)m_m[PCTRA] << 16)); + m_io->write_dword(SH4_IOPORT_16, (uint64_t)(m_m[PDTRA] & m_ioport16_direction) | ((uint64_t)m_m[PCTRA] << 16)); break; case PDTRA: if (m_m[BCR2] & 1) - m_io->write_dword(SH4_IOPORT_16, (UINT64)(m_m[PDTRA] & m_ioport16_direction) | ((UINT64)m_m[PCTRA] << 16)); + m_io->write_dword(SH4_IOPORT_16, (uint64_t)(m_m[PDTRA] & m_ioport16_direction) | ((uint64_t)m_m[PCTRA] << 16)); break; case PCTRB: m_ioport4_pullup = 0; @@ -894,7 +894,7 @@ READ32_MEMBER( sh4_base_device::sh4_internal_r ) if (m_cpu_type != CPU_TYPE_SH4) fatalerror("sh4_internal_r uses m_m[] with SH3\n"); - UINT32 addr = (offset << 2) + 0xfe000000; + uint32_t addr = (offset << 2) + 0xfe000000; offset = ((addr & 0xfc) >> 2) | ((addr & 0x1fe0000) >> 11); // printf("sh4_internal_r: Read %08x (%x) @ %08x\n", 0xfe000000+((offset & 0x3fc0) << 11)+((offset & 0x3f) << 2), offset, mem_mask); @@ -1184,18 +1184,18 @@ void sh34_base_device::sh4_parse_configuration() } } -UINT32 sh34_base_device::sh4_getsqremap(UINT32 address) +uint32_t sh34_base_device::sh4_getsqremap(uint32_t address) { if (!m_sh4_mmu_enabled) return address; else { int i; - UINT32 topaddr = address&0xfff00000; + uint32_t topaddr = address&0xfff00000; for (i=0;i<64;i++) { - UINT32 topcmp = m_sh4_tlb_address[i]&0xfff00000; + uint32_t topcmp = m_sh4_tlb_address[i]&0xfff00000; if (topcmp==topaddr) return (address&0x000fffff) | ((m_sh4_tlb_data[i])&0xfff00000); } @@ -1211,12 +1211,12 @@ READ64_MEMBER( sh4_base_device::sh4_tlb_r ) if (offs >= 0x01000000) { - UINT8 i = (offs>>8)&63; + uint8_t i = (offs>>8)&63; return m_sh4_tlb_data[i]; } else { - UINT8 i = (offs>>8)&63; + uint8_t i = (offs>>8)&63; return m_sh4_tlb_address[i]; } } @@ -1227,12 +1227,12 @@ WRITE64_MEMBER( sh4_base_device::sh4_tlb_w ) if (offs >= 0x01000000) { - UINT8 i = (offs>>8)&63; + uint8_t i = (offs>>8)&63; m_sh4_tlb_data[i] = data&0xffffffff; } else { - UINT8 i = (offs>>8)&63; + uint8_t i = (offs>>8)&63; m_sh4_tlb_address[i] = data&0xffffffff; } } diff --git a/src/devices/cpu/sh4/sh4comn.h b/src/devices/cpu/sh4/sh4comn.h index 3aaec85692f..230207652d6 100644 --- a/src/devices/cpu/sh4/sh4comn.h +++ b/src/devices/cpu/sh4/sh4comn.h @@ -58,21 +58,21 @@ struct sh4_state int pcfsel; // last pcflush entry set int maxpcfsel; // highest valid pcflush entry - UINT32 pcflushes[16]; // pcflush entries + uint32_t pcflushes[16]; // pcflush entries drc_cache * cache; /* pointer to the DRC code cache */ drcuml_state * drcuml; /* DRC UML generator state */ sh4_frontend * drcfe; /* pointer to the DRC front-end class */ - UINT32 drcoptions; /* configurable DRC options */ + uint32_t drcoptions; /* configurable DRC options */ /* internal stuff */ - UINT8 cache_dirty; /* true if we need to flush the cache */ + uint8_t cache_dirty; /* true if we need to flush the cache */ /* parameters for subroutines */ - UINT64 numcycles; /* return value from gettotalcycles */ - UINT32 arg0; /* print_debug argument 1 */ - UINT32 arg1; /* print_debug argument 2 */ - UINT32 irq; /* irq we're taking */ + uint64_t numcycles; /* return value from gettotalcycles */ + uint32_t arg0; /* print_debug argument 1 */ + uint32_t arg1; /* print_debug argument 2 */ + uint32_t irq; /* irq we're taking */ /* register mappings */ uml::parameter regmap[16]; /* parameter to register mappings for all 16 integer registers */ @@ -89,8 +89,8 @@ struct sh4_state uml::code_handle * nocode; /* nocode */ uml::code_handle * out_of_cycles; /* out of cycles exception handler */ - UINT32 prefadr; - UINT32 target; + uint32_t prefadr; + uint32_t target; }; #endif @@ -98,20 +98,20 @@ struct sh4_state class sh4_frontend : public drc_frontend { public: - sh4_frontend(sh4_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); + sh4_frontend(sh4_state &state, uint32_t window_start, uint32_t window_end, uint32_t max_sequence); protected: virtual bool describe(opcode_desc &desc, const opcode_desc *prev); private: - bool describe_group_0(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_2(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_3(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_4(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_6(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_8(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_12(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); - bool describe_group_15(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); + bool describe_group_0(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_2(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_3(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_4(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_6(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_8(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_12(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); + bool describe_group_15(opcode_desc &desc, const opcode_desc *prev, uint16_t opcode); sh4_state &m_context; }; diff --git a/src/devices/cpu/sh4/sh4dasm.cpp b/src/devices/cpu/sh4/sh4dasm.cpp index cba1bea7bd5..93a0a91ab1e 100644 --- a/src/devices/cpu/sh4/sh4dasm.cpp +++ b/src/devices/cpu/sh4/sh4dasm.cpp @@ -4,8 +4,8 @@ #include "debugger.h" #include "sh4.h" -#define SIGNX8(x) (((INT32)(x) << 24) >> 24) -#define SIGNX12(x) (((INT32)(x) << 20) >> 20) +#define SIGNX8(x) (((int32_t)(x) << 24) >> 24) +#define SIGNX12(x) (((int32_t)(x) << 20) >> 20) #define Rn ((opcode >> 8) & 15) #define Rm ((opcode >> 4) & 15) @@ -15,9 +15,9 @@ static const char *const regname[16] = { "R8", "R9", "R10","R11","R12","R13","R14","R15" }; -static UINT32 op0000(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0000(char *buffer, uint32_t pc, uint16_t opcode) { - UINT32 flags = 0; + uint32_t flags = 0; switch (opcode & 0xF) { case 0x0: @@ -143,13 +143,13 @@ static UINT32 op0000(char *buffer, UINT32 pc, UINT16 opcode) return flags; } -static UINT32 op0001(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0001(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "MOV.L %s,@($%02X,%s)", regname[Rm], (opcode & 15) * 4, regname[Rn]); return 0; } -static UINT32 op0010(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0010(char *buffer, uint32_t pc, uint16_t opcode) { switch (opcode & 15) { @@ -205,7 +205,7 @@ static UINT32 op0010(char *buffer, UINT32 pc, UINT16 opcode) return 0; } -static UINT32 op0011(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0011(char *buffer, uint32_t pc, uint16_t opcode) { switch (opcode & 15) { @@ -261,9 +261,9 @@ static UINT32 op0011(char *buffer, UINT32 pc, UINT16 opcode) return 0; } -static UINT32 op0100(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0100(char *buffer, uint32_t pc, uint16_t opcode) { - UINT32 flags = 0; + uint32_t flags = 0; switch (opcode & 0xF) { case 0x0: @@ -463,13 +463,13 @@ static UINT32 op0100(char *buffer, UINT32 pc, UINT16 opcode) return flags; } -static UINT32 op0101(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0101(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "MOV.L @($%02X,%s),%s", (opcode & 15) * 4, regname[Rm], regname[Rn]); return 0; } -static UINT32 op0110(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0110(char *buffer, uint32_t pc, uint16_t opcode) { switch(opcode & 0xF) @@ -526,13 +526,13 @@ static UINT32 op0110(char *buffer, UINT32 pc, UINT16 opcode) return 0; } -static UINT32 op0111(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op0111(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "ADD #$%02X,%s", opcode & 0xff, regname[Rn]); return 0; } -static UINT32 op1000(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1000(char *buffer, uint32_t pc, uint16_t opcode) { switch((opcode >> 8) & 15) { @@ -569,29 +569,29 @@ static UINT32 op1000(char *buffer, UINT32 pc, UINT16 opcode) return 0; } -static UINT32 op1001(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1001(char *buffer, uint32_t pc, uint16_t opcode) { -UINT32 ea=(pc+((opcode & 0xff) * 2)+2); +uint32_t ea=(pc+((opcode & 0xff) * 2)+2); sprintf(buffer, "MOV.W @($%04X,PC),%s [%08X]", (opcode & 0xff) * 2, regname[Rn], ea); return 0; } -static UINT32 op1010(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1010(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "BRA $%08X", SIGNX12(opcode & 0xfff) * 2 + pc + 2); return 0; } -static UINT32 op1011(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1011(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "BSR $%08X", SIGNX12(opcode & 0xfff) * 2 + pc + 2); return DASMFLAG_STEP_OVER | DASMFLAG_STEP_OVER_EXTRA(1); } -static UINT32 op1100(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1100(char *buffer, uint32_t pc, uint16_t opcode) { - UINT32 flags = 0; + uint32_t flags = 0; switch((opcode >> 8) & 15) { case 0: @@ -647,21 +647,21 @@ static UINT32 op1100(char *buffer, UINT32 pc, UINT16 opcode) return flags; } -static UINT32 op1101(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1101(char *buffer, uint32_t pc, uint16_t opcode) { -UINT32 ea=((pc + 2) & ~3) + (opcode & 0xff) * 4; +uint32_t ea=((pc + 2) & ~3) + (opcode & 0xff) * 4; sprintf(buffer, "MOV.L @($%04X,PC),%s [%08X]", (opcode & 0xff) * 4, regname[Rn], ea); return 0; } -static UINT32 op1110(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1110(char *buffer, uint32_t pc, uint16_t opcode) { sprintf(buffer, "MOV #$%02X,%s", (opcode & 0xff), regname[Rn]); return 0; } -static UINT32 op1111(char *buffer, UINT32 pc, UINT16 opcode) +static uint32_t op1111(char *buffer, uint32_t pc, uint16_t opcode) { switch (opcode & 0xf) { @@ -785,9 +785,9 @@ static UINT32 op1111(char *buffer, UINT32 pc, UINT16 opcode) return 0; } -unsigned DasmSH4(char *buffer, unsigned pc, UINT16 opcode) +unsigned DasmSH4(char *buffer, unsigned pc, uint16_t opcode) { - UINT32 flags; + uint32_t flags; pc += 2; diff --git a/src/devices/cpu/sh4/sh4dmac.cpp b/src/devices/cpu/sh4/sh4dmac.cpp index bf4c773b1eb..c06ffb034dd 100644 --- a/src/devices/cpu/sh4/sh4dmac.cpp +++ b/src/devices/cpu/sh4/sh4dmac.cpp @@ -48,10 +48,10 @@ TIMER_CALLBACK_MEMBER( sh34_base_device::sh4_dmac_callback ) } } -int sh34_base_device::sh4_dma_transfer(int channel, int timermode, UINT32 chcr, UINT32 *sar, UINT32 *dar, UINT32 *dmatcr) +int sh34_base_device::sh4_dma_transfer(int channel, int timermode, uint32_t chcr, uint32_t *sar, uint32_t *dar, uint32_t *dmatcr) { int incs, incd, size; - UINT32 src, dst, count; + uint32_t src, dst, count; incd = (chcr & CHCR_DM) >> 14; incs = (chcr & CHCR_SM) >> 12; @@ -184,10 +184,10 @@ int sh34_base_device::sh4_dma_transfer(int channel, int timermode, UINT32 chcr, return 1; } -int sh34_base_device::sh4_dma_transfer_device(int channel, UINT32 chcr, UINT32 *sar, UINT32 *dar, UINT32 *dmatcr) +int sh34_base_device::sh4_dma_transfer_device(int channel, uint32_t chcr, uint32_t *sar, uint32_t *dar, uint32_t *dmatcr) { int incs, incd, size, mod; - UINT32 src, dst, count; + uint32_t src, dst, count; incd = (chcr & CHCR_DM) >> 14; incs = (chcr & CHCR_SM) >> 12; @@ -237,7 +237,7 @@ int sh34_base_device::sh4_dma_transfer_device(int channel, UINT32 chcr, UINT32 * void sh34_base_device::sh4_dmac_check(int channel) { - UINT32 dmatcr, chcr, sar, dar; + uint32_t dmatcr, chcr, sar, dar; switch (channel) { @@ -295,7 +295,7 @@ void sh34_base_device::sh4_dmac_check(int channel) // called by drivers to transfer data in a cpu<->device dma. 'device' must be a SH4 cpu int sh34_base_device::sh4_dma_data(struct sh4_device_dma *s) { - UINT32 pos, len, siz; + uint32_t pos, len, siz; int channel = s->channel; void *data = s->buffer; @@ -315,38 +315,38 @@ int sh34_base_device::sh4_dma_data(struct sh4_device_dma *s) case 8: if (m_dma_source_increment[channel] == 2) m_dma_source[channel] -= 8; - *(UINT64 *)data = m_program->read_qword(m_dma_source[channel] & ~7); + *(uint64_t *)data = m_program->read_qword(m_dma_source[channel] & ~7); if (m_dma_source_increment[channel] == 1) m_dma_source[channel] += 8; break; case 1: if (m_dma_source_increment[channel] == 2) m_dma_source[channel]--; - *(UINT8 *)data = m_program->read_byte(m_dma_source[channel]); + *(uint8_t *)data = m_program->read_byte(m_dma_source[channel]); if (m_dma_source_increment[channel] == 1) m_dma_source[channel]++; break; case 2: if (m_dma_source_increment[channel] == 2) m_dma_source[channel] -= 2; - *(UINT16 *)data = m_program->read_word(m_dma_source[channel] & ~1); + *(uint16_t *)data = m_program->read_word(m_dma_source[channel] & ~1); if (m_dma_source_increment[channel] == 1) m_dma_source[channel] += 2; break; case 4: if (m_dma_source_increment[channel] == 2) m_dma_source[channel] -= 4; - *(UINT32 *)data = m_program->read_dword(m_dma_source[channel] & ~3); + *(uint32_t *)data = m_program->read_dword(m_dma_source[channel] & ~3); if (m_dma_source_increment[channel] == 1) m_dma_source[channel] += 4; break; case 32: if (m_dma_source_increment[channel] == 2) m_dma_source[channel] -= 32; - *(UINT64 *)data = m_program->read_qword(m_dma_source[channel] & ~31); - *((UINT64 *)data+1) = m_program->read_qword((m_dma_source[channel] & ~31)+8); - *((UINT64 *)data+2) = m_program->read_qword((m_dma_source[channel] & ~31)+16); - *((UINT64 *)data+3) = m_program->read_qword((m_dma_source[channel] & ~31)+24); + *(uint64_t *)data = m_program->read_qword(m_dma_source[channel] & ~31); + *((uint64_t *)data+1) = m_program->read_qword((m_dma_source[channel] & ~31)+8); + *((uint64_t *)data+2) = m_program->read_qword((m_dma_source[channel] & ~31)+16); + *((uint64_t *)data+3) = m_program->read_qword((m_dma_source[channel] & ~31)+24); if (m_dma_source_increment[channel] == 1) m_dma_source[channel] += 32; break; @@ -373,38 +373,38 @@ int sh34_base_device::sh4_dma_data(struct sh4_device_dma *s) case 8: if (m_dma_destination_increment[channel] == 2) m_dma_destination[channel]-=8; - m_program->write_qword(m_dma_destination[channel] & ~7, *(UINT64 *)data); + m_program->write_qword(m_dma_destination[channel] & ~7, *(uint64_t *)data); if (m_dma_destination_increment[channel] == 1) m_dma_destination[channel]+=8; break; case 1: if (m_dma_destination_increment[channel] == 2) m_dma_destination[channel]--; - m_program->write_byte(m_dma_destination[channel], *(UINT8 *)data); + m_program->write_byte(m_dma_destination[channel], *(uint8_t *)data); if (m_dma_destination_increment[channel] == 1) m_dma_destination[channel]++; break; case 2: if (m_dma_destination_increment[channel] == 2) m_dma_destination[channel]-=2; - m_program->write_word(m_dma_destination[channel] & ~1, *(UINT16 *)data); + m_program->write_word(m_dma_destination[channel] & ~1, *(uint16_t *)data); if (m_dma_destination_increment[channel] == 1) m_dma_destination[channel]+=2; break; case 4: if (m_dma_destination_increment[channel] == 2) m_dma_destination[channel]-=4; - m_program->write_dword(m_dma_destination[channel] & ~3, *(UINT32 *)data); + m_program->write_dword(m_dma_destination[channel] & ~3, *(uint32_t *)data); if (m_dma_destination_increment[channel] == 1) m_dma_destination[channel]+=4; break; case 32: if (m_dma_destination_increment[channel] == 2) m_dma_destination[channel]-=32; - m_program->write_qword(m_dma_destination[channel] & ~31, *(UINT64 *)data); - m_program->write_qword((m_dma_destination[channel] & ~31)+8, *((UINT64 *)data+1)); - m_program->write_qword((m_dma_destination[channel] & ~31)+16, *((UINT64 *)data+2)); - m_program->write_qword((m_dma_destination[channel] & ~31)+24, *((UINT64 *)data+3)); + m_program->write_qword(m_dma_destination[channel] & ~31, *(uint64_t *)data); + m_program->write_qword((m_dma_destination[channel] & ~31)+8, *((uint64_t *)data+1)); + m_program->write_qword((m_dma_destination[channel] & ~31)+16, *((uint64_t *)data+2)); + m_program->write_qword((m_dma_destination[channel] & ~31)+24, *((uint64_t *)data+3)); if (m_dma_destination_increment[channel] == 1) m_dma_destination[channel]+=32; break; @@ -426,10 +426,10 @@ int sh34_base_device::sh4_dma_data(struct sh4_device_dma *s) // called by drivers to transfer data in a DDT dma. void sh34_base_device::sh4_dma_ddt(struct sh4_ddt_dma *s) { - UINT32 chcr; - UINT32 *p32bits; - UINT64 *p32bytes; - UINT32 pos,len,siz; + uint32_t chcr; + uint32_t *p32bits; + uint64_t *p32bytes; + uint32_t pos,len,siz; if (m_cpu_type != CPU_TYPE_SH4) fatalerror("sh4_dma_ddt uses m_m[] with SH3\n"); @@ -527,7 +527,7 @@ void sh34_base_device::sh4_dma_ddt(struct sh4_ddt_dma *s) if (s->size == 4) { if ((s->direction) == 0) { len = s->length; - p32bits = (UINT32 *)(s->buffer); + p32bits = (uint32_t *)(s->buffer); for (pos = 0;pos < len;pos++) { *p32bits = m_program->read_dword(s->source); p32bits++; @@ -535,7 +535,7 @@ void sh34_base_device::sh4_dma_ddt(struct sh4_ddt_dma *s) } } else { len = s->length; - p32bits = (UINT32 *)(s->buffer); + p32bits = (uint32_t *)(s->buffer); for (pos = 0;pos < len;pos++) { m_program->write_dword(s->destination, *p32bits); p32bits++; @@ -546,7 +546,7 @@ void sh34_base_device::sh4_dma_ddt(struct sh4_ddt_dma *s) if (s->size == 32) { if ((s->direction) == 0) { len = s->length * 4; - p32bytes = (UINT64 *)(s->buffer); + p32bytes = (uint64_t *)(s->buffer); for (pos = 0;pos < len;pos++) { *p32bytes = m_program->read_qword(s->source); p32bytes++; @@ -554,7 +554,7 @@ void sh34_base_device::sh4_dma_ddt(struct sh4_ddt_dma *s) } } else { len = s->length * 4; - p32bytes = (UINT64 *)(s->buffer); + p32bytes = (uint64_t *)(s->buffer); for (pos = 0;pos < len;pos++) { m_program->write_qword(s->destination, *p32bytes); p32bytes++; @@ -566,93 +566,93 @@ void sh34_base_device::sh4_dma_ddt(struct sh4_ddt_dma *s) } - void sh34_base_device::sh4_handle_sar0_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_sar0_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_SAR0); } - void sh34_base_device::sh4_handle_sar1_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_sar1_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_SAR1); } - void sh34_base_device::sh4_handle_sar2_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_sar2_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_SAR2); } - void sh34_base_device::sh4_handle_sar3_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_sar3_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_SAR3); } - void sh34_base_device::sh4_handle_dar0_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_dar0_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_DAR0); } - void sh34_base_device::sh4_handle_dar1_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_dar1_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_DAR1); } - void sh34_base_device::sh4_handle_dar2_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_dar2_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_DAR2); } - void sh34_base_device::sh4_handle_dar3_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_dar3_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_DAR3); } - void sh34_base_device::sh4_handle_dmatcr0_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_dmatcr0_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_DMATCR0); } - void sh34_base_device::sh4_handle_dmatcr1_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_dmatcr1_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_DMATCR1); } - void sh34_base_device::sh4_handle_dmatcr2_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_dmatcr2_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_DMATCR2); } - void sh34_base_device::sh4_handle_dmatcr3_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_dmatcr3_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_DMATCR3); } - void sh34_base_device::sh4_handle_chcr0_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_chcr0_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_CHCR0); sh4_dmac_check(0); } - void sh34_base_device::sh4_handle_chcr1_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_chcr1_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_CHCR1); sh4_dmac_check(1); } - void sh34_base_device::sh4_handle_chcr2_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_chcr2_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_CHCR2); sh4_dmac_check(2); } - void sh34_base_device::sh4_handle_chcr3_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_chcr3_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_CHCR3); sh4_dmac_check(3); } - void sh34_base_device::sh4_handle_dmaor_addr_w(UINT32 data, UINT32 mem_mask) + void sh34_base_device::sh4_handle_dmaor_addr_w(uint32_t data, uint32_t mem_mask) { - UINT32 old = m_SH4_DMAOR; + uint32_t old = m_SH4_DMAOR; COMBINE_DATA(&m_SH4_DMAOR); if ((m_SH4_DMAOR & DMAOR_AE) && (~old & DMAOR_AE)) diff --git a/src/devices/cpu/sh4/sh4dmac.h b/src/devices/cpu/sh4/sh4dmac.h index fe0bbc84514..b7918fac997 100644 --- a/src/devices/cpu/sh4/sh4dmac.h +++ b/src/devices/cpu/sh4/sh4dmac.h @@ -27,37 +27,37 @@ #define DMAOR_NMIF 0x0002 #define DMAOR_DME 0x0001 -void sh4_handle_sar0_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_sar1_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_sar2_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_sar3_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_dar0_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_dar1_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_dar2_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_dar3_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_dmatcr0_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_dmatcr1_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_dmatcr2_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_dmatcr3_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_chcr0_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_chcr1_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_chcr2_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_chcr3_addr_w(UINT32 data, UINT32 mem_mask); -void sh4_handle_dmaor_addr_w(UINT32 data, UINT32 mem_mask); -UINT32 sh4_handle_sar0_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_sar1_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_sar2_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_sar3_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_dar0_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_dar1_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_dar2_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_dar3_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_dmatcr0_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_dmatcr1_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_dmatcr2_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_dmatcr3_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_chcr0_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_chcr1_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_chcr2_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_chcr3_addr_r(UINT32 mem_mask); -UINT32 sh4_handle_dmaor_addr_r(UINT32 mem_mask); +void sh4_handle_sar0_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_sar1_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_sar2_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_sar3_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_dar0_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_dar1_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_dar2_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_dar3_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_dmatcr0_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_dmatcr1_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_dmatcr2_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_dmatcr3_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_chcr0_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_chcr1_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_chcr2_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_chcr3_addr_w(uint32_t data, uint32_t mem_mask); +void sh4_handle_dmaor_addr_w(uint32_t data, uint32_t mem_mask); +uint32_t sh4_handle_sar0_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_sar1_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_sar2_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_sar3_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_dar0_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_dar1_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_dar2_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_dar3_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_dmatcr0_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_dmatcr1_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_dmatcr2_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_dmatcr3_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_chcr0_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_chcr1_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_chcr2_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_chcr3_addr_r(uint32_t mem_mask); +uint32_t sh4_handle_dmaor_addr_r(uint32_t mem_mask); diff --git a/src/devices/cpu/sh4/sh4tmu.cpp b/src/devices/cpu/sh4/sh4tmu.cpp index 46044de0f09..4735b8bba67 100644 --- a/src/devices/cpu/sh4/sh4tmu.cpp +++ b/src/devices/cpu/sh4/sh4tmu.cpp @@ -16,25 +16,25 @@ static const int tcnt_div[8] = { 4, 16, 64, 256, 1024, 1, 1, 1 }; a (constant+1) where 0 <= constant < 2^32 -------------------------------------------------*/ -static inline attotime sh4_scale_up_mame_time(const attotime &_time1, UINT32 factor1) +static inline attotime sh4_scale_up_mame_time(const attotime &_time1, uint32_t factor1) { return _time1 * factor1 + _time1; } -static UINT32 compute_ticks_timer(emu_timer *timer, int hertz, int divisor) +static uint32_t compute_ticks_timer(emu_timer *timer, int hertz, int divisor) { double ret; ret=((timer->remaining().as_double() * (double)hertz) / (double)divisor) - 1; - return (UINT32)ret; + return (uint32_t)ret; } void sh34_base_device::sh4_timer_recompute(int which) { double ticks; - UINT32 tcnt = 0; - UINT32 tcr = 0; + uint32_t tcnt = 0; + uint32_t tcr = 0; switch (which) { case 0: @@ -126,7 +126,7 @@ TIMER_CALLBACK_MEMBER( sh34_base_device::sh4_timer_callback ) } -UINT32 sh34_base_device::sh4_handle_tcnt0_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcnt0_addr_r(uint32_t mem_mask) { if (m_SH4_TSTR & 1) return compute_ticks_timer(m_timer[0], m_pm_clock, tcnt_div[m_SH4_TCR0 & 7]); @@ -134,7 +134,7 @@ UINT32 sh34_base_device::sh4_handle_tcnt0_addr_r(UINT32 mem_mask) return m_SH4_TCNT0; } -UINT32 sh34_base_device::sh4_handle_tcnt1_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcnt1_addr_r(uint32_t mem_mask) { if (m_SH4_TSTR & 2) return compute_ticks_timer(m_timer[1], m_pm_clock, tcnt_div[m_SH4_TCR1 & 7]); @@ -142,7 +142,7 @@ UINT32 sh34_base_device::sh4_handle_tcnt1_addr_r(UINT32 mem_mask) return m_SH4_TCNT1; } -UINT32 sh34_base_device::sh4_handle_tcnt2_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcnt2_addr_r(uint32_t mem_mask) { if (m_SH4_TSTR & 4) return compute_ticks_timer(m_timer[2], m_pm_clock, tcnt_div[m_SH4_TCR2 & 7]); @@ -150,55 +150,55 @@ UINT32 sh34_base_device::sh4_handle_tcnt2_addr_r(UINT32 mem_mask) return m_SH4_TCNT2; } -UINT32 sh34_base_device::sh4_handle_tcor0_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcor0_addr_r(uint32_t mem_mask) { return m_SH4_TCOR0; } -UINT32 sh34_base_device::sh4_handle_tcor1_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcor1_addr_r(uint32_t mem_mask) { return m_SH4_TCOR1; } -UINT32 sh34_base_device::sh4_handle_tcor2_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcor2_addr_r(uint32_t mem_mask) { return m_SH4_TCOR2; } -UINT32 sh34_base_device::sh4_handle_tcr0_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcr0_addr_r(uint32_t mem_mask) { return m_SH4_TCR0; } -UINT32 sh34_base_device::sh4_handle_tcr1_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcr1_addr_r(uint32_t mem_mask) { return m_SH4_TCR1; } -UINT32 sh34_base_device::sh4_handle_tcr2_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcr2_addr_r(uint32_t mem_mask) { return m_SH4_TCR2; } -UINT32 sh34_base_device::sh4_handle_tstr_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tstr_addr_r(uint32_t mem_mask) { return m_SH4_TSTR; } -UINT32 sh34_base_device::sh4_handle_tocr_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tocr_addr_r(uint32_t mem_mask) { return m_SH4_TOCR; } -UINT32 sh34_base_device::sh4_handle_tcpr2_addr_r(UINT32 mem_mask) +uint32_t sh34_base_device::sh4_handle_tcpr2_addr_r(uint32_t mem_mask) { return m_SH4_TCPR2; } -void sh34_base_device::sh4_handle_tstr_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tstr_addr_w(uint32_t data, uint32_t mem_mask) { - UINT32 old2 = m_SH4_TSTR; + uint32_t old2 = m_SH4_TSTR; COMBINE_DATA(&m_SH4_TSTR); if (old2 & 1) @@ -223,9 +223,9 @@ void sh34_base_device::sh4_handle_tstr_addr_w(UINT32 data, UINT32 mem_mask) sh4_timer_recompute(2); } -void sh34_base_device::sh4_handle_tcr0_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcr0_addr_w(uint32_t data, uint32_t mem_mask) { - UINT32 old2 = m_SH4_TCR0; + uint32_t old2 = m_SH4_TCR0; COMBINE_DATA(&m_SH4_TCR0); if (m_SH4_TSTR & 1) { @@ -236,9 +236,9 @@ void sh34_base_device::sh4_handle_tcr0_addr_w(UINT32 data, UINT32 mem_mask) sh4_exception_unrequest(SH4_INTC_TUNI0); } -void sh34_base_device::sh4_handle_tcr1_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcr1_addr_w(uint32_t data, uint32_t mem_mask) { - UINT32 old2 = m_SH4_TCR1; + uint32_t old2 = m_SH4_TCR1; COMBINE_DATA(&m_SH4_TCR1); if (m_SH4_TSTR & 2) { @@ -249,9 +249,9 @@ void sh34_base_device::sh4_handle_tcr1_addr_w(UINT32 data, UINT32 mem_mask) sh4_exception_unrequest(SH4_INTC_TUNI1); } -void sh34_base_device::sh4_handle_tcr2_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcr2_addr_w(uint32_t data, uint32_t mem_mask) { - UINT32 old2 = m_SH4_TCR2; + uint32_t old2 = m_SH4_TCR2; COMBINE_DATA(&m_SH4_TCR2); if (m_SH4_TSTR & 4) { @@ -262,7 +262,7 @@ void sh34_base_device::sh4_handle_tcr2_addr_w(UINT32 data, UINT32 mem_mask) sh4_exception_unrequest(SH4_INTC_TUNI2); } -void sh34_base_device::sh4_handle_tcor0_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcor0_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_TCOR0); if (m_SH4_TSTR & 1) @@ -272,7 +272,7 @@ void sh34_base_device::sh4_handle_tcor0_addr_w(UINT32 data, UINT32 mem_mask) } } -void sh34_base_device::sh4_handle_tcor1_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcor1_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_TCOR1); if (m_SH4_TSTR & 2) @@ -282,7 +282,7 @@ void sh34_base_device::sh4_handle_tcor1_addr_w(UINT32 data, UINT32 mem_mask) } } -void sh34_base_device::sh4_handle_tcor2_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcor2_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_TCOR2); if (m_SH4_TSTR & 4) @@ -292,33 +292,33 @@ void sh34_base_device::sh4_handle_tcor2_addr_w(UINT32 data, UINT32 mem_mask) } } -void sh34_base_device::sh4_handle_tcnt0_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcnt0_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_TCNT0); if (m_SH4_TSTR & 1) sh4_timer_recompute(0); } -void sh34_base_device::sh4_handle_tcnt1_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcnt1_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_TCNT1); if (m_SH4_TSTR & 2) sh4_timer_recompute(1); } -void sh34_base_device::sh4_handle_tcnt2_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcnt2_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_TCNT2); if (m_SH4_TSTR & 4) sh4_timer_recompute(2); } -void sh34_base_device::sh4_handle_tocr_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tocr_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_TOCR); } -void sh34_base_device::sh4_handle_tcpr2_addr_w(UINT32 data, UINT32 mem_mask) +void sh34_base_device::sh4_handle_tcpr2_addr_w(uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&m_SH4_TCPR2); } diff --git a/src/devices/cpu/sharc/compute.hxx b/src/devices/cpu/sharc/compute.hxx index 852c739ed46..ddea8a2f265 100644 --- a/src/devices/cpu/sharc/compute.hxx +++ b/src/devices/cpu/sharc/compute.hxx @@ -8,9 +8,9 @@ #define SET_FLAG_AZ(r) { m_core->astat |= (((r) == 0) ? AZ : 0); } #define SET_FLAG_AN(r) { m_core->astat |= (((r) & 0x80000000) ? AN : 0); } -#define SET_FLAG_AC_ADD(r,a,b) { m_core->astat |= (((UINT32)r < (UINT32)a) ? AC : 0); } +#define SET_FLAG_AC_ADD(r,a,b) { m_core->astat |= (((uint32_t)r < (uint32_t)a) ? AC : 0); } #define SET_FLAG_AV_ADD(r,a,b) { m_core->astat |= (((~((a) ^ (b)) & ((a) ^ (r))) & 0x80000000) ? AV : 0); } -#define SET_FLAG_AC_SUB(r,a,b) { m_core->astat |= ((!((UINT32)a < (UINT32)b)) ? AC : 0); } +#define SET_FLAG_AC_SUB(r,a,b) { m_core->astat |= ((!((uint32_t)a < (uint32_t)b)) ? AC : 0); } #define SET_FLAG_AV_SUB(r,a,b) { m_core->astat |= ((( ((a) ^ (b)) & ((a) ^ (r))) & 0x80000000) ? AV : 0); } #define IS_FLOAT_ZERO(r) ((((r) & 0x7fffffff) == 0)) @@ -21,10 +21,10 @@ #define CLEAR_MULTIPLIER_FLAGS() (m_core->astat &= ~(MN|MV|MU|MI)) #define SET_FLAG_MN(r) { m_core->astat |= (((r) & 0x80000000) ? MN : 0); } -#define SET_FLAG_MV(r) { m_core->astat |= ((((UINT32)((r) >> 32) != 0) && ((UINT32)((r) >> 32) != 0xffffffff)) ? MV : 0); } +#define SET_FLAG_MV(r) { m_core->astat |= ((((uint32_t)((r) >> 32) != 0) && ((uint32_t)((r) >> 32) != 0xffffffff)) ? MV : 0); } /* TODO: MU needs 80-bit result */ -#define SET_FLAG_MU(r) { m_core->astat |= ((((UINT32)((r) >> 32) == 0) && ((UINT32)(r)) != 0) ? MU : 0); } +#define SET_FLAG_MU(r) { m_core->astat |= ((((uint32_t)((r) >> 32) == 0) && ((uint32_t)(r)) != 0) ? MU : 0); } #define FLOAT_SIGN 0x80000000 @@ -34,7 +34,7 @@ /*****************************************************************************/ // Mantissa lookup-table for RECIPS opcode -static const UINT32 recips_mantissa_lookup[128] = +static const uint32_t recips_mantissa_lookup[128] = { 0x007F8000, 0x007E0000, 0x007C0000, 0x007A0000, 0x00780000, 0x00760000, 0x00740000, 0x00720000, @@ -71,7 +71,7 @@ static const UINT32 recips_mantissa_lookup[128] = }; // Mantissa lookup-table for RSQRTS opcode -static const UINT32 rsqrts_mantissa_lookup[128] = +static const uint32_t rsqrts_mantissa_lookup[128] = { 0x00350000, 0x00330000, 0x00320000, 0x00300000, 0x002F0000, 0x002E0000, 0x002D0000, 0x002B0000, @@ -113,7 +113,7 @@ static const UINT32 rsqrts_mantissa_lookup[128] = /* Rn = Rx + Ry */ void adsp21062_device::compute_add(int rn, int rx, int ry) { - UINT32 r = REG(rx) + REG(ry); + uint32_t r = REG(rx) + REG(ry); if (m_core->mode1 & MODE1_ALUSAT) fatalerror("SHARC: compute_add: ALU saturation not implemented!\n"); @@ -131,7 +131,7 @@ void adsp21062_device::compute_add(int rn, int rx, int ry) /* Rn = Rx - Ry */ void adsp21062_device::compute_sub(int rn, int rx, int ry) { - UINT32 r = REG(rx) - REG(ry); + uint32_t r = REG(rx) - REG(ry); if (m_core->mode1 & MODE1_ALUSAT) fatalerror("SHARC: compute_sub: ALU saturation not implemented!\n"); @@ -150,7 +150,7 @@ void adsp21062_device::compute_sub(int rn, int rx, int ry) void adsp21062_device::compute_add_ci(int rn, int rx, int ry) { int c = (m_core->astat & AC) ? 1 : 0; - UINT32 r = REG(rx) + REG(ry) + c; + uint32_t r = REG(rx) + REG(ry) + c; if (m_core->mode1 & MODE1_ALUSAT) fatalerror("SHARC: compute_add_ci: ALU saturation not implemented!\n"); @@ -169,7 +169,7 @@ void adsp21062_device::compute_add_ci(int rn, int rx, int ry) void adsp21062_device::compute_sub_ci(int rn, int rx, int ry) { int c = (m_core->astat & AC) ? 1 : 0; - UINT32 r = REG(rx) - REG(ry) + c - 1; + uint32_t r = REG(rx) - REG(ry) + c - 1; if (m_core->mode1 & MODE1_ALUSAT) fatalerror("SHARC: compute_sub_ci: ALU saturation not implemented!\n"); @@ -187,7 +187,7 @@ void adsp21062_device::compute_sub_ci(int rn, int rx, int ry) /* Rn = Rx AND Ry */ void adsp21062_device::compute_and(int rn, int rx, int ry) { - UINT32 r = REG(rx) & REG(ry); + uint32_t r = REG(rx) & REG(ry); CLEAR_ALU_FLAGS(); SET_FLAG_AN(r); @@ -200,12 +200,12 @@ void adsp21062_device::compute_and(int rn, int rx, int ry) /* COMP(Rx, Ry) */ void adsp21062_device::compute_comp(int rx, int ry) { - UINT32 comp_accum; + uint32_t comp_accum; CLEAR_ALU_FLAGS(); if( REG(rx) == REG(ry) ) m_core->astat |= AZ; - if( (INT32)REG(rx) < (INT32)REG(ry) ) + if( (int32_t)REG(rx) < (int32_t)REG(ry) ) m_core->astat |= AN; // Update ASTAT compare accumulation register @@ -239,7 +239,7 @@ void adsp21062_device::compute_pass(int rn, int rx) /* Rn = Rx XOR Ry */ void adsp21062_device::compute_xor(int rn, int rx, int ry) { - UINT32 r = REG(rx) ^ REG(ry); + uint32_t r = REG(rx) ^ REG(ry); CLEAR_ALU_FLAGS(); SET_FLAG_AN(r); SET_FLAG_AZ(r); @@ -251,7 +251,7 @@ void adsp21062_device::compute_xor(int rn, int rx, int ry) /* Rn = Rx OR Ry */ void adsp21062_device::compute_or(int rn, int rx, int ry) { - UINT32 r = REG(rx) | REG(ry); + uint32_t r = REG(rx) | REG(ry); CLEAR_ALU_FLAGS(); SET_FLAG_AN(r); SET_FLAG_AZ(r); @@ -263,7 +263,7 @@ void adsp21062_device::compute_or(int rn, int rx, int ry) /* Rn = Rx + 1 */ void adsp21062_device::compute_inc(int rn, int rx) { - UINT32 r = REG(rx) + 1; + uint32_t r = REG(rx) + 1; CLEAR_ALU_FLAGS(); SET_FLAG_AN(r); @@ -279,7 +279,7 @@ void adsp21062_device::compute_inc(int rn, int rx) /* Rn = Rx - 1 */ void adsp21062_device::compute_dec(int rn, int rx) { - UINT32 r = REG(rx) - 1; + uint32_t r = REG(rx) - 1; CLEAR_ALU_FLAGS(); SET_FLAG_AN(r); @@ -295,7 +295,7 @@ void adsp21062_device::compute_dec(int rn, int rx) /* Rn = MIN(Rx, Ry) */ void adsp21062_device::compute_min(int rn, int rx, int ry) { - UINT32 r = std::min((INT32)REG(rx), (INT32)REG(ry)); + uint32_t r = std::min((int32_t)REG(rx), (int32_t)REG(ry)); CLEAR_ALU_FLAGS(); SET_FLAG_AN(r); @@ -309,7 +309,7 @@ void adsp21062_device::compute_min(int rn, int rx, int ry) /* Rn = MAX(Rx, Ry) */ void adsp21062_device::compute_max(int rn, int rx, int ry) { - UINT32 r = std::max((INT32)REG(rx), (INT32)REG(ry)); + uint32_t r = std::max((int32_t)REG(rx), (int32_t)REG(ry)); CLEAR_ALU_FLAGS(); SET_FLAG_AN(r); @@ -323,7 +323,7 @@ void adsp21062_device::compute_max(int rn, int rx, int ry) /* Rn = -Rx */ void adsp21062_device::compute_neg(int rn, int rx) { - UINT32 r = -(INT32)(REG(rx)); + uint32_t r = -(int32_t)(REG(rx)); CLEAR_ALU_FLAGS(); SET_FLAG_AN(r); @@ -339,7 +339,7 @@ void adsp21062_device::compute_neg(int rn, int rx) /* Rn = NOT Rx */ void adsp21062_device::compute_not(int rn, int rx) { - UINT32 r = ~REG(rx); + uint32_t r = ~REG(rx); CLEAR_ALU_FLAGS(); SET_FLAG_AN(r); @@ -353,13 +353,13 @@ void adsp21062_device::compute_not(int rn, int rx) /*****************************************************************************/ /* Floating-point ALU operations */ -UINT32 adsp21062_device::SCALB(SHARC_REG rx, int ry) +uint32_t adsp21062_device::SCALB(SHARC_REG rx, int ry) { - UINT32 mantissa = rx.r & FLOAT_MANTISSA; - UINT32 sign = rx.r & FLOAT_SIGN; + uint32_t mantissa = rx.r & FLOAT_MANTISSA; + uint32_t sign = rx.r & FLOAT_SIGN; int exponent = ((rx.r >> 23) & 0xff) - 127; - exponent += (INT32)(REG(ry)); + exponent += (int32_t)(REG(ry)); if (exponent > 127) { @@ -383,7 +383,7 @@ UINT32 adsp21062_device::SCALB(SHARC_REG rx, int ry) void adsp21062_device::compute_float(int rn, int rx) { // verified - FREG(rn) = (float)(INT32)REG(rx); + FREG(rn) = (float)(int32_t)REG(rx); CLEAR_ALU_FLAGS(); // AN @@ -400,17 +400,17 @@ void adsp21062_device::compute_float(int rn, int rx) /* Rn = FIX Fx */ void adsp21062_device::compute_fix(int rn, int rx) { - INT32 alu_i; + int32_t alu_i; SHARC_REG r_alu; r_alu.f = FREG(rx); if (m_core->mode1 & MODE1_TRUNCATE) { - alu_i = (INT32)(r_alu.f); + alu_i = (int32_t)(r_alu.f); } else { - alu_i = (INT32)(r_alu.f < 0 ? (r_alu.f - 0.5f) : (r_alu.f + 0.5f)); + alu_i = (int32_t)(r_alu.f < 0 ? (r_alu.f - 0.5f) : (r_alu.f + 0.5f)); } CLEAR_ALU_FLAGS(); @@ -430,17 +430,17 @@ void adsp21062_device::compute_fix(int rn, int rx) /* Rn = FIX Fx BY Ry */ void adsp21062_device::compute_fix_scaled(int rn, int rx, int ry) { - INT32 alu_i; + int32_t alu_i; SHARC_REG r_alu; r_alu.r = SCALB(m_core->r[rx], ry); if (m_core->mode1 & MODE1_TRUNCATE) { - alu_i = (INT32)(r_alu.f); + alu_i = (int32_t)(r_alu.f); } else { - alu_i = (INT32)(r_alu.f < 0 ? (r_alu.f - 0.5f) : (r_alu.f + 0.5f)); + alu_i = (int32_t)(r_alu.f < 0 ? (r_alu.f - 0.5f) : (r_alu.f + 0.5f)); } CLEAR_ALU_FLAGS(); @@ -461,7 +461,7 @@ void adsp21062_device::compute_fix_scaled(int rn, int rx, int ry) void adsp21062_device::compute_float_scaled(int rn, int rx, int ry) { SHARC_REG x; - x.f = (float)(INT32)(REG(rx)); + x.f = (float)(int32_t)(REG(rx)); // verified CLEAR_ALU_FLAGS(); @@ -482,7 +482,7 @@ void adsp21062_device::compute_float_scaled(int rn, int rx, int ry) void adsp21062_device::compute_logb(int rn, int rx) { // verified - UINT32 r = REG(rx); + uint32_t r = REG(rx); CLEAR_ALU_FLAGS(); @@ -645,7 +645,7 @@ void adsp21062_device::compute_fneg(int rn, int rx) /* COMP(Fx, Fy) */ void adsp21062_device::compute_fcomp(int rx, int ry) { - UINT32 comp_accum; + uint32_t comp_accum; CLEAR_ALU_FLAGS(); // AZ @@ -775,7 +775,7 @@ void adsp21062_device::compute_fclip(int rn, int rx, int ry) void adsp21062_device::compute_recips(int rn, int rx) { // verified - UINT32 r; + uint32_t r; CLEAR_ALU_FLAGS(); @@ -799,11 +799,11 @@ void adsp21062_device::compute_recips(int rn, int rx) } else { - UINT32 mantissa = REG(rx) & 0x7fffff; - UINT32 exponent = (REG(rx) >> 23) & 0xff; - UINT32 sign = REG(rx) & FLOAT_SIGN; + uint32_t mantissa = REG(rx) & 0x7fffff; + uint32_t exponent = (REG(rx) >> 23) & 0xff; + uint32_t sign = REG(rx) & FLOAT_SIGN; - UINT32 res_mantissa = recips_mantissa_lookup[mantissa >> 16]; + uint32_t res_mantissa = recips_mantissa_lookup[mantissa >> 16]; int res_exponent = -(exponent - 127) - 1; if (res_exponent > 125 || res_exponent < -126) @@ -839,9 +839,9 @@ void adsp21062_device::compute_recips(int rn, int rx) void adsp21062_device::compute_rsqrts(int rn, int rx) { // verified - UINT32 r; + uint32_t r; - if ((UINT32)(REG(rx)) > 0x80000000) + if ((uint32_t)(REG(rx)) > 0x80000000) { // non-zero negative r = 0xffffffff; @@ -853,11 +853,11 @@ void adsp21062_device::compute_rsqrts(int rn, int rx) } else { - UINT32 mantissa = REG(rx) & 0xffffff; // mantissa + LSB of biased exponent - UINT32 exponent = (REG(rx) >> 23) & 0xff; - UINT32 sign = REG(rx) & FLOAT_SIGN; + uint32_t mantissa = REG(rx) & 0xffffff; // mantissa + LSB of biased exponent + uint32_t exponent = (REG(rx) >> 23) & 0xff; + uint32_t sign = REG(rx) & FLOAT_SIGN; - UINT32 res_mantissa = rsqrts_mantissa_lookup[mantissa >> 17]; + uint32_t res_mantissa = rsqrts_mantissa_lookup[mantissa >> 17]; int res_exponent = -((exponent - 127) / 2) - 1; res_exponent = (res_exponent + 127) & 0xff; @@ -924,53 +924,53 @@ void adsp21062_device::compute_fabs(int rn, int rx) /* Rn = (unsigned)Rx * (unsigned)Ry, integer, no rounding */ void adsp21062_device::compute_mul_uuin(int rn, int rx, int ry) { - UINT64 r = (UINT64)(UINT32)REG(rx) * (UINT64)(UINT32)REG(ry); + uint64_t r = (uint64_t)(uint32_t)REG(rx) * (uint64_t)(uint32_t)REG(ry); CLEAR_MULTIPLIER_FLAGS(); - SET_FLAG_MN((UINT32)r); + SET_FLAG_MN((uint32_t)r); SET_FLAG_MV(r); SET_FLAG_MU(r); - REG(rn) = (UINT32)(r); + REG(rn) = (uint32_t)(r); } /* Rn = (signed)Rx * (signed)Ry, integer, no rounding */ void adsp21062_device::compute_mul_ssin(int rn, int rx, int ry) { - UINT64 r = (INT64)(INT32)REG(rx) * (INT64)(INT32)REG(ry); + uint64_t r = (int64_t)(int32_t)REG(rx) * (int64_t)(int32_t)REG(ry); CLEAR_MULTIPLIER_FLAGS(); - SET_FLAG_MN((UINT32)r); + SET_FLAG_MN((uint32_t)r); SET_FLAG_MV(r); SET_FLAG_MU(r); - REG(rn) = (UINT32)(r); + REG(rn) = (uint32_t)(r); } /* MRF + (signed)Rx * (signed)Ry, integer, no rounding */ -UINT32 adsp21062_device::compute_mrf_plus_mul_ssin(int rx, int ry) +uint32_t adsp21062_device::compute_mrf_plus_mul_ssin(int rx, int ry) { - UINT64 r = m_core->mrf + ((INT64)(INT32)REG(rx) * (INT64)(INT32)REG(ry)); + uint64_t r = m_core->mrf + ((int64_t)(int32_t)REG(rx) * (int64_t)(int32_t)REG(ry)); CLEAR_MULTIPLIER_FLAGS(); - SET_FLAG_MN((UINT32)r); + SET_FLAG_MN((uint32_t)r); SET_FLAG_MV(r); SET_FLAG_MU(r); - return (UINT32)(r); + return (uint32_t)(r); } /* MRB + (signed)Rx * (signed)Ry, integer, no rounding */ -UINT32 adsp21062_device::compute_mrb_plus_mul_ssin(int rx, int ry) +uint32_t adsp21062_device::compute_mrb_plus_mul_ssin(int rx, int ry) { - INT64 r = m_core->mrb + ((INT64)(INT32)REG(rx) * (INT64)(INT32)REG(ry)); + int64_t r = m_core->mrb + ((int64_t)(int32_t)REG(rx) * (int64_t)(int32_t)REG(ry)); CLEAR_MULTIPLIER_FLAGS(); - SET_FLAG_MN((UINT32)r); + SET_FLAG_MN((uint32_t)r); SET_FLAG_MV(r); SET_FLAG_MU(r); - return (UINT32)(r); + return (uint32_t)(r); } /* Fn = Fx * Fy */ @@ -994,11 +994,11 @@ void adsp21062_device::compute_multi_mr_to_reg(int ai, int rk) { switch(ai) { - case 0: SET_UREG(rk, (UINT32)(m_core->mrf)); break; - case 1: SET_UREG(rk, (UINT32)(m_core->mrf >> 32)); break; + case 0: SET_UREG(rk, (uint32_t)(m_core->mrf)); break; + case 1: SET_UREG(rk, (uint32_t)(m_core->mrf >> 32)); break; case 2: fatalerror("SHARC: tried to load MR2F\n"); break; - case 4: SET_UREG(rk, (UINT32)(m_core->mrb)); break; - case 5: SET_UREG(rk, (UINT32)(m_core->mrb >> 32)); break; + case 4: SET_UREG(rk, (uint32_t)(m_core->mrb)); break; + case 5: SET_UREG(rk, (uint32_t)(m_core->mrb >> 32)); break; case 6: fatalerror("SHARC: tried to load MR2B\n"); break; default: fatalerror("SHARC: unknown ai %d in mr_to_reg\n", ai); } @@ -1011,10 +1011,10 @@ void adsp21062_device::compute_multi_reg_to_mr(int ai, int rk) switch(ai) { case 0: m_core->mrf &= ~0xffffffff; m_core->mrf |= GET_UREG(rk); break; - case 1: m_core->mrf &= 0xffffffff; m_core->mrf |= (UINT64)(GET_UREG(rk)) << 32; break; + case 1: m_core->mrf &= 0xffffffff; m_core->mrf |= (uint64_t)(GET_UREG(rk)) << 32; break; case 2: fatalerror("SHARC: tried to write MR2F\n"); break; case 4: m_core->mrb &= ~0xffffffff; m_core->mrb |= GET_UREG(rk); break; - case 5: m_core->mrb &= 0xffffffff; m_core->mrb |= (UINT64)(GET_UREG(rk)) << 32; break; + case 5: m_core->mrb &= 0xffffffff; m_core->mrb |= (uint64_t)(GET_UREG(rk)) << 32; break; case 6: fatalerror("SHARC: tried to write MR2B\n"); break; default: fatalerror("SHARC: unknown ai %d in reg_to_mr\n", ai); } @@ -1025,8 +1025,8 @@ void adsp21062_device::compute_multi_reg_to_mr(int ai, int rk) /* Ra = Rx + Ry, Rs = Rx - Ry */ void adsp21062_device::compute_dual_add_sub(int ra, int rs, int rx, int ry) { - UINT32 r_add = REG(rx) + REG(ry); - UINT32 r_sub = REG(rx) - REG(ry); + uint32_t r_add = REG(rx) + REG(ry); + uint32_t r_sub = REG(rx) - REG(ry); CLEAR_ALU_FLAGS(); if (r_add == 0 || r_sub == 0) @@ -1042,8 +1042,8 @@ void adsp21062_device::compute_dual_add_sub(int ra, int rs, int rx, int ry) { m_core->astat |= AV; } - if (((UINT32)r_add < (UINT32)REG(rx)) || - (!((UINT32)r_sub < (UINT32)REG(rx)))) + if (((uint32_t)r_add < (uint32_t)REG(rx)) || + (!((uint32_t)r_sub < (uint32_t)REG(rx)))) { m_core->astat |= AC; } @@ -1057,8 +1057,8 @@ void adsp21062_device::compute_dual_add_sub(int ra, int rs, int rx, int ry) /* Rm = (signed)Rxm * (signed)Rym, fractional, rounding, Ra = Rxa + Rya */ void adsp21062_device::compute_mul_ssfr_add(int rm, int rxm, int rym, int ra, int rxa, int rya) { - UINT32 r_mul = (UINT32)(((INT64)(REG(rxm)) * (INT64)(REG(rym))) >> 31); - UINT32 r_add = REG(rxa) + REG(rya); + uint32_t r_mul = (uint32_t)(((int64_t)(REG(rxm)) * (int64_t)(REG(rym))) >> 31); + uint32_t r_add = REG(rxa) + REG(rya); CLEAR_MULTIPLIER_FLAGS(); SET_FLAG_MN(r_mul); @@ -1082,8 +1082,8 @@ void adsp21062_device::compute_mul_ssfr_add(int rm, int rxm, int rym, int ra, in /* Rm = (signed)Rxm * (signed)Rym, fractional, rounding, Ra = Rxa - Rya */ void adsp21062_device::compute_mul_ssfr_sub(int rm, int rxm, int rym, int ra, int rxa, int rya) { - UINT32 r_mul = (UINT32)(((INT64)(REG(rxm)) * (INT64)(REG(rym))) >> 31); - UINT32 r_sub = REG(rxa) - REG(rya); + uint32_t r_mul = (uint32_t)(((int64_t)(REG(rxm)) * (int64_t)(REG(rym))) >> 31); + uint32_t r_sub = REG(rxa) - REG(rya); CLEAR_MULTIPLIER_FLAGS(); SET_FLAG_MN(r_mul); @@ -1203,7 +1203,7 @@ void adsp21062_device::compute_fmul_float_scaled(int fm, int fxm, int fym, int f SHARC_REG r_mul, r_alu; r_mul.f = FREG(fxm) * FREG(fym); - x.f = (float)(INT32)REG(fxa); + x.f = (float)(int32_t)REG(fxa); r_alu.r = SCALB(x, fya); @@ -1229,7 +1229,7 @@ void adsp21062_device::compute_fmul_float_scaled(int fm, int fxm, int fym, int f /* Fm = Fxm * Fym, Fa = FIX Fxa BY Fya */ void adsp21062_device::compute_fmul_fix_scaled(int fm, int fxm, int fym, int fa, int fxa, int fya) { - INT32 alu_i; + int32_t alu_i; SHARC_REG r_mul, r_alu; r_mul.f = FREG(fxm) * FREG(fym); @@ -1237,11 +1237,11 @@ void adsp21062_device::compute_fmul_fix_scaled(int fm, int fxm, int fym, int fa, if (m_core->mode1 & MODE1_TRUNCATE) { - alu_i = (INT32)(r_alu.f); + alu_i = (int32_t)(r_alu.f); } else { - alu_i = (INT32)(r_alu.f < 0 ? (r_alu.f - 0.5f) : (r_alu.f + 0.5f)); + alu_i = (int32_t)(r_alu.f < 0 ? (r_alu.f - 0.5f) : (r_alu.f + 0.5f)); } CLEAR_MULTIPLIER_FLAGS(); @@ -1267,7 +1267,7 @@ void adsp21062_device::compute_fmul_fix_scaled(int fm, int fxm, int fym, int fa, void adsp21062_device::compute_fmul_avg(int fm, int fxm, int fym, int fa, int fxa, int fya) { - INT32 alu_i; + int32_t alu_i; SHARC_REG r_mul, r_alu; r_mul.f = FREG(fxm) * FREG(fym); r_alu.f = (FREG(fxa) * FREG(fya))/((float) 2.0); @@ -1275,11 +1275,11 @@ void adsp21062_device::compute_fmul_avg(int fm, int fxm, int fym, int fa, int fx /* TODO: are flags right for this? */ if (m_core->mode1 & MODE1_TRUNCATE) { - alu_i = (INT32)(r_alu.f); + alu_i = (int32_t)(r_alu.f); } else { - alu_i = (INT32)(r_alu.f < 0 ? (r_alu.f - 0.5f) : (r_alu.f + 0.5f)); + alu_i = (int32_t)(r_alu.f < 0 ? (r_alu.f - 0.5f) : (r_alu.f + 0.5f)); } CLEAR_MULTIPLIER_FLAGS(); diff --git a/src/devices/cpu/sharc/sharc.cpp b/src/devices/cpu/sharc/sharc.cpp index 00e28dfafc7..228acd8c61a 100644 --- a/src/devices/cpu/sharc/sharc.cpp +++ b/src/devices/cpu/sharc/sharc.cpp @@ -53,9 +53,9 @@ enum }; -#define ROPCODE(pc) ((UINT64)(m_internal_ram[((pc-0x20000) * 3) + 0]) << 32) | \ - ((UINT64)(m_internal_ram[((pc-0x20000) * 3) + 1]) << 16) | \ - ((UINT64)(m_internal_ram[((pc-0x20000) * 3) + 2]) << 0) +#define ROPCODE(pc) ((uint64_t)(m_internal_ram[((pc-0x20000) * 3) + 0]) << 32) | \ + ((uint64_t)(m_internal_ram[((pc-0x20000) * 3) + 1]) << 16) | \ + ((uint64_t)(m_internal_ram[((pc-0x20000) * 3) + 2]) << 0) const device_type ADSP21062 = &device_creator; @@ -67,7 +67,7 @@ static ADDRESS_MAP_START( internal_pgm, AS_PROGRAM, 64, adsp21062_device ) ADDRESS_MAP_END -adsp21062_device::adsp21062_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adsp21062_device::adsp21062_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ADSP21062, "ADSP21062", tag, owner, clock, "adsp21062", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 64, 24, -3, ADDRESS_MAP_NAME(internal_pgm)) , m_data_config("data", ENDIANNESS_LITTLE, 32, 32, -2) @@ -80,7 +80,7 @@ adsp21062_device::adsp21062_device(const machine_config &mconfig, const char *ta } -offs_t adsp21062_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t adsp21062_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( sharc ); return CPU_DISASSEMBLE_NAME(sharc)(this, buffer, pc, oprom, opram, options); @@ -92,7 +92,7 @@ void adsp21062_device::enable_recompiler() } -void adsp21062_device::CHANGE_PC(UINT32 newpc) +void adsp21062_device::CHANGE_PC(uint32_t newpc) { m_core->pc = newpc; m_core->daddr = newpc; @@ -100,7 +100,7 @@ void adsp21062_device::CHANGE_PC(UINT32 newpc) m_core->nfaddr = newpc+2; } -void adsp21062_device::CHANGE_PC_DELAYED(UINT32 newpc) +void adsp21062_device::CHANGE_PC_DELAYED(uint32_t newpc) { m_core->nfaddr = newpc; @@ -136,7 +136,7 @@ TIMER_CALLBACK_MEMBER(adsp21062_device::sharc_iop_delayed_write_callback) m_core->delayed_iop_timer->adjust(attotime::never, 0); } -void adsp21062_device::sharc_iop_delayed_w(UINT32 reg, UINT32 data, int cycles) +void adsp21062_device::sharc_iop_delayed_w(uint32_t reg, uint32_t data, int cycles) { m_core->iop_delayed_reg = reg; m_core->iop_delayed_data = data; @@ -146,7 +146,7 @@ void adsp21062_device::sharc_iop_delayed_w(UINT32 reg, UINT32 data, int cycles) /* IOP registers */ -UINT32 adsp21062_device::sharc_iop_r(UINT32 address) +uint32_t adsp21062_device::sharc_iop_r(uint32_t address) { switch (address) { @@ -160,7 +160,7 @@ UINT32 adsp21062_device::sharc_iop_r(UINT32 address) } } -void adsp21062_device::sharc_iop_w(UINT32 address, UINT32 data) +void adsp21062_device::sharc_iop_w(uint32_t address, uint32_t data) { switch (address) { @@ -175,10 +175,10 @@ void adsp21062_device::sharc_iop_w(UINT32 address, UINT32 data) m_core->extdma_shift = 0; #if 0 - UINT64 r = pm_read48(m_core->dma[6].int_index); + uint64_t r = pm_read48(m_core->dma[6].int_index); - r &= ~((UINT64)(0xffff) << (m_core->extdma_shift*16)); - r |= ((UINT64)data & 0xffff) << (m_core->extdma_shift*16); + r &= ~((uint64_t)(0xffff) << (m_core->extdma_shift*16)); + r |= ((uint64_t)data & 0xffff) << (m_core->extdma_shift*16); pm_write48(m_core->dma[6].int_index, r); @@ -264,7 +264,7 @@ void adsp21062_device::build_opcode_table() for (i=0; i < 512; i++) { - UINT16 op = i << 7; + uint16_t op = i << 7; for (j=0; j < num_ops; j++) { @@ -285,7 +285,7 @@ void adsp21062_device::build_opcode_table() /*****************************************************************************/ -void adsp21062_device::external_iop_write(UINT32 address, UINT32 data) +void adsp21062_device::external_iop_write(uint32_t address, uint32_t data) { if (address == 0x1c) { @@ -301,7 +301,7 @@ void adsp21062_device::external_iop_write(UINT32 address, UINT32 data) } } -void adsp21062_device::external_dma_write(UINT32 address, UINT64 data) +void adsp21062_device::external_dma_write(uint32_t address, uint64_t data) { /* All addresses in the 17-bit index registers are offset by 0x0002 0000, the @@ -313,9 +313,9 @@ void adsp21062_device::external_dma_write(UINT32 address, UINT64 data) case 2: // 16/48 packing { int shift = address % 3; - UINT64 r = pm_read48((m_core->dma[6].int_index & 0x1ffff) | 0x20000); + uint64_t r = pm_read48((m_core->dma[6].int_index & 0x1ffff) | 0x20000); - r &= ~((UINT64)(0xffff) << (shift*16)); + r &= ~((uint64_t)(0xffff) << (shift*16)); r |= (data & 0xffff) << (shift*16); pm_write48((m_core->dma[6].int_index & 0x1ffff) | 0x20000, r); @@ -350,7 +350,7 @@ void adsp21062_device::device_start() m_internal_ram_block1 = &m_internal_ram[0x20000/2]; // init UML generator - UINT32 umlflags = 0; + uint32_t umlflags = 0; m_drcuml = std::make_unique(*this, m_cache, umlflags, 1, 24, 0); // add UML symbols @@ -767,7 +767,7 @@ void adsp21062_device::device_start() void adsp21062_device::device_reset() { - memset(m_internal_ram, 0, 2 * 0x10000 * sizeof(UINT16)); + memset(m_internal_ram, 0, 2 * 0x10000 * sizeof(uint16_t)); switch(m_boot_mode) { @@ -945,7 +945,7 @@ void adsp21062_device::execute_run() int condition = m_core->laddr.code; { - UINT32 looptop = TOP_PC(); + uint32_t looptop = TOP_PC(); if (m_core->pc - looptop > 2) { m_core->astat = m_core->astat_old_old_old; @@ -1012,7 +1012,7 @@ void adsp21062_device::execute_run() } } -bool adsp21062_device::memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value) +bool adsp21062_device::memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) { if (spacenum == AS_PROGRAM) { @@ -1075,25 +1075,25 @@ bool adsp21062_device::memory_read(address_spacenum spacenum, offs_t offset, int return true; } -bool adsp21062_device::memory_readop(offs_t offset, int size, UINT64 &value) +bool adsp21062_device::memory_readop(offs_t offset, int size, uint64_t &value) { - UINT64 mask = (size < 8) ? (((UINT64)1 << (8 * size)) - 1) : ~(UINT64)0; + uint64_t mask = (size < 8) ? (((uint64_t)1 << (8 * size)) - 1) : ~(uint64_t)0; int shift = 8 * (offset & 7); offset >>= 3; if (offset >= 0x20000 && offset < 0x28000) { - UINT64 op = ((UINT64)(m_internal_ram_block0[((offset-0x20000) * 3) + 0]) << 32) | - ((UINT64)(m_internal_ram_block0[((offset-0x20000) * 3) + 1]) << 16) | - ((UINT64)(m_internal_ram_block0[((offset-0x20000) * 3) + 2]) << 0); + uint64_t op = ((uint64_t)(m_internal_ram_block0[((offset-0x20000) * 3) + 0]) << 32) | + ((uint64_t)(m_internal_ram_block0[((offset-0x20000) * 3) + 1]) << 16) | + ((uint64_t)(m_internal_ram_block0[((offset-0x20000) * 3) + 2]) << 0); value = (op >> shift) & mask; return true; } else if (offset >= 0x28000 && offset < 0x30000) { - UINT64 op = ((UINT64)(m_internal_ram_block1[((offset-0x28000) * 3) + 0]) << 32) | - ((UINT64)(m_internal_ram_block1[((offset-0x28000) * 3) + 1]) << 16) | - ((UINT64)(m_internal_ram_block1[((offset-0x28000) * 3) + 2]) << 0); + uint64_t op = ((uint64_t)(m_internal_ram_block1[((offset-0x28000) * 3) + 0]) << 32) | + ((uint64_t)(m_internal_ram_block1[((offset-0x28000) * 3) + 1]) << 16) | + ((uint64_t)(m_internal_ram_block1[((offset-0x28000) * 3) + 2]) << 0); value = (op >> shift) & mask; return true; } diff --git a/src/devices/cpu/sharc/sharc.h b/src/devices/cpu/sharc/sharc.h index 3b60408b6aa..49853a44602 100644 --- a/src/devices/cpu/sharc/sharc.h +++ b/src/devices/cpu/sharc/sharc.h @@ -25,49 +25,49 @@ enum SHARC_BOOT_MODE struct alignas(16) SHARC_DAG { - UINT32 i[8]; - UINT32 m[8]; - UINT32 b[8]; - UINT32 l[8]; + uint32_t i[8]; + uint32_t m[8]; + uint32_t b[8]; + uint32_t l[8]; }; union SHARC_REG { - INT32 r; + int32_t r; float f; }; struct SHARC_DMA_REGS { - UINT32 control; - UINT32 int_index; - UINT32 int_modifier; - UINT32 int_count; - UINT32 chain_ptr; - UINT32 gen_purpose; - UINT32 ext_index; - UINT32 ext_modifier; - UINT32 ext_count; + uint32_t control; + uint32_t int_index; + uint32_t int_modifier; + uint32_t int_count; + uint32_t chain_ptr; + uint32_t gen_purpose; + uint32_t ext_index; + uint32_t ext_modifier; + uint32_t ext_count; }; struct SHARC_LADDR { - UINT32 addr; - UINT32 code; - UINT32 loop_type; + uint32_t addr; + uint32_t code; + uint32_t loop_type; }; struct SHARC_DMA_OP { - UINT32 src; - UINT32 dst; - UINT32 chain_ptr; - INT32 src_modifier; - INT32 dst_modifier; - INT32 src_count; - INT32 dst_count; - INT32 pmode; - INT32 chained_direction; + uint32_t src; + uint32_t dst; + uint32_t chain_ptr; + int32_t src_modifier; + int32_t dst_modifier; + int32_t src_count; + int32_t dst_count; + int32_t pmode; + int32_t chained_direction; emu_timer *timer; bool active; }; @@ -113,7 +113,7 @@ struct SHARC_DMA_OP #define SIGN_EXTEND6(x) (((x) & 0x20) ? (0xffffffc0 | (x)) : (x)) #define SIGN_EXTEND24(x) (((x) & 0x800000) ? (0xff000000 | (x)) : (x)) -#define MAKE_EXTRACT_MASK(start_bit, length) ((0xffffffff << start_bit) & (((UINT32)0xffffffff) >> (32 - (start_bit + length)))) +#define MAKE_EXTRACT_MASK(start_bit, length) ((0xffffffff << start_bit) & (((uint32_t)0xffffffff) >> (32 - (start_bit + length)))) #define OP_USERFLAG_COUNTER_LOOP 0x00000001 #define OP_USERFLAG_COND_LOOP 0x00000002 @@ -143,14 +143,14 @@ class adsp21062_device : public cpu_device public: // construction/destruction - adsp21062_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + adsp21062_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); // static configuration helpers static void set_boot_mode(device_t &device, const SHARC_BOOT_MODE boot_mode) { downcast(device).m_boot_mode = boot_mode; } void set_flag_input(int flag_num, int state); - void external_iop_write(UINT32 address, UINT32 data); - void external_dma_write(UINT32 address, UINT64 data); + void external_iop_write(uint32_t address, uint32_t data); + void external_dma_write(uint32_t address, uint64_t data); TIMER_CALLBACK_MEMBER(sharc_iop_delayed_write_callback); TIMER_CALLBACK_MEMBER(sharc_dma_callback); @@ -249,21 +249,21 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 8; } - virtual UINT32 execute_max_cycles() const override { return 8; } - virtual UINT32 execute_input_lines() const override { return 32; } + virtual uint32_t execute_min_cycles() const override { return 8; } + virtual uint32_t execute_max_cycles() const override { return 8; } + virtual uint32_t execute_input_lines() const override { return 32; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_DATA) ? &m_data_config : nullptr ); } - virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value) override; - virtual bool memory_readop(offs_t offset, int size, UINT64 &value) override; + virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) override; + virtual bool memory_readop(offs_t offset, int size, uint64_t &value) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 6; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 6; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 6; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 6; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; direct_read_data *m_direct; @@ -274,8 +274,8 @@ private: typedef void (adsp21062_device::*opcode_func)(); struct SHARC_OP { - UINT32 op_mask; - UINT32 op_bits; + uint32_t op_mask; + uint32_t op_bits; opcode_func handler; }; static const SHARC_OP s_sharc_opcode_table[]; @@ -286,24 +286,24 @@ private: { struct { - UINT32 az; - UINT32 av; - UINT32 an; - UINT32 ac; - UINT32 as; - UINT32 ai; - UINT32 mn; - UINT32 mv; - UINT32 mu; - UINT32 mi; - UINT32 sv; - UINT32 sz; - UINT32 ss; - UINT32 btf; - UINT32 af; - UINT32 cacc; + uint32_t az; + uint32_t av; + uint32_t an; + uint32_t ac; + uint32_t as; + uint32_t ai; + uint32_t mn; + uint32_t mv; + uint32_t mu; + uint32_t mi; + uint32_t sv; + uint32_t sz; + uint32_t ss; + uint32_t btf; + uint32_t af; + uint32_t cacc; }; - UINT64 flags64[8]; + uint64_t flags64[8]; }; }; @@ -312,23 +312,23 @@ private: SHARC_REG r[16]; SHARC_REG reg_alt[16]; - UINT32 pc; - UINT64 mrf; - UINT64 mrb; + uint32_t pc; + uint64_t mrf; + uint64_t mrb; - UINT32 pcstack[32]; - UINT32 lcstack[6]; - UINT32 lastack[6]; - UINT32 lstkp; + uint32_t pcstack[32]; + uint32_t lcstack[6]; + uint32_t lastack[6]; + uint32_t lstkp; - UINT32 faddr; - UINT32 daddr; - UINT32 pcstk; - UINT32 pcstkp; + uint32_t faddr; + uint32_t daddr; + uint32_t pcstk; + uint32_t pcstkp; SHARC_LADDR laddr; - UINT32 curlcntr; - UINT32 lcntr; - UINT8 extdma_shift; + uint32_t curlcntr; + uint32_t lcntr; + uint8_t extdma_shift; /* Data Address Generator (DAG) */ SHARC_DAG dag1; // (DM bus) @@ -339,80 +339,80 @@ private: SHARC_DMA_REGS dma[12]; /* System registers */ - UINT32 mode1; - UINT32 mode2; - UINT32 astat; - UINT32 stky; - UINT32 irptl; - UINT32 imask; - UINT32 imaskp; - UINT32 ustat1; - UINT32 ustat2; + uint32_t mode1; + uint32_t mode2; + uint32_t astat; + uint32_t stky; + uint32_t irptl; + uint32_t imask; + uint32_t imaskp; + uint32_t ustat1; + uint32_t ustat2; - UINT32 flag[4]; + uint32_t flag[4]; - UINT32 syscon; - UINT32 sysstat; + uint32_t syscon; + uint32_t sysstat; struct { - UINT32 mode1; - UINT32 astat; + uint32_t mode1; + uint32_t astat; } status_stack[5]; - INT32 status_stkp; + int32_t status_stkp; - UINT64 px; + uint64_t px; int icount; - UINT64 opcode; + uint64_t opcode; - UINT32 nfaddr; + uint32_t nfaddr; - INT32 idle; - INT32 irq_pending; - INT32 active_irq_num; + int32_t idle; + int32_t irq_pending; + int32_t active_irq_num; SHARC_DMA_OP dma_op[12]; - UINT32 dma_status; + uint32_t dma_status; - INT32 interrupt_active; + int32_t interrupt_active; - UINT32 iop_delayed_reg; - UINT32 iop_delayed_data; + uint32_t iop_delayed_reg; + uint32_t iop_delayed_data; emu_timer *delayed_iop_timer; - UINT32 delay_slot1, delay_slot2; + uint32_t delay_slot1, delay_slot2; - INT32 systemreg_latency_cycles; - INT32 systemreg_latency_reg; - UINT32 systemreg_latency_data; - UINT32 systemreg_previous_data; + int32_t systemreg_latency_cycles; + int32_t systemreg_latency_reg; + uint32_t systemreg_latency_data; + uint32_t systemreg_previous_data; - UINT32 astat_old; - UINT32 astat_old_old; - UINT32 astat_old_old_old; + uint32_t astat_old; + uint32_t astat_old_old; + uint32_t astat_old_old_old; - UINT32 arg0; - UINT32 arg1; - UINT32 arg2; - UINT32 arg3; + uint32_t arg0; + uint32_t arg1; + uint32_t arg2; + uint32_t arg3; - UINT64 arg64; - UINT32 mode1_delay_data; + uint64_t arg64; + uint32_t mode1_delay_data; ASTAT_DRC astat_drc; ASTAT_DRC astat_drc_copy; ASTAT_DRC astat_delay_copy; - UINT32 dreg_temp; - UINT32 dreg_temp2; - UINT32 jmpdest; - UINT32 temp_return; + uint32_t dreg_temp; + uint32_t dreg_temp2; + uint32_t jmpdest; + uint32_t temp_return; float fp0; float fp1; - UINT32 force_recompile; - UINT32 cache_dirty; + uint32_t force_recompile; + uint32_t cache_dirty; }; sharc_internal_state* m_core; @@ -448,43 +448,43 @@ private: uml::code_handle *m_swap_r0_7; uml::code_handle *m_swap_r8_15; - UINT16 *m_internal_ram_block0, *m_internal_ram_block1; + uint16_t *m_internal_ram_block0, *m_internal_ram_block1; address_space *m_program; address_space *m_data; opcode_func m_sharc_op[512]; - UINT16 m_internal_ram[2 * 0x10000]; // 2x 128KB + uint16_t m_internal_ram[2 * 0x10000]; // 2x 128KB bool m_enable_drc; - inline void CHANGE_PC(UINT32 newpc); - inline void CHANGE_PC_DELAYED(UINT32 newpc); - void sharc_iop_delayed_w(UINT32 reg, UINT32 data, int cycles); - UINT32 sharc_iop_r(UINT32 address); - void sharc_iop_w(UINT32 address, UINT32 data); - UINT32 pm_read32(UINT32 address); - void pm_write32(UINT32 address, UINT32 data); - UINT64 pm_read48(UINT32 address); - void pm_write48(UINT32 address, UINT64 data); - UINT32 dm_read32(UINT32 address); - void dm_write32(UINT32 address, UINT32 data); - void schedule_chained_dma_op(int channel, UINT32 dma_chain_ptr, int chained_direction); - void schedule_dma_op(int channel, UINT32 src, UINT32 dst, int src_modifier, int dst_modifier, int src_count, int dst_count, int pmode); + inline void CHANGE_PC(uint32_t newpc); + inline void CHANGE_PC_DELAYED(uint32_t newpc); + void sharc_iop_delayed_w(uint32_t reg, uint32_t data, int cycles); + uint32_t sharc_iop_r(uint32_t address); + void sharc_iop_w(uint32_t address, uint32_t data); + uint32_t pm_read32(uint32_t address); + void pm_write32(uint32_t address, uint32_t data); + uint64_t pm_read48(uint32_t address); + void pm_write48(uint32_t address, uint64_t data); + uint32_t dm_read32(uint32_t address); + void dm_write32(uint32_t address, uint32_t data); + void schedule_chained_dma_op(int channel, uint32_t dma_chain_ptr, int chained_direction); + void schedule_dma_op(int channel, uint32_t src, uint32_t dst, int src_modifier, int dst_modifier, int src_count, int dst_count, int pmode); void dma_op(int channel); void sharc_dma_exec(int channel); - void add_systemreg_write_latency_effect(int sysreg, UINT32 data, UINT32 prev_data); - inline void swap_register(UINT32 *a, UINT32 *b); + void add_systemreg_write_latency_effect(int sysreg, uint32_t data, uint32_t prev_data); + inline void swap_register(uint32_t *a, uint32_t *b); void systemreg_write_latency_effect(); - UINT32 GET_UREG(int ureg); - void SET_UREG(int ureg, UINT32 data); + uint32_t GET_UREG(int ureg); + void SET_UREG(int ureg, uint32_t data); void SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx); - void COMPUTE(UINT32 opcode); + void COMPUTE(uint32_t opcode); void check_interrupts(); - inline void PUSH_PC(UINT32 pc); - inline UINT32 POP_PC(); - inline UINT32 TOP_PC(); - inline void PUSH_LOOP(UINT32 addr, UINT32 code, UINT32 type, UINT32 count); + inline void PUSH_PC(uint32_t pc); + inline uint32_t POP_PC(); + inline uint32_t TOP_PC(); + inline void PUSH_LOOP(uint32_t addr, uint32_t code, uint32_t type, uint32_t count); inline void POP_LOOP(); inline void PUSH_STATUS_STACK(); inline void POP_STATUS_STACK(); @@ -549,7 +549,7 @@ private: inline void compute_max(int rn, int rx, int ry); inline void compute_neg(int rn, int rx); inline void compute_not(int rn, int rx); - inline UINT32 SCALB(SHARC_REG rx, int ry); + inline uint32_t SCALB(SHARC_REG rx, int ry); inline void compute_float(int rn, int rx); inline void compute_fix(int rn, int rx); inline void compute_fix_scaled(int rn, int rx, int ry); @@ -571,8 +571,8 @@ private: inline void compute_fabs(int rn, int rx); inline void compute_mul_uuin(int rn, int rx, int ry); inline void compute_mul_ssin(int rn, int rx, int ry); - inline UINT32 compute_mrf_plus_mul_ssin(int rx, int ry); - inline UINT32 compute_mrb_plus_mul_ssin(int rx, int ry); + inline uint32_t compute_mrf_plus_mul_ssin(int rx, int ry); + inline uint32_t compute_mrb_plus_mul_ssin(int rx, int ry); inline void compute_fmul(int rn, int rx, int ry); inline void compute_multi_mr_to_reg(int ai, int rk); inline void compute_multi_reg_to_mr(int ai, int rk); @@ -593,14 +593,14 @@ private: /* internal compiler state */ struct compiler_state { - UINT32 cycles; /* accumulated cycles */ - UINT8 checkints; /* need to check interrupts before next instruction */ + uint32_t cycles; /* accumulated cycles */ + uint8_t checkints; /* need to check interrupts before next instruction */ uml::code_label labelnum; /* index for local labels */ struct { int counter; int mode; - UINT32 data; + uint32_t data; } mode1_delay; }; @@ -612,7 +612,7 @@ private: void static_generate_nocode_handler(); void static_generate_out_of_cycles(); void static_generate_memory_accessor(MEM_ACCESSOR_TYPE type, const char *name, uml::code_handle *&handleptr); - void static_generate_exception(UINT8 exception, const char *name); + void static_generate_exception(uint8_t exception, const char *name); void static_generate_push_pc(); void static_generate_pop_pc(); void static_generate_push_loop(); @@ -633,17 +633,17 @@ private: void generate_call(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, bool delayslot); void generate_jump(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, bool delayslot, bool loopabort, bool clearint); void generate_loop_jump(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); - void generate_write_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 data); - void generate_set_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 data); - void generate_clear_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 data); - void generate_toggle_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 data); + void generate_write_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t data); + void generate_set_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t data); + void generate_clear_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t data); + void generate_toggle_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t data); void generate_read_ureg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int ureg, bool has_compute); - void generate_write_ureg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int ureg, bool imm, UINT32 data); + void generate_write_ureg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int ureg, bool imm, uint32_t data); void generate_update_circular_buffer(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int g, int i); void generate_astat_copy(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc); bool if_condition_always_true(int condition); - UINT32 do_condition_astat_bits(int condition); + uint32_t do_condition_astat_bits(int condition); }; diff --git a/src/devices/cpu/sharc/sharcdma.hxx b/src/devices/cpu/sharc/sharcdma.hxx index 9321dd88b05..fdbf7a0f635 100644 --- a/src/devices/cpu/sharc/sharcdma.hxx +++ b/src/devices/cpu/sharc/sharcdma.hxx @@ -8,18 +8,18 @@ #define DMA_PMODE_32_48 3 #define DMA_PMODE_8_48 4 -void adsp21062_device::schedule_chained_dma_op(int channel, UINT32 dma_chain_ptr, int chained_direction) +void adsp21062_device::schedule_chained_dma_op(int channel, uint32_t dma_chain_ptr, int chained_direction) { - UINT32 op_ptr = 0x20000 + dma_chain_ptr; + uint32_t op_ptr = 0x20000 + dma_chain_ptr; - UINT32 int_index = dm_read32(op_ptr - 0); - UINT32 int_modifier = dm_read32(op_ptr - 1); - UINT32 int_count = dm_read32(op_ptr - 2); - UINT32 chain_ptr = dm_read32(op_ptr - 3); - //UINT32 gen_purpose = dm_read32(op_ptr - 4); - UINT32 ext_index = dm_read32(op_ptr - 5); - UINT32 ext_modifier = dm_read32(op_ptr - 6); - UINT32 ext_count = dm_read32(op_ptr - 7); + uint32_t int_index = dm_read32(op_ptr - 0); + uint32_t int_modifier = dm_read32(op_ptr - 1); + uint32_t int_count = dm_read32(op_ptr - 2); + uint32_t chain_ptr = dm_read32(op_ptr - 3); + //uint32_t gen_purpose = dm_read32(op_ptr - 4); + uint32_t ext_index = dm_read32(op_ptr - 5); + uint32_t ext_modifier = dm_read32(op_ptr - 6); + uint32_t ext_count = dm_read32(op_ptr - 7); if (m_core->dma_op[channel].active) { @@ -58,7 +58,7 @@ void adsp21062_device::schedule_chained_dma_op(int channel, UINT32 dma_chain_ptr m_core->dma_status |= (1 << channel); } -void adsp21062_device::schedule_dma_op(int channel, UINT32 src, UINT32 dst, int src_modifier, int dst_modifier, int src_count, int dst_count, int pmode) +void adsp21062_device::schedule_dma_op(int channel, uint32_t src, uint32_t dst, int src_modifier, int dst_modifier, int src_count, int dst_count, int pmode) { if (m_core->dma_op[channel].active) { @@ -86,8 +86,8 @@ void adsp21062_device::schedule_dma_op(int channel, UINT32 src, UINT32 dst, int void adsp21062_device::dma_op(int channel) { int i; - UINT32 src = m_core->dma_op[channel].src; - UINT32 dst = m_core->dma_op[channel].dst; + uint32_t src = m_core->dma_op[channel].src; + uint32_t dst = m_core->dma_op[channel].dst; int src_modifier = m_core->dma_op[channel].src_modifier; int dst_modifier = m_core->dma_op[channel].dst_modifier; int src_count = m_core->dma_op[channel].src_count; @@ -102,7 +102,7 @@ void adsp21062_device::dma_op(int channel) { for (i=0; i < src_count; i++) { - UINT32 data = dm_read32(src); + uint32_t data = dm_read32(src); dm_write32(dst, data); src += src_modifier; dst += dst_modifier; @@ -114,7 +114,7 @@ void adsp21062_device::dma_op(int channel) int length = src_count/2; for (i=0; i < length; i++) { - UINT32 data = ((dm_read32(src+0) & 0xffff) << 16) | (dm_read32(src+1) & 0xffff); + uint32_t data = ((dm_read32(src+0) & 0xffff) << 16) | (dm_read32(src+1) & 0xffff); dm_write32(dst, data); src += src_modifier * 2; @@ -127,12 +127,12 @@ void adsp21062_device::dma_op(int channel) int length = src_count/6; for (i=0; i < length; i++) { - UINT64 data = ((UINT64)(dm_read32(src+0) & 0xff) << 0) | - ((UINT64)(dm_read32(src+1) & 0xff) << 8) | - ((UINT64)(dm_read32(src+2) & 0xff) << 16) | - ((UINT64)(dm_read32(src+3) & 0xff) << 24) | - ((UINT64)(dm_read32(src+4) & 0xff) << 32) | - ((UINT64)(dm_read32(src+5) & 0xff) << 40); + uint64_t data = ((uint64_t)(dm_read32(src+0) & 0xff) << 0) | + ((uint64_t)(dm_read32(src+1) & 0xff) << 8) | + ((uint64_t)(dm_read32(src+2) & 0xff) << 16) | + ((uint64_t)(dm_read32(src+3) & 0xff) << 24) | + ((uint64_t)(dm_read32(src+4) & 0xff) << 32) | + ((uint64_t)(dm_read32(src+5) & 0xff) << 40); pm_write48(dst, data); src += src_modifier * 6; @@ -165,9 +165,9 @@ void adsp21062_device::dma_op(int channel) void adsp21062_device::sharc_dma_exec(int channel) { - UINT32 src, dst; - UINT32 src_count, dst_count; - UINT32 src_modifier, dst_modifier; + uint32_t src, dst; + uint32_t src_count, dst_count; + uint32_t src_modifier, dst_modifier; int chen, tran, dtype, pmode, /*mswf, master,*/ ishake, intio/*, ext, flsh*/; chen = (m_core->dma[channel].control >> 1) & 0x1; @@ -189,7 +189,7 @@ void adsp21062_device::sharc_dma_exec(int channel) if (chen) // Chained DMA { - UINT32 dma_chain_ptr = m_core->dma[channel].chain_ptr & 0x1ffff; + uint32_t dma_chain_ptr = m_core->dma[channel].chain_ptr & 0x1ffff; schedule_chained_dma_op(channel, dma_chain_ptr, tran); } diff --git a/src/devices/cpu/sharc/sharcdrc.cpp b/src/devices/cpu/sharc/sharcdrc.cpp index a0372177b5f..a2422f1f8fc 100644 --- a/src/devices/cpu/sharc/sharcdrc.cpp +++ b/src/devices/cpu/sharc/sharcdrc.cpp @@ -197,20 +197,20 @@ static void cfunc_write_snoop(void *param) void adsp21062_device::sharc_cfunc_unimplemented() { - UINT64 op = m_core->arg64; - fatalerror("PC=%08X: Unimplemented op %04X%08X\n", m_core->pc, (UINT32)(op >> 32), (UINT32)(op)); + uint64_t op = m_core->arg64; + fatalerror("PC=%08X: Unimplemented op %04X%08X\n", m_core->pc, (uint32_t)(op >> 32), (uint32_t)(op)); } void adsp21062_device::sharc_cfunc_unimplemented_compute() { - UINT64 op = m_core->arg64; - fatalerror("PC=%08X: Unimplemented compute %04X%08X\n", m_core->pc, (UINT32)(op >> 32), (UINT32)(op)); + uint64_t op = m_core->arg64; + fatalerror("PC=%08X: Unimplemented compute %04X%08X\n", m_core->pc, (uint32_t)(op >> 32), (uint32_t)(op)); } void adsp21062_device::sharc_cfunc_unimplemented_shiftimm() { - UINT64 op = m_core->arg64; - fatalerror("PC=%08X: Unimplemented shiftimm %04X%08X\n", m_core->pc, (UINT32)(op >> 32), (UINT32)(op)); + uint64_t op = m_core->arg64; + fatalerror("PC=%08X: Unimplemented shiftimm %04X%08X\n", m_core->pc, (uint32_t)(op >> 32), (uint32_t)(op)); } void adsp21062_device::sharc_cfunc_read_iop() @@ -262,9 +262,9 @@ bool adsp21062_device::if_condition_always_true(int condition) return false; } -UINT32 adsp21062_device::do_condition_astat_bits(int condition) +uint32_t adsp21062_device::do_condition_astat_bits(int condition) { - UINT32 r = 0; + uint32_t r = 0; switch (condition) { case 0x00: r = AZ; break; // EQ @@ -873,7 +873,7 @@ void adsp21062_device::static_generate_pop_status() } -void adsp21062_device::static_generate_exception(UINT8 exception, const char *name) +void adsp21062_device::static_generate_exception(uint8_t exception, const char *name) { code_handle *&exception_handle = m_exception[exception]; @@ -1149,7 +1149,7 @@ void adsp21062_device::compile_block(offs_t pc) for (seqhead = desclist; seqhead != nullptr; seqhead = seqlast->next()) { const opcode_desc *curdesc; - UINT32 nextpc; + uint32_t nextpc; /* determine the last instruction in this sequence */ for (seqlast = seqhead; seqlast != nullptr; seqlast = seqlast->next()) @@ -1571,7 +1571,7 @@ void adsp21062_device::generate_update_cycles(drcuml_block *block, compiler_stat compiler->cycles = 0; } -void adsp21062_device::generate_write_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 data) +void adsp21062_device::generate_write_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t data) { code_label skip; @@ -1628,7 +1628,7 @@ void adsp21062_device::generate_write_mode1_imm(drcuml_block *block, compiler_st UML_MOV(block, MODE1, data); } -void adsp21062_device::generate_set_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 data) +void adsp21062_device::generate_set_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t data) { if (data & 0x1) fatalerror("generate_set_mode1_imm: tried to enable I8 bit reversing"); @@ -1688,7 +1688,7 @@ void adsp21062_device::generate_set_mode1_imm(drcuml_block *block, compiler_stat UML_OR(block, MODE1, MODE1, data); } -void adsp21062_device::generate_clear_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, UINT32 data) +void adsp21062_device::generate_clear_mode1_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, uint32_t data) { if (data & 0x1) fatalerror("generate_clear_mode1_imm: tried to disable I8 bit reversing"); @@ -2141,7 +2141,7 @@ void adsp21062_device::generate_read_ureg(drcuml_block *block, compiler_state *c generate_write_ureg - contents of register I0 or 32-bit immediate data are written into UREG -------------------------------------------------*/ -void adsp21062_device::generate_write_ureg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int ureg, bool imm, UINT32 data) +void adsp21062_device::generate_write_ureg(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int ureg, bool imm, uint32_t data) { switch (ureg) { @@ -2250,7 +2250,7 @@ void adsp21062_device::generate_write_ureg(drcuml_block *block, compiler_state * if (imm) { UML_DAND(block, mem(&m_core->px), mem(&m_core->px), ~0xffff); - UML_DOR(block, mem(&m_core->px), mem(&m_core->px), (UINT64)(data)); + UML_DOR(block, mem(&m_core->px), mem(&m_core->px), (uint64_t)(data)); } else { @@ -2264,7 +2264,7 @@ void adsp21062_device::generate_write_ureg(drcuml_block *block, compiler_state * if (imm) { UML_DAND(block, mem(&m_core->px), mem(&m_core->px), 0xffff); - UML_DOR(block, mem(&m_core->px), mem(&m_core->px), (UINT64)(data) << 16); + UML_DOR(block, mem(&m_core->px), mem(&m_core->px), (uint64_t)(data) << 16); } else { @@ -2282,13 +2282,13 @@ void adsp21062_device::generate_write_ureg(drcuml_block *block, compiler_state * int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT64 opcode = desc->opptr.q[0]; + uint64_t opcode = desc->opptr.q[0]; switch ((opcode >> 45) & 7) { case 0: // subops { - UINT32 subop = (opcode >> 40) & 0x1f; + uint32_t subop = (opcode >> 40) & 0x1f; switch (subop) { case 0x00: // NOP / idle |000|00000| @@ -2669,9 +2669,9 @@ int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compi case 0x0c: // do until counter expired |000|01100| { - UINT16 data = (UINT16)(opcode >> 24); + uint16_t data = (uint16_t)(opcode >> 24); int offset = SIGN_EXTEND24(opcode & 0xffffff); - UINT32 address = desc->pc + offset; + uint32_t address = desc->pc + offset; UML_MOV(block, LCNTR, data); if (data > 0) @@ -2692,7 +2692,7 @@ int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compi { int ureg = (opcode >> 32) & 0xff; int offset = SIGN_EXTEND24(opcode & 0xffffff); - UINT32 address = desc->pc + offset; + uint32_t address = desc->pc + offset; generate_read_ureg(block, compiler, desc, ureg, false); @@ -2713,7 +2713,7 @@ int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compi case 0x0e: // do until |000|01110| { int offset = SIGN_EXTEND24(opcode & 0xffffff); - UINT32 address = desc->pc + offset; + uint32_t address = desc->pc + offset; // push pc UML_MOV(block, I0, desc->pc + 1); @@ -2729,7 +2729,7 @@ int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compi case 0x0f: // immediate data -> ureg |000|01111| { int ureg = (opcode >> 32) & 0xff; - UINT32 data = (UINT32)opcode; + uint32_t data = (uint32_t)opcode; generate_write_ureg(block, compiler, desc, ureg, true, data); return TRUE; @@ -2741,7 +2741,7 @@ int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compi case 0x13: { int ureg = (opcode >> 32) & 0xff; - UINT32 address = (UINT32)(opcode); + uint32_t address = (uint32_t)(opcode); int d = (opcode >> 40) & 1; int g = (opcode >> 41) & 1; @@ -2791,7 +2791,7 @@ int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compi { int bop = (opcode >> 37) & 0x7; int sreg = (opcode >> 32) & 0xf; - UINT32 data = (UINT32)opcode; + uint32_t data = (uint32_t)opcode; switch (bop) { @@ -3068,7 +3068,7 @@ int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compi { int g = (opcode >> 38) & 0x1; int i = (opcode >> 32) & 0x7; - INT32 data = (INT32)(opcode); + int32_t data = (int32_t)(opcode); if (g) { @@ -3425,7 +3425,7 @@ int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compi int i = (opcode >> 41) & 0x7; int m = (opcode >> 38) & 0x7; int g = (opcode >> 37) & 0x1; - UINT32 data = (UINT32)opcode; + uint32_t data = (uint32_t)opcode; if (g) { @@ -3526,7 +3526,7 @@ int adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *compi int d = (opcode >> 40) & 1; int i = (opcode >> 41) & 0x7; int ureg = (opcode >> 32) & 0xff; - UINT32 offset = (UINT32)opcode; + uint32_t offset = (uint32_t)opcode; if (d) { @@ -3687,7 +3687,7 @@ void adsp21062_device::generate_unimplemented_compute(drcuml_block *block, compi void adsp21062_device::generate_compute(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc) { - UINT64 opcode = desc->opptr.q[0]; + uint64_t opcode = desc->opptr.q[0]; if ((opcode & 0x7fffff) == 0) return; @@ -3700,7 +3700,7 @@ void adsp21062_device::generate_compute(drcuml_block *block, compiler_state *com if (opcode & 0x400000) // multi-function operation { - UINT32 multiop = (opcode >> 16) & 0x3f; + uint32_t multiop = (opcode >> 16) & 0x3f; int fm = rs; int fa = rn; int fxm = (opcode >> 6) & 0x3; // registers 0 - 3 @@ -4114,7 +4114,7 @@ void adsp21062_device::generate_compute(drcuml_block *block, compiler_state *com } else // single-function operation { - UINT32 operation = (opcode >> 12) & 0xff; + uint32_t operation = (opcode >> 12) & 0xff; switch ((opcode >> 20) & 3) { @@ -5460,7 +5460,7 @@ void adsp21062_device::generate_do_condition(drcuml_block *block, compiler_state void adsp21062_device::generate_shift_imm(drcuml_block *block, compiler_state *compiler, const opcode_desc *desc, int data, int shiftop, int rn, int rx) { - INT8 shift = data & 0xff; + int8_t shift = data & 0xff; int bit = data & 0x3f; int len = (data >> 6) & 0x3f; diff --git a/src/devices/cpu/sharc/sharcdsm.cpp b/src/devices/cpu/sharc/sharcdsm.cpp index b65bbeb71ea..c0786f02ccd 100644 --- a/src/devices/cpu/sharc/sharcdsm.cpp +++ b/src/devices/cpu/sharc/sharcdsm.cpp @@ -9,7 +9,7 @@ #include "emu.h" #include "sharcdsm.h" -static UINT32 (* sharcdasm_table[256])(UINT32, UINT64); +static uint32_t (* sharcdasm_table[256])(uint32_t, uint64_t); static int dasm_table_built = 0; #define GET_UREG(x) (ureg_names[x]) @@ -40,7 +40,7 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) -static void compute(UINT32 opcode) +static void compute(uint32_t opcode) { int op = (opcode >> 12) & 0xff; int cu = (opcode >> 20) & 0x3; @@ -443,7 +443,7 @@ static void pm_dm_dreg(int g, int d, int i, int m, int dreg) static void shiftop(int shift, int data, int rn, int rx) { - INT8 data8 = data & 0xff; + int8_t data8 = data & 0xff; int bit6 = data & 0x3f; int len = (data >> 6) & 0x3f; @@ -478,7 +478,7 @@ static void shiftop(int shift, int data, int rn, int rx) -static UINT32 dasm_compute_dreg_dmpm(UINT32 pc, UINT64 opcode) +static uint32_t dasm_compute_dreg_dmpm(uint32_t pc, uint64_t opcode) { int dmi = (opcode >> 41) & 0x7; int dmm = (opcode >> 38) & 0x7; @@ -514,7 +514,7 @@ static UINT32 dasm_compute_dreg_dmpm(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_compute(UINT32 pc, UINT64 opcode) +static uint32_t dasm_compute(uint32_t pc, uint64_t opcode) { int cond = (opcode >> 33) & 0x1f; int comp = opcode & 0x7fffff; @@ -527,7 +527,7 @@ static UINT32 dasm_compute(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_compute_uregdmpm_regmod(UINT32 pc, UINT64 opcode) +static uint32_t dasm_compute_uregdmpm_regmod(uint32_t pc, uint64_t opcode) { int cond = (opcode >> 33) & 0x1f; int g = (opcode >> 32) & 0x1; @@ -548,7 +548,7 @@ static UINT32 dasm_compute_uregdmpm_regmod(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_compute_dregdmpm_immmod(UINT32 pc, UINT64 opcode) +static uint32_t dasm_compute_dregdmpm_immmod(uint32_t pc, uint64_t opcode) { int cond = (opcode >> 33) & 0x1f; int g = (opcode >> 40) & 0x1; @@ -569,7 +569,7 @@ static UINT32 dasm_compute_dregdmpm_immmod(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_compute_ureg_ureg(UINT32 pc, UINT64 opcode) +static uint32_t dasm_compute_ureg_ureg(uint32_t pc, uint64_t opcode) { int cond = (opcode >> 31) & 0x1f; int uregs = (opcode >> 36) & 0xff; @@ -586,7 +586,7 @@ static UINT32 dasm_compute_ureg_ureg(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_immshift_dregdmpm(UINT32 pc, UINT64 opcode) +static uint32_t dasm_immshift_dregdmpm(uint32_t pc, uint64_t opcode) { int cond = (opcode >> 33) & 0x1f; int g = (opcode >> 32) & 0x1; @@ -606,7 +606,7 @@ static UINT32 dasm_immshift_dregdmpm(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_immshift_dregdmpm_nodata(UINT32 pc, UINT64 opcode) +static uint32_t dasm_immshift_dregdmpm_nodata(uint32_t pc, uint64_t opcode) { int cond = (opcode >> 33) & 0x1f; int rn = (opcode >> 4) & 0xf; @@ -619,7 +619,7 @@ static UINT32 dasm_immshift_dregdmpm_nodata(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_compute_modify(UINT32 pc, UINT64 opcode) +static uint32_t dasm_compute_modify(uint32_t pc, uint64_t opcode) { int cond = (opcode >> 33) & 0x1f; int g = (opcode >> 38) & 0x7; @@ -637,13 +637,13 @@ static UINT32 dasm_compute_modify(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_direct_jump(UINT32 pc, UINT64 opcode) +static uint32_t dasm_direct_jump(uint32_t pc, uint64_t opcode) { int j = (opcode >> 26) & 0x1; int cond = (opcode >> 33) & 0x1f; int ci = (opcode >> 24) & 0x1; - UINT32 addr = opcode & 0xffffff; - UINT32 flags = 0; + uint32_t addr = opcode & 0xffffff; + uint32_t flags = 0; get_if_condition(cond); if (opcode & U64(0x8000000000)) @@ -675,7 +675,7 @@ static UINT32 dasm_direct_jump(UINT32 pc, UINT64 opcode) return flags; } -static UINT32 dasm_indirect_jump_compute(UINT32 pc, UINT64 opcode) +static uint32_t dasm_indirect_jump_compute(uint32_t pc, uint64_t opcode) { int b = (opcode >> 39) & 0x1; int j = (opcode >> 26) & 0x1; @@ -686,7 +686,7 @@ static UINT32 dasm_indirect_jump_compute(UINT32 pc, UINT64 opcode) int pmm = (opcode >> 27) & 0x7; int reladdr = (opcode >> 27) & 0x3f; int comp = opcode & 0x7fffff; - UINT32 flags = 0; + uint32_t flags = 0; get_if_condition(cond); if (b) @@ -729,7 +729,7 @@ static UINT32 dasm_indirect_jump_compute(UINT32 pc, UINT64 opcode) return flags; } -static UINT32 dasm_indirect_jump_compute_dregdm(UINT32 pc, UINT64 opcode) +static uint32_t dasm_indirect_jump_compute_dregdm(uint32_t pc, uint64_t opcode) { int d = (opcode >> 44) & 0x1; int cond = (opcode >> 33) & 0x1f; @@ -770,7 +770,7 @@ static UINT32 dasm_indirect_jump_compute_dregdm(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_rts_compute(UINT32 pc, UINT64 opcode) +static uint32_t dasm_rts_compute(uint32_t pc, uint64_t opcode) { int j = (opcode >> 26) & 0x1; int e = (opcode >> 25) & 0x1; @@ -811,11 +811,11 @@ static UINT32 dasm_rts_compute(UINT32 pc, UINT64 opcode) return DASMFLAG_STEP_OUT; } -static UINT32 dasm_do_until_counter(UINT32 pc, UINT64 opcode) +static uint32_t dasm_do_until_counter(uint32_t pc, uint64_t opcode) { int data = (opcode >> 24) & 0xffff; int ureg = (opcode >> 32) & 0xff; - UINT32 addr = opcode & 0xffffff; + uint32_t addr = opcode & 0xffffff; if (opcode & U64(0x10000000000)) /* Loop counter from universal register */ { @@ -830,21 +830,21 @@ static UINT32 dasm_do_until_counter(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_do_until(UINT32 pc, UINT64 opcode) +static uint32_t dasm_do_until(uint32_t pc, uint64_t opcode) { int term = (opcode >> 33) & 0x1f; - UINT32 addr = opcode & 0xffffff; + uint32_t addr = opcode & 0xffffff; print("DO (0x%08X) UNTIL %s", pc + SIGN_EXTEND24(addr), condition_codes_do[term]); return 0; } -static UINT32 dasm_immmove_uregdmpm(UINT32 pc, UINT64 opcode) +static uint32_t dasm_immmove_uregdmpm(uint32_t pc, uint64_t opcode) { int d = (opcode >> 40) & 0x1; int g = (opcode >> 41) & 0x1; int ureg = (opcode >> 32) & 0xff; - UINT32 addr = opcode & 0xffffffff; + uint32_t addr = opcode & 0xffffffff; if (g) { @@ -871,13 +871,13 @@ static UINT32 dasm_immmove_uregdmpm(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_immmove_uregdmpm_indirect(UINT32 pc, UINT64 opcode) +static uint32_t dasm_immmove_uregdmpm_indirect(uint32_t pc, uint64_t opcode) { int d = (opcode >> 40) & 0x1; int g = (opcode >> 44) & 0x1; int i = (opcode >> 41) & 0x7; int ureg = (opcode >> 32) & 0xff; - UINT32 addr = opcode & 0xffffffff; + uint32_t addr = opcode & 0xffffffff; if (g) { @@ -904,12 +904,12 @@ static UINT32 dasm_immmove_uregdmpm_indirect(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_immmove_immdata_dmpm(UINT32 pc, UINT64 opcode) +static uint32_t dasm_immmove_immdata_dmpm(uint32_t pc, uint64_t opcode) { int g = (opcode >> 37) & 0x1; int i = (opcode >> 41) & 0x7; int m = (opcode >> 38) & 0x7; - UINT32 data = opcode & 0xffffffff; + uint32_t data = opcode & 0xffffffff; if (g) { @@ -922,20 +922,20 @@ static UINT32 dasm_immmove_immdata_dmpm(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_immmove_immdata_ureg(UINT32 pc, UINT64 opcode) +static uint32_t dasm_immmove_immdata_ureg(uint32_t pc, uint64_t opcode) { int ureg = (opcode >> 32) & 0xff; - UINT32 data = opcode & 0xffffffff; + uint32_t data = opcode & 0xffffffff; print("%s = 0x%08X", GET_UREG(ureg), data); return 0; } -static UINT32 dasm_sysreg_bitop(UINT32 pc, UINT64 opcode) +static uint32_t dasm_sysreg_bitop(uint32_t pc, uint64_t opcode) { int bop = (opcode >> 37) & 0x7; int sreg = (opcode >> 32) & 0xf; - UINT32 data = opcode & 0xffffffff; + uint32_t data = opcode & 0xffffffff; print("BIT "); print("%s ", bopnames[bop]); @@ -944,11 +944,11 @@ static UINT32 dasm_sysreg_bitop(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_ireg_modify(UINT32 pc, UINT64 opcode) +static uint32_t dasm_ireg_modify(uint32_t pc, uint64_t opcode) { int g = (opcode >> 38) & 0x1; int i = (opcode >> 32) & 0x7; - UINT32 data = opcode & 0xffffffff; + uint32_t data = opcode & 0xffffffff; if (opcode & U64(0x8000000000)) /* with bit-reverse */ { @@ -975,7 +975,7 @@ static UINT32 dasm_ireg_modify(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_misc(UINT32 pc, UINT64 opcode) +static uint32_t dasm_misc(uint32_t pc, uint64_t opcode) { int bits = (opcode >> 33) & 0x7f; int lpu = (opcode >> 39) & 0x1; @@ -1041,7 +1041,7 @@ static UINT32 dasm_misc(UINT32 pc, UINT64 opcode) return 0; } -static UINT32 dasm_idlenop(UINT32 pc, UINT64 opcode) +static uint32_t dasm_idlenop(uint32_t pc, uint64_t opcode) { if (opcode & U64(0x8000000000)) { @@ -1055,7 +1055,7 @@ static UINT32 dasm_idlenop(UINT32 pc, UINT64 opcode) } #ifdef UNUSED_FUNCTION -static UINT32 dasm_cjump_rframe(UINT32 pc, UINT64 opcode) +static uint32_t dasm_cjump_rframe(uint32_t pc, uint64_t opcode) { /* TODO */ if (opcode & U64(0x10000000000)) /* RFRAME */ @@ -1070,7 +1070,7 @@ static UINT32 dasm_cjump_rframe(UINT32 pc, UINT64 opcode) } #endif -static UINT32 dasm_invalid(UINT32 pc, UINT64 opcode) +static uint32_t dasm_invalid(uint32_t pc, uint64_t opcode) { print("?"); return 0; @@ -1157,7 +1157,7 @@ static void build_dasm_table(void) for (i=0; i < 256; i++) { - UINT16 op = i << 8; + uint16_t op = i << 8; for (j=0; j < num_ops; j++) { @@ -1176,14 +1176,14 @@ static void build_dasm_table(void) } } -static UINT32 sharc_dasm_one(char *buffer, offs_t pc, UINT64 opcode) +static uint32_t sharc_dasm_one(char *buffer, offs_t pc, uint64_t opcode) { #define DEFAULT_DASM_WIDTH (64) char dasm_buffer[2000]; int i; int op = (opcode >> 40) & 0xff; - UINT32 flags; + uint32_t flags; if (!dasm_table_built) { @@ -1208,12 +1208,12 @@ static UINT32 sharc_dasm_one(char *buffer, offs_t pc, UINT64 opcode) CPU_DISASSEMBLE( sharc ) { - UINT64 op; - UINT32 flags; + uint64_t op; + uint32_t flags; - op = ((UINT64)oprom[0] << 0) | ((UINT64)oprom[1] << 8) | - ((UINT64)oprom[2] << 16) | ((UINT64)oprom[3] << 24) | - ((UINT64)oprom[4] << 32) | ((UINT64)oprom[5] << 40); + op = ((uint64_t)oprom[0] << 0) | ((uint64_t)oprom[1] << 8) | + ((uint64_t)oprom[2] << 16) | ((uint64_t)oprom[3] << 24) | + ((uint64_t)oprom[4] << 32) | ((uint64_t)oprom[5] << 40); flags = sharc_dasm_one(buffer, pc, op); return 1 | flags | DASMFLAG_SUPPORTED; diff --git a/src/devices/cpu/sharc/sharcdsm.h b/src/devices/cpu/sharc/sharcdsm.h index 8407b73cb50..e4a52e94ea6 100644 --- a/src/devices/cpu/sharc/sharcdsm.h +++ b/src/devices/cpu/sharc/sharcdsm.h @@ -73,7 +73,7 @@ static const char mr_regnames[16][8] = struct SHARC_DASM_OP { - UINT32 op_mask; - UINT32 op_bits; - UINT32 (* handler)(UINT32, UINT64); + uint32_t op_mask; + uint32_t op_bits; + uint32_t (* handler)(uint32_t, uint64_t); }; diff --git a/src/devices/cpu/sharc/sharcfe.cpp b/src/devices/cpu/sharc/sharcfe.cpp index 105eea6c66c..194dabcea8c 100644 --- a/src/devices/cpu/sharc/sharcfe.cpp +++ b/src/devices/cpu/sharc/sharcfe.cpp @@ -68,7 +68,7 @@ #define DM_L_MODIFIED(desc,x) do { (desc).regout[2] |= 1 << ((x) + 24); } while(0) -sharc_frontend::sharc_frontend(adsp21062_device *sharc, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) +sharc_frontend::sharc_frontend(adsp21062_device *sharc, uint32_t window_start, uint32_t window_end, uint32_t max_sequence) : drc_frontend(*sharc, window_start, window_end, max_sequence), m_sharc(sharc) { @@ -84,16 +84,16 @@ void sharc_frontend::flush() memset(map, 0, sizeof(LOOP_ENTRY) * 0x20000); } -void sharc_frontend::add_loop_entry(UINT32 pc, UINT8 type, UINT32 start_pc, UINT8 looptype, UINT8 condition) +void sharc_frontend::add_loop_entry(uint32_t pc, uint8_t type, uint32_t start_pc, uint8_t looptype, uint8_t condition) { - UINT32 l2 = pc >> 17; - UINT32 l1 = pc & 0x1ffff; + uint32_t l2 = pc >> 17; + uint32_t l1 = pc & 0x1ffff; if (l2 != 0x1) fatalerror("sharc_frontend::add_loop_entry: PC = %08X", pc); LOOP_ENTRY* map = m_loopmap.get(); - UINT32 current_type = map[l1].entrytype; + uint32_t current_type = map[l1].entrytype; if (current_type & type) { // check for mismatch if the entry is already used @@ -121,10 +121,10 @@ void sharc_frontend::insert_loop(const LOOP_DESCRIPTOR &loopdesc) add_loop_entry(loopdesc.astat_check_pc, LOOP_ENTRY_ASTAT_CHECK, loopdesc.start_pc, loopdesc.type, loopdesc.condition); } -bool sharc_frontend::is_loop_evaluation(UINT32 pc) +bool sharc_frontend::is_loop_evaluation(uint32_t pc) { - UINT32 l2 = pc >> 17; - UINT32 l1 = pc & 0x1ffff; + uint32_t l2 = pc >> 17; + uint32_t l1 = pc & 0x1ffff; if (l2 != 0x1) return false; @@ -136,10 +136,10 @@ bool sharc_frontend::is_loop_evaluation(UINT32 pc) return false; } -bool sharc_frontend::is_loop_start(UINT32 pc) +bool sharc_frontend::is_loop_start(uint32_t pc) { - UINT32 l2 = pc >> 17; - UINT32 l1 = pc & 0x1ffff; + uint32_t l2 = pc >> 17; + uint32_t l1 = pc & 0x1ffff; if (l2 != 0x1) return false; @@ -151,10 +151,10 @@ bool sharc_frontend::is_loop_start(UINT32 pc) return false; } -bool sharc_frontend::is_astat_delay_check(UINT32 pc) +bool sharc_frontend::is_astat_delay_check(uint32_t pc) { - UINT32 l2 = pc >> 17; - UINT32 l1 = pc & 0x1ffff; + uint32_t l2 = pc >> 17; + uint32_t l1 = pc & 0x1ffff; if (l2 != 0x1) return false; @@ -169,7 +169,7 @@ bool sharc_frontend::is_astat_delay_check(UINT32 pc) bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) { - UINT64 opcode = desc.opptr.q[0] = m_sharc->pm_read48(desc.physpc); + uint64_t opcode = desc.opptr.q[0] = m_sharc->pm_read48(desc.physpc); desc.length = 1; desc.cycles = 1; @@ -182,7 +182,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) if (map[index].looptype == LOOP_TYPE_CONDITIONAL) { - UINT32 flags = m_sharc->do_condition_astat_bits(map[index].condition); + uint32_t flags = m_sharc->do_condition_astat_bits(map[index].condition); if (flags & adsp21062_device::ASTAT_FLAGS::AZ) { desc.userflags |= OP_USERFLAG_ASTAT_DELAY_COPY_AZ; AZ_USED(desc); } if (flags & adsp21062_device::ASTAT_FLAGS::AN) { desc.userflags |= OP_USERFLAG_ASTAT_DELAY_COPY_AN; AN_USED(desc); } if (flags & adsp21062_device::ASTAT_FLAGS::AV) { desc.userflags |= OP_USERFLAG_ASTAT_DELAY_COPY_AV; AV_USED(desc); } @@ -223,7 +223,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) { case 0: // subops { - UINT32 subop = (opcode >> 40) & 0x1f; + uint32_t subop = (opcode >> 40) & 0x1f; switch (subop) { case 0x00: // NOP / idle |000|00000| @@ -296,7 +296,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) int j = (opcode >> 26) & 0x1; int b = (opcode >> 39) & 0x1; int cond = (opcode >> 33) & 0x1f; - UINT32 address = opcode & 0xffffff; + uint32_t address = opcode & 0xffffff; if (m_sharc->if_condition_always_true(cond)) desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; @@ -317,7 +317,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) int j = (opcode >> 26) & 0x1; int b = (opcode >> 39) & 0x1; int cond = (opcode >> 33) & 0x1f; - UINT32 address = opcode & 0xffffff; + uint32_t address = opcode & 0xffffff; if (m_sharc->if_condition_always_true(cond)) desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; @@ -522,7 +522,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) { int bop = (opcode >> 37) & 0x7; int sreg = (opcode >> 32) & 0xf; - UINT32 data = (UINT32)(opcode); + uint32_t data = (uint32_t)(opcode); switch (bop) { @@ -637,7 +637,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) break; default: - fatalerror("sharc_frontend::describe: unknown subop %02X in opcode %04X%08X", subop, (UINT16)(opcode >> 32), (UINT32)(opcode)); + fatalerror("sharc_frontend::describe: unknown subop %02X in opcode %04X%08X", subop, (uint16_t)(opcode >> 32), (uint32_t)(opcode)); return false; } break; @@ -978,7 +978,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev) return true; } -bool sharc_frontend::describe_compute(opcode_desc &desc, UINT64 opcode) +bool sharc_frontend::describe_compute(opcode_desc &desc, uint64_t opcode) { // skip if no-op if ((opcode & 0x7fffff) == 0) @@ -992,7 +992,7 @@ bool sharc_frontend::describe_compute(opcode_desc &desc, UINT64 opcode) if (opcode & 0x400000) // multi-function operation { - UINT32 multiop = (opcode >> 16) & 0x3f; + uint32_t multiop = (opcode >> 16) & 0x3f; int fm = rs; int fa = rn; int fxm = (opcode >> 6) & 0x3; // registers 0 - 3 @@ -1135,13 +1135,13 @@ bool sharc_frontend::describe_compute(opcode_desc &desc, UINT64 opcode) break; default: - fatalerror("sharc_frontend::describe_compute: unknown multiop %02X in opcode %04X%08X at %08X", multiop, (UINT16)(opcode >> 32), (UINT32)(opcode), desc.pc); + fatalerror("sharc_frontend::describe_compute: unknown multiop %02X in opcode %04X%08X at %08X", multiop, (uint16_t)(opcode >> 32), (uint32_t)(opcode), desc.pc); return false; } } else // single-function operation { - UINT32 operation = (opcode >> 12) & 0xff; + uint32_t operation = (opcode >> 12) & 0xff; switch ((opcode >> 20) & 3) { @@ -1242,7 +1242,7 @@ bool sharc_frontend::describe_compute(opcode_desc &desc, UINT64 opcode) } default: - fatalerror("sharc_frontend::describe_compute: unknown ALU op %02X in opcode %04X%08X at %08X", operation, (UINT16)(opcode >> 32), (UINT32)(opcode), desc.pc); + fatalerror("sharc_frontend::describe_compute: unknown ALU op %02X in opcode %04X%08X at %08X", operation, (uint16_t)(opcode >> 32), (uint32_t)(opcode), desc.pc); return false; } break; @@ -1526,7 +1526,7 @@ bool sharc_frontend::describe_compute(opcode_desc &desc, UINT64 opcode) break; default: - fatalerror("sharc_frontend::describe_compute: unknown mult op %02X in opcode %04X%08X at %08X", operation, (UINT16)(opcode >> 32), (UINT32)(opcode), desc.pc); + fatalerror("sharc_frontend::describe_compute: unknown mult op %02X in opcode %04X%08X at %08X", operation, (uint16_t)(opcode >> 32), (uint32_t)(opcode), desc.pc); } break; } @@ -1579,13 +1579,13 @@ bool sharc_frontend::describe_compute(opcode_desc &desc, UINT64 opcode) break; default: - fatalerror("sharc_frontend::describe_compute: unknown shift op %02X in opcode %04X%08X at %08X", operation, (UINT16)(opcode >> 32), (UINT32)(opcode), desc.pc); + fatalerror("sharc_frontend::describe_compute: unknown shift op %02X in opcode %04X%08X at %08X", operation, (uint16_t)(opcode >> 32), (uint32_t)(opcode), desc.pc); } break; } default: - fatalerror("sharc_frontend::describe_compute: unknown operation type in opcode %04X%08X at %08X", (UINT16)(opcode >> 32), (UINT32)(opcode), desc.pc); + fatalerror("sharc_frontend::describe_compute: unknown operation type in opcode %04X%08X at %08X", (uint16_t)(opcode >> 32), (uint32_t)(opcode), desc.pc); return false; } } diff --git a/src/devices/cpu/sharc/sharcfe.h b/src/devices/cpu/sharc/sharcfe.h index b383e122606..6961b53b34f 100644 --- a/src/devices/cpu/sharc/sharcfe.h +++ b/src/devices/cpu/sharc/sharcfe.h @@ -18,7 +18,7 @@ class sharc_frontend : public drc_frontend { public: - sharc_frontend(adsp21062_device *sharc, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); + sharc_frontend(adsp21062_device *sharc, uint32_t window_start, uint32_t window_end, uint32_t max_sequence); void flush(); enum UREG_ACCESS @@ -42,17 +42,17 @@ public: struct LOOP_ENTRY { - UINT16 entrytype; - UINT8 looptype; - UINT8 condition; - UINT32 start_pc; + uint16_t entrytype; + uint8_t looptype; + uint8_t condition; + uint32_t start_pc; }; struct LOOP_DESCRIPTOR { - UINT32 start_pc; - UINT32 end_pc; - UINT32 astat_check_pc; + uint32_t start_pc; + uint32_t end_pc; + uint32_t astat_check_pc; LOOP_TYPE type; int condition; }; @@ -62,16 +62,16 @@ protected: virtual bool describe(opcode_desc &desc, const opcode_desc *prev) override; private: - bool describe_compute(opcode_desc &desc, UINT64 opcode); + bool describe_compute(opcode_desc &desc, uint64_t opcode); bool describe_ureg_access(opcode_desc &desc, int reg, UREG_ACCESS access); bool describe_shiftop_imm(opcode_desc &desc, int shiftop, int rn, int rx); void describe_if_condition(opcode_desc &desc, int condition); void insert_loop(const LOOP_DESCRIPTOR &loopdesc); - void add_loop_entry(UINT32 pc, UINT8 type, UINT32 start_pc, UINT8 looptype, UINT8 condition); - bool is_loop_evaluation(UINT32 pc); - bool is_loop_start(UINT32 pc); - bool is_astat_delay_check(UINT32 pc); + void add_loop_entry(uint32_t pc, uint8_t type, uint32_t start_pc, uint8_t looptype, uint8_t condition); + bool is_loop_evaluation(uint32_t pc); + bool is_loop_start(uint32_t pc); + bool is_astat_delay_check(uint32_t pc); adsp21062_device *m_sharc; diff --git a/src/devices/cpu/sharc/sharcmem.hxx b/src/devices/cpu/sharc/sharcmem.hxx index 3b5ed63884d..d415fe0b04b 100644 --- a/src/devices/cpu/sharc/sharcmem.hxx +++ b/src/devices/cpu/sharc/sharcmem.hxx @@ -2,21 +2,21 @@ // copyright-holders:Ville Linde /* SHARC memory operations */ -UINT32 adsp21062_device::pm_read32(UINT32 address) +uint32_t adsp21062_device::pm_read32(uint32_t address) { if (address >= 0x20000 && address < 0x28000) { - UINT32 addr = (address & 0x7fff) * 3; + uint32_t addr = (address & 0x7fff) * 3; - return (UINT32)(m_internal_ram_block0[addr + 0] << 16) | + return (uint32_t)(m_internal_ram_block0[addr + 0] << 16) | (m_internal_ram_block0[addr + 1]); } else if (address >= 0x28000 && address < 0x40000) { // block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff - UINT32 addr = (address & 0x7fff) * 3; + uint32_t addr = (address & 0x7fff) * 3; - return (UINT32)(m_internal_ram_block1[addr + 0] << 16) | + return (uint32_t)(m_internal_ram_block1[addr + 0] << 16) | (m_internal_ram_block1[addr + 1]); } else { @@ -24,23 +24,23 @@ UINT32 adsp21062_device::pm_read32(UINT32 address) } } -void adsp21062_device::pm_write32(UINT32 address, UINT32 data) +void adsp21062_device::pm_write32(uint32_t address, uint32_t data) { if (address >= 0x20000 && address < 0x28000) { - UINT32 addr = (address & 0x7fff) * 3; + uint32_t addr = (address & 0x7fff) * 3; - m_internal_ram_block0[addr + 0] = (UINT16)(data >> 16); - m_internal_ram_block0[addr + 1] = (UINT16)(data); + m_internal_ram_block0[addr + 0] = (uint16_t)(data >> 16); + m_internal_ram_block0[addr + 1] = (uint16_t)(data); return; } else if (address >= 0x28000 && address < 0x40000) { // block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff - UINT32 addr = (address & 0x7fff) * 3; + uint32_t addr = (address & 0x7fff) * 3; - m_internal_ram_block1[addr + 0] = (UINT16)(data >> 16); - m_internal_ram_block1[addr + 1] = (UINT16)(data); + m_internal_ram_block1[addr + 0] = (uint16_t)(data >> 16); + m_internal_ram_block1[addr + 1] = (uint16_t)(data); return; } else { @@ -48,24 +48,24 @@ void adsp21062_device::pm_write32(UINT32 address, UINT32 data) } } -UINT64 adsp21062_device::pm_read48(UINT32 address) +uint64_t adsp21062_device::pm_read48(uint32_t address) { if ((address >= 0x20000 && address < 0x28000)) { - UINT32 addr = (address & 0x7fff) * 3; + uint32_t addr = (address & 0x7fff) * 3; - return ((UINT64)(m_internal_ram_block0[addr + 0]) << 32) | - ((UINT64)(m_internal_ram_block0[addr + 1]) << 16) | - ((UINT64)(m_internal_ram_block0[addr + 2]) << 0); + return ((uint64_t)(m_internal_ram_block0[addr + 0]) << 32) | + ((uint64_t)(m_internal_ram_block0[addr + 1]) << 16) | + ((uint64_t)(m_internal_ram_block0[addr + 2]) << 0); } else if (address >= 0x28000 && address < 0x40000) { // block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff - UINT32 addr = (address & 0x7fff) * 3; + uint32_t addr = (address & 0x7fff) * 3; - return ((UINT64)(m_internal_ram_block1[addr + 0]) << 32) | - ((UINT64)(m_internal_ram_block1[addr + 1]) << 16) | - ((UINT64)(m_internal_ram_block1[addr + 2]) << 0); + return ((uint64_t)(m_internal_ram_block1[addr + 0]) << 32) | + ((uint64_t)(m_internal_ram_block1[addr + 1]) << 16) | + ((uint64_t)(m_internal_ram_block1[addr + 2]) << 0); } else { fatalerror("SHARC: PM Bus Read48 %08X at %08X\n", address, m_core->pc); @@ -74,33 +74,33 @@ UINT64 adsp21062_device::pm_read48(UINT32 address) return 0; } -void adsp21062_device::pm_write48(UINT32 address, UINT64 data) +void adsp21062_device::pm_write48(uint32_t address, uint64_t data) { if ((address >= 0x20000 && address < 0x28000)) { - UINT32 addr = (address & 0x7fff) * 3; + uint32_t addr = (address & 0x7fff) * 3; - m_internal_ram_block0[addr + 0] = (UINT16)(data >> 32); - m_internal_ram_block0[addr + 1] = (UINT16)(data >> 16); - m_internal_ram_block0[addr + 2] = (UINT16)(data); + m_internal_ram_block0[addr + 0] = (uint16_t)(data >> 32); + m_internal_ram_block0[addr + 1] = (uint16_t)(data >> 16); + m_internal_ram_block0[addr + 2] = (uint16_t)(data); return; } else if (address >= 0x28000 && address < 0x40000) { // block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff - UINT32 addr = (address & 0x7fff) * 3; + uint32_t addr = (address & 0x7fff) * 3; - m_internal_ram_block1[addr + 0] = (UINT16)(data >> 32); - m_internal_ram_block1[addr + 1] = (UINT16)(data >> 16); - m_internal_ram_block1[addr + 2] = (UINT16)(data); + m_internal_ram_block1[addr + 0] = (uint16_t)(data >> 32); + m_internal_ram_block1[addr + 1] = (uint16_t)(data >> 16); + m_internal_ram_block1[addr + 2] = (uint16_t)(data); return; } else { - fatalerror("SHARC: PM Bus Write48 %08X, %04X%08X at %08X\n", address, (UINT16)(data >> 32),(UINT32)data, m_core->pc); + fatalerror("SHARC: PM Bus Write48 %08X, %04X%08X at %08X\n", address, (uint16_t)(data >> 32),(uint32_t)data, m_core->pc); } } -UINT32 adsp21062_device::dm_read32(UINT32 address) +uint32_t adsp21062_device::dm_read32(uint32_t address) { if (address < 0x100) { @@ -108,57 +108,57 @@ UINT32 adsp21062_device::dm_read32(UINT32 address) } else if (address >= 0x20000 && address < 0x28000) { - UINT32 addr = (address & 0x7fff) * 2; + uint32_t addr = (address & 0x7fff) * 2; - return (UINT32)(m_internal_ram_block0[addr + 0] << 16) | + return (uint32_t)(m_internal_ram_block0[addr + 0] << 16) | (m_internal_ram_block0[addr + 1]); } else if (address >= 0x28000 && address < 0x40000) { // block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff - UINT32 addr = (address & 0x7fff) * 2; + uint32_t addr = (address & 0x7fff) * 2; - return (UINT32)(m_internal_ram_block1[addr + 0] << 16) | + return (uint32_t)(m_internal_ram_block1[addr + 0] << 16) | (m_internal_ram_block1[addr + 1]); } // short word addressing else if (address >= 0x40000 && address < 0x50000) { - UINT32 addr = address & 0xffff; + uint32_t addr = address & 0xffff; - UINT16 r = m_internal_ram_block0[addr ^ 1]; + uint16_t r = m_internal_ram_block0[addr ^ 1]; if (m_core->mode1 & 0x4000) { // sign-extend - return (INT32)(INT16)(r); + return (int32_t)(int16_t)(r); } else { - return (UINT32)(r); + return (uint32_t)(r); } } else if (address >= 0x50000 && address < 0x80000) { // block 1 is mirrored in 0x50000...5ffff, 0x60000...0x6ffff and 0x70000...7ffff - UINT32 addr = address & 0xffff; + uint32_t addr = address & 0xffff; - UINT16 r = m_internal_ram_block1[addr ^ 1]; + uint16_t r = m_internal_ram_block1[addr ^ 1]; if (m_core->mode1 & 0x4000) { // sign-extend - return (INT32)(INT16)(r); + return (int32_t)(int16_t)(r); } else { - return (UINT32)(r); + return (uint32_t)(r); } } return m_data->read_dword(address << 2); } -void adsp21062_device::dm_write32(UINT32 address, UINT32 data) +void adsp21062_device::dm_write32(uint32_t address, uint32_t data) { if (address < 0x100) { @@ -167,26 +167,26 @@ void adsp21062_device::dm_write32(UINT32 address, UINT32 data) } else if (address >= 0x20000 && address < 0x28000) { - UINT32 addr = (address & 0x7fff) * 2; + uint32_t addr = (address & 0x7fff) * 2; - m_internal_ram_block0[addr + 0] = (UINT16)(data >> 16); - m_internal_ram_block0[addr + 1] = (UINT16)(data); + m_internal_ram_block0[addr + 0] = (uint16_t)(data >> 16); + m_internal_ram_block0[addr + 1] = (uint16_t)(data); return; } else if (address >= 0x28000 && address < 0x40000) { // block 1 is mirrored in 0x28000...2ffff, 0x30000...0x37fff and 0x38000...3ffff - UINT32 addr = (address & 0x7fff) * 2; + uint32_t addr = (address & 0x7fff) * 2; - m_internal_ram_block1[addr + 0] = (UINT16)(data >> 16); - m_internal_ram_block1[addr + 1] = (UINT16)(data); + m_internal_ram_block1[addr + 0] = (uint16_t)(data >> 16); + m_internal_ram_block1[addr + 1] = (uint16_t)(data); return; } // short word addressing else if (address >= 0x40000 && address < 0x50000) { - UINT32 addr = address & 0xffff; + uint32_t addr = address & 0xffff; m_internal_ram_block0[addr ^ 1] = data; return; @@ -194,7 +194,7 @@ void adsp21062_device::dm_write32(UINT32 address, UINT32 data) else if (address >= 0x50000 && address < 0x80000) { // block 1 is mirrored in 0x50000...5ffff, 0x60000...0x6ffff and 0x70000...7ffff - UINT32 addr = address & 0xffff; + uint32_t addr = address & 0xffff; m_internal_ram_block1[addr ^ 1] = data; return; diff --git a/src/devices/cpu/sharc/sharcops.hxx b/src/devices/cpu/sharc/sharcops.hxx index 0400319d10e..e3140f00352 100644 --- a/src/devices/cpu/sharc/sharcops.hxx +++ b/src/devices/cpu/sharc/sharcops.hxx @@ -87,7 +87,7 @@ /*****************************************************************************/ -void adsp21062_device::add_systemreg_write_latency_effect(int sysreg, UINT32 data, UINT32 prev_data) +void adsp21062_device::add_systemreg_write_latency_effect(int sysreg, uint32_t data, uint32_t prev_data) { if (m_core->systemreg_latency_cycles > 0) { @@ -101,9 +101,9 @@ void adsp21062_device::add_systemreg_write_latency_effect(int sysreg, UINT32 dat m_core->systemreg_previous_data = prev_data; } -void adsp21062_device::swap_register(UINT32 *a, UINT32 *b) +void adsp21062_device::swap_register(uint32_t *a, uint32_t *b) { - UINT32 temp = *a; + uint32_t temp = *a; *a = *b; *b = temp; } @@ -111,14 +111,14 @@ void adsp21062_device::swap_register(UINT32 *a, UINT32 *b) void adsp21062_device::systemreg_write_latency_effect() { int i; - UINT32 data = m_core->systemreg_latency_data; - UINT32 old_data = m_core->systemreg_previous_data; + uint32_t data = m_core->systemreg_latency_data; + uint32_t old_data = m_core->systemreg_previous_data; switch(m_core->systemreg_latency_reg) { case 0xb: /* MODE1 */ { - UINT32 oldreg = old_data; + uint32_t oldreg = old_data; m_core->mode1 = data; if ((data & 0x1) != (oldreg & 0x1)) @@ -213,12 +213,12 @@ void adsp21062_device::systemreg_write_latency_effect() if ((data & 0x80) != (oldreg & 0x80)) { for (i=8; i<16; i++) - swap_register((UINT32*)&m_core->r[i].r, (UINT32*)&m_core->reg_alt[i].r); + swap_register((uint32_t*)&m_core->r[i].r, (uint32_t*)&m_core->reg_alt[i].r); } if ((data & 0x400) != (oldreg & 0x400)) { for (i=0; i<8; i++) - swap_register((UINT32*)&m_core->r[i].r, (UINT32*)&m_core->reg_alt[i].r); + swap_register((uint32_t*)&m_core->r[i].r, (uint32_t*)&m_core->reg_alt[i].r); } break; } @@ -228,7 +228,7 @@ void adsp21062_device::systemreg_write_latency_effect() m_core->systemreg_latency_reg = -1; } -UINT32 adsp21062_device::GET_UREG(int ureg) +uint32_t adsp21062_device::GET_UREG(int ureg) { int reg = ureg & 0xf; switch((ureg >> 4) & 0xf) @@ -254,7 +254,7 @@ UINT32 adsp21062_device::GET_UREG(int ureg) { if (reg & 0x8) /* M8 - M15 */ { - INT32 r = m_core->dag2.m[reg & 0x7]; + int32_t r = m_core->dag2.m[reg & 0x7]; if (r & 0x800000) r |= 0xff000000; return r; @@ -310,7 +310,7 @@ UINT32 adsp21062_device::GET_UREG(int ureg) case 0xb: return m_core->mode1; /* MODE1 */ case 0xc: /* ASTAT */ { - UINT32 r = m_core->astat; + uint32_t r = m_core->astat; r &= ~0x00780000; r |= (m_core->flag[0] << 19); r |= (m_core->flag[1] << 20); @@ -330,9 +330,9 @@ UINT32 adsp21062_device::GET_UREG(int ureg) switch(reg) { /* PX needs to be handled separately if the whole 48 bits are needed */ - case 0xb: return (UINT32)(m_core->px); /* PX */ - case 0xc: return (UINT16)(m_core->px); /* PX1 */ - case 0xd: return (UINT32)(m_core->px >> 16); /* PX2 */ + case 0xb: return (uint32_t)(m_core->px); /* PX */ + case 0xc: return (uint16_t)(m_core->px); /* PX1 */ + case 0xd: return (uint32_t)(m_core->px >> 16); /* PX2 */ default: fatalerror("SHARC: GET_UREG: unknown register %08X at %08X\n", ureg, m_core->pc); } break; @@ -342,7 +342,7 @@ UINT32 adsp21062_device::GET_UREG(int ureg) } } -void adsp21062_device::SET_UREG(int ureg, UINT32 data) +void adsp21062_device::SET_UREG(int ureg, uint32_t data) { int reg = ureg & 0xf; switch((ureg >> 4) & 0xf) @@ -441,7 +441,7 @@ void adsp21062_device::SET_UREG(int ureg, UINT32 data) switch(reg) { case 0xc: m_core->px &= U64(0xffffffffffff0000); m_core->px |= (data & 0xffff); break; /* PX1 */ - case 0xd: m_core->px &= U64(0x000000000000ffff); m_core->px |= (UINT64)data << 16; break; /* PX2 */ + case 0xd: m_core->px &= U64(0x000000000000ffff); m_core->px |= (uint64_t)data << 16; break; /* PX2 */ default: fatalerror("SHARC: SET_UREG: unknown register %08X at %08X\n", ureg, m_core->pc); } break; @@ -451,16 +451,16 @@ void adsp21062_device::SET_UREG(int ureg, UINT32 data) } /*****************************************************************************/ -#define SET_FLAG_SV_LSHIFT(x, shift) if((x) & ((UINT32)0xffffffff << shift)) m_core->astat |= SV -#define SET_FLAG_SV_RSHIFT(x, shift) if((x) & ((UINT32)0xffffffff >> shift)) m_core->astat |= SV +#define SET_FLAG_SV_LSHIFT(x, shift) if((x) & ((uint32_t)0xffffffff << shift)) m_core->astat |= SV +#define SET_FLAG_SV_RSHIFT(x, shift) if((x) & ((uint32_t)0xffffffff >> shift)) m_core->astat |= SV #define SET_FLAG_SZ(x) if((x) == 0) m_core->astat |= SZ -#define MAKE_EXTRACT_MASK(start_bit, length) ((0xffffffff << start_bit) & (((UINT32)0xffffffff) >> (32 - (start_bit + length)))) +#define MAKE_EXTRACT_MASK(start_bit, length) ((0xffffffff << start_bit) & (((uint32_t)0xffffffff) >> (32 - (start_bit + length)))) void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx) { - INT8 shift = data & 0xff; + int8_t shift = data & 0xff; int bit = data & 0x3f; int len = (data >> 6) & 0x3f; @@ -487,11 +487,11 @@ void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx { if (shift < 0) { - REG(rn) = (shift > -32) ? ((INT32)REG(rx) >> -shift) : ((REG(rx) & 0x80000000) ? 0xffffffff : 0); + REG(rn) = (shift > -32) ? ((int32_t)REG(rx) >> -shift) : ((REG(rx) & 0x80000000) ? 0xffffffff : 0); } else { - REG(rn) = (shift < 32) ? ((INT32)REG(rx) << shift) : 0; + REG(rn) = (shift < 32) ? ((int32_t)REG(rx) << shift) : 0; if (shift > 0) { m_core->astat |= SV; @@ -506,14 +506,14 @@ void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx if (shift < 0) { int s = (-shift) & 0x1f; - REG(rn) = (((UINT32)REG(rx) >> s) & ((UINT32)(0xffffffff) >> s)) | - (((UINT32)REG(rx) << (32-s)) & ((UINT32)(0xffffffff) << (32-s))); + REG(rn) = (((uint32_t)REG(rx) >> s) & ((uint32_t)(0xffffffff) >> s)) | + (((uint32_t)REG(rx) << (32-s)) & ((uint32_t)(0xffffffff) << (32-s))); } else { int s = shift & 0x1f; - REG(rn) = (((UINT32)REG(rx) << s) & ((UINT32)(0xffffffff) << s)) | - (((UINT32)REG(rx) >> (32-s)) & ((UINT32)(0xffffffff) >> (32-s))); + REG(rn) = (((uint32_t)REG(rx) << s) & ((uint32_t)(0xffffffff) << s)) | + (((uint32_t)REG(rx) >> (32-s)) & ((uint32_t)(0xffffffff) >> (32-s))); } SET_FLAG_SZ(REG(rn)); break; @@ -521,7 +521,7 @@ void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx case 0x08: /* Rn = Rn OR LSHIFT Rx BY */ { - UINT32 r = 0; + uint32_t r = 0; if(shift < 0) { r = (shift > -32 ) ? (REG(rx) >> -shift) : 0; } else { @@ -539,7 +539,7 @@ void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx case 0x10: /* FEXT Rx BY : */ { - UINT32 ext = REG(rx) & MAKE_EXTRACT_MASK(bit, len); + uint32_t ext = REG(rx) & MAKE_EXTRACT_MASK(bit, len); REG(rn) = ext >> bit; SET_FLAG_SZ(REG(rn)); @@ -555,9 +555,9 @@ void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx case 0x12: /* FEXT Rx BY : (Sign Extended) */ { - UINT32 ext = (REG(rx) & MAKE_EXTRACT_MASK(bit, len)) >> bit; + uint32_t ext = (REG(rx) & MAKE_EXTRACT_MASK(bit, len)) >> bit; if (ext & (1 << (len-1))) { - ext |= (UINT32)0xffffffff << (len-1); + ext |= (uint32_t)0xffffffff << (len-1); } REG(rn) = ext; @@ -571,9 +571,9 @@ void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx case 0x13: /* FDEP Rx BY Ry : (Sign Extended) */ { - UINT32 ext = REG(rx) & MAKE_EXTRACT_MASK(0, len); + uint32_t ext = REG(rx) & MAKE_EXTRACT_MASK(0, len); if (ext & (1 << (len-1))) { - ext |= (UINT32)0xffffffff << (len-1); + ext |= (uint32_t)0xffffffff << (len-1); } REG(rn) = ext << bit; @@ -587,7 +587,7 @@ void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx case 0x19: /* Rn = Rn OR FDEP Rx BY : */ { - UINT32 ext = REG(rx) & MAKE_EXTRACT_MASK(0, len); + uint32_t ext = REG(rx) & MAKE_EXTRACT_MASK(0, len); REG(rn) |= ext << bit; @@ -648,7 +648,7 @@ void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx { if (data < 32) { - UINT32 r = REG(rx) & (1 << data); + uint32_t r = REG(rx) & (1 << data); SET_FLAG_SZ(r); } @@ -665,7 +665,7 @@ void adsp21062_device::SHIFT_OPERATION_IMM(int shiftop, int data, int rn, int rx #include "compute.hxx" -void adsp21062_device::COMPUTE(UINT32 opcode) +void adsp21062_device::COMPUTE(uint32_t opcode) { int multiop; int op = (opcode >> 12) & 0xff; @@ -887,14 +887,14 @@ void adsp21062_device::COMPUTE(UINT32 opcode) if (shift < 0) { int s = (-shift) & 0x1f; - REG(rn) = (((UINT32)REG(rx) >> s) & ((UINT32)(0xffffffff) >> s)) | - (((UINT32)REG(rx) << (32-s)) & ((UINT32)(0xffffffff) << (32-s))); + REG(rn) = (((uint32_t)REG(rx) >> s) & ((uint32_t)(0xffffffff) >> s)) | + (((uint32_t)REG(rx) << (32-s)) & ((uint32_t)(0xffffffff) << (32-s))); } else { int s = shift & 0x1f; - REG(rn) = (((UINT32)REG(rx) << s) & ((UINT32)(0xffffffff) << s)) | - (((UINT32)REG(rx) >> (32-s)) & ((UINT32)(0xffffffff) >> (32-s))); + REG(rn) = (((uint32_t)REG(rx) << s) & ((uint32_t)(0xffffffff) << s)) | + (((uint32_t)REG(rx) >> (32-s)) & ((uint32_t)(0xffffffff) >> (32-s))); if (shift > 0) { m_core->astat |= SV; @@ -906,7 +906,7 @@ void adsp21062_device::COMPUTE(UINT32 opcode) case 0x08: /* Rn = Rn OR LSHIFT Rx BY Ry*/ { - INT8 shift = REG(ry); + int8_t shift = REG(ry); if(shift < 0) { REG(rn) = REG(rn) | ((shift > -32 ) ? (REG(rx) >> -shift) : 0); } else { @@ -924,7 +924,7 @@ void adsp21062_device::COMPUTE(UINT32 opcode) { int bit = REG(ry) & 0x3f; int len = (REG(ry) >> 6) & 0x3f; - UINT32 ext = REG(rx) & MAKE_EXTRACT_MASK(bit, len); + uint32_t ext = REG(rx) & MAKE_EXTRACT_MASK(bit, len); REG(rn) = ext >> bit; SET_FLAG_SZ(REG(rn)); @@ -939,9 +939,9 @@ void adsp21062_device::COMPUTE(UINT32 opcode) { int bit = REG(ry) & 0x3f; int len = (REG(ry) >> 6) & 0x3f; - UINT32 ext = (REG(rx) & MAKE_EXTRACT_MASK(bit, len)) >> bit; + uint32_t ext = (REG(rx) & MAKE_EXTRACT_MASK(bit, len)) >> bit; if (ext & (1 << (len-1))) { - ext |= (UINT32)0xffffffff << (len-1); + ext |= (uint32_t)0xffffffff << (len-1); } REG(rn) = ext; @@ -957,7 +957,7 @@ void adsp21062_device::COMPUTE(UINT32 opcode) { int bit = REG(ry) & 0x3f; int len = (REG(ry) >> 6) & 0x3f; - UINT32 ext = REG(rx) & MAKE_EXTRACT_MASK(0, len); + uint32_t ext = REG(rx) & MAKE_EXTRACT_MASK(0, len); REG(rn) |= ext << bit; @@ -971,7 +971,7 @@ void adsp21062_device::COMPUTE(UINT32 opcode) case 0x30: /* BSET Rx BY Ry */ { - UINT32 shift = REG(ry); + uint32_t shift = REG(ry); REG(rn) = REG(rx); if (shift < 32) { @@ -987,7 +987,7 @@ void adsp21062_device::COMPUTE(UINT32 opcode) case 0x31: /* BCLR Rx BY Ry */ { - UINT32 shift = REG(ry); + uint32_t shift = REG(ry); REG(rn) = REG(rx); if (shift < 32) { @@ -1003,10 +1003,10 @@ void adsp21062_device::COMPUTE(UINT32 opcode) case 0x33: /* BTST Rx BY Ry */ { - UINT32 shift = REG(ry); + uint32_t shift = REG(ry); if (shift < 32) { - UINT32 r = REG(rx) & (1 << shift); + uint32_t r = REG(rx) & (1 << shift); SET_FLAG_SZ(r); } @@ -1029,7 +1029,7 @@ void adsp21062_device::COMPUTE(UINT32 opcode) } } -void adsp21062_device::PUSH_PC(UINT32 pc) +void adsp21062_device::PUSH_PC(uint32_t pc) { m_core->pcstkp++; if(m_core->pcstkp >= 32) @@ -1050,7 +1050,7 @@ void adsp21062_device::PUSH_PC(UINT32 pc) m_core->pcstack[m_core->pcstkp] = pc; } -UINT32 adsp21062_device::POP_PC() +uint32_t adsp21062_device::POP_PC() { m_core->pcstk = m_core->pcstack[m_core->pcstkp]; @@ -1073,12 +1073,12 @@ UINT32 adsp21062_device::POP_PC() return m_core->pcstk; } -UINT32 adsp21062_device::TOP_PC() +uint32_t adsp21062_device::TOP_PC() { return m_core->pcstack[m_core->pcstkp]; } -void adsp21062_device::PUSH_LOOP(UINT32 addr, UINT32 code, UINT32 type, UINT32 count) +void adsp21062_device::PUSH_LOOP(uint32_t addr, uint32_t code, uint32_t type, uint32_t count) { m_core->lstkp++; if(m_core->lstkp >= 6) @@ -1269,8 +1269,8 @@ void adsp21062_device::sharcop_compute_dreg_dm_dreg_pm() /* due to parallelity issues, source DREGs must be saved */ /* because the compute operation may change them */ - UINT32 parallel_pm_dreg = REG(pm_dreg); - UINT32 parallel_dm_dreg = REG(dm_dreg); + uint32_t parallel_pm_dreg = REG(pm_dreg); + uint32_t parallel_dm_dreg = REG(dm_dreg); if (compute) { @@ -1337,7 +1337,7 @@ void adsp21062_device::sharcop_compute_ureg_dmpm_premod() { /* due to parallelity issues, source UREG must be saved */ /* because the compute operation may change it */ - UINT32 parallel_ureg = GET_UREG(ureg); + uint32_t parallel_ureg = GET_UREG(ureg); if (compute) { @@ -1398,7 +1398,7 @@ void adsp21062_device::sharcop_compute_ureg_dmpm_postmod() { /* due to parallelity issues, source UREG must be saved */ /* because the compute operation may change it */ - UINT32 parallel_ureg = GET_UREG(ureg); + uint32_t parallel_ureg = GET_UREG(ureg); if (compute) { @@ -1497,7 +1497,7 @@ void adsp21062_device::sharcop_compute_dreg_to_dm_immmod() /* due to parallelity issues, source REG must be saved */ /* because the shift operation may change it */ - UINT32 parallel_dreg = REG(dreg); + uint32_t parallel_dreg = REG(dreg); if (IF_CONDITION_CODE(cond)) { @@ -1561,7 +1561,7 @@ void adsp21062_device::sharcop_compute_dreg_to_pm_immmod() /* due to parallelity issues, source REG must be saved */ /* because the compute operation may change it */ - UINT32 parallel_dreg = REG(dreg); + uint32_t parallel_dreg = REG(dreg); if (IF_CONDITION_CODE(cond)) { @@ -1598,7 +1598,7 @@ void adsp21062_device::sharcop_compute_ureg_to_ureg() { /* due to parallelity issues, source UREG must be saved */ /* because the compute operation may change it */ - UINT32 parallel_ureg = GET_UREG(src_ureg); + uint32_t parallel_ureg = GET_UREG(src_ureg); if (compute != 0) { @@ -1630,7 +1630,7 @@ void adsp21062_device::sharcop_imm_shift_dreg_dmpm() { /* due to parallelity issues, source REG must be saved */ /* because the shift operation may change it */ - UINT32 parallel_dreg = REG(dreg); + uint32_t parallel_dreg = REG(dreg); SHIFT_OPERATION_IMM(shiftop, data, rn, rx); @@ -1725,7 +1725,7 @@ void adsp21062_device::sharcop_direct_call() { int j = (m_core->opcode >> 26) & 0x1; int cond = (m_core->opcode >> 33) & 0x1f; - UINT32 address = m_core->opcode & 0xffffff; + uint32_t address = m_core->opcode & 0xffffff; if (IF_CONDITION_CODE(cond)) { @@ -1751,7 +1751,7 @@ void adsp21062_device::sharcop_direct_jump() int ci = (m_core->opcode >> 24) & 0x1; int j = (m_core->opcode >> 26) & 0x1; int cond = (m_core->opcode >> 33) & 0x1f; - UINT32 address = m_core->opcode & 0xffffff; + uint32_t address = m_core->opcode & 0xffffff; if(IF_CONDITION_CODE(cond)) { @@ -1793,7 +1793,7 @@ void adsp21062_device::sharcop_relative_call() { int j = (m_core->opcode >> 26) & 0x1; int cond = (m_core->opcode >> 33) & 0x1f; - UINT32 address = m_core->opcode & 0xffffff; + uint32_t address = m_core->opcode & 0xffffff; if (IF_CONDITION_CODE(cond)) { @@ -1817,7 +1817,7 @@ void adsp21062_device::sharcop_relative_jump() int ci = (m_core->opcode >> 24) & 0x1; int j = (m_core->opcode >> 26) & 0x1; int cond = (m_core->opcode >> 33) & 0x1f; - UINT32 address = m_core->opcode & 0xffffff; + uint32_t address = m_core->opcode & 0xffffff; if (IF_CONDITION_CODE(cond)) { @@ -2151,10 +2151,10 @@ void adsp21062_device::sharcop_indirect_jump_compute_dreg_dm() } else { - UINT32 compute = m_core->opcode & 0x7fffff; + uint32_t compute = m_core->opcode & 0x7fffff; /* due to parallelity issues, source REG must be saved */ /* because the compute operation may change it */ - UINT32 parallel_dreg = REG(dreg); + uint32_t parallel_dreg = REG(dreg); if (compute) { @@ -2194,10 +2194,10 @@ void adsp21062_device::sharcop_relative_jump_compute_dreg_dm() } else { - UINT32 compute = m_core->opcode & 0x7fffff; + uint32_t compute = m_core->opcode & 0x7fffff; /* due to parallelity issues, source REG must be saved */ /* because the compute operation may change it */ - UINT32 parallel_dreg = REG(dreg); + uint32_t parallel_dreg = REG(dreg); if (compute) { @@ -2345,9 +2345,9 @@ void adsp21062_device::sharcop_rti() /* do until counter expired, LCNTR immediate */ void adsp21062_device::sharcop_do_until_counter_imm() { - UINT16 data = (UINT16)(m_core->opcode >> 24); + uint16_t data = (uint16_t)(m_core->opcode >> 24); int offset = SIGN_EXTEND24(m_core->opcode & 0xffffff); - UINT32 address = m_core->pc + offset; + uint32_t address = m_core->pc + offset; int type; int cond = 0xf; /* until LCE (loop counter expired */ int distance = abs(offset); @@ -2381,7 +2381,7 @@ void adsp21062_device::sharcop_do_until_counter_ureg() { int ureg = (m_core->opcode >> 32) & 0xff; int offset = SIGN_EXTEND24(m_core->opcode & 0xffffff); - UINT32 address = m_core->pc + offset; + uint32_t address = m_core->pc + offset; int type; int cond = 0xf; /* until LCE (loop counter expired */ int distance = abs(offset); @@ -2415,7 +2415,7 @@ void adsp21062_device::sharcop_do_until() { int cond = (m_core->opcode >> 33) & 0x1f; int offset = SIGN_EXTEND24(m_core->opcode & 0xffffff); - UINT32 address = (m_core->pc + offset); + uint32_t address = (m_core->pc + offset); PUSH_PC(m_core->pc+1); PUSH_LOOP(address, cond, 0, 0); @@ -2428,7 +2428,7 @@ void adsp21062_device::sharcop_do_until() void adsp21062_device::sharcop_dm_to_ureg_direct() { int ureg = (m_core->opcode >> 32) & 0xff; - UINT32 address = (UINT32)(m_core->opcode); + uint32_t address = (uint32_t)(m_core->opcode); SET_UREG(ureg, dm_read32(address)); } @@ -2437,7 +2437,7 @@ void adsp21062_device::sharcop_dm_to_ureg_direct() void adsp21062_device::sharcop_ureg_to_dm_direct() { int ureg = (m_core->opcode >> 32) & 0xff; - UINT32 address = (UINT32)(m_core->opcode); + uint32_t address = (uint32_t)(m_core->opcode); dm_write32(address, GET_UREG(ureg)); } @@ -2446,7 +2446,7 @@ void adsp21062_device::sharcop_ureg_to_dm_direct() void adsp21062_device::sharcop_pm_to_ureg_direct() { int ureg = (m_core->opcode >> 32) & 0xff; - UINT32 address = (UINT32)(m_core->opcode); + uint32_t address = (uint32_t)(m_core->opcode); if (ureg == 0xdb) // PX is 48-bit { @@ -2462,7 +2462,7 @@ void adsp21062_device::sharcop_pm_to_ureg_direct() void adsp21062_device::sharcop_ureg_to_pm_direct() { int ureg = (m_core->opcode >> 32) & 0xff; - UINT32 address = (UINT32)(m_core->opcode); + uint32_t address = (uint32_t)(m_core->opcode); if (ureg == 0xdb) // PX is 48-bit { @@ -2481,7 +2481,7 @@ void adsp21062_device::sharcop_ureg_to_pm_direct() void adsp21062_device::sharcop_dm_to_ureg_indirect() { int ureg = (m_core->opcode >> 32) & 0xff; - UINT32 offset = (UINT32)m_core->opcode; + uint32_t offset = (uint32_t)m_core->opcode; int i = (m_core->opcode >> 41) & 0x7; SET_UREG(ureg, dm_read32(DM_REG_I(i) + offset)); @@ -2491,7 +2491,7 @@ void adsp21062_device::sharcop_dm_to_ureg_indirect() void adsp21062_device::sharcop_ureg_to_dm_indirect() { int ureg = (m_core->opcode >> 32) & 0xff; - UINT32 offset = (UINT32)m_core->opcode; + uint32_t offset = (uint32_t)m_core->opcode; int i = (m_core->opcode >> 41) & 0x7; dm_write32(DM_REG_I(i) + offset, GET_UREG(ureg)); @@ -2501,7 +2501,7 @@ void adsp21062_device::sharcop_ureg_to_dm_indirect() void adsp21062_device::sharcop_pm_to_ureg_indirect() { int ureg = (m_core->opcode >> 32) & 0xff; - UINT32 offset = m_core->opcode & 0xffffff; + uint32_t offset = m_core->opcode & 0xffffff; int i = (m_core->opcode >> 41) & 0x7; if (ureg == 0xdb) /* PX is 48-bit */ @@ -2518,7 +2518,7 @@ void adsp21062_device::sharcop_pm_to_ureg_indirect() void adsp21062_device::sharcop_ureg_to_pm_indirect() { int ureg = (m_core->opcode >> 32) & 0xff; - UINT32 offset = (UINT32)m_core->opcode; + uint32_t offset = (uint32_t)m_core->opcode; int i = (m_core->opcode >> 41) & 0x7; if (ureg == 0xdb) /* PX is 48-bit */ @@ -2540,7 +2540,7 @@ void adsp21062_device::sharcop_imm_to_dmpm() int i = (m_core->opcode >> 41) & 0x7; int m = (m_core->opcode >> 38) & 0x7; int g = (m_core->opcode >> 37) & 0x1; - UINT32 data = (UINT32)m_core->opcode; + uint32_t data = (uint32_t)m_core->opcode; if (g) { @@ -2565,7 +2565,7 @@ void adsp21062_device::sharcop_imm_to_dmpm() void adsp21062_device::sharcop_imm_to_ureg() { int ureg = (m_core->opcode >> 32) & 0xff; - UINT32 data = (UINT32)m_core->opcode; + uint32_t data = (uint32_t)m_core->opcode; SET_UREG(ureg, data); } @@ -2578,9 +2578,9 @@ void adsp21062_device::sharcop_sysreg_bitop() { int bop = (m_core->opcode >> 37) & 0x7; int sreg = (m_core->opcode >> 32) & 0xf; - UINT32 data = (UINT32)m_core->opcode; + uint32_t data = (uint32_t)m_core->opcode; - UINT32 src = GET_UREG(0x70 | sreg); + uint32_t src = GET_UREG(0x70 | sreg); switch(bop) { @@ -2639,7 +2639,7 @@ void adsp21062_device::sharcop_modify() { int g = (m_core->opcode >> 38) & 0x1; int i = (m_core->opcode >> 32) & 0x7; - INT32 data = (m_core->opcode); + int32_t data = (m_core->opcode); if (g) // PM { @@ -2725,5 +2725,5 @@ void adsp21062_device::sharcop_unimplemented() char dasm[1000]; CPU_DISASSEMBLE_NAME(sharc)(nullptr, dasm, m_core->pc, nullptr, nullptr, 0); osd_printf_debug("SHARC: %08X: %s\n", m_core->pc, dasm); - fatalerror("SHARC: Unimplemented opcode %04X%08X at %08X\n", (UINT16)(m_core->opcode >> 32), (UINT32)(m_core->opcode), m_core->pc); + fatalerror("SHARC: Unimplemented opcode %04X%08X at %08X\n", (uint16_t)(m_core->opcode >> 32), (uint32_t)(m_core->opcode), m_core->pc); } diff --git a/src/devices/cpu/sm510/kb1013vk1-2.h b/src/devices/cpu/sm510/kb1013vk1-2.h index 7e8c739354d..825b41f8cc3 100644 --- a/src/devices/cpu/sm510/kb1013vk1-2.h +++ b/src/devices/cpu/sm510/kb1013vk1-2.h @@ -23,10 +23,10 @@ class kb1013vk12_device : public sm500_device { public: - kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void execute_one() override; // opcode handlers diff --git a/src/devices/cpu/sm510/kb1013vk1-2core.cpp b/src/devices/cpu/sm510/kb1013vk1-2core.cpp index 1aa40b87cdb..25cb6a8288c 100644 --- a/src/devices/cpu/sm510/kb1013vk1-2core.cpp +++ b/src/devices/cpu/sm510/kb1013vk1-2core.cpp @@ -28,13 +28,13 @@ static ADDRESS_MAP_START(data_5x13x4, AS_DATA, 8, sm510_base_device) ADDRESS_MAP_END // device definitions -kb1013vk12_device::kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kb1013vk12_device::kb1013vk12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sm500_device(mconfig, KB1013VK12, "KB1013VK1-2", tag, owner, clock, 1 /* stack levels */, 11 /* prg width */, ADDRESS_MAP_NAME(program_1_8k), 7 /* data width */, ADDRESS_MAP_NAME(data_5x13x4), "kb1013vk1-2", __FILE__) { } // disasm -offs_t kb1013vk12_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t kb1013vk12_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(kb1013vk12); return CPU_DISASSEMBLE_NAME(kb1013vk12)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/sm510/sm500.h b/src/devices/cpu/sm510/sm500.h index 0743632609d..57924114414 100644 --- a/src/devices/cpu/sm510/sm500.h +++ b/src/devices/cpu/sm510/sm500.h @@ -46,11 +46,11 @@ O36 48 | * | 13 K2 class sm500_device : public sm510_base_device { public: - sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - sm500_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + sm500_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void execute_one() override; virtual void get_opcode_param() override; diff --git a/src/devices/cpu/sm510/sm500core.cpp b/src/devices/cpu/sm510/sm500core.cpp index a5117e7a856..deb32f652f7 100644 --- a/src/devices/cpu/sm510/sm500core.cpp +++ b/src/devices/cpu/sm510/sm500core.cpp @@ -28,17 +28,17 @@ ADDRESS_MAP_END // device definitions -sm500_device::sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sm500_device::sm500_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sm510_base_device(mconfig, SM500, "SM500", tag, owner, clock, 1 /* stack levels */, 11 /* prg width */, ADDRESS_MAP_NAME(program_1_2k), 6 /* data width */, ADDRESS_MAP_NAME(data_4x10x4), "sm500", __FILE__) { } -sm500_device::sm500_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) +sm500_device::sm500_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : sm510_base_device(mconfig, type, name, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data, shortname, source) { } // disasm -offs_t sm500_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t sm500_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(sm500); return CPU_DISASSEMBLE_NAME(sm500)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/sm510/sm510.cpp b/src/devices/cpu/sm510/sm510.cpp index 7242ef93b55..decfcce4e56 100644 --- a/src/devices/cpu/sm510/sm510.cpp +++ b/src/devices/cpu/sm510/sm510.cpp @@ -148,13 +148,13 @@ void sm510_base_device::device_reset() // lcd driver //------------------------------------------------- -inline UINT16 sm510_base_device::get_lcd_row(int column, UINT8* ram) +inline uint16_t sm510_base_device::get_lcd_row(int column, uint8_t* ram) { // output 0 if lcd blackpate/bleeder is off, or in case row doesn't exist if (ram == nullptr || m_bc || !m_bp) return 0; - UINT16 rowdata = 0; + uint16_t rowdata = 0; for (int i = 0; i < 0x10; i++) rowdata |= (ram[i] >> column & 1) << i; @@ -172,7 +172,7 @@ TIMER_CALLBACK_MEMBER(sm510_base_device::lcd_timer_cb) m_write_segc(h | SM510_PORT_SEGC, get_lcd_row(h, m_lcd_ram_c), 0xffff); // bs output from L/X and Y regs - UINT8 bs = (m_l >> h & 1) | ((m_x*2) >> h & 2); + uint8_t bs = (m_l >> h & 1) | ((m_x*2) >> h & 2); m_write_segbs(h | SM510_PORT_SEGBS, (m_bc || !m_bp) ? 0 : bs, 0xffff); } @@ -200,7 +200,7 @@ void sm510_base_device::clock_melody() // tone cycle table (SM511/SM512 datasheet fig.5) // cmd 0 = cmd, 1 = stop, > 13 = illegal(unknown) - static const UINT8 lut_tone_cycles[4*16] = + static const uint8_t lut_tone_cycles[4*16] = { 0, 0, 7, 8, 8, 9, 9, 10,11,11,12,13,14,14, 7*2, 8*2, 0, 0, 8, 8, 9, 9, 10,11,11,12,13,13,14,15, 8*2, 8*2, @@ -208,8 +208,8 @@ void sm510_base_device::clock_melody() 0, 0, 8, 9, 9, 10,10,11,11,12,13,14,14,15, 8*2, 9*2 }; - UINT8 cmd = m_melody_rom[m_melody_address] & 0x3f; - UINT8 out = 0; + uint8_t cmd = m_melody_rom[m_melody_address] & 0x3f; + uint8_t out = 0; // clock duty cycle if tone is active if ((cmd & 0xf) > 1) @@ -234,7 +234,7 @@ void sm510_base_device::clock_melody() // clock time base on F8(d7) if ((m_div & 0x7f) == 0) { - UINT8 mask = (cmd & 0x20) ? 0x1f : 0x0f; + uint8_t mask = (cmd & 0x20) ? 0x1f : 0x0f; m_melody_step_count = (m_melody_step_count + 1) & mask; if (m_melody_step_count == 0) @@ -257,7 +257,7 @@ void sm510_base_device::init_melody() // verify melody rom for (int i = 0; i < 0x100; i++) { - UINT8 data = m_melody_rom[i]; + uint8_t data = m_melody_rom[i]; if (data & 0xc0 || (data & 0x0f) > 13) logerror("%s unknown melody ROM data $%02X at $%02X\n", tag(), data, i); } diff --git a/src/devices/cpu/sm510/sm510.h b/src/devices/cpu/sm510/sm510.h index 54b71077159..0421288f5cb 100644 --- a/src/devices/cpu/sm510/sm510.h +++ b/src/devices/cpu/sm510/sm510.h @@ -92,7 +92,7 @@ class sm510_base_device : public cpu_device { public: // construction/destruction - sm510_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + sm510_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, prgwidth, 0, program) , m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data) @@ -126,11 +126,11 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 2 - 1) / 2; } // default 2 cycles per machine cycle - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 2); } // " - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 2 - 1) / 2; } // default 2 cycles per machine cycle + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } // " + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; virtual void execute_one() { } // -> child class @@ -139,8 +139,8 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 0x40; } // actually 2, but debugger doesn't like non-linear pc + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 0x40; } // actually 2, but debugger doesn't like non-linear pc address_space_config m_program_config; address_space_config m_data_config; @@ -152,51 +152,51 @@ protected: int m_prgmask; int m_datamask; - UINT16 m_pc, m_prev_pc; - UINT16 m_op, m_prev_op; - UINT8 m_param; + uint16_t m_pc, m_prev_pc; + uint16_t m_op, m_prev_op; + uint8_t m_param; int m_stack_levels; - UINT16 m_stack[2]; + uint16_t m_stack[2]; int m_icount; - UINT8 m_acc; - UINT8 m_bl; - UINT8 m_bm; + uint8_t m_acc; + uint8_t m_bl; + uint8_t m_bm; bool m_sbm; - UINT8 m_c; + uint8_t m_c; bool m_skip; - UINT8 m_w; - UINT8 m_r; + uint8_t m_w; + uint8_t m_r; bool m_k_active; bool m_halt; // lcd driver - optional_shared_ptr m_lcd_ram_a, m_lcd_ram_b, m_lcd_ram_c; + optional_shared_ptr m_lcd_ram_a, m_lcd_ram_b, m_lcd_ram_c; devcb_write16 m_write_sega, m_write_segb, m_write_segc, m_write_segbs; emu_timer *m_lcd_timer; - UINT8 m_l, m_x; - UINT8 m_y; + uint8_t m_l, m_x; + uint8_t m_y; bool m_bp; bool m_bc; - UINT16 get_lcd_row(int column, UINT8* ram); + uint16_t get_lcd_row(int column, uint8_t* ram); TIMER_CALLBACK_MEMBER(lcd_timer_cb); virtual void init_lcd_driver(); // melody controller - optional_region_ptr m_melody_rom; - UINT8 m_melody_rd; - UINT8 m_melody_step_count; - UINT8 m_melody_duty_count; - UINT8 m_melody_duty_index; - UINT8 m_melody_address; + optional_region_ptr m_melody_rom; + uint8_t m_melody_rd; + uint8_t m_melody_step_count; + uint8_t m_melody_duty_count; + uint8_t m_melody_duty_index; + uint8_t m_melody_address; void clock_melody(); void init_melody(); // interrupt/divider emu_timer *m_div_timer; - UINT16 m_div; + uint16_t m_div; bool m_1s; bool wake_me_up(); @@ -215,12 +215,12 @@ protected: virtual void get_opcode_param() { } virtual void update_w_latch() { } - UINT8 ram_r(); - void ram_w(UINT8 data); + uint8_t ram_r(); + void ram_w(uint8_t data); void pop_stack(); void push_stack(); - void do_branch(UINT8 pu, UINT8 pm, UINT8 pl); - UINT8 bitmask(UINT16 param); + void do_branch(uint8_t pu, uint8_t pm, uint8_t pl); + uint8_t bitmask(uint16_t param); // opcode handlers virtual void op_lb(); @@ -295,10 +295,10 @@ protected: class sm510_device : public sm510_base_device { public: - sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void execute_one() override; virtual void get_opcode_param() override; @@ -309,11 +309,11 @@ protected: class sm511_device : public sm510_base_device { public: - sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void execute_one() override; virtual void get_opcode_param() override; }; @@ -321,7 +321,7 @@ protected: class sm512_device : public sm511_device { public: - sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/sm510/sm510core.cpp b/src/devices/cpu/sm510/sm510core.cpp index a871276c3a1..e2fdb158544 100644 --- a/src/devices/cpu/sm510/sm510core.cpp +++ b/src/devices/cpu/sm510/sm510core.cpp @@ -30,13 +30,13 @@ ADDRESS_MAP_END // device definitions -sm510_device::sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sm510_device::sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sm510_base_device(mconfig, SM510, "SM510", tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, ADDRESS_MAP_NAME(program_2_7k), 7 /* data width */, ADDRESS_MAP_NAME(data_96_32x4), "sm510", __FILE__) { } // disasm -offs_t sm510_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t sm510_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(sm510); return CPU_DISASSEMBLE_NAME(sm510)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/sm510/sm510d.cpp b/src/devices/cpu/sm510/sm510d.cpp index ba765a716e2..ae48fa3a3e5 100644 --- a/src/devices/cpu/sm510/sm510d.cpp +++ b/src/devices/cpu/sm510/sm510d.cpp @@ -69,7 +69,7 @@ static const char *const s_mnemonics[] = }; // number of bits per opcode parameter, 8 or larger means 2-byte opcode -static const UINT8 s_bits[] = +static const uint8_t s_bits[] = { 0, 8, 4, 8, 0, 0, 0, 0, @@ -99,7 +99,7 @@ static const UINT8 s_bits[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 s_flags[] = +static const uint32_t s_flags[] = { 0, 0, 0, 0, 0, 0, 0, 0, @@ -127,7 +127,7 @@ static const UINT32 s_flags[] = }; // next program counter in sequence (relative) -static const INT8 s_next_pc[0x40] = +static const int8_t s_next_pc[0x40] = { 32, -1 /* rollback */, -1, 30, 30, -3, -3, 28, 28, -5, -5, 26, 26, -7, -7, 24, 24, -9, -9, 22, 22, -11, -11, 20, 20, -13, -13, 18, 18, -15, -15, 16, @@ -139,16 +139,16 @@ static const INT8 s_next_pc[0x40] = // common disasm -static offs_t sm510_common_disasm(const UINT8 *lut_mnemonic, const UINT8 *lut_extended, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) +static offs_t sm510_common_disasm(const uint8_t *lut_mnemonic, const uint8_t *lut_extended, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram) { // get raw opcode - UINT8 op = oprom[0]; - UINT8 instr = lut_mnemonic[op]; + uint8_t op = oprom[0]; + uint8_t instr = lut_mnemonic[op]; int len = 1; int bits = s_bits[instr]; - UINT8 mask = op & ((1 << (bits & 7)) - 1); - UINT16 param = mask; + uint8_t mask = op & ((1 << (bits & 7)) - 1); + uint16_t param = mask; if (bits >= 8) { // note: disasm view shows correct parameter, but raw view does not @@ -181,7 +181,7 @@ static offs_t sm510_common_disasm(const UINT8 *lut_mnemonic, const UINT8 *lut_ex } else { - UINT16 address = (param << 4 & 0xc00) | (mask << 6 & 0x3c0) | (param & 0x03f); + uint16_t address = (param << 4 & 0xc00) | (mask << 6 & 0x3c0) | (param & 0x03f); dst += sprintf(dst, "$%03X", address); } @@ -196,7 +196,7 @@ static offs_t sm510_common_disasm(const UINT8 *lut_mnemonic, const UINT8 *lut_ex // SM510 disasm -static const UINT8 sm510_mnemonic[0x100] = +static const uint8_t sm510_mnemonic[0x100] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ mSKIP, mATBP, mSBM, mATPL, mRM, mRM, mRM, mRM, mADD, mADD11,mCOMA, mEXBLA,mSM, mSM, mSM, mSM, // 0 @@ -228,7 +228,7 @@ CPU_DISASSEMBLE(sm510) // SM511 disasm -static const UINT8 sm511_mnemonic[0x100] = +static const uint8_t sm511_mnemonic[0x100] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ mROT, mDTA, mSBM, mATPL, mRM, mRM, mRM, mRM, mADD, mADD11,mCOMA, mEXBLA,mSM, mSM, mSM, mSM, // 0 @@ -252,7 +252,7 @@ static const UINT8 sm511_mnemonic[0x100] = mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM // F }; -static const UINT8 sm511_extended[0x10] = +static const uint8_t sm511_extended[0x10] = { mRME, mSME, mTMEL, mATFC, mBDC, mATBP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 60 3 }; @@ -260,7 +260,7 @@ static const UINT8 sm511_extended[0x10] = CPU_DISASSEMBLE(sm511) { // create extended opcode table - UINT8 ext[0x100]; + uint8_t ext[0x100]; memset(ext, 0, 0x100); memcpy(ext + 0x30, sm511_extended, 0x10); @@ -270,7 +270,7 @@ CPU_DISASSEMBLE(sm511) // SM500 disasm -static const UINT8 sm500_mnemonic[0x100] = +static const uint8_t sm500_mnemonic[0x100] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ mSKIP, mATR, mEXKSA,mATBP, mRM, mRM, mRM, mRM, mADD, mADDC, mCOMA, mEXBLA,mSM, mSM, mSM, mSM, // 0 @@ -294,7 +294,7 @@ static const UINT8 sm500_mnemonic[0x100] = mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS, mTRS // F }; -static const UINT8 sm500_extended[0x10] = +static const uint8_t sm500_extended[0x10] = { mCEND, 0, 0, 0, mDTA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 5E 0 }; @@ -302,7 +302,7 @@ static const UINT8 sm500_extended[0x10] = CPU_DISASSEMBLE(sm500) { // create extended opcode table - UINT8 ext[0x100]; + uint8_t ext[0x100]; memset(ext, 0, 0x100); memcpy(ext + 0x00, sm500_extended, 0x10); @@ -312,7 +312,7 @@ CPU_DISASSEMBLE(sm500) // KB1013VK1-2 disasm -static const UINT8 kb1013vk12_mnemonic[0x100] = +static const uint8_t kb1013vk12_mnemonic[0x100] = { /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ mNOP, mOAR, mBS1, mEN, mBM0, mBM0, mBM0, mBM0, mAM, mAC, mCOM, mXL, mBM1, mBM1, mBM1, mBM1, // 0 @@ -336,7 +336,7 @@ static const UINT8 kb1013vk12_mnemonic[0x100] = mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR, mCBR // F }; -static const UINT8 kb1013vk12_extended[0x10] = +static const uint8_t kb1013vk12_extended[0x10] = { mHLT, 0, 0, 0, mLDF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // 5E 0 }; @@ -344,7 +344,7 @@ static const UINT8 kb1013vk12_extended[0x10] = CPU_DISASSEMBLE(kb1013vk12) { // create extended opcode table - UINT8 ext[0x100]; + uint8_t ext[0x100]; memset(ext, 0, 0x100); memcpy(ext + 0x00, kb1013vk12_extended, 0x10); diff --git a/src/devices/cpu/sm510/sm510op.cpp b/src/devices/cpu/sm510/sm510op.cpp index 682aacf7e1b..a18e39bac67 100644 --- a/src/devices/cpu/sm510/sm510op.cpp +++ b/src/devices/cpu/sm510/sm510op.cpp @@ -8,17 +8,17 @@ // internal helpers -inline UINT8 sm510_base_device::ram_r() +inline uint8_t sm510_base_device::ram_r() { int bmh = (m_sbm) ? (1 << (m_datawidth-1)) : 0; // from SBM - UINT8 address = (bmh | m_bm << 4 | m_bl) & m_datamask; + uint8_t address = (bmh | m_bm << 4 | m_bl) & m_datamask; return m_data->read_byte(address) & 0xf; } -inline void sm510_base_device::ram_w(UINT8 data) +inline void sm510_base_device::ram_w(uint8_t data) { int bmh = (m_sbm) ? (1 << (m_datawidth-1)) : 0; // from SBM - UINT8 address = (bmh | m_bm << 4 | m_bl) & m_datamask; + uint8_t address = (bmh | m_bm << 4 | m_bl) & m_datamask; m_data->write_byte(address, data & 0xf); } @@ -36,13 +36,13 @@ void sm510_base_device::push_stack() m_stack[0] = m_pc; } -void sm510_base_device::do_branch(UINT8 pu, UINT8 pm, UINT8 pl) +void sm510_base_device::do_branch(uint8_t pu, uint8_t pm, uint8_t pl) { // set new PC(Pu/Pm/Pl) m_pc = ((pu << 10 & 0xc00) | (pm << 6 & 0x3c0) | (pl & 0x03f)) & m_prgmask; } -inline UINT8 sm510_base_device::bitmask(UINT16 param) +inline uint8_t sm510_base_device::bitmask(uint16_t param) { // bitmask from immediate opcode param return 1 << (param & 3); @@ -64,7 +64,7 @@ void sm510_base_device::op_lb() m_bl = (m_op >> 2 & 3); // bl(high) is still unclear, official doc is confusing - UINT8 hi = 0; + uint8_t hi = 0; switch (m_bl) { case 0: hi = 0; break; @@ -90,7 +90,7 @@ void sm510_base_device::op_sbm() void sm510_base_device::op_exbla() { // EXBLA: exchange BL with ACC - UINT8 a = m_acc; + uint8_t a = m_acc; m_acc = m_bl; m_bl = a; } @@ -155,7 +155,7 @@ void sm510_base_device::op_tm() // TM x: indirect subroutine call, pointers(IDX) are in page 0 m_icount--; push_stack(); - UINT8 idx = m_program->read_byte(m_op & 0x3f); + uint8_t idx = m_program->read_byte(m_op & 0x3f); do_branch(idx >> 6 & 3, 4, idx & 0x3f); } @@ -166,7 +166,7 @@ void sm510_base_device::op_tm() void sm510_base_device::op_exc() { // EXC x: exchange ACC with RAM, xor BM with x - UINT8 a = m_acc; + uint8_t a = m_acc; m_acc = ram_r(); ram_w(a); m_bm ^= (m_op & 3); @@ -304,7 +304,7 @@ void sm510_base_device::op_coma() void sm510_base_device::op_rot() { // ROT: rotate ACC right through carry - UINT8 c = m_acc & 1; + uint8_t c = m_acc & 1; m_acc = m_acc >> 1 | m_c << 3; m_c = c; } diff --git a/src/devices/cpu/sm510/sm511core.cpp b/src/devices/cpu/sm510/sm511core.cpp index c4c59d2d06a..b43cacf9dca 100644 --- a/src/devices/cpu/sm510/sm511core.cpp +++ b/src/devices/cpu/sm510/sm511core.cpp @@ -35,7 +35,7 @@ ADDRESS_MAP_END // disasm -offs_t sm511_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t sm511_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(sm511); return CPU_DISASSEMBLE_NAME(sm511)(this, buffer, pc, oprom, opram, options); @@ -43,15 +43,15 @@ offs_t sm511_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op // device definitions -sm511_device::sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sm511_device::sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sm510_base_device(mconfig, SM511, "SM511", tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, ADDRESS_MAP_NAME(program_4k), 7 /* data width */, ADDRESS_MAP_NAME(data_96_32x4), "sm511", __FILE__) { } -sm511_device::sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) +sm511_device::sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : sm510_base_device(mconfig, type, name, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data, shortname, source) { } -sm512_device::sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sm512_device::sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sm511_device(mconfig, SM512, "SM512", tag, owner, clock, 2, 12, ADDRESS_MAP_NAME(program_4k), 7, ADDRESS_MAP_NAME(data_80_48x4), "sm512", __FILE__) { } diff --git a/src/devices/cpu/sm8500/sm8500.cpp b/src/devices/cpu/sm8500/sm8500.cpp index 071c7ee56cf..c03ed425dbe 100644 --- a/src/devices/cpu/sm8500/sm8500.cpp +++ b/src/devices/cpu/sm8500/sm8500.cpp @@ -27,12 +27,12 @@ they are internally. const device_type SM8500 = &device_creator; -static const UINT8 sm8500_b2w[8] = { +static const uint8_t sm8500_b2w[8] = { 0, 8, 2, 10, 4, 12, 6, 14 }; -sm8500_cpu_device::sm8500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sm8500_cpu_device::sm8500_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SM8500, "SM8500", tag, owner, clock, "sm8500", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0) , m_dma_func(*this) @@ -53,7 +53,7 @@ void sm8500_cpu_device::get_sp() } -UINT8 sm8500_cpu_device::mem_readbyte( UINT32 offset ) const +uint8_t sm8500_cpu_device::mem_readbyte( uint32_t offset ) const { offset &= 0xffff; if ( offset < 0x10) @@ -65,9 +65,9 @@ UINT8 sm8500_cpu_device::mem_readbyte( UINT32 offset ) const } -void sm8500_cpu_device::mem_writebyte( UINT32 offset, UINT8 data ) +void sm8500_cpu_device::mem_writebyte( uint32_t offset, uint8_t data ) { - UINT8 i; + uint8_t i; offset &= 0xffff; if (offset < 0x10) { @@ -227,7 +227,7 @@ void sm8500_cpu_device::device_reset() mem_writebyte( m_SP, X ); -void sm8500_cpu_device::take_interrupt(UINT16 vector) +void sm8500_cpu_device::take_interrupt(uint16_t vector) { /* Get regs from ram */ get_sp(); @@ -341,7 +341,7 @@ void sm8500_cpu_device::process_interrupts() } -offs_t sm8500_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t sm8500_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( sm8500 ); return CPU_DISASSEMBLE_NAME(sm8500)(this, buffer, pc, oprom, opram, options); @@ -353,16 +353,16 @@ void sm8500_cpu_device::execute_run() do { int mycycles = 0; - UINT8 r1,r2; - UINT16 s1,s2; - UINT32 d1,d2; - UINT32 res; + uint8_t r1,r2; + uint16_t s1,s2; + uint32_t d1,d2; + uint32_t res; debugger_instruction_hook(this, m_PC); m_oldpc = m_PC; process_interrupts(); if ( !m_halted ) { - UINT8 op = mem_readbyte( m_PC++ ); + uint8_t op = mem_readbyte( m_PC++ ); m_SYS = m_program->read_byte(0x19); m_PS0 = m_program->read_byte(0x1e); m_PS1 = m_program->read_byte(0x1f); diff --git a/src/devices/cpu/sm8500/sm8500.h b/src/devices/cpu/sm8500/sm8500.h index ab9f3c9ea65..5356b776c8c 100644 --- a/src/devices/cpu/sm8500/sm8500.h +++ b/src/devices/cpu/sm8500/sm8500.h @@ -26,7 +26,7 @@ class sm8500_cpu_device : public cpu_device { public: // construction/destruction - sm8500_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + sm8500_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); // static configuration helpers template static devcb_base &set_dma_cb(device_t &device, _Object object) { return downcast(device).m_dma_func.set_callback(object); } @@ -47,23 +47,23 @@ public: protected: // Flags - static const UINT8 FLAG_C = 0x80; - static const UINT8 FLAG_Z = 0x40; - static const UINT8 FLAG_S = 0x20; - static const UINT8 FLAG_V = 0x10; - static const UINT8 FLAG_D = 0x08; - static const UINT8 FLAG_H = 0x04; - static const UINT8 FLAG_B = 0x02; - static const UINT8 FLAG_I = 0x01; + static const uint8_t FLAG_C = 0x80; + static const uint8_t FLAG_Z = 0x40; + static const uint8_t FLAG_S = 0x20; + static const uint8_t FLAG_V = 0x10; + static const uint8_t FLAG_D = 0x08; + static const uint8_t FLAG_H = 0x04; + static const uint8_t FLAG_B = 0x02; + static const uint8_t FLAG_I = 0x01; // device-level overrides virtual void device_start() override; virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 16; } - virtual UINT32 execute_input_lines() const override { return 11; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 16; } + virtual uint32_t execute_input_lines() const override { return 11; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -74,16 +74,16 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 5; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 5; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; inline void get_sp(); - UINT8 mem_readbyte(UINT32 offset) const; - void mem_writebyte(UINT32 offset, UINT8 data); - inline UINT16 mem_readword(UINT32 address) const { return (mem_readbyte(address ) << 8) | (mem_readbyte(address+1)); } - inline void mem_writeword(UINT32 address, UINT16 value) { mem_writebyte(address, value >> 8); mem_writebyte(address+1, value); } - inline void take_interrupt(UINT16 vector); + uint8_t mem_readbyte(uint32_t offset) const; + void mem_writebyte(uint32_t offset, uint8_t data); + inline uint16_t mem_readword(uint32_t address) const { return (mem_readbyte(address ) << 8) | (mem_readbyte(address+1)); } + inline void mem_writeword(uint32_t address, uint16_t value) { mem_writebyte(address, value >> 8); mem_writebyte(address+1, value); } + inline void take_interrupt(uint16_t vector); void process_interrupts(); address_space_config m_program_config; @@ -91,24 +91,24 @@ protected: devcb_write8 m_dma_func; devcb_write8 m_timer_func; - UINT16 m_PC; - UINT8 m_IE0; - UINT8 m_IE1; - UINT8 m_IR0; - UINT8 m_IR1; - UINT8 m_SYS; - UINT8 m_CKC; - UINT8 m_clock_changed; - UINT16 m_SP; - UINT8 m_PS0; - UINT8 m_PS1; - UINT16 m_IFLAGS; - UINT8 m_CheckInterrupts; + uint16_t m_PC; + uint8_t m_IE0; + uint8_t m_IE1; + uint8_t m_IR0; + uint8_t m_IR1; + uint8_t m_SYS; + uint8_t m_CKC; + uint8_t m_clock_changed; + uint16_t m_SP; + uint8_t m_PS0; + uint8_t m_PS1; + uint16_t m_IFLAGS; + uint8_t m_CheckInterrupts; int m_halted; int m_icount; address_space *m_program; - UINT16 m_oldpc; - UINT8 m_register_ram[0x108]; + uint16_t m_oldpc; + uint8_t m_register_ram[0x108]; }; diff --git a/src/devices/cpu/sm8500/sm8500d.cpp b/src/devices/cpu/sm8500/sm8500d.cpp index f5fc1341365..4e8bfbd2956 100644 --- a/src/devices/cpu/sm8500/sm8500d.cpp +++ b/src/devices/cpu/sm8500/sm8500d.cpp @@ -54,7 +54,7 @@ static const char *const s_mnemonic[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 s_flags[] = { +static const uint32_t s_flags[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _OVER, _OVER, 0, 0, 0, 0, 0, 0, 0, _OVER, 0, @@ -69,8 +69,8 @@ static const UINT32 s_flags[] = { struct sm8500dasm { - UINT8 mnemonic; - UINT8 arguments; + uint8_t mnemonic; + uint8_t arguments; }; static const char *const sm8500_cond[16] = { @@ -78,7 +78,7 @@ static const char *const sm8500_cond[16] = { "T", "GE", "GT", "UGT", "NOV", "PL", "NZ", "NC" }; -static const UINT8 sm8500_b2w[8] = { +static const uint8_t sm8500_b2w[8] = { 0, 8, 2, 10, 4, 12, 6, 14 }; @@ -177,10 +177,10 @@ CPU_DISASSEMBLE( sm8500 ) { const sm8500dasm *instr; char *dst; - UINT8 op; - INT8 offset; - UINT16 ea; - UINT16 ea2; + uint8_t op; + int8_t offset; + uint16_t ea; + uint16_t ea2; int pos = 0; dst = buffer; @@ -347,11 +347,11 @@ CPU_DISASSEMBLE( sm8500 ) dst += sprintf( dst, ",rr%02Xh", sm8500_b2w[( ea >> 3 ) & 0x07] ); break; case AM_cbr: - offset = (INT8) oprom[pos++]; + offset = (int8_t) oprom[pos++]; dst += sprintf( dst, "%s,$%04X", sm8500_cond[ op & 0x0F ], pc + pos + offset ); break; case AM_rbr: - offset = (INT8) oprom[pos++]; + offset = (int8_t) oprom[pos++]; dst += sprintf( dst, "r%02Xh,$%04X", op & 0x07, pc + pos + offset ); break; case AM_cjp: @@ -466,7 +466,7 @@ CPU_DISASSEMBLE( sm8500 ) break; case AM_Rbr: ea = oprom[pos++]; - offset = (INT8) oprom[pos++]; + offset = (int8_t) oprom[pos++]; dst += sprintf( dst, "R%02Xh,#%d,$%04X", ea, op & 0x07, pc + pos + offset ); break; case AM_Rb: @@ -525,7 +525,7 @@ CPU_DISASSEMBLE( sm8500 ) dst += sprintf( dst, "$%04X", 0xFF00 + ea2 ); } dst += sprintf( dst, ",#%d,", ea & 0x07 ); - offset = (INT8) oprom[pos++]; + offset = (int8_t) oprom[pos++]; dst += sprintf( dst, "$%04X", pc + pos + offset ); break; case AM_1A: diff --git a/src/devices/cpu/sm8500/sm85ops.h b/src/devices/cpu/sm8500/sm85ops.h index 4ba4dab24bd..2e3d0cdcbfb 100644 --- a/src/devices/cpu/sm8500/sm85ops.h +++ b/src/devices/cpu/sm8500/sm85ops.h @@ -97,11 +97,11 @@ r1 = sm8500_b2w[ ( r1 >> 3 ) & 0x07 ]; #define ARG_d8 r1 = mem_readbyte( m_PC++ ); \ - s2 = m_PC + ((INT8)r1); + s2 = m_PC + ((int8_t)r1); #define ARG_Rbr r1 = mem_readbyte( m_PC++ ); \ r2 = mem_readbyte( m_PC++ ); \ - s2 = m_PC + ((INT8)r2); + s2 = m_PC + ((int8_t)r2); #define ARG_ad16 s2 = mem_readword( m_PC ); \ m_PC += 2; @@ -872,7 +872,7 @@ case 0x2A: /* BBC FFii/i(Rr),#b,d8 - 16,12/14,10 cycles - Flags affected: ----- if ( mem_readbyte( s1 ) & s2 ) { mycycles += 10; } else { - m_PC = m_PC + ((INT8)d1); + m_PC = m_PC + ((int8_t)d1); mycycles += 14; } if ( ( r1 & 0x38 ) == 0 ) { @@ -882,7 +882,7 @@ case 0x2A: /* BBC FFii/i(Rr),#b,d8 - 16,12/14,10 cycles - Flags affected: ----- case 0x2B: /* BBS FFii/i(Rr),#b,d8 - 16,12/14,10 cycles - Flags affected: -------- */ ARG_riBd; if ( mem_readbyte( s1 ) & s2 ) { - m_PC = m_PC + ((INT8)d1); + m_PC = m_PC + ((int8_t)d1); mycycles += 14; } else { mycycles += 10; @@ -1307,7 +1307,7 @@ logerror( "%04X: DIV RRr,Rs!\n", m_PC-1 ); m_PS1 = m_PS1 & ~ ( FLAG_Z | FLAG_V ); s1 = mem_readbyte( r2 + 1 ); if ( s1 ) { - UINT16 div = mem_readword( r1 ); + uint16_t div = mem_readword( r1 ); res = div / s1; mem_writebyte( r2, div % s1 ); mem_writeword( r1, res ); diff --git a/src/devices/cpu/sparc/mb86901.cpp b/src/devices/cpu/sparc/mb86901.cpp index 17eff33b8d1..e14921dfbe2 100644 --- a/src/devices/cpu/sparc/mb86901.cpp +++ b/src/devices/cpu/sparc/mb86901.cpp @@ -38,7 +38,7 @@ const int mb86901_device::NWINDOWS = 7; // mb86901_device - constructor //------------------------------------------------- -mb86901_device::mb86901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb86901_device::mb86901_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, MB86901, "Fujitsu MB86901", tag, owner, clock, "mb86901", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 32, 32) , m_dasm(this, 7) @@ -58,7 +58,7 @@ void mb86901_device::device_start() size_t filesize = ftell(input); fseek(input, 0, SEEK_SET); - UINT8 *buf = new UINT8[filesize]; + uint8_t *buf = new uint8_t[filesize]; fread(buf, 1, filesize, input); fclose(input); @@ -73,10 +73,10 @@ void mb86901_device::device_start() break; // get opcode - UINT16 opcode = 0; + uint16_t opcode = 0; for (int shift = 12; shift >= 0 && pos < filesize; shift -= 4) { - UINT8 digit = buf[pos]; + uint8_t digit = buf[pos]; if (digit >= 'a' && digit <= 'z') { digit &= ~0x20; @@ -139,7 +139,7 @@ void mb86901_device::device_start() m_bp_irl = 0; m_irq_state = 0; - memset(m_dbgregs, 0, 24 * sizeof(UINT32)); + memset(m_dbgregs, 0, 24 * sizeof(uint32_t)); memset(m_illegal_instruction_asr, 0, 32 * sizeof(bool)); memset(m_privileged_asr, 1, 32 * sizeof(bool)); @@ -400,8 +400,8 @@ void mb86901_device::device_reset() PC = 0; nPC = 4; - memset(m_r, 0, sizeof(UINT32) * 120); - memset(m_fpr, 0, sizeof(UINT32) * 32); + memset(m_r, 0, sizeof(uint32_t) * 120); + memset(m_fpr, 0, sizeof(uint32_t) * 32); WIM = 0; TBR = 0; @@ -450,7 +450,7 @@ const address_space_config *mb86901_device::memory_space_config(address_spacenum // a 32-bit word in a big-endian system. //------------------------------------------------- -UINT32 mb86901_device::read_sized_word(UINT8 asi, UINT32 address, int size) +uint32_t mb86901_device::read_sized_word(uint8_t asi, uint32_t address, int size) { m_asi = asi; if (size == 1) @@ -477,7 +477,7 @@ UINT32 mb86901_device::read_sized_word(UINT8 asi, UINT32 address, int size) // size handlers //------------------------------------------------- -void mb86901_device::write_sized_word(UINT8 asi, UINT32 address, UINT32 data, int size) +void mb86901_device::write_sized_word(uint8_t asi, uint32_t address, uint32_t data, int size) { m_asi = asi; if (size == 1) @@ -526,7 +526,7 @@ void mb86901_device::state_string_export(const device_state_entry &entry, std::s // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 mb86901_device::disasm_min_opcode_bytes() const +uint32_t mb86901_device::disasm_min_opcode_bytes() const { return 4; } @@ -537,7 +537,7 @@ UINT32 mb86901_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 mb86901_device::disasm_max_opcode_bytes() const +uint32_t mb86901_device::disasm_max_opcode_bytes() const { return 4; } @@ -548,9 +548,9 @@ UINT32 mb86901_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t mb86901_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t mb86901_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { - UINT32 op = *reinterpret_cast(oprom); + uint32_t op = *reinterpret_cast(oprom); return m_dasm.dasm(buffer, pc, big_endianize_int32(op)); } @@ -564,7 +564,7 @@ offs_t mb86901_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 * // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 mb86901_device::execute_min_cycles() const +uint32_t mb86901_device::execute_min_cycles() const { return 1; } @@ -575,7 +575,7 @@ UINT32 mb86901_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 mb86901_device::execute_max_cycles() const +uint32_t mb86901_device::execute_max_cycles() const { return 4; } @@ -586,7 +586,7 @@ UINT32 mb86901_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 mb86901_device::execute_input_lines() const +uint32_t mb86901_device::execute_input_lines() const { return 16; } @@ -654,7 +654,7 @@ void mb86901_device::execute_set_input(int inputnum, int state) // execute_add - execute an add-type opcode //------------------------------------------------- -void mb86901_device::execute_add(UINT32 op) +void mb86901_device::execute_add(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 173, "Appendix C - ISP Descriptions - Add Instructions" (SPARCv8.pdf, pg. 170) @@ -678,10 +678,10 @@ void mb86901_device::execute_add(UINT32 op) ((not result<31>) and (r[rs1]<31> or operand2<31>)) ); */ - UINT32 rs1 = RS1REG; - UINT32 operand2 = USEIMM ? SIMM13 : RS2REG; + uint32_t rs1 = RS1REG; + uint32_t operand2 = USEIMM ? SIMM13 : RS2REG; - UINT32 result = 0; + uint32_t result = 0; if (ADD || ADDCC) result = rs1 + operand2; else if (ADDX || ADDXCC) @@ -708,7 +708,7 @@ void mb86901_device::execute_add(UINT32 op) // opcode //------------------------------------------------- -void mb86901_device::execute_taddcc(UINT32 op) +void mb86901_device::execute_taddcc(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 173, "Appendix C - ISP Descriptions - Tagged Add Instructions" (SPARCv8.pdf, pg. 170) @@ -735,10 +735,10 @@ void mb86901_device::execute_taddcc(UINT32 op) r[rd] <- result; ); */ - UINT32 rs1 = RS1REG; - UINT32 operand2 = USEIMM ? SIMM13 : RS2REG; + uint32_t rs1 = RS1REG; + uint32_t operand2 = USEIMM ? SIMM13 : RS2REG; - UINT32 result = rs1 + operand2; + uint32_t result = rs1 + operand2; bool temp_v = (BIT31(rs1) && BIT31(operand2) && !BIT31(result)) || (!BIT31(rs1) && !BIT31(operand2) && BIT31(result)) || @@ -769,7 +769,7 @@ void mb86901_device::execute_taddcc(UINT32 op) // opcode //------------------------------------------------- -void mb86901_device::execute_sub(UINT32 op) +void mb86901_device::execute_sub(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 174, "Appendix C - ISP Descriptions - Subtract Instructions" (SPARCv8.pdf, pg. 171) @@ -793,10 +793,10 @@ void mb86901_device::execute_sub(UINT32 op) (result<31> and ((not r[rs1]<31>) or operand2<31>)) ); */ - UINT32 rs1 = RS1REG; - UINT32 operand2 = USEIMM ? SIMM13 : RS2REG; + uint32_t rs1 = RS1REG; + uint32_t operand2 = USEIMM ? SIMM13 : RS2REG; - UINT32 result = 0; + uint32_t result = 0; if (SUB || SUBCC) result = rs1 - operand2; else if (SUBX || SUBXCC) @@ -823,7 +823,7 @@ void mb86901_device::execute_sub(UINT32 op) // opcode //-------------------------------------------------- -void mb86901_device::execute_tsubcc(UINT32 op) +void mb86901_device::execute_tsubcc(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 174, "Appendix C - ISP Descriptions - Tagged Subtract Instructions" (SPARCv8.pdf, pg. 171) @@ -851,10 +851,10 @@ void mb86901_device::execute_tsubcc(UINT32 op) ); */ - UINT32 rs1 = RS1REG; - UINT32 operand2 = USEIMM ? SIMM13 : RS2REG; + uint32_t rs1 = RS1REG; + uint32_t operand2 = USEIMM ? SIMM13 : RS2REG; - UINT32 result = rs1 - operand2; + uint32_t result = rs1 - operand2; bool temp_v = (BIT31(rs1) && !BIT31(operand2) && !BIT31(result)) || (!BIT31(rs1) && BIT31(operand2) && BIT31(result)) || @@ -885,7 +885,7 @@ void mb86901_device::execute_tsubcc(UINT32 op) // opcode, and/or/xor/andn/orn/xnor //------------------------------------------------- -void mb86901_device::execute_logical(UINT32 op) +void mb86901_device::execute_logical(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 172, "Appendix C - ISP Descriptions - Logical Instructions" (SPARCv8.pdf, pg. 169) @@ -909,9 +909,9 @@ void mb86901_device::execute_logical(UINT32 op) ); */ - UINT32 operand2 = USEIMM ? SIMM13 : RS2REG; + uint32_t operand2 = USEIMM ? SIMM13 : RS2REG; - UINT32 result = 0; + uint32_t result = 0; switch (OP3) { case OP3_AND: @@ -957,7 +957,7 @@ void mb86901_device::execute_logical(UINT32 op) // sll/srl/sra //------------------------------------------------- -void mb86901_device::execute_shift(UINT32 op) +void mb86901_device::execute_shift(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 172, "Appendix C - ISP Descriptions - Shift Instructions" (SPARCv8.pdf, pg. 169) @@ -970,14 +970,14 @@ void mb86901_device::execute_shift(UINT32 op) else if (SRA and (rd != 0) ) then r[rd] <- shift_right_arithmetic(r[rs1], shift_count) */ - UINT32 shift_count = USEIMM ? (SIMM13 & 31) : (RS2REG & 31); + uint32_t shift_count = USEIMM ? (SIMM13 & 31) : (RS2REG & 31); if (SLL && RD != 0) RDREG = RS1REG << shift_count; else if (SRL && RD != 0) - RDREG = UINT32(RS1REG) >> shift_count; + RDREG = uint32_t(RS1REG) >> shift_count; else if (SRA && RD != 0) - RDREG = INT32(RS1REG) >> shift_count; + RDREG = int32_t(RS1REG) >> shift_count; } @@ -985,7 +985,7 @@ void mb86901_device::execute_shift(UINT32 op) // execute_mulscc - execute a multiply step opcode //-------------------------------------------------- -void mb86901_device::execute_mulscc(UINT32 op) +void mb86901_device::execute_mulscc(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 175, "Appendix C - ISP Descriptions - Multiply Step Instruction" (SPARCv8.pdf, pg. 172) @@ -1010,11 +1010,11 @@ void mb86901_device::execute_mulscc(UINT32 op) C <- (operand1<31> and operand2<31>) or ((not result<31>) and (operand1<31> or operand2<31>)) */ - UINT32 operand1 = ((ICC_N != ICC_V) ? 0x80000000 : 0) | (RS1REG >> 1); + uint32_t operand1 = ((ICC_N != ICC_V) ? 0x80000000 : 0) | (RS1REG >> 1); - UINT32 operand2 = (Y & 1) ? (USEIMM ? SIMM13 : RS2REG) : 0; + uint32_t operand2 = (Y & 1) ? (USEIMM ? SIMM13 : RS2REG) : 0; - UINT32 result = operand1 + operand2; + uint32_t result = operand1 + operand2; Y = ((RS1REG & 1) ? 0x80000000 : 0) | (Y >> 1); if (RD != 0) @@ -1035,7 +1035,7 @@ void mb86901_device::execute_mulscc(UINT32 op) // opcode //------------------------------------------------- -void mb86901_device::execute_rdsr(UINT32 op) +void mb86901_device::execute_rdsr(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 182, "Appendix C - ISP Descriptions - Read State Register Instructions" (SPARCv8.pdf, pg. 179) @@ -1091,7 +1091,7 @@ void mb86901_device::execute_rdsr(UINT32 op) // opcode //------------------------------------------------- -void mb86901_device::execute_wrsr(UINT32 op) +void mb86901_device::execute_wrsr(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 183, "Appendix C - ISP Descriptions - Write State Register Instructions" (SPARCv8.pdf, pg. 180) @@ -1136,9 +1136,9 @@ void mb86901_device::execute_wrsr(UINT32 op) ) ); */ - UINT32 operand2 = USEIMM ? SIMM13 : RS2REG; + uint32_t operand2 = USEIMM ? SIMM13 : RS2REG; - UINT32 result = RS1REG ^ operand2; + uint32_t result = RS1REG ^ operand2; if (WRASR && RD == 0) { @@ -1211,7 +1211,7 @@ void mb86901_device::execute_wrsr(UINT32 op) // opcode //------------------------------------------------- -void mb86901_device::execute_rett(UINT32 op) +void mb86901_device::execute_rett(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 181, "Appendix C - ISP Descriptions - Return from Trap Instructions" (SPARCv8.pdf, pg. 178) @@ -1249,8 +1249,8 @@ void mb86901_device::execute_rett(UINT32 op) ) */ - UINT8 new_cwp = ((PSR & PSR_CWP_MASK) + 1) % NWINDOWS; - UINT32 address = RS1REG + (USEIMM ? SIMM13 : RS2REG); + uint8_t new_cwp = ((PSR & PSR_CWP_MASK) + 1) % NWINDOWS; + uint32_t address = RS1REG + (USEIMM ? SIMM13 : RS2REG); if (PSR & PSR_ET_MASK) { m_trap = 1; @@ -1312,7 +1312,7 @@ void mb86901_device::execute_rett(UINT32 op) // opcode //------------------------------------------------- -void mb86901_device::execute_saverestore(UINT32 op) +void mb86901_device::execute_saverestore(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 177, "Appendix C - ISP Descriptions - SAVE and RESTORE Instructions" (SPARCv8.pdf, pg. 174) @@ -1344,13 +1344,13 @@ void mb86901_device::execute_saverestore(UINT32 op) r[rd] <- result { destination in new window } */ - UINT32 rs1 = RS1REG; - UINT32 operand2 = USEIMM ? SIMM13 : RS2REG; + uint32_t rs1 = RS1REG; + uint32_t operand2 = USEIMM ? SIMM13 : RS2REG; - UINT32 result = 0; + uint32_t result = 0; if (SAVE) { - UINT8 new_cwp = (((PSR & PSR_CWP_MASK) + NWINDOWS) - 1) % NWINDOWS; + uint8_t new_cwp = (((PSR & PSR_CWP_MASK) + NWINDOWS) - 1) % NWINDOWS; if ((WIM & (1 << new_cwp)) != 0) { m_trap = 1; @@ -1365,7 +1365,7 @@ void mb86901_device::execute_saverestore(UINT32 op) } else if (RESTORE) { - UINT8 new_cwp = ((PSR & PSR_CWP_MASK) + 1) % NWINDOWS; + uint8_t new_cwp = ((PSR & PSR_CWP_MASK) + 1) % NWINDOWS; if ((WIM & (1 << new_cwp)) != 0) { m_trap = 1; @@ -1390,7 +1390,7 @@ void mb86901_device::execute_saverestore(UINT32 op) // execute_jmpl - execute a jump and link opcode //------------------------------------------------- -void mb86901_device::execute_jmpl(UINT32 op) +void mb86901_device::execute_jmpl(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 180, "Appendix C - ISP Descriptions - SAVE and RESTORE Instructions" (SPARCv8.pdf, pg. 177) @@ -1406,7 +1406,7 @@ void mb86901_device::execute_jmpl(UINT32 op) ) */ - UINT32 jump_address = RS1REG + (USEIMM ? SIMM13 : RS2REG); + uint32_t jump_address = RS1REG + (USEIMM ? SIMM13 : RS2REG); if (jump_address & 3) { @@ -1428,7 +1428,7 @@ void mb86901_device::execute_jmpl(UINT32 op) // mostly ALU ops //------------------------------------------------- -void mb86901_device::execute_group2(UINT32 op) +void mb86901_device::execute_group2(uint32_t op) { switch (OP3) { @@ -1569,7 +1569,7 @@ void mb86901_device::update_gpr_pointers() // execute_store - execute a store-type opcode //------------------------------------------------- -void mb86901_device::execute_store(UINT32 op) +void mb86901_device::execute_store(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 165, "Appendix C - ISP Descriptions - Store Instructions" (SPARCv8.pdf, pg. 162) @@ -1701,8 +1701,8 @@ void mb86901_device::execute_store(UINT32 op) m_illegal_instruction = 1; } - UINT32 address = 0; - UINT8 addr_space = 0; + uint32_t address = 0; + uint8_t addr_space = 0; if (!m_trap) { if (STD || ST || STH || STB || STF || STDF || STFSR || STDFQ || STCSR || STC || STDC || STDCQ) @@ -1769,10 +1769,10 @@ void mb86901_device::execute_store(UINT32 op) } } - UINT32 data0 = 0; + uint32_t data0 = 0; if (!m_trap) { - //UINT8 byte_mask; + //uint8_t byte_mask; if (STF) { //byte_mask = 15; @@ -1877,7 +1877,7 @@ void mb86901_device::execute_store(UINT32 op) } if (!m_trap && (STD || STDA || STDF || STDC || STDFQ || STDCQ)) { - UINT32 data1 = 0; + uint32_t data1 = 0; if (STD || STDA) { data1 = REG(RD | 1); @@ -1912,7 +1912,7 @@ void mb86901_device::execute_store(UINT32 op) // execute_load - execute a load-type opcode //------------------------------------------------- -void mb86901_device::execute_load(UINT32 op) +void mb86901_device::execute_load(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 163, "Appendix C - ISP Descriptions - C.9. Instruction Defintions - Load Instructions" (SPARCv8.pdf, pg. 160) @@ -2014,8 +2014,8 @@ void mb86901_device::execute_load(UINT32 op) ); */ - UINT32 address = 0; - UINT8 addr_space = 0; + uint32_t address = 0; + uint8_t addr_space = 0; if (LDD || LD || LDSH || LDUH || LDSB || LDUB || LDDF || LDF || LDFSR || LDDC || LDC || LDCSR) { address = RS1REG + (USEIMM ? SIMM13 : RS2REG); @@ -2079,10 +2079,10 @@ void mb86901_device::execute_load(UINT32 op) } } - UINT32 word0(0); + uint32_t word0(0); if (!m_trap) { - UINT32 data = read_sized_word(addr_space, address, (LD || LDD || LDA || LDDA) ? 4 : ((LDUH || LDSH || LDUHA || LDSHA) ? 2 : 1)); + uint32_t data = read_sized_word(addr_space, address, (LD || LDD || LDA || LDDA) ? 4 : ((LDUH || LDSH || LDUHA || LDSHA) ? 2 : 1)); if (m_mae) { @@ -2093,26 +2093,26 @@ void mb86901_device::execute_load(UINT32 op) { if (LDSB || LDSBA || LDUB || LDUBA) { - UINT8 byte = 0; + uint8_t byte = 0; if ((address & 3) == 0) byte = (data >> 24) & 0xff; else if ((address & 3) == 1) byte = (data >> 16) & 0xff; else if ((address & 3) == 2) byte = (data >> 8) & 0xff; else if ((address & 3) == 3) byte = data & 0xff; if (LDSB || LDSBA) - word0 = (((INT32)byte) << 24) >> 24; + word0 = (((int32_t)byte) << 24) >> 24; else word0 = byte; } else if (LDSH || LDSHA || LDUH || LDUHA) { - UINT16 halfword = 0; + uint16_t halfword = 0; if ((address & 3) == 0) halfword = (data >> 16) & 0xffff; else if ((address & 3) == 2) halfword = data & 0xffff; if (LDSH || LDSHA) { - word0 = (((INT32)halfword) << 16) >> 16; + word0 = (((int32_t)halfword) << 16) >> 16; } else { @@ -2140,7 +2140,7 @@ void mb86901_device::execute_load(UINT32 op) if (!m_trap && (LDD || LDDA || LDDF || LDDC)) { - UINT32 word1 = read_sized_word(addr_space, address + 4, 4); + uint32_t word1 = read_sized_word(addr_space, address + 4, 4); if (MAE) { m_trap = 1; @@ -2158,7 +2158,7 @@ void mb86901_device::execute_load(UINT32 op) // instruction //------------------------------------------------- -void mb86901_device::execute_ldstub(UINT32 op) +void mb86901_device::execute_ldstub(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 169, "Appendix C - ISP Descriptions - Atomic Load-Store Unsigned Byte Instructions" (SPARCv8.pdf, pg. 166) @@ -2219,8 +2219,8 @@ void mb86901_device::execute_ldstub(UINT32 op) ); */ - UINT32 address = 0; - UINT8 addr_space = 0; + uint32_t address = 0; + uint8_t addr_space = 0; if (LDSTUB) { address = RS1REG + (USEIMM ? SIMM13 : RS2REG); @@ -2245,7 +2245,7 @@ void mb86901_device::execute_ldstub(UINT32 op) } } - UINT32 data(0); + uint32_t data(0); if (!m_trap) { while (m_pb_block_ldst_byte || m_pb_block_ldst_word) @@ -2268,7 +2268,7 @@ void mb86901_device::execute_ldstub(UINT32 op) if (!m_trap) { - //UINT8 byte_mask; + //uint8_t byte_mask; if ((address & 3) == 0) { //byte_mask = 8; @@ -2296,7 +2296,7 @@ void mb86901_device::execute_ldstub(UINT32 op) } else { - UINT32 word; + uint32_t word; if ((address & 3) == 0) { word = (data >> 24) & 0xff; @@ -2325,7 +2325,7 @@ void mb86901_device::execute_ldstub(UINT32 op) // (load/store) //------------------------------------------------- -void mb86901_device::execute_group3(UINT32 op) +void mb86901_device::execute_group3(uint32_t op) { static const int ldst_cycles[64] = { 1, 1, 1, 2, 2, 2, 2, 3, @@ -2405,7 +2405,7 @@ void mb86901_device::execute_group3(UINT32 op) // condition code //------------------------------------------------- -bool mb86901_device::evaluate_condition(UINT32 op) +bool mb86901_device::evaluate_condition(uint32_t op) { bool take = false; bool n = ICC_N_SET; @@ -2436,7 +2436,7 @@ bool mb86901_device::evaluate_condition(UINT32 op) // execute_bicc - execute a branch opcode //------------------------------------------------- -void mb86901_device::execute_bicc(UINT32 op) +void mb86901_device::execute_bicc(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 178, "Appendix C - ISP Descriptions - Branch on Integer Condition Instructions" (SPARCv8.pdf, pg. 175) @@ -2471,7 +2471,7 @@ void mb86901_device::execute_bicc(UINT32 op) */ bool branch_taken = evaluate_condition(op); - UINT32 pc = PC; + uint32_t pc = PC; PC = nPC; if (branch_taken) { @@ -2492,7 +2492,7 @@ void mb86901_device::execute_bicc(UINT32 op) // execute_ticc - execute a conditional trap //------------------------------------------------- -void mb86901_device::execute_ticc(UINT32 op) +void mb86901_device::execute_ticc(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 182, "Appendix C - ISP Descriptions - Trap on Integer Condition Instructions" (SPARCv8.pdf, pg. 179) @@ -2531,7 +2531,7 @@ void mb86901_device::execute_ticc(UINT32 op) bool trap_eval_icc = evaluate_condition(op); - UINT8 trap_number = RS1REG + (USEIMM ? SIMM7 : RS2REG); + uint8_t trap_number = RS1REG + (USEIMM ? SIMM7 : RS2REG); if (COND) { @@ -2780,7 +2780,7 @@ void mb86901_device::execute_trap() // validity. //------------------------------------------------- -void mb86901_device::complete_instruction_execution(UINT32 op) +void mb86901_device::complete_instruction_execution(uint32_t op) { switch (OP) { @@ -2811,8 +2811,8 @@ void mb86901_device::complete_instruction_execution(UINT32 op) case OP_CALL: // call { - UINT32 pc = PC; - UINT32 callpc = PC + DISP30; + uint32_t pc = PC; + uint32_t callpc = PC + DISP30; PC = nPC; nPC = callpc; @@ -2838,7 +2838,7 @@ void mb86901_device::complete_instruction_execution(UINT32 op) // fetched instruction //------------------------------------------------- -void mb86901_device::dispatch_instruction(UINT32 op) +void mb86901_device::dispatch_instruction(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 159, "Appendix C - ISP Descriptions - C.6. Instruction Dispatch" (SPARCv8.pdf, pg. 156) @@ -2896,7 +2896,7 @@ void mb86901_device::dispatch_instruction(UINT32 op) // of a floating-point operation //------------------------------------------------- -void mb86901_device::complete_fp_execution(UINT32 /*op*/) +void mb86901_device::complete_fp_execution(uint32_t /*op*/) { } @@ -2984,8 +2984,8 @@ void mb86901_device::execute_step() { // write-state-register delay not yet implemented - UINT32 addr_space = (IS_USER ? 8 : 9); - UINT32 op = read_sized_word(addr_space, PC, 4); + uint32_t addr_space = (IS_USER ? 8 : 9); + uint32_t op = read_sized_word(addr_space, PC, 4); #if LOG_FCODES //if (m_log_fcodes) @@ -3134,7 +3134,7 @@ void mb86901_device::execute_run() // disassembler //------------------------------------------------- -UINT64 mb86901_device::get_reg_r(unsigned index) const +uint64_t mb86901_device::get_reg_r(unsigned index) const { return REG(index & 31); } @@ -3145,7 +3145,7 @@ UINT64 mb86901_device::get_reg_r(unsigned index) const // disassembler //------------------------------------------------- -UINT64 mb86901_device::get_translated_pc() const +uint64_t mb86901_device::get_translated_pc() const { // FIXME: how do we apply translation to the address so it's in the same space the disassembler sees? return m_pc; @@ -3157,7 +3157,7 @@ UINT64 mb86901_device::get_translated_pc() const // disassembler //------------------------------------------------- -UINT8 mb86901_device::get_icc() const +uint8_t mb86901_device::get_icc() const { return (m_psr & PSR_ICC_MASK) >> PSR_ICC_SHIFT; } @@ -3168,7 +3168,7 @@ UINT8 mb86901_device::get_icc() const // for disassembler //------------------------------------------------- -UINT8 mb86901_device::get_xcc() const +uint8_t mb86901_device::get_xcc() const { // not present before SPARCv9 return 0; @@ -3180,7 +3180,7 @@ UINT8 mb86901_device::get_xcc() const // for disassembler //------------------------------------------------- -UINT8 mb86901_device::get_fcc(unsigned index) const +uint8_t mb86901_device::get_fcc(unsigned index) const { // only one fcc instance before SPARCv9 return (m_fsr >> 10) & 3; diff --git a/src/devices/cpu/sparc/sparc.h b/src/devices/cpu/sparc/sparc.h index 424305a1924..07fa4cd10a4 100644 --- a/src/devices/cpu/sparc/sparc.h +++ b/src/devices/cpu/sparc/sparc.h @@ -25,7 +25,7 @@ class mb86901_device : public cpu_device, protected sparc_debug_state { public: - mb86901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb86901_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -33,9 +33,9 @@ public: virtual void device_stop() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -43,15 +43,15 @@ public: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - UINT8 get_asi() { return m_asi; } - UINT32 pc() { return m_pc; } + uint8_t get_asi() { return m_asi; } + uint32_t pc() { return m_pc; } template static void add_asi_desc(device_t &device, const T &desc) { return downcast(device).add_asi_desc(desc); } @@ -66,41 +66,41 @@ protected: void update_gpr_pointers(); - void execute_add(UINT32 op); - void execute_taddcc(UINT32 op); - void execute_sub(UINT32 op); - void execute_tsubcc(UINT32 op); - void execute_logical(UINT32 op); - void execute_shift(UINT32 op); - void execute_mulscc(UINT32 op); - void execute_rdsr(UINT32 op); - void execute_wrsr(UINT32 op); - void execute_rett(UINT32 op); - void execute_saverestore(UINT32 op); - void execute_jmpl(UINT32 op); + void execute_add(uint32_t op); + void execute_taddcc(uint32_t op); + void execute_sub(uint32_t op); + void execute_tsubcc(uint32_t op); + void execute_logical(uint32_t op); + void execute_shift(uint32_t op); + void execute_mulscc(uint32_t op); + void execute_rdsr(uint32_t op); + void execute_wrsr(uint32_t op); + void execute_rett(uint32_t op); + void execute_saverestore(uint32_t op); + void execute_jmpl(uint32_t op); #if SPARCV8 - void execute_mul(UINT32 op); - void execute_div(UINT32 op); + void execute_mul(uint32_t op); + void execute_div(uint32_t op); #endif - void execute_group2(UINT32 op); + void execute_group2(uint32_t op); - void execute_load(UINT32 op); - void execute_store(UINT32 op); - void execute_ldstub(UINT32 op); + void execute_load(uint32_t op); + void execute_store(uint32_t op); + void execute_ldstub(uint32_t op); #if SPARCV8 - void execute_swap(UINT32 op); + void execute_swap(uint32_t op); #endif - void execute_group3(UINT32 op); + void execute_group3(uint32_t op); - bool evaluate_condition(UINT32 op); - void execute_bicc(UINT32 op); - void execute_ticc(UINT32 op); + bool evaluate_condition(uint32_t op); + void execute_bicc(uint32_t op); + void execute_ticc(uint32_t op); void select_trap(); void execute_trap(); - void complete_instruction_execution(UINT32 op); - void dispatch_instruction(UINT32 op); - void complete_fp_execution(UINT32 /*op*/); + void complete_instruction_execution(uint32_t op); + void dispatch_instruction(uint32_t op); + void complete_fp_execution(uint32_t /*op*/); void execute_step(); void reset_step(); @@ -108,7 +108,7 @@ protected: #if LOG_FCODES void indent(); - void disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 handler_base, UINT32 entry_point, UINT32 stack); + void disassemble_ss1_fcode(uint32_t r5, uint32_t opcode, uint32_t handler_base, uint32_t entry_point, uint32_t stack); void log_fcodes(); #endif @@ -116,46 +116,46 @@ protected: const address_space_config m_program_config; // memory access - UINT32 read_sized_word(UINT8 asi, UINT32 address, int size); - void write_sized_word(UINT8 asi, UINT32 address, UINT32 data, int size); + uint32_t read_sized_word(uint8_t asi, uint32_t address, int size); + void write_sized_word(uint8_t asi, uint32_t address, uint32_t data, int size); // helpers for the disassembler - virtual UINT64 get_reg_r(unsigned index) const override; - virtual UINT64 get_translated_pc() const override; - virtual UINT8 get_icc() const override; - virtual UINT8 get_xcc() const override; - virtual UINT8 get_fcc(unsigned index) const override; + virtual uint64_t get_reg_r(unsigned index) const override; + virtual uint64_t get_translated_pc() const override; + virtual uint8_t get_icc() const override; + virtual uint8_t get_xcc() const override; + virtual uint8_t get_fcc(unsigned index) const override; // general-purpose registers - UINT32 m_r[120]; + uint32_t m_r[120]; // FPU registers - UINT32 m_fpr[32]; - UINT32 m_fsr; - UINT8 m_ftt; + uint32_t m_fpr[32]; + uint32_t m_fsr; + uint8_t m_ftt; // control/status registers - UINT32 m_pc; - UINT32 m_npc; - UINT32 m_psr; - UINT32 m_wim; - UINT32 m_tbr; - UINT32 m_y; + uint32_t m_pc; + uint32_t m_npc; + uint32_t m_psr; + uint32_t m_wim; + uint32_t m_tbr; + uint32_t m_y; bool m_bp_reset_in; - UINT8 m_bp_irl; + uint8_t m_bp_irl; bool m_bp_fpu_present; bool m_bp_cp_present; bool m_pb_error; bool m_pb_block_ldst_byte; bool m_pb_block_ldst_word; - UINT16 m_irq_state; + uint16_t m_irq_state; // trap and error registers bool m_trap; - UINT8 m_tt; - UINT8 m_ticc_trap_type; - UINT8 m_interrupt_level; + uint8_t m_tt; + uint8_t m_ticc_trap_type; + uint8_t m_interrupt_level; bool m_privileged_instruction; bool m_illegal_instruction; bool m_mem_address_not_aligned; @@ -179,29 +179,29 @@ protected: bool m_reset_trap; bool m_execute_mode; bool m_error_mode; - UINT8 m_fpu_sequence_err; - UINT8 m_cp_sequence_err; + uint8_t m_fpu_sequence_err; + uint8_t m_cp_sequence_err; // fields separated out from PSR (Processor State Register) - UINT8 m_impl; // implementation (always 0 in MB86901) - UINT8 m_ver; // version (always 0 in MB86901) - UINT8 m_icc; // integer condition codes + uint8_t m_impl; // implementation (always 0 in MB86901) + uint8_t m_ver; // version (always 0 in MB86901) + uint8_t m_icc; // integer condition codes bool m_ec; // enable coprocessor bool m_ef; // enable FPU - UINT8 m_pil; // processor interrupt level + uint8_t m_pil; // processor interrupt level bool m_s; // supervisor mode bool m_ps; // prior S state bool m_et; // enable traps - UINT8 m_cwp; // current window pointer + uint8_t m_cwp; // current window pointer bool m_alu_op3_assigned[64]; bool m_ldst_op3_assigned[64]; // register windowing helpers - UINT32* m_regs[32]; + uint32_t* m_regs[32]; // addressing helpers - UINT8 m_asi; + uint8_t m_asi; // other internal states bool m_privileged_asr[32]; @@ -212,19 +212,19 @@ protected: int m_icount; // debugger helpers - UINT32 m_dbgregs[24]; + uint32_t m_dbgregs[24]; sparc_disassembler m_dasm; // address spaces address_space *m_program; #if LOG_FCODES - UINT32 m_ss1_next_pc; - UINT32 m_ss1_next_opcode; - UINT32 m_ss1_next_handler_base; - UINT32 m_ss1_next_entry_point; - UINT32 m_ss1_next_stack; - std::map m_ss1_fcode_table; + uint32_t m_ss1_next_pc; + uint32_t m_ss1_next_opcode; + uint32_t m_ss1_next_handler_base; + uint32_t m_ss1_next_entry_point; + uint32_t m_ss1_next_stack; + std::map m_ss1_fcode_table; bool m_log_fcodes; #endif diff --git a/src/devices/cpu/sparc/sparcdasm.cpp b/src/devices/cpu/sparc/sparcdasm.cpp index 51f5173dfb7..38d139249be 100644 --- a/src/devices/cpu/sparc/sparcdasm.cpp +++ b/src/devices/cpu/sparc/sparcdasm.cpp @@ -13,11 +13,11 @@ namespace { - INT32 get_disp16(UINT32 op) { return DISP19; } - INT32 get_disp19(UINT32 op) { return DISP19; } - INT32 get_disp22(UINT32 op) { return DISP19; } + int32_t get_disp16(uint32_t op) { return DISP19; } + int32_t get_disp19(uint32_t op) { return DISP19; } + int32_t get_disp22(uint32_t op) { return DISP19; } - const char *bicc_comment(const sparc_debug_state *state, bool use_cc, offs_t pc, UINT32 op) + const char *bicc_comment(const sparc_debug_state *state, bool use_cc, offs_t pc, uint32_t op) { if (!state || (state->get_translated_pc() != pc)) return nullptr; auto const cc((use_cc && (BRCC & 0x2)) ? state->get_xcc() : state->get_icc()); @@ -42,7 +42,7 @@ namespace { } return nullptr; } - const char *bfcc_comment(const sparc_debug_state *state, bool use_cc, offs_t pc, UINT32 op) + const char *bfcc_comment(const sparc_debug_state *state, bool use_cc, offs_t pc, uint32_t op) { if (!state || (state->get_translated_pc() != pc)) return nullptr; auto const fcc(state->get_fcc(use_cc ? BRCC : 0)); @@ -67,10 +67,10 @@ namespace { } return nullptr; } - const char *bpr_comment(const sparc_debug_state *state, bool use_cc, offs_t pc, UINT32 op) + const char *bpr_comment(const sparc_debug_state *state, bool use_cc, offs_t pc, uint32_t op) { if (!state || (state->get_translated_pc() != pc)) return nullptr; - const INT64 reg(state->get_reg_r(RS1)); + const int64_t reg(state->get_reg_r(RS1)); switch (COND) { case 1: return (reg == 0) ? "will branch" : "will fall through"; @@ -568,7 +568,7 @@ const sparc_disassembler::vis_op_desc_map::value_type sparc_disassembler::VIS3B_ }; -inline UINT32 sparc_disassembler::freg(UINT32 val, bool shift) const +inline uint32_t sparc_disassembler::freg(uint32_t val, bool shift) const { return (shift && (m_version >= 9)) ? ((val & 0x1e) | ((val << 5) & 0x20)) : val; } @@ -730,7 +730,7 @@ sparc_disassembler::sparc_disassembler(const sparc_debug_state *state, unsigned } -offs_t sparc_disassembler::dasm(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm(char *buf, offs_t pc, uint32_t op) const { switch (OP) { @@ -1057,7 +1057,7 @@ offs_t sparc_disassembler::dasm(char *buf, offs_t pc, UINT32 op) const } -offs_t sparc_disassembler::dasm_invalid(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_invalid(char *buf, offs_t pc, uint32_t op) const { print(buf, "%-*s0x%08x ! ", m_op_field_width, ".word", op); if (OP == 0) @@ -1083,7 +1083,7 @@ offs_t sparc_disassembler::dasm_invalid(char *buf, offs_t pc, UINT32 op) const } -offs_t sparc_disassembler::dasm_branch(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_branch(char *buf, offs_t pc, uint32_t op) const { char *ptr(buf); const branch_desc &desc(m_branch_desc[OP2]); @@ -1094,7 +1094,7 @@ offs_t sparc_disassembler::dasm_branch(char *buf, offs_t pc, UINT32 op) const pad_op_field(buf, ptr); if (desc.use_cc) print(ptr, "%s,", desc.reg_cc[BRCC]); if (OP2 == 3) print(ptr, "%s,", REG_NAMES[RS1]); - const INT32 disp(desc.get_disp(op)); + const int32_t disp(desc.get_disp(op)); print(ptr, "%%pc%c0x%0*x ! 0x%08x", (disp < 0) ? '-' : '+', desc.disp_width, std::abs(disp), pc + disp); //const char * const comment(desc.get_comment ? desc.get_comment(m_state, desc.use_cc, pc, op) : nullptr); //if (comment) print(ptr, " - %s", comment); @@ -1103,7 +1103,7 @@ offs_t sparc_disassembler::dasm_branch(char *buf, offs_t pc, UINT32 op) const } -offs_t sparc_disassembler::dasm_shift(char *buf, offs_t pc, UINT32 op, const char *mnemonic, const char *mnemonicx, const char *mnemonicx0) const +offs_t sparc_disassembler::dasm_shift(char *buf, offs_t pc, uint32_t op, const char *mnemonic, const char *mnemonicx, const char *mnemonicx0) const { if ((m_version >= 9) && USEEXT) { @@ -1128,7 +1128,7 @@ offs_t sparc_disassembler::dasm_shift(char *buf, offs_t pc, UINT32 op, const cha } -offs_t sparc_disassembler::dasm_read_state_reg(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_read_state_reg(char *buf, offs_t pc, uint32_t op) const { if (RS1 == 0) { @@ -1158,7 +1158,7 @@ offs_t sparc_disassembler::dasm_read_state_reg(char *buf, offs_t pc, UINT32 op) else if ((m_version >= 9) && USEIMM && (RS1 == 15) && (RD == 0)) { print(buf, "%-*s", m_op_field_width, "membar"); - UINT32 mask(MMASK | (CMASK << 4)); + uint32_t mask(MMASK | (CMASK << 4)); if (mask == 0) print(buf, "0"); if (mask & 1) print(buf, "#LoadLoad%s", (mask >> 1) ? "|" : ""); mask >>= 1; @@ -1179,7 +1179,7 @@ offs_t sparc_disassembler::dasm_read_state_reg(char *buf, offs_t pc, UINT32 op) } -offs_t sparc_disassembler::dasm_write_state_reg(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_write_state_reg(char *buf, offs_t pc, uint32_t op) const { if (RD == 0) { @@ -1242,7 +1242,7 @@ offs_t sparc_disassembler::dasm_write_state_reg(char *buf, offs_t pc, UINT32 op) } -offs_t sparc_disassembler::dasm_move_cond(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_move_cond(char *buf, offs_t pc, uint32_t op) const { if ((m_version < 9) || !MOVCC_CC_NAMES[MOVCC]) return dasm_invalid(buf, pc, op); @@ -1257,7 +1257,7 @@ offs_t sparc_disassembler::dasm_move_cond(char *buf, offs_t pc, UINT32 op) const return 4 | DASMFLAG_SUPPORTED; } -offs_t sparc_disassembler::dasm_move_reg_cond(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_move_reg_cond(char *buf, offs_t pc, uint32_t op) const { if ((m_version < 9) || !MOVE_INT_COND_MNEMONICS[RCOND]) return dasm_invalid(buf, pc, op); @@ -1270,7 +1270,7 @@ offs_t sparc_disassembler::dasm_move_reg_cond(char *buf, offs_t pc, UINT32 op) c } -offs_t sparc_disassembler::dasm_fpop1(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_fpop1(char *buf, offs_t pc, uint32_t op) const { const auto it(m_fpop1_desc.find(OPF)); if (it == m_fpop1_desc.end()) return dasm_invalid(buf, pc, op); @@ -1283,7 +1283,7 @@ offs_t sparc_disassembler::dasm_fpop1(char *buf, offs_t pc, UINT32 op) const } -offs_t sparc_disassembler::dasm_fpop2(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_fpop2(char *buf, offs_t pc, uint32_t op) const { // Move Floating-Point Register on Condition if ((m_version >= 9) && (((op >> 18) & 1) == 0) && MOVCC_CC_NAMES[OPFCC]) @@ -1334,7 +1334,7 @@ offs_t sparc_disassembler::dasm_fpop2(char *buf, offs_t pc, UINT32 op) const } -offs_t sparc_disassembler::dasm_impdep1(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_impdep1(char *buf, offs_t pc, uint32_t op) const { const auto it(m_vis_op_desc.find(OPF)); if (it != m_vis_op_desc.end()) @@ -1384,7 +1384,7 @@ offs_t sparc_disassembler::dasm_impdep1(char *buf, offs_t pc, UINT32 op) const } -offs_t sparc_disassembler::dasm_jmpl(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_jmpl(char *buf, offs_t pc, uint32_t op) const { if (USEIMM && (RD == 0) && ((RS1 == 15) || (RS1 == 31)) && (SIMM13 == 8)) { @@ -1401,7 +1401,7 @@ offs_t sparc_disassembler::dasm_jmpl(char *buf, offs_t pc, UINT32 op) const } -offs_t sparc_disassembler::dasm_return(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_return(char *buf, offs_t pc, uint32_t op) const { print(buf, "%-*s", m_op_field_width, (m_version >= 9) ? "return" : "rett"); dasm_address(buf, op); @@ -1409,7 +1409,7 @@ offs_t sparc_disassembler::dasm_return(char *buf, offs_t pc, UINT32 op) const } -offs_t sparc_disassembler::dasm_tcc(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_tcc(char *buf, offs_t pc, uint32_t op) const { static const char *const tcc_names[16] = { "tn", "te", "tle", "tl", "tleu", "tcs", "tneg", "tvs", @@ -1442,7 +1442,7 @@ offs_t sparc_disassembler::dasm_tcc(char *buf, offs_t pc, UINT32 op) const } -offs_t sparc_disassembler::dasm_ldst(char *buf, offs_t pc, UINT32 op) const +offs_t sparc_disassembler::dasm_ldst(char *buf, offs_t pc, uint32_t op) const { if (m_version >= 9) { @@ -1582,7 +1582,7 @@ offs_t sparc_disassembler::dasm_ldst(char *buf, offs_t pc, UINT32 op) const } -void sparc_disassembler::dasm_address(char *&output, UINT32 op) const +void sparc_disassembler::dasm_address(char *&output, uint32_t op) const { if (USEIMM) { @@ -1598,7 +1598,7 @@ void sparc_disassembler::dasm_address(char *&output, UINT32 op) const } -void sparc_disassembler::dasm_asi(char *&output, UINT32 op) const +void sparc_disassembler::dasm_asi(char *&output, uint32_t op) const { if (USEIMM) { @@ -1615,7 +1615,7 @@ void sparc_disassembler::dasm_asi(char *&output, UINT32 op) const } -void sparc_disassembler::dasm_asi_comment(char *&output, UINT32 op) const +void sparc_disassembler::dasm_asi_comment(char *&output, uint32_t op) const { if (!USEIMM) { @@ -1626,7 +1626,7 @@ void sparc_disassembler::dasm_asi_comment(char *&output, UINT32 op) const } -void sparc_disassembler::dasm_vis_arg(char *&output, bool &args, vis_op_desc::arg fmt, UINT32 reg) const +void sparc_disassembler::dasm_vis_arg(char *&output, bool &args, vis_op_desc::arg fmt, uint32_t reg) const { switch (fmt) { diff --git a/src/devices/cpu/sparc/sparcdasm.h b/src/devices/cpu/sparc/sparcdasm.h index 1235496d453..5b545325967 100644 --- a/src/devices/cpu/sparc/sparcdasm.h +++ b/src/devices/cpu/sparc/sparcdasm.h @@ -15,11 +15,11 @@ class sparc_debug_state { public: - virtual UINT64 get_reg_r(unsigned index) const = 0; - virtual UINT64 get_translated_pc() const = 0; - virtual UINT8 get_icc() const = 0; - virtual UINT8 get_xcc() const = 0; - virtual UINT8 get_fcc(unsigned index) const = 0; // ?><= + virtual uint64_t get_reg_r(unsigned index) const = 0; + virtual uint64_t get_translated_pc() const = 0; + virtual uint8_t get_icc() const = 0; + virtual uint8_t get_xcc() const = 0; + virtual uint8_t get_fcc(unsigned index) const = 0; // ?><= protected: ~sparc_debug_state() { } @@ -38,7 +38,7 @@ public: const char *name = nullptr; const char *desc = nullptr; }; - typedef std::map asi_desc_map; + typedef std::map asi_desc_map; struct state_reg_desc { @@ -48,7 +48,7 @@ public: const char *read_name = nullptr; const char *write_name = nullptr; }; - typedef std::map state_reg_desc_map; + typedef std::map state_reg_desc_map; struct prftch_desc { @@ -56,7 +56,7 @@ public: prftch_desc(const char *name_) : name(name_) { } const char *name = nullptr; }; - typedef std::map prftch_desc_map; + typedef std::map prftch_desc_map; sparc_disassembler(const sparc_debug_state *state, unsigned version); sparc_disassembler(const sparc_debug_state *state, unsigned version, vis_level vis); @@ -106,13 +106,13 @@ public: } } - offs_t dasm(char *buf, offs_t pc, UINT32 op) const; + offs_t dasm(char *buf, offs_t pc, uint32_t op) const; private: struct branch_desc { - INT32 (*get_disp)(UINT32 op); - const char * (*get_comment)(const sparc_debug_state *state, bool use_cc, offs_t pc, UINT32 op); + int32_t (*get_disp)(uint32_t op); + const char * (*get_comment)(const sparc_debug_state *state, bool use_cc, offs_t pc, uint32_t op); int disp_width; bool use_pred, use_cc; const char *reg_cc[4]; @@ -125,7 +125,7 @@ private: const char *mnemonic; const char *g0_synth; }; - typedef std::map int_op_desc_map; + typedef std::map int_op_desc_map; struct fpop1_desc { @@ -137,7 +137,7 @@ private: bool rd_shift = false; const char *mnemonic = nullptr; }; - typedef std::map fpop1_desc_map; + typedef std::map fpop1_desc_map; struct fpop2_desc { @@ -147,7 +147,7 @@ private: bool shift = false; const char *mnemonic = nullptr; }; - typedef std::map fpop2_desc_map; + typedef std::map fpop2_desc_map; struct ldst_desc { @@ -160,7 +160,7 @@ private: const char *mnemonic = nullptr; const char *g0_synth = nullptr; }; - typedef std::map ldst_desc_map; + typedef std::map ldst_desc_map; struct vis_op_desc { @@ -173,29 +173,29 @@ private: bool collapse = false; const char *mnemonic = nullptr; }; - typedef std::map vis_op_desc_map; + typedef std::map vis_op_desc_map; - offs_t dasm_invalid(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_branch(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_shift(char *buf, offs_t pc, UINT32 op, const char *mnemonic, const char *mnemonicx, const char *mnemonicx0) const; - offs_t dasm_read_state_reg(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_write_state_reg(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_move_cond(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_move_reg_cond(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_fpop1(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_fpop2(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_impdep1(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_jmpl(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_return(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_tcc(char *buf, offs_t pc, UINT32 op) const; - offs_t dasm_ldst(char *buf, offs_t pc, UINT32 op) const; + offs_t dasm_invalid(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_branch(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_shift(char *buf, offs_t pc, uint32_t op, const char *mnemonic, const char *mnemonicx, const char *mnemonicx0) const; + offs_t dasm_read_state_reg(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_write_state_reg(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_move_cond(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_move_reg_cond(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_fpop1(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_fpop2(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_impdep1(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_jmpl(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_return(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_tcc(char *buf, offs_t pc, uint32_t op) const; + offs_t dasm_ldst(char *buf, offs_t pc, uint32_t op) const; - void dasm_address(char *&output, UINT32 op) const; - void dasm_asi(char *&output, UINT32 op) const; - void dasm_asi_comment(char *&output, UINT32 op) const; - void dasm_vis_arg(char *&output, bool &args, vis_op_desc::arg fmt, UINT32 reg) const; + void dasm_address(char *&output, uint32_t op) const; + void dasm_asi(char *&output, uint32_t op) const; + void dasm_asi_comment(char *&output, uint32_t op) const; + void dasm_vis_arg(char *&output, bool &args, vis_op_desc::arg fmt, uint32_t reg) const; - UINT32 freg(UINT32 val, bool shift) const; + uint32_t freg(uint32_t val, bool shift) const; template void add_int_op_desc(const T &desc); template void add_fpop1_desc(const T &desc); diff --git a/src/devices/cpu/sparc/sparcdefs.h b/src/devices/cpu/sparc/sparcdefs.h index e7c1a5b1ab0..823fb3e52f3 100644 --- a/src/devices/cpu/sparc/sparcdefs.h +++ b/src/devices/cpu/sparc/sparcdefs.h @@ -88,18 +88,18 @@ #define OPC ((op >> 5) & 0x1ff) #define OPFLOW ((op >> 5) & 0x3f) -#define DISP30 (INT32(op << 2)) -#define DISP22 (INT32(op << 10) >> 8) -#define DISP19 (INT32(op << 13) >> 11) -#define DISP16 (INT32(((op << 10) & 0xc0000000) | ((op << 16) & 0x3fff0000)) >> 14) +#define DISP30 (int32_t(op << 2)) +#define DISP22 (int32_t(op << 10) >> 8) +#define DISP19 (int32_t(op << 13) >> 11) +#define DISP16 (int32_t(((op << 10) & 0xc0000000) | ((op << 16) & 0x3fff0000)) >> 14) #define IMM22 (op << 10) #define CONST22 (op & 0x3fffff) -#define SIMM13 (INT32(op << 19) >> 19) -#define SIMM11 (INT32(op << 21) >> 21) -#define SIMM10 (INT32(op << 22) >> 22) -#define SIMM8 (INT32(op << 24) >> 24) +#define SIMM13 (int32_t(op << 19) >> 19) +#define SIMM11 (int32_t(op << 21) >> 21) +#define SIMM10 (int32_t(op << 22) >> 22) +#define SIMM8 (int32_t(op << 24) >> 24) #define IMM7 (op & 0x7f) -#define SIMM7 (INT32(op << 25) >> 25) +#define SIMM7 (int32_t(op << 25) >> 25) #define SHCNT32 (op & 31) #define SHCNT64 (op & 63) #define IAMODE (op & 0x7) diff --git a/src/devices/cpu/sparc/sparcv8ops.ipp b/src/devices/cpu/sparc/sparcv8ops.ipp index 1f42c7b0cb2..28149ef6778 100644 --- a/src/devices/cpu/sparc/sparcv8ops.ipp +++ b/src/devices/cpu/sparc/sparcv8ops.ipp @@ -11,7 +11,7 @@ // execute_swap - execute a swap instruction //------------------------------------------------- -void mb86901_device::execute_swap(UINT32 op) +void mb86901_device::execute_swap(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 169, "Appendix C - ISP Descriptions - Atomic Load-Store Unsigned Byte Instructions" (SPARCv8.pdf, pg. 166) @@ -62,8 +62,8 @@ void mb86901_device::execute_swap(UINT32 op) ); */ - UINT32 address = 0; - UINT8 addr_space = 0; + uint32_t address = 0; + uint8_t addr_space = 0; if (SWAP) { address = RS1REG + (USEIMM ? SIMM13 : RS2REG); @@ -88,8 +88,8 @@ void mb86901_device::execute_swap(UINT32 op) } } - UINT32 word = 0; - UINT32 temp = 0; + uint32_t word = 0; + uint32_t temp = 0; if (!m_trap) { temp = RDREG; @@ -134,7 +134,7 @@ void mb86901_device::execute_swap(UINT32 op) // execute_mul - execute a multiply opcode //------------------------------------------------- -void mb86901_device::execute_mul(UINT32 op) +void mb86901_device::execute_mul(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 175, "Appendix C - ISP Descriptions - Multiply Instructions" (SPARCv8.pdf, pg. 172) @@ -154,20 +154,20 @@ void mb86901_device::execute_mul(UINT32 op) ); */ - UINT32 operand2 = (USEIMM ? SIMM13 : RS2REG); + uint32_t operand2 = (USEIMM ? SIMM13 : RS2REG); - UINT32 result = 0; + uint32_t result = 0; if (UMUL || UMULCC) { - UINT64 dresult = (UINT64)RS1REG * (UINT64)operand2; - Y = (UINT32)(dresult >> 32); - result = (UINT32)dresult; + uint64_t dresult = (uint64_t)RS1REG * (uint64_t)operand2; + Y = (uint32_t)(dresult >> 32); + result = (uint32_t)dresult; } else if (SMUL || SMULCC) { - INT64 dresult = (INT64)(INT32)RS1REG * (INT64)(INT32)operand2; - Y = (UINT32)(dresult >> 32); - result = (UINT32)dresult; + int64_t dresult = (int64_t)(int32_t)RS1REG * (int64_t)(int32_t)operand2; + Y = (uint32_t)(dresult >> 32); + result = (uint32_t)dresult; } if (RD != 0) @@ -187,7 +187,7 @@ void mb86901_device::execute_mul(UINT32 op) // execute_div - execute a divide opcode //------------------------------------------------- -void mb86901_device::execute_div(UINT32 op) +void mb86901_device::execute_div(uint32_t op) { /* The SPARC Instruction Manual: Version 8, page 176, "Appendix C - ISP Descriptions - Multiply Instructions" (SPARCv8.pdf, pg. 173) @@ -234,7 +234,7 @@ void mb86901_device::execute_div(UINT32 op) ); */ - UINT32 operand2 = (USEIMM ? SIMM13 : RS2REG); + uint32_t operand2 = (USEIMM ? SIMM13 : RS2REG); if (operand2 == 0) { @@ -243,24 +243,24 @@ void mb86901_device::execute_div(UINT32 op) } else { - UINT32 result = 0; + uint32_t result = 0; bool temp_v = false; - INT64 temp_64bit; + int64_t temp_64bit; if (UDIV || UDIVCC) { - temp_64bit = INT64(UINT64((UINT64(Y) << 32) | UINT64(RS1REG)) / operand2); + temp_64bit = int64_t(uint64_t((uint64_t(Y) << 32) | uint64_t(RS1REG)) / operand2); - result = UINT32(temp_64bit); + result = uint32_t(temp_64bit); temp_v = ((temp_64bit & 0xffffffff00000000) == 0) ? false : true; } else if (SDIV || SDIVCC) { - temp_64bit = INT64(INT64((UINT64(Y) << 32) | UINT64(RS1REG)) / operand2); + temp_64bit = int64_t(int64_t((uint64_t(Y) << 32) | uint64_t(RS1REG)) / operand2); - result = UINT32(temp_64bit); + result = uint32_t(temp_64bit); - UINT64 shifted = UINT64(temp_64bit) >> 31; + uint64_t shifted = uint64_t(temp_64bit) >> 31; temp_v = (shifted == 0 || shifted == 0x1ffffffff) ? false : true; } diff --git a/src/devices/cpu/sparc/ss1fcode.ipp b/src/devices/cpu/sparc/ss1fcode.ipp index bbe6eec23a9..d9457742340 100644 --- a/src/devices/cpu/sparc/ss1fcode.ipp +++ b/src/devices/cpu/sparc/ss1fcode.ipp @@ -14,7 +14,7 @@ void mb86901_device::log_fcodes() if (PC == 0xffef0000) { - UINT32 opcode = read_sized_word(11, REG(5), 2); + uint32_t opcode = read_sized_word(11, REG(5), 2); if (!(REG(5) & 2)) { opcode >>= 16; @@ -33,10 +33,10 @@ void mb86901_device::log_fcodes() //{ // m_log_fcodes = false; //} - UINT32 handler_base = opcode << 2; + uint32_t handler_base = opcode << 2; handler_base += REG(2); // l1 = r2 + opcode << 2 - UINT32 entry_point = read_sized_word(11, handler_base, 2); + uint32_t entry_point = read_sized_word(11, handler_base, 2); if (!(handler_base & 2)) { entry_point >>= 16; @@ -59,7 +59,7 @@ void mb86901_device::log_fcodes() void mb86901_device::indent() { - UINT32 program_depth = (0xffeff000 - (REG(6) - 4)) / 4; + uint32_t program_depth = (0xffeff000 - (REG(6) - 4)) / 4; if (program_depth < 15) return; @@ -71,7 +71,7 @@ void mb86901_device::indent() } } -void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 handler_base, UINT32 entry_point, UINT32 stack) +void mb86901_device::disassemble_ss1_fcode(uint32_t r5, uint32_t opcode, uint32_t handler_base, uint32_t entry_point, uint32_t stack) { std::string opdesc = m_ss1_fcode_table[opcode]; if (opdesc.length() == 0) @@ -82,11 +82,11 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand indent(); printf("Data Return\n"); indent(); printf("-------- --------\n"); - UINT32 data_stack[8]; - UINT32 return_stack[8]; + uint32_t data_stack[8]; + uint32_t return_stack[8]; - UINT32 data_entries = (0xffefebe4 - (stack - 4)) / 4; - UINT32 return_entries = (0xffeff000 - (REG(6) - 4)) / 4; + uint32_t data_entries = (0xffefebe4 - (stack - 4)) / 4; + uint32_t return_entries = (0xffeff000 - (REG(6) - 4)) / 4; data_stack[0] = REG(4); for (int i = 0; i < data_entries && i < 7; i++) @@ -100,7 +100,7 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand return_stack[i] = read_sized_word(11, REG(6) + i * 4, 4); } - UINT32 total_lines = 0; + uint32_t total_lines = 0; if (data_entries > total_lines) total_lines = data_entries; @@ -124,12 +124,12 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand printf("\n"); } - UINT32 base = 0xffe87954; - UINT32 exact_op = (r5 - base) / 4; - UINT32 base_op = exact_op; + uint32_t base = 0xffe87954; + uint32_t exact_op = (r5 - base) / 4; + uint32_t base_op = exact_op; while (m_ss1_fcode_table[base_op].length() == 0) base_op--; - UINT32 dist = (exact_op - base_op) * 4; + uint32_t dist = (exact_op - base_op) * 4; if (entry_point == 0xffe87964) { @@ -143,8 +143,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand } else if (entry_point == 0xffe8799c) { - UINT32 address = handler_base + 2; - UINT32 half = read_sized_word(11, address, 2); + uint32_t address = handler_base + 2; + uint32_t half = read_sized_word(11, address, 2); if (!(address & 2)) half >>= 16; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; add halfword at handler_base+2 (%04x) to VM base pointer (%08x) and push onto stack (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), half, REG(3), REG(3) + half); @@ -152,34 +152,34 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand } else if (entry_point == 0xffe879e4) { - UINT32 address = handler_base + 2; - UINT32 half0 = read_sized_word(11, address, 2); + uint32_t address = handler_base + 2; + uint32_t half0 = read_sized_word(11, address, 2); if (address & 2) half0 <<= 16; address = handler_base + 4; - UINT32 half1 = read_sized_word(11, address, 2); + uint32_t half1 = read_sized_word(11, address, 2); if (!(address & 2)) half1 >>= 16; - UINT32 value = half0 | half1; + uint32_t value = half0 | half1; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; push immediate word from handler table (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value); indent(); printf(" // data stack now %08x (%d words deep)\n", stack - 4, (0xffefebe4 - (stack - 4)) / 4); } else if (entry_point == 0xffe879c4) { - UINT32 address = handler_base + 2; - UINT32 l0 = read_sized_word(11, address, 2); + uint32_t address = handler_base + 2; + uint32_t l0 = read_sized_word(11, address, 2); if (!(address & 2)) l0 >>= 16; address = REG(3) + l0; - UINT32 handler_base_2 = read_sized_word(11, address, 2); + uint32_t handler_base_2 = read_sized_word(11, address, 2); if (!(address & 2)) handler_base_2 >>= 16; address = REG(2) + (handler_base_2 << 2); - UINT32 l0_2 = read_sized_word(11, address, 2); + uint32_t l0_2 = read_sized_word(11, address, 2); if (!(address & 2)) l0_2 >>= 16; - UINT32 dest = REG(2) + (l0_2 << 2); + uint32_t dest = REG(2) + (l0_2 << 2); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; SPARC branch to %08x, calcs: g2(%08x) + halfword[g2(%04x) + (halfword[g3(%08x) + halfword[entry_point(%04x) + 2](%04x)](%04x) << 2)](%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), dest, REG(2), REG(2), REG(3), handler_base, l0, handler_base_2, l0_2); indent(); printf(" // target func: %08x\n", l0_2 << 2); @@ -196,15 +196,15 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand } else if (entry_point == 0xffe8c838) { - UINT32 address = handler_base + 2; - UINT32 half0 = read_sized_word(11, address, 2); + uint32_t address = handler_base + 2; + uint32_t half0 = read_sized_word(11, address, 2); if (address & 2) half0 <<= 16; address = handler_base + 4; - UINT32 half1 = read_sized_word(11, address, 2); + uint32_t half1 = read_sized_word(11, address, 2); if (!(address & 2)) half1 >>= 16; - UINT32 value = half0 | half1; + uint32_t value = half0 | half1; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; add 32-bit word (%08x) from handler table to top of stack (%08x + %08x = %08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value, REG(4), value, REG(4) + value); } @@ -214,15 +214,15 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand { case 0x003f: { - UINT32 address = r5 + 2; - UINT32 half0 = read_sized_word(11, address, 2); + uint32_t address = r5 + 2; + uint32_t half0 = read_sized_word(11, address, 2); if (address & 2) half0 <<= 16; address = r5 + 4; - UINT32 half1 = read_sized_word(11, address, 2); + uint32_t half1 = read_sized_word(11, address, 2); if (!(address & 2)) half1 >>= 16; - UINT32 value = half0 | half1; + uint32_t value = half0 | half1; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; push immediate word from instructions (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value); indent(); printf(" // data stack now %08x (%d words deep)\n", stack - 4, (0xffefebe4 - (stack - 4)) / 4); @@ -231,8 +231,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x004b: { - UINT32 address = r5 + 2; - UINT32 value = read_sized_word(11, address, 2); + uint32_t address = r5 + 2; + uint32_t value = read_sized_word(11, address, 2); if (!(address & 2)) value >>= 16; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; push immediate halfword from instructions (%04x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value); @@ -242,8 +242,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0055: { - UINT32 address = REG(4); - UINT32 new_opcode = read_sized_word(11, address, 2); + uint32_t address = REG(4); + uint32_t new_opcode = read_sized_word(11, address, 2); if (!(address & 2)) new_opcode >>= 16; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; pop stack top (%08x) as an opcode to execute\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), REG(4)); @@ -267,8 +267,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x05f: { - UINT32 address = r5 + 2; - UINT32 pc_offset = read_sized_word(11, address, 2); + uint32_t address = r5 + 2; + uint32_t pc_offset = read_sized_word(11, address, 2); if (!(address & 2)) pc_offset >>= 16; // advance program counter by amount specified as parameter @@ -278,11 +278,11 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0066: { - UINT32 address = r5 + 2; - UINT32 offset = read_sized_word(11, address, 2); + uint32_t address = r5 + 2; + uint32_t offset = read_sized_word(11, address, 2); if (!(address & 2)) offset >>= 16; - UINT32 target = r5 + 2 + offset; + uint32_t target = r5 + 2 + offset; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; pop data stack top (%08x) and if zero, jump to %08x\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), read_sized_word(11, REG(7), 4), target); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); @@ -291,15 +291,15 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x007b: { - UINT32 r4 = REG(4); - UINT32 value = read_sized_word(11, REG(6), 4); - UINT32 result = value + r4; + uint32_t r4 = REG(4); + uint32_t value = read_sized_word(11, REG(6), 4); + uint32_t result = value + r4; bool arithmetic_overflow = ((BIT31(value) && BIT31(r4) && !BIT31(result)) || (!BIT31(value) && !BIT31(r4) && BIT31(result))); - UINT32 address = r5 + 2; - UINT32 offset = read_sized_word(11, address, 2); + uint32_t address = r5 + 2; + uint32_t offset = read_sized_word(11, address, 2); if (!(address & 2)) offset >>= 16; - UINT32 target = r5 + 2 + offset; + uint32_t target = r5 + 2 + offset; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; pop data stack top and add to program stack top (%08x = %08x + %08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), result, value, r4); indent(); printf(" // if no addition overflow, jump to %08x\n", target); @@ -313,19 +313,19 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0099: { - UINT32 handler_base_2 = REG(4); + uint32_t handler_base_2 = REG(4); - UINT32 address = stack; - UINT32 l0_2 = read_sized_word(11, address, 4); + uint32_t address = stack; + uint32_t l0_2 = read_sized_word(11, address, 4); address = stack + 4; - UINT32 popped_g4 = read_sized_word(11, address, 4); + uint32_t popped_g4 = read_sized_word(11, address, 4); address = r5 + 2; - UINT32 offset = read_sized_word(11, address, 2); + uint32_t offset = read_sized_word(11, address, 2); if (!(address & 2)) offset >>= 16; - UINT32 target = r5 + 2 + offset; + uint32_t target = r5 + 2 + offset; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; branch relative to %08x if data stack second (%08x) == data stack top (%08x), pop_data result (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), target, l0_2, handler_base_2, popped_g4); if (handler_base_2 == l0_2) @@ -347,8 +347,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x00a4: { - UINT32 word0 = read_sized_word(11, REG(6), 4); - UINT32 word1 = read_sized_word(11, REG(6) + 4, 4); + uint32_t word0 = read_sized_word(11, REG(6), 4); + uint32_t word1 = read_sized_word(11, REG(6) + 4, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; push result (%08x) to data stack, add the top two values on the program stack, store in result (%08x = %08x + %08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), REG(4), word0 + word1, word0, word1); indent(); printf(" // data stack now %08x (%d words deep)\n", stack - 4, (0xffefebe4 - (stack - 4)) / 4); break; @@ -356,8 +356,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0121: { - UINT32 address = stack; - UINT32 word = read_sized_word(11, address, 4); + uint32_t address = stack; + uint32_t word = read_sized_word(11, address, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; logical-AND result with data stack pop, store in result (%08x = %08x & %08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), word & REG(4), word, REG(4)); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); break; @@ -365,8 +365,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0128: { - UINT32 address = stack; - UINT32 word = read_sized_word(11, address, 4); + uint32_t address = stack; + uint32_t word = read_sized_word(11, address, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; logical-OR result with data stack pop, store in result: %08x = %08x & %08x\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), word | REG(4), word, REG(4)); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); break; @@ -378,8 +378,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x014f: { - UINT32 address = stack; - UINT32 word = read_sized_word(11, address, 4); + uint32_t address = stack; + uint32_t word = read_sized_word(11, address, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; add result to data stack pop, store in result: %08x = %08x + %08x\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), word + REG(4), word, REG(4)); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); break; @@ -387,8 +387,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0155: { - UINT32 address = stack; - UINT32 word = read_sized_word(11, address, 4); + uint32_t address = stack; + uint32_t word = read_sized_word(11, address, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; subtract result from data stack pop, store in result: %08x = %08x - %08x\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), word - REG(4), word, REG(4)); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); break; @@ -419,15 +419,15 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x01c0: case 0x01c7: { - UINT32 address = REG(6); - UINT32 half0 = read_sized_word(11, address, 2); + uint32_t address = REG(6); + uint32_t half0 = read_sized_word(11, address, 2); if (address & 2) half0 <<= 16; address = REG(6) + 2; - UINT32 half1 = read_sized_word(11, address, 2); + uint32_t half1 = read_sized_word(11, address, 2); if (!(address & 2)) half1 >>= 16; - UINT32 value = half0 | half1; + uint32_t value = half0 | half1; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; return (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value); indent(); printf(" // program stack now %08x (%d words deep)\n", REG(6) + 4, (0xffeff000 - (REG(6) + 4)) / 4); @@ -450,7 +450,7 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0217: { - UINT32 value = read_sized_word(11, stack, 4); + uint32_t value = read_sized_word(11, stack, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; if pop_data (%08x) >= result (%08x), set result to 0, otherwise -1 (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value, REG(4), (value >= REG(4)) ? 0 : ~0); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); break; @@ -458,7 +458,7 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x022b: { - UINT32 value = read_sized_word(11, stack, 4); + uint32_t value = read_sized_word(11, stack, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; if pop_data (%08x) != result (%08x), set result to 0, otherwise -1 (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value, REG(4), (value != REG(4)) ? 0 : ~0); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); break; @@ -466,7 +466,7 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0236: { - UINT32 value = read_sized_word(11, stack, 4); + uint32_t value = read_sized_word(11, stack, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; if pop_data (%08x) == result (%08x), set result to 0, otherwise -1 (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value, REG(4), (value == REG(4)) ? 0 : ~0); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); break; @@ -474,7 +474,7 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x026d: { - UINT32 value = read_sized_word(11, stack, 4); + uint32_t value = read_sized_word(11, stack, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; if pop_data (%08x) < result (%08x), set result to 0, otherwise -1 (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value, REG(4), (value < REG(4)) ? 0 : ~0); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); break; @@ -482,7 +482,7 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0278: { - UINT32 value = read_sized_word(11, stack, 4); + uint32_t value = read_sized_word(11, stack, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; if pop_data (%08x) > result (%08x), set result to 0, otherwise -1 (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value, REG(4), (value > REG(4)) ? 0 : ~0); indent(); printf(" // data stack now %08x (%d words deep)\n", stack + 4, (0xffefebe4 - (stack + 4)) / 4); break; @@ -508,8 +508,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x029d: { - UINT32 top = read_sized_word(11, stack, 4); - UINT32 next = read_sized_word(11, stack + 4, 4); + uint32_t top = read_sized_word(11, stack, 4); + uint32_t next = read_sized_word(11, stack + 4, 4); indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; swap the top two values of the data stack (%08x <-> %08x), exchange second value with result (%08x <-> %08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), top, next, REG(4), next); break; } @@ -543,15 +543,15 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0334: { - UINT32 address = REG(4); - UINT32 half0 = read_sized_word(11, address, 2); + uint32_t address = REG(4); + uint32_t half0 = read_sized_word(11, address, 2); if (address & 2) half0 <<= 16; address = REG(4) + 2; - UINT32 half1 = read_sized_word(11, address, 2); + uint32_t half1 = read_sized_word(11, address, 2); if (!(address & 2)) half1 >>= 16; - UINT32 value = half0 | half1; + uint32_t value = half0 | half1; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; load result with word (%08x) at result address (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value, REG(4)); break; @@ -559,8 +559,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0349: { - UINT32 address = REG(4); - UINT32 value = read_sized_word(11, address, 2); + uint32_t address = REG(4); + uint32_t value = read_sized_word(11, address, 2); if (!(address & 2)) value >>= 16; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; load result with unsigned halfword (%04x) at result address (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value, REG(4)); break; @@ -568,8 +568,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x0353: { - UINT32 address = REG(4); - UINT32 value = read_sized_word(11, address, 1); + uint32_t address = REG(4); + uint32_t value = read_sized_word(11, address, 1); value >>= (3 - (address & 3)) * 8; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; load result with unsigned byte (%02x) at result address (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), value, REG(4)); break; @@ -601,8 +601,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x04ff: { - UINT32 address = r5 + 2; - UINT32 next_op = read_sized_word(11, address, 2); + uint32_t address = r5 + 2; + uint32_t next_op = read_sized_word(11, address, 2); if (!(address & 2)) next_op >>= 16; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; push_data result (%08x), load result with entry_point for next opcode (%08x = %08x + %08x, op %04x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), REG(4), REG(2) + (next_op << 2), REG(2), next_op << 2, next_op); @@ -612,9 +612,9 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x050a: { - UINT32 byte_addr = read_sized_word(11, REG(6), 4); - UINT32 address_shift = (3 - (byte_addr & 3)) * 8; - UINT8 value = read_sized_word(11, byte_addr, 1) >> address_shift; + uint32_t byte_addr = read_sized_word(11, REG(6), 4); + uint32_t address_shift = (3 - (byte_addr & 3)) * 8; + uint8_t value = read_sized_word(11, byte_addr, 1) >> address_shift; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; push result (%08x) onto data stack\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), REG(4)); indent(); printf(" // load result with byte pointed to by top of program stack (%02x)\n", value); indent(); printf(" // push address of next byte (%08x) onto data stack\n", byte_addr + 1); @@ -626,8 +626,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x05ca: { // - UINT32 address = REG(4); - UINT32 g2_offset = read_sized_word(11, address, 2); + uint32_t address = REG(4); + uint32_t g2_offset = read_sized_word(11, address, 2); if (!(address & 2)) g2_offset >>= 16; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; add halfword at address in result (%08x) to forth table base pointer (%08x) and store in result (%08x = %08x + %08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), address, REG(2), REG(2) + g2_offset, REG(2), g2_offset); @@ -636,8 +636,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x05e6: { - UINT32 address = REG(4); - UINT32 next_op = read_sized_word(11, address, 2); + uint32_t address = REG(4); + uint32_t next_op = read_sized_word(11, address, 2); if (!(address & 2)) next_op >>= 16; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; load result with entry_point for opcode (%08x = %08x + %08x, op %04x) pointed to by result (%08x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), REG(2) + (next_op << 2), REG(2), next_op << 2, next_op, REG(4)); @@ -647,8 +647,8 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x05ee: case 0x05ef: { - UINT32 stack_top = read_sized_word(11, stack, 4); - UINT32 new_opcode = (stack_top - REG(2)) >> 2; + uint32_t stack_top = read_sized_word(11, stack, 4); + uint32_t new_opcode = (stack_top - REG(2)) >> 2; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; pop word (%08x) from the data stack, turn it into a 16-bit opcode (%04x)\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), stack_top, new_opcode); indent(); printf(" // store the opcode at the address contained in the result (%08x)\n", REG(4)); indent(); printf(" // pop word from the data stack into to the result (%08x)\n", read_sized_word(11, stack + 4, 4)); @@ -692,12 +692,12 @@ void mb86901_device::disassemble_ss1_fcode(UINT32 r5, UINT32 opcode, UINT32 hand case 0x4181: { - UINT32 address = handler_base + 2; - UINT32 g3_offset = read_sized_word(11, address, 2); + uint32_t address = handler_base + 2; + uint32_t g3_offset = read_sized_word(11, address, 2); if (!(address & 2)) g3_offset >>= 16; address = REG(3) + g3_offset; - UINT32 new_result = read_sized_word(11, address, 2); + uint32_t new_result = read_sized_word(11, address, 2); if (!(address & 2)) new_result >>= 16; indent(); printf("Opcode at %08x (%04x + %x): %04x, entry is at %08x // %s ; push result (%08x) to data stack, load halfword (%04x) from handler table\n", r5, base_op, dist, opcode, entry_point, opdesc.c_str(), REG(4), g3_offset); diff --git a/src/devices/cpu/spc700/spc700.cpp b/src/devices/cpu/spc700/spc700.cpp index c84e5d56a3c..7d7468f8d9a 100644 --- a/src/devices/cpu/spc700/spc700.cpp +++ b/src/devices/cpu/spc700/spc700.cpp @@ -219,7 +219,7 @@ static inline int MAKE_INT_8(int A) {return (A & 0x80) ? A | ~0xff : A & 0xff;} const device_type SPC700 = &device_creator; -spc700_device::spc700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +spc700_device::spc700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SPC700, "SPC700", tag, owner, clock, "spc700", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0) , m_a(0) @@ -242,38 +242,38 @@ spc700_device::spc700_device(const machine_config &mconfig, const char *tag, dev #define CLK_ALL() CLOCKS = 0 -UINT32 spc700_device::read_8_normal(UINT32 address) +uint32_t spc700_device::read_8_normal(uint32_t address) { address = MAKE_UINT_16(address); return spc700_read_8(address); } -UINT32 spc700_device::read_8_immediate(UINT32 address) +uint32_t spc700_device::read_8_immediate(uint32_t address) { address = MAKE_UINT_16(address); return spc700_read_8_immediate(address); } -UINT32 spc700_device::read_8_instruction(UINT32 address) +uint32_t spc700_device::read_8_instruction(uint32_t address) { address = MAKE_UINT_16(address); return spc700_read_instruction(address); } -UINT32 spc700_device::read_8_direct(UINT32 address) +uint32_t spc700_device::read_8_direct(uint32_t address) { address = MAKE_UINT_8(address) | FLAG_P; return spc700_read_8_direct(address); } -void spc700_device::write_8_normal(UINT32 address, UINT32 value) +void spc700_device::write_8_normal(uint32_t address, uint32_t value) { address = MAKE_UINT_16(address); value = MAKE_UINT_8(value); spc700_write_8(address, value); } -void spc700_device::write_8_direct(UINT32 address, UINT32 value) +void spc700_device::write_8_direct(uint32_t address, uint32_t value) { address = MAKE_UINT_8(address) | FLAG_P; value = MAKE_UINT_8(value); @@ -281,22 +281,22 @@ void spc700_device::write_8_direct(UINT32 address, UINT32 value) } -UINT32 spc700_device::read_16_normal(UINT32 address) +uint32_t spc700_device::read_16_normal(uint32_t address) { return read_8_normal(address) | (read_8_normal(address+1)<<8); } -UINT32 spc700_device::read_16_immediate(UINT32 address) +uint32_t spc700_device::read_16_immediate(uint32_t address) { return read_8_immediate(address) | (read_8_immediate(address+1)<<8); } -UINT32 spc700_device::read_16_direct(UINT32 address) +uint32_t spc700_device::read_16_direct(uint32_t address) { return read_8_direct(address) | (read_8_direct(address+1)<<8); } -void spc700_device::write_16_direct(UINT32 address, UINT32 value) +void spc700_device::write_16_direct(uint32_t address, uint32_t value) { write_8_direct(address, value); write_8_direct(address+1, value>>8); @@ -399,31 +399,31 @@ void spc700_device::write_16_direct(UINT32 address, UINT32 value) #define OPER_16_YI() read_16_YI(EA_YI()) /* Effective Address Calculations */ -UINT32 spc700_device::EA_IMM() {return REG_PC++;} -UINT32 spc700_device::EA_IMM16() {REG_PC += 2; return REG_PC-2;} -UINT32 spc700_device::EA_ABS() {return OPER_16_IMM();} -UINT32 spc700_device::EA_ABX() {return EA_ABS() + REG_X;} -UINT32 spc700_device::EA_ABY() {return EA_ABS() + REG_Y;} -UINT32 spc700_device::EA_AXI() {return OPER_16_ABX();} -UINT32 spc700_device::EA_DP() {return OPER_8_IMM();} -UINT32 spc700_device::EA_DPX() {return (EA_DP() + REG_X)&0xff;} -UINT32 spc700_device::EA_DPY() {return (EA_DP() + REG_Y)&0xff;} -UINT32 spc700_device::EA_DXI() {return OPER_16_DPX();} -UINT32 spc700_device::EA_DIY() {UINT32 addr = OPER_16_DP(); if((addr&0xff00) != ((addr+REG_Y)&0xff00)) CLK(1); return addr + REG_Y;} -UINT32 spc700_device::EA_XI() {return REG_X;} -UINT32 spc700_device::EA_XII() {UINT32 val = REG_X;REG_X = MAKE_UINT_8(REG_X+1);return val;} -UINT32 spc700_device::EA_YI() {return REG_Y;} +uint32_t spc700_device::EA_IMM() {return REG_PC++;} +uint32_t spc700_device::EA_IMM16() {REG_PC += 2; return REG_PC-2;} +uint32_t spc700_device::EA_ABS() {return OPER_16_IMM();} +uint32_t spc700_device::EA_ABX() {return EA_ABS() + REG_X;} +uint32_t spc700_device::EA_ABY() {return EA_ABS() + REG_Y;} +uint32_t spc700_device::EA_AXI() {return OPER_16_ABX();} +uint32_t spc700_device::EA_DP() {return OPER_8_IMM();} +uint32_t spc700_device::EA_DPX() {return (EA_DP() + REG_X)&0xff;} +uint32_t spc700_device::EA_DPY() {return (EA_DP() + REG_Y)&0xff;} +uint32_t spc700_device::EA_DXI() {return OPER_16_DPX();} +uint32_t spc700_device::EA_DIY() {uint32_t addr = OPER_16_DP(); if((addr&0xff00) != ((addr+REG_Y)&0xff00)) CLK(1); return addr + REG_Y;} +uint32_t spc700_device::EA_XI() {return REG_X;} +uint32_t spc700_device::EA_XII() {uint32_t val = REG_X;REG_X = MAKE_UINT_8(REG_X+1);return val;} +uint32_t spc700_device::EA_YI() {return REG_Y;} /* Change the Program Counter */ -void spc700_device::JUMP(UINT32 address) +void spc700_device::JUMP(uint32_t address) { REG_PC = address; spc700_jumping(REG_PC); } -void spc700_device::BRANCH(UINT32 offset) +void spc700_device::BRANCH(uint32_t offset) { REG_PC = MAKE_UINT_16(REG_PC + MAKE_INT_8(offset)); spc700_branching(REG_PC); @@ -432,7 +432,7 @@ void spc700_device::BRANCH(UINT32 offset) #define GET_REG_YA() (REG_A | (REG_Y<<8)) -void spc700_device::SET_REG_YA(UINT32 value) +void spc700_device::SET_REG_YA(uint32_t value) { REG_A = MAKE_UINT_8(value); REG_Y = MAKE_UINT_8(value>>8); @@ -450,7 +450,7 @@ void spc700_device::SET_REG_YA(UINT32 value) CFLAG_AS_1()) /* Set the Process Status Register */ -void spc700_device::SET_REG_P(UINT32 value) +void spc700_device::SET_REG_P(uint32_t value) { FLAG_N = (value & 0x80); FLAG_Z = !(value & 2); @@ -463,27 +463,27 @@ void spc700_device::SET_REG_P(UINT32 value) } /* Push/Pull data to/from the stack */ -void spc700_device::PUSH_8(UINT32 value) +void spc700_device::PUSH_8(uint32_t value) { write_8_STK(REG_S+STACK_PAGE, value); REG_S = MAKE_UINT_8(REG_S - 1); } -UINT32 spc700_device::PULL_8() +uint32_t spc700_device::PULL_8() { REG_S = MAKE_UINT_8(REG_S + 1); return read_8_STK(REG_S+STACK_PAGE); } -void spc700_device::PUSH_16(UINT32 value) +void spc700_device::PUSH_16(uint32_t value) { PUSH_8(value>>8); PUSH_8(value); } -UINT32 spc700_device::PULL_16() +uint32_t spc700_device::PULL_16() { - UINT32 value = PULL_8(); + uint32_t value = PULL_8(); return value | (PULL_8()<<8); } @@ -499,7 +499,7 @@ void spc700_device::SERVICE_IRQ() } -void spc700_device::SET_FLAG_I(UINT32 value) +void spc700_device::SET_FLAG_I(uint32_t value) { FLAG_I = value & IFLAG_SET; #if !SPC700_OPTIMIZE_SNES @@ -517,7 +517,7 @@ void spc700_device::SET_FLAG_I(UINT32 value) FLAG_C = (m_spc_int16 > 0xff) ? CFLAG_SET : 0; \ FLAG_V = (~((A) ^ (B))) & (((A) ^ m_spc_int16) & 0x80); \ FLAG_H = (((m_spc_int16 & 0x0f) - TMP1) & 0x10) >> 1; \ - FLAG_NZ = (UINT8)m_spc_int16 + FLAG_NZ = (uint8_t)m_spc_int16 /* Add With Carry */ @@ -525,7 +525,7 @@ void spc700_device::SET_FLAG_I(UINT32 value) CLK(BCLK); \ SRC = OPER_8_##MODE(); \ SUBOP_ADC(SRC, REG_A); \ - REG_A = (UINT8)m_spc_int16; + REG_A = (uint8_t)m_spc_int16; /* Add With Carry to memory */ @@ -534,7 +534,7 @@ void spc700_device::SET_FLAG_I(UINT32 value) SRC = OPER_8_##SMODE(); \ DST = EA_##DMODE(); \ SUBOP_ADC(SRC, read_8_##DMODE(DST)); \ - write_8_##DMODE(DST, (UINT8)m_spc_int16) + write_8_##DMODE(DST, (uint8_t)m_spc_int16) /* Add word */ #define OP_ADDW(BCLK) \ @@ -548,7 +548,7 @@ void spc700_device::SET_FLAG_I(UINT32 value) FLAG_C = (TMP3 > 0xff) ? CFLAG_SET : 0; \ FLAG_H = ((unsigned) ((((DST) >> 8) & 0x0F) + \ (((SRC) >> 8) & 0x0F) + TMP2)) > 0x0F ? HFLAG_SET : 0; \ - FLAG_V = (~((DST) ^ (SRC)) & ((SRC) ^ (UINT16) m_spc_int16) & 0x8000) ? VFLAG_SET : 0; \ + FLAG_V = (~((DST) ^ (SRC)) & ((SRC) ^ (uint16_t) m_spc_int16) & 0x8000) ? VFLAG_SET : 0; \ FLAG_Z = (m_spc_int16 != 0); \ FLAG_N = (m_spc_int16>>8); \ SET_REG_YA(m_spc_int16); @@ -1101,7 +1101,7 @@ void spc700_device::SET_FLAG_I(UINT32 value) TMP2 = REG_A - SRC - (CFLAG_AS_1() ^ 1); \ SUBOP_ADC(REG_A, ~SRC); \ FLAG_C = (TMP2 <= 0xff) ? CFLAG_SET : 0; \ - REG_A = (UINT8)m_spc_int16; + REG_A = (uint8_t)m_spc_int16; /* Subtract With Carry to memory */ #define OP_SBCM(BCLK, SMODE, DMODE) \ @@ -1112,7 +1112,7 @@ void spc700_device::SET_FLAG_I(UINT32 value) TMP2 = TMP3 - SRC - (CFLAG_AS_1() ^ 1); \ SUBOP_ADC(~SRC, TMP3); \ FLAG_C = (TMP2 <= 0xff) ? CFLAG_SET : 0; \ - write_8_##DMODE(DST, (UINT8)m_spc_int16) + write_8_##DMODE(DST, (uint8_t)m_spc_int16) /* Set Carry flag */ #define OP_SETC(BCLK) \ @@ -1155,7 +1155,7 @@ void spc700_device::SET_FLAG_I(UINT32 value) FLAG_C = (TMP3 <= 0xff) ? CFLAG_SET : 0; \ FLAG_H = ((unsigned) ((((DST) >> 8) & 0x0F) - \ (((SRC) >> 8) & 0x0F) - TMP2)) > 0x0F ? 0: HFLAG_SET; \ - FLAG_V = (((DST) ^ (SRC)) & ((DST) ^ (UINT16) m_spc_int16) & 0x8000) ? VFLAG_SET : 0; \ + FLAG_V = (((DST) ^ (SRC)) & ((DST) ^ (uint16_t) m_spc_int16) & 0x8000) ? VFLAG_SET : 0; \ FLAG_Z = (m_spc_int16 != 0); \ FLAG_N = (m_spc_int16>>8); \ SET_REG_YA(m_spc_int16); @@ -1344,7 +1344,7 @@ void spc700_device::execute_set_input( int inptnum, int state ) #include "spc700ds.h" -offs_t spc700_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t spc700_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(spc700)(this, buffer, pc, oprom, opram, options); } diff --git a/src/devices/cpu/spc700/spc700.h b/src/devices/cpu/spc700/spc700.h index 30b9b2ccdf3..948e4d5e27c 100644 --- a/src/devices/cpu/spc700/spc700.h +++ b/src/devices/cpu/spc700/spc700.h @@ -10,7 +10,7 @@ class spc700_device : public cpu_device { public: // construction/destruction - spc700_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + spc700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -18,9 +18,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 2; } - virtual UINT32 execute_max_cycles() const override { return 8; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 2; } + virtual uint32_t execute_max_cycles() const override { return 8; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -33,78 +33,78 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 3; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 3; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; - UINT32 m_a; /* Accumulator */ - UINT32 m_x; /* Index Register X */ - UINT32 m_y; /* Index Register Y */ - UINT32 m_s; /* Stack Pointer */ - UINT32 m_pc; /* Program Counter */ - UINT32 m_ppc; /* Previous Program Counter */ - UINT32 m_flag_n; /* Negative Flag */ - UINT32 m_flag_z; /* Zero flag */ - UINT32 m_flag_v; /* Overflow Flag */ - UINT32 m_flag_p; /* Direct Page Flag */ - UINT32 m_flag_b; /* BRK Instruction Flag */ - UINT32 m_flag_h; /* Half-carry Flag */ - UINT32 m_flag_i; /* Interrupt Mask Flag */ - UINT32 m_flag_c; /* Carry Flag */ - UINT32 m_line_irq; /* Status of the IRQ line */ - UINT32 m_line_nmi; /* Status of the NMI line */ - UINT32 m_line_rst; /* Status of the RESET line */ - UINT32 m_ir; /* Instruction Register */ + uint32_t m_a; /* Accumulator */ + uint32_t m_x; /* Index Register X */ + uint32_t m_y; /* Index Register Y */ + uint32_t m_s; /* Stack Pointer */ + uint32_t m_pc; /* Program Counter */ + uint32_t m_ppc; /* Previous Program Counter */ + uint32_t m_flag_n; /* Negative Flag */ + uint32_t m_flag_z; /* Zero flag */ + uint32_t m_flag_v; /* Overflow Flag */ + uint32_t m_flag_p; /* Direct Page Flag */ + uint32_t m_flag_b; /* BRK Instruction Flag */ + uint32_t m_flag_h; /* Half-carry Flag */ + uint32_t m_flag_i; /* Interrupt Mask Flag */ + uint32_t m_flag_c; /* Carry Flag */ + uint32_t m_line_irq; /* Status of the IRQ line */ + uint32_t m_line_nmi; /* Status of the NMI line */ + uint32_t m_line_rst; /* Status of the RESET line */ + uint32_t m_ir; /* Instruction Register */ address_space *m_program; - UINT32 m_stopped; /* stopped status */ + uint32_t m_stopped; /* stopped status */ int m_ICount; - UINT32 m_source; - UINT32 m_destination; - UINT32 m_temp1; - UINT32 m_temp2; - UINT32 m_temp3; + uint32_t m_source; + uint32_t m_destination; + uint32_t m_temp1; + uint32_t m_temp2; + uint32_t m_temp3; short m_spc_int16; int m_spc_int32; - UINT32 m_debugger_temp; - - inline UINT32 read_8_normal(UINT32 address); - inline UINT32 read_8_immediate(UINT32 address); - inline UINT32 read_8_instruction(UINT32 address); - inline UINT32 read_8_direct(UINT32 address); - inline void write_8_normal(UINT32 address, UINT32 value); - inline void write_8_direct(UINT32 address, UINT32 value); - inline UINT32 read_16_normal(UINT32 address); - inline UINT32 read_16_immediate(UINT32 address); - inline UINT32 read_16_direct(UINT32 address); - inline void write_16_direct(UINT32 address, UINT32 value); - inline UINT32 EA_IMM(); - inline UINT32 EA_IMM16(); - inline UINT32 EA_ABS(); - inline UINT32 EA_ABX(); - inline UINT32 EA_ABY(); - inline UINT32 EA_AXI(); - inline UINT32 EA_DP(); - inline UINT32 EA_DPX(); - inline UINT32 EA_DPY(); - inline UINT32 EA_DXI(); - inline UINT32 EA_DIY(); - inline UINT32 EA_XI(); - inline UINT32 EA_XII(); - inline UINT32 EA_YI(); - inline void JUMP(UINT32 address); - inline void BRANCH(UINT32 offset); - inline void SET_REG_YA(UINT32 value); - inline void SET_REG_P(UINT32 value); - inline void PUSH_8(UINT32 value); - inline UINT32 PULL_8(); - inline void PUSH_16(UINT32 value); - inline UINT32 PULL_16(); + uint32_t m_debugger_temp; + + inline uint32_t read_8_normal(uint32_t address); + inline uint32_t read_8_immediate(uint32_t address); + inline uint32_t read_8_instruction(uint32_t address); + inline uint32_t read_8_direct(uint32_t address); + inline void write_8_normal(uint32_t address, uint32_t value); + inline void write_8_direct(uint32_t address, uint32_t value); + inline uint32_t read_16_normal(uint32_t address); + inline uint32_t read_16_immediate(uint32_t address); + inline uint32_t read_16_direct(uint32_t address); + inline void write_16_direct(uint32_t address, uint32_t value); + inline uint32_t EA_IMM(); + inline uint32_t EA_IMM16(); + inline uint32_t EA_ABS(); + inline uint32_t EA_ABX(); + inline uint32_t EA_ABY(); + inline uint32_t EA_AXI(); + inline uint32_t EA_DP(); + inline uint32_t EA_DPX(); + inline uint32_t EA_DPY(); + inline uint32_t EA_DXI(); + inline uint32_t EA_DIY(); + inline uint32_t EA_XI(); + inline uint32_t EA_XII(); + inline uint32_t EA_YI(); + inline void JUMP(uint32_t address); + inline void BRANCH(uint32_t offset); + inline void SET_REG_YA(uint32_t value); + inline void SET_REG_P(uint32_t value); + inline void PUSH_8(uint32_t value); + inline uint32_t PULL_8(); + inline void PUSH_16(uint32_t value); + inline uint32_t PULL_16(); inline void CHECK_IRQ(); - inline void SET_FLAG_I(UINT32 value); + inline void SET_FLAG_I(uint32_t value); void SERVICE_IRQ(); }; diff --git a/src/devices/cpu/spc700/spc700ds.cpp b/src/devices/cpu/spc700/spc700ds.cpp index 867ddd56210..7faf4468c13 100644 --- a/src/devices/cpu/spc700/spc700ds.cpp +++ b/src/devices/cpu/spc700/spc700ds.cpp @@ -321,7 +321,7 @@ static const spc700_opcode_struct g_opcodes[256] = }; static unsigned int g_pc; -static const UINT8 *rombase; +static const uint8_t *rombase; static inline unsigned int read_8_immediate(void) { @@ -340,7 +340,7 @@ static inline unsigned int read_16_immediate(void) CPU_DISASSEMBLE( spc700 ) { const spc700_opcode_struct* opcode; - UINT32 flags = 0; + uint32_t flags = 0; char* ptr; int var; int i; diff --git a/src/devices/cpu/ssem/ssem.cpp b/src/devices/cpu/ssem/ssem.cpp index 1ea2584c33e..a76d9a44182 100644 --- a/src/devices/cpu/ssem/ssem.cpp +++ b/src/devices/cpu/ssem/ssem.cpp @@ -25,7 +25,7 @@ CPU_DISASSEMBLE( ssem ); // The de facto snapshot format for other SSEM simulators stores the data physically in that format as well. // Therefore, in MESS, every 32-bit word has its bits reversed, too, and as a result the values must be // un-reversed before being used. -static inline UINT32 reverse(UINT32 v) +static inline uint32_t reverse(uint32_t v) { // Taken from http://www-graphics.stanford.edu/~seander/bithacks.html#ReverseParallel // swap odd and even bits @@ -42,9 +42,9 @@ static inline UINT32 reverse(UINT32 v) return v; } -inline UINT32 ssem_device::program_read32(UINT32 address) +inline uint32_t ssem_device::program_read32(uint32_t address) { - UINT32 v = 0; + uint32_t v = 0; // The MAME core does not have a good way of specifying a minimum datum size that is more than // 8 bits in width. The minimum datum width on the SSEM is 32 bits, so we need to quadruple // the address value to get the appropriate byte index. @@ -58,9 +58,9 @@ inline UINT32 ssem_device::program_read32(UINT32 address) return reverse(v); } -inline void ssem_device::program_write32(UINT32 address, UINT32 data) +inline void ssem_device::program_write32(uint32_t address, uint32_t data) { - UINT32 v = reverse(data); + uint32_t v = reverse(data); // The MAME core does not have a good way of specifying a minimum datum size that is more than // 8 bits in width. The minimum datum width on the SSEM is 32 bits, so we need to quadruple @@ -82,7 +82,7 @@ const device_type SSEMCPU = &device_creator; // ssem_device - constructor //------------------------------------------------- -ssem_device::ssem_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ssem_device::ssem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SSEMCPU, "SSEMCPU", tag, owner, clock, "ssem_cpu", __FILE__), m_program_config("program", ENDIANNESS_LITTLE, 8, 16), m_pc(1), @@ -166,7 +166,7 @@ void ssem_device::state_string_export(const device_state_entry &entry, std::stri // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 ssem_device::disasm_min_opcode_bytes() const +uint32_t ssem_device::disasm_min_opcode_bytes() const { return 4; } @@ -177,7 +177,7 @@ UINT32 ssem_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 ssem_device::disasm_max_opcode_bytes() const +uint32_t ssem_device::disasm_max_opcode_bytes() const { return 4; } @@ -188,7 +188,7 @@ UINT32 ssem_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t ssem_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t ssem_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( ssem ); return CPU_DISASSEMBLE_NAME(ssem)(this, buffer, pc, oprom, opram, options); @@ -204,7 +204,7 @@ offs_t ssem_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 ssem_device::execute_min_cycles() const +uint32_t ssem_device::execute_min_cycles() const { return 1; } @@ -215,7 +215,7 @@ UINT32 ssem_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 ssem_device::execute_max_cycles() const +uint32_t ssem_device::execute_max_cycles() const { return 1; } @@ -226,7 +226,7 @@ UINT32 ssem_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 ssem_device::execute_input_lines() const +uint32_t ssem_device::execute_input_lines() const { return 0; } @@ -249,7 +249,7 @@ void ssem_device::execute_set_input(int inputnum, int state) void ssem_device::execute_run() { - UINT32 op; + uint32_t op; m_pc &= 0x1f; m_shifted_pc = m_pc << 2; @@ -279,12 +279,12 @@ void ssem_device::execute_run() break; case 1: // JRP: Add the value at the specified address to the Program Counter. - m_pc += (INT32)program_read32(ADDR); + m_pc += (int32_t)program_read32(ADDR); m_shifted_pc = m_pc << 2; break; case 2: // LDN: Load the accumulator with the two's-complement negation of the value at the specified address. - m_a = (UINT32)(0 - (INT32)program_read32(ADDR)); + m_a = (uint32_t)(0 - (int32_t)program_read32(ADDR)); break; case 3: // STO: Store the value in the accumulator at the specified address. @@ -297,7 +297,7 @@ void ssem_device::execute_run() break; case 6: // CMP: If the accumulator is less than zero, skip the next opcode. - if((INT32)(m_a) < 0) + if((int32_t)(m_a) < 0) { m_pc++; m_shifted_pc = m_pc << 2; diff --git a/src/devices/cpu/ssem/ssem.h b/src/devices/cpu/ssem/ssem.h index 8d2c0c21044..4bfebaa432e 100644 --- a/src/devices/cpu/ssem/ssem.h +++ b/src/devices/cpu/ssem/ssem.h @@ -22,7 +22,7 @@ class ssem_device : public cpu_device { public: // construction/destruction - ssem_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ssem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -30,9 +30,9 @@ public: virtual void device_stop() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -40,9 +40,9 @@ public: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; @@ -51,14 +51,14 @@ public: const address_space_config m_program_config; // memory access - inline UINT32 program_read32(UINT32 addr); - inline void program_write32(UINT32 addr, UINT32 data); + inline uint32_t program_read32(uint32_t addr); + inline void program_write32(uint32_t addr, uint32_t data); // CPU registers - UINT32 m_pc; - UINT32 m_shifted_pc; - UINT32 m_a; - UINT32 m_halt; + uint32_t m_pc; + uint32_t m_shifted_pc; + uint32_t m_a; + uint32_t m_halt; // other internal states int m_icount; diff --git a/src/devices/cpu/ssem/ssemdasm.cpp b/src/devices/cpu/ssem/ssemdasm.cpp index a38ac00903a..efd9ba9715b 100644 --- a/src/devices/cpu/ssem/ssemdasm.cpp +++ b/src/devices/cpu/ssem/ssemdasm.cpp @@ -19,7 +19,7 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) va_end(vl); } -static inline UINT32 reverse(UINT32 v) +static inline uint32_t reverse(uint32_t v) { // Taken from http://www-graphics.stanford.edu/~seander/bithacks.html#ReverseParallel // swap odd and even bits @@ -36,10 +36,10 @@ static inline UINT32 reverse(UINT32 v) return v; } -offs_t ssem_dasm_one(char *buffer, offs_t pc, UINT32 op) +offs_t ssem_dasm_one(char *buffer, offs_t pc, uint32_t op) { - UINT8 instr = (reverse(op) >> 13) & 7; - UINT8 addr = reverse(op) & 0x1f; + uint8_t instr = (reverse(op) >> 13) & 7; + uint8_t addr = reverse(op) & 0x1f; output = buffer; @@ -79,9 +79,9 @@ offs_t ssem_dasm_one(char *buffer, offs_t pc, UINT32 op) CPU_DISASSEMBLE( ssem ) { - UINT32 op = (*(UINT8 *)(opram + 0) << 24) | - (*(UINT8 *)(opram + 1) << 16) | - (*(UINT8 *)(opram + 2) << 8) | - (*(UINT8 *)(opram + 3) << 0); + uint32_t op = (*(uint8_t *)(opram + 0) << 24) | + (*(uint8_t *)(opram + 1) << 16) | + (*(uint8_t *)(opram + 2) << 8) | + (*(uint8_t *)(opram + 3) << 0); return ssem_dasm_one(buffer, pc, op); } diff --git a/src/devices/cpu/ssp1601/ssp1601.cpp b/src/devices/cpu/ssp1601/ssp1601.cpp index e37939f34f4..1d38f5981a9 100644 --- a/src/devices/cpu/ssp1601/ssp1601.cpp +++ b/src/devices/cpu/ssp1601/ssp1601.cpp @@ -101,14 +101,14 @@ } #define OP_CMPA(x) { \ - UINT32 t = rA32 - ((x) << 16); \ + uint32_t t = rA32 - ((x) << 16); \ rST &= ~(SSP_FLAG_L|SSP_FLAG_Z|SSP_FLAG_V|SSP_FLAG_N); \ if (!t) rST |= SSP_FLAG_Z; \ else rST |= (t>>16)&SSP_FLAG_N; \ } #define OP_CMPA32(x) { \ - UINT32 t = rA32 - (x); \ + uint32_t t = rA32 - (x); \ rST &= ~(SSP_FLAG_L|SSP_FLAG_Z|SSP_FLAG_V|SSP_FLAG_N); \ if (!t) rST |= SSP_FLAG_Z; \ else rST |= (t>>16)&SSP_FLAG_N; \ @@ -192,7 +192,7 @@ const device_type SSP1601 = &device_creator; -ssp1601_device::ssp1601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ssp1601_device::ssp1601_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SSP1601, "SSP1601", tag, owner, clock, "ssp1601", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 16, 16, -1) , m_io_config("io", ENDIANNESS_BIG, 16, 4, 0) @@ -200,7 +200,7 @@ ssp1601_device::ssp1601_device(const machine_config &mconfig, const char *tag, d } -offs_t ssp1601_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t ssp1601_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( ssp1601 ); return CPU_DISASSEMBLE_NAME(ssp1601)(this, buffer, pc, oprom, opram, options); @@ -217,39 +217,39 @@ void ssp1601_device::update_P() rP.d = (m1 * m2 * 2); } -UINT32 ssp1601_device::read_unknown(int reg) +uint32_t ssp1601_device::read_unknown(int reg) { logerror("%s:%i FIXME\n", __FILE__, __LINE__); return 0; } -void ssp1601_device::write_unknown(int reg, UINT32 d) +void ssp1601_device::write_unknown(int reg, uint32_t d) { logerror("%s:%i FIXME\n", __FILE__, __LINE__); } /* map EXT regs to virtual I/O range of 0x00-0x0f */ -UINT32 ssp1601_device::read_ext(int reg) +uint32_t ssp1601_device::read_ext(int reg) { reg &= 7; return m_io->read_word((reg << 1)); } -void ssp1601_device::write_ext(int reg, UINT32 d) +void ssp1601_device::write_ext(int reg, uint32_t d) { reg &= 7; m_io->write_word((reg << 1), d); } // 4 -void ssp1601_device::write_ST(int reg, UINT32 d) +void ssp1601_device::write_ST(int reg, uint32_t d) { CHECK_ST(d); rST = d; } // 5 -UINT32 ssp1601_device::read_STACK(int reg) +uint32_t ssp1601_device::read_STACK(int reg) { --rSTACK; if ((signed short)rSTACK < 0) { @@ -259,7 +259,7 @@ UINT32 ssp1601_device::read_STACK(int reg) return m_stack[rSTACK]; } -void ssp1601_device::write_STACK(int reg, UINT32 d) +void ssp1601_device::write_STACK(int reg, uint32_t d) { if (rSTACK >= 6) { logerror(__FILE__ " FIXME: stack overflow! (%i) @ %04x\n", rSTACK, GET_PPC_OFFS()); @@ -269,33 +269,33 @@ void ssp1601_device::write_STACK(int reg, UINT32 d) } // 6 -UINT32 ssp1601_device::read_PC(int reg) +uint32_t ssp1601_device::read_PC(int reg) { return rPC; } -void ssp1601_device::write_PC(int reg, UINT32 d) +void ssp1601_device::write_PC(int reg, uint32_t d) { rPC = d; m_g_cycles--; } // 7 -UINT32 ssp1601_device::read_P(int reg) +uint32_t ssp1601_device::read_P(int reg) { update_P(); return rP.w.h; } // 15 -UINT32 ssp1601_device::read_AL(int reg) +uint32_t ssp1601_device::read_AL(int reg) { /* apparently reading AL causes some effect on EXT bus, VR depends on that.. */ read_ext(reg); return rAL; } -void ssp1601_device::write_AL(int reg, UINT32 d) +void ssp1601_device::write_AL(int reg, uint32_t d) { write_ext(reg, d); rAL = d; @@ -343,10 +343,10 @@ const ssp1601_device::write_func_t ssp1601_device::reg_write_handlers[16] = // #define ptr1_read(op) ptr1_read_(op&3,(op>>6)&4,(op<<1)&0x18) -UINT32 ssp1601_device::ptr1_read_(int ri, int isj2, int modi3) +uint32_t ssp1601_device::ptr1_read_(int ri, int isj2, int modi3) { //int t = (op&3) | ((op>>6)&4) | ((op<<1)&0x18); - UINT32 mask, add = 0, t = ri | isj2 | modi3; + uint32_t mask, add = 0, t = ri | isj2 | modi3; unsigned char *rp = nullptr; switch (t) { @@ -404,7 +404,7 @@ modulo: return t; } -void ssp1601_device::ptr1_write(int op, UINT32 d) +void ssp1601_device::ptr1_write(int op, uint32_t d) { int t = (op&3) | ((op>>6)&4) | ((op<<1)&0x18); switch (t) @@ -449,7 +449,7 @@ void ssp1601_device::ptr1_write(int op, UINT32 d) } } -UINT32 ssp1601_device::ptr2_read(int op) +uint32_t ssp1601_device::ptr2_read(int op) { int mv, t = (op&3) | ((op>>6)&4) | ((op<<1)&0x18); switch (t) @@ -576,7 +576,7 @@ void ssp1601_device::execute_run() while (m_g_cycles > 0) { int op; - UINT32 tmpv; + uint32_t tmpv; PPC = rPC; diff --git a/src/devices/cpu/ssp1601/ssp1601.h b/src/devices/cpu/ssp1601/ssp1601.h index 1917af79adb..b59fff81e4f 100644 --- a/src/devices/cpu/ssp1601/ssp1601.h +++ b/src/devices/cpu/ssp1601/ssp1601.h @@ -22,7 +22,7 @@ class ssp1601_device : public cpu_device { public: // construction/destruction - ssp1601_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ssp1601_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -30,9 +30,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 4; } - virtual UINT32 execute_input_lines() const override { return 3; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 4; } + virtual uint32_t execute_input_lines() const override { return 3; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -43,9 +43,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -66,7 +66,7 @@ private: unsigned short m_RAM1[256]; } mem; }; - UINT16 m_stack[6]; /* 6-level hardware stack */ + uint16_t m_stack[6]; /* 6-level hardware stack */ PAIR m_ppc; int m_g_cycles; @@ -76,24 +76,24 @@ private: address_space *m_io; void update_P(); - UINT32 read_unknown(int reg); - void write_unknown(int reg, UINT32 d); - UINT32 read_ext(int reg); - void write_ext(int reg, UINT32 d); - void write_ST(int reg, UINT32 d); - UINT32 read_STACK(int reg); - void write_STACK(int reg, UINT32 d); - UINT32 read_PC(int reg); - void write_PC(int reg, UINT32 d); - UINT32 read_P(int reg); - UINT32 read_AL(int reg); - void write_AL(int reg, UINT32 d); - UINT32 ptr1_read_(int ri, int isj2, int modi3); - void ptr1_write(int op, UINT32 d); - UINT32 ptr2_read(int op); - - typedef UINT32 (ssp1601_device::*read_func_t)(int reg); - typedef void (ssp1601_device::*write_func_t)(int reg, UINT32 d); + uint32_t read_unknown(int reg); + void write_unknown(int reg, uint32_t d); + uint32_t read_ext(int reg); + void write_ext(int reg, uint32_t d); + void write_ST(int reg, uint32_t d); + uint32_t read_STACK(int reg); + void write_STACK(int reg, uint32_t d); + uint32_t read_PC(int reg); + void write_PC(int reg, uint32_t d); + uint32_t read_P(int reg); + uint32_t read_AL(int reg); + void write_AL(int reg, uint32_t d); + uint32_t ptr1_read_(int ri, int isj2, int modi3); + void ptr1_write(int op, uint32_t d); + uint32_t ptr2_read(int op); + + typedef uint32_t (ssp1601_device::*read_func_t)(int reg); + typedef void (ssp1601_device::*write_func_t)(int reg, uint32_t d); static const read_func_t reg_read_handlers[16]; static const write_func_t reg_write_handlers[16]; diff --git a/src/devices/cpu/ssp1601/ssp1601d.cpp b/src/devices/cpu/ssp1601/ssp1601d.cpp index dfc8f3ae366..55161853a32 100644 --- a/src/devices/cpu/ssp1601/ssp1601d.cpp +++ b/src/devices/cpu/ssp1601/ssp1601d.cpp @@ -79,10 +79,10 @@ static char *get_cond(int op) } -static unsigned dasm_ssp1601(char *buffer, unsigned pc, const UINT8 *oprom) +static unsigned dasm_ssp1601(char *buffer, unsigned pc, const uint8_t *oprom) { - const UINT8 *base_oprom; - UINT16 op; + const uint8_t *base_oprom; + uint16_t op; int size = 1; int flags = 0; diff --git a/src/devices/cpu/superfx/sfx_dasm.cpp b/src/devices/cpu/superfx/sfx_dasm.cpp index e76e37ee003..d0a3dc36b0d 100644 --- a/src/devices/cpu/superfx/sfx_dasm.cpp +++ b/src/devices/cpu/superfx/sfx_dasm.cpp @@ -14,9 +14,9 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) va_end(vl); } -offs_t superfx_dasm_one(char *buffer, offs_t pc, UINT8 op, UINT8 param0, UINT8 param1, UINT16 alt) +offs_t superfx_dasm_one(char *buffer, offs_t pc, uint8_t op, uint8_t param0, uint8_t param1, uint16_t alt) { - UINT8 bytes_consumed = 1; + uint8_t bytes_consumed = 1; output = buffer; switch(op) @@ -37,47 +37,47 @@ offs_t superfx_dasm_one(char *buffer, offs_t pc, UINT8 op, UINT8 param0, UINT8 p print("ROL"); break; case 0x05: // BRA - print("BRA %d", (INT8)param0); + print("BRA %d", (int8_t)param0); bytes_consumed = 2; break; case 0x06: // BLT - print("BLT %d", (INT8)param0); + print("BLT %d", (int8_t)param0); bytes_consumed = 2; break; case 0x07: // BGE - print("BGE %d", (INT8)param0); + print("BGE %d", (int8_t)param0); bytes_consumed = 2; break; case 0x08: // BNE - print("BNE %d", (INT8)param0); + print("BNE %d", (int8_t)param0); bytes_consumed = 2; break; case 0x09: // BEQ - print("BEQ %d", (INT8)param0); + print("BEQ %d", (int8_t)param0); bytes_consumed = 2; break; case 0x0a: // BPL - print("BPL %d", (INT8)param0); + print("BPL %d", (int8_t)param0); bytes_consumed = 2; break; case 0x0b: // BMI - print("BMI %d", (INT8)param0); + print("BMI %d", (int8_t)param0); bytes_consumed = 2; break; case 0x0c: // BCC - print("BCC %d", (INT8)param0); + print("BCC %d", (int8_t)param0); bytes_consumed = 2; break; case 0x0d: // BCS - print("BCS %d", (INT8)param0); + print("BCS %d", (int8_t)param0); bytes_consumed = 2; break; case 0x0e: // BVC - print("BVC %d", (INT8)param0); + print("BVC %d", (int8_t)param0); bytes_consumed = 2; break; case 0x0f: // BVS - print("BVS %d", (INT8)param0); + print("BVS %d", (int8_t)param0); bytes_consumed = 2; break; diff --git a/src/devices/cpu/superfx/superfx.cpp b/src/devices/cpu/superfx/superfx.cpp index 1c7715c4d04..2e01df5874a 100644 --- a/src/devices/cpu/superfx/superfx.cpp +++ b/src/devices/cpu/superfx/superfx.cpp @@ -7,7 +7,7 @@ const device_type SUPERFX = &device_creator; -superfx_device::superfx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +superfx_device::superfx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, SUPERFX, "SuperFX", tag, owner, clock, "superfx", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 32, 0) , m_out_irq_func(*this), m_pipeline(0), m_ramaddr(0), m_sfr(0), m_pbr(0), m_rombr(0), m_rambr(0), m_cbr(0), m_scbr(0), m_scmr(0), m_colr(0), m_por(0), @@ -49,20 +49,20 @@ void superfx_device::superfx_update_speed() void superfx_device::superfx_cache_flush() { - UINT32 n = 0; + uint32_t n = 0; for(n = 0; n < 32; n++) { m_cache.valid[n] = 0; } } -UINT8 superfx_device::superfx_cache_mmio_read(UINT32 addr) +uint8_t superfx_device::superfx_cache_mmio_read(uint32_t addr) { addr = (addr + m_cbr) & 0x1ff; return m_cache.buffer[addr]; } -void superfx_device::superfx_cache_mmio_write(UINT32 addr, UINT8 data) +void superfx_device::superfx_cache_mmio_write(uint32_t addr, uint8_t data) { addr = (addr + m_cbr) & 0x1ff; m_cache.buffer[addr] = data; @@ -74,7 +74,7 @@ void superfx_device::superfx_cache_mmio_write(UINT32 addr, UINT8 data) void superfx_device::superfx_memory_reset() { - UINT32 n = 0; + uint32_t n = 0; for(n = 0; n < 0x200; n++) { m_cache.buffer[n] = 0x00; @@ -90,24 +90,24 @@ void superfx_device::superfx_memory_reset() } } -UINT8 superfx_device::superfx_bus_read(UINT32 addr) +uint8_t superfx_device::superfx_bus_read(uint32_t addr) { return m_program->read_byte(addr); } -void superfx_device::superfx_bus_write(UINT32 addr, UINT8 data) +void superfx_device::superfx_bus_write(uint32_t addr, uint8_t data) { m_program->write_byte(addr, data); } -void superfx_device::superfx_pixelcache_flush(INT32 line) +void superfx_device::superfx_pixelcache_flush(int32_t line) { - UINT8 x = m_pixelcache[line].offset << 3; - UINT8 y = m_pixelcache[line].offset >> 5; - UINT32 cn = 0; - UINT32 bpp = 2 << ((m_scmr & SUPERFX_SCMR_MD) - ((m_scmr & SUPERFX_SCMR_MD) >> 1)); // = [regs.scmr.md]{ 2, 4, 4, 8 }; - UINT32 addr; - UINT32 n = 0; + uint8_t x = m_pixelcache[line].offset << 3; + uint8_t y = m_pixelcache[line].offset >> 5; + uint32_t cn = 0; + uint32_t bpp = 2 << ((m_scmr & SUPERFX_SCMR_MD) - ((m_scmr & SUPERFX_SCMR_MD) >> 1)); // = [regs.scmr.md]{ 2, 4, 4, 8 }; + uint32_t addr; + uint32_t n = 0; if(m_pixelcache[line].bitpend == 0x00) { @@ -134,9 +134,9 @@ void superfx_device::superfx_pixelcache_flush(INT32 line) for(n = 0; n < bpp; n++) { - UINT32 byte = ((n >> 1) << 4) + (n & 1); // = [n]{ 0, 1, 16, 17, 32, 33, 48, 49 }; - UINT8 data = 0x00; - UINT32 x32 = 0; + uint32_t byte = ((n >> 1) << 4) + (n & 1); // = [n]{ 0, 1, 16, 17, 32, 33, 48, 49 }; + uint8_t data = 0x00; + uint32_t x32 = 0; for(x32 = 0; x32 < 8; x32++) { data |= ((m_pixelcache[line].data[x32] >> n) & 1) << x32; @@ -154,10 +154,10 @@ void superfx_device::superfx_pixelcache_flush(INT32 line) m_pixelcache[line].bitpend = 0x00; } -void superfx_device::superfx_plot(UINT8 x, UINT8 y) +void superfx_device::superfx_plot(uint8_t x, uint8_t y) { - UINT8 color = m_colr; - UINT16 offset = (y << 5) + (x >> 3); + uint8_t color = m_colr; + uint16_t offset = (y << 5) + (x >> 3); if((m_por & SUPERFX_POR_DITHER) != 0 && (m_scmr & SUPERFX_SCMR_MD) != 3) { @@ -215,13 +215,13 @@ void superfx_device::superfx_plot(UINT8 x, UINT8 y) } } -UINT8 superfx_device::superfx_rpix(UINT8 x, UINT8 y) +uint8_t superfx_device::superfx_rpix(uint8_t x, uint8_t y) { - UINT32 cn = 0; - UINT32 bpp; - UINT32 addr; - UINT8 data = 0x00; - UINT32 n = 0; + uint32_t cn = 0; + uint32_t bpp; + uint32_t addr; + uint8_t data = 0x00; + uint32_t n = 0; superfx_pixelcache_flush(1); superfx_pixelcache_flush(0); @@ -249,7 +249,7 @@ UINT8 superfx_device::superfx_rpix(UINT8 x, UINT8 y) for(n = 0; n < bpp; n++) { - UINT32 byte = ((n >> 1) << 4) + (n & 1); // = [n]{ 0, 1, 16, 17, 32, 33, 48, 49 }; + uint32_t byte = ((n >> 1) << 4) + (n & 1); // = [n]{ 0, 1, 16, 17, 32, 33, 48, 49 }; superfx_add_clocks_internal(m_memory_access_speed); data |= ((superfx_bus_read(addr + byte) >> x) & 1) << n; } @@ -257,7 +257,7 @@ UINT8 superfx_device::superfx_rpix(UINT8 x, UINT8 y) return data; } -UINT8 superfx_device::superfx_color(UINT8 source) +uint8_t superfx_device::superfx_color(uint8_t source) { if(m_por & SUPERFX_POR_HIGHNIBBLE) { @@ -278,13 +278,13 @@ void superfx_device::superfx_rambuffer_sync() } } -UINT8 superfx_device::superfx_rambuffer_read(UINT16 addr) +uint8_t superfx_device::superfx_rambuffer_read(uint16_t addr) { superfx_rambuffer_sync(); return superfx_bus_read(0x700000 + (m_rambr << 16) + addr); } -void superfx_device::superfx_rambuffer_write(UINT16 addr, UINT8 data) +void superfx_device::superfx_rambuffer_write(uint16_t addr, uint8_t data) { superfx_rambuffer_sync(); m_ramcl = m_memory_access_speed; @@ -306,13 +306,13 @@ void superfx_device::superfx_rombuffer_update() m_romcl = m_memory_access_speed; } -UINT8 superfx_device::superfx_rombuffer_read() +uint8_t superfx_device::superfx_rombuffer_read() { superfx_rombuffer_sync(); return m_romdr; } -void superfx_device::superfx_gpr_write(UINT8 r, UINT16 data) +void superfx_device::superfx_gpr_write(uint8_t r, uint16_t data) { m_r[r] = data; if(r == 14) @@ -325,16 +325,16 @@ void superfx_device::superfx_gpr_write(UINT8 r, UINT16 data) } } -UINT8 superfx_device::superfx_op_read(UINT16 addr) +uint8_t superfx_device::superfx_op_read(uint16_t addr) { - UINT16 offset = addr - m_cbr; + uint16_t offset = addr - m_cbr; if(offset < 512) { if(!m_cache.valid[offset >> 4]) { - UINT32 dp = offset & 0xfff0; - UINT32 sp = (m_pbr << 16) + ((m_cbr + dp) & 0xfff0); - UINT32 n = 0; + uint32_t dp = offset & 0xfff0; + uint32_t sp = (m_pbr << 16) + ((m_cbr + dp) & 0xfff0); + uint32_t n = 0; for(n = 0; n < 16; n++) { superfx_add_clocks_internal(m_memory_access_speed); @@ -365,17 +365,17 @@ UINT8 superfx_device::superfx_op_read(UINT16 addr) } } -UINT8 superfx_device::superfx_peekpipe() +uint8_t superfx_device::superfx_peekpipe() { - UINT8 result = m_pipeline; + uint8_t result = m_pipeline; m_pipeline = superfx_op_read(m_r[15]); m_r15_modified = 0; return result; } -UINT8 superfx_device::superfx_pipe() +uint8_t superfx_device::superfx_pipe() { - UINT8 result = m_pipeline; + uint8_t result = m_pipeline; m_pipeline = superfx_op_read(++m_r[15]); m_r15_modified = 0; return result; @@ -401,7 +401,7 @@ int superfx_device::access_rom() return 1; } -UINT8 superfx_device::mmio_read(UINT32 addr) +uint8_t superfx_device::mmio_read(uint32_t addr) { addr &= 0xffff; @@ -422,7 +422,7 @@ UINT8 superfx_device::mmio_read(UINT32 addr) case 0x3031: { - UINT8 r = m_sfr >> 8; + uint8_t r = m_sfr >> 8; m_sfr &= ~SUPERFX_SFR_IRQ; m_irq = 0; m_out_irq_func(m_irq); @@ -451,7 +451,7 @@ UINT8 superfx_device::mmio_read(UINT32 addr) return 0; } -void superfx_device::mmio_write(UINT32 addr, UINT8 data) +void superfx_device::mmio_write(uint32_t addr, uint8_t data) { addr &= 0xffff; @@ -465,7 +465,7 @@ void superfx_device::mmio_write(UINT32 addr, UINT8 data) if(addr >= 0x3000 && addr <= 0x301f) { - UINT32 n = (addr >> 1) & 0xf; + uint32_t n = (addr >> 1) & 0xf; if((addr & 1) == 0) { m_r[n] = (m_r[n] & 0xff00) | data; @@ -486,7 +486,7 @@ void superfx_device::mmio_write(UINT32 addr, UINT8 data) { case 0x3030: { - UINT8 g = (m_sfr & SUPERFX_SFR_G) ? 1 : 0; + uint8_t g = (m_sfr & SUPERFX_SFR_G) ? 1 : 0; m_sfr = (m_sfr & 0xff00) | (data << 0); if(g == 1 && !(m_sfr & SUPERFX_SFR_G)) { @@ -529,7 +529,7 @@ void superfx_device::mmio_write(UINT32 addr, UINT8 data) } } -void superfx_device::superfx_add_clocks_internal(UINT32 clocks) +void superfx_device::superfx_add_clocks_internal(uint32_t clocks) { if(m_romcl) { @@ -564,7 +564,7 @@ void superfx_device::superfx_timing_reset() m_ramdr = 0; } -void superfx_device::add_clocks(INT32 clocks) +void superfx_device::add_clocks(int32_t clocks) { superfx_add_clocks_internal(clocks); } @@ -763,7 +763,7 @@ void superfx_device::superfx_dreg_sfr_sz_update() void superfx_device::execute_run() { - UINT8 op; + uint8_t op; if(!(m_sfr & SUPERFX_SFR_G)) { @@ -817,7 +817,7 @@ void superfx_device::execute_run() break; case 0x04: // ROL { - UINT16 carry = *(m_sreg) & 0x8000; + uint16_t carry = *(m_sreg) & 0x8000; superfx_gpr_write(m_dreg_idx, (*(m_sreg) << 1) | SUPERFX_SFR_CY_SET); m_sfr &= ~SUPERFX_SFR_CY; m_sfr |= carry ? SUPERFX_SFR_CY : 0; @@ -827,13 +827,13 @@ void superfx_device::execute_run() } case 0x05: // BRA { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); superfx_gpr_write(15, m_r[15] + e); break; } case 0x06: // BLT { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if((SUPERFX_SFR_S_SET ^ SUPERFX_SFR_OV_SET) == 0) { superfx_gpr_write(15, m_r[15] + e); @@ -842,7 +842,7 @@ void superfx_device::execute_run() } case 0x07: // BGE { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if((SUPERFX_SFR_S_SET ^ SUPERFX_SFR_OV_SET) == 1) { superfx_gpr_write(15, m_r[15] + e); @@ -851,7 +851,7 @@ void superfx_device::execute_run() } case 0x08: // BNE { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if(SUPERFX_SFR_Z_SET == 0) { superfx_gpr_write(15, m_r[15] + e); @@ -860,7 +860,7 @@ void superfx_device::execute_run() } case 0x09: // BEQ { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if(SUPERFX_SFR_Z_SET == 1) { superfx_gpr_write(15, m_r[15] + e); @@ -869,7 +869,7 @@ void superfx_device::execute_run() } case 0x0a: // BPL { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if(SUPERFX_SFR_S_SET == 0) { superfx_gpr_write(15, m_r[15] + e); @@ -878,7 +878,7 @@ void superfx_device::execute_run() } case 0x0b: // BMI { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if(SUPERFX_SFR_S_SET == 1) { superfx_gpr_write(15, m_r[15] + e); @@ -887,7 +887,7 @@ void superfx_device::execute_run() } case 0x0c: // BCC { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if(SUPERFX_SFR_CY_SET == 0) { superfx_gpr_write(15, m_r[15] + e); @@ -896,7 +896,7 @@ void superfx_device::execute_run() } case 0x0d: // BCS { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if(SUPERFX_SFR_CY_SET == 1) { superfx_gpr_write(15, m_r[15] + e); @@ -905,7 +905,7 @@ void superfx_device::execute_run() } case 0x0e: // BVC { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if(SUPERFX_SFR_OV_SET == 0) { superfx_gpr_write(15, m_r[15] + e); @@ -914,7 +914,7 @@ void superfx_device::execute_run() } case 0x0f: // BVS { - INT32 e = (INT8)superfx_pipe(); + int32_t e = (int8_t)superfx_pipe(); if(SUPERFX_SFR_OV_SET == 1) { superfx_gpr_write(15, m_r[15] + e); @@ -991,7 +991,7 @@ void superfx_device::execute_run() case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: // LDW_IR / LDB_IR if((m_sfr & SUPERFX_SFR_ALT1) == 0) { // LDW_IR - UINT16 data; + uint16_t data; m_ramaddr = m_r[op & 0xf]; data = superfx_rambuffer_read(m_ramaddr ^ 0) << 0; data |= superfx_rambuffer_read(m_ramaddr ^ 1) << 8; @@ -1049,7 +1049,7 @@ void superfx_device::execute_run() case 0x50: case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: // ADD / ADC / ADDI / ADCI { - INT32 r = *(m_sreg); + int32_t r = *(m_sreg); m_sfr &= ~(SUPERFX_SFR_OV | SUPERFX_SFR_S | SUPERFX_SFR_Z); switch(m_sfr & SUPERFX_SFR_ALT) { @@ -1073,7 +1073,7 @@ void superfx_device::execute_run() m_sfr &= ~SUPERFX_SFR_CY; m_sfr |= (r & 0x8000) ? SUPERFX_SFR_S : 0; m_sfr |= (r >= 0x10000) ? SUPERFX_SFR_CY : 0; - m_sfr |= ((UINT16)r == 0) ? SUPERFX_SFR_Z : 0; + m_sfr |= ((uint16_t)r == 0) ? SUPERFX_SFR_Z : 0; superfx_gpr_write(m_dreg_idx, r); superfx_regs_reset(); break; @@ -1082,7 +1082,7 @@ void superfx_device::execute_run() case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f: // SUB / SBC / SUBI / CMP { - INT32 r = 0; + int32_t r = 0; m_sfr &= ~(SUPERFX_SFR_OV | SUPERFX_SFR_S | SUPERFX_SFR_Z); switch(m_sfr & SUPERFX_SFR_ALT) { @@ -1109,7 +1109,7 @@ void superfx_device::execute_run() m_sfr &= ~SUPERFX_SFR_CY; m_sfr |= (r & 0x8000) ? SUPERFX_SFR_S : 0; m_sfr |= (r >= 0x0) ? SUPERFX_SFR_CY : 0; - m_sfr |= ((UINT16)r == 0) ? SUPERFX_SFR_Z : 0; + m_sfr |= ((uint16_t)r == 0) ? SUPERFX_SFR_Z : 0; superfx_regs_reset(); break; } @@ -1150,16 +1150,16 @@ void superfx_device::execute_run() switch(m_sfr & SUPERFX_SFR_ALT) { case SUPERFX_SFR_ALT0: // MULT - superfx_gpr_write(m_dreg_idx, (INT8)(*(m_sreg)) * (INT8)(m_r[op & 0xf])); + superfx_gpr_write(m_dreg_idx, (int8_t)(*(m_sreg)) * (int8_t)(m_r[op & 0xf])); break; case SUPERFX_SFR_ALT1: // UMULT - superfx_gpr_write(m_dreg_idx, (UINT8)(*(m_sreg)) * (UINT8)(m_r[op & 0xf])); + superfx_gpr_write(m_dreg_idx, (uint8_t)(*(m_sreg)) * (uint8_t)(m_r[op & 0xf])); break; case SUPERFX_SFR_ALT2: // MULTI - superfx_gpr_write(m_dreg_idx, (INT8)(*(m_sreg)) * (INT8)(op & 0xf)); + superfx_gpr_write(m_dreg_idx, (int8_t)(*(m_sreg)) * (int8_t)(op & 0xf)); break; case SUPERFX_SFR_ALT3: // UMULTI - superfx_gpr_write(m_dreg_idx, (UINT8)(*(m_sreg)) * (UINT8)(op & 0xf)); + superfx_gpr_write(m_dreg_idx, (uint8_t)(*(m_sreg)) * (uint8_t)(op & 0xf)); break; } superfx_dreg_sfr_sz_update(); @@ -1182,7 +1182,7 @@ void superfx_device::execute_run() break; case 0x95: // SEX - superfx_gpr_write(m_dreg_idx, (INT8)(*(m_sreg))); + superfx_gpr_write(m_dreg_idx, (int8_t)(*(m_sreg))); superfx_dreg_sfr_sz_update(); superfx_regs_reset(); break; @@ -1192,7 +1192,7 @@ void superfx_device::execute_run() { // ASR m_sfr &= ~SUPERFX_SFR_CY; m_sfr |= (*(m_sreg) & 1) ? SUPERFX_SFR_CY : 0; - superfx_gpr_write(m_dreg_idx, (INT16)(*(m_sreg)) >> 1); + superfx_gpr_write(m_dreg_idx, (int16_t)(*(m_sreg)) >> 1); superfx_dreg_sfr_sz_update(); superfx_regs_reset(); } @@ -1200,7 +1200,7 @@ void superfx_device::execute_run() { // DIV2 m_sfr &= ~SUPERFX_SFR_CY; m_sfr |= (*(m_sreg) & 1) ? SUPERFX_SFR_CY : 0; - superfx_gpr_write(m_dreg_idx, ((INT16)(*(m_sreg)) >> 1) + ((UINT32)(*(m_sreg) + 1) >> 16)); + superfx_gpr_write(m_dreg_idx, ((int16_t)(*(m_sreg)) >> 1) + ((uint32_t)(*(m_sreg) + 1) >> 16)); superfx_dreg_sfr_sz_update(); superfx_regs_reset(); } @@ -1208,8 +1208,8 @@ void superfx_device::execute_run() case 0x97: // ROR { - UINT16 carry = *(m_sreg) & 1; - superfx_gpr_write(m_dreg_idx, (SUPERFX_SFR_CY_SET << 15) | ((UINT16)(*(m_sreg)) >> 1)); + uint16_t carry = *(m_sreg) & 1; + superfx_gpr_write(m_dreg_idx, (SUPERFX_SFR_CY_SET << 15) | ((uint16_t)(*(m_sreg)) >> 1)); m_sfr &= ~SUPERFX_SFR_CY; m_sfr |= carry ? SUPERFX_SFR_CY : 0; superfx_dreg_sfr_sz_update(); @@ -1234,7 +1234,7 @@ void superfx_device::execute_run() break; case 0x9e: // LOB - superfx_gpr_write(m_dreg_idx, (UINT16)(*(m_sreg)) & 0x00ff); + superfx_gpr_write(m_dreg_idx, (uint16_t)(*(m_sreg)) & 0x00ff); m_sfr &= ~(SUPERFX_SFR_S | SUPERFX_SFR_Z); m_sfr |= (*(m_dreg) & 0x80) ? SUPERFX_SFR_S : 0; m_sfr |= (*(m_dreg) == 0) ? SUPERFX_SFR_Z : 0; @@ -1243,7 +1243,7 @@ void superfx_device::execute_run() case 0x9f: // FMULT / LMULT { - UINT32 result = (INT16)(*(m_sreg)) * (INT16)(m_r[6]); + uint32_t result = (int16_t)(*(m_sreg)) * (int16_t)(m_r[6]); if(m_sfr & SUPERFX_SFR_ALT1) { // LMULT superfx_gpr_write(4, result); @@ -1262,7 +1262,7 @@ void superfx_device::execute_run() switch(m_sfr & SUPERFX_SFR_ALT) { case SUPERFX_SFR_ALT0: // IBT - superfx_gpr_write(op & 0xf, (INT8)superfx_pipe()); + superfx_gpr_write(op & 0xf, (int8_t)superfx_pipe()); superfx_regs_reset(); break; case SUPERFX_SFR_ALT2: // SMS @@ -1274,7 +1274,7 @@ void superfx_device::execute_run() case SUPERFX_SFR_ALT1: // LMS case SUPERFX_SFR_ALT3: // LMS { - UINT16 data; + uint16_t data; m_ramaddr = superfx_pipe() << 1; data = superfx_rambuffer_read(m_ramaddr ^ 0) << 0; data |= superfx_rambuffer_read(m_ramaddr ^ 1) << 8; @@ -1372,7 +1372,7 @@ void superfx_device::execute_run() case 0xef: // GETB / GETBH / GETBL / GETBS { - UINT8 byte = superfx_rombuffer_read(); + uint8_t byte = superfx_rombuffer_read(); switch(m_sfr & SUPERFX_SFR_ALT) { case SUPERFX_SFR_ALT0: // GETB @@ -1385,7 +1385,7 @@ void superfx_device::execute_run() superfx_gpr_write(m_dreg_idx, (*(m_sreg) & 0xff00) | (byte << 0)); break; case SUPERFX_SFR_ALT3: // GETBS - superfx_gpr_write(m_dreg_idx, (INT8)byte); + superfx_gpr_write(m_dreg_idx, (int8_t)byte); break; } superfx_regs_reset(); @@ -1395,7 +1395,7 @@ void superfx_device::execute_run() case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff: // IWT / LM / SM / LM { - UINT16 data; + uint16_t data; switch(m_sfr & SUPERFX_SFR_ALT) { case SUPERFX_SFR_ALT0: // IWT @@ -1439,14 +1439,14 @@ void superfx_device::execute_run() } -offs_t superfx_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t superfx_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { -extern offs_t superfx_dasm_one(char *buffer, offs_t pc, UINT8 op, UINT8 param0, UINT8 param1, UINT16 alt); +extern offs_t superfx_dasm_one(char *buffer, offs_t pc, uint8_t op, uint8_t param0, uint8_t param1, uint16_t alt); - UINT8 op = *(UINT8 *)(opram + 0); - UINT8 param0 = *(UINT8 *)(opram + 1); - UINT8 param1 = *(UINT8 *)(opram + 2); - UINT16 alt = m_sfr & SUPERFX_SFR_ALT; + uint8_t op = *(uint8_t *)(opram + 0); + uint8_t param0 = *(uint8_t *)(opram + 1); + uint8_t param1 = *(uint8_t *)(opram + 2); + uint16_t alt = m_sfr & SUPERFX_SFR_ALT; return superfx_dasm_one(buffer, pc, op, param0, param1, alt); } diff --git a/src/devices/cpu/superfx/superfx.h b/src/devices/cpu/superfx/superfx.h index 1de27856668..f5c14c7561e 100644 --- a/src/devices/cpu/superfx/superfx.h +++ b/src/devices/cpu/superfx/superfx.h @@ -94,14 +94,14 @@ class superfx_device : public cpu_device { public: // construction/destruction - superfx_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + superfx_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); // static configuration helpers template static devcb_base &set_out_irq_func(device_t &device, _Object object) { return downcast(device).m_out_irq_func.set_callback(object); } - UINT8 mmio_read(UINT32 addr); - void mmio_write(UINT32 addr, UINT8 data); - void add_clocks(INT32 clocks); + uint8_t mmio_read(uint32_t addr); + void mmio_write(uint32_t addr, uint8_t data); + void add_clocks(int32_t clocks); int access_ram(); int access_rom(); @@ -111,9 +111,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -124,89 +124,89 @@ protected: virtual void state_export(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 3; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 3; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; devcb_write_line m_out_irq_func; - UINT8 m_pipeline; - UINT16 m_ramaddr; // RAM Address - - UINT16 m_r[16]; // GPRs - UINT16 m_sfr; // Status Flag Register - UINT8 m_pbr; // Program Bank Register - UINT8 m_rombr; // Game Pack ROM Bank Register - UINT8 m_rambr; // Game Pack RAM Bank Register - UINT16 m_cbr; // Cache Base Register - UINT8 m_scbr; // Screen Base Register - UINT8 m_scmr; // Screen Mode Register - UINT8 m_colr; // Color Register - UINT8 m_por; // Plot Option Register - UINT8 m_bramr; // Back-Up RAM Register - UINT8 m_vcr; // Version Code Register - UINT8 m_cfgr; // Config Register - UINT8 m_clsr; // Clock Select Register - - UINT32 m_romcl; // Clock ticks until ROMDR is valid - UINT8 m_romdr; // ROM Buffer Data Register - - UINT32 m_ramcl; // Clock ticks until RAMDR is valid; - UINT16 m_ramar; // RAM Buffer Address Register - UINT8 m_ramdr; // RAM Buffer Data Register - - UINT16 *m_sreg; // Source Register (From) - UINT8 m_sreg_idx;// Source Register (To), index - UINT16 *m_dreg; // Destination Register (To) - UINT8 m_dreg_idx;// Destination Register (To), index - UINT8 m_r15_modified; - - UINT8 m_irq; // IRQ Pending - - UINT32 m_cache_access_speed; - UINT32 m_memory_access_speed; + uint8_t m_pipeline; + uint16_t m_ramaddr; // RAM Address + + uint16_t m_r[16]; // GPRs + uint16_t m_sfr; // Status Flag Register + uint8_t m_pbr; // Program Bank Register + uint8_t m_rombr; // Game Pack ROM Bank Register + uint8_t m_rambr; // Game Pack RAM Bank Register + uint16_t m_cbr; // Cache Base Register + uint8_t m_scbr; // Screen Base Register + uint8_t m_scmr; // Screen Mode Register + uint8_t m_colr; // Color Register + uint8_t m_por; // Plot Option Register + uint8_t m_bramr; // Back-Up RAM Register + uint8_t m_vcr; // Version Code Register + uint8_t m_cfgr; // Config Register + uint8_t m_clsr; // Clock Select Register + + uint32_t m_romcl; // Clock ticks until ROMDR is valid + uint8_t m_romdr; // ROM Buffer Data Register + + uint32_t m_ramcl; // Clock ticks until RAMDR is valid; + uint16_t m_ramar; // RAM Buffer Address Register + uint8_t m_ramdr; // RAM Buffer Data Register + + uint16_t *m_sreg; // Source Register (From) + uint8_t m_sreg_idx;// Source Register (To), index + uint16_t *m_dreg; // Destination Register (To) + uint8_t m_dreg_idx;// Destination Register (To), index + uint8_t m_r15_modified; + + uint8_t m_irq; // IRQ Pending + + uint32_t m_cache_access_speed; + uint32_t m_memory_access_speed; struct { - UINT8 buffer[0x200]; - UINT8 valid[0x20]; + uint8_t buffer[0x200]; + uint8_t valid[0x20]; } m_cache; struct { - UINT16 offset; - UINT8 bitpend; - UINT8 data[8]; + uint16_t offset; + uint8_t bitpend; + uint8_t data[8]; } m_pixelcache[2]; address_space *m_program; int m_icount; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; inline void superfx_regs_reset(); void superfx_update_speed(); void superfx_cache_flush(); - UINT8 superfx_cache_mmio_read(UINT32 addr); - void superfx_cache_mmio_write(UINT32 addr, UINT8 data); + uint8_t superfx_cache_mmio_read(uint32_t addr); + void superfx_cache_mmio_write(uint32_t addr, uint8_t data); void superfx_memory_reset(); - inline UINT8 superfx_bus_read(UINT32 addr); - inline void superfx_bus_write(UINT32 addr, UINT8 data); - inline void superfx_pixelcache_flush(INT32 line); - inline void superfx_plot(UINT8 x, UINT8 y); - UINT8 superfx_rpix(UINT8 x, UINT8 y); - inline UINT8 superfx_color(UINT8 source); + inline uint8_t superfx_bus_read(uint32_t addr); + inline void superfx_bus_write(uint32_t addr, uint8_t data); + inline void superfx_pixelcache_flush(int32_t line); + inline void superfx_plot(uint8_t x, uint8_t y); + uint8_t superfx_rpix(uint8_t x, uint8_t y); + inline uint8_t superfx_color(uint8_t source); inline void superfx_rambuffer_sync(); - inline UINT8 superfx_rambuffer_read(UINT16 addr); - inline void superfx_rambuffer_write(UINT16 addr, UINT8 data); + inline uint8_t superfx_rambuffer_read(uint16_t addr); + inline void superfx_rambuffer_write(uint16_t addr, uint8_t data); inline void superfx_rombuffer_sync(); inline void superfx_rombuffer_update(); - inline UINT8 superfx_rombuffer_read(); - inline void superfx_gpr_write(UINT8 r, UINT16 data); - inline UINT8 superfx_op_read(UINT16 addr); - inline UINT8 superfx_peekpipe(); - inline UINT8 superfx_pipe(); - inline void superfx_add_clocks_internal(UINT32 clocks); + inline uint8_t superfx_rombuffer_read(); + inline void superfx_gpr_write(uint8_t r, uint16_t data); + inline uint8_t superfx_op_read(uint16_t addr); + inline uint8_t superfx_peekpipe(); + inline uint8_t superfx_pipe(); + inline void superfx_add_clocks_internal(uint32_t clocks); void superfx_timing_reset(); inline void superfx_dreg_sfr_sz_update(); }; diff --git a/src/devices/cpu/t11/t11.cpp b/src/devices/cpu/t11/t11.cpp index d53bebf13cb..ce9e4290e87 100644 --- a/src/devices/cpu/t11/t11.cpp +++ b/src/devices/cpu/t11/t11.cpp @@ -39,12 +39,12 @@ const device_type T11 = &device_creator; const device_type K1801VM2 = &device_creator; -k1801vm2_device::k1801vm2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k1801vm2_device::k1801vm2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : t11_device(mconfig, K1801VM2, "K1801VM2", tag, owner, clock, "k1801vm2", __FILE__) { } -t11_device::t11_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) +t11_device::t11_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 16, 16, 0) , c_initial_mode(0) @@ -55,7 +55,7 @@ t11_device::t11_device(const machine_config &mconfig, device_type type, const ch memset(&m_psw, 0x00, sizeof(m_psw)); } -t11_device::t11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +t11_device::t11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, T11, "T11", tag, owner, clock, "t11", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, 16, 0) , c_initial_mode(0) @@ -169,8 +169,8 @@ int t11_device::POP() struct irq_table_entry { - UINT8 priority; - UINT8 vector; + uint8_t priority; + uint8_t vector; }; static const struct irq_table_entry irq_table[] = @@ -251,7 +251,7 @@ void t11_device::t11_check_irqs() void t11_device::device_start() { - static const UINT16 initial_pc[] = + static const uint16_t initial_pc[] = { 0xc000, 0x8000, 0x4000, 0x2000, 0x1000, 0x0000, 0xf600, 0xf400 @@ -409,7 +409,7 @@ void t11_device::execute_run() do { - UINT16 op; + uint16_t op; m_ppc = m_reg[7]; /* copy PC to previous PC */ @@ -422,7 +422,7 @@ void t11_device::execute_run() } -offs_t t11_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t t11_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( t11 ); return CPU_DISASSEMBLE_NAME(t11)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/t11/t11.h b/src/devices/cpu/t11/t11.h index 690be3d333c..1c62db4ee17 100644 --- a/src/devices/cpu/t11/t11.h +++ b/src/devices/cpu/t11/t11.h @@ -38,11 +38,11 @@ class t11_device : public cpu_device { public: // construction/destruction - t11_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); - t11_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); + t11_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); + t11_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 - static void set_initial_mode(device_t &device, const UINT16 mode) { downcast(device).c_initial_mode = mode; } + static void set_initial_mode(device_t &device, const uint16_t mode) { downcast(device).c_initial_mode = mode; } template static devcb_base &set_out_reset_func(device_t &device, _Object object) { return downcast(device).m_out_reset_func.set_callback(object); } protected: @@ -51,12 +51,12 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 12; } - virtual UINT32 execute_max_cycles() const override { return 110; } - virtual UINT32 execute_input_lines() const override { return 4; } + virtual uint32_t execute_min_cycles() const override { return 12; } + virtual uint32_t execute_max_cycles() const override { return 110; } + virtual uint32_t execute_input_lines() const override { return 4; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - virtual UINT32 execute_default_irq_vector() const override { return -1; }; + virtual uint32_t execute_default_irq_vector() const override { return -1; }; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : nullptr; } @@ -65,21 +65,21 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 6; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 6; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; protected: address_space_config m_program_config; - UINT16 c_initial_mode; + uint16_t c_initial_mode; PAIR m_ppc; /* previous program counter */ PAIR m_reg[8]; PAIR m_psw; - UINT16 m_initial_pc; - UINT8 m_wait_state; - UINT8 m_irq_state; + uint16_t m_initial_pc; + uint8_t m_wait_state; + uint8_t m_irq_state; int m_icount; address_space *m_program; direct_read_data *m_direct; @@ -94,1055 +94,1055 @@ protected: inline int POP(); void t11_check_irqs(); - typedef void ( t11_device::*opcode_func )(UINT16 op); + typedef void ( t11_device::*opcode_func )(uint16_t op); static const opcode_func s_opcode_table[65536 >> 3]; - void op_0000(UINT16 op); - void halt(UINT16 op); - void illegal(UINT16 op); - void jmp_rgd(UINT16 op); - void jmp_in(UINT16 op); - void jmp_ind(UINT16 op); - void jmp_de(UINT16 op); - void jmp_ded(UINT16 op); - void jmp_ix(UINT16 op); - void jmp_ixd(UINT16 op); - void rts(UINT16 op); - void ccc(UINT16 op); - void scc(UINT16 op); - void swab_rg(UINT16 op); - void swab_rgd(UINT16 op); - void swab_in(UINT16 op); - void swab_ind(UINT16 op); - void swab_de(UINT16 op); - void swab_ded(UINT16 op); - void swab_ix(UINT16 op); - void swab_ixd(UINT16 op); - void br(UINT16 op); - void bne(UINT16 op); - void beq(UINT16 op); - void bge(UINT16 op); - void blt(UINT16 op); - void bgt(UINT16 op); - void ble(UINT16 op); - void jsr_rgd(UINT16 op); - void jsr_in(UINT16 op); - void jsr_ind(UINT16 op); - void jsr_de(UINT16 op); - void jsr_ded(UINT16 op); - void jsr_ix(UINT16 op); - void jsr_ixd(UINT16 op); - void clr_rg(UINT16 op); - void clr_rgd(UINT16 op); - void clr_in(UINT16 op); - void clr_ind(UINT16 op); - void clr_de(UINT16 op); - void clr_ded(UINT16 op); - void clr_ix(UINT16 op); - void clr_ixd(UINT16 op); - void com_rg(UINT16 op); - void com_rgd(UINT16 op); - void com_in(UINT16 op); - void com_ind(UINT16 op); - void com_de(UINT16 op); - void com_ded(UINT16 op); - void com_ix(UINT16 op); - void com_ixd(UINT16 op); - void inc_rg(UINT16 op); - void inc_rgd(UINT16 op); - void inc_in(UINT16 op); - void inc_ind(UINT16 op); - void inc_de(UINT16 op); - void inc_ded(UINT16 op); - void inc_ix(UINT16 op); - void inc_ixd(UINT16 op); - void dec_rg(UINT16 op); - void dec_rgd(UINT16 op); - void dec_in(UINT16 op); - void dec_ind(UINT16 op); - void dec_de(UINT16 op); - void dec_ded(UINT16 op); - void dec_ix(UINT16 op); - void dec_ixd(UINT16 op); - void neg_rg(UINT16 op); - void neg_rgd(UINT16 op); - void neg_in(UINT16 op); - void neg_ind(UINT16 op); - void neg_de(UINT16 op); - void neg_ded(UINT16 op); - void neg_ix(UINT16 op); - void neg_ixd(UINT16 op); - void adc_rg(UINT16 op); - void adc_rgd(UINT16 op); - void adc_in(UINT16 op); - void adc_ind(UINT16 op); - void adc_de(UINT16 op); - void adc_ded(UINT16 op); - void adc_ix(UINT16 op); - void adc_ixd(UINT16 op); - void sbc_rg(UINT16 op); - void sbc_rgd(UINT16 op); - void sbc_in(UINT16 op); - void sbc_ind(UINT16 op); - void sbc_de(UINT16 op); - void sbc_ded(UINT16 op); - void sbc_ix(UINT16 op); - void sbc_ixd(UINT16 op); - void tst_rg(UINT16 op); - void tst_rgd(UINT16 op); - void tst_in(UINT16 op); - void tst_ind(UINT16 op); - void tst_de(UINT16 op); - void tst_ded(UINT16 op); - void tst_ix(UINT16 op); - void tst_ixd(UINT16 op); - void ror_rg(UINT16 op); - void ror_rgd(UINT16 op); - void ror_in(UINT16 op); - void ror_ind(UINT16 op); - void ror_de(UINT16 op); - void ror_ded(UINT16 op); - void ror_ix(UINT16 op); - void ror_ixd(UINT16 op); - void rol_rg(UINT16 op); - void rol_rgd(UINT16 op); - void rol_in(UINT16 op); - void rol_ind(UINT16 op); - void rol_de(UINT16 op); - void rol_ded(UINT16 op); - void rol_ix(UINT16 op); - void rol_ixd(UINT16 op); - void asr_rg(UINT16 op); - void asr_rgd(UINT16 op); - void asr_in(UINT16 op); - void asr_ind(UINT16 op); - void asr_de(UINT16 op); - void asr_ded(UINT16 op); - void asr_ix(UINT16 op); - void asr_ixd(UINT16 op); - void asl_rg(UINT16 op); - void asl_rgd(UINT16 op); - void asl_in(UINT16 op); - void asl_ind(UINT16 op); - void asl_de(UINT16 op); - void asl_ded(UINT16 op); - void asl_ix(UINT16 op); - void asl_ixd(UINT16 op); - void mark(UINT16 op); - void sxt_rg(UINT16 op); - void sxt_rgd(UINT16 op); - void sxt_in(UINT16 op); - void sxt_ind(UINT16 op); - void sxt_de(UINT16 op); - void sxt_ded(UINT16 op); - void sxt_ix(UINT16 op); - void sxt_ixd(UINT16 op); - void mov_rg_rg(UINT16 op); - void mov_rg_rgd(UINT16 op); - void mov_rg_in(UINT16 op); - void mov_rg_ind(UINT16 op); - void mov_rg_de(UINT16 op); - void mov_rg_ded(UINT16 op); - void mov_rg_ix(UINT16 op); - void mov_rg_ixd(UINT16 op); - void mov_rgd_rg(UINT16 op); - void mov_rgd_rgd(UINT16 op); - void mov_rgd_in(UINT16 op); - void mov_rgd_ind(UINT16 op); - void mov_rgd_de(UINT16 op); - void mov_rgd_ded(UINT16 op); - void mov_rgd_ix(UINT16 op); - void mov_rgd_ixd(UINT16 op); - void mov_in_rg(UINT16 op); - void mov_in_rgd(UINT16 op); - void mov_in_in(UINT16 op); - void mov_in_ind(UINT16 op); - void mov_in_de(UINT16 op); - void mov_in_ded(UINT16 op); - void mov_in_ix(UINT16 op); - void mov_in_ixd(UINT16 op); - void mov_ind_rg(UINT16 op); - void mov_ind_rgd(UINT16 op); - void mov_ind_in(UINT16 op); - void mov_ind_ind(UINT16 op); - void mov_ind_de(UINT16 op); - void mov_ind_ded(UINT16 op); - void mov_ind_ix(UINT16 op); - void mov_ind_ixd(UINT16 op); - void mov_de_rg(UINT16 op); - void mov_de_rgd(UINT16 op); - void mov_de_in(UINT16 op); - void mov_de_ind(UINT16 op); - void mov_de_de(UINT16 op); - void mov_de_ded(UINT16 op); - void mov_de_ix(UINT16 op); - void mov_de_ixd(UINT16 op); - void mov_ded_rg(UINT16 op); - void mov_ded_rgd(UINT16 op); - void mov_ded_in(UINT16 op); - void mov_ded_ind(UINT16 op); - void mov_ded_de(UINT16 op); - void mov_ded_ded(UINT16 op); - void mov_ded_ix(UINT16 op); - void mov_ded_ixd(UINT16 op); - void mov_ix_rg(UINT16 op); - void mov_ix_rgd(UINT16 op); - void mov_ix_in(UINT16 op); - void mov_ix_ind(UINT16 op); - void mov_ix_de(UINT16 op); - void mov_ix_ded(UINT16 op); - void mov_ix_ix(UINT16 op); - void mov_ix_ixd(UINT16 op); - void mov_ixd_rg(UINT16 op); - void mov_ixd_rgd(UINT16 op); - void mov_ixd_in(UINT16 op); - void mov_ixd_ind(UINT16 op); - void mov_ixd_de(UINT16 op); - void mov_ixd_ded(UINT16 op); - void mov_ixd_ix(UINT16 op); - void mov_ixd_ixd(UINT16 op); - void cmp_rg_rg(UINT16 op); - void cmp_rg_rgd(UINT16 op); - void cmp_rg_in(UINT16 op); - void cmp_rg_ind(UINT16 op); - void cmp_rg_de(UINT16 op); - void cmp_rg_ded(UINT16 op); - void cmp_rg_ix(UINT16 op); - void cmp_rg_ixd(UINT16 op); - void cmp_rgd_rg(UINT16 op); - void cmp_rgd_rgd(UINT16 op); - void cmp_rgd_in(UINT16 op); - void cmp_rgd_ind(UINT16 op); - void cmp_rgd_de(UINT16 op); - void cmp_rgd_ded(UINT16 op); - void cmp_rgd_ix(UINT16 op); - void cmp_rgd_ixd(UINT16 op); - void cmp_in_rg(UINT16 op); - void cmp_in_rgd(UINT16 op); - void cmp_in_in(UINT16 op); - void cmp_in_ind(UINT16 op); - void cmp_in_de(UINT16 op); - void cmp_in_ded(UINT16 op); - void cmp_in_ix(UINT16 op); - void cmp_in_ixd(UINT16 op); - void cmp_ind_rg(UINT16 op); - void cmp_ind_rgd(UINT16 op); - void cmp_ind_in(UINT16 op); - void cmp_ind_ind(UINT16 op); - void cmp_ind_de(UINT16 op); - void cmp_ind_ded(UINT16 op); - void cmp_ind_ix(UINT16 op); - void cmp_ind_ixd(UINT16 op); - void cmp_de_rg(UINT16 op); - void cmp_de_rgd(UINT16 op); - void cmp_de_in(UINT16 op); - void cmp_de_ind(UINT16 op); - void cmp_de_de(UINT16 op); - void cmp_de_ded(UINT16 op); - void cmp_de_ix(UINT16 op); - void cmp_de_ixd(UINT16 op); - void cmp_ded_rg(UINT16 op); - void cmp_ded_rgd(UINT16 op); - void cmp_ded_in(UINT16 op); - void cmp_ded_ind(UINT16 op); - void cmp_ded_de(UINT16 op); - void cmp_ded_ded(UINT16 op); - void cmp_ded_ix(UINT16 op); - void cmp_ded_ixd(UINT16 op); - void cmp_ix_rg(UINT16 op); - void cmp_ix_rgd(UINT16 op); - void cmp_ix_in(UINT16 op); - void cmp_ix_ind(UINT16 op); - void cmp_ix_de(UINT16 op); - void cmp_ix_ded(UINT16 op); - void cmp_ix_ix(UINT16 op); - void cmp_ix_ixd(UINT16 op); - void cmp_ixd_rg(UINT16 op); - void cmp_ixd_rgd(UINT16 op); - void cmp_ixd_in(UINT16 op); - void cmp_ixd_ind(UINT16 op); - void cmp_ixd_de(UINT16 op); - void cmp_ixd_ded(UINT16 op); - void cmp_ixd_ix(UINT16 op); - void cmp_ixd_ixd(UINT16 op); - void bit_rg_rg(UINT16 op); - void bit_rg_rgd(UINT16 op); - void bit_rg_in(UINT16 op); - void bit_rg_ind(UINT16 op); - void bit_rg_de(UINT16 op); - void bit_rg_ded(UINT16 op); - void bit_rg_ix(UINT16 op); - void bit_rg_ixd(UINT16 op); - void bit_rgd_rg(UINT16 op); - void bit_rgd_rgd(UINT16 op); - void bit_rgd_in(UINT16 op); - void bit_rgd_ind(UINT16 op); - void bit_rgd_de(UINT16 op); - void bit_rgd_ded(UINT16 op); - void bit_rgd_ix(UINT16 op); - void bit_rgd_ixd(UINT16 op); - void bit_in_rg(UINT16 op); - void bit_in_rgd(UINT16 op); - void bit_in_in(UINT16 op); - void bit_in_ind(UINT16 op); - void bit_in_de(UINT16 op); - void bit_in_ded(UINT16 op); - void bit_in_ix(UINT16 op); - void bit_in_ixd(UINT16 op); - void bit_ind_rg(UINT16 op); - void bit_ind_rgd(UINT16 op); - void bit_ind_in(UINT16 op); - void bit_ind_ind(UINT16 op); - void bit_ind_de(UINT16 op); - void bit_ind_ded(UINT16 op); - void bit_ind_ix(UINT16 op); - void bit_ind_ixd(UINT16 op); - void bit_de_rg(UINT16 op); - void bit_de_rgd(UINT16 op); - void bit_de_in(UINT16 op); - void bit_de_ind(UINT16 op); - void bit_de_de(UINT16 op); - void bit_de_ded(UINT16 op); - void bit_de_ix(UINT16 op); - void bit_de_ixd(UINT16 op); - void bit_ded_rg(UINT16 op); - void bit_ded_rgd(UINT16 op); - void bit_ded_in(UINT16 op); - void bit_ded_ind(UINT16 op); - void bit_ded_de(UINT16 op); - void bit_ded_ded(UINT16 op); - void bit_ded_ix(UINT16 op); - void bit_ded_ixd(UINT16 op); - void bit_ix_rg(UINT16 op); - void bit_ix_rgd(UINT16 op); - void bit_ix_in(UINT16 op); - void bit_ix_ind(UINT16 op); - void bit_ix_de(UINT16 op); - void bit_ix_ded(UINT16 op); - void bit_ix_ix(UINT16 op); - void bit_ix_ixd(UINT16 op); - void bit_ixd_rg(UINT16 op); - void bit_ixd_rgd(UINT16 op); - void bit_ixd_in(UINT16 op); - void bit_ixd_ind(UINT16 op); - void bit_ixd_de(UINT16 op); - void bit_ixd_ded(UINT16 op); - void bit_ixd_ix(UINT16 op); - void bit_ixd_ixd(UINT16 op); - void bic_rg_rg(UINT16 op); - void bic_rg_rgd(UINT16 op); - void bic_rg_in(UINT16 op); - void bic_rg_ind(UINT16 op); - void bic_rg_de(UINT16 op); - void bic_rg_ded(UINT16 op); - void bic_rg_ix(UINT16 op); - void bic_rg_ixd(UINT16 op); - void bic_rgd_rg(UINT16 op); - void bic_rgd_rgd(UINT16 op); - void bic_rgd_in(UINT16 op); - void bic_rgd_ind(UINT16 op); - void bic_rgd_de(UINT16 op); - void bic_rgd_ded(UINT16 op); - void bic_rgd_ix(UINT16 op); - void bic_rgd_ixd(UINT16 op); - void bic_in_rg(UINT16 op); - void bic_in_rgd(UINT16 op); - void bic_in_in(UINT16 op); - void bic_in_ind(UINT16 op); - void bic_in_de(UINT16 op); - void bic_in_ded(UINT16 op); - void bic_in_ix(UINT16 op); - void bic_in_ixd(UINT16 op); - void bic_ind_rg(UINT16 op); - void bic_ind_rgd(UINT16 op); - void bic_ind_in(UINT16 op); - void bic_ind_ind(UINT16 op); - void bic_ind_de(UINT16 op); - void bic_ind_ded(UINT16 op); - void bic_ind_ix(UINT16 op); - void bic_ind_ixd(UINT16 op); - void bic_de_rg(UINT16 op); - void bic_de_rgd(UINT16 op); - void bic_de_in(UINT16 op); - void bic_de_ind(UINT16 op); - void bic_de_de(UINT16 op); - void bic_de_ded(UINT16 op); - void bic_de_ix(UINT16 op); - void bic_de_ixd(UINT16 op); - void bic_ded_rg(UINT16 op); - void bic_ded_rgd(UINT16 op); - void bic_ded_in(UINT16 op); - void bic_ded_ind(UINT16 op); - void bic_ded_de(UINT16 op); - void bic_ded_ded(UINT16 op); - void bic_ded_ix(UINT16 op); - void bic_ded_ixd(UINT16 op); - void bic_ix_rg(UINT16 op); - void bic_ix_rgd(UINT16 op); - void bic_ix_in(UINT16 op); - void bic_ix_ind(UINT16 op); - void bic_ix_de(UINT16 op); - void bic_ix_ded(UINT16 op); - void bic_ix_ix(UINT16 op); - void bic_ix_ixd(UINT16 op); - void bic_ixd_rg(UINT16 op); - void bic_ixd_rgd(UINT16 op); - void bic_ixd_in(UINT16 op); - void bic_ixd_ind(UINT16 op); - void bic_ixd_de(UINT16 op); - void bic_ixd_ded(UINT16 op); - void bic_ixd_ix(UINT16 op); - void bic_ixd_ixd(UINT16 op); - void bis_rg_rg(UINT16 op); - void bis_rg_rgd(UINT16 op); - void bis_rg_in(UINT16 op); - void bis_rg_ind(UINT16 op); - void bis_rg_de(UINT16 op); - void bis_rg_ded(UINT16 op); - void bis_rg_ix(UINT16 op); - void bis_rg_ixd(UINT16 op); - void bis_rgd_rg(UINT16 op); - void bis_rgd_rgd(UINT16 op); - void bis_rgd_in(UINT16 op); - void bis_rgd_ind(UINT16 op); - void bis_rgd_de(UINT16 op); - void bis_rgd_ded(UINT16 op); - void bis_rgd_ix(UINT16 op); - void bis_rgd_ixd(UINT16 op); - void bis_in_rg(UINT16 op); - void bis_in_rgd(UINT16 op); - void bis_in_in(UINT16 op); - void bis_in_ind(UINT16 op); - void bis_in_de(UINT16 op); - void bis_in_ded(UINT16 op); - void bis_in_ix(UINT16 op); - void bis_in_ixd(UINT16 op); - void bis_ind_rg(UINT16 op); - void bis_ind_rgd(UINT16 op); - void bis_ind_in(UINT16 op); - void bis_ind_ind(UINT16 op); - void bis_ind_de(UINT16 op); - void bis_ind_ded(UINT16 op); - void bis_ind_ix(UINT16 op); - void bis_ind_ixd(UINT16 op); - void bis_de_rg(UINT16 op); - void bis_de_rgd(UINT16 op); - void bis_de_in(UINT16 op); - void bis_de_ind(UINT16 op); - void bis_de_de(UINT16 op); - void bis_de_ded(UINT16 op); - void bis_de_ix(UINT16 op); - void bis_de_ixd(UINT16 op); - void bis_ded_rg(UINT16 op); - void bis_ded_rgd(UINT16 op); - void bis_ded_in(UINT16 op); - void bis_ded_ind(UINT16 op); - void bis_ded_de(UINT16 op); - void bis_ded_ded(UINT16 op); - void bis_ded_ix(UINT16 op); - void bis_ded_ixd(UINT16 op); - void bis_ix_rg(UINT16 op); - void bis_ix_rgd(UINT16 op); - void bis_ix_in(UINT16 op); - void bis_ix_ind(UINT16 op); - void bis_ix_de(UINT16 op); - void bis_ix_ded(UINT16 op); - void bis_ix_ix(UINT16 op); - void bis_ix_ixd(UINT16 op); - void bis_ixd_rg(UINT16 op); - void bis_ixd_rgd(UINT16 op); - void bis_ixd_in(UINT16 op); - void bis_ixd_ind(UINT16 op); - void bis_ixd_de(UINT16 op); - void bis_ixd_ded(UINT16 op); - void bis_ixd_ix(UINT16 op); - void bis_ixd_ixd(UINT16 op); - void add_rg_rg(UINT16 op); - void add_rg_rgd(UINT16 op); - void add_rg_in(UINT16 op); - void add_rg_ind(UINT16 op); - void add_rg_de(UINT16 op); - void add_rg_ded(UINT16 op); - void add_rg_ix(UINT16 op); - void add_rg_ixd(UINT16 op); - void add_rgd_rg(UINT16 op); - void add_rgd_rgd(UINT16 op); - void add_rgd_in(UINT16 op); - void add_rgd_ind(UINT16 op); - void add_rgd_de(UINT16 op); - void add_rgd_ded(UINT16 op); - void add_rgd_ix(UINT16 op); - void add_rgd_ixd(UINT16 op); - void add_in_rg(UINT16 op); - void add_in_rgd(UINT16 op); - void add_in_in(UINT16 op); - void add_in_ind(UINT16 op); - void add_in_de(UINT16 op); - void add_in_ded(UINT16 op); - void add_in_ix(UINT16 op); - void add_in_ixd(UINT16 op); - void add_ind_rg(UINT16 op); - void add_ind_rgd(UINT16 op); - void add_ind_in(UINT16 op); - void add_ind_ind(UINT16 op); - void add_ind_de(UINT16 op); - void add_ind_ded(UINT16 op); - void add_ind_ix(UINT16 op); - void add_ind_ixd(UINT16 op); - void add_de_rg(UINT16 op); - void add_de_rgd(UINT16 op); - void add_de_in(UINT16 op); - void add_de_ind(UINT16 op); - void add_de_de(UINT16 op); - void add_de_ded(UINT16 op); - void add_de_ix(UINT16 op); - void add_de_ixd(UINT16 op); - void add_ded_rg(UINT16 op); - void add_ded_rgd(UINT16 op); - void add_ded_in(UINT16 op); - void add_ded_ind(UINT16 op); - void add_ded_de(UINT16 op); - void add_ded_ded(UINT16 op); - void add_ded_ix(UINT16 op); - void add_ded_ixd(UINT16 op); - void add_ix_rg(UINT16 op); - void add_ix_rgd(UINT16 op); - void add_ix_in(UINT16 op); - void add_ix_ind(UINT16 op); - void add_ix_de(UINT16 op); - void add_ix_ded(UINT16 op); - void add_ix_ix(UINT16 op); - void add_ix_ixd(UINT16 op); - void add_ixd_rg(UINT16 op); - void add_ixd_rgd(UINT16 op); - void add_ixd_in(UINT16 op); - void add_ixd_ind(UINT16 op); - void add_ixd_de(UINT16 op); - void add_ixd_ded(UINT16 op); - void add_ixd_ix(UINT16 op); - void add_ixd_ixd(UINT16 op); - void xor_rg(UINT16 op); - void xor_rgd(UINT16 op); - void xor_in(UINT16 op); - void xor_ind(UINT16 op); - void xor_de(UINT16 op); - void xor_ded(UINT16 op); - void xor_ix(UINT16 op); - void xor_ixd(UINT16 op); - void sob(UINT16 op); - void bpl(UINT16 op); - void bmi(UINT16 op); - void bhi(UINT16 op); - void blos(UINT16 op); - void bvc(UINT16 op); - void bvs(UINT16 op); - void bcc(UINT16 op); - void bcs(UINT16 op); - void emt(UINT16 op); - void trap(UINT16 op); - void clrb_rg(UINT16 op); - void clrb_rgd(UINT16 op); - void clrb_in(UINT16 op); - void clrb_ind(UINT16 op); - void clrb_de(UINT16 op); - void clrb_ded(UINT16 op); - void clrb_ix(UINT16 op); - void clrb_ixd(UINT16 op); - void comb_rg(UINT16 op); - void comb_rgd(UINT16 op); - void comb_in(UINT16 op); - void comb_ind(UINT16 op); - void comb_de(UINT16 op); - void comb_ded(UINT16 op); - void comb_ix(UINT16 op); - void comb_ixd(UINT16 op); - void incb_rg(UINT16 op); - void incb_rgd(UINT16 op); - void incb_in(UINT16 op); - void incb_ind(UINT16 op); - void incb_de(UINT16 op); - void incb_ded(UINT16 op); - void incb_ix(UINT16 op); - void incb_ixd(UINT16 op); - void decb_rg(UINT16 op); - void decb_rgd(UINT16 op); - void decb_in(UINT16 op); - void decb_ind(UINT16 op); - void decb_de(UINT16 op); - void decb_ded(UINT16 op); - void decb_ix(UINT16 op); - void decb_ixd(UINT16 op); - void negb_rg(UINT16 op); - void negb_rgd(UINT16 op); - void negb_in(UINT16 op); - void negb_ind(UINT16 op); - void negb_de(UINT16 op); - void negb_ded(UINT16 op); - void negb_ix(UINT16 op); - void negb_ixd(UINT16 op); - void adcb_rg(UINT16 op); - void adcb_rgd(UINT16 op); - void adcb_in(UINT16 op); - void adcb_ind(UINT16 op); - void adcb_de(UINT16 op); - void adcb_ded(UINT16 op); - void adcb_ix(UINT16 op); - void adcb_ixd(UINT16 op); - void sbcb_rg(UINT16 op); - void sbcb_rgd(UINT16 op); - void sbcb_in(UINT16 op); - void sbcb_ind(UINT16 op); - void sbcb_de(UINT16 op); - void sbcb_ded(UINT16 op); - void sbcb_ix(UINT16 op); - void sbcb_ixd(UINT16 op); - void tstb_rg(UINT16 op); - void tstb_rgd(UINT16 op); - void tstb_in(UINT16 op); - void tstb_ind(UINT16 op); - void tstb_de(UINT16 op); - void tstb_ded(UINT16 op); - void tstb_ix(UINT16 op); - void tstb_ixd(UINT16 op); - void rorb_rg(UINT16 op); - void rorb_rgd(UINT16 op); - void rorb_in(UINT16 op); - void rorb_ind(UINT16 op); - void rorb_de(UINT16 op); - void rorb_ded(UINT16 op); - void rorb_ix(UINT16 op); - void rorb_ixd(UINT16 op); - void rolb_rg(UINT16 op); - void rolb_rgd(UINT16 op); - void rolb_in(UINT16 op); - void rolb_ind(UINT16 op); - void rolb_de(UINT16 op); - void rolb_ded(UINT16 op); - void rolb_ix(UINT16 op); - void rolb_ixd(UINT16 op); - void asrb_rg(UINT16 op); - void asrb_rgd(UINT16 op); - void asrb_in(UINT16 op); - void asrb_ind(UINT16 op); - void asrb_de(UINT16 op); - void asrb_ded(UINT16 op); - void asrb_ix(UINT16 op); - void asrb_ixd(UINT16 op); - void aslb_rg(UINT16 op); - void aslb_rgd(UINT16 op); - void aslb_in(UINT16 op); - void aslb_ind(UINT16 op); - void aslb_de(UINT16 op); - void aslb_ded(UINT16 op); - void aslb_ix(UINT16 op); - void aslb_ixd(UINT16 op); - void mtps_rg(UINT16 op); - void mtps_rgd(UINT16 op); - void mtps_in(UINT16 op); - void mtps_ind(UINT16 op); - void mtps_de(UINT16 op); - void mtps_ded(UINT16 op); - void mtps_ix(UINT16 op); - void mtps_ixd(UINT16 op); - void mfps_rg(UINT16 op); - void mfps_rgd(UINT16 op); - void mfps_in(UINT16 op); - void mfps_ind(UINT16 op); - void mfps_de(UINT16 op); - void mfps_ded(UINT16 op); - void mfps_ix(UINT16 op); - void mfps_ixd(UINT16 op); - void movb_rg_rg(UINT16 op); - void movb_rg_rgd(UINT16 op); - void movb_rg_in(UINT16 op); - void movb_rg_ind(UINT16 op); - void movb_rg_de(UINT16 op); - void movb_rg_ded(UINT16 op); - void movb_rg_ix(UINT16 op); - void movb_rg_ixd(UINT16 op); - void movb_rgd_rg(UINT16 op); - void movb_rgd_rgd(UINT16 op); - void movb_rgd_in(UINT16 op); - void movb_rgd_ind(UINT16 op); - void movb_rgd_de(UINT16 op); - void movb_rgd_ded(UINT16 op); - void movb_rgd_ix(UINT16 op); - void movb_rgd_ixd(UINT16 op); - void movb_in_rg(UINT16 op); - void movb_in_rgd(UINT16 op); - void movb_in_in(UINT16 op); - void movb_in_ind(UINT16 op); - void movb_in_de(UINT16 op); - void movb_in_ded(UINT16 op); - void movb_in_ix(UINT16 op); - void movb_in_ixd(UINT16 op); - void movb_ind_rg(UINT16 op); - void movb_ind_rgd(UINT16 op); - void movb_ind_in(UINT16 op); - void movb_ind_ind(UINT16 op); - void movb_ind_de(UINT16 op); - void movb_ind_ded(UINT16 op); - void movb_ind_ix(UINT16 op); - void movb_ind_ixd(UINT16 op); - void movb_de_rg(UINT16 op); - void movb_de_rgd(UINT16 op); - void movb_de_in(UINT16 op); - void movb_de_ind(UINT16 op); - void movb_de_de(UINT16 op); - void movb_de_ded(UINT16 op); - void movb_de_ix(UINT16 op); - void movb_de_ixd(UINT16 op); - void movb_ded_rg(UINT16 op); - void movb_ded_rgd(UINT16 op); - void movb_ded_in(UINT16 op); - void movb_ded_ind(UINT16 op); - void movb_ded_de(UINT16 op); - void movb_ded_ded(UINT16 op); - void movb_ded_ix(UINT16 op); - void movb_ded_ixd(UINT16 op); - void movb_ix_rg(UINT16 op); - void movb_ix_rgd(UINT16 op); - void movb_ix_in(UINT16 op); - void movb_ix_ind(UINT16 op); - void movb_ix_de(UINT16 op); - void movb_ix_ded(UINT16 op); - void movb_ix_ix(UINT16 op); - void movb_ix_ixd(UINT16 op); - void movb_ixd_rg(UINT16 op); - void movb_ixd_rgd(UINT16 op); - void movb_ixd_in(UINT16 op); - void movb_ixd_ind(UINT16 op); - void movb_ixd_de(UINT16 op); - void movb_ixd_ded(UINT16 op); - void movb_ixd_ix(UINT16 op); - void movb_ixd_ixd(UINT16 op); - void cmpb_rg_rg(UINT16 op); - void cmpb_rg_rgd(UINT16 op); - void cmpb_rg_in(UINT16 op); - void cmpb_rg_ind(UINT16 op); - void cmpb_rg_de(UINT16 op); - void cmpb_rg_ded(UINT16 op); - void cmpb_rg_ix(UINT16 op); - void cmpb_rg_ixd(UINT16 op); - void cmpb_rgd_rg(UINT16 op); - void cmpb_rgd_rgd(UINT16 op); - void cmpb_rgd_in(UINT16 op); - void cmpb_rgd_ind(UINT16 op); - void cmpb_rgd_de(UINT16 op); - void cmpb_rgd_ded(UINT16 op); - void cmpb_rgd_ix(UINT16 op); - void cmpb_rgd_ixd(UINT16 op); - void cmpb_in_rg(UINT16 op); - void cmpb_in_rgd(UINT16 op); - void cmpb_in_in(UINT16 op); - void cmpb_in_ind(UINT16 op); - void cmpb_in_de(UINT16 op); - void cmpb_in_ded(UINT16 op); - void cmpb_in_ix(UINT16 op); - void cmpb_in_ixd(UINT16 op); - void cmpb_ind_rg(UINT16 op); - void cmpb_ind_rgd(UINT16 op); - void cmpb_ind_in(UINT16 op); - void cmpb_ind_ind(UINT16 op); - void cmpb_ind_de(UINT16 op); - void cmpb_ind_ded(UINT16 op); - void cmpb_ind_ix(UINT16 op); - void cmpb_ind_ixd(UINT16 op); - void cmpb_de_rg(UINT16 op); - void cmpb_de_rgd(UINT16 op); - void cmpb_de_in(UINT16 op); - void cmpb_de_ind(UINT16 op); - void cmpb_de_de(UINT16 op); - void cmpb_de_ded(UINT16 op); - void cmpb_de_ix(UINT16 op); - void cmpb_de_ixd(UINT16 op); - void cmpb_ded_rg(UINT16 op); - void cmpb_ded_rgd(UINT16 op); - void cmpb_ded_in(UINT16 op); - void cmpb_ded_ind(UINT16 op); - void cmpb_ded_de(UINT16 op); - void cmpb_ded_ded(UINT16 op); - void cmpb_ded_ix(UINT16 op); - void cmpb_ded_ixd(UINT16 op); - void cmpb_ix_rg(UINT16 op); - void cmpb_ix_rgd(UINT16 op); - void cmpb_ix_in(UINT16 op); - void cmpb_ix_ind(UINT16 op); - void cmpb_ix_de(UINT16 op); - void cmpb_ix_ded(UINT16 op); - void cmpb_ix_ix(UINT16 op); - void cmpb_ix_ixd(UINT16 op); - void cmpb_ixd_rg(UINT16 op); - void cmpb_ixd_rgd(UINT16 op); - void cmpb_ixd_in(UINT16 op); - void cmpb_ixd_ind(UINT16 op); - void cmpb_ixd_de(UINT16 op); - void cmpb_ixd_ded(UINT16 op); - void cmpb_ixd_ix(UINT16 op); - void cmpb_ixd_ixd(UINT16 op); - void bitb_rg_rg(UINT16 op); - void bitb_rg_rgd(UINT16 op); - void bitb_rg_in(UINT16 op); - void bitb_rg_ind(UINT16 op); - void bitb_rg_de(UINT16 op); - void bitb_rg_ded(UINT16 op); - void bitb_rg_ix(UINT16 op); - void bitb_rg_ixd(UINT16 op); - void bitb_rgd_rg(UINT16 op); - void bitb_rgd_rgd(UINT16 op); - void bitb_rgd_in(UINT16 op); - void bitb_rgd_ind(UINT16 op); - void bitb_rgd_de(UINT16 op); - void bitb_rgd_ded(UINT16 op); - void bitb_rgd_ix(UINT16 op); - void bitb_rgd_ixd(UINT16 op); - void bitb_in_rg(UINT16 op); - void bitb_in_rgd(UINT16 op); - void bitb_in_in(UINT16 op); - void bitb_in_ind(UINT16 op); - void bitb_in_de(UINT16 op); - void bitb_in_ded(UINT16 op); - void bitb_in_ix(UINT16 op); - void bitb_in_ixd(UINT16 op); - void bitb_ind_rg(UINT16 op); - void bitb_ind_rgd(UINT16 op); - void bitb_ind_in(UINT16 op); - void bitb_ind_ind(UINT16 op); - void bitb_ind_de(UINT16 op); - void bitb_ind_ded(UINT16 op); - void bitb_ind_ix(UINT16 op); - void bitb_ind_ixd(UINT16 op); - void bitb_de_rg(UINT16 op); - void bitb_de_rgd(UINT16 op); - void bitb_de_in(UINT16 op); - void bitb_de_ind(UINT16 op); - void bitb_de_de(UINT16 op); - void bitb_de_ded(UINT16 op); - void bitb_de_ix(UINT16 op); - void bitb_de_ixd(UINT16 op); - void bitb_ded_rg(UINT16 op); - void bitb_ded_rgd(UINT16 op); - void bitb_ded_in(UINT16 op); - void bitb_ded_ind(UINT16 op); - void bitb_ded_de(UINT16 op); - void bitb_ded_ded(UINT16 op); - void bitb_ded_ix(UINT16 op); - void bitb_ded_ixd(UINT16 op); - void bitb_ix_rg(UINT16 op); - void bitb_ix_rgd(UINT16 op); - void bitb_ix_in(UINT16 op); - void bitb_ix_ind(UINT16 op); - void bitb_ix_de(UINT16 op); - void bitb_ix_ded(UINT16 op); - void bitb_ix_ix(UINT16 op); - void bitb_ix_ixd(UINT16 op); - void bitb_ixd_rg(UINT16 op); - void bitb_ixd_rgd(UINT16 op); - void bitb_ixd_in(UINT16 op); - void bitb_ixd_ind(UINT16 op); - void bitb_ixd_de(UINT16 op); - void bitb_ixd_ded(UINT16 op); - void bitb_ixd_ix(UINT16 op); - void bitb_ixd_ixd(UINT16 op); - void bicb_rg_rg(UINT16 op); - void bicb_rg_rgd(UINT16 op); - void bicb_rg_in(UINT16 op); - void bicb_rg_ind(UINT16 op); - void bicb_rg_de(UINT16 op); - void bicb_rg_ded(UINT16 op); - void bicb_rg_ix(UINT16 op); - void bicb_rg_ixd(UINT16 op); - void bicb_rgd_rg(UINT16 op); - void bicb_rgd_rgd(UINT16 op); - void bicb_rgd_in(UINT16 op); - void bicb_rgd_ind(UINT16 op); - void bicb_rgd_de(UINT16 op); - void bicb_rgd_ded(UINT16 op); - void bicb_rgd_ix(UINT16 op); - void bicb_rgd_ixd(UINT16 op); - void bicb_in_rg(UINT16 op); - void bicb_in_rgd(UINT16 op); - void bicb_in_in(UINT16 op); - void bicb_in_ind(UINT16 op); - void bicb_in_de(UINT16 op); - void bicb_in_ded(UINT16 op); - void bicb_in_ix(UINT16 op); - void bicb_in_ixd(UINT16 op); - void bicb_ind_rg(UINT16 op); - void bicb_ind_rgd(UINT16 op); - void bicb_ind_in(UINT16 op); - void bicb_ind_ind(UINT16 op); - void bicb_ind_de(UINT16 op); - void bicb_ind_ded(UINT16 op); - void bicb_ind_ix(UINT16 op); - void bicb_ind_ixd(UINT16 op); - void bicb_de_rg(UINT16 op); - void bicb_de_rgd(UINT16 op); - void bicb_de_in(UINT16 op); - void bicb_de_ind(UINT16 op); - void bicb_de_de(UINT16 op); - void bicb_de_ded(UINT16 op); - void bicb_de_ix(UINT16 op); - void bicb_de_ixd(UINT16 op); - void bicb_ded_rg(UINT16 op); - void bicb_ded_rgd(UINT16 op); - void bicb_ded_in(UINT16 op); - void bicb_ded_ind(UINT16 op); - void bicb_ded_de(UINT16 op); - void bicb_ded_ded(UINT16 op); - void bicb_ded_ix(UINT16 op); - void bicb_ded_ixd(UINT16 op); - void bicb_ix_rg(UINT16 op); - void bicb_ix_rgd(UINT16 op); - void bicb_ix_in(UINT16 op); - void bicb_ix_ind(UINT16 op); - void bicb_ix_de(UINT16 op); - void bicb_ix_ded(UINT16 op); - void bicb_ix_ix(UINT16 op); - void bicb_ix_ixd(UINT16 op); - void bicb_ixd_rg(UINT16 op); - void bicb_ixd_rgd(UINT16 op); - void bicb_ixd_in(UINT16 op); - void bicb_ixd_ind(UINT16 op); - void bicb_ixd_de(UINT16 op); - void bicb_ixd_ded(UINT16 op); - void bicb_ixd_ix(UINT16 op); - void bicb_ixd_ixd(UINT16 op); - void bisb_rg_rg(UINT16 op); - void bisb_rg_rgd(UINT16 op); - void bisb_rg_in(UINT16 op); - void bisb_rg_ind(UINT16 op); - void bisb_rg_de(UINT16 op); - void bisb_rg_ded(UINT16 op); - void bisb_rg_ix(UINT16 op); - void bisb_rg_ixd(UINT16 op); - void bisb_rgd_rg(UINT16 op); - void bisb_rgd_rgd(UINT16 op); - void bisb_rgd_in(UINT16 op); - void bisb_rgd_ind(UINT16 op); - void bisb_rgd_de(UINT16 op); - void bisb_rgd_ded(UINT16 op); - void bisb_rgd_ix(UINT16 op); - void bisb_rgd_ixd(UINT16 op); - void bisb_in_rg(UINT16 op); - void bisb_in_rgd(UINT16 op); - void bisb_in_in(UINT16 op); - void bisb_in_ind(UINT16 op); - void bisb_in_de(UINT16 op); - void bisb_in_ded(UINT16 op); - void bisb_in_ix(UINT16 op); - void bisb_in_ixd(UINT16 op); - void bisb_ind_rg(UINT16 op); - void bisb_ind_rgd(UINT16 op); - void bisb_ind_in(UINT16 op); - void bisb_ind_ind(UINT16 op); - void bisb_ind_de(UINT16 op); - void bisb_ind_ded(UINT16 op); - void bisb_ind_ix(UINT16 op); - void bisb_ind_ixd(UINT16 op); - void bisb_de_rg(UINT16 op); - void bisb_de_rgd(UINT16 op); - void bisb_de_in(UINT16 op); - void bisb_de_ind(UINT16 op); - void bisb_de_de(UINT16 op); - void bisb_de_ded(UINT16 op); - void bisb_de_ix(UINT16 op); - void bisb_de_ixd(UINT16 op); - void bisb_ded_rg(UINT16 op); - void bisb_ded_rgd(UINT16 op); - void bisb_ded_in(UINT16 op); - void bisb_ded_ind(UINT16 op); - void bisb_ded_de(UINT16 op); - void bisb_ded_ded(UINT16 op); - void bisb_ded_ix(UINT16 op); - void bisb_ded_ixd(UINT16 op); - void bisb_ix_rg(UINT16 op); - void bisb_ix_rgd(UINT16 op); - void bisb_ix_in(UINT16 op); - void bisb_ix_ind(UINT16 op); - void bisb_ix_de(UINT16 op); - void bisb_ix_ded(UINT16 op); - void bisb_ix_ix(UINT16 op); - void bisb_ix_ixd(UINT16 op); - void bisb_ixd_rg(UINT16 op); - void bisb_ixd_rgd(UINT16 op); - void bisb_ixd_in(UINT16 op); - void bisb_ixd_ind(UINT16 op); - void bisb_ixd_de(UINT16 op); - void bisb_ixd_ded(UINT16 op); - void bisb_ixd_ix(UINT16 op); - void bisb_ixd_ixd(UINT16 op); - void sub_rg_rg(UINT16 op); - void sub_rg_rgd(UINT16 op); - void sub_rg_in(UINT16 op); - void sub_rg_ind(UINT16 op); - void sub_rg_de(UINT16 op); - void sub_rg_ded(UINT16 op); - void sub_rg_ix(UINT16 op); - void sub_rg_ixd(UINT16 op); - void sub_rgd_rg(UINT16 op); - void sub_rgd_rgd(UINT16 op); - void sub_rgd_in(UINT16 op); - void sub_rgd_ind(UINT16 op); - void sub_rgd_de(UINT16 op); - void sub_rgd_ded(UINT16 op); - void sub_rgd_ix(UINT16 op); - void sub_rgd_ixd(UINT16 op); - void sub_in_rg(UINT16 op); - void sub_in_rgd(UINT16 op); - void sub_in_in(UINT16 op); - void sub_in_ind(UINT16 op); - void sub_in_de(UINT16 op); - void sub_in_ded(UINT16 op); - void sub_in_ix(UINT16 op); - void sub_in_ixd(UINT16 op); - void sub_ind_rg(UINT16 op); - void sub_ind_rgd(UINT16 op); - void sub_ind_in(UINT16 op); - void sub_ind_ind(UINT16 op); - void sub_ind_de(UINT16 op); - void sub_ind_ded(UINT16 op); - void sub_ind_ix(UINT16 op); - void sub_ind_ixd(UINT16 op); - void sub_de_rg(UINT16 op); - void sub_de_rgd(UINT16 op); - void sub_de_in(UINT16 op); - void sub_de_ind(UINT16 op); - void sub_de_de(UINT16 op); - void sub_de_ded(UINT16 op); - void sub_de_ix(UINT16 op); - void sub_de_ixd(UINT16 op); - void sub_ded_rg(UINT16 op); - void sub_ded_rgd(UINT16 op); - void sub_ded_in(UINT16 op); - void sub_ded_ind(UINT16 op); - void sub_ded_de(UINT16 op); - void sub_ded_ded(UINT16 op); - void sub_ded_ix(UINT16 op); - void sub_ded_ixd(UINT16 op); - void sub_ix_rg(UINT16 op); - void sub_ix_rgd(UINT16 op); - void sub_ix_in(UINT16 op); - void sub_ix_ind(UINT16 op); - void sub_ix_de(UINT16 op); - void sub_ix_ded(UINT16 op); - void sub_ix_ix(UINT16 op); - void sub_ix_ixd(UINT16 op); - void sub_ixd_rg(UINT16 op); - void sub_ixd_rgd(UINT16 op); - void sub_ixd_in(UINT16 op); - void sub_ixd_ind(UINT16 op); - void sub_ixd_de(UINT16 op); - void sub_ixd_ded(UINT16 op); - void sub_ixd_ix(UINT16 op); - void sub_ixd_ixd(UINT16 op); + void op_0000(uint16_t op); + void halt(uint16_t op); + void illegal(uint16_t op); + void jmp_rgd(uint16_t op); + void jmp_in(uint16_t op); + void jmp_ind(uint16_t op); + void jmp_de(uint16_t op); + void jmp_ded(uint16_t op); + void jmp_ix(uint16_t op); + void jmp_ixd(uint16_t op); + void rts(uint16_t op); + void ccc(uint16_t op); + void scc(uint16_t op); + void swab_rg(uint16_t op); + void swab_rgd(uint16_t op); + void swab_in(uint16_t op); + void swab_ind(uint16_t op); + void swab_de(uint16_t op); + void swab_ded(uint16_t op); + void swab_ix(uint16_t op); + void swab_ixd(uint16_t op); + void br(uint16_t op); + void bne(uint16_t op); + void beq(uint16_t op); + void bge(uint16_t op); + void blt(uint16_t op); + void bgt(uint16_t op); + void ble(uint16_t op); + void jsr_rgd(uint16_t op); + void jsr_in(uint16_t op); + void jsr_ind(uint16_t op); + void jsr_de(uint16_t op); + void jsr_ded(uint16_t op); + void jsr_ix(uint16_t op); + void jsr_ixd(uint16_t op); + void clr_rg(uint16_t op); + void clr_rgd(uint16_t op); + void clr_in(uint16_t op); + void clr_ind(uint16_t op); + void clr_de(uint16_t op); + void clr_ded(uint16_t op); + void clr_ix(uint16_t op); + void clr_ixd(uint16_t op); + void com_rg(uint16_t op); + void com_rgd(uint16_t op); + void com_in(uint16_t op); + void com_ind(uint16_t op); + void com_de(uint16_t op); + void com_ded(uint16_t op); + void com_ix(uint16_t op); + void com_ixd(uint16_t op); + void inc_rg(uint16_t op); + void inc_rgd(uint16_t op); + void inc_in(uint16_t op); + void inc_ind(uint16_t op); + void inc_de(uint16_t op); + void inc_ded(uint16_t op); + void inc_ix(uint16_t op); + void inc_ixd(uint16_t op); + void dec_rg(uint16_t op); + void dec_rgd(uint16_t op); + void dec_in(uint16_t op); + void dec_ind(uint16_t op); + void dec_de(uint16_t op); + void dec_ded(uint16_t op); + void dec_ix(uint16_t op); + void dec_ixd(uint16_t op); + void neg_rg(uint16_t op); + void neg_rgd(uint16_t op); + void neg_in(uint16_t op); + void neg_ind(uint16_t op); + void neg_de(uint16_t op); + void neg_ded(uint16_t op); + void neg_ix(uint16_t op); + void neg_ixd(uint16_t op); + void adc_rg(uint16_t op); + void adc_rgd(uint16_t op); + void adc_in(uint16_t op); + void adc_ind(uint16_t op); + void adc_de(uint16_t op); + void adc_ded(uint16_t op); + void adc_ix(uint16_t op); + void adc_ixd(uint16_t op); + void sbc_rg(uint16_t op); + void sbc_rgd(uint16_t op); + void sbc_in(uint16_t op); + void sbc_ind(uint16_t op); + void sbc_de(uint16_t op); + void sbc_ded(uint16_t op); + void sbc_ix(uint16_t op); + void sbc_ixd(uint16_t op); + void tst_rg(uint16_t op); + void tst_rgd(uint16_t op); + void tst_in(uint16_t op); + void tst_ind(uint16_t op); + void tst_de(uint16_t op); + void tst_ded(uint16_t op); + void tst_ix(uint16_t op); + void tst_ixd(uint16_t op); + void ror_rg(uint16_t op); + void ror_rgd(uint16_t op); + void ror_in(uint16_t op); + void ror_ind(uint16_t op); + void ror_de(uint16_t op); + void ror_ded(uint16_t op); + void ror_ix(uint16_t op); + void ror_ixd(uint16_t op); + void rol_rg(uint16_t op); + void rol_rgd(uint16_t op); + void rol_in(uint16_t op); + void rol_ind(uint16_t op); + void rol_de(uint16_t op); + void rol_ded(uint16_t op); + void rol_ix(uint16_t op); + void rol_ixd(uint16_t op); + void asr_rg(uint16_t op); + void asr_rgd(uint16_t op); + void asr_in(uint16_t op); + void asr_ind(uint16_t op); + void asr_de(uint16_t op); + void asr_ded(uint16_t op); + void asr_ix(uint16_t op); + void asr_ixd(uint16_t op); + void asl_rg(uint16_t op); + void asl_rgd(uint16_t op); + void asl_in(uint16_t op); + void asl_ind(uint16_t op); + void asl_de(uint16_t op); + void asl_ded(uint16_t op); + void asl_ix(uint16_t op); + void asl_ixd(uint16_t op); + void mark(uint16_t op); + void sxt_rg(uint16_t op); + void sxt_rgd(uint16_t op); + void sxt_in(uint16_t op); + void sxt_ind(uint16_t op); + void sxt_de(uint16_t op); + void sxt_ded(uint16_t op); + void sxt_ix(uint16_t op); + void sxt_ixd(uint16_t op); + void mov_rg_rg(uint16_t op); + void mov_rg_rgd(uint16_t op); + void mov_rg_in(uint16_t op); + void mov_rg_ind(uint16_t op); + void mov_rg_de(uint16_t op); + void mov_rg_ded(uint16_t op); + void mov_rg_ix(uint16_t op); + void mov_rg_ixd(uint16_t op); + void mov_rgd_rg(uint16_t op); + void mov_rgd_rgd(uint16_t op); + void mov_rgd_in(uint16_t op); + void mov_rgd_ind(uint16_t op); + void mov_rgd_de(uint16_t op); + void mov_rgd_ded(uint16_t op); + void mov_rgd_ix(uint16_t op); + void mov_rgd_ixd(uint16_t op); + void mov_in_rg(uint16_t op); + void mov_in_rgd(uint16_t op); + void mov_in_in(uint16_t op); + void mov_in_ind(uint16_t op); + void mov_in_de(uint16_t op); + void mov_in_ded(uint16_t op); + void mov_in_ix(uint16_t op); + void mov_in_ixd(uint16_t op); + void mov_ind_rg(uint16_t op); + void mov_ind_rgd(uint16_t op); + void mov_ind_in(uint16_t op); + void mov_ind_ind(uint16_t op); + void mov_ind_de(uint16_t op); + void mov_ind_ded(uint16_t op); + void mov_ind_ix(uint16_t op); + void mov_ind_ixd(uint16_t op); + void mov_de_rg(uint16_t op); + void mov_de_rgd(uint16_t op); + void mov_de_in(uint16_t op); + void mov_de_ind(uint16_t op); + void mov_de_de(uint16_t op); + void mov_de_ded(uint16_t op); + void mov_de_ix(uint16_t op); + void mov_de_ixd(uint16_t op); + void mov_ded_rg(uint16_t op); + void mov_ded_rgd(uint16_t op); + void mov_ded_in(uint16_t op); + void mov_ded_ind(uint16_t op); + void mov_ded_de(uint16_t op); + void mov_ded_ded(uint16_t op); + void mov_ded_ix(uint16_t op); + void mov_ded_ixd(uint16_t op); + void mov_ix_rg(uint16_t op); + void mov_ix_rgd(uint16_t op); + void mov_ix_in(uint16_t op); + void mov_ix_ind(uint16_t op); + void mov_ix_de(uint16_t op); + void mov_ix_ded(uint16_t op); + void mov_ix_ix(uint16_t op); + void mov_ix_ixd(uint16_t op); + void mov_ixd_rg(uint16_t op); + void mov_ixd_rgd(uint16_t op); + void mov_ixd_in(uint16_t op); + void mov_ixd_ind(uint16_t op); + void mov_ixd_de(uint16_t op); + void mov_ixd_ded(uint16_t op); + void mov_ixd_ix(uint16_t op); + void mov_ixd_ixd(uint16_t op); + void cmp_rg_rg(uint16_t op); + void cmp_rg_rgd(uint16_t op); + void cmp_rg_in(uint16_t op); + void cmp_rg_ind(uint16_t op); + void cmp_rg_de(uint16_t op); + void cmp_rg_ded(uint16_t op); + void cmp_rg_ix(uint16_t op); + void cmp_rg_ixd(uint16_t op); + void cmp_rgd_rg(uint16_t op); + void cmp_rgd_rgd(uint16_t op); + void cmp_rgd_in(uint16_t op); + void cmp_rgd_ind(uint16_t op); + void cmp_rgd_de(uint16_t op); + void cmp_rgd_ded(uint16_t op); + void cmp_rgd_ix(uint16_t op); + void cmp_rgd_ixd(uint16_t op); + void cmp_in_rg(uint16_t op); + void cmp_in_rgd(uint16_t op); + void cmp_in_in(uint16_t op); + void cmp_in_ind(uint16_t op); + void cmp_in_de(uint16_t op); + void cmp_in_ded(uint16_t op); + void cmp_in_ix(uint16_t op); + void cmp_in_ixd(uint16_t op); + void cmp_ind_rg(uint16_t op); + void cmp_ind_rgd(uint16_t op); + void cmp_ind_in(uint16_t op); + void cmp_ind_ind(uint16_t op); + void cmp_ind_de(uint16_t op); + void cmp_ind_ded(uint16_t op); + void cmp_ind_ix(uint16_t op); + void cmp_ind_ixd(uint16_t op); + void cmp_de_rg(uint16_t op); + void cmp_de_rgd(uint16_t op); + void cmp_de_in(uint16_t op); + void cmp_de_ind(uint16_t op); + void cmp_de_de(uint16_t op); + void cmp_de_ded(uint16_t op); + void cmp_de_ix(uint16_t op); + void cmp_de_ixd(uint16_t op); + void cmp_ded_rg(uint16_t op); + void cmp_ded_rgd(uint16_t op); + void cmp_ded_in(uint16_t op); + void cmp_ded_ind(uint16_t op); + void cmp_ded_de(uint16_t op); + void cmp_ded_ded(uint16_t op); + void cmp_ded_ix(uint16_t op); + void cmp_ded_ixd(uint16_t op); + void cmp_ix_rg(uint16_t op); + void cmp_ix_rgd(uint16_t op); + void cmp_ix_in(uint16_t op); + void cmp_ix_ind(uint16_t op); + void cmp_ix_de(uint16_t op); + void cmp_ix_ded(uint16_t op); + void cmp_ix_ix(uint16_t op); + void cmp_ix_ixd(uint16_t op); + void cmp_ixd_rg(uint16_t op); + void cmp_ixd_rgd(uint16_t op); + void cmp_ixd_in(uint16_t op); + void cmp_ixd_ind(uint16_t op); + void cmp_ixd_de(uint16_t op); + void cmp_ixd_ded(uint16_t op); + void cmp_ixd_ix(uint16_t op); + void cmp_ixd_ixd(uint16_t op); + void bit_rg_rg(uint16_t op); + void bit_rg_rgd(uint16_t op); + void bit_rg_in(uint16_t op); + void bit_rg_ind(uint16_t op); + void bit_rg_de(uint16_t op); + void bit_rg_ded(uint16_t op); + void bit_rg_ix(uint16_t op); + void bit_rg_ixd(uint16_t op); + void bit_rgd_rg(uint16_t op); + void bit_rgd_rgd(uint16_t op); + void bit_rgd_in(uint16_t op); + void bit_rgd_ind(uint16_t op); + void bit_rgd_de(uint16_t op); + void bit_rgd_ded(uint16_t op); + void bit_rgd_ix(uint16_t op); + void bit_rgd_ixd(uint16_t op); + void bit_in_rg(uint16_t op); + void bit_in_rgd(uint16_t op); + void bit_in_in(uint16_t op); + void bit_in_ind(uint16_t op); + void bit_in_de(uint16_t op); + void bit_in_ded(uint16_t op); + void bit_in_ix(uint16_t op); + void bit_in_ixd(uint16_t op); + void bit_ind_rg(uint16_t op); + void bit_ind_rgd(uint16_t op); + void bit_ind_in(uint16_t op); + void bit_ind_ind(uint16_t op); + void bit_ind_de(uint16_t op); + void bit_ind_ded(uint16_t op); + void bit_ind_ix(uint16_t op); + void bit_ind_ixd(uint16_t op); + void bit_de_rg(uint16_t op); + void bit_de_rgd(uint16_t op); + void bit_de_in(uint16_t op); + void bit_de_ind(uint16_t op); + void bit_de_de(uint16_t op); + void bit_de_ded(uint16_t op); + void bit_de_ix(uint16_t op); + void bit_de_ixd(uint16_t op); + void bit_ded_rg(uint16_t op); + void bit_ded_rgd(uint16_t op); + void bit_ded_in(uint16_t op); + void bit_ded_ind(uint16_t op); + void bit_ded_de(uint16_t op); + void bit_ded_ded(uint16_t op); + void bit_ded_ix(uint16_t op); + void bit_ded_ixd(uint16_t op); + void bit_ix_rg(uint16_t op); + void bit_ix_rgd(uint16_t op); + void bit_ix_in(uint16_t op); + void bit_ix_ind(uint16_t op); + void bit_ix_de(uint16_t op); + void bit_ix_ded(uint16_t op); + void bit_ix_ix(uint16_t op); + void bit_ix_ixd(uint16_t op); + void bit_ixd_rg(uint16_t op); + void bit_ixd_rgd(uint16_t op); + void bit_ixd_in(uint16_t op); + void bit_ixd_ind(uint16_t op); + void bit_ixd_de(uint16_t op); + void bit_ixd_ded(uint16_t op); + void bit_ixd_ix(uint16_t op); + void bit_ixd_ixd(uint16_t op); + void bic_rg_rg(uint16_t op); + void bic_rg_rgd(uint16_t op); + void bic_rg_in(uint16_t op); + void bic_rg_ind(uint16_t op); + void bic_rg_de(uint16_t op); + void bic_rg_ded(uint16_t op); + void bic_rg_ix(uint16_t op); + void bic_rg_ixd(uint16_t op); + void bic_rgd_rg(uint16_t op); + void bic_rgd_rgd(uint16_t op); + void bic_rgd_in(uint16_t op); + void bic_rgd_ind(uint16_t op); + void bic_rgd_de(uint16_t op); + void bic_rgd_ded(uint16_t op); + void bic_rgd_ix(uint16_t op); + void bic_rgd_ixd(uint16_t op); + void bic_in_rg(uint16_t op); + void bic_in_rgd(uint16_t op); + void bic_in_in(uint16_t op); + void bic_in_ind(uint16_t op); + void bic_in_de(uint16_t op); + void bic_in_ded(uint16_t op); + void bic_in_ix(uint16_t op); + void bic_in_ixd(uint16_t op); + void bic_ind_rg(uint16_t op); + void bic_ind_rgd(uint16_t op); + void bic_ind_in(uint16_t op); + void bic_ind_ind(uint16_t op); + void bic_ind_de(uint16_t op); + void bic_ind_ded(uint16_t op); + void bic_ind_ix(uint16_t op); + void bic_ind_ixd(uint16_t op); + void bic_de_rg(uint16_t op); + void bic_de_rgd(uint16_t op); + void bic_de_in(uint16_t op); + void bic_de_ind(uint16_t op); + void bic_de_de(uint16_t op); + void bic_de_ded(uint16_t op); + void bic_de_ix(uint16_t op); + void bic_de_ixd(uint16_t op); + void bic_ded_rg(uint16_t op); + void bic_ded_rgd(uint16_t op); + void bic_ded_in(uint16_t op); + void bic_ded_ind(uint16_t op); + void bic_ded_de(uint16_t op); + void bic_ded_ded(uint16_t op); + void bic_ded_ix(uint16_t op); + void bic_ded_ixd(uint16_t op); + void bic_ix_rg(uint16_t op); + void bic_ix_rgd(uint16_t op); + void bic_ix_in(uint16_t op); + void bic_ix_ind(uint16_t op); + void bic_ix_de(uint16_t op); + void bic_ix_ded(uint16_t op); + void bic_ix_ix(uint16_t op); + void bic_ix_ixd(uint16_t op); + void bic_ixd_rg(uint16_t op); + void bic_ixd_rgd(uint16_t op); + void bic_ixd_in(uint16_t op); + void bic_ixd_ind(uint16_t op); + void bic_ixd_de(uint16_t op); + void bic_ixd_ded(uint16_t op); + void bic_ixd_ix(uint16_t op); + void bic_ixd_ixd(uint16_t op); + void bis_rg_rg(uint16_t op); + void bis_rg_rgd(uint16_t op); + void bis_rg_in(uint16_t op); + void bis_rg_ind(uint16_t op); + void bis_rg_de(uint16_t op); + void bis_rg_ded(uint16_t op); + void bis_rg_ix(uint16_t op); + void bis_rg_ixd(uint16_t op); + void bis_rgd_rg(uint16_t op); + void bis_rgd_rgd(uint16_t op); + void bis_rgd_in(uint16_t op); + void bis_rgd_ind(uint16_t op); + void bis_rgd_de(uint16_t op); + void bis_rgd_ded(uint16_t op); + void bis_rgd_ix(uint16_t op); + void bis_rgd_ixd(uint16_t op); + void bis_in_rg(uint16_t op); + void bis_in_rgd(uint16_t op); + void bis_in_in(uint16_t op); + void bis_in_ind(uint16_t op); + void bis_in_de(uint16_t op); + void bis_in_ded(uint16_t op); + void bis_in_ix(uint16_t op); + void bis_in_ixd(uint16_t op); + void bis_ind_rg(uint16_t op); + void bis_ind_rgd(uint16_t op); + void bis_ind_in(uint16_t op); + void bis_ind_ind(uint16_t op); + void bis_ind_de(uint16_t op); + void bis_ind_ded(uint16_t op); + void bis_ind_ix(uint16_t op); + void bis_ind_ixd(uint16_t op); + void bis_de_rg(uint16_t op); + void bis_de_rgd(uint16_t op); + void bis_de_in(uint16_t op); + void bis_de_ind(uint16_t op); + void bis_de_de(uint16_t op); + void bis_de_ded(uint16_t op); + void bis_de_ix(uint16_t op); + void bis_de_ixd(uint16_t op); + void bis_ded_rg(uint16_t op); + void bis_ded_rgd(uint16_t op); + void bis_ded_in(uint16_t op); + void bis_ded_ind(uint16_t op); + void bis_ded_de(uint16_t op); + void bis_ded_ded(uint16_t op); + void bis_ded_ix(uint16_t op); + void bis_ded_ixd(uint16_t op); + void bis_ix_rg(uint16_t op); + void bis_ix_rgd(uint16_t op); + void bis_ix_in(uint16_t op); + void bis_ix_ind(uint16_t op); + void bis_ix_de(uint16_t op); + void bis_ix_ded(uint16_t op); + void bis_ix_ix(uint16_t op); + void bis_ix_ixd(uint16_t op); + void bis_ixd_rg(uint16_t op); + void bis_ixd_rgd(uint16_t op); + void bis_ixd_in(uint16_t op); + void bis_ixd_ind(uint16_t op); + void bis_ixd_de(uint16_t op); + void bis_ixd_ded(uint16_t op); + void bis_ixd_ix(uint16_t op); + void bis_ixd_ixd(uint16_t op); + void add_rg_rg(uint16_t op); + void add_rg_rgd(uint16_t op); + void add_rg_in(uint16_t op); + void add_rg_ind(uint16_t op); + void add_rg_de(uint16_t op); + void add_rg_ded(uint16_t op); + void add_rg_ix(uint16_t op); + void add_rg_ixd(uint16_t op); + void add_rgd_rg(uint16_t op); + void add_rgd_rgd(uint16_t op); + void add_rgd_in(uint16_t op); + void add_rgd_ind(uint16_t op); + void add_rgd_de(uint16_t op); + void add_rgd_ded(uint16_t op); + void add_rgd_ix(uint16_t op); + void add_rgd_ixd(uint16_t op); + void add_in_rg(uint16_t op); + void add_in_rgd(uint16_t op); + void add_in_in(uint16_t op); + void add_in_ind(uint16_t op); + void add_in_de(uint16_t op); + void add_in_ded(uint16_t op); + void add_in_ix(uint16_t op); + void add_in_ixd(uint16_t op); + void add_ind_rg(uint16_t op); + void add_ind_rgd(uint16_t op); + void add_ind_in(uint16_t op); + void add_ind_ind(uint16_t op); + void add_ind_de(uint16_t op); + void add_ind_ded(uint16_t op); + void add_ind_ix(uint16_t op); + void add_ind_ixd(uint16_t op); + void add_de_rg(uint16_t op); + void add_de_rgd(uint16_t op); + void add_de_in(uint16_t op); + void add_de_ind(uint16_t op); + void add_de_de(uint16_t op); + void add_de_ded(uint16_t op); + void add_de_ix(uint16_t op); + void add_de_ixd(uint16_t op); + void add_ded_rg(uint16_t op); + void add_ded_rgd(uint16_t op); + void add_ded_in(uint16_t op); + void add_ded_ind(uint16_t op); + void add_ded_de(uint16_t op); + void add_ded_ded(uint16_t op); + void add_ded_ix(uint16_t op); + void add_ded_ixd(uint16_t op); + void add_ix_rg(uint16_t op); + void add_ix_rgd(uint16_t op); + void add_ix_in(uint16_t op); + void add_ix_ind(uint16_t op); + void add_ix_de(uint16_t op); + void add_ix_ded(uint16_t op); + void add_ix_ix(uint16_t op); + void add_ix_ixd(uint16_t op); + void add_ixd_rg(uint16_t op); + void add_ixd_rgd(uint16_t op); + void add_ixd_in(uint16_t op); + void add_ixd_ind(uint16_t op); + void add_ixd_de(uint16_t op); + void add_ixd_ded(uint16_t op); + void add_ixd_ix(uint16_t op); + void add_ixd_ixd(uint16_t op); + void xor_rg(uint16_t op); + void xor_rgd(uint16_t op); + void xor_in(uint16_t op); + void xor_ind(uint16_t op); + void xor_de(uint16_t op); + void xor_ded(uint16_t op); + void xor_ix(uint16_t op); + void xor_ixd(uint16_t op); + void sob(uint16_t op); + void bpl(uint16_t op); + void bmi(uint16_t op); + void bhi(uint16_t op); + void blos(uint16_t op); + void bvc(uint16_t op); + void bvs(uint16_t op); + void bcc(uint16_t op); + void bcs(uint16_t op); + void emt(uint16_t op); + void trap(uint16_t op); + void clrb_rg(uint16_t op); + void clrb_rgd(uint16_t op); + void clrb_in(uint16_t op); + void clrb_ind(uint16_t op); + void clrb_de(uint16_t op); + void clrb_ded(uint16_t op); + void clrb_ix(uint16_t op); + void clrb_ixd(uint16_t op); + void comb_rg(uint16_t op); + void comb_rgd(uint16_t op); + void comb_in(uint16_t op); + void comb_ind(uint16_t op); + void comb_de(uint16_t op); + void comb_ded(uint16_t op); + void comb_ix(uint16_t op); + void comb_ixd(uint16_t op); + void incb_rg(uint16_t op); + void incb_rgd(uint16_t op); + void incb_in(uint16_t op); + void incb_ind(uint16_t op); + void incb_de(uint16_t op); + void incb_ded(uint16_t op); + void incb_ix(uint16_t op); + void incb_ixd(uint16_t op); + void decb_rg(uint16_t op); + void decb_rgd(uint16_t op); + void decb_in(uint16_t op); + void decb_ind(uint16_t op); + void decb_de(uint16_t op); + void decb_ded(uint16_t op); + void decb_ix(uint16_t op); + void decb_ixd(uint16_t op); + void negb_rg(uint16_t op); + void negb_rgd(uint16_t op); + void negb_in(uint16_t op); + void negb_ind(uint16_t op); + void negb_de(uint16_t op); + void negb_ded(uint16_t op); + void negb_ix(uint16_t op); + void negb_ixd(uint16_t op); + void adcb_rg(uint16_t op); + void adcb_rgd(uint16_t op); + void adcb_in(uint16_t op); + void adcb_ind(uint16_t op); + void adcb_de(uint16_t op); + void adcb_ded(uint16_t op); + void adcb_ix(uint16_t op); + void adcb_ixd(uint16_t op); + void sbcb_rg(uint16_t op); + void sbcb_rgd(uint16_t op); + void sbcb_in(uint16_t op); + void sbcb_ind(uint16_t op); + void sbcb_de(uint16_t op); + void sbcb_ded(uint16_t op); + void sbcb_ix(uint16_t op); + void sbcb_ixd(uint16_t op); + void tstb_rg(uint16_t op); + void tstb_rgd(uint16_t op); + void tstb_in(uint16_t op); + void tstb_ind(uint16_t op); + void tstb_de(uint16_t op); + void tstb_ded(uint16_t op); + void tstb_ix(uint16_t op); + void tstb_ixd(uint16_t op); + void rorb_rg(uint16_t op); + void rorb_rgd(uint16_t op); + void rorb_in(uint16_t op); + void rorb_ind(uint16_t op); + void rorb_de(uint16_t op); + void rorb_ded(uint16_t op); + void rorb_ix(uint16_t op); + void rorb_ixd(uint16_t op); + void rolb_rg(uint16_t op); + void rolb_rgd(uint16_t op); + void rolb_in(uint16_t op); + void rolb_ind(uint16_t op); + void rolb_de(uint16_t op); + void rolb_ded(uint16_t op); + void rolb_ix(uint16_t op); + void rolb_ixd(uint16_t op); + void asrb_rg(uint16_t op); + void asrb_rgd(uint16_t op); + void asrb_in(uint16_t op); + void asrb_ind(uint16_t op); + void asrb_de(uint16_t op); + void asrb_ded(uint16_t op); + void asrb_ix(uint16_t op); + void asrb_ixd(uint16_t op); + void aslb_rg(uint16_t op); + void aslb_rgd(uint16_t op); + void aslb_in(uint16_t op); + void aslb_ind(uint16_t op); + void aslb_de(uint16_t op); + void aslb_ded(uint16_t op); + void aslb_ix(uint16_t op); + void aslb_ixd(uint16_t op); + void mtps_rg(uint16_t op); + void mtps_rgd(uint16_t op); + void mtps_in(uint16_t op); + void mtps_ind(uint16_t op); + void mtps_de(uint16_t op); + void mtps_ded(uint16_t op); + void mtps_ix(uint16_t op); + void mtps_ixd(uint16_t op); + void mfps_rg(uint16_t op); + void mfps_rgd(uint16_t op); + void mfps_in(uint16_t op); + void mfps_ind(uint16_t op); + void mfps_de(uint16_t op); + void mfps_ded(uint16_t op); + void mfps_ix(uint16_t op); + void mfps_ixd(uint16_t op); + void movb_rg_rg(uint16_t op); + void movb_rg_rgd(uint16_t op); + void movb_rg_in(uint16_t op); + void movb_rg_ind(uint16_t op); + void movb_rg_de(uint16_t op); + void movb_rg_ded(uint16_t op); + void movb_rg_ix(uint16_t op); + void movb_rg_ixd(uint16_t op); + void movb_rgd_rg(uint16_t op); + void movb_rgd_rgd(uint16_t op); + void movb_rgd_in(uint16_t op); + void movb_rgd_ind(uint16_t op); + void movb_rgd_de(uint16_t op); + void movb_rgd_ded(uint16_t op); + void movb_rgd_ix(uint16_t op); + void movb_rgd_ixd(uint16_t op); + void movb_in_rg(uint16_t op); + void movb_in_rgd(uint16_t op); + void movb_in_in(uint16_t op); + void movb_in_ind(uint16_t op); + void movb_in_de(uint16_t op); + void movb_in_ded(uint16_t op); + void movb_in_ix(uint16_t op); + void movb_in_ixd(uint16_t op); + void movb_ind_rg(uint16_t op); + void movb_ind_rgd(uint16_t op); + void movb_ind_in(uint16_t op); + void movb_ind_ind(uint16_t op); + void movb_ind_de(uint16_t op); + void movb_ind_ded(uint16_t op); + void movb_ind_ix(uint16_t op); + void movb_ind_ixd(uint16_t op); + void movb_de_rg(uint16_t op); + void movb_de_rgd(uint16_t op); + void movb_de_in(uint16_t op); + void movb_de_ind(uint16_t op); + void movb_de_de(uint16_t op); + void movb_de_ded(uint16_t op); + void movb_de_ix(uint16_t op); + void movb_de_ixd(uint16_t op); + void movb_ded_rg(uint16_t op); + void movb_ded_rgd(uint16_t op); + void movb_ded_in(uint16_t op); + void movb_ded_ind(uint16_t op); + void movb_ded_de(uint16_t op); + void movb_ded_ded(uint16_t op); + void movb_ded_ix(uint16_t op); + void movb_ded_ixd(uint16_t op); + void movb_ix_rg(uint16_t op); + void movb_ix_rgd(uint16_t op); + void movb_ix_in(uint16_t op); + void movb_ix_ind(uint16_t op); + void movb_ix_de(uint16_t op); + void movb_ix_ded(uint16_t op); + void movb_ix_ix(uint16_t op); + void movb_ix_ixd(uint16_t op); + void movb_ixd_rg(uint16_t op); + void movb_ixd_rgd(uint16_t op); + void movb_ixd_in(uint16_t op); + void movb_ixd_ind(uint16_t op); + void movb_ixd_de(uint16_t op); + void movb_ixd_ded(uint16_t op); + void movb_ixd_ix(uint16_t op); + void movb_ixd_ixd(uint16_t op); + void cmpb_rg_rg(uint16_t op); + void cmpb_rg_rgd(uint16_t op); + void cmpb_rg_in(uint16_t op); + void cmpb_rg_ind(uint16_t op); + void cmpb_rg_de(uint16_t op); + void cmpb_rg_ded(uint16_t op); + void cmpb_rg_ix(uint16_t op); + void cmpb_rg_ixd(uint16_t op); + void cmpb_rgd_rg(uint16_t op); + void cmpb_rgd_rgd(uint16_t op); + void cmpb_rgd_in(uint16_t op); + void cmpb_rgd_ind(uint16_t op); + void cmpb_rgd_de(uint16_t op); + void cmpb_rgd_ded(uint16_t op); + void cmpb_rgd_ix(uint16_t op); + void cmpb_rgd_ixd(uint16_t op); + void cmpb_in_rg(uint16_t op); + void cmpb_in_rgd(uint16_t op); + void cmpb_in_in(uint16_t op); + void cmpb_in_ind(uint16_t op); + void cmpb_in_de(uint16_t op); + void cmpb_in_ded(uint16_t op); + void cmpb_in_ix(uint16_t op); + void cmpb_in_ixd(uint16_t op); + void cmpb_ind_rg(uint16_t op); + void cmpb_ind_rgd(uint16_t op); + void cmpb_ind_in(uint16_t op); + void cmpb_ind_ind(uint16_t op); + void cmpb_ind_de(uint16_t op); + void cmpb_ind_ded(uint16_t op); + void cmpb_ind_ix(uint16_t op); + void cmpb_ind_ixd(uint16_t op); + void cmpb_de_rg(uint16_t op); + void cmpb_de_rgd(uint16_t op); + void cmpb_de_in(uint16_t op); + void cmpb_de_ind(uint16_t op); + void cmpb_de_de(uint16_t op); + void cmpb_de_ded(uint16_t op); + void cmpb_de_ix(uint16_t op); + void cmpb_de_ixd(uint16_t op); + void cmpb_ded_rg(uint16_t op); + void cmpb_ded_rgd(uint16_t op); + void cmpb_ded_in(uint16_t op); + void cmpb_ded_ind(uint16_t op); + void cmpb_ded_de(uint16_t op); + void cmpb_ded_ded(uint16_t op); + void cmpb_ded_ix(uint16_t op); + void cmpb_ded_ixd(uint16_t op); + void cmpb_ix_rg(uint16_t op); + void cmpb_ix_rgd(uint16_t op); + void cmpb_ix_in(uint16_t op); + void cmpb_ix_ind(uint16_t op); + void cmpb_ix_de(uint16_t op); + void cmpb_ix_ded(uint16_t op); + void cmpb_ix_ix(uint16_t op); + void cmpb_ix_ixd(uint16_t op); + void cmpb_ixd_rg(uint16_t op); + void cmpb_ixd_rgd(uint16_t op); + void cmpb_ixd_in(uint16_t op); + void cmpb_ixd_ind(uint16_t op); + void cmpb_ixd_de(uint16_t op); + void cmpb_ixd_ded(uint16_t op); + void cmpb_ixd_ix(uint16_t op); + void cmpb_ixd_ixd(uint16_t op); + void bitb_rg_rg(uint16_t op); + void bitb_rg_rgd(uint16_t op); + void bitb_rg_in(uint16_t op); + void bitb_rg_ind(uint16_t op); + void bitb_rg_de(uint16_t op); + void bitb_rg_ded(uint16_t op); + void bitb_rg_ix(uint16_t op); + void bitb_rg_ixd(uint16_t op); + void bitb_rgd_rg(uint16_t op); + void bitb_rgd_rgd(uint16_t op); + void bitb_rgd_in(uint16_t op); + void bitb_rgd_ind(uint16_t op); + void bitb_rgd_de(uint16_t op); + void bitb_rgd_ded(uint16_t op); + void bitb_rgd_ix(uint16_t op); + void bitb_rgd_ixd(uint16_t op); + void bitb_in_rg(uint16_t op); + void bitb_in_rgd(uint16_t op); + void bitb_in_in(uint16_t op); + void bitb_in_ind(uint16_t op); + void bitb_in_de(uint16_t op); + void bitb_in_ded(uint16_t op); + void bitb_in_ix(uint16_t op); + void bitb_in_ixd(uint16_t op); + void bitb_ind_rg(uint16_t op); + void bitb_ind_rgd(uint16_t op); + void bitb_ind_in(uint16_t op); + void bitb_ind_ind(uint16_t op); + void bitb_ind_de(uint16_t op); + void bitb_ind_ded(uint16_t op); + void bitb_ind_ix(uint16_t op); + void bitb_ind_ixd(uint16_t op); + void bitb_de_rg(uint16_t op); + void bitb_de_rgd(uint16_t op); + void bitb_de_in(uint16_t op); + void bitb_de_ind(uint16_t op); + void bitb_de_de(uint16_t op); + void bitb_de_ded(uint16_t op); + void bitb_de_ix(uint16_t op); + void bitb_de_ixd(uint16_t op); + void bitb_ded_rg(uint16_t op); + void bitb_ded_rgd(uint16_t op); + void bitb_ded_in(uint16_t op); + void bitb_ded_ind(uint16_t op); + void bitb_ded_de(uint16_t op); + void bitb_ded_ded(uint16_t op); + void bitb_ded_ix(uint16_t op); + void bitb_ded_ixd(uint16_t op); + void bitb_ix_rg(uint16_t op); + void bitb_ix_rgd(uint16_t op); + void bitb_ix_in(uint16_t op); + void bitb_ix_ind(uint16_t op); + void bitb_ix_de(uint16_t op); + void bitb_ix_ded(uint16_t op); + void bitb_ix_ix(uint16_t op); + void bitb_ix_ixd(uint16_t op); + void bitb_ixd_rg(uint16_t op); + void bitb_ixd_rgd(uint16_t op); + void bitb_ixd_in(uint16_t op); + void bitb_ixd_ind(uint16_t op); + void bitb_ixd_de(uint16_t op); + void bitb_ixd_ded(uint16_t op); + void bitb_ixd_ix(uint16_t op); + void bitb_ixd_ixd(uint16_t op); + void bicb_rg_rg(uint16_t op); + void bicb_rg_rgd(uint16_t op); + void bicb_rg_in(uint16_t op); + void bicb_rg_ind(uint16_t op); + void bicb_rg_de(uint16_t op); + void bicb_rg_ded(uint16_t op); + void bicb_rg_ix(uint16_t op); + void bicb_rg_ixd(uint16_t op); + void bicb_rgd_rg(uint16_t op); + void bicb_rgd_rgd(uint16_t op); + void bicb_rgd_in(uint16_t op); + void bicb_rgd_ind(uint16_t op); + void bicb_rgd_de(uint16_t op); + void bicb_rgd_ded(uint16_t op); + void bicb_rgd_ix(uint16_t op); + void bicb_rgd_ixd(uint16_t op); + void bicb_in_rg(uint16_t op); + void bicb_in_rgd(uint16_t op); + void bicb_in_in(uint16_t op); + void bicb_in_ind(uint16_t op); + void bicb_in_de(uint16_t op); + void bicb_in_ded(uint16_t op); + void bicb_in_ix(uint16_t op); + void bicb_in_ixd(uint16_t op); + void bicb_ind_rg(uint16_t op); + void bicb_ind_rgd(uint16_t op); + void bicb_ind_in(uint16_t op); + void bicb_ind_ind(uint16_t op); + void bicb_ind_de(uint16_t op); + void bicb_ind_ded(uint16_t op); + void bicb_ind_ix(uint16_t op); + void bicb_ind_ixd(uint16_t op); + void bicb_de_rg(uint16_t op); + void bicb_de_rgd(uint16_t op); + void bicb_de_in(uint16_t op); + void bicb_de_ind(uint16_t op); + void bicb_de_de(uint16_t op); + void bicb_de_ded(uint16_t op); + void bicb_de_ix(uint16_t op); + void bicb_de_ixd(uint16_t op); + void bicb_ded_rg(uint16_t op); + void bicb_ded_rgd(uint16_t op); + void bicb_ded_in(uint16_t op); + void bicb_ded_ind(uint16_t op); + void bicb_ded_de(uint16_t op); + void bicb_ded_ded(uint16_t op); + void bicb_ded_ix(uint16_t op); + void bicb_ded_ixd(uint16_t op); + void bicb_ix_rg(uint16_t op); + void bicb_ix_rgd(uint16_t op); + void bicb_ix_in(uint16_t op); + void bicb_ix_ind(uint16_t op); + void bicb_ix_de(uint16_t op); + void bicb_ix_ded(uint16_t op); + void bicb_ix_ix(uint16_t op); + void bicb_ix_ixd(uint16_t op); + void bicb_ixd_rg(uint16_t op); + void bicb_ixd_rgd(uint16_t op); + void bicb_ixd_in(uint16_t op); + void bicb_ixd_ind(uint16_t op); + void bicb_ixd_de(uint16_t op); + void bicb_ixd_ded(uint16_t op); + void bicb_ixd_ix(uint16_t op); + void bicb_ixd_ixd(uint16_t op); + void bisb_rg_rg(uint16_t op); + void bisb_rg_rgd(uint16_t op); + void bisb_rg_in(uint16_t op); + void bisb_rg_ind(uint16_t op); + void bisb_rg_de(uint16_t op); + void bisb_rg_ded(uint16_t op); + void bisb_rg_ix(uint16_t op); + void bisb_rg_ixd(uint16_t op); + void bisb_rgd_rg(uint16_t op); + void bisb_rgd_rgd(uint16_t op); + void bisb_rgd_in(uint16_t op); + void bisb_rgd_ind(uint16_t op); + void bisb_rgd_de(uint16_t op); + void bisb_rgd_ded(uint16_t op); + void bisb_rgd_ix(uint16_t op); + void bisb_rgd_ixd(uint16_t op); + void bisb_in_rg(uint16_t op); + void bisb_in_rgd(uint16_t op); + void bisb_in_in(uint16_t op); + void bisb_in_ind(uint16_t op); + void bisb_in_de(uint16_t op); + void bisb_in_ded(uint16_t op); + void bisb_in_ix(uint16_t op); + void bisb_in_ixd(uint16_t op); + void bisb_ind_rg(uint16_t op); + void bisb_ind_rgd(uint16_t op); + void bisb_ind_in(uint16_t op); + void bisb_ind_ind(uint16_t op); + void bisb_ind_de(uint16_t op); + void bisb_ind_ded(uint16_t op); + void bisb_ind_ix(uint16_t op); + void bisb_ind_ixd(uint16_t op); + void bisb_de_rg(uint16_t op); + void bisb_de_rgd(uint16_t op); + void bisb_de_in(uint16_t op); + void bisb_de_ind(uint16_t op); + void bisb_de_de(uint16_t op); + void bisb_de_ded(uint16_t op); + void bisb_de_ix(uint16_t op); + void bisb_de_ixd(uint16_t op); + void bisb_ded_rg(uint16_t op); + void bisb_ded_rgd(uint16_t op); + void bisb_ded_in(uint16_t op); + void bisb_ded_ind(uint16_t op); + void bisb_ded_de(uint16_t op); + void bisb_ded_ded(uint16_t op); + void bisb_ded_ix(uint16_t op); + void bisb_ded_ixd(uint16_t op); + void bisb_ix_rg(uint16_t op); + void bisb_ix_rgd(uint16_t op); + void bisb_ix_in(uint16_t op); + void bisb_ix_ind(uint16_t op); + void bisb_ix_de(uint16_t op); + void bisb_ix_ded(uint16_t op); + void bisb_ix_ix(uint16_t op); + void bisb_ix_ixd(uint16_t op); + void bisb_ixd_rg(uint16_t op); + void bisb_ixd_rgd(uint16_t op); + void bisb_ixd_in(uint16_t op); + void bisb_ixd_ind(uint16_t op); + void bisb_ixd_de(uint16_t op); + void bisb_ixd_ded(uint16_t op); + void bisb_ixd_ix(uint16_t op); + void bisb_ixd_ixd(uint16_t op); + void sub_rg_rg(uint16_t op); + void sub_rg_rgd(uint16_t op); + void sub_rg_in(uint16_t op); + void sub_rg_ind(uint16_t op); + void sub_rg_de(uint16_t op); + void sub_rg_ded(uint16_t op); + void sub_rg_ix(uint16_t op); + void sub_rg_ixd(uint16_t op); + void sub_rgd_rg(uint16_t op); + void sub_rgd_rgd(uint16_t op); + void sub_rgd_in(uint16_t op); + void sub_rgd_ind(uint16_t op); + void sub_rgd_de(uint16_t op); + void sub_rgd_ded(uint16_t op); + void sub_rgd_ix(uint16_t op); + void sub_rgd_ixd(uint16_t op); + void sub_in_rg(uint16_t op); + void sub_in_rgd(uint16_t op); + void sub_in_in(uint16_t op); + void sub_in_ind(uint16_t op); + void sub_in_de(uint16_t op); + void sub_in_ded(uint16_t op); + void sub_in_ix(uint16_t op); + void sub_in_ixd(uint16_t op); + void sub_ind_rg(uint16_t op); + void sub_ind_rgd(uint16_t op); + void sub_ind_in(uint16_t op); + void sub_ind_ind(uint16_t op); + void sub_ind_de(uint16_t op); + void sub_ind_ded(uint16_t op); + void sub_ind_ix(uint16_t op); + void sub_ind_ixd(uint16_t op); + void sub_de_rg(uint16_t op); + void sub_de_rgd(uint16_t op); + void sub_de_in(uint16_t op); + void sub_de_ind(uint16_t op); + void sub_de_de(uint16_t op); + void sub_de_ded(uint16_t op); + void sub_de_ix(uint16_t op); + void sub_de_ixd(uint16_t op); + void sub_ded_rg(uint16_t op); + void sub_ded_rgd(uint16_t op); + void sub_ded_in(uint16_t op); + void sub_ded_ind(uint16_t op); + void sub_ded_de(uint16_t op); + void sub_ded_ded(uint16_t op); + void sub_ded_ix(uint16_t op); + void sub_ded_ixd(uint16_t op); + void sub_ix_rg(uint16_t op); + void sub_ix_rgd(uint16_t op); + void sub_ix_in(uint16_t op); + void sub_ix_ind(uint16_t op); + void sub_ix_de(uint16_t op); + void sub_ix_ded(uint16_t op); + void sub_ix_ix(uint16_t op); + void sub_ix_ixd(uint16_t op); + void sub_ixd_rg(uint16_t op); + void sub_ixd_rgd(uint16_t op); + void sub_ixd_in(uint16_t op); + void sub_ixd_ind(uint16_t op); + void sub_ixd_de(uint16_t op); + void sub_ixd_ded(uint16_t op); + void sub_ixd_ix(uint16_t op); + void sub_ixd_ixd(uint16_t op); }; class k1801vm2_device : public t11_device { public: // construction/destruction - k1801vm2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k1801vm2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides diff --git a/src/devices/cpu/t11/t11dasm.cpp b/src/devices/cpu/t11/t11dasm.cpp index 0bb9da4e7ea..5f2e773dd43 100644 --- a/src/devices/cpu/t11/t11dasm.cpp +++ b/src/devices/cpu/t11/t11dasm.cpp @@ -15,7 +15,7 @@ static const char *const regs[8] = { "R0", "R1", "R2", "R3", "R4", "R5", "SP", "PC" }; -static const UINT8 *rombase; +static const uint8_t *rombase; static offs_t pcbase; #define PARAM_WORD(v) ((v) = rombase[pc - pcbase] | (rombase[pc + 1 - pcbase] << 8), pc += 2) @@ -88,9 +88,9 @@ CPU_DISASSEMBLE( t11 ) { char ea1[32], ea2[32]; unsigned PC = pc; - UINT16 op, lo, hi, addr; - INT16 offset; - UINT32 flags = 0; + uint16_t op, lo, hi, addr; + int16_t offset; + uint32_t flags = 0; rombase = oprom; pcbase = pc; @@ -161,31 +161,31 @@ CPU_DISASSEMBLE( t11 ) sprintf (buffer, "SWAB %s", ea1); break; case 0x0100: case 0x0140: case 0x0180: case 0x01c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BR $%04X", pc + offset); break; case 0x0200: case 0x0240: case 0x0280: case 0x02c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BNE $%04X", pc + offset); break; case 0x0300: case 0x0340: case 0x0380: case 0x03c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BEQ $%04X", pc + offset); break; case 0x0400: case 0x0440: case 0x0480: case 0x04c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BGE $%04X", pc + offset); break; case 0x0500: case 0x0540: case 0x0580: case 0x05c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BLT $%04X", pc + offset); break; case 0x0600: case 0x0640: case 0x0680: case 0x06c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BGT $%04X", pc + offset); break; case 0x0700: case 0x0740: case 0x0780: case 0x07c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BLE $%04X", pc + offset); break; case 0x0800: case 0x0840: case 0x0880: case 0x08c0: @@ -342,35 +342,35 @@ CPU_DISASSEMBLE( t11 ) break; case 0x8000: case 0x8040: case 0x8080: case 0x80c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BPL $%04X", pc + offset); break; case 0x8100: case 0x8140: case 0x8180: case 0x81c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BMI $%04X", pc + offset); break; case 0x8200: case 0x8240: case 0x8280: case 0x82c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BHI $%04X", pc + offset); break; case 0x8300: case 0x8340: case 0x8380: case 0x83c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BLOS $%04X", pc + offset); break; case 0x8400: case 0x8440: case 0x8480: case 0x84c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BVC $%04X", pc + offset); break; case 0x8500: case 0x8540: case 0x8580: case 0x85c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BVS $%04X", pc + offset); break; case 0x8600: case 0x8640: case 0x8680: case 0x86c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BCC $%04X", pc + offset); break; case 0x8700: case 0x8740: case 0x8780: case 0x87c0: - offset = 2 * (INT8)(op & 0xff); + offset = 2 * (int8_t)(op & 0xff); sprintf (buffer, "BCS $%04X", pc + offset); break; case 0x8800: case 0x8840: case 0x8880: case 0x88c0: diff --git a/src/devices/cpu/t11/t11ops.hxx b/src/devices/cpu/t11/t11ops.hxx index 86374fa061f..12856460a21 100644 --- a/src/devices/cpu/t11/t11ops.hxx +++ b/src/devices/cpu/t11/t11ops.hxx @@ -251,7 +251,7 @@ -void t11_device::op_0000(UINT16 op) +void t11_device::op_0000(uint16_t op) { switch (op & 0x3f) { @@ -266,7 +266,7 @@ void t11_device::op_0000(UINT16 op) } } -void t11_device::halt(UINT16 op) +void t11_device::halt(uint16_t op) { m_icount -= 48; PUSH(PSW); @@ -276,7 +276,7 @@ void t11_device::halt(UINT16 op) t11_check_irqs(); } -void t11_device::illegal(UINT16 op) +void t11_device::illegal(uint16_t op) { m_icount -= 48; PUSH(PSW); @@ -286,7 +286,7 @@ void t11_device::illegal(UINT16 op) t11_check_irqs(); } -void t11_device::mark(UINT16 op) +void t11_device::mark(uint16_t op) { m_icount -= 36; @@ -295,15 +295,15 @@ void t11_device::mark(UINT16 op) REGW(5) = POP(); } -void t11_device::jmp_rgd(UINT16 op) { m_icount -= 15; { JMP(RGD); } } -void t11_device::jmp_in(UINT16 op) { m_icount -= 18; { JMP(IN); } } -void t11_device::jmp_ind(UINT16 op) { m_icount -= 18; { JMP(IND); } } -void t11_device::jmp_de(UINT16 op) { m_icount -= 18; { JMP(DE); } } -void t11_device::jmp_ded(UINT16 op) { m_icount -= 21; { JMP(DED); } } -void t11_device::jmp_ix(UINT16 op) { m_icount -= 21; { JMP(IX); } } -void t11_device::jmp_ixd(UINT16 op) { m_icount -= 27; { JMP(IXD); } } +void t11_device::jmp_rgd(uint16_t op) { m_icount -= 15; { JMP(RGD); } } +void t11_device::jmp_in(uint16_t op) { m_icount -= 18; { JMP(IN); } } +void t11_device::jmp_ind(uint16_t op) { m_icount -= 18; { JMP(IND); } } +void t11_device::jmp_de(uint16_t op) { m_icount -= 18; { JMP(DE); } } +void t11_device::jmp_ded(uint16_t op) { m_icount -= 21; { JMP(DED); } } +void t11_device::jmp_ix(uint16_t op) { m_icount -= 21; { JMP(IX); } } +void t11_device::jmp_ixd(uint16_t op) { m_icount -= 27; { JMP(IXD); } } -void t11_device::rts(UINT16 op) +void t11_device::rts(uint16_t op) { int dreg; m_icount -= 21; @@ -312,551 +312,551 @@ void t11_device::rts(UINT16 op) REGW(dreg) = POP(); } -void t11_device::ccc(UINT16 op) { m_icount -= 18; { PSW &= ~(op & 15); } } -void t11_device::scc(UINT16 op) { m_icount -= 18; { PSW |= (op & 15); } } - -void t11_device::swab_rg(UINT16 op) { m_icount -= 12; { SWAB_R(RG); } } -void t11_device::swab_rgd(UINT16 op) { m_icount -= 21; { SWAB_M(RGD); } } -void t11_device::swab_in(UINT16 op) { m_icount -= 21; { SWAB_M(IN); } } -void t11_device::swab_ind(UINT16 op) { m_icount -= 27; { SWAB_M(IND); } } -void t11_device::swab_de(UINT16 op) { m_icount -= 24; { SWAB_M(DE); } } -void t11_device::swab_ded(UINT16 op) { m_icount -= 30; { SWAB_M(DED); } } -void t11_device::swab_ix(UINT16 op) { m_icount -= 30; { SWAB_M(IX); } } -void t11_device::swab_ixd(UINT16 op) { m_icount -= 36; { SWAB_M(IXD); } } - -void t11_device::br(UINT16 op) { m_icount -= 12; { BR(1); } } -void t11_device::bne(UINT16 op) { m_icount -= 12; { BR(!GET_Z); } } -void t11_device::beq(UINT16 op) { m_icount -= 12; { BR( GET_Z); } } -void t11_device::bge(UINT16 op) { m_icount -= 12; { BR(!((GET_N >> 2) ^ GET_V)); } } -void t11_device::blt(UINT16 op) { m_icount -= 12; { BR(((GET_N >> 2) ^ GET_V)); } } -void t11_device::bgt(UINT16 op) { m_icount -= 12; { BR(!GET_Z && !((GET_N >> 2) ^ GET_V)); } } -void t11_device::ble(UINT16 op) { m_icount -= 12; { BR( GET_Z || ((GET_N >> 2) ^ GET_V)); } } - -void t11_device::jsr_rgd(UINT16 op) { m_icount -= 27; { JSR(RGD); } } -void t11_device::jsr_in(UINT16 op) { m_icount -= 30; { JSR(IN); } } -void t11_device::jsr_ind(UINT16 op) { m_icount -= 30; { JSR(IND); } } -void t11_device::jsr_de(UINT16 op) { m_icount -= 30; { JSR(DE); } } -void t11_device::jsr_ded(UINT16 op) { m_icount -= 33; { JSR(DED); } } -void t11_device::jsr_ix(UINT16 op) { m_icount -= 33; { JSR(IX); } } -void t11_device::jsr_ixd(UINT16 op) { m_icount -= 39; { JSR(IXD); } } - -void t11_device::clr_rg(UINT16 op) { m_icount -= 12; { CLR_R(RG); } } -void t11_device::clr_rgd(UINT16 op) { m_icount -= 21; { CLR_M(RGD); } } -void t11_device::clr_in(UINT16 op) { m_icount -= 21; { CLR_M(IN); } } -void t11_device::clr_ind(UINT16 op) { m_icount -= 27; { CLR_M(IND); } } -void t11_device::clr_de(UINT16 op) { m_icount -= 24; { CLR_M(DE); } } -void t11_device::clr_ded(UINT16 op) { m_icount -= 30; { CLR_M(DED); } } -void t11_device::clr_ix(UINT16 op) { m_icount -= 30; { CLR_M(IX); } } -void t11_device::clr_ixd(UINT16 op) { m_icount -= 36; { CLR_M(IXD); } } - -void t11_device::com_rg(UINT16 op) { m_icount -= 12; { COM_R(RG); } } -void t11_device::com_rgd(UINT16 op) { m_icount -= 21; { COM_M(RGD); } } -void t11_device::com_in(UINT16 op) { m_icount -= 21; { COM_M(IN); } } -void t11_device::com_ind(UINT16 op) { m_icount -= 27; { COM_M(IND); } } -void t11_device::com_de(UINT16 op) { m_icount -= 24; { COM_M(DE); } } -void t11_device::com_ded(UINT16 op) { m_icount -= 30; { COM_M(DED); } } -void t11_device::com_ix(UINT16 op) { m_icount -= 30; { COM_M(IX); } } -void t11_device::com_ixd(UINT16 op) { m_icount -= 36; { COM_M(IXD); } } - -void t11_device::inc_rg(UINT16 op) { m_icount -= 12; { INC_R(RG); } } -void t11_device::inc_rgd(UINT16 op) { m_icount -= 21; { INC_M(RGD); } } -void t11_device::inc_in(UINT16 op) { m_icount -= 21; { INC_M(IN); } } -void t11_device::inc_ind(UINT16 op) { m_icount -= 27; { INC_M(IND); } } -void t11_device::inc_de(UINT16 op) { m_icount -= 24; { INC_M(DE); } } -void t11_device::inc_ded(UINT16 op) { m_icount -= 30; { INC_M(DED); } } -void t11_device::inc_ix(UINT16 op) { m_icount -= 30; { INC_M(IX); } } -void t11_device::inc_ixd(UINT16 op) { m_icount -= 36; { INC_M(IXD); } } - -void t11_device::dec_rg(UINT16 op) { m_icount -= 12; { DEC_R(RG); } } -void t11_device::dec_rgd(UINT16 op) { m_icount -= 21; { DEC_M(RGD); } } -void t11_device::dec_in(UINT16 op) { m_icount -= 21; { DEC_M(IN); } } -void t11_device::dec_ind(UINT16 op) { m_icount -= 27; { DEC_M(IND); } } -void t11_device::dec_de(UINT16 op) { m_icount -= 24; { DEC_M(DE); } } -void t11_device::dec_ded(UINT16 op) { m_icount -= 30; { DEC_M(DED); } } -void t11_device::dec_ix(UINT16 op) { m_icount -= 30; { DEC_M(IX); } } -void t11_device::dec_ixd(UINT16 op) { m_icount -= 36; { DEC_M(IXD); } } - -void t11_device::neg_rg(UINT16 op) { m_icount -= 12; { NEG_R(RG); } } -void t11_device::neg_rgd(UINT16 op) { m_icount -= 21; { NEG_M(RGD); } } -void t11_device::neg_in(UINT16 op) { m_icount -= 21; { NEG_M(IN); } } -void t11_device::neg_ind(UINT16 op) { m_icount -= 27; { NEG_M(IND); } } -void t11_device::neg_de(UINT16 op) { m_icount -= 24; { NEG_M(DE); } } -void t11_device::neg_ded(UINT16 op) { m_icount -= 30; { NEG_M(DED); } } -void t11_device::neg_ix(UINT16 op) { m_icount -= 30; { NEG_M(IX); } } -void t11_device::neg_ixd(UINT16 op) { m_icount -= 36; { NEG_M(IXD); } } - -void t11_device::adc_rg(UINT16 op) { m_icount -= 12; { ADC_R(RG); } } -void t11_device::adc_rgd(UINT16 op) { m_icount -= 21; { ADC_M(RGD); } } -void t11_device::adc_in(UINT16 op) { m_icount -= 21; { ADC_M(IN); } } -void t11_device::adc_ind(UINT16 op) { m_icount -= 27; { ADC_M(IND); } } -void t11_device::adc_de(UINT16 op) { m_icount -= 24; { ADC_M(DE); } } -void t11_device::adc_ded(UINT16 op) { m_icount -= 30; { ADC_M(DED); } } -void t11_device::adc_ix(UINT16 op) { m_icount -= 30; { ADC_M(IX); } } -void t11_device::adc_ixd(UINT16 op) { m_icount -= 36; { ADC_M(IXD); } } - -void t11_device::sbc_rg(UINT16 op) { m_icount -= 12; { SBC_R(RG); } } -void t11_device::sbc_rgd(UINT16 op) { m_icount -= 21; { SBC_M(RGD); } } -void t11_device::sbc_in(UINT16 op) { m_icount -= 21; { SBC_M(IN); } } -void t11_device::sbc_ind(UINT16 op) { m_icount -= 27; { SBC_M(IND); } } -void t11_device::sbc_de(UINT16 op) { m_icount -= 24; { SBC_M(DE); } } -void t11_device::sbc_ded(UINT16 op) { m_icount -= 30; { SBC_M(DED); } } -void t11_device::sbc_ix(UINT16 op) { m_icount -= 30; { SBC_M(IX); } } -void t11_device::sbc_ixd(UINT16 op) { m_icount -= 36; { SBC_M(IXD); } } - -void t11_device::tst_rg(UINT16 op) { m_icount -= 12; { TST_R(RG); } } -void t11_device::tst_rgd(UINT16 op) { m_icount -= 18; { TST_M(RGD); } } -void t11_device::tst_in(UINT16 op) { m_icount -= 18; { TST_M(IN); } } -void t11_device::tst_ind(UINT16 op) { m_icount -= 24; { TST_M(IND); } } -void t11_device::tst_de(UINT16 op) { m_icount -= 21; { TST_M(DE); } } -void t11_device::tst_ded(UINT16 op) { m_icount -= 27; { TST_M(DED); } } -void t11_device::tst_ix(UINT16 op) { m_icount -= 27; { TST_M(IX); } } -void t11_device::tst_ixd(UINT16 op) { m_icount -= 33; { TST_M(IXD); } } - -void t11_device::ror_rg(UINT16 op) { m_icount -= 12; { ROR_R(RG); } } -void t11_device::ror_rgd(UINT16 op) { m_icount -= 21; { ROR_M(RGD); } } -void t11_device::ror_in(UINT16 op) { m_icount -= 21; { ROR_M(IN); } } -void t11_device::ror_ind(UINT16 op) { m_icount -= 27; { ROR_M(IND); } } -void t11_device::ror_de(UINT16 op) { m_icount -= 24; { ROR_M(DE); } } -void t11_device::ror_ded(UINT16 op) { m_icount -= 30; { ROR_M(DED); } } -void t11_device::ror_ix(UINT16 op) { m_icount -= 30; { ROR_M(IX); } } -void t11_device::ror_ixd(UINT16 op) { m_icount -= 36; { ROR_M(IXD); } } - -void t11_device::rol_rg(UINT16 op) { m_icount -= 12; { ROL_R(RG); } } -void t11_device::rol_rgd(UINT16 op) { m_icount -= 21; { ROL_M(RGD); } } -void t11_device::rol_in(UINT16 op) { m_icount -= 21; { ROL_M(IN); } } -void t11_device::rol_ind(UINT16 op) { m_icount -= 27; { ROL_M(IND); } } -void t11_device::rol_de(UINT16 op) { m_icount -= 24; { ROL_M(DE); } } -void t11_device::rol_ded(UINT16 op) { m_icount -= 30; { ROL_M(DED); } } -void t11_device::rol_ix(UINT16 op) { m_icount -= 30; { ROL_M(IX); } } -void t11_device::rol_ixd(UINT16 op) { m_icount -= 36; { ROL_M(IXD); } } - -void t11_device::asr_rg(UINT16 op) { m_icount -= 12; { ASR_R(RG); } } -void t11_device::asr_rgd(UINT16 op) { m_icount -= 21; { ASR_M(RGD); } } -void t11_device::asr_in(UINT16 op) { m_icount -= 21; { ASR_M(IN); } } -void t11_device::asr_ind(UINT16 op) { m_icount -= 27; { ASR_M(IND); } } -void t11_device::asr_de(UINT16 op) { m_icount -= 24; { ASR_M(DE); } } -void t11_device::asr_ded(UINT16 op) { m_icount -= 30; { ASR_M(DED); } } -void t11_device::asr_ix(UINT16 op) { m_icount -= 30; { ASR_M(IX); } } -void t11_device::asr_ixd(UINT16 op) { m_icount -= 36; { ASR_M(IXD); } } - -void t11_device::asl_rg(UINT16 op) { m_icount -= 12; { ASL_R(RG); } } -void t11_device::asl_rgd(UINT16 op) { m_icount -= 21; { ASL_M(RGD); } } -void t11_device::asl_in(UINT16 op) { m_icount -= 21; { ASL_M(IN); } } -void t11_device::asl_ind(UINT16 op) { m_icount -= 27; { ASL_M(IND); } } -void t11_device::asl_de(UINT16 op) { m_icount -= 24; { ASL_M(DE); } } -void t11_device::asl_ded(UINT16 op) { m_icount -= 30; { ASL_M(DED); } } -void t11_device::asl_ix(UINT16 op) { m_icount -= 30; { ASL_M(IX); } } -void t11_device::asl_ixd(UINT16 op) { m_icount -= 36; { ASL_M(IXD); } } - -void t11_device::sxt_rg(UINT16 op) { m_icount -= 12; { SXT_R(RG); } } -void t11_device::sxt_rgd(UINT16 op) { m_icount -= 21; { SXT_M(RGD); } } -void t11_device::sxt_in(UINT16 op) { m_icount -= 21; { SXT_M(IN); } } -void t11_device::sxt_ind(UINT16 op) { m_icount -= 27; { SXT_M(IND); } } -void t11_device::sxt_de(UINT16 op) { m_icount -= 24; { SXT_M(DE); } } -void t11_device::sxt_ded(UINT16 op) { m_icount -= 30; { SXT_M(DED); } } -void t11_device::sxt_ix(UINT16 op) { m_icount -= 30; { SXT_M(IX); } } -void t11_device::sxt_ixd(UINT16 op) { m_icount -= 36; { SXT_M(IXD); } } - -void t11_device::mov_rg_rg(UINT16 op) { m_icount -= 9+ 3; { MOV_R(RG,RG); } } -void t11_device::mov_rg_rgd(UINT16 op) { m_icount -= 9+12; { MOV_M(RG,RGD); } } -void t11_device::mov_rg_in(UINT16 op) { m_icount -= 9+12; { MOV_M(RG,IN); } } -void t11_device::mov_rg_ind(UINT16 op) { m_icount -= 9+18; { MOV_M(RG,IND); } } -void t11_device::mov_rg_de(UINT16 op) { m_icount -= 9+15; { MOV_M(RG,DE); } } -void t11_device::mov_rg_ded(UINT16 op) { m_icount -= 9+21; { MOV_M(RG,DED); } } -void t11_device::mov_rg_ix(UINT16 op) { m_icount -= 9+21; { MOV_M(RG,IX); } } -void t11_device::mov_rg_ixd(UINT16 op) { m_icount -= 9+27; { MOV_M(RG,IXD); } } -void t11_device::mov_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { MOV_M(RGD,RG); } } -void t11_device::mov_rgd_rgd(UINT16 op) { m_icount -= 15+12; { MOV_M(RGD,RGD); } } -void t11_device::mov_rgd_in(UINT16 op) { m_icount -= 15+12; { MOV_M(RGD,IN); } } -void t11_device::mov_rgd_ind(UINT16 op) { m_icount -= 15+18; { MOV_M(RGD,IND); } } -void t11_device::mov_rgd_de(UINT16 op) { m_icount -= 15+15; { MOV_M(RGD,DE); } } -void t11_device::mov_rgd_ded(UINT16 op) { m_icount -= 15+21; { MOV_M(RGD,DED); } } -void t11_device::mov_rgd_ix(UINT16 op) { m_icount -= 15+21; { MOV_M(RGD,IX); } } -void t11_device::mov_rgd_ixd(UINT16 op) { m_icount -= 15+27; { MOV_M(RGD,IXD); } } -void t11_device::mov_in_rg(UINT16 op) { m_icount -= 15+ 3; { MOV_M(IN,RG); } } -void t11_device::mov_in_rgd(UINT16 op) { m_icount -= 15+12; { MOV_M(IN,RGD); } } -void t11_device::mov_in_in(UINT16 op) { m_icount -= 15+12; { MOV_M(IN,IN); } } -void t11_device::mov_in_ind(UINT16 op) { m_icount -= 15+18; { MOV_M(IN,IND); } } -void t11_device::mov_in_de(UINT16 op) { m_icount -= 15+15; { MOV_M(IN,DE); } } -void t11_device::mov_in_ded(UINT16 op) { m_icount -= 15+21; { MOV_M(IN,DED); } } -void t11_device::mov_in_ix(UINT16 op) { m_icount -= 15+21; { MOV_M(IN,IX); } } -void t11_device::mov_in_ixd(UINT16 op) { m_icount -= 15+27; { MOV_M(IN,IXD); } } -void t11_device::mov_ind_rg(UINT16 op) { m_icount -= 21+ 3; { MOV_M(IND,RG); } } -void t11_device::mov_ind_rgd(UINT16 op) { m_icount -= 21+12; { MOV_M(IND,RGD); } } -void t11_device::mov_ind_in(UINT16 op) { m_icount -= 21+12; { MOV_M(IND,IN); } } -void t11_device::mov_ind_ind(UINT16 op) { m_icount -= 21+18; { MOV_M(IND,IND); } } -void t11_device::mov_ind_de(UINT16 op) { m_icount -= 21+15; { MOV_M(IND,DE); } } -void t11_device::mov_ind_ded(UINT16 op) { m_icount -= 21+21; { MOV_M(IND,DED); } } -void t11_device::mov_ind_ix(UINT16 op) { m_icount -= 21+21; { MOV_M(IND,IX); } } -void t11_device::mov_ind_ixd(UINT16 op) { m_icount -= 21+27; { MOV_M(IND,IXD); } } -void t11_device::mov_de_rg(UINT16 op) { m_icount -= 18+ 3; { MOV_M(DE,RG); } } -void t11_device::mov_de_rgd(UINT16 op) { m_icount -= 18+12; { MOV_M(DE,RGD); } } -void t11_device::mov_de_in(UINT16 op) { m_icount -= 18+12; { MOV_M(DE,IN); } } -void t11_device::mov_de_ind(UINT16 op) { m_icount -= 18+18; { MOV_M(DE,IND); } } -void t11_device::mov_de_de(UINT16 op) { m_icount -= 18+15; { MOV_M(DE,DE); } } -void t11_device::mov_de_ded(UINT16 op) { m_icount -= 18+21; { MOV_M(DE,DED); } } -void t11_device::mov_de_ix(UINT16 op) { m_icount -= 18+21; { MOV_M(DE,IX); } } -void t11_device::mov_de_ixd(UINT16 op) { m_icount -= 18+27; { MOV_M(DE,IXD); } } -void t11_device::mov_ded_rg(UINT16 op) { m_icount -= 24+ 3; { MOV_M(DED,RG); } } -void t11_device::mov_ded_rgd(UINT16 op) { m_icount -= 24+12; { MOV_M(DED,RGD); } } -void t11_device::mov_ded_in(UINT16 op) { m_icount -= 24+12; { MOV_M(DED,IN); } } -void t11_device::mov_ded_ind(UINT16 op) { m_icount -= 24+18; { MOV_M(DED,IND); } } -void t11_device::mov_ded_de(UINT16 op) { m_icount -= 24+15; { MOV_M(DED,DE); } } -void t11_device::mov_ded_ded(UINT16 op) { m_icount -= 24+21; { MOV_M(DED,DED); } } -void t11_device::mov_ded_ix(UINT16 op) { m_icount -= 24+21; { MOV_M(DED,IX); } } -void t11_device::mov_ded_ixd(UINT16 op) { m_icount -= 24+27; { MOV_M(DED,IXD); } } -void t11_device::mov_ix_rg(UINT16 op) { m_icount -= 24+ 3; { MOV_M(IX,RG); } } -void t11_device::mov_ix_rgd(UINT16 op) { m_icount -= 24+12; { MOV_M(IX,RGD); } } -void t11_device::mov_ix_in(UINT16 op) { m_icount -= 24+12; { MOV_M(IX,IN); } } -void t11_device::mov_ix_ind(UINT16 op) { m_icount -= 24+18; { MOV_M(IX,IND); } } -void t11_device::mov_ix_de(UINT16 op) { m_icount -= 24+15; { MOV_M(IX,DE); } } -void t11_device::mov_ix_ded(UINT16 op) { m_icount -= 24+21; { MOV_M(IX,DED); } } -void t11_device::mov_ix_ix(UINT16 op) { m_icount -= 24+21; { MOV_M(IX,IX); } } -void t11_device::mov_ix_ixd(UINT16 op) { m_icount -= 24+27; { MOV_M(IX,IXD); } } -void t11_device::mov_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { MOV_M(IXD,RG); } } -void t11_device::mov_ixd_rgd(UINT16 op) { m_icount -= 30+12; { MOV_M(IXD,RGD); } } -void t11_device::mov_ixd_in(UINT16 op) { m_icount -= 30+12; { MOV_M(IXD,IN); } } -void t11_device::mov_ixd_ind(UINT16 op) { m_icount -= 30+18; { MOV_M(IXD,IND); } } -void t11_device::mov_ixd_de(UINT16 op) { m_icount -= 30+15; { MOV_M(IXD,DE); } } -void t11_device::mov_ixd_ded(UINT16 op) { m_icount -= 30+21; { MOV_M(IXD,DED); } } -void t11_device::mov_ixd_ix(UINT16 op) { m_icount -= 30+21; { MOV_M(IXD,IX); } } -void t11_device::mov_ixd_ixd(UINT16 op) { m_icount -= 30+27; { MOV_M(IXD,IXD); } } - -void t11_device::cmp_rg_rg(UINT16 op) { m_icount -= 9+ 3; { CMP_R(RG,RG); } } -void t11_device::cmp_rg_rgd(UINT16 op) { m_icount -= 9+ 9; { CMP_M(RG,RGD); } } -void t11_device::cmp_rg_in(UINT16 op) { m_icount -= 9+ 9; { CMP_M(RG,IN); } } -void t11_device::cmp_rg_ind(UINT16 op) { m_icount -= 9+15; { CMP_M(RG,IND); } } -void t11_device::cmp_rg_de(UINT16 op) { m_icount -= 9+12; { CMP_M(RG,DE); } } -void t11_device::cmp_rg_ded(UINT16 op) { m_icount -= 9+18; { CMP_M(RG,DED); } } -void t11_device::cmp_rg_ix(UINT16 op) { m_icount -= 9+18; { CMP_M(RG,IX); } } -void t11_device::cmp_rg_ixd(UINT16 op) { m_icount -= 9+24; { CMP_M(RG,IXD); } } -void t11_device::cmp_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { CMP_M(RGD,RG); } } -void t11_device::cmp_rgd_rgd(UINT16 op) { m_icount -= 15+ 9; { CMP_M(RGD,RGD); } } -void t11_device::cmp_rgd_in(UINT16 op) { m_icount -= 15+ 9; { CMP_M(RGD,IN); } } -void t11_device::cmp_rgd_ind(UINT16 op) { m_icount -= 15+15; { CMP_M(RGD,IND); } } -void t11_device::cmp_rgd_de(UINT16 op) { m_icount -= 15+12; { CMP_M(RGD,DE); } } -void t11_device::cmp_rgd_ded(UINT16 op) { m_icount -= 15+18; { CMP_M(RGD,DED); } } -void t11_device::cmp_rgd_ix(UINT16 op) { m_icount -= 15+18; { CMP_M(RGD,IX); } } -void t11_device::cmp_rgd_ixd(UINT16 op) { m_icount -= 15+24; { CMP_M(RGD,IXD); } } -void t11_device::cmp_in_rg(UINT16 op) { m_icount -= 15+ 3; { CMP_M(IN,RG); } } -void t11_device::cmp_in_rgd(UINT16 op) { m_icount -= 15+ 9; { CMP_M(IN,RGD); } } -void t11_device::cmp_in_in(UINT16 op) { m_icount -= 15+ 9; { CMP_M(IN,IN); } } -void t11_device::cmp_in_ind(UINT16 op) { m_icount -= 15+15; { CMP_M(IN,IND); } } -void t11_device::cmp_in_de(UINT16 op) { m_icount -= 15+12; { CMP_M(IN,DE); } } -void t11_device::cmp_in_ded(UINT16 op) { m_icount -= 15+18; { CMP_M(IN,DED); } } -void t11_device::cmp_in_ix(UINT16 op) { m_icount -= 15+18; { CMP_M(IN,IX); } } -void t11_device::cmp_in_ixd(UINT16 op) { m_icount -= 15+24; { CMP_M(IN,IXD); } } -void t11_device::cmp_ind_rg(UINT16 op) { m_icount -= 21+ 3; { CMP_M(IND,RG); } } -void t11_device::cmp_ind_rgd(UINT16 op) { m_icount -= 21+ 9; { CMP_M(IND,RGD); } } -void t11_device::cmp_ind_in(UINT16 op) { m_icount -= 21+ 9; { CMP_M(IND,IN); } } -void t11_device::cmp_ind_ind(UINT16 op) { m_icount -= 21+15; { CMP_M(IND,IND); } } -void t11_device::cmp_ind_de(UINT16 op) { m_icount -= 21+12; { CMP_M(IND,DE); } } -void t11_device::cmp_ind_ded(UINT16 op) { m_icount -= 21+18; { CMP_M(IND,DED); } } -void t11_device::cmp_ind_ix(UINT16 op) { m_icount -= 21+18; { CMP_M(IND,IX); } } -void t11_device::cmp_ind_ixd(UINT16 op) { m_icount -= 21+24; { CMP_M(IND,IXD); } } -void t11_device::cmp_de_rg(UINT16 op) { m_icount -= 18+ 3; { CMP_M(DE,RG); } } -void t11_device::cmp_de_rgd(UINT16 op) { m_icount -= 18+ 9; { CMP_M(DE,RGD); } } -void t11_device::cmp_de_in(UINT16 op) { m_icount -= 18+ 9; { CMP_M(DE,IN); } } -void t11_device::cmp_de_ind(UINT16 op) { m_icount -= 18+15; { CMP_M(DE,IND); } } -void t11_device::cmp_de_de(UINT16 op) { m_icount -= 18+12; { CMP_M(DE,DE); } } -void t11_device::cmp_de_ded(UINT16 op) { m_icount -= 18+18; { CMP_M(DE,DED); } } -void t11_device::cmp_de_ix(UINT16 op) { m_icount -= 18+18; { CMP_M(DE,IX); } } -void t11_device::cmp_de_ixd(UINT16 op) { m_icount -= 18+24; { CMP_M(DE,IXD); } } -void t11_device::cmp_ded_rg(UINT16 op) { m_icount -= 24+ 3; { CMP_M(DED,RG); } } -void t11_device::cmp_ded_rgd(UINT16 op) { m_icount -= 24+ 9; { CMP_M(DED,RGD); } } -void t11_device::cmp_ded_in(UINT16 op) { m_icount -= 24+ 9; { CMP_M(DED,IN); } } -void t11_device::cmp_ded_ind(UINT16 op) { m_icount -= 24+15; { CMP_M(DED,IND); } } -void t11_device::cmp_ded_de(UINT16 op) { m_icount -= 24+12; { CMP_M(DED,DE); } } -void t11_device::cmp_ded_ded(UINT16 op) { m_icount -= 24+18; { CMP_M(DED,DED); } } -void t11_device::cmp_ded_ix(UINT16 op) { m_icount -= 24+18; { CMP_M(DED,IX); } } -void t11_device::cmp_ded_ixd(UINT16 op) { m_icount -= 24+24; { CMP_M(DED,IXD); } } -void t11_device::cmp_ix_rg(UINT16 op) { m_icount -= 24+ 3; { CMP_M(IX,RG); } } -void t11_device::cmp_ix_rgd(UINT16 op) { m_icount -= 24+ 9; { CMP_M(IX,RGD); } } -void t11_device::cmp_ix_in(UINT16 op) { m_icount -= 24+ 9; { CMP_M(IX,IN); } } -void t11_device::cmp_ix_ind(UINT16 op) { m_icount -= 24+15; { CMP_M(IX,IND); } } -void t11_device::cmp_ix_de(UINT16 op) { m_icount -= 24+12; { CMP_M(IX,DE); } } -void t11_device::cmp_ix_ded(UINT16 op) { m_icount -= 24+18; { CMP_M(IX,DED); } } -void t11_device::cmp_ix_ix(UINT16 op) { m_icount -= 24+18; { CMP_M(IX,IX); } } -void t11_device::cmp_ix_ixd(UINT16 op) { m_icount -= 24+24; { CMP_M(IX,IXD); } } -void t11_device::cmp_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { CMP_M(IXD,RG); } } -void t11_device::cmp_ixd_rgd(UINT16 op) { m_icount -= 30+ 9; { CMP_M(IXD,RGD); } } -void t11_device::cmp_ixd_in(UINT16 op) { m_icount -= 30+ 9; { CMP_M(IXD,IN); } } -void t11_device::cmp_ixd_ind(UINT16 op) { m_icount -= 30+15; { CMP_M(IXD,IND); } } -void t11_device::cmp_ixd_de(UINT16 op) { m_icount -= 30+12; { CMP_M(IXD,DE); } } -void t11_device::cmp_ixd_ded(UINT16 op) { m_icount -= 30+18; { CMP_M(IXD,DED); } } -void t11_device::cmp_ixd_ix(UINT16 op) { m_icount -= 30+18; { CMP_M(IXD,IX); } } -void t11_device::cmp_ixd_ixd(UINT16 op) { m_icount -= 30+24; { CMP_M(IXD,IXD); } } - -void t11_device::bit_rg_rg(UINT16 op) { m_icount -= 9+ 3; { BIT_R(RG,RG); } } -void t11_device::bit_rg_rgd(UINT16 op) { m_icount -= 9+ 9; { BIT_M(RG,RGD); } } -void t11_device::bit_rg_in(UINT16 op) { m_icount -= 9+ 9; { BIT_M(RG,IN); } } -void t11_device::bit_rg_ind(UINT16 op) { m_icount -= 9+15; { BIT_M(RG,IND); } } -void t11_device::bit_rg_de(UINT16 op) { m_icount -= 9+12; { BIT_M(RG,DE); } } -void t11_device::bit_rg_ded(UINT16 op) { m_icount -= 9+18; { BIT_M(RG,DED); } } -void t11_device::bit_rg_ix(UINT16 op) { m_icount -= 9+18; { BIT_M(RG,IX); } } -void t11_device::bit_rg_ixd(UINT16 op) { m_icount -= 9+24; { BIT_M(RG,IXD); } } -void t11_device::bit_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { BIT_M(RGD,RG); } } -void t11_device::bit_rgd_rgd(UINT16 op) { m_icount -= 15+ 9; { BIT_M(RGD,RGD); } } -void t11_device::bit_rgd_in(UINT16 op) { m_icount -= 15+ 9; { BIT_M(RGD,IN); } } -void t11_device::bit_rgd_ind(UINT16 op) { m_icount -= 15+15; { BIT_M(RGD,IND); } } -void t11_device::bit_rgd_de(UINT16 op) { m_icount -= 15+12; { BIT_M(RGD,DE); } } -void t11_device::bit_rgd_ded(UINT16 op) { m_icount -= 15+18; { BIT_M(RGD,DED); } } -void t11_device::bit_rgd_ix(UINT16 op) { m_icount -= 15+18; { BIT_M(RGD,IX); } } -void t11_device::bit_rgd_ixd(UINT16 op) { m_icount -= 15+24; { BIT_M(RGD,IXD); } } -void t11_device::bit_in_rg(UINT16 op) { m_icount -= 15+ 3; { BIT_M(IN,RG); } } -void t11_device::bit_in_rgd(UINT16 op) { m_icount -= 15+ 9; { BIT_M(IN,RGD); } } -void t11_device::bit_in_in(UINT16 op) { m_icount -= 15+ 9; { BIT_M(IN,IN); } } -void t11_device::bit_in_ind(UINT16 op) { m_icount -= 15+15; { BIT_M(IN,IND); } } -void t11_device::bit_in_de(UINT16 op) { m_icount -= 15+12; { BIT_M(IN,DE); } } -void t11_device::bit_in_ded(UINT16 op) { m_icount -= 15+18; { BIT_M(IN,DED); } } -void t11_device::bit_in_ix(UINT16 op) { m_icount -= 15+18; { BIT_M(IN,IX); } } -void t11_device::bit_in_ixd(UINT16 op) { m_icount -= 15+24; { BIT_M(IN,IXD); } } -void t11_device::bit_ind_rg(UINT16 op) { m_icount -= 21+ 3; { BIT_M(IND,RG); } } -void t11_device::bit_ind_rgd(UINT16 op) { m_icount -= 21+ 9; { BIT_M(IND,RGD); } } -void t11_device::bit_ind_in(UINT16 op) { m_icount -= 21+ 9; { BIT_M(IND,IN); } } -void t11_device::bit_ind_ind(UINT16 op) { m_icount -= 21+15; { BIT_M(IND,IND); } } -void t11_device::bit_ind_de(UINT16 op) { m_icount -= 21+12; { BIT_M(IND,DE); } } -void t11_device::bit_ind_ded(UINT16 op) { m_icount -= 21+18; { BIT_M(IND,DED); } } -void t11_device::bit_ind_ix(UINT16 op) { m_icount -= 21+18; { BIT_M(IND,IX); } } -void t11_device::bit_ind_ixd(UINT16 op) { m_icount -= 21+24; { BIT_M(IND,IXD); } } -void t11_device::bit_de_rg(UINT16 op) { m_icount -= 18+ 3; { BIT_M(DE,RG); } } -void t11_device::bit_de_rgd(UINT16 op) { m_icount -= 18+ 9; { BIT_M(DE,RGD); } } -void t11_device::bit_de_in(UINT16 op) { m_icount -= 18+ 9; { BIT_M(DE,IN); } } -void t11_device::bit_de_ind(UINT16 op) { m_icount -= 18+15; { BIT_M(DE,IND); } } -void t11_device::bit_de_de(UINT16 op) { m_icount -= 18+12; { BIT_M(DE,DE); } } -void t11_device::bit_de_ded(UINT16 op) { m_icount -= 18+18; { BIT_M(DE,DED); } } -void t11_device::bit_de_ix(UINT16 op) { m_icount -= 18+18; { BIT_M(DE,IX); } } -void t11_device::bit_de_ixd(UINT16 op) { m_icount -= 18+24; { BIT_M(DE,IXD); } } -void t11_device::bit_ded_rg(UINT16 op) { m_icount -= 24+ 3; { BIT_M(DED,RG); } } -void t11_device::bit_ded_rgd(UINT16 op) { m_icount -= 24+ 9; { BIT_M(DED,RGD); } } -void t11_device::bit_ded_in(UINT16 op) { m_icount -= 24+ 9; { BIT_M(DED,IN); } } -void t11_device::bit_ded_ind(UINT16 op) { m_icount -= 24+15; { BIT_M(DED,IND); } } -void t11_device::bit_ded_de(UINT16 op) { m_icount -= 24+12; { BIT_M(DED,DE); } } -void t11_device::bit_ded_ded(UINT16 op) { m_icount -= 24+18; { BIT_M(DED,DED); } } -void t11_device::bit_ded_ix(UINT16 op) { m_icount -= 24+18; { BIT_M(DED,IX); } } -void t11_device::bit_ded_ixd(UINT16 op) { m_icount -= 24+24; { BIT_M(DED,IXD); } } -void t11_device::bit_ix_rg(UINT16 op) { m_icount -= 24+ 3; { BIT_M(IX,RG); } } -void t11_device::bit_ix_rgd(UINT16 op) { m_icount -= 24+ 9; { BIT_M(IX,RGD); } } -void t11_device::bit_ix_in(UINT16 op) { m_icount -= 24+ 9; { BIT_M(IX,IN); } } -void t11_device::bit_ix_ind(UINT16 op) { m_icount -= 24+15; { BIT_M(IX,IND); } } -void t11_device::bit_ix_de(UINT16 op) { m_icount -= 24+12; { BIT_M(IX,DE); } } -void t11_device::bit_ix_ded(UINT16 op) { m_icount -= 24+18; { BIT_M(IX,DED); } } -void t11_device::bit_ix_ix(UINT16 op) { m_icount -= 24+18; { BIT_M(IX,IX); } } -void t11_device::bit_ix_ixd(UINT16 op) { m_icount -= 24+24; { BIT_M(IX,IXD); } } -void t11_device::bit_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { BIT_M(IXD,RG); } } -void t11_device::bit_ixd_rgd(UINT16 op) { m_icount -= 30+ 9; { BIT_M(IXD,RGD); } } -void t11_device::bit_ixd_in(UINT16 op) { m_icount -= 30+ 9; { BIT_M(IXD,IN); } } -void t11_device::bit_ixd_ind(UINT16 op) { m_icount -= 30+15; { BIT_M(IXD,IND); } } -void t11_device::bit_ixd_de(UINT16 op) { m_icount -= 30+12; { BIT_M(IXD,DE); } } -void t11_device::bit_ixd_ded(UINT16 op) { m_icount -= 30+18; { BIT_M(IXD,DED); } } -void t11_device::bit_ixd_ix(UINT16 op) { m_icount -= 30+18; { BIT_M(IXD,IX); } } -void t11_device::bit_ixd_ixd(UINT16 op) { m_icount -= 30+24; { BIT_M(IXD,IXD); } } - -void t11_device::bic_rg_rg(UINT16 op) { m_icount -= 9+ 3; { BIC_R(RG,RG); } } -void t11_device::bic_rg_rgd(UINT16 op) { m_icount -= 9+12; { BIC_M(RG,RGD); } } -void t11_device::bic_rg_in(UINT16 op) { m_icount -= 9+12; { BIC_M(RG,IN); } } -void t11_device::bic_rg_ind(UINT16 op) { m_icount -= 9+18; { BIC_M(RG,IND); } } -void t11_device::bic_rg_de(UINT16 op) { m_icount -= 9+15; { BIC_M(RG,DE); } } -void t11_device::bic_rg_ded(UINT16 op) { m_icount -= 9+21; { BIC_M(RG,DED); } } -void t11_device::bic_rg_ix(UINT16 op) { m_icount -= 9+21; { BIC_M(RG,IX); } } -void t11_device::bic_rg_ixd(UINT16 op) { m_icount -= 9+27; { BIC_M(RG,IXD); } } -void t11_device::bic_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { BIC_X(RGD,RG); } } -void t11_device::bic_rgd_rgd(UINT16 op) { m_icount -= 15+12; { BIC_M(RGD,RGD); } } -void t11_device::bic_rgd_in(UINT16 op) { m_icount -= 15+12; { BIC_M(RGD,IN); } } -void t11_device::bic_rgd_ind(UINT16 op) { m_icount -= 15+18; { BIC_M(RGD,IND); } } -void t11_device::bic_rgd_de(UINT16 op) { m_icount -= 15+15; { BIC_M(RGD,DE); } } -void t11_device::bic_rgd_ded(UINT16 op) { m_icount -= 15+21; { BIC_M(RGD,DED); } } -void t11_device::bic_rgd_ix(UINT16 op) { m_icount -= 15+21; { BIC_M(RGD,IX); } } -void t11_device::bic_rgd_ixd(UINT16 op) { m_icount -= 15+27; { BIC_M(RGD,IXD); } } -void t11_device::bic_in_rg(UINT16 op) { m_icount -= 15+ 3; { BIC_X(IN,RG); } } -void t11_device::bic_in_rgd(UINT16 op) { m_icount -= 15+12; { BIC_M(IN,RGD); } } -void t11_device::bic_in_in(UINT16 op) { m_icount -= 15+12; { BIC_M(IN,IN); } } -void t11_device::bic_in_ind(UINT16 op) { m_icount -= 15+18; { BIC_M(IN,IND); } } -void t11_device::bic_in_de(UINT16 op) { m_icount -= 15+15; { BIC_M(IN,DE); } } -void t11_device::bic_in_ded(UINT16 op) { m_icount -= 15+21; { BIC_M(IN,DED); } } -void t11_device::bic_in_ix(UINT16 op) { m_icount -= 15+21; { BIC_M(IN,IX); } } -void t11_device::bic_in_ixd(UINT16 op) { m_icount -= 15+27; { BIC_M(IN,IXD); } } -void t11_device::bic_ind_rg(UINT16 op) { m_icount -= 21+ 3; { BIC_X(IND,RG); } } -void t11_device::bic_ind_rgd(UINT16 op) { m_icount -= 21+12; { BIC_M(IND,RGD); } } -void t11_device::bic_ind_in(UINT16 op) { m_icount -= 21+12; { BIC_M(IND,IN); } } -void t11_device::bic_ind_ind(UINT16 op) { m_icount -= 21+18; { BIC_M(IND,IND); } } -void t11_device::bic_ind_de(UINT16 op) { m_icount -= 21+15; { BIC_M(IND,DE); } } -void t11_device::bic_ind_ded(UINT16 op) { m_icount -= 21+21; { BIC_M(IND,DED); } } -void t11_device::bic_ind_ix(UINT16 op) { m_icount -= 21+21; { BIC_M(IND,IX); } } -void t11_device::bic_ind_ixd(UINT16 op) { m_icount -= 21+27; { BIC_M(IND,IXD); } } -void t11_device::bic_de_rg(UINT16 op) { m_icount -= 18+ 3; { BIC_X(DE,RG); } } -void t11_device::bic_de_rgd(UINT16 op) { m_icount -= 18+12; { BIC_M(DE,RGD); } } -void t11_device::bic_de_in(UINT16 op) { m_icount -= 18+12; { BIC_M(DE,IN); } } -void t11_device::bic_de_ind(UINT16 op) { m_icount -= 18+18; { BIC_M(DE,IND); } } -void t11_device::bic_de_de(UINT16 op) { m_icount -= 18+15; { BIC_M(DE,DE); } } -void t11_device::bic_de_ded(UINT16 op) { m_icount -= 18+21; { BIC_M(DE,DED); } } -void t11_device::bic_de_ix(UINT16 op) { m_icount -= 18+21; { BIC_M(DE,IX); } } -void t11_device::bic_de_ixd(UINT16 op) { m_icount -= 18+27; { BIC_M(DE,IXD); } } -void t11_device::bic_ded_rg(UINT16 op) { m_icount -= 24+ 3; { BIC_X(DED,RG); } } -void t11_device::bic_ded_rgd(UINT16 op) { m_icount -= 24+12; { BIC_M(DED,RGD); } } -void t11_device::bic_ded_in(UINT16 op) { m_icount -= 24+12; { BIC_M(DED,IN); } } -void t11_device::bic_ded_ind(UINT16 op) { m_icount -= 24+18; { BIC_M(DED,IND); } } -void t11_device::bic_ded_de(UINT16 op) { m_icount -= 24+15; { BIC_M(DED,DE); } } -void t11_device::bic_ded_ded(UINT16 op) { m_icount -= 24+21; { BIC_M(DED,DED); } } -void t11_device::bic_ded_ix(UINT16 op) { m_icount -= 24+21; { BIC_M(DED,IX); } } -void t11_device::bic_ded_ixd(UINT16 op) { m_icount -= 24+27; { BIC_M(DED,IXD); } } -void t11_device::bic_ix_rg(UINT16 op) { m_icount -= 24+ 3; { BIC_X(IX,RG); } } -void t11_device::bic_ix_rgd(UINT16 op) { m_icount -= 24+12; { BIC_M(IX,RGD); } } -void t11_device::bic_ix_in(UINT16 op) { m_icount -= 24+12; { BIC_M(IX,IN); } } -void t11_device::bic_ix_ind(UINT16 op) { m_icount -= 24+18; { BIC_M(IX,IND); } } -void t11_device::bic_ix_de(UINT16 op) { m_icount -= 24+15; { BIC_M(IX,DE); } } -void t11_device::bic_ix_ded(UINT16 op) { m_icount -= 24+21; { BIC_M(IX,DED); } } -void t11_device::bic_ix_ix(UINT16 op) { m_icount -= 24+21; { BIC_M(IX,IX); } } -void t11_device::bic_ix_ixd(UINT16 op) { m_icount -= 24+27; { BIC_M(IX,IXD); } } -void t11_device::bic_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { BIC_X(IXD,RG); } } -void t11_device::bic_ixd_rgd(UINT16 op) { m_icount -= 30+12; { BIC_M(IXD,RGD); } } -void t11_device::bic_ixd_in(UINT16 op) { m_icount -= 30+12; { BIC_M(IXD,IN); } } -void t11_device::bic_ixd_ind(UINT16 op) { m_icount -= 30+18; { BIC_M(IXD,IND); } } -void t11_device::bic_ixd_de(UINT16 op) { m_icount -= 30+15; { BIC_M(IXD,DE); } } -void t11_device::bic_ixd_ded(UINT16 op) { m_icount -= 30+21; { BIC_M(IXD,DED); } } -void t11_device::bic_ixd_ix(UINT16 op) { m_icount -= 30+21; { BIC_M(IXD,IX); } } -void t11_device::bic_ixd_ixd(UINT16 op) { m_icount -= 30+27; { BIC_M(IXD,IXD); } } - -void t11_device::bis_rg_rg(UINT16 op) { m_icount -= 9+ 3; { BIS_R(RG,RG); } } -void t11_device::bis_rg_rgd(UINT16 op) { m_icount -= 9+12; { BIS_M(RG,RGD); } } -void t11_device::bis_rg_in(UINT16 op) { m_icount -= 9+12; { BIS_M(RG,IN); } } -void t11_device::bis_rg_ind(UINT16 op) { m_icount -= 9+18; { BIS_M(RG,IND); } } -void t11_device::bis_rg_de(UINT16 op) { m_icount -= 9+15; { BIS_M(RG,DE); } } -void t11_device::bis_rg_ded(UINT16 op) { m_icount -= 9+21; { BIS_M(RG,DED); } } -void t11_device::bis_rg_ix(UINT16 op) { m_icount -= 9+21; { BIS_M(RG,IX); } } -void t11_device::bis_rg_ixd(UINT16 op) { m_icount -= 9+27; { BIS_M(RG,IXD); } } -void t11_device::bis_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { BIS_X(RGD,RG); } } -void t11_device::bis_rgd_rgd(UINT16 op) { m_icount -= 15+12; { BIS_M(RGD,RGD); } } -void t11_device::bis_rgd_in(UINT16 op) { m_icount -= 15+12; { BIS_M(RGD,IN); } } -void t11_device::bis_rgd_ind(UINT16 op) { m_icount -= 15+18; { BIS_M(RGD,IND); } } -void t11_device::bis_rgd_de(UINT16 op) { m_icount -= 15+15; { BIS_M(RGD,DE); } } -void t11_device::bis_rgd_ded(UINT16 op) { m_icount -= 15+21; { BIS_M(RGD,DED); } } -void t11_device::bis_rgd_ix(UINT16 op) { m_icount -= 15+21; { BIS_M(RGD,IX); } } -void t11_device::bis_rgd_ixd(UINT16 op) { m_icount -= 15+27; { BIS_M(RGD,IXD); } } -void t11_device::bis_in_rg(UINT16 op) { m_icount -= 15+ 3; { BIS_X(IN,RG); } } -void t11_device::bis_in_rgd(UINT16 op) { m_icount -= 15+12; { BIS_M(IN,RGD); } } -void t11_device::bis_in_in(UINT16 op) { m_icount -= 15+12; { BIS_M(IN,IN); } } -void t11_device::bis_in_ind(UINT16 op) { m_icount -= 15+18; { BIS_M(IN,IND); } } -void t11_device::bis_in_de(UINT16 op) { m_icount -= 15+15; { BIS_M(IN,DE); } } -void t11_device::bis_in_ded(UINT16 op) { m_icount -= 15+21; { BIS_M(IN,DED); } } -void t11_device::bis_in_ix(UINT16 op) { m_icount -= 15+21; { BIS_M(IN,IX); } } -void t11_device::bis_in_ixd(UINT16 op) { m_icount -= 15+27; { BIS_M(IN,IXD); } } -void t11_device::bis_ind_rg(UINT16 op) { m_icount -= 21+ 3; { BIS_X(IND,RG); } } -void t11_device::bis_ind_rgd(UINT16 op) { m_icount -= 21+12; { BIS_M(IND,RGD); } } -void t11_device::bis_ind_in(UINT16 op) { m_icount -= 21+12; { BIS_M(IND,IN); } } -void t11_device::bis_ind_ind(UINT16 op) { m_icount -= 21+18; { BIS_M(IND,IND); } } -void t11_device::bis_ind_de(UINT16 op) { m_icount -= 21+15; { BIS_M(IND,DE); } } -void t11_device::bis_ind_ded(UINT16 op) { m_icount -= 21+21; { BIS_M(IND,DED); } } -void t11_device::bis_ind_ix(UINT16 op) { m_icount -= 21+21; { BIS_M(IND,IX); } } -void t11_device::bis_ind_ixd(UINT16 op) { m_icount -= 21+27; { BIS_M(IND,IXD); } } -void t11_device::bis_de_rg(UINT16 op) { m_icount -= 18+ 3; { BIS_X(DE,RG); } } -void t11_device::bis_de_rgd(UINT16 op) { m_icount -= 18+12; { BIS_M(DE,RGD); } } -void t11_device::bis_de_in(UINT16 op) { m_icount -= 18+12; { BIS_M(DE,IN); } } -void t11_device::bis_de_ind(UINT16 op) { m_icount -= 18+18; { BIS_M(DE,IND); } } -void t11_device::bis_de_de(UINT16 op) { m_icount -= 18+15; { BIS_M(DE,DE); } } -void t11_device::bis_de_ded(UINT16 op) { m_icount -= 18+21; { BIS_M(DE,DED); } } -void t11_device::bis_de_ix(UINT16 op) { m_icount -= 18+21; { BIS_M(DE,IX); } } -void t11_device::bis_de_ixd(UINT16 op) { m_icount -= 18+27; { BIS_M(DE,IXD); } } -void t11_device::bis_ded_rg(UINT16 op) { m_icount -= 24+ 3; { BIS_X(DED,RG); } } -void t11_device::bis_ded_rgd(UINT16 op) { m_icount -= 24+12; { BIS_M(DED,RGD); } } -void t11_device::bis_ded_in(UINT16 op) { m_icount -= 24+12; { BIS_M(DED,IN); } } -void t11_device::bis_ded_ind(UINT16 op) { m_icount -= 24+18; { BIS_M(DED,IND); } } -void t11_device::bis_ded_de(UINT16 op) { m_icount -= 24+15; { BIS_M(DED,DE); } } -void t11_device::bis_ded_ded(UINT16 op) { m_icount -= 24+21; { BIS_M(DED,DED); } } -void t11_device::bis_ded_ix(UINT16 op) { m_icount -= 24+21; { BIS_M(DED,IX); } } -void t11_device::bis_ded_ixd(UINT16 op) { m_icount -= 24+27; { BIS_M(DED,IXD); } } -void t11_device::bis_ix_rg(UINT16 op) { m_icount -= 24+ 3; { BIS_X(IX,RG); } } -void t11_device::bis_ix_rgd(UINT16 op) { m_icount -= 24+12; { BIS_M(IX,RGD); } } -void t11_device::bis_ix_in(UINT16 op) { m_icount -= 24+12; { BIS_M(IX,IN); } } -void t11_device::bis_ix_ind(UINT16 op) { m_icount -= 24+18; { BIS_M(IX,IND); } } -void t11_device::bis_ix_de(UINT16 op) { m_icount -= 24+15; { BIS_M(IX,DE); } } -void t11_device::bis_ix_ded(UINT16 op) { m_icount -= 24+21; { BIS_M(IX,DED); } } -void t11_device::bis_ix_ix(UINT16 op) { m_icount -= 24+21; { BIS_M(IX,IX); } } -void t11_device::bis_ix_ixd(UINT16 op) { m_icount -= 24+27; { BIS_M(IX,IXD); } } -void t11_device::bis_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { BIS_X(IXD,RG); } } -void t11_device::bis_ixd_rgd(UINT16 op) { m_icount -= 30+12; { BIS_M(IXD,RGD); } } -void t11_device::bis_ixd_in(UINT16 op) { m_icount -= 30+12; { BIS_M(IXD,IN); } } -void t11_device::bis_ixd_ind(UINT16 op) { m_icount -= 30+18; { BIS_M(IXD,IND); } } -void t11_device::bis_ixd_de(UINT16 op) { m_icount -= 30+15; { BIS_M(IXD,DE); } } -void t11_device::bis_ixd_ded(UINT16 op) { m_icount -= 30+21; { BIS_M(IXD,DED); } } -void t11_device::bis_ixd_ix(UINT16 op) { m_icount -= 30+21; { BIS_M(IXD,IX); } } -void t11_device::bis_ixd_ixd(UINT16 op) { m_icount -= 30+27; { BIS_M(IXD,IXD); } } - -void t11_device::add_rg_rg(UINT16 op) { m_icount -= 9+ 3; { ADD_R(RG,RG); } } -void t11_device::add_rg_rgd(UINT16 op) { m_icount -= 9+12; { ADD_M(RG,RGD); } } -void t11_device::add_rg_in(UINT16 op) { m_icount -= 9+12; { ADD_M(RG,IN); } } -void t11_device::add_rg_ind(UINT16 op) { m_icount -= 9+18; { ADD_M(RG,IND); } } -void t11_device::add_rg_de(UINT16 op) { m_icount -= 9+15; { ADD_M(RG,DE); } } -void t11_device::add_rg_ded(UINT16 op) { m_icount -= 9+21; { ADD_M(RG,DED); } } -void t11_device::add_rg_ix(UINT16 op) { m_icount -= 9+21; { ADD_M(RG,IX); } } -void t11_device::add_rg_ixd(UINT16 op) { m_icount -= 9+27; { ADD_M(RG,IXD); } } -void t11_device::add_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { ADD_X(RGD,RG); } } -void t11_device::add_rgd_rgd(UINT16 op) { m_icount -= 15+12; { ADD_M(RGD,RGD); } } -void t11_device::add_rgd_in(UINT16 op) { m_icount -= 15+12; { ADD_M(RGD,IN); } } -void t11_device::add_rgd_ind(UINT16 op) { m_icount -= 15+18; { ADD_M(RGD,IND); } } -void t11_device::add_rgd_de(UINT16 op) { m_icount -= 15+15; { ADD_M(RGD,DE); } } -void t11_device::add_rgd_ded(UINT16 op) { m_icount -= 15+21; { ADD_M(RGD,DED); } } -void t11_device::add_rgd_ix(UINT16 op) { m_icount -= 15+21; { ADD_M(RGD,IX); } } -void t11_device::add_rgd_ixd(UINT16 op) { m_icount -= 15+27; { ADD_M(RGD,IXD); } } -void t11_device::add_in_rg(UINT16 op) { m_icount -= 15+ 3; { ADD_X(IN,RG); } } -void t11_device::add_in_rgd(UINT16 op) { m_icount -= 15+12; { ADD_M(IN,RGD); } } -void t11_device::add_in_in(UINT16 op) { m_icount -= 15+12; { ADD_M(IN,IN); } } -void t11_device::add_in_ind(UINT16 op) { m_icount -= 15+18; { ADD_M(IN,IND); } } -void t11_device::add_in_de(UINT16 op) { m_icount -= 15+15; { ADD_M(IN,DE); } } -void t11_device::add_in_ded(UINT16 op) { m_icount -= 15+21; { ADD_M(IN,DED); } } -void t11_device::add_in_ix(UINT16 op) { m_icount -= 15+21; { ADD_M(IN,IX); } } -void t11_device::add_in_ixd(UINT16 op) { m_icount -= 15+27; { ADD_M(IN,IXD); } } -void t11_device::add_ind_rg(UINT16 op) { m_icount -= 21+ 3; { ADD_X(IND,RG); } } -void t11_device::add_ind_rgd(UINT16 op) { m_icount -= 21+12; { ADD_M(IND,RGD); } } -void t11_device::add_ind_in(UINT16 op) { m_icount -= 21+12; { ADD_M(IND,IN); } } -void t11_device::add_ind_ind(UINT16 op) { m_icount -= 21+18; { ADD_M(IND,IND); } } -void t11_device::add_ind_de(UINT16 op) { m_icount -= 21+15; { ADD_M(IND,DE); } } -void t11_device::add_ind_ded(UINT16 op) { m_icount -= 21+21; { ADD_M(IND,DED); } } -void t11_device::add_ind_ix(UINT16 op) { m_icount -= 21+21; { ADD_M(IND,IX); } } -void t11_device::add_ind_ixd(UINT16 op) { m_icount -= 21+27; { ADD_M(IND,IXD); } } -void t11_device::add_de_rg(UINT16 op) { m_icount -= 18+ 3; { ADD_X(DE,RG); } } -void t11_device::add_de_rgd(UINT16 op) { m_icount -= 18+12; { ADD_M(DE,RGD); } } -void t11_device::add_de_in(UINT16 op) { m_icount -= 18+12; { ADD_M(DE,IN); } } -void t11_device::add_de_ind(UINT16 op) { m_icount -= 18+18; { ADD_M(DE,IND); } } -void t11_device::add_de_de(UINT16 op) { m_icount -= 18+15; { ADD_M(DE,DE); } } -void t11_device::add_de_ded(UINT16 op) { m_icount -= 18+21; { ADD_M(DE,DED); } } -void t11_device::add_de_ix(UINT16 op) { m_icount -= 18+21; { ADD_M(DE,IX); } } -void t11_device::add_de_ixd(UINT16 op) { m_icount -= 18+27; { ADD_M(DE,IXD); } } -void t11_device::add_ded_rg(UINT16 op) { m_icount -= 24+ 3; { ADD_X(DED,RG); } } -void t11_device::add_ded_rgd(UINT16 op) { m_icount -= 24+12; { ADD_M(DED,RGD); } } -void t11_device::add_ded_in(UINT16 op) { m_icount -= 24+12; { ADD_M(DED,IN); } } -void t11_device::add_ded_ind(UINT16 op) { m_icount -= 24+18; { ADD_M(DED,IND); } } -void t11_device::add_ded_de(UINT16 op) { m_icount -= 24+15; { ADD_M(DED,DE); } } -void t11_device::add_ded_ded(UINT16 op) { m_icount -= 24+21; { ADD_M(DED,DED); } } -void t11_device::add_ded_ix(UINT16 op) { m_icount -= 24+21; { ADD_M(DED,IX); } } -void t11_device::add_ded_ixd(UINT16 op) { m_icount -= 24+27; { ADD_M(DED,IXD); } } -void t11_device::add_ix_rg(UINT16 op) { m_icount -= 24+ 3; { ADD_X(IX,RG); } } -void t11_device::add_ix_rgd(UINT16 op) { m_icount -= 24+12; { ADD_M(IX,RGD); } } -void t11_device::add_ix_in(UINT16 op) { m_icount -= 24+12; { ADD_M(IX,IN); } } -void t11_device::add_ix_ind(UINT16 op) { m_icount -= 24+18; { ADD_M(IX,IND); } } -void t11_device::add_ix_de(UINT16 op) { m_icount -= 24+15; { ADD_M(IX,DE); } } -void t11_device::add_ix_ded(UINT16 op) { m_icount -= 24+21; { ADD_M(IX,DED); } } -void t11_device::add_ix_ix(UINT16 op) { m_icount -= 24+21; { ADD_M(IX,IX); } } -void t11_device::add_ix_ixd(UINT16 op) { m_icount -= 24+27; { ADD_M(IX,IXD); } } -void t11_device::add_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { ADD_X(IXD,RG); } } -void t11_device::add_ixd_rgd(UINT16 op) { m_icount -= 30+12; { ADD_M(IXD,RGD); } } -void t11_device::add_ixd_in(UINT16 op) { m_icount -= 30+12; { ADD_M(IXD,IN); } } -void t11_device::add_ixd_ind(UINT16 op) { m_icount -= 30+18; { ADD_M(IXD,IND); } } -void t11_device::add_ixd_de(UINT16 op) { m_icount -= 30+15; { ADD_M(IXD,DE); } } -void t11_device::add_ixd_ded(UINT16 op) { m_icount -= 30+21; { ADD_M(IXD,DED); } } -void t11_device::add_ixd_ix(UINT16 op) { m_icount -= 30+21; { ADD_M(IXD,IX); } } -void t11_device::add_ixd_ixd(UINT16 op) { m_icount -= 30+27; { ADD_M(IXD,IXD); } } - -void t11_device::xor_rg(UINT16 op) { m_icount -= 12; { XOR_R(RG); } } -void t11_device::xor_rgd(UINT16 op) { m_icount -= 21; { XOR_M(RGD); } } -void t11_device::xor_in(UINT16 op) { m_icount -= 21; { XOR_M(IN); } } -void t11_device::xor_ind(UINT16 op) { m_icount -= 27; { XOR_M(IND); } } -void t11_device::xor_de(UINT16 op) { m_icount -= 24; { XOR_M(DE); } } -void t11_device::xor_ded(UINT16 op) { m_icount -= 30; { XOR_M(DED); } } -void t11_device::xor_ix(UINT16 op) { m_icount -= 30; { XOR_M(IX); } } -void t11_device::xor_ixd(UINT16 op) { m_icount -= 36; { XOR_M(IXD); } } - -void t11_device::sob(UINT16 op) +void t11_device::ccc(uint16_t op) { m_icount -= 18; { PSW &= ~(op & 15); } } +void t11_device::scc(uint16_t op) { m_icount -= 18; { PSW |= (op & 15); } } + +void t11_device::swab_rg(uint16_t op) { m_icount -= 12; { SWAB_R(RG); } } +void t11_device::swab_rgd(uint16_t op) { m_icount -= 21; { SWAB_M(RGD); } } +void t11_device::swab_in(uint16_t op) { m_icount -= 21; { SWAB_M(IN); } } +void t11_device::swab_ind(uint16_t op) { m_icount -= 27; { SWAB_M(IND); } } +void t11_device::swab_de(uint16_t op) { m_icount -= 24; { SWAB_M(DE); } } +void t11_device::swab_ded(uint16_t op) { m_icount -= 30; { SWAB_M(DED); } } +void t11_device::swab_ix(uint16_t op) { m_icount -= 30; { SWAB_M(IX); } } +void t11_device::swab_ixd(uint16_t op) { m_icount -= 36; { SWAB_M(IXD); } } + +void t11_device::br(uint16_t op) { m_icount -= 12; { BR(1); } } +void t11_device::bne(uint16_t op) { m_icount -= 12; { BR(!GET_Z); } } +void t11_device::beq(uint16_t op) { m_icount -= 12; { BR( GET_Z); } } +void t11_device::bge(uint16_t op) { m_icount -= 12; { BR(!((GET_N >> 2) ^ GET_V)); } } +void t11_device::blt(uint16_t op) { m_icount -= 12; { BR(((GET_N >> 2) ^ GET_V)); } } +void t11_device::bgt(uint16_t op) { m_icount -= 12; { BR(!GET_Z && !((GET_N >> 2) ^ GET_V)); } } +void t11_device::ble(uint16_t op) { m_icount -= 12; { BR( GET_Z || ((GET_N >> 2) ^ GET_V)); } } + +void t11_device::jsr_rgd(uint16_t op) { m_icount -= 27; { JSR(RGD); } } +void t11_device::jsr_in(uint16_t op) { m_icount -= 30; { JSR(IN); } } +void t11_device::jsr_ind(uint16_t op) { m_icount -= 30; { JSR(IND); } } +void t11_device::jsr_de(uint16_t op) { m_icount -= 30; { JSR(DE); } } +void t11_device::jsr_ded(uint16_t op) { m_icount -= 33; { JSR(DED); } } +void t11_device::jsr_ix(uint16_t op) { m_icount -= 33; { JSR(IX); } } +void t11_device::jsr_ixd(uint16_t op) { m_icount -= 39; { JSR(IXD); } } + +void t11_device::clr_rg(uint16_t op) { m_icount -= 12; { CLR_R(RG); } } +void t11_device::clr_rgd(uint16_t op) { m_icount -= 21; { CLR_M(RGD); } } +void t11_device::clr_in(uint16_t op) { m_icount -= 21; { CLR_M(IN); } } +void t11_device::clr_ind(uint16_t op) { m_icount -= 27; { CLR_M(IND); } } +void t11_device::clr_de(uint16_t op) { m_icount -= 24; { CLR_M(DE); } } +void t11_device::clr_ded(uint16_t op) { m_icount -= 30; { CLR_M(DED); } } +void t11_device::clr_ix(uint16_t op) { m_icount -= 30; { CLR_M(IX); } } +void t11_device::clr_ixd(uint16_t op) { m_icount -= 36; { CLR_M(IXD); } } + +void t11_device::com_rg(uint16_t op) { m_icount -= 12; { COM_R(RG); } } +void t11_device::com_rgd(uint16_t op) { m_icount -= 21; { COM_M(RGD); } } +void t11_device::com_in(uint16_t op) { m_icount -= 21; { COM_M(IN); } } +void t11_device::com_ind(uint16_t op) { m_icount -= 27; { COM_M(IND); } } +void t11_device::com_de(uint16_t op) { m_icount -= 24; { COM_M(DE); } } +void t11_device::com_ded(uint16_t op) { m_icount -= 30; { COM_M(DED); } } +void t11_device::com_ix(uint16_t op) { m_icount -= 30; { COM_M(IX); } } +void t11_device::com_ixd(uint16_t op) { m_icount -= 36; { COM_M(IXD); } } + +void t11_device::inc_rg(uint16_t op) { m_icount -= 12; { INC_R(RG); } } +void t11_device::inc_rgd(uint16_t op) { m_icount -= 21; { INC_M(RGD); } } +void t11_device::inc_in(uint16_t op) { m_icount -= 21; { INC_M(IN); } } +void t11_device::inc_ind(uint16_t op) { m_icount -= 27; { INC_M(IND); } } +void t11_device::inc_de(uint16_t op) { m_icount -= 24; { INC_M(DE); } } +void t11_device::inc_ded(uint16_t op) { m_icount -= 30; { INC_M(DED); } } +void t11_device::inc_ix(uint16_t op) { m_icount -= 30; { INC_M(IX); } } +void t11_device::inc_ixd(uint16_t op) { m_icount -= 36; { INC_M(IXD); } } + +void t11_device::dec_rg(uint16_t op) { m_icount -= 12; { DEC_R(RG); } } +void t11_device::dec_rgd(uint16_t op) { m_icount -= 21; { DEC_M(RGD); } } +void t11_device::dec_in(uint16_t op) { m_icount -= 21; { DEC_M(IN); } } +void t11_device::dec_ind(uint16_t op) { m_icount -= 27; { DEC_M(IND); } } +void t11_device::dec_de(uint16_t op) { m_icount -= 24; { DEC_M(DE); } } +void t11_device::dec_ded(uint16_t op) { m_icount -= 30; { DEC_M(DED); } } +void t11_device::dec_ix(uint16_t op) { m_icount -= 30; { DEC_M(IX); } } +void t11_device::dec_ixd(uint16_t op) { m_icount -= 36; { DEC_M(IXD); } } + +void t11_device::neg_rg(uint16_t op) { m_icount -= 12; { NEG_R(RG); } } +void t11_device::neg_rgd(uint16_t op) { m_icount -= 21; { NEG_M(RGD); } } +void t11_device::neg_in(uint16_t op) { m_icount -= 21; { NEG_M(IN); } } +void t11_device::neg_ind(uint16_t op) { m_icount -= 27; { NEG_M(IND); } } +void t11_device::neg_de(uint16_t op) { m_icount -= 24; { NEG_M(DE); } } +void t11_device::neg_ded(uint16_t op) { m_icount -= 30; { NEG_M(DED); } } +void t11_device::neg_ix(uint16_t op) { m_icount -= 30; { NEG_M(IX); } } +void t11_device::neg_ixd(uint16_t op) { m_icount -= 36; { NEG_M(IXD); } } + +void t11_device::adc_rg(uint16_t op) { m_icount -= 12; { ADC_R(RG); } } +void t11_device::adc_rgd(uint16_t op) { m_icount -= 21; { ADC_M(RGD); } } +void t11_device::adc_in(uint16_t op) { m_icount -= 21; { ADC_M(IN); } } +void t11_device::adc_ind(uint16_t op) { m_icount -= 27; { ADC_M(IND); } } +void t11_device::adc_de(uint16_t op) { m_icount -= 24; { ADC_M(DE); } } +void t11_device::adc_ded(uint16_t op) { m_icount -= 30; { ADC_M(DED); } } +void t11_device::adc_ix(uint16_t op) { m_icount -= 30; { ADC_M(IX); } } +void t11_device::adc_ixd(uint16_t op) { m_icount -= 36; { ADC_M(IXD); } } + +void t11_device::sbc_rg(uint16_t op) { m_icount -= 12; { SBC_R(RG); } } +void t11_device::sbc_rgd(uint16_t op) { m_icount -= 21; { SBC_M(RGD); } } +void t11_device::sbc_in(uint16_t op) { m_icount -= 21; { SBC_M(IN); } } +void t11_device::sbc_ind(uint16_t op) { m_icount -= 27; { SBC_M(IND); } } +void t11_device::sbc_de(uint16_t op) { m_icount -= 24; { SBC_M(DE); } } +void t11_device::sbc_ded(uint16_t op) { m_icount -= 30; { SBC_M(DED); } } +void t11_device::sbc_ix(uint16_t op) { m_icount -= 30; { SBC_M(IX); } } +void t11_device::sbc_ixd(uint16_t op) { m_icount -= 36; { SBC_M(IXD); } } + +void t11_device::tst_rg(uint16_t op) { m_icount -= 12; { TST_R(RG); } } +void t11_device::tst_rgd(uint16_t op) { m_icount -= 18; { TST_M(RGD); } } +void t11_device::tst_in(uint16_t op) { m_icount -= 18; { TST_M(IN); } } +void t11_device::tst_ind(uint16_t op) { m_icount -= 24; { TST_M(IND); } } +void t11_device::tst_de(uint16_t op) { m_icount -= 21; { TST_M(DE); } } +void t11_device::tst_ded(uint16_t op) { m_icount -= 27; { TST_M(DED); } } +void t11_device::tst_ix(uint16_t op) { m_icount -= 27; { TST_M(IX); } } +void t11_device::tst_ixd(uint16_t op) { m_icount -= 33; { TST_M(IXD); } } + +void t11_device::ror_rg(uint16_t op) { m_icount -= 12; { ROR_R(RG); } } +void t11_device::ror_rgd(uint16_t op) { m_icount -= 21; { ROR_M(RGD); } } +void t11_device::ror_in(uint16_t op) { m_icount -= 21; { ROR_M(IN); } } +void t11_device::ror_ind(uint16_t op) { m_icount -= 27; { ROR_M(IND); } } +void t11_device::ror_de(uint16_t op) { m_icount -= 24; { ROR_M(DE); } } +void t11_device::ror_ded(uint16_t op) { m_icount -= 30; { ROR_M(DED); } } +void t11_device::ror_ix(uint16_t op) { m_icount -= 30; { ROR_M(IX); } } +void t11_device::ror_ixd(uint16_t op) { m_icount -= 36; { ROR_M(IXD); } } + +void t11_device::rol_rg(uint16_t op) { m_icount -= 12; { ROL_R(RG); } } +void t11_device::rol_rgd(uint16_t op) { m_icount -= 21; { ROL_M(RGD); } } +void t11_device::rol_in(uint16_t op) { m_icount -= 21; { ROL_M(IN); } } +void t11_device::rol_ind(uint16_t op) { m_icount -= 27; { ROL_M(IND); } } +void t11_device::rol_de(uint16_t op) { m_icount -= 24; { ROL_M(DE); } } +void t11_device::rol_ded(uint16_t op) { m_icount -= 30; { ROL_M(DED); } } +void t11_device::rol_ix(uint16_t op) { m_icount -= 30; { ROL_M(IX); } } +void t11_device::rol_ixd(uint16_t op) { m_icount -= 36; { ROL_M(IXD); } } + +void t11_device::asr_rg(uint16_t op) { m_icount -= 12; { ASR_R(RG); } } +void t11_device::asr_rgd(uint16_t op) { m_icount -= 21; { ASR_M(RGD); } } +void t11_device::asr_in(uint16_t op) { m_icount -= 21; { ASR_M(IN); } } +void t11_device::asr_ind(uint16_t op) { m_icount -= 27; { ASR_M(IND); } } +void t11_device::asr_de(uint16_t op) { m_icount -= 24; { ASR_M(DE); } } +void t11_device::asr_ded(uint16_t op) { m_icount -= 30; { ASR_M(DED); } } +void t11_device::asr_ix(uint16_t op) { m_icount -= 30; { ASR_M(IX); } } +void t11_device::asr_ixd(uint16_t op) { m_icount -= 36; { ASR_M(IXD); } } + +void t11_device::asl_rg(uint16_t op) { m_icount -= 12; { ASL_R(RG); } } +void t11_device::asl_rgd(uint16_t op) { m_icount -= 21; { ASL_M(RGD); } } +void t11_device::asl_in(uint16_t op) { m_icount -= 21; { ASL_M(IN); } } +void t11_device::asl_ind(uint16_t op) { m_icount -= 27; { ASL_M(IND); } } +void t11_device::asl_de(uint16_t op) { m_icount -= 24; { ASL_M(DE); } } +void t11_device::asl_ded(uint16_t op) { m_icount -= 30; { ASL_M(DED); } } +void t11_device::asl_ix(uint16_t op) { m_icount -= 30; { ASL_M(IX); } } +void t11_device::asl_ixd(uint16_t op) { m_icount -= 36; { ASL_M(IXD); } } + +void t11_device::sxt_rg(uint16_t op) { m_icount -= 12; { SXT_R(RG); } } +void t11_device::sxt_rgd(uint16_t op) { m_icount -= 21; { SXT_M(RGD); } } +void t11_device::sxt_in(uint16_t op) { m_icount -= 21; { SXT_M(IN); } } +void t11_device::sxt_ind(uint16_t op) { m_icount -= 27; { SXT_M(IND); } } +void t11_device::sxt_de(uint16_t op) { m_icount -= 24; { SXT_M(DE); } } +void t11_device::sxt_ded(uint16_t op) { m_icount -= 30; { SXT_M(DED); } } +void t11_device::sxt_ix(uint16_t op) { m_icount -= 30; { SXT_M(IX); } } +void t11_device::sxt_ixd(uint16_t op) { m_icount -= 36; { SXT_M(IXD); } } + +void t11_device::mov_rg_rg(uint16_t op) { m_icount -= 9+ 3; { MOV_R(RG,RG); } } +void t11_device::mov_rg_rgd(uint16_t op) { m_icount -= 9+12; { MOV_M(RG,RGD); } } +void t11_device::mov_rg_in(uint16_t op) { m_icount -= 9+12; { MOV_M(RG,IN); } } +void t11_device::mov_rg_ind(uint16_t op) { m_icount -= 9+18; { MOV_M(RG,IND); } } +void t11_device::mov_rg_de(uint16_t op) { m_icount -= 9+15; { MOV_M(RG,DE); } } +void t11_device::mov_rg_ded(uint16_t op) { m_icount -= 9+21; { MOV_M(RG,DED); } } +void t11_device::mov_rg_ix(uint16_t op) { m_icount -= 9+21; { MOV_M(RG,IX); } } +void t11_device::mov_rg_ixd(uint16_t op) { m_icount -= 9+27; { MOV_M(RG,IXD); } } +void t11_device::mov_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { MOV_M(RGD,RG); } } +void t11_device::mov_rgd_rgd(uint16_t op) { m_icount -= 15+12; { MOV_M(RGD,RGD); } } +void t11_device::mov_rgd_in(uint16_t op) { m_icount -= 15+12; { MOV_M(RGD,IN); } } +void t11_device::mov_rgd_ind(uint16_t op) { m_icount -= 15+18; { MOV_M(RGD,IND); } } +void t11_device::mov_rgd_de(uint16_t op) { m_icount -= 15+15; { MOV_M(RGD,DE); } } +void t11_device::mov_rgd_ded(uint16_t op) { m_icount -= 15+21; { MOV_M(RGD,DED); } } +void t11_device::mov_rgd_ix(uint16_t op) { m_icount -= 15+21; { MOV_M(RGD,IX); } } +void t11_device::mov_rgd_ixd(uint16_t op) { m_icount -= 15+27; { MOV_M(RGD,IXD); } } +void t11_device::mov_in_rg(uint16_t op) { m_icount -= 15+ 3; { MOV_M(IN,RG); } } +void t11_device::mov_in_rgd(uint16_t op) { m_icount -= 15+12; { MOV_M(IN,RGD); } } +void t11_device::mov_in_in(uint16_t op) { m_icount -= 15+12; { MOV_M(IN,IN); } } +void t11_device::mov_in_ind(uint16_t op) { m_icount -= 15+18; { MOV_M(IN,IND); } } +void t11_device::mov_in_de(uint16_t op) { m_icount -= 15+15; { MOV_M(IN,DE); } } +void t11_device::mov_in_ded(uint16_t op) { m_icount -= 15+21; { MOV_M(IN,DED); } } +void t11_device::mov_in_ix(uint16_t op) { m_icount -= 15+21; { MOV_M(IN,IX); } } +void t11_device::mov_in_ixd(uint16_t op) { m_icount -= 15+27; { MOV_M(IN,IXD); } } +void t11_device::mov_ind_rg(uint16_t op) { m_icount -= 21+ 3; { MOV_M(IND,RG); } } +void t11_device::mov_ind_rgd(uint16_t op) { m_icount -= 21+12; { MOV_M(IND,RGD); } } +void t11_device::mov_ind_in(uint16_t op) { m_icount -= 21+12; { MOV_M(IND,IN); } } +void t11_device::mov_ind_ind(uint16_t op) { m_icount -= 21+18; { MOV_M(IND,IND); } } +void t11_device::mov_ind_de(uint16_t op) { m_icount -= 21+15; { MOV_M(IND,DE); } } +void t11_device::mov_ind_ded(uint16_t op) { m_icount -= 21+21; { MOV_M(IND,DED); } } +void t11_device::mov_ind_ix(uint16_t op) { m_icount -= 21+21; { MOV_M(IND,IX); } } +void t11_device::mov_ind_ixd(uint16_t op) { m_icount -= 21+27; { MOV_M(IND,IXD); } } +void t11_device::mov_de_rg(uint16_t op) { m_icount -= 18+ 3; { MOV_M(DE,RG); } } +void t11_device::mov_de_rgd(uint16_t op) { m_icount -= 18+12; { MOV_M(DE,RGD); } } +void t11_device::mov_de_in(uint16_t op) { m_icount -= 18+12; { MOV_M(DE,IN); } } +void t11_device::mov_de_ind(uint16_t op) { m_icount -= 18+18; { MOV_M(DE,IND); } } +void t11_device::mov_de_de(uint16_t op) { m_icount -= 18+15; { MOV_M(DE,DE); } } +void t11_device::mov_de_ded(uint16_t op) { m_icount -= 18+21; { MOV_M(DE,DED); } } +void t11_device::mov_de_ix(uint16_t op) { m_icount -= 18+21; { MOV_M(DE,IX); } } +void t11_device::mov_de_ixd(uint16_t op) { m_icount -= 18+27; { MOV_M(DE,IXD); } } +void t11_device::mov_ded_rg(uint16_t op) { m_icount -= 24+ 3; { MOV_M(DED,RG); } } +void t11_device::mov_ded_rgd(uint16_t op) { m_icount -= 24+12; { MOV_M(DED,RGD); } } +void t11_device::mov_ded_in(uint16_t op) { m_icount -= 24+12; { MOV_M(DED,IN); } } +void t11_device::mov_ded_ind(uint16_t op) { m_icount -= 24+18; { MOV_M(DED,IND); } } +void t11_device::mov_ded_de(uint16_t op) { m_icount -= 24+15; { MOV_M(DED,DE); } } +void t11_device::mov_ded_ded(uint16_t op) { m_icount -= 24+21; { MOV_M(DED,DED); } } +void t11_device::mov_ded_ix(uint16_t op) { m_icount -= 24+21; { MOV_M(DED,IX); } } +void t11_device::mov_ded_ixd(uint16_t op) { m_icount -= 24+27; { MOV_M(DED,IXD); } } +void t11_device::mov_ix_rg(uint16_t op) { m_icount -= 24+ 3; { MOV_M(IX,RG); } } +void t11_device::mov_ix_rgd(uint16_t op) { m_icount -= 24+12; { MOV_M(IX,RGD); } } +void t11_device::mov_ix_in(uint16_t op) { m_icount -= 24+12; { MOV_M(IX,IN); } } +void t11_device::mov_ix_ind(uint16_t op) { m_icount -= 24+18; { MOV_M(IX,IND); } } +void t11_device::mov_ix_de(uint16_t op) { m_icount -= 24+15; { MOV_M(IX,DE); } } +void t11_device::mov_ix_ded(uint16_t op) { m_icount -= 24+21; { MOV_M(IX,DED); } } +void t11_device::mov_ix_ix(uint16_t op) { m_icount -= 24+21; { MOV_M(IX,IX); } } +void t11_device::mov_ix_ixd(uint16_t op) { m_icount -= 24+27; { MOV_M(IX,IXD); } } +void t11_device::mov_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { MOV_M(IXD,RG); } } +void t11_device::mov_ixd_rgd(uint16_t op) { m_icount -= 30+12; { MOV_M(IXD,RGD); } } +void t11_device::mov_ixd_in(uint16_t op) { m_icount -= 30+12; { MOV_M(IXD,IN); } } +void t11_device::mov_ixd_ind(uint16_t op) { m_icount -= 30+18; { MOV_M(IXD,IND); } } +void t11_device::mov_ixd_de(uint16_t op) { m_icount -= 30+15; { MOV_M(IXD,DE); } } +void t11_device::mov_ixd_ded(uint16_t op) { m_icount -= 30+21; { MOV_M(IXD,DED); } } +void t11_device::mov_ixd_ix(uint16_t op) { m_icount -= 30+21; { MOV_M(IXD,IX); } } +void t11_device::mov_ixd_ixd(uint16_t op) { m_icount -= 30+27; { MOV_M(IXD,IXD); } } + +void t11_device::cmp_rg_rg(uint16_t op) { m_icount -= 9+ 3; { CMP_R(RG,RG); } } +void t11_device::cmp_rg_rgd(uint16_t op) { m_icount -= 9+ 9; { CMP_M(RG,RGD); } } +void t11_device::cmp_rg_in(uint16_t op) { m_icount -= 9+ 9; { CMP_M(RG,IN); } } +void t11_device::cmp_rg_ind(uint16_t op) { m_icount -= 9+15; { CMP_M(RG,IND); } } +void t11_device::cmp_rg_de(uint16_t op) { m_icount -= 9+12; { CMP_M(RG,DE); } } +void t11_device::cmp_rg_ded(uint16_t op) { m_icount -= 9+18; { CMP_M(RG,DED); } } +void t11_device::cmp_rg_ix(uint16_t op) { m_icount -= 9+18; { CMP_M(RG,IX); } } +void t11_device::cmp_rg_ixd(uint16_t op) { m_icount -= 9+24; { CMP_M(RG,IXD); } } +void t11_device::cmp_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { CMP_M(RGD,RG); } } +void t11_device::cmp_rgd_rgd(uint16_t op) { m_icount -= 15+ 9; { CMP_M(RGD,RGD); } } +void t11_device::cmp_rgd_in(uint16_t op) { m_icount -= 15+ 9; { CMP_M(RGD,IN); } } +void t11_device::cmp_rgd_ind(uint16_t op) { m_icount -= 15+15; { CMP_M(RGD,IND); } } +void t11_device::cmp_rgd_de(uint16_t op) { m_icount -= 15+12; { CMP_M(RGD,DE); } } +void t11_device::cmp_rgd_ded(uint16_t op) { m_icount -= 15+18; { CMP_M(RGD,DED); } } +void t11_device::cmp_rgd_ix(uint16_t op) { m_icount -= 15+18; { CMP_M(RGD,IX); } } +void t11_device::cmp_rgd_ixd(uint16_t op) { m_icount -= 15+24; { CMP_M(RGD,IXD); } } +void t11_device::cmp_in_rg(uint16_t op) { m_icount -= 15+ 3; { CMP_M(IN,RG); } } +void t11_device::cmp_in_rgd(uint16_t op) { m_icount -= 15+ 9; { CMP_M(IN,RGD); } } +void t11_device::cmp_in_in(uint16_t op) { m_icount -= 15+ 9; { CMP_M(IN,IN); } } +void t11_device::cmp_in_ind(uint16_t op) { m_icount -= 15+15; { CMP_M(IN,IND); } } +void t11_device::cmp_in_de(uint16_t op) { m_icount -= 15+12; { CMP_M(IN,DE); } } +void t11_device::cmp_in_ded(uint16_t op) { m_icount -= 15+18; { CMP_M(IN,DED); } } +void t11_device::cmp_in_ix(uint16_t op) { m_icount -= 15+18; { CMP_M(IN,IX); } } +void t11_device::cmp_in_ixd(uint16_t op) { m_icount -= 15+24; { CMP_M(IN,IXD); } } +void t11_device::cmp_ind_rg(uint16_t op) { m_icount -= 21+ 3; { CMP_M(IND,RG); } } +void t11_device::cmp_ind_rgd(uint16_t op) { m_icount -= 21+ 9; { CMP_M(IND,RGD); } } +void t11_device::cmp_ind_in(uint16_t op) { m_icount -= 21+ 9; { CMP_M(IND,IN); } } +void t11_device::cmp_ind_ind(uint16_t op) { m_icount -= 21+15; { CMP_M(IND,IND); } } +void t11_device::cmp_ind_de(uint16_t op) { m_icount -= 21+12; { CMP_M(IND,DE); } } +void t11_device::cmp_ind_ded(uint16_t op) { m_icount -= 21+18; { CMP_M(IND,DED); } } +void t11_device::cmp_ind_ix(uint16_t op) { m_icount -= 21+18; { CMP_M(IND,IX); } } +void t11_device::cmp_ind_ixd(uint16_t op) { m_icount -= 21+24; { CMP_M(IND,IXD); } } +void t11_device::cmp_de_rg(uint16_t op) { m_icount -= 18+ 3; { CMP_M(DE,RG); } } +void t11_device::cmp_de_rgd(uint16_t op) { m_icount -= 18+ 9; { CMP_M(DE,RGD); } } +void t11_device::cmp_de_in(uint16_t op) { m_icount -= 18+ 9; { CMP_M(DE,IN); } } +void t11_device::cmp_de_ind(uint16_t op) { m_icount -= 18+15; { CMP_M(DE,IND); } } +void t11_device::cmp_de_de(uint16_t op) { m_icount -= 18+12; { CMP_M(DE,DE); } } +void t11_device::cmp_de_ded(uint16_t op) { m_icount -= 18+18; { CMP_M(DE,DED); } } +void t11_device::cmp_de_ix(uint16_t op) { m_icount -= 18+18; { CMP_M(DE,IX); } } +void t11_device::cmp_de_ixd(uint16_t op) { m_icount -= 18+24; { CMP_M(DE,IXD); } } +void t11_device::cmp_ded_rg(uint16_t op) { m_icount -= 24+ 3; { CMP_M(DED,RG); } } +void t11_device::cmp_ded_rgd(uint16_t op) { m_icount -= 24+ 9; { CMP_M(DED,RGD); } } +void t11_device::cmp_ded_in(uint16_t op) { m_icount -= 24+ 9; { CMP_M(DED,IN); } } +void t11_device::cmp_ded_ind(uint16_t op) { m_icount -= 24+15; { CMP_M(DED,IND); } } +void t11_device::cmp_ded_de(uint16_t op) { m_icount -= 24+12; { CMP_M(DED,DE); } } +void t11_device::cmp_ded_ded(uint16_t op) { m_icount -= 24+18; { CMP_M(DED,DED); } } +void t11_device::cmp_ded_ix(uint16_t op) { m_icount -= 24+18; { CMP_M(DED,IX); } } +void t11_device::cmp_ded_ixd(uint16_t op) { m_icount -= 24+24; { CMP_M(DED,IXD); } } +void t11_device::cmp_ix_rg(uint16_t op) { m_icount -= 24+ 3; { CMP_M(IX,RG); } } +void t11_device::cmp_ix_rgd(uint16_t op) { m_icount -= 24+ 9; { CMP_M(IX,RGD); } } +void t11_device::cmp_ix_in(uint16_t op) { m_icount -= 24+ 9; { CMP_M(IX,IN); } } +void t11_device::cmp_ix_ind(uint16_t op) { m_icount -= 24+15; { CMP_M(IX,IND); } } +void t11_device::cmp_ix_de(uint16_t op) { m_icount -= 24+12; { CMP_M(IX,DE); } } +void t11_device::cmp_ix_ded(uint16_t op) { m_icount -= 24+18; { CMP_M(IX,DED); } } +void t11_device::cmp_ix_ix(uint16_t op) { m_icount -= 24+18; { CMP_M(IX,IX); } } +void t11_device::cmp_ix_ixd(uint16_t op) { m_icount -= 24+24; { CMP_M(IX,IXD); } } +void t11_device::cmp_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { CMP_M(IXD,RG); } } +void t11_device::cmp_ixd_rgd(uint16_t op) { m_icount -= 30+ 9; { CMP_M(IXD,RGD); } } +void t11_device::cmp_ixd_in(uint16_t op) { m_icount -= 30+ 9; { CMP_M(IXD,IN); } } +void t11_device::cmp_ixd_ind(uint16_t op) { m_icount -= 30+15; { CMP_M(IXD,IND); } } +void t11_device::cmp_ixd_de(uint16_t op) { m_icount -= 30+12; { CMP_M(IXD,DE); } } +void t11_device::cmp_ixd_ded(uint16_t op) { m_icount -= 30+18; { CMP_M(IXD,DED); } } +void t11_device::cmp_ixd_ix(uint16_t op) { m_icount -= 30+18; { CMP_M(IXD,IX); } } +void t11_device::cmp_ixd_ixd(uint16_t op) { m_icount -= 30+24; { CMP_M(IXD,IXD); } } + +void t11_device::bit_rg_rg(uint16_t op) { m_icount -= 9+ 3; { BIT_R(RG,RG); } } +void t11_device::bit_rg_rgd(uint16_t op) { m_icount -= 9+ 9; { BIT_M(RG,RGD); } } +void t11_device::bit_rg_in(uint16_t op) { m_icount -= 9+ 9; { BIT_M(RG,IN); } } +void t11_device::bit_rg_ind(uint16_t op) { m_icount -= 9+15; { BIT_M(RG,IND); } } +void t11_device::bit_rg_de(uint16_t op) { m_icount -= 9+12; { BIT_M(RG,DE); } } +void t11_device::bit_rg_ded(uint16_t op) { m_icount -= 9+18; { BIT_M(RG,DED); } } +void t11_device::bit_rg_ix(uint16_t op) { m_icount -= 9+18; { BIT_M(RG,IX); } } +void t11_device::bit_rg_ixd(uint16_t op) { m_icount -= 9+24; { BIT_M(RG,IXD); } } +void t11_device::bit_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { BIT_M(RGD,RG); } } +void t11_device::bit_rgd_rgd(uint16_t op) { m_icount -= 15+ 9; { BIT_M(RGD,RGD); } } +void t11_device::bit_rgd_in(uint16_t op) { m_icount -= 15+ 9; { BIT_M(RGD,IN); } } +void t11_device::bit_rgd_ind(uint16_t op) { m_icount -= 15+15; { BIT_M(RGD,IND); } } +void t11_device::bit_rgd_de(uint16_t op) { m_icount -= 15+12; { BIT_M(RGD,DE); } } +void t11_device::bit_rgd_ded(uint16_t op) { m_icount -= 15+18; { BIT_M(RGD,DED); } } +void t11_device::bit_rgd_ix(uint16_t op) { m_icount -= 15+18; { BIT_M(RGD,IX); } } +void t11_device::bit_rgd_ixd(uint16_t op) { m_icount -= 15+24; { BIT_M(RGD,IXD); } } +void t11_device::bit_in_rg(uint16_t op) { m_icount -= 15+ 3; { BIT_M(IN,RG); } } +void t11_device::bit_in_rgd(uint16_t op) { m_icount -= 15+ 9; { BIT_M(IN,RGD); } } +void t11_device::bit_in_in(uint16_t op) { m_icount -= 15+ 9; { BIT_M(IN,IN); } } +void t11_device::bit_in_ind(uint16_t op) { m_icount -= 15+15; { BIT_M(IN,IND); } } +void t11_device::bit_in_de(uint16_t op) { m_icount -= 15+12; { BIT_M(IN,DE); } } +void t11_device::bit_in_ded(uint16_t op) { m_icount -= 15+18; { BIT_M(IN,DED); } } +void t11_device::bit_in_ix(uint16_t op) { m_icount -= 15+18; { BIT_M(IN,IX); } } +void t11_device::bit_in_ixd(uint16_t op) { m_icount -= 15+24; { BIT_M(IN,IXD); } } +void t11_device::bit_ind_rg(uint16_t op) { m_icount -= 21+ 3; { BIT_M(IND,RG); } } +void t11_device::bit_ind_rgd(uint16_t op) { m_icount -= 21+ 9; { BIT_M(IND,RGD); } } +void t11_device::bit_ind_in(uint16_t op) { m_icount -= 21+ 9; { BIT_M(IND,IN); } } +void t11_device::bit_ind_ind(uint16_t op) { m_icount -= 21+15; { BIT_M(IND,IND); } } +void t11_device::bit_ind_de(uint16_t op) { m_icount -= 21+12; { BIT_M(IND,DE); } } +void t11_device::bit_ind_ded(uint16_t op) { m_icount -= 21+18; { BIT_M(IND,DED); } } +void t11_device::bit_ind_ix(uint16_t op) { m_icount -= 21+18; { BIT_M(IND,IX); } } +void t11_device::bit_ind_ixd(uint16_t op) { m_icount -= 21+24; { BIT_M(IND,IXD); } } +void t11_device::bit_de_rg(uint16_t op) { m_icount -= 18+ 3; { BIT_M(DE,RG); } } +void t11_device::bit_de_rgd(uint16_t op) { m_icount -= 18+ 9; { BIT_M(DE,RGD); } } +void t11_device::bit_de_in(uint16_t op) { m_icount -= 18+ 9; { BIT_M(DE,IN); } } +void t11_device::bit_de_ind(uint16_t op) { m_icount -= 18+15; { BIT_M(DE,IND); } } +void t11_device::bit_de_de(uint16_t op) { m_icount -= 18+12; { BIT_M(DE,DE); } } +void t11_device::bit_de_ded(uint16_t op) { m_icount -= 18+18; { BIT_M(DE,DED); } } +void t11_device::bit_de_ix(uint16_t op) { m_icount -= 18+18; { BIT_M(DE,IX); } } +void t11_device::bit_de_ixd(uint16_t op) { m_icount -= 18+24; { BIT_M(DE,IXD); } } +void t11_device::bit_ded_rg(uint16_t op) { m_icount -= 24+ 3; { BIT_M(DED,RG); } } +void t11_device::bit_ded_rgd(uint16_t op) { m_icount -= 24+ 9; { BIT_M(DED,RGD); } } +void t11_device::bit_ded_in(uint16_t op) { m_icount -= 24+ 9; { BIT_M(DED,IN); } } +void t11_device::bit_ded_ind(uint16_t op) { m_icount -= 24+15; { BIT_M(DED,IND); } } +void t11_device::bit_ded_de(uint16_t op) { m_icount -= 24+12; { BIT_M(DED,DE); } } +void t11_device::bit_ded_ded(uint16_t op) { m_icount -= 24+18; { BIT_M(DED,DED); } } +void t11_device::bit_ded_ix(uint16_t op) { m_icount -= 24+18; { BIT_M(DED,IX); } } +void t11_device::bit_ded_ixd(uint16_t op) { m_icount -= 24+24; { BIT_M(DED,IXD); } } +void t11_device::bit_ix_rg(uint16_t op) { m_icount -= 24+ 3; { BIT_M(IX,RG); } } +void t11_device::bit_ix_rgd(uint16_t op) { m_icount -= 24+ 9; { BIT_M(IX,RGD); } } +void t11_device::bit_ix_in(uint16_t op) { m_icount -= 24+ 9; { BIT_M(IX,IN); } } +void t11_device::bit_ix_ind(uint16_t op) { m_icount -= 24+15; { BIT_M(IX,IND); } } +void t11_device::bit_ix_de(uint16_t op) { m_icount -= 24+12; { BIT_M(IX,DE); } } +void t11_device::bit_ix_ded(uint16_t op) { m_icount -= 24+18; { BIT_M(IX,DED); } } +void t11_device::bit_ix_ix(uint16_t op) { m_icount -= 24+18; { BIT_M(IX,IX); } } +void t11_device::bit_ix_ixd(uint16_t op) { m_icount -= 24+24; { BIT_M(IX,IXD); } } +void t11_device::bit_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { BIT_M(IXD,RG); } } +void t11_device::bit_ixd_rgd(uint16_t op) { m_icount -= 30+ 9; { BIT_M(IXD,RGD); } } +void t11_device::bit_ixd_in(uint16_t op) { m_icount -= 30+ 9; { BIT_M(IXD,IN); } } +void t11_device::bit_ixd_ind(uint16_t op) { m_icount -= 30+15; { BIT_M(IXD,IND); } } +void t11_device::bit_ixd_de(uint16_t op) { m_icount -= 30+12; { BIT_M(IXD,DE); } } +void t11_device::bit_ixd_ded(uint16_t op) { m_icount -= 30+18; { BIT_M(IXD,DED); } } +void t11_device::bit_ixd_ix(uint16_t op) { m_icount -= 30+18; { BIT_M(IXD,IX); } } +void t11_device::bit_ixd_ixd(uint16_t op) { m_icount -= 30+24; { BIT_M(IXD,IXD); } } + +void t11_device::bic_rg_rg(uint16_t op) { m_icount -= 9+ 3; { BIC_R(RG,RG); } } +void t11_device::bic_rg_rgd(uint16_t op) { m_icount -= 9+12; { BIC_M(RG,RGD); } } +void t11_device::bic_rg_in(uint16_t op) { m_icount -= 9+12; { BIC_M(RG,IN); } } +void t11_device::bic_rg_ind(uint16_t op) { m_icount -= 9+18; { BIC_M(RG,IND); } } +void t11_device::bic_rg_de(uint16_t op) { m_icount -= 9+15; { BIC_M(RG,DE); } } +void t11_device::bic_rg_ded(uint16_t op) { m_icount -= 9+21; { BIC_M(RG,DED); } } +void t11_device::bic_rg_ix(uint16_t op) { m_icount -= 9+21; { BIC_M(RG,IX); } } +void t11_device::bic_rg_ixd(uint16_t op) { m_icount -= 9+27; { BIC_M(RG,IXD); } } +void t11_device::bic_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { BIC_X(RGD,RG); } } +void t11_device::bic_rgd_rgd(uint16_t op) { m_icount -= 15+12; { BIC_M(RGD,RGD); } } +void t11_device::bic_rgd_in(uint16_t op) { m_icount -= 15+12; { BIC_M(RGD,IN); } } +void t11_device::bic_rgd_ind(uint16_t op) { m_icount -= 15+18; { BIC_M(RGD,IND); } } +void t11_device::bic_rgd_de(uint16_t op) { m_icount -= 15+15; { BIC_M(RGD,DE); } } +void t11_device::bic_rgd_ded(uint16_t op) { m_icount -= 15+21; { BIC_M(RGD,DED); } } +void t11_device::bic_rgd_ix(uint16_t op) { m_icount -= 15+21; { BIC_M(RGD,IX); } } +void t11_device::bic_rgd_ixd(uint16_t op) { m_icount -= 15+27; { BIC_M(RGD,IXD); } } +void t11_device::bic_in_rg(uint16_t op) { m_icount -= 15+ 3; { BIC_X(IN,RG); } } +void t11_device::bic_in_rgd(uint16_t op) { m_icount -= 15+12; { BIC_M(IN,RGD); } } +void t11_device::bic_in_in(uint16_t op) { m_icount -= 15+12; { BIC_M(IN,IN); } } +void t11_device::bic_in_ind(uint16_t op) { m_icount -= 15+18; { BIC_M(IN,IND); } } +void t11_device::bic_in_de(uint16_t op) { m_icount -= 15+15; { BIC_M(IN,DE); } } +void t11_device::bic_in_ded(uint16_t op) { m_icount -= 15+21; { BIC_M(IN,DED); } } +void t11_device::bic_in_ix(uint16_t op) { m_icount -= 15+21; { BIC_M(IN,IX); } } +void t11_device::bic_in_ixd(uint16_t op) { m_icount -= 15+27; { BIC_M(IN,IXD); } } +void t11_device::bic_ind_rg(uint16_t op) { m_icount -= 21+ 3; { BIC_X(IND,RG); } } +void t11_device::bic_ind_rgd(uint16_t op) { m_icount -= 21+12; { BIC_M(IND,RGD); } } +void t11_device::bic_ind_in(uint16_t op) { m_icount -= 21+12; { BIC_M(IND,IN); } } +void t11_device::bic_ind_ind(uint16_t op) { m_icount -= 21+18; { BIC_M(IND,IND); } } +void t11_device::bic_ind_de(uint16_t op) { m_icount -= 21+15; { BIC_M(IND,DE); } } +void t11_device::bic_ind_ded(uint16_t op) { m_icount -= 21+21; { BIC_M(IND,DED); } } +void t11_device::bic_ind_ix(uint16_t op) { m_icount -= 21+21; { BIC_M(IND,IX); } } +void t11_device::bic_ind_ixd(uint16_t op) { m_icount -= 21+27; { BIC_M(IND,IXD); } } +void t11_device::bic_de_rg(uint16_t op) { m_icount -= 18+ 3; { BIC_X(DE,RG); } } +void t11_device::bic_de_rgd(uint16_t op) { m_icount -= 18+12; { BIC_M(DE,RGD); } } +void t11_device::bic_de_in(uint16_t op) { m_icount -= 18+12; { BIC_M(DE,IN); } } +void t11_device::bic_de_ind(uint16_t op) { m_icount -= 18+18; { BIC_M(DE,IND); } } +void t11_device::bic_de_de(uint16_t op) { m_icount -= 18+15; { BIC_M(DE,DE); } } +void t11_device::bic_de_ded(uint16_t op) { m_icount -= 18+21; { BIC_M(DE,DED); } } +void t11_device::bic_de_ix(uint16_t op) { m_icount -= 18+21; { BIC_M(DE,IX); } } +void t11_device::bic_de_ixd(uint16_t op) { m_icount -= 18+27; { BIC_M(DE,IXD); } } +void t11_device::bic_ded_rg(uint16_t op) { m_icount -= 24+ 3; { BIC_X(DED,RG); } } +void t11_device::bic_ded_rgd(uint16_t op) { m_icount -= 24+12; { BIC_M(DED,RGD); } } +void t11_device::bic_ded_in(uint16_t op) { m_icount -= 24+12; { BIC_M(DED,IN); } } +void t11_device::bic_ded_ind(uint16_t op) { m_icount -= 24+18; { BIC_M(DED,IND); } } +void t11_device::bic_ded_de(uint16_t op) { m_icount -= 24+15; { BIC_M(DED,DE); } } +void t11_device::bic_ded_ded(uint16_t op) { m_icount -= 24+21; { BIC_M(DED,DED); } } +void t11_device::bic_ded_ix(uint16_t op) { m_icount -= 24+21; { BIC_M(DED,IX); } } +void t11_device::bic_ded_ixd(uint16_t op) { m_icount -= 24+27; { BIC_M(DED,IXD); } } +void t11_device::bic_ix_rg(uint16_t op) { m_icount -= 24+ 3; { BIC_X(IX,RG); } } +void t11_device::bic_ix_rgd(uint16_t op) { m_icount -= 24+12; { BIC_M(IX,RGD); } } +void t11_device::bic_ix_in(uint16_t op) { m_icount -= 24+12; { BIC_M(IX,IN); } } +void t11_device::bic_ix_ind(uint16_t op) { m_icount -= 24+18; { BIC_M(IX,IND); } } +void t11_device::bic_ix_de(uint16_t op) { m_icount -= 24+15; { BIC_M(IX,DE); } } +void t11_device::bic_ix_ded(uint16_t op) { m_icount -= 24+21; { BIC_M(IX,DED); } } +void t11_device::bic_ix_ix(uint16_t op) { m_icount -= 24+21; { BIC_M(IX,IX); } } +void t11_device::bic_ix_ixd(uint16_t op) { m_icount -= 24+27; { BIC_M(IX,IXD); } } +void t11_device::bic_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { BIC_X(IXD,RG); } } +void t11_device::bic_ixd_rgd(uint16_t op) { m_icount -= 30+12; { BIC_M(IXD,RGD); } } +void t11_device::bic_ixd_in(uint16_t op) { m_icount -= 30+12; { BIC_M(IXD,IN); } } +void t11_device::bic_ixd_ind(uint16_t op) { m_icount -= 30+18; { BIC_M(IXD,IND); } } +void t11_device::bic_ixd_de(uint16_t op) { m_icount -= 30+15; { BIC_M(IXD,DE); } } +void t11_device::bic_ixd_ded(uint16_t op) { m_icount -= 30+21; { BIC_M(IXD,DED); } } +void t11_device::bic_ixd_ix(uint16_t op) { m_icount -= 30+21; { BIC_M(IXD,IX); } } +void t11_device::bic_ixd_ixd(uint16_t op) { m_icount -= 30+27; { BIC_M(IXD,IXD); } } + +void t11_device::bis_rg_rg(uint16_t op) { m_icount -= 9+ 3; { BIS_R(RG,RG); } } +void t11_device::bis_rg_rgd(uint16_t op) { m_icount -= 9+12; { BIS_M(RG,RGD); } } +void t11_device::bis_rg_in(uint16_t op) { m_icount -= 9+12; { BIS_M(RG,IN); } } +void t11_device::bis_rg_ind(uint16_t op) { m_icount -= 9+18; { BIS_M(RG,IND); } } +void t11_device::bis_rg_de(uint16_t op) { m_icount -= 9+15; { BIS_M(RG,DE); } } +void t11_device::bis_rg_ded(uint16_t op) { m_icount -= 9+21; { BIS_M(RG,DED); } } +void t11_device::bis_rg_ix(uint16_t op) { m_icount -= 9+21; { BIS_M(RG,IX); } } +void t11_device::bis_rg_ixd(uint16_t op) { m_icount -= 9+27; { BIS_M(RG,IXD); } } +void t11_device::bis_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { BIS_X(RGD,RG); } } +void t11_device::bis_rgd_rgd(uint16_t op) { m_icount -= 15+12; { BIS_M(RGD,RGD); } } +void t11_device::bis_rgd_in(uint16_t op) { m_icount -= 15+12; { BIS_M(RGD,IN); } } +void t11_device::bis_rgd_ind(uint16_t op) { m_icount -= 15+18; { BIS_M(RGD,IND); } } +void t11_device::bis_rgd_de(uint16_t op) { m_icount -= 15+15; { BIS_M(RGD,DE); } } +void t11_device::bis_rgd_ded(uint16_t op) { m_icount -= 15+21; { BIS_M(RGD,DED); } } +void t11_device::bis_rgd_ix(uint16_t op) { m_icount -= 15+21; { BIS_M(RGD,IX); } } +void t11_device::bis_rgd_ixd(uint16_t op) { m_icount -= 15+27; { BIS_M(RGD,IXD); } } +void t11_device::bis_in_rg(uint16_t op) { m_icount -= 15+ 3; { BIS_X(IN,RG); } } +void t11_device::bis_in_rgd(uint16_t op) { m_icount -= 15+12; { BIS_M(IN,RGD); } } +void t11_device::bis_in_in(uint16_t op) { m_icount -= 15+12; { BIS_M(IN,IN); } } +void t11_device::bis_in_ind(uint16_t op) { m_icount -= 15+18; { BIS_M(IN,IND); } } +void t11_device::bis_in_de(uint16_t op) { m_icount -= 15+15; { BIS_M(IN,DE); } } +void t11_device::bis_in_ded(uint16_t op) { m_icount -= 15+21; { BIS_M(IN,DED); } } +void t11_device::bis_in_ix(uint16_t op) { m_icount -= 15+21; { BIS_M(IN,IX); } } +void t11_device::bis_in_ixd(uint16_t op) { m_icount -= 15+27; { BIS_M(IN,IXD); } } +void t11_device::bis_ind_rg(uint16_t op) { m_icount -= 21+ 3; { BIS_X(IND,RG); } } +void t11_device::bis_ind_rgd(uint16_t op) { m_icount -= 21+12; { BIS_M(IND,RGD); } } +void t11_device::bis_ind_in(uint16_t op) { m_icount -= 21+12; { BIS_M(IND,IN); } } +void t11_device::bis_ind_ind(uint16_t op) { m_icount -= 21+18; { BIS_M(IND,IND); } } +void t11_device::bis_ind_de(uint16_t op) { m_icount -= 21+15; { BIS_M(IND,DE); } } +void t11_device::bis_ind_ded(uint16_t op) { m_icount -= 21+21; { BIS_M(IND,DED); } } +void t11_device::bis_ind_ix(uint16_t op) { m_icount -= 21+21; { BIS_M(IND,IX); } } +void t11_device::bis_ind_ixd(uint16_t op) { m_icount -= 21+27; { BIS_M(IND,IXD); } } +void t11_device::bis_de_rg(uint16_t op) { m_icount -= 18+ 3; { BIS_X(DE,RG); } } +void t11_device::bis_de_rgd(uint16_t op) { m_icount -= 18+12; { BIS_M(DE,RGD); } } +void t11_device::bis_de_in(uint16_t op) { m_icount -= 18+12; { BIS_M(DE,IN); } } +void t11_device::bis_de_ind(uint16_t op) { m_icount -= 18+18; { BIS_M(DE,IND); } } +void t11_device::bis_de_de(uint16_t op) { m_icount -= 18+15; { BIS_M(DE,DE); } } +void t11_device::bis_de_ded(uint16_t op) { m_icount -= 18+21; { BIS_M(DE,DED); } } +void t11_device::bis_de_ix(uint16_t op) { m_icount -= 18+21; { BIS_M(DE,IX); } } +void t11_device::bis_de_ixd(uint16_t op) { m_icount -= 18+27; { BIS_M(DE,IXD); } } +void t11_device::bis_ded_rg(uint16_t op) { m_icount -= 24+ 3; { BIS_X(DED,RG); } } +void t11_device::bis_ded_rgd(uint16_t op) { m_icount -= 24+12; { BIS_M(DED,RGD); } } +void t11_device::bis_ded_in(uint16_t op) { m_icount -= 24+12; { BIS_M(DED,IN); } } +void t11_device::bis_ded_ind(uint16_t op) { m_icount -= 24+18; { BIS_M(DED,IND); } } +void t11_device::bis_ded_de(uint16_t op) { m_icount -= 24+15; { BIS_M(DED,DE); } } +void t11_device::bis_ded_ded(uint16_t op) { m_icount -= 24+21; { BIS_M(DED,DED); } } +void t11_device::bis_ded_ix(uint16_t op) { m_icount -= 24+21; { BIS_M(DED,IX); } } +void t11_device::bis_ded_ixd(uint16_t op) { m_icount -= 24+27; { BIS_M(DED,IXD); } } +void t11_device::bis_ix_rg(uint16_t op) { m_icount -= 24+ 3; { BIS_X(IX,RG); } } +void t11_device::bis_ix_rgd(uint16_t op) { m_icount -= 24+12; { BIS_M(IX,RGD); } } +void t11_device::bis_ix_in(uint16_t op) { m_icount -= 24+12; { BIS_M(IX,IN); } } +void t11_device::bis_ix_ind(uint16_t op) { m_icount -= 24+18; { BIS_M(IX,IND); } } +void t11_device::bis_ix_de(uint16_t op) { m_icount -= 24+15; { BIS_M(IX,DE); } } +void t11_device::bis_ix_ded(uint16_t op) { m_icount -= 24+21; { BIS_M(IX,DED); } } +void t11_device::bis_ix_ix(uint16_t op) { m_icount -= 24+21; { BIS_M(IX,IX); } } +void t11_device::bis_ix_ixd(uint16_t op) { m_icount -= 24+27; { BIS_M(IX,IXD); } } +void t11_device::bis_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { BIS_X(IXD,RG); } } +void t11_device::bis_ixd_rgd(uint16_t op) { m_icount -= 30+12; { BIS_M(IXD,RGD); } } +void t11_device::bis_ixd_in(uint16_t op) { m_icount -= 30+12; { BIS_M(IXD,IN); } } +void t11_device::bis_ixd_ind(uint16_t op) { m_icount -= 30+18; { BIS_M(IXD,IND); } } +void t11_device::bis_ixd_de(uint16_t op) { m_icount -= 30+15; { BIS_M(IXD,DE); } } +void t11_device::bis_ixd_ded(uint16_t op) { m_icount -= 30+21; { BIS_M(IXD,DED); } } +void t11_device::bis_ixd_ix(uint16_t op) { m_icount -= 30+21; { BIS_M(IXD,IX); } } +void t11_device::bis_ixd_ixd(uint16_t op) { m_icount -= 30+27; { BIS_M(IXD,IXD); } } + +void t11_device::add_rg_rg(uint16_t op) { m_icount -= 9+ 3; { ADD_R(RG,RG); } } +void t11_device::add_rg_rgd(uint16_t op) { m_icount -= 9+12; { ADD_M(RG,RGD); } } +void t11_device::add_rg_in(uint16_t op) { m_icount -= 9+12; { ADD_M(RG,IN); } } +void t11_device::add_rg_ind(uint16_t op) { m_icount -= 9+18; { ADD_M(RG,IND); } } +void t11_device::add_rg_de(uint16_t op) { m_icount -= 9+15; { ADD_M(RG,DE); } } +void t11_device::add_rg_ded(uint16_t op) { m_icount -= 9+21; { ADD_M(RG,DED); } } +void t11_device::add_rg_ix(uint16_t op) { m_icount -= 9+21; { ADD_M(RG,IX); } } +void t11_device::add_rg_ixd(uint16_t op) { m_icount -= 9+27; { ADD_M(RG,IXD); } } +void t11_device::add_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { ADD_X(RGD,RG); } } +void t11_device::add_rgd_rgd(uint16_t op) { m_icount -= 15+12; { ADD_M(RGD,RGD); } } +void t11_device::add_rgd_in(uint16_t op) { m_icount -= 15+12; { ADD_M(RGD,IN); } } +void t11_device::add_rgd_ind(uint16_t op) { m_icount -= 15+18; { ADD_M(RGD,IND); } } +void t11_device::add_rgd_de(uint16_t op) { m_icount -= 15+15; { ADD_M(RGD,DE); } } +void t11_device::add_rgd_ded(uint16_t op) { m_icount -= 15+21; { ADD_M(RGD,DED); } } +void t11_device::add_rgd_ix(uint16_t op) { m_icount -= 15+21; { ADD_M(RGD,IX); } } +void t11_device::add_rgd_ixd(uint16_t op) { m_icount -= 15+27; { ADD_M(RGD,IXD); } } +void t11_device::add_in_rg(uint16_t op) { m_icount -= 15+ 3; { ADD_X(IN,RG); } } +void t11_device::add_in_rgd(uint16_t op) { m_icount -= 15+12; { ADD_M(IN,RGD); } } +void t11_device::add_in_in(uint16_t op) { m_icount -= 15+12; { ADD_M(IN,IN); } } +void t11_device::add_in_ind(uint16_t op) { m_icount -= 15+18; { ADD_M(IN,IND); } } +void t11_device::add_in_de(uint16_t op) { m_icount -= 15+15; { ADD_M(IN,DE); } } +void t11_device::add_in_ded(uint16_t op) { m_icount -= 15+21; { ADD_M(IN,DED); } } +void t11_device::add_in_ix(uint16_t op) { m_icount -= 15+21; { ADD_M(IN,IX); } } +void t11_device::add_in_ixd(uint16_t op) { m_icount -= 15+27; { ADD_M(IN,IXD); } } +void t11_device::add_ind_rg(uint16_t op) { m_icount -= 21+ 3; { ADD_X(IND,RG); } } +void t11_device::add_ind_rgd(uint16_t op) { m_icount -= 21+12; { ADD_M(IND,RGD); } } +void t11_device::add_ind_in(uint16_t op) { m_icount -= 21+12; { ADD_M(IND,IN); } } +void t11_device::add_ind_ind(uint16_t op) { m_icount -= 21+18; { ADD_M(IND,IND); } } +void t11_device::add_ind_de(uint16_t op) { m_icount -= 21+15; { ADD_M(IND,DE); } } +void t11_device::add_ind_ded(uint16_t op) { m_icount -= 21+21; { ADD_M(IND,DED); } } +void t11_device::add_ind_ix(uint16_t op) { m_icount -= 21+21; { ADD_M(IND,IX); } } +void t11_device::add_ind_ixd(uint16_t op) { m_icount -= 21+27; { ADD_M(IND,IXD); } } +void t11_device::add_de_rg(uint16_t op) { m_icount -= 18+ 3; { ADD_X(DE,RG); } } +void t11_device::add_de_rgd(uint16_t op) { m_icount -= 18+12; { ADD_M(DE,RGD); } } +void t11_device::add_de_in(uint16_t op) { m_icount -= 18+12; { ADD_M(DE,IN); } } +void t11_device::add_de_ind(uint16_t op) { m_icount -= 18+18; { ADD_M(DE,IND); } } +void t11_device::add_de_de(uint16_t op) { m_icount -= 18+15; { ADD_M(DE,DE); } } +void t11_device::add_de_ded(uint16_t op) { m_icount -= 18+21; { ADD_M(DE,DED); } } +void t11_device::add_de_ix(uint16_t op) { m_icount -= 18+21; { ADD_M(DE,IX); } } +void t11_device::add_de_ixd(uint16_t op) { m_icount -= 18+27; { ADD_M(DE,IXD); } } +void t11_device::add_ded_rg(uint16_t op) { m_icount -= 24+ 3; { ADD_X(DED,RG); } } +void t11_device::add_ded_rgd(uint16_t op) { m_icount -= 24+12; { ADD_M(DED,RGD); } } +void t11_device::add_ded_in(uint16_t op) { m_icount -= 24+12; { ADD_M(DED,IN); } } +void t11_device::add_ded_ind(uint16_t op) { m_icount -= 24+18; { ADD_M(DED,IND); } } +void t11_device::add_ded_de(uint16_t op) { m_icount -= 24+15; { ADD_M(DED,DE); } } +void t11_device::add_ded_ded(uint16_t op) { m_icount -= 24+21; { ADD_M(DED,DED); } } +void t11_device::add_ded_ix(uint16_t op) { m_icount -= 24+21; { ADD_M(DED,IX); } } +void t11_device::add_ded_ixd(uint16_t op) { m_icount -= 24+27; { ADD_M(DED,IXD); } } +void t11_device::add_ix_rg(uint16_t op) { m_icount -= 24+ 3; { ADD_X(IX,RG); } } +void t11_device::add_ix_rgd(uint16_t op) { m_icount -= 24+12; { ADD_M(IX,RGD); } } +void t11_device::add_ix_in(uint16_t op) { m_icount -= 24+12; { ADD_M(IX,IN); } } +void t11_device::add_ix_ind(uint16_t op) { m_icount -= 24+18; { ADD_M(IX,IND); } } +void t11_device::add_ix_de(uint16_t op) { m_icount -= 24+15; { ADD_M(IX,DE); } } +void t11_device::add_ix_ded(uint16_t op) { m_icount -= 24+21; { ADD_M(IX,DED); } } +void t11_device::add_ix_ix(uint16_t op) { m_icount -= 24+21; { ADD_M(IX,IX); } } +void t11_device::add_ix_ixd(uint16_t op) { m_icount -= 24+27; { ADD_M(IX,IXD); } } +void t11_device::add_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { ADD_X(IXD,RG); } } +void t11_device::add_ixd_rgd(uint16_t op) { m_icount -= 30+12; { ADD_M(IXD,RGD); } } +void t11_device::add_ixd_in(uint16_t op) { m_icount -= 30+12; { ADD_M(IXD,IN); } } +void t11_device::add_ixd_ind(uint16_t op) { m_icount -= 30+18; { ADD_M(IXD,IND); } } +void t11_device::add_ixd_de(uint16_t op) { m_icount -= 30+15; { ADD_M(IXD,DE); } } +void t11_device::add_ixd_ded(uint16_t op) { m_icount -= 30+21; { ADD_M(IXD,DED); } } +void t11_device::add_ixd_ix(uint16_t op) { m_icount -= 30+21; { ADD_M(IXD,IX); } } +void t11_device::add_ixd_ixd(uint16_t op) { m_icount -= 30+27; { ADD_M(IXD,IXD); } } + +void t11_device::xor_rg(uint16_t op) { m_icount -= 12; { XOR_R(RG); } } +void t11_device::xor_rgd(uint16_t op) { m_icount -= 21; { XOR_M(RGD); } } +void t11_device::xor_in(uint16_t op) { m_icount -= 21; { XOR_M(IN); } } +void t11_device::xor_ind(uint16_t op) { m_icount -= 27; { XOR_M(IND); } } +void t11_device::xor_de(uint16_t op) { m_icount -= 24; { XOR_M(DE); } } +void t11_device::xor_ded(uint16_t op) { m_icount -= 30; { XOR_M(DED); } } +void t11_device::xor_ix(uint16_t op) { m_icount -= 30; { XOR_M(IX); } } +void t11_device::xor_ixd(uint16_t op) { m_icount -= 36; { XOR_M(IXD); } } + +void t11_device::sob(uint16_t op) { int sreg, source; @@ -868,16 +868,16 @@ void t11_device::sob(UINT16 op) PC -= 2 * (op & 0x3f); } -void t11_device::bpl(UINT16 op) { m_icount -= 12; { BR(!GET_N); } } -void t11_device::bmi(UINT16 op) { m_icount -= 12; { BR( GET_N); } } -void t11_device::bhi(UINT16 op) { m_icount -= 12; { BR(!GET_C && !GET_Z); } } -void t11_device::blos(UINT16 op) { m_icount -= 12; { BR( GET_C || GET_Z); } } -void t11_device::bvc(UINT16 op) { m_icount -= 12; { BR(!GET_V); } } -void t11_device::bvs(UINT16 op) { m_icount -= 12; { BR( GET_V); } } -void t11_device::bcc(UINT16 op) { m_icount -= 12; { BR(!GET_C); } } -void t11_device::bcs(UINT16 op) { m_icount -= 12; { BR( GET_C); } } +void t11_device::bpl(uint16_t op) { m_icount -= 12; { BR(!GET_N); } } +void t11_device::bmi(uint16_t op) { m_icount -= 12; { BR( GET_N); } } +void t11_device::bhi(uint16_t op) { m_icount -= 12; { BR(!GET_C && !GET_Z); } } +void t11_device::blos(uint16_t op) { m_icount -= 12; { BR( GET_C || GET_Z); } } +void t11_device::bvc(uint16_t op) { m_icount -= 12; { BR(!GET_V); } } +void t11_device::bvs(uint16_t op) { m_icount -= 12; { BR( GET_V); } } +void t11_device::bcc(uint16_t op) { m_icount -= 12; { BR(!GET_C); } } +void t11_device::bcs(uint16_t op) { m_icount -= 12; { BR( GET_C); } } -void t11_device::emt(UINT16 op) +void t11_device::emt(uint16_t op) { m_icount -= 48; PUSH(PSW); @@ -887,7 +887,7 @@ void t11_device::emt(UINT16 op) t11_check_irqs(); } -void t11_device::trap(UINT16 op) +void t11_device::trap(uint16_t op) { m_icount -= 48; PUSH(PSW); @@ -897,518 +897,518 @@ void t11_device::trap(UINT16 op) t11_check_irqs(); } -void t11_device::clrb_rg(UINT16 op) { m_icount -= 12; { CLRB_R(RG); } } -void t11_device::clrb_rgd(UINT16 op) { m_icount -= 21; { CLRB_M(RGD); } } -void t11_device::clrb_in(UINT16 op) { m_icount -= 21; { CLRB_M(IN); } } -void t11_device::clrb_ind(UINT16 op) { m_icount -= 27; { CLRB_M(IND); } } -void t11_device::clrb_de(UINT16 op) { m_icount -= 24; { CLRB_M(DE); } } -void t11_device::clrb_ded(UINT16 op) { m_icount -= 30; { CLRB_M(DED); } } -void t11_device::clrb_ix(UINT16 op) { m_icount -= 30; { CLRB_M(IX); } } -void t11_device::clrb_ixd(UINT16 op) { m_icount -= 36; { CLRB_M(IXD); } } - -void t11_device::comb_rg(UINT16 op) { m_icount -= 12; { COMB_R(RG); } } -void t11_device::comb_rgd(UINT16 op) { m_icount -= 21; { COMB_M(RGD); } } -void t11_device::comb_in(UINT16 op) { m_icount -= 21; { COMB_M(IN); } } -void t11_device::comb_ind(UINT16 op) { m_icount -= 27; { COMB_M(IND); } } -void t11_device::comb_de(UINT16 op) { m_icount -= 24; { COMB_M(DE); } } -void t11_device::comb_ded(UINT16 op) { m_icount -= 30; { COMB_M(DED); } } -void t11_device::comb_ix(UINT16 op) { m_icount -= 30; { COMB_M(IX); } } -void t11_device::comb_ixd(UINT16 op) { m_icount -= 36; { COMB_M(IXD); } } - -void t11_device::incb_rg(UINT16 op) { m_icount -= 12; { INCB_R(RG); } } -void t11_device::incb_rgd(UINT16 op) { m_icount -= 21; { INCB_M(RGD); } } -void t11_device::incb_in(UINT16 op) { m_icount -= 21; { INCB_M(IN); } } -void t11_device::incb_ind(UINT16 op) { m_icount -= 27; { INCB_M(IND); } } -void t11_device::incb_de(UINT16 op) { m_icount -= 24; { INCB_M(DE); } } -void t11_device::incb_ded(UINT16 op) { m_icount -= 30; { INCB_M(DED); } } -void t11_device::incb_ix(UINT16 op) { m_icount -= 30; { INCB_M(IX); } } -void t11_device::incb_ixd(UINT16 op) { m_icount -= 36; { INCB_M(IXD); } } - -void t11_device::decb_rg(UINT16 op) { m_icount -= 12; { DECB_R(RG); } } -void t11_device::decb_rgd(UINT16 op) { m_icount -= 21; { DECB_M(RGD); } } -void t11_device::decb_in(UINT16 op) { m_icount -= 21; { DECB_M(IN); } } -void t11_device::decb_ind(UINT16 op) { m_icount -= 27; { DECB_M(IND); } } -void t11_device::decb_de(UINT16 op) { m_icount -= 24; { DECB_M(DE); } } -void t11_device::decb_ded(UINT16 op) { m_icount -= 30; { DECB_M(DED); } } -void t11_device::decb_ix(UINT16 op) { m_icount -= 30; { DECB_M(IX); } } -void t11_device::decb_ixd(UINT16 op) { m_icount -= 36; { DECB_M(IXD); } } - -void t11_device::negb_rg(UINT16 op) { m_icount -= 12; { NEGB_R(RG); } } -void t11_device::negb_rgd(UINT16 op) { m_icount -= 21; { NEGB_M(RGD); } } -void t11_device::negb_in(UINT16 op) { m_icount -= 21; { NEGB_M(IN); } } -void t11_device::negb_ind(UINT16 op) { m_icount -= 27; { NEGB_M(IND); } } -void t11_device::negb_de(UINT16 op) { m_icount -= 24; { NEGB_M(DE); } } -void t11_device::negb_ded(UINT16 op) { m_icount -= 30; { NEGB_M(DED); } } -void t11_device::negb_ix(UINT16 op) { m_icount -= 30; { NEGB_M(IX); } } -void t11_device::negb_ixd(UINT16 op) { m_icount -= 36; { NEGB_M(IXD); } } - -void t11_device::adcb_rg(UINT16 op) { m_icount -= 12; { ADCB_R(RG); } } -void t11_device::adcb_rgd(UINT16 op) { m_icount -= 21; { ADCB_M(RGD); } } -void t11_device::adcb_in(UINT16 op) { m_icount -= 21; { ADCB_M(IN); } } -void t11_device::adcb_ind(UINT16 op) { m_icount -= 27; { ADCB_M(IND); } } -void t11_device::adcb_de(UINT16 op) { m_icount -= 24; { ADCB_M(DE); } } -void t11_device::adcb_ded(UINT16 op) { m_icount -= 30; { ADCB_M(DED); } } -void t11_device::adcb_ix(UINT16 op) { m_icount -= 30; { ADCB_M(IX); } } -void t11_device::adcb_ixd(UINT16 op) { m_icount -= 36; { ADCB_M(IXD); } } - -void t11_device::sbcb_rg(UINT16 op) { m_icount -= 12; { SBCB_R(RG); } } -void t11_device::sbcb_rgd(UINT16 op) { m_icount -= 21; { SBCB_M(RGD); } } -void t11_device::sbcb_in(UINT16 op) { m_icount -= 21; { SBCB_M(IN); } } -void t11_device::sbcb_ind(UINT16 op) { m_icount -= 27; { SBCB_M(IND); } } -void t11_device::sbcb_de(UINT16 op) { m_icount -= 24; { SBCB_M(DE); } } -void t11_device::sbcb_ded(UINT16 op) { m_icount -= 30; { SBCB_M(DED); } } -void t11_device::sbcb_ix(UINT16 op) { m_icount -= 30; { SBCB_M(IX); } } -void t11_device::sbcb_ixd(UINT16 op) { m_icount -= 36; { SBCB_M(IXD); } } - -void t11_device::tstb_rg(UINT16 op) { m_icount -= 12; { TSTB_R(RG); } } -void t11_device::tstb_rgd(UINT16 op) { m_icount -= 18; { TSTB_M(RGD); } } -void t11_device::tstb_in(UINT16 op) { m_icount -= 18; { TSTB_M(IN); } } -void t11_device::tstb_ind(UINT16 op) { m_icount -= 24; { TSTB_M(IND); } } -void t11_device::tstb_de(UINT16 op) { m_icount -= 21; { TSTB_M(DE); } } -void t11_device::tstb_ded(UINT16 op) { m_icount -= 27; { TSTB_M(DED); } } -void t11_device::tstb_ix(UINT16 op) { m_icount -= 27; { TSTB_M(IX); } } -void t11_device::tstb_ixd(UINT16 op) { m_icount -= 33; { TSTB_M(IXD); } } - -void t11_device::rorb_rg(UINT16 op) { m_icount -= 12; { RORB_R(RG); } } -void t11_device::rorb_rgd(UINT16 op) { m_icount -= 21; { RORB_M(RGD); } } -void t11_device::rorb_in(UINT16 op) { m_icount -= 21; { RORB_M(IN); } } -void t11_device::rorb_ind(UINT16 op) { m_icount -= 27; { RORB_M(IND); } } -void t11_device::rorb_de(UINT16 op) { m_icount -= 24; { RORB_M(DE); } } -void t11_device::rorb_ded(UINT16 op) { m_icount -= 30; { RORB_M(DED); } } -void t11_device::rorb_ix(UINT16 op) { m_icount -= 30; { RORB_M(IX); } } -void t11_device::rorb_ixd(UINT16 op) { m_icount -= 36; { RORB_M(IXD); } } - -void t11_device::rolb_rg(UINT16 op) { m_icount -= 12; { ROLB_R(RG); } } -void t11_device::rolb_rgd(UINT16 op) { m_icount -= 21; { ROLB_M(RGD); } } -void t11_device::rolb_in(UINT16 op) { m_icount -= 21; { ROLB_M(IN); } } -void t11_device::rolb_ind(UINT16 op) { m_icount -= 27; { ROLB_M(IND); } } -void t11_device::rolb_de(UINT16 op) { m_icount -= 24; { ROLB_M(DE); } } -void t11_device::rolb_ded(UINT16 op) { m_icount -= 30; { ROLB_M(DED); } } -void t11_device::rolb_ix(UINT16 op) { m_icount -= 30; { ROLB_M(IX); } } -void t11_device::rolb_ixd(UINT16 op) { m_icount -= 36; { ROLB_M(IXD); } } - -void t11_device::asrb_rg(UINT16 op) { m_icount -= 12; { ASRB_R(RG); } } -void t11_device::asrb_rgd(UINT16 op) { m_icount -= 21; { ASRB_M(RGD); } } -void t11_device::asrb_in(UINT16 op) { m_icount -= 21; { ASRB_M(IN); } } -void t11_device::asrb_ind(UINT16 op) { m_icount -= 27; { ASRB_M(IND); } } -void t11_device::asrb_de(UINT16 op) { m_icount -= 24; { ASRB_M(DE); } } -void t11_device::asrb_ded(UINT16 op) { m_icount -= 30; { ASRB_M(DED); } } -void t11_device::asrb_ix(UINT16 op) { m_icount -= 30; { ASRB_M(IX); } } -void t11_device::asrb_ixd(UINT16 op) { m_icount -= 36; { ASRB_M(IXD); } } - -void t11_device::aslb_rg(UINT16 op) { m_icount -= 12; { ASLB_R(RG); } } -void t11_device::aslb_rgd(UINT16 op) { m_icount -= 21; { ASLB_M(RGD); } } -void t11_device::aslb_in(UINT16 op) { m_icount -= 21; { ASLB_M(IN); } } -void t11_device::aslb_ind(UINT16 op) { m_icount -= 27; { ASLB_M(IND); } } -void t11_device::aslb_de(UINT16 op) { m_icount -= 24; { ASLB_M(DE); } } -void t11_device::aslb_ded(UINT16 op) { m_icount -= 30; { ASLB_M(DED); } } -void t11_device::aslb_ix(UINT16 op) { m_icount -= 30; { ASLB_M(IX); } } -void t11_device::aslb_ixd(UINT16 op) { m_icount -= 36; { ASLB_M(IXD); } } - -void t11_device::mtps_rg(UINT16 op) { m_icount -= 24; { MTPS_R(RG); } } -void t11_device::mtps_rgd(UINT16 op) { m_icount -= 30; { MTPS_M(RGD); } } -void t11_device::mtps_in(UINT16 op) { m_icount -= 30; { MTPS_M(IN); } } -void t11_device::mtps_ind(UINT16 op) { m_icount -= 36; { MTPS_M(IND); } } -void t11_device::mtps_de(UINT16 op) { m_icount -= 33; { MTPS_M(DE); } } -void t11_device::mtps_ded(UINT16 op) { m_icount -= 39; { MTPS_M(DED); } } -void t11_device::mtps_ix(UINT16 op) { m_icount -= 39; { MTPS_M(IX); } } -void t11_device::mtps_ixd(UINT16 op) { m_icount -= 45; { MTPS_M(IXD); } } - -void t11_device::mfps_rg(UINT16 op) { m_icount -= 12; { MFPS_R(RG); } } -void t11_device::mfps_rgd(UINT16 op) { m_icount -= 21; { MFPS_M(RGD); } } -void t11_device::mfps_in(UINT16 op) { m_icount -= 21; { MFPS_M(IN); } } -void t11_device::mfps_ind(UINT16 op) { m_icount -= 27; { MFPS_M(IND); } } -void t11_device::mfps_de(UINT16 op) { m_icount -= 24; { MFPS_M(DE); } } -void t11_device::mfps_ded(UINT16 op) { m_icount -= 30; { MFPS_M(DED); } } -void t11_device::mfps_ix(UINT16 op) { m_icount -= 30; { MFPS_M(IX); } } -void t11_device::mfps_ixd(UINT16 op) { m_icount -= 36; { MFPS_M(IXD); } } - -void t11_device::movb_rg_rg(UINT16 op) { m_icount -= 9+ 3; { MOVB_R(RG,RG); } } -void t11_device::movb_rg_rgd(UINT16 op) { m_icount -= 9+12; { MOVB_M(RG,RGD); } } -void t11_device::movb_rg_in(UINT16 op) { m_icount -= 9+12; { MOVB_M(RG,IN); } } -void t11_device::movb_rg_ind(UINT16 op) { m_icount -= 9+18; { MOVB_M(RG,IND); } } -void t11_device::movb_rg_de(UINT16 op) { m_icount -= 9+15; { MOVB_M(RG,DE); } } -void t11_device::movb_rg_ded(UINT16 op) { m_icount -= 9+21; { MOVB_M(RG,DED); } } -void t11_device::movb_rg_ix(UINT16 op) { m_icount -= 9+21; { MOVB_M(RG,IX); } } -void t11_device::movb_rg_ixd(UINT16 op) { m_icount -= 9+27; { MOVB_M(RG,IXD); } } -void t11_device::movb_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { MOVB_X(RGD,RG); } } -void t11_device::movb_rgd_rgd(UINT16 op) { m_icount -= 15+12; { MOVB_M(RGD,RGD); } } -void t11_device::movb_rgd_in(UINT16 op) { m_icount -= 15+12; { MOVB_M(RGD,IN); } } -void t11_device::movb_rgd_ind(UINT16 op) { m_icount -= 15+18; { MOVB_M(RGD,IND); } } -void t11_device::movb_rgd_de(UINT16 op) { m_icount -= 15+15; { MOVB_M(RGD,DE); } } -void t11_device::movb_rgd_ded(UINT16 op) { m_icount -= 15+21; { MOVB_M(RGD,DED); } } -void t11_device::movb_rgd_ix(UINT16 op) { m_icount -= 15+21; { MOVB_M(RGD,IX); } } -void t11_device::movb_rgd_ixd(UINT16 op) { m_icount -= 15+27; { MOVB_M(RGD,IXD); } } -void t11_device::movb_in_rg(UINT16 op) { m_icount -= 15+ 3; { MOVB_X(IN,RG); } } -void t11_device::movb_in_rgd(UINT16 op) { m_icount -= 15+12; { MOVB_M(IN,RGD); } } -void t11_device::movb_in_in(UINT16 op) { m_icount -= 15+12; { MOVB_M(IN,IN); } } -void t11_device::movb_in_ind(UINT16 op) { m_icount -= 15+18; { MOVB_M(IN,IND); } } -void t11_device::movb_in_de(UINT16 op) { m_icount -= 15+15; { MOVB_M(IN,DE); } } -void t11_device::movb_in_ded(UINT16 op) { m_icount -= 15+21; { MOVB_M(IN,DED); } } -void t11_device::movb_in_ix(UINT16 op) { m_icount -= 15+21; { MOVB_M(IN,IX); } } -void t11_device::movb_in_ixd(UINT16 op) { m_icount -= 15+27; { MOVB_M(IN,IXD); } } -void t11_device::movb_ind_rg(UINT16 op) { m_icount -= 21+ 3; { MOVB_X(IND,RG); } } -void t11_device::movb_ind_rgd(UINT16 op) { m_icount -= 21+12; { MOVB_M(IND,RGD); } } -void t11_device::movb_ind_in(UINT16 op) { m_icount -= 21+12; { MOVB_M(IND,IN); } } -void t11_device::movb_ind_ind(UINT16 op) { m_icount -= 21+18; { MOVB_M(IND,IND); } } -void t11_device::movb_ind_de(UINT16 op) { m_icount -= 21+15; { MOVB_M(IND,DE); } } -void t11_device::movb_ind_ded(UINT16 op) { m_icount -= 21+21; { MOVB_M(IND,DED); } } -void t11_device::movb_ind_ix(UINT16 op) { m_icount -= 21+21; { MOVB_M(IND,IX); } } -void t11_device::movb_ind_ixd(UINT16 op) { m_icount -= 21+27; { MOVB_M(IND,IXD); } } -void t11_device::movb_de_rg(UINT16 op) { m_icount -= 18+ 3; { MOVB_X(DE,RG); } } -void t11_device::movb_de_rgd(UINT16 op) { m_icount -= 18+12; { MOVB_M(DE,RGD); } } -void t11_device::movb_de_in(UINT16 op) { m_icount -= 18+12; { MOVB_M(DE,IN); } } -void t11_device::movb_de_ind(UINT16 op) { m_icount -= 18+18; { MOVB_M(DE,IND); } } -void t11_device::movb_de_de(UINT16 op) { m_icount -= 18+15; { MOVB_M(DE,DE); } } -void t11_device::movb_de_ded(UINT16 op) { m_icount -= 18+21; { MOVB_M(DE,DED); } } -void t11_device::movb_de_ix(UINT16 op) { m_icount -= 18+21; { MOVB_M(DE,IX); } } -void t11_device::movb_de_ixd(UINT16 op) { m_icount -= 18+27; { MOVB_M(DE,IXD); } } -void t11_device::movb_ded_rg(UINT16 op) { m_icount -= 24+ 3; { MOVB_X(DED,RG); } } -void t11_device::movb_ded_rgd(UINT16 op) { m_icount -= 24+12; { MOVB_M(DED,RGD); } } -void t11_device::movb_ded_in(UINT16 op) { m_icount -= 24+12; { MOVB_M(DED,IN); } } -void t11_device::movb_ded_ind(UINT16 op) { m_icount -= 24+18; { MOVB_M(DED,IND); } } -void t11_device::movb_ded_de(UINT16 op) { m_icount -= 24+15; { MOVB_M(DED,DE); } } -void t11_device::movb_ded_ded(UINT16 op) { m_icount -= 24+21; { MOVB_M(DED,DED); } } -void t11_device::movb_ded_ix(UINT16 op) { m_icount -= 24+21; { MOVB_M(DED,IX); } } -void t11_device::movb_ded_ixd(UINT16 op) { m_icount -= 24+27; { MOVB_M(DED,IXD); } } -void t11_device::movb_ix_rg(UINT16 op) { m_icount -= 24+ 3; { MOVB_X(IX,RG); } } -void t11_device::movb_ix_rgd(UINT16 op) { m_icount -= 24+12; { MOVB_M(IX,RGD); } } -void t11_device::movb_ix_in(UINT16 op) { m_icount -= 24+12; { MOVB_M(IX,IN); } } -void t11_device::movb_ix_ind(UINT16 op) { m_icount -= 24+18; { MOVB_M(IX,IND); } } -void t11_device::movb_ix_de(UINT16 op) { m_icount -= 24+15; { MOVB_M(IX,DE); } } -void t11_device::movb_ix_ded(UINT16 op) { m_icount -= 24+21; { MOVB_M(IX,DED); } } -void t11_device::movb_ix_ix(UINT16 op) { m_icount -= 24+21; { MOVB_M(IX,IX); } } -void t11_device::movb_ix_ixd(UINT16 op) { m_icount -= 24+27; { MOVB_M(IX,IXD); } } -void t11_device::movb_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { MOVB_X(IXD,RG); } } -void t11_device::movb_ixd_rgd(UINT16 op) { m_icount -= 30+12; { MOVB_M(IXD,RGD); } } -void t11_device::movb_ixd_in(UINT16 op) { m_icount -= 30+12; { MOVB_M(IXD,IN); } } -void t11_device::movb_ixd_ind(UINT16 op) { m_icount -= 30+18; { MOVB_M(IXD,IND); } } -void t11_device::movb_ixd_de(UINT16 op) { m_icount -= 30+15; { MOVB_M(IXD,DE); } } -void t11_device::movb_ixd_ded(UINT16 op) { m_icount -= 30+21; { MOVB_M(IXD,DED); } } -void t11_device::movb_ixd_ix(UINT16 op) { m_icount -= 30+21; { MOVB_M(IXD,IX); } } -void t11_device::movb_ixd_ixd(UINT16 op) { m_icount -= 30+27; { MOVB_M(IXD,IXD); } } - -void t11_device::cmpb_rg_rg(UINT16 op) { m_icount -= 9+ 3; { CMPB_R(RG,RG); } } -void t11_device::cmpb_rg_rgd(UINT16 op) { m_icount -= 9+ 9; { CMPB_M(RG,RGD); } } -void t11_device::cmpb_rg_in(UINT16 op) { m_icount -= 9+ 9; { CMPB_M(RG,IN); } } -void t11_device::cmpb_rg_ind(UINT16 op) { m_icount -= 9+15; { CMPB_M(RG,IND); } } -void t11_device::cmpb_rg_de(UINT16 op) { m_icount -= 9+12; { CMPB_M(RG,DE); } } -void t11_device::cmpb_rg_ded(UINT16 op) { m_icount -= 9+18; { CMPB_M(RG,DED); } } -void t11_device::cmpb_rg_ix(UINT16 op) { m_icount -= 9+18; { CMPB_M(RG,IX); } } -void t11_device::cmpb_rg_ixd(UINT16 op) { m_icount -= 9+24; { CMPB_M(RG,IXD); } } -void t11_device::cmpb_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { CMPB_M(RGD,RG); } } -void t11_device::cmpb_rgd_rgd(UINT16 op) { m_icount -= 15+ 9; { CMPB_M(RGD,RGD); } } -void t11_device::cmpb_rgd_in(UINT16 op) { m_icount -= 15+ 9; { CMPB_M(RGD,IN); } } -void t11_device::cmpb_rgd_ind(UINT16 op) { m_icount -= 15+15; { CMPB_M(RGD,IND); } } -void t11_device::cmpb_rgd_de(UINT16 op) { m_icount -= 15+12; { CMPB_M(RGD,DE); } } -void t11_device::cmpb_rgd_ded(UINT16 op) { m_icount -= 15+18; { CMPB_M(RGD,DED); } } -void t11_device::cmpb_rgd_ix(UINT16 op) { m_icount -= 15+18; { CMPB_M(RGD,IX); } } -void t11_device::cmpb_rgd_ixd(UINT16 op) { m_icount -= 15+24; { CMPB_M(RGD,IXD); } } -void t11_device::cmpb_in_rg(UINT16 op) { m_icount -= 15+ 3; { CMPB_M(IN,RG); } } -void t11_device::cmpb_in_rgd(UINT16 op) { m_icount -= 15+ 9; { CMPB_M(IN,RGD); } } -void t11_device::cmpb_in_in(UINT16 op) { m_icount -= 15+ 9; { CMPB_M(IN,IN); } } -void t11_device::cmpb_in_ind(UINT16 op) { m_icount -= 15+15; { CMPB_M(IN,IND); } } -void t11_device::cmpb_in_de(UINT16 op) { m_icount -= 15+12; { CMPB_M(IN,DE); } } -void t11_device::cmpb_in_ded(UINT16 op) { m_icount -= 15+18; { CMPB_M(IN,DED); } } -void t11_device::cmpb_in_ix(UINT16 op) { m_icount -= 15+18; { CMPB_M(IN,IX); } } -void t11_device::cmpb_in_ixd(UINT16 op) { m_icount -= 15+24; { CMPB_M(IN,IXD); } } -void t11_device::cmpb_ind_rg(UINT16 op) { m_icount -= 21+ 3; { CMPB_M(IND,RG); } } -void t11_device::cmpb_ind_rgd(UINT16 op) { m_icount -= 21+ 9; { CMPB_M(IND,RGD); } } -void t11_device::cmpb_ind_in(UINT16 op) { m_icount -= 21+ 9; { CMPB_M(IND,IN); } } -void t11_device::cmpb_ind_ind(UINT16 op) { m_icount -= 21+15; { CMPB_M(IND,IND); } } -void t11_device::cmpb_ind_de(UINT16 op) { m_icount -= 21+12; { CMPB_M(IND,DE); } } -void t11_device::cmpb_ind_ded(UINT16 op) { m_icount -= 21+18; { CMPB_M(IND,DED); } } -void t11_device::cmpb_ind_ix(UINT16 op) { m_icount -= 21+18; { CMPB_M(IND,IX); } } -void t11_device::cmpb_ind_ixd(UINT16 op) { m_icount -= 21+24; { CMPB_M(IND,IXD); } } -void t11_device::cmpb_de_rg(UINT16 op) { m_icount -= 18+ 3; { CMPB_M(DE,RG); } } -void t11_device::cmpb_de_rgd(UINT16 op) { m_icount -= 18+ 9; { CMPB_M(DE,RGD); } } -void t11_device::cmpb_de_in(UINT16 op) { m_icount -= 18+ 9; { CMPB_M(DE,IN); } } -void t11_device::cmpb_de_ind(UINT16 op) { m_icount -= 18+15; { CMPB_M(DE,IND); } } -void t11_device::cmpb_de_de(UINT16 op) { m_icount -= 18+12; { CMPB_M(DE,DE); } } -void t11_device::cmpb_de_ded(UINT16 op) { m_icount -= 18+18; { CMPB_M(DE,DED); } } -void t11_device::cmpb_de_ix(UINT16 op) { m_icount -= 18+18; { CMPB_M(DE,IX); } } -void t11_device::cmpb_de_ixd(UINT16 op) { m_icount -= 18+24; { CMPB_M(DE,IXD); } } -void t11_device::cmpb_ded_rg(UINT16 op) { m_icount -= 24+ 3; { CMPB_M(DED,RG); } } -void t11_device::cmpb_ded_rgd(UINT16 op) { m_icount -= 24+ 9; { CMPB_M(DED,RGD); } } -void t11_device::cmpb_ded_in(UINT16 op) { m_icount -= 24+ 9; { CMPB_M(DED,IN); } } -void t11_device::cmpb_ded_ind(UINT16 op) { m_icount -= 24+15; { CMPB_M(DED,IND); } } -void t11_device::cmpb_ded_de(UINT16 op) { m_icount -= 24+12; { CMPB_M(DED,DE); } } -void t11_device::cmpb_ded_ded(UINT16 op) { m_icount -= 24+18; { CMPB_M(DED,DED); } } -void t11_device::cmpb_ded_ix(UINT16 op) { m_icount -= 24+18; { CMPB_M(DED,IX); } } -void t11_device::cmpb_ded_ixd(UINT16 op) { m_icount -= 24+24; { CMPB_M(DED,IXD); } } -void t11_device::cmpb_ix_rg(UINT16 op) { m_icount -= 24+ 3; { CMPB_M(IX,RG); } } -void t11_device::cmpb_ix_rgd(UINT16 op) { m_icount -= 24+ 9; { CMPB_M(IX,RGD); } } -void t11_device::cmpb_ix_in(UINT16 op) { m_icount -= 24+ 9; { CMPB_M(IX,IN); } } -void t11_device::cmpb_ix_ind(UINT16 op) { m_icount -= 24+15; { CMPB_M(IX,IND); } } -void t11_device::cmpb_ix_de(UINT16 op) { m_icount -= 24+12; { CMPB_M(IX,DE); } } -void t11_device::cmpb_ix_ded(UINT16 op) { m_icount -= 24+18; { CMPB_M(IX,DED); } } -void t11_device::cmpb_ix_ix(UINT16 op) { m_icount -= 24+18; { CMPB_M(IX,IX); } } -void t11_device::cmpb_ix_ixd(UINT16 op) { m_icount -= 24+24; { CMPB_M(IX,IXD); } } -void t11_device::cmpb_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { CMPB_M(IXD,RG); } } -void t11_device::cmpb_ixd_rgd(UINT16 op) { m_icount -= 30+ 9; { CMPB_M(IXD,RGD); } } -void t11_device::cmpb_ixd_in(UINT16 op) { m_icount -= 30+ 9; { CMPB_M(IXD,IN); } } -void t11_device::cmpb_ixd_ind(UINT16 op) { m_icount -= 30+15; { CMPB_M(IXD,IND); } } -void t11_device::cmpb_ixd_de(UINT16 op) { m_icount -= 30+12; { CMPB_M(IXD,DE); } } -void t11_device::cmpb_ixd_ded(UINT16 op) { m_icount -= 30+18; { CMPB_M(IXD,DED); } } -void t11_device::cmpb_ixd_ix(UINT16 op) { m_icount -= 30+18; { CMPB_M(IXD,IX); } } -void t11_device::cmpb_ixd_ixd(UINT16 op) { m_icount -= 30+24; { CMPB_M(IXD,IXD); } } - -void t11_device::bitb_rg_rg(UINT16 op) { m_icount -= 9+ 3; { BITB_R(RG,RG); } } -void t11_device::bitb_rg_rgd(UINT16 op) { m_icount -= 9+ 9; { BITB_M(RG,RGD); } } -void t11_device::bitb_rg_in(UINT16 op) { m_icount -= 9+ 9; { BITB_M(RG,IN); } } -void t11_device::bitb_rg_ind(UINT16 op) { m_icount -= 9+15; { BITB_M(RG,IND); } } -void t11_device::bitb_rg_de(UINT16 op) { m_icount -= 9+12; { BITB_M(RG,DE); } } -void t11_device::bitb_rg_ded(UINT16 op) { m_icount -= 9+18; { BITB_M(RG,DED); } } -void t11_device::bitb_rg_ix(UINT16 op) { m_icount -= 9+18; { BITB_M(RG,IX); } } -void t11_device::bitb_rg_ixd(UINT16 op) { m_icount -= 9+24; { BITB_M(RG,IXD); } } -void t11_device::bitb_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { BITB_M(RGD,RG); } } -void t11_device::bitb_rgd_rgd(UINT16 op) { m_icount -= 15+ 9; { BITB_M(RGD,RGD); } } -void t11_device::bitb_rgd_in(UINT16 op) { m_icount -= 15+ 9; { BITB_M(RGD,IN); } } -void t11_device::bitb_rgd_ind(UINT16 op) { m_icount -= 15+15; { BITB_M(RGD,IND); } } -void t11_device::bitb_rgd_de(UINT16 op) { m_icount -= 15+12; { BITB_M(RGD,DE); } } -void t11_device::bitb_rgd_ded(UINT16 op) { m_icount -= 15+18; { BITB_M(RGD,DED); } } -void t11_device::bitb_rgd_ix(UINT16 op) { m_icount -= 15+18; { BITB_M(RGD,IX); } } -void t11_device::bitb_rgd_ixd(UINT16 op) { m_icount -= 15+24; { BITB_M(RGD,IXD); } } -void t11_device::bitb_in_rg(UINT16 op) { m_icount -= 15+ 3; { BITB_M(IN,RG); } } -void t11_device::bitb_in_rgd(UINT16 op) { m_icount -= 15+ 9; { BITB_M(IN,RGD); } } -void t11_device::bitb_in_in(UINT16 op) { m_icount -= 15+ 9; { BITB_M(IN,IN); } } -void t11_device::bitb_in_ind(UINT16 op) { m_icount -= 15+15; { BITB_M(IN,IND); } } -void t11_device::bitb_in_de(UINT16 op) { m_icount -= 15+12; { BITB_M(IN,DE); } } -void t11_device::bitb_in_ded(UINT16 op) { m_icount -= 15+18; { BITB_M(IN,DED); } } -void t11_device::bitb_in_ix(UINT16 op) { m_icount -= 15+18; { BITB_M(IN,IX); } } -void t11_device::bitb_in_ixd(UINT16 op) { m_icount -= 15+24; { BITB_M(IN,IXD); } } -void t11_device::bitb_ind_rg(UINT16 op) { m_icount -= 21+ 3; { BITB_M(IND,RG); } } -void t11_device::bitb_ind_rgd(UINT16 op) { m_icount -= 21+ 9; { BITB_M(IND,RGD); } } -void t11_device::bitb_ind_in(UINT16 op) { m_icount -= 21+ 9; { BITB_M(IND,IN); } } -void t11_device::bitb_ind_ind(UINT16 op) { m_icount -= 21+15; { BITB_M(IND,IND); } } -void t11_device::bitb_ind_de(UINT16 op) { m_icount -= 21+12; { BITB_M(IND,DE); } } -void t11_device::bitb_ind_ded(UINT16 op) { m_icount -= 21+18; { BITB_M(IND,DED); } } -void t11_device::bitb_ind_ix(UINT16 op) { m_icount -= 21+18; { BITB_M(IND,IX); } } -void t11_device::bitb_ind_ixd(UINT16 op) { m_icount -= 21+24; { BITB_M(IND,IXD); } } -void t11_device::bitb_de_rg(UINT16 op) { m_icount -= 18+ 3; { BITB_M(DE,RG); } } -void t11_device::bitb_de_rgd(UINT16 op) { m_icount -= 18+ 9; { BITB_M(DE,RGD); } } -void t11_device::bitb_de_in(UINT16 op) { m_icount -= 18+ 9; { BITB_M(DE,IN); } } -void t11_device::bitb_de_ind(UINT16 op) { m_icount -= 18+15; { BITB_M(DE,IND); } } -void t11_device::bitb_de_de(UINT16 op) { m_icount -= 18+12; { BITB_M(DE,DE); } } -void t11_device::bitb_de_ded(UINT16 op) { m_icount -= 18+18; { BITB_M(DE,DED); } } -void t11_device::bitb_de_ix(UINT16 op) { m_icount -= 18+18; { BITB_M(DE,IX); } } -void t11_device::bitb_de_ixd(UINT16 op) { m_icount -= 18+24; { BITB_M(DE,IXD); } } -void t11_device::bitb_ded_rg(UINT16 op) { m_icount -= 24+ 3; { BITB_M(DED,RG); } } -void t11_device::bitb_ded_rgd(UINT16 op) { m_icount -= 24+ 9; { BITB_M(DED,RGD); } } -void t11_device::bitb_ded_in(UINT16 op) { m_icount -= 24+ 9; { BITB_M(DED,IN); } } -void t11_device::bitb_ded_ind(UINT16 op) { m_icount -= 24+15; { BITB_M(DED,IND); } } -void t11_device::bitb_ded_de(UINT16 op) { m_icount -= 24+12; { BITB_M(DED,DE); } } -void t11_device::bitb_ded_ded(UINT16 op) { m_icount -= 24+18; { BITB_M(DED,DED); } } -void t11_device::bitb_ded_ix(UINT16 op) { m_icount -= 24+18; { BITB_M(DED,IX); } } -void t11_device::bitb_ded_ixd(UINT16 op) { m_icount -= 24+24; { BITB_M(DED,IXD); } } -void t11_device::bitb_ix_rg(UINT16 op) { m_icount -= 24+ 3; { BITB_M(IX,RG); } } -void t11_device::bitb_ix_rgd(UINT16 op) { m_icount -= 24+ 9; { BITB_M(IX,RGD); } } -void t11_device::bitb_ix_in(UINT16 op) { m_icount -= 24+ 9; { BITB_M(IX,IN); } } -void t11_device::bitb_ix_ind(UINT16 op) { m_icount -= 24+15; { BITB_M(IX,IND); } } -void t11_device::bitb_ix_de(UINT16 op) { m_icount -= 24+12; { BITB_M(IX,DE); } } -void t11_device::bitb_ix_ded(UINT16 op) { m_icount -= 24+18; { BITB_M(IX,DED); } } -void t11_device::bitb_ix_ix(UINT16 op) { m_icount -= 24+18; { BITB_M(IX,IX); } } -void t11_device::bitb_ix_ixd(UINT16 op) { m_icount -= 24+24; { BITB_M(IX,IXD); } } -void t11_device::bitb_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { BITB_M(IXD,RG); } } -void t11_device::bitb_ixd_rgd(UINT16 op) { m_icount -= 30+ 9; { BITB_M(IXD,RGD); } } -void t11_device::bitb_ixd_in(UINT16 op) { m_icount -= 30+ 9; { BITB_M(IXD,IN); } } -void t11_device::bitb_ixd_ind(UINT16 op) { m_icount -= 30+15; { BITB_M(IXD,IND); } } -void t11_device::bitb_ixd_de(UINT16 op) { m_icount -= 30+12; { BITB_M(IXD,DE); } } -void t11_device::bitb_ixd_ded(UINT16 op) { m_icount -= 30+18; { BITB_M(IXD,DED); } } -void t11_device::bitb_ixd_ix(UINT16 op) { m_icount -= 30+18; { BITB_M(IXD,IX); } } -void t11_device::bitb_ixd_ixd(UINT16 op) { m_icount -= 30+24; { BITB_M(IXD,IXD); } } - -void t11_device::bicb_rg_rg(UINT16 op) { m_icount -= 9+ 3; { BICB_R(RG,RG); } } -void t11_device::bicb_rg_rgd(UINT16 op) { m_icount -= 9+12; { BICB_M(RG,RGD); } } -void t11_device::bicb_rg_in(UINT16 op) { m_icount -= 9+12; { BICB_M(RG,IN); } } -void t11_device::bicb_rg_ind(UINT16 op) { m_icount -= 9+18; { BICB_M(RG,IND); } } -void t11_device::bicb_rg_de(UINT16 op) { m_icount -= 9+15; { BICB_M(RG,DE); } } -void t11_device::bicb_rg_ded(UINT16 op) { m_icount -= 9+21; { BICB_M(RG,DED); } } -void t11_device::bicb_rg_ix(UINT16 op) { m_icount -= 9+21; { BICB_M(RG,IX); } } -void t11_device::bicb_rg_ixd(UINT16 op) { m_icount -= 9+27; { BICB_M(RG,IXD); } } -void t11_device::bicb_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { BICB_X(RGD,RG); } } -void t11_device::bicb_rgd_rgd(UINT16 op) { m_icount -= 15+12; { BICB_M(RGD,RGD); } } -void t11_device::bicb_rgd_in(UINT16 op) { m_icount -= 15+12; { BICB_M(RGD,IN); } } -void t11_device::bicb_rgd_ind(UINT16 op) { m_icount -= 15+18; { BICB_M(RGD,IND); } } -void t11_device::bicb_rgd_de(UINT16 op) { m_icount -= 15+15; { BICB_M(RGD,DE); } } -void t11_device::bicb_rgd_ded(UINT16 op) { m_icount -= 15+21; { BICB_M(RGD,DED); } } -void t11_device::bicb_rgd_ix(UINT16 op) { m_icount -= 15+21; { BICB_M(RGD,IX); } } -void t11_device::bicb_rgd_ixd(UINT16 op) { m_icount -= 15+27; { BICB_M(RGD,IXD); } } -void t11_device::bicb_in_rg(UINT16 op) { m_icount -= 15+ 3; { BICB_X(IN,RG); } } -void t11_device::bicb_in_rgd(UINT16 op) { m_icount -= 15+12; { BICB_M(IN,RGD); } } -void t11_device::bicb_in_in(UINT16 op) { m_icount -= 15+12; { BICB_M(IN,IN); } } -void t11_device::bicb_in_ind(UINT16 op) { m_icount -= 15+18; { BICB_M(IN,IND); } } -void t11_device::bicb_in_de(UINT16 op) { m_icount -= 15+15; { BICB_M(IN,DE); } } -void t11_device::bicb_in_ded(UINT16 op) { m_icount -= 15+21; { BICB_M(IN,DED); } } -void t11_device::bicb_in_ix(UINT16 op) { m_icount -= 15+21; { BICB_M(IN,IX); } } -void t11_device::bicb_in_ixd(UINT16 op) { m_icount -= 15+27; { BICB_M(IN,IXD); } } -void t11_device::bicb_ind_rg(UINT16 op) { m_icount -= 21+ 3; { BICB_X(IND,RG); } } -void t11_device::bicb_ind_rgd(UINT16 op) { m_icount -= 21+12; { BICB_M(IND,RGD); } } -void t11_device::bicb_ind_in(UINT16 op) { m_icount -= 21+12; { BICB_M(IND,IN); } } -void t11_device::bicb_ind_ind(UINT16 op) { m_icount -= 21+18; { BICB_M(IND,IND); } } -void t11_device::bicb_ind_de(UINT16 op) { m_icount -= 21+15; { BICB_M(IND,DE); } } -void t11_device::bicb_ind_ded(UINT16 op) { m_icount -= 21+21; { BICB_M(IND,DED); } } -void t11_device::bicb_ind_ix(UINT16 op) { m_icount -= 21+21; { BICB_M(IND,IX); } } -void t11_device::bicb_ind_ixd(UINT16 op) { m_icount -= 21+27; { BICB_M(IND,IXD); } } -void t11_device::bicb_de_rg(UINT16 op) { m_icount -= 18+ 3; { BICB_X(DE,RG); } } -void t11_device::bicb_de_rgd(UINT16 op) { m_icount -= 18+12; { BICB_M(DE,RGD); } } -void t11_device::bicb_de_in(UINT16 op) { m_icount -= 18+12; { BICB_M(DE,IN); } } -void t11_device::bicb_de_ind(UINT16 op) { m_icount -= 18+18; { BICB_M(DE,IND); } } -void t11_device::bicb_de_de(UINT16 op) { m_icount -= 18+15; { BICB_M(DE,DE); } } -void t11_device::bicb_de_ded(UINT16 op) { m_icount -= 18+21; { BICB_M(DE,DED); } } -void t11_device::bicb_de_ix(UINT16 op) { m_icount -= 18+21; { BICB_M(DE,IX); } } -void t11_device::bicb_de_ixd(UINT16 op) { m_icount -= 18+27; { BICB_M(DE,IXD); } } -void t11_device::bicb_ded_rg(UINT16 op) { m_icount -= 24+ 3; { BICB_X(DED,RG); } } -void t11_device::bicb_ded_rgd(UINT16 op) { m_icount -= 24+12; { BICB_M(DED,RGD); } } -void t11_device::bicb_ded_in(UINT16 op) { m_icount -= 24+12; { BICB_M(DED,IN); } } -void t11_device::bicb_ded_ind(UINT16 op) { m_icount -= 24+18; { BICB_M(DED,IND); } } -void t11_device::bicb_ded_de(UINT16 op) { m_icount -= 24+15; { BICB_M(DED,DE); } } -void t11_device::bicb_ded_ded(UINT16 op) { m_icount -= 24+21; { BICB_M(DED,DED); } } -void t11_device::bicb_ded_ix(UINT16 op) { m_icount -= 24+21; { BICB_M(DED,IX); } } -void t11_device::bicb_ded_ixd(UINT16 op) { m_icount -= 24+27; { BICB_M(DED,IXD); } } -void t11_device::bicb_ix_rg(UINT16 op) { m_icount -= 24+ 3; { BICB_X(IX,RG); } } -void t11_device::bicb_ix_rgd(UINT16 op) { m_icount -= 24+12; { BICB_M(IX,RGD); } } -void t11_device::bicb_ix_in(UINT16 op) { m_icount -= 24+12; { BICB_M(IX,IN); } } -void t11_device::bicb_ix_ind(UINT16 op) { m_icount -= 24+18; { BICB_M(IX,IND); } } -void t11_device::bicb_ix_de(UINT16 op) { m_icount -= 24+15; { BICB_M(IX,DE); } } -void t11_device::bicb_ix_ded(UINT16 op) { m_icount -= 24+21; { BICB_M(IX,DED); } } -void t11_device::bicb_ix_ix(UINT16 op) { m_icount -= 24+21; { BICB_M(IX,IX); } } -void t11_device::bicb_ix_ixd(UINT16 op) { m_icount -= 24+27; { BICB_M(IX,IXD); } } -void t11_device::bicb_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { BICB_X(IXD,RG); } } -void t11_device::bicb_ixd_rgd(UINT16 op) { m_icount -= 30+12; { BICB_M(IXD,RGD); } } -void t11_device::bicb_ixd_in(UINT16 op) { m_icount -= 30+12; { BICB_M(IXD,IN); } } -void t11_device::bicb_ixd_ind(UINT16 op) { m_icount -= 30+18; { BICB_M(IXD,IND); } } -void t11_device::bicb_ixd_de(UINT16 op) { m_icount -= 30+15; { BICB_M(IXD,DE); } } -void t11_device::bicb_ixd_ded(UINT16 op) { m_icount -= 30+21; { BICB_M(IXD,DED); } } -void t11_device::bicb_ixd_ix(UINT16 op) { m_icount -= 30+21; { BICB_M(IXD,IX); } } -void t11_device::bicb_ixd_ixd(UINT16 op) { m_icount -= 30+27; { BICB_M(IXD,IXD); } } - -void t11_device::bisb_rg_rg(UINT16 op) { m_icount -= 9+ 3; { BISB_R(RG,RG); } } -void t11_device::bisb_rg_rgd(UINT16 op) { m_icount -= 9+12; { BISB_M(RG,RGD); } } -void t11_device::bisb_rg_in(UINT16 op) { m_icount -= 9+12; { BISB_M(RG,IN); } } -void t11_device::bisb_rg_ind(UINT16 op) { m_icount -= 9+18; { BISB_M(RG,IND); } } -void t11_device::bisb_rg_de(UINT16 op) { m_icount -= 9+15; { BISB_M(RG,DE); } } -void t11_device::bisb_rg_ded(UINT16 op) { m_icount -= 9+21; { BISB_M(RG,DED); } } -void t11_device::bisb_rg_ix(UINT16 op) { m_icount -= 9+21; { BISB_M(RG,IX); } } -void t11_device::bisb_rg_ixd(UINT16 op) { m_icount -= 9+27; { BISB_M(RG,IXD); } } -void t11_device::bisb_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { BISB_X(RGD,RG); } } -void t11_device::bisb_rgd_rgd(UINT16 op) { m_icount -= 15+12; { BISB_M(RGD,RGD); } } -void t11_device::bisb_rgd_in(UINT16 op) { m_icount -= 15+12; { BISB_M(RGD,IN); } } -void t11_device::bisb_rgd_ind(UINT16 op) { m_icount -= 15+18; { BISB_M(RGD,IND); } } -void t11_device::bisb_rgd_de(UINT16 op) { m_icount -= 15+15; { BISB_M(RGD,DE); } } -void t11_device::bisb_rgd_ded(UINT16 op) { m_icount -= 15+21; { BISB_M(RGD,DED); } } -void t11_device::bisb_rgd_ix(UINT16 op) { m_icount -= 15+21; { BISB_M(RGD,IX); } } -void t11_device::bisb_rgd_ixd(UINT16 op) { m_icount -= 15+27; { BISB_M(RGD,IXD); } } -void t11_device::bisb_in_rg(UINT16 op) { m_icount -= 15+ 3; { BISB_X(IN,RG); } } -void t11_device::bisb_in_rgd(UINT16 op) { m_icount -= 15+12; { BISB_M(IN,RGD); } } -void t11_device::bisb_in_in(UINT16 op) { m_icount -= 15+12; { BISB_M(IN,IN); } } -void t11_device::bisb_in_ind(UINT16 op) { m_icount -= 15+18; { BISB_M(IN,IND); } } -void t11_device::bisb_in_de(UINT16 op) { m_icount -= 15+15; { BISB_M(IN,DE); } } -void t11_device::bisb_in_ded(UINT16 op) { m_icount -= 15+21; { BISB_M(IN,DED); } } -void t11_device::bisb_in_ix(UINT16 op) { m_icount -= 15+21; { BISB_M(IN,IX); } } -void t11_device::bisb_in_ixd(UINT16 op) { m_icount -= 15+27; { BISB_M(IN,IXD); } } -void t11_device::bisb_ind_rg(UINT16 op) { m_icount -= 21+ 3; { BISB_X(IND,RG); } } -void t11_device::bisb_ind_rgd(UINT16 op) { m_icount -= 21+12; { BISB_M(IND,RGD); } } -void t11_device::bisb_ind_in(UINT16 op) { m_icount -= 21+12; { BISB_M(IND,IN); } } -void t11_device::bisb_ind_ind(UINT16 op) { m_icount -= 21+18; { BISB_M(IND,IND); } } -void t11_device::bisb_ind_de(UINT16 op) { m_icount -= 21+15; { BISB_M(IND,DE); } } -void t11_device::bisb_ind_ded(UINT16 op) { m_icount -= 21+21; { BISB_M(IND,DED); } } -void t11_device::bisb_ind_ix(UINT16 op) { m_icount -= 21+21; { BISB_M(IND,IX); } } -void t11_device::bisb_ind_ixd(UINT16 op) { m_icount -= 21+27; { BISB_M(IND,IXD); } } -void t11_device::bisb_de_rg(UINT16 op) { m_icount -= 18+ 3; { BISB_X(DE,RG); } } -void t11_device::bisb_de_rgd(UINT16 op) { m_icount -= 18+12; { BISB_M(DE,RGD); } } -void t11_device::bisb_de_in(UINT16 op) { m_icount -= 18+12; { BISB_M(DE,IN); } } -void t11_device::bisb_de_ind(UINT16 op) { m_icount -= 18+18; { BISB_M(DE,IND); } } -void t11_device::bisb_de_de(UINT16 op) { m_icount -= 18+15; { BISB_M(DE,DE); } } -void t11_device::bisb_de_ded(UINT16 op) { m_icount -= 18+21; { BISB_M(DE,DED); } } -void t11_device::bisb_de_ix(UINT16 op) { m_icount -= 18+21; { BISB_M(DE,IX); } } -void t11_device::bisb_de_ixd(UINT16 op) { m_icount -= 18+27; { BISB_M(DE,IXD); } } -void t11_device::bisb_ded_rg(UINT16 op) { m_icount -= 24+ 3; { BISB_X(DED,RG); } } -void t11_device::bisb_ded_rgd(UINT16 op) { m_icount -= 24+12; { BISB_M(DED,RGD); } } -void t11_device::bisb_ded_in(UINT16 op) { m_icount -= 24+12; { BISB_M(DED,IN); } } -void t11_device::bisb_ded_ind(UINT16 op) { m_icount -= 24+18; { BISB_M(DED,IND); } } -void t11_device::bisb_ded_de(UINT16 op) { m_icount -= 24+15; { BISB_M(DED,DE); } } -void t11_device::bisb_ded_ded(UINT16 op) { m_icount -= 24+21; { BISB_M(DED,DED); } } -void t11_device::bisb_ded_ix(UINT16 op) { m_icount -= 24+21; { BISB_M(DED,IX); } } -void t11_device::bisb_ded_ixd(UINT16 op) { m_icount -= 24+27; { BISB_M(DED,IXD); } } -void t11_device::bisb_ix_rg(UINT16 op) { m_icount -= 24+ 3; { BISB_X(IX,RG); } } -void t11_device::bisb_ix_rgd(UINT16 op) { m_icount -= 24+12; { BISB_M(IX,RGD); } } -void t11_device::bisb_ix_in(UINT16 op) { m_icount -= 24+12; { BISB_M(IX,IN); } } -void t11_device::bisb_ix_ind(UINT16 op) { m_icount -= 24+18; { BISB_M(IX,IND); } } -void t11_device::bisb_ix_de(UINT16 op) { m_icount -= 24+15; { BISB_M(IX,DE); } } -void t11_device::bisb_ix_ded(UINT16 op) { m_icount -= 24+21; { BISB_M(IX,DED); } } -void t11_device::bisb_ix_ix(UINT16 op) { m_icount -= 24+21; { BISB_M(IX,IX); } } -void t11_device::bisb_ix_ixd(UINT16 op) { m_icount -= 24+27; { BISB_M(IX,IXD); } } -void t11_device::bisb_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { BISB_X(IXD,RG); } } -void t11_device::bisb_ixd_rgd(UINT16 op) { m_icount -= 30+12; { BISB_M(IXD,RGD); } } -void t11_device::bisb_ixd_in(UINT16 op) { m_icount -= 30+12; { BISB_M(IXD,IN); } } -void t11_device::bisb_ixd_ind(UINT16 op) { m_icount -= 30+18; { BISB_M(IXD,IND); } } -void t11_device::bisb_ixd_de(UINT16 op) { m_icount -= 30+15; { BISB_M(IXD,DE); } } -void t11_device::bisb_ixd_ded(UINT16 op) { m_icount -= 30+21; { BISB_M(IXD,DED); } } -void t11_device::bisb_ixd_ix(UINT16 op) { m_icount -= 30+21; { BISB_M(IXD,IX); } } -void t11_device::bisb_ixd_ixd(UINT16 op) { m_icount -= 30+27; { BISB_M(IXD,IXD); } } - -void t11_device::sub_rg_rg(UINT16 op) { m_icount -= 9+ 3; { SUB_R(RG,RG); } } -void t11_device::sub_rg_rgd(UINT16 op) { m_icount -= 9+12; { SUB_M(RG,RGD); } } -void t11_device::sub_rg_in(UINT16 op) { m_icount -= 9+12; { SUB_M(RG,IN); } } -void t11_device::sub_rg_ind(UINT16 op) { m_icount -= 9+18; { SUB_M(RG,IND); } } -void t11_device::sub_rg_de(UINT16 op) { m_icount -= 9+15; { SUB_M(RG,DE); } } -void t11_device::sub_rg_ded(UINT16 op) { m_icount -= 9+21; { SUB_M(RG,DED); } } -void t11_device::sub_rg_ix(UINT16 op) { m_icount -= 9+21; { SUB_M(RG,IX); } } -void t11_device::sub_rg_ixd(UINT16 op) { m_icount -= 9+27; { SUB_M(RG,IXD); } } -void t11_device::sub_rgd_rg(UINT16 op) { m_icount -= 15+ 3; { SUB_X(RGD,RG); } } -void t11_device::sub_rgd_rgd(UINT16 op) { m_icount -= 15+12; { SUB_M(RGD,RGD); } } -void t11_device::sub_rgd_in(UINT16 op) { m_icount -= 15+12; { SUB_M(RGD,IN); } } -void t11_device::sub_rgd_ind(UINT16 op) { m_icount -= 15+18; { SUB_M(RGD,IND); } } -void t11_device::sub_rgd_de(UINT16 op) { m_icount -= 15+15; { SUB_M(RGD,DE); } } -void t11_device::sub_rgd_ded(UINT16 op) { m_icount -= 15+21; { SUB_M(RGD,DED); } } -void t11_device::sub_rgd_ix(UINT16 op) { m_icount -= 15+21; { SUB_M(RGD,IX); } } -void t11_device::sub_rgd_ixd(UINT16 op) { m_icount -= 15+27; { SUB_M(RGD,IXD); } } -void t11_device::sub_in_rg(UINT16 op) { m_icount -= 15+ 3; { SUB_X(IN,RG); } } -void t11_device::sub_in_rgd(UINT16 op) { m_icount -= 15+12; { SUB_M(IN,RGD); } } -void t11_device::sub_in_in(UINT16 op) { m_icount -= 15+12; { SUB_M(IN,IN); } } -void t11_device::sub_in_ind(UINT16 op) { m_icount -= 15+18; { SUB_M(IN,IND); } } -void t11_device::sub_in_de(UINT16 op) { m_icount -= 15+15; { SUB_M(IN,DE); } } -void t11_device::sub_in_ded(UINT16 op) { m_icount -= 15+21; { SUB_M(IN,DED); } } -void t11_device::sub_in_ix(UINT16 op) { m_icount -= 15+21; { SUB_M(IN,IX); } } -void t11_device::sub_in_ixd(UINT16 op) { m_icount -= 15+27; { SUB_M(IN,IXD); } } -void t11_device::sub_ind_rg(UINT16 op) { m_icount -= 21+ 3; { SUB_X(IND,RG); } } -void t11_device::sub_ind_rgd(UINT16 op) { m_icount -= 21+12; { SUB_M(IND,RGD); } } -void t11_device::sub_ind_in(UINT16 op) { m_icount -= 21+12; { SUB_M(IND,IN); } } -void t11_device::sub_ind_ind(UINT16 op) { m_icount -= 21+18; { SUB_M(IND,IND); } } -void t11_device::sub_ind_de(UINT16 op) { m_icount -= 21+15; { SUB_M(IND,DE); } } -void t11_device::sub_ind_ded(UINT16 op) { m_icount -= 21+21; { SUB_M(IND,DED); } } -void t11_device::sub_ind_ix(UINT16 op) { m_icount -= 21+21; { SUB_M(IND,IX); } } -void t11_device::sub_ind_ixd(UINT16 op) { m_icount -= 21+27; { SUB_M(IND,IXD); } } -void t11_device::sub_de_rg(UINT16 op) { m_icount -= 18+ 3; { SUB_X(DE,RG); } } -void t11_device::sub_de_rgd(UINT16 op) { m_icount -= 18+12; { SUB_M(DE,RGD); } } -void t11_device::sub_de_in(UINT16 op) { m_icount -= 18+12; { SUB_M(DE,IN); } } -void t11_device::sub_de_ind(UINT16 op) { m_icount -= 18+18; { SUB_M(DE,IND); } } -void t11_device::sub_de_de(UINT16 op) { m_icount -= 18+15; { SUB_M(DE,DE); } } -void t11_device::sub_de_ded(UINT16 op) { m_icount -= 18+21; { SUB_M(DE,DED); } } -void t11_device::sub_de_ix(UINT16 op) { m_icount -= 18+21; { SUB_M(DE,IX); } } -void t11_device::sub_de_ixd(UINT16 op) { m_icount -= 18+27; { SUB_M(DE,IXD); } } -void t11_device::sub_ded_rg(UINT16 op) { m_icount -= 24+ 3; { SUB_X(DED,RG); } } -void t11_device::sub_ded_rgd(UINT16 op) { m_icount -= 24+12; { SUB_M(DED,RGD); } } -void t11_device::sub_ded_in(UINT16 op) { m_icount -= 24+12; { SUB_M(DED,IN); } } -void t11_device::sub_ded_ind(UINT16 op) { m_icount -= 24+18; { SUB_M(DED,IND); } } -void t11_device::sub_ded_de(UINT16 op) { m_icount -= 24+15; { SUB_M(DED,DE); } } -void t11_device::sub_ded_ded(UINT16 op) { m_icount -= 24+21; { SUB_M(DED,DED); } } -void t11_device::sub_ded_ix(UINT16 op) { m_icount -= 24+21; { SUB_M(DED,IX); } } -void t11_device::sub_ded_ixd(UINT16 op) { m_icount -= 24+27; { SUB_M(DED,IXD); } } -void t11_device::sub_ix_rg(UINT16 op) { m_icount -= 24+ 3; { SUB_X(IX,RG); } } -void t11_device::sub_ix_rgd(UINT16 op) { m_icount -= 24+12; { SUB_M(IX,RGD); } } -void t11_device::sub_ix_in(UINT16 op) { m_icount -= 24+12; { SUB_M(IX,IN); } } -void t11_device::sub_ix_ind(UINT16 op) { m_icount -= 24+18; { SUB_M(IX,IND); } } -void t11_device::sub_ix_de(UINT16 op) { m_icount -= 24+15; { SUB_M(IX,DE); } } -void t11_device::sub_ix_ded(UINT16 op) { m_icount -= 24+21; { SUB_M(IX,DED); } } -void t11_device::sub_ix_ix(UINT16 op) { m_icount -= 24+21; { SUB_M(IX,IX); } } -void t11_device::sub_ix_ixd(UINT16 op) { m_icount -= 24+27; { SUB_M(IX,IXD); } } -void t11_device::sub_ixd_rg(UINT16 op) { m_icount -= 30+ 3; { SUB_X(IXD,RG); } } -void t11_device::sub_ixd_rgd(UINT16 op) { m_icount -= 30+12; { SUB_M(IXD,RGD); } } -void t11_device::sub_ixd_in(UINT16 op) { m_icount -= 30+12; { SUB_M(IXD,IN); } } -void t11_device::sub_ixd_ind(UINT16 op) { m_icount -= 30+18; { SUB_M(IXD,IND); } } -void t11_device::sub_ixd_de(UINT16 op) { m_icount -= 30+15; { SUB_M(IXD,DE); } } -void t11_device::sub_ixd_ded(UINT16 op) { m_icount -= 30+21; { SUB_M(IXD,DED); } } -void t11_device::sub_ixd_ix(UINT16 op) { m_icount -= 30+21; { SUB_M(IXD,IX); } } -void t11_device::sub_ixd_ixd(UINT16 op) { m_icount -= 30+27; { SUB_M(IXD,IXD); } } +void t11_device::clrb_rg(uint16_t op) { m_icount -= 12; { CLRB_R(RG); } } +void t11_device::clrb_rgd(uint16_t op) { m_icount -= 21; { CLRB_M(RGD); } } +void t11_device::clrb_in(uint16_t op) { m_icount -= 21; { CLRB_M(IN); } } +void t11_device::clrb_ind(uint16_t op) { m_icount -= 27; { CLRB_M(IND); } } +void t11_device::clrb_de(uint16_t op) { m_icount -= 24; { CLRB_M(DE); } } +void t11_device::clrb_ded(uint16_t op) { m_icount -= 30; { CLRB_M(DED); } } +void t11_device::clrb_ix(uint16_t op) { m_icount -= 30; { CLRB_M(IX); } } +void t11_device::clrb_ixd(uint16_t op) { m_icount -= 36; { CLRB_M(IXD); } } + +void t11_device::comb_rg(uint16_t op) { m_icount -= 12; { COMB_R(RG); } } +void t11_device::comb_rgd(uint16_t op) { m_icount -= 21; { COMB_M(RGD); } } +void t11_device::comb_in(uint16_t op) { m_icount -= 21; { COMB_M(IN); } } +void t11_device::comb_ind(uint16_t op) { m_icount -= 27; { COMB_M(IND); } } +void t11_device::comb_de(uint16_t op) { m_icount -= 24; { COMB_M(DE); } } +void t11_device::comb_ded(uint16_t op) { m_icount -= 30; { COMB_M(DED); } } +void t11_device::comb_ix(uint16_t op) { m_icount -= 30; { COMB_M(IX); } } +void t11_device::comb_ixd(uint16_t op) { m_icount -= 36; { COMB_M(IXD); } } + +void t11_device::incb_rg(uint16_t op) { m_icount -= 12; { INCB_R(RG); } } +void t11_device::incb_rgd(uint16_t op) { m_icount -= 21; { INCB_M(RGD); } } +void t11_device::incb_in(uint16_t op) { m_icount -= 21; { INCB_M(IN); } } +void t11_device::incb_ind(uint16_t op) { m_icount -= 27; { INCB_M(IND); } } +void t11_device::incb_de(uint16_t op) { m_icount -= 24; { INCB_M(DE); } } +void t11_device::incb_ded(uint16_t op) { m_icount -= 30; { INCB_M(DED); } } +void t11_device::incb_ix(uint16_t op) { m_icount -= 30; { INCB_M(IX); } } +void t11_device::incb_ixd(uint16_t op) { m_icount -= 36; { INCB_M(IXD); } } + +void t11_device::decb_rg(uint16_t op) { m_icount -= 12; { DECB_R(RG); } } +void t11_device::decb_rgd(uint16_t op) { m_icount -= 21; { DECB_M(RGD); } } +void t11_device::decb_in(uint16_t op) { m_icount -= 21; { DECB_M(IN); } } +void t11_device::decb_ind(uint16_t op) { m_icount -= 27; { DECB_M(IND); } } +void t11_device::decb_de(uint16_t op) { m_icount -= 24; { DECB_M(DE); } } +void t11_device::decb_ded(uint16_t op) { m_icount -= 30; { DECB_M(DED); } } +void t11_device::decb_ix(uint16_t op) { m_icount -= 30; { DECB_M(IX); } } +void t11_device::decb_ixd(uint16_t op) { m_icount -= 36; { DECB_M(IXD); } } + +void t11_device::negb_rg(uint16_t op) { m_icount -= 12; { NEGB_R(RG); } } +void t11_device::negb_rgd(uint16_t op) { m_icount -= 21; { NEGB_M(RGD); } } +void t11_device::negb_in(uint16_t op) { m_icount -= 21; { NEGB_M(IN); } } +void t11_device::negb_ind(uint16_t op) { m_icount -= 27; { NEGB_M(IND); } } +void t11_device::negb_de(uint16_t op) { m_icount -= 24; { NEGB_M(DE); } } +void t11_device::negb_ded(uint16_t op) { m_icount -= 30; { NEGB_M(DED); } } +void t11_device::negb_ix(uint16_t op) { m_icount -= 30; { NEGB_M(IX); } } +void t11_device::negb_ixd(uint16_t op) { m_icount -= 36; { NEGB_M(IXD); } } + +void t11_device::adcb_rg(uint16_t op) { m_icount -= 12; { ADCB_R(RG); } } +void t11_device::adcb_rgd(uint16_t op) { m_icount -= 21; { ADCB_M(RGD); } } +void t11_device::adcb_in(uint16_t op) { m_icount -= 21; { ADCB_M(IN); } } +void t11_device::adcb_ind(uint16_t op) { m_icount -= 27; { ADCB_M(IND); } } +void t11_device::adcb_de(uint16_t op) { m_icount -= 24; { ADCB_M(DE); } } +void t11_device::adcb_ded(uint16_t op) { m_icount -= 30; { ADCB_M(DED); } } +void t11_device::adcb_ix(uint16_t op) { m_icount -= 30; { ADCB_M(IX); } } +void t11_device::adcb_ixd(uint16_t op) { m_icount -= 36; { ADCB_M(IXD); } } + +void t11_device::sbcb_rg(uint16_t op) { m_icount -= 12; { SBCB_R(RG); } } +void t11_device::sbcb_rgd(uint16_t op) { m_icount -= 21; { SBCB_M(RGD); } } +void t11_device::sbcb_in(uint16_t op) { m_icount -= 21; { SBCB_M(IN); } } +void t11_device::sbcb_ind(uint16_t op) { m_icount -= 27; { SBCB_M(IND); } } +void t11_device::sbcb_de(uint16_t op) { m_icount -= 24; { SBCB_M(DE); } } +void t11_device::sbcb_ded(uint16_t op) { m_icount -= 30; { SBCB_M(DED); } } +void t11_device::sbcb_ix(uint16_t op) { m_icount -= 30; { SBCB_M(IX); } } +void t11_device::sbcb_ixd(uint16_t op) { m_icount -= 36; { SBCB_M(IXD); } } + +void t11_device::tstb_rg(uint16_t op) { m_icount -= 12; { TSTB_R(RG); } } +void t11_device::tstb_rgd(uint16_t op) { m_icount -= 18; { TSTB_M(RGD); } } +void t11_device::tstb_in(uint16_t op) { m_icount -= 18; { TSTB_M(IN); } } +void t11_device::tstb_ind(uint16_t op) { m_icount -= 24; { TSTB_M(IND); } } +void t11_device::tstb_de(uint16_t op) { m_icount -= 21; { TSTB_M(DE); } } +void t11_device::tstb_ded(uint16_t op) { m_icount -= 27; { TSTB_M(DED); } } +void t11_device::tstb_ix(uint16_t op) { m_icount -= 27; { TSTB_M(IX); } } +void t11_device::tstb_ixd(uint16_t op) { m_icount -= 33; { TSTB_M(IXD); } } + +void t11_device::rorb_rg(uint16_t op) { m_icount -= 12; { RORB_R(RG); } } +void t11_device::rorb_rgd(uint16_t op) { m_icount -= 21; { RORB_M(RGD); } } +void t11_device::rorb_in(uint16_t op) { m_icount -= 21; { RORB_M(IN); } } +void t11_device::rorb_ind(uint16_t op) { m_icount -= 27; { RORB_M(IND); } } +void t11_device::rorb_de(uint16_t op) { m_icount -= 24; { RORB_M(DE); } } +void t11_device::rorb_ded(uint16_t op) { m_icount -= 30; { RORB_M(DED); } } +void t11_device::rorb_ix(uint16_t op) { m_icount -= 30; { RORB_M(IX); } } +void t11_device::rorb_ixd(uint16_t op) { m_icount -= 36; { RORB_M(IXD); } } + +void t11_device::rolb_rg(uint16_t op) { m_icount -= 12; { ROLB_R(RG); } } +void t11_device::rolb_rgd(uint16_t op) { m_icount -= 21; { ROLB_M(RGD); } } +void t11_device::rolb_in(uint16_t op) { m_icount -= 21; { ROLB_M(IN); } } +void t11_device::rolb_ind(uint16_t op) { m_icount -= 27; { ROLB_M(IND); } } +void t11_device::rolb_de(uint16_t op) { m_icount -= 24; { ROLB_M(DE); } } +void t11_device::rolb_ded(uint16_t op) { m_icount -= 30; { ROLB_M(DED); } } +void t11_device::rolb_ix(uint16_t op) { m_icount -= 30; { ROLB_M(IX); } } +void t11_device::rolb_ixd(uint16_t op) { m_icount -= 36; { ROLB_M(IXD); } } + +void t11_device::asrb_rg(uint16_t op) { m_icount -= 12; { ASRB_R(RG); } } +void t11_device::asrb_rgd(uint16_t op) { m_icount -= 21; { ASRB_M(RGD); } } +void t11_device::asrb_in(uint16_t op) { m_icount -= 21; { ASRB_M(IN); } } +void t11_device::asrb_ind(uint16_t op) { m_icount -= 27; { ASRB_M(IND); } } +void t11_device::asrb_de(uint16_t op) { m_icount -= 24; { ASRB_M(DE); } } +void t11_device::asrb_ded(uint16_t op) { m_icount -= 30; { ASRB_M(DED); } } +void t11_device::asrb_ix(uint16_t op) { m_icount -= 30; { ASRB_M(IX); } } +void t11_device::asrb_ixd(uint16_t op) { m_icount -= 36; { ASRB_M(IXD); } } + +void t11_device::aslb_rg(uint16_t op) { m_icount -= 12; { ASLB_R(RG); } } +void t11_device::aslb_rgd(uint16_t op) { m_icount -= 21; { ASLB_M(RGD); } } +void t11_device::aslb_in(uint16_t op) { m_icount -= 21; { ASLB_M(IN); } } +void t11_device::aslb_ind(uint16_t op) { m_icount -= 27; { ASLB_M(IND); } } +void t11_device::aslb_de(uint16_t op) { m_icount -= 24; { ASLB_M(DE); } } +void t11_device::aslb_ded(uint16_t op) { m_icount -= 30; { ASLB_M(DED); } } +void t11_device::aslb_ix(uint16_t op) { m_icount -= 30; { ASLB_M(IX); } } +void t11_device::aslb_ixd(uint16_t op) { m_icount -= 36; { ASLB_M(IXD); } } + +void t11_device::mtps_rg(uint16_t op) { m_icount -= 24; { MTPS_R(RG); } } +void t11_device::mtps_rgd(uint16_t op) { m_icount -= 30; { MTPS_M(RGD); } } +void t11_device::mtps_in(uint16_t op) { m_icount -= 30; { MTPS_M(IN); } } +void t11_device::mtps_ind(uint16_t op) { m_icount -= 36; { MTPS_M(IND); } } +void t11_device::mtps_de(uint16_t op) { m_icount -= 33; { MTPS_M(DE); } } +void t11_device::mtps_ded(uint16_t op) { m_icount -= 39; { MTPS_M(DED); } } +void t11_device::mtps_ix(uint16_t op) { m_icount -= 39; { MTPS_M(IX); } } +void t11_device::mtps_ixd(uint16_t op) { m_icount -= 45; { MTPS_M(IXD); } } + +void t11_device::mfps_rg(uint16_t op) { m_icount -= 12; { MFPS_R(RG); } } +void t11_device::mfps_rgd(uint16_t op) { m_icount -= 21; { MFPS_M(RGD); } } +void t11_device::mfps_in(uint16_t op) { m_icount -= 21; { MFPS_M(IN); } } +void t11_device::mfps_ind(uint16_t op) { m_icount -= 27; { MFPS_M(IND); } } +void t11_device::mfps_de(uint16_t op) { m_icount -= 24; { MFPS_M(DE); } } +void t11_device::mfps_ded(uint16_t op) { m_icount -= 30; { MFPS_M(DED); } } +void t11_device::mfps_ix(uint16_t op) { m_icount -= 30; { MFPS_M(IX); } } +void t11_device::mfps_ixd(uint16_t op) { m_icount -= 36; { MFPS_M(IXD); } } + +void t11_device::movb_rg_rg(uint16_t op) { m_icount -= 9+ 3; { MOVB_R(RG,RG); } } +void t11_device::movb_rg_rgd(uint16_t op) { m_icount -= 9+12; { MOVB_M(RG,RGD); } } +void t11_device::movb_rg_in(uint16_t op) { m_icount -= 9+12; { MOVB_M(RG,IN); } } +void t11_device::movb_rg_ind(uint16_t op) { m_icount -= 9+18; { MOVB_M(RG,IND); } } +void t11_device::movb_rg_de(uint16_t op) { m_icount -= 9+15; { MOVB_M(RG,DE); } } +void t11_device::movb_rg_ded(uint16_t op) { m_icount -= 9+21; { MOVB_M(RG,DED); } } +void t11_device::movb_rg_ix(uint16_t op) { m_icount -= 9+21; { MOVB_M(RG,IX); } } +void t11_device::movb_rg_ixd(uint16_t op) { m_icount -= 9+27; { MOVB_M(RG,IXD); } } +void t11_device::movb_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { MOVB_X(RGD,RG); } } +void t11_device::movb_rgd_rgd(uint16_t op) { m_icount -= 15+12; { MOVB_M(RGD,RGD); } } +void t11_device::movb_rgd_in(uint16_t op) { m_icount -= 15+12; { MOVB_M(RGD,IN); } } +void t11_device::movb_rgd_ind(uint16_t op) { m_icount -= 15+18; { MOVB_M(RGD,IND); } } +void t11_device::movb_rgd_de(uint16_t op) { m_icount -= 15+15; { MOVB_M(RGD,DE); } } +void t11_device::movb_rgd_ded(uint16_t op) { m_icount -= 15+21; { MOVB_M(RGD,DED); } } +void t11_device::movb_rgd_ix(uint16_t op) { m_icount -= 15+21; { MOVB_M(RGD,IX); } } +void t11_device::movb_rgd_ixd(uint16_t op) { m_icount -= 15+27; { MOVB_M(RGD,IXD); } } +void t11_device::movb_in_rg(uint16_t op) { m_icount -= 15+ 3; { MOVB_X(IN,RG); } } +void t11_device::movb_in_rgd(uint16_t op) { m_icount -= 15+12; { MOVB_M(IN,RGD); } } +void t11_device::movb_in_in(uint16_t op) { m_icount -= 15+12; { MOVB_M(IN,IN); } } +void t11_device::movb_in_ind(uint16_t op) { m_icount -= 15+18; { MOVB_M(IN,IND); } } +void t11_device::movb_in_de(uint16_t op) { m_icount -= 15+15; { MOVB_M(IN,DE); } } +void t11_device::movb_in_ded(uint16_t op) { m_icount -= 15+21; { MOVB_M(IN,DED); } } +void t11_device::movb_in_ix(uint16_t op) { m_icount -= 15+21; { MOVB_M(IN,IX); } } +void t11_device::movb_in_ixd(uint16_t op) { m_icount -= 15+27; { MOVB_M(IN,IXD); } } +void t11_device::movb_ind_rg(uint16_t op) { m_icount -= 21+ 3; { MOVB_X(IND,RG); } } +void t11_device::movb_ind_rgd(uint16_t op) { m_icount -= 21+12; { MOVB_M(IND,RGD); } } +void t11_device::movb_ind_in(uint16_t op) { m_icount -= 21+12; { MOVB_M(IND,IN); } } +void t11_device::movb_ind_ind(uint16_t op) { m_icount -= 21+18; { MOVB_M(IND,IND); } } +void t11_device::movb_ind_de(uint16_t op) { m_icount -= 21+15; { MOVB_M(IND,DE); } } +void t11_device::movb_ind_ded(uint16_t op) { m_icount -= 21+21; { MOVB_M(IND,DED); } } +void t11_device::movb_ind_ix(uint16_t op) { m_icount -= 21+21; { MOVB_M(IND,IX); } } +void t11_device::movb_ind_ixd(uint16_t op) { m_icount -= 21+27; { MOVB_M(IND,IXD); } } +void t11_device::movb_de_rg(uint16_t op) { m_icount -= 18+ 3; { MOVB_X(DE,RG); } } +void t11_device::movb_de_rgd(uint16_t op) { m_icount -= 18+12; { MOVB_M(DE,RGD); } } +void t11_device::movb_de_in(uint16_t op) { m_icount -= 18+12; { MOVB_M(DE,IN); } } +void t11_device::movb_de_ind(uint16_t op) { m_icount -= 18+18; { MOVB_M(DE,IND); } } +void t11_device::movb_de_de(uint16_t op) { m_icount -= 18+15; { MOVB_M(DE,DE); } } +void t11_device::movb_de_ded(uint16_t op) { m_icount -= 18+21; { MOVB_M(DE,DED); } } +void t11_device::movb_de_ix(uint16_t op) { m_icount -= 18+21; { MOVB_M(DE,IX); } } +void t11_device::movb_de_ixd(uint16_t op) { m_icount -= 18+27; { MOVB_M(DE,IXD); } } +void t11_device::movb_ded_rg(uint16_t op) { m_icount -= 24+ 3; { MOVB_X(DED,RG); } } +void t11_device::movb_ded_rgd(uint16_t op) { m_icount -= 24+12; { MOVB_M(DED,RGD); } } +void t11_device::movb_ded_in(uint16_t op) { m_icount -= 24+12; { MOVB_M(DED,IN); } } +void t11_device::movb_ded_ind(uint16_t op) { m_icount -= 24+18; { MOVB_M(DED,IND); } } +void t11_device::movb_ded_de(uint16_t op) { m_icount -= 24+15; { MOVB_M(DED,DE); } } +void t11_device::movb_ded_ded(uint16_t op) { m_icount -= 24+21; { MOVB_M(DED,DED); } } +void t11_device::movb_ded_ix(uint16_t op) { m_icount -= 24+21; { MOVB_M(DED,IX); } } +void t11_device::movb_ded_ixd(uint16_t op) { m_icount -= 24+27; { MOVB_M(DED,IXD); } } +void t11_device::movb_ix_rg(uint16_t op) { m_icount -= 24+ 3; { MOVB_X(IX,RG); } } +void t11_device::movb_ix_rgd(uint16_t op) { m_icount -= 24+12; { MOVB_M(IX,RGD); } } +void t11_device::movb_ix_in(uint16_t op) { m_icount -= 24+12; { MOVB_M(IX,IN); } } +void t11_device::movb_ix_ind(uint16_t op) { m_icount -= 24+18; { MOVB_M(IX,IND); } } +void t11_device::movb_ix_de(uint16_t op) { m_icount -= 24+15; { MOVB_M(IX,DE); } } +void t11_device::movb_ix_ded(uint16_t op) { m_icount -= 24+21; { MOVB_M(IX,DED); } } +void t11_device::movb_ix_ix(uint16_t op) { m_icount -= 24+21; { MOVB_M(IX,IX); } } +void t11_device::movb_ix_ixd(uint16_t op) { m_icount -= 24+27; { MOVB_M(IX,IXD); } } +void t11_device::movb_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { MOVB_X(IXD,RG); } } +void t11_device::movb_ixd_rgd(uint16_t op) { m_icount -= 30+12; { MOVB_M(IXD,RGD); } } +void t11_device::movb_ixd_in(uint16_t op) { m_icount -= 30+12; { MOVB_M(IXD,IN); } } +void t11_device::movb_ixd_ind(uint16_t op) { m_icount -= 30+18; { MOVB_M(IXD,IND); } } +void t11_device::movb_ixd_de(uint16_t op) { m_icount -= 30+15; { MOVB_M(IXD,DE); } } +void t11_device::movb_ixd_ded(uint16_t op) { m_icount -= 30+21; { MOVB_M(IXD,DED); } } +void t11_device::movb_ixd_ix(uint16_t op) { m_icount -= 30+21; { MOVB_M(IXD,IX); } } +void t11_device::movb_ixd_ixd(uint16_t op) { m_icount -= 30+27; { MOVB_M(IXD,IXD); } } + +void t11_device::cmpb_rg_rg(uint16_t op) { m_icount -= 9+ 3; { CMPB_R(RG,RG); } } +void t11_device::cmpb_rg_rgd(uint16_t op) { m_icount -= 9+ 9; { CMPB_M(RG,RGD); } } +void t11_device::cmpb_rg_in(uint16_t op) { m_icount -= 9+ 9; { CMPB_M(RG,IN); } } +void t11_device::cmpb_rg_ind(uint16_t op) { m_icount -= 9+15; { CMPB_M(RG,IND); } } +void t11_device::cmpb_rg_de(uint16_t op) { m_icount -= 9+12; { CMPB_M(RG,DE); } } +void t11_device::cmpb_rg_ded(uint16_t op) { m_icount -= 9+18; { CMPB_M(RG,DED); } } +void t11_device::cmpb_rg_ix(uint16_t op) { m_icount -= 9+18; { CMPB_M(RG,IX); } } +void t11_device::cmpb_rg_ixd(uint16_t op) { m_icount -= 9+24; { CMPB_M(RG,IXD); } } +void t11_device::cmpb_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { CMPB_M(RGD,RG); } } +void t11_device::cmpb_rgd_rgd(uint16_t op) { m_icount -= 15+ 9; { CMPB_M(RGD,RGD); } } +void t11_device::cmpb_rgd_in(uint16_t op) { m_icount -= 15+ 9; { CMPB_M(RGD,IN); } } +void t11_device::cmpb_rgd_ind(uint16_t op) { m_icount -= 15+15; { CMPB_M(RGD,IND); } } +void t11_device::cmpb_rgd_de(uint16_t op) { m_icount -= 15+12; { CMPB_M(RGD,DE); } } +void t11_device::cmpb_rgd_ded(uint16_t op) { m_icount -= 15+18; { CMPB_M(RGD,DED); } } +void t11_device::cmpb_rgd_ix(uint16_t op) { m_icount -= 15+18; { CMPB_M(RGD,IX); } } +void t11_device::cmpb_rgd_ixd(uint16_t op) { m_icount -= 15+24; { CMPB_M(RGD,IXD); } } +void t11_device::cmpb_in_rg(uint16_t op) { m_icount -= 15+ 3; { CMPB_M(IN,RG); } } +void t11_device::cmpb_in_rgd(uint16_t op) { m_icount -= 15+ 9; { CMPB_M(IN,RGD); } } +void t11_device::cmpb_in_in(uint16_t op) { m_icount -= 15+ 9; { CMPB_M(IN,IN); } } +void t11_device::cmpb_in_ind(uint16_t op) { m_icount -= 15+15; { CMPB_M(IN,IND); } } +void t11_device::cmpb_in_de(uint16_t op) { m_icount -= 15+12; { CMPB_M(IN,DE); } } +void t11_device::cmpb_in_ded(uint16_t op) { m_icount -= 15+18; { CMPB_M(IN,DED); } } +void t11_device::cmpb_in_ix(uint16_t op) { m_icount -= 15+18; { CMPB_M(IN,IX); } } +void t11_device::cmpb_in_ixd(uint16_t op) { m_icount -= 15+24; { CMPB_M(IN,IXD); } } +void t11_device::cmpb_ind_rg(uint16_t op) { m_icount -= 21+ 3; { CMPB_M(IND,RG); } } +void t11_device::cmpb_ind_rgd(uint16_t op) { m_icount -= 21+ 9; { CMPB_M(IND,RGD); } } +void t11_device::cmpb_ind_in(uint16_t op) { m_icount -= 21+ 9; { CMPB_M(IND,IN); } } +void t11_device::cmpb_ind_ind(uint16_t op) { m_icount -= 21+15; { CMPB_M(IND,IND); } } +void t11_device::cmpb_ind_de(uint16_t op) { m_icount -= 21+12; { CMPB_M(IND,DE); } } +void t11_device::cmpb_ind_ded(uint16_t op) { m_icount -= 21+18; { CMPB_M(IND,DED); } } +void t11_device::cmpb_ind_ix(uint16_t op) { m_icount -= 21+18; { CMPB_M(IND,IX); } } +void t11_device::cmpb_ind_ixd(uint16_t op) { m_icount -= 21+24; { CMPB_M(IND,IXD); } } +void t11_device::cmpb_de_rg(uint16_t op) { m_icount -= 18+ 3; { CMPB_M(DE,RG); } } +void t11_device::cmpb_de_rgd(uint16_t op) { m_icount -= 18+ 9; { CMPB_M(DE,RGD); } } +void t11_device::cmpb_de_in(uint16_t op) { m_icount -= 18+ 9; { CMPB_M(DE,IN); } } +void t11_device::cmpb_de_ind(uint16_t op) { m_icount -= 18+15; { CMPB_M(DE,IND); } } +void t11_device::cmpb_de_de(uint16_t op) { m_icount -= 18+12; { CMPB_M(DE,DE); } } +void t11_device::cmpb_de_ded(uint16_t op) { m_icount -= 18+18; { CMPB_M(DE,DED); } } +void t11_device::cmpb_de_ix(uint16_t op) { m_icount -= 18+18; { CMPB_M(DE,IX); } } +void t11_device::cmpb_de_ixd(uint16_t op) { m_icount -= 18+24; { CMPB_M(DE,IXD); } } +void t11_device::cmpb_ded_rg(uint16_t op) { m_icount -= 24+ 3; { CMPB_M(DED,RG); } } +void t11_device::cmpb_ded_rgd(uint16_t op) { m_icount -= 24+ 9; { CMPB_M(DED,RGD); } } +void t11_device::cmpb_ded_in(uint16_t op) { m_icount -= 24+ 9; { CMPB_M(DED,IN); } } +void t11_device::cmpb_ded_ind(uint16_t op) { m_icount -= 24+15; { CMPB_M(DED,IND); } } +void t11_device::cmpb_ded_de(uint16_t op) { m_icount -= 24+12; { CMPB_M(DED,DE); } } +void t11_device::cmpb_ded_ded(uint16_t op) { m_icount -= 24+18; { CMPB_M(DED,DED); } } +void t11_device::cmpb_ded_ix(uint16_t op) { m_icount -= 24+18; { CMPB_M(DED,IX); } } +void t11_device::cmpb_ded_ixd(uint16_t op) { m_icount -= 24+24; { CMPB_M(DED,IXD); } } +void t11_device::cmpb_ix_rg(uint16_t op) { m_icount -= 24+ 3; { CMPB_M(IX,RG); } } +void t11_device::cmpb_ix_rgd(uint16_t op) { m_icount -= 24+ 9; { CMPB_M(IX,RGD); } } +void t11_device::cmpb_ix_in(uint16_t op) { m_icount -= 24+ 9; { CMPB_M(IX,IN); } } +void t11_device::cmpb_ix_ind(uint16_t op) { m_icount -= 24+15; { CMPB_M(IX,IND); } } +void t11_device::cmpb_ix_de(uint16_t op) { m_icount -= 24+12; { CMPB_M(IX,DE); } } +void t11_device::cmpb_ix_ded(uint16_t op) { m_icount -= 24+18; { CMPB_M(IX,DED); } } +void t11_device::cmpb_ix_ix(uint16_t op) { m_icount -= 24+18; { CMPB_M(IX,IX); } } +void t11_device::cmpb_ix_ixd(uint16_t op) { m_icount -= 24+24; { CMPB_M(IX,IXD); } } +void t11_device::cmpb_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { CMPB_M(IXD,RG); } } +void t11_device::cmpb_ixd_rgd(uint16_t op) { m_icount -= 30+ 9; { CMPB_M(IXD,RGD); } } +void t11_device::cmpb_ixd_in(uint16_t op) { m_icount -= 30+ 9; { CMPB_M(IXD,IN); } } +void t11_device::cmpb_ixd_ind(uint16_t op) { m_icount -= 30+15; { CMPB_M(IXD,IND); } } +void t11_device::cmpb_ixd_de(uint16_t op) { m_icount -= 30+12; { CMPB_M(IXD,DE); } } +void t11_device::cmpb_ixd_ded(uint16_t op) { m_icount -= 30+18; { CMPB_M(IXD,DED); } } +void t11_device::cmpb_ixd_ix(uint16_t op) { m_icount -= 30+18; { CMPB_M(IXD,IX); } } +void t11_device::cmpb_ixd_ixd(uint16_t op) { m_icount -= 30+24; { CMPB_M(IXD,IXD); } } + +void t11_device::bitb_rg_rg(uint16_t op) { m_icount -= 9+ 3; { BITB_R(RG,RG); } } +void t11_device::bitb_rg_rgd(uint16_t op) { m_icount -= 9+ 9; { BITB_M(RG,RGD); } } +void t11_device::bitb_rg_in(uint16_t op) { m_icount -= 9+ 9; { BITB_M(RG,IN); } } +void t11_device::bitb_rg_ind(uint16_t op) { m_icount -= 9+15; { BITB_M(RG,IND); } } +void t11_device::bitb_rg_de(uint16_t op) { m_icount -= 9+12; { BITB_M(RG,DE); } } +void t11_device::bitb_rg_ded(uint16_t op) { m_icount -= 9+18; { BITB_M(RG,DED); } } +void t11_device::bitb_rg_ix(uint16_t op) { m_icount -= 9+18; { BITB_M(RG,IX); } } +void t11_device::bitb_rg_ixd(uint16_t op) { m_icount -= 9+24; { BITB_M(RG,IXD); } } +void t11_device::bitb_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { BITB_M(RGD,RG); } } +void t11_device::bitb_rgd_rgd(uint16_t op) { m_icount -= 15+ 9; { BITB_M(RGD,RGD); } } +void t11_device::bitb_rgd_in(uint16_t op) { m_icount -= 15+ 9; { BITB_M(RGD,IN); } } +void t11_device::bitb_rgd_ind(uint16_t op) { m_icount -= 15+15; { BITB_M(RGD,IND); } } +void t11_device::bitb_rgd_de(uint16_t op) { m_icount -= 15+12; { BITB_M(RGD,DE); } } +void t11_device::bitb_rgd_ded(uint16_t op) { m_icount -= 15+18; { BITB_M(RGD,DED); } } +void t11_device::bitb_rgd_ix(uint16_t op) { m_icount -= 15+18; { BITB_M(RGD,IX); } } +void t11_device::bitb_rgd_ixd(uint16_t op) { m_icount -= 15+24; { BITB_M(RGD,IXD); } } +void t11_device::bitb_in_rg(uint16_t op) { m_icount -= 15+ 3; { BITB_M(IN,RG); } } +void t11_device::bitb_in_rgd(uint16_t op) { m_icount -= 15+ 9; { BITB_M(IN,RGD); } } +void t11_device::bitb_in_in(uint16_t op) { m_icount -= 15+ 9; { BITB_M(IN,IN); } } +void t11_device::bitb_in_ind(uint16_t op) { m_icount -= 15+15; { BITB_M(IN,IND); } } +void t11_device::bitb_in_de(uint16_t op) { m_icount -= 15+12; { BITB_M(IN,DE); } } +void t11_device::bitb_in_ded(uint16_t op) { m_icount -= 15+18; { BITB_M(IN,DED); } } +void t11_device::bitb_in_ix(uint16_t op) { m_icount -= 15+18; { BITB_M(IN,IX); } } +void t11_device::bitb_in_ixd(uint16_t op) { m_icount -= 15+24; { BITB_M(IN,IXD); } } +void t11_device::bitb_ind_rg(uint16_t op) { m_icount -= 21+ 3; { BITB_M(IND,RG); } } +void t11_device::bitb_ind_rgd(uint16_t op) { m_icount -= 21+ 9; { BITB_M(IND,RGD); } } +void t11_device::bitb_ind_in(uint16_t op) { m_icount -= 21+ 9; { BITB_M(IND,IN); } } +void t11_device::bitb_ind_ind(uint16_t op) { m_icount -= 21+15; { BITB_M(IND,IND); } } +void t11_device::bitb_ind_de(uint16_t op) { m_icount -= 21+12; { BITB_M(IND,DE); } } +void t11_device::bitb_ind_ded(uint16_t op) { m_icount -= 21+18; { BITB_M(IND,DED); } } +void t11_device::bitb_ind_ix(uint16_t op) { m_icount -= 21+18; { BITB_M(IND,IX); } } +void t11_device::bitb_ind_ixd(uint16_t op) { m_icount -= 21+24; { BITB_M(IND,IXD); } } +void t11_device::bitb_de_rg(uint16_t op) { m_icount -= 18+ 3; { BITB_M(DE,RG); } } +void t11_device::bitb_de_rgd(uint16_t op) { m_icount -= 18+ 9; { BITB_M(DE,RGD); } } +void t11_device::bitb_de_in(uint16_t op) { m_icount -= 18+ 9; { BITB_M(DE,IN); } } +void t11_device::bitb_de_ind(uint16_t op) { m_icount -= 18+15; { BITB_M(DE,IND); } } +void t11_device::bitb_de_de(uint16_t op) { m_icount -= 18+12; { BITB_M(DE,DE); } } +void t11_device::bitb_de_ded(uint16_t op) { m_icount -= 18+18; { BITB_M(DE,DED); } } +void t11_device::bitb_de_ix(uint16_t op) { m_icount -= 18+18; { BITB_M(DE,IX); } } +void t11_device::bitb_de_ixd(uint16_t op) { m_icount -= 18+24; { BITB_M(DE,IXD); } } +void t11_device::bitb_ded_rg(uint16_t op) { m_icount -= 24+ 3; { BITB_M(DED,RG); } } +void t11_device::bitb_ded_rgd(uint16_t op) { m_icount -= 24+ 9; { BITB_M(DED,RGD); } } +void t11_device::bitb_ded_in(uint16_t op) { m_icount -= 24+ 9; { BITB_M(DED,IN); } } +void t11_device::bitb_ded_ind(uint16_t op) { m_icount -= 24+15; { BITB_M(DED,IND); } } +void t11_device::bitb_ded_de(uint16_t op) { m_icount -= 24+12; { BITB_M(DED,DE); } } +void t11_device::bitb_ded_ded(uint16_t op) { m_icount -= 24+18; { BITB_M(DED,DED); } } +void t11_device::bitb_ded_ix(uint16_t op) { m_icount -= 24+18; { BITB_M(DED,IX); } } +void t11_device::bitb_ded_ixd(uint16_t op) { m_icount -= 24+24; { BITB_M(DED,IXD); } } +void t11_device::bitb_ix_rg(uint16_t op) { m_icount -= 24+ 3; { BITB_M(IX,RG); } } +void t11_device::bitb_ix_rgd(uint16_t op) { m_icount -= 24+ 9; { BITB_M(IX,RGD); } } +void t11_device::bitb_ix_in(uint16_t op) { m_icount -= 24+ 9; { BITB_M(IX,IN); } } +void t11_device::bitb_ix_ind(uint16_t op) { m_icount -= 24+15; { BITB_M(IX,IND); } } +void t11_device::bitb_ix_de(uint16_t op) { m_icount -= 24+12; { BITB_M(IX,DE); } } +void t11_device::bitb_ix_ded(uint16_t op) { m_icount -= 24+18; { BITB_M(IX,DED); } } +void t11_device::bitb_ix_ix(uint16_t op) { m_icount -= 24+18; { BITB_M(IX,IX); } } +void t11_device::bitb_ix_ixd(uint16_t op) { m_icount -= 24+24; { BITB_M(IX,IXD); } } +void t11_device::bitb_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { BITB_M(IXD,RG); } } +void t11_device::bitb_ixd_rgd(uint16_t op) { m_icount -= 30+ 9; { BITB_M(IXD,RGD); } } +void t11_device::bitb_ixd_in(uint16_t op) { m_icount -= 30+ 9; { BITB_M(IXD,IN); } } +void t11_device::bitb_ixd_ind(uint16_t op) { m_icount -= 30+15; { BITB_M(IXD,IND); } } +void t11_device::bitb_ixd_de(uint16_t op) { m_icount -= 30+12; { BITB_M(IXD,DE); } } +void t11_device::bitb_ixd_ded(uint16_t op) { m_icount -= 30+18; { BITB_M(IXD,DED); } } +void t11_device::bitb_ixd_ix(uint16_t op) { m_icount -= 30+18; { BITB_M(IXD,IX); } } +void t11_device::bitb_ixd_ixd(uint16_t op) { m_icount -= 30+24; { BITB_M(IXD,IXD); } } + +void t11_device::bicb_rg_rg(uint16_t op) { m_icount -= 9+ 3; { BICB_R(RG,RG); } } +void t11_device::bicb_rg_rgd(uint16_t op) { m_icount -= 9+12; { BICB_M(RG,RGD); } } +void t11_device::bicb_rg_in(uint16_t op) { m_icount -= 9+12; { BICB_M(RG,IN); } } +void t11_device::bicb_rg_ind(uint16_t op) { m_icount -= 9+18; { BICB_M(RG,IND); } } +void t11_device::bicb_rg_de(uint16_t op) { m_icount -= 9+15; { BICB_M(RG,DE); } } +void t11_device::bicb_rg_ded(uint16_t op) { m_icount -= 9+21; { BICB_M(RG,DED); } } +void t11_device::bicb_rg_ix(uint16_t op) { m_icount -= 9+21; { BICB_M(RG,IX); } } +void t11_device::bicb_rg_ixd(uint16_t op) { m_icount -= 9+27; { BICB_M(RG,IXD); } } +void t11_device::bicb_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { BICB_X(RGD,RG); } } +void t11_device::bicb_rgd_rgd(uint16_t op) { m_icount -= 15+12; { BICB_M(RGD,RGD); } } +void t11_device::bicb_rgd_in(uint16_t op) { m_icount -= 15+12; { BICB_M(RGD,IN); } } +void t11_device::bicb_rgd_ind(uint16_t op) { m_icount -= 15+18; { BICB_M(RGD,IND); } } +void t11_device::bicb_rgd_de(uint16_t op) { m_icount -= 15+15; { BICB_M(RGD,DE); } } +void t11_device::bicb_rgd_ded(uint16_t op) { m_icount -= 15+21; { BICB_M(RGD,DED); } } +void t11_device::bicb_rgd_ix(uint16_t op) { m_icount -= 15+21; { BICB_M(RGD,IX); } } +void t11_device::bicb_rgd_ixd(uint16_t op) { m_icount -= 15+27; { BICB_M(RGD,IXD); } } +void t11_device::bicb_in_rg(uint16_t op) { m_icount -= 15+ 3; { BICB_X(IN,RG); } } +void t11_device::bicb_in_rgd(uint16_t op) { m_icount -= 15+12; { BICB_M(IN,RGD); } } +void t11_device::bicb_in_in(uint16_t op) { m_icount -= 15+12; { BICB_M(IN,IN); } } +void t11_device::bicb_in_ind(uint16_t op) { m_icount -= 15+18; { BICB_M(IN,IND); } } +void t11_device::bicb_in_de(uint16_t op) { m_icount -= 15+15; { BICB_M(IN,DE); } } +void t11_device::bicb_in_ded(uint16_t op) { m_icount -= 15+21; { BICB_M(IN,DED); } } +void t11_device::bicb_in_ix(uint16_t op) { m_icount -= 15+21; { BICB_M(IN,IX); } } +void t11_device::bicb_in_ixd(uint16_t op) { m_icount -= 15+27; { BICB_M(IN,IXD); } } +void t11_device::bicb_ind_rg(uint16_t op) { m_icount -= 21+ 3; { BICB_X(IND,RG); } } +void t11_device::bicb_ind_rgd(uint16_t op) { m_icount -= 21+12; { BICB_M(IND,RGD); } } +void t11_device::bicb_ind_in(uint16_t op) { m_icount -= 21+12; { BICB_M(IND,IN); } } +void t11_device::bicb_ind_ind(uint16_t op) { m_icount -= 21+18; { BICB_M(IND,IND); } } +void t11_device::bicb_ind_de(uint16_t op) { m_icount -= 21+15; { BICB_M(IND,DE); } } +void t11_device::bicb_ind_ded(uint16_t op) { m_icount -= 21+21; { BICB_M(IND,DED); } } +void t11_device::bicb_ind_ix(uint16_t op) { m_icount -= 21+21; { BICB_M(IND,IX); } } +void t11_device::bicb_ind_ixd(uint16_t op) { m_icount -= 21+27; { BICB_M(IND,IXD); } } +void t11_device::bicb_de_rg(uint16_t op) { m_icount -= 18+ 3; { BICB_X(DE,RG); } } +void t11_device::bicb_de_rgd(uint16_t op) { m_icount -= 18+12; { BICB_M(DE,RGD); } } +void t11_device::bicb_de_in(uint16_t op) { m_icount -= 18+12; { BICB_M(DE,IN); } } +void t11_device::bicb_de_ind(uint16_t op) { m_icount -= 18+18; { BICB_M(DE,IND); } } +void t11_device::bicb_de_de(uint16_t op) { m_icount -= 18+15; { BICB_M(DE,DE); } } +void t11_device::bicb_de_ded(uint16_t op) { m_icount -= 18+21; { BICB_M(DE,DED); } } +void t11_device::bicb_de_ix(uint16_t op) { m_icount -= 18+21; { BICB_M(DE,IX); } } +void t11_device::bicb_de_ixd(uint16_t op) { m_icount -= 18+27; { BICB_M(DE,IXD); } } +void t11_device::bicb_ded_rg(uint16_t op) { m_icount -= 24+ 3; { BICB_X(DED,RG); } } +void t11_device::bicb_ded_rgd(uint16_t op) { m_icount -= 24+12; { BICB_M(DED,RGD); } } +void t11_device::bicb_ded_in(uint16_t op) { m_icount -= 24+12; { BICB_M(DED,IN); } } +void t11_device::bicb_ded_ind(uint16_t op) { m_icount -= 24+18; { BICB_M(DED,IND); } } +void t11_device::bicb_ded_de(uint16_t op) { m_icount -= 24+15; { BICB_M(DED,DE); } } +void t11_device::bicb_ded_ded(uint16_t op) { m_icount -= 24+21; { BICB_M(DED,DED); } } +void t11_device::bicb_ded_ix(uint16_t op) { m_icount -= 24+21; { BICB_M(DED,IX); } } +void t11_device::bicb_ded_ixd(uint16_t op) { m_icount -= 24+27; { BICB_M(DED,IXD); } } +void t11_device::bicb_ix_rg(uint16_t op) { m_icount -= 24+ 3; { BICB_X(IX,RG); } } +void t11_device::bicb_ix_rgd(uint16_t op) { m_icount -= 24+12; { BICB_M(IX,RGD); } } +void t11_device::bicb_ix_in(uint16_t op) { m_icount -= 24+12; { BICB_M(IX,IN); } } +void t11_device::bicb_ix_ind(uint16_t op) { m_icount -= 24+18; { BICB_M(IX,IND); } } +void t11_device::bicb_ix_de(uint16_t op) { m_icount -= 24+15; { BICB_M(IX,DE); } } +void t11_device::bicb_ix_ded(uint16_t op) { m_icount -= 24+21; { BICB_M(IX,DED); } } +void t11_device::bicb_ix_ix(uint16_t op) { m_icount -= 24+21; { BICB_M(IX,IX); } } +void t11_device::bicb_ix_ixd(uint16_t op) { m_icount -= 24+27; { BICB_M(IX,IXD); } } +void t11_device::bicb_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { BICB_X(IXD,RG); } } +void t11_device::bicb_ixd_rgd(uint16_t op) { m_icount -= 30+12; { BICB_M(IXD,RGD); } } +void t11_device::bicb_ixd_in(uint16_t op) { m_icount -= 30+12; { BICB_M(IXD,IN); } } +void t11_device::bicb_ixd_ind(uint16_t op) { m_icount -= 30+18; { BICB_M(IXD,IND); } } +void t11_device::bicb_ixd_de(uint16_t op) { m_icount -= 30+15; { BICB_M(IXD,DE); } } +void t11_device::bicb_ixd_ded(uint16_t op) { m_icount -= 30+21; { BICB_M(IXD,DED); } } +void t11_device::bicb_ixd_ix(uint16_t op) { m_icount -= 30+21; { BICB_M(IXD,IX); } } +void t11_device::bicb_ixd_ixd(uint16_t op) { m_icount -= 30+27; { BICB_M(IXD,IXD); } } + +void t11_device::bisb_rg_rg(uint16_t op) { m_icount -= 9+ 3; { BISB_R(RG,RG); } } +void t11_device::bisb_rg_rgd(uint16_t op) { m_icount -= 9+12; { BISB_M(RG,RGD); } } +void t11_device::bisb_rg_in(uint16_t op) { m_icount -= 9+12; { BISB_M(RG,IN); } } +void t11_device::bisb_rg_ind(uint16_t op) { m_icount -= 9+18; { BISB_M(RG,IND); } } +void t11_device::bisb_rg_de(uint16_t op) { m_icount -= 9+15; { BISB_M(RG,DE); } } +void t11_device::bisb_rg_ded(uint16_t op) { m_icount -= 9+21; { BISB_M(RG,DED); } } +void t11_device::bisb_rg_ix(uint16_t op) { m_icount -= 9+21; { BISB_M(RG,IX); } } +void t11_device::bisb_rg_ixd(uint16_t op) { m_icount -= 9+27; { BISB_M(RG,IXD); } } +void t11_device::bisb_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { BISB_X(RGD,RG); } } +void t11_device::bisb_rgd_rgd(uint16_t op) { m_icount -= 15+12; { BISB_M(RGD,RGD); } } +void t11_device::bisb_rgd_in(uint16_t op) { m_icount -= 15+12; { BISB_M(RGD,IN); } } +void t11_device::bisb_rgd_ind(uint16_t op) { m_icount -= 15+18; { BISB_M(RGD,IND); } } +void t11_device::bisb_rgd_de(uint16_t op) { m_icount -= 15+15; { BISB_M(RGD,DE); } } +void t11_device::bisb_rgd_ded(uint16_t op) { m_icount -= 15+21; { BISB_M(RGD,DED); } } +void t11_device::bisb_rgd_ix(uint16_t op) { m_icount -= 15+21; { BISB_M(RGD,IX); } } +void t11_device::bisb_rgd_ixd(uint16_t op) { m_icount -= 15+27; { BISB_M(RGD,IXD); } } +void t11_device::bisb_in_rg(uint16_t op) { m_icount -= 15+ 3; { BISB_X(IN,RG); } } +void t11_device::bisb_in_rgd(uint16_t op) { m_icount -= 15+12; { BISB_M(IN,RGD); } } +void t11_device::bisb_in_in(uint16_t op) { m_icount -= 15+12; { BISB_M(IN,IN); } } +void t11_device::bisb_in_ind(uint16_t op) { m_icount -= 15+18; { BISB_M(IN,IND); } } +void t11_device::bisb_in_de(uint16_t op) { m_icount -= 15+15; { BISB_M(IN,DE); } } +void t11_device::bisb_in_ded(uint16_t op) { m_icount -= 15+21; { BISB_M(IN,DED); } } +void t11_device::bisb_in_ix(uint16_t op) { m_icount -= 15+21; { BISB_M(IN,IX); } } +void t11_device::bisb_in_ixd(uint16_t op) { m_icount -= 15+27; { BISB_M(IN,IXD); } } +void t11_device::bisb_ind_rg(uint16_t op) { m_icount -= 21+ 3; { BISB_X(IND,RG); } } +void t11_device::bisb_ind_rgd(uint16_t op) { m_icount -= 21+12; { BISB_M(IND,RGD); } } +void t11_device::bisb_ind_in(uint16_t op) { m_icount -= 21+12; { BISB_M(IND,IN); } } +void t11_device::bisb_ind_ind(uint16_t op) { m_icount -= 21+18; { BISB_M(IND,IND); } } +void t11_device::bisb_ind_de(uint16_t op) { m_icount -= 21+15; { BISB_M(IND,DE); } } +void t11_device::bisb_ind_ded(uint16_t op) { m_icount -= 21+21; { BISB_M(IND,DED); } } +void t11_device::bisb_ind_ix(uint16_t op) { m_icount -= 21+21; { BISB_M(IND,IX); } } +void t11_device::bisb_ind_ixd(uint16_t op) { m_icount -= 21+27; { BISB_M(IND,IXD); } } +void t11_device::bisb_de_rg(uint16_t op) { m_icount -= 18+ 3; { BISB_X(DE,RG); } } +void t11_device::bisb_de_rgd(uint16_t op) { m_icount -= 18+12; { BISB_M(DE,RGD); } } +void t11_device::bisb_de_in(uint16_t op) { m_icount -= 18+12; { BISB_M(DE,IN); } } +void t11_device::bisb_de_ind(uint16_t op) { m_icount -= 18+18; { BISB_M(DE,IND); } } +void t11_device::bisb_de_de(uint16_t op) { m_icount -= 18+15; { BISB_M(DE,DE); } } +void t11_device::bisb_de_ded(uint16_t op) { m_icount -= 18+21; { BISB_M(DE,DED); } } +void t11_device::bisb_de_ix(uint16_t op) { m_icount -= 18+21; { BISB_M(DE,IX); } } +void t11_device::bisb_de_ixd(uint16_t op) { m_icount -= 18+27; { BISB_M(DE,IXD); } } +void t11_device::bisb_ded_rg(uint16_t op) { m_icount -= 24+ 3; { BISB_X(DED,RG); } } +void t11_device::bisb_ded_rgd(uint16_t op) { m_icount -= 24+12; { BISB_M(DED,RGD); } } +void t11_device::bisb_ded_in(uint16_t op) { m_icount -= 24+12; { BISB_M(DED,IN); } } +void t11_device::bisb_ded_ind(uint16_t op) { m_icount -= 24+18; { BISB_M(DED,IND); } } +void t11_device::bisb_ded_de(uint16_t op) { m_icount -= 24+15; { BISB_M(DED,DE); } } +void t11_device::bisb_ded_ded(uint16_t op) { m_icount -= 24+21; { BISB_M(DED,DED); } } +void t11_device::bisb_ded_ix(uint16_t op) { m_icount -= 24+21; { BISB_M(DED,IX); } } +void t11_device::bisb_ded_ixd(uint16_t op) { m_icount -= 24+27; { BISB_M(DED,IXD); } } +void t11_device::bisb_ix_rg(uint16_t op) { m_icount -= 24+ 3; { BISB_X(IX,RG); } } +void t11_device::bisb_ix_rgd(uint16_t op) { m_icount -= 24+12; { BISB_M(IX,RGD); } } +void t11_device::bisb_ix_in(uint16_t op) { m_icount -= 24+12; { BISB_M(IX,IN); } } +void t11_device::bisb_ix_ind(uint16_t op) { m_icount -= 24+18; { BISB_M(IX,IND); } } +void t11_device::bisb_ix_de(uint16_t op) { m_icount -= 24+15; { BISB_M(IX,DE); } } +void t11_device::bisb_ix_ded(uint16_t op) { m_icount -= 24+21; { BISB_M(IX,DED); } } +void t11_device::bisb_ix_ix(uint16_t op) { m_icount -= 24+21; { BISB_M(IX,IX); } } +void t11_device::bisb_ix_ixd(uint16_t op) { m_icount -= 24+27; { BISB_M(IX,IXD); } } +void t11_device::bisb_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { BISB_X(IXD,RG); } } +void t11_device::bisb_ixd_rgd(uint16_t op) { m_icount -= 30+12; { BISB_M(IXD,RGD); } } +void t11_device::bisb_ixd_in(uint16_t op) { m_icount -= 30+12; { BISB_M(IXD,IN); } } +void t11_device::bisb_ixd_ind(uint16_t op) { m_icount -= 30+18; { BISB_M(IXD,IND); } } +void t11_device::bisb_ixd_de(uint16_t op) { m_icount -= 30+15; { BISB_M(IXD,DE); } } +void t11_device::bisb_ixd_ded(uint16_t op) { m_icount -= 30+21; { BISB_M(IXD,DED); } } +void t11_device::bisb_ixd_ix(uint16_t op) { m_icount -= 30+21; { BISB_M(IXD,IX); } } +void t11_device::bisb_ixd_ixd(uint16_t op) { m_icount -= 30+27; { BISB_M(IXD,IXD); } } + +void t11_device::sub_rg_rg(uint16_t op) { m_icount -= 9+ 3; { SUB_R(RG,RG); } } +void t11_device::sub_rg_rgd(uint16_t op) { m_icount -= 9+12; { SUB_M(RG,RGD); } } +void t11_device::sub_rg_in(uint16_t op) { m_icount -= 9+12; { SUB_M(RG,IN); } } +void t11_device::sub_rg_ind(uint16_t op) { m_icount -= 9+18; { SUB_M(RG,IND); } } +void t11_device::sub_rg_de(uint16_t op) { m_icount -= 9+15; { SUB_M(RG,DE); } } +void t11_device::sub_rg_ded(uint16_t op) { m_icount -= 9+21; { SUB_M(RG,DED); } } +void t11_device::sub_rg_ix(uint16_t op) { m_icount -= 9+21; { SUB_M(RG,IX); } } +void t11_device::sub_rg_ixd(uint16_t op) { m_icount -= 9+27; { SUB_M(RG,IXD); } } +void t11_device::sub_rgd_rg(uint16_t op) { m_icount -= 15+ 3; { SUB_X(RGD,RG); } } +void t11_device::sub_rgd_rgd(uint16_t op) { m_icount -= 15+12; { SUB_M(RGD,RGD); } } +void t11_device::sub_rgd_in(uint16_t op) { m_icount -= 15+12; { SUB_M(RGD,IN); } } +void t11_device::sub_rgd_ind(uint16_t op) { m_icount -= 15+18; { SUB_M(RGD,IND); } } +void t11_device::sub_rgd_de(uint16_t op) { m_icount -= 15+15; { SUB_M(RGD,DE); } } +void t11_device::sub_rgd_ded(uint16_t op) { m_icount -= 15+21; { SUB_M(RGD,DED); } } +void t11_device::sub_rgd_ix(uint16_t op) { m_icount -= 15+21; { SUB_M(RGD,IX); } } +void t11_device::sub_rgd_ixd(uint16_t op) { m_icount -= 15+27; { SUB_M(RGD,IXD); } } +void t11_device::sub_in_rg(uint16_t op) { m_icount -= 15+ 3; { SUB_X(IN,RG); } } +void t11_device::sub_in_rgd(uint16_t op) { m_icount -= 15+12; { SUB_M(IN,RGD); } } +void t11_device::sub_in_in(uint16_t op) { m_icount -= 15+12; { SUB_M(IN,IN); } } +void t11_device::sub_in_ind(uint16_t op) { m_icount -= 15+18; { SUB_M(IN,IND); } } +void t11_device::sub_in_de(uint16_t op) { m_icount -= 15+15; { SUB_M(IN,DE); } } +void t11_device::sub_in_ded(uint16_t op) { m_icount -= 15+21; { SUB_M(IN,DED); } } +void t11_device::sub_in_ix(uint16_t op) { m_icount -= 15+21; { SUB_M(IN,IX); } } +void t11_device::sub_in_ixd(uint16_t op) { m_icount -= 15+27; { SUB_M(IN,IXD); } } +void t11_device::sub_ind_rg(uint16_t op) { m_icount -= 21+ 3; { SUB_X(IND,RG); } } +void t11_device::sub_ind_rgd(uint16_t op) { m_icount -= 21+12; { SUB_M(IND,RGD); } } +void t11_device::sub_ind_in(uint16_t op) { m_icount -= 21+12; { SUB_M(IND,IN); } } +void t11_device::sub_ind_ind(uint16_t op) { m_icount -= 21+18; { SUB_M(IND,IND); } } +void t11_device::sub_ind_de(uint16_t op) { m_icount -= 21+15; { SUB_M(IND,DE); } } +void t11_device::sub_ind_ded(uint16_t op) { m_icount -= 21+21; { SUB_M(IND,DED); } } +void t11_device::sub_ind_ix(uint16_t op) { m_icount -= 21+21; { SUB_M(IND,IX); } } +void t11_device::sub_ind_ixd(uint16_t op) { m_icount -= 21+27; { SUB_M(IND,IXD); } } +void t11_device::sub_de_rg(uint16_t op) { m_icount -= 18+ 3; { SUB_X(DE,RG); } } +void t11_device::sub_de_rgd(uint16_t op) { m_icount -= 18+12; { SUB_M(DE,RGD); } } +void t11_device::sub_de_in(uint16_t op) { m_icount -= 18+12; { SUB_M(DE,IN); } } +void t11_device::sub_de_ind(uint16_t op) { m_icount -= 18+18; { SUB_M(DE,IND); } } +void t11_device::sub_de_de(uint16_t op) { m_icount -= 18+15; { SUB_M(DE,DE); } } +void t11_device::sub_de_ded(uint16_t op) { m_icount -= 18+21; { SUB_M(DE,DED); } } +void t11_device::sub_de_ix(uint16_t op) { m_icount -= 18+21; { SUB_M(DE,IX); } } +void t11_device::sub_de_ixd(uint16_t op) { m_icount -= 18+27; { SUB_M(DE,IXD); } } +void t11_device::sub_ded_rg(uint16_t op) { m_icount -= 24+ 3; { SUB_X(DED,RG); } } +void t11_device::sub_ded_rgd(uint16_t op) { m_icount -= 24+12; { SUB_M(DED,RGD); } } +void t11_device::sub_ded_in(uint16_t op) { m_icount -= 24+12; { SUB_M(DED,IN); } } +void t11_device::sub_ded_ind(uint16_t op) { m_icount -= 24+18; { SUB_M(DED,IND); } } +void t11_device::sub_ded_de(uint16_t op) { m_icount -= 24+15; { SUB_M(DED,DE); } } +void t11_device::sub_ded_ded(uint16_t op) { m_icount -= 24+21; { SUB_M(DED,DED); } } +void t11_device::sub_ded_ix(uint16_t op) { m_icount -= 24+21; { SUB_M(DED,IX); } } +void t11_device::sub_ded_ixd(uint16_t op) { m_icount -= 24+27; { SUB_M(DED,IXD); } } +void t11_device::sub_ix_rg(uint16_t op) { m_icount -= 24+ 3; { SUB_X(IX,RG); } } +void t11_device::sub_ix_rgd(uint16_t op) { m_icount -= 24+12; { SUB_M(IX,RGD); } } +void t11_device::sub_ix_in(uint16_t op) { m_icount -= 24+12; { SUB_M(IX,IN); } } +void t11_device::sub_ix_ind(uint16_t op) { m_icount -= 24+18; { SUB_M(IX,IND); } } +void t11_device::sub_ix_de(uint16_t op) { m_icount -= 24+15; { SUB_M(IX,DE); } } +void t11_device::sub_ix_ded(uint16_t op) { m_icount -= 24+21; { SUB_M(IX,DED); } } +void t11_device::sub_ix_ix(uint16_t op) { m_icount -= 24+21; { SUB_M(IX,IX); } } +void t11_device::sub_ix_ixd(uint16_t op) { m_icount -= 24+27; { SUB_M(IX,IXD); } } +void t11_device::sub_ixd_rg(uint16_t op) { m_icount -= 30+ 3; { SUB_X(IXD,RG); } } +void t11_device::sub_ixd_rgd(uint16_t op) { m_icount -= 30+12; { SUB_M(IXD,RGD); } } +void t11_device::sub_ixd_in(uint16_t op) { m_icount -= 30+12; { SUB_M(IXD,IN); } } +void t11_device::sub_ixd_ind(uint16_t op) { m_icount -= 30+18; { SUB_M(IXD,IND); } } +void t11_device::sub_ixd_de(uint16_t op) { m_icount -= 30+15; { SUB_M(IXD,DE); } } +void t11_device::sub_ixd_ded(uint16_t op) { m_icount -= 30+21; { SUB_M(IXD,DED); } } +void t11_device::sub_ixd_ix(uint16_t op) { m_icount -= 30+21; { SUB_M(IXD,IX); } } +void t11_device::sub_ixd_ixd(uint16_t op) { m_icount -= 30+27; { SUB_M(IXD,IXD); } } diff --git a/src/devices/cpu/tlcs90/tlcs90.cpp b/src/devices/cpu/tlcs90/tlcs90.cpp index a347d93a632..820d5634126 100644 --- a/src/devices/cpu/tlcs90/tlcs90.cpp +++ b/src/devices/cpu/tlcs90/tlcs90.cpp @@ -53,7 +53,7 @@ static ADDRESS_MAP_START(tmp91641_mem, AS_PROGRAM, 8, tlcs90_device ) ADDRESS_MAP_END -tlcs90_device::tlcs90_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, address_map_constructor program_map) +tlcs90_device::tlcs90_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, address_map_constructor program_map) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0, program_map) , m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0) @@ -61,30 +61,30 @@ tlcs90_device::tlcs90_device(const machine_config &mconfig, device_type type, co } -tmp90840_device::tmp90840_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmp90840_device::tmp90840_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs90_device(mconfig, TMP90840, "TMP90840", tag, owner, clock, "tmp90840", __FILE__, ADDRESS_MAP_NAME(tmp90840_mem)) { } -tmp90841_device::tmp90841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmp90841_device::tmp90841_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs90_device(mconfig, TMP90841, "TMP90841", tag, owner, clock, "tmp90841", __FILE__, ADDRESS_MAP_NAME(tmp90841_mem)) { } -tmp90845_device::tmp90845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmp90845_device::tmp90845_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs90_device(mconfig, TMP90841, "TMP90845", tag, owner, clock, "tmp90845", __FILE__, ADDRESS_MAP_NAME(tmp90841_mem)) { } -tmp91640_device::tmp91640_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmp91640_device::tmp91640_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs90_device(mconfig, TMP91640, "TMP91640", tag, owner, clock, "tmp91640", __FILE__, ADDRESS_MAP_NAME(tmp91640_mem)) { } -tmp91641_device::tmp91641_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmp91641_device::tmp91641_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs90_device(mconfig, TMP91641, "TMP91641", tag, owner, clock, "tmp91641", __FILE__, ADDRESS_MAP_NAME(tmp91641_mem)) { } @@ -158,11 +158,11 @@ static const char *const r16_names[] = { "bc", "de", "hl", "??", #define ZF 0x40 #define SF 0x80 -static UINT8 SZ[256]; /* zero and sign flags */ -static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ -static UINT8 SZP[256]; /* zero, sign and parity flags */ -static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ -static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ +static uint8_t SZ[256]; /* zero and sign flags */ +static uint8_t SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ +static uint8_t SZP[256]; /* zero, sign and parity flags */ +static uint8_t SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ +static uint8_t SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ static const char *const cc_names[] = { "f", "lt", "le", "ule", "ov", "mi", "z", "c", "", "ge", "gt", "ugt", "nov", "pl", "nz", "nc" }; @@ -197,25 +197,25 @@ static const char *const cc_names[] = { "f", "lt", "le", "ule", "ov" #define R16D8( N,R,I ) m_mode##N = MODE_R16D8; m_r##N = R; m_r##N##b = I; #define R16R8( N,R,g ) m_mode##N = MODE_R16R8; m_r##N = R; m_r##N##b = g; -UINT8 tlcs90_device::RM8 (UINT32 a) { return m_program->read_byte( a ); } -UINT16 tlcs90_device::RM16(UINT32 a) { return RM8(a) | (RM8( (a+1) & 0xffff ) << 8); } +uint8_t tlcs90_device::RM8 (uint32_t a) { return m_program->read_byte( a ); } +uint16_t tlcs90_device::RM16(uint32_t a) { return RM8(a) | (RM8( (a+1) & 0xffff ) << 8); } -void tlcs90_device::WM8 (UINT32 a, UINT8 v) { m_program->write_byte( a, v ); } -void tlcs90_device::WM16(UINT32 a, UINT16 v) { WM8(a,v); WM8( (a+1) & 0xffff, v >> 8); } +void tlcs90_device::WM8 (uint32_t a, uint8_t v) { m_program->write_byte( a, v ); } +void tlcs90_device::WM16(uint32_t a, uint16_t v) { WM8(a,v); WM8( (a+1) & 0xffff, v >> 8); } -UINT8 tlcs90_device::RX8 (UINT32 a, UINT32 base) { return m_program->read_byte( base | a ); } -UINT16 tlcs90_device::RX16(UINT32 a, UINT32 base) { return RX8(a,base) | (RX8( (a+1) & 0xffff, base ) << 8); } +uint8_t tlcs90_device::RX8 (uint32_t a, uint32_t base) { return m_program->read_byte( base | a ); } +uint16_t tlcs90_device::RX16(uint32_t a, uint32_t base) { return RX8(a,base) | (RX8( (a+1) & 0xffff, base ) << 8); } -void tlcs90_device::WX8 (UINT32 a, UINT8 v, UINT32 base) { m_program->write_byte( base | a, v ); } -void tlcs90_device::WX16(UINT32 a, UINT16 v, UINT32 base) { WX8(a,v,base); WX8( (a+1) & 0xffff, v >> 8, base); } +void tlcs90_device::WX8 (uint32_t a, uint8_t v, uint32_t base) { m_program->write_byte( base | a, v ); } +void tlcs90_device::WX16(uint32_t a, uint16_t v, uint32_t base) { WX8(a,v,base); WX8( (a+1) & 0xffff, v >> 8, base); } -UINT8 tlcs90_device::READ8() { UINT8 b0 = RM8( m_addr++ ); m_addr &= 0xffff; return b0; } -UINT16 tlcs90_device::READ16() { UINT8 b0 = READ8(); return b0 | (READ8() << 8); } +uint8_t tlcs90_device::READ8() { uint8_t b0 = RM8( m_addr++ ); m_addr &= 0xffff; return b0; } +uint16_t tlcs90_device::READ16() { uint8_t b0 = READ8(); return b0 | (READ8() << 8); } void tlcs90_device::decode() { - UINT8 b0, b1, b2, b3; - UINT16 imm16; + uint8_t b0, b1, b2, b3; + uint16_t imm16; b0 = READ8(); @@ -984,14 +984,14 @@ static const char *const ir_names[] = { "DMAEH", "SCMOD", "SCCR", "SCBUF", "BX", "BY", "ADREG", "ADMOD" }; -const char *tlcs90_device::internal_registers_names(UINT16 x) +const char *tlcs90_device::internal_registers_names(uint16_t x) { int ir = x - T90_IOBASE; if ( ir >= 0 && ir < ARRAY_LENGTH(ir_names) ) return ir_names[ir]; return nullptr; } -int tlcs90_device::sprint_arg(char *buffer, UINT32 pc, const char *pre, const e_mode mode, const UINT16 r, const UINT16 rb) +int tlcs90_device::sprint_arg(char *buffer, uint32_t pc, const char *pre, const e_mode mode, const uint16_t r, const uint16_t rb) { const char *reg_name; switch ( mode ) @@ -1027,7 +1027,7 @@ int tlcs90_device::sprint_arg(char *buffer, UINT32 pc, const char *pre, const e_ //return 0; } -offs_t tlcs90_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tlcs90_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { int len; @@ -1045,7 +1045,7 @@ offs_t tlcs90_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o } -UINT16 tlcs90_device::r8( const UINT16 r ) +uint16_t tlcs90_device::r8( const uint16_t r ) { switch( r ) { @@ -1062,7 +1062,7 @@ UINT16 tlcs90_device::r8( const UINT16 r ) } } -void tlcs90_device::w8( const UINT16 r, UINT16 value ) +void tlcs90_device::w8( const uint16_t r, uint16_t value ) { switch( r ) { @@ -1079,7 +1079,7 @@ void tlcs90_device::w8( const UINT16 r, UINT16 value ) } } -UINT16 tlcs90_device::r16( const UINT16 r ) +uint16_t tlcs90_device::r16( const uint16_t r ) { switch( r ) { @@ -1100,7 +1100,7 @@ UINT16 tlcs90_device::r16( const UINT16 r ) } } -void tlcs90_device::w16( const UINT16 r, UINT16 value ) +void tlcs90_device::w16( const uint16_t r, uint16_t value ) { switch( r ) { @@ -1121,15 +1121,15 @@ void tlcs90_device::w16( const UINT16 r, UINT16 value ) #define READ_FN( N ) \ -UINT8 tlcs90_device::Read##N##_8() { \ +uint8_t tlcs90_device::Read##N##_8() { \ switch ( m_mode##N ) { \ case MODE_CC: \ case MODE_BIT8: \ - case MODE_I8: return (UINT8)m_r##N; \ - case MODE_D8: return (UINT8)m_r##N; \ - case MODE_R8: return (UINT8)r8(m_r##N); \ + case MODE_I8: return (uint8_t)m_r##N; \ + case MODE_D8: return (uint8_t)m_r##N; \ + case MODE_R8: return (uint8_t)r8(m_r##N); \ case MODE_MI16: return RM8(m_r##N); \ - case MODE_MR16R8: return RM8((UINT16)(r16(m_r##N) + (INT8)r8(m_r##N##b))); \ + case MODE_MR16R8: return RM8((uint16_t)(r16(m_r##N) + (int8_t)r8(m_r##N##b))); \ case MODE_MR16: \ switch( m_r##N ) { \ case IX: return RX8(m_ix.w.l,m_ixbase); \ @@ -1138,24 +1138,24 @@ UINT8 tlcs90_device::Read##N##_8() { \ return RM8(r16(m_r##N)); \ case MODE_MR16D8: \ switch( m_r##N ) { \ - case IX: return RX8((UINT16)(m_ix.w.l + (INT8)m_r##N##b),m_ixbase); \ - case IY: return RX8((UINT16)(m_iy.w.l + (INT8)m_r##N##b),m_iybase); \ + case IX: return RX8((uint16_t)(m_ix.w.l + (int8_t)m_r##N##b),m_ixbase); \ + case IY: return RX8((uint16_t)(m_iy.w.l + (int8_t)m_r##N##b),m_iybase); \ } \ - return RM8((UINT16)(r16(m_r##N) + (INT8)m_r##N##b)); \ + return RM8((uint16_t)(r16(m_r##N) + (int8_t)m_r##N##b)); \ default: \ fatalerror("%04x: unimplemented Read%d_8 mode = %d\n",m_pc.w.l,N,m_mode##N); \ } \ return 0; \ } \ -UINT16 tlcs90_device::Read##N##_16() { \ +uint16_t tlcs90_device::Read##N##_16() { \ switch ( m_mode##N ) { \ case MODE_I16: return m_r##N; \ case MODE_D16: return m_r##N - 1; \ case MODE_R16: return r16(m_r##N); \ - case MODE_R16D8: return r16(m_r##N) + (INT8)m_r##N##b; \ - case MODE_R16R8: return r16(m_r##N) + (INT8)r8(m_r##N##b); \ + case MODE_R16D8: return r16(m_r##N) + (int8_t)m_r##N##b; \ + case MODE_R16R8: return r16(m_r##N) + (int8_t)r8(m_r##N##b); \ case MODE_MI16: return RM16(m_r##N); \ - case MODE_MR16R8: return RM16((UINT16)(r16(m_r##N) + (INT8)r8(m_r##N##b))); \ + case MODE_MR16R8: return RM16((uint16_t)(r16(m_r##N) + (int8_t)r8(m_r##N##b))); \ case MODE_MR16: \ switch( m_r##N ) { \ case IX: return RX16(m_ix.w.l,m_ixbase); \ @@ -1164,10 +1164,10 @@ UINT16 tlcs90_device::Read##N##_16() { \ return RM16(r16(m_r##N)); \ case MODE_MR16D8: \ switch( m_r##N ) { \ - case IX: return RX16((UINT16)(m_ix.w.l + (INT8)m_r##N##b),m_ixbase); \ - case IY: return RX16((UINT16)(m_iy.w.l + (INT8)m_r##N##b),m_iybase); \ + case IX: return RX16((uint16_t)(m_ix.w.l + (int8_t)m_r##N##b),m_ixbase); \ + case IY: return RX16((uint16_t)(m_iy.w.l + (int8_t)m_r##N##b),m_iybase); \ } \ - return RM16((UINT16)(r16(m_r##N) + (INT8)m_r##N##b)); \ + return RM16((uint16_t)(r16(m_r##N) + (int8_t)m_r##N##b)); \ default: \ fatalerror("%04x: unimplemented Read%d_16 modes = %d\n",m_pc.w.l,N,m_mode##N); \ } \ @@ -1177,11 +1177,11 @@ UINT16 tlcs90_device::Read##N##_16() { \ #define WRITE_FN( N ) \ -void tlcs90_device::Write##N##_8( UINT8 value ) { \ +void tlcs90_device::Write##N##_8( uint8_t value ) { \ switch ( m_mode##N ) { \ case MODE_R8: w8(m_r##N,value); return; \ case MODE_MI16: WM8(m_r##N, value); return; \ - case MODE_MR16R8: WM8((UINT16)(r16(m_r##N) + (INT8)r8(m_r##N##b)), value); return; \ + case MODE_MR16R8: WM8((uint16_t)(r16(m_r##N) + (int8_t)r8(m_r##N##b)), value); return; \ case MODE_MR16: \ switch( m_r##N ) { \ case IX: WX8(m_ix.w.l,value,m_ixbase); return; \ @@ -1190,20 +1190,20 @@ void tlcs90_device::Write##N##_8( UINT8 value ) { \ WM8(r16(m_r##N), value); return; \ case MODE_MR16D8: \ switch( m_r##N ) { \ - case IX: WX8((UINT16)(m_ix.w.l + (INT8)m_r##N##b),value,m_ixbase); return; \ - case IY: WX8((UINT16)(m_iy.w.l + (INT8)m_r##N##b),value,m_iybase); return; \ + case IX: WX8((uint16_t)(m_ix.w.l + (int8_t)m_r##N##b),value,m_ixbase); return; \ + case IY: WX8((uint16_t)(m_iy.w.l + (int8_t)m_r##N##b),value,m_iybase); return; \ } \ - WM8((UINT16)(r16(m_r##N) + (INT8)m_r##N##b), value); return; \ + WM8((uint16_t)(r16(m_r##N) + (int8_t)m_r##N##b), value); return; \ default: \ fatalerror("%04x: unimplemented Write%d_8 mode = %d\n",m_pc.w.l,N,m_mode##N); \ } \ } \ -void tlcs90_device::Write##N##_16( UINT16 value ) \ +void tlcs90_device::Write##N##_16( uint16_t value ) \ { \ switch ( m_mode##N ) { \ case MODE_R16: w16(m_r##N,value); return; \ case MODE_MI16: WM16(m_r##N, value); return; \ - case MODE_MR16R8: WM16((UINT16)(r16(m_r##N) + (INT8)r8(m_r##N##b)), value); return; \ + case MODE_MR16R8: WM16((uint16_t)(r16(m_r##N) + (int8_t)r8(m_r##N##b)), value); return; \ case MODE_MR16: \ switch( m_r##N ) { \ case IX: WX16(m_ix.w.l,value,m_ixbase); return; \ @@ -1212,10 +1212,10 @@ void tlcs90_device::Write##N##_16( UINT16 value ) \ WM16(r16(m_r##N), value); return; \ case MODE_MR16D8: \ switch( m_r##N ) { \ - case IX: WX16((UINT16)(m_ix.w.l + (INT8)m_r##N##b),value,m_ixbase); return; \ - case IY: WX16((UINT16)(m_iy.w.l + (INT8)m_r##N##b),value,m_iybase); return; \ + case IX: WX16((uint16_t)(m_ix.w.l + (int8_t)m_r##N##b),value,m_ixbase); return; \ + case IY: WX16((uint16_t)(m_iy.w.l + (int8_t)m_r##N##b),value,m_iybase); return; \ } \ - WM16((UINT16)(r16(m_r##N) + (INT8)m_r##N##b), value); return; \ + WM16((uint16_t)(r16(m_r##N) + (int8_t)m_r##N##b), value); return; \ default: \ fatalerror("%04x: unimplemented Write%d_16 mode = %d\n",m_pc.w.l,N,m_mode##N); \ } \ @@ -1226,7 +1226,7 @@ READ_FN(2) WRITE_FN(1) WRITE_FN(2) -int tlcs90_device::Test( UINT8 cond ) +int tlcs90_device::Test( uint8_t cond ) { int s,v; switch ( cond ) @@ -1255,12 +1255,12 @@ int tlcs90_device::Test( UINT8 cond ) //return 0; } -void tlcs90_device::Push( UINT16 rr ) +void tlcs90_device::Push( uint16_t rr ) { m_sp.w.l -= 2; WM16( m_sp.w.l, r16(rr) ); } -void tlcs90_device::Pop( UINT16 rr ) +void tlcs90_device::Pop( uint16_t rr ) { w16( rr, RM16( m_sp.w.l ) ); m_sp.w.l += 2; @@ -1384,8 +1384,8 @@ void tlcs90_device::Cyc_f() { m_icount -= m_cyc_f; } void tlcs90_device::execute_run() { - UINT8 a8,b8; - UINT16 a16,b16; + uint8_t a8,b8; + uint16_t a16,b16; unsigned a32; PAIR tmp; @@ -1531,7 +1531,7 @@ void tlcs90_device::execute_run() case JR: if ( Test( Read1_8() ) ) { - m_pc.w.l += /*2 +*/ (INT8)Read2_8(); + m_pc.w.l += /*2 +*/ (int8_t)Read2_8(); Cyc(); } else Cyc_f(); @@ -1595,7 +1595,7 @@ void tlcs90_device::execute_run() case DAA: { - UINT8 cf, nf, hf, lo, hi, diff; + uint8_t cf, nf, hf, lo, hi, diff; cf = F & CF; nf = F & NF; hf = F & HF; @@ -1644,7 +1644,7 @@ void tlcs90_device::execute_run() a8 = 0; b8 = m_af.b.h; a32 = a8 - b8; - F = (F & IF) | SZ[(UINT8)a32] | NF; + F = (F & IF) | SZ[(uint8_t)a32] | NF; if (a32 & 0x100) F |= CF | XCF; //X? if ((a8 ^ a32 ^ b8) & 0x10) F |= HF; if ((b8 ^ a8) & (a8 ^ a32) & 0x80) F |= VF; @@ -1716,7 +1716,7 @@ void tlcs90_device::execute_run() a32 = a16 + 1; Write1_16( a32 ); F &= IF | CF; - if ((UINT16)a32 == 0) F |= ZF | XCF; + if ((uint16_t)a32 == 0) F |= ZF | XCF; if (a32 & 0x8000) F |= SF; if ((a16 ^ 0x8000) & a32 & 0x8000) F |= VF; if ((a16 ^ a32 ^ 1) & 0x1000) F |= HF; //?? @@ -1754,7 +1754,7 @@ void tlcs90_device::execute_run() a32 = a16 - 1; Write1_16( a32 ); F = (F & (IF | CF)) | NF; - if ((UINT16)a32 == 0) F |= ZF | XCF; + if ((uint16_t)a32 == 0) F |= ZF | XCF; if (a32 & 0x8000) F |= SF; if (a16 == 0x8000) F |= VF; if ((a16 ^ a32 ^ 1) & 0x1000) F |= HF; //?? @@ -1768,7 +1768,7 @@ void tlcs90_device::execute_run() a32 = a8 + b8; if ( (m_op == ADC) && (F & CF) ) a32 += 1; Write1_8( a32 ); - F = (F & IF) | SZ[(UINT8)a32]; + F = (F & IF) | SZ[(uint8_t)a32]; if (a32 & 0x100) F |= CF | XCF; //X? if ((a8 ^ a32 ^ b8) & 0x10) F |= HF; if ((b8 ^ a8 ^ 0x80) & (b8 ^ a32) & 0x80) F |= VF; @@ -1788,7 +1788,7 @@ void tlcs90_device::execute_run() else { F &= IF; - if ((UINT16)a32 == 0) F |= ZF; + if ((uint16_t)a32 == 0) F |= ZF; if (a32 & 0x8000) F |= SF; if ((b16 ^ a16 ^ 0x8000) & (b16 ^ a32) & 0x8000) F |= VF; } @@ -1804,7 +1804,7 @@ void tlcs90_device::execute_run() b8 = Read2_8(); a32 = a8 - b8; if ( (m_op == SBC) && (F & CF) ) a32 -= 1; - F = (F & IF) | SZ[(UINT8)a32] | NF; + F = (F & IF) | SZ[(uint8_t)a32] | NF; if (a32 & 0x100) F |= CF | XCF; //X? if ((a8 ^ a32 ^ b8) & 0x10) F |= HF; if ((b8 ^ a8) & (a8 ^ a32) & 0x80) F |= VF; @@ -1820,7 +1820,7 @@ void tlcs90_device::execute_run() a32 = a16 - b16; if ( (m_op == (SBC | OP_16)) && (F & CF) ) a32 -= 1; F = (F & IF) | NF; - if ((UINT16)a32 == 0) F |= ZF; + if ((uint16_t)a32 == 0) F |= ZF; if (a32 & 0x8000) F |= SF; if (a32 & 0x10000) F |= CF | XCF; //X? if ((a16 ^ a32 ^ b16) & 0x1000) F |= HF; //?? @@ -1967,7 +1967,7 @@ void tlcs90_device::execute_run() case DJNZ: if ( --m_bc.b.h ) { - m_pc.w.l += /*2 +*/ (INT8)Read1_8(); + m_pc.w.l += /*2 +*/ (int8_t)Read1_8(); Cyc(); } else Cyc_f(); @@ -1975,19 +1975,19 @@ void tlcs90_device::execute_run() case DJNZ | OP_16: if ( --m_bc.w.l ) { - m_pc.w.l += /*2 +*/ (INT8)Read2_8(); + m_pc.w.l += /*2 +*/ (int8_t)Read2_8(); Cyc(); } else Cyc_f(); break; case MUL: - m_hl.w.l = (UINT16)m_hl.b.l * (UINT16)Read2_8(); + m_hl.w.l = (uint16_t)m_hl.b.l * (uint16_t)Read2_8(); Cyc(); break; case DIV: a16 = m_hl.w.l; - b16 = (UINT16)Read2_8(); + b16 = (uint16_t)Read2_8(); if (b16 == 0) { F |= VF; @@ -2037,7 +2037,7 @@ void tlcs90_device::device_reset() memset(m_internal_registers, 0, sizeof(m_internal_registers)); } -void tlcs90_device::execute_burn(INT32 cycles) +void tlcs90_device::execute_burn(int32_t cycles) { m_icount -= 4 * ((cycles + 3) / 4); } @@ -2318,7 +2318,7 @@ READ8_MEMBER( tlcs90_device::t90_internal_registers_r ) { #define RIO m_io->read_byte( T90_IOBASE+offset ) - UINT8 data = m_internal_registers[offset]; + uint8_t data = m_internal_registers[offset]; switch ( T90_IOBASE + offset ) { case T90_P3: // 7,4,1,0 @@ -2512,14 +2512,14 @@ WRITE8_MEMBER( tlcs90_device::t90_internal_registers_w ) { #define WIO m_io->write_byte( T90_IOBASE+offset, data ) - UINT8 out_mask; - UINT8 old = m_internal_registers[offset]; + uint8_t out_mask; + uint8_t old = m_internal_registers[offset]; switch ( T90_IOBASE + offset ) { case T90_TRUN: { int i; - UINT8 mask; + uint8_t mask; // Timers 0-3 for (i = 0; i < 4; i++) { diff --git a/src/devices/cpu/tlcs90/tlcs90.h b/src/devices/cpu/tlcs90/tlcs90.h index 68f853994e9..3d622a74e32 100644 --- a/src/devices/cpu/tlcs90/tlcs90.h +++ b/src/devices/cpu/tlcs90/tlcs90.h @@ -25,7 +25,7 @@ class tlcs90_device : public cpu_device { public: // construction/destruction - tlcs90_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, address_map_constructor program_map); + tlcs90_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, address_map_constructor program_map); DECLARE_READ8_MEMBER( t90_internal_registers_r ); DECLARE_WRITE8_MEMBER( t90_internal_registers_w ); @@ -41,13 +41,13 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 2; } - virtual UINT32 execute_max_cycles() const override { return 26; } - virtual UINT32 execute_input_lines() const override { return 1; } - virtual UINT32 execute_default_irq_vector() const override { return 0xff; } + virtual uint32_t execute_min_cycles() const override { return 2; } + virtual uint32_t execute_max_cycles() const override { return 26; } + virtual uint32_t execute_input_lines() const override { return 1; } + virtual uint32_t execute_default_irq_vector() const override { return 0xff; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - virtual void execute_burn(INT32 cycles) override; + virtual void execute_burn(int32_t cycles) override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : nullptr ); } @@ -56,9 +56,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 6; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 6; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: enum e_mode { @@ -74,62 +74,62 @@ private: PAIR m_prvpc,m_pc,m_sp,m_af,m_bc,m_de,m_hl,m_ix,m_iy; PAIR m_af2,m_bc2,m_de2,m_hl2; - UINT8 m_halt, m_after_EI; - UINT16 m_irq_state, m_irq_mask; + uint8_t m_halt, m_after_EI; + uint16_t m_irq_state, m_irq_mask; address_space *m_program; address_space *m_io; int m_icount; int m_extra_cycles; // extra cycles for interrupts - UINT8 m_internal_registers[48]; - UINT32 m_ixbase,m_iybase; + uint8_t m_internal_registers[48]; + uint32_t m_ixbase,m_iybase; // Timers: 4 x 8-bit + 1 x 16-bit emu_timer *m_timer[4+1]; - UINT8 m_timer_value[4]; - UINT16 m_timer4_value; + uint8_t m_timer_value[4]; + uint16_t m_timer4_value; attotime m_timer_period; // Work registers - UINT8 m_op; + uint8_t m_op; e_mode m_mode1; - UINT16 m_r1,m_r1b; + uint16_t m_r1,m_r1b; e_mode m_mode2; - UINT16 m_r2,m_r2b; + uint16_t m_r2,m_r2b; int m_cyc_t,m_cyc_f; - UINT32 m_addr; - - inline UINT8 RM8 (UINT32 a); - inline UINT16 RM16(UINT32 a); - inline void WM8 (UINT32 a, UINT8 v); - inline void WM16(UINT32 a, UINT16 v); - inline UINT8 RX8 (UINT32 a, UINT32 base); - inline UINT16 RX16(UINT32 a, UINT32 base); - inline void WX8 (UINT32 a, UINT8 v, UINT32 base); - inline void WX16(UINT32 a, UINT16 v, UINT32 base); - inline UINT8 READ8(); - inline UINT16 READ16(); + uint32_t m_addr; + + inline uint8_t RM8 (uint32_t a); + inline uint16_t RM16(uint32_t a); + inline void WM8 (uint32_t a, uint8_t v); + inline void WM16(uint32_t a, uint16_t v); + inline uint8_t RX8 (uint32_t a, uint32_t base); + inline uint16_t RX16(uint32_t a, uint32_t base); + inline void WX8 (uint32_t a, uint8_t v, uint32_t base); + inline void WX16(uint32_t a, uint16_t v, uint32_t base); + inline uint8_t READ8(); + inline uint16_t READ16(); void decode(); - const char *internal_registers_names(UINT16 x); - int sprint_arg(char *buffer, UINT32 pc, const char *pre, const e_mode mode, const UINT16 r, const UINT16 rb); - inline UINT16 r8( const UINT16 r ); - inline void w8( const UINT16 r, UINT16 value ); - inline UINT16 r16( const UINT16 r ); - inline void w16( const UINT16 r, UINT16 value ); - inline UINT8 Read1_8(); - inline UINT16 Read1_16(); - inline UINT8 Read2_8(); - inline UINT16 Read2_16(); - inline void Write1_8( UINT8 value ); - inline void Write1_16( UINT16 value ); - inline void Write2_8( UINT8 value ); - inline void Write2_16( UINT16 value ); - inline int Test( UINT8 cond ); - inline void Push( UINT16 rr ); - inline void Pop( UINT16 rr ); + const char *internal_registers_names(uint16_t x); + int sprint_arg(char *buffer, uint32_t pc, const char *pre, const e_mode mode, const uint16_t r, const uint16_t rb); + inline uint16_t r8( const uint16_t r ); + inline void w8( const uint16_t r, uint16_t value ); + inline uint16_t r16( const uint16_t r ); + inline void w16( const uint16_t r, uint16_t value ); + inline uint8_t Read1_8(); + inline uint16_t Read1_16(); + inline uint8_t Read2_8(); + inline uint16_t Read2_16(); + inline void Write1_8( uint8_t value ); + inline void Write1_16( uint16_t value ); + inline void Write2_8( uint8_t value ); + inline void Write2_16( uint16_t value ); + inline int Test( uint8_t cond ); + inline void Push( uint16_t rr ); + inline void Pop( uint16_t rr ); inline void leave_halt(); void take_interrupt(tlcs90_e_irq irq); void check_interrupts(); @@ -147,7 +147,7 @@ class tmp90840_device : public tlcs90_device { public: // construction/destruction - tmp90840_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmp90840_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -155,7 +155,7 @@ class tmp90841_device : public tlcs90_device { public: // construction/destruction - tmp90841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmp90841_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -163,14 +163,14 @@ class tmp90845_device : public tlcs90_device { public: // construction/destruction - tmp90845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmp90845_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tmp91640_device : public tlcs90_device { public: // construction/destruction - tmp91640_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmp91640_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -178,7 +178,7 @@ class tmp91641_device : public tlcs90_device { public: // construction/destruction - tmp91641_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmp91641_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/tlcs900/900tbl.hxx b/src/devices/cpu/tlcs900/900tbl.hxx index 551e27770c4..38fe13abb4f 100644 --- a/src/devices/cpu/tlcs900/900tbl.hxx +++ b/src/devices/cpu/tlcs900/900tbl.hxx @@ -34,7 +34,7 @@ enum e_operand }; -int tlcs900h_device::condition_true( UINT8 cond ) +int tlcs900h_device::condition_true( uint8_t cond ) { switch ( cond & 0x0f ) { @@ -112,7 +112,7 @@ int tlcs900h_device::condition_true( UINT8 cond ) } -UINT8* tlcs900h_device::get_reg8_current( UINT8 reg ) +uint8_t* tlcs900h_device::get_reg8_current( uint8_t reg ) { switch( reg & 7 ) { @@ -153,7 +153,7 @@ UINT8* tlcs900h_device::get_reg8_current( UINT8 reg ) } -UINT16* tlcs900h_device::get_reg16_current( UINT8 reg ) +uint16_t* tlcs900h_device::get_reg16_current( uint8_t reg ) { switch( reg & 7 ) { @@ -195,7 +195,7 @@ UINT16* tlcs900h_device::get_reg16_current( UINT8 reg ) } -UINT32* tlcs900h_device::get_reg32_current( UINT8 reg ) +uint32_t* tlcs900h_device::get_reg32_current( uint8_t reg ) { switch( reg & 7 ) { @@ -237,9 +237,9 @@ UINT32* tlcs900h_device::get_reg32_current( UINT8 reg ) } -PAIR* tlcs900h_device::get_reg( UINT8 reg ) +PAIR* tlcs900h_device::get_reg( uint8_t reg ) { - UINT8 regbank; + uint8_t regbank; switch( reg & 0xf0 ) { @@ -279,7 +279,7 @@ PAIR* tlcs900h_device::get_reg( UINT8 reg ) } -UINT8* tlcs900h_device::get_reg8( UINT8 reg ) +uint8_t* tlcs900h_device::get_reg8( uint8_t reg ) { PAIR *r = get_reg( reg ); @@ -295,7 +295,7 @@ UINT8* tlcs900h_device::get_reg8( UINT8 reg ) } -UINT16* tlcs900h_device::get_reg16( UINT8 reg ) +uint16_t* tlcs900h_device::get_reg16( uint8_t reg ) { PAIR *r = get_reg( reg ); @@ -303,7 +303,7 @@ UINT16* tlcs900h_device::get_reg16( UINT8 reg ) } -UINT32* tlcs900h_device::get_reg32( UINT8 reg ) +uint32_t* tlcs900h_device::get_reg32( uint8_t reg ) { PAIR *r = get_reg( reg ); @@ -312,7 +312,7 @@ UINT32* tlcs900h_device::get_reg32( UINT8 reg ) -void tlcs900h_device::parity8( UINT8 a ) +void tlcs900h_device::parity8( uint8_t a ) { int i, j; @@ -326,7 +326,7 @@ void tlcs900h_device::parity8( UINT8 a ) } -void tlcs900h_device::parity16( UINT16 a ) +void tlcs900h_device::parity16( uint16_t a ) { int i, j; @@ -340,7 +340,7 @@ void tlcs900h_device::parity16( UINT16 a ) } -void tlcs900h_device::parity32( UINT32 a ) +void tlcs900h_device::parity32( uint32_t a ) { int i, j; @@ -354,10 +354,10 @@ void tlcs900h_device::parity32( UINT32 a ) } -UINT8 tlcs900h_device::adc8( UINT8 a, UINT8 b) +uint8_t tlcs900h_device::adc8( uint8_t a, uint8_t b) { - UINT8 cy = m_sr.b.l & FLAG_CF; - UINT8 result = a + b + cy; + uint8_t cy = m_sr.b.l & FLAG_CF; + uint8_t result = a + b + cy; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( result & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -369,10 +369,10 @@ UINT8 tlcs900h_device::adc8( UINT8 a, UINT8 b) } -UINT16 tlcs900h_device::adc16( UINT16 a, UINT16 b) +uint16_t tlcs900h_device::adc16( uint16_t a, uint16_t b) { - UINT8 cy = m_sr.b.l & FLAG_CF; - UINT16 result = a + b + cy; + uint8_t cy = m_sr.b.l & FLAG_CF; + uint16_t result = a + b + cy; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 8 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -384,10 +384,10 @@ UINT16 tlcs900h_device::adc16( UINT16 a, UINT16 b) } -UINT32 tlcs900h_device::adc32( UINT32 a, UINT32 b) +uint32_t tlcs900h_device::adc32( uint32_t a, uint32_t b) { - UINT8 cy = m_sr.b.l & FLAG_CF; - UINT32 result = a + b + cy; + uint8_t cy = m_sr.b.l & FLAG_CF; + uint32_t result = a + b + cy; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 24 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -398,9 +398,9 @@ UINT32 tlcs900h_device::adc32( UINT32 a, UINT32 b) } -UINT8 tlcs900h_device::add8( UINT8 a, UINT8 b) +uint8_t tlcs900h_device::add8( uint8_t a, uint8_t b) { - UINT8 result = a + b; + uint8_t result = a + b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( result & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -412,9 +412,9 @@ UINT8 tlcs900h_device::add8( UINT8 a, UINT8 b) } -UINT16 tlcs900h_device::add16( UINT16 a, UINT16 b) +uint16_t tlcs900h_device::add16( uint16_t a, uint16_t b) { - UINT16 result = a + b; + uint16_t result = a + b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 8 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -426,9 +426,9 @@ UINT16 tlcs900h_device::add16( UINT16 a, UINT16 b) } -UINT32 tlcs900h_device::add32( UINT32 a, UINT32 b) +uint32_t tlcs900h_device::add32( uint32_t a, uint32_t b) { - UINT32 result = a + b; + uint32_t result = a + b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 24 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -439,10 +439,10 @@ UINT32 tlcs900h_device::add32( UINT32 a, UINT32 b) } -UINT8 tlcs900h_device::sbc8( UINT8 a, UINT8 b) +uint8_t tlcs900h_device::sbc8( uint8_t a, uint8_t b) { - UINT8 cy = m_sr.b.l & FLAG_CF; - UINT8 result = a - b - cy; + uint8_t cy = m_sr.b.l & FLAG_CF; + uint8_t result = a - b - cy; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_CF); m_sr.b.l |= ( result & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -454,10 +454,10 @@ UINT8 tlcs900h_device::sbc8( UINT8 a, UINT8 b) } -UINT16 tlcs900h_device::sbc16( UINT16 a, UINT16 b) +uint16_t tlcs900h_device::sbc16( uint16_t a, uint16_t b) { - UINT8 cy = m_sr.b.l & FLAG_CF; - UINT16 result = a - b - cy; + uint8_t cy = m_sr.b.l & FLAG_CF; + uint16_t result = a - b - cy; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_CF); m_sr.b.l |= ( ( result >> 8 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -469,10 +469,10 @@ UINT16 tlcs900h_device::sbc16( UINT16 a, UINT16 b) } -UINT32 tlcs900h_device::sbc32( UINT32 a, UINT32 b) +uint32_t tlcs900h_device::sbc32( uint32_t a, uint32_t b) { - UINT8 cy = m_sr.b.l & FLAG_CF; - UINT32 result = a - b - cy; + uint8_t cy = m_sr.b.l & FLAG_CF; + uint32_t result = a - b - cy; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_CF); m_sr.b.l |= ( ( result >> 24 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -483,9 +483,9 @@ UINT32 tlcs900h_device::sbc32( UINT32 a, UINT32 b) } -UINT8 tlcs900h_device::sub8( UINT8 a, UINT8 b) +uint8_t tlcs900h_device::sub8( uint8_t a, uint8_t b) { - UINT8 result = a - b; + uint8_t result = a - b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_CF); m_sr.b.l |= ( result & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -497,9 +497,9 @@ UINT8 tlcs900h_device::sub8( UINT8 a, UINT8 b) } -UINT16 tlcs900h_device::sub16( UINT16 a, UINT16 b) +uint16_t tlcs900h_device::sub16( uint16_t a, uint16_t b) { - UINT16 result = a - b; + uint16_t result = a - b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_CF); m_sr.b.l |= ( ( result >> 8 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -511,9 +511,9 @@ UINT16 tlcs900h_device::sub16( UINT16 a, UINT16 b) } -UINT32 tlcs900h_device::sub32( UINT32 a, UINT32 b) +uint32_t tlcs900h_device::sub32( uint32_t a, uint32_t b) { - UINT32 result = a - b; + uint32_t result = a - b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_CF); m_sr.b.l |= ( ( result >> 24 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | @@ -524,9 +524,9 @@ UINT32 tlcs900h_device::sub32( UINT32 a, UINT32 b) } -UINT8 tlcs900h_device::and8( UINT8 a, UINT8 b) +uint8_t tlcs900h_device::and8( uint8_t a, uint8_t b) { - UINT8 result = a & b; + uint8_t result = a & b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( result & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | FLAG_HF; @@ -537,9 +537,9 @@ UINT8 tlcs900h_device::and8( UINT8 a, UINT8 b) } -UINT16 tlcs900h_device::and16( UINT16 a, UINT16 b) +uint16_t tlcs900h_device::and16( uint16_t a, uint16_t b) { - UINT16 result = a & b; + uint16_t result = a & b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 8 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | FLAG_HF; @@ -550,9 +550,9 @@ UINT16 tlcs900h_device::and16( UINT16 a, UINT16 b) } -UINT32 tlcs900h_device::and32( UINT32 a, UINT32 b) +uint32_t tlcs900h_device::and32( uint32_t a, uint32_t b) { - UINT32 result = a & b; + uint32_t result = a & b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 24 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ) | FLAG_HF; @@ -561,9 +561,9 @@ UINT32 tlcs900h_device::and32( UINT32 a, UINT32 b) } -UINT8 tlcs900h_device::or8( UINT8 a, UINT8 b) +uint8_t tlcs900h_device::or8( uint8_t a, uint8_t b) { - UINT8 result = a | b; + uint8_t result = a | b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( result & FLAG_SF ) | ( result ? 0 : FLAG_ZF ); @@ -574,9 +574,9 @@ UINT8 tlcs900h_device::or8( UINT8 a, UINT8 b) } -UINT16 tlcs900h_device::or16( UINT16 a, UINT16 b) +uint16_t tlcs900h_device::or16( uint16_t a, uint16_t b) { - UINT16 result = a | b; + uint16_t result = a | b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 8 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ); @@ -587,9 +587,9 @@ UINT16 tlcs900h_device::or16( UINT16 a, UINT16 b) } -UINT32 tlcs900h_device::or32( UINT32 a, UINT32 b) +uint32_t tlcs900h_device::or32( uint32_t a, uint32_t b) { - UINT32 result = a | b; + uint32_t result = a | b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 24 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ); @@ -598,9 +598,9 @@ UINT32 tlcs900h_device::or32( UINT32 a, UINT32 b) } -UINT8 tlcs900h_device::xor8( UINT8 a, UINT8 b) +uint8_t tlcs900h_device::xor8( uint8_t a, uint8_t b) { - UINT8 result = a ^ b; + uint8_t result = a ^ b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( result & FLAG_SF ) | ( result ? 0 : FLAG_ZF ); @@ -611,9 +611,9 @@ UINT8 tlcs900h_device::xor8( UINT8 a, UINT8 b) } -UINT16 tlcs900h_device::xor16( UINT16 a, UINT16 b) +uint16_t tlcs900h_device::xor16( uint16_t a, uint16_t b) { - UINT16 result = a ^ b; + uint16_t result = a ^ b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 8 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ); @@ -624,9 +624,9 @@ UINT16 tlcs900h_device::xor16( UINT16 a, UINT16 b) } -UINT32 tlcs900h_device::xor32( UINT32 a, UINT32 b) +uint32_t tlcs900h_device::xor32( uint32_t a, uint32_t b) { - UINT32 result = a ^ b; + uint32_t result = a ^ b; m_sr.b.l &= ~(FLAG_SF | FLAG_ZF | FLAG_HF | FLAG_VF | FLAG_NF | FLAG_CF); m_sr.b.l |= ( ( result >> 24 ) & FLAG_SF ) | ( result ? 0 : FLAG_ZF ); @@ -635,7 +635,7 @@ UINT32 tlcs900h_device::xor32( UINT32 a, UINT32 b) } -void tlcs900h_device::ldcf8( UINT8 a, UINT8 b ) +void tlcs900h_device::ldcf8( uint8_t a, uint8_t b ) { if ( b & ( 1 << ( a & 0x07 ) ) ) m_sr.b.l |= FLAG_CF; @@ -644,7 +644,7 @@ void tlcs900h_device::ldcf8( UINT8 a, UINT8 b ) } -void tlcs900h_device::ldcf16( UINT8 a, UINT8 b ) +void tlcs900h_device::ldcf16( uint8_t a, uint8_t b ) { if ( b & ( 1 << ( a & 0x0f ) ) ) m_sr.b.l |= FLAG_CF; @@ -653,7 +653,7 @@ void tlcs900h_device::ldcf16( UINT8 a, UINT8 b ) } -void tlcs900h_device::andcf8( UINT8 a, UINT8 b ) +void tlcs900h_device::andcf8( uint8_t a, uint8_t b ) { if ( ( b & ( 1 << ( a & 0x07 ) ) ) && ( m_sr.b.l & FLAG_CF ) ) m_sr.b.l |= FLAG_CF; @@ -662,7 +662,7 @@ void tlcs900h_device::andcf8( UINT8 a, UINT8 b ) } -void tlcs900h_device::andcf16( UINT8 a, UINT8 b ) +void tlcs900h_device::andcf16( uint8_t a, uint8_t b ) { if ( ( b & ( 1 << ( a & 0x0f ) ) ) && ( m_sr.b.l & FLAG_CF ) ) m_sr.b.l |= FLAG_CF; @@ -671,37 +671,37 @@ void tlcs900h_device::andcf16( UINT8 a, UINT8 b ) } -void tlcs900h_device::orcf8( UINT8 a, UINT8 b ) +void tlcs900h_device::orcf8( uint8_t a, uint8_t b ) { if ( b & ( 1 << ( a & 0x07 ) ) ) m_sr.b.l |= FLAG_CF; } -void tlcs900h_device::orcf16( UINT8 a, UINT8 b ) +void tlcs900h_device::orcf16( uint8_t a, uint8_t b ) { if ( b & ( 1 << ( a & 0x0f ) ) ) m_sr.b.l |= FLAG_CF; } -void tlcs900h_device::xorcf8( UINT8 a, UINT8 b ) +void tlcs900h_device::xorcf8( uint8_t a, uint8_t b ) { if ( b & ( 1 << ( a & 0x07 ) ) ) m_sr.b.l ^= FLAG_CF; } -void tlcs900h_device::xorcf16( UINT8 a, UINT8 b ) +void tlcs900h_device::xorcf16( uint8_t a, uint8_t b ) { if ( b & ( 1 << ( a & 0x0f ) ) ) m_sr.b.l ^= FLAG_CF; } -UINT8 tlcs900h_device::rl8( UINT8 a, UINT8 s ) +uint8_t tlcs900h_device::rl8( uint8_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -725,9 +725,9 @@ UINT8 tlcs900h_device::rl8( UINT8 a, UINT8 s ) } -UINT16 tlcs900h_device::rl16( UINT16 a, UINT8 s ) +uint16_t tlcs900h_device::rl16( uint16_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -751,9 +751,9 @@ UINT16 tlcs900h_device::rl16( UINT16 a, UINT8 s ) } -UINT32 tlcs900h_device::rl32( UINT32 a, UINT8 s ) +uint32_t tlcs900h_device::rl32( uint32_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -777,9 +777,9 @@ UINT32 tlcs900h_device::rl32( UINT32 a, UINT8 s ) return a; } -UINT8 tlcs900h_device::rlc8( UINT8 a, UINT8 s ) +uint8_t tlcs900h_device::rlc8( uint8_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -794,9 +794,9 @@ UINT8 tlcs900h_device::rlc8( UINT8 a, UINT8 s ) } -UINT16 tlcs900h_device::rlc16( UINT16 a, UINT8 s ) +uint16_t tlcs900h_device::rlc16( uint16_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -811,9 +811,9 @@ UINT16 tlcs900h_device::rlc16( UINT16 a, UINT8 s ) } -UINT32 tlcs900h_device::rlc32( UINT32 a, UINT8 s ) +uint32_t tlcs900h_device::rlc32( uint32_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -829,9 +829,9 @@ UINT32 tlcs900h_device::rlc32( UINT32 a, UINT8 s ) } -UINT8 tlcs900h_device::rr8( UINT8 a, UINT8 s ) +uint8_t tlcs900h_device::rr8( uint8_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -855,9 +855,9 @@ UINT8 tlcs900h_device::rr8( UINT8 a, UINT8 s ) } -UINT16 tlcs900h_device::rr16( UINT16 a, UINT8 s ) +uint16_t tlcs900h_device::rr16( uint16_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -881,9 +881,9 @@ UINT16 tlcs900h_device::rr16( UINT16 a, UINT8 s ) } -UINT32 tlcs900h_device::rr32( UINT32 a, UINT8 s ) +uint32_t tlcs900h_device::rr32( uint32_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -908,9 +908,9 @@ UINT32 tlcs900h_device::rr32( UINT32 a, UINT8 s ) } -UINT8 tlcs900h_device::rrc8( UINT8 a, UINT8 s ) +uint8_t tlcs900h_device::rrc8( uint8_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -925,9 +925,9 @@ UINT8 tlcs900h_device::rrc8( UINT8 a, UINT8 s ) } -UINT16 tlcs900h_device::rrc16( UINT16 a, UINT8 s ) +uint16_t tlcs900h_device::rrc16( uint16_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -942,9 +942,9 @@ UINT16 tlcs900h_device::rrc16( UINT16 a, UINT8 s ) } -UINT32 tlcs900h_device::rrc32( UINT32 a, UINT8 s ) +uint32_t tlcs900h_device::rrc32( uint32_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -960,9 +960,9 @@ UINT32 tlcs900h_device::rrc32( UINT32 a, UINT8 s ) } -UINT8 tlcs900h_device::sla8( UINT8 a, UINT8 s ) +uint8_t tlcs900h_device::sla8( uint8_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -978,9 +978,9 @@ UINT8 tlcs900h_device::sla8( UINT8 a, UINT8 s ) } -UINT16 tlcs900h_device::sla16( UINT16 a, UINT8 s ) +uint16_t tlcs900h_device::sla16( uint16_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -996,9 +996,9 @@ UINT16 tlcs900h_device::sla16( UINT16 a, UINT8 s ) } -UINT32 tlcs900h_device::sla32( UINT32 a, UINT8 s ) +uint32_t tlcs900h_device::sla32( uint32_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -1015,9 +1015,9 @@ UINT32 tlcs900h_device::sla32( UINT32 a, UINT8 s ) } -UINT8 tlcs900h_device::sra8( UINT8 a, UINT8 s ) +uint8_t tlcs900h_device::sra8( uint8_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -1033,9 +1033,9 @@ UINT8 tlcs900h_device::sra8( UINT8 a, UINT8 s ) } -UINT16 tlcs900h_device::sra16( UINT16 a, UINT8 s ) +uint16_t tlcs900h_device::sra16( uint16_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -1051,9 +1051,9 @@ UINT16 tlcs900h_device::sra16( UINT16 a, UINT8 s ) } -UINT32 tlcs900h_device::sra32( UINT32 a, UINT8 s ) +uint32_t tlcs900h_device::sra32( uint32_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -1070,9 +1070,9 @@ UINT32 tlcs900h_device::sra32( UINT32 a, UINT8 s ) } -UINT8 tlcs900h_device::srl8( UINT8 a, UINT8 s ) +uint8_t tlcs900h_device::srl8( uint8_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -1088,9 +1088,9 @@ UINT8 tlcs900h_device::srl8( UINT8 a, UINT8 s ) } -UINT16 tlcs900h_device::srl16( UINT16 a, UINT8 s ) +uint16_t tlcs900h_device::srl16( uint16_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -1106,9 +1106,9 @@ UINT16 tlcs900h_device::srl16( UINT16 a, UINT8 s ) } -UINT32 tlcs900h_device::srl32( UINT32 a, UINT8 s ) +uint32_t tlcs900h_device::srl32( uint32_t a, uint8_t s ) { - UINT8 count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; + uint8_t count = ( s & 0x0f ) ? ( s & 0x0f ) : 16; for ( ; count > 0; count-- ) { @@ -1125,7 +1125,7 @@ UINT32 tlcs900h_device::srl32( UINT32 a, UINT8 s ) } -UINT16 tlcs900h_device::div8( UINT16 a, UINT8 b ) +uint16_t tlcs900h_device::div8( uint16_t a, uint8_t b ) { ldiv_t result; @@ -1136,8 +1136,8 @@ UINT16 tlcs900h_device::div8( UINT16 a, UINT8 b ) } if ( a >= ( 0x0200 * b ) ) { - UINT16 diff = a - ( 0x0200 * b ); - UINT16 range = 0x100 - b; + uint16_t diff = a - ( 0x0200 * b ); + uint16_t range = 0x100 - b; result = ldiv( diff, range ); result.quot = 0x1ff - result.quot; @@ -1157,7 +1157,7 @@ UINT16 tlcs900h_device::div8( UINT16 a, UINT8 b ) } -UINT32 tlcs900h_device::div16( UINT32 a, UINT16 b ) +uint32_t tlcs900h_device::div16( uint32_t a, uint16_t b ) { ldiv_t result; @@ -1168,8 +1168,8 @@ UINT32 tlcs900h_device::div16( UINT32 a, UINT16 b ) } // if ( a >= ( 0x02000000 * b ) ) { -// UINT32 diff = a - ( 0x02000000 * b ); -// UINT32 range = 0x1000000 - b; +// uint32_t diff = a - ( 0x02000000 * b ); +// uint32_t range = 0x1000000 - b; // // result = ldiv( diff, range ); // result.quot = 0x1ffffff - result.quot; @@ -1189,7 +1189,7 @@ UINT32 tlcs900h_device::div16( UINT32 a, UINT16 b ) } -UINT16 tlcs900h_device::divs8( INT16 a, INT8 b ) +uint16_t tlcs900h_device::divs8( int16_t a, int8_t b ) { ldiv_t result; @@ -1210,7 +1210,7 @@ UINT16 tlcs900h_device::divs8( INT16 a, INT8 b ) } -UINT32 tlcs900h_device::divs16( INT32 a, INT16 b ) +uint32_t tlcs900h_device::divs16( int32_t a, int16_t b ) { ldiv_t result; @@ -1551,7 +1551,7 @@ void tlcs900h_device::_BITWIR() void tlcs900h_device::_BS1BRR() { - UINT16 r = *m_p2_reg16; + uint16_t r = *m_p2_reg16; if ( r ) { @@ -1570,7 +1570,7 @@ void tlcs900h_device::_BS1BRR() void tlcs900h_device::_BS1FRR() { - UINT16 r = *m_p2_reg16; + uint16_t r = *m_p2_reg16; if ( r ) { @@ -1729,8 +1729,8 @@ void tlcs900h_device::_CPLRR() void tlcs900h_device::_CPD() { - UINT8 result = *get_reg8_current( 1 ) - RDMEM( *m_p2_reg32 ); - UINT16 *bc = get_reg16_current( 1 ); + uint8_t result = *get_reg8_current( 1 ) - RDMEM( *m_p2_reg32 ); + uint16_t *bc = get_reg16_current( 1 ); *m_p2_reg32 -= 1; *bc -= 1; @@ -1755,8 +1755,8 @@ void tlcs900h_device::_CPDR() void tlcs900h_device::_CPDW() { - UINT16 result = *get_reg16_current( 0 ) - RDMEMW( *m_p2_reg32 ); - UINT16 *bc = get_reg16_current( 1 ); + uint16_t result = *get_reg16_current( 0 ) - RDMEMW( *m_p2_reg32 ); + uint16_t *bc = get_reg16_current( 1 ); *m_p2_reg32 -= 2; *bc -= 1; @@ -1781,8 +1781,8 @@ void tlcs900h_device::_CPDRW() void tlcs900h_device::_CPI() { - UINT8 result = *get_reg8_current( 1 ) - RDMEM( *m_p2_reg32 ); - UINT16 *bc = get_reg16_current( 1 ); + uint8_t result = *get_reg8_current( 1 ) - RDMEM( *m_p2_reg32 ); + uint16_t *bc = get_reg16_current( 1 ); *m_p2_reg32 += 1; *bc -= 1; @@ -1807,8 +1807,8 @@ void tlcs900h_device::_CPIR() void tlcs900h_device::_CPIW() { - UINT16 result = *get_reg16_current( 0 ) - RDMEMW( *m_p2_reg32 ); - UINT16 *bc = get_reg16_current( 1 ); + uint16_t result = *get_reg16_current( 0 ) - RDMEMW( *m_p2_reg32 ); + uint16_t *bc = get_reg16_current( 1 ); *m_p2_reg32 += 2; *bc -= 1; @@ -1847,11 +1847,11 @@ void tlcs900h_device::_CPLWR() void tlcs900h_device::_DAABR() { - UINT8 oldval = *m_p1_reg8; - UINT8 fixval = 0; - UINT8 carry = 0; - UINT8 high = *m_p1_reg8 & 0xf0; - UINT8 low = *m_p1_reg8 & 0x0f; + uint8_t oldval = *m_p1_reg8; + uint8_t fixval = 0; + uint8_t carry = 0; + uint8_t high = *m_p1_reg8 & 0xf0; + uint8_t low = *m_p1_reg8 & 0x0f; if ( m_sr.b.l & FLAG_CF ) { @@ -1915,7 +1915,7 @@ void tlcs900h_device::_DB() void tlcs900h_device::_DECBIM() { - UINT8 cy = m_sr.b.l & FLAG_CF; + uint8_t cy = m_sr.b.l & FLAG_CF; WRMEM( m_ea2.d, sub8( RDMEM( m_ea2.d ), m_imm1.b.l ? m_imm1.b.l : 8 ) ); m_sr.b.l = ( m_sr.b.l & ~ FLAG_CF ) | cy; @@ -1924,7 +1924,7 @@ void tlcs900h_device::_DECBIM() void tlcs900h_device::_DECBIR() { - UINT8 cy = m_sr.b.l & FLAG_CF; + uint8_t cy = m_sr.b.l & FLAG_CF; *m_p2_reg8 = sub8( *m_p2_reg8, m_imm1.b.l ? m_imm1.b.l : 8 ); m_sr.b.l = ( m_sr.b.l & ~ FLAG_CF ) | cy; @@ -1933,7 +1933,7 @@ void tlcs900h_device::_DECBIR() void tlcs900h_device::_DECWIM() { - UINT8 cy = m_sr.b.l & FLAG_CF; + uint8_t cy = m_sr.b.l & FLAG_CF; WRMEMW( m_ea2.d, sub16( RDMEMW( m_ea2.d ), m_imm1.b.l ? m_imm1.b.l : 8 ) ); m_sr.b.l = ( m_sr.b.l & ~ FLAG_CF ) | cy; @@ -2065,7 +2065,7 @@ void tlcs900h_device::_EI() void tlcs900h_device::_EXBMR() { - UINT8 i = RDMEM( m_ea1.d ); + uint8_t i = RDMEM( m_ea1.d ); WRMEM( m_ea1.d, *m_p2_reg8 ); *m_p2_reg8 = i; @@ -2074,7 +2074,7 @@ void tlcs900h_device::_EXBMR() void tlcs900h_device::_EXBRR() { - UINT8 i = *m_p2_reg8; + uint8_t i = *m_p2_reg8; *m_p2_reg8 = *m_p1_reg8; *m_p1_reg8 = i; @@ -2083,7 +2083,7 @@ void tlcs900h_device::_EXBRR() void tlcs900h_device::_EXWMR() { - UINT16 i = RDMEMW( m_ea1.d ); + uint16_t i = RDMEMW( m_ea1.d ); WRMEMW( m_ea1.d, *m_p2_reg16 ); *m_p2_reg16 = i; @@ -2092,7 +2092,7 @@ void tlcs900h_device::_EXWMR() void tlcs900h_device::_EXWRR() { - UINT16 i = *m_p2_reg16; + uint16_t i = *m_p2_reg16; *m_p2_reg16 = *m_p1_reg16; *m_p1_reg16 = i; @@ -2137,7 +2137,7 @@ void tlcs900h_device::_HALT() void tlcs900h_device::_INCBIM() { - UINT8 cy = m_sr.b.l & FLAG_CF; + uint8_t cy = m_sr.b.l & FLAG_CF; WRMEM( m_ea2.d, add8( RDMEM( m_ea2.d ), m_imm1.b.l ? m_imm1.b.l : 8 ) ); m_sr.b.l = ( m_sr.b.l & ~ FLAG_CF ) | cy; @@ -2146,7 +2146,7 @@ void tlcs900h_device::_INCBIM() void tlcs900h_device::_INCBIR() { - UINT8 cy = m_sr.b.l & FLAG_CF; + uint8_t cy = m_sr.b.l & FLAG_CF; *m_p2_reg8 = add8( *m_p2_reg8, m_imm1.b.l ? m_imm1.b.l : 8 ); m_sr.b.l = ( m_sr.b.l & ~ FLAG_CF ) | cy; @@ -2155,7 +2155,7 @@ void tlcs900h_device::_INCBIR() void tlcs900h_device::_INCWIM() { - UINT8 cy = m_sr.b.l & FLAG_CF; + uint8_t cy = m_sr.b.l & FLAG_CF; WRMEMW( m_ea2.d, add16( RDMEMW( m_ea2.d ), m_imm1.b.l ? m_imm1.b.l : 8 ) ); m_sr.b.l = ( m_sr.b.l & ~ FLAG_CF ) | cy; @@ -2386,7 +2386,7 @@ void tlcs900h_device::_LDCFWRR() void tlcs900h_device::_LDD() { - UINT16 *bc = get_reg16_current( 1 ); + uint16_t *bc = get_reg16_current( 1 ); WRMEM( *m_p1_reg32, RDMEM( *m_p2_reg32 ) ); *m_p1_reg32 -= 1; @@ -2402,7 +2402,7 @@ void tlcs900h_device::_LDD() void tlcs900h_device::_LDDR() { - UINT16 *bc = get_reg16_current( 1 ); + uint16_t *bc = get_reg16_current( 1 ); WRMEM( *m_p1_reg32, RDMEM( *m_p2_reg32 ) ); *m_p1_reg32 -= 1; @@ -2421,7 +2421,7 @@ void tlcs900h_device::_LDDR() void tlcs900h_device::_LDDRW() { - UINT16 *bc = get_reg16_current( 1 ); + uint16_t *bc = get_reg16_current( 1 ); WRMEMW( *m_p1_reg32, RDMEMW( *m_p2_reg32 ) ); *m_p1_reg32 -= 2; @@ -2440,7 +2440,7 @@ void tlcs900h_device::_LDDRW() void tlcs900h_device::_LDDW() { - UINT16 *bc = get_reg16_current( 1 ); + uint16_t *bc = get_reg16_current( 1 ); WRMEMW( *m_p1_reg32, RDMEMW( *m_p2_reg32 ) ); *m_p1_reg32 -= 2; @@ -2463,7 +2463,7 @@ void tlcs900h_device::_LDF() void tlcs900h_device::_LDI() { - UINT16 *bc = get_reg16_current( 1 ); + uint16_t *bc = get_reg16_current( 1 ); WRMEM( *m_p1_reg32, RDMEM( *m_p2_reg32 ) ); *m_p1_reg32 += 1; @@ -2479,7 +2479,7 @@ void tlcs900h_device::_LDI() void tlcs900h_device::_LDIR() { - UINT16 *bc = get_reg16_current( 1 ); + uint16_t *bc = get_reg16_current( 1 ); WRMEM( *m_p1_reg32, RDMEM( *m_p2_reg32 ) ); *m_p1_reg32 += 1; @@ -2498,7 +2498,7 @@ void tlcs900h_device::_LDIR() void tlcs900h_device::_LDIRW() { - UINT16 *bc = get_reg16_current( 1 ); + uint16_t *bc = get_reg16_current( 1 ); WRMEMW( *m_p1_reg32, RDMEMW( *m_p2_reg32 ) ); *m_p1_reg32 += 2; @@ -2517,7 +2517,7 @@ void tlcs900h_device::_LDIRW() void tlcs900h_device::_LDIW() { - UINT16 *bc = get_reg16_current( 1 ); + uint16_t *bc = get_reg16_current( 1 ); WRMEMW( *m_p1_reg32, RDMEMW( *m_p2_reg32 ) ); *m_p1_reg32 += 2; @@ -2533,7 +2533,7 @@ void tlcs900h_device::_LDIW() void tlcs900h_device::_LDX() { - UINT8 a, b; + uint8_t a, b; RDOP(); a = RDOP(); @@ -2615,8 +2615,8 @@ void tlcs900h_device::_MINC4() void tlcs900h_device::_MIRRW() { - UINT16 r = *m_p1_reg16; - UINT16 s = ( r & 0x01 ); + uint16_t r = *m_p1_reg16; + uint16_t s = ( r & 0x01 ); int i; @@ -2669,10 +2669,10 @@ void tlcs900h_device::_MULWRR() void tlcs900h_device::_MULAR() { - UINT32 *xde = get_reg32_current( 2 ); - UINT32 *xhl = get_reg32_current( 3 ); + uint32_t *xde = get_reg32_current( 2 ); + uint32_t *xhl = get_reg32_current( 3 ); - *m_p1_reg32 = *m_p1_reg32 + ( ((INT16)RDMEMW( *xde )) * ((INT16)RDMEMW( *xhl )) ); + *m_p1_reg32 = *m_p1_reg32 + ( ((int16_t)RDMEMW( *xde )) * ((int16_t)RDMEMW( *xhl )) ); *xhl -= 2; m_sr.b.l &= ~ ( FLAG_SF | FLAG_ZF | FLAG_VF ); @@ -2682,37 +2682,37 @@ void tlcs900h_device::_MULAR() void tlcs900h_device::_MULSBRI() { - *m_p1_reg16 = (INT8)( *m_p1_reg16 & 0xff ) * m_imm2.sb.l; + *m_p1_reg16 = (int8_t)( *m_p1_reg16 & 0xff ) * m_imm2.sb.l; } void tlcs900h_device::_MULSBRM() { - *m_p1_reg16 = (INT8)( *m_p1_reg16 & 0xff ) * (INT8)RDMEM( m_ea2.d ); + *m_p1_reg16 = (int8_t)( *m_p1_reg16 & 0xff ) * (int8_t)RDMEM( m_ea2.d ); } void tlcs900h_device::_MULSBRR() { - *m_p1_reg16 = (INT8)( *m_p1_reg16 & 0xff ) * (INT8)*m_p2_reg8; + *m_p1_reg16 = (int8_t)( *m_p1_reg16 & 0xff ) * (int8_t)*m_p2_reg8; } void tlcs900h_device::_MULSWRI() { - *m_p1_reg32 = (INT16)( *m_p1_reg32 & 0xffff ) * m_imm2.sw.l; + *m_p1_reg32 = (int16_t)( *m_p1_reg32 & 0xffff ) * m_imm2.sw.l; } void tlcs900h_device::_MULSWRM() { - *m_p1_reg32 = (INT16)( *m_p1_reg32 & 0xffff ) * (INT16)RDMEMW( m_ea2.d ); + *m_p1_reg32 = (int16_t)( *m_p1_reg32 & 0xffff ) * (int16_t)RDMEMW( m_ea2.d ); } void tlcs900h_device::_MULSWRR() { - *m_p1_reg32 = (INT16)( *m_p1_reg32 & 0xffff ) * (INT16)*m_p2_reg16; + *m_p1_reg32 = (int16_t)( *m_p1_reg32 & 0xffff ) * (int16_t)*m_p2_reg16; } @@ -3128,8 +3128,8 @@ void tlcs900h_device::_RLCLRR() void tlcs900h_device::_RLDRM() { - UINT8 a = *m_p1_reg8 & 0x0f; - UINT8 b = RDMEM( m_ea2.d ); + uint8_t a = *m_p1_reg8 & 0x0f; + uint8_t b = RDMEM( m_ea2.d ); *m_p1_reg8 = ( *m_p1_reg8 & 0xf0 ) | ( ( b & 0xf0 ) >> 4 ); WRMEM( m_ea2.d, ( ( b & 0x0f ) << 4 ) | a ); @@ -3237,8 +3237,8 @@ void tlcs900h_device::_RRCLRR() void tlcs900h_device::_RRDRM() { - UINT8 a = *m_p1_reg8 & 0x0f; - UINT8 b = RDMEM( m_ea2.d ); + uint8_t a = *m_p1_reg8 & 0x0f; + uint8_t b = RDMEM( m_ea2.d ); *m_p1_reg8 = ( *m_p1_reg8 & 0xf0 ) | ( b & 0x0f ); WRMEM( m_ea2.d, ( ( b & 0xf0 ) >> 4 ) | ( a << 4 ) ); @@ -3712,8 +3712,8 @@ void tlcs900h_device::_SWI() void tlcs900h_device::_TSETBIM() { - UINT8 b = 1 << ( m_imm1.b.l & 0x07 ); - UINT8 a = RDMEM( m_ea2.d ); + uint8_t b = 1 << ( m_imm1.b.l & 0x07 ); + uint8_t a = RDMEM( m_ea2.d ); m_sr.b.l &= ~ ( FLAG_ZF | FLAG_NF ); m_sr.b.l |= ( ( a & b ) ? 0 : FLAG_ZF ) | FLAG_HF; @@ -3723,7 +3723,7 @@ void tlcs900h_device::_TSETBIM() void tlcs900h_device::_TSETBIR() { - UINT8 b = 1 << ( m_imm1.b.l & 0x07 ); + uint8_t b = 1 << ( m_imm1.b.l & 0x07 ); m_sr.b.l &= ~ ( FLAG_ZF | FLAG_NF ); m_sr.b.l |= ( ( *m_p2_reg8 & b ) ? 0 : FLAG_ZF ) | FLAG_HF; @@ -3733,7 +3733,7 @@ void tlcs900h_device::_TSETBIR() void tlcs900h_device::_TSETWIR() { - UINT16 b = 1 << ( m_imm1.b.l & 0x0f ); + uint16_t b = 1 << ( m_imm1.b.l & 0x0f ); m_sr.b.l &= ~ ( FLAG_ZF | FLAG_NF ); m_sr.b.l |= ( ( *m_p2_reg16 & b ) ? 0 : FLAG_ZF ) | FLAG_HF; @@ -5359,7 +5359,7 @@ void tlcs900h_device::_88() m_ea2.d = *get_reg32_current( m_op ); m_op = RDOP(); - m_ea2.d += (INT8)m_op; + m_ea2.d += (int8_t)m_op; m_cycles += 2; m_op = RDOP(); inst = &s_mnemonic_80[m_op]; @@ -5394,7 +5394,7 @@ void tlcs900h_device::_98() m_ea2.d = *get_reg32_current( m_op ); m_op = RDOP(); - m_ea2.d += (INT8)m_op; + m_ea2.d += (int8_t)m_op; m_cycles += 2; m_op = RDOP(); inst = &s_mnemonic_98[m_op]; @@ -5425,7 +5425,7 @@ void tlcs900h_device::_A8() m_ea2.d = *get_reg32_current( m_op ); m_op = RDOP(); - m_ea2.d += (INT8)m_op; + m_ea2.d += (int8_t)m_op; m_cycles += 2; m_op = RDOP(); inst = &s_mnemonic_a0[m_op]; @@ -5456,7 +5456,7 @@ void tlcs900h_device::_B8() m_ea2.d = *get_reg32_current( m_op ); m_op = RDOP(); - m_ea2.d += (INT8)m_op; + m_ea2.d += (int8_t)m_op; m_cycles += 2; m_op = RDOP(); inst = &s_mnemonic_b8[m_op]; @@ -5470,7 +5470,7 @@ void tlcs900h_device::_B8() void tlcs900h_device::_C0() { const tlcs900inst *inst; - UINT32 *reg = nullptr; + uint32_t *reg = nullptr; switch ( m_op & 0x07 ) { @@ -5522,7 +5522,7 @@ void tlcs900h_device::_C0() m_op = RDOP(); m_ea2.d = *get_reg32( m_op ); m_op = RDOP(); - m_ea2.d += (INT8) *get_reg8( m_op ); + m_ea2.d += (int8_t) *get_reg8( m_op ); m_cycles += 8; break; @@ -5531,7 +5531,7 @@ void tlcs900h_device::_C0() m_op = RDOP(); m_ea2.d = *get_reg32( m_op ); m_op = RDOP(); - m_ea2.d += (INT16) *get_reg16( m_op ); + m_ea2.d += (int16_t) *get_reg16( m_op ); m_cycles += 8; break; @@ -5599,7 +5599,7 @@ void tlcs900h_device::oC8() void tlcs900h_device::_D0() { const tlcs900inst *inst; - UINT32 *reg = nullptr; + uint32_t *reg = nullptr; switch ( m_op & 0x07 ) { @@ -5651,7 +5651,7 @@ void tlcs900h_device::_D0() m_op = RDOP(); m_ea2.d = *get_reg32( m_op ); m_op = RDOP(); - m_ea2.d += (INT8) *get_reg8( m_op ); + m_ea2.d += (int8_t) *get_reg8( m_op ); m_cycles += 8; break; @@ -5660,7 +5660,7 @@ void tlcs900h_device::_D0() m_op = RDOP(); m_ea2.d = *get_reg32( m_op ); m_op = RDOP(); - m_ea2.d += (INT16) *get_reg16( m_op ); + m_ea2.d += (int16_t) *get_reg16( m_op ); m_cycles += 8; break; @@ -5726,7 +5726,7 @@ void tlcs900h_device::oD8() void tlcs900h_device::_E0() { const tlcs900inst *inst; - UINT32 *reg = nullptr; + uint32_t *reg = nullptr; switch ( m_op & 0x07 ) { @@ -5778,7 +5778,7 @@ void tlcs900h_device::_E0() m_op = RDOP(); m_ea2.d = *get_reg32( m_op ); m_op = RDOP(); - m_ea2.d += (INT8) *get_reg8( m_op ); + m_ea2.d += (int8_t) *get_reg8( m_op ); m_cycles += 8; break; @@ -5787,7 +5787,7 @@ void tlcs900h_device::_E0() m_op = RDOP(); m_ea2.d = *get_reg32( m_op ); m_op = RDOP(); - m_ea2.d += (INT16) *get_reg16( m_op ); + m_ea2.d += (int16_t) *get_reg16( m_op ); m_cycles += 8; break; @@ -5851,7 +5851,7 @@ void tlcs900h_device::_E8() void tlcs900h_device::_F0() { const tlcs900inst *inst; - UINT32 *reg = nullptr; + uint32_t *reg = nullptr; switch ( m_op & 0x07 ) { @@ -5903,7 +5903,7 @@ void tlcs900h_device::_F0() m_op = RDOP(); m_ea2.d = *get_reg32( m_op ); m_op = RDOP(); - m_ea2.d += (INT8) *get_reg8( m_op ); + m_ea2.d += (int8_t) *get_reg8( m_op ); m_cycles += 8; break; @@ -5912,7 +5912,7 @@ void tlcs900h_device::_F0() m_op = RDOP(); m_ea2.d = *get_reg32( m_op ); m_op = RDOP(); - m_ea2.d += (INT16) *get_reg16( m_op ); + m_ea2.d += (int16_t) *get_reg16( m_op ); m_cycles += 8; break; diff --git a/src/devices/cpu/tlcs900/dasm900.cpp b/src/devices/cpu/tlcs900/dasm900.cpp index 7231a2f4759..b07841bcce7 100644 --- a/src/devices/cpu/tlcs900/dasm900.cpp +++ b/src/devices/cpu/tlcs900/dasm900.cpp @@ -1438,8 +1438,8 @@ CPU_DISASSEMBLE( tlcs900 ) const tlcs900inst *dasm; char *dst = buffer; char buf[32]; - UINT8 op, op1; - UINT32 imm; + uint8_t op, op1; + uint32_t imm; int flags = 0; int pos = 0; @@ -1562,7 +1562,7 @@ CPU_DISASSEMBLE( tlcs900 ) case 0x13: imm = oprom[ pos++ ]; imm = imm | ( oprom[ pos++ ] << 8 ); - sprintf( buf, "0x%06x", pc + pos + (INT16)imm ); + sprintf( buf, "0x%06x", pc + pos + (int16_t)imm ); break; } break; @@ -1655,7 +1655,7 @@ CPU_DISASSEMBLE( tlcs900 ) case 0x13: imm = oprom[ pos++ ]; imm = imm | ( oprom[ pos++ ] << 8 ); - sprintf( buf, "0x%06x", pc + pos + (INT16)imm ); + sprintf( buf, "0x%06x", pc + pos + (int16_t)imm ); break; } break; @@ -1749,7 +1749,7 @@ CPU_DISASSEMBLE( tlcs900 ) case 0x13: imm = oprom[ pos++ ]; imm = imm | ( oprom[ pos++ ] << 8 ); - sprintf( buf, "0x%06x", pc + pos + (INT16)imm ); + sprintf( buf, "0x%06x", pc + pos + (int16_t)imm ); break; } break; @@ -1842,7 +1842,7 @@ CPU_DISASSEMBLE( tlcs900 ) case 0x13: imm = oprom[ pos++ ]; imm = imm | ( oprom[ pos++ ] << 8 ); - sprintf( buf, "0x%06x", pc + pos + (INT16)imm ); + sprintf( buf, "0x%06x", pc + pos + (int16_t)imm ); break; } break; @@ -1991,13 +1991,13 @@ CPU_DISASSEMBLE( tlcs900 ) case O_D8: imm = oprom[ pos++ ]; - dst += sprintf( dst, " 0x%06x", ( pc + pos + (INT8)imm ) & 0xFFFFFF ); + dst += sprintf( dst, " 0x%06x", ( pc + pos + (int8_t)imm ) & 0xFFFFFF ); break; case O_D16: imm = oprom[ pos++ ]; imm = imm | ( oprom[ pos++ ] << 8 ); - dst += sprintf( dst, " 0x%06x", ( pc + pos + (INT16)imm ) & 0xFFFFFF ); + dst += sprintf( dst, " 0x%06x", ( pc + pos + (int16_t)imm ) & 0xFFFFFF ); break; case O_F: @@ -2177,13 +2177,13 @@ CPU_DISASSEMBLE( tlcs900 ) case O_D8: imm = oprom[ pos++ ]; - dst += sprintf( dst, ",0x%06x", ( pc + pos + (INT8)imm ) & 0xFFFFFF ); + dst += sprintf( dst, ",0x%06x", ( pc + pos + (int8_t)imm ) & 0xFFFFFF ); break; case O_D16: imm = oprom[ pos++ ]; imm = imm | ( oprom[ pos++ ] << 8 ); - dst += sprintf( dst, ",0x%06x", ( pc + pos + (INT16)imm ) & 0xFFFFFF ); + dst += sprintf( dst, ",0x%06x", ( pc + pos + (int16_t)imm ) & 0xFFFFFF ); break; case O_F: diff --git a/src/devices/cpu/tlcs900/tlcs900.cpp b/src/devices/cpu/tlcs900/tlcs900.cpp index 5521954bc03..cdeb65e2d21 100644 --- a/src/devices/cpu/tlcs900/tlcs900.cpp +++ b/src/devices/cpu/tlcs900/tlcs900.cpp @@ -42,13 +42,13 @@ static ADDRESS_MAP_START(tmp95c063_mem16, AS_PROGRAM, 16, tmp95c063_device ) ADDRESS_MAP_END -tlcs900h_device::tlcs900h_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +tlcs900h_device::tlcs900h_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__), m_am8_16(0) { } -tmp95c061_device::tmp95c061_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmp95c061_device::tmp95c061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs900h_device(mconfig, TMP95C061, "TMP95C061", tag, owner, clock, "tmp95c061" ), m_port1_read(*this), m_port1_write(*this), @@ -87,7 +87,7 @@ void tmp95c061_device::device_config_complete() } } -tmp95c063_device::tmp95c063_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmp95c063_device::tmp95c063_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tlcs900h_device(mconfig, TMP95C063, "TMP95C063", tag, owner, clock, "tmp95c063"), m_port1_read(*this), m_port1_write(*this), @@ -141,7 +141,7 @@ void tmp95c063_device::device_config_complete() } -offs_t tlcs900h_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tlcs900h_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tlcs900 ); return CPU_DISASSEMBLE_NAME(tlcs900)(this, buffer, pc, oprom, opram, options); @@ -267,9 +267,9 @@ offs_t tlcs900h_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 #define FLAG_SF 0x80 -inline UINT8 tlcs900h_device::RDOP() +inline uint8_t tlcs900h_device::RDOP() { - UINT8 data; + uint8_t data; if ( m_prefetch_clear ) { @@ -531,9 +531,9 @@ void tmp95c061_device::device_reset() #define TMP95C061_NUM_MASKABLE_IRQS 22 static const struct { - UINT8 reg; - UINT8 iff; - UINT8 vector; + uint8_t reg; + uint8_t iff; + uint8_t vector; } tmp95c061_irq_vector_map[TMP95C061_NUM_MASKABLE_IRQS] = { { TMP95C061_INTETC32, 0x80, 0x80 }, /* INTTC3 */ @@ -564,7 +564,7 @@ static const struct { int tmp95c061_device::tlcs900_process_hdma( int channel ) { - UINT8 vector = ( m_reg[0x7c + channel] & 0x1f ) << 2; + uint8_t vector = ( m_reg[0x7c + channel] & 0x1f ) << 2; /* Check if any HDMA actions should be performed */ if ( vector >= 0x28 && vector != 0x3C && vector < 0x74 ) @@ -763,7 +763,7 @@ void tmp95c061_device::tlcs900_check_irqs() /* Take irq */ if ( irq >= 0 ) { - UINT8 vector = tmp95c061_irq_vector_map[irq].vector; + uint8_t vector = tmp95c061_irq_vector_map[irq].vector; m_xssp.d -= 4; WRMEML( m_xssp.d, m_pc.d ); @@ -865,7 +865,7 @@ void tmp95c061_device::tlcs900_change_tff( int which, int change ) void tmp95c061_device::tlcs900_handle_timers() { - UINT32 old_pre = m_timer_pre; + uint32_t old_pre = m_timer_pre; /* Is the pre-scaler active */ if ( m_reg[TMP95C061_TRUN] & 0x80 ) @@ -1450,9 +1450,9 @@ WRITE8_MEMBER( tmp95c061_device::internal_w ) #define TMP95C063_NUM_MASKABLE_IRQS 30 static const struct { - UINT8 reg; - UINT8 iff; - UINT8 vector; + uint8_t reg; + uint8_t iff; + uint8_t vector; } tmp95c063_irq_vector_map[TMP95C063_NUM_MASKABLE_IRQS] = { { TMP95C063_INTETC23, 0x80, 0xa0 }, /* INTTC3 */ @@ -1476,7 +1476,7 @@ static const struct { { TMP95C063_INTET23, 0x08, 0x58 }, /* INTT2 */ { TMP95C063_INTET01, 0x80, 0x54 }, /* INTT1 */ { TMP95C063_INTET01, 0x08, 0x50 }, /* INTT0 */ - { TMP95C063_INTE78, 0x80, 0x4c }, /* INT8 */ + { TMP95C063_INTE78, 0x80, 0x4c }, /* int8_t */ { TMP95C063_INTE78, 0x08, 0x48 }, /* INT7 */ { TMP95C063_INTE56, 0x80, 0x44 }, /* INT6 */ { TMP95C063_INTE56, 0x08, 0x40 }, /* INT5 */ @@ -1492,7 +1492,7 @@ void tmp95c063_device::tlcs900_handle_timers() { // TODO: implement timers 4-7 - UINT32 old_pre = m_timer_pre; + uint32_t old_pre = m_timer_pre; /* Is the pre-scaler active */ if ( m_reg[TMP95C063_T8RUN] & 0x80 ) @@ -1717,7 +1717,7 @@ void tmp95c063_device::tlcs900_check_irqs() /* Take irq */ if ( irq >= 0 ) { - UINT8 vector = tmp95c063_irq_vector_map[irq].vector; + uint8_t vector = tmp95c063_irq_vector_map[irq].vector; m_xssp.d -= 4; WRMEML( m_xssp.d, m_pc.d ); diff --git a/src/devices/cpu/tlcs900/tlcs900.h b/src/devices/cpu/tlcs900/tlcs900.h index 54b68a090d5..e0ab4a99b15 100644 --- a/src/devices/cpu/tlcs900/tlcs900.h +++ b/src/devices/cpu/tlcs900/tlcs900.h @@ -49,7 +49,7 @@ class tlcs900h_device : public cpu_device { public: // construction/destruction - tlcs900h_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + tlcs900h_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); // static configuration helpers static void set_am8_16(device_t &device, int am8_16) { downcast(device).m_am8_16 = am8_16; } @@ -59,9 +59,9 @@ protected: virtual void device_start() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } /* FIXME */ - virtual UINT32 execute_max_cycles() const override { return 1; } /* FIXME */ - virtual UINT32 execute_input_lines() const override { return 6; } + virtual uint32_t execute_min_cycles() const override { return 1; } /* FIXME */ + virtual uint32_t execute_max_cycles() const override { return 1; } /* FIXME */ + virtual uint32_t execute_input_lines() const override { return 6; } virtual void execute_run() override; // device_memory_interface overrides @@ -74,20 +74,20 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 7; } /* FIXME */ - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 7; } /* FIXME */ + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; protected: int m_am8_16; address_space_config m_program_config; - UINT8 RDMEM(offs_t addr) { return m_program->read_byte( addr ); } - UINT16 RDMEMW(offs_t addr) { return m_program->read_word( addr ); } - UINT32 RDMEML(offs_t addr) { return m_program->read_dword( addr ); } - void WRMEM(offs_t addr, UINT8 data) { m_program->write_byte( addr, data ); } - void WRMEMW(offs_t addr,UINT16 data) { m_program->write_word( addr, data ); } - void WRMEML(offs_t addr,UINT32 data) { m_program->write_dword( addr, data ); } + uint8_t RDMEM(offs_t addr) { return m_program->read_byte( addr ); } + uint16_t RDMEMW(offs_t addr) { return m_program->read_word( addr ); } + uint32_t RDMEML(offs_t addr) { return m_program->read_dword( addr ); } + void WRMEM(offs_t addr, uint8_t data) { m_program->write_byte( addr, data ); } + void WRMEMW(offs_t addr,uint16_t data) { m_program->write_word( addr, data ); } + void WRMEML(offs_t addr,uint32_t data) { m_program->write_dword( addr, data ); } /* registers */ PAIR m_xwa[4]; @@ -109,13 +109,13 @@ protected: PAIR m_dmam[4]; /* Internal timers, irqs, etc */ - UINT8 m_reg[0xa0]; - UINT32 m_timer_pre; - UINT8 m_timer[6]; + uint8_t m_reg[0xa0]; + uint32_t m_timer_pre; + uint8_t m_timer[6]; int m_timer_change[4]; bool m_prefetch_clear; - UINT8 m_prefetch_index; - UINT8 m_prefetch[4]; + uint8_t m_prefetch_index; + uint8_t m_prefetch[4]; /* Current state of input levels */ int m_level[TLCS900_NUM_INPUTS]; @@ -125,13 +125,13 @@ protected: /* used during execution */ PAIR m_dummy; /* for illegal register references */ - UINT8 m_op; + uint8_t m_op; PAIR m_ea1, m_ea2; PAIR m_imm1, m_imm2; int m_cycles; - UINT8 *m_p1_reg8, *m_p2_reg8; - UINT16 *m_p1_reg16, *m_p2_reg16; - UINT32 *m_p1_reg32, *m_p2_reg32; + uint8_t *m_p1_reg8, *m_p2_reg8; + uint16_t *m_p1_reg16, *m_p2_reg16; + uint32_t *m_p1_reg32, *m_p2_reg32; int m_halted; int m_icount; @@ -162,77 +162,77 @@ protected: static const tlcs900inst s_mnemonic_f0[256]; static const tlcs900inst s_mnemonic[256]; - inline UINT8 RDOP(); + inline uint8_t RDOP(); virtual void tlcs900_check_hdma() = 0; virtual void tlcs900_check_irqs() = 0; virtual void tlcs900_handle_ad() = 0; virtual void tlcs900_handle_timers() = 0; - int condition_true( UINT8 cond ); - UINT8 *get_reg8_current( UINT8 reg ); - UINT16 *get_reg16_current( UINT8 reg ); - UINT32 *get_reg32_current( UINT8 reg ); - PAIR *get_reg( UINT8 reg ); - UINT8 *get_reg8( UINT8 reg ); - UINT16 *get_reg16( UINT8 reg ); - UINT32 *get_reg32( UINT8 reg ); - void parity8( UINT8 a ); - void parity16( UINT16 a ); - void parity32( UINT32 a ); - UINT8 adc8( UINT8 a, UINT8 b); - UINT16 adc16( UINT16 a, UINT16 b); - UINT32 adc32( UINT32 a, UINT32 b); - UINT8 add8( UINT8 a, UINT8 b); - UINT16 add16( UINT16 a, UINT16 b); - UINT32 add32( UINT32 a, UINT32 b); - UINT8 sbc8( UINT8 a, UINT8 b); - UINT16 sbc16( UINT16 a, UINT16 b); - UINT32 sbc32( UINT32 a, UINT32 b); - UINT8 sub8( UINT8 a, UINT8 b); - UINT16 sub16( UINT16 a, UINT16 b); - UINT32 sub32( UINT32 a, UINT32 b); - UINT8 and8( UINT8 a, UINT8 b); - UINT16 and16( UINT16 a, UINT16 b); - UINT32 and32( UINT32 a, UINT32 b); - UINT8 or8( UINT8 a, UINT8 b); - UINT16 or16( UINT16 a, UINT16 b); - UINT32 or32( UINT32 a, UINT32 b); - UINT8 xor8( UINT8 a, UINT8 b); - UINT16 xor16( UINT16 a, UINT16 b); - UINT32 xor32( UINT32 a, UINT32 b); - void ldcf8( UINT8 a, UINT8 b ); - void ldcf16( UINT8 a, UINT8 b ); - void andcf8( UINT8 a, UINT8 b ); - void andcf16( UINT8 a, UINT8 b ); - void orcf8( UINT8 a, UINT8 b ); - void orcf16( UINT8 a, UINT8 b ); - void xorcf8( UINT8 a, UINT8 b ); - void xorcf16( UINT8 a, UINT8 b ); - UINT8 rl8( UINT8 a, UINT8 s ); - UINT16 rl16( UINT16 a, UINT8 s ); - UINT32 rl32( UINT32 a, UINT8 s ); - UINT8 rlc8( UINT8 a, UINT8 s ); - UINT16 rlc16( UINT16 a, UINT8 s ); - UINT32 rlc32( UINT32 a, UINT8 s ); - UINT8 rr8( UINT8 a, UINT8 s ); - UINT16 rr16( UINT16 a, UINT8 s ); - UINT32 rr32( UINT32 a, UINT8 s ); - UINT8 rrc8( UINT8 a, UINT8 s ); - UINT16 rrc16( UINT16 a, UINT8 s ); - UINT32 rrc32( UINT32 a, UINT8 s ); - UINT8 sla8( UINT8 a, UINT8 s ); - UINT16 sla16( UINT16 a, UINT8 s ); - UINT32 sla32( UINT32 a, UINT8 s ); - UINT8 sra8( UINT8 a, UINT8 s ); - UINT16 sra16( UINT16 a, UINT8 s ); - UINT32 sra32( UINT32 a, UINT8 s ); - UINT8 srl8( UINT8 a, UINT8 s ); - UINT16 srl16( UINT16 a, UINT8 s ); - UINT32 srl32( UINT32 a, UINT8 s ); - UINT16 div8( UINT16 a, UINT8 b ); - UINT32 div16( UINT32 a, UINT16 b ); - UINT16 divs8( INT16 a, INT8 b ); - UINT32 divs16( INT32 a, INT16 b ); + int condition_true( uint8_t cond ); + uint8_t *get_reg8_current( uint8_t reg ); + uint16_t *get_reg16_current( uint8_t reg ); + uint32_t *get_reg32_current( uint8_t reg ); + PAIR *get_reg( uint8_t reg ); + uint8_t *get_reg8( uint8_t reg ); + uint16_t *get_reg16( uint8_t reg ); + uint32_t *get_reg32( uint8_t reg ); + void parity8( uint8_t a ); + void parity16( uint16_t a ); + void parity32( uint32_t a ); + uint8_t adc8( uint8_t a, uint8_t b); + uint16_t adc16( uint16_t a, uint16_t b); + uint32_t adc32( uint32_t a, uint32_t b); + uint8_t add8( uint8_t a, uint8_t b); + uint16_t add16( uint16_t a, uint16_t b); + uint32_t add32( uint32_t a, uint32_t b); + uint8_t sbc8( uint8_t a, uint8_t b); + uint16_t sbc16( uint16_t a, uint16_t b); + uint32_t sbc32( uint32_t a, uint32_t b); + uint8_t sub8( uint8_t a, uint8_t b); + uint16_t sub16( uint16_t a, uint16_t b); + uint32_t sub32( uint32_t a, uint32_t b); + uint8_t and8( uint8_t a, uint8_t b); + uint16_t and16( uint16_t a, uint16_t b); + uint32_t and32( uint32_t a, uint32_t b); + uint8_t or8( uint8_t a, uint8_t b); + uint16_t or16( uint16_t a, uint16_t b); + uint32_t or32( uint32_t a, uint32_t b); + uint8_t xor8( uint8_t a, uint8_t b); + uint16_t xor16( uint16_t a, uint16_t b); + uint32_t xor32( uint32_t a, uint32_t b); + void ldcf8( uint8_t a, uint8_t b ); + void ldcf16( uint8_t a, uint8_t b ); + void andcf8( uint8_t a, uint8_t b ); + void andcf16( uint8_t a, uint8_t b ); + void orcf8( uint8_t a, uint8_t b ); + void orcf16( uint8_t a, uint8_t b ); + void xorcf8( uint8_t a, uint8_t b ); + void xorcf16( uint8_t a, uint8_t b ); + uint8_t rl8( uint8_t a, uint8_t s ); + uint16_t rl16( uint16_t a, uint8_t s ); + uint32_t rl32( uint32_t a, uint8_t s ); + uint8_t rlc8( uint8_t a, uint8_t s ); + uint16_t rlc16( uint16_t a, uint8_t s ); + uint32_t rlc32( uint32_t a, uint8_t s ); + uint8_t rr8( uint8_t a, uint8_t s ); + uint16_t rr16( uint16_t a, uint8_t s ); + uint32_t rr32( uint32_t a, uint8_t s ); + uint8_t rrc8( uint8_t a, uint8_t s ); + uint16_t rrc16( uint16_t a, uint8_t s ); + uint32_t rrc32( uint32_t a, uint8_t s ); + uint8_t sla8( uint8_t a, uint8_t s ); + uint16_t sla16( uint16_t a, uint8_t s ); + uint32_t sla32( uint32_t a, uint8_t s ); + uint8_t sra8( uint8_t a, uint8_t s ); + uint16_t sra16( uint16_t a, uint8_t s ); + uint32_t sra32( uint32_t a, uint8_t s ); + uint8_t srl8( uint8_t a, uint8_t s ); + uint16_t srl16( uint16_t a, uint8_t s ); + uint32_t srl32( uint32_t a, uint8_t s ); + uint16_t div8( uint16_t a, uint8_t b ); + uint32_t div16( uint32_t a, uint16_t b ); + uint16_t divs8( int16_t a, int8_t b ); + uint32_t divs16( int32_t a, int16_t b ); void _ADCBMI(); void _ADCBMR(); void _ADCBRI(); @@ -636,7 +636,7 @@ class tmp95c061_device : public tlcs900h_device { public: // construction/destruction - tmp95c061_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmp95c061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_port1_read(device_t &device, _Object object) { return downcast(device).m_port1_read.set_callback(object); } @@ -674,8 +674,8 @@ protected: void update_porta(); private: - UINT8 m_to1; - UINT8 m_to3; + uint8_t m_to1; + uint8_t m_to3; // Port 1: 8 bit I/O. Shared with D8-D15 devcb_read8 m_port1_read; @@ -756,7 +756,7 @@ class tmp95c063_device : public tlcs900h_device { public: // construction/destruction - tmp95c063_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmp95c063_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( internal_r ); DECLARE_WRITE8_MEMBER( internal_w ); @@ -843,7 +843,7 @@ private: // Port C: 8 bit input only. Shared with analogue inputs devcb_read8 m_portc_read; - // Port D: 5 bit I/O. Shared with INT8 + // Port D: 5 bit I/O. Shared with int8_t devcb_read8 m_portd_read; devcb_write8 m_portd_write; diff --git a/src/devices/cpu/tms1000/tms0270.cpp b/src/devices/cpu/tms1000/tms0270.cpp index b38ce2c13b7..edb9512518d 100644 --- a/src/devices/cpu/tms1000/tms0270.cpp +++ b/src/devices/cpu/tms1000/tms0270.cpp @@ -32,7 +32,7 @@ ADDRESS_MAP_END // device definitions -tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms0980_cpu_device(mconfig, TMS0270, "TMS0270", tag, owner, clock, 16 /* o pins */, 16 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_144x4), "tms0270", __FILE__) , m_read_ctl(*this) , m_write_ctl(*this) @@ -145,14 +145,14 @@ void tms0270_cpu_device::dynamic_output() } } -UINT8 tms0270_cpu_device::read_k_input() +uint8_t tms0270_cpu_device::read_k_input() { // external: TMS5100 CTL port via SEG G,B,C,D if (m_chipsel) return (m_ctl_dir) ? m_ctl_out : m_read_ctl(0, 0xff) & 0xf; // standard K-input otherwise - UINT8 k = m_read_k(0, 0xff) & 0x1f; + uint8_t k = m_read_k(0, 0xff) & 0x1f; return (k & 0x10) ? 0xf : k; // the TMS0270 KF line asserts all K-inputs } diff --git a/src/devices/cpu/tms1000/tms0270.h b/src/devices/cpu/tms1000/tms0270.h index 5cac8c810ad..76bbd2f859b 100644 --- a/src/devices/cpu/tms1000/tms0270.h +++ b/src/devices/cpu/tms1000/tms0270.h @@ -26,7 +26,7 @@ class tms0270_cpu_device : public tms0980_cpu_device { public: - tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_read_ctl_callback(device_t &device, _Object object) { return downcast(device).m_read_ctl.set_callback(object); } @@ -40,8 +40,8 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; - virtual void write_o_output(UINT8 index) override { tms1k_base_device::write_o_output(index); } - virtual UINT8 read_k_input() override; + virtual void write_o_output(uint8_t index) override { tms1k_base_device::write_o_output(index); } + virtual uint8_t read_k_input() override; virtual void dynamic_output() override; virtual void op_setr() override; @@ -50,15 +50,15 @@ protected: private: // state specific to interface with TMS5100 - UINT16 m_r_prev; - UINT8 m_chipsel; - UINT8 m_ctl_out; - UINT8 m_ctl_dir; + uint16_t m_r_prev; + uint8_t m_chipsel; + uint8_t m_ctl_out; + uint8_t m_ctl_dir; int m_pdc; - UINT8 m_o_latch_low; - UINT8 m_o_latch; - UINT8 m_o_latch_prev; + uint8_t m_o_latch_low; + uint8_t m_o_latch; + uint8_t m_o_latch_prev; devcb_read8 m_read_ctl; devcb_write8 m_write_ctl; diff --git a/src/devices/cpu/tms1000/tms0970.cpp b/src/devices/cpu/tms1000/tms0970.cpp index 514b7e79111..96c60fe5183 100644 --- a/src/devices/cpu/tms1000/tms0970.cpp +++ b/src/devices/cpu/tms1000/tms0970.cpp @@ -36,19 +36,19 @@ ADDRESS_MAP_END // device definitions -tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1000_cpu_device(mconfig, TMS0970, "TMS0970", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms0970", __FILE__) { } -tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) +tms0970_cpu_device::tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) { } -tms0950_cpu_device::tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms0950_cpu_device::tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms0970_cpu_device(mconfig, TMS0950, "TMS0950", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms0950", __FILE__) { } -tms1990_cpu_device::tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1990_cpu_device::tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms0970_cpu_device(mconfig, TMS1990, "TMS1990", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1990", __FILE__) { } @@ -97,9 +97,9 @@ void tms0970_cpu_device::device_reset() // pre-decode instructionset m_fixed_decode.resize(0x100); - memset(&m_fixed_decode[0], 0, 0x100*sizeof(UINT32)); + memset(&m_fixed_decode[0], 0, 0x100*sizeof(uint32_t)); m_micro_decode.resize(0x100); - memset(&m_micro_decode[0], 0, 0x100*sizeof(UINT32)); + memset(&m_micro_decode[0], 0, 0x100*sizeof(uint32_t)); for (int op = 0; op < 0x100; op++) { @@ -108,26 +108,26 @@ void tms0970_cpu_device::device_reset() m_fixed_decode[op] = (op & 0x40) ? F_CALL: F_BR; // 5 output bits select a microinstruction index - UINT32 imask = m_ipla->read(op); - UINT8 msel = imask & 0x1f; + uint32_t imask = m_ipla->read(op); + uint8_t msel = imask & 0x1f; // but if (from bottom to top) term 1 is active and output bit 5 is 0, R2,R4-R7 directly select a microinstruction index if (imask & 0x40 && (imask & 0x20) == 0) msel = (op & 0xf) | (op >> 1 & 0x10); msel = BITSWAP8(msel,7,6,5,0,1,2,3,4); // lines are reversed - UINT32 mmask = m_mpla->read(msel); + uint32_t mmask = m_mpla->read(msel); mmask ^= 0x09fe; // invert active-negative // _____ _____ _____ _____ ______ _____ ______ _____ _____ - const UINT32 md[15] = { M_CKM, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_CIN, M_AUTA, M_AUTY, M_STO }; + const uint32_t md[15] = { M_CKM, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_CIN, M_AUTA, M_AUTY, M_STO }; for (int bit = 0; bit < 15; bit++) if (mmask & (1 << bit)) m_micro_decode[op] |= md[bit]; // the other ipla terms each select a fixed instruction - const UINT32 id[8] = { F_LDP, F_TDO, F_COMX, F_LDX, F_SBIT, F_RBIT, F_SETR, F_RETN }; + const uint32_t id[8] = { F_LDP, F_TDO, F_COMX, F_LDX, F_SBIT, F_RBIT, F_SETR, F_RETN }; for (int bit = 0; bit < 8; bit++) if (imask & (0x80 << bit)) @@ -137,7 +137,7 @@ void tms0970_cpu_device::device_reset() // i/o handling -void tms0970_cpu_device::write_o_output(UINT8 index) +void tms0970_cpu_device::write_o_output(uint8_t index) { m_o_index = index; m_o = m_spla->read(index); diff --git a/src/devices/cpu/tms1000/tms0970.h b/src/devices/cpu/tms1000/tms0970.h index 62cfb57c4e2..360e30a42cb 100644 --- a/src/devices/cpu/tms1000/tms0970.h +++ b/src/devices/cpu/tms1000/tms0970.h @@ -15,15 +15,15 @@ class tms0970_cpu_device : public tms1000_cpu_device { public: - tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + tms0970_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms0970_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); protected: // overrides virtual void device_reset() override; virtual machine_config_constructor device_mconfig_additions() const override; - virtual void write_o_output(UINT8 index) override; + virtual void write_o_output(uint8_t index) override; virtual void op_setr() override; virtual void op_tdo() override; @@ -32,7 +32,7 @@ protected: class tms0950_cpu_device : public tms0970_cpu_device { public: - tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms0950_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // overrides @@ -46,7 +46,7 @@ protected: class tms1990_cpu_device : public tms0970_cpu_device { public: - tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1990_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/tms1000/tms0980.cpp b/src/devices/cpu/tms1000/tms0980.cpp index 31baf2ebb9b..523844b6366 100644 --- a/src/devices/cpu/tms1000/tms0980.cpp +++ b/src/devices/cpu/tms1000/tms0980.cpp @@ -40,15 +40,15 @@ ADDRESS_MAP_END // device definitions -tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms0970_cpu_device(mconfig, TMS0980, "TMS0980", tag, owner, clock, 8 /* o pins */, 9 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_144x4), "tms0980", __FILE__) { } -tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) +tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : tms0970_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) { } -tms1980_cpu_device::tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1980_cpu_device::tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms0980_cpu_device(mconfig, TMS1980, "TMS1980", tag, owner, clock, 7, 10, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_144x4), "tms1980", __FILE__) { } @@ -90,7 +90,7 @@ machine_config_constructor tms1980_cpu_device::device_mconfig_additions() const // disasm -offs_t tms0980_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms0980_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(tms0980); return CPU_DISASSEMBLE_NAME(tms0980)(this, buffer, pc, oprom, opram, options); @@ -98,13 +98,13 @@ offs_t tms0980_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UIN // device_reset -UINT32 tms0980_cpu_device::decode_fixed(UINT16 op) +uint32_t tms0980_cpu_device::decode_fixed(uint16_t op) { - UINT32 decode = 0; - UINT32 mask = m_ipla->read(op); + uint32_t decode = 0; + uint32_t mask = m_ipla->read(op); // 1 line per PLA row, no OR-mask - const UINT32 id[15] = { F_LDP, F_SBL, F_OFF, F_RBIT, F_SAL, F_XDA, F_REAC, F_SETR, F_RETN, F_SBIT, F_TDO, F_COMX8, F_COMX, F_LDX, F_SEAC }; + const uint32_t id[15] = { F_LDP, F_SBL, F_OFF, F_RBIT, F_SAL, F_XDA, F_REAC, F_SETR, F_RETN, F_SBIT, F_TDO, F_COMX8, F_COMX, F_LDX, F_SEAC }; for (int bit = 0; bit < 15; bit++) if (mask & (0x80 << bit)) @@ -113,17 +113,17 @@ UINT32 tms0980_cpu_device::decode_fixed(UINT16 op) return decode; } -UINT32 tms0980_cpu_device::decode_micro(UINT8 sel) +uint32_t tms0980_cpu_device::decode_micro(uint8_t sel) { - UINT32 decode = 0; + uint32_t decode = 0; sel = BITSWAP8(sel,7,6,0,1,2,3,4,5); // lines are reversed - UINT32 mask = m_mpla->read(sel); + uint32_t mask = m_mpla->read(sel); mask ^= 0x43fc3; // invert active-negative // M_RSTR is specific to TMS02x0/TMS1980, it redirects to F_RSTR // M_UNK1 is specific to TMS0270, unknown/unused yet and apparently not connected on every TMS0270 // _______ ______ _____ _____ _____ _____ ______ _____ ______ _____ _____ - const UINT32 md[22] = { M_NDMTP, M_DMTP, M_AUTY, M_AUTA, M_CKM, M_SSE, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_SSS, M_CME, M_CIN, M_STO, M_RSTR, M_UNK1 }; + const uint32_t md[22] = { M_NDMTP, M_DMTP, M_AUTY, M_AUTA, M_CKM, M_SSE, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_SSS, M_CME, M_CIN, M_STO, M_RSTR, M_UNK1 }; for (int bit = 0; bit < 22 && bit < m_mpla->outputs(); bit++) if (mask & (1 << bit)) @@ -139,11 +139,11 @@ void tms0980_cpu_device::device_reset() // pre-decode instructionset m_fixed_decode.resize(0x200); - memset(&m_fixed_decode[0], 0, 0x200*sizeof(UINT32)); + memset(&m_fixed_decode[0], 0, 0x200*sizeof(uint32_t)); m_micro_decode.resize(0x200); - memset(&m_micro_decode[0], 0, 0x200*sizeof(UINT32)); + memset(&m_micro_decode[0], 0, 0x200*sizeof(uint32_t)); - for (UINT16 op = 0; op < 0x200; op++) + for (uint16_t op = 0; op < 0x200; op++) { // upper half of the opcodes is always branch/call if (op & 0x100) @@ -159,7 +159,7 @@ void tms0980_cpu_device::device_reset() // like on TMS0970, one of the terms directly select a microinstruction index (via R4-R8), // but it can't be pre-determined when it's active m_micro_direct.resize(0x40); - memset(&m_micro_decode[0], 0, 0x40*sizeof(UINT32)); + memset(&m_micro_decode[0], 0, 0x40*sizeof(uint32_t)); for (int op = 0; op < 0x40; op++) m_micro_direct[op] = decode_micro(op); @@ -167,7 +167,7 @@ void tms0980_cpu_device::device_reset() // program counter/opcode decode -UINT32 tms0980_cpu_device::read_micro() +uint32_t tms0980_cpu_device::read_micro() { // if ipla term 0 is active, R4-R8 directly select a microinstruction index when R0 or R0^BL is 0 int r0 = m_opcode >> 8 & 1; @@ -195,10 +195,10 @@ void tms0980_cpu_device::read_opcode() // i/o handling -UINT8 tms0980_cpu_device::read_k_input() +uint8_t tms0980_cpu_device::read_k_input() { - UINT8 k = m_read_k(0, 0xff) & 0x1f; - UINT8 k3 = (k & 0x10) ? 3: 0; // the TMS0980 K3 line is simply K1|K2 + uint8_t k = m_read_k(0, 0xff) & 0x1f; + uint8_t k3 = (k & 0x10) ? 3: 0; // the TMS0980 K3 line is simply K1|K2 return (k & 0xf) | k3; } diff --git a/src/devices/cpu/tms1000/tms0980.h b/src/devices/cpu/tms1000/tms0980.h index baaa24e01a6..921c585769b 100644 --- a/src/devices/cpu/tms1000/tms0980.h +++ b/src/devices/cpu/tms1000/tms0980.h @@ -15,24 +15,24 @@ class tms0980_cpu_device : public tms0970_cpu_device { public: - tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + tms0980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms0980_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); protected: // overrides - virtual UINT32 decode_fixed(UINT16 op); - virtual UINT32 decode_micro(UINT8 sel); + virtual uint32_t decode_fixed(uint16_t op); + virtual uint32_t decode_micro(uint8_t sel); virtual void device_reset() override; virtual machine_config_constructor device_mconfig_additions() const override; - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual UINT8 read_k_input() override; + virtual uint8_t read_k_input() override; virtual void set_cki_bus() override; - virtual UINT32 read_micro(); + virtual uint32_t read_micro(); virtual void read_opcode() override; virtual void op_comx() override; @@ -41,14 +41,14 @@ protected: class tms1980_cpu_device : public tms0980_cpu_device { public: - tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // overrides virtual machine_config_constructor device_mconfig_additions() const override; - virtual void write_o_output(UINT8 index) override { tms1k_base_device::write_o_output(index); } - virtual UINT8 read_k_input() override { return tms1k_base_device::read_k_input(); } + virtual void write_o_output(uint8_t index) override { tms1k_base_device::write_o_output(index); } + virtual uint8_t read_k_input() override { return tms1k_base_device::read_k_input(); } virtual void op_setr() override { tms1k_base_device::op_setr(); } virtual void op_tdo() override; diff --git a/src/devices/cpu/tms1000/tms1000.cpp b/src/devices/cpu/tms1000/tms1000.cpp index 33edca13eba..5948d9753ff 100644 --- a/src/devices/cpu/tms1000/tms1000.cpp +++ b/src/devices/cpu/tms1000/tms1000.cpp @@ -47,31 +47,31 @@ ADDRESS_MAP_END // device definitions -tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1k_base_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__) { } -tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) +tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : tms1k_base_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) { } -tms1070_cpu_device::tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1070_cpu_device::tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1000_cpu_device(mconfig, TMS1070, "TMS1070", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1070", __FILE__) { } -tms1040_cpu_device::tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1040_cpu_device::tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1000_cpu_device(mconfig, TMS1040, "TMS1040", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1040", __FILE__) { } -tms1200_cpu_device::tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1200_cpu_device::tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1000_cpu_device(mconfig, TMS1200, "TMS1200", tag, owner, clock, 8, 13, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1200", __FILE__) { } -tms1700_cpu_device::tms1700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1700_cpu_device::tms1700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1000_cpu_device(mconfig, TMS1700, "TMS1700", tag, owner, clock, 8, 9, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_9bit_8), 6, ADDRESS_MAP_NAME(data_32x4), "tms1700", __FILE__) { } -tms1730_cpu_device::tms1730_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1730_cpu_device::tms1730_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1000_cpu_device(mconfig, TMS1730, "TMS1730", tag, owner, clock, 8, 9, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_9bit_8), 6, ADDRESS_MAP_NAME(data_32x4), "tms1730", __FILE__) { } @@ -93,7 +93,7 @@ machine_config_constructor tms1000_cpu_device::device_mconfig_additions() const // disasm -offs_t tms1000_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms1000_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(tms1000); return CPU_DISASSEMBLE_NAME(tms1000)(this, buffer, pc, oprom, opram, options); @@ -108,15 +108,15 @@ void tms1000_cpu_device::device_reset() // pre-decode instructionset m_fixed_decode.resize(0x100); - memset(&m_fixed_decode[0], 0, 0x100*sizeof(UINT32)); + memset(&m_fixed_decode[0], 0, 0x100*sizeof(uint32_t)); m_micro_decode.resize(0x100); - memset(&m_micro_decode[0], 0, 0x100*sizeof(UINT32)); + memset(&m_micro_decode[0], 0, 0x100*sizeof(uint32_t)); for (int op = 0; op < 0x100; op++) { // _____ _____ ______ _____ ______ _____ _____ _____ _____ - const UINT32 md[16] = { M_STSL, M_AUTY, M_AUTA, M_CIN, M_C8, M_NE, M_CKN, M_15TN, M_MTN, M_NATN, M_ATN, M_MTP, M_YTP, M_CKP, M_CKM, M_STO }; - UINT16 mask = m_mpla->read(op); + const uint32_t md[16] = { M_STSL, M_AUTY, M_AUTA, M_CIN, M_C8, M_NE, M_CKN, M_15TN, M_MTN, M_NATN, M_ATN, M_MTP, M_YTP, M_CKP, M_CKM, M_STO }; + uint16_t mask = m_mpla->read(op); mask ^= 0x3fc8; // invert active-negative for (int bit = 0; bit < 16; bit++) diff --git a/src/devices/cpu/tms1000/tms1000.h b/src/devices/cpu/tms1000/tms1000.h index af8dc3fd7ee..7cb5ba66ac6 100644 --- a/src/devices/cpu/tms1000/tms1000.h +++ b/src/devices/cpu/tms1000/tms1000.h @@ -15,8 +15,8 @@ class tms1000_cpu_device : public tms1k_base_device { public: - tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); protected: // overrides @@ -24,39 +24,39 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; class tms1070_cpu_device : public tms1000_cpu_device { public: - tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1070_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms1040_cpu_device : public tms1000_cpu_device { public: - tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1040_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms1200_cpu_device : public tms1000_cpu_device { public: - tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1200_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms1700_cpu_device : public tms1000_cpu_device { public: - tms1700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms1730_cpu_device : public tms1000_cpu_device { public: - tms1730_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1730_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/tms1000/tms1100.cpp b/src/devices/cpu/tms1000/tms1100.cpp index 042a0bcf6bf..6ef15a98043 100644 --- a/src/devices/cpu/tms1000/tms1100.cpp +++ b/src/devices/cpu/tms1000/tms1100.cpp @@ -27,29 +27,29 @@ ADDRESS_MAP_END // device definitions -tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1000_cpu_device(mconfig, TMS1100, "TMS1100", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 3 /* x width */, 11 /* prg width */, ADDRESS_MAP_NAME(program_11bit_8), 7 /* data width */, ADDRESS_MAP_NAME(data_128x4), "tms1100", __FILE__) { } -tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) +tms1100_cpu_device::tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : tms1000_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) { } -tms1170_cpu_device::tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1170_cpu_device::tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1100_cpu_device(mconfig, TMS1170, "TMS1170", tag, owner, clock, 8, 11, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1170", __FILE__) { } -tms1300_cpu_device::tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1300_cpu_device::tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1100_cpu_device(mconfig, TMS1300, "TMS1300", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1300", __FILE__) { } -tms1370_cpu_device::tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1370_cpu_device::tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1100_cpu_device(mconfig, TMS1370, "TMS1370", tag, owner, clock, 8, 16, 6, 8, 3, 11, ADDRESS_MAP_NAME(program_11bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1370", __FILE__) { } // disasm -offs_t tms1100_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms1100_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(tms1100); return CPU_DISASSEMBLE_NAME(tms1100)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/tms1000/tms1100.h b/src/devices/cpu/tms1000/tms1100.h index 2a78af0f283..e57f880df12 100644 --- a/src/devices/cpu/tms1000/tms1100.h +++ b/src/devices/cpu/tms1000/tms1100.h @@ -15,14 +15,14 @@ class tms1100_cpu_device : public tms1000_cpu_device { public: - tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + tms1100_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms1100_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); protected: // overrides virtual void device_reset() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void op_setr() override; virtual void op_rstr() override; @@ -31,19 +31,19 @@ protected: class tms1170_cpu_device : public tms1100_cpu_device { public: - tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1170_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms1300_cpu_device : public tms1100_cpu_device { public: - tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1300_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms1370_cpu_device : public tms1100_cpu_device { public: - tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1370_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/tms1000/tms1400.cpp b/src/devices/cpu/tms1000/tms1400.cpp index e9246b18685..550911a9752 100644 --- a/src/devices/cpu/tms1000/tms1400.cpp +++ b/src/devices/cpu/tms1000/tms1400.cpp @@ -36,28 +36,28 @@ ADDRESS_MAP_END // device definitions -tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1100_cpu_device(mconfig, TMS1400, "TMS1400", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 3 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_12bit_8), 7 /* data width */, ADDRESS_MAP_NAME(data_128x4), "tms1400", __FILE__) { } -tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) +tms1400_cpu_device::tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : tms1100_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) { } -tms1470_cpu_device::tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1470_cpu_device::tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1400_cpu_device(mconfig, TMS1470, "TMS1470", tag, owner, clock, 8, 10, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1470", __FILE__) { } -tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1400_cpu_device(mconfig, TMS1600, "TMS1600", tag, owner, clock, 8, 16, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1600", __FILE__) { } -tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) +tms1600_cpu_device::tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : tms1400_cpu_device(mconfig, type, name, tag, owner, clock, o_pins, r_pins, pc_bits, byte_bits, x_bits, prgwidth, program, datawidth, data, shortname, source) { } -tms1670_cpu_device::tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1670_cpu_device::tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1600_cpu_device(mconfig, TMS1670, "TMS1670", tag, owner, clock, 8, 16, 6, 8, 3, 12, ADDRESS_MAP_NAME(program_12bit_8), 7, ADDRESS_MAP_NAME(data_128x4), "tms1670", __FILE__) { } diff --git a/src/devices/cpu/tms1000/tms1400.h b/src/devices/cpu/tms1000/tms1400.h index 0b73babc223..1bfb59a821e 100644 --- a/src/devices/cpu/tms1000/tms1400.h +++ b/src/devices/cpu/tms1000/tms1400.h @@ -15,8 +15,8 @@ class tms1400_cpu_device : public tms1100_cpu_device { public: - tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + tms1400_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms1400_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); protected: // overrides @@ -34,21 +34,21 @@ protected: class tms1470_cpu_device : public tms1400_cpu_device { public: - tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1470_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms1600_cpu_device : public tms1400_cpu_device { public: - tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); + tms1600_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms1600_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source); }; class tms1670_cpu_device : public tms1600_cpu_device { public: - tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1670_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/tms1000/tms1k_base.cpp b/src/devices/cpu/tms1000/tms1k_base.cpp index ef5f41f0546..b8afaa75246 100644 --- a/src/devices/cpu/tms1000/tms1k_base.cpp +++ b/src/devices/cpu/tms1000/tms1k_base.cpp @@ -274,7 +274,7 @@ void tms1k_base_device::read_opcode() // i/o handling //------------------------------------------------- -void tms1k_base_device::write_o_output(UINT8 index) +void tms1k_base_device::write_o_output(uint8_t index) { // a hardcoded table is supported if the output pla is unknown m_o_index = index; @@ -282,7 +282,7 @@ void tms1k_base_device::write_o_output(UINT8 index) m_write_o(0, m_o & m_o_mask, 0xffff); } -UINT8 tms1k_base_device::read_k_input() +uint8_t tms1k_base_device::read_k_input() { // K1,2,4,8 (KC test pin is not emulated) return m_read_k(0, 0xff) & 0xf; @@ -343,7 +343,7 @@ void tms1k_base_device::op_call() // CALL/CALLL: conditional call if (m_status) { - UINT8 prev_pa = m_pa; + uint8_t prev_pa = m_pa; if (m_clatch == 0) { diff --git a/src/devices/cpu/tms1000/tms1k_base.h b/src/devices/cpu/tms1000/tms1k_base.h index aecbd041557..c4fdb99f933 100644 --- a/src/devices/cpu/tms1000/tms1k_base.h +++ b/src/devices/cpu/tms1000/tms1k_base.h @@ -84,7 +84,7 @@ class tms1k_base_device : public cpu_device { public: // construction/destruction - tms1k_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + tms1k_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t o_pins, uint8_t r_pins, uint8_t pc_bits, uint8_t byte_bits, uint8_t x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, byte_bits > 8 ? 16 : 8, prgwidth, 0, program) , m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data) @@ -109,9 +109,9 @@ public: template static devcb_base &set_write_o_callback(device_t &device, _Object object) { return downcast(device).m_write_o.set_callback(object); } template static devcb_base &set_write_r_callback(device_t &device, _Object object) { return downcast(device).m_write_r.set_callback(object); } template static devcb_base &set_power_off_callback(device_t &device, _Object object) { return downcast(device).m_power_off.set_callback(object); } - static void set_output_pla(device_t &device, const UINT16 *output_pla) { downcast(device).m_output_pla_table = output_pla; } + static void set_output_pla(device_t &device, const uint16_t *output_pla) { downcast(device).m_output_pla_table = output_pla; } - UINT8 debug_peek_o_index() { return m_o_index; } // get output PLA index, for debugging (don't use in emulation) + uint8_t debug_peek_o_index() { return m_o_index; } // get output PLA index, for debugging (don't use in emulation) // microinstructions enum @@ -177,25 +177,25 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 6; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 6; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 1; } // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; void next_pc(); - virtual void write_o_output(UINT8 index); - virtual UINT8 read_k_input(); + virtual void write_o_output(uint8_t index); + virtual uint8_t read_k_input(); virtual void set_cki_bus(); virtual void dynamic_output() { ; } // not used by default virtual void read_opcode(); @@ -232,70 +232,70 @@ protected: optional_device m_opla; optional_device m_spla; - UINT8 m_pc; // 6 or 7-bit program counter - UINT32 m_sr; // 6 or 7-bit subroutine return register(s) - UINT8 m_pa; // 4-bit page address register - UINT8 m_pb; // 4-bit page buffer register - UINT16 m_ps; // 4-bit page subroutine register(s) - UINT8 m_a; // 4-bit accumulator - UINT8 m_x; // 2,3,or 4-bit RAM X register - UINT8 m_y; // 4-bit RAM Y register - UINT8 m_ca; // chapter address register - UINT8 m_cb; // chapter buffer register - UINT16 m_cs; // chapter subroutine register(s) - UINT16 m_r; - UINT16 m_o; - UINT8 m_cki_bus; - UINT8 m_c4; - UINT8 m_p; // 4-bit adder p(lus)-input - UINT8 m_n; // 4-bit adder n(egative)-input - UINT8 m_adder_out; // adder result - UINT8 m_carry_in; // adder carry-in bit - UINT8 m_carry_out; // adder carry-out bit - UINT8 m_status; - UINT8 m_status_latch; - UINT8 m_eac; // end around carry bit - UINT8 m_clatch; // call latch bit(s) - UINT8 m_add; // add latch bit - UINT8 m_bl; // branch latch bit - - UINT8 m_ram_in; - UINT8 m_dam_in; + uint8_t m_pc; // 6 or 7-bit program counter + uint32_t m_sr; // 6 or 7-bit subroutine return register(s) + uint8_t m_pa; // 4-bit page address register + uint8_t m_pb; // 4-bit page buffer register + uint16_t m_ps; // 4-bit page subroutine register(s) + uint8_t m_a; // 4-bit accumulator + uint8_t m_x; // 2,3,or 4-bit RAM X register + uint8_t m_y; // 4-bit RAM Y register + uint8_t m_ca; // chapter address register + uint8_t m_cb; // chapter buffer register + uint16_t m_cs; // chapter subroutine register(s) + uint16_t m_r; + uint16_t m_o; + uint8_t m_cki_bus; + uint8_t m_c4; + uint8_t m_p; // 4-bit adder p(lus)-input + uint8_t m_n; // 4-bit adder n(egative)-input + uint8_t m_adder_out; // adder result + uint8_t m_carry_in; // adder carry-in bit + uint8_t m_carry_out; // adder carry-out bit + uint8_t m_status; + uint8_t m_status_latch; + uint8_t m_eac; // end around carry bit + uint8_t m_clatch; // call latch bit(s) + uint8_t m_add; // add latch bit + uint8_t m_bl; // branch latch bit + + uint8_t m_ram_in; + uint8_t m_dam_in; int m_ram_out; // signed! - UINT8 m_ram_address; - UINT16 m_rom_address; - UINT16 m_opcode; - UINT32 m_fixed; - UINT32 m_micro; + uint8_t m_ram_address; + uint16_t m_rom_address; + uint16_t m_opcode; + uint32_t m_fixed; + uint32_t m_micro; int m_subcycle; int m_icount; - UINT8 m_o_index; + uint8_t m_o_index; - UINT8 m_o_pins; // how many O pins - UINT8 m_r_pins; // how many R pins - UINT8 m_pc_bits; // how many program counter bits - UINT8 m_byte_bits; // how many bits per 'byte' - UINT8 m_x_bits; // how many X register bits + uint8_t m_o_pins; // how many O pins + uint8_t m_r_pins; // how many R pins + uint8_t m_pc_bits; // how many program counter bits + uint8_t m_byte_bits; // how many bits per 'byte' + uint8_t m_x_bits; // how many X register bits address_space *m_program; address_space *m_data; - const UINT16 *m_output_pla_table; + const uint16_t *m_output_pla_table; devcb_read8 m_read_k; devcb_write16 m_write_o; devcb_write16 m_write_r; devcb_write_line m_power_off; - UINT32 m_o_mask; - UINT32 m_r_mask; - UINT32 m_k_mask; - UINT32 m_pc_mask; - UINT32 m_x_mask; + uint32_t m_o_mask; + uint32_t m_r_mask; + uint32_t m_k_mask; + uint32_t m_pc_mask; + uint32_t m_x_mask; // lookup tables - std::vector m_fixed_decode; - std::vector m_micro_decode; - std::vector m_micro_direct; + std::vector m_fixed_decode; + std::vector m_micro_decode; + std::vector m_micro_direct; }; diff --git a/src/devices/cpu/tms1000/tms1k_dasm.cpp b/src/devices/cpu/tms1000/tms1k_dasm.cpp index 291b31ded95..8b2befad62a 100644 --- a/src/devices/cpu/tms1000/tms1k_dasm.cpp +++ b/src/devices/cpu/tms1000/tms1k_dasm.cpp @@ -39,7 +39,7 @@ static const char *const s_mnemonic[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 s_flags[] = +static const uint32_t s_flags[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _OVER, 0, @@ -57,7 +57,7 @@ enum e_addressing zB0 = 0, zI2, zI3, zI4, zB7 }; -static const UINT8 s_addressing[] = +static const uint8_t s_addressing[] = { zB0, zB0, zB0, zB0, zI4, zI4, zI4, zI4, zB0, zB0, zB7, zB7, zB0, @@ -73,7 +73,7 @@ static const UINT8 s_addressing[] = // opcode luts -static const UINT8 tms1000_mnemonic[256] = +static const uint8_t tms1000_mnemonic[256] = { /* 0x00 */ zCOMX, zA8AAC, zYNEA, zTAM, zTAMZA, zA10AAC, zA6AAC, zDAN, zTKA, zKNEZ, zTDO, zCLO, zRSTR, zSETR, zIA, zRETN, // 0 @@ -97,7 +97,7 @@ static const UINT8 tms1000_mnemonic[256] = }; -static const UINT8 tms1100_mnemonic[256] = +static const uint8_t tms1100_mnemonic[256] = { /* 0x00 */ zMNEA, zALEM, zYNEA, zXMA, zDYN, zIYC, zAMAAC, zDMAN, zTKA, zCOMX, zTDO, zCOMC, zRSTR, zSETR, zKNEZ, zRETN, // 0 @@ -121,7 +121,7 @@ static const UINT8 tms1100_mnemonic[256] = }; -static const UINT8 tms0980_mnemonic[512] = +static const uint8_t tms0980_mnemonic[512] = { /* 0x000 */ zCOMX, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN, zTKA, zMNEA, zTKM, 0, 0, zSETR, zKNEZ, 0, // 0 @@ -163,7 +163,7 @@ static const UINT8 tms0980_mnemonic[512] = }; -static const UINT8 tp0320_mnemonic[512] = +static const uint8_t tp0320_mnemonic[512] = { /* 0x000 */ 0, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN, zTKA, zMNEA, zTKM, 0, 0, zSETR, zKNEZ, 0, // 0 @@ -208,31 +208,31 @@ static const UINT8 tp0320_mnemonic[512] = // disasm -static const UINT8 i2_value[4] = +static const uint8_t i2_value[4] = { 0, 2, 1, 3 }; -static const UINT8 i3_value[8] = +static const uint8_t i3_value[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; -static const UINT8 i4_value[16] = +static const uint8_t i4_value[16] = { 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf }; -static offs_t tms1k_dasm(char *dst, const UINT8 *oprom, const UINT8 *lut_mnemonic, UINT16 opcode_mask) +static offs_t tms1k_dasm(char *dst, const uint8_t *oprom, const uint8_t *lut_mnemonic, uint16_t opcode_mask) { // get current opcode int pos = 0; - UINT16 op = oprom[pos++]; + uint16_t op = oprom[pos++]; if (opcode_mask & 0x100) op = (op << 8 | oprom[pos++]) & 0x1ff; // convert to mnemonic/param - UINT16 instr = lut_mnemonic[op]; + uint16_t instr = lut_mnemonic[op]; dst += sprintf(dst, "%-8s ", s_mnemonic[instr]); switch( s_addressing[instr] ) diff --git a/src/devices/cpu/tms1000/tp0320.cpp b/src/devices/cpu/tms1000/tp0320.cpp index b58c9e1a8ed..ab33c3788e2 100644 --- a/src/devices/cpu/tms1000/tp0320.cpp +++ b/src/devices/cpu/tms1000/tp0320.cpp @@ -36,7 +36,7 @@ ADDRESS_MAP_END // device definitions -tp0320_cpu_device::tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tp0320_cpu_device::tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms0980_cpu_device(mconfig, TP0320, "TP0320", tag, owner, clock, 7 /* o pins */, 10 /* r pins */, 7 /* pc bits */, 9 /* byte width */, 4 /* x width */, 12 /* prg width */, ADDRESS_MAP_NAME(program_11bit_9), 8 /* data width */, ADDRESS_MAP_NAME(data_192x4), "tp0320", __FILE__) { } @@ -58,7 +58,7 @@ machine_config_constructor tp0320_cpu_device::device_mconfig_additions() const // disasm -offs_t tp0320_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tp0320_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(tp0320); return CPU_DISASSEMBLE_NAME(tp0320)(this, buffer, pc, oprom, opram, options); @@ -66,16 +66,16 @@ offs_t tp0320_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT // device_reset -UINT32 tp0320_cpu_device::decode_micro(UINT8 sel) +uint32_t tp0320_cpu_device::decode_micro(uint8_t sel) { - UINT32 decode = 0; + uint32_t decode = 0; sel = BITSWAP8(sel,7,6,0,1,2,3,4,5); // lines are reversed - UINT32 mask = m_mpla->read(sel); + uint32_t mask = m_mpla->read(sel); mask ^= 0x0bff0; // invert active-negative // _____ _______ ______ _____ _____ ______ _____ _____ ______ _____ _____ - const UINT32 md[22] = { M_AUTA, M_AUTY, M_SSS, M_STO, M_YTP, M_NDMTP, M_DMTP, M_MTP, M_CKP, M_15TN, M_CKN, M_MTN, M_NATN, M_ATN, M_CME, M_CIN, M_SSE, M_CKM, M_NE, M_C8, M_SETR, M_RSTR }; + const uint32_t md[22] = { M_AUTA, M_AUTY, M_SSS, M_STO, M_YTP, M_NDMTP, M_DMTP, M_MTP, M_CKP, M_15TN, M_CKN, M_MTN, M_NATN, M_ATN, M_CME, M_CIN, M_SSE, M_CKM, M_NE, M_C8, M_SETR, M_RSTR }; for (int bit = 0; bit < 22 && bit < m_mpla->outputs(); bit++) if (mask & (1 << bit)) diff --git a/src/devices/cpu/tms1000/tp0320.h b/src/devices/cpu/tms1000/tp0320.h index 517b748927f..a85fc253cc4 100644 --- a/src/devices/cpu/tms1000/tp0320.h +++ b/src/devices/cpu/tms1000/tp0320.h @@ -15,16 +15,16 @@ class tp0320_cpu_device : public tms0980_cpu_device { public: - tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tp0320_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // overrides //virtual void device_start() override; - virtual UINT32 decode_fixed(UINT16 op) override { return 0; } // not yet - virtual UINT32 decode_micro(UINT8 sel) override; + virtual uint32_t decode_fixed(uint16_t op) override { return 0; } // not yet + virtual uint32_t decode_micro(uint8_t sel) override; virtual void device_reset() override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual machine_config_constructor device_mconfig_additions() const override; }; diff --git a/src/devices/cpu/tms32010/32010dsm.cpp b/src/devices/cpu/tms32010/32010dsm.cpp index 67f598d2b85..bea830175d6 100644 --- a/src/devices/cpu/tms32010/32010dsm.cpp +++ b/src/devices/cpu/tms32010/32010dsm.cpp @@ -208,7 +208,7 @@ static void InitDasm32010(void) fatalerror("not enough bits in encoding '%s %s' %d\n", ops[0],ops[1],bit); } - while (isspace((UINT8)*p)) p++; + while (isspace((uint8_t)*p)) p++; if (*p) Op[i].extcode = *p; Op[i].bits = bits; Op[i].mask = mask; @@ -224,7 +224,7 @@ static void InitDasm32010(void) CPU_DISASSEMBLE( tms32010 ) { - UINT32 flags = 0; + uint32_t flags = 0; int a, b, d, k, m, n, p, r, s, w; /* these can all be filled in by parsing an instruction */ int i; int op; diff --git a/src/devices/cpu/tms32010/tms32010.cpp b/src/devices/cpu/tms32010/tms32010.cpp index 146d95ab113..e5108cb0c7e 100644 --- a/src/devices/cpu/tms32010/tms32010.cpp +++ b/src/devices/cpu/tms32010/tms32010.cpp @@ -97,7 +97,7 @@ static ADDRESS_MAP_START( tms32015_ram, AS_DATA, 16, tms32010_device ) ADDRESS_MAP_END -tms32010_device::tms32010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32010_device::tms32010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, TMS32010, "TMS32010", tag, owner, clock, "tms32010", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 16, 12, -1) , m_data_config("data", ENDIANNESS_BIG, 16, 8, -1, ADDRESS_MAP_NAME(tms32010_ram)) @@ -108,7 +108,7 @@ tms32010_device::tms32010_device(const machine_config &mconfig, const char *tag, } -tms32010_device::tms32010_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, int addr_mask) +tms32010_device::tms32010_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, int addr_mask) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 16, 12, -1) , m_data_config("data", ENDIANNESS_BIG, 16, 8, -1, ADDRESS_MAP_NAME(tms32015_ram)) @@ -119,19 +119,19 @@ tms32010_device::tms32010_device(const machine_config &mconfig, device_type type } -tms32015_device::tms32015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32015_device::tms32015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms32010_device(mconfig, TMS32015, "TMS32015", tag, owner, clock, "tms32015", __FILE__, 0x0fff) { } -tms32016_device::tms32016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32016_device::tms32016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms32010_device(mconfig, TMS32016, "TMS32016", tag, owner, clock, "tms32016", __FILE__, 0xffff) { } -offs_t tms32010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms32010_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms32010 ); return CPU_DISASSEMBLE_NAME(tms32010)(this, buffer, pc, oprom, opram, options); @@ -225,36 +225,36 @@ offs_t tms32010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 * Shortcuts ************************************************************************/ -void tms32010_device::CLR(UINT16 flag) { m_STR &= ~flag; m_STR |= 0x1efe; } -void tms32010_device::SET_FLAG(UINT16 flag) { m_STR |= flag; m_STR |= 0x1efe; } +void tms32010_device::CLR(uint16_t flag) { m_STR &= ~flag; m_STR |= 0x1efe; } +void tms32010_device::SET_FLAG(uint16_t flag) { m_STR |= flag; m_STR |= 0x1efe; } -void tms32010_device::CALCULATE_ADD_OVERFLOW(INT32 addval) +void tms32010_device::CALCULATE_ADD_OVERFLOW(int32_t addval) { - if ((INT32)(~(m_oldacc.d ^ addval) & (m_oldacc.d ^ m_ACC.d)) < 0) { + if ((int32_t)(~(m_oldacc.d ^ addval) & (m_oldacc.d ^ m_ACC.d)) < 0) { SET_FLAG(OV_FLAG); if (OVM) - m_ACC.d = ((INT32)m_oldacc.d < 0) ? 0x80000000 : 0x7fffffff; + m_ACC.d = ((int32_t)m_oldacc.d < 0) ? 0x80000000 : 0x7fffffff; } } -void tms32010_device::CALCULATE_SUB_OVERFLOW(INT32 subval) +void tms32010_device::CALCULATE_SUB_OVERFLOW(int32_t subval) { - if ((INT32)((m_oldacc.d ^ subval) & (m_oldacc.d ^ m_ACC.d)) < 0) { + if ((int32_t)((m_oldacc.d ^ subval) & (m_oldacc.d ^ m_ACC.d)) < 0) { SET_FLAG(OV_FLAG); if (OVM) - m_ACC.d = ((INT32)m_oldacc.d < 0) ? 0x80000000 : 0x7fffffff; + m_ACC.d = ((int32_t)m_oldacc.d < 0) ? 0x80000000 : 0x7fffffff; } } -UINT16 tms32010_device::POP_STACK() +uint16_t tms32010_device::POP_STACK() { - UINT16 data = m_STACK[3]; + uint16_t data = m_STACK[3]; m_STACK[3] = m_STACK[2]; m_STACK[2] = m_STACK[1]; m_STACK[1] = m_STACK[0]; return (data & m_addr_mask); } -void tms32010_device::PUSH_STACK(UINT16 data) +void tms32010_device::PUSH_STACK(uint16_t data) { m_STACK[0] = m_STACK[1]; m_STACK[1] = m_STACK[2]; @@ -265,7 +265,7 @@ void tms32010_device::PUSH_STACK(UINT16 data) void tms32010_device::UPDATE_AR() { if (m_opcode.b.l & 0x30) { - UINT16 tmpAR = m_AR[ARP]; + uint16_t tmpAR = m_AR[ARP]; if (m_opcode.b.l & 0x20) tmpAR++ ; if (m_opcode.b.l & 0x10) tmpAR-- ; m_AR[ARP] = (m_AR[ARP] & 0xfe00) | (tmpAR & 0x01ff); @@ -280,15 +280,15 @@ void tms32010_device::UPDATE_ARP() } -void tms32010_device::getdata(UINT8 shift,UINT8 signext) +void tms32010_device::getdata(uint8_t shift,uint8_t signext) { if (m_opcode.b.l & 0x80) m_memaccess = IND; else m_memaccess = DMA_DP; - m_ALU.d = (UINT16)M_RDRAM(m_memaccess); - if (signext) m_ALU.d = (INT16)m_ALU.d; + m_ALU.d = (uint16_t)M_RDRAM(m_memaccess); + if (signext) m_ALU.d = (int16_t)m_ALU.d; m_ALU.d <<= shift; if (m_opcode.b.l & 0x80) { UPDATE_AR(); @@ -296,7 +296,7 @@ void tms32010_device::getdata(UINT8 shift,UINT8 signext) } } -void tms32010_device::putdata(UINT16 data) +void tms32010_device::putdata(uint16_t data) { if (m_opcode.b.l & 0x80) m_memaccess = IND; @@ -309,7 +309,7 @@ void tms32010_device::putdata(UINT16 data) } M_WRTRAM(m_memaccess,data); } -void tms32010_device::putdata_sar(UINT8 data) +void tms32010_device::putdata_sar(uint8_t data) { if (m_opcode.b.l & 0x80) m_memaccess = IND; @@ -322,7 +322,7 @@ void tms32010_device::putdata_sar(UINT8 data) } M_WRTRAM(m_memaccess,m_AR[data]); } -void tms32010_device::putdata_sst(UINT16 data) +void tms32010_device::putdata_sst(uint16_t data) { if (m_opcode.b.l & 0x80) m_memaccess = IND; @@ -354,7 +354,7 @@ void tms32010_device::illegal() void tms32010_device::abst() { - if ( (INT32)(m_ACC.d) < 0 ) { + if ( (int32_t)(m_ACC.d) < 0 ) { m_ACC.d = -m_ACC.d; if (OVM && (m_ACC.d == 0x80000000)) m_ACC.d-- ; } @@ -381,10 +381,10 @@ void tms32010_device::addh() m_oldacc.d = m_ACC.d; getdata(0,0); m_ACC.w.h += m_ALU.w.l; - if ((INT16)(~(m_oldacc.w.h ^ m_ALU.w.h) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { + if ((int16_t)(~(m_oldacc.w.h ^ m_ALU.w.h) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { SET_FLAG(OV_FLAG); if (OVM) - m_ACC.w.h = ((INT16)m_oldacc.w.h < 0) ? 0x8000 : 0x7fff; + m_ACC.w.h = ((int16_t)m_oldacc.w.h < 0) ? 0x8000 : 0x7fff; } } void tms32010_device::adds() @@ -423,7 +423,7 @@ void tms32010_device::banz() } void tms32010_device::bgez() { - if ( (INT32)(m_ACC.d) >= 0 ) { + if ( (int32_t)(m_ACC.d) >= 0 ) { m_PC = M_RDOP_ARG(m_PC); m_icount -= add_branch_cycle(); } @@ -432,7 +432,7 @@ void tms32010_device::bgez() } void tms32010_device::bgz() { - if ( (INT32)(m_ACC.d) > 0 ) { + if ( (int32_t)(m_ACC.d) > 0 ) { m_PC = M_RDOP_ARG(m_PC); m_icount -= add_branch_cycle(); } @@ -450,7 +450,7 @@ void tms32010_device::bioz() } void tms32010_device::blez() { - if ( (INT32)(m_ACC.d) <= 0 ) { + if ( (int32_t)(m_ACC.d) <= 0 ) { m_PC = M_RDOP_ARG(m_PC); m_icount -= add_branch_cycle(); } @@ -459,7 +459,7 @@ void tms32010_device::blez() } void tms32010_device::blz() { - if ( (INT32)(m_ACC.d) < 0 ) { + if ( (int32_t)(m_ACC.d) < 0 ) { m_PC = M_RDOP_ARG(m_PC); m_icount -= add_branch_cycle(); } @@ -608,12 +608,12 @@ void tms32010_device::ltd() void tms32010_device::mpy() { getdata(0,0); - m_Preg.d = (INT16)m_ALU.w.l * (INT16)m_Treg; + m_Preg.d = (int16_t)m_ALU.w.l * (int16_t)m_Treg; if (m_Preg.d == 0x40000000) m_Preg.d = 0xc0000000; } void tms32010_device::mpyk() { - m_Preg.d = (INT16)m_Treg * ((INT16)(m_opcode.w.l << 3) >> 3); + m_Preg.d = (int16_t)m_Treg * ((int16_t)(m_opcode.w.l << 3) >> 3); } void tms32010_device::nop() { @@ -692,10 +692,10 @@ void tms32010_device::subc() { m_oldacc.d = m_ACC.d; getdata(15,0); - m_ALU.d = (INT32) m_ACC.d - m_ALU.d; - if ((INT32)((m_oldacc.d ^ m_ALU.d) & (m_oldacc.d ^ m_ACC.d)) < 0) + m_ALU.d = (int32_t) m_ACC.d - m_ALU.d; + if ((int32_t)((m_oldacc.d ^ m_ALU.d) & (m_oldacc.d ^ m_ACC.d)) < 0) SET_FLAG(OV_FLAG); - if ( (INT32)(m_ALU.d) >= 0 ) + if ( (int32_t)(m_ALU.d) >= 0 ) m_ACC.d = ((m_ALU.d << 1) + 1); else m_ACC.d = (m_ACC.d << 1); diff --git a/src/devices/cpu/tms32010/tms32010.h b/src/devices/cpu/tms32010/tms32010.h index d595b073997..99c2f084e62 100644 --- a/src/devices/cpu/tms32010/tms32010.h +++ b/src/devices/cpu/tms32010/tms32010.h @@ -43,8 +43,8 @@ class tms32010_device : public cpu_device { public: // construction/destruction - tms32010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms32010_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, int addr_mask); + tms32010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms32010_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, int addr_mask); // static configuration helpers template static devcb_base & set_bio_in_cb(device_t &device, _Object object) { return downcast(device).m_bio_in.set_callback(object); } @@ -55,13 +55,13 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 3; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 3; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : nullptr ) ); } @@ -70,9 +70,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -84,28 +84,28 @@ private: typedef void ( tms32010_device::*opcode_func ) (); struct tms32010_opcode { - UINT8 cycles; + uint8_t cycles; opcode_func function; }; static const tms32010_opcode s_opcode_main[256]; static const tms32010_opcode s_opcode_7F[32]; /******************** CPU Internal Registers *******************/ - UINT16 m_PC; - UINT16 m_PREVPC; /* previous program counter */ - UINT16 m_STR; + uint16_t m_PC; + uint16_t m_PREVPC; /* previous program counter */ + uint16_t m_STR; PAIR m_ACC; PAIR m_ALU; PAIR m_Preg; - UINT16 m_Treg; - UINT16 m_AR[2]; - UINT16 m_STACK[4]; + uint16_t m_Treg; + uint16_t m_AR[2]; + uint16_t m_STACK[4]; PAIR m_opcode; int m_INTF; /* Pending Interrupt flag */ int m_icount; PAIR m_oldacc; - UINT16 m_memaccess; + uint16_t m_memaccess; int m_addr_mask; address_space *m_program; @@ -113,18 +113,18 @@ private: address_space *m_data; address_space *m_io; - inline void CLR(UINT16 flag); - inline void SET_FLAG(UINT16 flag); - inline void CALCULATE_ADD_OVERFLOW(INT32 addval); - inline void CALCULATE_SUB_OVERFLOW(INT32 subval); - inline UINT16 POP_STACK(); - inline void PUSH_STACK(UINT16 data); + inline void CLR(uint16_t flag); + inline void SET_FLAG(uint16_t flag); + inline void CALCULATE_ADD_OVERFLOW(int32_t addval); + inline void CALCULATE_SUB_OVERFLOW(int32_t subval); + inline uint16_t POP_STACK(); + inline void PUSH_STACK(uint16_t data); inline void UPDATE_AR(); inline void UPDATE_ARP(); - inline void getdata(UINT8 shift,UINT8 signext); - inline void putdata(UINT16 data); - inline void putdata_sar(UINT8 data); - inline void putdata_sst(UINT16 data); + inline void getdata(uint8_t shift,uint8_t signext); + inline void putdata(uint16_t data); + inline void putdata_sar(uint8_t data); + inline void putdata_sst(uint16_t data); void opcodes_7F(); void illegal(); void abst(); @@ -199,7 +199,7 @@ class tms32015_device : public tms32010_device { public: // construction/destruction - tms32015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms32015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -207,7 +207,7 @@ class tms32016_device : public tms32010_device { public: // construction/destruction - tms32016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms32016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/tms32025/32025dsm.cpp b/src/devices/cpu/tms32025/32025dsm.cpp index d87fc55e6cf..8c9a0405eca 100644 --- a/src/devices/cpu/tms32025/32025dsm.cpp +++ b/src/devices/cpu/tms32025/32025dsm.cpp @@ -373,7 +373,7 @@ static void InitDasm32025(void) fatalerror("not enough bits in encoding '%s %s' %d\n", ops[0],ops[1],bit); } - while (isspace((UINT8)*p)) p++; + while (isspace((uint8_t)*p)) p++; if (*p) Op[i].extcode = *p; Op[i].bits = bits; Op[i].mask = mask; @@ -389,7 +389,7 @@ static void InitDasm32025(void) CPU_DISASSEMBLE( tms32025 ) { - UINT32 flags = 0; + uint32_t flags = 0; int a, b, c, d, k, m, n, p, r, s, t, w; /* these can all be filled in by parsing an instruction */ int i; int op; diff --git a/src/devices/cpu/tms32025/tms32025.cpp b/src/devices/cpu/tms32025/tms32025.cpp index 5ce29bf10ab..991b5a0b050 100644 --- a/src/devices/cpu/tms32025/tms32025.cpp +++ b/src/devices/cpu/tms32025/tms32025.cpp @@ -206,7 +206,7 @@ const device_type TMS32025 = &device_creator; const device_type TMS32026 = &device_creator; -tms32025_device::tms32025_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32025_device::tms32025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, TMS32025, "TMS32025", tag, owner, clock, "tms32025", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 16, 16, -1) , m_data_config("data", ENDIANNESS_BIG, 16, 16, -1) @@ -221,7 +221,7 @@ tms32025_device::tms32025_device(const machine_config &mconfig, const char *tag, } -tms32025_device::tms32025_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) +tms32025_device::tms32025_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 16, 16, -1) , m_data_config("data", ENDIANNESS_BIG, 16, 16, -1) @@ -236,23 +236,23 @@ tms32025_device::tms32025_device(const machine_config &mconfig, device_type type } -tms32026_device::tms32026_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32026_device::tms32026_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms32025_device(mconfig, TMS32026, "TMS32026", tag, owner, clock, "tms32026", __FILE__) { } -offs_t tms32025_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms32025_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms32025 ); return CPU_DISASSEMBLE_NAME(tms32025)(this, buffer, pc, oprom, opram, options); } -void tms32025_device::CLR0(UINT16 flag) { m_STR0 &= ~flag; m_STR0 |= 0x0400; } -void tms32025_device::SET0(UINT16 flag) { m_STR0 |= flag; m_STR0 |= 0x0400; } -void tms32025_device::CLR1(UINT16 flag) { m_STR1 &= ~flag; m_STR1 |= 0x0180; } -void tms32025_device::SET1(UINT16 flag) { m_STR1 |= flag; m_STR1 |= 0x0180; } +void tms32025_device::CLR0(uint16_t flag) { m_STR0 &= ~flag; m_STR0 |= 0x0400; } +void tms32025_device::SET0(uint16_t flag) { m_STR0 |= flag; m_STR0 |= 0x0400; } +void tms32025_device::CLR1(uint16_t flag) { m_STR1 &= ~flag; m_STR1 |= 0x0180; } +void tms32025_device::SET1(uint16_t flag) { m_STR1 |= flag; m_STR1 |= 0x0180; } void tms32025_device::MODIFY_DP(int data) { @@ -276,36 +276,36 @@ void tms32025_device::MODIFY_ARP(int data) m_STR0 |= 0x0400; } -UINT16 tms32025_device::M_RDROM(offs_t addr) +uint16_t tms32025_device::M_RDROM(offs_t addr) { - UINT16 *ram; + uint16_t *ram; addr &= 0xffff; ram = m_pgmmap[addr >> 7]; if (ram) return ram[addr & 0x7f]; return m_program->read_word(addr << 1); } -void tms32025_device::M_WRTROM(offs_t addr, UINT16 data) +void tms32025_device::M_WRTROM(offs_t addr, uint16_t data) { - UINT16 *ram; + uint16_t *ram; addr &= 0xffff; ram = m_pgmmap[addr >> 7]; if (ram) { ram[addr & 0x7f] = data; } else m_program->write_word(addr << 1, data); } -UINT16 tms32025_device::M_RDRAM(offs_t addr) +uint16_t tms32025_device::M_RDRAM(offs_t addr) { - UINT16 *ram; + uint16_t *ram; addr &= 0xffff; ram = m_datamap[addr >> 7]; if (ram) return ram[addr & 0x7f]; return m_data->read_word(addr << 1); } -void tms32025_device::M_WRTRAM(offs_t addr, UINT16 data) +void tms32025_device::M_WRTRAM(offs_t addr, uint16_t data) { - UINT16 *ram; + uint16_t *ram; addr &= 0xffff; ram = m_datamap[addr >> 7]; if (ram) { @@ -321,9 +321,9 @@ void tms32025_device::M_WRTRAM(offs_t addr, UINT16 data) } -UINT16 tms32025_device::reverse_carry_add(UINT16 arg0, UINT16 arg1 ) +uint16_t tms32025_device::reverse_carry_add(uint16_t arg0, uint16_t arg1 ) { - UINT16 result = 0; + uint16_t result = 0; int carry = 0; int count; for( count=0; count<16; count++ ) @@ -383,7 +383,7 @@ void tms32025_device::MODIFY_AR_ARP() void tms32025_device::CALCULATE_ADD_CARRY() { - if ( (UINT32)(m_oldacc.d) > (UINT32)(m_ACC.d) ) { + if ( (uint32_t)(m_oldacc.d) > (uint32_t)(m_ACC.d) ) { SET1(C_FLAG); } else { @@ -393,7 +393,7 @@ void tms32025_device::CALCULATE_ADD_CARRY() void tms32025_device::CALCULATE_SUB_CARRY() { - if ( (UINT32)(m_oldacc.d) < (UINT32)(m_ACC.d) ) { + if ( (uint32_t)(m_oldacc.d) < (uint32_t)(m_ACC.d) ) { CLR1(C_FLAG); } else { @@ -401,32 +401,32 @@ void tms32025_device::CALCULATE_SUB_CARRY() } } -void tms32025_device::CALCULATE_ADD_OVERFLOW(INT32 addval) +void tms32025_device::CALCULATE_ADD_OVERFLOW(int32_t addval) { - if ((INT32)((m_ACC.d ^ addval) & (m_oldacc.d ^ m_ACC.d)) < 0) + if ((int32_t)((m_ACC.d ^ addval) & (m_oldacc.d ^ m_ACC.d)) < 0) { SET0(OV_FLAG); if (OVM) { - m_ACC.d = ((INT32)m_oldacc.d < 0) ? 0x80000000 : 0x7fffffff; + m_ACC.d = ((int32_t)m_oldacc.d < 0) ? 0x80000000 : 0x7fffffff; } } } -void tms32025_device::CALCULATE_SUB_OVERFLOW(INT32 subval) +void tms32025_device::CALCULATE_SUB_OVERFLOW(int32_t subval) { - if ((INT32)((m_oldacc.d ^ subval) & (m_oldacc.d ^ m_ACC.d)) < 0) + if ((int32_t)((m_oldacc.d ^ subval) & (m_oldacc.d ^ m_ACC.d)) < 0) { SET0(OV_FLAG); if (OVM) { - m_ACC.d = ((INT32)m_oldacc.d < 0) ? 0x80000000 : 0x7fffffff; + m_ACC.d = ((int32_t)m_oldacc.d < 0) ? 0x80000000 : 0x7fffffff; } } } -UINT16 tms32025_device::POP_STACK() +uint16_t tms32025_device::POP_STACK() { - UINT16 data = m_STACK[7]; + uint16_t data = m_STACK[7]; m_STACK[7] = m_STACK[6]; m_STACK[6] = m_STACK[5]; m_STACK[5] = m_STACK[4]; @@ -436,7 +436,7 @@ UINT16 tms32025_device::POP_STACK() m_STACK[1] = m_STACK[0]; return data; } -void tms32025_device::PUSH_STACK(UINT16 data) +void tms32025_device::PUSH_STACK(uint16_t data) { m_STACK[0] = m_STACK[1]; m_STACK[1] = m_STACK[2]; @@ -480,15 +480,15 @@ void tms32025_device::GETDATA(int shift,int signext) m_external_mem_access = 0; } - m_ALU.d = (UINT16)M_RDRAM(m_memaccess); - if (signext) m_ALU.d = (INT16)m_ALU.d; + m_ALU.d = (uint16_t)M_RDRAM(m_memaccess); + if (signext) m_ALU.d = (int16_t)m_ALU.d; m_ALU.d <<= shift; /* next ARP */ if (m_opcode.b.l & 0x80) MODIFY_AR_ARP(); } -void tms32025_device::PUTDATA(UINT16 data) +void tms32025_device::PUTDATA(uint16_t data) { if (m_opcode.b.l & 0x80) { if (m_memaccess >= 0x800) m_external_mem_access = 1; /* Pause if hold pin is active */ @@ -504,7 +504,7 @@ void tms32025_device::PUTDATA(UINT16 data) M_WRTRAM(DMA, data); } } -void tms32025_device::PUTDATA_SST(UINT16 data) +void tms32025_device::PUTDATA_SST(uint16_t data) { if (m_opcode.b.l & 0x80) m_memaccess = IND; else m_memaccess = DMApg0; @@ -537,7 +537,7 @@ void tms32025_device::illegal() void tms32025_device::abst() { - if ( (INT32)(m_ACC.d) < 0 ) { + if ( (int32_t)(m_ACC.d) < 0 ) { m_ACC.d = -m_ACC.d; if (m_ACC.d == 0x80000000) { SET0(OV_FLAG); @@ -569,18 +569,18 @@ void tms32025_device::addh() m_oldacc.d = m_ACC.d; GETDATA(0, 0); m_ACC.w.h += m_ALU.w.l; - if ( (UINT16)(m_oldacc.w.h) > (UINT16)(m_ACC.w.h) ) { + if ( (uint16_t)(m_oldacc.w.h) > (uint16_t)(m_ACC.w.h) ) { SET1(C_FLAG); /* Carry flag is not cleared, if no carry occurred */ } - if ((INT16)((m_ACC.w.h ^ m_ALU.w.l) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { + if ((int16_t)((m_ACC.w.h ^ m_ALU.w.l) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { SET0(OV_FLAG); - if (OVM) m_ACC.w.h = ((INT16)m_oldacc.w.h < 0) ? 0x8000 : 0x7fff; + if (OVM) m_ACC.w.h = ((int16_t)m_oldacc.w.h < 0) ? 0x8000 : 0x7fff; } } void tms32025_device::addk() { m_oldacc.d = m_ACC.d; - m_ALU.d = (UINT8)m_opcode.b.l; + m_ALU.d = (uint8_t)m_opcode.b.l; m_ACC.d += m_ALU.d; CALCULATE_ADD_OVERFLOW(m_ALU.d); CALCULATE_ADD_CARRY(); @@ -604,8 +604,8 @@ void tms32025_device::addt() void tms32025_device::adlk() { m_oldacc.d = m_ACC.d; - if (SXM) m_ALU.d = (INT16)M_RDOP_ARG(m_PC); - else m_ALU.d = (UINT16)M_RDOP_ARG(m_PC); + if (SXM) m_ALU.d = (int16_t)M_RDOP_ARG(m_PC); + else m_ALU.d = (uint16_t)M_RDOP_ARG(m_PC); m_PC++; m_ALU.d <<= (m_opcode.b.h & 0xf); m_ACC.d += m_ALU.d; @@ -624,7 +624,7 @@ void tms32025_device::and_() void tms32025_device::andk() { m_oldacc.d = m_ACC.d; - m_ALU.d = (UINT16)M_RDOP_ARG(m_PC); + m_ALU.d = (uint16_t)M_RDOP_ARG(m_PC); m_PC++; m_ALU.d <<= (m_opcode.b.h & 0xf); m_ACC.d &= m_ALU.d; @@ -672,13 +672,13 @@ void tms32025_device::bc() } void tms32025_device::bgez() { - if ( (INT32)(m_ACC.d) >= 0 ) SET_PC(M_RDOP_ARG(m_PC)); + if ( (int32_t)(m_ACC.d) >= 0 ) SET_PC(M_RDOP_ARG(m_PC)); else m_PC++ ; MODIFY_AR_ARP(); } void tms32025_device::bgz() { - if ( (INT32)(m_ACC.d) > 0 ) SET_PC(M_RDOP_ARG(m_PC)); + if ( (int32_t)(m_ACC.d) > 0 ) SET_PC(M_RDOP_ARG(m_PC)); else m_PC++ ; MODIFY_AR_ARP(); } @@ -702,7 +702,7 @@ void tms32025_device::bitt() } void tms32025_device::blez() { - if ( (INT32)(m_ACC.d) <= 0 ) SET_PC(M_RDOP_ARG(m_PC)); + if ( (int32_t)(m_ACC.d) <= 0 ) SET_PC(M_RDOP_ARG(m_PC)); else m_PC++ ; MODIFY_AR_ARP(); } @@ -730,7 +730,7 @@ void tms32025_device::blkp() } void tms32025_device::blz() { - if ( (INT32)(m_ACC.d) < 0 ) SET_PC(M_RDOP_ARG(m_PC)); + if ( (int32_t)(m_ACC.d) < 0 ) SET_PC(M_RDOP_ARG(m_PC)); else m_PC++ ; MODIFY_AR_ARP(); } @@ -790,16 +790,16 @@ void tms32025_device::cmpr() { switch (m_opcode.b.l & 3) { - case 00: if ( (UINT16)(m_AR[ARP]) == (UINT16)(m_AR[0]) ) SET1(TC_FLAG); + case 00: if ( (uint16_t)(m_AR[ARP]) == (uint16_t)(m_AR[0]) ) SET1(TC_FLAG); else CLR1(TC_FLAG); break; - case 01: if ( (UINT16)(m_AR[ARP]) < (UINT16)(m_AR[0]) ) SET1(TC_FLAG); + case 01: if ( (uint16_t)(m_AR[ARP]) < (uint16_t)(m_AR[0]) ) SET1(TC_FLAG); else CLR1(TC_FLAG); break; - case 02: if ( (UINT16)(m_AR[ARP]) > (UINT16)(m_AR[0]) ) SET1(TC_FLAG); + case 02: if ( (uint16_t)(m_AR[ARP]) > (uint16_t)(m_AR[0]) ) SET1(TC_FLAG); else CLR1(TC_FLAG); break; - case 03: if ( (UINT16)(m_AR[ARP]) != (UINT16)(m_AR[0]) ) SET1(TC_FLAG); + case 03: if ( (uint16_t)(m_AR[ARP]) != (uint16_t)(m_AR[0]) ) SET1(TC_FLAG); else CLR1(TC_FLAG); break; } @@ -968,7 +968,7 @@ void tms32025_device::lac() } void tms32025_device::lack() /* ZAC is a subset of this instruction */ { - m_ACC.d = (UINT8)m_opcode.b.l; + m_ACC.d = (uint8_t)m_opcode.b.l; } void tms32025_device::lact() { @@ -977,8 +977,8 @@ void tms32025_device::lact() } void tms32025_device::lalk() { - if (SXM) m_ALU.d = (INT16)M_RDOP_ARG(m_PC); - else m_ALU.d = (UINT16)M_RDOP_ARG(m_PC); + if (SXM) m_ALU.d = (int16_t)M_RDOP_ARG(m_PC); + else m_ALU.d = (uint16_t)M_RDOP_ARG(m_PC); m_PC++; m_ALU.d <<= (m_opcode.b.h & 0xf); m_ACC.d = m_ALU.d; @@ -1015,7 +1015,7 @@ void tms32025_device::lph() } void tms32025_device::lrlk() { - m_ALU.d = (UINT16)M_RDOP_ARG(m_PC); + m_ALU.d = (uint16_t)M_RDOP_ARG(m_PC); m_PC++; m_AR[m_opcode.b.h & 7] = m_ALU.w.l; } @@ -1098,7 +1098,7 @@ void tms32025_device::mac() /** RAM blocks B0,B1,B2 may be important ! CALCULATE_ADD_CARRY(); GETDATA(0, 0); m_Treg = m_ALU.w.l; - m_Preg.d = ( (INT16)m_ALU.w.l * (INT16)M_RDROM(m_PFC) ); + m_Preg.d = ( (int16_t)m_ALU.w.l * (int16_t)M_RDROM(m_PFC) ); m_PFC++; m_tms32025_dec_cycles += (2*CLK); } @@ -1118,7 +1118,7 @@ void tms32025_device::macd() /** RAM blocks B0,B1,B2 may be important ! M_WRTRAM((m_memaccess+1), m_ALU.w.l); } m_Treg = m_ALU.w.l; - m_Preg.d = ( (INT16)m_ALU.w.l * (INT16)M_RDROM(m_PFC) ); + m_Preg.d = ( (int16_t)m_ALU.w.l * (int16_t)M_RDROM(m_PFC) ); m_PFC++; m_tms32025_dec_cycles += (2*CLK); } @@ -1129,7 +1129,7 @@ void tms32025_device::mar() /* LARP and NOP are a subset of this instructi void tms32025_device::mpy() { GETDATA(0, 0); - m_Preg.d = (INT16)(m_ALU.w.l) * (INT16)(m_Treg); + m_Preg.d = (int16_t)(m_ALU.w.l) * (int16_t)(m_Treg); } void tms32025_device::mpya() { @@ -1139,11 +1139,11 @@ void tms32025_device::mpya() CALCULATE_ADD_OVERFLOW(m_ALU.d); CALCULATE_ADD_CARRY(); GETDATA(0, 0); - m_Preg.d = (INT16)(m_ALU.w.l) * (INT16)(m_Treg); + m_Preg.d = (int16_t)(m_ALU.w.l) * (int16_t)(m_Treg); } void tms32025_device::mpyk() { - m_Preg.d = (INT16)m_Treg * ((INT16)(m_opcode.w.l << 3) >> 3); + m_Preg.d = (int16_t)m_Treg * ((int16_t)(m_opcode.w.l << 3) >> 3); } void tms32025_device::mpys() @@ -1154,12 +1154,12 @@ void tms32025_device::mpys() CALCULATE_SUB_OVERFLOW(m_ALU.d); CALCULATE_SUB_CARRY(); GETDATA(0, 0); - m_Preg.d = (INT16)(m_ALU.w.l) * (INT16)(m_Treg); + m_Preg.d = (int16_t)(m_ALU.w.l) * (int16_t)(m_Treg); } void tms32025_device::mpyu() { GETDATA(0, 0); - m_Preg.d = (UINT16)(m_ALU.w.l) * (UINT16)(m_Treg); + m_Preg.d = (uint16_t)(m_ALU.w.l) * (uint16_t)(m_Treg); } void tms32025_device::neg() { @@ -1176,7 +1176,7 @@ void tms32025_device::nop() { } // NOP is a subset of the MAR instruction */ void tms32025_device::norm() { - if (m_ACC.d !=0 && (INT32)(m_ACC.d ^ (m_ACC.d << 1)) >= 0) + if (m_ACC.d !=0 && (int32_t)(m_ACC.d ^ (m_ACC.d << 1)) >= 0) { CLR1(TC_FLAG); m_ACC.d <<= 1; @@ -1191,7 +1191,7 @@ void tms32025_device::or_() } void tms32025_device::ork() { - m_ALU.d = (UINT16)M_RDOP_ARG(m_PC); + m_ALU.d = (uint16_t)M_RDOP_ARG(m_PC); m_PC++; m_ALU.d <<= (m_opcode.b.h & 0xf); m_ACC.d |= (m_ALU.d); @@ -1208,11 +1208,11 @@ void tms32025_device::pac() } void tms32025_device::pop() { - m_ACC.d = (UINT16)POP_STACK(); + m_ACC.d = (uint16_t)POP_STACK(); } void tms32025_device::popd() { - m_ALU.d = (UINT16)POP_STACK(); + m_ALU.d = (uint16_t)POP_STACK(); PUTDATA(m_ALU.w.l); } void tms32025_device::pshd() @@ -1310,8 +1310,8 @@ void tms32025_device::sar_ar7() { PUTDATA(m_AR[7]); } void tms32025_device::sblk() { m_oldacc.d = m_ACC.d; - if (SXM) m_ALU.d = (INT16)M_RDOP_ARG(m_PC); - else m_ALU.d = (UINT16)M_RDOP_ARG(m_PC); + if (SXM) m_ALU.d = (int16_t)M_RDOP_ARG(m_PC); + else m_ALU.d = (uint16_t)M_RDOP_ARG(m_PC); m_PC++; m_ALU.d <<= (m_opcode.b.h & 0xf); m_ACC.d -= m_ALU.d; @@ -1386,7 +1386,7 @@ void tms32025_device::sqra() CALCULATE_ADD_CARRY(); GETDATA(0, 0); m_Treg = m_ALU.w.l; - m_Preg.d = ((INT16)m_ALU.w.l * (INT16)m_ALU.w.l); + m_Preg.d = ((int16_t)m_ALU.w.l * (int16_t)m_ALU.w.l); } void tms32025_device::sqrs() { @@ -1397,7 +1397,7 @@ void tms32025_device::sqrs() CALCULATE_SUB_CARRY(); GETDATA(0, 0); m_Treg = m_ALU.w.l; - m_Preg.d = ((INT16)m_ALU.w.l * (INT16)m_ALU.w.l); + m_Preg.d = ((int16_t)m_ALU.w.l * (int16_t)m_ALU.w.l); } void tms32025_device::sst() { @@ -1442,7 +1442,7 @@ void tms32025_device::subc() m_oldacc.d = m_ACC.d; GETDATA(15, SXM); m_ACC.d -= m_ALU.d; /* Temporary switch to ACC. Actual calculation is done as (ACC)-[mem] -> ALU, will be preserved later on. */ - if ((INT32)((m_oldacc.d ^ m_ALU.d) & (m_oldacc.d ^ m_ACC.d)) < 0) { + if ((int32_t)((m_oldacc.d ^ m_ALU.d) & (m_oldacc.d ^ m_ACC.d)) < 0) { SET0(OV_FLAG); /* Not affected by OVM */ } CALCULATE_SUB_CARRY(); @@ -1460,18 +1460,18 @@ void tms32025_device::subh() m_oldacc.d = m_ACC.d; GETDATA(0, 0); m_ACC.w.h -= m_ALU.w.l; - if ( (UINT16)(m_oldacc.w.h) < (UINT16)(m_ACC.w.h) ) { + if ( (uint16_t)(m_oldacc.w.h) < (uint16_t)(m_ACC.w.h) ) { CLR1(C_FLAG); /* Carry flag is not affected, if no borrow occurred */ } - if ((INT16)((m_oldacc.w.h ^ m_ALU.w.l) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { + if ((int16_t)((m_oldacc.w.h ^ m_ALU.w.l) & (m_oldacc.w.h ^ m_ACC.w.h)) < 0) { SET0(OV_FLAG); - if (OVM) m_ACC.w.h = ((INT16)m_oldacc.w.h < 0) ? 0x8000 : 0x7fff; + if (OVM) m_ACC.w.h = ((int16_t)m_oldacc.w.h < 0) ? 0x8000 : 0x7fff; } } void tms32025_device::subk() { m_oldacc.d = m_ACC.d; - m_ALU.d = (UINT8)m_opcode.b.l; + m_ALU.d = (uint8_t)m_opcode.b.l; m_ACC.d -= m_ALU.b.l; CALCULATE_SUB_OVERFLOW(m_ALU.d); CALCULATE_SUB_CARRY(); @@ -1503,7 +1503,7 @@ void tms32025_device::tblr() m_PFC = m_ACC.w.l; } m_ALU.w.l = M_RDROM(m_PFC); - if ( (CNF0) && ( (UINT16)(m_PFC) >= 0xff00 ) ) {} /** TMS32025 only */ + if ( (CNF0) && ( (uint16_t)(m_PFC) >= 0xff00 ) ) {} /** TMS32025 only */ else m_tms32025_dec_cycles += (1*CLK); PUTDATA(m_ALU.w.l); m_PFC++; @@ -2127,7 +2127,7 @@ void tms32025_device::execute_run() } m_init_load_addr = 0; m_RPTC-- ; - } while ((INT8)(m_RPTC) != -1); + } while ((int8_t)(m_RPTC) != -1); m_RPTC = 0; m_PFC = m_PC; m_init_load_addr = 1; @@ -2179,7 +2179,7 @@ void tms32025_device::execute_set_input(int irqline, int state) /**************************************************************************** * Opcode fetcher ****************************************************************************/ -bool tms32025_device::memory_readop(offs_t offset, int size, UINT64 &value) +bool tms32025_device::memory_readop(offs_t offset, int size, uint64_t &value) { void *ptr; @@ -2187,13 +2187,13 @@ bool tms32025_device::memory_readop(offs_t offset, int size, UINT64 &value) if (!m_pgmmap[offset >> 8]) return 0; - ptr = &((UINT8 *)&m_pgmmap[offset >> 8])[offset & 0xff]; + ptr = &((uint8_t *)&m_pgmmap[offset >> 8])[offset & 0xff]; switch (size) { - case 1: value = *((UINT8 *) ptr); - case 2: value = *((UINT16 *) ptr); - case 4: value = *((UINT32 *) ptr); - case 8: value = *((UINT64 *) ptr); + case 1: value = *((uint8_t *) ptr); + case 2: value = *((uint16_t *) ptr); + case 4: value = *((uint32_t *) ptr); + case 8: value = *((uint64_t *) ptr); } return 1; } @@ -2202,10 +2202,10 @@ bool tms32025_device::memory_readop(offs_t offset, int size, UINT64 &value) /**************************************************************************** * Memory reader ****************************************************************************/ -bool tms32025_device::memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value) +bool tms32025_device::memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) { void *ptr; - UINT64 temp = 0; + uint64_t temp = 0; switch (spacenum) { @@ -2229,10 +2229,10 @@ bool tms32025_device::memory_read(address_spacenum spacenum, offs_t offset, int switch (size) { case 1: - value = ((UINT8 *)ptr)[BYTE_XOR_BE(offset & 0xff)]; + value = ((uint8_t *)ptr)[BYTE_XOR_BE(offset & 0xff)]; break; case 2: - value = ((UINT16 *)ptr)[(offset & 0xff) / 2]; + value = ((uint16_t *)ptr)[(offset & 0xff) / 2]; break; case 4: memory_read(spacenum, offset + 0, 2, temp); @@ -2254,7 +2254,7 @@ bool tms32025_device::memory_read(address_spacenum spacenum, offs_t offset, int /**************************************************************************** * Memory writer ****************************************************************************/ -bool tms32025_device::memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value) +bool tms32025_device::memory_write(address_spacenum spacenum, offs_t offset, int size, uint64_t value) { void *ptr; @@ -2280,10 +2280,10 @@ bool tms32025_device::memory_write(address_spacenum spacenum, offs_t offset, int switch (size) { case 1: - ((UINT8 *)ptr)[BYTE_XOR_BE(offset & 0xff)] = value; + ((uint8_t *)ptr)[BYTE_XOR_BE(offset & 0xff)] = value; break; case 2: - ((UINT16 *)ptr)[(offset & 0xff) / 2] = value; + ((uint16_t *)ptr)[(offset & 0xff) / 2] = value; break; case 4: memory_write(spacenum, offset + 0, 2, value >> 16); diff --git a/src/devices/cpu/tms32025/tms32025.h b/src/devices/cpu/tms32025/tms32025.h index e112dafde51..a2f907e3769 100644 --- a/src/devices/cpu/tms32025/tms32025.h +++ b/src/devices/cpu/tms32025/tms32025.h @@ -81,8 +81,8 @@ class tms32025_device : public cpu_device { public: // construction/destruction - tms32025_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms32025_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); + tms32025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms32025_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_bio_in_cb(device_t &device, _Object object) { return downcast(device).m_bio_in.set_callback(object); } @@ -98,17 +98,17 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 4; } - virtual UINT32 execute_max_cycles() const override { return 20; } - virtual UINT32 execute_input_lines() const override { return 6; } + virtual uint32_t execute_min_cycles() const override { return 4; } + virtual uint32_t execute_max_cycles() const override { return 20; } + virtual uint32_t execute_input_lines() const override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : nullptr ) ); } - virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value) override; - virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value) override; - virtual bool memory_readop(offs_t offset, int size, UINT64 &value) override; + virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) override; + virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, uint64_t value) override; + virtual bool memory_readop(offs_t offset, int size, uint64_t &value) override; // device_state_interface overrides virtual void state_import(const device_state_entry &entry) override; @@ -116,9 +116,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -128,7 +128,7 @@ private: typedef void ( tms32025_device::*opcode_func ) (); struct tms32025_opcode { - UINT8 cycles; + uint8_t cycles; opcode_func function; }; static const tms32025_opcode s_opcode_main[256]; @@ -144,22 +144,22 @@ private: /******************** CPU Internal Registers *******************/ - UINT16 m_PREVPC; /* previous program counter */ - UINT16 m_PC; - UINT16 m_PFC; - UINT16 m_STR0, m_STR1; - UINT8 m_IFR; - UINT8 m_RPTC; + uint16_t m_PREVPC; /* previous program counter */ + uint16_t m_PC; + uint16_t m_PFC; + uint16_t m_STR0, m_STR1; + uint8_t m_IFR; + uint8_t m_RPTC; PAIR m_ACC; PAIR m_Preg; - UINT16 m_Treg; - UINT16 m_AR[8]; - UINT16 m_STACK[8]; + uint16_t m_Treg; + uint16_t m_AR[8]; + uint16_t m_STACK[8]; PAIR m_ALU; protected: - UINT16 m_intRAM[0x800]; + uint16_t m_intRAM[0x800]; private: - UINT8 m_timerover; + uint8_t m_timerover; /********************** Status data ****************************/ PAIR m_opcode; @@ -171,7 +171,7 @@ private: int m_tms32025_dec_cycles; PAIR m_oldacc; - UINT32 m_memaccess; + uint32_t m_memaccess; int m_icount; int m_mHackIgnoreARP; /* special handling for lst, lst1 instructions */ int m_waiting_for_serial_frame; @@ -181,36 +181,36 @@ private: address_space *m_data; address_space *m_io; - UINT16 *m_pgmmap[0x200]; + uint16_t *m_pgmmap[0x200]; protected: - UINT16 *m_datamap[0x200]; + uint16_t *m_datamap[0x200]; private: - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; - inline void CLR0(UINT16 flag); - inline void SET0(UINT16 flag); - inline void CLR1(UINT16 flag); - inline void SET1(UINT16 flag); + inline void CLR0(uint16_t flag); + inline void SET0(uint16_t flag); + inline void CLR1(uint16_t flag); + inline void SET1(uint16_t flag); inline void MODIFY_DP(int data); inline void MODIFY_PM(int data); inline void MODIFY_ARP(int data); - inline UINT16 M_RDROM(offs_t addr); - inline void M_WRTROM(offs_t addr, UINT16 data); - inline UINT16 M_RDRAM(offs_t addr); - inline void M_WRTRAM(offs_t addr, UINT16 data); - UINT16 reverse_carry_add(UINT16 arg0, UINT16 arg1 ); + inline uint16_t M_RDROM(offs_t addr); + inline void M_WRTROM(offs_t addr, uint16_t data); + inline uint16_t M_RDRAM(offs_t addr); + inline void M_WRTRAM(offs_t addr, uint16_t data); + uint16_t reverse_carry_add(uint16_t arg0, uint16_t arg1 ); inline void MODIFY_AR_ARP(); inline void CALCULATE_ADD_CARRY(); inline void CALCULATE_SUB_CARRY(); - inline void CALCULATE_ADD_OVERFLOW(INT32 addval); - inline void CALCULATE_SUB_OVERFLOW(INT32 subval); - inline UINT16 POP_STACK(); - inline void PUSH_STACK(UINT16 data); + inline void CALCULATE_ADD_OVERFLOW(int32_t addval); + inline void CALCULATE_SUB_OVERFLOW(int32_t subval); + inline uint16_t POP_STACK(); + inline void PUSH_STACK(uint16_t data); inline void SHIFT_Preg_TO_ALU(); inline void GETDATA(int shift,int signext); - inline void PUTDATA(UINT16 data); - inline void PUTDATA_SST(UINT16 data); + inline void PUTDATA(uint16_t data); + inline void PUTDATA_SST(uint16_t data); void opcodes_CE(); void opcodes_Dx(); void illegal(); @@ -376,7 +376,7 @@ class tms32026_device : public tms32025_device { public: // construction/destruction - tms32026_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms32026_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_reset() override; diff --git a/src/devices/cpu/tms32031/32031ops.hxx b/src/devices/cpu/tms32031/32031ops.hxx index 60f2ab5d07f..476c5082a3e 100644 --- a/src/devices/cpu/tms32031/32031ops.hxx +++ b/src/devices/cpu/tms32031/32031ops.hxx @@ -25,22 +25,22 @@ #define FREGEXP(rnum) (m_r[rnum].exponent()) #define FREGMAN(rnum) (m_r[rnum].mantissa()) -#define FP2LONG(rnum) ((FREGEXP(rnum) << 24) | ((UINT32)FREGMAN(rnum) >> 8)) -#define LONG2FP(rnum,v) do { m_r[rnum].set_mantissa((v) << 8); m_r[rnum].set_exponent((INT32)(v) >> 24); } while (0) +#define FP2LONG(rnum) ((FREGEXP(rnum) << 24) | ((uint32_t)FREGMAN(rnum) >> 8)) +#define LONG2FP(rnum,v) do { m_r[rnum].set_mantissa((v) << 8); m_r[rnum].set_exponent((int32_t)(v) >> 24); } while (0) #define SHORT2FP(rnum,v) do { \ - if ((UINT16)(v) == 0x8000) { m_r[rnum].set_mantissa(0); m_r[rnum].set_exponent(-128); } \ - else { m_r[rnum].set_mantissa((v) << 20); m_r[rnum].set_exponent((INT16)(v) >> 12); } \ + if ((uint16_t)(v) == 0x8000) { m_r[rnum].set_mantissa(0); m_r[rnum].set_exponent(-128); } \ + else { m_r[rnum].set_mantissa((v) << 20); m_r[rnum].set_exponent((int16_t)(v) >> 12); } \ } while (0) -#define DIRECT(op) (((IREG(TMR_DP) & 0xff) << 16) | ((UINT16)op)) +#define DIRECT(op) (((IREG(TMR_DP) & 0xff) << 16) | ((uint16_t)op)) #define INDIRECT_D(op,o) ((this->*s_indirect_d[((o) >> 3) & 31])(op,o)) #define INDIRECT_1(op,o) ((this->*s_indirect_1[((o) >> 3) & 31])(op,o)) #define INDIRECT_1_DEF(op,o) ((this->*s_indirect_1_def[((o) >> 3) & 31])(op,o,defptr)) #define SIGN(val) ((val) & 0x80000000) -#define OVERFLOW_SUB(a,b,r) ((INT32)(((a) ^ (b)) & ((a) ^ (r))) < 0) -#define OVERFLOW_ADD(a,b,r) ((INT32)(((a) ^ (r)) & ((b) ^ (r))) < 0) +#define OVERFLOW_SUB(a,b,r) ((int32_t)(((a) ^ (b)) & ((a) ^ (r))) < 0) +#define OVERFLOW_ADD(a,b,r) ((int32_t)(((a) ^ (r)) & ((b) ^ (r))) < 0) #define CLR_FLAGS(f) do { IREG(TMR_ST) &= ~(f); } while (0) #define CLR_NVUF() CLR_FLAGS(NFLAG | VFLAG | UFFLAG) @@ -51,16 +51,16 @@ #define OR_NZ(val) do { IREG(TMR_ST) |= (((val) >> 28) & NFLAG) | (((val) == 0) << 2); } while (0) #define OR_NZF(reg) do { IREG(TMR_ST) |= ((reg.mantissa() >> 28) & NFLAG) | ((reg.exponent() == -128) << 2); } while (0) #define OR_NUF(reg) do { int temp = (reg.exponent() == -128) << 4; IREG(TMR_ST) |= ((reg.mantissa() >> 28) & NFLAG) | (temp) | (temp << 2); } while (0) -#define OR_V_SUB(a,b,r) do { UINT32 temp = ((((a) ^ (b)) & ((a) ^ (r))) >> 30) & VFLAG; IREG(TMR_ST) |= temp | (temp << 4); } while (0) -#define OR_V_ADD(a,b,r) do { UINT32 temp = ((((a) ^ (r)) & ((b) ^ (r))) >> 30) & VFLAG; IREG(TMR_ST) |= temp | (temp << 4); } while (0) -#define OR_C_SUB(a,b,r) do { IREG(TMR_ST) |= ((UINT32)(b) > (UINT32)(a)); } while (0) -#define OR_C_ADD(a,b,r) do { IREG(TMR_ST) |= ((UINT32)(a) > (UINT32)(r)); } while (0) -#define OR_C_SBB(a,b,c) do { INT64 temp = (INT64)(a) - (UINT32)(b) - (UINT32)(c); IREG(TMR_ST) |= (temp < 0); } while (0) -#define OR_C_ADC(a,b,c) do { UINT64 temp = (UINT64)(a) + (UINT32)(b) + (UINT32)(c); IREG(TMR_ST) |= (temp > 0xffffffff); } while (0) +#define OR_V_SUB(a,b,r) do { uint32_t temp = ((((a) ^ (b)) & ((a) ^ (r))) >> 30) & VFLAG; IREG(TMR_ST) |= temp | (temp << 4); } while (0) +#define OR_V_ADD(a,b,r) do { uint32_t temp = ((((a) ^ (r)) & ((b) ^ (r))) >> 30) & VFLAG; IREG(TMR_ST) |= temp | (temp << 4); } while (0) +#define OR_C_SUB(a,b,r) do { IREG(TMR_ST) |= ((uint32_t)(b) > (uint32_t)(a)); } while (0) +#define OR_C_ADD(a,b,r) do { IREG(TMR_ST) |= ((uint32_t)(a) > (uint32_t)(r)); } while (0) +#define OR_C_SBB(a,b,c) do { int64_t temp = (int64_t)(a) - (uint32_t)(b) - (uint32_t)(c); IREG(TMR_ST) |= (temp < 0); } while (0) +#define OR_C_ADC(a,b,c) do { uint64_t temp = (uint64_t)(a) + (uint32_t)(b) + (uint32_t)(c); IREG(TMR_ST) |= (temp > 0xffffffff); } while (0) #define OVM() (IREG(TMR_ST) & OVMFLAG) -#define DECLARE_DEF UINT32 defval; UINT32 *defptr = &defval +#define DECLARE_DEF uint32_t defval; uint32_t *defptr = &defval #define UPDATE_DEF() *defptr = defval @@ -69,7 +69,7 @@ // IMPLEMENTATION //************************************************************************** -void tms3203x_device::illegal(UINT32 op) +void tms3203x_device::illegal(uint32_t op) { if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) { @@ -79,7 +79,7 @@ void tms3203x_device::illegal(UINT32 op) } -void tms3203x_device::unimplemented(UINT32 op) +void tms3203x_device::unimplemented(uint32_t op) { fatalerror("Unimplemented op @ %06X: %08X (tbl=%03X)\n", m_pc - 1, op, op >> 21); } @@ -87,7 +87,7 @@ void tms3203x_device::unimplemented(UINT32 op) inline void tms3203x_device::execute_one() { - UINT32 op = ROPCODE(m_pc); + uint32_t op = ROPCODE(m_pc); m_icount -= 2; // 2 clocks per cycle m_pc++; #if (TMS_3203X_LOG_OPCODE_USAGE) @@ -101,7 +101,7 @@ void tms3203x_device::update_special(int dreg) { if (dreg == TMR_BK) { - UINT32 temp = IREG(TMR_BK); + uint32_t temp = IREG(TMR_BK); m_bkmask = temp; while (temp >>= 1) m_bkmask |= temp; @@ -123,27 +123,27 @@ void tms3203x_device::update_special(int dreg) // CONDITION CODES //************************************************************************** -const UINT32 C_LO = 1 << 1; -const UINT32 C_LS = 1 << 2; -const UINT32 C_HI = 1 << 3; -const UINT32 C_HS = 1 << 4; -const UINT32 C_EQ = 1 << 5; -const UINT32 C_NE = 1 << 6; -const UINT32 C_LT = 1 << 7; -const UINT32 C_LE = 1 << 8; -const UINT32 C_GT = 1 << 9; -const UINT32 C_GE = 1 << 10; -const UINT32 C_NV = 1 << 12; -const UINT32 C_V = 1 << 13; -const UINT32 C_NUF = 1 << 14; -const UINT32 C_UF = 1 << 15; -const UINT32 C_NLV = 1 << 16; -const UINT32 C_LV = 1 << 17; -const UINT32 C_NLUF = 1 << 18; -const UINT32 C_LUF = 1 << 19; -const UINT32 C_ZUF = 1 << 20; - -const UINT32 condition_table[0x80] = +const uint32_t C_LO = 1 << 1; +const uint32_t C_LS = 1 << 2; +const uint32_t C_HI = 1 << 3; +const uint32_t C_HS = 1 << 4; +const uint32_t C_EQ = 1 << 5; +const uint32_t C_NE = 1 << 6; +const uint32_t C_LT = 1 << 7; +const uint32_t C_LE = 1 << 8; +const uint32_t C_GT = 1 << 9; +const uint32_t C_GE = 1 << 10; +const uint32_t C_NV = 1 << 12; +const uint32_t C_V = 1 << 13; +const uint32_t C_NUF = 1 << 14; +const uint32_t C_UF = 1 << 15; +const uint32_t C_NLV = 1 << 16; +const uint32_t C_LV = 1 << 17; +const uint32_t C_NLUF = 1 << 18; +const uint32_t C_LUF = 1 << 19; +const uint32_t C_ZUF = 1 << 20; + +const uint32_t condition_table[0x80] = { /* ------- */ 1 | C_HI | C_HS | C_NE | C_GT | C_GE | C_NV | C_NUF | C_NLV | C_NLUF, /* ------C */ 1 | C_LO | C_LS | C_NE | C_GT | C_GE | C_NV | C_NUF | C_NLV | C_NLUF, @@ -324,7 +324,7 @@ void tms3203x_device::double_to_dsp_with_flags(double val, tmsreg &result) } else if (exponent > 127) { - if ((INT32)id.i[BYTE_XOR_BE(0)] >= 0) + if ((int32_t)id.i[BYTE_XOR_BE(0)] >= 0) result.set_mantissa(0x7fffffff); else { @@ -340,7 +340,7 @@ void tms3203x_device::double_to_dsp_with_flags(double val, tmsreg &result) result.set_exponent(-128); IREG(TMR_ST) |= ZFLAG; } - else if ((INT32)id.i[BYTE_XOR_BE(0)] >= 0) + else if ((int32_t)id.i[BYTE_XOR_BE(0)] >= 0) { result.set_mantissa(mantissa); result.set_exponent(exponent); @@ -370,7 +370,7 @@ void tms3203x_device::int2float(tmsreg &srcdst) #else void tms3203x_device::int2float(tmsreg &srcdst) { - UINT32 man = srcdst.mantissa(); + uint32_t man = srcdst.mantissa(); int exp, cnt; // never overflows or underflows @@ -384,14 +384,14 @@ void tms3203x_device::int2float(tmsreg &srcdst) } // check for -1 here because count_leading_ones will infinite loop - else if (man == (UINT32)-1) + else if (man == (uint32_t)-1) { man = 0; exp = -1; } // positive values; count leading zeros and shift - else if ((INT32)man > 0) + else if ((int32_t)man > 0) { cnt = count_leading_zeros(man); man <<= cnt; @@ -418,12 +418,12 @@ void tms3203x_device::int2float(tmsreg &srcdst) #if USE_FP void tms3203x_device::float2int(tmsreg &srcdst, int setflags) { - INT32 val; + int32_t val; if (setflags) CLR_NZVUF(); if (srcdst.exponent() > 30) { - if ((INT32)srcdst.mantissa() >= 0) + if ((int32_t)srcdst.mantissa() >= 0) val = 0x7fffffff; else val = 0x80000000; @@ -437,7 +437,7 @@ void tms3203x_device::float2int(tmsreg &srcdst, int setflags) #else void tms3203x_device::float2int(tmsreg &srcdst, bool setflags) { - INT32 man = srcdst.mantissa(); + int32_t man = srcdst.mantissa(); int shift = 31 - srcdst.exponent(); // never underflows @@ -474,7 +474,7 @@ void tms3203x_device::negf(tmsreg &dst, tmsreg tmsreg &src) #else void tms3203x_device::negf(tmsreg &dst, tmsreg &src) { - INT32 man = src.mantissa(); + int32_t man = src.mantissa(); CLR_NZVUF(); @@ -512,8 +512,8 @@ void tms3203x_device::addf(tmsreg &dst, tmsreg &src1, tmsreg &src2) #else void tms3203x_device::addf(tmsreg &dst, tmsreg &src1, tmsreg &src2) { - INT64 man; - INT64 m1, m2; + int64_t man; + int64_t m1, m2; int exp, cnt; // reset over/underflow conditions @@ -534,8 +534,8 @@ void tms3203x_device::addf(tmsreg &dst, tmsreg &src1, tmsreg &src2) } // extract mantissas from 1.0.31 values to 1.1.31 values - m1 = (INT64)src1.mantissa() ^ 0x80000000; - m2 = (INT64)src2.mantissa() ^ 0x80000000; + m1 = (int64_t)src1.mantissa() ^ 0x80000000; + m2 = (int64_t)src2.mantissa() ^ 0x80000000; // normalize based on the exponent if (src1.exponent() > src2.exponent()) @@ -574,24 +574,24 @@ void tms3203x_device::addf(tmsreg &dst, tmsreg &src1, tmsreg &src2) } // if the mantissa is >= 2.0 or < -2.0, normalize - else if (man >= INT64(U64(0x100000000)) || man < INT64(U64(0xffffffff00000000))) + else if (man >= int64_t(U64(0x100000000)) || man < int64_t(U64(0xffffffff00000000))) { man >>= 1; exp++; } // if the mantissa is < 1.0 and > -1.0, normalize - else if (man < INT64(U64(0x80000000)) && man >= INT64(U64(0xffffffff80000000))) + else if (man < int64_t(U64(0x80000000)) && man >= int64_t(U64(0xffffffff80000000))) { if (man > 0) { - cnt = count_leading_zeros((UINT32)man); + cnt = count_leading_zeros((uint32_t)man); man <<= cnt; exp -= cnt; } else { - cnt = count_leading_ones((UINT32)man); + cnt = count_leading_ones((uint32_t)man); man <<= cnt; exp -= cnt; } @@ -615,7 +615,7 @@ void tms3203x_device::addf(tmsreg &dst, tmsreg &src1, tmsreg &src2) // store the result back, removing the implicit one and putting // back the sign bit - dst.set_mantissa((UINT32)man ^ 0x80000000); + dst.set_mantissa((uint32_t)man ^ 0x80000000); dst.set_exponent(exp); OR_NZF(dst); } @@ -632,8 +632,8 @@ void tms3203x_device::subf(tmsreg &dst, tmsreg &src1, tmsreg &src2) #else void tms3203x_device::subf(tmsreg &dst, tmsreg &src1, tmsreg &src2) { - INT64 man; - INT64 m1, m2; + int64_t man; + int64_t m1, m2; int exp, cnt; // reset over/underflow conditions @@ -648,8 +648,8 @@ void tms3203x_device::subf(tmsreg &dst, tmsreg &src1, tmsreg &src2) } // extract mantissas from 1.0.31 values to 1.1.31 values - m1 = (INT64)src1.mantissa() ^ 0x80000000; - m2 = (INT64)src2.mantissa() ^ 0x80000000; + m1 = (int64_t)src1.mantissa() ^ 0x80000000; + m2 = (int64_t)src2.mantissa() ^ 0x80000000; // normalize based on the exponent if (src1.exponent() > src2.exponent()) @@ -687,24 +687,24 @@ void tms3203x_device::subf(tmsreg &dst, tmsreg &src1, tmsreg &src2) } // if the mantissa is >= 2.0 or < -2.0, normalize - else if (man >= INT64(U64(0x100000000)) || man < INT64(U64(0xffffffff00000000))) + else if (man >= int64_t(U64(0x100000000)) || man < int64_t(U64(0xffffffff00000000))) { man >>= 1; exp++; } // if the mantissa is < 1.0 and > -1.0, normalize - else if (man < INT64(U64(0x80000000)) && man >= INT64(U64(0xffffffff80000000))) + else if (man < int64_t(U64(0x80000000)) && man >= int64_t(U64(0xffffffff80000000))) { if (man > 0) { - cnt = count_leading_zeros((UINT32)man); + cnt = count_leading_zeros((uint32_t)man); man <<= cnt; exp -= cnt; } else { - cnt = count_leading_ones((UINT32)man); + cnt = count_leading_ones((uint32_t)man); man <<= cnt; exp -= cnt; } @@ -730,7 +730,7 @@ void tms3203x_device::subf(tmsreg &dst, tmsreg &src1, tmsreg &src2) // store the result back, removing the implicit one and putting // back the sign bit - dst.set_mantissa((UINT32)man ^ 0x80000000); + dst.set_mantissa((uint32_t)man ^ 0x80000000); dst.set_exponent(exp); OR_NZF(dst); } @@ -760,11 +760,11 @@ void tms3203x_device::mpyf(tmsreg &dst, tmsreg &src1, tmsreg &src2) } // convert the mantissas from 1.0.31 numbers to 1.1.23 numbers - INT32 m1 = (src1.mantissa() >> 8) ^ 0x800000; - INT32 m2 = (src2.mantissa() >> 8) ^ 0x800000; + int32_t m1 = (src1.mantissa() >> 8) ^ 0x800000; + int32_t m2 = (src2.mantissa() >> 8) ^ 0x800000; // multiply the mantissas and add the exponents - INT64 man = (INT64)m1 * (INT64)m2; + int64_t man = (int64_t)m1 * (int64_t)m2; int exp = src1.exponent() + src2.exponent(); // chop off the low bits, going from 1.2.46 down to 1.2.31 @@ -778,11 +778,11 @@ void tms3203x_device::mpyf(tmsreg &dst, tmsreg &src1, tmsreg &src2) } // if the mantissa is >= 2.0 or <= -2.0, normalize - else if (man >= INT64(U64(0x100000000))) + else if (man >= int64_t(U64(0x100000000))) { man >>= 1; exp++; - if (man >= INT64(U64(0x100000000))) + if (man >= int64_t(U64(0x100000000))) { man >>= 1; exp++; @@ -790,7 +790,7 @@ void tms3203x_device::mpyf(tmsreg &dst, tmsreg &src1, tmsreg &src2) } // if the mantissa is >= 2.0 or <= -2.0, normalize - else if (man < INT64(U64(0xffffffff00000000))) + else if (man < int64_t(U64(0xffffffff00000000))) { man >>= 1; exp++; @@ -814,7 +814,7 @@ void tms3203x_device::mpyf(tmsreg &dst, tmsreg &src1, tmsreg &src2) // store the result back, removing the implicit one and putting // back the sign bit - dst.set_mantissa((UINT32)man ^ 0x80000000); + dst.set_mantissa((uint32_t)man ^ 0x80000000); dst.set_exponent(exp); OR_NZF(dst); } @@ -830,7 +830,7 @@ void tms3203x_device::norm(tmsreg &dst, tmsreg &src) #else void tms3203x_device::norm(tmsreg &dst, tmsreg &src) { - INT32 man = src.mantissa(); + int32_t man = src.mantissa(); int exp = src.exponent(); CLR_NZVUF(); @@ -847,13 +847,13 @@ void tms3203x_device::norm(tmsreg &dst, tmsreg &src) int cnt; if (man > 0) { - cnt = count_leading_zeros((UINT32)man); + cnt = count_leading_zeros((uint32_t)man); man <<= cnt; exp -= cnt; } else { - cnt = count_leading_ones((UINT32)man); + cnt = count_leading_ones((uint32_t)man); man <<= cnt; exp -= cnt; } @@ -882,64 +882,64 @@ void tms3203x_device::norm(tmsreg &dst, tmsreg &src) // immediate displacement variants -UINT32 tms3203x_device::mod00_d(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod00_d(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - return IREG(reg) + (UINT8)op; + return IREG(reg) + (uint8_t)op; } -UINT32 tms3203x_device::mod01_d(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod01_d(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - return IREG(reg) - (UINT8)op; + return IREG(reg) - (uint8_t)op; } -UINT32 tms3203x_device::mod02_d(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod02_d(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - IREG(reg) += (UINT8)op; + IREG(reg) += (uint8_t)op; return IREG(reg); } -UINT32 tms3203x_device::mod03_d(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod03_d(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - IREG(reg) -= (UINT8)op; + IREG(reg) -= (uint8_t)op; return IREG(reg); } -UINT32 tms3203x_device::mod04_d(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod04_d(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - IREG(reg) += (UINT8)op; + uint32_t result = IREG(reg); + IREG(reg) += (uint8_t)op; return result; } -UINT32 tms3203x_device::mod05_d(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod05_d(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - IREG(reg) -= (UINT8)op; + uint32_t result = IREG(reg); + IREG(reg) -= (uint8_t)op; return result; } -UINT32 tms3203x_device::mod06_d(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod06_d(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) + (UINT8)op; + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) + (uint8_t)op; if (temp >= IREG(TMR_BK)) temp -= IREG(TMR_BK); IREG(reg) = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); return result; } -UINT32 tms3203x_device::mod07_d(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod07_d(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) - (UINT8)op; + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) - (uint8_t)op; if (temp < 0) temp += IREG(TMR_BK); IREG(reg) = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -949,58 +949,58 @@ UINT32 tms3203x_device::mod07_d(UINT32 op, UINT8 ar) // immediate displacement variants (implied 1) -UINT32 tms3203x_device::mod00_1(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod00_1(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) + 1; } -UINT32 tms3203x_device::mod01_1(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod01_1(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) - 1; } -UINT32 tms3203x_device::mod02_1(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod02_1(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return ++IREG(reg); } -UINT32 tms3203x_device::mod03_1(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod03_1(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return --IREG(reg); } -UINT32 tms3203x_device::mod04_1(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod04_1(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return IREG(reg)++; } -UINT32 tms3203x_device::mod05_1(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod05_1(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return IREG(reg)--; } -UINT32 tms3203x_device::mod06_1(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod06_1(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) + 1; + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) + 1; if (temp >= IREG(TMR_BK)) temp -= IREG(TMR_BK); IREG(reg) = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); return result; } -UINT32 tms3203x_device::mod07_1(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod07_1(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) - 1; + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) - 1; if (temp < 0) temp += IREG(TMR_BK); IREG(reg) = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -1010,64 +1010,64 @@ UINT32 tms3203x_device::mod07_1(UINT32 op, UINT8 ar) // IR0 displacement variants -UINT32 tms3203x_device::mod08(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod08(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) + IREG(TMR_IR0); } -UINT32 tms3203x_device::mod09(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod09(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) - IREG(TMR_IR0); } -UINT32 tms3203x_device::mod0a(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod0a(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); IREG(reg) += IREG(TMR_IR0); return IREG(reg); } -UINT32 tms3203x_device::mod0b(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod0b(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); IREG(reg) -= IREG(TMR_IR0); return IREG(reg); } -UINT32 tms3203x_device::mod0c(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod0c(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); + uint32_t result = IREG(reg); IREG(reg) += IREG(TMR_IR0); return result; } -UINT32 tms3203x_device::mod0d(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod0d(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); + uint32_t result = IREG(reg); IREG(reg) -= IREG(TMR_IR0); return result; } -UINT32 tms3203x_device::mod0e(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod0e(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) + IREG(TMR_IR0); + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) + IREG(TMR_IR0); if (temp >= IREG(TMR_BK)) temp -= IREG(TMR_BK); IREG(reg) = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); return result; } -UINT32 tms3203x_device::mod0f(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod0f(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) - IREG(TMR_IR0); + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) - IREG(TMR_IR0); if (temp < 0) temp += IREG(TMR_BK); IREG(reg) = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -1077,64 +1077,64 @@ UINT32 tms3203x_device::mod0f(UINT32 op, UINT8 ar) // IR1 displacement variants -UINT32 tms3203x_device::mod10(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod10(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) + IREG(TMR_IR1); } -UINT32 tms3203x_device::mod11(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod11(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) - IREG(TMR_IR1); } -UINT32 tms3203x_device::mod12(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod12(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); IREG(reg) += IREG(TMR_IR1); return IREG(reg); } -UINT32 tms3203x_device::mod13(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod13(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); IREG(reg) -= IREG(TMR_IR1); return IREG(reg); } -UINT32 tms3203x_device::mod14(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod14(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); + uint32_t result = IREG(reg); IREG(reg) += IREG(TMR_IR1); return result; } -UINT32 tms3203x_device::mod15(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod15(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); + uint32_t result = IREG(reg); IREG(reg) -= IREG(TMR_IR1); return result; } -UINT32 tms3203x_device::mod16(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod16(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) + IREG(TMR_IR1); + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) + IREG(TMR_IR1); if (temp >= IREG(TMR_BK)) temp -= IREG(TMR_BK); IREG(reg) = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); return result; } -UINT32 tms3203x_device::mod17(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod17(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) - IREG(TMR_IR1); + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) - IREG(TMR_IR1); if (temp < 0) temp += IREG(TMR_BK); IREG(reg) = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -1144,19 +1144,19 @@ UINT32 tms3203x_device::mod17(UINT32 op, UINT8 ar) // special variants -UINT32 tms3203x_device::mod18(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod18(uint32_t op, uint8_t ar) { int reg = TMR_AR0 + (ar & 7); return IREG(reg); } -UINT32 tms3203x_device::mod19(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::mod19(uint32_t op, uint8_t ar) { unimplemented(op); return 0; } -UINT32 tms3203x_device::modillegal(UINT32 op, UINT8 ar) +uint32_t tms3203x_device::modillegal(uint32_t op, uint8_t ar) { illegal(op); return 0; @@ -1165,37 +1165,37 @@ UINT32 tms3203x_device::modillegal(UINT32 op, UINT8 ar) // immediate displacement variants (implied 1) -UINT32 tms3203x_device::mod00_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod00_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) + 1; } -UINT32 tms3203x_device::mod01_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod01_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) - 1; } -UINT32 tms3203x_device::mod02_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod02_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 defval = IREG(reg) + 1; + uint32_t defval = IREG(reg) + 1; *defptrptr = defval; defptrptr = &IREG(reg); return defval; } -UINT32 tms3203x_device::mod03_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod03_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 defval = IREG(reg) - 1; + uint32_t defval = IREG(reg) - 1; *defptrptr = defval; defptrptr = &IREG(reg); return defval; } -UINT32 tms3203x_device::mod04_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod04_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); *defptrptr = IREG(reg) + 1; @@ -1203,7 +1203,7 @@ UINT32 tms3203x_device::mod04_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return IREG(reg); } -UINT32 tms3203x_device::mod05_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod05_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); *defptrptr = IREG(reg) - 1; @@ -1211,11 +1211,11 @@ UINT32 tms3203x_device::mod05_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return IREG(reg); } -UINT32 tms3203x_device::mod06_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod06_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) + 1; + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) + 1; if (temp >= IREG(TMR_BK)) temp -= IREG(TMR_BK); *defptrptr = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -1223,11 +1223,11 @@ UINT32 tms3203x_device::mod06_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return result; } -UINT32 tms3203x_device::mod07_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod07_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) - 1; + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) - 1; if (temp < 0) temp += IREG(TMR_BK); *defptrptr = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -1238,37 +1238,37 @@ UINT32 tms3203x_device::mod07_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) // IR0 displacement variants -UINT32 tms3203x_device::mod08_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod08_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) + IREG(TMR_IR0); } -UINT32 tms3203x_device::mod09_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod09_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) - IREG(TMR_IR0); } -UINT32 tms3203x_device::mod0a_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod0a_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 defval = IREG(reg) + IREG(TMR_IR0); + uint32_t defval = IREG(reg) + IREG(TMR_IR0); *defptrptr = defval; defptrptr = &IREG(reg); return defval; } -UINT32 tms3203x_device::mod0b_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod0b_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 defval = IREG(reg) - IREG(TMR_IR0); + uint32_t defval = IREG(reg) - IREG(TMR_IR0); *defptrptr = defval; defptrptr = &IREG(reg); return defval; } -UINT32 tms3203x_device::mod0c_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod0c_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); *defptrptr = IREG(reg) + IREG(TMR_IR0); @@ -1276,7 +1276,7 @@ UINT32 tms3203x_device::mod0c_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return IREG(reg); } -UINT32 tms3203x_device::mod0d_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod0d_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); *defptrptr = IREG(reg) - IREG(TMR_IR0); @@ -1284,11 +1284,11 @@ UINT32 tms3203x_device::mod0d_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return IREG(reg); } -UINT32 tms3203x_device::mod0e_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod0e_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) + IREG(TMR_IR0); + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) + IREG(TMR_IR0); if (temp >= IREG(TMR_BK)) temp -= IREG(TMR_BK); *defptrptr = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -1296,11 +1296,11 @@ UINT32 tms3203x_device::mod0e_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return result; } -UINT32 tms3203x_device::mod0f_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod0f_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) - IREG(TMR_IR0); + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) - IREG(TMR_IR0); if (temp < 0) temp += IREG(TMR_BK); *defptrptr = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -1311,37 +1311,37 @@ UINT32 tms3203x_device::mod0f_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) // IR1 displacement variants -UINT32 tms3203x_device::mod10_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod10_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) + IREG(TMR_IR1); } -UINT32 tms3203x_device::mod11_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod11_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); return IREG(reg) - IREG(TMR_IR1); } -UINT32 tms3203x_device::mod12_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod12_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 defval = IREG(reg) + IREG(TMR_IR1); + uint32_t defval = IREG(reg) + IREG(TMR_IR1); *defptrptr = defval; defptrptr = &IREG(reg); return defval; } -UINT32 tms3203x_device::mod13_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod13_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 defval = IREG(reg) - IREG(TMR_IR1); + uint32_t defval = IREG(reg) - IREG(TMR_IR1); *defptrptr = defval; defptrptr = &IREG(reg); return defval; } -UINT32 tms3203x_device::mod14_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod14_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); *defptrptr = IREG(reg) + IREG(TMR_IR1); @@ -1349,7 +1349,7 @@ UINT32 tms3203x_device::mod14_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return IREG(reg); } -UINT32 tms3203x_device::mod15_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod15_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); *defptrptr = IREG(reg) - IREG(TMR_IR1); @@ -1357,11 +1357,11 @@ UINT32 tms3203x_device::mod15_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return IREG(reg); } -UINT32 tms3203x_device::mod16_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod16_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) + IREG(TMR_IR1); + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) + IREG(TMR_IR1); if (temp >= IREG(TMR_BK)) temp -= IREG(TMR_BK); *defptrptr = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -1369,11 +1369,11 @@ UINT32 tms3203x_device::mod16_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return result; } -UINT32 tms3203x_device::mod17_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod17_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); - UINT32 result = IREG(reg); - INT32 temp = (result & m_bkmask) - IREG(TMR_IR1); + uint32_t result = IREG(reg); + int32_t temp = (result & m_bkmask) - IREG(TMR_IR1); if (temp < 0) temp += IREG(TMR_BK); *defptrptr = (IREG(reg) & ~m_bkmask) | (temp & m_bkmask); @@ -1381,19 +1381,19 @@ UINT32 tms3203x_device::mod17_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) return result; } -UINT32 tms3203x_device::mod18_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod18_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { int reg = TMR_AR0 + (ar & 7); return IREG(reg); } -UINT32 tms3203x_device::mod19_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::mod19_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { unimplemented(op); return 0; } -UINT32 tms3203x_device::modillegal_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) +uint32_t tms3203x_device::modillegal_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr) { illegal(op); return 0; @@ -1404,42 +1404,42 @@ UINT32 tms3203x_device::modillegal_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr) #define ABSF(dreg, sreg) \ { \ - INT32 man = FREGMAN(sreg); \ + int32_t man = FREGMAN(sreg); \ CLR_NZVUF(); \ m_r[dreg] = m_r[sreg]; \ if (man < 0) \ { \ m_r[dreg].set_mantissa(~man); \ - if (man == (INT32)0x80000000 && FREGEXP(sreg) == 127) \ + if (man == (int32_t)0x80000000 && FREGEXP(sreg) == 127) \ IREG(TMR_ST) |= VFLAG | LVFLAG; \ } \ OR_NZF(m_r[dreg]); \ } -void tms3203x_device::absf_reg(UINT32 op) +void tms3203x_device::absf_reg(uint32_t op) { int dreg = (op >> 16) & 7; int sreg = op & 7; ABSF(dreg, sreg); } -void tms3203x_device::absf_dir(UINT32 op) +void tms3203x_device::absf_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); ABSF(dreg, TMR_TEMP1); } -void tms3203x_device::absf_ind(UINT32 op) +void tms3203x_device::absf_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); ABSF(dreg, TMR_TEMP1); } -void tms3203x_device::absf_imm(UINT32 op) +void tms3203x_device::absf_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(TMR_TEMP1, op); @@ -1450,7 +1450,7 @@ void tms3203x_device::absf_imm(UINT32 op) #define ABSI(dreg, src) \ { \ - UINT32 _res = ((INT32)src < 0) ? -src : src; \ + uint32_t _res = ((int32_t)src < 0) ? -src : src; \ if (!OVM() || _res != 0x80000000) \ IREG(dreg) = _res; \ else \ @@ -1466,30 +1466,30 @@ void tms3203x_device::absf_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::absi_reg(UINT32 op) +void tms3203x_device::absi_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; ABSI(dreg, src); } -void tms3203x_device::absi_dir(UINT32 op) +void tms3203x_device::absi_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; ABSI(dreg, src); } -void tms3203x_device::absi_ind(UINT32 op) +void tms3203x_device::absi_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; ABSI(dreg, src); } -void tms3203x_device::absi_imm(UINT32 op) +void tms3203x_device::absi_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; ABSI(dreg, src); } @@ -1498,14 +1498,14 @@ void tms3203x_device::absi_imm(UINT32 op) #define ADDC(dreg, src1, src2) \ { \ - UINT32 _res = src1 + src2 + (IREG(TMR_ST) & CFLAG); \ + uint32_t _res = src1 + src2 + (IREG(TMR_ST) & CFLAG); \ if (!OVM() || !OVERFLOW_ADD(src1,src2,_res)) \ IREG(dreg) = _res; \ else \ - IREG(dreg) = ((INT32)src1 < 0) ? 0x80000000 : 0x7fffffff; \ + IREG(dreg) = ((int32_t)src1 < 0) ? 0x80000000 : 0x7fffffff; \ if (dreg < 8) \ { \ - UINT32 tempc = IREG(TMR_ST) & CFLAG; \ + uint32_t tempc = IREG(TMR_ST) & CFLAG; \ CLR_NZCVUF(); \ OR_C_ADC(src1,src2,tempc); \ OR_V_ADD(src1,src2,_res); \ @@ -1515,63 +1515,63 @@ void tms3203x_device::absi_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::addc_reg(UINT32 op) +void tms3203x_device::addc_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ADDC(dreg, dst, src); } -void tms3203x_device::addc_dir(UINT32 op) +void tms3203x_device::addc_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ADDC(dreg, dst, src); } -void tms3203x_device::addc_ind(UINT32 op) +void tms3203x_device::addc_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ADDC(dreg, dst, src); } -void tms3203x_device::addc_imm(UINT32 op) +void tms3203x_device::addc_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ADDC(dreg, dst, src); } /*-----------------------------------------------------*/ -void tms3203x_device::addf_reg(UINT32 op) +void tms3203x_device::addf_reg(uint32_t op) { int dreg = (op >> 16) & 7; addf(m_r[dreg], m_r[dreg], m_r[op & 7]); } -void tms3203x_device::addf_dir(UINT32 op) +void tms3203x_device::addf_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); addf(m_r[dreg], m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::addf_ind(UINT32 op) +void tms3203x_device::addf_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); addf(m_r[dreg], m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::addf_imm(UINT32 op) +void tms3203x_device::addf_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(TMR_TEMP1, op); @@ -1582,11 +1582,11 @@ void tms3203x_device::addf_imm(UINT32 op) #define ADDI(dreg, src1, src2) \ { \ - UINT32 _res = src1 + src2; \ + uint32_t _res = src1 + src2; \ if (!OVM() || !OVERFLOW_ADD(src1,src2,_res)) \ IREG(dreg) = _res; \ else \ - IREG(dreg) = ((INT32)src1 < 0) ? 0x80000000 : 0x7fffffff; \ + IREG(dreg) = ((int32_t)src1 < 0) ? 0x80000000 : 0x7fffffff; \ if (dreg < 8) \ { \ CLR_NZCVUF(); \ @@ -1598,35 +1598,35 @@ void tms3203x_device::addf_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::addi_reg(UINT32 op) +void tms3203x_device::addi_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ADDI(dreg, dst, src); } -void tms3203x_device::addi_dir(UINT32 op) +void tms3203x_device::addi_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ADDI(dreg, dst, src); } -void tms3203x_device::addi_ind(UINT32 op) +void tms3203x_device::addi_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ADDI(dreg, dst, src); } -void tms3203x_device::addi_imm(UINT32 op) +void tms3203x_device::addi_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ADDI(dreg, dst, src); } @@ -1634,7 +1634,7 @@ void tms3203x_device::addi_imm(UINT32 op) #define AND(dreg, src1, src2) \ { \ - UINT32 _res = (src1) & (src2); \ + uint32_t _res = (src1) & (src2); \ IREG(dreg) = _res; \ if (dreg < 8) \ { \ @@ -1645,35 +1645,35 @@ void tms3203x_device::addi_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::and_reg(UINT32 op) +void tms3203x_device::and_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); AND(dreg, dst, src); } -void tms3203x_device::and_dir(UINT32 op) +void tms3203x_device::and_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); AND(dreg, dst, src); } -void tms3203x_device::and_ind(UINT32 op) +void tms3203x_device::and_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); AND(dreg, dst, src); } -void tms3203x_device::and_imm(UINT32 op) +void tms3203x_device::and_imm(uint32_t op) { - UINT32 src = (UINT16)op; + uint32_t src = (uint16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); AND(dreg, dst, src); } @@ -1681,7 +1681,7 @@ void tms3203x_device::and_imm(UINT32 op) #define ANDN(dreg, src1, src2) \ { \ - UINT32 _res = (src1) & ~(src2); \ + uint32_t _res = (src1) & ~(src2); \ IREG(dreg) = _res; \ if (dreg < 8) \ { \ @@ -1692,35 +1692,35 @@ void tms3203x_device::and_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::andn_reg(UINT32 op) +void tms3203x_device::andn_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ANDN(dreg, dst, src); } -void tms3203x_device::andn_dir(UINT32 op) +void tms3203x_device::andn_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ANDN(dreg, dst, src); } -void tms3203x_device::andn_ind(UINT32 op) +void tms3203x_device::andn_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ANDN(dreg, dst, src); } -void tms3203x_device::andn_imm(UINT32 op) +void tms3203x_device::andn_imm(uint32_t op) { - UINT32 src = (UINT16)op; + uint32_t src = (uint16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); ANDN(dreg, dst, src); } @@ -1728,19 +1728,19 @@ void tms3203x_device::andn_imm(UINT32 op) #define ASH(dreg, src, count) \ { \ - UINT32 _res; \ - INT32 _count = (INT16)(count << 9) >> 9; /* 7 LSBs */ \ + uint32_t _res; \ + int32_t _count = (int16_t)(count << 9) >> 9; /* 7 LSBs */ \ if (_count < 0) \ { \ if (_count >= -31) \ - _res = (INT32)src >> -_count; \ + _res = (int32_t)src >> -_count; \ else \ - _res = (INT32)src >> 31; \ + _res = (int32_t)src >> 31; \ } \ else \ { \ if (_count <= 31) \ - _res = (INT32)src << _count; \ + _res = (int32_t)src << _count; \ else \ _res = 0; \ } \ @@ -1752,77 +1752,77 @@ void tms3203x_device::andn_imm(UINT32 op) if (_count < 0) \ { \ if (_count >= -32) \ - OR_C(((INT32)src >> (-_count - 1)) & 1); \ + OR_C(((int32_t)src >> (-_count - 1)) & 1); \ else \ - OR_C(((INT32)src >> 31) & 1); \ + OR_C(((int32_t)src >> 31) & 1); \ } \ else if (_count > 0) \ { \ if (_count <= 32) \ - OR_C(((UINT32)src << (_count - 1)) >> 31); \ + OR_C(((uint32_t)src << (_count - 1)) >> 31); \ } \ } \ else if (dreg >= TMR_BK) \ update_special(dreg); \ } -void tms3203x_device::ash_reg(UINT32 op) +void tms3203x_device::ash_reg(uint32_t op) { int dreg = (op >> 16) & 31; int count = IREG(op & 31); - UINT32 src = IREG(dreg); + uint32_t src = IREG(dreg); ASH(dreg, src, count); } -void tms3203x_device::ash_dir(UINT32 op) +void tms3203x_device::ash_dir(uint32_t op) { int dreg = (op >> 16) & 31; int count = RMEM(DIRECT(op)); - UINT32 src = IREG(dreg); + uint32_t src = IREG(dreg); ASH(dreg, src, count); } -void tms3203x_device::ash_ind(UINT32 op) +void tms3203x_device::ash_ind(uint32_t op) { int dreg = (op >> 16) & 31; int count = RMEM(INDIRECT_D(op, op >> 8)); - UINT32 src = IREG(dreg); + uint32_t src = IREG(dreg); ASH(dreg, src, count); } -void tms3203x_device::ash_imm(UINT32 op) +void tms3203x_device::ash_imm(uint32_t op) { int dreg = (op >> 16) & 31; int count = op; - UINT32 src = IREG(dreg); + uint32_t src = IREG(dreg); ASH(dreg, src, count); } /*-----------------------------------------------------*/ -void tms3203x_device::cmpf_reg(UINT32 op) +void tms3203x_device::cmpf_reg(uint32_t op) { int dreg = (op >> 16) & 7; subf(m_r[TMR_TEMP2], m_r[dreg], m_r[op & 7]); } -void tms3203x_device::cmpf_dir(UINT32 op) +void tms3203x_device::cmpf_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); subf(m_r[TMR_TEMP2], m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::cmpf_ind(UINT32 op) +void tms3203x_device::cmpf_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); subf(m_r[TMR_TEMP2], m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::cmpf_imm(UINT32 op) +void tms3203x_device::cmpf_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(TMR_TEMP1, op); @@ -1833,44 +1833,44 @@ void tms3203x_device::cmpf_imm(UINT32 op) #define CMPI(src1, src2) \ { \ - UINT32 _res = src1 - src2; \ + uint32_t _res = src1 - src2; \ CLR_NZCVUF(); \ OR_C_SUB(src1,src2,_res); \ OR_V_SUB(src1,src2,_res); \ OR_NZ(_res); \ } -void tms3203x_device::cmpi_reg(UINT32 op) +void tms3203x_device::cmpi_reg(uint32_t op) { - UINT32 src = IREG(op & 31); - UINT32 dst = IREG((op >> 16) & 31); + uint32_t src = IREG(op & 31); + uint32_t dst = IREG((op >> 16) & 31); CMPI(dst, src); } -void tms3203x_device::cmpi_dir(UINT32 op) +void tms3203x_device::cmpi_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); - UINT32 dst = IREG((op >> 16) & 31); + uint32_t src = RMEM(DIRECT(op)); + uint32_t dst = IREG((op >> 16) & 31); CMPI(dst, src); } -void tms3203x_device::cmpi_ind(UINT32 op) +void tms3203x_device::cmpi_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); - UINT32 dst = IREG((op >> 16) & 31); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t dst = IREG((op >> 16) & 31); CMPI(dst, src); } -void tms3203x_device::cmpi_imm(UINT32 op) +void tms3203x_device::cmpi_imm(uint32_t op) { - UINT32 src = (INT16)op; - UINT32 dst = IREG((op >> 16) & 31); + uint32_t src = (int16_t)op; + uint32_t dst = IREG((op >> 16) & 31); CMPI(dst, src); } /*-----------------------------------------------------*/ -void tms3203x_device::fix_reg(UINT32 op) +void tms3203x_device::fix_reg(uint32_t op) { int dreg = (op >> 16) & 31; m_r[TMR_TEMP1] = m_r[op & 7]; @@ -1878,25 +1878,25 @@ void tms3203x_device::fix_reg(UINT32 op) m_r[dreg].set_mantissa(m_r[TMR_TEMP1].mantissa()); } -void tms3203x_device::fix_dir(UINT32 op) +void tms3203x_device::fix_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; LONG2FP(TMR_TEMP1, res); float2int(m_r[TMR_TEMP1], dreg < 8); m_r[dreg].set_mantissa(m_r[TMR_TEMP1].mantissa()); } -void tms3203x_device::fix_ind(UINT32 op) +void tms3203x_device::fix_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; LONG2FP(TMR_TEMP1, res); float2int(m_r[TMR_TEMP1], dreg < 8); m_r[dreg].set_mantissa(m_r[TMR_TEMP1].mantissa()); } -void tms3203x_device::fix_imm(UINT32 op) +void tms3203x_device::fix_imm(uint32_t op) { int dreg = (op >> 16) & 31; SHORT2FP(TMR_TEMP1, op); @@ -1912,37 +1912,37 @@ void tms3203x_device::fix_imm(UINT32 op) int2float(m_r[dreg]); \ } -void tms3203x_device::float_reg(UINT32 op) +void tms3203x_device::float_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 7; FLOAT(dreg, src); } -void tms3203x_device::float_dir(UINT32 op) +void tms3203x_device::float_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; FLOAT(dreg, src); } -void tms3203x_device::float_ind(UINT32 op) +void tms3203x_device::float_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; FLOAT(dreg, src); } -void tms3203x_device::float_imm(UINT32 op) +void tms3203x_device::float_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 7; FLOAT(dreg, src); } /*-----------------------------------------------------*/ -void tms3203x_device::idle(UINT32 op) +void tms3203x_device::idle(uint32_t op) { m_is_idling = true; IREG(TMR_ST) |= GIEFLAG; @@ -1953,7 +1953,7 @@ void tms3203x_device::idle(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::lde_reg(UINT32 op) +void tms3203x_device::lde_reg(uint32_t op) { int dreg = (op >> 16) & 7; m_r[dreg].set_exponent(m_r[op & 7].exponent()); @@ -1961,9 +1961,9 @@ void tms3203x_device::lde_reg(UINT32 op) m_r[dreg].set_mantissa(0); } -void tms3203x_device::lde_dir(UINT32 op) +void tms3203x_device::lde_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); m_r[dreg].set_exponent(m_r[TMR_TEMP1].exponent()); @@ -1971,9 +1971,9 @@ void tms3203x_device::lde_dir(UINT32 op) m_r[dreg].set_mantissa(0); } -void tms3203x_device::lde_ind(UINT32 op) +void tms3203x_device::lde_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); m_r[dreg].set_exponent(m_r[TMR_TEMP1].exponent()); @@ -1981,7 +1981,7 @@ void tms3203x_device::lde_ind(UINT32 op) m_r[dreg].set_mantissa(0); } -void tms3203x_device::lde_imm(UINT32 op) +void tms3203x_device::lde_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(TMR_TEMP1, op); @@ -1992,7 +1992,7 @@ void tms3203x_device::lde_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldf_reg(UINT32 op) +void tms3203x_device::ldf_reg(uint32_t op) { int dreg = (op >> 16) & 7; m_r[dreg] = m_r[op & 7]; @@ -2000,25 +2000,25 @@ void tms3203x_device::ldf_reg(UINT32 op) OR_NZF(m_r[dreg]); } -void tms3203x_device::ldf_dir(UINT32 op) +void tms3203x_device::ldf_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); CLR_NZVUF(); OR_NZF(m_r[dreg]); } -void tms3203x_device::ldf_ind(UINT32 op) +void tms3203x_device::ldf_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); CLR_NZVUF(); OR_NZF(m_r[dreg]); } -void tms3203x_device::ldf_imm(UINT32 op) +void tms3203x_device::ldf_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(dreg, op); @@ -2028,8 +2028,8 @@ void tms3203x_device::ldf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfi_dir(UINT32 op) { unimplemented(op); } -void tms3203x_device::ldfi_ind(UINT32 op) { unimplemented(op); } +void tms3203x_device::ldfi_dir(uint32_t op) { unimplemented(op); } +void tms3203x_device::ldfi_ind(uint32_t op) { unimplemented(op); } /*-----------------------------------------------------*/ @@ -2045,62 +2045,62 @@ void tms3203x_device::ldfi_ind(UINT32 op) { unimplemented(op); } update_special(dreg); \ } -void tms3203x_device::ldi_reg(UINT32 op) +void tms3203x_device::ldi_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; LDI(dreg, src); } -void tms3203x_device::ldi_dir(UINT32 op) +void tms3203x_device::ldi_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; LDI(dreg, src); } -void tms3203x_device::ldi_ind(UINT32 op) +void tms3203x_device::ldi_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; LDI(dreg, src); } -void tms3203x_device::ldi_imm(UINT32 op) +void tms3203x_device::ldi_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; LDI(dreg, src); } /*-----------------------------------------------------*/ -void tms3203x_device::ldii_dir(UINT32 op) { unimplemented(op); } -void tms3203x_device::ldii_ind(UINT32 op) { unimplemented(op); } +void tms3203x_device::ldii_dir(uint32_t op) { unimplemented(op); } +void tms3203x_device::ldii_ind(uint32_t op) { unimplemented(op); } /*-----------------------------------------------------*/ -void tms3203x_device::ldm_reg(UINT32 op) +void tms3203x_device::ldm_reg(uint32_t op) { int dreg = (op >> 16) & 7; m_r[dreg].set_mantissa(m_r[op & 7].mantissa()); } -void tms3203x_device::ldm_dir(UINT32 op) +void tms3203x_device::ldm_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; m_r[dreg].set_mantissa(res); } -void tms3203x_device::ldm_ind(UINT32 op) +void tms3203x_device::ldm_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; m_r[dreg].set_mantissa(res); } -void tms3203x_device::ldm_imm(UINT32 op) +void tms3203x_device::ldm_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(TMR_TEMP1, op); @@ -2111,19 +2111,19 @@ void tms3203x_device::ldm_imm(UINT32 op) #define LSH(dreg, src, count) \ { \ - UINT32 _res; \ - INT32 _count = (INT16)(count << 9) >> 9; /* 7 LSBs */ \ + uint32_t _res; \ + int32_t _count = (int16_t)(count << 9) >> 9; /* 7 LSBs */ \ if (_count < 0) \ { \ if (_count >= -31) \ - _res = (UINT32)src >> -_count; \ + _res = (uint32_t)src >> -_count; \ else \ _res = 0; \ } \ else \ { \ if (_count <= 31) \ - _res = (UINT32)src << _count; \ + _res = (uint32_t)src << _count; \ else \ _res = 0; \ } \ @@ -2135,75 +2135,75 @@ void tms3203x_device::ldm_imm(UINT32 op) if (_count < 0) \ { \ if (_count >= -32) \ - OR_C(((UINT32)src >> (-_count - 1)) & 1); \ + OR_C(((uint32_t)src >> (-_count - 1)) & 1); \ } \ else if (_count > 0) \ { \ if (_count <= 32) \ - OR_C(((UINT32)src << (_count - 1)) >> 31); \ + OR_C(((uint32_t)src << (_count - 1)) >> 31); \ } \ } \ else if (dreg >= TMR_BK) \ update_special(dreg); \ } -void tms3203x_device::lsh_reg(UINT32 op) +void tms3203x_device::lsh_reg(uint32_t op) { int dreg = (op >> 16) & 31; int count = IREG(op & 31); - UINT32 src = IREG(dreg); + uint32_t src = IREG(dreg); LSH(dreg, src, count); } -void tms3203x_device::lsh_dir(UINT32 op) +void tms3203x_device::lsh_dir(uint32_t op) { int dreg = (op >> 16) & 31; int count = RMEM(DIRECT(op)); - UINT32 src = IREG(dreg); + uint32_t src = IREG(dreg); LSH(dreg, src, count); } -void tms3203x_device::lsh_ind(UINT32 op) +void tms3203x_device::lsh_ind(uint32_t op) { int dreg = (op >> 16) & 31; int count = RMEM(INDIRECT_D(op, op >> 8)); - UINT32 src = IREG(dreg); + uint32_t src = IREG(dreg); LSH(dreg, src, count); } -void tms3203x_device::lsh_imm(UINT32 op) +void tms3203x_device::lsh_imm(uint32_t op) { int dreg = (op >> 16) & 31; int count = op; - UINT32 src = IREG(dreg); + uint32_t src = IREG(dreg); LSH(dreg, src, count); } /*-----------------------------------------------------*/ -void tms3203x_device::mpyf_reg(UINT32 op) +void tms3203x_device::mpyf_reg(uint32_t op) { int dreg = (op >> 16) & 31; mpyf(m_r[dreg], m_r[dreg], m_r[op & 31]); } -void tms3203x_device::mpyf_dir(UINT32 op) +void tms3203x_device::mpyf_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; LONG2FP(TMR_TEMP1, res); mpyf(m_r[dreg], m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::mpyf_ind(UINT32 op) +void tms3203x_device::mpyf_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; LONG2FP(TMR_TEMP1, res); mpyf(m_r[dreg], m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::mpyf_imm(UINT32 op) +void tms3203x_device::mpyf_imm(uint32_t op) { int dreg = (op >> 16) & 31; SHORT2FP(TMR_TEMP1, op); @@ -2214,51 +2214,51 @@ void tms3203x_device::mpyf_imm(UINT32 op) #define MPYI(dreg, src1, src2) \ { \ - INT64 _res = (INT64)((INT32)(src1 << 8) >> 8) * (INT64)((INT32)(src2 << 8) >> 8);\ - if (!OVM() || (_res >= -(INT64)0x80000000 && _res <= (INT64)0x7fffffff)) \ + int64_t _res = (int64_t)((int32_t)(src1 << 8) >> 8) * (int64_t)((int32_t)(src2 << 8) >> 8);\ + if (!OVM() || (_res >= -(int64_t)0x80000000 && _res <= (int64_t)0x7fffffff)) \ IREG(dreg) = _res; \ else \ IREG(dreg) = (_res < 0) ? 0x80000000 : 0x7fffffff; \ if (dreg < 8) \ { \ CLR_NZVUF(); \ - OR_NZ((UINT32)_res); \ - if (_res < -(INT64)0x80000000 || _res > (INT64)0x7fffffff) \ + OR_NZ((uint32_t)_res); \ + if (_res < -(int64_t)0x80000000 || _res > (int64_t)0x7fffffff) \ IREG(TMR_ST) |= VFLAG | LVFLAG; \ } \ else if (dreg >= TMR_BK) \ update_special(dreg); \ } -void tms3203x_device::mpyi_reg(UINT32 op) +void tms3203x_device::mpyi_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); MPYI(dreg, dst, src); } -void tms3203x_device::mpyi_dir(UINT32 op) +void tms3203x_device::mpyi_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); MPYI(dreg, dst, src); } -void tms3203x_device::mpyi_ind(UINT32 op) +void tms3203x_device::mpyi_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); MPYI(dreg, dst, src); } -void tms3203x_device::mpyi_imm(UINT32 op) +void tms3203x_device::mpyi_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); MPYI(dreg, dst, src); } @@ -2266,14 +2266,14 @@ void tms3203x_device::mpyi_imm(UINT32 op) #define NEGB(dreg, src) \ { \ - UINT32 _res = 0 - src - (IREG(TMR_ST) & CFLAG); \ + uint32_t _res = 0 - src - (IREG(TMR_ST) & CFLAG); \ if (!OVM() || !OVERFLOW_SUB(0,src,_res)) \ IREG(dreg) = _res; \ else \ - IREG(dreg) = ((INT32)src < 0) ? 0x80000000 : 0x7fffffff; \ + IREG(dreg) = ((int32_t)src < 0) ? 0x80000000 : 0x7fffffff; \ if (dreg < 8) \ { \ - UINT32 tempc = IREG(TMR_ST) & CFLAG; \ + uint32_t tempc = IREG(TMR_ST) & CFLAG; \ CLR_NZCVUF(); \ OR_C_SBB(0,src,tempc); \ OR_V_SUB(0,src,_res); \ @@ -2283,59 +2283,59 @@ void tms3203x_device::mpyi_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::negb_reg(UINT32 op) +void tms3203x_device::negb_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; NEGB(dreg, src); } -void tms3203x_device::negb_dir(UINT32 op) +void tms3203x_device::negb_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; NEGB(dreg, src); } -void tms3203x_device::negb_ind(UINT32 op) +void tms3203x_device::negb_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; NEGB(dreg, src); } -void tms3203x_device::negb_imm(UINT32 op) +void tms3203x_device::negb_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; NEGB(dreg, src); } /*-----------------------------------------------------*/ -void tms3203x_device::negf_reg(UINT32 op) +void tms3203x_device::negf_reg(uint32_t op) { int dreg = (op >> 16) & 7; negf(m_r[dreg], m_r[op & 7]); } -void tms3203x_device::negf_dir(UINT32 op) +void tms3203x_device::negf_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); negf(m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::negf_ind(UINT32 op) +void tms3203x_device::negf_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); negf(m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::negf_imm(UINT32 op) +void tms3203x_device::negf_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(TMR_TEMP1, op); @@ -2346,11 +2346,11 @@ void tms3203x_device::negf_imm(UINT32 op) #define NEGI(dreg, src) \ { \ - UINT32 _res = 0 - src; \ + uint32_t _res = 0 - src; \ if (!OVM() || !OVERFLOW_SUB(0,src,_res)) \ IREG(dreg) = _res; \ else \ - IREG(dreg) = ((INT32)src < 0) ? 0x80000000 : 0x7fffffff; \ + IREG(dreg) = ((int32_t)src < 0) ? 0x80000000 : 0x7fffffff; \ if (dreg < 8) \ { \ CLR_NZCVUF(); \ @@ -2362,70 +2362,70 @@ void tms3203x_device::negf_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::negi_reg(UINT32 op) +void tms3203x_device::negi_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; NEGI(dreg, src); } -void tms3203x_device::negi_dir(UINT32 op) +void tms3203x_device::negi_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; NEGI(dreg, src); } -void tms3203x_device::negi_ind(UINT32 op) +void tms3203x_device::negi_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; NEGI(dreg, src); } -void tms3203x_device::negi_imm(UINT32 op) +void tms3203x_device::negi_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; NEGI(dreg, src); } /*-----------------------------------------------------*/ -void tms3203x_device::nop_reg(UINT32 op) +void tms3203x_device::nop_reg(uint32_t op) { } -void tms3203x_device::nop_ind(UINT32 op) +void tms3203x_device::nop_ind(uint32_t op) { RMEM(INDIRECT_D(op, op >> 8)); } /*-----------------------------------------------------*/ -void tms3203x_device::norm_reg(UINT32 op) +void tms3203x_device::norm_reg(uint32_t op) { int dreg = (op >> 16) & 7; norm(m_r[dreg], m_r[op & 7]); } -void tms3203x_device::norm_dir(UINT32 op) +void tms3203x_device::norm_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); norm(m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::norm_ind(UINT32 op) +void tms3203x_device::norm_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); norm(m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::norm_imm(UINT32 op) +void tms3203x_device::norm_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(TMR_TEMP1, op); @@ -2436,7 +2436,7 @@ void tms3203x_device::norm_imm(UINT32 op) #define NOT(dreg, src) \ { \ - UINT32 _res = ~(src); \ + uint32_t _res = ~(src); \ IREG(dreg) = _res; \ if (dreg < 8) \ { \ @@ -2447,40 +2447,40 @@ void tms3203x_device::norm_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::not_reg(UINT32 op) +void tms3203x_device::not_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; NOT(dreg, src); } -void tms3203x_device::not_dir(UINT32 op) +void tms3203x_device::not_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; NOT(dreg, src); } -void tms3203x_device::not_ind(UINT32 op) +void tms3203x_device::not_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; NOT(dreg, src); } -void tms3203x_device::not_imm(UINT32 op) +void tms3203x_device::not_imm(uint32_t op) { - UINT32 src = (UINT16)op; + uint32_t src = (uint16_t)op; int dreg = (op >> 16) & 31; NOT(dreg, src); } /*-----------------------------------------------------*/ -void tms3203x_device::pop(UINT32 op) +void tms3203x_device::pop(uint32_t op) { int dreg = (op >> 16) & 31; - UINT32 val = RMEM(IREG(TMR_SP)--); + uint32_t val = RMEM(IREG(TMR_SP)--); IREG(dreg) = val; if (dreg < 8) { @@ -2491,21 +2491,21 @@ void tms3203x_device::pop(UINT32 op) update_special(dreg); } -void tms3203x_device::popf(UINT32 op) +void tms3203x_device::popf(uint32_t op) { int dreg = (op >> 16) & 7; - UINT32 val = RMEM(IREG(TMR_SP)--); + uint32_t val = RMEM(IREG(TMR_SP)--); LONG2FP(dreg, val); CLR_NZVUF(); OR_NZF(m_r[dreg]); } -void tms3203x_device::push(UINT32 op) +void tms3203x_device::push(uint32_t op) { WMEM(++IREG(TMR_SP), IREG((op >> 16) & 31)); } -void tms3203x_device::pushf(UINT32 op) +void tms3203x_device::pushf(uint32_t op) { int dreg = (op >> 16) & 7; WMEM(++IREG(TMR_SP), FP2LONG(dreg)); @@ -2515,7 +2515,7 @@ void tms3203x_device::pushf(UINT32 op) #define OR(dreg, src1, src2) \ { \ - UINT32 _res = (src1) | (src2); \ + uint32_t _res = (src1) | (src2); \ IREG(dreg) = _res; \ if (dreg < 8) \ { \ @@ -2526,56 +2526,56 @@ void tms3203x_device::pushf(UINT32 op) update_special(dreg); \ } -void tms3203x_device::or_reg(UINT32 op) +void tms3203x_device::or_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); OR(dreg, dst, src); } -void tms3203x_device::or_dir(UINT32 op) +void tms3203x_device::or_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); OR(dreg, dst, src); } -void tms3203x_device::or_ind(UINT32 op) +void tms3203x_device::or_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); OR(dreg, dst, src); } -void tms3203x_device::or_imm(UINT32 op) +void tms3203x_device::or_imm(uint32_t op) { - UINT32 src = (UINT16)op; + uint32_t src = (uint16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); OR(dreg, dst, src); } /*-----------------------------------------------------*/ -void tms3203x_device::maxspeed(UINT32 op) { unimplemented(op); } +void tms3203x_device::maxspeed(uint32_t op) { unimplemented(op); } /*-----------------------------------------------------*/ #define RND(dreg) \ { \ - INT32 man = FREGMAN(dreg); \ + int32_t man = FREGMAN(dreg); \ CLR_NVUF(); \ if (man < 0x7fffff80) \ { \ - m_r[dreg].set_mantissa(((UINT32)man + 0x80) & 0xffffff00); \ + m_r[dreg].set_mantissa(((uint32_t)man + 0x80) & 0xffffff00); \ OR_NUF(m_r[dreg]); \ } \ else if (FREGEXP(dreg) < 127) \ { \ - m_r[dreg].set_mantissa(((UINT32)man + 0x80) & 0x7fffff00); \ + m_r[dreg].set_mantissa(((uint32_t)man + 0x80) & 0x7fffff00); \ m_r[dreg].set_exponent(FREGEXP(dreg) + 1); \ OR_NUF(m_r[dreg]); \ } \ @@ -2586,7 +2586,7 @@ void tms3203x_device::maxspeed(UINT32 op) { unimplemented(op); } } \ } -void tms3203x_device::rnd_reg(UINT32 op) +void tms3203x_device::rnd_reg(uint32_t op) { int sreg = op & 7; int dreg = (op >> 16) & 7; @@ -2594,23 +2594,23 @@ void tms3203x_device::rnd_reg(UINT32 op) RND(dreg); } -void tms3203x_device::rnd_dir(UINT32 op) +void tms3203x_device::rnd_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); RND(dreg); } -void tms3203x_device::rnd_ind(UINT32 op) +void tms3203x_device::rnd_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); RND(dreg); } -void tms3203x_device::rnd_imm(UINT32 op) +void tms3203x_device::rnd_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(dreg, op); @@ -2619,10 +2619,10 @@ void tms3203x_device::rnd_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::rol(UINT32 op) +void tms3203x_device::rol(uint32_t op) { int dreg = (op >> 16) & 31; - UINT32 res = IREG(dreg); + uint32_t res = IREG(dreg); int newcflag = res >> 31; res = (res << 1) | newcflag; IREG(dreg) = res; @@ -2636,10 +2636,10 @@ void tms3203x_device::rol(UINT32 op) update_special(dreg); } -void tms3203x_device::rolc(UINT32 op) +void tms3203x_device::rolc(uint32_t op) { int dreg = (op >> 16) & 31; - UINT32 res = IREG(dreg); + uint32_t res = IREG(dreg); int newcflag = res >> 31; res = (res << 1) | (IREG(TMR_ST) & CFLAG); IREG(dreg) = res; @@ -2653,10 +2653,10 @@ void tms3203x_device::rolc(UINT32 op) update_special(dreg); } -void tms3203x_device::ror(UINT32 op) +void tms3203x_device::ror(uint32_t op) { int dreg = (op >> 16) & 31; - UINT32 res = IREG(dreg); + uint32_t res = IREG(dreg); int newcflag = res & 1; res = (res >> 1) | (newcflag << 31); IREG(dreg) = res; @@ -2670,10 +2670,10 @@ void tms3203x_device::ror(UINT32 op) update_special(dreg); } -void tms3203x_device::rorc(UINT32 op) +void tms3203x_device::rorc(uint32_t op) { int dreg = (op >> 16) & 31; - UINT32 res = IREG(dreg); + uint32_t res = IREG(dreg); int newcflag = res & 1; res = (res >> 1) | ((IREG(TMR_ST) & CFLAG) << 31); IREG(dreg) = res; @@ -2689,7 +2689,7 @@ void tms3203x_device::rorc(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::rtps_reg(UINT32 op) +void tms3203x_device::rtps_reg(uint32_t op) { IREG(TMR_RC) = IREG(op & 31); IREG(TMR_RS) = m_pc; @@ -2699,7 +2699,7 @@ void tms3203x_device::rtps_reg(UINT32 op) m_delayed = true; } -void tms3203x_device::rtps_dir(UINT32 op) +void tms3203x_device::rtps_dir(uint32_t op) { IREG(TMR_RC) = RMEM(DIRECT(op)); IREG(TMR_RS) = m_pc; @@ -2709,7 +2709,7 @@ void tms3203x_device::rtps_dir(UINT32 op) m_delayed = true; } -void tms3203x_device::rtps_ind(UINT32 op) +void tms3203x_device::rtps_ind(uint32_t op) { IREG(TMR_RC) = RMEM(INDIRECT_D(op, op >> 8)); IREG(TMR_RS) = m_pc; @@ -2719,9 +2719,9 @@ void tms3203x_device::rtps_ind(UINT32 op) m_delayed = true; } -void tms3203x_device::rtps_imm(UINT32 op) +void tms3203x_device::rtps_imm(uint32_t op) { - IREG(TMR_RC) = (UINT16)op; + IREG(TMR_RC) = (uint16_t)op; IREG(TMR_RS) = m_pc; IREG(TMR_RE) = m_pc; IREG(TMR_ST) |= RMFLAG; @@ -2731,54 +2731,54 @@ void tms3203x_device::rtps_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::stf_dir(UINT32 op) +void tms3203x_device::stf_dir(uint32_t op) { WMEM(DIRECT(op), FP2LONG((op >> 16) & 7)); } -void tms3203x_device::stf_ind(UINT32 op) +void tms3203x_device::stf_ind(uint32_t op) { WMEM(INDIRECT_D(op, op >> 8), FP2LONG((op >> 16) & 7)); } /*-----------------------------------------------------*/ -void tms3203x_device::stfi_dir(UINT32 op) { unimplemented(op); } -void tms3203x_device::stfi_ind(UINT32 op) { unimplemented(op); } +void tms3203x_device::stfi_dir(uint32_t op) { unimplemented(op); } +void tms3203x_device::stfi_ind(uint32_t op) { unimplemented(op); } /*-----------------------------------------------------*/ -void tms3203x_device::sti_dir(UINT32 op) +void tms3203x_device::sti_dir(uint32_t op) { WMEM(DIRECT(op), IREG((op >> 16) & 31)); } -void tms3203x_device::sti_ind(UINT32 op) +void tms3203x_device::sti_ind(uint32_t op) { WMEM(INDIRECT_D(op, op >> 8), IREG((op >> 16) & 31)); } /*-----------------------------------------------------*/ -void tms3203x_device::stii_dir(UINT32 op) { unimplemented(op); } -void tms3203x_device::stii_ind(UINT32 op) { unimplemented(op); } +void tms3203x_device::stii_dir(uint32_t op) { unimplemented(op); } +void tms3203x_device::stii_ind(uint32_t op) { unimplemented(op); } /*-----------------------------------------------------*/ -void tms3203x_device::sigi(UINT32 op) { unimplemented(op); } +void tms3203x_device::sigi(uint32_t op) { unimplemented(op); } /*-----------------------------------------------------*/ #define SUBB(dreg, src1, src2) \ { \ - UINT32 _res = src1 - src2 - (IREG(TMR_ST) & CFLAG); \ + uint32_t _res = src1 - src2 - (IREG(TMR_ST) & CFLAG); \ if (!OVM() || !OVERFLOW_SUB(src1,src2,_res)) \ IREG(dreg) = _res; \ else \ - IREG(dreg) = ((INT32)src1 < 0) ? 0x80000000 : 0x7fffffff; \ + IREG(dreg) = ((int32_t)src1 < 0) ? 0x80000000 : 0x7fffffff; \ if (dreg < 8) \ { \ - UINT32 tempc = IREG(TMR_ST) & CFLAG; \ + uint32_t tempc = IREG(TMR_ST) & CFLAG; \ CLR_NZCVUF(); \ OR_C_SBB(src1,src2,tempc); \ OR_V_SUB(src1,src2,_res); \ @@ -2788,35 +2788,35 @@ void tms3203x_device::sigi(UINT32 op) { unimplemented(op); } update_special(dreg); \ } -void tms3203x_device::subb_reg(UINT32 op) +void tms3203x_device::subb_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBB(dreg, dst, src); } -void tms3203x_device::subb_dir(UINT32 op) +void tms3203x_device::subb_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBB(dreg, dst, src); } -void tms3203x_device::subb_ind(UINT32 op) +void tms3203x_device::subb_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBB(dreg, dst, src); } -void tms3203x_device::subb_imm(UINT32 op) +void tms3203x_device::subb_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBB(dreg, dst, src); } @@ -2824,7 +2824,7 @@ void tms3203x_device::subb_imm(UINT32 op) #define SUBC(dreg, src) \ { \ - UINT32 dst = IREG(dreg); \ + uint32_t dst = IREG(dreg); \ if (dst >= src) \ IREG(dreg) = ((dst - src) << 1) | 1; \ else \ @@ -2833,59 +2833,59 @@ void tms3203x_device::subb_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::subc_reg(UINT32 op) +void tms3203x_device::subc_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; SUBC(dreg, src); } -void tms3203x_device::subc_dir(UINT32 op) +void tms3203x_device::subc_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; SUBC(dreg, src); } -void tms3203x_device::subc_ind(UINT32 op) +void tms3203x_device::subc_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; SUBC(dreg, src); } -void tms3203x_device::subc_imm(UINT32 op) +void tms3203x_device::subc_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; SUBC(dreg, src); } /*-----------------------------------------------------*/ -void tms3203x_device::subf_reg(UINT32 op) +void tms3203x_device::subf_reg(uint32_t op) { int dreg = (op >> 16) & 7; subf(m_r[dreg], m_r[dreg], m_r[op & 7]); } -void tms3203x_device::subf_dir(UINT32 op) +void tms3203x_device::subf_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); subf(m_r[dreg], m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::subf_ind(UINT32 op) +void tms3203x_device::subf_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); subf(m_r[dreg], m_r[dreg], m_r[TMR_TEMP1]); } -void tms3203x_device::subf_imm(UINT32 op) +void tms3203x_device::subf_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(TMR_TEMP1, op); @@ -2896,11 +2896,11 @@ void tms3203x_device::subf_imm(UINT32 op) #define SUBI(dreg, src1, src2) \ { \ - UINT32 _res = src1 - src2; \ + uint32_t _res = src1 - src2; \ if (!OVM() || !OVERFLOW_SUB(src1,src2,_res)) \ IREG(dreg) = _res; \ else \ - IREG(dreg) = ((INT32)src1 < 0) ? 0x80000000 : 0x7fffffff; \ + IREG(dreg) = ((int32_t)src1 < 0) ? 0x80000000 : 0x7fffffff; \ if (dreg < 8) \ { \ CLR_NZCVUF(); \ @@ -2912,97 +2912,97 @@ void tms3203x_device::subf_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::subi_reg(UINT32 op) +void tms3203x_device::subi_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBI(dreg, dst, src); } -void tms3203x_device::subi_dir(UINT32 op) +void tms3203x_device::subi_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBI(dreg, dst, src); } -void tms3203x_device::subi_ind(UINT32 op) +void tms3203x_device::subi_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBI(dreg, dst, src); } -void tms3203x_device::subi_imm(UINT32 op) +void tms3203x_device::subi_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBI(dreg, dst, src); } /*-----------------------------------------------------*/ -void tms3203x_device::subrb_reg(UINT32 op) +void tms3203x_device::subrb_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBB(dreg, src, dst); } -void tms3203x_device::subrb_dir(UINT32 op) +void tms3203x_device::subrb_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBB(dreg, src, dst); } -void tms3203x_device::subrb_ind(UINT32 op) +void tms3203x_device::subrb_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBB(dreg, src, dst); } -void tms3203x_device::subrb_imm(UINT32 op) +void tms3203x_device::subrb_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBB(dreg, src, dst); } /*-----------------------------------------------------*/ -void tms3203x_device::subrf_reg(UINT32 op) +void tms3203x_device::subrf_reg(uint32_t op) { int dreg = (op >> 16) & 7; subf(m_r[dreg], m_r[op & 7], m_r[dreg]); } -void tms3203x_device::subrf_dir(UINT32 op) +void tms3203x_device::subrf_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); subf(m_r[dreg], m_r[TMR_TEMP1], m_r[dreg]); } -void tms3203x_device::subrf_ind(UINT32 op) +void tms3203x_device::subrf_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, res); subf(m_r[dreg], m_r[TMR_TEMP1], m_r[dreg]); } -void tms3203x_device::subrf_imm(UINT32 op) +void tms3203x_device::subrf_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(TMR_TEMP1, op); @@ -3011,35 +3011,35 @@ void tms3203x_device::subrf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::subri_reg(UINT32 op) +void tms3203x_device::subri_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBI(dreg, src, dst); } -void tms3203x_device::subri_dir(UINT32 op) +void tms3203x_device::subri_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBI(dreg, src, dst); } -void tms3203x_device::subri_ind(UINT32 op) +void tms3203x_device::subri_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBI(dreg, src, dst); } -void tms3203x_device::subri_imm(UINT32 op) +void tms3203x_device::subri_imm(uint32_t op) { - UINT32 src = (INT16)op; + uint32_t src = (int16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); SUBI(dreg, src, dst); } @@ -3047,36 +3047,36 @@ void tms3203x_device::subri_imm(UINT32 op) #define TSTB(src1, src2) \ { \ - UINT32 _res = (src1) & (src2); \ + uint32_t _res = (src1) & (src2); \ CLR_NZVUF(); \ OR_NZ(_res); \ } -void tms3203x_device::tstb_reg(UINT32 op) +void tms3203x_device::tstb_reg(uint32_t op) { - UINT32 src = IREG(op & 31); - UINT32 dst = IREG((op >> 16) & 31); + uint32_t src = IREG(op & 31); + uint32_t dst = IREG((op >> 16) & 31); TSTB(dst, src); } -void tms3203x_device::tstb_dir(UINT32 op) +void tms3203x_device::tstb_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); - UINT32 dst = IREG((op >> 16) & 31); + uint32_t src = RMEM(DIRECT(op)); + uint32_t dst = IREG((op >> 16) & 31); TSTB(dst, src); } -void tms3203x_device::tstb_ind(UINT32 op) +void tms3203x_device::tstb_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); - UINT32 dst = IREG((op >> 16) & 31); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t dst = IREG((op >> 16) & 31); TSTB(dst, src); } -void tms3203x_device::tstb_imm(UINT32 op) +void tms3203x_device::tstb_imm(uint32_t op) { - UINT32 src = (UINT16)op; - UINT32 dst = IREG((op >> 16) & 31); + uint32_t src = (uint16_t)op; + uint32_t dst = IREG((op >> 16) & 31); TSTB(dst, src); } @@ -3084,7 +3084,7 @@ void tms3203x_device::tstb_imm(UINT32 op) #define XOR(dreg, src1, src2) \ { \ - UINT32 _res = (src1) ^ (src2); \ + uint32_t _res = (src1) ^ (src2); \ IREG(dreg) = _res; \ if (dreg < 8) \ { \ @@ -3095,41 +3095,41 @@ void tms3203x_device::tstb_imm(UINT32 op) update_special(dreg); \ } -void tms3203x_device::xor_reg(UINT32 op) +void tms3203x_device::xor_reg(uint32_t op) { - UINT32 src = IREG(op & 31); + uint32_t src = IREG(op & 31); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); XOR(dreg, dst, src); } -void tms3203x_device::xor_dir(UINT32 op) +void tms3203x_device::xor_dir(uint32_t op) { - UINT32 src = RMEM(DIRECT(op)); + uint32_t src = RMEM(DIRECT(op)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); XOR(dreg, dst, src); } -void tms3203x_device::xor_ind(UINT32 op) +void tms3203x_device::xor_ind(uint32_t op) { - UINT32 src = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t src = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); XOR(dreg, dst, src); } -void tms3203x_device::xor_imm(UINT32 op) +void tms3203x_device::xor_imm(uint32_t op) { - UINT32 src = (UINT16)op; + uint32_t src = (uint16_t)op; int dreg = (op >> 16) & 31; - UINT32 dst = IREG(dreg); + uint32_t dst = IREG(dreg); XOR(dreg, dst, src); } /*-----------------------------------------------------*/ -void tms3203x_device::iack_dir(UINT32 op) +void tms3203x_device::iack_dir(uint32_t op) { offs_t addr = DIRECT(op); m_iack_cb(addr, ASSERT_LINE); @@ -3137,7 +3137,7 @@ void tms3203x_device::iack_dir(UINT32 op) m_iack_cb(addr, CLEAR_LINE); } -void tms3203x_device::iack_ind(UINT32 op) +void tms3203x_device::iack_ind(uint32_t op) { offs_t addr = INDIRECT_D(op, op >> 8); m_iack_cb(addr, ASSERT_LINE); @@ -3147,35 +3147,35 @@ void tms3203x_device::iack_ind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::addc3_regreg(UINT32 op) +void tms3203x_device::addc3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; ADDC(dreg, src1, src2); } -void tms3203x_device::addc3_indreg(UINT32 op) +void tms3203x_device::addc3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; ADDC(dreg, src1, src2); } -void tms3203x_device::addc3_regind(UINT32 op) +void tms3203x_device::addc3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; ADDC(dreg, src1, src2); } -void tms3203x_device::addc3_indind(UINT32 op) +void tms3203x_device::addc3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); ADDC(dreg, src1, src2); @@ -3183,7 +3183,7 @@ void tms3203x_device::addc3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::addf3_regreg(UINT32 op) +void tms3203x_device::addf3_regreg(uint32_t op) { int sreg1 = (op >> 8) & 7; int sreg2 = op & 7; @@ -3191,29 +3191,29 @@ void tms3203x_device::addf3_regreg(UINT32 op) addf(m_r[dreg], m_r[sreg1], m_r[sreg2]); } -void tms3203x_device::addf3_indreg(UINT32 op) +void tms3203x_device::addf3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); int sreg2 = op & 7; int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, src1); addf(m_r[dreg], m_r[TMR_TEMP1], m_r[sreg2]); } -void tms3203x_device::addf3_regind(UINT32 op) +void tms3203x_device::addf3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int sreg1 = (op >> 8) & 7; int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP2, src2); addf(m_r[dreg], m_r[sreg1], m_r[TMR_TEMP2]); } -void tms3203x_device::addf3_indind(UINT32 op) +void tms3203x_device::addf3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 7; UPDATE_DEF(); LONG2FP(TMR_TEMP1, src1); @@ -3223,36 +3223,36 @@ void tms3203x_device::addf3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::addi3_regreg(UINT32 op) +void tms3203x_device::addi3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; ADDI(dreg, src1, src2); } -void tms3203x_device::addi3_indreg(UINT32 op) +void tms3203x_device::addi3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; ADDI(dreg, src1, src2); } -void tms3203x_device::addi3_regind(UINT32 op) +void tms3203x_device::addi3_regind(uint32_t op) { // Radikal Bikers confirms via ADDI3 AR3,*AR3++(1),R2 / SUB $0001,R2 sequence - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; ADDI(dreg, src1, src2); } -void tms3203x_device::addi3_indind(UINT32 op) +void tms3203x_device::addi3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); ADDI(dreg, src1, src2); @@ -3260,35 +3260,35 @@ void tms3203x_device::addi3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::and3_regreg(UINT32 op) +void tms3203x_device::and3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; AND(dreg, src1, src2); } -void tms3203x_device::and3_indreg(UINT32 op) +void tms3203x_device::and3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; AND(dreg, src1, src2); } -void tms3203x_device::and3_regind(UINT32 op) +void tms3203x_device::and3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; AND(dreg, src1, src2); } -void tms3203x_device::and3_indind(UINT32 op) +void tms3203x_device::and3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); AND(dreg, src1, src2); @@ -3296,35 +3296,35 @@ void tms3203x_device::and3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::andn3_regreg(UINT32 op) +void tms3203x_device::andn3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; ANDN(dreg, src1, src2); } -void tms3203x_device::andn3_indreg(UINT32 op) +void tms3203x_device::andn3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; ANDN(dreg, src1, src2); } -void tms3203x_device::andn3_regind(UINT32 op) +void tms3203x_device::andn3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; ANDN(dreg, src1, src2); } -void tms3203x_device::andn3_indind(UINT32 op) +void tms3203x_device::andn3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); ANDN(dreg, src1, src2); @@ -3332,35 +3332,35 @@ void tms3203x_device::andn3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ash3_regreg(UINT32 op) +void tms3203x_device::ash3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; ASH(dreg, src1, src2); } -void tms3203x_device::ash3_indreg(UINT32 op) +void tms3203x_device::ash3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; ASH(dreg, src1, src2); } -void tms3203x_device::ash3_regind(UINT32 op) +void tms3203x_device::ash3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; ASH(dreg, src1, src2); } -void tms3203x_device::ash3_indind(UINT32 op) +void tms3203x_device::ash3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); ASH(dreg, src1, src2); @@ -3368,34 +3368,34 @@ void tms3203x_device::ash3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::cmpf3_regreg(UINT32 op) +void tms3203x_device::cmpf3_regreg(uint32_t op) { int sreg1 = (op >> 8) & 7; int sreg2 = op & 7; subf(m_r[TMR_TEMP1], m_r[sreg1], m_r[sreg2]); } -void tms3203x_device::cmpf3_indreg(UINT32 op) +void tms3203x_device::cmpf3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); int sreg2 = op & 7; LONG2FP(TMR_TEMP1, src1); subf(m_r[TMR_TEMP1], m_r[TMR_TEMP1], m_r[sreg2]); } -void tms3203x_device::cmpf3_regind(UINT32 op) +void tms3203x_device::cmpf3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int sreg1 = (op >> 8) & 7; LONG2FP(TMR_TEMP2, src2); subf(m_r[TMR_TEMP1], m_r[sreg1], m_r[TMR_TEMP2]); } -void tms3203x_device::cmpf3_indind(UINT32 op) +void tms3203x_device::cmpf3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); UPDATE_DEF(); LONG2FP(TMR_TEMP1, src1); LONG2FP(TMR_TEMP2, src2); @@ -3404,67 +3404,67 @@ void tms3203x_device::cmpf3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::cmpi3_regreg(UINT32 op) +void tms3203x_device::cmpi3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); CMPI(src1, src2); } -void tms3203x_device::cmpi3_indreg(UINT32 op) +void tms3203x_device::cmpi3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); CMPI(src1, src2); } -void tms3203x_device::cmpi3_regind(UINT32 op) +void tms3203x_device::cmpi3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); CMPI(src1, src2); } -void tms3203x_device::cmpi3_indind(UINT32 op) +void tms3203x_device::cmpi3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); UPDATE_DEF(); CMPI(src1, src2); } /*-----------------------------------------------------*/ -void tms3203x_device::lsh3_regreg(UINT32 op) +void tms3203x_device::lsh3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; LSH(dreg, src1, src2); } -void tms3203x_device::lsh3_indreg(UINT32 op) +void tms3203x_device::lsh3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; LSH(dreg, src1, src2); } -void tms3203x_device::lsh3_regind(UINT32 op) +void tms3203x_device::lsh3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; LSH(dreg, src1, src2); } -void tms3203x_device::lsh3_indind(UINT32 op) +void tms3203x_device::lsh3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); LSH(dreg, src1, src2); @@ -3472,7 +3472,7 @@ void tms3203x_device::lsh3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::mpyf3_regreg(UINT32 op) +void tms3203x_device::mpyf3_regreg(uint32_t op) { int sreg1 = (op >> 8) & 7; int sreg2 = op & 7; @@ -3480,29 +3480,29 @@ void tms3203x_device::mpyf3_regreg(UINT32 op) mpyf(m_r[dreg], m_r[sreg1], m_r[sreg2]); } -void tms3203x_device::mpyf3_indreg(UINT32 op) +void tms3203x_device::mpyf3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); int sreg2 = op & 7; int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, src1); mpyf(m_r[dreg], m_r[TMR_TEMP1], m_r[sreg2]); } -void tms3203x_device::mpyf3_regind(UINT32 op) +void tms3203x_device::mpyf3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int sreg1 = (op >> 8) & 7; int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP2, src2); mpyf(m_r[dreg], m_r[sreg1], m_r[TMR_TEMP2]); } -void tms3203x_device::mpyf3_indind(UINT32 op) +void tms3203x_device::mpyf3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 7; UPDATE_DEF(); LONG2FP(TMR_TEMP1, src1); @@ -3512,35 +3512,35 @@ void tms3203x_device::mpyf3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::mpyi3_regreg(UINT32 op) +void tms3203x_device::mpyi3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; MPYI(dreg, src1, src2); } -void tms3203x_device::mpyi3_indreg(UINT32 op) +void tms3203x_device::mpyi3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; MPYI(dreg, src1, src2); } -void tms3203x_device::mpyi3_regind(UINT32 op) +void tms3203x_device::mpyi3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; MPYI(dreg, src1, src2); } -void tms3203x_device::mpyi3_indind(UINT32 op) +void tms3203x_device::mpyi3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); MPYI(dreg, src1, src2); @@ -3548,35 +3548,35 @@ void tms3203x_device::mpyi3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::or3_regreg(UINT32 op) +void tms3203x_device::or3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; OR(dreg, src1, src2); } -void tms3203x_device::or3_indreg(UINT32 op) +void tms3203x_device::or3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; OR(dreg, src1, src2); } -void tms3203x_device::or3_regind(UINT32 op) +void tms3203x_device::or3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; OR(dreg, src1, src2); } -void tms3203x_device::or3_indind(UINT32 op) +void tms3203x_device::or3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); OR(dreg, src1, src2); @@ -3584,35 +3584,35 @@ void tms3203x_device::or3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::subb3_regreg(UINT32 op) +void tms3203x_device::subb3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; SUBB(dreg, src1, src2); } -void tms3203x_device::subb3_indreg(UINT32 op) +void tms3203x_device::subb3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; SUBB(dreg, src1, src2); } -void tms3203x_device::subb3_regind(UINT32 op) +void tms3203x_device::subb3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; SUBB(dreg, src1, src2); } -void tms3203x_device::subb3_indind(UINT32 op) +void tms3203x_device::subb3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); SUBB(dreg, src1, src2); @@ -3620,7 +3620,7 @@ void tms3203x_device::subb3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::subf3_regreg(UINT32 op) +void tms3203x_device::subf3_regreg(uint32_t op) { int sreg1 = (op >> 8) & 7; int sreg2 = op & 7; @@ -3628,29 +3628,29 @@ void tms3203x_device::subf3_regreg(UINT32 op) subf(m_r[dreg], m_r[sreg1], m_r[sreg2]); } -void tms3203x_device::subf3_indreg(UINT32 op) +void tms3203x_device::subf3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); int sreg2 = op & 7; int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP1, src1); subf(m_r[dreg], m_r[TMR_TEMP1], m_r[sreg2]); } -void tms3203x_device::subf3_regind(UINT32 op) +void tms3203x_device::subf3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int sreg1 = (op >> 8) & 7; int dreg = (op >> 16) & 7; LONG2FP(TMR_TEMP2, src2); subf(m_r[dreg], m_r[sreg1], m_r[TMR_TEMP2]); } -void tms3203x_device::subf3_indind(UINT32 op) +void tms3203x_device::subf3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 7; UPDATE_DEF(); LONG2FP(TMR_TEMP1, src1); @@ -3660,35 +3660,35 @@ void tms3203x_device::subf3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::subi3_regreg(UINT32 op) +void tms3203x_device::subi3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; SUBI(dreg, src1, src2); } -void tms3203x_device::subi3_indreg(UINT32 op) +void tms3203x_device::subi3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; SUBI(dreg, src1, src2); } -void tms3203x_device::subi3_regind(UINT32 op) +void tms3203x_device::subi3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; SUBI(dreg, src1, src2); } -void tms3203x_device::subi3_indind(UINT32 op) +void tms3203x_device::subi3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); SUBI(dreg, src1, src2); @@ -3696,67 +3696,67 @@ void tms3203x_device::subi3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::tstb3_regreg(UINT32 op) +void tms3203x_device::tstb3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); TSTB(src1, src2); } -void tms3203x_device::tstb3_indreg(UINT32 op) +void tms3203x_device::tstb3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); TSTB(src1, src2); } -void tms3203x_device::tstb3_regind(UINT32 op) +void tms3203x_device::tstb3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); TSTB(src1, src2); } -void tms3203x_device::tstb3_indind(UINT32 op) +void tms3203x_device::tstb3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); UPDATE_DEF(); TSTB(src1, src2); } /*-----------------------------------------------------*/ -void tms3203x_device::xor3_regreg(UINT32 op) +void tms3203x_device::xor3_regreg(uint32_t op) { - UINT32 src1 = IREG((op >> 8) & 31); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = IREG((op >> 8) & 31); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; XOR(dreg, src1, src2); } -void tms3203x_device::xor3_indreg(UINT32 op) +void tms3203x_device::xor3_indreg(uint32_t op) { - UINT32 src1 = RMEM(INDIRECT_1(op, op >> 8)); - UINT32 src2 = IREG(op & 31); + uint32_t src1 = RMEM(INDIRECT_1(op, op >> 8)); + uint32_t src2 = IREG(op & 31); int dreg = (op >> 16) & 31; XOR(dreg, src1, src2); } -void tms3203x_device::xor3_regind(UINT32 op) +void tms3203x_device::xor3_regind(uint32_t op) { - UINT32 src2 = RMEM(INDIRECT_1(op, op)); - UINT32 src1 = IREG((op >> 8) & 31); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = IREG((op >> 8) & 31); int dreg = (op >> 16) & 31; XOR(dreg, src1, src2); } -void tms3203x_device::xor3_indind(UINT32 op) +void tms3203x_device::xor3_indind(uint32_t op) { DECLARE_DEF; - UINT32 src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src2 = RMEM(INDIRECT_1(op, op)); + uint32_t src1 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src2 = RMEM(INDIRECT_1(op, op)); int dreg = (op >> 16) & 31; UPDATE_DEF(); XOR(dreg, src1, src2); @@ -3764,26 +3764,26 @@ void tms3203x_device::xor3_indind(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfu_reg(UINT32 op) +void tms3203x_device::ldfu_reg(uint32_t op) { m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfu_dir(UINT32 op) +void tms3203x_device::ldfu_dir(uint32_t op) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } -void tms3203x_device::ldfu_ind(UINT32 op) +void tms3203x_device::ldfu_ind(uint32_t op) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } -void tms3203x_device::ldfu_imm(UINT32 op) +void tms3203x_device::ldfu_imm(uint32_t op) { int dreg = (op >> 16) & 7; SHORT2FP(dreg, op); @@ -3791,27 +3791,27 @@ void tms3203x_device::ldfu_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldflo_reg(UINT32 op) +void tms3203x_device::ldflo_reg(uint32_t op) { if (CONDITION_LO()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldflo_dir(UINT32 op) +void tms3203x_device::ldflo_dir(uint32_t op) { if (CONDITION_LO()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldflo_ind(UINT32 op) +void tms3203x_device::ldflo_ind(uint32_t op) { if (CONDITION_LO()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -3819,7 +3819,7 @@ void tms3203x_device::ldflo_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldflo_imm(UINT32 op) +void tms3203x_device::ldflo_imm(uint32_t op) { if (CONDITION_LO()) { @@ -3830,27 +3830,27 @@ void tms3203x_device::ldflo_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfls_reg(UINT32 op) +void tms3203x_device::ldfls_reg(uint32_t op) { if (CONDITION_LS()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfls_dir(UINT32 op) +void tms3203x_device::ldfls_dir(uint32_t op) { if (CONDITION_LS()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfls_ind(UINT32 op) +void tms3203x_device::ldfls_ind(uint32_t op) { if (CONDITION_LS()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -3858,7 +3858,7 @@ void tms3203x_device::ldfls_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfls_imm(UINT32 op) +void tms3203x_device::ldfls_imm(uint32_t op) { if (CONDITION_LS()) { @@ -3869,27 +3869,27 @@ void tms3203x_device::ldfls_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfhi_reg(UINT32 op) +void tms3203x_device::ldfhi_reg(uint32_t op) { if (CONDITION_HI()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfhi_dir(UINT32 op) +void tms3203x_device::ldfhi_dir(uint32_t op) { if (CONDITION_HI()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfhi_ind(UINT32 op) +void tms3203x_device::ldfhi_ind(uint32_t op) { if (CONDITION_HI()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -3897,7 +3897,7 @@ void tms3203x_device::ldfhi_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfhi_imm(UINT32 op) +void tms3203x_device::ldfhi_imm(uint32_t op) { if (CONDITION_HI()) { @@ -3908,27 +3908,27 @@ void tms3203x_device::ldfhi_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfhs_reg(UINT32 op) +void tms3203x_device::ldfhs_reg(uint32_t op) { if (CONDITION_HS()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfhs_dir(UINT32 op) +void tms3203x_device::ldfhs_dir(uint32_t op) { if (CONDITION_HS()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfhs_ind(UINT32 op) +void tms3203x_device::ldfhs_ind(uint32_t op) { if (CONDITION_HS()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -3936,7 +3936,7 @@ void tms3203x_device::ldfhs_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfhs_imm(UINT32 op) +void tms3203x_device::ldfhs_imm(uint32_t op) { if (CONDITION_HS()) { @@ -3947,27 +3947,27 @@ void tms3203x_device::ldfhs_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfeq_reg(UINT32 op) +void tms3203x_device::ldfeq_reg(uint32_t op) { if (CONDITION_EQ()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfeq_dir(UINT32 op) +void tms3203x_device::ldfeq_dir(uint32_t op) { if (CONDITION_EQ()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfeq_ind(UINT32 op) +void tms3203x_device::ldfeq_ind(uint32_t op) { if (CONDITION_EQ()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -3975,7 +3975,7 @@ void tms3203x_device::ldfeq_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfeq_imm(UINT32 op) +void tms3203x_device::ldfeq_imm(uint32_t op) { if (CONDITION_EQ()) { @@ -3986,27 +3986,27 @@ void tms3203x_device::ldfeq_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfne_reg(UINT32 op) +void tms3203x_device::ldfne_reg(uint32_t op) { if (CONDITION_NE()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfne_dir(UINT32 op) +void tms3203x_device::ldfne_dir(uint32_t op) { if (CONDITION_NE()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfne_ind(UINT32 op) +void tms3203x_device::ldfne_ind(uint32_t op) { if (CONDITION_NE()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4014,7 +4014,7 @@ void tms3203x_device::ldfne_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfne_imm(UINT32 op) +void tms3203x_device::ldfne_imm(uint32_t op) { if (CONDITION_NE()) { @@ -4025,27 +4025,27 @@ void tms3203x_device::ldfne_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldflt_reg(UINT32 op) +void tms3203x_device::ldflt_reg(uint32_t op) { if (CONDITION_LT()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldflt_dir(UINT32 op) +void tms3203x_device::ldflt_dir(uint32_t op) { if (CONDITION_LT()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldflt_ind(UINT32 op) +void tms3203x_device::ldflt_ind(uint32_t op) { if (CONDITION_LT()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4053,7 +4053,7 @@ void tms3203x_device::ldflt_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldflt_imm(UINT32 op) +void tms3203x_device::ldflt_imm(uint32_t op) { if (CONDITION_LT()) { @@ -4064,27 +4064,27 @@ void tms3203x_device::ldflt_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfle_reg(UINT32 op) +void tms3203x_device::ldfle_reg(uint32_t op) { if (CONDITION_LE()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfle_dir(UINT32 op) +void tms3203x_device::ldfle_dir(uint32_t op) { if (CONDITION_LE()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfle_ind(UINT32 op) +void tms3203x_device::ldfle_ind(uint32_t op) { if (CONDITION_LE()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4092,7 +4092,7 @@ void tms3203x_device::ldfle_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfle_imm(UINT32 op) +void tms3203x_device::ldfle_imm(uint32_t op) { if (CONDITION_LE()) { @@ -4103,27 +4103,27 @@ void tms3203x_device::ldfle_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfgt_reg(UINT32 op) +void tms3203x_device::ldfgt_reg(uint32_t op) { if (CONDITION_GT()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfgt_dir(UINT32 op) +void tms3203x_device::ldfgt_dir(uint32_t op) { if (CONDITION_GT()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfgt_ind(UINT32 op) +void tms3203x_device::ldfgt_ind(uint32_t op) { if (CONDITION_GT()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4131,7 +4131,7 @@ void tms3203x_device::ldfgt_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfgt_imm(UINT32 op) +void tms3203x_device::ldfgt_imm(uint32_t op) { if (CONDITION_GT()) { @@ -4142,27 +4142,27 @@ void tms3203x_device::ldfgt_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfge_reg(UINT32 op) +void tms3203x_device::ldfge_reg(uint32_t op) { if (CONDITION_GE()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfge_dir(UINT32 op) +void tms3203x_device::ldfge_dir(uint32_t op) { if (CONDITION_GE()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfge_ind(UINT32 op) +void tms3203x_device::ldfge_ind(uint32_t op) { if (CONDITION_GE()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4170,7 +4170,7 @@ void tms3203x_device::ldfge_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfge_imm(UINT32 op) +void tms3203x_device::ldfge_imm(uint32_t op) { if (CONDITION_GE()) { @@ -4181,27 +4181,27 @@ void tms3203x_device::ldfge_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfnv_reg(UINT32 op) +void tms3203x_device::ldfnv_reg(uint32_t op) { if (CONDITION_NV()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfnv_dir(UINT32 op) +void tms3203x_device::ldfnv_dir(uint32_t op) { if (CONDITION_NV()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfnv_ind(UINT32 op) +void tms3203x_device::ldfnv_ind(uint32_t op) { if (CONDITION_NV()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4209,7 +4209,7 @@ void tms3203x_device::ldfnv_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfnv_imm(UINT32 op) +void tms3203x_device::ldfnv_imm(uint32_t op) { if (CONDITION_NV()) { @@ -4220,27 +4220,27 @@ void tms3203x_device::ldfnv_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfv_reg(UINT32 op) +void tms3203x_device::ldfv_reg(uint32_t op) { if (CONDITION_V()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfv_dir(UINT32 op) +void tms3203x_device::ldfv_dir(uint32_t op) { if (CONDITION_V()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfv_ind(UINT32 op) +void tms3203x_device::ldfv_ind(uint32_t op) { if (CONDITION_V()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4248,7 +4248,7 @@ void tms3203x_device::ldfv_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfv_imm(UINT32 op) +void tms3203x_device::ldfv_imm(uint32_t op) { if (CONDITION_V()) { @@ -4259,27 +4259,27 @@ void tms3203x_device::ldfv_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfnuf_reg(UINT32 op) +void tms3203x_device::ldfnuf_reg(uint32_t op) { if (CONDITION_NUF()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfnuf_dir(UINT32 op) +void tms3203x_device::ldfnuf_dir(uint32_t op) { if (CONDITION_NUF()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfnuf_ind(UINT32 op) +void tms3203x_device::ldfnuf_ind(uint32_t op) { if (CONDITION_NUF()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4287,7 +4287,7 @@ void tms3203x_device::ldfnuf_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfnuf_imm(UINT32 op) +void tms3203x_device::ldfnuf_imm(uint32_t op) { if (CONDITION_NUF()) { @@ -4298,27 +4298,27 @@ void tms3203x_device::ldfnuf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfuf_reg(UINT32 op) +void tms3203x_device::ldfuf_reg(uint32_t op) { if (CONDITION_UF()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfuf_dir(UINT32 op) +void tms3203x_device::ldfuf_dir(uint32_t op) { if (CONDITION_UF()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfuf_ind(UINT32 op) +void tms3203x_device::ldfuf_ind(uint32_t op) { if (CONDITION_UF()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4326,7 +4326,7 @@ void tms3203x_device::ldfuf_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfuf_imm(UINT32 op) +void tms3203x_device::ldfuf_imm(uint32_t op) { if (CONDITION_UF()) { @@ -4337,27 +4337,27 @@ void tms3203x_device::ldfuf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfnlv_reg(UINT32 op) +void tms3203x_device::ldfnlv_reg(uint32_t op) { if (CONDITION_NLV()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfnlv_dir(UINT32 op) +void tms3203x_device::ldfnlv_dir(uint32_t op) { if (CONDITION_NLV()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfnlv_ind(UINT32 op) +void tms3203x_device::ldfnlv_ind(uint32_t op) { if (CONDITION_NLV()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4365,7 +4365,7 @@ void tms3203x_device::ldfnlv_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfnlv_imm(UINT32 op) +void tms3203x_device::ldfnlv_imm(uint32_t op) { if (CONDITION_NLV()) { @@ -4376,27 +4376,27 @@ void tms3203x_device::ldfnlv_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldflv_reg(UINT32 op) +void tms3203x_device::ldflv_reg(uint32_t op) { if (CONDITION_LV()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldflv_dir(UINT32 op) +void tms3203x_device::ldflv_dir(uint32_t op) { if (CONDITION_LV()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldflv_ind(UINT32 op) +void tms3203x_device::ldflv_ind(uint32_t op) { if (CONDITION_LV()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4404,7 +4404,7 @@ void tms3203x_device::ldflv_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldflv_imm(UINT32 op) +void tms3203x_device::ldflv_imm(uint32_t op) { if (CONDITION_LV()) { @@ -4415,27 +4415,27 @@ void tms3203x_device::ldflv_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfnluf_reg(UINT32 op) +void tms3203x_device::ldfnluf_reg(uint32_t op) { if (CONDITION_NLUF()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfnluf_dir(UINT32 op) +void tms3203x_device::ldfnluf_dir(uint32_t op) { if (CONDITION_NLUF()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfnluf_ind(UINT32 op) +void tms3203x_device::ldfnluf_ind(uint32_t op) { if (CONDITION_NLUF()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4443,7 +4443,7 @@ void tms3203x_device::ldfnluf_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfnluf_imm(UINT32 op) +void tms3203x_device::ldfnluf_imm(uint32_t op) { if (CONDITION_NLUF()) { @@ -4454,27 +4454,27 @@ void tms3203x_device::ldfnluf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfluf_reg(UINT32 op) +void tms3203x_device::ldfluf_reg(uint32_t op) { if (CONDITION_LUF()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfluf_dir(UINT32 op) +void tms3203x_device::ldfluf_dir(uint32_t op) { if (CONDITION_LUF()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfluf_ind(UINT32 op) +void tms3203x_device::ldfluf_ind(uint32_t op) { if (CONDITION_LUF()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4482,7 +4482,7 @@ void tms3203x_device::ldfluf_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfluf_imm(UINT32 op) +void tms3203x_device::ldfluf_imm(uint32_t op) { if (CONDITION_LUF()) { @@ -4493,27 +4493,27 @@ void tms3203x_device::ldfluf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfzuf_reg(UINT32 op) +void tms3203x_device::ldfzuf_reg(uint32_t op) { if (CONDITION_ZUF()) m_r[(op >> 16) & 7] = m_r[op & 7]; } -void tms3203x_device::ldfzuf_dir(UINT32 op) +void tms3203x_device::ldfzuf_dir(uint32_t op) { if (CONDITION_ZUF()) { - UINT32 res = RMEM(DIRECT(op)); + uint32_t res = RMEM(DIRECT(op)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } } -void tms3203x_device::ldfzuf_ind(UINT32 op) +void tms3203x_device::ldfzuf_ind(uint32_t op) { if (CONDITION_ZUF()) { - UINT32 res = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t res = RMEM(INDIRECT_D(op, op >> 8)); int dreg = (op >> 16) & 7; LONG2FP(dreg, res); } @@ -4521,7 +4521,7 @@ void tms3203x_device::ldfzuf_ind(UINT32 op) INDIRECT_D(op, op >> 8); } -void tms3203x_device::ldfzuf_imm(UINT32 op) +void tms3203x_device::ldfzuf_imm(uint32_t op) { if (CONDITION_ZUF()) { @@ -4532,7 +4532,7 @@ void tms3203x_device::ldfzuf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldiu_reg(UINT32 op) +void tms3203x_device::ldiu_reg(uint32_t op) { int dreg = (op >> 16) & 31; IREG(dreg) = IREG(op & 31); @@ -4540,7 +4540,7 @@ void tms3203x_device::ldiu_reg(UINT32 op) update_special(dreg); } -void tms3203x_device::ldiu_dir(UINT32 op) +void tms3203x_device::ldiu_dir(uint32_t op) { int dreg = (op >> 16) & 31; IREG(dreg) = RMEM(DIRECT(op)); @@ -4548,7 +4548,7 @@ void tms3203x_device::ldiu_dir(UINT32 op) update_special(dreg); } -void tms3203x_device::ldiu_ind(UINT32 op) +void tms3203x_device::ldiu_ind(uint32_t op) { int dreg = (op >> 16) & 31; IREG(dreg) = RMEM(INDIRECT_D(op, op >> 8)); @@ -4556,17 +4556,17 @@ void tms3203x_device::ldiu_ind(UINT32 op) update_special(dreg); } -void tms3203x_device::ldiu_imm(UINT32 op) +void tms3203x_device::ldiu_imm(uint32_t op) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } /*-----------------------------------------------------*/ -void tms3203x_device::ldilo_reg(UINT32 op) +void tms3203x_device::ldilo_reg(uint32_t op) { if (CONDITION_LO()) { @@ -4577,9 +4577,9 @@ void tms3203x_device::ldilo_reg(UINT32 op) } } -void tms3203x_device::ldilo_dir(UINT32 op) +void tms3203x_device::ldilo_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_LO()) { int dreg = (op >> 16) & 31; @@ -4589,9 +4589,9 @@ void tms3203x_device::ldilo_dir(UINT32 op) } } -void tms3203x_device::ldilo_ind(UINT32 op) +void tms3203x_device::ldilo_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_LO()) { int dreg = (op >> 16) & 31; @@ -4601,12 +4601,12 @@ void tms3203x_device::ldilo_ind(UINT32 op) } } -void tms3203x_device::ldilo_imm(UINT32 op) +void tms3203x_device::ldilo_imm(uint32_t op) { if (CONDITION_LO()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -4614,7 +4614,7 @@ void tms3203x_device::ldilo_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldils_reg(UINT32 op) +void tms3203x_device::ldils_reg(uint32_t op) { if (CONDITION_LS()) { @@ -4625,9 +4625,9 @@ void tms3203x_device::ldils_reg(UINT32 op) } } -void tms3203x_device::ldils_dir(UINT32 op) +void tms3203x_device::ldils_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_LS()) { int dreg = (op >> 16) & 31; @@ -4637,9 +4637,9 @@ void tms3203x_device::ldils_dir(UINT32 op) } } -void tms3203x_device::ldils_ind(UINT32 op) +void tms3203x_device::ldils_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_LS()) { int dreg = (op >> 16) & 31; @@ -4649,12 +4649,12 @@ void tms3203x_device::ldils_ind(UINT32 op) } } -void tms3203x_device::ldils_imm(UINT32 op) +void tms3203x_device::ldils_imm(uint32_t op) { if (CONDITION_LS()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -4662,7 +4662,7 @@ void tms3203x_device::ldils_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldihi_reg(UINT32 op) +void tms3203x_device::ldihi_reg(uint32_t op) { if (CONDITION_HI()) { @@ -4673,9 +4673,9 @@ void tms3203x_device::ldihi_reg(UINT32 op) } } -void tms3203x_device::ldihi_dir(UINT32 op) +void tms3203x_device::ldihi_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_HI()) { int dreg = (op >> 16) & 31; @@ -4685,9 +4685,9 @@ void tms3203x_device::ldihi_dir(UINT32 op) } } -void tms3203x_device::ldihi_ind(UINT32 op) +void tms3203x_device::ldihi_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_HI()) { int dreg = (op >> 16) & 31; @@ -4697,12 +4697,12 @@ void tms3203x_device::ldihi_ind(UINT32 op) } } -void tms3203x_device::ldihi_imm(UINT32 op) +void tms3203x_device::ldihi_imm(uint32_t op) { if (CONDITION_HI()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -4710,7 +4710,7 @@ void tms3203x_device::ldihi_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldihs_reg(UINT32 op) +void tms3203x_device::ldihs_reg(uint32_t op) { if (CONDITION_HS()) { @@ -4721,9 +4721,9 @@ void tms3203x_device::ldihs_reg(UINT32 op) } } -void tms3203x_device::ldihs_dir(UINT32 op) +void tms3203x_device::ldihs_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_HS()) { int dreg = (op >> 16) & 31; @@ -4733,9 +4733,9 @@ void tms3203x_device::ldihs_dir(UINT32 op) } } -void tms3203x_device::ldihs_ind(UINT32 op) +void tms3203x_device::ldihs_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_HS()) { int dreg = (op >> 16) & 31; @@ -4745,12 +4745,12 @@ void tms3203x_device::ldihs_ind(UINT32 op) } } -void tms3203x_device::ldihs_imm(UINT32 op) +void tms3203x_device::ldihs_imm(uint32_t op) { if (CONDITION_HS()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -4758,7 +4758,7 @@ void tms3203x_device::ldihs_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldieq_reg(UINT32 op) +void tms3203x_device::ldieq_reg(uint32_t op) { if (CONDITION_EQ()) { @@ -4769,9 +4769,9 @@ void tms3203x_device::ldieq_reg(UINT32 op) } } -void tms3203x_device::ldieq_dir(UINT32 op) +void tms3203x_device::ldieq_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_EQ()) { int dreg = (op >> 16) & 31; @@ -4781,9 +4781,9 @@ void tms3203x_device::ldieq_dir(UINT32 op) } } -void tms3203x_device::ldieq_ind(UINT32 op) +void tms3203x_device::ldieq_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_EQ()) { int dreg = (op >> 16) & 31; @@ -4793,12 +4793,12 @@ void tms3203x_device::ldieq_ind(UINT32 op) } } -void tms3203x_device::ldieq_imm(UINT32 op) +void tms3203x_device::ldieq_imm(uint32_t op) { if (CONDITION_EQ()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -4806,7 +4806,7 @@ void tms3203x_device::ldieq_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldine_reg(UINT32 op) +void tms3203x_device::ldine_reg(uint32_t op) { if (CONDITION_NE()) { @@ -4817,9 +4817,9 @@ void tms3203x_device::ldine_reg(UINT32 op) } } -void tms3203x_device::ldine_dir(UINT32 op) +void tms3203x_device::ldine_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_NE()) { int dreg = (op >> 16) & 31; @@ -4829,9 +4829,9 @@ void tms3203x_device::ldine_dir(UINT32 op) } } -void tms3203x_device::ldine_ind(UINT32 op) +void tms3203x_device::ldine_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_NE()) { int dreg = (op >> 16) & 31; @@ -4841,12 +4841,12 @@ void tms3203x_device::ldine_ind(UINT32 op) } } -void tms3203x_device::ldine_imm(UINT32 op) +void tms3203x_device::ldine_imm(uint32_t op) { if (CONDITION_NE()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -4854,7 +4854,7 @@ void tms3203x_device::ldine_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldilt_reg(UINT32 op) +void tms3203x_device::ldilt_reg(uint32_t op) { if (CONDITION_LT()) { @@ -4865,9 +4865,9 @@ void tms3203x_device::ldilt_reg(UINT32 op) } } -void tms3203x_device::ldilt_dir(UINT32 op) +void tms3203x_device::ldilt_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_LT()) { int dreg = (op >> 16) & 31; @@ -4877,9 +4877,9 @@ void tms3203x_device::ldilt_dir(UINT32 op) } } -void tms3203x_device::ldilt_ind(UINT32 op) +void tms3203x_device::ldilt_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_LT()) { int dreg = (op >> 16) & 31; @@ -4889,12 +4889,12 @@ void tms3203x_device::ldilt_ind(UINT32 op) } } -void tms3203x_device::ldilt_imm(UINT32 op) +void tms3203x_device::ldilt_imm(uint32_t op) { if (CONDITION_LT()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -4902,7 +4902,7 @@ void tms3203x_device::ldilt_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldile_reg(UINT32 op) +void tms3203x_device::ldile_reg(uint32_t op) { if (CONDITION_LE()) { @@ -4913,9 +4913,9 @@ void tms3203x_device::ldile_reg(UINT32 op) } } -void tms3203x_device::ldile_dir(UINT32 op) +void tms3203x_device::ldile_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_LE()) { int dreg = (op >> 16) & 31; @@ -4925,9 +4925,9 @@ void tms3203x_device::ldile_dir(UINT32 op) } } -void tms3203x_device::ldile_ind(UINT32 op) +void tms3203x_device::ldile_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_LE()) { int dreg = (op >> 16) & 31; @@ -4937,12 +4937,12 @@ void tms3203x_device::ldile_ind(UINT32 op) } } -void tms3203x_device::ldile_imm(UINT32 op) +void tms3203x_device::ldile_imm(uint32_t op) { if (CONDITION_LE()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -4950,7 +4950,7 @@ void tms3203x_device::ldile_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldigt_reg(UINT32 op) +void tms3203x_device::ldigt_reg(uint32_t op) { if (CONDITION_GT()) { @@ -4961,9 +4961,9 @@ void tms3203x_device::ldigt_reg(UINT32 op) } } -void tms3203x_device::ldigt_dir(UINT32 op) +void tms3203x_device::ldigt_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_GT()) { int dreg = (op >> 16) & 31; @@ -4973,9 +4973,9 @@ void tms3203x_device::ldigt_dir(UINT32 op) } } -void tms3203x_device::ldigt_ind(UINT32 op) +void tms3203x_device::ldigt_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_GT()) { int dreg = (op >> 16) & 31; @@ -4985,12 +4985,12 @@ void tms3203x_device::ldigt_ind(UINT32 op) } } -void tms3203x_device::ldigt_imm(UINT32 op) +void tms3203x_device::ldigt_imm(uint32_t op) { if (CONDITION_GT()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -4998,7 +4998,7 @@ void tms3203x_device::ldigt_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldige_reg(UINT32 op) +void tms3203x_device::ldige_reg(uint32_t op) { if (CONDITION_GE()) { @@ -5009,9 +5009,9 @@ void tms3203x_device::ldige_reg(UINT32 op) } } -void tms3203x_device::ldige_dir(UINT32 op) +void tms3203x_device::ldige_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_GE()) { int dreg = (op >> 16) & 31; @@ -5021,9 +5021,9 @@ void tms3203x_device::ldige_dir(UINT32 op) } } -void tms3203x_device::ldige_ind(UINT32 op) +void tms3203x_device::ldige_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_GE()) { int dreg = (op >> 16) & 31; @@ -5033,12 +5033,12 @@ void tms3203x_device::ldige_ind(UINT32 op) } } -void tms3203x_device::ldige_imm(UINT32 op) +void tms3203x_device::ldige_imm(uint32_t op) { if (CONDITION_GE()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5046,7 +5046,7 @@ void tms3203x_device::ldige_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldinv_reg(UINT32 op) +void tms3203x_device::ldinv_reg(uint32_t op) { if (CONDITION_NV()) { @@ -5057,9 +5057,9 @@ void tms3203x_device::ldinv_reg(UINT32 op) } } -void tms3203x_device::ldinv_dir(UINT32 op) +void tms3203x_device::ldinv_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_NV()) { int dreg = (op >> 16) & 31; @@ -5069,9 +5069,9 @@ void tms3203x_device::ldinv_dir(UINT32 op) } } -void tms3203x_device::ldinv_ind(UINT32 op) +void tms3203x_device::ldinv_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_NV()) { int dreg = (op >> 16) & 31; @@ -5081,12 +5081,12 @@ void tms3203x_device::ldinv_ind(UINT32 op) } } -void tms3203x_device::ldinv_imm(UINT32 op) +void tms3203x_device::ldinv_imm(uint32_t op) { if (CONDITION_NV()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5094,7 +5094,7 @@ void tms3203x_device::ldinv_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldiuf_reg(UINT32 op) +void tms3203x_device::ldiuf_reg(uint32_t op) { if (CONDITION_UF()) { @@ -5105,9 +5105,9 @@ void tms3203x_device::ldiuf_reg(UINT32 op) } } -void tms3203x_device::ldiuf_dir(UINT32 op) +void tms3203x_device::ldiuf_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_UF()) { int dreg = (op >> 16) & 31; @@ -5117,9 +5117,9 @@ void tms3203x_device::ldiuf_dir(UINT32 op) } } -void tms3203x_device::ldiuf_ind(UINT32 op) +void tms3203x_device::ldiuf_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_UF()) { int dreg = (op >> 16) & 31; @@ -5129,12 +5129,12 @@ void tms3203x_device::ldiuf_ind(UINT32 op) } } -void tms3203x_device::ldiuf_imm(UINT32 op) +void tms3203x_device::ldiuf_imm(uint32_t op) { if (CONDITION_UF()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5142,7 +5142,7 @@ void tms3203x_device::ldiuf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldinuf_reg(UINT32 op) +void tms3203x_device::ldinuf_reg(uint32_t op) { if (CONDITION_NUF()) { @@ -5153,9 +5153,9 @@ void tms3203x_device::ldinuf_reg(UINT32 op) } } -void tms3203x_device::ldinuf_dir(UINT32 op) +void tms3203x_device::ldinuf_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_NUF()) { int dreg = (op >> 16) & 31; @@ -5165,9 +5165,9 @@ void tms3203x_device::ldinuf_dir(UINT32 op) } } -void tms3203x_device::ldinuf_ind(UINT32 op) +void tms3203x_device::ldinuf_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_NUF()) { int dreg = (op >> 16) & 31; @@ -5177,12 +5177,12 @@ void tms3203x_device::ldinuf_ind(UINT32 op) } } -void tms3203x_device::ldinuf_imm(UINT32 op) +void tms3203x_device::ldinuf_imm(uint32_t op) { if (CONDITION_NUF()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5190,7 +5190,7 @@ void tms3203x_device::ldinuf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldiv_reg(UINT32 op) +void tms3203x_device::ldiv_reg(uint32_t op) { if (CONDITION_V()) { @@ -5201,9 +5201,9 @@ void tms3203x_device::ldiv_reg(UINT32 op) } } -void tms3203x_device::ldiv_dir(UINT32 op) +void tms3203x_device::ldiv_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_V()) { int dreg = (op >> 16) & 31; @@ -5213,9 +5213,9 @@ void tms3203x_device::ldiv_dir(UINT32 op) } } -void tms3203x_device::ldiv_ind(UINT32 op) +void tms3203x_device::ldiv_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_V()) { int dreg = (op >> 16) & 31; @@ -5225,12 +5225,12 @@ void tms3203x_device::ldiv_ind(UINT32 op) } } -void tms3203x_device::ldiv_imm(UINT32 op) +void tms3203x_device::ldiv_imm(uint32_t op) { if (CONDITION_V()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5238,7 +5238,7 @@ void tms3203x_device::ldiv_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldinlv_reg(UINT32 op) +void tms3203x_device::ldinlv_reg(uint32_t op) { if (CONDITION_NLV()) { @@ -5249,9 +5249,9 @@ void tms3203x_device::ldinlv_reg(UINT32 op) } } -void tms3203x_device::ldinlv_dir(UINT32 op) +void tms3203x_device::ldinlv_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_NLV()) { int dreg = (op >> 16) & 31; @@ -5261,9 +5261,9 @@ void tms3203x_device::ldinlv_dir(UINT32 op) } } -void tms3203x_device::ldinlv_ind(UINT32 op) +void tms3203x_device::ldinlv_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_NLV()) { int dreg = (op >> 16) & 31; @@ -5273,12 +5273,12 @@ void tms3203x_device::ldinlv_ind(UINT32 op) } } -void tms3203x_device::ldinlv_imm(UINT32 op) +void tms3203x_device::ldinlv_imm(uint32_t op) { if (CONDITION_NLV()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5286,7 +5286,7 @@ void tms3203x_device::ldinlv_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldilv_reg(UINT32 op) +void tms3203x_device::ldilv_reg(uint32_t op) { if (CONDITION_LV()) { @@ -5297,9 +5297,9 @@ void tms3203x_device::ldilv_reg(UINT32 op) } } -void tms3203x_device::ldilv_dir(UINT32 op) +void tms3203x_device::ldilv_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_LV()) { int dreg = (op >> 16) & 31; @@ -5309,9 +5309,9 @@ void tms3203x_device::ldilv_dir(UINT32 op) } } -void tms3203x_device::ldilv_ind(UINT32 op) +void tms3203x_device::ldilv_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_LV()) { int dreg = (op >> 16) & 31; @@ -5321,12 +5321,12 @@ void tms3203x_device::ldilv_ind(UINT32 op) } } -void tms3203x_device::ldilv_imm(UINT32 op) +void tms3203x_device::ldilv_imm(uint32_t op) { if (CONDITION_LV()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5334,7 +5334,7 @@ void tms3203x_device::ldilv_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldinluf_reg(UINT32 op) +void tms3203x_device::ldinluf_reg(uint32_t op) { if (CONDITION_NLUF()) { @@ -5345,9 +5345,9 @@ void tms3203x_device::ldinluf_reg(UINT32 op) } } -void tms3203x_device::ldinluf_dir(UINT32 op) +void tms3203x_device::ldinluf_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_NLUF()) { int dreg = (op >> 16) & 31; @@ -5357,9 +5357,9 @@ void tms3203x_device::ldinluf_dir(UINT32 op) } } -void tms3203x_device::ldinluf_ind(UINT32 op) +void tms3203x_device::ldinluf_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_NLUF()) { int dreg = (op >> 16) & 31; @@ -5369,12 +5369,12 @@ void tms3203x_device::ldinluf_ind(UINT32 op) } } -void tms3203x_device::ldinluf_imm(UINT32 op) +void tms3203x_device::ldinluf_imm(uint32_t op) { if (CONDITION_NLUF()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5382,7 +5382,7 @@ void tms3203x_device::ldinluf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldiluf_reg(UINT32 op) +void tms3203x_device::ldiluf_reg(uint32_t op) { if (CONDITION_LUF()) { @@ -5393,9 +5393,9 @@ void tms3203x_device::ldiluf_reg(UINT32 op) } } -void tms3203x_device::ldiluf_dir(UINT32 op) +void tms3203x_device::ldiluf_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_LUF()) { int dreg = (op >> 16) & 31; @@ -5405,9 +5405,9 @@ void tms3203x_device::ldiluf_dir(UINT32 op) } } -void tms3203x_device::ldiluf_ind(UINT32 op) +void tms3203x_device::ldiluf_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_LUF()) { int dreg = (op >> 16) & 31; @@ -5417,12 +5417,12 @@ void tms3203x_device::ldiluf_ind(UINT32 op) } } -void tms3203x_device::ldiluf_imm(UINT32 op) +void tms3203x_device::ldiluf_imm(uint32_t op) { if (CONDITION_LUF()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5430,7 +5430,7 @@ void tms3203x_device::ldiluf_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldizuf_reg(UINT32 op) +void tms3203x_device::ldizuf_reg(uint32_t op) { if (CONDITION_ZUF()) { @@ -5441,9 +5441,9 @@ void tms3203x_device::ldizuf_reg(UINT32 op) } } -void tms3203x_device::ldizuf_dir(UINT32 op) +void tms3203x_device::ldizuf_dir(uint32_t op) { - UINT32 val = RMEM(DIRECT(op)); + uint32_t val = RMEM(DIRECT(op)); if (CONDITION_ZUF()) { int dreg = (op >> 16) & 31; @@ -5453,9 +5453,9 @@ void tms3203x_device::ldizuf_dir(UINT32 op) } } -void tms3203x_device::ldizuf_ind(UINT32 op) +void tms3203x_device::ldizuf_ind(uint32_t op) { - UINT32 val = RMEM(INDIRECT_D(op, op >> 8)); + uint32_t val = RMEM(INDIRECT_D(op, op >> 8)); if (CONDITION_ZUF()) { int dreg = (op >> 16) & 31; @@ -5465,12 +5465,12 @@ void tms3203x_device::ldizuf_ind(UINT32 op) } } -void tms3203x_device::ldizuf_imm(UINT32 op) +void tms3203x_device::ldizuf_imm(uint32_t op) { if (CONDITION_ZUF()) { int dreg = (op >> 16) & 31; - IREG(dreg) = (INT16)op; + IREG(dreg) = (int16_t)op; if (dreg >= TMR_BK) update_special(dreg); } @@ -5478,7 +5478,7 @@ void tms3203x_device::ldizuf_imm(UINT32 op) /*-----------------------------------------------------*/ -inline void tms3203x_device::execute_delayed(UINT32 newpc) +inline void tms3203x_device::execute_delayed(uint32_t newpc) { m_delayed = true; @@ -5511,20 +5511,20 @@ inline void tms3203x_device::execute_delayed(UINT32 newpc) /*-----------------------------------------------------*/ -void tms3203x_device::br_imm(UINT32 op) +void tms3203x_device::br_imm(uint32_t op) { m_pc = op & 0xffffff; m_icount -= 3*2; } -void tms3203x_device::brd_imm(UINT32 op) +void tms3203x_device::brd_imm(uint32_t op) { execute_delayed(op & 0xffffff); } /*-----------------------------------------------------*/ -void tms3203x_device::call_imm(UINT32 op) +void tms3203x_device::call_imm(uint32_t op) { WMEM(++IREG(TMR_SP), m_pc); m_pc = op & 0xffffff; @@ -5533,7 +5533,7 @@ void tms3203x_device::call_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::rptb_imm(UINT32 op) +void tms3203x_device::rptb_imm(uint32_t op) { IREG(TMR_RS) = m_pc; IREG(TMR_RE) = op & 0xffffff; @@ -5543,11 +5543,11 @@ void tms3203x_device::rptb_imm(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::swi(UINT32 op) { unimplemented(op); } +void tms3203x_device::swi(uint32_t op) { unimplemented(op); } /*-----------------------------------------------------*/ -void tms3203x_device::brc_reg(UINT32 op) +void tms3203x_device::brc_reg(uint32_t op) { if (condition(op >> 16)) { @@ -5556,7 +5556,7 @@ void tms3203x_device::brc_reg(UINT32 op) } } -void tms3203x_device::brcd_reg(UINT32 op) +void tms3203x_device::brcd_reg(uint32_t op) { if (condition(op >> 16)) execute_delayed(IREG(op & 31)); @@ -5564,26 +5564,26 @@ void tms3203x_device::brcd_reg(UINT32 op) execute_delayed(~0); } -void tms3203x_device::brc_imm(UINT32 op) +void tms3203x_device::brc_imm(uint32_t op) { if (condition(op >> 16)) { - m_pc += (INT16)op; + m_pc += (int16_t)op; m_icount -= 3*2; } } -void tms3203x_device::brcd_imm(UINT32 op) +void tms3203x_device::brcd_imm(uint32_t op) { if (condition(op >> 16)) - execute_delayed(m_pc + 2 + (INT16)op); + execute_delayed(m_pc + 2 + (int16_t)op); else execute_delayed(~0); } /*-----------------------------------------------------*/ -void tms3203x_device::dbc_reg(UINT32 op) +void tms3203x_device::dbc_reg(uint32_t op) { int reg = TMR_AR0 + ((op >> 22) & 7); int res = (IREG(reg) - 1) & 0xffffff; @@ -5595,7 +5595,7 @@ void tms3203x_device::dbc_reg(UINT32 op) } } -void tms3203x_device::dbcd_reg(UINT32 op) +void tms3203x_device::dbcd_reg(uint32_t op) { int reg = TMR_AR0 + ((op >> 22) & 7); int res = (IREG(reg) - 1) & 0xffffff; @@ -5606,32 +5606,32 @@ void tms3203x_device::dbcd_reg(UINT32 op) execute_delayed(~0); } -void tms3203x_device::dbc_imm(UINT32 op) +void tms3203x_device::dbc_imm(uint32_t op) { int reg = TMR_AR0 + ((op >> 22) & 7); int res = (IREG(reg) - 1) & 0xffffff; IREG(reg) = res | (IREG(reg) & 0xff000000); if (condition(op >> 16) && !(res & 0x800000)) { - m_pc += (INT16)op; + m_pc += (int16_t)op; m_icount -= 3*2; } } -void tms3203x_device::dbcd_imm(UINT32 op) +void tms3203x_device::dbcd_imm(uint32_t op) { int reg = TMR_AR0 + ((op >> 22) & 7); int res = (IREG(reg) - 1) & 0xffffff; IREG(reg) = res | (IREG(reg) & 0xff000000); if (condition(op >> 16) && !(res & 0x800000)) - execute_delayed(m_pc + 2 + (INT16)op); + execute_delayed(m_pc + 2 + (int16_t)op); else execute_delayed(~0); } /*-----------------------------------------------------*/ -void tms3203x_device::callc_reg(UINT32 op) +void tms3203x_device::callc_reg(uint32_t op) { if (condition(op >> 16)) { @@ -5641,12 +5641,12 @@ void tms3203x_device::callc_reg(UINT32 op) } } -void tms3203x_device::callc_imm(UINT32 op) +void tms3203x_device::callc_imm(uint32_t op) { if (condition(op >> 16)) { WMEM(++IREG(TMR_SP), m_pc); - m_pc += (INT16)op; + m_pc += (int16_t)op; m_icount -= 3*2; } } @@ -5664,7 +5664,7 @@ void tms3203x_device::trap(int trapnum) m_icount -= 4*2; } -void tms3203x_device::trapc(UINT32 op) +void tms3203x_device::trapc(uint32_t op) { if (condition(op >> 16)) trap(op & 0x3f); @@ -5672,7 +5672,7 @@ void tms3203x_device::trapc(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::retic_reg(UINT32 op) +void tms3203x_device::retic_reg(uint32_t op) { if (condition(op >> 16)) { @@ -5683,7 +5683,7 @@ void tms3203x_device::retic_reg(UINT32 op) } } -void tms3203x_device::retsc_reg(UINT32 op) +void tms3203x_device::retsc_reg(uint32_t op) { if (condition(op >> 16)) { @@ -5694,12 +5694,12 @@ void tms3203x_device::retsc_reg(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::mpyaddf_0(UINT32 op) +void tms3203x_device::mpyaddf_0(uint32_t op) { // src3 * src4, src1 + src2 DECLARE_DEF; - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); LONG2FP(TMR_TEMP1, src3); LONG2FP(TMR_TEMP2, src4); mpyf(m_r[TMR_TEMP3], m_r[TMR_TEMP1], m_r[TMR_TEMP2]); @@ -5708,12 +5708,12 @@ void tms3203x_device::mpyaddf_0(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::mpyaddf_1(UINT32 op) +void tms3203x_device::mpyaddf_1(uint32_t op) { // src3 * src1, src4 + src2 DECLARE_DEF; - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); LONG2FP(TMR_TEMP1, src3); LONG2FP(TMR_TEMP2, src4); mpyf(m_r[TMR_TEMP3], m_r[TMR_TEMP1], m_r[(op >> 19) & 7]); @@ -5722,12 +5722,12 @@ void tms3203x_device::mpyaddf_1(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::mpyaddf_2(UINT32 op) +void tms3203x_device::mpyaddf_2(uint32_t op) { // src1 * src2, src3 + src4 DECLARE_DEF; - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); LONG2FP(TMR_TEMP1, src3); LONG2FP(TMR_TEMP2, src4); mpyf(m_r[TMR_TEMP3], m_r[(op >> 19) & 7], m_r[(op >> 16) & 7]); @@ -5736,12 +5736,12 @@ void tms3203x_device::mpyaddf_2(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::mpyaddf_3(UINT32 op) +void tms3203x_device::mpyaddf_3(uint32_t op) { // src3 * src1, src2 + src4 DECLARE_DEF; - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); LONG2FP(TMR_TEMP1, src3); LONG2FP(TMR_TEMP2, src4); mpyf(m_r[TMR_TEMP3], m_r[TMR_TEMP1], m_r[(op >> 19) & 7]); @@ -5752,12 +5752,12 @@ void tms3203x_device::mpyaddf_3(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::mpysubf_0(UINT32 op) +void tms3203x_device::mpysubf_0(uint32_t op) { // src3 * src4, src1 - src2 DECLARE_DEF; - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); LONG2FP(TMR_TEMP1, src3); LONG2FP(TMR_TEMP2, src4); mpyf(m_r[TMR_TEMP3], m_r[TMR_TEMP1], m_r[TMR_TEMP2]); @@ -5766,12 +5766,12 @@ void tms3203x_device::mpysubf_0(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::mpysubf_1(UINT32 op) +void tms3203x_device::mpysubf_1(uint32_t op) { // src3 * src1, src4 - src2 DECLARE_DEF; - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); LONG2FP(TMR_TEMP1, src3); LONG2FP(TMR_TEMP2, src4); mpyf(m_r[TMR_TEMP3], m_r[TMR_TEMP1], m_r[(op >> 19) & 7]); @@ -5780,12 +5780,12 @@ void tms3203x_device::mpysubf_1(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::mpysubf_2(UINT32 op) +void tms3203x_device::mpysubf_2(uint32_t op) { // src1 * src2, src3 - src4 DECLARE_DEF; - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); LONG2FP(TMR_TEMP1, src3); LONG2FP(TMR_TEMP2, src4); mpyf(m_r[TMR_TEMP3], m_r[(op >> 19) & 7], m_r[(op >> 16) & 7]); @@ -5794,12 +5794,12 @@ void tms3203x_device::mpysubf_2(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::mpysubf_3(UINT32 op) +void tms3203x_device::mpysubf_3(uint32_t op) { // src3 * src1, src2 - src4 DECLARE_DEF; - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); LONG2FP(TMR_TEMP1, src3); LONG2FP(TMR_TEMP2, src4); mpyf(m_r[TMR_TEMP3], m_r[TMR_TEMP1], m_r[(op >> 19) & 7]); @@ -5810,96 +5810,96 @@ void tms3203x_device::mpysubf_3(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::mpyaddi_0(UINT32 op) +void tms3203x_device::mpyaddi_0(uint32_t op) { // src3 * src4, src1 + src2 DECLARE_DEF; - UINT32 src1 = IREG((op >> 19) & 7); - UINT32 src2 = IREG((op >> 16) & 7); - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); - INT64 mres = (INT64)((INT32)(src3 << 8) >> 8) * (INT64)((INT32)(src4 << 8) >> 8); - UINT32 ares = src1 + src2; + uint32_t src1 = IREG((op >> 19) & 7); + uint32_t src2 = IREG((op >> 16) & 7); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); + int64_t mres = (int64_t)((int32_t)(src3 << 8) >> 8) * (int64_t)((int32_t)(src4 << 8) >> 8); + uint32_t ares = src1 + src2; CLR_NZVUF(); if (OVM()) { - if (mres < -(INT64)0x80000000 || mres > (INT64)0x7fffffff) + if (mres < -(int64_t)0x80000000 || mres > (int64_t)0x7fffffff) mres = (mres < 0) ? 0x80000000 : 0x7fffffff; if (OVERFLOW_ADD(src1,src2,ares)) - ares = ((INT32)src1 < 0) ? 0x80000000 : 0x7fffffff; + ares = ((int32_t)src1 < 0) ? 0x80000000 : 0x7fffffff; } IREG((op >> 23) & 1) = mres; IREG(((op >> 22) & 1) | 2) = ares; UPDATE_DEF(); } -void tms3203x_device::mpyaddi_1(UINT32 op) +void tms3203x_device::mpyaddi_1(uint32_t op) { // src3 * src1, src4 + src2 DECLARE_DEF; - UINT32 src1 = IREG((op >> 19) & 7); - UINT32 src2 = IREG((op >> 16) & 7); - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); - INT64 mres = (INT64)((INT32)(src3 << 8) >> 8) * (INT64)((INT32)(src1 << 8) >> 8); - UINT32 ares = src4 + src2; + uint32_t src1 = IREG((op >> 19) & 7); + uint32_t src2 = IREG((op >> 16) & 7); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); + int64_t mres = (int64_t)((int32_t)(src3 << 8) >> 8) * (int64_t)((int32_t)(src1 << 8) >> 8); + uint32_t ares = src4 + src2; CLR_NZVUF(); if (OVM()) { - if (mres < -(INT64)0x80000000 || mres > (INT64)0x7fffffff) + if (mres < -(int64_t)0x80000000 || mres > (int64_t)0x7fffffff) mres = (mres < 0) ? 0x80000000 : 0x7fffffff; if (OVERFLOW_ADD(src4,src2,ares)) - ares = ((INT32)src4 < 0) ? 0x80000000 : 0x7fffffff; + ares = ((int32_t)src4 < 0) ? 0x80000000 : 0x7fffffff; } IREG((op >> 23) & 1) = mres; IREG(((op >> 22) & 1) | 2) = ares; UPDATE_DEF(); } -void tms3203x_device::mpyaddi_2(UINT32 op) +void tms3203x_device::mpyaddi_2(uint32_t op) { // src1 * src2, src3 + src4 DECLARE_DEF; - UINT32 src1 = IREG((op >> 19) & 7); - UINT32 src2 = IREG((op >> 16) & 7); - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); - INT64 mres = (INT64)((INT32)(src1 << 8) >> 8) * (INT64)((INT32)(src2 << 8) >> 8); - UINT32 ares = src3 + src4; + uint32_t src1 = IREG((op >> 19) & 7); + uint32_t src2 = IREG((op >> 16) & 7); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); + int64_t mres = (int64_t)((int32_t)(src1 << 8) >> 8) * (int64_t)((int32_t)(src2 << 8) >> 8); + uint32_t ares = src3 + src4; CLR_NZVUF(); if (OVM()) { - if (mres < -(INT64)0x80000000 || mres > (INT64)0x7fffffff) + if (mres < -(int64_t)0x80000000 || mres > (int64_t)0x7fffffff) mres = (mres < 0) ? 0x80000000 : 0x7fffffff; if (OVERFLOW_ADD(src3,src4,ares)) - ares = ((INT32)src3 < 0) ? 0x80000000 : 0x7fffffff; + ares = ((int32_t)src3 < 0) ? 0x80000000 : 0x7fffffff; } IREG((op >> 23) & 1) = mres; IREG(((op >> 22) & 1) | 2) = ares; UPDATE_DEF(); } -void tms3203x_device::mpyaddi_3(UINT32 op) +void tms3203x_device::mpyaddi_3(uint32_t op) { // src3 * src1, src2 + src4 DECLARE_DEF; - UINT32 src1 = IREG((op >> 19) & 7); - UINT32 src2 = IREG((op >> 16) & 7); - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); - INT64 mres = (INT64)((INT32)(src3 << 8) >> 8) * (INT64)((INT32)(src1 << 8) >> 8); - UINT32 ares = src2 + src4; + uint32_t src1 = IREG((op >> 19) & 7); + uint32_t src2 = IREG((op >> 16) & 7); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); + int64_t mres = (int64_t)((int32_t)(src3 << 8) >> 8) * (int64_t)((int32_t)(src1 << 8) >> 8); + uint32_t ares = src2 + src4; CLR_NZVUF(); if (OVM()) { - if (mres < -(INT64)0x80000000 || mres > (INT64)0x7fffffff) + if (mres < -(int64_t)0x80000000 || mres > (int64_t)0x7fffffff) mres = (mres < 0) ? 0x80000000 : 0x7fffffff; if (OVERFLOW_ADD(src2,src4,ares)) - ares = ((INT32)src2 < 0) ? 0x80000000 : 0x7fffffff; + ares = ((int32_t)src2 < 0) ? 0x80000000 : 0x7fffffff; } IREG((op >> 23) & 1) = mres; IREG(((op >> 22) & 1) | 2) = ares; @@ -5908,96 +5908,96 @@ void tms3203x_device::mpyaddi_3(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::mpysubi_0(UINT32 op) +void tms3203x_device::mpysubi_0(uint32_t op) { // src3 * src4, src1 - src2 DECLARE_DEF; - UINT32 src1 = IREG((op >> 19) & 7); - UINT32 src2 = IREG((op >> 16) & 7); - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); - INT64 mres = (INT64)((INT32)(src3 << 8) >> 8) * (INT64)((INT32)(src4 << 8) >> 8); - UINT32 ares = src1 - src2; + uint32_t src1 = IREG((op >> 19) & 7); + uint32_t src2 = IREG((op >> 16) & 7); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); + int64_t mres = (int64_t)((int32_t)(src3 << 8) >> 8) * (int64_t)((int32_t)(src4 << 8) >> 8); + uint32_t ares = src1 - src2; CLR_NZVUF(); if (OVM()) { - if (mres < -(INT64)0x80000000 || mres > (INT64)0x7fffffff) + if (mres < -(int64_t)0x80000000 || mres > (int64_t)0x7fffffff) mres = (mres < 0) ? 0x80000000 : 0x7fffffff; if (OVERFLOW_SUB(src1,src2,ares)) - ares = ((INT32)src1 < 0) ? 0x80000000 : 0x7fffffff; + ares = ((int32_t)src1 < 0) ? 0x80000000 : 0x7fffffff; } IREG((op >> 23) & 1) = mres; IREG(((op >> 22) & 1) | 2) = ares; UPDATE_DEF(); } -void tms3203x_device::mpysubi_1(UINT32 op) +void tms3203x_device::mpysubi_1(uint32_t op) { // src3 * src1, src4 - src2 DECLARE_DEF; - UINT32 src1 = IREG((op >> 19) & 7); - UINT32 src2 = IREG((op >> 16) & 7); - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); - INT64 mres = (INT64)((INT32)(src3 << 8) >> 8) * (INT64)((INT32)(src1 << 8) >> 8); - UINT32 ares = src4 - src2; + uint32_t src1 = IREG((op >> 19) & 7); + uint32_t src2 = IREG((op >> 16) & 7); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); + int64_t mres = (int64_t)((int32_t)(src3 << 8) >> 8) * (int64_t)((int32_t)(src1 << 8) >> 8); + uint32_t ares = src4 - src2; CLR_NZVUF(); if (OVM()) { - if (mres < -(INT64)0x80000000 || mres > (INT64)0x7fffffff) + if (mres < -(int64_t)0x80000000 || mres > (int64_t)0x7fffffff) mres = (mres < 0) ? 0x80000000 : 0x7fffffff; if (OVERFLOW_SUB(src4,src2,ares)) - ares = ((INT32)src4 < 0) ? 0x80000000 : 0x7fffffff; + ares = ((int32_t)src4 < 0) ? 0x80000000 : 0x7fffffff; } IREG((op >> 23) & 1) = mres; IREG(((op >> 22) & 1) | 2) = ares; UPDATE_DEF(); } -void tms3203x_device::mpysubi_2(UINT32 op) +void tms3203x_device::mpysubi_2(uint32_t op) { // src1 * src2, src3 - src4 DECLARE_DEF; - UINT32 src1 = IREG((op >> 19) & 7); - UINT32 src2 = IREG((op >> 16) & 7); - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); - INT64 mres = (INT64)((INT32)(src1 << 8) >> 8) * (INT64)((INT32)(src2 << 8) >> 8); - UINT32 ares = src3 - src4; + uint32_t src1 = IREG((op >> 19) & 7); + uint32_t src2 = IREG((op >> 16) & 7); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); + int64_t mres = (int64_t)((int32_t)(src1 << 8) >> 8) * (int64_t)((int32_t)(src2 << 8) >> 8); + uint32_t ares = src3 - src4; CLR_NZVUF(); if (OVM()) { - if (mres < -(INT64)0x80000000 || mres > (INT64)0x7fffffff) + if (mres < -(int64_t)0x80000000 || mres > (int64_t)0x7fffffff) mres = (mres < 0) ? 0x80000000 : 0x7fffffff; if (OVERFLOW_SUB(src3,src4,ares)) - ares = ((INT32)src3 < 0) ? 0x80000000 : 0x7fffffff; + ares = ((int32_t)src3 < 0) ? 0x80000000 : 0x7fffffff; } IREG((op >> 23) & 1) = mres; IREG(((op >> 22) & 1) | 2) = ares; UPDATE_DEF(); } -void tms3203x_device::mpysubi_3(UINT32 op) +void tms3203x_device::mpysubi_3(uint32_t op) { // src3 * src1, src2 - src4 DECLARE_DEF; - UINT32 src1 = IREG((op >> 19) & 7); - UINT32 src2 = IREG((op >> 16) & 7); - UINT32 src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); - UINT32 src4 = RMEM(INDIRECT_1(op, op)); - INT64 mres = (INT64)((INT32)(src3 << 8) >> 8) * (INT64)((INT32)(src1 << 8) >> 8); - UINT32 ares = src2 - src4; + uint32_t src1 = IREG((op >> 19) & 7); + uint32_t src2 = IREG((op >> 16) & 7); + uint32_t src3 = RMEM(INDIRECT_1_DEF(op, op >> 8)); + uint32_t src4 = RMEM(INDIRECT_1(op, op)); + int64_t mres = (int64_t)((int32_t)(src3 << 8) >> 8) * (int64_t)((int32_t)(src1 << 8) >> 8); + uint32_t ares = src2 - src4; CLR_NZVUF(); if (OVM()) { - if (mres < -(INT64)0x80000000 || mres > (INT64)0x7fffffff) + if (mres < -(int64_t)0x80000000 || mres > (int64_t)0x7fffffff) mres = (mres < 0) ? 0x80000000 : 0x7fffffff; if (OVERFLOW_SUB(src2,src4,ares)) - ares = ((INT32)src2 < 0) ? 0x80000000 : 0x7fffffff; + ares = ((int32_t)src2 < 0) ? 0x80000000 : 0x7fffffff; } IREG((op >> 23) & 1) = mres; IREG(((op >> 22) & 1) | 2) = ares; @@ -6006,7 +6006,7 @@ void tms3203x_device::mpysubi_3(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::stfstf(UINT32 op) +void tms3203x_device::stfstf(uint32_t op) { DECLARE_DEF; WMEM(INDIRECT_1_DEF(op, op >> 8), FP2LONG((op >> 16) & 7)); @@ -6014,7 +6014,7 @@ void tms3203x_device::stfstf(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::stisti(UINT32 op) +void tms3203x_device::stisti(uint32_t op) { DECLARE_DEF; WMEM(INDIRECT_1_DEF(op, op >> 8), IREG((op >> 16) & 7)); @@ -6024,10 +6024,10 @@ void tms3203x_device::stisti(UINT32 op) /*-----------------------------------------------------*/ -void tms3203x_device::ldfldf(UINT32 op) +void tms3203x_device::ldfldf(uint32_t op) { DECLARE_DEF; - UINT32 res; + uint32_t res; int dreg; res = RMEM(INDIRECT_1_DEF(op, op >> 8)); @@ -6039,7 +6039,7 @@ void tms3203x_device::ldfldf(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::ldildi(UINT32 op) +void tms3203x_device::ldildi(uint32_t op) { DECLARE_DEF; IREG((op >> 19) & 7) = RMEM(INDIRECT_1_DEF(op, op >> 8)); @@ -6055,11 +6055,11 @@ void tms3203x_device::ldildi(UINT32 op) // sreg1 = ((op >> 19) & 7) // dreg1 = ((op >> 22) & 7) -void tms3203x_device::absfstf(UINT32 op) +void tms3203x_device::absfstf(uint32_t op) { DECLARE_DEF; - UINT32 src3 = FP2LONG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = FP2LONG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; LONG2FP(TMR_TEMP1, src2); @@ -6069,11 +6069,11 @@ void tms3203x_device::absfstf(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::absisti(UINT32 op) +void tms3203x_device::absisti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; ABSI(dreg, src2); @@ -6082,11 +6082,11 @@ void tms3203x_device::absisti(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::addf3stf(UINT32 op) +void tms3203x_device::addf3stf(uint32_t op) { DECLARE_DEF; - UINT32 src3 = FP2LONG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = FP2LONG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { LONG2FP(TMR_TEMP1, src2); addf(m_r[(op >> 22) & 7], m_r[(op >> 19) & 7], m_r[TMR_TEMP1]); @@ -6095,53 +6095,53 @@ void tms3203x_device::addf3stf(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::addi3sti(UINT32 op) +void tms3203x_device::addi3sti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; - UINT32 src1 = IREG((op >> 19) & 7); + uint32_t src1 = IREG((op >> 19) & 7); ADDI(dreg, src1, src2); } WMEM(INDIRECT_1(op, op >> 8), src3); UPDATE_DEF(); } -void tms3203x_device::and3sti(UINT32 op) +void tms3203x_device::and3sti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; - UINT32 src1 = IREG((op >> 19) & 7); + uint32_t src1 = IREG((op >> 19) & 7); AND(dreg, src1, src2); } WMEM(INDIRECT_1(op, op >> 8), src3); UPDATE_DEF(); } -void tms3203x_device::ash3sti(UINT32 op) +void tms3203x_device::ash3sti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; - UINT32 count = IREG((op >> 19) & 7); + uint32_t count = IREG((op >> 19) & 7); ASH(dreg, src2, count); } WMEM(INDIRECT_1(op, op >> 8), src3); UPDATE_DEF(); } -void tms3203x_device::fixsti(UINT32 op) +void tms3203x_device::fixsti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; LONG2FP(dreg, src2); @@ -6151,11 +6151,11 @@ void tms3203x_device::fixsti(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::floatstf(UINT32 op) +void tms3203x_device::floatstf(uint32_t op) { DECLARE_DEF; - UINT32 src3 = FP2LONG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = FP2LONG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; IREG(dreg) = src2; @@ -6165,11 +6165,11 @@ void tms3203x_device::floatstf(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::ldfstf(UINT32 op) +void tms3203x_device::ldfstf(uint32_t op) { DECLARE_DEF; - UINT32 src3 = FP2LONG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = FP2LONG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; LONG2FP(dreg, src2); @@ -6178,35 +6178,35 @@ void tms3203x_device::ldfstf(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::ldisti(UINT32 op) +void tms3203x_device::ldisti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); IREG((op >> 22) & 7) = src2; WMEM(INDIRECT_1(op, op >> 8), src3); UPDATE_DEF(); } -void tms3203x_device::lsh3sti(UINT32 op) +void tms3203x_device::lsh3sti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; - UINT32 count = IREG((op >> 19) & 7); + uint32_t count = IREG((op >> 19) & 7); LSH(dreg, src2, count); } WMEM(INDIRECT_1(op, op >> 8), src3); UPDATE_DEF(); } -void tms3203x_device::mpyf3stf(UINT32 op) +void tms3203x_device::mpyf3stf(uint32_t op) { DECLARE_DEF; - UINT32 src3 = FP2LONG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = FP2LONG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { LONG2FP(TMR_TEMP1, src2); mpyf(m_r[(op >> 22) & 7], m_r[(op >> 19) & 7], m_r[TMR_TEMP1]); @@ -6215,25 +6215,25 @@ void tms3203x_device::mpyf3stf(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::mpyi3sti(UINT32 op) +void tms3203x_device::mpyi3sti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; - UINT32 src1 = IREG((op >> 19) & 7); + uint32_t src1 = IREG((op >> 19) & 7); MPYI(dreg, src1, src2); } WMEM(INDIRECT_1(op, op >> 8), src3); UPDATE_DEF(); } -void tms3203x_device::negfstf(UINT32 op) +void tms3203x_device::negfstf(uint32_t op) { DECLARE_DEF; - UINT32 src3 = FP2LONG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = FP2LONG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { LONG2FP(TMR_TEMP1, src2); negf(m_r[(op >> 22) & 7], m_r[TMR_TEMP1]); @@ -6242,11 +6242,11 @@ void tms3203x_device::negfstf(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::negisti(UINT32 op) +void tms3203x_device::negisti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; NEGI(dreg, src2); @@ -6255,11 +6255,11 @@ void tms3203x_device::negisti(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::notsti(UINT32 op) +void tms3203x_device::notsti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; NOT(dreg, src2); @@ -6268,25 +6268,25 @@ void tms3203x_device::notsti(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::or3sti(UINT32 op) +void tms3203x_device::or3sti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; - UINT32 src1 = IREG((op >> 19) & 7); + uint32_t src1 = IREG((op >> 19) & 7); OR(dreg, src1, src2); } WMEM(INDIRECT_1(op, op >> 8), src3); UPDATE_DEF(); } -void tms3203x_device::subf3stf(UINT32 op) +void tms3203x_device::subf3stf(uint32_t op) { DECLARE_DEF; - UINT32 src3 = FP2LONG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = FP2LONG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { LONG2FP(TMR_TEMP1, src2); subf(m_r[(op >> 22) & 7], m_r[TMR_TEMP1], m_r[(op >> 19) & 7]); @@ -6295,28 +6295,28 @@ void tms3203x_device::subf3stf(UINT32 op) UPDATE_DEF(); } -void tms3203x_device::subi3sti(UINT32 op) +void tms3203x_device::subi3sti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; - UINT32 src1 = IREG((op >> 19) & 7); + uint32_t src1 = IREG((op >> 19) & 7); SUBI(dreg, src2, src1); } WMEM(INDIRECT_1(op, op >> 8), src3); UPDATE_DEF(); } -void tms3203x_device::xor3sti(UINT32 op) +void tms3203x_device::xor3sti(uint32_t op) { DECLARE_DEF; - UINT32 src3 = IREG((op >> 16) & 7); - UINT32 src2 = RMEM(INDIRECT_1_DEF(op, op)); + uint32_t src3 = IREG((op >> 16) & 7); + uint32_t src2 = RMEM(INDIRECT_1_DEF(op, op)); { int dreg = (op >> 22) & 7; - UINT32 src1 = IREG((op >> 19) & 7); + uint32_t src1 = IREG((op >> 19) & 7); XOR(dreg, src1, src2); } WMEM(INDIRECT_1(op, op >> 8), src3); @@ -6328,7 +6328,7 @@ void tms3203x_device::xor3sti(UINT32 op) // FUNCTION TABLE //************************************************************************** -UINT32 (tms3203x_device::*const tms3203x_device::s_indirect_d[0x20])(UINT32, UINT8) = +uint32_t (tms3203x_device::*const tms3203x_device::s_indirect_d[0x20])(uint32_t, uint8_t) = { &tms3203x_device::mod00_d, &tms3203x_device::mod01_d, &tms3203x_device::mod02_d, &tms3203x_device::mod03_d, &tms3203x_device::mod04_d, &tms3203x_device::mod05_d, &tms3203x_device::mod06_d, &tms3203x_device::mod07_d, @@ -6341,7 +6341,7 @@ UINT32 (tms3203x_device::*const tms3203x_device::s_indirect_d[0x20])(UINT32, UIN }; -UINT32 (tms3203x_device::*const tms3203x_device::s_indirect_1[0x20])(UINT32, UINT8) = +uint32_t (tms3203x_device::*const tms3203x_device::s_indirect_1[0x20])(uint32_t, uint8_t) = { &tms3203x_device::mod00_1, &tms3203x_device::mod01_1, &tms3203x_device::mod02_1, &tms3203x_device::mod03_1, &tms3203x_device::mod04_1, &tms3203x_device::mod05_1, &tms3203x_device::mod06_1, &tms3203x_device::mod07_1, @@ -6354,7 +6354,7 @@ UINT32 (tms3203x_device::*const tms3203x_device::s_indirect_1[0x20])(UINT32, UIN }; -UINT32 (tms3203x_device::*const tms3203x_device::s_indirect_1_def[0x20])(UINT32, UINT8, UINT32 *&) = +uint32_t (tms3203x_device::*const tms3203x_device::s_indirect_1_def[0x20])(uint32_t, uint8_t, uint32_t *&) = { &tms3203x_device::mod00_1_def, &tms3203x_device::mod01_1_def, &tms3203x_device::mod02_1_def, &tms3203x_device::mod03_1_def, &tms3203x_device::mod04_1_def, &tms3203x_device::mod05_1_def, &tms3203x_device::mod06_1_def, &tms3203x_device::mod07_1_def, @@ -6366,7 +6366,7 @@ UINT32 (tms3203x_device::*const tms3203x_device::s_indirect_1_def[0x20])(UINT32, &tms3203x_device::modillegal_def,&tms3203x_device::modillegal_def,&tms3203x_device::modillegal_def,&tms3203x_device::modillegal_def }; -void (tms3203x_device::*const tms3203x_device::s_tms32031ops[])(UINT32 op) = +void (tms3203x_device::*const tms3203x_device::s_tms32031ops[])(uint32_t op) = { &tms3203x_device::absf_reg, &tms3203x_device::absf_dir, &tms3203x_device::absf_ind, &tms3203x_device::absf_imm, // 0x00 &tms3203x_device::absi_reg, &tms3203x_device::absi_dir, &tms3203x_device::absi_ind, &tms3203x_device::absi_imm, diff --git a/src/devices/cpu/tms32031/dis32031.cpp b/src/devices/cpu/tms32031/dis32031.cpp index 4ab75192704..d5c1d01d73b 100644 --- a/src/devices/cpu/tms32031/dis32031.cpp +++ b/src/devices/cpu/tms32031/dis32031.cpp @@ -31,7 +31,7 @@ ***************************************************************************/ #if 0 -static inline char *signed_16bit(INT16 val) +static inline char *signed_16bit(int16_t val) { static char temp[10]; if (val < 0) @@ -122,7 +122,7 @@ static const char *const condition[32] = // 19 = LUF (LUF) // 20 = ZUF (Z | UF) -static void append_indirect(UINT8 ma, INT8 disp, char *buffer) +static void append_indirect(uint8_t ma, int8_t disp, char *buffer) { char *dst = &buffer[strlen(buffer)]; char dispstr[20]; @@ -174,14 +174,14 @@ static void append_indirect(UINT8 ma, INT8 disp, char *buffer) } } -static void append_immediate(UINT16 data, int is_float, int is_unsigned, char *buffer) +static void append_immediate(uint16_t data, int is_float, int is_unsigned, char *buffer) { char *dst = &buffer[strlen(buffer)]; if (is_float) { - int exp = ((INT16)data >> 12) + 127; - UINT32 expanded_data; + int exp = ((int16_t)data >> 12) + 127; + uint32_t expanded_data; float float_val; expanded_data = ((data & 0x0800) << 20) + ((exp << 23) & 0x7f800000); @@ -194,13 +194,13 @@ static void append_immediate(UINT16 data, int is_float, int is_unsigned, char *b float_val = *(float *)&expanded_data; sprintf(dst, "%8f", (double) float_val); } - else if (!is_unsigned && (INT16)data < 0) + else if (!is_unsigned && (int16_t)data < 0) sprintf(dst, "-$%04X", -data & 0xffff); else sprintf(dst, "$%04X", data); } -static void disasm_general(const char *opstring, UINT32 op, int flags, char *buffer) +static void disasm_general(const char *opstring, uint32_t op, int flags, char *buffer) { sprintf(buffer, "%-6s", opstring); @@ -242,7 +242,7 @@ static void disasm_general(const char *opstring, UINT32 op, int flags, char *buf } } -static void disasm_3op(const char *opstring, UINT32 op, int flags, char *buffer) +static void disasm_3op(const char *opstring, uint32_t op, int flags, char *buffer) { sprintf(buffer, "%-6s", opstring); @@ -287,7 +287,7 @@ static void disasm_3op(const char *opstring, UINT32 op, int flags, char *buffer) } } -static void disasm_conditional(const char *opstring, UINT32 op, int flags, char *buffer) +static void disasm_conditional(const char *opstring, uint32_t op, int flags, char *buffer) { char temp[10]; sprintf(temp, "%s%s", opstring, condition[(op >> 23) & 31]); @@ -295,9 +295,9 @@ static void disasm_conditional(const char *opstring, UINT32 op, int flags, char } -static void disasm_parallel_3op3op(const char *opstring1, const char *opstring2, UINT32 op, int flags, const UINT8 *srctable, char *buffer) +static void disasm_parallel_3op3op(const char *opstring1, const char *opstring2, uint32_t op, int flags, const uint8_t *srctable, char *buffer) { - const UINT8 *s = &srctable[((op >> 24) & 3) * 4]; + const uint8_t *s = &srctable[((op >> 24) & 3) * 4]; int d1 = (op >> 23) & 1; int d2 = 2 + ((op >> 22) & 1); char src[5][20]; @@ -317,7 +317,7 @@ static void disasm_parallel_3op3op(const char *opstring1, const char *opstring2, } -static void disasm_parallel_3opstore(const char *opstring1, const char *opstring2, UINT32 op, int flags, char *buffer) +static void disasm_parallel_3opstore(const char *opstring1, const char *opstring2, uint32_t op, int flags, char *buffer) { int d1 = (op >> 22) & 7; int s1 = (op >> 19) & 7; @@ -341,7 +341,7 @@ static void disasm_parallel_3opstore(const char *opstring1, const char *opstring } -static void disasm_parallel_loadload(const char *opstring1, const char *opstring2, UINT32 op, int flags, char *buffer) +static void disasm_parallel_loadload(const char *opstring1, const char *opstring2, uint32_t op, int flags, char *buffer) { int d2 = (op >> 22) & 7; int d1 = (op >> 19) & 7; @@ -359,7 +359,7 @@ static void disasm_parallel_loadload(const char *opstring1, const char *opstring } -static void disasm_parallel_storestore(const char *opstring1, const char *opstring2, UINT32 op, int flags, char *buffer) +static void disasm_parallel_storestore(const char *opstring1, const char *opstring2, uint32_t op, int flags, char *buffer) { int s2 = (op >> 22) & 7; int s1 = (op >> 16) & 7; @@ -378,9 +378,9 @@ static void disasm_parallel_storestore(const char *opstring1, const char *opstri -static unsigned dasm_tms3203x(char *buffer, unsigned pc, UINT32 op) +static unsigned dasm_tms3203x(char *buffer, unsigned pc, uint32_t op) { - UINT32 flags = 0; + uint32_t flags = 0; switch (op >> 23) { @@ -524,7 +524,7 @@ static unsigned dasm_tms3203x(char *buffer, unsigned pc, UINT32 op) { char temp[10]; sprintf(temp, "B%s%s", condition[(op >> 16) & 31], ((op >> 21) & 1) ? "D" : ""); - sprintf(buffer, "%-6s$%06X", temp, (pc + (((op >> 21) & 1) ? 3 : 1) + (INT16)op) & 0xffffff); + sprintf(buffer, "%-6s$%06X", temp, (pc + (((op >> 21) & 1) ? 3 : 1) + (int16_t)op) & 0xffffff); break; } @@ -541,7 +541,7 @@ static unsigned dasm_tms3203x(char *buffer, unsigned pc, UINT32 op) { char temp[10]; sprintf(temp, "DB%s%s", condition[(op >> 16) & 31], ((op >> 21) & 1) ? "D" : ""); - sprintf(buffer, "%-6sAR%d,$%06X", temp, (op >> 22) & 7, (pc + (((op >> 21) & 1) ? 3 : 1) + (INT16)op) & 0xffffff); + sprintf(buffer, "%-6sAR%d,$%06X", temp, (op >> 22) & 7, (pc + (((op >> 21) & 1) ? 3 : 1) + (int16_t)op) & 0xffffff); break; } @@ -559,7 +559,7 @@ static unsigned dasm_tms3203x(char *buffer, unsigned pc, UINT32 op) { char temp[10]; sprintf(temp, "CALL%s", condition[(op >> 16) & 31]); - sprintf(buffer, "%-6s$%06X", temp, (pc + 1 + (INT16)op) & 0xffffff); + sprintf(buffer, "%-6s$%06X", temp, (pc + 1 + (int16_t)op) & 0xffffff); flags = DASMFLAG_STEP_OVER; break; } @@ -589,7 +589,7 @@ static unsigned dasm_tms3203x(char *buffer, unsigned pc, UINT32 op) case 0x100: case 0x101: case 0x102: case 0x103: case 0x104: case 0x105: case 0x106: case 0x107: // MPYF3||ADDF3 { - static const UINT8 srctable[] = { 3,4,1,2, 3,1,4,2, 1,2,3,4, 3,1,2,4 }; + static const uint8_t srctable[] = { 3,4,1,2, 3,1,4,2, 1,2,3,4, 3,1,2,4 }; disasm_parallel_3op3op("MPYF3", "ADDF3", op, FLOAT, srctable, buffer); break; } @@ -598,7 +598,7 @@ static unsigned dasm_tms3203x(char *buffer, unsigned pc, UINT32 op) case 0x108: case 0x109: case 0x10a: case 0x10b: case 0x10c: case 0x10d: case 0x10e: case 0x10f: // MPYF3||SUBF3 { - static const UINT8 srctable[] = { 3,4,1,2, 3,1,4,2, 1,2,3,4, 3,1,2,4 }; + static const uint8_t srctable[] = { 3,4,1,2, 3,1,4,2, 1,2,3,4, 3,1,2,4 }; disasm_parallel_3op3op("MPYF3", "SUBF3", op, FLOAT, srctable, buffer); break; } @@ -607,7 +607,7 @@ static unsigned dasm_tms3203x(char *buffer, unsigned pc, UINT32 op) case 0x110: case 0x111: case 0x112: case 0x113: case 0x114: case 0x115: case 0x116: case 0x117: // MPYI3||ADDI3 { - static const UINT8 srctable[] = { 3,4,1,2, 3,1,4,2, 1,2,3,4, 3,1,2,4 }; + static const uint8_t srctable[] = { 3,4,1,2, 3,1,4,2, 1,2,3,4, 3,1,2,4 }; disasm_parallel_3op3op("MPYI3", "ADDI3", op, INTEGER, srctable, buffer); break; } @@ -616,7 +616,7 @@ static unsigned dasm_tms3203x(char *buffer, unsigned pc, UINT32 op) case 0x118: case 0x119: case 0x11a: case 0x11b: case 0x11c: case 0x11d: case 0x11e: case 0x11f: // MPYI3||SUBI3 { - static const UINT8 srctable[] = { 3,4,1,2, 3,1,4,2, 1,2,3,4, 3,1,2,4 }; + static const uint8_t srctable[] = { 3,4,1,2, 3,1,4,2, 1,2,3,4, 3,1,2,4 }; disasm_parallel_3op3op("MPYI3", "SUBI3", op, INTEGER, srctable, buffer); break; } @@ -740,6 +740,6 @@ static unsigned dasm_tms3203x(char *buffer, unsigned pc, UINT32 op) CPU_DISASSEMBLE( tms3203x ) { - UINT32 op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); + uint32_t op = oprom[0] | (oprom[1] << 8) | (oprom[2] << 16) | (oprom[3] << 24); return dasm_tms3203x(buffer, pc, op); } diff --git a/src/devices/cpu/tms32031/tms32031.cpp b/src/devices/cpu/tms32031/tms32031.cpp index 22593bc9e15..a2a86c8b89a 100644 --- a/src/devices/cpu/tms32031/tms32031.cpp +++ b/src/devices/cpu/tms32031/tms32031.cpp @@ -144,7 +144,7 @@ float tms3203x_device::tmsreg::as_float() const else { int exp = (exponent() + 127) << 23; - INT32 man = -mantissa(); + int32_t man = -mantissa(); id.i[0] = 0x80000000 + exp + ((man >> 8) & 0x00ffffff); } @@ -179,7 +179,7 @@ double tms3203x_device::tmsreg::as_double() const else { int exp = (exponent() + 1023) << 20; - INT32 man = -mantissa(); + int32_t man = -mantissa(); id.i[BYTE_XOR_BE(0)] = 0x80000000 + exp + ((man >> 11) & 0x001fffff); id.i[BYTE_XOR_BE(1)] = (man << 21) & 0xffe00000; } @@ -199,8 +199,8 @@ void tms3203x_device::tmsreg::from_double(double val) // extract mantissa and exponent from the IEEE input int_double id; id.d = val; - INT32 mantissa = ((id.i[BYTE_XOR_BE(0)] & 0x000fffff) << 11) | ((id.i[BYTE_XOR_BE(1)] & 0xffe00000) >> 21); - INT32 exponent = ((id.i[BYTE_XOR_BE(0)] & 0x7ff00000) >> 20) - 1023; + int32_t mantissa = ((id.i[BYTE_XOR_BE(0)] & 0x000fffff) << 11) | ((id.i[BYTE_XOR_BE(1)] & 0xffe00000) >> 21); + int32_t exponent = ((id.i[BYTE_XOR_BE(0)] & 0x7ff00000) >> 20) - 1023; // if we're too small, map to 0 if (exponent < -128) @@ -212,7 +212,7 @@ void tms3203x_device::tmsreg::from_double(double val) // if we're too large, map to the maximum value else if (exponent > 127) { - if ((INT32)id.i[BYTE_XOR_BE(0)] >= 0) + if ((int32_t)id.i[BYTE_XOR_BE(0)] >= 0) set_mantissa(0x7fffffff); else set_mantissa(0x80000001); @@ -220,7 +220,7 @@ void tms3203x_device::tmsreg::from_double(double val) } // if we're positive, map directly - else if ((INT32)id.i[BYTE_XOR_BE(0)] >= 0) + else if ((int32_t)id.i[BYTE_XOR_BE(0)] >= 0) { set_mantissa(mantissa); set_exponent(exponent); @@ -251,7 +251,7 @@ void tms3203x_device::tmsreg::from_double(double val) // tms3203x_device - constructor //------------------------------------------------- -tms3203x_device::tms3203x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype, address_map_constructor internal_map, const char *shortname, const char *source) +tms3203x_device::tms3203x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t chiptype, address_map_constructor internal_map, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_LITTLE, 32, 24, -2, internal_map), m_chip_type(chiptype), @@ -280,12 +280,12 @@ tms3203x_device::tms3203x_device(const machine_config &mconfig, device_type type #endif } -tms32031_device::tms32031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32031_device::tms32031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms3203x_device(mconfig, TMS32031, "TMS32031", tag, owner, clock, CHIP_TYPE_TMS32031, ADDRESS_MAP_NAME(internal_32031), "tms32031", __FILE__) { } -tms32032_device::tms32032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32032_device::tms32032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms3203x_device(mconfig, TMS32032, "TMS32032", tag, owner, clock, CHIP_TYPE_TMS32032, ADDRESS_MAP_NAME(internal_32032), "tms32032", __FILE__) { } @@ -337,7 +337,7 @@ const tiny_rom_entry *tms3203x_device::device_rom_region() const // ROPCODE - fetch an opcode //------------------------------------------------- -inline UINT32 tms3203x_device::ROPCODE(offs_t pc) +inline uint32_t tms3203x_device::ROPCODE(offs_t pc) { return m_direct->read_dword(pc << 2); } @@ -347,7 +347,7 @@ inline UINT32 tms3203x_device::ROPCODE(offs_t pc) // RMEM - read memory //------------------------------------------------- -inline UINT32 tms3203x_device::RMEM(offs_t addr) +inline uint32_t tms3203x_device::RMEM(offs_t addr) { if (m_mcbl_mode && addr < 0x1000) return m_bootrom[addr]; @@ -360,7 +360,7 @@ inline UINT32 tms3203x_device::RMEM(offs_t addr) // WMEM - write memory //------------------------------------------------- -inline void tms3203x_device::WMEM(offs_t addr, UINT32 data) +inline void tms3203x_device::WMEM(offs_t addr, uint32_t data) { m_program->write_dword(addr << 2, data); } @@ -382,7 +382,7 @@ void tms3203x_device::device_start() m_iack_cb.resolve_safe(); // set up the internal boot loader ROM - m_bootrom = reinterpret_cast(memregion(shortname())->base()); + m_bootrom = reinterpret_cast(memregion(shortname())->base()); m_direct->set_direct_update(direct_update_delegate(FUNC(tms3203x_device::direct_handler), this)); // save state @@ -547,7 +547,7 @@ void tms3203x_device::state_string_export(const device_state_entry &entry, std:: break; case STATE_GENFLAGS: - UINT32 temp = m_r[TMR_ST].i32[0]; + uint32_t temp = m_r[TMR_ST].i32[0]; str = string_format("%c%c%c%c%c%c%c%c", (temp & 0x80) ? 'O':'.', (temp & 0x40) ? 'U':'.', @@ -567,7 +567,7 @@ void tms3203x_device::state_string_export(const device_state_entry &entry, std:: // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 tms3203x_device::disasm_min_opcode_bytes() const +uint32_t tms3203x_device::disasm_min_opcode_bytes() const { return 4; } @@ -578,7 +578,7 @@ UINT32 tms3203x_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 tms3203x_device::disasm_max_opcode_bytes() const +uint32_t tms3203x_device::disasm_max_opcode_bytes() const { return 4; } @@ -589,7 +589,7 @@ UINT32 tms3203x_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t tms3203x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms3203x_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms3203x ); return CPU_DISASSEMBLE_NAME(tms3203x)(this, buffer, pc, oprom, opram, options); @@ -606,9 +606,9 @@ offs_t tms3203x_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 // floating-point format a 32-bit IEEE float //------------------------------------------------- -float tms3203x_device::fp_to_float(UINT32 floatdata) +float tms3203x_device::fp_to_float(uint32_t floatdata) { - tmsreg gen(floatdata << 8, (INT32)floatdata >> 24); + tmsreg gen(floatdata << 8, (int32_t)floatdata >> 24); return gen.as_float(); } @@ -618,9 +618,9 @@ float tms3203x_device::fp_to_float(UINT32 floatdata) // floating-point format a 64-bit IEEE double //------------------------------------------------- -double tms3203x_device::fp_to_double(UINT32 floatdata) +double tms3203x_device::fp_to_double(uint32_t floatdata) { - tmsreg gen(floatdata << 8, (INT32)floatdata >> 24); + tmsreg gen(floatdata << 8, (int32_t)floatdata >> 24); return gen.as_double(); } @@ -630,10 +630,10 @@ double tms3203x_device::fp_to_double(UINT32 floatdata) // a 32-bit DSP floating-point value //------------------------------------------------- -UINT32 tms3203x_device::float_to_fp(float fval) +uint32_t tms3203x_device::float_to_fp(float fval) { tmsreg gen(fval); - return (gen.exponent() << 24) | ((UINT32)gen.mantissa() >> 8); + return (gen.exponent() << 24) | ((uint32_t)gen.mantissa() >> 8); } @@ -642,10 +642,10 @@ UINT32 tms3203x_device::float_to_fp(float fval) // a 32-bit DSP floating-point value //------------------------------------------------- -UINT32 tms3203x_device::double_to_fp(double dval) +uint32_t tms3203x_device::double_to_fp(double dval) { tmsreg gen(dval); - return (gen.exponent() << 24) | ((UINT32)gen.mantissa() >> 8); + return (gen.exponent() << 24) | ((uint32_t)gen.mantissa() >> 8); } @@ -662,7 +662,7 @@ UINT32 tms3203x_device::double_to_fp(double dval) void tms3203x_device::check_irqs() { // determine if we have any live interrupts - UINT16 validints = IREG(TMR_IF) & IREG(TMR_IE) & 0x0fff; + uint16_t validints = IREG(TMR_IF) & IREG(TMR_IE) & 0x0fff; if (validints == 0 || (IREG(TMR_ST) & GIEFLAG) == 0) return; @@ -679,7 +679,7 @@ void tms3203x_device::check_irqs() m_is_idling = false; if (!m_delayed) { - UINT16 intmask = 1 << (whichtrap - 1); + uint16_t intmask = 1 << (whichtrap - 1); // bit in IF is cleared when interrupt is taken IREG(TMR_IF) &= ~intmask; @@ -700,7 +700,7 @@ void tms3203x_device::check_irqs() // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 tms3203x_device::execute_min_cycles() const +uint32_t tms3203x_device::execute_min_cycles() const { return 1; } @@ -711,7 +711,7 @@ UINT32 tms3203x_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 tms3203x_device::execute_max_cycles() const +uint32_t tms3203x_device::execute_max_cycles() const { return 4; } @@ -722,7 +722,7 @@ UINT32 tms3203x_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 tms3203x_device::execute_input_lines() const +uint32_t tms3203x_device::execute_input_lines() const { return (m_chip_type == CHIP_TYPE_TMS32032) ? 13 : 12; } @@ -747,7 +747,7 @@ void tms3203x_device::execute_set_input(int inputnum, int state) } // update the external state - UINT16 intmask = 1 << inputnum; + uint16_t intmask = 1 << inputnum; if (state == ASSERT_LINE) { m_irq_state |= intmask; @@ -787,7 +787,7 @@ void tms3203x_device::execute_run() { if ((IREG(TMR_ST) & RMFLAG) && m_pc == IREG(TMR_RE) + 1) { - if ((INT32)--IREG(TMR_RC) >= 0) + if ((int32_t)--IREG(TMR_RC) >= 0) m_pc = IREG(TMR_RS); else { @@ -819,7 +819,7 @@ void tms3203x_device::execute_run() machine().debug_break(); if ((IREG(TMR_ST) & RMFLAG) && m_pc == IREG(TMR_RE) + 1) { - if ((INT32)--IREG(TMR_RC) >= 0) + if ((int32_t)--IREG(TMR_RC) >= 0) m_pc = IREG(TMR_RS); else { diff --git a/src/devices/cpu/tms32031/tms32031.h b/src/devices/cpu/tms32031/tms32031.h index d8fa5125c3d..4c554827cf4 100644 --- a/src/devices/cpu/tms32031/tms32031.h +++ b/src/devices/cpu/tms32031/tms32031.h @@ -116,14 +116,14 @@ class tms3203x_device : public cpu_device // constructors tmsreg() { i32[0] = i32[1] = 0; } tmsreg(double value) { from_double(value); } - tmsreg(INT32 mantissa, INT8 exponent) { set_mantissa(mantissa); set_exponent(exponent); } + tmsreg(int32_t mantissa, int8_t exponent) { set_mantissa(mantissa); set_exponent(exponent); } // getters - UINT32 integer() const { return i32[0]; } - INT32 mantissa() const { return i32[0]; } - INT8 exponent() const { return i32[1]; } - void set_mantissa(INT32 man) { i32[0] = man; } - void set_exponent(INT8 exp) { i32[1] = exp; } + uint32_t integer() const { return i32[0]; } + int32_t mantissa() const { return i32[0]; } + int8_t exponent() const { return i32[1]; } + void set_mantissa(int32_t man) { i32[0] = man; } + void set_exponent(int8_t exp) { i32[1] = exp; } // exporters float as_float() const; @@ -132,7 +132,7 @@ class tms3203x_device : public cpu_device // importers void from_double(double); - UINT32 i32[2]; + uint32_t i32[2]; }; protected: @@ -143,7 +143,7 @@ protected: }; // construction/destruction - tms3203x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype, address_map_constructor internal_map, const char *shortname, const char *source); + tms3203x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t chiptype, address_map_constructor internal_map, const char *shortname, const char *source); virtual ~tms3203x_device(); public: @@ -154,10 +154,10 @@ public: template static devcb_base &set_iack_callback(device_t &device, _Object object) { return downcast(device).m_iack_cb.set_callback(object); } // public interfaces - static float fp_to_float(UINT32 floatdata); - static double fp_to_double(UINT32 floatdata); - static UINT32 float_to_fp(float fval); - static UINT32 double_to_fp(double dval); + static float fp_to_float(uint32_t floatdata); + static double fp_to_double(uint32_t floatdata); + static uint32_t float_to_fp(float fval); + static uint32_t double_to_fp(double dval); protected: // device-level overrides @@ -167,9 +167,9 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -182,15 +182,15 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // memory helpers DECLARE_DIRECT_UPDATE_MEMBER(direct_handler); - UINT32 ROPCODE(offs_t pc); - UINT32 RMEM(offs_t addr); - void WMEM(offs_t addr, UINT32 data); + uint32_t ROPCODE(offs_t pc); + uint32_t RMEM(offs_t addr); + void WMEM(offs_t addr, uint32_t data); // misc helpers void check_irqs(); @@ -208,567 +208,567 @@ protected: void norm(tmsreg &dst, tmsreg &src); // memory addressing - UINT32 mod00_d(UINT32 op, UINT8 ar); - UINT32 mod01_d(UINT32 op, UINT8 ar); - UINT32 mod02_d(UINT32 op, UINT8 ar); - UINT32 mod03_d(UINT32 op, UINT8 ar); - UINT32 mod04_d(UINT32 op, UINT8 ar); - UINT32 mod05_d(UINT32 op, UINT8 ar); - UINT32 mod06_d(UINT32 op, UINT8 ar); - UINT32 mod07_d(UINT32 op, UINT8 ar); - - UINT32 mod00_1(UINT32 op, UINT8 ar); - UINT32 mod01_1(UINT32 op, UINT8 ar); - UINT32 mod02_1(UINT32 op, UINT8 ar); - UINT32 mod03_1(UINT32 op, UINT8 ar); - UINT32 mod04_1(UINT32 op, UINT8 ar); - UINT32 mod05_1(UINT32 op, UINT8 ar); - UINT32 mod06_1(UINT32 op, UINT8 ar); - UINT32 mod07_1(UINT32 op, UINT8 ar); - - UINT32 mod08(UINT32 op, UINT8 ar); - UINT32 mod09(UINT32 op, UINT8 ar); - UINT32 mod0a(UINT32 op, UINT8 ar); - UINT32 mod0b(UINT32 op, UINT8 ar); - UINT32 mod0c(UINT32 op, UINT8 ar); - UINT32 mod0d(UINT32 op, UINT8 ar); - UINT32 mod0e(UINT32 op, UINT8 ar); - UINT32 mod0f(UINT32 op, UINT8 ar); - - UINT32 mod10(UINT32 op, UINT8 ar); - UINT32 mod11(UINT32 op, UINT8 ar); - UINT32 mod12(UINT32 op, UINT8 ar); - UINT32 mod13(UINT32 op, UINT8 ar); - UINT32 mod14(UINT32 op, UINT8 ar); - UINT32 mod15(UINT32 op, UINT8 ar); - UINT32 mod16(UINT32 op, UINT8 ar); - UINT32 mod17(UINT32 op, UINT8 ar); - - UINT32 mod18(UINT32 op, UINT8 ar); - UINT32 mod19(UINT32 op, UINT8 ar); - UINT32 modillegal(UINT32 op, UINT8 ar); - - UINT32 mod00_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod01_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod02_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod03_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod04_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod05_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod06_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod07_1_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - - UINT32 mod08_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod09_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod0a_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod0b_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod0c_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod0d_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod0e_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod0f_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - - UINT32 mod10_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod11_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod12_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod13_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod14_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod15_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod16_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod17_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod18_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 mod19_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); - UINT32 modillegal_def(UINT32 op, UINT8 ar, UINT32 *&defptrptr); + uint32_t mod00_d(uint32_t op, uint8_t ar); + uint32_t mod01_d(uint32_t op, uint8_t ar); + uint32_t mod02_d(uint32_t op, uint8_t ar); + uint32_t mod03_d(uint32_t op, uint8_t ar); + uint32_t mod04_d(uint32_t op, uint8_t ar); + uint32_t mod05_d(uint32_t op, uint8_t ar); + uint32_t mod06_d(uint32_t op, uint8_t ar); + uint32_t mod07_d(uint32_t op, uint8_t ar); + + uint32_t mod00_1(uint32_t op, uint8_t ar); + uint32_t mod01_1(uint32_t op, uint8_t ar); + uint32_t mod02_1(uint32_t op, uint8_t ar); + uint32_t mod03_1(uint32_t op, uint8_t ar); + uint32_t mod04_1(uint32_t op, uint8_t ar); + uint32_t mod05_1(uint32_t op, uint8_t ar); + uint32_t mod06_1(uint32_t op, uint8_t ar); + uint32_t mod07_1(uint32_t op, uint8_t ar); + + uint32_t mod08(uint32_t op, uint8_t ar); + uint32_t mod09(uint32_t op, uint8_t ar); + uint32_t mod0a(uint32_t op, uint8_t ar); + uint32_t mod0b(uint32_t op, uint8_t ar); + uint32_t mod0c(uint32_t op, uint8_t ar); + uint32_t mod0d(uint32_t op, uint8_t ar); + uint32_t mod0e(uint32_t op, uint8_t ar); + uint32_t mod0f(uint32_t op, uint8_t ar); + + uint32_t mod10(uint32_t op, uint8_t ar); + uint32_t mod11(uint32_t op, uint8_t ar); + uint32_t mod12(uint32_t op, uint8_t ar); + uint32_t mod13(uint32_t op, uint8_t ar); + uint32_t mod14(uint32_t op, uint8_t ar); + uint32_t mod15(uint32_t op, uint8_t ar); + uint32_t mod16(uint32_t op, uint8_t ar); + uint32_t mod17(uint32_t op, uint8_t ar); + + uint32_t mod18(uint32_t op, uint8_t ar); + uint32_t mod19(uint32_t op, uint8_t ar); + uint32_t modillegal(uint32_t op, uint8_t ar); + + uint32_t mod00_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod01_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod02_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod03_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod04_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod05_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod06_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod07_1_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + + uint32_t mod08_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod09_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod0a_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod0b_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod0c_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod0d_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod0e_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod0f_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + + uint32_t mod10_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod11_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod12_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod13_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod14_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod15_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod16_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod17_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod18_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t mod19_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); + uint32_t modillegal_def(uint32_t op, uint8_t ar, uint32_t *&defptrptr); // instructions - void illegal(UINT32 op); - void unimplemented(UINT32 op); - - void absf_reg(UINT32 op); - void absf_dir(UINT32 op); - void absf_ind(UINT32 op); - void absf_imm(UINT32 op); - void absi_reg(UINT32 op); - void absi_dir(UINT32 op); - void absi_ind(UINT32 op); - void absi_imm(UINT32 op); - void addc_reg(UINT32 op); - void addc_dir(UINT32 op); - void addc_ind(UINT32 op); - void addc_imm(UINT32 op); - void addf_reg(UINT32 op); - void addf_dir(UINT32 op); - void addf_ind(UINT32 op); - void addf_imm(UINT32 op); - void addi_reg(UINT32 op); - void addi_dir(UINT32 op); - void addi_ind(UINT32 op); - void addi_imm(UINT32 op); - void and_reg(UINT32 op); - void and_dir(UINT32 op); - void and_ind(UINT32 op); - void and_imm(UINT32 op); - void andn_reg(UINT32 op); - void andn_dir(UINT32 op); - void andn_ind(UINT32 op); - void andn_imm(UINT32 op); - void ash_reg(UINT32 op); - void ash_dir(UINT32 op); - void ash_ind(UINT32 op); - void ash_imm(UINT32 op); - void cmpf_reg(UINT32 op); - void cmpf_dir(UINT32 op); - void cmpf_ind(UINT32 op); - void cmpf_imm(UINT32 op); - void cmpi_reg(UINT32 op); - void cmpi_dir(UINT32 op); - void cmpi_ind(UINT32 op); - void cmpi_imm(UINT32 op); - void fix_reg(UINT32 op); - void fix_dir(UINT32 op); - void fix_ind(UINT32 op); - void fix_imm(UINT32 op); - void float_reg(UINT32 op); - void float_dir(UINT32 op); - void float_ind(UINT32 op); - void float_imm(UINT32 op); - void idle(UINT32 op); - void lde_reg(UINT32 op); - void lde_dir(UINT32 op); - void lde_ind(UINT32 op); - void lde_imm(UINT32 op); - void ldf_reg(UINT32 op); - void ldf_dir(UINT32 op); - void ldf_ind(UINT32 op); - void ldf_imm(UINT32 op); - void ldfi_dir(UINT32 op); - void ldfi_ind(UINT32 op); - void ldi_reg(UINT32 op); - void ldi_dir(UINT32 op); - void ldi_ind(UINT32 op); - void ldi_imm(UINT32 op); - void ldii_dir(UINT32 op); - void ldii_ind(UINT32 op); - void ldm_reg(UINT32 op); - void ldm_dir(UINT32 op); - void ldm_ind(UINT32 op); - void ldm_imm(UINT32 op); - void lsh_reg(UINT32 op); - void lsh_dir(UINT32 op); - void lsh_ind(UINT32 op); - void lsh_imm(UINT32 op); - void mpyf_reg(UINT32 op); - void mpyf_dir(UINT32 op); - void mpyf_ind(UINT32 op); - void mpyf_imm(UINT32 op); - void mpyi_reg(UINT32 op); - void mpyi_dir(UINT32 op); - void mpyi_ind(UINT32 op); - void mpyi_imm(UINT32 op); - void negb_reg(UINT32 op); - void negb_dir(UINT32 op); - void negb_ind(UINT32 op); - void negb_imm(UINT32 op); - void negf_reg(UINT32 op); - void negf_dir(UINT32 op); - void negf_ind(UINT32 op); - void negf_imm(UINT32 op); - void negi_reg(UINT32 op); - void negi_dir(UINT32 op); - void negi_ind(UINT32 op); - void negi_imm(UINT32 op); - void nop_reg(UINT32 op); - void nop_ind(UINT32 op); - void norm_reg(UINT32 op); - void norm_dir(UINT32 op); - void norm_ind(UINT32 op); - void norm_imm(UINT32 op); - void not_reg(UINT32 op); - void not_dir(UINT32 op); - void not_ind(UINT32 op); - void not_imm(UINT32 op); - void pop(UINT32 op); - void popf(UINT32 op); - void push(UINT32 op); - void pushf(UINT32 op); - void or_reg(UINT32 op); - void or_dir(UINT32 op); - void or_ind(UINT32 op); - void or_imm(UINT32 op); - void maxspeed(UINT32 op); - void rnd_reg(UINT32 op); - void rnd_dir(UINT32 op); - void rnd_ind(UINT32 op); - void rnd_imm(UINT32 op); - void rol(UINT32 op); - void rolc(UINT32 op); - void ror(UINT32 op); - void rorc(UINT32 op); - void rtps_reg(UINT32 op); - void rtps_dir(UINT32 op); - void rtps_ind(UINT32 op); - void rtps_imm(UINT32 op); - void stf_dir(UINT32 op); - void stf_ind(UINT32 op); - void stfi_dir(UINT32 op); - void stfi_ind(UINT32 op); - void sti_dir(UINT32 op); - void sti_ind(UINT32 op); - void stii_dir(UINT32 op); - void stii_ind(UINT32 op); - void sigi(UINT32 op); - void subb_reg(UINT32 op); - void subb_dir(UINT32 op); - void subb_ind(UINT32 op); - void subb_imm(UINT32 op); - void subc_reg(UINT32 op); - void subc_dir(UINT32 op); - void subc_ind(UINT32 op); - void subc_imm(UINT32 op); - void subf_reg(UINT32 op); - void subf_dir(UINT32 op); - void subf_ind(UINT32 op); - void subf_imm(UINT32 op); - void subi_reg(UINT32 op); - void subi_dir(UINT32 op); - void subi_ind(UINT32 op); - void subi_imm(UINT32 op); - void subrb_reg(UINT32 op); - void subrb_dir(UINT32 op); - void subrb_ind(UINT32 op); - void subrb_imm(UINT32 op); - void subrf_reg(UINT32 op); - void subrf_dir(UINT32 op); - void subrf_ind(UINT32 op); - void subrf_imm(UINT32 op); - void subri_reg(UINT32 op); - void subri_dir(UINT32 op); - void subri_ind(UINT32 op); - void subri_imm(UINT32 op); - void tstb_reg(UINT32 op); - void tstb_dir(UINT32 op); - void tstb_ind(UINT32 op); - void tstb_imm(UINT32 op); - void xor_reg(UINT32 op); - void xor_dir(UINT32 op); - void xor_ind(UINT32 op); - void xor_imm(UINT32 op); - void iack_dir(UINT32 op); - void iack_ind(UINT32 op); - void addc3_regreg(UINT32 op); - void addc3_indreg(UINT32 op); - void addc3_regind(UINT32 op); - void addc3_indind(UINT32 op); - void addf3_regreg(UINT32 op); - void addf3_indreg(UINT32 op); - void addf3_regind(UINT32 op); - void addf3_indind(UINT32 op); - void addi3_regreg(UINT32 op); - void addi3_indreg(UINT32 op); - void addi3_regind(UINT32 op); - void addi3_indind(UINT32 op); - void and3_regreg(UINT32 op); - void and3_indreg(UINT32 op); - void and3_regind(UINT32 op); - void and3_indind(UINT32 op); - void andn3_regreg(UINT32 op); - void andn3_indreg(UINT32 op); - void andn3_regind(UINT32 op); - void andn3_indind(UINT32 op); - void ash3_regreg(UINT32 op); - void ash3_indreg(UINT32 op); - void ash3_regind(UINT32 op); - void ash3_indind(UINT32 op); - void cmpf3_regreg(UINT32 op); - void cmpf3_indreg(UINT32 op); - void cmpf3_regind(UINT32 op); - void cmpf3_indind(UINT32 op); - void cmpi3_regreg(UINT32 op); - void cmpi3_indreg(UINT32 op); - void cmpi3_regind(UINT32 op); - void cmpi3_indind(UINT32 op); - void lsh3_regreg(UINT32 op); - void lsh3_indreg(UINT32 op); - void lsh3_regind(UINT32 op); - void lsh3_indind(UINT32 op); - void mpyf3_regreg(UINT32 op); - void mpyf3_indreg(UINT32 op); - void mpyf3_regind(UINT32 op); - void mpyf3_indind(UINT32 op); - void mpyi3_regreg(UINT32 op); - void mpyi3_indreg(UINT32 op); - void mpyi3_regind(UINT32 op); - void mpyi3_indind(UINT32 op); - void or3_regreg(UINT32 op); - void or3_indreg(UINT32 op); - void or3_regind(UINT32 op); - void or3_indind(UINT32 op); - void subb3_regreg(UINT32 op); - void subb3_indreg(UINT32 op); - void subb3_regind(UINT32 op); - void subb3_indind(UINT32 op); - void subf3_regreg(UINT32 op); - void subf3_indreg(UINT32 op); - void subf3_regind(UINT32 op); - void subf3_indind(UINT32 op); - void subi3_regreg(UINT32 op); - void subi3_indreg(UINT32 op); - void subi3_regind(UINT32 op); - void subi3_indind(UINT32 op); - void tstb3_regreg(UINT32 op); - void tstb3_indreg(UINT32 op); - void tstb3_regind(UINT32 op); - void tstb3_indind(UINT32 op); - void xor3_regreg(UINT32 op); - void xor3_indreg(UINT32 op); - void xor3_regind(UINT32 op); - void xor3_indind(UINT32 op); - void ldfu_reg(UINT32 op); - void ldfu_dir(UINT32 op); - void ldfu_ind(UINT32 op); - void ldfu_imm(UINT32 op); - void ldflo_reg(UINT32 op); - void ldflo_dir(UINT32 op); - void ldflo_ind(UINT32 op); - void ldflo_imm(UINT32 op); - void ldfls_reg(UINT32 op); - void ldfls_dir(UINT32 op); - void ldfls_ind(UINT32 op); - void ldfls_imm(UINT32 op); - void ldfhi_reg(UINT32 op); - void ldfhi_dir(UINT32 op); - void ldfhi_ind(UINT32 op); - void ldfhi_imm(UINT32 op); - void ldfhs_reg(UINT32 op); - void ldfhs_dir(UINT32 op); - void ldfhs_ind(UINT32 op); - void ldfhs_imm(UINT32 op); - void ldfeq_reg(UINT32 op); - void ldfeq_dir(UINT32 op); - void ldfeq_ind(UINT32 op); - void ldfeq_imm(UINT32 op); - void ldfne_reg(UINT32 op); - void ldfne_dir(UINT32 op); - void ldfne_ind(UINT32 op); - void ldfne_imm(UINT32 op); - void ldflt_reg(UINT32 op); - void ldflt_dir(UINT32 op); - void ldflt_ind(UINT32 op); - void ldflt_imm(UINT32 op); - void ldfle_reg(UINT32 op); - void ldfle_dir(UINT32 op); - void ldfle_ind(UINT32 op); - void ldfle_imm(UINT32 op); - void ldfgt_reg(UINT32 op); - void ldfgt_dir(UINT32 op); - void ldfgt_ind(UINT32 op); - void ldfgt_imm(UINT32 op); - void ldfge_reg(UINT32 op); - void ldfge_dir(UINT32 op); - void ldfge_ind(UINT32 op); - void ldfge_imm(UINT32 op); - void ldfnv_reg(UINT32 op); - void ldfnv_dir(UINT32 op); - void ldfnv_ind(UINT32 op); - void ldfnv_imm(UINT32 op); - void ldfv_reg(UINT32 op); - void ldfv_dir(UINT32 op); - void ldfv_ind(UINT32 op); - void ldfv_imm(UINT32 op); - void ldfnuf_reg(UINT32 op); - void ldfnuf_dir(UINT32 op); - void ldfnuf_ind(UINT32 op); - void ldfnuf_imm(UINT32 op); - void ldfuf_reg(UINT32 op); - void ldfuf_dir(UINT32 op); - void ldfuf_ind(UINT32 op); - void ldfuf_imm(UINT32 op); - void ldfnlv_reg(UINT32 op); - void ldfnlv_dir(UINT32 op); - void ldfnlv_ind(UINT32 op); - void ldfnlv_imm(UINT32 op); - void ldflv_reg(UINT32 op); - void ldflv_dir(UINT32 op); - void ldflv_ind(UINT32 op); - void ldflv_imm(UINT32 op); - void ldfnluf_reg(UINT32 op); - void ldfnluf_dir(UINT32 op); - void ldfnluf_ind(UINT32 op); - void ldfnluf_imm(UINT32 op); - void ldfluf_reg(UINT32 op); - void ldfluf_dir(UINT32 op); - void ldfluf_ind(UINT32 op); - void ldfluf_imm(UINT32 op); - void ldfzuf_reg(UINT32 op); - void ldfzuf_dir(UINT32 op); - void ldfzuf_ind(UINT32 op); - void ldfzuf_imm(UINT32 op); - void ldiu_reg(UINT32 op); - void ldiu_dir(UINT32 op); - void ldiu_ind(UINT32 op); - void ldiu_imm(UINT32 op); - void ldilo_reg(UINT32 op); - void ldilo_dir(UINT32 op); - void ldilo_ind(UINT32 op); - void ldilo_imm(UINT32 op); - void ldils_reg(UINT32 op); - void ldils_dir(UINT32 op); - void ldils_ind(UINT32 op); - void ldils_imm(UINT32 op); - void ldihi_reg(UINT32 op); - void ldihi_dir(UINT32 op); - void ldihi_ind(UINT32 op); - void ldihi_imm(UINT32 op); - void ldihs_reg(UINT32 op); - void ldihs_dir(UINT32 op); - void ldihs_ind(UINT32 op); - void ldihs_imm(UINT32 op); - void ldieq_reg(UINT32 op); - void ldieq_dir(UINT32 op); - void ldieq_ind(UINT32 op); - void ldieq_imm(UINT32 op); - void ldine_reg(UINT32 op); - void ldine_dir(UINT32 op); - void ldine_ind(UINT32 op); - void ldine_imm(UINT32 op); - void ldilt_reg(UINT32 op); - void ldilt_dir(UINT32 op); - void ldilt_ind(UINT32 op); - void ldilt_imm(UINT32 op); - void ldile_reg(UINT32 op); - void ldile_dir(UINT32 op); - void ldile_ind(UINT32 op); - void ldile_imm(UINT32 op); - void ldigt_reg(UINT32 op); - void ldigt_dir(UINT32 op); - void ldigt_ind(UINT32 op); - void ldigt_imm(UINT32 op); - void ldige_reg(UINT32 op); - void ldige_dir(UINT32 op); - void ldige_ind(UINT32 op); - void ldige_imm(UINT32 op); - void ldinv_reg(UINT32 op); - void ldinv_dir(UINT32 op); - void ldinv_ind(UINT32 op); - void ldinv_imm(UINT32 op); - void ldiuf_reg(UINT32 op); - void ldiuf_dir(UINT32 op); - void ldiuf_ind(UINT32 op); - void ldiuf_imm(UINT32 op); - void ldinuf_reg(UINT32 op); - void ldinuf_dir(UINT32 op); - void ldinuf_ind(UINT32 op); - void ldinuf_imm(UINT32 op); - void ldiv_reg(UINT32 op); - void ldiv_dir(UINT32 op); - void ldiv_ind(UINT32 op); - void ldiv_imm(UINT32 op); - void ldinlv_reg(UINT32 op); - void ldinlv_dir(UINT32 op); - void ldinlv_ind(UINT32 op); - void ldinlv_imm(UINT32 op); - void ldilv_reg(UINT32 op); - void ldilv_dir(UINT32 op); - void ldilv_ind(UINT32 op); - void ldilv_imm(UINT32 op); - void ldinluf_reg(UINT32 op); - void ldinluf_dir(UINT32 op); - void ldinluf_ind(UINT32 op); - void ldinluf_imm(UINT32 op); - void ldiluf_reg(UINT32 op); - void ldiluf_dir(UINT32 op); - void ldiluf_ind(UINT32 op); - void ldiluf_imm(UINT32 op); - void ldizuf_reg(UINT32 op); - void ldizuf_dir(UINT32 op); - void ldizuf_ind(UINT32 op); - void ldizuf_imm(UINT32 op); - void execute_delayed(UINT32 newpc); - void br_imm(UINT32 op); - void brd_imm(UINT32 op); - void call_imm(UINT32 op); - void rptb_imm(UINT32 op); - void swi(UINT32 op); - void brc_reg(UINT32 op); - void brcd_reg(UINT32 op); - void brc_imm(UINT32 op); - void brcd_imm(UINT32 op); - void dbc_reg(UINT32 op); - void dbcd_reg(UINT32 op); - void dbc_imm(UINT32 op); - void dbcd_imm(UINT32 op); - void callc_reg(UINT32 op); - void callc_imm(UINT32 op); + void illegal(uint32_t op); + void unimplemented(uint32_t op); + + void absf_reg(uint32_t op); + void absf_dir(uint32_t op); + void absf_ind(uint32_t op); + void absf_imm(uint32_t op); + void absi_reg(uint32_t op); + void absi_dir(uint32_t op); + void absi_ind(uint32_t op); + void absi_imm(uint32_t op); + void addc_reg(uint32_t op); + void addc_dir(uint32_t op); + void addc_ind(uint32_t op); + void addc_imm(uint32_t op); + void addf_reg(uint32_t op); + void addf_dir(uint32_t op); + void addf_ind(uint32_t op); + void addf_imm(uint32_t op); + void addi_reg(uint32_t op); + void addi_dir(uint32_t op); + void addi_ind(uint32_t op); + void addi_imm(uint32_t op); + void and_reg(uint32_t op); + void and_dir(uint32_t op); + void and_ind(uint32_t op); + void and_imm(uint32_t op); + void andn_reg(uint32_t op); + void andn_dir(uint32_t op); + void andn_ind(uint32_t op); + void andn_imm(uint32_t op); + void ash_reg(uint32_t op); + void ash_dir(uint32_t op); + void ash_ind(uint32_t op); + void ash_imm(uint32_t op); + void cmpf_reg(uint32_t op); + void cmpf_dir(uint32_t op); + void cmpf_ind(uint32_t op); + void cmpf_imm(uint32_t op); + void cmpi_reg(uint32_t op); + void cmpi_dir(uint32_t op); + void cmpi_ind(uint32_t op); + void cmpi_imm(uint32_t op); + void fix_reg(uint32_t op); + void fix_dir(uint32_t op); + void fix_ind(uint32_t op); + void fix_imm(uint32_t op); + void float_reg(uint32_t op); + void float_dir(uint32_t op); + void float_ind(uint32_t op); + void float_imm(uint32_t op); + void idle(uint32_t op); + void lde_reg(uint32_t op); + void lde_dir(uint32_t op); + void lde_ind(uint32_t op); + void lde_imm(uint32_t op); + void ldf_reg(uint32_t op); + void ldf_dir(uint32_t op); + void ldf_ind(uint32_t op); + void ldf_imm(uint32_t op); + void ldfi_dir(uint32_t op); + void ldfi_ind(uint32_t op); + void ldi_reg(uint32_t op); + void ldi_dir(uint32_t op); + void ldi_ind(uint32_t op); + void ldi_imm(uint32_t op); + void ldii_dir(uint32_t op); + void ldii_ind(uint32_t op); + void ldm_reg(uint32_t op); + void ldm_dir(uint32_t op); + void ldm_ind(uint32_t op); + void ldm_imm(uint32_t op); + void lsh_reg(uint32_t op); + void lsh_dir(uint32_t op); + void lsh_ind(uint32_t op); + void lsh_imm(uint32_t op); + void mpyf_reg(uint32_t op); + void mpyf_dir(uint32_t op); + void mpyf_ind(uint32_t op); + void mpyf_imm(uint32_t op); + void mpyi_reg(uint32_t op); + void mpyi_dir(uint32_t op); + void mpyi_ind(uint32_t op); + void mpyi_imm(uint32_t op); + void negb_reg(uint32_t op); + void negb_dir(uint32_t op); + void negb_ind(uint32_t op); + void negb_imm(uint32_t op); + void negf_reg(uint32_t op); + void negf_dir(uint32_t op); + void negf_ind(uint32_t op); + void negf_imm(uint32_t op); + void negi_reg(uint32_t op); + void negi_dir(uint32_t op); + void negi_ind(uint32_t op); + void negi_imm(uint32_t op); + void nop_reg(uint32_t op); + void nop_ind(uint32_t op); + void norm_reg(uint32_t op); + void norm_dir(uint32_t op); + void norm_ind(uint32_t op); + void norm_imm(uint32_t op); + void not_reg(uint32_t op); + void not_dir(uint32_t op); + void not_ind(uint32_t op); + void not_imm(uint32_t op); + void pop(uint32_t op); + void popf(uint32_t op); + void push(uint32_t op); + void pushf(uint32_t op); + void or_reg(uint32_t op); + void or_dir(uint32_t op); + void or_ind(uint32_t op); + void or_imm(uint32_t op); + void maxspeed(uint32_t op); + void rnd_reg(uint32_t op); + void rnd_dir(uint32_t op); + void rnd_ind(uint32_t op); + void rnd_imm(uint32_t op); + void rol(uint32_t op); + void rolc(uint32_t op); + void ror(uint32_t op); + void rorc(uint32_t op); + void rtps_reg(uint32_t op); + void rtps_dir(uint32_t op); + void rtps_ind(uint32_t op); + void rtps_imm(uint32_t op); + void stf_dir(uint32_t op); + void stf_ind(uint32_t op); + void stfi_dir(uint32_t op); + void stfi_ind(uint32_t op); + void sti_dir(uint32_t op); + void sti_ind(uint32_t op); + void stii_dir(uint32_t op); + void stii_ind(uint32_t op); + void sigi(uint32_t op); + void subb_reg(uint32_t op); + void subb_dir(uint32_t op); + void subb_ind(uint32_t op); + void subb_imm(uint32_t op); + void subc_reg(uint32_t op); + void subc_dir(uint32_t op); + void subc_ind(uint32_t op); + void subc_imm(uint32_t op); + void subf_reg(uint32_t op); + void subf_dir(uint32_t op); + void subf_ind(uint32_t op); + void subf_imm(uint32_t op); + void subi_reg(uint32_t op); + void subi_dir(uint32_t op); + void subi_ind(uint32_t op); + void subi_imm(uint32_t op); + void subrb_reg(uint32_t op); + void subrb_dir(uint32_t op); + void subrb_ind(uint32_t op); + void subrb_imm(uint32_t op); + void subrf_reg(uint32_t op); + void subrf_dir(uint32_t op); + void subrf_ind(uint32_t op); + void subrf_imm(uint32_t op); + void subri_reg(uint32_t op); + void subri_dir(uint32_t op); + void subri_ind(uint32_t op); + void subri_imm(uint32_t op); + void tstb_reg(uint32_t op); + void tstb_dir(uint32_t op); + void tstb_ind(uint32_t op); + void tstb_imm(uint32_t op); + void xor_reg(uint32_t op); + void xor_dir(uint32_t op); + void xor_ind(uint32_t op); + void xor_imm(uint32_t op); + void iack_dir(uint32_t op); + void iack_ind(uint32_t op); + void addc3_regreg(uint32_t op); + void addc3_indreg(uint32_t op); + void addc3_regind(uint32_t op); + void addc3_indind(uint32_t op); + void addf3_regreg(uint32_t op); + void addf3_indreg(uint32_t op); + void addf3_regind(uint32_t op); + void addf3_indind(uint32_t op); + void addi3_regreg(uint32_t op); + void addi3_indreg(uint32_t op); + void addi3_regind(uint32_t op); + void addi3_indind(uint32_t op); + void and3_regreg(uint32_t op); + void and3_indreg(uint32_t op); + void and3_regind(uint32_t op); + void and3_indind(uint32_t op); + void andn3_regreg(uint32_t op); + void andn3_indreg(uint32_t op); + void andn3_regind(uint32_t op); + void andn3_indind(uint32_t op); + void ash3_regreg(uint32_t op); + void ash3_indreg(uint32_t op); + void ash3_regind(uint32_t op); + void ash3_indind(uint32_t op); + void cmpf3_regreg(uint32_t op); + void cmpf3_indreg(uint32_t op); + void cmpf3_regind(uint32_t op); + void cmpf3_indind(uint32_t op); + void cmpi3_regreg(uint32_t op); + void cmpi3_indreg(uint32_t op); + void cmpi3_regind(uint32_t op); + void cmpi3_indind(uint32_t op); + void lsh3_regreg(uint32_t op); + void lsh3_indreg(uint32_t op); + void lsh3_regind(uint32_t op); + void lsh3_indind(uint32_t op); + void mpyf3_regreg(uint32_t op); + void mpyf3_indreg(uint32_t op); + void mpyf3_regind(uint32_t op); + void mpyf3_indind(uint32_t op); + void mpyi3_regreg(uint32_t op); + void mpyi3_indreg(uint32_t op); + void mpyi3_regind(uint32_t op); + void mpyi3_indind(uint32_t op); + void or3_regreg(uint32_t op); + void or3_indreg(uint32_t op); + void or3_regind(uint32_t op); + void or3_indind(uint32_t op); + void subb3_regreg(uint32_t op); + void subb3_indreg(uint32_t op); + void subb3_regind(uint32_t op); + void subb3_indind(uint32_t op); + void subf3_regreg(uint32_t op); + void subf3_indreg(uint32_t op); + void subf3_regind(uint32_t op); + void subf3_indind(uint32_t op); + void subi3_regreg(uint32_t op); + void subi3_indreg(uint32_t op); + void subi3_regind(uint32_t op); + void subi3_indind(uint32_t op); + void tstb3_regreg(uint32_t op); + void tstb3_indreg(uint32_t op); + void tstb3_regind(uint32_t op); + void tstb3_indind(uint32_t op); + void xor3_regreg(uint32_t op); + void xor3_indreg(uint32_t op); + void xor3_regind(uint32_t op); + void xor3_indind(uint32_t op); + void ldfu_reg(uint32_t op); + void ldfu_dir(uint32_t op); + void ldfu_ind(uint32_t op); + void ldfu_imm(uint32_t op); + void ldflo_reg(uint32_t op); + void ldflo_dir(uint32_t op); + void ldflo_ind(uint32_t op); + void ldflo_imm(uint32_t op); + void ldfls_reg(uint32_t op); + void ldfls_dir(uint32_t op); + void ldfls_ind(uint32_t op); + void ldfls_imm(uint32_t op); + void ldfhi_reg(uint32_t op); + void ldfhi_dir(uint32_t op); + void ldfhi_ind(uint32_t op); + void ldfhi_imm(uint32_t op); + void ldfhs_reg(uint32_t op); + void ldfhs_dir(uint32_t op); + void ldfhs_ind(uint32_t op); + void ldfhs_imm(uint32_t op); + void ldfeq_reg(uint32_t op); + void ldfeq_dir(uint32_t op); + void ldfeq_ind(uint32_t op); + void ldfeq_imm(uint32_t op); + void ldfne_reg(uint32_t op); + void ldfne_dir(uint32_t op); + void ldfne_ind(uint32_t op); + void ldfne_imm(uint32_t op); + void ldflt_reg(uint32_t op); + void ldflt_dir(uint32_t op); + void ldflt_ind(uint32_t op); + void ldflt_imm(uint32_t op); + void ldfle_reg(uint32_t op); + void ldfle_dir(uint32_t op); + void ldfle_ind(uint32_t op); + void ldfle_imm(uint32_t op); + void ldfgt_reg(uint32_t op); + void ldfgt_dir(uint32_t op); + void ldfgt_ind(uint32_t op); + void ldfgt_imm(uint32_t op); + void ldfge_reg(uint32_t op); + void ldfge_dir(uint32_t op); + void ldfge_ind(uint32_t op); + void ldfge_imm(uint32_t op); + void ldfnv_reg(uint32_t op); + void ldfnv_dir(uint32_t op); + void ldfnv_ind(uint32_t op); + void ldfnv_imm(uint32_t op); + void ldfv_reg(uint32_t op); + void ldfv_dir(uint32_t op); + void ldfv_ind(uint32_t op); + void ldfv_imm(uint32_t op); + void ldfnuf_reg(uint32_t op); + void ldfnuf_dir(uint32_t op); + void ldfnuf_ind(uint32_t op); + void ldfnuf_imm(uint32_t op); + void ldfuf_reg(uint32_t op); + void ldfuf_dir(uint32_t op); + void ldfuf_ind(uint32_t op); + void ldfuf_imm(uint32_t op); + void ldfnlv_reg(uint32_t op); + void ldfnlv_dir(uint32_t op); + void ldfnlv_ind(uint32_t op); + void ldfnlv_imm(uint32_t op); + void ldflv_reg(uint32_t op); + void ldflv_dir(uint32_t op); + void ldflv_ind(uint32_t op); + void ldflv_imm(uint32_t op); + void ldfnluf_reg(uint32_t op); + void ldfnluf_dir(uint32_t op); + void ldfnluf_ind(uint32_t op); + void ldfnluf_imm(uint32_t op); + void ldfluf_reg(uint32_t op); + void ldfluf_dir(uint32_t op); + void ldfluf_ind(uint32_t op); + void ldfluf_imm(uint32_t op); + void ldfzuf_reg(uint32_t op); + void ldfzuf_dir(uint32_t op); + void ldfzuf_ind(uint32_t op); + void ldfzuf_imm(uint32_t op); + void ldiu_reg(uint32_t op); + void ldiu_dir(uint32_t op); + void ldiu_ind(uint32_t op); + void ldiu_imm(uint32_t op); + void ldilo_reg(uint32_t op); + void ldilo_dir(uint32_t op); + void ldilo_ind(uint32_t op); + void ldilo_imm(uint32_t op); + void ldils_reg(uint32_t op); + void ldils_dir(uint32_t op); + void ldils_ind(uint32_t op); + void ldils_imm(uint32_t op); + void ldihi_reg(uint32_t op); + void ldihi_dir(uint32_t op); + void ldihi_ind(uint32_t op); + void ldihi_imm(uint32_t op); + void ldihs_reg(uint32_t op); + void ldihs_dir(uint32_t op); + void ldihs_ind(uint32_t op); + void ldihs_imm(uint32_t op); + void ldieq_reg(uint32_t op); + void ldieq_dir(uint32_t op); + void ldieq_ind(uint32_t op); + void ldieq_imm(uint32_t op); + void ldine_reg(uint32_t op); + void ldine_dir(uint32_t op); + void ldine_ind(uint32_t op); + void ldine_imm(uint32_t op); + void ldilt_reg(uint32_t op); + void ldilt_dir(uint32_t op); + void ldilt_ind(uint32_t op); + void ldilt_imm(uint32_t op); + void ldile_reg(uint32_t op); + void ldile_dir(uint32_t op); + void ldile_ind(uint32_t op); + void ldile_imm(uint32_t op); + void ldigt_reg(uint32_t op); + void ldigt_dir(uint32_t op); + void ldigt_ind(uint32_t op); + void ldigt_imm(uint32_t op); + void ldige_reg(uint32_t op); + void ldige_dir(uint32_t op); + void ldige_ind(uint32_t op); + void ldige_imm(uint32_t op); + void ldinv_reg(uint32_t op); + void ldinv_dir(uint32_t op); + void ldinv_ind(uint32_t op); + void ldinv_imm(uint32_t op); + void ldiuf_reg(uint32_t op); + void ldiuf_dir(uint32_t op); + void ldiuf_ind(uint32_t op); + void ldiuf_imm(uint32_t op); + void ldinuf_reg(uint32_t op); + void ldinuf_dir(uint32_t op); + void ldinuf_ind(uint32_t op); + void ldinuf_imm(uint32_t op); + void ldiv_reg(uint32_t op); + void ldiv_dir(uint32_t op); + void ldiv_ind(uint32_t op); + void ldiv_imm(uint32_t op); + void ldinlv_reg(uint32_t op); + void ldinlv_dir(uint32_t op); + void ldinlv_ind(uint32_t op); + void ldinlv_imm(uint32_t op); + void ldilv_reg(uint32_t op); + void ldilv_dir(uint32_t op); + void ldilv_ind(uint32_t op); + void ldilv_imm(uint32_t op); + void ldinluf_reg(uint32_t op); + void ldinluf_dir(uint32_t op); + void ldinluf_ind(uint32_t op); + void ldinluf_imm(uint32_t op); + void ldiluf_reg(uint32_t op); + void ldiluf_dir(uint32_t op); + void ldiluf_ind(uint32_t op); + void ldiluf_imm(uint32_t op); + void ldizuf_reg(uint32_t op); + void ldizuf_dir(uint32_t op); + void ldizuf_ind(uint32_t op); + void ldizuf_imm(uint32_t op); + void execute_delayed(uint32_t newpc); + void br_imm(uint32_t op); + void brd_imm(uint32_t op); + void call_imm(uint32_t op); + void rptb_imm(uint32_t op); + void swi(uint32_t op); + void brc_reg(uint32_t op); + void brcd_reg(uint32_t op); + void brc_imm(uint32_t op); + void brcd_imm(uint32_t op); + void dbc_reg(uint32_t op); + void dbcd_reg(uint32_t op); + void dbc_imm(uint32_t op); + void dbcd_imm(uint32_t op); + void callc_reg(uint32_t op); + void callc_imm(uint32_t op); void trap(int trapnum); - void trapc(UINT32 op); - void retic_reg(UINT32 op); - void retsc_reg(UINT32 op); - void mpyaddf_0(UINT32 op); - void mpyaddf_1(UINT32 op); - void mpyaddf_2(UINT32 op); - void mpyaddf_3(UINT32 op); - void mpysubf_0(UINT32 op); - void mpysubf_1(UINT32 op); - void mpysubf_2(UINT32 op); - void mpysubf_3(UINT32 op); - void mpyaddi_0(UINT32 op); - void mpyaddi_1(UINT32 op); - void mpyaddi_2(UINT32 op); - void mpyaddi_3(UINT32 op); - void mpysubi_0(UINT32 op); - void mpysubi_1(UINT32 op); - void mpysubi_2(UINT32 op); - void mpysubi_3(UINT32 op); - void stfstf(UINT32 op); - void stisti(UINT32 op); - void ldfldf(UINT32 op); - void ldildi(UINT32 op); - void absfstf(UINT32 op); - void absisti(UINT32 op); - void addf3stf(UINT32 op); - void addi3sti(UINT32 op); - void and3sti(UINT32 op); - void ash3sti(UINT32 op); - void fixsti(UINT32 op); - void floatstf(UINT32 op); - void ldfstf(UINT32 op); - void ldisti(UINT32 op); - void lsh3sti(UINT32 op); - void mpyf3stf(UINT32 op); - void mpyi3sti(UINT32 op); - void negfstf(UINT32 op); - void negisti(UINT32 op); - void notsti(UINT32 op); - void or3sti(UINT32 op); - void subf3stf(UINT32 op); - void subi3sti(UINT32 op); - void xor3sti(UINT32 op); + void trapc(uint32_t op); + void retic_reg(uint32_t op); + void retsc_reg(uint32_t op); + void mpyaddf_0(uint32_t op); + void mpyaddf_1(uint32_t op); + void mpyaddf_2(uint32_t op); + void mpyaddf_3(uint32_t op); + void mpysubf_0(uint32_t op); + void mpysubf_1(uint32_t op); + void mpysubf_2(uint32_t op); + void mpysubf_3(uint32_t op); + void mpyaddi_0(uint32_t op); + void mpyaddi_1(uint32_t op); + void mpyaddi_2(uint32_t op); + void mpyaddi_3(uint32_t op); + void mpysubi_0(uint32_t op); + void mpysubi_1(uint32_t op); + void mpysubi_2(uint32_t op); + void mpysubi_3(uint32_t op); + void stfstf(uint32_t op); + void stisti(uint32_t op); + void ldfldf(uint32_t op); + void ldildi(uint32_t op); + void absfstf(uint32_t op); + void absisti(uint32_t op); + void addf3stf(uint32_t op); + void addi3sti(uint32_t op); + void and3sti(uint32_t op); + void ash3sti(uint32_t op); + void fixsti(uint32_t op); + void floatstf(uint32_t op); + void ldfstf(uint32_t op); + void ldisti(uint32_t op); + void lsh3sti(uint32_t op); + void mpyf3stf(uint32_t op); + void mpyi3sti(uint32_t op); + void negfstf(uint32_t op); + void negisti(uint32_t op); + void notsti(uint32_t op); + void or3sti(uint32_t op); + void subf3stf(uint32_t op); + void subi3sti(uint32_t op); + void xor3sti(uint32_t op); // configuration const address_space_config m_program_config; - UINT32 m_chip_type; + uint32_t m_chip_type; union int_double { double d; float f[2]; - UINT32 i[2]; + uint32_t i[2]; }; // core registers - UINT32 m_pc; + uint32_t m_pc; tmsreg m_r[36]; - UINT32 m_bkmask; + uint32_t m_bkmask; // internal stuff - UINT16 m_irq_state; + uint16_t m_irq_state; bool m_delayed; bool m_irq_pending; bool m_is_idling; int m_icount; - UINT32 m_iotemp; + uint32_t m_iotemp; address_space * m_program; direct_read_data * m_direct; - UINT32 * m_bootrom; + uint32_t * m_bootrom; bool m_mcbl_mode; devcb_write8 m_xf0_cb; @@ -776,13 +776,13 @@ protected: devcb_write8 m_iack_cb; // tables - static void (tms3203x_device::*const s_tms32031ops[])(UINT32 op); - static UINT32 (tms3203x_device::*const s_indirect_d[0x20])(UINT32, UINT8); - static UINT32 (tms3203x_device::*const s_indirect_1[0x20])(UINT32, UINT8); - static UINT32 (tms3203x_device::*const s_indirect_1_def[0x20])(UINT32, UINT8, UINT32 *&); + static void (tms3203x_device::*const s_tms32031ops[])(uint32_t op); + static uint32_t (tms3203x_device::*const s_indirect_d[0x20])(uint32_t, uint8_t); + static uint32_t (tms3203x_device::*const s_indirect_1[0x20])(uint32_t, uint8_t); + static uint32_t (tms3203x_device::*const s_indirect_1_def[0x20])(uint32_t, uint8_t, uint32_t *&); #if (TMS_3203X_LOG_OPCODE_USAGE) - UINT32 m_hits[0x200*4]; + uint32_t m_hits[0x200*4]; #endif }; @@ -793,7 +793,7 @@ class tms32031_device : public tms3203x_device { public: // construction/destruction - tms32031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms32031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -803,7 +803,7 @@ class tms32032_device : public tms3203x_device { public: // construction/destruction - tms32032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms32032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/tms32051/32051ops.hxx b/src/devices/cpu/tms32051/32051ops.hxx index 83e769416a1..e74fa06f1be 100644 --- a/src/devices/cpu/tms32051/32051ops.hxx +++ b/src/devices/cpu/tms32051/32051ops.hxx @@ -1,23 +1,23 @@ // license:BSD-3-Clause // copyright-holders:Ville Linde // stack is LIFO and is 8 levels deep, there is no stackpointer on the real chip -void tms32051_device::PUSH_STACK(UINT16 pc) +void tms32051_device::PUSH_STACK(uint16_t pc) { m_pcstack_ptr = (m_pcstack_ptr - 1) & 7; m_pcstack[m_pcstack_ptr] = pc; } -UINT16 tms32051_device::POP_STACK() +uint16_t tms32051_device::POP_STACK() { - UINT16 pc = m_pcstack[m_pcstack_ptr]; + uint16_t pc = m_pcstack[m_pcstack_ptr]; m_pcstack_ptr = (m_pcstack_ptr + 1) & 7; m_pcstack[(m_pcstack_ptr + 7) & 7] = m_pcstack[(m_pcstack_ptr + 6) & 7]; return pc; } -INT32 tms32051_device::SUB(UINT32 a, UINT32 b, bool shift16) +int32_t tms32051_device::SUB(uint32_t a, uint32_t b, bool shift16) { - UINT32 res = a - b; + uint32_t res = a - b; if (shift16) { @@ -35,19 +35,19 @@ INT32 tms32051_device::SUB(UINT32 a, UINT32 b, bool shift16) { if (m_st0.ovm) // overflow saturation mode { - res = ((INT32)(res) < 0) ? 0x7fffffff : 0x80000000; + res = ((int32_t)(res) < 0) ? 0x7fffffff : 0x80000000; } // set OV, this is a sticky flag m_st0.ov = 1; } - return (INT32)(res); + return (int32_t)(res); } -INT32 tms32051_device::ADD(UINT32 a, UINT32 b, bool shift16) +int32_t tms32051_device::ADD(uint32_t a, uint32_t b, bool shift16) { - UINT32 res = a + b; + uint32_t res = a + b; if (shift16) { @@ -65,14 +65,14 @@ INT32 tms32051_device::ADD(UINT32 a, UINT32 b, bool shift16) { if (m_st0.ovm) // overflow saturation mode { - res = ((INT32)(res) < 0) ? 0x7fffffff : 0x80000000; + res = ((int32_t)(res) < 0) ? 0x7fffffff : 0x80000000; } // set OV, this is a sticky flag m_st0.ov = 1; } - return (INT32)(res); + return (int32_t)(res); } @@ -119,11 +119,11 @@ void tms32051_device::UPDATE_ARP(int nar) m_st0.arp = nar; } -UINT16 tms32051_device::GET_ADDRESS() +uint16_t tms32051_device::GET_ADDRESS() { if (m_op & 0x80) // Indirect Addressing { - UINT16 ea; + uint16_t ea; int arp = m_st0.arp; int nar = m_op & 0x7; @@ -219,18 +219,18 @@ bool tms32051_device::GET_ZLVC_CONDITION(int zlvc, int zlvc_mask) case 0x01: break; // MZ=0, ML=0, Z=0, L=1 case 0x02: break; // MZ=0, ML=0, Z=1, L=0 case 0x03: break; // MZ=0, ML=0, Z=1, L=1 - case 0x04: if ((INT32)(m_acc) <= 0) return false; break; // MZ=0, ML=1, Z=0, L=0 (GT) - case 0x05: if ((INT32)(m_acc) >= 0) return false; break; // MZ=0, ML=1, Z=0, L=1 (LT) - case 0x06: if ((INT32)(m_acc) <= 0) return false; break; // MZ=0, ML=1, Z=1, L=0 (GT) - case 0x07: if ((INT32)(m_acc) >= 0) return false; break; // MZ=0, ML=1, Z=1, L=1 (LT) - case 0x08: if ((INT32)(m_acc) == 0) return false; break; // MZ=1, ML=0, Z=0, L=0 (NEQ) - case 0x09: if ((INT32)(m_acc) == 0) return false; break; // MZ=1, ML=0, Z=0, L=1 (NEQ) - case 0x0a: if ((INT32)(m_acc) != 0) return false; break; // MZ=1, ML=0, Z=1, L=0 (EQ) - case 0x0b: if ((INT32)(m_acc) != 0) return false; break; // MZ=1, ML=0, Z=1, L=1 (EQ) - case 0x0c: if ((INT32)(m_acc) <= 0) return false; break; // MZ=1, ML=1, Z=0, L=0 (GT) - case 0x0d: if ((INT32)(m_acc) >= 0) return false; break; // MZ=1, ML=1, Z=0, L=1 (LT) - case 0x0e: if ((INT32)(m_acc) < 0) return false; break; // MZ=1, ML=1, Z=1, L=0 (GEQ) - case 0x0f: if ((INT32)(m_acc) > 0) return false; break; // MZ=1, ML=1, Z=1, L=1 (LEQ) + case 0x04: if ((int32_t)(m_acc) <= 0) return false; break; // MZ=0, ML=1, Z=0, L=0 (GT) + case 0x05: if ((int32_t)(m_acc) >= 0) return false; break; // MZ=0, ML=1, Z=0, L=1 (LT) + case 0x06: if ((int32_t)(m_acc) <= 0) return false; break; // MZ=0, ML=1, Z=1, L=0 (GT) + case 0x07: if ((int32_t)(m_acc) >= 0) return false; break; // MZ=0, ML=1, Z=1, L=1 (LT) + case 0x08: if ((int32_t)(m_acc) == 0) return false; break; // MZ=1, ML=0, Z=0, L=0 (NEQ) + case 0x09: if ((int32_t)(m_acc) == 0) return false; break; // MZ=1, ML=0, Z=0, L=1 (NEQ) + case 0x0a: if ((int32_t)(m_acc) != 0) return false; break; // MZ=1, ML=0, Z=1, L=0 (EQ) + case 0x0b: if ((int32_t)(m_acc) != 0) return false; break; // MZ=1, ML=0, Z=1, L=1 (EQ) + case 0x0c: if ((int32_t)(m_acc) <= 0) return false; break; // MZ=1, ML=1, Z=0, L=0 (GT) + case 0x0d: if ((int32_t)(m_acc) >= 0) return false; break; // MZ=1, ML=1, Z=0, L=1 (LT) + case 0x0e: if ((int32_t)(m_acc) < 0) return false; break; // MZ=1, ML=1, Z=1, L=0 (GEQ) + case 0x0f: if ((int32_t)(m_acc) > 0) return false; break; // MZ=1, ML=1, Z=1, L=1 (LEQ) } return true; } @@ -255,7 +255,7 @@ bool tms32051_device::GET_TP_CONDITION(int tp) return true; } -INT32 tms32051_device::PREG_PSCALER(INT32 preg) +int32_t tms32051_device::PREG_PSCALER(int32_t preg) { switch (m_st1.pm & 3) { @@ -273,7 +273,7 @@ INT32 tms32051_device::PREG_PSCALER(INT32 preg) } case 3: // Right-shifted 6 bits, sign-extended, 6 LSBs lost { - return (INT32)(preg >> 6); + return (int32_t)(preg >> 6); } } return 0; @@ -300,18 +300,18 @@ void tms32051_device::op_adcb() void tms32051_device::op_add_mem() { - INT32 d; - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + int32_t d; + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); int shift = (m_op >> 8) & 0xf; if (m_st1.sxm) { - d = (INT32)(INT16)(data) << shift; + d = (int32_t)(int16_t)(data) << shift; } else { - d = (UINT32)(UINT16)(data) << shift; + d = (uint32_t)(uint16_t)(data) << shift; } m_acc = ADD(m_acc, d, false); @@ -321,7 +321,7 @@ void tms32051_device::op_add_mem() void tms32051_device::op_add_simm() { - UINT16 imm = m_op & 0xff; + uint16_t imm = m_op & 0xff; m_acc = ADD(m_acc, imm, false); @@ -330,17 +330,17 @@ void tms32051_device::op_add_simm() void tms32051_device::op_add_limm() { - INT32 d; - UINT16 imm = ROPCODE(); + int32_t d; + uint16_t imm = ROPCODE(); int shift = m_op & 0xf; if (m_st1.sxm) { - d = (INT32)(INT16)(imm) << shift; + d = (int32_t)(int16_t)(imm) << shift; } else { - d = (UINT32)(UINT16)(imm) << shift; + d = (uint32_t)(uint16_t)(imm) << shift; } m_acc = ADD(m_acc, d, false); @@ -350,8 +350,8 @@ void tms32051_device::op_add_limm() void tms32051_device::op_add_s16_mem() { - UINT16 ea = GET_ADDRESS(); - UINT32 data = DM_READ16(ea) << 16; + uint16_t ea = GET_ADDRESS(); + uint32_t data = DM_READ16(ea) << 16; m_acc = ADD(m_acc, data, true); @@ -382,17 +382,17 @@ void tms32051_device::op_addt() void tms32051_device::op_and_mem() { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); - m_acc &= (UINT32)(data); + m_acc &= (uint32_t)(data); CYCLES(1); } void tms32051_device::op_and_limm() { - UINT32 imm = ROPCODE(); + uint32_t imm = ROPCODE(); int shift = m_op & 0xf; m_acc &= imm << shift; @@ -416,11 +416,11 @@ void tms32051_device::op_bsar() if (m_st1.sxm) { - m_acc = (INT32)(m_acc) >> shift; + m_acc = (int32_t)(m_acc) >> shift; } else { - m_acc = (UINT32)(m_acc) >> shift; + m_acc = (uint32_t)(m_acc) >> shift; } CYCLES(1); @@ -428,7 +428,7 @@ void tms32051_device::op_bsar() void tms32051_device::op_cmpl() { - m_acc = ~(UINT32)(m_acc); + m_acc = ~(uint32_t)(m_acc); CYCLES(1); } @@ -467,7 +467,7 @@ void tms32051_device::op_crlt() void tms32051_device::op_exar() { - INT32 tmp = m_acc; + int32_t tmp = m_acc; m_acc = m_accb; m_accb = tmp; @@ -484,16 +484,16 @@ void tms32051_device::op_lacb() void tms32051_device::op_lacc_mem() { int shift = (m_op >> 8) & 0xf; - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); if (m_st1.sxm) { - m_acc = (INT32)(INT16)(data) << shift; + m_acc = (int32_t)(int16_t)(data) << shift; } else { - m_acc = (UINT32)(UINT16)(data) << shift; + m_acc = (uint32_t)(uint16_t)(data) << shift; } CYCLES(1); @@ -501,16 +501,16 @@ void tms32051_device::op_lacc_mem() void tms32051_device::op_lacc_limm() { - UINT16 imm = ROPCODE(); + uint16_t imm = ROPCODE(); int shift = m_op & 0xf; if (m_st1.sxm) { - m_acc = (INT32)(INT16)(imm) << shift; + m_acc = (int32_t)(int16_t)(imm) << shift; } else { - m_acc = (UINT32)(UINT16)(imm) << shift; + m_acc = (uint32_t)(uint16_t)(imm) << shift; } CYCLES(1); @@ -518,7 +518,7 @@ void tms32051_device::op_lacc_limm() void tms32051_device::op_lacc_s16_mem() { - UINT16 ea = GET_ADDRESS(); + uint16_t ea = GET_ADDRESS(); m_acc = DM_READ16(ea) << 16; CYCLES(1); @@ -533,7 +533,7 @@ void tms32051_device::op_lacl_simm() void tms32051_device::op_lacl_mem() { - UINT16 ea = GET_ADDRESS(); + uint16_t ea = GET_ADDRESS(); m_acc = DM_READ16(ea) & 0xffff; CYCLES(1); @@ -546,7 +546,7 @@ void tms32051_device::op_lact() void tms32051_device::op_lamm() { - UINT16 ea = GET_ADDRESS() & 0x7f; + uint16_t ea = GET_ADDRESS() & 0x7f; m_acc = DM_READ16(ea) & 0xffff; CYCLES(1); @@ -554,7 +554,7 @@ void tms32051_device::op_lamm() void tms32051_device::op_neg() { - if ((UINT32)(m_acc) == 0x80000000) + if ((uint32_t)(m_acc) == 0x80000000) { m_st0.ov = 1; m_st1.c = 0; @@ -562,7 +562,7 @@ void tms32051_device::op_neg() } else { - m_acc = 0 - (UINT32)(m_acc); + m_acc = 0 - (uint32_t)(m_acc); m_st1.c = (m_acc == 0) ? 1 : 0; } @@ -576,17 +576,17 @@ void tms32051_device::op_norm() void tms32051_device::op_or_mem() { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); - m_acc |= (UINT32)(data); + m_acc |= (uint32_t)(data); CYCLES(1); } void tms32051_device::op_or_limm() { - UINT32 imm = ROPCODE(); + uint32_t imm = ROPCODE(); int shift = m_op & 0xf; m_acc |= imm << shift; @@ -613,9 +613,9 @@ void tms32051_device::op_rol() void tms32051_device::op_rolb() { - UINT32 acc = m_acc; - UINT32 accb = m_accb; - UINT32 c = m_st1.c & 1; + uint32_t acc = m_acc; + uint32_t accb = m_accb; + uint32_t c = m_st1.c & 1; m_acc = (acc << 1) | ((accb >> 31) & 1); m_accb = (accb << 1) | c; @@ -643,28 +643,28 @@ void tms32051_device::op_sacb() void tms32051_device::op_sach() { - UINT16 ea = GET_ADDRESS(); + uint16_t ea = GET_ADDRESS(); int shift = (m_op >> 8) & 0x7; - DM_WRITE16(ea, (UINT16)((m_acc << shift) >> 16)); + DM_WRITE16(ea, (uint16_t)((m_acc << shift) >> 16)); CYCLES(1); } void tms32051_device::op_sacl() { - UINT16 ea = GET_ADDRESS(); + uint16_t ea = GET_ADDRESS(); int shift = (m_op >> 8) & 0x7; - DM_WRITE16(ea, (UINT16)(m_acc << shift)); + DM_WRITE16(ea, (uint16_t)(m_acc << shift)); CYCLES(1); } void tms32051_device::op_samm() { - UINT16 ea = GET_ADDRESS(); + uint16_t ea = GET_ADDRESS(); ea &= 0x7f; - DM_WRITE16(ea, (UINT16)(m_acc)); + DM_WRITE16(ea, (uint16_t)(m_acc)); CYCLES(1); } @@ -678,11 +678,11 @@ void tms32051_device::op_satl() int count = m_treg1 & 0xf; if (m_st1.sxm) { - m_acc = (INT32)(m_acc) >> count; + m_acc = (int32_t)(m_acc) >> count; } else { - m_acc = (UINT32)(m_acc) >> count; + m_acc = (uint32_t)(m_acc) >> count; } CYCLES(1); @@ -690,10 +690,10 @@ void tms32051_device::op_satl() void tms32051_device::op_sbb() { - UINT32 res = m_acc - m_accb; + uint32_t res = m_acc - m_accb; // C is cleared if borrow was generated - m_st1.c = ((UINT32)(m_acc) < res) ? 0 : 1; + m_st1.c = ((uint32_t)(m_acc) < res) ? 0 : 1; m_acc = res; @@ -715,8 +715,8 @@ void tms32051_device::op_sfl() void tms32051_device::op_sflb() { - UINT32 acc = m_acc; - UINT32 accb = m_accb; + uint32_t acc = m_acc; + uint32_t accb = m_accb; m_acc = (acc << 1) | ((accb >> 31) & 1); m_accb = (accb << 1); @@ -731,11 +731,11 @@ void tms32051_device::op_sfr() if (m_st1.sxm) { - m_acc = (INT32)(m_acc) >> 1; + m_acc = (int32_t)(m_acc) >> 1; } else { - m_acc = (UINT32)(m_acc) >> 1; + m_acc = (uint32_t)(m_acc) >> 1; } CYCLES(1); @@ -748,18 +748,18 @@ void tms32051_device::op_sfrb() void tms32051_device::op_sub_mem() { - INT32 d; - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + int32_t d; + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); int shift = (m_op >> 8) & 0xf; if (m_st1.sxm) { - d = (INT32)(INT16)(data) << shift; + d = (int32_t)(int16_t)(data) << shift; } else { - d = (UINT32)(UINT16)(data) << shift; + d = (uint32_t)(uint16_t)(data) << shift; } m_acc = SUB(m_acc, d, false); @@ -774,7 +774,7 @@ void tms32051_device::op_sub_s16_mem() void tms32051_device::op_sub_simm() { - UINT16 imm = m_op & 0xff; + uint16_t imm = m_op & 0xff; m_acc = SUB(m_acc, imm, false); @@ -783,17 +783,17 @@ void tms32051_device::op_sub_simm() void tms32051_device::op_sub_limm() { - INT32 d; - UINT16 imm = ROPCODE(); + int32_t d; + uint16_t imm = ROPCODE(); int shift = m_op & 0xf; if (m_st1.sxm) { - d = (INT32)(INT16)(imm) << shift; + d = (int32_t)(int16_t)(imm) << shift; } else { - d = (UINT32)(UINT16)(imm) << shift; + d = (uint32_t)(uint16_t)(imm) << shift; } m_acc = SUB(m_acc, d, false); @@ -823,17 +823,17 @@ void tms32051_device::op_subt() void tms32051_device::op_xor_mem() { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); - m_acc ^= (UINT32)(data); + m_acc ^= (uint32_t)(data); CYCLES(1); } void tms32051_device::op_xor_limm() { - UINT32 imm = ROPCODE(); + uint32_t imm = ROPCODE(); int shift = m_op & 0xf; m_acc ^= imm << shift; @@ -868,7 +868,7 @@ void tms32051_device::op_zap() void tms32051_device::op_adrk() { - UINT16 imm = m_op & 0xff; + uint16_t imm = m_op & 0xff; UPDATE_AR(m_st0.arp, imm); CYCLES(1); @@ -920,8 +920,8 @@ void tms32051_device::op_cmpr() void tms32051_device::op_lar_mem() { int arx = (m_op >> 8) & 0x7; - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); m_ar[arx] = data; @@ -939,7 +939,7 @@ void tms32051_device::op_lar_simm() void tms32051_device::op_lar_limm() { int arx = m_op & 0x7; - UINT16 imm = ROPCODE(); + uint16_t imm = ROPCODE(); m_ar[arx] = imm; CYCLES(2); @@ -969,8 +969,8 @@ void tms32051_device::op_mar() void tms32051_device::op_sar() { int arx = (m_op >> 8) & 0x7; - UINT16 ar = m_ar[arx]; - UINT16 ea = GET_ADDRESS(); + uint16_t ar = m_ar[arx]; + uint16_t ea = GET_ADDRESS(); DM_WRITE16(ea, ar); CYCLES(1); @@ -978,7 +978,7 @@ void tms32051_device::op_sar() void tms32051_device::op_sbrk() { - UINT16 imm = m_op & 0xff; + uint16_t imm = m_op & 0xff; UPDATE_AR(m_st0.arp, -imm); CYCLES(1); @@ -988,7 +988,7 @@ void tms32051_device::op_sbrk() void tms32051_device::op_b() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); GET_ADDRESS(); // update AR/ARP CHANGE_PC(pma); @@ -997,14 +997,14 @@ void tms32051_device::op_b() void tms32051_device::op_bacc() { - CHANGE_PC((UINT16)(m_acc)); + CHANGE_PC((uint16_t)(m_acc)); CYCLES(4); } void tms32051_device::op_baccd() { - UINT16 pc = (UINT16)(m_acc); + uint16_t pc = (uint16_t)(m_acc); delay_slot(m_pc); CHANGE_PC(pc); @@ -1014,7 +1014,7 @@ void tms32051_device::op_baccd() void tms32051_device::op_banz() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); if (m_ar[m_st0.arp] != 0) { @@ -1036,7 +1036,7 @@ void tms32051_device::op_banzd() void tms32051_device::op_bcnd() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); if (GET_ZLVC_CONDITION((m_op >> 4) & 0xf, m_op & 0xf) && GET_TP_CONDITION((m_op >> 8) & 0x3)) { @@ -1055,7 +1055,7 @@ void tms32051_device::op_bcnd() void tms32051_device::op_bcndd() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); if (GET_ZLVC_CONDITION((m_op >> 4) & 0xf, m_op & 0xf) && GET_TP_CONDITION((m_op >> 8) & 0x3)) { @@ -1075,7 +1075,7 @@ void tms32051_device::op_bcndd() void tms32051_device::op_bd() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); GET_ADDRESS(); // update AR/ARP delay_slot(m_pc); @@ -1094,7 +1094,7 @@ void tms32051_device::op_cala() void tms32051_device::op_calad() { - UINT16 pma = m_acc; + uint16_t pma = m_acc; PUSH_STACK(m_pc+2); delay_slot(m_pc); @@ -1105,7 +1105,7 @@ void tms32051_device::op_calad() void tms32051_device::op_call() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); GET_ADDRESS(); // update AR/ARP PUSH_STACK(m_pc); @@ -1116,7 +1116,7 @@ void tms32051_device::op_call() void tms32051_device::op_calld() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); GET_ADDRESS(); // update AR/ARP PUSH_STACK(m_pc+2); @@ -1128,7 +1128,7 @@ void tms32051_device::op_calld() void tms32051_device::op_cc() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); if (GET_ZLVC_CONDITION((m_op >> 4) & 0xf, m_op & 0xf) && GET_TP_CONDITION((m_op >> 8) & 0x3)) { @@ -1149,7 +1149,7 @@ void tms32051_device::op_cc() void tms32051_device::op_ccd() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); if (GET_ZLVC_CONDITION((m_op >> 4) & 0xf, m_op & 0xf) && GET_TP_CONDITION((m_op >> 8) & 0x3)) { @@ -1180,7 +1180,7 @@ void tms32051_device::op_retc() { if (GET_ZLVC_CONDITION((m_op >> 4) & 0xf, m_op & 0xf) && GET_TP_CONDITION((m_op >> 8) & 0x3)) { - UINT16 pc = POP_STACK(); + uint16_t pc = POP_STACK(); CHANGE_PC(pc); CYCLES(4); } @@ -1194,7 +1194,7 @@ void tms32051_device::op_retcd() { if (GET_ZLVC_CONDITION((m_op >> 4) & 0xf, m_op & 0xf) && GET_TP_CONDITION((m_op >> 8) & 0x3)) { - UINT16 pc = POP_STACK(); + uint16_t pc = POP_STACK(); delay_slot(m_pc); CHANGE_PC(pc); CYCLES(4); @@ -1207,7 +1207,7 @@ void tms32051_device::op_retcd() void tms32051_device::op_rete() { - UINT16 pc = POP_STACK(); + uint16_t pc = POP_STACK(); CHANGE_PC(pc); restore_interrupt_context(); @@ -1245,12 +1245,12 @@ void tms32051_device::op_xc() void tms32051_device::op_bldd_slimm() { - UINT16 pfc = ROPCODE(); + uint16_t pfc = ROPCODE(); while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(pfc); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(pfc); DM_WRITE16(ea, data); pfc++; CYCLES(2); @@ -1261,12 +1261,12 @@ void tms32051_device::op_bldd_slimm() void tms32051_device::op_bldd_dlimm() { - UINT16 pfc = ROPCODE(); + uint16_t pfc = ROPCODE(); while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); DM_WRITE16(pfc, data); pfc++; CYCLES(2); @@ -1277,12 +1277,12 @@ void tms32051_device::op_bldd_dlimm() void tms32051_device::op_bldd_sbmar() { - UINT16 pfc = m_bmar; + uint16_t pfc = m_bmar; while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(pfc); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(pfc); DM_WRITE16(ea, data); pfc++; CYCLES(2); @@ -1293,12 +1293,12 @@ void tms32051_device::op_bldd_sbmar() void tms32051_device::op_bldd_dbmar() { - UINT16 pfc = m_bmar; + uint16_t pfc = m_bmar; while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); DM_WRITE16(pfc, data); pfc++; CYCLES(2); @@ -1309,12 +1309,12 @@ void tms32051_device::op_bldd_dbmar() void tms32051_device::op_bldp() { - UINT16 pfc = m_bmar; + uint16_t pfc = m_bmar; while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); PM_WRITE16(pfc, data); pfc++; CYCLES(1); @@ -1330,12 +1330,12 @@ void tms32051_device::op_blpd_bmar() void tms32051_device::op_blpd_imm() { - UINT16 pfc = ROPCODE(); + uint16_t pfc = ROPCODE(); while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = PM_READ16(pfc); + uint16_t ea = GET_ADDRESS(); + uint16_t data = PM_READ16(pfc); DM_WRITE16(ea, data); pfc++; CYCLES(2); @@ -1358,12 +1358,12 @@ void tms32051_device::op_in() void tms32051_device::op_lmmr() { - UINT16 pfc = ROPCODE(); + uint16_t pfc = ROPCODE(); while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(pfc); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(pfc); DM_WRITE16(ea & 0x7f, data); pfc++; CYCLES(2); @@ -1374,10 +1374,10 @@ void tms32051_device::op_lmmr() void tms32051_device::op_out() { - UINT16 port = ROPCODE(); - UINT16 ea = GET_ADDRESS(); + uint16_t port = ROPCODE(); + uint16_t ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t data = DM_READ16(ea); m_io->write_word(port << 1, data); // TODO: handle repeat @@ -1386,12 +1386,12 @@ void tms32051_device::op_out() void tms32051_device::op_smmr() { - UINT16 pfc = ROPCODE(); + uint16_t pfc = ROPCODE(); while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea & 0x7f); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea & 0x7f); DM_WRITE16(pfc, data); pfc++; CYCLES(2); @@ -1402,12 +1402,12 @@ void tms32051_device::op_smmr() void tms32051_device::op_tblr() { - UINT16 pfc = (UINT16)(m_acc); + uint16_t pfc = (uint16_t)(m_acc); while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = PM_READ16(pfc); + uint16_t ea = GET_ADDRESS(); + uint16_t data = PM_READ16(pfc); DM_WRITE16(ea, data); pfc++; CYCLES(2); @@ -1418,12 +1418,12 @@ void tms32051_device::op_tblr() void tms32051_device::op_tblw() { - UINT16 pfc = (UINT16)(m_acc); + uint16_t pfc = (uint16_t)(m_acc); while (m_rptc > -1) { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); PM_WRITE16(pfc, data); pfc++; CYCLES(2); @@ -1436,8 +1436,8 @@ void tms32051_device::op_tblw() void tms32051_device::op_apl_dbmr() { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); data &= m_dbmr; @@ -1449,9 +1449,9 @@ void tms32051_device::op_apl_dbmr() void tms32051_device::op_apl_imm() { - UINT16 ea = GET_ADDRESS(); - UINT16 imm = ROPCODE(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t imm = ROPCODE(); + uint16_t data = DM_READ16(ea); data &= imm; @@ -1468,9 +1468,9 @@ void tms32051_device::op_cpl_dbmr() void tms32051_device::op_cpl_imm() { - UINT16 imm = ROPCODE(); - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t imm = ROPCODE(); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); m_st1.tc = (data == imm) ? 1 : 0; @@ -1479,8 +1479,8 @@ void tms32051_device::op_cpl_imm() void tms32051_device::op_opl_dbmr() { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); data |= m_dbmr; m_st1.tc = (data == 0) ? 1 : 0; @@ -1491,9 +1491,9 @@ void tms32051_device::op_opl_dbmr() void tms32051_device::op_opl_imm() { - UINT16 ea = GET_ADDRESS(); - UINT16 imm = ROPCODE(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t imm = ROPCODE(); + uint16_t data = DM_READ16(ea); data |= imm; m_st1.tc = (data == 0) ? 1 : 0; @@ -1504,8 +1504,8 @@ void tms32051_device::op_opl_imm() void tms32051_device::op_splk() { - UINT16 ea = GET_ADDRESS(); - UINT16 imm = ROPCODE(); + uint16_t ea = GET_ADDRESS(); + uint16_t imm = ROPCODE(); DM_WRITE16(ea, imm); @@ -1524,7 +1524,7 @@ void tms32051_device::op_xpl_imm() void tms32051_device::op_apac() { - INT32 spreg = PREG_PSCALER(m_preg); + int32_t spreg = PREG_PSCALER(m_preg); m_acc = ADD(m_acc, spreg, false); CYCLES(1); @@ -1537,8 +1537,8 @@ void tms32051_device::op_lph() void tms32051_device::op_lt() { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); m_treg0 = data; if (m_pmst.trm == 0) @@ -1552,9 +1552,9 @@ void tms32051_device::op_lt() void tms32051_device::op_lta() { - INT32 spreg; - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + int32_t spreg; + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); m_treg0 = data; spreg = PREG_PSCALER(m_preg); @@ -1605,10 +1605,10 @@ void tms32051_device::op_mads() void tms32051_device::op_mpy_mem() { - UINT16 ea = GET_ADDRESS(); - INT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + int16_t data = DM_READ16(ea); - m_preg = (INT32)(data) * (INT32)(INT16)(m_treg0); + m_preg = (int32_t)(data) * (int32_t)(int16_t)(m_treg0); CYCLES(1); } @@ -1650,8 +1650,8 @@ void tms32051_device::op_spac() void tms32051_device::op_sph() { - UINT16 ea = GET_ADDRESS(); - UINT16 spreg = (UINT16)(PREG_PSCALER(m_preg) >> 16); + uint16_t ea = GET_ADDRESS(); + uint16_t spreg = (uint16_t)(PREG_PSCALER(m_preg) >> 16); DM_WRITE16(ea, spreg); CYCLES(1); @@ -1659,8 +1659,8 @@ void tms32051_device::op_sph() void tms32051_device::op_spl() { - UINT16 ea = GET_ADDRESS(); - UINT16 spreg = (UINT16)(PREG_PSCALER(m_preg)); + uint16_t ea = GET_ADDRESS(); + uint16_t spreg = (uint16_t)(PREG_PSCALER(m_preg)); DM_WRITE16(ea, spreg); CYCLES(1); @@ -1690,8 +1690,8 @@ void tms32051_device::op_zpr() void tms32051_device::op_bit() { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); m_st1.tc = (data >> (~m_op >> 8 & 0xf)) & 1; @@ -1700,8 +1700,8 @@ void tms32051_device::op_bit() void tms32051_device::op_bitt() { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); m_st1.tc = (data >> (~m_treg2 & 0xf)) & 1; @@ -1804,8 +1804,8 @@ void tms32051_device::op_push() void tms32051_device::op_rpt_mem() { - UINT16 ea = GET_ADDRESS(); - UINT16 data = DM_READ16(ea); + uint16_t ea = GET_ADDRESS(); + uint16_t data = DM_READ16(ea); m_rptc = data; m_rpt_start = m_pc; m_rpt_end = m_pc; @@ -1815,7 +1815,7 @@ void tms32051_device::op_rpt_mem() void tms32051_device::op_rpt_limm() { - m_rptc = (UINT16)ROPCODE(); + m_rptc = (uint16_t)ROPCODE(); m_rpt_start = m_pc; m_rpt_end = m_pc; @@ -1833,7 +1833,7 @@ void tms32051_device::op_rpt_simm() void tms32051_device::op_rptb() { - UINT16 pma = ROPCODE(); + uint16_t pma = ROPCODE(); m_pmst.braf = 1; m_pasr = m_pc; m_paer = pma + 1; diff --git a/src/devices/cpu/tms32051/dis32051.cpp b/src/devices/cpu/tms32051/dis32051.cpp index ad4f2be1d04..e4e422d6868 100644 --- a/src/devices/cpu/tms32051/dis32051.cpp +++ b/src/devices/cpu/tms32051/dis32051.cpp @@ -55,7 +55,7 @@ static const char *const tp_condition_codes[4] = static offs_t npc; -static const UINT8 *rombase; +static const uint8_t *rombase; static offs_t pcbase; static char *output; @@ -69,9 +69,9 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) va_end(vl); } -static UINT16 FETCH(void) +static uint16_t FETCH(void) { - UINT16 result = rombase[(npc - pcbase) * 2 + 0] | (rombase[(npc - pcbase) * 2 + 1] << 8); + uint16_t result = rombase[(npc - pcbase) * 2 + 0] | (rombase[(npc - pcbase) * 2 + 1] << 8); npc++; return result; } @@ -152,7 +152,7 @@ static void print_condition_codes(bool pp, int zl, int cv, int tp) } } -static void dasm_group_be(UINT16 opcode) +static void dasm_group_be(uint16_t opcode) { int subop = opcode & 0xff; @@ -238,7 +238,7 @@ static void dasm_group_be(UINT16 opcode) } } -static void dasm_group_bf(UINT16 opcode) +static void dasm_group_bf(uint16_t opcode) { int subop = (opcode >> 4) & 0xf; int shift = opcode & 0xf; @@ -284,8 +284,8 @@ static void dasm_group_bf(UINT16 opcode) CPU_DISASSEMBLE( tms32051 ) { - UINT32 flags = 0; - UINT16 opcode; + uint32_t flags = 0; + uint16_t opcode; int baseop; int address, addr_mode; diff --git a/src/devices/cpu/tms32051/tms32051.cpp b/src/devices/cpu/tms32051/tms32051.cpp index e5efade625f..9707b5d6270 100644 --- a/src/devices/cpu/tms32051/tms32051.cpp +++ b/src/devices/cpu/tms32051/tms32051.cpp @@ -69,7 +69,7 @@ static ADDRESS_MAP_START( tms32051_internal_data, AS_DATA, 16, tms32051_device ) ADDRESS_MAP_END -tms32051_device::tms32051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32051_device::tms32051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, TMS32051, "TMS32051", tag, owner, clock, "tms32051", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, 16, -1, ADDRESS_MAP_NAME(tms32051_internal_pgm)) , m_data_config("data", ENDIANNESS_LITTLE, 16, 16, -1, ADDRESS_MAP_NAME(tms32051_internal_data)) @@ -77,7 +77,7 @@ tms32051_device::tms32051_device(const machine_config &mconfig, const char *tag, { } -tms32051_device::tms32051_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) +tms32051_device::tms32051_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 16, 16, -1) , m_data_config("data", ENDIANNESS_LITTLE, 16, 16, -1) @@ -106,13 +106,13 @@ static ADDRESS_MAP_START( tms32053_internal_data, AS_DATA, 16, tms32053_device ) ADDRESS_MAP_END -tms32053_device::tms32053_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32053_device::tms32053_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms32051_device(mconfig, TMS32053, "TMS32053", tag, owner, clock, "tms32053", __FILE__) { } -offs_t tms32051_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms32051_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms32051 ); return CPU_DISASSEMBLE_NAME(tms32051)(this, buffer, pc, oprom, opram, options); @@ -123,27 +123,27 @@ offs_t tms32051_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 #define ROPCODE() m_direct->read_word((m_pc++) << 1) -void tms32051_device::CHANGE_PC(UINT16 new_pc) +void tms32051_device::CHANGE_PC(uint16_t new_pc) { m_pc = new_pc; } -UINT16 tms32051_device::PM_READ16(UINT16 address) +uint16_t tms32051_device::PM_READ16(uint16_t address) { return m_program->read_word(address << 1); } -void tms32051_device::PM_WRITE16(UINT16 address, UINT16 data) +void tms32051_device::PM_WRITE16(uint16_t address, uint16_t data) { m_program->write_word(address << 1, data); } -UINT16 tms32051_device::DM_READ16(UINT16 address) +uint16_t tms32051_device::DM_READ16(uint16_t address) { return m_data->read_word(address << 1); } -void tms32051_device::DM_WRITE16(UINT16 address, UINT16 data) +void tms32051_device::DM_WRITE16(uint16_t address, uint16_t data) { m_data->write_word(address << 1, data); } @@ -161,7 +161,7 @@ void tms32051_device::op_group_bf() (this->*s_opcode_table_bf[m_op & 0xff])(); } -void tms32051_device::delay_slot(UINT16 startpc) +void tms32051_device::delay_slot(uint16_t startpc) { m_op = ROPCODE(); (this->*s_opcode_table[m_op >> 8])(); @@ -281,7 +281,7 @@ void tms32051_device::device_reset() m_pmst.ovly = 0; int i; - UINT16 src, dst, length; + uint16_t src, dst, length; src = 0x7800; dst = DM_READ16(src++); @@ -292,7 +292,7 @@ void tms32051_device::device_reset() /* TODO: if you soft reset on Taito JC it tries to do a 0x7802->0x9007 (0xff00) transfer. */ for (i=0; i < (length & 0x7ff); i++) { - UINT16 data = DM_READ16(src++); + uint16_t data = DM_READ16(src++); PM_WRITE16(dst++, data); } } @@ -368,7 +368,7 @@ void tms32051_device::execute_run() { while (m_icount > 0) { - UINT16 ppc; + uint16_t ppc; if (m_idle) { @@ -444,7 +444,7 @@ READ16_MEMBER( tms32051_device::cpuregs_r ) case 0x07: // PMST { - UINT16 r = 0; + uint16_t r = 0; r |= m_pmst.iptr << 11; r |= m_pmst.avis << 7; r |= m_pmst.ovly << 5; @@ -482,7 +482,7 @@ READ16_MEMBER( tms32051_device::cpuregs_r ) case 0x26: // TCR { - UINT16 r = 0; + uint16_t r = 0; r |= (m_timer.psc & 0xf) << 6; r |= (m_timer.tddr & 0xf); return r; @@ -631,7 +631,7 @@ WRITE16_MEMBER( tms32051_device::cpuregs_w ) } -bool tms32051_device::memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value) +bool tms32051_device::memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) { /* TODO: alignment if offset is odd */ if (spacenum == AS_PROGRAM) diff --git a/src/devices/cpu/tms32051/tms32051.h b/src/devices/cpu/tms32051/tms32051.h index ee83ed3c2ae..f025db4246f 100644 --- a/src/devices/cpu/tms32051/tms32051.h +++ b/src/devices/cpu/tms32051/tms32051.h @@ -21,35 +21,35 @@ enum struct TMS32051_PMST { - UINT16 iptr; - UINT16 avis; - UINT16 ovly; - UINT16 ram; - UINT16 mpmc; - UINT16 ndx; - UINT16 trm; - UINT16 braf; + uint16_t iptr; + uint16_t avis; + uint16_t ovly; + uint16_t ram; + uint16_t mpmc; + uint16_t ndx; + uint16_t trm; + uint16_t braf; }; struct TMS32051_ST0 { - UINT16 dp; - UINT16 intm; - UINT16 ovm; - UINT16 ov; - UINT16 arp; + uint16_t dp; + uint16_t intm; + uint16_t ovm; + uint16_t ov; + uint16_t arp; }; struct TMS32051_ST1 { - UINT16 arb; - UINT16 cnf; - UINT16 tc; - UINT16 sxm; - UINT16 c; - UINT16 hm; - UINT16 xf; - UINT16 pm; + uint16_t arb; + uint16_t cnf; + uint16_t tc; + uint16_t sxm; + uint16_t c; + uint16_t hm; + uint16_t xf; + uint16_t pm; }; @@ -57,8 +57,8 @@ class tms32051_device : public cpu_device { public: // construction/destruction - tms32051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms32051_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); + tms32051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms32051_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); DECLARE_READ16_MEMBER( cpuregs_r ); DECLARE_WRITE16_MEMBER( cpuregs_w ); @@ -69,20 +69,20 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 5; } - virtual UINT32 execute_input_lines() const override { return 6; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 5; } + virtual uint32_t execute_input_lines() const override { return 6; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : nullptr ) ); } - virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value) override; + virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; address_space_config m_data_config; @@ -93,71 +93,71 @@ protected: static const opcode_func s_opcode_table_be[256]; static const opcode_func s_opcode_table_bf[256]; - UINT16 m_pc; - UINT16 m_op; - INT32 m_acc; - INT32 m_accb; - INT32 m_preg; - UINT16 m_treg0; - UINT16 m_treg1; - UINT16 m_treg2; - UINT16 m_ar[8]; - INT32 m_rptc; - - UINT16 m_bmar; - INT32 m_brcr; - UINT16 m_paer; - UINT16 m_pasr; - UINT16 m_indx; - UINT16 m_dbmr; - UINT16 m_arcr; + uint16_t m_pc; + uint16_t m_op; + int32_t m_acc; + int32_t m_accb; + int32_t m_preg; + uint16_t m_treg0; + uint16_t m_treg1; + uint16_t m_treg2; + uint16_t m_ar[8]; + int32_t m_rptc; + + uint16_t m_bmar; + int32_t m_brcr; + uint16_t m_paer; + uint16_t m_pasr; + uint16_t m_indx; + uint16_t m_dbmr; + uint16_t m_arcr; TMS32051_ST0 m_st0; TMS32051_ST1 m_st1; TMS32051_PMST m_pmst; - UINT16 m_ifr; - UINT16 m_imr; + uint16_t m_ifr; + uint16_t m_imr; - UINT16 m_pcstack[8]; + uint16_t m_pcstack[8]; int m_pcstack_ptr; - UINT16 m_rpt_start, m_rpt_end; + uint16_t m_rpt_start, m_rpt_end; - UINT16 m_cbcr; - UINT16 m_cbsr1; - UINT16 m_cber1; - UINT16 m_cbsr2; - UINT16 m_cber2; + uint16_t m_cbcr; + uint16_t m_cbsr1; + uint16_t m_cber1; + uint16_t m_cbsr2; + uint16_t m_cber2; struct { int tddr; int psc; - UINT16 tim; - UINT16 prd; + uint16_t tim; + uint16_t prd; } m_timer; struct { - UINT16 drr; - UINT16 dxr; - UINT16 spc; + uint16_t drr; + uint16_t dxr; + uint16_t spc; } m_serial; struct { - INT32 acc; - INT32 accb; - UINT16 arcr; - UINT16 indx; + int32_t acc; + int32_t accb; + uint16_t arcr; + uint16_t indx; TMS32051_PMST pmst; - INT32 preg; + int32_t preg; TMS32051_ST0 st0; TMS32051_ST1 st1; - INT32 treg0; - INT32 treg1; - INT32 treg2; + int32_t treg0; + int32_t treg1; + int32_t treg2; } m_shadow; address_space *m_program; @@ -168,21 +168,21 @@ protected: bool m_idle; - inline void CHANGE_PC(UINT16 new_pc); - inline UINT16 PM_READ16(UINT16 address); - inline void PM_WRITE16(UINT16 address, UINT16 data); - inline UINT16 DM_READ16(UINT16 address); - inline void DM_WRITE16(UINT16 address, UINT16 data); - inline void PUSH_STACK(UINT16 pc); - inline UINT16 POP_STACK(); - inline INT32 SUB(UINT32 a, UINT32 b, bool shift16); - inline INT32 ADD(UINT32 a, UINT32 b, bool shift16); + inline void CHANGE_PC(uint16_t new_pc); + inline uint16_t PM_READ16(uint16_t address); + inline void PM_WRITE16(uint16_t address, uint16_t data); + inline uint16_t DM_READ16(uint16_t address); + inline void DM_WRITE16(uint16_t address, uint16_t data); + inline void PUSH_STACK(uint16_t pc); + inline uint16_t POP_STACK(); + inline int32_t SUB(uint32_t a, uint32_t b, bool shift16); + inline int32_t ADD(uint32_t a, uint32_t b, bool shift16); inline void UPDATE_AR(int ar, int step); inline void UPDATE_ARP(int nar); - UINT16 GET_ADDRESS(); + uint16_t GET_ADDRESS(); inline bool GET_ZLVC_CONDITION(int zlvc, int zlvc_mask); inline bool GET_TP_CONDITION(int tp); - inline INT32 PREG_PSCALER(INT32 preg); + inline int32_t PREG_PSCALER(int32_t preg); void op_invalid(); void op_abs(); void op_adcb(); @@ -362,7 +362,7 @@ protected: void op_sst_st1(); void op_group_be(); void op_group_bf(); - void delay_slot(UINT16 startpc); + void delay_slot(uint16_t startpc); void check_interrupts(); void save_interrupt_context(); void restore_interrupt_context(); @@ -373,7 +373,7 @@ class tms32053_device : public tms32051_device { public: // construction/destruction - tms32053_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms32053_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_config_complete() override; diff --git a/src/devices/cpu/tms32082/dis_mp.cpp b/src/devices/cpu/tms32082/dis_mp.cpp index e7083901fc7..cdfad55fdbd 100644 --- a/src/devices/cpu/tms32082/dis_mp.cpp +++ b/src/devices/cpu/tms32082/dis_mp.cpp @@ -5,7 +5,7 @@ #include "emu.h" -#define SIMM15(v) (INT32)((v & 0x4000) ? (v | 0xffffe000) : (v)) +#define SIMM15(v) (int32_t)((v & 0x4000) ? (v | 0xffffe000) : (v)) #define UIMM15(v) (v) static const char *BCND_CONDITION[32] = @@ -50,7 +50,7 @@ static const char *FLOATOP_ROUND[4] = }; static char *output; -static const UINT8 *opdata; +static const uint8_t *opdata; static int opbytes; static void ATTR_PRINTF(1,2) print(const char *fmt, ...) @@ -62,15 +62,15 @@ static void ATTR_PRINTF(1,2) print(const char *fmt, ...) va_end(vl); } -static UINT32 fetch(void) +static uint32_t fetch(void) { - UINT32 d = ((UINT32)(opdata[0]) << 24) | ((UINT32)(opdata[1]) << 16) | ((UINT32)(opdata[2]) << 8) | opdata[3]; + uint32_t d = ((uint32_t)(opdata[0]) << 24) | ((uint32_t)(opdata[1]) << 16) | ((uint32_t)(opdata[2]) << 8) | opdata[3]; opdata += 4; opbytes += 4; return d; } -static char* get_creg_name(UINT32 reg) +static char* get_creg_name(uint32_t reg) { static char buffer[64]; @@ -108,7 +108,7 @@ static char* get_creg_name(UINT32 reg) return buffer; } -static char* format_vector_op(UINT32 op, UINT32 imm32) +static char* format_vector_op(uint32_t op, uint32_t imm32) { static char buffer[256]; static char dest[64]; @@ -201,14 +201,14 @@ static char* format_vector_op(UINT32 op, UINT32 imm32) return buffer; } -static offs_t tms32082_disasm_mp(char *buffer, offs_t pc, const UINT8 *oprom) +static offs_t tms32082_disasm_mp(char *buffer, offs_t pc, const uint8_t *oprom) { output = buffer; opdata = oprom; opbytes = 0; - UINT32 flags = 0; + uint32_t flags = 0; - UINT32 op = fetch(); + uint32_t op = fetch(); int rd = (op >> 27) & 0x1f; int link = rd; @@ -217,7 +217,7 @@ static offs_t tms32082_disasm_mp(char *buffer, offs_t pc, const UINT8 *oprom) int endmask = (op >> 5) & 0x1f; int rotate = (op & 0x1f); int src1 = rotate; - UINT32 uimm15 = op & 0x7fff; + uint32_t uimm15 = op & 0x7fff; switch ((op >> 20) & 3) { @@ -317,7 +317,7 @@ static offs_t tms32082_disasm_mp(char *buffer, offs_t pc, const UINT8 *oprom) { int subop = (op >> 12) & 0xff; - UINT32 imm32 = 0; + uint32_t imm32 = 0; if (op & (1 << 12)) // fetch 32-bit immediate if needed imm32 = fetch(); diff --git a/src/devices/cpu/tms32082/dis_pp.cpp b/src/devices/cpu/tms32082/dis_pp.cpp index 8bc6af719a9..6aa7f5b2949 100644 --- a/src/devices/cpu/tms32082/dis_pp.cpp +++ b/src/devices/cpu/tms32082/dis_pp.cpp @@ -83,7 +83,7 @@ static char *format_address_mode(int mode, int areg, int s, int limx) return buffer; } -static void format_transfer(UINT64 op) +static void format_transfer(uint64_t op) { char buffer[128]; char *b = buffer; @@ -258,7 +258,7 @@ static void format_transfer(UINT64 op) int reg = (bank << 3) | d; - UINT16 offset; + uint16_t offset; if (s) { offset = op & 0x7fff; @@ -418,13 +418,13 @@ static void format_alu_op(int aluop, int a, const char *dst_text, const char *a_ } } -static offs_t tms32082_disasm_pp(char *buffer, offs_t pc, const UINT8 *oprom) +static offs_t tms32082_disasm_pp(char *buffer, offs_t pc, const uint8_t *oprom) { output = buffer; - UINT32 flags = 0; + uint32_t flags = 0; - UINT64 op = ((UINT64)(oprom[0]) << 56) | ((UINT64)(oprom[1]) << 48) | ((UINT64)(oprom[2]) << 40) | ((UINT64)(oprom[3]) << 32) | - ((UINT64)(oprom[4]) << 24) | ((UINT64)(oprom[5]) << 16) | ((UINT64)(oprom[6]) << 8) | ((UINT64)(oprom[7])); + uint64_t op = ((uint64_t)(oprom[0]) << 56) | ((uint64_t)(oprom[1]) << 48) | ((uint64_t)(oprom[2]) << 40) | ((uint64_t)(oprom[3]) << 32) | + ((uint64_t)(oprom[4]) << 24) | ((uint64_t)(oprom[5]) << 16) | ((uint64_t)(oprom[6]) << 8) | ((uint64_t)(oprom[7])); switch (op >> 60) { @@ -447,7 +447,7 @@ static offs_t tms32082_disasm_pp(char *buffer, offs_t pc, const UINT8 *oprom) if ((op & U64(0xfaa8100000000000)) == U64(0x8800000000000000)) { int operation = (op >> 39) & 0x1f; - UINT64 parallel_xfer = (op & U64(0x0000007fffffffff)); + uint64_t parallel_xfer = (op & U64(0x0000007fffffffff)); switch (operation) { @@ -471,7 +471,7 @@ static offs_t tms32082_disasm_pp(char *buffer, offs_t pc, const UINT8 *oprom) case 0: case 1: // Base set ALU (5-bit immediate) { - UINT64 parallel_xfer = (op & U64(0x0000007fffffffff)); + uint64_t parallel_xfer = (op & U64(0x0000007fffffffff)); int dst = (op >> 48) & 7; int src1 = (op >> 45) & 7; @@ -550,7 +550,7 @@ static offs_t tms32082_disasm_pp(char *buffer, offs_t pc, const UINT8 *oprom) case 2: // Base set ALU (reg src2) { - UINT64 parallel_xfer = (op & U64(0x0000007fffffffff)); + uint64_t parallel_xfer = (op & U64(0x0000007fffffffff)); int dst = (op >> 48) & 7; int src1 = (op >> 45) & 7; @@ -638,7 +638,7 @@ static offs_t tms32082_disasm_pp(char *buffer, offs_t pc, const UINT8 *oprom) int cl = (op >> 60) & 7; int aluop = (op >> 51) & 0xff; int a = (op >> 59) & 1; - UINT32 imm32 = (UINT32)(op); + uint32_t imm32 = (uint32_t)(op); int dreg = dst | (dstbank << 3); int s1reg = src1 | (s1bank << 3); @@ -700,7 +700,7 @@ static offs_t tms32082_disasm_pp(char *buffer, offs_t pc, const UINT8 *oprom) } default: - print("??? (%02X)", (UINT32)(op >> 60)); + print("??? (%02X)", (uint32_t)(op >> 60)); break; } diff --git a/src/devices/cpu/tms32082/mp_ops.cpp b/src/devices/cpu/tms32082/mp_ops.cpp index 1cce61f6a8d..0411e6996b6 100644 --- a/src/devices/cpu/tms32082/mp_ops.cpp +++ b/src/devices/cpu/tms32082/mp_ops.cpp @@ -27,75 +27,75 @@ #define CMP_OVERFLOW32(r, s, d) ((((d) ^ (s)) & ((d) ^ (r)) & 0x80000000) ? 1 : 0) #define CMP_OVERFLOW16(r, s, d) ((((d) ^ (s)) & ((d) ^ (r)) & 0x8000) ? 1 : 0) #define CMP_OVERFLOW8(r, s, d) ((((d) ^ (s)) & ((d) ^ (r)) & 0x80) ? 1 : 0) -#define CARRY32(x) (((x) & (((UINT64)1) << 32)) ? 1 : 0) +#define CARRY32(x) (((x) & (((uint64_t)1) << 32)) ? 1 : 0) #define CARRY16(x) (((x) & 0x10000) ? 1 : 0) #define CARRY8(x) (((x) & 0x100) ? 1 : 0) #define SIGN32(x) (((x) & 0x80000000) ? 1 : 0) #define SIGN16(x) (((x) & 0x8000) ? 1 : 0) #define SIGN8(x) (((x) & 0x80) ? 1 : 0) -#define SIGN_EXTEND(x, r) ((x) | (((x) & (0x80000000 >> r)) ? ((INT32)(0x80000000) >> r) : 0)) +#define SIGN_EXTEND(x, r) ((x) | (((x) & (0x80000000 >> r)) ? ((int32_t)(0x80000000) >> r) : 0)) -bool tms32082_mp_device::test_condition(int condition, UINT32 value) +bool tms32082_mp_device::test_condition(int condition, uint32_t value) { switch (condition) { case 0x00: return false; // never, byte - case 0x01: return (INT8)(value) > 0; // greater than zero, byte - case 0x02: return (INT8)(value) == 0; // equals zero, byte - case 0x03: return (INT8)(value) >= 0; // greater than or equal to zero, byte - case 0x04: return (INT8)(value) < 0; // less than zero, byte - case 0x05: return (INT8)(value) != 0; // not equal to zero, byte - case 0x06: return (INT8)(value) <= 0; // less than or equal to zero, byte + case 0x01: return (int8_t)(value) > 0; // greater than zero, byte + case 0x02: return (int8_t)(value) == 0; // equals zero, byte + case 0x03: return (int8_t)(value) >= 0; // greater than or equal to zero, byte + case 0x04: return (int8_t)(value) < 0; // less than zero, byte + case 0x05: return (int8_t)(value) != 0; // not equal to zero, byte + case 0x06: return (int8_t)(value) <= 0; // less than or equal to zero, byte case 0x07: return true; // always, byte case 0x08: return false; // never, word - case 0x09: return (INT16)(value) > 0; // greater than zero, word - case 0x0a: return (INT16)(value) == 0; // equals zero, word - case 0x0b: return (INT16)(value) >= 0; // greater than or equal to zero, word - case 0x0c: return (INT16)(value) < 0; // less than zero, word - case 0x0d: return (INT16)(value) != 0; // not equal to zero, word - case 0x0e: return (INT16)(value) <= 0; // less than or equal to zero, word + case 0x09: return (int16_t)(value) > 0; // greater than zero, word + case 0x0a: return (int16_t)(value) == 0; // equals zero, word + case 0x0b: return (int16_t)(value) >= 0; // greater than or equal to zero, word + case 0x0c: return (int16_t)(value) < 0; // less than zero, word + case 0x0d: return (int16_t)(value) != 0; // not equal to zero, word + case 0x0e: return (int16_t)(value) <= 0; // less than or equal to zero, word case 0x0f: return true; // always, word case 0x10: return false; // never, dword - case 0x11: return (INT32)(value) > 0; // greater than zero, dword - case 0x12: return (INT32)(value) == 0; // equals zero, dword - case 0x13: return (INT32)(value) >= 0; // greater than or equal to zero, dword - case 0x14: return (INT32)(value) < 0; // less than zero, dword - case 0x15: return (INT32)(value) != 0; // not equal to zero, dword - case 0x16: return (INT32)(value) <= 0; // less than or equal to zero, dword + case 0x11: return (int32_t)(value) > 0; // greater than zero, dword + case 0x12: return (int32_t)(value) == 0; // equals zero, dword + case 0x13: return (int32_t)(value) >= 0; // greater than or equal to zero, dword + case 0x14: return (int32_t)(value) < 0; // less than zero, dword + case 0x15: return (int32_t)(value) != 0; // not equal to zero, dword + case 0x16: return (int32_t)(value) <= 0; // less than or equal to zero, dword case 0x17: return true; // always, dword default: return false; // reserved } } -UINT32 tms32082_mp_device::calculate_cmp(UINT32 src1, UINT32 src2) +uint32_t tms32082_mp_device::calculate_cmp(uint32_t src1, uint32_t src2) { - UINT16 src1_16 = (UINT16)(src1); - UINT8 src1_8 = (UINT8)(src1); - UINT16 src2_16 = (UINT16)(src2); - UINT8 src2_8 = (UINT8)(src2); + uint16_t src1_16 = (uint16_t)(src1); + uint8_t src1_8 = (uint8_t)(src1); + uint16_t src2_16 = (uint16_t)(src2); + uint8_t src2_8 = (uint8_t)(src2); - UINT64 res32 = (UINT64)src1 - (UINT64)src2; + uint64_t res32 = (uint64_t)src1 - (uint64_t)src2; int z32 = (res32 == 0) ? 1 : 0; int n32 = SIGN32(res32); int v32 = CMP_OVERFLOW32(res32, src2, src1); int c32 = CARRY32(res32); - UINT32 res16 = (UINT32)src1_16 - (UINT32)src2_16; + uint32_t res16 = (uint32_t)src1_16 - (uint32_t)src2_16; int z16 = (res16 == 0) ? 1 : 0; int n16 = SIGN16(res16); int v16 = CMP_OVERFLOW16(res16, src2_16, src1_16); int c16 = CARRY16(res16); - UINT16 res8 = (UINT16)src1_8 - (UINT16)src2_8; + uint16_t res8 = (uint16_t)src1_8 - (uint16_t)src2_8; int z8 = (res8 == 0) ? 1 : 0; int n8 = SIGN8(res8); int v8 = CMP_OVERFLOW8(res8, src2_8, src1_8); int c8 = CARRY8(res8); - UINT32 flags = 0; + uint32_t flags = 0; // 32-bits (bits 20-29) flags |= ((~c32) & 1) << 29; // higher than or same (C) flags |= ((c32) & 1) << 28; // lower than (~C) @@ -148,7 +148,7 @@ void tms32082_mp_device::vector_loadstore() } case 0x03: // vst.d { - UINT64 data = m_fpair[rd >> 1]; + uint64_t data = m_fpair[rd >> 1]; m_program->write_qword(m_outp, data); m_outp += 8; break; @@ -189,7 +189,7 @@ void tms32082_mp_device::execute_short_imm() { case 0x02: // cmnd { - UINT32 data = OP_UIMM15(); + uint32_t data = OP_UIMM15(); processor_command(data); break; @@ -198,9 +198,9 @@ void tms32082_mp_device::execute_short_imm() case 0x04: // rdcr { int rd = OP_RD(); - UINT32 imm = OP_UIMM15(); + uint32_t imm = OP_UIMM15(); - UINT32 r = read_creg(imm); + uint32_t r = read_creg(imm); if (rd) m_reg[rd] = r; @@ -211,9 +211,9 @@ void tms32082_mp_device::execute_short_imm() { int rd = OP_RD(); int rs = OP_RS(); - UINT32 imm = OP_UIMM15(); + uint32_t imm = OP_UIMM15(); - UINT32 r = read_creg(imm); + uint32_t r = read_creg(imm); if (rd) m_reg[rd] = r; @@ -231,7 +231,7 @@ void tms32082_mp_device::execute_short_imm() } else { - UINT32 data = read_creg(cr); + uint32_t data = read_creg(cr); m_fetchpc = data & ~3; m_ie = (m_ie & ~1) | (data & 1); // global interrupt mask from creg @@ -246,15 +246,15 @@ void tms32082_mp_device::execute_short_imm() int inv = (m_ir & (1 << 11)); int rot = OP_ROTATE(); int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = SHIFT_MASK[end ? end : 32]; + uint32_t endmask = SHIFT_MASK[end ? end : 32]; if (inv) endmask = ~endmask; - UINT32 compmask = endmask; // shiftmask == 0xffffffff + uint32_t compmask = endmask; // shiftmask == 0xffffffff - UINT32 res; + uint32_t res; if (r) // right { res = ROTATE_R(source, rot) & compmask; @@ -275,15 +275,15 @@ void tms32082_mp_device::execute_short_imm() int inv = (m_ir & (1 << 11)); int rot = OP_ROTATE(); int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = SHIFT_MASK[end ? end : 32]; + uint32_t endmask = SHIFT_MASK[end ? end : 32]; if (inv) endmask = ~endmask; - UINT32 compmask = endmask; // shiftmask == 0xffffffff + uint32_t compmask = endmask; // shiftmask == 0xffffffff - UINT32 res; + uint32_t res; if (r) // right { res = ROTATE_R(source, rot) & compmask; @@ -306,17 +306,17 @@ void tms32082_mp_device::execute_short_imm() int inv = (m_ir & (1 << 11)); int rot = OP_ROTATE(); int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = SHIFT_MASK[end ? end : 32]; + uint32_t endmask = SHIFT_MASK[end ? end : 32]; if (inv) endmask = ~endmask; int shift = r ? 32-rot : rot; - UINT32 shiftmask = SHIFT_MASK[shift ? shift : 32]; - UINT32 compmask = endmask & shiftmask; + uint32_t shiftmask = SHIFT_MASK[shift ? shift : 32]; + uint32_t compmask = endmask & shiftmask; - UINT32 res; + uint32_t res; if (r) // right { res = ROTATE_R(source, rot) & compmask; @@ -337,16 +337,16 @@ void tms32082_mp_device::execute_short_imm() int inv = (m_ir & (1 << 11)); int rot = OP_ROTATE(); int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = SHIFT_MASK[end ? end : 32]; + uint32_t endmask = SHIFT_MASK[end ? end : 32]; if (inv) endmask = ~endmask; - UINT32 shiftmask = SHIFT_MASK[r ? 32-rot : rot]; - UINT32 compmask = endmask & shiftmask; + uint32_t shiftmask = SHIFT_MASK[r ? 32-rot : rot]; + uint32_t compmask = endmask & shiftmask; - UINT32 res; + uint32_t res; if (r) // right { res = (ROTATE_R(source, rot) & compmask) | (m_reg[rd] & ~compmask); @@ -367,17 +367,17 @@ void tms32082_mp_device::execute_short_imm() int inv = (m_ir & (1 << 11)); int rot = OP_ROTATE(); int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = SHIFT_MASK[end ? end : 32]; + uint32_t endmask = SHIFT_MASK[end ? end : 32]; if (inv) endmask = ~endmask; int shift = r ? 32-rot : rot; - UINT32 shiftmask = SHIFT_MASK[shift ? shift : 32]; - UINT32 compmask = endmask & shiftmask; + uint32_t shiftmask = SHIFT_MASK[shift ? shift : 32]; + uint32_t compmask = endmask & shiftmask; - UINT32 res; + uint32_t res; if (r) // right { res = ROTATE_R(source, rot) & compmask; @@ -400,16 +400,16 @@ void tms32082_mp_device::execute_short_imm() int inv = (m_ir & (1 << 11)); int rot = OP_ROTATE(); int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = SHIFT_MASK[end ? end : 32]; + uint32_t endmask = SHIFT_MASK[end ? end : 32]; if (inv) endmask = ~endmask; - UINT32 shiftmask = SHIFT_MASK[r ? 32-rot : rot]; - UINT32 compmask = endmask & ~shiftmask; + uint32_t shiftmask = SHIFT_MASK[r ? 32-rot : rot]; + uint32_t compmask = endmask & ~shiftmask; - UINT32 res; + uint32_t res; if (r) // right { res = ROTATE_R(source, rot) & compmask; @@ -430,16 +430,16 @@ void tms32082_mp_device::execute_short_imm() int inv = (m_ir & (1 << 11)); int rot = OP_ROTATE(); int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = SHIFT_MASK[end ? end : 32]; + uint32_t endmask = SHIFT_MASK[end ? end : 32]; if (inv) endmask = ~endmask; - UINT32 shiftmask = SHIFT_MASK[r ? 32-rot : rot]; - UINT32 compmask = endmask & ~shiftmask; + uint32_t shiftmask = SHIFT_MASK[r ? 32-rot : rot]; + uint32_t compmask = endmask & ~shiftmask; - UINT32 res; + uint32_t res; if (r) // right { res = (ROTATE_R(source, rot) & compmask) | (m_reg[rd] & ~compmask); @@ -458,7 +458,7 @@ void tms32082_mp_device::execute_short_imm() { int rd = OP_RD(); int rs = OP_RS(); - UINT32 imm = OP_UIMM15(); + uint32_t imm = OP_UIMM15(); if (rd) m_reg[rd] = m_reg[rs] & imm; @@ -469,7 +469,7 @@ void tms32082_mp_device::execute_short_imm() { int rd = OP_RD(); int rs = OP_RS(); - UINT32 imm = OP_UIMM15(); + uint32_t imm = OP_UIMM15(); if (rd) m_reg[rd] = ~m_reg[rs] & imm; @@ -480,7 +480,7 @@ void tms32082_mp_device::execute_short_imm() { int rd = OP_RD(); int rs = OP_RS(); - UINT32 imm = OP_UIMM15(); + uint32_t imm = OP_UIMM15(); if (rd) m_reg[rd] = m_reg[rs] & ~imm; @@ -491,7 +491,7 @@ void tms32082_mp_device::execute_short_imm() { int rd = OP_RD(); int rs = OP_RS(); - UINT32 imm = OP_UIMM15(); + uint32_t imm = OP_UIMM15(); if (rd) m_reg[rd] = m_reg[rs] | imm; @@ -502,7 +502,7 @@ void tms32082_mp_device::execute_short_imm() { int rd = OP_RD(); int rs = OP_RS(); - UINT32 imm = OP_UIMM15(); + uint32_t imm = OP_UIMM15(); if (rd) m_reg[rd] = m_reg[rs] | ~imm; @@ -515,10 +515,10 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; - UINT32 data = (UINT8)m_program->read_byte(address); + uint32_t address = m_reg[base] + offset; + uint32_t data = (uint8_t)m_program->read_byte(address); if (data & 0x80) data |= 0xffffff00; if (rd) m_reg[rd] = data; @@ -534,10 +534,10 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; - UINT32 data = (UINT16)m_program->read_word(address); + uint32_t address = m_reg[base] + offset; + uint32_t data = (uint16_t)m_program->read_word(address); if (data & 0x8000) data |= 0xffff0000; if (rd) m_reg[rd] = data; @@ -553,10 +553,10 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; - UINT32 data = m_program->read_dword(address); + uint32_t address = m_reg[base] + offset; + uint32_t data = m_program->read_dword(address); if (rd) m_reg[rd] = data; @@ -571,11 +571,11 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; - UINT32 data1 = m_program->read_dword(address); - UINT32 data2 = m_program->read_dword(address+4); + uint32_t address = m_reg[base] + offset; + uint32_t data1 = m_program->read_dword(address); + uint32_t data2 = m_program->read_dword(address+4); if (rd) { m_reg[(rd & ~1)+1] = data1; @@ -593,10 +593,10 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; - UINT32 data = (UINT8)(m_program->read_byte(address)); + uint32_t address = m_reg[base] + offset; + uint32_t data = (uint8_t)(m_program->read_byte(address)); if (rd) m_reg[rd] = data; @@ -611,10 +611,10 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; - UINT32 data = (UINT16)(m_program->read_word(address)); + uint32_t address = m_reg[base] + offset; + uint32_t data = (uint16_t)(m_program->read_word(address)); if (rd) m_reg[rd] = data; @@ -629,11 +629,11 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; + uint32_t address = m_reg[base] + offset; - m_program->write_byte(address, (UINT8)(m_reg[rd])); + m_program->write_byte(address, (uint8_t)(m_reg[rd])); if (m && base) m_reg[base] = address; @@ -646,11 +646,11 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; + uint32_t address = m_reg[base] + offset; - m_program->write_word(address, (UINT16)(m_reg[rd])); + m_program->write_word(address, (uint16_t)(m_reg[rd])); if (m && base) m_reg[base] = address; @@ -663,9 +663,9 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; + uint32_t address = m_reg[base] + offset; m_program->write_dword(address, m_reg[rd]); @@ -680,9 +680,9 @@ void tms32082_mp_device::execute_short_imm() int rd = OP_RD(); int base = OP_BASE(); int m = m_ir & (1 << 17); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); - UINT32 address = m_reg[base] + offset; + uint32_t address = m_reg[base] + offset; m_program->write_dword(address+0, m_reg[(rd & ~1) + 1]); m_program->write_dword(address+4, m_reg[rd & ~1]); @@ -696,7 +696,7 @@ void tms32082_mp_device::execute_short_imm() { int link = OP_LINK(); int base = OP_BASE(); - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); if (link) m_reg[link] = m_fetchpc; @@ -708,12 +708,12 @@ void tms32082_mp_device::execute_short_imm() case 0x48: // bbz { int bitnum = OP_BITNUM() ^ 0x1f; - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); int rs = OP_RS(); if ((m_reg[rs] & (1 << bitnum)) == 0) { - UINT32 address = m_pc + (offset * 4); + uint32_t address = m_pc + (offset * 4); m_pc = m_fetchpc; delay_slot(); @@ -726,7 +726,7 @@ void tms32082_mp_device::execute_short_imm() case 0x49: // bbz.a { int bitnum = OP_BITNUM() ^ 0x1f; - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); int rs = OP_RS(); if ((m_reg[rs] & (1 << bitnum)) == 0) @@ -739,12 +739,12 @@ void tms32082_mp_device::execute_short_imm() case 0x4a: // bbo { int bitnum = OP_BITNUM() ^ 0x1f; - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); int rs = OP_RS(); if ((m_reg[rs] & (1 << bitnum)) != 0) { - UINT32 address = m_pc + (offset * 4); + uint32_t address = m_pc + (offset * 4); m_pc = m_fetchpc; delay_slot(); @@ -757,7 +757,7 @@ void tms32082_mp_device::execute_short_imm() case 0x4b: // bbo.a { int bitnum = OP_BITNUM() ^ 0x1f; - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); int rs = OP_RS(); if ((m_reg[rs] & (1 << bitnum)) != 0) @@ -769,13 +769,13 @@ void tms32082_mp_device::execute_short_imm() case 0x4c: // bcnd { - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); int code = OP_RD(); int rs = OP_RS(); if (test_condition(code, m_reg[rs])) { - UINT32 address = m_pc + (offset * 4); + uint32_t address = m_pc + (offset * 4); m_pc = m_fetchpc; delay_slot(); @@ -787,7 +787,7 @@ void tms32082_mp_device::execute_short_imm() case 0x4d: // bcnd.a { - INT32 offset = OP_SIMM15(); + int32_t offset = OP_SIMM15(); int code = OP_RD(); int rs = OP_RS(); @@ -800,8 +800,8 @@ void tms32082_mp_device::execute_short_imm() case 0x50: // cmp { - UINT32 src1 = OP_SIMM15(); - UINT32 src2 = m_reg[OP_RS()]; + uint32_t src1 = OP_SIMM15(); + uint32_t src2 = m_reg[OP_RS()]; int rd = OP_RD(); if (rd) @@ -811,7 +811,7 @@ void tms32082_mp_device::execute_short_imm() case 0x58: // add { - INT32 imm = OP_SIMM15(); + int32_t imm = OP_SIMM15(); int rd = OP_RD(); int rs = OP_RS(); @@ -824,7 +824,7 @@ void tms32082_mp_device::execute_short_imm() case 0x59: // addu { - INT32 imm = OP_SIMM15(); + int32_t imm = OP_SIMM15(); int rd = OP_RD(); int rs = OP_RS(); @@ -835,7 +835,7 @@ void tms32082_mp_device::execute_short_imm() case 0x5a: // sub { - INT32 imm = OP_SIMM15(); + int32_t imm = OP_SIMM15(); int rd = OP_RD(); int rs = OP_RS(); @@ -848,7 +848,7 @@ void tms32082_mp_device::execute_short_imm() case 0x5b: // subu { - INT32 imm = OP_SIMM15(); + int32_t imm = OP_SIMM15(); int rd = OP_RD(); int rs = OP_RS(); @@ -864,7 +864,7 @@ void tms32082_mp_device::execute_short_imm() void tms32082_mp_device::execute_reg_long_imm() { - UINT32 imm32 = 0; + uint32_t imm32 = 0; int has_imm = (m_ir & (1 << 12)); @@ -875,7 +875,7 @@ void tms32082_mp_device::execute_reg_long_imm() { case 0x04: // cmnd { - UINT32 data = has_imm ? imm32 : m_reg[OP_SRC1()]; + uint32_t data = has_imm ? imm32 : m_reg[OP_SRC1()]; processor_command(data); break; @@ -887,17 +887,17 @@ void tms32082_mp_device::execute_reg_long_imm() int inv = (m_ir & (1 << 11)); int rot = m_reg[OP_ROTATE()]; int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = end ? SHIFT_MASK[end ? end : 32] : m_reg[OP_ROTATE()+1]; + uint32_t endmask = end ? SHIFT_MASK[end ? end : 32] : m_reg[OP_ROTATE()+1]; if (inv) endmask = ~endmask; int shift = r ? 32-rot : rot; - UINT32 shiftmask = SHIFT_MASK[shift ? shift : 32]; - UINT32 compmask = endmask & shiftmask; + uint32_t shiftmask = SHIFT_MASK[shift ? shift : 32]; + uint32_t compmask = endmask & shiftmask; - UINT32 res; + uint32_t res; if (r) // right { res = ROTATE_R(source, rot) & compmask; @@ -918,17 +918,17 @@ void tms32082_mp_device::execute_reg_long_imm() int inv = (m_ir & (1 << 11)); int rot = m_reg[OP_ROTATE()]; int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = end ? SHIFT_MASK[end ? end : 32] : m_reg[OP_ROTATE()+1]; + uint32_t endmask = end ? SHIFT_MASK[end ? end : 32] : m_reg[OP_ROTATE()+1]; if (inv) endmask = ~endmask; int shift = r ? 32-rot : rot; - UINT32 shiftmask = SHIFT_MASK[shift ? shift : 32]; - UINT32 compmask = endmask & shiftmask; + uint32_t shiftmask = SHIFT_MASK[shift ? shift : 32]; + uint32_t compmask = endmask & shiftmask; - UINT32 res; + uint32_t res; if (r) // right { res = ROTATE_R(source, rot) & compmask; @@ -950,17 +950,17 @@ void tms32082_mp_device::execute_reg_long_imm() int inv = (m_ir & (1 << 11)); int rot = m_reg[OP_ROTATE()]; int end = OP_ENDMASK(); - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); - UINT32 endmask = end ? SHIFT_MASK[end ? end : 32] : m_reg[OP_ROTATE()+1]; + uint32_t endmask = end ? SHIFT_MASK[end ? end : 32] : m_reg[OP_ROTATE()+1]; if (inv) endmask = ~endmask; int shift = r ? 32-rot : rot; - UINT32 shiftmask = SHIFT_MASK[shift ? shift : 32]; - UINT32 compmask = endmask & ~shiftmask; + uint32_t shiftmask = SHIFT_MASK[shift ? shift : 32]; + uint32_t compmask = endmask & ~shiftmask; - UINT32 res; + uint32_t res; if (r) // right { res = ROTATE_R(source, rot) & compmask; @@ -980,7 +980,7 @@ void tms32082_mp_device::execute_reg_long_imm() { int rd = OP_RD(); int rs = OP_RS(); - UINT32 src1 = has_imm ? imm32 : m_reg[OP_SRC1()]; + uint32_t src1 = has_imm ? imm32 : m_reg[OP_SRC1()]; if (rd) m_reg[rd] = src1 & m_reg[rs]; @@ -992,7 +992,7 @@ void tms32082_mp_device::execute_reg_long_imm() { int rd = OP_RD(); int rs = OP_RS(); - UINT32 src1 = has_imm ? imm32 : m_reg[OP_SRC1()]; + uint32_t src1 = has_imm ? imm32 : m_reg[OP_SRC1()]; if (rd) m_reg[rd] = src1 & ~(m_reg[rs]); @@ -1042,8 +1042,8 @@ void tms32082_mp_device::execute_reg_long_imm() int base = OP_BASE(); int rd = OP_RD(); - UINT32 address = m_reg[base] + (has_imm ? imm32 : m_reg[OP_SRC1()]); - UINT32 r = m_program->read_byte(address); + uint32_t address = m_reg[base] + (has_imm ? imm32 : m_reg[OP_SRC1()]); + uint32_t r = m_program->read_byte(address); if (r & 0x80) r |= 0xffffff00; if (rd) @@ -1065,8 +1065,8 @@ void tms32082_mp_device::execute_reg_long_imm() int base = OP_BASE(); int rd = OP_RD(); - UINT32 address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); - UINT32 r = m_program->read_word(address); + uint32_t address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); + uint32_t r = m_program->read_word(address); if (r & 0x8000) r |= 0xffff0000; if (rd) @@ -1087,8 +1087,8 @@ void tms32082_mp_device::execute_reg_long_imm() int base = OP_BASE(); int rd = OP_RD(); - UINT32 address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); - UINT32 r = m_program->read_dword(address); + uint32_t address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); + uint32_t r = m_program->read_dword(address); if (rd) m_reg[rd] = r; @@ -1108,8 +1108,8 @@ void tms32082_mp_device::execute_reg_long_imm() int base = OP_BASE(); int rd = OP_RD(); - UINT32 address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); - UINT64 r = m_program->read_qword(address); + uint32_t address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); + uint64_t r = m_program->read_qword(address); if (rd) m_fpair[rd >> 1] = r; @@ -1128,8 +1128,8 @@ void tms32082_mp_device::execute_reg_long_imm() int base = OP_BASE(); int rd = OP_RD(); - UINT32 address = m_reg[base] + (has_imm ? imm32 : m_reg[OP_SRC1()]); - UINT32 r = (UINT8)(m_program->read_byte(address)); + uint32_t address = m_reg[base] + (has_imm ? imm32 : m_reg[OP_SRC1()]); + uint32_t r = (uint8_t)(m_program->read_byte(address)); if (rd) m_reg[rd] = r; @@ -1149,8 +1149,8 @@ void tms32082_mp_device::execute_reg_long_imm() int base = OP_BASE(); int rd = OP_RD(); - UINT32 address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); - UINT32 r = (UINT16)(m_program->read_word(address)); + uint32_t address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); + uint32_t r = (uint16_t)(m_program->read_word(address)); if (rd) m_reg[rd] = r; @@ -1169,8 +1169,8 @@ void tms32082_mp_device::execute_reg_long_imm() int base = OP_BASE(); - UINT32 address = m_reg[base] + (has_imm ? imm32 : m_reg[OP_SRC1()]); - m_program->write_byte(address, (UINT8)(m_reg[OP_RD()])); + uint32_t address = m_reg[base] + (has_imm ? imm32 : m_reg[OP_SRC1()]); + m_program->write_byte(address, (uint8_t)(m_reg[OP_RD()])); if (m && base) m_reg[base] = address; @@ -1187,8 +1187,8 @@ void tms32082_mp_device::execute_reg_long_imm() int base = OP_BASE(); - UINT32 address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); - m_program->write_word(address, (UINT16)(m_reg[OP_RD()])); + uint32_t address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); + m_program->write_word(address, (uint16_t)(m_reg[OP_RD()])); if (m && base) m_reg[base] = address; @@ -1205,7 +1205,7 @@ void tms32082_mp_device::execute_reg_long_imm() int base = OP_BASE(); - UINT32 address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); + uint32_t address = m_reg[base] + ((has_imm ? imm32 : m_reg[OP_SRC1()]) << shift); m_program->write_dword(address, m_reg[OP_RD()]); if (m && base) @@ -1222,7 +1222,7 @@ void tms32082_mp_device::execute_reg_long_imm() if (link) m_reg[link] = m_fetchpc + 4; - UINT32 address = m_reg[base] + (has_imm ? imm32 : m_reg[OP_SRC1()]); + uint32_t address = m_reg[base] + (has_imm ? imm32 : m_reg[OP_SRC1()]); m_pc = m_fetchpc; delay_slot(); @@ -1248,8 +1248,8 @@ void tms32082_mp_device::execute_reg_long_imm() case 0xa1: // cmp { int rd = OP_RD(); - UINT32 src1 = has_imm ? imm32 : m_reg[OP_SRC1()]; - UINT32 src2 = m_reg[OP_RS()]; + uint32_t src1 = has_imm ? imm32 : m_reg[OP_SRC1()]; + uint32_t src2 = m_reg[OP_RS()]; if (rd) m_reg[rd] = calculate_cmp(src1, src2); @@ -1354,10 +1354,10 @@ void tms32082_mp_device::execute_reg_long_imm() m_fpair[rd >> 1] = d2u(source); break; case 2: - m_reg[rd] = (INT32)(source); + m_reg[rd] = (int32_t)(source); break; case 3: - m_reg[rd] = (UINT32)(source); + m_reg[rd] = (uint32_t)(source); break; } } @@ -1487,7 +1487,7 @@ void tms32082_mp_device::execute_reg_long_imm() { float s1 = u2f(has_imm ? imm32 : m_reg[src1]); float s2 = u2f(m_reg[rs]); - UINT64 res = d2u((double)(s1 + s2)); + uint64_t res = d2u((double)(s1 + s2)); m_fpair[rd >> 1] = res; break; } @@ -1495,7 +1495,7 @@ void tms32082_mp_device::execute_reg_long_imm() { float s1 = u2f(has_imm ? imm32 : m_reg[src1]); double s2 = u2d(m_fpair[rs >> 1]); - UINT64 res = d2u((double) s1 + s2); + uint64_t res = d2u((double) s1 + s2); m_fpair[rd >> 1] = res; break; } @@ -1503,7 +1503,7 @@ void tms32082_mp_device::execute_reg_long_imm() { double s1 = u2d(m_fpair[src1 >> 1]); float s2 = u2f(m_reg[rs]); - UINT64 res = d2u(s1 + (double) s2); + uint64_t res = d2u(s1 + (double) s2); m_fpair[rd >> 1] = res; break; } @@ -1511,7 +1511,7 @@ void tms32082_mp_device::execute_reg_long_imm() { double s1 = u2d(m_fpair[src1 >> 1]); double s2 = u2d(m_fpair[rs >> 1]); - UINT64 res = d2u((double)(s1 + s2)); + uint64_t res = d2u((double)(s1 + s2)); m_fpair[rd >> 1] = res; break; } @@ -1545,7 +1545,7 @@ void tms32082_mp_device::execute_reg_long_imm() { float s1 = u2f(has_imm ? imm32 : m_reg[src1]); float s2 = u2f(m_reg[rs]); - UINT64 res = d2u((double)(s1 - s2)); + uint64_t res = d2u((double)(s1 - s2)); m_fpair[rd >> 1] = res; break; } @@ -1553,7 +1553,7 @@ void tms32082_mp_device::execute_reg_long_imm() { float s1 = u2f(has_imm ? imm32 : m_reg[src1]); double s2 = u2d(m_fpair[rs >> 1]); - UINT64 res = d2u((double) s1 - s2); + uint64_t res = d2u((double) s1 - s2); m_fpair[rd >> 1] = res; break; } @@ -1561,7 +1561,7 @@ void tms32082_mp_device::execute_reg_long_imm() { double s1 = u2d(m_fpair[src1 >> 1]); float s2 = u2f(m_reg[rs]); - UINT64 res = d2u(s1 - (double) s2); + uint64_t res = d2u(s1 - (double) s2); m_fpair[rd >> 1] = res; break; } @@ -1569,7 +1569,7 @@ void tms32082_mp_device::execute_reg_long_imm() { double s1 = u2d(m_fpair[src1 >> 1]); double s2 = u2d(m_fpair[rs >> 1]); - UINT64 res = d2u((double)(s1 - s2)); + uint64_t res = d2u((double)(s1 - s2)); m_fpair[rd >> 1] = res; break; } @@ -1603,7 +1603,7 @@ void tms32082_mp_device::execute_reg_long_imm() { float s1 = u2f(has_imm ? imm32 : m_reg[src1]); float s2 = u2f(m_reg[rs]); - UINT64 res = d2u((double)(s1 * s2)); + uint64_t res = d2u((double)(s1 * s2)); m_fpair[rd >> 1] = res; break; } @@ -1611,7 +1611,7 @@ void tms32082_mp_device::execute_reg_long_imm() { float s1 = u2f(has_imm ? imm32 : m_reg[src1]); double s2 = u2d(m_fpair[rs >> 1]); - UINT64 res = d2u((double)s1 * s2); + uint64_t res = d2u((double)s1 * s2); m_fpair[rd >> 1] = res; break; } @@ -1619,7 +1619,7 @@ void tms32082_mp_device::execute_reg_long_imm() { double s1 = u2d(m_fpair[src1 >> 1]); float s2 = u2f(m_reg[rs]); - UINT64 res = d2u(s1 * (double) s2); + uint64_t res = d2u(s1 * (double) s2); m_fpair[rd >> 1] = res; break; } @@ -1627,18 +1627,18 @@ void tms32082_mp_device::execute_reg_long_imm() { double s1 = u2d(m_fpair[src1 >> 1]); double s2 = u2d(m_fpair[rs >> 1]); - UINT64 res = d2u(s1 * s2); + uint64_t res = d2u(s1 * s2); m_fpair[rd >> 1] = res; break; } case 0x2a: // I x I -> I { - m_reg[rd] = (INT32)(m_reg[rs]) * (INT32)(has_imm ? imm32 : m_reg[OP_SRC1()]); + m_reg[rd] = (int32_t)(m_reg[rs]) * (int32_t)(has_imm ? imm32 : m_reg[OP_SRC1()]); break; } case 0x3f: // U x U -> U { - m_reg[rd] = (UINT32)(m_reg[rs]) * (UINT32)(has_imm ? imm32 : m_reg[OP_SRC1()]); + m_reg[rd] = (uint32_t)(m_reg[rs]) * (uint32_t)(has_imm ? imm32 : m_reg[OP_SRC1()]); break; } default: @@ -1697,10 +1697,10 @@ void tms32082_mp_device::execute_reg_long_imm() s = u2d(m_fpair[src1 >> 1]); break; case 2: - s = has_imm ? (double)((INT32)(imm32)) : (double)(INT32)(m_reg[src1]); + s = has_imm ? (double)((int32_t)(imm32)) : (double)(int32_t)(m_reg[src1]); break; case 3: - s = has_imm ? (double)((UINT32)(imm32)) : (double)(UINT32)(m_reg[src1]); + s = has_imm ? (double)((uint32_t)(imm32)) : (double)(uint32_t)(m_reg[src1]); break; } @@ -1717,10 +1717,10 @@ void tms32082_mp_device::execute_reg_long_imm() m_fpair[rd >> 1] = d2u(s); break; case 2: - m_reg[rd] = (INT32)(s); + m_reg[rd] = (int32_t)(s); break; case 3: - m_reg[rd] = (UINT32)(s); + m_reg[rd] = (uint32_t)(s); break; } } @@ -1741,7 +1741,7 @@ void tms32082_mp_device::execute_reg_long_imm() if (rd) { - UINT32 flags = 0; + uint32_t flags = 0; flags |= (src1 == src2) ? (1 << 20) : 0; flags |= (src1 != src2) ? (1 << 21) : 0; flags |= (src1 > src2) ? (1 << 22) : 0; @@ -1787,7 +1787,7 @@ void tms32082_mp_device::execute_reg_long_imm() case 0xf2: // rmo { - UINT32 source = m_reg[OP_RS()]; + uint32_t source = m_reg[OP_RS()]; int rd = OP_RD(); int bit = 32; diff --git a/src/devices/cpu/tms32082/tms32082.cpp b/src/devices/cpu/tms32082/tms32082.cpp index 3d788a19aa2..a505a6a2045 100644 --- a/src/devices/cpu/tms32082/tms32082.cpp +++ b/src/devices/cpu/tms32082/tms32082.cpp @@ -33,7 +33,7 @@ static ADDRESS_MAP_START(mp_internal_map, AS_PROGRAM, 32, tms32082_mp_device) AM_RANGE(0x01010000, 0x010107ff) AM_READWRITE(mp_param_r, mp_param_w) ADDRESS_MAP_END -const UINT32 tms32082_mp_device::SHIFT_MASK[] = +const uint32_t tms32082_mp_device::SHIFT_MASK[] = { 0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, @@ -44,14 +44,14 @@ const UINT32 tms32082_mp_device::SHIFT_MASK[] = -tms32082_mp_device::tms32082_mp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32082_mp_device::tms32082_mp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, TMS32082_MP, "TMS32082 MP", tag, owner, clock, "tms32082_mp", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 32, 32, 0, ADDRESS_MAP_NAME(mp_internal_map)) { } -offs_t tms32082_mp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms32082_mp_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(tms32082_mp)(this, buffer, pc, oprom, opram, options); } @@ -80,22 +80,22 @@ WRITE32_MEMBER(tms32082_mp_device::mp_param_w) { // initiate Transfer Controller operation // TODO: move TC functionality to separate device - UINT32 address = data; - - UINT32 next_entry = m_program->read_dword(address + 0); - UINT32 pt_options = m_program->read_dword(address + 4); - UINT32 src_addr = m_program->read_dword(address + 8); - UINT32 dst_addr = m_program->read_dword(address + 12); - UINT32 src_b_count = m_program->read_word(address + 16); - UINT32 src_a_count = m_program->read_word(address + 18); - UINT32 dst_b_count = m_program->read_word(address + 20); - UINT32 dst_a_count = m_program->read_word(address + 22); - UINT32 src_c_count = m_program->read_dword(address + 24); - UINT32 dst_c_count = m_program->read_dword(address + 28); - UINT32 src_b_pitch = m_program->read_dword(address + 32); - UINT32 dst_b_pitch = m_program->read_dword(address + 36); - UINT32 src_c_pitch = m_program->read_dword(address + 40); - UINT32 dst_c_pitch = m_program->read_dword(address + 44); + uint32_t address = data; + + uint32_t next_entry = m_program->read_dword(address + 0); + uint32_t pt_options = m_program->read_dword(address + 4); + uint32_t src_addr = m_program->read_dword(address + 8); + uint32_t dst_addr = m_program->read_dword(address + 12); + uint32_t src_b_count = m_program->read_word(address + 16); + uint32_t src_a_count = m_program->read_word(address + 18); + uint32_t dst_b_count = m_program->read_word(address + 20); + uint32_t dst_a_count = m_program->read_word(address + 22); + uint32_t src_c_count = m_program->read_dword(address + 24); + uint32_t dst_c_count = m_program->read_dword(address + 28); + uint32_t src_b_pitch = m_program->read_dword(address + 32); + uint32_t dst_b_pitch = m_program->read_dword(address + 36); + uint32_t src_c_pitch = m_program->read_dword(address + 40); + uint32_t dst_c_pitch = m_program->read_dword(address + 44); printf("TC operation:\n"); printf(" Next entry: %08X\n", next_entry); @@ -116,20 +116,20 @@ WRITE32_MEMBER(tms32082_mp_device::mp_param_w) for (int ic = 0; ic <= src_c_count; ic++) { - UINT32 c_src_offset = ic * src_c_pitch; - UINT32 c_dst_offset = ic * dst_c_pitch; + uint32_t c_src_offset = ic * src_c_pitch; + uint32_t c_dst_offset = ic * dst_c_pitch; for (int ib = 0; ib <= src_b_count; ib++) { - UINT32 b_src_offset = ib * src_b_pitch; - UINT32 b_dst_offset = ib * dst_b_pitch; + uint32_t b_src_offset = ib * src_b_pitch; + uint32_t b_dst_offset = ib * dst_b_pitch; for (int ia = 0; ia < src_a_count; ia++) { - UINT32 src = src_addr + c_src_offset + b_src_offset + ia; - UINT32 dst = dst_addr + c_dst_offset + b_dst_offset + ia; + uint32_t src = src_addr + c_src_offset + b_src_offset + ia; + uint32_t dst = dst_addr + c_dst_offset + b_dst_offset + ia; - UINT32 data = m_program->read_byte(src); + uint32_t data = m_program->read_byte(src); m_program->write_byte(dst, data); //printf("%08X: %02X -> %08X\n", src, data, dst); @@ -248,7 +248,7 @@ void tms32082_mp_device::device_reset() m_ie = 0; } -void tms32082_mp_device::processor_command(UINT32 command) +void tms32082_mp_device::processor_command(uint32_t command) { printf("MP CMND %08X: ", command); @@ -290,7 +290,7 @@ void tms32082_mp_device::processor_command(UINT32 command) printf("\n"); } -UINT32 tms32082_mp_device::read_creg(int reg) +uint32_t tms32082_mp_device::read_creg(int reg) { switch (reg) { @@ -328,7 +328,7 @@ UINT32 tms32082_mp_device::read_creg(int reg) return 0; } -void tms32082_mp_device::write_creg(int reg, UINT32 data) +void tms32082_mp_device::write_creg(int reg, uint32_t data) { switch (reg) { @@ -425,9 +425,9 @@ void tms32082_mp_device::execute_set_input(int inputnum, int state) } } -UINT32 tms32082_mp_device::fetch() +uint32_t tms32082_mp_device::fetch() { - UINT32 w = m_direct->read_dword(m_fetchpc); + uint32_t w = m_direct->read_dword(m_fetchpc); m_fetchpc += 4; return w; } @@ -482,14 +482,14 @@ static ADDRESS_MAP_START(pp_internal_map, AS_PROGRAM, 32, tms32082_pp_device) AM_RANGE(0x01001000, 0x01001fff) AM_RAM AM_SHARE("pp1_param") ADDRESS_MAP_END -tms32082_pp_device::tms32082_pp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms32082_pp_device::tms32082_pp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, TMS32082_PP, "TMS32082 PP", tag, owner, clock, "tms32082_pp", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 32, 32, 0, ADDRESS_MAP_NAME(pp_internal_map)) { } -offs_t tms32082_pp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms32082_pp_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { return CPU_DISASSEMBLE_NAME(tms32082_pp)(this, buffer, pc, oprom, opram, options); } diff --git a/src/devices/cpu/tms32082/tms32082.h b/src/devices/cpu/tms32082/tms32082.h index 80163cc6145..0a315d6b79d 100644 --- a/src/devices/cpu/tms32082/tms32082.h +++ b/src/devices/cpu/tms32082/tms32082.h @@ -10,7 +10,7 @@ class tms32082_mp_device : public cpu_device { public: // construction/destruction - tms32082_mp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms32082_mp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); enum { @@ -80,9 +80,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -100,41 +100,41 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; - static const UINT32 SHIFT_MASK[33]; + static const uint32_t SHIFT_MASK[33]; - UINT32 m_pc; - UINT32 m_fetchpc; + uint32_t m_pc; + uint32_t m_fetchpc; union { - UINT32 m_reg[32]; - UINT64 m_fpair[16]; + uint32_t m_reg[32]; + uint64_t m_fpair[16]; }; union { - UINT64 m_acc[4]; + uint64_t m_acc[4]; double m_facc[4]; }; - UINT32 m_ir; + uint32_t m_ir; - UINT32 m_in0p; - UINT32 m_in1p; - UINT32 m_outp; - UINT32 m_ie; - UINT32 m_intpen; - UINT32 m_epc; - UINT32 m_eip; + uint32_t m_in0p; + uint32_t m_in1p; + uint32_t m_outp; + uint32_t m_ie; + uint32_t m_intpen; + uint32_t m_epc; + uint32_t m_eip; - UINT32 m_tcount; - UINT32 m_tscale; + uint32_t m_tcount; + uint32_t m_tscale; - UINT32 m_param_ram[0x800]; + uint32_t m_param_ram[0x800]; int m_icount; @@ -144,16 +144,16 @@ protected: write32_delegate m_cmd_callback; void check_interrupts(); - void processor_command(UINT32 command); - UINT32 fetch(); + void processor_command(uint32_t command); + uint32_t fetch(); void delay_slot(); void execute(); void execute_short_imm(); void execute_reg_long_imm(); - UINT32 read_creg(int reg); - void write_creg(int reg, UINT32 data); - bool test_condition(int condition, UINT32 value); - UINT32 calculate_cmp(UINT32 src1, UINT32 src2); + uint32_t read_creg(int reg); + void write_creg(int reg, uint32_t data); + bool test_condition(int condition, uint32_t value); + uint32_t calculate_cmp(uint32_t src1, uint32_t src2); void vector_loadstore(); }; @@ -163,7 +163,7 @@ class tms32082_pp_device : public cpu_device { public: // construction/destruction - tms32082_pp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms32082_pp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); enum { @@ -176,9 +176,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; // device_memory_interface overrides @@ -195,14 +195,14 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 8; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 8; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; - UINT32 m_pc; - UINT32 m_fetchpc; + uint32_t m_pc; + uint32_t m_fetchpc; int m_icount; diff --git a/src/devices/cpu/tms34010/34010dsm.cpp b/src/devices/cpu/tms34010/34010dsm.cpp index 15136885da4..70fbabc58db 100644 --- a/src/devices/cpu/tms34010/34010dsm.cpp +++ b/src/devices/cpu/tms34010/34010dsm.cpp @@ -21,19 +21,19 @@ #define PARAM_LONG(v) { v = rambase[(__pc + 16 - pcbase) >> 3] | (rambase[(__pc + 24 - pcbase) >> 3] << 8) | (rambase[(__pc + 32 - pcbase) >> 3] << 16) | (rambase[(__pc + 40 - pcbase) >> 3] << 24); _pc += 32; } #endif -static UINT8 rf; -static UINT32 __pc, _pc; -static UINT16 op,rs,rd; +static uint8_t rf; +static uint32_t __pc, _pc; +static uint16_t op,rs,rd; static char *buffer; static char temp[20]; -static const UINT8 *rombase; -static const UINT8 *rambase; +static const uint8_t *rombase; +static const uint8_t *rambase; static offs_t pcbase; -static void print_reg(UINT8 reg) +static void print_reg(uint8_t reg) { if (reg != 0x0f) { @@ -65,7 +65,7 @@ static void print_src_des_reg(void) static void print_word_parm(void) { - UINT16 w; + uint16_t w; PARAM_WORD(w); @@ -75,7 +75,7 @@ static void print_word_parm(void) static void print_word_parm_1s_comp(void) { - UINT16 w; + uint16_t w; PARAM_WORD(w); w = ~w; @@ -85,7 +85,7 @@ static void print_word_parm_1s_comp(void) static void print_long_parm(void) { - UINT32 l; + uint32_t l; PARAM_LONG(l); sprintf(temp, "%Xh", l); @@ -94,7 +94,7 @@ static void print_long_parm(void) static void print_long_parm_1s_comp(void) { - UINT32 l; + uint32_t l; PARAM_LONG(l); sprintf(temp, "%Xh", ~l); @@ -103,7 +103,7 @@ static void print_long_parm_1s_comp(void) static void print_constant(void) { - UINT8 constant = (op >> 5) & 0x1f; + uint8_t constant = (op >> 5) & 0x1f; sprintf(temp, "%Xh", constant); strcat(buffer, temp); @@ -111,7 +111,7 @@ static void print_constant(void) static void print_constant_1_32(void) { - UINT8 constant = (op >> 5) & 0x1f; + uint8_t constant = (op >> 5) & 0x1f; if (!constant) constant = 0x20; sprintf(temp, "%Xh", constant); @@ -120,7 +120,7 @@ static void print_constant_1_32(void) static void print_constant_1s_comp(void) { - UINT8 constant = (~op >> 5) & 0x1f; + uint8_t constant = (~op >> 5) & 0x1f; sprintf(temp, "%Xh", constant); strcat(buffer, temp); @@ -128,7 +128,7 @@ static void print_constant_1s_comp(void) static void print_constant_2s_comp(void) { - UINT8 constant = 32 - ((op >> 5) & 0x1f); + uint8_t constant = 32 - ((op >> 5) & 0x1f); sprintf(temp, "%Xh", constant); strcat(buffer, temp); @@ -136,11 +136,11 @@ static void print_constant_2s_comp(void) static void print_relative(void) { - UINT16 l; - INT16 ls; + uint16_t l; + int16_t ls; PARAM_WORD(l); - ls = (INT16)l; + ls = (int16_t)l; sprintf(temp, "%Xh", PC + 32 + (ls << 4)); strcat(buffer, temp); @@ -148,7 +148,7 @@ static void print_relative(void) static void print_relative_8bit(void) { - INT8 ls = (INT8)op; + int8_t ls = (int8_t)op; sprintf(temp, "%Xh", PC + 16 + (ls << 4)); strcat(buffer, temp); @@ -156,7 +156,7 @@ static void print_relative_8bit(void) static void print_relative_5bit(void) { - INT8 ls = (INT8)((op >> 5) & 0x1f); + int8_t ls = (int8_t)((op >> 5) & 0x1f); if (op & 0x0400) ls = -ls; sprintf(temp, "%Xh", PC + 16 + (ls << 4)); @@ -192,7 +192,7 @@ static void print_condition_code(void) } } -static void print_reg_list_range(INT8 first, INT8 last) +static void print_reg_list_range(int8_t first, int8_t last) { if ((first != -1 ) && (first != last)) { @@ -204,11 +204,11 @@ static void print_reg_list_range(INT8 first, INT8 last) } } -static void print_reg_list(UINT16 rev) +static void print_reg_list(uint16_t rev) { - UINT16 l; - UINT8 i; - INT8 first = -1, last = 0; + uint16_t l; + uint8_t i; + int8_t first = -1, last = 0; PARAM_WORD(l); @@ -248,11 +248,11 @@ static void print_reg_list(UINT16 rev) } -static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) +static unsigned Dasm340x0(char *buff, uint32_t pc, int is_34020) { int flags = 0; - UINT8 bad = 0; - UINT16 subop; + uint8_t bad = 0; + uint16_t subop; __pc = _pc = pc; buffer = buff; @@ -444,7 +444,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0x0000: if (is_34020 && (op & 0xfe00) == 0x0600) { - UINT32 x; + uint32_t x; PARAM_LONG(x); sprintf(buffer, "CEXEC %d,%06X,%d", (x >> 7) & 1, (x >> 8) & 0x1fffff, (x >> 29) & 7); } @@ -455,7 +455,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0x0020: if (is_34020 && (op & 0xfe00) == 0x0600) { - UINT32 x; + uint32_t x; PARAM_LONG(x); sprintf(buffer, "CMOVGC "); print_des_reg(); @@ -469,7 +469,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0x0040: if (is_34020 && (op & 0xfe00) == 0x0600) { - UINT32 x; + uint32_t x; PARAM_LONG(x); sprintf(buffer, "CMOVGC "); print_des_reg(); @@ -486,7 +486,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0x0060: if (is_34020 && (op & 0xfe00) == 0x0600) { - UINT32 x; + uint32_t x; PARAM_LONG(x); if (op == 0x0660 && (x & 0xff) == 0x01) @@ -513,7 +513,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0x0080: if (is_34020 && (op & 0xfe00) == 0x0600) { - UINT32 x; + uint32_t x; PARAM_LONG(x); sprintf(buffer, "CMOVMC *"); rf = (x & 0x10) ? 'B' : 'A'; @@ -528,7 +528,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0x00a0: if (is_34020 && (op & 0xfe00) == 0x0600) { - UINT32 x; + uint32_t x; PARAM_LONG(x); sprintf(buffer, "CMOVCM *"); print_des_reg(); @@ -542,7 +542,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0x00c0: if (is_34020 && (op & 0xfe00) == 0x0600) { - UINT32 x; + uint32_t x; PARAM_LONG(x); sprintf(buffer, "CMOVCM *-"); print_des_reg(); @@ -556,7 +556,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0x00e0: if (is_34020 && (op & 0xfe00) == 0x0600) { - UINT32 x; + uint32_t x; PARAM_LONG(x); sprintf(buffer, "CMOVMC *"); rf = (x & 0x10) ? 'B' : 'A'; @@ -659,7 +659,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0x0020: if (is_34020) { - UINT32 x; + uint32_t x; PARAM_LONG(x); sprintf(buffer, "CMOVMC *-"); rf = (x & 0x10) ? 'B' : 'A'; @@ -1587,7 +1587,7 @@ static unsigned Dasm340x0(char *buff, UINT32 pc, int is_34020) case 0xd800: if (is_34020) { - UINT32 x; + uint32_t x; PARAM_WORD(x); sprintf(buffer, "CEXEC %d,%06X,%d", op & 1, ((x << 5) & 0x1fffe0) | ((op >> 1) & 0x1f), (x >> 13) & 7); } diff --git a/src/devices/cpu/tms34010/34010fld.hxx b/src/devices/cpu/tms34010/34010fld.hxx index ca05039dac0..7d55bca3b7b 100644 --- a/src/devices/cpu/tms34010/34010fld.hxx +++ b/src/devices/cpu/tms34010/34010fld.hxx @@ -15,82 +15,82 @@ FIELD WRITE FUNCTIONS ***************************************************************************/ -void tms340x0_device::wfield_01(offs_t offset, UINT32 data) +void tms340x0_device::wfield_01(offs_t offset, uint32_t data) { WFIELDMAC(0x01,16); } -void tms340x0_device::wfield_02(offs_t offset, UINT32 data) +void tms340x0_device::wfield_02(offs_t offset, uint32_t data) { WFIELDMAC(0x03,15); } -void tms340x0_device::wfield_03(offs_t offset, UINT32 data) +void tms340x0_device::wfield_03(offs_t offset, uint32_t data) { WFIELDMAC(0x07,14); } -void tms340x0_device::wfield_04(offs_t offset, UINT32 data) +void tms340x0_device::wfield_04(offs_t offset, uint32_t data) { WFIELDMAC(0x0f,13); } -void tms340x0_device::wfield_05(offs_t offset, UINT32 data) +void tms340x0_device::wfield_05(offs_t offset, uint32_t data) { WFIELDMAC(0x1f,12); } -void tms340x0_device::wfield_06(offs_t offset, UINT32 data) +void tms340x0_device::wfield_06(offs_t offset, uint32_t data) { WFIELDMAC(0x3f,11); } -void tms340x0_device::wfield_07(offs_t offset, UINT32 data) +void tms340x0_device::wfield_07(offs_t offset, uint32_t data) { WFIELDMAC(0x7f,10); } -void tms340x0_device::wfield_08(offs_t offset, UINT32 data) +void tms340x0_device::wfield_08(offs_t offset, uint32_t data) { WFIELDMAC_8(); } -void tms340x0_device::wfield_09(offs_t offset, UINT32 data) +void tms340x0_device::wfield_09(offs_t offset, uint32_t data) { WFIELDMAC(0x1ff,8); } -void tms340x0_device::wfield_10(offs_t offset, UINT32 data) +void tms340x0_device::wfield_10(offs_t offset, uint32_t data) { WFIELDMAC(0x3ff,7); } -void tms340x0_device::wfield_11(offs_t offset, UINT32 data) +void tms340x0_device::wfield_11(offs_t offset, uint32_t data) { WFIELDMAC(0x7ff,6); } -void tms340x0_device::wfield_12(offs_t offset, UINT32 data) +void tms340x0_device::wfield_12(offs_t offset, uint32_t data) { WFIELDMAC(0xfff,5); } -void tms340x0_device::wfield_13(offs_t offset, UINT32 data) +void tms340x0_device::wfield_13(offs_t offset, uint32_t data) { WFIELDMAC(0x1fff,4); } -void tms340x0_device::wfield_14(offs_t offset, UINT32 data) +void tms340x0_device::wfield_14(offs_t offset, uint32_t data) { WFIELDMAC(0x3fff,3); } -void tms340x0_device::wfield_15(offs_t offset, UINT32 data) +void tms340x0_device::wfield_15(offs_t offset, uint32_t data) { WFIELDMAC(0x7fff,2); } -void tms340x0_device::wfield_16(offs_t offset, UINT32 data) +void tms340x0_device::wfield_16(offs_t offset, uint32_t data) { if (offset & 0x0f) { @@ -102,82 +102,82 @@ void tms340x0_device::wfield_16(offs_t offset, UINT32 data) } } -void tms340x0_device::wfield_17(offs_t offset, UINT32 data) +void tms340x0_device::wfield_17(offs_t offset, uint32_t data) { WFIELDMAC(0x1ffff,0); } -void tms340x0_device::wfield_18(offs_t offset, UINT32 data) +void tms340x0_device::wfield_18(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x3ffff,15); } -void tms340x0_device::wfield_19(offs_t offset, UINT32 data) +void tms340x0_device::wfield_19(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x7ffff,14); } -void tms340x0_device::wfield_20(offs_t offset, UINT32 data) +void tms340x0_device::wfield_20(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0xfffff,13); } -void tms340x0_device::wfield_21(offs_t offset, UINT32 data) +void tms340x0_device::wfield_21(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x1fffff,12); } -void tms340x0_device::wfield_22(offs_t offset, UINT32 data) +void tms340x0_device::wfield_22(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x3fffff,11); } -void tms340x0_device::wfield_23(offs_t offset, UINT32 data) +void tms340x0_device::wfield_23(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x7fffff,10); } -void tms340x0_device::wfield_24(offs_t offset, UINT32 data) +void tms340x0_device::wfield_24(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0xffffff,9); } -void tms340x0_device::wfield_25(offs_t offset, UINT32 data) +void tms340x0_device::wfield_25(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x1ffffff,8); } -void tms340x0_device::wfield_26(offs_t offset, UINT32 data) +void tms340x0_device::wfield_26(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x3ffffff,7); } -void tms340x0_device::wfield_27(offs_t offset, UINT32 data) +void tms340x0_device::wfield_27(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x7ffffff,6); } -void tms340x0_device::wfield_28(offs_t offset, UINT32 data) +void tms340x0_device::wfield_28(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0xfffffff,5); } -void tms340x0_device::wfield_29(offs_t offset, UINT32 data) +void tms340x0_device::wfield_29(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x1fffffff,4); } -void tms340x0_device::wfield_30(offs_t offset, UINT32 data) +void tms340x0_device::wfield_30(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x3fffffff,3); } -void tms340x0_device::wfield_31(offs_t offset, UINT32 data) +void tms340x0_device::wfield_31(offs_t offset, uint32_t data) { WFIELDMAC_BIG(0x7fffffff,2); } -void tms340x0_device::wfield_32(offs_t offset, UINT32 data) +void tms340x0_device::wfield_32(offs_t offset, uint32_t data) { WFIELDMAC_32(); } @@ -199,114 +199,114 @@ const tms340x0_device::wfield_func tms340x0_device::s_wfield_functions[32] = FIELD READ FUNCTIONS (ZERO-EXTEND) ***************************************************************************/ -UINT32 tms340x0_device::rfield_z_01(offs_t offset) +uint32_t tms340x0_device::rfield_z_01(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x01,16); return ret; } -UINT32 tms340x0_device::rfield_z_02(offs_t offset) +uint32_t tms340x0_device::rfield_z_02(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x03,15); return ret; } -UINT32 tms340x0_device::rfield_z_03(offs_t offset) +uint32_t tms340x0_device::rfield_z_03(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x07,14); return ret; } -UINT32 tms340x0_device::rfield_z_04(offs_t offset) +uint32_t tms340x0_device::rfield_z_04(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x0f,13); return ret; } -UINT32 tms340x0_device::rfield_z_05(offs_t offset) +uint32_t tms340x0_device::rfield_z_05(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x1f,12); return ret; } -UINT32 tms340x0_device::rfield_z_06(offs_t offset) +uint32_t tms340x0_device::rfield_z_06(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x3f,11); return ret; } -UINT32 tms340x0_device::rfield_z_07(offs_t offset) +uint32_t tms340x0_device::rfield_z_07(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x7f,10); return ret; } -UINT32 tms340x0_device::rfield_z_08(offs_t offset) +uint32_t tms340x0_device::rfield_z_08(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_8(); return ret; } -UINT32 tms340x0_device::rfield_z_09(offs_t offset) +uint32_t tms340x0_device::rfield_z_09(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x1ff,8); return ret; } -UINT32 tms340x0_device::rfield_z_10(offs_t offset) +uint32_t tms340x0_device::rfield_z_10(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x3ff,7); return ret; } -UINT32 tms340x0_device::rfield_z_11(offs_t offset) +uint32_t tms340x0_device::rfield_z_11(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x7ff,6); return ret; } -UINT32 tms340x0_device::rfield_z_12(offs_t offset) +uint32_t tms340x0_device::rfield_z_12(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0xfff,5); return ret; } -UINT32 tms340x0_device::rfield_z_13(offs_t offset) +uint32_t tms340x0_device::rfield_z_13(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x1fff,4); return ret; } -UINT32 tms340x0_device::rfield_z_14(offs_t offset) +uint32_t tms340x0_device::rfield_z_14(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x3fff,3); return ret; } -UINT32 tms340x0_device::rfield_z_15(offs_t offset) +uint32_t tms340x0_device::rfield_z_15(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x7fff,2); return ret; } -UINT32 tms340x0_device::rfield_z_16(offs_t offset) +uint32_t tms340x0_device::rfield_z_16(offs_t offset) { - UINT32 ret; + uint32_t ret; if (offset & 0x0f) { RFIELDMAC(0xffff,1); @@ -317,112 +317,112 @@ UINT32 tms340x0_device::rfield_z_16(offs_t offset) return ret; } -UINT32 tms340x0_device::rfield_z_17(offs_t offset) +uint32_t tms340x0_device::rfield_z_17(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x1ffff,0); return ret; } -UINT32 tms340x0_device::rfield_z_18(offs_t offset) +uint32_t tms340x0_device::rfield_z_18(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x3ffff,15); return ret; } -UINT32 tms340x0_device::rfield_z_19(offs_t offset) +uint32_t tms340x0_device::rfield_z_19(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x7ffff,14); return ret; } -UINT32 tms340x0_device::rfield_z_20(offs_t offset) +uint32_t tms340x0_device::rfield_z_20(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0xfffff,13); return ret; } -UINT32 tms340x0_device::rfield_z_21(offs_t offset) +uint32_t tms340x0_device::rfield_z_21(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x1fffff,12); return ret; } -UINT32 tms340x0_device::rfield_z_22(offs_t offset) +uint32_t tms340x0_device::rfield_z_22(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x3fffff,11); return ret; } -UINT32 tms340x0_device::rfield_z_23(offs_t offset) +uint32_t tms340x0_device::rfield_z_23(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x7fffff,10); return ret; } -UINT32 tms340x0_device::rfield_z_24(offs_t offset) +uint32_t tms340x0_device::rfield_z_24(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0xffffff,9); return ret; } -UINT32 tms340x0_device::rfield_z_25(offs_t offset) +uint32_t tms340x0_device::rfield_z_25(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x1ffffff,8); return ret; } -UINT32 tms340x0_device::rfield_z_26(offs_t offset) +uint32_t tms340x0_device::rfield_z_26(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x3ffffff,7); return ret; } -UINT32 tms340x0_device::rfield_z_27(offs_t offset) +uint32_t tms340x0_device::rfield_z_27(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x7ffffff,6); return ret; } -UINT32 tms340x0_device::rfield_z_28(offs_t offset) +uint32_t tms340x0_device::rfield_z_28(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0xfffffff,5); return ret; } -UINT32 tms340x0_device::rfield_z_29(offs_t offset) +uint32_t tms340x0_device::rfield_z_29(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x1fffffff,4); return ret; } -UINT32 tms340x0_device::rfield_z_30(offs_t offset) +uint32_t tms340x0_device::rfield_z_30(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x3fffffff,3); return ret; } -UINT32 tms340x0_device::rfield_z_31(offs_t offset) +uint32_t tms340x0_device::rfield_z_31(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x7fffffff,2); return ret; } -UINT32 tms340x0_device::rfield_32(offs_t offset) +uint32_t tms340x0_device::rfield_32(offs_t offset) { RFIELDMAC_32(); } @@ -432,58 +432,58 @@ UINT32 tms340x0_device::rfield_32(offs_t offset) FIELD READ FUNCTIONS (SIGN-EXTEND) ***************************************************************************/ -UINT32 tms340x0_device::rfield_s_01(offs_t offset) +uint32_t tms340x0_device::rfield_s_01(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x01,16); - return ((INT32)(ret << 31)) >> 31; + return ((int32_t)(ret << 31)) >> 31; } -UINT32 tms340x0_device::rfield_s_02(offs_t offset) +uint32_t tms340x0_device::rfield_s_02(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x03,15); - return ((INT32)(ret << 30)) >> 30; + return ((int32_t)(ret << 30)) >> 30; } -UINT32 tms340x0_device::rfield_s_03(offs_t offset) +uint32_t tms340x0_device::rfield_s_03(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x07,14); - return ((INT32)(ret << 29)) >> 29; + return ((int32_t)(ret << 29)) >> 29; } -UINT32 tms340x0_device::rfield_s_04(offs_t offset) +uint32_t tms340x0_device::rfield_s_04(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x0f,13); - return ((INT32)(ret << 28)) >> 28; + return ((int32_t)(ret << 28)) >> 28; } -UINT32 tms340x0_device::rfield_s_05(offs_t offset) +uint32_t tms340x0_device::rfield_s_05(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x1f,12); - return ((INT32)(ret << 27)) >> 27; + return ((int32_t)(ret << 27)) >> 27; } -UINT32 tms340x0_device::rfield_s_06(offs_t offset) +uint32_t tms340x0_device::rfield_s_06(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x3f,11); - return ((INT32)(ret << 26)) >> 26; + return ((int32_t)(ret << 26)) >> 26; } -UINT32 tms340x0_device::rfield_s_07(offs_t offset) +uint32_t tms340x0_device::rfield_s_07(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x7f,10); - return ((INT32)(ret << 25)) >> 25; + return ((int32_t)(ret << 25)) >> 25; } -UINT32 tms340x0_device::rfield_s_08(offs_t offset) +uint32_t tms340x0_device::rfield_s_08(offs_t offset) { - UINT32 ret; + uint32_t ret; if (offset & 0x07) { RFIELDMAC(0xff,9); @@ -491,61 +491,61 @@ UINT32 tms340x0_device::rfield_s_08(offs_t offset) else ret = TMS34010_RDMEM(TOBYTE(offset)); - return (INT32)(INT8)ret; + return (int32_t)(int8_t)ret; } -UINT32 tms340x0_device::rfield_s_09(offs_t offset) +uint32_t tms340x0_device::rfield_s_09(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x1ff,8); - return ((INT32)(ret << 23)) >> 23; + return ((int32_t)(ret << 23)) >> 23; } -UINT32 tms340x0_device::rfield_s_10(offs_t offset) +uint32_t tms340x0_device::rfield_s_10(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x3ff,7); - return ((INT32)(ret << 22)) >> 22; + return ((int32_t)(ret << 22)) >> 22; } -UINT32 tms340x0_device::rfield_s_11(offs_t offset) +uint32_t tms340x0_device::rfield_s_11(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x7ff,6); - return ((INT32)(ret << 21)) >> 21; + return ((int32_t)(ret << 21)) >> 21; } -UINT32 tms340x0_device::rfield_s_12(offs_t offset) +uint32_t tms340x0_device::rfield_s_12(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0xfff,5); - return ((INT32)(ret << 20)) >> 20; + return ((int32_t)(ret << 20)) >> 20; } -UINT32 tms340x0_device::rfield_s_13(offs_t offset) +uint32_t tms340x0_device::rfield_s_13(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x1fff,4); - return ((INT32)(ret << 19)) >> 19; + return ((int32_t)(ret << 19)) >> 19; } -UINT32 tms340x0_device::rfield_s_14(offs_t offset) +uint32_t tms340x0_device::rfield_s_14(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x3fff,3); - return ((INT32)(ret << 18)) >> 18; + return ((int32_t)(ret << 18)) >> 18; } -UINT32 tms340x0_device::rfield_s_15(offs_t offset) +uint32_t tms340x0_device::rfield_s_15(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x7fff,2); - return ((INT32)(ret << 17)) >> 17; + return ((int32_t)(ret << 17)) >> 17; } -UINT32 tms340x0_device::rfield_s_16(offs_t offset) +uint32_t tms340x0_device::rfield_s_16(offs_t offset) { - UINT32 ret; + uint32_t ret; if (offset & 0x0f) { RFIELDMAC(0xffff,1); @@ -556,112 +556,112 @@ UINT32 tms340x0_device::rfield_s_16(offs_t offset) ret = TMS34010_RDMEM_WORD(TOBYTE(offset)); } - return (INT32)(INT16)ret; + return (int32_t)(int16_t)ret; } -UINT32 tms340x0_device::rfield_s_17(offs_t offset) +uint32_t tms340x0_device::rfield_s_17(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC(0x1ffff,0); - return ((INT32)(ret << 15)) >> 15; + return ((int32_t)(ret << 15)) >> 15; } -UINT32 tms340x0_device::rfield_s_18(offs_t offset) +uint32_t tms340x0_device::rfield_s_18(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x3ffff,15); - return ((INT32)(ret << 14)) >> 14; + return ((int32_t)(ret << 14)) >> 14; } -UINT32 tms340x0_device::rfield_s_19(offs_t offset) +uint32_t tms340x0_device::rfield_s_19(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x7ffff,14); - return ((INT32)(ret << 13)) >> 13; + return ((int32_t)(ret << 13)) >> 13; } -UINT32 tms340x0_device::rfield_s_20(offs_t offset) +uint32_t tms340x0_device::rfield_s_20(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0xfffff,13); - return ((INT32)(ret << 12)) >> 12; + return ((int32_t)(ret << 12)) >> 12; } -UINT32 tms340x0_device::rfield_s_21(offs_t offset) +uint32_t tms340x0_device::rfield_s_21(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x1fffff,12); - return ((INT32)(ret << 11)) >> 11; + return ((int32_t)(ret << 11)) >> 11; } -UINT32 tms340x0_device::rfield_s_22(offs_t offset) +uint32_t tms340x0_device::rfield_s_22(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x3fffff,11); - return ((INT32)(ret << 10)) >> 10; + return ((int32_t)(ret << 10)) >> 10; } -UINT32 tms340x0_device::rfield_s_23(offs_t offset) +uint32_t tms340x0_device::rfield_s_23(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x7fffff,10); - return ((INT32)(ret << 9)) >> 9; + return ((int32_t)(ret << 9)) >> 9; } -UINT32 tms340x0_device::rfield_s_24(offs_t offset) +uint32_t tms340x0_device::rfield_s_24(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0xffffff,9); - return ((INT32)(ret << 8)) >> 8; + return ((int32_t)(ret << 8)) >> 8; } -UINT32 tms340x0_device::rfield_s_25(offs_t offset) +uint32_t tms340x0_device::rfield_s_25(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x1ffffff,8); - return ((INT32)(ret << 7)) >> 7; + return ((int32_t)(ret << 7)) >> 7; } -UINT32 tms340x0_device::rfield_s_26(offs_t offset) +uint32_t tms340x0_device::rfield_s_26(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x3ffffff,7); - return ((INT32)(ret << 6)) >> 6; + return ((int32_t)(ret << 6)) >> 6; } -UINT32 tms340x0_device::rfield_s_27(offs_t offset) +uint32_t tms340x0_device::rfield_s_27(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x7ffffff,6); - return ((INT32)(ret << 5)) >> 5; + return ((int32_t)(ret << 5)) >> 5; } -UINT32 tms340x0_device::rfield_s_28(offs_t offset) +uint32_t tms340x0_device::rfield_s_28(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0xfffffff,5); - return ((INT32)(ret << 4)) >> 4; + return ((int32_t)(ret << 4)) >> 4; } -UINT32 tms340x0_device::rfield_s_29(offs_t offset) +uint32_t tms340x0_device::rfield_s_29(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x1fffffff,4); - return ((INT32)(ret << 3)) >> 3; + return ((int32_t)(ret << 3)) >> 3; } -UINT32 tms340x0_device::rfield_s_30(offs_t offset) +uint32_t tms340x0_device::rfield_s_30(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x3fffffff,3); - return ((INT32)(ret << 2)) >> 2; + return ((int32_t)(ret << 2)) >> 2; } -UINT32 tms340x0_device::rfield_s_31(offs_t offset) +uint32_t tms340x0_device::rfield_s_31(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_BIG(0x7fffffff,2); - return ((INT32)(ret << 1)) >> 1; + return ((int32_t)(ret << 1)) >> 1; } const tms340x0_device::rfield_func tms340x0_device::s_rfield_functions[64] = diff --git a/src/devices/cpu/tms34010/34010gfx.hxx b/src/devices/cpu/tms34010/34010gfx.hxx index ece6085fd6e..5c92ad36b6b 100644 --- a/src/devices/cpu/tms34010/34010gfx.hxx +++ b/src/devices/cpu/tms34010/34010gfx.hxx @@ -18,7 +18,7 @@ /* Graphics Instructions */ -void tms340x0_device::line(UINT16 op) +void tms340x0_device::line(uint16_t op) { if (!P_FLAG()) { @@ -32,7 +32,7 @@ void tms340x0_device::line(UINT16 op) if (COUNT() > 0) { - INT16 x1,y1; + int16_t x1,y1; COUNT()--; if (WINDOW_CHECKING() != 3 || @@ -72,7 +72,7 @@ cases: * directions (left->right/right->left, top->bottom/bottom->top) */ -int tms340x0_device::apply_window(const char *inst_name,int srcbpp, UINT32 *srcaddr, XY *dst, int *dx, int *dy) +int tms340x0_device::apply_window(const char *inst_name,int srcbpp, uint32_t *srcaddr, XY *dst, int *dx, int *dy) { /* apply the window */ if (WINDOW_CHECKING() == 0) @@ -205,34 +205,34 @@ int tms340x0_device::compute_pixblt_b_cycles(int left_partials, int right_partia /* Shift register handling */ -void tms340x0_device::memory_w(address_space &space, offs_t offset,UINT16 data) +void tms340x0_device::memory_w(address_space &space, offs_t offset,uint16_t data) { space.write_word(offset, data); } -UINT16 tms340x0_device::memory_r(address_space &space, offs_t offset) +uint16_t tms340x0_device::memory_r(address_space &space, offs_t offset) { return space.read_word(offset); } -void tms340x0_device::shiftreg_w(address_space &space, offs_t offset,UINT16 data) +void tms340x0_device::shiftreg_w(address_space &space, offs_t offset,uint16_t data) { if (!m_from_shiftreg_cb.isnull()) - m_from_shiftreg_cb(space, (UINT32)(offset << 3) & ~15, &m_shiftreg[0]); + m_from_shiftreg_cb(space, (uint32_t)(offset << 3) & ~15, &m_shiftreg[0]); else logerror("From ShiftReg function not set. PC = %08X\n", m_pc); } -UINT16 tms340x0_device::shiftreg_r(address_space &space, offs_t offset) +uint16_t tms340x0_device::shiftreg_r(address_space &space, offs_t offset) { if (!m_to_shiftreg_cb.isnull()) - m_to_shiftreg_cb(space, (UINT32)(offset << 3) & ~15, &m_shiftreg[0]); + m_to_shiftreg_cb(space, (uint32_t)(offset << 3) & ~15, &m_shiftreg[0]); else logerror("To ShiftReg function not set. PC = %08X\n", m_pc); return m_shiftreg[0]; } -UINT16 tms340x0_device::dummy_shiftreg_r(address_space &space, offs_t offset) +uint16_t tms340x0_device::dummy_shiftreg_r(address_space &space, offs_t offset) { return m_shiftreg[0]; } @@ -240,28 +240,28 @@ UINT16 tms340x0_device::dummy_shiftreg_r(address_space &space, offs_t offset) /* Pixel operations */ -UINT32 tms340x0_device::pixel_op00(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return srcpix; } -UINT32 tms340x0_device::pixel_op01(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return srcpix & dstpix; } -UINT32 tms340x0_device::pixel_op02(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return srcpix & ~dstpix; } -UINT32 tms340x0_device::pixel_op03(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return 0; } -UINT32 tms340x0_device::pixel_op04(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return (srcpix | ~dstpix) & mask; } -UINT32 tms340x0_device::pixel_op05(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return ~(srcpix ^ dstpix) & mask; } -UINT32 tms340x0_device::pixel_op06(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return ~dstpix & mask; } -UINT32 tms340x0_device::pixel_op07(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return ~(srcpix | dstpix) & mask; } -UINT32 tms340x0_device::pixel_op08(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return (srcpix | dstpix) & mask; } -UINT32 tms340x0_device::pixel_op09(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return dstpix & mask; } -UINT32 tms340x0_device::pixel_op10(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return (srcpix ^ dstpix) & mask; } -UINT32 tms340x0_device::pixel_op11(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return (~srcpix & dstpix) & mask; } -UINT32 tms340x0_device::pixel_op12(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return mask; } -UINT32 tms340x0_device::pixel_op13(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return (~srcpix & dstpix) & mask; } -UINT32 tms340x0_device::pixel_op14(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return ~(srcpix & dstpix) & mask; } -UINT32 tms340x0_device::pixel_op15(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return srcpix ^ mask; } -UINT32 tms340x0_device::pixel_op16(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return (srcpix + dstpix) & mask; } -UINT32 tms340x0_device::pixel_op17(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { INT32 tmp = srcpix + (dstpix & mask); return (tmp > mask) ? mask : tmp; } -UINT32 tms340x0_device::pixel_op18(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { return (dstpix - srcpix) & mask; } -UINT32 tms340x0_device::pixel_op19(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { INT32 tmp = srcpix - (dstpix & mask); return (tmp < 0) ? 0 : tmp; } -UINT32 tms340x0_device::pixel_op20(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { dstpix &= mask; return (srcpix > dstpix) ? srcpix : dstpix; } -UINT32 tms340x0_device::pixel_op21(UINT32 dstpix, UINT32 mask, UINT32 srcpix) { dstpix &= mask; return (srcpix < dstpix) ? srcpix : dstpix; } +uint32_t tms340x0_device::pixel_op00(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return srcpix; } +uint32_t tms340x0_device::pixel_op01(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return srcpix & dstpix; } +uint32_t tms340x0_device::pixel_op02(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return srcpix & ~dstpix; } +uint32_t tms340x0_device::pixel_op03(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return 0; } +uint32_t tms340x0_device::pixel_op04(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return (srcpix | ~dstpix) & mask; } +uint32_t tms340x0_device::pixel_op05(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return ~(srcpix ^ dstpix) & mask; } +uint32_t tms340x0_device::pixel_op06(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return ~dstpix & mask; } +uint32_t tms340x0_device::pixel_op07(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return ~(srcpix | dstpix) & mask; } +uint32_t tms340x0_device::pixel_op08(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return (srcpix | dstpix) & mask; } +uint32_t tms340x0_device::pixel_op09(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return dstpix & mask; } +uint32_t tms340x0_device::pixel_op10(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return (srcpix ^ dstpix) & mask; } +uint32_t tms340x0_device::pixel_op11(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return (~srcpix & dstpix) & mask; } +uint32_t tms340x0_device::pixel_op12(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return mask; } +uint32_t tms340x0_device::pixel_op13(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return (~srcpix & dstpix) & mask; } +uint32_t tms340x0_device::pixel_op14(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return ~(srcpix & dstpix) & mask; } +uint32_t tms340x0_device::pixel_op15(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return srcpix ^ mask; } +uint32_t tms340x0_device::pixel_op16(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return (srcpix + dstpix) & mask; } +uint32_t tms340x0_device::pixel_op17(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { int32_t tmp = srcpix + (dstpix & mask); return (tmp > mask) ? mask : tmp; } +uint32_t tms340x0_device::pixel_op18(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { return (dstpix - srcpix) & mask; } +uint32_t tms340x0_device::pixel_op19(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { int32_t tmp = srcpix - (dstpix & mask); return (tmp < 0) ? 0 : tmp; } +uint32_t tms340x0_device::pixel_op20(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { dstpix &= mask; return (srcpix > dstpix) ? srcpix : dstpix; } +uint32_t tms340x0_device::pixel_op21(uint32_t dstpix, uint32_t mask, uint32_t srcpix) { dstpix &= mask; return (srcpix < dstpix) ? srcpix : dstpix; } const tms340x0_device::pixel_op_func tms340x0_device::s_pixel_op_table[32] = { @@ -270,7 +270,7 @@ const tms340x0_device::pixel_op_func tms340x0_device::s_pixel_op_table[32] = &tms340x0_device::pixel_op16, &tms340x0_device::pixel_op17, &tms340x0_device::pixel_op18, &tms340x0_device::pixel_op19, &tms340x0_device::pixel_op20, &tms340x0_device::pixel_op21, &tms340x0_device::pixel_op00, &tms340x0_device::pixel_op00, &tms340x0_device::pixel_op00, &tms340x0_device::pixel_op00, &tms340x0_device::pixel_op00, &tms340x0_device::pixel_op00, &tms340x0_device::pixel_op00, &tms340x0_device::pixel_op00, &tms340x0_device::pixel_op00, &tms340x0_device::pixel_op00 }; -const UINT8 tms340x0_device::s_pixel_op_timing_table[33] = +const uint8_t tms340x0_device::s_pixel_op_timing_table[33] = { 2,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,6,5,5,2,2,2,2,2,2,2,2,2,2,2 }; @@ -817,13 +817,13 @@ const tms340x0_device::pixblt_b_op_func tms340x0_device::s_fill_op_table[] = #undef PIXEL_OP_TIMING #undef PIXEL_OP -static const UINT8 pixelsize_lookup[32] = +static const uint8_t pixelsize_lookup[32] = { 0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 }; -void tms340x0_device::pixblt_b_l(UINT16 op) +void tms340x0_device::pixblt_b_l(uint16_t op) { int psize = pixelsize_lookup[IOREG(REG_PSIZE) & 0x1f]; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; @@ -835,7 +835,7 @@ void tms340x0_device::pixblt_b_l(UINT16 op) (this->*s_pixblt_b_op_table[ix])(1); } -void tms340x0_device::pixblt_b_xy(UINT16 op) +void tms340x0_device::pixblt_b_xy(uint16_t op) { int psize = pixelsize_lookup[IOREG(REG_PSIZE) & 0x1f]; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; @@ -847,7 +847,7 @@ void tms340x0_device::pixblt_b_xy(UINT16 op) (this->*s_pixblt_b_op_table[ix])(0); } -void tms340x0_device::pixblt_l_l(UINT16 op) +void tms340x0_device::pixblt_l_l(uint16_t op) { int psize = pixelsize_lookup[IOREG(REG_PSIZE) & 0x1f]; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; @@ -863,7 +863,7 @@ void tms340x0_device::pixblt_l_l(UINT16 op) (this->*s_pixblt_r_op_table[ix])(1, 1); } -void tms340x0_device::pixblt_l_xy(UINT16 op) +void tms340x0_device::pixblt_l_xy(uint16_t op) { int psize = pixelsize_lookup[IOREG(REG_PSIZE) & 0x1f]; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; @@ -879,7 +879,7 @@ void tms340x0_device::pixblt_l_xy(UINT16 op) (this->*s_pixblt_r_op_table[ix])(1, 0); } -void tms340x0_device::pixblt_xy_l(UINT16 op) +void tms340x0_device::pixblt_xy_l(uint16_t op) { int psize = pixelsize_lookup[IOREG(REG_PSIZE) & 0x1f]; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; @@ -895,7 +895,7 @@ void tms340x0_device::pixblt_xy_l(UINT16 op) (this->*s_pixblt_r_op_table[ix])(0, 1); } -void tms340x0_device::pixblt_xy_xy(UINT16 op) +void tms340x0_device::pixblt_xy_xy(uint16_t op) { int psize = pixelsize_lookup[IOREG(REG_PSIZE) & 0x1f]; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; @@ -911,7 +911,7 @@ void tms340x0_device::pixblt_xy_xy(UINT16 op) (this->*s_pixblt_r_op_table[ix])(0, 0); } -void tms340x0_device::fill_l(UINT16 op) +void tms340x0_device::fill_l(uint16_t op) { int psize = pixelsize_lookup[IOREG(REG_PSIZE) & 0x1f]; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; @@ -923,7 +923,7 @@ void tms340x0_device::fill_l(UINT16 op) (this->*s_fill_op_table[ix])(1); } -void tms340x0_device::fill_xy(UINT16 op) +void tms340x0_device::fill_xy(uint16_t op) { int psize = pixelsize_lookup[IOREG(REG_PSIZE) & 0x1f]; int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; @@ -953,8 +953,8 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear int dx, dy, x, y, /*words,*/ yreverse; word_write_func word_write; word_read_func word_read; - UINT32 readwrites = 0; - UINT32 saddr, daddr; + uint32_t readwrites = 0; + uint32_t saddr, daddr; XY dstxy = { 0 }; /* determine read/write functions */ @@ -973,8 +973,8 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear saddr = src_is_linear ? SADDR() : SXYTOL(SADDR_XY()); /* compute the bounds of the operation */ - dx = (INT16)DYDX_X(); - dy = (INT16)DYDX_Y(); + dx = (int16_t)DYDX_X(); + dy = (int16_t)DYDX_Y(); /* apply the window for non-linear destinations */ m_gfxcycles = 7 + (src_is_linear ? 0 : 2); @@ -1021,11 +1021,11 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear /* loop over rows */ for (y = 0; y < dy; y++) { - UINT32 srcwordaddr = saddr >> 4; - UINT32 dstwordaddr = daddr >> 4; - UINT8 srcbit = saddr & 15; - UINT8 dstbit = daddr & 15; - UINT32 srcword, dstword = 0; + uint32_t srcwordaddr = saddr >> 4; + uint32_t dstwordaddr = daddr >> 4; + uint8_t srcbit = saddr & 15; + uint8_t dstbit = daddr & 15; + uint32_t srcword, dstword = 0; /* fetch the initial source word */ srcword = (this->*word_read)(*m_program, srcwordaddr++ << 1); @@ -1041,8 +1041,8 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear /* loop over pixels */ for (x = 0; x < dx; x++) { - UINT32 dstmask; - UINT32 pixel; + uint32_t dstmask; + uint32_t pixel; /* fetch more words if necessary */ if (srcbit + BITS_PER_PIXEL > 16) @@ -1092,8 +1092,8 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear /* if we're right-partial, read and mask the remaining bits */ if (dstbit != 16) { - UINT16 origdst = (this->*word_read)(*m_program, dstwordaddr << 1); - UINT16 mask = 0xffff << dstbit; + uint16_t origdst = (this->*word_read)(*m_program, dstwordaddr << 1); + uint16_t mask = 0xffff << dstbit; dstword = (dstword & ~mask) | (origdst & mask); readwrites++; } @@ -1106,8 +1106,8 @@ void FUNCTION_NAME(tms340x0_device::pixblt)(int src_is_linear, int dst_is_linear #if 0 int left_partials, right_partials, full_words, bitshift, bitshift_alt; - UINT16 srcword, srcmask, dstword, dstmask, pixel; - UINT32 swordaddr, dwordaddr; + uint16_t srcword, srcmask, dstword, dstmask, pixel; + uint32_t swordaddr, dwordaddr; /* determine the bit shift to get from source to dest */ bitshift = ((daddr & 15) - (saddr & 15)) & 15; @@ -1302,7 +1302,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt_r)(int src_is_linear, int dst_is_line int dx, dy, x, y, words, yreverse; word_write_func word_write; word_read_func word_read; - UINT32 saddr, daddr; + uint32_t saddr, daddr; XY dstxy = { 0 }; /* determine read/write functions */ @@ -1323,8 +1323,8 @@ if ((saddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd s saddr &= ~(BITS_PER_PIXEL - 1); /* compute the bounds of the operation */ - dx = (INT16)DYDX_X(); - dy = (INT16)DYDX_Y(); + dx = (int16_t)DYDX_X(); + dy = (int16_t)DYDX_Y(); /* apply the window for non-linear destinations */ m_gfxcycles = 7 + (src_is_linear ? 0 : 2); @@ -1375,8 +1375,8 @@ if ((daddr & (BITS_PER_PIXEL - 1)) != 0) osd_printf_debug("PIXBLT_R%d with odd d for (y = 0; y < dy; y++) { int left_partials, right_partials, full_words, bitshift, bitshift_alt; - UINT16 srcword, srcmask, dstword, dstmask, pixel; - UINT32 swordaddr, dwordaddr; + uint16_t srcword, srcmask, dstword, dstmask, pixel; + uint32_t swordaddr, dwordaddr; /* determine the bit shift to get from source to dest */ bitshift = ((daddr & 15) - (saddr & 15)) & 15; @@ -1582,7 +1582,7 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) int dx, dy, x, y, words, left_partials, right_partials, full_words; word_write_func word_write; word_read_func word_read; - UINT32 saddr, daddr; + uint32_t saddr, daddr; XY dstxy = { 0 }; /* determine read/write functions */ @@ -1601,8 +1601,8 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) saddr = SADDR(); /* compute the bounds of the operation */ - dx = (INT16)DYDX_X(); - dy = (INT16)DYDX_Y(); + dx = (int16_t)DYDX_X(); + dy = (int16_t)DYDX_Y(); /* apply the window for non-linear destinations */ m_gfxcycles = 4; @@ -1649,8 +1649,8 @@ void FUNCTION_NAME(tms340x0_device::pixblt_b)(int dst_is_linear) /* loop over rows */ for (y = 0; y < dy; y++) { - UINT16 srcword, srcmask, dstword, dstmask, pixel; - UINT32 swordaddr, dwordaddr; + uint16_t srcword, srcmask, dstword, dstmask, pixel; + uint32_t swordaddr, dwordaddr; /* use byte addresses each row */ swordaddr = saddr >> 4; @@ -1796,7 +1796,7 @@ void FUNCTION_NAME(tms340x0_device::fill)(int dst_is_linear) int dx, dy, x, y, words, left_partials, right_partials, full_words; word_write_func word_write; word_read_func word_read; - UINT32 daddr; + uint32_t daddr; XY dstxy = { 0 }; /* determine read/write functions */ @@ -1812,8 +1812,8 @@ void FUNCTION_NAME(tms340x0_device::fill)(int dst_is_linear) } /* compute the bounds of the operation */ - dx = (INT16)DYDX_X(); - dy = (INT16)DYDX_Y(); + dx = (int16_t)DYDX_X(); + dy = (int16_t)DYDX_Y(); /* apply the window for non-linear destinations */ m_gfxcycles = 4; @@ -1860,8 +1860,8 @@ void FUNCTION_NAME(tms340x0_device::fill)(int dst_is_linear) /* loop over rows */ for (y = 0; y < dy; y++) { - UINT16 dstword, dstmask, pixel; - UINT32 dwordaddr; + uint16_t dstword, dstmask, pixel; + uint32_t dwordaddr; /* use byte addresses each row */ dwordaddr = daddr >> 4; diff --git a/src/devices/cpu/tms34010/34010ops.h b/src/devices/cpu/tms34010/34010ops.h index 6dad233c034..39833b35d77 100644 --- a/src/devices/cpu/tms34010/34010ops.h +++ b/src/devices/cpu/tms34010/34010ops.h @@ -23,15 +23,15 @@ #define TMS34010_RDMEM(A) ((unsigned)m_program->read_byte (A)) #define TMS34010_RDMEM_WORD(A) ((unsigned)m_program->read_word (A)) -inline UINT32 tms340x0_device::TMS34010_RDMEM_DWORD(offs_t A) +inline uint32_t tms340x0_device::TMS34010_RDMEM_DWORD(offs_t A) { - UINT32 result = m_program->read_word(A); + uint32_t result = m_program->read_word(A); return result | (m_program->read_word(A+2)<<16); } #define TMS34010_WRMEM(A,V) (m_program->write_byte(A,V)) #define TMS34010_WRMEM_WORD(A,V) (m_program->write_word(A,V)) -inline void tms340x0_device::TMS34010_WRMEM_DWORD(offs_t A, UINT32 V) +inline void tms340x0_device::TMS34010_WRMEM_DWORD(offs_t A, uint32_t V) { m_program->write_word(A,V); m_program->write_word(A+2,V>>16); @@ -52,36 +52,36 @@ inline void tms340x0_device::TMS34010_WRMEM_DWORD(offs_t A, UINT32 V) ***************************************************************************/ #define WFIELDMAC(MASK,MAX) \ - UINT32 shift = offset & 0x0f; \ - UINT32 masked_data = data & (MASK); \ - UINT32 old; \ + uint32_t shift = offset & 0x0f; \ + uint32_t masked_data = data & (MASK); \ + uint32_t old; \ \ offset = TOBYTE(offset & 0xfffffff0); \ \ if (shift >= MAX) \ { \ - old = (UINT32)TMS34010_RDMEM_DWORD(offset) & ~((MASK) << shift); \ + old = (uint32_t)TMS34010_RDMEM_DWORD(offset) & ~((MASK) << shift); \ TMS34010_WRMEM_DWORD(offset, (masked_data << shift) | old); \ } \ else \ { \ - old = (UINT32)TMS34010_RDMEM_WORD(offset) & ~((MASK) << shift); \ + old = (uint32_t)TMS34010_RDMEM_WORD(offset) & ~((MASK) << shift); \ TMS34010_WRMEM_WORD(offset, ((masked_data & (MASK)) << shift) | old); \ } #define WFIELDMAC_BIG(MASK,MAX) \ - UINT32 shift = offset & 0x0f; \ - UINT32 masked_data = data & (MASK); \ - UINT32 old; \ + uint32_t shift = offset & 0x0f; \ + uint32_t masked_data = data & (MASK); \ + uint32_t old; \ \ offset = TOBYTE(offset & 0xfffffff0); \ \ - old = (UINT32)TMS34010_RDMEM_DWORD(offset) & ~(UINT32)((MASK) << shift); \ - TMS34010_WRMEM_DWORD(offset, (UINT32)(masked_data << shift) | old); \ + old = (uint32_t)TMS34010_RDMEM_DWORD(offset) & ~(uint32_t)((MASK) << shift); \ + TMS34010_WRMEM_DWORD(offset, (uint32_t)(masked_data << shift) | old); \ if (shift >= MAX) \ { \ shift = 32 - shift; \ - old = (UINT32)TMS34010_RDMEM_WORD(offset + 4) & ~((MASK) >> shift); \ + old = (uint32_t)TMS34010_RDMEM_WORD(offset + 4) & ~((MASK) >> shift); \ TMS34010_WRMEM_WORD(offset, (masked_data >> shift) | old); \ } @@ -104,12 +104,12 @@ inline void tms340x0_device::TMS34010_WRMEM_DWORD(offs_t A, UINT32 V) #define WFIELDMAC_32() \ if (offset & 0x0f) \ { \ - UINT32 shift = offset&0x0f; \ - UINT32 old; \ - UINT32 hiword; \ + uint32_t shift = offset&0x0f; \ + uint32_t old; \ + uint32_t hiword; \ offset &= 0xfffffff0; \ - old = ((UINT32) TMS34010_RDMEM_DWORD (TOBYTE(offset ))&(0xffffffff>>(0x20-shift))); \ - hiword = ((UINT32) TMS34010_RDMEM_DWORD (TOBYTE(offset+0x20))&(0xffffffff<>(0x20-shift))); \ + hiword = ((uint32_t) TMS34010_RDMEM_DWORD (TOBYTE(offset+0x20))&(0xffffffff<>(0x20-shift))|hiword); \ } \ @@ -122,7 +122,7 @@ inline void tms340x0_device::TMS34010_WRMEM_DWORD(offs_t A, UINT32 V) ***************************************************************************/ #define RFIELDMAC(MASK,MAX) \ - UINT32 shift = offset & 0x0f; \ + uint32_t shift = offset & 0x0f; \ offset = TOBYTE(offset & 0xfffffff0); \ \ if (shift >= MAX) \ @@ -131,10 +131,10 @@ inline void tms340x0_device::TMS34010_WRMEM_DWORD(offs_t A, UINT32 V) ret = (TMS34010_RDMEM_WORD(offset) >> shift) & (MASK); #define RFIELDMAC_BIG(MASK,MAX) \ - UINT32 shift = offset & 0x0f; \ + uint32_t shift = offset & 0x0f; \ offset = TOBYTE(offset & 0xfffffff0); \ \ - ret = (UINT32)TMS34010_RDMEM_DWORD(offset) >> shift; \ + ret = (uint32_t)TMS34010_RDMEM_DWORD(offset) >> shift; \ if (shift >= MAX) \ ret |= (TMS34010_RDMEM_WORD(offset + 4) << (32 - shift)); \ ret &= MASK; @@ -142,9 +142,9 @@ inline void tms340x0_device::TMS34010_WRMEM_DWORD(offs_t A, UINT32 V) #define RFIELDMAC_32() \ if (offset&0x0f) \ { \ - UINT32 shift = offset&0x0f; \ + uint32_t shift = offset&0x0f; \ offset &= 0xfffffff0; \ - return (((UINT32)TMS34010_RDMEM_DWORD (TOBYTE(offset ))>> shift) | \ + return (((uint32_t)TMS34010_RDMEM_DWORD (TOBYTE(offset ))>> shift) | \ (TMS34010_RDMEM_DWORD (TOBYTE(offset+0x20))<<(0x20-shift)));\ } \ else \ diff --git a/src/devices/cpu/tms34010/34010ops.hxx b/src/devices/cpu/tms34010/34010ops.hxx index 9b4300b6600..57b5cca536e 100644 --- a/src/devices/cpu/tms34010/34010ops.hxx +++ b/src/devices/cpu/tms34010/34010ops.hxx @@ -15,12 +15,12 @@ MISC MACROS ***************************************************************************/ -#define ZEXTEND(val,width) if (width) (val) &= ((UINT32)0xffffffff >> (32 - (width))) -#define SEXTEND(val,width) if (width) (val) = (INT32)((val) << (32 - (width))) >> (32 - (width)) +#define ZEXTEND(val,width) if (width) (val) &= ((uint32_t)0xffffffff >> (32 - (width))) +#define SEXTEND(val,width) if (width) (val) = (int32_t)((val) << (32 - (width))) >> (32 - (width)) -#define SXYTOL(val) ((((INT16)(val).y * m_convsp) + ((INT16)(val).x << m_pixelshift)) + OFFSET()) -#define DXYTOL(val) ((((INT16)(val).y * m_convdp) + ((INT16)(val).x << m_pixelshift)) + OFFSET()) -#define MXYTOL(val) ((((INT16)(val).y * m_convmp) + ((INT16)(val).x << m_pixelshift)) + OFFSET()) +#define SXYTOL(val) ((((int16_t)(val).y * m_convsp) + ((int16_t)(val).x << m_pixelshift)) + OFFSET()) +#define DXYTOL(val) ((((int16_t)(val).y * m_convdp) + ((int16_t)(val).x << m_pixelshift)) + OFFSET()) +#define MXYTOL(val) ((((int16_t)(val).y * m_convmp) + ((int16_t)(val).x << m_pixelshift)) + OFFSET()) #define COUNT_CYCLES(x) m_icount -= x #define COUNT_UNKNOWN_CYCLES(x) COUNT_CYCLES(x) @@ -63,20 +63,20 @@ #define SET_NZ_VAL(val) SET_Z_VAL(val); SET_N_VAL(val) #define SET_V_SUB(a,b,r) SET_V_BIT_HI(((a) ^ (b)) & ((a) ^ (r)), 31) #define SET_V_ADD(a,b,r) SET_V_BIT_HI(~((a) ^ (b)) & ((a) ^ (r)), 31) -#define SET_C_SUB(a,b) SET_C_LOG((UINT32)(b) > (UINT32)(a)) -#define SET_C_ADD(a,b) SET_C_LOG((UINT32)~(a) < (UINT32)(b)) +#define SET_C_SUB(a,b) SET_C_LOG((uint32_t)(b) > (uint32_t)(a)) +#define SET_C_ADD(a,b) SET_C_LOG((uint32_t)~(a) < (uint32_t)(b)) #define SET_NZV_SUB(a,b,r) SET_NZ_VAL(r); SET_V_SUB(a,b,r) #define SET_NZCV_SUB(a,b,r) SET_NZV_SUB(a,b,r); SET_C_SUB(a,b) #define SET_NZCV_ADD(a,b,r) SET_NZ_VAL(r); SET_V_ADD(a,b,r); SET_C_ADD(a,b) -static const UINT8 fw_inc[32] = { 32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 }; +static const uint8_t fw_inc[32] = { 32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 }; /*************************************************************************** UNIMPLEMENTED INSTRUCTION ***************************************************************************/ -void tms340x0_device::unimpl(UINT16 op) +void tms340x0_device::unimpl(uint16_t op) { /* kludge for Super High Impact -- this doesn't seem to cause */ /* an illegal opcode exception */ @@ -122,8 +122,8 @@ void tms340x0_device::unimpl(UINT16 op) SET_V_BIT_LO(b->x, 15); \ COUNT_CYCLES(1); \ } -void tms340x0_device::add_xy_a(UINT16 op) { ADD_XY(A); } -void tms340x0_device::add_xy_b(UINT16 op) { ADD_XY(B); } +void tms340x0_device::add_xy_a(uint16_t op) { ADD_XY(A); } +void tms340x0_device::add_xy_b(uint16_t op) { ADD_XY(B); } #define SUB_XY(R) \ { \ @@ -138,12 +138,12 @@ void tms340x0_device::add_xy_b(UINT16 op) { ADD_XY(B); } b->y -= a.y; \ COUNT_CYCLES(1); \ } -void tms340x0_device::sub_xy_a(UINT16 op) { SUB_XY(A); } -void tms340x0_device::sub_xy_b(UINT16 op) { SUB_XY(B); } +void tms340x0_device::sub_xy_a(uint16_t op) { SUB_XY(A); } +void tms340x0_device::sub_xy_b(uint16_t op) { SUB_XY(B); } #define CMP_XY(R) \ { \ - INT16 res; \ + int16_t res; \ XY a = R##REG_XY(DSTREG(op)); \ XY b = R##REG_XY(SRCREG(op)); \ CLR_NCZV(); \ @@ -155,14 +155,14 @@ void tms340x0_device::sub_xy_b(UINT16 op) { SUB_XY(B); } SET_C_BIT_LO(res, 15); \ COUNT_CYCLES(1); \ } -void tms340x0_device::cmp_xy_a(UINT16 op) { CMP_XY(A); } -void tms340x0_device::cmp_xy_b(UINT16 op) { CMP_XY(B); } +void tms340x0_device::cmp_xy_a(uint16_t op) { CMP_XY(A); } +void tms340x0_device::cmp_xy_b(uint16_t op) { CMP_XY(B); } #define CPW(R) \ { \ - INT32 res = 0; \ - INT16 x = R##REG_X(SRCREG(op)); \ - INT16 y = R##REG_Y(SRCREG(op)); \ + int32_t res = 0; \ + int16_t x = R##REG_X(SRCREG(op)); \ + int16_t y = R##REG_Y(SRCREG(op)); \ \ CLR_V(); \ res |= ((WSTART_X() > x) ? 0x20 : 0); \ @@ -173,32 +173,32 @@ void tms340x0_device::cmp_xy_b(UINT16 op) { CMP_XY(B); } SET_V_LOG(res != 0); \ COUNT_CYCLES(1); \ } -void tms340x0_device::cpw_a(UINT16 op) { CPW(A); } -void tms340x0_device::cpw_b(UINT16 op) { CPW(B); } +void tms340x0_device::cpw_a(uint16_t op) { CPW(A); } +void tms340x0_device::cpw_b(uint16_t op) { CPW(B); } #define CVXYL(R) \ { \ R##REG(DSTREG(op)) = DXYTOL(R##REG_XY(SRCREG(op))); \ COUNT_CYCLES(3); \ } -void tms340x0_device::cvxyl_a(UINT16 op) { CVXYL(A); } -void tms340x0_device::cvxyl_b(UINT16 op) { CVXYL(B); } +void tms340x0_device::cvxyl_a(uint16_t op) { CVXYL(A); } +void tms340x0_device::cvxyl_b(uint16_t op) { CVXYL(B); } #define MOVX(R) \ { \ - R##REG(DSTREG(op)) = (R##REG(DSTREG(op)) & 0xffff0000) | (UINT16)R##REG(SRCREG(op)); \ + R##REG(DSTREG(op)) = (R##REG(DSTREG(op)) & 0xffff0000) | (uint16_t)R##REG(SRCREG(op)); \ COUNT_CYCLES(1); \ } -void tms340x0_device::movx_a(UINT16 op) { MOVX(A); } -void tms340x0_device::movx_b(UINT16 op) { MOVX(B); } +void tms340x0_device::movx_a(uint16_t op) { MOVX(A); } +void tms340x0_device::movx_b(uint16_t op) { MOVX(B); } #define MOVY(R) \ { \ - R##REG(DSTREG(op)) = (R##REG(SRCREG(op)) & 0xffff0000) | (UINT16)R##REG(DSTREG(op)); \ + R##REG(DSTREG(op)) = (R##REG(SRCREG(op)) & 0xffff0000) | (uint16_t)R##REG(DSTREG(op)); \ COUNT_CYCLES(1); \ } -void tms340x0_device::movy_a(UINT16 op) { MOVY(A); } -void tms340x0_device::movy_b(UINT16 op) { MOVY(B); } +void tms340x0_device::movy_a(uint16_t op) { MOVY(A); } +void tms340x0_device::movy_b(uint16_t op) { MOVY(B); } @@ -211,8 +211,8 @@ void tms340x0_device::movy_b(UINT16 op) { MOVY(B); } WPIXEL(R##REG(DSTREG(op)),R##REG(SRCREG(op))); \ COUNT_UNKNOWN_CYCLES(2); \ } -void tms340x0_device::pixt_ri_a(UINT16 op) { PIXT_RI(A); } -void tms340x0_device::pixt_ri_b(UINT16 op) { PIXT_RI(B); } +void tms340x0_device::pixt_ri_a(uint16_t op) { PIXT_RI(A); } +void tms340x0_device::pixt_ri_b(uint16_t op) { PIXT_RI(B); } #define PIXT_RIXY(R) \ { \ @@ -231,38 +231,38 @@ void tms340x0_device::pixt_ri_b(UINT16 op) { PIXT_RI(B); } skip: \ COUNT_UNKNOWN_CYCLES(4); \ } -void tms340x0_device::pixt_rixy_a(UINT16 op) { PIXT_RIXY(A); } -void tms340x0_device::pixt_rixy_b(UINT16 op) { PIXT_RIXY(B); } +void tms340x0_device::pixt_rixy_a(uint16_t op) { PIXT_RIXY(A); } +void tms340x0_device::pixt_rixy_b(uint16_t op) { PIXT_RIXY(B); } #define PIXT_IR(R) \ { \ - INT32 temp = RPIXEL(R##REG(SRCREG(op))); \ + int32_t temp = RPIXEL(R##REG(SRCREG(op))); \ CLR_V(); \ R##REG(DSTREG(op)) = temp; \ SET_V_LOG(temp != 0); \ COUNT_CYCLES(4); \ } -void tms340x0_device::pixt_ir_a(UINT16 op) { PIXT_IR(A); } -void tms340x0_device::pixt_ir_b(UINT16 op) { PIXT_IR(B); } +void tms340x0_device::pixt_ir_a(uint16_t op) { PIXT_IR(A); } +void tms340x0_device::pixt_ir_b(uint16_t op) { PIXT_IR(B); } #define PIXT_II(R) \ { \ WPIXEL(R##REG(DSTREG(op)),RPIXEL(R##REG(SRCREG(op)))); \ COUNT_UNKNOWN_CYCLES(4); \ } -void tms340x0_device::pixt_ii_a(UINT16 op) { PIXT_II(A); } -void tms340x0_device::pixt_ii_b(UINT16 op) { PIXT_II(B); } +void tms340x0_device::pixt_ii_a(uint16_t op) { PIXT_II(A); } +void tms340x0_device::pixt_ii_b(uint16_t op) { PIXT_II(B); } #define PIXT_IXYR(R) \ { \ - INT32 temp = RPIXEL(SXYTOL(R##REG_XY(SRCREG(op)))); \ + int32_t temp = RPIXEL(SXYTOL(R##REG_XY(SRCREG(op)))); \ CLR_V(); \ R##REG(DSTREG(op)) = temp; \ SET_V_LOG(temp != 0); \ COUNT_CYCLES(6); \ } -void tms340x0_device::pixt_ixyr_a(UINT16 op) { PIXT_IXYR(A); } -void tms340x0_device::pixt_ixyr_b(UINT16 op) { PIXT_IXYR(B); } +void tms340x0_device::pixt_ixyr_a(uint16_t op) { PIXT_IXYR(A); } +void tms340x0_device::pixt_ixyr_b(uint16_t op) { PIXT_IXYR(B); } #define PIXT_IXYIXY(R) \ { \ @@ -281,8 +281,8 @@ void tms340x0_device::pixt_ixyr_b(UINT16 op) { PIXT_IXYR(B); } skip: \ COUNT_UNKNOWN_CYCLES(7); \ } -void tms340x0_device::pixt_ixyixy_a(UINT16 op) { PIXT_IXYIXY(A); } -void tms340x0_device::pixt_ixyixy_b(UINT16 op) { PIXT_IXYIXY(B); } +void tms340x0_device::pixt_ixyixy_a(uint16_t op) { PIXT_IXYIXY(A); } +void tms340x0_device::pixt_ixyixy_b(uint16_t op) { PIXT_IXYIXY(B); } #define DRAV(R) \ { \ @@ -303,8 +303,8 @@ skip: R##REG_Y(DSTREG(op)) += R##REG_Y(SRCREG(op)); \ COUNT_UNKNOWN_CYCLES(4); \ } -void tms340x0_device::drav_a(UINT16 op) { DRAV(A); } -void tms340x0_device::drav_b(UINT16 op) { DRAV(B); } +void tms340x0_device::drav_a(uint16_t op) { DRAV(A); } +void tms340x0_device::drav_b(uint16_t op) { DRAV(B); } @@ -314,121 +314,121 @@ void tms340x0_device::drav_b(UINT16 op) { DRAV(B); } #define ABS(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 r = 0 - *rd; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t r = 0 - *rd; \ CLR_NZV(); \ if (r > 0) *rd = r; \ SET_NZ_VAL(r); \ - SET_V_LOG(r == (INT32)0x80000000); \ + SET_V_LOG(r == (int32_t)0x80000000); \ COUNT_CYCLES(1); \ } -void tms340x0_device::abs_a(UINT16 op) { ABS(A); } -void tms340x0_device::abs_b(UINT16 op) { ABS(B); } +void tms340x0_device::abs_a(uint16_t op) { ABS(A); } +void tms340x0_device::abs_b(uint16_t op) { ABS(B); } #define ADD(R) \ { \ - INT32 a = R##REG(SRCREG(op)); \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 b = *rd; \ - INT32 r = a + b; \ + int32_t a = R##REG(SRCREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t b = *rd; \ + int32_t r = a + b; \ CLR_NCZV(); \ *rd = r; \ SET_NZCV_ADD(a,b,r); \ COUNT_CYCLES(1); \ } -void tms340x0_device::add_a(UINT16 op) { ADD(A); } -void tms340x0_device::add_b(UINT16 op) { ADD(B); } +void tms340x0_device::add_a(uint16_t op) { ADD(A); } +void tms340x0_device::add_b(uint16_t op) { ADD(B); } #define ADDC(R) \ { \ /* I'm not sure to which side the carry is added to, should */ \ /* verify it against the examples */ \ - INT32 a = R##REG(SRCREG(op)); \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 b = *rd; \ - INT32 r = a + b + (C_FLAG() ? 1 : 0); \ + int32_t a = R##REG(SRCREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t b = *rd; \ + int32_t r = a + b + (C_FLAG() ? 1 : 0); \ CLR_NCZV(); \ *rd = r; \ SET_NZCV_ADD(a,b,r); \ COUNT_CYCLES(1); \ } -void tms340x0_device::addc_a(UINT16 op) { ADDC(A); } -void tms340x0_device::addc_b(UINT16 op) { ADDC(B); } +void tms340x0_device::addc_a(uint16_t op) { ADDC(A); } +void tms340x0_device::addc_b(uint16_t op) { ADDC(B); } #define ADDI_W(R) \ { \ - INT32 a = PARAM_WORD(); \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 b = *rd; \ - INT32 r = a + b; \ + int32_t a = PARAM_WORD(); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t b = *rd; \ + int32_t r = a + b; \ CLR_NCZV(); \ *rd = r; \ SET_NZCV_ADD(a,b,r); \ COUNT_CYCLES(2); \ } -void tms340x0_device::addi_w_a(UINT16 op) { ADDI_W(A); } -void tms340x0_device::addi_w_b(UINT16 op) { ADDI_W(B); } +void tms340x0_device::addi_w_a(uint16_t op) { ADDI_W(A); } +void tms340x0_device::addi_w_b(uint16_t op) { ADDI_W(B); } #define ADDI_L(R) \ { \ - INT32 a = PARAM_LONG(); \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 b = *rd; \ - INT32 r = a + b; \ + int32_t a = PARAM_LONG(); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t b = *rd; \ + int32_t r = a + b; \ CLR_NCZV(); \ *rd = r; \ SET_NZCV_ADD(a,b,r); \ COUNT_CYCLES(3); \ } -void tms340x0_device::addi_l_a(UINT16 op) { ADDI_L(A); } -void tms340x0_device::addi_l_b(UINT16 op) { ADDI_L(B); } +void tms340x0_device::addi_l_a(uint16_t op) { ADDI_L(A); } +void tms340x0_device::addi_l_b(uint16_t op) { ADDI_L(B); } #define ADDK(R) \ { \ - INT32 a = fw_inc[PARAM_K(op)]; \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 b = *rd; \ - INT32 r = a + b; \ + int32_t a = fw_inc[PARAM_K(op)]; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t b = *rd; \ + int32_t r = a + b; \ CLR_NCZV(); \ *rd = r; \ SET_NZCV_ADD(a,b,r); \ COUNT_CYCLES(1); \ } -void tms340x0_device::addk_a(UINT16 op) { ADDK(A); } -void tms340x0_device::addk_b(UINT16 op) { ADDK(B); } +void tms340x0_device::addk_a(uint16_t op) { ADDK(A); } +void tms340x0_device::addk_b(uint16_t op) { ADDK(B); } #define AND(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ *rd &= R##REG(SRCREG(op)); \ SET_Z_VAL(*rd); \ COUNT_CYCLES(1); \ } -void tms340x0_device::and_a(UINT16 op) { AND(A); } -void tms340x0_device::and_b(UINT16 op) { AND(B); } +void tms340x0_device::and_a(uint16_t op) { AND(A); } +void tms340x0_device::and_b(uint16_t op) { AND(B); } #define ANDI(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ *rd &= ~PARAM_LONG(); \ SET_Z_VAL(*rd); \ COUNT_CYCLES(3); \ } -void tms340x0_device::andi_a(UINT16 op) { ANDI(A); } -void tms340x0_device::andi_b(UINT16 op) { ANDI(B); } +void tms340x0_device::andi_a(uint16_t op) { ANDI(A); } +void tms340x0_device::andi_b(uint16_t op) { ANDI(B); } #define ANDN(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ *rd &= ~R##REG(SRCREG(op)); \ SET_Z_VAL(*rd); \ COUNT_CYCLES(1); \ } -void tms340x0_device::andn_a(UINT16 op) { ANDN(A); } -void tms340x0_device::andn_b(UINT16 op) { ANDN(B); } +void tms340x0_device::andn_a(uint16_t op) { ANDN(A); } +void tms340x0_device::andn_b(uint16_t op) { ANDN(B); } #define BTST_K(R) \ { \ @@ -440,8 +440,8 @@ void tms340x0_device::andn_b(UINT16 op) { ANDN(B); } SET_Z_BIT_HI(~R##REG(DSTREG(op)), bit); \ COUNT_CYCLES(1); \ } -void tms340x0_device::btst_k_a(UINT16 op) { BTST_K(A); } -void tms340x0_device::btst_k_b(UINT16 op) { BTST_K(B); } +void tms340x0_device::btst_k_a(uint16_t op) { BTST_K(A); } +void tms340x0_device::btst_k_b(uint16_t op) { BTST_K(B); } #define BTST_R(R) \ { \ @@ -453,10 +453,10 @@ void tms340x0_device::btst_k_b(UINT16 op) { BTST_K(B); } SET_Z_BIT_HI(~R##REG(DSTREG(op)), bit); \ COUNT_CYCLES(2); \ } -void tms340x0_device::btst_r_a(UINT16 op) { BTST_R(A); } -void tms340x0_device::btst_r_b(UINT16 op) { BTST_R(B); } +void tms340x0_device::btst_r_a(uint16_t op) { BTST_R(A); } +void tms340x0_device::btst_r_b(uint16_t op) { BTST_R(B); } -void tms340x0_device::clrc(UINT16 op) +void tms340x0_device::clrc(uint16_t op) { CLR_C(); COUNT_CYCLES(1); @@ -464,41 +464,41 @@ void tms340x0_device::clrc(UINT16 op) #define CMP(R) \ { \ - INT32 *rs = &R##REG(SRCREG(op)); \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 r = *rd - *rs; \ + int32_t *rs = &R##REG(SRCREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t r = *rd - *rs; \ CLR_NCZV(); \ SET_NZCV_SUB(*rd,*rs,r); \ COUNT_CYCLES(1); \ } -void tms340x0_device::cmp_a(UINT16 op) { CMP(A); } -void tms340x0_device::cmp_b(UINT16 op) { CMP(B); } +void tms340x0_device::cmp_a(uint16_t op) { CMP(A); } +void tms340x0_device::cmp_b(uint16_t op) { CMP(B); } #define CMPI_W(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 t = (INT16)~PARAM_WORD(); \ - INT32 r = *rd - t; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t t = (int16_t)~PARAM_WORD(); \ + int32_t r = *rd - t; \ CLR_NCZV(); \ SET_NZCV_SUB(*rd,t,r); \ COUNT_CYCLES(2); \ } -void tms340x0_device::cmpi_w_a(UINT16 op) { CMPI_W(A); } -void tms340x0_device::cmpi_w_b(UINT16 op) { CMPI_W(B); } +void tms340x0_device::cmpi_w_a(uint16_t op) { CMPI_W(A); } +void tms340x0_device::cmpi_w_b(uint16_t op) { CMPI_W(B); } #define CMPI_L(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 t = ~PARAM_LONG(); \ - INT32 r = *rd - t; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t t = ~PARAM_LONG(); \ + int32_t r = *rd - t; \ CLR_NCZV(); \ SET_NZCV_SUB(*rd,t,r); \ COUNT_CYCLES(3); \ } -void tms340x0_device::cmpi_l_a(UINT16 op) { CMPI_L(A); } -void tms340x0_device::cmpi_l_b(UINT16 op) { CMPI_L(B); } +void tms340x0_device::cmpi_l_a(uint16_t op) { CMPI_L(A); } +void tms340x0_device::cmpi_l_b(uint16_t op) { CMPI_L(B); } -void tms340x0_device::dint(UINT16 op) +void tms340x0_device::dint(uint16_t op) { m_st &= ~STBIT_IE; COUNT_CYCLES(3); @@ -506,8 +506,8 @@ void tms340x0_device::dint(UINT16 op) #define DIVS(R) \ { \ - INT32 *rs = &R##REG(SRCREG(op)); \ - INT32 *rd1 = &R##REG(DSTREG(op)); \ + int32_t *rs = &R##REG(SRCREG(op)); \ + int32_t *rd1 = &R##REG(DSTREG(op)); \ CLR_NZV(); \ if (!(DSTREG(op) & 1)) \ { \ @@ -517,11 +517,11 @@ void tms340x0_device::dint(UINT16 op) } \ else \ { \ - INT32 *rd2 = &R##REG(DSTREG(op)+1); \ - INT64 dividend = ((UINT64)*rd1 << 32) | (UINT32)*rd2; \ - INT64 quotient = dividend / *rs; \ - INT32 remainder = dividend % *rs; \ - UINT32 signbits = (INT32)quotient >> 31; \ + int32_t *rd2 = &R##REG(DSTREG(op)+1); \ + int64_t dividend = ((uint64_t)*rd1 << 32) | (uint32_t)*rd2; \ + int64_t quotient = dividend / *rs; \ + int32_t remainder = dividend % *rs; \ + uint32_t signbits = (int32_t)quotient >> 31; \ if (extract_64hi(quotient) != signbits) \ { \ SET_V_LOG(1); \ @@ -549,13 +549,13 @@ void tms340x0_device::dint(UINT16 op) COUNT_CYCLES(39); \ } \ } -void tms340x0_device::divs_a(UINT16 op) { DIVS(A); } -void tms340x0_device::divs_b(UINT16 op) { DIVS(B); } +void tms340x0_device::divs_a(uint16_t op) { DIVS(A); } +void tms340x0_device::divs_b(uint16_t op) { DIVS(B); } #define DIVU(R) \ { \ - INT32 *rs = &R##REG(SRCREG(op)); \ - INT32 *rd1 = &R##REG(DSTREG(op)); \ + int32_t *rs = &R##REG(SRCREG(op)); \ + int32_t *rd1 = &R##REG(DSTREG(op)); \ CLR_ZV(); \ if (!(DSTREG(op) & 1)) \ { \ @@ -565,10 +565,10 @@ void tms340x0_device::divs_b(UINT16 op) { DIVS(B); } } \ else \ { \ - INT32 *rd2 = &R##REG(DSTREG(op)+1); \ - UINT64 dividend = ((UINT64)*rd1 << 32) | (UINT32)*rd2; \ - UINT64 quotient = dividend / (UINT32)*rs; \ - UINT32 remainder = dividend % (UINT32)*rs; \ + int32_t *rd2 = &R##REG(DSTREG(op)+1); \ + uint64_t dividend = ((uint64_t)*rd1 << 32) | (uint32_t)*rd2; \ + uint64_t quotient = dividend / (uint32_t)*rs; \ + uint32_t remainder = dividend % (uint32_t)*rs; \ if (extract_64hi(quotient) != 0) \ { \ SET_V_LOG(1); \ @@ -589,16 +589,16 @@ void tms340x0_device::divs_b(UINT16 op) { DIVS(B); } } \ else \ { \ - *rd1 = (UINT32)*rd1 / (UINT32)*rs; \ + *rd1 = (uint32_t)*rd1 / (uint32_t)*rs; \ SET_Z_VAL(*rd1); \ } \ } \ COUNT_CYCLES(37); \ } -void tms340x0_device::divu_a(UINT16 op) { DIVU(A); } -void tms340x0_device::divu_b(UINT16 op) { DIVU(B); } +void tms340x0_device::divu_a(uint16_t op) { DIVU(A); } +void tms340x0_device::divu_b(uint16_t op) { DIVU(B); } -void tms340x0_device::eint(UINT16 op) +void tms340x0_device::eint(uint16_t op) { m_st |= STBIT_IE; check_interrupt(); @@ -607,24 +607,24 @@ void tms340x0_device::eint(UINT16 op) #define EXGF(F,R) \ { \ - UINT8 shift = F ? 6 : 0; \ - INT32 *rd = &R##REG(DSTREG(op)); \ - UINT32 temp = (m_st >> shift) & 0x3f; \ + uint8_t shift = F ? 6 : 0; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + uint32_t temp = (m_st >> shift) & 0x3f; \ m_st &= ~(0x3f << shift); \ m_st |= (*rd & 0x3f) << shift; \ *rd = temp; \ COUNT_CYCLES(1); \ } -void tms340x0_device::exgf0_a(UINT16 op) { EXGF(0,A); } -void tms340x0_device::exgf0_b(UINT16 op) { EXGF(0,B); } -void tms340x0_device::exgf1_a(UINT16 op) { EXGF(1,A); } -void tms340x0_device::exgf1_b(UINT16 op) { EXGF(1,B); } +void tms340x0_device::exgf0_a(uint16_t op) { EXGF(0,A); } +void tms340x0_device::exgf0_b(uint16_t op) { EXGF(0,B); } +void tms340x0_device::exgf1_a(uint16_t op) { EXGF(1,A); } +void tms340x0_device::exgf1_b(uint16_t op) { EXGF(1,B); } #define LMO(R) \ { \ - UINT32 res = 0; \ - UINT32 rs = R##REG(SRCREG(op)); \ - INT32 *rd = &R##REG(DSTREG(op)); \ + uint32_t res = 0; \ + uint32_t rs = R##REG(SRCREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ SET_Z_VAL(rs); \ if (rs) \ @@ -638,16 +638,16 @@ void tms340x0_device::exgf1_b(UINT16 op) { EXGF(1,B); } *rd = res; \ COUNT_CYCLES(1); \ } -void tms340x0_device::lmo_a(UINT16 op) { LMO(A); } -void tms340x0_device::lmo_b(UINT16 op) { LMO(B); } +void tms340x0_device::lmo_a(uint16_t op) { LMO(A); } +void tms340x0_device::lmo_b(uint16_t op) { LMO(B); } #define MMFM(R) \ { \ - INT32 i; \ - UINT16 l = (UINT16) PARAM_WORD(); \ + int32_t i; \ + uint16_t l = (uint16_t) PARAM_WORD(); \ COUNT_CYCLES(3); \ { \ - INT32 rd = DSTREG(op); \ + int32_t rd = DSTREG(op); \ for (i = 15; i >= 0 ; i--) \ { \ if (l & 0x8000) \ @@ -660,16 +660,16 @@ void tms340x0_device::lmo_b(UINT16 op) { LMO(B); } } \ } \ } -void tms340x0_device::mmfm_a(UINT16 op) { MMFM(A); } -void tms340x0_device::mmfm_b(UINT16 op) { MMFM(B); } +void tms340x0_device::mmfm_a(uint16_t op) { MMFM(A); } +void tms340x0_device::mmfm_b(uint16_t op) { MMFM(B); } #define MMTM(R) \ { \ - UINT32 i; \ - UINT16 l = (UINT16) PARAM_WORD(); \ + uint32_t i; \ + uint16_t l = (uint16_t) PARAM_WORD(); \ COUNT_CYCLES(2); \ { \ - INT32 rd = DSTREG(op); \ + int32_t rd = DSTREG(op); \ if (m_is_34020) \ { \ CLR_N(); \ @@ -687,13 +687,13 @@ void tms340x0_device::mmfm_b(UINT16 op) { MMFM(B); } } \ } \ } -void tms340x0_device::mmtm_a(UINT16 op) { MMTM(A); } -void tms340x0_device::mmtm_b(UINT16 op) { MMTM(B); } +void tms340x0_device::mmtm_a(uint16_t op) { MMTM(A); } +void tms340x0_device::mmtm_b(uint16_t op) { MMTM(B); } #define MODS(R) \ { \ - INT32 *rs = &R##REG(SRCREG(op)); \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rs = &R##REG(SRCREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_NZV(); \ if (*rs != 0) \ { \ @@ -704,31 +704,31 @@ void tms340x0_device::mmtm_b(UINT16 op) { MMTM(B); } SET_V_LOG(1); \ COUNT_CYCLES(40); \ } -void tms340x0_device::mods_a(UINT16 op) { MODS(A); } -void tms340x0_device::mods_b(UINT16 op) { MODS(B); } +void tms340x0_device::mods_a(uint16_t op) { MODS(A); } +void tms340x0_device::mods_b(uint16_t op) { MODS(B); } #define MODU(R) \ { \ - INT32 *rs = &R##REG(SRCREG(op)); \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rs = &R##REG(SRCREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_ZV(); \ if (*rs != 0) \ { \ - *rd = (UINT32)*rd % (UINT32)*rs; \ + *rd = (uint32_t)*rd % (uint32_t)*rs; \ SET_Z_VAL(*rd); \ } \ else \ SET_V_LOG(1); \ COUNT_CYCLES(35); \ } -void tms340x0_device::modu_a(UINT16 op) { MODU(A); } -void tms340x0_device::modu_b(UINT16 op) { MODU(B); } +void tms340x0_device::modu_a(uint16_t op) { MODU(A); } +void tms340x0_device::modu_b(uint16_t op) { MODU(B); } #define MPYS(R) \ { \ - INT32 *rd1 = &R##REG(DSTREG(op)); \ - INT32 m1 = R##REG(SRCREG(op)); \ - INT64 product; \ + int32_t *rd1 = &R##REG(DSTREG(op)); \ + int32_t m1 = R##REG(SRCREG(op)); \ + int64_t product; \ \ SEXTEND(m1, FW(1)); \ CLR_NZ(); \ @@ -741,14 +741,14 @@ void tms340x0_device::modu_b(UINT16 op) { MODU(B); } \ COUNT_CYCLES(20); \ } -void tms340x0_device::mpys_a(UINT16 op) { MPYS(A); } -void tms340x0_device::mpys_b(UINT16 op) { MPYS(B); } +void tms340x0_device::mpys_a(uint16_t op) { MPYS(A); } +void tms340x0_device::mpys_b(uint16_t op) { MPYS(B); } #define MPYU(R) \ { \ - INT32 *rd1 = &R##REG(DSTREG(op)); \ - UINT32 m1 = R##REG(SRCREG(op)); \ - UINT64 product; \ + int32_t *rd1 = &R##REG(DSTREG(op)); \ + uint32_t m1 = R##REG(SRCREG(op)); \ + uint64_t product; \ \ ZEXTEND(m1, FW(1)); \ CLR_Z(); \ @@ -760,73 +760,73 @@ void tms340x0_device::mpys_b(UINT16 op) { MPYS(B); } \ COUNT_CYCLES(21); \ } -void tms340x0_device::mpyu_a(UINT16 op) { MPYU(A); } -void tms340x0_device::mpyu_b(UINT16 op) { MPYU(B); } +void tms340x0_device::mpyu_a(uint16_t op) { MPYU(A); } +void tms340x0_device::mpyu_b(uint16_t op) { MPYU(B); } #define NEG(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 r = 0 - *rd; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t r = 0 - *rd; \ CLR_NCZV(); \ SET_NZCV_SUB(0,*rd,r); \ *rd = r; \ COUNT_CYCLES(1); \ } -void tms340x0_device::neg_a(UINT16 op) { NEG(A); } -void tms340x0_device::neg_b(UINT16 op) { NEG(B); } +void tms340x0_device::neg_a(uint16_t op) { NEG(A); } +void tms340x0_device::neg_b(uint16_t op) { NEG(B); } #define NEGB(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 t = *rd + (C_FLAG() ? 1 : 0); \ - INT32 r = 0 - t; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t t = *rd + (C_FLAG() ? 1 : 0); \ + int32_t r = 0 - t; \ CLR_NCZV(); \ SET_NZCV_SUB(0,t,r); \ *rd = r; \ COUNT_CYCLES(1); \ } -void tms340x0_device::negb_a(UINT16 op) { NEGB(A); } -void tms340x0_device::negb_b(UINT16 op) { NEGB(B); } +void tms340x0_device::negb_a(uint16_t op) { NEGB(A); } +void tms340x0_device::negb_b(uint16_t op) { NEGB(B); } -void tms340x0_device::nop(UINT16 op) +void tms340x0_device::nop(uint16_t op) { COUNT_CYCLES(1); } #define NOT(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ *rd = ~(*rd); \ SET_Z_VAL(*rd); \ COUNT_CYCLES(1); \ } -void tms340x0_device::not_a(UINT16 op) { NOT(A); } -void tms340x0_device::not_b(UINT16 op) { NOT(B); } +void tms340x0_device::not_a(uint16_t op) { NOT(A); } +void tms340x0_device::not_b(uint16_t op) { NOT(B); } #define OR(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ *rd |= R##REG(SRCREG(op)); \ SET_Z_VAL(*rd); \ COUNT_CYCLES(1); \ } -void tms340x0_device::or_a(UINT16 op) { OR(A); } -void tms340x0_device::or_b(UINT16 op) { OR(B); } +void tms340x0_device::or_a(uint16_t op) { OR(A); } +void tms340x0_device::or_b(uint16_t op) { OR(B); } #define ORI(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ *rd |= PARAM_LONG(); \ SET_Z_VAL(*rd); \ COUNT_CYCLES(3); \ } -void tms340x0_device::ori_a(UINT16 op) { ORI(A); } -void tms340x0_device::ori_b(UINT16 op) { ORI(B); } +void tms340x0_device::ori_a(uint16_t op) { ORI(A); } +void tms340x0_device::ori_b(uint16_t op) { ORI(B); } -void tms340x0_device::setc(UINT16 op) +void tms340x0_device::setc(uint16_t op) { SET_C_LOG(1); COUNT_CYCLES(1); @@ -834,59 +834,59 @@ void tms340x0_device::setc(UINT16 op) #define SETF(F) \ { \ - UINT8 shift = F ? 6 : 0; \ + uint8_t shift = F ? 6 : 0; \ m_st &= ~(0x3f << shift); \ m_st |= (op & 0x3f) << shift; \ COUNT_CYCLES(1+F); \ } -void tms340x0_device::setf0(UINT16 op) { SETF(0); } -void tms340x0_device::setf1(UINT16 op) { SETF(1); } +void tms340x0_device::setf0(uint16_t op) { SETF(0); } +void tms340x0_device::setf1(uint16_t op) { SETF(1); } #define SEXT(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_NZ(); \ SEXTEND(*rd,FW(F)); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(3); \ } -void tms340x0_device::sext0_a(UINT16 op) { SEXT(0,A); } -void tms340x0_device::sext0_b(UINT16 op) { SEXT(0,B); } -void tms340x0_device::sext1_a(UINT16 op) { SEXT(1,A); } -void tms340x0_device::sext1_b(UINT16 op) { SEXT(1,B); } +void tms340x0_device::sext0_a(uint16_t op) { SEXT(0,A); } +void tms340x0_device::sext0_b(uint16_t op) { SEXT(0,B); } +void tms340x0_device::sext1_a(uint16_t op) { SEXT(1,A); } +void tms340x0_device::sext1_b(uint16_t op) { SEXT(1,B); } #define RL(R,K) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 res = *rd; \ - INT32 k = (K); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t res = *rd; \ + int32_t k = (K); \ CLR_CZ(); \ if (k) \ { \ res<<=(k-1); \ SET_C_BIT_HI(res, 31); \ res<<=1; \ - res |= (((UINT32)*rd)>>((-k)&0x1f)); \ + res |= (((uint32_t)*rd)>>((-k)&0x1f)); \ *rd = res; \ } \ SET_Z_VAL(res); \ COUNT_CYCLES(1); \ } -void tms340x0_device::rl_k_a(UINT16 op) { RL(A,PARAM_K(op)); } -void tms340x0_device::rl_k_b(UINT16 op) { RL(B,PARAM_K(op)); } -void tms340x0_device::rl_r_a(UINT16 op) { RL(A,AREG(SRCREG(op))&0x1f); } -void tms340x0_device::rl_r_b(UINT16 op) { RL(B,BREG(SRCREG(op))&0x1f); } +void tms340x0_device::rl_k_a(uint16_t op) { RL(A,PARAM_K(op)); } +void tms340x0_device::rl_k_b(uint16_t op) { RL(B,PARAM_K(op)); } +void tms340x0_device::rl_r_a(uint16_t op) { RL(A,AREG(SRCREG(op))&0x1f); } +void tms340x0_device::rl_r_b(uint16_t op) { RL(B,BREG(SRCREG(op))&0x1f); } #define SLA(R,K) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - UINT32 res = *rd; \ - INT32 k = K; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + uint32_t res = *rd; \ + int32_t k = K; \ CLR_NCZV(); \ if (k) \ { \ - UINT32 mask = (0xffffffff<<(31-k))&0x7fffffff; \ - UINT32 res2 = SIGN(res) ? res^mask : res; \ + uint32_t mask = (0xffffffff<<(31-k))&0x7fffffff; \ + uint32_t res2 = SIGN(res) ? res^mask : res; \ SET_V_LOG((res2 & mask) != 0); \ \ res<<=(k-1); \ @@ -897,16 +897,16 @@ void tms340x0_device::rl_r_b(UINT16 op) { RL(B,BREG(SRCREG(op))&0x1f); } SET_NZ_VAL(res); \ COUNT_CYCLES(3); \ } -void tms340x0_device::sla_k_a(UINT16 op) { SLA(A,PARAM_K(op)); } -void tms340x0_device::sla_k_b(UINT16 op) { SLA(B,PARAM_K(op)); } -void tms340x0_device::sla_r_a(UINT16 op) { SLA(A,AREG(SRCREG(op))&0x1f); } -void tms340x0_device::sla_r_b(UINT16 op) { SLA(B,BREG(SRCREG(op))&0x1f); } +void tms340x0_device::sla_k_a(uint16_t op) { SLA(A,PARAM_K(op)); } +void tms340x0_device::sla_k_b(uint16_t op) { SLA(B,PARAM_K(op)); } +void tms340x0_device::sla_r_a(uint16_t op) { SLA(A,AREG(SRCREG(op))&0x1f); } +void tms340x0_device::sla_r_b(uint16_t op) { SLA(B,BREG(SRCREG(op))&0x1f); } #define SLL(R,K) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - UINT32 res = *rd; \ - INT32 k = K; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + uint32_t res = *rd; \ + int32_t k = K; \ CLR_CZ(); \ if (k) \ { \ @@ -918,16 +918,16 @@ void tms340x0_device::sla_r_b(UINT16 op) { SLA(B,BREG(SRCREG(op))&0x1f); } SET_Z_VAL(res); \ COUNT_CYCLES(1); \ } -void tms340x0_device::sll_k_a(UINT16 op) { SLL(A,PARAM_K(op)); } -void tms340x0_device::sll_k_b(UINT16 op) { SLL(B,PARAM_K(op)); } -void tms340x0_device::sll_r_a(UINT16 op) { SLL(A,AREG(SRCREG(op))&0x1f); } -void tms340x0_device::sll_r_b(UINT16 op) { SLL(B,BREG(SRCREG(op))&0x1f); } +void tms340x0_device::sll_k_a(uint16_t op) { SLL(A,PARAM_K(op)); } +void tms340x0_device::sll_k_b(uint16_t op) { SLL(B,PARAM_K(op)); } +void tms340x0_device::sll_r_a(uint16_t op) { SLL(A,AREG(SRCREG(op))&0x1f); } +void tms340x0_device::sll_r_b(uint16_t op) { SLL(B,BREG(SRCREG(op))&0x1f); } #define SRA(R,K) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 res = *rd; \ - INT32 k = (-(K)) & 0x1f; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t res = *rd; \ + int32_t k = (-(K)) & 0x1f; \ CLR_NCZ(); \ if (k) \ { \ @@ -939,16 +939,16 @@ void tms340x0_device::sll_r_b(UINT16 op) { SLL(B,BREG(SRCREG(op))&0x1f); } SET_NZ_VAL(res); \ COUNT_CYCLES(1); \ } -void tms340x0_device::sra_k_a(UINT16 op) { SRA(A,PARAM_K(op)); } -void tms340x0_device::sra_k_b(UINT16 op) { SRA(B,PARAM_K(op)); } -void tms340x0_device::sra_r_a(UINT16 op) { SRA(A,AREG(SRCREG(op))); } -void tms340x0_device::sra_r_b(UINT16 op) { SRA(B,BREG(SRCREG(op))); } +void tms340x0_device::sra_k_a(uint16_t op) { SRA(A,PARAM_K(op)); } +void tms340x0_device::sra_k_b(uint16_t op) { SRA(B,PARAM_K(op)); } +void tms340x0_device::sra_r_a(uint16_t op) { SRA(A,AREG(SRCREG(op))); } +void tms340x0_device::sra_r_b(uint16_t op) { SRA(B,BREG(SRCREG(op))); } #define SRL(R,K) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - UINT32 res = *rd; \ - INT32 k = (-(K)) & 0x1f; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + uint32_t res = *rd; \ + int32_t k = (-(K)) & 0x1f; \ CLR_CZ(); \ if (k) \ { \ @@ -960,111 +960,111 @@ void tms340x0_device::sra_r_b(UINT16 op) { SRA(B,BREG(SRCREG(op))); } SET_Z_VAL(res); \ COUNT_CYCLES(1); \ } -void tms340x0_device::srl_k_a(UINT16 op) { SRL(A,PARAM_K(op)); } -void tms340x0_device::srl_k_b(UINT16 op) { SRL(B,PARAM_K(op)); } -void tms340x0_device::srl_r_a(UINT16 op) { SRL(A,AREG(SRCREG(op))); } -void tms340x0_device::srl_r_b(UINT16 op) { SRL(B,BREG(SRCREG(op))); } +void tms340x0_device::srl_k_a(uint16_t op) { SRL(A,PARAM_K(op)); } +void tms340x0_device::srl_k_b(uint16_t op) { SRL(B,PARAM_K(op)); } +void tms340x0_device::srl_r_a(uint16_t op) { SRL(A,AREG(SRCREG(op))); } +void tms340x0_device::srl_r_b(uint16_t op) { SRL(B,BREG(SRCREG(op))); } #define SUB(R) \ { \ - INT32 *rs = &R##REG(SRCREG(op)); \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 r = *rd - *rs; \ + int32_t *rs = &R##REG(SRCREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t r = *rd - *rs; \ CLR_NCZV(); \ SET_NZCV_SUB(*rd,*rs,r); \ *rd = r; \ COUNT_CYCLES(1); \ } -void tms340x0_device::sub_a(UINT16 op) { SUB(A); } -void tms340x0_device::sub_b(UINT16 op) { SUB(B); } +void tms340x0_device::sub_a(uint16_t op) { SUB(A); } +void tms340x0_device::sub_b(uint16_t op) { SUB(B); } #define SUBB(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 t = R##REG(SRCREG(op)); \ - INT32 r = *rd - t - (C_FLAG() ? 1 : 0); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t t = R##REG(SRCREG(op)); \ + int32_t r = *rd - t - (C_FLAG() ? 1 : 0); \ CLR_NCZV(); \ SET_NZCV_SUB(*rd,t,r); \ *rd = r; \ COUNT_CYCLES(1); \ } -void tms340x0_device::subb_a(UINT16 op) { SUBB(A); } -void tms340x0_device::subb_b(UINT16 op) { SUBB(B); } +void tms340x0_device::subb_a(uint16_t op) { SUBB(A); } +void tms340x0_device::subb_b(uint16_t op) { SUBB(B); } #define SUBI_W(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 r; \ - INT32 t = ~PARAM_WORD(); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t r; \ + int32_t t = ~PARAM_WORD(); \ CLR_NCZV(); \ r = *rd - t; \ SET_NZCV_SUB(*rd,t,r); \ *rd = r; \ COUNT_CYCLES(2); \ } -void tms340x0_device::subi_w_a(UINT16 op) { SUBI_W(A); } -void tms340x0_device::subi_w_b(UINT16 op) { SUBI_W(B); } +void tms340x0_device::subi_w_a(uint16_t op) { SUBI_W(A); } +void tms340x0_device::subi_w_b(uint16_t op) { SUBI_W(B); } #define SUBI_L(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 t = ~PARAM_LONG(); \ - INT32 r = *rd - t; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t t = ~PARAM_LONG(); \ + int32_t r = *rd - t; \ CLR_NCZV(); \ SET_NZCV_SUB(*rd,t,r); \ *rd = r; \ COUNT_CYCLES(3); \ } -void tms340x0_device::subi_l_a(UINT16 op) { SUBI_L(A); } -void tms340x0_device::subi_l_b(UINT16 op) { SUBI_L(B); } +void tms340x0_device::subi_l_a(uint16_t op) { SUBI_L(A); } +void tms340x0_device::subi_l_b(uint16_t op) { SUBI_L(B); } #define SUBK(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 t = fw_inc[PARAM_K(op)]; \ - INT32 r = *rd - t; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t t = fw_inc[PARAM_K(op)]; \ + int32_t r = *rd - t; \ CLR_NCZV(); \ SET_NZCV_SUB(*rd,t,r); \ *rd = r; \ COUNT_CYCLES(1); \ } -void tms340x0_device::subk_a(UINT16 op) { SUBK(A); } -void tms340x0_device::subk_b(UINT16 op) { SUBK(B); } +void tms340x0_device::subk_a(uint16_t op) { SUBK(A); } +void tms340x0_device::subk_b(uint16_t op) { SUBK(B); } #define XOR(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ *rd ^= R##REG(SRCREG(op)); \ SET_Z_VAL(*rd); \ COUNT_CYCLES(1); \ } -void tms340x0_device::xor_a(UINT16 op) { XOR(A); } -void tms340x0_device::xor_b(UINT16 op) { XOR(B); } +void tms340x0_device::xor_a(uint16_t op) { XOR(A); } +void tms340x0_device::xor_b(uint16_t op) { XOR(B); } #define XORI(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ *rd ^= PARAM_LONG(); \ SET_Z_VAL(*rd); \ COUNT_CYCLES(3); \ } -void tms340x0_device::xori_a(UINT16 op) { XORI(A); } -void tms340x0_device::xori_b(UINT16 op) { XORI(B); } +void tms340x0_device::xori_a(uint16_t op) { XORI(A); } +void tms340x0_device::xori_b(uint16_t op) { XORI(B); } #define ZEXT(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ ZEXTEND(*rd,FW(F)); \ SET_Z_VAL(*rd); \ COUNT_CYCLES(1); \ } -void tms340x0_device::zext0_a(UINT16 op) { ZEXT(0,A); } -void tms340x0_device::zext0_b(UINT16 op) { ZEXT(0,B); } -void tms340x0_device::zext1_a(UINT16 op) { ZEXT(1,A); } -void tms340x0_device::zext1_b(UINT16 op) { ZEXT(1,B); } +void tms340x0_device::zext0_a(uint16_t op) { ZEXT(0,A); } +void tms340x0_device::zext0_b(uint16_t op) { ZEXT(0,B); } +void tms340x0_device::zext1_a(uint16_t op) { ZEXT(1,A); } +void tms340x0_device::zext1_b(uint16_t op) { ZEXT(1,B); } @@ -1074,346 +1074,346 @@ void tms340x0_device::zext1_b(UINT16 op) { ZEXT(1,B); } #define MOVI_W(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_NZV(); \ *rd=PARAM_WORD(); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(2); \ } -void tms340x0_device::movi_w_a(UINT16 op) { MOVI_W(A); } -void tms340x0_device::movi_w_b(UINT16 op) { MOVI_W(B); } +void tms340x0_device::movi_w_a(uint16_t op) { MOVI_W(A); } +void tms340x0_device::movi_w_b(uint16_t op) { MOVI_W(B); } #define MOVI_L(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_NZV(); \ *rd=PARAM_LONG(); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(3); \ } -void tms340x0_device::movi_l_a(UINT16 op) { MOVI_L(A); } -void tms340x0_device::movi_l_b(UINT16 op) { MOVI_L(B); } +void tms340x0_device::movi_l_a(uint16_t op) { MOVI_L(A); } +void tms340x0_device::movi_l_b(uint16_t op) { MOVI_L(B); } #define MOVK(R) \ { \ - INT32 k = PARAM_K(op); if (!k) k = 32; \ + int32_t k = PARAM_K(op); if (!k) k = 32; \ R##REG(DSTREG(op)) = k; \ COUNT_CYCLES(1); \ } -void tms340x0_device::movk_a(UINT16 op) { MOVK(A); } -void tms340x0_device::movk_b(UINT16 op) { MOVK(B); } +void tms340x0_device::movk_a(uint16_t op) { MOVK(A); } +void tms340x0_device::movk_b(uint16_t op) { MOVK(B); } #define MOVB_RN(R) \ { \ WBYTE(R##REG(DSTREG(op)),R##REG(SRCREG(op))); \ COUNT_CYCLES(1); \ } -void tms340x0_device::movb_rn_a(UINT16 op) { MOVB_RN(A); } -void tms340x0_device::movb_rn_b(UINT16 op) { MOVB_RN(B); } +void tms340x0_device::movb_rn_a(uint16_t op) { MOVB_RN(A); } +void tms340x0_device::movb_rn_b(uint16_t op) { MOVB_RN(B); } #define MOVB_NR(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_NZV(); \ - *rd = (INT8)RBYTE(R##REG(SRCREG(op))); \ + *rd = (int8_t)RBYTE(R##REG(SRCREG(op))); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(3); \ } -void tms340x0_device::movb_nr_a(UINT16 op) { MOVB_NR(A); } -void tms340x0_device::movb_nr_b(UINT16 op) { MOVB_NR(B); } +void tms340x0_device::movb_nr_a(uint16_t op) { MOVB_NR(A); } +void tms340x0_device::movb_nr_b(uint16_t op) { MOVB_NR(B); } #define MOVB_NN(R) \ { \ - WBYTE(R##REG(DSTREG(op)),(UINT32)(UINT8)RBYTE(R##REG(SRCREG(op))));\ + WBYTE(R##REG(DSTREG(op)),(uint32_t)(uint8_t)RBYTE(R##REG(SRCREG(op))));\ COUNT_CYCLES(3); \ } -void tms340x0_device::movb_nn_a(UINT16 op) { MOVB_NN(A); } -void tms340x0_device::movb_nn_b(UINT16 op) { MOVB_NN(B); } +void tms340x0_device::movb_nn_a(uint16_t op) { MOVB_NN(A); } +void tms340x0_device::movb_nn_b(uint16_t op) { MOVB_NN(B); } #define MOVB_R_NO(R) \ { \ - INT32 o = PARAM_WORD(); \ + int32_t o = PARAM_WORD(); \ WBYTE(R##REG(DSTREG(op))+o,R##REG(SRCREG(op))); \ COUNT_CYCLES(3); \ } -void tms340x0_device::movb_r_no_a(UINT16 op) { MOVB_R_NO(A); } -void tms340x0_device::movb_r_no_b(UINT16 op) { MOVB_R_NO(B); } +void tms340x0_device::movb_r_no_a(uint16_t op) { MOVB_R_NO(A); } +void tms340x0_device::movb_r_no_b(uint16_t op) { MOVB_R_NO(B); } #define MOVB_NO_R(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 o = PARAM_WORD(); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t o = PARAM_WORD(); \ CLR_NZV(); \ - *rd = (INT8)RBYTE(R##REG(SRCREG(op))+o); \ + *rd = (int8_t)RBYTE(R##REG(SRCREG(op))+o); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(5); \ } -void tms340x0_device::movb_no_r_a(UINT16 op) { MOVB_NO_R(A); } -void tms340x0_device::movb_no_r_b(UINT16 op) { MOVB_NO_R(B); } +void tms340x0_device::movb_no_r_a(uint16_t op) { MOVB_NO_R(A); } +void tms340x0_device::movb_no_r_b(uint16_t op) { MOVB_NO_R(B); } #define MOVB_NO_NO(R) \ { \ - INT32 o1 = PARAM_WORD(); \ - INT32 o2 = PARAM_WORD(); \ - WBYTE(R##REG(DSTREG(op))+o2,(UINT32)(UINT8)RBYTE(R##REG(SRCREG(op))+o1)); \ + int32_t o1 = PARAM_WORD(); \ + int32_t o2 = PARAM_WORD(); \ + WBYTE(R##REG(DSTREG(op))+o2,(uint32_t)(uint8_t)RBYTE(R##REG(SRCREG(op))+o1)); \ COUNT_CYCLES(5); \ } -void tms340x0_device::movb_no_no_a(UINT16 op) { MOVB_NO_NO(A); } -void tms340x0_device::movb_no_no_b(UINT16 op) { MOVB_NO_NO(B); } +void tms340x0_device::movb_no_no_a(uint16_t op) { MOVB_NO_NO(A); } +void tms340x0_device::movb_no_no_b(uint16_t op) { MOVB_NO_NO(B); } #define MOVB_RA(R) \ { \ WBYTE(PARAM_LONG(),R##REG(DSTREG(op))); \ COUNT_CYCLES(1); \ } -void tms340x0_device::movb_ra_a(UINT16 op) { MOVB_RA(A); } -void tms340x0_device::movb_ra_b(UINT16 op) { MOVB_RA(B); } +void tms340x0_device::movb_ra_a(uint16_t op) { MOVB_RA(A); } +void tms340x0_device::movb_ra_b(uint16_t op) { MOVB_RA(B); } #define MOVB_AR(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_NZV(); \ - *rd = (INT8)RBYTE(PARAM_LONG()); \ + *rd = (int8_t)RBYTE(PARAM_LONG()); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(5); \ } -void tms340x0_device::movb_ar_a(UINT16 op) { MOVB_AR(A); } -void tms340x0_device::movb_ar_b(UINT16 op) { MOVB_AR(B); } +void tms340x0_device::movb_ar_a(uint16_t op) { MOVB_AR(A); } +void tms340x0_device::movb_ar_b(uint16_t op) { MOVB_AR(B); } -void tms340x0_device::movb_aa(UINT16 op) +void tms340x0_device::movb_aa(uint16_t op) { - UINT32 bitaddrs=PARAM_LONG(); - WBYTE(PARAM_LONG(),(UINT32)(UINT8)RBYTE(bitaddrs)); + uint32_t bitaddrs=PARAM_LONG(); + WBYTE(PARAM_LONG(),(uint32_t)(uint8_t)RBYTE(bitaddrs)); COUNT_CYCLES(6); } #define MOVE_RR(RS,RD) \ { \ - INT32 *rd = &RD##REG(DSTREG(op)); \ + int32_t *rd = &RD##REG(DSTREG(op)); \ CLR_NZV(); \ *rd = RS##REG(SRCREG(op)); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(1); \ } -void tms340x0_device::move_rr_a (UINT16 op) { MOVE_RR(A,A); } -void tms340x0_device::move_rr_b (UINT16 op) { MOVE_RR(B,B); } -void tms340x0_device::move_rr_ax(UINT16 op) { MOVE_RR(A,B); } -void tms340x0_device::move_rr_bx(UINT16 op) { MOVE_RR(B,A); } +void tms340x0_device::move_rr_a (uint16_t op) { MOVE_RR(A,A); } +void tms340x0_device::move_rr_b (uint16_t op) { MOVE_RR(B,B); } +void tms340x0_device::move_rr_ax(uint16_t op) { MOVE_RR(A,B); } +void tms340x0_device::move_rr_bx(uint16_t op) { MOVE_RR(B,A); } #define MOVE_RN(F,R) \ { \ WFIELD##F(R##REG(DSTREG(op)),R##REG(SRCREG(op))); \ COUNT_CYCLES(1); \ } -void tms340x0_device::move0_rn_a (UINT16 op) { MOVE_RN(0,A); } -void tms340x0_device::move0_rn_b (UINT16 op) { MOVE_RN(0,B); } -void tms340x0_device::move1_rn_a (UINT16 op) { MOVE_RN(1,A); } -void tms340x0_device::move1_rn_b (UINT16 op) { MOVE_RN(1,B); } +void tms340x0_device::move0_rn_a (uint16_t op) { MOVE_RN(0,A); } +void tms340x0_device::move0_rn_b (uint16_t op) { MOVE_RN(0,B); } +void tms340x0_device::move1_rn_a (uint16_t op) { MOVE_RN(1,A); } +void tms340x0_device::move1_rn_b (uint16_t op) { MOVE_RN(1,B); } #define MOVE_R_DN(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ *rd-=fw_inc[FW(F)]; \ WFIELD##F(*rd,R##REG(SRCREG(op))); \ COUNT_CYCLES(2); \ } -void tms340x0_device::move0_r_dn_a (UINT16 op) { MOVE_R_DN(0,A); } -void tms340x0_device::move0_r_dn_b (UINT16 op) { MOVE_R_DN(0,B); } -void tms340x0_device::move1_r_dn_a (UINT16 op) { MOVE_R_DN(1,A); } -void tms340x0_device::move1_r_dn_b (UINT16 op) { MOVE_R_DN(1,B); } +void tms340x0_device::move0_r_dn_a (uint16_t op) { MOVE_R_DN(0,A); } +void tms340x0_device::move0_r_dn_b (uint16_t op) { MOVE_R_DN(0,B); } +void tms340x0_device::move1_r_dn_a (uint16_t op) { MOVE_R_DN(1,A); } +void tms340x0_device::move1_r_dn_b (uint16_t op) { MOVE_R_DN(1,B); } #define MOVE_R_NI(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ WFIELD##F(*rd,R##REG(SRCREG(op))); \ *rd+=fw_inc[FW(F)]; \ COUNT_CYCLES(1); \ } -void tms340x0_device::move0_r_ni_a (UINT16 op) { MOVE_R_NI(0,A); } -void tms340x0_device::move0_r_ni_b (UINT16 op) { MOVE_R_NI(0,B); } -void tms340x0_device::move1_r_ni_a (UINT16 op) { MOVE_R_NI(1,A); } -void tms340x0_device::move1_r_ni_b (UINT16 op) { MOVE_R_NI(1,B); } +void tms340x0_device::move0_r_ni_a (uint16_t op) { MOVE_R_NI(0,A); } +void tms340x0_device::move0_r_ni_b (uint16_t op) { MOVE_R_NI(0,B); } +void tms340x0_device::move1_r_ni_a (uint16_t op) { MOVE_R_NI(1,A); } +void tms340x0_device::move1_r_ni_b (uint16_t op) { MOVE_R_NI(1,B); } #define MOVE_NR(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_NZV(); \ *rd = RFIELD##F(R##REG(SRCREG(op))); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(3); \ } -void tms340x0_device::move0_nr_a (UINT16 op) { MOVE_NR(0,A); } -void tms340x0_device::move0_nr_b (UINT16 op) { MOVE_NR(0,B); } -void tms340x0_device::move1_nr_a (UINT16 op) { MOVE_NR(1,A); } -void tms340x0_device::move1_nr_b (UINT16 op) { MOVE_NR(1,B); } +void tms340x0_device::move0_nr_a (uint16_t op) { MOVE_NR(0,A); } +void tms340x0_device::move0_nr_b (uint16_t op) { MOVE_NR(0,B); } +void tms340x0_device::move1_nr_a (uint16_t op) { MOVE_NR(1,A); } +void tms340x0_device::move1_nr_b (uint16_t op) { MOVE_NR(1,B); } #define MOVE_DN_R(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 *rs = &R##REG(SRCREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t *rs = &R##REG(SRCREG(op)); \ CLR_NZV(); \ *rs-=fw_inc[FW(F)]; \ *rd = RFIELD##F(*rs); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(4); \ } -void tms340x0_device::move0_dn_r_a (UINT16 op) { MOVE_DN_R(0,A); } -void tms340x0_device::move0_dn_r_b (UINT16 op) { MOVE_DN_R(0,B); } -void tms340x0_device::move1_dn_r_a (UINT16 op) { MOVE_DN_R(1,A); } -void tms340x0_device::move1_dn_r_b (UINT16 op) { MOVE_DN_R(1,B); } +void tms340x0_device::move0_dn_r_a (uint16_t op) { MOVE_DN_R(0,A); } +void tms340x0_device::move0_dn_r_b (uint16_t op) { MOVE_DN_R(0,B); } +void tms340x0_device::move1_dn_r_a (uint16_t op) { MOVE_DN_R(1,A); } +void tms340x0_device::move1_dn_r_b (uint16_t op) { MOVE_DN_R(1,B); } #define MOVE_NI_R(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 *rs = &R##REG(SRCREG(op)); \ - INT32 data = RFIELD##F(*rs); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t *rs = &R##REG(SRCREG(op)); \ + int32_t data = RFIELD##F(*rs); \ CLR_NZV(); \ *rs+=fw_inc[FW(F)]; \ *rd = data; \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(3); \ } -void tms340x0_device::move0_ni_r_a (UINT16 op) { MOVE_NI_R(0,A); } -void tms340x0_device::move0_ni_r_b (UINT16 op) { MOVE_NI_R(0,B); } -void tms340x0_device::move1_ni_r_a (UINT16 op) { MOVE_NI_R(1,A); } -void tms340x0_device::move1_ni_r_b (UINT16 op) { MOVE_NI_R(1,B); } +void tms340x0_device::move0_ni_r_a (uint16_t op) { MOVE_NI_R(0,A); } +void tms340x0_device::move0_ni_r_b (uint16_t op) { MOVE_NI_R(0,B); } +void tms340x0_device::move1_ni_r_a (uint16_t op) { MOVE_NI_R(1,A); } +void tms340x0_device::move1_ni_r_b (uint16_t op) { MOVE_NI_R(1,B); } #define MOVE_NN(F,R) \ { \ WFIELD##F(R##REG(DSTREG(op)),RFIELD##F(R##REG(SRCREG(op)))); \ COUNT_CYCLES(3); \ } -void tms340x0_device::move0_nn_a (UINT16 op) { MOVE_NN(0,A); } -void tms340x0_device::move0_nn_b (UINT16 op) { MOVE_NN(0,B); } -void tms340x0_device::move1_nn_a (UINT16 op) { MOVE_NN(1,A); } -void tms340x0_device::move1_nn_b (UINT16 op) { MOVE_NN(1,B); } +void tms340x0_device::move0_nn_a (uint16_t op) { MOVE_NN(0,A); } +void tms340x0_device::move0_nn_b (uint16_t op) { MOVE_NN(0,B); } +void tms340x0_device::move1_nn_a (uint16_t op) { MOVE_NN(1,A); } +void tms340x0_device::move1_nn_b (uint16_t op) { MOVE_NN(1,B); } #define MOVE_DN_DN(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 *rs = &R##REG(SRCREG(op)); \ - INT32 data; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t *rs = &R##REG(SRCREG(op)); \ + int32_t data; \ *rs-=fw_inc[FW(F)]; \ data = RFIELD##F(*rs); \ *rd-=fw_inc[FW(F)]; \ WFIELD##F(*rd,data); \ COUNT_CYCLES(4); \ } -void tms340x0_device::move0_dn_dn_a (UINT16 op) { MOVE_DN_DN(0,A); } -void tms340x0_device::move0_dn_dn_b (UINT16 op) { MOVE_DN_DN(0,B); } -void tms340x0_device::move1_dn_dn_a (UINT16 op) { MOVE_DN_DN(1,A); } -void tms340x0_device::move1_dn_dn_b (UINT16 op) { MOVE_DN_DN(1,B); } +void tms340x0_device::move0_dn_dn_a (uint16_t op) { MOVE_DN_DN(0,A); } +void tms340x0_device::move0_dn_dn_b (uint16_t op) { MOVE_DN_DN(0,B); } +void tms340x0_device::move1_dn_dn_a (uint16_t op) { MOVE_DN_DN(1,A); } +void tms340x0_device::move1_dn_dn_b (uint16_t op) { MOVE_DN_DN(1,B); } #define MOVE_NI_NI(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 *rs = &R##REG(SRCREG(op)); \ - INT32 data = RFIELD##F(*rs); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t *rs = &R##REG(SRCREG(op)); \ + int32_t data = RFIELD##F(*rs); \ *rs+=fw_inc[FW(F)]; \ WFIELD##F(*rd,data); \ *rd+=fw_inc[FW(F)]; \ COUNT_CYCLES(4); \ } -void tms340x0_device::move0_ni_ni_a (UINT16 op) { MOVE_NI_NI(0,A); } -void tms340x0_device::move0_ni_ni_b (UINT16 op) { MOVE_NI_NI(0,B); } -void tms340x0_device::move1_ni_ni_a (UINT16 op) { MOVE_NI_NI(1,A); } -void tms340x0_device::move1_ni_ni_b (UINT16 op) { MOVE_NI_NI(1,B); } +void tms340x0_device::move0_ni_ni_a (uint16_t op) { MOVE_NI_NI(0,A); } +void tms340x0_device::move0_ni_ni_b (uint16_t op) { MOVE_NI_NI(0,B); } +void tms340x0_device::move1_ni_ni_a (uint16_t op) { MOVE_NI_NI(1,A); } +void tms340x0_device::move1_ni_ni_b (uint16_t op) { MOVE_NI_NI(1,B); } #define MOVE_R_NO(F,R) \ { \ - INT32 o = PARAM_WORD(); \ + int32_t o = PARAM_WORD(); \ WFIELD##F(R##REG(DSTREG(op))+o,R##REG(SRCREG(op))); \ COUNT_CYCLES(3); \ } -void tms340x0_device::move0_r_no_a (UINT16 op) { MOVE_R_NO(0,A); } -void tms340x0_device::move0_r_no_b (UINT16 op) { MOVE_R_NO(0,B); } -void tms340x0_device::move1_r_no_a (UINT16 op) { MOVE_R_NO(1,A); } -void tms340x0_device::move1_r_no_b (UINT16 op) { MOVE_R_NO(1,B); } +void tms340x0_device::move0_r_no_a (uint16_t op) { MOVE_R_NO(0,A); } +void tms340x0_device::move0_r_no_b (uint16_t op) { MOVE_R_NO(0,B); } +void tms340x0_device::move1_r_no_a (uint16_t op) { MOVE_R_NO(1,A); } +void tms340x0_device::move1_r_no_b (uint16_t op) { MOVE_R_NO(1,B); } #define MOVE_NO_R(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 o = PARAM_WORD(); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t o = PARAM_WORD(); \ CLR_NZV(); \ *rd = RFIELD##F(R##REG(SRCREG(op))+o); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(5); \ } -void tms340x0_device::move0_no_r_a (UINT16 op) { MOVE_NO_R(0,A); } -void tms340x0_device::move0_no_r_b (UINT16 op) { MOVE_NO_R(0,B); } -void tms340x0_device::move1_no_r_a (UINT16 op) { MOVE_NO_R(1,A); } -void tms340x0_device::move1_no_r_b (UINT16 op) { MOVE_NO_R(1,B); } +void tms340x0_device::move0_no_r_a (uint16_t op) { MOVE_NO_R(0,A); } +void tms340x0_device::move0_no_r_b (uint16_t op) { MOVE_NO_R(0,B); } +void tms340x0_device::move1_no_r_a (uint16_t op) { MOVE_NO_R(1,A); } +void tms340x0_device::move1_no_r_b (uint16_t op) { MOVE_NO_R(1,B); } #define MOVE_NO_NI(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 o = PARAM_WORD(); \ - INT32 data = RFIELD##F(R##REG(SRCREG(op))+o); \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t o = PARAM_WORD(); \ + int32_t data = RFIELD##F(R##REG(SRCREG(op))+o); \ WFIELD##F(*rd,data); \ *rd+=fw_inc[FW(F)]; \ COUNT_CYCLES(5); \ } -void tms340x0_device::move0_no_ni_a (UINT16 op) { MOVE_NO_NI(0,A); } -void tms340x0_device::move0_no_ni_b (UINT16 op) { MOVE_NO_NI(0,B); } -void tms340x0_device::move1_no_ni_a (UINT16 op) { MOVE_NO_NI(1,A); } -void tms340x0_device::move1_no_ni_b (UINT16 op) { MOVE_NO_NI(1,B); } +void tms340x0_device::move0_no_ni_a (uint16_t op) { MOVE_NO_NI(0,A); } +void tms340x0_device::move0_no_ni_b (uint16_t op) { MOVE_NO_NI(0,B); } +void tms340x0_device::move1_no_ni_a (uint16_t op) { MOVE_NO_NI(1,A); } +void tms340x0_device::move1_no_ni_b (uint16_t op) { MOVE_NO_NI(1,B); } #define MOVE_NO_NO(F,R) \ { \ - INT32 o1 = PARAM_WORD(); \ - INT32 o2 = PARAM_WORD(); \ - INT32 data = RFIELD##F(R##REG(SRCREG(op))+o1); \ + int32_t o1 = PARAM_WORD(); \ + int32_t o2 = PARAM_WORD(); \ + int32_t data = RFIELD##F(R##REG(SRCREG(op))+o1); \ WFIELD##F(R##REG(DSTREG(op))+o2,data); \ COUNT_CYCLES(5); \ } -void tms340x0_device::move0_no_no_a (UINT16 op) { MOVE_NO_NO(0,A); } -void tms340x0_device::move0_no_no_b (UINT16 op) { MOVE_NO_NO(0,B); } -void tms340x0_device::move1_no_no_a (UINT16 op) { MOVE_NO_NO(1,A); } -void tms340x0_device::move1_no_no_b (UINT16 op) { MOVE_NO_NO(1,B); } +void tms340x0_device::move0_no_no_a (uint16_t op) { MOVE_NO_NO(0,A); } +void tms340x0_device::move0_no_no_b (uint16_t op) { MOVE_NO_NO(0,B); } +void tms340x0_device::move1_no_no_a (uint16_t op) { MOVE_NO_NO(1,A); } +void tms340x0_device::move1_no_no_b (uint16_t op) { MOVE_NO_NO(1,B); } #define MOVE_RA(F,R) \ { \ WFIELD##F(PARAM_LONG(),R##REG(DSTREG(op))); \ COUNT_CYCLES(3); \ } -void tms340x0_device::move0_ra_a (UINT16 op) { MOVE_RA(0,A); } -void tms340x0_device::move0_ra_b (UINT16 op) { MOVE_RA(0,B); } -void tms340x0_device::move1_ra_a (UINT16 op) { MOVE_RA(1,A); } -void tms340x0_device::move1_ra_b (UINT16 op) { MOVE_RA(1,B); } +void tms340x0_device::move0_ra_a (uint16_t op) { MOVE_RA(0,A); } +void tms340x0_device::move0_ra_b (uint16_t op) { MOVE_RA(0,B); } +void tms340x0_device::move1_ra_a (uint16_t op) { MOVE_RA(1,A); } +void tms340x0_device::move1_ra_b (uint16_t op) { MOVE_RA(1,B); } #define MOVE_AR(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_NZV(); \ *rd = RFIELD##F(PARAM_LONG()); \ SET_NZ_VAL(*rd); \ COUNT_CYCLES(5); \ } -void tms340x0_device::move0_ar_a (UINT16 op) { MOVE_AR(0,A); } -void tms340x0_device::move0_ar_b (UINT16 op) { MOVE_AR(0,B); } -void tms340x0_device::move1_ar_a (UINT16 op) { MOVE_AR(1,A); } -void tms340x0_device::move1_ar_b (UINT16 op) { MOVE_AR(1,B); } +void tms340x0_device::move0_ar_a (uint16_t op) { MOVE_AR(0,A); } +void tms340x0_device::move0_ar_b (uint16_t op) { MOVE_AR(0,B); } +void tms340x0_device::move1_ar_a (uint16_t op) { MOVE_AR(1,A); } +void tms340x0_device::move1_ar_b (uint16_t op) { MOVE_AR(1,B); } #define MOVE_A_NI(F,R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ WFIELD##F(*rd,RFIELD##F(PARAM_LONG())); \ *rd+=fw_inc[FW(F)]; \ COUNT_CYCLES(5); \ } -void tms340x0_device::move0_a_ni_a (UINT16 op) { MOVE_A_NI(0,A); } -void tms340x0_device::move0_a_ni_b (UINT16 op) { MOVE_A_NI(0,B); } -void tms340x0_device::move1_a_ni_a (UINT16 op) { MOVE_A_NI(1,A); } -void tms340x0_device::move1_a_ni_b (UINT16 op) { MOVE_A_NI(1,B); } +void tms340x0_device::move0_a_ni_a (uint16_t op) { MOVE_A_NI(0,A); } +void tms340x0_device::move0_a_ni_b (uint16_t op) { MOVE_A_NI(0,B); } +void tms340x0_device::move1_a_ni_a (uint16_t op) { MOVE_A_NI(1,A); } +void tms340x0_device::move1_a_ni_b (uint16_t op) { MOVE_A_NI(1,B); } #define MOVE_AA(F) \ { \ - UINT32 bitaddrs=PARAM_LONG(); \ + uint32_t bitaddrs=PARAM_LONG(); \ WFIELD##F(PARAM_LONG(),RFIELD##F(bitaddrs)); \ COUNT_CYCLES(7); \ } -void tms340x0_device::move0_aa (UINT16 op) { MOVE_AA(0); } -void tms340x0_device::move1_aa (UINT16 op) { MOVE_AA(1); } +void tms340x0_device::move0_aa (uint16_t op) { MOVE_AA(0); } +void tms340x0_device::move1_aa (uint16_t op) { MOVE_AA(1); } @@ -1428,17 +1428,17 @@ void tms340x0_device::move1_aa (UINT16 op) { MOVE_AA(1); } CORRECT_ODD_PC("CALL"); \ COUNT_CYCLES(3); \ } -void tms340x0_device::call_a (UINT16 op) { CALL(A); } -void tms340x0_device::call_b (UINT16 op) { CALL(B); } +void tms340x0_device::call_a (uint16_t op) { CALL(A); } +void tms340x0_device::call_b (uint16_t op) { CALL(B); } -void tms340x0_device::callr(UINT16 op) +void tms340x0_device::callr(uint16_t op) { PUSH(m_pc+0x10); m_pc += (PARAM_WORD_NO_INC()<<4)+0x10; COUNT_CYCLES(3); } -void tms340x0_device::calla(UINT16 op) +void tms340x0_device::calla(uint16_t op) { PUSH(m_pc+0x20); m_pc = PARAM_LONG_NO_INC(); @@ -1459,8 +1459,8 @@ void tms340x0_device::calla(UINT16 op) COUNT_CYCLES(2); \ } \ } -void tms340x0_device::dsj_a (UINT16 op) { DSJ(A); } -void tms340x0_device::dsj_b (UINT16 op) { DSJ(B); } +void tms340x0_device::dsj_a (uint16_t op) { DSJ(A); } +void tms340x0_device::dsj_b (uint16_t op) { DSJ(B); } #define DSJEQ(R) \ { \ @@ -1483,8 +1483,8 @@ void tms340x0_device::dsj_b (UINT16 op) { DSJ(B); } COUNT_CYCLES(2); \ } \ } -void tms340x0_device::dsjeq_a (UINT16 op) { DSJEQ(A); } -void tms340x0_device::dsjeq_b (UINT16 op) { DSJEQ(B); } +void tms340x0_device::dsjeq_a (uint16_t op) { DSJEQ(A); } +void tms340x0_device::dsjeq_b (uint16_t op) { DSJEQ(B); } #define DSJNE(R) \ { \ @@ -1507,8 +1507,8 @@ void tms340x0_device::dsjeq_b (UINT16 op) { DSJEQ(B); } COUNT_CYCLES(2); \ } \ } -void tms340x0_device::dsjne_a (UINT16 op) { DSJNE(A); } -void tms340x0_device::dsjne_b (UINT16 op) { DSJNE(B); } +void tms340x0_device::dsjne_a (uint16_t op) { DSJNE(A); } +void tms340x0_device::dsjne_b (uint16_t op) { DSJNE(B); } #define DSJS(R) \ { \ @@ -1533,10 +1533,10 @@ void tms340x0_device::dsjne_b (UINT16 op) { DSJNE(B); } COUNT_CYCLES(3); \ } \ } -void tms340x0_device::dsjs_a (UINT16 op) { DSJS(A); } -void tms340x0_device::dsjs_b (UINT16 op) { DSJS(B); } +void tms340x0_device::dsjs_a (uint16_t op) { DSJS(A); } +void tms340x0_device::dsjs_b (uint16_t op) { DSJS(B); } -void tms340x0_device::emu(UINT16 op) +void tms340x0_device::emu(uint16_t op) { /* in RUN state, this instruction is a NOP */ COUNT_CYCLES(6); @@ -1544,31 +1544,31 @@ void tms340x0_device::emu(UINT16 op) #define EXGPC(R) \ { \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 temppc = *rd; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t temppc = *rd; \ *rd = m_pc; \ m_pc = temppc; \ CORRECT_ODD_PC("EXGPC"); \ COUNT_CYCLES(2); \ } -void tms340x0_device::exgpc_a (UINT16 op) { EXGPC(A); } -void tms340x0_device::exgpc_b (UINT16 op) { EXGPC(B); } +void tms340x0_device::exgpc_a (uint16_t op) { EXGPC(A); } +void tms340x0_device::exgpc_b (uint16_t op) { EXGPC(B); } #define GETPC(R) \ { \ R##REG(DSTREG(op)) = m_pc; \ COUNT_CYCLES(1); \ } -void tms340x0_device::getpc_a (UINT16 op) { GETPC(A); } -void tms340x0_device::getpc_b (UINT16 op) { GETPC(B); } +void tms340x0_device::getpc_a (uint16_t op) { GETPC(A); } +void tms340x0_device::getpc_b (uint16_t op) { GETPC(B); } #define GETST(R) \ { \ R##REG(DSTREG(op)) = m_st; \ COUNT_CYCLES(1); \ } -void tms340x0_device::getst_a (UINT16 op) { GETST(A); } -void tms340x0_device::getst_b (UINT16 op) { GETST(B); } +void tms340x0_device::getst_a (uint16_t op) { GETST(A); } +void tms340x0_device::getst_b (uint16_t op) { GETST(B); } #define j_xx_8(TAKE) \ { \ @@ -1636,195 +1636,195 @@ void tms340x0_device::getst_b (UINT16 op) { GETST(B); } COUNT_CYCLES(1); \ } -void tms340x0_device::j_UC_0(UINT16 op) +void tms340x0_device::j_UC_0(uint16_t op) { j_xx_0(1); } -void tms340x0_device::j_UC_8(UINT16 op) +void tms340x0_device::j_UC_8(uint16_t op) { j_xx_8(1); } -void tms340x0_device::j_UC_x(UINT16 op) +void tms340x0_device::j_UC_x(uint16_t op) { j_xx_x(1); } -void tms340x0_device::j_P_0(UINT16 op) +void tms340x0_device::j_P_0(uint16_t op) { j_xx_0(!N_FLAG() && !Z_FLAG()); } -void tms340x0_device::j_P_8(UINT16 op) +void tms340x0_device::j_P_8(uint16_t op) { j_xx_8(!N_FLAG() && !Z_FLAG()); } -void tms340x0_device::j_P_x(UINT16 op) +void tms340x0_device::j_P_x(uint16_t op) { j_xx_x(!N_FLAG() && !Z_FLAG()); } -void tms340x0_device::j_LS_0(UINT16 op) +void tms340x0_device::j_LS_0(uint16_t op) { j_xx_0(C_FLAG() || Z_FLAG()); } -void tms340x0_device::j_LS_8(UINT16 op) +void tms340x0_device::j_LS_8(uint16_t op) { j_xx_8(C_FLAG() || Z_FLAG()); } -void tms340x0_device::j_LS_x(UINT16 op) +void tms340x0_device::j_LS_x(uint16_t op) { j_xx_x(C_FLAG() || Z_FLAG()); } -void tms340x0_device::j_HI_0(UINT16 op) +void tms340x0_device::j_HI_0(uint16_t op) { j_xx_0(!C_FLAG() && !Z_FLAG()); } -void tms340x0_device::j_HI_8(UINT16 op) +void tms340x0_device::j_HI_8(uint16_t op) { j_xx_8(!C_FLAG() && !Z_FLAG()); } -void tms340x0_device::j_HI_x(UINT16 op) +void tms340x0_device::j_HI_x(uint16_t op) { j_xx_x(!C_FLAG() && !Z_FLAG()); } -void tms340x0_device::j_LT_0(UINT16 op) +void tms340x0_device::j_LT_0(uint16_t op) { j_xx_0((N_FLAG() && !V_FLAG()) || (!N_FLAG() && V_FLAG())); } -void tms340x0_device::j_LT_8(UINT16 op) +void tms340x0_device::j_LT_8(uint16_t op) { j_xx_8((N_FLAG() && !V_FLAG()) || (!N_FLAG() && V_FLAG())); } -void tms340x0_device::j_LT_x(UINT16 op) +void tms340x0_device::j_LT_x(uint16_t op) { j_xx_x((N_FLAG() && !V_FLAG()) || (!N_FLAG() && V_FLAG())); } -void tms340x0_device::j_GE_0(UINT16 op) +void tms340x0_device::j_GE_0(uint16_t op) { j_xx_0((N_FLAG() && V_FLAG()) || (!N_FLAG() && !V_FLAG())); } -void tms340x0_device::j_GE_8(UINT16 op) +void tms340x0_device::j_GE_8(uint16_t op) { j_xx_8((N_FLAG() && V_FLAG()) || (!N_FLAG() && !V_FLAG())); } -void tms340x0_device::j_GE_x(UINT16 op) +void tms340x0_device::j_GE_x(uint16_t op) { j_xx_x((N_FLAG() && V_FLAG()) || (!N_FLAG() && !V_FLAG())); } -void tms340x0_device::j_LE_0(UINT16 op) +void tms340x0_device::j_LE_0(uint16_t op) { j_xx_0((N_FLAG() && !V_FLAG()) || (!N_FLAG() && V_FLAG()) || Z_FLAG()); } -void tms340x0_device::j_LE_8(UINT16 op) +void tms340x0_device::j_LE_8(uint16_t op) { j_xx_8((N_FLAG() && !V_FLAG()) || (!N_FLAG() && V_FLAG()) || Z_FLAG()); } -void tms340x0_device::j_LE_x(UINT16 op) +void tms340x0_device::j_LE_x(uint16_t op) { j_xx_x((N_FLAG() && !V_FLAG()) || (!N_FLAG() && V_FLAG()) || Z_FLAG()); } -void tms340x0_device::j_GT_0(UINT16 op) +void tms340x0_device::j_GT_0(uint16_t op) { j_xx_0((N_FLAG() && V_FLAG() && !Z_FLAG()) || (!N_FLAG() && !V_FLAG() && !Z_FLAG())); } -void tms340x0_device::j_GT_8(UINT16 op) +void tms340x0_device::j_GT_8(uint16_t op) { j_xx_8((N_FLAG() && V_FLAG() && !Z_FLAG()) || (!N_FLAG() && !V_FLAG() && !Z_FLAG())); } -void tms340x0_device::j_GT_x(UINT16 op) +void tms340x0_device::j_GT_x(uint16_t op) { j_xx_x((N_FLAG() && V_FLAG() && !Z_FLAG()) || (!N_FLAG() && !V_FLAG() && !Z_FLAG())); } -void tms340x0_device::j_C_0(UINT16 op) +void tms340x0_device::j_C_0(uint16_t op) { j_xx_0(C_FLAG()); } -void tms340x0_device::j_C_8(UINT16 op) +void tms340x0_device::j_C_8(uint16_t op) { j_xx_8(C_FLAG()); } -void tms340x0_device::j_C_x(UINT16 op) +void tms340x0_device::j_C_x(uint16_t op) { j_xx_x(C_FLAG()); } -void tms340x0_device::j_NC_0(UINT16 op) +void tms340x0_device::j_NC_0(uint16_t op) { j_xx_0(!C_FLAG()); } -void tms340x0_device::j_NC_8(UINT16 op) +void tms340x0_device::j_NC_8(uint16_t op) { j_xx_8(!C_FLAG()); } -void tms340x0_device::j_NC_x(UINT16 op) +void tms340x0_device::j_NC_x(uint16_t op) { j_xx_x(!C_FLAG()); } -void tms340x0_device::j_EQ_0(UINT16 op) +void tms340x0_device::j_EQ_0(uint16_t op) { j_xx_0(Z_FLAG()); } -void tms340x0_device::j_EQ_8(UINT16 op) +void tms340x0_device::j_EQ_8(uint16_t op) { j_xx_8(Z_FLAG()); } -void tms340x0_device::j_EQ_x(UINT16 op) +void tms340x0_device::j_EQ_x(uint16_t op) { j_xx_x(Z_FLAG()); } -void tms340x0_device::j_NE_0(UINT16 op) +void tms340x0_device::j_NE_0(uint16_t op) { j_xx_0(!Z_FLAG()); } -void tms340x0_device::j_NE_8(UINT16 op) +void tms340x0_device::j_NE_8(uint16_t op) { j_xx_8(!Z_FLAG()); } -void tms340x0_device::j_NE_x(UINT16 op) +void tms340x0_device::j_NE_x(uint16_t op) { j_xx_x(!Z_FLAG()); } -void tms340x0_device::j_V_0(UINT16 op) +void tms340x0_device::j_V_0(uint16_t op) { j_xx_0(V_FLAG()); } -void tms340x0_device::j_V_8(UINT16 op) +void tms340x0_device::j_V_8(uint16_t op) { j_xx_8(V_FLAG()); } -void tms340x0_device::j_V_x(UINT16 op) +void tms340x0_device::j_V_x(uint16_t op) { j_xx_x(V_FLAG()); } -void tms340x0_device::j_NV_0(UINT16 op) +void tms340x0_device::j_NV_0(uint16_t op) { j_xx_0(!V_FLAG()); } -void tms340x0_device::j_NV_8(UINT16 op) +void tms340x0_device::j_NV_8(uint16_t op) { j_xx_8(!V_FLAG()); } -void tms340x0_device::j_NV_x(UINT16 op) +void tms340x0_device::j_NV_x(uint16_t op) { j_xx_x(!V_FLAG()); } -void tms340x0_device::j_N_0(UINT16 op) +void tms340x0_device::j_N_0(uint16_t op) { j_xx_0(N_FLAG()); } -void tms340x0_device::j_N_8(UINT16 op) +void tms340x0_device::j_N_8(uint16_t op) { j_xx_8(N_FLAG()); } -void tms340x0_device::j_N_x(UINT16 op) +void tms340x0_device::j_N_x(uint16_t op) { j_xx_x(N_FLAG()); } -void tms340x0_device::j_NN_0(UINT16 op) +void tms340x0_device::j_NN_0(uint16_t op) { j_xx_0(!N_FLAG()); } -void tms340x0_device::j_NN_8(UINT16 op) +void tms340x0_device::j_NN_8(uint16_t op) { j_xx_8(!N_FLAG()); } -void tms340x0_device::j_NN_x(UINT16 op) +void tms340x0_device::j_NN_x(uint16_t op) { j_xx_x(!N_FLAG()); } @@ -1835,16 +1835,16 @@ void tms340x0_device::j_NN_x(UINT16 op) CORRECT_ODD_PC("JUMP"); \ COUNT_CYCLES(2); \ } -void tms340x0_device::jump_a (UINT16 op) { JUMP(A); } -void tms340x0_device::jump_b (UINT16 op) { JUMP(B); } +void tms340x0_device::jump_a (uint16_t op) { JUMP(A); } +void tms340x0_device::jump_b (uint16_t op) { JUMP(B); } -void tms340x0_device::popst(UINT16 op) +void tms340x0_device::popst(uint16_t op) { SET_ST(POP()); COUNT_CYCLES(8); } -void tms340x0_device::pushst(UINT16 op) +void tms340x0_device::pushst(uint16_t op) { PUSH(m_st); COUNT_CYCLES(2); @@ -1855,21 +1855,21 @@ void tms340x0_device::pushst(UINT16 op) SET_ST(R##REG(DSTREG(op))); \ COUNT_CYCLES(3); \ } -void tms340x0_device::putst_a (UINT16 op) { PUTST(A); } -void tms340x0_device::putst_b (UINT16 op) { PUTST(B); } +void tms340x0_device::putst_a (uint16_t op) { PUTST(A); } +void tms340x0_device::putst_b (uint16_t op) { PUTST(B); } -void tms340x0_device::reti(UINT16 op) +void tms340x0_device::reti(uint16_t op) { - INT32 st = POP(); + int32_t st = POP(); m_pc = POP(); CORRECT_ODD_PC("RETI"); SET_ST(st); COUNT_CYCLES(11); } -void tms340x0_device::rets(UINT16 op) +void tms340x0_device::rets(uint16_t op) { - UINT32 offs; + uint32_t offs; m_pc = POP(); CORRECT_ODD_PC("RETS"); offs = PARAM_N(op); @@ -1885,12 +1885,12 @@ void tms340x0_device::rets(UINT16 op) R##REG(DSTREG(op)) = 0x0008; \ COUNT_CYCLES(1); \ } -void tms340x0_device::rev_a (UINT16 op) { REV(A); } -void tms340x0_device::rev_b (UINT16 op) { REV(B); } +void tms340x0_device::rev_a (uint16_t op) { REV(A); } +void tms340x0_device::rev_b (uint16_t op) { REV(B); } -void tms340x0_device::trap(UINT16 op) +void tms340x0_device::trap(uint16_t op) { - UINT32 t = PARAM_N(op); + uint32_t t = PARAM_N(op); if (t) { PUSH(m_pc); @@ -2020,29 +2020,29 @@ New 34020 ops: #define ADD_XYI(R) \ { \ - UINT32 a = PARAM_LONG(); \ + uint32_t a = PARAM_LONG(); \ XY *b = &R##REG_XY(DSTREG(op)); \ CLR_NCZV(); \ - b->x += (INT16)(a & 0xffff); \ - b->y += ((INT32)a >> 16); \ + b->x += (int16_t)(a & 0xffff); \ + b->y += ((int32_t)a >> 16); \ SET_N_LOG(b->x == 0); \ SET_C_BIT_LO(b->y, 15); \ SET_Z_LOG(b->y == 0); \ SET_V_BIT_LO(b->x, 15); \ COUNT_CYCLES(1); \ } -void tms340x0_device::addxyi_a(UINT16 op) +void tms340x0_device::addxyi_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } ADD_XYI(A); } -void tms340x0_device::addxyi_b(UINT16 op) +void tms340x0_device::addxyi_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } ADD_XYI(B); } -void tms340x0_device::blmove(UINT16 op) +void tms340x0_device::blmove(uint16_t op) { offs_t src = BREG(0); offs_t dst = BREG(2); @@ -2099,91 +2099,91 @@ void tms340x0_device::blmove(UINT16 op) m_pc -= 0x10; } -void tms340x0_device::cexec_l(UINT16 op) +void tms340x0_device::cexec_l(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cexec_l\n"); } -void tms340x0_device::cexec_s(UINT16 op) +void tms340x0_device::cexec_s(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cexec_s\n"); } -void tms340x0_device::clip(UINT16 op) +void tms340x0_device::clip(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:clip\n"); } -void tms340x0_device::cmovcg_a(UINT16 op) +void tms340x0_device::cmovcg_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovcg_a\n"); } -void tms340x0_device::cmovcg_b(UINT16 op) +void tms340x0_device::cmovcg_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovcg_b\n"); } -void tms340x0_device::cmovcm_f(UINT16 op) +void tms340x0_device::cmovcm_f(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovcm_f\n"); } -void tms340x0_device::cmovcm_b(UINT16 op) +void tms340x0_device::cmovcm_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovcm_b\n"); } -void tms340x0_device::cmovgc_a(UINT16 op) +void tms340x0_device::cmovgc_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovgc_a\n"); } -void tms340x0_device::cmovgc_b(UINT16 op) +void tms340x0_device::cmovgc_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovgc_b\n"); } -void tms340x0_device::cmovgc_a_s(UINT16 op) +void tms340x0_device::cmovgc_a_s(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovgc_a_s\n"); } -void tms340x0_device::cmovgc_b_s(UINT16 op) +void tms340x0_device::cmovgc_b_s(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovgc_b_s\n"); } -void tms340x0_device::cmovmc_f(UINT16 op) +void tms340x0_device::cmovmc_f(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovmc_f\n"); } -void tms340x0_device::cmovmc_f_va(UINT16 op) +void tms340x0_device::cmovmc_f_va(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovmc_f_va\n"); } -void tms340x0_device::cmovmc_f_vb(UINT16 op) +void tms340x0_device::cmovmc_f_vb(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovmc_f_vb\n"); } -void tms340x0_device::cmovmc_b(UINT16 op) +void tms340x0_device::cmovmc_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cmovmc_b\n"); @@ -2191,133 +2191,133 @@ void tms340x0_device::cmovmc_b(UINT16 op) #define CMPK(R) \ { \ - INT32 r; \ - INT32 *rd = &R##REG(DSTREG(op)); \ - INT32 t = PARAM_K(op); if (!t) t = 32; \ + int32_t r; \ + int32_t *rd = &R##REG(DSTREG(op)); \ + int32_t t = PARAM_K(op); if (!t) t = 32; \ CLR_NCZV(); \ r = *rd - t; \ SET_NZCV_SUB(*rd,t,r); \ COUNT_CYCLES(1); \ } -void tms340x0_device::cmp_k_a(UINT16 op) +void tms340x0_device::cmp_k_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } CMPK(A); } -void tms340x0_device::cmp_k_b(UINT16 op) +void tms340x0_device::cmp_k_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } CMPK(B); } -void tms340x0_device::cvdxyl_a(UINT16 op) +void tms340x0_device::cvdxyl_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cvdxyl_a\n"); } -void tms340x0_device::cvdxyl_b(UINT16 op) +void tms340x0_device::cvdxyl_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cvdxyl_b\n"); } -void tms340x0_device::cvmxyl_a(UINT16 op) +void tms340x0_device::cvmxyl_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cvmxyl_a\n"); } -void tms340x0_device::cvmxyl_b(UINT16 op) +void tms340x0_device::cvmxyl_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cvmxyl_b\n"); } -void tms340x0_device::cvsxyl_a(UINT16 op) +void tms340x0_device::cvsxyl_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cvsxyl_a\n"); } -void tms340x0_device::cvsxyl_b(UINT16 op) +void tms340x0_device::cvsxyl_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:cvsxyl_b\n"); } -void tms340x0_device::exgps_a(UINT16 op) +void tms340x0_device::exgps_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:exgps_a\n"); } -void tms340x0_device::exgps_b(UINT16 op) +void tms340x0_device::exgps_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:exgps_b\n"); } -void tms340x0_device::fline(UINT16 op) +void tms340x0_device::fline(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:fline\n"); } -void tms340x0_device::fpixeq(UINT16 op) +void tms340x0_device::fpixeq(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:fpixeq\n"); } -void tms340x0_device::fpixne(UINT16 op) +void tms340x0_device::fpixne(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:fpixne\n"); } -void tms340x0_device::getps_a(UINT16 op) +void tms340x0_device::getps_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:getps_a\n"); } -void tms340x0_device::getps_b(UINT16 op) +void tms340x0_device::getps_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:getps_b\n"); } -void tms340x0_device::idle(UINT16 op) +void tms340x0_device::idle(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:idle\n"); } -void tms340x0_device::linit(UINT16 op) +void tms340x0_device::linit(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:linit\n"); } -void tms340x0_device::mwait(UINT16 op) +void tms340x0_device::mwait(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } } -void tms340x0_device::pfill_xy(UINT16 op) +void tms340x0_device::pfill_xy(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:pfill_xy\n"); } -void tms340x0_device::pixblt_l_m_l(UINT16 op) +void tms340x0_device::pixblt_l_m_l(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:pixblt_l_m_l\n"); } -void tms340x0_device::retm(UINT16 op) +void tms340x0_device::retm(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:retm\n"); @@ -2325,9 +2325,9 @@ void tms340x0_device::retm(UINT16 op) #define RMO(R) \ { \ - UINT32 res = 0; \ - UINT32 rs = R##REG(SRCREG(op)); \ - INT32 *rd = &R##REG(DSTREG(op)); \ + uint32_t res = 0; \ + uint32_t rs = R##REG(SRCREG(op)); \ + int32_t *rd = &R##REG(DSTREG(op)); \ CLR_Z(); \ SET_Z_VAL(rs); \ if (rs) \ @@ -2342,12 +2342,12 @@ void tms340x0_device::retm(UINT16 op) COUNT_CYCLES(1); \ } -void tms340x0_device::rmo_a(UINT16 op) { RMO(A); } -void tms340x0_device::rmo_b(UINT16 op) { RMO(B); } +void tms340x0_device::rmo_a(uint16_t op) { RMO(A); } +void tms340x0_device::rmo_b(uint16_t op) { RMO(B); } #define RPIX(R) \ { \ - UINT32 v = R##REG(DSTREG(op)); \ + uint32_t v = R##REG(DSTREG(op)); \ switch (m_pixelshift) \ { \ case 0: \ @@ -2387,73 +2387,73 @@ void tms340x0_device::rmo_b(UINT16 op) { RMO(B); } R##REG(DSTREG(op)) = v; \ } -void tms340x0_device::rpix_a(UINT16 op) +void tms340x0_device::rpix_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } RPIX(A); } -void tms340x0_device::rpix_b(UINT16 op) +void tms340x0_device::rpix_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } RPIX(B); } -void tms340x0_device::setcdp(UINT16 op) +void tms340x0_device::setcdp(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:setcdp\n"); } -void tms340x0_device::setcmp(UINT16 op) +void tms340x0_device::setcmp(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:setcmp\n"); } -void tms340x0_device::setcsp(UINT16 op) +void tms340x0_device::setcsp(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:setcsp\n"); } -void tms340x0_device::swapf_a(UINT16 op) +void tms340x0_device::swapf_a(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:swapf_a\n"); } -void tms340x0_device::swapf_b(UINT16 op) +void tms340x0_device::swapf_b(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:swapf_b\n"); } -void tms340x0_device::tfill_xy(UINT16 op) +void tms340x0_device::tfill_xy(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:tfill_xy\n"); } -void tms340x0_device::trapl(UINT16 op) +void tms340x0_device::trapl(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:trapl\n"); } -void tms340x0_device::vblt_b_l(UINT16 op) +void tms340x0_device::vblt_b_l(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:vblt_b_l\n"); } -void tms340x0_device::vfill_l(UINT16 op) +void tms340x0_device::vfill_l(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:vfill_l\n"); } -void tms340x0_device::vlcol(UINT16 op) +void tms340x0_device::vlcol(uint16_t op) { if (!m_is_34020) { unimpl(op); return; } logerror("020:vlcol\n"); diff --git a/src/devices/cpu/tms34010/dis34010.cpp b/src/devices/cpu/tms34010/dis34010.cpp index 19e3338a7d2..01aebd4a6f1 100644 --- a/src/devices/cpu/tms34010/dis34010.cpp +++ b/src/devices/cpu/tms34010/dis34010.cpp @@ -4,8 +4,8 @@ #include "emu.h" -static UINT8 *filebuf; -static UINT32 offset; +static uint8_t *filebuf; +static uint32_t offset; #define STANDALONE #include "34010dsm.c" @@ -29,10 +29,10 @@ static void usage (void) int main (int argc,char *argv[]) { - UINT8 i,j,n; + uint8_t i,j,n; char *filename=0,buf[80]; FILE *f; - UINT32 begin=0,end=(UINT32)-1,filelen,len,pc; + uint32_t begin=0,end=(uint32_t)-1,filelen,len,pc; printf ("DIS34010\n" "Copyright Zsolt Vasvari/Aaron Giles\n"); diff --git a/src/devices/cpu/tms34010/tms34010.cpp b/src/devices/cpu/tms34010/tms34010.cpp index c2e67ccee7c..7cea0c14032 100644 --- a/src/devices/cpu/tms34010/tms34010.cpp +++ b/src/devices/cpu/tms34010/tms34010.cpp @@ -33,7 +33,7 @@ const device_type TMS34020 = &device_creator; GLOBAL VARIABLES ***************************************************************************/ -tms340x0_device::tms340x0_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +tms340x0_device::tms340x0_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , device_video_interface(mconfig, *this) , m_program_config("program", ENDIANNESS_LITTLE, 16, 32, 3), m_pc(0), m_ppc(0), m_st(0), m_pixel_write(nullptr), m_pixel_read(nullptr), m_raster_op(nullptr), m_pixel_op(nullptr), m_pixel_op_timing(0), m_convsp(0), m_convdp(0), m_convmp(0), m_gfxcycles(0), m_pixelshift(0), m_is_34020(0), m_reset_deferred(false) @@ -45,14 +45,14 @@ tms340x0_device::tms340x0_device(const machine_config &mconfig, device_type type } -tms34010_device::tms34010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms34010_device::tms34010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms340x0_device(mconfig, TMS34010, "TMS34010", tag, owner, clock, "tms34010") { m_is_34020 = 0; } -tms34020_device::tms34020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms34020_device::tms34020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms340x0_device(mconfig, TMS34020, "TMS34020", tag, owner, clock, "tms34020") { m_is_34020 = 1; @@ -108,7 +108,7 @@ tms34020_device::tms34020_device(const machine_config &mconfig, const char *tag, #define SKIP_LONG() (m_pc += (4 << 3)) #define PARAM_K(O) (((O) >> 5) & 0x1f) #define PARAM_N(O) ((O) & 0x1f) -#define PARAM_REL8(O) ((INT8)(O)) +#define PARAM_REL8(O) ((int8_t)(O)) /* memory I/O */ #define WFIELD0(a,b) (this->*s_wfield_functions[FW(0)])(a,b) @@ -156,7 +156,7 @@ tms34020_device::tms34020_device(const machine_config &mconfig, const char *tag, ***************************************************************************/ /* Break up Status Register into indiviual flags */ -inline void tms340x0_device::SET_ST(UINT32 st) +inline void tms340x0_device::SET_ST(uint32_t st) { m_st = st; /* interrupts might have been enabled, check it */ @@ -170,74 +170,74 @@ inline void tms340x0_device::RESET_ST() } /* shortcuts for reading opcodes */ -inline UINT32 tms340x0_device::ROPCODE() +inline uint32_t tms340x0_device::ROPCODE() { - UINT32 pc = TOBYTE(m_pc); + uint32_t pc = TOBYTE(m_pc); m_pc += 2 << 3; return m_direct->read_word(pc); } -inline INT16 tms340x0_device::PARAM_WORD() +inline int16_t tms340x0_device::PARAM_WORD() { - UINT32 pc = TOBYTE(m_pc); + uint32_t pc = TOBYTE(m_pc); m_pc += 2 << 3; return m_direct->read_word(pc); } -inline INT32 tms340x0_device::PARAM_LONG() +inline int32_t tms340x0_device::PARAM_LONG() { - UINT32 pc = TOBYTE(m_pc); + uint32_t pc = TOBYTE(m_pc); m_pc += 4 << 3; - return (UINT16)m_direct->read_word(pc) | (m_direct->read_word(pc + 2) << 16); + return (uint16_t)m_direct->read_word(pc) | (m_direct->read_word(pc + 2) << 16); } -inline INT16 tms340x0_device::PARAM_WORD_NO_INC() +inline int16_t tms340x0_device::PARAM_WORD_NO_INC() { return m_direct->read_word(TOBYTE(m_pc)); } -inline INT32 tms340x0_device::PARAM_LONG_NO_INC() +inline int32_t tms340x0_device::PARAM_LONG_NO_INC() { - UINT32 pc = TOBYTE(m_pc); - return (UINT16)m_direct->read_word(pc) | (m_direct->read_word(pc + 2) << 16); + uint32_t pc = TOBYTE(m_pc); + return (uint16_t)m_direct->read_word(pc) | (m_direct->read_word(pc + 2) << 16); } /* read memory byte */ -inline UINT32 tms340x0_device::RBYTE(offs_t offset) +inline uint32_t tms340x0_device::RBYTE(offs_t offset) { - UINT32 ret; + uint32_t ret; RFIELDMAC_8(); return ret; } /* write memory byte */ -inline void tms340x0_device::WBYTE(offs_t offset, UINT32 data) +inline void tms340x0_device::WBYTE(offs_t offset, uint32_t data) { WFIELDMAC_8(); } /* read memory long */ -inline UINT32 tms340x0_device::RLONG(offs_t offset) +inline uint32_t tms340x0_device::RLONG(offs_t offset) { RFIELDMAC_32(); } /* write memory long */ -inline void tms340x0_device::WLONG(offs_t offset, UINT32 data) +inline void tms340x0_device::WLONG(offs_t offset, uint32_t data) { WFIELDMAC_32(); } /* pushes/pops a value from the stack */ -inline void tms340x0_device::PUSH(UINT32 data) +inline void tms340x0_device::PUSH(uint32_t data) { SP() -= 0x20; WLONG(SP(), data); } -inline INT32 tms340x0_device::POP() +inline int32_t tms340x0_device::POP() { - INT32 ret = RLONG(SP()); + int32_t ret = RLONG(SP()); SP() += 0x20; return ret; } @@ -252,23 +252,23 @@ inline INT32 tms340x0_device::POP() /* TODO: Plane masking */ \ return (TMS34010_RDMEM_WORD(TOBYTE(offset & 0xfffffff0)) >> (offset & m1)) & m2; -UINT32 tms340x0_device::read_pixel_1(offs_t offset) { RP(0x0f,0x01) } -UINT32 tms340x0_device::read_pixel_2(offs_t offset) { RP(0x0e,0x03) } -UINT32 tms340x0_device::read_pixel_4(offs_t offset) { RP(0x0c,0x0f) } -UINT32 tms340x0_device::read_pixel_8(offs_t offset) { RP(0x08,0xff) } -UINT32 tms340x0_device::read_pixel_16(offs_t offset) +uint32_t tms340x0_device::read_pixel_1(offs_t offset) { RP(0x0f,0x01) } +uint32_t tms340x0_device::read_pixel_2(offs_t offset) { RP(0x0e,0x03) } +uint32_t tms340x0_device::read_pixel_4(offs_t offset) { RP(0x0c,0x0f) } +uint32_t tms340x0_device::read_pixel_8(offs_t offset) { RP(0x08,0xff) } +uint32_t tms340x0_device::read_pixel_16(offs_t offset) { /* TODO: Plane masking */ return TMS34010_RDMEM_WORD(TOBYTE(offset & 0xfffffff0)); } -UINT32 tms340x0_device::read_pixel_32(offs_t offset) +uint32_t tms340x0_device::read_pixel_32(offs_t offset) { /* TODO: Plane masking */ return TMS34010_RDMEM_DWORD(TOBYTE(offset & 0xffffffe0)); } /* Shift register read */ -UINT32 tms340x0_device::read_pixel_shiftreg(offs_t offset) +uint32_t tms340x0_device::read_pixel_shiftreg(offs_t offset) { if (!m_to_shiftreg_cb.isnull()) m_to_shiftreg_cb(*m_program, offset, &m_shiftreg[0]); @@ -285,9 +285,9 @@ UINT32 tms340x0_device::read_pixel_shiftreg(offs_t offset) /* No Raster Op + No Transparency */ #define WP(m1,m2) \ - UINT32 a = TOBYTE(offset & 0xfffffff0); \ - UINT32 pix = TMS34010_RDMEM_WORD(a); \ - UINT32 shiftcount = offset & m1; \ + uint32_t a = TOBYTE(offset & 0xfffffff0); \ + uint32_t pix = TMS34010_RDMEM_WORD(a); \ + uint32_t shiftcount = offset & m1; \ \ /* TODO: plane masking */ \ data &= m2; \ @@ -300,9 +300,9 @@ UINT32 tms340x0_device::read_pixel_shiftreg(offs_t offset) data &= m2; \ if (data) \ { \ - UINT32 a = TOBYTE(offset & 0xfffffff0); \ - UINT32 pix = TMS34010_RDMEM_WORD(a); \ - UINT32 shiftcount = offset & m1; \ + uint32_t a = TOBYTE(offset & 0xfffffff0); \ + uint32_t pix = TMS34010_RDMEM_WORD(a); \ + uint32_t shiftcount = offset & m1; \ \ /* TODO: plane masking */ \ pix = (pix & ~(m2 << shiftcount)) | (data << shiftcount); \ @@ -310,9 +310,9 @@ UINT32 tms340x0_device::read_pixel_shiftreg(offs_t offset) } /* Raster Op + No Transparency */ #define WP_R(m1,m2) \ - UINT32 a = TOBYTE(offset & 0xfffffff0); \ - UINT32 pix = TMS34010_RDMEM_WORD(a); \ - UINT32 shiftcount = offset & m1; \ + uint32_t a = TOBYTE(offset & 0xfffffff0); \ + uint32_t pix = TMS34010_RDMEM_WORD(a); \ + uint32_t shiftcount = offset & m1; \ \ /* TODO: plane masking */ \ data = (this->*m_raster_op)(data & m2, (pix >> shiftcount) & m2) & m2; \ @@ -321,9 +321,9 @@ UINT32 tms340x0_device::read_pixel_shiftreg(offs_t offset) /* Raster Op + Transparency */ #define WP_R_T(m1,m2) \ - UINT32 a = TOBYTE(offset & 0xfffffff0); \ - UINT32 pix = TMS34010_RDMEM_WORD(a); \ - UINT32 shiftcount = offset & m1; \ + uint32_t a = TOBYTE(offset & 0xfffffff0); \ + uint32_t pix = TMS34010_RDMEM_WORD(a); \ + uint32_t shiftcount = offset & m1; \ \ /* TODO: plane masking */ \ data = (this->*m_raster_op)(data & m2, (pix >> shiftcount) & m2) & m2; \ @@ -334,33 +334,33 @@ UINT32 tms340x0_device::read_pixel_shiftreg(offs_t offset) } /* No Raster Op + No Transparency */ -void tms340x0_device::write_pixel_1(offs_t offset, UINT32 data) { WP(0x0f, 0x01); } -void tms340x0_device::write_pixel_2(offs_t offset, UINT32 data) { WP(0x0e, 0x03); } -void tms340x0_device::write_pixel_4(offs_t offset, UINT32 data) { WP(0x0c, 0x0f); } -void tms340x0_device::write_pixel_8(offs_t offset, UINT32 data) { WP(0x08, 0xff); } -void tms340x0_device::write_pixel_16(offs_t offset, UINT32 data) +void tms340x0_device::write_pixel_1(offs_t offset, uint32_t data) { WP(0x0f, 0x01); } +void tms340x0_device::write_pixel_2(offs_t offset, uint32_t data) { WP(0x0e, 0x03); } +void tms340x0_device::write_pixel_4(offs_t offset, uint32_t data) { WP(0x0c, 0x0f); } +void tms340x0_device::write_pixel_8(offs_t offset, uint32_t data) { WP(0x08, 0xff); } +void tms340x0_device::write_pixel_16(offs_t offset, uint32_t data) { /* TODO: plane masking */ TMS34010_WRMEM_WORD(TOBYTE(offset & 0xfffffff0), data); } -void tms340x0_device::write_pixel_32(offs_t offset, UINT32 data) +void tms340x0_device::write_pixel_32(offs_t offset, uint32_t data) { /* TODO: plane masking */ TMS34010_WRMEM_WORD(TOBYTE(offset & 0xffffffe0), data); } /* No Raster Op + Transparency */ -void tms340x0_device::write_pixel_t_1(offs_t offset, UINT32 data) { WP_T(0x0f, 0x01); } -void tms340x0_device::write_pixel_t_2(offs_t offset, UINT32 data) { WP_T(0x0e, 0x03); } -void tms340x0_device::write_pixel_t_4(offs_t offset, UINT32 data) { WP_T(0x0c, 0x0f); } -void tms340x0_device::write_pixel_t_8(offs_t offset, UINT32 data) { WP_T(0x08, 0xff); } -void tms340x0_device::write_pixel_t_16(offs_t offset, UINT32 data) +void tms340x0_device::write_pixel_t_1(offs_t offset, uint32_t data) { WP_T(0x0f, 0x01); } +void tms340x0_device::write_pixel_t_2(offs_t offset, uint32_t data) { WP_T(0x0e, 0x03); } +void tms340x0_device::write_pixel_t_4(offs_t offset, uint32_t data) { WP_T(0x0c, 0x0f); } +void tms340x0_device::write_pixel_t_8(offs_t offset, uint32_t data) { WP_T(0x08, 0xff); } +void tms340x0_device::write_pixel_t_16(offs_t offset, uint32_t data) { /* TODO: plane masking */ if (data) TMS34010_WRMEM_WORD(TOBYTE(offset & 0xfffffff0), data); } -void tms340x0_device::write_pixel_t_32(offs_t offset, UINT32 data) +void tms340x0_device::write_pixel_t_32(offs_t offset, uint32_t data) { /* TODO: plane masking */ if (data) @@ -368,41 +368,41 @@ void tms340x0_device::write_pixel_t_32(offs_t offset, UINT32 data) } /* Raster Op + No Transparency */ -void tms340x0_device::write_pixel_r_1(offs_t offset, UINT32 data) { WP_R(0x0f, 0x01); } -void tms340x0_device::write_pixel_r_2(offs_t offset, UINT32 data) { WP_R(0x0e, 0x03); } -void tms340x0_device::write_pixel_r_4(offs_t offset, UINT32 data) { WP_R(0x0c, 0x0f); } -void tms340x0_device::write_pixel_r_8(offs_t offset, UINT32 data) { WP_R(0x08, 0xff); } -void tms340x0_device::write_pixel_r_16(offs_t offset, UINT32 data) +void tms340x0_device::write_pixel_r_1(offs_t offset, uint32_t data) { WP_R(0x0f, 0x01); } +void tms340x0_device::write_pixel_r_2(offs_t offset, uint32_t data) { WP_R(0x0e, 0x03); } +void tms340x0_device::write_pixel_r_4(offs_t offset, uint32_t data) { WP_R(0x0c, 0x0f); } +void tms340x0_device::write_pixel_r_8(offs_t offset, uint32_t data) { WP_R(0x08, 0xff); } +void tms340x0_device::write_pixel_r_16(offs_t offset, uint32_t data) { /* TODO: plane masking */ - UINT32 a = TOBYTE(offset & 0xfffffff0); + uint32_t a = TOBYTE(offset & 0xfffffff0); TMS34010_WRMEM_WORD(a, (this->*m_raster_op)(data, TMS34010_RDMEM_WORD(a))); } -void tms340x0_device::write_pixel_r_32(offs_t offset, UINT32 data) +void tms340x0_device::write_pixel_r_32(offs_t offset, uint32_t data) { /* TODO: plane masking */ - UINT32 a = TOBYTE(offset & 0xffffffe0); + uint32_t a = TOBYTE(offset & 0xffffffe0); TMS34010_WRMEM_DWORD(a, (this->*m_raster_op)(data, TMS34010_RDMEM_DWORD(a))); } /* Raster Op + Transparency */ -void tms340x0_device::write_pixel_r_t_1(offs_t offset, UINT32 data) { WP_R_T(0x0f,0x01); } -void tms340x0_device::write_pixel_r_t_2(offs_t offset, UINT32 data) { WP_R_T(0x0e,0x03); } -void tms340x0_device::write_pixel_r_t_4(offs_t offset, UINT32 data) { WP_R_T(0x0c,0x0f); } -void tms340x0_device::write_pixel_r_t_8(offs_t offset, UINT32 data) { WP_R_T(0x08,0xff); } -void tms340x0_device::write_pixel_r_t_16(offs_t offset, UINT32 data) +void tms340x0_device::write_pixel_r_t_1(offs_t offset, uint32_t data) { WP_R_T(0x0f,0x01); } +void tms340x0_device::write_pixel_r_t_2(offs_t offset, uint32_t data) { WP_R_T(0x0e,0x03); } +void tms340x0_device::write_pixel_r_t_4(offs_t offset, uint32_t data) { WP_R_T(0x0c,0x0f); } +void tms340x0_device::write_pixel_r_t_8(offs_t offset, uint32_t data) { WP_R_T(0x08,0xff); } +void tms340x0_device::write_pixel_r_t_16(offs_t offset, uint32_t data) { /* TODO: plane masking */ - UINT32 a = TOBYTE(offset & 0xfffffff0); + uint32_t a = TOBYTE(offset & 0xfffffff0); data = (this->*m_raster_op)(data, TMS34010_RDMEM_WORD(a)); if (data) TMS34010_WRMEM_WORD(a, data); } -void tms340x0_device::write_pixel_r_t_32(offs_t offset, UINT32 data) +void tms340x0_device::write_pixel_r_t_32(offs_t offset, uint32_t data) { /* TODO: plane masking */ - UINT32 a = TOBYTE(offset & 0xffffffe0); + uint32_t a = TOBYTE(offset & 0xffffffe0); data = (this->*m_raster_op)(data, TMS34010_RDMEM_DWORD(a)); if (data) @@ -410,7 +410,7 @@ void tms340x0_device::write_pixel_r_t_32(offs_t offset, UINT32 data) } /* Shift register write */ -void tms340x0_device::write_pixel_shiftreg(offs_t offset, UINT32 data) +void tms340x0_device::write_pixel_shiftreg(offs_t offset, uint32_t data) { if (!m_from_shiftreg_cb.isnull()) m_from_shiftreg_cb(*m_program, offset, &m_shiftreg[0]); @@ -425,32 +425,32 @@ void tms340x0_device::write_pixel_shiftreg(offs_t offset, UINT32 data) ***************************************************************************/ /* Raster operations */ -UINT32 tms340x0_device::raster_op_1(UINT32 newpix, UINT32 oldpix) { return newpix & oldpix; } -UINT32 tms340x0_device::raster_op_2(UINT32 newpix, UINT32 oldpix) { return newpix & ~oldpix; } -UINT32 tms340x0_device::raster_op_3(UINT32 newpix, UINT32 oldpix) { return 0; } -UINT32 tms340x0_device::raster_op_4(UINT32 newpix, UINT32 oldpix) { return newpix | ~oldpix; } -UINT32 tms340x0_device::raster_op_5(UINT32 newpix, UINT32 oldpix) { return ~(newpix ^ oldpix); } -UINT32 tms340x0_device::raster_op_6(UINT32 newpix, UINT32 oldpix) { return ~oldpix; } -UINT32 tms340x0_device::raster_op_7(UINT32 newpix, UINT32 oldpix) { return ~(newpix | oldpix); } -UINT32 tms340x0_device::raster_op_8(UINT32 newpix, UINT32 oldpix) { return newpix | oldpix; } -UINT32 tms340x0_device::raster_op_9(UINT32 newpix, UINT32 oldpix) { return oldpix; } -UINT32 tms340x0_device::raster_op_10(UINT32 newpix, UINT32 oldpix) { return newpix ^ oldpix; } -UINT32 tms340x0_device::raster_op_11(UINT32 newpix, UINT32 oldpix) { return ~newpix & oldpix; } -UINT32 tms340x0_device::raster_op_12(UINT32 newpix, UINT32 oldpix) { return 0xffff; } -UINT32 tms340x0_device::raster_op_13(UINT32 newpix, UINT32 oldpix) { return ~newpix | oldpix; } -UINT32 tms340x0_device::raster_op_14(UINT32 newpix, UINT32 oldpix) { return ~(newpix & oldpix); } -UINT32 tms340x0_device::raster_op_15(UINT32 newpix, UINT32 oldpix) { return ~newpix; } -UINT32 tms340x0_device::raster_op_16(UINT32 newpix, UINT32 oldpix) { return newpix + oldpix; } -UINT32 tms340x0_device::raster_op_17(UINT32 newpix, UINT32 oldpix) +uint32_t tms340x0_device::raster_op_1(uint32_t newpix, uint32_t oldpix) { return newpix & oldpix; } +uint32_t tms340x0_device::raster_op_2(uint32_t newpix, uint32_t oldpix) { return newpix & ~oldpix; } +uint32_t tms340x0_device::raster_op_3(uint32_t newpix, uint32_t oldpix) { return 0; } +uint32_t tms340x0_device::raster_op_4(uint32_t newpix, uint32_t oldpix) { return newpix | ~oldpix; } +uint32_t tms340x0_device::raster_op_5(uint32_t newpix, uint32_t oldpix) { return ~(newpix ^ oldpix); } +uint32_t tms340x0_device::raster_op_6(uint32_t newpix, uint32_t oldpix) { return ~oldpix; } +uint32_t tms340x0_device::raster_op_7(uint32_t newpix, uint32_t oldpix) { return ~(newpix | oldpix); } +uint32_t tms340x0_device::raster_op_8(uint32_t newpix, uint32_t oldpix) { return newpix | oldpix; } +uint32_t tms340x0_device::raster_op_9(uint32_t newpix, uint32_t oldpix) { return oldpix; } +uint32_t tms340x0_device::raster_op_10(uint32_t newpix, uint32_t oldpix) { return newpix ^ oldpix; } +uint32_t tms340x0_device::raster_op_11(uint32_t newpix, uint32_t oldpix) { return ~newpix & oldpix; } +uint32_t tms340x0_device::raster_op_12(uint32_t newpix, uint32_t oldpix) { return 0xffff; } +uint32_t tms340x0_device::raster_op_13(uint32_t newpix, uint32_t oldpix) { return ~newpix | oldpix; } +uint32_t tms340x0_device::raster_op_14(uint32_t newpix, uint32_t oldpix) { return ~(newpix & oldpix); } +uint32_t tms340x0_device::raster_op_15(uint32_t newpix, uint32_t oldpix) { return ~newpix; } +uint32_t tms340x0_device::raster_op_16(uint32_t newpix, uint32_t oldpix) { return newpix + oldpix; } +uint32_t tms340x0_device::raster_op_17(uint32_t newpix, uint32_t oldpix) { - UINT32 max = (UINT32)0xffffffff >> (32 - IOREG(REG_PSIZE)); - UINT32 res = newpix + oldpix; + uint32_t max = (uint32_t)0xffffffff >> (32 - IOREG(REG_PSIZE)); + uint32_t res = newpix + oldpix; return (res > max) ? max : res; } -UINT32 tms340x0_device::raster_op_18(UINT32 newpix, UINT32 oldpix) { return oldpix - newpix; } -UINT32 tms340x0_device::raster_op_19(UINT32 newpix, UINT32 oldpix) { return (oldpix > newpix) ? oldpix - newpix : 0; } -UINT32 tms340x0_device::raster_op_20(UINT32 newpix, UINT32 oldpix) { return (oldpix > newpix) ? oldpix : newpix; } -UINT32 tms340x0_device::raster_op_21(UINT32 newpix, UINT32 oldpix) { return (oldpix > newpix) ? newpix : oldpix; } +uint32_t tms340x0_device::raster_op_18(uint32_t newpix, uint32_t oldpix) { return oldpix - newpix; } +uint32_t tms340x0_device::raster_op_19(uint32_t newpix, uint32_t oldpix) { return (oldpix > newpix) ? oldpix - newpix : 0; } +uint32_t tms340x0_device::raster_op_20(uint32_t newpix, uint32_t oldpix) { return (oldpix > newpix) ? oldpix : newpix; } +uint32_t tms340x0_device::raster_op_21(uint32_t newpix, uint32_t oldpix) { return (oldpix > newpix) ? newpix : oldpix; } @@ -731,7 +731,7 @@ void tms340x0_device::execute_run() { do { - UINT16 op; + uint16_t op; m_ppc = m_pc; op = ROPCODE(); (this->*s_opcode_table[op >> 4])(op); @@ -741,7 +741,7 @@ void tms340x0_device::execute_run() { do { - UINT16 op; + uint16_t op; m_ppc = m_pc; debugger_instruction_hook(this, m_pc); op = ROPCODE(); @@ -773,7 +773,7 @@ const tms340x0_device::pixel_read_func tms340x0_device::s_pixel_read_ops[6] = void tms340x0_device::set_pixel_function() { - UINT32 i1,i2; + uint32_t i1,i2; if (IOREG(REG_DPYCTL) & 0x0800) { @@ -939,7 +939,7 @@ TIMER_CALLBACK_MEMBER( tms340x0_device::scanline_callback ) /* 34010 increments by the DUDATE field in DPYCTL */ if (!m_is_34020) { - UINT16 dpyadr = IOREG(REG_DPYADR); + uint16_t dpyadr = IOREG(REG_DPYADR); if ((dpyadr & 3) == 0) dpyadr = ((dpyadr & 0xfffc) - (IOREG(REG_DPYCTL) & 0x03fc)) | (IOREG(REG_DPYSTRT) & 0x0003); else @@ -950,8 +950,8 @@ TIMER_CALLBACK_MEMBER( tms340x0_device::scanline_callback ) /* 34020 updates based on the DINC register, including zoom */ else { - UINT32 dpynx = IOREG(REG020_DPYNXL) | (IOREG(REG020_DPYNXH) << 16); - UINT32 dinc = IOREG(REG020_DINCL) | (IOREG(REG020_DINCH) << 16); + uint32_t dpynx = IOREG(REG020_DPYNXL) | (IOREG(REG020_DPYNXH) << 16); + uint32_t dinc = IOREG(REG020_DINCL) | (IOREG(REG020_DINCH) << 16); dpynx = (dpynx & 0xffffffe0) | ((dpynx + dinc) & 0x1f); if ((dpynx & 0x1f) == 0) dpynx += dinc & 0xffffffe0; @@ -983,7 +983,7 @@ void tms340x0_device::get_display_params(tms34010_display_params *params) /* 34010 gets its address from DPYADR and DPYTAP */ if (!m_is_34020) { - UINT16 dpyadr = IOREG(REG_DPYADR); + uint16_t dpyadr = IOREG(REG_DPYADR); if (!(IOREG(REG_DPYCTL) & 0x0400)) dpyadr ^= 0xfffc; params->rowaddr = dpyadr >> 4; @@ -1002,7 +1002,7 @@ void tms340x0_device::get_display_params(tms34010_display_params *params) } } -UINT32 tms340x0_device::tms340x0_ind16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tms340x0_device::tms340x0_ind16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { pen_t blackpen = screen.palette().black_pen(); tms34010_display_params params; @@ -1024,7 +1024,7 @@ UINT32 tms340x0_device::tms340x0_ind16(screen_device &screen, bitmap_ind16 &bitm params.heblnk = params.hsblnk = cliprect.max_x + 1; /* blank out the blank regions */ - UINT16 *dest = &bitmap.pix16(cliprect.min_y); + uint16_t *dest = &bitmap.pix16(cliprect.min_y); for (x = cliprect.min_x; x < params.heblnk; x++) dest[x] = blackpen; for (x = params.hsblnk; x <= cliprect.max_x; x++) @@ -1033,7 +1033,7 @@ UINT32 tms340x0_device::tms340x0_ind16(screen_device &screen, bitmap_ind16 &bitm } -UINT32 tms340x0_device::tms340x0_rgb32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t tms340x0_device::tms340x0_rgb32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { pen_t blackpen = rgb_t::black; tms34010_display_params params; @@ -1055,7 +1055,7 @@ UINT32 tms340x0_device::tms340x0_rgb32(screen_device &screen, bitmap_rgb32 &bitm params.heblnk = params.hsblnk = cliprect.max_x + 1; /* blank out the blank regions */ - UINT32 *dest = &bitmap.pix32(cliprect.min_y); + uint32_t *dest = &bitmap.pix32(cliprect.min_y); for (x = cliprect.min_x; x < params.heblnk; x++) dest[x] = blackpen; for (x = params.hsblnk; x <= cliprect.max_x; x++) @@ -1519,7 +1519,7 @@ WRITE16_MEMBER( tms340x0_device::host_w ) { addr += 0x10; IOREG(REG_HSTADRH) = addr >> 16; - IOREG(REG_HSTADRL) = (UINT16)addr; + IOREG(REG_HSTADRL) = (uint16_t)addr; } break; @@ -1579,7 +1579,7 @@ READ16_MEMBER( tms340x0_device::host_r ) { addr += 0x10; IOREG(REG_HSTADRH) = addr >> 16; - IOREG(REG_HSTADRL) = (UINT16)addr; + IOREG(REG_HSTADRL) = (uint16_t)addr; } break; @@ -1627,7 +1627,7 @@ void tms340x0_device::state_string_export(const device_state_entry &entry, std:: } -offs_t tms34010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms34010_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms34010 ); @@ -1635,7 +1635,7 @@ offs_t tms34010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 } -offs_t tms34020_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms34020_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms34020 ); diff --git a/src/devices/cpu/tms34010/tms34010.h b/src/devices/cpu/tms34010/tms34010.h index 83d96832f38..d45d4af6891 100644 --- a/src/devices/cpu/tms34010/tms34010.h +++ b/src/devices/cpu/tms34010/tms34010.h @@ -177,12 +177,12 @@ enum /* Configuration structure */ struct tms34010_display_params { - UINT16 vcount; /* most recent VCOUNT */ - UINT16 veblnk, vsblnk; /* start/end of VBLANK */ - UINT16 heblnk, hsblnk; /* start/end of HBLANK */ - UINT16 rowaddr, coladdr; /* row/column addresses */ - UINT8 yoffset; /* y offset from addresses */ - UINT8 enabled; /* video enabled */ + uint16_t vcount; /* most recent VCOUNT */ + uint16_t veblnk, vsblnk; /* start/end of VBLANK */ + uint16_t heblnk, hsblnk; /* start/end of HBLANK */ + uint16_t rowaddr, coladdr; /* row/column addresses */ + uint8_t yoffset; /* y offset from addresses */ + uint8_t enabled; /* video enabled */ }; @@ -215,17 +215,17 @@ typedef device_delegate to_shiftreg_cb_delegate; +typedef device_delegate to_shiftreg_cb_delegate; -#define TMS340X0_TO_SHIFTREG_CB_MEMBER(_name) void _name(address_space &space, offs_t address, UINT16 *shiftreg) +#define TMS340X0_TO_SHIFTREG_CB_MEMBER(_name) void _name(address_space &space, offs_t address, uint16_t *shiftreg) #define MCFG_TMS340X0_TO_SHIFTREG_CB(_class, _method) \ tms340x0_device::set_to_shiftreg_callback(*device, to_shiftreg_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); -typedef device_delegate from_shiftreg_cb_delegate; +typedef device_delegate from_shiftreg_cb_delegate; -#define TMS340X0_FROM_SHIFTREG_CB_MEMBER(_name) void _name(address_space &space, offs_t address, UINT16 *shiftreg) +#define TMS340X0_FROM_SHIFTREG_CB_MEMBER(_name) void _name(address_space &space, offs_t address, uint16_t *shiftreg) #define MCFG_TMS340X0_FROM_SHIFTREG_CB(_class, _method) \ tms340x0_device::set_from_shiftreg_callback(*device, from_shiftreg_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); @@ -236,10 +236,10 @@ class tms340x0_device : public cpu_device, { public: // construction/destruction - tms340x0_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + tms340x0_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); static void set_halt_on_reset(device_t &device, bool halt_on_reset) { downcast(device).m_halt_on_reset = halt_on_reset; } - static void set_pixel_clock(device_t &device, UINT32 pixclock) { downcast(device).m_pixclock = pixclock; } + static void set_pixel_clock(device_t &device, uint32_t pixclock) { downcast(device).m_pixclock = pixclock; } static void set_pixels_per_clock(device_t &device, int pixperclock) { downcast(device).m_pixperclock = pixperclock; } static void set_scanline_ind16_callback(device_t &device, scanline_ind16_cb_delegate callback) { downcast(device).m_scanline_ind16_cb = callback; } static void set_scanline_rgb32_callback(device_t &device, scanline_rgb32_cb_delegate callback) { downcast(device).m_scanline_rgb32_cb = callback; } @@ -250,8 +250,8 @@ public: void get_display_params(tms34010_display_params *params); void tms34010_state_postload(); - UINT32 tms340x0_ind16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 tms340x0_rgb32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t tms340x0_ind16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t tms340x0_rgb32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual DECLARE_WRITE16_MEMBER(io_register_w) = 0; virtual DECLARE_READ16_MEMBER(io_register_r) = 0; @@ -268,9 +268,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 10000; } - virtual UINT32 execute_input_lines() const override { return 2; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 10000; } + virtual uint32_t execute_input_lines() const override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -281,26 +281,26 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 10; } - - typedef void (tms340x0_device::*pixel_write_func)(offs_t offset, UINT32 data); - typedef UINT32 (tms340x0_device::*pixel_read_func)(offs_t offset); - typedef UINT32 (tms340x0_device::*raster_op_func)(UINT32 newpix, UINT32 oldpix); - typedef void (tms340x0_device::*wfield_func)(offs_t offset, UINT32 data); - typedef UINT32 (tms340x0_device::*rfield_func)(offs_t offset); - typedef void (tms340x0_device::*opcode_func)(UINT16 op); - typedef UINT32 (tms340x0_device::*pixel_op_func)(UINT32, UINT32, UINT32); + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 10; } + + typedef void (tms340x0_device::*pixel_write_func)(offs_t offset, uint32_t data); + typedef uint32_t (tms340x0_device::*pixel_read_func)(offs_t offset); + typedef uint32_t (tms340x0_device::*raster_op_func)(uint32_t newpix, uint32_t oldpix); + typedef void (tms340x0_device::*wfield_func)(offs_t offset, uint32_t data); + typedef uint32_t (tms340x0_device::*rfield_func)(offs_t offset); + typedef void (tms340x0_device::*opcode_func)(uint16_t op); + typedef uint32_t (tms340x0_device::*pixel_op_func)(uint32_t, uint32_t, uint32_t); typedef void (tms340x0_device::*pixblt_op_func)(int, int); typedef void (tms340x0_device::*pixblt_b_op_func)(int); - typedef void (tms340x0_device::*word_write_func)(address_space &space, offs_t offset,UINT16 data); - typedef UINT16 (tms340x0_device::*word_read_func)(address_space &space, offs_t offset); + typedef void (tms340x0_device::*word_write_func)(address_space &space, offs_t offset,uint16_t data); + typedef uint16_t (tms340x0_device::*word_read_func)(address_space &space, offs_t offset); static const wfield_func s_wfield_functions[32]; static const rfield_func s_rfield_functions[64]; static const opcode_func s_opcode_table[65536 >> 4]; static const pixel_op_func s_pixel_op_table[32]; - static const UINT8 s_pixel_op_timing_table[33]; + static const uint8_t s_pixel_op_timing_table[33]; static const pixblt_op_func s_pixblt_op_table[]; static const pixblt_op_func s_pixblt_r_op_table[]; static const pixblt_b_op_func s_pixblt_b_op_table[]; @@ -311,28 +311,28 @@ protected: address_space_config m_program_config; - UINT32 m_pc; - UINT32 m_ppc; - UINT32 m_st; + uint32_t m_pc; + uint32_t m_ppc; + uint32_t m_st; pixel_write_func m_pixel_write; pixel_read_func m_pixel_read; raster_op_func m_raster_op; pixel_op_func m_pixel_op; - UINT32 m_pixel_op_timing; - UINT32 m_convsp; - UINT32 m_convdp; - UINT32 m_convmp; - INT32 m_gfxcycles; - UINT8 m_pixelshift; - UINT8 m_is_34020; + uint32_t m_pixel_op_timing; + uint32_t m_convsp; + uint32_t m_convdp; + uint32_t m_convmp; + int32_t m_gfxcycles; + uint8_t m_pixelshift; + uint8_t m_is_34020; bool m_reset_deferred; bool m_halt_on_reset; /* /HCS pin, which determines HALT state after reset */ - UINT8 m_hblank_stable; - UINT8 m_external_host_access; - UINT8 m_executing; + uint8_t m_hblank_stable; + uint8_t m_external_host_access; + uint8_t m_executing; address_space *m_program; direct_read_data *m_direct; - UINT32 m_pixclock; /* the pixel clock (0 means don't adjust screen size) */ + uint32_t m_pixclock; /* the pixel clock (0 means don't adjust screen size) */ int m_pixperclock; /* pixels per clock */ emu_timer *m_scantimer; int m_icount; @@ -346,11 +346,11 @@ protected: struct XY { #ifdef LSB_FIRST - INT16 x; - INT16 y; + int16_t x; + int16_t y; #else - INT16 y; - INT16 x; + int16_t y; + int16_t x; #endif }; @@ -358,578 +358,578 @@ protected: /* B registers 0-15 map to regs[30]-regs[15] */ union { - INT32 reg; + int32_t reg; XY xy; } m_regs[31]; - UINT16 m_IOregs[64]; - UINT16 m_shiftreg[(8 * 512 * sizeof(UINT16))/2]; + uint16_t m_IOregs[64]; + uint16_t m_shiftreg[(8 * 512 * sizeof(uint16_t))/2]; - UINT32 TMS34010_RDMEM_DWORD(offs_t A); - void TMS34010_WRMEM_DWORD(offs_t A, UINT32 V); - void SET_ST(UINT32 st); + uint32_t TMS34010_RDMEM_DWORD(offs_t A); + void TMS34010_WRMEM_DWORD(offs_t A, uint32_t V); + void SET_ST(uint32_t st); void RESET_ST(); - UINT32 ROPCODE(); - INT16 PARAM_WORD(); - INT32 PARAM_LONG(); - INT16 PARAM_WORD_NO_INC(); - INT32 PARAM_LONG_NO_INC(); - UINT32 RBYTE(offs_t offset); - void WBYTE(offs_t offset, UINT32 data); - UINT32 RLONG(offs_t offset); - void WLONG(offs_t offset, UINT32 data); - void PUSH(UINT32 data); - INT32 POP(); - UINT32 read_pixel_1(offs_t offset); - UINT32 read_pixel_2(offs_t offset); - UINT32 read_pixel_4(offs_t offset); - UINT32 read_pixel_8(offs_t offset); - UINT32 read_pixel_16(offs_t offset); - UINT32 read_pixel_32(offs_t offset); - UINT32 read_pixel_shiftreg(offs_t offset); - void write_pixel_1(offs_t offset, UINT32 data); - void write_pixel_2(offs_t offset, UINT32 data); - void write_pixel_4(offs_t offset, UINT32 data); - void write_pixel_8(offs_t offset, UINT32 data); - void write_pixel_16(offs_t offset, UINT32 data); - void write_pixel_32(offs_t offset, UINT32 data); - void write_pixel_t_1(offs_t offset, UINT32 data); - void write_pixel_t_2(offs_t offset, UINT32 data); - void write_pixel_t_4(offs_t offset, UINT32 data); - void write_pixel_t_8(offs_t offset, UINT32 data); - void write_pixel_t_16(offs_t offset, UINT32 data); - void write_pixel_t_32(offs_t offset, UINT32 data); - void write_pixel_r_1(offs_t offset, UINT32 data); - void write_pixel_r_2(offs_t offset, UINT32 data); - void write_pixel_r_4(offs_t offset, UINT32 data); - void write_pixel_r_8(offs_t offset, UINT32 data); - void write_pixel_r_16(offs_t offset, UINT32 data); - void write_pixel_r_32(offs_t offset, UINT32 data); - void write_pixel_r_t_1(offs_t offset, UINT32 data); - void write_pixel_r_t_2(offs_t offset, UINT32 data); - void write_pixel_r_t_4(offs_t offset, UINT32 data); - void write_pixel_r_t_8(offs_t offset, UINT32 data); - void write_pixel_r_t_16(offs_t offset, UINT32 data); - void write_pixel_r_t_32(offs_t offset, UINT32 data); - void write_pixel_shiftreg(offs_t offset, UINT32 data); - UINT32 raster_op_1(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_2(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_3(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_4(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_5(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_6(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_7(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_8(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_9(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_10(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_11(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_12(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_13(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_14(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_15(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_16(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_17(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_18(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_19(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_20(UINT32 newpix, UINT32 oldpix); - UINT32 raster_op_21(UINT32 newpix, UINT32 oldpix); - void wfield_01(offs_t offset, UINT32 data); - void wfield_02(offs_t offset, UINT32 data); - void wfield_03(offs_t offset, UINT32 data); - void wfield_04(offs_t offset, UINT32 data); - void wfield_05(offs_t offset, UINT32 data); - void wfield_06(offs_t offset, UINT32 data); - void wfield_07(offs_t offset, UINT32 data); - void wfield_08(offs_t offset, UINT32 data); - void wfield_09(offs_t offset, UINT32 data); - void wfield_10(offs_t offset, UINT32 data); - void wfield_11(offs_t offset, UINT32 data); - void wfield_12(offs_t offset, UINT32 data); - void wfield_13(offs_t offset, UINT32 data); - void wfield_14(offs_t offset, UINT32 data); - void wfield_15(offs_t offset, UINT32 data); - void wfield_16(offs_t offset, UINT32 data); - void wfield_17(offs_t offset, UINT32 data); - void wfield_18(offs_t offset, UINT32 data); - void wfield_19(offs_t offset, UINT32 data); - void wfield_20(offs_t offset, UINT32 data); - void wfield_21(offs_t offset, UINT32 data); - void wfield_22(offs_t offset, UINT32 data); - void wfield_23(offs_t offset, UINT32 data); - void wfield_24(offs_t offset, UINT32 data); - void wfield_25(offs_t offset, UINT32 data); - void wfield_26(offs_t offset, UINT32 data); - void wfield_27(offs_t offset, UINT32 data); - void wfield_28(offs_t offset, UINT32 data); - void wfield_29(offs_t offset, UINT32 data); - void wfield_30(offs_t offset, UINT32 data); - void wfield_31(offs_t offset, UINT32 data); - void wfield_32(offs_t offset, UINT32 data); - UINT32 rfield_z_01(offs_t offset); - UINT32 rfield_z_02(offs_t offset); - UINT32 rfield_z_03(offs_t offset); - UINT32 rfield_z_04(offs_t offset); - UINT32 rfield_z_05(offs_t offset); - UINT32 rfield_z_06(offs_t offset); - UINT32 rfield_z_07(offs_t offset); - UINT32 rfield_z_08(offs_t offset); - UINT32 rfield_z_09(offs_t offset); - UINT32 rfield_z_10(offs_t offset); - UINT32 rfield_z_11(offs_t offset); - UINT32 rfield_z_12(offs_t offset); - UINT32 rfield_z_13(offs_t offset); - UINT32 rfield_z_14(offs_t offset); - UINT32 rfield_z_15(offs_t offset); - UINT32 rfield_z_16(offs_t offset); - UINT32 rfield_z_17(offs_t offset); - UINT32 rfield_z_18(offs_t offset); - UINT32 rfield_z_19(offs_t offset); - UINT32 rfield_z_20(offs_t offset); - UINT32 rfield_z_21(offs_t offset); - UINT32 rfield_z_22(offs_t offset); - UINT32 rfield_z_23(offs_t offset); - UINT32 rfield_z_24(offs_t offset); - UINT32 rfield_z_25(offs_t offset); - UINT32 rfield_z_26(offs_t offset); - UINT32 rfield_z_27(offs_t offset); - UINT32 rfield_z_28(offs_t offset); - UINT32 rfield_z_29(offs_t offset); - UINT32 rfield_z_30(offs_t offset); - UINT32 rfield_z_31(offs_t offset); - UINT32 rfield_32(offs_t offset); - UINT32 rfield_s_01(offs_t offset); - UINT32 rfield_s_02(offs_t offset); - UINT32 rfield_s_03(offs_t offset); - UINT32 rfield_s_04(offs_t offset); - UINT32 rfield_s_05(offs_t offset); - UINT32 rfield_s_06(offs_t offset); - UINT32 rfield_s_07(offs_t offset); - UINT32 rfield_s_08(offs_t offset); - UINT32 rfield_s_09(offs_t offset); - UINT32 rfield_s_10(offs_t offset); - UINT32 rfield_s_11(offs_t offset); - UINT32 rfield_s_12(offs_t offset); - UINT32 rfield_s_13(offs_t offset); - UINT32 rfield_s_14(offs_t offset); - UINT32 rfield_s_15(offs_t offset); - UINT32 rfield_s_16(offs_t offset); - UINT32 rfield_s_17(offs_t offset); - UINT32 rfield_s_18(offs_t offset); - UINT32 rfield_s_19(offs_t offset); - UINT32 rfield_s_20(offs_t offset); - UINT32 rfield_s_21(offs_t offset); - UINT32 rfield_s_22(offs_t offset); - UINT32 rfield_s_23(offs_t offset); - UINT32 rfield_s_24(offs_t offset); - UINT32 rfield_s_25(offs_t offset); - UINT32 rfield_s_26(offs_t offset); - UINT32 rfield_s_27(offs_t offset); - UINT32 rfield_s_28(offs_t offset); - UINT32 rfield_s_29(offs_t offset); - UINT32 rfield_s_30(offs_t offset); - UINT32 rfield_s_31(offs_t offset); - void unimpl(UINT16 op); - void pixblt_l_l(UINT16 op); /* 0f00 */ - void pixblt_l_xy(UINT16 op); /* 0f20 */ - void pixblt_xy_l(UINT16 op); /* 0f40 */ - void pixblt_xy_xy(UINT16 op); /* 0f60 */ - void pixblt_b_l(UINT16 op); /* 0f80 */ - void pixblt_b_xy(UINT16 op); /* 0fa0 */ - void fill_l(UINT16 op); /* 0fc0 */ - void fill_xy(UINT16 op); /* 0fe0 */ - void line(UINT16 op); /* df10/df90 */ - void add_xy_a(UINT16 op); /* e000/e100 */ - void add_xy_b(UINT16 op); /* e000/e100 */ - void sub_xy_a(UINT16 op); /* e200/e300 */ - void sub_xy_b(UINT16 op); /* e200/e300 */ - void cmp_xy_a(UINT16 op); /* e400/e500 */ - void cmp_xy_b(UINT16 op); /* e400/e500 */ - void cpw_a(UINT16 op); /* e600/e700 */ - void cpw_b(UINT16 op); /* e600/e700 */ - void cvxyl_a(UINT16 op); /* e800/e900 */ - void cvxyl_b(UINT16 op); /* e800/e900 */ - void movx_a(UINT16 op); /* ec00/ed00 */ - void movx_b(UINT16 op); /* ec00/ed00 */ - void movy_a(UINT16 op); /* ee00/ef00 */ - void movy_b(UINT16 op); /* ee00/ef00 */ - void pixt_ri_a(UINT16 op); /* f800/f900 */ - void pixt_ri_b(UINT16 op); /* f800/f900 */ - void pixt_rixy_a(UINT16 op); /* f000/f100 */ - void pixt_rixy_b(UINT16 op); /* f000/f100 */ - void pixt_ir_a(UINT16 op); /* fa00/fb00 */ - void pixt_ir_b(UINT16 op); /* fa00/fb00 */ - void pixt_ii_a(UINT16 op); /* fc00/fd00 */ - void pixt_ii_b(UINT16 op); /* fc00/fd00 */ - void pixt_ixyr_a(UINT16 op); /* f200/f300 */ - void pixt_ixyr_b(UINT16 op); /* f200/f300 */ - void pixt_ixyixy_a(UINT16 op); /* f400/f500 */ - void pixt_ixyixy_b(UINT16 op); /* f400/f500 */ - void drav_a(UINT16 op); /* f600/f700 */ - void drav_b(UINT16 op); /* f600/f700 */ - void abs_a(UINT16 op); /* 0380 */ - void abs_b(UINT16 op); /* 0390 */ - void add_a(UINT16 op); /* 4000/4100 */ - void add_b(UINT16 op); /* 4000/4100 */ - void addc_a(UINT16 op); /* 4200/4200 */ - void addc_b(UINT16 op); /* 4200/4200 */ - void addi_w_a(UINT16 op); /* 0b00 */ - void addi_w_b(UINT16 op); /* 0b10 */ - void addi_l_a(UINT16 op); /* 0b20 */ - void addi_l_b(UINT16 op); /* 0b30 */ - void addk_a(UINT16 op); /* 1000-1300 */ - void addk_b(UINT16 op); /* 1000-1300 */ - void and_a(UINT16 op); /* 5000/5100 */ - void and_b(UINT16 op); /* 5000/5100 */ - void andi_a(UINT16 op); /* 0b80 */ - void andi_b(UINT16 op); /* 0b90 */ - void andn_a(UINT16 op); /* 5200-5300 */ - void andn_b(UINT16 op); /* 5200-5300 */ - void btst_k_a(UINT16 op); /* 1c00-1f00 */ - void btst_k_b(UINT16 op); /* 1c00-1f00 */ - void btst_r_a(UINT16 op); /* 4a00-4b00 */ - void btst_r_b(UINT16 op); /* 4a00-4b00 */ - void clrc(UINT16 op); /* 0320 */ - void cmp_a(UINT16 op); /* 4800/4900 */ - void cmp_b(UINT16 op); /* 4800/4900 */ - void cmpi_w_a(UINT16 op); /* 0b40 */ - void cmpi_w_b(UINT16 op); /* 0b50 */ - void cmpi_l_a(UINT16 op); /* 0b60 */ - void cmpi_l_b(UINT16 op); /* 0b70 */ - void dint(UINT16 op); - void divs_a(UINT16 op); /* 5800/5900 */ - void divs_b(UINT16 op); /* 5800/5900 */ - void divu_a(UINT16 op); /* 5a00/5b00 */ - void divu_b(UINT16 op); /* 5a00/5b00 */ - void eint(UINT16 op); - void exgf0_a(UINT16 op); /* d500 */ - void exgf0_b(UINT16 op); /* d510 */ - void exgf1_a(UINT16 op); /* d700 */ - void exgf1_b(UINT16 op); /* d710 */ - void lmo_a(UINT16 op); /* 6a00/6b00 */ - void lmo_b(UINT16 op); /* 6a00/6b00 */ - void mmfm_a(UINT16 op); /* 09a0 */ - void mmfm_b(UINT16 op); /* 09b0 */ - void mmtm_a(UINT16 op); /* 0980 */ - void mmtm_b(UINT16 op); /* 0990 */ - void mods_a(UINT16 op); /* 6c00/6d00 */ - void mods_b(UINT16 op); /* 6c00/6d00 */ - void modu_a(UINT16 op); /* 6e00/6f00 */ - void modu_b(UINT16 op); /* 6e00/6f00 */ - void mpys_a(UINT16 op); /* 5c00/5d00 */ - void mpys_b(UINT16 op); /* 5c00/5d00 */ - void mpyu_a(UINT16 op); /* 5e00/5e00 */ - void mpyu_b(UINT16 op); /* 5e00/5f00 */ - void neg_a(UINT16 op); /* 03a0 */ - void neg_b(UINT16 op); /* 03b0 */ - void negb_a(UINT16 op); /* 03c0 */ - void negb_b(UINT16 op); /* 03d0 */ - void nop(UINT16 op); /* 0300 */ - void not_a(UINT16 op); /* 03e0 */ - void not_b(UINT16 op); /* 03f0 */ - void or_a(UINT16 op); /* 5400-5500 */ - void or_b(UINT16 op); /* 5400-5500 */ - void ori_a(UINT16 op); /* 0ba0 */ - void ori_b(UINT16 op); /* 0bb0 */ - void rl_k_a(UINT16 op); /* 3000-3300 */ - void rl_k_b(UINT16 op); /* 3000-3300 */ - void rl_r_a(UINT16 op); /* 6800/6900 */ - void rl_r_b(UINT16 op); /* 6800/6900 */ - void setc(UINT16 op); /* 0de0 */ - void setf0(UINT16 op); - void setf1(UINT16 op); - void sext0_a(UINT16 op); /* 0500 */ - void sext0_b(UINT16 op); /* 0510 */ - void sext1_a(UINT16 op); /* 0700 */ - void sext1_b(UINT16 op); /* 0710 */ - void sla_k_a(UINT16 op); /* 2000-2300 */ - void sla_k_b(UINT16 op); /* 2000-2300 */ - void sla_r_a(UINT16 op); /* 6000/6100 */ - void sla_r_b(UINT16 op); /* 6000/6100 */ - void sll_k_a(UINT16 op); /* 2400-2700 */ - void sll_k_b(UINT16 op); /* 2400-2700 */ - void sll_r_a(UINT16 op); /* 6200/6300 */ - void sll_r_b(UINT16 op); /* 6200/6300 */ - void sra_k_a(UINT16 op); /* 2800-2b00 */ - void sra_k_b(UINT16 op); /* 2800-2b00 */ - void sra_r_a(UINT16 op); /* 6400/6500 */ - void sra_r_b(UINT16 op); /* 6400/6500 */ - void srl_k_a(UINT16 op); /* 2c00-2f00 */ - void srl_k_b(UINT16 op); /* 2c00-2f00 */ - void srl_r_a(UINT16 op); /* 6600/6700 */ - void srl_r_b(UINT16 op); /* 6600/6700 */ - void sub_a(UINT16 op); /* 4400/4500 */ - void sub_b(UINT16 op); /* 4400/4500 */ - void subb_a(UINT16 op); /* 4600/4700 */ - void subb_b(UINT16 op); /* 4600/4700 */ - void subi_w_a(UINT16 op); /* 0be0 */ - void subi_w_b(UINT16 op); /* 0bf0 */ - void subi_l_a(UINT16 op); /* 0d00 */ - void subi_l_b(UINT16 op); /* 0d10 */ - void subk_a(UINT16 op); /* 1400-1700 */ - void subk_b(UINT16 op); /* 1400-1700 */ - void xor_a(UINT16 op); /* 5600-5700 */ - void xor_b(UINT16 op); /* 5600-5700 */ - void xori_a(UINT16 op); /* 0bc0 */ - void xori_b(UINT16 op); /* 0bd0 */ - void zext0_a(UINT16 op); /* 0520 */ - void zext0_b(UINT16 op); /* 0530 */ - void zext1_a(UINT16 op); /* 0720 */ - void zext1_b(UINT16 op); /* 0720 */ - void movi_w_a(UINT16 op); - void movi_w_b(UINT16 op); - void movi_l_a(UINT16 op); - void movi_l_b(UINT16 op); - void movk_a(UINT16 op); - void movk_b(UINT16 op); - void movb_rn_a(UINT16 op); /* 8c00-8d00 */ - void movb_rn_b(UINT16 op); /* 8c00-8d00 */ - void movb_nr_a(UINT16 op); /* 8e00-8f00 */ - void movb_nr_b(UINT16 op); /* 8e00-8f00 */ - void movb_nn_a(UINT16 op); /* 9c00-9d00 */ - void movb_nn_b(UINT16 op); /* 9c00-9d00 */ - void movb_r_no_a(UINT16 op); /* ac00-ad00 */ - void movb_r_no_b(UINT16 op); /* ac00-ad00 */ - void movb_no_r_a(UINT16 op); /* ae00-af00 */ - void movb_no_r_b(UINT16 op); /* ae00-af00 */ - void movb_no_no_a(UINT16 op); /* bc00-bd00 */ - void movb_no_no_b(UINT16 op); /* bc00-bd00 */ - void movb_ra_a(UINT16 op); - void movb_ra_b(UINT16 op); - void movb_ar_a(UINT16 op); - void movb_ar_b(UINT16 op); - void movb_aa(UINT16 op); - void move_rr_a(UINT16 op); /* 4c00/d00 */ - void move_rr_b(UINT16 op); /* 4c00/d00 */ - void move_rr_ax(UINT16 op); /* 4e00/f00 */ - void move_rr_bx(UINT16 op); /* 4e00/f00 */ - void move0_rn_a(UINT16 op); /* 8000 */ - void move0_rn_b(UINT16 op); - void move1_rn_a(UINT16 op); - void move1_rn_b(UINT16 op); - void move0_r_dn_a(UINT16 op); /* a000 */ - void move0_r_dn_b(UINT16 op); - void move1_r_dn_a(UINT16 op); - void move1_r_dn_b(UINT16 op); - void move0_r_ni_a(UINT16 op); /* 9000 */ - void move0_r_ni_b(UINT16 op); - void move1_r_ni_a(UINT16 op); - void move1_r_ni_b(UINT16 op); - void move0_nr_a(UINT16 op); /* 8400-500 */ - void move0_nr_b(UINT16 op); /* 8400-500 */ - void move1_nr_a(UINT16 op); /* 8600-700 */ - void move1_nr_b(UINT16 op); /* 8600-700 */ - void move0_dn_r_a(UINT16 op); /* A400-500 */ - void move0_dn_r_b(UINT16 op); /* A400-500 */ - void move1_dn_r_a(UINT16 op); /* A600-700 */ - void move1_dn_r_b(UINT16 op); /* A600-700 */ - void move0_ni_r_a(UINT16 op); /* 9400-500 */ - void move0_ni_r_b(UINT16 op); /* 9400-500 */ - void move1_ni_r_a(UINT16 op); /* 9600-700 */ - void move1_ni_r_b(UINT16 op); /* 9600-700 */ - void move0_nn_a(UINT16 op); /* 8800 */ - void move0_nn_b(UINT16 op); - void move1_nn_a(UINT16 op); - void move1_nn_b(UINT16 op); - void move0_dn_dn_a(UINT16 op); /* a800 */ - void move0_dn_dn_b(UINT16 op); - void move1_dn_dn_a(UINT16 op); - void move1_dn_dn_b(UINT16 op); - void move0_ni_ni_a(UINT16 op); /* 9800 */ - void move0_ni_ni_b(UINT16 op); - void move1_ni_ni_a(UINT16 op); - void move1_ni_ni_b(UINT16 op); - void move0_r_no_a(UINT16 op); /* b000 */ - void move0_r_no_b(UINT16 op); - void move1_r_no_a(UINT16 op); - void move1_r_no_b(UINT16 op); - void move0_no_r_a(UINT16 op); /* b400 */ - void move0_no_r_b(UINT16 op); - void move1_no_r_a(UINT16 op); - void move1_no_r_b(UINT16 op); - void move0_no_ni_a(UINT16 op); /* d000 */ - void move0_no_ni_b(UINT16 op); - void move1_no_ni_a(UINT16 op); - void move1_no_ni_b(UINT16 op); - void move0_no_no_a(UINT16 op); /* b800 */ - void move0_no_no_b(UINT16 op); - void move1_no_no_a(UINT16 op); - void move1_no_no_b(UINT16 op); - void move0_ra_a(UINT16 op); - void move0_ra_b(UINT16 op); - void move1_ra_a(UINT16 op); - void move1_ra_b(UINT16 op); - void move0_ar_a(UINT16 op); - void move0_ar_b(UINT16 op); - void move1_ar_a(UINT16 op); - void move1_ar_b(UINT16 op); - void move0_a_ni_a(UINT16 op); /* d400 */ - void move0_a_ni_b(UINT16 op); /* d410 */ - void move1_a_ni_a(UINT16 op); /* d600 */ - void move1_a_ni_b(UINT16 op); /* d610 */ - void move0_aa(UINT16 op); /* 05c0 */ - void move1_aa(UINT16 op); /* 07c0 */ - void call_a(UINT16 op); /* 0920 */ - void call_b(UINT16 op); /* 0930 */ - void callr(UINT16 op); /* 0d3f */ - void calla(UINT16 op); /* 0d5f */ - void dsj_a(UINT16 op); /* 0d80 */ - void dsj_b(UINT16 op); /* 0d90 */ - void dsjeq_a(UINT16 op); /* 0da0 */ - void dsjeq_b(UINT16 op); /* 0db0 */ - void dsjne_a(UINT16 op); /* 0dc0 */ - void dsjne_b(UINT16 op); /* 0dd0 */ - void dsjs_a(UINT16 op); - void dsjs_b(UINT16 op); - void emu(UINT16 op); /* 0100 */ - void exgpc_a(UINT16 op); /* 0120 */ - void exgpc_b(UINT16 op); /* 0130 */ - void getpc_a(UINT16 op); /* 0140 */ - void getpc_b(UINT16 op); /* 0150 */ - void getst_a(UINT16 op); /* 0180 */ - void getst_b(UINT16 op); /* 0190 */ - void j_UC_0(UINT16 op); - void j_UC_8(UINT16 op); - void j_UC_x(UINT16 op); - void j_P_0(UINT16 op); - void j_P_8(UINT16 op); - void j_P_x(UINT16 op); - void j_LS_0(UINT16 op); - void j_LS_8(UINT16 op); - void j_LS_x(UINT16 op); - void j_HI_0(UINT16 op); - void j_HI_8(UINT16 op); - void j_HI_x(UINT16 op); - void j_LT_0(UINT16 op); - void j_LT_8(UINT16 op); - void j_LT_x(UINT16 op); - void j_GE_0(UINT16 op); - void j_GE_8(UINT16 op); - void j_GE_x(UINT16 op); - void j_LE_0(UINT16 op); - void j_LE_8(UINT16 op); - void j_LE_x(UINT16 op); - void j_GT_0(UINT16 op); - void j_GT_8(UINT16 op); - void j_GT_x(UINT16 op); - void j_C_0(UINT16 op); - void j_C_8(UINT16 op); - void j_C_x(UINT16 op); - void j_NC_0(UINT16 op); - void j_NC_8(UINT16 op); - void j_NC_x(UINT16 op); - void j_EQ_0(UINT16 op); - void j_EQ_8(UINT16 op); - void j_EQ_x(UINT16 op); - void j_NE_0(UINT16 op); - void j_NE_8(UINT16 op); - void j_NE_x(UINT16 op); - void j_V_0(UINT16 op); - void j_V_8(UINT16 op); - void j_V_x(UINT16 op); - void j_NV_0(UINT16 op); - void j_NV_8(UINT16 op); - void j_NV_x(UINT16 op); - void j_N_0(UINT16 op); - void j_N_8(UINT16 op); - void j_N_x(UINT16 op); - void j_NN_0(UINT16 op); - void j_NN_8(UINT16 op); - void j_NN_x(UINT16 op); - void jump_a(UINT16 op); /* 0160 */ - void jump_b(UINT16 op); /* 0170 */ - void popst(UINT16 op); /* 01c0 */ - void pushst(UINT16 op); /* 01e0 */ - void putst_a(UINT16 op); /* 01a0 */ - void putst_b(UINT16 op); /* 01b0 */ - void reti(UINT16 op); /* 0940 */ - void rets(UINT16 op); /* 0960/70 */ - void rev_a(UINT16 op); /* 0020 */ - void rev_b(UINT16 op); /* 0030 */ - void trap(UINT16 op); /* 0900/10 */ - void addxyi_a(UINT16 op); - void addxyi_b(UINT16 op); - void blmove(UINT16 op); - void cexec_l(UINT16 op); - void cexec_s(UINT16 op); - void clip(UINT16 op); - void cmovcg_a(UINT16 op); - void cmovcg_b(UINT16 op); - void cmovcm_f(UINT16 op); - void cmovcm_b(UINT16 op); - void cmovgc_a(UINT16 op); - void cmovgc_b(UINT16 op); - void cmovgc_a_s(UINT16 op); - void cmovgc_b_s(UINT16 op); - void cmovmc_f(UINT16 op); - void cmovmc_f_va(UINT16 op); - void cmovmc_f_vb(UINT16 op); - void cmovmc_b(UINT16 op); - void cmp_k_a(UINT16 op); - void cmp_k_b(UINT16 op); - void cvdxyl_a(UINT16 op); - void cvdxyl_b(UINT16 op); - void cvmxyl_a(UINT16 op); - void cvmxyl_b(UINT16 op); - void cvsxyl_a(UINT16 op); - void cvsxyl_b(UINT16 op); - void exgps_a(UINT16 op); - void exgps_b(UINT16 op); - void fline(UINT16 op); - void fpixeq(UINT16 op); - void fpixne(UINT16 op); - void getps_a(UINT16 op); - void getps_b(UINT16 op); - void idle(UINT16 op); - void linit(UINT16 op); - void mwait(UINT16 op); - void pfill_xy(UINT16 op); - void pixblt_l_m_l(UINT16 op); - void retm(UINT16 op); - void rmo_a(UINT16 op); - void rmo_b(UINT16 op); - void rpix_a(UINT16 op); - void rpix_b(UINT16 op); - void setcdp(UINT16 op); - void setcmp(UINT16 op); - void setcsp(UINT16 op); - void swapf_a(UINT16 op); - void swapf_b(UINT16 op); - void tfill_xy(UINT16 op); - void trapl(UINT16 op); - void vblt_b_l(UINT16 op); - void vfill_l(UINT16 op); - void vlcol(UINT16 op); - int apply_window(const char *inst_name,int srcbpp, UINT32 *srcaddr, XY *dst, int *dx, int *dy); + uint32_t ROPCODE(); + int16_t PARAM_WORD(); + int32_t PARAM_LONG(); + int16_t PARAM_WORD_NO_INC(); + int32_t PARAM_LONG_NO_INC(); + uint32_t RBYTE(offs_t offset); + void WBYTE(offs_t offset, uint32_t data); + uint32_t RLONG(offs_t offset); + void WLONG(offs_t offset, uint32_t data); + void PUSH(uint32_t data); + int32_t POP(); + uint32_t read_pixel_1(offs_t offset); + uint32_t read_pixel_2(offs_t offset); + uint32_t read_pixel_4(offs_t offset); + uint32_t read_pixel_8(offs_t offset); + uint32_t read_pixel_16(offs_t offset); + uint32_t read_pixel_32(offs_t offset); + uint32_t read_pixel_shiftreg(offs_t offset); + void write_pixel_1(offs_t offset, uint32_t data); + void write_pixel_2(offs_t offset, uint32_t data); + void write_pixel_4(offs_t offset, uint32_t data); + void write_pixel_8(offs_t offset, uint32_t data); + void write_pixel_16(offs_t offset, uint32_t data); + void write_pixel_32(offs_t offset, uint32_t data); + void write_pixel_t_1(offs_t offset, uint32_t data); + void write_pixel_t_2(offs_t offset, uint32_t data); + void write_pixel_t_4(offs_t offset, uint32_t data); + void write_pixel_t_8(offs_t offset, uint32_t data); + void write_pixel_t_16(offs_t offset, uint32_t data); + void write_pixel_t_32(offs_t offset, uint32_t data); + void write_pixel_r_1(offs_t offset, uint32_t data); + void write_pixel_r_2(offs_t offset, uint32_t data); + void write_pixel_r_4(offs_t offset, uint32_t data); + void write_pixel_r_8(offs_t offset, uint32_t data); + void write_pixel_r_16(offs_t offset, uint32_t data); + void write_pixel_r_32(offs_t offset, uint32_t data); + void write_pixel_r_t_1(offs_t offset, uint32_t data); + void write_pixel_r_t_2(offs_t offset, uint32_t data); + void write_pixel_r_t_4(offs_t offset, uint32_t data); + void write_pixel_r_t_8(offs_t offset, uint32_t data); + void write_pixel_r_t_16(offs_t offset, uint32_t data); + void write_pixel_r_t_32(offs_t offset, uint32_t data); + void write_pixel_shiftreg(offs_t offset, uint32_t data); + uint32_t raster_op_1(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_2(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_3(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_4(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_5(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_6(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_7(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_8(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_9(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_10(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_11(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_12(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_13(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_14(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_15(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_16(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_17(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_18(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_19(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_20(uint32_t newpix, uint32_t oldpix); + uint32_t raster_op_21(uint32_t newpix, uint32_t oldpix); + void wfield_01(offs_t offset, uint32_t data); + void wfield_02(offs_t offset, uint32_t data); + void wfield_03(offs_t offset, uint32_t data); + void wfield_04(offs_t offset, uint32_t data); + void wfield_05(offs_t offset, uint32_t data); + void wfield_06(offs_t offset, uint32_t data); + void wfield_07(offs_t offset, uint32_t data); + void wfield_08(offs_t offset, uint32_t data); + void wfield_09(offs_t offset, uint32_t data); + void wfield_10(offs_t offset, uint32_t data); + void wfield_11(offs_t offset, uint32_t data); + void wfield_12(offs_t offset, uint32_t data); + void wfield_13(offs_t offset, uint32_t data); + void wfield_14(offs_t offset, uint32_t data); + void wfield_15(offs_t offset, uint32_t data); + void wfield_16(offs_t offset, uint32_t data); + void wfield_17(offs_t offset, uint32_t data); + void wfield_18(offs_t offset, uint32_t data); + void wfield_19(offs_t offset, uint32_t data); + void wfield_20(offs_t offset, uint32_t data); + void wfield_21(offs_t offset, uint32_t data); + void wfield_22(offs_t offset, uint32_t data); + void wfield_23(offs_t offset, uint32_t data); + void wfield_24(offs_t offset, uint32_t data); + void wfield_25(offs_t offset, uint32_t data); + void wfield_26(offs_t offset, uint32_t data); + void wfield_27(offs_t offset, uint32_t data); + void wfield_28(offs_t offset, uint32_t data); + void wfield_29(offs_t offset, uint32_t data); + void wfield_30(offs_t offset, uint32_t data); + void wfield_31(offs_t offset, uint32_t data); + void wfield_32(offs_t offset, uint32_t data); + uint32_t rfield_z_01(offs_t offset); + uint32_t rfield_z_02(offs_t offset); + uint32_t rfield_z_03(offs_t offset); + uint32_t rfield_z_04(offs_t offset); + uint32_t rfield_z_05(offs_t offset); + uint32_t rfield_z_06(offs_t offset); + uint32_t rfield_z_07(offs_t offset); + uint32_t rfield_z_08(offs_t offset); + uint32_t rfield_z_09(offs_t offset); + uint32_t rfield_z_10(offs_t offset); + uint32_t rfield_z_11(offs_t offset); + uint32_t rfield_z_12(offs_t offset); + uint32_t rfield_z_13(offs_t offset); + uint32_t rfield_z_14(offs_t offset); + uint32_t rfield_z_15(offs_t offset); + uint32_t rfield_z_16(offs_t offset); + uint32_t rfield_z_17(offs_t offset); + uint32_t rfield_z_18(offs_t offset); + uint32_t rfield_z_19(offs_t offset); + uint32_t rfield_z_20(offs_t offset); + uint32_t rfield_z_21(offs_t offset); + uint32_t rfield_z_22(offs_t offset); + uint32_t rfield_z_23(offs_t offset); + uint32_t rfield_z_24(offs_t offset); + uint32_t rfield_z_25(offs_t offset); + uint32_t rfield_z_26(offs_t offset); + uint32_t rfield_z_27(offs_t offset); + uint32_t rfield_z_28(offs_t offset); + uint32_t rfield_z_29(offs_t offset); + uint32_t rfield_z_30(offs_t offset); + uint32_t rfield_z_31(offs_t offset); + uint32_t rfield_32(offs_t offset); + uint32_t rfield_s_01(offs_t offset); + uint32_t rfield_s_02(offs_t offset); + uint32_t rfield_s_03(offs_t offset); + uint32_t rfield_s_04(offs_t offset); + uint32_t rfield_s_05(offs_t offset); + uint32_t rfield_s_06(offs_t offset); + uint32_t rfield_s_07(offs_t offset); + uint32_t rfield_s_08(offs_t offset); + uint32_t rfield_s_09(offs_t offset); + uint32_t rfield_s_10(offs_t offset); + uint32_t rfield_s_11(offs_t offset); + uint32_t rfield_s_12(offs_t offset); + uint32_t rfield_s_13(offs_t offset); + uint32_t rfield_s_14(offs_t offset); + uint32_t rfield_s_15(offs_t offset); + uint32_t rfield_s_16(offs_t offset); + uint32_t rfield_s_17(offs_t offset); + uint32_t rfield_s_18(offs_t offset); + uint32_t rfield_s_19(offs_t offset); + uint32_t rfield_s_20(offs_t offset); + uint32_t rfield_s_21(offs_t offset); + uint32_t rfield_s_22(offs_t offset); + uint32_t rfield_s_23(offs_t offset); + uint32_t rfield_s_24(offs_t offset); + uint32_t rfield_s_25(offs_t offset); + uint32_t rfield_s_26(offs_t offset); + uint32_t rfield_s_27(offs_t offset); + uint32_t rfield_s_28(offs_t offset); + uint32_t rfield_s_29(offs_t offset); + uint32_t rfield_s_30(offs_t offset); + uint32_t rfield_s_31(offs_t offset); + void unimpl(uint16_t op); + void pixblt_l_l(uint16_t op); /* 0f00 */ + void pixblt_l_xy(uint16_t op); /* 0f20 */ + void pixblt_xy_l(uint16_t op); /* 0f40 */ + void pixblt_xy_xy(uint16_t op); /* 0f60 */ + void pixblt_b_l(uint16_t op); /* 0f80 */ + void pixblt_b_xy(uint16_t op); /* 0fa0 */ + void fill_l(uint16_t op); /* 0fc0 */ + void fill_xy(uint16_t op); /* 0fe0 */ + void line(uint16_t op); /* df10/df90 */ + void add_xy_a(uint16_t op); /* e000/e100 */ + void add_xy_b(uint16_t op); /* e000/e100 */ + void sub_xy_a(uint16_t op); /* e200/e300 */ + void sub_xy_b(uint16_t op); /* e200/e300 */ + void cmp_xy_a(uint16_t op); /* e400/e500 */ + void cmp_xy_b(uint16_t op); /* e400/e500 */ + void cpw_a(uint16_t op); /* e600/e700 */ + void cpw_b(uint16_t op); /* e600/e700 */ + void cvxyl_a(uint16_t op); /* e800/e900 */ + void cvxyl_b(uint16_t op); /* e800/e900 */ + void movx_a(uint16_t op); /* ec00/ed00 */ + void movx_b(uint16_t op); /* ec00/ed00 */ + void movy_a(uint16_t op); /* ee00/ef00 */ + void movy_b(uint16_t op); /* ee00/ef00 */ + void pixt_ri_a(uint16_t op); /* f800/f900 */ + void pixt_ri_b(uint16_t op); /* f800/f900 */ + void pixt_rixy_a(uint16_t op); /* f000/f100 */ + void pixt_rixy_b(uint16_t op); /* f000/f100 */ + void pixt_ir_a(uint16_t op); /* fa00/fb00 */ + void pixt_ir_b(uint16_t op); /* fa00/fb00 */ + void pixt_ii_a(uint16_t op); /* fc00/fd00 */ + void pixt_ii_b(uint16_t op); /* fc00/fd00 */ + void pixt_ixyr_a(uint16_t op); /* f200/f300 */ + void pixt_ixyr_b(uint16_t op); /* f200/f300 */ + void pixt_ixyixy_a(uint16_t op); /* f400/f500 */ + void pixt_ixyixy_b(uint16_t op); /* f400/f500 */ + void drav_a(uint16_t op); /* f600/f700 */ + void drav_b(uint16_t op); /* f600/f700 */ + void abs_a(uint16_t op); /* 0380 */ + void abs_b(uint16_t op); /* 0390 */ + void add_a(uint16_t op); /* 4000/4100 */ + void add_b(uint16_t op); /* 4000/4100 */ + void addc_a(uint16_t op); /* 4200/4200 */ + void addc_b(uint16_t op); /* 4200/4200 */ + void addi_w_a(uint16_t op); /* 0b00 */ + void addi_w_b(uint16_t op); /* 0b10 */ + void addi_l_a(uint16_t op); /* 0b20 */ + void addi_l_b(uint16_t op); /* 0b30 */ + void addk_a(uint16_t op); /* 1000-1300 */ + void addk_b(uint16_t op); /* 1000-1300 */ + void and_a(uint16_t op); /* 5000/5100 */ + void and_b(uint16_t op); /* 5000/5100 */ + void andi_a(uint16_t op); /* 0b80 */ + void andi_b(uint16_t op); /* 0b90 */ + void andn_a(uint16_t op); /* 5200-5300 */ + void andn_b(uint16_t op); /* 5200-5300 */ + void btst_k_a(uint16_t op); /* 1c00-1f00 */ + void btst_k_b(uint16_t op); /* 1c00-1f00 */ + void btst_r_a(uint16_t op); /* 4a00-4b00 */ + void btst_r_b(uint16_t op); /* 4a00-4b00 */ + void clrc(uint16_t op); /* 0320 */ + void cmp_a(uint16_t op); /* 4800/4900 */ + void cmp_b(uint16_t op); /* 4800/4900 */ + void cmpi_w_a(uint16_t op); /* 0b40 */ + void cmpi_w_b(uint16_t op); /* 0b50 */ + void cmpi_l_a(uint16_t op); /* 0b60 */ + void cmpi_l_b(uint16_t op); /* 0b70 */ + void dint(uint16_t op); + void divs_a(uint16_t op); /* 5800/5900 */ + void divs_b(uint16_t op); /* 5800/5900 */ + void divu_a(uint16_t op); /* 5a00/5b00 */ + void divu_b(uint16_t op); /* 5a00/5b00 */ + void eint(uint16_t op); + void exgf0_a(uint16_t op); /* d500 */ + void exgf0_b(uint16_t op); /* d510 */ + void exgf1_a(uint16_t op); /* d700 */ + void exgf1_b(uint16_t op); /* d710 */ + void lmo_a(uint16_t op); /* 6a00/6b00 */ + void lmo_b(uint16_t op); /* 6a00/6b00 */ + void mmfm_a(uint16_t op); /* 09a0 */ + void mmfm_b(uint16_t op); /* 09b0 */ + void mmtm_a(uint16_t op); /* 0980 */ + void mmtm_b(uint16_t op); /* 0990 */ + void mods_a(uint16_t op); /* 6c00/6d00 */ + void mods_b(uint16_t op); /* 6c00/6d00 */ + void modu_a(uint16_t op); /* 6e00/6f00 */ + void modu_b(uint16_t op); /* 6e00/6f00 */ + void mpys_a(uint16_t op); /* 5c00/5d00 */ + void mpys_b(uint16_t op); /* 5c00/5d00 */ + void mpyu_a(uint16_t op); /* 5e00/5e00 */ + void mpyu_b(uint16_t op); /* 5e00/5f00 */ + void neg_a(uint16_t op); /* 03a0 */ + void neg_b(uint16_t op); /* 03b0 */ + void negb_a(uint16_t op); /* 03c0 */ + void negb_b(uint16_t op); /* 03d0 */ + void nop(uint16_t op); /* 0300 */ + void not_a(uint16_t op); /* 03e0 */ + void not_b(uint16_t op); /* 03f0 */ + void or_a(uint16_t op); /* 5400-5500 */ + void or_b(uint16_t op); /* 5400-5500 */ + void ori_a(uint16_t op); /* 0ba0 */ + void ori_b(uint16_t op); /* 0bb0 */ + void rl_k_a(uint16_t op); /* 3000-3300 */ + void rl_k_b(uint16_t op); /* 3000-3300 */ + void rl_r_a(uint16_t op); /* 6800/6900 */ + void rl_r_b(uint16_t op); /* 6800/6900 */ + void setc(uint16_t op); /* 0de0 */ + void setf0(uint16_t op); + void setf1(uint16_t op); + void sext0_a(uint16_t op); /* 0500 */ + void sext0_b(uint16_t op); /* 0510 */ + void sext1_a(uint16_t op); /* 0700 */ + void sext1_b(uint16_t op); /* 0710 */ + void sla_k_a(uint16_t op); /* 2000-2300 */ + void sla_k_b(uint16_t op); /* 2000-2300 */ + void sla_r_a(uint16_t op); /* 6000/6100 */ + void sla_r_b(uint16_t op); /* 6000/6100 */ + void sll_k_a(uint16_t op); /* 2400-2700 */ + void sll_k_b(uint16_t op); /* 2400-2700 */ + void sll_r_a(uint16_t op); /* 6200/6300 */ + void sll_r_b(uint16_t op); /* 6200/6300 */ + void sra_k_a(uint16_t op); /* 2800-2b00 */ + void sra_k_b(uint16_t op); /* 2800-2b00 */ + void sra_r_a(uint16_t op); /* 6400/6500 */ + void sra_r_b(uint16_t op); /* 6400/6500 */ + void srl_k_a(uint16_t op); /* 2c00-2f00 */ + void srl_k_b(uint16_t op); /* 2c00-2f00 */ + void srl_r_a(uint16_t op); /* 6600/6700 */ + void srl_r_b(uint16_t op); /* 6600/6700 */ + void sub_a(uint16_t op); /* 4400/4500 */ + void sub_b(uint16_t op); /* 4400/4500 */ + void subb_a(uint16_t op); /* 4600/4700 */ + void subb_b(uint16_t op); /* 4600/4700 */ + void subi_w_a(uint16_t op); /* 0be0 */ + void subi_w_b(uint16_t op); /* 0bf0 */ + void subi_l_a(uint16_t op); /* 0d00 */ + void subi_l_b(uint16_t op); /* 0d10 */ + void subk_a(uint16_t op); /* 1400-1700 */ + void subk_b(uint16_t op); /* 1400-1700 */ + void xor_a(uint16_t op); /* 5600-5700 */ + void xor_b(uint16_t op); /* 5600-5700 */ + void xori_a(uint16_t op); /* 0bc0 */ + void xori_b(uint16_t op); /* 0bd0 */ + void zext0_a(uint16_t op); /* 0520 */ + void zext0_b(uint16_t op); /* 0530 */ + void zext1_a(uint16_t op); /* 0720 */ + void zext1_b(uint16_t op); /* 0720 */ + void movi_w_a(uint16_t op); + void movi_w_b(uint16_t op); + void movi_l_a(uint16_t op); + void movi_l_b(uint16_t op); + void movk_a(uint16_t op); + void movk_b(uint16_t op); + void movb_rn_a(uint16_t op); /* 8c00-8d00 */ + void movb_rn_b(uint16_t op); /* 8c00-8d00 */ + void movb_nr_a(uint16_t op); /* 8e00-8f00 */ + void movb_nr_b(uint16_t op); /* 8e00-8f00 */ + void movb_nn_a(uint16_t op); /* 9c00-9d00 */ + void movb_nn_b(uint16_t op); /* 9c00-9d00 */ + void movb_r_no_a(uint16_t op); /* ac00-ad00 */ + void movb_r_no_b(uint16_t op); /* ac00-ad00 */ + void movb_no_r_a(uint16_t op); /* ae00-af00 */ + void movb_no_r_b(uint16_t op); /* ae00-af00 */ + void movb_no_no_a(uint16_t op); /* bc00-bd00 */ + void movb_no_no_b(uint16_t op); /* bc00-bd00 */ + void movb_ra_a(uint16_t op); + void movb_ra_b(uint16_t op); + void movb_ar_a(uint16_t op); + void movb_ar_b(uint16_t op); + void movb_aa(uint16_t op); + void move_rr_a(uint16_t op); /* 4c00/d00 */ + void move_rr_b(uint16_t op); /* 4c00/d00 */ + void move_rr_ax(uint16_t op); /* 4e00/f00 */ + void move_rr_bx(uint16_t op); /* 4e00/f00 */ + void move0_rn_a(uint16_t op); /* 8000 */ + void move0_rn_b(uint16_t op); + void move1_rn_a(uint16_t op); + void move1_rn_b(uint16_t op); + void move0_r_dn_a(uint16_t op); /* a000 */ + void move0_r_dn_b(uint16_t op); + void move1_r_dn_a(uint16_t op); + void move1_r_dn_b(uint16_t op); + void move0_r_ni_a(uint16_t op); /* 9000 */ + void move0_r_ni_b(uint16_t op); + void move1_r_ni_a(uint16_t op); + void move1_r_ni_b(uint16_t op); + void move0_nr_a(uint16_t op); /* 8400-500 */ + void move0_nr_b(uint16_t op); /* 8400-500 */ + void move1_nr_a(uint16_t op); /* 8600-700 */ + void move1_nr_b(uint16_t op); /* 8600-700 */ + void move0_dn_r_a(uint16_t op); /* A400-500 */ + void move0_dn_r_b(uint16_t op); /* A400-500 */ + void move1_dn_r_a(uint16_t op); /* A600-700 */ + void move1_dn_r_b(uint16_t op); /* A600-700 */ + void move0_ni_r_a(uint16_t op); /* 9400-500 */ + void move0_ni_r_b(uint16_t op); /* 9400-500 */ + void move1_ni_r_a(uint16_t op); /* 9600-700 */ + void move1_ni_r_b(uint16_t op); /* 9600-700 */ + void move0_nn_a(uint16_t op); /* 8800 */ + void move0_nn_b(uint16_t op); + void move1_nn_a(uint16_t op); + void move1_nn_b(uint16_t op); + void move0_dn_dn_a(uint16_t op); /* a800 */ + void move0_dn_dn_b(uint16_t op); + void move1_dn_dn_a(uint16_t op); + void move1_dn_dn_b(uint16_t op); + void move0_ni_ni_a(uint16_t op); /* 9800 */ + void move0_ni_ni_b(uint16_t op); + void move1_ni_ni_a(uint16_t op); + void move1_ni_ni_b(uint16_t op); + void move0_r_no_a(uint16_t op); /* b000 */ + void move0_r_no_b(uint16_t op); + void move1_r_no_a(uint16_t op); + void move1_r_no_b(uint16_t op); + void move0_no_r_a(uint16_t op); /* b400 */ + void move0_no_r_b(uint16_t op); + void move1_no_r_a(uint16_t op); + void move1_no_r_b(uint16_t op); + void move0_no_ni_a(uint16_t op); /* d000 */ + void move0_no_ni_b(uint16_t op); + void move1_no_ni_a(uint16_t op); + void move1_no_ni_b(uint16_t op); + void move0_no_no_a(uint16_t op); /* b800 */ + void move0_no_no_b(uint16_t op); + void move1_no_no_a(uint16_t op); + void move1_no_no_b(uint16_t op); + void move0_ra_a(uint16_t op); + void move0_ra_b(uint16_t op); + void move1_ra_a(uint16_t op); + void move1_ra_b(uint16_t op); + void move0_ar_a(uint16_t op); + void move0_ar_b(uint16_t op); + void move1_ar_a(uint16_t op); + void move1_ar_b(uint16_t op); + void move0_a_ni_a(uint16_t op); /* d400 */ + void move0_a_ni_b(uint16_t op); /* d410 */ + void move1_a_ni_a(uint16_t op); /* d600 */ + void move1_a_ni_b(uint16_t op); /* d610 */ + void move0_aa(uint16_t op); /* 05c0 */ + void move1_aa(uint16_t op); /* 07c0 */ + void call_a(uint16_t op); /* 0920 */ + void call_b(uint16_t op); /* 0930 */ + void callr(uint16_t op); /* 0d3f */ + void calla(uint16_t op); /* 0d5f */ + void dsj_a(uint16_t op); /* 0d80 */ + void dsj_b(uint16_t op); /* 0d90 */ + void dsjeq_a(uint16_t op); /* 0da0 */ + void dsjeq_b(uint16_t op); /* 0db0 */ + void dsjne_a(uint16_t op); /* 0dc0 */ + void dsjne_b(uint16_t op); /* 0dd0 */ + void dsjs_a(uint16_t op); + void dsjs_b(uint16_t op); + void emu(uint16_t op); /* 0100 */ + void exgpc_a(uint16_t op); /* 0120 */ + void exgpc_b(uint16_t op); /* 0130 */ + void getpc_a(uint16_t op); /* 0140 */ + void getpc_b(uint16_t op); /* 0150 */ + void getst_a(uint16_t op); /* 0180 */ + void getst_b(uint16_t op); /* 0190 */ + void j_UC_0(uint16_t op); + void j_UC_8(uint16_t op); + void j_UC_x(uint16_t op); + void j_P_0(uint16_t op); + void j_P_8(uint16_t op); + void j_P_x(uint16_t op); + void j_LS_0(uint16_t op); + void j_LS_8(uint16_t op); + void j_LS_x(uint16_t op); + void j_HI_0(uint16_t op); + void j_HI_8(uint16_t op); + void j_HI_x(uint16_t op); + void j_LT_0(uint16_t op); + void j_LT_8(uint16_t op); + void j_LT_x(uint16_t op); + void j_GE_0(uint16_t op); + void j_GE_8(uint16_t op); + void j_GE_x(uint16_t op); + void j_LE_0(uint16_t op); + void j_LE_8(uint16_t op); + void j_LE_x(uint16_t op); + void j_GT_0(uint16_t op); + void j_GT_8(uint16_t op); + void j_GT_x(uint16_t op); + void j_C_0(uint16_t op); + void j_C_8(uint16_t op); + void j_C_x(uint16_t op); + void j_NC_0(uint16_t op); + void j_NC_8(uint16_t op); + void j_NC_x(uint16_t op); + void j_EQ_0(uint16_t op); + void j_EQ_8(uint16_t op); + void j_EQ_x(uint16_t op); + void j_NE_0(uint16_t op); + void j_NE_8(uint16_t op); + void j_NE_x(uint16_t op); + void j_V_0(uint16_t op); + void j_V_8(uint16_t op); + void j_V_x(uint16_t op); + void j_NV_0(uint16_t op); + void j_NV_8(uint16_t op); + void j_NV_x(uint16_t op); + void j_N_0(uint16_t op); + void j_N_8(uint16_t op); + void j_N_x(uint16_t op); + void j_NN_0(uint16_t op); + void j_NN_8(uint16_t op); + void j_NN_x(uint16_t op); + void jump_a(uint16_t op); /* 0160 */ + void jump_b(uint16_t op); /* 0170 */ + void popst(uint16_t op); /* 01c0 */ + void pushst(uint16_t op); /* 01e0 */ + void putst_a(uint16_t op); /* 01a0 */ + void putst_b(uint16_t op); /* 01b0 */ + void reti(uint16_t op); /* 0940 */ + void rets(uint16_t op); /* 0960/70 */ + void rev_a(uint16_t op); /* 0020 */ + void rev_b(uint16_t op); /* 0030 */ + void trap(uint16_t op); /* 0900/10 */ + void addxyi_a(uint16_t op); + void addxyi_b(uint16_t op); + void blmove(uint16_t op); + void cexec_l(uint16_t op); + void cexec_s(uint16_t op); + void clip(uint16_t op); + void cmovcg_a(uint16_t op); + void cmovcg_b(uint16_t op); + void cmovcm_f(uint16_t op); + void cmovcm_b(uint16_t op); + void cmovgc_a(uint16_t op); + void cmovgc_b(uint16_t op); + void cmovgc_a_s(uint16_t op); + void cmovgc_b_s(uint16_t op); + void cmovmc_f(uint16_t op); + void cmovmc_f_va(uint16_t op); + void cmovmc_f_vb(uint16_t op); + void cmovmc_b(uint16_t op); + void cmp_k_a(uint16_t op); + void cmp_k_b(uint16_t op); + void cvdxyl_a(uint16_t op); + void cvdxyl_b(uint16_t op); + void cvmxyl_a(uint16_t op); + void cvmxyl_b(uint16_t op); + void cvsxyl_a(uint16_t op); + void cvsxyl_b(uint16_t op); + void exgps_a(uint16_t op); + void exgps_b(uint16_t op); + void fline(uint16_t op); + void fpixeq(uint16_t op); + void fpixne(uint16_t op); + void getps_a(uint16_t op); + void getps_b(uint16_t op); + void idle(uint16_t op); + void linit(uint16_t op); + void mwait(uint16_t op); + void pfill_xy(uint16_t op); + void pixblt_l_m_l(uint16_t op); + void retm(uint16_t op); + void rmo_a(uint16_t op); + void rmo_b(uint16_t op); + void rpix_a(uint16_t op); + void rpix_b(uint16_t op); + void setcdp(uint16_t op); + void setcmp(uint16_t op); + void setcsp(uint16_t op); + void swapf_a(uint16_t op); + void swapf_b(uint16_t op); + void tfill_xy(uint16_t op); + void trapl(uint16_t op); + void vblt_b_l(uint16_t op); + void vfill_l(uint16_t op); + void vlcol(uint16_t op); + int apply_window(const char *inst_name,int srcbpp, uint32_t *srcaddr, XY *dst, int *dx, int *dy); int compute_fill_cycles(int left_partials, int right_partials, int full_words, int op_timing); int compute_pixblt_cycles(int left_partials, int right_partials, int full_words, int op_timing); int compute_pixblt_b_cycles(int left_partials, int right_partials, int full_words, int rows, int op_timing, int bpp); - void memory_w(address_space &space, offs_t offset,UINT16 data); - UINT16 memory_r(address_space &space, offs_t offset); - void shiftreg_w(address_space &space, offs_t offset, UINT16 data); - UINT16 shiftreg_r(address_space &space, offs_t offset); - UINT16 dummy_shiftreg_r(address_space &space, offs_t offset); - UINT32 pixel_op00(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op01(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op02(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op03(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op04(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op05(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op06(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op07(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op08(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op09(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op10(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op11(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op12(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op13(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op14(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op15(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op16(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op17(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op18(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op19(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op20(UINT32 dstpix, UINT32 mask, UINT32 srcpix); - UINT32 pixel_op21(UINT32 dstpix, UINT32 mask, UINT32 srcpix); + void memory_w(address_space &space, offs_t offset,uint16_t data); + uint16_t memory_r(address_space &space, offs_t offset); + void shiftreg_w(address_space &space, offs_t offset, uint16_t data); + uint16_t shiftreg_r(address_space &space, offs_t offset); + uint16_t dummy_shiftreg_r(address_space &space, offs_t offset); + uint32_t pixel_op00(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op01(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op02(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op03(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op04(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op05(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op06(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op07(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op08(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op09(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op10(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op11(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op12(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op13(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op14(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op15(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op16(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op17(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op18(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op19(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op20(uint32_t dstpix, uint32_t mask, uint32_t srcpix); + uint32_t pixel_op21(uint32_t dstpix, uint32_t mask, uint32_t srcpix); void pixblt_1_op0(int src_is_linear, int dst_is_linear); void pixblt_2_op0(int src_is_linear, int dst_is_linear); void pixblt_4_op0(int src_is_linear, int dst_is_linear); @@ -1020,16 +1020,16 @@ protected: class tms34010_device : public tms340x0_device { public: - tms34010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms34010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); /* Reads & writes to the 34010 I/O registers; place at 0xc0000000 */ virtual DECLARE_WRITE16_MEMBER( io_register_w ) override; virtual DECLARE_READ16_MEMBER( io_register_r ) override; protected: - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 8 - 1) / 8; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 8); } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 8 - 1) / 8; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 8); } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; extern const device_type TMS34010; @@ -1037,16 +1037,16 @@ extern const device_type TMS34010; class tms34020_device : public tms340x0_device { public: - tms34020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms34020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); /* Reads & writes to the 34010 I/O registers; place at 0xc0000000 */ virtual DECLARE_WRITE16_MEMBER( io_register_w ) override; virtual DECLARE_READ16_MEMBER( io_register_r ) override; protected: - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; extern const device_type TMS34020; diff --git a/src/devices/cpu/tms57002/57002dsm.cpp b/src/devices/cpu/tms57002/57002dsm.cpp index db4a0d12b15..4b03fff991d 100644 --- a/src/devices/cpu/tms57002/57002dsm.cpp +++ b/src/devices/cpu/tms57002/57002dsm.cpp @@ -12,7 +12,7 @@ #include "debugger.h" #include "tms57002.h" -static const char *get_memadr(UINT32 opcode, char type) +static const char *get_memadr(uint32_t opcode, char type) { static char buff[2][10]; static int index = 0; @@ -38,8 +38,8 @@ static const char *get_memadr(UINT32 opcode, char type) CPU_DISASSEMBLE(tms57002) { - UINT32 opcode = opram[0] | (opram[1] << 8) | (opram[2] << 16); - UINT8 fa = opcode >> 18; + uint32_t opcode = opram[0] | (opram[1] << 8) | (opram[2] << 16); + uint8_t fa = opcode >> 18; char *buf = buffer; if(fa == 0x3f) { switch((opcode >> 11) & 0x7f) { // category 3 diff --git a/src/devices/cpu/tms57002/tms57002.cpp b/src/devices/cpu/tms57002/tms57002.cpp index fbc7b208673..eafa912206c 100644 --- a/src/devices/cpu/tms57002/tms57002.cpp +++ b/src/devices/cpu/tms57002/tms57002.cpp @@ -20,7 +20,7 @@ static ADDRESS_MAP_START(internal_pgm, AS_PROGRAM, 32, tms57002_device) AM_RANGE(0x00, 0xff) AM_RAM ADDRESS_MAP_END -tms57002_device::tms57002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms57002_device::tms57002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, TMS57002, "TMS57002", tag, owner, clock, "tms57002", __FILE__), device_sound_interface(mconfig, *this), macc(0), st0(0), st1(0), sti(0), txrd(0), @@ -32,7 +32,7 @@ tms57002_device::tms57002_device(const machine_config &mconfig, const char *tag, WRITE_LINE_MEMBER(tms57002_device::pload_w) { - UINT8 olds = sti; + uint8_t olds = sti; if(state) sti &= ~IN_PLOAD; else @@ -47,7 +47,7 @@ WRITE_LINE_MEMBER(tms57002_device::pload_w) WRITE_LINE_MEMBER(tms57002_device::cload_w) { - UINT8 olds = sti; + uint8_t olds = sti; if(state) sti &= ~IN_CLOAD; else @@ -90,7 +90,7 @@ WRITE8_MEMBER(tms57002_device::data_w) case IN_PLOAD: host[hidx++] = data; if(hidx >= 3) { - UINT32 val = (host[0]<<16) | (host[1]<<8) | host[2]; + uint32_t val = (host[0]<<16) | (host[1]<<8) | host[2]; hidx = 0; switch(sti & SU_MASK) { @@ -112,7 +112,7 @@ WRITE8_MEMBER(tms57002_device::data_w) if(sti & SU_CVAL) { host[hidx++] = data; if(hidx >= 4) { - UINT32 val = (host[0]<<24) | (host[1]<<16) | (host[2]<<8) | host[3]; + uint32_t val = (host[0]<<24) | (host[1]<<16) | (host[2]<<8) | host[3]; cmem[sa] = val; sti &= ~SU_CVAL; allow_update = 0; @@ -127,7 +127,7 @@ WRITE8_MEMBER(tms57002_device::data_w) case IN_PLOAD|IN_CLOAD: host[hidx++] = data; if(hidx >= 4) { - UINT32 val = (host[0]<<24) | (host[1]<<16) | (host[2]<<8) | host[3]; + uint32_t val = (host[0]<<24) | (host[1]<<16) | (host[2]<<8) | host[3]; hidx = 0; cmem[ca++] = val; } @@ -137,7 +137,7 @@ WRITE8_MEMBER(tms57002_device::data_w) READ8_MEMBER(tms57002_device::data_r) { - UINT8 res; + uint8_t res; if(!(sti & S_HOST)) return 0xff; @@ -186,8 +186,8 @@ WRITE_LINE_MEMBER(tms57002_device::sync_w) void tms57002_device::xm_init() { - UINT32 adr = xoa + xba; - UINT32 mask = 0; + uint32_t adr = xoa + xba; + uint32_t mask = 0; switch(st0 & ST0_M) { case ST0_M_64K: mask = 0x0ffff; break; @@ -207,8 +207,8 @@ void tms57002_device::xm_init() inline void tms57002_device::xm_step_read() { - UINT32 adr = xm_adr; - UINT8 v = data->read_byte(adr); + uint32_t adr = xm_adr; + uint8_t v = data->read_byte(adr); int done; if(st0 & ST0_WORD) { if(st0 & ST0_SEL) { @@ -245,8 +245,8 @@ inline void tms57002_device::xm_step_read() inline void tms57002_device::xm_step_write() { - UINT32 adr = xm_adr; - UINT8 v; + uint32_t adr = xm_adr; + uint8_t v; int done; if(st0 & ST0_WORD) { if(st0 & ST0_SEL) { @@ -277,10 +277,10 @@ inline void tms57002_device::xm_step_write() xm_adr = adr+1; } -INT64 tms57002_device::macc_to_output_0(INT64 rounding, UINT64 rmask) +int64_t tms57002_device::macc_to_output_0(int64_t rounding, uint64_t rmask) { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; int over = 0; // Overflow detection and shifting @@ -302,10 +302,10 @@ INT64 tms57002_device::macc_to_output_0(INT64 rounding, UINT64 rmask) return m; } -INT64 tms57002_device::macc_to_output_1(INT64 rounding, UINT64 rmask) +int64_t tms57002_device::macc_to_output_1(int64_t rounding, uint64_t rmask) { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; int over = 0; // Overflow detection and shifting @@ -328,10 +328,10 @@ INT64 tms57002_device::macc_to_output_1(INT64 rounding, UINT64 rmask) return m; } -INT64 tms57002_device::macc_to_output_2(INT64 rounding, UINT64 rmask) +int64_t tms57002_device::macc_to_output_2(int64_t rounding, uint64_t rmask) { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; int over = 0; // Overflow detection and shifting @@ -354,10 +354,10 @@ INT64 tms57002_device::macc_to_output_2(INT64 rounding, UINT64 rmask) return m; } -INT64 tms57002_device::macc_to_output_3(INT64 rounding, UINT64 rmask) +int64_t tms57002_device::macc_to_output_3(int64_t rounding, uint64_t rmask) { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; int over = 0; // Overflow detection and shifting @@ -377,10 +377,10 @@ INT64 tms57002_device::macc_to_output_3(INT64 rounding, UINT64 rmask) return m; } -INT64 tms57002_device::macc_to_output_0s(INT64 rounding, UINT64 rmask) +int64_t tms57002_device::macc_to_output_0s(int64_t rounding, uint64_t rmask) { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; int over = 0; // Overflow detection and shifting @@ -406,10 +406,10 @@ INT64 tms57002_device::macc_to_output_0s(INT64 rounding, UINT64 rmask) return m; } -INT64 tms57002_device::macc_to_output_1s(INT64 rounding, UINT64 rmask) +int64_t tms57002_device::macc_to_output_1s(int64_t rounding, uint64_t rmask) { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; int over = 0; // Overflow detection and shifting @@ -436,10 +436,10 @@ INT64 tms57002_device::macc_to_output_1s(INT64 rounding, UINT64 rmask) return m; } -INT64 tms57002_device::macc_to_output_2s(INT64 rounding, UINT64 rmask) +int64_t tms57002_device::macc_to_output_2s(int64_t rounding, uint64_t rmask) { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; int over = 0; // Overflow detection and shifting @@ -466,10 +466,10 @@ INT64 tms57002_device::macc_to_output_2s(INT64 rounding, UINT64 rmask) return m; } -INT64 tms57002_device::macc_to_output_3s(INT64 rounding, UINT64 rmask) +int64_t tms57002_device::macc_to_output_3s(int64_t rounding, uint64_t rmask) { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; int over = 0; // Overflow detection and shifting @@ -493,10 +493,10 @@ INT64 tms57002_device::macc_to_output_3s(INT64 rounding, UINT64 rmask) return m; } -INT64 tms57002_device::check_macc_overflow_0() +int64_t tms57002_device::check_macc_overflow_0() { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; // Overflow detection m1 = m & 0xf800000000000ULL; @@ -506,10 +506,10 @@ INT64 tms57002_device::check_macc_overflow_0() return m; } -INT64 tms57002_device::check_macc_overflow_1() +int64_t tms57002_device::check_macc_overflow_1() { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; // Overflow detection m1 = m & 0xfe00000000000ULL; @@ -519,10 +519,10 @@ INT64 tms57002_device::check_macc_overflow_1() return m; } -INT64 tms57002_device::check_macc_overflow_2() +int64_t tms57002_device::check_macc_overflow_2() { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; // Overflow detection m1 = m & 0xff80000000000ULL; @@ -532,15 +532,15 @@ INT64 tms57002_device::check_macc_overflow_2() return m; } -INT64 tms57002_device::check_macc_overflow_3() +int64_t tms57002_device::check_macc_overflow_3() { return macc; } -INT64 tms57002_device::check_macc_overflow_0s() +int64_t tms57002_device::check_macc_overflow_0s() { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; // Overflow detection m1 = m & 0xf800000000000ULL; @@ -554,10 +554,10 @@ INT64 tms57002_device::check_macc_overflow_0s() return m; } -INT64 tms57002_device::check_macc_overflow_1s() +int64_t tms57002_device::check_macc_overflow_1s() { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; // Overflow detection m1 = m & 0xfe00000000000ULL; @@ -571,10 +571,10 @@ INT64 tms57002_device::check_macc_overflow_1s() return m; } -INT64 tms57002_device::check_macc_overflow_2s() +int64_t tms57002_device::check_macc_overflow_2s() { - INT64 m = macc; - UINT64 m1; + int64_t m = macc; + uint64_t m1; // Overflow detection m1 = m & 0xff80000000000ULL; @@ -588,7 +588,7 @@ INT64 tms57002_device::check_macc_overflow_2s() return m; } -INT64 tms57002_device::check_macc_overflow_3s() +int64_t tms57002_device::check_macc_overflow_3s() { return macc; } @@ -611,7 +611,7 @@ void tms57002_device::cache_flush() } } -void tms57002_device::add_one(cstate *cs, unsigned short op, UINT8 param) +void tms57002_device::add_one(cstate *cs, unsigned short op, uint8_t param) { short ipc = cache.iused++; cache.inst[ipc].op = op; @@ -626,7 +626,7 @@ void tms57002_device::add_one(cstate *cs, unsigned short op, UINT8 param) } } -void tms57002_device::decode_one(UINT32 opcode, cstate *cs, void (tms57002_device::*dec)(UINT32 opcode, unsigned short *op, cstate *cs)) +void tms57002_device::decode_one(uint32_t opcode, cstate *cs, void (tms57002_device::*dec)(uint32_t opcode, unsigned short *op, cstate *cs)) { unsigned short op = 0; (this->*dec)(opcode, &op, cs); @@ -635,7 +635,7 @@ void tms57002_device::decode_one(UINT32 opcode, cstate *cs, void (tms57002_devic add_one(cs, op, opcode & 0xff); } -short tms57002_device::get_hash(unsigned char adr, UINT32 st1, short *pnode) +short tms57002_device::get_hash(unsigned char adr, uint32_t st1, short *pnode) { short hnode; st1 &= ST1_CACHE; @@ -650,7 +650,7 @@ short tms57002_device::get_hash(unsigned char adr, UINT32 st1, short *pnode) return -1; } -short tms57002_device::get_hashnode(unsigned char adr, UINT32 st1, short pnode) +short tms57002_device::get_hashnode(unsigned char adr, uint32_t st1, short pnode) { short hnode = cache.hused++; cache.hashnode[hnode].st1 = st1 & ST1_CACHE; @@ -667,7 +667,7 @@ int tms57002_device::decode_get_pc() { short pnode, res; cstate cs; - UINT8 adr = pc; + uint8_t adr = pc; res = get_hash(adr, st1, &pnode); if(res != -1) @@ -684,7 +684,7 @@ int tms57002_device::decode_get_pc() for(;;) { short ipc; - UINT32 opcode = program->read_dword(adr << 2); + uint32_t opcode = program->read_dword(adr << 2); cs.inc = 0; @@ -734,8 +734,8 @@ void tms57002_device::execute_run() } for(;;) { - UINT32 c, d; - INT64 r; + uint32_t c, d; + int64_t r; const icd *i = cache.inst + ipc; ipc = i->next; @@ -800,10 +800,10 @@ void tms57002_device::sound_stream_update(sound_stream &stream, stream_sample_t si[2] = inputs[2][0] & 0xffffff; si[3] = inputs[3][0] & 0xffffff; } - outputs[0][0] = INT16(so[0] >> 8); - outputs[1][0] = INT16(so[1] >> 8); - outputs[2][0] = INT16(so[2] >> 8); - outputs[3][0] = INT16(so[3] >> 8); + outputs[0][0] = int16_t(so[0] >> 8); + outputs[1][0] = int16_t(so[1] >> 8); + outputs[2][0] = int16_t(so[2] >> 8); + outputs[3][0] = int16_t(so[3] >> 8); sync_w(1); } @@ -877,32 +877,32 @@ void tms57002_device::device_start() save_item(NAME(allow_update)); } -UINT32 tms57002_device::execute_min_cycles() const +uint32_t tms57002_device::execute_min_cycles() const { return 1; } -UINT32 tms57002_device::execute_max_cycles() const +uint32_t tms57002_device::execute_max_cycles() const { return 3; } -UINT32 tms57002_device::execute_input_lines() const +uint32_t tms57002_device::execute_input_lines() const { return 0; } -UINT32 tms57002_device::disasm_min_opcode_bytes() const +uint32_t tms57002_device::disasm_min_opcode_bytes() const { return 4; } -UINT32 tms57002_device::disasm_max_opcode_bytes() const +uint32_t tms57002_device::disasm_max_opcode_bytes() const { return 4; } -offs_t tms57002_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms57002_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms57002 ); return CPU_DISASSEMBLE_NAME(tms57002)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/tms57002/tms57002.h b/src/devices/cpu/tms57002/tms57002.h index 6cfcf4b4b51..7ae8102c99c 100644 --- a/src/devices/cpu/tms57002/tms57002.h +++ b/src/devices/cpu/tms57002/tms57002.h @@ -14,7 +14,7 @@ class tms57002_device : public cpu_device, public device_sound_interface { public: - tms57002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms57002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(data_r); DECLARE_WRITE8_MEMBER(data_w); @@ -31,13 +31,13 @@ protected: virtual void device_reset() override; virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: enum { @@ -118,22 +118,22 @@ private: short ipc; }; - INT64 macc; + int64_t macc; - UINT32 cmem[256]; - UINT32 dmem0[256]; - UINT32 dmem1[32]; + uint32_t cmem[256]; + uint32_t dmem0[256]; + uint32_t dmem1[32]; - UINT32 si[4], so[4]; + uint32_t si[4], so[4]; - UINT32 st0, st1, sti; - UINT32 aacc, xoa, xba, xwr, xrd, txrd, creg; + uint32_t st0, st1, sti; + uint32_t aacc, xoa, xba, xwr, xrd, txrd, creg; - UINT8 pc, hpc, ca, id, ba0, ba1, rptc, rptc_next, sa; + uint8_t pc, hpc, ca, id, ba0, ba1, rptc, rptc_next, sa; - UINT32 xm_adr; + uint32_t xm_adr; - UINT8 host[4], hidx, allow_update; + uint8_t host[4], hidx, allow_update; cd cache; @@ -143,46 +143,46 @@ private: int icount; int unsupported_inst_warning; - void decode_error(UINT32 opcode); - void decode_cat1(UINT32 opcode, unsigned short *op, cstate *cs); - void decode_cat2_pre(UINT32 opcode, unsigned short *op, cstate *cs); - void decode_cat3(UINT32 opcode, unsigned short *op, cstate *cs); - void decode_cat2_post(UINT32 opcode, unsigned short *op, cstate *cs); - - inline int xmode(UINT32 opcode, char type, cstate *cs); - inline int sfao(UINT32 st1); - inline int dbp(UINT32 st1); - inline int crm(UINT32 st1); - inline int sfai(UINT32 st1); - inline int sfmo(UINT32 st1); - inline int rnd(UINT32 st1); - inline int movm(UINT32 st1); - inline int sfma(UINT32 st1); + void decode_error(uint32_t opcode); + void decode_cat1(uint32_t opcode, unsigned short *op, cstate *cs); + void decode_cat2_pre(uint32_t opcode, unsigned short *op, cstate *cs); + void decode_cat3(uint32_t opcode, unsigned short *op, cstate *cs); + void decode_cat2_post(uint32_t opcode, unsigned short *op, cstate *cs); + + inline int xmode(uint32_t opcode, char type, cstate *cs); + inline int sfao(uint32_t st1); + inline int dbp(uint32_t st1); + inline int crm(uint32_t st1); + inline int sfai(uint32_t st1); + inline int sfmo(uint32_t st1); + inline int rnd(uint32_t st1); + inline int movm(uint32_t st1); + inline int sfma(uint32_t st1); void xm_init(); void xm_step_read(); void xm_step_write(); - INT64 macc_to_output_0(INT64 rounding, UINT64 rmask); - INT64 macc_to_output_1(INT64 rounding, UINT64 rmask); - INT64 macc_to_output_2(INT64 rounding, UINT64 rmask); - INT64 macc_to_output_3(INT64 rounding, UINT64 rmask); - INT64 macc_to_output_0s(INT64 rounding, UINT64 rmask); - INT64 macc_to_output_1s(INT64 rounding, UINT64 rmask); - INT64 macc_to_output_2s(INT64 rounding, UINT64 rmask); - INT64 macc_to_output_3s(INT64 rounding, UINT64 rmask); - INT64 check_macc_overflow_0(); - INT64 check_macc_overflow_1(); - INT64 check_macc_overflow_2(); - INT64 check_macc_overflow_3(); - INT64 check_macc_overflow_0s(); - INT64 check_macc_overflow_1s(); - INT64 check_macc_overflow_2s(); - INT64 check_macc_overflow_3s(); + int64_t macc_to_output_0(int64_t rounding, uint64_t rmask); + int64_t macc_to_output_1(int64_t rounding, uint64_t rmask); + int64_t macc_to_output_2(int64_t rounding, uint64_t rmask); + int64_t macc_to_output_3(int64_t rounding, uint64_t rmask); + int64_t macc_to_output_0s(int64_t rounding, uint64_t rmask); + int64_t macc_to_output_1s(int64_t rounding, uint64_t rmask); + int64_t macc_to_output_2s(int64_t rounding, uint64_t rmask); + int64_t macc_to_output_3s(int64_t rounding, uint64_t rmask); + int64_t check_macc_overflow_0(); + int64_t check_macc_overflow_1(); + int64_t check_macc_overflow_2(); + int64_t check_macc_overflow_3(); + int64_t check_macc_overflow_0s(); + int64_t check_macc_overflow_1s(); + int64_t check_macc_overflow_2s(); + int64_t check_macc_overflow_3s(); void cache_flush(); - void add_one(cstate *cs, unsigned short op, UINT8 param); - void decode_one(UINT32 opcode, cstate *cs, void (tms57002_device::*dec)(UINT32 opcode, unsigned short *op, cstate *cs)); - short get_hash(unsigned char adr, UINT32 st1, short *pnode); - short get_hashnode(unsigned char adr, UINT32 st1, short pnode); + void add_one(cstate *cs, unsigned short op, uint8_t param); + void decode_one(uint32_t opcode, cstate *cs, void (tms57002_device::*dec)(uint32_t opcode, unsigned short *op, cstate *cs)); + short get_hash(unsigned char adr, uint32_t st1, short *pnode); + short get_hashnode(unsigned char adr, uint32_t st1, short pnode); int decode_get_pc(); }; diff --git a/src/devices/cpu/tms57002/tms57kdec.cpp b/src/devices/cpu/tms57002/tms57kdec.cpp index 62061cc6cc7..c30bd1fc35a 100644 --- a/src/devices/cpu/tms57002/tms57kdec.cpp +++ b/src/devices/cpu/tms57002/tms57kdec.cpp @@ -12,7 +12,7 @@ #include "debugger.h" #include "tms57002.h" -inline int tms57002_device::xmode(UINT32 opcode, char type, cstate *cs) +inline int tms57002_device::xmode(uint32_t opcode, char type, cstate *cs) { if(((opcode & 0x400) && (type == 'c')) || (!(opcode & 0x400) && (type == 'd'))) { if(opcode & 0x100) @@ -28,52 +28,52 @@ inline int tms57002_device::xmode(UINT32 opcode, char type, cstate *cs) return 1; } -inline int tms57002_device::sfao(UINT32 st1) +inline int tms57002_device::sfao(uint32_t st1) { return st1 & ST1_SFAO ? 1 : 0; } -inline int tms57002_device::dbp(UINT32 st1) +inline int tms57002_device::dbp(uint32_t st1) { return st1 & ST1_DBP ? 1 : 0; } -inline int tms57002_device::crm(UINT32 st1) +inline int tms57002_device::crm(uint32_t st1) { int crm = (st1 & ST1_CRM) >> ST1_CRM_SHIFT; return crm <= 2 ? crm : 0; } -inline int tms57002_device::sfai(UINT32 st1) +inline int tms57002_device::sfai(uint32_t st1) { return st1 & ST1_SFAI ? 1 : 0; } -inline int tms57002_device::sfmo(UINT32 st1) +inline int tms57002_device::sfmo(uint32_t st1) { return (st1 & ST1_SFMO) >> ST1_SFMO_SHIFT; } -inline int tms57002_device::rnd(UINT32 st1) +inline int tms57002_device::rnd(uint32_t st1) { int rnd = (st1 & ST1_RND) >> ST1_RND_SHIFT; return rnd <= 4 ? rnd : 0; } -inline int tms57002_device::movm(UINT32 st1) +inline int tms57002_device::movm(uint32_t st1) { return st1 & ST1_MOVM ? 1 : 0; } -inline int tms57002_device::sfma(UINT32 st1) +inline int tms57002_device::sfma(uint32_t st1) { return (st1 & ST1_SFMA) >> ST1_SFMA_SHIFT; } -void tms57002_device::decode_error(UINT32 opcode) +void tms57002_device::decode_error(uint32_t opcode) { char buf[256]; - UINT8 opr[3]; + uint8_t opr[3]; if(unsupported_inst_warning) return; @@ -86,7 +86,7 @@ void tms57002_device::decode_error(UINT32 opcode) popmessage("tms57002: %s - Contact Mamedev", buf); } -void tms57002_device::decode_cat1(UINT32 opcode, unsigned short *op, cstate *cs) +void tms57002_device::decode_cat1(uint32_t opcode, unsigned short *op, cstate *cs) { switch(opcode >> 18) { case 0x00: // nop @@ -102,7 +102,7 @@ void tms57002_device::decode_cat1(UINT32 opcode, unsigned short *op, cstate *cs) } } -void tms57002_device::decode_cat2_pre(UINT32 opcode, unsigned short *op, cstate *cs) +void tms57002_device::decode_cat2_pre(uint32_t opcode, unsigned short *op, cstate *cs) { switch((opcode >> 11) & 0x7f) { case 0x00: // nop @@ -118,7 +118,7 @@ void tms57002_device::decode_cat2_pre(UINT32 opcode, unsigned short *op, cstate } } -void tms57002_device::decode_cat2_post(UINT32 opcode, unsigned short *op, cstate *cs) +void tms57002_device::decode_cat2_post(uint32_t opcode, unsigned short *op, cstate *cs) { switch((opcode >> 11) & 0x7f) { case 0x00: // nop @@ -134,7 +134,7 @@ void tms57002_device::decode_cat2_post(UINT32 opcode, unsigned short *op, cstate } } -void tms57002_device::decode_cat3(UINT32 opcode, unsigned short *op, cstate *cs) +void tms57002_device::decode_cat3(uint32_t opcode, unsigned short *op, cstate *cs) { switch((opcode >> 11) & 0x7f) { case 0x00: // nop diff --git a/src/devices/cpu/tms57002/tmsinstr.lst b/src/devices/cpu/tms57002/tmsinstr.lst index bcae2967949..d3fb0fa57f5 100644 --- a/src/devices/cpu/tms57002/tmsinstr.lst +++ b/src/devices/cpu/tms57002/tmsinstr.lst @@ -1,32 +1,32 @@ abs 1 01 1 n abs aacc = %a; - if(((INT32)aacc) < 0) { + if(((int32_t)aacc) < 0) { aacc = - aacc; - if(((INT32)aacc) < 0) + if(((int32_t)aacc) < 0) st1 |= ST1_AOV; } add 1 03 1 y add %d,a - %wa((INT64)(INT32)%d + (INT64)(INT32)%a); + %wa((int64_t)(int32_t)%d + (int64_t)(int32_t)%a); add 1 04 1 y add %c,a - %wa((INT64)(INT32)%c + (INT64)(INT32)%a); + %wa((int64_t)(int32_t)%c + (int64_t)(int32_t)%a); add 1 05 1 y add %d,m %sfai(d, %d); - %wa((INT64)(INT32)d + (%mo >> 16)); + %wa((int64_t)(int32_t)d + (%mo >> 16)); add 1 06 1 y add %c,m - %wa((INT64)(INT32)%c + (%mo >> 16)); + %wa((int64_t)(int32_t)%c + (%mo >> 16)); add 1 07 1 y add %d,%c - %wa((INT64)(INT32)%d + (INT64)(INT32)%c); + %wa((int64_t)(int32_t)%d + (int64_t)(int32_t)%c); adds 1 08 1 y adds %d @@ -57,7 +57,7 @@ b 3 48 3 n b bgz 3 50 3 n cb bgz %i - if(((INT32)aacc) > 0) { + if(((int32_t)aacc) > 0) { %b(%i); } @@ -66,7 +66,7 @@ bioz 3 70 3 n cb blz 3 58 3 n cb blz %i - if(((INT32)aacc) < 0) { + if(((int32_t)aacc) < 0) { %b(%i); } @@ -191,7 +191,7 @@ lcaa 2a 08 1 y lcac 3 40 1 n lcac %i - if(((INT32)aacc) >= 0) + if(((int32_t)aacc) >= 0) ca = %i; lcak 3 18 1 n @@ -219,11 +219,11 @@ lirk 3 20 1 n lmhc 1 33 1 n lmhc %c - macc = ((INT64)(INT32)%c) << 16; + macc = ((int64_t)(int32_t)%c) << 16; lmhd 1 31 1 n lmhd %d - macc = ((INT64)(INT32)%d) << 16; + macc = ((int64_t)(int32_t)%d) << 16; lmld 1 32 1 n lmld %d @@ -250,7 +250,7 @@ mac 1 24 1 y if(d & 0x00800000) d |= 0xff000000; creg = c = %c; - r = (INT64)(INT32)c * (INT64)(INT32)d; + r = (int64_t)(int32_t)c * (int64_t)(int32_t)d; macc = %ml + (r >> 7); mac 1 25 1 y @@ -259,27 +259,27 @@ mac 1 25 1 y mac 1 26 1 y mac %c,a creg = c = %c; - r = (INT64)(INT32)c * (INT64)(INT32)%a; + r = (int64_t)(int32_t)c * (int64_t)(int32_t)%a; macc = %ml + (r >> 15); macs 1 2e 1 y macs %c,a creg = c = %c; - r = (INT64)(INT32)c * (INT64)(INT32)%a; + r = (int64_t)(int32_t)c * (int64_t)(int32_t)%a; macc = %ml + (r >> 14); macu 1 29 1 y macu %d,%c d = %d24; // d is 24bits unsigned creg = c = %c; - r = (INT64)(INT32)c * (INT64)d; + r = (int64_t)(int32_t)c * (int64_t)d; macc = %ml + (r >> 7); macu 1 2a 1 y macu a,%d d = %d24; // d is 24bits unsigned creg = c = %a; - r = (INT64)(INT32)c * (INT64)d; + r = (int64_t)(int32_t)c * (int64_t)d; macc = %ml + (r >> 7); mpy 1 21 1 y @@ -288,13 +288,13 @@ mpy 1 21 1 y if(d & 0x00800000) d |= 0xff000000; creg = c = %c; - r = (INT64)(INT32)c * (INT64)(INT32)d; + r = (int64_t)(int32_t)c * (int64_t)(int32_t)d; macc = r >> 7; mpy 1 22 1 y mpy %c,a creg = c = %c; - r = (INT64)(INT32)c * (INT64)(INT32)%a; + r = (int64_t)(int32_t)c * (int64_t)(int32_t)%a; macc = r >> 15; mpy 1 23 1 y @@ -304,7 +304,7 @@ mpyu 1 28 1 y mpyu %d,%c creg = c = %c; d = %d24; // d is 24bits unsigned - r = (INT64)(INT32)c * (INT64)d; + r = (int64_t)(int32_t)c * (int64_t)d; macc = r >> 7; neg 1 02 1 n @@ -495,11 +495,11 @@ std1 2a 0d 1 y sub 1 09 1 y sub %d,a - %wa((INT64)(INT32)%d - (INT64)(INT32)%a); + %wa((int64_t)(int32_t)%d - (int64_t)(int32_t)%a); sub 1 0a 1 y sub %c,a - %wa((INT64)(INT32)%c - (INT64)(INT32)%a); + %wa((int64_t)(int32_t)%c - (int64_t)(int32_t)%a); sub 1 0b 1 y sub %d,m @@ -509,7 +509,7 @@ sub 1 0c 1 y sub 1 0d 1 y sub %d,%c - %wa((INT64)(INT32)%d - (INT64)(INT32)%c); + %wa((int64_t)(int32_t)%d - (int64_t)(int32_t)%c); wre 1 38 1 n wre %d,%c diff --git a/src/devices/cpu/tms57002/tmsmake.py b/src/devices/cpu/tms57002/tmsmake.py index e2e12b5a4b3..1aaa0fc59e4 100755 --- a/src/devices/cpu/tms57002/tmsmake.py +++ b/src/devices/cpu/tms57002/tmsmake.py @@ -91,7 +91,7 @@ PDESC_EXPAND = { "wd1": expand_wd1, "b1": lambda v: "pc = ", "b2": lambda v: " sti |= S_BRANCH;", - "sfai1": lambda v: ["", "((INT32)("][v["sfai"]], + "sfai1": lambda v: ["", "((int32_t)("][v["sfai"]], "sfai2": lambda v: ["", ")) >> 1"][v["sfai"]], } diff --git a/src/devices/cpu/tms7000/7000dasm.cpp b/src/devices/cpu/tms7000/7000dasm.cpp index e265ef1db7e..5240cf1fc37 100644 --- a/src/devices/cpu/tms7000/7000dasm.cpp +++ b/src/devices/cpu/tms7000/7000dasm.cpp @@ -21,7 +21,7 @@ struct tms7000_opcodeinfo { int opcode; char name[8]; int operand; - UINT32 s_flag; + uint32_t s_flag; }; static const oprandinfo of[] = { @@ -382,10 +382,10 @@ CPU_DISASSEMBLE( tms7000 ) /* We found a match */ int j,k,vector; - UINT8 a; - INT8 b; - UINT16 c; - INT16 d; + uint8_t a; + int8_t b; + uint16_t c; + int16_t d; buffer += sprintf (buffer, "%s", opcodes[i].name); @@ -401,32 +401,32 @@ CPU_DISASSEMBLE( tms7000 ) buffer += sprintf (buffer, "%s", of[j].opstr[k]); break; case UI8: - a = (UINT8)opram[pos++]; + a = (uint8_t)opram[pos++]; buffer += sprintf(buffer, of[j].opstr[k], (unsigned int)a); break; case I8: - b = (INT8)opram[pos++]; - buffer += sprintf (buffer, of[j].opstr[k], (INT8)b); + b = (int8_t)opram[pos++]; + buffer += sprintf (buffer, of[j].opstr[k], (int8_t)b); break; case UI16: - c = (UINT16)opram[pos++]; + c = (uint16_t)opram[pos++]; c <<= 8; c += opram[pos++]; buffer += sprintf (buffer, of[j].opstr[k], (unsigned int)c); break; case I16: - d = (INT16)opram[pos++]; + d = (int16_t)opram[pos++]; d <<= 8; d += opram[pos++]; buffer += sprintf (buffer, of[j].opstr[k], (signed int)d); break; case PCREL: - b = (INT8)opram[pos++]; + b = (int8_t)opram[pos++]; sprintf(tmpbuf, "$%04X", pc+2+k+b); buffer += sprintf (buffer, of[j].opstr[k], tmpbuf); break; case PCABS: - c = (UINT16)opram[pos++]; + c = (uint16_t)opram[pos++]; c <<= 8; c += opram[pos++]; sprintf(tmpbuf, "$%04X", c); diff --git a/src/devices/cpu/tms7000/tms7000.cpp b/src/devices/cpu/tms7000/tms7000.cpp index bb3d24bf338..61943fa717f 100644 --- a/src/devices/cpu/tms7000/tms7000.cpp +++ b/src/devices/cpu/tms7000/tms7000.cpp @@ -105,7 +105,7 @@ ADDRESS_MAP_END // device definitions -tms7000_device::tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms7000_device::tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, TMS7000, "TMS7000", tag, owner, clock, "tms7000", __FILE__), m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, ADDRESS_MAP_NAME(tms7000_mem)), m_io_config("io", ENDIANNESS_BIG, 8, 8, 0, ADDRESS_MAP_NAME(tms7000_io)), @@ -113,7 +113,7 @@ tms7000_device::tms7000_device(const machine_config &mconfig, const char *tag, d { } -tms7000_device::tms7000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal, UINT32 info_flags, const char *shortname, const char *source) +tms7000_device::tms7000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal, uint32_t info_flags, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, internal), m_io_config("io", ENDIANNESS_BIG, 8, 8, 0, ADDRESS_MAP_NAME(tms7000_io)), @@ -121,57 +121,57 @@ tms7000_device::tms7000_device(const machine_config &mconfig, device_type type, { } -tms7020_device::tms7020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms7020_device::tms7020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS7020, "TMS7020", tag, owner, clock, ADDRESS_MAP_NAME(tms7020_mem), 0, "tms7020", __FILE__) { } -tms7020_exl_device::tms7020_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms7020_exl_device::tms7020_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS7020_EXL, "TMS7020 (Exelvision)", tag, owner, clock, ADDRESS_MAP_NAME(tms7020_mem), 0, "tms7020_exl", __FILE__) { } -tms7040_device::tms7040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms7040_device::tms7040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS7040, "TMS7040", tag, owner, clock, ADDRESS_MAP_NAME(tms7040_mem), 0, "tms7040", __FILE__) { } -tms70c00_device::tms70c00_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms70c00_device::tms70c00_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS70C00, "TMS70C00", tag, owner, clock, ADDRESS_MAP_NAME(tms7000_mem), TMS7000_CHIP_IS_CMOS, "tms70c00", __FILE__) { } -tms70c20_device::tms70c20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms70c20_device::tms70c20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS70C20, "TMS70C20", tag, owner, clock, ADDRESS_MAP_NAME(tms7020_mem), TMS7000_CHIP_IS_CMOS, "tms70c20", __FILE__) { } -tms70c40_device::tms70c40_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms70c40_device::tms70c40_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS70C40, "TMS70C40", tag, owner, clock, ADDRESS_MAP_NAME(tms7040_mem), TMS7000_CHIP_IS_CMOS, "tms70c40", __FILE__) { } -tms7001_device::tms7001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms7001_device::tms7001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS7001, "TMS7001", tag, owner, clock, ADDRESS_MAP_NAME(tms7001_mem), TMS7000_CHIP_FAMILY_70X2, "tms7001", __FILE__) { } -tms7041_device::tms7041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms7041_device::tms7041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS7041, "TMS7041", tag, owner, clock, ADDRESS_MAP_NAME(tms7041_mem), TMS7000_CHIP_FAMILY_70X2, "tms7041", __FILE__) { } -tms7002_device::tms7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms7002_device::tms7002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS7002, "TMS7002", tag, owner, clock, ADDRESS_MAP_NAME(tms7002_mem), TMS7000_CHIP_FAMILY_70X2, "tms7002", __FILE__) { } -tms7042_device::tms7042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms7042_device::tms7042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS7042, "TMS7042", tag, owner, clock, ADDRESS_MAP_NAME(tms7042_mem), TMS7000_CHIP_FAMILY_70X2, "tms7042", __FILE__) { } -tms70c46_device::tms70c46_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms70c46_device::tms70c46_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms7000_device(mconfig, TMS70C46, "TMS70C46", tag, owner, clock, ADDRESS_MAP_NAME(tms70c46_mem), TMS7000_CHIP_IS_CMOS, "tms70c46", __FILE__) { } @@ -267,7 +267,7 @@ void tms7000_device::state_string_export(const device_state_entry &entry, std::s } } -offs_t tms7000_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms7000_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms7000 ); return CPU_DISASSEMBLE_NAME(tms7000)(this, buffer, pc, oprom, opram, options); @@ -623,7 +623,7 @@ void tms7000_device::execute_run() } while (m_icount > 0); } -void tms7000_device::execute_one(UINT8 op) +void tms7000_device::execute_one(uint8_t op) { switch (op) { @@ -854,7 +854,7 @@ void tms7000_device::execute_one(UINT8 op) } } -void tms7020_exl_device::execute_one(UINT8 op) +void tms7020_exl_device::execute_one(uint8_t op) { // TMS7020 Exelvision EXL 100 custom opcode(s) if (op == 0xd7) diff --git a/src/devices/cpu/tms7000/tms7000.h b/src/devices/cpu/tms7000/tms7000.h index 1097f86acad..1d7c04e024f 100644 --- a/src/devices/cpu/tms7000/tms7000.h +++ b/src/devices/cpu/tms7000/tms7000.h @@ -45,8 +45,8 @@ class tms7000_device : public cpu_device { public: // construction/destruction - tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms7000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal, UINT32 info_flags, const char *shortname, const char *source); + tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms7000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, address_map_constructor internal, uint32_t info_flags, const char *shortname, const char *source); DECLARE_READ8_MEMBER(tms7000_unmapped_rf_r) { if (!space.debugger_access()) logerror("'%s' (%04X): unmapped_rf_r @ $%04x\n", tag(), m_pc, offset + 0x80); return 0; }; DECLARE_WRITE8_MEMBER(tms7000_unmapped_rf_w) { logerror("'%s' (%04X): unmapped_rf_w @ $%04x = $%02x\n", tag(), m_pc, offset + 0x80, data); }; @@ -57,7 +57,7 @@ public: DECLARE_WRITE8_MEMBER(tms7002_pf_w) { tms7000_pf_w(space, offset + 0x10, data); } bool chip_is_cmos() { return (m_info_flags & TMS7000_CHIP_IS_CMOS) ? true : false; } - UINT32 chip_get_family() { return m_info_flags & TMS7000_CHIP_FAMILY_MASK; } + uint32_t chip_get_family() { return m_info_flags & TMS7000_CHIP_FAMILY_MASK; } bool chip_is_family_70x0() { return chip_get_family() == TMS7000_CHIP_FAMILY_70X0; } bool chip_is_family_70x2() { return chip_get_family() == TMS7000_CHIP_FAMILY_70X2; } bool chip_is_family_70cx2() { return chip_get_family() == TMS7000_CHIP_FAMILY_70CX2; } @@ -68,11 +68,11 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 2 - 1) / 2; } // internal /2 divider - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 2); } // internal /2 divider - virtual UINT32 execute_min_cycles() const override { return 5; } - virtual UINT32 execute_max_cycles() const override { return 49; } - virtual UINT32 execute_input_lines() const override { return 2; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 2 - 1) / 2; } // internal /2 divider + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } // internal /2 divider + virtual uint32_t execute_min_cycles() const override { return 5; } + virtual uint32_t execute_max_cycles() const override { return 49; } + virtual uint32_t execute_input_lines() const override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int extline, int state) override; @@ -83,16 +83,16 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; - virtual void execute_one(UINT8 op); + virtual void execute_one(uint8_t op); address_space_config m_program_config; address_space_config m_io_config; - UINT32 m_info_flags; + uint32_t m_info_flags; address_space *m_program; direct_read_data *m_direct; @@ -102,22 +102,22 @@ protected: bool m_irq_state[2]; bool m_idle_state; bool m_idle_halt; - UINT16 m_pc; - UINT8 m_sp; - UINT8 m_sr; - UINT8 m_op; + uint16_t m_pc; + uint8_t m_sp; + uint8_t m_sr; + uint8_t m_op; - UINT8 m_io_control[3]; + uint8_t m_io_control[3]; emu_timer *m_timer_handle[2]; - UINT8 m_timer_data[2]; - UINT8 m_timer_control[2]; + uint8_t m_timer_data[2]; + uint8_t m_timer_control[2]; int m_timer_decrementer[2]; int m_timer_prescaler[2]; - UINT16 m_timer_capture_latch[2]; + uint16_t m_timer_capture_latch[2]; - UINT8 m_port_latch[4]; - UINT8 m_port_ddr[4]; + uint8_t m_port_latch[4]; + uint8_t m_port_ddr[4]; void flag_ext_interrupt(int extline); void check_interrupts(); @@ -130,26 +130,26 @@ protected: void timer_tick_low(int tmr); // internal read/write - inline UINT8 read_r8(UINT8 address) { return m_program->read_byte(address); } - inline void write_r8(UINT8 address, UINT8 data) { m_program->write_byte(address, data); } - inline UINT16 read_r16(UINT8 address) { return m_program->read_byte((address - 1) & 0xff) << 8 | m_program->read_byte(address); } - inline void write_r16(UINT8 address, UINT16 data) { m_program->write_byte((address - 1) & 0xff, data >> 8 & 0xff); m_program->write_byte(address, data & 0xff); } + inline uint8_t read_r8(uint8_t address) { return m_program->read_byte(address); } + inline void write_r8(uint8_t address, uint8_t data) { m_program->write_byte(address, data); } + inline uint16_t read_r16(uint8_t address) { return m_program->read_byte((address - 1) & 0xff) << 8 | m_program->read_byte(address); } + inline void write_r16(uint8_t address, uint16_t data) { m_program->write_byte((address - 1) & 0xff, data >> 8 & 0xff); m_program->write_byte(address, data & 0xff); } - inline UINT8 read_p(UINT8 address) { return m_program->read_byte(0x100 + address); } - inline void write_p(UINT8 address, UINT8 data) { m_program->write_byte(0x100 + address, data); } + inline uint8_t read_p(uint8_t address) { return m_program->read_byte(0x100 + address); } + inline void write_p(uint8_t address, uint8_t data) { m_program->write_byte(0x100 + address, data); } - inline UINT8 read_mem8(UINT16 address) { return m_program->read_byte(address); } - inline void write_mem8(UINT16 address, UINT8 data) { m_program->write_byte(address, data); } - inline UINT16 read_mem16(UINT16 address) { return m_program->read_byte(address) << 8 | m_program->read_byte((address + 1) & 0xffff); } - inline void write_mem16(UINT16 address, UINT16 data) { m_program->write_byte(address, data >> 8 & 0xff); m_program->write_byte((address + 1) & 0xffff, data & 0xff); } + inline uint8_t read_mem8(uint16_t address) { return m_program->read_byte(address); } + inline void write_mem8(uint16_t address, uint8_t data) { m_program->write_byte(address, data); } + inline uint16_t read_mem16(uint16_t address) { return m_program->read_byte(address) << 8 | m_program->read_byte((address + 1) & 0xffff); } + inline void write_mem16(uint16_t address, uint16_t data) { m_program->write_byte(address, data >> 8 & 0xff); m_program->write_byte((address + 1) & 0xffff, data & 0xff); } - inline UINT8 imm8() { return m_direct->read_byte(m_pc++); } - inline UINT16 imm16() { UINT16 ret = m_direct->read_byte(m_pc++) << 8; return ret | m_direct->read_byte(m_pc++); } + inline uint8_t imm8() { return m_direct->read_byte(m_pc++); } + inline uint16_t imm16() { uint16_t ret = m_direct->read_byte(m_pc++) << 8; return ret | m_direct->read_byte(m_pc++); } - inline UINT8 pull8() { return m_program->read_byte(m_sp--); } - inline void push8(UINT8 data) { m_program->write_byte(++m_sp, data); } - inline UINT16 pull16() { UINT16 ret = m_program->read_byte(m_sp--); return ret | m_program->read_byte(m_sp--) << 8; } - inline void push16(UINT16 data) { m_program->write_byte(++m_sp, data >> 8 & 0xff); m_program->write_byte(++m_sp, data & 0xff); } + inline uint8_t pull8() { return m_program->read_byte(m_sp--); } + inline void push8(uint8_t data) { m_program->write_byte(++m_sp, data); } + inline uint16_t pull16() { uint16_t ret = m_program->read_byte(m_sp--); return ret | m_program->read_byte(m_sp--) << 8; } + inline void push16(uint16_t data) { m_program->write_byte(++m_sp, data >> 8 & 0xff); m_program->write_byte(++m_sp, data & 0xff); } // statusreg flags enum @@ -199,39 +199,39 @@ protected: void sta_inx(); void sta_ind(); void stsp(); - void trap(UINT8 address); - void illegal(UINT8 op); - - typedef int (tms7000_device::*op_func)(UINT8, UINT8); - int op_clr(UINT8 param1, UINT8 param2); - int op_dec(UINT8 param1, UINT8 param2); - int op_inc(UINT8 param1, UINT8 param2); - int op_inv(UINT8 param1, UINT8 param2); - int op_rl(UINT8 param1, UINT8 param2); - int op_rlc(UINT8 param1, UINT8 param2); - int op_rr(UINT8 param1, UINT8 param2); - int op_rrc(UINT8 param1, UINT8 param2); - int op_swap(UINT8 param1, UINT8 param2); - int op_xchb(UINT8 param1, UINT8 param2); - - int op_adc(UINT8 param1, UINT8 param2); - int op_add(UINT8 param1, UINT8 param2); - int op_and(UINT8 param1, UINT8 param2); - int op_cmp(UINT8 param1, UINT8 param2); - int op_dac(UINT8 param1, UINT8 param2); - int op_dsb(UINT8 param1, UINT8 param2); - int op_mpy(UINT8 param1, UINT8 param2); - int op_mov(UINT8 param1, UINT8 param2); - int op_or(UINT8 param1, UINT8 param2); - int op_sbb(UINT8 param1, UINT8 param2); - int op_sub(UINT8 param1, UINT8 param2); - int op_xor(UINT8 param1, UINT8 param2); + void trap(uint8_t address); + void illegal(uint8_t op); + + typedef int (tms7000_device::*op_func)(uint8_t, uint8_t); + int op_clr(uint8_t param1, uint8_t param2); + int op_dec(uint8_t param1, uint8_t param2); + int op_inc(uint8_t param1, uint8_t param2); + int op_inv(uint8_t param1, uint8_t param2); + int op_rl(uint8_t param1, uint8_t param2); + int op_rlc(uint8_t param1, uint8_t param2); + int op_rr(uint8_t param1, uint8_t param2); + int op_rrc(uint8_t param1, uint8_t param2); + int op_swap(uint8_t param1, uint8_t param2); + int op_xchb(uint8_t param1, uint8_t param2); + + int op_adc(uint8_t param1, uint8_t param2); + int op_add(uint8_t param1, uint8_t param2); + int op_and(uint8_t param1, uint8_t param2); + int op_cmp(uint8_t param1, uint8_t param2); + int op_dac(uint8_t param1, uint8_t param2); + int op_dsb(uint8_t param1, uint8_t param2); + int op_mpy(uint8_t param1, uint8_t param2); + int op_mov(uint8_t param1, uint8_t param2); + int op_or(uint8_t param1, uint8_t param2); + int op_sbb(uint8_t param1, uint8_t param2); + int op_sub(uint8_t param1, uint8_t param2); + int op_xor(uint8_t param1, uint8_t param2); void shortbranch(bool check); void jmp(bool check); - int op_djnz(UINT8 param1, UINT8 param2); - int op_btjo(UINT8 param1, UINT8 param2); - int op_btjz(UINT8 param1, UINT8 param2); + int op_djnz(uint8_t param1, uint8_t param2); + int op_btjo(uint8_t param1, uint8_t param2); + int op_btjz(uint8_t param1, uint8_t param2); void am_a(op_func op); void am_b(op_func op); @@ -259,17 +259,17 @@ protected: class tms7020_device : public tms7000_device { public: - tms7020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms7020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms7020_exl_device : public tms7000_device { public: - tms7020_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms7020_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual void execute_one(UINT8 op) override; + virtual void execute_one(uint8_t op) override; private: void lvdp(); @@ -279,35 +279,35 @@ private: class tms7040_device : public tms7000_device { public: - tms7040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms7040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms70c00_device : public tms7000_device { public: - tms70c00_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms70c00_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms70c20_device : public tms7000_device { public: - tms70c20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms70c20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms70c40_device : public tms7000_device { public: - tms70c40_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms70c40_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms70c46_device : public tms7000_device { public: - tms70c46_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms70c46_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(control_r); DECLARE_WRITE8_MEMBER(control_w); @@ -327,35 +327,35 @@ protected: virtual void device_reset() override; private: - UINT8 m_control; + uint8_t m_control; }; class tms7001_device : public tms7000_device { public: - tms7001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms7001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms7041_device : public tms7000_device { public: - tms7041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms7041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms7002_device : public tms7000_device { public: - tms7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms7002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms7042_device : public tms7000_device { public: - tms7042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms7042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/tms7000/tms7000op.cpp b/src/devices/cpu/tms7000/tms7000op.cpp index 24880caafe8..dcc2db25a44 100644 --- a/src/devices/cpu/tms7000/tms7000op.cpp +++ b/src/devices/cpu/tms7000/tms7000op.cpp @@ -33,7 +33,7 @@ void tms7000_device::am_b(op_func op) void tms7000_device::am_r(op_func op) { m_icount -= 7; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), 0); } @@ -52,14 +52,14 @@ void tms7000_device::am_a2b(op_func op) void tms7000_device::am_a2p(op_func op) { m_icount -= 10; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_p, r, read_p(r), read_r8(0)); } void tms7000_device::am_a2r(op_func op) { m_icount -= 8; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), read_r8(0)); } @@ -78,14 +78,14 @@ void tms7000_device::am_b2b(op_func op) void tms7000_device::am_b2r(op_func op) { m_icount -= 7; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), read_r8(1)); } void tms7000_device::am_b2p(op_func op) { m_icount -= 9; - UINT8 r = imm8(); + uint8_t r = imm8(); AM_WB(write_p, r, read_p(r), read_r8(1)); } @@ -104,8 +104,8 @@ void tms7000_device::am_r2b(op_func op) void tms7000_device::am_r2r(op_func op) { m_icount -= 10; - UINT8 param2 = read_r8(imm8()); - UINT8 r = imm8(); + uint8_t param2 = read_r8(imm8()); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), param2); } @@ -124,16 +124,16 @@ void tms7000_device::am_i2b(op_func op) void tms7000_device::am_i2r(op_func op) { m_icount -= 9; - UINT8 param2 = imm8(); - UINT8 r = imm8(); + uint8_t param2 = imm8(); + uint8_t r = imm8(); AM_WB(write_r8, r, read_r8(r), param2); } void tms7000_device::am_i2p(op_func op) { m_icount -= 11; - UINT8 param2 = imm8(); - UINT8 r = imm8(); + uint8_t param2 = imm8(); + uint8_t r = imm8(); AM_WB(write_p, r, read_p(r), param2); } @@ -153,177 +153,177 @@ void tms7000_device::am_p2b(op_func op) // common opcodes // 1 param -int tms7000_device::op_clr(UINT8 param1, UINT8 param2) +int tms7000_device::op_clr(uint8_t param1, uint8_t param2) { - UINT8 t = 0; + uint8_t t = 0; SET_CNZ(t); return t; } -int tms7000_device::op_dec(UINT8 param1, UINT8 param2) +int tms7000_device::op_dec(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - 1; + uint16_t t = param1 - 1; SET_NZ(t); SET_C(~t); return t; } -int tms7000_device::op_inc(UINT8 param1, UINT8 param2) +int tms7000_device::op_inc(uint8_t param1, uint8_t param2) { - UINT16 t = param1 + 1; + uint16_t t = param1 + 1; SET_CNZ(t); return t; } -int tms7000_device::op_inv(UINT8 param1, UINT8 param2) +int tms7000_device::op_inv(uint8_t param1, uint8_t param2) { - UINT8 t = ~param1; + uint8_t t = ~param1; SET_CNZ(t); return t; } -int tms7000_device::op_rl(UINT8 param1, UINT8 param2) +int tms7000_device::op_rl(uint8_t param1, uint8_t param2) { - UINT16 t = param1 << 1 | param1 >> 7; + uint16_t t = param1 << 1 | param1 >> 7; SET_CNZ(t); return t; } -int tms7000_device::op_rlc(UINT8 param1, UINT8 param2) +int tms7000_device::op_rlc(uint8_t param1, uint8_t param2) { - UINT16 t = param1 << 1 | GET_C(); + uint16_t t = param1 << 1 | GET_C(); SET_CNZ(t); return t; } -int tms7000_device::op_rr(UINT8 param1, UINT8 param2) +int tms7000_device::op_rr(uint8_t param1, uint8_t param2) { - UINT16 t = param1 >> 1 | param1 << 8 | (param1 << 7 & 0x80); + uint16_t t = param1 >> 1 | param1 << 8 | (param1 << 7 & 0x80); SET_CNZ(t); return t; } -int tms7000_device::op_rrc(UINT8 param1, UINT8 param2) +int tms7000_device::op_rrc(uint8_t param1, uint8_t param2) { - UINT16 t = param1 >> 1 | param1 << 8 | GET_C() << 7; + uint16_t t = param1 >> 1 | param1 << 8 | GET_C() << 7; SET_CNZ(t); return t; } -int tms7000_device::op_swap(UINT8 param1, UINT8 param2) +int tms7000_device::op_swap(uint8_t param1, uint8_t param2) { m_icount -= 3; - UINT16 t = param1 >> 4 | param1 << 4; + uint16_t t = param1 >> 4 | param1 << 4; SET_CNZ(t); return t; } -int tms7000_device::op_xchb(UINT8 param1, UINT8 param2) +int tms7000_device::op_xchb(uint8_t param1, uint8_t param2) { m_icount -= 1; - UINT8 t = read_r8(1); + uint8_t t = read_r8(1); SET_CNZ(t); write_r8(1, param1); return t; } // 2 params -int tms7000_device::op_adc(UINT8 param1, UINT8 param2) +int tms7000_device::op_adc(uint8_t param1, uint8_t param2) { - UINT16 t = param1 + param2 + GET_C(); + uint16_t t = param1 + param2 + GET_C(); SET_CNZ(t); return t; } -int tms7000_device::op_add(UINT8 param1, UINT8 param2) +int tms7000_device::op_add(uint8_t param1, uint8_t param2) { - UINT16 t = param1 + param2; + uint16_t t = param1 + param2; SET_CNZ(t); return t; } -int tms7000_device::op_and(UINT8 param1, UINT8 param2) +int tms7000_device::op_and(uint8_t param1, uint8_t param2) { - UINT8 t = param1 & param2; + uint8_t t = param1 & param2; SET_CNZ(t); return t; } -int tms7000_device::op_cmp(UINT8 param1, UINT8 param2) +int tms7000_device::op_cmp(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - param2; + uint16_t t = param1 - param2; SET_NZ(t); SET_C(~t); return WB_NO; } -int tms7000_device::op_mpy(UINT8 param1, UINT8 param2) +int tms7000_device::op_mpy(uint8_t param1, uint8_t param2) { m_icount -= 39; - UINT16 t = param1 * param2; + uint16_t t = param1 * param2; SET_CNZ(t >> 8); write_mem16(0, t); // always writes result to regs A-B return WB_NO; } -int tms7000_device::op_mov(UINT8 param1, UINT8 param2) +int tms7000_device::op_mov(uint8_t param1, uint8_t param2) { - UINT8 t = param2; + uint8_t t = param2; SET_CNZ(t); return t; } -int tms7000_device::op_or(UINT8 param1, UINT8 param2) +int tms7000_device::op_or(uint8_t param1, uint8_t param2) { - UINT8 t = param1 | param2; + uint8_t t = param1 | param2; SET_CNZ(t); return t; } -int tms7000_device::op_sbb(UINT8 param1, UINT8 param2) +int tms7000_device::op_sbb(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - param2 - (!GET_C()); + uint16_t t = param1 - param2 - (!GET_C()); SET_NZ(t); SET_C(~t); return t; } -int tms7000_device::op_sub(UINT8 param1, UINT8 param2) +int tms7000_device::op_sub(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - param2; + uint16_t t = param1 - param2; SET_NZ(t); SET_C(~t); return t; } -int tms7000_device::op_xor(UINT8 param1, UINT8 param2) +int tms7000_device::op_xor(uint8_t param1, uint8_t param2) { - UINT8 t = param1 ^ param2; + uint8_t t = param1 ^ param2; SET_CNZ(t); return t; } // BCD arthrimetic handling -static const UINT8 lut_bcd_out[6] = { 0x00, 0x06, 0x00, 0x66, 0x60, 0x66 }; +static const uint8_t lut_bcd_out[6] = { 0x00, 0x06, 0x00, 0x66, 0x60, 0x66 }; -int tms7000_device::op_dac(UINT8 param1, UINT8 param2) +int tms7000_device::op_dac(uint8_t param1, uint8_t param2) { m_icount -= 2; int c = GET_C(); - UINT8 h1 = param1 >> 4 & 0xf; - UINT8 l1 = param1 >> 0 & 0xf; - UINT8 h2 = param2 >> 4 & 0xf; - UINT8 l2 = param2 >> 0 & 0xf; + uint8_t h1 = param1 >> 4 & 0xf; + uint8_t l1 = param1 >> 0 & 0xf; + uint8_t h2 = param2 >> 4 & 0xf; + uint8_t l2 = param2 >> 0 & 0xf; // compute bcd constant - UINT8 d = ((l1 + l2 + c) < 10) ? 0 : 1; + uint8_t d = ((l1 + l2 + c) < 10) ? 0 : 1; if ((h1 + h2) == 9) d |= 2; else if ((h1 + h2) > 9) d |= 4; - UINT8 t = param1 + param2 + c + lut_bcd_out[d]; + uint8_t t = param1 + param2 + c + lut_bcd_out[d]; SET_CNZ(t); if (d > 2) m_sr |= SR_C; @@ -331,24 +331,24 @@ int tms7000_device::op_dac(UINT8 param1, UINT8 param2) return t; } -int tms7000_device::op_dsb(UINT8 param1, UINT8 param2) +int tms7000_device::op_dsb(uint8_t param1, uint8_t param2) { m_icount -= 2; int c = !GET_C(); - UINT8 h1 = param1 >> 4 & 0xf; - UINT8 l1 = param1 >> 0 & 0xf; - UINT8 h2 = param2 >> 4 & 0xf; - UINT8 l2 = param2 >> 0 & 0xf; + uint8_t h1 = param1 >> 4 & 0xf; + uint8_t l1 = param1 >> 0 & 0xf; + uint8_t h2 = param2 >> 4 & 0xf; + uint8_t l2 = param2 >> 0 & 0xf; // compute bcd constant - UINT8 d = ((l1 - c) >= l2) ? 0 : 1; + uint8_t d = ((l1 - c) >= l2) ? 0 : 1; if (h1 == h2) d |= 2; else if (h1 < h2) d |= 4; - UINT8 t = param1 - param2 - c - lut_bcd_out[d]; + uint8_t t = param1 - param2 - c - lut_bcd_out[d]; SET_CNZ(t); if (d <= 2) m_sr |= SR_C; @@ -360,7 +360,7 @@ int tms7000_device::op_dsb(UINT8 param1, UINT8 param2) void tms7000_device::shortbranch(bool check) { m_icount -= 2; - INT8 d = (INT8)imm8(); + int8_t d = (int8_t)imm8(); if (check) { @@ -375,24 +375,24 @@ void tms7000_device::jmp(bool check) shortbranch(check); } -int tms7000_device::op_djnz(UINT8 param1, UINT8 param2) +int tms7000_device::op_djnz(uint8_t param1, uint8_t param2) { - UINT16 t = param1 - 1; + uint16_t t = param1 - 1; shortbranch(t != 0); return t; } -int tms7000_device::op_btjo(UINT8 param1, UINT8 param2) +int tms7000_device::op_btjo(uint8_t param1, uint8_t param2) { - UINT8 t = param1 & param2; + uint8_t t = param1 & param2; SET_CNZ(t); shortbranch(t != 0); return WB_NO; } -int tms7000_device::op_btjz(UINT8 param1, UINT8 param2) +int tms7000_device::op_btjz(uint8_t param1, uint8_t param2) { - UINT8 t = ~param1 & param2; + uint8_t t = ~param1 & param2; SET_CNZ(t); shortbranch(t != 0); return WB_NO; @@ -405,7 +405,7 @@ int tms7000_device::op_btjz(UINT8 param1, UINT8 param2) void tms7000_device::decd_a() { m_icount -= 9; - UINT32 t = read_r16(0) - 1; + uint32_t t = read_r16(0) - 1; write_r16(0, t); SET_NZ(t >> 8); SET_C(~(t >> 8)); @@ -414,7 +414,7 @@ void tms7000_device::decd_a() void tms7000_device::decd_b() { m_icount -= 9; - UINT32 t = read_r16(1) - 1; + uint32_t t = read_r16(1) - 1; write_r16(1, t); SET_NZ(t >> 8); SET_C(~(t >> 8)); @@ -423,8 +423,8 @@ void tms7000_device::decd_b() void tms7000_device::decd_r() { m_icount -= 11; - UINT8 r = imm8(); - UINT32 t = read_r16(r) - 1; + uint8_t r = imm8(); + uint32_t t = read_r16(r) - 1; write_r16(r, t); SET_NZ(t >> 8); SET_C(~(t >> 8)); @@ -434,7 +434,7 @@ void tms7000_device::decd_r() void tms7000_device::cmpa_dir() { m_icount -= 12; - UINT16 t = read_r8(0) - read_mem8(imm16()); + uint16_t t = read_r8(0) - read_mem8(imm16()); SET_NZ(t); SET_C(~t); } @@ -442,7 +442,7 @@ void tms7000_device::cmpa_dir() void tms7000_device::cmpa_inx() { m_icount -= 14; - UINT16 t = read_r8(0) - read_mem8(imm16() + read_r8(1)); + uint16_t t = read_r8(0) - read_mem8(imm16() + read_r8(1)); SET_NZ(t); SET_C(~t); } @@ -450,7 +450,7 @@ void tms7000_device::cmpa_inx() void tms7000_device::cmpa_ind() { m_icount -= 11; - UINT16 t = read_r8(0) - read_mem8(read_r16(imm8())); + uint16_t t = read_r8(0) - read_mem8(read_r16(imm8())); SET_NZ(t); SET_C(~t); } @@ -459,7 +459,7 @@ void tms7000_device::cmpa_ind() void tms7000_device::lda_dir() { m_icount -= 11; - UINT8 t = read_mem8(imm16()); + uint8_t t = read_mem8(imm16()); write_r8(0, t); SET_CNZ(t); } @@ -467,7 +467,7 @@ void tms7000_device::lda_dir() void tms7000_device::lda_inx() { m_icount -= 13; - UINT8 t = read_mem8(imm16() + read_r8(1)); + uint8_t t = read_mem8(imm16() + read_r8(1)); write_r8(0, t); SET_CNZ(t); } @@ -475,7 +475,7 @@ void tms7000_device::lda_inx() void tms7000_device::lda_ind() { m_icount -= 10; - UINT8 t = read_mem8(read_r16(imm8())); + uint8_t t = read_mem8(read_r16(imm8())); write_r8(0, t); SET_CNZ(t); } @@ -484,7 +484,7 @@ void tms7000_device::lda_ind() void tms7000_device::sta_dir() { m_icount -= 11; - UINT8 t = read_r8(0); + uint8_t t = read_r8(0); write_mem8(imm16(), t); SET_CNZ(t); } @@ -492,7 +492,7 @@ void tms7000_device::sta_dir() void tms7000_device::sta_inx() { m_icount -= 13; - UINT8 t = read_r8(0); + uint8_t t = read_r8(0); write_mem8(imm16() + read_r8(1), t); SET_CNZ(t); } @@ -500,7 +500,7 @@ void tms7000_device::sta_inx() void tms7000_device::sta_ind() { m_icount -= 10; - UINT8 t = read_r8(0); + uint8_t t = read_r8(0); write_mem8(read_r16(imm8()), t); SET_CNZ(t); } @@ -509,7 +509,7 @@ void tms7000_device::sta_ind() void tms7000_device::movd_dir() { m_icount -= 15; - UINT16 t = imm16(); + uint16_t t = imm16(); write_r16(imm8(), t); SET_CNZ(t >> 8); } @@ -517,7 +517,7 @@ void tms7000_device::movd_dir() void tms7000_device::movd_inx() { m_icount -= 17; - UINT16 t = imm16() + read_r8(1); + uint16_t t = imm16() + read_r8(1); write_r16(imm8(), t); SET_CNZ(t >> 8); } @@ -525,7 +525,7 @@ void tms7000_device::movd_inx() void tms7000_device::movd_ind() { m_icount -= 14; - UINT16 t = read_r16(imm8()); + uint16_t t = read_r16(imm8()); write_r16(imm8(), t); SET_CNZ(t >> 8); } @@ -553,7 +553,7 @@ void tms7000_device::br_ind() void tms7000_device::call_dir() { m_icount -= 14; - UINT16 t = imm16(); + uint16_t t = imm16(); push16(m_pc); m_pc = t; } @@ -561,7 +561,7 @@ void tms7000_device::call_dir() void tms7000_device::call_inx() { m_icount -= 16; - UINT16 t = imm16() + read_r8(1); + uint16_t t = imm16() + read_r8(1); push16(m_pc); m_pc = t; } @@ -569,12 +569,12 @@ void tms7000_device::call_inx() void tms7000_device::call_ind() { m_icount -= 13; - UINT16 t = read_r16(imm8()); + uint16_t t = read_r16(imm8()); push16(m_pc); m_pc = t; } -void tms7000_device::trap(UINT8 address) +void tms7000_device::trap(uint8_t address) { m_icount -= 14; push16(m_pc); @@ -599,7 +599,7 @@ void tms7000_device::rets() void tms7000_device::pop_a() { m_icount -= 6; - UINT8 t = pull8(); + uint8_t t = pull8(); write_r8(0, t); SET_CNZ(t); } @@ -607,7 +607,7 @@ void tms7000_device::pop_a() void tms7000_device::pop_b() { m_icount -= 6; - UINT8 t = pull8(); + uint8_t t = pull8(); write_r8(1, t); SET_CNZ(t); } @@ -615,7 +615,7 @@ void tms7000_device::pop_b() void tms7000_device::pop_r() { m_icount -= 8; - UINT8 t = pull8(); + uint8_t t = pull8(); write_r8(imm8(), t); SET_CNZ(t); } @@ -631,7 +631,7 @@ void tms7000_device::pop_st() void tms7000_device::push_a() { m_icount -= 6; - UINT8 t = read_r8(0); + uint8_t t = read_r8(0); push8(t); SET_CNZ(t); } @@ -639,7 +639,7 @@ void tms7000_device::push_a() void tms7000_device::push_b() { m_icount -= 6; - UINT8 t = read_r8(1); + uint8_t t = read_r8(1); push8(t); SET_CNZ(t); } @@ -647,7 +647,7 @@ void tms7000_device::push_b() void tms7000_device::push_r() { m_icount -= 8; - UINT8 t = read_r8(imm8()); + uint8_t t = read_r8(imm8()); push8(t); SET_CNZ(t); } @@ -712,13 +712,13 @@ void tms7020_exl_device::lvdp() m_icount -= 10; // TODO: check real timing imm8(); // always 0x28? discarded? read_p(0x28); - UINT8 t = read_p(0x24); + uint8_t t = read_p(0x24); write_r8(0, t); SET_CNZ(t); } // illegal opcode handling -void tms7000_device::illegal(UINT8 op) +void tms7000_device::illegal(uint8_t op) { m_icount -= 5; // guessed logerror("%s: illegal opcode $%02X @ $%04x\n", tag(), op, m_pc); diff --git a/src/devices/cpu/tms9900/9900dasm.cpp b/src/devices/cpu/tms9900/9900dasm.cpp index adf5affc0d6..bd4b0215d32 100644 --- a/src/devices/cpu/tms9900/9900dasm.cpp +++ b/src/devices/cpu/tms9900/9900dasm.cpp @@ -300,13 +300,13 @@ static const enum opcodes ops_001c_002f_s0[20]= static int PC; -static inline UINT16 readop_arg(const UINT8 *opram, unsigned pc) +static inline uint16_t readop_arg(const uint8_t *opram, unsigned pc) { - UINT16 result = opram[PC++ - pc] << 8; + uint16_t result = opram[PC++ - pc] << 8; return result | opram[PC++ - pc]; } -static int print_arg (char *dest, int mode, int arg, const UINT8 *opram, unsigned pc) +static int print_arg (char *dest, int mode, int arg, const uint8_t *opram, unsigned pc) { int base; @@ -333,7 +333,7 @@ static int print_arg (char *dest, int mode, int arg, const UINT8 *opram, unsigne /***************************************************************************** * Disassemble a single command and return the number of bytes it uses. *****************************************************************************/ -unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const UINT8 *oprom, const UINT8 *opram) +unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const uint8_t *oprom, const uint8_t *opram) { int OP, OP2, opc; int sarg, darg, smode, dmode; diff --git a/src/devices/cpu/tms9900/99xxcore.h b/src/devices/cpu/tms9900/99xxcore.h index 827e32dc5eb..6eaef876d95 100644 --- a/src/devices/cpu/tms9900/99xxcore.h +++ b/src/devices/cpu/tms9900/99xxcore.h @@ -283,16 +283,16 @@ Other references can be found on spies.com: struct tms99xx_state; -static inline void execute(tms99xx_state *cpustate, UINT16 opcode); +static inline void execute(tms99xx_state *cpustate, uint16_t opcode); #if EXTERNAL_INSTRUCTION_DECODING static void external_instruction_notify(tms99xx_state *cpustate, int ext_op_ID); #endif -static UINT16 decipheraddr(tms99xx_state *cpustate, UINT16 opcode); -static UINT16 decipheraddrbyte(tms99xx_state *cpustate, UINT16 opcode); -static void contextswitch(tms99xx_state *cpustate, UINT16 addr); +static uint16_t decipheraddr(tms99xx_state *cpustate, uint16_t opcode); +static uint16_t decipheraddrbyte(tms99xx_state *cpustate, uint16_t opcode); +static void contextswitch(tms99xx_state *cpustate, uint16_t addr); #if HAS_MAPPING || HAS_PRIVILEGE -static void contextswitchX(tms99xx_state *cpustate, UINT16 addr); +static void contextswitchX(tms99xx_state *cpustate, uint16_t addr); #else #define contextswitchX(cs, addr) contextswitch(cs, addr) #endif @@ -420,40 +420,40 @@ a ST_MASK */ struct map_file_t { - UINT16 L[3], B[3]; /* actual registers */ - UINT32 limit[3], bias[3]; /* equivalent in a more convenient form */ + uint16_t L[3], B[3]; /* actual registers */ + uint32_t limit[3], bias[3]; /* equivalent in a more convenient form */ }; struct tms99xx_state { /* "actual" tms9900 registers : */ - UINT16 WP; /* Workspace pointer */ - UINT16 PC; /* Program counter */ - UINT16 STATUS; /* STatus register */ + uint16_t WP; /* Workspace pointer */ + uint16_t PC; /* Program counter */ + uint16_t STATUS; /* STatus register */ /* Now, data used for emulation */ - UINT8 lastparity; + uint8_t lastparity; char lds_flag, ldd_flag; - UINT16 IR; /* Instruction register, with the currently parsed opcode */ + uint16_t IR; /* Instruction register, with the currently parsed opcode */ - UINT8 interrupt_pending; /* true if an interrupt must be honored... */ + uint8_t interrupt_pending; /* true if an interrupt must be honored... */ #if ! ((TMS99XX_MODEL == TMS9940_ID) || (TMS99XX_MODEL == TMS9985_ID)) - UINT8 load_state; /* nonzero if the LOAD* line is active (low) */ + uint8_t load_state; /* nonzero if the LOAD* line is active (low) */ #endif #if (TMS99XX_MODEL == TI990_10_ID) || (TMS99XX_MODEL == TMS9900_ID) || (TMS99XX_MODEL == TMS9980_ID) /* On tms9900, we cache the state of INTREQ* and IC0-IC3 here */ /* On tms9980/9981, we translate the state of IC0-IC2 to the equivalent state for a tms9900, and store the result here */ - UINT8 irq_level; /* when INTREQ* is active, interrupt level on IC0-IC3 ; else always 16 */ - UINT8 irq_state; /* nonzero if the INTREQ* line is active (low) */ + uint8_t irq_level; /* when INTREQ* is active, interrupt level on IC0-IC3 ; else always 16 */ + uint8_t irq_state; /* nonzero if the INTREQ* line is active (low) */ /* with TMS9940, bit 0 means INT1, bit 1 decrementer, bit 2 INT2 */ #elif (TMS99XX_MODEL == TMS9995_ID) /* tms9995 is quite different : it latches the interrupt inputs */ - UINT8 irq_level; /* We store the level of the request with the highest level here */ - UINT8 int_state; /* interrupt lines state */ - UINT8 int_latch; /* interrupt latches state */ + uint8_t irq_level; /* We store the level of the request with the highest level here */ + uint8_t int_state; /* interrupt lines state */ + uint8_t int_latch; /* interrupt latches state */ #endif /* interrupt callback */ @@ -465,60 +465,60 @@ struct tms99xx_state address_space *io; int icount; - UINT8 IDLE; /* nonzero if processor is IDLE - i.e waiting for interrupt while writing + uint8_t IDLE; /* nonzero if processor is IDLE - i.e waiting for interrupt while writing special data on CRU bus */ #if HAS_MAPPING - UINT8 mapping_on; /* set by a CRU write */ + uint8_t mapping_on; /* set by a CRU write */ map_file_t map_files[3]; /* internal mapper registers */ - UINT8 cur_map; /* equivalent to ST_MF status bit */ - UINT8 cur_src_map; /* set to 2 by LDS */ - UINT8 cur_dst_map; /* set to 2 by LDD */ + uint8_t cur_map; /* equivalent to ST_MF status bit */ + uint8_t cur_src_map; /* set to 2 by LDS */ + uint8_t cur_dst_map; /* set to 2 by LDD */ #if (TMS99XX_MODEL == TI990_10_ID) - UINT8 reset_maperr; /* reset mapper error flag line (reset flags in 945417-9701 p. 3-90) */ + uint8_t reset_maperr; /* reset mapper error flag line (reset flags in 945417-9701 p. 3-90) */ - UINT32 mapper_address_latch; /* used to load the map file and for diagnostic purpose */ - UINT16 mapper_cru_read_register; /* read register select code for mapper cru interface */ - UINT8 diaglat; /* set when diagnostic address latch is done */ - UINT8 latch_control[3]; /* latch control */ + uint32_t mapper_address_latch; /* used to load the map file and for diagnostic purpose */ + uint16_t mapper_cru_read_register; /* read register select code for mapper cru interface */ + uint8_t diaglat; /* set when diagnostic address latch is done */ + uint8_t latch_control[3]; /* latch control */ #endif #endif #if (TMS99XX_MODEL == TI990_10_ID) - UINT16 error_interrupt_register; /* one flag for each interrupt condition */ + uint16_t error_interrupt_register; /* one flag for each interrupt condition */ ti99xx_error_interrupt_func error_interrupt_callback; #endif #if (TMS99XX_MODEL == TMS9985_ID) || (TMS99XX_MODEL == TMS9995_ID) - UINT8 RAM[256]; /* on-chip RAM (I know this is weird, but the internal bus is 16-bit-wide, whereas the external bus is 8-bit-wide) */ + uint8_t RAM[256]; /* on-chip RAM (I know this is weird, but the internal bus is 16-bit-wide, whereas the external bus is 8-bit-wide) */ #endif #if (TMS99XX_MODEL == TMS9940_ID) || (TMS99XX_MODEL == TMS9985_ID) || (TMS99XX_MODEL == TMS9995_ID) /* on-chip event counter/timer*/ - UINT8 decrementer_enabled; - UINT16 decrementer_interval; - UINT16 decrementer_count; /* used in event counter mode*/ + uint8_t decrementer_enabled; + uint16_t decrementer_interval; + uint16_t decrementer_count; /* used in event counter mode*/ emu_timer *timer; /* used in timer mode */ #endif #if (TMS99XX_MODEL == TMS9995_ID) /* additionnal registers */ - UINT16 flag; /* flag register */ - UINT8 MID_flag; /* MID flag register */ + uint16_t flag; /* flag register */ + uint8_t MID_flag; /* MID flag register */ /* chip config, which can be set on reset */ - UINT8 memory_wait_states_byte; - UINT8 memory_wait_states_word; + uint8_t memory_wait_states_byte; + uint8_t memory_wait_states_word; /* mask option (off on normal tms9995) */ - UINT8 is_mp9537; + uint8_t is_mp9537; #endif /* Some instructions (i.e. XOP, BLWP, and MID) disable interrupt recognition until another instruction is executed : so they set this flag */ - UINT8 disable_interrupt_recognition; + uint8_t disable_interrupt_recognition; /* notify the driver of changes in IDLE state */ ti99xx_idle_func idle_callback; @@ -943,7 +943,7 @@ WRITE8_HANDLER(tms9995_internal2_w) } else if (addr < 0xf0fc) { - return *(UINT16 *)(& cpustate->RAM[addr - 0xf000]); + return *(uint16_t *)(& cpustate->RAM[addr - 0xf000]); } else if (addr < 0xfffa) { @@ -964,7 +964,7 @@ WRITE8_HANDLER(tms9995_internal2_w) } else { - return *(UINT16 *)(& cpustate->RAM[addr - 0xff00]); + return *(uint16_t *)(& cpustate->RAM[addr - 0xff00]); } } @@ -978,7 +978,7 @@ WRITE8_HANDLER(tms9995_internal2_w) } else if (addr < 0xf0fc) { - *(UINT16 *)(& cpustate->RAM[addr - 0xf000]) = data; + *(uint16_t *)(& cpustate->RAM[addr - 0xf000]) = data; } else if (addr < 0xfffa) { @@ -994,7 +994,7 @@ WRITE8_HANDLER(tms9995_internal2_w) } else { - *(UINT16 *)(& cpustate->RAM[addr - 0xff00]) = data; + *(uint16_t *)(& cpustate->RAM[addr - 0xff00]) = data; } } @@ -1082,15 +1082,15 @@ WRITE8_HANDLER(tms9995_internal2_w) #define READREG(reg) readword(cpustate, (cpustate->WP+(reg)) & 0xffff) #define WRITEREG(reg, data) writeword(cpustate, (cpustate->WP+(reg)) & 0xffff, (data)) -static inline UINT16 READREG_DEBUG(tms99xx_state *cpustate, int reg) +static inline uint16_t READREG_DEBUG(tms99xx_state *cpustate, int reg) { int temp = cpustate->icount; - UINT16 result = READREG(reg); + uint16_t result = READREG(reg); cpustate->icount = temp; return result; } -static inline void WRITEREG_DEBUG(tms99xx_state *cpustate, int reg, UINT16 data) +static inline void WRITEREG_DEBUG(tms99xx_state *cpustate, int reg, uint16_t data) { int temp = cpustate->icount; WRITEREG(reg, data); @@ -1242,7 +1242,7 @@ static void set_flag1(tms99xx_state *cpustate, int val); static void setstat(tms99xx_state *cpustate) { int i; - UINT8 a; + uint8_t a; cpustate->STATUS &= ~ ST_OP; @@ -1297,7 +1297,7 @@ static void getstat(tms99xx_state *cpustate) */ -static const UINT16 right_shift_mask_table[17] = +static const uint16_t right_shift_mask_table[17] = { 0xFFFF, 0x7FFF, @@ -1318,7 +1318,7 @@ static const UINT16 right_shift_mask_table[17] = 0x0000 }; -static const UINT16 inverted_right_shift_mask_table[17] = +static const uint16_t inverted_right_shift_mask_table[17] = { 0x0000, 0x8000, @@ -1339,12 +1339,12 @@ static const UINT16 inverted_right_shift_mask_table[17] = 0xFFFF }; -static inline UINT16 logical_right_shift(UINT16 val, int c) +static inline uint16_t logical_right_shift(uint16_t val, int c) { return((val>>c) & right_shift_mask_table[c]); } -static inline INT16 arithmetic_right_shift(INT16 val, int c) +static inline int16_t arithmetic_right_shift(int16_t val, int c) { if (val < 0) return((val>>c) | inverted_right_shift_mask_table[c]); @@ -1359,7 +1359,7 @@ static inline INT16 arithmetic_right_shift(INT16 val, int c) /* Set lae */ -static inline void setst_lae(tms99xx_state *cpustate, INT16 val) +static inline void setst_lae(tms99xx_state *cpustate, int16_t val) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ); @@ -1375,7 +1375,7 @@ static inline void setst_lae(tms99xx_state *cpustate, INT16 val) /* Set laep (BYTE) */ -static inline void setst_byte_laep(tms99xx_state *cpustate, INT8 val) +static inline void setst_byte_laep(tms99xx_state *cpustate, int8_t val) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ); @@ -1392,7 +1392,7 @@ static inline void setst_byte_laep(tms99xx_state *cpustate, INT8 val) /* For COC, CZC, and TB */ -static inline void setst_e(tms99xx_state *cpustate, UINT16 val, UINT16 to) +static inline void setst_e(tms99xx_state *cpustate, uint16_t val, uint16_t to) { if (val == to) cpustate->STATUS |= ST_EQ; @@ -1403,7 +1403,7 @@ static inline void setst_e(tms99xx_state *cpustate, UINT16 val, UINT16 to) /* For CI, C, CB */ -static inline void setst_c_lae(tms99xx_state *cpustate, UINT16 to, UINT16 val) +static inline void setst_c_lae(tms99xx_state *cpustate, uint16_t to, uint16_t val) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ); @@ -1411,9 +1411,9 @@ static inline void setst_c_lae(tms99xx_state *cpustate, UINT16 to, UINT16 val) cpustate->STATUS |= ST_EQ; else { - if ( ((INT16) val) > ((INT16) to) ) + if ( ((int16_t) val) > ((int16_t) to) ) cpustate->STATUS |= ST_AGT; - if ( ((UINT16) val) > ((UINT16) to) ) + if ( ((uint16_t) val) > ((uint16_t) to) ) cpustate->STATUS |= ST_LGT; } } @@ -1421,10 +1421,10 @@ static inline void setst_c_lae(tms99xx_state *cpustate, UINT16 to, UINT16 val) /* Set laeco for add */ -static inline INT16 setst_add_laeco(tms99xx_state *cpustate, int a, int b) +static inline int16_t setst_add_laeco(tms99xx_state *cpustate, int a, int b) { - UINT32 res; - INT16 res2; + uint32_t res; + int16_t res2; cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C | ST_OV); @@ -1441,7 +1441,7 @@ static inline INT16 setst_add_laeco(tms99xx_state *cpustate, int a, int b) cpustate->STATUS |= ST_DC; #endif - res2 = (INT16) res; + res2 = (int16_t) res; if (res2 > 0) cpustate->STATUS |= ST_LGT | ST_AGT; @@ -1457,10 +1457,10 @@ static inline INT16 setst_add_laeco(tms99xx_state *cpustate, int a, int b) /* Set laeco for subtract */ -static inline INT16 setst_sub_laeco(tms99xx_state *cpustate, int a, int b) +static inline int16_t setst_sub_laeco(tms99xx_state *cpustate, int a, int b) { - UINT32 res; - INT16 res2; + uint32_t res; + int16_t res2; cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C | ST_OV); @@ -1477,7 +1477,7 @@ static inline INT16 setst_sub_laeco(tms99xx_state *cpustate, int a, int b) cpustate->STATUS |= ST_DC; #endif - res2 = (INT16) res; + res2 = (int16_t) res; if (res2 > 0) cpustate->STATUS |= ST_LGT | ST_AGT; @@ -1493,10 +1493,10 @@ static inline INT16 setst_sub_laeco(tms99xx_state *cpustate, int a, int b) /* Set laecop for add (BYTE) */ -static inline INT8 setst_addbyte_laecop(tms99xx_state *cpustate, int a, int b) +static inline int8_t setst_addbyte_laecop(tms99xx_state *cpustate, int a, int b) { unsigned int res; - INT8 res2; + int8_t res2; cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C | ST_OV | ST_OP); @@ -1513,7 +1513,7 @@ static inline INT8 setst_addbyte_laecop(tms99xx_state *cpustate, int a, int b) cpustate->STATUS |= ST_DC; #endif - res2 = (INT8) res; + res2 = (int8_t) res; if (res2 > 0) cpustate->STATUS |= ST_LGT | ST_AGT; @@ -1531,10 +1531,10 @@ static inline INT8 setst_addbyte_laecop(tms99xx_state *cpustate, int a, int b) /* Set laecop for subtract (BYTE) */ -static inline INT8 setst_subbyte_laecop(tms99xx_state *cpustate, int a, int b) +static inline int8_t setst_subbyte_laecop(tms99xx_state *cpustate, int a, int b) { unsigned int res; - INT8 res2; + int8_t res2; cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C | ST_OV | ST_OP); @@ -1551,7 +1551,7 @@ static inline INT8 setst_subbyte_laecop(tms99xx_state *cpustate, int a, int b) cpustate->STATUS |= ST_DC; #endif - res2 = (INT8) res; + res2 = (int8_t) res; if (res2 > 0) cpustate->STATUS |= ST_LGT | ST_AGT; @@ -1570,7 +1570,7 @@ static inline INT8 setst_subbyte_laecop(tms99xx_state *cpustate, int a, int b) /* For NEG */ -static inline void setst_laeo(tms99xx_state *cpustate, INT16 val) +static inline void setst_laeo(tms99xx_state *cpustate, int16_t val) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_OV); @@ -1579,7 +1579,7 @@ static inline void setst_laeo(tms99xx_state *cpustate, INT16 val) else if (val < 0) { cpustate->STATUS |= ST_LGT; - if (((UINT16) val) == 0x8000) + if (((uint16_t) val) == 0x8000) cpustate->STATUS |= ST_OV; } else @@ -1591,7 +1591,7 @@ static inline void setst_laeo(tms99xx_state *cpustate, INT16 val) /* Meat of SRA */ -static inline UINT16 setst_sra_laec(tms99xx_state *cpustate, INT16 a, UINT16 c) +static inline uint16_t setst_sra_laec(tms99xx_state *cpustate, int16_t a, uint16_t c) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C); @@ -1617,7 +1617,7 @@ static inline UINT16 setst_sra_laec(tms99xx_state *cpustate, INT16 a, UINT16 c) /* Meat of SRL. Same algorithm as SRA, except that we fills in with 0s. */ -static inline UINT16 setst_srl_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) +static inline uint16_t setst_srl_laec(tms99xx_state *cpustate, uint16_t a,uint16_t c) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C); @@ -1629,9 +1629,9 @@ static inline UINT16 setst_srl_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) a = logical_right_shift(a, 1); } - if (((INT16) a) > 0) + if (((int16_t) a) > 0) cpustate->STATUS |= ST_LGT | ST_AGT; - else if (((INT16) a) < 0) + else if (((int16_t) a) < 0) cpustate->STATUS |= ST_LGT; else cpustate->STATUS |= ST_EQ; @@ -1643,7 +1643,7 @@ static inline UINT16 setst_srl_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) // // Meat of SRC // -static inline UINT16 setst_src_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) +static inline uint16_t setst_src_laec(tms99xx_state *cpustate, uint16_t a,uint16_t c) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C); @@ -1654,9 +1654,9 @@ static inline UINT16 setst_src_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) cpustate->STATUS |= ST_C; } - if (((INT16) a) > 0) + if (((int16_t) a) > 0) cpustate->STATUS |= ST_LGT | ST_AGT; - else if (((INT16) a) < 0) + else if (((int16_t) a) < 0) cpustate->STATUS |= ST_LGT; else cpustate->STATUS |= ST_EQ; @@ -1668,15 +1668,15 @@ static inline UINT16 setst_src_laec(tms99xx_state *cpustate, UINT16 a,UINT16 c) // // Meat of SLA // -static inline UINT16 setst_sla_laeco(tms99xx_state *cpustate, UINT16 a, UINT16 c) +static inline uint16_t setst_sla_laeco(tms99xx_state *cpustate, uint16_t a, uint16_t c) { cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ | ST_C | ST_OV); if (c != 0) { { - register UINT16 mask; - register UINT16 ousted_bits; + register uint16_t mask; + register uint16_t ousted_bits; mask = 0xFFFF << (16-c-1); ousted_bits = a & mask; @@ -1693,9 +1693,9 @@ static inline UINT16 setst_sla_laeco(tms99xx_state *cpustate, UINT16 a, UINT16 c a <<= 1; } - if (((INT16) a) > 0) + if (((int16_t) a) > 0) cpustate->STATUS |= ST_LGT | ST_AGT; - else if (((INT16) a) < 0) + else if (((int16_t) a) < 0) cpustate->STATUS |= ST_LGT; else cpustate->STATUS |= ST_EQ; @@ -1889,9 +1889,9 @@ static CPU_EXIT( tms99xx ) } /* fetch : read one word at * PC, and increment PC. */ -static inline UINT16 fetch(tms99xx_state *cpustate) +static inline uint16_t fetch(tms99xx_state *cpustate) { - UINT16 value = readword(cpustate, cpustate->PC); + uint16_t value = readword(cpustate, cpustate->PC); cpustate->PC += 2; return value; } @@ -2417,7 +2417,7 @@ static void field_interrupt(tms99xx_state *cpustate) static CPU_DISASSEMBLE( tms99xx ) { - extern unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const UINT8 *oprom, const UINT8 *opram); + extern unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const uint8_t *oprom, const uint8_t *opram); return Dasm9900(buffer, pc, TMS99XX_MODEL, oprom, opram); } @@ -2628,7 +2628,7 @@ static void write_single_CRU(tms99xx_state *cpustate, int port, int data) /* performs a normal write to CRU bus (used by SBZ, SBO, LDCR : address range 0 -> 0xFFF) */ -static cru_error_code writeCRU(tms99xx_state *cpustate, int CRUAddr, int Number, UINT16 Value) +static cru_error_code writeCRU(tms99xx_state *cpustate, int CRUAddr, int Number, uint16_t Value) { int count; @@ -2881,7 +2881,7 @@ static int readCRU(tms99xx_state *cpustate, int CRUAddr, int Number) #if HAS_MAPPING /* load a map file from memory */ -static void load_map_file(tms99xx_state *cpustate, UINT16 src_addr, int src_map_file, int dst_file) +static void load_map_file(tms99xx_state *cpustate, uint16_t src_addr, int src_map_file, int dst_file) { int i; @@ -2938,9 +2938,9 @@ static void load_map_file(tms99xx_state *cpustate, UINT16 src_addr, int src_map_ #endif /* contextswitch : performs a BLWP, i.e. load PC, WP, and save old PC, old WP and ST... */ -static void contextswitch(tms99xx_state *cpustate, UINT16 addr) +static void contextswitch(tms99xx_state *cpustate, uint16_t addr) { - UINT16 oldWP, oldpc; + uint16_t oldWP, oldpc; /* save old state */ oldWP = cpustate->WP; @@ -2963,9 +2963,9 @@ static void contextswitch(tms99xx_state *cpustate, UINT16 addr) we enter privileged mode and select map file 0 before doing the context switch */ /* For CPU that have no privilege support, contextswitchX would behave identically to contextswitch, so we can call contextswitch in all cases. */ -static void contextswitchX(tms99xx_state *cpustate, UINT16 addr) +static void contextswitchX(tms99xx_state *cpustate, uint16_t addr) { - UINT16 oldWP, oldpc, oldST; + uint16_t oldWP, oldpc, oldST; /* save old state */ oldWP = cpustate->WP; @@ -3000,10 +3000,10 @@ static void contextswitchX(tms99xx_state *cpustate, UINT16 addr) * NOTA : the LSBit is always ignored in word addresses, * but we do not set it to 0 because of XOP... */ -static UINT16 decipheraddr(tms99xx_state *cpustate, UINT16 opcode) +static uint16_t decipheraddr(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 ts = opcode & 0x30; - register UINT16 reg = opcode & 0xF; + register uint16_t ts = opcode & 0x30; + register uint16_t reg = opcode & 0xF; reg += reg; @@ -3017,7 +3017,7 @@ static UINT16 decipheraddr(tms99xx_state *cpustate, UINT16 opcode) } else if (ts == 0x20) { - register UINT16 imm; + register uint16_t imm; imm = fetch(cpustate); @@ -3034,7 +3034,7 @@ static UINT16 decipheraddr(tms99xx_state *cpustate, UINT16 opcode) } else /*if (ts == 0x30)*/ { /* *Rx+ */ - register UINT16 response; + register uint16_t response; reg += cpustate->WP; /* reg now contains effective address */ @@ -3047,10 +3047,10 @@ static UINT16 decipheraddr(tms99xx_state *cpustate, UINT16 opcode) } /* decipheraddrbyte : compute and return the effective address in byte instructions. */ -static UINT16 decipheraddrbyte(tms99xx_state *cpustate, UINT16 opcode) +static uint16_t decipheraddrbyte(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 ts = opcode & 0x30; - register UINT16 reg = opcode & 0xF; + register uint16_t ts = opcode & 0x30; + register uint16_t reg = opcode & 0xF; reg += reg; @@ -3064,7 +3064,7 @@ static UINT16 decipheraddrbyte(tms99xx_state *cpustate, UINT16 opcode) } else if (ts == 0x20) { - register UINT16 imm; + register uint16_t imm; imm = fetch(cpustate); @@ -3081,7 +3081,7 @@ static UINT16 decipheraddrbyte(tms99xx_state *cpustate, UINT16 opcode) } else /*if (ts == 0x30)*/ { /* *Rx+ */ - register UINT16 response; + register uint16_t response; reg += cpustate->WP; /* reg now contains effective address */ @@ -3143,7 +3143,7 @@ static UINT16 decipheraddrbyte(tms99xx_state *cpustate, UINT16 opcode) >0C00->0FFF (not for 990/12 and 99110) ============================================================================*/ -static void illegal(tms99xx_state *cpustate, UINT16 opcode) +static void illegal(tms99xx_state *cpustate, uint16_t opcode) { HANDLE_ILLEGAL; } @@ -3162,7 +3162,7 @@ static void illegal(tms99xx_state *cpustate, UINT16 opcode) --------------------------------- ============================================================================*/ -static void h0000(tms99xx_state *cpustate, UINT16 opcode) +static void h0000(tms99xx_state *cpustate, uint16_t opcode) { if (opcode >= 0x30) { /* STPC STore Program Counter */ @@ -3234,9 +3234,9 @@ static void h0000(tms99xx_state *cpustate, UINT16 opcode) tms9989 and later : LST, LWP ============================================================================*/ -static void h0040(tms99xx_state *cpustate, UINT16 opcode) +static void h0040(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 addr; + register uint16_t addr; addr = opcode & 0xF; addr = ((addr + addr) + cpustate->WP) & ~1; @@ -3310,9 +3310,9 @@ static void h0040(tms99xx_state *cpustate, UINT16 opcode) tms9989 and later : DIVS, MPYS tms99xxx : BIND ============================================================================*/ -static void h0100(tms99xx_state *cpustate, UINT16 opcode) +static void h0100(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 src; + register uint16_t src; #if HAS_MAPPING int src_map = (opcode & 0x0030) ? cpustate->cur_src_map : cpustate->cur_map; #endif @@ -3333,9 +3333,9 @@ static void h0100(tms99xx_state *cpustate, UINT16 opcode) /* DIVS -- DIVide Signed */ /* R0 = (R0:R1)/S R1 = (R0:R1)%S */ { - INT16 d = readwordX(cpustate, src, src_map); - INT32 divq = (READREG(R0) << 16) | READREG(R1); - INT32 q = divq/d; + int16_t d = readwordX(cpustate, src, src_map); + int32_t divq = (READREG(R0) << 16) | READREG(R1); + int32_t q = divq/d; if ((q < -32768L) || (q > 32767L)) { @@ -3358,8 +3358,8 @@ static void h0100(tms99xx_state *cpustate, UINT16 opcode) /* MPYS -- MultiPlY Signed */ /* Results: R0:R1 = R0*S */ { - INT32 prod = ((INT32) (INT16) readwordX(cpustate, src, src_map)); - prod = prod*((INT32) (INT16) READREG(R0)); + int32_t prod = ((int32_t) (int16_t) readwordX(cpustate, src, src_map)); + prod = prod*((int32_t) (int16_t) READREG(R0)); cpustate->STATUS &= ~ (ST_LGT | ST_AGT | ST_EQ); if (prod > 0) @@ -3402,10 +3402,10 @@ static void h0100(tms99xx_state *cpustate, UINT16 opcode) LI, AI, ANDI, ORI, CI, STWP, STST, LIMI, LWPI, IDLE, RSET, RTWP, CKON, CKOF, LREX systems with memory mapper: LMF ============================================================================*/ -static void h0200(tms99xx_state *cpustate, UINT16 opcode) +static void h0200(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 addr; - register UINT16 value; /* used for anything */ + register uint16_t addr; + register uint16_t value; /* used for anything */ addr = opcode & 0xF; addr = ((addr + addr) + cpustate->WP) & ~1; @@ -3754,10 +3754,10 @@ static void h0200(tms99xx_state *cpustate, UINT16 opcode) BLWP, B, X, CLR, NEG, INV, INC, INCT, DEC, DECT, BL, SWPB, SETO, ABS systems with memory mapper: LDD, LDS ============================================================================*/ -static void h0400(tms99xx_state *cpustate, UINT16 opcode) +static void h0400(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 addr = decipheraddr(cpustate, opcode) & ~1; - register UINT16 value; /* used for anything */ + register uint16_t addr = decipheraddr(cpustate, opcode) & ~1; + register uint16_t value; /* used for anything */ #if HAS_MAPPING int src_map = (opcode & 0x0030) ? cpustate->cur_src_map : cpustate->cur_map; #endif @@ -3801,7 +3801,7 @@ static void h0400(tms99xx_state *cpustate, UINT16 opcode) case 4: /* NEG */ /* NEG --- NEGate */ /* *S = -*S */ - value = - (INT16) readwordX(cpustate, addr, src_map); + value = - (int16_t) readwordX(cpustate, addr, src_map); if (value) cpustate->STATUS &= ~ ST_C; else @@ -3899,9 +3899,9 @@ static void h0400(tms99xx_state *cpustate, UINT16 opcode) CYCLES(5, 12, Mooof!); - if (((INT16) value) > 0) + if (((int16_t) value) > 0) cpustate->STATUS |= ST_LGT | ST_AGT; - else if (((INT16) value) < 0) + else if (((int16_t) value) < 0) { cpustate->STATUS |= ST_LGT; if (value == 0x8000) @@ -3912,7 +3912,7 @@ static void h0400(tms99xx_state *cpustate, UINT16 opcode) cpustate->STATUS |= ST_DC; #endif - writewordX(cpustate, addr, - ((INT16) value), src_map); + writewordX(cpustate, addr, - ((int16_t) value), src_map); CYCLES(0, 2, Mooof!); } else @@ -3927,14 +3927,14 @@ static void h0400(tms99xx_state *cpustate, UINT16 opcode) value = readwordX(cpustate, addr, src_map); CYCLES(Mooof!, Mooof!, 3); - if (((INT16) value) > 0) + if (((int16_t) value) > 0) cpustate->STATUS |= ST_LGT | ST_AGT; - else if (((INT16) value) < 0) + else if (((int16_t) value) < 0) { cpustate->STATUS |= ST_LGT; if (value == 0x8000) cpustate->STATUS |= ST_OV; - value = - ((INT16) value); + value = - ((int16_t) value); } else cpustate->STATUS |= ST_EQ; @@ -4005,11 +4005,11 @@ static void h0400(tms99xx_state *cpustate, UINT16 opcode) SRA, SRL, SLA, SRC ============================================================================*/ -static void h0800(tms99xx_state *cpustate, UINT16 opcode) +static void h0800(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 addr; - register UINT16 cnt = (opcode & 0xF0) >> 4; - register UINT16 value; + register uint16_t addr; + register uint16_t cnt = (opcode & 0xF0) >> 4; + register uint16_t value; addr = (opcode & 0xF); addr = ((addr+addr) + cpustate->WP) & ~1; @@ -4071,7 +4071,7 @@ static void h0800(tms99xx_state *cpustate, UINT16 opcode) --------------------------------- ============================================================================*/ -static void h0c00(tms99xx_state *cpustate, UINT16 opcode) +static void h0c00(tms99xx_state *cpustate, uint16_t opcode) { if (opcode & 0x30) { @@ -4164,9 +4164,9 @@ static void h0c00(tms99xx_state *cpustate, UINT16 opcode) --------------------------------- ============================================================================*/ -static void h0c40(tms99xx_state *cpustate, UINT16 opcode) +static void h0c40(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 src; + register uint16_t src; #if HAS_MAPPING int src_map = (opcode & 0x0030) ? cpustate->cur_src_map : cpustate->cur_map; @@ -4234,7 +4234,7 @@ static void h0c40(tms99xx_state *cpustate, UINT16 opcode) --------------------------------- ============================================================================*/ -static void h0e00(tms99xx_state *cpustate, UINT16 opcode) +static void h0e00(tms99xx_state *cpustate, uint16_t opcode) { switch ((opcode & 0x30) >> 4) { @@ -4267,10 +4267,10 @@ static void h0e00(tms99xx_state *cpustate, UINT16 opcode) JMP, JLT, JLE, JEQ, JHE, JGT, JNE, JNC, JOC, JNO, JL, JH, JOP SBO, SBZ, TB ============================================================================*/ -static void h1000(tms99xx_state *cpustate, UINT16 opcode) +static void h1000(tms99xx_state *cpustate, uint16_t opcode) { /* we convert 8 bit signed word offset to a 16 bit effective word offset. */ - register INT16 offset = ((INT8) opcode); + register int16_t offset = ((int8_t) opcode); switch ((opcode & 0xF00) >> 8) @@ -4408,7 +4408,7 @@ static void h1000(tms99xx_state *cpustate, UINT16 opcode) { /* Let's set ST_OP. */ int i; - UINT8 a; + uint8_t a; a = cpustate->lastparity; i = 0; @@ -4498,11 +4498,11 @@ tms9940 : DCA, DCS, LIIM ==========================================================================*/ /* xop, ldcr and stcr are handled elsewhere */ -static void h2000(tms99xx_state *cpustate, UINT16 opcode) +static void h2000(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 dest = (opcode & 0x3C0) >> 6; - register UINT16 src; - register UINT16 value; + register uint16_t dest = (opcode & 0x3C0) >> 6; + register uint16_t src; + register uint16_t value; #if HAS_MAPPING int src_map = (opcode & 0x0030) ? cpustate->cur_src_map : cpustate->cur_map; @@ -4556,8 +4556,8 @@ static void h2000(tms99xx_state *cpustate, UINT16 opcode) /* DIV --- DIVide (unsigned) */ /* D = D/S D+1 = D%S */ { - UINT16 d = readwordX(cpustate, src, src_map); - UINT16 hi = readword(cpustate, dest); + uint16_t d = readwordX(cpustate, src, src_map); + uint16_t hi = readword(cpustate, dest); unsigned long divq = (((unsigned long) hi) << 16) | readword(cpustate, (dest+2)&0xffff); if (d <= hi) @@ -4580,7 +4580,7 @@ static void h2000(tms99xx_state *cpustate, UINT16 opcode) } } -static void xop(tms99xx_state *cpustate, UINT16 opcode) +static void xop(tms99xx_state *cpustate, uint16_t opcode) { /* XOP */ /* XOP --- eXtended OPeration */ /* WP = *(40h+D), PC = *(42h+D) */ @@ -4588,8 +4588,8 @@ static void xop(tms99xx_state *cpustate, UINT16 opcode) /* New R11=S */ /* Xop bit set */ - register UINT16 immediate = (opcode & 0x3C0) >> 6; - register UINT16 operand; + register uint16_t immediate = (opcode & 0x3C0) >> 6; + register uint16_t operand; #if (TMS99XX_MODEL == TMS9940_ID) || (TMS99XX_MODEL == TMS9985_ID) @@ -4685,10 +4685,10 @@ static void xop(tms99xx_state *cpustate, UINT16 opcode) } /* LDCR and STCR */ -static void ldcr_stcr(tms99xx_state *cpustate, UINT16 opcode) +static void ldcr_stcr(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 cnt = (opcode & 0x3C0) >> 6; - register UINT16 addr; + register uint16_t cnt = (opcode & 0x3C0) >> 6; + register uint16_t addr; int value; #if HAS_MAPPING @@ -4829,11 +4829,11 @@ static void ldcr_stcr(tms99xx_state *cpustate, UINT16 opcode) ============================================================================*/ /* word instructions */ -static void h4000w(tms99xx_state *cpustate, UINT16 opcode) +static void h4000w(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 src; - register UINT16 dest; - register UINT16 value; + register uint16_t src; + register uint16_t dest; + register uint16_t value; #if HAS_MAPPING int src_map = (opcode & 0x0030) ? cpustate->cur_src_map : cpustate->cur_map; @@ -4898,11 +4898,11 @@ static void h4000w(tms99xx_state *cpustate, UINT16 opcode) } /* byte instruction */ -static void h4000b(tms99xx_state *cpustate, UINT16 opcode) +static void h4000b(tms99xx_state *cpustate, uint16_t opcode) { - register UINT16 src; - register UINT16 dest; - register UINT16 value; + register uint16_t src; + register uint16_t dest; + register uint16_t value; #if HAS_MAPPING int src_map = (opcode & 0x0030) ? cpustate->cur_src_map : cpustate->cur_map; @@ -4971,13 +4971,13 @@ static void h4000b(tms99xx_state *cpustate, UINT16 opcode) } -static inline void execute(tms99xx_state *cpustate, UINT16 opcode) +static inline void execute(tms99xx_state *cpustate, uint16_t opcode) { #if (! HAS_9995_OPCODES) /* tms9900-like instruction set*/ - static void (*const jumptable_short[128])(tms99xx_state *,UINT16) = + static void (*const jumptable_short[128])(tms99xx_state *,uint16_t) = { &illegal,&h0200,&h0400,&h0400,&h0800,&h0800,&illegal,&illegal, &h1000,&h1000,&h1000,&h1000,&h1000,&h1000,&h1000,&h1000, @@ -5004,7 +5004,7 @@ static inline void execute(tms99xx_state *cpustate, UINT16 opcode) /* tms9989 and tms9995 include 4 extra instructions, and one additionnal instruction type */ /* tms99000 includes yet another additional instruction */ - static void (*const jumptable_long[256])(tms99xx_state *,UINT16) = + static void (*const jumptable_long[256])(tms99xx_state *,uint16_t) = { &h0040,&h0100,&h0200,&h0200,&h0400,&h0400,&h0400,&h0400, &h0800,&h0800,&h0800,&h0800,&illegal,&illegal,&illegal,&illegal, @@ -5131,7 +5131,7 @@ static CPU_SET_INFO( tms99xx ) * Generic get_info **************************************************************************/ -void TMS99XX_GET_INFO(legacy_cpu_device *device, UINT32 state, cpuinfo *info) +void TMS99XX_GET_INFO(legacy_cpu_device *device, uint32_t state, cpuinfo *info) { tms99xx_state *cpustate = (device != nullptr && device->token() != nullptr) ? get_safe_token(device) : nullptr; switch (state) diff --git a/src/devices/cpu/tms9900/ti990_10.cpp b/src/devices/cpu/tms9900/ti990_10.cpp index 01c2c57a87d..6465ecf8475 100644 --- a/src/devices/cpu/tms9900/ti990_10.cpp +++ b/src/devices/cpu/tms9900/ti990_10.cpp @@ -41,7 +41,7 @@ twice their number. Accordingly, the TMS9900 has a CRU bitmask 0x0fff. ****************************************************************************/ -ti990_10_device::ti990_10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ti990_10_device::ti990_10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, TI990_10, "TI990/10 CPU", tag, owner, clock, "ti990_10_cpu", __FILE__), m_program_config("program", ENDIANNESS_BIG, 16, 21), m_io_config("cru", ENDIANNESS_BIG, 8, 12), @@ -112,35 +112,35 @@ void ti990_10_device::execute_set_input(int irqline, int state) // ========================================================================== -UINT32 ti990_10_device::execute_min_cycles() const +uint32_t ti990_10_device::execute_min_cycles() const { return 2; } // TODO: Compute this value, just a wild guess for the average -UINT32 ti990_10_device::execute_max_cycles() const +uint32_t ti990_10_device::execute_max_cycles() const { return 10; } -UINT32 ti990_10_device::execute_input_lines() const +uint32_t ti990_10_device::execute_input_lines() const { return 2; } // device_disasm_interface overrides -UINT32 ti990_10_device::disasm_min_opcode_bytes() const +uint32_t ti990_10_device::disasm_min_opcode_bytes() const { return 2; } -UINT32 ti990_10_device::disasm_max_opcode_bytes() const +uint32_t ti990_10_device::disasm_max_opcode_bytes() const { return 6; } // TODO: check 9900dasm -offs_t ti990_10_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t ti990_10_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms9900 ); return CPU_DISASSEMBLE_NAME(tms9900)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/tms9900/ti990_10.h b/src/devices/cpu/tms9900/ti990_10.h index 4fa8da2b43f..763e64ea00f 100644 --- a/src/devices/cpu/tms9900/ti990_10.h +++ b/src/devices/cpu/tms9900/ti990_10.h @@ -15,7 +15,7 @@ class ti990_10_device : public cpu_device { public: - ti990_10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ti990_10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~ti990_10_device(); protected: @@ -25,16 +25,16 @@ protected: void device_reset() override; // device_execute_interface overrides - UINT32 execute_min_cycles() const override; - UINT32 execute_max_cycles() const override; - UINT32 execute_input_lines() const override; + uint32_t execute_min_cycles() const override; + uint32_t execute_max_cycles() const override; + uint32_t execute_input_lines() const override; void execute_set_input(int irqline, int state) override; void execute_run() override; // device_disasm_interface overrides - UINT32 disasm_min_opcode_bytes() const override; - UINT32 disasm_max_opcode_bytes() const override; - offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + uint32_t disasm_min_opcode_bytes() const override; + uint32_t disasm_max_opcode_bytes() const override; + offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; const address_space_config* memory_space_config(address_spacenum spacenum) const override; @@ -47,12 +47,12 @@ protected: int m_icount; // Hardware registers - UINT16 WP; // Workspace pointer - UINT16 PC; // Program counter - UINT16 ST; // Status register + uint16_t WP; // Workspace pointer + uint16_t PC; // Program counter + uint16_t ST; // Status register private: - UINT16 m_state_any; + uint16_t m_state_any; }; // device type definition diff --git a/src/devices/cpu/tms9900/tms9900.cpp b/src/devices/cpu/tms9900/tms9900.cpp index 1962cc897f5..a189d2e0a94 100644 --- a/src/devices/cpu/tms9900/tms9900.cpp +++ b/src/devices/cpu/tms9900/tms9900.cpp @@ -170,7 +170,7 @@ enum twice their number. Accordingly, the TMS9900 has a CRU bitmask 0x0fff. ****************************************************************************/ -tms99xx_device::tms99xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, int databus_width, int prg_addr_bits, int cru_addr_bits, device_t *owner, UINT32 clock, const char *shortname, const char *source) +tms99xx_device::tms99xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, int databus_width, int prg_addr_bits, int cru_addr_bits, device_t *owner, uint32_t clock, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_BIG, databus_width, prg_addr_bits), m_io_config("cru", ENDIANNESS_BIG, 8, cru_addr_bits), @@ -198,7 +198,7 @@ tms99xx_device::~tms99xx_device() Constructor for TMS9900 ****************************************************************************/ -tms9900_device::tms9900_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9900_device::tms9900_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms99xx_device(mconfig, TMS9900, "TMS9900", tag, 16, 16, 12, owner, clock, "tms9900", __FILE__) { } @@ -340,21 +340,21 @@ void tms99xx_device::state_import(const device_state_entry &entry) // bits of the STATUS register break; case TMS9900_PC: - PC = (UINT16)(m_state_any & m_prgaddr_mask & 0xfffe); + PC = (uint16_t)(m_state_any & m_prgaddr_mask & 0xfffe); break; case TMS9900_WP: - WP = (UINT16)(m_state_any & m_prgaddr_mask & 0xfffe); + WP = (uint16_t)(m_state_any & m_prgaddr_mask & 0xfffe); break; case TMS9900_STATUS: - ST = (UINT16)m_state_any; + ST = (uint16_t)m_state_any; break; case TMS9900_IR: - IR = (UINT16)m_state_any; + IR = (uint16_t)m_state_any; break; default: // Workspace registers if (index <= TMS9900_R15) - write_workspace_register_debug(index-TMS9900_R0, (UINT16)m_state_any); + write_workspace_register_debug(index-TMS9900_R0, (uint16_t)m_state_any); break; } } @@ -398,7 +398,7 @@ void tms99xx_device::state_string_export(const device_state_entry &entry, std::s static const char *statestr = "LAECOPX-----IIII"; char flags[17]; for (auto &flag : flags) flag = 0x00; - UINT16 val = 0x8000; + uint16_t val = 0x8000; if (entry.index()==STATE_GENFLAGS) { for (int i=0; i < 16; i++) @@ -412,17 +412,17 @@ void tms99xx_device::state_string_export(const device_state_entry &entry, std::s /**************************************************************************/ -UINT16 tms99xx_device::read_workspace_register_debug(int reg) +uint16_t tms99xx_device::read_workspace_register_debug(int reg) { int temp = m_icount; m_prgspace->set_debugger_access(true); - UINT16 value = m_prgspace->read_word((WP+(reg<<1)) & m_prgaddr_mask & 0xfffe); + uint16_t value = m_prgspace->read_word((WP+(reg<<1)) & m_prgaddr_mask & 0xfffe); m_prgspace->set_debugger_access(false); m_icount = temp; return value; } -void tms99xx_device::write_workspace_register_debug(int reg, UINT16 data) +void tms99xx_device::write_workspace_register_debug(int reg, uint16_t data) { int temp = m_icount; m_prgspace->set_debugger_access(true); @@ -457,7 +457,7 @@ const address_space_config *tms99xx_device::memory_space_config(address_spacenum /* Define the indices for the micro-operation table. This is done for the sake - of a simpler microprogram definition as an UINT8[]. + of a simpler microprogram definition as an uint8_t[]. */ enum { @@ -513,7 +513,7 @@ enum #define MICROPROGRAM(_MP) \ - static const UINT8 _MP[] = + static const uint8_t _MP[] = /* This is a kind of subroutine with 6 variants. Might be done in countless @@ -1087,7 +1087,7 @@ void tms99xx_device::build_command_lookup_table() int cmdindex; int bitcount; const tms_instruction *inst; - UINT16 opcode; + uint16_t opcode; m_command_lookup_table = std::make_unique(16); @@ -1225,10 +1225,10 @@ void tms99xx_device::execute_run() } else { - const UINT8* program = nullptr; + const uint8_t* program = nullptr; // When we are in the data derivation sequence, the caller_index is set if (m_program_index != NOPRG) - program = (m_caller_index == NOPRG)? (UINT8*)s_command[m_program_index].prog : data_derivation; + program = (m_caller_index == NOPRG)? (uint8_t*)s_command[m_program_index].prog : data_derivation; // Handle HOLD // A HOLD request is signalled through the input line HOLD. @@ -1260,7 +1260,7 @@ void tms99xx_device::execute_run() set_wait_state(false); m_check_ready = false; // If we don't have a microprogram, acquire the next instruction - UINT8 op = (m_program_index==NOPRG)? IAQ : program[MPC]; + uint8_t op = (m_program_index==NOPRG)? IAQ : program[MPC]; if (TRACE_MICRO) logerror("MPC = %d, op = %d\n", MPC, op); // Call the operation of the microprogram @@ -1441,11 +1441,11 @@ inline void tms99xx_device::set_wait_state(bool state) Acquire the next word as an instruction. The program counter advances by one word. */ -void tms99xx_device::decode(UINT16 inst) +void tms99xx_device::decode(uint16_t inst) { int ix = 0; lookup_entry* table = m_command_lookup_table.get(); - UINT16 opcode = inst; + uint16_t opcode = inst; bool complete = false; m_state = 0; @@ -1592,7 +1592,7 @@ void tms99xx_device::register_read() void tms99xx_device::register_write() { // This will be called twice; m_pass is set by the embedded mem_write - UINT16 addr_save = m_address; + uint16_t addr_save = m_address; m_address = (WP + (m_regnumber<<1)) & m_prgaddr_mask & 0xfffe; mem_write(); m_address = addr_save; @@ -1711,7 +1711,7 @@ void tms99xx_device::command_completed() */ void tms99xx_device::data_derivation_subprogram() { - UINT16 ircopy = IR; + uint16_t ircopy = IR; // Save the return program and position m_caller_index = m_program_index; @@ -1744,7 +1744,7 @@ inline void tms99xx_device::set_status_bit(int bit, bool state) else ST &= ~bit; } -void tms99xx_device::set_status_parity(UINT8 value) +void tms99xx_device::set_status_parity(uint8_t value) { int count = 0; for (int i=0; i < 8; i++) @@ -1755,11 +1755,11 @@ void tms99xx_device::set_status_parity(UINT8 value) set_status_bit(ST_OP, (count & 1)!=0); } -inline void tms99xx_device::compare_and_set_lae(UINT16 value1, UINT16 value2) +inline void tms99xx_device::compare_and_set_lae(uint16_t value1, uint16_t value2) { set_status_bit(ST_EQ, value1 == value2); set_status_bit(ST_LH, value1 > value2); - set_status_bit(ST_AGT, (INT16)value1 > (INT16)value2); + set_status_bit(ST_AGT, (int16_t)value1 > (int16_t)value2); if (TRACE_STATUS) logerror("ST = %04x (val1=%04x, val2=%04x)\n", ST, value1, value2); } @@ -1843,10 +1843,10 @@ void tms99xx_device::alu_reg() void tms99xx_device::alu_f1() { - UINT32 dest_new = 0; + uint32_t dest_new = 0; // Save the destination value - UINT16 prev_dest_value = m_current_value; + uint16_t prev_dest_value = m_current_value; m_destination_even = ((m_address & 1)==0); // this is the destination address; the source address has already been saved bool byteop = byte_operation(); @@ -1934,7 +1934,7 @@ void tms99xx_device::alu_f1() if (byteop) { - set_status_parity((UINT8)(dest_new>>8)); + set_status_parity((uint8_t)(dest_new>>8)); // destnew is the new value to be written (high byte); needs to be // merged with the existing word @@ -1942,12 +1942,12 @@ void tms99xx_device::alu_f1() m_current_value = (prev_dest_value & 0x00ff) | (dest_new & 0xff00); else m_current_value = (prev_dest_value & 0xff00) | ((dest_new >> 8) & 0x00ff); - compare_and_set_lae((UINT16)(dest_new & 0xff00), 0); + compare_and_set_lae((uint16_t)(dest_new & 0xff00), 0); } else { - m_current_value = (UINT16)(dest_new & 0xffff); - compare_and_set_lae((UINT16)(dest_new & 0xffff), 0); + m_current_value = (uint16_t)(dest_new & 0xffff); + compare_and_set_lae((uint16_t)(dest_new & 0xffff), 0); } pulse_clock(2); @@ -1960,7 +1960,7 @@ void tms99xx_device::alu_comp() { if (!m_destination_even) m_current_value <<= 8; if (!m_source_even) m_source_value <<= 8; - set_status_parity((UINT8)(m_source_value>>8)); + set_status_parity((uint8_t)(m_source_value>>8)); compare_and_set_lae(m_source_value & 0xff00, m_current_value & 0xff00); } else @@ -2007,7 +2007,7 @@ void tms99xx_device::alu_f3() void tms99xx_device::alu_multiply() { - UINT32 result; + uint32_t result; switch (m_state) { @@ -2034,9 +2034,9 @@ void tms99xx_device::alu_multiply() void tms99xx_device::alu_divide() { // Format is DIV Divisor,REG(dividend) - UINT32 uval32; + uint32_t uval32; bool overflow = true; - UINT16 value1; + uint16_t value1; switch (m_state) { @@ -2148,9 +2148,9 @@ void tms99xx_device::alu_xop() void tms99xx_device::alu_clr_swpb() { - UINT32 dest_new = 0; - UINT32 src_val = m_current_value & 0x0000ffff; - UINT16 sign = 0; + uint32_t dest_new = 0; + uint32_t src_val = m_current_value & 0x0000ffff; + uint16_t sign = 0; bool setstatus = true; bool check_ov = true; @@ -2302,7 +2302,7 @@ void tms99xx_device::alu_blwp() void tms99xx_device::alu_ldcr() { - UINT16 value; + uint16_t value; // Spec: "If the source operand address is odd, the address is truncated // to an even address prior to data transfer." @@ -2326,7 +2326,7 @@ void tms99xx_device::alu_ldcr() if (m_count <= 8) { if (m_source_even) value>>=8; - set_status_parity((UINT8)(value & 0xff)); + set_status_parity((uint8_t)(value & 0xff)); compare_and_set_lae(value<<8, 0); } else @@ -2343,7 +2343,7 @@ void tms99xx_device::alu_ldcr() void tms99xx_device::alu_stcr() { - UINT16 value; + uint16_t value; int n = 2; // For STCR transfers with more than 8 bits, the first CRU bit is // always put into the least significant bit of the destination word. @@ -2368,7 +2368,7 @@ void tms99xx_device::alu_stcr() if (m_count < 9) { if (TRACE_CRU) logerror("Store CRU at %04x (%d bits) in %04x, result = %02x\n", m_cru_address, m_count, m_source_address, value); - set_status_parity((UINT8)(value & 0xff)); + set_status_parity((uint8_t)(value & 0xff)); compare_and_set_lae(value<<8, 0); if (m_source_even) m_current_value = (m_source_value & 0x00ff) | (value<<8); @@ -2394,7 +2394,7 @@ void tms99xx_device::alu_stcr() void tms99xx_device::alu_sbz_sbo() { - INT8 displacement; + int8_t displacement; if (m_state==0) { m_address = WP + 24; @@ -2402,7 +2402,7 @@ void tms99xx_device::alu_sbz_sbo() else { m_value = (m_command==SBO)? 1 : 0; - displacement = (INT8)(IR & 0xff); + displacement = (int8_t)(IR & 0xff); m_cru_address = m_current_value + (displacement<<1); m_count = 1; } @@ -2412,14 +2412,14 @@ void tms99xx_device::alu_sbz_sbo() void tms99xx_device::alu_tb() { - INT8 displacement; + int8_t displacement; switch (m_state) { case 0: m_address = WP + 24; break; case 1: - displacement = (INT8)(IR & 0xff); + displacement = (int8_t)(IR & 0xff); m_cru_address = m_current_value + (displacement<<1); m_count = 1; break; @@ -2434,7 +2434,7 @@ void tms99xx_device::alu_tb() void tms99xx_device::alu_jmp() { - INT8 displacement; + int8_t displacement; bool cond = false; if (m_state==0) @@ -2502,8 +2502,8 @@ void tms99xx_device::alu_shift() { bool carry = false; bool overflow = false; - UINT16 sign = 0; - UINT32 value; + uint16_t sign = 0; + uint32_t value; int count; switch (m_state) @@ -2585,7 +2585,7 @@ void tms99xx_device::alu_shift() void tms99xx_device::alu_ai_ori() { - UINT32 dest_new = 0; + uint32_t dest_new = 0; switch (m_command) { case AI: @@ -2734,18 +2734,18 @@ void tms99xx_device::alu_int() } /**************************************************************************/ -UINT32 tms99xx_device::execute_min_cycles() const +uint32_t tms99xx_device::execute_min_cycles() const { return 2; } // TODO: Compute this value, just a wild guess for the average -UINT32 tms99xx_device::execute_max_cycles() const +uint32_t tms99xx_device::execute_max_cycles() const { return 10; } -UINT32 tms99xx_device::execute_input_lines() const +uint32_t tms99xx_device::execute_input_lines() const { return 2; } @@ -2755,17 +2755,17 @@ UINT32 tms99xx_device::execute_input_lines() const // execute_burn = nop // device_disasm_interface overrides -UINT32 tms99xx_device::disasm_min_opcode_bytes() const +uint32_t tms99xx_device::disasm_min_opcode_bytes() const { return 2; } -UINT32 tms99xx_device::disasm_max_opcode_bytes() const +uint32_t tms99xx_device::disasm_max_opcode_bytes() const { return 6; } -offs_t tms99xx_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms99xx_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms9900 ); return CPU_DISASSEMBLE_NAME(tms9900)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/tms9900/tms9900.h b/src/devices/cpu/tms9900/tms9900.h index 1104a29e4d4..1d4c54b6e17 100644 --- a/src/devices/cpu/tms9900/tms9900.h +++ b/src/devices/cpu/tms9900/tms9900.h @@ -44,7 +44,7 @@ class tms99xx_device : public cpu_device public: tms99xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, int databus_width, int prg_addr_bits, int cru_addr_bits, - device_t *owner, UINT32 clock, const char *shortname, const char *source); + device_t *owner, uint32_t clock, const char *shortname, const char *source); ~tms99xx_device(); @@ -74,16 +74,16 @@ protected: virtual void resolve_lines(); // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_set_input(int irqline, int state) override; virtual void execute_run() override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; const address_space_config* memory_space_config(address_spacenum spacenum) const override; @@ -91,35 +91,35 @@ protected: virtual void mem_read(void); virtual void mem_write(void); virtual void acquire_instruction(void); - void decode(UINT16 inst); + void decode(uint16_t inst); const address_space_config m_program_config; const address_space_config m_io_config; address_space* m_prgspace; address_space* m_cru; - virtual UINT16 read_workspace_register_debug(int reg); - virtual void write_workspace_register_debug(int reg, UINT16 data); + virtual uint16_t read_workspace_register_debug(int reg); + virtual void write_workspace_register_debug(int reg, uint16_t data); // Cycle counter int m_icount; // TMS9900 hardware registers - UINT16 WP; // Workspace pointer - UINT16 PC; // Program counter - UINT16 ST; // Status register + uint16_t WP; // Workspace pointer + uint16_t PC; // Program counter + uint16_t ST; // Status register // Internal register - UINT16 IR; // Instruction register + uint16_t IR; // Instruction register // Stored address - UINT16 m_address; + uint16_t m_address; // Stores the recently read word or the word to be written - UINT16 m_current_value; + uint16_t m_current_value; // Decoded command - UINT16 m_command; + uint16_t m_command; // Is it a byte operation? Only format 1 commands with the byte flag set // and CRU commands with less than 9 bits to transfer are byte operations. @@ -140,8 +140,8 @@ protected: int m_mem_phase; // Max address - const UINT16 m_prgaddr_mask; - const UINT16 m_cruaddr_mask; + const uint16_t m_prgaddr_mask; + const uint16_t m_cruaddr_mask; bool m_load_state; bool m_irq_state; @@ -219,7 +219,7 @@ private: bool m_hold_state; // State / debug management - UINT16 m_state_any; + uint16_t m_state_any; static const char* s_statename[]; virtual void state_import(const device_state_entry &entry) override; virtual void state_export(const device_state_entry &entry) override; @@ -234,7 +234,7 @@ private: void build_command_lookup_table(); // Sequence of micro-operations - typedef const UINT8* microprogram; + typedef const uint8_t* microprogram; // Method pointer typedef void (tms99xx_device::*ophandler)(void); @@ -242,7 +242,7 @@ private: // Opcode list entry struct tms_instruction { - UINT16 opcode; + uint16_t opcode; int id; int format; microprogram prog; // Microprogram @@ -347,39 +347,39 @@ private: bool m_destination_even; // Intermediate storage for the source operand - UINT16 m_source_address; - UINT16 m_source_value; - UINT16 m_address_saved; + uint16_t m_source_address; + uint16_t m_source_value; + uint16_t m_address_saved; // Another copy of the address - UINT16 m_address_copy; + uint16_t m_address_copy; // Stores the recently read register contents - UINT16 m_register_contents; + uint16_t m_register_contents; // Stores the register number for the next register access int m_regnumber; // CRU support: Stores the CRU address - UINT16 m_cru_address; + uint16_t m_cru_address; // CRU support: Stores the number of bits to be transferred int m_count; // Copy of the value - UINT16 m_value_copy; + uint16_t m_value_copy; // Another internal register, storing intermediate values // Using 32 bits to support MPY - UINT32 m_value; + uint32_t m_value; // For two-argument commands. Indicates whether this is the second operand. bool m_get_destination; // Status register update inline void set_status_bit(int bit, bool state); - inline void compare_and_set_lae(UINT16 value1, UINT16 value2); - void set_status_parity(UINT8 value); + inline void compare_and_set_lae(uint16_t value1, uint16_t value2); + void set_status_parity(uint8_t value); }; /*****************************************************************************/ @@ -387,7 +387,7 @@ private: class tms9900_device : public tms99xx_device { public: - tms9900_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9900_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/tms9900/tms9980a.cpp b/src/devices/cpu/tms9900/tms9980a.cpp index 054a293a403..5cb028e543a 100644 --- a/src/devices/cpu/tms9900/tms9980a.cpp +++ b/src/devices/cpu/tms9900/tms9980a.cpp @@ -74,7 +74,7 @@ Constructor ****************************************************************************/ -tms9980a_device::tms9980a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9980a_device::tms9980a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms99xx_device(mconfig, TMS9980A, "TMS9980A", tag, 8, 14, 11, owner, clock, "tms9980a", __FILE__) { } @@ -92,16 +92,16 @@ void tms9980a_device::resolve_lines() m_dbin_line.resolve(); } -UINT16 tms9980a_device::read_workspace_register_debug(int reg) +uint16_t tms9980a_device::read_workspace_register_debug(int reg) { int temp = m_icount; int addr = (WP+(reg<<1)) & 0xfffe & m_prgaddr_mask; - UINT16 value = (m_prgspace->read_byte(addr) << 8) | (m_prgspace->read_byte(addr+1) & 0xff); + uint16_t value = (m_prgspace->read_byte(addr) << 8) | (m_prgspace->read_byte(addr+1) & 0xff); m_icount = temp; return value; } -void tms9980a_device::write_workspace_register_debug(int reg, UINT16 data) +void tms9980a_device::write_workspace_register_debug(int reg, uint16_t data) { int temp = m_icount; int addr = (WP+(reg<<1)) & 0xfffe & m_prgaddr_mask; @@ -175,7 +175,7 @@ void tms9980a_device::execute_set_input(int irqline, int state) */ void tms9980a_device::mem_read() { - UINT8 value; + uint8_t value; switch (m_mem_phase) { case 1: @@ -260,18 +260,18 @@ void tms9980a_device::acquire_instruction() /**************************************************************************/ -UINT32 tms9980a_device::execute_min_cycles() const +uint32_t tms9980a_device::execute_min_cycles() const { return 2; } // TODO: Compute this value, just a wild guess for the average -UINT32 tms9980a_device::execute_max_cycles() const +uint32_t tms9980a_device::execute_max_cycles() const { return 10; } -UINT32 tms9980a_device::execute_input_lines() const +uint32_t tms9980a_device::execute_input_lines() const { return 8; } @@ -281,17 +281,17 @@ UINT32 tms9980a_device::execute_input_lines() const // execute_burn = nop // device_disasm_interface overrides -UINT32 tms9980a_device::disasm_min_opcode_bytes() const +uint32_t tms9980a_device::disasm_min_opcode_bytes() const { return 2; } -UINT32 tms9980a_device::disasm_max_opcode_bytes() const +uint32_t tms9980a_device::disasm_max_opcode_bytes() const { return 6; } -offs_t tms9980a_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms9980a_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms9980 ); return CPU_DISASSEMBLE_NAME(tms9980)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/tms9900/tms9980a.h b/src/devices/cpu/tms9900/tms9980a.h index d32c79dc9ca..3f295b73749 100644 --- a/src/devices/cpu/tms9900/tms9980a.h +++ b/src/devices/cpu/tms9900/tms9980a.h @@ -26,7 +26,7 @@ enum class tms9980a_device : public tms99xx_device { public: - tms9980a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9980a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: void mem_read(void) override; @@ -35,17 +35,17 @@ protected: void resolve_lines() override; - UINT16 read_workspace_register_debug(int reg) override; - void write_workspace_register_debug(int reg, UINT16 data) override; + uint16_t read_workspace_register_debug(int reg) override; + void write_workspace_register_debug(int reg, uint16_t data) override; - UINT32 execute_min_cycles() const override; - UINT32 execute_max_cycles() const override; - UINT32 execute_input_lines() const override; + uint32_t execute_min_cycles() const override; + uint32_t execute_max_cycles() const override; + uint32_t execute_input_lines() const override; void execute_set_input(int irqline, int state) override; - UINT32 disasm_min_opcode_bytes() const override; - UINT32 disasm_max_opcode_bytes() const override; - offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + uint32_t disasm_min_opcode_bytes() const override; + uint32_t disasm_max_opcode_bytes() const override; + offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config80; address_space_config m_io_config80; }; diff --git a/src/devices/cpu/tms9900/tms9995.cpp b/src/devices/cpu/tms9900/tms9995.cpp index d8ffcda2337..b161ec05ce3 100644 --- a/src/devices/cpu/tms9900/tms9995.cpp +++ b/src/devices/cpu/tms9900/tms9995.cpp @@ -177,7 +177,7 @@ enum Constructor ****************************************************************************/ -tms9995_device::tms9995_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9995_device::tms9995_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, TMS9995, "TMS9995", tag, owner, clock, "tms9995", __FILE__), m_state_any(0), PC(0), @@ -199,7 +199,7 @@ tms9995_device::tms9995_device(const machine_config &mconfig, const char *tag, d /* Called from subclass. */ -tms9995_device::tms9995_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) +tms9995_device::tms9995_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) : cpu_device(mconfig, TMS9995, name, tag, owner, clock, shortname, source), m_state_any(0), PC(0), @@ -385,21 +385,21 @@ void tms9995_device::state_import(const device_state_entry &entry) // bits of the STATUS register break; case TMS9995_PC: - PC = (UINT16)m_state_any & 0xfffe; + PC = (uint16_t)m_state_any & 0xfffe; break; case TMS9995_WP: - WP = (UINT16)m_state_any & 0xfffe; + WP = (uint16_t)m_state_any & 0xfffe; break; case TMS9995_STATUS: - ST = (UINT16)m_state_any; + ST = (uint16_t)m_state_any; break; case TMS9995_IR: - IR = (UINT16)m_state_any; + IR = (uint16_t)m_state_any; break; default: // Workspace registers if (index <= TMS9995_R15) - write_workspace_register_debug(index-TMS9995_R0, (UINT16)m_state_any); + write_workspace_register_debug(index-TMS9995_R0, (uint16_t)m_state_any); break; } } @@ -443,7 +443,7 @@ void tms9995_device::state_string_export(const device_state_entry &entry, std::s static const char *statestr = "LAECOPX-----IIII"; char flags[17]; memset(flags, 0x00, ARRAY_LENGTH(flags)); - UINT16 val = 0x8000; + uint16_t val = 0x8000; if (entry.index()==STATE_GENFLAGS) { for (int i=0; i < 16; i++) @@ -459,10 +459,10 @@ void tms9995_device::state_string_export(const device_state_entry &entry, std::s Provide access to the workspace registers via the debugger. We have to take care whether this is in onchip RAM or outside. */ -UINT16 tms9995_device::read_workspace_register_debug(int reg) +uint16_t tms9995_device::read_workspace_register_debug(int reg) { int temp = m_icount; - UINT16 value; + uint16_t value; int addrb = (WP + (reg << 1)) & 0xfffe; @@ -481,7 +481,7 @@ UINT16 tms9995_device::read_workspace_register_debug(int reg) return value; } -void tms9995_device::write_workspace_register_debug(int reg, UINT16 data) +void tms9995_device::write_workspace_register_debug(int reg, uint16_t data) { int temp = m_icount; int addrb = (WP + (reg << 1)) & 0xfffe; @@ -527,7 +527,7 @@ const address_space_config *tms9995_device::memory_space_config(address_spacenum /* Define the indices for the micro-operation table. This is done for the sake - of a simpler microprogram definition as an UINT8[]. + of a simpler microprogram definition as an uint8_t[]. */ enum { @@ -580,7 +580,7 @@ enum }; #define MICROPROGRAM(_MP) \ - static const UINT8 _MP[] = + static const uint8_t _MP[] = /* Cycles: @@ -1201,7 +1201,7 @@ void tms9995_device::build_command_lookup_table() int cmdindex; int bitcount; const tms_instruction *inst; - UINT16 opcode; + uint16_t opcode; m_command_lookup_table = std::make_unique(16); @@ -1305,7 +1305,7 @@ void tms9995_device::execute_run() m_check_ready = false; if (TRACE_MICRO) logerror("main loop, operation %s, MPC = %d\n", opname[m_command], MPC); - UINT8* program = (UINT8*)s_command[m_index].prog; + uint8_t* program = (uint8_t*)s_command[m_index].prog; (this->*s_microoperation[program[MPC]])(); // For multi-pass operations where the MPC should not advance @@ -1469,11 +1469,11 @@ void tms9995_device::set_hold_state(bool state) Decode the instruction. This is done in parallel to other operations so we just do it together with the prefetch. */ -void tms9995_device::decode(UINT16 inst) +void tms9995_device::decode(uint16_t inst) { int ix = 0; lookup_entry* table = m_command_lookup_table.get(); - UINT16 opcode = inst; + uint16_t opcode = inst; bool complete = false; m_mid_active = false; @@ -1860,8 +1860,8 @@ void tms9995_device::mem_read() { // This is an off-chip access m_check_ready = true; - UINT8 value; - UINT16 address = m_address; + uint8_t value; + uint16_t address = m_address; switch (m_mem_phase) { @@ -1994,7 +1994,7 @@ void tms9995_device::mem_write() { // This is an off-chip access m_check_ready = true; - UINT16 address = m_address; + uint16_t address = m_address; switch (m_mem_phase) { case 1: @@ -2174,8 +2174,8 @@ void tms9995_device::cru_output_operation() void tms9995_device::cru_input_operation() { - UINT16 crubit; - UINT8 crubyte; + uint16_t crubit; + uint8_t crubyte; // Reading is different, since MESS uses 8 bit transfers // We read 8 bits in one go, then iterate another min(n-1,7) times to allow @@ -2295,7 +2295,7 @@ void tms9995_device::trigger_decrementer() */ void tms9995_device::operand_address_subprogram() { - UINT16 ircopy = IR; + uint16_t ircopy = IR; if (m_get_destination) ircopy = ircopy >> 6; // Save the return program and position @@ -2380,7 +2380,7 @@ inline void tms9995_device::set_status_bit(int bit, bool state) m_int_overflow = (m_check_overflow && bit == ST_OV && ((ST & ST_OE)!=0) && state == true); } -void tms9995_device::set_status_parity(UINT8 value) +void tms9995_device::set_status_parity(uint8_t value) { int count = 0; for (int i=0; i < 8; i++) @@ -2391,11 +2391,11 @@ void tms9995_device::set_status_parity(UINT8 value) set_status_bit(ST_OP, (count & 1)!=0); } -inline void tms9995_device::compare_and_set_lae(UINT16 value1, UINT16 value2) +inline void tms9995_device::compare_and_set_lae(uint16_t value1, uint16_t value2) { set_status_bit(ST_EQ, value1 == value2); set_status_bit(ST_LH, value1 > value2); - set_status_bit(ST_AGT, (INT16)value1 > (INT16)value2); + set_status_bit(ST_AGT, (int16_t)value1 > (int16_t)value2); } /************************************************************************** @@ -2423,7 +2423,7 @@ void tms9995_device::alu_add_s_sxc() // The destination address is still in m_address // Prefetch will not change m_current_value and m_address - UINT32 dest_new = 0; + uint32_t dest_new = 0; switch (m_command) { @@ -2464,12 +2464,12 @@ void tms9995_device::alu_add_s_sxc() break; } - m_current_value = (UINT16)(dest_new & 0xffff); + m_current_value = (uint16_t)(dest_new & 0xffff); - compare_and_set_lae((UINT16)(dest_new & 0xffff),0); + compare_and_set_lae((uint16_t)(dest_new & 0xffff),0); if (m_byteop) { - set_status_parity((UINT8)(dest_new>>8)); + set_status_parity((uint8_t)(dest_new>>8)); } if (TRACE_STATUS) logerror("ST = %04x (val=%04x)\n", ST, m_current_value); // No clock pulse (will be done by prefetch) @@ -2536,7 +2536,7 @@ void tms9995_device::alu_c() // Prefetch will not change m_current_value and m_address if (m_byteop) { - set_status_parity((UINT8)(m_source_value>>8)); + set_status_parity((uint8_t)(m_source_value>>8)); } compare_and_set_lae(m_source_value, m_current_value); if (TRACE_STATUS) logerror("ST = %04x (val1=%04x, val2=%04x)\n", ST, m_source_value, m_current_value); @@ -2574,10 +2574,10 @@ void tms9995_device::alu_clr_seto() void tms9995_device::alu_divide() { int n=1; - UINT32 uval32; + uint32_t uval32; bool overflow = true; - UINT16 value1; + uint16_t value1; switch (m_inst_state) { @@ -2645,9 +2645,9 @@ void tms9995_device::alu_divide_signed() { int n=1; bool overflow; - UINT16 w1, w2, dwait; - INT16 divisor; - INT32 dividend; + uint16_t w1, w2, dwait; + int16_t divisor; + int32_t dividend; switch (m_inst_state) { @@ -2710,8 +2710,8 @@ void tms9995_device::alu_divide_signed() // We are here because there was no overflow dividend = m_value_copy << 16 | m_current_value; // Do the calculation - m_current_value = (UINT16)(dividend / (INT16)m_source_value); - m_value_copy = (UINT16)(dividend % (INT16)m_source_value); + m_current_value = (uint16_t)(dividend / (int16_t)m_source_value); + m_value_copy = (uint16_t)(dividend % (int16_t)m_source_value); m_address = WP; // As we have not implemented the real division algorithm we must @@ -2824,7 +2824,7 @@ void tms9995_device::alu_f3() */ void tms9995_device::alu_imm_arithm() { - UINT32 dest_new = 0; + uint32_t dest_new = 0; // We have the register value in m_source_value, the register address in m_address_saved // and the immediate value in m_current_value @@ -2846,7 +2846,7 @@ void tms9995_device::alu_imm_arithm() break; } - m_current_value = (UINT16)(dest_new & 0xffff); + m_current_value = (uint16_t)(dest_new & 0xffff); compare_and_set_lae(m_current_value, 0); m_address = m_address_saved; if (TRACE_STATUS) logerror("ST = %04x (val=%04x)\n", ST, m_current_value); @@ -2858,7 +2858,7 @@ void tms9995_device::alu_imm_arithm() void tms9995_device::alu_jump() { bool cond = false; - INT8 displacement = (IR & 0xff); + int8_t displacement = (IR & 0xff); switch (m_command) { @@ -2936,7 +2936,7 @@ void tms9995_device::alu_ldcr() if (m_byteop) { m_current_value = (m_current_value>>8) & 0xff; - set_status_parity((UINT8)m_current_value); + set_status_parity((uint8_t)m_current_value); } m_cru_value = m_current_value; m_address = WP + 24; @@ -3010,7 +3010,7 @@ void tms9995_device::alu_mov() m_current_value = m_source_value; if (m_byteop) { - set_status_parity((UINT8)(m_current_value>>8)); + set_status_parity((uint8_t)(m_current_value>>8)); } compare_and_set_lae(m_current_value, 0); if (TRACE_STATUS) logerror("ST = %04x (val=%04x)\n", ST, m_current_value); @@ -3023,8 +3023,8 @@ void tms9995_device::alu_mov() void tms9995_device::alu_multiply() { int n = 0; - UINT32 result; - INT32 results; + uint32_t result; + int32_t results; if (m_command==MPY) { @@ -3067,7 +3067,7 @@ void tms9995_device::alu_multiply() break; case 1: // m_current_value <- register content - results = ((INT16)m_source_value) * ((INT16)m_current_value); + results = ((int16_t)m_source_value) * ((int16_t)m_current_value); m_current_value = (results >> 16) & 0xffff; m_value_copy = results & 0xffff; // m_address is still the register @@ -3114,7 +3114,7 @@ void tms9995_device::alu_rtwp() void tms9995_device::alu_sbo_sbz() { - INT8 displacement; + int8_t displacement; if (m_inst_state==0) { @@ -3123,7 +3123,7 @@ void tms9995_device::alu_sbo_sbz() else { m_cru_value = (m_command==SBO)? 1 : 0; - displacement = (INT8)(IR & 0xff); + displacement = (int8_t)(IR & 0xff); m_cru_address = m_current_value + (displacement<<1); m_count = 1; } @@ -3138,8 +3138,8 @@ void tms9995_device::alu_shift() { bool carry = false; bool overflow = false; - UINT16 sign = 0; - UINT32 value; + uint16_t sign = 0; + uint32_t value; int count; switch (m_inst_state) @@ -3215,9 +3215,9 @@ void tms9995_device::alu_shift() */ void tms9995_device::alu_single_arithm() { - UINT32 dest_new = 0; - UINT32 src_val = m_current_value & 0x0000ffff; - UINT16 sign = 0; + uint32_t dest_new = 0; + uint32_t src_val = m_current_value & 0x0000ffff; + uint16_t sign = 0; bool check_ov = true; switch (m_command) @@ -3334,7 +3334,7 @@ void tms9995_device::alu_stcr() n = 13; if (m_byteop) { - set_status_parity((UINT8)m_current_value); + set_status_parity((uint8_t)m_current_value); m_current_value <<= 8; } else n += 8; @@ -3361,7 +3361,7 @@ void tms9995_device::alu_stst_stwp() */ void tms9995_device::alu_tb() { - INT8 displacement; + int8_t displacement; switch (m_inst_state) { @@ -3370,7 +3370,7 @@ void tms9995_device::alu_tb() pulse_clock(1); break; case 1: - displacement = (INT8)(IR & 0xff); + displacement = (int8_t)(IR & 0xff); m_cru_address = m_current_value + (displacement<<1); m_cru_first_read = true; m_count = 1; @@ -3523,32 +3523,32 @@ void tms9995_device::alu_int() } /**************************************************************************/ -UINT32 tms9995_device::execute_min_cycles() const +uint32_t tms9995_device::execute_min_cycles() const { return 2; } -UINT32 tms9995_device::execute_max_cycles() const +uint32_t tms9995_device::execute_max_cycles() const { return 44; } -UINT32 tms9995_device::execute_input_lines() const +uint32_t tms9995_device::execute_input_lines() const { return 2; } -UINT32 tms9995_device::disasm_min_opcode_bytes() const +uint32_t tms9995_device::disasm_min_opcode_bytes() const { return 2; } -UINT32 tms9995_device::disasm_max_opcode_bytes() const +uint32_t tms9995_device::disasm_max_opcode_bytes() const { return 6; } -offs_t tms9995_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t tms9995_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( tms9995 ); return CPU_DISASSEMBLE_NAME(tms9995)(this, buffer, pc, oprom, opram, options); diff --git a/src/devices/cpu/tms9900/tms9995.h b/src/devices/cpu/tms9900/tms9995.h index 1231de40196..f1867d5b0b1 100644 --- a/src/devices/cpu/tms9900/tms9995.h +++ b/src/devices/cpu/tms9900/tms9995.h @@ -48,8 +48,8 @@ enum class tms9995_device : public cpu_device { public: - tms9995_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms9995_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); + tms9995_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms9995_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); // READY input line. When asserted (high), the memory is ready for data exchange. // We chose to use a direct method instead of a delegate to keep performance @@ -73,7 +73,7 @@ public: template static devcb_base &static_set_dbin_callback(device_t &device, _Object object) { return downcast(device).m_dbin_line.set_callback(object); } // For debugger access - UINT8 debug_read_onchip_memory(offs_t addr) { return m_onchip_memory[addr & 0xff]; }; + uint8_t debug_read_onchip_memory(offs_t addr) { return m_onchip_memory[addr & 0xff]; }; bool is_onchip(offs_t addrb) { return (((addrb & 0xff00)==0xf000 && (addrb < 0xf0fc)) || ((addrb & 0xfffc)==0xfffc)) && !m_mp9537; } void set_overflow_interrupt( int enable ) { m_check_overflow = (enable!=0); } @@ -85,46 +85,46 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_set_input(int irqline, int state) override; virtual void execute_run() override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; const address_space_config* memory_space_config(address_spacenum spacenum) const override; - UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return clocks / 4.0; } - UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return cycles * 4.0; } + uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return clocks / 4.0; } + uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return cycles * 4.0; } // Variant of the TMS9995 without internal RAM and decrementer bool m_mp9537; private: // State / debug management - UINT16 m_state_any; + uint16_t m_state_any; static const char* s_statename[]; void state_import(const device_state_entry &entry) override; void state_export(const device_state_entry &entry) override; void state_string_export(const device_state_entry &entry, std::string &str) const override; - UINT16 read_workspace_register_debug(int reg); - void write_workspace_register_debug(int reg, UINT16 data); + uint16_t read_workspace_register_debug(int reg); + void write_workspace_register_debug(int reg, uint16_t data); // TMS9995 hardware registers - UINT16 WP; // Workspace pointer - UINT16 PC; // Program counter - UINT16 ST; // Status register + uint16_t WP; // Workspace pointer + uint16_t PC; // Program counter + uint16_t ST; // Status register // The TMS9995 has a prefetch feature which causes a wrong display of the PC. // We use this additional member for the debugger only. - UINT16 PC_debug; + uint16_t PC_debug; // 256 bytes of onchip memory - UINT8 m_onchip_memory[256]; + uint8_t m_onchip_memory[256]; const address_space_config m_program_config; const address_space_config m_io_config; @@ -213,7 +213,7 @@ private: // Decode the given 16-bit value which has been retrieved by a prefetch or // during an X operation. - void decode(UINT16 inst); + void decode(uint16_t inst); // Store the interrupt mask part of the ST. This is used when processing // an interrupt, passing the new mask from the service_interrupt part to @@ -221,26 +221,26 @@ private: int m_intmask; // Stored address - UINT16 m_address; + uint16_t m_address; // Stores the recently read word or the word to be written - UINT16 m_current_value; + uint16_t m_current_value; // Stores the value of the source operand in multi-operand instructions - UINT16 m_source_value; + uint16_t m_source_value; // During indexed addressing, this value is added to get the final address value. - UINT16 m_address_add; + uint16_t m_address_add; // During indirect/auto-increment addressing, this copy of the address must // be preserved while writing the new value to the register. - UINT16 m_address_saved; + uint16_t m_address_saved; // Another copy of the address - UINT16 m_address_copy; + uint16_t m_address_copy; // Copy of the value - UINT16 m_value_copy; + uint16_t m_value_copy; // Stores the recent register number. Only used to pass the register // number during the operand address derivation. @@ -253,18 +253,18 @@ private: void trigger_decrementer(); // Start value - UINT16 m_starting_count_storage_register; + uint16_t m_starting_count_storage_register; // Current decrementer value. - UINT16 m_decrementer_value; + uint16_t m_decrementer_value; // ============== CRU support ====================== - UINT16 m_cru_address; - UINT16 m_cru_value; + uint16_t m_cru_address; + uint16_t m_cru_value; bool m_cru_first_read; int m_cru_bits_left; - UINT32 m_cru_read; + uint32_t m_cru_read; // CPU-internal CRU flags bool m_flag[16]; @@ -275,13 +275,13 @@ private: // the decoded commands. When the next instruction shall be started, // the contents from the pre* members are copied to the main members. - UINT16 IR; - UINT16 m_command; + uint16_t IR; + uint16_t m_command; int m_index; bool m_byteop; - UINT16 m_pre_IR; - UINT16 m_pre_command; + uint16_t m_pre_IR; + uint16_t m_pre_command; int m_pre_index; bool m_pre_byteop; @@ -294,7 +294,7 @@ private: void build_command_lookup_table(); // Sequence of micro-operations - typedef const UINT8* microprogram; + typedef const uint8_t* microprogram; // Method pointer typedef void (tms9995_device::*ophandler)(void); @@ -302,7 +302,7 @@ private: // Opcode list entry struct tms_instruction { - UINT16 opcode; + uint16_t opcode; int id; int format; microprogram prog; // Microprogram @@ -344,8 +344,8 @@ private: // Status register update inline void set_status_bit(int bit, bool state); - inline void compare_and_set_lae(UINT16 value1, UINT16 value2); - void set_status_parity(UINT8 value); + inline void compare_and_set_lae(uint16_t value1, uint16_t value2); + void set_status_parity(uint8_t value); // Micro-operation declarations void int_prefetch_and_decode(); @@ -438,7 +438,7 @@ private: class tms9995_mp9537_device : public tms9995_device { public: - tms9995_mp9537_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + tms9995_mp9537_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9995_device(mconfig, TMS9995_MP9537, "TMS9995-MP9537", tag, owner, clock, "tms9995_mp9537", __FILE__) { m_mp9537 = true; diff --git a/src/devices/cpu/ucom4/ucom4.cpp b/src/devices/cpu/ucom4/ucom4.cpp index 71f1bd2ce9b..f3cff841953 100644 --- a/src/devices/cpu/ucom4/ucom4.cpp +++ b/src/devices/cpu/ucom4/ucom4.cpp @@ -58,19 +58,19 @@ ADDRESS_MAP_END // device definitions -upd553_cpu_device::upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd553_cpu_device::upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ucom4_cpu_device(mconfig, NEC_D553, "uPD553", tag, owner, clock, NEC_UCOM43, 3 /* stack levels */, 11 /* prg width */, ADDRESS_MAP_NAME(program_2k), 7 /* data width */, ADDRESS_MAP_NAME(data_96x4), "upd553", __FILE__) { } -upd557l_cpu_device::upd557l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd557l_cpu_device::upd557l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ucom4_cpu_device(mconfig, NEC_D557L, "uPD557L", tag, owner, clock, NEC_UCOM43, 3, 11, ADDRESS_MAP_NAME(program_2k), 7, ADDRESS_MAP_NAME(data_96x4), "upd557l", __FILE__) { } -upd650_cpu_device::upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd650_cpu_device::upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ucom4_cpu_device(mconfig, NEC_D650, "uPD650", tag, owner, clock, NEC_UCOM43, 3, 11, ADDRESS_MAP_NAME(program_2k), 7, ADDRESS_MAP_NAME(data_96x4), "upd650", __FILE__) { } -upd552_cpu_device::upd552_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd552_cpu_device::upd552_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ucom4_cpu_device(mconfig, NEC_D552, "uPD552", tag, owner, clock, NEC_UCOM44, 1, 10, ADDRESS_MAP_NAME(program_1k), 6, ADDRESS_MAP_NAME(data_64x4), "upd552", __FILE__) { } @@ -95,7 +95,7 @@ void ucom4_cpu_device::state_string_export(const device_state_entry &entry, std: } } -offs_t ucom4_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t ucom4_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE(ucom4); return CPU_DISASSEMBLE_NAME(ucom4)(this, buffer, pc, oprom, opram, options); @@ -220,10 +220,10 @@ void ucom4_cpu_device::device_reset() // default: // A,B are inputs, C,D are input/output, E,F,G,H,I are output -UINT8 ucom4_cpu_device::input_r(int index) +uint8_t ucom4_cpu_device::input_r(int index) { index &= 0xf; - UINT8 inp = 0; + uint8_t inp = 0; switch (index) { @@ -240,7 +240,7 @@ UINT8 ucom4_cpu_device::input_r(int index) return inp & 0xf; } -void ucom4_cpu_device::output_w(int index, UINT8 data) +void ucom4_cpu_device::output_w(int index, uint8_t data) { index &= 0xf; data &= 0xf; @@ -266,7 +266,7 @@ void ucom4_cpu_device::output_w(int index, UINT8 data) // uPD557L: // ports B,H,I are stripped, port G is reduced to 1 pin -UINT8 upd557l_cpu_device::input_r(int index) +uint8_t upd557l_cpu_device::input_r(int index) { index &= 0xf; @@ -278,7 +278,7 @@ UINT8 upd557l_cpu_device::input_r(int index) return 0; } -void upd557l_cpu_device::output_w(int index, UINT8 data) +void upd557l_cpu_device::output_w(int index, uint8_t data) { index &= 0xf; data &= 0xf; diff --git a/src/devices/cpu/ucom4/ucom4.h b/src/devices/cpu/ucom4/ucom4.h index 01a7f2ecc1c..5e1f3b20a25 100644 --- a/src/devices/cpu/ucom4/ucom4.h +++ b/src/devices/cpu/ucom4/ucom4.h @@ -100,7 +100,7 @@ class ucom4_cpu_device : public cpu_device { public: // construction/destruction - ucom4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int family, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) + ucom4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int family, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_BIG, 8, prgwidth, 0, program) , m_data_config("data", ENDIANNESS_BIG, 8, datawidth, 0, data) @@ -141,11 +141,11 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } // " - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 2; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } // 4 cycles per machine cycle + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } // " + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 2; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_set_input(int line, int state) override; virtual void execute_run() override; @@ -153,9 +153,9 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : nullptr); } // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 2; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 2; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_state_interface overrides virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; @@ -171,27 +171,27 @@ protected: int m_datamask; int m_family; // MCU family (43/44/45) int m_stack_levels; // number of callstack levels - UINT16 m_stack[3]; // max 3 - UINT8 m_port_out[0x10]; // last value written to output port - UINT8 m_op; - UINT8 m_prev_op; // previous opcode - UINT8 m_arg; // opcode argument for 2-byte opcodes - UINT8 m_bitmask; // opcode bit argument + uint16_t m_stack[3]; // max 3 + uint8_t m_port_out[0x10]; // last value written to output port + uint8_t m_op; + uint8_t m_prev_op; // previous opcode + uint8_t m_arg; // opcode argument for 2-byte opcodes + uint8_t m_bitmask; // opcode bit argument bool m_skip; // skip next opcode int m_icount; emu_timer *m_timer; - UINT16 m_pc; // program counter - UINT16 m_prev_pc; - UINT8 m_acc; // 4-bit accumulator - UINT8 m_dpl; // 4-bit data pointer low (RAM x) - UINT8 m_dph; // 4-bit(?) data pointer high (RAM y) - UINT8 m_dph_mask; - UINT8 m_carry_f; // carry flag - UINT8 m_carry_s_f; // carry save flag - UINT8 m_timer_f; // timer out flag - UINT8 m_int_f; // interrupt flag - UINT8 m_inte_f; // interrupt enable flag + uint16_t m_pc; // program counter + uint16_t m_prev_pc; + uint8_t m_acc; // 4-bit accumulator + uint8_t m_dpl; // 4-bit data pointer low (RAM x) + uint8_t m_dph; // 4-bit(?) data pointer high (RAM y) + uint8_t m_dph_mask; + uint8_t m_carry_f; // carry flag + uint8_t m_carry_s_f; // carry save flag + uint8_t m_timer_f; // timer out flag + uint8_t m_int_f; // interrupt flag + uint8_t m_inte_f; // interrupt enable flag int m_int_line; // interrupt pin state // i/o handlers @@ -208,23 +208,23 @@ protected: devcb_write8 m_write_h; devcb_write8 m_write_i; - virtual UINT8 input_r(int index); - virtual void output_w(int index, UINT8 data); + virtual uint8_t input_r(int index); + virtual void output_w(int index, uint8_t data); // misc internal helpers void increment_pc(); void fetch_arg(); void do_interrupt(); - UINT8 ram_r(); - void ram_w(UINT8 data); + uint8_t ram_r(); + void ram_w(uint8_t data); void pop_stack(); void push_stack(); bool check_op_43(); TIMER_CALLBACK_MEMBER( simple_timer_cb ); - UINT8 ucom43_reg_r(int index); - void ucom43_reg_w(int index, UINT8 data); + uint8_t ucom43_reg_r(int index); + void ucom43_reg_w(int index, uint8_t data); // opcode handlers void op_illegal(); @@ -316,32 +316,32 @@ protected: class upd553_cpu_device : public ucom4_cpu_device { public: - upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class upd557l_cpu_device : public ucom4_cpu_device { public: - upd557l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd557l_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual UINT8 input_r(int index) override; - virtual void output_w(int index, UINT8 data) override; + virtual uint8_t input_r(int index) override; + virtual void output_w(int index, uint8_t data) override; }; class upd650_cpu_device : public ucom4_cpu_device { public: - upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class upd552_cpu_device : public ucom4_cpu_device { public: - upd552_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd552_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/ucom4/ucom4d.cpp b/src/devices/cpu/ucom4/ucom4d.cpp index 14adfefbc79..32284002e91 100644 --- a/src/devices/cpu/ucom4/ucom4d.cpp +++ b/src/devices/cpu/ucom4/ucom4d.cpp @@ -38,7 +38,7 @@ static const char *const s_mnemonics[] = }; // number of bits per opcode parameter, 2 digits means opcode is 2 bytes -static const UINT8 s_bits[] = +static const uint8_t s_bits[] = { 4, 0, 2, 80, 4, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, @@ -54,7 +54,7 @@ static const UINT8 s_bits[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 s_flags[] = +static const uint32_t s_flags[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -68,7 +68,7 @@ static const UINT32 s_flags[] = }; -static const UINT8 ucom4_mnemonic[0x100] = +static const uint8_t ucom4_mnemonic[0x100] = { /* 0x00 */ mNOP, mDI, mS, mTIT, mTC, mTTM, mDAA, mTAL, @@ -116,8 +116,8 @@ static const UINT8 ucom4_mnemonic[0x100] = CPU_DISASSEMBLE(ucom4) { int pos = 0; - UINT8 op = oprom[pos++]; - UINT8 instr = ucom4_mnemonic[op]; + uint8_t op = oprom[pos++]; + uint8_t instr = ucom4_mnemonic[op]; char *dst = buffer; dst += sprintf(dst, "%-4s ", s_mnemonics[instr]); @@ -126,10 +126,10 @@ CPU_DISASSEMBLE(ucom4) int bits = s_bits[instr]; if (bits) { - UINT16 param = op & ((1 << (bits % 10)) - 1); + uint16_t param = op & ((1 << (bits % 10)) - 1); if (bits / 10) { - UINT8 op2 = oprom[pos++]; + uint8_t op2 = oprom[pos++]; param = (param << (bits / 10)) | (op2 & ((1 << (bits / 10)) - 1)); bits = (bits % 10) + (bits / 10); } diff --git a/src/devices/cpu/ucom4/ucom4op.cpp b/src/devices/cpu/ucom4/ucom4op.cpp index a9c5c0fe892..8c8e69f9ed4 100644 --- a/src/devices/cpu/ucom4/ucom4op.cpp +++ b/src/devices/cpu/ucom4/ucom4op.cpp @@ -8,15 +8,15 @@ // internal helpers -inline UINT8 ucom4_cpu_device::ram_r() +inline uint8_t ucom4_cpu_device::ram_r() { - UINT16 address = m_dph << 4 | m_dpl; + uint16_t address = m_dph << 4 | m_dpl; return m_data->read_byte(address & m_datamask) & 0xf; } -inline void ucom4_cpu_device::ram_w(UINT8 data) +inline void ucom4_cpu_device::ram_w(uint8_t data) { - UINT16 address = m_dph << 4 | m_dpl; + uint16_t address = m_dph << 4 | m_dpl; m_data->write_byte(address & m_datamask, data & 0xf); } @@ -105,7 +105,7 @@ void ucom4_cpu_device::op_tla() void ucom4_cpu_device::op_xm() { // XM X: Exchange ACC with RAM, xor DPh with X - UINT8 old_acc = m_acc; + uint8_t old_acc = m_acc; m_acc = ram_r(); ram_w(old_acc); m_dph ^= (m_op & 0x03); @@ -468,12 +468,12 @@ enum UCOM43_F }; -inline UINT8 ucom4_cpu_device::ucom43_reg_r(int index) +inline uint8_t ucom4_cpu_device::ucom43_reg_r(int index) { return m_data->read_byte(m_datamask - index) & 0xf; } -inline void ucom4_cpu_device::ucom43_reg_w(int index, UINT8 data) +inline void ucom4_cpu_device::ucom43_reg_w(int index, uint8_t data) { m_data->write_byte(m_datamask - index, data & 0xf); } @@ -527,7 +527,7 @@ void ucom4_cpu_device::op_xaw() // XAW: Exchange ACC with W m_icount--; - UINT8 old_acc = m_acc; + uint8_t old_acc = m_acc; m_acc = ucom43_reg_r(UCOM43_W); ucom43_reg_w(UCOM43_W, old_acc); } @@ -538,7 +538,7 @@ void ucom4_cpu_device::op_xaz() // XAZ: Exchange ACC with Z m_icount--; - UINT8 old_acc = m_acc; + uint8_t old_acc = m_acc; m_acc = ucom43_reg_r(UCOM43_Z); ucom43_reg_w(UCOM43_Z, old_acc); } @@ -549,7 +549,7 @@ void ucom4_cpu_device::op_xhr() // XHR: Exchange DPh with R m_icount--; - UINT8 old_dph = m_dph; + uint8_t old_dph = m_dph; m_dph = ucom43_reg_r(UCOM43_R); ucom43_reg_w(UCOM43_R, old_dph); } @@ -560,7 +560,7 @@ void ucom4_cpu_device::op_xhx() // XHX: Exchange DPh with X m_icount--; - UINT8 old_dph = m_dph; + uint8_t old_dph = m_dph; m_dph = ucom43_reg_r(UCOM43_X); ucom43_reg_w(UCOM43_X, old_dph); } @@ -571,7 +571,7 @@ void ucom4_cpu_device::op_xls() // XLS: Exchange DPl with S m_icount--; - UINT8 old_dpl = m_dpl; + uint8_t old_dpl = m_dpl; m_dpl = ucom43_reg_r(UCOM43_S); ucom43_reg_w(UCOM43_S, old_dpl); } @@ -582,7 +582,7 @@ void ucom4_cpu_device::op_xly() // XLY: Exchange DPl with Y m_icount--; - UINT8 old_dpl = m_dpl; + uint8_t old_dpl = m_dpl; m_dpl = ucom43_reg_r(UCOM43_Y); ucom43_reg_w(UCOM43_Y, old_dpl); } @@ -592,7 +592,7 @@ void ucom4_cpu_device::op_xc() if (!check_op_43()) return; // XC: Exchange Carry F/F with Carry Save F/F - UINT8 c = m_carry_f; + uint8_t c = m_carry_f; m_carry_f = m_carry_s_f; m_carry_s_f = c; } @@ -644,7 +644,7 @@ void ucom4_cpu_device::op_rar() if (!check_op_43()) return; // RAR: Rotate ACC Right through Carry F/F - UINT8 c = m_acc & 1; + uint8_t c = m_acc & 1; m_acc = m_acc >> 1 | m_carry_f << 3; m_carry_f = c; } @@ -657,7 +657,7 @@ void ucom4_cpu_device::op_inm() if (!check_op_43()) return; // INM: Increment RAM, skip next on carry - UINT8 val = (ram_r() + 1) & 0xf; + uint8_t val = (ram_r() + 1) & 0xf; ram_w(val); m_skip = (val == 0); } @@ -667,7 +667,7 @@ void ucom4_cpu_device::op_dem() if (!check_op_43()) return; // DEM: Decrement RAM, skip next on carry - UINT8 val = (ram_r() - 1) & 0xf; + uint8_t val = (ram_r() - 1) & 0xf; ram_w(val); m_skip = (val == 0xf); } diff --git a/src/devices/cpu/uml.cpp b/src/devices/cpu/uml.cpp index 0aff923fafd..5b4822cb379 100644 --- a/src/devices/cpu/uml.cpp +++ b/src/devices/cpu/uml.cpp @@ -227,7 +227,7 @@ const opcode_info instruction::s_opcode_info_table[OP_MAX] = // rol32 - perform a 32-bit left rotate //------------------------------------------------- -inline UINT32 rol32(UINT32 source, UINT8 count) +inline uint32_t rol32(uint32_t source, uint8_t count) { count &= 31; return (source << count) | (source >> (32 - count)); @@ -238,7 +238,7 @@ inline UINT32 rol32(UINT32 source, UINT8 count) // rol64 - perform a 64-bit left rotate //------------------------------------------------- -inline UINT64 rol64(UINT64 source, UINT8 count) +inline uint64_t rol64(uint64_t source, uint8_t count) { count &= 63; return (source << count) | (source >> (64 - count)); @@ -302,10 +302,10 @@ uml::instruction::instruction() // parameters //------------------------------------------------- -void uml::instruction::configure(opcode_t op, UINT8 size, condition_t condition) +void uml::instruction::configure(opcode_t op, uint8_t size, condition_t condition) { // fill in the instruction - m_opcode = (opcode_t)(UINT8)op; + m_opcode = (opcode_t)(uint8_t)op; m_size = size; m_condition = condition; m_flags = 0; @@ -321,10 +321,10 @@ void uml::instruction::configure(opcode_t op, UINT8 size, condition_t condition) // parameter //------------------------------------------------- -void uml::instruction::configure(opcode_t op, UINT8 size, parameter p0, condition_t condition) +void uml::instruction::configure(opcode_t op, uint8_t size, parameter p0, condition_t condition) { // fill in the instruction - m_opcode = (opcode_t)(UINT8)op; + m_opcode = (opcode_t)(uint8_t)op; m_size = size; m_condition = condition; m_flags = 0; @@ -341,10 +341,10 @@ void uml::instruction::configure(opcode_t op, UINT8 size, parameter p0, conditio // parameters //------------------------------------------------- -void uml::instruction::configure(opcode_t op, UINT8 size, parameter p0, parameter p1, condition_t condition) +void uml::instruction::configure(opcode_t op, uint8_t size, parameter p0, parameter p1, condition_t condition) { // fill in the instruction - m_opcode = (opcode_t)(UINT8)op; + m_opcode = (opcode_t)(uint8_t)op; m_size = size; m_condition = condition; m_flags = 0; @@ -362,10 +362,10 @@ void uml::instruction::configure(opcode_t op, UINT8 size, parameter p0, paramete // parameters //------------------------------------------------- -void uml::instruction::configure(opcode_t op, UINT8 size, parameter p0, parameter p1, parameter p2, condition_t condition) +void uml::instruction::configure(opcode_t op, uint8_t size, parameter p0, parameter p1, parameter p2, condition_t condition) { // fill in the instruction - m_opcode = (opcode_t)(UINT8)op; + m_opcode = (opcode_t)(uint8_t)op; m_size = size; m_condition = condition; m_flags = 0; @@ -384,10 +384,10 @@ void uml::instruction::configure(opcode_t op, UINT8 size, parameter p0, paramete // parameters //------------------------------------------------- -void uml::instruction::configure(opcode_t op, UINT8 size, parameter p0, parameter p1, parameter p2, parameter p3, condition_t condition) +void uml::instruction::configure(opcode_t op, uint8_t size, parameter p0, parameter p1, parameter p2, parameter p3, condition_t condition) { // fill in the instruction - m_opcode = (opcode_t)(UINT8)op; + m_opcode = (opcode_t)(uint8_t)op; m_size = size; m_condition = condition; m_flags = 0; @@ -414,8 +414,8 @@ void uml::instruction::simplify() if (m_flags != 0) return; - static const UINT64 instsizemask[] = { 0, 0, 0, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) }; - static const UINT64 paramsizemask[] = { 0xff, 0xffff, 0xffffffff, U64(0xffffffffffffffff) }; + static const uint64_t instsizemask[] = { 0, 0, 0, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) }; + static const uint64_t paramsizemask[] = { 0xff, 0xffff, 0xffffffff, U64(0xffffffffffffffff) }; // loop until we've simplified all we can opcode_t origop; @@ -462,10 +462,10 @@ void uml::instruction::simplify() if (m_param[1].is_immediate()) switch (m_param[2].size()) { - case SIZE_BYTE: convert_to_mov_immediate((INT8)m_param[1].immediate()); break; - case SIZE_WORD: convert_to_mov_immediate((INT16)m_param[1].immediate()); break; - case SIZE_DWORD: convert_to_mov_immediate((INT32)m_param[1].immediate()); break; - case SIZE_QWORD: convert_to_mov_immediate((INT64)m_param[1].immediate()); break; + case SIZE_BYTE: convert_to_mov_immediate((int8_t)m_param[1].immediate()); break; + case SIZE_WORD: convert_to_mov_immediate((int16_t)m_param[1].immediate()); break; + case SIZE_DWORD: convert_to_mov_immediate((int32_t)m_param[1].immediate()); break; + case SIZE_QWORD: convert_to_mov_immediate((int64_t)m_param[1].immediate()); break; case SIZE_DQWORD: fatalerror("Invalid SEXT target size\n"); } break; @@ -545,9 +545,9 @@ void uml::instruction::simplify() else if (m_param[2].is_immediate() && m_param[3].is_immediate()) { if (m_size == 4) - convert_to_mov_immediate((UINT32)((UINT32)m_param[1].immediate() * (UINT32)m_param[2].immediate())); + convert_to_mov_immediate((uint32_t)((uint32_t)m_param[1].immediate() * (uint32_t)m_param[2].immediate())); else if (m_size == 8) - convert_to_mov_immediate((UINT64)((UINT64)m_param[1].immediate() * (UINT64)m_param[2].immediate())); + convert_to_mov_immediate((uint64_t)((uint64_t)m_param[1].immediate() * (uint64_t)m_param[2].immediate())); } } break; @@ -561,9 +561,9 @@ void uml::instruction::simplify() else if (m_param[2].is_immediate() && m_param[3].is_immediate()) { if (m_size == 4) - convert_to_mov_immediate((INT32)((INT32)m_param[1].immediate() * (INT32)m_param[2].immediate())); + convert_to_mov_immediate((int32_t)((int32_t)m_param[1].immediate() * (int32_t)m_param[2].immediate())); else if (m_size == 8) - convert_to_mov_immediate((INT64)((INT64)m_param[1].immediate() * (INT64)m_param[2].immediate())); + convert_to_mov_immediate((int64_t)((int64_t)m_param[1].immediate() * (int64_t)m_param[2].immediate())); } } break; @@ -577,9 +577,9 @@ void uml::instruction::simplify() else if (m_param[2].is_immediate() && m_param[3].is_immediate()) { if (m_size == 4) - convert_to_mov_immediate((UINT32)((UINT32)m_param[1].immediate() / (UINT32)m_param[2].immediate())); + convert_to_mov_immediate((uint32_t)((uint32_t)m_param[1].immediate() / (uint32_t)m_param[2].immediate())); else if (m_size == 8) - convert_to_mov_immediate((UINT64)((UINT64)m_param[1].immediate() / (UINT64)m_param[2].immediate())); + convert_to_mov_immediate((uint64_t)((uint64_t)m_param[1].immediate() / (uint64_t)m_param[2].immediate())); } } break; @@ -593,9 +593,9 @@ void uml::instruction::simplify() else if (m_param[2].is_immediate() && m_param[3].is_immediate()) { if (m_size == 4) - convert_to_mov_immediate((INT32)((INT32)m_param[1].immediate() / (INT32)m_param[2].immediate())); + convert_to_mov_immediate((int32_t)((int32_t)m_param[1].immediate() / (int32_t)m_param[2].immediate())); else if (m_size == 8) - convert_to_mov_immediate((INT64)((INT64)m_param[1].immediate() / (INT64)m_param[2].immediate())); + convert_to_mov_immediate((int64_t)((int64_t)m_param[1].immediate() / (int64_t)m_param[2].immediate())); } } break; @@ -680,9 +680,9 @@ void uml::instruction::simplify() if (m_param[1].is_immediate() && m_param[2].is_immediate()) { if (m_size == 4) - convert_to_mov_immediate((UINT32)m_param[1].immediate() >> m_param[2].immediate()); + convert_to_mov_immediate((uint32_t)m_param[1].immediate() >> m_param[2].immediate()); else if (m_size == 8) - convert_to_mov_immediate((UINT64)m_param[1].immediate() >> m_param[2].immediate()); + convert_to_mov_immediate((uint64_t)m_param[1].immediate() >> m_param[2].immediate()); } else if (m_param[2].is_immediate_value(0)) convert_to_mov_param(1); @@ -693,9 +693,9 @@ void uml::instruction::simplify() if (m_param[1].is_immediate() && m_param[2].is_immediate()) { if (m_size == 4) - convert_to_mov_immediate((INT32)m_param[1].immediate() >> m_param[2].immediate()); + convert_to_mov_immediate((int32_t)m_param[1].immediate() >> m_param[2].immediate()); else if (m_size == 8) - convert_to_mov_immediate((INT64)m_param[1].immediate() >> m_param[2].immediate()); + convert_to_mov_immediate((int64_t)m_param[1].immediate() >> m_param[2].immediate()); } else if (m_param[2].is_immediate_value(0)) convert_to_mov_param(1); @@ -791,9 +791,9 @@ void uml::instruction::validate() // instruction //------------------------------------------------- -UINT8 uml::instruction::input_flags() const +uint8_t uml::instruction::input_flags() const { - static const UINT8 flags_for_condition[] = + static const uint8_t flags_for_condition[] = { FLAG_Z, // COND_Z FLAG_Z, // COND_NZ @@ -813,7 +813,7 @@ UINT8 uml::instruction::input_flags() const FLAG_S | FLAG_V // COND_GE }; - UINT8 flags = s_opcode_info_table[m_opcode].inflags; + uint8_t flags = s_opcode_info_table[m_opcode].inflags; if (flags & 0x80) flags = m_param[flags - OPFLAGS_P1].immediate() & OPFLAGS_ALL; if (m_condition != COND_ALWAYS) @@ -828,9 +828,9 @@ UINT8 uml::instruction::input_flags() const // instruction //------------------------------------------------- -UINT8 uml::instruction::output_flags() const +uint8_t uml::instruction::output_flags() const { - UINT8 flags = s_opcode_info_table[m_opcode].outflags; + uint8_t flags = s_opcode_info_table[m_opcode].outflags; if (flags & 0x80) flags = m_param[flags - OPFLAGS_P1].immediate() & OPFLAGS_ALL; return flags; @@ -843,7 +843,7 @@ UINT8 uml::instruction::output_flags() const // instruction //------------------------------------------------- -UINT8 uml::instruction::modified_flags() const +uint8_t uml::instruction::modified_flags() const { return s_opcode_info_table[m_opcode].modflags; } @@ -915,14 +915,14 @@ std::string uml::instruction::disasm(drcuml_state *drcuml) const } // truncate to size - UINT64 value = param.immediate(); - if (size == 1) value = (UINT8)value; - if (size == 2) value = (UINT16)value; - if (size == 4) value = (UINT32)value; - if ((UINT32)value == value) - util::stream_format(buffer, "$%X", (UINT32)value); + uint64_t value = param.immediate(); + if (size == 1) value = (uint8_t)value; + if (size == 2) value = (uint16_t)value; + if (size == 4) value = (uint32_t)value; + if ((uint32_t)value == value) + util::stream_format(buffer, "$%X", (uint32_t)value); else - util::stream_format(buffer, "$%X%08X", (UINT32)(value >> 32), (UINT32)value); + util::stream_format(buffer, "$%X%08X", (uint32_t)(value >> 32), (uint32_t)value); } break; @@ -972,7 +972,7 @@ std::string uml::instruction::disasm(drcuml_state *drcuml) const case parameter::PTYPE_MEMORY: { const char *symbol; - UINT32 symoffset; + uint32_t symoffset; // symbol if (drcuml != nullptr && (symbol = drcuml->symbol_find(param.memory(), &symoffset)) != nullptr) @@ -985,7 +985,7 @@ std::string uml::instruction::disasm(drcuml_state *drcuml) const // cache memory else if (drcuml != nullptr && drcuml->cache().contains_pointer(param.memory())) - util::stream_format(buffer, "[+$%X]", (UINT32)(uintptr_t)((drccodeptr)param.memory() - drcuml->cache().near())); + util::stream_format(buffer, "[+$%X]", (uint32_t)(uintptr_t)((drccodeptr)param.memory() - drcuml->cache().near())); // general memory else diff --git a/src/devices/cpu/uml.h b/src/devices/cpu/uml.h index 9c2b9a4c80e..a86f8eee82b 100644 --- a/src/devices/cpu/uml.h +++ b/src/devices/cpu/uml.h @@ -51,11 +51,11 @@ namespace uml const int MAPVAR_END = MAPVAR_M0 + MAPVAR_COUNT; // flag definitions - const UINT8 FLAG_C = 0x01; // carry flag - const UINT8 FLAG_V = 0x02; // overflow flag (defined for integer only) - const UINT8 FLAG_Z = 0x04; // zero flag - const UINT8 FLAG_S = 0x08; // sign flag (defined for integer only) - const UINT8 FLAG_U = 0x10; // unordered flag (defined for FP only) + const uint8_t FLAG_C = 0x01; // carry flag + const uint8_t FLAG_V = 0x02; // overflow flag (defined for integer only) + const uint8_t FLAG_Z = 0x04; // zero flag + const uint8_t FLAG_S = 0x08; // sign flag (defined for integer only) + const uint8_t FLAG_U = 0x10; // unordered flag (defined for FP only) // testable conditions; note that these are defined such that (condition ^ 1) is // always the opposite @@ -260,18 +260,18 @@ namespace uml { public: // construction - code_label(UINT32 label = 0) : m_label(label) { } + code_label(uint32_t label = 0) : m_label(label) { } // operators - operator UINT32 &() { return m_label; } + operator uint32_t &() { return m_label; } bool operator==(const code_label &rhs) const { return (m_label == rhs.m_label); } bool operator!=(const code_label &rhs) const { return (m_label != rhs.m_label); } // getters - UINT32 label() const { return m_label; } + uint32_t label() const { return m_label; } private: - UINT32 m_label; + uint32_t m_label; }; // a parameter for a UML instructon is encoded like this @@ -300,12 +300,12 @@ namespace uml }; // represents the value of an opcode parameter - typedef UINT64 parameter_value; + typedef uint64_t parameter_value; // construction parameter() : m_type(PTYPE_NONE), m_value(0) { } parameter(const parameter ¶m) : m_type(param.m_type), m_value(param.m_value) { } - parameter(UINT64 val) : m_type(PTYPE_IMMEDIATE), m_value(val) { } + parameter(uint64_t val) : m_type(PTYPE_IMMEDIATE), m_value(val) { } parameter(operand_size size, memory_scale scale) : m_type(PTYPE_SIZE_SCALE), m_value((scale << 4) | size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); assert(scale >= SCALE_x1 && scale <= SCALE_x8); } parameter(operand_size size, memory_space space) : m_type(PTYPE_SIZE_SPACE), m_value((space << 4) | size) { assert(size >= SIZE_BYTE && size <= SIZE_DQWORD); assert(space >= SPACE_PROGRAM && space <= SPACE_IO); } parameter(code_handle &handle) : m_type(PTYPE_CODE_HANDLE), m_value(reinterpret_cast(&handle)) { } @@ -329,7 +329,7 @@ namespace uml // getters parameter_type type() const { return m_type; } - UINT64 immediate() const { assert(m_type == PTYPE_IMMEDIATE); return m_value; } + uint64_t immediate() const { assert(m_type == PTYPE_IMMEDIATE); return m_value; } int ireg() const { assert(m_type == PTYPE_INT_REGISTER); assert(m_value >= REG_I0 && m_value < REG_I_END); return m_value; } int freg() const { assert(m_type == PTYPE_FLOAT_REGISTER); assert(m_value >= REG_F0 && m_value < REG_F_END); return m_value; } int vreg() const { assert(m_type == PTYPE_VECTOR_REGISTER); assert(m_value >= REG_V0 && m_value < REG_V_END); return m_value; } @@ -361,7 +361,7 @@ namespace uml bool is_string() const { return (m_type == PTYPE_STRING); } // other queries - bool is_immediate_value(UINT64 value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); } + bool is_immediate_value(uint64_t value) const { return (m_type == PTYPE_IMMEDIATE && m_value == value); } private: // private constructor @@ -377,18 +377,18 @@ namespace uml { struct parameter_info { - UINT8 output; // input or output? - UINT8 size; // size of the parameter - UINT16 typemask; // types allowed + uint8_t output; // input or output? + uint8_t size; // size of the parameter + uint16_t typemask; // types allowed }; opcode_t opcode; // the opcode itself const char * mnemonic; // mnemonic string - UINT8 sizes; // allowed sizes + uint8_t sizes; // allowed sizes bool condition; // conditions allowed? - UINT8 inflags; // input flags - UINT8 outflags; // output flags - UINT8 modflags; // modified flags + uint8_t inflags; // input flags + uint8_t outflags; // output flags + uint8_t modflags; // modified flags parameter_info param[4]; // information about parameters }; @@ -402,32 +402,32 @@ namespace uml // getters opcode_t opcode() const { return m_opcode; } condition_t condition() const { return m_condition; } - UINT8 flags() const { return m_flags; } - UINT8 size() const { return m_size; } - UINT8 numparams() const { return m_numparams; } + uint8_t flags() const { return m_flags; } + uint8_t size() const { return m_size; } + uint8_t numparams() const { return m_numparams; } const parameter ¶m(int index) const { assert(index < m_numparams); return m_param[index]; } // setters - void set_flags(UINT8 flags) { m_flags = flags; } - void set_mapvar(int paramnum, UINT32 value) { assert(paramnum < m_numparams); assert(m_param[paramnum].is_mapvar()); m_param[paramnum] = value; } + void set_flags(uint8_t flags) { m_flags = flags; } + void set_mapvar(int paramnum, uint32_t value) { assert(paramnum < m_numparams); assert(m_param[paramnum].is_mapvar()); m_param[paramnum] = value; } // misc std::string disasm(drcuml_state *drcuml = nullptr) const; - UINT8 input_flags() const; - UINT8 output_flags() const; - UINT8 modified_flags() const; + uint8_t input_flags() const; + uint8_t output_flags() const; + uint8_t modified_flags() const; void simplify(); // compile-time opcodes void handle(code_handle &hand) { configure(OP_HANDLE, 4, hand); } - void hash(UINT32 mode, UINT32 pc) { configure(OP_HASH, 4, mode, pc); } + void hash(uint32_t mode, uint32_t pc) { configure(OP_HASH, 4, mode, pc); } void label(code_label lab) { configure(OP_LABEL, 4, lab); } void comment(const char *string) { configure(OP_COMMENT, 4, parameter::make_string(string)); } - void mapvar(parameter mapvar, UINT32 value) { assert(mapvar.is_mapvar()); configure(OP_MAPVAR, 4, mapvar, value); } + void mapvar(parameter mapvar, uint32_t value) { assert(mapvar.is_mapvar()); configure(OP_MAPVAR, 4, mapvar, value); } // control flow operations void nop() { configure(OP_NOP, 4); } - void debug(UINT32 pc) { configure(OP_DEBUG, 4, pc); } + void debug(uint32_t pc) { configure(OP_DEBUG, 4, pc); } void exit(parameter param) { configure(OP_EXIT, 4, param); } void exit(condition_t cond, parameter param) { configure(OP_EXIT, 4, param, cond); } void hashjmp(parameter mode, parameter pc, code_handle &handle) { configure(OP_HASHJMP, 4, mode, pc, handle); } @@ -447,7 +447,7 @@ namespace uml void setfmod(parameter mode) { configure(OP_SETFMOD, 4, mode); } void getfmod(parameter dst) { configure(OP_GETFMOD, 4, dst); } void getexp(parameter dst) { configure(OP_GETEXP, 4, dst); } - void getflgs(parameter dst, UINT32 flags) { configure(OP_GETFLGS, 4, dst, flags); } + void getflgs(parameter dst, uint32_t flags) { configure(OP_GETFLGS, 4, dst, flags); } void save(drcuml_machine_state *dst) { configure(OP_SAVE, 4, parameter::make_memory(dst)); } void restore(drcuml_machine_state *src) { configure(OP_RESTORE, 4, parameter::make_memory(src)); } @@ -581,23 +581,23 @@ namespace uml private: // internal configuration - void configure(opcode_t op, UINT8 size, condition_t cond = COND_ALWAYS); - void configure(opcode_t op, UINT8 size, parameter p0, condition_t cond = COND_ALWAYS); - void configure(opcode_t op, UINT8 size, parameter p0, parameter p1, condition_t cond = COND_ALWAYS); - void configure(opcode_t op, UINT8 size, parameter p0, parameter p1, parameter p2, condition_t cond = COND_ALWAYS); - void configure(opcode_t op, UINT8 size, parameter p0, parameter p1, parameter p2, parameter p3, condition_t cond = COND_ALWAYS); + void configure(opcode_t op, uint8_t size, condition_t cond = COND_ALWAYS); + void configure(opcode_t op, uint8_t size, parameter p0, condition_t cond = COND_ALWAYS); + void configure(opcode_t op, uint8_t size, parameter p0, parameter p1, condition_t cond = COND_ALWAYS); + void configure(opcode_t op, uint8_t size, parameter p0, parameter p1, parameter p2, condition_t cond = COND_ALWAYS); + void configure(opcode_t op, uint8_t size, parameter p0, parameter p1, parameter p2, parameter p3, condition_t cond = COND_ALWAYS); // opcode validation and simplification void validate(); - void convert_to_mov_immediate(UINT64 immediate) { m_opcode = OP_MOV; m_numparams = 2; m_param[1] = immediate; } + void convert_to_mov_immediate(uint64_t immediate) { m_opcode = OP_MOV; m_numparams = 2; m_param[1] = immediate; } void convert_to_mov_param(int pnum) { m_opcode = OP_MOV; m_numparams = 2; m_param[1] = m_param[pnum]; } // internal state opcode_t m_opcode; // opcode condition_t m_condition; // condition - UINT8 m_flags; // flags - UINT8 m_size; // operation size - UINT8 m_numparams; // number of parameters + uint8_t m_flags; // flags + uint8_t m_size; // operation size + uint8_t m_numparams; // number of parameters parameter m_param[MAX_PARAMS];// up to 4 parameters static const opcode_info s_opcode_info_table[OP_MAX]; @@ -606,9 +606,9 @@ namespace uml // structure describing rules for parameter encoding struct parameter_info { - UINT8 output; // input or output? - UINT8 size; // size of the parameter - UINT16 typemask; // types allowed + uint8_t output; // input or output? + uint8_t size; // size of the parameter + uint16_t typemask; // types allowed }; // global inline functions to specify a register parameter by index diff --git a/src/devices/cpu/unsp/unsp.cpp b/src/devices/cpu/unsp/unsp.cpp index 12bdc67078c..11500ba0e48 100644 --- a/src/devices/cpu/unsp/unsp.cpp +++ b/src/devices/cpu/unsp/unsp.cpp @@ -16,14 +16,14 @@ const device_type UNSP = &device_creator; -unsp_device::unsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +unsp_device::unsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, UNSP, "u'nSP", tag, owner, clock, "unsp", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 16, 23, -1), m_irq(0), m_fiq(0), m_curirq(0), m_sirq(0), m_sb(0), m_saved_sb(0), m_program(nullptr), m_icount(0), m_debugger_temp(0) { } -offs_t unsp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t unsp_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( unsp ); return CPU_DISASSEMBLE_NAME(unsp)(this, buffer, pc, oprom, opram, options); @@ -95,24 +95,24 @@ offs_t unsp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr #define WRITEBACK_OPA \ if(OP0 != 4 && OP0 < 12) \ { \ - UNSP_REG_I(OPA) = (UINT16)lres; \ + UNSP_REG_I(OPA) = (uint16_t)lres; \ } /*****************************************************************************/ -void unsp_device::unimplemented_opcode(UINT16 op) +void unsp_device::unimplemented_opcode(uint16_t op) { fatalerror("UNSP: unknown opcode %04x at %04x\n", op, UNSP_LPC); } /*****************************************************************************/ -UINT16 unsp_device::READ16(UINT32 address) +uint16_t unsp_device::READ16(uint32_t address) { return m_program->read_word(address<<1); } -void unsp_device::WRITE16(UINT32 address, UINT16 data) +void unsp_device::WRITE16(uint32_t address, uint16_t data) { m_program->write_word(address<<1, data); } @@ -121,7 +121,7 @@ void unsp_device::WRITE16(UINT32 address, UINT16 data) void unsp_device::device_start() { - memset(m_r, 0, sizeof(UINT16) * UNSP_GPR_COUNT); + memset(m_r, 0, sizeof(uint16_t) * UNSP_GPR_COUNT); m_irq = 0; m_fiq = 0; m_curirq = 0; @@ -175,7 +175,7 @@ void unsp_device::state_import(const device_state_entry &entry) void unsp_device::device_reset() { - memset(m_r, 0, sizeof(UINT16) * UNSP_GPR_COUNT); + memset(m_r, 0, sizeof(uint16_t) * UNSP_GPR_COUNT); UNSP_REG(PC) = READ16(0xfff7); m_irq = 0; @@ -184,49 +184,49 @@ void unsp_device::device_reset() /*****************************************************************************/ -void unsp_device::unsp_update_nz(UINT32 value) +void unsp_device::unsp_update_nz(uint32_t value) { UNSP_REG(SR) &= ~(UNSP_N | UNSP_Z); if(value & 0x8000) { UNSP_REG(SR) |= UNSP_N; } - if((UINT16)value == 0) + if((uint16_t)value == 0) { UNSP_REG(SR) |= UNSP_Z; } } -void unsp_device::unsp_update_nzsc(UINT32 value, UINT16 r0, UINT16 r1) +void unsp_device::unsp_update_nzsc(uint32_t value, uint16_t r0, uint16_t r1) { UNSP_REG(SR) &= ~(UNSP_C | UNSP_S); unsp_update_nz(value); - if(value != (UINT16)value) + if(value != (uint16_t)value) { UNSP_REG(SR) |= UNSP_C; } - if((INT16)r0 < (INT16)r1) + if((int16_t)r0 < (int16_t)r1) { UNSP_REG(SR) |= UNSP_S; } } -void unsp_device::unsp_push(UINT16 value, UINT16 *reg) +void unsp_device::unsp_push(uint16_t value, uint16_t *reg) { WRITE16((*reg)--, value); } -UINT16 unsp_device::unsp_pop(UINT16 *reg) +uint16_t unsp_device::unsp_pop(uint16_t *reg) { return READ16(++(*reg)); } void unsp_device::execute_run() { - UINT32 op; - UINT32 lres; - UINT16 r0, r1; + uint32_t op; + uint32_t lres; + uint16_t r0, r1; lres = 0; while (m_icount > 0) @@ -547,7 +547,7 @@ void unsp_device::execute_run() } if(OP0 != 4 && OP0 < 12) { - WRITE16(READ16(UNSP_LPC), (UINT16)lres); + WRITE16(READ16(UNSP_LPC), (uint16_t)lres); } UNSP_REG(PC)++; break; @@ -555,7 +555,7 @@ void unsp_device::execute_run() // ALU, Shifted default: { - UINT32 shift = (UNSP_REG_I(OPB) << 4) | m_sb; + uint32_t shift = (UNSP_REG_I(OPB) << 4) | m_sb; if(shift & 0x80000) { shift |= 0xf00000; @@ -607,8 +607,8 @@ void unsp_device::execute_run() case 9: // load r, r >> imm2 lres = ((UNSP_REG_I(OPB) << 4) | m_sb) >> (OPN - 3); m_sb = lres & 0x0f; - unsp_update_nz((UINT16)(lres >> 4)); - UNSP_REG_I(OPA) = (UINT16)(lres >> 4); + unsp_update_nz((uint16_t)(lres >> 4)); + UNSP_REG_I(OPA) = (uint16_t)(lres >> 4); break; default: unimplemented_opcode(op); @@ -617,7 +617,7 @@ void unsp_device::execute_run() } else { - UINT32 shift = ((m_sb << 16) | UNSP_REG_I(OPB)) << (OPN + 1); + uint32_t shift = ((m_sb << 16) | UNSP_REG_I(OPB)) << (OPN + 1); m_sb = (shift >> 16) & 0x0f; r0 = UNSP_REG_I(OPA); r1 = shift & 0x0000ffff; @@ -627,17 +627,17 @@ void unsp_device::execute_run() case 0: // add r, r << imm2 lres = r0 + r1; unsp_update_nzsc(lres, r0, r1); - UNSP_REG_I(OPA) = (UINT16)lres; + UNSP_REG_I(OPA) = (uint16_t)lres; break; case 9: // load r, r << imm2 lres = r1; unsp_update_nz(lres); - UNSP_REG_I(OPA) = (UINT16)lres; + UNSP_REG_I(OPA) = (uint16_t)lres; break; case 10: // or r, r << imm2 lres = r0 | r1; unsp_update_nz(lres); - UNSP_REG_I(OPA) = (UINT16)lres; + UNSP_REG_I(OPA) = (uint16_t)lres; break; default: unimplemented_opcode(op); @@ -652,13 +652,13 @@ void unsp_device::execute_run() { lres = ((((m_sb << 16) | UNSP_REG_I(OPB)) << 4) | m_sb) >> (OPN - 3); m_sb = lres & 0x0f; - r1 = (UINT16)(lres >> 4); + r1 = (uint16_t)(lres >> 4); } else { lres = ((((m_sb << 16) | UNSP_REG_I(OPB)) << 4) | m_sb) << (OPN + 1); m_sb = (lres >> 20) & 0x0f; - r1 = (UINT16)(lres >> 4); + r1 = (uint16_t)(lres >> 4); } switch(OP0) @@ -717,7 +717,7 @@ void unsp_device::execute_run() lres -= UNSP_REG_I(OPA) << 16; } UNSP_REG(R4) = lres >> 16; - UNSP_REG(R3) = (UINT16)lres; + UNSP_REG(R3) = (uint16_t)lres; break; } else @@ -740,7 +740,7 @@ void unsp_device::execute_run() lres -= UNSP_REG_I(OPB) << 16; } UNSP_REG(R4) = lres >> 16; - UNSP_REG(R3) = (UINT16)lres; + UNSP_REG(R3) = (uint16_t)lres; break; } else @@ -805,7 +805,7 @@ void unsp_device::execute_run() void unsp_device::execute_set_input(int irqline, int state) { - UINT16 irq_vector = 0; + uint16_t irq_vector = 0; m_sirq &= ~(1 << irqline); diff --git a/src/devices/cpu/unsp/unsp.h b/src/devices/cpu/unsp/unsp.h index 6424016cf3b..69e1ad962b0 100644 --- a/src/devices/cpu/unsp/unsp.h +++ b/src/devices/cpu/unsp/unsp.h @@ -53,7 +53,7 @@ class unsp_device : public cpu_device { public: // construction/destruction - unsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + unsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -61,9 +61,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 5; } - virtual UINT32 execute_max_cycles() const override { return 5; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 5; } + virtual uint32_t execute_max_cycles() const override { return 5; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -75,33 +75,33 @@ protected: virtual void state_export(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; - UINT16 m_r[16]; - UINT8 m_irq; - UINT8 m_fiq; - UINT16 m_curirq; - UINT16 m_sirq; - UINT8 m_sb; - UINT8 m_saved_sb; + uint16_t m_r[16]; + uint8_t m_irq; + uint8_t m_fiq; + uint16_t m_curirq; + uint16_t m_sirq; + uint8_t m_sb; + uint8_t m_saved_sb; address_space *m_program; int m_icount; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; - void unimplemented_opcode(UINT16 op); - inline UINT16 READ16(UINT32 address); - inline void WRITE16(UINT32 address, UINT16 data); - inline void unsp_update_nz(UINT32 value); - inline void unsp_update_nzsc(UINT32 value, UINT16 r0, UINT16 r1); - inline void unsp_push(UINT16 value, UINT16 *reg); - inline UINT16 unsp_pop(UINT16 *reg); + void unimplemented_opcode(uint16_t op); + inline uint16_t READ16(uint32_t address); + inline void WRITE16(uint32_t address, uint16_t data); + inline void unsp_update_nz(uint32_t value); + inline void unsp_update_nzsc(uint32_t value, uint16_t r0, uint16_t r1); + inline void unsp_push(uint16_t value, uint16_t *reg); + inline uint16_t unsp_pop(uint16_t *reg); }; diff --git a/src/devices/cpu/unsp/unspdasm.cpp b/src/devices/cpu/unsp/unspdasm.cpp index 34f153fc916..50ae51c29a9 100644 --- a/src/devices/cpu/unsp/unspdasm.cpp +++ b/src/devices/cpu/unsp/unspdasm.cpp @@ -59,8 +59,8 @@ static const char *alu[] = CPU_DISASSEMBLE( unsp ) { - UINT16 op = *(UINT16 *)oprom; - UINT16 imm16 = *(UINT16 *)(oprom + 2); + uint16_t op = *(uint16_t *)oprom; + uint16_t imm16 = *(uint16_t *)(oprom + 2); op = big_endianize_int16(op); imm16 = big_endianize_int16(imm16); diff --git a/src/devices/cpu/upd7725/dasm7725.cpp b/src/devices/cpu/upd7725/dasm7725.cpp index 987002412ac..8edeb821e53 100644 --- a/src/devices/cpu/upd7725/dasm7725.cpp +++ b/src/devices/cpu/upd7725/dasm7725.cpp @@ -15,22 +15,22 @@ CPU_DISASSEMBLE( upd7725 ) { static char output[256]; - UINT32 opcode = oprom[2] | (oprom[1] << 8) | (oprom[0] << 16); - UINT32 type = (opcode >> 22); + uint32_t opcode = oprom[2] | (oprom[1] << 8) | (oprom[0] << 16); + uint32_t type = (opcode >> 22); // printf("dasm: PC %x opcode %08x\n", pc, opcode); memset(output, 0, sizeof(output)); if(type == 0 || type == 1) { //OP,RT - UINT8 pselect = (opcode >> 20)&0x3; //P select - UINT8 alu = (opcode >> 16)&0xf; //ALU operation mode - UINT8 asl = (opcode >> 15)&0x1; //accumulator select - UINT8 dpl = (opcode >> 13)&0x3; //DP low modify - UINT8 dphm = (opcode >> 9)&0xf; //DP high XOR modify - UINT8 rpdcr = (opcode >> 8)&0x1; //RP decrement - UINT8 src = (opcode >> 4)&0xf; //move source - UINT8 dst = (opcode >> 0)&0xf; //move destination + uint8_t pselect = (opcode >> 20)&0x3; //P select + uint8_t alu = (opcode >> 16)&0xf; //ALU operation mode + uint8_t asl = (opcode >> 15)&0x1; //accumulator select + uint8_t dpl = (opcode >> 13)&0x3; //DP low modify + uint8_t dphm = (opcode >> 9)&0xf; //DP high XOR modify + uint8_t rpdcr = (opcode >> 8)&0x1; //RP decrement + uint8_t src = (opcode >> 4)&0xf; //move source + uint8_t dst = (opcode >> 0)&0xf; //move destination switch(alu) { case 0: strcat(output, "nop "); break; @@ -147,8 +147,8 @@ CPU_DISASSEMBLE( upd7725 ) } if(type == 2) { //JP - UINT16 brch = (opcode >> 13) & 0x1ff; //branch - UINT16 na = (opcode >> 2) & 0x7ff; //next address + uint16_t brch = (opcode >> 13) & 0x1ff; //branch + uint16_t na = (opcode >> 2) & 0x7ff; //next address switch(brch) { case 0x000: strcat(output, "jmpso "); break; @@ -201,8 +201,8 @@ CPU_DISASSEMBLE( upd7725 ) if(type == 3) { //LD strcat(output, "ld "); - UINT16 id = opcode >> 6; - UINT8 dst = (opcode >> 0) & 0xf; //destination + uint16_t id = opcode >> 6; + uint8_t dst = (opcode >> 0) & 0xf; //destination char temp[16]; sprintf(temp, "$%x,", id); diff --git a/src/devices/cpu/upd7725/upd7725.cpp b/src/devices/cpu/upd7725/upd7725.cpp index 9564d380bc9..841d9322050 100644 --- a/src/devices/cpu/upd7725/upd7725.cpp +++ b/src/devices/cpu/upd7725/upd7725.cpp @@ -24,7 +24,7 @@ const device_type UPD7725 = &device_creator; const device_type UPD96050 = &device_creator; -necdsp_device::necdsp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, UINT32 abits, UINT32 dbits, const char *name, const char *shortname, const char *source) +necdsp_device::necdsp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t abits, uint32_t dbits, const char *name, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), m_program_config("program", ENDIANNESS_BIG, 32, abits, -2), // data bus width, address bus width, -2 means DWORD-addressable m_data_config("data", ENDIANNESS_BIG, 16, dbits, -1), m_icount(0), // -1 for WORD-addressable @@ -47,12 +47,12 @@ necdsp_device::necdsp_device(const machine_config &mconfig, device_type type, co } -upd7725_device::upd7725_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7725_device::upd7725_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : necdsp_device(mconfig, UPD7725, tag, owner, clock, 11, 11, "uPD7725", "upd7725", __FILE__) { } -upd96050_device::upd96050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd96050_device::upd96050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : necdsp_device(mconfig, UPD96050, tag, owner, clock, 14, 12, "uPD96050", "upd96050", __FILE__) { } @@ -238,7 +238,7 @@ void necdsp_device::state_string_export(const device_state_entry &entry, std::st // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 necdsp_device::execute_min_cycles() const +uint32_t necdsp_device::execute_min_cycles() const { return 4; } @@ -249,7 +249,7 @@ UINT32 necdsp_device::execute_min_cycles() const // cycles it takes for one instruction to execute //------------------------------------------------- -UINT32 necdsp_device::execute_max_cycles() const +uint32_t necdsp_device::execute_max_cycles() const { return 4; } @@ -260,7 +260,7 @@ UINT32 necdsp_device::execute_max_cycles() const // input/interrupt lines //------------------------------------------------- -UINT32 necdsp_device::execute_input_lines() const +uint32_t necdsp_device::execute_input_lines() const { return 3; // TODO: there should be 11: INT, SCK, /SIEN, /SOEN, SI, and /DACK, plus SO, /SORQ and DRQ; for now, just INT, P0, and P1 are enough. } @@ -287,7 +287,7 @@ void necdsp_device::execute_set_input(int inputnum, int state) // of the shortest instruction, in bytes //------------------------------------------------- -UINT32 necdsp_device::disasm_min_opcode_bytes() const +uint32_t necdsp_device::disasm_min_opcode_bytes() const { return 4; } @@ -298,7 +298,7 @@ UINT32 necdsp_device::disasm_min_opcode_bytes() const // of the longest instruction, in bytes //------------------------------------------------- -UINT32 necdsp_device::disasm_max_opcode_bytes() const +uint32_t necdsp_device::disasm_max_opcode_bytes() const { return 4; } @@ -308,7 +308,7 @@ UINT32 necdsp_device::disasm_max_opcode_bytes() const // helper function //------------------------------------------------- -offs_t necdsp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t necdsp_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( upd7725 ); return CPU_DISASSEMBLE_NAME(upd7725)(this, buffer, pc, oprom, opram, options); @@ -316,7 +316,7 @@ offs_t necdsp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o void necdsp_device::execute_run() { - UINT32 opcode; + uint32_t opcode; do { @@ -336,7 +336,7 @@ void necdsp_device::execute_run() case 3: exec_ld(opcode); break; } - INT32 result = (INT32)regs.k * regs.l; //sign + 30-bit result + int32_t result = (int32_t)regs.k * regs.l; //sign + 30-bit result regs.m = result >> 15; //store sign + top 15-bits regs.n = result << 1; //store low 15-bits + zero @@ -345,15 +345,15 @@ void necdsp_device::execute_run() } while (m_icount > 0); } -void necdsp_device::exec_op(UINT32 opcode) { - UINT8 pselect = (opcode >> 20)&0x3; //P select - UINT8 alu = (opcode >> 16)&0xf; //ALU operation mode - UINT8 asl = (opcode >> 15)&0x1; //accumulator select - UINT8 dpl = (opcode >> 13)&0x3; //DP low modify - UINT8 dphm = (opcode >> 9)&0xf; //DP high XOR modify - UINT8 rpdcr = (opcode >> 8)&0x1; //RP decrement - UINT8 src = (opcode >> 4)&0xf; //move source - UINT8 dst = (opcode >> 0)&0xf; //move destination +void necdsp_device::exec_op(uint32_t opcode) { + uint8_t pselect = (opcode >> 20)&0x3; //P select + uint8_t alu = (opcode >> 16)&0xf; //ALU operation mode + uint8_t asl = (opcode >> 15)&0x1; //accumulator select + uint8_t dpl = (opcode >> 13)&0x3; //DP low modify + uint8_t dphm = (opcode >> 9)&0xf; //DP high XOR modify + uint8_t rpdcr = (opcode >> 8)&0x1; //RP decrement + uint8_t src = (opcode >> 4)&0xf; //move source + uint8_t dst = (opcode >> 0)&0xf; //move destination switch(src) { case 0: regs.idb = regs.trb; break; @@ -375,7 +375,7 @@ void necdsp_device::exec_op(UINT32 opcode) { } if(alu) { - UINT16 p=0, q=0, r=0; + uint16_t p=0, q=0, r=0; Flag flag; bool c=0; @@ -474,19 +474,19 @@ void necdsp_device::exec_op(UINT32 opcode) { if(rpdcr) regs.rp--; } -void necdsp_device::exec_rt(UINT32 opcode) { +void necdsp_device::exec_rt(uint32_t opcode) { exec_op(opcode); regs.pc = regs.stack[--regs.sp]; regs.sp &= 0xf; } -void necdsp_device::exec_jp(UINT32 opcode) { - UINT16 brch = (opcode >> 13) & 0x1ff; //branch - UINT16 na = (opcode >> 2) & 0x7ff; //next address - UINT16 bank = (opcode >> 0) & 0x3; //bank address +void necdsp_device::exec_jp(uint32_t opcode) { + uint16_t brch = (opcode >> 13) & 0x1ff; //branch + uint16_t na = (opcode >> 2) & 0x7ff; //next address + uint16_t bank = (opcode >> 0) & 0x3; //bank address - UINT16 jps = (regs.pc & 0x2000) | (bank << 11) | (na << 0); - UINT16 jpl = (bank << 11) | (na << 0); + uint16_t jps = (regs.pc & 0x2000) | (bank << 11) | (na << 0); + uint16_t jpl = (bank << 11) | (na << 0); switch(brch) { case 0x000: regs.pc = regs.so; return; //JMPSO @@ -537,9 +537,9 @@ void necdsp_device::exec_jp(UINT32 opcode) { } } -void necdsp_device::exec_ld(UINT32 opcode) { - UINT16 id = opcode >> 6; //immediate data - UINT8 dst = (opcode >> 0) & 0xf; //destination +void necdsp_device::exec_ld(uint32_t opcode) { + uint16_t id = opcode >> 6; //immediate data + uint8_t dst = (opcode >> 0) & 0xf; //destination regs.idb = id; @@ -566,7 +566,7 @@ void necdsp_device::exec_ld(UINT32 opcode) { } } -UINT8 necdsp_device::snesdsp_read(bool mode) { +uint8_t necdsp_device::snesdsp_read(bool mode) { if (!mode) { return regs.sr >> 8; @@ -595,7 +595,7 @@ UINT8 necdsp_device::snesdsp_read(bool mode) { } } -void necdsp_device::snesdsp_write(bool mode, UINT8 data) { +void necdsp_device::snesdsp_write(bool mode, uint8_t data) { if (!mode) return; if (regs.sr.drc == 0) diff --git a/src/devices/cpu/upd7725/upd7725.h b/src/devices/cpu/upd7725/upd7725.h index 94a7f85869f..80714d376eb 100644 --- a/src/devices/cpu/upd7725/upd7725.h +++ b/src/devices/cpu/upd7725/upd7725.h @@ -73,7 +73,7 @@ class necdsp_device : public cpu_device { protected: // construction/destruction - necdsp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, UINT32 abits, UINT32 dbits, const char *name, const char *shortname, const char *source); + necdsp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t abits, uint32_t dbits, const char *name, const char *shortname, const char *source); public: @@ -89,8 +89,8 @@ public: //template static devcb_base &set_out_sorq_callback(device_t &device, _Object object) { return downcast(device).m_out_sorq_cb.set_callback(object); } //template static devcb_base &set_out_drq_callback(device_t &device, _Object object) { return downcast(device).m_out_drq_cb.set_callback(object); } - UINT8 snesdsp_read(bool mode); - void snesdsp_write(bool mode, UINT8 data); + uint8_t snesdsp_read(bool mode); + void snesdsp_write(bool mode, uint8_t data); protected: // device-level overrides @@ -98,9 +98,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -113,14 +113,14 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // inline data const address_space_config m_program_config, m_data_config; - UINT16 dataRAM[2048]; + uint16_t dataRAM[2048]; private: struct Flag @@ -161,32 +161,32 @@ private: struct Regs { - UINT16 pc; //program counter - UINT16 stack[16]; //LIFO - UINT16 rp; //ROM pointer - UINT16 dp; //data pointer - UINT8 sp; //stack pointer - INT16 k; - INT16 l; - INT16 m; - INT16 n; - INT16 a; //accumulator - INT16 b; //accumulator + uint16_t pc; //program counter + uint16_t stack[16]; //LIFO + uint16_t rp; //ROM pointer + uint16_t dp; //data pointer + uint8_t sp; //stack pointer + int16_t k; + int16_t l; + int16_t m; + int16_t n; + int16_t a; //accumulator + int16_t b; //accumulator Flag flaga; Flag flagb; - UINT16 tr; //temporary register - UINT16 trb; //temporary register + uint16_t tr; //temporary register + uint16_t trb; //temporary register Status sr; //status register - UINT16 dr; //data register - UINT16 si; - UINT16 so; - UINT16 idb; + uint16_t dr; //data register + uint16_t si; + uint16_t so; + uint16_t idb; } regs; - void exec_op(UINT32 opcode); - void exec_rt(UINT32 opcode); - void exec_jp(UINT32 opcode); - void exec_ld(UINT32 opcode); + void exec_op(uint32_t opcode); + void exec_rt(uint32_t opcode); + void exec_jp(uint32_t opcode); + void exec_ld(uint32_t opcode); int m_icount; int m_irq; // old irq line state, for detecting rising edges. @@ -213,17 +213,17 @@ class upd7725_device : public necdsp_device { public: // construction/destruction - upd7725_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd7725_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class upd96050_device : public necdsp_device { public: // construction/destruction - upd96050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd96050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT16 dataram_r(UINT16 addr) { return dataRAM[addr]; } - void dataram_w(UINT16 addr, UINT16 data) { dataRAM[addr] = data; } + uint16_t dataram_r(uint16_t addr) { return dataRAM[addr]; } + void dataram_w(uint16_t addr, uint16_t data) { dataRAM[addr] = data; } }; // device type definition diff --git a/src/devices/cpu/upd7810/upd7810.cpp b/src/devices/cpu/upd7810/upd7810.cpp index 9722ba360b3..ba375d196e1 100644 --- a/src/devices/cpu/upd7810/upd7810.cpp +++ b/src/devices/cpu/upd7810/upd7810.cpp @@ -381,7 +381,7 @@ const device_type UPD78C05 = &device_creator; const device_type UPD78C06 = &device_creator; -upd7810_device::upd7810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7810_device::upd7810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, UPD7810, "uPD7810", tag, owner, clock, "upd7810", __FILE__) , m_to_func(*this) , m_co0_func(*this) @@ -409,7 +409,7 @@ upd7810_device::upd7810_device(const machine_config &mconfig, const char *tag, d m_op74 = s_op74; } -upd7810_device::upd7810_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) +upd7810_device::upd7810_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_to_func(*this) , m_co0_func(*this) @@ -429,7 +429,7 @@ upd7810_device::upd7810_device(const machine_config &mconfig, device_type type, { } -upd7807_device::upd7807_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7807_device::upd7807_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd7810_device(mconfig, UPD7807, "uPD7807", tag, owner, clock, "upd7807", __FILE__) { m_opXX = s_opXX_7807; @@ -442,7 +442,7 @@ upd7807_device::upd7807_device(const machine_config &mconfig, const char *tag, d m_op74 = s_op74; } -upd7801_device::upd7801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7801_device::upd7801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd7810_device(mconfig, UPD7801, "uPD7801", tag, owner, clock, "upd7801", __FILE__) { m_op48 = s_op48_7801; @@ -455,7 +455,7 @@ upd7801_device::upd7801_device(const machine_config &mconfig, const char *tag, d m_opXX = s_opXX_7801; } -upd78c05_device::upd78c05_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd78c05_device::upd78c05_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd7810_device(mconfig, UPD78C05, "uPD78C05", tag, owner, clock, "upd78c05", __FILE__) { m_op48 = s_op48_78c05; @@ -468,12 +468,12 @@ upd78c05_device::upd78c05_device(const machine_config &mconfig, const char *tag, m_opXX = s_opXX_78c05; } -upd78c05_device::upd78c05_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) +upd78c05_device::upd78c05_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) : upd7810_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -upd78c06_device::upd78c06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd78c06_device::upd78c06_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd78c05_device(mconfig, UPD78C06, "uPD78C06", tag, owner, clock, "upd78c06", __FILE__) { m_op48 = s_op48_78c06; @@ -486,33 +486,33 @@ upd78c06_device::upd78c06_device(const machine_config &mconfig, const char *tag, m_opXX = s_opXX_78c06; } -offs_t upd7810_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t upd7810_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( upd7810 ); return CPU_DISASSEMBLE_NAME(upd7810)(this, buffer, pc, oprom, opram, options); } -offs_t upd7807_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t upd7807_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( upd7807 ); return CPU_DISASSEMBLE_NAME(upd7807)(this, buffer, pc, oprom, opram, options); } -offs_t upd7801_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t upd7801_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( upd7801 ); return CPU_DISASSEMBLE_NAME(upd7801)(this, buffer, pc, oprom, opram, options); } -offs_t upd78c05_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t upd78c05_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( upd78c05 ); return CPU_DISASSEMBLE_NAME(upd78c05)(this, buffer, pc, oprom, opram, options); } -UINT8 upd7810_device::RP(offs_t port) +uint8_t upd7810_device::RP(offs_t port) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (port) { case UPD7810_PORTA: @@ -590,7 +590,7 @@ UINT8 upd7810_device::RP(offs_t port) return data; } -void upd7810_device::WP(offs_t port, UINT8 data) +void upd7810_device::WP(offs_t port, uint8_t data) { switch (port) { @@ -669,7 +669,7 @@ void upd7810_device::WP(offs_t port, UINT8 data) void upd7810_device::upd7810_take_irq() { - UINT16 vector = 0; + uint16_t vector = 0; int irqline = 0; /* global interrupt disable? */ @@ -767,7 +767,7 @@ void upd7810_device::upd7810_take_irq() void upd7801_device::upd7810_take_irq() { - UINT16 vector = 0; + uint16_t vector = 0; int irqline = 0; /* global interrupt disable? */ @@ -999,7 +999,7 @@ void upd7810_device::upd7810_sio_input() if (m_rxcnt > 0) { RXD = m_rxd_func(); - m_rxs = (m_rxs >> 1) | ((UINT16)RXD << 15); + m_rxs = (m_rxs >> 1) | ((uint16_t)RXD << 15); m_rxcnt--; if (0 == m_rxcnt) { diff --git a/src/devices/cpu/upd7810/upd7810.h b/src/devices/cpu/upd7810/upd7810.h index d7d96be75d7..28900cb6c43 100644 --- a/src/devices/cpu/upd7810/upd7810.h +++ b/src/devices/cpu/upd7810/upd7810.h @@ -94,8 +94,8 @@ class upd7810_device : public cpu_device { public: // construction/destruction - upd7810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - upd7810_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); + upd7810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + upd7810_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_to_func(device_t &device, _Object object) { return downcast(device).m_to_func.set_callback(object); } @@ -160,9 +160,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 40; } - virtual UINT32 execute_input_lines() const override { return 2; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 40; } + virtual uint32_t execute_input_lines() const override { return 2; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -173,9 +173,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void handle_timers(int cycles); virtual void upd7810_take_irq(); @@ -204,10 +204,10 @@ protected: struct opcode_s { opcode_func opfunc; - UINT8 oplen; - UINT8 cycles; - UINT8 cycles_skip; - UINT8 mask_l0_l1; + uint8_t oplen; + uint8_t cycles; + uint8_t cycles_skip; + uint8_t mask_l0_l1; }; static const struct opcode_s s_op48[256]; @@ -250,10 +250,10 @@ protected: PAIR m_ppc; /* previous program counter */ PAIR m_pc; /* program counter */ PAIR m_sp; /* stack pointer */ - UINT8 m_op; /* opcode */ - UINT8 m_op2; /* opcode part 2 */ - UINT8 m_iff; /* interrupt enable flip flop */ - UINT8 m_psw; /* processor status word */ + uint8_t m_op; /* opcode */ + uint8_t m_op2; /* opcode part 2 */ + uint8_t m_iff; /* interrupt enable flip flop */ + uint8_t m_psw; /* processor status word */ PAIR m_ea; /* extended accumulator */ PAIR m_va; /* accumulator + vector register */ PAIR m_bc; /* 8bit B and C registers / 16bit BC register */ @@ -268,69 +268,69 @@ protected: PAIR m_tm; /* 8 bit timer 0/1 comparator inputs */ PAIR m_ecnt; /* timer counter register / capture register */ PAIR m_etm; /* timer 0/1 comparator inputs */ - UINT8 m_ma; /* port A input or output mask */ - UINT8 m_mb; /* port B input or output mask */ - UINT8 m_mcc; /* port C control/port select */ - UINT8 m_mc; /* port C input or output mask */ - UINT8 m_mm; /* memory mapping */ - UINT8 m_mf; /* port F input or output mask */ - UINT8 m_tmm; /* timer 0 and timer 1 operating parameters */ - UINT8 m_etmm; /* 16-bit multifunction timer/event counter */ - UINT8 m_eom; /* 16-bit timer/event counter output control */ - UINT8 m_sml; /* serial interface parameters low */ - UINT8 m_smh; /* -"- high */ - UINT8 m_panm; /* previous analog to digital converter operating parameters */ - UINT8 m_anm; /* analog to digital converter operating parameters */ - UINT8 m_mkl; /* interrupt mask low */ - UINT8 m_mkh; /* -"- high */ - UINT8 m_zcm; /* bias circuitry for ac zero-cross detection */ - UINT8 m_pa_in; /* port A,B,C,D,F inputs */ - UINT8 m_pb_in; - UINT8 m_pc_in; - UINT8 m_pd_in; - UINT8 m_pf_in; - UINT8 m_pa_out; /* port A,B,C,D,F outputs */ - UINT8 m_pb_out; - UINT8 m_pc_out; - UINT8 m_pd_out; - UINT8 m_pf_out; - UINT8 m_cr0; /* analog digital conversion register 0 */ - UINT8 m_cr1; /* analog digital conversion register 1 */ - UINT8 m_cr2; /* analog digital conversion register 2 */ - UINT8 m_cr3; /* analog digital conversion register 3 */ - UINT8 m_txb; /* transmitter buffer */ - UINT8 m_rxb; /* receiver buffer */ - UINT8 m_txd; /* port C control line states */ - UINT8 m_rxd; - UINT8 m_sck; - UINT8 m_ti; - UINT8 m_to; - UINT8 m_ci; - UINT8 m_lv0; /* level flip flop for co0 */ - UINT8 m_lv1; /* level flip flop for co1 */ - UINT8 m_co0; - UINT8 m_co1; - UINT16 m_irr; /* interrupt request register */ - UINT16 m_itf; /* interrupt test flag register */ + uint8_t m_ma; /* port A input or output mask */ + uint8_t m_mb; /* port B input or output mask */ + uint8_t m_mcc; /* port C control/port select */ + uint8_t m_mc; /* port C input or output mask */ + uint8_t m_mm; /* memory mapping */ + uint8_t m_mf; /* port F input or output mask */ + uint8_t m_tmm; /* timer 0 and timer 1 operating parameters */ + uint8_t m_etmm; /* 16-bit multifunction timer/event counter */ + uint8_t m_eom; /* 16-bit timer/event counter output control */ + uint8_t m_sml; /* serial interface parameters low */ + uint8_t m_smh; /* -"- high */ + uint8_t m_panm; /* previous analog to digital converter operating parameters */ + uint8_t m_anm; /* analog to digital converter operating parameters */ + uint8_t m_mkl; /* interrupt mask low */ + uint8_t m_mkh; /* -"- high */ + uint8_t m_zcm; /* bias circuitry for ac zero-cross detection */ + uint8_t m_pa_in; /* port A,B,C,D,F inputs */ + uint8_t m_pb_in; + uint8_t m_pc_in; + uint8_t m_pd_in; + uint8_t m_pf_in; + uint8_t m_pa_out; /* port A,B,C,D,F outputs */ + uint8_t m_pb_out; + uint8_t m_pc_out; + uint8_t m_pd_out; + uint8_t m_pf_out; + uint8_t m_cr0; /* analog digital conversion register 0 */ + uint8_t m_cr1; /* analog digital conversion register 1 */ + uint8_t m_cr2; /* analog digital conversion register 2 */ + uint8_t m_cr3; /* analog digital conversion register 3 */ + uint8_t m_txb; /* transmitter buffer */ + uint8_t m_rxb; /* receiver buffer */ + uint8_t m_txd; /* port C control line states */ + uint8_t m_rxd; + uint8_t m_sck; + uint8_t m_ti; + uint8_t m_to; + uint8_t m_ci; + uint8_t m_lv0; /* level flip flop for co0 */ + uint8_t m_lv1; /* level flip flop for co1 */ + uint8_t m_co0; + uint8_t m_co1; + uint16_t m_irr; /* interrupt request register */ + uint16_t m_itf; /* interrupt test flag register */ int m_nmi; /* keep track of current nmi state. Needed for 7810 irq checking. */ int m_int1; /* keep track of current int1 state. Needed for irq checking. */ int m_int2; /* keep track to current int2 state. Needed for irq checking. */ /* internal helper variables */ - UINT16 m_txs; /* transmitter shift register */ - UINT16 m_rxs; /* receiver shift register */ - UINT8 m_txcnt; /* transmitter shift register bit count */ - UINT8 m_rxcnt; /* receiver shift register bit count */ - UINT8 m_txbuf; /* transmitter buffer was written */ - INT32 m_ovc0; /* overflow counter for timer 0 (for clock div 12/384) */ - INT32 m_ovc1; /* overflow counter for timer 0 (for clock div 12/384) */ - INT32 m_ovce; /* overflow counter for ecnt */ - INT32 m_ovcf; /* overflow counter for fixed clock div 3 mode */ - INT32 m_ovcs; /* overflow counter for serial I/O */ - UINT8 m_edges; /* rising/falling edge flag for serial I/O */ - UINT16 m_adcnt; /* A/D converter cycle count */ - UINT8 m_adtot; /* A/D converter total cycles per conversion */ - UINT8 m_tmpcr; /* temporary analog digital conversion register */ + uint16_t m_txs; /* transmitter shift register */ + uint16_t m_rxs; /* receiver shift register */ + uint8_t m_txcnt; /* transmitter shift register bit count */ + uint8_t m_rxcnt; /* receiver shift register bit count */ + uint8_t m_txbuf; /* transmitter buffer was written */ + int32_t m_ovc0; /* overflow counter for timer 0 (for clock div 12/384) */ + int32_t m_ovc1; /* overflow counter for timer 0 (for clock div 12/384) */ + int32_t m_ovce; /* overflow counter for ecnt */ + int32_t m_ovcf; /* overflow counter for fixed clock div 3 mode */ + int32_t m_ovcs; /* overflow counter for serial I/O */ + uint8_t m_edges; /* rising/falling edge flag for serial I/O */ + uint16_t m_adcnt; /* A/D converter cycle count */ + uint8_t m_adtot; /* A/D converter total cycles per conversion */ + uint8_t m_tmpcr; /* temporary analog digital conversion register */ int m_shdone; /* A/D converter sample and hold done */ int m_adout; /* currently selected A/D converter output register */ int m_adin; /* currently selected A/D converter input */ @@ -349,8 +349,8 @@ protected: address_space *m_io; int m_icount; - UINT8 RP(offs_t port); - void WP(offs_t port, UINT8 data); + uint8_t RP(offs_t port); + void WP(offs_t port, uint8_t data); void upd7810_write_EOM(); void upd7810_write_TXB(); void upd7810_sio_output(); @@ -1373,10 +1373,10 @@ class upd7807_device : public upd7810_device { public: // construction/destruction - upd7807_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd7807_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; @@ -1384,12 +1384,12 @@ class upd7801_device : public upd7810_device { public: // construction/destruction - upd7801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd7801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_reset() override; virtual void execute_set_input(int inputnum, int state) override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void handle_timers(int cycles) override; virtual void upd7810_take_irq() override; }; @@ -1399,15 +1399,15 @@ class upd78c05_device : public upd7810_device { public: // construction/destruction - upd78c05_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - upd78c05_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); + upd78c05_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + upd78c05_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: virtual void device_start() override; virtual void device_reset() override; - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 4 - 1) / 4; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 4); } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 4 - 1) / 4; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 4); } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; virtual void handle_timers(int cycles) override; }; @@ -1416,7 +1416,7 @@ class upd78c06_device : public upd78c05_device { public: // construction/destruction - upd78c06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd78c06_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/cpu/upd7810/upd7810_dasm.cpp b/src/devices/cpu/upd7810/upd7810_dasm.cpp index c39cf0c1efc..0beed6a01d3 100644 --- a/src/devices/cpu/upd7810/upd7810_dasm.cpp +++ b/src/devices/cpu/upd7810/upd7810_dasm.cpp @@ -24,7 +24,7 @@ public: bool is_call() const { return (m_token == CALB) || (m_token == CALF) || (m_token == CALL) || (m_token == CALT); } bool is_return() const { return (m_token == RET) || (m_token == RETI); } - const dasm_s &prefix_get(UINT8 op) const { assert(m_token == prefix); return reinterpret_cast(m_args)[op]; } + const dasm_s &prefix_get(uint8_t op) const { assert(m_token == prefix); return reinterpret_cast(m_args)[op]; } static const dasm_s XX_7810[256]; static const dasm_s XX_7807[256]; @@ -214,10 +214,10 @@ protected: }; dasm_s() : m_token(illegal), m_args(nullptr) { } - dasm_s(UINT8 t, const char *a) : m_token(t), m_args(a) { } + dasm_s(uint8_t t, const char *a) : m_token(t), m_args(a) { } dasm_s(const dasm_s (&a)[256]) : m_token(prefix), m_args(a) { } - UINT8 m_token; + uint8_t m_token; const void *m_args; static const char *const token_names[]; @@ -5416,20 +5416,20 @@ const char *const regname[32] = "illegal", "TMM", "PT", "illegal" }; -offs_t Dasm( char *buffer, offs_t pc, const dasm_s (&dasmXX)[256], const UINT8 *oprom, const UINT8 *opram, int is_7810 ) +offs_t Dasm( char *buffer, offs_t pc, const dasm_s (&dasmXX)[256], const uint8_t *oprom, const uint8_t *opram, int is_7810 ) { unsigned idx = 0; - const UINT8 op = oprom[idx++]; + const uint8_t op = oprom[idx++]; const dasm_s *desc = &dasmXX[op]; if (desc->is_prefix()) desc = &desc->prefix_get(oprom[idx++]); buffer += sprintf(buffer, "%-8.8s", desc->name()); - UINT32 flags = desc->is_call() ? DASMFLAG_STEP_OVER : desc->is_return() ? DASMFLAG_STEP_OUT : 0; - UINT8 op2; + uint32_t flags = desc->is_call() ? DASMFLAG_STEP_OVER : desc->is_return() ? DASMFLAG_STEP_OUT : 0; + uint8_t op2; int offset; - UINT16 ea; + uint16_t ea; for (const char *a = desc->args(); a && *a; a++) { diff --git a/src/devices/cpu/upd7810/upd7810_opcodes.cpp b/src/devices/cpu/upd7810/upd7810_opcodes.cpp index ab4589222c1..6ee8d02d688 100644 --- a/src/devices/cpu/upd7810/upd7810_opcodes.cpp +++ b/src/devices/cpu/upd7810/upd7810_opcodes.cpp @@ -220,7 +220,7 @@ void upd7810_device::MUL_C() /* 48 31: 0100 1000 0011 0001 */ void upd7810_device::RLR_A() { - UINT8 carry=(PSW&CY)<<7; + uint8_t carry=(PSW&CY)<<7; PSW = (PSW & ~CY) | (A & CY); A = (A >> 1) | carry; } @@ -228,7 +228,7 @@ void upd7810_device::RLR_A() /* 48 32: 0100 1000 0011 0010 */ void upd7810_device::RLR_B() { - UINT8 carry=(PSW&CY)<<7; + uint8_t carry=(PSW&CY)<<7; PSW = (PSW & ~CY) | (B & CY); B = (B >> 1) | carry; } @@ -236,7 +236,7 @@ void upd7810_device::RLR_B() /* 48 33: 0100 1000 0011 0011 */ void upd7810_device::RLR_C() { - UINT8 carry=(PSW&CY)<<7; + uint8_t carry=(PSW&CY)<<7; PSW = (PSW & ~CY) | (C & CY); C = (C >> 1) | carry; } @@ -244,7 +244,7 @@ void upd7810_device::RLR_C() /* 48 35: 0100 1000 0011 0101 */ void upd7810_device::RLL_A() { - UINT8 carry=PSW&CY; + uint8_t carry=PSW&CY; PSW = (PSW & ~CY) | ((A >> 7) & CY); A = (A << 1) | carry; } @@ -252,7 +252,7 @@ void upd7810_device::RLL_A() /* 48 36: 0100 1000 0011 0110 */ void upd7810_device::RLL_B() { - UINT8 carry=PSW&CY; + uint8_t carry=PSW&CY; PSW = (PSW & ~CY) | ((B >> 7) & CY); B = (B << 1) | carry; } @@ -260,7 +260,7 @@ void upd7810_device::RLL_B() /* 48 37: 0100 1000 0011 0111 */ void upd7810_device::RLL_C() { - UINT8 carry=PSW&CY; + uint8_t carry=PSW&CY; PSW = (PSW & ~CY) | ((C >> 7) & CY); C = (C << 1) | carry; } @@ -268,7 +268,7 @@ void upd7810_device::RLL_C() /* 48 38: 0100 1000 0011 1000 */ void upd7810_device::RLD() { - UINT8 m = RM( HL ), tmp; + uint8_t m = RM( HL ), tmp; tmp = (m << 4) | (A & 0x0f); A = (A & 0xf0) | (m >> 4); WM( HL, tmp ); @@ -277,7 +277,7 @@ void upd7810_device::RLD() /* 48 39: 0100 1000 0011 1001 */ void upd7810_device::RRD() { - UINT8 m = RM( HL ), tmp; + uint8_t m = RM( HL ), tmp; tmp = (A << 4) | (m >> 4); A = (A & 0xf0) | (m & 0x0f); WM( HL, tmp ); @@ -303,7 +303,7 @@ void upd7810_device::DIV_A() { if (A) { - UINT8 remainder; + uint8_t remainder; remainder = EA % A; EA /= A; A = remainder; @@ -317,7 +317,7 @@ void upd7810_device::DIV_B() { if (B) { - UINT8 remainder; + uint8_t remainder; remainder = EA % B; EA /= B; B = remainder; @@ -331,7 +331,7 @@ void upd7810_device::DIV_C() { if (C) { - UINT8 remainder; + uint8_t remainder; remainder = EA % C; EA /= C; C = remainder; @@ -661,7 +661,7 @@ void upd7810_device::LDEAX_Hp() /* 48 8b: 0100 1000 1000 1011 xxxx xxxx */ void upd7810_device::LDEAX_D_xx() { - UINT16 ea; + uint16_t ea; RDOPARG( ea ); ea += DE; EAL = RM( ea ); @@ -671,7 +671,7 @@ void upd7810_device::LDEAX_D_xx() /* 48 8c: 0100 1000 1000 1100 */ void upd7810_device::LDEAX_H_A() { - UINT16 ea = HL + A; + uint16_t ea = HL + A; EAL = RM( ea ); EAH = RM( ea + 1 ); } @@ -679,7 +679,7 @@ void upd7810_device::LDEAX_H_A() /* 48 8d: 0100 1000 1000 1101 */ void upd7810_device::LDEAX_H_B() { - UINT16 ea = HL + B; + uint16_t ea = HL + B; EAL = RM( ea ); EAH = RM( ea + 1 ); } @@ -687,7 +687,7 @@ void upd7810_device::LDEAX_H_B() /* 48 8e: 0100 1000 1000 1110 */ void upd7810_device::LDEAX_H_EA() { - UINT16 ea = HL + EA; + uint16_t ea = HL + EA; EAL = RM( ea ); EAH = RM( ea + 1 ); } @@ -695,7 +695,7 @@ void upd7810_device::LDEAX_H_EA() /* 48 8f: 0100 1000 1000 1111 xxxx xxxx */ void upd7810_device::LDEAX_H_xx() { - UINT16 ea; + uint16_t ea; RDOPARG( ea ); ea += HL; EAL = RM( ea ); @@ -735,7 +735,7 @@ void upd7810_device::STEAX_Hp() /* 48 9b: 0100 1000 1000 1011 xxxx xxxx */ void upd7810_device::STEAX_D_xx() { - UINT16 ea; + uint16_t ea; RDOPARG( ea ); ea += DE; WM( ea, EAL ); @@ -745,7 +745,7 @@ void upd7810_device::STEAX_D_xx() /* 48 9c: 0100 1000 1000 1100 */ void upd7810_device::STEAX_H_A() { - UINT16 ea = HL + A; + uint16_t ea = HL + A; WM( ea, EAL ); WM( ea + 1, EAH ); } @@ -753,7 +753,7 @@ void upd7810_device::STEAX_H_A() /* 48 9d: 0100 1000 1000 1101 */ void upd7810_device::STEAX_H_B() { - UINT16 ea = HL + B; + uint16_t ea = HL + B; WM( ea, EAL ); WM( ea + 1, EAH ); } @@ -761,7 +761,7 @@ void upd7810_device::STEAX_H_B() /* 48 9e: 0100 1000 1000 1110 */ void upd7810_device::STEAX_H_EA() { - UINT16 ea = HL + EA; + uint16_t ea = HL + EA; WM( ea, EAL ); WM( ea + 1, EAH ); } @@ -769,7 +769,7 @@ void upd7810_device::STEAX_H_EA() /* 48 9f: 0100 1000 1000 1111 xxxx xxxx */ void upd7810_device::STEAX_H_xx() { - UINT16 ea; + uint16_t ea; RDOPARG( ea ); ea += HL; WM( ea, EAL ); @@ -793,7 +793,7 @@ void upd7810_device::DSLL_EA() /* 48 a8: 0100 1000 1010 1000 */ void upd7810_device::TABLE() { - UINT16 ea = PC + A + 1; + uint16_t ea = PC + A + 1; C = RM( ea ); B = RM( ea + 1 ); } @@ -801,7 +801,7 @@ void upd7810_device::TABLE() /* 48 b0: 0100 1000 1011 0000 */ void upd7810_device::DRLR_EA() { - UINT8 carry=PSW&CY; + uint8_t carry=PSW&CY; PSW = (PSW & ~CY) | (EA & CY); EA = (EA >> 1) | (carry << 15); } @@ -809,7 +809,7 @@ void upd7810_device::DRLR_EA() /* 48 b4: 0100 1000 1011 0100 */ void upd7810_device::DRLL_EA() { - UINT8 carry=PSW&CY; + uint8_t carry=PSW&CY; PSW = (PSW & ~CY) | ((EA >> 15) & CY); EA = (EA << 1) | carry; } @@ -906,7 +906,7 @@ void upd7810_device::MOV_A_SMH() void upd7810_device::MOV_A_EOM() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; + uint8_t eom = EOM & 0x22; A = eom; } @@ -1265,7 +1265,7 @@ void upd7810_device::ORA_L_A() /* 60 20: 0110 0000 0010 0000 */ void upd7810_device::ADDNC_V_A() { - UINT8 tmp = V + A; + uint8_t tmp = V + A; ZHC_ADD( tmp, V, 0 ); V = tmp; SKIP_NC; @@ -1274,7 +1274,7 @@ void upd7810_device::ADDNC_V_A() /* 60 21: 0110 0000 0010 0001 */ void upd7810_device::ADDNC_A_A() { - UINT8 tmp = A + A; + uint8_t tmp = A + A; ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -1283,7 +1283,7 @@ void upd7810_device::ADDNC_A_A() /* 60 22: 0110 0000 0010 0010 */ void upd7810_device::ADDNC_B_A() { - UINT8 tmp = B + A; + uint8_t tmp = B + A; ZHC_ADD( tmp, B, 0 ); B = tmp; SKIP_NC; @@ -1292,7 +1292,7 @@ void upd7810_device::ADDNC_B_A() /* 60 23: 0110 0000 0010 0011 */ void upd7810_device::ADDNC_C_A() { - UINT8 tmp = C + A; + uint8_t tmp = C + A; ZHC_ADD( tmp, C, 0 ); C = tmp; SKIP_NC; @@ -1301,7 +1301,7 @@ void upd7810_device::ADDNC_C_A() /* 60 24: 0110 0000 0010 0100 */ void upd7810_device::ADDNC_D_A() { - UINT8 tmp = D + A; + uint8_t tmp = D + A; ZHC_ADD( tmp, D, 0 ); D = tmp; SKIP_NC; @@ -1310,7 +1310,7 @@ void upd7810_device::ADDNC_D_A() /* 60 25: 0110 0000 0010 0101 */ void upd7810_device::ADDNC_E_A() { - UINT8 tmp = E + A; + uint8_t tmp = E + A; ZHC_ADD( tmp, E, 0 ); E = tmp; SKIP_NC; @@ -1319,7 +1319,7 @@ void upd7810_device::ADDNC_E_A() /* 60 26: 0110 0000 0010 0110 */ void upd7810_device::ADDNC_H_A() { - UINT8 tmp = H + A; + uint8_t tmp = H + A; ZHC_ADD( tmp, H, 0 ); H = tmp; SKIP_NC; @@ -1328,7 +1328,7 @@ void upd7810_device::ADDNC_H_A() /* 60 27: 0110 0000 0010 0111 */ void upd7810_device::ADDNC_L_A() { - UINT8 tmp = L + A; + uint8_t tmp = L + A; ZHC_ADD( tmp, L, 0 ); L = tmp; SKIP_NC; @@ -1337,7 +1337,7 @@ void upd7810_device::ADDNC_L_A() /* 60 28: 0110 0000 0010 1000 */ void upd7810_device::GTA_V_A() { - UINT16 tmp = V - A - 1; + uint16_t tmp = V - A - 1; ZHC_SUB( tmp, V, 0 ); SKIP_NC; } @@ -1345,7 +1345,7 @@ void upd7810_device::GTA_V_A() /* 60 29: 0110 0000 0010 1001 */ void upd7810_device::GTA_A_A() { - UINT16 tmp = A - A - 1; + uint16_t tmp = A - A - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -1353,7 +1353,7 @@ void upd7810_device::GTA_A_A() /* 60 2a: 0110 0000 0010 1010 */ void upd7810_device::GTA_B_A() { - UINT16 tmp = B - A - 1; + uint16_t tmp = B - A - 1; ZHC_SUB( tmp, B, 0 ); SKIP_NC; } @@ -1361,7 +1361,7 @@ void upd7810_device::GTA_B_A() /* 60 2b: 0110 0000 0010 1011 */ void upd7810_device::GTA_C_A() { - UINT16 tmp = C - A - 1; + uint16_t tmp = C - A - 1; ZHC_SUB( tmp, C, 0 ); SKIP_NC; } @@ -1369,7 +1369,7 @@ void upd7810_device::GTA_C_A() /* 60 2c: 0110 0000 0010 1100 */ void upd7810_device::GTA_D_A() { - UINT16 tmp = D - A - 1; + uint16_t tmp = D - A - 1; ZHC_SUB( tmp, D, 0 ); SKIP_NC; } @@ -1377,7 +1377,7 @@ void upd7810_device::GTA_D_A() /* 60 2d: 0110 0000 0010 1101 */ void upd7810_device::GTA_E_A() { - UINT16 tmp = E - A - 1; + uint16_t tmp = E - A - 1; ZHC_SUB( tmp, E, 0 ); SKIP_NC; } @@ -1385,7 +1385,7 @@ void upd7810_device::GTA_E_A() /* 60 2e: 0110 0000 0010 1110 */ void upd7810_device::GTA_H_A() { - UINT16 tmp = H - A - 1; + uint16_t tmp = H - A - 1; ZHC_SUB( tmp, H, 0 ); SKIP_NC; } @@ -1393,7 +1393,7 @@ void upd7810_device::GTA_H_A() /* 60 2f: 0110 0000 0010 1111 */ void upd7810_device::GTA_L_A() { - UINT16 tmp = L - A - 1; + uint16_t tmp = L - A - 1; ZHC_SUB( tmp, L, 0 ); SKIP_NC; } @@ -1401,7 +1401,7 @@ void upd7810_device::GTA_L_A() /* 60 30: 0110 0000 0011 0000 */ void upd7810_device::SUBNB_V_A() { - UINT8 tmp = V - A; + uint8_t tmp = V - A; ZHC_SUB( tmp, V, 0 ); V = tmp; SKIP_NC; @@ -1410,7 +1410,7 @@ void upd7810_device::SUBNB_V_A() /* 60 31: 0110 0000 0011 0001 */ void upd7810_device::SUBNB_A_A() { - UINT8 tmp = A - A; + uint8_t tmp = A - A; ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -1419,7 +1419,7 @@ void upd7810_device::SUBNB_A_A() /* 60 32: 0110 0000 0011 0010 */ void upd7810_device::SUBNB_B_A() { - UINT8 tmp = B - A; + uint8_t tmp = B - A; ZHC_SUB( tmp, B, 0 ); B = tmp; SKIP_NC; @@ -1428,7 +1428,7 @@ void upd7810_device::SUBNB_B_A() /* 60 33: 0110 0000 0011 0011 */ void upd7810_device::SUBNB_C_A() { - UINT8 tmp = C - A; + uint8_t tmp = C - A; ZHC_SUB( tmp, C, 0 ); C = tmp; SKIP_NC; @@ -1437,7 +1437,7 @@ void upd7810_device::SUBNB_C_A() /* 60 34: 0110 0000 0011 0100 */ void upd7810_device::SUBNB_D_A() { - UINT8 tmp = D - A; + uint8_t tmp = D - A; ZHC_SUB( tmp, D, 0 ); D = tmp; SKIP_NC; @@ -1446,7 +1446,7 @@ void upd7810_device::SUBNB_D_A() /* 60 35: 0110 0000 0011 0101 */ void upd7810_device::SUBNB_E_A() { - UINT8 tmp = E - A; + uint8_t tmp = E - A; ZHC_SUB( tmp, E, 0 ); E = tmp; SKIP_NC; @@ -1455,7 +1455,7 @@ void upd7810_device::SUBNB_E_A() /* 60 36: 0110 0000 0011 0110 */ void upd7810_device::SUBNB_H_A() { - UINT8 tmp = H - A; + uint8_t tmp = H - A; ZHC_SUB( tmp, H, 0 ); H = tmp; SKIP_NC; @@ -1464,7 +1464,7 @@ void upd7810_device::SUBNB_H_A() /* 60 37: 0110 0000 0011 0111 */ void upd7810_device::SUBNB_L_A() { - UINT8 tmp = L - A; + uint8_t tmp = L - A; ZHC_SUB( tmp, L, 0 ); L = tmp; SKIP_NC; @@ -1473,7 +1473,7 @@ void upd7810_device::SUBNB_L_A() /* 60 38: 0110 0000 0011 1000 */ void upd7810_device::LTA_V_A() { - UINT8 tmp = V - A; + uint8_t tmp = V - A; ZHC_SUB( tmp, V, 0 ); SKIP_CY; } @@ -1481,7 +1481,7 @@ void upd7810_device::LTA_V_A() /* 60 39: 0110 0000 0011 1001 */ void upd7810_device::LTA_A_A() { - UINT8 tmp = A - A; + uint8_t tmp = A - A; ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -1489,7 +1489,7 @@ void upd7810_device::LTA_A_A() /* 60 3a: 0110 0000 0011 1010 */ void upd7810_device::LTA_B_A() { - UINT8 tmp = B - A; + uint8_t tmp = B - A; ZHC_SUB( tmp, B, 0 ); SKIP_CY; } @@ -1497,7 +1497,7 @@ void upd7810_device::LTA_B_A() /* 60 3b: 0110 0000 0011 1011 */ void upd7810_device::LTA_C_A() { - UINT8 tmp = C - A; + uint8_t tmp = C - A; ZHC_SUB( tmp, C, 0 ); SKIP_CY; } @@ -1505,7 +1505,7 @@ void upd7810_device::LTA_C_A() /* 60 3c: 0110 0000 0011 1100 */ void upd7810_device::LTA_D_A() { - UINT8 tmp = D - A; + uint8_t tmp = D - A; ZHC_SUB( tmp, D, 0 ); SKIP_CY; } @@ -1513,7 +1513,7 @@ void upd7810_device::LTA_D_A() /* 60 3d: 0110 0000 0011 1101 */ void upd7810_device::LTA_E_A() { - UINT8 tmp = E - A; + uint8_t tmp = E - A; ZHC_SUB( tmp, E, 0 ); SKIP_CY; } @@ -1521,7 +1521,7 @@ void upd7810_device::LTA_E_A() /* 60 3e: 0110 0000 0011 1110 */ void upd7810_device::LTA_H_A() { - UINT8 tmp = H - A; + uint8_t tmp = H - A; ZHC_SUB( tmp, H, 0 ); SKIP_CY; } @@ -1529,7 +1529,7 @@ void upd7810_device::LTA_H_A() /* 60 3f: 0110 0000 0011 1111 */ void upd7810_device::LTA_L_A() { - UINT8 tmp = L - A; + uint8_t tmp = L - A; ZHC_SUB( tmp, L, 0 ); SKIP_CY; } @@ -1537,7 +1537,7 @@ void upd7810_device::LTA_L_A() /* 60 40: 0110 0000 0100 0000 */ void upd7810_device::ADD_V_A() { - UINT8 tmp = V + A; + uint8_t tmp = V + A; ZHC_ADD( tmp, V, 0 ); V = tmp; } @@ -1545,7 +1545,7 @@ void upd7810_device::ADD_V_A() /* 60 41: 0110 0000 0100 0001 */ void upd7810_device::ADD_A_A() { - UINT8 tmp = A + A; + uint8_t tmp = A + A; ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -1553,7 +1553,7 @@ void upd7810_device::ADD_A_A() /* 60 42: 0110 0000 0100 0010 */ void upd7810_device::ADD_B_A() { - UINT8 tmp = B + A; + uint8_t tmp = B + A; ZHC_ADD( tmp, B, 0 ); B = tmp; } @@ -1561,7 +1561,7 @@ void upd7810_device::ADD_B_A() /* 60 43: 0110 0000 0100 0011 */ void upd7810_device::ADD_C_A() { - UINT8 tmp = C + A; + uint8_t tmp = C + A; ZHC_ADD( tmp, C, 0 ); C = tmp; } @@ -1569,7 +1569,7 @@ void upd7810_device::ADD_C_A() /* 60 44: 0110 0000 0100 0100 */ void upd7810_device::ADD_D_A() { - UINT8 tmp = D + A; + uint8_t tmp = D + A; ZHC_ADD( tmp, D, 0 ); D = tmp; } @@ -1577,7 +1577,7 @@ void upd7810_device::ADD_D_A() /* 60 45: 0110 0000 0100 0101 */ void upd7810_device::ADD_E_A() { - UINT8 tmp = E + A; + uint8_t tmp = E + A; ZHC_ADD( tmp, E, 0 ); E = tmp; } @@ -1585,7 +1585,7 @@ void upd7810_device::ADD_E_A() /* 60 46: 0110 0000 0100 0110 */ void upd7810_device::ADD_H_A() { - UINT8 tmp = H + A; + uint8_t tmp = H + A; ZHC_ADD( tmp, H, 0 ); H = tmp; } @@ -1593,7 +1593,7 @@ void upd7810_device::ADD_H_A() /* 60 47: 0110 0000 0100 0111 */ void upd7810_device::ADD_L_A() { - UINT8 tmp = L + A; + uint8_t tmp = L + A; ZHC_ADD( tmp, L, 0 ); L = tmp; } @@ -1601,7 +1601,7 @@ void upd7810_device::ADD_L_A() /* 60 50: 0110 0000 0101 0000 */ void upd7810_device::ADC_V_A() { - UINT8 tmp = V + A + (PSW & CY); + uint8_t tmp = V + A + (PSW & CY); ZHC_ADD( tmp, V, (PSW & CY) ); V = tmp; } @@ -1609,7 +1609,7 @@ void upd7810_device::ADC_V_A() /* 60 51: 0110 0000 0101 0001 */ void upd7810_device::ADC_A_A() { - UINT8 tmp = A + A + (PSW & CY); + uint8_t tmp = A + A + (PSW & CY); ZHC_ADD( tmp, A, (PSW & CY) ); A = tmp; } @@ -1617,7 +1617,7 @@ void upd7810_device::ADC_A_A() /* 60 52: 0110 0000 0101 0010 */ void upd7810_device::ADC_B_A() { - UINT8 tmp = B + A + (PSW & CY); + uint8_t tmp = B + A + (PSW & CY); ZHC_ADD( tmp, B, (PSW & CY) ); B = tmp; } @@ -1625,7 +1625,7 @@ void upd7810_device::ADC_B_A() /* 60 53: 0110 0000 0101 0011 */ void upd7810_device::ADC_C_A() { - UINT8 tmp = C + A + (PSW & CY); + uint8_t tmp = C + A + (PSW & CY); ZHC_ADD( tmp, C, (PSW & CY) ); C = tmp; } @@ -1633,7 +1633,7 @@ void upd7810_device::ADC_C_A() /* 60 54: 0110 0000 0101 0100 */ void upd7810_device::ADC_D_A() { - UINT8 tmp = D + A + (PSW & CY); + uint8_t tmp = D + A + (PSW & CY); ZHC_ADD( tmp, D, (PSW & CY) ); D = tmp; } @@ -1641,7 +1641,7 @@ void upd7810_device::ADC_D_A() /* 60 55: 0110 0000 0101 0101 */ void upd7810_device::ADC_E_A() { - UINT8 tmp = E + A + (PSW & CY); + uint8_t tmp = E + A + (PSW & CY); ZHC_ADD( tmp, E, (PSW & CY) ); E = tmp; } @@ -1649,7 +1649,7 @@ void upd7810_device::ADC_E_A() /* 60 56: 0110 0000 0101 0110 */ void upd7810_device::ADC_H_A() { - UINT8 tmp = H + A + (PSW & CY); + uint8_t tmp = H + A + (PSW & CY); ZHC_ADD( tmp, H, (PSW & CY) ); H = tmp; } @@ -1657,7 +1657,7 @@ void upd7810_device::ADC_H_A() /* 60 57: 0110 0000 0101 0111 */ void upd7810_device::ADC_L_A() { - UINT8 tmp = L + A + (PSW & CY); + uint8_t tmp = L + A + (PSW & CY); ZHC_ADD( tmp, L, (PSW & CY) ); L = tmp; } @@ -1665,7 +1665,7 @@ void upd7810_device::ADC_L_A() /* 60 60: 0110 0000 0110 0000 */ void upd7810_device::SUB_V_A() { - UINT8 tmp = V - A; + uint8_t tmp = V - A; ZHC_SUB( tmp, V, 0 ); V = tmp; } @@ -1673,7 +1673,7 @@ void upd7810_device::SUB_V_A() /* 60 61: 0110 0000 0110 0001 */ void upd7810_device::SUB_A_A() { - UINT8 tmp = A - A; + uint8_t tmp = A - A; ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -1681,7 +1681,7 @@ void upd7810_device::SUB_A_A() /* 60 62: 0110 0000 0110 0010 */ void upd7810_device::SUB_B_A() { - UINT8 tmp = B - A; + uint8_t tmp = B - A; ZHC_SUB( tmp, B, 0 ); B = tmp; } @@ -1689,7 +1689,7 @@ void upd7810_device::SUB_B_A() /* 60 63: 0110 0000 0110 0011 */ void upd7810_device::SUB_C_A() { - UINT8 tmp = C - A; + uint8_t tmp = C - A; ZHC_SUB( tmp, C, 0 ); C = tmp; } @@ -1697,7 +1697,7 @@ void upd7810_device::SUB_C_A() /* 60 64: 0110 0000 0110 0100 */ void upd7810_device::SUB_D_A() { - UINT8 tmp = D - A; + uint8_t tmp = D - A; ZHC_SUB( tmp, D, 0 ); D = tmp; } @@ -1705,7 +1705,7 @@ void upd7810_device::SUB_D_A() /* 60 65: 0110 0000 0110 0101 */ void upd7810_device::SUB_E_A() { - UINT8 tmp = E - A; + uint8_t tmp = E - A; ZHC_SUB( tmp, E, 0 ); E = tmp; } @@ -1713,7 +1713,7 @@ void upd7810_device::SUB_E_A() /* 60 66: 0110 0000 0110 0110 */ void upd7810_device::SUB_H_A() { - UINT8 tmp = H - A; + uint8_t tmp = H - A; ZHC_SUB( tmp, H, 0 ); H = tmp; } @@ -1721,7 +1721,7 @@ void upd7810_device::SUB_H_A() /* 60 67: 0110 0000 0110 0111 */ void upd7810_device::SUB_L_A() { - UINT8 tmp = L - A; + uint8_t tmp = L - A; ZHC_SUB( tmp, L, 0 ); L = tmp; } @@ -1729,7 +1729,7 @@ void upd7810_device::SUB_L_A() /* 60 68: 0110 0000 0110 1000 */ void upd7810_device::NEA_V_A() { - UINT8 tmp = V - A; + uint8_t tmp = V - A; ZHC_SUB( tmp, V, 0 ); SKIP_NZ; } @@ -1737,7 +1737,7 @@ void upd7810_device::NEA_V_A() /* 60 69: 0110 0000 0110 1001 */ void upd7810_device::NEA_A_A() { - UINT8 tmp = A - A; + uint8_t tmp = A - A; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -1745,7 +1745,7 @@ void upd7810_device::NEA_A_A() /* 60 6a: 0110 0000 0110 1010 */ void upd7810_device::NEA_B_A() { - UINT8 tmp = B - A; + uint8_t tmp = B - A; ZHC_SUB( tmp, B, 0 ); SKIP_NZ; } @@ -1753,7 +1753,7 @@ void upd7810_device::NEA_B_A() /* 60 6b: 0110 0000 0110 1011 */ void upd7810_device::NEA_C_A() { - UINT8 tmp = C - A; + uint8_t tmp = C - A; ZHC_SUB( tmp, C, 0 ); SKIP_NZ; } @@ -1761,7 +1761,7 @@ void upd7810_device::NEA_C_A() /* 60 6c: 0110 0000 0110 1100 */ void upd7810_device::NEA_D_A() { - UINT8 tmp = D - A; + uint8_t tmp = D - A; ZHC_SUB( tmp, D, 0 ); SKIP_NZ; } @@ -1769,7 +1769,7 @@ void upd7810_device::NEA_D_A() /* 60 6d: 0110 0000 0110 1101 */ void upd7810_device::NEA_E_A() { - UINT8 tmp = E - A; + uint8_t tmp = E - A; ZHC_SUB( tmp, E, 0 ); SKIP_NZ; } @@ -1777,7 +1777,7 @@ void upd7810_device::NEA_E_A() /* 60 6e: 0110 0000 0110 1110 */ void upd7810_device::NEA_H_A() { - UINT8 tmp = H - A; + uint8_t tmp = H - A; ZHC_SUB( tmp, H, 0 ); SKIP_NZ; } @@ -1785,7 +1785,7 @@ void upd7810_device::NEA_H_A() /* 60 6f: 0110 0000 0110 1111 */ void upd7810_device::NEA_L_A() { - UINT8 tmp = L - A; + uint8_t tmp = L - A; ZHC_SUB( tmp, L, 0 ); SKIP_NZ; } @@ -1793,7 +1793,7 @@ void upd7810_device::NEA_L_A() /* 60 70: 0110 0000 0111 0000 */ void upd7810_device::SBB_V_A() { - UINT8 tmp = V - A - (PSW & CY); + uint8_t tmp = V - A - (PSW & CY); ZHC_SUB( tmp, V, (PSW & CY) ); V = tmp; } @@ -1801,7 +1801,7 @@ void upd7810_device::SBB_V_A() /* 60 71: 0110 0000 0111 0001 */ void upd7810_device::SBB_A_A() { - UINT8 tmp = A - A - (PSW & CY); + uint8_t tmp = A - A - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -1809,7 +1809,7 @@ void upd7810_device::SBB_A_A() /* 60 72: 0110 0000 0111 0010 */ void upd7810_device::SBB_B_A() { - UINT8 tmp = B - A - (PSW & CY); + uint8_t tmp = B - A - (PSW & CY); ZHC_SUB( tmp, B, (PSW & CY) ); B = tmp; } @@ -1817,7 +1817,7 @@ void upd7810_device::SBB_B_A() /* 60 73: 0110 0000 0111 0011 */ void upd7810_device::SBB_C_A() { - UINT8 tmp = C - A - (PSW & CY); + uint8_t tmp = C - A - (PSW & CY); ZHC_SUB( tmp, C, (PSW & CY) ); C = tmp; } @@ -1825,7 +1825,7 @@ void upd7810_device::SBB_C_A() /* 60 74: 0110 0000 0111 0100 */ void upd7810_device::SBB_D_A() { - UINT8 tmp = D - A - (PSW & CY); + uint8_t tmp = D - A - (PSW & CY); ZHC_SUB( tmp, D, (PSW & CY) ); D = tmp; } @@ -1833,7 +1833,7 @@ void upd7810_device::SBB_D_A() /* 60 75: 0110 0000 0111 0101 */ void upd7810_device::SBB_E_A() { - UINT8 tmp = E - A - (PSW & CY); + uint8_t tmp = E - A - (PSW & CY); ZHC_SUB( tmp, E, (PSW & CY) ); E = tmp; } @@ -1841,7 +1841,7 @@ void upd7810_device::SBB_E_A() /* 60 76: 0110 0000 0111 0110 */ void upd7810_device::SBB_H_A() { - UINT8 tmp = H - A - (PSW & CY); + uint8_t tmp = H - A - (PSW & CY); ZHC_SUB( tmp, H, (PSW & CY) ); H = tmp; } @@ -1849,7 +1849,7 @@ void upd7810_device::SBB_H_A() /* 60 77: 0110 0000 0111 0111 */ void upd7810_device::SBB_L_A() { - UINT8 tmp = L - A - (PSW & CY); + uint8_t tmp = L - A - (PSW & CY); ZHC_SUB( tmp, L, (PSW & CY) ); L = tmp; } @@ -1857,7 +1857,7 @@ void upd7810_device::SBB_L_A() /* 60 78: 0110 0000 0111 1000 */ void upd7810_device::EQA_V_A() { - UINT8 tmp = V - A; + uint8_t tmp = V - A; ZHC_SUB( tmp, V, 0 ); SKIP_Z; } @@ -1865,7 +1865,7 @@ void upd7810_device::EQA_V_A() /* 60 79: 0110 0000 0111 1001 */ void upd7810_device::EQA_A_A() { - UINT8 tmp = A - A; + uint8_t tmp = A - A; ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -1873,7 +1873,7 @@ void upd7810_device::EQA_A_A() /* 60 7a: 0110 0000 0111 1010 */ void upd7810_device::EQA_B_A() { - UINT8 tmp = B - A; + uint8_t tmp = B - A; ZHC_SUB( tmp, B, 0 ); SKIP_Z; } @@ -1881,7 +1881,7 @@ void upd7810_device::EQA_B_A() /* 60 7b: 0110 0000 0111 1011 */ void upd7810_device::EQA_C_A() { - UINT8 tmp = C - A; + uint8_t tmp = C - A; ZHC_SUB( tmp, C, 0 ); SKIP_Z; } @@ -1889,7 +1889,7 @@ void upd7810_device::EQA_C_A() /* 60 7c: 0110 0000 0111 1100 */ void upd7810_device::EQA_D_A() { - UINT8 tmp = D - A; + uint8_t tmp = D - A; ZHC_SUB( tmp, D, 0 ); SKIP_Z; } @@ -1897,7 +1897,7 @@ void upd7810_device::EQA_D_A() /* 60 7d: 0110 0000 0111 1101 */ void upd7810_device::EQA_E_A() { - UINT8 tmp = E - A; + uint8_t tmp = E - A; ZHC_SUB( tmp, E, 0 ); SKIP_Z; } @@ -1905,7 +1905,7 @@ void upd7810_device::EQA_E_A() /* 60 7e: 0110 0000 0111 1110 */ void upd7810_device::EQA_H_A() { - UINT8 tmp = H - A; + uint8_t tmp = H - A; ZHC_SUB( tmp, H, 0 ); SKIP_Z; } @@ -1913,7 +1913,7 @@ void upd7810_device::EQA_H_A() /* 60 7f: 0110 0000 0111 1111 */ void upd7810_device::EQA_L_A() { - UINT8 tmp = L - A; + uint8_t tmp = L - A; ZHC_SUB( tmp, L, 0 ); SKIP_Z; } @@ -2077,7 +2077,7 @@ void upd7810_device::ORA_A_L() /* 60 a0: 0110 0000 1010 0000 */ void upd7810_device::ADDNC_A_V() { - UINT8 tmp = A + V; + uint8_t tmp = A + V; ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2089,7 +2089,7 @@ void upd7810_device::ADDNC_A_V() /* 60 a2: 0110 0000 1010 0010 */ void upd7810_device::ADDNC_A_B() { - UINT8 tmp = A + B; + uint8_t tmp = A + B; ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2098,7 +2098,7 @@ void upd7810_device::ADDNC_A_B() /* 60 a3: 0110 0000 1010 0011 */ void upd7810_device::ADDNC_A_C() { - UINT8 tmp = A + C; + uint8_t tmp = A + C; ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2107,7 +2107,7 @@ void upd7810_device::ADDNC_A_C() /* 60 a4: 0110 0000 1010 0100 */ void upd7810_device::ADDNC_A_D() { - UINT8 tmp = A + D; + uint8_t tmp = A + D; ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2116,7 +2116,7 @@ void upd7810_device::ADDNC_A_D() /* 60 a5: 0110 0000 1010 0101 */ void upd7810_device::ADDNC_A_E() { - UINT8 tmp = A + E; + uint8_t tmp = A + E; ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2125,7 +2125,7 @@ void upd7810_device::ADDNC_A_E() /* 60 a6: 0110 0000 1010 0110 */ void upd7810_device::ADDNC_A_H() { - UINT8 tmp = A + H; + uint8_t tmp = A + H; ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2134,7 +2134,7 @@ void upd7810_device::ADDNC_A_H() /* 60 a7: 0110 0000 1010 0111 */ void upd7810_device::ADDNC_A_L() { - UINT8 tmp = A + L; + uint8_t tmp = A + L; ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2143,7 +2143,7 @@ void upd7810_device::ADDNC_A_L() /* 60 a8: 0110 0000 1010 1000 */ void upd7810_device::GTA_A_V() { - UINT16 tmp = A - V - 1; + uint16_t tmp = A - V - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -2154,7 +2154,7 @@ void upd7810_device::GTA_A_V() /* 60 aa: 0110 0000 1010 1010 */ void upd7810_device::GTA_A_B() { - UINT16 tmp = A - B - 1; + uint16_t tmp = A - B - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -2162,7 +2162,7 @@ void upd7810_device::GTA_A_B() /* 60 ab: 0110 0000 1010 1011 */ void upd7810_device::GTA_A_C() { - UINT16 tmp = A - C - 1; + uint16_t tmp = A - C - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -2170,7 +2170,7 @@ void upd7810_device::GTA_A_C() /* 60 ac: 0110 0000 1010 1100 */ void upd7810_device::GTA_A_D() { - UINT16 tmp = A - D - 1; + uint16_t tmp = A - D - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -2178,7 +2178,7 @@ void upd7810_device::GTA_A_D() /* 60 ad: 0110 0000 1010 1101 */ void upd7810_device::GTA_A_E() { - UINT16 tmp = A - E - 1; + uint16_t tmp = A - E - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -2186,7 +2186,7 @@ void upd7810_device::GTA_A_E() /* 60 ae: 0110 0000 1010 1110 */ void upd7810_device::GTA_A_H() { - UINT16 tmp = A - H - 1; + uint16_t tmp = A - H - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -2194,7 +2194,7 @@ void upd7810_device::GTA_A_H() /* 60 af: 0110 0000 1010 1111 */ void upd7810_device::GTA_A_L() { - UINT16 tmp = A - L - 1; + uint16_t tmp = A - L - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -2202,7 +2202,7 @@ void upd7810_device::GTA_A_L() /* 60 b0: 0110 0000 1011 0000 */ void upd7810_device::SUBNB_A_V() { - UINT8 tmp = A - V; + uint8_t tmp = A - V; ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2214,7 +2214,7 @@ void upd7810_device::SUBNB_A_V() /* 60 b2: 0110 0000 1011 0010 */ void upd7810_device::SUBNB_A_B() { - UINT8 tmp = A - B; + uint8_t tmp = A - B; ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2223,7 +2223,7 @@ void upd7810_device::SUBNB_A_B() /* 60 b3: 0110 0000 1011 0011 */ void upd7810_device::SUBNB_A_C() { - UINT8 tmp = A - C; + uint8_t tmp = A - C; ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2232,7 +2232,7 @@ void upd7810_device::SUBNB_A_C() /* 60 b4: 0110 0000 1011 0100 */ void upd7810_device::SUBNB_A_D() { - UINT8 tmp = A - D; + uint8_t tmp = A - D; ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2241,7 +2241,7 @@ void upd7810_device::SUBNB_A_D() /* 60 b5: 0110 0000 1011 0101 */ void upd7810_device::SUBNB_A_E() { - UINT8 tmp = A - E; + uint8_t tmp = A - E; ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2250,7 +2250,7 @@ void upd7810_device::SUBNB_A_E() /* 60 b6: 0110 0000 1011 0110 */ void upd7810_device::SUBNB_A_H() { - UINT8 tmp = A - H; + uint8_t tmp = A - H; ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2259,7 +2259,7 @@ void upd7810_device::SUBNB_A_H() /* 60 b7: 0110 0000 1011 0111 */ void upd7810_device::SUBNB_A_L() { - UINT8 tmp = A - L; + uint8_t tmp = A - L; ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -2268,7 +2268,7 @@ void upd7810_device::SUBNB_A_L() /* 60 b8: 0110 0000 1011 1000 */ void upd7810_device::LTA_A_V() { - UINT8 tmp = A - V; + uint8_t tmp = A - V; ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -2279,7 +2279,7 @@ void upd7810_device::LTA_A_V() /* 60 ba: 0110 0000 1011 1010 */ void upd7810_device::LTA_A_B() { - UINT8 tmp = A - B; + uint8_t tmp = A - B; ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -2287,7 +2287,7 @@ void upd7810_device::LTA_A_B() /* 60 bb: 0110 0000 1011 1011 */ void upd7810_device::LTA_A_C() { - UINT8 tmp = A - C; + uint8_t tmp = A - C; ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -2295,7 +2295,7 @@ void upd7810_device::LTA_A_C() /* 60 bc: 0110 0000 1011 1100 */ void upd7810_device::LTA_A_D() { - UINT8 tmp = A - D; + uint8_t tmp = A - D; ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -2303,7 +2303,7 @@ void upd7810_device::LTA_A_D() /* 60 bd: 0110 0000 1011 1101 */ void upd7810_device::LTA_A_E() { - UINT8 tmp = A - E; + uint8_t tmp = A - E; ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -2311,7 +2311,7 @@ void upd7810_device::LTA_A_E() /* 60 be: 0110 0000 1011 1110 */ void upd7810_device::LTA_A_H() { - UINT8 tmp = A - H; + uint8_t tmp = A - H; ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -2319,7 +2319,7 @@ void upd7810_device::LTA_A_H() /* 60 bf: 0110 0000 1011 1111 */ void upd7810_device::LTA_A_L() { - UINT8 tmp = A - L; + uint8_t tmp = A - L; ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -2327,7 +2327,7 @@ void upd7810_device::LTA_A_L() /* 60 c0: 0110 0000 1100 0000 */ void upd7810_device::ADD_A_V() { - UINT8 tmp = A + V; + uint8_t tmp = A + V; ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -2338,7 +2338,7 @@ void upd7810_device::ADD_A_V() /* 60 c2: 0110 0000 1100 0010 */ void upd7810_device::ADD_A_B() { - UINT8 tmp = A + B; + uint8_t tmp = A + B; ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -2346,7 +2346,7 @@ void upd7810_device::ADD_A_B() /* 60 c3: 0110 0000 1100 0011 */ void upd7810_device::ADD_A_C() { - UINT8 tmp = A + C; + uint8_t tmp = A + C; ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -2354,7 +2354,7 @@ void upd7810_device::ADD_A_C() /* 60 c4: 0110 0000 1100 0100 */ void upd7810_device::ADD_A_D() { - UINT8 tmp = A + D; + uint8_t tmp = A + D; ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -2362,7 +2362,7 @@ void upd7810_device::ADD_A_D() /* 60 c5: 0110 0000 1100 0101 */ void upd7810_device::ADD_A_E() { - UINT8 tmp = A + E; + uint8_t tmp = A + E; ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -2370,7 +2370,7 @@ void upd7810_device::ADD_A_E() /* 60 c6: 0110 0000 1100 0110 */ void upd7810_device::ADD_A_H() { - UINT8 tmp = A + H; + uint8_t tmp = A + H; ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -2378,7 +2378,7 @@ void upd7810_device::ADD_A_H() /* 60 c7: 0110 0000 1100 0111 */ void upd7810_device::ADD_A_L() { - UINT8 tmp = A + L; + uint8_t tmp = A + L; ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -2458,7 +2458,7 @@ void upd7810_device::ONA_A_L() /* 60 d0: 0110 0000 1101 0000 */ void upd7810_device::ADC_A_V() { - UINT8 tmp = A + V + (PSW & CY); + uint8_t tmp = A + V + (PSW & CY); ZHC_ADD( tmp, A, (PSW & CY) ); A = tmp; } @@ -2469,7 +2469,7 @@ void upd7810_device::ADC_A_V() /* 60 d2: 0110 0000 1101 0010 */ void upd7810_device::ADC_A_B() { - UINT8 tmp = A + B + (PSW & CY); + uint8_t tmp = A + B + (PSW & CY); ZHC_ADD( tmp, A, (PSW & CY) ); A = tmp; } @@ -2477,7 +2477,7 @@ void upd7810_device::ADC_A_B() /* 60 d3: 0110 0000 1101 0011 */ void upd7810_device::ADC_A_C() { - UINT8 tmp = A + C + (PSW & CY); + uint8_t tmp = A + C + (PSW & CY); ZHC_ADD( tmp, A, (PSW & CY) ); A = tmp; } @@ -2485,7 +2485,7 @@ void upd7810_device::ADC_A_C() /* 60 d4: 0110 0000 1101 0100 */ void upd7810_device::ADC_A_D() { - UINT8 tmp = A + D + (PSW & CY); + uint8_t tmp = A + D + (PSW & CY); ZHC_ADD( tmp, A, (PSW & CY) ); A = tmp; } @@ -2493,7 +2493,7 @@ void upd7810_device::ADC_A_D() /* 60 d5: 0110 0000 1101 0101 */ void upd7810_device::ADC_A_E() { - UINT8 tmp = A + E + (PSW & CY); + uint8_t tmp = A + E + (PSW & CY); ZHC_ADD( tmp, A, (PSW & CY) ); A = tmp; } @@ -2501,7 +2501,7 @@ void upd7810_device::ADC_A_E() /* 60 d6: 0110 0000 1101 0110 */ void upd7810_device::ADC_A_H() { - UINT8 tmp = A + H + (PSW & CY); + uint8_t tmp = A + H + (PSW & CY); ZHC_ADD( tmp, A, (PSW & CY) ); A = tmp; } @@ -2509,7 +2509,7 @@ void upd7810_device::ADC_A_H() /* 60 d7: 0110 0000 1101 0111 */ void upd7810_device::ADC_A_L() { - UINT8 tmp = A + L + (PSW & CY); + uint8_t tmp = A + L + (PSW & CY); ZHC_ADD( tmp, A, (PSW & CY) ); A = tmp; } @@ -2589,7 +2589,7 @@ void upd7810_device::OFFA_A_L() /* 60 e0: 0110 0000 1110 0000 */ void upd7810_device::SUB_A_V() { - UINT8 tmp = A - V; + uint8_t tmp = A - V; ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -2600,7 +2600,7 @@ void upd7810_device::SUB_A_V() /* 60 e2: 0110 0000 1110 0010 */ void upd7810_device::SUB_A_B() { - UINT8 tmp = A - B; + uint8_t tmp = A - B; ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -2608,7 +2608,7 @@ void upd7810_device::SUB_A_B() /* 60 e3: 0110 0000 1110 0011 */ void upd7810_device::SUB_A_C() { - UINT8 tmp = A - C; + uint8_t tmp = A - C; ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -2616,7 +2616,7 @@ void upd7810_device::SUB_A_C() /* 60 e4: 0110 0000 1110 0100 */ void upd7810_device::SUB_A_D() { - UINT8 tmp = A - D; + uint8_t tmp = A - D; ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -2624,7 +2624,7 @@ void upd7810_device::SUB_A_D() /* 60 e5: 0110 0000 1110 0101 */ void upd7810_device::SUB_A_E() { - UINT8 tmp = A - E; + uint8_t tmp = A - E; ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -2632,7 +2632,7 @@ void upd7810_device::SUB_A_E() /* 60 e6: 0110 0000 1110 0110 */ void upd7810_device::SUB_A_H() { - UINT8 tmp = A - H; + uint8_t tmp = A - H; ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -2640,7 +2640,7 @@ void upd7810_device::SUB_A_H() /* 60 e7: 0110 0000 1110 0111 */ void upd7810_device::SUB_A_L() { - UINT8 tmp = A - L; + uint8_t tmp = A - L; ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -2648,7 +2648,7 @@ void upd7810_device::SUB_A_L() /* 60 e8: 0110 0000 1110 1000 */ void upd7810_device::NEA_A_V() { - UINT8 tmp = A - V; + uint8_t tmp = A - V; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -2659,7 +2659,7 @@ void upd7810_device::NEA_A_V() /* 60 ea: 0110 0000 1110 1010 */ void upd7810_device::NEA_A_B() { - UINT8 tmp = A - B; + uint8_t tmp = A - B; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -2667,7 +2667,7 @@ void upd7810_device::NEA_A_B() /* 60 eb: 0110 0000 1110 1011 */ void upd7810_device::NEA_A_C() { - UINT8 tmp = A - C; + uint8_t tmp = A - C; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -2675,7 +2675,7 @@ void upd7810_device::NEA_A_C() /* 60 ec: 0110 0000 1110 1100 */ void upd7810_device::NEA_A_D() { - UINT8 tmp = A - D; + uint8_t tmp = A - D; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -2683,7 +2683,7 @@ void upd7810_device::NEA_A_D() /* 60 ed: 0110 0000 1110 1101 */ void upd7810_device::NEA_A_E() { - UINT8 tmp = A - E; + uint8_t tmp = A - E; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -2691,7 +2691,7 @@ void upd7810_device::NEA_A_E() /* 60 ee: 0110 0000 1110 1110 */ void upd7810_device::NEA_A_H() { - UINT8 tmp = A - H; + uint8_t tmp = A - H; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -2699,7 +2699,7 @@ void upd7810_device::NEA_A_H() /* 60 ef: 0110 0000 1110 1111 */ void upd7810_device::NEA_A_L() { - UINT8 tmp = A - L; + uint8_t tmp = A - L; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -2707,7 +2707,7 @@ void upd7810_device::NEA_A_L() /* 60 f0: 0110 0000 1111 0000 */ void upd7810_device::SBB_A_V() { - UINT8 tmp = A - V - (PSW & CY); + uint8_t tmp = A - V - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -2718,7 +2718,7 @@ void upd7810_device::SBB_A_V() /* 60 f2: 0110 0000 1111 0010 */ void upd7810_device::SBB_A_B() { - UINT8 tmp = A - B - (PSW & CY); + uint8_t tmp = A - B - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -2726,7 +2726,7 @@ void upd7810_device::SBB_A_B() /* 60 f3: 0110 0000 1111 0011 */ void upd7810_device::SBB_A_C() { - UINT8 tmp = A - C - (PSW & CY); + uint8_t tmp = A - C - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -2734,7 +2734,7 @@ void upd7810_device::SBB_A_C() /* 60 f4: 0110 0000 1111 0100 */ void upd7810_device::SBB_A_D() { - UINT8 tmp = A - D - (PSW & CY); + uint8_t tmp = A - D - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -2742,7 +2742,7 @@ void upd7810_device::SBB_A_D() /* 60 f5: 0110 0000 1111 0101 */ void upd7810_device::SBB_A_E() { - UINT8 tmp = A - E - (PSW & CY); + uint8_t tmp = A - E - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -2750,7 +2750,7 @@ void upd7810_device::SBB_A_E() /* 60 f6: 0110 0000 1111 0110 */ void upd7810_device::SBB_A_H() { - UINT8 tmp = A - H - (PSW & CY); + uint8_t tmp = A - H - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -2758,7 +2758,7 @@ void upd7810_device::SBB_A_H() /* 60 f7: 0110 0000 1111 0111 */ void upd7810_device::SBB_A_L() { - UINT8 tmp = A - L - (PSW & CY); + uint8_t tmp = A - L - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -2766,7 +2766,7 @@ void upd7810_device::SBB_A_L() /* 60 f8: 0110 0000 1111 1000 */ void upd7810_device::EQA_A_V() { - UINT8 tmp = A - V; + uint8_t tmp = A - V; ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -2777,7 +2777,7 @@ void upd7810_device::EQA_A_V() /* 60 fa: 0110 0000 1111 1010 */ void upd7810_device::EQA_A_B() { - UINT8 tmp = A - B; + uint8_t tmp = A - B; ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -2785,7 +2785,7 @@ void upd7810_device::EQA_A_B() /* 60 fb: 0110 0000 1111 1011 */ void upd7810_device::EQA_A_C() { - UINT8 tmp = A - C; + uint8_t tmp = A - C; ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -2793,7 +2793,7 @@ void upd7810_device::EQA_A_C() /* 60 fc: 0110 0000 1111 1100 */ void upd7810_device::EQA_A_D() { - UINT8 tmp = A - D; + uint8_t tmp = A - D; ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -2801,7 +2801,7 @@ void upd7810_device::EQA_A_D() /* 60 fd: 0110 0000 1111 1101 */ void upd7810_device::EQA_A_E() { - UINT8 tmp = A - E; + uint8_t tmp = A - E; ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -2809,7 +2809,7 @@ void upd7810_device::EQA_A_E() /* 60 fe: 0110 0000 1111 1110 */ void upd7810_device::EQA_A_H() { - UINT8 tmp = A - H; + uint8_t tmp = A - H; ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -2817,7 +2817,7 @@ void upd7810_device::EQA_A_H() /* 60 ff: 0110 0000 1111 1111 */ void upd7810_device::EQA_A_L() { - UINT8 tmp = A - L; + uint8_t tmp = A - L; ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -2826,7 +2826,7 @@ void upd7810_device::EQA_A_L() /* 64 00: 0110 0100 0000 0000 xxxx xxxx */ void upd7810_device::MVI_PA_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); WP( UPD7810_PORTA, imm ); } @@ -2834,7 +2834,7 @@ void upd7810_device::MVI_PA_xx() /* 64 01: 0110 0100 0000 0001 xxxx xxxx */ void upd7810_device::MVI_PB_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); WP( UPD7810_PORTB, imm ); } @@ -2842,7 +2842,7 @@ void upd7810_device::MVI_PB_xx() /* 64 02: 0110 0100 0000 0010 xxxx xxxx */ void upd7810_device::MVI_PC_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); WP( UPD7810_PORTC, imm ); } @@ -2850,7 +2850,7 @@ void upd7810_device::MVI_PC_xx() /* 64 03: 0110 0100 0000 0011 xxxx xxxx */ void upd7810_device::MVI_PD_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); WP( UPD7810_PORTD, imm ); } @@ -2858,7 +2858,7 @@ void upd7810_device::MVI_PD_xx() /* 64 05: 0110 0100 0000 0101 xxxx xxxx */ void upd7810_device::MVI_PF_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); WP( UPD7810_PORTF, imm ); } @@ -2878,7 +2878,7 @@ void upd7810_device::MVI_MKL_xx() /* 64 08: 0110 0100 0000 1000 xxxx xxxx */ void upd7810_device::ANI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA), imm; + uint8_t pa = RP( UPD7810_PORTA), imm; RDOPARG( imm ); pa &= imm; WP( UPD7810_PORTA, pa ); @@ -2888,7 +2888,7 @@ void upd7810_device::ANI_PA_xx() /* 64 09: 0110 0100 0000 1001 xxxx xxxx */ void upd7810_device::ANI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB), imm; + uint8_t pb = RP( UPD7810_PORTB), imm; RDOPARG( imm ); pb &= imm; WP( UPD7810_PORTB, pb ); @@ -2898,7 +2898,7 @@ void upd7810_device::ANI_PB_xx() /* 64 0a: 0110 0100 0000 1010 xxxx xxxx */ void upd7810_device::ANI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC), imm; + uint8_t pc = RP( UPD7810_PORTC), imm; RDOPARG( imm ); pc &= imm; WP( UPD7810_PORTC, pc ); @@ -2908,7 +2908,7 @@ void upd7810_device::ANI_PC_xx() /* 64 0b: 0110 0100 0000 1011 xxxx xxxx */ void upd7810_device::ANI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), imm; + uint8_t pd = RP( UPD7810_PORTD ), imm; RDOPARG( imm ); pd &= imm; WP( UPD7810_PORTD, pd ); @@ -2918,7 +2918,7 @@ void upd7810_device::ANI_PD_xx() /* 64 0d: 0110 0100 0000 1101 xxxx xxxx */ void upd7810_device::ANI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), imm; + uint8_t pf = RP( UPD7810_PORTF ), imm; RDOPARG( imm ); pf &= imm; WP( UPD7810_PORTF, pf ); @@ -2928,7 +2928,7 @@ void upd7810_device::ANI_PF_xx() /* 64 0e: 0110 0100 0000 1110 xxxx xxxx */ void upd7810_device::ANI_MKH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); MKH &= imm; SET_Z(MKH); @@ -2937,7 +2937,7 @@ void upd7810_device::ANI_MKH_xx() /* 64 0f: 0110 0100 0000 1111 xxxx xxxx */ void upd7810_device::ANI_MKL_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); MKL &= imm; SET_Z(MKL); @@ -2946,7 +2946,7 @@ void upd7810_device::ANI_MKL_xx() /* 64 10: 0110 0100 0001 0000 xxxx xxxx */ void upd7810_device::XRI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), imm; + uint8_t pa = RP( UPD7810_PORTA ), imm; RDOPARG( imm ); pa ^= imm; WP( UPD7810_PORTA, pa ); @@ -2956,7 +2956,7 @@ void upd7810_device::XRI_PA_xx() /* 64 11: 0110 0100 0001 0001 xxxx xxxx */ void upd7810_device::XRI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), imm; + uint8_t pb = RP( UPD7810_PORTB ), imm; RDOPARG( imm ); pb ^= imm; WP( UPD7810_PORTB, pb ); @@ -2966,7 +2966,7 @@ void upd7810_device::XRI_PB_xx() /* 64 12: 0110 0100 0001 0010 xxxx xxxx */ void upd7810_device::XRI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), imm; + uint8_t pc = RP( UPD7810_PORTC ), imm; RDOPARG( imm ); pc ^= imm; WP( UPD7810_PORTC, pc ); @@ -2976,7 +2976,7 @@ void upd7810_device::XRI_PC_xx() /* 64 13: 0110 0100 0001 0011 xxxx xxxx */ void upd7810_device::XRI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), imm; + uint8_t pd = RP( UPD7810_PORTD ), imm; RDOPARG( imm ); pd ^= imm; WP( UPD7810_PORTD, pd ); @@ -2986,7 +2986,7 @@ void upd7810_device::XRI_PD_xx() /* 64 15: 0110 0100 0001 0101 xxxx xxxx */ void upd7810_device::XRI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), imm; + uint8_t pf = RP( UPD7810_PORTF ), imm; RDOPARG( imm ); pf ^= imm; WP( UPD7810_PORTF, pf ); @@ -2996,7 +2996,7 @@ void upd7810_device::XRI_PF_xx() /* 64 16: 0110 0100 0001 0110 xxxx xxxx */ void upd7810_device::XRI_MKH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); MKH ^= imm; SET_Z(MKH); @@ -3005,7 +3005,7 @@ void upd7810_device::XRI_MKH_xx() /* 64 17: 0110 0100 0001 0111 xxxx xxxx */ void upd7810_device::XRI_MKL_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); MKL ^= imm; SET_Z(MKL); @@ -3014,7 +3014,7 @@ void upd7810_device::XRI_MKL_xx() /* 64 18: 0110 0100 0001 1000 xxxx xxxx */ void upd7810_device::ORI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), imm; + uint8_t pa = RP( UPD7810_PORTA ), imm; RDOPARG( imm ); pa |= imm; WP( UPD7810_PORTA, pa ); @@ -3024,7 +3024,7 @@ void upd7810_device::ORI_PA_xx() /* 64 19: 0110 0100 0001 1001 xxxx xxxx */ void upd7810_device::ORI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), imm; + uint8_t pb = RP( UPD7810_PORTB ), imm; RDOPARG( imm ); pb |= imm; WP( UPD7810_PORTB, pb ); @@ -3034,7 +3034,7 @@ void upd7810_device::ORI_PB_xx() /* 64 1a: 0110 0100 0001 1010 xxxx xxxx */ void upd7810_device::ORI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), imm; + uint8_t pc = RP( UPD7810_PORTC ), imm; RDOPARG( imm ); pc |= imm; WP( UPD7810_PORTC, pc ); @@ -3044,7 +3044,7 @@ void upd7810_device::ORI_PC_xx() /* 64 1b: 0110 0100 0001 1011 xxxx xxxx */ void upd7810_device::ORI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), imm; + uint8_t pd = RP( UPD7810_PORTD ), imm; RDOPARG( imm ); pd |= imm; WP( UPD7810_PORTD, pd ); @@ -3054,7 +3054,7 @@ void upd7810_device::ORI_PD_xx() /* 64 1d: 0110 0100 0001 1101 xxxx xxxx */ void upd7810_device::ORI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), imm; + uint8_t pf = RP( UPD7810_PORTF ), imm; RDOPARG( imm ); pf |= imm; WP( UPD7810_PORTF, pf ); @@ -3064,7 +3064,7 @@ void upd7810_device::ORI_PF_xx() /* 64 1e: 0110 0100 0001 1110 xxxx xxxx */ void upd7810_device::ORI_MKH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); MKH |= imm; SET_Z(MKH); @@ -3073,7 +3073,7 @@ void upd7810_device::ORI_MKH_xx() /* 64 1f: 0110 0100 0001 1111 xxxx xxxx */ void upd7810_device::ORI_MKL_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); MKL |= imm; SET_Z(MKL); @@ -3082,8 +3082,8 @@ void upd7810_device::ORI_MKL_xx() /* 64 20: 0110 0100 0010 0000 xxxx xxxx */ void upd7810_device::ADINC_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ); - UINT8 tmp, imm; + uint8_t pa = RP( UPD7810_PORTA ); + uint8_t tmp, imm; RDOPARG( imm ); tmp = pa + imm; @@ -3096,8 +3096,8 @@ void upd7810_device::ADINC_PA_xx() /* 64 21: 0110 0100 0010 0001 xxxx xxxx */ void upd7810_device::ADINC_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ); - UINT8 tmp, imm; + uint8_t pb = RP( UPD7810_PORTB ); + uint8_t tmp, imm; RDOPARG( imm ); tmp = pb + imm; @@ -3110,8 +3110,8 @@ void upd7810_device::ADINC_PB_xx() /* 64 22: 0110 0100 0010 0010 xxxx xxxx */ void upd7810_device::ADINC_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ); - UINT8 tmp, imm; + uint8_t pc = RP( UPD7810_PORTC ); + uint8_t tmp, imm; RDOPARG( imm ); tmp = pc + imm; @@ -3124,8 +3124,8 @@ void upd7810_device::ADINC_PC_xx() /* 64 23: 0110 0100 0010 0011 xxxx xxxx */ void upd7810_device::ADINC_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ); - UINT8 tmp, imm; + uint8_t pd = RP( UPD7810_PORTD ); + uint8_t tmp, imm; RDOPARG( imm ); tmp = pd + imm; @@ -3138,8 +3138,8 @@ void upd7810_device::ADINC_PD_xx() /* 64 25: 0110 0100 0010 0101 xxxx xxxx */ void upd7810_device::ADINC_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ); - UINT8 tmp, imm; + uint8_t pf = RP( UPD7810_PORTF ); + uint8_t tmp, imm; RDOPARG( imm ); tmp = pf + imm; @@ -3152,7 +3152,7 @@ void upd7810_device::ADINC_PF_xx() /* 64 26: 0110 0100 0010 0110 xxxx xxxx */ void upd7810_device::ADINC_MKH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKH + imm; @@ -3165,7 +3165,7 @@ void upd7810_device::ADINC_MKH_xx() /* 64 27: 0110 0100 0010 0111 xxxx xxxx */ void upd7810_device::ADINC_MKL_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKL + imm; @@ -3178,8 +3178,8 @@ void upd7810_device::ADINC_MKL_xx() /* 64 28: 0110 0100 0010 1000 xxxx xxxx */ void upd7810_device::GTI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), imm; - UINT16 tmp; + uint8_t pa = RP( UPD7810_PORTA ), imm; + uint16_t tmp; RDOPARG( imm ); tmp = pa - imm - 1; @@ -3191,8 +3191,8 @@ void upd7810_device::GTI_PA_xx() /* 64 29: 0110 0100 0010 1001 xxxx xxxx */ void upd7810_device::GTI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), imm; - UINT16 tmp; + uint8_t pb = RP( UPD7810_PORTB ), imm; + uint16_t tmp; RDOPARG( imm ); tmp = pb - imm - 1; @@ -3204,8 +3204,8 @@ void upd7810_device::GTI_PB_xx() /* 64 2a: 0110 0100 0010 1010 xxxx xxxx */ void upd7810_device::GTI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), imm; - UINT16 tmp; + uint8_t pc = RP( UPD7810_PORTC ), imm; + uint16_t tmp; RDOPARG( imm ); tmp = pc - imm - 1; @@ -3217,8 +3217,8 @@ void upd7810_device::GTI_PC_xx() /* 64 2b: 0110 0100 0010 1011 xxxx xxxx */ void upd7810_device::GTI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), imm; - UINT16 tmp; + uint8_t pd = RP( UPD7810_PORTD ), imm; + uint16_t tmp; RDOPARG( imm ); tmp = pd - imm - 1; @@ -3230,8 +3230,8 @@ void upd7810_device::GTI_PD_xx() /* 64 2d: 0110 0100 0010 1101 xxxx xxxx */ void upd7810_device::GTI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), imm; - UINT16 tmp; + uint8_t pf = RP( UPD7810_PORTF ), imm; + uint16_t tmp; RDOPARG( imm ); tmp = pf - imm - 1; @@ -3243,8 +3243,8 @@ void upd7810_device::GTI_PF_xx() /* 64 2e: 0110 0100 0010 1110 xxxx xxxx */ void upd7810_device::GTI_MKH_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = MKH - imm - 1; @@ -3256,8 +3256,8 @@ void upd7810_device::GTI_MKH_xx() /* 64 2f: 0110 0100 0010 1111 xxxx xxxx */ void upd7810_device::GTI_MKL_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = MKL - imm - 1; @@ -3269,7 +3269,7 @@ void upd7810_device::GTI_MKL_xx() /* 64 30: 0110 0100 0011 0000 xxxx xxxx */ void upd7810_device::SUINB_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; + uint8_t pa = RP( UPD7810_PORTA ), tmp, imm; RDOPARG( imm ); tmp = pa - imm; @@ -3282,7 +3282,7 @@ void upd7810_device::SUINB_PA_xx() /* 64 31: 0110 0100 0011 0001 xxxx xxxx */ void upd7810_device::SUINB_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; + uint8_t pb = RP( UPD7810_PORTB ), tmp, imm; RDOPARG( imm ); tmp = pb - imm; @@ -3295,7 +3295,7 @@ void upd7810_device::SUINB_PB_xx() /* 64 32: 0110 0100 0011 0010 xxxx xxxx */ void upd7810_device::SUINB_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; + uint8_t pc = RP( UPD7810_PORTC ), tmp, imm; RDOPARG( imm ); tmp = pc - imm; @@ -3308,7 +3308,7 @@ void upd7810_device::SUINB_PC_xx() /* 64 33: 0110 0100 0011 0011 xxxx xxxx */ void upd7810_device::SUINB_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; + uint8_t pd = RP( UPD7810_PORTD ), tmp, imm; RDOPARG( imm ); tmp = pd - imm; @@ -3321,7 +3321,7 @@ void upd7810_device::SUINB_PD_xx() /* 64 35: 0110 0100 0011 0101 xxxx xxxx */ void upd7810_device::SUINB_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; + uint8_t pf = RP( UPD7810_PORTF ), tmp, imm; RDOPARG( imm ); tmp = pf - imm; @@ -3334,7 +3334,7 @@ void upd7810_device::SUINB_PF_xx() /* 64 36: 0110 0100 0011 0110 xxxx xxxx */ void upd7810_device::SUINB_MKH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKH - imm; @@ -3346,7 +3346,7 @@ void upd7810_device::SUINB_MKH_xx() /* 64 37: 0110 0100 0011 0111 xxxx xxxx */ void upd7810_device::SUINB_MKL_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKL - imm; @@ -3358,7 +3358,7 @@ void upd7810_device::SUINB_MKL_xx() /* 64 38: 0110 0100 0011 1000 xxxx xxxx */ void upd7810_device::LTI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; + uint8_t pa = RP( UPD7810_PORTA ), tmp, imm; RDOPARG( imm ); tmp = pa - imm; ZHC_SUB( tmp, pa, 0 ); @@ -3368,7 +3368,7 @@ void upd7810_device::LTI_PA_xx() /* 64 39: 0110 0100 0011 1001 xxxx xxxx */ void upd7810_device::LTI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; + uint8_t pb = RP( UPD7810_PORTB ), tmp, imm; RDOPARG( imm ); tmp = pb - imm; ZHC_SUB( tmp, pb, 0 ); @@ -3378,7 +3378,7 @@ void upd7810_device::LTI_PB_xx() /* 64 3a: 0110 0100 0011 1010 xxxx xxxx */ void upd7810_device::LTI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; + uint8_t pc = RP( UPD7810_PORTC ), tmp, imm; RDOPARG( imm ); tmp = pc - imm; ZHC_SUB( tmp, pc, 0 ); @@ -3388,7 +3388,7 @@ void upd7810_device::LTI_PC_xx() /* 64 3b: 0110 0100 0011 1011 xxxx xxxx */ void upd7810_device::LTI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; + uint8_t pd = RP( UPD7810_PORTD ), tmp, imm; RDOPARG( imm ); tmp = pd - imm; ZHC_SUB( tmp, pd, 0 ); @@ -3398,7 +3398,7 @@ void upd7810_device::LTI_PD_xx() /* 64 3d: 0110 0100 0011 1101 xxxx xxxx */ void upd7810_device::LTI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; + uint8_t pf = RP( UPD7810_PORTF ), tmp, imm; RDOPARG( imm ); tmp = pf - imm; ZHC_SUB( tmp, pf, 0 ); @@ -3408,7 +3408,7 @@ void upd7810_device::LTI_PF_xx() /* 64 3e: 0110 0100 0011 1110 xxxx xxxx */ void upd7810_device::LTI_MKH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKH - imm; @@ -3419,7 +3419,7 @@ void upd7810_device::LTI_MKH_xx() /* 64 3f: 0110 0100 0011 1111 xxxx xxxx */ void upd7810_device::LTI_MKL_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKL - imm; @@ -3430,7 +3430,7 @@ void upd7810_device::LTI_MKL_xx() /* 64 40: 0110 0100 0100 0000 xxxx xxxx */ void upd7810_device::ADI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; + uint8_t pa = RP( UPD7810_PORTA ), tmp, imm; RDOPARG( imm ); tmp = pa + imm; @@ -3442,7 +3442,7 @@ void upd7810_device::ADI_PA_xx() /* 64 41: 0110 0100 0100 0001 xxxx xxxx */ void upd7810_device::ADI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; + uint8_t pb = RP( UPD7810_PORTB ), tmp, imm; RDOPARG( imm ); tmp = pb + imm; @@ -3454,7 +3454,7 @@ void upd7810_device::ADI_PB_xx() /* 64 42: 0110 0100 0100 0010 xxxx xxxx */ void upd7810_device::ADI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; + uint8_t pc = RP( UPD7810_PORTC ), tmp, imm; RDOPARG( imm ); tmp = pc + imm; @@ -3466,7 +3466,7 @@ void upd7810_device::ADI_PC_xx() /* 64 43: 0110 0100 0100 0011 xxxx xxxx */ void upd7810_device::ADI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; + uint8_t pd = RP( UPD7810_PORTD ), tmp, imm; RDOPARG( imm ); tmp = pd + imm; @@ -3478,7 +3478,7 @@ void upd7810_device::ADI_PD_xx() /* 64 45: 0110 0100 0100 0101 xxxx xxxx */ void upd7810_device::ADI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; + uint8_t pf = RP( UPD7810_PORTF ), tmp, imm; RDOPARG( imm ); tmp = pf + imm; @@ -3490,7 +3490,7 @@ void upd7810_device::ADI_PF_xx() /* 64 46: 0110 0100 0100 0110 xxxx xxxx */ void upd7810_device::ADI_MKH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKH + imm; @@ -3501,7 +3501,7 @@ void upd7810_device::ADI_MKH_xx() /* 64 47: 0110 0100 0100 0111 xxxx xxxx */ void upd7810_device::ADI_MKL_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKL + imm; @@ -3512,7 +3512,7 @@ void upd7810_device::ADI_MKL_xx() /* 64 48: 0110 0100 0100 1000 xxxx xxxx */ void upd7810_device::ONI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), imm; + uint8_t pa = RP( UPD7810_PORTA ), imm; RDOPARG( imm ); if (pa & imm) @@ -3522,7 +3522,7 @@ void upd7810_device::ONI_PA_xx() /* 64 49: 0110 0100 0100 1001 xxxx xxxx */ void upd7810_device::ONI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), imm; + uint8_t pb = RP( UPD7810_PORTB ), imm; RDOPARG( imm ); if (pb & imm) @@ -3532,7 +3532,7 @@ void upd7810_device::ONI_PB_xx() /* 64 4a: 0110 0100 0100 1010 xxxx xxxx */ void upd7810_device::ONI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), imm; + uint8_t pc = RP( UPD7810_PORTC ), imm; RDOPARG( imm ); if (pc & imm) @@ -3542,7 +3542,7 @@ void upd7810_device::ONI_PC_xx() /* 64 4b: 0110 0100 0100 1011 xxxx xxxx */ void upd7810_device::ONI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), imm; + uint8_t pd = RP( UPD7810_PORTD ), imm; RDOPARG( imm ); if (pd & imm) @@ -3552,7 +3552,7 @@ void upd7810_device::ONI_PD_xx() /* 64 4d: 0110 0100 0100 1101 xxxx xxxx */ void upd7810_device::ONI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), imm; + uint8_t pf = RP( UPD7810_PORTF ), imm; RDOPARG( imm ); if (pf & imm) @@ -3562,7 +3562,7 @@ void upd7810_device::ONI_PF_xx() /* 64 4e: 0110 0100 0100 1110 xxxx xxxx */ void upd7810_device::ONI_MKH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (MKH & imm) @@ -3572,7 +3572,7 @@ void upd7810_device::ONI_MKH_xx() /* 64 4f: 0110 0100 0100 1111 xxxx xxxx */ void upd7810_device::ONI_MKL_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (MKL & imm) @@ -3582,7 +3582,7 @@ void upd7810_device::ONI_MKL_xx() /* 64 50: 0110 0100 0101 0000 xxxx xxxx */ void upd7810_device::ACI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; + uint8_t pa = RP( UPD7810_PORTA ), tmp, imm; RDOPARG( imm ); tmp = pa + imm + (PSW & CY); @@ -3594,7 +3594,7 @@ void upd7810_device::ACI_PA_xx() /* 64 51: 0110 0100 0101 0001 xxxx xxxx */ void upd7810_device::ACI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; + uint8_t pb = RP( UPD7810_PORTB ), tmp, imm; RDOPARG( imm ); tmp = pb + imm + (PSW & CY); @@ -3606,7 +3606,7 @@ void upd7810_device::ACI_PB_xx() /* 64 52: 0110 0100 0101 0010 xxxx xxxx */ void upd7810_device::ACI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; + uint8_t pc = RP( UPD7810_PORTC ), tmp, imm; RDOPARG( imm ); tmp = pc + imm + (PSW & CY); @@ -3618,7 +3618,7 @@ void upd7810_device::ACI_PC_xx() /* 64 53: 0110 0100 0101 0011 xxxx xxxx */ void upd7810_device::ACI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; + uint8_t pd = RP( UPD7810_PORTD ), tmp, imm; RDOPARG( imm ); tmp = pd + imm + (PSW & CY); @@ -3630,7 +3630,7 @@ void upd7810_device::ACI_PD_xx() /* 64 55: 0110 0100 0101 0101 xxxx xxxx */ void upd7810_device::ACI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; + uint8_t pf = RP( UPD7810_PORTF ), tmp, imm; RDOPARG( imm ); tmp = pf + imm + (PSW & CY); @@ -3642,7 +3642,7 @@ void upd7810_device::ACI_PF_xx() /* 64 56: 0110 0100 0101 0110 xxxx xxxx */ void upd7810_device::ACI_MKH_xx() { - UINT8 imm, tmp; + uint8_t imm, tmp; RDOPARG( imm ); tmp = MKH + imm + (PSW & CY); @@ -3653,7 +3653,7 @@ void upd7810_device::ACI_MKH_xx() /* 64 57: 0110 0100 0101 0111 xxxx xxxx */ void upd7810_device::ACI_MKL_xx() { - UINT8 imm, tmp; + uint8_t imm, tmp; RDOPARG( imm ); tmp = MKL + imm + (PSW & CY); @@ -3664,7 +3664,7 @@ void upd7810_device::ACI_MKL_xx() /* 64 58: 0110 0100 0101 1000 xxxx xxxx */ void upd7810_device::OFFI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), imm; + uint8_t pa = RP( UPD7810_PORTA ), imm; RDOPARG( imm ); if (0 == (pa & imm)) @@ -3674,7 +3674,7 @@ void upd7810_device::OFFI_PA_xx() /* 64 59: 0110 0100 0101 1001 xxxx xxxx */ void upd7810_device::OFFI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), imm; + uint8_t pb = RP( UPD7810_PORTB ), imm; RDOPARG( imm ); if (0 == (pb & imm)) @@ -3684,7 +3684,7 @@ void upd7810_device::OFFI_PB_xx() /* 64 5a: 0110 0100 0101 1010 xxxx xxxx */ void upd7810_device::OFFI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), imm; + uint8_t pc = RP( UPD7810_PORTC ), imm; RDOPARG( imm ); if (0 == (pc & imm)) @@ -3694,7 +3694,7 @@ void upd7810_device::OFFI_PC_xx() /* 64 5b: 0110 0100 0101 1011 xxxx xxxx */ void upd7810_device::OFFI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), imm; + uint8_t pd = RP( UPD7810_PORTD ), imm; RDOPARG( imm ); if (0 == (pd & imm)) @@ -3704,7 +3704,7 @@ void upd7810_device::OFFI_PD_xx() /* 64 5d: 0110 0100 0101 1101 xxxx xxxx */ void upd7810_device::OFFI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), imm; + uint8_t pf = RP( UPD7810_PORTF ), imm; RDOPARG( imm ); if (0 == (pf & imm)) @@ -3714,7 +3714,7 @@ void upd7810_device::OFFI_PF_xx() /* 64 5e: 0110 0100 0101 1110 xxxx xxxx */ void upd7810_device::OFFI_MKH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (MKH & imm)) @@ -3724,7 +3724,7 @@ void upd7810_device::OFFI_MKH_xx() /* 64 5f: 0110 0100 0101 1111 xxxx xxxx */ void upd7810_device::OFFI_MKL_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (MKL & imm)) @@ -3734,7 +3734,7 @@ void upd7810_device::OFFI_MKL_xx() /* 64 60: 0110 0100 0110 0000 xxxx xxxx */ void upd7810_device::SUI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; + uint8_t pa = RP( UPD7810_PORTA ), tmp, imm; RDOPARG( imm ); tmp = pa - imm; @@ -3746,7 +3746,7 @@ void upd7810_device::SUI_PA_xx() /* 64 61: 0110 0100 0110 0001 xxxx xxxx */ void upd7810_device::SUI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; + uint8_t pb = RP( UPD7810_PORTB ), tmp, imm; RDOPARG( imm ); tmp = pb - imm; @@ -3758,7 +3758,7 @@ void upd7810_device::SUI_PB_xx() /* 64 62: 0110 0100 0110 0010 xxxx xxxx */ void upd7810_device::SUI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; + uint8_t pc = RP( UPD7810_PORTC ), tmp, imm; RDOPARG( imm ); tmp = pc - imm; @@ -3770,7 +3770,7 @@ void upd7810_device::SUI_PC_xx() /* 64 63: 0110 0100 0110 0011 xxxx xxxx */ void upd7810_device::SUI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; + uint8_t pd = RP( UPD7810_PORTD ), tmp, imm; RDOPARG( imm ); tmp = pd - imm; @@ -3782,7 +3782,7 @@ void upd7810_device::SUI_PD_xx() /* 64 65: 0110 0100 0110 0101 xxxx xxxx */ void upd7810_device::SUI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; + uint8_t pf = RP( UPD7810_PORTF ), tmp, imm; RDOPARG( imm ); tmp = pf - imm; @@ -3794,7 +3794,7 @@ void upd7810_device::SUI_PF_xx() /* 64 66: 0110 0100 0110 0110 xxxx xxxx */ void upd7810_device::SUI_MKH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKH - imm; @@ -3805,7 +3805,7 @@ void upd7810_device::SUI_MKH_xx() /* 64 67: 0110 0100 0110 0111 xxxx xxxx */ void upd7810_device::SUI_MKL_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKL - imm; @@ -3816,7 +3816,7 @@ void upd7810_device::SUI_MKL_xx() /* 64 68: 0110 0100 0110 1000 xxxx xxxx */ void upd7810_device::NEI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; + uint8_t pa = RP( UPD7810_PORTA ), tmp, imm; RDOPARG( imm ); tmp = pa - imm; @@ -3827,7 +3827,7 @@ void upd7810_device::NEI_PA_xx() /* 64 69: 0110 0100 0110 1001 xxxx xxxx */ void upd7810_device::NEI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; + uint8_t pb = RP( UPD7810_PORTB ), tmp, imm; RDOPARG( imm ); tmp = pb - imm; @@ -3838,7 +3838,7 @@ void upd7810_device::NEI_PB_xx() /* 64 6a: 0110 0100 0110 1010 xxxx xxxx */ void upd7810_device::NEI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; + uint8_t pc = RP( UPD7810_PORTC ), tmp, imm; RDOPARG( imm ); tmp = pc - imm; @@ -3849,7 +3849,7 @@ void upd7810_device::NEI_PC_xx() /* 64 6b: 0110 0100 0110 1011 xxxx xxxx */ void upd7810_device::NEI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; + uint8_t pd = RP( UPD7810_PORTD ), tmp, imm; RDOPARG( imm ); tmp = pd - imm; @@ -3860,7 +3860,7 @@ void upd7810_device::NEI_PD_xx() /* 64 6d: 0110 0100 0110 1101 xxxx xxxx */ void upd7810_device::NEI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; + uint8_t pf = RP( UPD7810_PORTF ), tmp, imm; RDOPARG( imm ); tmp = pf - imm; @@ -3871,7 +3871,7 @@ void upd7810_device::NEI_PF_xx() /* 64 6e: 0110 0100 0110 1110 xxxx xxxx */ void upd7810_device::NEI_MKH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKH - imm; @@ -3882,7 +3882,7 @@ void upd7810_device::NEI_MKH_xx() /* 64 6f: 0110 0100 0110 1111 xxxx xxxx */ void upd7810_device::NEI_MKL_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKL - imm; @@ -3893,7 +3893,7 @@ void upd7810_device::NEI_MKL_xx() /* 64 70: 0110 0100 0111 0000 xxxx xxxx */ void upd7810_device::SBI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; + uint8_t pa = RP( UPD7810_PORTA ), tmp, imm; RDOPARG( imm ); tmp = pa - imm - (PSW & CY); @@ -3905,7 +3905,7 @@ void upd7810_device::SBI_PA_xx() /* 64 71: 0110 0100 0111 0001 xxxx xxxx */ void upd7810_device::SBI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; + uint8_t pb = RP( UPD7810_PORTB ), tmp, imm; RDOPARG( imm ); tmp = pb - imm - (PSW & CY); @@ -3917,7 +3917,7 @@ void upd7810_device::SBI_PB_xx() /* 64 72: 0110 0100 0111 0010 xxxx xxxx */ void upd7810_device::SBI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; + uint8_t pc = RP( UPD7810_PORTC ), tmp, imm; RDOPARG( imm ); tmp = pc - imm - (PSW & CY); @@ -3929,7 +3929,7 @@ void upd7810_device::SBI_PC_xx() /* 64 73: 0110 0100 0111 0011 xxxx xxxx */ void upd7810_device::SBI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; + uint8_t pd = RP( UPD7810_PORTD ), tmp, imm; RDOPARG( imm ); tmp = pd - imm - (PSW & CY); @@ -3941,7 +3941,7 @@ void upd7810_device::SBI_PD_xx() /* 64 75: 0110 0100 0111 0101 xxxx xxxx */ void upd7810_device::SBI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; + uint8_t pf = RP( UPD7810_PORTF ), tmp, imm; RDOPARG( imm ); tmp = pf - imm - (PSW & CY); @@ -3953,7 +3953,7 @@ void upd7810_device::SBI_PF_xx() /* 64 76: 0110 0100 0111 0110 xxxx xxxx */ void upd7810_device::SBI_MKH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKH - imm - (PSW & CY); @@ -3964,7 +3964,7 @@ void upd7810_device::SBI_MKH_xx() /* 64 77: 0110 0100 0111 0111 xxxx xxxx */ void upd7810_device::SBI_MKL_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKL - imm - (PSW & CY); @@ -3975,7 +3975,7 @@ void upd7810_device::SBI_MKL_xx() /* 64 78: 0110 0100 0111 1000 xxxx xxxx */ void upd7810_device::EQI_PA_xx() { - UINT8 pa = RP( UPD7810_PORTA ), tmp, imm; + uint8_t pa = RP( UPD7810_PORTA ), tmp, imm; RDOPARG( imm ); tmp = pa - imm; @@ -3986,7 +3986,7 @@ void upd7810_device::EQI_PA_xx() /* 64 79: 0110 0100 0111 1001 xxxx xxxx */ void upd7810_device::EQI_PB_xx() { - UINT8 pb = RP( UPD7810_PORTB ), tmp, imm; + uint8_t pb = RP( UPD7810_PORTB ), tmp, imm; RDOPARG( imm ); tmp = pb - imm; @@ -3997,7 +3997,7 @@ void upd7810_device::EQI_PB_xx() /* 64 7a: 0110 0100 0111 1010 xxxx xxxx */ void upd7810_device::EQI_PC_xx() { - UINT8 pc = RP( UPD7810_PORTC ), tmp, imm; + uint8_t pc = RP( UPD7810_PORTC ), tmp, imm; RDOPARG( imm ); tmp = pc - imm; @@ -4008,7 +4008,7 @@ void upd7810_device::EQI_PC_xx() /* 64 7b: 0110 0100 0111 1011 xxxx xxxx */ void upd7810_device::EQI_PD_xx() { - UINT8 pd = RP( UPD7810_PORTD ), tmp, imm; + uint8_t pd = RP( UPD7810_PORTD ), tmp, imm; RDOPARG( imm ); tmp = pd - imm; @@ -4019,7 +4019,7 @@ void upd7810_device::EQI_PD_xx() /* 64 7d: 0110 0100 0111 1101 xxxx xxxx */ void upd7810_device::EQI_PF_xx() { - UINT8 pf = RP( UPD7810_PORTF ), tmp, imm; + uint8_t pf = RP( UPD7810_PORTF ), tmp, imm; RDOPARG( imm ); tmp = pf - imm; @@ -4030,7 +4030,7 @@ void upd7810_device::EQI_PF_xx() /* 64 7e: 0110 0100 0111 1110 xxxx xxxx */ void upd7810_device::EQI_MKH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKH - imm; @@ -4041,7 +4041,7 @@ void upd7810_device::EQI_MKH_xx() /* 64 7f: 0110 0100 0111 1111 xxxx xxxx */ void upd7810_device::EQI_MKL_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = MKL - imm; @@ -4077,7 +4077,7 @@ void upd7810_device::MVI_TMM_xx() /* 64 88: 0110 0100 1000 1000 xxxx xxxx */ void upd7810_device::ANI_ANM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); ANM &= imm; @@ -4087,7 +4087,7 @@ void upd7810_device::ANI_ANM_xx() /* 64 89: 0110 0100 1000 1001 xxxx xxxx */ void upd7810_device::ANI_SMH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); SMH &= imm; @@ -4098,8 +4098,8 @@ void upd7810_device::ANI_SMH_xx() void upd7810_device::ANI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; + uint8_t eom = EOM & 0x22; + uint8_t imm; RDOPARG( imm ); /* only bits #1 and #5 can be read */ @@ -4111,7 +4111,7 @@ void upd7810_device::ANI_EOM_xx() /* 64 8d: 0110 0100 1000 1101 xxxx xxxx */ void upd7810_device::ANI_TMM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); TMM &= imm; @@ -4121,7 +4121,7 @@ void upd7810_device::ANI_TMM_xx() /* 64 90: 0110 0100 1001 0000 xxxx xxxx */ void upd7810_device::XRI_ANM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); ANM ^= imm; @@ -4131,7 +4131,7 @@ void upd7810_device::XRI_ANM_xx() /* 64 91: 0110 0100 1001 0001 xxxx xxxx */ void upd7810_device::XRI_SMH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); SMH ^= imm; @@ -4142,8 +4142,8 @@ void upd7810_device::XRI_SMH_xx() void upd7810_device::XRI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; + uint8_t eom = EOM & 0x22; + uint8_t imm; RDOPARG( imm ); /* only bits #1 and #5 can be read */ @@ -4155,7 +4155,7 @@ void upd7810_device::XRI_EOM_xx() /* 64 95: 0110 0100 1001 0101 xxxx xxxx */ void upd7810_device::XRI_TMM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); TMM ^= imm; @@ -4165,7 +4165,7 @@ void upd7810_device::XRI_TMM_xx() /* 64 98: 0110 0100 1001 1000 xxxx xxxx */ void upd7810_device::ORI_ANM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); ANM |= imm; @@ -4175,7 +4175,7 @@ void upd7810_device::ORI_ANM_xx() /* 64 99: 0110 0100 1001 1001 xxxx xxxx */ void upd7810_device::ORI_SMH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); SMH |= imm; @@ -4186,8 +4186,8 @@ void upd7810_device::ORI_SMH_xx() void upd7810_device::ORI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; + uint8_t eom = EOM & 0x22; + uint8_t imm; RDOPARG( imm ); /* only bits #1 and #5 can be read */ @@ -4199,7 +4199,7 @@ void upd7810_device::ORI_EOM_xx() /* 64 9d: 0110 0100 1001 1101 xxxx xxxx */ void upd7810_device::ORI_TMM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); TMM |= imm; @@ -4209,7 +4209,7 @@ void upd7810_device::ORI_TMM_xx() /* 64 a0: 0110 0100 1010 0000 xxxx xxxx */ void upd7810_device::ADINC_ANM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = ANM + imm; @@ -4222,7 +4222,7 @@ void upd7810_device::ADINC_ANM_xx() /* 64 a1: 0110 0100 1010 0001 xxxx xxxx */ void upd7810_device::ADINC_SMH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = SMH + imm; @@ -4236,8 +4236,8 @@ void upd7810_device::ADINC_SMH_xx() void upd7810_device::ADINC_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; + uint8_t eom = EOM & 0x22; + uint8_t tmp, imm; RDOPARG( imm ); /* only bits #1 and #5 can be read */ @@ -4252,7 +4252,7 @@ void upd7810_device::ADINC_EOM_xx() /* 64 a5: 0110 0100 1010 0101 xxxx xxxx */ void upd7810_device::ADINC_TMM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = TMM + imm; @@ -4265,8 +4265,8 @@ void upd7810_device::ADINC_TMM_xx() /* 64 a8: 0110 0100 1010 1000 xxxx xxxx */ void upd7810_device::GTI_ANM_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = ANM - imm - 1; @@ -4278,8 +4278,8 @@ void upd7810_device::GTI_ANM_xx() /* 64 a9: 0110 0100 1010 1001 xxxx xxxx */ void upd7810_device::GTI_SMH_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = SMH - imm - 1; @@ -4292,9 +4292,9 @@ void upd7810_device::GTI_SMH_xx() void upd7810_device::GTI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; - UINT16 tmp; + uint8_t eom = EOM & 0x22; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = eom - imm - 1; @@ -4306,8 +4306,8 @@ void upd7810_device::GTI_EOM_xx() /* 64 ad: 0110 0100 1010 1101 xxxx xxxx */ void upd7810_device::GTI_TMM_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = TMM - imm - 1; @@ -4319,7 +4319,7 @@ void upd7810_device::GTI_TMM_xx() /* 64 b0: 0110 0100 1011 0000 xxxx xxxx */ void upd7810_device::SUINB_ANM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = ANM - imm; @@ -4331,7 +4331,7 @@ void upd7810_device::SUINB_ANM_xx() /* 64 b1: 0110 0100 1011 0001 xxxx xxxx */ void upd7810_device::SUINB_SMH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = SMH - imm; @@ -4344,8 +4344,8 @@ void upd7810_device::SUINB_SMH_xx() void upd7810_device::SUINB_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; + uint8_t eom = EOM & 0x22; + uint8_t tmp, imm; RDOPARG( imm ); tmp = eom - imm; @@ -4358,7 +4358,7 @@ void upd7810_device::SUINB_EOM_xx() /* 64 b5: 0110 0100 1011 0101 xxxx xxxx */ void upd7810_device::SUINB_TMM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = TMM - imm; @@ -4370,7 +4370,7 @@ void upd7810_device::SUINB_TMM_xx() /* 64 b8: 0110 0100 1011 1000 xxxx xxxx */ void upd7810_device::LTI_ANM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = ANM - imm; @@ -4381,7 +4381,7 @@ void upd7810_device::LTI_ANM_xx() /* 64 b9: 0110 0100 1011 1001 xxxx xxxx */ void upd7810_device::LTI_SMH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = SMH - imm; @@ -4393,8 +4393,8 @@ void upd7810_device::LTI_SMH_xx() void upd7810_device::LTI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; + uint8_t eom = EOM & 0x22; + uint8_t tmp, imm; RDOPARG( imm ); tmp = eom - imm; @@ -4405,7 +4405,7 @@ void upd7810_device::LTI_EOM_xx() /* 64 bd: 0110 0100 1011 1101 xxxx xxxx */ void upd7810_device::LTI_TMM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = TMM - imm; @@ -4416,7 +4416,7 @@ void upd7810_device::LTI_TMM_xx() /* 64 c0: 0110 0100 1100 0000 xxxx xxxx */ void upd7810_device::ADI_ANM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = ANM + imm; @@ -4428,7 +4428,7 @@ void upd7810_device::ADI_ANM_xx() /* 64 c1: 0110 0100 1100 0001 xxxx xxxx */ void upd7810_device::ADI_SMH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = SMH + imm; @@ -4441,8 +4441,8 @@ void upd7810_device::ADI_SMH_xx() void upd7810_device::ADI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; + uint8_t eom = EOM & 0x22; + uint8_t tmp, imm; RDOPARG( imm ); tmp = eom + imm; @@ -4455,7 +4455,7 @@ void upd7810_device::ADI_EOM_xx() /* 64 c5: 0110 0100 1100 0101 xxxx xxxx */ void upd7810_device::ADI_TMM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = TMM + imm; @@ -4467,7 +4467,7 @@ void upd7810_device::ADI_TMM_xx() /* 64 c8: 0110 0100 1100 1000 xxxx xxxx */ void upd7810_device::ONI_ANM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (ANM & imm) @@ -4477,7 +4477,7 @@ void upd7810_device::ONI_ANM_xx() /* 64 c9: 0110 0100 1100 1001 xxxx xxxx */ void upd7810_device::ONI_SMH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (SMH & imm) @@ -4488,8 +4488,8 @@ void upd7810_device::ONI_SMH_xx() void upd7810_device::ONI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; + uint8_t eom = EOM & 0x22; + uint8_t imm; RDOPARG( imm ); if (eom & imm) @@ -4499,7 +4499,7 @@ void upd7810_device::ONI_EOM_xx() /* 64 cd: 0110 0100 1100 1101 xxxx xxxx */ void upd7810_device::ONI_TMM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (TMM & imm) @@ -4509,7 +4509,7 @@ void upd7810_device::ONI_TMM_xx() /* 64 d0: 0110 0100 1101 0000 xxxx xxxx */ void upd7810_device::ACI_ANM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = ANM + imm + (PSW & CY); @@ -4521,7 +4521,7 @@ void upd7810_device::ACI_ANM_xx() /* 64 d1: 0110 0100 1101 0001 xxxx xxxx */ void upd7810_device::ACI_SMH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = SMH + imm + (PSW & CY); @@ -4534,8 +4534,8 @@ void upd7810_device::ACI_SMH_xx() void upd7810_device::ACI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; + uint8_t eom = EOM & 0x22; + uint8_t tmp, imm; RDOPARG( imm ); tmp = eom + imm + (PSW & CY); @@ -4548,7 +4548,7 @@ void upd7810_device::ACI_EOM_xx() /* 64 d5: 0110 0100 1101 0101 xxxx xxxx */ void upd7810_device::ACI_TMM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = TMM + imm + (PSW & CY); @@ -4560,7 +4560,7 @@ void upd7810_device::ACI_TMM_xx() /* 64 d8: 0110 0100 1101 1000 xxxx xxxx */ void upd7810_device::OFFI_ANM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (ANM & imm)) @@ -4570,7 +4570,7 @@ void upd7810_device::OFFI_ANM_xx() /* 64 d9: 0110 0100 1101 1001 xxxx xxxx */ void upd7810_device::OFFI_SMH_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (SMH & imm)) @@ -4581,8 +4581,8 @@ void upd7810_device::OFFI_SMH_xx() void upd7810_device::OFFI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 imm; + uint8_t eom = EOM & 0x22; + uint8_t imm; RDOPARG( imm ); if (0 == (eom & imm)) @@ -4592,7 +4592,7 @@ void upd7810_device::OFFI_EOM_xx() /* 64 dd: 0110 0100 1101 1101 xxxx xxxx */ void upd7810_device::OFFI_TMM_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (TMM & imm)) @@ -4602,7 +4602,7 @@ void upd7810_device::OFFI_TMM_xx() /* 64 e0: 0110 0100 1110 0000 xxxx xxxx */ void upd7810_device::SUI_ANM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = ANM - imm; @@ -4613,7 +4613,7 @@ void upd7810_device::SUI_ANM_xx() /* 64 e1: 0110 0100 1110 0001 xxxx xxxx */ void upd7810_device::SUI_SMH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = SMH - imm; @@ -4625,8 +4625,8 @@ void upd7810_device::SUI_SMH_xx() void upd7810_device::SUI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; + uint8_t eom = EOM & 0x22; + uint8_t tmp, imm; RDOPARG( imm ); tmp = eom - imm; @@ -4638,7 +4638,7 @@ void upd7810_device::SUI_EOM_xx() /* 64 e5: 0110 0100 1110 0101 xxxx xxxx */ void upd7810_device::SUI_TMM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = TMM - imm; @@ -4649,7 +4649,7 @@ void upd7810_device::SUI_TMM_xx() /* 64 e8: 0110 0100 1110 1000 xxxx xxxx */ void upd7810_device::NEI_ANM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = ANM - imm; @@ -4660,7 +4660,7 @@ void upd7810_device::NEI_ANM_xx() /* 64 e9: 0110 0100 1110 1001 xxxx xxxx */ void upd7810_device::NEI_SMH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = SMH - imm; @@ -4672,8 +4672,8 @@ void upd7810_device::NEI_SMH_xx() void upd7810_device::NEI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; + uint8_t eom = EOM & 0x22; + uint8_t tmp, imm; RDOPARG( imm ); tmp = eom - imm; @@ -4684,7 +4684,7 @@ void upd7810_device::NEI_EOM_xx() /* 64 ed: 0110 0100 1110 1101 xxxx xxxx */ void upd7810_device::NEI_TMM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = TMM - imm; @@ -4695,7 +4695,7 @@ void upd7810_device::NEI_TMM_xx() /* 64 f0: 0110 0100 1111 0000 xxxx xxxx */ void upd7810_device::SBI_ANM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = ANM - imm - (PSW & CY); @@ -4706,7 +4706,7 @@ void upd7810_device::SBI_ANM_xx() /* 64 f1: 0110 0100 1111 0001 xxxx xxxx */ void upd7810_device::SBI_SMH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = SMH - imm - (PSW & CY); @@ -4718,8 +4718,8 @@ void upd7810_device::SBI_SMH_xx() void upd7810_device::SBI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; + uint8_t eom = EOM & 0x22; + uint8_t tmp, imm; RDOPARG( imm ); tmp = eom - imm - (PSW & CY); @@ -4731,7 +4731,7 @@ void upd7810_device::SBI_EOM_xx() /* 64 f5: 0110 0100 1111 0101 xxxx xxxx */ void upd7810_device::SBI_TMM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = TMM - imm - (PSW & CY); @@ -4742,7 +4742,7 @@ void upd7810_device::SBI_TMM_xx() /* 64 f8: 0110 0100 1111 1000 xxxx xxxx */ void upd7810_device::EQI_ANM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = ANM - imm; @@ -4753,7 +4753,7 @@ void upd7810_device::EQI_ANM_xx() /* 64 f9: 0110 0100 1111 1001 xxxx xxxx */ void upd7810_device::EQI_SMH_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = SMH - imm; @@ -4765,8 +4765,8 @@ void upd7810_device::EQI_SMH_xx() void upd7810_device::EQI_EOM_xx() { /* only bits #1 and #5 can be read */ - UINT8 eom = EOM & 0x22; - UINT8 tmp, imm; + uint8_t eom = EOM & 0x22; + uint8_t tmp, imm; RDOPARG( imm ); tmp = eom - imm; @@ -4777,7 +4777,7 @@ void upd7810_device::EQI_EOM_xx() /* 64 fd: 0110 0100 1111 1101 xxxx xxxx */ void upd7810_device::EQI_TMM_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = TMM - imm; @@ -4885,7 +4885,7 @@ void upd7810_device::LHLD_w() /* 70 41: 0111 0000 0100 0001 */ void upd7810_device::EADD_EA_A() { - UINT16 tmp; + uint16_t tmp; tmp = EA + A; ZHC_ADD( tmp, EA, 0 ); EA = tmp; @@ -4894,7 +4894,7 @@ void upd7810_device::EADD_EA_A() /* 70 42: 0111 0000 0100 0010 */ void upd7810_device::EADD_EA_B() { - UINT16 tmp; + uint16_t tmp; tmp = EA + B; ZHC_ADD( tmp, EA, 0 ); EA = tmp; @@ -4903,7 +4903,7 @@ void upd7810_device::EADD_EA_B() /* 70 43: 0111 0000 0100 0011 */ void upd7810_device::EADD_EA_C() { - UINT16 tmp; + uint16_t tmp; tmp = EA + C; ZHC_ADD( tmp, EA, 0 ); EA = tmp; @@ -4912,7 +4912,7 @@ void upd7810_device::EADD_EA_C() /* 70 61: 0111 0000 0110 0001 */ void upd7810_device::ESUB_EA_A() { - UINT16 tmp; + uint16_t tmp; tmp = EA - A; ZHC_SUB( tmp, EA, 0 ); EA = tmp; @@ -4921,7 +4921,7 @@ void upd7810_device::ESUB_EA_A() /* 70 62: 0111 0000 0110 0010 */ void upd7810_device::ESUB_EA_B() { - UINT16 tmp; + uint16_t tmp; tmp = EA - B; ZHC_SUB( tmp, EA, 0 ); EA = tmp; @@ -4930,7 +4930,7 @@ void upd7810_device::ESUB_EA_B() /* 70 63: 0111 0000 0110 0011 */ void upd7810_device::ESUB_EA_C() { - UINT16 tmp; + uint16_t tmp; tmp = EA - C; ZHC_SUB( tmp, EA, 0 ); EA = tmp; @@ -5274,7 +5274,7 @@ void upd7810_device::ORAX_Hm() /* 70 a1: 0111 0000 1010 0001 */ void upd7810_device::ADDNCX_B() { - UINT8 tmp = A + RM( BC ); + uint8_t tmp = A + RM( BC ); ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -5283,7 +5283,7 @@ void upd7810_device::ADDNCX_B() /* 70 a2: 0111 0000 1010 0010 */ void upd7810_device::ADDNCX_D() { - UINT8 tmp = A + RM( DE ); + uint8_t tmp = A + RM( DE ); ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -5292,7 +5292,7 @@ void upd7810_device::ADDNCX_D() /* 70 a3: 0111 0000 1010 0011 */ void upd7810_device::ADDNCX_H() { - UINT8 tmp = A + RM( HL ); + uint8_t tmp = A + RM( HL ); ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -5301,7 +5301,7 @@ void upd7810_device::ADDNCX_H() /* 70 a4: 0111 0000 1010 0100 */ void upd7810_device::ADDNCX_Dp() { - UINT8 tmp = A + RM( DE ); + uint8_t tmp = A + RM( DE ); DE++; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5311,7 +5311,7 @@ void upd7810_device::ADDNCX_Dp() /* 70 a5: 0111 0000 1010 0101 */ void upd7810_device::ADDNCX_Hp() { - UINT8 tmp = A + RM( HL ); + uint8_t tmp = A + RM( HL ); HL++; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5321,7 +5321,7 @@ void upd7810_device::ADDNCX_Hp() /* 70 a6: 0111 0000 1010 0110 */ void upd7810_device::ADDNCX_Dm() { - UINT8 tmp = A + RM( DE ); + uint8_t tmp = A + RM( DE ); DE--; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5331,7 +5331,7 @@ void upd7810_device::ADDNCX_Dm() /* 70 a7: 0111 0000 1010 0111 */ void upd7810_device::ADDNCX_Hm() { - UINT8 tmp = A + RM( HL ); + uint8_t tmp = A + RM( HL ); HL--; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5341,7 +5341,7 @@ void upd7810_device::ADDNCX_Hm() /* 70 a9: 0111 0000 1010 1001 */ void upd7810_device::GTAX_B() { - UINT16 tmp = A - RM( BC ) - 1; + uint16_t tmp = A - RM( BC ) - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -5349,7 +5349,7 @@ void upd7810_device::GTAX_B() /* 70 aa: 0111 0000 1010 1010 */ void upd7810_device::GTAX_D() { - UINT16 tmp = A - RM( DE ) - 1; + uint16_t tmp = A - RM( DE ) - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -5357,7 +5357,7 @@ void upd7810_device::GTAX_D() /* 70 ab: 0111 0000 1010 1011 */ void upd7810_device::GTAX_H() { - UINT16 tmp = A - RM( HL ) - 1; + uint16_t tmp = A - RM( HL ) - 1; ZHC_SUB( tmp, A, 0 ); SKIP_NC; } @@ -5365,7 +5365,7 @@ void upd7810_device::GTAX_H() /* 70 ac: 0111 0000 1010 1100 */ void upd7810_device::GTAX_Dp() { - UINT16 tmp = A - RM( DE ) - 1; + uint16_t tmp = A - RM( DE ) - 1; DE++; ZHC_SUB( tmp, A, 0 ); SKIP_NC; @@ -5374,7 +5374,7 @@ void upd7810_device::GTAX_Dp() /* 70 ad: 0111 0000 1010 1101 */ void upd7810_device::GTAX_Hp() { - UINT16 tmp = A - RM( HL ) - 1; + uint16_t tmp = A - RM( HL ) - 1; HL++; ZHC_SUB( tmp, A, 0 ); SKIP_NC; @@ -5383,7 +5383,7 @@ void upd7810_device::GTAX_Hp() /* 70 ae: 0111 0000 1010 1110 */ void upd7810_device::GTAX_Dm() { - UINT16 tmp = A - RM( DE ) - 1; + uint16_t tmp = A - RM( DE ) - 1; DE--; ZHC_SUB( tmp, A, 0 ); SKIP_NC; @@ -5392,7 +5392,7 @@ void upd7810_device::GTAX_Dm() /* 70 af: 0111 0000 1010 1111 */ void upd7810_device::GTAX_Hm() { - UINT16 tmp = A - RM( HL ) - 1; + uint16_t tmp = A - RM( HL ) - 1; HL--; ZHC_SUB( tmp, A, 0 ); SKIP_NC; @@ -5401,7 +5401,7 @@ void upd7810_device::GTAX_Hm() /* 70 b1: 0111 0000 1011 0001 */ void upd7810_device::SUBNBX_B() { - UINT8 tmp = A - RM( BC ); + uint8_t tmp = A - RM( BC ); ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -5410,7 +5410,7 @@ void upd7810_device::SUBNBX_B() /* 70 b2: 0111 0000 1011 0010 */ void upd7810_device::SUBNBX_D() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -5419,7 +5419,7 @@ void upd7810_device::SUBNBX_D() /* 70 b3: 0111 0000 1011 0011 */ void upd7810_device::SUBNBX_H() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_NC; @@ -5428,7 +5428,7 @@ void upd7810_device::SUBNBX_H() /* 70 b4: 0111 0000 1011 0100 */ void upd7810_device::SUBNBX_Dp() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); DE++; ZHC_SUB( tmp, A, 0 ); A = tmp; @@ -5438,7 +5438,7 @@ void upd7810_device::SUBNBX_Dp() /* 70 b5: 0111 0000 1011 0101 */ void upd7810_device::SUBNBX_Hp() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); HL++; ZHC_SUB( tmp, A, 0 ); A = tmp; @@ -5448,7 +5448,7 @@ void upd7810_device::SUBNBX_Hp() /* 70 b6: 0111 0000 1011 0110 */ void upd7810_device::SUBNBX_Dm() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); DE--; ZHC_SUB( tmp, A, 0 ); A = tmp; @@ -5458,7 +5458,7 @@ void upd7810_device::SUBNBX_Dm() /* 70 b7: 0111 0000 1011 0111 */ void upd7810_device::SUBNBX_Hm() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); HL--; ZHC_SUB( tmp, A, 0 ); A = tmp; @@ -5468,7 +5468,7 @@ void upd7810_device::SUBNBX_Hm() /* 70 b9: 0111 0000 1011 1001 */ void upd7810_device::LTAX_B() { - UINT8 tmp = A - RM( BC ); + uint8_t tmp = A - RM( BC ); ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -5476,7 +5476,7 @@ void upd7810_device::LTAX_B() /* 70 ba: 0111 0000 1011 1010 */ void upd7810_device::LTAX_D() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -5484,7 +5484,7 @@ void upd7810_device::LTAX_D() /* 70 bb: 0111 0000 1011 1011 */ void upd7810_device::LTAX_H() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); ZHC_SUB( tmp, A, 0 ); SKIP_CY; } @@ -5492,7 +5492,7 @@ void upd7810_device::LTAX_H() /* 70 bc: 0111 0000 1011 1100 */ void upd7810_device::LTAX_Dp() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); DE++; ZHC_SUB( tmp, A, 0 ); SKIP_CY; @@ -5501,7 +5501,7 @@ void upd7810_device::LTAX_Dp() /* 70 bd: 0111 0000 1011 1101 */ void upd7810_device::LTAX_Hp() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); HL++; ZHC_SUB( tmp, A, 0 ); SKIP_CY; @@ -5510,7 +5510,7 @@ void upd7810_device::LTAX_Hp() /* 70 be: 0111 0000 1011 1110 */ void upd7810_device::LTAX_Dm() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); DE--; ZHC_SUB( tmp, A, 0 ); SKIP_CY; @@ -5519,7 +5519,7 @@ void upd7810_device::LTAX_Dm() /* 70 bf: 0111 0000 1011 1111 */ void upd7810_device::LTAX_Hm() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); HL--; ZHC_SUB( tmp, A, 0 ); SKIP_CY; @@ -5528,7 +5528,7 @@ void upd7810_device::LTAX_Hm() /* 70 c1: 0111 0000 1100 0001 */ void upd7810_device::ADDX_B() { - UINT8 tmp = A + RM( BC ); + uint8_t tmp = A + RM( BC ); ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -5536,7 +5536,7 @@ void upd7810_device::ADDX_B() /* 70 c2: 0111 0000 1100 0010 */ void upd7810_device::ADDX_D() { - UINT8 tmp = A + RM( DE ); + uint8_t tmp = A + RM( DE ); ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -5544,7 +5544,7 @@ void upd7810_device::ADDX_D() /* 70 c3: 0111 0000 1100 0011 */ void upd7810_device::ADDX_H() { - UINT8 tmp = A + RM( HL ); + uint8_t tmp = A + RM( HL ); ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -5552,7 +5552,7 @@ void upd7810_device::ADDX_H() /* 70 c4: 0111 0000 1100 0100 */ void upd7810_device::ADDX_Dp() { - UINT8 tmp = A + RM( DE ); + uint8_t tmp = A + RM( DE ); DE++; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5561,7 +5561,7 @@ void upd7810_device::ADDX_Dp() /* 70 c5: 0111 0000 1100 0101 */ void upd7810_device::ADDX_Hp() { - UINT8 tmp = A + RM( HL ); + uint8_t tmp = A + RM( HL ); HL++; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5570,7 +5570,7 @@ void upd7810_device::ADDX_Hp() /* 70 c6: 0111 0000 1100 0110 */ void upd7810_device::ADDX_Dm() { - UINT8 tmp = A + RM( DE ); + uint8_t tmp = A + RM( DE ); DE--; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5579,7 +5579,7 @@ void upd7810_device::ADDX_Dm() /* 70 c7: 0111 0000 1100 0111 */ void upd7810_device::ADDX_Hm() { - UINT8 tmp = A + RM( HL ); + uint8_t tmp = A + RM( HL ); HL--; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5655,7 +5655,7 @@ void upd7810_device::ONAX_Hm() /* 70 d1: 0111 0000 1101 0001 */ void upd7810_device::ADCX_B() { - UINT8 tmp = A + RM( BC ) + (PSW & CY); + uint8_t tmp = A + RM( BC ) + (PSW & CY); ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -5663,7 +5663,7 @@ void upd7810_device::ADCX_B() /* 70 d2: 0111 0000 1101 0010 */ void upd7810_device::ADCX_D() { - UINT8 tmp = A + RM( DE ) + (PSW & CY); + uint8_t tmp = A + RM( DE ) + (PSW & CY); ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -5671,7 +5671,7 @@ void upd7810_device::ADCX_D() /* 70 d3: 0111 0000 1101 0011 */ void upd7810_device::ADCX_H() { - UINT8 tmp = A + RM( HL ) + (PSW & CY); + uint8_t tmp = A + RM( HL ) + (PSW & CY); ZHC_ADD( tmp, A, 0 ); A = tmp; } @@ -5679,7 +5679,7 @@ void upd7810_device::ADCX_H() /* 70 d4: 0111 0000 1101 0100 */ void upd7810_device::ADCX_Dp() { - UINT8 tmp = A + RM( DE ) + (PSW & CY); + uint8_t tmp = A + RM( DE ) + (PSW & CY); DE++; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5688,7 +5688,7 @@ void upd7810_device::ADCX_Dp() /* 70 d5: 0111 0000 1101 0101 */ void upd7810_device::ADCX_Hp() { - UINT8 tmp = A + RM( HL ) + (PSW & CY); + uint8_t tmp = A + RM( HL ) + (PSW & CY); HL++; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5697,7 +5697,7 @@ void upd7810_device::ADCX_Hp() /* 70 d6: 0111 0000 1101 0110 */ void upd7810_device::ADCX_Dm() { - UINT8 tmp = A + RM( DE ) + (PSW & CY); + uint8_t tmp = A + RM( DE ) + (PSW & CY); DE--; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5706,7 +5706,7 @@ void upd7810_device::ADCX_Dm() /* 70 d7: 0111 0000 1101 0111 */ void upd7810_device::ADCX_Hm() { - UINT8 tmp = A + RM( HL ) + (PSW & CY); + uint8_t tmp = A + RM( HL ) + (PSW & CY); HL--; ZHC_ADD( tmp, A, 0 ); A = tmp; @@ -5782,7 +5782,7 @@ void upd7810_device::OFFAX_Hm() /* 70 e1: 0111 0000 1110 0001 */ void upd7810_device::SUBX_B() { - UINT8 tmp = A - RM( BC ); + uint8_t tmp = A - RM( BC ); ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -5790,7 +5790,7 @@ void upd7810_device::SUBX_B() /* 70 e2: 0111 0000 1110 0010 */ void upd7810_device::SUBX_D() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -5798,7 +5798,7 @@ void upd7810_device::SUBX_D() /* 70 e3: 0111 0000 1110 0011 */ void upd7810_device::SUBX_H() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); ZHC_SUB( tmp, A, 0 ); A = tmp; } @@ -5806,7 +5806,7 @@ void upd7810_device::SUBX_H() /* 70 e4: 0111 0000 1110 0100 */ void upd7810_device::SUBX_Dp() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); ZHC_SUB( tmp, A, 0 ); A = tmp; DE++; @@ -5815,7 +5815,7 @@ void upd7810_device::SUBX_Dp() /* 70 e5: 0111 0000 1110 0101 */ void upd7810_device::SUBX_Hp() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); ZHC_SUB( tmp, A, 0 ); A = tmp; HL++; @@ -5824,7 +5824,7 @@ void upd7810_device::SUBX_Hp() /* 70 e6: 0111 0000 1110 0110 */ void upd7810_device::SUBX_Dm() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); ZHC_SUB( tmp, A, 0 ); A = tmp; DE--; @@ -5833,7 +5833,7 @@ void upd7810_device::SUBX_Dm() /* 70 e7: 0111 0000 1110 0111 */ void upd7810_device::SUBX_Hm() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); ZHC_SUB( tmp, A, 0 ); A = tmp; HL--; @@ -5842,7 +5842,7 @@ void upd7810_device::SUBX_Hm() /* 70 e9: 0111 0000 1110 1001 */ void upd7810_device::NEAX_B() { - UINT8 tmp = A - RM( BC ); + uint8_t tmp = A - RM( BC ); ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -5850,7 +5850,7 @@ void upd7810_device::NEAX_B() /* 70 ea: 0111 0000 1110 1010 */ void upd7810_device::NEAX_D() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -5858,7 +5858,7 @@ void upd7810_device::NEAX_D() /* 70 eb: 0111 0000 1110 1011 */ void upd7810_device::NEAX_H() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); ZHC_SUB( tmp, A, 0 ); SKIP_NZ; } @@ -5866,7 +5866,7 @@ void upd7810_device::NEAX_H() /* 70 ec: 0111 0000 1110 1100 */ void upd7810_device::NEAX_Dp() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); DE++; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; @@ -5875,7 +5875,7 @@ void upd7810_device::NEAX_Dp() /* 70 ed: 0111 0000 1110 1101 */ void upd7810_device::NEAX_Hp() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); HL++; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; @@ -5884,7 +5884,7 @@ void upd7810_device::NEAX_Hp() /* 70 ee: 0111 0000 1110 1110 */ void upd7810_device::NEAX_Dm() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); DE--; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; @@ -5893,7 +5893,7 @@ void upd7810_device::NEAX_Dm() /* 70 ef: 0111 0000 1110 1111 */ void upd7810_device::NEAX_Hm() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); HL--; ZHC_SUB( tmp, A, 0 ); SKIP_NZ; @@ -5902,7 +5902,7 @@ void upd7810_device::NEAX_Hm() /* 70 f1: 0111 0000 1111 0001 */ void upd7810_device::SBBX_B() { - UINT8 tmp = A - RM( BC ) - (PSW & CY); + uint8_t tmp = A - RM( BC ) - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -5910,7 +5910,7 @@ void upd7810_device::SBBX_B() /* 70 f2: 0111 0000 1111 0010 */ void upd7810_device::SBBX_D() { - UINT8 tmp = A - RM( DE ) - (PSW & CY); + uint8_t tmp = A - RM( DE ) - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -5918,7 +5918,7 @@ void upd7810_device::SBBX_D() /* 70 f3: 0111 0000 1111 0011 */ void upd7810_device::SBBX_H() { - UINT8 tmp = A - RM( HL ) - (PSW & CY); + uint8_t tmp = A - RM( HL ) - (PSW & CY); ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; } @@ -5926,7 +5926,7 @@ void upd7810_device::SBBX_H() /* 70 f4: 0111 0000 1111 0100 */ void upd7810_device::SBBX_Dp() { - UINT8 tmp = A - RM( DE ) - (PSW & CY); + uint8_t tmp = A - RM( DE ) - (PSW & CY); DE++; ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; @@ -5935,7 +5935,7 @@ void upd7810_device::SBBX_Dp() /* 70 f5: 0111 0000 1111 0101 */ void upd7810_device::SBBX_Hp() { - UINT8 tmp = A - RM( HL ) - (PSW & CY); + uint8_t tmp = A - RM( HL ) - (PSW & CY); HL++; ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; @@ -5944,7 +5944,7 @@ void upd7810_device::SBBX_Hp() /* 70 f6: 0111 0000 1111 0110 */ void upd7810_device::SBBX_Dm() { - UINT8 tmp = A - RM( DE ) - (PSW & CY); + uint8_t tmp = A - RM( DE ) - (PSW & CY); DE--; ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; @@ -5953,7 +5953,7 @@ void upd7810_device::SBBX_Dm() /* 70 f7: 0111 0000 1111 0111 */ void upd7810_device::SBBX_Hm() { - UINT8 tmp = A - RM( HL ) - (PSW & CY); + uint8_t tmp = A - RM( HL ) - (PSW & CY); HL--; ZHC_SUB( tmp, A, (PSW & CY) ); A = tmp; @@ -5962,7 +5962,7 @@ void upd7810_device::SBBX_Hm() /* 70 f9: 0111 0000 1111 1001 */ void upd7810_device::EQAX_B() { - UINT8 tmp = A - RM( BC ); + uint8_t tmp = A - RM( BC ); ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -5970,7 +5970,7 @@ void upd7810_device::EQAX_B() /* 70 fa: 0111 0000 1111 1010 */ void upd7810_device::EQAX_D() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -5978,7 +5978,7 @@ void upd7810_device::EQAX_D() /* 70 fb: 0111 0000 1111 1011 */ void upd7810_device::EQAX_H() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); ZHC_SUB( tmp, A, 0 ); SKIP_Z; } @@ -5986,7 +5986,7 @@ void upd7810_device::EQAX_H() /* 70 fc: 0111 0000 1111 1100 */ void upd7810_device::EQAX_Dp() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); DE++; ZHC_SUB( tmp, A, 0 ); SKIP_Z; @@ -5995,7 +5995,7 @@ void upd7810_device::EQAX_Dp() /* 70 fd: 0111 0000 1111 1101 */ void upd7810_device::EQAX_Hp() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); HL++; ZHC_SUB( tmp, A, 0 ); SKIP_Z; @@ -6004,7 +6004,7 @@ void upd7810_device::EQAX_Hp() /* 70 fe: 0111 0000 1111 1110 */ void upd7810_device::EQAX_Dm() { - UINT8 tmp = A - RM( DE ); + uint8_t tmp = A - RM( DE ); DE--; ZHC_SUB( tmp, A, 0 ); SKIP_Z; @@ -6013,7 +6013,7 @@ void upd7810_device::EQAX_Dm() /* 70 ff: 0111 0000 1111 1111 */ void upd7810_device::EQAX_Hm() { - UINT8 tmp = A - RM( HL ); + uint8_t tmp = A - RM( HL ); HL--; ZHC_SUB( tmp, A, 0 ); SKIP_Z; @@ -6023,7 +6023,7 @@ void upd7810_device::EQAX_Hm() /* 74 08: 0111 0100 0000 1000 xxxx xxxx */ void upd7810_device::ANI_V_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); V &= imm; SET_Z(V); @@ -6032,7 +6032,7 @@ void upd7810_device::ANI_V_xx() /* 74 09: 0111 0100 0000 1001 xxxx xxxx */ void upd7810_device::ANI_A_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); A &= imm; SET_Z(A); @@ -6041,7 +6041,7 @@ void upd7810_device::ANI_A_xx() /* 74 0a: 0111 0100 0000 1010 xxxx xxxx */ void upd7810_device::ANI_B_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); B &= imm; SET_Z(B); @@ -6050,7 +6050,7 @@ void upd7810_device::ANI_B_xx() /* 74 0b: 0111 0100 0000 1011 xxxx xxxx */ void upd7810_device::ANI_C_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); C &= imm; SET_Z(C); @@ -6059,7 +6059,7 @@ void upd7810_device::ANI_C_xx() /* 74 0c: 0111 0100 0000 1100 xxxx xxxx */ void upd7810_device::ANI_D_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); D &= imm; SET_Z(D); @@ -6068,7 +6068,7 @@ void upd7810_device::ANI_D_xx() /* 74 0d: 0111 0100 0000 1101 xxxx xxxx */ void upd7810_device::ANI_E_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); E &= imm; SET_Z(E); @@ -6077,7 +6077,7 @@ void upd7810_device::ANI_E_xx() /* 74 0e: 0111 0100 0000 1110 xxxx xxxx */ void upd7810_device::ANI_H_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); H &= imm; SET_Z(H); @@ -6086,7 +6086,7 @@ void upd7810_device::ANI_H_xx() /* 74 0f: 0111 0100 0000 1111 xxxx xxxx */ void upd7810_device::ANI_L_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); L &= imm; SET_Z(L); @@ -6095,7 +6095,7 @@ void upd7810_device::ANI_L_xx() /* 74 10: 0111 0100 0001 0000 xxxx xxxx */ void upd7810_device::XRI_V_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); V ^= imm; SET_Z(V); @@ -6104,7 +6104,7 @@ void upd7810_device::XRI_V_xx() /* 74 11: 0111 0100 0001 0001 xxxx xxxx */ void upd7810_device::XRI_A_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); A ^= imm; SET_Z(A); @@ -6113,7 +6113,7 @@ void upd7810_device::XRI_A_xx() /* 74 12: 0111 0100 0001 0010 xxxx xxxx */ void upd7810_device::XRI_B_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); B ^= imm; SET_Z(B); @@ -6122,7 +6122,7 @@ void upd7810_device::XRI_B_xx() /* 74 13: 0111 0100 0001 0011 xxxx xxxx */ void upd7810_device::XRI_C_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); C ^= imm; SET_Z(C); @@ -6131,7 +6131,7 @@ void upd7810_device::XRI_C_xx() /* 74 14: 0111 0100 0001 0100 xxxx xxxx */ void upd7810_device::XRI_D_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); D ^= imm; SET_Z(D); @@ -6140,7 +6140,7 @@ void upd7810_device::XRI_D_xx() /* 74 15: 0111 0100 0001 0101 xxxx xxxx */ void upd7810_device::XRI_E_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); E ^= imm; SET_Z(E); @@ -6149,7 +6149,7 @@ void upd7810_device::XRI_E_xx() /* 74 16: 0111 0100 0001 0110 xxxx xxxx */ void upd7810_device::XRI_H_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); H ^= imm; SET_Z(H); @@ -6158,7 +6158,7 @@ void upd7810_device::XRI_H_xx() /* 74 17: 0111 0100 0001 0111 xxxx xxxx */ void upd7810_device::XRI_L_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); L ^= imm; SET_Z(L); @@ -6167,7 +6167,7 @@ void upd7810_device::XRI_L_xx() /* 74 18: 0111 0100 0001 1000 xxxx xxxx */ void upd7810_device::ORI_V_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); V |= imm; SET_Z(V); @@ -6176,7 +6176,7 @@ void upd7810_device::ORI_V_xx() /* 74 19: 0111 0100 0001 1001 xxxx xxxx */ void upd7810_device::ORI_A_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); A |= imm; SET_Z(A); @@ -6185,7 +6185,7 @@ void upd7810_device::ORI_A_xx() /* 74 1a: 0111 0100 0001 1010 xxxx xxxx */ void upd7810_device::ORI_B_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); B |= imm; SET_Z(B); @@ -6194,7 +6194,7 @@ void upd7810_device::ORI_B_xx() /* 74 1b: 0111 0100 0001 1011 xxxx xxxx */ void upd7810_device::ORI_C_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); C |= imm; SET_Z(C); @@ -6203,7 +6203,7 @@ void upd7810_device::ORI_C_xx() /* 74 1c: 0111 0100 0001 1100 xxxx xxxx */ void upd7810_device::ORI_D_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); D |= imm; SET_Z(D); @@ -6212,7 +6212,7 @@ void upd7810_device::ORI_D_xx() /* 74 1d: 0111 0100 0001 1101 xxxx xxxx */ void upd7810_device::ORI_E_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); E |= imm; SET_Z(E); @@ -6221,7 +6221,7 @@ void upd7810_device::ORI_E_xx() /* 74 1e: 0111 0100 0001 1110 xxxx xxxx */ void upd7810_device::ORI_H_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); H |= imm; SET_Z(H); @@ -6230,7 +6230,7 @@ void upd7810_device::ORI_H_xx() /* 74 1f: 0111 0100 0001 1111 xxxx xxxx */ void upd7810_device::ORI_L_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); L |= imm; SET_Z(L); @@ -6239,7 +6239,7 @@ void upd7810_device::ORI_L_xx() /* 74 20: 0111 0100 0010 0000 xxxx xxxx */ void upd7810_device::ADINC_V_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = V + imm; @@ -6252,7 +6252,7 @@ void upd7810_device::ADINC_V_xx() /* 74 21: 0111 0100 0010 0001 xxxx xxxx */ void upd7810_device::ADINC_A_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = A + imm; @@ -6265,7 +6265,7 @@ void upd7810_device::ADINC_A_xx() /* 74 22: 0111 0100 0010 0010 xxxx xxxx */ void upd7810_device::ADINC_B_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = B + imm; @@ -6278,7 +6278,7 @@ void upd7810_device::ADINC_B_xx() /* 74 23: 0111 0100 0010 0011 xxxx xxxx */ void upd7810_device::ADINC_C_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = C + imm; @@ -6291,7 +6291,7 @@ void upd7810_device::ADINC_C_xx() /* 74 24: 0111 0100 0010 0100 xxxx xxxx */ void upd7810_device::ADINC_D_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = D + imm; @@ -6304,7 +6304,7 @@ void upd7810_device::ADINC_D_xx() /* 74 25: 0111 0100 0010 0101 xxxx xxxx */ void upd7810_device::ADINC_E_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = E + imm; @@ -6317,7 +6317,7 @@ void upd7810_device::ADINC_E_xx() /* 74 26: 0111 0100 0010 0110 xxxx xxxx */ void upd7810_device::ADINC_H_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = H + imm; @@ -6330,7 +6330,7 @@ void upd7810_device::ADINC_H_xx() /* 74 27: 0111 0100 0010 0111 xxxx xxxx */ void upd7810_device::ADINC_L_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = L + imm; @@ -6343,8 +6343,8 @@ void upd7810_device::ADINC_L_xx() /* 74 28: 0111 0100 0010 1000 xxxx xxxx */ void upd7810_device::GTI_V_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = V - imm - 1; @@ -6356,8 +6356,8 @@ void upd7810_device::GTI_V_xx() /* 74 29: 0111 0100 0010 1001 xxxx xxxx */ void upd7810_device::GTI_A_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = A - imm - 1; @@ -6369,8 +6369,8 @@ void upd7810_device::GTI_A_xx() /* 74 2a: 0111 0100 0010 1010 xxxx xxxx */ void upd7810_device::GTI_B_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = B - imm - 1; @@ -6382,8 +6382,8 @@ void upd7810_device::GTI_B_xx() /* 74 2b: 0111 0100 0010 1011 xxxx xxxx */ void upd7810_device::GTI_C_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = C - imm - 1; @@ -6395,8 +6395,8 @@ void upd7810_device::GTI_C_xx() /* 74 2c: 0111 0100 0010 1100 xxxx xxxx */ void upd7810_device::GTI_D_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = D - imm - 1; @@ -6408,8 +6408,8 @@ void upd7810_device::GTI_D_xx() /* 74 2d: 0111 0100 0010 1101 xxxx xxxx */ void upd7810_device::GTI_E_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = E - imm - 1; @@ -6421,8 +6421,8 @@ void upd7810_device::GTI_E_xx() /* 74 2e: 0111 0100 0010 1110 xxxx xxxx */ void upd7810_device::GTI_H_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = H - imm - 1; @@ -6434,8 +6434,8 @@ void upd7810_device::GTI_H_xx() /* 74 2f: 0111 0100 0010 1111 xxxx xxxx */ void upd7810_device::GTI_L_xx() { - UINT8 imm; - UINT16 tmp; + uint8_t imm; + uint16_t tmp; RDOPARG( imm ); tmp = L - imm - 1; @@ -6447,7 +6447,7 @@ void upd7810_device::GTI_L_xx() /* 74 30: 0111 0100 0011 0000 xxxx xxxx */ void upd7810_device::SUINB_V_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = V - imm; @@ -6459,7 +6459,7 @@ void upd7810_device::SUINB_V_xx() /* 74 31: 0111 0100 0011 0001 xxxx xxxx */ void upd7810_device::SUINB_A_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = A - imm; @@ -6471,7 +6471,7 @@ void upd7810_device::SUINB_A_xx() /* 74 32: 0111 0100 0011 0010 xxxx xxxx */ void upd7810_device::SUINB_B_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = B - imm; @@ -6483,7 +6483,7 @@ void upd7810_device::SUINB_B_xx() /* 74 33: 0111 0100 0011 0011 xxxx xxxx */ void upd7810_device::SUINB_C_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = C - imm; @@ -6495,7 +6495,7 @@ void upd7810_device::SUINB_C_xx() /* 74 34: 0111 0100 0011 0100 xxxx xxxx */ void upd7810_device::SUINB_D_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = D - imm; @@ -6507,7 +6507,7 @@ void upd7810_device::SUINB_D_xx() /* 74 35: 0111 0100 0011 0101 xxxx xxxx */ void upd7810_device::SUINB_E_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = E - imm; @@ -6519,7 +6519,7 @@ void upd7810_device::SUINB_E_xx() /* 74 36: 0111 0100 0011 0110 xxxx xxxx */ void upd7810_device::SUINB_H_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = H - imm; @@ -6531,7 +6531,7 @@ void upd7810_device::SUINB_H_xx() /* 74 37: 0111 0100 0011 0111 xxxx xxxx */ void upd7810_device::SUINB_L_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = L - imm; @@ -6543,7 +6543,7 @@ void upd7810_device::SUINB_L_xx() /* 74 38: 0111 0100 0011 1000 xxxx xxxx */ void upd7810_device::LTI_V_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = V - imm; @@ -6554,7 +6554,7 @@ void upd7810_device::LTI_V_xx() /* 74 39: 0111 0100 0011 1001 xxxx xxxx */ void upd7810_device::LTI_A_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = A - imm; @@ -6565,7 +6565,7 @@ void upd7810_device::LTI_A_xx() /* 74 3a: 0111 0100 0011 1010 xxxx xxxx */ void upd7810_device::LTI_B_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = B - imm; @@ -6576,7 +6576,7 @@ void upd7810_device::LTI_B_xx() /* 74 3b: 0111 0100 0011 1011 xxxx xxxx */ void upd7810_device::LTI_C_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = C - imm; @@ -6587,7 +6587,7 @@ void upd7810_device::LTI_C_xx() /* 74 3c: 0111 0100 0011 1100 xxxx xxxx */ void upd7810_device::LTI_D_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = D - imm; @@ -6598,7 +6598,7 @@ void upd7810_device::LTI_D_xx() /* 74 3d: 0111 0100 0011 1101 xxxx xxxx */ void upd7810_device::LTI_E_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = E - imm; @@ -6609,7 +6609,7 @@ void upd7810_device::LTI_E_xx() /* 74 3e: 0111 0100 0011 1110 xxxx xxxx */ void upd7810_device::LTI_H_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = H - imm; @@ -6620,7 +6620,7 @@ void upd7810_device::LTI_H_xx() /* 74 3f: 0111 0100 0011 1111 xxxx xxxx */ void upd7810_device::LTI_L_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = L - imm; @@ -6631,7 +6631,7 @@ void upd7810_device::LTI_L_xx() /* 74 40: 0111 0100 0100 0000 xxxx xxxx */ void upd7810_device::ADI_V_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = V + imm; @@ -6643,7 +6643,7 @@ void upd7810_device::ADI_V_xx() /* 74 41: 0111 0100 0100 0001 xxxx xxxx */ void upd7810_device::ADI_A_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = A + imm; @@ -6655,7 +6655,7 @@ void upd7810_device::ADI_A_xx() /* 74 42: 0111 0100 0100 0010 xxxx xxxx */ void upd7810_device::ADI_B_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = B + imm; @@ -6667,7 +6667,7 @@ void upd7810_device::ADI_B_xx() /* 74 43: 0111 0100 0100 0011 xxxx xxxx */ void upd7810_device::ADI_C_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = C + imm; @@ -6679,7 +6679,7 @@ void upd7810_device::ADI_C_xx() /* 74 44: 0111 0100 0100 0100 xxxx xxxx */ void upd7810_device::ADI_D_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = D + imm; @@ -6691,7 +6691,7 @@ void upd7810_device::ADI_D_xx() /* 74 45: 0111 0100 0100 0101 xxxx xxxx */ void upd7810_device::ADI_E_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = E + imm; @@ -6703,7 +6703,7 @@ void upd7810_device::ADI_E_xx() /* 74 46: 0111 0100 0100 0110 xxxx xxxx */ void upd7810_device::ADI_H_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = H + imm; @@ -6715,7 +6715,7 @@ void upd7810_device::ADI_H_xx() /* 74 47: 0111 0100 0100 0111 xxxx xxxx */ void upd7810_device::ADI_L_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = L + imm; @@ -6727,7 +6727,7 @@ void upd7810_device::ADI_L_xx() /* 74 48: 0111 0100 0100 1000 xxxx xxxx */ void upd7810_device::ONI_V_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (V & imm) @@ -6737,7 +6737,7 @@ void upd7810_device::ONI_V_xx() /* 74 49: 0111 0100 0100 1001 xxxx xxxx */ void upd7810_device::ONI_A_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (A & imm) @@ -6747,7 +6747,7 @@ void upd7810_device::ONI_A_xx() /* 74 4a: 0111 0100 0100 1010 xxxx xxxx */ void upd7810_device::ONI_B_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (B & imm) @@ -6757,7 +6757,7 @@ void upd7810_device::ONI_B_xx() /* 74 4b: 0111 0100 0100 1011 xxxx xxxx */ void upd7810_device::ONI_C_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (C & imm) @@ -6767,7 +6767,7 @@ void upd7810_device::ONI_C_xx() /* 74 4c: 0111 0100 0100 1100 xxxx xxxx */ void upd7810_device::ONI_D_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (D & imm) @@ -6777,7 +6777,7 @@ void upd7810_device::ONI_D_xx() /* 74 4d: 0111 0100 0100 1101 xxxx xxxx */ void upd7810_device::ONI_E_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (E & imm) @@ -6787,7 +6787,7 @@ void upd7810_device::ONI_E_xx() /* 74 4e: 0111 0100 0100 1110 xxxx xxxx */ void upd7810_device::ONI_H_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (H & imm) @@ -6797,7 +6797,7 @@ void upd7810_device::ONI_H_xx() /* 74 4f: 0111 0100 0100 1111 xxxx xxxx */ void upd7810_device::ONI_L_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (L & imm) @@ -6807,7 +6807,7 @@ void upd7810_device::ONI_L_xx() /* 74 50: 0111 0100 0101 0000 xxxx xxxx */ void upd7810_device::ACI_V_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = V + imm + (PSW & CY); @@ -6818,7 +6818,7 @@ void upd7810_device::ACI_V_xx() /* 74 51: 0111 0100 0101 0001 xxxx xxxx */ void upd7810_device::ACI_A_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = A + imm + (PSW & CY); @@ -6829,7 +6829,7 @@ void upd7810_device::ACI_A_xx() /* 74 52: 0111 0100 0101 0010 xxxx xxxx */ void upd7810_device::ACI_B_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = B + imm + (PSW & CY); @@ -6840,7 +6840,7 @@ void upd7810_device::ACI_B_xx() /* 74 53: 0111 0100 0101 0011 xxxx xxxx */ void upd7810_device::ACI_C_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = C + imm + (PSW & CY); @@ -6851,7 +6851,7 @@ void upd7810_device::ACI_C_xx() /* 74 54: 0111 0100 0101 0100 xxxx xxxx */ void upd7810_device::ACI_D_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = D + imm + (PSW & CY); @@ -6862,7 +6862,7 @@ void upd7810_device::ACI_D_xx() /* 74 55: 0111 0100 0101 0101 xxxx xxxx */ void upd7810_device::ACI_E_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = E + imm + (PSW & CY); @@ -6873,7 +6873,7 @@ void upd7810_device::ACI_E_xx() /* 74 56: 0111 0100 0101 0110 xxxx xxxx */ void upd7810_device::ACI_H_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = H + imm + (PSW & CY); @@ -6884,7 +6884,7 @@ void upd7810_device::ACI_H_xx() /* 74 57: 0111 0100 0101 0111 xxxx xxxx */ void upd7810_device::ACI_L_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = L + imm + (PSW & CY); @@ -6895,7 +6895,7 @@ void upd7810_device::ACI_L_xx() /* 74 58: 0111 0100 0101 1000 xxxx xxxx */ void upd7810_device::OFFI_V_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (V & imm)) @@ -6905,7 +6905,7 @@ void upd7810_device::OFFI_V_xx() /* 74 59: 0111 0100 0101 1001 xxxx xxxx */ void upd7810_device::OFFI_A_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (A & imm)) @@ -6915,7 +6915,7 @@ void upd7810_device::OFFI_A_xx() /* 74 5a: 0111 0100 0101 1010 xxxx xxxx */ void upd7810_device::OFFI_B_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (B & imm)) @@ -6925,7 +6925,7 @@ void upd7810_device::OFFI_B_xx() /* 74 5b: 0111 0100 0101 1011 xxxx xxxx */ void upd7810_device::OFFI_C_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (C & imm)) @@ -6935,7 +6935,7 @@ void upd7810_device::OFFI_C_xx() /* 74 5c: 0111 0100 0101 1100 xxxx xxxx */ void upd7810_device::OFFI_D_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (D & imm)) @@ -6945,7 +6945,7 @@ void upd7810_device::OFFI_D_xx() /* 74 5d: 0111 0100 0101 1101 xxxx xxxx */ void upd7810_device::OFFI_E_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (E & imm)) @@ -6955,7 +6955,7 @@ void upd7810_device::OFFI_E_xx() /* 74 5e: 0111 0100 0101 1110 xxxx xxxx */ void upd7810_device::OFFI_H_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (H & imm)) @@ -6965,7 +6965,7 @@ void upd7810_device::OFFI_H_xx() /* 74 5f: 0111 0100 0101 1111 xxxx xxxx */ void upd7810_device::OFFI_L_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); if (0 == (L & imm)) @@ -6975,7 +6975,7 @@ void upd7810_device::OFFI_L_xx() /* 74 60: 0111 0100 0110 0000 xxxx xxxx */ void upd7810_device::SUI_V_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = V - imm; @@ -6986,7 +6986,7 @@ void upd7810_device::SUI_V_xx() /* 74 61: 0111 0100 0110 0001 xxxx xxxx */ void upd7810_device::SUI_A_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = A - imm; @@ -6997,7 +6997,7 @@ void upd7810_device::SUI_A_xx() /* 74 62: 0111 0100 0110 0010 xxxx xxxx */ void upd7810_device::SUI_B_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = B - imm; @@ -7008,7 +7008,7 @@ void upd7810_device::SUI_B_xx() /* 74 63: 0111 0100 0110 0011 xxxx xxxx */ void upd7810_device::SUI_C_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = C - imm; @@ -7019,7 +7019,7 @@ void upd7810_device::SUI_C_xx() /* 74 64: 0111 0100 0110 0100 xxxx xxxx */ void upd7810_device::SUI_D_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = D - imm; @@ -7030,7 +7030,7 @@ void upd7810_device::SUI_D_xx() /* 74 65: 0111 0100 0110 0101 xxxx xxxx */ void upd7810_device::SUI_E_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = E - imm; @@ -7041,7 +7041,7 @@ void upd7810_device::SUI_E_xx() /* 74 66: 0111 0100 0110 0110 xxxx xxxx */ void upd7810_device::SUI_H_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = H - imm; @@ -7052,7 +7052,7 @@ void upd7810_device::SUI_H_xx() /* 74 67: 0111 0100 0110 0111 xxxx xxxx */ void upd7810_device::SUI_L_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = L - imm; @@ -7063,7 +7063,7 @@ void upd7810_device::SUI_L_xx() /* 74 68: 0111 0100 0110 1000 xxxx xxxx */ void upd7810_device::NEI_V_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = V - imm; @@ -7074,7 +7074,7 @@ void upd7810_device::NEI_V_xx() /* 74 69: 0111 0100 0110 1001 xxxx xxxx */ void upd7810_device::NEI_A_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = A - imm; @@ -7085,7 +7085,7 @@ void upd7810_device::NEI_A_xx() /* 74 6a: 0111 0100 0110 1010 xxxx xxxx */ void upd7810_device::NEI_B_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = B - imm; @@ -7096,7 +7096,7 @@ void upd7810_device::NEI_B_xx() /* 74 6b: 0111 0100 0110 1011 xxxx xxxx */ void upd7810_device::NEI_C_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = C - imm; @@ -7107,7 +7107,7 @@ void upd7810_device::NEI_C_xx() /* 74 6c: 0111 0100 0110 1100 xxxx xxxx */ void upd7810_device::NEI_D_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = D - imm; @@ -7118,7 +7118,7 @@ void upd7810_device::NEI_D_xx() /* 74 6d: 0111 0100 0110 1101 xxxx xxxx */ void upd7810_device::NEI_E_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = E - imm; @@ -7129,7 +7129,7 @@ void upd7810_device::NEI_E_xx() /* 74 6e: 0111 0100 0110 1110 xxxx xxxx */ void upd7810_device::NEI_H_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = H - imm; @@ -7140,7 +7140,7 @@ void upd7810_device::NEI_H_xx() /* 74 6f: 0111 0100 0110 1111 xxxx xxxx */ void upd7810_device::NEI_L_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = L - imm; @@ -7151,7 +7151,7 @@ void upd7810_device::NEI_L_xx() /* 74 70: 0111 0100 0111 0000 xxxx xxxx */ void upd7810_device::SBI_V_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = V - imm - (PSW & CY); @@ -7162,7 +7162,7 @@ void upd7810_device::SBI_V_xx() /* 74 71: 0111 0100 0111 0001 xxxx xxxx */ void upd7810_device::SBI_A_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = A - imm - (PSW & CY); @@ -7173,7 +7173,7 @@ void upd7810_device::SBI_A_xx() /* 74 72: 0111 0100 0111 0010 xxxx xxxx */ void upd7810_device::SBI_B_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = B - imm - (PSW & CY); @@ -7184,7 +7184,7 @@ void upd7810_device::SBI_B_xx() /* 74 73: 0111 0100 0111 0011 xxxx xxxx */ void upd7810_device::SBI_C_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = C - imm - (PSW & CY); @@ -7195,7 +7195,7 @@ void upd7810_device::SBI_C_xx() /* 74 74: 0111 0100 0111 0100 xxxx xxxx */ void upd7810_device::SBI_D_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = D - imm - (PSW & CY); @@ -7206,7 +7206,7 @@ void upd7810_device::SBI_D_xx() /* 74 75: 0111 0100 0111 0101 xxxx xxxx */ void upd7810_device::SBI_E_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = E - imm - (PSW & CY); @@ -7217,7 +7217,7 @@ void upd7810_device::SBI_E_xx() /* 74 76: 0111 0100 0111 0110 xxxx xxxx */ void upd7810_device::SBI_H_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = H - imm - (PSW & CY); @@ -7228,7 +7228,7 @@ void upd7810_device::SBI_H_xx() /* 74 77: 0111 0100 0111 0111 xxxx xxxx */ void upd7810_device::SBI_L_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = L - imm - (PSW & CY); @@ -7239,7 +7239,7 @@ void upd7810_device::SBI_L_xx() /* 74 78: 0111 0100 0111 1000 xxxx xxxx */ void upd7810_device::EQI_V_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = V - imm; @@ -7250,7 +7250,7 @@ void upd7810_device::EQI_V_xx() /* 74 79: 0111 0100 0111 1001 xxxx xxxx */ void upd7810_device::EQI_A_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = A - imm; @@ -7261,7 +7261,7 @@ void upd7810_device::EQI_A_xx() /* 74 7a: 0111 0100 0111 1010 xxxx xxxx */ void upd7810_device::EQI_B_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = B - imm; @@ -7272,7 +7272,7 @@ void upd7810_device::EQI_B_xx() /* 74 7b: 0111 0100 0111 1011 xxxx xxxx */ void upd7810_device::EQI_C_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = C - imm; @@ -7283,7 +7283,7 @@ void upd7810_device::EQI_C_xx() /* 74 7c: 0111 0100 0111 1100 xxxx xxxx */ void upd7810_device::EQI_D_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = D - imm; @@ -7294,7 +7294,7 @@ void upd7810_device::EQI_D_xx() /* 74 7d: 0111 0100 0111 1101 xxxx xxxx */ void upd7810_device::EQI_E_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = E - imm; @@ -7305,7 +7305,7 @@ void upd7810_device::EQI_E_xx() /* 74 7e: 0111 0100 0111 1110 xxxx xxxx */ void upd7810_device::EQI_H_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = H - imm; @@ -7316,7 +7316,7 @@ void upd7810_device::EQI_H_xx() /* 74 7f: 0111 0100 0111 1111 xxxx xxxx */ void upd7810_device::EQI_L_xx() { - UINT8 tmp, imm; + uint8_t tmp, imm; RDOPARG( imm ); tmp = L - imm; @@ -7421,7 +7421,7 @@ void upd7810_device::DOR_EA_HL() void upd7810_device::ADDNCW_wa() { PAIR ea = m_va; - UINT8 tmp; + uint8_t tmp; RDOPARG( ea.b.l ); @@ -7434,7 +7434,7 @@ void upd7810_device::ADDNCW_wa() /* 74 a5: 0111 0100 1010 0101 */ void upd7810_device::DADDNC_EA_BC() { - UINT16 tmp = EA + BC; + uint16_t tmp = EA + BC; ZHC_ADD( tmp, EA, 0 ); EA = tmp; @@ -7444,7 +7444,7 @@ void upd7810_device::DADDNC_EA_BC() /* 74 a6: 0111 0100 1010 0110 */ void upd7810_device::DADDNC_EA_DE() { - UINT16 tmp = EA + DE; + uint16_t tmp = EA + DE; ZHC_ADD( tmp, EA, 0 ); EA = tmp; @@ -7454,7 +7454,7 @@ void upd7810_device::DADDNC_EA_DE() /* 74 a7: 0111 0100 1010 0111 */ void upd7810_device::DADDNC_EA_HL() { - UINT16 tmp = EA + HL; + uint16_t tmp = EA + HL; ZHC_ADD( tmp, EA, 0 ); EA = tmp; @@ -7465,7 +7465,7 @@ void upd7810_device::DADDNC_EA_HL() void upd7810_device::GTAW_wa() { PAIR ea = m_va; - UINT16 tmp; + uint16_t tmp; RDOPARG( ea.b.l ); tmp = A - RM( ea.d ) - 1; @@ -7476,7 +7476,7 @@ void upd7810_device::GTAW_wa() /* 74 ad: 0111 0100 1010 1101 */ void upd7810_device::DGT_EA_BC() { - UINT32 tmp = EA - BC - 1; + uint32_t tmp = EA - BC - 1; ZHC_SUB( tmp, EA, 0 ); SKIP_NC; } @@ -7484,7 +7484,7 @@ void upd7810_device::DGT_EA_BC() /* 74 ae: 0111 0100 1010 1110 */ void upd7810_device::DGT_EA_DE() { - UINT32 tmp = EA - DE - 1; + uint32_t tmp = EA - DE - 1; ZHC_SUB( tmp, EA, 0 ); SKIP_NC; } @@ -7492,7 +7492,7 @@ void upd7810_device::DGT_EA_DE() /* 74 af: 0111 0100 1010 1111 */ void upd7810_device::DGT_EA_HL() { - UINT32 tmp = EA - HL - 1; + uint32_t tmp = EA - HL - 1; ZHC_SUB( tmp, EA, 0 ); SKIP_NC; } @@ -7501,7 +7501,7 @@ void upd7810_device::DGT_EA_HL() void upd7810_device::SUBNBW_wa() { PAIR ea = m_va; - UINT8 tmp; + uint8_t tmp; RDOPARG( ea.b.l ); tmp = A - RM( ea.d ); @@ -7513,7 +7513,7 @@ void upd7810_device::SUBNBW_wa() /* 74 b5: 0111 0100 1011 0101 */ void upd7810_device::DSUBNB_EA_BC() { - UINT16 tmp = EA - BC; + uint16_t tmp = EA - BC; ZHC_SUB( tmp, EA, 0 ); EA = tmp; SKIP_NC; @@ -7522,7 +7522,7 @@ void upd7810_device::DSUBNB_EA_BC() /* 74 b6: 0111 0100 1011 0110 */ void upd7810_device::DSUBNB_EA_DE() { - UINT16 tmp = EA - DE; + uint16_t tmp = EA - DE; ZHC_SUB( tmp, EA, 0 ); EA = tmp; SKIP_NC; @@ -7531,7 +7531,7 @@ void upd7810_device::DSUBNB_EA_DE() /* 74 b7: 0111 0100 1011 0111 */ void upd7810_device::DSUBNB_EA_HL() { - UINT16 tmp; + uint16_t tmp; tmp = EA - HL; ZHC_SUB( tmp, EA, 0 ); @@ -7543,7 +7543,7 @@ void upd7810_device::DSUBNB_EA_HL() void upd7810_device::LTAW_wa() { PAIR ea = m_va; - UINT8 tmp; + uint8_t tmp; RDOPARG( ea.b.l ); tmp = A - RM( ea.d ); @@ -7554,7 +7554,7 @@ void upd7810_device::LTAW_wa() /* 74 bd: 0111 0100 1011 1101 */ void upd7810_device::DLT_EA_BC() { - UINT16 tmp = EA - BC; + uint16_t tmp = EA - BC; ZHC_SUB( tmp, EA, 0 ); SKIP_CY; } @@ -7562,7 +7562,7 @@ void upd7810_device::DLT_EA_BC() /* 74 be: 0111 0100 1011 1110 */ void upd7810_device::DLT_EA_DE() { - UINT16 tmp = EA - DE; + uint16_t tmp = EA - DE; ZHC_SUB( tmp, EA, 0 ); SKIP_CY; } @@ -7570,7 +7570,7 @@ void upd7810_device::DLT_EA_DE() /* 74 bf: 0111 0100 1011 1111 */ void upd7810_device::DLT_EA_HL() { - UINT16 tmp = EA - HL; + uint16_t tmp = EA - HL; ZHC_SUB( tmp, EA, 0 ); SKIP_CY; } @@ -7579,7 +7579,7 @@ void upd7810_device::DLT_EA_HL() void upd7810_device::ADDW_wa() { PAIR ea = m_va; - UINT8 tmp; + uint8_t tmp; RDOPARG( ea.b.l ); tmp = A + RM( ea.d ); ZHC_ADD( tmp, A, 0 ); @@ -7589,7 +7589,7 @@ void upd7810_device::ADDW_wa() /* 74 c5: 0111 0100 1100 0101 */ void upd7810_device::DADD_EA_BC() { - UINT16 tmp = EA + BC; + uint16_t tmp = EA + BC; ZHC_ADD( tmp, EA, 0 ); EA = tmp; } @@ -7597,7 +7597,7 @@ void upd7810_device::DADD_EA_BC() /* 74 c6: 0111 0100 1100 0110 */ void upd7810_device::DADD_EA_DE() { - UINT16 tmp = EA + DE; + uint16_t tmp = EA + DE; ZHC_ADD( tmp, EA, 0 ); EA = tmp; } @@ -7605,7 +7605,7 @@ void upd7810_device::DADD_EA_DE() /* 74 c7: 0111 0100 1100 0111 */ void upd7810_device::DADD_EA_HL() { - UINT16 tmp = EA + HL; + uint16_t tmp = EA + HL; ZHC_ADD( tmp, EA, 0 ); EA = tmp; } @@ -7653,7 +7653,7 @@ void upd7810_device::DON_EA_HL() void upd7810_device::ADCW_wa() { PAIR ea = m_va; - UINT8 tmp; + uint8_t tmp; RDOPARG( ea.b.l ); tmp = A + RM( ea.d ) + (PSW & CY); @@ -7664,7 +7664,7 @@ void upd7810_device::ADCW_wa() /* 74 d5: 0111 0100 1101 0101 */ void upd7810_device::DADC_EA_BC() { - UINT16 tmp = EA + BC + (PSW & CY); + uint16_t tmp = EA + BC + (PSW & CY); ZHC_ADD( tmp, EA, (PSW & CY) ); EA = tmp; } @@ -7672,7 +7672,7 @@ void upd7810_device::DADC_EA_BC() /* 74 d6: 0111 0100 1101 0110 */ void upd7810_device::DADC_EA_DE() { - UINT16 tmp = EA + DE + (PSW & CY); + uint16_t tmp = EA + DE + (PSW & CY); ZHC_ADD( tmp, EA, (PSW & CY) ); EA = tmp; } @@ -7680,7 +7680,7 @@ void upd7810_device::DADC_EA_DE() /* 74 d7: 0111 0100 1101 0111 */ void upd7810_device::DADC_EA_HL() { - UINT16 tmp = EA + HL + (PSW & CY); + uint16_t tmp = EA + HL + (PSW & CY); ZHC_ADD( tmp, EA, (PSW & CY) ); EA = tmp; } @@ -7728,7 +7728,7 @@ void upd7810_device::DOFF_EA_HL() void upd7810_device::SUBW_wa() { PAIR ea = m_va; - UINT8 tmp; + uint8_t tmp; RDOPARG( ea.b.l ); tmp = A - RM( ea.d ); @@ -7739,7 +7739,7 @@ void upd7810_device::SUBW_wa() /* 74 e5: 0111 0100 1110 0101 */ void upd7810_device::DSUB_EA_BC() { - UINT16 tmp = EA - BC; + uint16_t tmp = EA - BC; ZHC_SUB( tmp, EA, 0 ); EA = tmp; } @@ -7747,7 +7747,7 @@ void upd7810_device::DSUB_EA_BC() /* 74 e6: 0111 0100 1110 0110 */ void upd7810_device::DSUB_EA_DE() { - UINT16 tmp = EA - DE; + uint16_t tmp = EA - DE; ZHC_SUB( tmp, EA, 0 ); EA = tmp; } @@ -7755,7 +7755,7 @@ void upd7810_device::DSUB_EA_DE() /* 74 e7: 0111 0100 1110 0111 */ void upd7810_device::DSUB_EA_HL() { - UINT16 tmp = EA - HL; + uint16_t tmp = EA - HL; ZHC_SUB( tmp, EA, 0 ); EA = tmp; } @@ -7764,7 +7764,7 @@ void upd7810_device::DSUB_EA_HL() void upd7810_device::NEAW_wa() { PAIR ea = m_va; - UINT8 tmp; + uint8_t tmp; RDOPARG( ea.b.l ); tmp = A - RM( ea.d ); @@ -7775,7 +7775,7 @@ void upd7810_device::NEAW_wa() /* 74 ed: 0111 0100 1110 1101 */ void upd7810_device::DNE_EA_BC() { - UINT16 tmp; + uint16_t tmp; tmp = EA - BC; ZHC_SUB( tmp, EA, 0 ); @@ -7785,7 +7785,7 @@ void upd7810_device::DNE_EA_BC() /* 74 ee: 0111 0100 1110 1110 */ void upd7810_device::DNE_EA_DE() { - UINT16 tmp; + uint16_t tmp; tmp = EA - DE; ZHC_SUB( tmp, EA, 0 ); @@ -7795,7 +7795,7 @@ void upd7810_device::DNE_EA_DE() /* 74 ef: 0111 0100 1110 1111 */ void upd7810_device::DNE_EA_HL() { - UINT16 tmp; + uint16_t tmp; tmp = EA - HL; ZHC_SUB( tmp, EA, 0 ); @@ -7806,7 +7806,7 @@ void upd7810_device::DNE_EA_HL() void upd7810_device::SBBW_wa() { PAIR ea = m_va; - UINT8 tmp; + uint8_t tmp; RDOPARG( ea.b.l ); tmp = A - RM( ea.d ) - (PSW & CY); @@ -7817,7 +7817,7 @@ void upd7810_device::SBBW_wa() /* 74 f5: 0111 0100 1111 0101 */ void upd7810_device::DSBB_EA_BC() { - UINT16 tmp = EA - BC - (PSW & CY); + uint16_t tmp = EA - BC - (PSW & CY); ZHC_SUB( tmp, EA, (PSW & CY) ); EA = tmp; } @@ -7825,7 +7825,7 @@ void upd7810_device::DSBB_EA_BC() /* 74 f6: 0111 0100 1111 0110 */ void upd7810_device::DSBB_EA_DE() { - UINT16 tmp = EA - DE - (PSW & CY); + uint16_t tmp = EA - DE - (PSW & CY); ZHC_SUB( tmp, EA, (PSW & CY) ); EA = tmp; } @@ -7833,7 +7833,7 @@ void upd7810_device::DSBB_EA_DE() /* 74 f7: 0111 0100 1111 0111 */ void upd7810_device::DSBB_EA_HL() { - UINT16 tmp = EA - HL - (PSW & CY); + uint16_t tmp = EA - HL - (PSW & CY); ZHC_SUB( tmp, EA, (PSW & CY) ); EA = tmp; } @@ -7842,7 +7842,7 @@ void upd7810_device::DSBB_EA_HL() void upd7810_device::EQAW_wa() { PAIR ea = m_va; - UINT8 tmp; + uint8_t tmp; RDOPARG( ea.b.l ); tmp = A - RM( ea.d ); @@ -7853,7 +7853,7 @@ void upd7810_device::EQAW_wa() /* 74 fd: 0111 0100 1111 1101 */ void upd7810_device::DEQ_EA_BC() { - UINT16 tmp; + uint16_t tmp; tmp = EA - BC; ZHC_SUB( tmp, EA, 0 ); @@ -7863,7 +7863,7 @@ void upd7810_device::DEQ_EA_BC() /* 74 fe: 0111 0100 1111 1110 */ void upd7810_device::DEQ_EA_DE() { - UINT16 tmp; + uint16_t tmp; tmp = EA - DE; ZHC_SUB( tmp, EA, 0 ); @@ -7873,7 +7873,7 @@ void upd7810_device::DEQ_EA_DE() /* 74 ff: 0111 0100 1111 1111 */ void upd7810_device::DEQ_EA_HL() { - UINT16 tmp; + uint16_t tmp; tmp = EA - HL; ZHC_SUB( tmp, EA, 0 ); @@ -7922,7 +7922,7 @@ void upd7810_device::LXI_S_w() void upd7810_device::ANIW_wa_xx() { PAIR ea = m_va; - UINT8 m, imm; + uint8_t m, imm; RDOPARG( ea.b.l ); RDOPARG( imm ); @@ -7986,7 +7986,7 @@ void upd7810_device::MOV_A_L() /* 10: 0001 0000 */ void upd7810_device::EXA() { - UINT16 tmp; + uint16_t tmp; tmp = EA; EA = EA2; EA2 = tmp; tmp = VA; VA = VA2; VA2 = tmp; } @@ -7994,7 +7994,7 @@ void upd7810_device::EXA() /* 11: 0001 0001 */ void upd7810_device::EXX() { - UINT16 tmp; + uint16_t tmp; tmp = BC; BC = BC2; BC2 = tmp; tmp = DE; DE = DE2; DE2 = tmp; tmp = HL; HL = HL2; HL2 = tmp; @@ -8003,7 +8003,7 @@ void upd7810_device::EXX() /* 48 AD (7807 only) */ void upd7810_device::EXR() { - UINT16 tmp; + uint16_t tmp; tmp = BC; BC = BC2; BC2 = tmp; tmp = DE; DE = DE2; DE2 = tmp; tmp = HL; HL = HL2; HL2 = tmp; @@ -8034,7 +8034,7 @@ void upd7810_device::LXI_B_w() void upd7810_device::ORIW_wa_xx() { PAIR ea = m_va; - UINT8 m, imm; + uint8_t m, imm; RDOPARG( ea.b.l ); RDOPARG( imm ); @@ -8102,7 +8102,7 @@ void upd7810_device::MOV_L_A() void upd7810_device::INRW_wa() { PAIR ea = m_va; - UINT8 tmp, m; + uint8_t tmp, m; RDOPARG( ea.b.l ); m = RM( ea.d ); @@ -8141,8 +8141,8 @@ void upd7810_device::LXI_D_w() void upd7810_device::GTIW_wa_xx() { PAIR ea = m_va; - UINT8 m, imm; - UINT16 tmp; + uint8_t m, imm; + uint16_t tmp; RDOPARG( ea.b.l ); RDOPARG( imm ); @@ -8208,7 +8208,7 @@ void upd7810_device::LDAX_Hm() void upd7810_device::DCRW_wa() { PAIR ea = m_va; - UINT8 tmp, m; + uint8_t tmp, m; RDOPARG( ea.b.l ); m = RM( ea.d ); @@ -8262,7 +8262,7 @@ void upd7810_device::LXI_H_w() void upd7810_device::LTIW_wa_xx() { PAIR ea = m_va; - UINT8 tmp, m, imm; + uint8_t tmp, m, imm; RDOPARG( ea.b.l ); RDOPARG( imm ); @@ -8344,7 +8344,7 @@ void upd7810_device::CALL_w() /* 41: 0100 0001 */ void upd7810_device::INR_A() { - UINT8 tmp = A + 1; + uint8_t tmp = A + 1; ZHC_ADD( tmp, A, 0 ); A = tmp; SKIP_CY; @@ -8353,7 +8353,7 @@ void upd7810_device::INR_A() /* 42: 0100 0010 */ void upd7810_device::INR_B() { - UINT8 tmp = B + 1; + uint8_t tmp = B + 1; ZHC_ADD( tmp, B, 0 ); B = tmp; SKIP_CY; @@ -8362,7 +8362,7 @@ void upd7810_device::INR_B() /* 43: 0100 0011 */ void upd7810_device::INR_C() { - UINT8 tmp = C + 1; + uint8_t tmp = C + 1; ZHC_ADD( tmp, C, 0 ); C = tmp; SKIP_CY; @@ -8379,7 +8379,7 @@ void upd7810_device::LXI_EA_s() void upd7810_device::ONIW_wa_xx() { PAIR ea = m_va; - UINT8 imm; + uint8_t imm; RDOPARG( ea.b.l ); RDOPARG( imm ); @@ -8406,7 +8406,7 @@ void upd7810_device::PRE_48() /* 49: 0100 1001 xxxx xxxx */ void upd7810_device::MVIX_BC_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); WM( BC, imm ); } @@ -8414,7 +8414,7 @@ void upd7810_device::MVIX_BC_xx() /* 4a: 0100 1010 xxxx xxxx */ void upd7810_device::MVIX_DE_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); WM( DE, imm ); } @@ -8422,7 +8422,7 @@ void upd7810_device::MVIX_DE_xx() /* 4b: 0100 1011 xxxx xxxx */ void upd7810_device::MVIX_HL_xx() { - UINT8 imm; + uint8_t imm; RDOPARG( imm ); WM( HL, imm ); } @@ -8448,7 +8448,7 @@ void upd7810_device::PRE_4D() /* 4e: 0100 111d dddd dddd */ void upd7810_device::JRE() { - UINT8 offs; + uint8_t offs; RDOPARG( offs ); if (OP & 0x01) PC -= 256 - offs; @@ -8459,14 +8459,14 @@ void upd7810_device::JRE() /* 50: 0101 0000 */ void upd7810_device::EXH() { - UINT16 tmp; + uint16_t tmp; tmp = HL; HL = HL2; HL2 = tmp; } /* 51: 0101 0001 */ void upd7810_device::DCR_A() { - UINT8 tmp = A - 1; + uint8_t tmp = A - 1; ZHC_SUB( tmp, A, 0 ); A = tmp; SKIP_CY; @@ -8475,7 +8475,7 @@ void upd7810_device::DCR_A() /* 52: 0101 0010 */ void upd7810_device::DCR_B() { - UINT8 tmp = B - 1; + uint8_t tmp = B - 1; ZHC_SUB( tmp, B, 0 ); B = tmp; SKIP_CY; @@ -8484,7 +8484,7 @@ void upd7810_device::DCR_B() /* 53: 0101 0011 */ void upd7810_device::DCR_C() { - UINT8 tmp = C - 1; + uint8_t tmp = C - 1; ZHC_SUB( tmp, C, 0 ); C = tmp; SKIP_CY; @@ -8506,7 +8506,7 @@ void upd7810_device::JMP_w() void upd7810_device::OFFIW_wa_xx() { PAIR ea = m_va; - UINT8 imm; + uint8_t imm; RDOPARG( ea.b.l ); RDOPARG( imm ); @@ -8612,7 +8612,7 @@ void upd7810_device::BIT_7_wa() /* 5d: 0101 1111 bbbb bbbb (7807 only) */ void upd7810_device::SKN_bit() { - UINT8 imm; + uint8_t imm; int val; RDOPARG( imm ); @@ -8665,7 +8665,7 @@ void upd7810_device::SKN_bit() /* 58: 0101 1000 bbbb bbbb (7807 only) */ void upd7810_device::SETB() { - UINT8 imm; + uint8_t imm; int bit; RDOPARG( imm ); @@ -8715,7 +8715,7 @@ void upd7810_device::SETB() /* 5b: 0101 1011 bbbb bbbb (7807 only) */ void upd7810_device::CLR() { - UINT8 imm; + uint8_t imm; int bit; RDOPARG( imm ); @@ -8765,7 +8765,7 @@ void upd7810_device::CLR() /* 5d: 0101 1111 bbbb bbbb (7807 only) */ void upd7810_device::SK_bit() { - UINT8 imm; + uint8_t imm; int val; RDOPARG( imm ); @@ -8827,7 +8827,7 @@ void upd7810_device::PRE_60() /* 61: 0110 0001 */ void upd7810_device::DAA() { - UINT8 l = A & 0x0f, h = A >> 4, tmp, adj = 0x00, old_cy = PSW & CY; + uint8_t l = A & 0x0f, h = A >> 4, tmp, adj = 0x00, old_cy = PSW & CY; if (0 == (PSW & HC)) { @@ -8892,7 +8892,7 @@ void upd7810_device::PRE_64() void upd7810_device::NEIW_wa_xx() { PAIR ea = m_va; - UINT8 tmp, m, imm; + uint8_t tmp, m, imm; RDOPARG( ea.b.l ); RDOPARG( imm ); @@ -8979,7 +8979,7 @@ void upd7810_device::PRE_70() void upd7810_device::MVIW_wa_xx() { PAIR ea = m_va; - UINT8 imm; + uint8_t imm; RDOPARG( ea.b.l ); RDOPARG( imm ); @@ -9013,7 +9013,7 @@ void upd7810_device::PRE_74() void upd7810_device::EQIW_wa_xx() { PAIR ea = m_va; - UINT8 tmp, m, imm; + uint8_t tmp, m, imm; RDOPARG( ea.b.l ); RDOPARG( imm ); @@ -9147,7 +9147,7 @@ void upd7810_device::EI() /* ab: 1010 1011 dddd dddd */ void upd7810_device::LDAX_D_xx() { - UINT16 ea; + uint16_t ea; RDOPARG( ea ); ea += DE; A = RM( ea ); @@ -9156,7 +9156,7 @@ void upd7810_device::LDAX_D_xx() /* ac: 1010 1100 */ void upd7810_device::LDAX_H_A() { - UINT16 ea; + uint16_t ea; ea = HL + A; A = RM( ea ); } @@ -9164,7 +9164,7 @@ void upd7810_device::LDAX_H_A() /* ad: 1010 1101 */ void upd7810_device::LDAX_H_B() { - UINT16 ea; + uint16_t ea; ea = HL + B; A = RM( ea ); } @@ -9172,7 +9172,7 @@ void upd7810_device::LDAX_H_B() /* ae: 1010 1110 */ void upd7810_device::LDAX_H_EA() { - UINT16 ea; + uint16_t ea; ea = HL + EA; A = RM( ea ); } @@ -9180,7 +9180,7 @@ void upd7810_device::LDAX_H_EA() /* af: 1010 1111 dddd dddd */ void upd7810_device::LDAX_H_xx() { - UINT16 ea; + uint16_t ea; RDOPARG( ea ); ea += HL; A = RM( ea ); @@ -9277,7 +9277,7 @@ void upd7810_device::DI() /* bb: 1011 1011 dddd dddd */ void upd7810_device::STAX_D_xx() { - UINT16 ea; + uint16_t ea; RDOPARG(ea); ea += DE; WM( ea, A ); @@ -9286,7 +9286,7 @@ void upd7810_device::STAX_D_xx() /* bc: 1011 1100 */ void upd7810_device::STAX_H_A() { - UINT16 ea = A; + uint16_t ea = A; ea += HL; WM( ea, A ); } @@ -9294,7 +9294,7 @@ void upd7810_device::STAX_H_A() /* bd: 1011 1101 */ void upd7810_device::STAX_H_B() { - UINT16 ea = B; + uint16_t ea = B; ea += HL; WM( ea, A ); } @@ -9302,7 +9302,7 @@ void upd7810_device::STAX_H_B() /* be: 1011 1110 */ void upd7810_device::STAX_H_EA() { - UINT16 ea = EA; + uint16_t ea = EA; ea += HL; WM( ea, A ); } @@ -9310,7 +9310,7 @@ void upd7810_device::STAX_H_EA() /* bf: 1011 1111 dddd dddd */ void upd7810_device::STAX_H_xx() { - UINT16 ea; + uint16_t ea; RDOPARG( ea ); ea += HL; WM( ea, A ); @@ -9319,7 +9319,7 @@ void upd7810_device::STAX_H_xx() /* c0: 11dd dddd */ void upd7810_device::JR() { - INT8 offs = (INT8)(OP << 2) >> 2; + int8_t offs = (int8_t)(OP << 2) >> 2; PC += offs; } @@ -9348,56 +9348,56 @@ void upd7810_device::CALT_7801() /* DCR(W) and INR(W) instructions do not modify the CY register on at least 78c05 and 78c06 */ void upd7810_device::DCR_A_7801() { - UINT32 old_CY = PSW & CY; + uint32_t old_CY = PSW & CY; DCR_A(); PSW = ( PSW & ~CY ) | old_CY; } void upd7810_device::DCR_B_7801() { - UINT32 old_CY = PSW & CY; + uint32_t old_CY = PSW & CY; DCR_B(); PSW = ( PSW & ~CY ) | old_CY; } void upd7810_device::DCR_C_7801() { - UINT32 old_CY = PSW & CY; + uint32_t old_CY = PSW & CY; DCR_C(); PSW = ( PSW & ~CY ) | old_CY; } void upd7810_device::DCRW_wa_7801() { - UINT32 old_CY = PSW & CY; + uint32_t old_CY = PSW & CY; DCRW_wa(); PSW = ( PSW & ~CY ) | old_CY; } void upd7810_device::INR_A_7801() { - UINT32 old_CY = PSW & CY; + uint32_t old_CY = PSW & CY; INR_A(); PSW = ( PSW & ~CY ) | old_CY; } void upd7810_device::INR_B_7801() { - UINT32 old_CY = PSW & CY; + uint32_t old_CY = PSW & CY; INR_B(); PSW = ( PSW & ~CY ) | old_CY; } void upd7810_device::INR_C_7801() { - UINT32 old_CY = PSW & CY; + uint32_t old_CY = PSW & CY; INR_C(); PSW = ( PSW & ~CY ) | old_CY; } void upd7810_device::INRW_wa_7801() { - UINT32 old_CY = PSW & CY; + uint32_t old_CY = PSW & CY; INRW_wa(); PSW = ( PSW & ~CY ) | old_CY; } diff --git a/src/devices/cpu/v30mz/v30mz.cpp b/src/devices/cpu/v30mz/v30mz.cpp index 1436b72d757..54197ea82c0 100644 --- a/src/devices/cpu/v30mz/v30mz.cpp +++ b/src/devices/cpu/v30mz/v30mz.cpp @@ -75,7 +75,7 @@ enum BREGS { #define CF (m_CarryVal!=0) #define SF (m_SignVal<0) #define ZF (m_ZeroVal==0) -#define PF m_parity_table[(UINT8)m_ParityVal] +#define PF m_parity_table[(uint8_t)m_ParityVal] #define AF (m_AuxVal!=0) #define OF (m_OverVal!=0) #define MD (m_MF!=0) @@ -97,7 +97,7 @@ enum BREGS { const device_type V30MZ = &device_creator; -v30mz_cpu_device::v30mz_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v30mz_cpu_device::v30mz_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, V30MZ, "V30MZ", tag, owner, clock, "v30mz", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0) @@ -109,23 +109,23 @@ v30mz_cpu_device::v30mz_cpu_device(const machine_config &mconfig, const char *ta static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH }; /* Set up parity lookup table. */ - for (UINT16 i = 0;i < 256; i++) + for (uint16_t i = 0;i < 256; i++) { - UINT16 c = 0; - for (UINT16 j = i; j > 0; j >>= 1) + uint16_t c = 0; + for (uint16_t j = i; j > 0; j >>= 1) { if (j & 1) c++; } m_parity_table[i] = !(c & 1); } - for (UINT16 i = 0; i < 256; i++) + for (uint16_t i = 0; i < 256; i++) { m_Mod_RM.reg.b[i] = reg_name[(i & 0x38) >> 3]; m_Mod_RM.reg.w[i] = (WREGS) ( (i & 0x38) >> 3) ; } - for (UINT16 i = 0xc0; i < 0x100; i++) + for (uint16_t i = 0xc0; i < 0x100; i++) { m_Mod_RM.RM.w[i] = (WREGS)( i & 7 ); m_Mod_RM.RM.b[i] = (BREGS)reg_name[i & 7]; @@ -197,7 +197,7 @@ void v30mz_cpu_device::state_string_export(const device_state_entry &entry, std: case STATE_GENFLAGS: { - UINT16 flags = CompressFlags(); + uint16_t flags = CompressFlags(); str = string_format("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", flags & 0x8000 ? 'M':'.', flags & 0x4000 ? '?':'.', @@ -264,77 +264,77 @@ void v30mz_cpu_device::device_reset() } -inline UINT32 v30mz_cpu_device::pc() +inline uint32_t v30mz_cpu_device::pc() { m_pc = ( m_sregs[CS] << 4 ) + m_ip; return m_pc; } -inline UINT8 v30mz_cpu_device::read_byte(UINT32 addr) +inline uint8_t v30mz_cpu_device::read_byte(uint32_t addr) { return m_program->read_byte(addr); } -inline UINT16 v30mz_cpu_device::read_word(UINT32 addr) +inline uint16_t v30mz_cpu_device::read_word(uint32_t addr) { return m_program->read_byte(addr) | ( m_program->read_byte(addr+1) << 8 ); } -inline void v30mz_cpu_device::write_byte(UINT32 addr, UINT8 data) +inline void v30mz_cpu_device::write_byte(uint32_t addr, uint8_t data) { m_program->write_byte(addr, data); } -inline void v30mz_cpu_device::write_word(UINT32 addr, UINT16 data) +inline void v30mz_cpu_device::write_word(uint32_t addr, uint16_t data) { m_program->write_byte( addr, data & 0xff ); m_program->write_byte( addr + 1, data >> 8 ); } -inline UINT8 v30mz_cpu_device::read_port(UINT16 port) +inline uint8_t v30mz_cpu_device::read_port(uint16_t port) { return m_io->read_byte(port); } -inline void v30mz_cpu_device::write_port(UINT16 port, UINT8 data) +inline void v30mz_cpu_device::write_port(uint16_t port, uint8_t data) { m_io->write_byte(port, data); } -inline UINT8 v30mz_cpu_device::fetch_op() +inline uint8_t v30mz_cpu_device::fetch_op() { - UINT8 data = m_direct->read_byte( pc() ); + uint8_t data = m_direct->read_byte( pc() ); m_ip++; return data; } -inline UINT8 v30mz_cpu_device::fetch() +inline uint8_t v30mz_cpu_device::fetch() { - UINT8 data = m_direct->read_byte( pc() ); + uint8_t data = m_direct->read_byte( pc() ); m_ip++; return data; } -inline UINT16 v30mz_cpu_device::fetch_word() +inline uint16_t v30mz_cpu_device::fetch_word() { - UINT16 data = fetch(); + uint16_t data = fetch(); data |= ( fetch() << 8 ); return data; } -inline UINT8 v30mz_cpu_device::repx_op() +inline uint8_t v30mz_cpu_device::repx_op() { - UINT8 next = fetch_op(); + uint8_t next = fetch_op(); bool seg_prefix = false; int seg = 0; @@ -371,19 +371,19 @@ inline UINT8 v30mz_cpu_device::repx_op() } -inline void v30mz_cpu_device::CLK(UINT32 cycles) +inline void v30mz_cpu_device::CLK(uint32_t cycles) { m_icount -= cycles; } -inline void v30mz_cpu_device::CLKM(UINT32 cycles_reg, UINT32 cycles_mem) +inline void v30mz_cpu_device::CLKM(uint32_t cycles_reg, uint32_t cycles_mem) { m_icount -= ( m_modrm >= 0xc0 ) ? cycles_reg : cycles_mem; } -inline UINT32 v30mz_cpu_device::default_base(int seg) +inline uint32_t v30mz_cpu_device::default_base(int seg) { if ( m_seg_prefix && (seg==DS || seg==SS) ) { @@ -396,7 +396,7 @@ inline UINT32 v30mz_cpu_device::default_base(int seg) } -inline UINT32 v30mz_cpu_device::get_ea() +inline uint32_t v30mz_cpu_device::get_ea() { switch( m_modrm & 0xc7 ) { @@ -434,76 +434,76 @@ inline UINT32 v30mz_cpu_device::get_ea() break; case 0x40: - m_eo = m_regs.w[BW] + m_regs.w[IX] + (INT8)fetch(); + m_eo = m_regs.w[BW] + m_regs.w[IX] + (int8_t)fetch(); m_ea = default_base(DS) + m_eo; break; case 0x41: - m_eo = m_regs.w[BW] + m_regs.w[IY] + (INT8)fetch(); + m_eo = m_regs.w[BW] + m_regs.w[IY] + (int8_t)fetch(); m_ea = default_base(DS) + m_eo; break; case 0x42: - m_eo = m_regs.w[BP] + m_regs.w[IX] + (INT8)fetch(); + m_eo = m_regs.w[BP] + m_regs.w[IX] + (int8_t)fetch(); m_ea = default_base(SS) + m_eo; break; case 0x43: - m_eo = m_regs.w[BP] + m_regs.w[IY] + (INT8)fetch(); + m_eo = m_regs.w[BP] + m_regs.w[IY] + (int8_t)fetch(); m_ea = default_base(SS) + m_eo; break; case 0x44: - m_eo = m_regs.w[IX] + (INT8)fetch(); + m_eo = m_regs.w[IX] + (int8_t)fetch(); m_ea = default_base(DS) + m_eo; break; case 0x45: - m_eo = m_regs.w[IY] + (INT8)fetch(); + m_eo = m_regs.w[IY] + (int8_t)fetch(); m_ea = default_base(DS) + m_eo; break; case 0x46: - m_eo = m_regs.w[BP] + (INT8)fetch(); + m_eo = m_regs.w[BP] + (int8_t)fetch(); m_ea = default_base(SS) + m_eo; break; case 0x47: - m_eo = m_regs.w[BW] + (INT8)fetch(); + m_eo = m_regs.w[BW] + (int8_t)fetch(); m_ea = default_base(DS) + m_eo; break; case 0x80: m_e16 = fetch_word(); - m_eo = m_regs.w[BW] + m_regs.w[IX] + (INT16)m_e16; + m_eo = m_regs.w[BW] + m_regs.w[IX] + (int16_t)m_e16; m_ea = default_base(DS) + m_eo; break; case 0x81: m_e16 = fetch_word(); - m_eo = m_regs.w[BW] + m_regs.w[IY] + (INT16)m_e16; + m_eo = m_regs.w[BW] + m_regs.w[IY] + (int16_t)m_e16; m_ea = default_base(DS) + m_eo; break; case 0x82: m_e16 = fetch_word(); - m_eo = m_regs.w[BP] + m_regs.w[IX] + (INT16)m_e16; + m_eo = m_regs.w[BP] + m_regs.w[IX] + (int16_t)m_e16; m_ea = default_base(SS) + m_eo; break; case 0x83: m_e16 = fetch_word(); - m_eo = m_regs.w[BP] + m_regs.w[IY] + (INT16)m_e16; + m_eo = m_regs.w[BP] + m_regs.w[IY] + (int16_t)m_e16; m_ea = default_base(SS) + m_eo; break; case 0x84: m_e16 = fetch_word(); - m_eo = m_regs.w[IX] + (INT16)m_e16; + m_eo = m_regs.w[IX] + (int16_t)m_e16; m_ea = default_base(DS) + m_eo; break; case 0x85: m_e16 = fetch_word(); - m_eo = m_regs.w[IY] + (INT16)m_e16; + m_eo = m_regs.w[IY] + (int16_t)m_e16; m_ea = default_base(DS) + m_eo; break; case 0x86: m_e16 = fetch_word(); - m_eo = m_regs.w[BP] + (INT16)m_e16; + m_eo = m_regs.w[BP] + (int16_t)m_e16; m_ea = default_base(SS) + m_eo; break; case 0x87: m_e16 = fetch_word(); - m_eo = m_regs.w[BW] + (INT16)m_e16; + m_eo = m_regs.w[BW] + (int16_t)m_e16; m_ea = default_base(DS) + m_eo; break; } @@ -512,7 +512,7 @@ inline UINT32 v30mz_cpu_device::get_ea() } -inline void v30mz_cpu_device::PutbackRMByte(UINT8 data) +inline void v30mz_cpu_device::PutbackRMByte(uint8_t data) { if ( m_modrm >= 0xc0 ) { @@ -525,7 +525,7 @@ inline void v30mz_cpu_device::PutbackRMByte(UINT8 data) } -inline void v30mz_cpu_device::PutbackRMWord(UINT16 data) +inline void v30mz_cpu_device::PutbackRMWord(uint16_t data) { if ( m_modrm >= 0xc0 ) { @@ -545,12 +545,12 @@ inline void v30mz_cpu_device::PutImmRMWord() } else { - UINT32 addr = get_ea(); + uint32_t addr = get_ea(); write_word( addr, fetch_word() ); } } -inline void v30mz_cpu_device::PutRMWord(UINT16 val) +inline void v30mz_cpu_device::PutRMWord(uint16_t val) { if ( m_modrm >= 0xc0 ) { @@ -563,7 +563,7 @@ inline void v30mz_cpu_device::PutRMWord(UINT16 val) } -inline void v30mz_cpu_device::PutRMByte(UINT8 val) +inline void v30mz_cpu_device::PutRMByte(uint8_t val) { if ( m_modrm >= 0xc0 ) { @@ -584,7 +584,7 @@ inline void v30mz_cpu_device::PutImmRMByte() } else { - UINT32 addr = get_ea(); + uint32_t addr = get_ea(); write_byte( addr, fetch() ); } } @@ -637,31 +637,31 @@ inline void v30mz_cpu_device::DEF_axd16() -inline void v30mz_cpu_device::RegByte(UINT8 data) +inline void v30mz_cpu_device::RegByte(uint8_t data) { m_regs.b[ m_Mod_RM.reg.b[ m_modrm ] ] = data; } -inline void v30mz_cpu_device::RegWord(UINT16 data) +inline void v30mz_cpu_device::RegWord(uint16_t data) { m_regs.w[ m_Mod_RM.reg.w[ m_modrm ] ] = data; } -inline UINT8 v30mz_cpu_device::RegByte() +inline uint8_t v30mz_cpu_device::RegByte() { return m_regs.b[ m_Mod_RM.reg.b[ m_modrm ] ]; } -inline UINT16 v30mz_cpu_device::RegWord() +inline uint16_t v30mz_cpu_device::RegWord() { return m_regs.w[ m_Mod_RM.reg.w[ m_modrm ] ]; } -inline UINT16 v30mz_cpu_device::GetRMWord() +inline uint16_t v30mz_cpu_device::GetRMWord() { if ( m_modrm >= 0xc0 ) { @@ -674,15 +674,15 @@ inline UINT16 v30mz_cpu_device::GetRMWord() } -inline UINT16 v30mz_cpu_device::GetnextRMWord() +inline uint16_t v30mz_cpu_device::GetnextRMWord() { - UINT32 addr = ( m_ea & 0xf0000 ) | ( ( m_ea + 2 ) & 0xffff ); + uint32_t addr = ( m_ea & 0xf0000 ) | ( ( m_ea + 2 ) & 0xffff ); return read_word( addr ); } -inline UINT8 v30mz_cpu_device::GetRMByte() +inline uint8_t v30mz_cpu_device::GetRMByte() { if ( m_modrm >= 0xc0 ) { @@ -695,26 +695,26 @@ inline UINT8 v30mz_cpu_device::GetRMByte() } -inline void v30mz_cpu_device::PutMemB(int seg, UINT16 offset, UINT8 data) +inline void v30mz_cpu_device::PutMemB(int seg, uint16_t offset, uint8_t data) { write_byte( default_base( seg ) + offset, data); } -inline void v30mz_cpu_device::PutMemW(int seg, UINT16 offset, UINT16 data) +inline void v30mz_cpu_device::PutMemW(int seg, uint16_t offset, uint16_t data) { PutMemB( seg, offset, data & 0xff); PutMemB( seg, offset+1, data >> 8); } -inline UINT8 v30mz_cpu_device::GetMemB(int seg, UINT16 offset) +inline uint8_t v30mz_cpu_device::GetMemB(int seg, uint16_t offset) { return read_byte( default_base(seg) + offset ); } -inline UINT16 v30mz_cpu_device::GetMemW(int seg, UINT16 offset) +inline uint16_t v30mz_cpu_device::GetMemW(int seg, uint16_t offset) { return GetMemB(seg, offset) | ( GetMemB(seg, offset + 1) << 8 ); } @@ -722,68 +722,68 @@ inline UINT16 v30mz_cpu_device::GetMemW(int seg, UINT16 offset) // Setting flags -inline void v30mz_cpu_device::set_CFB(UINT32 x) +inline void v30mz_cpu_device::set_CFB(uint32_t x) { m_CarryVal = x & 0x100; } -inline void v30mz_cpu_device::set_CFW(UINT32 x) +inline void v30mz_cpu_device::set_CFW(uint32_t x) { m_CarryVal = x & 0x10000; } -inline void v30mz_cpu_device::set_AF(UINT32 x,UINT32 y,UINT32 z) +inline void v30mz_cpu_device::set_AF(uint32_t x,uint32_t y,uint32_t z) { m_AuxVal = (x ^ (y ^ z)) & 0x10; } -inline void v30mz_cpu_device::set_SF(UINT32 x) +inline void v30mz_cpu_device::set_SF(uint32_t x) { m_SignVal = x; } -inline void v30mz_cpu_device::set_ZF(UINT32 x) +inline void v30mz_cpu_device::set_ZF(uint32_t x) { m_ZeroVal = x; } -inline void v30mz_cpu_device::set_PF(UINT32 x) +inline void v30mz_cpu_device::set_PF(uint32_t x) { m_ParityVal = x; } -inline void v30mz_cpu_device::set_SZPF_Byte(UINT32 x) +inline void v30mz_cpu_device::set_SZPF_Byte(uint32_t x) { - m_SignVal = m_ZeroVal = m_ParityVal = (INT8)x; + m_SignVal = m_ZeroVal = m_ParityVal = (int8_t)x; } -inline void v30mz_cpu_device::set_SZPF_Word(UINT32 x) +inline void v30mz_cpu_device::set_SZPF_Word(uint32_t x) { - m_SignVal = m_ZeroVal = m_ParityVal = (INT16)x; + m_SignVal = m_ZeroVal = m_ParityVal = (int16_t)x; } -inline void v30mz_cpu_device::set_OFW_Add(UINT32 x,UINT32 y,UINT32 z) +inline void v30mz_cpu_device::set_OFW_Add(uint32_t x,uint32_t y,uint32_t z) { m_OverVal = (x ^ y) & (x ^ z) & 0x8000; } -inline void v30mz_cpu_device::set_OFB_Add(UINT32 x,UINT32 y,UINT32 z) +inline void v30mz_cpu_device::set_OFB_Add(uint32_t x,uint32_t y,uint32_t z) { m_OverVal = (x ^ y) & (x ^ z) & 0x80; } -inline void v30mz_cpu_device::set_OFW_Sub(UINT32 x,UINT32 y,UINT32 z) +inline void v30mz_cpu_device::set_OFW_Sub(uint32_t x,uint32_t y,uint32_t z) { m_OverVal = (z ^ y) & (z ^ x) & 0x8000; } -inline void v30mz_cpu_device::set_OFB_Sub(UINT32 x,UINT32 y,UINT32 z) +inline void v30mz_cpu_device::set_OFB_Sub(uint32_t x,uint32_t y,uint32_t z) { m_OverVal = (z ^ y) & (z ^ x) & 0x80; } -inline UINT16 v30mz_cpu_device::CompressFlags() const +inline uint16_t v30mz_cpu_device::CompressFlags() const { return (CF ? 1 : 0) | (PF ? 4 : 0) @@ -797,7 +797,7 @@ inline UINT16 v30mz_cpu_device::CompressFlags() const | (MD << 15); } -inline void v30mz_cpu_device::ExpandFlags(UINT16 f) +inline void v30mz_cpu_device::ExpandFlags(uint16_t f) { m_CarryVal = (f) & 1; m_ParityVal = !((f) & 4); @@ -843,7 +843,7 @@ inline void v30mz_cpu_device::i_outsw() inline void v30mz_cpu_device::i_movsb() { - UINT8 tmp = GetMemB( DS, m_regs.w[IX] ); + uint8_t tmp = GetMemB( DS, m_regs.w[IX] ); PutMemB( ES, m_regs.w[IY], tmp); m_regs.w[IY] += -2 * m_DF + 1; m_regs.w[IX] += -2 * m_DF + 1; @@ -852,7 +852,7 @@ inline void v30mz_cpu_device::i_movsb() inline void v30mz_cpu_device::i_movsw() { - UINT16 tmp = GetMemW( DS, m_regs.w[IX] ); + uint16_t tmp = GetMemW( DS, m_regs.w[IX] ); PutMemW( ES, m_regs.w[IY], tmp ); m_regs.w[IY] += -4 * m_DF + 2; m_regs.w[IX] += -4 * m_DF + 2; @@ -928,7 +928,7 @@ inline void v30mz_cpu_device::i_scasw() inline void v30mz_cpu_device::i_popf() { - UINT32 tmp = POP(); + uint32_t tmp = POP(); ExpandFlags(tmp); CLK(3); @@ -941,7 +941,7 @@ inline void v30mz_cpu_device::i_popf() inline void v30mz_cpu_device::ADDB() { - UINT32 res = m_dst + m_src; + uint32_t res = m_dst + m_src; set_CFB(res); set_OFB_Add(res,m_src,m_dst); @@ -953,7 +953,7 @@ inline void v30mz_cpu_device::ADDB() inline void v30mz_cpu_device::ADDW() { - UINT32 res = m_dst + m_src; + uint32_t res = m_dst + m_src; set_CFW(res); set_OFW_Add(res,m_src,m_dst); @@ -965,7 +965,7 @@ inline void v30mz_cpu_device::ADDW() inline void v30mz_cpu_device::SUBB() { - UINT32 res = m_dst - m_src; + uint32_t res = m_dst - m_src; set_CFB(res); set_OFB_Sub(res,m_src,m_dst); @@ -977,7 +977,7 @@ inline void v30mz_cpu_device::SUBB() inline void v30mz_cpu_device::SUBW() { - UINT32 res = m_dst - m_src; + uint32_t res = m_dst - m_src; set_CFW(res); set_OFW_Sub(res,m_src,m_dst); @@ -1085,7 +1085,7 @@ inline void v30mz_cpu_device::RORC_WORD() m_dst >>= 1; } -inline void v30mz_cpu_device::SHL_BYTE(UINT8 c) +inline void v30mz_cpu_device::SHL_BYTE(uint8_t c) { m_icount -= c; m_dst <<= c; @@ -1094,7 +1094,7 @@ inline void v30mz_cpu_device::SHL_BYTE(UINT8 c) PutbackRMByte(m_dst); } -inline void v30mz_cpu_device::SHL_WORD(UINT8 c) +inline void v30mz_cpu_device::SHL_WORD(uint8_t c) { m_icount -= c; m_dst <<= c; @@ -1103,7 +1103,7 @@ inline void v30mz_cpu_device::SHL_WORD(UINT8 c) PutbackRMWord(m_dst); } -inline void v30mz_cpu_device::SHR_BYTE(UINT8 c) +inline void v30mz_cpu_device::SHR_BYTE(uint8_t c) { m_icount -= c; m_dst >>= c-1; @@ -1113,7 +1113,7 @@ inline void v30mz_cpu_device::SHR_BYTE(UINT8 c) PutbackRMByte(m_dst); } -inline void v30mz_cpu_device::SHR_WORD(UINT8 c) +inline void v30mz_cpu_device::SHR_WORD(uint8_t c) { m_icount -= c; m_dst >>= c-1; @@ -1123,20 +1123,20 @@ inline void v30mz_cpu_device::SHR_WORD(UINT8 c) PutbackRMWord(m_dst); } -inline void v30mz_cpu_device::SHRA_BYTE(UINT8 c) +inline void v30mz_cpu_device::SHRA_BYTE(uint8_t c) { m_icount -= c; - m_dst = ((INT8)m_dst) >> (c-1); + m_dst = ((int8_t)m_dst) >> (c-1); m_CarryVal = m_dst & 0x1; m_dst = m_dst >> 1; set_SZPF_Byte(m_dst); PutbackRMByte(m_dst); } -inline void v30mz_cpu_device::SHRA_WORD(UINT8 c) +inline void v30mz_cpu_device::SHRA_WORD(uint8_t c) { m_icount -= c; - m_dst = ((INT16)m_dst) >> (c-1); + m_dst = ((int16_t)m_dst) >> (c-1); m_CarryVal = m_dst & 0x1; m_dst = m_dst >> 1; set_SZPF_Word(m_dst); @@ -1144,19 +1144,19 @@ inline void v30mz_cpu_device::SHRA_WORD(UINT8 c) } -inline void v30mz_cpu_device::XchgAWReg(UINT8 reg) +inline void v30mz_cpu_device::XchgAWReg(uint8_t reg) { - UINT16 tmp = m_regs.w[reg]; + uint16_t tmp = m_regs.w[reg]; m_regs.w[reg] = m_regs.w[AW]; m_regs.w[AW] = tmp; } -inline void v30mz_cpu_device::IncWordReg(UINT8 reg) +inline void v30mz_cpu_device::IncWordReg(uint8_t reg) { - UINT32 tmp = m_regs.w[reg]; - UINT32 tmp1 = tmp+1; + uint32_t tmp = m_regs.w[reg]; + uint32_t tmp1 = tmp+1; m_OverVal = (tmp == 0x7fff); set_AF(tmp1,tmp,1); @@ -1165,10 +1165,10 @@ inline void v30mz_cpu_device::IncWordReg(UINT8 reg) } -inline void v30mz_cpu_device::DecWordReg(UINT8 reg) +inline void v30mz_cpu_device::DecWordReg(uint8_t reg) { - UINT32 tmp = m_regs.w[reg]; - UINT32 tmp1 = tmp-1; + uint32_t tmp = m_regs.w[reg]; + uint32_t tmp1 = tmp-1; m_OverVal = (tmp == 0x8000); set_AF(tmp1,tmp,1); @@ -1177,16 +1177,16 @@ inline void v30mz_cpu_device::DecWordReg(UINT8 reg) } -inline void v30mz_cpu_device::PUSH(UINT16 data) +inline void v30mz_cpu_device::PUSH(uint16_t data) { m_regs.w[SP] -= 2; write_word( ( m_sregs[SS] << 4 ) + m_regs.w[SP], data ); } -inline UINT16 v30mz_cpu_device::POP() +inline uint16_t v30mz_cpu_device::POP() { - UINT16 data = read_word( ( m_sregs[SS] << 4 ) + m_regs.w[SP] ); + uint16_t data = read_word( ( m_sregs[SS] << 4 ) + m_regs.w[SP] ); m_regs.w[SP] += 2; return data; @@ -1195,7 +1195,7 @@ inline UINT16 v30mz_cpu_device::POP() inline void v30mz_cpu_device::JMP(bool cond) { - int rel = (int)((INT8)fetch()); + int rel = (int)((int8_t)fetch()); if (cond) { @@ -1206,11 +1206,11 @@ inline void v30mz_cpu_device::JMP(bool cond) } -inline void v30mz_cpu_device::ADJ4(INT8 param1,INT8 param2) +inline void v30mz_cpu_device::ADJ4(int8_t param1,int8_t param2) { if (AF || ((m_regs.b[AL] & 0xf) > 9)) { - UINT16 tmp; + uint16_t tmp; tmp = m_regs.b[AL] + param1; m_regs.b[AL] = tmp; m_AuxVal = 1; @@ -1225,7 +1225,7 @@ inline void v30mz_cpu_device::ADJ4(INT8 param1,INT8 param2) } -inline void v30mz_cpu_device::ADJB(INT8 param1, INT8 param2) +inline void v30mz_cpu_device::ADJB(int8_t param1, int8_t param2) { if (AF || ((m_regs.b[AL] & 0xf) > 9)) { @@ -1257,8 +1257,8 @@ void v30mz_cpu_device::interrupt(int int_num) m_pending_irq &= ~INT_IRQ; } - UINT16 dest_off = read_word( int_num * 4 + 0 ); - UINT16 dest_seg = read_word( int_num * 4 + 2 ); + uint16_t dest_off = read_word( int_num * 4 + 0 ); + uint16_t dest_seg = read_word( int_num * 4 + 2 ); PUSH(m_sregs[CS]); PUSH(m_ip); @@ -1296,7 +1296,7 @@ void v30mz_cpu_device::execute_set_input( int inptnum, int state ) } -offs_t v30mz_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t v30mz_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( nec ); return CPU_DISASSEMBLE_NAME(nec)(this, buffer, pc, oprom, opram, options); @@ -1355,7 +1355,7 @@ void v30mz_cpu_device::execute_run() debugger_instruction_hook( this, pc() ); - UINT8 op = fetch_op(); + uint8_t op = fetch_op(); switch(op) { @@ -1460,7 +1460,7 @@ void v30mz_cpu_device::execute_run() case 0x0f: // i_pre_nec { - UINT32 tmp, tmp2; + uint32_t tmp, tmp2; switch ( fetch() ) { @@ -1581,8 +1581,8 @@ void v30mz_cpu_device::execute_run() case 0x20: { int count = (m_regs.b[CL]+1)/2; - UINT16 di = m_regs.w[IY]; - UINT16 si = m_regs.w[IX]; + uint16_t di = m_regs.w[IY]; + uint16_t si = m_regs.w[IX]; if (m_seg_prefix) { logerror("%s: %06x: Warning: seg_prefix defined for add4s\n", tag(), pc()); @@ -1612,8 +1612,8 @@ void v30mz_cpu_device::execute_run() case 0x22: { int count = (m_regs.b[CL]+1)/2; - UINT16 di = m_regs.w[IY]; - UINT16 si = m_regs.w[IX]; + uint16_t di = m_regs.w[IY]; + uint16_t si = m_regs.w[IX]; if (m_seg_prefix) { logerror("%s: %06x: Warning: seg_prefix defined for sub4s\n", tag(), pc()); @@ -1652,8 +1652,8 @@ void v30mz_cpu_device::execute_run() case 0x26: { int count = (m_regs.b[CL]+1)/2; - UINT16 di = m_regs.w[IY]; - UINT16 si = m_regs.w[IX]; + uint16_t di = m_regs.w[IY]; + uint16_t si = m_regs.w[IX]; if (m_seg_prefix) { logerror("%s: %06x: Warning: seg_prefix defined for cmp4s\n", tag(), pc()); @@ -2232,7 +2232,7 @@ void v30mz_cpu_device::execute_run() case 0x60: // i_pusha { - UINT32 tmp = m_regs.w[SP]; + uint32_t tmp = m_regs.w[SP]; PUSH(m_regs.w[AW]); PUSH(m_regs.w[CW]); @@ -2260,7 +2260,7 @@ void v30mz_cpu_device::execute_run() case 0x62: // i_chkind { - UINT32 low,high,tmp; + uint32_t low,high,tmp; m_modrm = fetch(); low = GetRMWord(); high = GetnextRMWord(); @@ -2280,8 +2280,8 @@ void v30mz_cpu_device::execute_run() case 0x64: // i_repnc { - UINT8 next = repx_op(); - UINT16 c = m_regs.w[CW]; + uint8_t next = repx_op(); + uint16_t c = m_regs.w[CW]; switch (next) { @@ -2311,8 +2311,8 @@ void v30mz_cpu_device::execute_run() case 0x65: // i_repc { - UINT8 next = repx_op(); - UINT16 c = m_regs.w[CW]; + uint8_t next = repx_op(); + uint16_t c = m_regs.w[CW]; switch (next) { @@ -2347,28 +2347,28 @@ void v30mz_cpu_device::execute_run() case 0x69: // i_imul_d16 { - UINT32 tmp; + uint32_t tmp; DEF_r16w(); tmp = fetch_word(); - m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)tmp); - m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1); + m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)tmp); + m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1); RegWord(m_dst); CLKM(3,4); } break; case 0x6a: // i_push_d8 - PUSH( (UINT16)((INT16)((INT8)fetch())) ); + PUSH( (uint16_t)((int16_t)((int8_t)fetch())) ); CLK(1); break; case 0x6b: // i_imul_d8 { - UINT32 src2; + uint32_t src2; DEF_r16w(); - src2= (UINT16)((INT16)((INT8)fetch())); - m_dst = (INT32)((INT16)m_src)*(INT32)((INT16)src2); - m_CarryVal = m_OverVal = (((INT32)m_dst) >> 15 != 0) && (((INT32)m_dst) >> 15 != -1); + src2= (uint16_t)((int16_t)((int8_t)fetch())); + m_dst = (int32_t)((int16_t)m_src)*(int32_t)((int16_t)src2); + m_CarryVal = m_OverVal = (((int32_t)m_dst) >> 15 != 0) && (((int32_t)m_dst) >> 15 != -1); RegWord(m_dst); CLKM(3,4); } @@ -2501,7 +2501,7 @@ void v30mz_cpu_device::execute_run() case 0x82: // i_82pre m_modrm = fetch(); m_dst = GetRMByte(); - m_src = (INT8)fetch(); + m_src = (int8_t)fetch(); if (m_modrm >=0xc0 ) { CLK(1); } else if ((m_modrm & 0x38)==0x38) { CLK(2); } else { CLK(3); } @@ -2522,7 +2522,7 @@ void v30mz_cpu_device::execute_run() case 0x83: // i_83pre m_modrm = fetch(); m_dst = GetRMWord(); - m_src = ((INT16)((INT8)fetch())); + m_src = ((int16_t)((int8_t)fetch())); if ( m_modrm >= 0xc0 ) { CLK(1); } else if (( m_modrm & 0x38 ) == 0x38) { CLK(2); } else { CLK(3); } @@ -2690,8 +2690,8 @@ void v30mz_cpu_device::execute_run() case 0x9a: // i_call_far { - UINT16 tmp = fetch_word(); - UINT16 tmp2 = fetch_word(); + uint16_t tmp = fetch_word(); + uint16_t tmp2 = fetch_word(); PUSH(m_sregs[CS]); PUSH(m_ip); m_ip = tmp; @@ -2715,7 +2715,7 @@ void v30mz_cpu_device::execute_run() case 0x9e: // i_sahf { - UINT32 tmp = (CompressFlags() & 0xff00) | (m_regs.b[AH] & 0xd5); + uint32_t tmp = (CompressFlags() & 0xff00) | (m_regs.b[AH] & 0xd5); ExpandFlags(tmp); CLK(4); } @@ -2729,7 +2729,7 @@ void v30mz_cpu_device::execute_run() case 0xa0: // i_mov_aldisp { - UINT32 addr = fetch_word(); + uint32_t addr = fetch_word(); m_regs.b[AL] = GetMemB(DS, addr); CLK(1); } @@ -2737,7 +2737,7 @@ void v30mz_cpu_device::execute_run() case 0xa1: // i_mov_axdisp { - UINT32 addr = fetch_word(); + uint32_t addr = fetch_word(); m_regs.b[AL] = GetMemB(DS, addr); m_regs.b[AH] = GetMemB(DS, addr+1); CLK(1); @@ -2746,7 +2746,7 @@ void v30mz_cpu_device::execute_run() case 0xa2: // i_mov_dispal { - UINT32 addr = fetch_word(); + uint32_t addr = fetch_word(); PutMemB(DS, addr, m_regs.b[AL]); CLK(1); } @@ -2754,7 +2754,7 @@ void v30mz_cpu_device::execute_run() case 0xa3: // i_mov_dispax { - UINT32 addr = fetch_word(); + uint32_t addr = fetch_word(); PutMemB(DS, addr, m_regs.b[AL]); PutMemB(DS, addr+1, m_regs.b[AH]); CLK(1); @@ -2907,7 +2907,7 @@ void v30mz_cpu_device::execute_run() case 0xc0: // i_rotshft_bd8 { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMByte(); m_dst = m_src; @@ -2932,7 +2932,7 @@ void v30mz_cpu_device::execute_run() case 0xc1: // i_rotshft_wd8 { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMWord(); m_dst = m_src; @@ -2958,7 +2958,7 @@ void v30mz_cpu_device::execute_run() case 0xc2: // i_ret_d16 { - UINT32 count = fetch_word(); + uint32_t count = fetch_word(); m_ip = POP(); m_regs.w[SP] += count; CLK(6); @@ -2999,8 +2999,8 @@ void v30mz_cpu_device::execute_run() case 0xc8: // i_enter { - UINT16 nb = fetch(); - UINT32 level; + uint16_t nb = fetch(); + uint32_t level; CLK(8); nb |= fetch() << 8; @@ -3029,7 +3029,7 @@ void v30mz_cpu_device::execute_run() case 0xca: // i_retf_d16 { - UINT32 count = fetch_word(); + uint32_t count = fetch_word(); m_ip = POP(); m_sregs[CS] = POP(); m_regs.w[SP] += count; @@ -3108,7 +3108,7 @@ void v30mz_cpu_device::execute_run() case 0xd2: // i_rotshft_bcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMByte(); @@ -3134,7 +3134,7 @@ void v30mz_cpu_device::execute_run() case 0xd3: // i_rotshft_wcl { - UINT8 c; + uint8_t c; m_modrm = fetch(); m_src = GetRMWord(); @@ -3194,7 +3194,7 @@ void v30mz_cpu_device::execute_run() case 0xe0: // i_loopne { - INT8 disp = (INT8)fetch(); + int8_t disp = (int8_t)fetch(); m_regs.w[CW]--; if (!ZF && m_regs.w[CW]) @@ -3208,7 +3208,7 @@ void v30mz_cpu_device::execute_run() case 0xe1: // i_loope { - INT8 disp = (INT8)fetch(); + int8_t disp = (int8_t)fetch(); m_regs.w[CW]--; if (ZF && m_regs.w[CW]) @@ -3222,7 +3222,7 @@ void v30mz_cpu_device::execute_run() case 0xe2: // i_loop { - INT8 disp = (INT8)fetch(); + int8_t disp = (int8_t)fetch(); m_regs.w[CW]--; if (m_regs.w[CW]) @@ -3236,7 +3236,7 @@ void v30mz_cpu_device::execute_run() case 0xe3: // i_jcxz { - INT8 disp = (INT8)fetch(); + int8_t disp = (int8_t)fetch(); if (m_regs.w[CW] == 0) { @@ -3254,7 +3254,7 @@ void v30mz_cpu_device::execute_run() case 0xe5: // i_inax { - UINT8 port = fetch(); + uint8_t port = fetch(); m_regs.b[AL] = read_port(port); m_regs.b[AH] = read_port(port+1); @@ -3269,7 +3269,7 @@ void v30mz_cpu_device::execute_run() case 0xe7: // i_outax { - UINT8 port = fetch(); + uint8_t port = fetch(); write_port(port, m_regs.b[AL]); write_port(port+1, m_regs.b[AH]); @@ -3280,7 +3280,7 @@ void v30mz_cpu_device::execute_run() case 0xe8: // i_call_d16 { - INT16 tmp = (INT16)fetch_word(); + int16_t tmp = (int16_t)fetch_word(); PUSH(m_ip); m_ip = m_ip + tmp; @@ -3290,7 +3290,7 @@ void v30mz_cpu_device::execute_run() case 0xe9: // i_jmp_d16 { - INT16 offset = (INT16)fetch_word(); + int16_t offset = (int16_t)fetch_word(); m_ip += offset; CLK(4); } @@ -3298,8 +3298,8 @@ void v30mz_cpu_device::execute_run() case 0xea: // i_jmp_far { - UINT16 tmp = fetch_word(); - UINT16 tmp1 = fetch_word(); + uint16_t tmp = fetch_word(); + uint16_t tmp1 = fetch_word(); m_sregs[CS] = tmp1; m_ip = tmp; @@ -3309,14 +3309,14 @@ void v30mz_cpu_device::execute_run() case 0xeb: // i_jmp_d8 { - int tmp = (int)((INT8)fetch()); + int tmp = (int)((int8_t)fetch()); CLK(4); if (tmp==-2 && m_no_interrupt==0 && (m_pending_irq==0) && m_icount>0) { m_icount%=12; /* cycle skip */ } - m_ip = (UINT16)(m_ip+tmp); + m_ip = (uint16_t)(m_ip+tmp); } break; @@ -3327,7 +3327,7 @@ void v30mz_cpu_device::execute_run() case 0xed: // i_inaxdx { - UINT32 port = m_regs.w[DW]; + uint32_t port = m_regs.w[DW]; m_regs.b[AL] = read_port(port); m_regs.b[AH] = read_port(port+1); @@ -3342,7 +3342,7 @@ void v30mz_cpu_device::execute_run() case 0xef: // i_outdxax { - UINT32 port = m_regs.w[DW]; + uint32_t port = m_regs.w[DW]; write_port(port, m_regs.b[AL]); write_port(port+1, m_regs.b[AH]); @@ -3359,8 +3359,8 @@ void v30mz_cpu_device::execute_run() case 0xf2: // i_repne { - UINT8 next = repx_op(); - UINT16 c = m_regs.w[CW]; + uint8_t next = repx_op(); + uint16_t c = m_regs.w[CW]; switch (next) { @@ -3389,8 +3389,8 @@ void v30mz_cpu_device::execute_run() case 0xf3: // i_repe { - UINT8 next = repx_op(); - UINT16 c = m_regs.w[CW]; + uint8_t next = repx_op(); + uint16_t c = m_regs.w[CW]; switch (next) { @@ -3429,9 +3429,9 @@ void v30mz_cpu_device::execute_run() case 0xf6: // i_f6pre { - UINT32 tmp; - UINT32 uresult,uresult2; - INT32 result,result2; + uint32_t tmp; + uint32_t uresult,uresult2; + int32_t result,result2; m_modrm = fetch(); tmp = GetRMByte(); @@ -3459,13 +3459,13 @@ void v30mz_cpu_device::execute_run() break; case 0x20: /* MULU */ uresult = m_regs.b[AL] * tmp; - m_regs.w[AW] = (UINT16)uresult; + m_regs.w[AW] = (uint16_t)uresult; m_CarryVal = m_OverVal = (m_regs.b[AH]!=0) ? 1 : 0; CLKM(3,4); break; case 0x28: /* MUL */ - result = (INT16)((INT8)m_regs.b[AL])*(INT16)((INT8)tmp); - m_regs.w[AW] = (UINT16)result; + result = (int16_t)((int8_t)m_regs.b[AL])*(int16_t)((int8_t)tmp); + m_regs.w[AW] = (uint16_t)result; m_CarryVal = m_OverVal = (m_regs.b[AH]!=0) ? 1 : 0; CLKM(3,4); break; @@ -3493,9 +3493,9 @@ void v30mz_cpu_device::execute_run() case 0x38: /* DIV */ if (tmp) { - result = (INT16)m_regs.w[AW]; - result2 = result % (INT16)((INT8)tmp); - if ((result /= (INT16)((INT8)tmp)) > 0xff) + result = (int16_t)m_regs.w[AW]; + result2 = result % (int16_t)((int8_t)tmp); + if ((result /= (int16_t)((int8_t)tmp)) > 0xff) { interrupt(0); } @@ -3518,9 +3518,9 @@ void v30mz_cpu_device::execute_run() case 0xf7: // i_f7pre { - UINT32 tmp,tmp2; - UINT32 uresult,uresult2; - INT32 result,result2; + uint32_t tmp,tmp2; + uint32_t uresult,uresult2; + int32_t result,result2; m_modrm = fetch(); tmp = GetRMWord(); @@ -3550,12 +3550,12 @@ void v30mz_cpu_device::execute_run() case 0x20: /* MULU */ uresult = m_regs.w[AW]*tmp; m_regs.w[AW] = uresult & 0xffff; - m_regs.w[DW] = ((UINT32)uresult)>>16; + m_regs.w[DW] = ((uint32_t)uresult)>>16; m_CarryVal = m_OverVal = (m_regs.w[DW] != 0) ? 1 : 0; CLKM(3,4); break; case 0x28: /* MUL */ - result = (INT32)((INT16)m_regs.w[AW]) * (INT32)((INT16)tmp); + result = (int32_t)((int16_t)m_regs.w[AW]) * (int32_t)((int16_t)tmp); m_regs.w[AW] = result & 0xffff; m_regs.w[DW] = result >> 16; m_CarryVal = m_OverVal = (m_regs.w[DW] != 0) ? 1 : 0; @@ -3564,7 +3564,7 @@ void v30mz_cpu_device::execute_run() case 0x30: /* DIVU */ if (tmp) { - uresult = (((UINT32)m_regs.w[DW]) << 16) | m_regs.w[AW]; + uresult = (((uint32_t)m_regs.w[DW]) << 16) | m_regs.w[AW]; uresult2 = uresult % tmp; if ((uresult /= tmp) > 0xffff) { @@ -3585,9 +3585,9 @@ void v30mz_cpu_device::execute_run() case 0x38: /* DIV */ if (tmp) { - result = ((UINT32)m_regs.w[DW] << 16) + m_regs.w[AW]; - result2 = result % (INT32)((INT16)tmp); - if ((result /= (INT32)((INT16)tmp)) > 0xffff) + result = ((uint32_t)m_regs.w[DW] << 16) + m_regs.w[AW]; + result2 = result % (int32_t)((int16_t)tmp); + if ((result /= (int32_t)((int16_t)tmp)) > 0xffff) { interrupt(0); } @@ -3640,7 +3640,7 @@ void v30mz_cpu_device::execute_run() case 0xfe: // i_fepre { - UINT32 tmp, tmp1; + uint32_t tmp, tmp1; m_modrm = fetch(); tmp = GetRMByte(); switch ( m_modrm & 0x38 ) @@ -3670,7 +3670,7 @@ void v30mz_cpu_device::execute_run() case 0xff: // i_ffpre { - UINT32 tmp, tmp1; + uint32_t tmp, tmp1; m_modrm = fetch(); tmp = GetRMWord(); switch ( m_modrm & 0x38 ) diff --git a/src/devices/cpu/v30mz/v30mz.h b/src/devices/cpu/v30mz/v30mz.h index 6ba07800b9e..db0e0a3ca22 100644 --- a/src/devices/cpu/v30mz/v30mz.h +++ b/src/devices/cpu/v30mz/v30mz.h @@ -6,7 +6,7 @@ struct nec_config { - const UINT8* v25v35_decryptiontable; // internal decryption table + const uint8_t* v25v35_decryptiontable; // internal decryption table }; enum @@ -26,7 +26,7 @@ class v30mz_cpu_device : public cpu_device { public: // construction/destruction - v30mz_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v30mz_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -34,9 +34,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 80; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 80; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -47,50 +47,50 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 7; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 7; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; void interrupt(int int_num); - inline UINT32 pc(); + inline uint32_t pc(); // Accessing memory and io - inline UINT8 read_byte(UINT32 addr); - inline UINT16 read_word(UINT32 addr); - inline void write_byte(UINT32 addr, UINT8 data); - inline void write_word(UINT32 addr, UINT16 data); - inline UINT8 read_port(UINT16 port); - inline void write_port(UINT16 port, UINT8 data); + inline uint8_t read_byte(uint32_t addr); + inline uint16_t read_word(uint32_t addr); + inline void write_byte(uint32_t addr, uint8_t data); + inline void write_word(uint32_t addr, uint16_t data); + inline uint8_t read_port(uint16_t port); + inline void write_port(uint16_t port, uint8_t data); // Executing instructions - inline UINT8 fetch_op(); - inline UINT8 fetch(); - inline UINT16 fetch_word(); - inline UINT8 repx_op(); + inline uint8_t fetch_op(); + inline uint8_t fetch(); + inline uint16_t fetch_word(); + inline uint8_t repx_op(); // Cycles passed while executing instructions - inline void CLK(UINT32 cycles); - inline void CLKM(UINT32 cycles_reg, UINT32 cycles_mem); + inline void CLK(uint32_t cycles); + inline void CLKM(uint32_t cycles_reg, uint32_t cycles_mem); // Memory handling while executing instructions - inline UINT32 default_base(int seg); - inline UINT32 get_ea(); - inline void PutbackRMByte(UINT8 data); - inline void PutbackRMWord(UINT16 data); - inline void RegByte(UINT8 data); - inline void RegWord(UINT16 data); - inline UINT8 RegByte(); - inline UINT16 RegWord(); - inline UINT16 GetRMWord(); - inline UINT16 GetnextRMWord(); - inline UINT8 GetRMByte(); - inline void PutMemB(int seg, UINT16 offset, UINT8 data); - inline void PutMemW(int seg, UINT16 offset, UINT16 data); - inline UINT8 GetMemB(int seg, UINT16 offset); - inline UINT16 GetMemW(int seg, UINT16 offset); + inline uint32_t default_base(int seg); + inline uint32_t get_ea(); + inline void PutbackRMByte(uint8_t data); + inline void PutbackRMWord(uint16_t data); + inline void RegByte(uint8_t data); + inline void RegWord(uint16_t data); + inline uint8_t RegByte(); + inline uint16_t RegWord(); + inline uint16_t GetRMWord(); + inline uint16_t GetnextRMWord(); + inline uint8_t GetRMByte(); + inline void PutMemB(int seg, uint16_t offset, uint8_t data); + inline void PutMemW(int seg, uint16_t offset, uint16_t data); + inline uint8_t GetMemB(int seg, uint16_t offset); + inline uint16_t GetMemW(int seg, uint16_t offset); inline void PutImmRMWord(); - inline void PutRMWord(UINT16 val); - inline void PutRMByte(UINT8 val); + inline void PutRMWord(uint16_t val); + inline void PutRMByte(uint8_t val); inline void PutImmRMByte(); inline void DEF_br8(); inline void DEF_wr16(); @@ -100,20 +100,20 @@ protected: inline void DEF_axd16(); // Flags - inline void set_CFB(UINT32 x); - inline void set_CFW(UINT32 x); - inline void set_AF(UINT32 x,UINT32 y,UINT32 z); - inline void set_SF(UINT32 x); - inline void set_ZF(UINT32 x); - inline void set_PF(UINT32 x); - inline void set_SZPF_Byte(UINT32 x); - inline void set_SZPF_Word(UINT32 x); - inline void set_OFW_Add(UINT32 x,UINT32 y,UINT32 z); - inline void set_OFB_Add(UINT32 x,UINT32 y,UINT32 z); - inline void set_OFW_Sub(UINT32 x,UINT32 y,UINT32 z); - inline void set_OFB_Sub(UINT32 x,UINT32 y,UINT32 z); - inline UINT16 CompressFlags() const; - inline void ExpandFlags(UINT16 f); + inline void set_CFB(uint32_t x); + inline void set_CFW(uint32_t x); + inline void set_AF(uint32_t x,uint32_t y,uint32_t z); + inline void set_SF(uint32_t x); + inline void set_ZF(uint32_t x); + inline void set_PF(uint32_t x); + inline void set_SZPF_Byte(uint32_t x); + inline void set_SZPF_Word(uint32_t x); + inline void set_OFW_Add(uint32_t x,uint32_t y,uint32_t z); + inline void set_OFB_Add(uint32_t x,uint32_t y,uint32_t z); + inline void set_OFW_Sub(uint32_t x,uint32_t y,uint32_t z); + inline void set_OFB_Sub(uint32_t x,uint32_t y,uint32_t z); + inline uint16_t CompressFlags() const; + inline void ExpandFlags(uint16_t f); // rep instructions inline void i_insb(); @@ -151,20 +151,20 @@ protected: inline void ROLC_WORD(); inline void RORC_BYTE(); inline void RORC_WORD(); - inline void SHL_BYTE(UINT8 c); - inline void SHL_WORD(UINT8 c); - inline void SHR_BYTE(UINT8 c); - inline void SHR_WORD(UINT8 c); - inline void SHRA_BYTE(UINT8 c); - inline void SHRA_WORD(UINT8 c); - inline void XchgAWReg(UINT8 reg); - inline void IncWordReg(UINT8 reg); - inline void DecWordReg(UINT8 reg); - inline void PUSH(UINT16 data); - inline UINT16 POP(); + inline void SHL_BYTE(uint8_t c); + inline void SHL_WORD(uint8_t c); + inline void SHR_BYTE(uint8_t c); + inline void SHR_WORD(uint8_t c); + inline void SHRA_BYTE(uint8_t c); + inline void SHRA_WORD(uint8_t c); + inline void XchgAWReg(uint8_t reg); + inline void IncWordReg(uint8_t reg); + inline void DecWordReg(uint8_t reg); + inline void PUSH(uint16_t data); + inline uint16_t POP(); inline void JMP(bool cond); - inline void ADJ4(INT8 param1, INT8 param2); - inline void ADJB(INT8 param1, INT8 param2); + inline void ADJ4(int8_t param1, int8_t param2); + inline void ADJB(int8_t param1, int8_t param2); protected: address_space_config m_program_config; @@ -172,44 +172,44 @@ protected: union { /* eight general registers */ - UINT16 w[8]; /* viewed as 16 bits registers */ - UINT8 b[16]; /* or as 8 bit registers */ + uint16_t w[8]; /* viewed as 16 bits registers */ + uint8_t b[16]; /* or as 8 bit registers */ } m_regs; - UINT16 m_sregs[4]; + uint16_t m_sregs[4]; - UINT16 m_ip; + uint16_t m_ip; - INT32 m_SignVal; - UINT32 m_AuxVal, m_OverVal, m_ZeroVal, m_CarryVal, m_ParityVal; /* 0 or non-0 valued flags */ - UINT8 m_TF, m_IF, m_DF, m_MF; /* 0 or 1 valued flags */ /* OB[19.07.99] added Mode Flag V30 */ - UINT32 m_int_vector; - UINT32 m_pending_irq; - UINT32 m_nmi_state; - UINT32 m_irq_state; - UINT8 m_no_interrupt; - UINT8 m_fire_trap; + int32_t m_SignVal; + uint32_t m_AuxVal, m_OverVal, m_ZeroVal, m_CarryVal, m_ParityVal; /* 0 or non-0 valued flags */ + uint8_t m_TF, m_IF, m_DF, m_MF; /* 0 or 1 valued flags */ /* OB[19.07.99] added Mode Flag V30 */ + uint32_t m_int_vector; + uint32_t m_pending_irq; + uint32_t m_nmi_state; + uint32_t m_irq_state; + uint8_t m_no_interrupt; + uint8_t m_fire_trap; address_space *m_program; direct_read_data *m_direct; address_space *m_io; int m_icount; - UINT32 m_prefix_base; /* base address of the latest prefix segment */ + uint32_t m_prefix_base; /* base address of the latest prefix segment */ bool m_seg_prefix; /* prefix segment indicator */ bool m_seg_prefix_next; /* prefix segment for next instruction */ - UINT32 m_ea; - UINT16 m_eo; - UINT16 m_e16; + uint32_t m_ea; + uint16_t m_eo; + uint16_t m_e16; // Used during execution of instructions - UINT8 m_modrm; - UINT32 m_dst; - UINT32 m_src; - UINT32 m_pc; + uint8_t m_modrm; + uint32_t m_dst; + uint32_t m_src; + uint32_t m_pc; // Lookup tables - UINT8 m_parity_table[256]; + uint8_t m_parity_table[256]; struct { struct { int w[256]; diff --git a/src/devices/cpu/v60/am.hxx b/src/devices/cpu/v60/am.hxx index 0432350788d..4ec2e72db85 100644 --- a/src/devices/cpu/v60/am.hxx +++ b/src/devices/cpu/v60/am.hxx @@ -23,14 +23,14 @@ amLength */ -UINT32 v60_device::ReadAM() +uint32_t v60_device::ReadAM() { m_modm = m_modm?1:0; m_modval = OpRead8(m_modadd); return (this->*s_AMTable1[m_modm][m_modval >> 5])(); } -UINT32 v60_device::BitReadAM() +uint32_t v60_device::BitReadAM() { m_modm = m_modm?1:0; m_modval = OpRead8(m_modadd); @@ -50,14 +50,14 @@ UINT32 v60_device::BitReadAM() amLength */ -UINT32 v60_device::ReadAMAddress() +uint32_t v60_device::ReadAMAddress() { m_modm = m_modm?1:0; m_modval = OpRead8(m_modadd); return (this->*s_AMTable2[m_modm][m_modval >> 5])(); } -UINT32 v60_device::BitReadAMAddress() +uint32_t v60_device::BitReadAMAddress() { m_modm = m_modm?1:0; m_modval = OpRead8(m_modadd); @@ -75,7 +75,7 @@ UINT32 v60_device::BitReadAMAddress() amLength */ -UINT32 v60_device::WriteAM() +uint32_t v60_device::WriteAM() { m_modm = m_modm?1:0; m_modval = OpRead8(m_modadd); diff --git a/src/devices/cpu/v60/am1.hxx b/src/devices/cpu/v60/am1.hxx index cc5e0f4a1fd..50d1e429a4a 100644 --- a/src/devices/cpu/v60/am1.hxx +++ b/src/devices/cpu/v60/am1.hxx @@ -3,15 +3,15 @@ // AM1 Functions (for ReadAM) // ************************** -UINT32 v60_device::am1Register() +uint32_t v60_device::am1Register() { switch (m_moddim) { case 0: - m_amout = (UINT8)m_reg[m_modval & 0x1F]; + m_amout = (uint8_t)m_reg[m_modval & 0x1F]; break; case 1: - m_amout = (UINT16)m_reg[m_modval & 0x1F]; + m_amout = (uint16_t)m_reg[m_modval & 0x1F]; break; case 2: m_amout = m_reg[m_modval & 0x1F]; @@ -21,7 +21,7 @@ UINT32 v60_device::am1Register() return 1; } -UINT32 v60_device::am1RegisterIndirect() +uint32_t v60_device::am1RegisterIndirect() { switch (m_moddim) { @@ -39,14 +39,14 @@ UINT32 v60_device::am1RegisterIndirect() return 1; } -UINT32 v60_device::bam1RegisterIndirect() +uint32_t v60_device::bam1RegisterIndirect() { m_bamoffset = 0; m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F]); return 1; } -UINT32 v60_device::am1RegisterIndirectIndexed() +uint32_t v60_device::am1RegisterIndirectIndexed() { switch (m_moddim) { @@ -64,7 +64,7 @@ UINT32 v60_device::am1RegisterIndirectIndexed() return 2; } -UINT32 v60_device::bam1RegisterIndirectIndexed() +uint32_t v60_device::bam1RegisterIndirectIndexed() { m_bamoffset = m_reg[m_modval & 0x1F]; m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + m_bamoffset / 8); @@ -72,7 +72,7 @@ UINT32 v60_device::bam1RegisterIndirectIndexed() return 2; } -UINT32 v60_device::am1Autoincrement() +uint32_t v60_device::am1Autoincrement() { switch (m_moddim) { @@ -93,7 +93,7 @@ UINT32 v60_device::am1Autoincrement() return 1; } -UINT32 v60_device::bam1Autoincrement() +uint32_t v60_device::bam1Autoincrement() { m_bamoffset = 0; m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F]); @@ -112,7 +112,7 @@ UINT32 v60_device::bam1Autoincrement() return 1; } -UINT32 v60_device::am1Autodecrement() +uint32_t v60_device::am1Autodecrement() { switch (m_moddim) { @@ -133,7 +133,7 @@ UINT32 v60_device::am1Autodecrement() return 1; } -UINT32 v60_device::bam1Autodecrement() +uint32_t v60_device::bam1Autodecrement() { m_bamoffset = 0; switch (m_moddim) @@ -152,25 +152,25 @@ UINT32 v60_device::bam1Autodecrement() return 1; } -UINT32 v60_device::am1Displacement8() +uint32_t v60_device::am1Displacement8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_byte(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)); break; case 1: - m_amout = m_program->read_word_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_word_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)); break; case 2: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)); break; } return 2; } -UINT32 v60_device::bam1Displacement8() +uint32_t v60_device::bam1Displacement8() { m_bamoffset = m_program->read_byte(m_modadd + 1); m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + m_bamoffset / 8); @@ -179,25 +179,25 @@ UINT32 v60_device::bam1Displacement8() } -UINT32 v60_device::am1Displacement16() +uint32_t v60_device::am1Displacement16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_byte(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)); break; case 1: - m_amout = m_program->read_word_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_word_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)); break; case 2: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)); break; } return 3; } -UINT32 v60_device::bam1Displacement16() +uint32_t v60_device::bam1Displacement16() { m_bamoffset = OpRead16(m_modadd + 1); m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + m_bamoffset / 8); @@ -205,7 +205,7 @@ UINT32 v60_device::bam1Displacement16() return 3; } -UINT32 v60_device::am1Displacement32() +uint32_t v60_device::am1Displacement32() { switch (m_moddim) { @@ -223,7 +223,7 @@ UINT32 v60_device::am1Displacement32() return 5; } -UINT32 v60_device::bam1Displacement32() +uint32_t v60_device::bam1Displacement32() { m_bamoffset = OpRead32(m_modadd + 1); m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + m_bamoffset / 8); @@ -231,59 +231,59 @@ UINT32 v60_device::bam1Displacement32() return 5; } -UINT32 v60_device::am1DisplacementIndexed8() +uint32_t v60_device::am1DisplacementIndexed8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F]); + m_amout = m_program->read_byte(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F]); break; case 1: - m_amout = m_program->read_word_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2); + m_amout = m_program->read_word_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2); break; case 2: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4); break; } return 3; } -UINT32 v60_device::bam1DisplacementIndexed8() +uint32_t v60_device::bam1DisplacementIndexed8() { m_bamoffset = m_reg[m_modval & 0x1F]; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_bamoffset / 8); m_bamoffset&=7; return 3; } -UINT32 v60_device::am1DisplacementIndexed16() +uint32_t v60_device::am1DisplacementIndexed16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F]); + m_amout = m_program->read_byte(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F]); break; case 1: - m_amout = m_program->read_word_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2); + m_amout = m_program->read_word_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2); break; case 2: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4); break; } return 4; } -UINT32 v60_device::bam1DisplacementIndexed16() +uint32_t v60_device::bam1DisplacementIndexed16() { m_bamoffset = m_reg[m_modval & 0x1F]; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_bamoffset / 8); m_bamoffset&=7; return 4; } -UINT32 v60_device::am1DisplacementIndexed32() +uint32_t v60_device::am1DisplacementIndexed32() { switch (m_moddim) { @@ -301,7 +301,7 @@ UINT32 v60_device::am1DisplacementIndexed32() return 6; } -UINT32 v60_device::bam1DisplacementIndexed32() +uint32_t v60_device::bam1DisplacementIndexed32() { m_bamoffset = m_reg[m_modval & 0x1F]; m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + OpRead32(m_modadd + 2) + m_bamoffset / 8); @@ -310,25 +310,25 @@ UINT32 v60_device::bam1DisplacementIndexed32() } -UINT32 v60_device::am1PCDisplacement8() +uint32_t v60_device::am1PCDisplacement8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(PC + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_byte(PC + (int8_t)OpRead8(m_modadd + 1)); break; case 1: - m_amout = m_program->read_word_unaligned(PC + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_word_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)); break; case 2: - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)); break; } return 2; } -UINT32 v60_device::bam1PCDisplacement8() +uint32_t v60_device::bam1PCDisplacement8() { m_bamoffset = OpRead8(m_modadd + 1); m_amout = m_program->read_dword_unaligned(PC + m_bamoffset / 8); @@ -336,25 +336,25 @@ UINT32 v60_device::bam1PCDisplacement8() return 2; } -UINT32 v60_device::am1PCDisplacement16() +uint32_t v60_device::am1PCDisplacement16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(PC + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_byte(PC + (int16_t)OpRead16(m_modadd + 1)); break; case 1: - m_amout = m_program->read_word_unaligned(PC + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_word_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)); break; case 2: - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)); break; } return 3; } -UINT32 v60_device::bam1PCDisplacement16() +uint32_t v60_device::bam1PCDisplacement16() { m_bamoffset = OpRead16(m_modadd + 1); m_amout = m_program->read_dword_unaligned(PC + m_bamoffset / 8); @@ -362,7 +362,7 @@ UINT32 v60_device::bam1PCDisplacement16() return 3; } -UINT32 v60_device::am1PCDisplacement32() +uint32_t v60_device::am1PCDisplacement32() { switch (m_moddim) { @@ -380,7 +380,7 @@ UINT32 v60_device::am1PCDisplacement32() return 5; } -UINT32 v60_device::bam1PCDisplacement32() +uint32_t v60_device::bam1PCDisplacement32() { m_bamoffset = OpRead32(m_modadd + 1); m_amout = m_program->read_dword_unaligned(PC + m_bamoffset / 8); @@ -388,60 +388,60 @@ UINT32 v60_device::bam1PCDisplacement32() return 5; } -UINT32 v60_device::am1PCDisplacementIndexed8() +uint32_t v60_device::am1PCDisplacementIndexed8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F]); + m_amout = m_program->read_byte(PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F]); break; case 1: - m_amout = m_program->read_word_unaligned(PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2); + m_amout = m_program->read_word_unaligned(PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2); break; case 2: - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4); + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4); break; } return 3; } -UINT32 v60_device::bam1PCDisplacementIndexed8() +uint32_t v60_device::bam1PCDisplacementIndexed8() { m_bamoffset = m_reg[m_modval & 0x1F]; - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2) + m_bamoffset / 8); m_bamoffset&=7; return 3; } -UINT32 v60_device::am1PCDisplacementIndexed16() +uint32_t v60_device::am1PCDisplacementIndexed16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F]); + m_amout = m_program->read_byte(PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F]); break; case 1: - m_amout = m_program->read_word_unaligned(PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2); + m_amout = m_program->read_word_unaligned(PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2); break; case 2: - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4); + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4); break; } return 4; } -UINT32 v60_device::bam1PCDisplacementIndexed16() +uint32_t v60_device::bam1PCDisplacementIndexed16() { m_bamoffset = m_reg[m_modval & 0x1F]; - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2) + m_bamoffset / 8); m_bamoffset&=7; return 4; } -UINT32 v60_device::am1PCDisplacementIndexed32() +uint32_t v60_device::am1PCDisplacementIndexed32() { switch (m_moddim) { @@ -459,7 +459,7 @@ UINT32 v60_device::am1PCDisplacementIndexed32() return 6; } -UINT32 v60_device::bam1PCDisplacementIndexed32() +uint32_t v60_device::bam1PCDisplacementIndexed32() { m_bamoffset = m_reg[m_modval & 0x1F]; m_amout = m_program->read_dword_unaligned(PC + OpRead32(m_modadd + 2) + m_bamoffset / 8); @@ -467,57 +467,57 @@ UINT32 v60_device::bam1PCDisplacementIndexed32() return 6; } -UINT32 v60_device::am1DisplacementIndirect8() +uint32_t v60_device::am1DisplacementIndirect8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1))); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1))); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1))); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1))); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1))); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1))); break; } return 2; } -UINT32 v60_device::bam1DisplacementIndirect8() +uint32_t v60_device::bam1DisplacementIndirect8() { m_bamoffset = 0; - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1))); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1))); return 2; } -UINT32 v60_device::am1DisplacementIndirect16() +uint32_t v60_device::am1DisplacementIndirect16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1))); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1))); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1))); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1))); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1))); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1))); break; } return 3; } -UINT32 v60_device::bam1DisplacementIndirect16() +uint32_t v60_device::bam1DisplacementIndirect16() { m_bamoffset = 0; - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1))); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1))); return 3; } -UINT32 v60_device::am1DisplacementIndirect32() +uint32_t v60_device::am1DisplacementIndirect32() { switch (m_moddim) { @@ -535,66 +535,66 @@ UINT32 v60_device::am1DisplacementIndirect32() return 5; } -UINT32 v60_device::bam1DisplacementIndirect32() +uint32_t v60_device::bam1DisplacementIndirect32() { m_bamoffset = 0; m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + OpRead32(m_modadd + 1))); return 5; } -UINT32 v60_device::am1DisplacementIndirectIndexed8() +uint32_t v60_device::am1DisplacementIndirectIndexed8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F]); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F]); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4); break; } return 3; } -UINT32 v60_device::bam1DisplacementIndirectIndexed8() +uint32_t v60_device::bam1DisplacementIndirectIndexed8() { m_bamoffset = m_reg[m_modval & 0x1F]; - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_bamoffset / 8); m_bamoffset&=7; return 3; } -UINT32 v60_device::am1DisplacementIndirectIndexed16() +uint32_t v60_device::am1DisplacementIndirectIndexed16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F]); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F]); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4); break; } return 4; } -UINT32 v60_device::bam1DisplacementIndirectIndexed16() +uint32_t v60_device::bam1DisplacementIndirectIndexed16() { m_bamoffset = m_reg[m_modval & 0x1F]; - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_bamoffset / 8); m_bamoffset&=7; return 4; } -UINT32 v60_device::am1DisplacementIndirectIndexed32() +uint32_t v60_device::am1DisplacementIndirectIndexed32() { switch (m_moddim) { @@ -612,7 +612,7 @@ UINT32 v60_device::am1DisplacementIndirectIndexed32() return 6; } -UINT32 v60_device::bam1DisplacementIndirectIndexed32() +uint32_t v60_device::bam1DisplacementIndirectIndexed32() { m_bamoffset = m_reg[m_modval & 0x1F]; m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + OpRead32(m_modadd + 2)) + m_bamoffset / 8); @@ -620,57 +620,57 @@ UINT32 v60_device::bam1DisplacementIndirectIndexed32() return 6; } -UINT32 v60_device::am1PCDisplacementIndirect8() +uint32_t v60_device::am1PCDisplacementIndirect8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1))); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1))); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1))); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1))); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1))); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1))); break; } return 2; } -UINT32 v60_device::bam1PCDisplacementIndirect8() +uint32_t v60_device::bam1PCDisplacementIndirect8() { m_bamoffset = 0; - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1))); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1))); return 2; } -UINT32 v60_device::am1PCDisplacementIndirect16() +uint32_t v60_device::am1PCDisplacementIndirect16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1))); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1))); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1))); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1))); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1))); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1))); break; } return 3; } -UINT32 v60_device::bam1PCDisplacementIndirect16() +uint32_t v60_device::bam1PCDisplacementIndirect16() { m_bamoffset = 0; - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1))); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1))); return 3; } -UINT32 v60_device::am1PCDisplacementIndirect32() +uint32_t v60_device::am1PCDisplacementIndirect32() { switch (m_moddim) { @@ -688,66 +688,66 @@ UINT32 v60_device::am1PCDisplacementIndirect32() return 5; } -UINT32 v60_device::bam1PCDisplacementIndirect32() +uint32_t v60_device::bam1PCDisplacementIndirect32() { m_bamoffset = 0; m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + OpRead32(m_modadd + 1))); return 5; } -UINT32 v60_device::am1PCDisplacementIndirectIndexed8() +uint32_t v60_device::am1PCDisplacementIndirectIndexed8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F]); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F]); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4); break; } return 3; } -UINT32 v60_device::bam1PCDisplacementIndirectIndexed8() +uint32_t v60_device::bam1PCDisplacementIndirectIndexed8() { m_bamoffset = m_reg[m_modval & 0x1F]; - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_bamoffset / 8); m_bamoffset&=7; return 3; } -UINT32 v60_device::am1PCDisplacementIndirectIndexed16() +uint32_t v60_device::am1PCDisplacementIndirectIndexed16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F]); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F]); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4); break; } return 4; } -UINT32 v60_device::bam1PCDisplacementIndirectIndexed16() +uint32_t v60_device::bam1PCDisplacementIndirectIndexed16() { m_bamoffset = m_reg[m_modval & 0x1F]; - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_bamoffset / 8); m_bamoffset&=7; return 4; } -UINT32 v60_device::am1PCDisplacementIndirectIndexed32() +uint32_t v60_device::am1PCDisplacementIndirectIndexed32() { switch (m_moddim) { @@ -765,7 +765,7 @@ UINT32 v60_device::am1PCDisplacementIndirectIndexed32() return 6; } -UINT32 v60_device::bam1PCDisplacementIndirectIndexed32() +uint32_t v60_device::bam1PCDisplacementIndirectIndexed32() { m_bamoffset = m_reg[m_modval & 0x1F]; m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + OpRead32(m_modadd + 2)) + m_bamoffset / 8); @@ -773,63 +773,63 @@ UINT32 v60_device::bam1PCDisplacementIndirectIndexed32() return 6; } -UINT32 v60_device::am1DoubleDisplacement8() +uint32_t v60_device::am1DoubleDisplacement8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2)); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2)); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2)); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2)); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2)); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2)); break; } return 3; } -UINT32 v60_device::bam1DoubleDisplacement8() +uint32_t v60_device::bam1DoubleDisplacement8() { m_bamoffset = OpRead8(m_modadd + 2); - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)) + m_bamoffset / 8); m_bamoffset&=7; return 3; } -UINT32 v60_device::am1DoubleDisplacement16() +uint32_t v60_device::am1DoubleDisplacement16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3)); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3)); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3)); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3)); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3)); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3)); break; } return 5; } -UINT32 v60_device::bam1DoubleDisplacement16() +uint32_t v60_device::bam1DoubleDisplacement16() { m_bamoffset = OpRead16(m_modadd + 3); - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)) + m_bamoffset / 8); m_bamoffset&=7; return 5; } -UINT32 v60_device::am1DoubleDisplacement32() +uint32_t v60_device::am1DoubleDisplacement32() { switch (m_moddim) { @@ -849,7 +849,7 @@ UINT32 v60_device::am1DoubleDisplacement32() return 9; } -UINT32 v60_device::bam1DoubleDisplacement32() +uint32_t v60_device::bam1DoubleDisplacement32() { m_bamoffset = OpRead32(m_modadd + 5); m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + OpRead32(m_modadd + 1)) + m_bamoffset / 8); @@ -857,64 +857,64 @@ UINT32 v60_device::bam1DoubleDisplacement32() return 9; } -UINT32 v60_device::am1PCDoubleDisplacement8() +uint32_t v60_device::am1PCDoubleDisplacement8() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2)); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2)); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2)); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2)); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2)); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2)); break; } return 3; } -UINT32 v60_device::bam1PCDoubleDisplacement8() +uint32_t v60_device::bam1PCDoubleDisplacement8() { m_bamoffset = OpRead8(m_modadd + 2); - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)) + m_bamoffset / 8); m_bamoffset&=7; return 3; } -UINT32 v60_device::am1PCDoubleDisplacement16() +uint32_t v60_device::am1PCDoubleDisplacement16() { switch (m_moddim) { case 0: - m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3)); + m_amout = m_program->read_byte(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3)); break; case 1: - m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3)); + m_amout = m_program->read_word_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3)); break; case 2: - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3)); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3)); break; } return 5; } -UINT32 v60_device::bam1PCDoubleDisplacement16() +uint32_t v60_device::bam1PCDoubleDisplacement16() { m_bamoffset = OpRead16(m_modadd + 3); - m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)) + m_bamoffset / 8); + m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)) + m_bamoffset / 8); m_bamoffset&=7; return 5; } -UINT32 v60_device::am1PCDoubleDisplacement32() +uint32_t v60_device::am1PCDoubleDisplacement32() { switch (m_moddim) { @@ -934,7 +934,7 @@ UINT32 v60_device::am1PCDoubleDisplacement32() return 9; } -UINT32 v60_device::bam1PCDoubleDisplacement32() +uint32_t v60_device::bam1PCDoubleDisplacement32() { m_bamoffset = OpRead32(m_modadd + 5); m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(PC + OpRead32(m_modadd + 1)) + m_bamoffset / 8); @@ -942,7 +942,7 @@ UINT32 v60_device::bam1PCDoubleDisplacement32() return 9; } -UINT32 v60_device::am1DirectAddress() +uint32_t v60_device::am1DirectAddress() { switch (m_moddim) { @@ -962,14 +962,14 @@ UINT32 v60_device::am1DirectAddress() return 5; } -UINT32 v60_device::bam1DirectAddress() +uint32_t v60_device::bam1DirectAddress() { m_bamoffset = 0; m_amout = m_program->read_dword_unaligned(OpRead32(m_modadd + 1)); return 5; } -UINT32 v60_device::am1DirectAddressIndexed() +uint32_t v60_device::am1DirectAddressIndexed() { switch (m_moddim) { @@ -989,7 +989,7 @@ UINT32 v60_device::am1DirectAddressIndexed() return 6; } -UINT32 v60_device::bam1DirectAddressIndexed() +uint32_t v60_device::bam1DirectAddressIndexed() { m_bamoffset = m_reg[m_modval & 0x1F]; m_amout = m_program->read_dword_unaligned(OpRead32(m_modadd + 2) + m_bamoffset / 8); @@ -997,7 +997,7 @@ UINT32 v60_device::bam1DirectAddressIndexed() return 6; } -UINT32 v60_device::am1DirectAddressDeferred() +uint32_t v60_device::am1DirectAddressDeferred() { switch (m_moddim) { @@ -1017,14 +1017,14 @@ UINT32 v60_device::am1DirectAddressDeferred() return 5; } -UINT32 v60_device::bam1DirectAddressDeferred() +uint32_t v60_device::bam1DirectAddressDeferred() { m_bamoffset = 0; m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(OpRead32(m_modadd + 1))); return 5; } -UINT32 v60_device::am1DirectAddressDeferredIndexed() +uint32_t v60_device::am1DirectAddressDeferredIndexed() { switch (m_moddim) { @@ -1044,7 +1044,7 @@ UINT32 v60_device::am1DirectAddressDeferredIndexed() return 6; } -UINT32 v60_device::bam1DirectAddressDeferredIndexed() +uint32_t v60_device::bam1DirectAddressDeferredIndexed() { m_bamoffset = m_reg[m_modval & 0x1F]; m_amout = m_program->read_dword_unaligned(m_program->read_dword_unaligned(OpRead32(m_modadd + 2)) + m_bamoffset / 8); @@ -1052,7 +1052,7 @@ UINT32 v60_device::bam1DirectAddressDeferredIndexed() return 6; } -UINT32 v60_device::am1Immediate() +uint32_t v60_device::am1Immediate() { switch (m_moddim) { @@ -1074,7 +1074,7 @@ UINT32 v60_device::am1Immediate() return 1; } -UINT32 v60_device::am1ImmediateQuick() +uint32_t v60_device::am1ImmediateQuick() { m_amout = m_modval & 0xF; return 1; @@ -1086,69 +1086,69 @@ UINT32 v60_device::am1ImmediateQuick() // AM1 Tables (for ReadAM) // *********************** -UINT32 v60_device::am1Error1() +uint32_t v60_device::am1Error1() { fatalerror("CPU - AM1 - 1 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam1Error1() +uint32_t v60_device::bam1Error1() { fatalerror("CPU - BAM1 - 1 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::am1Error2() +uint32_t v60_device::am1Error2() { fatalerror("CPU - AM1 - 2 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam1Error2() +uint32_t v60_device::bam1Error2() { fatalerror("CPU - BAM1 - 2 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } #ifdef UNUSED_FUNCTION -UINT32 v60_device::am1Error3() +uint32_t v60_device::am1Error3() { fatalerror("CPU - AM1 - 3 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam1Error3() +uint32_t v60_device::bam1Error3() { fatalerror("CPU - BAM1 - 3 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } #endif -UINT32 v60_device::am1Error4() +uint32_t v60_device::am1Error4() { fatalerror("CPU - AM1 - 4 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam1Error4() +uint32_t v60_device::bam1Error4() { fatalerror("CPU - BAM1 - 4 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::am1Error5() +uint32_t v60_device::am1Error5() { fatalerror("CPU - AM1 - 5 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam1Error5() +uint32_t v60_device::bam1Error5() { fatalerror("CPU - BAM1 - 5 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam1Error6() +uint32_t v60_device::bam1Error6() { fatalerror("CPU - BAM1 - 6 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ @@ -1195,7 +1195,7 @@ const v60_device::am_func v60_device::s_BAMTable1_G7a[16] = }; -UINT32 v60_device::am1Group7a() +uint32_t v60_device::am1Group7a() { if (!(m_modval2 & 0x10)) return am1Error4(); @@ -1203,7 +1203,7 @@ UINT32 v60_device::am1Group7a() return (this->*s_AMTable1_G7a[m_modval2 & 0xF])(); } -UINT32 v60_device::bam1Group7a() +uint32_t v60_device::bam1Group7a() { if (!(m_modval2 & 0x10)) return bam1Error4(); @@ -1310,25 +1310,25 @@ const v60_device::am_func v60_device::s_BAMTable1_G6[8] = }; -UINT32 v60_device::am1Group6() +uint32_t v60_device::am1Group6() { m_modval2 = OpRead8(m_modadd + 1); return (this->*s_AMTable1_G6[m_modval2 >> 5])(); } -UINT32 v60_device::bam1Group6() +uint32_t v60_device::bam1Group6() { m_modval2 = OpRead8(m_modadd + 1); return (this->*s_BAMTable1_G6[m_modval2 >> 5])(); } -UINT32 v60_device::am1Group7() +uint32_t v60_device::am1Group7() { return (this->*s_AMTable1_G7[m_modval & 0x1F])(); } -UINT32 v60_device::bam1Group7() +uint32_t v60_device::bam1Group7() { return (this->*s_BAMTable1_G7[m_modval & 0x1F])(); } diff --git a/src/devices/cpu/v60/am2.hxx b/src/devices/cpu/v60/am2.hxx index 2b01d324979..df3ce901680 100644 --- a/src/devices/cpu/v60/am2.hxx +++ b/src/devices/cpu/v60/am2.hxx @@ -3,21 +3,21 @@ // AM2 Functions (for ReadAMAddress) // ********************************* -UINT32 v60_device::am2Register() +uint32_t v60_device::am2Register() { m_amflag = 1; m_amout = m_modval & 0x1F; return 1; } -UINT32 v60_device::am2RegisterIndirect() +uint32_t v60_device::am2RegisterIndirect() { m_amflag = 0; m_amout = m_reg[m_modval & 0x1F]; return 1; } -UINT32 v60_device::bam2RegisterIndirect() +uint32_t v60_device::bam2RegisterIndirect() { m_amflag = 0; m_amout = m_reg[m_modval & 0x1F]; @@ -25,7 +25,7 @@ UINT32 v60_device::bam2RegisterIndirect() return 1; } -UINT32 v60_device::am2RegisterIndirectIndexed() +uint32_t v60_device::am2RegisterIndirectIndexed() { m_amflag = 0; @@ -48,7 +48,7 @@ UINT32 v60_device::am2RegisterIndirectIndexed() return 2; } -UINT32 v60_device::bam2RegisterIndirectIndexed() +uint32_t v60_device::bam2RegisterIndirectIndexed() { m_amflag = 0; m_amout = m_reg[m_modval2 & 0x1F]; @@ -56,7 +56,7 @@ UINT32 v60_device::bam2RegisterIndirectIndexed() return 2; } -UINT32 v60_device::am2Autoincrement() +uint32_t v60_device::am2Autoincrement() { m_amflag = 0; m_amout = m_reg[m_modval & 0x1F]; @@ -80,7 +80,7 @@ UINT32 v60_device::am2Autoincrement() return 1; } -UINT32 v60_device::bam2Autoincrement() +uint32_t v60_device::bam2Autoincrement() { m_amflag = 0; m_amout = m_reg[m_modval & 0x1F]; @@ -102,7 +102,7 @@ UINT32 v60_device::bam2Autoincrement() return 1; } -UINT32 v60_device::am2Autodecrement() +uint32_t v60_device::am2Autodecrement() { m_amflag = 0; @@ -126,7 +126,7 @@ UINT32 v60_device::am2Autodecrement() return 1; } -UINT32 v60_device::bam2Autodecrement() +uint32_t v60_device::bam2Autodecrement() { m_amflag = 0; m_bamoffset = 0; @@ -149,41 +149,41 @@ UINT32 v60_device::bam2Autodecrement() } -UINT32 v60_device::am2Displacement8() +uint32_t v60_device::am2Displacement8() { m_amflag = 0; - m_amout = m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1); + m_amout = m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1); return 2; } -UINT32 v60_device::bam2Displacement8() +uint32_t v60_device::bam2Displacement8() { m_amflag = 0; m_amout = m_reg[m_modval & 0x1F]; - m_bamoffset = (INT8)OpRead8(m_modadd + 1); + m_bamoffset = (int8_t)OpRead8(m_modadd + 1); return 2; } -UINT32 v60_device::am2Displacement16() +uint32_t v60_device::am2Displacement16() { m_amflag = 0; - m_amout = m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1); + m_amout = m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1); return 3; } -UINT32 v60_device::bam2Displacement16() +uint32_t v60_device::bam2Displacement16() { m_amflag = 0; m_amout = m_reg[m_modval & 0x1F]; - m_bamoffset = (INT16)OpRead16(m_modadd + 1); + m_bamoffset = (int16_t)OpRead16(m_modadd + 1); return 3; } -UINT32 v60_device::am2Displacement32() +uint32_t v60_device::am2Displacement32() { m_amflag = 0; m_amout = m_reg[m_modval & 0x1F] + OpRead32(m_modadd + 1); @@ -191,7 +191,7 @@ UINT32 v60_device::am2Displacement32() return 5; } -UINT32 v60_device::bam2Displacement32() +uint32_t v60_device::bam2Displacement32() { m_amflag = 0; m_amout = m_reg[m_modval & 0x1F]; @@ -200,71 +200,71 @@ UINT32 v60_device::bam2Displacement32() return 5; } -UINT32 v60_device::am2DisplacementIndexed8() +uint32_t v60_device::am2DisplacementIndexed8() { m_amflag = 0; switch (m_moddim) { case 0: - m_amout = m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F]; + m_amout = m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F]; break; case 1: - m_amout = m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2; + m_amout = m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2; break; case 2: - m_amout = m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4; + m_amout = m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4; break; case 3: - m_amout = m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 8; + m_amout = m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 8; break; } return 3; } -UINT32 v60_device::bam2DisplacementIndexed8() +uint32_t v60_device::bam2DisplacementIndexed8() { m_amflag = 0; - m_amout = m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2); + m_amout = m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2); m_bamoffset = m_reg[m_modval & 0x1F]; return 3; } -UINT32 v60_device::am2DisplacementIndexed16() +uint32_t v60_device::am2DisplacementIndexed16() { m_amflag = 0; switch (m_moddim) { case 0: - m_amout = m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F]; + m_amout = m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F]; break; case 1: - m_amout = m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2; + m_amout = m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2; break; case 2: - m_amout = m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4; + m_amout = m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4; break; case 3: - m_amout = m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 8; + m_amout = m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 8; break; } return 4; } -UINT32 v60_device::bam2DisplacementIndexed16() +uint32_t v60_device::bam2DisplacementIndexed16() { m_amflag = 0; - m_amout = m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2); + m_amout = m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2); m_bamoffset = m_reg[m_modval & 0x1F]; return 4; } -UINT32 v60_device::am2DisplacementIndexed32() +uint32_t v60_device::am2DisplacementIndexed32() { m_amflag = 0; @@ -287,7 +287,7 @@ UINT32 v60_device::am2DisplacementIndexed32() return 6; } -UINT32 v60_device::bam2DisplacementIndexed32() +uint32_t v60_device::bam2DisplacementIndexed32() { m_amflag = 0; m_amout = m_reg[m_modval2 & 0x1F] + OpRead32(m_modadd + 2); @@ -296,41 +296,41 @@ UINT32 v60_device::bam2DisplacementIndexed32() return 6; } -UINT32 v60_device::am2PCDisplacement8() +uint32_t v60_device::am2PCDisplacement8() { m_amflag = 0; - m_amout = PC + (INT8)OpRead8(m_modadd + 1); + m_amout = PC + (int8_t)OpRead8(m_modadd + 1); return 2; } -UINT32 v60_device::bam2PCDisplacement8() +uint32_t v60_device::bam2PCDisplacement8() { m_amflag = 0; m_amout = PC; - m_bamoffset = (INT8)OpRead8(m_modadd + 1); + m_bamoffset = (int8_t)OpRead8(m_modadd + 1); return 2; } -UINT32 v60_device::am2PCDisplacement16() +uint32_t v60_device::am2PCDisplacement16() { m_amflag = 0; - m_amout = PC + (INT16)OpRead16(m_modadd + 1); + m_amout = PC + (int16_t)OpRead16(m_modadd + 1); return 3; } -UINT32 v60_device::bam2PCDisplacement16() +uint32_t v60_device::bam2PCDisplacement16() { m_amflag = 0; m_amout = PC; - m_bamoffset = (INT16)OpRead16(m_modadd + 1); + m_bamoffset = (int16_t)OpRead16(m_modadd + 1); return 3; } -UINT32 v60_device::am2PCDisplacement32() +uint32_t v60_device::am2PCDisplacement32() { m_amflag = 0; m_amout = PC + OpRead32(m_modadd + 1); @@ -338,7 +338,7 @@ UINT32 v60_device::am2PCDisplacement32() return 5; } -UINT32 v60_device::bam2PCDisplacement32() +uint32_t v60_device::bam2PCDisplacement32() { m_amflag = 0; m_amout = PC; @@ -348,71 +348,71 @@ UINT32 v60_device::bam2PCDisplacement32() } -UINT32 v60_device::am2PCDisplacementIndexed8() +uint32_t v60_device::am2PCDisplacementIndexed8() { m_amflag = 0; switch (m_moddim) { case 0: - m_amout = PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F]; + m_amout = PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F]; break; case 1: - m_amout = PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2; + m_amout = PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2; break; case 2: - m_amout = PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4; + m_amout = PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4; break; case 3: - m_amout = PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 8; + m_amout = PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 8; break; } return 3; } -UINT32 v60_device::bam2PCDisplacementIndexed8() +uint32_t v60_device::bam2PCDisplacementIndexed8() { m_amflag = 0; - m_amout = PC + (INT8)OpRead8(m_modadd + 2); + m_amout = PC + (int8_t)OpRead8(m_modadd + 2); m_bamoffset = m_reg[m_modval & 0x1F]; return 3; } -UINT32 v60_device::am2PCDisplacementIndexed16() +uint32_t v60_device::am2PCDisplacementIndexed16() { m_amflag = 0; switch (m_moddim) { case 0: - m_amout = PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F]; + m_amout = PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F]; break; case 1: - m_amout = PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2; + m_amout = PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2; break; case 2: - m_amout = PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4; + m_amout = PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4; break; case 3: - m_amout = PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 8; + m_amout = PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 8; break; } return 4; } -UINT32 v60_device::bam2PCDisplacementIndexed16() +uint32_t v60_device::bam2PCDisplacementIndexed16() { m_amflag = 0; - m_amout = PC + (INT16)OpRead16(m_modadd + 2); + m_amout = PC + (int16_t)OpRead16(m_modadd + 2); m_bamoffset = m_reg[m_modval & 0x1F]; return 4; } -UINT32 v60_device::am2PCDisplacementIndexed32() +uint32_t v60_device::am2PCDisplacementIndexed32() { m_amflag = 0; @@ -435,7 +435,7 @@ UINT32 v60_device::am2PCDisplacementIndexed32() return 6; } -UINT32 v60_device::bam2PCDisplacementIndexed32() +uint32_t v60_device::bam2PCDisplacementIndexed32() { m_amflag = 0; m_amout = PC + OpRead32(m_modadd + 2); @@ -444,39 +444,39 @@ UINT32 v60_device::bam2PCDisplacementIndexed32() return 6; } -UINT32 v60_device::am2DisplacementIndirect8() +uint32_t v60_device::am2DisplacementIndirect8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)); return 2; } -UINT32 v60_device::bam2DisplacementIndirect8() +uint32_t v60_device::bam2DisplacementIndirect8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)); m_bamoffset = 0; return 2; } -UINT32 v60_device::am2DisplacementIndirect16() +uint32_t v60_device::am2DisplacementIndirect16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)); return 3; } -UINT32 v60_device::bam2DisplacementIndirect16() +uint32_t v60_device::bam2DisplacementIndirect16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)); m_bamoffset = 0; return 3; } -UINT32 v60_device::am2DisplacementIndirect32() +uint32_t v60_device::am2DisplacementIndirect32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + OpRead32(m_modadd + 1)); @@ -484,7 +484,7 @@ UINT32 v60_device::am2DisplacementIndirect32() return 5; } -UINT32 v60_device::bam2DisplacementIndirect32() +uint32_t v60_device::bam2DisplacementIndirect32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + OpRead32(m_modadd + 1)); @@ -493,71 +493,71 @@ UINT32 v60_device::bam2DisplacementIndirect32() return 5; } -UINT32 v60_device::am2DisplacementIndirectIndexed8() +uint32_t v60_device::am2DisplacementIndirectIndexed8() { m_amflag = 0; switch (m_moddim) { case 0: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F]; + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F]; break; case 1: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2; + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2; break; case 2: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4; + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4; break; case 3: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 8; + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 8; break; } return 3; } -UINT32 v60_device::bam2DisplacementIndirectIndexed8() +uint32_t v60_device::bam2DisplacementIndirectIndexed8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)); m_bamoffset = m_reg[m_modval & 0x1F]; return 3; } -UINT32 v60_device::am2DisplacementIndirectIndexed16() +uint32_t v60_device::am2DisplacementIndirectIndexed16() { m_amflag = 0; switch (m_moddim) { case 0: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F]; + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F]; break; case 1: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2; + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2; break; case 2: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4; + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4; break; case 3: - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 8; + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 8; break; } return 4; } -UINT32 v60_device::bam2DisplacementIndirectIndexed16() +uint32_t v60_device::bam2DisplacementIndirectIndexed16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)); m_bamoffset = m_reg[m_modval & 0x1F]; return 4; } -UINT32 v60_device::am2DisplacementIndirectIndexed32() +uint32_t v60_device::am2DisplacementIndirectIndexed32() { m_amflag = 0; @@ -580,7 +580,7 @@ UINT32 v60_device::am2DisplacementIndirectIndexed32() return 6; } -UINT32 v60_device::bam2DisplacementIndirectIndexed32() +uint32_t v60_device::bam2DisplacementIndirectIndexed32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + OpRead32(m_modadd + 2)); @@ -589,41 +589,41 @@ UINT32 v60_device::bam2DisplacementIndirectIndexed32() return 6; } -UINT32 v60_device::am2PCDisplacementIndirect8() +uint32_t v60_device::am2PCDisplacementIndirect8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)); return 2; } -UINT32 v60_device::bam2PCDisplacementIndirect8() +uint32_t v60_device::bam2PCDisplacementIndirect8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)); m_bamoffset = 0; return 2; } -UINT32 v60_device::am2PCDisplacementIndirect16() +uint32_t v60_device::am2PCDisplacementIndirect16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)); return 3; } -UINT32 v60_device::bam2PCDisplacementIndirect16() +uint32_t v60_device::bam2PCDisplacementIndirect16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)); + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)); m_bamoffset = 0; return 3; } -UINT32 v60_device::am2PCDisplacementIndirect32() +uint32_t v60_device::am2PCDisplacementIndirect32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(PC + OpRead32(m_modadd + 1)); @@ -631,7 +631,7 @@ UINT32 v60_device::am2PCDisplacementIndirect32() return 5; } -UINT32 v60_device::bam2PCDisplacementIndirect32() +uint32_t v60_device::bam2PCDisplacementIndirect32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(PC + OpRead32(m_modadd + 1)); @@ -640,55 +640,55 @@ UINT32 v60_device::bam2PCDisplacementIndirect32() return 5; } -UINT32 v60_device::am2PCDisplacementIndirectIndexed8() +uint32_t v60_device::am2PCDisplacementIndirectIndexed8() { m_amflag = 0; switch (m_moddim) { case 0: - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F]; + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F]; break; case 1: - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2; + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2; break; case 2: - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4; + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4; break; case 3: - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 8; + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 8; break; } return 3; } -UINT32 v60_device::bam2PCDisplacementIndirectIndexed8() +uint32_t v60_device::bam2PCDisplacementIndirectIndexed8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)); + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)); m_bamoffset = m_reg[m_modval & 0x1F]; return 3; } -UINT32 v60_device::am2PCDisplacementIndirectIndexed16() +uint32_t v60_device::am2PCDisplacementIndirectIndexed16() { m_amflag = 0; switch (m_moddim) { case 0: - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F]; + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F]; break; case 1: - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2; + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2; break; case 2: - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4; + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4; break; case 3: - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 8; + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 8; break; } @@ -696,17 +696,17 @@ UINT32 v60_device::am2PCDisplacementIndirectIndexed16() } -UINT32 v60_device::bam2PCDisplacementIndirectIndexed16() +uint32_t v60_device::bam2PCDisplacementIndirectIndexed16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)); + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)); m_bamoffset = m_reg[m_modval & 0x1F]; return 4; } -UINT32 v60_device::am2PCDisplacementIndirectIndexed32() +uint32_t v60_device::am2PCDisplacementIndirectIndexed32() { m_amflag = 0; @@ -729,7 +729,7 @@ UINT32 v60_device::am2PCDisplacementIndirectIndexed32() return 6; } -UINT32 v60_device::bam2PCDisplacementIndirectIndexed32() +uint32_t v60_device::bam2PCDisplacementIndirectIndexed32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(PC + OpRead32(m_modadd + 2)); @@ -738,41 +738,41 @@ UINT32 v60_device::bam2PCDisplacementIndirectIndexed32() return 6; } -UINT32 v60_device::am2DoubleDisplacement8() +uint32_t v60_device::am2DoubleDisplacement8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2); return 3; } -UINT32 v60_device::bam2DoubleDisplacement8() +uint32_t v60_device::bam2DoubleDisplacement8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)); - m_bamoffset = (INT8)OpRead8(m_modadd + 2); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)); + m_bamoffset = (int8_t)OpRead8(m_modadd + 2); return 3; } -UINT32 v60_device::am2DoubleDisplacement16() +uint32_t v60_device::am2DoubleDisplacement16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3); return 5; } -UINT32 v60_device::bam2DoubleDisplacement16() +uint32_t v60_device::bam2DoubleDisplacement16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)); - m_bamoffset = (INT8)OpRead8(m_modadd + 3); + m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)); + m_bamoffset = (int8_t)OpRead8(m_modadd + 3); return 5; } -UINT32 v60_device::am2DoubleDisplacement32() +uint32_t v60_device::am2DoubleDisplacement32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + OpRead32(m_modadd + 1)) + OpRead32(m_modadd + 5); @@ -780,7 +780,7 @@ UINT32 v60_device::am2DoubleDisplacement32() return 9; } -UINT32 v60_device::bam2DoubleDisplacement32() +uint32_t v60_device::bam2DoubleDisplacement32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + OpRead32(m_modadd + 1)); @@ -790,41 +790,41 @@ UINT32 v60_device::bam2DoubleDisplacement32() } -UINT32 v60_device::am2PCDoubleDisplacement8() +uint32_t v60_device::am2PCDoubleDisplacement8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2); + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2); return 3; } -UINT32 v60_device::bam2PCDoubleDisplacement8() +uint32_t v60_device::bam2PCDoubleDisplacement8() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)); - m_bamoffset = (INT8)OpRead8(m_modadd + 2); + m_amout = m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)); + m_bamoffset = (int8_t)OpRead8(m_modadd + 2); return 3; } -UINT32 v60_device::am2PCDoubleDisplacement16() +uint32_t v60_device::am2PCDoubleDisplacement16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3); + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3); return 5; } -UINT32 v60_device::bam2PCDoubleDisplacement16() +uint32_t v60_device::bam2PCDoubleDisplacement16() { m_amflag = 0; - m_amout = m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)); - m_bamoffset = (INT8)OpRead8(m_modadd + 3); + m_amout = m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)); + m_bamoffset = (int8_t)OpRead8(m_modadd + 3); return 5; } -UINT32 v60_device::am2PCDoubleDisplacement32() +uint32_t v60_device::am2PCDoubleDisplacement32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(PC + OpRead32(m_modadd + 1)) + OpRead32(m_modadd + 5); @@ -832,7 +832,7 @@ UINT32 v60_device::am2PCDoubleDisplacement32() return 9; } -UINT32 v60_device::bam2PCDoubleDisplacement32() +uint32_t v60_device::bam2PCDoubleDisplacement32() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(PC + OpRead32(m_modadd + 1)); @@ -841,7 +841,7 @@ UINT32 v60_device::bam2PCDoubleDisplacement32() return 9; } -UINT32 v60_device::am2DirectAddress() +uint32_t v60_device::am2DirectAddress() { m_amflag = 0; m_amout = OpRead32(m_modadd + 1); @@ -849,7 +849,7 @@ UINT32 v60_device::am2DirectAddress() return 5; } -UINT32 v60_device::bam2DirectAddress() +uint32_t v60_device::bam2DirectAddress() { m_amflag = 0; m_amout = OpRead32(m_modadd + 1); @@ -858,7 +858,7 @@ UINT32 v60_device::bam2DirectAddress() return 5; } -UINT32 v60_device::am2DirectAddressIndexed() +uint32_t v60_device::am2DirectAddressIndexed() { m_amflag = 0; @@ -881,7 +881,7 @@ UINT32 v60_device::am2DirectAddressIndexed() return 6; } -UINT32 v60_device::bam2DirectAddressIndexed() +uint32_t v60_device::bam2DirectAddressIndexed() { m_amflag = 0; m_amout = OpRead32(m_modadd + 2); @@ -890,7 +890,7 @@ UINT32 v60_device::bam2DirectAddressIndexed() return 6; } -UINT32 v60_device::am2DirectAddressDeferred() +uint32_t v60_device::am2DirectAddressDeferred() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(OpRead32(m_modadd + 1)); @@ -898,7 +898,7 @@ UINT32 v60_device::am2DirectAddressDeferred() return 5; } -UINT32 v60_device::bam2DirectAddressDeferred() +uint32_t v60_device::bam2DirectAddressDeferred() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(OpRead32(m_modadd + 1)); @@ -907,7 +907,7 @@ UINT32 v60_device::bam2DirectAddressDeferred() return 5; } -UINT32 v60_device::am2DirectAddressDeferredIndexed() +uint32_t v60_device::am2DirectAddressDeferredIndexed() { m_amflag = 0; @@ -930,7 +930,7 @@ UINT32 v60_device::am2DirectAddressDeferredIndexed() return 6; } -UINT32 v60_device::bam2DirectAddressDeferredIndexed() +uint32_t v60_device::bam2DirectAddressDeferredIndexed() { m_amflag = 0; m_amout = m_program->read_dword_unaligned(OpRead32(m_modadd + 2)); @@ -939,13 +939,13 @@ UINT32 v60_device::bam2DirectAddressDeferredIndexed() return 6; } -UINT32 v60_device::am2Immediate() +uint32_t v60_device::am2Immediate() { // ignore LDPR return am1Immediate(); } -UINT32 v60_device::am2ImmediateQuick() +uint32_t v60_device::am2ImmediateQuick() { // ignore LDPR return am1ImmediateQuick(); @@ -955,72 +955,72 @@ UINT32 v60_device::am2ImmediateQuick() // AM2 Tables (for ReadAMAddress) // ****************************** -UINT32 v60_device::am2Error1() +uint32_t v60_device::am2Error1() { // f1lap trips this, why? logerror("CPU - AM2 - 1 (PC=%06x)", PC); return 0; } -UINT32 v60_device::am2Error2() +uint32_t v60_device::am2Error2() { fatalerror("CPU - AM2 - 2 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } #ifdef UNUSED_FUNCTION -UINT32 v60_device::am2Error3() +uint32_t v60_device::am2Error3() { fatalerror("CPU - AM2 - 3 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } #endif -UINT32 v60_device::am2Error4() +uint32_t v60_device::am2Error4() { fatalerror("CPU - AM2 - 4 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::am2Error5() +uint32_t v60_device::am2Error5() { fatalerror("CPU - AM2 - 5 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam2Error1() +uint32_t v60_device::bam2Error1() { fatalerror("CPU - BAM2 - 1 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam2Error2() +uint32_t v60_device::bam2Error2() { fatalerror("CPU - BAM2 - 2 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } #ifdef UNUSED_FUNCTION -UINT32 v60_device::bam2Error3() +uint32_t v60_device::bam2Error3() { fatalerror("CPU - BAM2 - 3 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } #endif -UINT32 v60_device::bam2Error4() +uint32_t v60_device::bam2Error4() { fatalerror("CPU - BAM2 - 4 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam2Error5() +uint32_t v60_device::bam2Error5() { fatalerror("CPU - BAM2 - 5 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::bam2Error6() +uint32_t v60_device::bam2Error6() { fatalerror("CPU - BAM2 - 6 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ @@ -1067,7 +1067,7 @@ const v60_device::am_func v60_device::s_BAMTable2_G7a[16] = &v60_device::bam2Error5 }; -UINT32 v60_device::am2Group7a() +uint32_t v60_device::am2Group7a() { if (!(m_modval2 & 0x10)) return am2Error4(); @@ -1075,7 +1075,7 @@ UINT32 v60_device::am2Group7a() return (this->*s_AMTable2_G7a[m_modval2 & 0xF])(); } -UINT32 v60_device::bam2Group7a() +uint32_t v60_device::bam2Group7a() { if (!(m_modval2 & 0x10)) return bam2Error4(); @@ -1182,22 +1182,22 @@ const v60_device::am_func v60_device::s_BAMTable2_G6[8] = -UINT32 v60_device::am2Group6() +uint32_t v60_device::am2Group6() { m_modval2 = OpRead8(m_modadd + 1); return (this->*s_AMTable2_G6[m_modval2 >> 5])(); } -UINT32 v60_device::bam2Group6() +uint32_t v60_device::bam2Group6() { m_modval2 = OpRead8(m_modadd + 1); return (this->*s_BAMTable2_G6[m_modval2 >> 5])(); } -UINT32 v60_device::am2Group7() +uint32_t v60_device::am2Group7() { return (this->*s_AMTable2_G7[m_modval & 0x1F])(); } -UINT32 v60_device::bam2Group7() +uint32_t v60_device::bam2Group7() { return (this->*s_BAMTable2_G7[m_modval & 0x1F])(); } diff --git a/src/devices/cpu/v60/am3.hxx b/src/devices/cpu/v60/am3.hxx index 93af406f266..e02051b1be4 100644 --- a/src/devices/cpu/v60/am3.hxx +++ b/src/devices/cpu/v60/am3.hxx @@ -3,7 +3,7 @@ // AM3 Functions (for ReadAM) // ************************** -UINT32 v60_device::am3Register() +uint32_t v60_device::am3Register() { switch (m_moddim) { @@ -21,7 +21,7 @@ UINT32 v60_device::am3Register() return 1; } -UINT32 v60_device::am3RegisterIndirect() +uint32_t v60_device::am3RegisterIndirect() { switch (m_moddim) { @@ -39,7 +39,7 @@ UINT32 v60_device::am3RegisterIndirect() return 1; } -UINT32 v60_device::am3RegisterIndirectIndexed() +uint32_t v60_device::am3RegisterIndirectIndexed() { switch (m_moddim) { @@ -57,7 +57,7 @@ UINT32 v60_device::am3RegisterIndirectIndexed() return 2; } -UINT32 v60_device::am3Autoincrement() +uint32_t v60_device::am3Autoincrement() { switch (m_moddim) { @@ -78,7 +78,7 @@ UINT32 v60_device::am3Autoincrement() return 1; } -UINT32 v60_device::am3Autodecrement() +uint32_t v60_device::am3Autodecrement() { switch (m_moddim) { @@ -99,43 +99,43 @@ UINT32 v60_device::am3Autodecrement() return 1; } -UINT32 v60_device::am3Displacement8() +uint32_t v60_device::am3Displacement8() { switch (m_moddim) { case 0: - m_program->write_byte(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1), m_modwritevalb); + m_program->write_byte(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1), m_modwritevalh); + m_program->write_word_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1), m_modwritevalw); + m_program->write_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1), m_modwritevalw); break; } return 2; } -UINT32 v60_device::am3Displacement16() +uint32_t v60_device::am3Displacement16() { switch (m_moddim) { case 0: - m_program->write_byte(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1), m_modwritevalb); + m_program->write_byte(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1), m_modwritevalh); + m_program->write_word_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1), m_modwritevalw); + m_program->write_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1), m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3Displacement32() +uint32_t v60_device::am3Displacement32() { switch (m_moddim) { @@ -154,43 +154,43 @@ UINT32 v60_device::am3Displacement32() } -UINT32 v60_device::am3DisplacementIndexed8() +uint32_t v60_device::am3DisplacementIndexed8() { switch (m_moddim) { case 0: - m_program->write_byte(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F], m_modwritevalb); + m_program->write_byte(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F], m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); + m_program->write_word_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); + m_program->write_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3DisplacementIndexed16() +uint32_t v60_device::am3DisplacementIndexed16() { switch (m_moddim) { case 0: - m_program->write_byte(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F], m_modwritevalb); + m_program->write_byte(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F], m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); + m_program->write_word_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); + m_program->write_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); break; } return 4; } -UINT32 v60_device::am3DisplacementIndexed32() +uint32_t v60_device::am3DisplacementIndexed32() { switch (m_moddim) { @@ -209,43 +209,43 @@ UINT32 v60_device::am3DisplacementIndexed32() } -UINT32 v60_device::am3PCDisplacement8() +uint32_t v60_device::am3PCDisplacement8() { switch (m_moddim) { case 0: - m_program->write_byte(PC + (INT8)OpRead8(m_modadd + 1), m_modwritevalb); + m_program->write_byte(PC + (int8_t)OpRead8(m_modadd + 1), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(PC + (INT8)OpRead8(m_modadd + 1), m_modwritevalh); + m_program->write_word_unaligned(PC + (int8_t)OpRead8(m_modadd + 1), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1), m_modwritevalw); + m_program->write_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1), m_modwritevalw); break; } return 2; } -UINT32 v60_device::am3PCDisplacement16() +uint32_t v60_device::am3PCDisplacement16() { switch (m_moddim) { case 0: - m_program->write_byte(PC + (INT16)OpRead16(m_modadd + 1), m_modwritevalb); + m_program->write_byte(PC + (int16_t)OpRead16(m_modadd + 1), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(PC + (INT16)OpRead16(m_modadd + 1), m_modwritevalh); + m_program->write_word_unaligned(PC + (int16_t)OpRead16(m_modadd + 1), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1), m_modwritevalw); + m_program->write_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1), m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3PCDisplacement32() +uint32_t v60_device::am3PCDisplacement32() { switch (m_moddim) { @@ -263,43 +263,43 @@ UINT32 v60_device::am3PCDisplacement32() return 5; } -UINT32 v60_device::am3PCDisplacementIndexed8() +uint32_t v60_device::am3PCDisplacementIndexed8() { switch (m_moddim) { case 0: - m_program->write_byte(PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F], m_modwritevalb); + m_program->write_byte(PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F], m_modwritevalb); break; case 1: - m_program->write_word_unaligned(PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); + m_program->write_word_unaligned(PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); + m_program->write_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3PCDisplacementIndexed16() +uint32_t v60_device::am3PCDisplacementIndexed16() { switch (m_moddim) { case 0: - m_program->write_byte(PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F], m_modwritevalb); + m_program->write_byte(PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F], m_modwritevalb); break; case 1: - m_program->write_word_unaligned(PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); + m_program->write_word_unaligned(PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); + m_program->write_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); break; } return 4; } -UINT32 v60_device::am3PCDisplacementIndexed32() +uint32_t v60_device::am3PCDisplacementIndexed32() { switch (m_moddim) { @@ -317,43 +317,43 @@ UINT32 v60_device::am3PCDisplacementIndexed32() return 6; } -UINT32 v60_device::am3DisplacementIndirect8() +uint32_t v60_device::am3DisplacementIndirect8() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)), m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)), m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)), m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)), m_modwritevalw); break; } return 2; } -UINT32 v60_device::am3DisplacementIndirect16() +uint32_t v60_device::am3DisplacementIndirect16() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)), m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)), m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)), m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)), m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3DisplacementIndirect32() +uint32_t v60_device::am3DisplacementIndirect32() { switch (m_moddim) { @@ -372,43 +372,43 @@ UINT32 v60_device::am3DisplacementIndirect32() } -UINT32 v60_device::am3DisplacementIndirectIndexed8() +uint32_t v60_device::am3DisplacementIndirectIndexed8() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F], m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F], m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3DisplacementIndirectIndexed16() +uint32_t v60_device::am3DisplacementIndirectIndexed16() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F], m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F], m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval2 & 0x1F] + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); break; } return 4; } -UINT32 v60_device::am3DisplacementIndirectIndexed32() +uint32_t v60_device::am3DisplacementIndirectIndexed32() { switch (m_moddim) { @@ -426,43 +426,43 @@ UINT32 v60_device::am3DisplacementIndirectIndexed32() return 6; } -UINT32 v60_device::am3PCDisplacementIndirect8() +uint32_t v60_device::am3PCDisplacementIndirect8() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)), m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)), m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)), m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)), m_modwritevalw); break; } return 2; } -UINT32 v60_device::am3PCDisplacementIndirect16() +uint32_t v60_device::am3PCDisplacementIndirect16() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)), m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)), m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)), m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)), m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3PCDisplacementIndirect32() +uint32_t v60_device::am3PCDisplacementIndirect32() { switch (m_moddim) { @@ -481,43 +481,43 @@ UINT32 v60_device::am3PCDisplacementIndirect32() } -UINT32 v60_device::am3PCDisplacementIndirectIndexed8() +uint32_t v60_device::am3PCDisplacementIndirectIndexed8() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F], m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F], m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3PCDisplacementIndirectIndexed16() +uint32_t v60_device::am3PCDisplacementIndirectIndexed16() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F], m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F], m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 2, m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 2)) + m_reg[m_modval & 0x1F] * 4, m_modwritevalw); break; } return 4; } -UINT32 v60_device::am3PCDisplacementIndirectIndexed32() +uint32_t v60_device::am3PCDisplacementIndirectIndexed32() { switch (m_moddim) { @@ -536,43 +536,43 @@ UINT32 v60_device::am3PCDisplacementIndirectIndexed32() } -UINT32 v60_device::am3DoubleDisplacement8() +uint32_t v60_device::am3DoubleDisplacement8() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2), m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2), m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2), m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2), m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3DoubleDisplacement16() +uint32_t v60_device::am3DoubleDisplacement16() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3), m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3), m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3), m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(m_reg[m_modval & 0x1F] + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3), m_modwritevalw); break; } return 5; } -UINT32 v60_device::am3DoubleDisplacement32() +uint32_t v60_device::am3DoubleDisplacement32() { switch (m_moddim) { @@ -591,43 +591,43 @@ UINT32 v60_device::am3DoubleDisplacement32() } -UINT32 v60_device::am3PCDoubleDisplacement8() +uint32_t v60_device::am3PCDoubleDisplacement8() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2), m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2), m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (INT8)OpRead8(m_modadd + 1)) + (INT8)OpRead8(m_modadd + 2), m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (int8_t)OpRead8(m_modadd + 1)) + (int8_t)OpRead8(m_modadd + 2), m_modwritevalw); break; } return 3; } -UINT32 v60_device::am3PCDoubleDisplacement16() +uint32_t v60_device::am3PCDoubleDisplacement16() { switch (m_moddim) { case 0: - m_program->write_byte(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3), m_modwritevalb); + m_program->write_byte(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3), m_modwritevalb); break; case 1: - m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3), m_modwritevalh); + m_program->write_word_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3), m_modwritevalh); break; case 2: - m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (INT16)OpRead16(m_modadd + 1)) + (INT16)OpRead16(m_modadd + 3), m_modwritevalw); + m_program->write_dword_unaligned(m_program->read_dword_unaligned(PC + (int16_t)OpRead16(m_modadd + 1)) + (int16_t)OpRead16(m_modadd + 3), m_modwritevalw); break; } return 5; } -UINT32 v60_device::am3PCDoubleDisplacement32() +uint32_t v60_device::am3PCDoubleDisplacement32() { switch (m_moddim) { @@ -645,7 +645,7 @@ UINT32 v60_device::am3PCDoubleDisplacement32() return 9; } -UINT32 v60_device::am3DirectAddress() +uint32_t v60_device::am3DirectAddress() { switch (m_moddim) { @@ -663,7 +663,7 @@ UINT32 v60_device::am3DirectAddress() return 5; } -UINT32 v60_device::am3DirectAddressIndexed() +uint32_t v60_device::am3DirectAddressIndexed() { switch (m_moddim) { @@ -681,7 +681,7 @@ UINT32 v60_device::am3DirectAddressIndexed() return 6; } -UINT32 v60_device::am3DirectAddressDeferred() +uint32_t v60_device::am3DirectAddressDeferred() { switch (m_moddim) { @@ -699,7 +699,7 @@ UINT32 v60_device::am3DirectAddressDeferred() return 5; } -UINT32 v60_device::am3DirectAddressDeferredIndexed() +uint32_t v60_device::am3DirectAddressDeferredIndexed() { switch (m_moddim) { @@ -717,13 +717,13 @@ UINT32 v60_device::am3DirectAddressDeferredIndexed() return 6; } -UINT32 v60_device::am3Immediate() +uint32_t v60_device::am3Immediate() { fatalerror("CPU - AM3 - IMM (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::am3ImmediateQuick() +uint32_t v60_device::am3ImmediateQuick() { fatalerror("CPU - AM3 - IMMQ (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ @@ -734,33 +734,33 @@ UINT32 v60_device::am3ImmediateQuick() // AM3 Tables (for ReadAMAddress) // ****************************** -UINT32 v60_device::am3Error1() +uint32_t v60_device::am3Error1() { fatalerror("CPU - AM3 - 1 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::am3Error2() +uint32_t v60_device::am3Error2() { fatalerror("CPU - AM3 - 2 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } #ifdef UNUSED_FUNCTION -UINT32 v60_device::am3Error3() +uint32_t v60_device::am3Error3() { fatalerror("CPU - AM3 - 3 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } #endif -UINT32 v60_device::am3Error4() +uint32_t v60_device::am3Error4() { fatalerror("CPU - AM3 - 4 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::am3Error5() +uint32_t v60_device::am3Error5() { fatalerror("CPU - AM3 - 5 (PC=%06x)\n", PC); return 0; /* never reached, fatalerror won't return */ @@ -786,7 +786,7 @@ const v60_device::am_func v60_device::s_AMTable3_G7a[16] = &v60_device::am3Error5 }; -UINT32 v60_device::am3Group7a() +uint32_t v60_device::am3Group7a() { if (!(m_modval2 & 0x10)) return am3Error4(); @@ -845,14 +845,14 @@ const v60_device::am_func v60_device::s_AMTable3_G6[8] = -UINT32 v60_device::am3Group6() +uint32_t v60_device::am3Group6() { m_modval2 = OpRead8(m_modadd + 1); return (this->*s_AMTable3_G6[m_modval2 >> 5])(); } -UINT32 v60_device::am3Group7() +uint32_t v60_device::am3Group7() { return (this->*s_AMTable3_G7[m_modval & 0x1F])(); } diff --git a/src/devices/cpu/v60/op12.hxx b/src/devices/cpu/v60/op12.hxx index 319e9995595..cb9dde1c153 100644 --- a/src/devices/cpu/v60/op12.hxx +++ b/src/devices/cpu/v60/op12.hxx @@ -20,13 +20,13 @@ #define F12LOADOPBYTE(num) \ if (m_flag##num) \ - appb = (UINT8)m_reg[m_op##num]; \ + appb = (uint8_t)m_reg[m_op##num]; \ else \ appb = m_program->read_byte(m_op##num); #define F12LOADOPHALF(num) \ if (m_flag##num) \ - apph = (UINT16)m_reg[m_op##num]; \ + apph = (uint16_t)m_reg[m_op##num]; \ else \ apph = m_program->read_word_unaligned(m_op##num); @@ -76,7 +76,7 @@ // Decode the first operand of the instruction and prepare // writing to the second operand. -void v60_device::F12DecodeFirstOperand(am_func DecodeOp1, UINT8 dim1) +void v60_device::F12DecodeFirstOperand(am_func DecodeOp1, uint8_t dim1) { m_instflags = OpRead8(PC + 1); @@ -109,10 +109,10 @@ void v60_device::F12DecodeFirstOperand(am_func DecodeOp1, UINT8 dim1) switch (dim1) { case 0: - m_op1 = (UINT8)m_reg[m_instflags & 0x1F]; + m_op1 = (uint8_t)m_reg[m_instflags & 0x1F]; break; case 1: - m_op1 = (UINT16)m_reg[m_instflags & 0x1F]; + m_op1 = (uint16_t)m_reg[m_instflags & 0x1F]; break; case 2: m_op1 = m_reg[m_instflags & 0x1F]; @@ -132,7 +132,7 @@ void v60_device::F12DecodeFirstOperand(am_func DecodeOp1, UINT8 dim1) } } -void v60_device::F12WriteSecondOperand(UINT8 dim2) +void v60_device::F12WriteSecondOperand(uint8_t dim2) { m_moddim = dim2; @@ -177,9 +177,9 @@ void v60_device::F12WriteSecondOperand(UINT8 dim2) // Decode both format 1 / 2 operands -void v60_device::F12DecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func DecodeOp2, UINT8 dim2) +void v60_device::F12DecodeOperands(am_func DecodeOp1, uint8_t dim1, am_func DecodeOp2, uint8_t dim2) { - UINT8 _if12 = OpRead8(PC + 1); + uint8_t _if12 = OpRead8(PC + 1); // Check if F1 or F2 if (_if12 & 0x80) @@ -213,10 +213,10 @@ void v60_device::F12DecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func Decode switch (dim2) { case 0: - m_op2 = (UINT8)m_reg[_if12 & 0x1F]; + m_op2 = (uint8_t)m_reg[_if12 & 0x1F]; break; case 1: - m_op2 = (UINT16)m_reg[_if12 & 0x1F]; + m_op2 = (uint16_t)m_reg[_if12 & 0x1F]; break; case 2: m_op2 = m_reg[_if12 & 0x1F]; @@ -245,10 +245,10 @@ void v60_device::F12DecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func Decode switch (dim1) { case 0: - m_op1 = (UINT8)m_reg[_if12 & 0x1F]; + m_op1 = (uint8_t)m_reg[_if12 & 0x1F]; break; case 1: - m_op1 = (UINT16)m_reg[_if12 & 0x1F]; + m_op1 = (uint16_t)m_reg[_if12 & 0x1F]; break; case 2: m_op1 = m_reg[_if12 & 0x1F]; @@ -267,78 +267,78 @@ void v60_device::F12DecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func Decode } } -UINT32 v60_device::opADDB() /* TRUSTED (C too!)*/ +uint32_t v60_device::opADDB() /* TRUSTED (C too!)*/ { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); - ADDB(appb, (UINT8)m_op1); + ADDB(appb, (uint8_t)m_op1); F12STOREOP2BYTE(); F12END(); } -UINT32 v60_device::opADDH() /* TRUSTED (C too!)*/ +uint32_t v60_device::opADDH() /* TRUSTED (C too!)*/ { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); - ADDW(apph, (UINT16)m_op1); + ADDW(apph, (uint16_t)m_op1); F12STOREOP2HALF(); F12END(); } -UINT32 v60_device::opADDW() /* TRUSTED (C too!) */ +uint32_t v60_device::opADDW() /* TRUSTED (C too!) */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); - ADDL(appw, (UINT32)m_op1); + ADDL(appw, (uint32_t)m_op1); F12STOREOP2WORD(); F12END(); } -UINT32 v60_device::opADDCB() +uint32_t v60_device::opADDCB() { - UINT8 appb, temp; + uint8_t appb, temp; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); - temp = ((UINT8)m_op1 + (_CY?1:0)); + temp = ((uint8_t)m_op1 + (_CY?1:0)); ADDB(appb, temp); F12STOREOP2BYTE(); F12END(); } -UINT32 v60_device::opADDCH() +uint32_t v60_device::opADDCH() { - UINT16 apph, temp; + uint16_t apph, temp; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); - temp = ((UINT16)m_op1 + (_CY?1:0)); + temp = ((uint16_t)m_op1 + (_CY?1:0)); ADDW(apph, temp); F12STOREOP2HALF(); F12END(); } -UINT32 v60_device::opADDCW() +uint32_t v60_device::opADDCW() { - UINT32 appw, temp; + uint32_t appw, temp; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); @@ -351,9 +351,9 @@ UINT32 v60_device::opADDCW() F12END(); } -UINT32 v60_device::opANDB() /* TRUSTED */ +uint32_t v60_device::opANDB() /* TRUSTED */ { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); @@ -367,9 +367,9 @@ UINT32 v60_device::opANDB() /* TRUSTED */ F12END(); } -UINT32 v60_device::opANDH() /* TRUSTED */ +uint32_t v60_device::opANDH() /* TRUSTED */ { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); @@ -383,9 +383,9 @@ UINT32 v60_device::opANDH() /* TRUSTED */ F12END(); } -UINT32 v60_device::opANDW() /* TRUSTED */ +uint32_t v60_device::opANDW() /* TRUSTED */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); @@ -399,7 +399,7 @@ UINT32 v60_device::opANDW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opCALL() /* TRUSTED */ +uint32_t v60_device::opCALL() /* TRUSTED */ { F12DecodeOperands(&v60_device::ReadAMAddress, 0,&v60_device::ReadAMAddress, 2); @@ -414,7 +414,7 @@ UINT32 v60_device::opCALL() /* TRUSTED */ return 0; } -UINT32 v60_device::opCHKAR() +uint32_t v60_device::opCHKAR() { F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAM, 0); @@ -426,7 +426,7 @@ UINT32 v60_device::opCHKAR() F12END(); } -UINT32 v60_device::opCHKAW() +uint32_t v60_device::opCHKAW() { F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAM, 0); @@ -438,7 +438,7 @@ UINT32 v60_device::opCHKAW() F12END(); } -UINT32 v60_device::opCHKAE() +uint32_t v60_device::opCHKAE() { F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAM, 0); @@ -450,9 +450,9 @@ UINT32 v60_device::opCHKAE() F12END(); } -UINT32 v60_device::opCHLVL() +uint32_t v60_device::opCHLVL() { - UINT32 oldPSW; + uint32_t oldPSW; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAM, 0); @@ -480,9 +480,9 @@ UINT32 v60_device::opCHLVL() return 0; } -UINT32 v60_device::opCLR1() /* TRUSTED */ +uint32_t v60_device::opCLR1() /* TRUSTED */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); @@ -496,48 +496,48 @@ UINT32 v60_device::opCLR1() /* TRUSTED */ F12END(); } -UINT32 v60_device::opCMPB() /* TRUSTED (C too!) */ +uint32_t v60_device::opCMPB() /* TRUSTED (C too!) */ { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAM, 0); - appb = (UINT8)m_op2; - SUBB(appb, (UINT8)m_op1); + appb = (uint8_t)m_op2; + SUBB(appb, (uint8_t)m_op1); F12END(); } -UINT32 v60_device::opCMPH() /* TRUSTED (C too!) */ +uint32_t v60_device::opCMPH() /* TRUSTED (C too!) */ { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAM, 1); - apph = (UINT16)m_op2; - SUBW(apph, (UINT16)m_op1); + apph = (uint16_t)m_op2; + SUBW(apph, (uint16_t)m_op1); F12END(); } -UINT32 v60_device::opCMPW() /* TRUSTED (C too!)*/ +uint32_t v60_device::opCMPW() /* TRUSTED (C too!)*/ { F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAM, 2); - SUBL(m_op2, (UINT32)m_op1); + SUBL(m_op2, (uint32_t)m_op1); F12END(); } -UINT32 v60_device::opDIVB() /* TRUSTED */ +uint32_t v60_device::opDIVB() /* TRUSTED */ { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); _OV = ((appb == 0x80) && (m_op1 == 0xFF)); if (m_op1 && !_OV) - appb= (INT8)appb / (INT8)m_op1; + appb= (int8_t)appb / (int8_t)m_op1; _Z = (appb == 0); _S = ((appb & 0x80) != 0); @@ -545,16 +545,16 @@ UINT32 v60_device::opDIVB() /* TRUSTED */ F12END(); } -UINT32 v60_device::opDIVH() /* TRUSTED */ +uint32_t v60_device::opDIVH() /* TRUSTED */ { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); _OV = ((apph == 0x8000) && (m_op1 == 0xFFFF)); if (m_op1 && !_OV) - apph = (INT16)apph / (INT16)m_op1; + apph = (int16_t)apph / (int16_t)m_op1; _Z = (apph == 0); _S = ((apph & 0x8000) != 0); @@ -562,16 +562,16 @@ UINT32 v60_device::opDIVH() /* TRUSTED */ F12END(); } -UINT32 v60_device::opDIVW() /* TRUSTED */ +uint32_t v60_device::opDIVW() /* TRUSTED */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); _OV = ((appw == 0x80000000) && (m_op1 == 0xFFFFFFFF)); if (m_op1 && !_OV) - appw = (INT32)appw / (INT32)m_op1; + appw = (int32_t)appw / (int32_t)m_op1; _Z = (appw == 0); _S = ((appw & 0x80000000) != 0); @@ -579,10 +579,10 @@ UINT32 v60_device::opDIVW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opDIVX() +uint32_t v60_device::opDIVX() { - UINT32 a, b; - INT64 dv; + uint32_t a, b; + int64_t dv; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 3); @@ -597,10 +597,10 @@ UINT32 v60_device::opDIVX() b = m_program->read_dword_unaligned(m_op2 + 4); } - dv = ((UINT64)b << 32) | ((UINT64)a); + dv = ((uint64_t)b << 32) | ((uint64_t)a); - a = dv / (INT64)((INT32)m_op1); - b = dv % (INT64)((INT32)m_op1); + a = dv / (int64_t)((int32_t)m_op1); + b = dv % (int64_t)((int32_t)m_op1); _S = ((a & 0x80000000) != 0); _Z = (a == 0); @@ -619,10 +619,10 @@ UINT32 v60_device::opDIVX() F12END(); } -UINT32 v60_device::opDIVUX() +uint32_t v60_device::opDIVUX() { - UINT32 a, b; - UINT64 dv; + uint32_t a, b; + uint64_t dv; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 3); @@ -637,9 +637,9 @@ UINT32 v60_device::opDIVUX() b = m_program->read_dword_unaligned(m_op2 + 4); } - dv = (UINT64)(((UINT64)b << 32) | (UINT64)a); - a = (UINT32)(dv / (UINT64)m_op1); - b = (UINT32)(dv % (UINT64)m_op1); + dv = (uint64_t)(((uint64_t)b << 32) | (uint64_t)a); + a = (uint32_t)(dv / (uint64_t)m_op1); + b = (uint32_t)(dv % (uint64_t)m_op1); _S = ((a & 0x80000000) != 0); _Z = (a == 0); @@ -659,15 +659,15 @@ UINT32 v60_device::opDIVUX() } -UINT32 v60_device::opDIVUB() /* TRUSTED */ +uint32_t v60_device::opDIVUB() /* TRUSTED */ { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); _OV = 0; - if (m_op1) appb /= (UINT8)m_op1; + if (m_op1) appb /= (uint8_t)m_op1; _Z = (appb == 0); _S = ((appb & 0x80) != 0); @@ -675,15 +675,15 @@ UINT32 v60_device::opDIVUB() /* TRUSTED */ F12END(); } -UINT32 v60_device::opDIVUH() /* TRUSTED */ +uint32_t v60_device::opDIVUH() /* TRUSTED */ { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); _OV = 0; - if (m_op1) apph /= (UINT16)m_op1; + if (m_op1) apph /= (uint16_t)m_op1; _Z = (apph == 0); _S = ((apph & 0x8000) != 0); @@ -691,9 +691,9 @@ UINT32 v60_device::opDIVUH() /* TRUSTED */ F12END(); } -UINT32 v60_device::opDIVUW() /* TRUSTED */ +uint32_t v60_device::opDIVUW() /* TRUSTED */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); @@ -707,7 +707,7 @@ UINT32 v60_device::opDIVUW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opINB() +uint32_t v60_device::opINB() { F12DecodeFirstOperand(&v60_device::ReadAMAddress, 0); m_modwritevalb = m_io->read_byte(m_op1); @@ -722,7 +722,7 @@ UINT32 v60_device::opINB() F12END(); } -UINT32 v60_device::opINH() +uint32_t v60_device::opINH() { F12DecodeFirstOperand(&v60_device::ReadAMAddress, 1); m_modwritevalh = m_io->read_word_unaligned(m_op1); @@ -737,7 +737,7 @@ UINT32 v60_device::opINH() F12END(); } -UINT32 v60_device::opINW() +uint32_t v60_device::opINW() { F12DecodeFirstOperand(&v60_device::ReadAMAddress, 2); m_modwritevalw = m_io->read_dword_unaligned(m_op1); @@ -752,7 +752,7 @@ UINT32 v60_device::opINW() F12END(); } -UINT32 v60_device::opLDPR() +uint32_t v60_device::opLDPR() { F12DecodeOperands(&v60_device::ReadAMAddress, 2,&v60_device::ReadAM, 2); if (m_op2 <= 28) @@ -769,7 +769,7 @@ UINT32 v60_device::opLDPR() F12END(); } -UINT32 v60_device::opLDTASK() +uint32_t v60_device::opLDTASK() { int i; F12DecodeOperands(&v60_device::ReadAMAddress, 2,&v60_device::ReadAM, 2); @@ -811,9 +811,9 @@ UINT32 v60_device::opLDTASK() F12END(); } -UINT32 v60_device::opMOVD() /* TRUSTED */ +uint32_t v60_device::opMOVD() /* TRUSTED */ { - UINT32 a, b; + uint32_t a, b; F12DecodeOperands(&v60_device::ReadAMAddress, 3,&v60_device::ReadAMAddress, 3); @@ -842,23 +842,23 @@ UINT32 v60_device::opMOVD() /* TRUSTED */ F12END(); } -UINT32 v60_device::opMOVB() /* TRUSTED */ +uint32_t v60_device::opMOVB() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 0); - m_modwritevalb = (UINT8)m_op1; + m_modwritevalb = (uint8_t)m_op1; F12WriteSecondOperand(0); F12END(); } -UINT32 v60_device::opMOVH() /* TRUSTED */ +uint32_t v60_device::opMOVH() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 1); - m_modwritevalh = (UINT16)m_op1; + m_modwritevalh = (uint16_t)m_op1; F12WriteSecondOperand(1); F12END(); } -UINT32 v60_device::opMOVW() /* TRUSTED */ +uint32_t v60_device::opMOVW() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 2); m_modwritevalw = m_op1; @@ -866,7 +866,7 @@ UINT32 v60_device::opMOVW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opMOVEAB() /* TRUSTED */ +uint32_t v60_device::opMOVEAB() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAMAddress, 0); m_modwritevalw = m_op1; @@ -874,7 +874,7 @@ UINT32 v60_device::opMOVEAB() /* TRUSTED */ F12END(); } -UINT32 v60_device::opMOVEAH() /* TRUSTED */ +uint32_t v60_device::opMOVEAH() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAMAddress, 1); m_modwritevalw = m_op1; @@ -882,7 +882,7 @@ UINT32 v60_device::opMOVEAH() /* TRUSTED */ F12END(); } -UINT32 v60_device::opMOVEAW() /* TRUSTED */ +uint32_t v60_device::opMOVEAW() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAMAddress, 2); m_modwritevalw = m_op1; @@ -890,34 +890,34 @@ UINT32 v60_device::opMOVEAW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opMOVSBH() /* TRUSTED */ +uint32_t v60_device::opMOVSBH() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 0); - m_modwritevalh = (INT8)(m_op1 & 0xFF); + m_modwritevalh = (int8_t)(m_op1 & 0xFF); F12WriteSecondOperand(1); F12END(); } -UINT32 v60_device::opMOVSBW() /* TRUSTED */ +uint32_t v60_device::opMOVSBW() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 0); - m_modwritevalw = (INT8)(m_op1 & 0xFF); + m_modwritevalw = (int8_t)(m_op1 & 0xFF); F12WriteSecondOperand(2); F12END(); } -UINT32 v60_device::opMOVSHW() /* TRUSTED */ +uint32_t v60_device::opMOVSHW() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 1); - m_modwritevalw = (INT16)(m_op1 & 0xFFFF); + m_modwritevalw = (int16_t)(m_op1 & 0xFFFF); F12WriteSecondOperand(2); F12END(); } -UINT32 v60_device::opMOVTHB() +uint32_t v60_device::opMOVTHB() { F12DecodeFirstOperand(&v60_device::ReadAM, 1); - m_modwritevalb = (UINT8)(m_op1 & 0xFF); + m_modwritevalb = (uint8_t)(m_op1 & 0xFF); // Check for overflow: the truncated bits must match the sign // of the result, otherwise overflow @@ -931,10 +931,10 @@ UINT32 v60_device::opMOVTHB() F12END(); } -UINT32 v60_device::opMOVTWB() +uint32_t v60_device::opMOVTWB() { F12DecodeFirstOperand(&v60_device::ReadAM, 2); - m_modwritevalb = (UINT8)(m_op1 & 0xFF); + m_modwritevalb = (uint8_t)(m_op1 & 0xFF); // Check for overflow: the truncated bits must match the sign // of the result, otherwise overflow @@ -948,10 +948,10 @@ UINT32 v60_device::opMOVTWB() F12END(); } -UINT32 v60_device::opMOVTWH() +uint32_t v60_device::opMOVTWH() { F12DecodeFirstOperand(&v60_device::ReadAM, 2); - m_modwritevalh = (UINT16)(m_op1 & 0xFFFF); + m_modwritevalh = (uint16_t)(m_op1 & 0xFFFF); // Check for overflow: the truncated bits must match the sign // of the result, otherwise overflow @@ -966,15 +966,15 @@ UINT32 v60_device::opMOVTWH() } -UINT32 v60_device::opMOVZBH() /* TRUSTED */ +uint32_t v60_device::opMOVZBH() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 0); - m_modwritevalh = (UINT16)m_op1; + m_modwritevalh = (uint16_t)m_op1; F12WriteSecondOperand(1); F12END(); } -UINT32 v60_device::opMOVZBW() /* TRUSTED */ +uint32_t v60_device::opMOVZBW() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 0); m_modwritevalw = m_op1; @@ -982,7 +982,7 @@ UINT32 v60_device::opMOVZBW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opMOVZHW() /* TRUSTED */ +uint32_t v60_device::opMOVZHW() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 1); m_modwritevalw = m_op1; @@ -990,16 +990,16 @@ UINT32 v60_device::opMOVZHW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opMULB() +uint32_t v60_device::opMULB() { - UINT8 appb; - UINT32 tmp; + uint8_t appb; + uint32_t tmp; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); // @@@ OV not set!! - tmp = (INT8)appb * (INT32)(INT8)m_op1; + tmp = (int8_t)appb * (int32_t)(int8_t)m_op1; appb = tmp; _Z = (appb == 0); _S = ((appb & 0x80) != 0); @@ -1009,16 +1009,16 @@ UINT32 v60_device::opMULB() F12END(); } -UINT32 v60_device::opMULH() +uint32_t v60_device::opMULH() { - UINT16 apph; - UINT32 tmp; + uint16_t apph; + uint32_t tmp; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); // @@@ OV not set!! - tmp = (INT16)apph * (INT32)(INT16)m_op1; + tmp = (int16_t)apph * (int32_t)(int16_t)m_op1; apph = tmp; _Z = (apph == 0); _S = ((apph & 0x8000) != 0); @@ -1028,16 +1028,16 @@ UINT32 v60_device::opMULH() F12END(); } -UINT32 v60_device::opMULW() +uint32_t v60_device::opMULW() { - UINT32 appw; - UINT64 tmp; + uint32_t appw; + uint64_t tmp; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); // @@@ OV not set!! - tmp = (INT32)appw * (INT64)(INT32)m_op1; + tmp = (int32_t)appw * (int64_t)(int32_t)m_op1; appw = tmp; _Z = (appw == 0); _S = ((appw & 0x80000000) != 0); @@ -1047,16 +1047,16 @@ UINT32 v60_device::opMULW() F12END(); } -UINT32 v60_device::opMULUB() +uint32_t v60_device::opMULUB() { - UINT8 appb; - UINT32 tmp; + uint8_t appb; + uint32_t tmp; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); // @@@ OV not set!! - tmp = appb * (UINT8)m_op1; + tmp = appb * (uint8_t)m_op1; appb = tmp; _Z = (appb == 0); _S = ((appb & 0x80) != 0); @@ -1066,16 +1066,16 @@ UINT32 v60_device::opMULUB() F12END(); } -UINT32 v60_device::opMULUH() +uint32_t v60_device::opMULUH() { - UINT16 apph; - UINT32 tmp; + uint16_t apph; + uint32_t tmp; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); // @@@ OV not set!! - tmp = apph * (UINT16)m_op1; + tmp = apph * (uint16_t)m_op1; apph = tmp; _Z = (apph == 0); _S = ((apph & 0x8000) != 0); @@ -1085,16 +1085,16 @@ UINT32 v60_device::opMULUH() F12END(); } -UINT32 v60_device::opMULUW() +uint32_t v60_device::opMULUW() { - UINT32 appw; - UINT64 tmp; + uint32_t appw; + uint64_t tmp; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); // @@@ OV not set!! - tmp = (UINT64)appw * (UINT64)m_op1; + tmp = (uint64_t)appw * (uint64_t)m_op1; appw = tmp; _Z = (appw == 0); _S = ((appw & 0x80000000) != 0); @@ -1104,40 +1104,40 @@ UINT32 v60_device::opMULUW() F12END(); } -UINT32 v60_device::opNEGB() /* TRUSTED (C too!)*/ +uint32_t v60_device::opNEGB() /* TRUSTED (C too!)*/ { F12DecodeFirstOperand(&v60_device::ReadAM, 0); m_modwritevalb = 0; - SUBB(m_modwritevalb, (INT8)m_op1); + SUBB(m_modwritevalb, (int8_t)m_op1); F12WriteSecondOperand(0); F12END(); } -UINT32 v60_device::opNEGH() /* TRUSTED (C too!)*/ +uint32_t v60_device::opNEGH() /* TRUSTED (C too!)*/ { F12DecodeFirstOperand(&v60_device::ReadAM, 1); m_modwritevalh = 0; - SUBW(m_modwritevalh, (INT16)m_op1); + SUBW(m_modwritevalh, (int16_t)m_op1); F12WriteSecondOperand(1); F12END(); } -UINT32 v60_device::opNEGW() /* TRUSTED (C too!)*/ +uint32_t v60_device::opNEGW() /* TRUSTED (C too!)*/ { F12DecodeFirstOperand(&v60_device::ReadAM, 2); m_modwritevalw = 0; - SUBL(m_modwritevalw, (INT32)m_op1); + SUBL(m_modwritevalw, (int32_t)m_op1); F12WriteSecondOperand(2); F12END(); } -UINT32 v60_device::opNOTB() /* TRUSTED */ +uint32_t v60_device::opNOTB() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 0); m_modwritevalb=~m_op1; @@ -1150,7 +1150,7 @@ UINT32 v60_device::opNOTB() /* TRUSTED */ F12END(); } -UINT32 v60_device::opNOTH() /* TRUSTED */ +uint32_t v60_device::opNOTH() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 1); m_modwritevalh=~m_op1; @@ -1163,7 +1163,7 @@ UINT32 v60_device::opNOTH() /* TRUSTED */ F12END(); } -UINT32 v60_device::opNOTW() /* TRUSTED */ +uint32_t v60_device::opNOTW() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 2); m_modwritevalw=~m_op1; @@ -1176,9 +1176,9 @@ UINT32 v60_device::opNOTW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opNOT1() /* TRUSTED */ +uint32_t v60_device::opNOT1() /* TRUSTED */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); @@ -1195,76 +1195,76 @@ UINT32 v60_device::opNOT1() /* TRUSTED */ F12END(); } -UINT32 v60_device::opORB() /* TRUSTED (C too!)*/ +uint32_t v60_device::opORB() /* TRUSTED (C too!)*/ { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); - ORB(appb, (UINT8)m_op1); + ORB(appb, (uint8_t)m_op1); F12STOREOP2BYTE(); F12END(); } -UINT32 v60_device::opORH() /* TRUSTED (C too!)*/ +uint32_t v60_device::opORH() /* TRUSTED (C too!)*/ { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); - ORW(apph, (UINT16)m_op1); + ORW(apph, (uint16_t)m_op1); F12STOREOP2HALF(); F12END(); } -UINT32 v60_device::opORW() /* TRUSTED (C too!) */ +uint32_t v60_device::opORW() /* TRUSTED (C too!) */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); - ORL(appw, (UINT32)m_op1); + ORL(appw, (uint32_t)m_op1); F12STOREOP2WORD(); F12END(); } -UINT32 v60_device::opOUTB() +uint32_t v60_device::opOUTB() { F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 2); - m_io->write_byte(m_op2,(UINT8)m_op1); + m_io->write_byte(m_op2,(uint8_t)m_op1); F12END(); } -UINT32 v60_device::opOUTH() +uint32_t v60_device::opOUTH() { F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 2); - m_io->write_word_unaligned(m_op2,(UINT16)m_op1); + m_io->write_word_unaligned(m_op2,(uint16_t)m_op1); F12END(); } -UINT32 v60_device::opOUTW() +uint32_t v60_device::opOUTW() { F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); m_io->write_dword_unaligned(m_op2, m_op1); F12END(); } -UINT32 v60_device::opREMB() +uint32_t v60_device::opREMB() { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); _OV = 0; if (m_op1) - appb= (INT8)appb % (INT8)m_op1; + appb= (int8_t)appb % (int8_t)m_op1; _Z = (appb == 0); _S = ((appb & 0x80) != 0); @@ -1272,16 +1272,16 @@ UINT32 v60_device::opREMB() F12END(); } -UINT32 v60_device::opREMH() +uint32_t v60_device::opREMH() { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); _OV = 0; if (m_op1) - apph = (INT16)apph % (INT16)m_op1; + apph = (int16_t)apph % (int16_t)m_op1; _Z = (apph == 0); _S = ((apph & 0x8000) != 0); @@ -1289,16 +1289,16 @@ UINT32 v60_device::opREMH() F12END(); } -UINT32 v60_device::opREMW() +uint32_t v60_device::opREMW() { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); _OV = 0; if (m_op1) - appw = (INT32)appw % (INT32)m_op1; + appw = (int32_t)appw % (int32_t)m_op1; _Z = (appw == 0); _S = ((appw & 0x80000000) != 0); @@ -1306,16 +1306,16 @@ UINT32 v60_device::opREMW() F12END(); } -UINT32 v60_device::opREMUB() +uint32_t v60_device::opREMUB() { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); _OV = 0; if (m_op1) - appb %= (UINT8)m_op1; + appb %= (uint8_t)m_op1; _Z = (appb == 0); _S = ((appb & 0x80) != 0); @@ -1323,16 +1323,16 @@ UINT32 v60_device::opREMUB() F12END(); } -UINT32 v60_device::opREMUH() +uint32_t v60_device::opREMUH() { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); _OV = 0; if (m_op1) - apph %= (UINT16)m_op1; + apph %= (uint16_t)m_op1; _Z = (apph == 0); _S = ((apph & 0x8000) != 0); @@ -1340,9 +1340,9 @@ UINT32 v60_device::opREMUH() F12END(); } -UINT32 v60_device::opREMUW() +uint32_t v60_device::opREMUW() { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); @@ -1357,16 +1357,16 @@ UINT32 v60_device::opREMUW() F12END(); } -UINT32 v60_device::opROTB() /* TRUSTED */ +uint32_t v60_device::opROTB() /* TRUSTED */ { - UINT8 appb; - INT8 i, count; + uint8_t appb; + int8_t i, count; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); if (count > 0) { for (i = 0;i < count;i++) @@ -1393,16 +1393,16 @@ UINT32 v60_device::opROTB() /* TRUSTED */ F12END(); } -UINT32 v60_device::opROTH() /* TRUSTED */ +uint32_t v60_device::opROTH() /* TRUSTED */ { - UINT16 apph; - INT8 i, count; + uint16_t apph; + int8_t i, count; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); if (count > 0) { for (i = 0;i < count;i++) @@ -1429,16 +1429,16 @@ UINT32 v60_device::opROTH() /* TRUSTED */ F12END(); } -UINT32 v60_device::opROTW() /* TRUSTED */ +uint32_t v60_device::opROTW() /* TRUSTED */ { - UINT32 appw; - INT8 i, count; + uint32_t appw; + int8_t i, count; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); if (count > 0) { for (i = 0;i < count;i++) @@ -1465,23 +1465,23 @@ UINT32 v60_device::opROTW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opROTCB() /* TRUSTED */ +uint32_t v60_device::opROTCB() /* TRUSTED */ { - UINT8 appb; - INT8 i, cy, count; + uint8_t appb; + int8_t i, cy, count; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); NORMALIZEFLAGS(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); if (count > 0) { for (i = 0;i < count;i++) { cy = _CY; - _CY = (UINT8)((appb & 0x80) >> 7); + _CY = (uint8_t)((appb & 0x80) >> 7); appb = (appb << 1) | cy; } } @@ -1506,23 +1506,23 @@ UINT32 v60_device::opROTCB() /* TRUSTED */ F12END(); } -UINT32 v60_device::opROTCH() /* TRUSTED */ +uint32_t v60_device::opROTCH() /* TRUSTED */ { - UINT16 apph; - INT8 i, cy, count; + uint16_t apph; + int8_t i, cy, count; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); NORMALIZEFLAGS(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); if (count > 0) { for (i = 0;i < count;i++) { cy = _CY; - _CY = (UINT8)((apph & 0x8000) >> 15); + _CY = (uint8_t)((apph & 0x8000) >> 15); apph = (apph << 1) | cy; } } @@ -1532,8 +1532,8 @@ UINT32 v60_device::opROTCH() /* TRUSTED */ for (i = 0;i < count;i++) { cy = _CY; - _CY = (UINT8)(apph & 1); - apph = (apph >> 1) | ((UINT16)cy << 15); + _CY = (uint8_t)(apph & 1); + apph = (apph >> 1) | ((uint16_t)cy << 15); } } else @@ -1547,23 +1547,23 @@ UINT32 v60_device::opROTCH() /* TRUSTED */ F12END(); } -UINT32 v60_device::opROTCW() /* TRUSTED */ +uint32_t v60_device::opROTCW() /* TRUSTED */ { - UINT32 appw; - INT8 i, cy, count; + uint32_t appw; + int8_t i, cy, count; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); NORMALIZEFLAGS(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); if (count > 0) { for (i = 0;i < count;i++) { cy = _CY; - _CY = (UINT8)((appw & 0x80000000) >> 31); + _CY = (uint8_t)((appw & 0x80000000) >> 31); appw = (appw << 1) | cy; } } @@ -1573,8 +1573,8 @@ UINT32 v60_device::opROTCW() /* TRUSTED */ for (i = 0;i < count;i++) { cy = _CY; - _CY = (UINT8)(appw & 1); - appw = (appw >> 1) | ((UINT32)cy << 31); + _CY = (uint8_t)(appw & 1); + appw = (appw >> 1) | ((uint32_t)cy << 31); } } else @@ -1588,11 +1588,11 @@ UINT32 v60_device::opROTCW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opRVBIT() +uint32_t v60_device::opRVBIT() { F12DecodeFirstOperand(&v60_device::ReadAM, 0); - m_modwritevalb =(UINT8) + m_modwritevalb =(uint8_t) (((m_op1 & (1 << 0)) << 7) | ((m_op1 & (1 << 1)) << 5) | ((m_op1 & (1 << 2)) << 3) | @@ -1606,7 +1606,7 @@ UINT32 v60_device::opRVBIT() F12END(); } -UINT32 v60_device::opRVBYT() /* TRUSTED */ +uint32_t v60_device::opRVBYT() /* TRUSTED */ { F12DecodeFirstOperand(&v60_device::ReadAM, 2); @@ -1619,9 +1619,9 @@ UINT32 v60_device::opRVBYT() /* TRUSTED */ F12END(); } -UINT32 v60_device::opSET1() /* TRUSTED */ +uint32_t v60_device::opSET1() /* TRUSTED */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); @@ -1636,7 +1636,7 @@ UINT32 v60_device::opSET1() /* TRUSTED */ } -UINT32 v60_device::opSETF() +uint32_t v60_device::opSETF() { F12DecodeFirstOperand(&v60_device::ReadAM, 0); @@ -1717,7 +1717,7 @@ UINT32 v60_device::opSETF() /* #define SHIFTLEFT_OY(val, count, bitsize) \ {\ - UINT32 tmp = ((val) >> (bitsize - 1)) & 1; \ + uint32_t tmp = ((val) >> (bitsize - 1)) & 1; \ tmp <<= count; \ tmp -= 1; \ tmp <<= (bitsize - (count)); \ @@ -1729,7 +1729,7 @@ UINT32 v60_device::opSETF() // During the shift, the overflow is set if the sign bit changes at any point during the shift #define SHIFTLEFT_OV(val, count, bitsize) \ {\ - UINT32 tmp; \ + uint32_t tmp; \ if (count == 32) \ tmp = 0xFFFFFFFF; \ else \ @@ -1742,7 +1742,7 @@ UINT32 v60_device::opSETF() } #define SHIFTLEFT_CY(val, count, bitsize) \ - _CY = (UINT8)(((val) >> (bitsize - count)) & 1); + _CY = (uint8_t)(((val) >> (bitsize - count)) & 1); @@ -1750,20 +1750,20 @@ UINT32 v60_device::opSETF() _OV = 0; #define SHIFTARITHMETICRIGHT_CY(val, count, bitsize) \ - _CY = (UINT8)(((val) >> (count - 1)) & 1); + _CY = (uint8_t)(((val) >> (count - 1)) & 1); -UINT32 v60_device::opSHAB() +uint32_t v60_device::opSHAB() { - UINT8 appb; - INT8 count; + uint8_t appb; + int8_t count; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); // Special case: destination unchanged, flags set if (count == 0) @@ -1797,7 +1797,7 @@ UINT32 v60_device::opSHAB() if (count >= 8) appb = (appb & 0x80) ? 0xFF : 0; else - appb = ((INT8)appb) >> count; + appb = ((int8_t)appb) >> count; SetSZPF_Byte(appb); } @@ -1808,16 +1808,16 @@ UINT32 v60_device::opSHAB() F12END(); } -UINT32 v60_device::opSHAH() +uint32_t v60_device::opSHAH() { - UINT16 apph; - INT8 count; + uint16_t apph; + int8_t count; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); // Special case: destination unchanged, flags set if (count == 0) @@ -1851,7 +1851,7 @@ UINT32 v60_device::opSHAH() if (count >= 16) apph = (apph & 0x8000) ? 0xFFFF : 0; else - apph = ((INT16)apph) >> count; + apph = ((int16_t)apph) >> count; SetSZPF_Word(apph); } @@ -1862,16 +1862,16 @@ UINT32 v60_device::opSHAH() F12END(); } -UINT32 v60_device::opSHAW() +uint32_t v60_device::opSHAW() { - UINT32 appw; - INT8 count; + uint32_t appw; + int8_t count; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); // Special case: destination unchanged, flags set if (count == 0) @@ -1905,7 +1905,7 @@ UINT32 v60_device::opSHAW() if (count >= 32) appw = (appw & 0x80000000) ? 0xFFFFFFFF : 0; else - appw = ((INT32)appw) >> count; + appw = ((int32_t)appw) >> count; SetSZPF_Long(appw); } @@ -1917,17 +1917,17 @@ UINT32 v60_device::opSHAW() } -UINT32 v60_device::opSHLB() /* TRUSTED */ +uint32_t v60_device::opSHLB() /* TRUSTED */ { - UINT8 appb; - INT8 count; - UINT32 tmp; + uint8_t appb; + int8_t count; + uint32_t tmp; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); if (count > 0) { // left shift flags: @@ -1962,7 +1962,7 @@ UINT32 v60_device::opSHLB() /* TRUSTED */ // overflow always cleared tmp = appb & 0xff; tmp >>= ((-count) - 1); - _CY = (UINT8)(tmp & 0x1); + _CY = (uint8_t)(tmp & 0x1); _OV = 0; appb >>= -count; @@ -1976,17 +1976,17 @@ UINT32 v60_device::opSHLB() /* TRUSTED */ F12END(); } -UINT32 v60_device::opSHLH() /* TRUSTED */ +uint32_t v60_device::opSHLH() /* TRUSTED */ { - UINT16 apph; - INT8 count; - UINT32 tmp; + uint16_t apph; + int8_t count; + uint32_t tmp; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); // osd_printf_debug("apph: %x count: %d ", apph, count); if (count > 0) { @@ -2022,7 +2022,7 @@ UINT32 v60_device::opSHLH() /* TRUSTED */ // overflow always cleared tmp = apph & 0xffff; tmp >>= ((-count) - 1); - _CY = (UINT8)(tmp & 0x1); + _CY = (uint8_t)(tmp & 0x1); _OV = 0; apph >>= -count; @@ -2036,17 +2036,17 @@ UINT32 v60_device::opSHLH() /* TRUSTED */ F12END(); } -UINT32 v60_device::opSHLW() /* TRUSTED */ +uint32_t v60_device::opSHLW() /* TRUSTED */ { - UINT32 appw; - INT8 count; - UINT64 tmp; + uint32_t appw; + int8_t count; + uint64_t tmp; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); - count = (INT8)(m_op1 & 0xFF); + count = (int8_t)(m_op1 & 0xFF); if (count > 0) { // left shift flags: @@ -2079,9 +2079,9 @@ UINT32 v60_device::opSHLW() /* TRUSTED */ // right shift flags: // carry = last bit shifted out // overflow always cleared - tmp = (UINT64)(appw & 0xffffffff); + tmp = (uint64_t)(appw & 0xffffffff); tmp >>= ((-count) - 1); - _CY = (UINT8)(tmp & 0x1); + _CY = (uint8_t)(tmp & 0x1); _OV = 0; appw >>= -count; @@ -2095,7 +2095,7 @@ UINT32 v60_device::opSHLW() /* TRUSTED */ F12END(); } -UINT32 v60_device::opSTPR() +uint32_t v60_device::opSTPR() { F12DecodeFirstOperand(&v60_device::ReadAM, 2); if (m_op1 <= 28) @@ -2109,94 +2109,94 @@ UINT32 v60_device::opSTPR() } -UINT32 v60_device::opSUBB() /* TRUSTED (C too!) */ +uint32_t v60_device::opSUBB() /* TRUSTED (C too!) */ { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); - SUBB(appb, (UINT8)m_op1); + SUBB(appb, (uint8_t)m_op1); F12STOREOP2BYTE(); F12END(); } -UINT32 v60_device::opSUBH() /* TRUSTED (C too!) */ +uint32_t v60_device::opSUBH() /* TRUSTED (C too!) */ { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); - SUBW(apph, (UINT16)m_op1); + SUBW(apph, (uint16_t)m_op1); F12STOREOP2HALF(); F12END(); } -UINT32 v60_device::opSUBW() /* TRUSTED (C too!) */ +uint32_t v60_device::opSUBW() /* TRUSTED (C too!) */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); - SUBL(appw, (UINT32)m_op1); + SUBL(appw, (uint32_t)m_op1); F12STOREOP2WORD(); F12END(); } -UINT32 v60_device::opSUBCB() +uint32_t v60_device::opSUBCB() { - UINT8 appb; - UINT8 src; + uint8_t appb; + uint8_t src; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); - src = (UINT8)m_op1 + (_CY?1:0); + src = (uint8_t)m_op1 + (_CY?1:0); SUBB(appb, src); F12STOREOP2BYTE(); F12END(); } -UINT32 v60_device::opSUBCH() +uint32_t v60_device::opSUBCH() { - UINT16 apph; - UINT16 src; + uint16_t apph; + uint16_t src; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); - src = (UINT16)m_op1 + (_CY?1:0); + src = (uint16_t)m_op1 + (_CY?1:0); SUBW(apph, src); F12STOREOP2HALF(); F12END(); } -UINT32 v60_device::opSUBCW() +uint32_t v60_device::opSUBCW() { - UINT32 appw; - UINT32 src; + uint32_t appw; + uint32_t src; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); - src = (UINT32)m_op1 + (_CY?1:0); + src = (uint32_t)m_op1 + (_CY?1:0); SUBL(appw, src); F12STOREOP2WORD(); F12END(); } -UINT32 v60_device::opTEST1() +uint32_t v60_device::opTEST1() { F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAM, 2); @@ -2206,7 +2206,7 @@ UINT32 v60_device::opTEST1() F12END(); } -UINT32 v60_device::opUPDPSWW() +uint32_t v60_device::opUPDPSWW() { F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAM, 2); @@ -2218,7 +2218,7 @@ UINT32 v60_device::opUPDPSWW() F12END(); } -UINT32 v60_device::opUPDPSWH() +uint32_t v60_device::opUPDPSWH() { F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAM, 2); @@ -2230,9 +2230,9 @@ UINT32 v60_device::opUPDPSWH() F12END(); } -UINT32 v60_device::opXCHB() /* TRUSTED */ +uint32_t v60_device::opXCHB() /* TRUSTED */ { - UINT8 appb, temp; + uint8_t appb, temp; F12DecodeOperands(&v60_device::ReadAMAddress, 0,&v60_device::ReadAMAddress, 0); @@ -2246,9 +2246,9 @@ UINT32 v60_device::opXCHB() /* TRUSTED */ F12END() } -UINT32 v60_device::opXCHH() /* TRUSTED */ +uint32_t v60_device::opXCHH() /* TRUSTED */ { - UINT16 apph, temp; + uint16_t apph, temp; F12DecodeOperands(&v60_device::ReadAMAddress, 1,&v60_device::ReadAMAddress, 1); @@ -2262,9 +2262,9 @@ UINT32 v60_device::opXCHH() /* TRUSTED */ F12END() } -UINT32 v60_device::opXCHW() /* TRUSTED */ +uint32_t v60_device::opXCHW() /* TRUSTED */ { - UINT32 appw, temp; + uint32_t appw, temp; F12DecodeOperands(&v60_device::ReadAMAddress, 2,&v60_device::ReadAMAddress, 2); @@ -2278,49 +2278,49 @@ UINT32 v60_device::opXCHW() /* TRUSTED */ F12END() } -UINT32 v60_device::opXORB() /* TRUSTED (C too!) */ +uint32_t v60_device::opXORB() /* TRUSTED (C too!) */ { - UINT8 appb; + uint8_t appb; F12DecodeOperands(&v60_device::ReadAM, 0,&v60_device::ReadAMAddress, 0); F12LOADOP2BYTE(); - XORB(appb, (UINT8)m_op1); + XORB(appb, (uint8_t)m_op1); F12STOREOP2BYTE(); F12END(); } -UINT32 v60_device::opXORH() /* TRUSTED (C too!) */ +uint32_t v60_device::opXORH() /* TRUSTED (C too!) */ { - UINT16 apph; + uint16_t apph; F12DecodeOperands(&v60_device::ReadAM, 1,&v60_device::ReadAMAddress, 1); F12LOADOP2HALF(); - XORW(apph, (UINT16)m_op1); + XORW(apph, (uint16_t)m_op1); F12STOREOP2HALF(); F12END(); } -UINT32 v60_device::opXORW() /* TRUSTED (C too!) */ +uint32_t v60_device::opXORW() /* TRUSTED (C too!) */ { - UINT32 appw; + uint32_t appw; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 2); F12LOADOP2WORD(); - XORL(appw, (UINT32)m_op1); + XORL(appw, (uint32_t)m_op1); F12STOREOP2WORD(); F12END(); } -UINT32 v60_device::opMULX() +uint32_t v60_device::opMULX() { - INT32 a, b; - INT64 res; + int32_t a, b; + int64_t res; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 3); @@ -2333,10 +2333,10 @@ UINT32 v60_device::opMULX() a = m_program->read_dword_unaligned(m_op2); } - res = (INT64)a * (INT64)(INT32)m_op1; + res = (int64_t)a * (int64_t)(int32_t)m_op1; - b = (INT32)((res >> 32)&0xffffffff); - a = (INT32)(res & 0xffffffff); + b = (int32_t)((res >> 32)&0xffffffff); + a = (int32_t)(res & 0xffffffff); _S = ((b & 0x80000000) != 0); _Z = (a == 0 && b == 0); @@ -2355,10 +2355,10 @@ UINT32 v60_device::opMULX() F12END(); } -UINT32 v60_device::opMULUX() +uint32_t v60_device::opMULUX() { - INT32 a, b; - UINT64 res; + int32_t a, b; + uint64_t res; F12DecodeOperands(&v60_device::ReadAM, 2,&v60_device::ReadAMAddress, 3); @@ -2371,9 +2371,9 @@ UINT32 v60_device::opMULUX() a = m_program->read_dword_unaligned(m_op2); } - res = (UINT64)a * (UINT64)m_op1; - b = (INT32)((res >> 32)&0xffffffff); - a = (INT32)(res & 0xffffffff); + res = (uint64_t)a * (uint64_t)m_op1; + b = (int32_t)((res >> 32)&0xffffffff); + a = (int32_t)(res & 0xffffffff); _S = ((b & 0x80000000) != 0); _Z = (a == 0 && b == 0); diff --git a/src/devices/cpu/v60/op2.hxx b/src/devices/cpu/v60/op2.hxx index 98a8612f345..8d7be235dce 100644 --- a/src/devices/cpu/v60/op2.hxx +++ b/src/devices/cpu/v60/op2.hxx @@ -16,7 +16,7 @@ else \ m_program->write_dword_unaligned(m_op##num, f2u(appf)); -void v60_device::F2DecodeFirstOperand(am_func DecodeOp1, UINT8 dim1) +void v60_device::F2DecodeFirstOperand(am_func DecodeOp1, uint8_t dim1) { m_moddim = dim1; m_modm = m_instflags & 0x40; @@ -26,7 +26,7 @@ void v60_device::F2DecodeFirstOperand(am_func DecodeOp1, UINT8 dim1) m_flag1 = m_amflag; } -void v60_device::F2DecodeSecondOperand(am_func DecodeOp2, UINT8 dim2) +void v60_device::F2DecodeSecondOperand(am_func DecodeOp2, uint8_t dim2) { m_moddim = dim2; m_modm = m_instflags & 0x20; @@ -36,7 +36,7 @@ void v60_device::F2DecodeSecondOperand(am_func DecodeOp2, UINT8 dim2) m_flag2 = m_amflag; } -void v60_device::F2WriteSecondOperand(UINT8 dim2) +void v60_device::F2WriteSecondOperand(uint8_t dim2) { m_moddim = dim2; m_modm = m_instflags & 0x20; @@ -44,14 +44,14 @@ void v60_device::F2WriteSecondOperand(UINT8 dim2) m_amlength2 = WriteAM(); } -UINT32 v60_device::opCVTWS() +uint32_t v60_device::opCVTWS() { float val; F2DecodeFirstOperand(&v60_device::ReadAM, 2); // Convert to float - val = (float)(INT32)m_op1; + val = (float)(int32_t)m_op1; m_modwritevalw = f2u(val); _OV = 0; @@ -63,15 +63,15 @@ UINT32 v60_device::opCVTWS() F2END(); } -UINT32 v60_device::opCVTSW() +uint32_t v60_device::opCVTSW() { float val; F2DecodeFirstOperand(&v60_device::ReadAM, 2); - // Convert to UINT32 + // Convert to uint32_t val = u2f(m_op1); - m_modwritevalw = (UINT32)val; + m_modwritevalw = (uint32_t)val; _OV = 0; _CY =(val < 0.0f); @@ -82,7 +82,7 @@ UINT32 v60_device::opCVTSW() F2END(); } -UINT32 v60_device::opMOVFS() +uint32_t v60_device::opMOVFS() { F2DecodeFirstOperand(&v60_device::ReadAM, 2); m_modwritevalw = m_op1; @@ -90,7 +90,7 @@ UINT32 v60_device::opMOVFS() F2END(); } -UINT32 v60_device::opNEGFS() +uint32_t v60_device::opNEGFS() { float appf; @@ -108,7 +108,7 @@ UINT32 v60_device::opNEGFS() F2END() } -UINT32 v60_device::opABSFS() +uint32_t v60_device::opABSFS() { float appf; @@ -129,9 +129,9 @@ UINT32 v60_device::opABSFS() F2END() } -UINT32 v60_device::opADDFS() +uint32_t v60_device::opADDFS() { - UINT32 appw; + uint32_t appw; float appf; F2DecodeFirstOperand(&v60_device::ReadAM, 2); @@ -150,9 +150,9 @@ UINT32 v60_device::opADDFS() F2END() } -UINT32 v60_device::opSUBFS() +uint32_t v60_device::opSUBFS() { - UINT32 appw; + uint32_t appw; float appf; F2DecodeFirstOperand(&v60_device::ReadAM, 2); @@ -171,9 +171,9 @@ UINT32 v60_device::opSUBFS() F2END() } -UINT32 v60_device::opMULFS() +uint32_t v60_device::opMULFS() { - UINT32 appw; + uint32_t appw; float appf; F2DecodeFirstOperand(&v60_device::ReadAM, 2); @@ -192,9 +192,9 @@ UINT32 v60_device::opMULFS() F2END() } -UINT32 v60_device::opDIVFS() +uint32_t v60_device::opDIVFS() { - UINT32 appw; + uint32_t appw; float appf; F2DecodeFirstOperand(&v60_device::ReadAM, 2); @@ -213,9 +213,9 @@ UINT32 v60_device::opDIVFS() F2END() } -UINT32 v60_device::opSCLFS() +uint32_t v60_device::opSCLFS() { - UINT32 appw; + uint32_t appw; float appf; F2DecodeFirstOperand(&v60_device::ReadAM, 1); @@ -223,8 +223,8 @@ UINT32 v60_device::opSCLFS() F2LOADOPFLOAT(2); - if ((INT16)m_op1 < 0) - appf /= 1 << -(INT16)m_op1; + if ((int16_t)m_op1 < 0) + appf /= 1 << -(int16_t)m_op1; else appf *= 1 << m_op1; @@ -237,7 +237,7 @@ UINT32 v60_device::opSCLFS() F2END() } -UINT32 v60_device::opCMPF() +uint32_t v60_device::opCMPF() { float appf; @@ -254,13 +254,13 @@ UINT32 v60_device::opCMPF() F2END(); } -UINT32 v60_device::op5FUNHANDLED() +uint32_t v60_device::op5FUNHANDLED() { fatalerror("Unhandled 5F opcode at %08x\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::op5CUNHANDLED() +uint32_t v60_device::op5CUNHANDLED() { fatalerror("Unhandled 5C opcode at %08x\n", PC); return 0; /* never reached, fatalerror won't return */ @@ -340,14 +340,14 @@ const v60_device::am_func v60_device::s_Op5CTable[32] = }; -UINT32 v60_device::op5F() +uint32_t v60_device::op5F() { m_instflags = OpRead8(PC + 1); return (this->*s_Op5FTable[m_instflags & 0x1F])(); } -UINT32 v60_device::op5C() +uint32_t v60_device::op5C() { m_instflags = OpRead8(PC + 1); return (this->*s_Op5CTable[m_instflags & 0x1F])(); diff --git a/src/devices/cpu/v60/op3.hxx b/src/devices/cpu/v60/op3.hxx index 0f014d40909..0dac42beaaf 100644 --- a/src/devices/cpu/v60/op3.hxx +++ b/src/devices/cpu/v60/op3.hxx @@ -1,15 +1,15 @@ // license:BSD-3-Clause // copyright-holders:Farfetch'd, R. Belmont -UINT32 v60_device::opINCB() /* TRUSTED */ +uint32_t v60_device::opINCB() /* TRUSTED */ { - UINT8 appb; + uint8_t appb; m_modadd = PC + 1; m_moddim = 0; m_amlength1 = ReadAMAddress(); if (m_amflag) - appb = (UINT8)m_reg[m_amout]; + appb = (uint8_t)m_reg[m_amout]; else appb = m_program->read_byte(m_amout); @@ -23,16 +23,16 @@ UINT32 v60_device::opINCB() /* TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opINCH() /* TRUSTED */ +uint32_t v60_device::opINCH() /* TRUSTED */ { - UINT16 apph; + uint16_t apph; m_modadd = PC + 1; m_moddim = 1; m_amlength1 = ReadAMAddress(); if (m_amflag) - apph = (UINT16)m_reg[m_amout]; + apph = (uint16_t)m_reg[m_amout]; else apph = m_program->read_word_unaligned(m_amout); @@ -46,9 +46,9 @@ UINT32 v60_device::opINCH() /* TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opINCW() /* TRUSTED */ +uint32_t v60_device::opINCW() /* TRUSTED */ { - UINT32 appw; + uint32_t appw; m_modadd = PC + 1; m_moddim = 2; @@ -69,16 +69,16 @@ UINT32 v60_device::opINCW() /* TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opDECB() /* TRUSTED */ +uint32_t v60_device::opDECB() /* TRUSTED */ { - UINT8 appb; + uint8_t appb; m_modadd = PC + 1; m_moddim = 0; m_amlength1 = ReadAMAddress(); if (m_amflag) - appb = (UINT8)m_reg[m_amout]; + appb = (uint8_t)m_reg[m_amout]; else appb = m_program->read_byte(m_amout); @@ -92,16 +92,16 @@ UINT32 v60_device::opDECB() /* TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opDECH() /* TRUSTED */ +uint32_t v60_device::opDECH() /* TRUSTED */ { - UINT16 apph; + uint16_t apph; m_modadd = PC + 1; m_moddim = 1; m_amlength1 = ReadAMAddress(); if (m_amflag) - apph = (UINT16)m_reg[m_amout]; + apph = (uint16_t)m_reg[m_amout]; else apph = m_program->read_word_unaligned(m_amout); @@ -115,9 +115,9 @@ UINT32 v60_device::opDECH() /* TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opDECW() /* TRUSTED */ +uint32_t v60_device::opDECW() /* TRUSTED */ { - UINT32 appw; + uint32_t appw; m_modadd = PC + 1; m_moddim = 2; @@ -138,7 +138,7 @@ UINT32 v60_device::opDECW() /* TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opJMP() /* TRUSTED */ +uint32_t v60_device::opJMP() /* TRUSTED */ { m_modadd = PC + 1; m_moddim = 0; @@ -155,7 +155,7 @@ UINT32 v60_device::opJMP() /* TRUSTED */ return 0; } -UINT32 v60_device::opJSR() /* TRUSTED */ +uint32_t v60_device::opJSR() /* TRUSTED */ { m_modadd = PC + 1; m_moddim = 0; @@ -176,7 +176,7 @@ UINT32 v60_device::opJSR() /* TRUSTED */ return 0; } -UINT32 v60_device::opPREPARE() /* somewhat TRUSTED */ +uint32_t v60_device::opPREPARE() /* somewhat TRUSTED */ { m_modadd = PC + 1; m_moddim = 2; @@ -197,7 +197,7 @@ UINT32 v60_device::opPREPARE() /* somewhat TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opRET() /* TRUSTED */ +uint32_t v60_device::opRET() /* TRUSTED */ { m_modadd = PC + 1; m_moddim = 2; @@ -219,9 +219,9 @@ UINT32 v60_device::opRET() /* TRUSTED */ return 0; } -UINT32 v60_device::opTRAP() +uint32_t v60_device::opTRAP() { - UINT32 oldPSW; + uint32_t oldPSW; m_modadd = PC + 1; m_moddim = 0; @@ -299,9 +299,9 @@ UINT32 v60_device::opTRAP() return 0; } -UINT32 v60_device::opRETIU() /* TRUSTED */ +uint32_t v60_device::opRETIU() /* TRUSTED */ { - UINT32 newPSW; + uint32_t newPSW; m_modadd = PC + 1; m_moddim = 1; @@ -323,9 +323,9 @@ UINT32 v60_device::opRETIU() /* TRUSTED */ return 0; } -UINT32 v60_device::opRETIS() +uint32_t v60_device::opRETIS() { - UINT32 newPSW; + uint32_t newPSW; m_modadd = PC + 1; m_moddim = 1; @@ -348,10 +348,10 @@ UINT32 v60_device::opRETIS() return 0; } -UINT32 v60_device::opSTTASK() +uint32_t v60_device::opSTTASK() { int i; - UINT32 adr; + uint32_t adr; m_modadd = PC + 1; m_moddim = 2; @@ -394,7 +394,7 @@ UINT32 v60_device::opSTTASK() return m_amlength1 + 1; } -UINT32 v60_device::opGETPSW() +uint32_t v60_device::opGETPSW() { m_modadd = PC + 1; m_moddim = 2; @@ -406,18 +406,18 @@ UINT32 v60_device::opGETPSW() return m_amlength1 + 1; } -UINT32 v60_device::opTASI() +uint32_t v60_device::opTASI() { - UINT8 appb; + uint8_t appb; m_modadd = PC + 1; m_moddim = 0; // Load the address of the operand m_amlength1 = ReadAMAddress(); - // Load UINT8 from the address + // Load uint8_t from the address if (m_amflag) - appb = (UINT8)m_reg[m_amout & 0x1F]; + appb = (uint8_t)m_reg[m_amout & 0x1F]; else appb = m_program->read_byte(m_amout); @@ -433,7 +433,7 @@ UINT32 v60_device::opTASI() return m_amlength1 + 1; } -UINT32 v60_device::opCLRTLB() +uint32_t v60_device::opCLRTLB() { m_modadd = PC + 1; m_moddim = 2; @@ -446,7 +446,7 @@ UINT32 v60_device::opCLRTLB() return m_amlength1 + 1; } -UINT32 v60_device::opPOPM() +uint32_t v60_device::opPOPM() { int i; @@ -472,7 +472,7 @@ UINT32 v60_device::opPOPM() return m_amlength1 + 1; } -UINT32 v60_device::opPUSHM() +uint32_t v60_device::opPUSHM() { int i; @@ -499,7 +499,7 @@ UINT32 v60_device::opPUSHM() return m_amlength1 + 1; } -UINT32 v60_device::opTESTB() /* TRUSTED */ +uint32_t v60_device::opTESTB() /* TRUSTED */ { m_modadd = PC + 1; m_moddim = 0; @@ -515,7 +515,7 @@ UINT32 v60_device::opTESTB() /* TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opTESTH() /* TRUSTED */ +uint32_t v60_device::opTESTH() /* TRUSTED */ { m_modadd = PC + 1; m_moddim = 1; @@ -531,7 +531,7 @@ UINT32 v60_device::opTESTH() /* TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opTESTW() /* TRUSTED */ +uint32_t v60_device::opTESTW() /* TRUSTED */ { m_modadd = PC + 1; m_moddim = 2; @@ -547,7 +547,7 @@ UINT32 v60_device::opTESTW() /* TRUSTED */ return m_amlength1 + 1; } -UINT32 v60_device::opPUSH() +uint32_t v60_device::opPUSH() { m_modadd = PC + 1; m_moddim = 2; @@ -560,7 +560,7 @@ UINT32 v60_device::opPUSH() return m_amlength1 + 1; } -UINT32 v60_device::opPOP() +uint32_t v60_device::opPOP() { m_modadd = PC + 1; m_moddim = 2; @@ -572,70 +572,70 @@ UINT32 v60_device::opPOP() } -UINT32 v60_device::opINCB_0() { m_modm = 0; return opINCB(); } -UINT32 v60_device::opINCB_1() { m_modm = 1; return opINCB(); } -UINT32 v60_device::opINCH_0() { m_modm = 0; return opINCH(); } -UINT32 v60_device::opINCH_1() { m_modm = 1; return opINCH(); } -UINT32 v60_device::opINCW_0() { m_modm = 0; return opINCW(); } -UINT32 v60_device::opINCW_1() { m_modm = 1; return opINCW(); } +uint32_t v60_device::opINCB_0() { m_modm = 0; return opINCB(); } +uint32_t v60_device::opINCB_1() { m_modm = 1; return opINCB(); } +uint32_t v60_device::opINCH_0() { m_modm = 0; return opINCH(); } +uint32_t v60_device::opINCH_1() { m_modm = 1; return opINCH(); } +uint32_t v60_device::opINCW_0() { m_modm = 0; return opINCW(); } +uint32_t v60_device::opINCW_1() { m_modm = 1; return opINCW(); } -UINT32 v60_device::opDECB_0() { m_modm = 0; return opDECB(); } -UINT32 v60_device::opDECB_1() { m_modm = 1; return opDECB(); } -UINT32 v60_device::opDECH_0() { m_modm = 0; return opDECH(); } -UINT32 v60_device::opDECH_1() { m_modm = 1; return opDECH(); } -UINT32 v60_device::opDECW_0() { m_modm = 0; return opDECW(); } -UINT32 v60_device::opDECW_1() { m_modm = 1; return opDECW(); } +uint32_t v60_device::opDECB_0() { m_modm = 0; return opDECB(); } +uint32_t v60_device::opDECB_1() { m_modm = 1; return opDECB(); } +uint32_t v60_device::opDECH_0() { m_modm = 0; return opDECH(); } +uint32_t v60_device::opDECH_1() { m_modm = 1; return opDECH(); } +uint32_t v60_device::opDECW_0() { m_modm = 0; return opDECW(); } +uint32_t v60_device::opDECW_1() { m_modm = 1; return opDECW(); } -UINT32 v60_device::opJMP_0() { m_modm = 0; return opJMP(); } -UINT32 v60_device::opJMP_1() { m_modm = 1; return opJMP(); } +uint32_t v60_device::opJMP_0() { m_modm = 0; return opJMP(); } +uint32_t v60_device::opJMP_1() { m_modm = 1; return opJMP(); } -UINT32 v60_device::opJSR_0() { m_modm = 0; return opJSR(); } -UINT32 v60_device::opJSR_1() { m_modm = 1; return opJSR(); } +uint32_t v60_device::opJSR_0() { m_modm = 0; return opJSR(); } +uint32_t v60_device::opJSR_1() { m_modm = 1; return opJSR(); } -UINT32 v60_device::opPREPARE_0() { m_modm = 0; return opPREPARE(); } -UINT32 v60_device::opPREPARE_1() { m_modm = 1; return opPREPARE(); } +uint32_t v60_device::opPREPARE_0() { m_modm = 0; return opPREPARE(); } +uint32_t v60_device::opPREPARE_1() { m_modm = 1; return opPREPARE(); } -UINT32 v60_device::opRET_0() { m_modm = 0; return opRET(); } -UINT32 v60_device::opRET_1() { m_modm = 1; return opRET(); } +uint32_t v60_device::opRET_0() { m_modm = 0; return opRET(); } +uint32_t v60_device::opRET_1() { m_modm = 1; return opRET(); } -UINT32 v60_device::opTRAP_0() { m_modm = 0; return opTRAP(); } -UINT32 v60_device::opTRAP_1() { m_modm = 1; return opTRAP(); } +uint32_t v60_device::opTRAP_0() { m_modm = 0; return opTRAP(); } +uint32_t v60_device::opTRAP_1() { m_modm = 1; return opTRAP(); } -UINT32 v60_device::opRETIU_0() { m_modm = 0; return opRETIU(); } -UINT32 v60_device::opRETIU_1() { m_modm = 1; return opRETIU(); } +uint32_t v60_device::opRETIU_0() { m_modm = 0; return opRETIU(); } +uint32_t v60_device::opRETIU_1() { m_modm = 1; return opRETIU(); } -UINT32 v60_device::opRETIS_0() { m_modm = 0; return opRETIS(); } -UINT32 v60_device::opRETIS_1() { m_modm = 1; return opRETIS(); } +uint32_t v60_device::opRETIS_0() { m_modm = 0; return opRETIS(); } +uint32_t v60_device::opRETIS_1() { m_modm = 1; return opRETIS(); } -UINT32 v60_device::opGETPSW_0() { m_modm = 0; return opGETPSW(); } -UINT32 v60_device::opGETPSW_1() { m_modm = 1; return opGETPSW(); } +uint32_t v60_device::opGETPSW_0() { m_modm = 0; return opGETPSW(); } +uint32_t v60_device::opGETPSW_1() { m_modm = 1; return opGETPSW(); } -UINT32 v60_device::opTASI_0() { m_modm = 0; return opTASI(); } -UINT32 v60_device::opTASI_1() { m_modm = 1; return opTASI(); } +uint32_t v60_device::opTASI_0() { m_modm = 0; return opTASI(); } +uint32_t v60_device::opTASI_1() { m_modm = 1; return opTASI(); } -UINT32 v60_device::opCLRTLB_0() { m_modm = 0; return opCLRTLB(); } -UINT32 v60_device::opCLRTLB_1() { m_modm = 1; return opCLRTLB(); } +uint32_t v60_device::opCLRTLB_0() { m_modm = 0; return opCLRTLB(); } +uint32_t v60_device::opCLRTLB_1() { m_modm = 1; return opCLRTLB(); } -UINT32 v60_device::opPOPM_0() { m_modm = 0; return opPOPM(); } -UINT32 v60_device::opPOPM_1() { m_modm = 1; return opPOPM(); } +uint32_t v60_device::opPOPM_0() { m_modm = 0; return opPOPM(); } +uint32_t v60_device::opPOPM_1() { m_modm = 1; return opPOPM(); } -UINT32 v60_device::opPUSHM_0() { m_modm = 0; return opPUSHM(); } -UINT32 v60_device::opPUSHM_1() { m_modm = 1; return opPUSHM(); } +uint32_t v60_device::opPUSHM_0() { m_modm = 0; return opPUSHM(); } +uint32_t v60_device::opPUSHM_1() { m_modm = 1; return opPUSHM(); } -UINT32 v60_device::opTESTB_0() { m_modm = 0; return opTESTB(); } -UINT32 v60_device::opTESTB_1() { m_modm = 1; return opTESTB(); } +uint32_t v60_device::opTESTB_0() { m_modm = 0; return opTESTB(); } +uint32_t v60_device::opTESTB_1() { m_modm = 1; return opTESTB(); } -UINT32 v60_device::opTESTH_0() { m_modm = 0; return opTESTH(); } -UINT32 v60_device::opTESTH_1() { m_modm = 1; return opTESTH(); } +uint32_t v60_device::opTESTH_0() { m_modm = 0; return opTESTH(); } +uint32_t v60_device::opTESTH_1() { m_modm = 1; return opTESTH(); } -UINT32 v60_device::opTESTW_0() { m_modm = 0; return opTESTW(); } -UINT32 v60_device::opTESTW_1() { m_modm = 1; return opTESTW(); } +uint32_t v60_device::opTESTW_0() { m_modm = 0; return opTESTW(); } +uint32_t v60_device::opTESTW_1() { m_modm = 1; return opTESTW(); } -UINT32 v60_device::opPUSH_0() { m_modm = 0; return opPUSH(); } -UINT32 v60_device::opPUSH_1() { m_modm = 1; return opPUSH(); } +uint32_t v60_device::opPUSH_0() { m_modm = 0; return opPUSH(); } +uint32_t v60_device::opPUSH_1() { m_modm = 1; return opPUSH(); } -UINT32 v60_device::opPOP_0() { m_modm = 0; return opPOP(); } -UINT32 v60_device::opPOP_1() { m_modm = 1; return opPOP(); } +uint32_t v60_device::opPOP_0() { m_modm = 0; return opPOP(); } +uint32_t v60_device::opPOP_1() { m_modm = 1; return opPOP(); } -UINT32 v60_device::opSTTASK_0() { m_modm = 0; return opSTTASK(); } -UINT32 v60_device::opSTTASK_1() { m_modm = 1; return opSTTASK(); } +uint32_t v60_device::opSTTASK_0() { m_modm = 0; return opSTTASK(); } +uint32_t v60_device::opSTTASK_1() { m_modm = 1; return opSTTASK(); } diff --git a/src/devices/cpu/v60/op4.hxx b/src/devices/cpu/v60/op4.hxx index ca5b4cef4c6..edef480789a 100644 --- a/src/devices/cpu/v60/op4.hxx +++ b/src/devices/cpu/v60/op4.hxx @@ -4,26 +4,26 @@ FULLY TRUSTED */ -UINT32 v60_device::opBGT8() /* TRUSTED */ +uint32_t v60_device::opBGT8() /* TRUSTED */ { NORMALIZEFLAGS(); if (!((_S ^ _OV) | _Z)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBGT16() /* TRUSTED */ +uint32_t v60_device::opBGT16() /* TRUSTED */ { NORMALIZEFLAGS(); if (!((_S ^ _OV) | _Z)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } @@ -31,52 +31,52 @@ UINT32 v60_device::opBGT16() /* TRUSTED */ } -UINT32 v60_device::opBGE8() /* TRUSTED */ +uint32_t v60_device::opBGE8() /* TRUSTED */ { NORMALIZEFLAGS(); if (!(_S ^ _OV)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBGE16() /* TRUSTED */ +uint32_t v60_device::opBGE16() /* TRUSTED */ { NORMALIZEFLAGS(); if (!(_S ^ _OV)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBLT8() /* TRUSTED */ +uint32_t v60_device::opBLT8() /* TRUSTED */ { NORMALIZEFLAGS(); if ((_S ^ _OV)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBLT16() /* TRUSTED */ +uint32_t v60_device::opBLT16() /* TRUSTED */ { NORMALIZEFLAGS(); if ((_S ^ _OV)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } @@ -84,271 +84,271 @@ UINT32 v60_device::opBLT16() /* TRUSTED */ } -UINT32 v60_device::opBLE8() /* TRUSTED */ +uint32_t v60_device::opBLE8() /* TRUSTED */ { NORMALIZEFLAGS(); if (((_S ^ _OV) | _Z)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBLE16() /* TRUSTED */ +uint32_t v60_device::opBLE16() /* TRUSTED */ { NORMALIZEFLAGS(); if (((_S ^ _OV) | _Z)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBH8() /* TRUSTED */ +uint32_t v60_device::opBH8() /* TRUSTED */ { if (!(_CY | _Z)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBH16() /* TRUSTED */ +uint32_t v60_device::opBH16() /* TRUSTED */ { if (!(_CY | _Z)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBNH8() /* TRUSTED */ +uint32_t v60_device::opBNH8() /* TRUSTED */ { if ((_CY | _Z)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBNH16() /* TRUSTED */ +uint32_t v60_device::opBNH16() /* TRUSTED */ { if ((_CY | _Z)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBNL8() /* TRUSTED */ +uint32_t v60_device::opBNL8() /* TRUSTED */ { if (!(_CY)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBNL16() /* TRUSTED */ +uint32_t v60_device::opBNL16() /* TRUSTED */ { if (!(_CY)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBL8() /* TRUSTED */ +uint32_t v60_device::opBL8() /* TRUSTED */ { if ((_CY)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBL16() /* TRUSTED */ +uint32_t v60_device::opBL16() /* TRUSTED */ { if ((_CY)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBNE8() /* TRUSTED */ +uint32_t v60_device::opBNE8() /* TRUSTED */ { if (!(_Z)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBNE16() /* TRUSTED */ +uint32_t v60_device::opBNE16() /* TRUSTED */ { if (!(_Z)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBE8() /* TRUSTED */ +uint32_t v60_device::opBE8() /* TRUSTED */ { if ((_Z)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBE16() /* TRUSTED */ +uint32_t v60_device::opBE16() /* TRUSTED */ { if ((_Z)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBNV8() /* TRUSTED */ +uint32_t v60_device::opBNV8() /* TRUSTED */ { if (!(_OV)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBNV16() /* TRUSTED */ +uint32_t v60_device::opBNV16() /* TRUSTED */ { if (!(_OV)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBV8() /* TRUSTED */ +uint32_t v60_device::opBV8() /* TRUSTED */ { if ((_OV)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBV16() /* TRUSTED */ +uint32_t v60_device::opBV16() /* TRUSTED */ { if ((_OV)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBP8() /* TRUSTED */ +uint32_t v60_device::opBP8() /* TRUSTED */ { if (!(_S)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBP16() /* TRUSTED */ +uint32_t v60_device::opBP16() /* TRUSTED */ { if (!(_S)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBN8() /* TRUSTED */ +uint32_t v60_device::opBN8() /* TRUSTED */ { if ((_S)) { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } return 2; } -UINT32 v60_device::opBN16() /* TRUSTED */ +uint32_t v60_device::opBN16() /* TRUSTED */ { if ((_S)) { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } return 3; } -UINT32 v60_device::opBR8() /* TRUSTED */ +uint32_t v60_device::opBR8() /* TRUSTED */ { - PC += (INT8)OpRead8(PC + 1); + PC += (int8_t)OpRead8(PC + 1); return 0; } -UINT32 v60_device::opBR16() /* TRUSTED */ +uint32_t v60_device::opBR16() /* TRUSTED */ { - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } -UINT32 v60_device::opBSR() /* TRUSTED */ +uint32_t v60_device::opBSR() /* TRUSTED */ { // Save Next PC onto the stack SP -= 4; m_program->write_dword_unaligned(SP, PC + 3); // Jump to subroutine - PC += (INT16)OpRead16(PC + 1); + PC += (int16_t)OpRead16(PC + 1); return 0; } diff --git a/src/devices/cpu/v60/op5.hxx b/src/devices/cpu/v60/op5.hxx index be6084eb6e1..a70a1809ce0 100644 --- a/src/devices/cpu/v60/op5.hxx +++ b/src/devices/cpu/v60/op5.hxx @@ -4,10 +4,10 @@ * HALT: must add log */ -UINT32 v60_device::opBRK() +uint32_t v60_device::opBRK() { /* - UINT32 oldPSW = v60_update_psw_for_exception(0, 0); + uint32_t oldPSW = v60_update_psw_for_exception(0, 0); SP -=4; m_program->write_dword_unaligned(SP, EXCEPTION_CODE_AND_SIZE(0x0d00, 4)); @@ -22,9 +22,9 @@ UINT32 v60_device::opBRK() return 1; } -UINT32 v60_device::opBRKV() +uint32_t v60_device::opBRKV() { - UINT32 oldPSW = v60_update_psw_for_exception(0, 0); + uint32_t oldPSW = v60_update_psw_for_exception(0, 0); SP -=4; m_program->write_dword_unaligned(SP, PC); @@ -39,14 +39,14 @@ UINT32 v60_device::opBRKV() return 0; } -UINT32 v60_device::opCLRTLBA() +uint32_t v60_device::opCLRTLBA() { // @@@ TLB not yet supported logerror("Skipping CLRTLBA opcode! PC=%x\n", PC); return 1; } -UINT32 v60_device::opDISPOSE() +uint32_t v60_device::opDISPOSE() { SP = FP; FP = m_program->read_dword_unaligned(SP); @@ -55,19 +55,19 @@ UINT32 v60_device::opDISPOSE() return 1; } -UINT32 v60_device::opHALT() +uint32_t v60_device::opHALT() { // @@@ It should wait for an interrupt to occur //logerror("HALT found: skipping"); return 1; } -UINT32 v60_device::opNOP() /* TRUSTED */ +uint32_t v60_device::opNOP() /* TRUSTED */ { return 1; } -UINT32 v60_device::opRSR() +uint32_t v60_device::opRSR() { PC = m_program->read_dword_unaligned(SP); SP +=4; @@ -75,7 +75,7 @@ UINT32 v60_device::opRSR() return 0; } -UINT32 v60_device::opTRAPFL() +uint32_t v60_device::opTRAPFL() { if ((TKCW & 0x1F0) & ((v60ReadPSW() & 0x1F00) >> 4)) { diff --git a/src/devices/cpu/v60/op6.hxx b/src/devices/cpu/v60/op6.hxx index 087680534f9..d1286372cbd 100644 --- a/src/devices/cpu/v60/op6.hxx +++ b/src/devices/cpu/v60/op6.hxx @@ -4,39 +4,39 @@ FULLY TRUSTED */ -UINT32 v60_device::opTB(int reg) /* TRUSTED */ +uint32_t v60_device::opTB(int reg) /* TRUSTED */ { if (m_reg[reg] == 0) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBGT(int reg) /* TRUSTED */ +uint32_t v60_device::opDBGT(int reg) /* TRUSTED */ { m_reg[reg]--; NORMALIZEFLAGS(); if ((m_reg[reg] != 0) && !((_S ^ _OV) | _Z)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBLE(int reg) /* TRUSTED */ +uint32_t v60_device::opDBLE(int reg) /* TRUSTED */ { m_reg[reg]--; NORMALIZEFLAGS(); if ((m_reg[reg] != 0) && ((_S ^ _OV) | _Z)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } @@ -44,54 +44,54 @@ UINT32 v60_device::opDBLE(int reg) /* TRUSTED */ } -UINT32 v60_device::opDBGE(int reg) /* TRUSTED */ +uint32_t v60_device::opDBGE(int reg) /* TRUSTED */ { m_reg[reg]--; NORMALIZEFLAGS(); if ((m_reg[reg] != 0) && !(_S ^ _OV)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBLT(int reg) /* TRUSTED */ +uint32_t v60_device::opDBLT(int reg) /* TRUSTED */ { m_reg[reg]--; NORMALIZEFLAGS(); if ((m_reg[reg] != 0) && (_S ^ _OV)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBH(int reg) /* TRUSTED */ +uint32_t v60_device::opDBH(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && !(_CY | _Z)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBNH(int reg) /* TRUSTED */ +uint32_t v60_device::opDBNH(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && (_CY | _Z)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } @@ -99,117 +99,117 @@ UINT32 v60_device::opDBNH(int reg) /* TRUSTED */ } -UINT32 v60_device::opDBL(int reg) /* TRUSTED */ +uint32_t v60_device::opDBL(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && (_CY)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBNL(int reg) /* TRUSTED */ +uint32_t v60_device::opDBNL(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && !(_CY)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBE(int reg) /* TRUSTED */ +uint32_t v60_device::opDBE(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && (_Z)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBNE(int reg) /* TRUSTED */ +uint32_t v60_device::opDBNE(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && !(_Z)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBV(int reg) /* TRUSTED */ +uint32_t v60_device::opDBV(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && (_OV)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBNV(int reg) /* TRUSTED */ +uint32_t v60_device::opDBNV(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && !(_OV)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBN(int reg) /* TRUSTED */ +uint32_t v60_device::opDBN(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && (_S)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBP(int reg) /* TRUSTED */ +uint32_t v60_device::opDBP(int reg) /* TRUSTED */ { m_reg[reg]--; if ((m_reg[reg] != 0) && !(_S)) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } return 4; } -UINT32 v60_device::opDBR(int reg) /* TRUSTED */ +uint32_t v60_device::opDBR(int reg) /* TRUSTED */ { m_reg[reg]--; if (m_reg[reg] != 0) { - PC += (INT16)OpRead16(PC + 2); + PC += (int16_t)OpRead16(PC + 2); return 0; } @@ -241,14 +241,14 @@ const v60_device::op6_func v60_device::s_OpC7Table[8] = /* TRUSTED */ }; -UINT32 v60_device::opC6() /* TRUSTED */ +uint32_t v60_device::opC6() /* TRUSTED */ { - UINT8 appb = OpRead8(PC + 1); + uint8_t appb = OpRead8(PC + 1); return (this->*s_OpC6Table[appb >> 5])(appb & 0x1f); } -UINT32 v60_device::opC7() /* TRUSTED */ +uint32_t v60_device::opC7() /* TRUSTED */ { - UINT8 appb = OpRead8(PC + 1); + uint8_t appb = OpRead8(PC + 1); return (this->*s_OpC7Table[appb >> 5])(appb & 0x1f); } diff --git a/src/devices/cpu/v60/op7a.hxx b/src/devices/cpu/v60/op7a.hxx index 67a7b0fb82c..99634f84018 100644 --- a/src/devices/cpu/v60/op7a.hxx +++ b/src/devices/cpu/v60/op7a.hxx @@ -28,9 +28,9 @@ #define F7CCREATEBITMASK(x) \ x = ((1 << (x)) - 1) -void v60_device::F7aDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func DecodeOp2, UINT8 dim2) +void v60_device::F7aDecodeOperands(am_func DecodeOp1, uint8_t dim1, am_func DecodeOp2, uint8_t dim2) { - UINT8 appb; + uint8_t appb; // Decode first operand m_moddim = dim1; m_modm = m_subop & 0x40; @@ -62,9 +62,9 @@ void v60_device::F7aDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func Decode m_lenop2 = appb; } -void v60_device::F7bDecodeFirstOperand(am_func DecodeOp1, UINT8 dim1) +void v60_device::F7bDecodeFirstOperand(am_func DecodeOp1, uint8_t dim1) { - UINT8 appb; + uint8_t appb; // Decode first operand m_moddim = dim1; m_modm = m_subop & 0x40; @@ -82,7 +82,7 @@ void v60_device::F7bDecodeFirstOperand(am_func DecodeOp1, UINT8 dim1) } -void v60_device::F7bWriteSecondOperand(UINT8 dim2) +void v60_device::F7bWriteSecondOperand(uint8_t dim2) { m_moddim = dim2; m_modm = m_subop & 0x20; @@ -91,7 +91,7 @@ void v60_device::F7bWriteSecondOperand(UINT8 dim2) } -void v60_device::F7bDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func DecodeOp2, UINT8 dim2) +void v60_device::F7bDecodeOperands(am_func DecodeOp1, uint8_t dim1, am_func DecodeOp2, uint8_t dim2) { // Decode first operand F7bDecodeFirstOperand(DecodeOp1, dim1); @@ -107,9 +107,9 @@ void v60_device::F7bDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func Decode m_bamoffset2 = m_bamoffset; } -void v60_device::F7cDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func DecodeOp2, UINT8 dim2) +void v60_device::F7cDecodeOperands(am_func DecodeOp1, uint8_t dim1, am_func DecodeOp2, uint8_t dim2) { - UINT8 appb; + uint8_t appb; // Decode first operand m_moddim = dim1; m_modm = m_subop & 0x40; @@ -136,13 +136,13 @@ void v60_device::F7cDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func Decode #define F7CLOADOP1BYTE(appb) \ if (m_flag1) \ - appb = (UINT8)(m_reg[m_op1]&0xFF); \ + appb = (uint8_t)(m_reg[m_op1]&0xFF); \ else \ appb = m_program->read_byte(m_op1); #define F7CLOADOP2BYTE(appb) \ if (m_flag2) \ - appb = (UINT8)(m_reg[m_op2]&0xFF); \ + appb = (uint8_t)(m_reg[m_op2]&0xFF); \ else \ appb = m_program->read_byte(m_op2); @@ -159,10 +159,10 @@ void v60_device::F7cDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func Decode else \ m_program->write_word_unaligned(m_op2, apph); -UINT32 v60_device::opCMPSTRB(UINT8 bFill, UINT8 bStop) +uint32_t v60_device::opCMPSTRB(uint8_t bFill, uint8_t bStop) { - UINT32 i, dest; - UINT8 c1, c2; + uint32_t i, dest; + uint8_t c1, c2; F7aDecodeOperands(&v60_device::ReadAMAddress, 0,&v60_device::ReadAMAddress, 0); @@ -172,12 +172,12 @@ UINT32 v60_device::opCMPSTRB(UINT8 bFill, UINT8 bStop) if (m_lenop1 < m_lenop2) { for (i = m_lenop1; i < m_lenop2; i++) - m_program->write_byte(m_op1 + i,(UINT8)R26); + m_program->write_byte(m_op1 + i,(uint8_t)R26); } else if (m_lenop2 < m_lenop1) { for (i = m_lenop2; i < m_lenop1; i++) - m_program->write_byte(m_op2 + i,(UINT8)R26); + m_program->write_byte(m_op2 + i,(uint8_t)R26); } } @@ -202,7 +202,7 @@ UINT32 v60_device::opCMPSTRB(UINT8 bFill, UINT8 bStop) } if (bStop) - if (c1 == (UINT8)R26 || c2 == (UINT8)R26) + if (c1 == (uint8_t)R26 || c2 == (uint8_t)R26) { _CY = 0; break; @@ -225,10 +225,10 @@ UINT32 v60_device::opCMPSTRB(UINT8 bFill, UINT8 bStop) F7AEND(); } -UINT32 v60_device::opCMPSTRH(UINT8 bFill, UINT8 bStop) +uint32_t v60_device::opCMPSTRH(uint8_t bFill, uint8_t bStop) { - UINT32 i, dest; - UINT16 c1, c2; + uint32_t i, dest; + uint16_t c1, c2; F7aDecodeOperands(&v60_device::ReadAMAddress, 0,&v60_device::ReadAMAddress, 0); @@ -238,12 +238,12 @@ UINT32 v60_device::opCMPSTRH(UINT8 bFill, UINT8 bStop) if (m_lenop1 < m_lenop2) { for (i = m_lenop1; i < m_lenop2; i++) - m_program->write_word_unaligned(m_op1 + i * 2,(UINT16)R26); + m_program->write_word_unaligned(m_op1 + i * 2,(uint16_t)R26); } else if (m_lenop2 < m_lenop1) { for (i = m_lenop2; i < m_lenop1; i++) - m_program->write_word_unaligned(m_op2 + i * 2,(UINT16)R26); + m_program->write_word_unaligned(m_op2 + i * 2,(uint16_t)R26); } } @@ -268,7 +268,7 @@ UINT32 v60_device::opCMPSTRH(UINT8 bFill, UINT8 bStop) } if (bStop) - if (c1 == (UINT16)R26 || c2 == (UINT16)R26) + if (c1 == (uint16_t)R26 || c2 == (uint16_t)R26) { _CY = 0; break; @@ -293,10 +293,10 @@ UINT32 v60_device::opCMPSTRH(UINT8 bFill, UINT8 bStop) -UINT32 v60_device::opMOVSTRUB(UINT8 bFill, UINT8 bStop) /* TRUSTED (0, 0) (1, 0) */ +uint32_t v60_device::opMOVSTRUB(uint8_t bFill, uint8_t bStop) /* TRUSTED (0, 0) (1, 0) */ { - UINT32 i, dest; - UINT8 c1; + uint32_t i, dest; + uint8_t c1; // if (bStop) // { @@ -311,7 +311,7 @@ UINT32 v60_device::opMOVSTRUB(UINT8 bFill, UINT8 bStop) /* TRUSTED (0, 0) (1, 0) { m_program->write_byte(m_op2 + i,(c1 = m_program->read_byte(m_op1 + i))); - if (bStop && c1 == (UINT8)R26) + if (bStop && c1 == (uint8_t)R26) break; } @@ -321,7 +321,7 @@ UINT32 v60_device::opMOVSTRUB(UINT8 bFill, UINT8 bStop) /* TRUSTED (0, 0) (1, 0) if (bFill && m_lenop1 < m_lenop2) { for (;i < m_lenop2; i++) - m_program->write_byte(m_op2 + i,(UINT8)R26); + m_program->write_byte(m_op2 + i,(uint8_t)R26); R27 = m_op2 + i; } @@ -330,10 +330,10 @@ UINT32 v60_device::opMOVSTRUB(UINT8 bFill, UINT8 bStop) /* TRUSTED (0, 0) (1, 0) F7AEND(); } -UINT32 v60_device::opMOVSTRDB(UINT8 bFill, UINT8 bStop) +uint32_t v60_device::opMOVSTRDB(uint8_t bFill, uint8_t bStop) { - UINT32 i, dest; - UINT8 c1; + uint32_t i, dest; + uint8_t c1; F7aDecodeOperands(&v60_device::ReadAMAddress, 0,&v60_device::ReadAMAddress, 0); @@ -343,7 +343,7 @@ UINT32 v60_device::opMOVSTRDB(UINT8 bFill, UINT8 bStop) { m_program->write_byte(m_op2 + (dest - i - 1),(c1 = m_program->read_byte(m_op1 + (dest - i - 1)))); - if (bStop && c1 == (UINT8)R26) + if (bStop && c1 == (uint8_t)R26) break; } @@ -353,7 +353,7 @@ UINT32 v60_device::opMOVSTRDB(UINT8 bFill, UINT8 bStop) if (bFill && m_lenop1 < m_lenop2) { for (;i < m_lenop2; i++) - m_program->write_byte(m_op2 + dest + (m_lenop2 - i - 1),(UINT8)R26); + m_program->write_byte(m_op2 + dest + (m_lenop2 - i - 1),(uint8_t)R26); R27 = m_op2 + (m_lenop2 - i - 1); } @@ -363,10 +363,10 @@ UINT32 v60_device::opMOVSTRDB(UINT8 bFill, UINT8 bStop) } -UINT32 v60_device::opMOVSTRUH(UINT8 bFill, UINT8 bStop) /* TRUSTED (0, 0) (1, 0) */ +uint32_t v60_device::opMOVSTRUH(uint8_t bFill, uint8_t bStop) /* TRUSTED (0, 0) (1, 0) */ { - UINT32 i, dest; - UINT16 c1; + uint32_t i, dest; + uint16_t c1; // if (bStop) // { int a = 1; } @@ -379,7 +379,7 @@ UINT32 v60_device::opMOVSTRUH(UINT8 bFill, UINT8 bStop) /* TRUSTED (0, 0) (1, 0) { m_program->write_word_unaligned(m_op2 + i * 2,(c1 = m_program->read_word_unaligned(m_op1 + i * 2))); - if (bStop && c1 == (UINT16)R26) + if (bStop && c1 == (uint16_t)R26) break; } @@ -389,7 +389,7 @@ UINT32 v60_device::opMOVSTRUH(UINT8 bFill, UINT8 bStop) /* TRUSTED (0, 0) (1, 0) if (bFill && m_lenop1 < m_lenop2) { for (;i < m_lenop2; i++) - m_program->write_word_unaligned(m_op2 + i * 2,(UINT16)R26); + m_program->write_word_unaligned(m_op2 + i * 2,(uint16_t)R26); R27 = m_op2 + i * 2; } @@ -397,10 +397,10 @@ UINT32 v60_device::opMOVSTRUH(UINT8 bFill, UINT8 bStop) /* TRUSTED (0, 0) (1, 0) F7AEND(); } -UINT32 v60_device::opMOVSTRDH(UINT8 bFill, UINT8 bStop) +uint32_t v60_device::opMOVSTRDH(uint8_t bFill, uint8_t bStop) { - UINT32 i, dest; - UINT16 c1; + uint32_t i, dest; + uint16_t c1; // if (bFill | bStop) // { int a = 1; } @@ -416,7 +416,7 @@ UINT32 v60_device::opMOVSTRDH(UINT8 bFill, UINT8 bStop) { m_program->write_word_unaligned(m_op2 + (dest - i - 1) * 2,(c1 = m_program->read_word_unaligned(m_op1 + (dest - i - 1) * 2))); - if (bStop && c1 == (UINT16)R26) + if (bStop && c1 == (uint16_t)R26) break; } @@ -426,7 +426,7 @@ UINT32 v60_device::opMOVSTRDH(UINT8 bFill, UINT8 bStop) if (bFill && m_lenop1 < m_lenop2) { for (;i < m_lenop2; i++) - m_program->write_word_unaligned(m_op2 + (m_lenop2 - i - 1) * 2,(UINT16)R26); + m_program->write_word_unaligned(m_op2 + (m_lenop2 - i - 1) * 2,(uint16_t)R26); R27 = m_op2 + (m_lenop2 - i - 1) * 2; } @@ -434,16 +434,16 @@ UINT32 v60_device::opMOVSTRDH(UINT8 bFill, UINT8 bStop) F7AEND(); } -UINT32 v60_device::opSEARCHUB(UINT8 bSearch) +uint32_t v60_device::opSEARCHUB(uint8_t bSearch) { - UINT8 appb; - UINT32 i; + uint8_t appb; + uint32_t i; F7bDecodeOperands(&v60_device::ReadAMAddress, 0,&v60_device::ReadAM, 0); for (i = 0; i < m_lenop1; i++) { - appb = (m_program->read_byte(m_op1 + i) == (UINT8)m_op2); + appb = (m_program->read_byte(m_op1 + i) == (uint8_t)m_op2); if ((bSearch && appb) || (!bSearch && !appb)) break; } @@ -460,16 +460,16 @@ UINT32 v60_device::opSEARCHUB(UINT8 bSearch) F7BEND(); } -UINT32 v60_device::opSEARCHUH(UINT8 bSearch) +uint32_t v60_device::opSEARCHUH(uint8_t bSearch) { - UINT8 appb; - UINT32 i; + uint8_t appb; + uint32_t i; F7bDecodeOperands(&v60_device::ReadAMAddress, 1,&v60_device::ReadAM, 1); for (i = 0; i < m_lenop1; i++) { - appb = (m_program->read_word_unaligned(m_op1 + i * 2) == (UINT16)m_op2); + appb = (m_program->read_word_unaligned(m_op1 + i * 2) == (uint16_t)m_op2); if ((bSearch && appb) || (!bSearch && !appb)) break; } @@ -485,16 +485,16 @@ UINT32 v60_device::opSEARCHUH(UINT8 bSearch) F7BEND(); } -UINT32 v60_device::opSEARCHDB(UINT8 bSearch) +uint32_t v60_device::opSEARCHDB(uint8_t bSearch) { - UINT8 appb; - INT32 i; + uint8_t appb; + int32_t i; F7bDecodeOperands(&v60_device::ReadAMAddress, 0,&v60_device::ReadAM, 0); for (i = m_lenop1; i >= 0; i--) { - appb = (m_program->read_byte(m_op1 + i) == (UINT8)m_op2); + appb = (m_program->read_byte(m_op1 + i) == (uint8_t)m_op2); if ((bSearch && appb) || (!bSearch && !appb)) break; } @@ -503,7 +503,7 @@ UINT32 v60_device::opSEARCHDB(UINT8 bSearch) R27 = i; // This is the opposite as stated in V60 manual... - if ((UINT32)i != m_lenop1) + if ((uint32_t)i != m_lenop1) _Z = 0; else _Z = 1; @@ -511,16 +511,16 @@ UINT32 v60_device::opSEARCHDB(UINT8 bSearch) F7BEND(); } -UINT32 v60_device::opSEARCHDH(UINT8 bSearch) +uint32_t v60_device::opSEARCHDH(uint8_t bSearch) { - UINT8 appb; - INT32 i; + uint8_t appb; + int32_t i; F7bDecodeOperands(&v60_device::ReadAMAddress, 1,&v60_device::ReadAM, 1); for (i = m_lenop1 - 1; i >= 0; i--) { - appb = (m_program->read_word_unaligned(m_op1 + i * 2) == (UINT16)m_op2); + appb = (m_program->read_word_unaligned(m_op1 + i * 2) == (uint16_t)m_op2); if ((bSearch && appb) || (!bSearch && !appb)) break; } @@ -528,7 +528,7 @@ UINT32 v60_device::opSEARCHDH(UINT8 bSearch) R28 = m_op1 + i * 2; R27 = i; - if ((UINT32)i != m_lenop1) + if ((uint32_t)i != m_lenop1) _Z = 0; else _Z = 1; @@ -537,35 +537,35 @@ UINT32 v60_device::opSEARCHDH(UINT8 bSearch) } -UINT32 v60_device::opSCHCUB() { return opSEARCHUB(1); } -UINT32 v60_device::opSCHCUH() { return opSEARCHUH(1); } -UINT32 v60_device::opSCHCDB() { return opSEARCHDB(1); } -UINT32 v60_device::opSCHCDH() { return opSEARCHDH(1); } -UINT32 v60_device::opSKPCUB() { return opSEARCHUB(0); } -UINT32 v60_device::opSKPCUH() { return opSEARCHUH(0); } -UINT32 v60_device::opSKPCDB() { return opSEARCHDB(0); } -UINT32 v60_device::opSKPCDH() { return opSEARCHDH(0); } - -UINT32 v60_device::opCMPCB() { return opCMPSTRB(0, 0); } -UINT32 v60_device::opCMPCH() { return opCMPSTRH(0, 0); } -UINT32 v60_device::opCMPCFB() { return opCMPSTRB(1, 0); } -UINT32 v60_device::opCMPCFH() { return opCMPSTRH(1, 0); } -UINT32 v60_device::opCMPCSB() { return opCMPSTRB(0, 1); } -UINT32 v60_device::opCMPCSH() { return opCMPSTRH(0, 1); } - -UINT32 v60_device::opMOVCUB() { return opMOVSTRUB(0, 0); } -UINT32 v60_device::opMOVCUH() { return opMOVSTRUH(0, 0); } -UINT32 v60_device::opMOVCFUB() { return opMOVSTRUB(1, 0); } -UINT32 v60_device::opMOVCFUH() { return opMOVSTRUH(1, 0); } -UINT32 v60_device::opMOVCSUB() { return opMOVSTRUB(0, 1); } -UINT32 v60_device::opMOVCSUH() { return opMOVSTRUH(0, 1); } - -UINT32 v60_device::opMOVCDB() { return opMOVSTRDB(0, 0); } -UINT32 v60_device::opMOVCDH() { return opMOVSTRDH(0, 0); } -UINT32 v60_device::opMOVCFDB() { return opMOVSTRDB(1, 0); } -UINT32 v60_device::opMOVCFDH() { return opMOVSTRDH(1, 0); } - -UINT32 v60_device::opEXTBFZ() /* TRUSTED */ +uint32_t v60_device::opSCHCUB() { return opSEARCHUB(1); } +uint32_t v60_device::opSCHCUH() { return opSEARCHUH(1); } +uint32_t v60_device::opSCHCDB() { return opSEARCHDB(1); } +uint32_t v60_device::opSCHCDH() { return opSEARCHDH(1); } +uint32_t v60_device::opSKPCUB() { return opSEARCHUB(0); } +uint32_t v60_device::opSKPCUH() { return opSEARCHUH(0); } +uint32_t v60_device::opSKPCDB() { return opSEARCHDB(0); } +uint32_t v60_device::opSKPCDH() { return opSEARCHDH(0); } + +uint32_t v60_device::opCMPCB() { return opCMPSTRB(0, 0); } +uint32_t v60_device::opCMPCH() { return opCMPSTRH(0, 0); } +uint32_t v60_device::opCMPCFB() { return opCMPSTRB(1, 0); } +uint32_t v60_device::opCMPCFH() { return opCMPSTRH(1, 0); } +uint32_t v60_device::opCMPCSB() { return opCMPSTRB(0, 1); } +uint32_t v60_device::opCMPCSH() { return opCMPSTRH(0, 1); } + +uint32_t v60_device::opMOVCUB() { return opMOVSTRUB(0, 0); } +uint32_t v60_device::opMOVCUH() { return opMOVSTRUH(0, 0); } +uint32_t v60_device::opMOVCFUB() { return opMOVSTRUB(1, 0); } +uint32_t v60_device::opMOVCFUH() { return opMOVSTRUH(1, 0); } +uint32_t v60_device::opMOVCSUB() { return opMOVSTRUB(0, 1); } +uint32_t v60_device::opMOVCSUH() { return opMOVSTRUH(0, 1); } + +uint32_t v60_device::opMOVCDB() { return opMOVSTRDB(0, 0); } +uint32_t v60_device::opMOVCDH() { return opMOVSTRDH(0, 0); } +uint32_t v60_device::opMOVCFDB() { return opMOVSTRDB(1, 0); } +uint32_t v60_device::opMOVCFDH() { return opMOVSTRDH(1, 0); } + +uint32_t v60_device::opEXTBFZ() /* TRUSTED */ { F7bDecodeFirstOperand(&v60_device::BitReadAM, 11); @@ -578,7 +578,7 @@ UINT32 v60_device::opEXTBFZ() /* TRUSTED */ F7BEND(); } -UINT32 v60_device::opEXTBFS() /* TRUSTED */ +uint32_t v60_device::opEXTBFS() /* TRUSTED */ { F7bDecodeFirstOperand(&v60_device::BitReadAM, 11); @@ -593,9 +593,9 @@ UINT32 v60_device::opEXTBFS() /* TRUSTED */ F7BEND(); } -UINT32 v60_device::opEXTBFL() +uint32_t v60_device::opEXTBFL() { - UINT32 appw; + uint32_t appw; F7bDecodeFirstOperand(&v60_device::BitReadAM, 11); @@ -610,14 +610,14 @@ UINT32 v60_device::opEXTBFL() F7BEND(); } -UINT32 v60_device::opSCHBS(UINT32 bSearch1) +uint32_t v60_device::opSCHBS(uint32_t bSearch1) { - UINT32 i, data; - UINT32 offset; + uint32_t i, data; + uint32_t offset; F7bDecodeFirstOperand(&v60_device::BitReadAMAddress, 10); - // Read first UINT8 + // Read first uint8_t m_op1 += m_bamoffset / 8; data = m_program->read_byte(m_op1); offset = m_bamoffset & 7; @@ -637,7 +637,7 @@ UINT32 v60_device::opSCHBS(UINT32 bSearch1) offset++; if (offset == 8) { - // Next UINT8 please + // Next uint8_t please offset = 0; m_op1++; data = m_program->read_byte(m_op1); @@ -654,12 +654,12 @@ UINT32 v60_device::opSCHBS(UINT32 bSearch1) F7BEND(); } -UINT32 v60_device::opSCH0BSU() { return opSCHBS(0); } -UINT32 v60_device::opSCH1BSU() { return opSCHBS(1); } +uint32_t v60_device::opSCH0BSU() { return opSCHBS(0); } +uint32_t v60_device::opSCH1BSU() { return opSCHBS(1); } -UINT32 v60_device::opINSBFR() +uint32_t v60_device::opINSBFR() { - UINT32 appw; + uint32_t appw; F7cDecodeOperands(&v60_device::ReadAM, 2,&v60_device::BitReadAMAddress, 11); F7CCREATEBITMASK(m_lenop1); @@ -676,9 +676,9 @@ UINT32 v60_device::opINSBFR() F7CEND(); } -UINT32 v60_device::opINSBFL() +uint32_t v60_device::opINSBFL() { - UINT32 appw; + uint32_t appw; F7cDecodeOperands(&v60_device::ReadAM, 2,&v60_device::BitReadAMAddress, 11); m_op1 >>= (32 - m_lenop1); @@ -697,10 +697,10 @@ UINT32 v60_device::opINSBFL() F7CEND(); } -UINT32 v60_device::opMOVBSD() +uint32_t v60_device::opMOVBSD() { - UINT32 i; - UINT8 srcdata, dstdata; + uint32_t i; + uint8_t srcdata, dstdata; F7bDecodeOperands(&v60_device::BitReadAMAddress, 10, &v60_device::BitReadAMAddress, 10); @@ -753,10 +753,10 @@ UINT32 v60_device::opMOVBSD() F7BEND(); } -UINT32 v60_device::opMOVBSU() +uint32_t v60_device::opMOVBSU() { - UINT32 i; - UINT8 srcdata, dstdata; + uint32_t i; + uint8_t srcdata, dstdata; F7bDecodeOperands(&v60_device::BitReadAMAddress, 10, &v60_device::BitReadAMAddress, 10); @@ -804,10 +804,10 @@ UINT32 v60_device::opMOVBSU() // RADM 0x20f4b8 holds the time left -UINT32 v60_device::opADDDC() +uint32_t v60_device::opADDDC() { - UINT8 appb; - UINT8 src, dst; + uint8_t appb; + uint8_t src, dst; F7cDecodeOperands(&v60_device::ReadAM, 0, &v60_device::ReadAMAddress, 0); @@ -818,7 +818,7 @@ UINT32 v60_device::opADDDC() F7CLOADOP2BYTE(appb); - src = (UINT8)(m_op1 >> 4) * 10 + (UINT8)(m_op1 & 0xF); + src = (uint8_t)(m_op1 >> 4) * 10 + (uint8_t)(m_op1 & 0xF); dst = (appb >> 4) * 10 + (appb & 0xF); appb = src + dst + (_CY?1:0); @@ -843,10 +843,10 @@ UINT32 v60_device::opADDDC() F7CEND(); } -UINT32 v60_device::opSUBDC() +uint32_t v60_device::opSUBDC() { - INT8 appb; - UINT32 src, dst; + int8_t appb; + uint32_t src, dst; F7cDecodeOperands(&v60_device::ReadAM, 0, &v60_device::ReadAMAddress, 0); @@ -857,11 +857,11 @@ UINT32 v60_device::opSUBDC() F7CLOADOP2BYTE(appb); - src = (UINT32)(m_op1 >> 4) * 10 + (UINT32)(m_op1 & 0xF); + src = (uint32_t)(m_op1 >> 4) * 10 + (uint32_t)(m_op1 & 0xF); dst = ((appb & 0xF0) >> 4) * 10 + (appb & 0xF); // Note that this APPB must be SIGNED! - appb = (INT32)dst - (INT32)src - (_CY?1:0); + appb = (int32_t)dst - (int32_t)src - (_CY?1:0); if (appb < 0) { @@ -883,10 +883,10 @@ UINT32 v60_device::opSUBDC() F7CEND(); } -UINT32 v60_device::opSUBRDC() +uint32_t v60_device::opSUBRDC() { - INT8 appb; - UINT32 src, dst; + int8_t appb; + uint32_t src, dst; F7cDecodeOperands(&v60_device::ReadAM, 0, &v60_device::ReadAMAddress, 0); @@ -897,11 +897,11 @@ UINT32 v60_device::opSUBRDC() F7CLOADOP2BYTE(appb); - src = (UINT32)(m_op1 >> 4) * 10 + (UINT32)(m_op1 & 0xF); + src = (uint32_t)(m_op1 >> 4) * 10 + (uint32_t)(m_op1 & 0xF); dst = ((appb & 0xF0) >> 4) * 10 + (appb & 0xF); // Note that this APPB must be SIGNED! - appb = (INT32)src - (INT32)dst - (_CY?1:0); + appb = (int32_t)src - (int32_t)dst - (_CY?1:0); if (appb < 0) { @@ -923,13 +923,13 @@ UINT32 v60_device::opSUBRDC() F7CEND(); } -UINT32 v60_device::opCVTDPZ() +uint32_t v60_device::opCVTDPZ() { - UINT16 apph; + uint16_t apph; F7cDecodeOperands(&v60_device::ReadAM, 0, &v60_device::ReadAMAddress, 1); - apph = (UINT16)(((m_op1 >> 4) & 0xF) | ((m_op1 & 0xF) << 8)); + apph = (uint16_t)(((m_op1 >> 4) & 0xF) | ((m_op1 & 0xF) << 8)); apph |= (m_lenop1); apph |= (m_lenop1 << 8); @@ -940,9 +940,9 @@ UINT32 v60_device::opCVTDPZ() F7CEND(); } -UINT32 v60_device::opCVTDZP() +uint32_t v60_device::opCVTDZP() { - UINT8 appb; + uint8_t appb; F7cDecodeOperands(&v60_device::ReadAM, 1, &v60_device::ReadAMAddress, 0); if ((m_op1 & 0xF0) != (m_lenop1 & 0xF0) || ((m_op1 >> 8) & 0xF0) != (m_lenop1 & 0xF0)) @@ -957,38 +957,38 @@ UINT32 v60_device::opCVTDZP() logerror("CVTD.ZP Decimal exception #2!\n"); } - appb = (UINT8)(((m_op1 >> 8) & 0xF) | ((m_op1 & 0xF) << 4)); + appb = (uint8_t)(((m_op1 >> 8) & 0xF) | ((m_op1 & 0xF) << 4)); if (appb != 0) _Z = 0; F7CSTOREOP2BYTE(); F7CEND(); } -UINT32 v60_device::op58UNHANDLED() +uint32_t v60_device::op58UNHANDLED() { fatalerror("Unhandled 58 opcode at PC: /%06x\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::op5AUNHANDLED() +uint32_t v60_device::op5AUNHANDLED() { fatalerror("Unhandled 5A opcode at PC: /%06x\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::op5BUNHANDLED() +uint32_t v60_device::op5BUNHANDLED() { fatalerror("Unhandled 5B opcode at PC: /%06x\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::op5DUNHANDLED() +uint32_t v60_device::op5DUNHANDLED() { fatalerror("Unhandled 5D opcode at PC: /%06x\n", PC); return 0; /* never reached, fatalerror won't return */ } -UINT32 v60_device::op59UNHANDLED() +uint32_t v60_device::op59UNHANDLED() { fatalerror("Unhandled 59 opcode at PC: /%06x\n", PC); return 0; /* never reached, fatalerror won't return */ @@ -1176,35 +1176,35 @@ const v60_device::am_func v60_device::s_Op5ATable[32] = &v60_device::op5AUNHANDLED }; -UINT32 v60_device::op58() +uint32_t v60_device::op58() { m_subop = OpRead8(PC + 1); return (this->*s_Op58Table[m_subop & 0x1F])(); } -UINT32 v60_device::op5A() +uint32_t v60_device::op5A() { m_subop = OpRead8(PC + 1); return (this->*s_Op5ATable[m_subop & 0x1F])(); } -UINT32 v60_device::op5B() +uint32_t v60_device::op5B() { m_subop = OpRead8(PC + 1); return (this->*s_Op5BTable[m_subop & 0x1F])(); } -UINT32 v60_device::op5D() +uint32_t v60_device::op5D() { m_subop = OpRead8(PC + 1); return (this->*s_Op5DTable[m_subop & 0x1F])(); } -UINT32 v60_device::op59() +uint32_t v60_device::op59() { m_subop = OpRead8(PC + 1); diff --git a/src/devices/cpu/v60/v60.cpp b/src/devices/cpu/v60/v60.cpp index 009a7cf66a7..831a826c035 100644 --- a/src/devices/cpu/v60/v60.cpp +++ b/src/devices/cpu/v60/v60.cpp @@ -81,7 +81,7 @@ const device_type V60 = &device_creator; const device_type V70 = &device_creator; -v60_device::v60_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v60_device::v60_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, V60, "V60", tag, owner, clock, "v60", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0) , m_io_config("io", ENDIANNESS_LITTLE, 16, 24, 0) @@ -94,7 +94,7 @@ v60_device::v60_device(const machine_config &mconfig, const char *tag, device_t } -v60_device::v60_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) +v60_device::v60_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0) , m_io_config("io", ENDIANNESS_LITTLE, 16, 24, 0) @@ -106,20 +106,20 @@ v60_device::v60_device(const machine_config &mconfig, device_type type, const ch m_reg[45] = 0x00007000; } -v70_device::v70_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v70_device::v70_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : v60_device(mconfig, V70, "V70", tag, owner, clock, "v70", __FILE__) { } -offs_t v60_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t v60_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( v60 ); return CPU_DISASSEMBLE_NAME(v60)(this, buffer, pc, oprom, opram, options); } -offs_t v70_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t v70_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( v70 ); return CPU_DISASSEMBLE_NAME(v70)(this, buffer, pc, oprom, opram, options); @@ -158,14 +158,14 @@ offs_t v70_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opro #define SetCFB(x) {_CY = ((x) & 0x100) ? 1 : 0; } #define SetCFW(x) {_CY = ((x) & 0x10000) ? 1 : 0; } -#define SetCFL(x) {_CY = ((x) & (((UINT64)1) << 32)) ? 1 : 0; } +#define SetCFL(x) {_CY = ((x) & (((uint64_t)1) << 32)) ? 1 : 0; } #define SetSF(x) (_S = (x)) #define SetZF(x) (_Z = (x)) -#define SetSZPF_Byte(x) {_Z = ((UINT8)(x) == 0); _S = ((x)&0x80) ? 1 : 0; } -#define SetSZPF_Word(x) {_Z = ((UINT16)(x) == 0); _S = ((x)&0x8000) ? 1 : 0; } -#define SetSZPF_Long(x) {_Z = ((UINT32)(x) == 0); _S = ((x)&0x80000000) ? 1 : 0; } +#define SetSZPF_Byte(x) {_Z = ((uint8_t)(x) == 0); _S = ((x)&0x80) ? 1 : 0; } +#define SetSZPF_Word(x) {_Z = ((uint16_t)(x) == 0); _S = ((x)&0x8000) ? 1 : 0; } +#define SetSZPF_Long(x) {_Z = ((uint32_t)(x) == 0); _S = ((x)&0x80000000) ? 1 : 0; } #define ORB(dst, src) { (dst) |= (src); _CY = _OV = 0; SetSZPF_Byte(dst); } #define ORW(dst, src) { (dst) |= (src); _CY = _OV = 0; SetSZPF_Word(dst); } @@ -179,13 +179,13 @@ offs_t v70_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opro #define XORW(dst, src) { (dst) ^= (src); _CY = _OV = 0; SetSZPF_Word(dst); } #define XORL(dst, src) { (dst) ^= (src); _CY = _OV = 0; SetSZPF_Long(dst); } -#define SUBB(dst, src) { unsigned res = (dst) - (src); SetCFB(res); SetOFB_Sub(res, src, dst); SetSZPF_Byte(res); dst = (UINT8)res; } -#define SUBW(dst, src) { unsigned res = (dst) - (src); SetCFW(res); SetOFW_Sub(res, src, dst); SetSZPF_Word(res); dst = (UINT16)res; } -#define SUBL(dst, src) { UINT64 res = (UINT64)(dst) - (INT64)(src); SetCFL(res); SetOFL_Sub(res, src, dst); SetSZPF_Long(res); dst = (UINT32)res; } +#define SUBB(dst, src) { unsigned res = (dst) - (src); SetCFB(res); SetOFB_Sub(res, src, dst); SetSZPF_Byte(res); dst = (uint8_t)res; } +#define SUBW(dst, src) { unsigned res = (dst) - (src); SetCFW(res); SetOFW_Sub(res, src, dst); SetSZPF_Word(res); dst = (uint16_t)res; } +#define SUBL(dst, src) { uint64_t res = (uint64_t)(dst) - (int64_t)(src); SetCFL(res); SetOFL_Sub(res, src, dst); SetSZPF_Long(res); dst = (uint32_t)res; } -#define ADDB(dst, src) { unsigned res = (dst) + (src); SetCFB(res); SetOFB_Add(res, src, dst); SetSZPF_Byte(res); dst = (UINT8)res; } -#define ADDW(dst, src) { unsigned res = (dst) + (src); SetCFW(res); SetOFW_Add(res, src, dst); SetSZPF_Word(res); dst = (UINT16)res; } -#define ADDL(dst, src) { UINT64 res = (UINT64)(dst) + (UINT64)(src); SetCFL(res); SetOFL_Add(res, src, dst); SetSZPF_Long(res); dst = (UINT32)res; } +#define ADDB(dst, src) { unsigned res = (dst) + (src); SetCFB(res); SetOFB_Add(res, src, dst); SetSZPF_Byte(res); dst = (uint8_t)res; } +#define ADDW(dst, src) { unsigned res = (dst) + (src); SetCFW(res); SetOFW_Add(res, src, dst); SetSZPF_Word(res); dst = (uint16_t)res; } +#define ADDL(dst, src) { uint64_t res = (uint64_t)(dst) + (uint64_t)(src); SetCFL(res); SetOFL_Add(res, src, dst); SetSZPF_Long(res); dst = (uint32_t)res; } #define SETREG8(a, b) (a) = ((a) & ~0xff) | ((b) & 0xff) #define SETREG16(a, b) (a) = ((a) & ~0xffff) | ((b) & 0xffff) @@ -296,14 +296,14 @@ void v60_device::v60ReloadStack() SP = m_reg[37 + ((PSW >> 24) & 3)]; } -UINT32 v60_device::v60ReadPSW() +uint32_t v60_device::v60ReadPSW() { PSW &= 0xfffffff0; PSW |= (_Z?1:0) | (_S?2:0) | (_OV?4:0) | (_CY?8:0); return PSW; } -void v60_device::v60WritePSW(UINT32 newval) +void v60_device::v60WritePSW(uint32_t newval) { /* determine if we need to save / restore the stacks */ int updateStack = 0; @@ -322,10 +322,10 @@ void v60_device::v60WritePSW(UINT32 newval) /* set the new value and update the flags */ PSW = newval; - _Z = (UINT8)(PSW & 1); - _S = (UINT8)(PSW & 2); - _OV = (UINT8)(PSW & 4); - _CY = (UINT8)(PSW & 8); + _Z = (uint8_t)(PSW & 1); + _S = (uint8_t)(PSW & 2); + _OV = (uint8_t)(PSW & 4); + _CY = (uint8_t)(PSW & 8); /* fetch the new stack value */ if (updateStack) @@ -333,10 +333,10 @@ void v60_device::v60WritePSW(UINT32 newval) } -UINT32 v60_device::v60_update_psw_for_exception(int is_interrupt, int target_level) +uint32_t v60_device::v60_update_psw_for_exception(int is_interrupt, int target_level) { - UINT32 oldPSW = v60ReadPSW(); - UINT32 newPSW = oldPSW; + uint32_t oldPSW = v60ReadPSW(); + uint32_t newPSW = oldPSW; // Change to interrupt context newPSW &= ~(3 << 24); // PSW.EL = 0 @@ -371,7 +371,7 @@ UINT32 v60_device::v60_update_psw_for_exception(int is_interrupt, int target_lev #include "op6.hxx" #include "op7a.hxx" -UINT32 v60_device::opUNHANDLED() +uint32_t v60_device::opUNHANDLED() { fatalerror("Unhandled OpCode found : %02x at %08x\n", OpRead16(PC), PC); //return 0; /* never reached, fatalerror won't return */ @@ -552,7 +552,7 @@ void v60_device::stall() void v60_device::v60_do_irq(int vector) { - UINT32 oldPSW = v60_update_psw_for_exception(1, 0); + uint32_t oldPSW = v60_update_psw_for_exception(1, 0); // Push PC and PSW onto the stack SP-=4; @@ -608,7 +608,7 @@ void v60_device::execute_run() while (m_icount > 0) { - UINT32 inc; + uint32_t inc; m_PPC = PC; debugger_instruction_hook(this, PC); m_icount -= 8; /* fix me -- this is just an average */ diff --git a/src/devices/cpu/v60/v60.h b/src/devices/cpu/v60/v60.h index acb1c70bfcf..2b6fa22b298 100644 --- a/src/devices/cpu/v60/v60.h +++ b/src/devices/cpu/v60/v60.h @@ -84,8 +84,8 @@ class v60_device : public cpu_device { public: // construction/destruction - v60_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - v60_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); + v60_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + v60_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); void stall(); @@ -95,9 +95,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 1; } - virtual UINT32 execute_input_lines() const override { return 1; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 1; } + virtual uint32_t execute_input_lines() const override { return 1; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -109,13 +109,13 @@ protected: virtual void state_export(const device_state_entry &entry) override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 22; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 22; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: - typedef UINT32 (v60_device::*am_func)(); - typedef UINT32 (v60_device::*op6_func)(int reg); + typedef uint32_t (v60_device::*am_func)(); + typedef uint32_t (v60_device::*op6_func)(int reg); static const am_func s_AMTable1_G7a[16]; static const am_func s_BAMTable1_G7a[16]; @@ -153,618 +153,618 @@ private: offs_t m_fetch_xor; offs_t m_start_pc; - UINT32 m_reg[68]; + uint32_t m_reg[68]; struct { - UINT8 CY; - UINT8 OV; - UINT8 S; - UINT8 Z; + uint8_t CY; + uint8_t OV; + uint8_t S; + uint8_t Z; } m_flags; - UINT8 m_irq_line; - UINT8 m_nmi_line; + uint8_t m_irq_line; + uint8_t m_nmi_line; address_space *m_program; direct_read_data * m_direct; address_space *m_io; - UINT32 m_PPC; + uint32_t m_PPC; int m_icount; int m_stall_io; - UINT32 m_op1, m_op2; - UINT8 m_flag1, m_flag2; - UINT8 m_instflags; - UINT32 m_lenop1, m_lenop2; - UINT8 m_subop; - UINT32 m_bamoffset1, m_bamoffset2; + uint32_t m_op1, m_op2; + uint8_t m_flag1, m_flag2; + uint8_t m_instflags; + uint32_t m_lenop1, m_lenop2; + uint8_t m_subop; + uint32_t m_bamoffset1, m_bamoffset2; // Output variables for ReadAMAddress(cpustate) - UINT8 m_amflag; - UINT32 m_amout; - UINT32 m_bamoffset; + uint8_t m_amflag; + uint32_t m_amout; + uint32_t m_bamoffset; // Appo temp var - UINT32 m_amlength1, m_amlength2; + uint32_t m_amlength1, m_amlength2; // Global vars used by AM functions - UINT32 m_modadd; - UINT8 m_modm; - UINT8 m_modval; - UINT8 m_modval2; - UINT8 m_modwritevalb; - UINT16 m_modwritevalh; - UINT32 m_modwritevalw; - UINT8 m_moddim; + uint32_t m_modadd; + uint8_t m_modm; + uint8_t m_modval; + uint8_t m_modval2; + uint8_t m_modwritevalb; + uint16_t m_modwritevalh; + uint32_t m_modwritevalw; + uint8_t m_moddim; - UINT32 m_debugger_temp; + uint32_t m_debugger_temp; inline void v60SaveStack(); inline void v60ReloadStack(); - inline UINT32 v60ReadPSW(); - inline void v60WritePSW(UINT32 newval); - inline UINT32 v60_update_psw_for_exception(int is_interrupt, int target_level); + inline uint32_t v60ReadPSW(); + inline void v60WritePSW(uint32_t newval); + inline uint32_t v60_update_psw_for_exception(int is_interrupt, int target_level); - UINT32 am1Register(); - UINT32 am1RegisterIndirect(); - UINT32 bam1RegisterIndirect(); - UINT32 am1RegisterIndirectIndexed(); - UINT32 bam1RegisterIndirectIndexed(); - UINT32 am1Autoincrement(); - UINT32 bam1Autoincrement(); - UINT32 am1Autodecrement(); - UINT32 bam1Autodecrement(); - UINT32 am1Displacement8(); - UINT32 bam1Displacement8(); - UINT32 am1Displacement16(); - UINT32 bam1Displacement16(); - UINT32 am1Displacement32(); - UINT32 bam1Displacement32(); - UINT32 am1DisplacementIndexed8(); - UINT32 bam1DisplacementIndexed8(); - UINT32 am1DisplacementIndexed16(); - UINT32 bam1DisplacementIndexed16(); - UINT32 am1DisplacementIndexed32(); - UINT32 bam1DisplacementIndexed32(); - UINT32 am1PCDisplacement8(); - UINT32 bam1PCDisplacement8(); - UINT32 am1PCDisplacement16(); - UINT32 bam1PCDisplacement16(); - UINT32 am1PCDisplacement32(); - UINT32 bam1PCDisplacement32(); - UINT32 am1PCDisplacementIndexed8(); - UINT32 bam1PCDisplacementIndexed8(); - UINT32 am1PCDisplacementIndexed16(); - UINT32 bam1PCDisplacementIndexed16(); - UINT32 am1PCDisplacementIndexed32(); - UINT32 bam1PCDisplacementIndexed32(); - UINT32 am1DisplacementIndirect8(); - UINT32 bam1DisplacementIndirect8(); - UINT32 am1DisplacementIndirect16(); - UINT32 bam1DisplacementIndirect16(); - UINT32 am1DisplacementIndirect32(); - UINT32 bam1DisplacementIndirect32(); - UINT32 am1DisplacementIndirectIndexed8(); - UINT32 bam1DisplacementIndirectIndexed8(); - UINT32 am1DisplacementIndirectIndexed16(); - UINT32 bam1DisplacementIndirectIndexed16(); - UINT32 am1DisplacementIndirectIndexed32(); - UINT32 bam1DisplacementIndirectIndexed32(); - UINT32 am1PCDisplacementIndirect8(); - UINT32 bam1PCDisplacementIndirect8(); - UINT32 am1PCDisplacementIndirect16(); - UINT32 bam1PCDisplacementIndirect16(); - UINT32 am1PCDisplacementIndirect32(); - UINT32 bam1PCDisplacementIndirect32(); - UINT32 am1PCDisplacementIndirectIndexed8(); - UINT32 bam1PCDisplacementIndirectIndexed8(); - UINT32 am1PCDisplacementIndirectIndexed16(); - UINT32 bam1PCDisplacementIndirectIndexed16(); - UINT32 am1PCDisplacementIndirectIndexed32(); - UINT32 bam1PCDisplacementIndirectIndexed32(); - UINT32 am1DoubleDisplacement8(); - UINT32 bam1DoubleDisplacement8(); - UINT32 am1DoubleDisplacement16(); - UINT32 bam1DoubleDisplacement16(); - UINT32 am1DoubleDisplacement32(); - UINT32 bam1DoubleDisplacement32(); - UINT32 am1PCDoubleDisplacement8(); - UINT32 bam1PCDoubleDisplacement8(); - UINT32 am1PCDoubleDisplacement16(); - UINT32 bam1PCDoubleDisplacement16(); - UINT32 am1PCDoubleDisplacement32(); - UINT32 bam1PCDoubleDisplacement32(); - UINT32 am1DirectAddress(); - UINT32 bam1DirectAddress(); - UINT32 am1DirectAddressIndexed(); - UINT32 bam1DirectAddressIndexed(); - UINT32 am1DirectAddressDeferred(); - UINT32 bam1DirectAddressDeferred(); - UINT32 am1DirectAddressDeferredIndexed(); - UINT32 bam1DirectAddressDeferredIndexed(); - UINT32 am1Immediate(); - UINT32 am1ImmediateQuick(); - UINT32 am1Error1(); - UINT32 bam1Error1(); - UINT32 am1Error2(); - UINT32 bam1Error2(); - UINT32 am1Error4(); - UINT32 bam1Error4(); - UINT32 am1Error5(); - UINT32 bam1Error5(); - UINT32 bam1Error6(); - UINT32 am1Group7a(); - UINT32 bam1Group7a(); - UINT32 am1Group6(); - UINT32 bam1Group6(); - UINT32 am1Group7(); - UINT32 bam1Group7(); - UINT32 am2Register(); - UINT32 am2RegisterIndirect(); - UINT32 bam2RegisterIndirect(); - UINT32 am2RegisterIndirectIndexed(); - UINT32 bam2RegisterIndirectIndexed(); - UINT32 am2Autoincrement(); - UINT32 bam2Autoincrement(); - UINT32 am2Autodecrement(); - UINT32 bam2Autodecrement(); - UINT32 am2Displacement8(); - UINT32 bam2Displacement8(); - UINT32 am2Displacement16(); - UINT32 bam2Displacement16(); - UINT32 am2Displacement32(); - UINT32 bam2Displacement32(); - UINT32 am2DisplacementIndexed8(); - UINT32 bam2DisplacementIndexed8(); - UINT32 am2DisplacementIndexed16(); - UINT32 bam2DisplacementIndexed16(); - UINT32 am2DisplacementIndexed32(); - UINT32 bam2DisplacementIndexed32(); - UINT32 am2PCDisplacement8(); - UINT32 bam2PCDisplacement8(); - UINT32 am2PCDisplacement16(); - UINT32 bam2PCDisplacement16(); - UINT32 am2PCDisplacement32(); - UINT32 bam2PCDisplacement32(); - UINT32 am2PCDisplacementIndexed8(); - UINT32 bam2PCDisplacementIndexed8(); - UINT32 am2PCDisplacementIndexed16(); - UINT32 bam2PCDisplacementIndexed16(); - UINT32 am2PCDisplacementIndexed32(); - UINT32 bam2PCDisplacementIndexed32(); - UINT32 am2DisplacementIndirect8(); - UINT32 bam2DisplacementIndirect8(); - UINT32 am2DisplacementIndirect16(); - UINT32 bam2DisplacementIndirect16(); - UINT32 am2DisplacementIndirect32(); - UINT32 bam2DisplacementIndirect32(); - UINT32 am2DisplacementIndirectIndexed8(); - UINT32 bam2DisplacementIndirectIndexed8(); - UINT32 am2DisplacementIndirectIndexed16(); - UINT32 bam2DisplacementIndirectIndexed16(); - UINT32 am2DisplacementIndirectIndexed32(); - UINT32 bam2DisplacementIndirectIndexed32(); - UINT32 am2PCDisplacementIndirect8(); - UINT32 bam2PCDisplacementIndirect8(); - UINT32 am2PCDisplacementIndirect16(); - UINT32 bam2PCDisplacementIndirect16(); - UINT32 am2PCDisplacementIndirect32(); - UINT32 bam2PCDisplacementIndirect32(); - UINT32 am2PCDisplacementIndirectIndexed8(); - UINT32 bam2PCDisplacementIndirectIndexed8(); - UINT32 am2PCDisplacementIndirectIndexed16(); - UINT32 bam2PCDisplacementIndirectIndexed16(); - UINT32 am2PCDisplacementIndirectIndexed32(); - UINT32 bam2PCDisplacementIndirectIndexed32(); - UINT32 am2DoubleDisplacement8(); - UINT32 bam2DoubleDisplacement8(); - UINT32 am2DoubleDisplacement16(); - UINT32 bam2DoubleDisplacement16(); - UINT32 am2DoubleDisplacement32(); - UINT32 bam2DoubleDisplacement32(); - UINT32 am2PCDoubleDisplacement8(); - UINT32 bam2PCDoubleDisplacement8(); - UINT32 am2PCDoubleDisplacement16(); - UINT32 bam2PCDoubleDisplacement16(); - UINT32 am2PCDoubleDisplacement32(); - UINT32 bam2PCDoubleDisplacement32(); - UINT32 am2DirectAddress(); - UINT32 bam2DirectAddress(); - UINT32 am2DirectAddressIndexed(); - UINT32 bam2DirectAddressIndexed(); - UINT32 am2DirectAddressDeferred(); - UINT32 bam2DirectAddressDeferred(); - UINT32 am2DirectAddressDeferredIndexed(); - UINT32 bam2DirectAddressDeferredIndexed(); - UINT32 am2Immediate(); - UINT32 am2ImmediateQuick(); - UINT32 am2Error1(); - UINT32 am2Error2(); - UINT32 am2Error4(); - UINT32 am2Error5(); - UINT32 bam2Error1(); - UINT32 bam2Error2(); - UINT32 bam2Error4(); - UINT32 bam2Error5(); - UINT32 bam2Error6(); - UINT32 am2Group7a(); - UINT32 bam2Group7a(); - UINT32 am2Group6(); - UINT32 bam2Group6(); - UINT32 am2Group7(); - UINT32 bam2Group7(); - UINT32 am3Register(); - UINT32 am3RegisterIndirect(); - UINT32 am3RegisterIndirectIndexed(); - UINT32 am3Autoincrement(); - UINT32 am3Autodecrement(); - UINT32 am3Displacement8(); - UINT32 am3Displacement16(); - UINT32 am3Displacement32(); - UINT32 am3DisplacementIndexed8(); - UINT32 am3DisplacementIndexed16(); - UINT32 am3DisplacementIndexed32(); - UINT32 am3PCDisplacement8(); - UINT32 am3PCDisplacement16(); - UINT32 am3PCDisplacement32(); - UINT32 am3PCDisplacementIndexed8(); - UINT32 am3PCDisplacementIndexed16(); - UINT32 am3PCDisplacementIndexed32(); - UINT32 am3DisplacementIndirect8(); - UINT32 am3DisplacementIndirect16(); - UINT32 am3DisplacementIndirect32(); - UINT32 am3DisplacementIndirectIndexed8(); - UINT32 am3DisplacementIndirectIndexed16(); - UINT32 am3DisplacementIndirectIndexed32(); - UINT32 am3PCDisplacementIndirect8(); - UINT32 am3PCDisplacementIndirect16(); - UINT32 am3PCDisplacementIndirect32(); - UINT32 am3PCDisplacementIndirectIndexed8(); - UINT32 am3PCDisplacementIndirectIndexed16(); - UINT32 am3PCDisplacementIndirectIndexed32(); - UINT32 am3DoubleDisplacement8(); - UINT32 am3DoubleDisplacement16(); - UINT32 am3DoubleDisplacement32(); - UINT32 am3PCDoubleDisplacement8(); - UINT32 am3PCDoubleDisplacement16(); - UINT32 am3PCDoubleDisplacement32(); - UINT32 am3DirectAddress(); - UINT32 am3DirectAddressIndexed(); - UINT32 am3DirectAddressDeferred(); - UINT32 am3DirectAddressDeferredIndexed(); - UINT32 am3Immediate(); - UINT32 am3ImmediateQuick(); - UINT32 am3Error1(); - UINT32 am3Error2(); - UINT32 am3Error4(); - UINT32 am3Error5(); - UINT32 am3Group7a(); - UINT32 am3Group6(); - UINT32 am3Group7(); - UINT32 ReadAM(); - UINT32 BitReadAM(); - UINT32 ReadAMAddress(); - UINT32 BitReadAMAddress(); - UINT32 WriteAM(); - void F12DecodeFirstOperand(am_func DecodeOp1, UINT8 dim1); - void F12WriteSecondOperand(UINT8 dim2); - void F12DecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func DecodeOp2, UINT8 dim2); - UINT32 opADDB(); - UINT32 opADDH(); - UINT32 opADDW(); - UINT32 opADDCB(); - UINT32 opADDCH(); - UINT32 opADDCW(); - UINT32 opANDB(); - UINT32 opANDH(); - UINT32 opANDW(); - UINT32 opCALL(); - UINT32 opCHKAR(); - UINT32 opCHKAW(); - UINT32 opCHKAE(); - UINT32 opCHLVL(); - UINT32 opCLR1(); - UINT32 opCMPB(); - UINT32 opCMPH(); - UINT32 opCMPW(); - UINT32 opDIVB(); - UINT32 opDIVH(); - UINT32 opDIVW(); - UINT32 opDIVX(); - UINT32 opDIVUX(); - UINT32 opDIVUB(); - UINT32 opDIVUH(); - UINT32 opDIVUW(); - UINT32 opINB(); - UINT32 opINH(); - UINT32 opINW(); - UINT32 opLDPR(); - UINT32 opLDTASK(); - UINT32 opMOVD(); - UINT32 opMOVB(); - UINT32 opMOVH(); - UINT32 opMOVW(); - UINT32 opMOVEAB(); - UINT32 opMOVEAH(); - UINT32 opMOVEAW(); - UINT32 opMOVSBH(); - UINT32 opMOVSBW(); - UINT32 opMOVSHW(); - UINT32 opMOVTHB(); - UINT32 opMOVTWB(); - UINT32 opMOVTWH(); - UINT32 opMOVZBH(); - UINT32 opMOVZBW(); - UINT32 opMOVZHW(); - UINT32 opMULB(); - UINT32 opMULH(); - UINT32 opMULW(); - UINT32 opMULUB(); - UINT32 opMULUH(); - UINT32 opMULUW(); - UINT32 opNEGB(); - UINT32 opNEGH(); - UINT32 opNEGW(); - UINT32 opNOTB(); - UINT32 opNOTH(); - UINT32 opNOTW(); - UINT32 opNOT1(); - UINT32 opORB(); - UINT32 opORH(); - UINT32 opORW(); - UINT32 opOUTB(); - UINT32 opOUTH(); - UINT32 opOUTW(); - UINT32 opREMB(); - UINT32 opREMH(); - UINT32 opREMW(); - UINT32 opREMUB(); - UINT32 opREMUH(); - UINT32 opREMUW(); - UINT32 opROTB(); - UINT32 opROTH(); - UINT32 opROTW(); - UINT32 opROTCB(); - UINT32 opROTCH(); - UINT32 opROTCW(); - UINT32 opRVBIT(); - UINT32 opRVBYT(); - UINT32 opSET1(); - UINT32 opSETF(); - UINT32 opSHAB(); - UINT32 opSHAH(); - UINT32 opSHAW(); - UINT32 opSHLB(); - UINT32 opSHLH(); - UINT32 opSHLW(); - UINT32 opSTPR(); - UINT32 opSUBB(); - UINT32 opSUBH(); - UINT32 opSUBW(); - UINT32 opSUBCB(); - UINT32 opSUBCH(); - UINT32 opSUBCW(); - UINT32 opTEST1(); - UINT32 opUPDPSWW(); - UINT32 opUPDPSWH(); - UINT32 opXCHB(); - UINT32 opXCHH(); - UINT32 opXCHW(); - UINT32 opXORB(); - UINT32 opXORH(); - UINT32 opXORW(); - UINT32 opMULX(); - UINT32 opMULUX(); - void F2DecodeFirstOperand(am_func DecodeOp1, UINT8 dim1); - void F2DecodeSecondOperand(am_func DecodeOp2, UINT8 dim2); - void F2WriteSecondOperand(UINT8 dim2); - UINT32 opCVTWS(); - UINT32 opCVTSW(); - UINT32 opMOVFS(); - UINT32 opNEGFS(); - UINT32 opABSFS(); - UINT32 opADDFS(); - UINT32 opSUBFS(); - UINT32 opMULFS(); - UINT32 opDIVFS(); - UINT32 opSCLFS(); - UINT32 opCMPF(); - UINT32 op5FUNHANDLED(); - UINT32 op5CUNHANDLED(); - UINT32 op5F(); - UINT32 op5C(); - UINT32 opINCB(); - UINT32 opINCH(); - UINT32 opINCW(); - UINT32 opDECB(); - UINT32 opDECH(); - UINT32 opDECW(); - UINT32 opJMP(); - UINT32 opJSR(); - UINT32 opPREPARE(); - UINT32 opRET(); - UINT32 opTRAP(); - UINT32 opRETIU(); - UINT32 opRETIS(); - UINT32 opSTTASK(); - UINT32 opGETPSW(); - UINT32 opTASI(); - UINT32 opCLRTLB(); - UINT32 opPOPM(); - UINT32 opPUSHM(); - UINT32 opTESTB(); - UINT32 opTESTH(); - UINT32 opTESTW(); - UINT32 opPUSH(); - UINT32 opPOP(); - UINT32 opINCB_0(); - UINT32 opINCB_1(); - UINT32 opINCH_0(); - UINT32 opINCH_1(); - UINT32 opINCW_0(); - UINT32 opINCW_1(); - UINT32 opDECB_0(); - UINT32 opDECB_1(); - UINT32 opDECH_0(); - UINT32 opDECH_1(); - UINT32 opDECW_0(); - UINT32 opDECW_1(); - UINT32 opJMP_0(); - UINT32 opJMP_1(); - UINT32 opJSR_0(); - UINT32 opJSR_1(); - UINT32 opPREPARE_0(); - UINT32 opPREPARE_1(); - UINT32 opRET_0(); - UINT32 opRET_1(); - UINT32 opTRAP_0(); - UINT32 opTRAP_1(); - UINT32 opRETIU_0(); - UINT32 opRETIU_1(); - UINT32 opRETIS_0(); - UINT32 opRETIS_1(); - UINT32 opGETPSW_0(); - UINT32 opGETPSW_1(); - UINT32 opTASI_0(); - UINT32 opTASI_1(); - UINT32 opCLRTLB_0(); - UINT32 opCLRTLB_1(); - UINT32 opPOPM_0(); - UINT32 opPOPM_1(); - UINT32 opPUSHM_0(); - UINT32 opPUSHM_1(); - UINT32 opTESTB_0(); - UINT32 opTESTB_1(); - UINT32 opTESTH_0(); - UINT32 opTESTH_1(); - UINT32 opTESTW_0(); - UINT32 opTESTW_1(); - UINT32 opPUSH_0(); - UINT32 opPUSH_1(); - UINT32 opPOP_0(); - UINT32 opPOP_1(); - UINT32 opSTTASK_0(); - UINT32 opSTTASK_1(); - UINT32 opBGT8(); - UINT32 opBGT16(); - UINT32 opBGE8(); - UINT32 opBGE16(); - UINT32 opBLT8(); - UINT32 opBLT16(); - UINT32 opBLE8(); - UINT32 opBLE16(); - UINT32 opBH8(); - UINT32 opBH16(); - UINT32 opBNH8(); - UINT32 opBNH16(); - UINT32 opBNL8(); - UINT32 opBNL16(); - UINT32 opBL8(); - UINT32 opBL16(); - UINT32 opBNE8(); - UINT32 opBNE16(); - UINT32 opBE8(); - UINT32 opBE16(); - UINT32 opBNV8(); - UINT32 opBNV16(); - UINT32 opBV8(); - UINT32 opBV16(); - UINT32 opBP8(); - UINT32 opBP16(); - UINT32 opBN8(); - UINT32 opBN16(); - UINT32 opBR8(); - UINT32 opBR16(); - UINT32 opBSR(); - UINT32 opBRK(); - UINT32 opBRKV(); - UINT32 opCLRTLBA(); - UINT32 opDISPOSE(); - UINT32 opHALT(); - UINT32 opNOP(); - UINT32 opRSR(); - UINT32 opTRAPFL(); - UINT32 opTB(int reg); - UINT32 opDBGT(int reg); - UINT32 opDBLE(int reg); - UINT32 opDBGE(int reg); - UINT32 opDBLT(int reg); - UINT32 opDBH(int reg); - UINT32 opDBNH(int reg); - UINT32 opDBL(int reg); - UINT32 opDBNL(int reg); - UINT32 opDBE(int reg); - UINT32 opDBNE(int reg); - UINT32 opDBV(int reg); - UINT32 opDBNV(int reg); - UINT32 opDBN(int reg); - UINT32 opDBP(int reg); - UINT32 opDBR(int reg); - UINT32 opC6(); - UINT32 opC7(); - void F7aDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func DecodeOp2, UINT8 dim2); - void F7bDecodeFirstOperand(am_func DecodeOp1, UINT8 dim1); - void F7bWriteSecondOperand(UINT8 dim2); - void F7bDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func DecodeOp2, UINT8 dim2); - void F7cDecodeOperands(am_func DecodeOp1, UINT8 dim1, am_func DecodeOp2, UINT8 dim2); - UINT32 opCMPSTRB(UINT8 bFill, UINT8 bStop); - UINT32 opCMPSTRH(UINT8 bFill, UINT8 bStop); - UINT32 opMOVSTRUB(UINT8 bFill, UINT8 bStop); - UINT32 opMOVSTRDB(UINT8 bFill, UINT8 bStop); - UINT32 opMOVSTRUH(UINT8 bFill, UINT8 bStop); - UINT32 opMOVSTRDH(UINT8 bFill, UINT8 bStop); - UINT32 opSEARCHUB(UINT8 bSearch); - UINT32 opSEARCHUH(UINT8 bSearch); - UINT32 opSEARCHDB(UINT8 bSearch); - UINT32 opSEARCHDH(UINT8 bSearch); - UINT32 opSCHCUB(); - UINT32 opSCHCUH(); - UINT32 opSCHCDB(); - UINT32 opSCHCDH(); - UINT32 opSKPCUB(); - UINT32 opSKPCUH(); - UINT32 opSKPCDB(); - UINT32 opSKPCDH(); - UINT32 opCMPCB(); - UINT32 opCMPCH(); - UINT32 opCMPCFB(); - UINT32 opCMPCFH(); - UINT32 opCMPCSB(); - UINT32 opCMPCSH(); - UINT32 opMOVCUB(); - UINT32 opMOVCUH(); - UINT32 opMOVCFUB(); - UINT32 opMOVCFUH(); - UINT32 opMOVCSUB(); - UINT32 opMOVCSUH(); - UINT32 opMOVCDB(); - UINT32 opMOVCDH(); - UINT32 opMOVCFDB(); - UINT32 opMOVCFDH(); - UINT32 opEXTBFZ(); - UINT32 opEXTBFS(); - UINT32 opEXTBFL(); - UINT32 opSCHBS(UINT32 bSearch1); - UINT32 opSCH0BSU(); - UINT32 opSCH1BSU(); - UINT32 opINSBFR(); - UINT32 opINSBFL(); - UINT32 opMOVBSD(); - UINT32 opMOVBSU(); - UINT32 opADDDC(); - UINT32 opSUBDC(); - UINT32 opSUBRDC(); - UINT32 opCVTDPZ(); - UINT32 opCVTDZP(); - UINT32 op58UNHANDLED(); - UINT32 op5AUNHANDLED(); - UINT32 op5BUNHANDLED(); - UINT32 op5DUNHANDLED(); - UINT32 op59UNHANDLED(); - UINT32 op58(); - UINT32 op5A(); - UINT32 op5B(); - UINT32 op5D(); - UINT32 op59(); - UINT32 opUNHANDLED(); + uint32_t am1Register(); + uint32_t am1RegisterIndirect(); + uint32_t bam1RegisterIndirect(); + uint32_t am1RegisterIndirectIndexed(); + uint32_t bam1RegisterIndirectIndexed(); + uint32_t am1Autoincrement(); + uint32_t bam1Autoincrement(); + uint32_t am1Autodecrement(); + uint32_t bam1Autodecrement(); + uint32_t am1Displacement8(); + uint32_t bam1Displacement8(); + uint32_t am1Displacement16(); + uint32_t bam1Displacement16(); + uint32_t am1Displacement32(); + uint32_t bam1Displacement32(); + uint32_t am1DisplacementIndexed8(); + uint32_t bam1DisplacementIndexed8(); + uint32_t am1DisplacementIndexed16(); + uint32_t bam1DisplacementIndexed16(); + uint32_t am1DisplacementIndexed32(); + uint32_t bam1DisplacementIndexed32(); + uint32_t am1PCDisplacement8(); + uint32_t bam1PCDisplacement8(); + uint32_t am1PCDisplacement16(); + uint32_t bam1PCDisplacement16(); + uint32_t am1PCDisplacement32(); + uint32_t bam1PCDisplacement32(); + uint32_t am1PCDisplacementIndexed8(); + uint32_t bam1PCDisplacementIndexed8(); + uint32_t am1PCDisplacementIndexed16(); + uint32_t bam1PCDisplacementIndexed16(); + uint32_t am1PCDisplacementIndexed32(); + uint32_t bam1PCDisplacementIndexed32(); + uint32_t am1DisplacementIndirect8(); + uint32_t bam1DisplacementIndirect8(); + uint32_t am1DisplacementIndirect16(); + uint32_t bam1DisplacementIndirect16(); + uint32_t am1DisplacementIndirect32(); + uint32_t bam1DisplacementIndirect32(); + uint32_t am1DisplacementIndirectIndexed8(); + uint32_t bam1DisplacementIndirectIndexed8(); + uint32_t am1DisplacementIndirectIndexed16(); + uint32_t bam1DisplacementIndirectIndexed16(); + uint32_t am1DisplacementIndirectIndexed32(); + uint32_t bam1DisplacementIndirectIndexed32(); + uint32_t am1PCDisplacementIndirect8(); + uint32_t bam1PCDisplacementIndirect8(); + uint32_t am1PCDisplacementIndirect16(); + uint32_t bam1PCDisplacementIndirect16(); + uint32_t am1PCDisplacementIndirect32(); + uint32_t bam1PCDisplacementIndirect32(); + uint32_t am1PCDisplacementIndirectIndexed8(); + uint32_t bam1PCDisplacementIndirectIndexed8(); + uint32_t am1PCDisplacementIndirectIndexed16(); + uint32_t bam1PCDisplacementIndirectIndexed16(); + uint32_t am1PCDisplacementIndirectIndexed32(); + uint32_t bam1PCDisplacementIndirectIndexed32(); + uint32_t am1DoubleDisplacement8(); + uint32_t bam1DoubleDisplacement8(); + uint32_t am1DoubleDisplacement16(); + uint32_t bam1DoubleDisplacement16(); + uint32_t am1DoubleDisplacement32(); + uint32_t bam1DoubleDisplacement32(); + uint32_t am1PCDoubleDisplacement8(); + uint32_t bam1PCDoubleDisplacement8(); + uint32_t am1PCDoubleDisplacement16(); + uint32_t bam1PCDoubleDisplacement16(); + uint32_t am1PCDoubleDisplacement32(); + uint32_t bam1PCDoubleDisplacement32(); + uint32_t am1DirectAddress(); + uint32_t bam1DirectAddress(); + uint32_t am1DirectAddressIndexed(); + uint32_t bam1DirectAddressIndexed(); + uint32_t am1DirectAddressDeferred(); + uint32_t bam1DirectAddressDeferred(); + uint32_t am1DirectAddressDeferredIndexed(); + uint32_t bam1DirectAddressDeferredIndexed(); + uint32_t am1Immediate(); + uint32_t am1ImmediateQuick(); + uint32_t am1Error1(); + uint32_t bam1Error1(); + uint32_t am1Error2(); + uint32_t bam1Error2(); + uint32_t am1Error4(); + uint32_t bam1Error4(); + uint32_t am1Error5(); + uint32_t bam1Error5(); + uint32_t bam1Error6(); + uint32_t am1Group7a(); + uint32_t bam1Group7a(); + uint32_t am1Group6(); + uint32_t bam1Group6(); + uint32_t am1Group7(); + uint32_t bam1Group7(); + uint32_t am2Register(); + uint32_t am2RegisterIndirect(); + uint32_t bam2RegisterIndirect(); + uint32_t am2RegisterIndirectIndexed(); + uint32_t bam2RegisterIndirectIndexed(); + uint32_t am2Autoincrement(); + uint32_t bam2Autoincrement(); + uint32_t am2Autodecrement(); + uint32_t bam2Autodecrement(); + uint32_t am2Displacement8(); + uint32_t bam2Displacement8(); + uint32_t am2Displacement16(); + uint32_t bam2Displacement16(); + uint32_t am2Displacement32(); + uint32_t bam2Displacement32(); + uint32_t am2DisplacementIndexed8(); + uint32_t bam2DisplacementIndexed8(); + uint32_t am2DisplacementIndexed16(); + uint32_t bam2DisplacementIndexed16(); + uint32_t am2DisplacementIndexed32(); + uint32_t bam2DisplacementIndexed32(); + uint32_t am2PCDisplacement8(); + uint32_t bam2PCDisplacement8(); + uint32_t am2PCDisplacement16(); + uint32_t bam2PCDisplacement16(); + uint32_t am2PCDisplacement32(); + uint32_t bam2PCDisplacement32(); + uint32_t am2PCDisplacementIndexed8(); + uint32_t bam2PCDisplacementIndexed8(); + uint32_t am2PCDisplacementIndexed16(); + uint32_t bam2PCDisplacementIndexed16(); + uint32_t am2PCDisplacementIndexed32(); + uint32_t bam2PCDisplacementIndexed32(); + uint32_t am2DisplacementIndirect8(); + uint32_t bam2DisplacementIndirect8(); + uint32_t am2DisplacementIndirect16(); + uint32_t bam2DisplacementIndirect16(); + uint32_t am2DisplacementIndirect32(); + uint32_t bam2DisplacementIndirect32(); + uint32_t am2DisplacementIndirectIndexed8(); + uint32_t bam2DisplacementIndirectIndexed8(); + uint32_t am2DisplacementIndirectIndexed16(); + uint32_t bam2DisplacementIndirectIndexed16(); + uint32_t am2DisplacementIndirectIndexed32(); + uint32_t bam2DisplacementIndirectIndexed32(); + uint32_t am2PCDisplacementIndirect8(); + uint32_t bam2PCDisplacementIndirect8(); + uint32_t am2PCDisplacementIndirect16(); + uint32_t bam2PCDisplacementIndirect16(); + uint32_t am2PCDisplacementIndirect32(); + uint32_t bam2PCDisplacementIndirect32(); + uint32_t am2PCDisplacementIndirectIndexed8(); + uint32_t bam2PCDisplacementIndirectIndexed8(); + uint32_t am2PCDisplacementIndirectIndexed16(); + uint32_t bam2PCDisplacementIndirectIndexed16(); + uint32_t am2PCDisplacementIndirectIndexed32(); + uint32_t bam2PCDisplacementIndirectIndexed32(); + uint32_t am2DoubleDisplacement8(); + uint32_t bam2DoubleDisplacement8(); + uint32_t am2DoubleDisplacement16(); + uint32_t bam2DoubleDisplacement16(); + uint32_t am2DoubleDisplacement32(); + uint32_t bam2DoubleDisplacement32(); + uint32_t am2PCDoubleDisplacement8(); + uint32_t bam2PCDoubleDisplacement8(); + uint32_t am2PCDoubleDisplacement16(); + uint32_t bam2PCDoubleDisplacement16(); + uint32_t am2PCDoubleDisplacement32(); + uint32_t bam2PCDoubleDisplacement32(); + uint32_t am2DirectAddress(); + uint32_t bam2DirectAddress(); + uint32_t am2DirectAddressIndexed(); + uint32_t bam2DirectAddressIndexed(); + uint32_t am2DirectAddressDeferred(); + uint32_t bam2DirectAddressDeferred(); + uint32_t am2DirectAddressDeferredIndexed(); + uint32_t bam2DirectAddressDeferredIndexed(); + uint32_t am2Immediate(); + uint32_t am2ImmediateQuick(); + uint32_t am2Error1(); + uint32_t am2Error2(); + uint32_t am2Error4(); + uint32_t am2Error5(); + uint32_t bam2Error1(); + uint32_t bam2Error2(); + uint32_t bam2Error4(); + uint32_t bam2Error5(); + uint32_t bam2Error6(); + uint32_t am2Group7a(); + uint32_t bam2Group7a(); + uint32_t am2Group6(); + uint32_t bam2Group6(); + uint32_t am2Group7(); + uint32_t bam2Group7(); + uint32_t am3Register(); + uint32_t am3RegisterIndirect(); + uint32_t am3RegisterIndirectIndexed(); + uint32_t am3Autoincrement(); + uint32_t am3Autodecrement(); + uint32_t am3Displacement8(); + uint32_t am3Displacement16(); + uint32_t am3Displacement32(); + uint32_t am3DisplacementIndexed8(); + uint32_t am3DisplacementIndexed16(); + uint32_t am3DisplacementIndexed32(); + uint32_t am3PCDisplacement8(); + uint32_t am3PCDisplacement16(); + uint32_t am3PCDisplacement32(); + uint32_t am3PCDisplacementIndexed8(); + uint32_t am3PCDisplacementIndexed16(); + uint32_t am3PCDisplacementIndexed32(); + uint32_t am3DisplacementIndirect8(); + uint32_t am3DisplacementIndirect16(); + uint32_t am3DisplacementIndirect32(); + uint32_t am3DisplacementIndirectIndexed8(); + uint32_t am3DisplacementIndirectIndexed16(); + uint32_t am3DisplacementIndirectIndexed32(); + uint32_t am3PCDisplacementIndirect8(); + uint32_t am3PCDisplacementIndirect16(); + uint32_t am3PCDisplacementIndirect32(); + uint32_t am3PCDisplacementIndirectIndexed8(); + uint32_t am3PCDisplacementIndirectIndexed16(); + uint32_t am3PCDisplacementIndirectIndexed32(); + uint32_t am3DoubleDisplacement8(); + uint32_t am3DoubleDisplacement16(); + uint32_t am3DoubleDisplacement32(); + uint32_t am3PCDoubleDisplacement8(); + uint32_t am3PCDoubleDisplacement16(); + uint32_t am3PCDoubleDisplacement32(); + uint32_t am3DirectAddress(); + uint32_t am3DirectAddressIndexed(); + uint32_t am3DirectAddressDeferred(); + uint32_t am3DirectAddressDeferredIndexed(); + uint32_t am3Immediate(); + uint32_t am3ImmediateQuick(); + uint32_t am3Error1(); + uint32_t am3Error2(); + uint32_t am3Error4(); + uint32_t am3Error5(); + uint32_t am3Group7a(); + uint32_t am3Group6(); + uint32_t am3Group7(); + uint32_t ReadAM(); + uint32_t BitReadAM(); + uint32_t ReadAMAddress(); + uint32_t BitReadAMAddress(); + uint32_t WriteAM(); + void F12DecodeFirstOperand(am_func DecodeOp1, uint8_t dim1); + void F12WriteSecondOperand(uint8_t dim2); + void F12DecodeOperands(am_func DecodeOp1, uint8_t dim1, am_func DecodeOp2, uint8_t dim2); + uint32_t opADDB(); + uint32_t opADDH(); + uint32_t opADDW(); + uint32_t opADDCB(); + uint32_t opADDCH(); + uint32_t opADDCW(); + uint32_t opANDB(); + uint32_t opANDH(); + uint32_t opANDW(); + uint32_t opCALL(); + uint32_t opCHKAR(); + uint32_t opCHKAW(); + uint32_t opCHKAE(); + uint32_t opCHLVL(); + uint32_t opCLR1(); + uint32_t opCMPB(); + uint32_t opCMPH(); + uint32_t opCMPW(); + uint32_t opDIVB(); + uint32_t opDIVH(); + uint32_t opDIVW(); + uint32_t opDIVX(); + uint32_t opDIVUX(); + uint32_t opDIVUB(); + uint32_t opDIVUH(); + uint32_t opDIVUW(); + uint32_t opINB(); + uint32_t opINH(); + uint32_t opINW(); + uint32_t opLDPR(); + uint32_t opLDTASK(); + uint32_t opMOVD(); + uint32_t opMOVB(); + uint32_t opMOVH(); + uint32_t opMOVW(); + uint32_t opMOVEAB(); + uint32_t opMOVEAH(); + uint32_t opMOVEAW(); + uint32_t opMOVSBH(); + uint32_t opMOVSBW(); + uint32_t opMOVSHW(); + uint32_t opMOVTHB(); + uint32_t opMOVTWB(); + uint32_t opMOVTWH(); + uint32_t opMOVZBH(); + uint32_t opMOVZBW(); + uint32_t opMOVZHW(); + uint32_t opMULB(); + uint32_t opMULH(); + uint32_t opMULW(); + uint32_t opMULUB(); + uint32_t opMULUH(); + uint32_t opMULUW(); + uint32_t opNEGB(); + uint32_t opNEGH(); + uint32_t opNEGW(); + uint32_t opNOTB(); + uint32_t opNOTH(); + uint32_t opNOTW(); + uint32_t opNOT1(); + uint32_t opORB(); + uint32_t opORH(); + uint32_t opORW(); + uint32_t opOUTB(); + uint32_t opOUTH(); + uint32_t opOUTW(); + uint32_t opREMB(); + uint32_t opREMH(); + uint32_t opREMW(); + uint32_t opREMUB(); + uint32_t opREMUH(); + uint32_t opREMUW(); + uint32_t opROTB(); + uint32_t opROTH(); + uint32_t opROTW(); + uint32_t opROTCB(); + uint32_t opROTCH(); + uint32_t opROTCW(); + uint32_t opRVBIT(); + uint32_t opRVBYT(); + uint32_t opSET1(); + uint32_t opSETF(); + uint32_t opSHAB(); + uint32_t opSHAH(); + uint32_t opSHAW(); + uint32_t opSHLB(); + uint32_t opSHLH(); + uint32_t opSHLW(); + uint32_t opSTPR(); + uint32_t opSUBB(); + uint32_t opSUBH(); + uint32_t opSUBW(); + uint32_t opSUBCB(); + uint32_t opSUBCH(); + uint32_t opSUBCW(); + uint32_t opTEST1(); + uint32_t opUPDPSWW(); + uint32_t opUPDPSWH(); + uint32_t opXCHB(); + uint32_t opXCHH(); + uint32_t opXCHW(); + uint32_t opXORB(); + uint32_t opXORH(); + uint32_t opXORW(); + uint32_t opMULX(); + uint32_t opMULUX(); + void F2DecodeFirstOperand(am_func DecodeOp1, uint8_t dim1); + void F2DecodeSecondOperand(am_func DecodeOp2, uint8_t dim2); + void F2WriteSecondOperand(uint8_t dim2); + uint32_t opCVTWS(); + uint32_t opCVTSW(); + uint32_t opMOVFS(); + uint32_t opNEGFS(); + uint32_t opABSFS(); + uint32_t opADDFS(); + uint32_t opSUBFS(); + uint32_t opMULFS(); + uint32_t opDIVFS(); + uint32_t opSCLFS(); + uint32_t opCMPF(); + uint32_t op5FUNHANDLED(); + uint32_t op5CUNHANDLED(); + uint32_t op5F(); + uint32_t op5C(); + uint32_t opINCB(); + uint32_t opINCH(); + uint32_t opINCW(); + uint32_t opDECB(); + uint32_t opDECH(); + uint32_t opDECW(); + uint32_t opJMP(); + uint32_t opJSR(); + uint32_t opPREPARE(); + uint32_t opRET(); + uint32_t opTRAP(); + uint32_t opRETIU(); + uint32_t opRETIS(); + uint32_t opSTTASK(); + uint32_t opGETPSW(); + uint32_t opTASI(); + uint32_t opCLRTLB(); + uint32_t opPOPM(); + uint32_t opPUSHM(); + uint32_t opTESTB(); + uint32_t opTESTH(); + uint32_t opTESTW(); + uint32_t opPUSH(); + uint32_t opPOP(); + uint32_t opINCB_0(); + uint32_t opINCB_1(); + uint32_t opINCH_0(); + uint32_t opINCH_1(); + uint32_t opINCW_0(); + uint32_t opINCW_1(); + uint32_t opDECB_0(); + uint32_t opDECB_1(); + uint32_t opDECH_0(); + uint32_t opDECH_1(); + uint32_t opDECW_0(); + uint32_t opDECW_1(); + uint32_t opJMP_0(); + uint32_t opJMP_1(); + uint32_t opJSR_0(); + uint32_t opJSR_1(); + uint32_t opPREPARE_0(); + uint32_t opPREPARE_1(); + uint32_t opRET_0(); + uint32_t opRET_1(); + uint32_t opTRAP_0(); + uint32_t opTRAP_1(); + uint32_t opRETIU_0(); + uint32_t opRETIU_1(); + uint32_t opRETIS_0(); + uint32_t opRETIS_1(); + uint32_t opGETPSW_0(); + uint32_t opGETPSW_1(); + uint32_t opTASI_0(); + uint32_t opTASI_1(); + uint32_t opCLRTLB_0(); + uint32_t opCLRTLB_1(); + uint32_t opPOPM_0(); + uint32_t opPOPM_1(); + uint32_t opPUSHM_0(); + uint32_t opPUSHM_1(); + uint32_t opTESTB_0(); + uint32_t opTESTB_1(); + uint32_t opTESTH_0(); + uint32_t opTESTH_1(); + uint32_t opTESTW_0(); + uint32_t opTESTW_1(); + uint32_t opPUSH_0(); + uint32_t opPUSH_1(); + uint32_t opPOP_0(); + uint32_t opPOP_1(); + uint32_t opSTTASK_0(); + uint32_t opSTTASK_1(); + uint32_t opBGT8(); + uint32_t opBGT16(); + uint32_t opBGE8(); + uint32_t opBGE16(); + uint32_t opBLT8(); + uint32_t opBLT16(); + uint32_t opBLE8(); + uint32_t opBLE16(); + uint32_t opBH8(); + uint32_t opBH16(); + uint32_t opBNH8(); + uint32_t opBNH16(); + uint32_t opBNL8(); + uint32_t opBNL16(); + uint32_t opBL8(); + uint32_t opBL16(); + uint32_t opBNE8(); + uint32_t opBNE16(); + uint32_t opBE8(); + uint32_t opBE16(); + uint32_t opBNV8(); + uint32_t opBNV16(); + uint32_t opBV8(); + uint32_t opBV16(); + uint32_t opBP8(); + uint32_t opBP16(); + uint32_t opBN8(); + uint32_t opBN16(); + uint32_t opBR8(); + uint32_t opBR16(); + uint32_t opBSR(); + uint32_t opBRK(); + uint32_t opBRKV(); + uint32_t opCLRTLBA(); + uint32_t opDISPOSE(); + uint32_t opHALT(); + uint32_t opNOP(); + uint32_t opRSR(); + uint32_t opTRAPFL(); + uint32_t opTB(int reg); + uint32_t opDBGT(int reg); + uint32_t opDBLE(int reg); + uint32_t opDBGE(int reg); + uint32_t opDBLT(int reg); + uint32_t opDBH(int reg); + uint32_t opDBNH(int reg); + uint32_t opDBL(int reg); + uint32_t opDBNL(int reg); + uint32_t opDBE(int reg); + uint32_t opDBNE(int reg); + uint32_t opDBV(int reg); + uint32_t opDBNV(int reg); + uint32_t opDBN(int reg); + uint32_t opDBP(int reg); + uint32_t opDBR(int reg); + uint32_t opC6(); + uint32_t opC7(); + void F7aDecodeOperands(am_func DecodeOp1, uint8_t dim1, am_func DecodeOp2, uint8_t dim2); + void F7bDecodeFirstOperand(am_func DecodeOp1, uint8_t dim1); + void F7bWriteSecondOperand(uint8_t dim2); + void F7bDecodeOperands(am_func DecodeOp1, uint8_t dim1, am_func DecodeOp2, uint8_t dim2); + void F7cDecodeOperands(am_func DecodeOp1, uint8_t dim1, am_func DecodeOp2, uint8_t dim2); + uint32_t opCMPSTRB(uint8_t bFill, uint8_t bStop); + uint32_t opCMPSTRH(uint8_t bFill, uint8_t bStop); + uint32_t opMOVSTRUB(uint8_t bFill, uint8_t bStop); + uint32_t opMOVSTRDB(uint8_t bFill, uint8_t bStop); + uint32_t opMOVSTRUH(uint8_t bFill, uint8_t bStop); + uint32_t opMOVSTRDH(uint8_t bFill, uint8_t bStop); + uint32_t opSEARCHUB(uint8_t bSearch); + uint32_t opSEARCHUH(uint8_t bSearch); + uint32_t opSEARCHDB(uint8_t bSearch); + uint32_t opSEARCHDH(uint8_t bSearch); + uint32_t opSCHCUB(); + uint32_t opSCHCUH(); + uint32_t opSCHCDB(); + uint32_t opSCHCDH(); + uint32_t opSKPCUB(); + uint32_t opSKPCUH(); + uint32_t opSKPCDB(); + uint32_t opSKPCDH(); + uint32_t opCMPCB(); + uint32_t opCMPCH(); + uint32_t opCMPCFB(); + uint32_t opCMPCFH(); + uint32_t opCMPCSB(); + uint32_t opCMPCSH(); + uint32_t opMOVCUB(); + uint32_t opMOVCUH(); + uint32_t opMOVCFUB(); + uint32_t opMOVCFUH(); + uint32_t opMOVCSUB(); + uint32_t opMOVCSUH(); + uint32_t opMOVCDB(); + uint32_t opMOVCDH(); + uint32_t opMOVCFDB(); + uint32_t opMOVCFDH(); + uint32_t opEXTBFZ(); + uint32_t opEXTBFS(); + uint32_t opEXTBFL(); + uint32_t opSCHBS(uint32_t bSearch1); + uint32_t opSCH0BSU(); + uint32_t opSCH1BSU(); + uint32_t opINSBFR(); + uint32_t opINSBFL(); + uint32_t opMOVBSD(); + uint32_t opMOVBSU(); + uint32_t opADDDC(); + uint32_t opSUBDC(); + uint32_t opSUBRDC(); + uint32_t opCVTDPZ(); + uint32_t opCVTDZP(); + uint32_t op58UNHANDLED(); + uint32_t op5AUNHANDLED(); + uint32_t op5BUNHANDLED(); + uint32_t op5DUNHANDLED(); + uint32_t op59UNHANDLED(); + uint32_t op58(); + uint32_t op5A(); + uint32_t op5B(); + uint32_t op5D(); + uint32_t op59(); + uint32_t opUNHANDLED(); void v60_do_irq(int vector); void v60_try_irq(); @@ -775,10 +775,10 @@ class v70_device : public v60_device { public: // construction/destruction - v70_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v70_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; }; diff --git a/src/devices/cpu/v60/v60d.cpp b/src/devices/cpu/v60/v60d.cpp index a32268fc2b4..f30298080c3 100644 --- a/src/devices/cpu/v60/v60d.cpp +++ b/src/devices/cpu/v60/v60d.cpp @@ -26,7 +26,7 @@ static const char *const v60_reg_names[69] = { "ADTMR1","Reserved","Reserved","Reserved" }; -static const UINT8 *rombase; +static const uint8_t *rombase; static offs_t pcbase; #define readop(a) rombase[(a) - pcbase] diff --git a/src/devices/cpu/v810/v810.cpp b/src/devices/cpu/v810/v810.cpp index 4e03c000747..ba002562548 100644 --- a/src/devices/cpu/v810/v810.cpp +++ b/src/devices/cpu/v810/v810.cpp @@ -38,7 +38,7 @@ const device_type V810 = &device_creator; -v810_device::v810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v810_device::v810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, V810, "V810", tag, owner, clock, "v810", __FILE__) , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0) , m_io_config("io", ENDIANNESS_LITTLE, 32, 32, 0) @@ -46,7 +46,7 @@ v810_device::v810_device(const machine_config &mconfig, const char *tag, device_ } -offs_t v810_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t v810_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( v810 ); return CPU_DISASSEMBLE_NAME(v810)(this, buffer, pc, oprom, opram, options); @@ -150,25 +150,25 @@ offs_t v810_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr #define D9(x) ((x&0x1ff)|((x&0x100)?0xfffffe00:0)) #define SO(opcode) (((opcode)&0xfc00)>>10) -#define CHECK_CY(x) PSW=(PSW & ~8)|(((x) & (((UINT64)1) << 32)) ? 8 : 0) +#define CHECK_CY(x) PSW=(PSW & ~8)|(((x) & (((uint64_t)1) << 32)) ? 8 : 0) #define CHECK_OVADD(x,y,z) PSW=(PSW & ~0x00000004) |(( ((x) ^ (z)) & ((y) ^ (z)) & 0x80000000) ? 4: 0) #define CHECK_OVSUB(x,y,z) PSW=(PSW & ~0x00000004) |(( ((y) ^ (z)) & ((x) ^ (y)) & 0x80000000) ? 4: 0) -#define CHECK_ZS(x) PSW=(PSW & ~3)|((UINT32)(x)==0)|(((x)&0x80000000) ? 2: 0) +#define CHECK_ZS(x) PSW=(PSW & ~3)|((uint32_t)(x)==0)|(((x)&0x80000000) ? 2: 0) -#define ADD(dst, src) { UINT64 res=(UINT64)(dst)+(UINT64)(src); SetCF(res); SetOF_Add(res,src,dst); SetSZPF(res); dst=(UINT32)res; } -#define SUB(dst, src) { UINT64 res=(UINT64)(dst)-(INT64)(src); SetCF(res); SetOF_Sub(res,src,dst); SetSZPF(res); dst=(UINT32)res; } +#define ADD(dst, src) { uint64_t res=(uint64_t)(dst)+(uint64_t)(src); SetCF(res); SetOF_Add(res,src,dst); SetSZPF(res); dst=(uint32_t)res; } +#define SUB(dst, src) { uint64_t res=(uint64_t)(dst)-(int64_t)(src); SetCF(res); SetOF_Sub(res,src,dst); SetSZPF(res); dst=(uint32_t)res; } -void v810_device::SETREG(UINT32 reg,UINT32 val) +void v810_device::SETREG(uint32_t reg,uint32_t val) { if(reg) m_reg[reg]=val; } -UINT32 v810_device::GETREG(UINT32 reg) +uint32_t v810_device::GETREG(uint32_t reg) { if(reg) return m_reg[reg]; @@ -176,31 +176,31 @@ UINT32 v810_device::GETREG(UINT32 reg) return 0; } -UINT32 v810_device::opUNDEF(UINT32 op) +uint32_t v810_device::opUNDEF(uint32_t op) { logerror("V810: Unknown opcode %x @ %x",op,PC-2); return clkIF; } -UINT32 v810_device::opMOVr(UINT32 op) // mov reg1, reg2 +uint32_t v810_device::opMOVr(uint32_t op) // mov reg1, reg2 { SETREG(GET2,GETREG(GET1)); return clkIF; } -UINT32 v810_device::opMOVEA(UINT32 op) // movea imm16, reg1, reg2 +uint32_t v810_device::opMOVEA(uint32_t op) // movea imm16, reg1, reg2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=R_OP(PC); + uint32_t op1=GETREG(GET1); + uint32_t op2=R_OP(PC); PC+=2; op2=I16(op2); SETREG(GET2,op1+op2); return clkIF; } -UINT32 v810_device::opMOVHI(UINT32 op) // movhi imm16, reg1 ,reg2 +uint32_t v810_device::opMOVHI(uint32_t op) // movhi imm16, reg1 ,reg2 { - UINT32 op2=R_OP(PC); + uint32_t op2=R_OP(PC); PC+=2; op2=UI16(op2); op2<<=16; @@ -208,17 +208,17 @@ UINT32 v810_device::opMOVHI(UINT32 op) // movhi imm16, reg1 ,reg2 return clkIF; } -UINT32 v810_device::opMOVi(UINT32 op) // mov imm5,r2 +uint32_t v810_device::opMOVi(uint32_t op) // mov imm5,r2 { SETREG(GET2,I5(op)); return clkIF; } -UINT32 v810_device::opADDr(UINT32 op) // add r1,r2 +uint32_t v810_device::opADDr(uint32_t op) // add r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); - UINT64 res=(UINT64)op2+(UINT64)op1; + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); + uint64_t res=(uint64_t)op2+(uint64_t)op1; CHECK_CY(res); CHECK_OVADD(op1,op2,res); CHECK_ZS(res); @@ -226,11 +226,11 @@ UINT32 v810_device::opADDr(UINT32 op) // add r1,r2 return clkIF; } -UINT32 v810_device::opADDi(UINT32 op) // add imm5,r2 +uint32_t v810_device::opADDi(uint32_t op) // add imm5,r2 { - UINT32 op1=I5(op); - UINT32 op2=GETREG(GET2); - UINT64 res=(UINT64)op2+(UINT64)op1; + uint32_t op1=I5(op); + uint32_t op2=GETREG(GET2); + uint64_t res=(uint64_t)op2+(uint64_t)op1; CHECK_CY(res); CHECK_OVADD(op1,op2,res); CHECK_ZS(res); @@ -239,14 +239,14 @@ UINT32 v810_device::opADDi(UINT32 op) // add imm5,r2 } -UINT32 v810_device::opADDI(UINT32 op) // addi imm16, reg1, reg2 +uint32_t v810_device::opADDI(uint32_t op) // addi imm16, reg1, reg2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=R_OP(PC); - UINT64 res; + uint32_t op1=GETREG(GET1); + uint32_t op2=R_OP(PC); + uint64_t res; PC+=2; op2=I16(op2); - res=(UINT64)op2+(UINT64)op1; + res=(uint64_t)op2+(uint64_t)op1; CHECK_CY(res); CHECK_OVADD(op1,op2,res); CHECK_ZS(res); @@ -254,11 +254,11 @@ UINT32 v810_device::opADDI(UINT32 op) // addi imm16, reg1, reg2 return clkIF; } -UINT32 v810_device::opSUBr(UINT32 op) // sub r1,r2 +uint32_t v810_device::opSUBr(uint32_t op) // sub r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); - UINT64 res=(UINT64)op2-(UINT64)op1; + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); + uint64_t res=(uint64_t)op2-(uint64_t)op1; CHECK_CY(res); CHECK_OVSUB(op1,op2,res); CHECK_ZS(res); @@ -267,32 +267,32 @@ UINT32 v810_device::opSUBr(UINT32 op) // sub r1,r2 } -UINT32 v810_device::opCMPr(UINT32 op) // cmp r1,r2 +uint32_t v810_device::opCMPr(uint32_t op) // cmp r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); - UINT64 res=(UINT64)op2-(UINT64)op1; + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); + uint64_t res=(uint64_t)op2-(uint64_t)op1; CHECK_CY(res); CHECK_OVSUB(op1,op2,res); CHECK_ZS(res); return clkIF; } -UINT32 v810_device::opCMPi(UINT32 op) // cmpi imm5,r2 +uint32_t v810_device::opCMPi(uint32_t op) // cmpi imm5,r2 { - UINT32 op1=I5(op); - UINT32 op2=GETREG(GET2); - UINT64 res=(UINT64)op2-(UINT64)op1; + uint32_t op1=I5(op); + uint32_t op2=GETREG(GET2); + uint64_t res=(uint64_t)op2-(uint64_t)op1; CHECK_CY(res); CHECK_OVSUB(op1,op2,res); CHECK_ZS(res); return clkIF; } -UINT32 v810_device::opSETFi(UINT32 op) // setf imm5,r2 +uint32_t v810_device::opSETFi(uint32_t op) // setf imm5,r2 { - UINT32 op1=I5(op); - UINT8 res=0; + uint32_t op1=I5(op); + uint8_t res=0; op1&=0xf; switch(op1) { @@ -365,10 +365,10 @@ UINT32 v810_device::opSETFi(UINT32 op) // setf imm5,r2 } -UINT32 v810_device::opANDr(UINT32 op) // and r1,r2 +uint32_t v810_device::opANDr(uint32_t op) // and r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); op2&=op1; CHECK_ZS(op2); SET_OV(0); @@ -376,10 +376,10 @@ UINT32 v810_device::opANDr(UINT32 op) // and r1,r2 return clkIF; } -UINT32 v810_device::opANDI(UINT32 op) // andi imm16,r1,r2 +uint32_t v810_device::opANDI(uint32_t op) // andi imm16,r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=R_OP(PC); + uint32_t op1=GETREG(GET1); + uint32_t op2=R_OP(PC); PC+=2; op2=UI16(op2); op2&=op1; @@ -390,10 +390,10 @@ UINT32 v810_device::opANDI(UINT32 op) // andi imm16,r1,r2 return clkIF; } -UINT32 v810_device::opORr(UINT32 op) // or r1,r2 +uint32_t v810_device::opORr(uint32_t op) // or r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); op2|=op1; CHECK_ZS(op2); SET_OV(0); @@ -401,10 +401,10 @@ UINT32 v810_device::opORr(UINT32 op) // or r1,r2 return clkIF; } -UINT32 v810_device::opORI(UINT32 op) // ori imm16,r1,r2 +uint32_t v810_device::opORI(uint32_t op) // ori imm16,r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=R_OP(PC); + uint32_t op1=GETREG(GET1); + uint32_t op2=R_OP(PC); PC+=2; op2=UI16(op2); op2|=op1; @@ -415,10 +415,10 @@ UINT32 v810_device::opORI(UINT32 op) // ori imm16,r1,r2 return clkIF; } -UINT32 v810_device::opXORr(UINT32 op) // xor r1,r2 +uint32_t v810_device::opXORr(uint32_t op) // xor r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); op2^=op1; CHECK_ZS(op2); SET_OV(0); @@ -427,25 +427,25 @@ UINT32 v810_device::opXORr(UINT32 op) // xor r1,r2 } -UINT32 v810_device::opLDSR(UINT32 op) // ldsr reg2,regID +uint32_t v810_device::opLDSR(uint32_t op) // ldsr reg2,regID { - UINT32 op1=UI5(op); + uint32_t op1=UI5(op); SETREG(32+op1,GETREG(GET2)); return clkIF; } -UINT32 v810_device::opSTSR(UINT32 op) // ldsr regID,reg2 +uint32_t v810_device::opSTSR(uint32_t op) // ldsr regID,reg2 { - UINT32 op1=UI5(op); + uint32_t op1=UI5(op); SETREG(GET2,GETREG(32+op1)); return clkIF; } -UINT32 v810_device::opXORI(UINT32 op) // xori imm16,r1,r2 +uint32_t v810_device::opXORI(uint32_t op) // xori imm16,r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=R_OP(PC); + uint32_t op1=GETREG(GET1); + uint32_t op2=R_OP(PC); PC+=2; op2=UI16(op2); op2^=op1; @@ -456,20 +456,20 @@ UINT32 v810_device::opXORI(UINT32 op) // xori imm16,r1,r2 return clkIF; } -UINT32 v810_device::opNOTr(UINT32 op) // not r1,r2 +uint32_t v810_device::opNOTr(uint32_t op) // not r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=~op1; + uint32_t op1=GETREG(GET1); + uint32_t op2=~op1; CHECK_ZS(op2); SET_OV(0); SETREG(GET2,op2); return clkIF; } -UINT32 v810_device::opSHLr(UINT32 op) // shl r1,r2 +uint32_t v810_device::opSHLr(uint32_t op) // shl r1,r2 { - UINT64 tmp; - UINT32 count=GETREG(GET1); + uint64_t tmp; + uint32_t count=GETREG(GET1); count&=0x1f; SET_OV(0); @@ -486,10 +486,10 @@ UINT32 v810_device::opSHLr(UINT32 op) // shl r1,r2 return clkIF; } -UINT32 v810_device::opSHLi(UINT32 op) // shl imm5,r2 +uint32_t v810_device::opSHLi(uint32_t op) // shl imm5,r2 { - UINT64 tmp; - UINT32 count=UI5(op); + uint64_t tmp; + uint32_t count=UI5(op); SET_OV(0); SET_CY(0); @@ -505,10 +505,10 @@ UINT32 v810_device::opSHLi(UINT32 op) // shl imm5,r2 return clkIF; } -UINT32 v810_device::opSHRr(UINT32 op) // shr r1,r2 +uint32_t v810_device::opSHRr(uint32_t op) // shr r1,r2 { - UINT64 tmp; - UINT32 count=GETREG(GET1); + uint64_t tmp; + uint32_t count=GETREG(GET1); count&=0x1f; SET_OV(0); SET_CY(0); @@ -523,10 +523,10 @@ UINT32 v810_device::opSHRr(UINT32 op) // shr r1,r2 return clkIF; } -UINT32 v810_device::opSHRi(UINT32 op) // shr imm5,r2 +uint32_t v810_device::opSHRi(uint32_t op) // shr imm5,r2 { - UINT64 tmp; - UINT32 count=UI5(op); + uint64_t tmp; + uint32_t count=UI5(op); SET_OV(0); SET_CY(0); if(count) @@ -541,10 +541,10 @@ UINT32 v810_device::opSHRi(UINT32 op) // shr imm5,r2 return clkIF; } -UINT32 v810_device::opSARr(UINT32 op) // sar r1,r2 +uint32_t v810_device::opSARr(uint32_t op) // sar r1,r2 { - INT32 tmp; - UINT32 count=GETREG(GET1); + int32_t tmp; + uint32_t count=GETREG(GET1); count&=0x1f; SET_OV(0); SET_CY(0); @@ -560,10 +560,10 @@ UINT32 v810_device::opSARr(UINT32 op) // sar r1,r2 return clkIF; } -UINT32 v810_device::opSARi(UINT32 op) // sar imm5,r2 +uint32_t v810_device::opSARi(uint32_t op) // sar imm5,r2 { - INT32 tmp; - UINT32 count=UI5(op); + int32_t tmp; + uint32_t count=UI5(op); SET_OV(0); SET_CY(0); if(count) @@ -578,23 +578,23 @@ UINT32 v810_device::opSARi(UINT32 op) // sar imm5,r2 return clkIF; } -UINT32 v810_device::opJMPr(UINT32 op) +uint32_t v810_device::opJMPr(uint32_t op) { PC=GETREG(GET1)&~1; return clkIF+2; } -UINT32 v810_device::opJR(UINT32 op) +uint32_t v810_device::opJR(uint32_t op) { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC=PC-2+(D26(op,tmp)&~1); return clkIF+2; } -UINT32 v810_device::opJAL(UINT32 op) +uint32_t v810_device::opJAL(uint32_t op) { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; R31=PC; PC+=D26(op,tmp); @@ -604,25 +604,25 @@ UINT32 v810_device::opJAL(UINT32 op) } -UINT32 v810_device::opEI(UINT32 op) +uint32_t v810_device::opEI(uint32_t op) { SET_ID(0); return clkIF; } -UINT32 v810_device::opDI(UINT32 op) +uint32_t v810_device::opDI(uint32_t op) { SET_ID(1); return clkIF; } -UINT32 v810_device::opTRAP(UINT32 op) +uint32_t v810_device::opTRAP(uint32_t op) { printf("V810: TRAP @ %X\n",PC-2); return clkIF; } -UINT32 v810_device::opRETI(UINT32 op) +uint32_t v810_device::opRETI(uint32_t op) { if(GET_NP) { PC = FEPC; @@ -634,13 +634,13 @@ UINT32 v810_device::opRETI(UINT32 op) return clkIF; } -UINT32 v810_device::opHALT(UINT32 op) +uint32_t v810_device::opHALT(uint32_t op) { printf("V810: HALT @ %X\n",PC-2); return clkIF; } -UINT32 v810_device::opB(UINT32 op) +uint32_t v810_device::opB(uint32_t op) { int doBranch=0; switch((op>>9)&0xf) @@ -716,9 +716,9 @@ UINT32 v810_device::opB(UINT32 op) return clkIF; } -UINT32 v810_device::opLDB(UINT32 op) // ld.b disp16[reg1],reg2 +uint32_t v810_device::opLDB(uint32_t op) // ld.b disp16[reg1],reg2 { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -728,9 +728,9 @@ UINT32 v810_device::opLDB(UINT32 op) // ld.b disp16[reg1],reg2 return clkIF+clkMEM; } -UINT32 v810_device::opLDH(UINT32 op) // ld.h disp16[reg1],reg2 +uint32_t v810_device::opLDH(uint32_t op) // ld.h disp16[reg1],reg2 { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -740,9 +740,9 @@ UINT32 v810_device::opLDH(UINT32 op) // ld.h disp16[reg1],reg2 return clkIF+clkMEM; } -UINT32 v810_device::opLDW(UINT32 op) // ld.w disp16[reg1],reg2 +uint32_t v810_device::opLDW(uint32_t op) // ld.w disp16[reg1],reg2 { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -751,9 +751,9 @@ UINT32 v810_device::opLDW(UINT32 op) // ld.w disp16[reg1],reg2 return clkIF+clkMEM; } -UINT32 v810_device::opINB(UINT32 op) // in.b disp16[reg1],reg2 +uint32_t v810_device::opINB(uint32_t op) // in.b disp16[reg1],reg2 { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -762,16 +762,16 @@ UINT32 v810_device::opINB(UINT32 op) // in.b disp16[reg1],reg2 return clkIF+clkMEM; } -UINT32 v810_device::opCAXI(UINT32 op) // caxi disp16[reg1],reg2 +uint32_t v810_device::opCAXI(uint32_t op) // caxi disp16[reg1],reg2 { printf("V810 CAXI execute\n"); PC+=2; return clkIF; } -UINT32 v810_device::opINH(UINT32 op) // in.h disp16[reg1],reg2 +uint32_t v810_device::opINH(uint32_t op) // in.h disp16[reg1],reg2 { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -780,9 +780,9 @@ UINT32 v810_device::opINH(UINT32 op) // in.h disp16[reg1],reg2 return clkIF+clkMEM; } -UINT32 v810_device::opINW(UINT32 op) // in.w disp16[reg1],reg2 +uint32_t v810_device::opINW(uint32_t op) // in.w disp16[reg1],reg2 { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -791,9 +791,9 @@ UINT32 v810_device::opINW(UINT32 op) // in.w disp16[reg1],reg2 return clkIF+clkMEM; } -UINT32 v810_device::opSTB(UINT32 op) // st.b reg2, disp16[reg1] +uint32_t v810_device::opSTB(uint32_t op) // st.b reg2, disp16[reg1] { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -801,9 +801,9 @@ UINT32 v810_device::opSTB(UINT32 op) // st.b reg2, disp16[reg1] return clkIF+clkMEM; } -UINT32 v810_device::opSTH(UINT32 op) // st.h reg2, disp16[reg1] +uint32_t v810_device::opSTH(uint32_t op) // st.h reg2, disp16[reg1] { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -811,9 +811,9 @@ UINT32 v810_device::opSTH(UINT32 op) // st.h reg2, disp16[reg1] return clkIF+clkMEM; } -UINT32 v810_device::opSTW(UINT32 op) // st.w reg2, disp16[reg1] +uint32_t v810_device::opSTW(uint32_t op) // st.w reg2, disp16[reg1] { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -821,9 +821,9 @@ UINT32 v810_device::opSTW(UINT32 op) // st.w reg2, disp16[reg1] return clkIF+clkMEM; } -UINT32 v810_device::opOUTB(UINT32 op) // out.b reg2, disp16[reg1] +uint32_t v810_device::opOUTB(uint32_t op) // out.b reg2, disp16[reg1] { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -831,9 +831,9 @@ UINT32 v810_device::opOUTB(UINT32 op) // out.b reg2, disp16[reg1] return clkIF+clkMEM; } -UINT32 v810_device::opOUTH(UINT32 op) // out.h reg2, disp16[reg1] +uint32_t v810_device::opOUTH(uint32_t op) // out.h reg2, disp16[reg1] { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -841,9 +841,9 @@ UINT32 v810_device::opOUTH(UINT32 op) // out.h reg2, disp16[reg1] return clkIF+clkMEM; } -UINT32 v810_device::opOUTW(UINT32 op) // out.w reg2, disp16[reg1] +uint32_t v810_device::opOUTW(uint32_t op) // out.w reg2, disp16[reg1] { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; tmp=D16(tmp); tmp+=GETREG(GET1); @@ -851,12 +851,12 @@ UINT32 v810_device::opOUTW(UINT32 op) // out.w reg2, disp16[reg1] return clkIF+clkMEM; } -UINT32 v810_device::opMULr(UINT32 op) // mul r1,r2 +uint32_t v810_device::opMULr(uint32_t op) // mul r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); - UINT64 tmp; - tmp=(INT64)(INT32)op1*(INT64)(INT32)op2; + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); + uint64_t tmp; + tmp=(int64_t)(int32_t)op1*(int64_t)(int32_t)op2; op2=tmp&0xffffffff; tmp>>=32; CHECK_ZS(tmp);//z = bad! @@ -868,12 +868,12 @@ UINT32 v810_device::opMULr(UINT32 op) // mul r1,r2 return clkIF; } -UINT32 v810_device::opMULUr(UINT32 op) // mulu r1,r2 +uint32_t v810_device::opMULUr(uint32_t op) // mulu r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); - UINT64 tmp; - tmp=(UINT64)op1*(UINT64)op2; + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); + uint64_t tmp; + tmp=(uint64_t)op1*(uint64_t)op2; op2=tmp&0xffffffff; tmp>>=32; CHECK_ZS(tmp);//z = bad! @@ -885,14 +885,14 @@ UINT32 v810_device::opMULUr(UINT32 op) // mulu r1,r2 return clkIF; } -UINT32 v810_device::opDIVr(UINT32 op) // div r1,r2 +uint32_t v810_device::opDIVr(uint32_t op) // div r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); if(op1) { - SETREG(30,(INT32)((INT32)op2%(INT32)op1)); - SETREG(GET2,(INT32)((INT32)op2/(INT32)op1)); + SETREG(30,(int32_t)((int32_t)op2%(int32_t)op1)); + SETREG(GET2,(int32_t)((int32_t)op2/(int32_t)op1)); SET_OV((op1^op2^GETREG(GET2)) == 0x80000000); CHECK_ZS(GETREG(GET2)); } @@ -901,14 +901,14 @@ UINT32 v810_device::opDIVr(UINT32 op) // div r1,r2 return clkIF; } -UINT32 v810_device::opDIVUr(UINT32 op) // divu r1,r2 +uint32_t v810_device::opDIVUr(uint32_t op) // divu r1,r2 { - UINT32 op1=GETREG(GET1); - UINT32 op2=GETREG(GET2); + uint32_t op1=GETREG(GET1); + uint32_t op2=GETREG(GET2); if(op1) { - SETREG(30,(INT32)(op2%op1)); - SETREG(GET2,(INT32)(op2/op1)); + SETREG(30,(int32_t)(op2%op1)); + SETREG(GET2,(int32_t)(op2/op1)); SET_OV((op1^op2^GETREG(GET2)) == 0x80000000); CHECK_ZS(GETREG(GET2)); } @@ -917,7 +917,7 @@ UINT32 v810_device::opDIVUr(UINT32 op) // divu r1,r2 return clkIF; } -void v810_device::opADDF(UINT32 op) +void v810_device::opADDF(uint32_t op) { //TODO: CY float val1=u2f(GETREG(GET1)); @@ -929,7 +929,7 @@ void v810_device::opADDF(UINT32 op) SETREG(GET2,f2u(val2)); } -void v810_device::opSUBF(UINT32 op) +void v810_device::opSUBF(uint32_t op) { float val1=u2f(GETREG(GET1)); float val2=u2f(GETREG(GET2)); @@ -941,7 +941,7 @@ void v810_device::opSUBF(UINT32 op) SETREG(GET2,f2u(val2)); } -void v810_device::opMULF(UINT32 op) +void v810_device::opMULF(uint32_t op) { //TODO: CY float val1=u2f(GETREG(GET1)); @@ -953,7 +953,7 @@ void v810_device::opMULF(UINT32 op) SETREG(GET2,f2u(val2)); } -void v810_device::opDIVF(UINT32 op) +void v810_device::opDIVF(uint32_t op) { //TODO: CY float val1=u2f(GETREG(GET1)); @@ -968,16 +968,16 @@ void v810_device::opDIVF(UINT32 op) SETREG(GET2,f2u(val2)); } -void v810_device::opTRNC(UINT32 op) +void v810_device::opTRNC(uint32_t op) { float val1=u2f(GETREG(GET1)); SET_OV(0); SET_Z((val1==0.0f)?1:0); SET_S((val1<0.0f)?1:0); - SETREG(GET2,(INT32)val1); + SETREG(GET2,(int32_t)val1); } -void v810_device::opCMPF(UINT32 op) +void v810_device::opCMPF(uint32_t op) { float val1=u2f(GETREG(GET1)); float val2=u2f(GETREG(GET2)); @@ -988,26 +988,26 @@ void v810_device::opCMPF(UINT32 op) SET_S((val2<0.0f)?1:0); } -void v810_device::opCVTS(UINT32 op) +void v810_device::opCVTS(uint32_t op) { float val1=u2f(GETREG(GET1)); SET_OV(0); SET_Z((val1==0.0f)?1:0); SET_S((val1<0.0f)?1:0); - SETREG(GET2,(INT32)val1); + SETREG(GET2,(int32_t)val1); } -void v810_device::opCVTW(UINT32 op) +void v810_device::opCVTW(uint32_t op) { //TODO: CY - float val1=(INT32)GETREG(GET1); + float val1=(int32_t)GETREG(GET1); SET_OV(0); SET_Z((val1==0.0f)?1:0); SET_S((val1<0.0f)?1:0); SETREG(GET2,f2u(val1)); } -void v810_device::opMPYHW(UINT32 op) +void v810_device::opMPYHW(uint32_t op) { int val1=(GETREG(GET1) & 0xffff); int val2=(GETREG(GET2) & 0xffff); @@ -1018,7 +1018,7 @@ void v810_device::opMPYHW(UINT32 op) SETREG(GET2,val2); } -void v810_device::opXB(UINT32 op) +void v810_device::opXB(uint32_t op) { int val=GETREG(GET2); SET_OV(0); @@ -1029,7 +1029,7 @@ void v810_device::opXB(UINT32 op) } -void v810_device::opXH(UINT32 op) +void v810_device::opXH(uint32_t op) { int val=GETREG(GET2); SET_OV(0); @@ -1039,9 +1039,9 @@ void v810_device::opXH(UINT32 op) SETREG(GET2,val); } -UINT32 v810_device::opFpoint(UINT32 op) +uint32_t v810_device::opFpoint(uint32_t op) { - UINT32 tmp=R_OP(PC); + uint32_t tmp=R_OP(PC); PC+=2; switch((tmp&0xfc00)>>10) { @@ -1063,15 +1063,15 @@ UINT32 v810_device::opFpoint(UINT32 op) } /* TODO: clocks */ -UINT32 v810_device::opBSU(UINT32 op) +uint32_t v810_device::opBSU(uint32_t op) { if(!(op & 8)) fatalerror("V810: unknown BSU opcode %04x\n",op); { - UINT32 srcbit,dstbit,src,dst,size; - UINT32 dsttmp,tmp; - UINT8 srctmp; + uint32_t srcbit,dstbit,src,dst,size; + uint32_t dsttmp,tmp; + uint8_t srctmp; // printf("BDST %08x BSRC %08x SIZE %08x DST %08x SRC %08x\n",R26,R27,R28,R29,R30); @@ -1350,7 +1350,7 @@ void v810_device::take_interrupt() PC = 0xfffffe00 | (m_irq_line << 4); ECR = 0xfe00 | (m_irq_line << 4); - UINT8 num = m_irq_line + 1; + uint8_t num = m_irq_line + 1; if (num==0x10) num=0x0f; PSW &= 0xfff0ffff; // clear interrupt level @@ -1372,7 +1372,7 @@ void v810_device::execute_run() } while(m_icount>0) { - UINT32 op; + uint32_t op; m_PPC=PC; debugger_instruction_hook(this, PC); diff --git a/src/devices/cpu/v810/v810.h b/src/devices/cpu/v810/v810.h index 4e85ed7b540..7b9769cd3ff 100644 --- a/src/devices/cpu/v810/v810.h +++ b/src/devices/cpu/v810/v810.h @@ -83,7 +83,7 @@ class v810_device : public cpu_device { public: // construction/destruction - v810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -91,9 +91,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 3; } - virtual UINT32 execute_max_cycles() const override { return 6; } - virtual UINT32 execute_input_lines() const override { return 16; } + virtual uint32_t execute_min_cycles() const override { return 3; } + virtual uint32_t execute_max_cycles() const override { return 6; } + virtual uint32_t execute_input_lines() const override { return 16; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -104,95 +104,95 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: - typedef UINT32 (v810_device::*opcode_func)(UINT32 op); + typedef uint32_t (v810_device::*opcode_func)(uint32_t op); static const opcode_func s_OpCodeTable[64]; address_space_config m_program_config; address_space_config m_io_config; - UINT32 m_reg[65]; - UINT8 m_irq_line; - UINT8 m_irq_state; - UINT8 m_nmi_line; + uint32_t m_reg[65]; + uint8_t m_irq_line; + uint8_t m_irq_state; + uint8_t m_nmi_line; address_space *m_program; direct_read_data *m_direct; address_space *m_io; - UINT32 m_PPC; + uint32_t m_PPC; int m_icount; - inline void SETREG(UINT32 reg,UINT32 val); - inline UINT32 GETREG(UINT32 reg); - UINT32 opUNDEF(UINT32 op); - UINT32 opMOVr(UINT32 op); - UINT32 opMOVEA(UINT32 op); - UINT32 opMOVHI(UINT32 op); - UINT32 opMOVi(UINT32 op); - UINT32 opADDr(UINT32 op); - UINT32 opADDi(UINT32 op); - UINT32 opADDI(UINT32 op); - UINT32 opSUBr(UINT32 op); - UINT32 opCMPr(UINT32 op); - UINT32 opCMPi(UINT32 op); - UINT32 opSETFi(UINT32 op); - UINT32 opANDr(UINT32 op); - UINT32 opANDI(UINT32 op); - UINT32 opORr(UINT32 op); - UINT32 opORI(UINT32 op); - UINT32 opXORr(UINT32 op); - UINT32 opLDSR(UINT32 op); - UINT32 opSTSR(UINT32 op); - UINT32 opXORI(UINT32 op); - UINT32 opNOTr(UINT32 op); - UINT32 opSHLr(UINT32 op); - UINT32 opSHLi(UINT32 op); - UINT32 opSHRr(UINT32 op); - UINT32 opSHRi(UINT32 op); - UINT32 opSARr(UINT32 op); - UINT32 opSARi(UINT32 op); - UINT32 opJMPr(UINT32 op); - UINT32 opJR(UINT32 op); - UINT32 opJAL(UINT32 op); - UINT32 opEI(UINT32 op); - UINT32 opDI(UINT32 op); - UINT32 opTRAP(UINT32 op); - UINT32 opRETI(UINT32 op); - UINT32 opHALT(UINT32 op); - UINT32 opB(UINT32 op); - UINT32 opLDB(UINT32 op); - UINT32 opLDH(UINT32 op); - UINT32 opLDW(UINT32 op); - UINT32 opINB(UINT32 op); - UINT32 opCAXI(UINT32 op); - UINT32 opINH(UINT32 op); - UINT32 opINW(UINT32 op); - UINT32 opSTB(UINT32 op); - UINT32 opSTH(UINT32 op); - UINT32 opSTW(UINT32 op); - UINT32 opOUTB(UINT32 op); - UINT32 opOUTH(UINT32 op); - UINT32 opOUTW(UINT32 op); - UINT32 opMULr(UINT32 op); - UINT32 opMULUr(UINT32 op); - UINT32 opDIVr(UINT32 op); - UINT32 opDIVUr(UINT32 op); - void opADDF(UINT32 op); - void opSUBF(UINT32 op); - void opMULF(UINT32 op); - void opDIVF(UINT32 op); - void opTRNC(UINT32 op); - void opCMPF(UINT32 op); - void opCVTS(UINT32 op); - void opCVTW(UINT32 op); - void opMPYHW(UINT32 op); - void opXB(UINT32 op); - void opXH(UINT32 op); - UINT32 opFpoint(UINT32 op); - UINT32 opBSU(UINT32 op); + inline void SETREG(uint32_t reg,uint32_t val); + inline uint32_t GETREG(uint32_t reg); + uint32_t opUNDEF(uint32_t op); + uint32_t opMOVr(uint32_t op); + uint32_t opMOVEA(uint32_t op); + uint32_t opMOVHI(uint32_t op); + uint32_t opMOVi(uint32_t op); + uint32_t opADDr(uint32_t op); + uint32_t opADDi(uint32_t op); + uint32_t opADDI(uint32_t op); + uint32_t opSUBr(uint32_t op); + uint32_t opCMPr(uint32_t op); + uint32_t opCMPi(uint32_t op); + uint32_t opSETFi(uint32_t op); + uint32_t opANDr(uint32_t op); + uint32_t opANDI(uint32_t op); + uint32_t opORr(uint32_t op); + uint32_t opORI(uint32_t op); + uint32_t opXORr(uint32_t op); + uint32_t opLDSR(uint32_t op); + uint32_t opSTSR(uint32_t op); + uint32_t opXORI(uint32_t op); + uint32_t opNOTr(uint32_t op); + uint32_t opSHLr(uint32_t op); + uint32_t opSHLi(uint32_t op); + uint32_t opSHRr(uint32_t op); + uint32_t opSHRi(uint32_t op); + uint32_t opSARr(uint32_t op); + uint32_t opSARi(uint32_t op); + uint32_t opJMPr(uint32_t op); + uint32_t opJR(uint32_t op); + uint32_t opJAL(uint32_t op); + uint32_t opEI(uint32_t op); + uint32_t opDI(uint32_t op); + uint32_t opTRAP(uint32_t op); + uint32_t opRETI(uint32_t op); + uint32_t opHALT(uint32_t op); + uint32_t opB(uint32_t op); + uint32_t opLDB(uint32_t op); + uint32_t opLDH(uint32_t op); + uint32_t opLDW(uint32_t op); + uint32_t opINB(uint32_t op); + uint32_t opCAXI(uint32_t op); + uint32_t opINH(uint32_t op); + uint32_t opINW(uint32_t op); + uint32_t opSTB(uint32_t op); + uint32_t opSTH(uint32_t op); + uint32_t opSTW(uint32_t op); + uint32_t opOUTB(uint32_t op); + uint32_t opOUTH(uint32_t op); + uint32_t opOUTW(uint32_t op); + uint32_t opMULr(uint32_t op); + uint32_t opMULUr(uint32_t op); + uint32_t opDIVr(uint32_t op); + uint32_t opDIVUr(uint32_t op); + void opADDF(uint32_t op); + void opSUBF(uint32_t op); + void opMULF(uint32_t op); + void opDIVF(uint32_t op); + void opTRNC(uint32_t op); + void opCMPF(uint32_t op); + void opCVTS(uint32_t op); + void opCVTW(uint32_t op); + void opMPYHW(uint32_t op); + void opXB(uint32_t op); + void opXH(uint32_t op); + uint32_t opFpoint(uint32_t op); + uint32_t opBSU(uint32_t op); void take_interrupt(); }; diff --git a/src/devices/cpu/v810/v810dasm.cpp b/src/devices/cpu/v810/v810dasm.cpp index 2f541cc73c4..d45ff377f43 100644 --- a/src/devices/cpu/v810/v810dasm.cpp +++ b/src/devices/cpu/v810/v810dasm.cpp @@ -41,8 +41,8 @@ static const char *const dRegs[]= CPU_DISASSEMBLE( v810 ) { - UINT32 flags = 0; - UINT32 opc,opc2; + uint32_t flags = 0; + uint32_t opc,opc2; unsigned size; opc = oprom[0] | (oprom[1] << 8); opc2 = oprom[2] | (oprom[3] << 8); diff --git a/src/devices/cpu/x86emit.h b/src/devices/cpu/x86emit.h index f2a53332400..5494c0b5668 100644 --- a/src/devices/cpu/x86emit.h +++ b/src/devices/cpu/x86emit.h @@ -25,31 +25,31 @@ #define __X86EMIT_H__ // use x86code * to reference generated code -typedef UINT8 x86code; +typedef uint8_t x86code; // this structure tracks information about a link struct emit_link { x86code * target; - UINT8 size; + uint8_t size; }; // structure for describing memory references class x86_memref { public: - x86_memref(UINT8 basereg, UINT8 indreg, UINT8 scale, INT32 disp) + x86_memref(uint8_t basereg, uint8_t indreg, uint8_t scale, int32_t disp) : m_base(basereg), m_index(indreg), m_scale(scale), m_disp(disp) { } - x86_memref operator+(INT32 offset) { return x86_memref(m_base, m_index, m_scale, m_disp + offset); } + x86_memref operator+(int32_t offset) { return x86_memref(m_base, m_index, m_scale, m_disp + offset); } - UINT8 m_base; - UINT8 m_index; - UINT8 m_scale; - INT32 m_disp; + uint8_t m_base; + uint8_t m_index; + uint8_t m_scale; + int32_t m_disp; }; #endif @@ -78,9 +78,9 @@ namespace x64emit //************************************************************************** // opcode size flag; low 4 bits must match REX low 4 bits, hence the odd numbers here -const UINT8 OP_16BIT = 0x10; -const UINT8 OP_32BIT = 0x00; -const UINT8 OP_64BIT = 0x08; +const uint8_t OP_16BIT = 0x10; +const uint8_t OP_32BIT = 0x00; +const uint8_t OP_64BIT = 0x08; // 16 registers on x64, only 8 on x86 #if (X86EMIT_SIZE == 64) @@ -90,170 +90,170 @@ const int REG_MAX = 8; #endif // invalid register index for "none" -const UINT8 REG_NONE = REG_MAX; +const uint8_t REG_NONE = REG_MAX; // 8-bit registers -- note that we assume a flat model for 64-bit -const UINT8 REG_AL = 0; -const UINT8 REG_CL = 1; -const UINT8 REG_DL = 2; -const UINT8 REG_BL = 3; +const uint8_t REG_AL = 0; +const uint8_t REG_CL = 1; +const uint8_t REG_DL = 2; +const uint8_t REG_BL = 3; #if (X86EMIT_SIZE == 32) -const UINT8 REG_AH = 4; -const UINT8 REG_CH = 5; -const UINT8 REG_DH = 6; -const UINT8 REG_BH = 7; +const uint8_t REG_AH = 4; +const uint8_t REG_CH = 5; +const uint8_t REG_DH = 6; +const uint8_t REG_BH = 7; #else -const UINT8 REG_SPL = 4; -const UINT8 REG_BPL = 5; -const UINT8 REG_SIL = 6; -const UINT8 REG_DIL = 7; -const UINT8 REG_R8L = 8; -const UINT8 REG_R9L = 9; -const UINT8 REG_R10L = 10; -const UINT8 REG_R11L = 11; -const UINT8 REG_R12L = 12; -const UINT8 REG_R13L = 13; -const UINT8 REG_R14L = 14; -const UINT8 REG_R15L = 15; +const uint8_t REG_SPL = 4; +const uint8_t REG_BPL = 5; +const uint8_t REG_SIL = 6; +const uint8_t REG_DIL = 7; +const uint8_t REG_R8L = 8; +const uint8_t REG_R9L = 9; +const uint8_t REG_R10L = 10; +const uint8_t REG_R11L = 11; +const uint8_t REG_R12L = 12; +const uint8_t REG_R13L = 13; +const uint8_t REG_R14L = 14; +const uint8_t REG_R15L = 15; #endif // 16-bit registers -const UINT8 REG_AX = 0; -const UINT8 REG_CX = 1; -const UINT8 REG_DX = 2; -const UINT8 REG_BX = 3; -const UINT8 REG_SP = 4; -const UINT8 REG_BP = 5; -const UINT8 REG_SI = 6; -const UINT8 REG_DI = 7; +const uint8_t REG_AX = 0; +const uint8_t REG_CX = 1; +const uint8_t REG_DX = 2; +const uint8_t REG_BX = 3; +const uint8_t REG_SP = 4; +const uint8_t REG_BP = 5; +const uint8_t REG_SI = 6; +const uint8_t REG_DI = 7; #if (X86EMIT_SIZE == 64) -const UINT8 REG_R8W = 8; -const UINT8 REG_R9W = 9; -const UINT8 REG_R10W = 10; -const UINT8 REG_R11W = 11; -const UINT8 REG_R12W = 12; -const UINT8 REG_R13W = 13; -const UINT8 REG_R14W = 14; -const UINT8 REG_R15W = 15; +const uint8_t REG_R8W = 8; +const uint8_t REG_R9W = 9; +const uint8_t REG_R10W = 10; +const uint8_t REG_R11W = 11; +const uint8_t REG_R12W = 12; +const uint8_t REG_R13W = 13; +const uint8_t REG_R14W = 14; +const uint8_t REG_R15W = 15; #endif // 32-bit registers -const UINT8 REG_EAX = 0; -const UINT8 REG_ECX = 1; -const UINT8 REG_EDX = 2; -const UINT8 REG_EBX = 3; -const UINT8 REG_ESP = 4; -const UINT8 REG_EBP = 5; -const UINT8 REG_ESI = 6; -const UINT8 REG_EDI = 7; +const uint8_t REG_EAX = 0; +const uint8_t REG_ECX = 1; +const uint8_t REG_EDX = 2; +const uint8_t REG_EBX = 3; +const uint8_t REG_ESP = 4; +const uint8_t REG_EBP = 5; +const uint8_t REG_ESI = 6; +const uint8_t REG_EDI = 7; #if (X86EMIT_SIZE == 64) -const UINT8 REG_R8D = 8; -const UINT8 REG_R9D = 9; -const UINT8 REG_R10D = 10; -const UINT8 REG_R11D = 11; -const UINT8 REG_R12D = 12; -const UINT8 REG_R13D = 13; -const UINT8 REG_R14D = 14; -const UINT8 REG_R15D = 15; +const uint8_t REG_R8D = 8; +const uint8_t REG_R9D = 9; +const uint8_t REG_R10D = 10; +const uint8_t REG_R11D = 11; +const uint8_t REG_R12D = 12; +const uint8_t REG_R13D = 13; +const uint8_t REG_R14D = 14; +const uint8_t REG_R15D = 15; #endif // 64-bit registers #if (X86EMIT_SIZE == 64) -const UINT8 REG_RAX = 0; -const UINT8 REG_RCX = 1; -const UINT8 REG_RDX = 2; -const UINT8 REG_RBX = 3; -const UINT8 REG_RSP = 4; -const UINT8 REG_RBP = 5; -const UINT8 REG_RSI = 6; -const UINT8 REG_RDI = 7; -const UINT8 REG_R8 = 8; -const UINT8 REG_R9 = 9; -const UINT8 REG_R10 = 10; -const UINT8 REG_R11 = 11; -const UINT8 REG_R12 = 12; -const UINT8 REG_R13 = 13; -const UINT8 REG_R14 = 14; -const UINT8 REG_R15 = 15; +const uint8_t REG_RAX = 0; +const uint8_t REG_RCX = 1; +const uint8_t REG_RDX = 2; +const uint8_t REG_RBX = 3; +const uint8_t REG_RSP = 4; +const uint8_t REG_RBP = 5; +const uint8_t REG_RSI = 6; +const uint8_t REG_RDI = 7; +const uint8_t REG_R8 = 8; +const uint8_t REG_R9 = 9; +const uint8_t REG_R10 = 10; +const uint8_t REG_R11 = 11; +const uint8_t REG_R12 = 12; +const uint8_t REG_R13 = 13; +const uint8_t REG_R14 = 14; +const uint8_t REG_R15 = 15; #endif // 64-bit MMX registers -const UINT8 REG_MM0 = 0; -const UINT8 REG_MM1 = 1; -const UINT8 REG_MM2 = 2; -const UINT8 REG_MM3 = 3; -const UINT8 REG_MM4 = 4; -const UINT8 REG_MM5 = 5; -const UINT8 REG_MM6 = 6; -const UINT8 REG_MM7 = 7; +const uint8_t REG_MM0 = 0; +const uint8_t REG_MM1 = 1; +const uint8_t REG_MM2 = 2; +const uint8_t REG_MM3 = 3; +const uint8_t REG_MM4 = 4; +const uint8_t REG_MM5 = 5; +const uint8_t REG_MM6 = 6; +const uint8_t REG_MM7 = 7; #if (X86EMIT_SIZE == 64) -const UINT8 REG_MM8 = 8; -const UINT8 REG_MM9 = 9; -const UINT8 REG_MM10 = 10; -const UINT8 REG_MM11 = 11; -const UINT8 REG_MM12 = 12; -const UINT8 REG_MM13 = 13; -const UINT8 REG_MM14 = 14; -const UINT8 REG_MM15 = 15; +const uint8_t REG_MM8 = 8; +const uint8_t REG_MM9 = 9; +const uint8_t REG_MM10 = 10; +const uint8_t REG_MM11 = 11; +const uint8_t REG_MM12 = 12; +const uint8_t REG_MM13 = 13; +const uint8_t REG_MM14 = 14; +const uint8_t REG_MM15 = 15; #endif // 128-bit XMM registers -const UINT8 REG_XMM0 = 0; -const UINT8 REG_XMM1 = 1; -const UINT8 REG_XMM2 = 2; -const UINT8 REG_XMM3 = 3; -const UINT8 REG_XMM4 = 4; -const UINT8 REG_XMM5 = 5; -const UINT8 REG_XMM6 = 6; -const UINT8 REG_XMM7 = 7; +const uint8_t REG_XMM0 = 0; +const uint8_t REG_XMM1 = 1; +const uint8_t REG_XMM2 = 2; +const uint8_t REG_XMM3 = 3; +const uint8_t REG_XMM4 = 4; +const uint8_t REG_XMM5 = 5; +const uint8_t REG_XMM6 = 6; +const uint8_t REG_XMM7 = 7; #if (X86EMIT_SIZE == 64) -const UINT8 REG_XMM8 = 8; -const UINT8 REG_XMM9 = 9; -const UINT8 REG_XMM10 = 10; -const UINT8 REG_XMM11 = 11; -const UINT8 REG_XMM12 = 12; -const UINT8 REG_XMM13 = 13; -const UINT8 REG_XMM14 = 14; -const UINT8 REG_XMM15 = 15; +const uint8_t REG_XMM8 = 8; +const uint8_t REG_XMM9 = 9; +const uint8_t REG_XMM10 = 10; +const uint8_t REG_XMM11 = 11; +const uint8_t REG_XMM12 = 12; +const uint8_t REG_XMM13 = 13; +const uint8_t REG_XMM14 = 14; +const uint8_t REG_XMM15 = 15; #endif // conditions -const UINT8 COND_A = 7; -const UINT8 COND_AE = 3; -const UINT8 COND_B = 2; -const UINT8 COND_BE = 6; -const UINT8 COND_C = 2; -const UINT8 COND_E = 4; -const UINT8 COND_Z = 4; -const UINT8 COND_G = 15; -const UINT8 COND_GE = 13; -const UINT8 COND_L = 12; -const UINT8 COND_LE = 14; -const UINT8 COND_NA = 6; -const UINT8 COND_NAE = 2; -const UINT8 COND_NB = 3; -const UINT8 COND_NBE = 7; -const UINT8 COND_NC = 3; -const UINT8 COND_NE = 5; -const UINT8 COND_NG = 14; -const UINT8 COND_NGE = 12; -const UINT8 COND_NL = 13; -const UINT8 COND_NLE = 15; -const UINT8 COND_NO = 1; -const UINT8 COND_NP = 11; -const UINT8 COND_NS = 9; -const UINT8 COND_NZ = 5; -const UINT8 COND_O = 0; -const UINT8 COND_P = 10; -const UINT8 COND_PE = 10; -const UINT8 COND_PO = 11; -const UINT8 COND_S = 8; +const uint8_t COND_A = 7; +const uint8_t COND_AE = 3; +const uint8_t COND_B = 2; +const uint8_t COND_BE = 6; +const uint8_t COND_C = 2; +const uint8_t COND_E = 4; +const uint8_t COND_Z = 4; +const uint8_t COND_G = 15; +const uint8_t COND_GE = 13; +const uint8_t COND_L = 12; +const uint8_t COND_LE = 14; +const uint8_t COND_NA = 6; +const uint8_t COND_NAE = 2; +const uint8_t COND_NB = 3; +const uint8_t COND_NBE = 7; +const uint8_t COND_NC = 3; +const uint8_t COND_NE = 5; +const uint8_t COND_NG = 14; +const uint8_t COND_NGE = 12; +const uint8_t COND_NL = 13; +const uint8_t COND_NLE = 15; +const uint8_t COND_NO = 1; +const uint8_t COND_NP = 11; +const uint8_t COND_NS = 9; +const uint8_t COND_NZ = 5; +const uint8_t COND_O = 0; +const uint8_t COND_P = 10; +const uint8_t COND_PE = 10; +const uint8_t COND_PO = 11; +const uint8_t COND_S = 8; // floating point rounding modes -const UINT8 FPRND_NEAR = 0; -const UINT8 FPRND_DOWN = 1; -const UINT8 FPRND_UP = 2; -const UINT8 FPRND_CHOP = 3; +const uint8_t FPRND_NEAR = 0; +const uint8_t FPRND_DOWN = 1; +const uint8_t FPRND_UP = 2; +const uint8_t FPRND_CHOP = 3; @@ -262,907 +262,907 @@ const UINT8 FPRND_CHOP = 3; //************************************************************************** // opcode flags (in upper 8 bits of opcode) -const UINT32 OPFLAG_8BITREG = (1 << 24); -const UINT32 OPFLAG_8BITRM = (1 << 25); +const uint32_t OPFLAG_8BITREG = (1 << 24); +const uint32_t OPFLAG_8BITRM = (1 << 25); // single byte opcodes -const UINT32 OP_ADD_Eb_Gb = (0x00 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_ADD_Ev_Gv = 0x01; -const UINT32 OP_ADD_Gb_Eb = (0x02 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_ADD_Gv_Ev = 0x03; -const UINT32 OP_ADD_AL_Ib = 0x04; -const UINT32 OP_ADD_rAX_Iz = 0x05; -const UINT32 OP_PUSH_ES = 0x06; -const UINT32 OP_POP_ES = 0x07; -const UINT32 OP_OR_Eb_Gb = (0x08 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_OR_Ev_Gv = 0x09; -const UINT32 OP_OR_Gb_Eb = (0x0a | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_OR_Gv_Ev = 0x0b; -const UINT32 OP_OR_AL_Ib = 0x0c; -const UINT32 OP_OR_eAX_Iv = 0x0d; -const UINT32 OP_PUSH_CS = 0x0e; -const UINT32 OP_EXTENDED = 0x0f; - -const UINT32 OP_ADC_Eb_Gb = (0x10 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_ADC_Ev_Gv = 0x11; -const UINT32 OP_ADC_Gb_Eb = (0x12 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_ADC_Gv_Ev = 0x13; -const UINT32 OP_ADC_AL_Ib = 0x14; -const UINT32 OP_ADC_rAX_Iz = 0x15; -const UINT32 OP_PUSH_SS = 0x16; -const UINT32 OP_POP_SS = 0x17; -const UINT32 OP_SBB_Eb_Gb = (0x18 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_SBB_Ev_Gv = 0x19; -const UINT32 OP_SBB_Gb_Eb = (0x1a | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_SBB_Gv_Ev = 0x1b; -const UINT32 OP_SBB_AL_Ib = 0x1c; -const UINT32 OP_SBB_eAX_Iv = 0x1d; -const UINT32 OP_PUSH_DS = 0x1e; -const UINT32 OP_POP_DS = 0x1f; - -const UINT32 OP_AND_Eb_Gb = (0x20 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_AND_Ev_Gv = 0x21; -const UINT32 OP_AND_Gb_Eb = (0x22 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_AND_Gv_Ev = 0x23; -const UINT32 OP_AND_AL_Ib = 0x24; -const UINT32 OP_AND_rAX_Iz = 0x25; -const UINT32 PREFIX_ES = 0x26; -const UINT32 OP_DAA = 0x27; -const UINT32 OP_SUB_Eb_Gb = (0x28 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_SUB_Ev_Gv = 0x29; -const UINT32 OP_SUB_Gb_Eb = (0x2a | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_SUB_Gv_Ev = 0x2b; -const UINT32 OP_SUB_AL_Ib = 0x2c; -const UINT32 OP_SUB_eAX_Iv = 0x2d; -const UINT32 PREFIX_CS = 0x2e; -const UINT32 OP_DAS = 0x2f; - -const UINT32 OP_XOR_Eb_Gb = (0x30 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_XOR_Ev_Gv = 0x31; -const UINT32 OP_XOR_Gb_Eb = (0x32 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_XOR_Gv_Ev = 0x33; -const UINT32 OP_XOR_AL_Ib = 0x34; -const UINT32 OP_XOR_rAX_Iz = 0x35; -const UINT32 PREFIX_SS = 0x36; -const UINT32 OP_AAA = 0x37; -const UINT32 OP_CMP_Eb_Gb = (0x38 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_CMP_Ev_Gv = 0x39; -const UINT32 OP_CMP_Gb_Eb = (0x3a | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_CMP_Gv_Ev = 0x3b; -const UINT32 OP_CMP_AL_Ib = 0x3c; -const UINT32 OP_CMP_eAX_Iv = 0x3d; -const UINT32 PREFIX_DS = 0x3e; -const UINT32 OP_AAS = 0x3f; - -const UINT32 OP_REX = 0x40; -const UINT32 OP_REX_B = 0x41; -const UINT32 OP_REX_X = 0x42; -const UINT32 OP_REX_XB = 0x43; -const UINT32 OP_REX_R = 0x44; -const UINT32 OP_REX_RB = 0x45; -const UINT32 OP_REX_RX = 0x46; -const UINT32 OP_REX_RXB = 0x47; -const UINT32 OP_REX_W = 0x48; -const UINT32 OP_REX_WB = 0x49; -const UINT32 OP_REX_WX = 0x4a; -const UINT32 OP_REX_WXB = 0x4b; -const UINT32 OP_REX_WR = 0x4c; -const UINT32 OP_REX_WRB = 0x4d; -const UINT32 OP_REX_WRX = 0x4e; -const UINT32 OP_REX_WRXB = 0x4f; - -const UINT32 OP_PUSH_rAX = 0x50; -const UINT32 OP_PUSH_rCX = 0x51; -const UINT32 OP_PUSH_rDX = 0x52; -const UINT32 OP_PUSH_rBX = 0x53; -const UINT32 OP_PUSH_rSP = 0x54; -const UINT32 OP_PUSH_rBP = 0x55; -const UINT32 OP_PUSH_rSI = 0x56; -const UINT32 OP_PUSH_rDI = 0x57; -const UINT32 OP_POP_rAX = 0x58; -const UINT32 OP_POP_rCX = 0x59; -const UINT32 OP_POP_rDX = 0x5a; -const UINT32 OP_POP_rBX = 0x5b; -const UINT32 OP_POP_rSP = 0x5c; -const UINT32 OP_POP_rBP = 0x5d; -const UINT32 OP_POP_rSI = 0x5e; -const UINT32 OP_POP_rDI = 0x5f; - -const UINT32 OP_PUSHA = 0x60; -const UINT32 OP_POPA = 0x61; -const UINT32 OP_BOUND_Gv_Ma = 0x62; -const UINT32 OP_ARPL_Ew_Gw = 0x63; -const UINT32 OP_MOVSXD_Gv_Ev = 0x63; -const UINT32 PREFIX_FS = 0x64; -const UINT32 PREFIX_GS = 0x65; -const UINT32 PREFIX_OPSIZE = 0x66; -const UINT32 PREFIX_ADSIZE = 0x67; -const UINT32 OP_PUSH_Iz = 0x68; -const UINT32 OP_IMUL_Gv_Ev_Iz = 0x69; -const UINT32 OP_PUSH_Ib = 0x6a; -const UINT32 OP_IMUL_Gv_Ev_Ib = 0x6b; -const UINT32 OP_INS_Yb_DX = 0x6c; -const UINT32 OP_INS_Yz_DX = 0x6d; -const UINT32 OP_OUTS_DX_Xb = 0x6e; -const UINT32 OP_OUTS_DX_Xz = 0x6f; - -const UINT32 OP_JCC_O_Jb = 0x70; -const UINT32 OP_JCC_NO_Jb = 0x71; -const UINT32 OP_JCC_B_Jb = 0x72; -const UINT32 OP_JCC_C_Jb = 0x72; -const UINT32 OP_JCC_NAE_Jb = 0x72; -const UINT32 OP_JCC_AE_Jb = 0x73; -const UINT32 OP_JCC_NB_Jb = 0x73; -const UINT32 OP_JCC_NC_Jb = 0x73; -const UINT32 OP_JCC_E_Jb = 0x74; -const UINT32 OP_JCC_Z_Jb = 0x74; -const UINT32 OP_JCC_NE_Jb = 0x75; -const UINT32 OP_JCC_NZ_Jb = 0x75; -const UINT32 OP_JCC_BE_Jb = 0x76; -const UINT32 OP_JCC_NA_Jb = 0x76; -const UINT32 OP_JCC_A_Jb = 0x77; -const UINT32 OP_JCC_NBE_Jb = 0x77; -const UINT32 OP_JCC_S_Jb = 0x78; -const UINT32 OP_JCC_NS_Jb = 0x79; -const UINT32 OP_JCC_P_Jb = 0x7a; -const UINT32 OP_JCC_PE_Jb = 0x7a; -const UINT32 OP_JCC_NP_Jb = 0x7b; -const UINT32 OP_JCC_PO_Jb = 0x7b; -const UINT32 OP_JCC_L_Jb = 0x7c; -const UINT32 OP_JCC_NGE_Jb = 0x7c; -const UINT32 OP_JCC_NL_Jb = 0x7d; -const UINT32 OP_JCC_GE_Jb = 0x7d; -const UINT32 OP_JCC_LE_Jb = 0x7e; -const UINT32 OP_JCC_NG_Jb = 0x7e; -const UINT32 OP_JCC_NLE_Jb = 0x7f; -const UINT32 OP_JCC_G_Jb = 0x7f; - -const UINT32 OP_G1_Eb_Ib = (0x80 | OPFLAG_8BITRM); -const UINT32 OP_G1_Ev_Iz = 0x81; -const UINT32 OP_G1_Eb_Ibx = (0x82 | OPFLAG_8BITRM); -const UINT32 OP_G1_Ev_Ib = 0x83; -const UINT32 OP_TEST_Eb_Gb = (0x84 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_TEST_Ev_Gv = 0x85; -const UINT32 OP_XCHG_Eb_Gb = (0x86 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_XCHG_Ev_Gv = 0x87; -const UINT32 OP_MOV_Eb_Gb = (0x88 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_MOV_Ev_Gv = 0x89; -const UINT32 OP_MOV_Gb_Eb = (0x8a | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_MOV_Gv_Ev = 0x8b; -const UINT32 OP_MOV_Ev_Sw = 0x8c; -const UINT32 OP_LEA_Gv_M = 0x8d; -const UINT32 OP_MOV_Sw_Ew = 0x8e; -const UINT32 OP_G1A_Ev = 0x8f; - -const UINT32 OP_NOP = 0x90; -const UINT32 OP_PAUSE = 0x90; -const UINT32 OP_XCHG_rCX = 0x91; -const UINT32 OP_XCHG_rDX = 0x92; -const UINT32 OP_XCHG_rBX = 0x93; -const UINT32 OP_XCHG_rSP = 0x94; -const UINT32 OP_XCHG_rBP = 0x95; -const UINT32 OP_XCHG_rSI = 0x96; -const UINT32 OP_XCHG_rDI = 0x97; -const UINT32 OP_CBW = 0x98; -const UINT32 OP_CWDE = 0x98; -const UINT32 OP_CDQE = 0x98; -const UINT32 OP_CWD = 0x99; -const UINT32 OP_CDQ = 0x99; -const UINT32 OP_CQO = 0x99; -const UINT32 OP_CALLF_Ap = 0x9a; -const UINT32 OP_FWAIT = 0x9b; -const UINT32 OP_PUSHF_Fv = 0x9c; -const UINT32 OP_POPF_Fv = 0x9d; -const UINT32 OP_SAHF = 0x9e; -const UINT32 OP_LAHF = 0x9f; - -const UINT32 OP_MOV_AL_Ob = 0xa0; -const UINT32 OP_MOV_rAX_Ov = 0xa1; -const UINT32 OP_MOV_Ob_AL = 0xa2; -const UINT32 OP_MOV_Ov_rAX = 0xa3; -const UINT32 OP_MOVS_Xb_Yb = 0xa4; -const UINT32 OP_MOVS_Xv_Yv = 0xa5; -const UINT32 OP_CMPS_Xb_Yb = 0xa6; -const UINT32 OP_CMPS_Xv_Yv = 0xa7; -const UINT32 OP_TEST_AL_Ib = 0xa8; -const UINT32 OP_TEST_rAX_Iz = 0xa9; -const UINT32 OP_STOS_Yb_AL = 0xaa; -const UINT32 OP_STOS_Yv_rAX = 0xab; -const UINT32 OP_LODS_AL_Xb = 0xac; -const UINT32 OP_LODS_rAX_Xv = 0xad; -const UINT32 OP_SCAS_AL_Yb = 0xae; -const UINT32 OP_SCAC_rAX_Yv = 0xaf; - -const UINT32 OP_MOV_AL_Ib = 0xb0; -const UINT32 OP_MOV_CL_Ib = 0xb1; -const UINT32 OP_MOV_DL_Ib = 0xb2; -const UINT32 OP_MOV_BL_Ib = 0xb3; -const UINT32 OP_MOV_AH_Ib = 0xb4; -const UINT32 OP_MOV_CH_Ib = 0xb5; -const UINT32 OP_MOV_DH_Ib = 0xb6; -const UINT32 OP_MOV_BH_Ib = 0xb7; -const UINT32 OP_MOV_rAX_Iv = 0xb8; -const UINT32 OP_MOV_rCX_Iv = 0xb9; -const UINT32 OP_MOV_rDX_Iv = 0xba; -const UINT32 OP_MOV_rBX_Iv = 0xbb; -const UINT32 OP_MOV_rSP_Iv = 0xbc; -const UINT32 OP_MOV_rBP_Iv = 0xbd; -const UINT32 OP_MOV_rSI_Iv = 0xbe; -const UINT32 OP_MOV_rDI_Iv = 0xbf; - -const UINT32 OP_G2_Eb_Ib = (0xc0 | OPFLAG_8BITRM); -const UINT32 OP_G2_Ev_Ib = 0xc1; -const UINT32 OP_RETN_Iw = 0xc2; -const UINT32 OP_RETN = 0xc3; -const UINT32 OP_LES_Gz_Mp = 0xc4; -const UINT32 OP_LDS_Gz_Mp = 0xc5; -const UINT32 OP_G11_Eb_Ib = (0xc6 | OPFLAG_8BITRM); -const UINT32 OP_G11_Ev_Iz = 0xc7; -const UINT32 OP_ENTER_Iw_Ib = 0xc8; -const UINT32 OP_LEAVE = 0xc9; -const UINT32 OP_RETF_Iw = 0xca; -const UINT32 OP_RETF = 0xcb; -const UINT32 OP_INT_3 = 0xcc; -const UINT32 OP_INT_Ib = 0xcd; -const UINT32 OP_INTO = 0xce; -const UINT32 OP_IRET = 0xcf; - -const UINT32 OP_G2_Eb_1 = (0xd0 | OPFLAG_8BITRM); -const UINT32 OP_G2_Ev_1 = 0xd1; -const UINT32 OP_G2_Eb_CL = (0xd2 | OPFLAG_8BITRM); -const UINT32 OP_G2_Ev_CL = 0xd3; -const UINT32 OP_AAM = 0xd4; -const UINT32 OP_AAD = 0xd5; -const UINT32 OP_XLAT = 0xd7; -const UINT32 OP_ESC_D8 = 0xd8; -const UINT32 OP_ESC_D9 = 0xd9; -const UINT32 OP_ESC_DA = 0xda; -const UINT32 OP_ESC_DB = 0xdb; -const UINT32 OP_ESC_DC = 0xdc; -const UINT32 OP_ESC_DD = 0xdd; -const UINT32 OP_ESC_DE = 0xde; -const UINT32 OP_ESC_DF = 0xdf; - -const UINT32 OP_LOOPNE_Jb = 0xe0; -const UINT32 OP_LOOPE_Jb = 0xe1; -const UINT32 OP_LOOP_Jb = 0xe2; -const UINT32 OP_JrCXZ_Jb = 0xe3; -const UINT32 OP_IN_AL_Ib = 0xe4; -const UINT32 OP_IN_eAX_Ib = 0xe5; -const UINT32 OP_OUT_Ib_AL = 0xe6; -const UINT32 OP_OUT_Ib_eAX = 0xe7; -const UINT32 OP_CALL_Jz = 0xe8; -const UINT32 OP_JMP_Jz = 0xe9; -const UINT32 OP_JMPF_AP = 0xea; -const UINT32 OP_JMP_Jb = 0xeb; -const UINT32 OP_IN_AL_DX = 0xec; -const UINT32 OP_IN_eAX_D = 0xed; -const UINT32 OP_OUT_DX_AL = 0xee; -const UINT32 OP_OUT_DX_eAX = 0xef; - -const UINT32 PREFIX_LOCK = 0xf0; -const UINT32 PREFIX_REPNE = 0xf2; -const UINT32 PREFIX_REPE = 0xf3; -const UINT32 OP_HLT = 0xf4; -const UINT32 OP_CMC = 0xf5; -const UINT32 OP_G3_Eb = (0xf6 | OPFLAG_8BITRM); -const UINT32 OP_G3_Ev = 0xf7; -const UINT32 OP_CLC = 0xf8; -const UINT32 OP_STC = 0xf9; -const UINT32 OP_CLI = 0xfa; -const UINT32 OP_STI = 0xfb; -const UINT32 OP_CLD = 0xfc; -const UINT32 OP_STD = 0xfd; -const UINT32 OP_G4 = 0xfe; -const UINT32 OP_G5 = 0xff; +const uint32_t OP_ADD_Eb_Gb = (0x00 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_ADD_Ev_Gv = 0x01; +const uint32_t OP_ADD_Gb_Eb = (0x02 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_ADD_Gv_Ev = 0x03; +const uint32_t OP_ADD_AL_Ib = 0x04; +const uint32_t OP_ADD_rAX_Iz = 0x05; +const uint32_t OP_PUSH_ES = 0x06; +const uint32_t OP_POP_ES = 0x07; +const uint32_t OP_OR_Eb_Gb = (0x08 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_OR_Ev_Gv = 0x09; +const uint32_t OP_OR_Gb_Eb = (0x0a | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_OR_Gv_Ev = 0x0b; +const uint32_t OP_OR_AL_Ib = 0x0c; +const uint32_t OP_OR_eAX_Iv = 0x0d; +const uint32_t OP_PUSH_CS = 0x0e; +const uint32_t OP_EXTENDED = 0x0f; + +const uint32_t OP_ADC_Eb_Gb = (0x10 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_ADC_Ev_Gv = 0x11; +const uint32_t OP_ADC_Gb_Eb = (0x12 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_ADC_Gv_Ev = 0x13; +const uint32_t OP_ADC_AL_Ib = 0x14; +const uint32_t OP_ADC_rAX_Iz = 0x15; +const uint32_t OP_PUSH_SS = 0x16; +const uint32_t OP_POP_SS = 0x17; +const uint32_t OP_SBB_Eb_Gb = (0x18 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_SBB_Ev_Gv = 0x19; +const uint32_t OP_SBB_Gb_Eb = (0x1a | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_SBB_Gv_Ev = 0x1b; +const uint32_t OP_SBB_AL_Ib = 0x1c; +const uint32_t OP_SBB_eAX_Iv = 0x1d; +const uint32_t OP_PUSH_DS = 0x1e; +const uint32_t OP_POP_DS = 0x1f; + +const uint32_t OP_AND_Eb_Gb = (0x20 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_AND_Ev_Gv = 0x21; +const uint32_t OP_AND_Gb_Eb = (0x22 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_AND_Gv_Ev = 0x23; +const uint32_t OP_AND_AL_Ib = 0x24; +const uint32_t OP_AND_rAX_Iz = 0x25; +const uint32_t PREFIX_ES = 0x26; +const uint32_t OP_DAA = 0x27; +const uint32_t OP_SUB_Eb_Gb = (0x28 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_SUB_Ev_Gv = 0x29; +const uint32_t OP_SUB_Gb_Eb = (0x2a | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_SUB_Gv_Ev = 0x2b; +const uint32_t OP_SUB_AL_Ib = 0x2c; +const uint32_t OP_SUB_eAX_Iv = 0x2d; +const uint32_t PREFIX_CS = 0x2e; +const uint32_t OP_DAS = 0x2f; + +const uint32_t OP_XOR_Eb_Gb = (0x30 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_XOR_Ev_Gv = 0x31; +const uint32_t OP_XOR_Gb_Eb = (0x32 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_XOR_Gv_Ev = 0x33; +const uint32_t OP_XOR_AL_Ib = 0x34; +const uint32_t OP_XOR_rAX_Iz = 0x35; +const uint32_t PREFIX_SS = 0x36; +const uint32_t OP_AAA = 0x37; +const uint32_t OP_CMP_Eb_Gb = (0x38 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_CMP_Ev_Gv = 0x39; +const uint32_t OP_CMP_Gb_Eb = (0x3a | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_CMP_Gv_Ev = 0x3b; +const uint32_t OP_CMP_AL_Ib = 0x3c; +const uint32_t OP_CMP_eAX_Iv = 0x3d; +const uint32_t PREFIX_DS = 0x3e; +const uint32_t OP_AAS = 0x3f; + +const uint32_t OP_REX = 0x40; +const uint32_t OP_REX_B = 0x41; +const uint32_t OP_REX_X = 0x42; +const uint32_t OP_REX_XB = 0x43; +const uint32_t OP_REX_R = 0x44; +const uint32_t OP_REX_RB = 0x45; +const uint32_t OP_REX_RX = 0x46; +const uint32_t OP_REX_RXB = 0x47; +const uint32_t OP_REX_W = 0x48; +const uint32_t OP_REX_WB = 0x49; +const uint32_t OP_REX_WX = 0x4a; +const uint32_t OP_REX_WXB = 0x4b; +const uint32_t OP_REX_WR = 0x4c; +const uint32_t OP_REX_WRB = 0x4d; +const uint32_t OP_REX_WRX = 0x4e; +const uint32_t OP_REX_WRXB = 0x4f; + +const uint32_t OP_PUSH_rAX = 0x50; +const uint32_t OP_PUSH_rCX = 0x51; +const uint32_t OP_PUSH_rDX = 0x52; +const uint32_t OP_PUSH_rBX = 0x53; +const uint32_t OP_PUSH_rSP = 0x54; +const uint32_t OP_PUSH_rBP = 0x55; +const uint32_t OP_PUSH_rSI = 0x56; +const uint32_t OP_PUSH_rDI = 0x57; +const uint32_t OP_POP_rAX = 0x58; +const uint32_t OP_POP_rCX = 0x59; +const uint32_t OP_POP_rDX = 0x5a; +const uint32_t OP_POP_rBX = 0x5b; +const uint32_t OP_POP_rSP = 0x5c; +const uint32_t OP_POP_rBP = 0x5d; +const uint32_t OP_POP_rSI = 0x5e; +const uint32_t OP_POP_rDI = 0x5f; + +const uint32_t OP_PUSHA = 0x60; +const uint32_t OP_POPA = 0x61; +const uint32_t OP_BOUND_Gv_Ma = 0x62; +const uint32_t OP_ARPL_Ew_Gw = 0x63; +const uint32_t OP_MOVSXD_Gv_Ev = 0x63; +const uint32_t PREFIX_FS = 0x64; +const uint32_t PREFIX_GS = 0x65; +const uint32_t PREFIX_OPSIZE = 0x66; +const uint32_t PREFIX_ADSIZE = 0x67; +const uint32_t OP_PUSH_Iz = 0x68; +const uint32_t OP_IMUL_Gv_Ev_Iz = 0x69; +const uint32_t OP_PUSH_Ib = 0x6a; +const uint32_t OP_IMUL_Gv_Ev_Ib = 0x6b; +const uint32_t OP_INS_Yb_DX = 0x6c; +const uint32_t OP_INS_Yz_DX = 0x6d; +const uint32_t OP_OUTS_DX_Xb = 0x6e; +const uint32_t OP_OUTS_DX_Xz = 0x6f; + +const uint32_t OP_JCC_O_Jb = 0x70; +const uint32_t OP_JCC_NO_Jb = 0x71; +const uint32_t OP_JCC_B_Jb = 0x72; +const uint32_t OP_JCC_C_Jb = 0x72; +const uint32_t OP_JCC_NAE_Jb = 0x72; +const uint32_t OP_JCC_AE_Jb = 0x73; +const uint32_t OP_JCC_NB_Jb = 0x73; +const uint32_t OP_JCC_NC_Jb = 0x73; +const uint32_t OP_JCC_E_Jb = 0x74; +const uint32_t OP_JCC_Z_Jb = 0x74; +const uint32_t OP_JCC_NE_Jb = 0x75; +const uint32_t OP_JCC_NZ_Jb = 0x75; +const uint32_t OP_JCC_BE_Jb = 0x76; +const uint32_t OP_JCC_NA_Jb = 0x76; +const uint32_t OP_JCC_A_Jb = 0x77; +const uint32_t OP_JCC_NBE_Jb = 0x77; +const uint32_t OP_JCC_S_Jb = 0x78; +const uint32_t OP_JCC_NS_Jb = 0x79; +const uint32_t OP_JCC_P_Jb = 0x7a; +const uint32_t OP_JCC_PE_Jb = 0x7a; +const uint32_t OP_JCC_NP_Jb = 0x7b; +const uint32_t OP_JCC_PO_Jb = 0x7b; +const uint32_t OP_JCC_L_Jb = 0x7c; +const uint32_t OP_JCC_NGE_Jb = 0x7c; +const uint32_t OP_JCC_NL_Jb = 0x7d; +const uint32_t OP_JCC_GE_Jb = 0x7d; +const uint32_t OP_JCC_LE_Jb = 0x7e; +const uint32_t OP_JCC_NG_Jb = 0x7e; +const uint32_t OP_JCC_NLE_Jb = 0x7f; +const uint32_t OP_JCC_G_Jb = 0x7f; + +const uint32_t OP_G1_Eb_Ib = (0x80 | OPFLAG_8BITRM); +const uint32_t OP_G1_Ev_Iz = 0x81; +const uint32_t OP_G1_Eb_Ibx = (0x82 | OPFLAG_8BITRM); +const uint32_t OP_G1_Ev_Ib = 0x83; +const uint32_t OP_TEST_Eb_Gb = (0x84 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_TEST_Ev_Gv = 0x85; +const uint32_t OP_XCHG_Eb_Gb = (0x86 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_XCHG_Ev_Gv = 0x87; +const uint32_t OP_MOV_Eb_Gb = (0x88 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_MOV_Ev_Gv = 0x89; +const uint32_t OP_MOV_Gb_Eb = (0x8a | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_MOV_Gv_Ev = 0x8b; +const uint32_t OP_MOV_Ev_Sw = 0x8c; +const uint32_t OP_LEA_Gv_M = 0x8d; +const uint32_t OP_MOV_Sw_Ew = 0x8e; +const uint32_t OP_G1A_Ev = 0x8f; + +const uint32_t OP_NOP = 0x90; +const uint32_t OP_PAUSE = 0x90; +const uint32_t OP_XCHG_rCX = 0x91; +const uint32_t OP_XCHG_rDX = 0x92; +const uint32_t OP_XCHG_rBX = 0x93; +const uint32_t OP_XCHG_rSP = 0x94; +const uint32_t OP_XCHG_rBP = 0x95; +const uint32_t OP_XCHG_rSI = 0x96; +const uint32_t OP_XCHG_rDI = 0x97; +const uint32_t OP_CBW = 0x98; +const uint32_t OP_CWDE = 0x98; +const uint32_t OP_CDQE = 0x98; +const uint32_t OP_CWD = 0x99; +const uint32_t OP_CDQ = 0x99; +const uint32_t OP_CQO = 0x99; +const uint32_t OP_CALLF_Ap = 0x9a; +const uint32_t OP_FWAIT = 0x9b; +const uint32_t OP_PUSHF_Fv = 0x9c; +const uint32_t OP_POPF_Fv = 0x9d; +const uint32_t OP_SAHF = 0x9e; +const uint32_t OP_LAHF = 0x9f; + +const uint32_t OP_MOV_AL_Ob = 0xa0; +const uint32_t OP_MOV_rAX_Ov = 0xa1; +const uint32_t OP_MOV_Ob_AL = 0xa2; +const uint32_t OP_MOV_Ov_rAX = 0xa3; +const uint32_t OP_MOVS_Xb_Yb = 0xa4; +const uint32_t OP_MOVS_Xv_Yv = 0xa5; +const uint32_t OP_CMPS_Xb_Yb = 0xa6; +const uint32_t OP_CMPS_Xv_Yv = 0xa7; +const uint32_t OP_TEST_AL_Ib = 0xa8; +const uint32_t OP_TEST_rAX_Iz = 0xa9; +const uint32_t OP_STOS_Yb_AL = 0xaa; +const uint32_t OP_STOS_Yv_rAX = 0xab; +const uint32_t OP_LODS_AL_Xb = 0xac; +const uint32_t OP_LODS_rAX_Xv = 0xad; +const uint32_t OP_SCAS_AL_Yb = 0xae; +const uint32_t OP_SCAC_rAX_Yv = 0xaf; + +const uint32_t OP_MOV_AL_Ib = 0xb0; +const uint32_t OP_MOV_CL_Ib = 0xb1; +const uint32_t OP_MOV_DL_Ib = 0xb2; +const uint32_t OP_MOV_BL_Ib = 0xb3; +const uint32_t OP_MOV_AH_Ib = 0xb4; +const uint32_t OP_MOV_CH_Ib = 0xb5; +const uint32_t OP_MOV_DH_Ib = 0xb6; +const uint32_t OP_MOV_BH_Ib = 0xb7; +const uint32_t OP_MOV_rAX_Iv = 0xb8; +const uint32_t OP_MOV_rCX_Iv = 0xb9; +const uint32_t OP_MOV_rDX_Iv = 0xba; +const uint32_t OP_MOV_rBX_Iv = 0xbb; +const uint32_t OP_MOV_rSP_Iv = 0xbc; +const uint32_t OP_MOV_rBP_Iv = 0xbd; +const uint32_t OP_MOV_rSI_Iv = 0xbe; +const uint32_t OP_MOV_rDI_Iv = 0xbf; + +const uint32_t OP_G2_Eb_Ib = (0xc0 | OPFLAG_8BITRM); +const uint32_t OP_G2_Ev_Ib = 0xc1; +const uint32_t OP_RETN_Iw = 0xc2; +const uint32_t OP_RETN = 0xc3; +const uint32_t OP_LES_Gz_Mp = 0xc4; +const uint32_t OP_LDS_Gz_Mp = 0xc5; +const uint32_t OP_G11_Eb_Ib = (0xc6 | OPFLAG_8BITRM); +const uint32_t OP_G11_Ev_Iz = 0xc7; +const uint32_t OP_ENTER_Iw_Ib = 0xc8; +const uint32_t OP_LEAVE = 0xc9; +const uint32_t OP_RETF_Iw = 0xca; +const uint32_t OP_RETF = 0xcb; +const uint32_t OP_INT_3 = 0xcc; +const uint32_t OP_INT_Ib = 0xcd; +const uint32_t OP_INTO = 0xce; +const uint32_t OP_IRET = 0xcf; + +const uint32_t OP_G2_Eb_1 = (0xd0 | OPFLAG_8BITRM); +const uint32_t OP_G2_Ev_1 = 0xd1; +const uint32_t OP_G2_Eb_CL = (0xd2 | OPFLAG_8BITRM); +const uint32_t OP_G2_Ev_CL = 0xd3; +const uint32_t OP_AAM = 0xd4; +const uint32_t OP_AAD = 0xd5; +const uint32_t OP_XLAT = 0xd7; +const uint32_t OP_ESC_D8 = 0xd8; +const uint32_t OP_ESC_D9 = 0xd9; +const uint32_t OP_ESC_DA = 0xda; +const uint32_t OP_ESC_DB = 0xdb; +const uint32_t OP_ESC_DC = 0xdc; +const uint32_t OP_ESC_DD = 0xdd; +const uint32_t OP_ESC_DE = 0xde; +const uint32_t OP_ESC_DF = 0xdf; + +const uint32_t OP_LOOPNE_Jb = 0xe0; +const uint32_t OP_LOOPE_Jb = 0xe1; +const uint32_t OP_LOOP_Jb = 0xe2; +const uint32_t OP_JrCXZ_Jb = 0xe3; +const uint32_t OP_IN_AL_Ib = 0xe4; +const uint32_t OP_IN_eAX_Ib = 0xe5; +const uint32_t OP_OUT_Ib_AL = 0xe6; +const uint32_t OP_OUT_Ib_eAX = 0xe7; +const uint32_t OP_CALL_Jz = 0xe8; +const uint32_t OP_JMP_Jz = 0xe9; +const uint32_t OP_JMPF_AP = 0xea; +const uint32_t OP_JMP_Jb = 0xeb; +const uint32_t OP_IN_AL_DX = 0xec; +const uint32_t OP_IN_eAX_D = 0xed; +const uint32_t OP_OUT_DX_AL = 0xee; +const uint32_t OP_OUT_DX_eAX = 0xef; + +const uint32_t PREFIX_LOCK = 0xf0; +const uint32_t PREFIX_REPNE = 0xf2; +const uint32_t PREFIX_REPE = 0xf3; +const uint32_t OP_HLT = 0xf4; +const uint32_t OP_CMC = 0xf5; +const uint32_t OP_G3_Eb = (0xf6 | OPFLAG_8BITRM); +const uint32_t OP_G3_Ev = 0xf7; +const uint32_t OP_CLC = 0xf8; +const uint32_t OP_STC = 0xf9; +const uint32_t OP_CLI = 0xfa; +const uint32_t OP_STI = 0xfb; +const uint32_t OP_CLD = 0xfc; +const uint32_t OP_STD = 0xfd; +const uint32_t OP_G4 = 0xfe; +const uint32_t OP_G5 = 0xff; // double byte opcodes -const UINT32 OP_G6 = 0x0f00; -const UINT32 OP_G7 = 0x0f01; -const UINT32 OP_LAR_Gv_Ew = 0x0f02; -const UINT32 OP_LSL_Gv_Ew = 0x0f03; -const UINT32 OP_SYSCALL = 0x0f05; -const UINT32 OP_CLTS = 0x0f06; -const UINT32 OP_SYSRET = 0x0f07; -const UINT32 OP_INVD = 0x0f08; -const UINT32 OP_WBINVD = 0x0f09; -const UINT32 OP_UD2 = 0x0f0b; -const UINT32 OP_NOP0d_Ev = 0x0f0d; - -const UINT32 OP_MOVUPS_Vps_Wps = 0x0f10; -const UINT32 OP_MOVSS_Vss_Wss = 0xf30f10; -const UINT32 OP_MOVUPD_Vpd_Wpd = 0x660f10; -const UINT32 OP_MOVSD_Vsd_Wsd = 0xf20f10; -const UINT32 OP_MOVUPS_Wps_Vps = 0x0f11; -const UINT32 OP_MOVSS_Wss_Vss = 0xf30f11; -const UINT32 OP_MOVUPD_Wpd_Vpd = 0x660f11; -const UINT32 OP_MOVSD_Wsd_Vsd = 0xf20f11; -const UINT32 OP_MOVLPS_Vq_Mq = 0x0f12; -const UINT32 OP_MOVLPD_Vq_Mq = 0x660f12; -const UINT32 OP_MOVHLPS_Vq_Uq = 0x0f12; -const UINT32 OP_MOVDDUP_Vq_Wq = 0xf20f12; -const UINT32 OP_MOVSLDUP_Vq_Wq = 0xf30f12; -const UINT32 OP_MOVLPS_Mq_Vq = 0x0f13; -const UINT32 OP_MOVLPD_Mq_Vq = 0x660f13; -const UINT32 OP_UNPCKLPS_Vps_Wq = 0x0f14; -const UINT32 OP_UNPCKLPD_Vpd_Wq = 0x660f14; -const UINT32 OP_UNPCKHPS_Vps_Wq = 0x0f15; -const UINT32 OP_UNPCKHPD_Vpd_Wq = 0x660f15; -const UINT32 OP_MOVHPS_Vq_Mq = 0x0f16; -const UINT32 OP_MOVHPD_Vq_Mq = 0x660f16; -const UINT32 OP_MOVLHPS_Vq_Uq = 0x0f16; -const UINT32 OP_MOVSHDUP_Vq_Wq = 0xf30f16; -const UINT32 OP_MOVHPS_Mq_Vq = 0x0f17; -const UINT32 OP_MOVHPD_Mq_Vq = 0x660f17; -const UINT32 OP_PREFETCH_G16 = 0x0f18; -const UINT32 OP_NOP1f_Ev = 0x0f1f; - -const UINT32 OP_MOV_Rd_Cd = 0x0f20; -const UINT32 OP_MOV_Rd_Dd = 0x0f21; -const UINT32 OP_MOV_Cd_Rd = 0x0f22; -const UINT32 OP_MOV_Dd_Rd = 0x0f23; -const UINT32 OP_MOVAPS_Vps_Wps = 0x0f28; -const UINT32 OP_MOVAPD_Vpd_Wpd = 0x660f28; -const UINT32 OP_MOVAPS_Wps_Vps = 0x0f29; -const UINT32 OP_MOVAPD_Wpd_Vpd = 0x660f29; -const UINT32 OP_CVTPI2PS_Vps_Qq = 0x0f2a; -const UINT32 OP_CVTSI2SS_Vss_Ed = 0xf30f2a; -const UINT32 OP_CVTPI2PD_Vpd_Qq = 0x660f2a; -const UINT32 OP_CVTSI2SD_Vsd_Ed = 0xf20f2a; -const UINT32 OP_MOVNTPS_Mps_Vps = 0x0f2b; -const UINT32 OP_MOVNTPD_Mpd_Vpd = 0x660f2b; -const UINT32 OP_CVTTPS2PI_Pq_Wq = 0x0f2c; -const UINT32 OP_CVTTSS2SI_Gd_Wss = 0xf30f2c; -const UINT32 OP_CVTTPD2PI_Pq_Wpd = 0x660f2c; -const UINT32 OP_CVTTSD2SI_Gd_Wsd = 0xf20f2c; -const UINT32 OP_CVTPS2PI_Pq_Wq = 0x0f2d; -const UINT32 OP_CVTSS2SI_Gd_Wss = 0xf30f2d; -const UINT32 OP_CVTPD2PI_Pq_Wpd = 0x660f2d; -const UINT32 OP_CVTSD2SI_Gd_Wsd = 0xf20f2d; -const UINT32 OP_UCOMISS_Vss_Wss = 0x0f2e; -const UINT32 OP_UCOMISD_Vsd_Wsd = 0x660f2e; -const UINT32 OP_COMISS_Vss_Wss = 0x0f2f; -const UINT32 OP_COMISD_Vsd_Wsd = 0x660f2f; - -const UINT32 OP_WRMSR = 0x0f30; -const UINT32 OP_RDTSC = 0x0f31; -const UINT32 OP_RDMSR = 0x0f32; -const UINT32 OP_RDPMC = 0x0f33; -const UINT32 OP_SYSENTER = 0x0f34; -const UINT32 OP_SYSEXIT = 0x0f35; -const UINT32 OP_GETSEC = 0x0f37; - -const UINT32 OP_CMOV_O_Gv_Ev = 0x0f40; -const UINT32 OP_CMOV_NO_Gv_Ev = 0x0f41; -const UINT32 OP_CMOV_B_Gv_Ev = 0x0f42; -const UINT32 OP_CMOV_C_Gv_Ev = 0x0f42; -const UINT32 OP_CMOV_AE_Gv_Ev = 0x0f43; -const UINT32 OP_CMOV_NC_Gv_Ev = 0x0f43; -const UINT32 OP_CMOV_E_Gv_Ev = 0x0f44; -const UINT32 OP_CMOV_Z_Gv_Ev = 0x0f44; -const UINT32 OP_CMOV_NE_Gv_Ev = 0x0f45; -const UINT32 OP_CMOV_NZ_Gv_Ev = 0x0f45; -const UINT32 OP_CMOV_BE_Gv_Ev = 0x0f46; -const UINT32 OP_CMOV_A_Gv_Ev = 0x0f47; -const UINT32 OP_CMOV_S_Gv_Ev = 0x0f48; -const UINT32 OP_CMOV_NS_Gv_Ev = 0x0f49; -const UINT32 OP_CMOV_P_Gv_Ev = 0x0f4a; -const UINT32 OP_CMOV_PE_Gv_Ev = 0x0f4a; -const UINT32 OP_CMOV_NP_Gv_Ev = 0x0f4b; -const UINT32 OP_CMOV_PO_Gv_Ev = 0x0f4b; -const UINT32 OP_CMOV_L_Gv_Ev = 0x0f4c; -const UINT32 OP_CMOV_NGE_Gv_Ev = 0x0f4c; -const UINT32 OP_CMOV_NL_Gv_Ev = 0x0f4d; -const UINT32 OP_CMOV_GE_Gv_Ev = 0x0f4d; -const UINT32 OP_CMOV_LE_Gv_Ev = 0x0f4e; -const UINT32 OP_CMOV_NG_Gv_Ev = 0x0f4e; -const UINT32 OP_CMOV_NLE_Gv_Ev = 0x0f4f; -const UINT32 OP_CMOV_G_Gv_Ev = 0x0f4f; - -const UINT32 OP_MOVMSKPS_Gd_Ups = 0x0f50; -const UINT32 OP_MOVMSKPD_Gd_Upd = 0x660f50; -const UINT32 OP_SQRTPS_Vps_Wps = 0x0f51; -const UINT32 OP_SQRTSS_Vss_Wss = 0xf30f51; -const UINT32 OP_SQRTPD_Vpd_Wpd = 0x660f51; -const UINT32 OP_SQRTSD_Vsd_Wsd = 0xf20f51; -const UINT32 OP_RSQRTPS_Vps_Wps = 0x0f52; -const UINT32 OP_RSQRTSS_Vss_Wss = 0xf30f52; -const UINT32 OP_RCPPS_Vps_Wps = 0x0f53; -const UINT32 OP_RCPSS_Vss_Wss = 0xf30f53; -const UINT32 OP_ANDPS_Vps_Wps = 0x0f54; -const UINT32 OP_ANDPD_Vpd_Wpd = 0x660f54; -const UINT32 OP_ANDNPS_Vps_Wps = 0x0f55; -const UINT32 OP_ANDNPD_Vpd_Wpd = 0x660f55; -const UINT32 OP_ORPS_Vps_Wps = 0x0f56; -const UINT32 OP_ORPD_Vpd_Wpd = 0x660f56; -const UINT32 OP_XORPS_Vps_Wps = 0x0f57; -const UINT32 OP_XORPD_Vpd_Wpd = 0x660f57; -const UINT32 OP_ADDPS_Vps_Wps = 0x0f58; -const UINT32 OP_ADDSS_Vss_Wss = 0xf30f58; -const UINT32 OP_ADDPD_Vpd_Wpd = 0x660f58; -const UINT32 OP_ADDSD_Vsd_Wsd = 0xf20f58; -const UINT32 OP_MULPS_Vps_Wps = 0x0f59; -const UINT32 OP_MULSS_Vss_Wss = 0xf30f59; -const UINT32 OP_MULPD_Vpd_Wpd = 0x660f59; -const UINT32 OP_MULSD_Vsd_Wsd = 0xf20f59; -const UINT32 OP_CVTPS2PD_Vpd_Wq = 0x0f5a; -const UINT32 OP_CVTSS2SD_Vsd_Wss = 0xf30f5a; -const UINT32 OP_CVTPD2PS_Vps_Wpd = 0x660f5a; -const UINT32 OP_CVTSD2SS_Vss_Wsd = 0xf20f5a; -const UINT32 OP_CVTDQ2PS_Vps_Wdq = 0x0f5b; -const UINT32 OP_CVTPS2DQ_Vdq_Wps = 0x660f5b; -const UINT32 OP_CVTTPS2DQ_Vdq_Wps = 0xf30f5b; -const UINT32 OP_SUBPS_Vps_Wps = 0x0f5c; -const UINT32 OP_SUBSS_Vss_Wss = 0xf30f5c; -const UINT32 OP_SUBPD_Vpd_Wpd = 0x660f5c; -const UINT32 OP_SUBSD_Vsd_Wsd = 0xf20f5c; -const UINT32 OP_MINPS_Vps_Wps = 0x0f5d; -const UINT32 OP_MINSS_Vss_Wss = 0xf30f5d; -const UINT32 OP_MINPD_Vpd_Wpd = 0x660f5d; -const UINT32 OP_MINSD_Vsd_Wsd = 0xf20f5d; -const UINT32 OP_DIVPS_Vps_Wps = 0x0f5e; -const UINT32 OP_DIVSS_Vss_Wss = 0xf30f5e; -const UINT32 OP_DIVPD_Vpd_Wpd = 0x660f5e; -const UINT32 OP_DIVSD_Vsd_Wsd = 0xf20f5e; -const UINT32 OP_MAXPS_Vps_Wps = 0x0f5f; -const UINT32 OP_MAXSS_Vss_Wss = 0xf30f5f; -const UINT32 OP_MAXPD_Vpd_Wpd = 0x660f5f; -const UINT32 OP_MAXSD_Vsd_Wsd = 0xf20f5f; - -const UINT32 OP_PUNPCKLBW_Pq_Qd = 0x0f60; -const UINT32 OP_PUNPCKLBW_Vdq_Wdq = 0x660f60; -const UINT32 OP_PUNPCKLWD_Pq_Qd = 0x0f61; -const UINT32 OP_PUNPCKLWD_Vdq_Wdq = 0x660f61; -const UINT32 OP_PUNPCKLDQ_Pq_Qd = 0x0f62; -const UINT32 OP_PUNPCKLDQ_Vdq_Wdq = 0x660f62; -const UINT32 OP_PACKSSWB_Pq_Qq = 0x0f63; -const UINT32 OP_PACKSSWB_Vdq_Wdq = 0x660f63; -const UINT32 OP_PCMPGTB_Pq_Qq = 0x0f64; -const UINT32 OP_PCMPGTB_Vdq_Wdq = 0x660f64; -const UINT32 OP_PCMPGTW_Pq_Qq = 0x0f65; -const UINT32 OP_PCMPGTW_Vdq_Wdq = 0x660f65; -const UINT32 OP_PCMPGTD_Pq_Qq = 0x0f66; -const UINT32 OP_PCMPGTD_Vdq_Wdq = 0x660f66; -const UINT32 OP_PACKUSWB_Pq_Qq = 0x0f67; -const UINT32 OP_PACKUSWB_Vdq_Wdq = 0x660f67; -const UINT32 OP_PUNPCKHBW_Pq_Qq = 0x0f68; -const UINT32 OP_PUNPCKHBW_Vdq_Qdq = 0x660f68; -const UINT32 OP_PUNPCKHWD_Pq_Qq = 0x0f69; -const UINT32 OP_PUNPCKHWD_Vdq_Qdq = 0x660f69; -const UINT32 OP_PUNPCKHDQ_Pq_Qq = 0x0f6a; -const UINT32 OP_PUNPCKHDQ_Vdq_Qdq = 0x660f6a; -const UINT32 OP_PACKSSDW_Pq_Qq = 0x0f6b; -const UINT32 OP_PACKSSDW_Vdq_Qdq = 0x660f6b; -const UINT32 OP_PUNPCKLQDQ_Vdq_Wdq = 0x660f6c; -const UINT32 OP_PUNPCKHQDQ_Vdq_Wdq = 0x660f6d; -const UINT32 OP_MOVD_Pd_Ed = 0x0f6e; -const UINT32 OP_MOVD_Vd_Ed = 0x660f6e; -const UINT32 OP_MOVQ_Pq_Qq = 0x0f6f; -const UINT32 OP_MOVDQA_Vdq_Wdq = 0x660f6f; -const UINT32 OP_MOVDQU_Vdq_Wdq = 0xf30f6f; - -const UINT32 OP_PSHUFW_Pq_Qq_Ib = 0x0f70; -const UINT32 OP_PSHUFD_Vdq_Wdq_Ib = 0x660f70; -const UINT32 OP_PSHUFHW_Vdq_Wdq_Ib = 0xf30f70; -const UINT32 OP_PSHUFLW_Vdq_Wdq_Ib = 0xf20f70; -const UINT32 OP_G12 = 0x0f71; -const UINT32 OP_G13 = 0x0f72; -const UINT32 OP_G14 = 0x0f73; -const UINT32 OP_PCMPEQB_Pq_Qq = 0x0f74; -const UINT32 OP_PCMPEQB_Vdq_Wdq = 0x660f74; -const UINT32 OP_PCMPEQW_Pq_Qq = 0x0f75; -const UINT32 OP_PCMPEQW_Vdq_Wdq = 0x660f75; -const UINT32 OP_PCMPEQD_Pq_Qq = 0x0f76; -const UINT32 OP_PCMPEQD_Vdq_Wdq = 0x660f76; -const UINT32 OP_EMMS = 0x0f77; -const UINT32 OP_VMREAD_Ed_Gd = 0x0f78; -const UINT32 OP_VMWRITE_Gd_Ed = 0x0f79; -const UINT32 OP_HADDPD_Vpd_Wpd = 0x660f7c; -const UINT32 OP_HADDPS_Vps_Wps = 0xf20f7c; -const UINT32 OP_HSUBPD_Vpd_Wpd = 0x660f7d; -const UINT32 OP_HSUBPS_Vps_Wps = 0xf20f7d; -const UINT32 OP_MOVD_Ed_Pd = 0x0f7e; -const UINT32 OP_MOVD_Ed_Vd = 0x660f7e; -const UINT32 OP_MOVQ_Vq_Wq = 0xf30f7e; -const UINT32 OP_MOVQ_Qq_Pq = 0x0f7f; -const UINT32 OP_MOVDQA_Wdq_Vdq = 0x660f7f; -const UINT32 OP_MOVDQU_Wdq_Vdq = 0xf30f7f; - -const UINT32 OP_JCC_O_Jv = 0x0f80; -const UINT32 OP_JCC_NO_Jv = 0x0f81; -const UINT32 OP_JCC_B_Jv = 0x0f82; -const UINT32 OP_JCC_C_Jv = 0x0f82; -const UINT32 OP_JCC_NAE_Jv = 0x0f82; -const UINT32 OP_JCC_AE_Jv = 0x0f83; -const UINT32 OP_JCC_NB_Jv = 0x0f83; -const UINT32 OP_JCC_NC_Jv = 0x0f83; -const UINT32 OP_JCC_E_Jv = 0x0f84; -const UINT32 OP_JCC_Z_Jv = 0x0f84; -const UINT32 OP_JCC_NE_Jv = 0x0f85; -const UINT32 OP_JCC_NZ_Jv = 0x0f85; -const UINT32 OP_JCC_BE_Jv = 0x0f86; -const UINT32 OP_JCC_NA_Jv = 0x0f86; -const UINT32 OP_JCC_A_Jv = 0x0f87; -const UINT32 OP_JCC_NBE_Jv = 0x0f87; -const UINT32 OP_JCC_S_Jv = 0x0f88; -const UINT32 OP_JCC_NS_Jv = 0x0f89; -const UINT32 OP_JCC_P_Jv = 0x0f8a; -const UINT32 OP_JCC_PE_Jv = 0x0f8a; -const UINT32 OP_JCC_NP_Jv = 0x0f8b; -const UINT32 OP_JCC_PO_Jv = 0x0f8b; -const UINT32 OP_JCC_L_Jv = 0x0f8c; -const UINT32 OP_JCC_NGE_Jv = 0x0f8c; -const UINT32 OP_JCC_NL_Jv = 0x0f8d; -const UINT32 OP_JCC_GE_Jv = 0x0f8d; -const UINT32 OP_JCC_LE_Jv = 0x0f8e; -const UINT32 OP_JCC_NG_Jv = 0x0f8e; -const UINT32 OP_JCC_NLE_Jv = 0x0f8f; -const UINT32 OP_JCC_G_Jv = 0x0f8f; - -const UINT32 OP_SETCC_O_Eb = (0x0f90 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NO_Eb = (0x0f91 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_B_Eb = (0x0f92 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_C_Eb = (0x0f92 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NAE_Eb = (0x0f92 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_AE_Eb = (0x0f93 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NB_Eb = (0x0f93 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NC_Eb = (0x0f93 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_E_Eb = (0x0f94 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_Z_Eb = (0x0f94 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NE_Eb = (0x0f95 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NZ_Eb = (0x0f95 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_BE_Eb = (0x0f96 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NA_Eb = (0x0f96 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_A_Eb = (0x0f97 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NBE_Eb = (0x0f97 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_S_Eb = (0x0f98 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NS_Eb = (0x0f99 | OPFLAG_8BITRM); -const UINT32 OP_SETCC_P_Eb = (0x0f9a | OPFLAG_8BITRM); -const UINT32 OP_SETCC_PE_Eb = (0x0f9a | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NP_Eb = (0x0f9b | OPFLAG_8BITRM); -const UINT32 OP_SETCC_PO_Eb = (0x0f9b | OPFLAG_8BITRM); -const UINT32 OP_SETCC_L_Eb = (0x0f9c | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NGE_Eb = (0x0f9c | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NL_Eb = (0x0f9d | OPFLAG_8BITRM); -const UINT32 OP_SETCC_GE_Eb = (0x0f9d | OPFLAG_8BITRM); -const UINT32 OP_SETCC_LE_Eb = (0x0f9e | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NG_Eb = (0x0f9e | OPFLAG_8BITRM); -const UINT32 OP_SETCC_NLE_Eb = (0x0f9f | OPFLAG_8BITRM); -const UINT32 OP_SETCC_G_Eb = (0x0f9f | OPFLAG_8BITRM); - -const UINT32 OP_PUSH_FS = 0x0fa0; -const UINT32 OP_POP_FS = 0x0fa1; -const UINT32 OP_CPUID = 0x0fa2; -const UINT32 OP_BT_Ev_Gv = 0x0fa3; -const UINT32 OP_SHLD_Ev_Gv_Ib = 0x0fa4; -const UINT32 OP_SHLD_Ev_Gv_CL = 0x0fa5; -const UINT32 OP_PUSH_GS = 0x0fa8; -const UINT32 OP_POP_GS = 0x0fa9; -const UINT32 OP_RSM = 0x0faa; -const UINT32 OP_BTS_Ev_Gv = 0x0fab; -const UINT32 OP_SHRD_Ev_Gv_Ib = 0x0fac; -const UINT32 OP_SHRD_Ev_Gv_CL = 0x0fad; -const UINT32 OP_G16 = 0x0fae; -const UINT32 OP_IMUL_Gv_Ev = 0x0faf; - -const UINT32 OP_CMPXCHG_Eb_Gb = (0x0fb0 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_CMPXCHG_Ev_Gv = 0x0fb1; -const UINT32 OP_LSS_Mp = 0x0fb2; -const UINT32 OP_BTR_Ev_Gv = 0x0fb3; -const UINT32 OP_LFS_Mp = 0x0fb4; -const UINT32 OP_LGS_Mp = 0x0fb5; -const UINT32 OP_MOVZX_Gv_Eb = (0x0fb6 | OPFLAG_8BITRM); -const UINT32 OP_MOVZX_Gv_Ew = 0x0fb7; -const UINT32 OP_JMPE = 0x0fb8; -const UINT32 OP_POPCNT_Gv_Ev = 0xf30fb8; -const UINT32 OP_G10_INVALID = 0x0fb9; -const UINT32 OP_G8_Ev_Ib = 0x0fba; -const UINT32 OP_BTC_Ev_Gv = 0x0fbb; -const UINT32 OP_BSF_Gv_Ev = 0x0fbc; -const UINT32 OP_BSR_Gv_Ev = 0x0fbd; -const UINT32 OP_MOVSX_Gv_Eb = (0x0fbe | OPFLAG_8BITRM); -const UINT32 OP_MOVSX_Gv_Ew = 0x0fbf; - -const UINT32 OP_XADD_Eb_Gb = (0x0fc0 | OPFLAG_8BITRM | OPFLAG_8BITREG); -const UINT32 OP_XADD_Ev_Gv = 0x0fc1; -const UINT32 OP_CMPPS_Vps_Wps_Ib = 0x0fc2; -const UINT32 OP_CMPSS_Vss_Wss_Ib = 0xf30fc2; -const UINT32 OP_CMPPD_Vpd_Wpd_Ib = 0x660fc2; -const UINT32 OP_CMPSD_Vsd_Wsd_Ib = 0xf20fc2; -const UINT32 OP_MOVNTI_Md_Gd = 0x0fc3; -const UINT32 OP_PINSRW_Pw_Ew_Ib = 0x0fc4; -const UINT32 OP_PINSRW_Vw_Ew_Ib = 0x660fc4; -const UINT32 OP_PEXTRW_Gw_Pw_Ib = 0x0fc5; -const UINT32 OP_PEXTRW_Gw_Vw_Ib = 0x660fc5; -const UINT32 OP_SHUFPS_Vps_Wps_Ib = 0x0fc6; -const UINT32 OP_SHUFPD_Vpd_Wpd_Ib = 0x660fc6; -const UINT32 OP_G9 = 0x0fc7; -const UINT32 OP_BSWAP_EAX = 0x0fc8; -const UINT32 OP_BSWAP_ECX = 0x0fc9; -const UINT32 OP_BSWAP_EDX = 0x0fca; -const UINT32 OP_BSWAP_EBX = 0x0fcb; -const UINT32 OP_BSWAP_ESP = 0x0fcc; -const UINT32 OP_BSWAP_EBP = 0x0fcd; -const UINT32 OP_BSWAP_ESI = 0x0fce; -const UINT32 OP_BSWAP_EDI = 0x0fcf; - -const UINT32 OP_ADDSUBPD_Vpd_Wpd = 0x0fd0; -const UINT32 OP_ADDSUBPS_Vps_Wps = 0xf20fd0; -const UINT32 OP_PSRLW_Pq_Qq = 0x0fd1; -const UINT32 OP_PSRLW_Vdq_Wdq = 0x660fd1; -const UINT32 OP_PSRLD_Pq_Qq = 0x0fd2; -const UINT32 OP_PSRLD_Vdq_Wdq = 0x660fd2; -const UINT32 OP_PSRLQ_Pq_Qq = 0x0fd3; -const UINT32 OP_PSRLQ_Vdq_Wdq = 0x660fd3; -const UINT32 OP_PADDQ_Pq_Qq = 0x0fd4; -const UINT32 OP_PADDQ_Vdq_Wdq = 0x660fd4; -const UINT32 OP_PMULLW_Pq_Qq = 0x0fd5; -const UINT32 OP_PMULLW_Vdq_Wdq = 0x660fd5; -const UINT32 OP_MOVQ_Wq_Vq = 0x0fd6; -const UINT32 OP_MOVQ2DQ_Vdq_Qq = 0xf30fd6; -const UINT32 OP_MOVDQ2Q_Pq_Vq = 0xf20fd6; -const UINT32 OP_PMOVMSKB_Gd_Pq = 0x0fd7; -const UINT32 OP_PMOVMSKB_Gd_Vdq = 0x660fd7; -const UINT32 OP_PSUBUSB_Pq_Qq = 0x0fd8; -const UINT32 OP_PSUBUSB_Vdq_Wdq = 0x660fd8; -const UINT32 OP_PSUBUSW_Pq_Qq = 0x0fd9; -const UINT32 OP_PSUBUSW_Vdq_Wdq = 0x660fd9; -const UINT32 OP_PMINUB_Pq_Qq = 0x0fda; -const UINT32 OP_PMINUB_Vdq_Wdq = 0x660fda; -const UINT32 OP_PAND_Pq_Qq = 0x0fdb; -const UINT32 OP_PAND_Vdq_Wdq = 0x660fdb; -const UINT32 OP_PADDUSB_Pq_Qq = 0x0fdc; -const UINT32 OP_PADDUSB_Vdq_Wdq = 0x660fdc; -const UINT32 OP_PADDUSW_Pq_Qq = 0x0fdd; -const UINT32 OP_PADDUSW_Vdq_Wdq = 0x660fdd; -const UINT32 OP_PMAXUB_Pq_Qq = 0x0fde; -const UINT32 OP_PMAXUB_Vdq_Wdq = 0x660fde; -const UINT32 OP_PANDN_Pq_Qq = 0x0fdf; -const UINT32 OP_PANDN_Vdq_Wdq = 0x660fdf; - -const UINT32 OP_PAVGB_Pq_Qq = 0x0fe0; -const UINT32 OP_PAVGB_Vdq_Wdq = 0x660fe0; -const UINT32 OP_PSRAW_Pq_Qq = 0x0fe1; -const UINT32 OP_PSRAW_Vdq_Wdq = 0x660fe1; -const UINT32 OP_PSRAD_Pq_Qq = 0x0fe2; -const UINT32 OP_PSRAD_Vdq_Wdq = 0x660fe2; -const UINT32 OP_PAVGW_Pq_Qq = 0x0fe3; -const UINT32 OP_PAVGW_Vdq_Wdq = 0x660fe3; -const UINT32 OP_PMULHUW_Pq_Qq = 0x0fe4; -const UINT32 OP_PMULHUW_Vdq_Wdq = 0x660fe4; -const UINT32 OP_PMULHW_Pq_Qq = 0x0fe5; -const UINT32 OP_PMULHW_Vdq_Wdq = 0x660fe5; -const UINT32 OP_CVTPD2DQ_Vdq_Wpd = 0xf20fe6; -const UINT32 OP_CVTTPD2DQ_Vdq_Wpd = 0x660fe6; -const UINT32 OP_CVTDQ2PD_Vpd_Wq = 0xf30fe6; -const UINT32 OP_MOVNTQ_Mq_Vq = 0x0fe7; -const UINT32 OP_MOVNTDQ_Mdq_Vdq = 0x660fe7; -const UINT32 OP_PSUBSB_Pq_Qq = 0x0fe8; -const UINT32 OP_PSUBSB_Vdq_Wdq = 0x660fe8; -const UINT32 OP_PSUBSW_Pq_Qq = 0x0fe9; -const UINT32 OP_PSUBSW_Vdq_Wdq = 0x660fe9; -const UINT32 OP_PMINSW_Pq_Qq = 0x0fea; -const UINT32 OP_PMINSW_Vdq_Wdq = 0x660fea; -const UINT32 OP_POR_Pq_Qq = 0x0feb; -const UINT32 OP_POR_Vdq_Wdq = 0x660feb; -const UINT32 OP_PADDSB_Pq_Qq = 0x0fec; -const UINT32 OP_PADDSB_Vdq_Wdq = 0x660fec; -const UINT32 OP_PADDSW_Pq_Qq = 0x0fed; -const UINT32 OP_PADDSW_Vdq_Wdq = 0x660fed; -const UINT32 OP_PMAXSW_Pq_Qq = 0x0fee; -const UINT32 OP_PMAXSW_Vdq_Wdq = 0x660fee; -const UINT32 OP_PXOR_Pq_Qq = 0x0fef; -const UINT32 OP_PXOR_Vdq_Wdq = 0x660fef; - -const UINT32 OP_LDDQU_Vdq_Mdq = 0xf20ff0; -const UINT32 OP_PSLLW_Pq_Qq = 0x0ff1; -const UINT32 OP_PSLLW_Vdq_Wdq = 0x660ff1; -const UINT32 OP_PSLLD_Pq_Qq = 0x0ff2; -const UINT32 OP_PSLLD_Vdq_Wdq = 0x660ff2; -const UINT32 OP_PSLLQ_Pq_Qq = 0x0ff3; -const UINT32 OP_PSLLQ_Vdq_Wdq = 0x660ff3; -const UINT32 OP_PMULUDQ_Pq_Qq = 0x0ff4; -const UINT32 OP_PMULUDQ_Vdq_Wdq = 0x660ff4; -const UINT32 OP_PMADDWD_Pq_Qq = 0x0ff5; -const UINT32 OP_PMADDWD_Vdq_Wdq = 0x660ff5; -const UINT32 OP_PSADBW_Pq_Qq = 0x0ff6; -const UINT32 OP_PSADBW_Vdq_Wdq = 0x660ff6; -const UINT32 OP_MASKMOVQ_Pq_Qq = 0x0ff7; -const UINT32 OP_MASKMOVDQU_Vdq_Wdq = 0x660ff7; -const UINT32 OP_PSUBB_Pq_Qq = 0x0ff8; -const UINT32 OP_PSUBB_Vdq_Wdq = 0x660ff8; -const UINT32 OP_PSUBW_Pq_Qq = 0x0ff9; -const UINT32 OP_PSUBW_Vdq_Wdq = 0x660ff9; -const UINT32 OP_PSUBD_Pq_Qq = 0x0ffa; -const UINT32 OP_PSUBD_Vdq_Wdq = 0x660ffa; -const UINT32 OP_PSUBQ_Pq_Qq = 0x0ffb; -const UINT32 OP_PSUBQ_Vdq_Wdq = 0x660ffb; -const UINT32 OP_PADDB_Pq_Qq = 0x0ffc; -const UINT32 OP_PADDB_Vdq_Wdq = 0x660ffc; -const UINT32 OP_PADDW_Pq_Qq = 0x0ffd; -const UINT32 OP_PADDW_Vdq_Wdq = 0x660ffd; -const UINT32 OP_PADDD_Pq_Qq = 0x0ffe; -const UINT32 OP_PADDD_Vdq_Wdq = 0x660ffe; +const uint32_t OP_G6 = 0x0f00; +const uint32_t OP_G7 = 0x0f01; +const uint32_t OP_LAR_Gv_Ew = 0x0f02; +const uint32_t OP_LSL_Gv_Ew = 0x0f03; +const uint32_t OP_SYSCALL = 0x0f05; +const uint32_t OP_CLTS = 0x0f06; +const uint32_t OP_SYSRET = 0x0f07; +const uint32_t OP_INVD = 0x0f08; +const uint32_t OP_WBINVD = 0x0f09; +const uint32_t OP_UD2 = 0x0f0b; +const uint32_t OP_NOP0d_Ev = 0x0f0d; + +const uint32_t OP_MOVUPS_Vps_Wps = 0x0f10; +const uint32_t OP_MOVSS_Vss_Wss = 0xf30f10; +const uint32_t OP_MOVUPD_Vpd_Wpd = 0x660f10; +const uint32_t OP_MOVSD_Vsd_Wsd = 0xf20f10; +const uint32_t OP_MOVUPS_Wps_Vps = 0x0f11; +const uint32_t OP_MOVSS_Wss_Vss = 0xf30f11; +const uint32_t OP_MOVUPD_Wpd_Vpd = 0x660f11; +const uint32_t OP_MOVSD_Wsd_Vsd = 0xf20f11; +const uint32_t OP_MOVLPS_Vq_Mq = 0x0f12; +const uint32_t OP_MOVLPD_Vq_Mq = 0x660f12; +const uint32_t OP_MOVHLPS_Vq_Uq = 0x0f12; +const uint32_t OP_MOVDDUP_Vq_Wq = 0xf20f12; +const uint32_t OP_MOVSLDUP_Vq_Wq = 0xf30f12; +const uint32_t OP_MOVLPS_Mq_Vq = 0x0f13; +const uint32_t OP_MOVLPD_Mq_Vq = 0x660f13; +const uint32_t OP_UNPCKLPS_Vps_Wq = 0x0f14; +const uint32_t OP_UNPCKLPD_Vpd_Wq = 0x660f14; +const uint32_t OP_UNPCKHPS_Vps_Wq = 0x0f15; +const uint32_t OP_UNPCKHPD_Vpd_Wq = 0x660f15; +const uint32_t OP_MOVHPS_Vq_Mq = 0x0f16; +const uint32_t OP_MOVHPD_Vq_Mq = 0x660f16; +const uint32_t OP_MOVLHPS_Vq_Uq = 0x0f16; +const uint32_t OP_MOVSHDUP_Vq_Wq = 0xf30f16; +const uint32_t OP_MOVHPS_Mq_Vq = 0x0f17; +const uint32_t OP_MOVHPD_Mq_Vq = 0x660f17; +const uint32_t OP_PREFETCH_G16 = 0x0f18; +const uint32_t OP_NOP1f_Ev = 0x0f1f; + +const uint32_t OP_MOV_Rd_Cd = 0x0f20; +const uint32_t OP_MOV_Rd_Dd = 0x0f21; +const uint32_t OP_MOV_Cd_Rd = 0x0f22; +const uint32_t OP_MOV_Dd_Rd = 0x0f23; +const uint32_t OP_MOVAPS_Vps_Wps = 0x0f28; +const uint32_t OP_MOVAPD_Vpd_Wpd = 0x660f28; +const uint32_t OP_MOVAPS_Wps_Vps = 0x0f29; +const uint32_t OP_MOVAPD_Wpd_Vpd = 0x660f29; +const uint32_t OP_CVTPI2PS_Vps_Qq = 0x0f2a; +const uint32_t OP_CVTSI2SS_Vss_Ed = 0xf30f2a; +const uint32_t OP_CVTPI2PD_Vpd_Qq = 0x660f2a; +const uint32_t OP_CVTSI2SD_Vsd_Ed = 0xf20f2a; +const uint32_t OP_MOVNTPS_Mps_Vps = 0x0f2b; +const uint32_t OP_MOVNTPD_Mpd_Vpd = 0x660f2b; +const uint32_t OP_CVTTPS2PI_Pq_Wq = 0x0f2c; +const uint32_t OP_CVTTSS2SI_Gd_Wss = 0xf30f2c; +const uint32_t OP_CVTTPD2PI_Pq_Wpd = 0x660f2c; +const uint32_t OP_CVTTSD2SI_Gd_Wsd = 0xf20f2c; +const uint32_t OP_CVTPS2PI_Pq_Wq = 0x0f2d; +const uint32_t OP_CVTSS2SI_Gd_Wss = 0xf30f2d; +const uint32_t OP_CVTPD2PI_Pq_Wpd = 0x660f2d; +const uint32_t OP_CVTSD2SI_Gd_Wsd = 0xf20f2d; +const uint32_t OP_UCOMISS_Vss_Wss = 0x0f2e; +const uint32_t OP_UCOMISD_Vsd_Wsd = 0x660f2e; +const uint32_t OP_COMISS_Vss_Wss = 0x0f2f; +const uint32_t OP_COMISD_Vsd_Wsd = 0x660f2f; + +const uint32_t OP_WRMSR = 0x0f30; +const uint32_t OP_RDTSC = 0x0f31; +const uint32_t OP_RDMSR = 0x0f32; +const uint32_t OP_RDPMC = 0x0f33; +const uint32_t OP_SYSENTER = 0x0f34; +const uint32_t OP_SYSEXIT = 0x0f35; +const uint32_t OP_GETSEC = 0x0f37; + +const uint32_t OP_CMOV_O_Gv_Ev = 0x0f40; +const uint32_t OP_CMOV_NO_Gv_Ev = 0x0f41; +const uint32_t OP_CMOV_B_Gv_Ev = 0x0f42; +const uint32_t OP_CMOV_C_Gv_Ev = 0x0f42; +const uint32_t OP_CMOV_AE_Gv_Ev = 0x0f43; +const uint32_t OP_CMOV_NC_Gv_Ev = 0x0f43; +const uint32_t OP_CMOV_E_Gv_Ev = 0x0f44; +const uint32_t OP_CMOV_Z_Gv_Ev = 0x0f44; +const uint32_t OP_CMOV_NE_Gv_Ev = 0x0f45; +const uint32_t OP_CMOV_NZ_Gv_Ev = 0x0f45; +const uint32_t OP_CMOV_BE_Gv_Ev = 0x0f46; +const uint32_t OP_CMOV_A_Gv_Ev = 0x0f47; +const uint32_t OP_CMOV_S_Gv_Ev = 0x0f48; +const uint32_t OP_CMOV_NS_Gv_Ev = 0x0f49; +const uint32_t OP_CMOV_P_Gv_Ev = 0x0f4a; +const uint32_t OP_CMOV_PE_Gv_Ev = 0x0f4a; +const uint32_t OP_CMOV_NP_Gv_Ev = 0x0f4b; +const uint32_t OP_CMOV_PO_Gv_Ev = 0x0f4b; +const uint32_t OP_CMOV_L_Gv_Ev = 0x0f4c; +const uint32_t OP_CMOV_NGE_Gv_Ev = 0x0f4c; +const uint32_t OP_CMOV_NL_Gv_Ev = 0x0f4d; +const uint32_t OP_CMOV_GE_Gv_Ev = 0x0f4d; +const uint32_t OP_CMOV_LE_Gv_Ev = 0x0f4e; +const uint32_t OP_CMOV_NG_Gv_Ev = 0x0f4e; +const uint32_t OP_CMOV_NLE_Gv_Ev = 0x0f4f; +const uint32_t OP_CMOV_G_Gv_Ev = 0x0f4f; + +const uint32_t OP_MOVMSKPS_Gd_Ups = 0x0f50; +const uint32_t OP_MOVMSKPD_Gd_Upd = 0x660f50; +const uint32_t OP_SQRTPS_Vps_Wps = 0x0f51; +const uint32_t OP_SQRTSS_Vss_Wss = 0xf30f51; +const uint32_t OP_SQRTPD_Vpd_Wpd = 0x660f51; +const uint32_t OP_SQRTSD_Vsd_Wsd = 0xf20f51; +const uint32_t OP_RSQRTPS_Vps_Wps = 0x0f52; +const uint32_t OP_RSQRTSS_Vss_Wss = 0xf30f52; +const uint32_t OP_RCPPS_Vps_Wps = 0x0f53; +const uint32_t OP_RCPSS_Vss_Wss = 0xf30f53; +const uint32_t OP_ANDPS_Vps_Wps = 0x0f54; +const uint32_t OP_ANDPD_Vpd_Wpd = 0x660f54; +const uint32_t OP_ANDNPS_Vps_Wps = 0x0f55; +const uint32_t OP_ANDNPD_Vpd_Wpd = 0x660f55; +const uint32_t OP_ORPS_Vps_Wps = 0x0f56; +const uint32_t OP_ORPD_Vpd_Wpd = 0x660f56; +const uint32_t OP_XORPS_Vps_Wps = 0x0f57; +const uint32_t OP_XORPD_Vpd_Wpd = 0x660f57; +const uint32_t OP_ADDPS_Vps_Wps = 0x0f58; +const uint32_t OP_ADDSS_Vss_Wss = 0xf30f58; +const uint32_t OP_ADDPD_Vpd_Wpd = 0x660f58; +const uint32_t OP_ADDSD_Vsd_Wsd = 0xf20f58; +const uint32_t OP_MULPS_Vps_Wps = 0x0f59; +const uint32_t OP_MULSS_Vss_Wss = 0xf30f59; +const uint32_t OP_MULPD_Vpd_Wpd = 0x660f59; +const uint32_t OP_MULSD_Vsd_Wsd = 0xf20f59; +const uint32_t OP_CVTPS2PD_Vpd_Wq = 0x0f5a; +const uint32_t OP_CVTSS2SD_Vsd_Wss = 0xf30f5a; +const uint32_t OP_CVTPD2PS_Vps_Wpd = 0x660f5a; +const uint32_t OP_CVTSD2SS_Vss_Wsd = 0xf20f5a; +const uint32_t OP_CVTDQ2PS_Vps_Wdq = 0x0f5b; +const uint32_t OP_CVTPS2DQ_Vdq_Wps = 0x660f5b; +const uint32_t OP_CVTTPS2DQ_Vdq_Wps = 0xf30f5b; +const uint32_t OP_SUBPS_Vps_Wps = 0x0f5c; +const uint32_t OP_SUBSS_Vss_Wss = 0xf30f5c; +const uint32_t OP_SUBPD_Vpd_Wpd = 0x660f5c; +const uint32_t OP_SUBSD_Vsd_Wsd = 0xf20f5c; +const uint32_t OP_MINPS_Vps_Wps = 0x0f5d; +const uint32_t OP_MINSS_Vss_Wss = 0xf30f5d; +const uint32_t OP_MINPD_Vpd_Wpd = 0x660f5d; +const uint32_t OP_MINSD_Vsd_Wsd = 0xf20f5d; +const uint32_t OP_DIVPS_Vps_Wps = 0x0f5e; +const uint32_t OP_DIVSS_Vss_Wss = 0xf30f5e; +const uint32_t OP_DIVPD_Vpd_Wpd = 0x660f5e; +const uint32_t OP_DIVSD_Vsd_Wsd = 0xf20f5e; +const uint32_t OP_MAXPS_Vps_Wps = 0x0f5f; +const uint32_t OP_MAXSS_Vss_Wss = 0xf30f5f; +const uint32_t OP_MAXPD_Vpd_Wpd = 0x660f5f; +const uint32_t OP_MAXSD_Vsd_Wsd = 0xf20f5f; + +const uint32_t OP_PUNPCKLBW_Pq_Qd = 0x0f60; +const uint32_t OP_PUNPCKLBW_Vdq_Wdq = 0x660f60; +const uint32_t OP_PUNPCKLWD_Pq_Qd = 0x0f61; +const uint32_t OP_PUNPCKLWD_Vdq_Wdq = 0x660f61; +const uint32_t OP_PUNPCKLDQ_Pq_Qd = 0x0f62; +const uint32_t OP_PUNPCKLDQ_Vdq_Wdq = 0x660f62; +const uint32_t OP_PACKSSWB_Pq_Qq = 0x0f63; +const uint32_t OP_PACKSSWB_Vdq_Wdq = 0x660f63; +const uint32_t OP_PCMPGTB_Pq_Qq = 0x0f64; +const uint32_t OP_PCMPGTB_Vdq_Wdq = 0x660f64; +const uint32_t OP_PCMPGTW_Pq_Qq = 0x0f65; +const uint32_t OP_PCMPGTW_Vdq_Wdq = 0x660f65; +const uint32_t OP_PCMPGTD_Pq_Qq = 0x0f66; +const uint32_t OP_PCMPGTD_Vdq_Wdq = 0x660f66; +const uint32_t OP_PACKUSWB_Pq_Qq = 0x0f67; +const uint32_t OP_PACKUSWB_Vdq_Wdq = 0x660f67; +const uint32_t OP_PUNPCKHBW_Pq_Qq = 0x0f68; +const uint32_t OP_PUNPCKHBW_Vdq_Qdq = 0x660f68; +const uint32_t OP_PUNPCKHWD_Pq_Qq = 0x0f69; +const uint32_t OP_PUNPCKHWD_Vdq_Qdq = 0x660f69; +const uint32_t OP_PUNPCKHDQ_Pq_Qq = 0x0f6a; +const uint32_t OP_PUNPCKHDQ_Vdq_Qdq = 0x660f6a; +const uint32_t OP_PACKSSDW_Pq_Qq = 0x0f6b; +const uint32_t OP_PACKSSDW_Vdq_Qdq = 0x660f6b; +const uint32_t OP_PUNPCKLQDQ_Vdq_Wdq = 0x660f6c; +const uint32_t OP_PUNPCKHQDQ_Vdq_Wdq = 0x660f6d; +const uint32_t OP_MOVD_Pd_Ed = 0x0f6e; +const uint32_t OP_MOVD_Vd_Ed = 0x660f6e; +const uint32_t OP_MOVQ_Pq_Qq = 0x0f6f; +const uint32_t OP_MOVDQA_Vdq_Wdq = 0x660f6f; +const uint32_t OP_MOVDQU_Vdq_Wdq = 0xf30f6f; + +const uint32_t OP_PSHUFW_Pq_Qq_Ib = 0x0f70; +const uint32_t OP_PSHUFD_Vdq_Wdq_Ib = 0x660f70; +const uint32_t OP_PSHUFHW_Vdq_Wdq_Ib = 0xf30f70; +const uint32_t OP_PSHUFLW_Vdq_Wdq_Ib = 0xf20f70; +const uint32_t OP_G12 = 0x0f71; +const uint32_t OP_G13 = 0x0f72; +const uint32_t OP_G14 = 0x0f73; +const uint32_t OP_PCMPEQB_Pq_Qq = 0x0f74; +const uint32_t OP_PCMPEQB_Vdq_Wdq = 0x660f74; +const uint32_t OP_PCMPEQW_Pq_Qq = 0x0f75; +const uint32_t OP_PCMPEQW_Vdq_Wdq = 0x660f75; +const uint32_t OP_PCMPEQD_Pq_Qq = 0x0f76; +const uint32_t OP_PCMPEQD_Vdq_Wdq = 0x660f76; +const uint32_t OP_EMMS = 0x0f77; +const uint32_t OP_VMREAD_Ed_Gd = 0x0f78; +const uint32_t OP_VMWRITE_Gd_Ed = 0x0f79; +const uint32_t OP_HADDPD_Vpd_Wpd = 0x660f7c; +const uint32_t OP_HADDPS_Vps_Wps = 0xf20f7c; +const uint32_t OP_HSUBPD_Vpd_Wpd = 0x660f7d; +const uint32_t OP_HSUBPS_Vps_Wps = 0xf20f7d; +const uint32_t OP_MOVD_Ed_Pd = 0x0f7e; +const uint32_t OP_MOVD_Ed_Vd = 0x660f7e; +const uint32_t OP_MOVQ_Vq_Wq = 0xf30f7e; +const uint32_t OP_MOVQ_Qq_Pq = 0x0f7f; +const uint32_t OP_MOVDQA_Wdq_Vdq = 0x660f7f; +const uint32_t OP_MOVDQU_Wdq_Vdq = 0xf30f7f; + +const uint32_t OP_JCC_O_Jv = 0x0f80; +const uint32_t OP_JCC_NO_Jv = 0x0f81; +const uint32_t OP_JCC_B_Jv = 0x0f82; +const uint32_t OP_JCC_C_Jv = 0x0f82; +const uint32_t OP_JCC_NAE_Jv = 0x0f82; +const uint32_t OP_JCC_AE_Jv = 0x0f83; +const uint32_t OP_JCC_NB_Jv = 0x0f83; +const uint32_t OP_JCC_NC_Jv = 0x0f83; +const uint32_t OP_JCC_E_Jv = 0x0f84; +const uint32_t OP_JCC_Z_Jv = 0x0f84; +const uint32_t OP_JCC_NE_Jv = 0x0f85; +const uint32_t OP_JCC_NZ_Jv = 0x0f85; +const uint32_t OP_JCC_BE_Jv = 0x0f86; +const uint32_t OP_JCC_NA_Jv = 0x0f86; +const uint32_t OP_JCC_A_Jv = 0x0f87; +const uint32_t OP_JCC_NBE_Jv = 0x0f87; +const uint32_t OP_JCC_S_Jv = 0x0f88; +const uint32_t OP_JCC_NS_Jv = 0x0f89; +const uint32_t OP_JCC_P_Jv = 0x0f8a; +const uint32_t OP_JCC_PE_Jv = 0x0f8a; +const uint32_t OP_JCC_NP_Jv = 0x0f8b; +const uint32_t OP_JCC_PO_Jv = 0x0f8b; +const uint32_t OP_JCC_L_Jv = 0x0f8c; +const uint32_t OP_JCC_NGE_Jv = 0x0f8c; +const uint32_t OP_JCC_NL_Jv = 0x0f8d; +const uint32_t OP_JCC_GE_Jv = 0x0f8d; +const uint32_t OP_JCC_LE_Jv = 0x0f8e; +const uint32_t OP_JCC_NG_Jv = 0x0f8e; +const uint32_t OP_JCC_NLE_Jv = 0x0f8f; +const uint32_t OP_JCC_G_Jv = 0x0f8f; + +const uint32_t OP_SETCC_O_Eb = (0x0f90 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NO_Eb = (0x0f91 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_B_Eb = (0x0f92 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_C_Eb = (0x0f92 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NAE_Eb = (0x0f92 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_AE_Eb = (0x0f93 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NB_Eb = (0x0f93 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NC_Eb = (0x0f93 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_E_Eb = (0x0f94 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_Z_Eb = (0x0f94 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NE_Eb = (0x0f95 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NZ_Eb = (0x0f95 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_BE_Eb = (0x0f96 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NA_Eb = (0x0f96 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_A_Eb = (0x0f97 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NBE_Eb = (0x0f97 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_S_Eb = (0x0f98 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NS_Eb = (0x0f99 | OPFLAG_8BITRM); +const uint32_t OP_SETCC_P_Eb = (0x0f9a | OPFLAG_8BITRM); +const uint32_t OP_SETCC_PE_Eb = (0x0f9a | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NP_Eb = (0x0f9b | OPFLAG_8BITRM); +const uint32_t OP_SETCC_PO_Eb = (0x0f9b | OPFLAG_8BITRM); +const uint32_t OP_SETCC_L_Eb = (0x0f9c | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NGE_Eb = (0x0f9c | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NL_Eb = (0x0f9d | OPFLAG_8BITRM); +const uint32_t OP_SETCC_GE_Eb = (0x0f9d | OPFLAG_8BITRM); +const uint32_t OP_SETCC_LE_Eb = (0x0f9e | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NG_Eb = (0x0f9e | OPFLAG_8BITRM); +const uint32_t OP_SETCC_NLE_Eb = (0x0f9f | OPFLAG_8BITRM); +const uint32_t OP_SETCC_G_Eb = (0x0f9f | OPFLAG_8BITRM); + +const uint32_t OP_PUSH_FS = 0x0fa0; +const uint32_t OP_POP_FS = 0x0fa1; +const uint32_t OP_CPUID = 0x0fa2; +const uint32_t OP_BT_Ev_Gv = 0x0fa3; +const uint32_t OP_SHLD_Ev_Gv_Ib = 0x0fa4; +const uint32_t OP_SHLD_Ev_Gv_CL = 0x0fa5; +const uint32_t OP_PUSH_GS = 0x0fa8; +const uint32_t OP_POP_GS = 0x0fa9; +const uint32_t OP_RSM = 0x0faa; +const uint32_t OP_BTS_Ev_Gv = 0x0fab; +const uint32_t OP_SHRD_Ev_Gv_Ib = 0x0fac; +const uint32_t OP_SHRD_Ev_Gv_CL = 0x0fad; +const uint32_t OP_G16 = 0x0fae; +const uint32_t OP_IMUL_Gv_Ev = 0x0faf; + +const uint32_t OP_CMPXCHG_Eb_Gb = (0x0fb0 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_CMPXCHG_Ev_Gv = 0x0fb1; +const uint32_t OP_LSS_Mp = 0x0fb2; +const uint32_t OP_BTR_Ev_Gv = 0x0fb3; +const uint32_t OP_LFS_Mp = 0x0fb4; +const uint32_t OP_LGS_Mp = 0x0fb5; +const uint32_t OP_MOVZX_Gv_Eb = (0x0fb6 | OPFLAG_8BITRM); +const uint32_t OP_MOVZX_Gv_Ew = 0x0fb7; +const uint32_t OP_JMPE = 0x0fb8; +const uint32_t OP_POPCNT_Gv_Ev = 0xf30fb8; +const uint32_t OP_G10_INVALID = 0x0fb9; +const uint32_t OP_G8_Ev_Ib = 0x0fba; +const uint32_t OP_BTC_Ev_Gv = 0x0fbb; +const uint32_t OP_BSF_Gv_Ev = 0x0fbc; +const uint32_t OP_BSR_Gv_Ev = 0x0fbd; +const uint32_t OP_MOVSX_Gv_Eb = (0x0fbe | OPFLAG_8BITRM); +const uint32_t OP_MOVSX_Gv_Ew = 0x0fbf; + +const uint32_t OP_XADD_Eb_Gb = (0x0fc0 | OPFLAG_8BITRM | OPFLAG_8BITREG); +const uint32_t OP_XADD_Ev_Gv = 0x0fc1; +const uint32_t OP_CMPPS_Vps_Wps_Ib = 0x0fc2; +const uint32_t OP_CMPSS_Vss_Wss_Ib = 0xf30fc2; +const uint32_t OP_CMPPD_Vpd_Wpd_Ib = 0x660fc2; +const uint32_t OP_CMPSD_Vsd_Wsd_Ib = 0xf20fc2; +const uint32_t OP_MOVNTI_Md_Gd = 0x0fc3; +const uint32_t OP_PINSRW_Pw_Ew_Ib = 0x0fc4; +const uint32_t OP_PINSRW_Vw_Ew_Ib = 0x660fc4; +const uint32_t OP_PEXTRW_Gw_Pw_Ib = 0x0fc5; +const uint32_t OP_PEXTRW_Gw_Vw_Ib = 0x660fc5; +const uint32_t OP_SHUFPS_Vps_Wps_Ib = 0x0fc6; +const uint32_t OP_SHUFPD_Vpd_Wpd_Ib = 0x660fc6; +const uint32_t OP_G9 = 0x0fc7; +const uint32_t OP_BSWAP_EAX = 0x0fc8; +const uint32_t OP_BSWAP_ECX = 0x0fc9; +const uint32_t OP_BSWAP_EDX = 0x0fca; +const uint32_t OP_BSWAP_EBX = 0x0fcb; +const uint32_t OP_BSWAP_ESP = 0x0fcc; +const uint32_t OP_BSWAP_EBP = 0x0fcd; +const uint32_t OP_BSWAP_ESI = 0x0fce; +const uint32_t OP_BSWAP_EDI = 0x0fcf; + +const uint32_t OP_ADDSUBPD_Vpd_Wpd = 0x0fd0; +const uint32_t OP_ADDSUBPS_Vps_Wps = 0xf20fd0; +const uint32_t OP_PSRLW_Pq_Qq = 0x0fd1; +const uint32_t OP_PSRLW_Vdq_Wdq = 0x660fd1; +const uint32_t OP_PSRLD_Pq_Qq = 0x0fd2; +const uint32_t OP_PSRLD_Vdq_Wdq = 0x660fd2; +const uint32_t OP_PSRLQ_Pq_Qq = 0x0fd3; +const uint32_t OP_PSRLQ_Vdq_Wdq = 0x660fd3; +const uint32_t OP_PADDQ_Pq_Qq = 0x0fd4; +const uint32_t OP_PADDQ_Vdq_Wdq = 0x660fd4; +const uint32_t OP_PMULLW_Pq_Qq = 0x0fd5; +const uint32_t OP_PMULLW_Vdq_Wdq = 0x660fd5; +const uint32_t OP_MOVQ_Wq_Vq = 0x0fd6; +const uint32_t OP_MOVQ2DQ_Vdq_Qq = 0xf30fd6; +const uint32_t OP_MOVDQ2Q_Pq_Vq = 0xf20fd6; +const uint32_t OP_PMOVMSKB_Gd_Pq = 0x0fd7; +const uint32_t OP_PMOVMSKB_Gd_Vdq = 0x660fd7; +const uint32_t OP_PSUBUSB_Pq_Qq = 0x0fd8; +const uint32_t OP_PSUBUSB_Vdq_Wdq = 0x660fd8; +const uint32_t OP_PSUBUSW_Pq_Qq = 0x0fd9; +const uint32_t OP_PSUBUSW_Vdq_Wdq = 0x660fd9; +const uint32_t OP_PMINUB_Pq_Qq = 0x0fda; +const uint32_t OP_PMINUB_Vdq_Wdq = 0x660fda; +const uint32_t OP_PAND_Pq_Qq = 0x0fdb; +const uint32_t OP_PAND_Vdq_Wdq = 0x660fdb; +const uint32_t OP_PADDUSB_Pq_Qq = 0x0fdc; +const uint32_t OP_PADDUSB_Vdq_Wdq = 0x660fdc; +const uint32_t OP_PADDUSW_Pq_Qq = 0x0fdd; +const uint32_t OP_PADDUSW_Vdq_Wdq = 0x660fdd; +const uint32_t OP_PMAXUB_Pq_Qq = 0x0fde; +const uint32_t OP_PMAXUB_Vdq_Wdq = 0x660fde; +const uint32_t OP_PANDN_Pq_Qq = 0x0fdf; +const uint32_t OP_PANDN_Vdq_Wdq = 0x660fdf; + +const uint32_t OP_PAVGB_Pq_Qq = 0x0fe0; +const uint32_t OP_PAVGB_Vdq_Wdq = 0x660fe0; +const uint32_t OP_PSRAW_Pq_Qq = 0x0fe1; +const uint32_t OP_PSRAW_Vdq_Wdq = 0x660fe1; +const uint32_t OP_PSRAD_Pq_Qq = 0x0fe2; +const uint32_t OP_PSRAD_Vdq_Wdq = 0x660fe2; +const uint32_t OP_PAVGW_Pq_Qq = 0x0fe3; +const uint32_t OP_PAVGW_Vdq_Wdq = 0x660fe3; +const uint32_t OP_PMULHUW_Pq_Qq = 0x0fe4; +const uint32_t OP_PMULHUW_Vdq_Wdq = 0x660fe4; +const uint32_t OP_PMULHW_Pq_Qq = 0x0fe5; +const uint32_t OP_PMULHW_Vdq_Wdq = 0x660fe5; +const uint32_t OP_CVTPD2DQ_Vdq_Wpd = 0xf20fe6; +const uint32_t OP_CVTTPD2DQ_Vdq_Wpd = 0x660fe6; +const uint32_t OP_CVTDQ2PD_Vpd_Wq = 0xf30fe6; +const uint32_t OP_MOVNTQ_Mq_Vq = 0x0fe7; +const uint32_t OP_MOVNTDQ_Mdq_Vdq = 0x660fe7; +const uint32_t OP_PSUBSB_Pq_Qq = 0x0fe8; +const uint32_t OP_PSUBSB_Vdq_Wdq = 0x660fe8; +const uint32_t OP_PSUBSW_Pq_Qq = 0x0fe9; +const uint32_t OP_PSUBSW_Vdq_Wdq = 0x660fe9; +const uint32_t OP_PMINSW_Pq_Qq = 0x0fea; +const uint32_t OP_PMINSW_Vdq_Wdq = 0x660fea; +const uint32_t OP_POR_Pq_Qq = 0x0feb; +const uint32_t OP_POR_Vdq_Wdq = 0x660feb; +const uint32_t OP_PADDSB_Pq_Qq = 0x0fec; +const uint32_t OP_PADDSB_Vdq_Wdq = 0x660fec; +const uint32_t OP_PADDSW_Pq_Qq = 0x0fed; +const uint32_t OP_PADDSW_Vdq_Wdq = 0x660fed; +const uint32_t OP_PMAXSW_Pq_Qq = 0x0fee; +const uint32_t OP_PMAXSW_Vdq_Wdq = 0x660fee; +const uint32_t OP_PXOR_Pq_Qq = 0x0fef; +const uint32_t OP_PXOR_Vdq_Wdq = 0x660fef; + +const uint32_t OP_LDDQU_Vdq_Mdq = 0xf20ff0; +const uint32_t OP_PSLLW_Pq_Qq = 0x0ff1; +const uint32_t OP_PSLLW_Vdq_Wdq = 0x660ff1; +const uint32_t OP_PSLLD_Pq_Qq = 0x0ff2; +const uint32_t OP_PSLLD_Vdq_Wdq = 0x660ff2; +const uint32_t OP_PSLLQ_Pq_Qq = 0x0ff3; +const uint32_t OP_PSLLQ_Vdq_Wdq = 0x660ff3; +const uint32_t OP_PMULUDQ_Pq_Qq = 0x0ff4; +const uint32_t OP_PMULUDQ_Vdq_Wdq = 0x660ff4; +const uint32_t OP_PMADDWD_Pq_Qq = 0x0ff5; +const uint32_t OP_PMADDWD_Vdq_Wdq = 0x660ff5; +const uint32_t OP_PSADBW_Pq_Qq = 0x0ff6; +const uint32_t OP_PSADBW_Vdq_Wdq = 0x660ff6; +const uint32_t OP_MASKMOVQ_Pq_Qq = 0x0ff7; +const uint32_t OP_MASKMOVDQU_Vdq_Wdq = 0x660ff7; +const uint32_t OP_PSUBB_Pq_Qq = 0x0ff8; +const uint32_t OP_PSUBB_Vdq_Wdq = 0x660ff8; +const uint32_t OP_PSUBW_Pq_Qq = 0x0ff9; +const uint32_t OP_PSUBW_Vdq_Wdq = 0x660ff9; +const uint32_t OP_PSUBD_Pq_Qq = 0x0ffa; +const uint32_t OP_PSUBD_Vdq_Wdq = 0x660ffa; +const uint32_t OP_PSUBQ_Pq_Qq = 0x0ffb; +const uint32_t OP_PSUBQ_Vdq_Wdq = 0x660ffb; +const uint32_t OP_PADDB_Pq_Qq = 0x0ffc; +const uint32_t OP_PADDB_Vdq_Wdq = 0x660ffc; +const uint32_t OP_PADDW_Pq_Qq = 0x0ffd; +const uint32_t OP_PADDW_Vdq_Wdq = 0x660ffd; +const uint32_t OP_PADDD_Pq_Qq = 0x0ffe; +const uint32_t OP_PADDD_Vdq_Wdq = 0x660ffe; // triple byte opcodes (0f 38) -const UINT32 OP_PSHUFB_Pq_Qq = 0x0f3800; -const UINT32 OP_PSHUFB_Vdq_Wdq = 0x660f3800; -const UINT32 OP_PHADDW_Pq_Qq = 0x0f3801; -const UINT32 OP_PHADDW_Vdq_Wdq = 0x660f3801; -const UINT32 OP_PHADDD_Pq_Qq = 0x0f3802; -const UINT32 OP_PHADDD_Vdq_Wdq = 0x660f3802; -const UINT32 OP_PHADDSW_Pq_Qq = 0x0f3803; -const UINT32 OP_PHADDSW_Vdq_Wdq = 0x660f3803; -const UINT32 OP_PMADDUBSW_Pq_Qq = 0x0f3804; -const UINT32 OP_PMADDUBSW_Vdq_Wdq = 0x660f3804; -const UINT32 OP_PHSUBW_Pq_Qq = 0x0f3805; -const UINT32 OP_PHSUBW_Vdq_Wdq = 0x660f3805; -const UINT32 OP_PHSUBD_Pq_Qq = 0x0f3806; -const UINT32 OP_PHSUBD_Vdq_Wdq = 0x660f3806; -const UINT32 OP_PHSUBSW_Pq_Qq = 0x0f3807; -const UINT32 OP_PHSUBSW_Vdq_Wdq = 0x660f3807; -const UINT32 OP_PSIGNB_Pq_Qq = 0x0f3808; -const UINT32 OP_PSIGNB_Vdq_Wdq = 0x660f3808; -const UINT32 OP_PSIGNW_Pq_Qq = 0x0f3809; -const UINT32 OP_PSIGNW_Vdq_Wdq = 0x660f3809; -const UINT32 OP_PSIGND_Pq_Qq = 0x0f380a; -const UINT32 OP_PSIGND_Vdq_Wdq = 0x660f380a; -const UINT32 OP_PMULHRSW_Pq_Qq = 0x0f380b; -const UINT32 OP_PMULHRSW_Vdq_Wdq = 0x660f380b; - -const UINT32 OP_PBLENDVB_Vdq_Wdq = 0x660f3810; -const UINT32 OP_PBLENDVPS_Vdq_Wdq = 0x660f3814; -const UINT32 OP_PBLENDVPD_Vdq_Wdq = 0x660f3815; -const UINT32 OP_PTEST_Vdq_Wdq = 0x660f3817; -const UINT32 OP_PABSB_Pq_Qq = 0x0f381c; -const UINT32 OP_PABSB_Vdq_Wdq = 0x660f381c; -const UINT32 OP_PABSW_Pq_Qq = 0x0f381d; -const UINT32 OP_PABSW_Vdq_Wdq = 0x660f381d; -const UINT32 OP_PABSD_Pq_Qq = 0x0f381e; -const UINT32 OP_PABSD_Vdq_Wdq = 0x660f381e; - -const UINT32 OP_PMOVSXBW_Vdq_Udq = 0x660f3820; -const UINT32 OP_PMOVSXBD_Vdq_Udq = 0x660f3821; -const UINT32 OP_PMOVSXBQ_Vdq_Udq = 0x660f3822; -const UINT32 OP_PMOVSXWD_Vdq_Udq = 0x660f3823; -const UINT32 OP_PMOVSXWQ_Vdq_Udq = 0x660f3824; -const UINT32 OP_PMOVSXDQ_Vdq_Udq = 0x660f3825; -const UINT32 OP_PMULDQ_Vdq_Udq = 0x660f3828; -const UINT32 OP_PCMPEQQ_Vdq_Udq = 0x660f3829; -const UINT32 OP_MOVNTDQA_Vdq_Udq = 0x660f382a; -const UINT32 OP_PACKUSDW_Vdq_Udq = 0x660f382b; - -const UINT32 OP_PMOVZXBW_Vdq_Udq = 0x660f3830; -const UINT32 OP_PMOVZXBD_Vdq_Udq = 0x660f3831; -const UINT32 OP_PMOVZXBQ_Vdq_Udq = 0x660f3832; -const UINT32 OP_PMOVZXWD_Vdq_Udq = 0x660f3833; -const UINT32 OP_PMOVZXWQ_Vdq_Udq = 0x660f3834; -const UINT32 OP_PMOVZXDQ_Vdq_Udq = 0x660f3835; -const UINT32 OP_PMINSB_Vdq_Udq = 0x660f3838; -const UINT32 OP_PMINSD_Vdq_Udq = 0x660f3839; -const UINT32 OP_PMINUW_Vdq_Udq = 0x660f383a; -const UINT32 OP_PMINUD_Vdq_Udq = 0x660f383b; -const UINT32 OP_PMAXSB_Vdq_Udq = 0x660f383c; -const UINT32 OP_PMAXSD_Vdq_Udq = 0x660f383d; -const UINT32 OP_PMAXUW_Vdq_Udq = 0x660f383e; -const UINT32 OP_PMAXUD_Vdq_Udq = 0x660f383f; - -const UINT32 OP_MULLD_Vdq_Wdq = 0x660f3840; -const UINT32 OP_PHMINPOSUW_Vdq_Wdq = 0x660f3841; - -const UINT32 OP_NVEPT_Gd_Mdq = 0x660f3880; -const UINT32 OP_NVVPID_Gd_Mdq = 0x660f3881; - -const UINT32 OP_MOVBE_Gv_Mv = 0x0f38f0; -const UINT32 OP_CRC32_Gd_Eb = 0xf20f38f0; -const UINT32 OP_MOVBE_Mv_Gv = 0x0f38f1; -const UINT32 OP_CRC32_Gd_Ev = 0xf20f38f1; +const uint32_t OP_PSHUFB_Pq_Qq = 0x0f3800; +const uint32_t OP_PSHUFB_Vdq_Wdq = 0x660f3800; +const uint32_t OP_PHADDW_Pq_Qq = 0x0f3801; +const uint32_t OP_PHADDW_Vdq_Wdq = 0x660f3801; +const uint32_t OP_PHADDD_Pq_Qq = 0x0f3802; +const uint32_t OP_PHADDD_Vdq_Wdq = 0x660f3802; +const uint32_t OP_PHADDSW_Pq_Qq = 0x0f3803; +const uint32_t OP_PHADDSW_Vdq_Wdq = 0x660f3803; +const uint32_t OP_PMADDUBSW_Pq_Qq = 0x0f3804; +const uint32_t OP_PMADDUBSW_Vdq_Wdq = 0x660f3804; +const uint32_t OP_PHSUBW_Pq_Qq = 0x0f3805; +const uint32_t OP_PHSUBW_Vdq_Wdq = 0x660f3805; +const uint32_t OP_PHSUBD_Pq_Qq = 0x0f3806; +const uint32_t OP_PHSUBD_Vdq_Wdq = 0x660f3806; +const uint32_t OP_PHSUBSW_Pq_Qq = 0x0f3807; +const uint32_t OP_PHSUBSW_Vdq_Wdq = 0x660f3807; +const uint32_t OP_PSIGNB_Pq_Qq = 0x0f3808; +const uint32_t OP_PSIGNB_Vdq_Wdq = 0x660f3808; +const uint32_t OP_PSIGNW_Pq_Qq = 0x0f3809; +const uint32_t OP_PSIGNW_Vdq_Wdq = 0x660f3809; +const uint32_t OP_PSIGND_Pq_Qq = 0x0f380a; +const uint32_t OP_PSIGND_Vdq_Wdq = 0x660f380a; +const uint32_t OP_PMULHRSW_Pq_Qq = 0x0f380b; +const uint32_t OP_PMULHRSW_Vdq_Wdq = 0x660f380b; + +const uint32_t OP_PBLENDVB_Vdq_Wdq = 0x660f3810; +const uint32_t OP_PBLENDVPS_Vdq_Wdq = 0x660f3814; +const uint32_t OP_PBLENDVPD_Vdq_Wdq = 0x660f3815; +const uint32_t OP_PTEST_Vdq_Wdq = 0x660f3817; +const uint32_t OP_PABSB_Pq_Qq = 0x0f381c; +const uint32_t OP_PABSB_Vdq_Wdq = 0x660f381c; +const uint32_t OP_PABSW_Pq_Qq = 0x0f381d; +const uint32_t OP_PABSW_Vdq_Wdq = 0x660f381d; +const uint32_t OP_PABSD_Pq_Qq = 0x0f381e; +const uint32_t OP_PABSD_Vdq_Wdq = 0x660f381e; + +const uint32_t OP_PMOVSXBW_Vdq_Udq = 0x660f3820; +const uint32_t OP_PMOVSXBD_Vdq_Udq = 0x660f3821; +const uint32_t OP_PMOVSXBQ_Vdq_Udq = 0x660f3822; +const uint32_t OP_PMOVSXWD_Vdq_Udq = 0x660f3823; +const uint32_t OP_PMOVSXWQ_Vdq_Udq = 0x660f3824; +const uint32_t OP_PMOVSXDQ_Vdq_Udq = 0x660f3825; +const uint32_t OP_PMULDQ_Vdq_Udq = 0x660f3828; +const uint32_t OP_PCMPEQQ_Vdq_Udq = 0x660f3829; +const uint32_t OP_MOVNTDQA_Vdq_Udq = 0x660f382a; +const uint32_t OP_PACKUSDW_Vdq_Udq = 0x660f382b; + +const uint32_t OP_PMOVZXBW_Vdq_Udq = 0x660f3830; +const uint32_t OP_PMOVZXBD_Vdq_Udq = 0x660f3831; +const uint32_t OP_PMOVZXBQ_Vdq_Udq = 0x660f3832; +const uint32_t OP_PMOVZXWD_Vdq_Udq = 0x660f3833; +const uint32_t OP_PMOVZXWQ_Vdq_Udq = 0x660f3834; +const uint32_t OP_PMOVZXDQ_Vdq_Udq = 0x660f3835; +const uint32_t OP_PMINSB_Vdq_Udq = 0x660f3838; +const uint32_t OP_PMINSD_Vdq_Udq = 0x660f3839; +const uint32_t OP_PMINUW_Vdq_Udq = 0x660f383a; +const uint32_t OP_PMINUD_Vdq_Udq = 0x660f383b; +const uint32_t OP_PMAXSB_Vdq_Udq = 0x660f383c; +const uint32_t OP_PMAXSD_Vdq_Udq = 0x660f383d; +const uint32_t OP_PMAXUW_Vdq_Udq = 0x660f383e; +const uint32_t OP_PMAXUD_Vdq_Udq = 0x660f383f; + +const uint32_t OP_MULLD_Vdq_Wdq = 0x660f3840; +const uint32_t OP_PHMINPOSUW_Vdq_Wdq = 0x660f3841; + +const uint32_t OP_NVEPT_Gd_Mdq = 0x660f3880; +const uint32_t OP_NVVPID_Gd_Mdq = 0x660f3881; + +const uint32_t OP_MOVBE_Gv_Mv = 0x0f38f0; +const uint32_t OP_CRC32_Gd_Eb = 0xf20f38f0; +const uint32_t OP_MOVBE_Mv_Gv = 0x0f38f1; +const uint32_t OP_CRC32_Gd_Ev = 0xf20f38f1; // triple byte opcodes (0f 3a) -const UINT32 OP_ROUNDPS_Vdq_Wdq_Ib = 0x660f3a08; -const UINT32 OP_ROUNDPD_Vdq_Wdq_Ib = 0x660f3a09; -const UINT32 OP_ROUNDSS_Vss_Wss_Ib = 0x660f3a0a; -const UINT32 OP_ROUNDSD_Vsd_Wsd_Ib = 0x660f3a0b; -const UINT32 OP_BLENDPS_Vdq_Wdq_Ib = 0x660f3a0c; -const UINT32 OP_BLENDPD_Vdq_Wdq_Ib = 0x660f3a0d; -const UINT32 OP_PBLENDW_Vdq_Wdq_Ib = 0x660f3a0e; -const UINT32 OP_PALIGNR_Pq_Qq_Ib = 0x0f3a0f; -const UINT32 OP_PALIGNR_Vdq_Wdq_Ib = 0x660f3a0f; - -const UINT32 OP_EXTRB_Rd_Vdq_Ib = 0x660f3a14; -const UINT32 OP_EXTRW_Rd_Vdq_Ib = 0x660f3a15; -const UINT32 OP_EXTRD_Rd_Vdq_Ib = 0x660f3a16; -const UINT32 OP_EXTRACTPS_Ed_Vdq_Ib = 0x660f3a17; - -const UINT32 OP_PINSRB_Vdq_Rd_Ib = 0x660f3a20; -const UINT32 OP_INSERTPS_Vdq_Udq_Ib = 0x660f3a21; -const UINT32 OP_PINSRD_Vdq_Ed_Ib = 0x660f3a22; - -const UINT32 OP_DPPS_Vdq_Wdq_Ib = 0x660f3a40; -const UINT32 OP_DPPD_Vdq_Wdq_Ib = 0x660f3a41; -const UINT32 OP_MPSADBW_Vdq_Wdq_Ib = 0x660f3a42; - -const UINT32 OP_PCMPESTRM_Vdq_Wdq_Ib = 0x660f3a60; -const UINT32 OP_PCMPESTRI_Vdq_Wdq_Ib = 0x660f3a61; -const UINT32 OP_PCMPISTRM_Vdq_Wdq_Ib = 0x660f3a62; -const UINT32 OP_PCMPISTRI_Vdq_Wdq_Ib = 0x660f3a63; +const uint32_t OP_ROUNDPS_Vdq_Wdq_Ib = 0x660f3a08; +const uint32_t OP_ROUNDPD_Vdq_Wdq_Ib = 0x660f3a09; +const uint32_t OP_ROUNDSS_Vss_Wss_Ib = 0x660f3a0a; +const uint32_t OP_ROUNDSD_Vsd_Wsd_Ib = 0x660f3a0b; +const uint32_t OP_BLENDPS_Vdq_Wdq_Ib = 0x660f3a0c; +const uint32_t OP_BLENDPD_Vdq_Wdq_Ib = 0x660f3a0d; +const uint32_t OP_PBLENDW_Vdq_Wdq_Ib = 0x660f3a0e; +const uint32_t OP_PALIGNR_Pq_Qq_Ib = 0x0f3a0f; +const uint32_t OP_PALIGNR_Vdq_Wdq_Ib = 0x660f3a0f; + +const uint32_t OP_EXTRB_Rd_Vdq_Ib = 0x660f3a14; +const uint32_t OP_EXTRW_Rd_Vdq_Ib = 0x660f3a15; +const uint32_t OP_EXTRD_Rd_Vdq_Ib = 0x660f3a16; +const uint32_t OP_EXTRACTPS_Ed_Vdq_Ib = 0x660f3a17; + +const uint32_t OP_PINSRB_Vdq_Rd_Ib = 0x660f3a20; +const uint32_t OP_INSERTPS_Vdq_Udq_Ib = 0x660f3a21; +const uint32_t OP_PINSRD_Vdq_Ed_Ib = 0x660f3a22; + +const uint32_t OP_DPPS_Vdq_Wdq_Ib = 0x660f3a40; +const uint32_t OP_DPPD_Vdq_Wdq_Ib = 0x660f3a41; +const uint32_t OP_MPSADBW_Vdq_Wdq_Ib = 0x660f3a42; + +const uint32_t OP_PCMPESTRM_Vdq_Wdq_Ib = 0x660f3a60; +const uint32_t OP_PCMPESTRI_Vdq_Wdq_Ib = 0x660f3a61; +const uint32_t OP_PCMPISTRM_Vdq_Wdq_Ib = 0x660f3a62; +const uint32_t OP_PCMPISTRI_Vdq_Wdq_Ib = 0x660f3a63; // floating point opcodes -const UINT32 OP_FADD_ST0_STn = 0xd8c0; -const UINT32 OP_FMUL_ST0_STn = 0xd8c8; -const UINT32 OP_FCOM_ST0_STn = 0xd8d0; -const UINT32 OP_FCOMP_ST0_STn = 0xd8d8; -const UINT32 OP_FSUB_ST0_STn = 0xd8e0; -const UINT32 OP_FSUBR_ST0_STn = 0xd8e8; -const UINT32 OP_FDIV_ST0_STn = 0xd8f0; -const UINT32 OP_FDIVR_ST0_STn = 0xd8f8; -const UINT32 OP_FLD_ST0_STn = 0xd9c0; -const UINT32 OP_FXCH_ST0_STn = 0xd9c8; -const UINT32 OP_FNOP = 0xd9d0; -const UINT32 OP_FCHS = 0xd9e0; -const UINT32 OP_FABS = 0xd9e1; -const UINT32 OP_FTST = 0xd9e4; -const UINT32 OP_FXAM = 0xd9e5; -const UINT32 OP_FLD1 = 0xd9e8; -const UINT32 OP_FLDL2T = 0xd9e9; -const UINT32 OP_FLDL2E = 0xd9ea; -const UINT32 OP_FLDPI = 0xd9eb; -const UINT32 OP_FLDLG2 = 0xd9ec; -const UINT32 OP_FLDLN2 = 0xd9ed; -const UINT32 OP_FLDZ = 0xd9ee; -const UINT32 OP_F2XM1 = 0xd9f0; -const UINT32 OP_FYL2X = 0xd9f1; -const UINT32 OP_FPTAN = 0xd9f2; -const UINT32 OP_FPATAN = 0xd9f3; -const UINT32 OP_FXTRACT = 0xd9f4; -const UINT32 OP_FPREM1 = 0xd9f5; -const UINT32 OP_FDECSTP = 0xd9f6; -const UINT32 OP_FINCSTP = 0xd9f7; -const UINT32 OP_FPREM = 0xd9f8; -const UINT32 OP_FYL2XP1 = 0xd9f9; -const UINT32 OP_FSQRT = 0xd9fa; -const UINT32 OP_FSINCOS = 0xd9fb; -const UINT32 OP_FRNDINT = 0xd9fc; -const UINT32 OP_FSCALE = 0xd9fd; -const UINT32 OP_FSIN = 0xd9fe; -const UINT32 OP_FCOS = 0xd9ff; -const UINT32 OP_FCMOVB_ST0_STn = 0xdac0; -const UINT32 OP_FCMOVE_ST0_STn = 0xdac8; -const UINT32 OP_FCMOVBE_ST0_STn = 0xdad0; -const UINT32 OP_FCMOVU_ST0_STn = 0xdad8; -const UINT32 OP_FUCOMPP = 0xdae9; -const UINT32 OP_FCMOVNB_ST0_STn = 0xdbc0; -const UINT32 OP_FCMOVNE_ST0_STn = 0xdbc8; -const UINT32 OP_FCMOVNBE_ST0_STn = 0xdbd0; -const UINT32 OP_FCMOVNU_ST0_STn = 0xdbd8; -const UINT32 OP_FCLEX = 0xdbe2; -const UINT32 OP_FINIT = 0xdbe3; -const UINT32 OP_FUCOMI_ST0_STn = 0xdbe8; -const UINT32 OP_FCOMI_ST0_STn = 0xdbf0; -const UINT32 OP_FADD_STn_ST0 = 0xdcc0; -const UINT32 OP_FMUL_STn_ST0 = 0xdcc8; -const UINT32 OP_FSUBR_STn_ST0 = 0xdce0; -const UINT32 OP_FSUB_STn_ST0 = 0xdce8; -const UINT32 OP_FDIVR_STn_ST0 = 0xdcf0; -const UINT32 OP_FDIV_STn_ST0 = 0xdcf8; -const UINT32 OP_FFREE_STn = 0xddc0; -const UINT32 OP_FST_STn = 0xddd0; -const UINT32 OP_FSTP_STn = 0xddd8; -const UINT32 OP_FUCOM_STn_ST0 = 0xdde0; -const UINT32 OP_FUCOMP_STn = 0xdde8; -const UINT32 OP_FADDP_STn_ST0 = 0xdec0; -const UINT32 OP_FMULP_STn_ST0 = 0xdec8; -const UINT32 OP_FCOMPP = 0xded9; -const UINT32 OP_FSUBRP_STn_ST0 = 0xdee0; -const UINT32 OP_FSUBP_STn_ST0 = 0xdee8; -const UINT32 OP_FDIVRP_STn_ST0 = 0xdef0; -const UINT32 OP_FDIVP_STn_ST0 = 0xdef8; -const UINT32 OP_FSTSW_AX = 0xdfe0; -const UINT32 OP_FCOMIP_ST0_STn = 0xdff0; +const uint32_t OP_FADD_ST0_STn = 0xd8c0; +const uint32_t OP_FMUL_ST0_STn = 0xd8c8; +const uint32_t OP_FCOM_ST0_STn = 0xd8d0; +const uint32_t OP_FCOMP_ST0_STn = 0xd8d8; +const uint32_t OP_FSUB_ST0_STn = 0xd8e0; +const uint32_t OP_FSUBR_ST0_STn = 0xd8e8; +const uint32_t OP_FDIV_ST0_STn = 0xd8f0; +const uint32_t OP_FDIVR_ST0_STn = 0xd8f8; +const uint32_t OP_FLD_ST0_STn = 0xd9c0; +const uint32_t OP_FXCH_ST0_STn = 0xd9c8; +const uint32_t OP_FNOP = 0xd9d0; +const uint32_t OP_FCHS = 0xd9e0; +const uint32_t OP_FABS = 0xd9e1; +const uint32_t OP_FTST = 0xd9e4; +const uint32_t OP_FXAM = 0xd9e5; +const uint32_t OP_FLD1 = 0xd9e8; +const uint32_t OP_FLDL2T = 0xd9e9; +const uint32_t OP_FLDL2E = 0xd9ea; +const uint32_t OP_FLDPI = 0xd9eb; +const uint32_t OP_FLDLG2 = 0xd9ec; +const uint32_t OP_FLDLN2 = 0xd9ed; +const uint32_t OP_FLDZ = 0xd9ee; +const uint32_t OP_F2XM1 = 0xd9f0; +const uint32_t OP_FYL2X = 0xd9f1; +const uint32_t OP_FPTAN = 0xd9f2; +const uint32_t OP_FPATAN = 0xd9f3; +const uint32_t OP_FXTRACT = 0xd9f4; +const uint32_t OP_FPREM1 = 0xd9f5; +const uint32_t OP_FDECSTP = 0xd9f6; +const uint32_t OP_FINCSTP = 0xd9f7; +const uint32_t OP_FPREM = 0xd9f8; +const uint32_t OP_FYL2XP1 = 0xd9f9; +const uint32_t OP_FSQRT = 0xd9fa; +const uint32_t OP_FSINCOS = 0xd9fb; +const uint32_t OP_FRNDINT = 0xd9fc; +const uint32_t OP_FSCALE = 0xd9fd; +const uint32_t OP_FSIN = 0xd9fe; +const uint32_t OP_FCOS = 0xd9ff; +const uint32_t OP_FCMOVB_ST0_STn = 0xdac0; +const uint32_t OP_FCMOVE_ST0_STn = 0xdac8; +const uint32_t OP_FCMOVBE_ST0_STn = 0xdad0; +const uint32_t OP_FCMOVU_ST0_STn = 0xdad8; +const uint32_t OP_FUCOMPP = 0xdae9; +const uint32_t OP_FCMOVNB_ST0_STn = 0xdbc0; +const uint32_t OP_FCMOVNE_ST0_STn = 0xdbc8; +const uint32_t OP_FCMOVNBE_ST0_STn = 0xdbd0; +const uint32_t OP_FCMOVNU_ST0_STn = 0xdbd8; +const uint32_t OP_FCLEX = 0xdbe2; +const uint32_t OP_FINIT = 0xdbe3; +const uint32_t OP_FUCOMI_ST0_STn = 0xdbe8; +const uint32_t OP_FCOMI_ST0_STn = 0xdbf0; +const uint32_t OP_FADD_STn_ST0 = 0xdcc0; +const uint32_t OP_FMUL_STn_ST0 = 0xdcc8; +const uint32_t OP_FSUBR_STn_ST0 = 0xdce0; +const uint32_t OP_FSUB_STn_ST0 = 0xdce8; +const uint32_t OP_FDIVR_STn_ST0 = 0xdcf0; +const uint32_t OP_FDIV_STn_ST0 = 0xdcf8; +const uint32_t OP_FFREE_STn = 0xddc0; +const uint32_t OP_FST_STn = 0xddd0; +const uint32_t OP_FSTP_STn = 0xddd8; +const uint32_t OP_FUCOM_STn_ST0 = 0xdde0; +const uint32_t OP_FUCOMP_STn = 0xdde8; +const uint32_t OP_FADDP_STn_ST0 = 0xdec0; +const uint32_t OP_FMULP_STn_ST0 = 0xdec8; +const uint32_t OP_FCOMPP = 0xded9; +const uint32_t OP_FSUBRP_STn_ST0 = 0xdee0; +const uint32_t OP_FSUBP_STn_ST0 = 0xdee8; +const uint32_t OP_FDIVRP_STn_ST0 = 0xdef0; +const uint32_t OP_FDIVP_STn_ST0 = 0xdef8; +const uint32_t OP_FSTSW_AX = 0xdfe0; +const uint32_t OP_FCOMIP_ST0_STn = 0xdff0; @@ -1170,13 +1170,13 @@ const UINT32 OP_FCOMIP_ST0_STn = 0xdff0; // MEMORY REFERENCES //************************************************************************** -inline x86_memref MBD(UINT8 base, INT32 disp) { return x86_memref(base, REG_NONE, 1, disp); } -inline x86_memref MBISD(UINT8 base, UINT8 ind, UINT8 scale, INT32 disp) { return x86_memref(base, ind, scale, disp); } +inline x86_memref MBD(uint8_t base, int32_t disp) { return x86_memref(base, REG_NONE, 1, disp); } +inline x86_memref MBISD(uint8_t base, uint8_t ind, uint8_t scale, int32_t disp) { return x86_memref(base, ind, scale, disp); } #if (X86EMIT_SIZE == 32) inline x86_memref MABS(const void *mem) { return x86_memref(REG_NONE, REG_NONE, 1, reinterpret_cast(const_cast(mem))); } -inline x86_memref MABSI(const void *mem, UINT8 index) { return x86_memref(index, REG_NONE, 1, reinterpret_cast(const_cast(mem))); } -inline x86_memref MABSI(const void *mem, UINT8 index, UINT8 scale) { return x86_memref(REG_NONE, index, scale, reinterpret_cast(const_cast(mem))); } +inline x86_memref MABSI(const void *mem, uint8_t index) { return x86_memref(index, REG_NONE, 1, reinterpret_cast(const_cast(mem))); } +inline x86_memref MABSI(const void *mem, uint8_t index, uint8_t scale) { return x86_memref(REG_NONE, index, scale, reinterpret_cast(const_cast(mem))); } #endif @@ -1190,7 +1190,7 @@ inline x86_memref MABSI(const void *mem, UINT8 index, UINT8 scale) { return x86_ // three components //------------------------------------------------- -inline UINT8 make_modrm(UINT8 mode, UINT8 reg, UINT8 rm) +inline uint8_t make_modrm(uint8_t mode, uint8_t reg, uint8_t rm) { assert(mode < 4); assert(reg < REG_MAX); @@ -1204,9 +1204,9 @@ inline UINT8 make_modrm(UINT8 mode, UINT8 reg, UINT8 rm) // three components //------------------------------------------------- -inline UINT8 make_sib(UINT8 scale, UINT8 index, UINT8 base) +inline uint8_t make_sib(uint8_t scale, uint8_t index, uint8_t base) { - static const UINT8 scale_lookup[9] = { 0<<6, 0<<6, 1<<6, 0<<6, 2<<6, 0<<6, 0<<6, 0<<6, 3<<6 }; + static const uint8_t scale_lookup[9] = { 0<<6, 0<<6, 1<<6, 0<<6, 2<<6, 0<<6, 0<<6, 0<<6, 3<<6 }; assert(scale == 1 || scale == 2 || scale == 4 || scale == 8); assert(index < REG_MAX); assert(base < REG_MAX); @@ -1218,9 +1218,9 @@ inline UINT8 make_sib(UINT8 scale, UINT8 index, UINT8 base) // emit_byte - emit a byte //------------------------------------------------- -inline void emit_byte(x86code *&emitptr, UINT8 byte) +inline void emit_byte(x86code *&emitptr, uint8_t byte) { - *((UINT8 *)emitptr) = byte; + *((uint8_t *)emitptr) = byte; emitptr += 1; } @@ -1229,9 +1229,9 @@ inline void emit_byte(x86code *&emitptr, UINT8 byte) // emit_word - emit a word //------------------------------------------------- -inline void emit_word(x86code *&emitptr, UINT16 word) +inline void emit_word(x86code *&emitptr, uint16_t word) { - *((UINT16 *)emitptr) = word; + *((uint16_t *)emitptr) = word; emitptr += 2; } @@ -1240,9 +1240,9 @@ inline void emit_word(x86code *&emitptr, UINT16 word) // emit_dword - emit a dword //------------------------------------------------- -inline void emit_dword(x86code *&emitptr, UINT32 dword) +inline void emit_dword(x86code *&emitptr, uint32_t dword) { - *((UINT32 *)emitptr) = dword; + *((uint32_t *)emitptr) = dword; emitptr += 4; } @@ -1251,9 +1251,9 @@ inline void emit_dword(x86code *&emitptr, UINT32 dword) // emit_qword - emit a dword //------------------------------------------------- -inline void emit_qword(x86code *&emitptr, UINT64 qword) +inline void emit_qword(x86code *&emitptr, uint64_t qword) { - *((UINT64 *)emitptr) = qword; + *((uint64_t *)emitptr) = qword; emitptr += 8; } @@ -1268,7 +1268,7 @@ inline void emit_qword(x86code *&emitptr, UINT64 qword) // along with any necessary REX prefixes for x64 //------------------------------------------------- -inline void emit_op(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 sib, UINT8 rm) +inline void emit_op(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg, uint8_t sib, uint8_t rm) { if (opsize == OP_16BIT) emit_byte(emitptr, PREFIX_OPSIZE); @@ -1280,7 +1280,7 @@ inline void emit_op(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 #if (X86EMIT_SIZE == 64) { - UINT8 rex; + uint8_t rex; assert(opsize == OP_16BIT || opsize == OP_32BIT || opsize == OP_64BIT); @@ -1304,7 +1304,7 @@ inline void emit_op(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 // emit_op_simple - emit a simple opcode //------------------------------------------------- -inline void emit_op_simple(x86code *&emitptr, UINT32 op, UINT8 opsize) +inline void emit_op_simple(x86code *&emitptr, uint32_t op, uint8_t opsize) { emit_op(emitptr, op, opsize, 0, 0, 0); } @@ -1315,7 +1315,7 @@ inline void emit_op_simple(x86code *&emitptr, UINT32 op, UINT8 opsize) // a register parameter //------------------------------------------------- -inline void emit_op_reg(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg) +inline void emit_op_reg(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg) { emit_op(emitptr, op, opsize, 0, 0, reg); } @@ -1326,7 +1326,7 @@ inline void emit_op_reg(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg) // register modrm byte //------------------------------------------------- -inline void emit_op_modrm_reg(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 rm) +inline void emit_op_modrm_reg(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg, uint8_t rm) { assert(reg < REG_MAX); assert(rm < REG_MAX); @@ -1341,7 +1341,7 @@ inline void emit_op_modrm_reg(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 // memory modrm byte //------------------------------------------------- -inline void emit_op_modrm_mem(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, x86_memref memref) +inline void emit_op_modrm_mem(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg, x86_memref memref) { assert(reg < REG_MAX); assert(memref.m_base < REG_MAX || memref.m_base == REG_NONE); @@ -1372,10 +1372,10 @@ inline void emit_op_modrm_mem(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 emit_byte(emitptr, make_modrm(0, reg, memref.m_base)); // mode 1 for 1-byte offset - else if ((INT8)memref.m_disp == memref.m_disp) + else if ((int8_t)memref.m_disp == memref.m_disp) { emit_byte(emitptr, make_modrm(1, reg, memref.m_base)); - emit_byte(emitptr, (INT8)memref.m_disp); + emit_byte(emitptr, (int8_t)memref.m_disp); } // mode 2 for 4-byte offset @@ -1412,11 +1412,11 @@ inline void emit_op_modrm_mem(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 } // mode 1 for 1-byte offset - else if ((INT8)memref.m_disp == memref.m_disp) + else if ((int8_t)memref.m_disp == memref.m_disp) { emit_byte(emitptr, make_modrm(1, reg, 4)); emit_byte(emitptr, make_sib(memref.m_scale, memref.m_index, memref.m_base)); - emit_byte(emitptr, (INT8)memref.m_disp); + emit_byte(emitptr, (int8_t)memref.m_disp); } // mode 2 for 4-byte offset @@ -1440,7 +1440,7 @@ inline void emit_op_modrm_mem(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 // register modrm byte and an 8-bit immediate //------------------------------------------------- -inline void emit_op_modrm_reg_imm8(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 rm, UINT8 imm) +inline void emit_op_modrm_reg_imm8(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg, uint8_t rm, uint8_t imm) { emit_op_modrm_reg(emitptr, op, opsize, reg, rm); emit_byte(emitptr, imm); @@ -1452,7 +1452,7 @@ inline void emit_op_modrm_reg_imm8(x86code *&emitptr, UINT32 op, UINT8 opsize, U // memory modrm byte and an 8-bit immediate //------------------------------------------------- -inline void emit_op_modrm_mem_imm8(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, x86_memref memref, UINT8 imm) +inline void emit_op_modrm_mem_imm8(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg, x86_memref memref, uint8_t imm) { emit_op_modrm_mem(emitptr, op, opsize, reg, memref); emit_byte(emitptr, imm); @@ -1464,7 +1464,7 @@ inline void emit_op_modrm_mem_imm8(x86code *&emitptr, UINT32 op, UINT8 opsize, U // register modrm byte and a 16-bit immediate //------------------------------------------------- -inline void emit_op_modrm_reg_imm16(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 rm, UINT16 imm) +inline void emit_op_modrm_reg_imm16(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg, uint8_t rm, uint16_t imm) { emit_op_modrm_reg(emitptr, op, opsize, reg, rm); emit_word(emitptr, imm); @@ -1476,7 +1476,7 @@ inline void emit_op_modrm_reg_imm16(x86code *&emitptr, UINT32 op, UINT8 opsize, // memory modrm byte and a 16-bit immediate //------------------------------------------------- -inline void emit_op_modrm_mem_imm16(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, x86_memref memref, UINT16 imm) +inline void emit_op_modrm_mem_imm16(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg, x86_memref memref, uint16_t imm) { emit_op_modrm_mem(emitptr, op, opsize, reg, memref); emit_word(emitptr, imm); @@ -1489,9 +1489,9 @@ inline void emit_op_modrm_mem_imm16(x86code *&emitptr, UINT32 op, UINT8 opsize, // immediate //------------------------------------------------- -inline void emit_op_modrm_reg_imm816(x86code *&emitptr, UINT32 op8, UINT32 op16, UINT8 opsize, UINT8 reg, UINT8 rm, UINT16 imm) +inline void emit_op_modrm_reg_imm816(x86code *&emitptr, uint32_t op8, uint32_t op16, uint8_t opsize, uint8_t reg, uint8_t rm, uint16_t imm) { - if ((INT8)imm == (INT16)imm) + if ((int8_t)imm == (int16_t)imm) { emit_op_modrm_reg(emitptr, op8, opsize, reg, rm); emit_byte(emitptr, imm); @@ -1510,9 +1510,9 @@ inline void emit_op_modrm_reg_imm816(x86code *&emitptr, UINT32 op8, UINT32 op16, // immediate //------------------------------------------------- -inline void emit_op_modrm_mem_imm816(x86code *&emitptr, UINT32 op8, UINT32 op16, UINT8 opsize, UINT8 reg, x86_memref memref, UINT16 imm) +inline void emit_op_modrm_mem_imm816(x86code *&emitptr, uint32_t op8, uint32_t op16, uint8_t opsize, uint8_t reg, x86_memref memref, uint16_t imm) { - if ((INT8)imm == (INT16)imm) + if ((int8_t)imm == (int16_t)imm) { emit_op_modrm_mem(emitptr, op8, opsize, reg, memref); emit_byte(emitptr, imm); @@ -1530,7 +1530,7 @@ inline void emit_op_modrm_mem_imm816(x86code *&emitptr, UINT32 op8, UINT32 op16, // register modrm byte and a 32-bit immediate //------------------------------------------------- -inline void emit_op_modrm_reg_imm32(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, UINT8 rm, UINT32 imm) +inline void emit_op_modrm_reg_imm32(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg, uint8_t rm, uint32_t imm) { emit_op_modrm_reg(emitptr, op, opsize, reg, rm); emit_dword(emitptr, imm); @@ -1542,7 +1542,7 @@ inline void emit_op_modrm_reg_imm32(x86code *&emitptr, UINT32 op, UINT8 opsize, // memory modrm byte and a 32-bit immediate //------------------------------------------------- -inline void emit_op_modrm_mem_imm32(x86code *&emitptr, UINT32 op, UINT8 opsize, UINT8 reg, x86_memref memref, UINT32 imm) +inline void emit_op_modrm_mem_imm32(x86code *&emitptr, uint32_t op, uint8_t opsize, uint8_t reg, x86_memref memref, uint32_t imm) { emit_op_modrm_mem(emitptr, op, opsize, reg, memref); emit_dword(emitptr, imm); @@ -1555,9 +1555,9 @@ inline void emit_op_modrm_mem_imm32(x86code *&emitptr, UINT32 op, UINT8 opsize, // immediate //------------------------------------------------- -inline void emit_op_modrm_reg_imm832(x86code *&emitptr, UINT32 op8, UINT32 op32, UINT8 opsize, UINT8 reg, UINT8 rm, UINT32 imm) +inline void emit_op_modrm_reg_imm832(x86code *&emitptr, uint32_t op8, uint32_t op32, uint8_t opsize, uint8_t reg, uint8_t rm, uint32_t imm) { - if ((INT8)imm == (INT32)imm) + if ((int8_t)imm == (int32_t)imm) { emit_op_modrm_reg(emitptr, op8, opsize, reg, rm); emit_byte(emitptr, imm); @@ -1576,9 +1576,9 @@ inline void emit_op_modrm_reg_imm832(x86code *&emitptr, UINT32 op8, UINT32 op32, // immediate //------------------------------------------------- -inline void emit_op_modrm_mem_imm832(x86code *&emitptr, UINT32 op8, UINT32 op32, UINT8 opsize, UINT8 reg, x86_memref memref, UINT32 imm) +inline void emit_op_modrm_mem_imm832(x86code *&emitptr, uint32_t op8, uint32_t op32, uint8_t opsize, uint8_t reg, x86_memref memref, uint32_t imm) { - if ((INT8)imm == (INT32)imm) + if ((int8_t)imm == (int32_t)imm) { emit_op_modrm_mem(emitptr, op8, opsize, reg, memref); emit_byte(emitptr, imm); @@ -1631,21 +1631,21 @@ inline void emit_cqo(x86code *&emitptr) { emit_op_simple(emitptr, OP_CQO, OP_ inline void resolve_link(x86code *&destptr, const emit_link &linkinfo) { - INT64 delta = destptr - linkinfo.target; + int64_t delta = destptr - linkinfo.target; if (linkinfo.size == 1) { - assert((INT8)delta == delta); - ((INT8 *)linkinfo.target)[-1] = (INT8)delta; + assert((int8_t)delta == delta); + ((int8_t *)linkinfo.target)[-1] = (int8_t)delta; } else if (linkinfo.size == 2) { - assert((INT16)delta == delta); - ((INT16 *)linkinfo.target)[-1] = (INT16)delta; + assert((int16_t)delta == delta); + ((int16_t *)linkinfo.target)[-1] = (int16_t)delta; } else { - assert((INT32)delta == delta); - ((INT32 *)linkinfo.target)[-1] = (INT32)delta; + assert((int32_t)delta == delta); + ((int32_t *)linkinfo.target)[-1] = (int32_t)delta; } } @@ -1692,10 +1692,10 @@ inline void emit_jmp_near_link(x86code *&emitptr, emit_link &linkinfo) inline void emit_jmp(x86code *&emitptr, x86code *target) { - INT32 delta = target - (emitptr + 2); + int32_t delta = target - (emitptr + 2); emit_link link; - if ((INT8)delta == delta) + if ((int8_t)delta == delta) emit_jmp_short_link(emitptr, link); else emit_jmp_near_link(emitptr, link); @@ -1707,7 +1707,7 @@ inline void emit_jmp(x86code *&emitptr, x86code *target) // emit_jcc_* //------------------------------------------------- -inline void emit_jcc_short_link(x86code *&emitptr, UINT8 cond, emit_link &linkinfo) +inline void emit_jcc_short_link(x86code *&emitptr, uint8_t cond, emit_link &linkinfo) { emit_op_simple(emitptr, OP_JCC_O_Jb + cond, OP_32BIT); emit_byte(emitptr, 0); @@ -1715,7 +1715,7 @@ inline void emit_jcc_short_link(x86code *&emitptr, UINT8 cond, emit_link &linkin linkinfo.size = 1; } -inline void emit_jcc_near_link(x86code *&emitptr, UINT8 cond, emit_link &linkinfo) +inline void emit_jcc_near_link(x86code *&emitptr, uint8_t cond, emit_link &linkinfo) { emit_op_simple(emitptr, OP_JCC_O_Jv + cond, OP_32BIT); emit_dword(emitptr, 0); @@ -1723,12 +1723,12 @@ inline void emit_jcc_near_link(x86code *&emitptr, UINT8 cond, emit_link &linkinf linkinfo.size = 4; } -inline void emit_jcc(x86code *&emitptr, UINT8 cond, x86code *target) +inline void emit_jcc(x86code *&emitptr, uint8_t cond, x86code *target) { - INT32 delta = emitptr + 2 - target; + int32_t delta = emitptr + 2 - target; emit_link link; - if ((INT8)delta == delta) + if ((int8_t)delta == delta) emit_jcc_short_link(emitptr, cond, link); else emit_jcc_near_link(emitptr, cond, link); @@ -1780,14 +1780,14 @@ inline void emit_jrcxz(x86code *&emitptr, x86code *target) //------------------------------------------------- #if (X86EMIT_SIZE == 32) -inline void emit_call_r32(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G5, OP_32BIT, 2, dreg); } +inline void emit_call_r32(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G5, OP_32BIT, 2, dreg); } inline void emit_call_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G5, OP_32BIT, 2, memref); } -inline void emit_jmp_r32(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G5, OP_32BIT, 4, dreg); } +inline void emit_jmp_r32(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G5, OP_32BIT, 4, dreg); } inline void emit_jmp_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G5, OP_32BIT, 4, memref); } #else -inline void emit_call_r64(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G5, OP_32BIT, 2, dreg); } +inline void emit_call_r64(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G5, OP_32BIT, 2, dreg); } inline void emit_call_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G5, OP_32BIT, 2, memref); } -inline void emit_jmp_r64(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G5, OP_32BIT, 4, dreg); } +inline void emit_jmp_r64(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G5, OP_32BIT, 4, dreg); } inline void emit_jmp_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G5, OP_32BIT, 4, memref); } #endif @@ -1796,7 +1796,7 @@ inline void emit_jmp_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_ // emit_ret_* //------------------------------------------------- -inline void emit_ret_imm(x86code *&emitptr, UINT16 imm) +inline void emit_ret_imm(x86code *&emitptr, uint16_t imm) { emit_op_simple(emitptr, OP_RETN_Iw, OP_32BIT); emit_word(emitptr, imm); @@ -1808,12 +1808,12 @@ inline void emit_ret_imm(x86code *&emitptr, UINT16 imm) // PUSH/POP EMITTERS //************************************************************************** -inline void emit_push_imm(x86code *&emitptr, INT32 imm) +inline void emit_push_imm(x86code *&emitptr, int32_t imm) { - if ((INT8)imm == imm) + if ((int8_t)imm == imm) { emit_op_simple(emitptr, OP_PUSH_Ib, OP_32BIT); - emit_byte(emitptr, (INT8)imm); + emit_byte(emitptr, (int8_t)imm); } else { @@ -1824,16 +1824,16 @@ inline void emit_push_imm(x86code *&emitptr, INT32 imm) #if (X86EMIT_SIZE == 32) -inline void emit_push_r32(x86code *&emitptr, UINT8 reg) { emit_op_reg(emitptr, OP_PUSH_rAX + (reg & 7), OP_32BIT, reg); } +inline void emit_push_r32(x86code *&emitptr, uint8_t reg) { emit_op_reg(emitptr, OP_PUSH_rAX + (reg & 7), OP_32BIT, reg); } inline void emit_push_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G5, OP_32BIT, 6, memref); } -inline void emit_pop_r32(x86code *&emitptr, UINT8 reg) { emit_op_reg(emitptr, OP_POP_rAX + (reg & 7), OP_32BIT, reg); } +inline void emit_pop_r32(x86code *&emitptr, uint8_t reg) { emit_op_reg(emitptr, OP_POP_rAX + (reg & 7), OP_32BIT, reg); } inline void emit_pop_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G1A_Ev, OP_32BIT, 0, memref); } #else -inline void emit_push_r64(x86code *&emitptr, UINT8 reg) { emit_op_reg(emitptr, OP_PUSH_rAX + (reg & 7), OP_32BIT, reg); } +inline void emit_push_r64(x86code *&emitptr, uint8_t reg) { emit_op_reg(emitptr, OP_PUSH_rAX + (reg & 7), OP_32BIT, reg); } inline void emit_push_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G5, OP_32BIT, 6, memref); } -inline void emit_pop_r64(x86code *&emitptr, UINT8 reg) { emit_op_reg(emitptr, OP_POP_rAX + (reg & 7), OP_32BIT, reg); } +inline void emit_pop_r64(x86code *&emitptr, uint8_t reg) { emit_op_reg(emitptr, OP_POP_rAX + (reg & 7), OP_32BIT, reg); } inline void emit_pop_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G1A_Ev, OP_32BIT, 0, memref); } #endif @@ -1848,23 +1848,23 @@ inline void emit_pop_m64(x86code *&emitptr, x86_memref memref) // emit_mov_r8_* //------------------------------------------------- -inline void emit_mov_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) +inline void emit_mov_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_reg(emitptr, OP_MOV_AL_Ib | (dreg & 7), OP_32BIT, dreg); emit_byte(emitptr, imm); } -inline void emit_mov_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOV_Gb_Eb, OP_32BIT, dreg, sreg); } -inline void emit_mov_r8_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOV_Gb_Eb, OP_32BIT, dreg, memref); } -inline void emit_mov_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOV_Eb_Gb, OP_32BIT, sreg, memref); } -inline void emit_mov_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G11_Eb_Ib, OP_32BIT, 0, memref, imm); } +inline void emit_mov_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOV_Gb_Eb, OP_32BIT, dreg, sreg); } +inline void emit_mov_r8_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOV_Gb_Eb, OP_32BIT, dreg, memref); } +inline void emit_mov_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOV_Eb_Gb, OP_32BIT, sreg, memref); } +inline void emit_mov_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G11_Eb_Ib, OP_32BIT, 0, memref, imm); } //------------------------------------------------- // emit_xchg_r8_* //------------------------------------------------- -inline void emit_xchg_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) +inline void emit_xchg_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { if (dreg == REG_EAX) emit_op_reg(emitptr, OP_NOP | (sreg & 7), OP_32BIT, sreg); @@ -1879,29 +1879,29 @@ inline void emit_xchg_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) // emit_mov_r16_* //------------------------------------------------- -inline void emit_mov_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) +inline void emit_mov_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_reg(emitptr, OP_MOV_rAX_Iv | (dreg & 7), OP_16BIT, dreg); emit_word(emitptr, imm); } -inline void emit_mov_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOV_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_mov_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOV_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_mov_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm16(emitptr, OP_G11_Ev_Iz, OP_16BIT, 0, memref, imm); } -inline void emit_mov_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOV_Ev_Gv, OP_16BIT, sreg, memref); } -inline void emit_movsx_r16_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Eb, OP_16BIT, dreg, sreg); } -inline void emit_movsx_r16_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Eb, OP_16BIT, dreg, memref); } -inline void emit_movzx_r16_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVZX_Gv_Eb, OP_16BIT, dreg, sreg); } -inline void emit_movzx_r16_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Eb, OP_16BIT, dreg, memref); } -inline void emit_cmovcc_r16_r16(x86code *&emitptr, UINT8 cond, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_16BIT, dreg, sreg); } -inline void emit_cmovcc_r16_m16(x86code *&emitptr, UINT8 cond, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_16BIT, dreg, memref); } +inline void emit_mov_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOV_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_mov_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOV_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_mov_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm16(emitptr, OP_G11_Ev_Iz, OP_16BIT, 0, memref, imm); } +inline void emit_mov_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOV_Ev_Gv, OP_16BIT, sreg, memref); } +inline void emit_movsx_r16_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Eb, OP_16BIT, dreg, sreg); } +inline void emit_movsx_r16_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Eb, OP_16BIT, dreg, memref); } +inline void emit_movzx_r16_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVZX_Gv_Eb, OP_16BIT, dreg, sreg); } +inline void emit_movzx_r16_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Eb, OP_16BIT, dreg, memref); } +inline void emit_cmovcc_r16_r16(x86code *&emitptr, uint8_t cond, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_16BIT, dreg, sreg); } +inline void emit_cmovcc_r16_m16(x86code *&emitptr, uint8_t cond, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_16BIT, dreg, memref); } //------------------------------------------------- // emit_xchg_r16_* //------------------------------------------------- -inline void emit_xchg_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) +inline void emit_xchg_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { if (dreg == REG_EAX) emit_op_reg(emitptr, OP_NOP | (sreg & 7), OP_16BIT, sreg); @@ -1916,21 +1916,21 @@ inline void emit_xchg_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) // emit_mov_r32_* //------------------------------------------------- -inline void emit_mov_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) +inline void emit_mov_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_reg(emitptr, OP_MOV_rAX_Iv | (dreg & 7), OP_32BIT, dreg); emit_dword(emitptr, imm); } -inline void emit_mov_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOV_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_mov_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOV_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_mov_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm32(emitptr, OP_G11_Ev_Iz, OP_32BIT, 0, memref, imm); } -inline void emit_mov_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOV_Ev_Gv, OP_32BIT, sreg, memref); } -inline void emit_movsx_r32_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Eb, OP_32BIT, dreg, sreg); } -inline void emit_movsx_r32_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Eb, OP_32BIT, dreg, memref); } -inline void emit_movsx_r32_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Ew, OP_32BIT, dreg, sreg); } -inline void emit_movsx_r32_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Ew, OP_32BIT, dreg, memref); } -inline void emit_movzx_r32_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) +inline void emit_mov_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOV_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_mov_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOV_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_mov_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm32(emitptr, OP_G11_Ev_Iz, OP_32BIT, 0, memref, imm); } +inline void emit_mov_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOV_Ev_Gv, OP_32BIT, sreg, memref); } +inline void emit_movsx_r32_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Eb, OP_32BIT, dreg, sreg); } +inline void emit_movsx_r32_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Eb, OP_32BIT, dreg, memref); } +inline void emit_movsx_r32_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Ew, OP_32BIT, dreg, sreg); } +inline void emit_movsx_r32_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Ew, OP_32BIT, dreg, memref); } +inline void emit_movzx_r32_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { #if (X86EMIT_SIZE == 32) if (sreg >= 4) @@ -1942,18 +1942,18 @@ inline void emit_movzx_r32_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) #endif emit_op_modrm_reg(emitptr, OP_MOVZX_Gv_Eb, OP_32BIT, dreg, sreg); } -inline void emit_movzx_r32_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Eb, OP_32BIT, dreg, memref); } -inline void emit_movzx_r32_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVZX_Gv_Ew, OP_32BIT, dreg, sreg); } -inline void emit_movzx_r32_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Ew, OP_32BIT, dreg, memref); } -inline void emit_cmovcc_r32_r32(x86code *&emitptr, UINT8 cond, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_32BIT, dreg, sreg); } -inline void emit_cmovcc_r32_m32(x86code *&emitptr, UINT8 cond, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_32BIT, dreg, memref); } +inline void emit_movzx_r32_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Eb, OP_32BIT, dreg, memref); } +inline void emit_movzx_r32_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVZX_Gv_Ew, OP_32BIT, dreg, sreg); } +inline void emit_movzx_r32_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Ew, OP_32BIT, dreg, memref); } +inline void emit_cmovcc_r32_r32(x86code *&emitptr, uint8_t cond, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_32BIT, dreg, sreg); } +inline void emit_cmovcc_r32_m32(x86code *&emitptr, uint8_t cond, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_32BIT, dreg, memref); } //------------------------------------------------- // emit_xchg_r32_* //------------------------------------------------- -inline void emit_xchg_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) +inline void emit_xchg_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { if (dreg == REG_EAX) emit_op_reg(emitptr, OP_NOP | (sreg & 7), OP_32BIT, sreg); @@ -1970,14 +1970,14 @@ inline void emit_xchg_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) #if (X86EMIT_SIZE == 64) -inline void emit_mov_r64_imm(x86code *&emitptr, UINT8 dreg, UINT64 imm) +inline void emit_mov_r64_imm(x86code *&emitptr, uint8_t dreg, uint64_t imm) { - if ((UINT32)imm == imm) + if ((uint32_t)imm == imm) { emit_op_reg(emitptr, OP_MOV_rAX_Iv | (dreg & 7), OP_32BIT, dreg); emit_dword(emitptr, imm); } - else if ((INT32)imm == imm) + else if ((int32_t)imm == imm) emit_op_modrm_reg_imm32(emitptr, OP_G11_Ev_Iz, OP_64BIT, 0, dreg, imm); else { @@ -1986,29 +1986,29 @@ inline void emit_mov_r64_imm(x86code *&emitptr, UINT8 dreg, UINT64 imm) } } -inline void emit_mov_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOV_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_mov_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOV_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_mov_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm32(emitptr, OP_G11_Ev_Iz, OP_64BIT, 0, memref, imm); } -inline void emit_mov_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOV_Ev_Gv, OP_64BIT, sreg, memref); } -inline void emit_movsx_r64_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Eb, OP_64BIT, dreg, sreg); } -inline void emit_movsx_r64_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Eb, OP_64BIT, dreg, memref); } -inline void emit_movsx_r64_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Ew, OP_64BIT, dreg, sreg); } -inline void emit_movsx_r64_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Ew, OP_64BIT, dreg, memref); } -inline void emit_movsxd_r64_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVSXD_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_movsxd_r64_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSXD_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_movzx_r64_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVZX_Gv_Eb, OP_64BIT, dreg, sreg); } -inline void emit_movzx_r64_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Eb, OP_64BIT, dreg, memref); } -inline void emit_movzx_r64_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVZX_Gv_Ew, OP_64BIT, dreg, sreg); } -inline void emit_movzx_r64_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Ew, OP_64BIT, dreg, memref); } -inline void emit_cmovcc_r64_r64(x86code *&emitptr, UINT8 cond, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_64BIT, dreg, sreg); } -inline void emit_cmovcc_r64_m64(x86code *&emitptr, UINT8 cond, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_64BIT, dreg, memref); } +inline void emit_mov_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOV_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_mov_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOV_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_mov_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm32(emitptr, OP_G11_Ev_Iz, OP_64BIT, 0, memref, imm); } +inline void emit_mov_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOV_Ev_Gv, OP_64BIT, sreg, memref); } +inline void emit_movsx_r64_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Eb, OP_64BIT, dreg, sreg); } +inline void emit_movsx_r64_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Eb, OP_64BIT, dreg, memref); } +inline void emit_movsx_r64_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVSX_Gv_Ew, OP_64BIT, dreg, sreg); } +inline void emit_movsx_r64_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSX_Gv_Ew, OP_64BIT, dreg, memref); } +inline void emit_movsxd_r64_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVSXD_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_movsxd_r64_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSXD_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_movzx_r64_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVZX_Gv_Eb, OP_64BIT, dreg, sreg); } +inline void emit_movzx_r64_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Eb, OP_64BIT, dreg, memref); } +inline void emit_movzx_r64_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVZX_Gv_Ew, OP_64BIT, dreg, sreg); } +inline void emit_movzx_r64_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVZX_Gv_Ew, OP_64BIT, dreg, memref); } +inline void emit_cmovcc_r64_r64(x86code *&emitptr, uint8_t cond, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_64BIT, dreg, sreg); } +inline void emit_cmovcc_r64_m64(x86code *&emitptr, uint8_t cond, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMOV_O_Gv_Ev + cond, OP_64BIT, dreg, memref); } //------------------------------------------------- // emit_xchg_r64_* //------------------------------------------------- -inline void emit_xchg_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) +inline void emit_xchg_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { if (dreg == REG_EAX) emit_op_reg(emitptr, OP_NOP | (sreg & 7), OP_64BIT, sreg); @@ -2029,174 +2029,174 @@ inline void emit_xchg_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) // emit_arith_r8_* //------------------------------------------------- -inline void emit_add_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 0, dreg, imm); } -inline void emit_add_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 0, memref, imm); } -inline void emit_add_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADD_Gb_Eb, OP_32BIT, dreg, sreg); } -inline void emit_add_r8_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADD_Gb_Eb, OP_32BIT, dreg, memref); } -inline void emit_add_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_ADD_Eb_Gb, OP_32BIT, sreg, memref); } - -inline void emit_or_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 1, dreg, imm); } -inline void emit_or_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 1, memref, imm); } -inline void emit_or_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_OR_Gb_Eb, OP_32BIT, dreg, sreg); } -inline void emit_or_r8_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_OR_Gb_Eb, OP_32BIT, dreg, memref); } -inline void emit_or_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_OR_Eb_Gb, OP_32BIT, sreg, memref); } - -inline void emit_adc_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 2, dreg, imm); } -inline void emit_adc_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 2, memref, imm); } -inline void emit_adc_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADC_Gb_Eb, OP_32BIT, dreg, sreg); } -inline void emit_adc_r8_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADC_Gb_Eb, OP_32BIT, dreg, memref); } -inline void emit_adc_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_ADC_Eb_Gb, OP_32BIT, sreg, memref); } - -inline void emit_sbb_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 3, dreg, imm); } -inline void emit_sbb_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 3, memref, imm); } -inline void emit_sbb_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SBB_Gb_Eb, OP_32BIT, dreg, sreg); } -inline void emit_sbb_r8_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SBB_Gb_Eb, OP_32BIT, dreg, memref); } -inline void emit_sbb_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SBB_Eb_Gb, OP_32BIT, sreg, memref); } - -inline void emit_and_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 4, dreg, imm); } -inline void emit_and_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 4, memref, imm); } -inline void emit_and_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_AND_Gb_Eb, OP_32BIT, dreg, sreg); } -inline void emit_and_r8_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_AND_Gb_Eb, OP_32BIT, dreg, memref); } -inline void emit_and_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_AND_Eb_Gb, OP_32BIT, sreg, memref); } - -inline void emit_sub_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 5, dreg, imm); } -inline void emit_sub_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 5, memref, imm); } -inline void emit_sub_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SUB_Gb_Eb, OP_32BIT, dreg, sreg); } -inline void emit_sub_r8_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUB_Gb_Eb, OP_32BIT, dreg, memref); } -inline void emit_sub_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SUB_Eb_Gb, OP_32BIT, sreg, memref); } - -inline void emit_xor_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 6, dreg, imm); } -inline void emit_xor_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 6, memref, imm); } -inline void emit_xor_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_XOR_Gb_Eb, OP_32BIT, dreg, sreg); } -inline void emit_xor_r8_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XOR_Gb_Eb, OP_32BIT, dreg, memref); } -inline void emit_xor_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_XOR_Eb_Gb, OP_32BIT, sreg, memref); } - -inline void emit_cmp_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 7, dreg, imm); } -inline void emit_cmp_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 7, memref, imm); } -inline void emit_cmp_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CMP_Gb_Eb, OP_32BIT, dreg, sreg); } -inline void emit_cmp_r8_m8(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMP_Gb_Eb, OP_32BIT, dreg, memref); } -inline void emit_cmp_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_CMP_Eb_Gb, OP_32BIT, sreg, memref); } - -inline void emit_test_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G3_Eb, OP_32BIT, 0, dreg, imm); } -inline void emit_test_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G3_Eb, OP_32BIT, 0, memref, imm); } -inline void emit_test_r8_r8(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_TEST_Eb_Gb, OP_32BIT, sreg, dreg); } -inline void emit_test_m8_r8(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_TEST_Eb_Gb, OP_32BIT, sreg, memref); } +inline void emit_add_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 0, dreg, imm); } +inline void emit_add_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 0, memref, imm); } +inline void emit_add_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADD_Gb_Eb, OP_32BIT, dreg, sreg); } +inline void emit_add_r8_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADD_Gb_Eb, OP_32BIT, dreg, memref); } +inline void emit_add_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_ADD_Eb_Gb, OP_32BIT, sreg, memref); } + +inline void emit_or_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 1, dreg, imm); } +inline void emit_or_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 1, memref, imm); } +inline void emit_or_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_OR_Gb_Eb, OP_32BIT, dreg, sreg); } +inline void emit_or_r8_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_OR_Gb_Eb, OP_32BIT, dreg, memref); } +inline void emit_or_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_OR_Eb_Gb, OP_32BIT, sreg, memref); } + +inline void emit_adc_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 2, dreg, imm); } +inline void emit_adc_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 2, memref, imm); } +inline void emit_adc_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADC_Gb_Eb, OP_32BIT, dreg, sreg); } +inline void emit_adc_r8_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADC_Gb_Eb, OP_32BIT, dreg, memref); } +inline void emit_adc_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_ADC_Eb_Gb, OP_32BIT, sreg, memref); } + +inline void emit_sbb_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 3, dreg, imm); } +inline void emit_sbb_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 3, memref, imm); } +inline void emit_sbb_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SBB_Gb_Eb, OP_32BIT, dreg, sreg); } +inline void emit_sbb_r8_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SBB_Gb_Eb, OP_32BIT, dreg, memref); } +inline void emit_sbb_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SBB_Eb_Gb, OP_32BIT, sreg, memref); } + +inline void emit_and_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 4, dreg, imm); } +inline void emit_and_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 4, memref, imm); } +inline void emit_and_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_AND_Gb_Eb, OP_32BIT, dreg, sreg); } +inline void emit_and_r8_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_AND_Gb_Eb, OP_32BIT, dreg, memref); } +inline void emit_and_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_AND_Eb_Gb, OP_32BIT, sreg, memref); } + +inline void emit_sub_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 5, dreg, imm); } +inline void emit_sub_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 5, memref, imm); } +inline void emit_sub_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SUB_Gb_Eb, OP_32BIT, dreg, sreg); } +inline void emit_sub_r8_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUB_Gb_Eb, OP_32BIT, dreg, memref); } +inline void emit_sub_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SUB_Eb_Gb, OP_32BIT, sreg, memref); } + +inline void emit_xor_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 6, dreg, imm); } +inline void emit_xor_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 6, memref, imm); } +inline void emit_xor_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_XOR_Gb_Eb, OP_32BIT, dreg, sreg); } +inline void emit_xor_r8_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XOR_Gb_Eb, OP_32BIT, dreg, memref); } +inline void emit_xor_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_XOR_Eb_Gb, OP_32BIT, sreg, memref); } + +inline void emit_cmp_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 7, dreg, imm); } +inline void emit_cmp_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G1_Eb_Ib, OP_32BIT, 7, memref, imm); } +inline void emit_cmp_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CMP_Gb_Eb, OP_32BIT, dreg, sreg); } +inline void emit_cmp_r8_m8(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMP_Gb_Eb, OP_32BIT, dreg, memref); } +inline void emit_cmp_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_CMP_Eb_Gb, OP_32BIT, sreg, memref); } + +inline void emit_test_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G3_Eb, OP_32BIT, 0, dreg, imm); } +inline void emit_test_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G3_Eb, OP_32BIT, 0, memref, imm); } +inline void emit_test_r8_r8(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_TEST_Eb_Gb, OP_32BIT, sreg, dreg); } +inline void emit_test_m8_r8(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_TEST_Eb_Gb, OP_32BIT, sreg, memref); } //------------------------------------------------- // emit_arith_r16_* //------------------------------------------------- -inline void emit_add_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 0, dreg, imm); } -inline void emit_add_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 0, memref, imm); } -inline void emit_add_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADD_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_add_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADD_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_add_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_ADD_Ev_Gv, OP_16BIT, sreg, memref); } - -inline void emit_or_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 1, dreg, imm); } -inline void emit_or_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 1, memref, imm); } -inline void emit_or_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_OR_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_or_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_OR_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_or_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_OR_Ev_Gv, OP_16BIT, sreg, memref); } - -inline void emit_adc_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 2, dreg, imm); } -inline void emit_adc_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 2, memref, imm); } -inline void emit_adc_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADC_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_adc_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADC_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_adc_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_ADC_Ev_Gv, OP_16BIT, sreg, memref); } - -inline void emit_sbb_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 3, dreg, imm); } -inline void emit_sbb_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 3, memref, imm); } -inline void emit_sbb_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SBB_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_sbb_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SBB_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_sbb_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SBB_Ev_Gv, OP_16BIT, sreg, memref); } - -inline void emit_and_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 4, dreg, imm); } -inline void emit_and_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 4, memref, imm); } -inline void emit_and_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_AND_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_and_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_AND_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_and_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_AND_Ev_Gv, OP_16BIT, sreg, memref); } - -inline void emit_sub_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 5, dreg, imm); } -inline void emit_sub_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 5, memref, imm); } -inline void emit_sub_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SUB_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_sub_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUB_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_sub_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SUB_Ev_Gv, OP_16BIT, sreg, memref); } - -inline void emit_xor_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 6, dreg, imm); } -inline void emit_xor_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 6, memref, imm); } -inline void emit_xor_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_XOR_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_xor_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XOR_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_xor_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_XOR_Ev_Gv, OP_16BIT, sreg, memref); } - -inline void emit_cmp_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 7, dreg, imm); } -inline void emit_cmp_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 7, memref, imm); } -inline void emit_cmp_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CMP_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_cmp_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMP_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_cmp_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_CMP_Ev_Gv, OP_16BIT, sreg, memref); } - -inline void emit_test_r16_imm(x86code *&emitptr, UINT8 dreg, UINT16 imm) { emit_op_modrm_reg_imm16(emitptr, OP_G3_Ev, OP_16BIT, 0, dreg, imm); } -inline void emit_test_m16_imm(x86code *&emitptr, x86_memref memref, UINT16 imm) { emit_op_modrm_mem_imm16(emitptr, OP_G3_Ev, OP_16BIT, 0, memref, imm); } -inline void emit_test_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_TEST_Ev_Gv, OP_16BIT, sreg, dreg); } -inline void emit_test_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_TEST_Ev_Gv, OP_16BIT, sreg, memref); } +inline void emit_add_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 0, dreg, imm); } +inline void emit_add_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 0, memref, imm); } +inline void emit_add_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADD_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_add_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADD_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_add_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_ADD_Ev_Gv, OP_16BIT, sreg, memref); } + +inline void emit_or_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 1, dreg, imm); } +inline void emit_or_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 1, memref, imm); } +inline void emit_or_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_OR_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_or_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_OR_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_or_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_OR_Ev_Gv, OP_16BIT, sreg, memref); } + +inline void emit_adc_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 2, dreg, imm); } +inline void emit_adc_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 2, memref, imm); } +inline void emit_adc_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADC_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_adc_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADC_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_adc_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_ADC_Ev_Gv, OP_16BIT, sreg, memref); } + +inline void emit_sbb_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 3, dreg, imm); } +inline void emit_sbb_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 3, memref, imm); } +inline void emit_sbb_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SBB_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_sbb_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SBB_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_sbb_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SBB_Ev_Gv, OP_16BIT, sreg, memref); } + +inline void emit_and_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 4, dreg, imm); } +inline void emit_and_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 4, memref, imm); } +inline void emit_and_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_AND_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_and_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_AND_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_and_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_AND_Ev_Gv, OP_16BIT, sreg, memref); } + +inline void emit_sub_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 5, dreg, imm); } +inline void emit_sub_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 5, memref, imm); } +inline void emit_sub_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SUB_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_sub_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUB_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_sub_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SUB_Ev_Gv, OP_16BIT, sreg, memref); } + +inline void emit_xor_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 6, dreg, imm); } +inline void emit_xor_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 6, memref, imm); } +inline void emit_xor_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_XOR_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_xor_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XOR_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_xor_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_XOR_Ev_Gv, OP_16BIT, sreg, memref); } + +inline void emit_cmp_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_modrm_reg_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 7, dreg, imm); } +inline void emit_cmp_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm816(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_16BIT, 7, memref, imm); } +inline void emit_cmp_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CMP_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_cmp_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMP_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_cmp_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_CMP_Ev_Gv, OP_16BIT, sreg, memref); } + +inline void emit_test_r16_imm(x86code *&emitptr, uint8_t dreg, uint16_t imm) { emit_op_modrm_reg_imm16(emitptr, OP_G3_Ev, OP_16BIT, 0, dreg, imm); } +inline void emit_test_m16_imm(x86code *&emitptr, x86_memref memref, uint16_t imm) { emit_op_modrm_mem_imm16(emitptr, OP_G3_Ev, OP_16BIT, 0, memref, imm); } +inline void emit_test_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_TEST_Ev_Gv, OP_16BIT, sreg, dreg); } +inline void emit_test_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_TEST_Ev_Gv, OP_16BIT, sreg, memref); } //------------------------------------------------- // emit_arith_r32_* //------------------------------------------------- -inline void emit_add_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 0, dreg, imm); } -inline void emit_add_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 0, memref, imm); } -inline void emit_add_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADD_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_add_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADD_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_add_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_ADD_Ev_Gv, OP_32BIT, sreg, memref); } - -inline void emit_or_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 1, dreg, imm); } -inline void emit_or_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 1, memref, imm); } -inline void emit_or_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_OR_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_or_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_OR_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_or_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_OR_Ev_Gv, OP_32BIT, sreg, memref); } - -inline void emit_adc_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 2, dreg, imm); } -inline void emit_adc_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 2, memref, imm); } -inline void emit_adc_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADC_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_adc_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADC_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_adc_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_ADC_Ev_Gv, OP_32BIT, sreg, memref); } - -inline void emit_sbb_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 3, dreg, imm); } -inline void emit_sbb_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 3, memref, imm); } -inline void emit_sbb_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SBB_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_sbb_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SBB_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_sbb_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SBB_Ev_Gv, OP_32BIT, sreg, memref); } - -inline void emit_and_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 4, dreg, imm); } -inline void emit_and_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 4, memref, imm); } -inline void emit_and_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_AND_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_and_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_AND_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_and_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_AND_Ev_Gv, OP_32BIT, sreg, memref); } - -inline void emit_sub_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 5, dreg, imm); } -inline void emit_sub_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 5, memref, imm); } -inline void emit_sub_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SUB_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_sub_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUB_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_sub_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SUB_Ev_Gv, OP_32BIT, sreg, memref); } - -inline void emit_xor_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 6, dreg, imm); } -inline void emit_xor_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 6, memref, imm); } -inline void emit_xor_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_XOR_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_xor_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XOR_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_xor_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_XOR_Ev_Gv, OP_32BIT, sreg, memref); } - -inline void emit_cmp_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 7, dreg, imm); } -inline void emit_cmp_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 7, memref, imm); } -inline void emit_cmp_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CMP_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_cmp_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMP_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_cmp_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_CMP_Ev_Gv, OP_32BIT, sreg, memref); } - -inline void emit_test_r32_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm32(emitptr, OP_G3_Ev, OP_32BIT, 0, dreg, imm); } -inline void emit_test_m32_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm32(emitptr, OP_G3_Ev, OP_32BIT, 0, memref, imm); } -inline void emit_test_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_TEST_Ev_Gv, OP_32BIT, sreg, dreg); } -inline void emit_test_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_TEST_Ev_Gv, OP_32BIT, sreg, memref); } +inline void emit_add_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 0, dreg, imm); } +inline void emit_add_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 0, memref, imm); } +inline void emit_add_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADD_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_add_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADD_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_add_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_ADD_Ev_Gv, OP_32BIT, sreg, memref); } + +inline void emit_or_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 1, dreg, imm); } +inline void emit_or_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 1, memref, imm); } +inline void emit_or_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_OR_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_or_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_OR_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_or_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_OR_Ev_Gv, OP_32BIT, sreg, memref); } + +inline void emit_adc_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 2, dreg, imm); } +inline void emit_adc_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 2, memref, imm); } +inline void emit_adc_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADC_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_adc_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADC_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_adc_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_ADC_Ev_Gv, OP_32BIT, sreg, memref); } + +inline void emit_sbb_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 3, dreg, imm); } +inline void emit_sbb_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 3, memref, imm); } +inline void emit_sbb_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SBB_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_sbb_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SBB_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_sbb_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SBB_Ev_Gv, OP_32BIT, sreg, memref); } + +inline void emit_and_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 4, dreg, imm); } +inline void emit_and_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 4, memref, imm); } +inline void emit_and_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_AND_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_and_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_AND_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_and_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_AND_Ev_Gv, OP_32BIT, sreg, memref); } + +inline void emit_sub_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 5, dreg, imm); } +inline void emit_sub_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 5, memref, imm); } +inline void emit_sub_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SUB_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_sub_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUB_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_sub_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SUB_Ev_Gv, OP_32BIT, sreg, memref); } + +inline void emit_xor_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 6, dreg, imm); } +inline void emit_xor_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 6, memref, imm); } +inline void emit_xor_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_XOR_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_xor_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XOR_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_xor_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_XOR_Ev_Gv, OP_32BIT, sreg, memref); } + +inline void emit_cmp_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 7, dreg, imm); } +inline void emit_cmp_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_32BIT, 7, memref, imm); } +inline void emit_cmp_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CMP_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_cmp_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMP_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_cmp_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_CMP_Ev_Gv, OP_32BIT, sreg, memref); } + +inline void emit_test_r32_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm32(emitptr, OP_G3_Ev, OP_32BIT, 0, dreg, imm); } +inline void emit_test_m32_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm32(emitptr, OP_G3_Ev, OP_32BIT, 0, memref, imm); } +inline void emit_test_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_TEST_Ev_Gv, OP_32BIT, sreg, dreg); } +inline void emit_test_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_TEST_Ev_Gv, OP_32BIT, sreg, memref); } //------------------------------------------------- @@ -2205,58 +2205,58 @@ inline void emit_test_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) #if (X86EMIT_SIZE == 64) -inline void emit_add_r64_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 0, dreg, imm); } -inline void emit_add_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 0, memref, imm); } -inline void emit_add_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADD_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_add_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADD_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_add_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_ADD_Ev_Gv, OP_64BIT, sreg, memref); } - -inline void emit_or_r64_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 1, dreg, imm); } -inline void emit_or_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 1, memref, imm); } -inline void emit_or_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_OR_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_or_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_OR_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_or_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_OR_Ev_Gv, OP_64BIT, sreg, memref); } - -inline void emit_adc_r64_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 2, dreg, imm); } -inline void emit_adc_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 2, memref, imm); } -inline void emit_adc_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADC_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_adc_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADC_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_adc_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_ADC_Ev_Gv, OP_64BIT, sreg, memref); } - -inline void emit_sbb_r64_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 3, dreg, imm); } -inline void emit_sbb_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 3, memref, imm); } -inline void emit_sbb_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SBB_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_sbb_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SBB_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_sbb_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SBB_Ev_Gv, OP_64BIT, sreg, memref); } - -inline void emit_and_r64_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 4, dreg, imm); } -inline void emit_and_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 4, memref, imm); } -inline void emit_and_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_AND_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_and_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_AND_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_and_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_AND_Ev_Gv, OP_64BIT, sreg, memref); } - -inline void emit_sub_r64_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 5, dreg, imm); } -inline void emit_sub_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 5, memref, imm); } -inline void emit_sub_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SUB_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_sub_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUB_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_sub_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SUB_Ev_Gv, OP_64BIT, sreg, memref); } - -inline void emit_xor_r64_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 6, dreg, imm); } -inline void emit_xor_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 6, memref, imm); } -inline void emit_xor_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_XOR_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_xor_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XOR_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_xor_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_XOR_Ev_Gv, OP_64BIT, sreg, memref); } - -inline void emit_cmp_r64_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 7, dreg, imm); } -inline void emit_cmp_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 7, memref, imm); } -inline void emit_cmp_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CMP_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_cmp_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMP_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_cmp_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_CMP_Ev_Gv, OP_64BIT, sreg, memref); } - -inline void emit_test_r64_imm(x86code *&emitptr, UINT8 dreg, UINT32 imm) { emit_op_modrm_reg_imm32(emitptr, OP_G3_Ev, OP_64BIT, 0, dreg, imm); } -inline void emit_test_m64_imm(x86code *&emitptr, x86_memref memref, UINT32 imm) { emit_op_modrm_mem_imm32(emitptr, OP_G3_Ev, OP_64BIT, 0, memref, imm); } -inline void emit_test_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_TEST_Ev_Gv, OP_64BIT, sreg, dreg); } -inline void emit_test_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_TEST_Ev_Gv, OP_64BIT, sreg, memref); } +inline void emit_add_r64_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 0, dreg, imm); } +inline void emit_add_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 0, memref, imm); } +inline void emit_add_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADD_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_add_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADD_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_add_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_ADD_Ev_Gv, OP_64BIT, sreg, memref); } + +inline void emit_or_r64_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 1, dreg, imm); } +inline void emit_or_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 1, memref, imm); } +inline void emit_or_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_OR_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_or_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_OR_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_or_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_OR_Ev_Gv, OP_64BIT, sreg, memref); } + +inline void emit_adc_r64_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 2, dreg, imm); } +inline void emit_adc_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 2, memref, imm); } +inline void emit_adc_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADC_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_adc_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADC_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_adc_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_ADC_Ev_Gv, OP_64BIT, sreg, memref); } + +inline void emit_sbb_r64_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 3, dreg, imm); } +inline void emit_sbb_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 3, memref, imm); } +inline void emit_sbb_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SBB_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_sbb_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SBB_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_sbb_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SBB_Ev_Gv, OP_64BIT, sreg, memref); } + +inline void emit_and_r64_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 4, dreg, imm); } +inline void emit_and_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 4, memref, imm); } +inline void emit_and_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_AND_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_and_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_AND_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_and_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_AND_Ev_Gv, OP_64BIT, sreg, memref); } + +inline void emit_sub_r64_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 5, dreg, imm); } +inline void emit_sub_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 5, memref, imm); } +inline void emit_sub_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SUB_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_sub_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUB_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_sub_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SUB_Ev_Gv, OP_64BIT, sreg, memref); } + +inline void emit_xor_r64_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 6, dreg, imm); } +inline void emit_xor_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 6, memref, imm); } +inline void emit_xor_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_XOR_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_xor_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XOR_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_xor_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_XOR_Ev_Gv, OP_64BIT, sreg, memref); } + +inline void emit_cmp_r64_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 7, dreg, imm); } +inline void emit_cmp_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_G1_Ev_Ib, OP_G1_Ev_Iz, OP_64BIT, 7, memref, imm); } +inline void emit_cmp_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CMP_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_cmp_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CMP_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_cmp_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_CMP_Ev_Gv, OP_64BIT, sreg, memref); } + +inline void emit_test_r64_imm(x86code *&emitptr, uint8_t dreg, uint32_t imm) { emit_op_modrm_reg_imm32(emitptr, OP_G3_Ev, OP_64BIT, 0, dreg, imm); } +inline void emit_test_m64_imm(x86code *&emitptr, x86_memref memref, uint32_t imm) { emit_op_modrm_mem_imm32(emitptr, OP_G3_Ev, OP_64BIT, 0, memref, imm); } +inline void emit_test_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_TEST_Ev_Gv, OP_64BIT, sreg, dreg); } +inline void emit_test_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_TEST_Ev_Gv, OP_64BIT, sreg, memref); } #endif @@ -2270,7 +2270,7 @@ inline void emit_test_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) // emit_shift_reg_imm //------------------------------------------------- -inline void emit_shift_reg_imm(x86code *&emitptr, UINT32 op1, UINT32 opn, UINT8 opsize, UINT8 opindex, UINT8 dreg, UINT8 imm) +inline void emit_shift_reg_imm(x86code *&emitptr, uint32_t op1, uint32_t opn, uint8_t opsize, uint8_t opindex, uint8_t dreg, uint8_t imm) { if (imm == 1) emit_op_modrm_reg(emitptr, op1, opsize, opindex, dreg); @@ -2278,7 +2278,7 @@ inline void emit_shift_reg_imm(x86code *&emitptr, UINT32 op1, UINT32 opn, UINT8 emit_op_modrm_reg_imm8(emitptr, opn, opsize, opindex, dreg, imm); } -inline void emit_shift_mem_imm(x86code *&emitptr, UINT32 op1, UINT32 opn, UINT8 opsize, UINT8 opindex, x86_memref memref, UINT8 imm) +inline void emit_shift_mem_imm(x86code *&emitptr, uint32_t op1, uint32_t opn, uint8_t opsize, uint8_t opindex, x86_memref memref, uint8_t imm) { if (imm == 1) emit_op_modrm_mem(emitptr, op1, opsize, opindex, memref); @@ -2291,39 +2291,39 @@ inline void emit_shift_mem_imm(x86code *&emitptr, UINT32 op1, UINT32 opn, UINT8 // emit_shift_r8_* //------------------------------------------------- -inline void emit_rol_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 0, dreg, imm); } -inline void emit_rol_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 0, memref, imm); } -inline void emit_rol_r8_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 0, dreg); } +inline void emit_rol_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 0, dreg, imm); } +inline void emit_rol_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 0, memref, imm); } +inline void emit_rol_r8_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 0, dreg); } inline void emit_rol_m8_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Eb_CL, OP_32BIT, 0, memref); } -inline void emit_ror_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 1, dreg, imm); } -inline void emit_ror_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 1, memref, imm); } -inline void emit_ror_r8_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 1, dreg); } +inline void emit_ror_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 1, dreg, imm); } +inline void emit_ror_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 1, memref, imm); } +inline void emit_ror_r8_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 1, dreg); } inline void emit_ror_m8_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Eb_CL, OP_32BIT, 1, memref); } -inline void emit_rcl_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 2, dreg, imm); } -inline void emit_rcl_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 2, memref, imm); } -inline void emit_rcl_r8_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 2, dreg); } +inline void emit_rcl_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 2, dreg, imm); } +inline void emit_rcl_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 2, memref, imm); } +inline void emit_rcl_r8_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 2, dreg); } inline void emit_rcl_m8_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Eb_CL, OP_32BIT, 2, memref); } -inline void emit_rcr_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 3, dreg, imm); } -inline void emit_rcr_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 3, memref, imm); } -inline void emit_rcr_r8_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 3, dreg); } +inline void emit_rcr_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 3, dreg, imm); } +inline void emit_rcr_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 3, memref, imm); } +inline void emit_rcr_r8_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 3, dreg); } inline void emit_rcr_m8_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Eb_CL, OP_32BIT, 3, memref); } -inline void emit_shl_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 4, dreg, imm); } -inline void emit_shl_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 4, memref, imm); } -inline void emit_shl_r8_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 4, dreg); } +inline void emit_shl_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 4, dreg, imm); } +inline void emit_shl_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 4, memref, imm); } +inline void emit_shl_r8_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 4, dreg); } inline void emit_shl_m8_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Eb_CL, OP_32BIT, 4, memref); } -inline void emit_shr_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 5, dreg, imm); } -inline void emit_shr_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 5, memref, imm); } -inline void emit_shr_r8_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 5, dreg); } +inline void emit_shr_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 5, dreg, imm); } +inline void emit_shr_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 5, memref, imm); } +inline void emit_shr_r8_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 5, dreg); } inline void emit_shr_m8_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Eb_CL, OP_32BIT, 5, memref); } -inline void emit_sar_r8_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 7, dreg, imm); } -inline void emit_sar_m8_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 7, memref, imm); } -inline void emit_sar_r8_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 7, dreg); } +inline void emit_sar_r8_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 7, dreg, imm); } +inline void emit_sar_m8_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Eb_1, OP_G2_Eb_Ib, OP_32BIT, 7, memref, imm); } +inline void emit_sar_r8_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Eb_CL, OP_32BIT, 7, dreg); } inline void emit_sar_m8_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Eb_CL, OP_32BIT, 7, memref); } @@ -2331,39 +2331,39 @@ inline void emit_sar_m8_cl(x86code *&emitptr, x86_memref memref) // emit_shift_r16_* //------------------------------------------------- -inline void emit_rol_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 0, dreg, imm); } -inline void emit_rol_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 0, memref, imm); } -inline void emit_rol_r16_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 0, dreg); } +inline void emit_rol_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 0, dreg, imm); } +inline void emit_rol_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 0, memref, imm); } +inline void emit_rol_r16_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 0, dreg); } inline void emit_rol_m16_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_16BIT, 0, memref); } -inline void emit_ror_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 1, dreg, imm); } -inline void emit_ror_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 1, memref, imm); } -inline void emit_ror_r16_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 1, dreg); } +inline void emit_ror_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 1, dreg, imm); } +inline void emit_ror_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 1, memref, imm); } +inline void emit_ror_r16_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 1, dreg); } inline void emit_ror_m16_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_16BIT, 1, memref); } -inline void emit_rcl_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 2, dreg, imm); } -inline void emit_rcl_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 2, memref, imm); } -inline void emit_rcl_r16_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 2, dreg); } +inline void emit_rcl_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 2, dreg, imm); } +inline void emit_rcl_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 2, memref, imm); } +inline void emit_rcl_r16_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 2, dreg); } inline void emit_rcl_m16_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_16BIT, 2, memref); } -inline void emit_rcr_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 3, dreg, imm); } -inline void emit_rcr_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 3, memref, imm); } -inline void emit_rcr_r16_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 3, dreg); } +inline void emit_rcr_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 3, dreg, imm); } +inline void emit_rcr_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 3, memref, imm); } +inline void emit_rcr_r16_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 3, dreg); } inline void emit_rcr_m16_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_16BIT, 3, memref); } -inline void emit_shl_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 4, dreg, imm); } -inline void emit_shl_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 4, memref, imm); } -inline void emit_shl_r16_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 4, dreg); } +inline void emit_shl_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 4, dreg, imm); } +inline void emit_shl_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 4, memref, imm); } +inline void emit_shl_r16_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 4, dreg); } inline void emit_shl_m16_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_16BIT, 4, memref); } -inline void emit_shr_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 5, dreg, imm); } -inline void emit_shr_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 5, memref, imm); } -inline void emit_shr_r16_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 5, dreg); } +inline void emit_shr_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 5, dreg, imm); } +inline void emit_shr_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 5, memref, imm); } +inline void emit_shr_r16_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 5, dreg); } inline void emit_shr_m16_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_16BIT, 5, memref); } -inline void emit_sar_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 7, dreg, imm); } -inline void emit_sar_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 7, memref, imm); } -inline void emit_sar_r16_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 7, dreg); } +inline void emit_sar_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 7, dreg, imm); } +inline void emit_sar_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_16BIT, 7, memref, imm); } +inline void emit_sar_r16_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_16BIT, 7, dreg); } inline void emit_sar_m16_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_16BIT, 7, memref); } @@ -2371,50 +2371,50 @@ inline void emit_sar_m16_cl(x86code *&emitptr, x86_memref memref) // emit_shift_r32_* //------------------------------------------------- -inline void emit_rol_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 0, dreg, imm); } -inline void emit_rol_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 0, memref, imm); } -inline void emit_rol_r32_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 0, dreg); } +inline void emit_rol_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 0, dreg, imm); } +inline void emit_rol_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 0, memref, imm); } +inline void emit_rol_r32_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 0, dreg); } inline void emit_rol_m32_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_32BIT, 0, memref); } -inline void emit_ror_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 1, dreg, imm); } -inline void emit_ror_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 1, memref, imm); } -inline void emit_ror_r32_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 1, dreg); } +inline void emit_ror_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 1, dreg, imm); } +inline void emit_ror_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 1, memref, imm); } +inline void emit_ror_r32_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 1, dreg); } inline void emit_ror_m32_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_32BIT, 1, memref); } -inline void emit_rcl_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 2, dreg, imm); } -inline void emit_rcl_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 2, memref, imm); } -inline void emit_rcl_r32_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 2, dreg); } +inline void emit_rcl_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 2, dreg, imm); } +inline void emit_rcl_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 2, memref, imm); } +inline void emit_rcl_r32_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 2, dreg); } inline void emit_rcl_m32_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_32BIT, 2, memref); } -inline void emit_rcr_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 3, dreg, imm); } -inline void emit_rcr_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 3, memref, imm); } -inline void emit_rcr_r32_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 3, dreg); } +inline void emit_rcr_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 3, dreg, imm); } +inline void emit_rcr_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 3, memref, imm); } +inline void emit_rcr_r32_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 3, dreg); } inline void emit_rcr_m32_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_32BIT, 3, memref); } -inline void emit_shl_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 4, dreg, imm); } -inline void emit_shl_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 4, memref, imm); } -inline void emit_shl_r32_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 4, dreg); } +inline void emit_shl_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 4, dreg, imm); } +inline void emit_shl_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 4, memref, imm); } +inline void emit_shl_r32_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 4, dreg); } inline void emit_shl_m32_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_32BIT, 4, memref); } -inline void emit_shr_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 5, dreg, imm); } -inline void emit_shr_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 5, memref, imm); } -inline void emit_shr_r32_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 5, dreg); } +inline void emit_shr_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 5, dreg, imm); } +inline void emit_shr_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 5, memref, imm); } +inline void emit_shr_r32_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 5, dreg); } inline void emit_shr_m32_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_32BIT, 5, memref); } -inline void emit_sar_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 7, dreg, imm); } -inline void emit_sar_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 7, memref, imm); } -inline void emit_sar_r32_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 7, dreg); } +inline void emit_sar_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 7, dreg, imm); } +inline void emit_sar_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_32BIT, 7, memref, imm); } +inline void emit_sar_r32_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_32BIT, 7, dreg); } inline void emit_sar_m32_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_32BIT, 7, memref); } -inline void emit_shld_r32_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_SHLD_Ev_Gv_Ib, OP_32BIT, sreg, dreg, imm); } -inline void emit_shld_m32_r32_imm(x86code *&emitptr, x86_memref memref, UINT8 sreg, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_SHLD_Ev_Gv_Ib, OP_32BIT, sreg, memref, imm); } -inline void emit_shld_r32_r32_cl(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SHLD_Ev_Gv_CL, OP_32BIT, sreg, dreg); } -inline void emit_shld_m32_r32_cl(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SHLD_Ev_Gv_CL, OP_32BIT, sreg, memref); } +inline void emit_shld_r32_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_SHLD_Ev_Gv_Ib, OP_32BIT, sreg, dreg, imm); } +inline void emit_shld_m32_r32_imm(x86code *&emitptr, x86_memref memref, uint8_t sreg, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_SHLD_Ev_Gv_Ib, OP_32BIT, sreg, memref, imm); } +inline void emit_shld_r32_r32_cl(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SHLD_Ev_Gv_CL, OP_32BIT, sreg, dreg); } +inline void emit_shld_m32_r32_cl(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SHLD_Ev_Gv_CL, OP_32BIT, sreg, memref); } -inline void emit_shrd_r32_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_SHRD_Ev_Gv_Ib, OP_32BIT, sreg, dreg, imm); } -inline void emit_shrd_m32_r32_imm(x86code *&emitptr, x86_memref memref, UINT8 sreg, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_SHRD_Ev_Gv_Ib, OP_32BIT, sreg, memref, imm); } -inline void emit_shrd_r32_r32_cl(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SHRD_Ev_Gv_CL, OP_32BIT, sreg, dreg); } -inline void emit_shrd_m32_r32_cl(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SHRD_Ev_Gv_CL, OP_32BIT, sreg, memref); } +inline void emit_shrd_r32_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_SHRD_Ev_Gv_Ib, OP_32BIT, sreg, dreg, imm); } +inline void emit_shrd_m32_r32_imm(x86code *&emitptr, x86_memref memref, uint8_t sreg, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_SHRD_Ev_Gv_Ib, OP_32BIT, sreg, memref, imm); } +inline void emit_shrd_r32_r32_cl(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SHRD_Ev_Gv_CL, OP_32BIT, sreg, dreg); } +inline void emit_shrd_m32_r32_cl(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SHRD_Ev_Gv_CL, OP_32BIT, sreg, memref); } //------------------------------------------------- @@ -2423,50 +2423,50 @@ inline void emit_shrd_m32_r32_cl(x86code *&emitptr, x86_memref memref, UINT8 sre #if (X86EMIT_SIZE == 64) -inline void emit_rol_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 0, dreg, imm); } -inline void emit_rol_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 0, memref, imm); } -inline void emit_rol_r64_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 0, dreg); } +inline void emit_rol_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 0, dreg, imm); } +inline void emit_rol_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 0, memref, imm); } +inline void emit_rol_r64_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 0, dreg); } inline void emit_rol_m64_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_64BIT, 0, memref); } -inline void emit_ror_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 1, dreg, imm); } -inline void emit_ror_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 1, memref, imm); } -inline void emit_ror_r64_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 1, dreg); } +inline void emit_ror_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 1, dreg, imm); } +inline void emit_ror_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 1, memref, imm); } +inline void emit_ror_r64_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 1, dreg); } inline void emit_ror_m64_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_64BIT, 1, memref); } -inline void emit_rcl_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 2, dreg, imm); } -inline void emit_rcl_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 2, memref, imm); } -inline void emit_rcl_r64_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 2, dreg); } +inline void emit_rcl_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 2, dreg, imm); } +inline void emit_rcl_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 2, memref, imm); } +inline void emit_rcl_r64_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 2, dreg); } inline void emit_rcl_m64_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_64BIT, 2, memref); } -inline void emit_rcr_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 3, dreg, imm); } -inline void emit_rcr_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 3, memref, imm); } -inline void emit_rcr_r64_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 3, dreg); } +inline void emit_rcr_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 3, dreg, imm); } +inline void emit_rcr_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 3, memref, imm); } +inline void emit_rcr_r64_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 3, dreg); } inline void emit_rcr_m64_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_64BIT, 3, memref); } -inline void emit_shl_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 4, dreg, imm); } -inline void emit_shl_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 4, memref, imm); } -inline void emit_shl_r64_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 4, dreg); } +inline void emit_shl_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 4, dreg, imm); } +inline void emit_shl_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 4, memref, imm); } +inline void emit_shl_r64_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 4, dreg); } inline void emit_shl_m64_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_64BIT, 4, memref); } -inline void emit_shr_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 5, dreg, imm); } -inline void emit_shr_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 5, memref, imm); } -inline void emit_shr_r64_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 5, dreg); } +inline void emit_shr_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 5, dreg, imm); } +inline void emit_shr_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 5, memref, imm); } +inline void emit_shr_r64_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 5, dreg); } inline void emit_shr_m64_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_64BIT, 5, memref); } -inline void emit_sar_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 7, dreg, imm); } -inline void emit_sar_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 7, memref, imm); } -inline void emit_sar_r64_cl(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 7, dreg); } +inline void emit_sar_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_shift_reg_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 7, dreg, imm); } +inline void emit_sar_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_shift_mem_imm(emitptr, OP_G2_Ev_1, OP_G2_Ev_Ib, OP_64BIT, 7, memref, imm); } +inline void emit_sar_r64_cl(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G2_Ev_CL, OP_64BIT, 7, dreg); } inline void emit_sar_m64_cl(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G2_Ev_CL, OP_64BIT, 7, memref); } -inline void emit_shld_r64_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_SHLD_Ev_Gv_Ib, OP_64BIT, sreg, dreg, imm); } -inline void emit_shld_m64_r64_imm(x86code *&emitptr, x86_memref memref, UINT8 sreg, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_SHLD_Ev_Gv_Ib, OP_64BIT, sreg, memref, imm); } -inline void emit_shld_r64_r64_cl(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SHLD_Ev_Gv_CL, OP_64BIT, sreg, dreg); } -inline void emit_shld_m64_r64_cl(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SHLD_Ev_Gv_CL, OP_64BIT, sreg, memref); } +inline void emit_shld_r64_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_SHLD_Ev_Gv_Ib, OP_64BIT, sreg, dreg, imm); } +inline void emit_shld_m64_r64_imm(x86code *&emitptr, x86_memref memref, uint8_t sreg, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_SHLD_Ev_Gv_Ib, OP_64BIT, sreg, memref, imm); } +inline void emit_shld_r64_r64_cl(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SHLD_Ev_Gv_CL, OP_64BIT, sreg, dreg); } +inline void emit_shld_m64_r64_cl(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SHLD_Ev_Gv_CL, OP_64BIT, sreg, memref); } -inline void emit_shrd_r64_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_SHRD_Ev_Gv_Ib, OP_64BIT, sreg, dreg, imm); } -inline void emit_shrd_m64_r64_imm(x86code *&emitptr, x86_memref memref, UINT8 sreg, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_SHRD_Ev_Gv_Ib, OP_64BIT, sreg, memref, imm); } -inline void emit_shrd_r64_r64_cl(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SHRD_Ev_Gv_CL, OP_64BIT, sreg, dreg); } -inline void emit_shrd_m64_r64_cl(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_SHRD_Ev_Gv_CL, OP_64BIT, sreg, memref); } +inline void emit_shrd_r64_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_SHRD_Ev_Gv_Ib, OP_64BIT, sreg, dreg, imm); } +inline void emit_shrd_m64_r64_imm(x86code *&emitptr, x86_memref memref, uint8_t sreg, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_SHRD_Ev_Gv_Ib, OP_64BIT, sreg, memref, imm); } +inline void emit_shrd_r64_r64_cl(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SHRD_Ev_Gv_CL, OP_64BIT, sreg, dreg); } +inline void emit_shrd_m64_r64_cl(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_SHRD_Ev_Gv_CL, OP_64BIT, sreg, memref); } #endif @@ -2480,22 +2480,22 @@ inline void emit_shrd_m64_r64_cl(x86code *&emitptr, x86_memref memref, UINT8 sre // emit_group3_r8_* //------------------------------------------------- -inline void emit_not_r8(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 2, dreg); } +inline void emit_not_r8(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 2, dreg); } inline void emit_not_m8(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 2, memref); } -inline void emit_neg_r8(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 3, dreg); } +inline void emit_neg_r8(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 3, dreg); } inline void emit_neg_m8(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 3, memref); } -inline void emit_mul_r8(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 4, dreg); } +inline void emit_mul_r8(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 4, dreg); } inline void emit_mul_m8(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 4, memref); } -inline void emit_imul_r8(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 5, dreg); } +inline void emit_imul_r8(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 5, dreg); } inline void emit_imul_m8(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 5, memref); } -inline void emit_div_r8(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 6, dreg); } +inline void emit_div_r8(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 6, dreg); } inline void emit_div_m8(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 6, memref); } -inline void emit_idiv_r8(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 7, dreg); } +inline void emit_idiv_r8(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 7, dreg); } inline void emit_idiv_m8(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 7, memref); } @@ -2503,22 +2503,22 @@ inline void emit_idiv_m8(x86code *&emitptr, x86_memref memref) { emit_op_modrm_m // emit_group3_r16_* //------------------------------------------------- -inline void emit_not_r16(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 2, dreg); } +inline void emit_not_r16(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 2, dreg); } inline void emit_not_m16(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_16BIT, 2, memref); } -inline void emit_neg_r16(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 3, dreg); } +inline void emit_neg_r16(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 3, dreg); } inline void emit_neg_m16(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_16BIT, 3, memref); } -inline void emit_mul_r16(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 4, dreg); } +inline void emit_mul_r16(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 4, dreg); } inline void emit_mul_m16(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_16BIT, 4, memref); } -inline void emit_imul_r16(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 5, dreg); } +inline void emit_imul_r16(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 5, dreg); } inline void emit_imul_m16(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_16BIT, 5, memref); } -inline void emit_div_r16(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 6, dreg); } +inline void emit_div_r16(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 6, dreg); } inline void emit_div_m16(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_16BIT, 6, memref); } -inline void emit_idiv_r16(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 7, dreg); } +inline void emit_idiv_r16(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_16BIT, 7, dreg); } inline void emit_idiv_m16(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_16BIT, 7, memref); } @@ -2526,22 +2526,22 @@ inline void emit_idiv_m16(x86code *&emitptr, x86_memref memref) { emit_op_modrm_ // emit_group3_r32_* //------------------------------------------------- -inline void emit_not_r32(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 2, dreg); } +inline void emit_not_r32(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 2, dreg); } inline void emit_not_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 2, memref); } -inline void emit_neg_r32(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 3, dreg); } +inline void emit_neg_r32(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 3, dreg); } inline void emit_neg_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 3, memref); } -inline void emit_mul_r32(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 4, dreg); } +inline void emit_mul_r32(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 4, dreg); } inline void emit_mul_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 4, memref); } -inline void emit_imul_r32(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 5, dreg); } +inline void emit_imul_r32(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 5, dreg); } inline void emit_imul_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 5, memref); } -inline void emit_div_r32(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 6, dreg); } +inline void emit_div_r32(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 6, dreg); } inline void emit_div_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 6, memref); } -inline void emit_idiv_r32(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 7, dreg); } +inline void emit_idiv_r32(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_32BIT, 7, dreg); } inline void emit_idiv_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_32BIT, 7, memref); } @@ -2551,22 +2551,22 @@ inline void emit_idiv_m32(x86code *&emitptr, x86_memref memref) { emit_op_modrm_ #if (X86EMIT_SIZE == 64) -inline void emit_not_r64(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 2, dreg); } +inline void emit_not_r64(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 2, dreg); } inline void emit_not_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_64BIT, 2, memref); } -inline void emit_neg_r64(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 3, dreg); } +inline void emit_neg_r64(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 3, dreg); } inline void emit_neg_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_64BIT, 3, memref); } -inline void emit_mul_r64(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 4, dreg); } +inline void emit_mul_r64(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 4, dreg); } inline void emit_mul_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_64BIT, 4, memref); } -inline void emit_imul_r64(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 5, dreg); } +inline void emit_imul_r64(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 5, dreg); } inline void emit_imul_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_64BIT, 5, memref); } -inline void emit_div_r64(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 6, dreg); } +inline void emit_div_r64(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 6, dreg); } inline void emit_div_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_64BIT, 6, memref); } -inline void emit_idiv_r64(x86code *&emitptr, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 7, dreg); } +inline void emit_idiv_r64(x86code *&emitptr, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_G3_Ev, OP_64BIT, 7, dreg); } inline void emit_idiv_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_G3_Ev, OP_64BIT, 7, memref); } #endif @@ -2581,22 +2581,22 @@ inline void emit_idiv_m64(x86code *&emitptr, x86_memref memref) { emit_op_modrm_ // emit_imul_r16_* //------------------------------------------------- -inline void emit_imul_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_IMUL_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_imul_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_IMUL_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_imul_r16_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, INT16 imm) { emit_op_modrm_reg_imm816(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_16BIT, dreg, sreg, imm); } -inline void emit_imul_r16_m16_imm(x86code *&emitptr, UINT8 dreg, x86_memref memref, INT16 imm) { emit_op_modrm_mem_imm816(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_16BIT, dreg, memref, imm); } +inline void emit_imul_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_IMUL_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_imul_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_IMUL_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_imul_r16_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, int16_t imm) { emit_op_modrm_reg_imm816(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_16BIT, dreg, sreg, imm); } +inline void emit_imul_r16_m16_imm(x86code *&emitptr, uint8_t dreg, x86_memref memref, int16_t imm) { emit_op_modrm_mem_imm816(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_16BIT, dreg, memref, imm); } -inline void emit_imul_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_IMUL_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_imul_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_IMUL_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_imul_r32_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, INT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_32BIT, dreg, sreg, imm); } -inline void emit_imul_r32_m32_imm(x86code *&emitptr, UINT8 dreg, x86_memref memref, INT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_32BIT, dreg, memref, imm); } +inline void emit_imul_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_IMUL_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_imul_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_IMUL_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_imul_r32_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, int32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_32BIT, dreg, sreg, imm); } +inline void emit_imul_r32_m32_imm(x86code *&emitptr, uint8_t dreg, x86_memref memref, int32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_32BIT, dreg, memref, imm); } #if (X86EMIT_SIZE == 64) -inline void emit_imul_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_IMUL_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_imul_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_IMUL_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_imul_r64_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, INT32 imm) { emit_op_modrm_reg_imm832(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_64BIT, dreg, sreg, imm); } -inline void emit_imul_r64_m64_imm(x86code *&emitptr, UINT8 dreg, x86_memref memref, INT32 imm) { emit_op_modrm_mem_imm832(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_64BIT, dreg, memref, imm); } +inline void emit_imul_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_IMUL_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_imul_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_IMUL_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_imul_r64_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, int32_t imm) { emit_op_modrm_reg_imm832(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_64BIT, dreg, sreg, imm); } +inline void emit_imul_r64_m64_imm(x86code *&emitptr, uint8_t dreg, x86_memref memref, int32_t imm) { emit_op_modrm_mem_imm832(emitptr, OP_IMUL_Gv_Ev_Ib, OP_IMUL_Gv_Ev_Iz, OP_64BIT, dreg, memref, imm); } #endif @@ -2610,29 +2610,29 @@ inline void emit_imul_r64_m64_imm(x86code *&emitptr, UINT8 dreg, x86_memref memr // emit_bswap_* //------------------------------------------------- -inline void emit_bswap_r32(x86code *&emitptr, UINT8 dreg) { emit_op_reg(emitptr, OP_BSWAP_EAX + (dreg & 7), OP_32BIT, dreg); } -inline void emit_bswap_r64(x86code *&emitptr, UINT8 dreg) { emit_op_reg(emitptr, OP_BSWAP_EAX + (dreg & 7), OP_64BIT, dreg); } +inline void emit_bswap_r32(x86code *&emitptr, uint8_t dreg) { emit_op_reg(emitptr, OP_BSWAP_EAX + (dreg & 7), OP_32BIT, dreg); } +inline void emit_bswap_r64(x86code *&emitptr, uint8_t dreg) { emit_op_reg(emitptr, OP_BSWAP_EAX + (dreg & 7), OP_64BIT, dreg); } //------------------------------------------------- // emit_bsr/bsf_r16_* //------------------------------------------------- -inline void emit_bsf_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BSF_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_bsf_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSF_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_bsr_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BSR_Gv_Ev, OP_16BIT, dreg, sreg); } -inline void emit_bsr_r16_m16(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSR_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_bsf_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BSF_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_bsf_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSF_Gv_Ev, OP_16BIT, dreg, memref); } +inline void emit_bsr_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BSR_Gv_Ev, OP_16BIT, dreg, sreg); } +inline void emit_bsr_r16_m16(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSR_Gv_Ev, OP_16BIT, dreg, memref); } -inline void emit_bsf_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BSF_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_bsf_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSF_Gv_Ev, OP_32BIT, dreg, memref); } -inline void emit_bsr_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BSR_Gv_Ev, OP_32BIT, dreg, sreg); } -inline void emit_bsr_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSR_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_bsf_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BSF_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_bsf_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSF_Gv_Ev, OP_32BIT, dreg, memref); } +inline void emit_bsr_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BSR_Gv_Ev, OP_32BIT, dreg, sreg); } +inline void emit_bsr_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSR_Gv_Ev, OP_32BIT, dreg, memref); } #if (X86EMIT_SIZE == 64) -inline void emit_bsf_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BSF_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_bsf_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSF_Gv_Ev, OP_64BIT, dreg, memref); } -inline void emit_bsr_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BSR_Gv_Ev, OP_64BIT, dreg, sreg); } -inline void emit_bsr_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSR_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_bsf_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BSF_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_bsf_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSF_Gv_Ev, OP_64BIT, dreg, memref); } +inline void emit_bsr_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BSR_Gv_Ev, OP_64BIT, dreg, sreg); } +inline void emit_bsr_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_BSR_Gv_Ev, OP_64BIT, dreg, memref); } #endif @@ -2640,50 +2640,50 @@ inline void emit_bsr_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) // emit_bit_r16_* //------------------------------------------------- -inline void emit_bt_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BT_Ev_Gv, OP_16BIT, sreg, dreg); } -inline void emit_bt_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BT_Ev_Gv, OP_16BIT, sreg, memref); } -inline void emit_bt_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 4, dreg, imm); } -inline void emit_bt_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 4, memref, imm); } +inline void emit_bt_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BT_Ev_Gv, OP_16BIT, sreg, dreg); } +inline void emit_bt_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BT_Ev_Gv, OP_16BIT, sreg, memref); } +inline void emit_bt_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 4, dreg, imm); } +inline void emit_bt_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 4, memref, imm); } -inline void emit_bts_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BTS_Ev_Gv, OP_16BIT, sreg, dreg); } -inline void emit_bts_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BTS_Ev_Gv, OP_16BIT, sreg, memref); } -inline void emit_bts_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 5, dreg, imm); } -inline void emit_bts_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 5, memref, imm); } +inline void emit_bts_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BTS_Ev_Gv, OP_16BIT, sreg, dreg); } +inline void emit_bts_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BTS_Ev_Gv, OP_16BIT, sreg, memref); } +inline void emit_bts_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 5, dreg, imm); } +inline void emit_bts_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 5, memref, imm); } -inline void emit_btr_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BTR_Ev_Gv, OP_16BIT, sreg, dreg); } -inline void emit_btr_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BTR_Ev_Gv, OP_16BIT, sreg, memref); } -inline void emit_btr_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 6, dreg, imm); } -inline void emit_btr_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 6, memref, imm); } +inline void emit_btr_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BTR_Ev_Gv, OP_16BIT, sreg, dreg); } +inline void emit_btr_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BTR_Ev_Gv, OP_16BIT, sreg, memref); } +inline void emit_btr_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 6, dreg, imm); } +inline void emit_btr_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 6, memref, imm); } -inline void emit_btc_r16_r16(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BTC_Ev_Gv, OP_16BIT, sreg, dreg); } -inline void emit_btc_m16_r16(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BTC_Ev_Gv, OP_16BIT, sreg, memref); } -inline void emit_btc_r16_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 7, dreg, imm); } -inline void emit_btc_m16_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 7, memref, imm); } +inline void emit_btc_r16_r16(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BTC_Ev_Gv, OP_16BIT, sreg, dreg); } +inline void emit_btc_m16_r16(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BTC_Ev_Gv, OP_16BIT, sreg, memref); } +inline void emit_btc_r16_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 7, dreg, imm); } +inline void emit_btc_m16_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_16BIT, 7, memref, imm); } //------------------------------------------------- // emit_bit_r32_* //------------------------------------------------- -inline void emit_bt_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BT_Ev_Gv, OP_32BIT, sreg, dreg); } -inline void emit_bt_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BT_Ev_Gv, OP_32BIT, sreg, memref); } -inline void emit_bt_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 4, dreg, imm); } -inline void emit_bt_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 4, memref, imm); } +inline void emit_bt_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BT_Ev_Gv, OP_32BIT, sreg, dreg); } +inline void emit_bt_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BT_Ev_Gv, OP_32BIT, sreg, memref); } +inline void emit_bt_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 4, dreg, imm); } +inline void emit_bt_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 4, memref, imm); } -inline void emit_bts_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BTS_Ev_Gv, OP_32BIT, sreg, dreg); } -inline void emit_bts_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BTS_Ev_Gv, OP_32BIT, sreg, memref); } -inline void emit_bts_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 5, dreg, imm); } -inline void emit_bts_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 5, memref, imm); } +inline void emit_bts_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BTS_Ev_Gv, OP_32BIT, sreg, dreg); } +inline void emit_bts_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BTS_Ev_Gv, OP_32BIT, sreg, memref); } +inline void emit_bts_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 5, dreg, imm); } +inline void emit_bts_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 5, memref, imm); } -inline void emit_btr_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BTR_Ev_Gv, OP_32BIT, sreg, dreg); } -inline void emit_btr_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BTR_Ev_Gv, OP_32BIT, sreg, memref); } -inline void emit_btr_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 6, dreg, imm); } -inline void emit_btr_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 6, memref, imm); } +inline void emit_btr_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BTR_Ev_Gv, OP_32BIT, sreg, dreg); } +inline void emit_btr_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BTR_Ev_Gv, OP_32BIT, sreg, memref); } +inline void emit_btr_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 6, dreg, imm); } +inline void emit_btr_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 6, memref, imm); } -inline void emit_btc_r32_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BTC_Ev_Gv, OP_32BIT, sreg, dreg); } -inline void emit_btc_m32_r32(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BTC_Ev_Gv, OP_32BIT, sreg, memref); } -inline void emit_btc_r32_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 7, dreg, imm); } -inline void emit_btc_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 7, memref, imm); } +inline void emit_btc_r32_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BTC_Ev_Gv, OP_32BIT, sreg, dreg); } +inline void emit_btc_m32_r32(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BTC_Ev_Gv, OP_32BIT, sreg, memref); } +inline void emit_btc_r32_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 7, dreg, imm); } +inline void emit_btc_m32_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_32BIT, 7, memref, imm); } //------------------------------------------------- @@ -2692,25 +2692,25 @@ inline void emit_btc_m32_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { #if (X86EMIT_SIZE == 64) -inline void emit_bt_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BT_Ev_Gv, OP_64BIT, sreg, dreg); } -inline void emit_bt_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BT_Ev_Gv, OP_64BIT, sreg, memref); } -inline void emit_bt_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 4, dreg, imm); } -inline void emit_bt_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 4, memref, imm); } +inline void emit_bt_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BT_Ev_Gv, OP_64BIT, sreg, dreg); } +inline void emit_bt_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BT_Ev_Gv, OP_64BIT, sreg, memref); } +inline void emit_bt_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 4, dreg, imm); } +inline void emit_bt_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 4, memref, imm); } -inline void emit_bts_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BTS_Ev_Gv, OP_64BIT, sreg, dreg); } -inline void emit_bts_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BTS_Ev_Gv, OP_64BIT, sreg, memref); } -inline void emit_bts_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 5, dreg, imm); } -inline void emit_bts_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 5, memref, imm); } +inline void emit_bts_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BTS_Ev_Gv, OP_64BIT, sreg, dreg); } +inline void emit_bts_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BTS_Ev_Gv, OP_64BIT, sreg, memref); } +inline void emit_bts_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 5, dreg, imm); } +inline void emit_bts_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 5, memref, imm); } -inline void emit_btr_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BTR_Ev_Gv, OP_64BIT, sreg, dreg); } -inline void emit_btr_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BTR_Ev_Gv, OP_64BIT, sreg, memref); } -inline void emit_btr_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 6, dreg, imm); } -inline void emit_btr_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 6, memref, imm); } +inline void emit_btr_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BTR_Ev_Gv, OP_64BIT, sreg, dreg); } +inline void emit_btr_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BTR_Ev_Gv, OP_64BIT, sreg, memref); } +inline void emit_btr_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 6, dreg, imm); } +inline void emit_btr_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 6, memref, imm); } -inline void emit_btc_r64_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_BTC_Ev_Gv, OP_64BIT, sreg, dreg); } -inline void emit_btc_m64_r64(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_BTC_Ev_Gv, OP_64BIT, sreg, memref); } -inline void emit_btc_r64_imm(x86code *&emitptr, UINT8 dreg, UINT8 imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 7, dreg, imm); } -inline void emit_btc_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 7, memref, imm); } +inline void emit_btc_r64_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_BTC_Ev_Gv, OP_64BIT, sreg, dreg); } +inline void emit_btc_m64_r64(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_BTC_Ev_Gv, OP_64BIT, sreg, memref); } +inline void emit_btc_r64_imm(x86code *&emitptr, uint8_t dreg, uint8_t imm) { emit_op_modrm_reg_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 7, dreg, imm); } +inline void emit_btc_m64_imm(x86code *&emitptr, x86_memref memref, uint8_t imm) { emit_op_modrm_mem_imm8(emitptr, OP_G8_Ev_Ib, OP_64BIT, 7, memref, imm); } #endif @@ -2720,10 +2720,10 @@ inline void emit_btc_m64_imm(x86code *&emitptr, x86_memref memref, UINT8 imm) { // LEA EMITTERS //************************************************************************** -inline void emit_lea_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_LEA_Gv_M, OP_32BIT, dreg, memref); } +inline void emit_lea_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_LEA_Gv_M, OP_32BIT, dreg, memref); } #if (X86EMIT_SIZE == 64) -inline void emit_lea_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_LEA_Gv_M, OP_64BIT, dreg, memref); } +inline void emit_lea_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_LEA_Gv_M, OP_64BIT, dreg, memref); } #endif @@ -2736,8 +2736,8 @@ inline void emit_lea_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) // emit_setcc_* //------------------------------------------------- -inline void emit_setcc_r8(x86code *&emitptr, UINT8 cond, UINT8 dreg) { emit_op_modrm_reg(emitptr, OP_SETCC_O_Eb + cond, OP_32BIT, 0, dreg); } -inline void emit_setcc_m8(x86code *&emitptr, UINT8 cond, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SETCC_O_Eb + cond, OP_32BIT, 0, memref); } +inline void emit_setcc_r8(x86code *&emitptr, uint8_t cond, uint8_t dreg) { emit_op_modrm_reg(emitptr, OP_SETCC_O_Eb + cond, OP_32BIT, 0, dreg); } +inline void emit_setcc_m8(x86code *&emitptr, uint8_t cond, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SETCC_O_Eb + cond, OP_32BIT, 0, memref); } @@ -2791,46 +2791,46 @@ inline void emit_fstsw_ax(x86code *&emitptr) { emit_op_simple(emitptr, OP_FSTSW_ #if (X86EMIT_SIZE == 32) -inline void emit_ffree_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FFREE_STn + reg, OP_32BIT); } -inline void emit_fst_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FST_STn + reg, OP_32BIT); } -inline void emit_fstp_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FSTP_STn + reg, OP_32BIT); } -inline void emit_fucomp_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FUCOMP_STn + reg, OP_32BIT); } - -inline void emit_fadd_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FADD_ST0_STn + reg, OP_32BIT); } -inline void emit_fmul_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FMUL_ST0_STn + reg, OP_32BIT); } -inline void emit_fcom_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCOM_ST0_STn + reg, OP_32BIT); } -inline void emit_fcomp_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCOMP_ST0_STn + reg, OP_32BIT); } -inline void emit_fsub_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FSUB_ST0_STn + reg, OP_32BIT); } -inline void emit_fsubr_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FSUBR_ST0_STn + reg, OP_32BIT); } -inline void emit_fdiv_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FDIV_ST0_STn + reg, OP_32BIT); } -inline void emit_fdivr_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FDIVR_ST0_STn + reg, OP_32BIT); } -inline void emit_fld_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FLD_ST0_STn + reg, OP_32BIT); } -inline void emit_fxch_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FXCH_ST0_STn + reg, OP_32BIT); } -inline void emit_fcmovb_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCMOVB_ST0_STn + reg, OP_32BIT); } -inline void emit_fcmove_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCMOVE_ST0_STn + reg, OP_32BIT); } -inline void emit_fcmovbe_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCMOVBE_ST0_STn + reg, OP_32BIT); } -inline void emit_fcmovu_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCMOVU_ST0_STn + reg, OP_32BIT); } -inline void emit_fcmovnb_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCMOVNB_ST0_STn + reg, OP_32BIT); } -inline void emit_fcmovne_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCMOVNE_ST0_STn + reg, OP_32BIT); } -inline void emit_fcmovnbe_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCMOVNBE_ST0_STn + reg, OP_32BIT); } -inline void emit_fcmovnu_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCMOVNU_ST0_STn + reg, OP_32BIT); } -inline void emit_fucomi_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FUCOMI_ST0_STn + reg, OP_32BIT); } -inline void emit_fcomi_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCOMI_ST0_STn + reg, OP_32BIT); } -inline void emit_fcomip_st0_stn(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FCOMIP_ST0_STn + reg, OP_32BIT); } - -inline void emit_fadd_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FADD_STn_ST0 + reg, OP_32BIT); } -inline void emit_fmul_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FMUL_STn_ST0 + reg, OP_32BIT); } -inline void emit_fsubr_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FSUBR_STn_ST0 + reg, OP_32BIT); } -inline void emit_fsub_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FSUB_STn_ST0 + reg, OP_32BIT); } -inline void emit_fdivr_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FDIVR_STn_ST0 + reg, OP_32BIT); } -inline void emit_fdiv_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FDIV_STn_ST0 + reg, OP_32BIT); } -inline void emit_fucom_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FUCOM_STn_ST0 + reg, OP_32BIT); } -inline void emit_faddp_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FADDP_STn_ST0 + reg, OP_32BIT); } -inline void emit_fmulp_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FMULP_STn_ST0 + reg, OP_32BIT); } -inline void emit_fsubrp_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FSUBRP_STn_ST0 + reg, OP_32BIT); } -inline void emit_fsubp_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FSUBP_STn_ST0 + reg, OP_32BIT); } -inline void emit_fdivrp_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FDIVRP_STn_ST0 + reg, OP_32BIT); } -inline void emit_fdivp_stn_st0(x86code *&emitptr, UINT8 reg) { emit_op_simple(emitptr, OP_FDIVP_STn_ST0 + reg, OP_32BIT); } +inline void emit_ffree_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FFREE_STn + reg, OP_32BIT); } +inline void emit_fst_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FST_STn + reg, OP_32BIT); } +inline void emit_fstp_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FSTP_STn + reg, OP_32BIT); } +inline void emit_fucomp_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FUCOMP_STn + reg, OP_32BIT); } + +inline void emit_fadd_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FADD_ST0_STn + reg, OP_32BIT); } +inline void emit_fmul_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FMUL_ST0_STn + reg, OP_32BIT); } +inline void emit_fcom_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCOM_ST0_STn + reg, OP_32BIT); } +inline void emit_fcomp_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCOMP_ST0_STn + reg, OP_32BIT); } +inline void emit_fsub_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FSUB_ST0_STn + reg, OP_32BIT); } +inline void emit_fsubr_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FSUBR_ST0_STn + reg, OP_32BIT); } +inline void emit_fdiv_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FDIV_ST0_STn + reg, OP_32BIT); } +inline void emit_fdivr_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FDIVR_ST0_STn + reg, OP_32BIT); } +inline void emit_fld_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FLD_ST0_STn + reg, OP_32BIT); } +inline void emit_fxch_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FXCH_ST0_STn + reg, OP_32BIT); } +inline void emit_fcmovb_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCMOVB_ST0_STn + reg, OP_32BIT); } +inline void emit_fcmove_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCMOVE_ST0_STn + reg, OP_32BIT); } +inline void emit_fcmovbe_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCMOVBE_ST0_STn + reg, OP_32BIT); } +inline void emit_fcmovu_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCMOVU_ST0_STn + reg, OP_32BIT); } +inline void emit_fcmovnb_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCMOVNB_ST0_STn + reg, OP_32BIT); } +inline void emit_fcmovne_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCMOVNE_ST0_STn + reg, OP_32BIT); } +inline void emit_fcmovnbe_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCMOVNBE_ST0_STn + reg, OP_32BIT); } +inline void emit_fcmovnu_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCMOVNU_ST0_STn + reg, OP_32BIT); } +inline void emit_fucomi_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FUCOMI_ST0_STn + reg, OP_32BIT); } +inline void emit_fcomi_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCOMI_ST0_STn + reg, OP_32BIT); } +inline void emit_fcomip_st0_stn(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FCOMIP_ST0_STn + reg, OP_32BIT); } + +inline void emit_fadd_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FADD_STn_ST0 + reg, OP_32BIT); } +inline void emit_fmul_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FMUL_STn_ST0 + reg, OP_32BIT); } +inline void emit_fsubr_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FSUBR_STn_ST0 + reg, OP_32BIT); } +inline void emit_fsub_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FSUB_STn_ST0 + reg, OP_32BIT); } +inline void emit_fdivr_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FDIVR_STn_ST0 + reg, OP_32BIT); } +inline void emit_fdiv_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FDIV_STn_ST0 + reg, OP_32BIT); } +inline void emit_fucom_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FUCOM_STn_ST0 + reg, OP_32BIT); } +inline void emit_faddp_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FADDP_STn_ST0 + reg, OP_32BIT); } +inline void emit_fmulp_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FMULP_STn_ST0 + reg, OP_32BIT); } +inline void emit_fsubrp_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FSUBRP_STn_ST0 + reg, OP_32BIT); } +inline void emit_fsubp_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FSUBP_STn_ST0 + reg, OP_32BIT); } +inline void emit_fdivrp_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FDIVRP_STn_ST0 + reg, OP_32BIT); } +inline void emit_fdivp_stn_st0(x86code *&emitptr, uint8_t reg) { emit_op_simple(emitptr, OP_FDIVP_STn_ST0 + reg, OP_32BIT); } inline void emit_faddp(x86code *&emitptr) { emit_faddp_stn_st0(emitptr, 1); } inline void emit_fmulp(x86code *&emitptr) { emit_fmulp_stn_st0(emitptr, 1); } @@ -2934,90 +2934,90 @@ inline void emit_stmxcsr_m32(x86code *&emitptr, x86_memref memref) { emit_op_mo // MISC SSE EMITTERS //************************************************************************** -inline void emit_movd_r128_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Vd_Ed, OP_32BIT, dreg, sreg); } -inline void emit_movd_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVD_Vd_Ed, OP_32BIT, dreg, memref); } -inline void emit_movd_r32_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Ed_Vd, OP_32BIT, sreg, dreg); } -inline void emit_movd_m32_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOVD_Ed_Vd, OP_32BIT, sreg, memref); } +inline void emit_movd_r128_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Vd_Ed, OP_32BIT, dreg, sreg); } +inline void emit_movd_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVD_Vd_Ed, OP_32BIT, dreg, memref); } +inline void emit_movd_r32_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Ed_Vd, OP_32BIT, sreg, dreg); } +inline void emit_movd_m32_r128(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOVD_Ed_Vd, OP_32BIT, sreg, memref); } #if (X86EMIT_SIZE == 64) -inline void emit_movq_r128_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Vd_Ed, OP_64BIT, dreg, sreg); } -inline void emit_movq_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVD_Vd_Ed, OP_64BIT, dreg, memref); } -inline void emit_movq_r64_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Ed_Vd, OP_64BIT, sreg, dreg); } -inline void emit_movq_m64_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOVD_Ed_Vd, OP_64BIT, sreg, memref); } +inline void emit_movq_r128_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Vd_Ed, OP_64BIT, dreg, sreg); } +inline void emit_movq_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVD_Vd_Ed, OP_64BIT, dreg, memref); } +inline void emit_movq_r64_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVD_Ed_Vd, OP_64BIT, sreg, dreg); } +inline void emit_movq_m64_r128(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOVD_Ed_Vd, OP_64BIT, sreg, memref); } #endif -inline void emit_movdqa_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVDQA_Vdq_Wdq, OP_32BIT, dreg, memref); } -inline void emit_movdqa_m128_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOVDQA_Wdq_Vdq, OP_32BIT, sreg, memref); } -inline void emit_movdqu_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVDQU_Vdq_Wdq, OP_32BIT, dreg, memref); } -inline void emit_movdqu_m128_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOVDQU_Wdq_Vdq, OP_32BIT, sreg, memref); } +inline void emit_movdqa_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVDQA_Vdq_Wdq, OP_32BIT, dreg, memref); } +inline void emit_movdqa_m128_r128(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOVDQA_Wdq_Vdq, OP_32BIT, sreg, memref); } +inline void emit_movdqu_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVDQU_Vdq_Wdq, OP_32BIT, dreg, memref); } +inline void emit_movdqu_m128_r128(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOVDQU_Wdq_Vdq, OP_32BIT, sreg, memref); } //************************************************************************** // SSE SCALAR SINGLE EMITTERS //************************************************************************** -inline void emit_movss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVSS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_movss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_movss_m32_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOVSS_Wss_Vss, OP_32BIT, sreg, memref); } +inline void emit_movss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVSS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_movss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_movss_m32_r128(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOVSS_Wss_Vss, OP_32BIT, sreg, memref); } -inline void emit_addss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADDSS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_addss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADDSS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_addss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADDSS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_addss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADDSS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_subss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SUBSS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_subss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUBSS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_subss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SUBSS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_subss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUBSS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_mulss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MULSS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_mulss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MULSS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_mulss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MULSS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_mulss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MULSS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_divss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_DIVSS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_divss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_DIVSS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_divss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_DIVSS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_divss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_DIVSS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_rcpss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_RCPSS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_rcpss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_RCPSS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_rcpss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_RCPSS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_rcpss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_RCPSS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_sqrtss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SQRTSS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_sqrtss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SQRTSS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_sqrtss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SQRTSS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_sqrtss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SQRTSS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_rsqrtss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_RSQRTSS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_rsqrtss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_RSQRTSS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_rsqrtss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_RSQRTSS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_rsqrtss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_RSQRTSS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_comiss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_COMISS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_comiss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_COMISS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_comiss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_COMISS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_comiss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_COMISS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_ucomiss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_UCOMISS_Vss_Wss, OP_32BIT, dreg, sreg); } -inline void emit_ucomiss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_UCOMISS_Vss_Wss, OP_32BIT, dreg, memref); } +inline void emit_ucomiss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_UCOMISS_Vss_Wss, OP_32BIT, dreg, sreg); } +inline void emit_ucomiss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_UCOMISS_Vss_Wss, OP_32BIT, dreg, memref); } -inline void emit_cvtsi2ss_r128_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSI2SS_Vss_Ed, OP_32BIT, dreg, sreg); } -inline void emit_cvtsi2ss_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSI2SS_Vss_Ed, OP_32BIT, dreg, memref); } +inline void emit_cvtsi2ss_r128_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSI2SS_Vss_Ed, OP_32BIT, dreg, sreg); } +inline void emit_cvtsi2ss_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSI2SS_Vss_Ed, OP_32BIT, dreg, memref); } #if (X86EMIT_SIZE == 64) -inline void emit_cvtsi2ss_r128_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSI2SS_Vss_Ed, OP_64BIT, dreg, sreg); } -inline void emit_cvtsi2ss_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSI2SS_Vss_Ed, OP_64BIT, dreg, memref); } +inline void emit_cvtsi2ss_r128_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSI2SS_Vss_Ed, OP_64BIT, dreg, sreg); } +inline void emit_cvtsi2ss_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSI2SS_Vss_Ed, OP_64BIT, dreg, memref); } #endif -inline void emit_cvtsd2ss_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSD2SS_Vss_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_cvtsd2ss_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSD2SS_Vss_Wsd, OP_32BIT, dreg, memref); } +inline void emit_cvtsd2ss_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSD2SS_Vss_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_cvtsd2ss_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSD2SS_Vss_Wsd, OP_32BIT, dreg, memref); } -inline void emit_cvtss2si_r32_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSS2SI_Gd_Wss, OP_32BIT, dreg, sreg); } -inline void emit_cvtss2si_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSS2SI_Gd_Wss, OP_32BIT, dreg, memref); } +inline void emit_cvtss2si_r32_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSS2SI_Gd_Wss, OP_32BIT, dreg, sreg); } +inline void emit_cvtss2si_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSS2SI_Gd_Wss, OP_32BIT, dreg, memref); } #if (X86EMIT_SIZE == 64) -inline void emit_cvtss2si_r64_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSS2SI_Gd_Wss, OP_64BIT, dreg, sreg); } -inline void emit_cvtss2si_r64_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSS2SI_Gd_Wss, OP_64BIT, dreg, memref); } +inline void emit_cvtss2si_r64_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSS2SI_Gd_Wss, OP_64BIT, dreg, sreg); } +inline void emit_cvtss2si_r64_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSS2SI_Gd_Wss, OP_64BIT, dreg, memref); } #endif -inline void emit_cvttss2si_r32_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTTSS2SI_Gd_Wss, OP_32BIT, dreg, sreg); } -inline void emit_cvttss2si_r32_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTSS2SI_Gd_Wss, OP_32BIT, dreg, memref); } +inline void emit_cvttss2si_r32_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTTSS2SI_Gd_Wss, OP_32BIT, dreg, sreg); } +inline void emit_cvttss2si_r32_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTSS2SI_Gd_Wss, OP_32BIT, dreg, memref); } #if (X86EMIT_SIZE == 64) -inline void emit_cvttss2si_r64_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTTSS2SI_Gd_Wss, OP_64BIT, dreg, sreg); } -inline void emit_cvttss2si_r64_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTSS2SI_Gd_Wss, OP_64BIT, dreg, memref); } +inline void emit_cvttss2si_r64_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTTSS2SI_Gd_Wss, OP_64BIT, dreg, sreg); } +inline void emit_cvttss2si_r64_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTSS2SI_Gd_Wss, OP_64BIT, dreg, memref); } #endif -inline void emit_roundss_r128_r128_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, UINT8 imm) { emit_op_modrm_reg(emitptr, OP_ROUNDSS_Vss_Wss_Ib, OP_32BIT, dreg, sreg); emit_byte(emitptr, imm); } -inline void emit_roundss_r128_m32_imm(x86code *&emitptr, UINT8 dreg, x86_memref memref, UINT8 imm) { emit_op_modrm_mem(emitptr, OP_ROUNDSS_Vss_Wss_Ib, OP_32BIT, dreg, memref); emit_byte(emitptr, imm); } +inline void emit_roundss_r128_r128_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, uint8_t imm) { emit_op_modrm_reg(emitptr, OP_ROUNDSS_Vss_Wss_Ib, OP_32BIT, dreg, sreg); emit_byte(emitptr, imm); } +inline void emit_roundss_r128_m32_imm(x86code *&emitptr, uint8_t dreg, x86_memref memref, uint8_t imm) { emit_op_modrm_mem(emitptr, OP_ROUNDSS_Vss_Wss_Ib, OP_32BIT, dreg, memref); emit_byte(emitptr, imm); } @@ -3025,57 +3025,57 @@ inline void emit_roundss_r128_m32_imm(x86code *&emitptr, UINT8 dreg, x86_memref // SSE PACKED SINGLE EMITTERS //************************************************************************** -inline void emit_movps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVAPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_movps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVAPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_movps_m128_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOVAPS_Wps_Vps, OP_32BIT, sreg, memref); } +inline void emit_movps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVAPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_movps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVAPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_movps_m128_r128(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOVAPS_Wps_Vps, OP_32BIT, sreg, memref); } -inline void emit_addps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADDPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_addps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADDPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_addps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADDPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_addps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADDPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_subps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SUBPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_subps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUBPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_subps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SUBPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_subps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUBPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_mulps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MULPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_mulps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MULPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_mulps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MULPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_mulps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MULPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_divps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_DIVPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_divps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_DIVPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_divps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_DIVPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_divps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_DIVPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_rcpps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_RCPPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_rcpps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_RCPPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_rcpps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_RCPPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_rcpps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_RCPPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_sqrtps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SQRTPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_sqrtps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SQRTPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_sqrtps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SQRTPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_sqrtps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SQRTPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_rsqrtps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_RSQRTPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_rsqrtps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_RSQRTPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_rsqrtps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_RSQRTPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_rsqrtps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_RSQRTPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_andps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ANDPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_andps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ANDPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_andps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ANDPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_andps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ANDPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_andnps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ANDNPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_andnps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ANDNPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_andnps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ANDNPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_andnps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ANDNPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_orps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ORPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_orps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ORPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_orps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ORPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_orps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ORPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_xorps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_XORPS_Vps_Wps, OP_32BIT, dreg, sreg); } -inline void emit_xorps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XORPS_Vps_Wps, OP_32BIT, dreg, memref); } +inline void emit_xorps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_XORPS_Vps_Wps, OP_32BIT, dreg, sreg); } +inline void emit_xorps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XORPS_Vps_Wps, OP_32BIT, dreg, memref); } -inline void emit_cvtdq2ps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTDQ2PS_Vps_Wdq, OP_32BIT, dreg, sreg); } -inline void emit_cvtdq2ps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTDQ2PS_Vps_Wdq, OP_32BIT, dreg, memref); } +inline void emit_cvtdq2ps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTDQ2PS_Vps_Wdq, OP_32BIT, dreg, sreg); } +inline void emit_cvtdq2ps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTDQ2PS_Vps_Wdq, OP_32BIT, dreg, memref); } -inline void emit_cvtpd2ps_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTPD2PS_Vps_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_cvtpd2ps_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTPD2PS_Vps_Wpd, OP_32BIT, dreg, memref); } +inline void emit_cvtpd2ps_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTPD2PS_Vps_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_cvtpd2ps_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTPD2PS_Vps_Wpd, OP_32BIT, dreg, memref); } -inline void emit_cvtps2dq_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTPS2DQ_Vdq_Wps, OP_32BIT, dreg, sreg); } -inline void emit_cvtps2dq_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTPS2DQ_Vdq_Wps, OP_32BIT, dreg, memref); } +inline void emit_cvtps2dq_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTPS2DQ_Vdq_Wps, OP_32BIT, dreg, sreg); } +inline void emit_cvtps2dq_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTPS2DQ_Vdq_Wps, OP_32BIT, dreg, memref); } -inline void emit_cvttps2dq_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTTPS2DQ_Vdq_Wps, OP_32BIT, dreg, sreg); } -inline void emit_cvttps2dq_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTPS2DQ_Vdq_Wps, OP_32BIT, dreg, memref); } +inline void emit_cvttps2dq_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTTPS2DQ_Vdq_Wps, OP_32BIT, dreg, sreg); } +inline void emit_cvttps2dq_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTPS2DQ_Vdq_Wps, OP_32BIT, dreg, memref); } -inline void emit_roundps_r128_r128_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, UINT8 imm) { emit_op_modrm_reg(emitptr, OP_ROUNDPS_Vdq_Wdq_Ib, OP_32BIT, dreg, sreg); emit_byte(emitptr, imm); } -inline void emit_roundps_r128_m128_imm(x86code *&emitptr, UINT8 dreg, x86_memref memref, UINT8 imm) { emit_op_modrm_mem(emitptr, OP_ROUNDPS_Vdq_Wdq_Ib, OP_32BIT, dreg, memref); emit_byte(emitptr, imm); } +inline void emit_roundps_r128_r128_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, uint8_t imm) { emit_op_modrm_reg(emitptr, OP_ROUNDPS_Vdq_Wdq_Ib, OP_32BIT, dreg, sreg); emit_byte(emitptr, imm); } +inline void emit_roundps_r128_m128_imm(x86code *&emitptr, uint8_t dreg, x86_memref memref, uint8_t imm) { emit_op_modrm_mem(emitptr, OP_ROUNDPS_Vdq_Wdq_Ib, OP_32BIT, dreg, memref); emit_byte(emitptr, imm); } @@ -3083,60 +3083,60 @@ inline void emit_roundps_r128_m128_imm(x86code *&emitptr, UINT8 dreg, x86_memref // SSE SCALAR DOUBLE EMITTERS //************************************************************************** -inline void emit_movsd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_movsd_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSD_Vsd_Wsd, OP_32BIT, dreg, memref); } -inline void emit_movsd_m64_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOVSD_Wsd_Vsd, OP_32BIT, sreg, memref); } +inline void emit_movsd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_movsd_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVSD_Vsd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_movsd_m64_r128(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOVSD_Wsd_Vsd, OP_32BIT, sreg, memref); } -inline void emit_addsd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADDSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_addsd_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADDSD_Vsd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_addsd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADDSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_addsd_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADDSD_Vsd_Wsd, OP_32BIT, dreg, memref); } -inline void emit_subsd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SUBSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_subsd_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUBSD_Vsd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_subsd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SUBSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_subsd_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUBSD_Vsd_Wsd, OP_32BIT, dreg, memref); } -inline void emit_mulsd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MULSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_mulsd_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MULSD_Vsd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_mulsd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MULSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_mulsd_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MULSD_Vsd_Wsd, OP_32BIT, dreg, memref); } -inline void emit_divsd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_DIVSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_divsd_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_DIVSD_Vsd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_divsd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_DIVSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_divsd_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_DIVSD_Vsd_Wsd, OP_32BIT, dreg, memref); } -inline void emit_sqrtsd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SQRTSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_sqrtsd_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SQRTSD_Vsd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_sqrtsd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SQRTSD_Vsd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_sqrtsd_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SQRTSD_Vsd_Wsd, OP_32BIT, dreg, memref); } -inline void emit_comisd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_COMISD_Vsd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_comisd_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_COMISD_Vsd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_comisd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_COMISD_Vsd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_comisd_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_COMISD_Vsd_Wsd, OP_32BIT, dreg, memref); } -inline void emit_ucomisd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_UCOMISD_Vsd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_ucomisd_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_UCOMISD_Vsd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_ucomisd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_UCOMISD_Vsd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_ucomisd_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_UCOMISD_Vsd_Wsd, OP_32BIT, dreg, memref); } -inline void emit_cvtsi2sd_r128_r32(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSI2SD_Vsd_Ed, OP_32BIT, dreg, sreg); } -inline void emit_cvtsi2sd_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSI2SD_Vsd_Ed, OP_32BIT, dreg, memref); } +inline void emit_cvtsi2sd_r128_r32(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSI2SD_Vsd_Ed, OP_32BIT, dreg, sreg); } +inline void emit_cvtsi2sd_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSI2SD_Vsd_Ed, OP_32BIT, dreg, memref); } #if (X86EMIT_SIZE == 64) -inline void emit_cvtsi2sd_r128_r64(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSI2SD_Vsd_Ed, OP_64BIT, dreg, sreg); } -inline void emit_cvtsi2sd_r128_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSI2SD_Vsd_Ed, OP_64BIT, dreg, memref); } +inline void emit_cvtsi2sd_r128_r64(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSI2SD_Vsd_Ed, OP_64BIT, dreg, sreg); } +inline void emit_cvtsi2sd_r128_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSI2SD_Vsd_Ed, OP_64BIT, dreg, memref); } #endif -inline void emit_cvtss2sd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSS2SD_Vsd_Wss, OP_32BIT, dreg, sreg); } -inline void emit_cvtss2sd_r128_m32(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSS2SD_Vsd_Wss, OP_32BIT, dreg, memref); } +inline void emit_cvtss2sd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSS2SD_Vsd_Wss, OP_32BIT, dreg, sreg); } +inline void emit_cvtss2sd_r128_m32(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSS2SD_Vsd_Wss, OP_32BIT, dreg, memref); } -inline void emit_cvtsd2si_r32_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSD2SI_Gd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_cvtsd2si_r32_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSD2SI_Gd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_cvtsd2si_r32_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSD2SI_Gd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_cvtsd2si_r32_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSD2SI_Gd_Wsd, OP_32BIT, dreg, memref); } #if (X86EMIT_SIZE == 64) -inline void emit_cvtsd2si_r64_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTSD2SI_Gd_Wsd, OP_64BIT, dreg, sreg); } -inline void emit_cvtsd2si_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSD2SI_Gd_Wsd, OP_64BIT, dreg, memref); } +inline void emit_cvtsd2si_r64_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTSD2SI_Gd_Wsd, OP_64BIT, dreg, sreg); } +inline void emit_cvtsd2si_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTSD2SI_Gd_Wsd, OP_64BIT, dreg, memref); } #endif -inline void emit_cvttsd2si_r32_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTTSD2SI_Gd_Wsd, OP_32BIT, dreg, sreg); } -inline void emit_cvttsd2si_r32_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTSD2SI_Gd_Wsd, OP_32BIT, dreg, memref); } +inline void emit_cvttsd2si_r32_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTTSD2SI_Gd_Wsd, OP_32BIT, dreg, sreg); } +inline void emit_cvttsd2si_r32_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTSD2SI_Gd_Wsd, OP_32BIT, dreg, memref); } #if (X86EMIT_SIZE == 64) -inline void emit_cvttsd2si_r64_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTTSD2SI_Gd_Wsd, OP_64BIT, dreg, sreg); } -inline void emit_cvttsd2si_r64_m64(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTSD2SI_Gd_Wsd, OP_64BIT, dreg, memref); } +inline void emit_cvttsd2si_r64_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTTSD2SI_Gd_Wsd, OP_64BIT, dreg, sreg); } +inline void emit_cvttsd2si_r64_m64(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTSD2SI_Gd_Wsd, OP_64BIT, dreg, memref); } #endif -inline void emit_roundsd_r128_r128_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, UINT8 imm) { emit_op_modrm_reg(emitptr, OP_ROUNDSD_Vsd_Wsd_Ib, OP_32BIT, dreg, sreg); emit_byte(emitptr, imm); } -inline void emit_roundsd_r128_m64_imm(x86code *&emitptr, UINT8 dreg, x86_memref memref, UINT8 imm) { emit_op_modrm_mem(emitptr, OP_ROUNDSD_Vsd_Wsd_Ib, OP_32BIT, dreg, memref); emit_byte(emitptr, imm); } +inline void emit_roundsd_r128_r128_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, uint8_t imm) { emit_op_modrm_reg(emitptr, OP_ROUNDSD_Vsd_Wsd_Ib, OP_32BIT, dreg, sreg); emit_byte(emitptr, imm); } +inline void emit_roundsd_r128_m64_imm(x86code *&emitptr, uint8_t dreg, x86_memref memref, uint8_t imm) { emit_op_modrm_mem(emitptr, OP_ROUNDSD_Vsd_Wsd_Ib, OP_32BIT, dreg, memref); emit_byte(emitptr, imm); } @@ -3144,51 +3144,51 @@ inline void emit_roundsd_r128_m64_imm(x86code *&emitptr, UINT8 dreg, x86_memref // SSE PACKED DOUBLE EMITTERS //************************************************************************** -inline void emit_movpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MOVAPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_movpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVAPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_movpd_m128_r128(x86code *&emitptr, x86_memref memref, UINT8 sreg) { emit_op_modrm_mem(emitptr, OP_MOVAPD_Wpd_Vpd, OP_32BIT, sreg, memref); } +inline void emit_movpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MOVAPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_movpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MOVAPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_movpd_m128_r128(x86code *&emitptr, x86_memref memref, uint8_t sreg) { emit_op_modrm_mem(emitptr, OP_MOVAPD_Wpd_Vpd, OP_32BIT, sreg, memref); } -inline void emit_addpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ADDPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_addpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADDPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_addpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ADDPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_addpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ADDPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_subpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SUBPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_subpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUBPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_subpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SUBPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_subpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SUBPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_mulpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_MULPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_mulpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MULPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_mulpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_MULPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_mulpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_MULPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_divpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_DIVPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_divpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_DIVPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_divpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_DIVPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_divpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_DIVPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_sqrtpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_SQRTPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_sqrtpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SQRTPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_sqrtpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_SQRTPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_sqrtpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_SQRTPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_andpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ANDPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_andpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ANDPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_andpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ANDPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_andpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ANDPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_andnpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ANDNPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_andnpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ANDNPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_andnpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ANDNPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_andnpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ANDNPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_orpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_ORPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_orpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ORPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_orpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_ORPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_orpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_ORPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_xorpd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_XORPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_xorpd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XORPD_Vpd_Wpd, OP_32BIT, dreg, memref); } +inline void emit_xorpd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_XORPD_Vpd_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_xorpd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_XORPD_Vpd_Wpd, OP_32BIT, dreg, memref); } -inline void emit_cvtdq2pd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTDQ2PD_Vpd_Wq, OP_32BIT, dreg, sreg); } -inline void emit_cvtdq2pd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTDQ2PD_Vpd_Wq, OP_32BIT, dreg, memref); } +inline void emit_cvtdq2pd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTDQ2PD_Vpd_Wq, OP_32BIT, dreg, sreg); } +inline void emit_cvtdq2pd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTDQ2PD_Vpd_Wq, OP_32BIT, dreg, memref); } -inline void emit_cvtps2pd_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTPS2PD_Vpd_Wq, OP_32BIT, dreg, sreg); } -inline void emit_cvtps2pd_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTPS2PD_Vpd_Wq, OP_32BIT, dreg, memref); } +inline void emit_cvtps2pd_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTPS2PD_Vpd_Wq, OP_32BIT, dreg, sreg); } +inline void emit_cvtps2pd_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTPS2PD_Vpd_Wq, OP_32BIT, dreg, memref); } -inline void emit_cvtpd2dq_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTPD2DQ_Vdq_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_cvtpd2dq_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTPD2DQ_Vdq_Wpd, OP_32BIT, dreg, memref); } +inline void emit_cvtpd2dq_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTPD2DQ_Vdq_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_cvtpd2dq_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTPD2DQ_Vdq_Wpd, OP_32BIT, dreg, memref); } -inline void emit_cvttpd2dq_r128_r128(x86code *&emitptr, UINT8 dreg, UINT8 sreg) { emit_op_modrm_reg(emitptr, OP_CVTTPD2DQ_Vdq_Wpd, OP_32BIT, dreg, sreg); } -inline void emit_cvttpd2dq_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTPD2DQ_Vdq_Wpd, OP_32BIT, dreg, memref); } +inline void emit_cvttpd2dq_r128_r128(x86code *&emitptr, uint8_t dreg, uint8_t sreg) { emit_op_modrm_reg(emitptr, OP_CVTTPD2DQ_Vdq_Wpd, OP_32BIT, dreg, sreg); } +inline void emit_cvttpd2dq_r128_m128(x86code *&emitptr, uint8_t dreg, x86_memref memref) { emit_op_modrm_mem(emitptr, OP_CVTTPD2DQ_Vdq_Wpd, OP_32BIT, dreg, memref); } -inline void emit_roundpd_r128_r128_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, UINT8 imm) { emit_op_modrm_reg(emitptr, OP_ROUNDPD_Vdq_Wdq_Ib, OP_32BIT, dreg, sreg); emit_byte(emitptr, imm); } -inline void emit_roundpd_r128_m128_imm(x86code *&emitptr, UINT8 dreg, x86_memref memref, UINT8 imm) { emit_op_modrm_mem(emitptr, OP_ROUNDPD_Vdq_Wdq_Ib, OP_32BIT, dreg, memref); emit_byte(emitptr, imm); } +inline void emit_roundpd_r128_r128_imm(x86code *&emitptr, uint8_t dreg, uint8_t sreg, uint8_t imm) { emit_op_modrm_reg(emitptr, OP_ROUNDPD_Vdq_Wdq_Ib, OP_32BIT, dreg, sreg); emit_byte(emitptr, imm); } +inline void emit_roundpd_r128_m128_imm(x86code *&emitptr, uint8_t dreg, x86_memref memref, uint8_t imm) { emit_op_modrm_mem(emitptr, OP_ROUNDPD_Vdq_Wdq_Ib, OP_32BIT, dreg, memref); emit_byte(emitptr, imm); } } diff --git a/src/devices/cpu/x86log.cpp b/src/devices/cpu/x86log.cpp index 09d53c80bba..f8990e51049 100644 --- a/src/devices/cpu/x86log.cpp +++ b/src/devices/cpu/x86log.cpp @@ -20,7 +20,7 @@ ***************************************************************************/ static void reset_log(x86log_context *log) noexcept; -extern int i386_dasm_one_ex(char *buffer, UINT64 eip, const UINT8 *oprom, int mode); +extern int i386_dasm_one_ex(char *buffer, uint64_t eip, const uint8_t *oprom, int mode); @@ -130,9 +130,9 @@ void x86log_disasm_code_range(x86log_context *log, const char *label, x86code *s { default: case 1: sprintf(buffer, "db %02X", *cur); break; - case 2: sprintf(buffer, "dw %04X", *(UINT16 *)cur); break; - case 4: sprintf(buffer, "dd %08X", *(UINT32 *)cur); break; - case 8: sprintf(buffer, "dq %08X%08X", ((UINT32 *)cur)[1], ((UINT32 *)cur)[0]); break; + case 2: sprintf(buffer, "dw %04X", *(uint16_t *)cur); break; + case 4: sprintf(buffer, "dd %08X", *(uint32_t *)cur); break; + case 8: sprintf(buffer, "dq %08X%08X", ((uint32_t *)cur)[1], ((uint32_t *)cur)[0]); break; } } diff --git a/src/devices/cpu/z180/z180.cpp b/src/devices/cpu/z180/z180.cpp index 26fee676f7e..0eab56994b8 100644 --- a/src/devices/cpu/z180/z180.cpp +++ b/src/devices/cpu/z180/z180.cpp @@ -81,7 +81,7 @@ Hitachi HD647180 series: const device_type Z180 = &device_creator; -z180_device::z180_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z180_device::z180_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, Z180, "Z180", tag, owner, clock, "z180", __FILE__) , z80_daisy_chain_interface(mconfig, *this) , m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0) @@ -91,7 +91,7 @@ z180_device::z180_device(const machine_config &mconfig, const char *tag, device_ } -offs_t z180_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t z180_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( z180 ); return CPU_DISASSEMBLE_NAME(z180)(this, buffer, pc, oprom, opram, options); @@ -750,14 +750,14 @@ offs_t z180_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr -static UINT8 SZ[256]; /* zero and sign flags */ -static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ -static UINT8 SZP[256]; /* zero, sign and parity flags */ -static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ -static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ +static uint8_t SZ[256]; /* zero and sign flags */ +static uint8_t SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ +static uint8_t SZP[256]; /* zero, sign and parity flags */ +static uint8_t SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ +static uint8_t SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ -static std::unique_ptr SZHVC_add; -static std::unique_ptr SZHVC_sub; +static std::unique_ptr SZHVC_add; +static std::unique_ptr SZHVC_sub; #include "z180ops.h" #include "z180tbl.h" @@ -781,10 +781,10 @@ const address_space_config *z180_device::memory_space_config(address_spacenum sp } } -UINT8 z180_device::z180_readcontrol(offs_t port) +uint8_t z180_device::z180_readcontrol(offs_t port) { /* normal external readport */ - UINT8 data = m_iospace->read_byte(port); + uint8_t data = m_iospace->read_byte(port); /* remap internal I/O registers */ if((port & (IO_IOCR & 0xc0)) == (IO_IOCR & 0xc0)) @@ -1210,7 +1210,7 @@ data |= 0x02; // kludge for 20pacgal return data; } -void z180_device::z180_writecontrol(offs_t port, UINT8 data) +void z180_device::z180_writecontrol(offs_t port, uint8_t data) { /* normal external write port */ m_iospace->write_byte(port, data); @@ -1307,7 +1307,7 @@ void z180_device::z180_writecontrol(offs_t port, UINT8 data) case Z180_TCR: LOG(("Z180 '%s' TCR wr $%02x ($%02x)\n", tag(), data, data & Z180_TCR_WMASK)); { - UINT16 old = IO_TCR; + uint16_t old = IO_TCR; /* Force reload on state change */ IO_TCR = (IO_TCR & ~Z180_TCR_WMASK) | (data & Z180_TCR_WMASK); if (!(old & Z180_TCR_TDE0) && (IO_TCR & Z180_TCR_TDE0)) @@ -1758,9 +1758,9 @@ int z180_device::z180_dma1() return 6 + cycles; } -void z180_device::z180_write_iolines(UINT32 data) +void z180_device::z180_write_iolines(uint32_t data) { - UINT32 changes = m_iol ^ data; + uint32_t changes = m_iol ^ data; /* I/O asynchronous clock 0 (active high) or DREQ0 (mux) */ if (changes & Z180_CKA0) @@ -1887,11 +1887,11 @@ void z180_device::device_start() { int i, p; int oldval, newval, val; - UINT8 *padd, *padc, *psub, *psbc; + uint8_t *padd, *padc, *psub, *psbc; /* allocate big flag arrays once */ - SZHVC_add = std::make_unique(2*256*256); - SZHVC_sub = std::make_unique(2*256*256); + SZHVC_add = std::make_unique(2*256*256); + SZHVC_sub = std::make_unique(2*256*256); padd = &SZHVC_add[ 0*256]; padc = &SZHVC_add[256*256]; @@ -2158,7 +2158,7 @@ void z180_device::device_reset() m_after_EI = 0; m_ea = 0; - memcpy(m_cc, (UINT8 *)cc_default, sizeof(m_cc)); + memcpy(m_cc, (uint8_t *)cc_default, sizeof(m_cc)); _IX = _IY = 0xffff; /* IX and IY are FFFF after a reset! */ _F = ZF; /* Zero flag is set */ @@ -2459,7 +2459,7 @@ again: /**************************************************************************** * Burn 'cycles' T-states. Adjust R register for the lost time ****************************************************************************/ -void z180_device::execute_burn(INT32 cycles) +void z180_device::execute_burn(int32_t cycles) { /* FIXME: This is not appropriate for dma */ while ( (cycles > 0) ) diff --git a/src/devices/cpu/z180/z180.h b/src/devices/cpu/z180/z180.h index 36b260e7a6f..67befa3a4d3 100644 --- a/src/devices/cpu/z180/z180.h +++ b/src/devices/cpu/z180/z180.h @@ -125,7 +125,7 @@ class z180_device : public cpu_device, public z80_daisy_chain_interface { public: // construction/destruction - z180_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + z180_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); protected: // device-level overrides @@ -133,12 +133,12 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 16; } - virtual UINT32 execute_input_lines() const override { return 3; } - virtual UINT32 execute_default_irq_vector() const override { return 0xff; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 16; } + virtual uint32_t execute_input_lines() const override { return 3; } + virtual uint32_t execute_default_irq_vector() const override { return 0xff; } virtual void execute_run() override; - virtual void execute_burn(INT32 cycles) override; + virtual void execute_burn(int32_t cycles) override; virtual void execute_set_input(int inputnum, int state) override; // device_memory_interface overrides @@ -151,9 +151,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; @@ -162,34 +162,34 @@ private: PAIR m_PREPC,m_PC,m_SP,m_AF,m_BC,m_DE,m_HL,m_IX,m_IY; PAIR m_AF2,m_BC2,m_DE2,m_HL2; - UINT8 m_R,m_R2,m_IFF1,m_IFF2,m_HALT,m_IM,m_I; - UINT8 m_tmdr_latch; /* flag latched TMDR0H, TMDR1H values */ - UINT8 m_read_tcr_tmdr[2]; /* flag to indicate that TCR or TMDR was read */ - UINT32 m_iol; /* I/O line status bits */ - UINT8 m_io[64]; /* 64 internal 8 bit registers */ + uint8_t m_R,m_R2,m_IFF1,m_IFF2,m_HALT,m_IM,m_I; + uint8_t m_tmdr_latch; /* flag latched TMDR0H, TMDR1H values */ + uint8_t m_read_tcr_tmdr[2]; /* flag to indicate that TCR or TMDR was read */ + uint32_t m_iol; /* I/O line status bits */ + uint8_t m_io[64]; /* 64 internal 8 bit registers */ offs_t m_mmu[16]; /* MMU address translation */ - UINT8 m_tmdrh[2]; /* latched TMDR0H and TMDR1H values */ - UINT16 m_tmdr_value[2]; /* TMDR values used byt PRT0 and PRT1 as down counter */ - UINT8 m_tif[2]; /* TIF0 and TIF1 values */ - UINT8 m_nmi_state; /* nmi line state */ - UINT8 m_nmi_pending; /* nmi pending */ - UINT8 m_irq_state[3]; /* irq line states (INT0,INT1,INT2) */ - UINT8 m_int_pending[11 + 1]; /* interrupt pending */ - UINT8 m_after_EI; /* are we in the EI shadow? */ - UINT32 m_ea; - UINT8 m_timer_cnt; /* timer counter / divide by 20 */ - UINT8 m_dma0_cnt; /* dma0 counter / divide by 20 */ - UINT8 m_dma1_cnt; /* dma1 counter / divide by 20 */ + uint8_t m_tmdrh[2]; /* latched TMDR0H and TMDR1H values */ + uint16_t m_tmdr_value[2]; /* TMDR values used byt PRT0 and PRT1 as down counter */ + uint8_t m_tif[2]; /* TIF0 and TIF1 values */ + uint8_t m_nmi_state; /* nmi line state */ + uint8_t m_nmi_pending; /* nmi pending */ + uint8_t m_irq_state[3]; /* irq line states (INT0,INT1,INT2) */ + uint8_t m_int_pending[11 + 1]; /* interrupt pending */ + uint8_t m_after_EI; /* are we in the EI shadow? */ + uint32_t m_ea; + uint8_t m_timer_cnt; /* timer counter / divide by 20 */ + uint8_t m_dma0_cnt; /* dma0 counter / divide by 20 */ + uint8_t m_dma1_cnt; /* dma1 counter / divide by 20 */ address_space *m_program; direct_read_data *m_direct; address_space *m_oprogram; direct_read_data *m_odirect; address_space *m_iospace; - UINT8 m_rtemp; - UINT32 m_ioltemp; + uint8_t m_rtemp; + uint32_t m_ioltemp; int m_icount; int m_extra_cycles; /* extra cpu cycles */ - UINT8 *m_cc[6]; + uint8_t *m_cc[6]; typedef void (z180_device::*opcode_func)(); static const opcode_func s_z180ops[6][0x100]; @@ -197,33 +197,33 @@ private: inline void z180_mmu(); inline void RM16( offs_t addr, PAIR *r ); inline void WM16( offs_t addr, PAIR *r ); - inline UINT8 ROP(); - inline UINT8 ARG(); - inline UINT32 ARG16(); - inline UINT8 INC(UINT8 value); - inline UINT8 DEC(UINT8 value); - inline UINT8 RLC(UINT8 value); - inline UINT8 RRC(UINT8 value); - inline UINT8 RL(UINT8 value); - inline UINT8 RR(UINT8 value); - inline UINT8 SLA(UINT8 value); - inline UINT8 SRA(UINT8 value); - inline UINT8 SLL(UINT8 value); - inline UINT8 SRL(UINT8 value); - inline UINT8 RES(UINT8 bit, UINT8 value); - inline UINT8 SET(UINT8 bit, UINT8 value); - inline int exec_op(const UINT8 opcode); - inline int exec_cb(const UINT8 opcode); - inline int exec_dd(const UINT8 opcode); - inline int exec_ed(const UINT8 opcode); - inline int exec_fd(const UINT8 opcode); - inline int exec_xycb(const UINT8 opcode); + inline uint8_t ROP(); + inline uint8_t ARG(); + inline uint32_t ARG16(); + inline uint8_t INC(uint8_t value); + inline uint8_t DEC(uint8_t value); + inline uint8_t RLC(uint8_t value); + inline uint8_t RRC(uint8_t value); + inline uint8_t RL(uint8_t value); + inline uint8_t RR(uint8_t value); + inline uint8_t SLA(uint8_t value); + inline uint8_t SRA(uint8_t value); + inline uint8_t SLL(uint8_t value); + inline uint8_t SRL(uint8_t value); + inline uint8_t RES(uint8_t bit, uint8_t value); + inline uint8_t SET(uint8_t bit, uint8_t value); + inline int exec_op(const uint8_t opcode); + inline int exec_cb(const uint8_t opcode); + inline int exec_dd(const uint8_t opcode); + inline int exec_ed(const uint8_t opcode); + inline int exec_fd(const uint8_t opcode); + inline int exec_xycb(const uint8_t opcode); int take_interrupt(int irq); - UINT8 z180_readcontrol(offs_t port); - void z180_writecontrol(offs_t port, UINT8 data); + uint8_t z180_readcontrol(offs_t port); + void z180_writecontrol(offs_t port, uint8_t data); int z180_dma0(int max_cycles); int z180_dma1(); - void z180_write_iolines(UINT32 data); + void z180_write_iolines(uint32_t data); void clock_timers(); int check_interrupts(); void handle_io_timers(int cycles); diff --git a/src/devices/cpu/z180/z180dasm.cpp b/src/devices/cpu/z180/z180dasm.cpp index e44f6d67ae4..b4b4b6571a7 100644 --- a/src/devices/cpu/z180/z180dasm.cpp +++ b/src/devices/cpu/z180/z180dasm.cpp @@ -38,7 +38,7 @@ static const char *const s_mnemonic[] = { }; struct z80dasm { - UINT8 mnemonic; + uint8_t mnemonic; const char *arguments; }; @@ -377,12 +377,12 @@ static const z80dasm mnemonic_main[256]= { {zCALL,"m,A"}, {zDB,"fd"}, {zCP,"B"}, {zRST,"V"} }; -static char sign(INT8 offset) +static char sign(int8_t offset) { return (offset < 0)? '-':'+'; } -static int offs(INT8 offset) +static int offs(int8_t offset) { if (offset < 0) return -offset; return offset; @@ -397,11 +397,11 @@ CPU_DISASSEMBLE( z180 ) const char *src, *ixy; char *dst; unsigned PC = pc; - INT8 offset = 0; - UINT8 op, op1 = 0; - UINT16 ea; + int8_t offset = 0; + uint8_t op, op1 = 0; + uint16_t ea; int pos = 0; - UINT32 flags = 0; + uint32_t flags = 0; ixy = "oops!!"; dst = buffer; @@ -423,7 +423,7 @@ CPU_DISASSEMBLE( z180 ) op1 = oprom[pos++]; if( op1 == 0xcb ) { - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; op1 = opram[pos++]; /* fourth byte from opbase.ram! */ d = &mnemonic_xx_cb[op1]; } @@ -434,7 +434,7 @@ CPU_DISASSEMBLE( z180 ) op1 = oprom[pos++]; if( op1 == 0xcb ) { - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; op1 = opram[pos++]; /* fourth byte from opbase.ram! */ d = &mnemonic_xx_cb[op1]; } @@ -471,7 +471,7 @@ CPU_DISASSEMBLE( z180 ) dst += sprintf( dst, "$%04X", ea ); break; case 'O': /* Offset relative to PC */ - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; dst += sprintf( dst, "$%05X", PC + offset + 2 ); break; case 'P': /* Port number */ @@ -488,7 +488,7 @@ CPU_DISASSEMBLE( z180 ) dst += sprintf( dst, "$%05X", ea ); break; case 'X': - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; case 'Y': dst += sprintf( dst,"(%s%c$%02x)", ixy, sign(offset), offs(offset) ); break; diff --git a/src/devices/cpu/z180/z180ed.hxx b/src/devices/cpu/z180/z180ed.hxx index 91520228f87..df123a07a23 100644 --- a/src/devices/cpu/z180/z180ed.hxx +++ b/src/devices/cpu/z180/z180ed.hxx @@ -135,7 +135,7 @@ OP(ed,6d) { RETI; } /* RETI OP(ed,6e) { m_IM = 0; } /* IM 0 */ OP(ed,6f) { RLD; } /* RLD (HL) */ -OP(ed,70) { UINT8 res = IN(_BC); _F = (_F & CF) | SZP[res]; } /* IN 0,(C) */ +OP(ed,70) { uint8_t res = IN(_BC); _F = (_F & CF) | SZP[res]; } /* IN 0,(C) */ OP(ed,71) { OUT(_BC,0); } /* OUT (C),0 */ OP(ed,72) { SBC16( SP ); } /* SBC HL,SP */ OP(ed,73) { m_ea = ARG16(); WM16( m_ea, &m_SP ); } /* LD (w),SP */ diff --git a/src/devices/cpu/z180/z180ops.h b/src/devices/cpu/z180/z180ops.h index 6fb50e18112..3e2139fa51c 100644 --- a/src/devices/cpu/z180/z180ops.h +++ b/src/devices/cpu/z180/z180ops.h @@ -98,7 +98,7 @@ void z180_device::WM16( offs_t addr, PAIR *r ) * reading opcodes. In case of system with memory mapped I/O, * this function can be used to greatly speed up emulation ***************************************************************/ -UINT8 z180_device::ROP() +uint8_t z180_device::ROP() { offs_t addr = _PCD; _PC++; @@ -111,14 +111,14 @@ UINT8 z180_device::ROP() * support systems that use different encoding mechanisms for * opcodes and opcode arguments ***************************************************************/ -UINT8 z180_device::ARG() +uint8_t z180_device::ARG() { offs_t addr = _PCD; _PC++; return m_direct->read_byte(MMU_REMAP_ADDR(addr)); } -UINT32 z180_device::ARG16() +uint32_t z180_device::ARG16() { offs_t addr = _PCD; _PC += 2; @@ -129,8 +129,8 @@ UINT32 z180_device::ARG16() * Calculate the effective addess m_ea of an opcode using * IX+offset resp. IY+offset addressing. ***************************************************************/ -#define EAX() m_ea = (UINT32)(UINT16)(_IX + (INT8)ARG()) -#define EAY() m_ea = (UINT32)(UINT16)(_IY + (INT8)ARG()) +#define EAX() m_ea = (uint32_t)(uint16_t)(_IX + (int8_t)ARG()) +#define EAY() m_ea = (uint32_t)(uint16_t)(_IY + (int8_t)ARG()) /*************************************************************** * POP @@ -168,7 +168,7 @@ UINT32 z180_device::ARG16() ***************************************************************/ #define JR() \ { \ - INT8 arg = (INT8)ARG(); /* ARG() also increments _PC */ \ + int8_t arg = (int8_t)ARG(); /* ARG() also increments _PC */ \ _PC += arg; /* so don't do _PC += ARG() */ \ } @@ -178,7 +178,7 @@ UINT32 z180_device::ARG16() #define JR_COND(cond,opcode) \ if( cond ) \ { \ - INT8 arg = (INT8)ARG(); /* ARG() also increments _PC */ \ + int8_t arg = (int8_t)ARG(); /* ARG() also increments _PC */ \ _PC += arg; /* so don't do _PC += ARG() */ \ CC(ex,opcode); \ } \ @@ -277,19 +277,19 @@ UINT32 z180_device::ARG16() /*************************************************************** * INC r8 ***************************************************************/ -UINT8 z180_device::INC(UINT8 value) +uint8_t z180_device::INC(uint8_t value) { - UINT8 res = value + 1; + uint8_t res = value + 1; _F = (_F & CF) | SZHV_inc[res]; - return (UINT8)res; + return (uint8_t)res; } /*************************************************************** * DEC r8 ***************************************************************/ -UINT8 z180_device::DEC(UINT8 value) +uint8_t z180_device::DEC(uint8_t value) { - UINT8 res = value - 1; + uint8_t res = value - 1; _F = (_F & CF) | SZHV_dec[res]; return res; } @@ -312,8 +312,8 @@ UINT8 z180_device::DEC(UINT8 value) * RLA ***************************************************************/ #define RLA { \ - UINT8 res = (_A << 1) | (_F & CF); \ - UINT8 c = (_A & 0x80) ? CF : 0; \ + uint8_t res = (_A << 1) | (_F & CF); \ + uint8_t c = (_A & 0x80) ? CF : 0; \ _F = (_F & (SF | ZF | PF)) | c | (res & (YF | XF)); \ _A = res; \ } @@ -322,8 +322,8 @@ UINT8 z180_device::DEC(UINT8 value) * RRA ***************************************************************/ #define RRA { \ - UINT8 res = (_A >> 1) | (_F << 7); \ - UINT8 c = (_A & 0x01) ? CF : 0; \ + uint8_t res = (_A >> 1) | (_F << 7); \ + uint8_t c = (_A & 0x01) ? CF : 0; \ _F = (_F & (SF | ZF | PF)) | c | (res & (YF | XF)); \ _A = res; \ } @@ -332,7 +332,7 @@ UINT8 z180_device::DEC(UINT8 value) * RRD ***************************************************************/ #define RRD { \ - UINT8 n = RM(_HL); \ + uint8_t n = RM(_HL); \ WM( _HL, (n >> 4) | (_A << 4) ); \ _A = (_A & 0xf0) | (n & 0x0f); \ _F = (_F & CF) | SZP[_A]; \ @@ -342,7 +342,7 @@ UINT8 z180_device::DEC(UINT8 value) * RLD ***************************************************************/ #define RLD { \ - UINT8 n = RM(_HL); \ + uint8_t n = RM(_HL); \ WM( _HL, (n << 4) | (_A & 0x0f) ); \ _A = (_A & 0xf0) | (n >> 4); \ _F = (_F & CF) | SZP[_A]; \ @@ -353,8 +353,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define ADD(value) \ { \ - UINT32 ah = _AFD & 0xff00; \ - UINT32 res = (UINT8)((ah >> 8) + value); \ + uint32_t ah = _AFD & 0xff00; \ + uint32_t res = (uint8_t)((ah >> 8) + value); \ _F = SZHVC_add[ah | res]; \ _A = res; \ } @@ -364,8 +364,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define ADC(value) \ { \ - UINT32 ah = _AFD & 0xff00, c = _AFD & 1; \ - UINT32 res = (UINT8)((ah >> 8) + value + c); \ + uint32_t ah = _AFD & 0xff00, c = _AFD & 1; \ + uint32_t res = (uint8_t)((ah >> 8) + value + c); \ _F = SZHVC_add[(c << 16) | ah | res]; \ _A = res; \ } @@ -375,8 +375,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define SUB(value) \ { \ - UINT32 ah = _AFD & 0xff00; \ - UINT32 res = (UINT8)((ah >> 8) - value); \ + uint32_t ah = _AFD & 0xff00; \ + uint32_t res = (uint8_t)((ah >> 8) - value); \ _F = SZHVC_sub[ah | res]; \ _A = res; \ } @@ -386,8 +386,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define SBC(value) \ { \ - UINT32 ah = _AFD & 0xff00, c = _AFD & 1; \ - UINT32 res = (UINT8)((ah >> 8) - value - c); \ + uint32_t ah = _AFD & 0xff00, c = _AFD & 1; \ + uint32_t res = (uint8_t)((ah >> 8) - value - c); \ _F = SZHVC_sub[(c<<16) | ah | res]; \ _A = res; \ } @@ -396,7 +396,7 @@ UINT8 z180_device::DEC(UINT8 value) * NEG ***************************************************************/ #define NEG { \ - UINT8 value = _A; \ + uint8_t value = _A; \ _A = 0; \ SUB(value); \ } @@ -405,7 +405,7 @@ UINT8 z180_device::DEC(UINT8 value) * DAA ***************************************************************/ #define DAA { \ - UINT8 r = _A; \ + uint8_t r = _A; \ if (_F&NF) { \ if ((_F&HF)|((_A&0xf)>9)) r-=6; \ if ((_F&CF)|(_A>0x99)) r-=0x60; \ @@ -444,8 +444,8 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define CP(value) \ { \ - UINT32 ah = _AFD & 0xff00; \ - UINT32 res = (UINT8)((ah >> 8) - value); \ + uint32_t ah = _AFD & 0xff00; \ + uint32_t res = (uint8_t)((ah >> 8) - value); \ _F = SZHVC_sub[ah | res]; \ } @@ -492,11 +492,11 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define ADD16(DR,SR) \ { \ - UINT32 res = m_##DR.d + m_##SR.d; \ + uint32_t res = m_##DR.d + m_##SR.d; \ _F = (_F & (SF | ZF | VF)) | \ (((m_##DR.d ^ res ^ m_##SR.d) >> 8) & HF) | \ ((res >> 16) & CF); \ - m_##DR.w.l = (UINT16)res; \ + m_##DR.w.l = (uint16_t)res; \ } /*************************************************************** @@ -504,13 +504,13 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define ADC16(DR) \ { \ - UINT32 res = _HLD + m_##DR.d + (_F & CF); \ + uint32_t res = _HLD + m_##DR.d + (_F & CF); \ _F = (((_HLD ^ res ^ m_##DR.d) >> 8) & HF) | \ ((res >> 16) & CF) | \ ((res >> 8) & SF) | \ ((res & 0xffff) ? 0 : ZF) | \ (((m_##DR.d ^ _HLD ^ 0x8000) & (m_##DR.d ^ res) & 0x8000) >> 13); \ - _HL = (UINT16)res; \ + _HL = (uint16_t)res; \ } /*************************************************************** @@ -518,19 +518,19 @@ UINT8 z180_device::DEC(UINT8 value) ***************************************************************/ #define SBC16(DR) \ { \ - UINT32 res = _HLD - m_##DR.d - (_F & CF); \ + uint32_t res = _HLD - m_##DR.d - (_F & CF); \ _F = (((_HLD ^ res ^ m_##DR.d) >> 8) & HF) | NF | \ ((res >> 16) & CF) | \ ((res >> 8) & SF) | \ ((res & 0xffff) ? 0 : ZF) | \ (((m_##DR.d ^ _HLD) & (_HLD ^ res) &0x8000) >> 13); \ - _HL = (UINT16)res; \ + _HL = (uint16_t)res; \ } /*************************************************************** * RLC r8 ***************************************************************/ -UINT8 z180_device::RLC(UINT8 value) +uint8_t z180_device::RLC(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -542,7 +542,7 @@ UINT8 z180_device::RLC(UINT8 value) /*************************************************************** * RRC r8 ***************************************************************/ -UINT8 z180_device::RRC(UINT8 value) +uint8_t z180_device::RRC(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -554,7 +554,7 @@ UINT8 z180_device::RRC(UINT8 value) /*************************************************************** * RL r8 ***************************************************************/ -UINT8 z180_device::RL(UINT8 value) +uint8_t z180_device::RL(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -566,7 +566,7 @@ UINT8 z180_device::RL(UINT8 value) /*************************************************************** * RR r8 ***************************************************************/ -UINT8 z180_device::RR(UINT8 value) +uint8_t z180_device::RR(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -578,7 +578,7 @@ UINT8 z180_device::RR(UINT8 value) /*************************************************************** * SLA r8 ***************************************************************/ -UINT8 z180_device::SLA(UINT8 value) +uint8_t z180_device::SLA(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -590,7 +590,7 @@ UINT8 z180_device::SLA(UINT8 value) /*************************************************************** * SRA r8 ***************************************************************/ -UINT8 z180_device::SRA(UINT8 value) +uint8_t z180_device::SRA(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -602,7 +602,7 @@ UINT8 z180_device::SRA(UINT8 value) /*************************************************************** * SLL r8 ***************************************************************/ -UINT8 z180_device::SLL(UINT8 value) +uint8_t z180_device::SLL(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -614,7 +614,7 @@ UINT8 z180_device::SLL(UINT8 value) /*************************************************************** * SRL r8 ***************************************************************/ -UINT8 z180_device::SRL(UINT8 value) +uint8_t z180_device::SRL(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -639,7 +639,7 @@ UINT8 z180_device::SRL(UINT8 value) /*************************************************************** * RES bit,r8 ***************************************************************/ -UINT8 z180_device::RES(UINT8 bit, UINT8 value) +uint8_t z180_device::RES(uint8_t bit, uint8_t value) { return value & ~(1< flag 5 */ \ @@ -669,8 +669,8 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * CPI ***************************************************************/ #define CPI { \ - UINT8 val = RM(_HL); \ - UINT8 res = _A - val; \ + uint8_t val = RM(_HL); \ + uint8_t res = _A - val; \ _HL++; _BC--; \ _F = (_F & CF) | (SZ[res] & ~(YF|XF)) | ((_A ^ val ^ res) & HF) | NF; \ if( _F & HF ) res -= 1; \ @@ -683,7 +683,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * INI ***************************************************************/ #define INI { \ - UINT8 io = IN(_BC); \ + uint8_t io = IN(_BC); \ _B--; \ WM( _HL, io ); \ _HL++; \ @@ -701,7 +701,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * OUTI ***************************************************************/ #define OUTI { \ - UINT8 io = RM(_HL); \ + uint8_t io = RM(_HL); \ _B--; \ OUT( _BC, io ); \ _HL++; \ @@ -719,7 +719,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * LDD ***************************************************************/ #define LDD { \ - UINT8 io = RM(_HL); \ + uint8_t io = RM(_HL); \ WM( _DE, io ); \ _F &= SF | ZF | CF; \ if( (_A + io) & 0x02 ) _F |= YF; /* bit 1 -> flag 5 */ \ @@ -732,8 +732,8 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * CPD ***************************************************************/ #define CPD { \ - UINT8 val = RM(_HL); \ - UINT8 res = _A - val; \ + uint8_t val = RM(_HL); \ + uint8_t res = _A - val; \ _HL--; _BC--; \ _F = (_F & CF) | (SZ[res] & ~(YF|XF)) | ((_A ^ val ^ res) & HF) | NF; \ if( _F & HF ) res -= 1; \ @@ -746,7 +746,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * IND ***************************************************************/ #define IND { \ - UINT8 io = IN(_BC); \ + uint8_t io = IN(_BC); \ _B--; \ WM( _HL, io ); \ _HL--; \ @@ -764,7 +764,7 @@ UINT8 z180_device::SET(UINT8 bit, UINT8 value) * OUTD ***************************************************************/ #define OUTD { \ - UINT8 io = RM(_HL); \ + uint8_t io = RM(_HL); \ _B--; \ OUT( _BC, io ); \ _HL--; \ diff --git a/src/devices/cpu/z180/z180tbl.h b/src/devices/cpu/z180/z180tbl.h index 4884992a5e3..57d1bed3961 100644 --- a/src/devices/cpu/z180/z180tbl.h +++ b/src/devices/cpu/z180/z180tbl.h @@ -1,17 +1,17 @@ // license:BSD-3-Clause // copyright-holders:Juergen Buchmueller /* tmp1 value for ini/inir/outi/otir for [C.1-0][io.1-0] */ -static const UINT8 irep_tmp1[4][4] = { +static const uint8_t irep_tmp1[4][4] = { {0,0,1,0},{0,1,0,1},{1,0,1,1},{0,1,1,0} }; /* tmp1 value for ind/indr/outd/otdr for [C.1-0][io.1-0] */ -static const UINT8 drep_tmp1[4][4] = { +static const uint8_t drep_tmp1[4][4] = { {0,1,0,0},{1,0,0,1},{0,0,1,0},{0,1,0,1} }; /* tmp2 value for all in/out repeated opcodes for B.7-0 */ -static const UINT8 breg_tmp2[256] = { +static const uint8_t breg_tmp2[256] = { 0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1, 0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0, 1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0, @@ -30,7 +30,7 @@ static const UINT8 breg_tmp2[256] = { 1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1 }; -static const UINT8 cc_op[0x100] = { +static const uint8_t cc_op[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 3, 9, 7, 4, 4, 4, 6, 3, 4, 7, 6, 4, 4, 4, 6, 3, 7, 9, 7, 4, 4, 4, 6, 3, 8, 7, 6, 4, 4, 4, 6, 3, @@ -50,7 +50,7 @@ static const UINT8 cc_op[0x100] = { 5, 9, 6, 3, 6,11, 6,11, 5, 4, 6, 3, 6, 0, 6,11 }; -static const UINT8 cc_cb[0x100] = { +static const uint8_t cc_cb[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7, @@ -70,7 +70,7 @@ static const UINT8 cc_cb[0x100] = { 7, 7, 7, 7, 7, 7,13, 7, 7, 7, 7, 7, 7, 7,13, 7 }; -static const UINT8 cc_ed[0x100] = { +static const uint8_t cc_ed[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 12,13, 6, 6, 9, 6, 6, 6,12,13, 6, 6, 9, 6, 6, 6, 12,13, 6, 6, 9, 6, 6, 6,12,13, 6, 6, 9, 6, 6, 6, @@ -90,7 +90,7 @@ static const UINT8 cc_ed[0x100] = { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }; -static const UINT8 cc_xy[0x100] = { +static const uint8_t cc_xy[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 4, 4, 4, 4, 4, 4, 4, 4, 4,10, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,10, 4, 4, 4, 4, 4, 4, @@ -110,7 +110,7 @@ static const UINT8 cc_xy[0x100] = { 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4 }; -static const UINT8 cc_xycb[0x100] = { +static const uint8_t cc_xycb[0x100] = { /*-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, @@ -131,7 +131,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 -1 -2 -3 -4 -5 -6 -7 -8 -9 -a -b -c -d -e -f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* DJNZ */ @@ -151,7 +151,7 @@ static const UINT8 cc_ex[0x100] = { 5, 0, 3, 0,10, 0, 0, 2, 5, 0, 3, 0,10, 0, 0, 2 }; -static const UINT8 *const cc_default[6] = { cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex }; +static const uint8_t *const cc_default[6] = { cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex }; #define Z180_TABLE_dd Z180_TABLE_xy #define Z180_TABLE_fd Z180_TABLE_xy @@ -218,7 +218,7 @@ const z180_device::opcode_func z180_device::s_z180ops[Z180_PREFIX_COUNT][0x100] ***************************************************************/ #define EXEC_PROTOTYPE(prefix) \ -int z180_device::exec##_##prefix(const UINT8 opcode) \ +int z180_device::exec##_##prefix(const uint8_t opcode) \ { \ (this->*s_z180ops[Z180_PREFIX_##prefix][opcode])(); \ return m_cc[Z180_TABLE_##prefix][opcode]; \ diff --git a/src/devices/cpu/z8/z8.cpp b/src/devices/cpu/z8/z8.cpp index 7e21e5d2e5b..3ce48319632 100644 --- a/src/devices/cpu/z8/z8.cpp +++ b/src/devices/cpu/z8/z8.cpp @@ -170,7 +170,7 @@ static ADDRESS_MAP_START( program_4kb, AS_PROGRAM, 8, z8_device ) ADDRESS_MAP_END -z8_device::z8_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, int size) +z8_device::z8_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, int size) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0, ( size == 4 ) ? ADDRESS_MAP_NAME(program_4kb) : ADDRESS_MAP_NAME(program_2kb)) , m_data_config("data", ENDIANNESS_LITTLE, 8, 16, 0) @@ -179,25 +179,25 @@ z8_device::z8_device(const machine_config &mconfig, device_type type, const char } -z8601_device::z8601_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock) +z8601_device::z8601_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock) : z8_device(mconfig, Z8601, "Z8601", _tag, _owner, _clock, "z8601", __FILE__, 2) { } -ub8830d_device::ub8830d_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock) +ub8830d_device::ub8830d_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock) : z8_device(mconfig, UB8830D, "UB8830D", _tag, _owner, _clock, "ub8830d", __FILE__, 2) { } -z8611_device::z8611_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock) +z8611_device::z8611_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock) : z8_device(mconfig, Z8611, "Z8611", _tag, _owner, _clock, "z8611", __FILE__, 4) { } -offs_t z8_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t z8_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( z8 ); return CPU_DISASSEMBLE_NAME(z8)(this, buffer, pc, oprom, opram, options); @@ -208,9 +208,9 @@ offs_t z8_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom INLINE FUNCTIONS ***************************************************************************/ -UINT8 z8_device::fetch() +uint8_t z8_device::fetch() { - UINT8 data = m_direct->read_byte(m_pc); + uint8_t data = m_direct->read_byte(m_pc); m_pc++; @@ -218,10 +218,10 @@ UINT8 z8_device::fetch() } -UINT8 z8_device::register_read(UINT8 offset) +uint8_t z8_device::register_read(uint8_t offset) { - UINT8 data = 0xff; - UINT8 mask = 0; + uint8_t data = 0xff; + uint8_t mask = 0; switch (offset) { @@ -312,14 +312,14 @@ UINT8 z8_device::register_read(UINT8 offset) return data; } -UINT16 z8_device::register_pair_read(UINT8 offset) +uint16_t z8_device::register_pair_read(uint8_t offset) { return (register_read(offset) << 8) | register_read(offset + 1); } -void z8_device::register_write(UINT8 offset, UINT8 data) +void z8_device::register_write(uint8_t offset, uint8_t data) { - UINT8 mask = 0; + uint8_t mask = 0; switch (offset) { @@ -403,18 +403,18 @@ void z8_device::register_write(UINT8 offset, UINT8 data) m_r[offset] = data; } -void z8_device::register_pair_write(UINT8 offset, UINT16 data) +void z8_device::register_pair_write(uint8_t offset, uint16_t data) { register_write(offset, data >> 8); register_write(offset + 1, data & 0xff); } -UINT8 z8_device::get_working_register(int offset) +uint8_t z8_device::get_working_register(int offset) { return (m_r[Z8_REGISTER_RP] & 0xf0) | (offset & 0x0f); } -UINT8 z8_device::get_register(UINT8 offset) +uint8_t z8_device::get_register(uint8_t offset) { if ((offset & 0xf0) == 0xe0) return get_working_register(offset & 0x0f); @@ -422,17 +422,17 @@ UINT8 z8_device::get_register(UINT8 offset) return offset; } -UINT8 z8_device::get_intermediate_register(int offset) +uint8_t z8_device::get_intermediate_register(int offset) { return register_read(get_register(offset)); } -void z8_device::stack_push_byte(UINT8 src) +void z8_device::stack_push_byte(uint8_t src) { if (register_read(Z8_REGISTER_P01M) & Z8_P01M_INTERNAL_STACK) { /* SP <- SP - 1 */ - UINT8 sp = register_read(Z8_REGISTER_SPL) - 1; + uint8_t sp = register_read(Z8_REGISTER_SPL) - 1; register_write(Z8_REGISTER_SPL, sp); /* @SP <- src */ @@ -441,7 +441,7 @@ void z8_device::stack_push_byte(UINT8 src) else { /* SP <- SP - 1 */ - UINT16 sp = register_pair_read(Z8_REGISTER_SPH) - 1; + uint16_t sp = register_pair_read(Z8_REGISTER_SPH) - 1; register_pair_write(Z8_REGISTER_SPH, sp); /* @SP <- src */ @@ -449,12 +449,12 @@ void z8_device::stack_push_byte(UINT8 src) } } -void z8_device::stack_push_word(UINT16 src) +void z8_device::stack_push_word(uint16_t src) { if (register_read(Z8_REGISTER_P01M) & Z8_P01M_INTERNAL_STACK) { /* SP <- SP - 2 */ - UINT8 sp = register_read(Z8_REGISTER_SPL) - 2; + uint8_t sp = register_read(Z8_REGISTER_SPL) - 2; register_write(Z8_REGISTER_SPL, sp); /* @SP <- src */ @@ -463,7 +463,7 @@ void z8_device::stack_push_word(UINT16 src) else { /* SP <- SP - 2 */ - UINT16 sp = register_pair_read(Z8_REGISTER_SPH) - 2; + uint16_t sp = register_pair_read(Z8_REGISTER_SPH) - 2; register_pair_write(Z8_REGISTER_SPH, sp); /* @SP <- src */ @@ -471,12 +471,12 @@ void z8_device::stack_push_word(UINT16 src) } } -UINT8 z8_device::stack_pop_byte() +uint8_t z8_device::stack_pop_byte() { if (register_read(Z8_REGISTER_P01M) & Z8_P01M_INTERNAL_STACK) { /* SP <- SP + 1 */ - UINT8 sp = register_read(Z8_REGISTER_SPL) + 1; + uint8_t sp = register_read(Z8_REGISTER_SPL) + 1; register_write(Z8_REGISTER_SPL, sp); /* @SP <- src */ @@ -485,7 +485,7 @@ UINT8 z8_device::stack_pop_byte() else { /* SP <- SP + 1 */ - UINT16 sp = register_pair_read(Z8_REGISTER_SPH) + 1; + uint16_t sp = register_pair_read(Z8_REGISTER_SPH) + 1; register_pair_write(Z8_REGISTER_SPH, sp); /* @SP <- src */ @@ -493,12 +493,12 @@ UINT8 z8_device::stack_pop_byte() } } -UINT16 z8_device::stack_pop_word() +uint16_t z8_device::stack_pop_word() { if (register_read(Z8_REGISTER_P01M) & Z8_P01M_INTERNAL_STACK) { /* SP <- SP + 2 */ - UINT8 sp = register_read(Z8_REGISTER_SPL) + 2; + uint8_t sp = register_read(Z8_REGISTER_SPL) + 2; register_write(Z8_REGISTER_SPL, sp); /* @SP <- src */ @@ -507,7 +507,7 @@ UINT16 z8_device::stack_pop_word() else { /* SP <- SP + 2 */ - UINT16 sp = register_pair_read(Z8_REGISTER_SPH) + 2; + uint16_t sp = register_pair_read(Z8_REGISTER_SPH) + 2; register_pair_write(Z8_REGISTER_SPH, sp); /* @SP <- src */ @@ -515,7 +515,7 @@ UINT16 z8_device::stack_pop_word() } } -void z8_device::set_flag(UINT8 flag, int state) +void z8_device::set_flag(uint8_t flag, int state) { if (state) m_r[Z8_REGISTER_FLAGS] |= flag; @@ -534,7 +534,7 @@ void z8_device::set_flag(UINT8 flag, int state) OPCODE HANDLERS ***************************************************************************/ -#define INSTRUCTION(mnemonic) void z8_device::mnemonic(UINT8 opcode, int *cycles) +#define INSTRUCTION(mnemonic) void z8_device::mnemonic(uint8_t opcode, int *cycles) INSTRUCTION( illegal ) { @@ -726,7 +726,7 @@ void z8_device::execute_run() { do { - UINT8 opcode; + uint8_t opcode; int cycles; debugger_instruction_hook(this, m_pc); diff --git a/src/devices/cpu/z8/z8.h b/src/devices/cpu/z8/z8.h index 758ae7c5366..1d3afb9aaa0 100644 --- a/src/devices/cpu/z8/z8.h +++ b/src/devices/cpu/z8/z8.h @@ -24,7 +24,7 @@ class z8_device : public cpu_device { public: // construction/destruction - z8_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, int size); + z8_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, int size); protected: // device-level overrides @@ -32,11 +32,11 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 6; } - virtual UINT32 execute_max_cycles() const override { return 20; } - virtual UINT32 execute_input_lines() const override { return 4; } - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks + 2 - 1) / 2; } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 2); } + virtual uint32_t execute_min_cycles() const override { return 6; } + virtual uint32_t execute_max_cycles() const override { return 20; } + virtual uint32_t execute_input_lines() const override { return 4; } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks + 2 - 1) / 2; } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 2); } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -59,9 +59,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 3; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 3; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: @@ -75,16 +75,16 @@ private: address_space *m_io; /* registers */ - UINT16 m_pc; /* program counter */ - UINT8 m_r[256]; /* register file */ - UINT8 m_input[4]; /* port input latches */ - UINT8 m_output[4]; /* port output latches */ - UINT8 m_t0; /* timer 0 current count */ - UINT8 m_t1; /* timer 1 current count */ + uint16_t m_pc; /* program counter */ + uint8_t m_r[256]; /* register file */ + uint8_t m_input[4]; /* port input latches */ + uint8_t m_output[4]; /* port output latches */ + uint8_t m_t0; /* timer 0 current count */ + uint8_t m_t1; /* timer 1 current count */ /* fake registers */ - UINT16 m_fake_sp; /* fake stack pointer */ - UINT8 m_fake_r[16]; /* fake working registers */ + uint16_t m_fake_sp; /* fake stack pointer */ + uint8_t m_fake_r[16]; /* fake working registers */ /* interrupts */ int m_irq[6]; /* interrupts */ @@ -99,54 +99,54 @@ private: TIMER_CALLBACK_MEMBER( t0_tick ); TIMER_CALLBACK_MEMBER( t1_tick ); - inline UINT8 fetch(); - inline UINT8 register_read(UINT8 offset); - inline UINT16 register_pair_read(UINT8 offset); - inline void register_write(UINT8 offset, UINT8 data); - inline void register_pair_write(UINT8 offset, UINT16 data); - inline UINT8 get_working_register(int offset); - inline UINT8 get_register(UINT8 offset); - inline UINT8 get_intermediate_register(int offset); - inline void stack_push_byte(UINT8 src); - inline void stack_push_word(UINT16 src); - inline UINT8 stack_pop_byte(); - inline UINT16 stack_pop_word(); - inline void set_flag(UINT8 flag, int state); - inline void clear(UINT8 dst); - inline void load(UINT8 dst, UINT8 src); + inline uint8_t fetch(); + inline uint8_t register_read(uint8_t offset); + inline uint16_t register_pair_read(uint8_t offset); + inline void register_write(uint8_t offset, uint8_t data); + inline void register_pair_write(uint8_t offset, uint16_t data); + inline uint8_t get_working_register(int offset); + inline uint8_t get_register(uint8_t offset); + inline uint8_t get_intermediate_register(int offset); + inline void stack_push_byte(uint8_t src); + inline void stack_push_word(uint16_t src); + inline uint8_t stack_pop_byte(); + inline uint16_t stack_pop_word(); + inline void set_flag(uint8_t flag, int state); + inline void clear(uint8_t dst); + inline void load(uint8_t dst, uint8_t src); inline void load_from_memory(address_space *space); inline void load_to_memory(address_space *space); inline void load_from_memory_autoinc(address_space *space); inline void load_to_memory_autoinc(address_space *space); - inline void pop(UINT8 dst); - inline void push(UINT8 src); - inline void add_carry(UINT8 dst, INT8 src); - inline void add(UINT8 dst, INT8 src); - inline void compare(UINT8 dst, UINT8 src); - inline void decimal_adjust(UINT8 dst); - inline void decrement(UINT8 dst); - inline void decrement_word(UINT8 dst); - inline void increment(UINT8 dst); - inline void increment_word(UINT8 dst); - inline void subtract_carry(UINT8 dst, UINT8 src); - inline void subtract(UINT8 dst, UINT8 src); - inline void _and(UINT8 dst, UINT8 src); - inline void complement(UINT8 dst); - inline void _or(UINT8 dst, UINT8 src); - inline void _xor(UINT8 dst, UINT8 src); - inline void call(UINT16 dst); - inline void jump(UINT16 dst); + inline void pop(uint8_t dst); + inline void push(uint8_t src); + inline void add_carry(uint8_t dst, int8_t src); + inline void add(uint8_t dst, int8_t src); + inline void compare(uint8_t dst, uint8_t src); + inline void decimal_adjust(uint8_t dst); + inline void decrement(uint8_t dst); + inline void decrement_word(uint8_t dst); + inline void increment(uint8_t dst); + inline void increment_word(uint8_t dst); + inline void subtract_carry(uint8_t dst, uint8_t src); + inline void subtract(uint8_t dst, uint8_t src); + inline void _and(uint8_t dst, uint8_t src); + inline void complement(uint8_t dst); + inline void _or(uint8_t dst, uint8_t src); + inline void _xor(uint8_t dst, uint8_t src); + inline void call(uint16_t dst); + inline void jump(uint16_t dst); inline int check_condition_code(int cc); - inline void test_complement_under_mask(UINT8 dst, UINT8 src); - inline void test_under_mask(UINT8 dst, UINT8 src); - inline void rotate_left(UINT8 dst); - inline void rotate_left_carry(UINT8 dst); - inline void rotate_right(UINT8 dst); - inline void rotate_right_carry(UINT8 dst); - inline void shift_right_arithmetic(UINT8 dst); - inline void swap(UINT8 dst); - - #define INSTRUCTION(inst) void inst(UINT8 opcode, int *cycles); + inline void test_complement_under_mask(uint8_t dst, uint8_t src); + inline void test_under_mask(uint8_t dst, uint8_t src); + inline void rotate_left(uint8_t dst); + inline void rotate_left_carry(uint8_t dst); + inline void rotate_right(uint8_t dst); + inline void rotate_right_carry(uint8_t dst); + inline void shift_right_arithmetic(uint8_t dst); + inline void swap(uint8_t dst); + + #define INSTRUCTION(inst) void inst(uint8_t opcode, int *cycles); INSTRUCTION( illegal ) INSTRUCTION( clr_R1 ) INSTRUCTION( clr_IR1 ) @@ -277,7 +277,7 @@ private: INSTRUCTION( srp_IM ) #undef INSTRUCTION - typedef void (z8_device::*z8_opcode_func) (UINT8 opcode, int *cycles); + typedef void (z8_device::*z8_opcode_func) (uint8_t opcode, int *cycles); struct z8_opcode_map { z8_opcode_func function; @@ -292,21 +292,21 @@ private: class z8601_device : public z8_device { public: - z8601_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + z8601_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); }; class ub8830d_device : public z8_device { public: - ub8830d_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + ub8830d_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); }; class z8611_device : public z8_device { public: - z8611_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + z8611_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); }; diff --git a/src/devices/cpu/z8/z8dasm.cpp b/src/devices/cpu/z8/z8dasm.cpp index 3801ca5c34b..3b342d98628 100644 --- a/src/devices/cpu/z8/z8dasm.cpp +++ b/src/devices/cpu/z8/z8dasm.cpp @@ -68,7 +68,7 @@ static const char *const CONDITION_CODE[16] = #define arg_IR(_value) if ((_value & 0xf0) == 0xe0) ARG(Ir, _value & 0x0f) else ARG(IR, _value) #define arg_IRR(_value) if ((_value & 0xf0) == 0xe0) ARG(Irr, _value & 0x0f) else ARG(IRR, _value) #define arg_IM(_value) ARG(IM, _value) -#define arg_RA ARG(RA, pc + (INT8)B0 + 2) +#define arg_RA ARG(RA, pc + (int8_t)B0 + 2) #define arg_DA ARG(DA, B0 << 8 | B1) #define arg_X(_value1, _value2) { if (argc) dst += sprintf(dst, ", "); dst += sprintf(dst, X, _value1, _value2); argc++; } @@ -84,9 +84,9 @@ static const char *const CONDITION_CODE[16] = CPU_DISASSEMBLE( z8 ) { - const UINT8 *startrom = oprom; - UINT32 flags = 0; - UINT8 opcode = *oprom++; + const uint8_t *startrom = oprom; + uint32_t flags = 0; + uint8_t opcode = *oprom++; char *dst = buffer; int argc = 0; diff --git a/src/devices/cpu/z8/z8ops.hxx b/src/devices/cpu/z8/z8ops.hxx index 4c522791b8e..48d0b226859 100644 --- a/src/devices/cpu/z8/z8ops.hxx +++ b/src/devices/cpu/z8/z8ops.hxx @@ -20,96 +20,96 @@ #define flag(_flag) ((m_r[Z8_REGISTER_FLAGS] & Z8_FLAGS##_##_flag) ? 1 : 0) #define mode_r1_r2(_func) \ - UINT8 dst_src = fetch();\ - UINT8 dst = r(dst_src >> 4);\ - UINT8 src = read(r(dst_src & 0x0f));\ + uint8_t dst_src = fetch();\ + uint8_t dst = r(dst_src >> 4);\ + uint8_t src = read(r(dst_src & 0x0f));\ _func(dst, src); #define mode_r1_Ir2(_func) \ - UINT8 dst_src = fetch();\ - UINT8 dst = r(dst_src >> 4);\ - UINT8 src = read(Ir(dst_src & 0x0f));\ + uint8_t dst_src = fetch();\ + uint8_t dst = r(dst_src >> 4);\ + uint8_t src = read(Ir(dst_src & 0x0f));\ _func(dst, src); #define mode_R2_R1(_func) \ - UINT8 src = read(R);\ - UINT8 dst = R;\ + uint8_t src = read(R);\ + uint8_t dst = R;\ _func(dst, src); #define mode_IR2_R1(_func) \ - UINT8 src = read(R);\ - UINT8 dst = IR;\ + uint8_t src = read(R);\ + uint8_t dst = IR;\ _func(dst, src); #define mode_R1_IM(_func) \ - UINT8 dst = R;\ - UINT8 src = IM;\ + uint8_t dst = R;\ + uint8_t src = IM;\ _func(dst, src); #define mode_IR1_IM(_func) \ - UINT8 dst = IR;\ - UINT8 src = IM;\ + uint8_t dst = IR;\ + uint8_t src = IM;\ _func(dst, src); #define mode_r1(_func) \ - UINT8 dst = r(opcode >> 4);\ + uint8_t dst = r(opcode >> 4);\ _func(dst); #define mode_R1(_func) \ - UINT8 dst = R;\ + uint8_t dst = R;\ _func(dst); #define mode_RR1(_func) \ - UINT8 dst = R;\ + uint8_t dst = R;\ _func(dst); #define mode_IR1(_func) \ - UINT8 dst = IR;\ + uint8_t dst = IR;\ _func(dst); #define mode_r1_IM(_func) \ - UINT8 dst = r(opcode >> 4);\ - UINT8 src = IM;\ + uint8_t dst = r(opcode >> 4);\ + uint8_t src = IM;\ _func(dst, src); #define mode_r1_R2(_func) \ - UINT8 dst = r(opcode >> 4);\ - UINT8 src = read(R);\ + uint8_t dst = r(opcode >> 4);\ + uint8_t src = read(R);\ _func(dst, src); #define mode_r2_R1(_func) \ - UINT8 src = read(r(opcode >> 4));\ - UINT8 dst = R;\ + uint8_t src = read(r(opcode >> 4));\ + uint8_t dst = R;\ _func(dst, src); #define mode_Ir1_r2(_func) \ - UINT8 dst_src = fetch();\ - UINT8 dst = Ir(dst_src >> 4);\ - UINT8 src = read(r(dst_src & 0x0f));\ + uint8_t dst_src = fetch();\ + uint8_t dst = Ir(dst_src >> 4);\ + uint8_t src = read(r(dst_src & 0x0f));\ _func(dst, src); #define mode_R2_IR1(_func) \ - UINT8 src = read(R);\ - UINT8 dst = IR;\ + uint8_t src = read(R);\ + uint8_t dst = IR;\ _func(dst, src); #define mode_r1_x_R2(_func) \ - UINT8 dst_src = fetch();\ - UINT8 dst = r(dst_src >> 4);\ - UINT8 src = read(read(r(dst_src & 0x0f)) + R);\ + uint8_t dst_src = fetch();\ + uint8_t dst = r(dst_src >> 4);\ + uint8_t src = read(read(r(dst_src & 0x0f)) + R);\ _func(dst, src); #define mode_r2_x_R1(_func) \ - UINT8 dst_src = fetch();\ - UINT8 dst = R + read(r(dst_src & 0x0f));\ - UINT8 src = read(r(dst_src >> 4));\ + uint8_t dst_src = fetch();\ + uint8_t dst = R + read(r(dst_src & 0x0f));\ + uint8_t src = read(r(dst_src >> 4));\ _func(dst, src); /*************************************************************************** LOAD INSTRUCTIONS ***************************************************************************/ -void z8_device::clear(UINT8 dst) +void z8_device::clear(uint8_t dst) { /* dst <- 0 */ register_write(dst, 0); @@ -118,7 +118,7 @@ void z8_device::clear(UINT8 dst) INSTRUCTION( clr_R1 ) { mode_R1(clear) } INSTRUCTION( clr_IR1 ) { mode_IR1(clear) } -void z8_device::load(UINT8 dst, UINT8 src) +void z8_device::load(uint8_t dst, uint8_t src) { /* dst <- src */ register_write(dst, src); @@ -141,37 +141,37 @@ INSTRUCTION( ld_IR1_IM ) { mode_IR1_IM(load) } void z8_device::load_from_memory(address_space *space) { - UINT8 operands = fetch(); - UINT8 dst = get_working_register(operands >> 4); - UINT8 src = get_working_register(operands & 0x0f); + uint8_t operands = fetch(); + uint8_t dst = get_working_register(operands >> 4); + uint8_t src = get_working_register(operands & 0x0f); - UINT16 address = register_pair_read(src); - UINT8 data = m_direct->read_byte(address); + uint16_t address = register_pair_read(src); + uint8_t data = m_direct->read_byte(address); register_write(dst, data); } void z8_device::load_to_memory(address_space *space) { - UINT8 operands = fetch(); - UINT8 src = get_working_register(operands >> 4); - UINT8 dst = get_working_register(operands & 0x0f); + uint8_t operands = fetch(); + uint8_t src = get_working_register(operands >> 4); + uint8_t dst = get_working_register(operands & 0x0f); - UINT16 address = register_pair_read(dst); - UINT8 data = register_read(src); + uint16_t address = register_pair_read(dst); + uint8_t data = register_read(src); m_program->write_byte(address, data); } void z8_device::load_from_memory_autoinc(address_space *space) { - UINT8 operands = fetch(); - UINT8 dst = get_working_register(operands >> 4); - UINT8 real_dst = get_intermediate_register(dst); - UINT8 src = get_working_register(operands & 0x0f); + uint8_t operands = fetch(); + uint8_t dst = get_working_register(operands >> 4); + uint8_t real_dst = get_intermediate_register(dst); + uint8_t src = get_working_register(operands & 0x0f); - UINT16 address = register_pair_read(src); - UINT8 data = m_direct->read_byte(address); + uint16_t address = register_pair_read(src); + uint8_t data = m_direct->read_byte(address); register_write(real_dst, data); @@ -181,13 +181,13 @@ void z8_device::load_from_memory_autoinc(address_space *space) void z8_device::load_to_memory_autoinc(address_space *space) { - UINT8 operands = fetch(); - UINT8 src = get_working_register(operands >> 4); - UINT8 dst = get_working_register(operands & 0x0f); - UINT8 real_src = get_intermediate_register(src); + uint8_t operands = fetch(); + uint8_t src = get_working_register(operands >> 4); + uint8_t dst = get_working_register(operands & 0x0f); + uint8_t real_src = get_intermediate_register(src); - UINT16 address = register_pair_read(dst); - UINT8 data = register_read(real_src); + uint16_t address = register_pair_read(dst); + uint8_t data = register_read(real_src); m_program->write_byte(address, data); @@ -204,7 +204,7 @@ INSTRUCTION( lde_r2_Irr1 ) { load_to_memory(m_data); } INSTRUCTION( ldei_Ir1_Irr2 ) { load_from_memory_autoinc(m_data); } INSTRUCTION( ldei_Ir2_Irr1 ) { load_to_memory_autoinc(m_data); } -void z8_device::pop(UINT8 dst) +void z8_device::pop(uint8_t dst) { /* dst <- @SP SP <- SP + 1 */ @@ -214,7 +214,7 @@ void z8_device::pop(UINT8 dst) INSTRUCTION( pop_R1 ) { mode_R1(pop) } INSTRUCTION( pop_IR1 ) { mode_IR1(pop) } -void z8_device::push(UINT8 src) +void z8_device::push(uint8_t src) { /* SP <- SP - 1 @SP <- src */ @@ -228,11 +228,11 @@ INSTRUCTION( push_IR2 ) { mode_IR1(push) } ARITHMETIC INSTRUCTIONS ***************************************************************************/ -void z8_device::add_carry(UINT8 dst, INT8 src) +void z8_device::add_carry(uint8_t dst, int8_t src) { /* dst <- dst + src + C */ - UINT8 data = register_read(dst); - UINT16 new_data = data + src + flag(C); + uint8_t data = register_read(dst); + uint16_t new_data = data + src + flag(C); set_flag_c(new_data & 0x100); set_flag_z(new_data == 0); @@ -251,11 +251,11 @@ INSTRUCTION( adc_IR2_R1 ) { mode_IR2_R1(add_carry) } INSTRUCTION( adc_R1_IM ) { mode_R1_IM(add_carry) } INSTRUCTION( adc_IR1_IM ) { mode_IR1_IM(add_carry) } -void z8_device::add(UINT8 dst, INT8 src) +void z8_device::add(uint8_t dst, int8_t src) { /* dst <- dst + src */ - UINT8 data = register_read(dst); - UINT16 new_data = data + src; + uint8_t data = register_read(dst); + uint16_t new_data = data + src; set_flag_c(new_data & 0x100); set_flag_z(new_data == 0); @@ -274,11 +274,11 @@ INSTRUCTION( add_IR2_R1 ) { mode_IR2_R1(add) } INSTRUCTION( add_R1_IM ) { mode_R1_IM(add) } INSTRUCTION( add_IR1_IM ) { mode_IR1_IM(add) } -void z8_device::compare(UINT8 dst, UINT8 src) +void z8_device::compare(uint8_t dst, uint8_t src) { /* dst - src */ - UINT8 data = register_read(dst); - UINT16 new_data = data - src; + uint8_t data = register_read(dst); + uint16_t new_data = data - src; set_flag_c(!(new_data & 0x100)); set_flag_z(new_data == 0); @@ -293,17 +293,17 @@ INSTRUCTION( cp_IR2_R1 ) { mode_IR2_R1(compare) } INSTRUCTION( cp_R1_IM ) { mode_R1_IM(compare) } INSTRUCTION( cp_IR1_IM ) { mode_IR1_IM(compare) } -void z8_device::decimal_adjust(UINT8 dst) +void z8_device::decimal_adjust(uint8_t dst) { } INSTRUCTION( da_R1 ) { mode_R1(decimal_adjust) } INSTRUCTION( da_IR1 ) { mode_IR1(decimal_adjust) } -void z8_device::decrement(UINT8 dst) +void z8_device::decrement(uint8_t dst) { /* dst <- dst - 1 */ - UINT8 data = register_read(dst) - 1; + uint8_t data = register_read(dst) - 1; set_flag_z(data == 0); set_flag_s(data & 0x80); @@ -315,10 +315,10 @@ void z8_device::decrement(UINT8 dst) INSTRUCTION( dec_R1 ) { mode_R1(decrement) } INSTRUCTION( dec_IR1 ) { mode_IR1(decrement) } -void z8_device::decrement_word(UINT8 dst) +void z8_device::decrement_word(uint8_t dst) { /* dst <- dst - 1 */ - UINT16 data = register_pair_read(dst) - 1; + uint16_t data = register_pair_read(dst) - 1; set_flag_z(data == 0); set_flag_s(data & 0x8000); @@ -330,10 +330,10 @@ void z8_device::decrement_word(UINT8 dst) INSTRUCTION( decw_RR1 ) { mode_RR1(decrement_word) } INSTRUCTION( decw_IR1 ) { mode_IR1(decrement_word) } -void z8_device::increment(UINT8 dst) +void z8_device::increment(uint8_t dst) { /* dst <- dst + 1 */ - UINT8 data = register_read(dst) + 1; + uint8_t data = register_read(dst) + 1; set_flag_z(data == 0); set_flag_s(data & 0x80); @@ -346,10 +346,10 @@ INSTRUCTION( inc_r1 ) { mode_r1(increment) } INSTRUCTION( inc_R1 ) { mode_R1(increment) } INSTRUCTION( inc_IR1 ) { mode_IR1(increment) } -void z8_device::increment_word(UINT8 dst) +void z8_device::increment_word(uint8_t dst) { /* dst <- dst + 1 */ - UINT16 data = register_pair_read(dst) + 1; + uint16_t data = register_pair_read(dst) + 1; set_flag_z(data == 0); set_flag_s(data & 0x8000); @@ -361,11 +361,11 @@ void z8_device::increment_word(UINT8 dst) INSTRUCTION( incw_RR1 ) { mode_RR1(increment_word) } INSTRUCTION( incw_IR1 ) { mode_IR1(increment_word) } -void z8_device::subtract_carry(UINT8 dst, UINT8 src) +void z8_device::subtract_carry(uint8_t dst, uint8_t src) { /* dst <- dst - src - C */ - UINT8 data = register_read(dst); - UINT16 new_data = data - src; + uint8_t data = register_read(dst); + uint16_t new_data = data - src; set_flag_c(!(new_data & 0x100)); set_flag_z(new_data == 0); @@ -384,11 +384,11 @@ INSTRUCTION( sbc_IR2_R1 ) { mode_IR2_R1(subtract_carry) } INSTRUCTION( sbc_R1_IM ) { mode_R1_IM(subtract_carry) } INSTRUCTION( sbc_IR1_IM ) { mode_IR1_IM(subtract_carry) } -void z8_device::subtract(UINT8 dst, UINT8 src) +void z8_device::subtract(uint8_t dst, uint8_t src) { /* dst <- dst - src */ - UINT8 data = register_read(dst); - UINT16 new_data = data - src; + uint8_t data = register_read(dst); + uint16_t new_data = data - src; set_flag_c(!(new_data & 0x100)); set_flag_z(new_data == 0); @@ -411,10 +411,10 @@ INSTRUCTION( sub_IR1_IM ) { mode_IR1_IM(subtract) } LOGICAL INSTRUCTIONS ***************************************************************************/ -void z8_device::_and(UINT8 dst, UINT8 src) +void z8_device::_and(uint8_t dst, uint8_t src) { /* dst <- dst AND src */ - UINT8 data = register_read(dst) & src; + uint8_t data = register_read(dst) & src; register_write(dst, data); set_flag_z(data == 0); @@ -429,10 +429,10 @@ INSTRUCTION( and_IR2_R1 ) { mode_IR2_R1(_and) } INSTRUCTION( and_R1_IM ) { mode_R1_IM(_and) } INSTRUCTION( and_IR1_IM ) { mode_IR1_IM(_and) } -void z8_device::complement(UINT8 dst) +void z8_device::complement(uint8_t dst) { /* dst <- NOT dst */ - UINT8 data = register_read(dst) ^ 0xff; + uint8_t data = register_read(dst) ^ 0xff; register_write(dst, data); set_flag_z(data == 0); @@ -443,10 +443,10 @@ void z8_device::complement(UINT8 dst) INSTRUCTION( com_R1 ) { mode_R1(complement) } INSTRUCTION( com_IR1 ) { mode_IR1(complement) } -void z8_device::_or(UINT8 dst, UINT8 src) +void z8_device::_or(uint8_t dst, uint8_t src) { /* dst <- dst OR src */ - UINT8 data = register_read(dst) | src; + uint8_t data = register_read(dst) | src; register_write(dst, data); set_flag_z(data == 0); @@ -461,10 +461,10 @@ INSTRUCTION( or_IR2_R1 ) { mode_IR2_R1(_or) } INSTRUCTION( or_R1_IM ) { mode_R1_IM(_or) } INSTRUCTION( or_IR1_IM ) { mode_IR1_IM(_or) } -void z8_device::_xor(UINT8 dst, UINT8 src) +void z8_device::_xor(uint8_t dst, uint8_t src) { /* dst <- dst XOR src */ - UINT8 data = register_read(dst) ^ src; + uint8_t data = register_read(dst) ^ src; register_write(dst, data); set_flag_z(data == 0); @@ -483,22 +483,22 @@ INSTRUCTION( xor_IR1_IM ) { mode_IR1_IM(_xor) } PROGRAM CONTROL INSTRUCTIONS ***************************************************************************/ -void z8_device::call(UINT16 dst) +void z8_device::call(uint16_t dst) { stack_push_word(m_pc); m_pc = dst; } -INSTRUCTION( call_IRR1 ) { UINT16 dst = register_pair_read(get_intermediate_register(get_register(fetch()))); call(dst); } -INSTRUCTION( call_DA ) { UINT16 dst = (fetch() << 8) | fetch(); call(dst); } +INSTRUCTION( call_IRR1 ) { uint16_t dst = register_pair_read(get_intermediate_register(get_register(fetch()))); call(dst); } +INSTRUCTION( call_DA ) { uint16_t dst = (fetch() << 8) | fetch(); call(dst); } INSTRUCTION( djnz_r1_RA ) { - INT8 ra = (INT8)fetch(); + int8_t ra = (int8_t)fetch(); /* r <- r - 1 */ int r = get_working_register(opcode >> 4); - UINT8 data = register_read(r) - 1; + uint8_t data = register_read(r) - 1; register_write(r, data); /* if r<>0, PC <- PC + dst */ @@ -530,7 +530,7 @@ INSTRUCTION( ret ) m_pc = stack_pop_word(); } -void z8_device::jump(UINT16 dst) +void z8_device::jump(uint16_t dst) { /* PC <- dst */ m_pc = dst; @@ -567,7 +567,7 @@ int z8_device::check_condition_code(int cc) INSTRUCTION( jp_cc_DA ) { - UINT16 dst = (fetch() << 8) | fetch(); + uint16_t dst = (fetch() << 8) | fetch(); /* if cc is true, then PC <- dst */ if (check_condition_code(opcode >> 4)) @@ -579,8 +579,8 @@ INSTRUCTION( jp_cc_DA ) INSTRUCTION( jr_cc_RA ) { - INT8 ra = (INT8)fetch(); - UINT16 dst = m_pc + ra; + int8_t ra = (int8_t)fetch(); + uint16_t dst = m_pc + ra; /* if cc is true, then PC <- dst */ if (check_condition_code(opcode >> 4)) @@ -594,10 +594,10 @@ INSTRUCTION( jr_cc_RA ) BIT MANIPULATION INSTRUCTIONS ***************************************************************************/ -void z8_device::test_complement_under_mask(UINT8 dst, UINT8 src) +void z8_device::test_complement_under_mask(uint8_t dst, uint8_t src) { /* NOT(dst) AND src */ - UINT8 data = (register_read(dst) ^ 0xff) & src; + uint8_t data = (register_read(dst) ^ 0xff) & src; set_flag_z(data == 0); set_flag_s(data & 0x80); @@ -611,10 +611,10 @@ INSTRUCTION( tcm_IR2_R1 ) { mode_IR2_R1(test_complement_under_mask) } INSTRUCTION( tcm_R1_IM ) { mode_R1_IM(test_complement_under_mask) } INSTRUCTION( tcm_IR1_IM ) { mode_IR1_IM(test_complement_under_mask) } -void z8_device::test_under_mask(UINT8 dst, UINT8 src) +void z8_device::test_under_mask(uint8_t dst, uint8_t src) { /* dst AND src */ - UINT8 data = register_read(dst) & src; + uint8_t data = register_read(dst) & src; set_flag_z(data == 0); set_flag_s(data & 0x80); @@ -632,11 +632,11 @@ INSTRUCTION( tm_IR1_IM ) { mode_IR1_IM(test_under_mask) } ROTATE AND SHIFT INSTRUCTIONS ***************************************************************************/ -void z8_device::rotate_left(UINT8 dst) +void z8_device::rotate_left(uint8_t dst) { /* << */ - UINT8 data = register_read(dst); - UINT8 new_data = (data << 1) | BIT(data, 7); + uint8_t data = register_read(dst); + uint8_t new_data = (data << 1) | BIT(data, 7); set_flag_c(data & 0x80); set_flag_z(data == 0); @@ -649,11 +649,11 @@ void z8_device::rotate_left(UINT8 dst) INSTRUCTION( rl_R1 ) { mode_R1(rotate_left) } INSTRUCTION( rl_IR1 ) { mode_IR1(rotate_left) } -void z8_device::rotate_left_carry(UINT8 dst) +void z8_device::rotate_left_carry(uint8_t dst) { /* << C */ - UINT8 data = register_read(dst); - UINT8 new_data = (data << 1) | flag(C); + uint8_t data = register_read(dst); + uint8_t new_data = (data << 1) | flag(C); set_flag_c(data & 0x80); set_flag_z(data == 0); @@ -666,11 +666,11 @@ void z8_device::rotate_left_carry(UINT8 dst) INSTRUCTION( rlc_R1 ) { mode_R1(rotate_left_carry) } INSTRUCTION( rlc_IR1 ) { mode_IR1(rotate_left_carry) } -void z8_device::rotate_right(UINT8 dst) +void z8_device::rotate_right(uint8_t dst) { /* >> */ - UINT8 data = register_read(dst); - UINT8 new_data = ((data & 0x01) << 7) | (data >> 1); + uint8_t data = register_read(dst); + uint8_t new_data = ((data & 0x01) << 7) | (data >> 1); set_flag_c(data & 0x01); set_flag_z(data == 0); @@ -683,11 +683,11 @@ void z8_device::rotate_right(UINT8 dst) INSTRUCTION( rr_R1 ) { mode_R1(rotate_right) } INSTRUCTION( rr_IR1 ) { mode_IR1(rotate_right) } -void z8_device::rotate_right_carry(UINT8 dst) +void z8_device::rotate_right_carry(uint8_t dst) { /* >> C */ - UINT8 data = register_read(dst); - UINT8 new_data = (flag(C) << 7) | (data >> 1); + uint8_t data = register_read(dst); + uint8_t new_data = (flag(C) << 7) | (data >> 1); set_flag_c(data & 0x01); set_flag_z(data == 0); @@ -700,11 +700,11 @@ void z8_device::rotate_right_carry(UINT8 dst) INSTRUCTION( rrc_R1 ) { mode_R1(rotate_right_carry) } INSTRUCTION( rrc_IR1 ) { mode_IR1(rotate_right_carry) } -void z8_device::shift_right_arithmetic(UINT8 dst) +void z8_device::shift_right_arithmetic(uint8_t dst) { /* */ - UINT8 data = register_read(dst); - UINT8 new_data = (data & 0x80) | ((data >> 1) & 0x7f); + uint8_t data = register_read(dst); + uint8_t new_data = (data & 0x80) | ((data >> 1) & 0x7f); set_flag_c(data & 0x01); set_flag_z(data == 0); @@ -717,10 +717,10 @@ void z8_device::shift_right_arithmetic(UINT8 dst) INSTRUCTION( sra_R1 ) { mode_R1(shift_right_arithmetic) } INSTRUCTION( sra_IR1 ) { mode_IR1(shift_right_arithmetic) } -void z8_device::swap(UINT8 dst) +void z8_device::swap(uint8_t dst) { /* dst(7-4) <-> dst(3-0) */ - UINT8 data = register_read(dst); + uint8_t data = register_read(dst); data = (data << 4) | (data >> 4); register_write(dst, data); diff --git a/src/devices/cpu/z80/kl5c80a12.cpp b/src/devices/cpu/z80/kl5c80a12.cpp index 7d6cdf70538..1fa24b2365a 100644 --- a/src/devices/cpu/z80/kl5c80a12.cpp +++ b/src/devices/cpu/z80/kl5c80a12.cpp @@ -18,7 +18,7 @@ const device_type KL5C80A12 = &device_creator; -kl5c80a12_device::kl5c80a12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kl5c80a12_device::kl5c80a12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80_device(mconfig, KL5C80A12, "KL5C80A12", tag, owner, clock, "kl5c80a12", __FILE__) { } diff --git a/src/devices/cpu/z80/kl5c80a12.h b/src/devices/cpu/z80/kl5c80a12.h index 7ad3e16ca85..8ca3aadc146 100644 --- a/src/devices/cpu/z80/kl5c80a12.h +++ b/src/devices/cpu/z80/kl5c80a12.h @@ -35,7 +35,7 @@ class kl5c80a12_device : public z80_device { public: - kl5c80a12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + kl5c80a12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); // static configuration helpers diff --git a/src/devices/cpu/z80/tmpz84c011.cpp b/src/devices/cpu/z80/tmpz84c011.cpp index 428dd924c71..970db6624bd 100644 --- a/src/devices/cpu/z80/tmpz84c011.cpp +++ b/src/devices/cpu/z80/tmpz84c011.cpp @@ -30,7 +30,7 @@ static ADDRESS_MAP_START( tmpz84c011_internal_io_map, AS_IO, 8, tmpz84c011_devic ADDRESS_MAP_END -tmpz84c011_device::tmpz84c011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmpz84c011_device::tmpz84c011_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80_device(mconfig, TMPZ84C011, "TMPZ84C011", tag, owner, clock, "tmpz84c011", __FILE__), m_io_space_config( "io", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME( tmpz84c011_internal_io_map ) ), m_ctc(*this, "tmpz84c011_ctc"), diff --git a/src/devices/cpu/z80/tmpz84c011.h b/src/devices/cpu/z80/tmpz84c011.h index ffb5cdbd96f..bd9a77dca4e 100644 --- a/src/devices/cpu/z80/tmpz84c011.h +++ b/src/devices/cpu/z80/tmpz84c011.h @@ -75,7 +75,7 @@ class tmpz84c011_device : public z80_device { public: - tmpz84c011_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + tmpz84c011_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); // static configuration helpers template static devcb_base &set_zc0_callback(device_t &device, _Object object) { return downcast(device).m_zc0_cb.set_callback(object); } @@ -150,8 +150,8 @@ private: required_device m_ctc; // internal state - UINT8 m_pio_dir[5]; - UINT8 m_pio_latch[5]; + uint8_t m_pio_dir[5]; + uint8_t m_pio_latch[5]; // callbacks devcb_write8 m_outportsa; diff --git a/src/devices/cpu/z80/tmpz84c015.cpp b/src/devices/cpu/z80/tmpz84c015.cpp index 3586001e2c6..19a7279f31f 100644 --- a/src/devices/cpu/z80/tmpz84c015.cpp +++ b/src/devices/cpu/z80/tmpz84c015.cpp @@ -24,7 +24,7 @@ static ADDRESS_MAP_START( tmpz84c015_internal_io_map, AS_IO, 8, tmpz84c015_devic ADDRESS_MAP_END -tmpz84c015_device::tmpz84c015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmpz84c015_device::tmpz84c015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80_device(mconfig, TMPZ84C015, "TMPZ84C015", tag, owner, clock, "tmpz84c015", __FILE__), m_io_space_config( "io", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME( tmpz84c015_internal_io_map ) ), m_ctc(*this, "tmpz84c015_ctc"), @@ -125,7 +125,7 @@ void tmpz84c015_device::device_reset() void tmpz84c015_device::device_post_load() { // reinit irq priority - UINT8 prio = m_irq_priority; + uint8_t prio = m_irq_priority; m_irq_priority = -1; irq_priority_w(*m_io, 0, prio); } diff --git a/src/devices/cpu/z80/tmpz84c015.h b/src/devices/cpu/z80/tmpz84c015.h index 2578f6a92ef..4efab045f24 100644 --- a/src/devices/cpu/z80/tmpz84c015.h +++ b/src/devices/cpu/z80/tmpz84c015.h @@ -105,7 +105,7 @@ class tmpz84c015_device : public z80_device { public: - tmpz84c015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); + tmpz84c015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t); // static configuration helpers template static devcb_base &set_out_txda_callback(device_t &device, _Object object) { return downcast(device).m_out_txda_cb.set_callback(object); } @@ -229,7 +229,7 @@ private: required_device m_pio; // internal state - UINT8 m_irq_priority; + uint8_t m_irq_priority; // callbacks devcb_write_line m_out_txda_cb; diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp index 6b72570a63c..a23dfbe4bf6 100644 --- a/src/devices/cpu/z80/z80.cpp +++ b/src/devices/cpu/z80/z80.cpp @@ -96,7 +96,7 @@ * now also adjust the r register depending on the skipped opcodes. * Changes in 2.2: * - Fixed bugs in CPL, SCF and CCF instructions flag handling. - * - Changed variable ea and arg16() function to UINT32; this + * - Changed variable ea and arg16() function to uint32_t; this * produces slightly more efficient code. * - The DD/FD XY CB opcodes where XY is 40-7F and Y is not 6/E * are changed to calls to the X6/XE opcodes to reduce object size. @@ -183,16 +183,16 @@ static bool tables_initialised = false; -static UINT8 SZ[256]; /* zero and sign flags */ -static UINT8 SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ -static UINT8 SZP[256]; /* zero, sign and parity flags */ -static UINT8 SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ -static UINT8 SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ +static uint8_t SZ[256]; /* zero and sign flags */ +static uint8_t SZ_BIT[256]; /* zero, sign and parity/overflow (=zero) flags for BIT opcode */ +static uint8_t SZP[256]; /* zero, sign and parity flags */ +static uint8_t SZHV_inc[256]; /* zero, sign, half carry and overflow flags INC r8 */ +static uint8_t SZHV_dec[256]; /* zero, sign, half carry and overflow flags DEC r8 */ -static UINT8 SZHVC_add[2*256*256]; -static UINT8 SZHVC_sub[2*256*256]; +static uint8_t SZHVC_add[2*256*256]; +static uint8_t SZHVC_sub[2*256*256]; -static const UINT8 cc_op[0x100] = { +static const uint8_t cc_op[0x100] = { 4,10, 7, 6, 4, 4, 7, 4, 4,11, 7, 6, 4, 4, 7, 4, 8,10, 7, 6, 4, 4, 7, 4,12,11, 7, 6, 4, 4, 7, 4, 7,10,16, 6, 4, 4, 7, 4, 7,11,16, 6, 4, 4, 7, 4, @@ -211,7 +211,7 @@ static const UINT8 cc_op[0x100] = { 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 0, 7,11 /* fd -> cc_xy */ }; -static const UINT8 cc_cb[0x100] = { +static const uint8_t cc_cb[0x100] = { 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, @@ -230,7 +230,7 @@ static const UINT8 cc_cb[0x100] = { 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8 }; -static const UINT8 cc_ed[0x100] = { +static const uint8_t cc_ed[0x100] = { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, @@ -250,7 +250,7 @@ static const UINT8 cc_ed[0x100] = { }; /* ix/iy: with the exception of (i+offset) opcodes, t-states are main_opcode_table + 4 */ -static const UINT8 cc_xy[0x100] = { +static const uint8_t cc_xy[0x100] = { 4+4,10+4, 7+4, 6+4, 4+4, 4+4, 7+4, 4+4, 4+4,11+4, 7+4, 6+4, 4+4, 4+4, 7+4, 4+4, 8+4,10+4, 7+4, 6+4, 4+4, 4+4, 7+4, 4+4,12+4,11+4, 7+4, 6+4, 4+4, 4+4, 7+4, 4+4, 7+4,10+4,16+4, 6+4, 4+4, 4+4, 7+4, 4+4, 7+4,11+4,16+4, 6+4, 4+4, 4+4, 7+4, 4+4, @@ -269,7 +269,7 @@ static const UINT8 cc_xy[0x100] = { 5+4,10+4,10+4, 4+4,10+4,11+4, 7+4,11+4, 5+4, 6+4,10+4, 4+4,10+4, 4 , 7+4,11+4 /* fd -> cc_xy again */ }; -static const UINT8 cc_xycb[0x100] = { +static const uint8_t cc_xycb[0x100] = { 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, @@ -289,7 +289,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 */ @@ -417,7 +417,7 @@ inline void z80_device::leave_halt() /*************************************************************** * Input a byte from given I/O port ***************************************************************/ -inline UINT8 z80_device::in(UINT16 port) +inline uint8_t z80_device::in(uint16_t port) { return m_io->read_byte(port); } @@ -425,7 +425,7 @@ inline UINT8 z80_device::in(UINT16 port) /*************************************************************** * Output a byte to given I/O port ***************************************************************/ -inline void z80_device::out(UINT16 port, UINT8 value) +inline void z80_device::out(uint16_t port, uint8_t value) { m_io->write_byte(port, value); } @@ -433,7 +433,7 @@ inline void z80_device::out(UINT16 port, UINT8 value) /*************************************************************** * Read a byte from given memory location ***************************************************************/ -inline UINT8 z80_device::rm(UINT16 addr) +inline uint8_t z80_device::rm(uint16_t addr) { return m_program->read_byte(addr); } @@ -441,7 +441,7 @@ inline UINT8 z80_device::rm(UINT16 addr) /*************************************************************** * Read a word from given memory location ***************************************************************/ -inline void z80_device::rm16(UINT16 addr, PAIR &r) +inline void z80_device::rm16(uint16_t addr, PAIR &r) { r.b.l = rm(addr); r.b.h = rm((addr+1)); @@ -450,7 +450,7 @@ inline void z80_device::rm16(UINT16 addr, PAIR &r) /*************************************************************** * Write a byte to given memory location ***************************************************************/ -inline void z80_device::wm(UINT16 addr, UINT8 value) +inline void z80_device::wm(uint16_t addr, uint8_t value) { m_program->write_byte(addr, value); } @@ -458,7 +458,7 @@ inline void z80_device::wm(UINT16 addr, UINT8 value) /*************************************************************** * Write a word to given memory location ***************************************************************/ -inline void z80_device::wm16(UINT16 addr, PAIR &r) +inline void z80_device::wm16(uint16_t addr, PAIR &r) { wm(addr, r.b.l); wm((addr+1), r.b.h); @@ -469,11 +469,11 @@ inline void z80_device::wm16(UINT16 addr, PAIR &r) * reading opcodes. In case of system with memory mapped I/O, * this function can be used to greatly speed up emulation ***************************************************************/ -inline UINT8 z80_device::rop() +inline uint8_t z80_device::rop() { unsigned pc = PCD; PC++; - UINT8 res = m_decrypted_opcodes_direct->read_byte(pc); + uint8_t res = m_decrypted_opcodes_direct->read_byte(pc); m_icount -= 2; m_refresh_cb((m_i << 8) | (m_r2 & 0x80) | ((m_r-1) & 0x7f)); m_icount += 2; @@ -486,14 +486,14 @@ inline UINT8 z80_device::rop() * support systems that use different encoding mechanisms for * opcodes and opcode arguments ***************************************************************/ -inline UINT8 z80_device::arg() +inline uint8_t z80_device::arg() { unsigned pc = PCD; PC++; return m_direct->read_byte(pc); } -inline UINT16 z80_device::arg16() +inline uint16_t z80_device::arg16() { unsigned pc = PCD; PC += 2; @@ -506,13 +506,13 @@ inline UINT16 z80_device::arg16() ***************************************************************/ inline void z80_device::eax() { - m_ea = (UINT32)(UINT16)(IX + (INT8)arg()); + m_ea = (uint32_t)(uint16_t)(IX + (int8_t)arg()); WZ = m_ea; } inline void z80_device::eay() { - m_ea = (UINT32)(UINT16)(IY + (INT8)arg()); + m_ea = (uint32_t)(uint16_t)(IY + (int8_t)arg()); WZ = m_ea; } @@ -564,7 +564,7 @@ inline void z80_device::jp_cond(bool cond) ***************************************************************/ inline void z80_device::jr() { - INT8 a = (INT8)arg(); /* arg() also increments PC */ + int8_t a = (int8_t)arg(); /* arg() also increments PC */ PC += a; /* so don't do PC += arg() */ WZ = PC; } @@ -572,7 +572,7 @@ inline void z80_device::jr() /*************************************************************** * JR_COND ***************************************************************/ -inline void z80_device::jr_cond(bool cond, UINT8 opcode) +inline void z80_device::jr_cond(bool cond, uint8_t opcode) { if (cond) { @@ -597,7 +597,7 @@ inline void z80_device::call() /*************************************************************** * CALL_COND ***************************************************************/ -inline void z80_device::call_cond(bool cond, UINT8 opcode) +inline void z80_device::call_cond(bool cond, uint8_t opcode) { if (cond) { @@ -616,7 +616,7 @@ inline void z80_device::call_cond(bool cond, UINT8 opcode) /*************************************************************** * RET_COND ***************************************************************/ -inline void z80_device::ret_cond(bool cond, UINT8 opcode) +inline void z80_device::ret_cond(bool cond, uint8_t opcode) { if (cond) { @@ -689,7 +689,7 @@ inline void z80_device::ld_a_i() /*************************************************************** * RST ***************************************************************/ -inline void z80_device::rst(UINT16 addr) +inline void z80_device::rst(uint16_t addr) { push(m_pc); PCD = addr; @@ -699,19 +699,19 @@ inline void z80_device::rst(UINT16 addr) /*************************************************************** * INC r8 ***************************************************************/ -inline UINT8 z80_device::inc(UINT8 value) +inline uint8_t z80_device::inc(uint8_t value) { - UINT8 res = value + 1; + uint8_t res = value + 1; F = (F & CF) | SZHV_inc[res]; - return (UINT8)res; + return (uint8_t)res; } /*************************************************************** * DEC r8 ***************************************************************/ -inline UINT8 z80_device::dec(UINT8 value) +inline uint8_t z80_device::dec(uint8_t value) { - UINT8 res = value - 1; + uint8_t res = value - 1; F = (F & CF) | SZHV_dec[res]; return res; } @@ -740,8 +740,8 @@ inline void z80_device::rrca() ***************************************************************/ inline void z80_device::rla() { - UINT8 res = (A << 1) | (F & CF); - UINT8 c = (A & 0x80) ? CF : 0; + uint8_t res = (A << 1) | (F & CF); + uint8_t c = (A & 0x80) ? CF : 0; F = (F & (SF | ZF | PF)) | c | (res & (YF | XF)); A = res; } @@ -751,8 +751,8 @@ inline void z80_device::rla() ***************************************************************/ inline void z80_device::rra() { - UINT8 res = (A >> 1) | (F << 7); - UINT8 c = (A & 0x01) ? CF : 0; + uint8_t res = (A >> 1) | (F << 7); + uint8_t c = (A & 0x01) ? CF : 0; F = (F & (SF | ZF | PF)) | c | (res & (YF | XF)); A = res; } @@ -762,7 +762,7 @@ inline void z80_device::rra() ***************************************************************/ inline void z80_device::rrd() { - UINT8 n = rm(HL); + uint8_t n = rm(HL); WZ = HL+1; wm(HL, (n >> 4) | (A << 4)); A = (A & 0xf0) | (n & 0x0f); @@ -774,7 +774,7 @@ inline void z80_device::rrd() ***************************************************************/ inline void z80_device::rld() { - UINT8 n = rm(HL); + uint8_t n = rm(HL); WZ = HL+1; wm(HL, (n << 4) | (A & 0x0f)); A = (A & 0xf0) | (n >> 4); @@ -784,10 +784,10 @@ inline void z80_device::rld() /*************************************************************** * ADD A,n ***************************************************************/ -inline void z80_device::add_a(UINT8 value) +inline void z80_device::add_a(uint8_t value) { - UINT32 ah = AFD & 0xff00; - UINT32 res = (UINT8)((ah >> 8) + value); + uint32_t ah = AFD & 0xff00; + uint32_t res = (uint8_t)((ah >> 8) + value); F = SZHVC_add[ah | res]; A = res; } @@ -795,10 +795,10 @@ inline void z80_device::add_a(UINT8 value) /*************************************************************** * ADC A,n ***************************************************************/ -inline void z80_device::adc_a(UINT8 value) +inline void z80_device::adc_a(uint8_t value) { - UINT32 ah = AFD & 0xff00, c = AFD & 1; - UINT32 res = (UINT8)((ah >> 8) + value + c); + uint32_t ah = AFD & 0xff00, c = AFD & 1; + uint32_t res = (uint8_t)((ah >> 8) + value + c); F = SZHVC_add[(c << 16) | ah | res]; A = res; } @@ -806,10 +806,10 @@ inline void z80_device::adc_a(UINT8 value) /*************************************************************** * SUB n ***************************************************************/ -inline void z80_device::sub(UINT8 value) +inline void z80_device::sub(uint8_t value) { - UINT32 ah = AFD & 0xff00; - UINT32 res = (UINT8)((ah >> 8) - value); + uint32_t ah = AFD & 0xff00; + uint32_t res = (uint8_t)((ah >> 8) - value); F = SZHVC_sub[ah | res]; A = res; } @@ -817,10 +817,10 @@ inline void z80_device::sub(UINT8 value) /*************************************************************** * SBC A,n ***************************************************************/ -inline void z80_device::sbc_a(UINT8 value) +inline void z80_device::sbc_a(uint8_t value) { - UINT32 ah = AFD & 0xff00, c = AFD & 1; - UINT32 res = (UINT8)((ah >> 8) - value - c); + uint32_t ah = AFD & 0xff00, c = AFD & 1; + uint32_t res = (uint8_t)((ah >> 8) - value - c); F = SZHVC_sub[(c<<16) | ah | res]; A = res; } @@ -830,7 +830,7 @@ inline void z80_device::sbc_a(UINT8 value) ***************************************************************/ inline void z80_device::neg() { - UINT8 value = A; + uint8_t value = A; A = 0; sub(value); } @@ -840,7 +840,7 @@ inline void z80_device::neg() ***************************************************************/ inline void z80_device::daa() { - UINT8 a = A; + uint8_t a = A; if (F & NF) { if ((F&HF) | ((A&0xf)>9)) a-=6; if ((F&CF) | (A>0x99)) a-=0x60; @@ -857,7 +857,7 @@ inline void z80_device::daa() /*************************************************************** * AND n ***************************************************************/ -inline void z80_device::and_a(UINT8 value) +inline void z80_device::and_a(uint8_t value) { A &= value; F = SZP[A] | HF; @@ -866,7 +866,7 @@ inline void z80_device::and_a(UINT8 value) /*************************************************************** * OR n ***************************************************************/ -inline void z80_device::or_a(UINT8 value) +inline void z80_device::or_a(uint8_t value) { A |= value; F = SZP[A]; @@ -875,7 +875,7 @@ inline void z80_device::or_a(UINT8 value) /*************************************************************** * XOR n ***************************************************************/ -inline void z80_device::xor_a(UINT8 value) +inline void z80_device::xor_a(uint8_t value) { A ^= value; F = SZP[A]; @@ -884,11 +884,11 @@ inline void z80_device::xor_a(UINT8 value) /*************************************************************** * CP n ***************************************************************/ -inline void z80_device::cp(UINT8 value) +inline void z80_device::cp(uint8_t value) { unsigned val = value; - UINT32 ah = AFD & 0xff00; - UINT32 res = (UINT8)((ah >> 8) - val); + uint32_t ah = AFD & 0xff00; + uint32_t res = (uint8_t)((ah >> 8) - val); F = (SZHVC_sub[ah | res] & ~(YF | XF)) | (val & (YF | XF)); } @@ -939,12 +939,12 @@ inline void z80_device::ex_sp(PAIR &r) ***************************************************************/ inline void z80_device::add16(PAIR &dr, PAIR &sr) { - UINT32 res = dr.d + sr.d; + uint32_t res = dr.d + sr.d; WZ = dr.d + 1; F = (F & (SF | ZF | VF)) | (((dr.d ^ res ^ sr.d) >> 8) & HF) | ((res >> 16) & CF) | ((res >> 8) & (YF | XF)); - dr.w.l = (UINT16)res; + dr.w.l = (uint16_t)res; } /*************************************************************** @@ -952,14 +952,14 @@ inline void z80_device::add16(PAIR &dr, PAIR &sr) ***************************************************************/ inline void z80_device::adc_hl(PAIR &r) { - UINT32 res = HLD + r.d + (F & CF); + uint32_t res = HLD + r.d + (F & CF); WZ = HL + 1; F = (((HLD ^ res ^ r.d) >> 8) & HF) | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((r.d ^ HLD ^ 0x8000) & (r.d ^ res) & 0x8000) >> 13); - HL = (UINT16)res; + HL = (uint16_t)res; } /*************************************************************** @@ -967,20 +967,20 @@ inline void z80_device::adc_hl(PAIR &r) ***************************************************************/ inline void z80_device::sbc_hl(PAIR &r) { - UINT32 res = HLD - r.d - (F & CF); + uint32_t res = HLD - r.d - (F & CF); WZ = HL + 1; F = (((HLD ^ res ^ r.d) >> 8) & HF) | NF | ((res >> 16) & CF) | ((res >> 8) & (SF | YF | XF)) | ((res & 0xffff) ? 0 : ZF) | (((r.d ^ HLD) & (HLD ^ res) &0x8000) >> 13); - HL = (UINT16)res; + HL = (uint16_t)res; } /*************************************************************** * RLC r8 ***************************************************************/ -inline UINT8 z80_device::rlc(UINT8 value) +inline uint8_t z80_device::rlc(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -992,7 +992,7 @@ inline UINT8 z80_device::rlc(UINT8 value) /*************************************************************** * RRC r8 ***************************************************************/ -inline UINT8 z80_device::rrc(UINT8 value) +inline uint8_t z80_device::rrc(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -1004,7 +1004,7 @@ inline UINT8 z80_device::rrc(UINT8 value) /*************************************************************** * RL r8 ***************************************************************/ -inline UINT8 z80_device::rl(UINT8 value) +inline uint8_t z80_device::rl(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -1016,7 +1016,7 @@ inline UINT8 z80_device::rl(UINT8 value) /*************************************************************** * RR r8 ***************************************************************/ -inline UINT8 z80_device::rr(UINT8 value) +inline uint8_t z80_device::rr(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -1028,7 +1028,7 @@ inline UINT8 z80_device::rr(UINT8 value) /*************************************************************** * SLA r8 ***************************************************************/ -inline UINT8 z80_device::sla(UINT8 value) +inline uint8_t z80_device::sla(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -1040,7 +1040,7 @@ inline UINT8 z80_device::sla(UINT8 value) /*************************************************************** * SRA r8 ***************************************************************/ -inline UINT8 z80_device::sra(UINT8 value) +inline uint8_t z80_device::sra(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -1052,7 +1052,7 @@ inline UINT8 z80_device::sra(UINT8 value) /*************************************************************** * SLL r8 ***************************************************************/ -inline UINT8 z80_device::sll(UINT8 value) +inline uint8_t z80_device::sll(uint8_t value) { unsigned res = value; unsigned c = (res & 0x80) ? CF : 0; @@ -1064,7 +1064,7 @@ inline UINT8 z80_device::sll(UINT8 value) /*************************************************************** * SRL r8 ***************************************************************/ -inline UINT8 z80_device::srl(UINT8 value) +inline uint8_t z80_device::srl(uint8_t value) { unsigned res = value; unsigned c = (res & 0x01) ? CF : 0; @@ -1076,7 +1076,7 @@ inline UINT8 z80_device::srl(UINT8 value) /*************************************************************** * BIT bit,r8 ***************************************************************/ -inline void z80_device::bit(int bit, UINT8 value) +inline void z80_device::bit(int bit, uint8_t value) { F = (F & CF) | HF | (SZ_BIT[value & (1<>8) & (YF|XF)); } @@ -1100,7 +1100,7 @@ inline void z80_device::bit_xy(int bit, UINT8 value) /*************************************************************** * RES bit,r8 ***************************************************************/ -inline UINT8 z80_device::res(int bit, UINT8 value) +inline uint8_t z80_device::res(int bit, uint8_t value) { return value & ~(1< flag 5 */ @@ -1132,8 +1132,8 @@ inline void z80_device::ldi() ***************************************************************/ inline void z80_device::cpi() { - UINT8 val = rm(HL); - UINT8 res = A - val; + uint8_t val = rm(HL); + uint8_t res = A - val; WZ++; HL++; BC--; F = (F & CF) | (SZ[res]&~(YF|XF)) | ((A^val^res)&HF) | NF; @@ -1149,7 +1149,7 @@ inline void z80_device::cpi() inline void z80_device::ini() { unsigned t; - UINT8 io = in(BC); + uint8_t io = in(BC); WZ = BC + 1; B--; wm(HL, io); @@ -1158,7 +1158,7 @@ inline void z80_device::ini() t = (unsigned)((C + 1) & 0xff) + (unsigned)io; if (io & SF) F |= NF; if (t & 0x100) F |= HF | CF; - F |= SZP[(UINT8)(t & 0x07) ^ B] & PF; + F |= SZP[(uint8_t)(t & 0x07) ^ B] & PF; } /*************************************************************** @@ -1167,7 +1167,7 @@ inline void z80_device::ini() inline void z80_device::outi() { unsigned t; - UINT8 io = rm(HL); + uint8_t io = rm(HL); B--; WZ = BC + 1; out(BC, io); @@ -1176,7 +1176,7 @@ inline void z80_device::outi() t = (unsigned)L + (unsigned)io; if (io & SF) F |= NF; if (t & 0x100) F |= HF | CF; - F |= SZP[(UINT8)(t & 0x07) ^ B] & PF; + F |= SZP[(uint8_t)(t & 0x07) ^ B] & PF; } /*************************************************************** @@ -1184,7 +1184,7 @@ inline void z80_device::outi() ***************************************************************/ inline void z80_device::ldd() { - UINT8 io = rm(HL); + uint8_t io = rm(HL); wm(DE, io); F &= SF | ZF | CF; if ((A + io) & 0x02) F |= YF; /* bit 1 -> flag 5 */ @@ -1198,8 +1198,8 @@ inline void z80_device::ldd() ***************************************************************/ inline void z80_device::cpd() { - UINT8 val = rm(HL); - UINT8 res = A - val; + uint8_t val = rm(HL); + uint8_t res = A - val; WZ--; HL--; BC--; F = (F & CF) | (SZ[res]&~(YF|XF)) | ((A^val^res)&HF) | NF; @@ -1215,7 +1215,7 @@ inline void z80_device::cpd() inline void z80_device::ind() { unsigned t; - UINT8 io = in(BC); + uint8_t io = in(BC); WZ = BC - 1; B--; wm(HL, io); @@ -1224,7 +1224,7 @@ inline void z80_device::ind() t = ((unsigned)(C - 1) & 0xff) + (unsigned)io; if (io & SF) F |= NF; if (t & 0x100) F |= HF | CF; - F |= SZP[(UINT8)(t & 0x07) ^ B] & PF; + F |= SZP[(uint8_t)(t & 0x07) ^ B] & PF; } /*************************************************************** @@ -1233,7 +1233,7 @@ inline void z80_device::ind() inline void z80_device::outd() { unsigned t; - UINT8 io = rm(HL); + uint8_t io = rm(HL); B--; WZ = BC - 1; out(BC, io); @@ -1242,7 +1242,7 @@ inline void z80_device::outd() t = (unsigned)L + (unsigned)io; if (io & SF) F |= NF; if (t & 0x100) F |= HF | CF; - F |= SZP[(UINT8)(t & 0x07) ^ B] & PF; + F |= SZP[(uint8_t)(t & 0x07) ^ B] & PF; } /*************************************************************** @@ -2669,7 +2669,7 @@ OP(ed,6d) { reti(); } /* RETI OP(ed,6e) { m_im = 0; } /* IM 0 */ OP(ed,6f) { rld(); } /* RLD (HL) */ -OP(ed,70) { UINT8 res = in(BC); F = (F & CF) | SZP[res]; } /* IN 0,(C) */ +OP(ed,70) { uint8_t res = in(BC); F = (F & CF) | SZP[res]; } /* IN 0,(C) */ OP(ed,71) { out(BC, 0); } /* OUT (C),0 */ OP(ed,72) { sbc_hl(m_sp); } /* SBC HL,SP */ OP(ed,73) { m_ea = arg16(); wm16(m_ea, m_sp); WZ = m_ea + 1; } /* LD (w),SP */ @@ -3270,10 +3270,10 @@ void z80_device::device_start() { if( !tables_initialised ) { - UINT8 *padd = &SZHVC_add[ 0*256]; - UINT8 *padc = &SZHVC_add[256*256]; - UINT8 *psub = &SZHVC_sub[ 0*256]; - UINT8 *psbc = &SZHVC_sub[256*256]; + uint8_t *padd = &SZHVC_add[ 0*256]; + uint8_t *padc = &SZHVC_add[256*256]; + uint8_t *psub = &SZHVC_sub[ 0*256]; + uint8_t *psbc = &SZHVC_sub[256*256]; for (int oldval = 0; oldval < 256; oldval++) { for (int newval = 0; newval < 256; newval++) @@ -3669,7 +3669,7 @@ void z80_device::state_string_export(const device_state_entry &entry, std::strin // helper function //------------------------------------------------- -offs_t z80_device::disasm_disassemble( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options ) +offs_t z80_device::disasm_disassemble( char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options ) { extern CPU_DISASSEMBLE( z80 ); return CPU_DISASSEMBLE_NAME(z80)(this, buffer, pc, oprom, opram, options); @@ -3680,7 +3680,7 @@ offs_t z80_device::disasm_disassemble( char *buffer, offs_t pc, const UINT8 *opr * Generic set_info **************************************************************************/ -void z80_device::z80_set_cycle_tables(const UINT8 *op, const UINT8 *cb, const UINT8 *ed, const UINT8 *xy, const UINT8 *xycb, const UINT8 *ex) +void z80_device::z80_set_cycle_tables(const uint8_t *op, const uint8_t *cb, const uint8_t *ed, const uint8_t *xy, const uint8_t *xycb, const uint8_t *ex) { m_cc_op = (op != nullptr) ? op : cc_op; m_cc_cb = (cb != nullptr) ? cb : cc_cb; @@ -3691,7 +3691,7 @@ void z80_device::z80_set_cycle_tables(const UINT8 *op, const UINT8 *cb, const UI } -z80_device::z80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +z80_device::z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, Z80, "Z80", tag, owner, clock, "z80", __FILE__), z80_daisy_chain_interface(mconfig, *this), m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0), @@ -3702,7 +3702,7 @@ z80_device::z80_device(const machine_config &mconfig, const char *tag, device_t { } -z80_device::z80_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) : +z80_device::z80_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source), z80_daisy_chain_interface(mconfig, *this), m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0), @@ -3726,7 +3726,7 @@ const address_space_config *z80_device::memory_space_config(address_spacenum spa const device_type Z80 = &device_creator; -nsc800_device::nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nsc800_device::nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80_device(mconfig, NSC800, "NSC800", tag, owner, clock, "nsc800", __FILE__) { } diff --git a/src/devices/cpu/z80/z80.h b/src/devices/cpu/z80/z80.h index 70eab883103..af38e5fec0a 100644 --- a/src/devices/cpu/z80/z80.h +++ b/src/devices/cpu/z80/z80.h @@ -36,24 +36,24 @@ enum class z80_device : public cpu_device, public z80_daisy_chain_interface { public: - z80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void z80_set_cycle_tables(const UINT8 *op, const UINT8 *cb, const UINT8 *ed, const UINT8 *xy, const UINT8 *xycb, const UINT8 *ex); + void z80_set_cycle_tables(const uint8_t *op, const uint8_t *cb, const uint8_t *ed, const uint8_t *xy, const uint8_t *xycb, const uint8_t *ex); template static devcb_base &set_irqack_cb(device_t &device, _Object object) { return downcast(device).m_irqack_cb.set_callback(object); } template static devcb_base &set_refresh_cb(device_t &device, _Object object) { return downcast(device).m_refresh_cb.set_callback(object); } protected: - z80_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); + z80_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-level overrides virtual void device_start() override; virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 2; } - virtual UINT32 execute_max_cycles() const override { return 16; } - virtual UINT32 execute_input_lines() const override { return 4; } - virtual UINT32 execute_default_irq_vector() const override { return 0xff; } + virtual uint32_t execute_min_cycles() const override { return 2; } + virtual uint32_t execute_max_cycles() const override { return 16; } + virtual uint32_t execute_input_lines() const override { return 4; } + virtual uint32_t execute_default_irq_vector() const override { return 0xff; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -66,9 +66,9 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; #undef PROTOTYPES #define PROTOTYPES(prefix) \ @@ -149,15 +149,15 @@ protected: void halt(); void leave_halt(); - UINT8 in(UINT16 port); - void out(UINT16 port, UINT8 value); - UINT8 rm(UINT16 addr); - void rm16(UINT16 addr, PAIR &r); - void wm(UINT16 addr, UINT8 value); - void wm16(UINT16 addr, PAIR &r); - UINT8 rop(); - UINT8 arg(); - UINT16 arg16(); + uint8_t in(uint16_t port); + void out(uint16_t port, uint8_t value); + uint8_t rm(uint16_t addr); + void rm16(uint16_t addr, PAIR &r); + void wm(uint16_t addr, uint8_t value); + void wm16(uint16_t addr, PAIR &r); + uint8_t rop(); + uint8_t arg(); + uint16_t arg16(); void eax(); void eay(); void pop(PAIR &r); @@ -165,35 +165,35 @@ protected: void jp(void); void jp_cond(bool cond); void jr(); - void jr_cond(bool cond, UINT8 opcode); + void jr_cond(bool cond, uint8_t opcode); void call(); - void call_cond(bool cond, UINT8 opcode); - void ret_cond(bool cond, UINT8 opcode); + void call_cond(bool cond, uint8_t opcode); + void ret_cond(bool cond, uint8_t opcode); void retn(); void reti(); void ld_r_a(); void ld_a_r(); void ld_i_a(); void ld_a_i(); - void rst(UINT16 addr); - UINT8 inc(UINT8 value); - UINT8 dec(UINT8 value); + void rst(uint16_t addr); + uint8_t inc(uint8_t value); + uint8_t dec(uint8_t value); void rlca(); void rrca(); void rla(); void rra(); void rrd(); void rld(); - void add_a(UINT8 value); - void adc_a(UINT8 value); - void sub(UINT8 value); - void sbc_a(UINT8 value); + void add_a(uint8_t value); + void adc_a(uint8_t value); + void sub(uint8_t value); + void sbc_a(uint8_t value); void neg(); void daa(); - void and_a(UINT8 value); - void or_a(UINT8 value); - void xor_a(UINT8 value); - void cp(UINT8 value); + void and_a(uint8_t value); + void or_a(uint8_t value); + void xor_a(uint8_t value); + void cp(uint8_t value); void ex_af(); void ex_de_hl(); void exx(); @@ -201,19 +201,19 @@ protected: void add16(PAIR &dr, PAIR &sr); void adc_hl(PAIR &r); void sbc_hl(PAIR &r); - UINT8 rlc(UINT8 value); - UINT8 rrc(UINT8 value); - UINT8 rl(UINT8 value); - UINT8 rr(UINT8 value); - UINT8 sla(UINT8 value); - UINT8 sra(UINT8 value); - UINT8 sll(UINT8 value); - UINT8 srl(UINT8 value); - void bit(int bit, UINT8 value); - void bit_hl(int bit, UINT8 value); - void bit_xy(int bit, UINT8 value); - UINT8 res(int bit, UINT8 value); - UINT8 set(int bit, UINT8 value); + uint8_t rlc(uint8_t value); + uint8_t rrc(uint8_t value); + uint8_t rl(uint8_t value); + uint8_t rr(uint8_t value); + uint8_t sla(uint8_t value); + uint8_t sra(uint8_t value); + uint8_t sll(uint8_t value); + uint8_t srl(uint8_t value); + void bit(int bit, uint8_t value); + void bit_hl(int bit, uint8_t value); + void bit_xy(int bit, uint8_t value); + uint8_t res(int bit, uint8_t value); + uint8_t set(int bit, uint8_t value); void ldi(); void cpi(); void ini(); @@ -261,31 +261,31 @@ protected: PAIR m_bc2; PAIR m_de2; PAIR m_hl2; - UINT8 m_r; - UINT8 m_r2; - UINT8 m_iff1; - UINT8 m_iff2; - UINT8 m_halt; - UINT8 m_im; - UINT8 m_i; - UINT8 m_nmi_state; /* nmi line state */ - UINT8 m_nmi_pending; /* nmi pending */ - UINT8 m_irq_state; /* irq line state */ + uint8_t m_r; + uint8_t m_r2; + uint8_t m_iff1; + uint8_t m_iff2; + uint8_t m_halt; + uint8_t m_im; + uint8_t m_i; + uint8_t m_nmi_state; /* nmi line state */ + uint8_t m_nmi_pending; /* nmi pending */ + uint8_t m_irq_state; /* irq line state */ int m_wait_state; // wait line state int m_busrq_state; // bus request line state - UINT8 m_after_ei; /* are we in the EI shadow? */ - UINT8 m_after_ldair; /* same, but for LD A,I or LD A,R */ - UINT32 m_ea; + uint8_t m_after_ei; /* are we in the EI shadow? */ + uint8_t m_after_ldair; /* same, but for LD A,I or LD A,R */ + uint32_t m_ea; device_irq_acknowledge_delegate m_irq_callback; int m_icount; - UINT8 m_rtemp; - const UINT8 * m_cc_op; - const UINT8 * m_cc_cb; - const UINT8 * m_cc_ed; - const UINT8 * m_cc_xy; - const UINT8 * m_cc_xycb; - const UINT8 * m_cc_ex; + uint8_t m_rtemp; + const uint8_t * m_cc_op; + const uint8_t * m_cc_cb; + const uint8_t * m_cc_ed; + const uint8_t * m_cc_xy; + const uint8_t * m_cc_xycb; + const uint8_t * m_cc_ex; }; extern const device_type Z80; @@ -293,7 +293,7 @@ extern const device_type Z80; class nsc800_device : public z80_device { public: - nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -301,12 +301,12 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_input_lines() const override { return 7; } + virtual uint32_t execute_input_lines() const override { return 7; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; void take_interrupt_nsc800(); - UINT8 m_nsc800_irq_state[4]; /* state of NSC800 restart interrupts A, B, C */ + uint8_t m_nsc800_irq_state[4]; /* state of NSC800 restart interrupts A, B, C */ }; extern const device_type NSC800; diff --git a/src/devices/cpu/z80/z80daisy.h b/src/devices/cpu/z80/z80daisy.h index 11d17dc36eb..57d852261bc 100644 --- a/src/devices/cpu/z80/z80daisy.h +++ b/src/devices/cpu/z80/z80daisy.h @@ -20,8 +20,8 @@ //************************************************************************** // these constants are returned from the irq_state function -const UINT8 Z80_DAISY_INT = 0x01; // interrupt request mask -const UINT8 Z80_DAISY_IEO = 0x02; // interrupt disable mask (IEO) +const uint8_t Z80_DAISY_INT = 0x01; // interrupt request mask +const uint8_t Z80_DAISY_IEO = 0x02; // interrupt disable mask (IEO) diff --git a/src/devices/cpu/z80/z80dasm.cpp b/src/devices/cpu/z80/z80dasm.cpp index 011d7857d19..e7bf8b60051 100644 --- a/src/devices/cpu/z80/z80dasm.cpp +++ b/src/devices/cpu/z80/z80dasm.cpp @@ -40,7 +40,7 @@ static const char *const s_mnemonic[] = #define _OVER DASMFLAG_STEP_OVER #define _OUT DASMFLAG_STEP_OUT -static const UINT32 s_flags[] = +static const uint32_t s_flags[] = { 0 ,0 ,0 ,0 ,_OVER,0 ,0 ,0 , _OVER,0 ,_OVER,0 ,0 ,0 ,0 ,0 , @@ -55,7 +55,7 @@ static const UINT32 s_flags[] = struct z80dasm { - UINT8 mnemonic; + uint8_t mnemonic; const char *arguments; }; @@ -399,12 +399,12 @@ static const z80dasm mnemonic_main[256] = {zCALL,"m,A"}, {zDB,"fd"}, {zCP,"B"}, {zRST,"V"} }; -static char sign(INT8 offset) +static char sign(int8_t offset) { return (offset < 0)? '-':'+'; } -static int offs(INT8 offset) +static int offs(int8_t offset) { if (offset < 0) return -offset; return offset; @@ -418,9 +418,9 @@ CPU_DISASSEMBLE( z80 ) const z80dasm *d; const char *src, *ixy; char *dst; - INT8 offset = 0; - UINT8 op, op1 = 0; - UINT16 ea; + int8_t offset = 0; + uint8_t op, op1 = 0; + uint16_t ea; int pos = 0; ixy = "oops!!"; @@ -443,7 +443,7 @@ CPU_DISASSEMBLE( z80 ) op1 = oprom[pos++]; if( op1 == 0xcb ) { - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; op1 = opram[pos++]; /* fourth byte from opbase.ram! */ d = &mnemonic_xx_cb[op1]; } @@ -454,7 +454,7 @@ CPU_DISASSEMBLE( z80 ) op1 = oprom[pos++]; if( op1 == 0xcb ) { - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; op1 = opram[pos++]; /* fourth byte from opbase.ram! */ d = &mnemonic_xx_cb[op1]; } @@ -491,7 +491,7 @@ CPU_DISASSEMBLE( z80 ) dst += sprintf( dst, "$%04X", ea ); break; case 'O': /* Offset relative to PC */ - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; dst += sprintf( dst, "$%04X", (pc + offset + 2) & 0xffff ); break; case 'P': /* Port number */ @@ -508,7 +508,7 @@ CPU_DISASSEMBLE( z80 ) dst += sprintf( dst, "$%04X", ea ); break; case 'X': - offset = (INT8) opram[pos++]; + offset = (int8_t) opram[pos++]; /* fall through */ case 'Y': dst += sprintf( dst,"(%s%c$%02x)", ixy, sign(offset), offs(offset) ); diff --git a/src/devices/cpu/z8000/8000dasm.cpp b/src/devices/cpu/z8000/8000dasm.cpp index 5118af4b433..fd9b194db6b 100644 --- a/src/devices/cpu/z8000/8000dasm.cpp +++ b/src/devices/cpu/z8000/8000dasm.cpp @@ -19,9 +19,9 @@ static int n[16]; /* opcode nibbles */ static int b[8]; /* opcode bytes */ static int w[4]; /* opcode words */ -static void GET_OP(const UINT8 *oprom, int i, unsigned offset) +static void GET_OP(const uint8_t *oprom, int i, unsigned offset) { - UINT16 opcode = (oprom[offset] << 8) | oprom[offset + 1]; + uint16_t opcode = (oprom[offset] << 8) | oprom[offset + 1]; w[i] = opcode; b[i*2+0] = opcode >> 8; b[i*2+1] = opcode & 0xff; @@ -54,8 +54,8 @@ CPU_DISASSEMBLE( z8000 ) char *dst = buffer; const char *src; Z8000_exec *o; - UINT32 flags = 0; - UINT32 old_w; + uint32_t flags = 0; + uint32_t old_w; /* already initialized? */ if(z8000_exec == nullptr) @@ -115,7 +115,7 @@ CPU_DISASSEMBLE( z8000 ) /* absolute immediate 8bit (rl/rr) */ src++; i = *src++ - '0'; - dst += sprintf(dst, "#%d", ((INT8)b[i]<0) ? -(INT8)b[i] : b[i]); + dst += sprintf(dst, "#%d", ((int8_t)b[i]<0) ? -(int8_t)b[i] : b[i]); break; case '+': /* imm4m1 (inc/dec value) */ @@ -232,7 +232,7 @@ CPU_DISASSEMBLE( z8000 ) tmp = new_pc - 2 * (w[0] & 0x7f); break; case 1: /* disp8 */ - tmp = new_pc + 2 * (INT8)(w[0] & 0xff); + tmp = new_pc + 2 * (int8_t)(w[0] & 0xff); break; case 2: /* disp12 */ tmp = w[0] & 0x7ff; diff --git a/src/devices/cpu/z8000/makedab.cpp b/src/devices/cpu/z8000/makedab.cpp index 57668f3af85..02a27f6783e 100644 --- a/src/devices/cpu/z8000/makedab.cpp +++ b/src/devices/cpu/z8000/makedab.cpp @@ -71,7 +71,7 @@ int main(int ac, char **av) printf(" * 0..7 result value \n"); printf(" * 8 carry flag after \n"); printf(" ************************************************/\n"); - printf("static const UINT16 Z8000_dab[0x800] = {\n"); + printf("static const uint16_t Z8000_dab[0x800] = {\n"); for (i = 0; i < 0x800; i++) { if ((i & 0x3ff) == 0) { if (i & 0x400) diff --git a/src/devices/cpu/z8000/z8000.cpp b/src/devices/cpu/z8000/z8000.cpp index 2b8b874bceb..f94b0c1d09c 100644 --- a/src/devices/cpu/z8000/z8000.cpp +++ b/src/devices/cpu/z8000/z8000.cpp @@ -32,7 +32,7 @@ const device_type Z8001 = &device_creator; const device_type Z8002 = &device_creator; -z8002_device::z8002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z8002_device::z8002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, Z8002, "Z8002", tag, owner, clock, "z8002", __FILE__) , z80_daisy_chain_interface(mconfig, *this) , m_program_config("program", ENDIANNESS_BIG, 16, 16, 0) @@ -43,7 +43,7 @@ z8002_device::z8002_device(const machine_config &mconfig, const char *tag, devic } -z8002_device::z8002_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) +z8002_device::z8002_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) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) , z80_daisy_chain_interface(mconfig, *this) , m_program_config("program", ENDIANNESS_BIG, 16, 20, 0) @@ -54,14 +54,14 @@ z8002_device::z8002_device(const machine_config &mconfig, device_type type, cons } -z8001_device::z8001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z8001_device::z8001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z8002_device(mconfig, Z8001, "Zilog Z8001", tag, owner, clock, "z8001", __FILE__) , m_data_config("data", ENDIANNESS_BIG, 16, 20, 0) { } -offs_t z8002_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t z8002_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( z8000 ); return CPU_DISASSEMBLE_NAME(z8000)(this, buffer, pc, oprom, opram, options); @@ -72,7 +72,7 @@ offs_t z8002_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op Z8000_exec *z8000_exec = nullptr; /* zero, sign and parity flags for logical byte operations */ -static UINT8 z8000_zsp[256]; +static uint8_t z8000_zsp[256]; int z8002_device::segmented_mode() @@ -85,12 +85,12 @@ int z8001_device::segmented_mode() return (m_fcw & F_SEG) ? 1 : 0; } -UINT32 z8002_device::addr_add(UINT32 addr, UINT32 addend) +uint32_t z8002_device::addr_add(uint32_t addr, uint32_t addend) { return (addr & 0xffff0000) | ((addr + addend) & 0xffff); } -UINT32 z8002_device::addr_sub(UINT32 addr, UINT32 subtrahend) +uint32_t z8002_device::addr_sub(uint32_t addr, uint32_t subtrahend) { return (addr & 0xffff0000) | ((addr - subtrahend) & 0xffff); } @@ -98,14 +98,14 @@ UINT32 z8002_device::addr_sub(UINT32 addr, UINT32 subtrahend) /* conversion table for Z8000 DAB opcode */ #include "z8000dab.h" -UINT16 z8002_device::RDOP() +uint16_t z8002_device::RDOP() { - UINT16 res = m_program->read_word(m_pc); + uint16_t res = m_program->read_word(m_pc); m_pc += 2; return res; } -UINT32 z8002_device::get_operand(int opnum) +uint32_t z8002_device::get_operand(int opnum) { int i; @@ -123,7 +123,7 @@ UINT32 z8002_device::get_operand(int opnum) return m_op[opnum]; } -UINT32 z8002_device::get_addr_operand(int opnum) +uint32_t z8002_device::get_addr_operand(int opnum) { int i; @@ -134,7 +134,7 @@ UINT32 z8002_device::get_addr_operand(int opnum) if (! (m_op_valid & (1 << opnum))) { - UINT32 seg = m_program->read_word(m_pc); + uint32_t seg = m_program->read_word(m_pc); m_pc += 2; if (segmented_mode()) { @@ -153,7 +153,7 @@ UINT32 z8002_device::get_addr_operand(int opnum) return m_op[opnum]; } -UINT32 z8002_device::get_raw_addr_operand(int opnum) +uint32_t z8002_device::get_raw_addr_operand(int opnum) { int i; @@ -164,7 +164,7 @@ UINT32 z8002_device::get_raw_addr_operand(int opnum) if (! (m_op_valid & (1 << opnum))) { - UINT32 seg = m_program->read_word(m_pc); + uint32_t seg = m_program->read_word(m_pc); m_pc += 2; if (segmented_mode()) { @@ -183,12 +183,12 @@ UINT32 z8002_device::get_raw_addr_operand(int opnum) return m_op[opnum]; } -UINT32 z8002_device::adjust_addr_for_nonseg_mode(UINT32 addr) +uint32_t z8002_device::adjust_addr_for_nonseg_mode(uint32_t addr) { return addr; } -UINT32 z8001_device::adjust_addr_for_nonseg_mode(UINT32 addr) +uint32_t z8001_device::adjust_addr_for_nonseg_mode(uint32_t addr) { if (!(m_fcw & F_SEG)) { @@ -200,7 +200,7 @@ UINT32 z8001_device::adjust_addr_for_nonseg_mode(UINT32 addr) } } -UINT8 z8002_device::RDMEM_B(address_spacenum spacenum, UINT32 addr) +uint8_t z8002_device::RDMEM_B(address_spacenum spacenum, uint32_t addr) { addr = adjust_addr_for_nonseg_mode(addr); if (spacenum == AS_PROGRAM) @@ -209,7 +209,7 @@ UINT8 z8002_device::RDMEM_B(address_spacenum spacenum, UINT32 addr) return m_data->read_byte(addr); } -UINT16 z8002_device::RDMEM_W(address_spacenum spacenum, UINT32 addr) +uint16_t z8002_device::RDMEM_W(address_spacenum spacenum, uint32_t addr) { addr = adjust_addr_for_nonseg_mode(addr); addr &= ~1; @@ -224,9 +224,9 @@ UINT16 z8002_device::RDMEM_W(address_spacenum spacenum, UINT32 addr) return m_data->read_word(addr); } -UINT32 z8002_device::RDMEM_L(address_spacenum spacenum, UINT32 addr) +uint32_t z8002_device::RDMEM_L(address_spacenum spacenum, uint32_t addr) { - UINT32 result; + uint32_t result; addr = adjust_addr_for_nonseg_mode(addr); addr &= ~1; if (spacenum == AS_PROGRAM) @@ -241,7 +241,7 @@ UINT32 z8002_device::RDMEM_L(address_spacenum spacenum, UINT32 addr) } } -void z8002_device::WRMEM_B(address_spacenum spacenum, UINT32 addr, UINT8 value) +void z8002_device::WRMEM_B(address_spacenum spacenum, uint32_t addr, uint8_t value) { addr = adjust_addr_for_nonseg_mode(addr); if (spacenum == AS_PROGRAM) @@ -250,7 +250,7 @@ void z8002_device::WRMEM_B(address_spacenum spacenum, UINT32 addr, UINT8 value) m_data->write_byte(addr, value); } -void z8002_device::WRMEM_W(address_spacenum spacenum, UINT32 addr, UINT16 value) +void z8002_device::WRMEM_W(address_spacenum spacenum, uint32_t addr, uint16_t value) { addr = adjust_addr_for_nonseg_mode(addr); addr &= ~1; @@ -260,7 +260,7 @@ void z8002_device::WRMEM_W(address_spacenum spacenum, UINT32 addr, UINT16 value) m_data->write_word(addr, value); } -void z8002_device::WRMEM_L(address_spacenum spacenum, UINT32 addr, UINT32 value) +void z8002_device::WRMEM_L(address_spacenum spacenum, uint32_t addr, uint32_t value) { addr = adjust_addr_for_nonseg_mode(addr); addr &= ~1; @@ -276,7 +276,7 @@ void z8002_device::WRMEM_L(address_spacenum spacenum, UINT32 addr, UINT32 value) } } -UINT8 z8002_device::RDPORT_B(int mode, UINT16 addr) +uint8_t z8002_device::RDPORT_B(int mode, uint16_t addr) { if(mode == 0) { @@ -289,12 +289,12 @@ UINT8 z8002_device::RDPORT_B(int mode, UINT16 addr) } } -UINT16 z8002_device::RDPORT_W(int mode, UINT16 addr) +uint16_t z8002_device::RDPORT_W(int mode, uint16_t addr) { if(mode == 0) { - return m_io->read_byte((UINT16)(addr)) + - (m_io->read_byte((UINT16)(addr+1)) << 8); + return m_io->read_byte((uint16_t)(addr)) + + (m_io->read_byte((uint16_t)(addr+1)) << 8); } else { @@ -303,11 +303,11 @@ UINT16 z8002_device::RDPORT_W(int mode, UINT16 addr) } } -UINT16 z8001_device::RDPORT_W(int mode, UINT16 addr) +uint16_t z8001_device::RDPORT_W(int mode, uint16_t addr) { if(mode == 0) { - return m_io->read_word_unaligned((UINT16)addr); + return m_io->read_word_unaligned((uint16_t)addr); } else { @@ -316,7 +316,7 @@ UINT16 z8001_device::RDPORT_W(int mode, UINT16 addr) } } -void z8002_device::WRPORT_B(int mode, UINT16 addr, UINT8 value) +void z8002_device::WRPORT_B(int mode, uint16_t addr, uint8_t value) { if(mode == 0) { @@ -329,12 +329,12 @@ void z8002_device::WRPORT_B(int mode, UINT16 addr, UINT8 value) } } -void z8002_device::WRPORT_W(int mode, UINT16 addr, UINT16 value) +void z8002_device::WRPORT_W(int mode, uint16_t addr, uint16_t value) { if(mode == 0) { - m_io->write_byte((UINT16)(addr),value & 0xff); - m_io->write_byte((UINT16)(addr+1),(value >> 8) & 0xff); + m_io->write_byte((uint16_t)(addr),value & 0xff); + m_io->write_byte((uint16_t)(addr+1),(value >> 8) & 0xff); } else { @@ -342,11 +342,11 @@ void z8002_device::WRPORT_W(int mode, UINT16 addr, UINT16 value) } } -void z8001_device::WRPORT_W(int mode, UINT16 addr, UINT16 value) +void z8001_device::WRPORT_W(int mode, uint16_t addr, uint16_t value) { if(mode == 0) { - m_io->write_word_unaligned((UINT16)addr, value); + m_io->write_word_unaligned((uint16_t)addr, value); } else { @@ -407,42 +407,42 @@ void z8001_device::PUSH_PC() } -UINT32 z8002_device::GET_PC(UINT32 VEC) +uint32_t z8002_device::GET_PC(uint32_t VEC) { return RDMEM_W(AS_PROGRAM, VEC + 2); } -UINT32 z8001_device::GET_PC(UINT32 VEC) +uint32_t z8001_device::GET_PC(uint32_t VEC) { return segmented_addr(RDMEM_L(AS_PROGRAM, VEC + 4)); } -UINT16 z8002_device::GET_FCW(UINT32 VEC) +uint16_t z8002_device::GET_FCW(uint32_t VEC) { return RDMEM_W(AS_PROGRAM, VEC); } -UINT16 z8001_device::GET_FCW(UINT32 VEC) +uint16_t z8001_device::GET_FCW(uint32_t VEC) { return RDMEM_W(AS_PROGRAM, VEC + 2); } -UINT32 z8002_device::F_SEG_Z8001() +uint32_t z8002_device::F_SEG_Z8001() { return 0; } -UINT32 z8001_device::F_SEG_Z8001() +uint32_t z8001_device::F_SEG_Z8001() { return F_SEG; } -UINT32 z8002_device::PSA_ADDR() +uint32_t z8002_device::PSA_ADDR() { return m_psapoff; } -UINT32 z8001_device::PSA_ADDR() +uint32_t z8001_device::PSA_ADDR() { return segmented_addr((m_psapseg << 16) | m_psapoff); } @@ -450,7 +450,7 @@ UINT32 z8001_device::PSA_ADDR() void z8002_device::Interrupt() { - UINT16 fcw = m_fcw; + uint16_t fcw = m_fcw; if (m_irq_req & Z8000_NVI) { @@ -551,13 +551,13 @@ void z8002_device::Interrupt() } } -UINT32 z8002_device::read_irq_vector() +uint32_t z8002_device::read_irq_vector() { return RDMEM_W(AS_PROGRAM, VEC00 + 2 * (m_irq_req & 0xff)); } -UINT32 z8001_device::read_irq_vector() +uint32_t z8001_device::read_irq_vector() { return segmented_addr(RDMEM_L(AS_PROGRAM, VEC00 + 4 * (m_irq_req & 0xff))); } diff --git a/src/devices/cpu/z8000/z8000.h b/src/devices/cpu/z8000/z8000.h index 577b82a0935..403b3ef729e 100644 --- a/src/devices/cpu/z8000/z8000.h +++ b/src/devices/cpu/z8000/z8000.h @@ -37,8 +37,8 @@ class z8002_device : public cpu_device, public z80_daisy_chain_interface { public: // construction/destruction - z8002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - z8002_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); + z8002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + z8002_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); ~z8002_device(); template static devcb_base &set_mo_callback(device_t &device, _Object object) { return downcast(device).m_mo_out.set_callback(object); } @@ -50,10 +50,10 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 2; } - virtual UINT32 execute_max_cycles() const override { return 744; } - virtual UINT32 execute_input_lines() const override { return 2; } - virtual UINT32 execute_default_irq_vector() const override { return 0xff; } + virtual uint32_t execute_min_cycles() const override { return 2; } + virtual uint32_t execute_max_cycles() const override { return 744; } + virtual uint32_t execute_input_lines() const override { return 2; } + virtual uint32_t execute_default_irq_vector() const override { return 0xff; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -72,32 +72,32 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 6; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 6; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; address_space_config m_program_config; address_space_config m_io_config; devcb_write_line m_mo_out; - UINT32 m_op[4]; /* opcodes/data of current instruction */ - UINT32 m_ppc; /* previous program counter */ - UINT32 m_pc; /* program counter */ - UINT16 m_psapseg; /* program status pointer, segment (Z8001 only) */ - UINT16 m_psapoff; /* program status pointer, offset */ - UINT16 m_fcw; /* flags and control word */ - UINT16 m_refresh; /* refresh timer/counter */ - UINT16 m_nspseg; /* system stack pointer, segment (Z8001 only) */ - UINT16 m_nspoff; /* system stack pointer, offset */ - UINT16 m_irq_req; /* CPU is halted, interrupt or trap request */ - UINT16 m_irq_vec; /* interrupt vector */ - UINT32 m_op_valid; /* bit field indicating if given op[] field is already initialized */ + uint32_t m_op[4]; /* opcodes/data of current instruction */ + uint32_t m_ppc; /* previous program counter */ + uint32_t m_pc; /* program counter */ + uint16_t m_psapseg; /* program status pointer, segment (Z8001 only) */ + uint16_t m_psapoff; /* program status pointer, offset */ + uint16_t m_fcw; /* flags and control word */ + uint16_t m_refresh; /* refresh timer/counter */ + uint16_t m_nspseg; /* system stack pointer, segment (Z8001 only) */ + uint16_t m_nspoff; /* system stack pointer, offset */ + uint16_t m_irq_req; /* CPU is halted, interrupt or trap request */ + uint16_t m_irq_vec; /* interrupt vector */ + uint32_t m_op_valid; /* bit field indicating if given op[] field is already initialized */ union { - UINT8 B[16]; /* RL0,RH0,RL1,RH1...RL7,RH7 */ - UINT16 W[16]; /* R0,R1,R2...R15 */ - UINT32 L[8]; /* RR0,RR2,RR4..RR14 */ - UINT64 Q[4]; /* RQ0,RQ4,..RQ12 */ + uint8_t B[16]; /* RL0,RH0,RL1,RH1...RL7,RH7 */ + uint16_t W[16]; /* R0,R1,R2...R15 */ + uint32_t L[8]; /* RR0,RR2,RR4..RR14 */ + uint64_t Q[4]; /* RQ0,RQ4,..RQ12 */ } m_regs; /* registers */ int m_nmi_state; /* NMI line state */ int m_irq_state[2]; /* IRQ line states (NVI, VI) */ @@ -112,104 +112,104 @@ protected: void clear_internal_state(); void register_debug_state(); virtual int segmented_mode(); - static inline UINT32 addr_add(UINT32 addr, UINT32 addend); - static inline UINT32 addr_sub(UINT32 addr, UINT32 subtrahend); - inline UINT16 RDOP(); - inline UINT32 get_operand(int opnum); - inline UINT32 get_addr_operand(int opnum); - inline UINT32 get_raw_addr_operand(int opnum); - virtual UINT32 adjust_addr_for_nonseg_mode(UINT32 addr); - inline UINT8 RDMEM_B(address_spacenum spacenum, UINT32 addr); - inline UINT16 RDMEM_W(address_spacenum spacenum, UINT32 addr); - inline UINT32 RDMEM_L(address_spacenum spacenum, UINT32 addr); - inline void WRMEM_B(address_spacenum spacenum, UINT32 addr, UINT8 value); - inline void WRMEM_W(address_spacenum spacenum, UINT32 addr, UINT16 value); - inline void WRMEM_L(address_spacenum spacenum, UINT32 addr, UINT32 value); - inline UINT8 RDPORT_B(int mode, UINT16 addr); - virtual UINT16 RDPORT_W(int mode, UINT16 addr); - inline void WRPORT_B(int mode, UINT16 addr, UINT8 value); - virtual void WRPORT_W(int mode, UINT16 addr, UINT16 value); + static inline uint32_t addr_add(uint32_t addr, uint32_t addend); + static inline uint32_t addr_sub(uint32_t addr, uint32_t subtrahend); + inline uint16_t RDOP(); + inline uint32_t get_operand(int opnum); + inline uint32_t get_addr_operand(int opnum); + inline uint32_t get_raw_addr_operand(int opnum); + virtual uint32_t adjust_addr_for_nonseg_mode(uint32_t addr); + inline uint8_t RDMEM_B(address_spacenum spacenum, uint32_t addr); + inline uint16_t RDMEM_W(address_spacenum spacenum, uint32_t addr); + inline uint32_t RDMEM_L(address_spacenum spacenum, uint32_t addr); + inline void WRMEM_B(address_spacenum spacenum, uint32_t addr, uint8_t value); + inline void WRMEM_W(address_spacenum spacenum, uint32_t addr, uint16_t value); + inline void WRMEM_L(address_spacenum spacenum, uint32_t addr, uint32_t value); + inline uint8_t RDPORT_B(int mode, uint16_t addr); + virtual uint16_t RDPORT_W(int mode, uint16_t addr); + inline void WRPORT_B(int mode, uint16_t addr, uint8_t value); + virtual void WRPORT_W(int mode, uint16_t addr, uint16_t value); inline void cycles(int cycles); inline void set_irq(int type); virtual void PUSH_PC(); - virtual void CHANGE_FCW(UINT16 fcw); - static inline UINT32 make_segmented_addr(UINT32 addr); - static inline UINT32 segmented_addr(UINT32 addr); - inline UINT32 addr_from_reg(int regno); - inline void addr_to_reg(int regno, UINT32 addr); - inline void add_to_addr_reg(int regno, UINT16 addend); - inline void sub_from_addr_reg(int regno, UINT16 subtrahend); - inline void set_pc(UINT32 addr); - inline void PUSHW(UINT8 dst, UINT16 value); - inline UINT16 POPW(UINT8 src); - inline void PUSHL(UINT8 dst, UINT32 value); - inline UINT32 POPL(UINT8 src); - inline UINT8 ADDB(UINT8 dest, UINT8 value); - inline UINT16 ADDW(UINT16 dest, UINT16 value); - inline UINT32 ADDL(UINT32 dest, UINT32 value); - inline UINT8 ADCB(UINT8 dest, UINT8 value); - inline UINT16 ADCW(UINT16 dest, UINT16 value); - inline UINT8 SUBB(UINT8 dest, UINT8 value); - inline UINT16 SUBW(UINT16 dest, UINT16 value); - inline UINT32 SUBL(UINT32 dest, UINT32 value); - inline UINT8 SBCB(UINT8 dest, UINT8 value); - inline UINT16 SBCW(UINT16 dest, UINT16 value); - inline UINT8 ORB(UINT8 dest, UINT8 value); - inline UINT16 ORW(UINT16 dest, UINT16 value); - inline UINT8 ANDB(UINT8 dest, UINT8 value); - inline UINT16 ANDW(UINT16 dest, UINT16 value); - inline UINT8 XORB(UINT8 dest, UINT8 value); - inline UINT16 XORW(UINT16 dest, UINT16 value); - inline void CPB(UINT8 dest, UINT8 value); - inline void CPW(UINT16 dest, UINT16 value); - inline void CPL(UINT32 dest, UINT32 value); - inline UINT8 COMB(UINT8 dest); - inline UINT16 COMW(UINT16 dest); - inline UINT8 NEGB(UINT8 dest); - inline UINT16 NEGW(UINT16 dest); - inline void TESTB(UINT8 result); - inline void TESTW(UINT16 dest); - inline void TESTL(UINT32 dest); - inline UINT8 INCB(UINT8 dest, UINT8 value); - inline UINT16 INCW(UINT16 dest, UINT16 value); - inline UINT8 DECB(UINT8 dest, UINT8 value); - inline UINT16 DECW(UINT16 dest, UINT16 value); - inline UINT32 MULTW(UINT16 dest, UINT16 value); - inline UINT64 MULTL(UINT32 dest, UINT32 value); - inline UINT32 DIVW(UINT32 dest, UINT16 value); - inline UINT64 DIVL(UINT64 dest, UINT32 value); - inline UINT8 RLB(UINT8 dest, UINT8 twice); - inline UINT16 RLW(UINT16 dest, UINT8 twice); - inline UINT8 RLCB(UINT8 dest, UINT8 twice); - inline UINT16 RLCW(UINT16 dest, UINT8 twice); - inline UINT8 RRB(UINT8 dest, UINT8 twice); - inline UINT16 RRW(UINT16 dest, UINT8 twice); - inline UINT8 RRCB(UINT8 dest, UINT8 twice); - inline UINT16 RRCW(UINT16 dest, UINT8 twice); - inline UINT8 SDAB(UINT8 dest, INT8 count); - inline UINT16 SDAW(UINT16 dest, INT8 count); - inline UINT32 SDAL(UINT32 dest, INT8 count); - inline UINT8 SDLB(UINT8 dest, INT8 count); - inline UINT16 SDLW(UINT16 dest, INT8 count); - inline UINT32 SDLL(UINT32 dest, INT8 count); - inline UINT8 SLAB(UINT8 dest, UINT8 count); - inline UINT16 SLAW(UINT16 dest, UINT8 count); - inline UINT32 SLAL(UINT32 dest, UINT8 count); - inline UINT8 SLLB(UINT8 dest, UINT8 count); - inline UINT16 SLLW(UINT16 dest, UINT8 count); - inline UINT32 SLLL(UINT32 dest, UINT8 count); - inline UINT8 SRAB(UINT8 dest, UINT8 count); - inline UINT16 SRAW(UINT16 dest, UINT8 count); - inline UINT32 SRAL(UINT32 dest, UINT8 count); - inline UINT8 SRLB(UINT8 dest, UINT8 count); - inline UINT16 SRLW(UINT16 dest, UINT8 count); - inline UINT32 SRLL(UINT32 dest, UINT8 count); + virtual void CHANGE_FCW(uint16_t fcw); + static inline uint32_t make_segmented_addr(uint32_t addr); + static inline uint32_t segmented_addr(uint32_t addr); + inline uint32_t addr_from_reg(int regno); + inline void addr_to_reg(int regno, uint32_t addr); + inline void add_to_addr_reg(int regno, uint16_t addend); + inline void sub_from_addr_reg(int regno, uint16_t subtrahend); + inline void set_pc(uint32_t addr); + inline void PUSHW(uint8_t dst, uint16_t value); + inline uint16_t POPW(uint8_t src); + inline void PUSHL(uint8_t dst, uint32_t value); + inline uint32_t POPL(uint8_t src); + inline uint8_t ADDB(uint8_t dest, uint8_t value); + inline uint16_t ADDW(uint16_t dest, uint16_t value); + inline uint32_t ADDL(uint32_t dest, uint32_t value); + inline uint8_t ADCB(uint8_t dest, uint8_t value); + inline uint16_t ADCW(uint16_t dest, uint16_t value); + inline uint8_t SUBB(uint8_t dest, uint8_t value); + inline uint16_t SUBW(uint16_t dest, uint16_t value); + inline uint32_t SUBL(uint32_t dest, uint32_t value); + inline uint8_t SBCB(uint8_t dest, uint8_t value); + inline uint16_t SBCW(uint16_t dest, uint16_t value); + inline uint8_t ORB(uint8_t dest, uint8_t value); + inline uint16_t ORW(uint16_t dest, uint16_t value); + inline uint8_t ANDB(uint8_t dest, uint8_t value); + inline uint16_t ANDW(uint16_t dest, uint16_t value); + inline uint8_t XORB(uint8_t dest, uint8_t value); + inline uint16_t XORW(uint16_t dest, uint16_t value); + inline void CPB(uint8_t dest, uint8_t value); + inline void CPW(uint16_t dest, uint16_t value); + inline void CPL(uint32_t dest, uint32_t value); + inline uint8_t COMB(uint8_t dest); + inline uint16_t COMW(uint16_t dest); + inline uint8_t NEGB(uint8_t dest); + inline uint16_t NEGW(uint16_t dest); + inline void TESTB(uint8_t result); + inline void TESTW(uint16_t dest); + inline void TESTL(uint32_t dest); + inline uint8_t INCB(uint8_t dest, uint8_t value); + inline uint16_t INCW(uint16_t dest, uint16_t value); + inline uint8_t DECB(uint8_t dest, uint8_t value); + inline uint16_t DECW(uint16_t dest, uint16_t value); + inline uint32_t MULTW(uint16_t dest, uint16_t value); + inline uint64_t MULTL(uint32_t dest, uint32_t value); + inline uint32_t DIVW(uint32_t dest, uint16_t value); + inline uint64_t DIVL(uint64_t dest, uint32_t value); + inline uint8_t RLB(uint8_t dest, uint8_t twice); + inline uint16_t RLW(uint16_t dest, uint8_t twice); + inline uint8_t RLCB(uint8_t dest, uint8_t twice); + inline uint16_t RLCW(uint16_t dest, uint8_t twice); + inline uint8_t RRB(uint8_t dest, uint8_t twice); + inline uint16_t RRW(uint16_t dest, uint8_t twice); + inline uint8_t RRCB(uint8_t dest, uint8_t twice); + inline uint16_t RRCW(uint16_t dest, uint8_t twice); + inline uint8_t SDAB(uint8_t dest, int8_t count); + inline uint16_t SDAW(uint16_t dest, int8_t count); + inline uint32_t SDAL(uint32_t dest, int8_t count); + inline uint8_t SDLB(uint8_t dest, int8_t count); + inline uint16_t SDLW(uint16_t dest, int8_t count); + inline uint32_t SDLL(uint32_t dest, int8_t count); + inline uint8_t SLAB(uint8_t dest, uint8_t count); + inline uint16_t SLAW(uint16_t dest, uint8_t count); + inline uint32_t SLAL(uint32_t dest, uint8_t count); + inline uint8_t SLLB(uint8_t dest, uint8_t count); + inline uint16_t SLLW(uint16_t dest, uint8_t count); + inline uint32_t SLLL(uint32_t dest, uint8_t count); + inline uint8_t SRAB(uint8_t dest, uint8_t count); + inline uint16_t SRAW(uint16_t dest, uint8_t count); + inline uint32_t SRAL(uint32_t dest, uint8_t count); + inline uint8_t SRLB(uint8_t dest, uint8_t count); + inline uint16_t SRLW(uint16_t dest, uint8_t count); + inline uint32_t SRLL(uint32_t dest, uint8_t count); inline void Interrupt(); - virtual UINT32 GET_PC(UINT32 VEC); - virtual UINT16 GET_FCW(UINT32 VEC); - virtual UINT32 F_SEG_Z8001(); - virtual UINT32 PSA_ADDR(); - virtual UINT32 read_irq_vector(); + virtual uint32_t GET_PC(uint32_t VEC); + virtual uint16_t GET_FCW(uint32_t VEC); + virtual uint32_t F_SEG_Z8001(); + virtual uint32_t PSA_ADDR(); + virtual uint32_t read_irq_vector(); public: void zinvalid(); @@ -630,7 +630,7 @@ class z8001_device : public z8002_device { public: // construction/destruction - z8001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z8001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -650,21 +650,21 @@ protected: } // device_disasm_interface overrides - virtual UINT32 disasm_max_opcode_bytes() const override { return 8; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 8; } address_space_config m_data_config; virtual int segmented_mode() override; - virtual UINT32 adjust_addr_for_nonseg_mode(UINT32 addr) override; - virtual UINT16 RDPORT_W(int mode, UINT16 addr) override; - virtual void WRPORT_W(int mode, UINT16 addr, UINT16 value) override; + virtual uint32_t adjust_addr_for_nonseg_mode(uint32_t addr) override; + virtual uint16_t RDPORT_W(int mode, uint16_t addr) override; + virtual void WRPORT_W(int mode, uint16_t addr, uint16_t value) override; virtual void PUSH_PC() override; - virtual void CHANGE_FCW(UINT16 fcw) override; - virtual UINT32 GET_PC(UINT32 VEC) override; - virtual UINT16 GET_FCW(UINT32 VEC) override; - virtual UINT32 F_SEG_Z8001() override; - virtual UINT32 PSA_ADDR() override; - virtual UINT32 read_irq_vector() override; + virtual void CHANGE_FCW(uint16_t fcw) override; + virtual uint32_t GET_PC(uint32_t VEC) override; + virtual uint16_t GET_FCW(uint32_t VEC) override; + virtual uint32_t F_SEG_Z8001() override; + virtual uint32_t PSA_ADDR() override; + virtual uint32_t read_irq_vector() override; private: void z8k_disass_mode(int ref, int params, const char *param[]); diff --git a/src/devices/cpu/z8000/z8000cpu.h b/src/devices/cpu/z8000/z8000cpu.h index 1a3f9e52b0f..21c648ecb6e 100644 --- a/src/devices/cpu/z8000/z8000cpu.h +++ b/src/devices/cpu/z8000/z8000cpu.h @@ -150,30 +150,30 @@ /* get data from the opcode words */ /* o is the opcode word offset */ /* s is a nibble shift factor */ -#define GET_BIT(o) UINT16 bit = 1 << (get_operand(o) & 15) -#define GET_CCC(o,s) UINT8 cc = (get_operand(o) >> (s)) & 15 +#define GET_BIT(o) uint16_t bit = 1 << (get_operand(o) & 15) +#define GET_CCC(o,s) uint8_t cc = (get_operand(o) >> (s)) & 15 -#define GET_DST(o,s) UINT8 dst = (get_operand(o) >> (s)) & 15 -#define GET_SRC(o,s) UINT8 src = (get_operand(o) >> (s)) & 15 -#define GET_IDX(o,s) UINT8 idx = (get_operand(o) >> (s)) & 15 -#define GET_CNT(o,s) INT8 cnt = (get_operand(o) >> (s)) & 15 -#define GET_IMM4(o,s) UINT8 imm4 = (get_operand(o) >> (s)) & 15 +#define GET_DST(o,s) uint8_t dst = (get_operand(o) >> (s)) & 15 +#define GET_SRC(o,s) uint8_t src = (get_operand(o) >> (s)) & 15 +#define GET_IDX(o,s) uint8_t idx = (get_operand(o) >> (s)) & 15 +#define GET_CNT(o,s) int8_t cnt = (get_operand(o) >> (s)) & 15 +#define GET_IMM4(o,s) uint8_t imm4 = (get_operand(o) >> (s)) & 15 -#define GET_I4M1(o,s) UINT8 i4p1 = ((get_operand(o) >> (s)) & 15) + 1 -#define GET_IMM1(o,s) UINT8 imm1 = (get_operand(o) >> (s)) & 2 -#define GET_IMM2(o,s) UINT8 imm2 = (get_operand(o) >> (s)) & 3 -#define GET_IMM3(o,s) UINT8 imm3 = (get_operand(o) >> (s)) & 7 +#define GET_I4M1(o,s) uint8_t i4p1 = ((get_operand(o) >> (s)) & 15) + 1 +#define GET_IMM1(o,s) uint8_t imm1 = (get_operand(o) >> (s)) & 2 +#define GET_IMM2(o,s) uint8_t imm2 = (get_operand(o) >> (s)) & 3 +#define GET_IMM3(o,s) uint8_t imm3 = (get_operand(o) >> (s)) & 7 -#define GET_IMM8(o) UINT8 imm8 = (UINT8)get_operand(o) +#define GET_IMM8(o) uint8_t imm8 = (uint8_t)get_operand(o) -#define GET_IMM16(o) UINT16 imm16 = get_operand(o) -#define GET_IDX16(o) UINT32 idx16 = get_operand(o) -#define GET_IMM32 UINT32 imm32 = (get_operand(1) << 16) + get_operand(2) -#define GET_DSP7 UINT8 dsp7 = get_operand(0) & 127 -#define GET_DSP8 INT8 dsp8 = (INT8)get_operand(0) -#define GET_DSP16 UINT32 dsp16 = addr_add(m_pc, (INT16)get_operand(1)) -#define GET_ADDR(o) UINT32 addr = (UINT32)get_addr_operand(o) -#define GET_ADDR_RAW(o) UINT32 addr = (UINT32)get_raw_addr_operand(o) +#define GET_IMM16(o) uint16_t imm16 = get_operand(o) +#define GET_IDX16(o) uint32_t idx16 = get_operand(o) +#define GET_IMM32 uint32_t imm32 = (get_operand(1) << 16) + get_operand(2) +#define GET_DSP7 uint8_t dsp7 = get_operand(0) & 127 +#define GET_DSP8 int8_t dsp8 = (int8_t)get_operand(0) +#define GET_DSP16 uint32_t dsp16 = addr_add(m_pc, (int16_t)get_operand(1)) +#define GET_ADDR(o) uint32_t addr = (uint32_t)get_addr_operand(o) +#define GET_ADDR_RAW(o) uint32_t addr = (uint32_t)get_raw_addr_operand(o) /* structure for the opcode definition table */ @@ -184,7 +184,7 @@ struct Z8000_init { int size, cycles; opcode_func opcode; const char *dasm; - UINT32 dasmflags; + uint32_t dasmflags; }; /* structure for the opcode execution table / disassembler */ @@ -193,7 +193,7 @@ struct Z8000_exec { int cycles; int size; const char *dasm; - UINT32 dasmflags; + uint32_t dasmflags; }; /* opcode execution table */ diff --git a/src/devices/cpu/z8000/z8000dab.h b/src/devices/cpu/z8000/z8000dab.h index 44280993803..56fb9220ef3 100644 --- a/src/devices/cpu/z8000/z8000dab.h +++ b/src/devices/cpu/z8000/z8000dab.h @@ -15,7 +15,7 @@ * 0..7 result value * 8 carry flag after ************************************************/ -static const UINT16 Z8000_dab[0x800] = { +static const uint16_t Z8000_dab[0x800] = { /* add/adc results */ 0x000,0x001,0x002,0x003,0x004,0x005,0x006,0x007, 0x008,0x009,0x010,0x011,0x012,0x013,0x014,0x015, diff --git a/src/devices/cpu/z8000/z8000ops.hxx b/src/devices/cpu/z8000/z8000ops.hxx index 4bb0d781f1d..127c9be11e9 100644 --- a/src/devices/cpu/z8000/z8000ops.hxx +++ b/src/devices/cpu/z8000/z8000ops.hxx @@ -16,9 +16,9 @@ check new fcw for switch to system mode and swap stack pointer if needed ******************************************/ -void z8002_device::CHANGE_FCW(UINT16 fcw) +void z8002_device::CHANGE_FCW(uint16_t fcw) { - UINT16 tmp; + uint16_t tmp; if ((fcw ^ m_fcw) & F_S_N) /* system/user mode change? */ { tmp = RW(15); @@ -39,9 +39,9 @@ void z8002_device::CHANGE_FCW(UINT16 fcw) m_fcw = fcw; /* set new m_fcw */ } -void z8001_device::CHANGE_FCW(UINT16 fcw) +void z8001_device::CHANGE_FCW(uint16_t fcw) { - UINT16 tmp; + uint16_t tmp; if ((fcw ^ m_fcw) & F_S_N) /* system/user mode change? */ { tmp = RW(15); @@ -84,17 +84,17 @@ void z8001_device::CHANGE_FCW(UINT16 fcw) m_fcw = fcw; /* set new m_fcw */ } -UINT32 z8002_device::make_segmented_addr(UINT32 addr) +uint32_t z8002_device::make_segmented_addr(uint32_t addr) { return ((addr & 0x007f0000) << 8) | 0x80000000 | (addr & 0xffff); } -UINT32 z8002_device::segmented_addr(UINT32 addr) +uint32_t z8002_device::segmented_addr(uint32_t addr) { return ((addr & 0x7f000000) >> 8) | (addr & 0xffff); } -UINT32 z8002_device::addr_from_reg(int regno) +uint32_t z8002_device::addr_from_reg(int regno) { if (segmented_mode()) return segmented_addr(RL(regno)); @@ -102,10 +102,10 @@ UINT32 z8002_device::addr_from_reg(int regno) return RW(regno); } -void z8002_device::addr_to_reg(int regno, UINT32 addr) +void z8002_device::addr_to_reg(int regno, uint32_t addr) { if (segmented_mode()) { - UINT32 segaddr = make_segmented_addr(addr); + uint32_t segaddr = make_segmented_addr(addr); RW(regno) = (RW(regno) & 0x80ff) | ((segaddr >> 16) & 0x7f00); RW(regno | 1) = segaddr & 0xffff; } @@ -113,21 +113,21 @@ void z8002_device::addr_to_reg(int regno, UINT32 addr) RW(regno) = addr; } -void z8002_device::add_to_addr_reg(int regno, UINT16 addend) +void z8002_device::add_to_addr_reg(int regno, uint16_t addend) { if (segmented_mode()) regno |= 1; RW(regno) += addend; } -void z8002_device::sub_from_addr_reg(int regno, UINT16 subtrahend) +void z8002_device::sub_from_addr_reg(int regno, uint16_t subtrahend) { if (segmented_mode()) regno |= 1; RW(regno) -= subtrahend; } -void z8002_device::set_pc(UINT32 addr) +void z8002_device::set_pc(uint32_t addr) { if (segmented_mode()) m_pc = addr; @@ -135,7 +135,7 @@ void z8002_device::set_pc(UINT32 addr) m_pc = (m_pc & 0xffff0000) | (addr & 0xffff); } -void z8002_device::PUSHW(UINT8 dst, UINT16 value) +void z8002_device::PUSHW(uint8_t dst, uint16_t value) { if (segmented_mode()) RW(dst | 1) -= 2; @@ -144,9 +144,9 @@ void z8002_device::PUSHW(UINT8 dst, UINT16 value) WRMEM_W(AS_DATA, addr_from_reg(dst), value); } -UINT16 z8002_device::POPW(UINT8 src) +uint16_t z8002_device::POPW(uint8_t src) { - UINT16 result = RDMEM_W(AS_DATA, addr_from_reg(src)); + uint16_t result = RDMEM_W(AS_DATA, addr_from_reg(src)); if (segmented_mode()) RW(src | 1) += 2; else @@ -154,7 +154,7 @@ UINT16 z8002_device::POPW(UINT8 src) return result; } -void z8002_device::PUSHL(UINT8 dst, UINT32 value) +void z8002_device::PUSHL(uint8_t dst, uint32_t value) { if (segmented_mode()) RW(dst | 1) -= 4; @@ -163,9 +163,9 @@ void z8002_device::PUSHL(UINT8 dst, UINT32 value) WRMEM_L(AS_DATA, addr_from_reg(dst), value); } -UINT32 z8002_device::POPL(UINT8 src) +uint32_t z8002_device::POPL(uint8_t src) { - UINT32 result = RDMEM_L(AS_DATA, addr_from_reg(src)); + uint32_t result = RDMEM_L(AS_DATA, addr_from_reg(src)); if (segmented_mode()) RW(src | 1) += 4; else @@ -174,10 +174,10 @@ UINT32 z8002_device::POPL(UINT8 src) } /* check zero and sign flag for byte, word and long results */ -#define CHK_XXXB_ZS if (!result) SET_Z; else if ((INT8) result < 0) SET_S -#define CHK_XXXW_ZS if (!result) SET_Z; else if ((INT16)result < 0) SET_S -#define CHK_XXXL_ZS if (!result) SET_Z; else if ((INT32)result < 0) SET_S -#define CHK_XXXQ_ZS if (!result) SET_Z; else if ((INT64)result < 0) SET_S +#define CHK_XXXB_ZS if (!result) SET_Z; else if ((int8_t) result < 0) SET_S +#define CHK_XXXW_ZS if (!result) SET_Z; else if ((int16_t)result < 0) SET_S +#define CHK_XXXL_ZS if (!result) SET_Z; else if ((int32_t)result < 0) SET_S +#define CHK_XXXQ_ZS if (!result) SET_Z; else if ((int64_t)result < 0) SET_S #define CHK_XXXB_ZSP m_fcw |= z8000_zsp[result] @@ -216,9 +216,9 @@ UINT32 z8002_device::POPL(UINT8 src) add byte flags: CZSVDH ******************************************/ -UINT8 z8002_device::ADDB(UINT8 dest, UINT8 value) +uint8_t z8002_device::ADDB(uint8_t dest, uint8_t value) { - UINT8 result = dest + value; + uint8_t result = dest + value; CLR_CZSVH; /* first clear C, Z, S, P/V and H flags */ CLR_DA; /* clear DA (decimal adjust) flag for addb */ CHK_XXXB_ZS; /* set Z and S flags for result byte */ @@ -232,9 +232,9 @@ UINT8 z8002_device::ADDB(UINT8 dest, UINT8 value) add word flags: CZSV-- ******************************************/ -UINT16 z8002_device::ADDW(UINT16 dest, UINT16 value) +uint16_t z8002_device::ADDW(uint16_t dest, uint16_t value) { - UINT16 result = dest + value; + uint16_t result = dest + value; CLR_CZSV; /* first clear C, Z, S, P/V flags */ CHK_XXXW_ZS; /* set Z and S flags for result word */ CHK_ADDX_C; /* set C if result overflowed */ @@ -246,9 +246,9 @@ UINT16 z8002_device::ADDW(UINT16 dest, UINT16 value) add long flags: CZSV-- ******************************************/ -UINT32 z8002_device::ADDL(UINT32 dest, UINT32 value) +uint32_t z8002_device::ADDL(uint32_t dest, uint32_t value) { - UINT32 result = dest + value; + uint32_t result = dest + value; CLR_CZSV; /* first clear C, Z, S, P/V flags */ CHK_XXXL_ZS; /* set Z and S flags for result long */ CHK_ADDX_C; /* set C if result overflowed */ @@ -260,9 +260,9 @@ UINT32 z8002_device::ADDL(UINT32 dest, UINT32 value) add with carry byte flags: CZSVDH ******************************************/ -UINT8 z8002_device::ADCB(UINT8 dest, UINT8 value) +uint8_t z8002_device::ADCB(uint8_t dest, uint8_t value) { - UINT8 result = dest + value + GET_C; + uint8_t result = dest + value + GET_C; CLR_CZSVH; /* first clear C, Z, S, P/V and H flags */ CLR_DA; /* clear DA (decimal adjust) flag for adcb */ CHK_XXXB_ZS; /* set Z and S flags for result byte */ @@ -276,9 +276,9 @@ UINT8 z8002_device::ADCB(UINT8 dest, UINT8 value) add with carry word flags: CZSV-- ******************************************/ -UINT16 z8002_device::ADCW(UINT16 dest, UINT16 value) +uint16_t z8002_device::ADCW(uint16_t dest, uint16_t value) { - UINT16 result = dest + value + GET_C; + uint16_t result = dest + value + GET_C; CLR_CZSV; /* first clear C, Z, S, P/V flags */ CHK_XXXW_ZS; /* set Z and S flags for result word */ CHK_ADCX_C; /* set C if result overflowed */ @@ -290,9 +290,9 @@ UINT16 z8002_device::ADCW(UINT16 dest, UINT16 value) subtract byte flags: CZSVDH ******************************************/ -UINT8 z8002_device::SUBB(UINT8 dest, UINT8 value) +uint8_t z8002_device::SUBB(uint8_t dest, uint8_t value) { - UINT8 result = dest - value; + uint8_t result = dest - value; CLR_CZSVH; /* first clear C, Z, S, P/V and H flags */ SET_DA; /* set DA (decimal adjust) flag for subb */ CHK_XXXB_ZS; /* set Z and S flags for result byte */ @@ -306,9 +306,9 @@ UINT8 z8002_device::SUBB(UINT8 dest, UINT8 value) subtract word flags: CZSV-- ******************************************/ -UINT16 z8002_device::SUBW(UINT16 dest, UINT16 value) +uint16_t z8002_device::SUBW(uint16_t dest, uint16_t value) { - UINT16 result = dest - value; + uint16_t result = dest - value; CLR_CZSV; /* first clear C, Z, S, P/V flags */ CHK_XXXW_ZS; /* set Z and S flags for result word */ CHK_SUBX_C; /* set C if result underflowed */ @@ -320,9 +320,9 @@ UINT16 z8002_device::SUBW(UINT16 dest, UINT16 value) subtract long flags: CZSV-- ******************************************/ -UINT32 z8002_device::SUBL(UINT32 dest, UINT32 value) +uint32_t z8002_device::SUBL(uint32_t dest, uint32_t value) { - UINT32 result = dest - value; + uint32_t result = dest - value; CLR_CZSV; /* first clear C, Z, S, P/V flags */ CHK_XXXL_ZS; /* set Z and S flags for result long */ CHK_SUBX_C; /* set C if result underflowed */ @@ -334,9 +334,9 @@ UINT32 z8002_device::SUBL(UINT32 dest, UINT32 value) subtract with carry byte flags: CZSVDH ******************************************/ -UINT8 z8002_device::SBCB(UINT8 dest, UINT8 value) +uint8_t z8002_device::SBCB(uint8_t dest, uint8_t value) { - UINT8 result = dest - value - GET_C; + uint8_t result = dest - value - GET_C; CLR_CZSVH; /* first clear C, Z, S, P/V and H flags */ SET_DA; /* set DA (decimal adjust) flag for sbcb */ CHK_XXXB_ZS; /* set Z and S flags for result byte */ @@ -350,9 +350,9 @@ UINT8 z8002_device::SBCB(UINT8 dest, UINT8 value) subtract with carry word flags: CZSV-- ******************************************/ -UINT16 z8002_device::SBCW(UINT16 dest, UINT16 value) +uint16_t z8002_device::SBCW(uint16_t dest, uint16_t value) { - UINT16 result = dest - value - GET_C; + uint16_t result = dest - value - GET_C; CLR_CZSV; /* first clear C, Z, S, P/V flags */ CHK_XXXW_ZS; /* set Z and S flags for result word */ CHK_SBCX_C; /* set C if result underflowed */ @@ -364,9 +364,9 @@ UINT16 z8002_device::SBCW(UINT16 dest, UINT16 value) logical or byte flags: -ZSP-- ******************************************/ -UINT8 z8002_device::ORB(UINT8 dest, UINT8 value) +uint8_t z8002_device::ORB(uint8_t dest, uint8_t value) { - UINT8 result = dest | value; + uint8_t result = dest | value; CLR_ZSP; /* first clear Z, S, P/V flags */ CHK_XXXB_ZSP; /* set Z, S and P flags for result byte */ return result; @@ -376,9 +376,9 @@ UINT8 z8002_device::ORB(UINT8 dest, UINT8 value) logical or word flags: -ZS--- ******************************************/ -UINT16 z8002_device::ORW(UINT16 dest, UINT16 value) +uint16_t z8002_device::ORW(uint16_t dest, uint16_t value) { - UINT16 result = dest | value; + uint16_t result = dest | value; CLR_ZS; /* first clear Z, and S flags */ CHK_XXXW_ZS; /* set Z and S flags for result word */ return result; @@ -388,9 +388,9 @@ UINT16 z8002_device::ORW(UINT16 dest, UINT16 value) logical and byte flags: -ZSP-- ******************************************/ -UINT8 z8002_device::ANDB(UINT8 dest, UINT8 value) +uint8_t z8002_device::ANDB(uint8_t dest, uint8_t value) { - UINT8 result = dest & value; + uint8_t result = dest & value; CLR_ZSP; /* first clear Z,S and P/V flags */ CHK_XXXB_ZSP; /* set Z, S and P flags for result byte */ return result; @@ -400,9 +400,9 @@ UINT8 z8002_device::ANDB(UINT8 dest, UINT8 value) logical and word flags: -ZS--- ******************************************/ -UINT16 z8002_device::ANDW(UINT16 dest, UINT16 value) +uint16_t z8002_device::ANDW(uint16_t dest, uint16_t value) { - UINT16 result = dest & value; + uint16_t result = dest & value; CLR_ZS; /* first clear Z and S flags */ CHK_XXXW_ZS; /* set Z and S flags for result word */ return result; @@ -412,9 +412,9 @@ UINT16 z8002_device::ANDW(UINT16 dest, UINT16 value) logical exclusive or byte flags: -ZSP-- ******************************************/ -UINT8 z8002_device::XORB(UINT8 dest, UINT8 value) +uint8_t z8002_device::XORB(uint8_t dest, uint8_t value) { - UINT8 result = dest ^ value; + uint8_t result = dest ^ value; CLR_ZSP; /* first clear Z, S and P/V flags */ CHK_XXXB_ZSP; /* set Z, S and P flags for result byte */ return result; @@ -424,9 +424,9 @@ UINT8 z8002_device::XORB(UINT8 dest, UINT8 value) logical exclusive or word flags: -ZS--- ******************************************/ -UINT16 z8002_device::XORW(UINT16 dest, UINT16 value) +uint16_t z8002_device::XORW(uint16_t dest, uint16_t value) { - UINT16 result = dest ^ value; + uint16_t result = dest ^ value; CLR_ZS; /* first clear Z and S flags */ CHK_XXXW_ZS; /* set Z and S flags for result word */ return result; @@ -437,9 +437,9 @@ UINT16 z8002_device::XORW(UINT16 dest, UINT16 value) compare byte flags: CZSV-- ******************************************/ -void z8002_device::CPB(UINT8 dest, UINT8 value) +void z8002_device::CPB(uint8_t dest, uint8_t value) { - UINT8 result = dest - value; + uint8_t result = dest - value; CLR_CZSV; /* first clear C, Z, S and P/V flags */ CHK_XXXB_ZS; /* set Z and S flags for result byte */ CHK_SUBX_C; /* set C if result underflowed */ @@ -450,9 +450,9 @@ void z8002_device::CPB(UINT8 dest, UINT8 value) compare word flags: CZSV-- ******************************************/ -void z8002_device::CPW(UINT16 dest, UINT16 value) +void z8002_device::CPW(uint16_t dest, uint16_t value) { - UINT16 result = dest - value; + uint16_t result = dest - value; CLR_CZSV; CHK_XXXW_ZS; /* set Z and S flags for result word */ CHK_SUBX_C; /* set C if result underflowed */ @@ -463,9 +463,9 @@ void z8002_device::CPW(UINT16 dest, UINT16 value) compare long flags: CZSV-- ******************************************/ -void z8002_device::CPL(UINT32 dest, UINT32 value) +void z8002_device::CPL(uint32_t dest, uint32_t value) { - UINT32 result = dest - value; + uint32_t result = dest - value; CLR_CZSV; CHK_XXXL_ZS; /* set Z and S flags for result long */ CHK_SUBX_C; /* set C if result underflowed */ @@ -476,9 +476,9 @@ void z8002_device::CPL(UINT32 dest, UINT32 value) complement byte flags: -ZSP-- ******************************************/ -UINT8 z8002_device::COMB(UINT8 dest) +uint8_t z8002_device::COMB(uint8_t dest) { - UINT8 result = ~dest; + uint8_t result = ~dest; CLR_ZSP; CHK_XXXB_ZSP; /* set Z, S and P flags for result byte */ return result; @@ -488,9 +488,9 @@ UINT8 z8002_device::COMB(UINT8 dest) complement word flags: -ZS--- ******************************************/ -UINT16 z8002_device::COMW(UINT16 dest) +uint16_t z8002_device::COMW(uint16_t dest) { - UINT16 result = ~dest; + uint16_t result = ~dest; CLR_ZS; CHK_XXXW_ZS; /* set Z and S flags for result word */ return result; @@ -500,9 +500,9 @@ UINT16 z8002_device::COMW(UINT16 dest) negate byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::NEGB(UINT8 dest) +uint8_t z8002_device::NEGB(uint8_t dest) { - UINT8 result = (UINT8) -dest; + uint8_t result = (uint8_t) -dest; CLR_CZSV; CHK_XXXB_ZS; /* set Z and S flags for result byte */ if (result > 0) SET_C; @@ -514,9 +514,9 @@ UINT8 z8002_device::NEGB(UINT8 dest) negate word flags: CZSV-- ******************************************/ -UINT16 z8002_device::NEGW(UINT16 dest) +uint16_t z8002_device::NEGW(uint16_t dest) { - UINT16 result = (UINT16) -dest; + uint16_t result = (uint16_t) -dest; CLR_CZSV; CHK_XXXW_ZS; /* set Z and S flags for result word */ if (result > 0) SET_C; @@ -528,7 +528,7 @@ UINT16 z8002_device::NEGW(UINT16 dest) test byte flags: -ZSP-- ******************************************/ -void z8002_device::TESTB(UINT8 result) +void z8002_device::TESTB(uint8_t result) { CLR_ZSP; CHK_XXXB_ZSP; /* set Z and S flags for result byte */ @@ -538,7 +538,7 @@ void z8002_device::TESTB(UINT8 result) test word flags: -ZS--- ******************************************/ -void z8002_device::TESTW(UINT16 dest) +void z8002_device::TESTW(uint16_t dest) { CLR_ZS; if (!dest) SET_Z; else if (dest & S16) SET_S; @@ -548,7 +548,7 @@ void z8002_device::TESTW(UINT16 dest) test long flags: -ZS--- ******************************************/ -void z8002_device::TESTL(UINT32 dest) +void z8002_device::TESTL(uint32_t dest) { CLR_ZS; if (!dest) SET_Z; else if (dest & S32) SET_S; @@ -558,9 +558,9 @@ void z8002_device::TESTL(UINT32 dest) increment byte flags: -ZSV-- ******************************************/ -UINT8 z8002_device::INCB(UINT8 dest, UINT8 value) +uint8_t z8002_device::INCB(uint8_t dest, uint8_t value) { - UINT8 result = dest + value; + uint8_t result = dest + value; CLR_ZSV; CHK_XXXB_ZS; /* set Z and S flags for result byte */ CHK_ADDB_V; /* set V if result overflowed */ @@ -571,9 +571,9 @@ UINT8 z8002_device::INCB(UINT8 dest, UINT8 value) increment word flags: -ZSV-- ******************************************/ -UINT16 z8002_device::INCW(UINT16 dest, UINT16 value) +uint16_t z8002_device::INCW(uint16_t dest, uint16_t value) { - UINT16 result = dest + value; + uint16_t result = dest + value; CLR_ZSV; CHK_XXXW_ZS; /* set Z and S flags for result byte */ CHK_ADDW_V; /* set V if result overflowed */ @@ -584,9 +584,9 @@ UINT16 z8002_device::INCW(UINT16 dest, UINT16 value) decrement byte flags: -ZSV-- ******************************************/ -UINT8 z8002_device::DECB(UINT8 dest, UINT8 value) +uint8_t z8002_device::DECB(uint8_t dest, uint8_t value) { - UINT8 result = dest - value; + uint8_t result = dest - value; CLR_ZSV; CHK_XXXB_ZS; /* set Z and S flags for result byte */ CHK_SUBB_V; /* set V if result overflowed */ @@ -597,9 +597,9 @@ UINT8 z8002_device::DECB(UINT8 dest, UINT8 value) decrement word flags: -ZSV-- ******************************************/ -UINT16 z8002_device::DECW(UINT16 dest, UINT16 value) +uint16_t z8002_device::DECW(uint16_t dest, uint16_t value) { - UINT16 result = dest - value; + uint16_t result = dest - value; CLR_ZSV; CHK_XXXW_ZS; /* set Z and S flags for result word */ CHK_SUBW_V; /* set V if result overflowed */ @@ -610,9 +610,9 @@ UINT16 z8002_device::DECW(UINT16 dest, UINT16 value) multiply words flags: CZSV-- ******************************************/ -UINT32 z8002_device::MULTW(UINT16 dest, UINT16 value) +uint32_t z8002_device::MULTW(uint16_t dest, uint16_t value) { - UINT32 result = (INT32)(INT16)dest * (INT16)value; + uint32_t result = (int32_t)(int16_t)dest * (int16_t)value; CLR_CZSV; CHK_XXXL_ZS; if(!value) @@ -620,7 +620,7 @@ UINT32 z8002_device::MULTW(UINT16 dest, UINT16 value) /* multiplication with zero is faster */ m_icount += (70-18); } - if((INT32)result < -0x7fff || (INT32)result >= 0x7fff) SET_C; + if((int32_t)result < -0x7fff || (int32_t)result >= 0x7fff) SET_C; return result; } @@ -628,9 +628,9 @@ UINT32 z8002_device::MULTW(UINT16 dest, UINT16 value) multiply longs flags: CZSV-- ******************************************/ -UINT64 z8002_device::MULTL(UINT32 dest, UINT32 value) +uint64_t z8002_device::MULTL(uint32_t dest, uint32_t value) { - UINT64 result = (INT64)(INT32)dest * (INT32)value; + uint64_t result = (int64_t)(int32_t)dest * (int32_t)value; if(!value) { /* multiplication with zero is faster */ @@ -644,7 +644,7 @@ UINT64 z8002_device::MULTL(UINT32 dest, UINT32 value) } CLR_CZSV; CHK_XXXQ_ZS; - if((INT64)result < -0x7fffffffL || (INT64)result >= 0x7fffffffL) SET_C; + if((int64_t)result < -0x7fffffffL || (int64_t)result >= 0x7fffffffL) SET_C; return result; } @@ -652,24 +652,24 @@ UINT64 z8002_device::MULTL(UINT32 dest, UINT32 value) divide long by word flags: CZSV-- ******************************************/ -UINT32 z8002_device::DIVW(UINT32 dest, UINT16 value) +uint32_t z8002_device::DIVW(uint32_t dest, uint16_t value) { - UINT32 result = dest; - UINT16 remainder = 0; + uint32_t result = dest; + uint16_t remainder = 0; CLR_CZSV; if (value) { - UINT16 qsign = ((dest >> 16) ^ value) & S16; - UINT16 rsign = (dest >> 16) & S16; - if ((INT32)dest < 0) dest = -dest; - if ((INT16)value < 0) value = -value; + uint16_t qsign = ((dest >> 16) ^ value) & S16; + uint16_t rsign = (dest >> 16) & S16; + if ((int32_t)dest < 0) dest = -dest; + if ((int16_t)value < 0) value = -value; result = dest / value; remainder = dest % value; if (qsign) result = -result; if (rsign) remainder = -remainder; - if ((INT32)result < -0x8000 || (INT32)result > 0x7fff) + if ((int32_t)result < -0x8000 || (int32_t)result > 0x7fff) { - INT32 temp = (INT32)result >> 1; + int32_t temp = (int32_t)result >> 1; SET_V; if (temp >= -0x8000 && temp <= 0x7fff) { @@ -682,7 +682,7 @@ UINT32 z8002_device::DIVW(UINT32 dest, UINT16 value) { CHK_XXXW_ZS; } - result = ((UINT32)remainder << 16) | (result & 0xffff); + result = ((uint32_t)remainder << 16) | (result & 0xffff); } else { @@ -696,24 +696,24 @@ UINT32 z8002_device::DIVW(UINT32 dest, UINT16 value) divide quad word by long flags: CZSV-- ******************************************/ -UINT64 z8002_device::DIVL(UINT64 dest, UINT32 value) +uint64_t z8002_device::DIVL(uint64_t dest, uint32_t value) { - UINT64 result = dest; - UINT32 remainder = 0; + uint64_t result = dest; + uint32_t remainder = 0; CLR_CZSV; if (value) { - UINT32 qsign = ((dest >> 32) ^ value) & S32; - UINT32 rsign = (dest >> 32) & S32; - if ((INT64)dest < 0) dest = -dest; - if ((INT32)value < 0) value = -value; + uint32_t qsign = ((dest >> 32) ^ value) & S32; + uint32_t rsign = (dest >> 32) & S32; + if ((int64_t)dest < 0) dest = -dest; + if ((int32_t)value < 0) value = -value; result = dest / value; remainder = dest % value; if (qsign) result = -result; if (rsign) remainder = -remainder; - if ((INT64)result < -0x80000000 || (INT64)result > 0x7fffffff) + if ((int64_t)result < -0x80000000 || (int64_t)result > 0x7fffffff) { - INT64 temp = (INT64)result >> 1; + int64_t temp = (int64_t)result >> 1; SET_V; if (temp >= -0x80000000 && temp <= 0x7fffffff) { @@ -726,7 +726,7 @@ UINT64 z8002_device::DIVL(UINT64 dest, UINT32 value) { CHK_XXXL_ZS; } - result = ((UINT64)remainder << 32) | (result & 0xffffffff); + result = ((uint64_t)remainder << 32) | (result & 0xffffffff); } else { @@ -740,9 +740,9 @@ UINT64 z8002_device::DIVL(UINT64 dest, UINT32 value) rotate left byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::RLB(UINT8 dest, UINT8 twice) +uint8_t z8002_device::RLB(uint8_t dest, uint8_t twice) { - UINT8 result = (dest << 1) | (dest >> 7); + uint8_t result = (dest << 1) | (dest >> 7); CLR_CZSV; if (twice) result = (result << 1) | (result >> 7); CHK_XXXB_ZS; /* set Z and S flags for result byte */ @@ -755,9 +755,9 @@ UINT8 z8002_device::RLB(UINT8 dest, UINT8 twice) rotate left word flags: CZSV-- ******************************************/ -UINT16 z8002_device::RLW(UINT16 dest, UINT8 twice) +uint16_t z8002_device::RLW(uint16_t dest, uint8_t twice) { - UINT16 result = (dest << 1) | (dest >> 15); + uint16_t result = (dest << 1) | (dest >> 15); CLR_CZSV; if (twice) result = (result << 1) | (result >> 15); CHK_XXXW_ZS; /* set Z and S flags for result word */ @@ -770,13 +770,13 @@ UINT16 z8002_device::RLW(UINT16 dest, UINT8 twice) rotate left through carry byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::RLCB(UINT8 dest, UINT8 twice) +uint8_t z8002_device::RLCB(uint8_t dest, uint8_t twice) { - UINT8 c = dest & S08; - UINT8 result = (dest << 1) | GET_C; + uint8_t c = dest & S08; + uint8_t result = (dest << 1) | GET_C; CLR_CZSV; if (twice) { - UINT8 c1 = c >> 7; + uint8_t c1 = c >> 7; c = result & S08; result = (result << 1) | c1; } @@ -790,13 +790,13 @@ UINT8 z8002_device::RLCB(UINT8 dest, UINT8 twice) rotate left through carry word flags: CZSV-- ******************************************/ -UINT16 z8002_device::RLCW(UINT16 dest, UINT8 twice) +uint16_t z8002_device::RLCW(uint16_t dest, uint8_t twice) { - UINT16 c = dest & S16; - UINT16 result = (dest << 1) | GET_C; + uint16_t c = dest & S16; + uint16_t result = (dest << 1) | GET_C; CLR_CZSV; if (twice) { - UINT16 c1 = c >> 15; + uint16_t c1 = c >> 15; c = result & S16; result = (result << 1) | c1; } @@ -810,9 +810,9 @@ UINT16 z8002_device::RLCW(UINT16 dest, UINT8 twice) rotate right byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::RRB(UINT8 dest, UINT8 twice) +uint8_t z8002_device::RRB(uint8_t dest, uint8_t twice) { - UINT8 result = (dest >> 1) | (dest << 7); + uint8_t result = (dest >> 1) | (dest << 7); CLR_CZSV; if (twice) result = (result >> 1) | (result << 7); if (!result) SET_Z; else if (result & S08) SET_SC; @@ -824,9 +824,9 @@ UINT8 z8002_device::RRB(UINT8 dest, UINT8 twice) rotate right word flags: CZSV-- ******************************************/ -UINT16 z8002_device::RRW(UINT16 dest, UINT8 twice) +uint16_t z8002_device::RRW(uint16_t dest, uint8_t twice) { - UINT16 result = (dest >> 1) | (dest << 15); + uint16_t result = (dest >> 1) | (dest << 15); CLR_CZSV; if (twice) result = (result >> 1) | (result << 15); if (!result) SET_Z; else if (result & S16) SET_SC; @@ -838,13 +838,13 @@ UINT16 z8002_device::RRW(UINT16 dest, UINT8 twice) rotate right through carry byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::RRCB(UINT8 dest, UINT8 twice) +uint8_t z8002_device::RRCB(uint8_t dest, uint8_t twice) { - UINT8 c = dest & 1; - UINT8 result = (dest >> 1) | (GET_C << 7); + uint8_t c = dest & 1; + uint8_t result = (dest >> 1) | (GET_C << 7); CLR_CZSV; if (twice) { - UINT8 c1 = c << 7; + uint8_t c1 = c << 7; c = result & 1; result = (result >> 1) | c1; } @@ -858,13 +858,13 @@ UINT8 z8002_device::RRCB(UINT8 dest, UINT8 twice) rotate right through carry word flags: CZSV-- ******************************************/ -UINT16 z8002_device::RRCW(UINT16 dest, UINT8 twice) +uint16_t z8002_device::RRCW(uint16_t dest, uint8_t twice) { - UINT16 c = dest & 1; - UINT16 result = (dest >> 1) | (GET_C << 15); + uint16_t c = dest & 1; + uint16_t result = (dest >> 1) | (GET_C << 15); CLR_CZSV; if (twice) { - UINT16 c1 = c << 15; + uint16_t c1 = c << 15; c = result & 1; result = (result >> 1) | c1; } @@ -878,10 +878,10 @@ UINT16 z8002_device::RRCW(UINT16 dest, UINT8 twice) shift dynamic arithmetic byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::SDAB(UINT8 dest, INT8 count) +uint8_t z8002_device::SDAB(uint8_t dest, int8_t count) { - INT8 result = (INT8) dest; - UINT8 c = 0; + int8_t result = (int8_t) dest; + uint8_t c = 0; CLR_CZSV; while (count > 0) { c = result & S08; @@ -896,17 +896,17 @@ UINT8 z8002_device::SDAB(UINT8 dest, INT8 count) CHK_XXXB_ZS; /* set Z and S flags for result byte */ if (c) SET_C; if ((result ^ dest) & S08) SET_V; - return (UINT8)result; + return (uint8_t)result; } /****************************************** shift dynamic arithmetic word flags: CZSV-- ******************************************/ -UINT16 z8002_device::SDAW(UINT16 dest, INT8 count) +uint16_t z8002_device::SDAW(uint16_t dest, int8_t count) { - INT16 result = (INT16) dest; - UINT16 c = 0; + int16_t result = (int16_t) dest; + uint16_t c = 0; CLR_CZSV; while (count > 0) { c = result & S16; @@ -921,17 +921,17 @@ UINT16 z8002_device::SDAW(UINT16 dest, INT8 count) CHK_XXXW_ZS; /* set Z and S flags for result word */ if (c) SET_C; if ((result ^ dest) & S16) SET_V; - return (UINT16)result; + return (uint16_t)result; } /****************************************** shift dynamic arithmetic long flags: CZSV-- ******************************************/ -UINT32 z8002_device::SDAL(UINT32 dest, INT8 count) +uint32_t z8002_device::SDAL(uint32_t dest, int8_t count) { - INT32 result = (INT32) dest; - UINT32 c = 0; + int32_t result = (int32_t) dest; + uint32_t c = 0; CLR_CZSV; while (count > 0) { c = result & S32; @@ -946,17 +946,17 @@ UINT32 z8002_device::SDAL(UINT32 dest, INT8 count) CHK_XXXL_ZS; /* set Z and S flags for result long */ if (c) SET_C; if ((result ^ dest) & S32) SET_V; - return (UINT32) result; + return (uint32_t) result; } /****************************************** shift dynamic logic byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::SDLB(UINT8 dest, INT8 count) +uint8_t z8002_device::SDLB(uint8_t dest, int8_t count) { - UINT8 result = dest; - UINT8 c = 0; + uint8_t result = dest; + uint8_t c = 0; CLR_CZSV; while (count > 0) { c = result & S08; @@ -978,10 +978,10 @@ UINT8 z8002_device::SDLB(UINT8 dest, INT8 count) shift dynamic logic word flags: CZSV-- ******************************************/ -UINT16 z8002_device::SDLW(UINT16 dest, INT8 count) +uint16_t z8002_device::SDLW(uint16_t dest, int8_t count) { - UINT16 result = dest; - UINT16 c = 0; + uint16_t result = dest; + uint16_t c = 0; CLR_CZSV; while (count > 0) { c = result & S16; @@ -1003,10 +1003,10 @@ UINT16 z8002_device::SDLW(UINT16 dest, INT8 count) shift dynamic logic long flags: CZSV-- ******************************************/ -UINT32 z8002_device::SDLL(UINT32 dest, INT8 count) +uint32_t z8002_device::SDLL(uint32_t dest, int8_t count) { - UINT32 result = dest; - UINT32 c = 0; + uint32_t result = dest; + uint32_t c = 0; CLR_CZSV; while (count > 0) { c = result & S32; @@ -1028,10 +1028,10 @@ UINT32 z8002_device::SDLL(UINT32 dest, INT8 count) shift left arithmetic byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::SLAB(UINT8 dest, UINT8 count) +uint8_t z8002_device::SLAB(uint8_t dest, uint8_t count) { - UINT8 c = (count) ? (dest << (count - 1)) & S08 : 0; - UINT8 result = (UINT8)((INT8)dest << count); + uint8_t c = (count) ? (dest << (count - 1)) & S08 : 0; + uint8_t result = (uint8_t)((int8_t)dest << count); CLR_CZSV; CHK_XXXB_ZS; /* set Z and S flags for result byte */ if (c) SET_C; @@ -1043,10 +1043,10 @@ UINT8 z8002_device::SLAB(UINT8 dest, UINT8 count) shift left arithmetic word flags: CZSV-- ******************************************/ -UINT16 z8002_device::SLAW(UINT16 dest, UINT8 count) +uint16_t z8002_device::SLAW(uint16_t dest, uint8_t count) { - UINT16 c = (count) ? (dest << (count - 1)) & S16 : 0; - UINT16 result = (UINT16)((INT16)dest << count); + uint16_t c = (count) ? (dest << (count - 1)) & S16 : 0; + uint16_t result = (uint16_t)((int16_t)dest << count); CLR_CZSV; CHK_XXXW_ZS; /* set Z and S flags for result word */ if (c) SET_C; @@ -1058,10 +1058,10 @@ UINT16 z8002_device::SLAW(UINT16 dest, UINT8 count) shift left arithmetic long flags: CZSV-- ******************************************/ -UINT32 z8002_device::SLAL(UINT32 dest, UINT8 count) +uint32_t z8002_device::SLAL(uint32_t dest, uint8_t count) { - UINT32 c = (count) ? (dest << (count - 1)) & S32 : 0; - UINT32 result = (UINT32)((INT32)dest << count); + uint32_t c = (count) ? (dest << (count - 1)) & S32 : 0; + uint32_t result = (uint32_t)((int32_t)dest << count); CLR_CZSV; CHK_XXXL_ZS; /* set Z and S flags for result long */ if (c) SET_C; @@ -1073,10 +1073,10 @@ UINT32 z8002_device::SLAL(UINT32 dest, UINT8 count) shift left logic byte flags: CZS--- ******************************************/ -UINT8 z8002_device::SLLB(UINT8 dest, UINT8 count) +uint8_t z8002_device::SLLB(uint8_t dest, uint8_t count) { - UINT8 c = (count) ? (dest << (count - 1)) & S08 : 0; - UINT8 result = dest << count; + uint8_t c = (count) ? (dest << (count - 1)) & S08 : 0; + uint8_t result = dest << count; CLR_CZS; CHK_XXXB_ZS; /* set Z and S flags for result byte */ if (c) SET_C; @@ -1087,10 +1087,10 @@ UINT8 z8002_device::SLLB(UINT8 dest, UINT8 count) shift left logic word flags: CZS--- ******************************************/ -UINT16 z8002_device::SLLW(UINT16 dest, UINT8 count) +uint16_t z8002_device::SLLW(uint16_t dest, uint8_t count) { - UINT16 c = (count) ? (dest << (count - 1)) & S16 : 0; - UINT16 result = dest << count; + uint16_t c = (count) ? (dest << (count - 1)) & S16 : 0; + uint16_t result = dest << count; CLR_CZS; CHK_XXXW_ZS; /* set Z and S flags for result word */ if (c) SET_C; @@ -1101,10 +1101,10 @@ UINT16 z8002_device::SLLW(UINT16 dest, UINT8 count) shift left logic long flags: CZS--- ******************************************/ -UINT32 z8002_device::SLLL(UINT32 dest, UINT8 count) +uint32_t z8002_device::SLLL(uint32_t dest, uint8_t count) { - UINT32 c = (count) ? (dest << (count - 1)) & S32 : 0; - UINT32 result = dest << count; + uint32_t c = (count) ? (dest << (count - 1)) & S32 : 0; + uint32_t result = dest << count; CLR_CZS; CHK_XXXL_ZS; /* set Z and S flags for result long */ if (c) SET_C; @@ -1115,10 +1115,10 @@ UINT32 z8002_device::SLLL(UINT32 dest, UINT8 count) shift right arithmetic byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::SRAB(UINT8 dest, UINT8 count) +uint8_t z8002_device::SRAB(uint8_t dest, uint8_t count) { - UINT8 c = (count) ? ((INT8)dest >> (count - 1)) & 1 : 0; - UINT8 result = (UINT8)((INT8)dest >> count); + uint8_t c = (count) ? ((int8_t)dest >> (count - 1)) & 1 : 0; + uint8_t result = (uint8_t)((int8_t)dest >> count); CLR_CZSV; CHK_XXXB_ZS; /* set Z and S flags for result byte */ if (c) SET_C; @@ -1129,10 +1129,10 @@ UINT8 z8002_device::SRAB(UINT8 dest, UINT8 count) shift right arithmetic word flags: CZSV-- ******************************************/ -UINT16 z8002_device::SRAW(UINT16 dest, UINT8 count) +uint16_t z8002_device::SRAW(uint16_t dest, uint8_t count) { - UINT8 c = (count) ? ((INT16)dest >> (count - 1)) & 1 : 0; - UINT16 result = (UINT16)((INT16)dest >> count); + uint8_t c = (count) ? ((int16_t)dest >> (count - 1)) & 1 : 0; + uint16_t result = (uint16_t)((int16_t)dest >> count); CLR_CZSV; CHK_XXXW_ZS; /* set Z and S flags for result word */ if (c) SET_C; @@ -1143,10 +1143,10 @@ UINT16 z8002_device::SRAW(UINT16 dest, UINT8 count) shift right arithmetic long flags: CZSV-- ******************************************/ -UINT32 z8002_device::SRAL(UINT32 dest, UINT8 count) +uint32_t z8002_device::SRAL(uint32_t dest, uint8_t count) { - UINT8 c = (count) ? ((INT32)dest >> (count - 1)) & 1 : 0; - UINT32 result = (UINT32)((INT32)dest >> count); + uint8_t c = (count) ? ((int32_t)dest >> (count - 1)) & 1 : 0; + uint32_t result = (uint32_t)((int32_t)dest >> count); CLR_CZSV; CHK_XXXL_ZS; /* set Z and S flags for result long */ if (c) SET_C; @@ -1157,10 +1157,10 @@ UINT32 z8002_device::SRAL(UINT32 dest, UINT8 count) shift right logic byte flags: CZSV-- ******************************************/ -UINT8 z8002_device::SRLB(UINT8 dest, UINT8 count) +uint8_t z8002_device::SRLB(uint8_t dest, uint8_t count) { - UINT8 c = (count) ? (dest >> (count - 1)) & 1 : 0; - UINT8 result = dest >> count; + uint8_t c = (count) ? (dest >> (count - 1)) & 1 : 0; + uint8_t result = dest >> count; CLR_CZS; CHK_XXXB_ZS; /* set Z and S flags for result byte */ if (c) SET_C; @@ -1171,10 +1171,10 @@ UINT8 z8002_device::SRLB(UINT8 dest, UINT8 count) shift right logic word flags: CZSV-- ******************************************/ -UINT16 z8002_device::SRLW(UINT16 dest, UINT8 count) +uint16_t z8002_device::SRLW(uint16_t dest, uint8_t count) { - UINT8 c = (count) ? (dest >> (count - 1)) & 1 : 0; - UINT16 result = dest >> count; + uint8_t c = (count) ? (dest >> (count - 1)) & 1 : 0; + uint16_t result = dest >> count; CLR_CZS; CHK_XXXW_ZS; /* set Z and S flags for result word */ if (c) SET_C; @@ -1185,10 +1185,10 @@ UINT16 z8002_device::SRLW(UINT16 dest, UINT8 count) shift right logic long flags: CZSV-- ******************************************/ -UINT32 z8002_device::SRLL(UINT32 dest, UINT8 count) +uint32_t z8002_device::SRLL(uint32_t dest, uint8_t count) { - UINT8 c = (count) ? (dest >> (count - 1)) & 1 : 0; - UINT32 result = dest >> count; + uint8_t c = (count) ? (dest >> (count - 1)) & 1 : 0; + uint32_t result = dest >> count; CLR_CZS; CHK_XXXL_ZS; /* set Z and S flags for result long */ if (c) SET_C; @@ -1475,7 +1475,7 @@ void z8002_device::Z0B_ssN0_dddd() void z8002_device::Z0C_ddN0_0000() { GET_DST(OP0,NIB3); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_B(AS_DATA, addr, COMB(RDMEM_B(AS_DATA, addr))); } @@ -1497,7 +1497,7 @@ void z8002_device::Z0C_ddN0_0001_imm8() void z8002_device::Z0C_ddN0_0010() { GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_B(AS_DATA, addr, NEGB(RDMEM_B(AS_DATA, addr))); } @@ -1529,7 +1529,7 @@ void z8002_device::Z0C_ddN0_0101_imm8() void z8002_device::Z0C_ddN0_0110() { GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); if (RDMEM_B(AS_DATA, addr) & S08) SET_S; else CLR_S; WRMEM_B(AS_DATA, addr, 0xff); } @@ -1551,7 +1551,7 @@ void z8002_device::Z0C_ddN0_1000() void z8002_device::Z0D_ddN0_0000() { GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_W(AS_DATA, addr, COMW(RDMEM_W(AS_DATA, addr))); } @@ -1573,7 +1573,7 @@ void z8002_device::Z0D_ddN0_0001_imm16() void z8002_device::Z0D_ddN0_0010() { GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_W(AS_DATA, addr, NEGW(RDMEM_W(AS_DATA, addr))); } @@ -1605,7 +1605,7 @@ void z8002_device::Z0D_ddN0_0101_imm16() void z8002_device::Z0D_ddN0_0110() { GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); if (RDMEM_W(AS_DATA, addr) & S16) SET_S; else CLR_S; WRMEM_W(AS_DATA, addr, 0xffff); } @@ -1900,7 +1900,7 @@ void z8002_device::Z1C_ddN0_1001_0000_ssss_0000_nmin1() GET_DST(OP0,NIB2); GET_CNT(OP1,NIB3); GET_SRC(OP1,NIB1); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); while (cnt-- >= 0) { WRMEM_W(AS_DATA, addr, RW(src)); addr = addr_add(addr, 2); @@ -1917,7 +1917,7 @@ void z8002_device::Z1C_ssN0_0001_0000_dddd_0000_nmin1() GET_SRC(OP0,NIB2); GET_CNT(OP1,NIB3); GET_DST(OP1,NIB1); - UINT32 addr = addr_from_reg(src); + uint32_t addr = addr_from_reg(src); while (cnt-- >= 0) { RW(dst) = RDMEM_W(AS_DATA, addr); addr = addr_add(addr, 2); @@ -2030,7 +2030,7 @@ void z8002_device::Z22_ddN0_imm4() { GET_BIT(OP0); GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_B(AS_DATA, addr, RDMEM_B(AS_DATA, addr) & ~bit); } @@ -2053,7 +2053,7 @@ void z8002_device::Z23_ddN0_imm4() { GET_BIT(OP0); GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_W(AS_DATA, addr, RDMEM_W(AS_DATA, addr) & ~bit); } @@ -2076,7 +2076,7 @@ void z8002_device::Z24_ddN0_imm4() { GET_BIT(OP0); GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_B(AS_DATA, addr, RDMEM_B(AS_DATA, addr) | bit); } @@ -2099,7 +2099,7 @@ void z8002_device::Z25_ddN0_imm4() { GET_BIT(OP0); GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_W(AS_DATA, addr, RDMEM_W(AS_DATA, addr) | bit); } @@ -2155,7 +2155,7 @@ void z8002_device::Z28_ddN0_imm4m1() { GET_I4M1(OP0,NIB3); GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_B(AS_DATA, addr, INCB(RDMEM_B(AS_DATA, addr), i4p1)); } @@ -2167,7 +2167,7 @@ void z8002_device::Z29_ddN0_imm4m1() { GET_I4M1(OP0,NIB3); GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_W(AS_DATA, addr, INCW(RDMEM_W(AS_DATA, addr), i4p1)); } @@ -2179,7 +2179,7 @@ void z8002_device::Z2A_ddN0_imm4m1() { GET_I4M1(OP0,NIB3); GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_B(AS_DATA, addr, DECB(RDMEM_B(AS_DATA, addr), i4p1)); } @@ -2191,7 +2191,7 @@ void z8002_device::Z2B_ddN0_imm4m1() { GET_I4M1(OP0,NIB3); GET_DST(OP0,NIB2); - UINT32 addr = addr_from_reg(dst); + uint32_t addr = addr_from_reg(dst); WRMEM_W(AS_DATA, addr, DECW(RDMEM_W(AS_DATA, addr), i4p1)); } @@ -2203,8 +2203,8 @@ void z8002_device::Z2C_ssN0_dddd() { GET_DST(OP0,NIB3); GET_SRC(OP0,NIB2); - UINT32 addr = addr_from_reg(src); - UINT8 tmp = RDMEM_B( AS_DATA, addr); + uint32_t addr = addr_from_reg(src); + uint8_t tmp = RDMEM_B( AS_DATA, addr); WRMEM_B(AS_DATA, addr, RB(dst)); RB(dst) = tmp; } @@ -2217,8 +2217,8 @@ void z8002_device::Z2D_ssN0_dddd() { GET_DST(OP0,NIB3); GET_SRC(OP0,NIB2); - UINT32 addr = addr_from_reg(src); - UINT16 tmp = RDMEM_W(AS_DATA, addr); + uint32_t addr = addr_from_reg(src); + uint16_t tmp = RDMEM_W(AS_DATA, addr); WRMEM_W(AS_DATA, addr, RW(dst)); RW(dst) = tmp; } @@ -2464,15 +2464,15 @@ void z8002_device::Z39_ssN0_0000() { CHECK_PRIVILEGED_INSTR(); GET_SRC(OP0,NIB2); - UINT16 fcw; + uint16_t fcw; if (segmented_mode()) { - UINT32 addr = addr_from_reg(src); + uint32_t addr = addr_from_reg(src); fcw = RDMEM_W(AS_DATA, addr + 2); set_pc(segmented_addr(RDMEM_L(AS_DATA, addr + 4))); } else { fcw = RDMEM_W(AS_DATA, RW(src)); - set_pc(RDMEM_W(AS_DATA, (UINT16)(RW(src) + 2))); + set_pc(RDMEM_W(AS_DATA, (uint16_t)(RW(src) + 2))); } if ((fcw ^ m_fcw) & F_SEG) printf("ldps 1 (0x%05x): changing from %ssegmented mode to %ssegmented mode\n", m_pc, (m_fcw & F_SEG) ? "non-" : "", (fcw & F_SEG) ? "" : "non-"); CHANGE_FCW(fcw); /* check for user/system mode change */ @@ -4314,7 +4314,7 @@ void z8002_device::Z6C_0000_dddd_addr() { GET_DST(OP0,NIB3); GET_ADDR(OP1); - UINT8 tmp = RDMEM_B(AS_DATA, addr); + uint8_t tmp = RDMEM_B(AS_DATA, addr); WRMEM_B(AS_DATA, addr, RB(dst)); RB(dst) = tmp; } @@ -4328,7 +4328,7 @@ void z8002_device::Z6C_ssN0_dddd_addr() GET_DST(OP0,NIB3); GET_SRC(OP0,NIB2); GET_ADDR(OP1); - UINT8 tmp; + uint8_t tmp; addr = addr_add(addr, RW(src)); tmp = RDMEM_B(AS_DATA, addr); WRMEM_B(AS_DATA, addr, RB(dst)); @@ -4343,7 +4343,7 @@ void z8002_device::Z6D_0000_dddd_addr() { GET_DST(OP0,NIB3); GET_ADDR(OP1); - UINT16 tmp = RDMEM_W(AS_DATA, addr); + uint16_t tmp = RDMEM_W(AS_DATA, addr); WRMEM_W(AS_DATA, addr, RW(dst)); RW(dst) = tmp; } @@ -4357,7 +4357,7 @@ void z8002_device::Z6D_ssN0_dddd_addr() GET_DST(OP0,NIB3); GET_SRC(OP0,NIB2); GET_ADDR(OP1); - UINT16 tmp; + uint16_t tmp; addr = addr_add(addr, RW(src)); tmp = RDMEM_W(AS_DATA, addr); WRMEM_W(AS_DATA, addr, RW(dst)); @@ -4515,7 +4515,7 @@ void z8002_device::Z76_ssN0_dddd_addr() GET_DST(OP0,NIB3); GET_SRC(OP0,NIB2); GET_ADDR_RAW(OP1); - UINT16 temp = RW(src); // store src in case dst == src + uint16_t temp = RW(src); // store src in case dst == src if (segmented_mode()) { RL(dst) = addr; } @@ -4559,14 +4559,14 @@ void z8002_device::Z79_0000_0000_addr() { CHECK_PRIVILEGED_INSTR(); GET_ADDR(OP1); - UINT16 fcw; + uint16_t fcw; if (segmented_mode()) { fcw = RDMEM_W(AS_DATA, addr + 2); set_pc(segmented_addr(RDMEM_L(AS_DATA, addr + 4))); } else { fcw = RDMEM_W(AS_DATA, addr); - set_pc(RDMEM_W(AS_DATA, (UINT16)(addr + 2))); + set_pc(RDMEM_W(AS_DATA, (uint16_t)(addr + 2))); } CHANGE_FCW(fcw); /* check for user/system mode change */ } @@ -4580,7 +4580,7 @@ void z8002_device::Z79_ssN0_0000_addr() CHECK_PRIVILEGED_INSTR(); GET_SRC(OP0,NIB2); GET_ADDR(OP1); - UINT16 fcw; + uint16_t fcw; addr = addr_add(addr, RW(src)); if (segmented_mode()) { fcw = RDMEM_W(AS_DATA, addr + 2); @@ -4588,7 +4588,7 @@ void z8002_device::Z79_ssN0_0000_addr() } else { fcw = RDMEM_W(AS_DATA, addr); - m_pc = RDMEM_W(AS_DATA, (UINT16)(addr + 2)); + m_pc = RDMEM_W(AS_DATA, (uint16_t)(addr + 2)); } if ((fcw ^ m_fcw) & F_SEG) printf("ldps 3 (0x%05x): changing from %ssegmented mode to %ssegmented mode\n", m_pc, (fcw & F_SEG) ? "non-" : "", (fcw & F_SEG) ? "" : "non-"); CHANGE_FCW(fcw); /* check for user/system mode change */ @@ -4611,7 +4611,7 @@ void z8002_device::Z7A_0000_0000() ******************************************/ void z8002_device::Z7B_0000_0000() { - UINT16 tag, fcw; + uint16_t tag, fcw; CHECK_PRIVILEGED_INSTR(); tag = POPW(SP); /* get type tag */ fcw = POPW(SP); /* get m_fcw */ @@ -4689,7 +4689,7 @@ void z8002_device::Z7C_0000_00ii() { CHECK_PRIVILEGED_INSTR(); GET_IMM2(OP0,NIB3); - UINT16 fcw = m_fcw; + uint16_t fcw = m_fcw; fcw &= (imm2 << 11) | 0xe7ff; CHANGE_FCW(fcw); } @@ -4702,7 +4702,7 @@ void z8002_device::Z7C_0000_01ii() { CHECK_PRIVILEGED_INSTR(); GET_IMM2(OP0,NIB3); - UINT16 fcw = m_fcw; + uint16_t fcw = m_fcw; fcw |= ((~imm2) << 11) & 0x1800; CHANGE_FCW(fcw); } @@ -4752,7 +4752,7 @@ void z8002_device::Z7D_ssss_1ccc() switch (imm3) { case 2: { - UINT16 fcw; + uint16_t fcw; fcw = RW(src); CHANGE_FCW(fcw); /* check for user/system mode change */ } @@ -5483,7 +5483,7 @@ void z8002_device::ZAC_ssss_dddd() { GET_DST(OP0,NIB3); GET_SRC(OP0,NIB2); - UINT8 tmp = RB(src); + uint8_t tmp = RB(src); RB(src) = RB(dst); RB(dst) = tmp; } @@ -5496,7 +5496,7 @@ void z8002_device::ZAD_ssss_dddd() { GET_DST(OP0,NIB3); GET_SRC(OP0,NIB2); - UINT16 tmp = RW(src); + uint16_t tmp = RW(src); RW(src) = RW(dst); RW(dst) = tmp; } @@ -5509,7 +5509,7 @@ void z8002_device::ZAE_dddd_cccc() { GET_CCC(OP0,NIB3); GET_DST(OP0,NIB2); - UINT8 tmp = RB(dst) & ~1; + uint8_t tmp = RB(dst) & ~1; switch (cc) { case 0: if (CC0) tmp |= 1; break; case 1: if (CC1) tmp |= 1; break; @@ -5539,7 +5539,7 @@ void z8002_device::ZAF_dddd_cccc() { GET_CCC(OP0,NIB3); GET_DST(OP0,NIB2); - UINT16 tmp = RW(dst) & ~1; + uint16_t tmp = RW(dst) & ~1; switch (cc) { case 0: if (CC0) tmp |= 1; break; case 1: if (CC1) tmp |= 1; break; @@ -5568,8 +5568,8 @@ void z8002_device::ZAF_dddd_cccc() void z8002_device::ZB0_dddd_0000() { GET_DST(OP0,NIB2); - UINT8 result; - UINT16 idx = RB(dst); + uint8_t result; + uint16_t idx = RB(dst); if (m_fcw & F_C) idx |= 0x100; if (m_fcw & F_H) idx |= 0x200; if (m_fcw & F_DA) idx |= 0x400; @@ -5623,7 +5623,7 @@ void z8002_device::ZB2_dddd_0001_imm8() GET_DST(OP0,NIB2); GET_IMM8(OP1); if (imm8 & S08) - RB(dst) = SRLB(RB(dst), -(INT8)imm8); + RB(dst) = SRLB(RB(dst), -(int8_t)imm8); else RB(dst) = SLLB(RB(dst), imm8); } @@ -5636,7 +5636,7 @@ void z8002_device::ZB2_dddd_0011_0000_ssss_0000_0000() { GET_DST(OP0,NIB2); GET_SRC(OP1,NIB1); - RB(dst) = SRLB(RB(dst), (INT8)RW(src)); + RB(dst) = SRLB(RB(dst), (int8_t)RW(src)); } /****************************************** @@ -5672,7 +5672,7 @@ void z8002_device::ZB2_dddd_1001_imm8() GET_DST(OP0,NIB2); GET_IMM8(OP1); if (imm8 & S08) - RB(dst) = SRAB(RB(dst), -(INT8)imm8); + RB(dst) = SRAB(RB(dst), -(int8_t)imm8); else RB(dst) = SLAB(RB(dst), imm8); } @@ -5685,7 +5685,7 @@ void z8002_device::ZB2_dddd_1011_0000_ssss_0000_0000() { GET_DST(OP0,NIB2); GET_SRC(OP1,NIB1); - RB(dst) = SDAB(RB(dst), (INT8) RW(src)); + RB(dst) = SDAB(RB(dst), (int8_t) RW(src)); } /****************************************** @@ -5721,7 +5721,7 @@ void z8002_device::ZB3_dddd_0001_imm8() GET_DST(OP0,NIB2); GET_IMM16(OP1); if (imm16 & S16) - RW(dst) = SRLW(RW(dst), -(INT16)imm16); + RW(dst) = SRLW(RW(dst), -(int16_t)imm16); else RW(dst) = SLLW(RW(dst), imm16); } @@ -5734,7 +5734,7 @@ void z8002_device::ZB3_dddd_0011_0000_ssss_0000_0000() { GET_DST(OP0,NIB2); GET_SRC(OP1,NIB1); - RW(dst) = SDLW(RW(dst), (INT8)RW(src)); + RW(dst) = SDLW(RW(dst), (int8_t)RW(src)); } /****************************************** @@ -5759,7 +5759,7 @@ void z8002_device::ZB3_dddd_0101_imm8() GET_DST(OP0,NIB2); GET_IMM16(OP1); if (imm16 & S16) - RL(dst) = SRLL(RL(dst), -(INT16)imm16); + RL(dst) = SRLL(RL(dst), -(int16_t)imm16); else RL(dst) = SLLL(RL(dst), imm16); } @@ -5797,7 +5797,7 @@ void z8002_device::ZB3_dddd_1001_imm8() GET_DST(OP0,NIB2); GET_IMM16(OP1); if (imm16 & S16) - RW(dst) = SRAW(RW(dst), -(INT16)imm16); + RW(dst) = SRAW(RW(dst), -(int16_t)imm16); else RW(dst) = SLAW(RW(dst), imm16); } @@ -5810,7 +5810,7 @@ void z8002_device::ZB3_dddd_1011_0000_ssss_0000_0000() { GET_DST(OP0,NIB2); GET_SRC(OP1,NIB1); - RW(dst) = SDAW(RW(dst), (INT8)RW(src)); + RW(dst) = SDAW(RW(dst), (int8_t)RW(src)); } /****************************************** @@ -5835,7 +5835,7 @@ void z8002_device::ZB3_dddd_1101_imm8() GET_DST(OP0,NIB2); GET_IMM16(OP1); if (imm16 & S16) - RL(dst) = SRAL(RL(dst), -(INT16)imm16); + RL(dst) = SRAL(RL(dst), -(int16_t)imm16); else RL(dst) = SLAL(RL(dst), imm16); } @@ -5915,7 +5915,7 @@ void z8002_device::ZB8_ddN0_0010_0000_rrrr_ssN0_0000() GET_DST(OP0,NIB2); GET_SRC(OP1,NIB2); GET_CNT(OP1,NIB1); - UINT8 xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); + uint8_t xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); RB(1) = xlt; /* load RH1 */ if (xlt) CLR_Z; else SET_Z; add_to_addr_reg(dst, 1); @@ -5931,7 +5931,7 @@ void z8002_device::ZB8_ddN0_0110_0000_rrrr_ssN0_1110() GET_DST(OP0,NIB2); GET_SRC(OP1,NIB2); GET_CNT(OP1,NIB1); - UINT8 xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); + uint8_t xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); RB(1) = xlt; /* load RH1 */ if (xlt) CLR_Z; else SET_Z; add_to_addr_reg(dst, 1); @@ -5952,7 +5952,7 @@ void z8002_device::ZB8_ddN0_1010_0000_rrrr_ssN0_0000() GET_DST(OP0,NIB2); GET_SRC(OP1,NIB2); GET_CNT(OP1,NIB1); - UINT8 xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); + uint8_t xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); RB(1) = xlt; /* load RH1 */ if (xlt) CLR_Z; else SET_Z; sub_from_addr_reg(dst, 1); @@ -5968,7 +5968,7 @@ void z8002_device::ZB8_ddN0_1110_0000_rrrr_ssN0_1110() GET_DST(OP0,NIB2); GET_SRC(OP1,NIB2); GET_CNT(OP1,NIB1); - UINT8 xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); + uint8_t xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); RB(1) = xlt; /* load RH1 */ if (xlt) CLR_Z; else SET_Z; sub_from_addr_reg(dst, 1); @@ -5989,7 +5989,7 @@ void z8002_device::ZB8_ddN0_0000_0000_rrrr_ssN0_0000() GET_DST(OP0,NIB2); GET_SRC(OP1,NIB2); GET_CNT(OP1,NIB1); - UINT8 xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); + uint8_t xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); WRMEM_B(AS_DATA, addr_from_reg(dst), xlt); RB(1) = xlt; /* destroy RH1 */ add_to_addr_reg(dst, 1); @@ -6005,7 +6005,7 @@ void z8002_device::ZB8_ddN0_0100_0000_rrrr_ssN0_0000() GET_DST(OP0,NIB2); GET_SRC(OP1,NIB2); GET_CNT(OP1,NIB1); - UINT8 xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); + uint8_t xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); WRMEM_B(AS_DATA, addr_from_reg(dst), xlt); RB(1) = xlt; /* destroy RH1 */ add_to_addr_reg(dst, 1); @@ -6021,7 +6021,7 @@ void z8002_device::ZB8_ddN0_1000_0000_rrrr_ssN0_0000() GET_DST(OP0,NIB2); GET_SRC(OP1,NIB2); GET_CNT(OP1,NIB1); - UINT8 xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); + uint8_t xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); WRMEM_B(AS_DATA, addr_from_reg(dst), xlt); RB(1) = xlt; /* destroy RH1 */ sub_from_addr_reg(dst, 1); @@ -6037,7 +6037,7 @@ void z8002_device::ZB8_ddN0_1100_0000_rrrr_ssN0_0000() GET_DST(OP0,NIB2); GET_SRC(OP1,NIB2); GET_CNT(OP1,NIB1); - UINT8 xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); + uint8_t xlt = RDMEM_B(AS_DATA, addr_from_reg(src) + RDMEM_B(AS_DATA, addr_from_reg(dst))); WRMEM_B(AS_DATA, addr_from_reg(dst), xlt); RB(1) = xlt; /* destroy RH1 */ sub_from_addr_reg(dst, 1); @@ -6669,9 +6669,9 @@ void z8002_device::ZBB_ssN0_1110_0000_rrrr_ddN0_cccc() ******************************************/ void z8002_device::ZBC_aaaa_bbbb() { - UINT8 b = m_op[0] & 15; - UINT8 a = (m_op[0] >> 4) & 15; - UINT8 tmp = RB(b); + uint8_t b = m_op[0] & 15; + uint8_t a = (m_op[0] >> 4) & 15; + uint8_t tmp = RB(b); RB(a) = (RB(a) >> 4) | (RB(b) << 4); RB(b) = (RB(b) & 0xf0) | (tmp & 0x0f); if (RB(b)) CLR_Z; else SET_Z; @@ -6694,9 +6694,9 @@ void z8002_device::ZBD_dddd_imm4() ******************************************/ void z8002_device::ZBE_aaaa_bbbb() { - UINT8 b = m_op[0] & 15; - UINT8 a = (m_op[0] >> 4) & 15; - UINT8 tmp = RB(a); + uint8_t b = m_op[0] & 15; + uint8_t a = (m_op[0] >> 4) & 15; + uint8_t tmp = RB(a); RB(a) = (RB(a) << 4) | (RB(b) & 0x0f); RB(b) = (RB(b) & 0xf0) | (tmp >> 4); if (RB(b)) CLR_Z; else SET_Z; @@ -6745,7 +6745,7 @@ void z8002_device::ZC_dddd_imm8() ******************************************/ void z8002_device::ZD_dsp12() { - INT16 dsp12 = m_op[0] & 0xfff; + int16_t dsp12 = m_op[0] & 0xfff; if (segmented_mode()) PUSHL(SP, make_segmented_addr(m_pc)); else diff --git a/src/devices/imagedev/bitbngr.cpp b/src/devices/imagedev/bitbngr.cpp index 18842cb8005..eddf94e0fca 100644 --- a/src/devices/imagedev/bitbngr.cpp +++ b/src/devices/imagedev/bitbngr.cpp @@ -21,7 +21,7 @@ const device_type BITBANGER = &device_creator; ctor -------------------------------------------------*/ -bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BITBANGER, "Bitbanger", tag, owner, clock, "bitbanger", __FILE__), device_image_interface(mconfig, *this) { @@ -33,7 +33,7 @@ bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *ta native_output - outputs data to a file -------------------------------------------------*/ -void bitbanger_device::output(UINT8 data) +void bitbanger_device::output(uint8_t data) { if (exists()) { @@ -46,7 +46,7 @@ void bitbanger_device::output(UINT8 data) native_input - inputs data from a file -------------------------------------------------*/ -UINT32 bitbanger_device::input(void *buffer, UINT32 length) +uint32_t bitbanger_device::input(void *buffer, uint32_t length) { if (exists()) { diff --git a/src/devices/imagedev/bitbngr.h b/src/devices/imagedev/bitbngr.h index 0a67a731bf7..fd7b179b14a 100644 --- a/src/devices/imagedev/bitbngr.h +++ b/src/devices/imagedev/bitbngr.h @@ -14,7 +14,7 @@ class bitbanger_device : public device_t, { public: // construction/destruction - bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // image-level overrides virtual image_init_result call_load() override; @@ -30,8 +30,8 @@ public: virtual bool is_reset_on_load() const override { return 0; } virtual const char *file_extensions() const override { return ""; } - void output(UINT8 data); - UINT32 input(void *buffer, UINT32 length); + void output(uint8_t data); + uint32_t input(void *buffer, uint32_t length); protected: // device-level overrides diff --git a/src/devices/imagedev/cassette.cpp b/src/devices/imagedev/cassette.cpp index 052873cbe48..c89faa1cc06 100644 --- a/src/devices/imagedev/cassette.cpp +++ b/src/devices/imagedev/cassette.cpp @@ -23,7 +23,7 @@ const device_type CASSETTE = &device_creator; // cassette_image_device - constructor //------------------------------------------------- -cassette_image_device::cassette_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cassette_image_device::cassette_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CASSETTE, "Cassette", tag, owner, clock, "cassette_image", __FILE__), device_image_interface(mconfig, *this), m_cassette(nullptr), @@ -138,7 +138,7 @@ void cassette_image_device::change_state(cassette_state state, cassette_state ma double cassette_image_device::input() { - INT32 sample; + int32_t sample; double double_value; update(); @@ -161,7 +161,7 @@ void cassette_image_device::output(double value) value = std::min(value, 1.0); value = std::max(value, -1.0); - m_value = (INT32) (value * 0x7FFFFFFF); + m_value = (int32_t) (value * 0x7FFFFFFF); } } diff --git a/src/devices/imagedev/cassette.h b/src/devices/imagedev/cassette.h index 6445090ef92..4a98dc3b61a 100644 --- a/src/devices/imagedev/cassette.h +++ b/src/devices/imagedev/cassette.h @@ -47,7 +47,7 @@ class cassette_image_device : public device_t, { public: // construction/destruction - cassette_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cassette_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~cassette_image_device(); static void static_set_formats(device_t &device, const struct CassetteFormat* const *formats) { downcast(device).m_formats = formats; } @@ -103,7 +103,7 @@ private: cassette_state m_state; double m_position; double m_position_time; - INT32 m_value; + int32_t m_value; int m_channel; double m_speed; // speed multiplier for tape speeds other than standard 1.875ips (used in adam driver) int m_direction; // direction select diff --git a/src/devices/imagedev/chd_cd.cpp b/src/devices/imagedev/chd_cd.cpp index 9386d741d58..103806c1e62 100644 --- a/src/devices/imagedev/chd_cd.cpp +++ b/src/devices/imagedev/chd_cd.cpp @@ -19,7 +19,7 @@ const device_type CDROM = &device_creator; // cdrom_image_device - constructor //------------------------------------------------- -cdrom_image_device::cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdrom_image_device::cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDROM, "CD-ROM Image", tag, owner, clock, "cdrom_image", __FILE__), device_image_interface(mconfig, *this), m_cdrom_handle(nullptr), @@ -28,7 +28,7 @@ cdrom_image_device::cdrom_image_device(const machine_config &mconfig, const char { } -cdrom_image_device::cdrom_image_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) +cdrom_image_device::cdrom_image_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_image_interface(mconfig, *this), m_cdrom_handle(nullptr), diff --git a/src/devices/imagedev/chd_cd.h b/src/devices/imagedev/chd_cd.h index 64bb3924fee..9bf63749b58 100644 --- a/src/devices/imagedev/chd_cd.h +++ b/src/devices/imagedev/chd_cd.h @@ -25,8 +25,8 @@ class cdrom_image_device : public device_t, { public: // construction/destruction - cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - cdrom_image_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); + cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + cdrom_image_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 ~cdrom_image_device(); static void static_set_interface(device_t &device, const char *_interface) { downcast(device).m_interface = _interface; } diff --git a/src/devices/imagedev/diablo.cpp b/src/devices/imagedev/diablo.cpp index 238e0dd5a89..58f17793b2a 100644 --- a/src/devices/imagedev/diablo.cpp +++ b/src/devices/imagedev/diablo.cpp @@ -29,7 +29,7 @@ const device_type DIABLO = &device_creator; // diablo_image_device - constructor //------------------------------------------------- -diablo_image_device::diablo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +diablo_image_device::diablo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DIABLO, "Diablo", tag, owner, clock, "diablo_image", __FILE__), device_image_interface(mconfig, *this), m_chd(nullptr), @@ -111,21 +111,21 @@ image_init_result diablo_image_device::call_load() image_init_result diablo_image_device::call_create(int create_format, util::option_resolution *create_args) { int err; - UINT32 sectorsize, hunksize; - UINT32 cylinders, heads, sectors, totalsectors; + uint32_t sectorsize, hunksize; + uint32_t cylinders, heads, sectors, totalsectors; assert_always(create_args != nullptr, "Expected create_args to not be nullptr"); cylinders = create_args->lookup_int('C'); heads = create_args->lookup_int('H'); sectors = create_args->lookup_int('S'); - sectorsize = create_args->lookup_int('L') * sizeof(UINT16); + sectorsize = create_args->lookup_int('L') * sizeof(uint16_t); hunksize = create_args->lookup_int('K'); totalsectors = cylinders * heads * sectors; /* create the CHD file */ chd_codec_type compression[4] = { CHD_CODEC_NONE }; - err = m_origchd.create(image_core_file(), (UINT64)totalsectors * (UINT64)sectorsize, hunksize, sectorsize, compression); + err = m_origchd.create(image_core_file(), (uint64_t)totalsectors * (uint64_t)sectorsize, hunksize, sectorsize, compression); if (err != CHDERR_NONE) goto error; diff --git a/src/devices/imagedev/diablo.h b/src/devices/imagedev/diablo.h index f4d99532345..cb0366728b0 100644 --- a/src/devices/imagedev/diablo.h +++ b/src/devices/imagedev/diablo.h @@ -23,7 +23,7 @@ class diablo_image_device : public device_t, { public: // construction/destruction - diablo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + diablo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~diablo_image_device(); static void static_set_device_load(device_t &device, device_image_load_delegate callback) { downcast(device).m_device_image_load = callback; } diff --git a/src/devices/imagedev/flopdrv.cpp b/src/devices/imagedev/flopdrv.cpp index 1e7226ec127..2533e09d516 100644 --- a/src/devices/imagedev/flopdrv.cpp +++ b/src/devices/imagedev/flopdrv.cpp @@ -81,7 +81,7 @@ void legacy_floppy_image_device::flopimg_get_id_callback(chrn_id *id, int id_ind { int cylinder, sector, N; unsigned long flags; - UINT32 sector_length; + uint32_t sector_length; if (!m_floppy) return; @@ -103,7 +103,7 @@ void legacy_floppy_image_device::log_readwrite(const char *name, int head, int t char membuf[1024]; int i; for (i = 0; i < length; i++) - sprintf(membuf + i*2, "%02x", (int) (UINT8) buf[i]); + sprintf(membuf + i*2, "%02x", (int) (uint8_t) buf[i]); logerror("%s: head=%i track=%i sector=%i buffer='%s'\n", name, head, track, sector, membuf); } @@ -396,7 +396,7 @@ int legacy_floppy_image_device::floppy_drive_get_current_track() return m_current_track; } -UINT64 legacy_floppy_image_device::floppy_drive_get_current_track_size(int head) +uint64_t legacy_floppy_image_device::floppy_drive_get_current_track_size(int head) { int size = 0; if (exists()) @@ -696,7 +696,7 @@ const device_type LEGACY_FLOPPY = &device_creator; // legacy_floppy_image_device - constructor //------------------------------------------------- -legacy_floppy_image_device::legacy_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +legacy_floppy_image_device::legacy_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LEGACY_FLOPPY, "Floppy Disk", tag, owner, clock, "legacy_floppy_image", __FILE__), device_image_interface(mconfig, *this), m_out_idx_func(*this), @@ -730,7 +730,7 @@ legacy_floppy_image_device::legacy_floppy_image_device(const machine_config &mco memset(&m_extension_list,0,sizeof(m_extension_list)); } -legacy_floppy_image_device::legacy_floppy_image_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) +legacy_floppy_image_device::legacy_floppy_image_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_image_interface(mconfig, *this), m_out_idx_func(*this), diff --git a/src/devices/imagedev/flopdrv.h b/src/devices/imagedev/flopdrv.h index c362d62aa9e..ca9f469edb6 100644 --- a/src/devices/imagedev/flopdrv.h +++ b/src/devices/imagedev/flopdrv.h @@ -55,10 +55,10 @@ struct floppy_type_t { - UINT8 media_size; - UINT8 head_number; - UINT8 max_track_number; - UINT8 max_density; + uint8_t media_size; + uint8_t head_number; + uint8_t max_track_number; + uint8_t max_density; }; // ======================> floppy_interface @@ -93,8 +93,8 @@ class legacy_floppy_image_device : public device_t, { public: // construction/destruction - legacy_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - legacy_floppy_image_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); + legacy_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + legacy_floppy_image_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); ~legacy_floppy_image_device(); static void static_set_floppy_config(device_t &device, const floppy_interface *config) { downcast(device).m_config = config; } @@ -132,7 +132,7 @@ public: void floppy_install_unload_proc(void (*proc)(device_image_interface &image)); void floppy_drive_set_index_pulse_callback(void (*callback)(device_t *controller,device_t *image, int state)); int floppy_drive_get_current_track(); - UINT64 floppy_drive_get_current_track_size(int head); + uint64_t floppy_drive_get_current_track_size(int head); void floppy_drive_set_rpm(float rpm); void floppy_drive_set_controller(device_t *controller); int floppy_get_drive_type(); diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index cb07b6654dd..fbd508c579a 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -124,7 +124,7 @@ const floppy_format_type floppy_image_device::default_floppy_formats[] = { nullptr }; -floppy_connector::floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_connector::floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FLOPPY_CONNECTOR, "Floppy drive connector abstraction", tag, owner, clock, "floppy_connector", __FILE__), device_slot_interface(mconfig, *this), formats(nullptr), @@ -164,7 +164,7 @@ floppy_image_device *floppy_connector::get_device() // floppy_image_device - constructor //------------------------------------------------- -floppy_image_device::floppy_image_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) +floppy_image_device::floppy_image_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_image_interface(mconfig, *this), device_slot_card_interface(mconfig, *this), @@ -690,7 +690,7 @@ void floppy_image_device::seek_phase_w(int phases) dskchg = 1; } -int floppy_image_device::find_index(UINT32 position, const std::vector &buf) +int floppy_image_device::find_index(uint32_t position, const std::vector &buf) { int spos = (buf.size() >> 1)-1; int step; @@ -709,7 +709,7 @@ int floppy_image_device::find_index(UINT32 position, const std::vector & } } -UINT32 floppy_image_device::find_position(attotime &base, const attotime &when) +uint32_t floppy_image_device::find_position(attotime &base, const attotime &when) { base = revolution_start_time; attotime delta = when - base; @@ -726,9 +726,9 @@ UINT32 floppy_image_device::find_position(attotime &base, const attotime &when) return (delta*floppy_ratio_1).as_ticks(1000000000/1000); } -attotime floppy_image_device::get_next_index_time(std::vector &buf, int index, int delta, attotime base) +attotime floppy_image_device::get_next_index_time(std::vector &buf, int index, int delta, attotime base) { - UINT32 next_position; + uint32_t next_position; int cells = buf.size(); if(index+delta < cells) next_position = buf[index+delta] & floppy_image::TIME_MASK; @@ -739,7 +739,7 @@ attotime floppy_image_device::get_next_index_time(std::vector &buf, int next_position = 200000000 + (buf[index] & floppy_image::TIME_MASK); } - return base + attotime::from_nsec((UINT64(next_position)*2000/floppy_ratio_1+1)/2); + return base + attotime::from_nsec((uint64_t(next_position)*2000/floppy_ratio_1+1)/2); } attotime floppy_image_device::get_next_transition(const attotime &from_when) @@ -747,13 +747,13 @@ attotime floppy_image_device::get_next_transition(const attotime &from_when) if(!image || mon) return attotime::never; - std::vector &buf = image->get_buffer(cyl, ss, subcyl); - UINT32 cells = buf.size(); + std::vector &buf = image->get_buffer(cyl, ss, subcyl); + uint32_t cells = buf.size(); if(cells <= 1) return attotime::never; attotime base; - UINT32 position = find_position(base, from_when); + uint32_t position = find_position(base, from_when); int index = find_index(position, buf); @@ -780,7 +780,7 @@ void floppy_image_device::write_flux(const attotime &start, const attotime &end, for(int i=0; i != transition_count; i++) trans_pos[i] = find_position(base, transitions[i]); - std::vector &buf = image->get_buffer(cyl, ss, subcyl); + std::vector &buf = image->get_buffer(cyl, ss, subcyl); int index; if(!buf.empty()) @@ -793,17 +793,17 @@ void floppy_image_device::write_flux(const attotime &start, const attotime &end, if(index && (buf[index] & floppy_image::TIME_MASK) == start_pos) index--; - UINT32 cur_mg = buf[index] & floppy_image::MG_MASK; + uint32_t cur_mg = buf[index] & floppy_image::MG_MASK; if(cur_mg == floppy_image::MG_N || cur_mg == floppy_image::MG_D) cur_mg = floppy_image::MG_A; - UINT32 pos = start_pos; + uint32_t pos = start_pos; int ti = 0; int cells = buf.size(); while(pos != end_pos) { if(buf.size() < cells+10) buf.resize(cells+200); - UINT32 next_pos; + uint32_t next_pos; if(ti != transition_count) next_pos = trans_pos[ti++]; else @@ -822,15 +822,15 @@ void floppy_image_device::write_flux(const attotime &start, const attotime &end, buf.resize(cells); } -void floppy_image_device::write_zone(UINT32 *buf, int &cells, int &index, UINT32 spos, UINT32 epos, UINT32 mg) +void floppy_image_device::write_zone(uint32_t *buf, int &cells, int &index, uint32_t spos, uint32_t epos, uint32_t mg) { while(spos < epos) { while(index != cells-1 && (buf[index+1] & floppy_image::TIME_MASK) <= spos) index++; - UINT32 ref_start = buf[index] & floppy_image::TIME_MASK; - UINT32 ref_end = index == cells-1 ? 200000000 : buf[index+1] & floppy_image::TIME_MASK; - UINT32 ref_mg = buf[index] & floppy_image::MG_MASK; + uint32_t ref_start = buf[index] & floppy_image::TIME_MASK; + uint32_t ref_end = index == cells-1 ? 200000000 : buf[index+1] & floppy_image::TIME_MASK; + uint32_t ref_mg = buf[index] & floppy_image::MG_MASK; // Can't overwrite a damaged zone if(ref_mg == floppy_image::MG_D) { @@ -848,25 +848,25 @@ void floppy_image_device::write_zone(UINT32 *buf, int &cells, int &index, UINT32 if(spos == ref_start) { if(epos >= ref_end) { // Full overlap, that cell is dead, we need to see which ones we can extend - UINT32 prev_mg = index != 0 ? buf[index-1] & floppy_image::MG_MASK : ~0; - UINT32 next_mg = index != cells-1 ? buf[index+1] & floppy_image::MG_MASK : ~0; + uint32_t prev_mg = index != 0 ? buf[index-1] & floppy_image::MG_MASK : ~0; + uint32_t next_mg = index != cells-1 ? buf[index+1] & floppy_image::MG_MASK : ~0; if(prev_mg == mg) { if(next_mg == mg) { // Both match, merge all three in one - memmove(buf+index, buf+index+2, (cells-index-2)*sizeof(UINT32)); + memmove(buf+index, buf+index+2, (cells-index-2)*sizeof(uint32_t)); cells -= 2; index--; } else { // Previous matches, drop the current cell - memmove(buf+index, buf+index+1, (cells-index-1)*sizeof(UINT32)); + memmove(buf+index, buf+index+1, (cells-index-1)*sizeof(uint32_t)); cells --; } } else { if(next_mg == mg) { // Following matches, extend it - memmove(buf+index, buf+index+1, (cells-index-1)*sizeof(UINT32)); + memmove(buf+index, buf+index+1, (cells-index-1)*sizeof(uint32_t)); cells --; buf[index] = mg | spos; } else { @@ -885,7 +885,7 @@ void floppy_image_device::write_zone(UINT32 *buf, int &cells, int &index, UINT32 else { // Otherwise we need to insert a new cell if(index != cells-1) - memmove(buf+index+1, buf+index, (cells-index)*sizeof(UINT32)); + memmove(buf+index+1, buf+index, (cells-index)*sizeof(uint32_t)); cells++; buf[index] = mg | spos; buf[index+1] = ref_mg | epos; @@ -899,7 +899,7 @@ void floppy_image_device::write_zone(UINT32 *buf, int &cells, int &index, UINT32 // If we can't just extend the following cell, we need to insert a new one if(index == cells-1 || (buf[index+1] & floppy_image::MG_MASK) != mg) { if(index != cells-1) - memmove(buf+index+2, buf+index+1, (cells-index-1)*sizeof(UINT32)); + memmove(buf+index+2, buf+index+1, (cells-index-1)*sizeof(uint32_t)); cells++; } buf[index+1] = mg | spos; @@ -910,7 +910,7 @@ void floppy_image_device::write_zone(UINT32 *buf, int &cells, int &index, UINT32 // Full inclusion // We need to split the zone in 3 if(index != cells-1) - memmove(buf+index+3, buf+index+1, (cells-index-1)*sizeof(UINT32)); + memmove(buf+index+3, buf+index+1, (cells-index-1)*sizeof(uint32_t)); cells += 2; buf[index+1] = mg | spos; buf[index+2] = ref_mg | epos; @@ -931,12 +931,12 @@ void floppy_image_device::set_write_splice(const attotime &when) } } -UINT32 floppy_image_device::get_form_factor() const +uint32_t floppy_image_device::get_form_factor() const { return form_factor; } -UINT32 floppy_image_device::get_variant() const +uint32_t floppy_image_device::get_variant() const { return image ? image->get_variant() : 0; } @@ -1018,7 +1018,7 @@ static const char *const floppy525_sample_names[] = nullptr }; -floppy_sound_device::floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +floppy_sound_device::floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : samples_device(mconfig, FLOPPYSOUND, "Floppy sound", tag, owner, clock, "flopsnd", __FILE__), m_sound(nullptr), m_step_base(0), @@ -1211,7 +1211,7 @@ void floppy_sound_device::sound_stream_update(sound_stream &stream, stream_sampl // Also, there is no need for interpolation, as we only expect // one sample rate of 44100 for all samples - INT16 out; + int16_t out; stream_sample_t *samplebuffer = outputs[0]; int idx = 0; int sampleend = 0; @@ -1338,7 +1338,7 @@ const device_type FLOPPYSOUND = &device_creator; // 3" single-sided double density //------------------------------------------------- -floppy_3_ssdd::floppy_3_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_3_ssdd::floppy_3_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_3_SSDD, "3\" single sided floppy drive", tag, owner, clock, "floppy_3_ssdd", __FILE__) { } @@ -1355,7 +1355,7 @@ void floppy_3_ssdd::setup_characteristics() set_rpm(300); } -void floppy_3_ssdd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_3_ssdd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSDD; @@ -1365,7 +1365,7 @@ void floppy_3_ssdd::handled_variants(UINT32 *variants, int &var_count) const // 3" double-sided double density //------------------------------------------------- -floppy_3_dsdd::floppy_3_dsdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_3_dsdd::floppy_3_dsdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_3_DSDD, "3\" double sided floppy drive", tag, owner, clock, "floppy_3_dsdd", __FILE__) { } @@ -1382,7 +1382,7 @@ void floppy_3_dsdd::setup_characteristics() set_rpm(300); } -void floppy_3_dsdd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_3_dsdd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSDD; @@ -1393,7 +1393,7 @@ void floppy_3_dsdd::handled_variants(UINT32 *variants, int &var_count) const // 3.5" single-sided double density //------------------------------------------------- -floppy_35_ssdd::floppy_35_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_35_ssdd::floppy_35_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_35_SSDD, "3.5\" single-sided double density floppy drive", tag, owner, clock, "floppy_35_ssdd", __FILE__) { } @@ -1410,7 +1410,7 @@ void floppy_35_ssdd::setup_characteristics() set_rpm(300); } -void floppy_35_ssdd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_35_ssdd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1421,7 +1421,7 @@ void floppy_35_ssdd::handled_variants(UINT32 *variants, int &var_count) const // 3.5" double-sided double density //------------------------------------------------- -floppy_35_dd::floppy_35_dd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_35_dd::floppy_35_dd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_35_DD, "3.5\" double density floppy drive", tag, owner, clock, "floppy_35_dd", __FILE__) { } @@ -1438,7 +1438,7 @@ void floppy_35_dd::setup_characteristics() set_rpm(300); } -void floppy_35_dd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_35_dd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1450,7 +1450,7 @@ void floppy_35_dd::handled_variants(UINT32 *variants, int &var_count) const // 3.5" high density //------------------------------------------------- -floppy_35_hd::floppy_35_hd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_35_hd::floppy_35_hd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_35_HD, "3.5\" high density floppy drive", tag, owner, clock, "floppy_35_hd", __FILE__) { } @@ -1467,7 +1467,7 @@ void floppy_35_hd::setup_characteristics() set_rpm(300); } -void floppy_35_hd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_35_hd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1480,7 +1480,7 @@ void floppy_35_hd::handled_variants(UINT32 *variants, int &var_count) const // 3.5" extended density //------------------------------------------------- -floppy_35_ed::floppy_35_ed(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_35_ed::floppy_35_ed(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_35_ED, "3.5\" extended density floppy drive", tag, owner, clock, "floppy_35_ed", __FILE__) { } @@ -1497,7 +1497,7 @@ void floppy_35_ed::setup_characteristics() set_rpm(300); } -void floppy_35_ed::handled_variants(UINT32 *variants, int &var_count) const +void floppy_35_ed::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1511,7 +1511,7 @@ void floppy_35_ed::handled_variants(UINT32 *variants, int &var_count) const // 5.25" single-sided single density 35 tracks //------------------------------------------------- -floppy_525_sssd_35t::floppy_525_sssd_35t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_525_sssd_35t::floppy_525_sssd_35t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_525_SSSD_35T, "5.25\" single-sided single density 35-track floppy drive", tag, owner, clock, "floppy_525_sssd_35t", __FILE__) { } @@ -1528,7 +1528,7 @@ void floppy_525_sssd_35t::setup_characteristics() set_rpm(300); } -void floppy_525_sssd_35t::handled_variants(UINT32 *variants, int &var_count) const +void floppy_525_sssd_35t::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1538,7 +1538,7 @@ void floppy_525_sssd_35t::handled_variants(UINT32 *variants, int &var_count) con // 5.25" double-sided single density 35 tracks //------------------------------------------------- -floppy_525_sd_35t::floppy_525_sd_35t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_525_sd_35t::floppy_525_sd_35t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_525_SD_35T, "5.25\" single density 35-track floppy drive", tag, owner, clock, "floppy_525_sd_35t", __FILE__) { } @@ -1555,7 +1555,7 @@ void floppy_525_sd_35t::setup_characteristics() set_rpm(300); } -void floppy_525_sd_35t::handled_variants(UINT32 *variants, int &var_count) const +void floppy_525_sd_35t::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1565,7 +1565,7 @@ void floppy_525_sd_35t::handled_variants(UINT32 *variants, int &var_count) const // 5.25" single-sided single density //------------------------------------------------- -floppy_525_sssd::floppy_525_sssd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_525_sssd::floppy_525_sssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_525_SSSD, "5.25\" single-sided single density floppy drive", tag, owner, clock, "floppy_525_sssd", __FILE__) { } @@ -1582,7 +1582,7 @@ void floppy_525_sssd::setup_characteristics() set_rpm(300); } -void floppy_525_sssd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_525_sssd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1592,7 +1592,7 @@ void floppy_525_sssd::handled_variants(UINT32 *variants, int &var_count) const // 5.25" double-sided single density //------------------------------------------------- -floppy_525_sd::floppy_525_sd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_525_sd::floppy_525_sd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_525_SD, "5.25\" single density floppy drive", tag, owner, clock, "floppy_525_sd", __FILE__) { } @@ -1609,7 +1609,7 @@ void floppy_525_sd::setup_characteristics() set_rpm(300); } -void floppy_525_sd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_525_sd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1619,7 +1619,7 @@ void floppy_525_sd::handled_variants(UINT32 *variants, int &var_count) const // 5.25" single-sided double density //------------------------------------------------- -floppy_525_ssdd::floppy_525_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_525_ssdd::floppy_525_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_525_SSDD, "5.25\" single-sided double density floppy drive", tag, owner, clock, "floppy_525_ssdd", __FILE__) { } @@ -1636,7 +1636,7 @@ void floppy_525_ssdd::setup_characteristics() set_rpm(300); } -void floppy_525_ssdd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_525_ssdd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1647,7 +1647,7 @@ void floppy_525_ssdd::handled_variants(UINT32 *variants, int &var_count) const // 5.25" double-sided double density //------------------------------------------------- -floppy_525_dd::floppy_525_dd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_525_dd::floppy_525_dd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_525_DD, "5.25\" double density floppy drive", tag, owner, clock, "floppy_525_dd", __FILE__) { } @@ -1664,7 +1664,7 @@ void floppy_525_dd::setup_characteristics() set_rpm(300); } -void floppy_525_dd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_525_dd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1676,7 +1676,7 @@ void floppy_525_dd::handled_variants(UINT32 *variants, int &var_count) const // 5.25" single-sided quad density //------------------------------------------------- -floppy_525_ssqd::floppy_525_ssqd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_525_ssqd::floppy_525_ssqd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_525_QD, "5.25\" single-sided quad density floppy drive", tag, owner, clock, "floppy_525_ssqd", __FILE__) { } @@ -1693,7 +1693,7 @@ void floppy_525_ssqd::setup_characteristics() set_rpm(300); } -void floppy_525_ssqd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_525_ssqd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1705,7 +1705,7 @@ void floppy_525_ssqd::handled_variants(UINT32 *variants, int &var_count) const // 5.25" double-sided quad density //------------------------------------------------- -floppy_525_qd::floppy_525_qd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_525_qd::floppy_525_qd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_525_QD, "5.25\" quad density floppy drive", tag, owner, clock, "floppy_525_qd", __FILE__) { } @@ -1722,7 +1722,7 @@ void floppy_525_qd::setup_characteristics() set_rpm(300); } -void floppy_525_qd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_525_qd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1737,7 +1737,7 @@ void floppy_525_qd::handled_variants(UINT32 *variants, int &var_count) const // 5.25" high density //------------------------------------------------- -floppy_525_hd::floppy_525_hd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_525_hd::floppy_525_hd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_525_HD, "5.25\" high density floppy drive", tag, owner, clock, "floppy_525_hd", __FILE__) { } @@ -1754,7 +1754,7 @@ void floppy_525_hd::setup_characteristics() set_rpm(360); } -void floppy_525_hd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_525_hd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1769,7 +1769,7 @@ void floppy_525_hd::handled_variants(UINT32 *variants, int &var_count) const // 8" single-sided single density //------------------------------------------------- -floppy_8_sssd::floppy_8_sssd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_8_sssd::floppy_8_sssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_8_SSSD, "8\" single density single sided floppy drive", tag, owner, clock, "floppy_8_sssd", __FILE__) { } @@ -1787,7 +1787,7 @@ void floppy_8_sssd::setup_characteristics() set_rpm(360); } -void floppy_8_sssd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_8_sssd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1797,7 +1797,7 @@ void floppy_8_sssd::handled_variants(UINT32 *variants, int &var_count) const // 8" double-sided single density //------------------------------------------------- -floppy_8_dssd::floppy_8_dssd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_8_dssd::floppy_8_dssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_8_DSSD, "8\" single density double sided floppy drive", tag, owner, clock, "floppy_8_dssd", __FILE__) { } @@ -1815,7 +1815,7 @@ void floppy_8_dssd::setup_characteristics() set_rpm(360); } -void floppy_8_dssd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_8_dssd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1826,7 +1826,7 @@ void floppy_8_dssd::handled_variants(UINT32 *variants, int &var_count) const // 8" single-sided double density //------------------------------------------------- -floppy_8_ssdd::floppy_8_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_8_ssdd::floppy_8_ssdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_8_SSDD, "8\" double density single sided floppy drive", tag, owner, clock, "floppy_8_ssdd", __FILE__) { } @@ -1844,7 +1844,7 @@ void floppy_8_ssdd::setup_characteristics() set_rpm(360); } -void floppy_8_ssdd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_8_ssdd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1855,7 +1855,7 @@ void floppy_8_ssdd::handled_variants(UINT32 *variants, int &var_count) const // 8" double-sided double density //------------------------------------------------- -floppy_8_dsdd::floppy_8_dsdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +floppy_8_dsdd::floppy_8_dsdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, FLOPPY_8_DSDD, "8\" double density double sided floppy drive", tag, owner, clock, "floppy_8_dsdd", __FILE__) { } @@ -1873,7 +1873,7 @@ void floppy_8_dsdd::setup_characteristics() set_rpm(360); } -void floppy_8_dsdd::handled_variants(UINT32 *variants, int &var_count) const +void floppy_8_dsdd::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1896,7 +1896,7 @@ void floppy_8_dsdd::handled_variants(UINT32 *variants, int &var_count) const // //------------------------------------------------- -epson_smd_165::epson_smd_165(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +epson_smd_165::epson_smd_165(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, EPSON_SD_321, "EPSON SMD-165 Floppy Disk Drive", tag, owner, clock, "epson_smd_165", __FILE__) { } @@ -1913,7 +1913,7 @@ void epson_smd_165::setup_characteristics() set_rpm(300); } -void epson_smd_165::handled_variants(UINT32 *variants, int &var_count) const +void epson_smd_165::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1947,7 +1947,7 @@ void epson_smd_165::handled_variants(UINT32 *variants, int &var_count) const // //------------------------------------------------- -epson_sd_320::epson_sd_320(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +epson_sd_320::epson_sd_320(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, EPSON_SD_320, "EPSON SD-320 Mini-Floppy Disk Drive", tag, owner, clock, "epson_sd_320", __FILE__) { } @@ -1964,7 +1964,7 @@ void epson_sd_320::setup_characteristics() set_rpm(300); } -void epson_sd_320::handled_variants(UINT32 *variants, int &var_count) const +void epson_sd_320::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -1979,7 +1979,7 @@ void epson_sd_320::handled_variants(UINT32 *variants, int &var_count) const // //------------------------------------------------- -epson_sd_321::epson_sd_321(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +epson_sd_321::epson_sd_321(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, EPSON_SD_321, "EPSON SD-321 Mini-Floppy Disk Drive", tag, owner, clock, "epson_sd_321", __FILE__) { } @@ -1996,7 +1996,7 @@ void epson_sd_321::setup_characteristics() set_rpm(300); } -void epson_sd_321::handled_variants(UINT32 *variants, int &var_count) const +void epson_sd_321::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -2014,7 +2014,7 @@ void epson_sd_321::handled_variants(UINT32 *variants, int &var_count) const // //------------------------------------------------- -sony_oa_d31v::sony_oa_d31v(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sony_oa_d31v::sony_oa_d31v(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, SONY_OA_D31V, "Sony OA-D31V Micro Floppydisk Drive", tag, owner, clock, "sony_oa_d31v", __FILE__) { } @@ -2031,7 +2031,7 @@ void sony_oa_d31v::setup_characteristics() set_rpm(600); } -void sony_oa_d31v::handled_variants(UINT32 *variants, int &var_count) const +void sony_oa_d31v::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -2049,7 +2049,7 @@ void sony_oa_d31v::handled_variants(UINT32 *variants, int &var_count) const // //------------------------------------------------- -sony_oa_d32w::sony_oa_d32w(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sony_oa_d32w::sony_oa_d32w(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, SONY_OA_D32W, "Sony OA-D32W Micro Floppydisk Drive", tag, owner, clock, "sony_oa_d32w", __FILE__) { } @@ -2066,7 +2066,7 @@ void sony_oa_d32w::setup_characteristics() set_rpm(600); } -void sony_oa_d32w::handled_variants(UINT32 *variants, int &var_count) const +void sony_oa_d32w::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -2085,7 +2085,7 @@ void sony_oa_d32w::handled_variants(UINT32 *variants, int &var_count) const // //------------------------------------------------- -sony_oa_d32v::sony_oa_d32v(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sony_oa_d32v::sony_oa_d32v(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, SONY_OA_D32V, "Sony OA-D32V Micro Floppydisk Drive", tag, owner, clock, "sony_oa_d32v", __FILE__) { } @@ -2102,7 +2102,7 @@ void sony_oa_d32v::setup_characteristics() set_rpm(600); } -void sony_oa_d32v::handled_variants(UINT32 *variants, int &var_count) const +void sony_oa_d32v::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -2119,7 +2119,7 @@ void sony_oa_d32v::handled_variants(UINT32 *variants, int &var_count) const // //------------------------------------------------- -teac_fd_55e::teac_fd_55e(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +teac_fd_55e::teac_fd_55e(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, TEAC_FD_55F, "TEAC FD-55E FDD", tag, owner, clock, "teac_fd_55e", __FILE__) { } @@ -2136,7 +2136,7 @@ void teac_fd_55e::setup_characteristics() set_rpm(300); } -void teac_fd_55e::handled_variants(UINT32 *variants, int &var_count) const +void teac_fd_55e::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -2154,7 +2154,7 @@ void teac_fd_55e::handled_variants(UINT32 *variants, int &var_count) const // //------------------------------------------------- -teac_fd_55f::teac_fd_55f(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +teac_fd_55f::teac_fd_55f(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, TEAC_FD_55F, "TEAC FD-55F FDD", tag, owner, clock, "teac_fd_55f", __FILE__) { } @@ -2171,7 +2171,7 @@ void teac_fd_55f::setup_characteristics() set_rpm(300); } -void teac_fd_55f::handled_variants(UINT32 *variants, int &var_count) const +void teac_fd_55f::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -2192,7 +2192,7 @@ void teac_fd_55f::handled_variants(UINT32 *variants, int &var_count) const // //------------------------------------------------- -teac_fd_55g::teac_fd_55g(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +teac_fd_55g::teac_fd_55g(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, TEAC_FD_55G, "TEAC FD-55G FDD", tag, owner, clock, "teac_fd_55g", __FILE__) { } @@ -2209,7 +2209,7 @@ void teac_fd_55g::setup_characteristics() set_rpm(360); } -void teac_fd_55g::handled_variants(UINT32 *variants, int &var_count) const +void teac_fd_55g::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; @@ -2226,7 +2226,7 @@ void teac_fd_55g::handled_variants(UINT32 *variants, int &var_count) const // used in the Commodoere 1541 disk drive //------------------------------------------------- -alps_3255190x::alps_3255190x(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +alps_3255190x::alps_3255190x(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : floppy_image_device(mconfig, ALPS_3255190x, "ALPS 32551901/32551902 Floppy Drive", tag, owner, clock, "alps_3255190x", __FILE__) { } @@ -2244,7 +2244,7 @@ void alps_3255190x::setup_characteristics() cyl = 34; } -void alps_3255190x::handled_variants(UINT32 *variants, int &var_count) const +void alps_3255190x::handled_variants(uint32_t *variants, int &var_count) const { var_count = 0; variants[var_count++] = floppy_image::SSSD; diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h index 0742649050b..287008fff5b 100644 --- a/src/devices/imagedev/floppy.h +++ b/src/devices/imagedev/floppy.h @@ -71,10 +71,10 @@ public: typedef delegate wpt_cb; // construction/destruction - floppy_image_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); + floppy_image_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 ~floppy_image_device(); - virtual void handled_variants(UINT32 *variants, int &var_count) const = 0; + virtual void handled_variants(uint32_t *variants, int &var_count) const = 0; void set_formats(const floppy_format_type *formats); floppy_image_format_t *get_formats() const; @@ -104,7 +104,7 @@ public: void setup_ready_cb(ready_cb cb); void setup_wpt_cb(wpt_cb cb); - std::vector &get_buffer() { return image->get_buffer(cyl, ss, subcyl); } + std::vector &get_buffer() { return image->get_buffer(cyl, ss, subcyl); } int get_cyl() { return cyl; } void mon_w(int state); @@ -131,8 +131,8 @@ public: void write_flux(const attotime &start, const attotime &end, int transition_count, const attotime *transitions); void set_write_splice(const attotime &when); int get_sides() { return sides; } - UINT32 get_form_factor() const; - UINT32 get_variant() const; + uint32_t get_form_factor() const; + uint32_t get_variant() const; static const floppy_format_type default_floppy_formats[]; @@ -160,7 +160,7 @@ protected: /* Physical characteristics, filled by setup_characteristics */ int tracks; /* addressable tracks */ int sides; /* number of heads */ - UINT32 form_factor; /* 3"5, 5"25, etc */ + uint32_t form_factor; /* 3"5, 5"25, etc */ bool motor_always_on; /* state of input lines */ @@ -182,7 +182,7 @@ protected: int floppy_ratio_1; // rpm/300*1000 attotime revolution_start_time, rev_time; - UINT32 revolution_count; + uint32_t revolution_count; int cyl, subcyl; bool image_dirty; @@ -194,11 +194,11 @@ protected: ready_cb cur_ready_cb; wpt_cb cur_wpt_cb; - UINT32 find_position(attotime &base, const attotime &when); - int find_index(UINT32 position, const std::vector &buf); - void write_zone(UINT32 *buf, int &cells, int &index, UINT32 spos, UINT32 epos, UINT32 mg); + uint32_t find_position(attotime &base, const attotime &when); + int find_index(uint32_t position, const std::vector &buf); + void write_zone(uint32_t *buf, int &cells, int &index, uint32_t spos, uint32_t epos, uint32_t mg); void commit_image(); - attotime get_next_index_time(std::vector &buf, int index, int delta, attotime base); + attotime get_next_index_time(std::vector &buf, int index, int delta, attotime base); // Sound bool m_make_sound; @@ -208,9 +208,9 @@ protected: #define DECLARE_FLOPPY_IMAGE_DEVICE(_name, _interface) \ class _name : public floppy_image_device { \ public: \ - _name(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); \ + _name(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); \ virtual ~_name(); \ - virtual void handled_variants(UINT32 *variants, int &var_count) const override; \ + virtual void handled_variants(uint32_t *variants, int &var_count) const override; \ virtual const char *image_interface() const override { return _interface; } \ protected: \ virtual void setup_characteristics() override; \ @@ -256,7 +256,7 @@ extern const device_type FLOPPYSOUND; class floppy_sound_device : public samples_device { public: - floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void motor(bool on, bool withdisk); void step(int track); bool samples_loaded() { return m_loaded; } @@ -292,7 +292,7 @@ class floppy_connector: public device_t, public device_slot_interface { public: - floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~floppy_connector(); void set_formats(const floppy_format_type *formats); diff --git a/src/devices/imagedev/harddriv.cpp b/src/devices/imagedev/harddriv.cpp index 8070a1d9afe..6903e847abd 100644 --- a/src/devices/imagedev/harddriv.cpp +++ b/src/devices/imagedev/harddriv.cpp @@ -38,7 +38,7 @@ const device_type HARDDISK = &device_creator; // harddisk_image_device - constructor //------------------------------------------------- -harddisk_image_device::harddisk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +harddisk_image_device::harddisk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HARDDISK, "Harddisk", tag, owner, clock, "harddisk_image", __FILE__), device_image_interface(mconfig, *this), m_chd(nullptr), @@ -52,7 +52,7 @@ harddisk_image_device::harddisk_image_device(const machine_config &mconfig, cons //------------------------------------------------- // harddisk_image_device - constructor for subclasses //------------------------------------------------- -harddisk_image_device::harddisk_image_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) +harddisk_image_device::harddisk_image_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_image_interface(mconfig, *this), m_chd(nullptr), @@ -135,8 +135,8 @@ image_init_result harddisk_image_device::call_load() image_init_result harddisk_image_device::call_create(int create_format, util::option_resolution *create_args) { int err; - UINT32 sectorsize, hunksize; - UINT32 cylinders, heads, sectors, totalsectors; + uint32_t sectorsize, hunksize; + uint32_t cylinders, heads, sectors, totalsectors; assert_always(create_args != nullptr, "Expected create_args to not be nullptr"); cylinders = create_args->lookup_int('C'); @@ -149,7 +149,7 @@ image_init_result harddisk_image_device::call_create(int create_format, util::op /* create the CHD file */ chd_codec_type compression[4] = { CHD_CODEC_NONE }; - err = m_origchd.create(image_core_file(), (UINT64)totalsectors * (UINT64)sectorsize, hunksize, sectorsize, compression); + err = m_origchd.create(image_core_file(), (uint64_t)totalsectors * (uint64_t)sectorsize, hunksize, sectorsize, compression); if (err != CHDERR_NONE) goto error; diff --git a/src/devices/imagedev/harddriv.h b/src/devices/imagedev/harddriv.h index 2438262690c..0302a2b58b0 100644 --- a/src/devices/imagedev/harddriv.h +++ b/src/devices/imagedev/harddriv.h @@ -25,7 +25,7 @@ class harddisk_image_device : public device_t, { public: // construction/destruction - harddisk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + harddisk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~harddisk_image_device(); static void static_set_device_load(device_t &device, device_image_load_delegate callback) { downcast(device).m_device_image_load = callback; } @@ -54,7 +54,7 @@ public: chd_file *get_chd_file(); protected: - harddisk_image_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); + harddisk_image_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-level overrides virtual void device_config_complete() override; diff --git a/src/devices/imagedev/mfmhd.cpp b/src/devices/imagedev/mfmhd.cpp index faf49e95f23..312c597a31c 100644 --- a/src/devices/imagedev/mfmhd.cpp +++ b/src/devices/imagedev/mfmhd.cpp @@ -154,7 +154,7 @@ There are two data transfer methods: - - read(attotime &from_when, const attotime &limit, UINT16 &data) + - read(attotime &from_when, const attotime &limit, uint16_t &data) Delivers the MFM cells at the given point in time. The cells are returned in the data parameter. The behavior depends on the chosen encoding: @@ -167,7 +167,7 @@ When the limit is exceeded, the method returns true, otherwise false. - - write(attotime &from_when, const attotime &limit, UINT16 cdata, bool wpcom=false, bool reduced_wc=false) + - write(attotime &from_when, const attotime &limit, uint16_t cdata, bool wpcom=false, bool reduced_wc=false) Writes the MFM cells at the given point in time. cdata contains the cells according to the encoding (see above). The controller also has @@ -307,7 +307,7 @@ std::string mfm_harddisk_device::tts(const attotime &t) return buf; } -mfm_harddisk_device::mfm_harddisk_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) +mfm_harddisk_device::mfm_harddisk_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) : harddisk_image_device(mconfig, type, name, tag, owner, clock, shortname, source), device_slot_card_interface(mconfig, *this), m_index_timer(nullptr), @@ -791,7 +791,7 @@ void mfm_harddisk_device::step_w(line_state line) bool mfm_harddisk_device::find_position(attotime &from_when, const attotime &limit, int &bytepos, int &bit) { // Frequency - UINT32 freq = 1000000000/m_cell_size; + uint32_t freq = 1000000000/m_cell_size; // As we stop some few cells early each track, we adjust our position // to the track start @@ -830,9 +830,9 @@ bool mfm_harddisk_device::find_position(attotime &from_when, const attotime &lim Returns true if the time limit will be exceeded before reading the bit or complete byte. Otherwise returns the bit at the given position, or the complete data byte with the clock byte. */ -bool mfm_harddisk_device::read(attotime &from_when, const attotime &limit, UINT16 &cdata) +bool mfm_harddisk_device::read(attotime &from_when, const attotime &limit, uint16_t &cdata) { - UINT16* track = m_cache->get_trackimage(m_current_cylinder, m_current_head); + uint16_t* track = m_cache->get_trackimage(m_current_cylinder, m_current_head); if (track==nullptr) { @@ -869,9 +869,9 @@ bool mfm_harddisk_device::read(attotime &from_when, const attotime &limit, UINT1 Returns true if the time limit will be exceeded before writing the bit or complete byte. */ -bool mfm_harddisk_device::write(attotime &from_when, const attotime &limit, UINT16 cdata, bool wpcom, bool reduced_wc) +bool mfm_harddisk_device::write(attotime &from_when, const attotime &limit, uint16_t cdata, bool wpcom, bool reduced_wc) { - UINT16* track = m_cache->get_trackimage(m_current_cylinder, m_current_head); + uint16_t* track = m_cache->get_trackimage(m_current_cylinder, m_current_head); if (track==nullptr) { @@ -915,13 +915,13 @@ bool mfm_harddisk_device::write(attotime &from_when, const attotime &limit, UINT return false; } -chd_error mfm_harddisk_device::load_track(UINT16* data, int cylinder, int head) +chd_error mfm_harddisk_device::load_track(uint16_t* data, int cylinder, int head) { chd_error state = m_format->load(m_chd, data, m_trackimage_size, cylinder, head); return state; } -void mfm_harddisk_device::write_track(UINT16* data, int cylinder, int head) +void mfm_harddisk_device::write_track(uint16_t* data, int cylinder, int head) { m_format->save(m_chd, data, m_trackimage_size, cylinder, head); } @@ -934,7 +934,7 @@ int mfm_harddisk_device::get_actual_heads() /* The generic HD takes any kind of CHD HD image and magically creates enough heads and cylinders. */ -mfm_hd_generic_device::mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mfm_hd_generic_device::mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mfm_harddisk_device(mconfig, MFMHD_GENERIC, "Generic MFM hard disk", tag, owner, clock, "mfm_harddisk", __FILE__) { } @@ -944,7 +944,7 @@ const device_type MFMHD_GENERIC = &device_creator; /* Various models. */ -mfm_hd_st213_device::mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mfm_hd_st213_device::mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mfm_harddisk_device(mconfig, MFMHD_ST213, "Seagate ST-213 MFM hard disk", tag, owner, clock, "mfm_hd_st213", __FILE__) { m_phys_cylinders = 670; @@ -957,7 +957,7 @@ mfm_hd_st213_device::mfm_hd_st213_device(const machine_config &mconfig, const ch const device_type MFMHD_ST213 = &device_creator; -mfm_hd_st225_device::mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mfm_hd_st225_device::mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mfm_harddisk_device(mconfig, MFMHD_ST225, "Seagate ST-225 MFM hard disk", tag, owner, clock, "mfm_hd_st225", __FILE__) { m_phys_cylinders = 670; @@ -970,7 +970,7 @@ mfm_hd_st225_device::mfm_hd_st225_device(const machine_config &mconfig, const ch const device_type MFMHD_ST225 = &device_creator; -mfm_hd_st251_device::mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mfm_hd_st251_device::mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mfm_harddisk_device(mconfig, MFMHD_ST251, "Seagate ST-251 MFM hard disk", tag, owner, clock, "mfm_hd_st251", __FILE__) { m_phys_cylinders = 821; @@ -1081,7 +1081,7 @@ void mfmhd_trackimage_cache::init(mfm_harddisk_device* mfmhd, int tracksize, int if (TRACE_CACHE && TRACE_DETAIL) m_machine.logerror("[%s:cache] MFM HD allocate cache slot\n", mfmhd->tag()); previous = current; current = global_alloc(mfmhd_trackimage); - current->encdata = global_alloc_array(UINT16, tracksize); + current->encdata = global_alloc_array(uint16_t, tracksize); // Load the first tracks into the slots state = m_mfmhd->load_track(current->encdata, cylinder, head); @@ -1116,7 +1116,7 @@ void mfmhd_trackimage_cache::init(mfm_harddisk_device* mfmhd, int tracksize, int the CHD, convert it, and evict the least recently used line. The searched track will be the first in m_tracks. */ -UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head) +uint16_t* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head) { // Search the cached track images mfmhd_trackimage* current = m_tracks; @@ -1177,7 +1177,7 @@ UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head) // ================================================================ -mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock): +mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock): device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__), device_slot_interface(mconfig, *this), m_encoding(), diff --git a/src/devices/imagedev/mfmhd.h b/src/devices/imagedev/mfmhd.h index 64d4f9cec97..6d76d5bff9d 100644 --- a/src/devices/imagedev/mfmhd.h +++ b/src/devices/imagedev/mfmhd.h @@ -26,7 +26,7 @@ public: bool dirty; int cylinder; int head; - UINT16* encdata; // MFM encoding per byte + uint16_t* encdata; // MFM encoding per byte mfmhd_trackimage* next; }; @@ -36,7 +36,7 @@ public: mfmhd_trackimage_cache(running_machine &machine); ~mfmhd_trackimage_cache(); void init(mfm_harddisk_device* mfmhd, int tracksize, int trackslots); - UINT16* get_trackimage(int cylinder, int head); + uint16_t* get_trackimage(int cylinder, int head); void mark_current_as_dirty(); void cleanup(); void write_back_one(); @@ -51,7 +51,7 @@ class mfm_harddisk_device : public harddisk_image_device, public device_slot_card_interface { public: - mfm_harddisk_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); + mfm_harddisk_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); ~mfm_harddisk_device(); typedef delegate index_pulse_cb; @@ -76,10 +76,10 @@ public: line_state trk00_r() { return m_current_cylinder==0? ASSERT_LINE : CLEAR_LINE; } // Data output towards controller - bool read(attotime &from_when, const attotime &limit, UINT16 &data); + bool read(attotime &from_when, const attotime &limit, uint16_t &data); // Data input from controller - bool write(attotime &from_when, const attotime &limit, UINT16 cdata, bool wpcom=false, bool reduced_wc=false); + bool write(attotime &from_when, const attotime &limit, uint16_t cdata, bool wpcom=false, bool reduced_wc=false); // Step void step_w(line_state line); @@ -95,8 +95,8 @@ public: attotime track_end_time(); // Access the tracks on the image. Used as a callback from the cache. - chd_error load_track(UINT16* data, int cylinder, int head); - void write_track(UINT16* data, int cylinder, int head); + chd_error load_track(uint16_t* data, int cylinder, int head); + void write_track(uint16_t* data, int cylinder, int head); // Delivers the number of heads according to the loaded image int get_actual_heads(); @@ -174,7 +174,7 @@ private: class mfm_hd_generic_device : public mfm_harddisk_device { public: - mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type MFMHD_GENERIC; @@ -182,7 +182,7 @@ extern const device_type MFMHD_GENERIC; class mfm_hd_st213_device : public mfm_harddisk_device { public: - mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type MFMHD_ST213; @@ -190,7 +190,7 @@ extern const device_type MFMHD_ST213; class mfm_hd_st225_device : public mfm_harddisk_device { public: - mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type MFMHD_ST225; @@ -198,7 +198,7 @@ extern const device_type MFMHD_ST225; class mfm_hd_st251_device : public mfm_harddisk_device { public: - mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type MFMHD_ST251; @@ -209,7 +209,7 @@ class mfm_harddisk_connector : public device_t, public device_slot_interface { public: - mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mfm_harddisk_connector(); mfm_harddisk_device *get_device(); diff --git a/src/devices/imagedev/midiin.cpp b/src/devices/imagedev/midiin.cpp index 3b05a9c90ad..b4c556760db 100644 --- a/src/devices/imagedev/midiin.cpp +++ b/src/devices/imagedev/midiin.cpp @@ -22,7 +22,7 @@ const device_type MIDIIN = &device_creator; ctor -------------------------------------------------*/ -midiin_device::midiin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +midiin_device::midiin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDIIN, "MIDI In image device", tag, owner, clock, "midiin", __FILE__), device_image_interface(mconfig, *this), device_serial_interface(mconfig, *this), @@ -78,7 +78,7 @@ void midiin_device::device_timer(emu_timer &timer, device_timer_id id, int param return; } - UINT8 buf[8192*4]; + uint8_t buf[8192*4]; int bytesRead; if (m_midi == nullptr) { @@ -158,7 +158,7 @@ void midiin_device::tra_callback() m_input_cb(bit); } -void midiin_device::xmit_char(UINT8 data) +void midiin_device::xmit_char(uint8_t data) { // printf("MIDI in: xmit %02x\n", data); diff --git a/src/devices/imagedev/midiin.h b/src/devices/imagedev/midiin.h index d14cb9c0680..08429c54003 100644 --- a/src/devices/imagedev/midiin.h +++ b/src/devices/imagedev/midiin.h @@ -26,7 +26,7 @@ class midiin_device : public device_t, { public: // construction/destruction - midiin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midiin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_input_callback(device_t &device, _Object object) { return downcast(device).m_input_cb.set_callback(object); } @@ -59,12 +59,12 @@ protected: private: static const int XMIT_RING_SIZE = (8192*4*4); - void xmit_char(UINT8 data); + void xmit_char(uint8_t data); osd_midi_device *m_midi; emu_timer *m_timer; devcb_write_line m_input_cb; - UINT8 m_xmitring[XMIT_RING_SIZE]; + uint8_t m_xmitring[XMIT_RING_SIZE]; int m_xmit_read, m_xmit_write; bool m_tx_busy; }; diff --git a/src/devices/imagedev/midiout.cpp b/src/devices/imagedev/midiout.cpp index d1509080f59..e2784f72992 100644 --- a/src/devices/imagedev/midiout.cpp +++ b/src/devices/imagedev/midiout.cpp @@ -22,7 +22,7 @@ const device_type MIDIOUT = &device_creator; ctor -------------------------------------------------*/ -midiout_device::midiout_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +midiout_device::midiout_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDIOUT, "MIDI Out image device", tag, owner, clock, "midiout", __FILE__), device_image_interface(mconfig, *this), device_serial_interface(mconfig, *this), @@ -96,7 +96,7 @@ void midiout_device::call_unload(void) void midiout_device::rcv_complete() // Rx completed receiving byte { receive_register_extract(); - UINT8 data = get_received_char(); + uint8_t data = get_received_char(); if (m_midi) { diff --git a/src/devices/imagedev/midiout.h b/src/devices/imagedev/midiout.h index 062cf662630..b62e9a161c5 100644 --- a/src/devices/imagedev/midiout.h +++ b/src/devices/imagedev/midiout.h @@ -31,7 +31,7 @@ class midiout_device : public device_t, { public: // construction/destruction - midiout_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midiout_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // image-level overrides virtual image_init_result call_load() override; @@ -47,7 +47,7 @@ public: virtual const char *file_extensions() const override { return "mid"; } virtual bool core_opens_image_file() const override { return false; } - virtual void tx(UINT8 state) { rx_w(state); } + virtual void tx(uint8_t state) { rx_w(state); } protected: // device-level overrides diff --git a/src/devices/imagedev/printer.cpp b/src/devices/imagedev/printer.cpp index 25c3b0f7330..495ac5775d3 100644 --- a/src/devices/imagedev/printer.cpp +++ b/src/devices/imagedev/printer.cpp @@ -19,7 +19,7 @@ const device_type PRINTER = &device_creator; // printer_image_device - constructor //------------------------------------------------- -printer_image_device::printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +printer_image_device::printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PRINTER, "Printer", tag, owner, clock, "printer_image", __FILE__), device_image_interface(mconfig, *this), m_online_cb(*this) @@ -68,7 +68,7 @@ int printer_image_device::is_ready() printer_output - outputs data to a printer -------------------------------------------------*/ -void printer_image_device::output(UINT8 data) +void printer_image_device::output(uint8_t data) { if (exists()) { diff --git a/src/devices/imagedev/printer.h b/src/devices/imagedev/printer.h index 841d0fd400c..c2a547ef046 100644 --- a/src/devices/imagedev/printer.h +++ b/src/devices/imagedev/printer.h @@ -25,7 +25,7 @@ class printer_image_device : public device_t, { public: // construction/destruction - printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_online_callback(device_t &device, _Object object) { return downcast(device).m_online_cb.set_callback(object); } @@ -48,7 +48,7 @@ public: /* checks to see if a printer is ready */ int is_ready(); /* outputs data to a printer */ - void output(UINT8 data); + void output(uint8_t data); protected: // device-level overrides virtual void device_start() override; diff --git a/src/devices/imagedev/snapquik.cpp b/src/devices/imagedev/snapquik.cpp index 6449cbfb872..110288abf1f 100644 --- a/src/devices/imagedev/snapquik.cpp +++ b/src/devices/imagedev/snapquik.cpp @@ -18,7 +18,7 @@ const device_type SNAPSHOT = &device_creator; // snapshot_image_device - constructor //------------------------------------------------- -snapshot_image_device::snapshot_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +snapshot_image_device::snapshot_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNAPSHOT, "Snapshot", tag, owner, clock, "snapshot_image", __FILE__), device_image_interface(mconfig, *this), m_file_extensions(nullptr), @@ -29,7 +29,7 @@ snapshot_image_device::snapshot_image_device(const machine_config &mconfig, cons { } -snapshot_image_device::snapshot_image_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) : +snapshot_image_device::snapshot_image_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_image_interface(mconfig, *this), m_file_extensions(nullptr), @@ -96,7 +96,7 @@ const device_type QUICKLOAD = &device_creator; // quickload_image_device - constructor //------------------------------------------------- -quickload_image_device::quickload_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +quickload_image_device::quickload_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : snapshot_image_device(mconfig, QUICKLOAD, "Quickload", tag, owner, clock, "quickload", __FILE__) { } diff --git a/src/devices/imagedev/snapquik.h b/src/devices/imagedev/snapquik.h index 1c1a9a3b3df..c1c421f99cb 100644 --- a/src/devices/imagedev/snapquik.h +++ b/src/devices/imagedev/snapquik.h @@ -21,8 +21,8 @@ class snapshot_image_device : public device_t, { public: // construction/destruction - snapshot_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - snapshot_image_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); + snapshot_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + snapshot_image_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 ~snapshot_image_device(); static void static_set_interface(device_t &device, const char *_interface) { downcast(device).m_interface = _interface; } @@ -64,7 +64,7 @@ class quickload_image_device : public snapshot_image_device { public: // construction/destruction - quickload_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + quickload_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual iodevice_t image_type() const override { return IO_QUICKLOAD; } }; diff --git a/src/devices/machine/40105.cpp b/src/devices/machine/40105.cpp index c220f9eb18c..8dec8b78cec 100644 --- a/src/devices/machine/40105.cpp +++ b/src/devices/machine/40105.cpp @@ -34,7 +34,7 @@ const device_type CMOS_40105 = &device_creator; // cmos_40105_device - constructor //------------------------------------------------- -cmos_40105_device::cmos_40105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cmos_40105_device::cmos_40105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CMOS_40105, "40105", tag, owner, clock, "40105", __FILE__), m_write_dir(*this), m_write_dor(*this), m_d(0), m_q(0), m_dir(0), m_dor(0), m_si(0), m_so(0) @@ -68,7 +68,7 @@ void cmos_40105_device::device_start() void cmos_40105_device::device_reset() { - m_fifo = std::queue(); + m_fifo = std::queue(); m_dir = 1; m_dor = 0; @@ -83,7 +83,7 @@ void cmos_40105_device::device_reset() // read - read Q //------------------------------------------------- -UINT8 cmos_40105_device::read() +uint8_t cmos_40105_device::read() { return m_q; } @@ -93,7 +93,7 @@ UINT8 cmos_40105_device::read() // write - write D //------------------------------------------------- -void cmos_40105_device::write(UINT8 data) +void cmos_40105_device::write(uint8_t data) { m_d = data & 0x0f; } diff --git a/src/devices/machine/40105.h b/src/devices/machine/40105.h index 09411a0d3e3..67d3a58274e 100644 --- a/src/devices/machine/40105.h +++ b/src/devices/machine/40105.h @@ -37,13 +37,13 @@ class cmos_40105_device : public device_t { public: // construction/destruction - cmos_40105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cmos_40105_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_dir_callback(_dir dir) { m_write_dir.set_callback(dir); } template void set_dor_callback(_dor dor) { m_write_dor.set_callback(dor); } - UINT8 read(); - void write(UINT8 data); + uint8_t read(); + void write(uint8_t data); DECLARE_WRITE_LINE_MEMBER( si_w ); DECLARE_WRITE_LINE_MEMBER( so_w ); @@ -60,10 +60,10 @@ private: devcb_write_line m_write_dir; devcb_write_line m_write_dor; - std::queue m_fifo; + std::queue m_fifo; - UINT8 m_d; - UINT8 m_q; + uint8_t m_d; + uint8_t m_q; int m_dir; int m_dor; diff --git a/src/devices/machine/53c7xx.cpp b/src/devices/machine/53c7xx.cpp index c77baa6a8dc..daabe348188 100644 --- a/src/devices/machine/53c7xx.cpp +++ b/src/devices/machine/53c7xx.cpp @@ -58,7 +58,7 @@ const device_type NCR53C7XX = &device_creator; // ncr53c7xx_device - constructor/destructor //------------------------------------------------- -ncr53c7xx_device::ncr53c7xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ncr53c7xx_device::ncr53c7xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nscsi_device(mconfig, NCR53C7XX, "53C7xx SCSI", tag, owner, clock, "ncr537xx", __FILE__), device_execute_interface(mconfig, *this), m_icount(0), @@ -187,7 +187,7 @@ READ32_MEMBER( ncr53c7xx_device::read ) { VERBOSE_LOG(machine(), 1, "REG R: [%x] (%08X)\n", offset, mem_mask); - UINT32 ret = 0; + uint32_t ret = 0; switch (offset) { @@ -700,7 +700,7 @@ void ncr53c7xx_device::send_byte() set_scsi_state( (m_scsi_state & STATE_MASK) | (SEND_WAIT_SETTLE << SUB_SHIFT) ); - UINT32 data = m_host_read(m_dnad & ~3, 0xffffffff); + uint32_t data = m_host_read(m_dnad & ~3, 0xffffffff); data = data >> ((m_dnad & 3) * 8) & 0xff; ++m_dnad; @@ -742,8 +742,8 @@ void ncr53c7xx_device::device_timer(emu_timer &timer, device_timer_id id, int pa void ncr53c7xx_device::step(bool timeout) { - UINT32 ctrl = scsi_bus->ctrl_r(); - UINT32 data = scsi_bus->data_r(); + uint32_t ctrl = scsi_bus->ctrl_r(); + uint32_t data = scsi_bus->data_r(); VERBOSE_LOG(machine(), 2, "Step: CTRL:%x DATA:%x (%d.%d) Timeout:%d\n", ctrl, data, m_scsi_state & STATE_MASK, m_scsi_state >> SUB_SHIFT, timeout); @@ -1058,8 +1058,8 @@ void ncr53c7xx_device::step(bool timeout) { m_last_data = scsi_bus->data_r(); - UINT32 shift = (8 * (m_dnad & 3)); - UINT32 mem_mask = 0xff << shift; + uint32_t shift = (8 * (m_dnad & 3)); + uint32_t mem_mask = 0xff << shift; m_host_write(m_dnad & ~3, data << shift, mem_mask); ++m_dnad; @@ -1138,7 +1138,7 @@ void ncr53c7xx_device::execute_run() m_finished = false; // Fetch the instruction - UINT32 inst = m_host_read(m_dsp, 0xffffffff); + uint32_t inst = m_host_read(m_dsp, 0xffffffff); m_dcmd = inst >> 24; m_dbc = inst & 0xffffff; @@ -1534,7 +1534,7 @@ void ncr53c7xx_device::io_i_waitreselect() void ncr53c7xx_device::io_i_set() { - UINT32 mask = 0; + uint32_t mask = 0; if (m_dbc & (1 << 3)) mask |= S_ATN; @@ -1554,7 +1554,7 @@ void ncr53c7xx_device::io_i_set() void ncr53c7xx_device::io_i_clear() { - UINT32 mask = 0; + uint32_t mask = 0; if (m_dbc & (1 << 3)) mask |= S_ATN; diff --git a/src/devices/machine/53c7xx.h b/src/devices/machine/53c7xx.h index 00d87c6337d..f343f8472dc 100644 --- a/src/devices/machine/53c7xx.h +++ b/src/devices/machine/53c7xx.h @@ -72,7 +72,7 @@ class ncr53c7xx_device : public nscsi_device, { public: // construction/destruction - ncr53c7xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ncr53c7xx_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); } @@ -178,40 +178,40 @@ private: // SCSI registers - UINT8 m_scntl[2]; - UINT8 m_sdid; - UINT8 m_sien; - UINT8 m_scid; - UINT8 m_sxfer; - UINT8 m_sodl; - UINT8 m_socl; - UINT8 m_sfbr; - UINT8 m_sidl; - UINT8 m_sbdl; - UINT8 m_sbcl; - UINT8 m_dstat; - UINT8 m_sstat[3]; - UINT8 m_ctest[8]; - UINT32 m_temp; - UINT8 m_dfifo; - UINT8 m_istat; - UINT32 m_dbc; - UINT8 m_dcmd; - UINT32 m_dnad; - UINT32 m_dsp; - UINT32 m_dsps; - UINT8 m_dmode; - UINT8 m_dien; - UINT8 m_dwt; - UINT8 m_dcntl; + uint8_t m_scntl[2]; + uint8_t m_sdid; + uint8_t m_sien; + uint8_t m_scid; + uint8_t m_sxfer; + uint8_t m_sodl; + uint8_t m_socl; + uint8_t m_sfbr; + uint8_t m_sidl; + uint8_t m_sbdl; + uint8_t m_sbcl; + uint8_t m_dstat; + uint8_t m_sstat[3]; + uint8_t m_ctest[8]; + uint32_t m_temp; + uint8_t m_dfifo; + uint8_t m_istat; + uint32_t m_dbc; + uint8_t m_dcmd; + uint32_t m_dnad; + uint32_t m_dsp; + uint32_t m_dsps; + uint8_t m_dmode; + uint8_t m_dien; + uint8_t m_dwt; + uint8_t m_dcntl; // other state int m_scsi_state; bool m_connected; bool m_finished; - UINT8 m_last_data; - UINT32 m_xfr_phase; + uint8_t m_last_data; + uint32_t m_xfr_phase; emu_timer *m_tm; int m_scripts_state; diff --git a/src/devices/machine/53c810.cpp b/src/devices/machine/53c810.cpp index 2d6b7049016..1ea3bd8e1cc 100644 --- a/src/devices/machine/53c810.cpp +++ b/src/devices/machine/53c810.cpp @@ -9,9 +9,9 @@ #define DMA_MAX_ICOUNT 512 /* Maximum number of DMA Scripts opcodes to run */ #define DASM_OPCODES 0 -UINT32 lsi53c810_device::FETCH() +uint32_t lsi53c810_device::FETCH() { - UINT32 r = m_fetch_cb(dsp); + uint32_t r = m_fetch_cb(dsp); dsp += 4; return r; } @@ -23,8 +23,8 @@ void lsi53c810_device::dmaop_invalid() void lsi53c810_device::dmaop_move_memory() { - UINT32 src = FETCH(); - UINT32 dst = FETCH(); + uint32_t src = FETCH(); + uint32_t dst = FETCH(); int count; count = dcmd & 0xffffff; @@ -51,9 +51,9 @@ void lsi53c810_device::dmaop_interrupt() void lsi53c810_device::dmaop_block_move() { - UINT32 address; - UINT32 count; - INT32 dsps; + uint32_t address; + uint32_t count; + int32_t dsps; address = FETCH(); count = dcmd & 0x00ffffff; @@ -65,7 +65,7 @@ void lsi53c810_device::dmaop_block_move() // table indirect if (dcmd & 0x10000000) { - dsps = (INT32)address&0xffffff; + dsps = (int32_t)address&0xffffff; // sign extend if (dsps & 0x00800000) { @@ -95,7 +95,7 @@ void lsi53c810_device::dmaop_block_move() void lsi53c810_device::dmaop_select() { -// UINT32 operand; +// uint32_t operand; // operand = FETCH(); @@ -122,7 +122,7 @@ void lsi53c810_device::dmaop_select() void lsi53c810_device::dmaop_wait_disconnect() { -// UINT32 operand; +// uint32_t operand; // operand = FETCH(); @@ -140,7 +140,7 @@ void lsi53c810_device::dmaop_wait_disconnect() void lsi53c810_device::dmaop_wait_reselect() { - // UINT32 operand; + // uint32_t operand; // operand = FETCH(); @@ -158,7 +158,7 @@ void lsi53c810_device::dmaop_wait_reselect() void lsi53c810_device::dmaop_set() { -// UINT32 operand; +// uint32_t operand; // operand = FETCH(); @@ -187,7 +187,7 @@ void lsi53c810_device::dmaop_set() void lsi53c810_device::dmaop_clear() { -// UINT32 operand; +// uint32_t operand; // operand = FETCH(); @@ -289,10 +289,10 @@ int lsi53c810_device::scripts_compute_branch() return passed; } -UINT32 lsi53c810_device::scripts_get_jump_dest() +uint32_t lsi53c810_device::scripts_get_jump_dest() { - INT32 dsps; - UINT32 dest; + int32_t dsps; + uint32_t dest; dsps = FETCH(); @@ -309,7 +309,7 @@ UINT32 lsi53c810_device::scripts_get_jump_dest() dsps += dsp; } - dest = (UINT32)dsps; + dest = (uint32_t)dsps; logerror("cur DSP %x, dest %x\n", dsp, dest); @@ -394,7 +394,7 @@ void lsi53c810_device::dma_exec() } } -UINT8 lsi53c810_device::lsi53c810_reg_r( int offset ) +uint8_t lsi53c810_device::lsi53c810_reg_r( int offset ) { // logerror("53c810: read reg %d:0x%x (PC=%x)\n", offset, offset, space.device().safe_pc()); switch(offset) @@ -477,7 +477,7 @@ UINT8 lsi53c810_device::lsi53c810_reg_r( int offset ) //return 0; } -void lsi53c810_device::lsi53c810_reg_w(int offset, UINT8 data) +void lsi53c810_device::lsi53c810_reg_w(int offset, uint8_t data) { // logerror("53c810: %02x to reg %d:0x%x (PC=%x)\n", data, offset, offset, space.device().safe_pc()); switch(offset) @@ -610,7 +610,7 @@ void lsi53c810_device::lsi53c810_reg_w(int offset, UINT8 data) } } -void lsi53c810_device::add_opcode(UINT8 op, UINT8 mask, opcode_handler_delegate handler) +void lsi53c810_device::add_opcode(uint8_t op, uint8_t mask, opcode_handler_delegate handler) { for (int i = 0; i < 256; i++) { @@ -621,7 +621,7 @@ void lsi53c810_device::add_opcode(UINT8 op, UINT8 mask, opcode_handler_delegate } } -lsi53c810_device::lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lsi53c810_device::lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : legacy_scsi_host_adapter(mconfig, LSI53C810, "53C810 SCSI", tag, owner, clock, "lsi53c810", __FILE__) { } @@ -663,17 +663,17 @@ void lsi53c810_device::device_start() * *************************************/ -UINT32 lsi53c810_device::lsi53c810_dasm_fetch(UINT32 pc) +uint32_t lsi53c810_device::lsi53c810_dasm_fetch(uint32_t pc) { return m_fetch_cb(pc); } -unsigned lsi53c810_device::lsi53c810_dasm(char *buf, UINT32 pc) +unsigned lsi53c810_device::lsi53c810_dasm(char *buf, uint32_t pc) { unsigned result = 0; const char *op_mnemonic = nullptr; - UINT32 op = lsi53c810_dasm_fetch(pc); - UINT32 dest; + uint32_t op = lsi53c810_dasm_fetch(pc); + uint32_t dest; int i; static const char *const phases[] = @@ -699,7 +699,7 @@ unsigned lsi53c810_device::lsi53c810_dasm(char *buf, UINT32 pc) { static const struct { - UINT32 flag; + uint32_t flag; const char *text; } flags[] = { diff --git a/src/devices/machine/53c810.h b/src/devices/machine/53c810.h index 49ac2281e2f..b00bf57e8ed 100644 --- a/src/devices/machine/53c810.h +++ b/src/devices/machine/53c810.h @@ -8,25 +8,25 @@ typedef device_delegate lsi53c810_irq_delegate; #define LSI53C810_IRQ_CB(name) void name(int state) -typedef device_delegate lsi53c810_dma_delegate; -#define LSI53C810_DMA_CB(name) void name(UINT32 src, UINT32 dst, int length, int byteswap) +typedef device_delegate lsi53c810_dma_delegate; +#define LSI53C810_DMA_CB(name) void name(uint32_t src, uint32_t dst, int length, int byteswap) -typedef device_delegate lsi53c810_fetch_delegate; -#define LSI53C810_FETCH_CB(name) UINT32 name(UINT32 dsp) +typedef device_delegate lsi53c810_fetch_delegate; +#define LSI53C810_FETCH_CB(name) uint32_t name(uint32_t dsp) class lsi53c810_device : public legacy_scsi_host_adapter { public: // construction/destruction - lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lsi53c810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_irq_callback(device_t &device, lsi53c810_irq_delegate callback) { downcast(device).m_irq_cb = callback; } static void set_dma_callback(device_t &device, lsi53c810_dma_delegate callback) { downcast(device).m_dma_cb = callback; } static void set_fetch_callback(device_t &device, lsi53c810_fetch_delegate callback) { downcast(device).m_fetch_cb = callback; } - UINT8 lsi53c810_reg_r( int offset ); - void lsi53c810_reg_w(int offset, UINT8 data); + uint8_t lsi53c810_reg_r( int offset ); + void lsi53c810_reg_w(int offset, uint8_t data); protected: // device-level overrides @@ -40,7 +40,7 @@ private: lsi53c810_dma_delegate m_dma_cb; lsi53c810_fetch_delegate m_fetch_cb; - UINT32 FETCH(); + uint32_t FETCH(); void dmaop_invalid(); void dmaop_move_memory(); void dmaop_interrupt(); @@ -54,44 +54,44 @@ private: void dmaop_move_to_sfbr(); void dmaop_read_modify_write(); int scripts_compute_branch(); - UINT32 scripts_get_jump_dest(); + uint32_t scripts_get_jump_dest(); void dmaop_jump(); void dmaop_call(); void dmaop_return(); void dmaop_store(); void dmaop_load(); void dma_exec(); - void add_opcode(UINT8 op, UINT8 mask, opcode_handler_delegate handler); - UINT32 lsi53c810_dasm_fetch(UINT32 pc); - unsigned lsi53c810_dasm(char *buf, UINT32 pc); - - UINT8 scntl0; - UINT8 scntl1; - UINT8 scntl2; - UINT8 scntl3; - UINT8 scid; - UINT8 sxfer; - UINT8 socl; - UINT8 istat; - UINT8 dstat; - UINT8 sstat0; - UINT8 sstat1; - UINT8 sstat2; - UINT8 dien; - UINT8 dcntl; - UINT8 dmode; - UINT32 temp; - UINT32 dsa; - UINT32 dsp; - UINT32 dsps; - UINT32 dcmd; - UINT8 sien0; - UINT8 sien1; - UINT8 stime0; - UINT8 respid; - UINT8 stest1; - UINT8 scratch_a[4]; - UINT8 scratch_b[4]; + void add_opcode(uint8_t op, uint8_t mask, opcode_handler_delegate handler); + uint32_t lsi53c810_dasm_fetch(uint32_t pc); + unsigned lsi53c810_dasm(char *buf, uint32_t pc); + + uint8_t scntl0; + uint8_t scntl1; + uint8_t scntl2; + uint8_t scntl3; + uint8_t scid; + uint8_t sxfer; + uint8_t socl; + uint8_t istat; + uint8_t dstat; + uint8_t sstat0; + uint8_t sstat1; + uint8_t sstat2; + uint8_t dien; + uint8_t dcntl; + uint8_t dmode; + uint32_t temp; + uint32_t dsa; + uint32_t dsp; + uint32_t dsps; + uint32_t dcmd; + uint8_t sien0; + uint8_t sien1; + uint8_t stime0; + uint8_t respid; + uint8_t stest1; + uint8_t scratch_a[4]; + uint8_t scratch_b[4]; int dma_icount; int halted; int carry; diff --git a/src/devices/machine/64h156.cpp b/src/devices/machine/64h156.cpp index 243627e1f1e..849109f1b11 100644 --- a/src/devices/machine/64h156.cpp +++ b/src/devices/machine/64h156.cpp @@ -54,7 +54,7 @@ const device_type C64H156 = &device_creator; // c64h156_device - constructor //------------------------------------------------- -c64h156_device::c64h156_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +c64h156_device::c64h156_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64H156, "64H156", tag, owner, clock, "c64h156", __FILE__), m_write_atn(*this), m_write_sync(*this), diff --git a/src/devices/machine/64h156.h b/src/devices/machine/64h156.h index 6cab8bb369d..08d68a994e4 100644 --- a/src/devices/machine/64h156.h +++ b/src/devices/machine/64h156.h @@ -92,7 +92,7 @@ class c64h156_device : public device_t { public: // construction/destruction - c64h156_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c64h156_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_atn_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_atn.set_callback(object); } template static devcb_base &set_sync_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_sync.set_callback(object); } @@ -141,18 +141,18 @@ private: int oe; int soe; int accl; - UINT8 accl_yb; + uint8_t accl_yb; attotime edge; - UINT16 shift_reg; + uint16_t shift_reg; int cycle_counter; int cell_counter; int bit_counter; int zero_counter; int cycles_until_random_flux; - UINT8 yb; - UINT8 shift_reg_write; + uint8_t yb; + uint8_t shift_reg_write; attotime write_start_time; attotime write_buffer[32]; int write_position; @@ -171,7 +171,7 @@ private: int m_soe; int m_oe; int m_ted; - UINT8 m_yb; + uint8_t m_yb; int m_atni; int m_atna; diff --git a/src/devices/machine/6522via.cpp b/src/devices/machine/6522via.cpp index 56a35e19040..2949b77c594 100644 --- a/src/devices/machine/6522via.cpp +++ b/src/devices/machine/6522via.cpp @@ -110,9 +110,9 @@ INLINE FUNCTIONS ***************************************************************************/ -UINT16 via6522_device::get_counter1_value() +uint16_t via6522_device::get_counter1_value() { - UINT16 val; + uint16_t val; if(m_t1_active) { @@ -142,7 +142,7 @@ ADDRESS_MAP_END // via6522_device - constructor //------------------------------------------------- -via6522_device::via6522_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +via6522_device::via6522_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIA6522, "6522 VIA", tag, owner, clock, "via6522", __FILE__), m_in_a_handler(*this), m_in_b_handler(*this), @@ -442,7 +442,7 @@ void via6522_device::device_timer(emu_timer &timer, device_timer_id id, int para } } -UINT8 via6522_device::input_pa() +uint8_t via6522_device::input_pa() { /// TODO: REMOVE THIS if (!m_in_a_handler.isnull()) @@ -458,11 +458,11 @@ UINT8 via6522_device::input_pa() void via6522_device::output_pa() { - UINT8 pa = (m_out_a & m_ddr_a) | ~m_ddr_a; + uint8_t pa = (m_out_a & m_ddr_a) | ~m_ddr_a; m_out_a_handler(pa); } -UINT8 via6522_device::input_pb() +uint8_t via6522_device::input_pb() { /// TODO: REMOVE THIS if (m_ddr_b != 0xff && !m_in_b_handler.isnull()) @@ -470,7 +470,7 @@ UINT8 via6522_device::input_pb() m_in_b = m_in_b_handler(0); } - UINT8 pb = (m_out_b & m_ddr_b) + (m_in_b & ~m_ddr_b); + uint8_t pb = (m_out_b & m_ddr_b) + (m_in_b & ~m_ddr_b); if (T1_SET_PB7(m_acr)) pb = (pb & 0x7f) | (m_t1_pb7 << 7); @@ -480,7 +480,7 @@ UINT8 via6522_device::input_pb() void via6522_device::output_pb() { - UINT8 pb = (m_out_b & m_ddr_b) | ~m_ddr_b; + uint8_t pb = (m_out_b & m_ddr_b) | ~m_ddr_b; if (T1_SET_PB7(m_acr)) pb = (pb & 0x7f) | (m_t1_pb7 << 7); @@ -811,7 +811,7 @@ WRITE8_MEMBER( via6522_device::write ) case VIA_ACR: { - UINT16 counter1 = get_counter1_value(); + uint16_t counter1 = get_counter1_value(); m_acr = data; output_pb(); diff --git a/src/devices/machine/6522via.h b/src/devices/machine/6522via.h index 467ff0885fb..316606ea35c 100644 --- a/src/devices/machine/6522via.h +++ b/src/devices/machine/6522via.h @@ -64,7 +64,7 @@ class via6522_device : public device_t { public: // construction/destruction - via6522_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + via6522_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // TODO: REMOVE THESE template static devcb_base &set_readpa_handler(device_t &device, _Object object) { return downcast(device).m_in_a_handler.set_callback(object); } @@ -140,7 +140,7 @@ private: static const device_timer_id TIMER_T2 = 2; static const device_timer_id TIMER_CA2 = 3; - UINT16 get_counter1_value(); + uint16_t get_counter1_value(); void set_int(int data); void clear_int(int data); @@ -149,9 +149,9 @@ private: void write_pa(int line, int state); void write_pb(int line, int state); - UINT8 input_pa(); + uint8_t input_pa(); void output_pa(); - UINT8 input_pb(); + uint8_t input_pb(); void output_pb(); void output_irq(); @@ -168,49 +168,49 @@ private: devcb_write_line m_cb2_handler; devcb_write_line m_irq_handler; - UINT8 m_in_a; + uint8_t m_in_a; int m_in_ca1; int m_in_ca2; - UINT8 m_out_a; + uint8_t m_out_a; int m_out_ca2; - UINT8 m_ddr_a; - UINT8 m_latch_a; + uint8_t m_ddr_a; + uint8_t m_latch_a; - UINT8 m_in_b; + uint8_t m_in_b; int m_in_cb1; int m_in_cb2; - UINT8 m_out_b; + uint8_t m_out_b; int m_out_cb1; int m_out_cb2; - UINT8 m_ddr_b; - UINT8 m_latch_b; - - UINT8 m_t1cl; - UINT8 m_t1ch; - UINT8 m_t1ll; - UINT8 m_t1lh; - UINT8 m_t2cl; - UINT8 m_t2ch; - UINT8 m_t2ll; - UINT8 m_t2lh; - - UINT8 m_sr; - UINT8 m_pcr; - UINT8 m_acr; - UINT8 m_ier; - UINT8 m_ifr; + uint8_t m_ddr_b; + uint8_t m_latch_b; + + uint8_t m_t1cl; + uint8_t m_t1ch; + uint8_t m_t1ll; + uint8_t m_t1lh; + uint8_t m_t2cl; + uint8_t m_t2ch; + uint8_t m_t2ll; + uint8_t m_t2lh; + + uint8_t m_sr; + uint8_t m_pcr; + uint8_t m_acr; + uint8_t m_ier; + uint8_t m_ifr; emu_timer *m_t1; attotime m_time1; - UINT8 m_t1_active; + uint8_t m_t1_active; int m_t1_pb7; emu_timer *m_t2; attotime m_time2; - UINT8 m_t2_active; + uint8_t m_t2_active; emu_timer *m_ca2_timer; emu_timer *m_shift_timer; - UINT8 m_shift_counter; + uint8_t m_shift_counter; }; diff --git a/src/devices/machine/6525tpi.cpp b/src/devices/machine/6525tpi.cpp index 8d5a43a2b35..1658ce08d5b 100644 --- a/src/devices/machine/6525tpi.cpp +++ b/src/devices/machine/6525tpi.cpp @@ -106,7 +106,7 @@ const device_type TPI6525 = &device_creator; -tpi6525_device::tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tpi6525_device::tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TPI6525, "6525 TPI", tag, owner, clock, "tpi6525", __FILE__), m_out_irq_cb(*this), m_in_pa_cb(*this), @@ -296,7 +296,7 @@ WRITE_LINE_MEMBER( tpi6525_device::i4_w ) READ8_MEMBER( tpi6525_device::pa_r ) { - UINT8 data = m_in_a; + uint8_t data = m_in_a; if (!m_in_pa_cb.isnull()) data = m_in_pa_cb(offset); @@ -315,7 +315,7 @@ WRITE8_MEMBER( tpi6525_device::pa_w ) READ8_MEMBER( tpi6525_device::pb_r ) { - UINT8 data = m_in_b; + uint8_t data = m_in_b; if (!m_in_pb_cb.isnull()) data = m_in_pb_cb(offset); @@ -334,7 +334,7 @@ WRITE8_MEMBER( tpi6525_device::pb_w ) READ8_MEMBER( tpi6525_device::pc_r ) { - UINT8 data = m_in_c; + uint8_t data = m_in_c; if (!m_in_pc_cb.isnull()) data &= m_in_pc_cb(offset); @@ -353,7 +353,7 @@ WRITE8_MEMBER( tpi6525_device::pc_w ) READ8_MEMBER( tpi6525_device::read ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (offset & 7) { @@ -537,7 +537,7 @@ WRITE8_MEMBER( tpi6525_device::write ) } } -void tpi6525_device::port_line_w(UINT8 &port, int line, int state) +void tpi6525_device::port_line_w(uint8_t &port, int line, int state) { port &= ~(1 << line); port |= state << line; @@ -545,17 +545,17 @@ void tpi6525_device::port_line_w(UINT8 &port, int line, int state) /* this should probably be done better, needed for amigacd.c */ -UINT8 tpi6525_device::get_ddr_a() +uint8_t tpi6525_device::get_ddr_a() { return m_ddr_a; } -UINT8 tpi6525_device::get_ddr_b() +uint8_t tpi6525_device::get_ddr_b() { return m_ddr_b; } -UINT8 tpi6525_device::get_ddr_c() +uint8_t tpi6525_device::get_ddr_c() { return m_ddr_c; } diff --git a/src/devices/machine/6525tpi.h b/src/devices/machine/6525tpi.h index a1699ea213b..ed927d2e11a 100644 --- a/src/devices/machine/6525tpi.h +++ b/src/devices/machine/6525tpi.h @@ -39,7 +39,7 @@ class tpi6525_device : public device_t { public: - tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tpi6525_device() {} template static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_cb.set_callback(object); } @@ -77,9 +77,9 @@ public: WRITE_LINE_MEMBER( pb6_w ) { port_line_w(m_in_b, 6, state); } WRITE_LINE_MEMBER( pb7_w ) { port_line_w(m_in_b, 7, state); } - UINT8 get_ddr_a(); - UINT8 get_ddr_b(); - UINT8 get_ddr_c(); + uint8_t get_ddr_a(); + uint8_t get_ddr_b(); + uint8_t get_ddr_c(); protected: // device-level overrides @@ -102,22 +102,22 @@ private: devcb_write_line m_out_ca_cb; devcb_write_line m_out_cb_cb; - UINT8 m_port_a, m_ddr_a, m_in_a; - UINT8 m_port_b, m_ddr_b, m_in_b; - UINT8 m_port_c, m_ddr_c, m_in_c; + uint8_t m_port_a, m_ddr_a, m_in_a; + uint8_t m_port_b, m_ddr_b, m_in_b; + uint8_t m_port_c, m_ddr_c, m_in_c; - UINT8 m_ca_level, m_cb_level, m_interrupt_level; + uint8_t m_ca_level, m_cb_level, m_interrupt_level; - UINT8 m_cr; - UINT8 m_air; + uint8_t m_cr; + uint8_t m_air; - UINT8 m_irq_level[5]; + uint8_t m_irq_level[5]; void set_interrupt(); void clear_interrupt(); // helper function to write a single line - static void port_line_w(UINT8 &port, int line, int state); + static void port_line_w(uint8_t &port, int line, int state); }; extern const device_type TPI6525; diff --git a/src/devices/machine/6532riot.cpp b/src/devices/machine/6532riot.cpp index 8ef5566fbde..7ed81903115 100644 --- a/src/devices/machine/6532riot.cpp +++ b/src/devices/machine/6532riot.cpp @@ -62,7 +62,7 @@ void riot6532_device::update_irqstate() according to the DDR -------------------------------------------------*/ -UINT8 riot6532_device::apply_ddr(const riot6532_port *port) +uint8_t riot6532_device::apply_ddr(const riot6532_port *port) { return (port->m_out & port->m_ddr) | (port->m_in & ~port->m_ddr); } @@ -75,7 +75,7 @@ UINT8 riot6532_device::apply_ddr(const riot6532_port *port) void riot6532_device::update_pa7_state() { - UINT8 data = apply_ddr(&m_port[0]) & 0x80; + uint8_t data = apply_ddr(&m_port[0]) & 0x80; /* if the state changed in the correct direction, set the PA7 flag and update IRQs */ if ((m_pa7prev ^ data) && (m_pa7dir ^ data) == 0) @@ -91,7 +91,7 @@ void riot6532_device::update_pa7_state() get_timer - return the current timer value -------------------------------------------------*/ -UINT8 riot6532_device::get_timer() +uint8_t riot6532_device::get_timer() { /* if idle, return 0 */ if (m_timerstate == TIMER_IDLE) @@ -151,14 +151,14 @@ WRITE8_MEMBER( riot6532_device::write ) reg_w(offset, data); } -void riot6532_device::reg_w(UINT8 offset, UINT8 data) +void riot6532_device::reg_w(uint8_t offset, uint8_t data) { /* if A4 == 1 and A2 == 1, we are writing to the timer */ if ((offset & 0x14) == 0x14) { - static const UINT8 timershift[4] = { 0, 3, 6, 10 }; + static const uint8_t timershift[4] = { 0, 3, 6, 10 }; attotime curtime = machine().time(); - INT64 target; + int64_t target; /* A0-A1 contain the timer divisor */ m_timershift = timershift[offset & 3]; @@ -236,9 +236,9 @@ READ8_MEMBER( riot6532_device::read ) return reg_r(offset, space.debugger_access()); } -UINT8 riot6532_device::reg_r(UINT8 offset, bool debugger_access) +uint8_t riot6532_device::reg_r(uint8_t offset, bool debugger_access) { - UINT8 val; + uint8_t val; /* if A2 == 1 and A0 == 1, we are reading interrupt flags */ if ((offset & 0x05) == 0x05) @@ -321,7 +321,7 @@ UINT8 riot6532_device::reg_r(UINT8 offset, bool debugger_access) porta_in_set - set port A input value -------------------------------------------------*/ -void riot6532_device::porta_in_set(UINT8 data, UINT8 mask) +void riot6532_device::porta_in_set(uint8_t data, uint8_t mask) { m_port[0].m_in = (m_port[0].m_in & ~mask) | (data & mask); update_pa7_state(); @@ -332,7 +332,7 @@ void riot6532_device::porta_in_set(UINT8 data, UINT8 mask) portb_in_set - set port B input value -------------------------------------------------*/ -void riot6532_device::portb_in_set(UINT8 data, UINT8 mask) +void riot6532_device::portb_in_set(uint8_t data, uint8_t mask) { m_port[1].m_in = (m_port[1].m_in & ~mask) | (data & mask); } @@ -342,7 +342,7 @@ void riot6532_device::portb_in_set(UINT8 data, UINT8 mask) porta_in_get - return port A input value -------------------------------------------------*/ -UINT8 riot6532_device::porta_in_get() +uint8_t riot6532_device::porta_in_get() { return m_port[0].m_in; } @@ -352,7 +352,7 @@ UINT8 riot6532_device::porta_in_get() portb_in_get - return port B input value -------------------------------------------------*/ -UINT8 riot6532_device::portb_in_get() +uint8_t riot6532_device::portb_in_get() { return m_port[1].m_in; } @@ -362,7 +362,7 @@ UINT8 riot6532_device::portb_in_get() porta_in_get - return port A output value -------------------------------------------------*/ -UINT8 riot6532_device::porta_out_get() +uint8_t riot6532_device::porta_out_get() { return m_port[0].m_out; } @@ -372,7 +372,7 @@ UINT8 riot6532_device::porta_out_get() portb_in_get - return port B output value -------------------------------------------------*/ -UINT8 riot6532_device::portb_out_get() +uint8_t riot6532_device::portb_out_get() { return m_port[1].m_out; } @@ -386,7 +386,7 @@ UINT8 riot6532_device::portb_out_get() // riot6532_device - constructor //------------------------------------------------- -riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RIOT6532, "6532 RIOT", tag, owner, clock, "riot6532", __FILE__), m_in_pa_cb(*this), m_out_pa_cb(*this), diff --git a/src/devices/machine/6532riot.h b/src/devices/machine/6532riot.h index dd1699c6c48..4ab030fe96d 100644 --- a/src/devices/machine/6532riot.h +++ b/src/devices/machine/6532riot.h @@ -45,7 +45,7 @@ class riot6532_device : public device_t { public: // construction/destruction - riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_in_pa_callback(device_t &device, _Object object) { return downcast(device).m_in_pa_cb.set_callback(object); } template static devcb_base &set_out_pa_callback(device_t &device, _Object object) { return downcast(device).m_out_pa_cb.set_callback(object); } @@ -56,17 +56,17 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - UINT8 reg_r(UINT8 offset, bool debugger_access = false); - void reg_w(UINT8 offset, UINT8 data); + uint8_t reg_r(uint8_t offset, bool debugger_access = false); + void reg_w(uint8_t offset, uint8_t data); - void porta_in_set(UINT8 data, UINT8 mask); - void portb_in_set(UINT8 data, UINT8 mask); + void porta_in_set(uint8_t data, uint8_t mask); + void portb_in_set(uint8_t data, uint8_t mask); - UINT8 porta_in_get(); - UINT8 portb_in_get(); + uint8_t porta_in_get(); + uint8_t portb_in_get(); - UINT8 porta_out_get(); - UINT8 portb_out_get(); + uint8_t porta_out_get(); + uint8_t portb_out_get(); void timer_end(); @@ -74,9 +74,9 @@ protected: class riot6532_port { public: - UINT8 m_in; - UINT8 m_out; - UINT8 m_ddr; + uint8_t m_in; + uint8_t m_out; + uint8_t m_ddr; devcb_read8 *m_in_cb; devcb_write8 *m_out_cb; }; @@ -91,9 +91,9 @@ protected: private: void update_irqstate(); - UINT8 apply_ddr(const riot6532_port *port); + uint8_t apply_ddr(const riot6532_port *port); void update_pa7_state(); - UINT8 get_timer(); + uint8_t get_timer(); riot6532_port m_port[2]; @@ -103,15 +103,15 @@ private: devcb_write8 m_out_pb_cb; devcb_write_line m_irq_cb; - UINT8 m_irqstate; - UINT8 m_irqenable; + uint8_t m_irqstate; + uint8_t m_irqenable; int m_irq; - UINT8 m_pa7dir; /* 0x80 = high-to-low, 0x00 = low-to-high */ - UINT8 m_pa7prev; + uint8_t m_pa7dir; /* 0x80 = high-to-low, 0x00 = low-to-high */ + uint8_t m_pa7prev; - UINT8 m_timershift; - UINT8 m_timerstate; + uint8_t m_timershift; + uint8_t m_timerstate; emu_timer * m_timer; enum diff --git a/src/devices/machine/6821pia.cpp b/src/devices/machine/6821pia.cpp index a2a08180086..85a5b4d9c3e 100644 --- a/src/devices/machine/6821pia.cpp +++ b/src/devices/machine/6821pia.cpp @@ -49,7 +49,7 @@ const device_type PIA6821 = &device_creator; // pia6821_device - constructor //------------------------------------------------- -pia6821_device::pia6821_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pia6821_device::pia6821_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PIA6821, "6821 PIA", tag, owner, clock, "pia6821", __FILE__), m_in_a_handler(*this), m_in_b_handler(*this), @@ -218,10 +218,10 @@ void pia6821_device::update_interrupts() // get_in_a_value //------------------------------------------------- -UINT8 pia6821_device::get_in_a_value() +uint8_t pia6821_device::get_in_a_value() { - UINT8 port_a_data = 0; - UINT8 ret; + uint8_t port_a_data = 0; + uint8_t ret; // update the input if (!m_in_a_handler.isnull()) @@ -262,9 +262,9 @@ UINT8 pia6821_device::get_in_a_value() // get_in_b_value //------------------------------------------------- -UINT8 pia6821_device::get_in_b_value() +uint8_t pia6821_device::get_in_b_value() { - UINT8 ret; + uint8_t ret; if (m_ddr_b == 0xff) { @@ -273,7 +273,7 @@ UINT8 pia6821_device::get_in_b_value() } else { - UINT8 port_b_data; + uint8_t port_b_data; // update the input if (!m_in_b_handler.isnull()) @@ -311,9 +311,9 @@ UINT8 pia6821_device::get_in_b_value() // get_out_a_value //------------------------------------------------- -UINT8 pia6821_device::get_out_a_value() +uint8_t pia6821_device::get_out_a_value() { - UINT8 ret; + uint8_t ret; if (m_ddr_a == 0xff) { @@ -334,7 +334,7 @@ UINT8 pia6821_device::get_out_a_value() // get_out_b_value //------------------------------------------------- -UINT8 pia6821_device::get_out_b_value() +uint8_t pia6821_device::get_out_b_value() { // input pins are high-impedance - we just send them as zeros for backwards compatibility return m_out_b & m_ddr_b; @@ -404,9 +404,9 @@ void pia6821_device::set_out_cb2(int data) // port_a_r //------------------------------------------------- -UINT8 pia6821_device::port_a_r() +uint8_t pia6821_device::port_a_r() { - UINT8 ret = get_in_a_value(); + uint8_t ret = get_in_a_value(); // IRQ flags implicitly cleared by a read m_irq_a1 = FALSE; @@ -436,9 +436,9 @@ UINT8 pia6821_device::port_a_r() // ddr_a_r //------------------------------------------------- -UINT8 pia6821_device::ddr_a_r() +uint8_t pia6821_device::ddr_a_r() { - UINT8 ret = m_ddr_a; + uint8_t ret = m_ddr_a; LOG(("PIA #%s: DDR A read = %02X\n", tag(), ret)); @@ -450,9 +450,9 @@ UINT8 pia6821_device::ddr_a_r() // port_b_r //------------------------------------------------- -UINT8 pia6821_device::port_b_r() +uint8_t pia6821_device::port_b_r() { - UINT8 ret = get_in_b_value(); + uint8_t ret = get_in_b_value(); // This read will implicitly clear the IRQ B1 flag. If CB2 is in write-strobe // mode with CB1 restore, and a CB1 active transition set the flag, @@ -478,9 +478,9 @@ UINT8 pia6821_device::port_b_r() // ddr_b_r //------------------------------------------------- -UINT8 pia6821_device::ddr_b_r() +uint8_t pia6821_device::ddr_b_r() { - UINT8 ret = m_ddr_b; + uint8_t ret = m_ddr_b; LOG(("PIA #%s: DDR B read = %02X\n", tag(), ret)); @@ -492,9 +492,9 @@ UINT8 pia6821_device::ddr_b_r() // control_a_r //------------------------------------------------- -UINT8 pia6821_device::control_a_r() +uint8_t pia6821_device::control_a_r() { - UINT8 ret; + uint8_t ret; // update CA1 & CA2 if callback exists, these in turn may update IRQ's if (!m_in_ca1_handler.isnull()) @@ -541,9 +541,9 @@ UINT8 pia6821_device::control_a_r() // control_b_r //------------------------------------------------- -UINT8 pia6821_device::control_b_r() +uint8_t pia6821_device::control_b_r() { - UINT8 ret; + uint8_t ret; // update CB1 & CB2 if callback exists, these in turn may update IRQ's if(!m_in_cb1_handler.isnull()) @@ -586,9 +586,9 @@ UINT8 pia6821_device::control_b_r() // read //------------------------------------------------- -UINT8 pia6821_device::reg_r(UINT8 offset) +uint8_t pia6821_device::reg_r(uint8_t offset) { - UINT8 ret; + uint8_t ret; switch (offset & 0x03) { @@ -636,7 +636,7 @@ UINT8 pia6821_device::reg_r(UINT8 offset) void pia6821_device::send_to_out_a_func(const char* message) { // input pins are pulled high - UINT8 data = get_out_a_value(); + uint8_t data = get_out_a_value(); LOG(("PIA #%s: %s = %02X\n", tag(), message, data)); @@ -663,7 +663,7 @@ void pia6821_device::send_to_out_a_func(const char* message) void pia6821_device::send_to_out_b_func(const char* message) { // input pins are high-impedance - we just send them as zeros for backwards compatibility - UINT8 data = get_out_b_value(); + uint8_t data = get_out_b_value(); LOG(("PIA #%s: %s = %02X\n", tag(), message, data)); @@ -687,7 +687,7 @@ void pia6821_device::send_to_out_b_func(const char* message) // port_a_w //------------------------------------------------- -void pia6821_device::port_a_w(UINT8 data) +void pia6821_device::port_a_w(uint8_t data) { // buffer the output value m_out_a = data; @@ -700,7 +700,7 @@ void pia6821_device::port_a_w(UINT8 data) // ddr_a_w //------------------------------------------------- -void pia6821_device::ddr_a_w(UINT8 data) +void pia6821_device::ddr_a_w(uint8_t data) { if(data == 0x00) { @@ -729,7 +729,7 @@ void pia6821_device::ddr_a_w(UINT8 data) // port_b_w //------------------------------------------------- -void pia6821_device::port_b_w(UINT8 data) +void pia6821_device::port_b_w(uint8_t data) { // buffer the output value m_out_b = data; @@ -755,7 +755,7 @@ void pia6821_device::port_b_w(UINT8 data) // ddr_b_w //------------------------------------------------- -void pia6821_device::ddr_b_w(UINT8 data) +void pia6821_device::ddr_b_w(uint8_t data) { if (data == 0x00) { @@ -784,7 +784,7 @@ void pia6821_device::ddr_b_w(UINT8 data) // control_a_w //------------------------------------------------- -void pia6821_device::control_a_w(UINT8 data) +void pia6821_device::control_a_w(uint8_t data) { // bit 7 and 6 are read only data &= 0x3f; @@ -822,7 +822,7 @@ void pia6821_device::control_a_w(UINT8 data) // control_b_w //------------------------------------------------- -void pia6821_device::control_b_w(UINT8 data) +void pia6821_device::control_b_w(uint8_t data) { int temp; @@ -856,7 +856,7 @@ void pia6821_device::control_b_w(UINT8 data) // write //------------------------------------------------- -void pia6821_device::reg_w(UINT8 offset, UINT8 data) +void pia6821_device::reg_w(uint8_t offset, uint8_t data) { switch (offset & 0x03) { @@ -898,7 +898,7 @@ void pia6821_device::reg_w(UINT8 offset, UINT8 data) // set_a_input //------------------------------------------------- -void pia6821_device::set_a_input(UINT8 data, UINT8 z_mask) +void pia6821_device::set_a_input(uint8_t data, uint8_t z_mask) { assert_always(m_in_a_handler.isnull(), "pia6821_porta_w() called when in_a_func implemented"); @@ -914,7 +914,7 @@ void pia6821_device::set_a_input(UINT8 data, UINT8 z_mask) // pia6821_porta_w //------------------------------------------------- -void pia6821_device::porta_w(UINT8 data) +void pia6821_device::porta_w(uint8_t data) { set_a_input(data, 0); } @@ -924,7 +924,7 @@ void pia6821_device::porta_w(UINT8 data) // a_output //------------------------------------------------- -UINT8 pia6821_device::a_output() +uint8_t pia6821_device::a_output() { m_out_a_needs_pulled = false; @@ -1021,7 +1021,7 @@ int pia6821_device::ca2_output_z() // portb_w //------------------------------------------------- -void pia6821_device::portb_w(UINT8 data) +void pia6821_device::portb_w(uint8_t data) { assert_always(m_in_b_handler.isnull(), "pia_set_input_b() called when in_b_func implemented"); @@ -1036,7 +1036,7 @@ void pia6821_device::portb_w(UINT8 data) // b_output //------------------------------------------------- -UINT8 pia6821_device::b_output() +uint8_t pia6821_device::b_output() { m_out_b_needs_pulled = false; diff --git a/src/devices/machine/6821pia.h b/src/devices/machine/6821pia.h index 64631184d29..6eafbe75645 100644 --- a/src/devices/machine/6821pia.h +++ b/src/devices/machine/6821pia.h @@ -78,7 +78,7 @@ class pia6821_device : public device_t { public: // construction/destruction - pia6821_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pia6821_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers // TODO: REMOVE THESE @@ -102,13 +102,13 @@ public: DECLARE_READ8_MEMBER( read_alt ) { return reg_r(((offset << 1) & 0x02) | ((offset >> 1) & 0x01)); } DECLARE_WRITE8_MEMBER( write_alt ) { reg_w(((offset << 1) & 0x02) | ((offset >> 1) & 0x01), data); } - UINT8 port_b_z_mask() const { return ~m_ddr_b; } // see first note in .c - void set_port_a_z_mask(UINT8 data) { m_port_a_z_mask = data; }// see second note in .c + uint8_t port_b_z_mask() const { return ~m_ddr_b; } // see first note in .c + void set_port_a_z_mask(uint8_t data) { m_port_a_z_mask = data; }// see second note in .c DECLARE_WRITE8_MEMBER( porta_w ) { porta_w(data); } - void porta_w(UINT8 data); - void set_a_input(UINT8 data, UINT8 z_mask); - UINT8 a_output(); + void porta_w(uint8_t data); + void set_a_input(uint8_t data, uint8_t z_mask); + uint8_t a_output(); DECLARE_WRITE_LINE_MEMBER( ca1_w ); @@ -117,8 +117,8 @@ public: int ca2_output_z(); DECLARE_WRITE8_MEMBER( portb_w ) { portb_w(data); } - void portb_w(UINT8 data); - UINT8 b_output(); + void portb_w(uint8_t data); + uint8_t b_output(); DECLARE_WRITE_LINE_MEMBER( cb1_w ); @@ -135,39 +135,39 @@ protected: virtual void device_reset() override; private: - UINT8 reg_r(UINT8 offset); - void reg_w(UINT8 offset, UINT8 data); + uint8_t reg_r(uint8_t offset); + void reg_w(uint8_t offset, uint8_t data); void update_interrupts(); - UINT8 get_in_a_value(); - UINT8 get_in_b_value(); + uint8_t get_in_a_value(); + uint8_t get_in_b_value(); - UINT8 get_out_a_value(); - UINT8 get_out_b_value(); + uint8_t get_out_a_value(); + uint8_t get_out_b_value(); void set_out_ca2(int data); void set_out_cb2(int data); - UINT8 port_a_r(); - UINT8 ddr_a_r(); - UINT8 control_a_r(); + uint8_t port_a_r(); + uint8_t ddr_a_r(); + uint8_t control_a_r(); - UINT8 port_b_r(); - UINT8 ddr_b_r(); - UINT8 control_b_r(); + uint8_t port_b_r(); + uint8_t ddr_b_r(); + uint8_t control_b_r(); void send_to_out_a_func(const char* message); void send_to_out_b_func(const char* message); - void port_a_w(UINT8 data); - void ddr_a_w(UINT8 data); + void port_a_w(uint8_t data); + void ddr_a_w(uint8_t data); - void port_b_w(UINT8 data); - void ddr_b_w(UINT8 data); + void port_b_w(uint8_t data); + void ddr_b_w(uint8_t data); - void control_a_w(UINT8 data); - void control_b_w(UINT8 data); + void control_a_w(uint8_t data); + void control_b_w(uint8_t data); devcb_read8 m_in_a_handler; devcb_read8 m_in_b_handler; @@ -181,29 +181,29 @@ private: devcb_write_line m_irqa_handler; devcb_write_line m_irqb_handler; - UINT8 m_in_a; - UINT8 m_in_ca1; - UINT8 m_in_ca2; - UINT8 m_out_a; - UINT8 m_out_ca2; - UINT8 m_port_a_z_mask; - UINT8 m_ddr_a; - UINT8 m_ctl_a; - UINT8 m_irq_a1; - UINT8 m_irq_a2; - UINT8 m_irq_a_state; - - UINT8 m_in_b; - UINT8 m_in_cb1; - UINT8 m_in_cb2; - UINT8 m_out_b; - UINT8 m_out_cb2; - UINT8 m_last_out_cb2_z; - UINT8 m_ddr_b; - UINT8 m_ctl_b; - UINT8 m_irq_b1; - UINT8 m_irq_b2; - UINT8 m_irq_b_state; + uint8_t m_in_a; + uint8_t m_in_ca1; + uint8_t m_in_ca2; + uint8_t m_out_a; + uint8_t m_out_ca2; + uint8_t m_port_a_z_mask; + uint8_t m_ddr_a; + uint8_t m_ctl_a; + uint8_t m_irq_a1; + uint8_t m_irq_a2; + uint8_t m_irq_a_state; + + uint8_t m_in_b; + uint8_t m_in_cb1; + uint8_t m_in_cb2; + uint8_t m_out_b; + uint8_t m_out_cb2; + uint8_t m_last_out_cb2_z; + uint8_t m_ddr_b; + uint8_t m_ctl_b; + uint8_t m_irq_b1; + uint8_t m_irq_b2; + uint8_t m_irq_b_state; // variables that indicate if access a line externally - // used to for logging purposes ONLY diff --git a/src/devices/machine/68230pit.cpp b/src/devices/machine/68230pit.cpp index 725d6fa42cd..14add04b023 100644 --- a/src/devices/machine/68230pit.cpp +++ b/src/devices/machine/68230pit.cpp @@ -53,7 +53,7 @@ const device_type PIT68230 = &device_creator; //------------------------------------------------- // pit68230_device - constructors //------------------------------------------------- -pit68230_device::pit68230_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +pit68230_device::pit68230_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t (mconfig, type, name, tag, owner, clock, shortname, source) , m_pa_out_cb(*this) , m_pa_in_cb(*this) @@ -89,7 +89,7 @@ pit68230_device::pit68230_device(const machine_config &mconfig, device_type type } -pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pit68230_device::pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t (mconfig, PIT68230, "PIT68230", tag, owner, clock, "pit68230", __FILE__) , m_pa_out_cb (*this) , m_pa_in_cb(*this) @@ -192,7 +192,7 @@ void pit68230_device::device_reset () //------------------------------------------------- // device_timer - handler timer events //------------------------------------------------- -void pit68230_device::device_timer (emu_timer &timer, device_timer_id id, INT32 param, void *ptr) +void pit68230_device::device_timer (emu_timer &timer, device_timer_id id, int32_t param, void *ptr) { switch(id) { @@ -212,14 +212,14 @@ void pit68230_device::device_timer (emu_timer &timer, device_timer_id id, INT32 } } -void pit68230_device::h1_set (UINT8 state) +void pit68230_device::h1_set (uint8_t state) { LOG(("%s %s %d @ m_psr %2x => ",tag(), FUNCNAME, state, m_psr)); if (state) m_psr |= 1; else m_psr &= ~1; LOG(("%02x %lld\n", m_psr, machine ().firstcpu->total_cycles ())); } -void pit68230_device::portb_setbit (UINT8 bit, UINT8 state) +void pit68230_device::portb_setbit (uint8_t bit, uint8_t state) { LOG(("%s %s %d/%d @ m_pbdr %2x => ", tag(), FUNCNAME, bit, state, m_pbdr)); if (state) m_pbdr |= (1 << bit); else m_pbdr &= ~(1 << bit); @@ -227,47 +227,47 @@ void pit68230_device::portb_setbit (UINT8 bit, UINT8 state) } #if VERBOSE > 2 -static INT32 ow_cnt = 0; -static INT32 ow_data = 0; -static INT32 ow_ofs = 0; +static int32_t ow_cnt = 0; +static int32_t ow_data = 0; +static int32_t ow_ofs = 0; #endif -void pit68230_device::wr_pitreg_pgcr(UINT8 data) +void pit68230_device::wr_pitreg_pgcr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_pgcr = data; } -void pit68230_device::wr_pitreg_psrr(UINT8 data) +void pit68230_device::wr_pitreg_psrr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_psrr = data; } -void pit68230_device::wr_pitreg_paddr(UINT8 data) +void pit68230_device::wr_pitreg_paddr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_paddr = data; } -void pit68230_device::wr_pitreg_pbddr(UINT8 data) +void pit68230_device::wr_pitreg_pbddr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_pbddr = data; } -void pit68230_device::wr_pitreg_pcddr(UINT8 data) +void pit68230_device::wr_pitreg_pcddr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_pcddr = data; } -void pit68230_device::wr_pitreg_pivr(UINT8 data) +void pit68230_device::wr_pitreg_pivr(uint8_t data) { LOG(("%s(%02x) \"%s\": Not implemented yet\n", FUNCNAME, data, tag())); } -void pit68230_device::wr_pitreg_pacr(UINT8 data) +void pit68230_device::wr_pitreg_pacr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_pacr = data; @@ -290,13 +290,13 @@ void pit68230_device::wr_pitreg_pacr(UINT8 data) m_h2_out_cb (m_pacr & 0x08 ? 1 : 0); // TODO: Check mode and submodes } -void pit68230_device::wr_pitreg_pbcr(UINT8 data) +void pit68230_device::wr_pitreg_pbcr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_pbcr = data; } -void pit68230_device::wr_pitreg_padr(UINT8 data) +void pit68230_device::wr_pitreg_padr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_padr |= (data & m_paddr); @@ -304,7 +304,7 @@ void pit68230_device::wr_pitreg_padr(UINT8 data) m_pa_out_cb ((offs_t)0, m_padr); } -void pit68230_device::wr_pitreg_pbdr(UINT8 data) +void pit68230_device::wr_pitreg_pbdr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_pbdr |= (data & m_pbddr); @@ -312,7 +312,7 @@ void pit68230_device::wr_pitreg_pbdr(UINT8 data) m_pb_out_cb ((offs_t)0, m_pbdr & m_pbddr); } -void pit68230_device::wr_pitreg_pcdr(UINT8 data) +void pit68230_device::wr_pitreg_pcdr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_pcdr |= (data & m_pcddr); @@ -320,7 +320,7 @@ void pit68230_device::wr_pitreg_pcdr(UINT8 data) m_pc_out_cb ((offs_t)0, m_pcdr); } -void pit68230_device::wr_pitreg_psr(UINT8 data) +void pit68230_device::wr_pitreg_psr(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_psr = data; @@ -388,7 +388,7 @@ TCR bit 0 - Timer Enable 0 Disabled 1 Enabled */ -void pit68230_device::wr_pitreg_tcr(UINT8 data) +void pit68230_device::wr_pitreg_tcr(uint8_t data) { int tout = 0; int tiack = 0; @@ -441,34 +441,34 @@ void pit68230_device::wr_pitreg_tcr(UINT8 data) } } -void pit68230_device::wr_pitreg_tivr(UINT8 data) +void pit68230_device::wr_pitreg_tivr(uint8_t data) { LOG(("%s(%02x) \"%s\": \n", FUNCNAME, data, tag())); m_tivr = data; } -void pit68230_device::wr_pitreg_cprh(UINT8 data) +void pit68230_device::wr_pitreg_cprh(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_cpr &= ~0xff0000; m_cpr |= ((data << 16) & 0xff0000); } -void pit68230_device::wr_pitreg_cprm(UINT8 data) +void pit68230_device::wr_pitreg_cprm(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_cpr &= ~0x00ff00; m_cpr |= ((data << 8) & 0x00ff00); } -void pit68230_device::wr_pitreg_cprl(UINT8 data) +void pit68230_device::wr_pitreg_cprl(uint8_t data) { LOG(("%s(%02x) \"%s\": %s - %02x\n", FUNCNAME, data, tag(), FUNCNAME, data)); m_cpr &= ~0x0000ff; m_cpr |= ((data << 0) & 0x0000ff); } -void pit68230_device::wr_pitreg_tsr(UINT8 data) +void pit68230_device::wr_pitreg_tsr(uint8_t data) { LOG(("%s(%02x) \"%s\": \n", FUNCNAME, data, tag())); m_tsr = data; @@ -521,60 +521,60 @@ WRITE8_MEMBER (pit68230_device::write) } #if VERBOSE > 2 -static INT32 or_cnt = 0; -static INT32 or_data = 0; -static INT32 or_ofs = 0; +static int32_t or_cnt = 0; +static int32_t or_data = 0; +static int32_t or_ofs = 0; #endif -UINT8 pit68230_device::rr_pitreg_pgcr() +uint8_t pit68230_device::rr_pitreg_pgcr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pgcr)); return m_pgcr; } -UINT8 pit68230_device::rr_pitreg_psrr() +uint8_t pit68230_device::rr_pitreg_psrr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_psrr)); return m_psrr; } -UINT8 pit68230_device::rr_pitreg_paddr() +uint8_t pit68230_device::rr_pitreg_paddr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_paddr)); return m_paddr; } -UINT8 pit68230_device::rr_pitreg_pbddr() +uint8_t pit68230_device::rr_pitreg_pbddr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pbddr)); return m_pbddr; } -UINT8 pit68230_device::rr_pitreg_pcddr() +uint8_t pit68230_device::rr_pitreg_pcddr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pcddr)); return m_pcddr; } -UINT8 pit68230_device::rr_pitreg_pivr() +uint8_t pit68230_device::rr_pitreg_pivr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pivr)); return m_pivr; } -UINT8 pit68230_device::rr_pitreg_pacr() +uint8_t pit68230_device::rr_pitreg_pacr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pacr)); return m_pacr; } -UINT8 pit68230_device::rr_pitreg_pbcr() +uint8_t pit68230_device::rr_pitreg_pbcr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_pbcr)); return m_pbcr; } -UINT8 pit68230_device::rr_pitreg_padr() +uint8_t pit68230_device::rr_pitreg_padr() { m_padr &= m_paddr; m_padr |= (m_pa_in_cb() & ~m_paddr); @@ -589,7 +589,7 @@ UINT8 pit68230_device::rr_pitreg_padr() * mode/submode, reading or writing may affect the double-buffered handshake * mechanism. The port B data register is not affected by the assertion of the * RESET pin. PB0-PB7 sits on pins 17-24 on a 48 pin DIP package */ -UINT8 pit68230_device::rr_pitreg_pbdr() +uint8_t pit68230_device::rr_pitreg_pbdr() { m_pbdr &= m_pbddr; m_pbdr |= (m_pb_in_cb() & ~m_pbddr); @@ -597,7 +597,7 @@ UINT8 pit68230_device::rr_pitreg_pbdr() return m_pbdr; } -UINT8 pit68230_device::rr_pitreg_pcdr() +uint8_t pit68230_device::rr_pitreg_pcdr() { m_pcdr &= m_pcddr; m_pcdr |= (m_pc_in_cb() & ~m_pcddr); @@ -609,10 +609,10 @@ UINT8 pit68230_device::rr_pitreg_pcdr() It is a read-only address and no other PI/T condition is affected. In all modes, the instantaneous pin level is read and no input latching is performed except at the data bus interface. Writes to this address are answered with DTACK, but the data is ignored.*/ -UINT8 pit68230_device::rr_pitreg_paar() +uint8_t pit68230_device::rr_pitreg_paar() { // NOTE: no side effect emulated so using ..padr - UINT8 ret; + uint8_t ret; ret = m_pa_in_cb(); LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, ret)); return ret; @@ -622,10 +622,10 @@ UINT8 pit68230_device::rr_pitreg_paar() It is a read-only address and no other PI/T condition is affected. In all modes, the instantaneous pin level is read and no input latching is performed except at the data bus interface.Writes to this address are answered with DTACK, but the data is ignored.*/ -UINT8 pit68230_device::rr_pitreg_pbar() +uint8_t pit68230_device::rr_pitreg_pbar() { // NOTE: no side effect emulated so using ..pbdr - UINT8 ret; + uint8_t ret; ret = m_pb_in_cb(); LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, ret)); return ret; @@ -637,68 +637,68 @@ UINT8 pit68230_device::rr_pitreg_pbar() * register. Bits 3-0 are the respective status bits referred to throughout this document. * Their interpretation depends on the programmed mode/submode of the PI/T. For bits * 3-0 a one is the active or asserted state. */ -UINT8 pit68230_device::rr_pitreg_psr() +uint8_t pit68230_device::rr_pitreg_psr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_psr)); return m_psr; } -UINT8 pit68230_device::rr_pitreg_tcr() +uint8_t pit68230_device::rr_pitreg_tcr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_tcr)); return m_tcr; } -UINT8 pit68230_device::rr_pitreg_tivr() +uint8_t pit68230_device::rr_pitreg_tivr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_tivr)); return m_tivr; } -UINT8 pit68230_device::rr_pitreg_cprh() +uint8_t pit68230_device::rr_pitreg_cprh() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 16) & 0xff)); return (m_cpr >> 16) & 0xff; } -UINT8 pit68230_device::rr_pitreg_cprm() +uint8_t pit68230_device::rr_pitreg_cprm() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 8) & 0xff)); return (m_cpr >> 8) & 0xff; } -UINT8 pit68230_device::rr_pitreg_cprl() +uint8_t pit68230_device::rr_pitreg_cprl() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cpr >> 0) & 0xff)); return (m_cpr >> 0) & 0xff; } -UINT8 pit68230_device::rr_pitreg_cntrh() +uint8_t pit68230_device::rr_pitreg_cntrh() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 16) & 0xff)); return (m_cntr >> 16) & 0xff; } -UINT8 pit68230_device::rr_pitreg_cntrm() +uint8_t pit68230_device::rr_pitreg_cntrm() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 8) & 0xff)); return (m_cntr >> 8) & 0xff; } -UINT8 pit68230_device::rr_pitreg_cntrl() +uint8_t pit68230_device::rr_pitreg_cntrl() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, (m_cntr >> 0) & 0xff)); return (m_cntr >> 0) & 0xff; } -UINT8 pit68230_device::rr_pitreg_tsr() +uint8_t pit68230_device::rr_pitreg_tsr() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_tsr)); return m_tsr; } READ8_MEMBER (pit68230_device::read){ - UINT8 data; + uint8_t data; switch (offset) { case PIT_68230_PGCR: data = rr_pitreg_pgcr(); break; diff --git a/src/devices/machine/68230pit.h b/src/devices/machine/68230pit.h index 06736741867..556ac56fa16 100644 --- a/src/devices/machine/68230pit.h +++ b/src/devices/machine/68230pit.h @@ -107,8 +107,8 @@ class pit68230_device : public device_t//, public device_execute_interface { public: // construction/destruction - pit68230_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pit68230_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + pit68230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_pa_in_callback (device_t &device, _Object object){ return downcast(device).m_pa_in_cb.set_callback (object); } template static devcb_base &set_pa_out_callback (device_t &device, _Object object){ return downcast(device).m_pa_out_cb.set_callback (object); } template static devcb_base &set_pb_in_callback (device_t &device, _Object object){ return downcast(device).m_pb_in_cb.set_callback (object); } @@ -123,53 +123,53 @@ class pit68230_device : public device_t//, public device_execute_interface DECLARE_WRITE8_MEMBER (write); DECLARE_READ8_MEMBER (read); - void h1_set (UINT8 state); - void portb_setbit (UINT8 bit, UINT8 state); - - void wr_pitreg_pgcr(UINT8 data); - void wr_pitreg_psrr(UINT8 data); - void wr_pitreg_paddr(UINT8 data); - void wr_pitreg_pbddr(UINT8 data); - void wr_pitreg_pcddr(UINT8 data); - void wr_pitreg_pivr(UINT8 data); - void wr_pitreg_pacr(UINT8 data); - void wr_pitreg_pbcr(UINT8 data); - void wr_pitreg_padr(UINT8 data); - void wr_pitreg_pbdr(UINT8 data); - void wr_pitreg_paar(UINT8 data); - void wr_pitreg_pbar(UINT8 data); - void wr_pitreg_pcdr(UINT8 data); - void wr_pitreg_psr(UINT8 data); - void wr_pitreg_tcr(UINT8 data); - void wr_pitreg_tivr(UINT8 data); - void wr_pitreg_cprh(UINT8 data); - void wr_pitreg_cprm(UINT8 data); - void wr_pitreg_cprl(UINT8 data); - void wr_pitreg_tsr(UINT8 data); - - UINT8 rr_pitreg_pgcr(); - UINT8 rr_pitreg_psrr(); - UINT8 rr_pitreg_paddr(); - UINT8 rr_pitreg_pbddr(); - UINT8 rr_pitreg_pcddr(); - UINT8 rr_pitreg_pivr(); - UINT8 rr_pitreg_pacr(); - UINT8 rr_pitreg_pbcr(); - UINT8 rr_pitreg_padr(); - UINT8 rr_pitreg_pbdr(); - UINT8 rr_pitreg_paar(); - UINT8 rr_pitreg_pbar(); - UINT8 rr_pitreg_pcdr(); - UINT8 rr_pitreg_psr(); - UINT8 rr_pitreg_tcr(); - UINT8 rr_pitreg_tivr(); - UINT8 rr_pitreg_cprh(); - UINT8 rr_pitreg_cprm(); - UINT8 rr_pitreg_cprl(); - UINT8 rr_pitreg_cntrh(); - UINT8 rr_pitreg_cntrm(); - UINT8 rr_pitreg_cntrl(); - UINT8 rr_pitreg_tsr(); + void h1_set (uint8_t state); + void portb_setbit (uint8_t bit, uint8_t state); + + void wr_pitreg_pgcr(uint8_t data); + void wr_pitreg_psrr(uint8_t data); + void wr_pitreg_paddr(uint8_t data); + void wr_pitreg_pbddr(uint8_t data); + void wr_pitreg_pcddr(uint8_t data); + void wr_pitreg_pivr(uint8_t data); + void wr_pitreg_pacr(uint8_t data); + void wr_pitreg_pbcr(uint8_t data); + void wr_pitreg_padr(uint8_t data); + void wr_pitreg_pbdr(uint8_t data); + void wr_pitreg_paar(uint8_t data); + void wr_pitreg_pbar(uint8_t data); + void wr_pitreg_pcdr(uint8_t data); + void wr_pitreg_psr(uint8_t data); + void wr_pitreg_tcr(uint8_t data); + void wr_pitreg_tivr(uint8_t data); + void wr_pitreg_cprh(uint8_t data); + void wr_pitreg_cprm(uint8_t data); + void wr_pitreg_cprl(uint8_t data); + void wr_pitreg_tsr(uint8_t data); + + uint8_t rr_pitreg_pgcr(); + uint8_t rr_pitreg_psrr(); + uint8_t rr_pitreg_paddr(); + uint8_t rr_pitreg_pbddr(); + uint8_t rr_pitreg_pcddr(); + uint8_t rr_pitreg_pivr(); + uint8_t rr_pitreg_pacr(); + uint8_t rr_pitreg_pbcr(); + uint8_t rr_pitreg_padr(); + uint8_t rr_pitreg_pbdr(); + uint8_t rr_pitreg_paar(); + uint8_t rr_pitreg_pbar(); + uint8_t rr_pitreg_pcdr(); + uint8_t rr_pitreg_psr(); + uint8_t rr_pitreg_tcr(); + uint8_t rr_pitreg_tivr(); + uint8_t rr_pitreg_cprh(); + uint8_t rr_pitreg_cprm(); + uint8_t rr_pitreg_cprl(); + uint8_t rr_pitreg_cntrh(); + uint8_t rr_pitreg_cntrm(); + uint8_t rr_pitreg_cntrl(); + uint8_t rr_pitreg_tsr(); protected: @@ -212,23 +212,23 @@ protected: devcb_write_line m_h4_out_cb; // peripheral ports - UINT8 m_pgcr; // Port General Control register - UINT8 m_psrr; // Port Service Request register - UINT8 m_paddr; // Port A Data Direction register - UINT8 m_pbddr; // Port B Data Direction register - UINT8 m_pcddr; // Port C Data Direction register - UINT8 m_pivr; // Ports Interrupt vector - UINT8 m_pacr; // Port A Control register - UINT8 m_pbcr; // Port B Control register - UINT8 m_padr; // Port A Data register - UINT8 m_pbdr; // Port B Data register - UINT8 m_pcdr; // Port C Data register - UINT8 m_psr; // Port Status Register - UINT8 m_tcr; // Timer Control Register - UINT8 m_tivr; // Timer Interrupt Vector register + uint8_t m_pgcr; // Port General Control register + uint8_t m_psrr; // Port Service Request register + uint8_t m_paddr; // Port A Data Direction register + uint8_t m_pbddr; // Port B Data Direction register + uint8_t m_pcddr; // Port C Data Direction register + uint8_t m_pivr; // Ports Interrupt vector + uint8_t m_pacr; // Port A Control register + uint8_t m_pbcr; // Port B Control register + uint8_t m_padr; // Port A Data register + uint8_t m_pbdr; // Port B Data register + uint8_t m_pcdr; // Port C Data register + uint8_t m_psr; // Port Status Register + uint8_t m_tcr; // Timer Control Register + uint8_t m_tivr; // Timer Interrupt Vector register int m_cpr; // Counter Preload Registers (3 x 8 = 24 bits) int m_cntr; // - The 24 bit Counter - UINT8 m_tsr; // Timer Status Register + uint8_t m_tsr; // Timer Status Register // Timers emu_timer *pit_timer; diff --git a/src/devices/machine/68307.cpp b/src/devices/machine/68307.cpp index cbdd2c1eed8..70a272a5436 100644 --- a/src/devices/machine/68307.cpp +++ b/src/devices/machine/68307.cpp @@ -52,7 +52,7 @@ machine_config_constructor m68307cpu_device::device_mconfig_additions() const } -m68307cpu_device::m68307cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68307cpu_device::m68307cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m68000_device(mconfig, "MC68307", tag, owner, clock, M68307, 16,24, ADDRESS_MAP_NAME(m68307_internal_map), "mc68307", __FILE__), write_irq(*this), write_a_tx(*this), @@ -111,43 +111,43 @@ int m68307_calc_cs(m68307cpu_device *m68k, offs_t address) -UINT16 m68307cpu_device::simple_read_immediate_16_m68307(offs_t address) +uint16_t m68307cpu_device::simple_read_immediate_16_m68307(offs_t address) { // m68307_currentcs = m68307_calc_cs(this, address); return m_direct->read_word(address); } -UINT8 m68307cpu_device::read_byte_m68307(offs_t address) +uint8_t m68307cpu_device::read_byte_m68307(offs_t address) { // m68307_currentcs = m68307_calc_cs(this, address); return m_space->read_byte(address); } -UINT16 m68307cpu_device::read_word_m68307(offs_t address) +uint16_t m68307cpu_device::read_word_m68307(offs_t address) { // m68307_currentcs = m68307_calc_cs(this, address); return m_space->read_word(address); } -UINT32 m68307cpu_device::read_dword_m68307(offs_t address) +uint32_t m68307cpu_device::read_dword_m68307(offs_t address) { // m68307_currentcs = m68307_calc_cs(this, address); return m_space->read_dword(address); } -void m68307cpu_device::write_byte_m68307(offs_t address, UINT8 data) +void m68307cpu_device::write_byte_m68307(offs_t address, uint8_t data) { // m68307_currentcs = m68307_calc_cs(this, address); m_space->write_byte(address, data); } -void m68307cpu_device::write_word_m68307(offs_t address, UINT16 data) +void m68307cpu_device::write_word_m68307(offs_t address, uint16_t data) { // m68307_currentcs = m68307_calc_cs(this, address); m_space->write_word(address, data); } -void m68307cpu_device::write_dword_m68307(offs_t address, UINT32 data) +void m68307cpu_device::write_dword_m68307(offs_t address, uint32_t data) { // m68307_currentcs = m68307_calc_cs(this, address); m_space->write_dword(address, data); @@ -185,7 +185,7 @@ void m68307cpu_device::set_port_callbacks(m68307_porta_read_delegate porta_r, m6 -UINT16 m68307cpu_device::get_cs(offs_t address) +uint16_t m68307cpu_device::get_cs(offs_t address) { m68307_currentcs = m68307_calc_cs(this, address); diff --git a/src/devices/machine/68307.h b/src/devices/machine/68307.h index 60ae61db49a..dba86a8f996 100644 --- a/src/devices/machine/68307.h +++ b/src/devices/machine/68307.h @@ -16,10 +16,10 @@ #include "machine/mc68681.h" -typedef device_delegate m68307_porta_read_delegate; -typedef device_delegate m68307_porta_write_delegate; -typedef device_delegate m68307_portb_read_delegate; -typedef device_delegate m68307_portb_write_delegate; +typedef device_delegate m68307_porta_read_delegate; +typedef device_delegate m68307_porta_write_delegate; +typedef device_delegate m68307_portb_read_delegate; +typedef device_delegate m68307_portb_write_delegate; /* trampolines so we can specify the 68681 serial configuration when adding the CPU */ @@ -39,7 +39,7 @@ typedef device_delegate static devcb_base &set_irq_cb(device_t &device, _Object object) { return downcast(device).write_irq.set_callback(object); } @@ -57,15 +57,15 @@ public: devcb_read8 read_inport; devcb_write8 write_outport; - UINT16 simple_read_immediate_16_m68307(offs_t address); + uint16_t simple_read_immediate_16_m68307(offs_t address); - UINT8 read_byte_m68307(offs_t address); - UINT16 read_word_m68307(offs_t address); - UINT32 read_dword_m68307(offs_t address); - void write_byte_m68307(offs_t address, UINT8 data); - void write_word_m68307(offs_t address, UINT16 data); - void write_dword_m68307(offs_t address, UINT32 data); + uint8_t read_byte_m68307(offs_t address); + uint16_t read_word_m68307(offs_t address); + uint32_t read_dword_m68307(offs_t address); + void write_byte_m68307(offs_t address, uint8_t data); + void write_word_m68307(offs_t address, uint16_t data); + void write_dword_m68307(offs_t address, uint32_t data); /* 68307 peripheral modules */ @@ -74,9 +74,9 @@ public: // m68307_serial* m68307SERIAL; m68307_timer* m68307TIMER; - UINT16 m68307_base; - UINT16 m68307_scrhigh; - UINT16 m68307_scrlow; + uint16_t m68307_base; + uint16_t m68307_scrhigh; + uint16_t m68307_scrlow; int m68307_currentcs; @@ -96,7 +96,7 @@ public: /* callbacks for internal ports */ void set_port_callbacks(m68307_porta_read_delegate porta_r, m68307_porta_write_delegate porta_w, m68307_portb_read_delegate portb_r, m68307_portb_write_delegate portb_w); void set_interrupt(int level, int vector); - UINT16 get_cs(offs_t address); + uint16_t get_cs(offs_t address); void timer0_interrupt(); void timer1_interrupt(); void serial_interrupt(int vector); @@ -110,11 +110,11 @@ public: void init16_m68307(address_space &space); - virtual UINT32 disasm_min_opcode_bytes() const override { return 2; }; - virtual UINT32 disasm_max_opcode_bytes() const override { return 10; }; + virtual uint32_t disasm_min_opcode_bytes() const override { return 2; }; + virtual uint32_t disasm_max_opcode_bytes() const override { return 10; }; - virtual UINT32 execute_min_cycles() const override { return 4; }; - virtual UINT32 execute_max_cycles() const override { return 158; }; + virtual uint32_t execute_min_cycles() const override { return 4; }; + virtual uint32_t execute_max_cycles() const override { return 158; }; required_device m_duart; protected: diff --git a/src/devices/machine/68307bus.cpp b/src/devices/machine/68307bus.cpp index 4d6b2928d40..91c193f2d4e 100644 --- a/src/devices/machine/68307bus.cpp +++ b/src/devices/machine/68307bus.cpp @@ -12,7 +12,7 @@ READ8_MEMBER( m68307cpu_device::m68307_internal_mbus_r ) m68307cpu_device *m68k = this; m68307_mbus* mbus = m68k->m68307MBUS; assert(mbus != nullptr); - UINT8 retval; + uint8_t retval; if (mbus) { diff --git a/src/devices/machine/68307bus.h b/src/devices/machine/68307bus.h index 5131ad4c9c5..eb6db9811ae 100644 --- a/src/devices/machine/68307bus.h +++ b/src/devices/machine/68307bus.h @@ -13,7 +13,7 @@ class m68307_mbus { public: - UINT16 m_MFCR; + uint16_t m_MFCR; bool m_busy; bool m_intpend; diff --git a/src/devices/machine/68307sim.cpp b/src/devices/machine/68307sim.cpp index 7d293d6f8d7..47479cae1da 100644 --- a/src/devices/machine/68307sim.cpp +++ b/src/devices/machine/68307sim.cpp @@ -140,18 +140,18 @@ WRITE16_MEMBER( m68307cpu_device::m68307_internal_sim_w ) } -void m68307_sim::write_pacnt(UINT16 data, UINT16 mem_mask) +void m68307_sim::write_pacnt(uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_pacnt); } -void m68307_sim::write_paddr(UINT16 data, UINT16 mem_mask) +void m68307_sim::write_paddr(uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_paddr); } -UINT16 m68307_sim::read_padat(m68307cpu_device* m68k, address_space &space, UINT16 mem_mask) +uint16_t m68307_sim::read_padat(m68307cpu_device* m68k, address_space &space, uint16_t mem_mask) { int pc = space.device().safe_pc(); @@ -159,12 +159,12 @@ UINT16 m68307_sim::read_padat(m68307cpu_device* m68k, address_space &space, UINT { // for general purpose bits, if configured as 'output' then anything output gets latched // and anything configured as input is read from the port - UINT8 outputbits = m_paddr; - UINT8 inputbits = ~m_paddr; - UINT8 general_purpose_bits = ~m_pacnt; - UINT8 indat = m68k->m_m68307_porta_r(space, false, (inputbits & general_purpose_bits)&mem_mask) & ((inputbits & general_purpose_bits) & mem_mask); // read general purpose input lines + uint8_t outputbits = m_paddr; + uint8_t inputbits = ~m_paddr; + uint8_t general_purpose_bits = ~m_pacnt; + uint8_t indat = m68k->m_m68307_porta_r(space, false, (inputbits & general_purpose_bits)&mem_mask) & ((inputbits & general_purpose_bits) & mem_mask); // read general purpose input lines indat |= m68k->m_m68307_porta_r(space, true, (inputbits & ~general_purpose_bits)&mem_mask) & ((inputbits & ~general_purpose_bits)& mem_mask); // read dedicated input lines - UINT8 outdat = (m_padat & outputbits) & general_purpose_bits; // read general purpose output lines (reads latched data) + uint8_t outdat = (m_padat & outputbits) & general_purpose_bits; // read general purpose output lines (reads latched data) return (indat | outdat); @@ -177,7 +177,7 @@ UINT16 m68307_sim::read_padat(m68307cpu_device* m68k, address_space &space, UINT } -void m68307_sim::write_padat(m68307cpu_device* m68k, address_space &space, UINT16 data, UINT16 mem_mask) +void m68307_sim::write_padat(m68307cpu_device* m68k, address_space &space, uint16_t data, uint16_t mem_mask) { int pc = space.device().safe_pc(); COMBINE_DATA(&m_padat); @@ -192,17 +192,17 @@ void m68307_sim::write_padat(m68307cpu_device* m68k, address_space &space, UINT1 } } -void m68307_sim::write_pbcnt(UINT16 data, UINT16 mem_mask) +void m68307_sim::write_pbcnt(uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_pbcnt); } -void m68307_sim::write_pbddr(UINT16 data, UINT16 mem_mask) +void m68307_sim::write_pbddr(uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_pbddr); } -UINT16 m68307_sim::read_pbdat(m68307cpu_device* m68k, address_space &space, UINT16 mem_mask) +uint16_t m68307_sim::read_pbdat(m68307cpu_device* m68k, address_space &space, uint16_t mem_mask) { int pc = space.device().safe_pc(); @@ -210,13 +210,13 @@ UINT16 m68307_sim::read_pbdat(m68307cpu_device* m68k, address_space &space, UINT { // for general purpose bits, if configured as 'output' then anything output gets latched // and anything configured as input is read from the port - UINT16 outputbits = m_pbddr; - UINT16 inputbits = ~m_pbddr; - UINT16 general_purpose_bits = ~m_pbcnt; + uint16_t outputbits = m_pbddr; + uint16_t inputbits = ~m_pbddr; + uint16_t general_purpose_bits = ~m_pbcnt; - UINT16 indat = m68k->m_m68307_portb_r(space, false, (inputbits & general_purpose_bits)&mem_mask) & ((inputbits & general_purpose_bits) & mem_mask); // read general purpose input lines + uint16_t indat = m68k->m_m68307_portb_r(space, false, (inputbits & general_purpose_bits)&mem_mask) & ((inputbits & general_purpose_bits) & mem_mask); // read general purpose input lines indat |= m68k->m_m68307_portb_r(space, true, (inputbits & ~general_purpose_bits)&mem_mask) & ((inputbits & ~general_purpose_bits)& mem_mask); // read dedicated input lines - UINT16 outdat = (m_pbdat & outputbits) & general_purpose_bits; // read general purpose output lines (reads latched data) + uint16_t outdat = (m_pbdat & outputbits) & general_purpose_bits; // read general purpose output lines (reads latched data) return (indat | outdat); } @@ -228,7 +228,7 @@ UINT16 m68307_sim::read_pbdat(m68307cpu_device* m68k, address_space &space, UINT } -void m68307_sim::write_pbdat(m68307cpu_device* m68k, address_space &space, UINT16 data, UINT16 mem_mask) +void m68307_sim::write_pbdat(m68307cpu_device* m68k, address_space &space, uint16_t data, uint16_t mem_mask) { int pc = space.device().safe_pc(); COMBINE_DATA(&m_pbdat); @@ -243,7 +243,7 @@ void m68307_sim::write_pbdat(m68307cpu_device* m68k, address_space &space, UINT1 } } -void m68307_sim::write_licr1(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mask) +void m68307_sim::write_licr1(m68307cpu_device* m68k, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_licr1); data = m_licr1; @@ -259,10 +259,10 @@ void m68307_sim::write_licr1(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mas m68k->logerror("\n"); } -void m68307_sim::write_licr2(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mask) +void m68307_sim::write_licr2(m68307cpu_device* m68k, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_licr2); - UINT16 newdata = m_licr2; + uint16_t newdata = m_licr2; m68k->logerror("m_licr2 value %04x : Details :\n", newdata); m68k->logerror("int8ipl %01x\n", (newdata>>0)&7); m68k->logerror("pir8 %01x\n", (newdata>>3)&1); @@ -283,7 +283,7 @@ void m68307_sim::write_licr2(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mas } -void m68307_sim::write_picr(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mask) +void m68307_sim::write_picr(m68307cpu_device* m68k, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_picr); data = m_picr; @@ -295,7 +295,7 @@ void m68307_sim::write_picr(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mask m68k->logerror("\n"); } -void m68307_sim::write_pivr(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mask) +void m68307_sim::write_pivr(m68307cpu_device* m68k, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_pivr); data = m_pivr; diff --git a/src/devices/machine/68307sim.h b/src/devices/machine/68307sim.h index 2198e19d956..0d7c5ceea1a 100644 --- a/src/devices/machine/68307sim.h +++ b/src/devices/machine/68307sim.h @@ -36,39 +36,39 @@ class m68307_sim { public: - UINT16 m_pacnt; // 8-bit - UINT16 m_paddr; // 8-bit - UINT16 m_padat; // 8-bit + uint16_t m_pacnt; // 8-bit + uint16_t m_paddr; // 8-bit + uint16_t m_padat; // 8-bit - UINT16 m_pbcnt; - UINT16 m_pbddr; - UINT16 m_pbdat; + uint16_t m_pbcnt; + uint16_t m_pbddr; + uint16_t m_pbdat; - UINT16 m_pivr; // 8-bit + uint16_t m_pivr; // 8-bit - UINT16 m_br[4]; - UINT16 m_or[4]; - UINT16 m_picr; - UINT16 m_licr1; - UINT16 m_licr2; + uint16_t m_br[4]; + uint16_t m_or[4]; + uint16_t m_picr; + uint16_t m_licr1; + uint16_t m_licr2; - void write_pacnt(UINT16 data, UINT16 mem_mask); - void write_paddr(UINT16 data, UINT16 mem_mask); - UINT16 read_padat(m68307cpu_device* m68k, address_space &space, UINT16 mem_mask); - void write_padat(m68307cpu_device* m68k, address_space &space, UINT16 data, UINT16 mem_mask); + void write_pacnt(uint16_t data, uint16_t mem_mask); + void write_paddr(uint16_t data, uint16_t mem_mask); + uint16_t read_padat(m68307cpu_device* m68k, address_space &space, uint16_t mem_mask); + void write_padat(m68307cpu_device* m68k, address_space &space, uint16_t data, uint16_t mem_mask); - void write_pbcnt(UINT16 data, UINT16 mem_mask); - void write_pbddr(UINT16 data, UINT16 mem_mask); - UINT16 read_pbdat(m68307cpu_device* m68k, address_space &space, UINT16 mem_mask); - void write_pbdat(m68307cpu_device* m68k, address_space &space, UINT16 data, UINT16 mem_mask); + void write_pbcnt(uint16_t data, uint16_t mem_mask); + void write_pbddr(uint16_t data, uint16_t mem_mask); + uint16_t read_pbdat(m68307cpu_device* m68k, address_space &space, uint16_t mem_mask); + void write_pbdat(m68307cpu_device* m68k, address_space &space, uint16_t data, uint16_t mem_mask); - void write_licr1(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mask); - void write_licr2(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mask); - void write_picr(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mask); - void write_pivr(m68307cpu_device* m68k, UINT16 data, UINT16 mem_mask); + void write_licr1(m68307cpu_device* m68k, uint16_t data, uint16_t mem_mask); + void write_licr2(m68307cpu_device* m68k, uint16_t data, uint16_t mem_mask); + void write_picr(m68307cpu_device* m68k, uint16_t data, uint16_t mem_mask); + void write_pivr(m68307cpu_device* m68k, uint16_t data, uint16_t mem_mask); void reset(void); }; diff --git a/src/devices/machine/68307tmu.cpp b/src/devices/machine/68307tmu.cpp index e3c8e595f7c..5deb48a9f85 100644 --- a/src/devices/machine/68307tmu.cpp +++ b/src/devices/machine/68307tmu.cpp @@ -142,7 +142,7 @@ void m68307_timer::init(m68307cpu_device *device) wd_mametimer = device->machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m68307_timer::wd_timer_callback),this), parent); } -UINT16 m68307_timer::read_tcn(UINT16 mem_mask, int which) +uint16_t m68307_timer::read_tcn(uint16_t mem_mask, int which) { // we should return the current timer value by // calculating what it should be based on the time @@ -150,14 +150,14 @@ UINT16 m68307_timer::read_tcn(UINT16 mem_mask, int which) return 0x3a98; } -void m68307_timer::write_ter(UINT16 data, UINT16 mem_mask, int which) +void m68307_timer::write_ter(uint16_t data, uint16_t mem_mask, int which) { assert(which >= 0 && which < ARRAY_LENGTH(singletimer)); m68307_single_timer* tptr = &singletimer[which]; if (data & 0x2) tptr->regs[m68307TIMER_TMR] &= ~0x2; } -void m68307_timer::write_tmr(UINT16 data, UINT16 mem_mask, int which) +void m68307_timer::write_tmr(uint16_t data, uint16_t mem_mask, int which) { m68307cpu_device* m68k = parent; assert(which >= 0 && which < ARRAY_LENGTH(singletimer)); @@ -208,7 +208,7 @@ void m68307_timer::write_tmr(UINT16 data, UINT16 mem_mask, int which) } -void m68307_timer::write_trr(UINT16 data, UINT16 mem_mask, int which) +void m68307_timer::write_trr(uint16_t data, uint16_t mem_mask, int which) { assert(which >= 0 && which < ARRAY_LENGTH(singletimer)); m68307_single_timer* tptr = &singletimer[which]; diff --git a/src/devices/machine/68307tmu.h b/src/devices/machine/68307tmu.h index 660bdaeeb41..8ecdfa8a86f 100644 --- a/src/devices/machine/68307tmu.h +++ b/src/devices/machine/68307tmu.h @@ -17,7 +17,7 @@ class m68307cpu_device; struct m68307_single_timer { - UINT16 regs[0x8]; + uint16_t regs[0x8]; bool enabled; emu_timer *mametimer; }; @@ -31,10 +31,10 @@ class m68307_timer emu_timer *wd_mametimer; m68307cpu_device *parent; - void write_tmr(UINT16 data, UINT16 mem_mask, int which); - void write_trr(UINT16 data, UINT16 mem_mask, int which); - void write_ter(UINT16 data, UINT16 mem_mask, int which); - UINT16 read_tcn(UINT16 mem_mask, int which); + void write_tmr(uint16_t data, uint16_t mem_mask, int which); + void write_trr(uint16_t data, uint16_t mem_mask, int which); + void write_ter(uint16_t data, uint16_t mem_mask, int which); + uint16_t read_tcn(uint16_t mem_mask, int which); void init(m68307cpu_device *device); void reset(void); diff --git a/src/devices/machine/68340.cpp b/src/devices/machine/68340.cpp index f65c820ab33..312139f528e 100644 --- a/src/devices/machine/68340.cpp +++ b/src/devices/machine/68340.cpp @@ -32,7 +32,7 @@ int m68340_calc_cs(m68340cpu_device *m68k, offs_t address) -UINT16 m68340cpu_device::get_cs(offs_t address) +uint16_t m68340cpu_device::get_cs(offs_t address) { m68340_currentcs = m68340_calc_cs(this, address); @@ -109,7 +109,7 @@ ADDRESS_MAP_END -m68340cpu_device::m68340cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m68340cpu_device::m68340cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : fscpu32_device(mconfig, "MC68340", tag, owner, clock, M68340, 32,32, ADDRESS_MAP_NAME(m68340_internal_map), "mc68340", __FILE__) { m68340SIM = nullptr; diff --git a/src/devices/machine/68340.h b/src/devices/machine/68340.h index 5e9d4b5d908..b6883423193 100644 --- a/src/devices/machine/68340.h +++ b/src/devices/machine/68340.h @@ -21,7 +21,7 @@ class m68340cpu_device : public fscpu32_device { public: - m68340cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m68340cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); int m68340_currentcs; @@ -32,13 +32,13 @@ public: m68340_serial* m68340SERIAL; m68340_timer* m68340TIMER; - UINT32 m68340_base; + uint32_t m68340_base; - UINT16 m_avr; - UINT16 m_picr; - UINT16 m_pitr; + uint16_t m_avr; + uint16_t m_picr; + uint16_t m_pitr; - UINT16 get_cs(offs_t address); + uint16_t get_cs(offs_t address); READ32_MEMBER( m68340_internal_base_r ); WRITE32_MEMBER( m68340_internal_base_w ); diff --git a/src/devices/machine/68340sim.h b/src/devices/machine/68340sim.h index 493fa9805ce..821de60b319 100644 --- a/src/devices/machine/68340sim.h +++ b/src/devices/machine/68340sim.h @@ -53,8 +53,8 @@ class m68340_sim { public: - UINT32 m_am[4]; - UINT32 m_ba[4]; + uint32_t m_am[4]; + uint32_t m_ba[4]; void reset(void); }; diff --git a/src/devices/machine/6840ptm.cpp b/src/devices/machine/6840ptm.cpp index 1d3d2eeddf9..3e5858b2164 100644 --- a/src/devices/machine/6840ptm.cpp +++ b/src/devices/machine/6840ptm.cpp @@ -69,7 +69,7 @@ const device_type PTM6840 = &device_creator; // ptm6840_device - constructor //------------------------------------------------- -ptm6840_device::ptm6840_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ptm6840_device::ptm6840_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PTM6840, "6840 PTM", tag, owner, clock, "ptm6840", __FILE__), m_internal_clock(0.0), m_out_cb{*this, *this, *this}, @@ -304,7 +304,7 @@ void ptm6840_device::update_interrupts() // compute_counter - Compute Counter //------------------------------------------------- -UINT16 ptm6840_device::compute_counter( int counter ) const +uint16_t ptm6840_device::compute_counter( int counter ) const { double clock; @@ -496,7 +496,7 @@ WRITE8_MEMBER( ptm6840_device::write ) case PTM_6840_CTRL2: { int idx = (offset == 1) ? 1 : (m_control_reg[1] & CR1_SELECT) ? 0 : 2; - UINT8 diffs = data ^ m_control_reg[idx]; + uint8_t diffs = data ^ m_control_reg[idx]; m_t3_divisor = (m_control_reg[2] & T3_PRESCALE_EN) ? 8 : 1; m_mode[idx] = (data >> 3) & 0x07; m_control_reg[idx] = data; diff --git a/src/devices/machine/6840ptm.h b/src/devices/machine/6840ptm.h index fdbc931fbc7..0362ded05f6 100644 --- a/src/devices/machine/6840ptm.h +++ b/src/devices/machine/6840ptm.h @@ -49,7 +49,7 @@ class ptm6840_device : public device_t { public: // construction/destruction - ptm6840_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ptm6840_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_internal_clock(device_t &device, double clock) { downcast(device).m_internal_clock = clock; } static void set_external_clocks(device_t &device, double clock0, double clock1, double clock2) { downcast(device).m_external_clock[0] = clock0; downcast(device).m_external_clock[1] = clock1; downcast(device).m_external_clock[2] = clock2; } @@ -58,14 +58,14 @@ public: int status(int clock) const { return m_enabled[clock]; } // get whether timer is enabled int irq_state() const { return m_irq; } // get IRQ state - UINT16 count(int counter) const { return compute_counter(counter); } // get counter value + uint16_t count(int counter) const { return compute_counter(counter); } // get counter value void set_ext_clock(int counter, double clock); // set clock frequency int ext_clock(int counter) const { return m_external_clock[counter]; } // get clock frequency DECLARE_WRITE8_MEMBER( write ); - void write(offs_t offset, UINT8 data) { write(machine().driver_data()->generic_space(), offset, data); } + void write(offs_t offset, uint8_t data) { write(machine().driver_data()->generic_space(), offset, data); } DECLARE_READ8_MEMBER( read ); - UINT8 read(offs_t offset) { return read(machine().driver_data()->generic_space(), offset); } + uint8_t read(offs_t offset) { return read(machine().driver_data()->generic_space(), offset); } void set_gate(int idx, int state); DECLARE_WRITE_LINE_MEMBER( set_g1 ); @@ -90,7 +90,7 @@ private: void tick(int counter, int count); void timeout(int idx); - UINT16 compute_counter(int counter) const; + uint16_t compute_counter(int counter) const; void reload_count(int idx); enum @@ -131,26 +131,26 @@ private: devcb_write_line m_out_cb[3]; devcb_write_line m_irq_cb; - UINT8 m_control_reg[3]; - UINT8 m_output[3]; // Output states - UINT8 m_gate[3]; // Input gate states - UINT8 m_clk[3]; // Clock states - UINT8 m_enabled[3]; - UINT8 m_mode[3]; - UINT8 m_fired[3]; - UINT8 m_t3_divisor; - UINT8 m_t3_scaler; - UINT8 m_irq; - UINT8 m_status_reg; - UINT8 m_status_read_since_int; - UINT8 m_lsb_buffer; - UINT8 m_msb_buffer; + uint8_t m_control_reg[3]; + uint8_t m_output[3]; // Output states + uint8_t m_gate[3]; // Input gate states + uint8_t m_clk[3]; // Clock states + uint8_t m_enabled[3]; + uint8_t m_mode[3]; + uint8_t m_fired[3]; + uint8_t m_t3_divisor; + uint8_t m_t3_scaler; + uint8_t m_irq; + uint8_t m_status_reg; + uint8_t m_status_read_since_int; + uint8_t m_lsb_buffer; + uint8_t m_msb_buffer; // Each PTM has 3 timers emu_timer *m_timer[3]; - UINT16 m_latch[3]; - UINT16 m_counter[3]; + uint16_t m_latch[3]; + uint16_t m_counter[3]; static const char *const opmode[]; }; diff --git a/src/devices/machine/6850acia.cpp b/src/devices/machine/6850acia.cpp index 82615fbaf32..99882640fc4 100644 --- a/src/devices/machine/6850acia.cpp +++ b/src/devices/machine/6850acia.cpp @@ -64,7 +64,7 @@ const device_type ACIA6850 = &device_creator; // acia6850_device - constructor //------------------------------------------------- -acia6850_device::acia6850_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +acia6850_device::acia6850_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ACIA6850, "6850 ACIA", tag, owner, clock, "acia6850", __FILE__), m_txd_handler(*this), m_rts_handler(*this), @@ -88,7 +88,7 @@ acia6850_device::acia6850_device(const machine_config &mconfig, const char *tag, { } -acia6850_device::acia6850_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) +acia6850_device::acia6850_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_txd_handler(*this), m_rts_handler(*this), @@ -169,7 +169,7 @@ void acia6850_device::device_reset() READ8_MEMBER( acia6850_device::status_r ) { - UINT8 status = m_status; + uint8_t status = m_status; if (status & SR_CTS) { diff --git a/src/devices/machine/6850acia.h b/src/devices/machine/6850acia.h index df8c4a3bc29..0163dd7f4ca 100644 --- a/src/devices/machine/6850acia.h +++ b/src/devices/machine/6850acia.h @@ -28,7 +28,7 @@ class acia6850_device : public device_t { public: // construction/destruction - acia6850_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + acia6850_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_txd_handler(device_t &device, _Object object) { return downcast(device).m_txd_handler.set_callback(object); } @@ -47,7 +47,7 @@ public: DECLARE_WRITE_LINE_MEMBER( write_txc ); protected: - acia6850_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); + acia6850_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-level overrides virtual void device_start() override; @@ -99,9 +99,9 @@ private: devcb_write_line m_rts_handler; devcb_write_line m_irq_handler; - UINT8 m_status; - UINT8 m_tdr; - UINT8 m_rdr; + uint8_t m_status; + uint8_t m_tdr; + uint8_t m_rdr; bool m_first_master_reset; int m_dcd_irq_pending; diff --git a/src/devices/machine/68561mpcc.cpp b/src/devices/machine/68561mpcc.cpp index 29c5673a052..7ee3880877c 100644 --- a/src/devices/machine/68561mpcc.cpp +++ b/src/devices/machine/68561mpcc.cpp @@ -27,7 +27,7 @@ const device_type MPCC68561 = &device_creator; IMPLEMENTATION ***************************************************************************/ -mpcc68561_t::mpcc68561_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mpcc68561_t::mpcc68561_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MPCC68561, "Rockwell 68561 MPCC", tag, owner, clock, "mpcc68561", __FILE__), mode(0), reg(0), status(0), IRQV(0), MasterIRQEnable(0), lastIRQStat(0), IRQType(), intrq_cb(*this) { @@ -211,7 +211,7 @@ void mpcc68561_t::acknowledge() mpcc_getreg -------------------------------------------------*/ -UINT8 mpcc68561_t::getreg() +uint8_t mpcc68561_t::getreg() { /* Not yet implemented */ #if LOG_MPCC @@ -220,7 +220,7 @@ UINT8 mpcc68561_t::getreg() if (reg == 0) { - UINT8 rv = 0; + uint8_t rv = 0; Chan *ourCh = &channel[0]; @@ -241,7 +241,7 @@ UINT8 mpcc68561_t::getreg() mpcc_putreg -------------------------------------------------*/ -void mpcc68561_t::putreg(int ch, UINT8 data) +void mpcc68561_t::putreg(int ch, uint8_t data) { Chan *pChan = &channel[ch]; @@ -367,7 +367,7 @@ void mpcc68561_t::putreg(int ch, UINT8 data) mpcc68561_get_reg_a -------------------------------------------------*/ -UINT8 mpcc68561_t::get_reg_a(int reg) +uint8_t mpcc68561_t::get_reg_a(int reg) { return channel[0].reg_val[reg]; } @@ -378,7 +378,7 @@ UINT8 mpcc68561_t::get_reg_a(int reg) mpcc68561_set_reg_a -------------------------------------------------*/ -void mpcc68561_t::set_reg_a(int reg, UINT8 data) +void mpcc68561_t::set_reg_a(int reg, uint8_t data) { channel[0].reg_val[reg] = data; } @@ -391,7 +391,7 @@ void mpcc68561_t::set_reg_a(int reg, UINT8 data) READ8_MEMBER( mpcc68561_t::reg_r) { - UINT8 result = 0; + uint8_t result = 0; offset %= 4; diff --git a/src/devices/machine/68561mpcc.h b/src/devices/machine/68561mpcc.h index bb0bb4c2c6d..ed38b7bdb01 100644 --- a/src/devices/machine/68561mpcc.h +++ b/src/devices/machine/68561mpcc.h @@ -31,12 +31,12 @@ public: IRQ_B_EXT }; - mpcc68561_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mpcc68561_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast(device).intrq_cb.set_callback(object); } - UINT8 get_reg_a(int reg); - void set_reg_a(int reg, UINT8 data); + uint8_t get_reg_a(int reg); + void set_reg_a(int reg, uint8_t data); void set_status(int status); @@ -65,12 +65,12 @@ private: bool syncHunt; bool DCDEnable; bool CTSEnable; - UINT8 rxData; - UINT8 txData; + uint8_t rxData; + uint8_t txData; emu_timer *baudtimer; - UINT8 reg_val[22]; + uint8_t reg_val[22]; }; int mode; @@ -89,8 +89,8 @@ private: void initchannel(int ch); void resetchannel(int ch); void acknowledge(); - UINT8 getreg(); - void putreg(int ch, UINT8 data); + uint8_t getreg(); + void putreg(int ch, uint8_t data); }; /*************************************************************************** diff --git a/src/devices/machine/7200fifo.cpp b/src/devices/machine/7200fifo.cpp index 59e659ae9b5..d8bab32e758 100644 --- a/src/devices/machine/7200fifo.cpp +++ b/src/devices/machine/7200fifo.cpp @@ -19,7 +19,7 @@ const device_type FIFO7200 = &device_creator; // fifo7200_device - constructor //------------------------------------------------- -fifo7200_device::fifo7200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fifo7200_device::fifo7200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FIFO7200, "IDT7200 FIFO", tag, owner, clock, "fifo7200", __FILE__), m_ram_size(0), m_read_ptr(0), m_write_ptr(0), m_ef(0), m_ff(0), m_hf(0), m_ef_handler(*this), @@ -73,7 +73,7 @@ void fifo7200_device::device_reset() -void fifo7200_device::fifo_write(UINT16 data) +void fifo7200_device::fifo_write(uint16_t data) { if (m_ff) { @@ -104,7 +104,7 @@ void fifo7200_device::fifo_write(UINT16 data) } } -UINT16 fifo7200_device::fifo_read() +uint16_t fifo7200_device::fifo_read() { if (m_ef) { @@ -112,7 +112,7 @@ UINT16 fifo7200_device::fifo_read() return 0x1ff; } - UINT16 ret = m_buffer[m_read_ptr]; + uint16_t ret = m_buffer[m_read_ptr]; m_read_ptr = (m_read_ptr + 1) % m_ram_size; // update flags diff --git a/src/devices/machine/7200fifo.h b/src/devices/machine/7200fifo.h index 044484de076..ea58ea0dfa7 100644 --- a/src/devices/machine/7200fifo.h +++ b/src/devices/machine/7200fifo.h @@ -81,7 +81,7 @@ The following chips are functionally equivalent and pin-compatible. class fifo7200_device : public device_t { public: - fifo7200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fifo7200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_ef_handler(device_t &device, _Object object) { return downcast(device).m_ef_handler.set_callback(object); } @@ -95,11 +95,11 @@ public: // normal configuration DECLARE_WRITE16_MEMBER( data_word_w ) { fifo_write(data); } - DECLARE_READ16_MEMBER( data_word_r ) { return (UINT16)fifo_read(); } + DECLARE_READ16_MEMBER( data_word_r ) { return (uint16_t)fifo_read(); } // use these for simple configurations that don't have d8/q8 connected DECLARE_WRITE8_MEMBER( data_byte_w ) { fifo_write(data); } - DECLARE_READ8_MEMBER( data_byte_r ) { return (UINT8)fifo_read(); } + DECLARE_READ8_MEMBER( data_byte_r ) { return (uint8_t)fifo_read(); } protected: // device-level overrides @@ -107,10 +107,10 @@ protected: virtual void device_reset() override; private: - void fifo_write(UINT16 data); - UINT16 fifo_read(); + void fifo_write(uint16_t data); + uint16_t fifo_read(); - std::vector m_buffer; + std::vector m_buffer; int m_ram_size; int m_read_ptr; diff --git a/src/devices/machine/74123.cpp b/src/devices/machine/74123.cpp index 0263ad0eb4b..ad3cd7d2a0c 100644 --- a/src/devices/machine/74123.cpp +++ b/src/devices/machine/74123.cpp @@ -28,7 +28,7 @@ const device_type TTL74123 = &device_creator; // ttl74123_device - constructor //------------------------------------------------- -ttl74123_device::ttl74123_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ttl74123_device::ttl74123_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL74123, "74123 TTL", tag, owner, clock, "ttl74123", __FILE__), m_timer(nullptr), m_connection_type(TTL74123_NOT_GROUNDED_NO_DIODE), m_res(1.0), diff --git a/src/devices/machine/74123.h b/src/devices/machine/74123.h index 898dd48e6ea..0fd9ad6ad70 100644 --- a/src/devices/machine/74123.h +++ b/src/devices/machine/74123.h @@ -96,7 +96,7 @@ class ttl74123_device : public device_t { public: // construction/destruction - ttl74123_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ttl74123_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_connection_type(device_t &device, int type) { downcast(device).m_connection_type = type; } static void set_resistor_value(device_t &device, double value) { downcast(device).m_res = value; } diff --git a/src/devices/machine/74145.cpp b/src/devices/machine/74145.cpp index f85439398de..218a65829f5 100644 --- a/src/devices/machine/74145.cpp +++ b/src/devices/machine/74145.cpp @@ -59,7 +59,7 @@ const device_type TTL74145 = &device_creator; // ttl74145_device - constructor //------------------------------------------------- -ttl74145_device::ttl74145_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ttl74145_device::ttl74145_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL74145, "TTL74145", tag, owner, clock, "ttl74145", __FILE__) , m_output_line_0_cb(*this) , m_output_line_1_cb(*this) @@ -111,10 +111,10 @@ void ttl74145_device::device_reset() IMPLEMENTATION ***************************************************************************/ -void ttl74145_device::write(UINT8 data) +void ttl74145_device::write(uint8_t data) { /* decode number */ - UINT16 new_number = bcd_2_dec(data & 0x0f); + uint16_t new_number = bcd_2_dec(data & 0x0f); /* call output callbacks if the number changed */ if (new_number != m_number) @@ -136,7 +136,7 @@ void ttl74145_device::write(UINT8 data) } -UINT16 ttl74145_device::read() +uint16_t ttl74145_device::read() { return (1 << m_number) & 0x3ff; } diff --git a/src/devices/machine/74145.h b/src/devices/machine/74145.h index a6472f69291..8f44de45bb1 100644 --- a/src/devices/machine/74145.h +++ b/src/devices/machine/74145.h @@ -54,7 +54,7 @@ class ttl74145_device : public device_t { public: // construction/destruction - ttl74145_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ttl74145_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_output_line_0_callback(device_t &device, _Object object) { return downcast(device).m_output_line_0_cb.set_callback(object); } template static devcb_base &set_output_line_1_callback(device_t &device, _Object object) { return downcast(device).m_output_line_1_cb.set_callback(object); } @@ -67,8 +67,8 @@ public: template static devcb_base &set_output_line_8_callback(device_t &device, _Object object) { return downcast(device).m_output_line_8_cb.set_callback(object); } template static devcb_base &set_output_line_9_callback(device_t &device, _Object object) { return downcast(device).m_output_line_9_cb.set_callback(object); } - UINT16 read(); - void write(UINT8 data); + uint16_t read(); + void write(uint8_t data); protected: // device-level overrides virtual void device_start() override; @@ -87,7 +87,7 @@ private: devcb_write_line m_output_line_9_cb; /* decoded number */ - UINT16 m_number; + uint16_t m_number; }; // device type definition diff --git a/src/devices/machine/74148.cpp b/src/devices/machine/74148.cpp index 71520535f63..8786d2aa7b4 100644 --- a/src/devices/machine/74148.cpp +++ b/src/devices/machine/74148.cpp @@ -46,7 +46,7 @@ const device_type TTL74148 = &device_creator; -ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL74148, "74148 TTL", tag, owner, clock, "74148", __FILE__), m_enable_input(0), m_output(0), diff --git a/src/devices/machine/74148.h b/src/devices/machine/74148.h index 37ca98cf0ec..c7301e11588 100644 --- a/src/devices/machine/74148.h +++ b/src/devices/machine/74148.h @@ -52,7 +52,7 @@ typedef device_delegate ttl74148_output_delegate; class ttl74148_device : public device_t { public: - ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~ttl74148_device() {} static void set_output_callback(device_t &device, ttl74148_output_delegate callback) { downcast(device).m_output_cb = callback; } diff --git a/src/devices/machine/74153.cpp b/src/devices/machine/74153.cpp index d5b8ad37634..591fcdedbd1 100644 --- a/src/devices/machine/74153.cpp +++ b/src/devices/machine/74153.cpp @@ -41,7 +41,7 @@ const device_type TTL74153 = &device_creator; -ttl74153_device::ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ttl74153_device::ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL74153, "74153 TTL", tag, owner, clock, "74153", __FILE__), m_a(0), m_b(0) diff --git a/src/devices/machine/74153.h b/src/devices/machine/74153.h index 491fce01565..77194610742 100644 --- a/src/devices/machine/74153.h +++ b/src/devices/machine/74153.h @@ -47,7 +47,7 @@ typedef device_delegate ttl74153_output_delegate; class ttl74153_device : public device_t { public: - ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~ttl74153_device() {} static void set_output_callback(device_t &device, ttl74153_output_delegate callback) { downcast(device).m_output_cb = callback; } diff --git a/src/devices/machine/74181.cpp b/src/devices/machine/74181.cpp index a58b2cd190c..ea92cb061d5 100644 --- a/src/devices/machine/74181.cpp +++ b/src/devices/machine/74181.cpp @@ -26,7 +26,7 @@ const device_type TTL74181 = &device_creator; // ttl74181_device - constructor //------------------------------------------------- -ttl74181_device::ttl74181_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ttl74181_device::ttl74181_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL74181, "74181 TTL", tag, owner, clock, "ttl74181", __FILE__), m_a(0), m_b(0), @@ -98,7 +98,7 @@ void ttl74181_device::update() m_cn = (!(m_c & bp0 & bp1 & bp2 & bp3)) | m_g; } -void ttl74181_device::input_a_w(UINT8 data) +void ttl74181_device::input_a_w(uint8_t data) { data &= 0x0f; @@ -109,7 +109,7 @@ void ttl74181_device::input_a_w(UINT8 data) } } -void ttl74181_device::input_b_w(UINT8 data) +void ttl74181_device::input_b_w(uint8_t data) { data &= 0x0f; @@ -120,7 +120,7 @@ void ttl74181_device::input_b_w(UINT8 data) } } -void ttl74181_device::select_w(UINT8 data) +void ttl74181_device::select_w(uint8_t data) { data &= 0x0f; diff --git a/src/devices/machine/74181.h b/src/devices/machine/74181.h index 563acb3943e..d883b24995f 100644 --- a/src/devices/machine/74181.h +++ b/src/devices/machine/74181.h @@ -33,17 +33,17 @@ class ttl74181_device : public device_t { public: // construction/destruction - ttl74181_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ttl74181_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inputs - void input_a_w(UINT8 data); - void input_b_w(UINT8 data); - void select_w(UINT8 data); + void input_a_w(uint8_t data); + void input_b_w(uint8_t data); + void select_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER( mode_w ); DECLARE_WRITE_LINE_MEMBER( carry_w ); // outputs - UINT8 function_r() { return m_f; } + uint8_t function_r() { return m_f; } DECLARE_READ_LINE_MEMBER( carry_r ) { return m_cn; } DECLARE_READ_LINE_MEMBER( generate_r ) { return m_g; } DECLARE_READ_LINE_MEMBER( propagate_r ) { return m_p; } @@ -58,14 +58,14 @@ private: void update(); // inputs - UINT8 m_a; - UINT8 m_b; - UINT8 m_s; + uint8_t m_a; + uint8_t m_b; + uint8_t m_s; int m_m; int m_c; // outputs - UINT8 m_f; + uint8_t m_f; int m_cn; int m_g; int m_p; diff --git a/src/devices/machine/7474.cpp b/src/devices/machine/7474.cpp index 1b6ce95033d..50852c76e0c 100644 --- a/src/devices/machine/7474.cpp +++ b/src/devices/machine/7474.cpp @@ -55,7 +55,7 @@ const device_type TTL7474 = &device_creator; // ttl7474_device - constructor //------------------------------------------------- -ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL7474, "7474 TTL", tag, owner, clock, "7474", __FILE__), m_output_func(*this), m_comp_output_func(*this) diff --git a/src/devices/machine/7474.h b/src/devices/machine/7474.h index 15ece073ad1..7cafd0563be 100644 --- a/src/devices/machine/7474.h +++ b/src/devices/machine/7474.h @@ -69,7 +69,7 @@ class ttl7474_device : public device_t { public: // construction/destruction - ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_output_cb(device_t &device, _Object object) { return downcast(device).m_output_func.set_callback(object); } @@ -95,19 +95,19 @@ private: devcb_write_line m_comp_output_func; // inputs - UINT8 m_clear; // pin 1/13 - UINT8 m_preset; // pin 4/10 - UINT8 m_clk; // pin 3/11 - UINT8 m_d; // pin 2/12 + uint8_t m_clear; // pin 1/13 + uint8_t m_preset; // pin 4/10 + uint8_t m_clk; // pin 3/11 + uint8_t m_d; // pin 2/12 // outputs - UINT8 m_output; // pin 5/9 - UINT8 m_output_comp; // pin 6/8 + uint8_t m_output; // pin 5/9 + uint8_t m_output_comp; // pin 6/8 // internal - UINT8 m_last_clock; - UINT8 m_last_output; - UINT8 m_last_output_comp; + uint8_t m_last_clock; + uint8_t m_last_output; + uint8_t m_last_output_comp; void update(); void init(); diff --git a/src/devices/machine/8042kbdc.cpp b/src/devices/machine/8042kbdc.cpp index 72b3718c821..bbd3ea3e469 100644 --- a/src/devices/machine/8042kbdc.cpp +++ b/src/devices/machine/8042kbdc.cpp @@ -196,7 +196,7 @@ const device_type KBDC8042 = &device_creator; // kbdc8042_device - constructor //------------------------------------------------- -kbdc8042_device::kbdc8042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kbdc8042_device::kbdc8042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KBDC8042, "8042 Keyboard Controller", tag, owner, clock, "kbdc8042", __FILE__) , m_keyboard_dev(*this, "at_keyboard") , m_system_reset_cb(*this) @@ -249,9 +249,9 @@ void kbdc8042_device::device_reset() at_8042_set_outport(0xfe, 1); } -void kbdc8042_device::at_8042_set_outport(UINT8 data, int initial) +void kbdc8042_device::at_8042_set_outport(uint8_t data, int initial) { - UINT8 change; + uint8_t change; change = initial ? 0xFF : (m_outport ^ data); m_outport = data; if (change & 0x02) @@ -267,7 +267,7 @@ WRITE_LINE_MEMBER( kbdc8042_device::keyboard_w ) at_8042_check_keyboard(); } -void kbdc8042_device::at_8042_receive(UINT8 data) +void kbdc8042_device::at_8042_receive(uint8_t data) { if (LOG_KEYBOARD) logerror("at_8042_receive Received 0x%02x\n", data); @@ -334,7 +334,7 @@ void kbdc8042_device::at_8042_clear_keyboard_received() READ8_MEMBER(kbdc8042_device::data_r) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { case 0: diff --git a/src/devices/machine/8042kbdc.h b/src/devices/machine/8042kbdc.h index 75ea3d4f2d8..a08279f77fa 100644 --- a/src/devices/machine/8042kbdc.h +++ b/src/devices/machine/8042kbdc.h @@ -54,7 +54,7 @@ class kbdc8042_device : public device_t { public: // construction/destruction - kbdc8042_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kbdc8042_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; @@ -71,8 +71,8 @@ public: DECLARE_WRITE_LINE_MEMBER( write_out2 ); DECLARE_WRITE_LINE_MEMBER( keyboard_w ); - void at_8042_set_outport(UINT8 data, int initial); - void at_8042_receive(UINT8 data); + void at_8042_set_outport(uint8_t data, int initial); + void at_8042_receive(uint8_t data); void at_8042_check_keyboard(); void at_8042_clear_keyboard_received(); @@ -81,7 +81,7 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT8 m_inport, m_outport, m_data, m_command; + uint8_t m_inport, m_outport, m_data, m_command; struct { int received; diff --git a/src/devices/machine/8530scc.cpp b/src/devices/machine/8530scc.cpp index 88cd30a3388..ee7631d241c 100644 --- a/src/devices/machine/8530scc.cpp +++ b/src/devices/machine/8530scc.cpp @@ -25,7 +25,7 @@ const device_type SCC8530 = &device_creator; IMPLEMENTATION ***************************************************************************/ -scc8530_t::scc8530_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +scc8530_t::scc8530_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SCC8530, "Zilog 8530 SCC (Legacy)", tag, owner, clock, "scc8530l", __FILE__), mode(0), reg(0), status(0), IRQV(0), MasterIRQEnable(0), lastIRQStat(0), IRQType(), intrq_cb(*this) { @@ -214,7 +214,7 @@ void scc8530_t::acknowledge() scc_getareg -------------------------------------------------*/ -UINT8 scc8530_t::getareg() +uint8_t scc8530_t::getareg() { /* Not yet implemented */ #if LOG_SCC @@ -223,7 +223,7 @@ UINT8 scc8530_t::getareg() if (reg == 0) { - UINT8 rv = 0; + uint8_t rv = 0; Chan *ourCh = &channel[0]; @@ -246,7 +246,7 @@ UINT8 scc8530_t::getareg() scc_getareg -------------------------------------------------*/ -UINT8 scc8530_t::getbreg() +uint8_t scc8530_t::getbreg() { #if LOG_SCC printf("SCC: port B reg %i read 0x%02x\n", reg, channel[1].reg_val[reg]); @@ -254,7 +254,7 @@ UINT8 scc8530_t::getbreg() if (reg == 0) { - UINT8 rv = 0; + uint8_t rv = 0; Chan *ourCh = &channel[1]; @@ -285,7 +285,7 @@ UINT8 scc8530_t::getbreg() scc_putreg -------------------------------------------------*/ -void scc8530_t::putreg(int ch, UINT8 data) +void scc8530_t::putreg(int ch, uint8_t data) { Chan *pChan = &channel[ch]; @@ -417,7 +417,7 @@ void scc8530_t::putreg(int ch, UINT8 data) scc8530_get_reg_a -------------------------------------------------*/ -UINT8 scc8530_t::get_reg_a(int reg) +uint8_t scc8530_t::get_reg_a(int reg) { return channel[0].reg_val[reg]; } @@ -428,7 +428,7 @@ UINT8 scc8530_t::get_reg_a(int reg) scc8530_get_reg_b -------------------------------------------------*/ -UINT8 scc8530_t::get_reg_b(int reg) +uint8_t scc8530_t::get_reg_b(int reg) { return channel[1].reg_val[reg]; } @@ -439,7 +439,7 @@ UINT8 scc8530_t::get_reg_b(int reg) scc8530_set_reg_a -------------------------------------------------*/ -void scc8530_t::set_reg_a(int reg, UINT8 data) +void scc8530_t::set_reg_a(int reg, uint8_t data) { channel[0].reg_val[reg] = data; } @@ -450,7 +450,7 @@ void scc8530_t::set_reg_a(int reg, UINT8 data) scc8530_set_reg_b -------------------------------------------------*/ -void scc8530_t::set_reg_b(int reg, UINT8 data) +void scc8530_t::set_reg_b(int reg, uint8_t data) { channel[1].reg_val[reg] = data; } @@ -474,9 +474,9 @@ READ8_MEMBER(scc8530_t::reg_r) // port for either SCC channel. //------------------------------------------------- -UINT8 scc8530_t::read_reg(int offset) +uint8_t scc8530_t::read_reg(int offset) { - UINT8 result = 0; + uint8_t result = 0; switch(offset) { @@ -518,7 +518,7 @@ WRITE8_MEMBER( scc8530_t::reg_w ) // port for either SCC channel. //------------------------------------------------- -void scc8530_t::write_reg(int offset, UINT8 data) +void scc8530_t::write_reg(int offset, uint8_t data) { //offset & 3; diff --git a/src/devices/machine/8530scc.h b/src/devices/machine/8530scc.h index b711f7cdabe..a13f102d1ac 100644 --- a/src/devices/machine/8530scc.h +++ b/src/devices/machine/8530scc.h @@ -29,22 +29,22 @@ public: IRQ_B_EXT }; - scc8530_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc8530_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast(device).intrq_cb.set_callback(object); } - UINT8 get_reg_a(int reg); - UINT8 get_reg_b(int reg); - void set_reg_a(int reg, UINT8 data); - void set_reg_b(int reg, UINT8 data); + uint8_t get_reg_a(int reg); + uint8_t get_reg_b(int reg); + void set_reg_a(int reg, uint8_t data); + void set_reg_b(int reg, uint8_t data); void set_status(int status); DECLARE_READ8_MEMBER(reg_r); DECLARE_WRITE8_MEMBER(reg_w); - void write_reg(int offset, UINT8 data); - UINT8 read_reg(int offset); + void write_reg(int offset, uint8_t data); + uint8_t read_reg(int offset); protected: virtual void device_start() override; @@ -68,12 +68,12 @@ private: bool syncHunt; bool DCDEnable; bool CTSEnable; - UINT8 rxData; - UINT8 txData; + uint8_t rxData; + uint8_t txData; emu_timer *baudtimer; - UINT8 reg_val[16]; + uint8_t reg_val[16]; }; int mode; @@ -92,9 +92,9 @@ private: void initchannel(int ch); void resetchannel(int ch); void acknowledge(); - UINT8 getareg(); - UINT8 getbreg(); - void putreg(int ch, UINT8 data); + uint8_t getareg(); + uint8_t getbreg(); + void putreg(int ch, uint8_t data); }; /*************************************************************************** diff --git a/src/devices/machine/aakart.cpp b/src/devices/machine/aakart.cpp index c7b9e260243..cd39e31bf0c 100644 --- a/src/devices/machine/aakart.cpp +++ b/src/devices/machine/aakart.cpp @@ -39,7 +39,7 @@ const device_type AAKART = &device_creator; // aakart_device - constructor //------------------------------------------------- -aakart_device::aakart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +aakart_device::aakart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AAKART, "AAKART", tag, owner, clock, "aakart", __FILE__), m_rxtimer(nullptr), m_txtimer(nullptr), m_mousetimer(nullptr), m_keybtimer(nullptr), m_out_tx_cb(*this), m_out_rx_cb(*this), m_tx_latch(0), m_rx(0), m_new_command(0), m_status(0), m_mouse_enable(0), m_keyb_enable(0), m_keyb_row(0), m_keyb_col(0), m_keyb_state(0) @@ -178,7 +178,7 @@ WRITE8_MEMBER( aakart_device::write ) m_new_command |= 1; } -void aakart_device::send_keycode_down(UINT8 row, UINT8 col) +void aakart_device::send_keycode_down(uint8_t row, uint8_t col) { //printf("keycode down\n"); m_keyb_row = row | 0xc0; @@ -186,7 +186,7 @@ void aakart_device::send_keycode_down(UINT8 row, UINT8 col) m_keyb_state = 1; } -void aakart_device::send_keycode_up(UINT8 row, UINT8 col) +void aakart_device::send_keycode_up(uint8_t row, uint8_t col) { //printf("keycode up\n"); m_keyb_row = row | 0xd0; diff --git a/src/devices/machine/aakart.h b/src/devices/machine/aakart.h index 15eefd6bf92..9e81fb2f6b0 100644 --- a/src/devices/machine/aakart.h +++ b/src/devices/machine/aakart.h @@ -43,7 +43,7 @@ class aakart_device : public device_t { public: // construction/destruction - aakart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + aakart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_tx_callback(device_t &device, _Object object) { return downcast(device).m_out_tx_cb.set_callback(object); } template static devcb_base &set_out_rx_callback(device_t &device, _Object object) { return downcast(device).m_out_rx_cb.set_callback(object); } @@ -51,8 +51,8 @@ public: // I/O operations DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( read ); - void send_keycode_down(UINT8 row, UINT8 col); - void send_keycode_up(UINT8 row, UINT8 col); + void send_keycode_down(uint8_t row, uint8_t col); + void send_keycode_up(uint8_t row, uint8_t col); protected: // device-level overrides virtual void device_validity_check(validity_checker &valid) const override; @@ -72,16 +72,16 @@ private: devcb_write_line m_out_tx_cb; devcb_write_line m_out_rx_cb; - UINT8 m_tx_latch; - //UINT8 m_rx_latch; - UINT8 m_rx; - UINT8 m_new_command; - UINT8 m_status; - UINT8 m_mouse_enable; - UINT8 m_keyb_enable; - UINT8 m_keyb_row; - UINT8 m_keyb_col; - UINT8 m_keyb_state; + uint8_t m_tx_latch; + //uint8_t m_rx_latch; + uint8_t m_rx; + uint8_t m_new_command; + uint8_t m_status; + uint8_t m_mouse_enable; + uint8_t m_keyb_enable; + uint8_t m_keyb_row; + uint8_t m_keyb_col; + uint8_t m_keyb_state; }; diff --git a/src/devices/machine/adc0808.cpp b/src/devices/machine/adc0808.cpp index da7b21f883e..902133161d4 100644 --- a/src/devices/machine/adc0808.cpp +++ b/src/devices/machine/adc0808.cpp @@ -23,7 +23,7 @@ const device_type ADC0808 = &device_creator; // adc0808_device - constructor //------------------------------------------------- -adc0808_device::adc0808_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adc0808_device::adc0808_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADC0808, "ADC0808", tag, owner, clock, "adc0808", __FILE__), m_out_eoc_cb(*this), m_address(0), diff --git a/src/devices/machine/adc0808.h b/src/devices/machine/adc0808.h index 9a863e4ef81..3bb7aa1dff8 100644 --- a/src/devices/machine/adc0808.h +++ b/src/devices/machine/adc0808.h @@ -80,7 +80,7 @@ class adc0808_device : public device_t { public: // construction/destruction - adc0808_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adc0808_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_eoc_callback(device_t &device, _Object object) { return downcast(device).m_out_eoc_cb.set_callback(object); } static void set_in_vref_pos_callback(device_t &device, adc0808_analog_read_delegate callback) { downcast(device).m_in_vref_pos_cb = callback; } @@ -122,7 +122,7 @@ private: int m_eoc; // end of conversion pin int m_next_eoc; // next value end of conversion pin - UINT8 m_sar; // successive approximation register + uint8_t m_sar; // successive approximation register int m_cycle; // clock cycle counter int m_bit; // bit counter diff --git a/src/devices/machine/adc083x.cpp b/src/devices/machine/adc083x.cpp index 690c2d0e1fd..375bc442a93 100644 --- a/src/devices/machine/adc083x.cpp +++ b/src/devices/machine/adc083x.cpp @@ -51,7 +51,7 @@ const device_type ADC0832 = &device_creator; const device_type ADC0834 = &device_creator; const device_type ADC0838 = &device_creator; -adc083x_device::adc083x_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) +adc083x_device::adc083x_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_cs(0), m_clk(0), @@ -68,25 +68,25 @@ adc083x_device::adc083x_device(const machine_config &mconfig, device_type type, { } -adc0831_device::adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adc0831_device::adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adc083x_device(mconfig, ADC0831, "ADC0831", tag, owner, clock, "adc0831", __FILE__) { m_mux_bits = 0; } -adc0832_device::adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adc0832_device::adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adc083x_device(mconfig, ADC0832, "ADC0832", tag, owner, clock, "adc0832", __FILE__) { m_mux_bits = 2; } -adc0834_device::adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adc0834_device::adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adc083x_device(mconfig, ADC0834, "ADC0834", tag, owner, clock, "adc0834", __FILE__) { m_mux_bits = 3; } -adc0838_device::adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adc0838_device::adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adc083x_device(mconfig, ADC0838, "ADC0838", tag, owner, clock, "adc0838", __FILE__) { m_mux_bits = 4; @@ -176,7 +176,7 @@ WRITE_LINE_MEMBER( adc083x_device::cs_write ) adc083x_device::conversion -------------------------------------------------*/ -UINT8 adc083x_device::conversion() +uint8_t adc083x_device::conversion() { int result; int positive_channel = ADC083X_AGND; diff --git a/src/devices/machine/adc083x.h b/src/devices/machine/adc083x.h index 6a97973acca..b8fe1268591 100644 --- a/src/devices/machine/adc083x.h +++ b/src/devices/machine/adc083x.h @@ -17,8 +17,8 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef device_delegate adc083x_input_delegate; -#define ADC083X_INPUT_CB(name) double name(UINT8 input) +typedef device_delegate adc083x_input_delegate; +#define ADC083X_INPUT_CB(name) double name(uint8_t input) #define MCFG_ADC083X_INPUT_CB(_class, _method) \ adc083x_device::set_input_callback(*device, adc083x_input_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); @@ -46,7 +46,7 @@ typedef device_delegate adc083x_input_delegate; class adc083x_device : public device_t { public: - adc083x_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); + adc083x_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 static void set_input_callback(device_t &device, adc083x_input_delegate input_callback) { downcast(device).m_input_callback = input_callback; } @@ -62,27 +62,27 @@ protected: // device-level overrides virtual void device_start() override; - INT32 m_mux_bits; + int32_t m_mux_bits; private: - UINT8 conversion(); + uint8_t conversion(); void clear_sars(); // internal state - INT32 m_cs; - INT32 m_clk; - INT32 m_di; - INT32 m_se; - INT32 m_sars; - INT32 m_do; - INT32 m_sgl; - INT32 m_odd; - INT32 m_sel1; - INT32 m_sel0; - INT32 m_state; - INT32 m_bit; - INT32 m_output; + int32_t m_cs; + int32_t m_clk; + int32_t m_di; + int32_t m_se; + int32_t m_sars; + int32_t m_do; + int32_t m_sgl; + int32_t m_odd; + int32_t m_sel1; + int32_t m_sel0; + int32_t m_state; + int32_t m_bit; + int32_t m_output; adc083x_input_delegate m_input_callback; }; @@ -90,7 +90,7 @@ private: class adc0831_device : public adc083x_device { public: - adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type ADC0831; @@ -99,7 +99,7 @@ extern const device_type ADC0831; class adc0832_device : public adc083x_device { public: - adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type ADC0832; @@ -108,7 +108,7 @@ extern const device_type ADC0832; class adc0834_device : public adc083x_device { public: - adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type ADC0834; @@ -117,7 +117,7 @@ extern const device_type ADC0834; class adc0838_device : public adc083x_device { public: - adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type ADC0838; diff --git a/src/devices/machine/adc1038.cpp b/src/devices/machine/adc1038.cpp index 1f1e2fb3180..d0591c867b6 100644 --- a/src/devices/machine/adc1038.cpp +++ b/src/devices/machine/adc1038.cpp @@ -15,7 +15,7 @@ const device_type ADC1038 = &device_creator; -adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADC1038, "ADC1038", tag, owner, clock, "adc1038", __FILE__), m_cycle(0), m_clk(0), m_adr(0), m_data_in(0), m_data_out(0), m_adc_data(0), m_sars(0), m_gticlub_hack(0) { diff --git a/src/devices/machine/adc1038.h b/src/devices/machine/adc1038.h index 84e6ecf2f29..f3b74bd0290 100644 --- a/src/devices/machine/adc1038.h +++ b/src/devices/machine/adc1038.h @@ -26,7 +26,7 @@ typedef device_delegate adc1038_input_delegate; class adc1038_device : public device_t { public: - adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~adc1038_device() {} static void set_input_callback(device_t &device, adc1038_input_delegate callback) { downcast(device).m_input_cb = callback; } diff --git a/src/devices/machine/adc1213x.cpp b/src/devices/machine/adc1213x.cpp index b3aec60a8e7..ed501313156 100644 --- a/src/devices/machine/adc1213x.cpp +++ b/src/devices/machine/adc1213x.cpp @@ -36,7 +36,7 @@ const device_type ADC12130 = &device_creator; -adc12130_device::adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adc12130_device::adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adc12138_device(mconfig, ADC12130, "ADC12130", tag, owner, clock, "adc12130", __FILE__) { } @@ -44,7 +44,7 @@ adc12130_device::adc12130_device(const machine_config &mconfig, const char *tag, const device_type ADC12132 = &device_creator; -adc12132_device::adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adc12132_device::adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : adc12138_device(mconfig, ADC12132, "ADC12132", tag, owner, clock, "adc12132", __FILE__) { } @@ -52,11 +52,11 @@ adc12132_device::adc12132_device(const machine_config &mconfig, const char *tag, const device_type ADC12138 = &device_creator; -adc12138_device::adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +adc12138_device::adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ADC12138, "ADC12138", tag, owner, clock, "adc12138", __FILE__) { } -adc12138_device::adc12138_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) +adc12138_device::adc12138_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) { } diff --git a/src/devices/machine/adc1213x.h b/src/devices/machine/adc1213x.h index 361cd3dede8..56251fdae91 100644 --- a/src/devices/machine/adc1213x.h +++ b/src/devices/machine/adc1213x.h @@ -17,8 +17,8 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef device_delegate adc1213x_ipt_convert_delegate; -#define ADC12138_IPT_CONVERT_CB(name) double name(UINT8 input) +typedef device_delegate adc1213x_ipt_convert_delegate; +#define ADC12138_IPT_CONVERT_CB(name) double name(uint8_t input) /*************************************************************************** MACROS / CONSTANTS @@ -27,8 +27,8 @@ typedef device_delegate adc1213x_ipt_convert_delegate; class adc12138_device : public device_t { public: - adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - adc12138_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); + adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + adc12138_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); ~adc12138_device() {} static void set_ipt_convert_callback(device_t &device, adc1213x_ipt_convert_delegate callback) { downcast(device).m_ipt_read_cb = callback; } @@ -69,7 +69,7 @@ extern const device_type ADC12138; class adc12130_device : public adc12138_device { public: - adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type ADC12130; @@ -77,7 +77,7 @@ extern const device_type ADC12130; class adc12132_device : public adc12138_device { public: - adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type ADC12132; diff --git a/src/devices/machine/aicartc.cpp b/src/devices/machine/aicartc.cpp index e4ed8fa44b0..4ca6bee31bd 100644 --- a/src/devices/machine/aicartc.cpp +++ b/src/devices/machine/aicartc.cpp @@ -30,7 +30,7 @@ const device_type AICARTC = &device_creator; // aicartc_device - constructor //------------------------------------------------- -aicartc_device::aicartc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +aicartc_device::aicartc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AICARTC, "AICA RTC", tag, owner, clock, "aicartc", __FILE__), device_rtc_interface(mconfig, *this), m_rtc_reg_lo(0), m_rtc_reg_hi(0), m_rtc_tick(0), m_we(0), m_clock_timer(nullptr) { @@ -66,7 +66,7 @@ void aicartc_device::rtc_clock_updated(int year, int month, int day, int day_of_ const int month_to_day_conversion[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; // put the seconds - UINT32 current_time = second; + uint32_t current_time = second; // put the minutes current_time += minute * 60; @@ -128,7 +128,7 @@ void aicartc_device::device_timer(emu_timer &timer, device_timer_id id, int para READ16_MEMBER( aicartc_device::read ) { - UINT16 res; + uint16_t res; res = 0; switch(offset) diff --git a/src/devices/machine/aicartc.h b/src/devices/machine/aicartc.h index f923ce073ca..ba06de45db2 100644 --- a/src/devices/machine/aicartc.h +++ b/src/devices/machine/aicartc.h @@ -32,15 +32,15 @@ class aicartc_device : public device_t, { public: // construction/destruction - aicartc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + aicartc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE16_MEMBER( write ); DECLARE_READ16_MEMBER( read ); - UINT16 m_rtc_reg_lo,m_rtc_reg_hi; - UINT16 m_rtc_tick; - UINT8 m_we; + uint16_t m_rtc_reg_lo,m_rtc_reg_hi; + uint16_t m_rtc_tick; + uint8_t m_we; protected: // device-level overrides diff --git a/src/devices/machine/akiko.cpp b/src/devices/machine/akiko.cpp index 6a2772187f8..ed356996633 100644 --- a/src/devices/machine/akiko.cpp +++ b/src/devices/machine/akiko.cpp @@ -55,7 +55,7 @@ machine_config_constructor akiko_device::device_mconfig_additions() const // akiko_device - constructor //------------------------------------------------- -akiko_device::akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +akiko_device::akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AKIKO, "CBM AKIKO", tag, owner, clock, "akiko", __FILE__), m_c2p_input_index(0), m_c2p_output_index(0), @@ -177,9 +177,9 @@ void akiko_device::device_reset() /* create the TOC table */ if ( m_cdrom != nullptr && cdrom_get_last_track(m_cdrom) ) { - UINT8 *p; + uint8_t *p; int i, addrctrl = cdrom_get_adr_control( m_cdrom, 0 ); - UINT32 discend; + uint32_t discend; discend = cdrom_get_track_start(m_cdrom,cdrom_get_last_track(m_cdrom)-1); discend += cdrom_get_toc(m_cdrom)->tracks[cdrom_get_last_track(m_cdrom)-1].frames; @@ -187,7 +187,7 @@ void akiko_device::device_reset() m_cdrom_numtracks = cdrom_get_last_track(m_cdrom)+3; - m_cdrom_toc = std::make_unique(13*m_cdrom_numtracks); + m_cdrom_toc = std::make_unique(13*m_cdrom_numtracks); memset( m_cdrom_toc.get(), 0, 13*m_cdrom_numtracks); p = m_cdrom_toc.get(); @@ -208,7 +208,7 @@ void akiko_device::device_reset() for( i = 0; i < cdrom_get_last_track(m_cdrom); i++ ) { - UINT32 trackpos = cdrom_get_track_start(m_cdrom,i); + uint32_t trackpos = cdrom_get_track_start(m_cdrom,i); trackpos = lba_to_msf(trackpos); addrctrl = cdrom_get_adr_control( m_cdrom, i ); @@ -241,7 +241,7 @@ void akiko_device::device_stop() } } -void akiko_device::nvram_write(UINT32 data) +void akiko_device::nvram_write(uint32_t data) { m_i2c_scl_out = BIT(data, 31); m_i2c_sda_out = BIT(data, 30); @@ -252,9 +252,9 @@ void akiko_device::nvram_write(UINT32 data) m_sda_w(m_i2c_sda_out); } -UINT32 akiko_device::nvram_read() +uint32_t akiko_device::nvram_read() { - UINT32 v = 0; + uint32_t v = 0; if (m_i2c_scl_dir) v |= m_i2c_scl_out << 31; @@ -276,7 +276,7 @@ UINT32 akiko_device::nvram_read() * ************************************/ -void akiko_device::c2p_write(UINT32 data) +void akiko_device::c2p_write(uint32_t data) { m_c2p_input_buffer[m_c2p_input_index] = data; m_c2p_input_index++; @@ -284,9 +284,9 @@ void akiko_device::c2p_write(UINT32 data) m_c2p_output_index = 0; } -UINT32 akiko_device::c2p_read() +uint32_t akiko_device::c2p_read() { - UINT32 val; + uint32_t val; if ( m_c2p_output_index == 0 ) { @@ -354,7 +354,7 @@ void akiko_device::cdda_stop() } } -void akiko_device::cdda_play(UINT32 lba, UINT32 num_blocks) +void akiko_device::cdda_play(uint32_t lba, uint32_t num_blocks) { if (m_cdda != nullptr) { @@ -383,7 +383,7 @@ void akiko_device::cdda_pause(int pause) } } -UINT8 akiko_device::cdda_getstatus(UINT32 *lba) +uint8_t akiko_device::cdda_getstatus(uint32_t *lba) { if ( lba ) *lba = 0; @@ -411,7 +411,7 @@ UINT8 akiko_device::cdda_getstatus(UINT32 *lba) return 0x15; /* no audio status */ } -void akiko_device::set_cd_status(UINT32 status) +void akiko_device::set_cd_status(uint32_t status) { amiga_state *amiga = machine().driver_data(); @@ -432,7 +432,7 @@ TIMER_CALLBACK_MEMBER(akiko_device::frame_proc) if (m_cdda != nullptr) { - UINT8 s = cdda_getstatus(nullptr); + uint8_t s = cdda_getstatus(nullptr); if ( s == 0x11 ) { @@ -443,9 +443,9 @@ TIMER_CALLBACK_MEMBER(akiko_device::frame_proc) } } -static UINT32 lba_from_triplet( UINT8 *triplet ) +static uint32_t lba_from_triplet( uint8_t *triplet ) { - UINT32 r; + uint32_t r; r = bcd_2_dec(triplet[0]) * (60*75); r += bcd_2_dec(triplet[1]) * 75; @@ -456,7 +456,7 @@ static UINT32 lba_from_triplet( UINT8 *triplet ) TIMER_CALLBACK_MEMBER(akiko_device::dma_proc) { - UINT8 buf[2352]; + uint8_t buf[2352]; int index; if ( (m_cdrom_dmacontrol & 0x04000000) == 0 ) @@ -470,12 +470,12 @@ TIMER_CALLBACK_MEMBER(akiko_device::dma_proc) if ( m_cdrom_readreqmask & ( 1 << index ) ) { amiga_state *amiga = machine().driver_data(); - UINT32 track = cdrom_get_track( m_cdrom, m_cdrom_lba_cur ); - UINT32 datasize;// = cdrom_get_toc(m_cdrom)->tracks[track].datasize; - UINT32 subsize = cdrom_get_toc( m_cdrom )->tracks[track].subsize; + uint32_t track = cdrom_get_track( m_cdrom, m_cdrom_lba_cur ); + uint32_t datasize;// = cdrom_get_toc(m_cdrom)->tracks[track].datasize; + uint32_t subsize = cdrom_get_toc( m_cdrom )->tracks[track].subsize; int i; - UINT32 curmsf = lba_to_msf( m_cdrom_lba_cur ); + uint32_t curmsf = lba_to_msf( m_cdrom_lba_cur ); memset( buf, 0, 16 ); buf[3] = m_cdrom_lba_cur - m_cdrom_lba_start; @@ -506,7 +506,7 @@ TIMER_CALLBACK_MEMBER(akiko_device::dma_proc) for( i = 0; i < 2352; i += 2 ) { - UINT16 data; + uint16_t data; data = buf[i]; data <<= 8; @@ -542,11 +542,11 @@ void akiko_device::start_dma() m_dma_timer->adjust( attotime::from_usec( CD_SECTOR_TIME / m_cdrom_speed ) ); } -void akiko_device::setup_response( int len, UINT8 *r1 ) +void akiko_device::setup_response( int len, uint8_t *r1 ) { int resp_addr = m_cdrom_address[1]; - UINT8 resp_csum = 0xff; - UINT8 resp_buffer[32]; + uint8_t resp_csum = 0xff; + uint8_t resp_buffer[32]; int i; memset( resp_buffer, 0, sizeof( resp_buffer ) ); @@ -571,8 +571,8 @@ void akiko_device::setup_response( int len, UINT8 *r1 ) TIMER_CALLBACK_MEMBER( akiko_device::cd_delayed_cmd ) { - UINT8 resp[32]; - UINT8 cddastatus; + uint8_t resp[32]; + uint8_t cddastatus; if ( m_cdrom_status[0] & 0x10000000 ) return; @@ -612,14 +612,14 @@ TIMER_CALLBACK_MEMBER( akiko_device::cd_delayed_cmd ) void akiko_device::update_cdrom() { - UINT8 resp[32], cmdbuf[32]; + uint8_t resp[32], cmdbuf[32]; if ( m_cdrom_status[0] & 0x10000000 ) return; while ( m_cdrom_cmd_start != m_cdrom_cmd_end ) { - UINT32 cmd_addr = m_cdrom_address[1] + 0x200 + m_cdrom_cmd_start; + uint32_t cmd_addr = m_cdrom_address[1] + 0x200 + m_cdrom_cmd_start; int cmd = m_space->read_byte( cmd_addr ); memset( resp, 0, sizeof( resp ) ); @@ -658,7 +658,7 @@ void akiko_device::update_cdrom() else if ( cmd == 0x04 ) /* seek/read/play cd multi command */ { int i; - UINT32 startpos, endpos; + uint32_t startpos, endpos; for( i = 0; i < 13; i++ ) { @@ -728,7 +728,7 @@ void akiko_device::update_cdrom() } else if ( cmd == 0x06 ) /* read subq */ { - UINT32 lba; + uint32_t lba; resp[1] = 0x00; @@ -736,9 +736,9 @@ void akiko_device::update_cdrom() if ( lba > 0 ) { - UINT32 disk_pos; - UINT32 track_pos; - UINT32 track; + uint32_t disk_pos; + uint32_t track_pos; + uint32_t track; int addrctrl; track = cdrom_get_track(m_cdrom, lba); @@ -791,7 +791,7 @@ void akiko_device::update_cdrom() READ32_MEMBER( akiko_device::read ) { - UINT32 retval; + uint32_t retval; if ( LOG_AKIKO && offset < (0x30/4) ) { diff --git a/src/devices/machine/akiko.h b/src/devices/machine/akiko.h index 3fd1b586fb6..6b6ccc44fca 100644 --- a/src/devices/machine/akiko.h +++ b/src/devices/machine/akiko.h @@ -49,7 +49,7 @@ class akiko_device : public device_t { public: - akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~akiko_device() {} // callbacks @@ -83,10 +83,10 @@ private: address_space *m_space; // chunky to planar converter - UINT32 m_c2p_input_buffer[8]; - UINT32 m_c2p_output_buffer[8]; - UINT32 m_c2p_input_index; - UINT32 m_c2p_output_index; + uint32_t m_c2p_input_buffer[8]; + uint32_t m_c2p_output_buffer[8]; + uint32_t m_c2p_input_index; + uint32_t m_c2p_output_index; // i2c bus int m_i2c_scl_out; @@ -95,48 +95,48 @@ private: int m_i2c_sda_dir; // cdrom - UINT32 m_cdrom_status[2]; - UINT32 m_cdrom_address[2]; - UINT32 m_cdrom_track_index; - UINT32 m_cdrom_lba_start; - UINT32 m_cdrom_lba_end; - UINT32 m_cdrom_lba_cur; - UINT16 m_cdrom_readmask; - UINT16 m_cdrom_readreqmask; - UINT32 m_cdrom_dmacontrol; - UINT32 m_cdrom_numtracks; - UINT8 m_cdrom_speed; - UINT8 m_cdrom_cmd_start; - UINT8 m_cdrom_cmd_end; - UINT8 m_cdrom_cmd_resp; + uint32_t m_cdrom_status[2]; + uint32_t m_cdrom_address[2]; + uint32_t m_cdrom_track_index; + uint32_t m_cdrom_lba_start; + uint32_t m_cdrom_lba_end; + uint32_t m_cdrom_lba_cur; + uint16_t m_cdrom_readmask; + uint16_t m_cdrom_readreqmask; + uint32_t m_cdrom_dmacontrol; + uint32_t m_cdrom_numtracks; + uint8_t m_cdrom_speed; + uint8_t m_cdrom_cmd_start; + uint8_t m_cdrom_cmd_end; + uint8_t m_cdrom_cmd_resp; cdda_device *m_cdda; cdrom_file *m_cdrom; - std::unique_ptr m_cdrom_toc; + std::unique_ptr m_cdrom_toc; emu_timer *m_dma_timer; emu_timer *m_frame_timer; int m_cdrom_is_device; - void nvram_write(UINT32 data); - UINT32 nvram_read(); + void nvram_write(uint32_t data); + uint32_t nvram_read(); - void c2p_write(UINT32 data); - UINT32 c2p_read(); + void c2p_write(uint32_t data); + uint32_t c2p_read(); void cdda_stop(); - void cdda_play(UINT32 lba, UINT32 num_blocks); + void cdda_play(uint32_t lba, uint32_t num_blocks); void cdda_pause(int pause); - UINT8 cdda_getstatus(UINT32 *lba); - void set_cd_status(UINT32 status); + uint8_t cdda_getstatus(uint32_t *lba); + void set_cd_status(uint32_t status); TIMER_CALLBACK_MEMBER( frame_proc ); TIMER_CALLBACK_MEMBER( dma_proc ); void start_dma(); - void setup_response( int len, UINT8 *r1 ); + void setup_response( int len, uint8_t *r1 ); TIMER_CALLBACK_MEMBER( cd_delayed_cmd ); void update_cdrom(); diff --git a/src/devices/machine/am53cf96.cpp b/src/devices/machine/am53cf96.cpp index 595a38f985b..60bfe25ddb0 100644 --- a/src/devices/machine/am53cf96.cpp +++ b/src/devices/machine/am53cf96.cpp @@ -146,7 +146,7 @@ WRITE8_MEMBER( am53cf96_device::write ) } } -am53cf96_device::am53cf96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +am53cf96_device::am53cf96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : legacy_scsi_host_adapter(mconfig, AM53CF96, "53CF96 SCSI", tag, owner, clock, "am53cf96", __FILE__), m_irq_handler(*this) { @@ -174,7 +174,7 @@ void am53cf96_device::device_start() } // retrieve data from the SCSI controller -void am53cf96_device::dma_read_data(int bytes, UINT8 *pData) +void am53cf96_device::dma_read_data(int bytes, uint8_t *pData) { scsi_regs[REG_STATUS] |= 0x10; // indicate DMA finished @@ -182,7 +182,7 @@ void am53cf96_device::dma_read_data(int bytes, UINT8 *pData) } // write data to the SCSI controller -void am53cf96_device::dma_write_data(int bytes, UINT8 *pData) +void am53cf96_device::dma_write_data(int bytes, uint8_t *pData) { // int i; diff --git a/src/devices/machine/am53cf96.h b/src/devices/machine/am53cf96.h index 1c078d6e3f6..ec2697bab5b 100644 --- a/src/devices/machine/am53cf96.h +++ b/src/devices/machine/am53cf96.h @@ -41,7 +41,7 @@ class am53cf96_device : public legacy_scsi_host_adapter { public: // construction/destruction - am53cf96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + am53cf96_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); } @@ -49,8 +49,8 @@ public: DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); - void dma_read_data(int bytes, UINT8 *pData); - void dma_write_data(int bytes, UINT8 *pData); + void dma_read_data(int bytes, uint8_t *pData); + void dma_write_data(int bytes, uint8_t *pData); protected: // device-level overrides @@ -60,11 +60,11 @@ protected: private: static const device_timer_id TIMER_TRANSFER = 0; - UINT8 scsi_regs[32]; - UINT8 fifo[16]; - UINT8 fptr; - UINT8 xfer_state; - UINT8 last_id; + uint8_t scsi_regs[32]; + uint8_t fifo[16]; + uint8_t fptr; + uint8_t xfer_state; + uint8_t last_id; emu_timer* m_transfer_timer; devcb_write_line m_irq_handler; diff --git a/src/devices/machine/am9517a.cpp b/src/devices/machine/am9517a.cpp index 3465ee58b87..5b370560847 100644 --- a/src/devices/machine/am9517a.cpp +++ b/src/devices/machine/am9517a.cpp @@ -316,7 +316,7 @@ inline void am9517a_device::dma_write() switch (MODE_TRANSFER_MASK) { case MODE_TRANSFER_VERIFY: { - UINT8 v1 = m_in_memr_cb(offset); + uint8_t v1 = m_in_memr_cb(offset); if(0 && m_temp != v1) logerror("%s: verify error %02x vs. %02x\n", tag(), m_temp, v1); break; @@ -472,7 +472,7 @@ void am9517a_device::end_of_process() //------------------------------------------------- -am9517a_device::am9517a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +am9517a_device::am9517a_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__), device_execute_interface(mconfig, *this), m_icount(0), @@ -499,7 +499,7 @@ am9517a_device::am9517a_device(const machine_config &mconfig, device_type type, } -am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AM9517A, "AM9517A", tag, owner, clock, "am9517a", __FILE__), device_execute_interface(mconfig, *this), m_icount(0), @@ -526,12 +526,12 @@ am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, d { } -upd71071_v53_device::upd71071_v53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd71071_v53_device::upd71071_v53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : am9517a_device(mconfig, V53_DMAU, "V53 DMAU", tag, owner, clock, "v53_dmau") { } -pcxport_dmac_device::pcxport_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pcxport_dmac_device::pcxport_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : am9517a_device(mconfig, PCXPORT_DMAC, "PC Transporter DMAC", tag, owner, clock, "pcx_dmac") { } @@ -811,7 +811,7 @@ void am9517a_device::execute_run() READ8_MEMBER( am9517a_device::read ) { - UINT8 data = 0; + uint8_t data = 0; if (!BIT(offset, 3)) { @@ -1105,7 +1105,7 @@ void upd71071_v53_device::device_reset() READ8_MEMBER(upd71071_v53_device::read) { - UINT8 ret = 0; + uint8_t ret = 0; int channel = m_selected_channel; if (LOG) logerror("DMA: read from register %02x\n",offset); diff --git a/src/devices/machine/am9517a.h b/src/devices/machine/am9517a.h index 764f29e12c4..fd309c935e2 100644 --- a/src/devices/machine/am9517a.h +++ b/src/devices/machine/am9517a.h @@ -50,8 +50,8 @@ class am9517a_device : public device_t, public: // construction/destruction - am9517a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); - am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + am9517a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); + am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_hreq_callback(device_t &device, _Object object) { return downcast(device).m_out_hreq_cb.set_callback(object); } template static devcb_base &set_out_eop_callback(device_t &device, _Object object) { return downcast(device).m_out_eop_cb.set_callback(object); } @@ -95,15 +95,15 @@ protected: virtual void end_of_process(); int m_icount; - UINT32 m_address_mask; + uint32_t m_address_mask; struct { - UINT32 m_address; - UINT16 m_count; - UINT32 m_base_address; - UINT16 m_base_count; - UINT8 m_mode; + uint32_t m_address; + uint16_t m_count; + uint32_t m_base_address; + uint16_t m_base_count; + uint8_t m_mode; } m_channel[4]; int m_msb; @@ -114,11 +114,11 @@ protected: int m_state; int m_current_channel; int m_last_channel; - UINT8 m_command; - UINT8 m_mask; - UINT8 m_status; - UINT16 m_temp; - UINT8 m_request; + uint8_t m_command; + uint8_t m_mask; + uint8_t m_status; + uint16_t m_temp; + uint8_t m_request; private: inline void dma_request(int channel, int state); @@ -162,7 +162,7 @@ class upd71071_v53_device : public am9517a_device { public: // construction/destruction - upd71071_v53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd71071_v53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER( read ) override; virtual DECLARE_WRITE8_MEMBER( write ) override; @@ -174,7 +174,7 @@ protected: int m_selected_channel; int m_base; - UINT8 m_command_high; + uint8_t m_command_high; }; @@ -183,7 +183,7 @@ class pcxport_dmac_device : public am9517a_device { public: // construction/destruction - pcxport_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pcxport_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_reset() override; diff --git a/src/devices/machine/amigafdc.cpp b/src/devices/machine/amigafdc.cpp index d71b4f458dc..81f7efd2fb5 100644 --- a/src/devices/machine/amigafdc.cpp +++ b/src/devices/machine/amigafdc.cpp @@ -18,7 +18,7 @@ FLOPPY_FORMATS_MEMBER( amiga_fdc::floppy_formats ) FLOPPY_ADF_FORMAT FLOPPY_FORMATS_END -amiga_fdc::amiga_fdc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +amiga_fdc::amiga_fdc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AMIGA_FDC, "Amiga FDC", tag, owner, clock, "amiga_fdc", __FILE__), m_write_index(*this), floppy(nullptr), t_gen(nullptr), dsklen(0), pre_dsklen(0), dsksync(0), dskbyt(0), adkcon(0), dmacon(0), dskpt(0), dma_value(0), dma_state(0) { @@ -71,7 +71,7 @@ void amiga_fdc::dma_done() state->custom_chip_w(REG_INTREQ, INTENA_SETCLR | INTENA_DSKBLK); } -void amiga_fdc::dma_write(UINT16 value) +void amiga_fdc::dma_write(uint16_t value) { amiga_state *state = machine().driver_data(); state->chip_ram_w(dskpt, value); @@ -85,10 +85,10 @@ void amiga_fdc::dma_write(UINT16 value) dma_done(); } -UINT16 amiga_fdc::dma_read() +uint16_t amiga_fdc::dma_read() { amiga_state *state = machine().driver_data(); - UINT16 res = state->chip_ram_r(dskpt); + uint16_t res = state->chip_ram_r(dskpt); dskpt += 2; dsklen--; @@ -347,19 +347,19 @@ void amiga_fdc::dma_check() } -void amiga_fdc::adkcon_set(UINT16 data) +void amiga_fdc::adkcon_set(uint16_t data) { live_sync(); adkcon = data; live_run(); } -UINT16 amiga_fdc::adkcon_r(void) +uint16_t amiga_fdc::adkcon_r(void) { return adkcon; } -void amiga_fdc::dsklen_w(UINT16 data) +void amiga_fdc::dsklen_w(uint16_t data) { live_sync(); if(!(data & 0x8000) || (data == pre_dsklen)) { @@ -371,38 +371,38 @@ void amiga_fdc::dsklen_w(UINT16 data) live_run(); } -void amiga_fdc::dskpth_w(UINT16 data) +void amiga_fdc::dskpth_w(uint16_t data) { live_sync(); dskpt = (dskpt & 0xffff) | (data << 16); live_run(); } -void amiga_fdc::dskptl_w(UINT16 data) +void amiga_fdc::dskptl_w(uint16_t data) { live_sync(); dskpt = (dskpt & 0xffff0000) | data; live_run(); } -UINT16 amiga_fdc::dskpth_r() +uint16_t amiga_fdc::dskpth_r() { return dskpt >> 16; } -UINT16 amiga_fdc::dskptl_r() +uint16_t amiga_fdc::dskptl_r() { return dskpt; } -void amiga_fdc::dsksync_w(UINT16 data) +void amiga_fdc::dsksync_w(uint16_t data) { live_sync(); dsksync = data; live_run(); } -void amiga_fdc::dmacon_set(UINT16 data) +void amiga_fdc::dmacon_set(uint16_t data) { live_sync(); dmacon = data; @@ -410,9 +410,9 @@ void amiga_fdc::dmacon_set(UINT16 data) live_run(); } -UINT16 amiga_fdc::dskbytr_r() +uint16_t amiga_fdc::dskbytr_r() { - UINT16 res = dskbyt; + uint16_t res = dskbyt; dskbyt &= 0x7fff; return res; } @@ -484,9 +484,9 @@ WRITE8_MEMBER( amiga_fdc::ciaaprb_w ) live_run(); } -UINT8 amiga_fdc::ciaapra_r() +uint8_t amiga_fdc::ciaapra_r() { - UINT8 ret = 0x3c; + uint8_t ret = 0x3c; if(floppy) { //if(!floppy->ready_r()) fixit: seems to not work well with multiple disk drives ret &= ~0x20; @@ -538,7 +538,7 @@ int amiga_fdc::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, co if(transition_time == 0xffff && !when.is_never() && etime >= when) transition_time = counter; if(slot < 8) { - UINT8 mask = 1 << slot; + uint8_t mask = 1 << slot; if(phase_add & mask) counter += 258; else if(phase_sub & mask) @@ -562,15 +562,15 @@ int amiga_fdc::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, co int bit = transition_time != 0xffff; if(transition_time != 0xffff) { - static const UINT8 pha[8] = { 0xf, 0x7, 0x3, 0x1, 0, 0, 0, 0 }; - static const UINT8 phs[8] = { 0, 0, 0, 0, 0x1, 0x3, 0x7, 0xf }; - static const UINT8 freqa[4][8] = { + static const uint8_t pha[8] = { 0xf, 0x7, 0x3, 0x1, 0, 0, 0, 0 }; + static const uint8_t phs[8] = { 0, 0, 0, 0, 0x1, 0x3, 0x7, 0xf }; + static const uint8_t freqa[4][8] = { { 0xf, 0x7, 0x3, 0x1, 0, 0, 0, 0 }, { 0x7, 0x3, 0x1, 0, 0, 0, 0, 0 }, { 0x7, 0x3, 0x1, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0 } }; - static const UINT8 freqs[4][8] = { + static const uint8_t freqs[4][8] = { { 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0x1, 0x3, 0x7 }, { 0, 0, 0, 0, 0, 0x1, 0x3, 0x7 }, @@ -624,7 +624,7 @@ bool amiga_fdc::pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_devic attotime etime = ctime+delays[slot]; if(etime > limit) return true; - UINT16 pre_counter = counter; + uint16_t pre_counter = counter; counter += increment; if(bit && !(pre_counter & 0x400) && (counter & 0x400)) if(write_position < ARRAY_LENGTH(write_buffer)) diff --git a/src/devices/machine/amigafdc.h b/src/devices/machine/amigafdc.h index 2cef736e6cf..3a91a50ea15 100644 --- a/src/devices/machine/amigafdc.h +++ b/src/devices/machine/amigafdc.h @@ -11,24 +11,24 @@ class amiga_fdc : public device_t { public: - amiga_fdc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amiga_fdc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_index_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_index.set_callback(object); } DECLARE_WRITE8_MEMBER(ciaaprb_w); - UINT8 ciaapra_r(); - UINT16 dskbytr_r(); - UINT16 dskpth_r(); - UINT16 dskptl_r(); + uint8_t ciaapra_r(); + uint16_t dskbytr_r(); + uint16_t dskpth_r(); + uint16_t dskptl_r(); - void dsksync_w(UINT16 data); - void dskpth_w(UINT16 data); - void dskptl_w(UINT16 data); - void dsklen_w(UINT16 data); - void adkcon_set(UINT16 data); - void dmacon_set(UINT16 data); - UINT16 adkcon_r(void); + void dsksync_w(uint16_t data); + void dskpth_w(uint16_t data); + void dskptl_w(uint16_t data); + void dsklen_w(uint16_t data); + void adkcon_set(uint16_t data); + void dmacon_set(uint16_t data); + uint16_t adkcon_r(void); DECLARE_FLOPPY_FORMATS( floppy_formats ); @@ -54,12 +54,12 @@ private: }; struct pll_t { - UINT16 counter; - UINT16 increment; - UINT16 transition_time; - UINT8 history; - UINT8 slot; - UINT8 phase_add, phase_sub, freq_add, freq_sub; + uint16_t counter; + uint16_t increment; + uint16_t transition_time; + uint8_t history; + uint8_t slot; + uint8_t phase_add, phase_sub, freq_add, freq_sub; attotime ctime; attotime delays[38]; @@ -80,7 +80,7 @@ private: struct live_info { attotime tm; int state, next_state; - UINT16 shift_reg; + uint16_t shift_reg; int bit_counter; pll_t pll; }; @@ -93,9 +93,9 @@ private: live_info cur_live, checkpoint_live; emu_timer *t_gen; - UINT16 dsklen, pre_dsklen, dsksync, dskbyt, adkcon, dmacon; - UINT32 dskpt; - UINT16 dma_value; + uint16_t dsklen, pre_dsklen, dsksync, dskbyt, adkcon, dmacon; + uint32_t dskpt; + uint16_t dma_value; int dma_state; @@ -104,8 +104,8 @@ private: bool dma_enabled(); void dma_check(); void dma_done(); - void dma_write(UINT16 value); - UINT16 dma_read(); + void dma_write(uint16_t value); + uint16_t dma_read(); void live_start(); void checkpoint(); diff --git a/src/devices/machine/appldriv.cpp b/src/devices/machine/appldriv.cpp index c5b86d071e2..43fc944eb6c 100644 --- a/src/devices/machine/appldriv.cpp +++ b/src/devices/machine/appldriv.cpp @@ -124,10 +124,10 @@ static void apple525_seek_disk(apple525_floppy_image_device *img, signed int ste disk->tween_tracks = 0; } -static void apple525_disk_set_lines(device_t *device,device_t *image, UINT8 new_state) +static void apple525_disk_set_lines(device_t *device,device_t *image, uint8_t new_state) { apple525_floppy_image_device *cur_disk; - UINT8 old_state; + uint8_t old_state; unsigned int phase; cur_disk = get_device(image); @@ -174,7 +174,7 @@ int apple525_get_count(device_t *device) return cnt; } -void apple525_set_lines(device_t *device, UINT8 lines) +void apple525_set_lines(device_t *device, uint8_t lines) { int i, count; device_t *image; @@ -192,9 +192,9 @@ void apple525_set_lines(device_t *device, UINT8 lines) } /* reads/writes a byte; write_value is -1 for read only */ -static UINT8 apple525_process_byte(device_t *img, int write_value) +static uint8_t apple525_process_byte(device_t *img, int write_value) { - UINT8 read_value; + uint8_t read_value; apple525_floppy_image_device *disk; int spinfract_divisor; int spinfract_dividend; @@ -256,14 +256,14 @@ static device_t *apple525_selected_image(device_t *device) return nullptr; } -UINT8 apple525_read_data(device_t *device) +uint8_t apple525_read_data(device_t *device) { device_t *image; image = apple525_selected_image(device); return image ? apple525_process_byte(image, -1) : 0xFF; } -void apple525_write_data(device_t *device,UINT8 data) +void apple525_write_data(device_t *device,uint8_t data) { device_t *image; image = apple525_selected_image(device); @@ -297,7 +297,7 @@ const device_type FLOPPY_APPLE = &device_creator; // apple525_floppy_image_device - constructor //------------------------------------------------- -apple525_floppy_image_device::apple525_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apple525_floppy_image_device::apple525_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : legacy_floppy_image_device(mconfig, FLOPPY_APPLE, "Apple Disk II", tag, owner, clock, "floppy_apple", __FILE__) { } diff --git a/src/devices/machine/appldriv.h b/src/devices/machine/appldriv.h index b98d63f7748..1725c1a5814 100644 --- a/src/devices/machine/appldriv.h +++ b/src/devices/machine/appldriv.h @@ -15,11 +15,11 @@ #include "imagedev/flopdrv.h" #include "formats/ap2_dsk.h" -void apple525_set_lines(device_t *device,UINT8 lines); +void apple525_set_lines(device_t *device,uint8_t lines); void apple525_set_enable_lines(device_t *device,int enable_mask); -UINT8 apple525_read_data(device_t *device); -void apple525_write_data(device_t *device,UINT8 data); +uint8_t apple525_read_data(device_t *device); +void apple525_write_data(device_t *device,uint8_t data); int apple525_read_status(device_t *device); int apple525_get_count(running_machine &machine); @@ -27,7 +27,7 @@ class apple525_floppy_image_device : public legacy_floppy_image_device { public: // construction/destruction - apple525_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apple525_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual image_init_result call_load() override; virtual void call_unload() override; @@ -43,7 +43,7 @@ public: unsigned int track_dirty : 1; int position; int spin_count; /* simulate drive spin to fool RWTS test at $BD34 */ - UINT8 track_data[APPLE2_NIBBLE_SIZE * APPLE2_SECTOR_COUNT]; + uint8_t track_data[APPLE2_NIBBLE_SIZE * APPLE2_SECTOR_COUNT]; protected: virtual void device_start() override; diff --git a/src/devices/machine/applefdc.cpp b/src/devices/machine/applefdc.cpp index 06bf5cba948..56ea8288fe3 100644 --- a/src/devices/machine/applefdc.cpp +++ b/src/devices/machine/applefdc.cpp @@ -105,7 +105,7 @@ enum // ctor //------------------------------------------------- -applefdc_base_device::applefdc_base_device(applefdc_base_device::applefdc_t fdc_type, const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +applefdc_base_device::applefdc_base_device(applefdc_base_device::applefdc_t fdc_type, 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_type(fdc_type), m_interface(nullptr) @@ -199,7 +199,7 @@ int applefdc_base_device::iwm_enable2() // iwm_readenable2handshake - hackish function //------------------------------------------------- -UINT8 applefdc_base_device::iwm_readenable2handshake() +uint8_t applefdc_base_device::iwm_readenable2handshake() { /* R. Nabet : This function looks more like a hack than a real feature of the IWM; */ /* it is not called from the Mac Plus driver */ @@ -214,9 +214,9 @@ UINT8 applefdc_base_device::iwm_readenable2handshake() // statusreg_r - reads the status register //------------------------------------------------- -UINT8 applefdc_base_device::statusreg_r() +uint8_t applefdc_base_device::statusreg_r() { - UINT8 result; + uint8_t result; int status; const applefdc_interface *intf = get_interface(); @@ -243,7 +243,7 @@ UINT8 applefdc_base_device::statusreg_r() // iwm_modereg_w - changes the mode register //------------------------------------------------- -void applefdc_base_device::iwm_modereg_w(UINT8 data) +void applefdc_base_device::iwm_modereg_w(uint8_t data) { m_mode = data & 0x1f; /* write mode register */ @@ -257,10 +257,10 @@ void applefdc_base_device::iwm_modereg_w(UINT8 data) // read_reg - reads a register //------------------------------------------------- -UINT8 applefdc_base_device::read_reg(int lines) +uint8_t applefdc_base_device::read_reg(int lines) { const applefdc_interface *intf = get_interface(); - UINT8 result = 0; + uint8_t result = 0; switch(lines) { @@ -308,7 +308,7 @@ UINT8 applefdc_base_device::read_reg(int lines) // write_reg - writes a register //------------------------------------------------- -void applefdc_base_device::write_reg(UINT8 data) +void applefdc_base_device::write_reg(uint8_t data) { const applefdc_interface *intf = get_interface(); @@ -441,10 +441,10 @@ void applefdc_base_device::iwm_access(int offset) // read - reads a byte from the FDC //------------------------------------------------- -UINT8 applefdc_base_device::read(UINT8 offset) +uint8_t applefdc_base_device::read(uint8_t offset) { const applefdc_interface *intf = get_interface(); - UINT8 result = 0; + uint8_t result = 0; // normalize offset offset &= 0xf; @@ -504,7 +504,7 @@ UINT8 applefdc_base_device::read(UINT8 offset) // write - writes a byte to the FDC //------------------------------------------------- -void applefdc_base_device::write(UINT8 offset, UINT8 data) +void applefdc_base_device::write(uint8_t offset, uint8_t data) { const applefdc_interface *intf = get_interface(); @@ -553,7 +553,7 @@ void applefdc_base_device::write(UINT8 offset, UINT8 data) // get_lines - accessor //------------------------------------------------- -UINT8 applefdc_base_device::get_lines() +uint8_t applefdc_base_device::get_lines() { return m_lines & 0x0f; } @@ -566,7 +566,7 @@ UINT8 applefdc_base_device::get_lines() const device_type APPLEFDC = &device_creator; -applefdc_device::applefdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +applefdc_device::applefdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : applefdc_base_device(APPLEFDC_APPLE2, mconfig, APPLEFDC, "Apple FDC", tag, owner, clock, "apple_fdc", __FILE__) { } @@ -579,7 +579,7 @@ applefdc_device::applefdc_device(const machine_config &mconfig, const char *tag, const device_type IWM = &device_creator; -iwm_device::iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iwm_device::iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : applefdc_base_device(APPLEFDC_IWM, mconfig, IWM, "Apple IWM (Integrated Woz Machine)", tag, owner, clock, "iwm", __FILE__) { } diff --git a/src/devices/machine/applefdc.h b/src/devices/machine/applefdc.h index 7a105b777a1..872e69031ba 100644 --- a/src/devices/machine/applefdc.h +++ b/src/devices/machine/applefdc.h @@ -42,11 +42,11 @@ extern const device_type SWIM; struct applefdc_interface { - void (*set_lines)(device_t *device, UINT8 lines); + void (*set_lines)(device_t *device, uint8_t lines); void (*set_enable_lines)(device_t *device, int enable_mask); - UINT8 (*read_data)(device_t *device); - void (*write_data)(device_t *device, UINT8 data); + uint8_t (*read_data)(device_t *device); + void (*write_data)(device_t *device, uint8_t data); int (*read_status)(device_t *device); }; @@ -63,17 +63,17 @@ public: static void static_set_config(device_t &device, const applefdc_interface *intrf) { downcast(device).m_interface = intrf; } // read/write handlers - virtual UINT8 read(UINT8 offset); - virtual void write(UINT8 offset, UINT8 data); + virtual uint8_t read(uint8_t offset); + virtual void write(uint8_t offset, uint8_t data); // read/write handlers overloads - UINT8 read(offs_t offset) { return read((UINT8) offset); } - void write(offs_t offset, UINT8 data) { write((UINT8) offset, data); } - DECLARE_READ8_MEMBER( read ) { return read((UINT8) offset); } - DECLARE_WRITE8_MEMBER( write ) { write((UINT8) offset, data); } + uint8_t read(offs_t offset) { return read((uint8_t) offset); } + void write(offs_t offset, uint8_t data) { write((uint8_t) offset, data); } + DECLARE_READ8_MEMBER( read ) { return read((uint8_t) offset); } + DECLARE_WRITE8_MEMBER( write ) { write((uint8_t) offset, data); } // accessor - UINT8 get_lines(); + uint8_t get_lines(); protected: enum applefdc_t @@ -84,7 +84,7 @@ protected: }; // constructor - applefdc_base_device(applefdc_t fdc_type, const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + applefdc_base_device(applefdc_t fdc_type, 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-level overrides virtual void device_start() override; @@ -92,7 +92,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // other protecteds - virtual void iwm_modereg_w(UINT8 data); + virtual void iwm_modereg_w(uint8_t data); private: // data that is constant for the lifetime of the emulation @@ -101,18 +101,18 @@ private: const applefdc_interface *m_interface; // data that changes at emulation time - UINT8 m_write_byte; - UINT8 m_lines; /* flags from IWM_MOTOR - IWM_Q7 */ - UINT8 m_mode; /* 0-31; see above */ - UINT8 m_handshake_hack; /* not sure what this is for */ + uint8_t m_write_byte; + uint8_t m_lines; /* flags from IWM_MOTOR - IWM_Q7 */ + uint8_t m_mode; /* 0-31; see above */ + uint8_t m_handshake_hack; /* not sure what this is for */ // functions const applefdc_interface *get_interface(); int iwm_enable2(); - UINT8 iwm_readenable2handshake(); - UINT8 statusreg_r(); - UINT8 read_reg(int lines); - void write_reg(UINT8 data); + uint8_t iwm_readenable2handshake(); + uint8_t statusreg_r(); + uint8_t read_reg(int lines); + void write_reg(uint8_t data); void turn_motor_onoff(bool status); void iwm_access(int offset); }; @@ -126,7 +126,7 @@ private: class applefdc_device : public applefdc_base_device { public: - applefdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + applefdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -138,7 +138,7 @@ public: class iwm_device : public applefdc_base_device { public: - iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/machine/at28c16.cpp b/src/devices/machine/at28c16.cpp index bc6900924eb..1169ad3b468 100644 --- a/src/devices/machine/at28c16.cpp +++ b/src/devices/machine/at28c16.cpp @@ -39,7 +39,7 @@ const device_type AT28C16 = &device_creator; // at28c16_device - constructor //------------------------------------------------- -at28c16_device::at28c16_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +at28c16_device::at28c16_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t(mconfig, AT28C16, "AT28C16", tag, owner, clock, "at28c16", __FILE__), device_memory_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -114,7 +114,7 @@ void at28c16_device::device_reset() void at28c16_device::nvram_default() { - UINT16 default_value = 0xff; + uint16_t default_value = 0xff; for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ ) { space(AS_PROGRAM).write_byte( offs, default_value ); @@ -136,7 +136,7 @@ void at28c16_device::nvram_default() void at28c16_device::nvram_read( emu_file &file ) { - std::vector buffer( AT28C16_TOTAL_BYTES ); + std::vector buffer( AT28C16_TOTAL_BYTES ); file.read( &buffer[0], AT28C16_TOTAL_BYTES ); @@ -153,7 +153,7 @@ void at28c16_device::nvram_read( emu_file &file ) void at28c16_device::nvram_write( emu_file &file ) { - std::vector buffer ( AT28C16_TOTAL_BYTES ); + std::vector buffer ( AT28C16_TOTAL_BYTES ); for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ ) { @@ -211,7 +211,7 @@ READ8_MEMBER( at28c16_device::read ) { if( m_last_write >= 0 ) { - UINT8 data = m_last_write ^ 0x80; + uint8_t data = m_last_write ^ 0x80; // logerror( "%s: AT28C16: read( %04x ) write status %02x\n", machine.describe_context(), offset, data ); return data; } @@ -222,7 +222,7 @@ READ8_MEMBER( at28c16_device::read ) offset += AT28C16_ID_BYTES; } - UINT8 data = this->space(AS_PROGRAM).read_byte( offset ); + uint8_t data = this->space(AS_PROGRAM).read_byte( offset ); // logerror( "%s: AT28C16: read( %04x ) data %02x\n", machine.describe_context(), offset, data ); return data; } diff --git a/src/devices/machine/at28c16.h b/src/devices/machine/at28c16.h index c33f92785e8..9cbbfdaca17 100644 --- a/src/devices/machine/at28c16.h +++ b/src/devices/machine/at28c16.h @@ -35,7 +35,7 @@ class at28c16_device : { public: // construction/destruction - at28c16_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ); + at28c16_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); // I/O operations DECLARE_WRITE8_MEMBER( write ); @@ -65,7 +65,7 @@ protected: int m_a9_12v; int m_oe_12v; int m_last_write; - optional_region_ptr m_default_data; + optional_region_ptr m_default_data; }; diff --git a/src/devices/machine/at29x.cpp b/src/devices/machine/at29x.cpp index bb2bdd8b8b9..0842a32a7dc 100644 --- a/src/devices/machine/at29x.cpp +++ b/src/devices/machine/at29x.cpp @@ -54,7 +54,7 @@ enum Constructor for all variants */ -at29x_device::at29x_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) +at29x_device::at29x_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_nvram_interface(mconfig, *this), m_memory_size(0), // bytes @@ -70,7 +70,7 @@ at29x_device::at29x_device(const machine_config &mconfig, device_type type, cons /* Constructor for AT29C020 */ -at29c020_device::at29c020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +at29c020_device::at29c020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : at29x_device(mconfig, AT29C020, "ATMEL 29C020 256K x 8 FEEPROM", tag, owner, clock, "at29c020", __FILE__) { m_memory_size = 256*1024; @@ -81,7 +81,7 @@ at29c020_device::at29c020_device(const machine_config &mconfig, const char *tag, /* Constructor for AT29C040 */ -at29c040_device::at29c040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +at29c040_device::at29c040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : at29x_device(mconfig, AT29C040, "ATMEL 29C040 512K x 8 FEEPROM", tag, owner, clock, "at29c040", __FILE__) { m_memory_size = 512*1024; @@ -92,7 +92,7 @@ at29c040_device::at29c040_device(const machine_config &mconfig, const char *tag, /* Constructor for AT29C040A */ -at29c040a_device::at29c040a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +at29c040a_device::at29c040a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : at29x_device(mconfig, AT29C040A, "ATMEL 29C040A 512K x 8 FEEPROM", tag, owner, clock, "at29c040a", __FILE__) { m_memory_size = 512*1024; @@ -479,8 +479,8 @@ WRITE8_MEMBER( at29x_device::write ) void at29x_device::device_start(void) { - m_programming_buffer = std::make_unique(m_sector_size); - m_eememory = std::make_unique(m_memory_size+2); + m_programming_buffer = std::make_unique(m_sector_size); + m_eememory = std::make_unique(m_memory_size+2); m_programming_timer = timer_alloc(PRGTIMER); // TODO: Complete 16-bit handling diff --git a/src/devices/machine/at29x.h b/src/devices/machine/at29x.h index 924a17e0f70..ca37c31b0db 100644 --- a/src/devices/machine/at29x.h +++ b/src/devices/machine/at29x.h @@ -34,7 +34,7 @@ enum s_pgm_t class at29x_device : public device_t, public device_nvram_interface { public: - at29x_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); + at29x_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); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -63,7 +63,7 @@ protected: private: void sync_flags(void); - std::unique_ptr m_eememory; + std::unique_ptr m_eememory; bool m_lower_bbl; // set when lower boot block lockout is enabled bool m_higher_bbl; // set when upper boot block lockout is enabled @@ -78,7 +78,7 @@ private: bool m_disabling_sdb; // set when a sdp disable command is in progress bool m_toggle_bit; // indicates flashing in progress (toggles for each query) - std::unique_ptr m_programming_buffer; + std::unique_ptr m_programming_buffer; int m_programming_last_offset; emu_timer* m_programming_timer; }; @@ -89,19 +89,19 @@ private: class at29c020_device : public at29x_device { public: - at29c020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + at29c020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class at29c040_device : public at29x_device { public: - at29c040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + at29c040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class at29c040a_device : public at29x_device { public: - at29c040a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + at29c040a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; #define MCFG_AT29C020_ADD(_tag ) \ diff --git a/src/devices/machine/at45dbxx.cpp b/src/devices/machine/at45dbxx.cpp index 8b127986679..13255b298e0 100644 --- a/src/devices/machine/at45dbxx.cpp +++ b/src/devices/machine/at45dbxx.cpp @@ -45,7 +45,7 @@ const device_type AT45DB161 = &device_creator; // at45db041_device - constructor //------------------------------------------------- -at45db041_device::at45db041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +at45db041_device::at45db041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AT45DB041, "AT45DB041", tag, owner, clock, "at45db041", __FILE__), device_nvram_interface(mconfig, *this), write_so(*this) @@ -53,7 +53,7 @@ at45db041_device::at45db041_device(const machine_config &mconfig, const char *ta } -at45db041_device::at45db041_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) +at45db041_device::at45db041_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_nvram_interface(mconfig, *this), write_so(*this) @@ -61,13 +61,13 @@ at45db041_device::at45db041_device(const machine_config &mconfig, device_type ty } -at45db081_device::at45db081_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +at45db081_device::at45db081_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : at45db041_device(mconfig, AT45DB081, "AT45DB081", tag, owner, clock, "at45db081", __FILE__) { } -at45db161_device::at45db161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +at45db161_device::at45db161_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : at45db041_device(mconfig, AT45DB161, "AT45DB161", tag, owner, clock, "at45db161", __FILE__) { } @@ -147,7 +147,7 @@ void at45db041_device::nvram_default() memory_region *region = memregion(DEVICE_SELF); if (region != nullptr) { - UINT32 bytes = region->bytes(); + uint32_t bytes = region->bytes(); if (bytes > m_size) bytes = m_size; @@ -175,9 +175,9 @@ void at45db041_device::nvram_write(emu_file &file) file.write(&m_data[0], m_size); } -UINT8 at45db041_device::read_byte() +uint8_t at45db041_device::read_byte() { - UINT8 data; + uint8_t data; // check mode if ((m_mode != FLASH_MODE_SO) || (!m_io.data)) return 0; // read byte @@ -187,46 +187,46 @@ UINT8 at45db041_device::read_byte() return data; } -void at45db041_device::flash_set_io(UINT8* data, UINT32 size, UINT32 pos) +void at45db041_device::flash_set_io(uint8_t* data, uint32_t size, uint32_t pos) { m_io.data = data; m_io.size = size; m_io.pos = pos; } -UINT32 at45db041_device::flash_get_page_addr() +uint32_t at45db041_device::flash_get_page_addr() { return ((m_cmd.data[1] & 0x0F) << 7) | ((m_cmd.data[2] & 0xFE) >> 1); } -UINT32 at45db041_device::flash_get_byte_addr() +uint32_t at45db041_device::flash_get_byte_addr() { return ((m_cmd.data[2] & 0x01) << 8) | ((m_cmd.data[3] & 0xFF) >> 0); } -UINT32 at45db081_device::flash_get_page_addr() +uint32_t at45db081_device::flash_get_page_addr() { return ((m_cmd.data[1] & 0x1F) << 7) | ((m_cmd.data[2] & 0xFE) >> 1); } -UINT32 at45db161_device::flash_get_page_addr() +uint32_t at45db161_device::flash_get_page_addr() { return ((m_cmd.data[1] & 0x3F) << 6) | ((m_cmd.data[2] & 0xFC) >> 2); } -UINT32 at45db161_device::flash_get_byte_addr() +uint32_t at45db161_device::flash_get_byte_addr() { return ((m_cmd.data[2] & 0x03) << 8) | ((m_cmd.data[3] & 0xFF) >> 0); } -void at45db041_device::write_byte(UINT8 data) +void at45db041_device::write_byte(uint8_t data) { // check mode if (m_mode != FLASH_MODE_SI) return; // process byte if (m_cmd.size < 8) { - UINT8 opcode; + uint8_t opcode; _logerror( 2, ("at45dbxx_write_byte (%02X)\n", data)); // add to command buffer m_cmd.data[m_cmd.size++] = data; @@ -254,8 +254,8 @@ void at45db041_device::write_byte(UINT8 data) // 8 bits command + 4 bits reserved + 11 bits page address + 9 bits don't care if (m_cmd.size == 4) { - UINT32 page; - UINT8 comp; + uint32_t page; + uint8_t comp; page = flash_get_page_addr(); _logerror( 1, ("at45dbxx opcode %02X - main memory page to buffer 1 compare [%04X]\n", opcode, page)); comp = memcmp( &m_data[page * page_size()], &m_buffer1[0], page_size()) == 0 ? 0 : 1; @@ -272,7 +272,7 @@ void at45db041_device::write_byte(UINT8 data) // 8 bits command + 4 bits reserved + 11 bits page address + 9 bits buffer address + 32 bits don't care if (m_cmd.size == 8) { - UINT32 page, byte; + uint32_t page, byte; page = flash_get_page_addr(); byte = flash_get_byte_addr(); _logerror( 1, ("at45dbxx opcode %02X - main memory page read [%04X/%04X]\n", opcode, page, byte)); @@ -288,7 +288,7 @@ void at45db041_device::write_byte(UINT8 data) // 8 bits command + 4 bits reserved + 11 bits page address + 9 bits buffer address if (m_cmd.size == 4) { - UINT32 page, byte; + uint32_t page, byte; page = flash_get_page_addr(); byte = flash_get_byte_addr(); _logerror( 1, ("at45dbxx opcode %02X - main memory page program through buffer 1 [%04X/%04X]\n",opcode, page, byte)); @@ -341,7 +341,7 @@ WRITE_LINE_MEMBER(at45db041_device::cs_w) // complete program command if ((m_cmd.size >= 4) && (m_cmd.data[0] == FLASH_CMD_82)) { - UINT32 page, byte; + uint32_t page, byte; page = flash_get_page_addr(); byte = flash_get_byte_addr(); _logerror( 1, ("at45dbxx - program data stored in buffer 1 into selected page in main memory [%04X/%04X]\n", page, byte)); diff --git a/src/devices/machine/at45dbxx.h b/src/devices/machine/at45dbxx.h index 449d95f9651..85425cd1ded 100644 --- a/src/devices/machine/at45dbxx.h +++ b/src/devices/machine/at45dbxx.h @@ -41,15 +41,15 @@ class at45db041_device : public device_t, public device_nvram_interface { public: - at45db041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - at45db041_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); + at45db041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + at45db041_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); DECLARE_WRITE_LINE_MEMBER(cs_w); DECLARE_WRITE_LINE_MEMBER(sck_w); DECLARE_WRITE_LINE_MEMBER(si_w); DECLARE_READ_LINE_MEMBER(so_r); - UINT8 *get_ptr() { return &m_data[0]; } + uint8_t *get_ptr() { return &m_data[0]; } template static devcb_base &set_so_cb(device_t &device, _Object object) { return downcast(device).write_so.set_callback(object); } devcb_write_line write_so; @@ -67,25 +67,25 @@ protected: protected: virtual int num_pages() const { return 2048; } virtual int page_size() const { return 264; } - virtual UINT8 device_id() const { return 0x18; } + virtual uint8_t device_id() const { return 0x18; } - UINT8 read_byte(); - void flash_set_io(UINT8* data, UINT32 size, UINT32 pos); - virtual UINT32 flash_get_page_addr(); - virtual UINT32 flash_get_byte_addr(); - void write_byte(UINT8 data); + uint8_t read_byte(); + void flash_set_io(uint8_t* data, uint32_t size, uint32_t pos); + virtual uint32_t flash_get_page_addr(); + virtual uint32_t flash_get_byte_addr(); + void write_byte(uint8_t data); // internal state - std::vector m_data; - UINT32 m_size; - UINT8 m_mode; - UINT8 m_status; - std::vector m_buffer1; - //std::vector m_buffer2; - UINT8 m_si_byte; - UINT8 m_si_bits; - UINT8 m_so_byte; - UINT8 m_so_bits; + std::vector m_data; + uint32_t m_size; + uint8_t m_mode; + uint8_t m_status; + std::vector m_buffer1; + //std::vector m_buffer2; + uint8_t m_si_byte; + uint8_t m_si_bits; + uint8_t m_so_byte; + uint8_t m_so_bits; struct AT45DBXX_PINS { @@ -100,15 +100,15 @@ protected: struct AT45DBXX_IO { - UINT8 *data; - UINT32 size; - UINT32 pos; + uint8_t *data; + uint32_t size; + uint32_t pos; } m_io; struct AT45DBXX_CMD { - UINT8 data[8]; - UINT8 size; + uint8_t data[8]; + uint8_t size; } m_cmd; }; @@ -117,14 +117,14 @@ protected: class at45db081_device : public at45db041_device { public: - at45db081_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + at45db081_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int num_pages() const override { return 4096; } virtual int page_size() const override { return 264; } - virtual UINT8 device_id() const override { return 0x20; } + virtual uint8_t device_id() const override { return 0x20; } - virtual UINT32 flash_get_page_addr() override; + virtual uint32_t flash_get_page_addr() override; }; // ======================> at45db161_device @@ -132,15 +132,15 @@ protected: class at45db161_device : public at45db041_device { public: - at45db161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + at45db161_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int num_pages() const override { return 4096; } virtual int page_size() const override { return 528; } - virtual UINT8 device_id() const override { return 0x28; } + virtual uint8_t device_id() const override { return 0x28; } - virtual UINT32 flash_get_page_addr() override; - virtual UINT32 flash_get_byte_addr() override; + virtual uint32_t flash_get_page_addr() override; + virtual uint32_t flash_get_byte_addr() override; }; diff --git a/src/devices/machine/at_keybc.cpp b/src/devices/machine/at_keybc.cpp index f6e5b76283c..56b3907e638 100644 --- a/src/devices/machine/at_keybc.cpp +++ b/src/devices/machine/at_keybc.cpp @@ -58,7 +58,7 @@ ROM_END // at_keyboard_controller_device - constructor //------------------------------------------------- -at_keyboard_controller_device::at_keyboard_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +at_keyboard_controller_device::at_keyboard_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AT_KEYBOARD_CONTROLLER, "AT Keyboard Controller", tag, owner, clock, "at_keybc", __FILE__), m_cpu(nullptr), m_system_reset_cb(*this), diff --git a/src/devices/machine/at_keybc.h b/src/devices/machine/at_keybc.h index 5854f0f4f5d..591b43f9d89 100644 --- a/src/devices/machine/at_keybc.h +++ b/src/devices/machine/at_keybc.h @@ -47,7 +47,7 @@ class at_keyboard_controller_device : public device_t { public: // construction/destruction - at_keyboard_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + at_keyboard_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_system_reset_callback(device_t &device, _Object object) { return downcast(device).m_system_reset_cb.set_callback(object); } template static devcb_base &set_gate_a20_callback(device_t &device, _Object object) { return downcast(device).m_gate_a20_cb.set_callback(object); } @@ -96,8 +96,8 @@ private: devcb_write_line m_keyboard_clock_cb; devcb_write_line m_keyboard_data_cb; - UINT8 m_clock_signal; - UINT8 m_data_signal; + uint8_t m_clock_signal; + uint8_t m_data_signal; }; diff --git a/src/devices/machine/atadev.h b/src/devices/machine/atadev.h index 3b96a6b580c..d889bc8f346 100644 --- a/src/devices/machine/atadev.h +++ b/src/devices/machine/atadev.h @@ -23,11 +23,11 @@ public: ata_device_interface(const machine_config &mconfig, device_t &device); virtual ~ata_device_interface() {} - virtual UINT16 read_dma() = 0; + virtual uint16_t read_dma() = 0; virtual DECLARE_READ16_MEMBER(read_cs0) = 0; virtual DECLARE_READ16_MEMBER(read_cs1) = 0; - virtual void write_dma(UINT16 data) = 0; + virtual void write_dma(uint16_t data) = 0; virtual DECLARE_WRITE16_MEMBER(write_cs0) = 0; virtual DECLARE_WRITE16_MEMBER(write_cs1) = 0; virtual DECLARE_WRITE_LINE_MEMBER(write_dmack) = 0; diff --git a/src/devices/machine/ataflash.cpp b/src/devices/machine/ataflash.cpp index a7491f1eb1e..7ff624a5421 100644 --- a/src/devices/machine/ataflash.cpp +++ b/src/devices/machine/ataflash.cpp @@ -8,7 +8,7 @@ const device_type ATA_FLASH_PCCARD = &device_creator; -ata_flash_pccard_device::ata_flash_pccard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ata_flash_pccard_device::ata_flash_pccard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ide_hdd_device(mconfig, ATA_FLASH_PCCARD, "ATA Flash PCCARD", tag, owner, clock, "ataflash", __FILE__), m_gnetreadlock(0), m_locked(0) { } @@ -25,7 +25,7 @@ void ata_flash_pccard_device::device_reset() { ide_hdd_device::device_reset(); - UINT32 metalength; + uint32_t metalength; memset(m_key, 0, sizeof(m_key)); memset(m_cis, 0xff, 512); @@ -99,9 +99,9 @@ WRITE16_MEMBER( ata_flash_pccard_device::write_reg ) { if(offset >= 0x280 && offset <= 0x288 && m_handle != nullptr) { - UINT8 v = data; + uint8_t v = data; int pos = offset - 0x280; - UINT8 k = pos < sizeof(m_key) ? m_key[pos] : 0; + uint8_t k = pos < sizeof(m_key) ? m_key[pos] : 0; if(v == k) { diff --git a/src/devices/machine/ataflash.h b/src/devices/machine/ataflash.h index e0504b2f180..d54d09d552b 100644 --- a/src/devices/machine/ataflash.h +++ b/src/devices/machine/ataflash.h @@ -14,7 +14,7 @@ class ata_flash_pccard_device : public ide_hdd_device, public pccard_interface { public: - ata_flash_pccard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ata_flash_pccard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ16_MEMBER(read_memory) override; virtual DECLARE_WRITE16_MEMBER(write_memory) override; @@ -32,9 +32,9 @@ protected: virtual bool is_ready() override; private: - UINT8 m_cis[512]; - UINT8 m_key[5]; - UINT8 m_gnetreadlock; + uint8_t m_cis[512]; + uint8_t m_key[5]; + uint8_t m_gnetreadlock; int m_locked; }; diff --git a/src/devices/machine/atahle.cpp b/src/devices/machine/atahle.cpp index ce25fdcd679..df2714dd407 100644 --- a/src/devices/machine/atahle.cpp +++ b/src/devices/machine/atahle.cpp @@ -39,7 +39,7 @@ enum #define DEVICE1_PDIAG_TIME (attotime::from_msec(2)) #define DIAGNOSTIC_TIME (attotime::from_msec(2)) -ata_hle_device::ata_hle_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) +ata_hle_device::ata_hle_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), ata_device_interface(mconfig, *this), device_slot_card_interface(mconfig, *this), @@ -326,7 +326,7 @@ bool ata_hle_device::set_features() return false; } -int ata_hle_device::bit_to_mode(UINT16 word) +int ata_hle_device::bit_to_mode(uint16_t word) { switch (word>>8) { @@ -369,10 +369,10 @@ int ata_hle_device::ultra_dma_mode() return bit_to_mode(m_identify_buffer[88]); } -UINT16 ata_hle_device::read_data() +uint16_t ata_hle_device::read_data() { /* fetch the correct amount of data */ - UINT16 result = m_buffer[m_buffer_offset++]; + uint16_t result = m_buffer[m_buffer_offset++]; if (!m_8bit_data_transfers) result |= m_buffer[m_buffer_offset++] << 8; @@ -386,7 +386,7 @@ UINT16 ata_hle_device::read_data() return result; } -void ata_hle_device::write_data(UINT16 data) +void ata_hle_device::write_data(uint16_t data) { /* store the correct amount of data */ m_buffer[m_buffer_offset++] = data; @@ -542,9 +542,9 @@ WRITE_LINE_MEMBER( ata_hle_device::write_pdiag ) } } -UINT16 ata_hle_device::read_dma() +uint16_t ata_hle_device::read_dma() { - UINT16 result = 0xffff; + uint16_t result = 0xffff; if (device_selected()) { @@ -590,7 +590,7 @@ READ16_MEMBER( ata_hle_device::read_cs0 ) // if (offset != IDE_CS0_DATA_RW && offset != IDE_CS0_STATUS_R) LOG(("%s:IDE cs0 read at %X, mem_mask=%d\n", machine().describe_context(), offset, mem_mask)); - UINT16 result = 0xffff; + uint16_t result = 0xffff; if (device_selected() || m_single_device) { @@ -708,7 +708,7 @@ READ16_MEMBER( ata_hle_device::read_cs1 ) // if (offset != IDE_CS1_ALTERNATE_STATUS_R) LOG(("%s:IDE cs1 read at %X, mem_mask=%d\n", machine().describe_context(), offset, mem_mask)); - UINT16 result = 0xffff; + uint16_t result = 0xffff; if (device_selected() || m_single_device) { @@ -768,7 +768,7 @@ READ16_MEMBER( ata_hle_device::read_cs1 ) return result; } -void ata_hle_device::write_dma( UINT16 data ) +void ata_hle_device::write_dma( uint16_t data ) { if (device_selected()) { @@ -827,7 +827,7 @@ WRITE16_MEMBER( ata_hle_device::write_cs0 ) } else { - UINT8 old; + uint8_t old; switch (offset) { @@ -926,7 +926,7 @@ WRITE16_MEMBER( ata_hle_device::write_cs1 ) } else { - UINT8 old; + uint8_t old; switch (offset) { diff --git a/src/devices/machine/atahle.h b/src/devices/machine/atahle.h index 29bc23bf9cd..82189c6b536 100644 --- a/src/devices/machine/atahle.h +++ b/src/devices/machine/atahle.h @@ -20,13 +20,13 @@ class ata_hle_device : public device_t, public device_slot_card_interface { public: - ata_hle_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); + ata_hle_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 UINT16 read_dma() override; + virtual uint16_t read_dma() override; virtual DECLARE_READ16_MEMBER(read_cs0) override; virtual DECLARE_READ16_MEMBER(read_cs1) override; - virtual void write_dma(UINT16 data) override; + virtual void write_dma(uint16_t data) override; virtual DECLARE_WRITE16_MEMBER(write_cs0) override; virtual DECLARE_WRITE16_MEMBER(write_cs1) override; virtual DECLARE_WRITE_LINE_MEMBER(write_csel) override; @@ -49,7 +49,7 @@ protected: int dev() { return (m_device_head & IDE_DEVICE_HEAD_DRV) >> 4; } bool device_selected() { return m_csel == dev(); } - virtual UINT8 calculate_status() { return m_status; } + virtual uint8_t calculate_status() { return m_status; } virtual void soft_reset(); virtual void process_command(); virtual void finished_command(); @@ -60,10 +60,10 @@ protected: virtual bool is_ready() = 0; virtual void perform_diagnostic() = 0; virtual void signature() = 0; - virtual UINT16 read_data(); - virtual void write_data(UINT16 data); + virtual uint16_t read_data(); + virtual void write_data(uint16_t data); - int bit_to_mode(UINT16 word); + int bit_to_mode(uint16_t word); int single_word_dma_mode(); int multi_word_dma_mode(); int ultra_dma_mode(); @@ -175,21 +175,21 @@ protected: attotime MINIMUM_COMMAND_TIME; - std::vector m_buffer; - UINT16 m_buffer_offset; - UINT16 m_buffer_size; - UINT8 m_error; - UINT8 m_feature; - UINT16 m_sector_count; - UINT8 m_sector_number; - UINT8 m_cylinder_low; - UINT8 m_cylinder_high; - UINT8 m_device_head; - UINT8 m_status; - UINT8 m_command; - UINT8 m_device_control; - - UINT16 m_identify_buffer[256]; + std::vector m_buffer; + uint16_t m_buffer_offset; + uint16_t m_buffer_size; + uint8_t m_error; + uint8_t m_feature; + uint16_t m_sector_count; + uint8_t m_sector_number; + uint8_t m_cylinder_low; + uint8_t m_cylinder_high; + uint8_t m_device_head; + uint8_t m_status; + uint8_t m_command; + uint8_t m_device_control; + + uint16_t m_identify_buffer[256]; bool m_revert_to_defaults; bool m_8bit_data_transfers; diff --git a/src/devices/machine/ataintf.cpp b/src/devices/machine/ataintf.cpp index b9c51351e71..7ec7dd8838d 100644 --- a/src/devices/machine/ataintf.cpp +++ b/src/devices/machine/ataintf.cpp @@ -122,9 +122,9 @@ WRITE_LINE_MEMBER( ata_interface_device::pdiag1_write_line ) * *************************************/ -UINT16 ata_interface_device::read_dma() +uint16_t ata_interface_device::read_dma() { - UINT16 result = 0xffff; + uint16_t result = 0xffff; for (auto & elem : m_slot) if (elem->dev() != nullptr) result &= elem->dev()->read_dma(); @@ -135,7 +135,7 @@ UINT16 ata_interface_device::read_dma() READ16_MEMBER( ata_interface_device::read_cs0 ) { - UINT16 result = mem_mask; + uint16_t result = mem_mask; for (auto & elem : m_slot) if (elem->dev() != nullptr) result &= elem->dev()->read_cs0(space, offset, mem_mask); @@ -149,7 +149,7 @@ READ16_MEMBER( ata_interface_device::read_cs0 ) READ16_MEMBER( ata_interface_device::read_cs1 ) { - UINT16 result = mem_mask; + uint16_t result = mem_mask; for (auto & elem : m_slot) if (elem->dev() != nullptr) result &= elem->dev()->read_cs1(space, offset, mem_mask); @@ -166,7 +166,7 @@ READ16_MEMBER( ata_interface_device::read_cs1 ) * *************************************/ -void ata_interface_device::write_dma( UINT16 data ) +void ata_interface_device::write_dma( uint16_t data ) { // printf( "%s: write_dma %04x\n", machine().describe_context(), data ); @@ -207,7 +207,7 @@ SLOT_INTERFACE_START(ata_devices) SLOT_INTERFACE("cdrom", ATAPI_CDROM) SLOT_INTERFACE_END -ata_interface_device::ata_interface_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) : +ata_interface_device::ata_interface_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_irq_handler(*this), m_dmarq_handler(*this), @@ -217,7 +217,7 @@ ata_interface_device::ata_interface_device(const machine_config &mconfig, device const device_type ATA_INTERFACE = &device_creator; -ata_interface_device::ata_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ata_interface_device::ata_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATA_INTERFACE, "ATA Interface", tag, owner, clock, "ata_interface", __FILE__), m_irq_handler(*this), m_dmarq_handler(*this), @@ -296,7 +296,7 @@ const device_type ATA_SLOT = &device_creator; // ata_slot_device - constructor //------------------------------------------------- -ata_slot_device::ata_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ata_slot_device::ata_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATA_SLOT, "ATA Connector", tag, owner, clock, "ata_slot", __FILE__), device_slot_interface(mconfig, *this), m_dev(nullptr) diff --git a/src/devices/machine/ataintf.h b/src/devices/machine/ataintf.h index d1752d5923b..018796414ff 100644 --- a/src/devices/machine/ataintf.h +++ b/src/devices/machine/ataintf.h @@ -26,7 +26,7 @@ class ata_slot_device : public device_t, { public: // construction/destruction - ata_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ata_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ata_device_interface *dev() { return m_dev; } protected: @@ -77,18 +77,18 @@ SLOT_INTERFACE_EXTERN(ata_devices); class ata_interface_device : public device_t { public: - ata_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ata_interface_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); + ata_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ata_interface_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_irq_handler(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } template static devcb_base &set_dmarq_handler(device_t &device, _Object object) { return downcast(device).m_dmarq_handler.set_callback(object); } template static devcb_base &set_dasp_handler(device_t &device, _Object object) { return downcast(device).m_dasp_handler.set_callback(object); } - UINT16 read_dma(); + uint16_t read_dma(); virtual DECLARE_READ16_MEMBER(read_cs0); virtual DECLARE_READ16_MEMBER(read_cs1); - void write_dma(UINT16 data); + void write_dma(uint16_t data); virtual DECLARE_WRITE16_MEMBER(write_cs0); virtual DECLARE_WRITE16_MEMBER(write_cs1); DECLARE_WRITE_LINE_MEMBER(write_dmack); diff --git a/src/devices/machine/atapicdr.cpp b/src/devices/machine/atapicdr.cpp index deb0da52c52..268a5a71b4c 100644 --- a/src/devices/machine/atapicdr.cpp +++ b/src/devices/machine/atapicdr.cpp @@ -10,17 +10,17 @@ const device_type ATAPI_CDROM = &device_creator; const device_type ATAPI_FIXED_CDROM = &device_creator; -atapi_cdrom_device::atapi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +atapi_cdrom_device::atapi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atapi_hle_device(mconfig, ATAPI_CDROM, "ATAPI CDROM", tag, owner, clock, "cdrom", __FILE__) { } -atapi_cdrom_device::atapi_cdrom_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) : +atapi_cdrom_device::atapi_cdrom_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) : atapi_hle_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -atapi_fixed_cdrom_device::atapi_fixed_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +atapi_fixed_cdrom_device::atapi_fixed_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atapi_cdrom_device(mconfig, ATAPI_FIXED_CDROM, "ATAPI fixed CDROM", tag, owner, clock, "cdrom_fixed", __FILE__) { } diff --git a/src/devices/machine/atapicdr.h b/src/devices/machine/atapicdr.h index 041081a0cd0..1105506c84f 100644 --- a/src/devices/machine/atapicdr.h +++ b/src/devices/machine/atapicdr.h @@ -20,10 +20,10 @@ class atapi_cdrom_device : public atapi_hle_device, public t10mmc { public: - atapi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - atapi_cdrom_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); + atapi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + atapi_cdrom_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); - UINT16 *identify_device_buffer() { return m_identify_buffer; } + uint16_t *identify_device_buffer() { return m_identify_buffer; } protected: // device-level overrides @@ -41,7 +41,7 @@ protected: class atapi_fixed_cdrom_device : public atapi_cdrom_device { public: - atapi_fixed_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atapi_fixed_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_reset() override; }; diff --git a/src/devices/machine/atapihle.cpp b/src/devices/machine/atapihle.cpp index 1216e7a91ad..010921e944f 100644 --- a/src/devices/machine/atapihle.cpp +++ b/src/devices/machine/atapihle.cpp @@ -2,7 +2,7 @@ // copyright-holders:smf #include "atapihle.h" -atapi_hle_device::atapi_hle_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) +atapi_hle_device::atapi_hle_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) : ata_hle_device(mconfig, type, name, tag, owner, clock, shortname, source), m_packet(0), m_data_size(0) diff --git a/src/devices/machine/atapihle.h b/src/devices/machine/atapihle.h index d124259e577..2e44816a2ca 100644 --- a/src/devices/machine/atapihle.h +++ b/src/devices/machine/atapihle.h @@ -20,7 +20,7 @@ class atapi_hle_device : public ata_hle_device, public virtual t10spc { public: - atapi_hle_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); + atapi_hle_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); enum atapi_features_flag_t { diff --git a/src/devices/machine/autoconfig.cpp b/src/devices/machine/autoconfig.cpp index 02afb595985..e05d153be63 100644 --- a/src/devices/machine/autoconfig.cpp +++ b/src/devices/machine/autoconfig.cpp @@ -80,13 +80,13 @@ void amiga_autoconfig::autoconfig_can_shutup(bool state) m_cfg[0x04] |= (state ? 0x04 : 0x00) << 12; } -void amiga_autoconfig::autoconfig_product(UINT8 data) +void amiga_autoconfig::autoconfig_product(uint8_t data) { m_cfg[0x02] = ~((data & 0xf0) >> 4) << 12; m_cfg[0x03] = ~((data & 0x0f) >> 0) << 12; } -void amiga_autoconfig::autoconfig_manufacturer(UINT16 data) +void amiga_autoconfig::autoconfig_manufacturer(uint16_t data) { m_cfg[0x08] = ~((data & 0xf000) >> 12) << 12; m_cfg[0x09] = ~((data & 0x0f00) >> 8) << 12; @@ -94,7 +94,7 @@ void amiga_autoconfig::autoconfig_manufacturer(UINT16 data) m_cfg[0x0b] = ~((data & 0x000f) >> 0) << 12; } -void amiga_autoconfig::autoconfig_serial(UINT32 data) +void amiga_autoconfig::autoconfig_serial(uint32_t data) { m_cfg[0x0c] = ~((data & 0xf0000000) >> 28) << 12; m_cfg[0x0d] = ~((data & 0x0f000000) >> 24) << 12; @@ -106,7 +106,7 @@ void amiga_autoconfig::autoconfig_serial(UINT32 data) m_cfg[0x13] = ~((data & 0x0000000f) >> 0) << 12; } -void amiga_autoconfig::autoconfig_rom_vector(UINT16 data) +void amiga_autoconfig::autoconfig_rom_vector(uint16_t data) { m_cfg[0x14] = ~((data & 0xf000) >> 12) << 12; m_cfg[0x15] = ~((data & 0x0f00) >> 8) << 12; @@ -121,7 +121,7 @@ void amiga_autoconfig::autoconfig_rom_vector(UINT16 data) READ16_MEMBER( amiga_autoconfig::autoconfig_read ) { - UINT16 data = m_cfg[offset] | 0x0fff; + uint16_t data = m_cfg[offset] | 0x0fff; if (VERBOSE && !space.debugger_access()) space.device().logerror("autoconfig_read %04x @ %02x [mask = %04x]\n", data, offset, mem_mask); diff --git a/src/devices/machine/autoconfig.h b/src/devices/machine/autoconfig.h index 042d3886189..f061f0d2e7e 100644 --- a/src/devices/machine/autoconfig.h +++ b/src/devices/machine/autoconfig.h @@ -56,19 +56,19 @@ protected: void autoconfig_can_shutup(bool state); // product number, manufacturer number, serial number - void autoconfig_product(UINT8 data); - void autoconfig_manufacturer(UINT16 data); - void autoconfig_serial(UINT32 data); + void autoconfig_product(uint8_t data); + void autoconfig_manufacturer(uint16_t data); + void autoconfig_serial(uint32_t data); // rom vector - void autoconfig_rom_vector(UINT16 data); + void autoconfig_rom_vector(uint16_t data); // called once we have received a valid base address from the host system virtual void autoconfig_base_address(offs_t address) = 0; private: // configuration information about our autoconfig board, 256 nibbles - UINT16 m_cfg[0x40]; + uint16_t m_cfg[0x40]; }; #endif // __AUTOCONFIG_H__ diff --git a/src/devices/machine/ay31015.cpp b/src/devices/machine/ay31015.cpp index 659e16e281b..0e17222c0e6 100644 --- a/src/devices/machine/ay31015.cpp +++ b/src/devices/machine/ay31015.cpp @@ -97,7 +97,7 @@ Start bit (low), Bit 0, Bit 1... highest bit, Parity bit (if enabled), 1-2 stop const device_type AY31015 = &device_creator; const device_type AY51013 = &device_creator; -ay31015_device::ay31015_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) +ay31015_device::ay31015_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_control_reg(0), m_status_reg(0), @@ -125,7 +125,7 @@ ay31015_device::ay31015_device(const machine_config &mconfig, device_type type, elem = 0; } -ay31015_device::ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ay31015_device::ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AY31015, "AY-3-1015", tag, owner, clock, "ay31015", __FILE__), m_control_reg(0), m_status_reg(0), @@ -153,7 +153,7 @@ ay31015_device::ay31015_device(const machine_config &mconfig, const char *tag, d elem = 0; } -ay51013_device::ay51013_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ay51013_device::ay51013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay31015_device(mconfig, AY31015, "AY-5-1013", tag, owner, clock, "ay51013", __FILE__) { } @@ -210,7 +210,7 @@ void ay31015_device::device_reset() } -inline UINT8 ay31015_device::get_si() +inline uint8_t ay31015_device::get_si() { if (!m_read_si_cb.isnull()) m_pins[AY31015_SI] = m_read_si_cb(0) ? 1 : 0; @@ -228,7 +228,7 @@ inline void ay31015_device::set_so( int data ) } -inline int ay31015_device::update_status_pin( UINT8 reg_bit, ay31015_output_pin_t pin ) +inline int ay31015_device::update_status_pin( uint8_t reg_bit, ay31015_output_pin_t pin ) { int new_value = (m_status_reg & reg_bit) ? 1 : 0; @@ -428,7 +428,7 @@ TIMER_CALLBACK_MEMBER( ay31015_device::rx_process ) TIMER_CALLBACK_MEMBER( ay31015_device::tx_process ) { - UINT8 t1; + uint8_t t1; switch (m_tx_state) { case IDLE: @@ -561,7 +561,7 @@ TIMER_CALLBACK_MEMBER( ay31015_device::tx_process ) void ay31015_device::internal_reset() { /* total pulses = 16 * data-bits */ - UINT8 t1; + uint8_t t1; if (m_control_reg & CONTROL_NB2) t1 = (m_control_reg & CONTROL_NB1) ? 8 : 7; @@ -586,7 +586,7 @@ void ay31015_device::internal_reset() void ay51013_device::internal_reset() { /* total pulses = 16 * data-bits */ - UINT8 t1; + uint8_t t1; if (m_control_reg & CONTROL_NB2) t1 = (m_control_reg & CONTROL_NB1) ? 8 : 7; @@ -612,7 +612,7 @@ void ay51013_device::internal_reset() void ay31015_device::transfer_control_pins() { - UINT8 control = 0; + uint8_t control = 0; control |= m_pins[AY31015_NP ] ? CONTROL_NP : 0; control |= m_pins[AY31015_TSB] ? CONTROL_TSB : 0; @@ -733,7 +733,7 @@ void ay31015_device::set_transmitter_clock( double new_clock ) ay31015_get_received_data - return a byte to the computer -------------------------------------------------*/ -UINT8 ay31015_device::get_received_data() +uint8_t ay31015_device::get_received_data() { return m_rx_buffer; } @@ -742,7 +742,7 @@ UINT8 ay31015_device::get_received_data() /*------------------------------------------------- ay31015_set_transmit_data - accept a byte to transmit, if able -------------------------------------------------*/ -void ay31015_device::set_transmit_data( UINT8 data ) +void ay31015_device::set_transmit_data( uint8_t data ) { if (m_status_reg & STATUS_TBMT) { diff --git a/src/devices/machine/ay31015.h b/src/devices/machine/ay31015.h index ab511bfe940..ded0ba7da87 100644 --- a/src/devices/machine/ay31015.h +++ b/src/devices/machine/ay31015.h @@ -61,8 +61,8 @@ ALLOW_SAVE_TYPE(state_t); class ay31015_device : public device_t { public: - ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ay31015_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); + ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ay31015_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); ~ay31015_device() {} static void set_tx_clock(device_t &device, double tx_clock) { downcast(device).m_tx_clock = tx_clock; } @@ -89,12 +89,12 @@ public: /* Reead the received data */ /* The received data is available on RD8-RD1 (pins 5-12) */ - UINT8 get_received_data(); + uint8_t get_received_data(); /* Set the transmitter buffer */ /* The data to transmit is set on DB1-DB8 (pins 26-33) */ - void set_transmit_data( UINT8 data ); + void set_transmit_data( uint8_t data ); protected: // device-level overrides @@ -104,9 +104,9 @@ protected: virtual void internal_reset(); // internal state - inline UINT8 get_si(); + inline uint8_t get_si(); inline void set_so(int data); - inline int update_status_pin(UINT8 reg_bit, ay31015_output_pin_t pin); + inline int update_status_pin(uint8_t reg_bit, ay31015_output_pin_t pin); void update_status_pins(); void transfer_control_pins(); inline void update_rx_timer(); @@ -116,26 +116,26 @@ protected: int m_pins[41]; - UINT8 m_control_reg; - UINT8 m_status_reg; - UINT16 m_second_stop_bit; // 0, 8, 16 - UINT16 m_total_pulses; // bits * 16 - UINT8 m_internal_sample; + uint8_t m_control_reg; + uint8_t m_status_reg; + uint16_t m_second_stop_bit; // 0, 8, 16 + uint16_t m_total_pulses; // bits * 16 + uint8_t m_internal_sample; state_t m_rx_state; - UINT8 m_rx_data; // byte being received - UINT8 m_rx_buffer; // received byte waiting to be accepted by computer - UINT8 m_rx_bit_count; - UINT8 m_rx_parity; - UINT16 m_rx_pulses; // total pulses left + uint8_t m_rx_data; // byte being received + uint8_t m_rx_buffer; // received byte waiting to be accepted by computer + uint8_t m_rx_bit_count; + uint8_t m_rx_parity; + uint16_t m_rx_pulses; // total pulses left double m_rx_clock; /* RCP - pin 17 */ emu_timer *m_rx_timer; state_t m_tx_state; - UINT8 m_tx_data; // byte being sent - UINT8 m_tx_buffer; // next byte to send - UINT8 m_tx_parity; - UINT16 m_tx_pulses; // total pulses left + uint8_t m_tx_data; // byte being sent + uint8_t m_tx_buffer; // next byte to send + uint8_t m_tx_parity; + uint16_t m_tx_pulses; // total pulses left double m_tx_clock; /* TCP - pin 40 */ emu_timer *m_tx_timer; @@ -147,7 +147,7 @@ protected: class ay51013_device : public ay31015_device { public: - ay51013_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ay51013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void internal_reset() override; diff --git a/src/devices/machine/bankdev.cpp b/src/devices/machine/bankdev.cpp index 0b4571f9a87..be9bc47d63d 100644 --- a/src/devices/machine/bankdev.cpp +++ b/src/devices/machine/bankdev.cpp @@ -5,7 +5,7 @@ // device type definition const device_type ADDRESS_MAP_BANK = &device_creator; -address_map_bank_device::address_map_bank_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +address_map_bank_device::address_map_bank_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t(mconfig, ADDRESS_MAP_BANK, "Address Map Bank", tag, owner, clock, "address_map_bank", __FILE__), device_memory_interface(mconfig, *this), m_endianness(ENDIANNESS_NATIVE), diff --git a/src/devices/machine/bankdev.h b/src/devices/machine/bankdev.h index 946faef53f0..9b162780ea0 100644 --- a/src/devices/machine/bankdev.h +++ b/src/devices/machine/bankdev.h @@ -25,13 +25,13 @@ class address_map_bank_device : { public: // construction/destruction - address_map_bank_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ); + address_map_bank_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); // static configuration helpers static void set_endianness(device_t &device, endianness_t endianness) { downcast(device).m_endianness = endianness; } - static void set_databus_width(device_t &device, UINT8 databus_width) { downcast(device).m_databus_width = databus_width; } - static void set_addrbus_width(device_t &device, UINT8 addrbus_width) { downcast(device).m_addrbus_width = addrbus_width; } - static void set_stride(device_t &device, UINT32 stride) { downcast(device).m_stride = stride; } + static void set_databus_width(device_t &device, uint8_t databus_width) { downcast(device).m_databus_width = databus_width; } + static void set_addrbus_width(device_t &device, uint8_t addrbus_width) { downcast(device).m_addrbus_width = addrbus_width; } + static void set_stride(device_t &device, uint32_t stride) { downcast(device).m_stride = stride; } DECLARE_ADDRESS_MAP(amap8, 8); DECLARE_ADDRESS_MAP(amap16, 16); @@ -60,9 +60,9 @@ protected: private: // internal state endianness_t m_endianness; - UINT8 m_databus_width; - UINT8 m_addrbus_width; - UINT32 m_stride; + uint8_t m_databus_width; + uint8_t m_addrbus_width; + uint32_t m_stride; address_space_config m_program_config; address_space *m_program; offs_t m_offset; diff --git a/src/devices/machine/bcreader.cpp b/src/devices/machine/bcreader.cpp index 4d05a779835..9b286f49281 100644 --- a/src/devices/machine/bcreader.cpp +++ b/src/devices/machine/bcreader.cpp @@ -59,7 +59,7 @@ const device_type BARCODE_READER = &device_creator; // barcode_reader_device - constructor //------------------------------------------------- -barcode_reader_device::barcode_reader_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +barcode_reader_device::barcode_reader_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BARCODE_READER, "Barcode Reader", tag, owner, clock, "bcreader", __FILE__) , m_byte_length(0) , m_pixel_length(0) @@ -93,7 +93,7 @@ void barcode_reader_device::device_start() //------------------------------------------------- // Left Odd -static const UINT8 bcread_data_LO[10][7] = +static const uint8_t bcread_data_LO[10][7] = { {1, 1, 1, 0, 0, 1, 0}, {1, 1, 0, 0, 1, 1, 0}, {1, 1, 0, 1, 1, 0, 0}, {1, 0, 0, 0, 0, 1, 0}, @@ -103,7 +103,7 @@ static const UINT8 bcread_data_LO[10][7] = }; // Left Even -static const UINT8 bcread_data_LE[10][7] = +static const uint8_t bcread_data_LE[10][7] = { {1, 0, 1, 1, 0, 0, 0}, {1, 0, 0, 1, 1, 0, 0}, {1, 1, 0, 0, 1, 0, 0}, {1, 0, 1, 1, 1, 1, 0}, @@ -113,7 +113,7 @@ static const UINT8 bcread_data_LE[10][7] = }; // Right Even -static const UINT8 bcread_data_RE[10][7] = +static const uint8_t bcread_data_RE[10][7] = { {0, 0, 0, 1, 1, 0, 1}, {0, 0, 1, 1, 0, 0, 1}, {0, 0, 1, 0, 0, 1, 1}, {0, 1, 1, 1, 1, 0, 1}, @@ -124,7 +124,7 @@ static const UINT8 bcread_data_RE[10][7] = // EAN-13 added an extra digit to determine // the parity type of the first digits block -static const UINT8 bcread_parity_type[10][6] = +static const uint8_t bcread_parity_type[10][6] = { {1, 1, 1, 1, 1, 1}, {1, 1, 0, 1, 0, 0}, {1, 1, 0, 0, 1, 0}, {1, 1, 0, 0, 0, 1}, @@ -264,13 +264,13 @@ void barcode_reader_device::write_code(const char *barcode, int len) // the codes by bytes //------------------------------------------------- -UINT8 barcode_reader_device::read_code() +uint8_t barcode_reader_device::read_code() { if (m_new_code) { if (m_byte_count < m_byte_length) { - UINT8 val = m_byte_data[m_byte_count]; + uint8_t val = m_byte_data[m_byte_count]; m_byte_count++; return val; } diff --git a/src/devices/machine/bcreader.h b/src/devices/machine/bcreader.h index ecb6908e0ae..bc94f6dd92e 100644 --- a/src/devices/machine/bcreader.h +++ b/src/devices/machine/bcreader.h @@ -24,12 +24,12 @@ class barcode_reader_device : public device_t { public: // construction/destruction - barcode_reader_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + barcode_reader_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void write_code(const char *barcode, int len); int get_pending_code() { return m_new_code; } int get_byte_length() { return m_byte_length; } - UINT8 read_code(); + uint8_t read_code(); int read_pixel(); // TODO: add checksum validation! @@ -40,8 +40,8 @@ protected: // device-level overrides virtual void device_start() override; - UINT8 m_byte_data[13]; - UINT8 m_pixel_data[100]; + uint8_t m_byte_data[13]; + uint8_t m_pixel_data[100]; int m_byte_length; int m_pixel_length; int m_byte_count; diff --git a/src/devices/machine/buffer.cpp b/src/devices/machine/buffer.cpp index 6b2058c6937..7497f49ecd4 100644 --- a/src/devices/machine/buffer.cpp +++ b/src/devices/machine/buffer.cpp @@ -5,7 +5,7 @@ const device_type INPUT_BUFFER = &device_creator; -input_buffer_device::input_buffer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +input_buffer_device::input_buffer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INPUT_BUFFER, "Input Buffer", tag, owner, clock, "input_buffer", __FILE__), m_input_data(0xff) { diff --git a/src/devices/machine/buffer.h b/src/devices/machine/buffer.h index 7c719c918af..812f9f89f78 100644 --- a/src/devices/machine/buffer.h +++ b/src/devices/machine/buffer.h @@ -6,9 +6,9 @@ class input_buffer_device : public device_t { public: - input_buffer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + input_buffer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT8 read() { return m_input_data; } + uint8_t read() { return m_input_data; } DECLARE_READ8_MEMBER(read) { return read(); } DECLARE_WRITE_LINE_MEMBER(write_bit0) { if (state) m_input_data |= 0x01; else m_input_data &= ~0x01; } @@ -23,7 +23,7 @@ public: protected: virtual void device_start() override; - UINT8 m_input_data; + uint8_t m_input_data; }; extern const device_type INPUT_BUFFER; diff --git a/src/devices/machine/cdp1852.cpp b/src/devices/machine/cdp1852.cpp index 52fe18eb82b..2bfae3f3a5a 100644 --- a/src/devices/machine/cdp1852.cpp +++ b/src/devices/machine/cdp1852.cpp @@ -38,7 +38,7 @@ enum // cdp1852_device - constructor //------------------------------------------------- -cdp1852_device::cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cdp1852_device::cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDP1852, "CDP1852 I/O", tag, owner, clock, "cdp1852", __FILE__), m_read_mode(*this), m_write_sr(*this), diff --git a/src/devices/machine/cdp1852.h b/src/devices/machine/cdp1852.h index eb8cef75dd4..dafdf4147cf 100644 --- a/src/devices/machine/cdp1852.h +++ b/src/devices/machine/cdp1852.h @@ -58,7 +58,7 @@ class cdp1852_device : public device_t { public: // construction/destruction - cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_mode_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_mode.set_callback(object); } template static devcb_base &set_sr_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_sr.set_callback(object); } @@ -83,8 +83,8 @@ private: devcb_write8 m_write_data; int m_new_data; // new data written - UINT8 m_data; // data latch - UINT8 m_next_data; // next data + uint8_t m_data; // data latch + uint8_t m_next_data; // next data int m_sr; // service request flag int m_next_sr; // next value of service request flag diff --git a/src/devices/machine/cdp1871.cpp b/src/devices/machine/cdp1871.cpp index e685f8c43ad..2a3e8444f3f 100644 --- a/src/devices/machine/cdp1871.cpp +++ b/src/devices/machine/cdp1871.cpp @@ -22,7 +22,7 @@ const device_type CDP1871 = &device_creator; // MACROS / CONSTANTS //************************************************************************** -const UINT8 cdp1871_device::key_codes[4][11][8] = +const uint8_t cdp1871_device::key_codes[4][11][8] = { // normal { @@ -95,7 +95,7 @@ const UINT8 cdp1871_device::key_codes[4][11][8] = // cdp1871_device - constructor //------------------------------------------------- -cdp1871_device::cdp1871_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cdp1871_device::cdp1871_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDP1871, "RCA CDP1871", tag, owner, clock, "cdp1871", __FILE__), m_read_d1(*this), m_read_d2(*this), @@ -235,7 +235,7 @@ void cdp1871_device::clock_scan_counters() void cdp1871_device::detect_keypress() { - UINT8 data = 0; + uint8_t data = 0; switch (m_drive) { case 0: data = m_read_d1(0); break; diff --git a/src/devices/machine/cdp1871.h b/src/devices/machine/cdp1871.h index 02238822057..e6759505403 100644 --- a/src/devices/machine/cdp1871.h +++ b/src/devices/machine/cdp1871.h @@ -93,7 +93,7 @@ class cdp1871_device : public device_t { public: // construction/destruction - cdp1871_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdp1871_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_d1_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_d1.set_callback(object); } template static devcb_base &set_d2_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_d2.set_callback(object); } @@ -160,7 +160,7 @@ private: // timers emu_timer *m_scan_timer; // keyboard scan timer - static const UINT8 key_codes[4][11][8]; + static const uint8_t key_codes[4][11][8]; }; diff --git a/src/devices/machine/clock.cpp b/src/devices/machine/clock.cpp index 70d3bd4fade..e933f28ddda 100644 --- a/src/devices/machine/clock.cpp +++ b/src/devices/machine/clock.cpp @@ -4,7 +4,7 @@ const device_type CLOCK = &device_creator; -clock_device::clock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +clock_device::clock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CLOCK, "Clock", tag, owner, clock, "clock", __FILE__), m_signal(0), m_timer(nullptr), diff --git a/src/devices/machine/clock.h b/src/devices/machine/clock.h index 4be97128bfe..6205b408071 100644 --- a/src/devices/machine/clock.h +++ b/src/devices/machine/clock.h @@ -13,7 +13,7 @@ class clock_device : public device_t { public: - clock_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + clock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_signal_handler(device_t &device, _Object object) { return downcast(device).m_signal_handler.set_callback(object); } diff --git a/src/devices/machine/com8116.cpp b/src/devices/machine/com8116.cpp index f5c177fef62..84d638c02a7 100644 --- a/src/devices/machine/com8116.cpp +++ b/src/devices/machine/com8116.cpp @@ -87,7 +87,7 @@ const int com8116_device::divisors_16X_4_9152MHz_SY2661_2[] = // com8116_device - constructor //------------------------------------------------- -com8116_device::com8116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +com8116_device::com8116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, COM8116, "COM8116", tag, owner, clock, "com8116", __FILE__), m_fx4_handler(*this), m_fr_handler(*this), @@ -165,7 +165,7 @@ void com8116_device::device_timer(emu_timer &timer, device_timer_id id, int para // str_w - //------------------------------------------------- -void com8116_device::str_w(UINT8 data) +void com8116_device::str_w(uint8_t data) { int fr_divider = data & 0x0f; int fr_clock = clock() / m_fr_divisors[fr_divider]; @@ -185,7 +185,7 @@ WRITE8_MEMBER( com8116_device::str_w ) // stt_w - //------------------------------------------------- -void com8116_device::stt_w(UINT8 data) +void com8116_device::stt_w(uint8_t data) { int ft_divider = data & 0x0f; int ft_clock = clock() / m_ft_divisors[ft_divider]; diff --git a/src/devices/machine/com8116.h b/src/devices/machine/com8116.h index 614be491318..720aa010838 100644 --- a/src/devices/machine/com8116.h +++ b/src/devices/machine/com8116.h @@ -51,15 +51,15 @@ class com8116_device : public device_t { public: // construction/destruction - com8116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + com8116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_fx4_handler(device_t &device, _Object object) { return downcast(device).m_fx4_handler.set_callback(object); } template static devcb_base &set_fr_handler(device_t &device, _Object object) { return downcast(device).m_fr_handler.set_callback(object); } template static devcb_base &set_ft_handler(device_t &device, _Object object) { return downcast(device).m_ft_handler.set_callback(object); } - void str_w(UINT8 data); + void str_w(uint8_t data); DECLARE_WRITE8_MEMBER( str_w ); - void stt_w(UINT8 data); + void stt_w(uint8_t data); DECLARE_WRITE8_MEMBER( stt_w ); static const int divisors_16X_5_0688MHz[]; diff --git a/src/devices/machine/corvushd.cpp b/src/devices/machine/corvushd.cpp index d1cdfcd1835..95cd4a17cb9 100644 --- a/src/devices/machine/corvushd.cpp +++ b/src/devices/machine/corvushd.cpp @@ -72,7 +72,7 @@ const device_type CORVUS_HDC = &device_creator; -corvus_hdc_t::corvus_hdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +corvus_hdc_t::corvus_hdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CORVUS_HDC, "Corvus Flat Cable HDC", tag, owner, clock, "corvus_hdc", __FILE__), m_status(0), m_prep_mode(false), @@ -120,8 +120,8 @@ corvus_hdc_t::corvus_hdc_t(const machine_config &mconfig, const char *tag, devic // Returns: // nada // -void corvus_hdc_t::dump_buffer(UINT8 *buffer, UINT16 length) { - UINT16 offset; +void corvus_hdc_t::dump_buffer(uint8_t *buffer, uint16_t length) { + uint16_t offset; char ascii_dump[16]; logerror("dump_buffer: Dump of %d bytes:\n", length); @@ -160,7 +160,7 @@ void corvus_hdc_t::dump_buffer(UINT8 *buffer, UINT16 length) { // Returns: // Whether the command was invalid or not (true = invalid command) // -bool corvus_hdc_t::parse_hdc_command(UINT8 data) { +bool corvus_hdc_t::parse_hdc_command(uint8_t data) { m_awaiting_modifier = false; // This is the case by definition LOG(("parse_hdc_command: Called with data: 0x%2.2x, Prep mode is: %d\n", data, m_prep_mode)); @@ -266,11 +266,11 @@ bool corvus_hdc_t::parse_hdc_command(UINT8 data) { // Returns: // status: Command status // -UINT8 corvus_hdc_t::corvus_write_sector(UINT8 drv, UINT32 sector, UINT8 *buffer, int len) { +uint8_t corvus_hdc_t::corvus_write_sector(uint8_t drv, uint32_t sector, uint8_t *buffer, int len) { hard_disk_file *disk; // Structures for interface to CHD routines - UINT8 tbuffer[512]; // Buffer to hold an entire sector - UINT16 cylinder; // Cylinder this sector resides on + uint8_t tbuffer[512]; // Buffer to hold an entire sector + uint16_t cylinder; // Cylinder this sector resides on LOG(("corvus_write_sector: Write Drive: %d, physical sector: 0x%5.5x\n", drv, sector)); @@ -324,10 +324,10 @@ UINT8 corvus_hdc_t::corvus_write_sector(UINT8 drv, UINT32 sector, UINT8 *buffer, // Returns: // status: Corvus status // -UINT8 corvus_hdc_t::corvus_write_logical_sector(dadr_t *dadr, UINT8 *buffer, int len) { - UINT8 status; // Status returned from Physical Sector read - UINT8 drv; // Corvus drive id (1..15) - UINT32 sector; // Sector number on drive +uint8_t corvus_hdc_t::corvus_write_logical_sector(dadr_t *dadr, uint8_t *buffer, int len) { + uint8_t status; // Status returned from Physical Sector read + uint8_t drv; // Corvus drive id (1..15) + uint32_t sector; // Sector number on drive // // Unencode the first byte of the DADR @@ -374,11 +374,11 @@ UINT8 corvus_hdc_t::corvus_write_logical_sector(dadr_t *dadr, UINT8 *buffer, int // Returns: // status: Corvus status // -UINT8 corvus_hdc_t::corvus_read_sector(UINT8 drv, UINT32 sector, UINT8 *buffer, int len) { +uint8_t corvus_hdc_t::corvus_read_sector(uint8_t drv, uint32_t sector, uint8_t *buffer, int len) { hard_disk_file *disk; // Structures for interface to CHD routines - UINT8 tbuffer[512]; // Buffer to store full sector results in - UINT16 cylinder; + uint8_t tbuffer[512]; // Buffer to store full sector results in + uint16_t cylinder; LOG(("corvus_read_sector: Read Drive: %d, physical sector: 0x%5.5x\n", drv, sector)); @@ -421,10 +421,10 @@ UINT8 corvus_hdc_t::corvus_read_sector(UINT8 drv, UINT32 sector, UINT8 *buffer, // Returns: // status: Corvus status // -UINT8 corvus_hdc_t::corvus_read_logical_sector(dadr_t *dadr, UINT8 *buffer, int len) { - UINT8 status; // Status returned from Physical Sector read - UINT8 drv; // Corvus drive id (1..15) - UINT32 sector; // Sector number on drive +uint8_t corvus_hdc_t::corvus_read_logical_sector(dadr_t *dadr, uint8_t *buffer, int len) { + uint8_t status; // Status returned from Physical Sector read + uint8_t drv; // Corvus drive id (1..15) + uint32_t sector; // Sector number on drive // // Unencode the first byte of the DADR @@ -472,13 +472,13 @@ UINT8 corvus_hdc_t::corvus_read_logical_sector(dadr_t *dadr, UINT8 *buffer, int // Side-effects: // Fills in the semaphore result code // -UINT8 corvus_hdc_t::corvus_lock_semaphore(UINT8 *name) { +uint8_t corvus_hdc_t::corvus_lock_semaphore(uint8_t *name) { semaphore_table_block_t semaphore_table; - UINT8 offset = 0; + uint8_t offset = 0; bool found = false; - UINT8 blank_offset = 32; // Initialize to invalid offset - UINT8 status; // Status returned from Physical Sector read + uint8_t blank_offset = 32; // Initialize to invalid offset + uint8_t status; // Status returned from Physical Sector read // // Read the semaphore table from the drive @@ -547,12 +547,12 @@ UINT8 corvus_hdc_t::corvus_lock_semaphore(UINT8 *name) { // Side-effects: // Fills in the semaphore result code // -UINT8 corvus_hdc_t::corvus_unlock_semaphore(UINT8 *name) { +uint8_t corvus_hdc_t::corvus_unlock_semaphore(uint8_t *name) { semaphore_table_block_t semaphore_table; - UINT8 offset = 0; + uint8_t offset = 0; bool found = false; - UINT8 status; // Status returned from Physical Sector read + uint8_t status; // Status returned from Physical Sector read // // Read the semaphore table from the drive @@ -612,10 +612,10 @@ UINT8 corvus_hdc_t::corvus_unlock_semaphore(UINT8 *name) { // Disk status // // -UINT8 corvus_hdc_t::corvus_init_semaphore_table() { +uint8_t corvus_hdc_t::corvus_init_semaphore_table() { semaphore_table_block_t semaphore_table; - UINT8 status; + uint8_t status; memset(semaphore_table.semaphore_block.semaphore_table, 0x20, 256); @@ -641,22 +641,22 @@ UINT8 corvus_hdc_t::corvus_init_semaphore_table() { // Returns: // Status of command // -UINT8 corvus_hdc_t::corvus_get_drive_parameters(UINT8 drv) { - UINT16 capacity; // Number of usable 512-byte blocks - UINT16 raw_capacity; // Number of actual 512-byte blocks +uint8_t corvus_hdc_t::corvus_get_drive_parameters(uint8_t drv) { + uint16_t capacity; // Number of usable 512-byte blocks + uint16_t raw_capacity; // Number of actual 512-byte blocks union { - UINT8 + uint8_t buffer[512]; disk_parameter_block_t dpb; } raw_disk_parameter_block; // Buffer for the Disk Parameter Block union { - UINT8 + uint8_t buffer[512]; constellation_parameter_block_t cpb; } raw_constellation_parameter_block; // Buffer for the Constellation Parameter Block - UINT8 status; // Status to return + uint8_t status; // Status to return // // Make sure a valid drive is being accessed @@ -755,7 +755,7 @@ UINT8 corvus_hdc_t::corvus_get_drive_parameters(UINT8 drv) { // Returns: // status: Status of read operation // -UINT8 corvus_hdc_t::corvus_read_boot_block(UINT8 block) { +uint8_t corvus_hdc_t::corvus_read_boot_block(uint8_t block) { LOG(("corvus_read_boot_block: Reading boot block: %d\n", block)); return corvus_read_sector(1, 25 + block, m_buffer.read_512_response.data, 512); @@ -792,7 +792,7 @@ UINT8 corvus_hdc_t::corvus_read_boot_block(UINT8 block) { // Returns: // Status of command // -UINT8 corvus_hdc_t::corvus_enter_prep_mode(UINT8 drv, UINT8 *prep_block) { +uint8_t corvus_hdc_t::corvus_enter_prep_mode(uint8_t drv, uint8_t *prep_block) { // on rev b/h drives, sending the "put drive into prep mode" // command when already in prep mode is an error. if (m_prep_mode) { @@ -824,7 +824,7 @@ UINT8 corvus_hdc_t::corvus_enter_prep_mode(UINT8 drv, UINT8 *prep_block) { // Returns: // Status of command (always success) // -UINT8 corvus_hdc_t::corvus_exit_prep_mode() { +uint8_t corvus_hdc_t::corvus_exit_prep_mode() { LOG(("corvus_exit_prep_mode: Prep mode exited\n")); m_prep_mode = false; m_prep_drv = 0; @@ -845,9 +845,9 @@ UINT8 corvus_hdc_t::corvus_exit_prep_mode() { // Returns: // Status of command // -UINT8 corvus_hdc_t::corvus_read_firmware_block(UINT8 head, UINT8 sector) { - UINT16 relative_sector; // Relative sector on drive for Physical Read - UINT8 status; +uint8_t corvus_hdc_t::corvus_read_firmware_block(uint8_t head, uint8_t sector) { + uint16_t relative_sector; // Relative sector on drive for Physical Read + uint8_t status; relative_sector = head * m_sectors_per_track + sector; @@ -873,9 +873,9 @@ UINT8 corvus_hdc_t::corvus_read_firmware_block(UINT8 head, UINT8 sector) { // Returns: // Status of command // -UINT8 corvus_hdc_t::corvus_write_firmware_block(UINT8 head, UINT8 sector, UINT8 *buffer) { - UINT16 relative_sector; // Relative sector on drive for Physical Write - UINT8 status; +uint8_t corvus_hdc_t::corvus_write_firmware_block(uint8_t head, uint8_t sector, uint8_t *buffer) { + uint16_t relative_sector; // Relative sector on drive for Physical Write + uint8_t status; relative_sector = head * m_sectors_per_track + sector; @@ -899,11 +899,11 @@ UINT8 corvus_hdc_t::corvus_write_firmware_block(UINT8 head, UINT8 sector, UINT8 // Returns: // Status of command // -UINT8 corvus_hdc_t::corvus_format_drive(UINT8 *pattern, UINT16 len) { - UINT32 sector; - UINT32 max_sector; - UINT8 status = 0; - UINT8 tbuffer[512]; +uint8_t corvus_hdc_t::corvus_format_drive(uint8_t *pattern, uint16_t len) { + uint32_t sector; + uint32_t max_sector; + uint8_t status = 0; + uint8_t tbuffer[512]; // Set up m_tracks_per_cylinder and m_sectors_per_track corvus_hdc_file(m_prep_drv); @@ -1371,7 +1371,7 @@ READ8_MEMBER ( corvus_hdc_t::status_r ) { // Value in the controller data register // READ8_MEMBER ( corvus_hdc_t::read ) { - UINT8 result; + uint8_t result; if((m_status & CONTROLLER_DIRECTION) == 0) { // Check to see if we're in Controller-to-Host mode logerror("corvus_hdc_data_r: Data register read when in Host-to-Controller mode (status: 0x%2.2x)\n", m_status); diff --git a/src/devices/machine/corvushd.h b/src/devices/machine/corvushd.h index cb3bee03594..a85ffdbb9fe 100644 --- a/src/devices/machine/corvushd.h +++ b/src/devices/machine/corvushd.h @@ -182,7 +182,7 @@ class corvus_hdc_t : public device_t { public: // construction/destruction - corvus_hdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + corvus_hdc_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -202,27 +202,27 @@ private: // Sector addressing scheme for Rev B/H drives used in various commands (Called a DADR in the docs) struct dadr_t { - UINT8 address_msn_and_drive;// Most significant nibble: Most signficant nibble of sector address, Least significant nibble: Drive # - UINT8 address_lsb; // Least significant byte of sector address - UINT8 address_mid; // Middle byte of sector address + uint8_t address_msn_and_drive;// Most significant nibble: Most signficant nibble of sector address, Least significant nibble: Drive # + uint8_t address_lsb; // Least significant byte of sector address + uint8_t address_mid; // Middle byte of sector address }; - UINT8 m_status; // Controller status byte (DIRECTION + BUSY/READY) + uint8_t m_status; // Controller status byte (DIRECTION + BUSY/READY) // Prep mode bool m_prep_mode; // Whether the controller is in Prep Mode or not - UINT8 m_prep_drv; // If in prep mode, Corvus drive id (1..15) being prepped + uint8_t m_prep_drv; // If in prep mode, Corvus drive id (1..15) being prepped // Physical drive info - UINT8 m_sectors_per_track; // Number of sectors per track for this drive - UINT8 m_tracks_per_cylinder;// Number of tracks per cylinder (heads) - UINT16 m_cylinders_per_drive;// Number of cylinders per drive + uint8_t m_sectors_per_track; // Number of sectors per track for this drive + uint8_t m_tracks_per_cylinder;// Number of tracks per cylinder (heads) + uint16_t m_cylinders_per_drive;// Number of cylinders per drive // Command Processing - UINT16 m_offset; // Current offset into raw_data buffer + uint16_t m_offset; // Current offset into raw_data buffer bool m_awaiting_modifier; // We've received a two-byte command and we're waiting for the mod - UINT16 m_recv_bytes; // Number of bytes expected to be received from Host - UINT16 m_xmit_bytes; // Number of bytes expected to be transmitted to host + uint16_t m_recv_bytes; // Number of bytes expected to be received from Host + uint16_t m_xmit_bytes; // Number of bytes expected to be transmitted to host // Timing-related values - UINT16 m_last_cylinder; // Last cylinder accessed - for calculating seek times - UINT32 m_delay; // Delay in microseconds for callback + uint16_t m_last_cylinder; // Last cylinder accessed - for calculating seek times + uint32_t m_delay; // Delay in microseconds for callback emu_timer *m_timeout_timer; // Four-second timer for timeouts emu_timer *m_cmd_timer; bool m_invalid_command_flag; // I hate this, but it saves a lot more tests @@ -234,197 +234,197 @@ private: // // Raw Buffer // - UINT8 raw_data[MAX_COMMAND_SIZE]; + uint8_t raw_data[MAX_COMMAND_SIZE]; // // Basic interpretation of code and modifier // struct { - UINT8 code; // First byte of data is the code (command) - UINT8 modifier; // Second byte of data is the modifier + uint8_t code; // First byte of data is the code (command) + uint8_t modifier; // Second byte of data is the modifier } command; // // Basic response code // struct { - UINT8 status; // Status code returned by the command executed + uint8_t status; // Status code returned by the command executed } single_byte_response; // // Read sector command // struct { - UINT8 code; // Command code + uint8_t code; // Command code dadr_t dadr; // Encoded drive and sector to read } read_sector_command; // // 128-byte Read Sector response // struct { - UINT8 status; // Status code returned by command executed - UINT8 data[128]; // Data returned from read + uint8_t status; // Status code returned by command executed + uint8_t data[128]; // Data returned from read } read_128_response; // // 256-byte Read Sector response // struct { - UINT8 status; // Status code returned by command executed - UINT8 data[256]; // Data returned from read + uint8_t status; // Status code returned by command executed + uint8_t data[256]; // Data returned from read } read_256_response; // // 512-byte Read Sector response // struct { - UINT8 status; // Status code returned by command executed - UINT8 data[512]; // Data returned by read + uint8_t status; // Status code returned by command executed + uint8_t data[512]; // Data returned by read } read_512_response; // // Write 128-byte sector command // struct { - UINT8 code; // Command code + uint8_t code; // Command code dadr_t dadr; // Encoded drive and sector to write - UINT8 data[128]; // Data to be written + uint8_t data[128]; // Data to be written } write_128_command; // // Write 256-byte sector command // struct { - UINT8 code; // Command code + uint8_t code; // Command code dadr_t dadr; // Encoded drive and sector to write - UINT8 data[256]; // Data to be written + uint8_t data[256]; // Data to be written } write_256_command; // // Write 512-byte sector command // struct { - UINT8 code; // Command Code + uint8_t code; // Command Code dadr_t dadr; // Encoded drive and sector to write - UINT8 data[512]; // Data to be written + uint8_t data[512]; // Data to be written } write_512_command; // // Semaphore Lock command // struct { - UINT8 code; // Command code - UINT8 modifier; // Command code modifier - UINT8 name[8]; // Semaphore name + uint8_t code; // Command code + uint8_t modifier; // Command code modifier + uint8_t name[8]; // Semaphore name } lock_semaphore_command; // // Semaphore Unlock command // struct { - UINT8 code; // Command code - UINT8 modifier; // Command code modifier - UINT8 name[8]; // Semaphore name + uint8_t code; // Command code + uint8_t modifier; // Command code modifier + uint8_t name[8]; // Semaphore name } unlock_semaphore_command; // // Semaphore Lock/Unlock response // struct { - UINT8 status; // Disk access status - UINT8 result; // Semaphore action status - UINT8 unused[10]; // Unused + uint8_t status; // Disk access status + uint8_t result; // Semaphore action status + uint8_t unused[10]; // Unused } semaphore_locking_response; // // Initialize Semaphore table command // struct { - UINT8 code; // Command code - UINT8 modifier; // Command code modifier - UINT8 unused[3]; // Unused + uint8_t code; // Command code + uint8_t modifier; // Command code modifier + uint8_t unused[3]; // Unused } init_semaphore_command; // // Semaphore Status command // struct { - UINT8 code; // Command code - UINT8 modifier; // Command code modifier - UINT8 zero_three; // Don't ask me... - UINT8 unused[2]; // Unused + uint8_t code; // Command code + uint8_t modifier; // Command code modifier + uint8_t zero_three; // Don't ask me... + uint8_t unused[2]; // Unused } semaphore_status_command; // // Semaphore Status response // struct { - UINT8 status; // Disk access status - UINT8 table[256]; // Contents of the semaphore table + uint8_t status; // Disk access status + uint8_t table[256]; // Contents of the semaphore table } semaphore_status_response; // // Get Drive Parameters command (0x10) // struct { - UINT8 code; // Command code - UINT8 drive; // Drive number (starts at 1) + uint8_t code; // Command code + uint8_t drive; // Drive number (starts at 1) } get_drive_parameters_command; // // Get Drive Parameters command response // struct { - UINT8 status; // Status code returned by command executed - UINT8 firmware_desc[31]; // Firmware string description - UINT8 firmware_rev; // Firmware revision number - UINT8 rom_version; // ROM Version + uint8_t status; // Status code returned by command executed + uint8_t firmware_desc[31]; // Firmware string description + uint8_t firmware_rev; // Firmware revision number + uint8_t rom_version; // ROM Version struct { - UINT8 sectors_per_track; // Sectors/Track - UINT8 tracks_per_cylinder; // Tracks/Cylinder (heads) + uint8_t sectors_per_track; // Sectors/Track + uint8_t tracks_per_cylinder; // Tracks/Cylinder (heads) struct { - UINT8 lsb; - UINT8 msb; + uint8_t lsb; + uint8_t msb; } cylinders_per_drive; // Byte-flipped Cylinders/Drive } track_info; struct { - UINT8 lsb; // Least significant byte - UINT8 midb; // Middle byte - UINT8 msb; // Most significant byte + uint8_t lsb; // Least significant byte + uint8_t midb; // Middle byte + uint8_t msb; // Most significant byte } capacity; // 24-bit value, byte-flipped (lsb..msb) - UINT8 unused[16]; - UINT8 interleave; // Interleave factor + uint8_t unused[16]; + uint8_t interleave; // Interleave factor struct { - UINT8 mux_parameters[12]; - UINT8 pipe_name_table_ptr[2]; // Pointer to table of 64 entries, 8 bytes each (table of names) - UINT8 pipe_ptr_table_ptr[2]; // Pointer to table of 64 entries, 8 bytes each. See pp. 29 - Mass Storage GTI - UINT8 pipe_area_size[2]; // Size of pipe area (lsb, msb) + uint8_t mux_parameters[12]; + uint8_t pipe_name_table_ptr[2]; // Pointer to table of 64 entries, 8 bytes each (table of names) + uint8_t pipe_ptr_table_ptr[2]; // Pointer to table of 64 entries, 8 bytes each. See pp. 29 - Mass Storage GTI + uint8_t pipe_area_size[2]; // Size of pipe area (lsb, msb) struct { - UINT8 track_offset[2]; + uint8_t track_offset[2]; } vdo_table[7]; // Virtual drive table - UINT8 lsi11_vdo_table[8]; - UINT8 lsi11_spare_table[8]; + uint8_t lsi11_vdo_table[8]; + uint8_t lsi11_spare_table[8]; } table_info; - UINT8 drive_number; // Physical drive number + uint8_t drive_number; // Physical drive number struct { - UINT8 lsb; // Least - UINT8 midb; // Middle - UINT8 msb; // Most + uint8_t lsb; // Least + uint8_t midb; // Middle + uint8_t msb; // Most } physical_capacity; // Physical capacity of drive } drive_param_response; // // 2-byte Boot command (0x14) // struct { - UINT8 code; // Command code - UINT8 boot_block; // Which boot block to read (0-7) + uint8_t code; // Command code + uint8_t boot_block; // Which boot block to read (0-7) } old_boot_command; // // Put drive into prep mode command (0x11) // struct { - UINT8 code; // Command code - UINT8 drive; // Drive number (starts at 1) - UINT8 prep_block[512]; // Machine code payload + uint8_t code; // Command code + uint8_t drive; // Drive number (starts at 1) + uint8_t prep_block[512]; // Machine code payload } prep_mode_command; // // Read Firmware command (Prep Mode 0x32) // struct { - UINT8 code; // Command Code - UINT8 encoded_h_s;// Encoded Head (bits 7-5) / Sector (bits 4-0) + uint8_t code; // Command Code + uint8_t encoded_h_s;// Encoded Head (bits 7-5) / Sector (bits 4-0) } read_firmware_command; // // Write Firmware command (Prep Mode 0x33) // struct { - UINT8 code; // Command Code - UINT8 encoded_h_s; // Encoded Head (bits 7-5) / Sector (bits 4-0) - UINT8 data[512]; // Data to be written + uint8_t code; // Command Code + uint8_t encoded_h_s; // Encoded Head (bits 7-5) / Sector (bits 4-0) + uint8_t data[512]; // Data to be written } write_firmware_command; // // Format Drive command (Prep Mode 0x01) @@ -435,8 +435,8 @@ private: // all Corvus diagnostic programs send 513 bytes total, including the command, so I'm going with that. // struct { - UINT8 code; // Command Code - UINT8 pattern[512]; // Pattern to be written + uint8_t code; // Command Code + uint8_t pattern[512]; // Pattern to be written } format_drive_revbh_command; // // Verify Drive command (Prep Mode 0x07) @@ -447,75 +447,75 @@ private: // return a count of 0. That makes this a fixed length response of 2 bytes. // struct { - UINT8 status; // Disk access status - UINT8 bad_sectors; // Number of bad sectors (always zero) + uint8_t status; // Disk access status + uint8_t bad_sectors; // Number of bad sectors (always zero) } verify_drive_response; } m_buffer; // Structure of Block #1, the Disk Parameter Block struct disk_parameter_block_t { struct { - UINT8 lsb; - UINT8 msb; + uint8_t lsb; + uint8_t msb; } spared_track[8]; // Spared track table (0xffff indicates end) - UINT8 interleave; // Interleave factor - UINT8 reserved; + uint8_t interleave; // Interleave factor + uint8_t reserved; struct { - UINT8 track_offset[2]; // Virtual drive offsets (lsb, msb) 0xffff indicates unused + uint8_t track_offset[2]; // Virtual drive offsets (lsb, msb) 0xffff indicates unused } vdo_table[7]; - UINT8 lsi11_vdo_table[8]; - UINT8 lsi11_spare_table[8]; - UINT8 reserved2[432]; + uint8_t lsi11_vdo_table[8]; + uint8_t lsi11_spare_table[8]; + uint8_t reserved2[432]; struct { - UINT8 lsb; - UINT8 msb; + uint8_t lsb; + uint8_t msb; } revh_spare_table[16]; }; // Structure of Block #3, the Constellation Parameter Block struct constellation_parameter_block_t { - UINT8 mux_parameters[12]; - UINT8 pipe_name_table_ptr[2]; - UINT8 pipe_ptr_table_ptr[2]; - UINT8 pipe_area_size[2]; - UINT8 reserved[470]; - UINT8 software_protection[12]; - UINT8 serial_number[12]; + uint8_t mux_parameters[12]; + uint8_t pipe_name_table_ptr[2]; + uint8_t pipe_ptr_table_ptr[2]; + uint8_t pipe_area_size[2]; + uint8_t reserved[470]; + uint8_t software_protection[12]; + uint8_t serial_number[12]; }; // Structure of Block #7, the Semaphore Table Block struct semaphore_table_block_t { union { - UINT8 semaphore_table[256]; // Table consists of 256 bytes + uint8_t semaphore_table[256]; // Table consists of 256 bytes struct { - UINT8 semaphore_name[8]; // Each semaphore name is 8 bytes + uint8_t semaphore_name[8]; // Each semaphore name is 8 bytes } semaphore_entry[32]; // 32 Entries } semaphore_block; - UINT8 unused[256]; // Remaining half of block is unused + uint8_t unused[256]; // Remaining half of block is unused }; // Command size structure (number of bytes to xmit and recv for each command) struct corvus_cmd_t { - UINT16 recv_bytes; // Number of bytes from host for this command - UINT16 xmit_bytes; // Number of bytes to return to host + uint16_t recv_bytes; // Number of bytes from host for this command + uint16_t xmit_bytes; // Number of bytes to return to host }; - void dump_buffer(UINT8 *buffer, UINT16 length); - bool parse_hdc_command(UINT8 data); - UINT8 corvus_write_sector(UINT8 drv, UINT32 sector, UINT8 *buffer, int len); - UINT8 corvus_write_logical_sector(dadr_t *dadr, UINT8 *buffer, int len); - UINT8 corvus_read_sector(UINT8 drv, UINT32 sector, UINT8 *buffer, int len); - UINT8 corvus_read_logical_sector(dadr_t *dadr, UINT8 *buffer, int len); - UINT8 corvus_lock_semaphore(UINT8 *name); - UINT8 corvus_unlock_semaphore(UINT8 *name); - UINT8 corvus_init_semaphore_table(); - UINT8 corvus_get_drive_parameters(UINT8 drv); - UINT8 corvus_read_boot_block(UINT8 block); - UINT8 corvus_enter_prep_mode(UINT8 drv, UINT8 *prep_block); - UINT8 corvus_exit_prep_mode(); - UINT8 corvus_read_firmware_block(UINT8 head, UINT8 sector); - UINT8 corvus_write_firmware_block(UINT8 head, UINT8 sector, UINT8 *buffer); - UINT8 corvus_format_drive(UINT8 *pattern, UINT16 len); + void dump_buffer(uint8_t *buffer, uint16_t length); + bool parse_hdc_command(uint8_t data); + uint8_t corvus_write_sector(uint8_t drv, uint32_t sector, uint8_t *buffer, int len); + uint8_t corvus_write_logical_sector(dadr_t *dadr, uint8_t *buffer, int len); + uint8_t corvus_read_sector(uint8_t drv, uint32_t sector, uint8_t *buffer, int len); + uint8_t corvus_read_logical_sector(dadr_t *dadr, uint8_t *buffer, int len); + uint8_t corvus_lock_semaphore(uint8_t *name); + uint8_t corvus_unlock_semaphore(uint8_t *name); + uint8_t corvus_init_semaphore_table(); + uint8_t corvus_get_drive_parameters(uint8_t drv); + uint8_t corvus_read_boot_block(uint8_t block); + uint8_t corvus_enter_prep_mode(uint8_t drv, uint8_t *prep_block); + uint8_t corvus_exit_prep_mode(); + uint8_t corvus_read_firmware_block(uint8_t head, uint8_t sector); + uint8_t corvus_write_firmware_block(uint8_t head, uint8_t sector, uint8_t *buffer); + uint8_t corvus_format_drive(uint8_t *pattern, uint16_t len); hard_disk_file *corvus_hdc_file(int id); void corvus_process_command_packet(bool local_invalid_command_flag); diff --git a/src/devices/machine/cr511b.cpp b/src/devices/machine/cr511b.cpp index debd3906fbc..e7678ac1537 100644 --- a/src/devices/machine/cr511b.cpp +++ b/src/devices/machine/cr511b.cpp @@ -45,7 +45,7 @@ machine_config_constructor cr511b_device::device_mconfig_additions() const // cr511b_device - constructor //------------------------------------------------- -cr511b_device::cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cr511b_device::cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CR511B, "CR-511-B CD-ROM drive", tag, owner, clock, "cr511b", __FILE__), m_cdrom(*this, "cdrom"), m_cdda(*this, "cdda"), diff --git a/src/devices/machine/cr511b.h b/src/devices/machine/cr511b.h index b4b3529f061..a5ab90d6bf6 100644 --- a/src/devices/machine/cr511b.h +++ b/src/devices/machine/cr511b.h @@ -75,7 +75,7 @@ class cr511b_device : public device_t { public: // construction/destruction - cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // callbacks template static devcb_base &set_stch_handler(device_t &device, _Object object) @@ -141,7 +141,7 @@ private: int m_cmd; // data transfer - //UINT8 m_sector_buffer[CD_MAX_SECTOR_DATA]; + //uint8_t m_sector_buffer[CD_MAX_SECTOR_DATA]; }; // device type definition diff --git a/src/devices/machine/cr589.cpp b/src/devices/machine/cr589.cpp index 8c0ae34f6c9..26ac49d1423 100644 --- a/src/devices/machine/cr589.cpp +++ b/src/devices/machine/cr589.cpp @@ -80,7 +80,7 @@ void matsushita_cr589_device::ExecCommand() } } -void matsushita_cr589_device::ReadData( UINT8 *data, int dataLength ) +void matsushita_cr589_device::ReadData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { @@ -110,7 +110,7 @@ void matsushita_cr589_device::ReadData( UINT8 *data, int dataLength ) } } -void matsushita_cr589_device::WriteData( UINT8 *data, int dataLength ) +void matsushita_cr589_device::WriteData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { @@ -139,7 +139,7 @@ void matsushita_cr589_device::WriteData( UINT8 *data, int dataLength ) // device type definition const device_type CR589 = &device_creator; -matsushita_cr589_device::matsushita_cr589_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +matsushita_cr589_device::matsushita_cr589_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atapi_cdrom_device(mconfig, CR589, "Matsushita CR589 CD-ROM Drive", tag, owner, clock, "cr589", __FILE__), device_nvram_interface(mconfig, *this) { diff --git a/src/devices/machine/cr589.h b/src/devices/machine/cr589.h index 9357f9ec43b..b35537b305b 100644 --- a/src/devices/machine/cr589.h +++ b/src/devices/machine/cr589.h @@ -20,11 +20,11 @@ class matsushita_cr589_device : public atapi_cdrom_device, public device_nvram_interface { public: - matsushita_cr589_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + matsushita_cr589_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); 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; // ksys573 changes discs without telling the cdrom_image_device virtual void process_buffer() override { atapi_hle_device::process_buffer(); } @@ -40,7 +40,7 @@ protected: private: int download; - UINT8 buffer[ 65536 ]; + uint8_t buffer[ 65536 ]; int bufferOffset; }; diff --git a/src/devices/machine/cs4031.cpp b/src/devices/machine/cs4031.cpp index fd3a303209f..d2c9286fffa 100644 --- a/src/devices/machine/cs4031.cpp +++ b/src/devices/machine/cs4031.cpp @@ -154,7 +154,7 @@ machine_config_constructor cs4031_device::device_mconfig_additions() const // cs4031_device - constructor //------------------------------------------------- -cs4031_device::cs4031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cs4031_device::cs4031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CS4031, "CS4031", tag, owner, clock, "cs4031", __FILE__), m_read_ior(*this), m_write_iow(*this), @@ -263,7 +263,7 @@ void cs4031_device::device_start() m_keybc = downcast(machine().device(m_keybctag)); m_ram = ram_dev->pointer(); - UINT32 ram_size = ram_dev->size(); + uint32_t ram_size = ram_dev->size(); // install base memory m_space->install_ram(0x000000, 0x09ffff, m_ram); @@ -362,7 +362,7 @@ READ8_MEMBER( cs4031_device::dma_read_word ) if (m_dma_channel == -1) return 0xff; - UINT16 result = m_space->read_word((page_offset() & 0xfe0000) | (offset << 1)); + uint16_t result = m_space->read_word((page_offset() & 0xfe0000) | (offset << 1)); m_dma_high_byte = result >> 8; return result; @@ -411,7 +411,7 @@ void cs4031_device::update_dma_clock() { if (m_dma_clock_divider[m_registers[DMA_CLOCK] & 0x0f] != 0) { - UINT32 dma_clock = clock() / m_dma_clock_divider[m_registers[DMA_CLOCK] & 0x0f]; + uint32_t dma_clock = clock() / m_dma_clock_divider[m_registers[DMA_CLOCK] & 0x0f]; if (!BIT(m_registers[DMA_WAIT_STATE], 0)) dma_clock /= 2; @@ -503,7 +503,7 @@ WRITE8_MEMBER( cs4031_device::config_address_w ) READ8_MEMBER( cs4031_device::config_data_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; if (m_address_valid) { @@ -891,7 +891,7 @@ WRITE8_MEMBER( cs4031_device::sysctrl_w ) READ8_MEMBER( cs4031_device::sysctrl_r ) { - UINT8 result = 0; // reserved bits read as 0? + uint8_t result = 0; // reserved bits read as 0? result |= m_cpureset << 0; result |= m_fast_gatea20 << 1; diff --git a/src/devices/machine/cs4031.h b/src/devices/machine/cs4031.h index 9a194a8699b..629f3ecd6c3 100644 --- a/src/devices/machine/cs4031.h +++ b/src/devices/machine/cs4031.h @@ -82,7 +82,7 @@ class cs4031_device : public device_t { public: // construction/destruction - cs4031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cs4031_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; @@ -108,9 +108,9 @@ public: DECLARE_READ8_MEMBER( dma1_ior1_r ) { return m_read_ior(1); } DECLARE_READ8_MEMBER( dma1_ior2_r ) { return m_read_ior(2); } DECLARE_READ8_MEMBER( dma1_ior3_r ) { return m_read_ior(3); } - DECLARE_READ8_MEMBER( dma2_ior1_r ) { UINT16 result = m_read_ior(5); m_dma_high_byte = result >> 8; return result; } - DECLARE_READ8_MEMBER( dma2_ior2_r ) { UINT16 result = m_read_ior(6); m_dma_high_byte = result >> 8; return result; } - DECLARE_READ8_MEMBER( dma2_ior3_r ) { UINT16 result = m_read_ior(7); m_dma_high_byte = result >> 8; return result; } + DECLARE_READ8_MEMBER( dma2_ior1_r ) { uint16_t result = m_read_ior(5); m_dma_high_byte = result >> 8; return result; } + DECLARE_READ8_MEMBER( dma2_ior2_r ) { uint16_t result = m_read_ior(6); m_dma_high_byte = result >> 8; return result; } + DECLARE_READ8_MEMBER( dma2_ior3_r ) { uint16_t result = m_read_ior(7); m_dma_high_byte = result >> 8; return result; } DECLARE_WRITE8_MEMBER( dma1_iow0_w ) { m_write_iow(0, data, 0xffff); } DECLARE_WRITE8_MEMBER( dma1_iow1_w ) { m_write_iow(1, data, 0xffff); } DECLARE_WRITE8_MEMBER( dma1_iow2_w ) { m_write_iow(2, data, 0xffff); } @@ -228,9 +228,9 @@ private: address_space *m_space; address_space *m_space_io; - UINT8 *m_isa; - UINT8 *m_bios; - UINT8 *m_ram; + uint8_t *m_isa; + uint8_t *m_bios; + uint8_t *m_ram; // ipc core devices required_device m_dma1; @@ -241,11 +241,11 @@ private: required_device m_rtc; int m_dma_eop; - UINT8 m_dma_page[0x10]; - UINT8 m_dma_high_byte; + uint8_t m_dma_page[0x10]; + uint8_t m_dma_high_byte; int m_dma_channel; - UINT8 m_portb; + uint8_t m_portb; int m_refresh_toggle; int m_iochck; int m_nmi_mask; @@ -276,10 +276,10 @@ private: SOFT_RESET_AND_GATEA20 = 0x1c }; - UINT8 m_address; + uint8_t m_address; bool m_address_valid; - UINT8 m_registers[0x20]; + uint8_t m_registers[0x20]; }; diff --git a/src/devices/machine/cs8221.cpp b/src/devices/machine/cs8221.cpp index d7f38de1bd7..2d3d0e2f218 100644 --- a/src/devices/machine/cs8221.cpp +++ b/src/devices/machine/cs8221.cpp @@ -58,7 +58,7 @@ static const char *const register_names[] = // cs8221_device - constructor //------------------------------------------------- -cs8221_device::cs8221_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cs8221_device::cs8221_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CS8221, "CS8221", tag, owner, clock, "cs8221", __FILE__), m_address(0), m_address_valid(false) @@ -118,7 +118,7 @@ WRITE8_MEMBER( cs8221_device::address_w ) READ8_MEMBER( cs8221_device::data_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; if (m_address_valid) { diff --git a/src/devices/machine/cs8221.h b/src/devices/machine/cs8221.h index b6a403bafba..6041ae76135 100644 --- a/src/devices/machine/cs8221.h +++ b/src/devices/machine/cs8221.h @@ -44,7 +44,7 @@ class cs8221_device : public device_t { public: // construction/destruction - cs8221_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cs8221_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( address_w ); DECLARE_READ8_MEMBER( data_r ); @@ -65,12 +65,12 @@ private: // internal state //address_space *m_space; - //UINT8 *m_isa; - //UINT8 *m_bios; - //UINT8 *m_ram; + //uint8_t *m_isa; + //uint8_t *m_bios; + //uint8_t *m_ram; // address selection - UINT8 m_address; + uint8_t m_address; bool m_address_valid; const char *m_cputag; @@ -78,7 +78,7 @@ private: const char *m_biostag; - UINT8 m_registers[0x10]; + uint8_t m_registers[0x10]; }; diff --git a/src/devices/machine/diablo_hd.cpp b/src/devices/machine/diablo_hd.cpp index d5147c2b3a2..6b32fd83495 100644 --- a/src/devices/machine/diablo_hd.cpp +++ b/src/devices/machine/diablo_hd.cpp @@ -57,7 +57,7 @@ * */ -diablo_hd_device::diablo_hd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +diablo_hd_device::diablo_hd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DIABLO_HD, "Diablo Disk", tag, owner, clock, "diablo_hd", __FILE__), #if DIABLO_DEBUG m_log_level(8), @@ -230,20 +230,20 @@ void diablo_hd_device::set_sector_callback(void *cookie, void (*callback)(void * * 256 words data */ typedef struct { - UINT8 pageno[2*DIABLO_PAGENO_WORDS]; //!< sector page number - UINT8 header[2*DIABLO_HEADER_WORDS]; //!< sector header words - UINT8 label[2*DIABLO_LABEL_WORDS]; //!< sector label words - UINT8 data[2*DIABLO_DATA_WORDS]; //!< sector data words + uint8_t pageno[2*DIABLO_PAGENO_WORDS]; //!< sector page number + uint8_t header[2*DIABLO_HEADER_WORDS]; //!< sector header words + uint8_t label[2*DIABLO_LABEL_WORDS]; //!< sector label words + uint8_t data[2*DIABLO_DATA_WORDS]; //!< sector data words } diablo_sector_t; /** - * @brief write a bit into an array of UINT32 + * @brief write a bit into an array of uint32_t * @param bits pointer to array of bits * @param dst destination index * @param bit bit value * @return next destination index */ -static inline size_t WRBIT(UINT32* bits, size_t dst, int bit) +static inline size_t WRBIT(uint32_t* bits, size_t dst, int bit) { if (bit) { bits[(dst)/32] |= 1 << ((dst) % 32); @@ -254,13 +254,13 @@ static inline size_t WRBIT(UINT32* bits, size_t dst, int bit) } /** - * @brief read a bit from an array of UINT32 + * @brief read a bit from an array of uint32_t * @param bits pointer to array of bits * @param src source index * @param bit reference to the bit to set * @return next source index */ -static inline size_t RDBIT(UINT32* bits, size_t src, int& bit) +static inline size_t RDBIT(uint32_t* bits, size_t src, int& bit) { bit = (bits[src/32] >> (src % 32)) & 1; return ++src; @@ -306,7 +306,7 @@ void diablo_hd_device::read_sector() if (m_disk) { // allocate a buffer for this page - m_cache[m_page] = std::make_unique(sizeof(diablo_sector_t)); + m_cache[m_page] = std::make_unique(sizeof(diablo_sector_t)); // and read the page from the hard_disk image if (hard_disk_read(m_disk, m_page, m_cache[m_page].get())) { LOG_DRIVE((2,"[DHD%u] CHS:%03d/%d/%02d => page:%d loaded\n", m_unit, m_cylinder, m_head, m_sector, m_page)); @@ -327,7 +327,7 @@ void diablo_hd_device::read_sector() * @param start start value for the checksum * @return returns the checksum of the record */ -int diablo_hd_device::cksum(UINT8 *src, size_t size, int start) +int diablo_hd_device::cksum(uint8_t *src, size_t size, int start) { int sum = start; /* compute XOR of all words */ @@ -346,7 +346,7 @@ int diablo_hd_device::cksum(UINT8 *src, size_t size, int start) * @param size number of words to write * @return offset to next destination bit */ -size_t diablo_hd_device::expand_zeroes(UINT32 *bits, size_t dst, size_t size) +size_t diablo_hd_device::expand_zeroes(uint32_t *bits, size_t dst, size_t size) { for (size_t offs = 0; offs < 32 * size; offs += 2) { dst = WRBIT(bits, dst, 1); // write the clock bit @@ -363,7 +363,7 @@ size_t diablo_hd_device::expand_zeroes(UINT32 *bits, size_t dst, size_t size) * @param size number of words to write * @return offset to next destination bit */ -size_t diablo_hd_device::expand_sync(UINT32 *bits, size_t dst, size_t size) +size_t diablo_hd_device::expand_sync(uint32_t *bits, size_t dst, size_t size) { for (size_t offs = 0; offs < 32 * size - 2; offs += 2) { dst = WRBIT(bits, dst, 1); // write the clock bit @@ -383,7 +383,7 @@ size_t diablo_hd_device::expand_sync(UINT32 *bits, size_t dst, size_t size) * @param size size of the record in bytes * @return offset to next destination bit */ -size_t diablo_hd_device::expand_record(UINT32 *bits, size_t dst, UINT8 *field, size_t size) +size_t diablo_hd_device::expand_record(uint32_t *bits, size_t dst, uint8_t *field, size_t size) { for (size_t offs = 0; offs < size; offs += 2) { int word = field[size - 2 - offs] + 256 * field[size - 2 - offs + 1]; @@ -405,7 +405,7 @@ size_t diablo_hd_device::expand_record(UINT32 *bits, size_t dst, UINT8 *field, s * @param size size of the record in bytes * @return offset to next destination bit */ -size_t diablo_hd_device::expand_cksum(UINT32 *bits, size_t dst, UINT8 *field, size_t size) +size_t diablo_hd_device::expand_cksum(uint32_t *bits, size_t dst, uint8_t *field, size_t size) { int word = cksum(field, size, 0521); for (size_t bit = 0; bit < 32; bit += 2) { @@ -422,7 +422,7 @@ size_t diablo_hd_device::expand_cksum(UINT32 *bits, size_t dst, UINT8 *field, si * @param page page number (0 to DRIVE_PAGES-1) * @return pointer to the newly allocated array of bits */ -UINT32* diablo_hd_device::expand_sector() +uint32_t* diablo_hd_device::expand_sector() { size_t dst; @@ -440,7 +440,7 @@ UINT32* diablo_hd_device::expand_sector() diablo_sector_t *s = reinterpret_cast(m_cache[m_page].get()); /* allocate a bits image */ - UINT32 *bits = auto_alloc_array_clear(machine(), UINT32, 400); + uint32_t *bits = auto_alloc_array_clear(machine(), uint32_t, 400); if (m_diablo31) { /* write sync bit after (MFROBL-MRPAL) words - 1 bit */ @@ -492,7 +492,7 @@ UINT32* diablo_hd_device::expand_sector() } #if DIABLO_DEBUG -void diablo_hd_device::dump_ascii(UINT8 *src, size_t size) +void diablo_hd_device::dump_ascii(uint8_t *src, size_t size) { size_t offs; LOG_DRIVE((0," [")); @@ -511,7 +511,7 @@ void diablo_hd_device::dump_ascii(UINT8 *src, size_t size) * @param size size of the record in bytes * @param name name to print before the dump */ -size_t diablo_hd_device::dump_record(UINT8 *src, size_t addr, size_t size, const char *name, int cr) +size_t diablo_hd_device::dump_record(uint8_t *src, size_t addr, size_t size, const char *name, int cr) { size_t offs; LOG_DRIVE((0,"%s:", name)); @@ -545,9 +545,9 @@ size_t diablo_hd_device::dump_record(UINT8 *src, size_t addr, size_t size, const * @param size number of words to scan for a sync word * @return next source index for reading */ -size_t diablo_hd_device::squeeze_sync(UINT32 *bits, size_t src, size_t size) +size_t diablo_hd_device::squeeze_sync(uint32_t *bits, size_t src, size_t size) { - UINT32 accu = 0; + uint32_t accu = 0; /* hunt for the first 0x0001 word */ for (size_t bitcount = 0, offs = 0; offs < size; /* */) { /* @@ -581,9 +581,9 @@ size_t diablo_hd_device::squeeze_sync(UINT32 *bits, size_t src, size_t size) * @param size number of words to scan for a sync word * @return next source index for reading */ -size_t diablo_hd_device::squeeze_unsync(UINT32 *bits, size_t src, size_t size) +size_t diablo_hd_device::squeeze_unsync(uint32_t *bits, size_t src, size_t size) { - UINT32 accu = 0; + uint32_t accu = 0; /* hunt for the first 0 word (16 x 0 bits) */ for (size_t bitcount = 0, offs = 0; offs < size; /* */) { /* @@ -617,9 +617,9 @@ size_t diablo_hd_device::squeeze_unsync(UINT32 *bits, size_t src, size_t size) * @param size size of the record in bytes * @return next source index for reading */ -size_t diablo_hd_device::squeeze_record(UINT32 *bits, size_t src, UINT8 *field, size_t size) +size_t diablo_hd_device::squeeze_record(uint32_t *bits, size_t src, uint8_t *field, size_t size) { - UINT32 accu = 0; + uint32_t accu = 0; for (size_t bitcount = 0, offs = 0; offs < size; /* */) { int bit; src = RDBIT(bits,src,bit); // skip clock @@ -646,9 +646,9 @@ size_t diablo_hd_device::squeeze_record(UINT32 *bits, size_t src, UINT8 *field, * @param cksum pointer to an int to receive the checksum word * @return next source index for reading */ -size_t diablo_hd_device::squeeze_cksum(UINT32 *bits, size_t src, int *cksum) +size_t diablo_hd_device::squeeze_cksum(uint32_t *bits, size_t src, int *cksum) { - UINT32 accu = 0; + uint32_t accu = 0; for (size_t bitcount = 0; bitcount < 32; bitcount += 2) { int bit; @@ -719,7 +719,7 @@ void diablo_hd_device::squeeze_sector() LOG_DRIVE((0,"[DHD%u] no bits\n", m_unit)); return; } - UINT32 *bits = m_bits[m_page]; + uint32_t *bits = m_bits[m_page]; // pointer to sector buffer s = reinterpret_cast(m_cache[m_page].get()); @@ -1159,7 +1159,7 @@ void diablo_hd_device::wr_data(int index, int wrdata) return; // invalid page } - UINT32 *bits = expand_sector(); + uint32_t *bits = expand_sector(); if (!bits) { LOG_DRIVE((0,"[DHD%u] no bits\n", m_unit)); return; // invalid unit @@ -1211,7 +1211,7 @@ int diablo_hd_device::rd_data(int index) return 1; // invalid unit } - UINT32 *bits = expand_sector(); + uint32_t *bits = expand_sector(); if (!bits) { LOG_DRIVE((0,"[DHD%u] no bits\n", m_unit)); return 1; // invalid page @@ -1254,7 +1254,7 @@ int diablo_hd_device::rd_clock(int index) return 1; // invalid page } - UINT32 *bits = expand_sector(); + uint32_t *bits = expand_sector(); if (!bits) { LOG_DRIVE((0,"[DHD%u] no bits\n", m_unit)); return 1; // invalid unit @@ -1399,7 +1399,7 @@ void diablo_hd_device::device_reset() if (!m_handle) return; // for units with a CHD assigned to them start the timer - m_bits = auto_alloc_array_clear(machine(), UINT32*, m_pages); + m_bits = auto_alloc_array_clear(machine(), uint32_t*, m_pages); timer_set(m_sector_time - m_sector_mark_0_time, 1, 0); read_sector(); } diff --git a/src/devices/machine/diablo_hd.h b/src/devices/machine/diablo_hd.h index 786e8ed1139..9601d69dc5d 100644 --- a/src/devices/machine/diablo_hd.h +++ b/src/devices/machine/diablo_hd.h @@ -22,7 +22,7 @@ extern const device_type DIABLO_HD; class diablo_hd_device : public device_t { public: - diablo_hd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + diablo_hd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~diablo_hd_device(); static const int DIABLO_UNIT_MAX = 2; //!< max number of drive units @@ -108,8 +108,8 @@ private: int m_head; //!< current head (track) number on cylinder int m_sector; //!< current sector number in track int m_page; //!< current page (derived from cylinder, head and sector) - std::unique_ptr m_cache[2 * DIABLO_PAGES]; //!< pages raw bytes - UINT32** m_bits; //!< pages expanded to bits + std::unique_ptr m_cache[2 * DIABLO_PAGES]; //!< pages raw bytes + uint32_t** m_bits; //!< pages expanded to bits int m_rdfirst; //!< set to first bit of a sector that is read from int m_rdlast; //!< set to last bit of a sector that was read from int m_wrfirst; //!< set to non-zero if a sector is written to @@ -125,42 +125,42 @@ private: void read_sector(); //! compute the checksum of a record - int cksum(UINT8 *src, size_t size, int start); + int cksum(uint8_t *src, size_t size, int start); //! expand a series of clock bits and 0 data bits - size_t expand_zeroes(UINT32 *bits, size_t dst, size_t size); + size_t expand_zeroes(uint32_t *bits, size_t dst, size_t size); //! expand a series of 0 words and write a final sync bit - size_t expand_sync(UINT32 *bits, size_t dst, size_t size); + size_t expand_sync(uint32_t *bits, size_t dst, size_t size); //! expand a record of words into a array of bits at dst - size_t expand_record(UINT32 *bits, size_t dst, UINT8 *field, size_t size); + size_t expand_record(uint32_t *bits, size_t dst, uint8_t *field, size_t size); //! expand a record's checksum word to 32 bits - size_t expand_cksum(UINT32 *bits, size_t dst, UINT8 *field, size_t size); + size_t expand_cksum(uint32_t *bits, size_t dst, uint8_t *field, size_t size); //! expand a sector into an array of clock and data bits - UINT32* expand_sector(); + uint32_t* expand_sector(); #if DIABLO_DEBUG //! dump a number of words as ASCII characters - void dump_ascii(UINT8 *src, size_t size); + void dump_ascii(uint8_t *src, size_t size); //! dump a record's contents - size_t dump_record(UINT8 *src, size_t addr, size_t size, const char *name, int cr); + size_t dump_record(uint8_t *src, size_t addr, size_t size, const char *name, int cr); #endif //! find a sync bit in an array of clock and data bits - size_t squeeze_sync(UINT32 *bits, size_t src, size_t size); + size_t squeeze_sync(uint32_t *bits, size_t src, size_t size); //! find a 16 x 0 bits sequence in an array of clock and data bits - size_t squeeze_unsync(UINT32 *bits, size_t src, size_t size); + size_t squeeze_unsync(uint32_t *bits, size_t src, size_t size); //! squeeze an array of clock and data bits into a sector's record - size_t squeeze_record(UINT32 *bits, size_t src, UINT8 *field, size_t size); + size_t squeeze_record(uint32_t *bits, size_t src, uint8_t *field, size_t size); //! squeeze an array of 32 clock and data bits into a checksum word - size_t squeeze_cksum(UINT32 *bits, size_t src, int *cksum); + size_t squeeze_cksum(uint32_t *bits, size_t src, int *cksum); //! squeeze a array of clock and data bits into a sector's data void squeeze_sector(); diff --git a/src/devices/machine/dmac.cpp b/src/devices/machine/dmac.cpp index ba1167eb2d5..ae7fe93efba 100644 --- a/src/devices/machine/dmac.cpp +++ b/src/devices/machine/dmac.cpp @@ -37,7 +37,7 @@ const device_type DMAC = &device_creator; // dmac_device - constructor //------------------------------------------------- -dmac_device::dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dmac_device::dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMAC, "DMAC DMA Controller", tag, owner, clock, "dmac", __FILE__), amiga_autoconfig(), m_cfgout_handler(*this), @@ -174,7 +174,7 @@ void dmac_device::start_dma() READ16_MEMBER( dmac_device::register_read ) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; // autoconfig handles this if (offset < 0x20) @@ -275,7 +275,7 @@ WRITE16_MEMBER( dmac_device::register_write ) logerror("%s('%s'): write wtc hi %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); m_wtc &= 0x0000ffff; - m_wtc |= ((UINT32) data) << 16; + m_wtc |= ((uint32_t) data) << 16; break; case 0x41: @@ -291,7 +291,7 @@ WRITE16_MEMBER( dmac_device::register_write ) logerror("%s('%s'): write acr hi %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); m_acr &= 0x0000ffff; - m_acr |= ((UINT32) data) << 16; + m_acr |= ((uint32_t) data) << 16; break; case 0x43: diff --git a/src/devices/machine/dmac.h b/src/devices/machine/dmac.h index 8580b4c86ab..6dcf201eb3b 100644 --- a/src/devices/machine/dmac.h +++ b/src/devices/machine/dmac.h @@ -55,7 +55,7 @@ class dmac_device : public device_t, public amiga_autoconfig { public: // construction/destruction - dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // callbacks template static devcb_base &set_cfgout_handler(device_t &device, _Object object) @@ -80,8 +80,8 @@ public: { return downcast(device).m_io_write_handler.set_callback(object); } void set_address_space(address_space *space) { m_space = space; }; - void set_rom(UINT8 *rom) { m_rom = rom; }; - void set_ram(UINT8 *ram) { m_ram = ram; }; + void set_rom(uint8_t *rom) { m_rom = rom; }; + void set_ram(uint8_t *ram) { m_ram = ram; }; // input lines DECLARE_WRITE_LINE_MEMBER( configin_w ); @@ -140,8 +140,8 @@ private: devcb_write8 m_io_write_handler; address_space *m_space; - UINT8 *m_rom; - UINT8 *m_ram; + uint8_t *m_rom; + uint8_t *m_ram; int m_ram_size; // autoconfig state @@ -151,10 +151,10 @@ private: int m_rst; // register - UINT16 m_cntr; // control register - UINT16 m_istr; // interrupt status register - UINT32 m_wtc; // word transfer count - UINT32 m_acr; // address control register + uint16_t m_cntr; // control register + uint16_t m_istr; // interrupt status register + uint32_t m_wtc; // word transfer count + uint32_t m_acr; // address control register bool m_dma_active; diff --git a/src/devices/machine/dp8390.cpp b/src/devices/machine/dp8390.cpp index 32d41d73896..64f6fcbb407 100644 --- a/src/devices/machine/dp8390.cpp +++ b/src/devices/machine/dp8390.cpp @@ -9,17 +9,17 @@ const device_type DP8390D = &device_creator; const device_type RTL8019A = &device_creator; -dp8390d_device::dp8390d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dp8390d_device::dp8390d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dp8390_device(mconfig, DP8390D, "DP8390D", tag, owner, clock, 10.0f, "dp8390d", __FILE__) { m_type = TYPE_DP8390D; } -rtl8019a_device::rtl8019a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rtl8019a_device::rtl8019a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dp8390_device(mconfig, RTL8019A, "RTL8019A", tag, owner, clock, 10.0f, "rtl8019a", __FILE__) { m_type = TYPE_RTL8019A; } -dp8390_device::dp8390_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, float bandwidth, const char *shortname, const char *source) +dp8390_device::dp8390_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, float bandwidth, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_network_interface(mconfig, *this, bandwidth), m_type(0), m_irq_cb(*this), @@ -64,9 +64,9 @@ void dp8390_device::check_dma_complete() { } void dp8390_device::do_tx() { - std::vector buf; + std::vector buf; int i; - UINT32 high16 = (m_regs.dcr & 4)?m_regs.rsar<<16:0; + uint32_t high16 = (m_regs.dcr & 4)?m_regs.rsar<<16:0; if(m_reset) return; if(LOOPBACK) return; // TODO: loopback m_regs.tsr = 0; @@ -91,7 +91,7 @@ void dp8390_device::do_tx() { check_irq(); } -void dp8390_device::set_cr(UINT8 newcr) { +void dp8390_device::set_cr(uint8_t newcr) { int ostate = ((m_regs.cr & 3) == 2); m_regs.cr = newcr; if((newcr & 1) && (ostate == 1)) return stop(); @@ -117,10 +117,10 @@ void dp8390_device::recv_overflow() { return; } -void dp8390_device::recv(UINT8 *buf, int len) { +void dp8390_device::recv(uint8_t *buf, int len) { int i; - UINT16 start = (m_regs.curr << 8), offset; - UINT32 high16; + uint16_t start = (m_regs.curr << 8), offset; + uint32_t high16; if(m_reset) return; if(m_regs.curr == m_regs.pstop) start = m_regs.pstart << 8; offset = start + 4; @@ -162,7 +162,7 @@ void dp8390_device::recv(UINT8 *buf, int len) { check_irq(); } -void dp8390_device::recv_cb(UINT8 *buf, int len) { +void dp8390_device::recv_cb(uint8_t *buf, int len) { if(!LOOPBACK) recv(buf, len); } @@ -175,9 +175,9 @@ WRITE_LINE_MEMBER(dp8390_device::dp8390_reset) { } READ16_MEMBER(dp8390_device::dp8390_r) { - UINT16 data; + uint16_t data; if(m_cs) { - UINT32 high16 = (m_regs.dcr & 4)?m_regs.rsar<<16:0; + uint32_t high16 = (m_regs.dcr & 4)?m_regs.rsar<<16:0; if(m_regs.dcr & 1) { m_regs.crda &= ~1; data = m_mem_read_cb(high16 + m_regs.crda++); @@ -346,7 +346,7 @@ READ16_MEMBER(dp8390_device::dp8390_r) { WRITE16_MEMBER(dp8390_device::dp8390_w) { if(m_cs) { - UINT32 high16 = (m_regs.dcr & 4)?m_regs.rsar<<16:0; + uint32_t high16 = (m_regs.dcr & 4)?m_regs.rsar<<16:0; if(m_regs.dcr & 1) { data = DP8390_BYTE_ORDER(data); m_regs.crda &= ~1; diff --git a/src/devices/machine/dp8390.h b/src/devices/machine/dp8390.h index 49341e30e49..9f21cee9e75 100644 --- a/src/devices/machine/dp8390.h +++ b/src/devices/machine/dp8390.h @@ -38,7 +38,7 @@ class dp8390_device : public device_t, { public: // construction/destruction - dp8390_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, float bandwidth, const char *shortname, const char *source); + dp8390_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, float bandwidth, const char *shortname, const char *source); template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } template static devcb_base &set_breq_callback(device_t &device, _Object object) { return downcast(device).m_breq_cb.set_callback(object); } @@ -49,7 +49,7 @@ public: DECLARE_READ16_MEMBER( dp8390_r ); DECLARE_WRITE_LINE_MEMBER( dp8390_cs ); DECLARE_WRITE_LINE_MEMBER( dp8390_reset ); - void recv_cb(UINT8 *buf, int len) override; + void recv_cb(uint8_t *buf, int len) override; protected: // device-level overrides @@ -69,74 +69,74 @@ private: devcb_read8 m_mem_read_cb; devcb_write8 m_mem_write_cb; - void set_cr(UINT8 newcr); + void set_cr(uint8_t newcr); void check_dma_complete(); void do_tx(); void check_irq() { m_irq_cb((m_regs.imr & m_regs.isr & 0x7f)?ASSERT_LINE:CLEAR_LINE); } void recv_overflow(); void stop(); - void recv(UINT8 *buf, int len); + void recv(uint8_t *buf, int len); int m_reset; bool m_cs; int m_rdma_active; struct { - UINT8 cr; - UINT16 clda; - UINT8 pstart; - UINT8 pstop; - UINT8 bnry; - UINT8 tsr; - UINT8 tpsr; - UINT8 ncr; - UINT8 fifo; - UINT16 tbcr; - UINT8 isr; - UINT16 crda; - UINT16 rsar; - UINT16 rbcr; - UINT8 rsr; - UINT8 rcr; - UINT8 cntr0; - UINT8 tcr; - UINT8 cntr1; - UINT8 dcr; - UINT8 cntr2; - UINT8 imr; - - UINT8 par[6]; - UINT8 curr; - UINT8 mar[8]; - - UINT8 rnpp; - UINT8 lnpp; - UINT16 ac; + uint8_t cr; + uint16_t clda; + uint8_t pstart; + uint8_t pstop; + uint8_t bnry; + uint8_t tsr; + uint8_t tpsr; + uint8_t ncr; + uint8_t fifo; + uint16_t tbcr; + uint8_t isr; + uint16_t crda; + uint16_t rsar; + uint16_t rbcr; + uint8_t rsr; + uint8_t rcr; + uint8_t cntr0; + uint8_t tcr; + uint8_t cntr1; + uint8_t dcr; + uint8_t cntr2; + uint8_t imr; + + uint8_t par[6]; + uint8_t curr; + uint8_t mar[8]; + + uint8_t rnpp; + uint8_t lnpp; + uint16_t ac; } m_regs; struct { - UINT8 cr9346; - UINT8 bpage; - UINT8 config0; - UINT8 config1; - UINT8 config2; - UINT8 config3; - UINT8 config4; - UINT8 csnsav; - UINT8 intr; + uint8_t cr9346; + uint8_t bpage; + uint8_t config0; + uint8_t config1; + uint8_t config2; + uint8_t config3; + uint8_t config4; + uint8_t csnsav; + uint8_t intr; } m_8019regs; }; class rtl8019a_device : public dp8390_device { public: - rtl8019a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rtl8019a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class dp8390d_device : public dp8390_device { public: - dp8390d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dp8390d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // device type definition diff --git a/src/devices/machine/ds1204.cpp b/src/devices/machine/ds1204.cpp index 56d57267ad3..62df5bce313 100644 --- a/src/devices/machine/ds1204.cpp +++ b/src/devices/machine/ds1204.cpp @@ -29,7 +29,7 @@ inline void ATTR_PRINTF( 3, 4 ) ds1204_device::verboselog( int n_level, const ch // device type definition const device_type DS1204 = &device_creator; -ds1204_device::ds1204_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +ds1204_device::ds1204_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t( mconfig, DS1204, "DS1204", tag, owner, clock, "ds1204", __FILE__ ), device_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -80,7 +80,7 @@ void ds1204_device::nvram_default() } else { - UINT8 *region = m_region->base(); + uint8_t *region = m_region->base(); memcpy( m_unique_pattern, region, sizeof( m_unique_pattern ) ); region += sizeof( m_unique_pattern ); memcpy( m_identification, region, sizeof( m_identification ) ); region += sizeof( m_identification ); @@ -111,7 +111,7 @@ void ds1204_device::new_state( int state ) m_bit = 0; } -void ds1204_device::writebit( UINT8 *buffer ) +void ds1204_device::writebit( uint8_t *buffer ) { if( m_clk ) { @@ -131,7 +131,7 @@ void ds1204_device::writebit( UINT8 *buffer ) } } -void ds1204_device::readbit( UINT8 *buffer ) +void ds1204_device::readbit( uint8_t *buffer ) { if( !m_clk ) { diff --git a/src/devices/machine/ds1204.h b/src/devices/machine/ds1204.h index 35e84c7771f..20d80bad208 100644 --- a/src/devices/machine/ds1204.h +++ b/src/devices/machine/ds1204.h @@ -22,7 +22,7 @@ class ds1204_device : public device_t, { public: // construction/destruction - ds1204_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ); + ds1204_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); DECLARE_WRITE_LINE_MEMBER( write_rst ); DECLARE_WRITE_LINE_MEMBER( write_clk ); @@ -41,8 +41,8 @@ protected: private: inline void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, const char *s_fmt, ... ); void new_state(int state); - void writebit(UINT8 *buffer); - void readbit(UINT8 *buffer); + void writebit(uint8_t *buffer); + void readbit(uint8_t *buffer); enum state_t { @@ -80,12 +80,12 @@ private: int m_dqr; int m_state; int m_bit; - UINT8 m_command[3]; - UINT8 m_compare_register[8]; - UINT8 m_unique_pattern[2]; - UINT8 m_identification[8]; - UINT8 m_security_match[8]; - UINT8 m_secure_memory[16]; + uint8_t m_command[3]; + uint8_t m_compare_register[8]; + uint8_t m_unique_pattern[2]; + uint8_t m_identification[8]; + uint8_t m_security_match[8]; + uint8_t m_secure_memory[16]; }; diff --git a/src/devices/machine/ds128x.cpp b/src/devices/machine/ds128x.cpp index 5b7fa8e0663..c39e239d6a7 100644 --- a/src/devices/machine/ds128x.cpp +++ b/src/devices/machine/ds128x.cpp @@ -10,7 +10,7 @@ const device_type DS12885 = &device_creator; // ds12885_device - constructor //------------------------------------------------- -ds12885_device::ds12885_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds12885_device::ds12885_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc146818_device(mconfig, DS12885, "DS12885", tag, owner, clock, "ds12885", __FILE__) { } diff --git a/src/devices/machine/ds128x.h b/src/devices/machine/ds128x.h index 7dbd2deb92c..feb10b84ecd 100644 --- a/src/devices/machine/ds128x.h +++ b/src/devices/machine/ds128x.h @@ -14,7 +14,7 @@ class ds12885_device : public mc146818_device { public: // construction/destruction - ds12885_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds12885_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int data_size() override { return 128; } diff --git a/src/devices/machine/ds1302.cpp b/src/devices/machine/ds1302.cpp index b6f6b0675b4..1f5c1ad4718 100644 --- a/src/devices/machine/ds1302.cpp +++ b/src/devices/machine/ds1302.cpp @@ -72,7 +72,7 @@ const device_type DS1302 = &device_creator; // ds1302_device - constructor //------------------------------------------------- -ds1302_device::ds1302_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds1302_device::ds1302_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS1302, "DS1302", tag, owner, clock, "ds1302", __FILE__), device_rtc_interface(mconfig, *this), device_nvram_interface(mconfig, *this) diff --git a/src/devices/machine/ds1302.h b/src/devices/machine/ds1302.h index 273bd6bbc9e..b3e318a86f0 100644 --- a/src/devices/machine/ds1302.h +++ b/src/devices/machine/ds1302.h @@ -44,7 +44,7 @@ class ds1302_device : public device_t, { public: // construction/destruction - ds1302_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds1302_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( ce_w ); DECLARE_WRITE_LINE_MEMBER( sclk_w ); @@ -76,13 +76,13 @@ private: int m_io; int m_state; int m_bits; - UINT8 m_cmd; - UINT8 m_data; + uint8_t m_cmd; + uint8_t m_data; int m_addr; - UINT8 m_reg[9]; - UINT8 m_user[9]; - UINT8 m_ram[0x20]; + uint8_t m_reg[9]; + uint8_t m_user[9]; + uint8_t m_ram[0x20]; // timers emu_timer *m_clock_timer; diff --git a/src/devices/machine/ds1315.cpp b/src/devices/machine/ds1315.cpp index e9c984e4716..ca07dfcd24e 100644 --- a/src/devices/machine/ds1315.cpp +++ b/src/devices/machine/ds1315.cpp @@ -27,7 +27,7 @@ const device_type DS1315 = &device_creator; -ds1315_device::ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds1315_device::ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS1315, "Dallas Semiconductor DS1315", tag, owner, clock, "ds1315", __FILE__), m_mode(), m_count(0) { } @@ -69,7 +69,7 @@ void ds1315_device::device_reset() LOCAL VARIABLES ***************************************************************************/ -static const UINT8 ds1315_pattern[] = +static const uint8_t ds1315_pattern[] = { 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, @@ -135,7 +135,7 @@ READ8_MEMBER( ds1315_device::read_1 ) READ8_MEMBER( ds1315_device::read_data ) { - UINT8 result; + uint8_t result; if (m_mode == DS_CALENDAR_IO) { @@ -233,7 +233,7 @@ void ds1315_device::input_raw_data() { int raw[8], i, j; raw[0] = raw[1] = raw[2] = raw[3] = raw[4] = raw[5] = raw[6] = raw[7] = 0; - UINT8 flag = 1; + uint8_t flag = 1; for (i = 0; i < 64; i++) { diff --git a/src/devices/machine/ds1315.h b/src/devices/machine/ds1315.h index 1894a05aac7..5fb02f4a694 100644 --- a/src/devices/machine/ds1315.h +++ b/src/devices/machine/ds1315.h @@ -31,7 +31,7 @@ ALLOW_SAVE_TYPE(ds1315_mode_t); class ds1315_device : public device_t { public: - ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~ds1315_device() {} DECLARE_READ8_MEMBER(read_0); @@ -56,7 +56,7 @@ private: void input_raw_data(); int m_count; - UINT8 m_raw_data[8*8]; + uint8_t m_raw_data[8*8]; }; extern const device_type DS1315; diff --git a/src/devices/machine/ds1386.cpp b/src/devices/machine/ds1386.cpp index 91a6e2f9c06..22d2e51c95b 100644 --- a/src/devices/machine/ds1386.cpp +++ b/src/devices/machine/ds1386.cpp @@ -29,7 +29,7 @@ const device_type DS1386_8K = &device_creator; const device_type DS1386_32K = &device_creator; -ds1386_device::ds1386_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, size_t size) +ds1386_device::ds1386_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, size_t size) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__) , device_nvram_interface(mconfig, *this) , m_tod_alarm(0) @@ -59,12 +59,12 @@ ds1386_device::ds1386_device(const machine_config &mconfig, device_type type, co { } -ds1386_8k_device::ds1386_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds1386_8k_device::ds1386_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ds1386_device(mconfig, DS1386_8K, "DS1386-8K", tag, owner, clock, "ds1386_8k", 8192) { } -ds1386_32k_device::ds1386_32k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds1386_32k_device::ds1386_32k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ds1386_device(mconfig, DS1386_32K, "DS1386-32K", tag, owner, clock, "ds1386_32k", 32768) { } @@ -120,7 +120,7 @@ void ds1386_device::device_start() save_item(NAME(m_watchdog_alarm)); save_item(NAME(m_square)); - m_ram = std::make_unique(m_ram_size); + m_ram = std::make_unique(m_ram_size); memset(&m_ram[0], 0, m_ram_size); } @@ -265,9 +265,9 @@ void ds1386_device::advance_hundredths() } if (carry) { - UINT8 value = 0; - UINT8 min_value = 0; - UINT8 max_value = 0; + uint8_t value = 0; + uint8_t min_value = 0; + uint8_t max_value = 0; if (m_hours & HOURS_12_24) { value = m_hours & 0x1f; @@ -309,13 +309,13 @@ void ds1386_device::advance_hundredths() if (carry) { - UINT8 maxdays; - static const UINT8 daysinmonth[] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; + uint8_t maxdays; + static const uint8_t daysinmonth[] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; time_helper::inc_bcd(&m_days, 0x07, 0x01, 0x07); - UINT8 month = time_helper::from_bcd(m_months_enables); - UINT8 year = time_helper::from_bcd(m_years); + uint8_t month = time_helper::from_bcd(m_months_enables); + uint8_t year = time_helper::from_bcd(m_years); if (month == 2 && (year % 4) == 0) { @@ -334,7 +334,7 @@ void ds1386_device::advance_hundredths() } if (carry) { - UINT8 enables = m_months_enables & 0xc0; + uint8_t enables = m_months_enables & 0xc0; carry = time_helper::inc_bcd(&m_months_enables, 0x1f, 0x01, 0x12); m_months_enables &= 0x3f; m_months_enables |= enables; @@ -378,7 +378,7 @@ void ds1386_device::copy_registers_to_ram() void ds1386_device::check_tod_alarm() { - UINT8 mode = BIT(m_days_alarm, 7) | (BIT(m_hours_alarm, 5) << 1) | (BIT(m_minutes_alarm, 3) << 2); + uint8_t mode = BIT(m_days_alarm, 7) | (BIT(m_hours_alarm, 5) << 1) | (BIT(m_minutes_alarm, 3) << 2); bool zeroes = (m_hundredths == 0 && m_seconds == 0); if (zeroes && (m_ram[REGISTER_COMMAND] & COMMAND_TDF) == 0) { @@ -465,9 +465,9 @@ WRITE8_MEMBER( ds1386_device::data_w ) case 0x09: // months { - UINT8 old_value = m_ram[offset]; + uint8_t old_value = m_ram[offset]; m_ram[offset] = data & 0xdf; - UINT8 changed = old_value ^ data; + uint8_t changed = old_value ^ data; if (changed & DISABLE_SQW) { if (m_ram[offset] & DISABLE_SQW) @@ -506,8 +506,8 @@ WRITE8_MEMBER( ds1386_device::data_w ) safe_inta_cb(0); } m_ram[offset] = data; - UINT8 wd_hundredths = m_ram[REGISTER_WATCHDOG_HUNDREDTHS]; - UINT8 wd_seconds = m_ram[REGISTER_WATCHDOG_SECONDS]; + uint8_t wd_hundredths = m_ram[REGISTER_WATCHDOG_HUNDREDTHS]; + uint8_t wd_seconds = m_ram[REGISTER_WATCHDOG_SECONDS]; int total_hundredths = (wd_hundredths & 0xf) + ((wd_hundredths >> 4) & 0xf) * 10 + (wd_seconds & 0xf) * 100 + ((wd_seconds >> 4) & 0xf) * 1000; m_watchdog_timer->adjust(attotime::from_msec(total_hundredths * 10)); break; @@ -515,9 +515,9 @@ WRITE8_MEMBER( ds1386_device::data_w ) case 0x0b: // command { - UINT8 old = m_ram[offset]; + uint8_t old = m_ram[offset]; m_ram[offset] = data & 0xfc; - UINT8 changed = old ^ m_ram[offset]; + uint8_t changed = old ^ m_ram[offset]; if (changed & COMMAND_IPSW) { int old_a = (old & COMMAND_IPSW) ? m_tod_alarm : m_watchdog_alarm; diff --git a/src/devices/machine/ds1386.h b/src/devices/machine/ds1386.h index 1146416b923..b7aa5beb93d 100644 --- a/src/devices/machine/ds1386.h +++ b/src/devices/machine/ds1386.h @@ -81,7 +81,7 @@ class ds1386_device : public device_t, public device_nvram_interface { public: - ds1386_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, size_t size); + ds1386_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, size_t size); DECLARE_WRITE8_MEMBER( data_w ); DECLARE_READ8_MEMBER( data_r ); @@ -171,20 +171,20 @@ protected: emu_timer *m_inta_timer; emu_timer *m_intb_timer; - std::unique_ptr m_ram; - optional_region_ptr m_default_data; - - UINT8 m_hundredths; - UINT8 m_seconds; - UINT8 m_minutes; - UINT8 m_minutes_alarm; - UINT8 m_hours; - UINT8 m_hours_alarm; - UINT8 m_days; - UINT8 m_days_alarm; - UINT8 m_date; - UINT8 m_months_enables; - UINT8 m_years; + std::unique_ptr m_ram; + optional_region_ptr m_default_data; + + uint8_t m_hundredths; + uint8_t m_seconds; + uint8_t m_minutes; + uint8_t m_minutes_alarm; + uint8_t m_hours; + uint8_t m_hours_alarm; + uint8_t m_days; + uint8_t m_days_alarm; + uint8_t m_date; + uint8_t m_months_enables; + uint8_t m_years; const size_t m_ram_size; }; @@ -193,14 +193,14 @@ class ds1386_8k_device : public ds1386_device { public: // construction/destruction - ds1386_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds1386_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ds1386_32k_device : public ds1386_device { public: // construction/destruction - ds1386_32k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds1386_32k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // device type definition diff --git a/src/devices/machine/ds2401.cpp b/src/devices/machine/ds2401.cpp index 154deaea628..663b89ce493 100644 --- a/src/devices/machine/ds2401.cpp +++ b/src/devices/machine/ds2401.cpp @@ -29,7 +29,7 @@ inline void ds2401_device::verboselog(int n_level, const char *s_fmt, ...) // device type definition const device_type DS2401 = &device_creator; -ds2401_device::ds2401_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds2401_device::ds2401_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS2401, "DS2401", tag, owner, clock, "ds2401", __FILE__), m_state(0), m_bit(0), m_shift(0), m_byte(0), m_rx(false), m_tx(false), m_timer_main(nullptr), m_timer_reset(nullptr) { } @@ -228,7 +228,7 @@ READ_LINE_MEMBER( ds2401_device::read ) return m_tx && m_rx; } -UINT8 ds2401_device::direct_read(int index) +uint8_t ds2401_device::direct_read(int index) { return m_data[index]; } diff --git a/src/devices/machine/ds2401.h b/src/devices/machine/ds2401.h index 5f4d87131f0..bfeb5c2f6a4 100644 --- a/src/devices/machine/ds2401.h +++ b/src/devices/machine/ds2401.h @@ -20,11 +20,11 @@ class ds2401_device : public device_t { public: // construction/destruction - ds2401_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds2401_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( write ); DECLARE_READ_LINE_MEMBER( read ); - UINT8 direct_read(int index); + uint8_t direct_read(int index); protected: enum { @@ -55,9 +55,9 @@ protected: // internal state int m_state, m_bit, m_shift; - UINT8 m_byte; + uint8_t m_byte; bool m_rx, m_tx; - UINT8 m_data[SIZE_DATA]; + uint8_t m_data[SIZE_DATA]; emu_timer *m_timer_main, *m_timer_reset; attotime t_samp, t_rdv, t_rstl, t_pdh, t_pdl; diff --git a/src/devices/machine/ds2404.cpp b/src/devices/machine/ds2404.cpp index 68082389cee..65db6cd82fa 100644 --- a/src/devices/machine/ds2404.cpp +++ b/src/devices/machine/ds2404.cpp @@ -24,7 +24,7 @@ const device_type DS2404 = &device_creator; // ds2404_device - constructor //------------------------------------------------- -ds2404_device::ds2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds2404_device::ds2404_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS2404, "DS2404", tag, owner, clock, "ds2404", __FILE__), device_nvram_interface(mconfig, *this), m_tick_timer(nullptr), m_ref_year(0), m_ref_month(0), m_ref_day(0), m_address(0), @@ -43,7 +43,7 @@ ds2404_device::ds2404_device(const machine_config &mconfig, const char *tag, dev // to set the reference year //------------------------------------------------- -void ds2404_device::static_set_ref_year(device_t &device, UINT32 year) +void ds2404_device::static_set_ref_year(device_t &device, uint32_t year) { ds2404_device &ds2404 = downcast(device); ds2404.m_ref_year = year; @@ -55,7 +55,7 @@ void ds2404_device::static_set_ref_year(device_t &device, UINT32 year) // to set the reference month //------------------------------------------------- -void ds2404_device::static_set_ref_month(device_t &device, UINT8 month) +void ds2404_device::static_set_ref_month(device_t &device, uint8_t month) { ds2404_device &ds2404 = downcast(device); ds2404.m_ref_month = month; @@ -67,7 +67,7 @@ void ds2404_device::static_set_ref_month(device_t &device, UINT8 month) // to set the reference day //------------------------------------------------- -void ds2404_device::static_set_ref_day(device_t &device, UINT8 day) +void ds2404_device::static_set_ref_day(device_t &device, uint8_t day) { ds2404_device &ds2404 = downcast(device); ds2404.m_ref_day = day; @@ -107,7 +107,7 @@ void ds2404_device::device_start() } -void ds2404_device::ds2404_rom_cmd(UINT8 cmd) +void ds2404_device::ds2404_rom_cmd(uint8_t cmd) { switch(cmd) { @@ -121,7 +121,7 @@ void ds2404_device::ds2404_rom_cmd(UINT8 cmd) } } -void ds2404_device::ds2404_cmd(UINT8 cmd) +void ds2404_device::ds2404_cmd(uint8_t cmd) { switch(cmd) { @@ -155,7 +155,7 @@ void ds2404_device::ds2404_cmd(UINT8 cmd) } } -UINT8 ds2404_device::ds2404_readmem() +uint8_t ds2404_device::ds2404_readmem() { if( m_address < 0x200 ) { @@ -168,7 +168,7 @@ UINT8 ds2404_device::ds2404_readmem() return 0; } -void ds2404_device::ds2404_writemem(UINT8 value) +void ds2404_device::ds2404_writemem(uint8_t value) { if( m_address < 0x200 ) { @@ -194,7 +194,7 @@ WRITE8_MEMBER( ds2404_device::ds2404_3w_reset_w ) READ8_MEMBER( ds2404_device::ds2404_data_r ) { - UINT8 value = 0; + uint8_t value = 0; switch(m_state[m_state_ptr]) { case DS2404_STATE_IDLE: diff --git a/src/devices/machine/ds2404.h b/src/devices/machine/ds2404.h index 86b9c7be05d..420f9f41207 100644 --- a/src/devices/machine/ds2404.h +++ b/src/devices/machine/ds2404.h @@ -49,12 +49,12 @@ class ds2404_device : public device_t, { public: // construction/destruction - ds2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds2404_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers - static void static_set_ref_year(device_t &device, UINT32 m_ref_year); - static void static_set_ref_month(device_t &device, UINT8 m_ref_month); - static void static_set_ref_day(device_t &device, UINT8 m_ref_day); + static void static_set_ref_year(device_t &device, uint32_t m_ref_year); + static void static_set_ref_month(device_t &device, uint8_t m_ref_month); + static void static_set_ref_day(device_t &device, uint8_t m_ref_day); /* 1-wire interface reset */ DECLARE_WRITE8_MEMBER(ds2404_1w_reset_w); @@ -82,11 +82,11 @@ protected: private: - void ds2404_rom_cmd(UINT8 cmd); - void ds2404_cmd(UINT8 cmd); + void ds2404_rom_cmd(uint8_t cmd); + void ds2404_cmd(uint8_t cmd); - UINT8 ds2404_readmem(); - void ds2404_writemem(UINT8 value); + uint8_t ds2404_readmem(); + void ds2404_writemem(uint8_t value); enum DS2404_STATE { @@ -105,18 +105,18 @@ private: emu_timer *m_tick_timer; // configuration state - UINT32 m_ref_year; - UINT8 m_ref_month; - UINT8 m_ref_day; - - UINT16 m_address; - UINT16 m_offset; - UINT16 m_end_offset; - UINT8 m_a1; - UINT8 m_a2; - UINT8 m_sram[512]; /* 4096 bits */ - UINT8 m_ram[32]; /* scratchpad ram, 256 bits */ - UINT8 m_rtc[5]; /* 40-bit RTC counter */ + uint32_t m_ref_year; + uint8_t m_ref_month; + uint8_t m_ref_day; + + uint16_t m_address; + uint16_t m_offset; + uint16_t m_end_offset; + uint8_t m_a1; + uint8_t m_a2; + uint8_t m_sram[512]; /* 4096 bits */ + uint8_t m_ram[32]; /* scratchpad ram, 256 bits */ + uint8_t m_rtc[5]; /* 40-bit RTC counter */ DS2404_STATE m_state[8]; int m_state_ptr; }; diff --git a/src/devices/machine/ds75160a.cpp b/src/devices/machine/ds75160a.cpp index 1560fa4f0b2..8cda22b6ad9 100644 --- a/src/devices/machine/ds75160a.cpp +++ b/src/devices/machine/ds75160a.cpp @@ -26,7 +26,7 @@ const device_type DS75160A = &device_creator; // ds75160a_device - constructor //------------------------------------------------- -ds75160a_device::ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds75160a_device::ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS75160A, "DS75160A", tag, owner, clock, "ds75160a", __FILE__), m_read(*this), m_write(*this), @@ -60,7 +60,7 @@ void ds75160a_device::device_start() READ8_MEMBER( ds75160a_device::read ) { - UINT8 data = 0; + uint8_t data = 0; if (!m_te) { diff --git a/src/devices/machine/ds75160a.h b/src/devices/machine/ds75160a.h index 5cb4898322d..877bb5a31f2 100644 --- a/src/devices/machine/ds75160a.h +++ b/src/devices/machine/ds75160a.h @@ -48,7 +48,7 @@ class ds75160a_device : public device_t { public: // construction/destruction - ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_callbacks(_read rd, _write wr) { m_read.set_callback(rd); @@ -69,7 +69,7 @@ private: devcb_read8 m_read; devcb_write8 m_write; - UINT8 m_data; + uint8_t m_data; int m_te; int m_pe; diff --git a/src/devices/machine/ds75161a.cpp b/src/devices/machine/ds75161a.cpp index 5ec21a0e003..fbb196c4c15 100644 --- a/src/devices/machine/ds75161a.cpp +++ b/src/devices/machine/ds75161a.cpp @@ -26,7 +26,7 @@ const device_type DS75161A = &device_creator; // ds75161a_device - constructor //------------------------------------------------- -ds75161a_device::ds75161a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ds75161a_device::ds75161a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DS75161A, "DS75161A", tag, owner, clock, "ds75161a", __FILE__), m_in_ren_cb(*this), m_in_ifc_cb(*this), diff --git a/src/devices/machine/ds75161a.h b/src/devices/machine/ds75161a.h index 33c244f6528..2330f200f16 100644 --- a/src/devices/machine/ds75161a.h +++ b/src/devices/machine/ds75161a.h @@ -90,7 +90,7 @@ class ds75161a_device : public device_t { public: // construction/destruction - ds75161a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ds75161a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_in_ren_callback(device_t &device, _Object object) { return downcast(device).m_in_ren_cb.set_callback(object); } template static devcb_base &set_in_ifc_callback(device_t &device, _Object object) { return downcast(device).m_in_ifc_cb.set_callback(object); } diff --git a/src/devices/machine/e0516.cpp b/src/devices/machine/e0516.cpp index acd6c2d0193..2643583caf8 100644 --- a/src/devices/machine/e0516.cpp +++ b/src/devices/machine/e0516.cpp @@ -38,7 +38,7 @@ const device_type E0516 = &device_creator; // e0516_device - constructor //------------------------------------------------- -e0516_device::e0516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e0516_device::e0516_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, E0516, "E05-16", tag, owner, clock, "e0516", __FILE__), device_rtc_interface(mconfig, *this), m_cs(0), m_clk(0), m_data_latch(0), m_reg_latch(0), m_read_write(0), m_state(0), m_bits(0), m_dio(0), m_timer(nullptr) { diff --git a/src/devices/machine/e0516.h b/src/devices/machine/e0516.h index 227c65dd2a5..6760fd7f06c 100644 --- a/src/devices/machine/e0516.h +++ b/src/devices/machine/e0516.h @@ -46,7 +46,7 @@ class e0516_device : public device_t, { public: // construction/destruction - e0516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e0516_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( cs_w ); DECLARE_WRITE_LINE_MEMBER( clk_w ); diff --git a/src/devices/machine/e05a03.cpp b/src/devices/machine/e05a03.cpp index b0389abb6df..4f031f3da28 100644 --- a/src/devices/machine/e05a03.cpp +++ b/src/devices/machine/e05a03.cpp @@ -16,7 +16,7 @@ const device_type E05A03 = &device_creator; -e05a03_device::e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e05a03_device::e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, E05A03, "E05A03", tag, owner, clock, "e05a03", __FILE__), m_write_nlq_lp(*this), m_write_pe_lp(*this), @@ -129,7 +129,7 @@ WRITE8_MEMBER( e05a03_device::write ) READ8_MEMBER( e05a03_device::read ) { - UINT8 result = 0; + uint8_t result = 0; logerror("%s: e05a03_r(%02x)\n", space.machine().describe_context(), offset); diff --git a/src/devices/machine/e05a03.h b/src/devices/machine/e05a03.h index 86b36b673b0..07f84299143 100644 --- a/src/devices/machine/e05a03.h +++ b/src/devices/machine/e05a03.h @@ -36,7 +36,7 @@ class e05a03_device : public device_t { public: - e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~e05a03_device() {} template static devcb_base &set_nlq_lp_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_nlq_lp.set_callback(object); } @@ -70,7 +70,7 @@ private: devcb_read8 m_read_data; /* pin 47-54, centronics data input */ /* 24-bit shift register, port 0x00, 0x01 and 0x02 */ - UINT32 m_shift; + uint32_t m_shift; /* port 0x03 */ int m_busy_leading; @@ -84,13 +84,13 @@ private: #endif /* port 0x04 and 0x05 (9-bit) */ - UINT16 m_printhead; + uint16_t m_printhead; /* port 0x06 (4-bit) */ - UINT8 m_pf_motor; + uint8_t m_pf_motor; /* port 0x07 (4-bit) */ - UINT8 m_cr_motor; + uint8_t m_cr_motor; }; extern const device_type E05A03; diff --git a/src/devices/machine/e05a30.cpp b/src/devices/machine/e05a30.cpp index 8bb802f9265..386ebd1f641 100644 --- a/src/devices/machine/e05a30.cpp +++ b/src/devices/machine/e05a30.cpp @@ -22,7 +22,7 @@ const device_type E05A30 = &device_creator; -e05a30_device::e05a30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +e05a30_device::e05a30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, E05A30, "E05A30", tag, owner, clock, "e05a30", __FILE__), m_write_printhead(*this), m_write_pf_stepper(*this), @@ -94,14 +94,14 @@ void e05a30_device::device_reset() * MMIO 0xC005 keeps the 9th pin in the MSB. */ -void e05a30_device::update_printhead(int pos, UINT8 data) +void e05a30_device::update_printhead(int pos, uint8_t data) { if (pos == 0) { m_printhead &= 0x01fe; m_printhead |= (data >> 7); } else { m_printhead &= 0x0001; - m_printhead |= (UINT16) (data << 1); + m_printhead |= (uint16_t) (data << 1); } m_write_printhead(m_printhead); } @@ -119,13 +119,13 @@ void e05a30_device::update_printhead(int pos, UINT8 data) * For the PF motor, the output data is fed directly to the stepper motor. */ -void e05a30_device::update_pf_stepper(UINT8 data) +void e05a30_device::update_pf_stepper(uint8_t data) { m_pf_stepper = data & 0x0f; m_write_pf_stepper(m_pf_stepper); } -static UINT8 cr_sla7020m(UINT8 data) +static uint8_t cr_sla7020m(uint8_t data) { bool ina = BIT(data, 0); bool inb = BIT(data, 1); @@ -137,7 +137,7 @@ static UINT8 cr_sla7020m(UINT8 data) bool outb1 = !inb && tdb; return (outb1<<3)|(outb0<<2)|(outa1<<1)|(outa0<<0); } -void e05a30_device::update_cr_stepper(UINT8 data) +void e05a30_device::update_cr_stepper(uint8_t data) { m_cr_stepper = data & 0x0f; m_write_cr_stepper(cr_sla7020m(m_cr_stepper)); @@ -196,7 +196,7 @@ WRITE8_MEMBER( e05a30_device::write ) READ8_MEMBER( e05a30_device::read ) { - UINT8 result = 0; + uint8_t result = 0; LOG("%s: e05a30_r([0xC0%02x]): ", space.machine().describe_context(), offset); diff --git a/src/devices/machine/e05a30.h b/src/devices/machine/e05a30.h index f05b3fd35c9..f5f396f63fd 100644 --- a/src/devices/machine/e05a30.h +++ b/src/devices/machine/e05a30.h @@ -46,7 +46,7 @@ class e05a30_device : public device_t { public: - e05a30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + e05a30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~e05a30_device() {} template static devcb_base &set_printhead_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_printhead.set_callback(object); } @@ -90,24 +90,24 @@ private: devcb_write_line m_write_centronics_fault; devcb_write_line m_write_centronics_select; - void update_printhead(int pos, UINT8 data); - void update_pf_stepper(UINT8 data); - void update_cr_stepper(UINT8 data); + void update_printhead(int pos, uint8_t data); + void update_pf_stepper(uint8_t data); + void update_cr_stepper(uint8_t data); /* port 0x05 and 0x06 (9-bit) */ - UINT16 m_printhead; + uint16_t m_printhead; /* port 0x07 (4-bit) */ - UINT8 m_pf_stepper; + uint8_t m_pf_stepper; /* port 0x08 (4-bit) */ - UINT8 m_cr_stepper; + uint8_t m_cr_stepper; /* Centronics stuff */ - UINT8 m_centronics_data; + uint8_t m_centronics_data; int m_centronics_busy; int m_centronics_nack; - UINT8 m_centronics_strobe; - UINT8 m_centronics_data_latch; - UINT8 m_centronics_data_latched; + uint8_t m_centronics_strobe; + uint8_t m_centronics_data_latch; + uint8_t m_centronics_data_latched; }; extern const device_type E05A30; diff --git a/src/devices/machine/eeprom.cpp b/src/devices/machine/eeprom.cpp index c7374775042..7e3a552a4d4 100644 --- a/src/devices/machine/eeprom.cpp +++ b/src/devices/machine/eeprom.cpp @@ -77,19 +77,19 @@ void eeprom_base_device::static_set_size(device_t &device, int cells, int cellbi // to set the default data //------------------------------------------------- -void eeprom_base_device::static_set_default_data(device_t &device, const UINT8 *data, UINT32 size) +void eeprom_base_device::static_set_default_data(device_t &device, const uint8_t *data, uint32_t size) { eeprom_base_device &eeprom = downcast(device); assert(eeprom.m_data_bits == 8); - eeprom.m_default_data.u8 = const_cast(data); + eeprom.m_default_data.u8 = const_cast(data); eeprom.m_default_data_size = size; } -void eeprom_base_device::static_set_default_data(device_t &device, const UINT16 *data, UINT32 size) +void eeprom_base_device::static_set_default_data(device_t &device, const uint16_t *data, uint32_t size) { eeprom_base_device &eeprom = downcast(device); assert(eeprom.m_data_bits == 16); - eeprom.m_default_data.u16 = const_cast(data); + eeprom.m_default_data.u16 = const_cast(data); eeprom.m_default_data_size = size / 2; } @@ -99,7 +99,7 @@ void eeprom_base_device::static_set_default_data(device_t &device, const UINT16 // to set the default value //------------------------------------------------- -void eeprom_base_device::static_set_default_value(device_t &device, UINT32 value) +void eeprom_base_device::static_set_default_value(device_t &device, uint32_t value) { eeprom_base_device &eeprom = downcast(device); eeprom.m_default_value = value; @@ -122,7 +122,7 @@ void eeprom_base_device::static_set_timing(device_t &device, timing_type type, c // read - read data at the given address //------------------------------------------------- -UINT32 eeprom_base_device::read(offs_t address) +uint32_t eeprom_base_device::read(offs_t address) { if (!ready()) logerror("EEPROM: Read performed before previous operation completed!\n"); @@ -134,7 +134,7 @@ UINT32 eeprom_base_device::read(offs_t address) // write - write data at the given address //------------------------------------------------- -void eeprom_base_device::write(offs_t address, UINT32 data) +void eeprom_base_device::write(offs_t address, uint32_t data) { if (!ready()) logerror("EEPROM: Write performed before previous operation completed!\n"); @@ -149,7 +149,7 @@ void eeprom_base_device::write(offs_t address, UINT32 data) // performed) //------------------------------------------------- -void eeprom_base_device::write_all(UINT32 data) +void eeprom_base_device::write_all(uint32_t data) { if (!ready()) logerror("EEPROM: Write all performed before previous operation completed!\n"); @@ -209,8 +209,8 @@ void eeprom_base_device::device_validity_check(validity_checker &valid) const void eeprom_base_device::device_start() { - UINT32 size = (m_data_bits == 8 ? 1 : 2) << m_address_bits; - m_data = std::make_unique(size); + uint32_t size = (m_data_bits == 8 ? 1 : 2) << m_address_bits; + m_data = std::make_unique(size); // save states save_item(NAME(m_completion_time)); @@ -236,11 +236,11 @@ void eeprom_base_device::device_reset() void eeprom_base_device::nvram_default() { - UINT32 eeprom_length = 1 << m_address_bits; - UINT32 eeprom_bytes = eeprom_length * m_data_bits / 8; + uint32_t eeprom_length = 1 << m_address_bits; + uint32_t eeprom_bytes = eeprom_length * m_data_bits / 8; // initialize to the default value - UINT32 default_value = m_default_value_set ? m_default_value : ~0; + uint32_t default_value = m_default_value_set ? m_default_value : ~0; for (offs_t offs = 0; offs < eeprom_length; offs++) internal_write(offs, default_value); @@ -280,8 +280,8 @@ void eeprom_base_device::nvram_default() void eeprom_base_device::nvram_read(emu_file &file) { - UINT32 eeprom_length = 1 << m_address_bits; - UINT32 eeprom_bytes = eeprom_length * m_data_bits / 8; + uint32_t eeprom_length = 1 << m_address_bits; + uint32_t eeprom_bytes = eeprom_length * m_data_bits / 8; file.read(&m_data[0], eeprom_bytes); } @@ -294,8 +294,8 @@ void eeprom_base_device::nvram_read(emu_file &file) void eeprom_base_device::nvram_write(emu_file &file) { - UINT32 eeprom_length = 1 << m_address_bits; - UINT32 eeprom_bytes = eeprom_length * m_data_bits / 8; + uint32_t eeprom_length = 1 << m_address_bits; + uint32_t eeprom_bytes = eeprom_length * m_data_bits / 8; file.write(&m_data[0], eeprom_bytes); } @@ -305,7 +305,7 @@ void eeprom_base_device::nvram_write(emu_file &file) // internal_read - read data at the given address //------------------------------------------------- -UINT32 eeprom_base_device::internal_read(offs_t address) +uint32_t eeprom_base_device::internal_read(offs_t address) { if (m_data_bits == 16) return m_data[address * 2] | (m_data[address * 2 + 1] << 8); @@ -319,7 +319,7 @@ UINT32 eeprom_base_device::internal_read(offs_t address) // address //------------------------------------------------- -void eeprom_base_device::internal_write(offs_t address, UINT32 data) +void eeprom_base_device::internal_write(offs_t address, uint32_t data) { if (m_data_bits == 16) { diff --git a/src/devices/machine/eeprom.h b/src/devices/machine/eeprom.h index 7fdcc8cd473..450a7f774d8 100644 --- a/src/devices/machine/eeprom.h +++ b/src/devices/machine/eeprom.h @@ -63,15 +63,15 @@ public: // inline configuration helpers static void static_set_size(device_t &device, int cells, int cellbits); - static void static_set_default_data(device_t &device, const UINT8 *data, UINT32 size); - static void static_set_default_data(device_t &device, const UINT16 *data, UINT32 size); - static void static_set_default_value(device_t &device, UINT32 value); + static void static_set_default_data(device_t &device, const uint8_t *data, uint32_t size); + static void static_set_default_data(device_t &device, const uint16_t *data, uint32_t size); + static void static_set_default_value(device_t &device, uint32_t value); static void static_set_timing(device_t &device, timing_type type, const attotime &duration); // read/write/erase data - UINT32 read(offs_t address); - void write(offs_t address, UINT32 data); - void write_all(UINT32 data); + uint32_t read(offs_t address); + void write(offs_t address, uint32_t data); + void write_all(uint32_t data); void erase(offs_t address); void erase_all(); @@ -79,8 +79,8 @@ public: bool ready() const { return machine().time() >= m_completion_time; } // internal read/write without side-effects - UINT32 internal_read(offs_t address); - void internal_write(offs_t address, UINT32 data); + uint32_t internal_read(offs_t address); + void internal_write(offs_t address, uint32_t data); protected: // device-level overrides @@ -95,15 +95,15 @@ protected: optional_memory_region m_region; - std::unique_ptr m_data; + std::unique_ptr m_data; // configuration state - UINT32 m_cells; - UINT8 m_address_bits; - UINT8 m_data_bits; + uint32_t m_cells; + uint8_t m_address_bits; + uint8_t m_data_bits; generic_ptr m_default_data; - UINT32 m_default_data_size; - UINT32 m_default_value; + uint32_t m_default_data_size; + uint32_t m_default_value; bool m_default_value_set; attotime m_operation_time[TIMING_COUNT]; diff --git a/src/devices/machine/eeprompar.cpp b/src/devices/machine/eeprompar.cpp index af575ec1419..cf92b2db69e 100644 --- a/src/devices/machine/eeprompar.cpp +++ b/src/devices/machine/eeprompar.cpp @@ -116,7 +116,7 @@ READ8_MEMBER(eeprom_parallel_28xx_device::read) // macro for defining a new device class #define DEFINE_PARALLEL_EEPROM_DEVICE(_baseclass, _lowercase, _uppercase, _bits, _cells) \ -eeprom_parallel_##_lowercase##_device::eeprom_parallel_##_lowercase##_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) \ +eeprom_parallel_##_lowercase##_device::eeprom_parallel_##_lowercase##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) \ : eeprom_parallel_##_baseclass##_device(mconfig, EEPROM_PARALLEL_##_uppercase, "Parallel EEPROM " #_uppercase " (" #_cells "x" #_bits ")", tag, owner, #_lowercase, __FILE__) \ { \ static_set_size(*this, _cells, _bits); \ diff --git a/src/devices/machine/eeprompar.h b/src/devices/machine/eeprompar.h index e8ed153dd97..e70f22c062b 100644 --- a/src/devices/machine/eeprompar.h +++ b/src/devices/machine/eeprompar.h @@ -87,7 +87,7 @@ public: class eeprom_parallel_##_lowercase##_device : public eeprom_parallel_##_baseclass##_device \ { \ public: \ - eeprom_parallel_##_lowercase##_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); \ + eeprom_parallel_##_lowercase##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); \ }; \ extern const device_type EEPROM_PARALLEL_##_uppercase; // standard 28XX class of 8-bit EEPROMs diff --git a/src/devices/machine/eepromser.cpp b/src/devices/machine/eepromser.cpp index 347accae06f..90e03109f76 100644 --- a/src/devices/machine/eepromser.cpp +++ b/src/devices/machine/eepromser.cpp @@ -780,7 +780,7 @@ void eeprom_serial_x24c44_device::device_start() // start the base class eeprom_base_device::device_start(); - INT16 i=0; + int16_t i=0; m_ram_length=0xf; for (i=0;i<16;i++){ @@ -806,7 +806,7 @@ void eeprom_serial_x24c44_device::device_start() } void eeprom_serial_x24c44_device::copy_eeprom_to_ram(){ - UINT16 i=0; + uint16_t i=0; LOG1(("EEPROM TO RAM COPY!!!\n")); for (i=0;i<16;i++){ m_ram_data[i]=read(i); @@ -817,7 +817,7 @@ void eeprom_serial_x24c44_device::copy_eeprom_to_ram(){ void eeprom_serial_x24c44_device::copy_ram_to_eeprom(){ - UINT16 i=0; + uint16_t i=0; if (m_store_latch){ LOG1(("RAM TO EEPROM COPY\n")); for (i=0;i<16;i++){ @@ -910,7 +910,7 @@ void eeprom_serial_x24c44_device::execute_command() void eeprom_serial_x24c44_device::handle_event(eeprom_event event) { -//UINT32 tmp=0; +//uint32_t tmp=0; #if (VERBOSE_PRINTF > 0 || VERBOSE_LOGERROR > 0) // for debugging purposes if ((event & EVENT_CS_RISING_EDGE) != 0) LOG2(("Event: CS rising\n")); @@ -1127,7 +1127,7 @@ WRITE_LINE_MEMBER(eeprom_serial_x24c44_device::di_write) { base_di_write(state); // macro for defining a new device class #define DEFINE_SERIAL_EEPROM_DEVICE(_baseclass, _lowercase, _uppercase, _bits, _cells, _addrbits) \ -eeprom_serial_##_lowercase##_##_bits##bit_device::eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) \ +eeprom_serial_##_lowercase##_##_bits##bit_device::eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) \ : eeprom_serial_##_baseclass##_device(mconfig, EEPROM_SERIAL_##_uppercase##_##_bits##BIT, "Serial EEPROM " #_uppercase " (" #_cells "x" #_bits ")", tag, owner, #_lowercase "_" #_bits, __FILE__) \ { \ static_set_size(*this, _cells, _bits); \ diff --git a/src/devices/machine/eepromser.h b/src/devices/machine/eepromser.h index cbba81bfbbe..f52b6b57fa7 100644 --- a/src/devices/machine/eepromser.h +++ b/src/devices/machine/eepromser.h @@ -152,22 +152,22 @@ protected: // configuration state - UINT8 m_command_address_bits; // number of address bits in a command + uint8_t m_command_address_bits; // number of address bits in a command bool m_streaming_enabled; // true if streaming is enabled // runtime state eeprom_state m_state; // current internal state - UINT8 m_cs_state; // state of the CS line + uint8_t m_cs_state; // state of the CS line attotime m_last_cs_rising_edge_time; // time of the last CS rising edge - UINT8 m_oe_state; // state of the OE line - UINT8 m_clk_state; // state of the CLK line - UINT8 m_di_state; // state of the DI line + uint8_t m_oe_state; // state of the OE line + uint8_t m_clk_state; // state of the CLK line + uint8_t m_di_state; // state of the DI line bool m_locked; // are we locked against writes? - UINT32 m_bits_accum; // number of bits accumulated - UINT32 m_command_address_accum; // accumulator of command+address bits + uint32_t m_bits_accum; // number of bits accumulated + uint32_t m_command_address_accum; // accumulator of command+address bits eeprom_command m_command; // current command - UINT32 m_address; // current address extracted from command - UINT32 m_shift_register; // holds data coming in/going out + uint32_t m_address; // current address extracted from command + uint32_t m_shift_register; // holds data coming in/going out }; @@ -247,10 +247,10 @@ protected: void copy_ram_to_eeprom(); void copy_eeprom_to_ram(); void device_start() override; - UINT8 m_ram_length; - UINT16 m_ram_data[16]; - UINT16 m_reading; - UINT8 m_store_latch; + uint8_t m_ram_length; + uint16_t m_ram_data[16]; + uint16_t m_reading; + uint8_t m_store_latch; }; @@ -264,7 +264,7 @@ protected: class eeprom_serial_##_lowercase##_##_bits##bit_device : public eeprom_serial_##_baseclass##_device \ { \ public: \ - eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); \ + eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); \ }; \ extern const device_type EEPROM_SERIAL_##_uppercase##_##_bits##BIT; // standard 93CX6 class of 16-bit EEPROMs diff --git a/src/devices/machine/er2055.cpp b/src/devices/machine/er2055.cpp index c0c5966b5a9..5953419156e 100644 --- a/src/devices/machine/er2055.cpp +++ b/src/devices/machine/er2055.cpp @@ -33,7 +33,7 @@ ADDRESS_MAP_END // er2055_device - constructor //------------------------------------------------- -er2055_device::er2055_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +er2055_device::er2055_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ER2055, "ER2055 EAROM", tag, owner, clock, "er2055", __FILE__), device_memory_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -90,7 +90,7 @@ void er2055_device::nvram_default() if (m_region->bytewidth() != 1) fatalerror("er2055 region '%s' needs to be an 8-bit region\n", tag()); - UINT8 *default_data = m_region->base(); + uint8_t *default_data = m_region->base(); for (int byte = 0; byte < SIZE_DATA; byte++) space(AS_PROGRAM).write_byte(byte, default_data[byte]); } @@ -104,7 +104,7 @@ void er2055_device::nvram_default() void er2055_device::nvram_read(emu_file &file) { - UINT8 buffer[SIZE_DATA]; + uint8_t buffer[SIZE_DATA]; file.read(buffer, sizeof(buffer)); for (int byte = 0; byte < SIZE_DATA; byte++) space(AS_PROGRAM).write_byte(byte, buffer[byte]); @@ -118,7 +118,7 @@ void er2055_device::nvram_read(emu_file &file) void er2055_device::nvram_write(emu_file &file) { - UINT8 buffer[SIZE_DATA]; + uint8_t buffer[SIZE_DATA]; for (int byte = 0; byte < SIZE_DATA; byte++) buffer[byte] = space(AS_PROGRAM).read_byte(byte); file.write(buffer, sizeof(buffer)); @@ -136,10 +136,10 @@ void er2055_device::nvram_write(emu_file &file) // reacts to various combinations //------------------------------------------------- -void er2055_device::set_control(UINT8 cs1, UINT8 cs2, UINT8 c1, UINT8 c2, UINT8 ck) +void er2055_device::set_control(uint8_t cs1, uint8_t cs2, uint8_t c1, uint8_t c2, uint8_t ck) { // create a new composite control state - UINT8 oldstate = m_control_state; + uint8_t oldstate = m_control_state; m_control_state = (ck != 0) ? CK : 0; m_control_state |= (c1 != 0) ? C1 : 0; m_control_state |= (c2 != 0) ? C2 : 0; diff --git a/src/devices/machine/er2055.h b/src/devices/machine/er2055.h index 82ad9d2c0e9..c5796c1bb27 100644 --- a/src/devices/machine/er2055.h +++ b/src/devices/machine/er2055.h @@ -36,15 +36,15 @@ class er2055_device : public device_t, { public: // construction/destruction - er2055_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + er2055_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations - UINT8 data() const { return m_data; } - void set_address(UINT8 address) { m_address = address & 0x3f; } - void set_data(UINT8 data) { m_data = data; } + uint8_t data() const { return m_data; } + void set_address(uint8_t address) { m_address = address & 0x3f; } + void set_data(uint8_t data) { m_data = data; } // control lines -- all lines are specified as active-high (even CS2) - void set_control(UINT8 cs1, UINT8 cs2, UINT8 c1, UINT8 c2, UINT8 ck); + void set_control(uint8_t cs1, uint8_t cs2, uint8_t c1, uint8_t c2, uint8_t ck); protected: // device-level overrides @@ -60,11 +60,11 @@ protected: static const int SIZE_DATA = 0x40; - static const UINT8 CK = 0x01; - static const UINT8 C1 = 0x02; - static const UINT8 C2 = 0x04; - static const UINT8 CS1 = 0x08; - static const UINT8 CS2 = 0x10; + static const uint8_t CK = 0x01; + static const uint8_t C1 = 0x02; + static const uint8_t C2 = 0x04; + static const uint8_t CS1 = 0x08; + static const uint8_t CS2 = 0x10; optional_memory_region m_region; @@ -72,9 +72,9 @@ protected: address_space_config m_space_config; // internal state - UINT8 m_control_state; - UINT8 m_address; - UINT8 m_data; + uint8_t m_control_state; + uint8_t m_address; + uint8_t m_data; }; diff --git a/src/devices/machine/f3853.cpp b/src/devices/machine/f3853.cpp index 49deb99f073..747bd3cdc28 100644 --- a/src/devices/machine/f3853.cpp +++ b/src/devices/machine/f3853.cpp @@ -49,7 +49,7 @@ const device_type F3853 = &device_creator; // f3853_device - constructor //------------------------------------------------- -f3853_device::f3853_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +f3853_device::f3853_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, F3853, "F3853", tag, owner, clock, "f3853", __FILE__) { } @@ -60,13 +60,13 @@ f3853_device::f3853_device(const machine_config &mconfig, const char *tag, devic void f3853_device::device_start() { - UINT8 reg = 0xfe; - for(INT32 i=254 /* Known to get 0xfe after 255 cycles */; i >= 0; i--) + uint8_t reg = 0xfe; + for(int32_t i=254 /* Known to get 0xfe after 255 cycles */; i >= 0; i--) { - INT32 o7 = (reg & 0x80) ? TRUE : FALSE; - INT32 o5 = (reg & 0x20) ? TRUE : FALSE; - INT32 o4 = (reg & 0x10) ? TRUE : FALSE; - INT32 o3 = (reg & 0x08) ? TRUE : FALSE; + int32_t o7 = (reg & 0x80) ? TRUE : FALSE; + int32_t o5 = (reg & 0x20) ? TRUE : FALSE; + int32_t o4 = (reg & 0x10) ? TRUE : FALSE; + int32_t o3 = (reg & 0x08) ? TRUE : FALSE; m_value_to_cycle[reg] = i; reg <<= 1; if (!((o7 != o5) != (o4 != o3))) @@ -121,7 +121,7 @@ void f3853_device::set_interrupt_request_line() } -void f3853_device::timer_start(UINT8 value) +void f3853_device::timer_start(uint8_t value) { attotime period = (value != 0xff) ? attotime::from_hz(clock()) * (m_value_to_cycle[value]*31) : attotime::never; @@ -157,7 +157,7 @@ void f3853_device::set_priority_in_line(int level) READ8_MEMBER(f3853_device::read) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { diff --git a/src/devices/machine/f3853.h b/src/devices/machine/f3853.h index b080b982fc2..ee75fae052c 100644 --- a/src/devices/machine/f3853.h +++ b/src/devices/machine/f3853.h @@ -51,9 +51,9 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef device_delegate f3853_interrupt_req_delegate; +typedef device_delegate f3853_interrupt_req_delegate; -#define F3853_INTERRUPT_REQ_CB(_name) void _name(UINT16 addr, int level) +#define F3853_INTERRUPT_REQ_CB(_name) void _name(uint16_t addr, int level) // ======================> f3853_device @@ -62,7 +62,7 @@ class f3853_device : public device_t { public: // construction/destruction - f3853_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + f3853_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_interrupt_req_callback(device_t &device, f3853_interrupt_req_delegate callback) { downcast(device).m_interrupt_req_cb = callback; } @@ -82,22 +82,22 @@ protected: private: void set_interrupt_request_line(); - void timer_start(UINT8 value); + void timer_start(uint8_t value); f3853_interrupt_req_delegate m_interrupt_req_cb; - UINT8 m_high; - UINT8 m_low; // Bit 7 is set to 0 for timer interrupts, 1 for external interrupts - INT32 m_external_enable; - INT32 m_timer_enable; + uint8_t m_high; + uint8_t m_low; // Bit 7 is set to 0 for timer interrupts, 1 for external interrupts + int32_t m_external_enable; + int32_t m_timer_enable; - INT32 m_request_flipflop; + int32_t m_request_flipflop; - INT32 m_priority_line; /* inverted level*/ - INT32 m_external_interrupt_line; /* inverted level */ + int32_t m_priority_line; /* inverted level*/ + int32_t m_external_interrupt_line; /* inverted level */ emu_timer *m_timer; - UINT8 m_value_to_cycle[0x100]; + uint8_t m_value_to_cycle[0x100]; }; diff --git a/src/devices/machine/fdc37c665gt.cpp b/src/devices/machine/fdc37c665gt.cpp index 671d0314560..4df67df6d39 100644 --- a/src/devices/machine/fdc37c665gt.cpp +++ b/src/devices/machine/fdc37c665gt.cpp @@ -2,7 +2,7 @@ // copyright-holders:smf #include "fdc37c665gt.h" -fdc37c665gt_device::fdc37c665gt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +fdc37c665gt_device::fdc37c665gt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FDC37C665GT, "FDC37C665GT", tag, owner, clock, "fdc37c665gt", __FILE__), m_uart1(*this, "uart1"), m_uart2(*this, "uart2") @@ -11,7 +11,7 @@ fdc37c665gt_device::fdc37c665gt_device(const machine_config &mconfig, const char READ8_MEMBER(fdc37c665gt_device::read) { - UINT8 data = 0; + uint8_t data = 0; if ((offset & 0x3f8) == 0x3f8) { diff --git a/src/devices/machine/fdc37c665gt.h b/src/devices/machine/fdc37c665gt.h index 569bf8ed0e8..094cc45db75 100644 --- a/src/devices/machine/fdc37c665gt.h +++ b/src/devices/machine/fdc37c665gt.h @@ -16,7 +16,7 @@ class fdc37c665gt_device : public device_t { public: // construction/destruction - fdc37c665gt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fdc37c665gt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); diff --git a/src/devices/machine/fga002.cpp b/src/devices/machine/fga002.cpp index d89a35bbbc9..b97dfbe7dfc 100644 --- a/src/devices/machine/fga002.cpp +++ b/src/devices/machine/fga002.cpp @@ -69,27 +69,27 @@ const device_type FGA002 = &device_creator; // fga002_device - constructor //------------------------------------------------- -fga002_device::fga002_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +fga002_device::fga002_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) , m_out_int_cb(*this) , m_liack4_cb(*this) , m_liack5_cb(*this) , m_liack6_cb(*this) , m_liack7_cb(*this) - , m_irq_level((UINT8)0) + , m_irq_level((uint8_t)0) { for (auto & elem : m_int_state) elem = 0; } -fga002_device::fga002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fga002_device::fga002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FGA002, "FGA-002", tag, owner, clock, "fga002", __FILE__) , m_out_int_cb(*this) , m_liack4_cb(*this) , m_liack5_cb(*this) , m_liack6_cb(*this) , m_liack7_cb(*this) - , m_irq_level((UINT8)0) + , m_irq_level((uint8_t)0) { for (auto & elem : m_int_state) elem = 0; @@ -148,7 +148,7 @@ void fga002_device::device_reset() //------------------------------------------------- // device_timer - handler timer events //------------------------------------------------- -void fga002_device::device_timer (emu_timer &timer, device_timer_id id, INT32 param, void *ptr) +void fga002_device::device_timer (emu_timer &timer, device_timer_id id, int32_t param, void *ptr) { switch(id) { @@ -224,9 +224,9 @@ const fga_irq_t fga002_device::m_irq_sources[] = { }; -void fga002_device::trigger_interrupt(UINT8 data) +void fga002_device::trigger_interrupt(uint8_t data) { - UINT8 icr = 0; + uint8_t icr = 0; LOGINT(("%s(%02x)\n", FUNCNAME, data)); @@ -353,13 +353,13 @@ int fga002_device::get_irq_level() Also, if a write access to the TIM0COUNT register is performed, the counter is loaded with the value stored in the Timer Preload Register. */ -void fga002_device::do_fga002reg_tim0preload_w(UINT8 data) +void fga002_device::do_fga002reg_tim0preload_w(uint8_t data) { LOG(("%s(%02x)\n", FUNCNAME, data)); m_fga002[FGA_TIM0PRELOAD] = data; } -UINT8 fga002_device::do_fga002reg_tim0preload_r() +uint8_t fga002_device::do_fga002reg_tim0preload_r() { LOG(("%s() %02x\n", FUNCNAME, m_fga002[FGA_TIM0PRELOAD])); return m_fga002[FGA_TIM0PRELOAD]; @@ -405,7 +405,7 @@ UINT8 fga002_device::do_fga002reg_tim0preload_r() 1111 2 seconds */ -void fga002_device::do_fga002reg_tim0ctl_w(UINT8 data) +void fga002_device::do_fga002reg_tim0ctl_w(uint8_t data) { LOG(("%s(%02x)\n", FUNCNAME, data)); if ((data & REG_TIM0CTL_START_STOP) != (m_fga002[FGA_TIM0CTL] & REG_TIM0CTL_START_STOP)) @@ -440,7 +440,7 @@ void fga002_device::do_fga002reg_tim0ctl_w(UINT8 data) m_fga002[FGA_TIM0CTL] = data; } -UINT8 fga002_device::do_fga002reg_tim0ctl_r() +uint8_t fga002_device::do_fga002reg_tim0ctl_r() { LOG(("%s() %02x\n", FUNCNAME, m_fga002[FGA_TIM0CTL])); return m_fga002[FGA_TIM0CTL]; @@ -453,13 +453,13 @@ UINT8 fga002_device::do_fga002reg_tim0ctl_r() The Timer Count Register is initialized to the value $FF after reset. [7:0] Timer Count Value */ -void fga002_device::do_fga002reg_tim0count_w(UINT8 data) +void fga002_device::do_fga002reg_tim0count_w(uint8_t data) { LOG(("%s(%02x)\n", FUNCNAME, data)); m_tim0count = m_fga002[FGA_TIM0PRELOAD]; } -UINT8 fga002_device::do_fga002reg_tim0count_r() +uint8_t fga002_device::do_fga002reg_tim0count_r() { LOG(("%s() %02x\n", FUNCNAME, m_tim0count)); return m_tim0count; @@ -471,13 +471,13 @@ UINT8 fga002_device::do_fga002reg_tim0count_r() [3] IRQ enable, 1 = timer interrupt channel enabled, 0 = disabled [2:0] IRQ level 000 = interrupt disabled 001-111 = Level 1 to 7 interrupt */ -void fga002_device::do_fga002reg_icrtim0_w(UINT8 data) +void fga002_device::do_fga002reg_icrtim0_w(uint8_t data) { LOGINT(("%s(%02x)\n", FUNCNAME, data)); m_fga002[FGA_ICRTIM0] = data; } -UINT8 fga002_device::do_fga002reg_icrtim0_r() +uint8_t fga002_device::do_fga002reg_icrtim0_r() { LOGINT(("%s() %02x\n", FUNCNAME, m_fga002[FGA_ICRTIM0])); return m_fga002[FGA_ICRTIM0]; @@ -489,13 +489,13 @@ UINT8 fga002_device::do_fga002reg_icrtim0_r() [7] The IRQ Status register bit displays if a timer interrupt request is pending. 1 = no interrupt is pending. 0 = interrupt is pending [6:0] not used */ -void fga002_device::do_fga002reg_istim0_w(UINT8 data) +void fga002_device::do_fga002reg_istim0_w(uint8_t data) { LOGINT(("%s(%02x)\n", FUNCNAME, data)); m_fga002[FGA_ISTIM0] &= ~REG_ISTIM0_TIM_INT; // Clear timer interrupt status } -UINT8 fga002_device::do_fga002reg_istim0_r() +uint8_t fga002_device::do_fga002reg_istim0_r() { LOGINT(("%s() %02x\n", FUNCNAME, m_fga002[FGA_ISTIM0])); return m_fga002[FGA_ISTIM0]; @@ -505,7 +505,7 @@ UINT8 fga002_device::do_fga002reg_istim0_r() /* * FGA-002 interrupt support */ -void fga002_device::do_fga002reg_localiack_w(UINT8 data) +void fga002_device::do_fga002reg_localiack_w(uint8_t data) { m_fga002[FGA_LOCALIACK] = data; @@ -520,54 +520,54 @@ void fga002_device::do_fga002reg_localiack_w(UINT8 data) #endif } -UINT8 fga002_device::do_fga002reg_localiack_r() +uint8_t fga002_device::do_fga002reg_localiack_r() { - UINT8 ret = m_fga002[FGA_LOCALIACK]; + uint8_t ret = m_fga002[FGA_LOCALIACK]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_ctl3_r() +uint8_t fga002_device::do_fga002reg_ctl3_r() { - UINT8 ret = m_fga002[FGA_CTL3]; + uint8_t ret = m_fga002[FGA_CTL3]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -void fga002_device::do_fga002reg_ctl3_w(UINT8 data) +void fga002_device::do_fga002reg_ctl3_w(uint8_t data) { m_fga002[FGA_CTL3] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } // Local Interrupt control register methods -UINT8 fga002_device::do_fga002reg_icrlocal0_r(){ UINT8 ret = m_fga002[FGA_ICRLOCAL0]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_icrlocal1_r(){ UINT8 ret = m_fga002[FGA_ICRLOCAL1]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_icrlocal2_r(){ UINT8 ret = m_fga002[FGA_ICRLOCAL2]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_icrlocal3_r(){ UINT8 ret = m_fga002[FGA_ICRLOCAL3]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_icrlocal4_r(){ UINT8 ret = m_fga002[FGA_ICRLOCAL4]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_icrlocal5_r(){ UINT8 ret = m_fga002[FGA_ICRLOCAL5]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_icrlocal6_r(){ UINT8 ret = m_fga002[FGA_ICRLOCAL6]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_icrlocal7_r(){ UINT8 ret = m_fga002[FGA_ICRLOCAL7]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } - -void fga002_device::do_fga002reg_icrlocal0_w(UINT8 data){ m_fga002[FGA_ICRLOCAL0] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } -void fga002_device::do_fga002reg_icrlocal1_w(UINT8 data){ m_fga002[FGA_ICRLOCAL1] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } -void fga002_device::do_fga002reg_icrlocal2_w(UINT8 data){ m_fga002[FGA_ICRLOCAL2] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } -void fga002_device::do_fga002reg_icrlocal3_w(UINT8 data){ m_fga002[FGA_ICRLOCAL3] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } -void fga002_device::do_fga002reg_icrlocal4_w(UINT8 data){ m_fga002[FGA_ICRLOCAL4] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } -void fga002_device::do_fga002reg_icrlocal5_w(UINT8 data){ m_fga002[FGA_ICRLOCAL5] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } -void fga002_device::do_fga002reg_icrlocal6_w(UINT8 data){ m_fga002[FGA_ICRLOCAL6] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } -void fga002_device::do_fga002reg_icrlocal7_w(UINT8 data){ m_fga002[FGA_ICRLOCAL7] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } +uint8_t fga002_device::do_fga002reg_icrlocal0_r(){ uint8_t ret = m_fga002[FGA_ICRLOCAL0]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_icrlocal1_r(){ uint8_t ret = m_fga002[FGA_ICRLOCAL1]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_icrlocal2_r(){ uint8_t ret = m_fga002[FGA_ICRLOCAL2]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_icrlocal3_r(){ uint8_t ret = m_fga002[FGA_ICRLOCAL3]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_icrlocal4_r(){ uint8_t ret = m_fga002[FGA_ICRLOCAL4]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_icrlocal5_r(){ uint8_t ret = m_fga002[FGA_ICRLOCAL5]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_icrlocal6_r(){ uint8_t ret = m_fga002[FGA_ICRLOCAL6]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_icrlocal7_r(){ uint8_t ret = m_fga002[FGA_ICRLOCAL7]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } + +void fga002_device::do_fga002reg_icrlocal0_w(uint8_t data){ m_fga002[FGA_ICRLOCAL0] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } +void fga002_device::do_fga002reg_icrlocal1_w(uint8_t data){ m_fga002[FGA_ICRLOCAL1] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } +void fga002_device::do_fga002reg_icrlocal2_w(uint8_t data){ m_fga002[FGA_ICRLOCAL2] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } +void fga002_device::do_fga002reg_icrlocal3_w(uint8_t data){ m_fga002[FGA_ICRLOCAL3] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } +void fga002_device::do_fga002reg_icrlocal4_w(uint8_t data){ m_fga002[FGA_ICRLOCAL4] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } +void fga002_device::do_fga002reg_icrlocal5_w(uint8_t data){ m_fga002[FGA_ICRLOCAL5] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } +void fga002_device::do_fga002reg_icrlocal6_w(uint8_t data){ m_fga002[FGA_ICRLOCAL6] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } +void fga002_device::do_fga002reg_icrlocal7_w(uint8_t data){ m_fga002[FGA_ICRLOCAL7] = data; LOGINT(("%s(%02x)\n", FUNCNAME, data)); } // Local Interrupt Status Register methods -UINT8 fga002_device::do_fga002reg_islocal0_r(){ UINT8 ret = m_fga002[FGA_ISLOCAL0]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_islocal1_r(){ UINT8 ret = m_fga002[FGA_ISLOCAL1]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_islocal2_r(){ UINT8 ret = m_fga002[FGA_ISLOCAL2]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_islocal3_r(){ UINT8 ret = m_fga002[FGA_ISLOCAL3]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_islocal4_r(){ UINT8 ret = m_fga002[FGA_ISLOCAL4]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_islocal5_r(){ UINT8 ret = m_fga002[FGA_ISLOCAL5]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_islocal6_r(){ UINT8 ret = m_fga002[FGA_ISLOCAL6]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } -UINT8 fga002_device::do_fga002reg_islocal7_r(){ UINT8 ret = m_fga002[FGA_ISLOCAL7]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_islocal0_r(){ uint8_t ret = m_fga002[FGA_ISLOCAL0]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_islocal1_r(){ uint8_t ret = m_fga002[FGA_ISLOCAL1]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_islocal2_r(){ uint8_t ret = m_fga002[FGA_ISLOCAL2]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_islocal3_r(){ uint8_t ret = m_fga002[FGA_ISLOCAL3]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_islocal4_r(){ uint8_t ret = m_fga002[FGA_ISLOCAL4]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_islocal5_r(){ uint8_t ret = m_fga002[FGA_ISLOCAL5]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_islocal6_r(){ uint8_t ret = m_fga002[FGA_ISLOCAL6]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } +uint8_t fga002_device::do_fga002reg_islocal7_r(){ uint8_t ret = m_fga002[FGA_ISLOCAL7]; LOGINT(("%s() <- %02x\n", FUNCNAME, ret)); return ret; } void fga002_device::islocal_w(int status, int vector, int control, int data) { @@ -576,14 +576,14 @@ void fga002_device::islocal_w(int status, int vector, int control, int data) } // TODO: support level triggered interrupts, only edge triggered interrupts are supported atm -void fga002_device::do_fga002reg_islocal0_w(UINT8 data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL0, INT_LOCAL0, FGA_ICRLOCAL0, data ); } -void fga002_device::do_fga002reg_islocal1_w(UINT8 data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL1, INT_LOCAL1, FGA_ICRLOCAL1, data ); } -void fga002_device::do_fga002reg_islocal2_w(UINT8 data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL2, INT_LOCAL2, FGA_ICRLOCAL2, data ); } -void fga002_device::do_fga002reg_islocal3_w(UINT8 data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL3, INT_LOCAL3, FGA_ICRLOCAL3, data ); } -void fga002_device::do_fga002reg_islocal4_w(UINT8 data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL4, INT_LOCAL4, FGA_ICRLOCAL4, data ); m_liack4_cb(); } /* terminate device IRQ */ -void fga002_device::do_fga002reg_islocal5_w(UINT8 data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL5, INT_LOCAL5, FGA_ICRLOCAL5, data ); m_liack5_cb(); } -void fga002_device::do_fga002reg_islocal6_w(UINT8 data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL6, INT_LOCAL6, FGA_ICRLOCAL6, data ); m_liack6_cb(); } -void fga002_device::do_fga002reg_islocal7_w(UINT8 data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL6, INT_LOCAL7, FGA_ICRLOCAL7, data ); m_liack7_cb(); } +void fga002_device::do_fga002reg_islocal0_w(uint8_t data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL0, INT_LOCAL0, FGA_ICRLOCAL0, data ); } +void fga002_device::do_fga002reg_islocal1_w(uint8_t data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL1, INT_LOCAL1, FGA_ICRLOCAL1, data ); } +void fga002_device::do_fga002reg_islocal2_w(uint8_t data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL2, INT_LOCAL2, FGA_ICRLOCAL2, data ); } +void fga002_device::do_fga002reg_islocal3_w(uint8_t data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL3, INT_LOCAL3, FGA_ICRLOCAL3, data ); } +void fga002_device::do_fga002reg_islocal4_w(uint8_t data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL4, INT_LOCAL4, FGA_ICRLOCAL4, data ); m_liack4_cb(); } /* terminate device IRQ */ +void fga002_device::do_fga002reg_islocal5_w(uint8_t data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL5, INT_LOCAL5, FGA_ICRLOCAL5, data ); m_liack5_cb(); } +void fga002_device::do_fga002reg_islocal6_w(uint8_t data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL6, INT_LOCAL6, FGA_ICRLOCAL6, data ); m_liack6_cb(); } +void fga002_device::do_fga002reg_islocal7_w(uint8_t data){ LOGINT(("%s\n", FUNCNAME)); islocal_w( FGA_ISLOCAL6, INT_LOCAL7, FGA_ICRLOCAL7, data ); m_liack7_cb(); } // Local IRQ callbacks // TODO: support level triggered interrupts, ICR bit 6, only edge triggered interrupts are supported atm @@ -722,7 +722,7 @@ WRITE8_MEMBER (fga002_device::write){ } READ8_MEMBER (fga002_device::read){ - UINT8 ret = 0; + uint8_t ret = 0; LOG(("%s[%04x] ", FUNCNAME, offset)); switch(offset) diff --git a/src/devices/machine/fga002.h b/src/devices/machine/fga002.h index 88d5a8d11b5..8722c96761e 100644 --- a/src/devices/machine/fga002.h +++ b/src/devices/machine/fga002.h @@ -46,8 +46,8 @@ class fga002_device : public device_t { public: // construction/destruction - fga002_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - fga002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fga002_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + fga002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER (write); DECLARE_READ8_MEMBER (read); @@ -96,23 +96,23 @@ class fga002_device : public device_t private: - UINT8 m_tim0count; - UINT8 m_fga002[0x500]; + uint8_t m_tim0count; + uint8_t m_fga002[0x500]; - UINT8 do_fga002reg_ctl3_r(); - void do_fga002reg_ctl3_w(UINT8 data); + uint8_t do_fga002reg_ctl3_r(); + void do_fga002reg_ctl3_w(uint8_t data); /* Timer functions */ - UINT8 do_fga002reg_tim0preload_r(); - void do_fga002reg_tim0preload_w(UINT8 data); - UINT8 do_fga002reg_tim0ctl_r(); - void do_fga002reg_tim0ctl_w(UINT8 data); - UINT8 do_fga002reg_tim0count_r(); - void do_fga002reg_tim0count_w(UINT8 data); - UINT8 do_fga002reg_icrtim0_r(); - void do_fga002reg_icrtim0_w(UINT8 data); - UINT8 do_fga002reg_istim0_r(); - void do_fga002reg_istim0_w(UINT8 data); + uint8_t do_fga002reg_tim0preload_r(); + void do_fga002reg_tim0preload_w(uint8_t data); + uint8_t do_fga002reg_tim0ctl_r(); + void do_fga002reg_tim0ctl_w(uint8_t data); + uint8_t do_fga002reg_tim0count_r(); + void do_fga002reg_tim0count_w(uint8_t data); + uint8_t do_fga002reg_icrtim0_r(); + void do_fga002reg_icrtim0_w(uint8_t data); + uint8_t do_fga002reg_istim0_r(); + void do_fga002reg_istim0_w(uint8_t data); emu_timer *fga_timer; enum { @@ -146,47 +146,47 @@ class fga002_device : public device_t }; /* Interrupt support */ - UINT8 m_irq_level; - UINT8 do_fga002reg_localiack_r(); - void do_fga002reg_localiack_w(UINT8 data); - - UINT8 do_fga002reg_islocal0_r(); - UINT8 do_fga002reg_islocal1_r(); - UINT8 do_fga002reg_islocal2_r(); - UINT8 do_fga002reg_islocal3_r(); - UINT8 do_fga002reg_islocal4_r(); - UINT8 do_fga002reg_islocal5_r(); - UINT8 do_fga002reg_islocal6_r(); - UINT8 do_fga002reg_islocal7_r(); + uint8_t m_irq_level; + uint8_t do_fga002reg_localiack_r(); + void do_fga002reg_localiack_w(uint8_t data); + + uint8_t do_fga002reg_islocal0_r(); + uint8_t do_fga002reg_islocal1_r(); + uint8_t do_fga002reg_islocal2_r(); + uint8_t do_fga002reg_islocal3_r(); + uint8_t do_fga002reg_islocal4_r(); + uint8_t do_fga002reg_islocal5_r(); + uint8_t do_fga002reg_islocal6_r(); + uint8_t do_fga002reg_islocal7_r(); void islocal_w(int status, int vector, int control, int data); - void do_fga002reg_islocal0_w(UINT8 data); - void do_fga002reg_islocal1_w(UINT8 data); - void do_fga002reg_islocal2_w(UINT8 data); - void do_fga002reg_islocal3_w(UINT8 data); - void do_fga002reg_islocal4_w(UINT8 data); - void do_fga002reg_islocal5_w(UINT8 data); - void do_fga002reg_islocal6_w(UINT8 data); - void do_fga002reg_islocal7_w(UINT8 data); - - UINT8 do_fga002reg_icrlocal0_r(); - UINT8 do_fga002reg_icrlocal1_r(); - UINT8 do_fga002reg_icrlocal2_r(); - UINT8 do_fga002reg_icrlocal3_r(); - UINT8 do_fga002reg_icrlocal4_r(); - UINT8 do_fga002reg_icrlocal5_r(); - UINT8 do_fga002reg_icrlocal6_r(); - UINT8 do_fga002reg_icrlocal7_r(); - void do_fga002reg_icrlocal0_w(UINT8 data); - void do_fga002reg_icrlocal1_w(UINT8 data); - void do_fga002reg_icrlocal2_w(UINT8 data); - void do_fga002reg_icrlocal3_w(UINT8 data); - void do_fga002reg_icrlocal4_w(UINT8 data); - void do_fga002reg_icrlocal5_w(UINT8 data); - void do_fga002reg_icrlocal6_w(UINT8 data); - void do_fga002reg_icrlocal7_w(UINT8 data); - - void trigger_interrupt(UINT8 data); + void do_fga002reg_islocal0_w(uint8_t data); + void do_fga002reg_islocal1_w(uint8_t data); + void do_fga002reg_islocal2_w(uint8_t data); + void do_fga002reg_islocal3_w(uint8_t data); + void do_fga002reg_islocal4_w(uint8_t data); + void do_fga002reg_islocal5_w(uint8_t data); + void do_fga002reg_islocal6_w(uint8_t data); + void do_fga002reg_islocal7_w(uint8_t data); + + uint8_t do_fga002reg_icrlocal0_r(); + uint8_t do_fga002reg_icrlocal1_r(); + uint8_t do_fga002reg_icrlocal2_r(); + uint8_t do_fga002reg_icrlocal3_r(); + uint8_t do_fga002reg_icrlocal4_r(); + uint8_t do_fga002reg_icrlocal5_r(); + uint8_t do_fga002reg_icrlocal6_r(); + uint8_t do_fga002reg_icrlocal7_r(); + void do_fga002reg_icrlocal0_w(uint8_t data); + void do_fga002reg_icrlocal1_w(uint8_t data); + void do_fga002reg_icrlocal2_w(uint8_t data); + void do_fga002reg_icrlocal3_w(uint8_t data); + void do_fga002reg_icrlocal4_w(uint8_t data); + void do_fga002reg_icrlocal5_w(uint8_t data); + void do_fga002reg_icrlocal6_w(uint8_t data); + void do_fga002reg_icrlocal7_w(uint8_t data); + + void trigger_interrupt(uint8_t data); void check_interrupts(); enum { diff --git a/src/devices/machine/gayle.cpp b/src/devices/machine/gayle.cpp index 93ea9034eb0..2127f41d87f 100644 --- a/src/devices/machine/gayle.cpp +++ b/src/devices/machine/gayle.cpp @@ -33,7 +33,7 @@ const device_type GAYLE = &device_creator; // gayle_device - constructor //------------------------------------------------- -gayle_device::gayle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +gayle_device::gayle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GAYLE, "GAYLE", tag, owner, clock, "gayle", __FILE__), m_int2_w(*this), m_cs0_read(*this), @@ -49,7 +49,7 @@ gayle_device::gayle_device(const machine_config &mconfig, const char *tag, devic // set_id - set gayle id //------------------------------------------------- -void gayle_device::set_id(device_t &device, UINT8 id) +void gayle_device::set_id(device_t &device, uint8_t id) { gayle_device &gayle = downcast(device); gayle.m_gayle_id = id; @@ -88,7 +88,7 @@ void gayle_device::device_reset() READ16_MEMBER( gayle_device::gayle_r ) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; offset <<= 1; // swap @@ -188,7 +188,7 @@ WRITE_LINE_MEMBER( gayle_device::ide_interrupt_w ) READ16_MEMBER( gayle_device::gayle_id_r ) { - UINT16 data; + uint16_t data; if (ACCESSING_BITS_8_15) data = ((m_gayle_id << m_gayle_id_count++) & 0x80) << 8; diff --git a/src/devices/machine/gayle.h b/src/devices/machine/gayle.h index 6ea542dd392..d59bf1c5d67 100644 --- a/src/devices/machine/gayle.h +++ b/src/devices/machine/gayle.h @@ -50,7 +50,7 @@ class gayle_device : public device_t { public: // construction/destruction - gayle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gayle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // callbacks template static devcb_base &set_int2_handler(device_t &device, _Object object) @@ -77,7 +77,7 @@ public: DECLARE_WRITE16_MEMBER( gayle_id_w ); // inline configuration - static void set_id(device_t &device, UINT8 id); + static void set_id(device_t &device, uint8_t id); protected: virtual void device_start() override; @@ -99,9 +99,9 @@ private: devcb_read16 m_cs1_read; devcb_write16 m_cs1_write; - UINT8 m_gayle_id; + uint8_t m_gayle_id; int m_gayle_id_count; - UINT8 m_gayle_reg[4]; + uint8_t m_gayle_reg[4]; }; // device type definition diff --git a/src/devices/machine/gen_latch.cpp b/src/devices/machine/gen_latch.cpp index 2a595595c14..f7848abfaee 100644 --- a/src/devices/machine/gen_latch.cpp +++ b/src/devices/machine/gen_latch.cpp @@ -23,7 +23,7 @@ const device_type GENERIC_LATCH_8 = &device_creator; // generic_latch_8_device - constructor //------------------------------------------------- -generic_latch_8_device::generic_latch_8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +generic_latch_8_device::generic_latch_8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GENERIC_LATCH_8, "Generic 8-bit latch", tag, owner, clock, "generic_latch_8", __FILE__), m_latched_value(0), m_latch_read(0) @@ -66,9 +66,9 @@ WRITE_LINE_MEMBER( generic_latch_8_device::clear_w ) // callback to set a latch value //------------------------------------------------- -void generic_latch_8_device::sync_callback(void *ptr, INT32 param) +void generic_latch_8_device::sync_callback(void *ptr, int32_t param) { - UINT8 value = param; + uint8_t value = param; // if the latch hasn't been read and the value is changed, log a warning if (!m_latch_read && m_latched_value != value) @@ -105,7 +105,7 @@ const device_type GENERIC_LATCH_16 = &device_creator; // generic_latch_16_device - constructor //------------------------------------------------- -generic_latch_16_device::generic_latch_16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +generic_latch_16_device::generic_latch_16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GENERIC_LATCH_16, "Generic 16-bit latch", tag, owner, clock, "generic_latch_16", __FILE__), m_latched_value(0), m_latch_read(0) @@ -148,9 +148,9 @@ WRITE_LINE_MEMBER( generic_latch_16_device::clear_w ) // callback to set a latch value //------------------------------------------------- -void generic_latch_16_device::sync_callback(void *ptr, INT32 param) +void generic_latch_16_device::sync_callback(void *ptr, int32_t param) { - UINT16 value = param; + uint16_t value = param; // if the latch hasn't been read and the value is changed, log a warning if (!m_latch_read && m_latched_value != value) diff --git a/src/devices/machine/gen_latch.h b/src/devices/machine/gen_latch.h index 07938a7b5d9..8076f8c7b14 100644 --- a/src/devices/machine/gen_latch.h +++ b/src/devices/machine/gen_latch.h @@ -31,7 +31,7 @@ class generic_latch_8_device : public device_t { public: // construction/destruction - generic_latch_8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_latch_8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -41,15 +41,15 @@ public: DECLARE_WRITE_LINE_MEMBER( preset_w ); DECLARE_WRITE_LINE_MEMBER( clear_w ); - void preset_w(UINT16 value) { m_latched_value = value; } + void preset_w(uint16_t value) { m_latched_value = value; } protected: virtual void device_start() override; - void sync_callback(void *ptr, INT32 param); + void sync_callback(void *ptr, int32_t param); private: - UINT16 m_latched_value; - UINT8 m_latch_read; + uint16_t m_latched_value; + uint8_t m_latch_read; }; // device type definition @@ -62,7 +62,7 @@ class generic_latch_16_device : public device_t { public: // construction/destruction - generic_latch_16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_latch_16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER( read ); DECLARE_WRITE16_MEMBER( write ); @@ -75,10 +75,10 @@ public: protected: virtual void device_start() override; - void sync_callback(void *ptr, INT32 param); + void sync_callback(void *ptr, int32_t param); private: - UINT16 m_latched_value; - UINT8 m_latch_read; + uint16_t m_latched_value; + uint8_t m_latch_read; }; // device type definition diff --git a/src/devices/machine/genpc.cpp b/src/devices/machine/genpc.cpp index 978683d7ab5..9a44c04e1d0 100644 --- a/src/devices/machine/genpc.cpp +++ b/src/devices/machine/genpc.cpp @@ -507,7 +507,7 @@ void ibm5160_mb_device::static_set_cputag(device_t &device, const char *tag) // ibm5160_mb_device - constructor //------------------------------------------------- -ibm5160_mb_device::ibm5160_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ibm5160_mb_device::ibm5160_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IBM5160_MOTHERBOARD, "IBM5160_MOTHERBOARD", tag, owner, clock, "ibm5160_mb", __FILE__), m_maincpu(*owner, "maincpu"), m_pic8259(*this, "pic8259"), @@ -611,7 +611,7 @@ machine_config_constructor ibm5150_mb_device::device_mconfig_additions() const // ibm5150_mb_device - constructor //------------------------------------------------- -ibm5150_mb_device::ibm5150_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ibm5150_mb_device::ibm5150_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ibm5160_mb_device(mconfig, tag, owner, clock), m_cassette(*this, "cassette") { @@ -826,7 +826,7 @@ ioport_constructor ec1841_mb_device::device_input_ports() const // ec1841_mb_device - constructor //------------------------------------------------- -ec1841_mb_device::ec1841_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ec1841_mb_device::ec1841_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ibm5160_mb_device(mconfig, tag, owner, clock) { } @@ -876,7 +876,7 @@ READ8_MEMBER ( ec1841_mb_device::pc_ppi_portc_r ) return data; } -pc_noppi_mb_device::pc_noppi_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pc_noppi_mb_device::pc_noppi_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ibm5160_mb_device(mconfig, tag, owner, clock) { } diff --git a/src/devices/machine/genpc.h b/src/devices/machine/genpc.h index e766ea367da..9c982c3fccd 100644 --- a/src/devices/machine/genpc.h +++ b/src/devices/machine/genpc.h @@ -29,7 +29,7 @@ class ibm5160_mb_device : public device_t { public: // construction/destruction - ibm5160_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ibm5160_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration static void static_set_cputag(device_t &device, const char *tag); @@ -55,25 +55,25 @@ public: /* U73 is an LS74 - dual flip flop */ /* Q2 is set by OUT1 from the 8253 and goes to DRQ1 on the 8237 */ - UINT8 m_u73_q2; - UINT8 m_out1; + uint8_t m_u73_q2; + uint8_t m_out1; int m_dma_channel; - UINT8 m_dma_offset[4]; - UINT8 m_pc_spkrdata; - UINT8 m_pit_out2; + uint8_t m_dma_offset[4]; + uint8_t m_pc_spkrdata; + uint8_t m_pit_out2; bool m_cur_eop; - UINT8 m_nmi_enabled; + uint8_t m_nmi_enabled; int m_ppi_portc_switch_high; int m_ppi_speaker; int m_ppi_keyboard_clear; - UINT8 m_ppi_keyb_clock; - UINT8 m_ppi_portb; - UINT8 m_ppi_clock_signal; - UINT8 m_ppi_data_signal; - UINT8 m_ppi_shift_register; - UINT8 m_ppi_shift_enable; + uint8_t m_ppi_keyb_clock; + uint8_t m_ppi_portb; + uint8_t m_ppi_clock_signal; + uint8_t m_ppi_data_signal; + uint8_t m_ppi_shift_register; + uint8_t m_ppi_shift_enable; // interface to the keyboard DECLARE_WRITE_LINE_MEMBER( keyboard_clock_w ); @@ -127,7 +127,7 @@ class ibm5150_mb_device : public ibm5160_mb_device { public: // construction/destruction - ibm5150_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ibm5150_mb_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; @@ -157,7 +157,7 @@ class ec1841_mb_device : public ibm5160_mb_device { public: // construction/destruction - ec1841_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ec1841_mb_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; @@ -181,8 +181,8 @@ class pc_noppi_mb_device : public ibm5160_mb_device { public: // construction/destruction - pc_noppi_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - UINT8 pit_out2() { return m_pit_out2; } // helper for near-clones with multifunction ics instead of 8255s + pc_noppi_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + uint8_t pit_out2() { return m_pit_out2; } // helper for near-clones with multifunction ics instead of 8255s DECLARE_ADDRESS_MAP(map, 8); diff --git a/src/devices/machine/gt64xxx.cpp b/src/devices/machine/gt64xxx.cpp index 15fb9443234..9d38fef3c7f 100644 --- a/src/devices/machine/gt64xxx.cpp +++ b/src/devices/machine/gt64xxx.cpp @@ -23,7 +23,7 @@ DEVICE_ADDRESS_MAP_START(cpu_map, 32, gt64xxx_device) AM_RANGE(0x00000000, 0x00000cff) AM_READWRITE( cpu_if_r, cpu_if_w) ADDRESS_MAP_END -gt64xxx_device::gt64xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gt64xxx_device::gt64xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_host_device(mconfig, GT64XXX, "Galileo GT-64XXX System Controller", tag, owner, clock, "gt64xxx", __FILE__), m_be(0), m_autoconfig(0), m_irq_num(-1), m_mem_config("memory_space", ENDIANNESS_LITTLE, 32, 32), @@ -68,7 +68,7 @@ void gt64xxx_device::device_start() m_dma_timer->adjust(attotime::never, 0, DMA_TIMER_PERIOD); // ROM - UINT32 romSize = m_romRegion->bytes(); + uint32_t romSize = m_romRegion->bytes(); m_cpu_space->install_rom (0x1fc00000, 0x1fc00000 + romSize - 1, m_romRegion->base()); // ROM MIPS DRC m_cpu->add_fastram(0x1fc00000, 0x1fc00000 + romSize - 1, TRUE, m_romRegion->base()); @@ -152,7 +152,7 @@ void gt64xxx_device::device_reset() void gt64xxx_device::map_cpu_space() { - UINT32 winStart, winEnd; + uint32_t winStart, winEnd; // ROM region starts at 0x1fc00000 m_cpu_space->unmap_readwrite(0x00000000, 0x1fbfffff); @@ -176,7 +176,7 @@ void gt64xxx_device::map_cpu_space() m_ram[ramIndex].resize((winEnd + 1 - winStart) / 4); m_cpu_space->install_ram(winStart, winEnd, m_ram[ramIndex].data()); //m_cpu->add_fastram(winStart, m_ram[ramIndex].size() * sizeof(m_ram[ramIndex][0]), FALSE, &m_ram[ramIndex][0]); - //m_cpu->add_fastram(winStart, m_ram[ramIndex].size() * sizeof(UINT32), FALSE, m_ram[ramIndex].data()); + //m_cpu->add_fastram(winStart, m_ram[ramIndex].size() * sizeof(uint32_t), FALSE, m_ram[ramIndex].data()); if (LOG_GALILEO) logerror("%s: map_cpu_space ras[%i] start: %08X end: %08X\n", tag(), ramIndex, winStart, winEnd); } @@ -254,11 +254,11 @@ void gt64xxx_device::map_cpu_space() } } -void gt64xxx_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 gt64xxx_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) { int ramIndex; - UINT32 winStart, winEnd, winSize; + uint32_t winStart, winEnd, winSize; // Not sure if GREG_RAS_1_0_LO should be added on PCI address map side. // RAS0 @@ -332,7 +332,7 @@ WRITE_LINE_MEMBER(gt64xxx_device::pci_stall) // PCI bus control READ32_MEMBER (gt64xxx_device::pci_config_r) { - UINT32 result = 0; + uint32_t result = 0; if (LOG_GALILEO) logerror("%06X:galileo pci_config_r from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); return result; @@ -345,7 +345,7 @@ WRITE32_MEMBER (gt64xxx_device::pci_config_w) // PCI Master Window 0 READ32_MEMBER (gt64xxx_device::master_mem0_r) { - UINT32 result = this->space(AS_DATA).read_dword((m_reg[GREG_PCI_MEM0_LO]<<21) | (offset*4), mem_mask); + uint32_t result = this->space(AS_DATA).read_dword((m_reg[GREG_PCI_MEM0_LO]<<21) | (offset*4), mem_mask); if (LOG_PCI) logerror("%06X:galileo pci mem0 read from offset %08X = %08X & %08X\n", space.device().safe_pc(), (m_reg[GREG_PCI_MEM0_LO]<<21) | (offset*4), result, mem_mask); return result; @@ -372,7 +372,7 @@ WRITE32_MEMBER (gt64xxx_device::master_mem0_w) // PCI Master Window 1 READ32_MEMBER (gt64xxx_device::master_mem1_r) { - UINT32 result = this->space(AS_DATA).read_dword((m_reg[GREG_PCI_MEM1_LO]<<21) | (offset*4), mem_mask); + uint32_t result = this->space(AS_DATA).read_dword((m_reg[GREG_PCI_MEM1_LO]<<21) | (offset*4), mem_mask); if (LOG_PCI) logerror("%06X:galileo pci mem1 read from offset %08X = %08X & %08X\n", space.device().safe_pc(), (m_reg[GREG_PCI_MEM1_LO]<<21) | (offset*4), result, mem_mask); return result; @@ -387,7 +387,7 @@ WRITE32_MEMBER (gt64xxx_device::master_mem1_w) // PCI Master IO READ32_MEMBER (gt64xxx_device::master_io_r) { - UINT32 result = this->space(AS_IO).read_dword((m_reg[GREG_PCI_IO_LO]<<21) | (offset*4), mem_mask); + uint32_t result = this->space(AS_IO).read_dword((m_reg[GREG_PCI_IO_LO]<<21) | (offset*4), mem_mask); if (LOG_PCI && m_prev_addr != offset) { m_prev_addr = offset; logerror("%06X:galileo pci io read from offset %08X = %08X & %08X\n", space.device().safe_pc(), (m_reg[GREG_PCI_IO_LO] << 21) | (offset * 4), result, mem_mask); @@ -405,7 +405,7 @@ WRITE32_MEMBER (gt64xxx_device::master_io_w) READ32_MEMBER(gt64xxx_device::ras_0_r) { - UINT32 result = m_ram[0][offset]; + uint32_t result = m_ram[0][offset]; if (LOG_PCI) logerror("%06X:galileo ras_0 read from offset %08X = %08X & %08X\n", space.device().safe_pc(), offset * 4, result, mem_mask); return result; @@ -420,7 +420,7 @@ WRITE32_MEMBER(gt64xxx_device::ras_0_w) READ32_MEMBER(gt64xxx_device::ras_1_r) { - UINT32 result = m_ram[1][offset]; + uint32_t result = m_ram[1][offset]; if (LOG_PCI) logerror("%06X:galileo ras_0 read from offset %08X = %08X & %08X\n", space.device().safe_pc(), offset * 4, result, mem_mask); return result; @@ -435,7 +435,7 @@ WRITE32_MEMBER(gt64xxx_device::ras_1_w) READ32_MEMBER(gt64xxx_device::ras_2_r) { - UINT32 result = m_ram[2][offset]; + uint32_t result = m_ram[2][offset]; if (LOG_PCI) logerror("%06X:galileo ras_0 read from offset %08X = %08X & %08X\n", space.device().safe_pc(), offset * 4, result, mem_mask); return result; @@ -450,7 +450,7 @@ WRITE32_MEMBER(gt64xxx_device::ras_2_w) READ32_MEMBER(gt64xxx_device::ras_3_r) { - UINT32 result = m_ram[3][offset]; + uint32_t result = m_ram[3][offset]; if (LOG_PCI) logerror("%06X:galileo ras_0 read from offset %08X = %08X & %08X\n", space.device().safe_pc(), offset * 4, result, mem_mask); return result; @@ -467,7 +467,7 @@ WRITE32_MEMBER(gt64xxx_device::ras_3_w) // CPU I/F READ32_MEMBER (gt64xxx_device::cpu_if_r) { - UINT32 result = m_reg[offset]; + uint32_t result = m_reg[offset]; /* switch off the offset for special cases */ switch (offset) @@ -483,7 +483,7 @@ READ32_MEMBER (gt64xxx_device::cpu_if_r) result = timer->count; if (timer->active) { - UINT32 elapsed = (timer->timer->elapsed() * m_clock).as_double(); + uint32_t elapsed = (timer->timer->elapsed() * m_clock).as_double(); result = (result > elapsed) ? (result - elapsed) : 0; } @@ -538,7 +538,7 @@ WRITE32_MEMBER(gt64xxx_device::cpu_if_w) mem_mask = flipendian_int32(mem_mask); } - UINT32 oldata = m_reg[offset]; + uint32_t oldata = m_reg[offset]; COMBINE_DATA(&m_reg[offset]); /* switch off the offset for special cases */ @@ -639,7 +639,7 @@ WRITE32_MEMBER(gt64xxx_device::cpu_if_w) } else if (timer->active && !(data & mask)) { - UINT32 elapsed = (timer->timer->elapsed() * m_clock).as_double(); + uint32_t elapsed = (timer->timer->elapsed() * m_clock).as_double(); timer->active = 0; timer->count = (timer->count > elapsed) ? (timer->count - elapsed) : 0; timer->timer->adjust(attotime::never, which); @@ -666,7 +666,7 @@ WRITE32_MEMBER(gt64xxx_device::cpu_if_w) case GREG_CONFIG_ADDRESS: // Type 0 config transactions signalled by Bus Num = 0 and Device Num != 0 // Bits 15:11 get mapped into device number for configuration - UINT32 modData; + uint32_t modData; if (0 && (data & 0xff0000) == 0x0 && (data & 0xf800)) { // Type 0 transaction modData = 0; @@ -756,7 +756,7 @@ TIMER_CALLBACK_MEMBER(gt64xxx_device::timer_callback) * Galileo DMA handler * *************************************/ -address_space* gt64xxx_device::dma_decode_address(UINT32 &addr) +address_space* gt64xxx_device::dma_decode_address(uint32_t &addr) { for (size_t index = 0; index < proc_addr_bank::ADDR_NUM; ++index) { @@ -769,7 +769,7 @@ address_space* gt64xxx_device::dma_decode_address(UINT32 &addr) int gt64xxx_device::dma_fetch_next(address_space &space, int which) { offs_t address = 0; - UINT32 data; + uint32_t data; /* no-op for unchained mode */ if (!(m_reg[GREG_DMA0_CONTROL + which] & 0x200)) @@ -827,7 +827,7 @@ TIMER_CALLBACK_MEMBER (gt64xxx_device::perform_dma) { offs_t srcaddr = m_reg[GREG_DMA0_SOURCE + which]; offs_t dstaddr = m_reg[GREG_DMA0_DEST + which]; - UINT32 bytesleft = m_reg[GREG_DMA0_COUNT + which] & 0xffff; + uint32_t bytesleft = m_reg[GREG_DMA0_COUNT + which] & 0xffff; address_space* srcSpace = dma_decode_address(srcaddr); address_space* dstSpace = dma_decode_address(dstaddr); @@ -867,7 +867,7 @@ TIMER_CALLBACK_MEMBER (gt64xxx_device::perform_dma) m_reg[GREG_DMA0_COUNT + which] = (m_reg[GREG_DMA0_COUNT + which] & ~0xffff) | bytesleft; m_retry_count++; - UINT32 configRetryCount = (m_reg[GREG_PCI_TIMEOUT] >> 16) & 0xff; + uint32_t configRetryCount = (m_reg[GREG_PCI_TIMEOUT] >> 16) & 0xff; if (m_retry_count >= configRetryCount && configRetryCount > 0) { logerror("gt64xxx_device::perform_dma Error! Too many PCI retries. DMA%d: src=%08X dst=%08X bytes=%04X sinc=%d dinc=%d\n", which, srcaddr, dstaddr, bytesleft, srcinc, dstinc); // Signal error and abort DMA diff --git a/src/devices/machine/gt64xxx.h b/src/devices/machine/gt64xxx.h index 467e72bcae5..15720d36897 100644 --- a/src/devices/machine/gt64xxx.h +++ b/src/devices/machine/gt64xxx.h @@ -173,14 +173,14 @@ struct galileo_timer { emu_timer * timer; - UINT32 count; - UINT8 active; + uint32_t count; + uint8_t active; }; struct galileo_addr_map { - UINT32 low_addr; - UINT32 high_addr; + uint32_t low_addr; + uint32_t high_addr; address_space* space; galileo_addr_map() : low_addr(0xffffffff), high_addr(0x0) {} }; @@ -196,14 +196,14 @@ struct galileo_device_map class gt64xxx_device : public pci_host_device { public: - gt64xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gt64xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void reset_all_mappings() 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; void set_cpu_tag(const char *tag) { cpu_tag = tag;} - void set_clock(const UINT32 clock) {m_clock = clock;} + void set_clock(const uint32_t clock) {m_clock = clock;} void set_be(const int be) {m_be = be;} void set_autoconfig(const int autoconfig) {m_autoconfig = autoconfig;} void set_irq_num(const int irq_num) {m_irq_num = irq_num;} @@ -255,16 +255,16 @@ protected: private: mips3_device *m_cpu; const char *cpu_tag; - UINT32 m_clock; + uint32_t m_clock; int m_be, m_autoconfig; int m_irq_num; int m_pci_stall_state; int m_retry_count; int m_pci_cpu_stalled; - UINT32 m_cpu_stalled_offset; - UINT32 m_cpu_stalled_data; - UINT32 m_cpu_stalled_mem_mask; + uint32_t m_cpu_stalled_offset; + uint32_t m_cpu_stalled_data; + uint32_t m_cpu_stalled_mem_mask; address_space_config m_mem_config, m_io_config; @@ -275,19 +275,19 @@ private: void map_cpu_space(); - UINT32 m_prev_addr; + uint32_t m_prev_addr; /* raw register data */ - UINT32 m_reg[0xd00/4]; + uint32_t m_reg[0xd00/4]; /* timer info */ galileo_timer m_timer[4]; TIMER_CALLBACK_MEMBER(timer_callback); /* DMA info */ - INT8 m_dma_active; + int8_t m_dma_active; // Ram - std::vector m_ram[4]; + std::vector m_ram[4]; // Chip Select galileo_device_map m_cs_map[4]; @@ -308,7 +308,7 @@ private: galileo_addr_map dma_addr_map[proc_addr_bank::ADDR_NUM]; int dma_fetch_next(address_space &space, int which); TIMER_CALLBACK_MEMBER(perform_dma); - address_space* dma_decode_address(UINT32 &addr); + address_space* dma_decode_address(uint32_t &addr); }; diff --git a/src/devices/machine/hd63450.cpp b/src/devices/machine/hd63450.cpp index e15039fbb38..cc5cbe7940a 100644 --- a/src/devices/machine/hd63450.cpp +++ b/src/devices/machine/hd63450.cpp @@ -10,7 +10,7 @@ const device_type HD63450 = &device_creator; -hd63450_device::hd63450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd63450_device::hd63450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HD63450, "Hitachi HD63450", tag, owner, clock, "hd63450", __FILE__), m_dma_end(*this), m_dma_error(*this), diff --git a/src/devices/machine/hd63450.h b/src/devices/machine/hd63450.h index e303a0d28b2..5cee35500fc 100644 --- a/src/devices/machine/hd63450.h +++ b/src/devices/machine/hd63450.h @@ -71,7 +71,7 @@ struct hd63450_regs class hd63450_device : public device_t { public: - hd63450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd63450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~hd63450_device() {} template static devcb_base &set_dma_end_callback(device_t &device, _Object object) { return downcast(device).m_dma_end.set_callback(object); } diff --git a/src/devices/machine/hd64610.cpp b/src/devices/machine/hd64610.cpp index f006b2a65d2..c44cc072e61 100644 --- a/src/devices/machine/hd64610.cpp +++ b/src/devices/machine/hd64610.cpp @@ -98,7 +98,7 @@ inline void hd64610_device::set_irq_line() // read_counter - //------------------------------------------------- -inline UINT8 hd64610_device::read_counter(int counter) +inline uint8_t hd64610_device::read_counter(int counter) { return bcd_2_dec(m_regs[counter]); } @@ -108,7 +108,7 @@ inline UINT8 hd64610_device::read_counter(int counter) // write_counter - //------------------------------------------------- -inline void hd64610_device::write_counter(int counter, UINT8 value) +inline void hd64610_device::write_counter(int counter, uint8_t value) { m_regs[counter] = dec_2_bcd(value); } @@ -150,7 +150,7 @@ inline void hd64610_device::check_alarm() // hd64610_device - constructor //------------------------------------------------- -hd64610_device::hd64610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd64610_device::hd64610_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HD64610, "HD64610", tag, owner, clock, "hd64610", __FILE__), device_rtc_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -286,7 +286,7 @@ WRITE_LINE_MEMBER( hd64610_device::h_w ) READ8_MEMBER( hd64610_device::read ) { - UINT8 data = m_regs[offset & 0x0f]; + uint8_t data = m_regs[offset & 0x0f]; if (LOG) logerror("HD64610 '%s' Register %u Read %02x\n", tag(), offset, data); diff --git a/src/devices/machine/hd64610.h b/src/devices/machine/hd64610.h index 2dc5726ddea..44357443d68 100644 --- a/src/devices/machine/hd64610.h +++ b/src/devices/machine/hd64610.h @@ -54,7 +54,7 @@ class hd64610_device : public device_t, { public: // construction/destruction - hd64610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd64610_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_cb.set_callback(object); } template static devcb_base &set_out_1hz_callback(device_t &device, _Object object) { return downcast(device).m_out_1hz_cb.set_callback(object); } @@ -80,8 +80,8 @@ protected: private: inline void set_irq_line(); - inline UINT8 read_counter(int counter); - inline void write_counter(int counter, UINT8 value); + inline uint8_t read_counter(int counter); + inline void write_counter(int counter, uint8_t value); inline void check_alarm(); static const device_timer_id TIMER_UPDATE_COUNTER = 0; @@ -89,7 +89,7 @@ private: devcb_write_line m_out_irq_cb; devcb_write_line m_out_1hz_cb; - UINT8 m_regs[0x10]; // Internal registers + uint8_t m_regs[0x10]; // Internal registers int m_hline_state; // H-Start/Stop line int m_irq_out; // alarm output diff --git a/src/devices/machine/hdc92x4.cpp b/src/devices/machine/hdc92x4.cpp index 8de7457143a..0cc0aa32934 100644 --- a/src/devices/machine/hdc92x4.cpp +++ b/src/devices/machine/hdc92x4.cpp @@ -468,7 +468,7 @@ const hdc92x4_device::cmddef hdc92x4_device::s_command[] = /* Standard constructor for the base class and the two variants */ -hdc92x4_device::hdc92x4_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) +hdc92x4_device::hdc92x4_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_out_intrq(*this), m_out_dmarq(*this), @@ -480,13 +480,13 @@ hdc92x4_device::hdc92x4_device(const machine_config &mconfig, device_type type, { } -hdc9224_device::hdc9224_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hdc9224_device::hdc9224_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hdc92x4_device(mconfig, HDC9224, "SMC HDC9224 Universal Disk Controller", tag, owner, clock, "hdc9224", __FILE__) { m_is_hdc9234 = false; } -hdc9234_device::hdc9234_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hdc9234_device::hdc9234_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hdc92x4_device(mconfig, HDC9234, "SMC HDC9234 Universal Disk Controller", tag, owner, clock, "hdc9234", __FILE__) { m_is_hdc9234 = true; @@ -496,7 +496,7 @@ hdc9234_device::hdc9234_device(const machine_config &mconfig, const char *tag, d /* Set or reset some bits. */ -void hdc92x4_device::set_bits(UINT8& byte, int mask, bool set) +void hdc92x4_device::set_bits(uint8_t& byte, int mask, bool set) { if (set) byte |= mask; else byte &= ~mask; @@ -628,7 +628,7 @@ bool hdc92x4_device::bad_sector() return (m_selected_drive_type != TYPE_AT) && ((m_register_r[CURRENT_HEAD] & 0x80)!=0); } -UINT8 hdc92x4_device::current_command() +uint8_t hdc92x4_device::current_command() { return m_register_w[COMMAND]; } @@ -1565,7 +1565,7 @@ void hdc92x4_device::tape_backup() */ void hdc92x4_device::poll_drives() { - UINT8 drivebit; + uint8_t drivebit; if (m_substate == UNDEF) { logerror("POLL DRIVES command %02x\n", current_command()); @@ -2947,7 +2947,7 @@ void hdc92x4_device::live_run_until(attotime limit) { m_out_dip(ASSERT_LINE); m_live_state.byte_counter--; - UINT8 headbyte = m_in_dma(0, 0xff); + uint8_t headbyte = m_in_dma(0, 0xff); write_on_track(encode(headbyte), 1, (m_live_state.byte_counter>0)? WRITE_HEADER : WRITE_HEADER_CRC); @@ -2968,7 +2968,7 @@ void hdc92x4_device::live_run_until(attotime limit) case WRITE_HEADER_CRC: if (m_live_state.byte_counter > 0) { - UINT8 crct = (m_live_state.crc >> 8) & 0xff; + uint8_t crct = (m_live_state.crc >> 8) & 0xff; if (TRACE_WRITE && TRACE_DETAIL) logerror("Write CRC byte %02x\n", crct); m_live_state.byte_counter--; write_on_track(encode(crct), 1, WRITE_HEADER_CRC); @@ -3694,7 +3694,7 @@ void hdc92x4_device::live_run_hd_until(attotime limit) { m_out_dip(ASSERT_LINE); m_live_state.byte_counter--; - UINT8 headbyte = m_in_dma(0, 0xff); + uint8_t headbyte = m_in_dma(0, 0xff); if (TRACE_HEADER) logerror("%02x\n", headbyte); write_on_track(encode_hd(headbyte), 1, (m_live_state.byte_counter>0)? WRITE_HEADER : WRITE_HEADER_CRC); @@ -3711,7 +3711,7 @@ void hdc92x4_device::live_run_hd_until(attotime limit) case WRITE_HEADER_CRC: if (m_live_state.byte_counter > 0) { - UINT8 crct = (m_live_state.crc >> 8) & 0xff; + uint8_t crct = (m_live_state.crc >> 8) & 0xff; if (TRACE_HEADER) logerror("%02x\n", crct); m_live_state.byte_counter--; write_on_track(encode_hd(crct), 1, WRITE_HEADER_CRC); @@ -3833,7 +3833,7 @@ void hdc92x4_device::live_abort() comprised by WRITE_TRACK_(NEXT_)BYTE Arguments: byte to be written, number, state on return */ -void hdc92x4_device::write_on_track(UINT16 encoded, int repeat, int next_state) +void hdc92x4_device::write_on_track(uint16_t encoded, int repeat, int next_state) { m_live_state.repeat = repeat; m_live_state.state = WRITE_TRACK_BYTE; @@ -3854,7 +3854,7 @@ void hdc92x4_device::skip_on_track(int repeat, int next_state) m_live_state.return_state = next_state; } -UINT8 hdc92x4_device::get_data_from_encoding(UINT16 raw) +uint8_t hdc92x4_device::get_data_from_encoding(uint16_t raw) { unsigned int value = 0; @@ -3952,10 +3952,10 @@ bool hdc92x4_device::write_one_bit(const attotime &limit) return false; } -UINT16 hdc92x4_device::encode(UINT8 byte) +uint16_t hdc92x4_device::encode(uint8_t byte) { - UINT16 raw; - UINT8 check_pos; + uint16_t raw; + uint8_t check_pos; bool last_bit_set; check_pos = 0x80; @@ -4003,7 +4003,7 @@ void hdc92x4_device::encode_again() encode_raw(m_live_state.shift_reg_save); } -void hdc92x4_device::encode_raw(UINT16 raw) +void hdc92x4_device::encode_raw(uint16_t raw) { m_live_state.bit_counter = 16; m_live_state.shift_reg = m_live_state.shift_reg_save = raw; @@ -4060,7 +4060,7 @@ void hdc92x4_device::checkpoint() */ bool hdc92x4_device::read_from_mfmhd(const attotime &limit) { - UINT16 data = 0; + uint16_t data = 0; bool offlimit = false; if (m_harddisk != nullptr) @@ -4098,7 +4098,7 @@ bool hdc92x4_device::read_from_mfmhd(const attotime &limit) } else { - UINT16 separated = data; + uint16_t separated = data; m_live_state.shift_reg = data; if (m_hd_encoding == MFM_BYTE) @@ -4137,7 +4137,7 @@ bool hdc92x4_device::read_from_mfmhd(const attotime &limit) */ bool hdc92x4_device::write_to_mfmhd(const attotime &limit) { - UINT16 data; + uint16_t data; int count; bool offlimit = false; @@ -4183,10 +4183,10 @@ bool hdc92x4_device::write_to_mfmhd(const attotime &limit) return false; } -UINT16 hdc92x4_device::encode_hd(UINT8 byte) +uint16_t hdc92x4_device::encode_hd(uint8_t byte) { - UINT16 cells; - UINT8 check_pos; + uint16_t cells; + uint8_t check_pos; bool last_bit_set; check_pos = 0x80; @@ -4227,9 +4227,9 @@ UINT16 hdc92x4_device::encode_hd(UINT8 byte) return cells; } -UINT16 hdc92x4_device::encode_a1_hd() +uint16_t hdc92x4_device::encode_a1_hd() { - UINT16 cells = 0; + uint16_t cells = 0; switch (m_hd_encoding) { @@ -4260,7 +4260,7 @@ UINT16 hdc92x4_device::encode_a1_hd() */ READ8_MEMBER( hdc92x4_device::read ) { - UINT8 reply; + uint8_t reply; if ((offset & 1) == 0) { // Data register @@ -4491,7 +4491,7 @@ void hdc92x4_device::set_command_done() Read the drive status over the auxbus (as said, let the controller board push the values into the controller) */ -void hdc92x4_device::auxbus_in(UINT8 data) +void hdc92x4_device::auxbus_in(uint8_t data) { // Kill unwanted input via auxbus until we are initialized. if (!m_initialized) @@ -4653,7 +4653,7 @@ void hdc92x4_device::auxbus_out() } } -void hdc92x4_device::dma_address_out(UINT8 addrub, UINT8 addrhb, UINT8 addrlb) +void hdc92x4_device::dma_address_out(uint8_t addrub, uint8_t addrhb, uint8_t addrlb) { if (TRACE_DMA) logerror("Setting DMA address %06x\n", (addrub<<16 | addrhb<<8 | addrlb)&0xffffff); m_out_auxbus((offs_t)HDC_OUTPUT_DMA_ADDR, addrub); diff --git a/src/devices/machine/hdc92x4.h b/src/devices/machine/hdc92x4.h index ab7011c5ec7..ae3601d5846 100644 --- a/src/devices/machine/hdc92x4.h +++ b/src/devices/machine/hdc92x4.h @@ -79,7 +79,7 @@ enum class hdc92x4_device : public device_t { public: - hdc92x4_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); + hdc92x4_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); // Accesors from the CPU side DECLARE_READ8_MEMBER( read ); @@ -98,7 +98,7 @@ public: // auxbus_in is intended to read events from the drives // In the real chip the status is polled; to avoid unnecessary load // we implement it as a push call - void auxbus_in( UINT8 data ); + void auxbus_in( uint8_t data ); // We pretend that the data separator is part of this controller. It is // in fact a separate circuit. The clock divider must be properly set @@ -131,8 +131,8 @@ protected: int m_register_pointer; // Read and write registers - UINT8 m_register_w[12]; - UINT8 m_register_r[15]; + uint8_t m_register_w[12]; + uint8_t m_register_r[15]; // Interrupt management (outgoing INT pin) void set_interrupt(line_state intr); @@ -144,19 +144,19 @@ protected: mfm_harddisk_device* m_harddisk; // internal register OUTPUT1 - UINT8 m_output1, m_output1_old; + uint8_t m_output1, m_output1_old; // internal register OUTPUT2 - UINT8 m_output2, m_output2_old; + uint8_t m_output2, m_output2_old; // Write the output registers to the latches void auxbus_out(); // Write the DMA address to the external latches - void dma_address_out(UINT8 addrub, UINT8 addrhb, UINT8 addrlb); + void dma_address_out(uint8_t addrub, uint8_t addrhb, uint8_t addrlb); // Intermediate storage for register - UINT8 m_regvalue; + uint8_t m_regvalue; // Drive type that has been selected in drive_select int m_selected_drive_type; @@ -198,7 +198,7 @@ protected: std::string ttsn(); // Utility routine to set or reset bits - void set_bits(UINT8& byte, int mask, bool set); + void set_bits(uint8_t& byte, int mask, bool set); // Event handling line_state m_line_level; @@ -213,16 +213,16 @@ protected: struct live_info { attotime time; - UINT16 shift_reg; - UINT16 shift_reg_save; - UINT16 crc; + uint16_t shift_reg; + uint16_t shift_reg_save; + uint16_t crc; int bit_counter; int bit_count_total; // used for timeout handling int byte_counter; bool data_separator_phase; bool last_data_bit; - UINT8 clock_reg; - UINT8 data_reg; + uint8_t clock_reg; + uint8_t data_reg; int state; int next_state; int repeat; // for formatting @@ -258,7 +258,7 @@ protected: bool found_mark(int state); // Delivers the data bits from the given encoding - UINT8 get_data_from_encoding(UINT16 raw); + uint8_t get_data_from_encoding(uint16_t raw); // ============================================== // PLL functions and interface to floppy and harddisk @@ -268,7 +268,7 @@ protected: fdc_pll_t m_pll, m_checkpoint_pll; // Clock divider value - UINT8 m_clock_divider; + uint8_t m_clock_divider; // MFM HD encoding type mfmhd_enc_t m_hd_encoding; @@ -278,14 +278,14 @@ protected: // Puts the word into the shift register directly. Changes the m_live_state members // shift_reg, and last_data_bit - void encode_raw(UINT16 word); + void encode_raw(uint16_t word); // Encodes a byte in FM or MFM. Called by encode_byte. - UINT16 encode(UINT8 byte); + uint16_t encode(uint8_t byte); // Encodes a byte in FM or MFM. Called by encode_byte. - UINT16 encode_hd(UINT8 byte); - UINT16 encode_a1_hd(); + uint16_t encode_hd(uint8_t byte); + uint16_t encode_a1_hd(); // Encode the latest byte again void encode_again(); @@ -297,7 +297,7 @@ protected: bool write_one_bit(const attotime &limit); // Writes to the current position on the track - void write_on_track(UINT16 raw, int count, int next_state); + void write_on_track(uint16_t raw, int count, int next_state); // Skips bytes on the track void skip_on_track(int count, int next_state); @@ -318,8 +318,8 @@ protected: typedef struct { - UINT8 baseval; - UINT8 mask; + uint8_t baseval; + uint8_t mask; cmdfunc command; } cmddef; @@ -436,7 +436,7 @@ protected: int current_cylinder(); // Delivers the current command - UINT8 current_command(); + uint8_t current_command(); // Step time (minus pulse width) virtual int step_time() =0; @@ -490,7 +490,7 @@ protected: class hdc9224_device : public hdc92x4_device { public: - hdc9224_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hdc9224_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: int step_time() override; @@ -500,7 +500,7 @@ protected: class hdc9234_device : public hdc92x4_device { public: - hdc9234_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hdc9234_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: int step_time() override; diff --git a/src/devices/machine/hp_taco.cpp b/src/devices/machine/hp_taco.cpp index 62f1924a4ea..0f427765875 100644 --- a/src/devices/machine/hp_taco.cpp +++ b/src/devices/machine/hp_taco.cpp @@ -280,7 +280,7 @@ static const hp_taco_device::tape_pos_t tape_holes[] = { const device_type HP_TACO = &device_creator; // Constructors -hp_taco_device::hp_taco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +hp_taco_device::hp_taco_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__), device_image_interface(mconfig , *this), m_irq_handler(*this), @@ -291,7 +291,7 @@ hp_taco_device::hp_taco_device(const machine_config &mconfig, device_type type, clear_state(); } -hp_taco_device::hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hp_taco_device::hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HP_TACO, "HP TACO", tag, owner, clock, "TACO", __FILE__), device_image_interface(mconfig , *this), m_irq_handler(*this), @@ -336,7 +336,7 @@ WRITE16_MEMBER(hp_taco_device::reg_w) READ16_MEMBER(hp_taco_device::reg_r) { - UINT16 res = 0; + uint16_t res = 0; // Any I/O activity clears IRQ irq_w(false); @@ -671,7 +671,7 @@ void hp_taco_device::update_tach_reg(void) tape_pos_t pos = current_tape_pos(); tape_pos_t pos_int = pos / TAPE_POS_FRACT; tape_pos_t ref_int = m_tach_reg_ref / TAPE_POS_FRACT; - UINT16 reg_value = (UINT16)(abs(pos_int - ref_int) + m_tach_reg); + uint16_t reg_value = (uint16_t)(abs(pos_int - ref_int) + m_tach_reg); LOG_0(("Tach = %04x @ pos = %d, ref_pos = %d\n" , reg_value , pos , m_tach_reg_ref)); @@ -741,11 +741,11 @@ attotime hp_taco_device::time_to_stopping_pos(void) const return time_to_distance(m_tape_fast ? FAST_BRAKE_DIST : SLOW_BRAKE_DIST); } -bool hp_taco_device::start_tape_cmd(UINT16 cmd_reg , UINT16 must_be_1 , UINT16 must_be_0) +bool hp_taco_device::start_tape_cmd(uint16_t cmd_reg , uint16_t must_be_1 , uint16_t must_be_0) { m_cmd_reg = cmd_reg; - UINT16 to_be_tested = (m_cmd_reg & CMD_REG_MASK) | (m_status_reg & STATUS_REG_MASK); + uint16_t to_be_tested = (m_cmd_reg & CMD_REG_MASK) | (m_status_reg & STATUS_REG_MASK); // Bits in STATUS_ERR_MASK must always be 0 must_be_0 |= STATUS_ERR_MASK; @@ -1054,8 +1054,8 @@ void hp_taco_device::clear_tape(void) void hp_taco_device::dump_sequence(tape_track_t::const_iterator it_start , unsigned n_words) { if (n_words) { - UINT32 tmp32; - UINT16 tmp16; + uint32_t tmp32; + uint16_t tmp16; tmp32 = n_words; fwrite(&tmp32 , sizeof(tmp32)); @@ -1072,7 +1072,7 @@ void hp_taco_device::dump_sequence(tape_track_t::const_iterator it_start , unsig void hp_taco_device::save_tape(void) { - UINT32 tmp32; + uint32_t tmp32; fseek(0, SEEK_SET); @@ -1094,14 +1094,14 @@ void hp_taco_device::save_tape(void) } dump_sequence(it_start , n_words); // End of track - tmp32 = (UINT32)-1; + tmp32 = (uint32_t)-1; fwrite(&tmp32 , sizeof(tmp32)); } } bool hp_taco_device::load_track(tape_track_t& track) { - UINT32 tmp32; + uint32_t tmp32; track.clear(); @@ -1110,7 +1110,7 @@ bool hp_taco_device::load_track(tape_track_t& track) return false; } - if (tmp32 == (UINT32)-1) { + if (tmp32 == (uint32_t)-1) { return true; } @@ -1123,7 +1123,7 @@ bool hp_taco_device::load_track(tape_track_t& track) tape_pos_t pos = (tape_pos_t)tmp32; for (unsigned i = 0; i < n_words; i++) { - UINT16 tmp16; + uint16_t tmp16; if (fread(&tmp16 , sizeof(tmp16)) != sizeof(tmp16)) { return false; @@ -1137,7 +1137,7 @@ bool hp_taco_device::load_track(tape_track_t& track) bool hp_taco_device::load_tape(void) { - UINT32 magic; + uint32_t magic; if (fread(&magic , sizeof(magic)) != sizeof(magic) || magic != FILE_MAGIC) { @@ -1536,7 +1536,7 @@ void hp_taco_device::cmd_fsm(void) } } -void hp_taco_device::start_cmd_exec(UINT16 new_cmd_reg) +void hp_taco_device::start_cmd_exec(uint16_t new_cmd_reg) { LOG_0(("New cmd %02x @ %g cmd %02x st %d\n" , CMD_CODE(new_cmd_reg) , machine().time().as_double() , CMD_CODE(m_cmd_reg) , m_cmd_state)); diff --git a/src/devices/machine/hp_taco.h b/src/devices/machine/hp_taco.h index 49cfeacd141..6bd66c1b4e5 100644 --- a/src/devices/machine/hp_taco.h +++ b/src/devices/machine/hp_taco.h @@ -27,8 +27,8 @@ class hp_taco_device : public device_t , { public: // construction/destruction - hp_taco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); - hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hp_taco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); + hp_taco_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); } @@ -57,10 +57,10 @@ public: virtual const char *file_extensions() const override; // Tape position, 1 unit = 1 inch / (968 * 1024) - typedef INT32 tape_pos_t; + typedef int32_t tape_pos_t; // Words stored on tape - typedef UINT16 tape_word_t; + typedef uint16_t tape_word_t; protected: // device-level overrides @@ -79,16 +79,16 @@ private: devcb_write_line m_sts_handler; // Registers - UINT16 m_data_reg; + uint16_t m_data_reg; bool m_data_reg_full; - UINT16 m_cmd_reg; - UINT16 m_status_reg; - UINT16 m_tach_reg; + uint16_t m_cmd_reg; + uint16_t m_status_reg; + uint16_t m_tach_reg; tape_pos_t m_tach_reg_ref; bool m_tach_reg_frozen; - UINT16 m_checksum_reg; + uint16_t m_checksum_reg; bool m_clear_checksum_reg; - UINT16 m_timing_reg; + uint16_t m_timing_reg; // State bool m_irq; @@ -125,7 +125,7 @@ private: // Reading & writing bool m_tape_wr; tape_pos_t m_rw_pos; - UINT16 m_next_word; + uint16_t m_next_word; tape_track_t::iterator m_rd_it; bool m_rd_it_valid; @@ -153,7 +153,7 @@ private: attotime time_to_distance(tape_pos_t distance) const; attotime time_to_target(tape_pos_t target) const; attotime time_to_stopping_pos(void) const; - bool start_tape_cmd(UINT16 cmd_reg , UINT16 must_be_1 , UINT16 must_be_0); + bool start_tape_cmd(uint16_t cmd_reg , uint16_t must_be_1 , uint16_t must_be_0); void stop_tape(void); tape_track_t& current_track(void); static tape_pos_t word_length(tape_word_t w); @@ -181,7 +181,7 @@ private: void terminate_cmd_now(void); void set_data_timeout(bool long_timeout); void cmd_fsm(void); - void start_cmd_exec(UINT16 new_cmd_reg); + void start_cmd_exec(uint16_t new_cmd_reg); image_init_result internal_load(bool is_create); }; diff --git a/src/devices/machine/i2cmem.cpp b/src/devices/machine/i2cmem.cpp index bac06e66420..02aa54d2771 100644 --- a/src/devices/machine/i2cmem.cpp +++ b/src/devices/machine/i2cmem.cpp @@ -69,7 +69,7 @@ const device_type I2CMEM = &device_creator; // i2cmem_device - constructor //------------------------------------------------- -i2cmem_device::i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +i2cmem_device::i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t(mconfig, I2CMEM, "I2C Memory", tag, owner, clock, "i2cmem", __FILE__), device_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -98,7 +98,7 @@ i2cmem_device::i2cmem_device( const machine_config &mconfig, const char *tag, de void i2cmem_device::device_start() { - m_data = std::make_unique(m_data_size); + m_data = std::make_unique(m_data_size); m_page.resize( m_page_size ); save_item( NAME(m_scl) ); diff --git a/src/devices/machine/i2cmem.h b/src/devices/machine/i2cmem.h index 797df97d70a..e739e7c963f 100644 --- a/src/devices/machine/i2cmem.h +++ b/src/devices/machine/i2cmem.h @@ -89,7 +89,7 @@ class i2cmem_device : { public: // construction/destruction - i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ); + i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); static void set_address(device_t &device, int address) { downcast(device).m_slave_address = address; } static void set_page_size(device_t &device, int page_size) { downcast(device).m_page_size = page_size; } @@ -126,7 +126,7 @@ protected: optional_memory_region m_region; // internal state - std::unique_ptr m_data; + std::unique_ptr m_data; int m_slave_address; int m_page_size; int m_data_size; @@ -142,7 +142,7 @@ protected: int m_shift; int m_devsel; int m_byteaddr; - std::vector m_page; + std::vector m_page; int m_page_offset; }; diff --git a/src/devices/machine/i6300esb.cpp b/src/devices/machine/i6300esb.cpp index 649c437befd..012ed9d6598 100644 --- a/src/devices/machine/i6300esb.cpp +++ b/src/devices/machine/i6300esb.cpp @@ -8,7 +8,7 @@ const device_type I6300ESB_LPC = &device_creator; DEVICE_ADDRESS_MAP_START(map, 32, i6300esb_watchdog_device) ADDRESS_MAP_END -i6300esb_watchdog_device::i6300esb_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i6300esb_watchdog_device::i6300esb_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, I6300ESB_WATCHDOG, "i6300ESB southbridge watchdog", tag, owner, clock, "i6300esb_watchdog", __FILE__) { } @@ -86,7 +86,7 @@ DEVICE_ADDRESS_MAP_START(internal_io_map, 32, i6300esb_lpc_device) ADDRESS_MAP_END -i6300esb_lpc_device::i6300esb_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i6300esb_lpc_device::i6300esb_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, I6300ESB_LPC, "i6300ESB southbridge ISA/LPC bridge", tag, owner, clock, "i6300esb_lpc", __FILE__), acpi(*this, "acpi"), rtc (*this, "rtc"), @@ -662,15 +662,15 @@ WRITE8_MEMBER (i6300esb_lpc_device::nop_w) { } -void i6300esb_lpc_device::map_bios(address_space *memory_space, UINT32 start, UINT32 end, int idsel) +void i6300esb_lpc_device::map_bios(address_space *memory_space, uint32_t start, uint32_t end, int idsel) { // Ignore idsel, a16 inversion for now - UINT32 mask = m_region->bytes() - 1; + uint32_t mask = m_region->bytes() - 1; memory_space->install_rom(start, end, m_region->base() + (start & mask)); } -void i6300esb_lpc_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 i6300esb_lpc_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) { if(fwh_dec_en1 & 0x80) { map_bios(memory_space, 0xfff80000, 0xffffffff, 7); @@ -713,7 +713,7 @@ void i6300esb_lpc_device::map_extra(UINT64 memory_window_start, UINT64 memory_wi if(gpio_cntl & 0x10) logerror("%s: Warning: gpio range enabled at %04x-%04x\n", tag(), gpio_base, gpio_base+63); - UINT32 hpet = 0xfed00000 + ((gen_cntl & 0x00018000) >> 3); + uint32_t hpet = 0xfed00000 + ((gen_cntl & 0x00018000) >> 3); logerror("%s: Warning: hpet at %08x-%08x\n", tag(), hpet, hpet+0x3ff); if(lpc_en & 0x1000) @@ -728,26 +728,26 @@ void i6300esb_lpc_device::map_extra(UINT64 memory_window_start, UINT64 memory_wi logerror("%s: Warning: gameport at 200-207\n", tag()); if(lpc_en & 0x0008) { - UINT16 fdc = lpc_if_fdd_lpt_range & 0x10 ? 0x370 : 0x3f0; + uint16_t fdc = lpc_if_fdd_lpt_range & 0x10 ? 0x370 : 0x3f0; logerror("%s: Warning: floppy at %04x-%04x\n", tag(), fdc, fdc+7); } if(lpc_en & 0x0004) { - static const UINT16 lpt_pos[4] = { 0x378, 0x278, 0x3bc, 0x000 }; - UINT16 lpt = lpt_pos[lpc_if_fdd_lpt_range & 3]; + static const uint16_t lpt_pos[4] = { 0x378, 0x278, 0x3bc, 0x000 }; + uint16_t lpt = lpt_pos[lpc_if_fdd_lpt_range & 3]; if(lpt) logerror("%s: Warning: lpt at %04x-%04x %04x-%04x\n", tag(), lpt, lpt+7, lpt+0x400, lpt+0x407); } - static const UINT16 com_pos[8] = { 0x3f8, 0x2f8, 0x220, 0x228, 0x238, 0x2e8, 0x338, 0x3e8 }; + static const uint16_t com_pos[8] = { 0x3f8, 0x2f8, 0x220, 0x228, 0x238, 0x2e8, 0x338, 0x3e8 }; if(lpc_en & 0x0002) { - UINT16 comb = com_pos[(lpc_if_com_range >> 4) & 7]; + uint16_t comb = com_pos[(lpc_if_com_range >> 4) & 7]; logerror("%s: Warning: comb at %04x-%04x\n", tag(), comb, comb+7); } if(lpc_en & 0x0001) { - UINT16 coma = com_pos[lpc_if_com_range & 7]; + uint16_t coma = com_pos[lpc_if_com_range & 7]; logerror("%s: Warning: coma at %04x-%04x\n", tag(), coma, coma+7); } diff --git a/src/devices/machine/i6300esb.h b/src/devices/machine/i6300esb.h index e3f216123bc..0472f8e75e3 100644 --- a/src/devices/machine/i6300esb.h +++ b/src/devices/machine/i6300esb.h @@ -18,11 +18,11 @@ class i6300esb_lpc_device : public pci_device { public: - i6300esb_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i6300esb_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void reset_all_mappings() 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; virtual DECLARE_ADDRESS_MAP(config_map, 32) override; @@ -39,13 +39,13 @@ private: DECLARE_ADDRESS_MAP(internal_io_map, 32); - UINT32 pmbase, gpio_base, fwh_sel1, gen_cntl, etr1, rst_cnt2, gpi_rout; - UINT16 bios_cntl, pci_dma_cfg, gen1_dec, lpc_en, gen2_dec, fwh_sel2, func_dis, gen_pmcon_1; - UINT16 mon_trp_rng[4], mon_trp_msk; - UINT8 pirq_rout[8]; - UINT8 acpi_cntl, tco_cntl, gpio_cntl, serirq_cntl, d31_err_cfg, d31_err_sts, gen_sta, back_cntl, rtc_conf; - UINT8 lpc_if_com_range, lpc_if_fdd_lpt_range, lpc_if_sound_range, fwh_dec_en1, fwh_dec_en2, siu_config_port; - UINT8 gen_pmcon_2, gen_pmcon_3, apm_cnt, apm_sts, mon_fwd_en, nmi_sc; + uint32_t pmbase, gpio_base, fwh_sel1, gen_cntl, etr1, rst_cnt2, gpi_rout; + uint16_t bios_cntl, pci_dma_cfg, gen1_dec, lpc_en, gen2_dec, fwh_sel2, func_dis, gen_pmcon_1; + uint16_t mon_trp_rng[4], mon_trp_msk; + uint8_t pirq_rout[8]; + uint8_t acpi_cntl, tco_cntl, gpio_cntl, serirq_cntl, d31_err_cfg, d31_err_sts, gen_sta, back_cntl, rtc_conf; + uint8_t lpc_if_com_range, lpc_if_fdd_lpt_range, lpc_if_sound_range, fwh_dec_en1, fwh_dec_en2, siu_config_port; + uint8_t gen_pmcon_2, gen_pmcon_3, apm_cnt, apm_sts, mon_fwd_en, nmi_sc; int siu_config_state; DECLARE_WRITE8_MEMBER (nop_w); @@ -140,12 +140,12 @@ private: DECLARE_READ8_MEMBER (nmi_sc_r); // 61 DECLARE_WRITE8_MEMBER (nmi_sc_w); - void map_bios(address_space *memory_space, UINT32 start, UINT32 end, int idsel); + void map_bios(address_space *memory_space, uint32_t start, uint32_t end, int idsel); }; class i6300esb_watchdog_device : public pci_device { public: - i6300esb_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i6300esb_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/machine/i80130.cpp b/src/devices/machine/i80130.cpp index 83c840fa30d..3d196195598 100644 --- a/src/devices/machine/i80130.cpp +++ b/src/devices/machine/i80130.cpp @@ -30,7 +30,7 @@ ADDRESS_MAP_END READ16_MEMBER( i80130_device::io_r ) { - UINT16 data = 0; + uint16_t data = 0; switch (offset) { @@ -130,7 +130,7 @@ machine_config_constructor i80130_device::device_mconfig_additions() const // i80130_device - constructor //------------------------------------------------- -i80130_device::i80130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i80130_device::i80130_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I80130, "I80130", tag, owner, clock, "i80130", __FILE__), m_pic(*this, "pic"), m_pit(*this, "pit"), diff --git a/src/devices/machine/i80130.h b/src/devices/machine/i80130.h index d5ef5800011..c7f035e67fc 100644 --- a/src/devices/machine/i80130.h +++ b/src/devices/machine/i80130.h @@ -51,7 +51,7 @@ class i80130_device : public device_t { public: // construction/destruction - i80130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i80130_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); } template static devcb_base &set_ack_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_ack.set_callback(object); } @@ -67,7 +67,7 @@ public: virtual const tiny_rom_entry *device_rom_region() const override; virtual machine_config_constructor device_mconfig_additions() const override; - UINT8 inta_r() { return m_pic->acknowledge(); } + uint8_t inta_r() { return m_pic->acknowledge(); } DECLARE_WRITE_LINE_MEMBER( ir0_w ) { m_pic->ir0_w(state); } DECLARE_WRITE_LINE_MEMBER( ir1_w ) { m_pic->ir1_w(state); } diff --git a/src/devices/machine/i8155.cpp b/src/devices/machine/i8155.cpp index b3d4098398a..7e0d80aaf03 100644 --- a/src/devices/machine/i8155.cpp +++ b/src/devices/machine/i8155.cpp @@ -108,7 +108,7 @@ ADDRESS_MAP_END // INLINE HELPERS //************************************************************************** -inline UINT8 i8155_device::get_timer_mode() +inline uint8_t i8155_device::get_timer_mode() { return (m_count_length >> 8) & TIMER_MODE_MASK; } @@ -154,9 +154,9 @@ inline int i8155_device::get_port_mode(int port) return mode; } -inline UINT8 i8155_device::read_port(int port) +inline uint8_t i8155_device::read_port(int port) { - UINT8 data = 0; + uint8_t data = 0; switch (get_port_mode(port)) { @@ -177,7 +177,7 @@ inline UINT8 i8155_device::read_port(int port) return data; } -inline void i8155_device::write_port(int port, UINT8 data) +inline void i8155_device::write_port(int port, uint8_t data) { switch (get_port_mode(port)) { @@ -202,7 +202,7 @@ inline void i8155_device::write_port(int port, UINT8 data) // i8155_device - constructor //------------------------------------------------- -i8155_device::i8155_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8155_device::i8155_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8155, "8155 RIOT", tag, owner, clock, "i8155", __FILE__), device_memory_interface(mconfig, *this), m_in_pa_cb(*this), @@ -352,7 +352,7 @@ const address_space_config *i8155_device::memory_space_config(address_spacenum s READ8_MEMBER( i8155_device::io_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0x07) { @@ -392,7 +392,7 @@ READ8_MEMBER( i8155_device::io_r ) // register_w - register write //------------------------------------------------- -void i8155_device::register_w(int offset, UINT8 data) +void i8155_device::register_w(int offset, uint8_t data) { switch (offset & 0x07) { @@ -557,7 +557,7 @@ WRITE8_MEMBER( i8155_device::ale_w ) READ8_MEMBER( i8155_device::read ) { - UINT8 data = 0; + uint8_t data = 0; switch (m_io_m) { diff --git a/src/devices/machine/i8155.h b/src/devices/machine/i8155.h index 085ffe15196..5fe8cf41715 100644 --- a/src/devices/machine/i8155.h +++ b/src/devices/machine/i8155.h @@ -75,7 +75,7 @@ class i8155_device : public device_t, { public: // construction/destruction - i8155_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8155_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_in_pa_callback(device_t &device, _Object object) { return downcast(device).m_in_pa_cb.set_callback(object); } template static devcb_base &set_in_pb_callback(device_t &device, _Object object) { return downcast(device).m_in_pb_cb.set_callback(object); } @@ -103,14 +103,14 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; - inline UINT8 get_timer_mode(); + inline uint8_t get_timer_mode(); inline void timer_output(); inline void pulse_timer_output(); inline int get_port_mode(int port); - inline UINT8 read_port(int port); - inline void write_port(int port, UINT8 data); + inline uint8_t read_port(int port); + inline void write_port(int port, uint8_t data); - void register_w(int offset, UINT8 data); + void register_w(int offset, uint8_t data); private: devcb_read8 m_in_pa_cb; @@ -126,16 +126,16 @@ private: // CPU interface int m_io_m; // I/O or memory select - UINT8 m_ad; // address + uint8_t m_ad; // address // registers - UINT8 m_command; // command register - UINT8 m_status; // status register - UINT8 m_output[3]; // output latches + uint8_t m_command; // command register + uint8_t m_status; // status register + uint8_t m_output[3]; // output latches // counter - UINT16 m_count_length; // count length register - UINT16 m_counter; // counter register + uint16_t m_count_length; // count length register + uint16_t m_counter; // counter register int m_to; // timer output // timers diff --git a/src/devices/machine/i8212.cpp b/src/devices/machine/i8212.cpp index 0ece5f05c1c..a9b12e5937c 100644 --- a/src/devices/machine/i8212.cpp +++ b/src/devices/machine/i8212.cpp @@ -30,7 +30,7 @@ const device_type I8212 = &device_creator; // i8212_device - constructor //------------------------------------------------- -i8212_device::i8212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +i8212_device::i8212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8212, "I8212", tag, owner, clock, "i8212", __FILE__), m_write_irq(*this), m_read_di(*this), diff --git a/src/devices/machine/i8212.h b/src/devices/machine/i8212.h index ea62ce9eefb..3ced6e05d6f 100644 --- a/src/devices/machine/i8212.h +++ b/src/devices/machine/i8212.h @@ -67,7 +67,7 @@ class i8212_device : public device_t { public: // construction/destruction - i8212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8212_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); } template static devcb_base &set_di_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_di.set_callback(object); } @@ -91,7 +91,7 @@ private: int m_md; // mode int m_stb; // strobe - UINT8 m_data; // data latch + uint8_t m_data; // data latch }; diff --git a/src/devices/machine/i8214.cpp b/src/devices/machine/i8214.cpp index 4a93504137e..4efeb83bf2a 100644 --- a/src/devices/machine/i8214.cpp +++ b/src/devices/machine/i8214.cpp @@ -86,7 +86,7 @@ void i8214_device::check_interrupt() // i8214_device - constructor //------------------------------------------------- -i8214_device::i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8214_device::i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8214, "I8214", tag, owner, clock, "i8214", __FILE__) , m_write_irq(*this) , m_write_enlg(*this) @@ -129,9 +129,9 @@ void i8214_device::device_start() // a_r - //------------------------------------------------- -UINT8 i8214_device::a_r() +uint8_t i8214_device::a_r() { - UINT8 a = m_a & 0x07; + uint8_t a = m_a & 0x07; if (LOG) logerror("I8214 '%s' A: %01x\n", tag(), a); @@ -143,7 +143,7 @@ UINT8 i8214_device::a_r() // b_w - //------------------------------------------------- -void i8214_device::b_w(UINT8 data) +void i8214_device::b_w(uint8_t data) { m_current_status = data & 0x07; diff --git a/src/devices/machine/i8214.h b/src/devices/machine/i8214.h index 60757d92cef..782a5a98934 100644 --- a/src/devices/machine/i8214.h +++ b/src/devices/machine/i8214.h @@ -52,7 +52,7 @@ class i8214_device : public device_t { public: // construction/destruction - i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8214_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); } template static devcb_base &set_enlg_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_enlg.set_callback(object); } @@ -61,8 +61,8 @@ public: DECLARE_WRITE_LINE_MEMBER( etlg_w ); DECLARE_WRITE_LINE_MEMBER( inte_w ); - UINT8 a_r(); - void b_w(UINT8 data); + uint8_t a_r(); + void b_w(uint8_t data); void r_w(int line, int state); protected: @@ -81,7 +81,7 @@ private: int m_int_dis; // interrupt (latch) disable flip-flop int m_a; // request level int m_current_status; - UINT8 m_r; // interrupt request latch + uint8_t m_r; // interrupt request latch int m_sgs; // status group select int m_etlg; // enable this level group }; diff --git a/src/devices/machine/i82371sb.cpp b/src/devices/machine/i82371sb.cpp index e1081dac406..eb3b6c0f57e 100644 --- a/src/devices/machine/i82371sb.cpp +++ b/src/devices/machine/i82371sb.cpp @@ -31,7 +31,7 @@ DEVICE_ADDRESS_MAP_START(internal_io_map, 32, i82371sb_isa_device) AM_RANGE(0x00ec, 0x00ef) AM_WRITE8 (nop_w, 0x0000ff00) // Non-existing, used for delays by the bios/os ADDRESS_MAP_END -i82371sb_isa_device::i82371sb_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i82371sb_isa_device::i82371sb_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, I82371SB_ISA, "i82371sb southbridge ISA bridge", tag, owner, clock, "i82371sb_isa", __FILE__), m_boot_state_hook(*this) { @@ -260,14 +260,14 @@ WRITE8_MEMBER(i82371sb_isa_device::cthtmr_w) -void i82371sb_isa_device::map_bios(address_space *memory_space, UINT32 start, UINT32 end) +void i82371sb_isa_device::map_bios(address_space *memory_space, uint32_t start, uint32_t end) { - UINT32 mask = m_region->bytes() - 1; + uint32_t mask = m_region->bytes() - 1; memory_space->install_rom(start, end, m_region->base() + (start & mask)); } -void i82371sb_isa_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 i82371sb_isa_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) { map_bios(memory_space, 0xfffe0000, 0xffffffff); map_bios(memory_space, 0x000e0000, 0x000fffff); @@ -315,7 +315,7 @@ void i82371sb_isa_device::map_extra(UINT64 memory_window_start, UINT64 memory_wi if(gpio_cntl & 0x10) logerror("%s: Warning: gpio range enabled at %04x-%04x\n", tag(), gpio_base, gpio_base+63); - UINT32 hpet = 0xfed00000 + ((gen_cntl & 0x00018000) >> 3); + uint32_t hpet = 0xfed00000 + ((gen_cntl & 0x00018000) >> 3); logerror("%s: Warning: hpet at %08x-%08x\n", tag(), hpet, hpet+0x3ff); if(lpc_en & 0x1000) @@ -330,26 +330,26 @@ void i82371sb_isa_device::map_extra(UINT64 memory_window_start, UINT64 memory_wi logerror("%s: Warning: gameport at 200-207\n", tag()); if(lpc_en & 0x0008) { - UINT16 fdc = lpc_if_fdd_lpt_range & 0x10 ? 0x370 : 0x3f0; + uint16_t fdc = lpc_if_fdd_lpt_range & 0x10 ? 0x370 : 0x3f0; logerror("%s: Warning: floppy at %04x-%04x\n", tag(), fdc, fdc+7); } if(lpc_en & 0x0004) { - static const UINT16 lpt_pos[4] = { 0x378, 0x278, 0x3bc, 0x000 }; - UINT16 lpt = lpt_pos[lpc_if_fdd_lpt_range & 3]; + static const uint16_t lpt_pos[4] = { 0x378, 0x278, 0x3bc, 0x000 }; + uint16_t lpt = lpt_pos[lpc_if_fdd_lpt_range & 3]; if(lpt) logerror("%s: Warning: lpt at %04x-%04x %04x-%04x\n", tag(), lpt, lpt+7, lpt+0x400, lpt+0x407); } - static const UINT16 com_pos[8] = { 0x3f8, 0x2f8, 0x220, 0x228, 0x238, 0x2e8, 0x338, 0x3e8 }; + static const uint16_t com_pos[8] = { 0x3f8, 0x2f8, 0x220, 0x228, 0x238, 0x2e8, 0x338, 0x3e8 }; if(lpc_en & 0x0002) { - UINT16 comb = com_pos[(lpc_if_com_range >> 4) & 7]; + uint16_t comb = com_pos[(lpc_if_com_range >> 4) & 7]; logerror("%s: Warning: comb at %04x-%04x\n", tag(), comb, comb+7); } if(lpc_en & 0x0001) { - UINT16 coma = com_pos[lpc_if_com_range & 7]; + uint16_t coma = com_pos[lpc_if_com_range & 7]; logerror("%s: Warning: coma at %04x-%04x\n", tag(), coma, coma+7); } diff --git a/src/devices/machine/i82371sb.h b/src/devices/machine/i82371sb.h index 35912f96561..16862728cc8 100644 --- a/src/devices/machine/i82371sb.h +++ b/src/devices/machine/i82371sb.h @@ -15,13 +15,13 @@ class i82371sb_isa_device : public pci_device { public: - i82371sb_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82371sb_isa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_boot_state_hook(device_t &device, _Object object) { return downcast(device).m_boot_state_hook.set_callback(object); } virtual void reset_all_mappings() 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; virtual DECLARE_ADDRESS_MAP(config_map, 32) override; DECLARE_ADDRESS_MAP(internal_io_map, 32); @@ -71,12 +71,12 @@ protected: private: devcb_write8 m_boot_state_hook; - UINT32 see; - UINT16 xbcs, mstat, pcsc, smien, smireq; - UINT8 iort, pirqrc[4], tom, mbirq0, mbdma[2], apicbase; - UINT8 dlc, smicntl, ftmr, ctlmtr, cthmtr; + uint32_t see; + uint16_t xbcs, mstat, pcsc, smien, smireq; + uint8_t iort, pirqrc[4], tom, mbirq0, mbdma[2], apicbase; + uint8_t dlc, smicntl, ftmr, ctlmtr, cthmtr; - void map_bios(address_space *memory_space, UINT32 start, UINT32 end); + void map_bios(address_space *memory_space, uint32_t start, uint32_t end); }; extern const device_type I82371SB_ISA; diff --git a/src/devices/machine/i8243.cpp b/src/devices/machine/i8243.cpp index f63159b5739..241888bb31a 100644 --- a/src/devices/machine/i8243.cpp +++ b/src/devices/machine/i8243.cpp @@ -22,7 +22,7 @@ const device_type I8243 = &device_creator; // i8243_device - constructor //------------------------------------------------- -i8243_device::i8243_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8243_device::i8243_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8243, "8243 I/O Expander", tag, owner, clock, "i8243", __FILE__), m_p2out(0), m_p2(0), m_opcode(0), m_prog(0), m_readhandler(*this), m_writehandler(*this) diff --git a/src/devices/machine/i8243.h b/src/devices/machine/i8243.h index 5157056491d..9cae49d0333 100644 --- a/src/devices/machine/i8243.h +++ b/src/devices/machine/i8243.h @@ -41,7 +41,7 @@ class i8243_device : public device_t { public: // construction/destruction - i8243_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8243_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_read_handler(device_t &device, _Object object) { return downcast(device).m_readhandler.set_callback(object); } @@ -61,11 +61,11 @@ protected: private: - UINT8 m_p[4]; /* 4 ports' worth of data */ - UINT8 m_p2out; /* port 2 bits that will be returned */ - UINT8 m_p2; /* most recent port 2 value */ - UINT8 m_opcode; /* latched opcode */ - UINT8 m_prog; /* previous PROG state */ + uint8_t m_p[4]; /* 4 ports' worth of data */ + uint8_t m_p2out; /* port 2 bits that will be returned */ + uint8_t m_p2; /* most recent port 2 value */ + uint8_t m_opcode; /* latched opcode */ + uint8_t m_prog; /* previous PROG state */ devcb_read8 m_readhandler; devcb_write8 m_writehandler; diff --git a/src/devices/machine/i82439hx.cpp b/src/devices/machine/i82439hx.cpp index 10a2d340fe6..ff3ff18c677 100644 --- a/src/devices/machine/i82439hx.cpp +++ b/src/devices/machine/i82439hx.cpp @@ -24,7 +24,7 @@ DEVICE_ADDRESS_MAP_START(config_map, 32, i82439hx_host_device) AM_INHERIT_FROM(pci_host_device::config_map) ADDRESS_MAP_END -i82439hx_host_device::i82439hx_host_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i82439hx_host_device::i82439hx_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_host_device(mconfig, I82439HX, "i82439hx northbridge", tag, owner, clock, "i82439hx", __FILE__) { } @@ -81,8 +81,8 @@ void i82439hx_host_device::device_reset() errsyn = 0x00; } -void i82439hx_host_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 i82439hx_host_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) { io_space->install_device(0, 0xffff, *static_cast(this), &pci_host_device::io_configuration_access_map); diff --git a/src/devices/machine/i82439hx.h b/src/devices/machine/i82439hx.h index 55b6e7bf18d..dd694bc6acc 100644 --- a/src/devices/machine/i82439hx.h +++ b/src/devices/machine/i82439hx.h @@ -14,7 +14,7 @@ class i82439hx_host_device : public pci_host_device { public: - i82439hx_host_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82439hx_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_cpu_tag(const char *tag); void set_ram_size(int ram_size); @@ -49,8 +49,8 @@ public: virtual void reset_all_mappings() 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; virtual DECLARE_ADDRESS_MAP(config_map, 32) override; @@ -62,11 +62,11 @@ private: const char *cpu_tag; int ram_size; cpu_device *cpu; - std::vector ram; + std::vector ram; - UINT8 pcon, cc, dramec, dramc, dramt; - UINT8 pam[7], drb[8]; - UINT8 drt, drat, smram, errcmd, errsts, errsyn; + uint8_t pcon, cc, dramec, dramc, dramt; + uint8_t pam[7], drb[8]; + uint8_t drt, drat, smram, errcmd, errsts, errsyn; }; extern const device_type I82439HX; diff --git a/src/devices/machine/i8251.cpp b/src/devices/machine/i8251.cpp index 7b0d272970d..2fc9ef798b6 100644 --- a/src/devices/machine/i8251.cpp +++ b/src/devices/machine/i8251.cpp @@ -37,7 +37,7 @@ const device_type V53_SCU = &device_creator; // i8251_device - constructor //------------------------------------------------- -i8251_device::i8251_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +i8251_device::i8251_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__), device_serial_interface(mconfig, *this), m_txd_handler(*this), @@ -55,7 +55,7 @@ i8251_device::i8251_device(const machine_config &mconfig, device_type type, cons { } -i8251_device::i8251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8251_device::i8251_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8251, "8251 USART", tag, owner, clock, "i8251", __FILE__), device_serial_interface(mconfig, *this), m_txd_handler(*this), @@ -73,7 +73,7 @@ i8251_device::i8251_device(const machine_config &mconfig, const char *tag, devic { } -v53_scu_device::v53_scu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v53_scu_device::v53_scu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8251_device(mconfig, V53_SCU, "V53 SCU", tag, owner, clock, "v53_scu") { } @@ -216,7 +216,7 @@ void i8251_device::transmit_clock() } /* if diserial has bits to send, make them so */ if (!is_transmit_register_empty()) { - UINT8 data = transmit_register_get_data_bit(); + uint8_t data = transmit_register_get_data_bit(); m_txd_handler(data); } @@ -637,7 +637,7 @@ WRITE8_MEMBER(i8251_device::control_w) READ8_MEMBER(i8251_device::status_r) { - UINT8 status = (m_dsr << 7) | m_status; + uint8_t status = (m_dsr << 7) | m_status; LOG(("status: %02x\n", status)); return status; @@ -681,7 +681,7 @@ WRITE8_MEMBER(i8251_device::data_w) bit of data has been received -------------------------------------------------*/ -void i8251_device::receive_character(UINT8 ch) +void i8251_device::receive_character(uint8_t ch) { m_rx_data = ch; diff --git a/src/devices/machine/i8251.h b/src/devices/machine/i8251.h index 7a2f7ec55fd..a556851beb7 100644 --- a/src/devices/machine/i8251.h +++ b/src/devices/machine/i8251.h @@ -42,8 +42,8 @@ class i8251_device : public device_t, { public: // construction/destruction - i8251_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); - i8251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8251_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname); + i8251_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_txd_handler(device_t &device, _Object object) { return downcast(device).m_txd_handler.set_callback(object); } @@ -68,7 +68,7 @@ public: DECLARE_WRITE_LINE_MEMBER( write_rxc ); /// TODO: REMOVE THIS - void receive_character(UINT8 ch); + void receive_character(uint8_t ch); /// TODO: this shouldn't be public enum @@ -114,18 +114,18 @@ private: devcb_write_line m_syndet_handler; /* flags controlling how i8251_control_w operates */ - UINT8 m_flags; + uint8_t m_flags; /* offset into sync_bytes used during sync byte transfer */ - UINT8 m_sync_byte_offset; + uint8_t m_sync_byte_offset; /* number of sync bytes written so far */ - UINT8 m_sync_byte_count; + uint8_t m_sync_byte_count; /* the sync bytes written */ - UINT8 m_sync_bytes[2]; + uint8_t m_sync_bytes[2]; /* status of i8251 */ - UINT8 m_status; - UINT8 m_command; + uint8_t m_status; + uint8_t m_command; /* mode byte - bit definitions depend on mode - e.g. synchronous, asynchronous */ - UINT8 m_mode_byte; + uint8_t m_mode_byte; int m_cts; int m_dsr; @@ -137,16 +137,16 @@ private: int m_br_factor; /* data being received */ - UINT8 m_rx_data; + uint8_t m_rx_data; /* tx buffer */ - UINT8 m_tx_data; + uint8_t m_tx_data; }; class v53_scu_device : public i8251_device { public: // construction/destruction - v53_scu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v53_scu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/machine/i82541.cpp b/src/devices/machine/i82541.cpp index 8e5a1467183..bbec58fe55d 100644 --- a/src/devices/machine/i82541.cpp +++ b/src/devices/machine/i82541.cpp @@ -13,7 +13,7 @@ ADDRESS_MAP_END DEVICE_ADDRESS_MAP_START(registers_io_map, 32, i82541_device) ADDRESS_MAP_END -i82541_device::i82541_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i82541_device::i82541_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, I82541, "I82541 ethernet controller", tag, owner, clock, "i82541", __FILE__) { } diff --git a/src/devices/machine/i82541.h b/src/devices/machine/i82541.h index 475a94dc2be..2f94b773f7e 100644 --- a/src/devices/machine/i82541.h +++ b/src/devices/machine/i82541.h @@ -12,7 +12,7 @@ class i82541_device : public pci_device { public: - i82541_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82541_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/machine/i8255.cpp b/src/devices/machine/i8255.cpp index 7e6a769f904..ff78e63ab01 100644 --- a/src/devices/machine/i8255.cpp +++ b/src/devices/machine/i8255.cpp @@ -257,7 +257,7 @@ inline int i8255_device::port_c_upper_mode() // i8255_device - constructor //------------------------------------------------- -i8255_device::i8255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8255_device::i8255_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8255, "8255 PPI", tag, owner, clock, "i8255", __FILE__), m_in_pa_cb(*this), m_in_pb_cb(*this), @@ -311,9 +311,9 @@ void i8255_device::device_reset() // read_mode0 - //------------------------------------------------- -UINT8 i8255_device::read_mode0(int port) +uint8_t i8255_device::read_mode0(int port) { - UINT8 data; + uint8_t data; if (port_mode(port) == MODE_OUTPUT) { @@ -334,9 +334,9 @@ UINT8 i8255_device::read_mode0(int port) // read_mode1 - //------------------------------------------------- -UINT8 i8255_device::read_mode1(int port) +uint8_t i8255_device::read_mode1(int port) { - UINT8 data; + uint8_t data; if (port_mode(port) == MODE_OUTPUT) { @@ -366,9 +366,9 @@ UINT8 i8255_device::read_mode1(int port) // read_mode2 - //------------------------------------------------- -UINT8 i8255_device::read_mode2() +uint8_t i8255_device::read_mode2() { - UINT8 data; + uint8_t data; // read data from input latch data = m_input[PORT_A]; @@ -390,11 +390,11 @@ UINT8 i8255_device::read_mode2() // read_pc - //------------------------------------------------- -UINT8 i8255_device::read_pc() +uint8_t i8255_device::read_pc() { - UINT8 data = 0; - UINT8 mask = 0; - UINT8 b_mask = 0x0f; + uint8_t data = 0; + uint8_t mask = 0; + uint8_t b_mask = 0x0f; // PC upper switch (group_mode(GROUP_A)) @@ -483,7 +483,7 @@ UINT8 i8255_device::read_pc() // write_mode0 - //------------------------------------------------- -void i8255_device::write_mode0(int port, UINT8 data) +void i8255_device::write_mode0(int port, uint8_t data) { if (port_mode(port) == MODE_OUTPUT) { @@ -505,7 +505,7 @@ void i8255_device::write_mode0(int port, UINT8 data) // write_mode1 - //------------------------------------------------- -void i8255_device::write_mode1(int port, UINT8 data) +void i8255_device::write_mode1(int port, uint8_t data) { if (port_mode(port) == MODE_OUTPUT) { @@ -533,7 +533,7 @@ void i8255_device::write_mode1(int port, UINT8 data) // write_mode2 - //------------------------------------------------- -void i8255_device::write_mode2(UINT8 data) +void i8255_device::write_mode2(uint8_t data) { // latch output data m_output[PORT_A] = data; @@ -555,9 +555,9 @@ void i8255_device::write_mode2(UINT8 data) void i8255_device::output_pc() { - UINT8 data = 0; - UINT8 mask = 0; - UINT8 b_mask = 0x0f; + uint8_t data = 0; + uint8_t mask = 0; + uint8_t b_mask = 0x0f; // PC upper switch (group_mode(GROUP_A)) @@ -635,7 +635,7 @@ void i8255_device::output_pc() // set_mode - //------------------------------------------------- -void i8255_device::set_mode(UINT8 data) +void i8255_device::set_mode(uint8_t data) { m_control = data; @@ -766,7 +766,7 @@ void i8255_device::set_pc_bit(int bit, int state) READ8_MEMBER( i8255_device::read ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0x03) { @@ -875,9 +875,9 @@ READ8_MEMBER( i8255_device::pa_r ) // pb_r - port A read //------------------------------------------------- -UINT8 i8255_device::pa_r() +uint8_t i8255_device::pa_r() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (port_mode(PORT_A) == MODE_OUTPUT) { @@ -902,9 +902,9 @@ READ8_MEMBER( i8255_device::pb_r ) // pb_r - port B read //------------------------------------------------- -UINT8 i8255_device::pb_r() +uint8_t i8255_device::pb_r() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (port_mode(PORT_B) == MODE_OUTPUT) { diff --git a/src/devices/machine/i8255.h b/src/devices/machine/i8255.h index 1fa41e727a5..21b53561e5c 100644 --- a/src/devices/machine/i8255.h +++ b/src/devices/machine/i8255.h @@ -68,7 +68,7 @@ class i8255_device : public device_t { public: // construction/destruction - i8255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8255_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_in_pa_callback(device_t &device, _Object object) { return downcast(device).m_in_pa_cb.set_callback(object); } template static devcb_base &set_in_pb_callback(device_t &device, _Object object) { return downcast(device).m_in_pb_cb.set_callback(object); } @@ -81,10 +81,10 @@ public: DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( pa_r ); - UINT8 pa_r(); + uint8_t pa_r(); DECLARE_READ8_MEMBER( pb_r ); - UINT8 pb_r(); + uint8_t pb_r(); DECLARE_WRITE_LINE_MEMBER( pc2_w ); DECLARE_WRITE_LINE_MEMBER( pc4_w ); @@ -108,15 +108,15 @@ private: inline int port_c_lower_mode(); inline int port_c_upper_mode(); - UINT8 read_mode0(int port); - UINT8 read_mode1(int port); - UINT8 read_mode2(); - UINT8 read_pc(); - void write_mode0(int port, UINT8 data); - void write_mode1(int port, UINT8 data); - void write_mode2(UINT8 data); + uint8_t read_mode0(int port); + uint8_t read_mode1(int port); + uint8_t read_mode2(); + uint8_t read_pc(); + void write_mode0(int port, uint8_t data); + void write_mode1(int port, uint8_t data); + void write_mode2(uint8_t data); void output_pc(); - void set_mode(UINT8 data); + void set_mode(uint8_t data); void set_pc_bit(int bit, int state); devcb_read8 m_in_pa_cb; @@ -127,9 +127,9 @@ private: devcb_write8 m_out_pb_cb; devcb_write8 m_out_pc_cb; - UINT8 m_control; // mode control word - UINT8 m_output[3]; // output latch - UINT8 m_input[3]; // input latch + uint8_t m_control; // mode control word + uint8_t m_output[3]; // output latch + uint8_t m_input[3]; // input latch int m_ibf[2]; // input buffer full flag int m_obf[2]; // output buffer full flag, negative logic diff --git a/src/devices/machine/i8257.cpp b/src/devices/machine/i8257.cpp index a54d21697cc..7bac8ea817d 100644 --- a/src/devices/machine/i8257.cpp +++ b/src/devices/machine/i8257.cpp @@ -181,7 +181,7 @@ inline void i8257_device::dma_write() switch (MODE_TRANSFER_MASK) { case MODE_TRANSFER_VERIFY: { - UINT8 v1 = m_in_memr_cb(offset); + uint8_t v1 = m_in_memr_cb(offset); if(0 && m_temp != v1) logerror("%s: verify error %02x vs. %02x\n", tag(), m_temp, v1); break; @@ -257,7 +257,7 @@ inline void i8257_device::advance() // i8257_device - constructor //------------------------------------------------- -i8257_device::i8257_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8257_device::i8257_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8257, "Intel 8257", tag, owner, clock, "i8257", __FILE__), device_execute_interface(mconfig, *this), m_icount(0), @@ -491,7 +491,7 @@ void i8257_device::execute_run() READ8_MEMBER( i8257_device::read ) { - UINT8 data = 0; + uint8_t data = 0; if (!BIT(offset, 3)) { diff --git a/src/devices/machine/i8257.h b/src/devices/machine/i8257.h index ad02ece924e..0c4fd5a2f4a 100644 --- a/src/devices/machine/i8257.h +++ b/src/devices/machine/i8257.h @@ -101,7 +101,7 @@ class i8257_device : public device_t, { public: // construction/destruction - i8257_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8257_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -164,10 +164,10 @@ private: int m_state; int m_current_channel; int m_last_channel; - UINT8 m_transfer_mode; - UINT8 m_status; - UINT8 m_request; - UINT8 m_temp; + uint8_t m_transfer_mode; + uint8_t m_status; + uint8_t m_request; + uint8_t m_temp; devcb_write_line m_out_hrq_cb; devcb_write_line m_out_tc_cb; @@ -192,9 +192,9 @@ private: struct { - UINT16 m_address; - UINT16 m_count; - UINT8 m_mode; + uint16_t m_address; + uint16_t m_count; + uint8_t m_mode; } m_channel[4]; }; diff --git a/src/devices/machine/i8271.cpp b/src/devices/machine/i8271.cpp index dfd098a5f82..be0fa7576a0 100644 --- a/src/devices/machine/i8271.cpp +++ b/src/devices/machine/i8271.cpp @@ -5,7 +5,7 @@ const device_type I8271 = &device_creator; -i8271_device::i8271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8271_device::i8271_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8271, "Intel 8271", tag, owner, clock, "i8271", __FILE__), ready_connected(false), mode(0), main_phase(0), intrq_cb(*this), drq_cb(*this), @@ -131,7 +131,7 @@ void i8271_device::set_floppy(floppy_image_device *flop) READ8_MEMBER(i8271_device::sr_r) { - UINT32 ret = (irq ? SR_IRQ : 0); + uint32_t ret = (irq ? SR_IRQ : 0); switch(main_phase) { case PHASE_CMD: ret |= SR_CF; @@ -200,7 +200,7 @@ WRITE8_MEMBER(i8271_device::param_w) } } -bool i8271_device::set_output(UINT8 data) +bool i8271_device::set_output(uint8_t data) { if(main_phase == PHASE_EXEC) { if(drq) { @@ -213,7 +213,7 @@ bool i8271_device::set_output(UINT8 data) return true; } -bool i8271_device::get_input(UINT8 *data) +bool i8271_device::get_input(uint8_t *data) { if(main_phase == PHASE_EXEC) { if(drq) { @@ -470,7 +470,7 @@ void i8271_device::live_run(attotime limit) case SCAN_SECTOR_DATA_BYTE: if(!scan_done) { - UINT8 data = 0; + uint8_t data = 0; if(!get_input(&data)) { live_delay(IDLE); return; @@ -545,7 +545,7 @@ void i8271_device::live_run(attotime limit) cur_live.crc = 0xffff; live_write_raw(BIT(command[0], 2) ? 0xf56a : 0xf56f); } else if(cur_live.byte_counter < 7+sector_size) { - UINT8 data = 0; + uint8_t data = 0; if(!get_input(&data)) { live_delay(IDLE); return; @@ -602,7 +602,7 @@ void i8271_device::live_run(attotime limit) cur_live.crc = 0xffff; live_write_raw(0xf57e); } else if(cur_live.byte_counter < 11) { - UINT8 data = 0; + uint8_t data = 0; if(!get_input(&data)) { live_delay(IDLE); return; @@ -1312,7 +1312,7 @@ void i8271_device::write_data_continue(floppy_info &fi) } } -int i8271_device::calc_sector_size(UINT8 size) +int i8271_device::calc_sector_size(uint8_t size) { return size > 7 ? 16384 : 128 << size; } @@ -1686,16 +1686,16 @@ bool i8271_device::write_one_bit(const attotime &limit) return false; } -void i8271_device::live_write_raw(UINT16 raw) +void i8271_device::live_write_raw(uint16_t raw) { // logerror("write %04x %04x\n", raw, cur_live.crc); cur_live.shift_reg = raw; cur_live.data_bit_context = raw & 1; } -void i8271_device::live_write_fm(UINT8 fm) +void i8271_device::live_write_fm(uint8_t fm) { - UINT16 raw = 0xaaaa; + uint16_t raw = 0xaaaa; for(int i=0; i<8; i++) if(fm & (0x80 >> i)) raw |= 0x4000 >> (2*i); diff --git a/src/devices/machine/i8271.h b/src/devices/machine/i8271.h index 5c63393a43f..03f2bdb5a3c 100644 --- a/src/devices/machine/i8271.h +++ b/src/devices/machine/i8271.h @@ -26,7 +26,7 @@ class i8271_device : public device_t { public: - i8271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8271_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~i8271_device() {} template static devcb_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast(device).intrq_cb.set_callback(object); } @@ -177,7 +177,7 @@ private: int id; int main_state, sub_state; int dir, counter; - UINT8 pcn, badtrack[2]; + uint8_t pcn, badtrack[2]; bool live, index, ready; }; @@ -187,12 +187,12 @@ private: attotime tm; int state, next_state; floppy_info *fi; - UINT16 shift_reg; - UINT16 crc; + uint16_t shift_reg; + uint16_t crc; int bit_counter, byte_counter, previous_type; bool data_separator_phase, data_bit_context; - UINT8 data_reg; - UINT8 idbuf[6]; + uint8_t data_reg; + uint8_t idbuf[6]; fdc_pll_t pll; }; @@ -209,10 +209,10 @@ private: floppy_info flopi[2]; int command_pos, sectors_read, scan_len; - UINT8 command[6], dma_data, oport; - UINT8 rr, scan_sec, moder; - UINT8 precomp, perpmode, scan_cnt[2]; - UINT8 srate, hset, icnt, hload; + uint8_t command[6], dma_data, oport; + uint8_t rr, scan_sec, moder; + uint8_t precomp, perpmode, scan_cnt[2]; + uint8_t srate, hset, icnt, hload; int sector_size; int cur_rate; int idle_icnt; @@ -245,7 +245,7 @@ private: void set_irq(bool state); bool get_ready(int fid); - int calc_sector_size(UINT8 size); + int calc_sector_size(uint8_t size); int check_command(); void start_command(int cmd); @@ -281,13 +281,13 @@ private: void live_delay(int state); void live_sync(); void live_run(attotime limit = attotime::never); - void live_write_raw(UINT16 raw); - void live_write_fm(UINT8 fm); + void live_write_raw(uint16_t raw); + void live_write_fm(uint8_t fm); bool read_one_bit(const attotime &limit); bool write_one_bit(const attotime &limit); - bool set_output(UINT8 data); - bool get_input(UINT8 *data); + bool set_output(uint8_t data); + bool get_input(uint8_t *data); }; extern const device_type I8271; diff --git a/src/devices/machine/i8279.cpp b/src/devices/machine/i8279.cpp index 725d1aa4827..389397f8677 100644 --- a/src/devices/machine/i8279.cpp +++ b/src/devices/machine/i8279.cpp @@ -89,7 +89,7 @@ const device_type I8279 = &device_creator; // i8279_device - constructor //------------------------------------------------- -i8279_device::i8279_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8279_device::i8279_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8279, "8279 KDC", tag, owner, clock, "i8279", __FILE__), m_out_irq_cb(*this), m_out_sl_cb(*this), @@ -126,7 +126,7 @@ void i8279_device::device_start() void i8279_device::device_reset() { - UINT8 i; + uint8_t i; // startup values are unknown: setting to 0 for (i = 2; i < 8; i++) m_cmd[i] = 0; @@ -157,10 +157,10 @@ void i8279_device::timer_adjust() // If this is too long, the sensor mode doesn't work correctly. #if 0 - UINT8 divider = (m_cmd[1]) ? m_cmd[1] : 1; - UINT32 new_clock = clock() / divider; + uint8_t divider = (m_cmd[1]) ? m_cmd[1] : 1; + uint32_t new_clock = clock() / divider; #else - UINT32 new_clock = 2000; + uint32_t new_clock = 2000; #endif if (m_clock != new_clock) @@ -175,8 +175,8 @@ void i8279_device::timer_adjust() void i8279_device::clear_display() { // clear all digits - UINT8 i,patterns[4] = { 0, 0, 0x20, 0xff }; - UINT8 data = patterns[(m_cmd[6] & 12) >> 2]; + uint8_t i,patterns[4] = { 0, 0, 0x20, 0xff }; + uint8_t data = patterns[(m_cmd[6] & 12) >> 2]; // The CD high bit (also done by CA) if (m_cmd[6] & 0x11) @@ -203,9 +203,9 @@ void i8279_device::set_irq(bool state) } -void i8279_device::new_key(UINT8 data, bool skey, bool ckey) +void i8279_device::new_key(uint8_t data, bool skey, bool ckey) { - UINT8 i, rl, sl; + uint8_t i, rl, sl; for (i = 0; BIT(data, i); i++) {}; rl = i; if (BIT(m_cmd[0], 0)) @@ -220,7 +220,7 @@ void i8279_device::new_key(UINT8 data, bool skey, bool ckey) } -void i8279_device::new_fifo(UINT8 data) +void i8279_device::new_fifo(uint8_t data) { // see if already overrun if (BIT(m_status, 5)) @@ -236,7 +236,7 @@ void i8279_device::new_fifo(UINT8 data) m_fifo[m_status & 7] = data; // bump fifo size & turn off underrun - UINT8 fifo_size = m_status & 7; + uint8_t fifo_size = m_status & 7; if ((fifo_size)==7) m_status |= 8; // full else @@ -261,9 +261,9 @@ void i8279_device::timer_mainloop() // bit 3 - number of digits to display // bit 4 - left or right entry - UINT8 scanner_mask = BIT(m_cmd[0], 0) ? 15 : BIT(m_cmd[0], 3) ? 15 : 7; + uint8_t scanner_mask = BIT(m_cmd[0], 0) ? 15 : BIT(m_cmd[0], 3) ? 15 : 7; bool decoded = BIT(m_cmd[0], 0); - UINT8 kbd_type = (m_cmd[0] & 6) >> 1; + uint8_t kbd_type = (m_cmd[0] & 6) >> 1; bool shift_key = 1; bool ctrl_key = 1; bool strobe_pulse = 0; @@ -290,10 +290,10 @@ void i8279_device::timer_mainloop() if ( !m_in_rl_cb.isnull() ) { - UINT8 rl = m_in_rl_cb(0); + uint8_t rl = m_in_rl_cb(0); // see if key still down from last time - UINT16 key_down = (m_scanner << 8) | rl; + uint16_t key_down = (m_scanner << 8) | rl; if (key_down == m_key_down) rl = 0xff; else @@ -312,7 +312,7 @@ void i8279_device::timer_mainloop() break; case 2: { - UINT8 addr = m_scanner &7; + uint8_t addr = m_scanner &7; if (decoded) for (addr=0; !BIT(m_scanner, addr); addr++) {}; @@ -366,9 +366,9 @@ READ8_MEMBER( i8279_device::status_r ) READ8_MEMBER( i8279_device::data_r ) { - UINT8 i; + uint8_t i; bool sensor_mode = ((m_cmd[0] & 6)==4); - UINT8 data; + uint8_t data; if (m_read_flag) { // read the display ram @@ -397,7 +397,7 @@ READ8_MEMBER( i8279_device::data_r ) { // read a key from fifo data = m_fifo[0]; - UINT8 fifo_size = m_status & 7; + uint8_t fifo_size = m_status & 7; switch (m_status & 0x38) { case 0x00: // no errors @@ -434,7 +434,7 @@ READ8_MEMBER( i8279_device::data_r ) WRITE8_MEMBER( i8279_device::cmd_w ) {//printf("Command: %X=%X ",data>>5,data&31); - UINT8 cmd = data >> 5; + uint8_t cmd = data >> 5; data &= 0x1f; m_cmd[cmd] = data; switch (cmd) diff --git a/src/devices/machine/i8279.h b/src/devices/machine/i8279.h index 3da46da3121..615e8dfdba2 100644 --- a/src/devices/machine/i8279.h +++ b/src/devices/machine/i8279.h @@ -74,7 +74,7 @@ class i8279_device : public device_t { public: // construction/destruction - i8279_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8279_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_cb.set_callback(object); } template static devcb_base &set_out_sl_callback(device_t &device, _Object object) { return downcast(device).m_out_sl_cb.set_callback(object); } @@ -104,8 +104,8 @@ private: void timer_adjust(); void clear_display(); - void new_key(UINT8 data, bool skey, bool ckey); - void new_fifo(UINT8 data); + void new_key(uint8_t data, bool skey, bool ckey); + void new_fifo(uint8_t data); void set_irq(bool state); devcb_write_line m_out_irq_cb; // IRQ @@ -118,20 +118,20 @@ private: emu_timer *m_timer; - UINT8 m_d_ram[16]; // display ram - UINT8 m_d_ram_ptr; - UINT8 m_s_ram[8]; // might be same as fifo ram - UINT8 m_s_ram_ptr; - UINT8 m_fifo[8]; // queued keystrokes - UINT8 m_cmd[8]; // Device settings - UINT8 m_status; // Returned via status_r - UINT32 m_clock; // Internal scan clock - UINT8 m_scanner; // next output on SL lines + uint8_t m_d_ram[16]; // display ram + uint8_t m_d_ram_ptr; + uint8_t m_s_ram[8]; // might be same as fifo ram + uint8_t m_s_ram_ptr; + uint8_t m_fifo[8]; // queued keystrokes + uint8_t m_cmd[8]; // Device settings + uint8_t m_status; // Returned via status_r + uint32_t m_clock; // Internal scan clock + uint8_t m_scanner; // next output on SL lines bool m_autoinc; // auto-increment flag bool m_read_flag; // read from where bool m_ctrl_key; // previous state of strobe input - UINT16 m_key_down; + uint16_t m_key_down; }; diff --git a/src/devices/machine/i82875p.cpp b/src/devices/machine/i82875p.cpp index 58f8b3264c9..a1ab51f59e4 100644 --- a/src/devices/machine/i82875p.cpp +++ b/src/devices/machine/i82875p.cpp @@ -41,7 +41,7 @@ DEVICE_ADDRESS_MAP_START(config_map, 32, i82875p_host_device) AM_INHERIT_FROM(pci_host_device::config_map) ADDRESS_MAP_END -i82875p_host_device::i82875p_host_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i82875p_host_device::i82875p_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_host_device(mconfig, I82875P_HOST, "I82875P Northbridge", tag, owner, clock, "i82875p_host", __FILE__) { } @@ -341,12 +341,12 @@ void i82875p_host_device::device_reset() skpd = 0x0000; } -void i82875p_host_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 i82875p_host_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) { io_space->install_device(0, 0xffff, *static_cast(this), &pci_host_device::io_configuration_access_map); - UINT32 top = toud << 16; + uint32_t top = toud << 16; if(esmramc & 1) { switch((esmramc >> 1) & 3) { case 2: top += 512*1024; break; @@ -426,7 +426,7 @@ void i82875p_host_device::map_extra(UINT64 memory_window_start, UINT64 memory_wi } -i82875p_agp_device::i82875p_agp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i82875p_agp_device::i82875p_agp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : agp_bridge_device(mconfig, I82875P_AGP, "I82875P AGP Bridge", tag, owner, clock, "i82875p_agp", __FILE__) { } @@ -449,7 +449,7 @@ DEVICE_ADDRESS_MAP_START(overflow_map, 32, i82875p_overflow_device) ADDRESS_MAP_END -i82875p_overflow_device::i82875p_overflow_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i82875p_overflow_device::i82875p_overflow_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, I82875P_OVERFLOW, "I82875P Configuration Overflow", tag, owner, clock, "i82875p_overflow", __FILE__) { } diff --git a/src/devices/machine/i82875p.h b/src/devices/machine/i82875p.h index 4f7723e64a7..2d40094c2da 100644 --- a/src/devices/machine/i82875p.h +++ b/src/devices/machine/i82875p.h @@ -20,15 +20,15 @@ class i82875p_host_device : public pci_host_device { public: - i82875p_host_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82875p_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_cpu_tag(const char *tag); void set_ram_size(int ram_size); virtual void reset_all_mappings() 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; virtual DECLARE_ADDRESS_MAP(config_map, 32) override; @@ -88,17 +88,17 @@ private: const char *cpu_tag; int ram_size; cpu_device *cpu; - std::vector ram; + std::vector ram; - UINT8 agpm, fpllcont, pam[8], smram, esmramc; - UINT8 apsize, amtt, lptt; - UINT16 toud, mchcfg, errcmd, smicmd, scicmd, skpd; - UINT32 agpctrl, attbase; + uint8_t agpm, fpllcont, pam[8], smram, esmramc; + uint8_t apsize, amtt, lptt; + uint16_t toud, mchcfg, errcmd, smicmd, scicmd, skpd; + uint32_t agpctrl, attbase; }; class i82875p_agp_device : public agp_bridge_device { public: - i82875p_agp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82875p_agp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -107,7 +107,7 @@ protected: class i82875p_overflow_device : public pci_device { public: - i82875p_overflow_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82875p_overflow_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER (dram_row_boundary_r); @@ -127,8 +127,8 @@ protected: private: DECLARE_ADDRESS_MAP(overflow_map, 32); - UINT8 dram_row_boundary[8], dram_row_attribute[4]; - UINT32 dram_timing, dram_controller_mode; + uint8_t dram_row_boundary[8], dram_row_attribute[4]; + uint32_t dram_timing, dram_controller_mode; }; extern const device_type I82875P_HOST; diff --git a/src/devices/machine/i8355.cpp b/src/devices/machine/i8355.cpp index cf53a098a19..bb3731aab58 100644 --- a/src/devices/machine/i8355.cpp +++ b/src/devices/machine/i8355.cpp @@ -56,9 +56,9 @@ ADDRESS_MAP_END // read_port - read from input port //------------------------------------------------- -inline UINT8 i8355_device::read_port(int port) +inline uint8_t i8355_device::read_port(int port) { - UINT8 data = m_output[port] & m_ddr[port]; + uint8_t data = m_output[port] & m_ddr[port]; if (m_ddr[port] != 0xff) { @@ -74,7 +74,7 @@ inline UINT8 i8355_device::read_port(int port) // write_port - write to output port //------------------------------------------------- -inline void i8355_device::write_port(int port, UINT8 data) +inline void i8355_device::write_port(int port, uint8_t data) { m_output[port] = data; @@ -92,7 +92,7 @@ inline void i8355_device::write_port(int port, UINT8 data) // i8355_device - constructor //------------------------------------------------- -i8355_device::i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8355_device::i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8355, "Intel 8355", tag, owner, clock, "i8355", __FILE__), device_memory_interface(mconfig, *this), m_in_pa_cb(*this), @@ -153,7 +153,7 @@ READ8_MEMBER( i8355_device::io_r ) { int port = offset & 0x01; - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0x03) { diff --git a/src/devices/machine/i8355.h b/src/devices/machine/i8355.h index 7337fa0193d..2acb4aff6a5 100644 --- a/src/devices/machine/i8355.h +++ b/src/devices/machine/i8355.h @@ -73,7 +73,7 @@ class i8355_device : public device_t, { public: // construction/destruction - i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_in_pa_callback(device_t &device, _Object object) { return downcast(device).m_in_pa_cb.set_callback(object); } template static devcb_base &set_out_pa_callback(device_t &device, _Object object) { return downcast(device).m_out_pa_cb.set_callback(object); } @@ -93,8 +93,8 @@ protected: // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; - inline UINT8 read_port(int port); - inline void write_port(int port, UINT8 data); + inline uint8_t read_port(int port); + inline void write_port(int port, uint8_t data); private: devcb_read8 m_in_pa_cb; @@ -104,8 +104,8 @@ private: devcb_write8 m_out_pb_cb; // registers - UINT8 m_output[2]; // output latches - UINT8 m_ddr[2]; // DDR latches + uint8_t m_output[2]; // output latches + uint8_t m_ddr[2]; // DDR latches const address_space_config m_space_config; }; diff --git a/src/devices/machine/idectrl.cpp b/src/devices/machine/idectrl.cpp index 5be4dcd3d5a..54e05b55c2d 100644 --- a/src/devices/machine/idectrl.cpp +++ b/src/devices/machine/idectrl.cpp @@ -26,12 +26,12 @@ const device_type IDE_CONTROLLER = &device_creator; -ide_controller_device::ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ide_controller_device::ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ata_interface_device(mconfig, IDE_CONTROLLER, "IDE Controller", tag, owner, clock, "ide_controller", __FILE__) { } -ide_controller_device::ide_controller_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) : +ide_controller_device::ide_controller_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) : ata_interface_device(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -89,19 +89,19 @@ WRITE16_MEMBER( ide_controller_device::write_cs1 ) const device_type IDE_CONTROLLER_32 = &device_creator; -ide_controller_32_device::ide_controller_32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ide_controller_32_device::ide_controller_32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ide_controller_device(mconfig, IDE_CONTROLLER, "IDE Controller (32 bit)", tag, owner, clock, "ide_controller32", __FILE__) { } -ide_controller_32_device::ide_controller_32_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) : +ide_controller_32_device::ide_controller_32_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) : ide_controller_device(mconfig, type, name, tag, owner, clock, shortname, source) { } READ32_MEMBER(ide_controller_32_device::read_cs0) { - UINT32 data = 0; + uint32_t data = 0; if (ACCESSING_BITS_0_15) { @@ -120,7 +120,7 @@ READ32_MEMBER(ide_controller_32_device::read_cs0) READ32_MEMBER(ide_controller_32_device::read_cs1) { - UINT32 data = 0; + uint32_t data = 0; if (ACCESSING_BITS_0_15) { @@ -168,7 +168,7 @@ WRITE32_MEMBER(ide_controller_32_device::write_cs1) const device_type BUS_MASTER_IDE_CONTROLLER = &device_creator; -bus_master_ide_controller_device::bus_master_ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +bus_master_ide_controller_device::bus_master_ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ide_controller_32_device(mconfig, BUS_MASTER_IDE_CONTROLLER, "Bus Master IDE Controller", tag, owner, clock, "bus_master_ide_controller", __FILE__), m_dma_address(0), m_dma_bytes_left(0), @@ -275,8 +275,8 @@ WRITE32_MEMBER( bus_master_ide_controller_device::bmdma_w ) if( ACCESSING_BITS_0_7 ) { /* Bus Master IDE Command register */ - UINT8 old = m_bus_master_command; - UINT8 val = data & 0xff; + uint8_t old = m_bus_master_command; + uint8_t val = data & 0xff; /* save the "Read or Write Control" bit 3 and the "Start/Stop Bus Master" bit 0 */ m_bus_master_command = (old & 0xf6) | (val & 0x09); @@ -307,8 +307,8 @@ WRITE32_MEMBER( bus_master_ide_controller_device::bmdma_w ) if( ACCESSING_BITS_16_23 ) { /* Bus Master IDE Status register */ - UINT8 old = m_bus_master_status; - UINT8 val = data >> 16; + uint8_t old = m_bus_master_status; + uint8_t val = data >> 16; /* save the DMA capable bits */ m_bus_master_status = (old & 0x9f) | (val & 0x60); @@ -360,7 +360,7 @@ void bus_master_ide_controller_device::execute_dma() if (m_bus_master_command & 8) { // read from ata bus - UINT16 data = read_dma(); + uint16_t data = read_dma(); // write to memory m_dma_space->write_byte(m_dma_address++, data & 0xff); @@ -369,7 +369,7 @@ void bus_master_ide_controller_device::execute_dma() else { // read from memory; - UINT16 data = m_dma_space->read_byte(m_dma_address++); + uint16_t data = m_dma_space->read_byte(m_dma_address++); data |= m_dma_space->read_byte(m_dma_address++) << 8; // write to ata bus diff --git a/src/devices/machine/idectrl.h b/src/devices/machine/idectrl.h index 1d5a184b809..3ecb1c3bf39 100644 --- a/src/devices/machine/idectrl.h +++ b/src/devices/machine/idectrl.h @@ -30,8 +30,8 @@ class ide_controller_device : public ata_interface_device { public: - ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ide_controller_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); + ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ide_controller_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_READ16_MEMBER(read_cs0) override; virtual DECLARE_READ16_MEMBER(read_cs1) override; @@ -53,8 +53,8 @@ extern const device_type IDE_CONTROLLER; class ide_controller_32_device : public ide_controller_device { public: - ide_controller_32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ide_controller_32_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); + ide_controller_32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ide_controller_32_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_READ32_MEMBER(read_cs0); virtual DECLARE_READ32_MEMBER(read_cs1); @@ -85,8 +85,8 @@ extern const device_type IDE_CONTROLLER_32; class bus_master_ide_controller_device : public ide_controller_32_device { public: - bus_master_ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - static void set_bus_master_space(device_t &device, const char *bmcpu, UINT32 bmspace) {bus_master_ide_controller_device &ide = downcast(device); ide.m_bmcpu = bmcpu; ide.m_bmspace = bmspace; } + bus_master_ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + static void set_bus_master_space(device_t &device, const char *bmcpu, uint32_t bmspace) {bus_master_ide_controller_device &ide = downcast(device); ide.m_bmcpu = bmcpu; ide.m_bmspace = bmspace; } DECLARE_READ32_MEMBER( bmdma_r ); DECLARE_WRITE32_MEMBER( bmdma_w ); @@ -101,17 +101,17 @@ private: void execute_dma(); const char *m_bmcpu; - UINT32 m_bmspace; + uint32_t m_bmspace; address_space * m_dma_space; - UINT8 m_dma_address_xor; + uint8_t m_dma_address_xor; offs_t m_dma_address; - UINT32 m_dma_bytes_left; + uint32_t m_dma_bytes_left; offs_t m_dma_descriptor; - UINT8 m_dma_last_buffer; - UINT8 m_bus_master_command; - UINT8 m_bus_master_status; - UINT32 m_bus_master_descriptor; + uint8_t m_dma_last_buffer; + uint8_t m_bus_master_command; + uint8_t m_bus_master_status; + uint32_t m_bus_master_descriptor; int m_irq; int m_dmarq; }; diff --git a/src/devices/machine/idehd.cpp b/src/devices/machine/idehd.cpp index f56c6f68558..35e90f6193f 100644 --- a/src/devices/machine/idehd.cpp +++ b/src/devices/machine/idehd.cpp @@ -19,7 +19,7 @@ #define TIME_FULL_STROKE_SEEK (attotime::from_usec(13000)) #define TIME_AVERAGE_ROTATIONAL_LATENCY (attotime::from_usec(1300)) -ata_mass_storage_device::ata_mass_storage_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) +ata_mass_storage_device::ata_mass_storage_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) : ata_hle_device(mconfig, type, name, tag, owner, clock, shortname, source), m_can_identify_device(0), m_num_cylinders(0), @@ -36,7 +36,7 @@ ata_mass_storage_device::ata_mass_storage_device(const machine_config &mconfig, * *************************************/ -UINT32 ata_mass_storage_device::lba_address() +uint32_t ata_mass_storage_device::lba_address() { /* LBA direct? */ if (m_device_head & IDE_DEVICE_HEAD_L) @@ -54,11 +54,11 @@ UINT32 ata_mass_storage_device::lba_address() * *************************************/ -static void swap_strncpy(UINT16 *dst, const char *src, int field_size_in_words) +static void swap_strncpy(uint16_t *dst, const char *src, int field_size_in_words) { for (int i = 0; i < field_size_in_words; i++) { - UINT16 d; + uint16_t d; if (*src) { @@ -309,7 +309,7 @@ void ata_mass_storage_device::finished_command() void ata_mass_storage_device::next_sector() { - UINT8 cur_head = m_device_head & IDE_DEVICE_HEAD_HS; + uint8_t cur_head = m_device_head & IDE_DEVICE_HEAD_HS; /* LBA direct? */ if (m_device_head & IDE_DEVICE_HEAD_L) @@ -779,13 +779,13 @@ const device_type IDE_HARDDISK = &device_creator; // ide_hdd_device - constructor //------------------------------------------------- -ide_hdd_device::ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ide_hdd_device::ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ata_mass_storage_device(mconfig, IDE_HARDDISK, "IDE Hard Disk", tag, owner, clock, "hdd", __FILE__), m_image(*this, "image") { } -ide_hdd_device::ide_hdd_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) +ide_hdd_device::ide_hdd_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) : ata_mass_storage_device(mconfig, type, name, tag, owner, clock, shortname, source), m_image(*this, "image") { @@ -821,7 +821,7 @@ void ide_hdd_device::device_reset() } // build the features page - UINT32 metalength; + uint32_t metalength; if (m_handle->read_metadata (HARD_DISK_IDENT_METADATA_TAG, 0, &m_buffer[0], 512, metalength) == CHDERR_NONE) { for( int w = 0; w < 256; w++ ) @@ -840,9 +840,9 @@ void ide_hdd_device::device_reset() ata_mass_storage_device::device_reset(); } -UINT8 ide_hdd_device::calculate_status() +uint8_t ide_hdd_device::calculate_status() { - UINT8 result = ata_hle_device::calculate_status(); + uint8_t result = ata_hle_device::calculate_status(); if (m_last_status_timer->elapsed() > TIME_PER_ROTATION) { diff --git a/src/devices/machine/idehd.h b/src/devices/machine/idehd.h index 8acc9e14474..f979d25285b 100644 --- a/src/devices/machine/idehd.h +++ b/src/devices/machine/idehd.h @@ -20,17 +20,17 @@ class ata_mass_storage_device : public ata_hle_device { public: - ata_mass_storage_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); + ata_mass_storage_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); - UINT16 *identify_device_buffer() { return m_identify_buffer; } + uint16_t *identify_device_buffer() { return m_identify_buffer; } - void set_master_password(const UINT8 *password) + void set_master_password(const uint8_t *password) { m_master_password = password; m_master_password_enable = (password != nullptr); } - void set_user_password(const UINT8 *password) + void set_user_password(const uint8_t *password) { m_user_password = password; m_user_password_enable = (password != nullptr); @@ -39,8 +39,8 @@ public: protected: virtual void device_start() override; - virtual int read_sector(UINT32 lba, void *buffer) = 0; - virtual int write_sector(UINT32 lba, const void *buffer) = 0; + virtual int read_sector(uint32_t lba, void *buffer) = 0; + virtual int write_sector(uint32_t lba, const void *buffer) = 0; virtual attotime seek_time(); void ide_build_identify_device(); @@ -56,14 +56,14 @@ protected: virtual void signature() override; int m_can_identify_device; - UINT16 m_num_cylinders; - UINT8 m_num_sectors; - UINT8 m_num_heads; + uint16_t m_num_cylinders; + uint8_t m_num_sectors; + uint8_t m_num_heads; - virtual UINT32 lba_address(); + virtual uint32_t lba_address(); private: - void set_geometry(UINT8 sectors, UINT8 heads) { m_num_sectors = sectors; m_num_heads = heads; } + void set_geometry(uint8_t sectors, uint8_t heads) { m_num_sectors = sectors; m_num_heads = heads; } void finished_read(); void finished_write(); void next_sector(); @@ -71,14 +71,14 @@ private: void read_first_sector(); void soft_reset() override; - UINT32 m_cur_lba; - UINT16 m_block_count; - UINT16 m_sectors_until_int; + uint32_t m_cur_lba; + uint16_t m_block_count; + uint16_t m_sectors_until_int; - UINT8 m_master_password_enable; - UINT8 m_user_password_enable; - const UINT8 * m_master_password; - const UINT8 * m_user_password; + uint8_t m_master_password_enable; + uint8_t m_user_password_enable; + const uint8_t * m_master_password; + const uint8_t * m_user_password; }; // ======================> ide_hdd_device @@ -87,8 +87,8 @@ class ide_hdd_device : public ata_mass_storage_device { public: // construction/destruction - ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ide_hdd_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); + ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ide_hdd_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: // device-level overrides @@ -98,9 +98,9 @@ protected: // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; - virtual int read_sector(UINT32 lba, void *buffer) override { if (m_disk == nullptr) return 0; return hard_disk_read(m_disk, lba, buffer); } - virtual int write_sector(UINT32 lba, const void *buffer) override { if (m_disk == nullptr) return 0; return hard_disk_write(m_disk, lba, buffer); } - virtual UINT8 calculate_status() override; + virtual int read_sector(uint32_t lba, void *buffer) override { if (m_disk == nullptr) return 0; return hard_disk_read(m_disk, lba, buffer); } + virtual int write_sector(uint32_t lba, const void *buffer) override { if (m_disk == nullptr) return 0; return hard_disk_write(m_disk, lba, buffer); } + virtual uint8_t calculate_status() override; chd_file *m_handle; hard_disk_file *m_disk; diff --git a/src/devices/machine/im6402.cpp b/src/devices/machine/im6402.cpp index ed27e61279a..4cc898d8e52 100644 --- a/src/devices/machine/im6402.cpp +++ b/src/devices/machine/im6402.cpp @@ -75,7 +75,7 @@ inline void im6402_device::set_tre(int state) // im6402_device - constructor //------------------------------------------------- -im6402_device::im6402_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +im6402_device::im6402_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IM6402, "Intersil IM6402", tag, owner, clock, "im6402", __FILE__), device_serial_interface(mconfig, *this), m_write_tro(*this), diff --git a/src/devices/machine/im6402.h b/src/devices/machine/im6402.h index 05f0b33861a..24d45796d12 100644 --- a/src/devices/machine/im6402.h +++ b/src/devices/machine/im6402.h @@ -79,7 +79,7 @@ class im6402_device : public device_t, { public: // construction/destruction - im6402_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + im6402_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_rrc(device_t &device, int rrc) { downcast(device).m_rrc = rrc; } static void set_trc(device_t &device, int trc) { downcast(device).m_trc = trc; } @@ -151,12 +151,12 @@ private: int m_pi; // receiver - UINT8 m_rbr; + uint8_t m_rbr; int m_rrc; int m_rrc_count; // transmitter - UINT8 m_tbr; + uint8_t m_tbr; int m_trc; int m_trc_count; }; diff --git a/src/devices/machine/input_merger.cpp b/src/devices/machine/input_merger.cpp index ceedca5d556..8c45c5b8794 100644 --- a/src/devices/machine/input_merger.cpp +++ b/src/devices/machine/input_merger.cpp @@ -32,7 +32,7 @@ const device_type INPUT_MERGER_ACTIVE_LOW = &device_creator; // ins8154_device - constructor //------------------------------------------------- -ins8154_device::ins8154_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ins8154_device::ins8154_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, INS8154, "INS8154 RAM I/O", tag, owner, clock, "ins8154", __FILE__), m_in_a_cb(*this), m_out_a_cb(*this), @@ -94,7 +94,7 @@ void ins8154_device::device_reset() READ8_MEMBER(ins8154_device::ins8154_r) { - UINT8 val = 0xff; + uint8_t val = 0xff; if (offset > 0x24) { diff --git a/src/devices/machine/ins8154.h b/src/devices/machine/ins8154.h index 6a38a840c89..b49e5368ae6 100644 --- a/src/devices/machine/ins8154.h +++ b/src/devices/machine/ins8154.h @@ -68,7 +68,7 @@ class ins8154_device : public device_t { public: // construction/destruction - ins8154_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ins8154_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_in_a_callback(device_t &device, _Object object) { return downcast(device).m_in_a_cb.set_callback(object); } template static devcb_base &set_out_a_callback(device_t &device, _Object object) { return downcast(device).m_out_a_cb.set_callback(object); } @@ -99,13 +99,13 @@ private: devcb_write_line m_out_irq_cb; /* registers */ - UINT8 m_in_a; /* Input Latch Port A */ - UINT8 m_in_b; /* Input Latch Port B */ - UINT8 m_out_a; /* Output Latch Port A */ - UINT8 m_out_b; /* Output Latch Port B */ - UINT8 m_mdr; /* Mode Definition Register */ - UINT8 m_odra; /* Output Definition Register Port A */ - UINT8 m_odrb; /* Output Definition Register Port B */ + uint8_t m_in_a; /* Input Latch Port A */ + uint8_t m_in_b; /* Input Latch Port B */ + uint8_t m_out_a; /* Output Latch Port A */ + uint8_t m_out_b; /* Output Latch Port B */ + uint8_t m_mdr; /* Mode Definition Register */ + uint8_t m_odra; /* Output Definition Register Port A */ + uint8_t m_odrb; /* Output Definition Register Port B */ }; diff --git a/src/devices/machine/ins8250.cpp b/src/devices/machine/ins8250.cpp index 6607d7844da..98a80adcb93 100644 --- a/src/devices/machine/ins8250.cpp +++ b/src/devices/machine/ins8250.cpp @@ -91,7 +91,7 @@ const device_type NS16450 = &device_creator; const device_type NS16550 = &device_creator; const device_type PC16552D = &device_creator; -ins8250_uart_device::ins8250_uart_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) +ins8250_uart_device::ins8250_uart_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__), device_serial_interface(mconfig, *this), m_out_tx_cb(*this), @@ -109,25 +109,25 @@ ins8250_uart_device::ins8250_uart_device(const machine_config &mconfig, device_t m_regs.ier = 0; } -ins8250_device::ins8250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ins8250_device::ins8250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ins8250_uart_device(mconfig, INS8250, "National Semiconductor INS8250", tag, owner, clock, "ins8250") { m_device_type = TYPE_INS8250; } -ns16450_device::ns16450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ns16450_device::ns16450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ins8250_uart_device(mconfig, NS16450, "National Semiconductor NS16450", tag, owner, clock, "ns16450") { m_device_type = TYPE_NS16450; } -ns16550_device::ns16550_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ns16550_device::ns16550_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ins8250_uart_device(mconfig, NS16550, "National Semiconductor NS16550", tag, owner, clock, "ns16550") { m_device_type = TYPE_NS16550; } -pc16552_device::pc16552_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc16552_device::pc16552_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC16552D, "National Semiconductor PC16552D", tag, owner, clock, "pc16552d", __FILE__) { } @@ -496,7 +496,7 @@ void ins8250_uart_device::tra_callback() void ins8250_uart_device::update_msr() { - UINT8 data; + uint8_t data; int change; if (m_regs.mcr & 0x10) @@ -643,15 +643,15 @@ void ns16550_device::device_timer(emu_timer &timer, device_timer_id id, int para } } -void ns16550_device::push_tx(UINT8 data) +void ns16550_device::push_tx(uint8_t data) { m_tfifo[m_thead] = data; ++m_thead &= 0x0f; } -UINT8 ns16550_device::pop_rx() +uint8_t ns16550_device::pop_rx() { - UINT8 data = m_rfifo[m_rtail]; + uint8_t data = m_rfifo[m_rtail]; clear_int(COM_INT_PENDING_CHAR_TIMEOUT & ~1); // don't clear bit 1 yet if(m_rnum) @@ -676,7 +676,7 @@ UINT8 ns16550_device::pop_rx() return data; } -void ns16550_device::set_fcr(UINT8 data) +void ns16550_device::set_fcr(uint8_t data) { const int bytes_per_int[] = {1, 4, 8, 14}; if(!(data & 1)) diff --git a/src/devices/machine/ins8250.h b/src/devices/machine/ins8250.h index 547c3dea602..4da3b0fb9af 100644 --- a/src/devices/machine/ins8250.h +++ b/src/devices/machine/ins8250.h @@ -19,7 +19,7 @@ class ins8250_uart_device : public device_t, public device_serial_interface { public: - ins8250_uart_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + ins8250_uart_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_out_tx_callback(device_t &device, _Object object) { return downcast(device).m_out_tx_cb.set_callback(object); } template static devcb_base &set_out_dtr_callback(device_t &device, _Object object) { return downcast(device).m_out_dtr_cb.set_callback(object); } @@ -44,9 +44,9 @@ protected: virtual void tra_callback() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void set_fcr(UINT8 data) {} - virtual void push_tx(UINT8 data) {} - virtual UINT8 pop_rx() { return 0; } + virtual void set_fcr(uint8_t data) {} + virtual void push_tx(uint8_t data) {} + virtual uint8_t pop_rx() { return 0; } void trigger_int(int flag); void clear_int(int flag); @@ -60,20 +60,20 @@ protected: }; int m_device_type; struct { - UINT8 thr; /* 0 -W transmitter holding register */ - UINT8 rbr; /* 0 R- receiver buffer register */ - UINT8 ier; /* 1 RW interrupt enable register */ - UINT16 dl; /* 0/1 RW divisor latch (if DLAB = 1) */ - UINT8 iir; /* 2 R- interrupt identification register */ - UINT8 fcr; - UINT8 lcr; /* 3 RW line control register (bit 7: DLAB) */ - UINT8 mcr; /* 4 RW modem control register */ - UINT8 lsr; /* 5 R- line status register */ - UINT8 msr; /* 6 R- modem status register */ - UINT8 scr; /* 7 RW scratch register */ + uint8_t thr; /* 0 -W transmitter holding register */ + uint8_t rbr; /* 0 R- receiver buffer register */ + uint8_t ier; /* 1 RW interrupt enable register */ + uint16_t dl; /* 0/1 RW divisor latch (if DLAB = 1) */ + uint8_t iir; /* 2 R- interrupt identification register */ + uint8_t fcr; + uint8_t lcr; /* 3 RW line control register (bit 7: DLAB) */ + uint8_t mcr; /* 4 RW modem control register */ + uint8_t lsr; /* 5 R- line status register */ + uint8_t msr; /* 6 R- modem status register */ + uint8_t scr; /* 7 RW scratch register */ } m_regs; private: - UINT8 m_int_pending; + uint8_t m_int_pending; devcb_write_line m_out_tx_cb; devcb_write_line m_out_dtr_cb; @@ -96,33 +96,33 @@ private: class ins8250_device : public ins8250_uart_device { public: - ins8250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ins8250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ns16450_device : public ins8250_uart_device { public: - ns16450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ns16450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class ns16550_device : public ins8250_uart_device { public: - ns16550_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ns16550_device(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 rcv_complete() override; virtual void tra_complete() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual void set_fcr(UINT8 data) override; - virtual void push_tx(UINT8 data) override; - virtual UINT8 pop_rx() override; + virtual void set_fcr(uint8_t data) override; + virtual void push_tx(uint8_t data) override; + virtual uint8_t pop_rx() override; private: void set_timer() { m_timeout->adjust(attotime::from_hz((clock()*4*8)/(m_regs.dl*16))); } int m_rintlvl; - UINT8 m_rfifo[16]; - UINT8 m_tfifo[16]; + uint8_t m_rfifo[16]; + uint8_t m_tfifo[16]; int m_rhead, m_rtail, m_rnum; int m_thead, m_ttail; emu_timer *m_timeout; @@ -131,7 +131,7 @@ private: class pc16552_device : public device_t { public: - pc16552_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc16552_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read) { return ((offset & 8) ? m_chan1 : m_chan0)->ins8250_r(space, offset & 7, mem_mask); } DECLARE_WRITE8_MEMBER(write) { ((offset & 8) ? m_chan1 : m_chan0)->ins8250_w(space, offset & 7, data, mem_mask); } diff --git a/src/devices/machine/intelfsh.cpp b/src/devices/machine/intelfsh.cpp index 19a871a018e..88e3cdddec8 100644 --- a/src/devices/machine/intelfsh.cpp +++ b/src/devices/machine/intelfsh.cpp @@ -120,7 +120,7 @@ const device_type SST_39VF400A = &device_creator; // intelfsh_device - constructor //------------------------------------------------- -intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -332,100 +332,100 @@ intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type break; } -intelfsh8_device::intelfsh8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +intelfsh8_device::intelfsh8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : intelfsh_device(mconfig, type, name, tag, owner, clock, variant, shortname, source) { } -intelfsh16_device::intelfsh16_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +intelfsh16_device::intelfsh16_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : intelfsh_device(mconfig, type, name, tag, owner, clock, variant, shortname, source) { } -intel_28f016s5_device::intel_28f016s5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intel_28f016s5_device::intel_28f016s5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, INTEL_28F016S5, "Intel 28F016S5 Flash", tag, owner, clock, FLASH_INTEL_28F016S5, "intel_28f016s5", __FILE__) { } -fujitsu_29f160t_device::fujitsu_29f160t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fujitsu_29f160t_device::fujitsu_29f160t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, FUJITSU_29F160T, "Fujitsu 29F160 Flash", tag, owner, clock, FLASH_FUJITSU_29F160T, "fujitsu_29f160t", __FILE__) { } -fujitsu_29f016a_device::fujitsu_29f016a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fujitsu_29f016a_device::fujitsu_29f016a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, FUJITSU_29F016A, "Fujitsu 29F016A Flash", tag, owner, clock, FLASH_FUJITSU_29F016A, "fujitsu_29f016a", __FILE__) { } -fujitsu_29dl16x_device::fujitsu_29dl16x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fujitsu_29dl16x_device::fujitsu_29dl16x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, FUJITSU_29DL16X, "Fujitsu 29DL16X Flash", tag, owner, clock, FLASH_FUJITSU_29DL16X, "fujitsu_29dl16x", __FILE__) { } -sharp_lh28f016s_device::sharp_lh28f016s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sharp_lh28f016s_device::sharp_lh28f016s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, SHARP_LH28F016S, "Sharp LH28F016S Flash", tag, owner, clock, FLASH_SHARP_LH28F016S, "sharp_lh28f016s", __FILE__) { } -sharp_lh28f016s_16bit_device::sharp_lh28f016s_16bit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sharp_lh28f016s_16bit_device::sharp_lh28f016s_16bit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, SHARP_LH28F016S_16BIT, "Sharp LH28F016S Flash (16-bit)", tag, owner, clock, FLASH_SHARP_LH28F016S_16BIT, "sharp_lh28f016s_16bit", __FILE__) { } -atmel_29c010_device::atmel_29c010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atmel_29c010_device::atmel_29c010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, ATMEL_29C010, "Atmel 29C010 Flash", tag, owner, clock, FLASH_ATMEL_29C010, "atmel_29c010", __FILE__) { } -amd_29f010_device::amd_29f010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amd_29f010_device::amd_29f010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, AMD_29F010, "AMD 29F010 Flash", tag, owner, clock, FLASH_AMD_29F010, "amd_29f010", __FILE__) { } -amd_29f040_device::amd_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amd_29f040_device::amd_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, AMD_29F040, "AMD 29F040 Flash", tag, owner, clock, FLASH_AMD_29F040, "amd_29f040", __FILE__) { } -amd_29f080_device::amd_29f080_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amd_29f080_device::amd_29f080_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, AMD_29F080, "AMD 29F080 Flash", tag, owner, clock, FLASH_AMD_29F080, "amd_29f080", __FILE__) { } -amd_29f400t_device::amd_29f400t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amd_29f400t_device::amd_29f400t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, AMD_29F400T, "AMD 29F400 Flash", tag, owner, clock, FLASH_AMD_29F400T, "amd_29f400t", __FILE__) { } -amd_29f800t_device::amd_29f800t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amd_29f800t_device::amd_29f800t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, AMD_29F800T, "AMD 29F800 Flash", tag, owner, clock, FLASH_AMD_29F800T, "amd_29f800t", __FILE__) { } -amd_29lv200t_device::amd_29lv200t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amd_29lv200t_device::amd_29lv200t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, AMD_29LV200T, "AMD 29LV200T Flash", tag, owner, clock, FLASH_AMD_29LV200T, "amd_29lv200t", __FILE__) { } -intel_e28f008sa_device::intel_e28f008sa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intel_e28f008sa_device::intel_e28f008sa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, INTEL_E28F008SA, "Intel E28F008SA Flash", tag, owner, clock, FLASH_INTEL_E28F008SA, "intel_e28f008sa", __FILE__) { } -macronix_29l001mc_device::macronix_29l001mc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +macronix_29l001mc_device::macronix_29l001mc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, MACRONIX_29L001MC, "Macronix 29L001MC Flash", tag, owner, clock, FLASH_MACRONIX_29L001MC, "macronix_29l001mc", __FILE__) { } -macronix_29lv160tmc_device::macronix_29lv160tmc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +macronix_29lv160tmc_device::macronix_29lv160tmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, MACRONIX_29LV160TMC, "Macronix 29LV160TMC Flash", tag, owner, clock, FLASH_MACRONIX_29LV160TMC, "macronix_29lv160tmc", __FILE__) { } -panasonic_mn63f805mnp_device::panasonic_mn63f805mnp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +panasonic_mn63f805mnp_device::panasonic_mn63f805mnp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, PANASONIC_MN63F805MNP, "Panasonic MN63F805MNP Flash", tag, owner, clock, FLASH_PANASONIC_MN63F805MNP, "panasonic_mn63f805mnp", __FILE__) { } -sanyo_le26fv10n1ts_device::sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sanyo_le26fv10n1ts_device::sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, SANYO_LE26FV10N1TS, "Sanyo LE26FV10N1TS Flash", tag, owner, clock, FLASH_SANYO_LE26FV10N1TS, "sanyo_le26fv10n1ts", __FILE__) { } -sst_28sf040_device::sst_28sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sst_28sf040_device::sst_28sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, SST_28SF040, "SST 28SF040 Flash", tag, owner, clock, FLASH_SST_28SF040, "sst_28sf040", __FILE__) { } -sst_39vf020_device::sst_39vf020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sst_39vf020_device::sst_39vf020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, SST_39VF020, "SST 39VF020 Flash", tag, owner, clock, FLASH_SST_39VF020, "sst_39vf020", __FILE__) { } -sharp_lh28f400_device::sharp_lh28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sharp_lh28f400_device::sharp_lh28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, SHARP_LH28F400, "Sharp LH28F400 Flash", tag, owner, clock, FLASH_SHARP_LH28F400, "sharp_lh28f400", __FILE__) { } -intel_te28f160_device::intel_te28f160_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intel_te28f160_device::intel_te28f160_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, INTEL_TE28F160, "Intel TE28F160 Flash", tag, owner, clock, FLASH_INTEL_TE28F160, "intel_te28f160", __FILE__) { } -intel_te28f320_device::intel_te28f320_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intel_te28f320_device::intel_te28f320_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, INTEL_TE28F320, "Intel TE28F320 Flash", tag, owner, clock, FLASH_INTEL_TE28F320, "intel_te28f320", __FILE__) { } -intel_e28f400b_device::intel_e28f400b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intel_e28f400b_device::intel_e28f400b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, INTEL_E28F400B, "Intel E28F400B Flash", tag, owner, clock, FLASH_INTEL_E28F400B, "intel_e28f400b", __FILE__) { } -sharp_unk128mbit_device::sharp_unk128mbit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sharp_unk128mbit_device::sharp_unk128mbit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, SHARP_UNK128MBIT, "Sharp Unknown 128Mbit Flash", tag, owner, clock, FLASH_SHARP_UNK128MBIT, "sharp_unk128mbit", __FILE__) { } -intel_28f320j3d_device::intel_28f320j3d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intel_28f320j3d_device::intel_28f320j3d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, INTEL_28F320J3D, "Intel 28F320J3D Flash", tag, owner, clock, FLASH_INTEL_28F320J3D, "intel_28f320j3d", __FILE__) { } -intel_28f320j5_device::intel_28f320j5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +intel_28f320j5_device::intel_28f320j5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, INTEL_28F320J5, "Intel 28F320J3D_a Flash", tag, owner, clock, FLASH_INTEL_28F320J5, "intel_28f320j5", __FILE__) { } -sst_39vf400a_device::sst_39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sst_39vf400a_device::sst_39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh16_device(mconfig, SST_39VF400A, "SST 39VF400A Flash", tag, owner, clock, FLASH_SST_39VF400A, "sst_39vf400a", __FILE__) { } -tms_29f040_device::tms_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms_29f040_device::tms_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : intelfsh8_device(mconfig, TMS_29F040, "Texas Instruments 29F040 Flash", tag, owner, clock, FLASH_TMS_29F040, "tms_29f040", __FILE__) { } //------------------------------------------------- @@ -434,7 +434,7 @@ tms_29f040_device::tms_29f040_device(const machine_config &mconfig, const char * void intelfsh_device::device_start() { - m_data = std::make_unique(m_size); + m_data = std::make_unique(m_size); m_timer = timer_alloc(); save_item( NAME(m_status) ); @@ -473,7 +473,7 @@ void intelfsh_device::nvram_default() // region always wins if (m_region.found()) { - UINT32 bytes = m_region->bytes(); + uint32_t bytes = m_region->bytes(); if (bytes > m_size) bytes = m_size; @@ -485,7 +485,7 @@ void intelfsh_device::nvram_default() else { for (offs_t offs = 0; offs < bytes; offs += 2) { - UINT16 v = m_region->u16(offs / 2); + uint16_t v = m_region->u16(offs / 2); m_data[offs] = v >> 8; m_data[offs+1] = v; } @@ -525,9 +525,9 @@ void intelfsh_device::nvram_write(emu_file &file) // bit-width-specific readers //------------------------------------------------- -UINT32 intelfsh_device::read_full(UINT32 address) +uint32_t intelfsh_device::read_full(uint32_t address) { - UINT32 data = 0; + uint32_t data = 0; address += m_bank << 16; switch( m_flash_mode ) { @@ -637,7 +637,7 @@ UINT32 intelfsh_device::read_full(UINT32 address) // bit-width-specific writers //------------------------------------------------- -void intelfsh_device::write_full(UINT32 address, UINT32 data) +void intelfsh_device::write_full(uint32_t address, uint32_t data) { //logerror( "intelflash_write( %u : %08x, %08x )\n", m_flash_mode, address, data ); @@ -858,7 +858,7 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data) { // sector erase // clear the 4k/64k block containing the current address to all 0xffs - UINT32 base = address * ((m_bits == 16) ? 2 : 1); + uint32_t base = address * ((m_bits == 16) ? 2 : 1); if (m_sector_is_4k) { memset(&m_data[base & ~0xfff], 0xff, 4 * 1024); @@ -969,7 +969,7 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data) if (m_type == FLASH_SST_28SF040) { // clear the 256 bytes block containing the current address to all 0xffs - UINT32 base = address * ((m_bits == 16) ? 2 : 1); + uint32_t base = address * ((m_bits == 16) ? 2 : 1); memset(&m_data[base & ~0xff], 0xff, 256); m_timer->adjust( attotime::from_msec( 4 ) ); @@ -984,7 +984,7 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data) // 40000-5ffff - 128KB main block // 60000-7ffff - 128KB main block // erase duration is 0.3s for boot and parameter blocks, and 0.6s for main blocks - UINT32 base = (address & 0x3ffff) * 2; + uint32_t base = (address & 0x3ffff) * 2; int size, duration; if (base < 0x4000) { @@ -1019,7 +1019,7 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data) else { // clear the 64k block containing the current address to all 0xffs - UINT32 base = address * ((m_bits == 16) ? 2 : 1); + uint32_t base = address * ((m_bits == 16) ? 2 : 1); memset(&m_data[base & ~0xffff], 0xff, 64 * 1024); m_timer->adjust( attotime::from_seconds( 1 ) ); diff --git a/src/devices/machine/intelfsh.h b/src/devices/machine/intelfsh.h index 44e54e8f32b..a222add0830 100644 --- a/src/devices/machine/intelfsh.h +++ b/src/devices/machine/intelfsh.h @@ -148,11 +148,11 @@ public: FLASH_SST_39VF400A }; - UINT8 *base() { return &m_data[0]; } + uint8_t *base() { return &m_data[0]; } protected: // construction/destruction - intelfsh_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); + intelfsh_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); protected: // device-level overrides @@ -165,32 +165,32 @@ protected: virtual void nvram_write(emu_file &file) override; // derived helpers - UINT32 read_full(UINT32 offset); - void write_full(UINT32 offset, UINT32 data); + uint32_t read_full(uint32_t offset); + void write_full(uint32_t offset, uint32_t data); optional_memory_region m_region; // configuration state - UINT32 m_type; - INT32 m_size; - UINT8 m_bits; - UINT32 m_addrmask; - UINT16 m_device_id; - UINT8 m_maker_id; + uint32_t m_type; + int32_t m_size; + uint8_t m_bits; + uint32_t m_addrmask; + uint16_t m_device_id; + uint8_t m_maker_id; bool m_sector_is_4k; bool m_sector_is_16k; bool m_top_boot_sector; - UINT8 m_page_size; + uint8_t m_page_size; // internal state - std::unique_ptr m_data; - UINT8 m_status; - INT32 m_erase_sector; - INT32 m_flash_mode; + std::unique_ptr m_data; + uint8_t m_status; + int32_t m_erase_sector; + int32_t m_flash_mode; bool m_flash_master_lock; emu_timer * m_timer; - INT32 m_bank; - UINT8 m_byte_count; + int32_t m_bank; + uint8_t m_byte_count; }; @@ -200,17 +200,17 @@ class intelfsh8_device : public intelfsh_device { protected: // construction/destruction - intelfsh8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); + intelfsh8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); public: // public interface - UINT8 read(offs_t offset) { return read_full(offset); } - void write(offs_t offset, UINT8 data) { write_full(offset, data); } + uint8_t read(offs_t offset) { return read_full(offset); } + void write(offs_t offset, uint8_t data) { write_full(offset, data); } DECLARE_READ8_MEMBER(read) { return read_full(offset); } DECLARE_WRITE8_MEMBER(write) { write_full(offset, data); } - UINT8 read_raw(offs_t offset) { return m_data[offset]; } - void write_raw(offs_t offset, UINT8 data) { m_data[offset] = data; } + uint8_t read_raw(offs_t offset) { return m_data[offset]; } + void write_raw(offs_t offset, uint8_t data) { m_data[offset] = data; } }; @@ -220,17 +220,17 @@ class intelfsh16_device : public intelfsh_device { protected: // construction/destruction - intelfsh16_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); + intelfsh16_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); public: // public interface - UINT16 read(offs_t offset) { return read_full(offset); } - void write(offs_t offset, UINT16 data) { write_full(offset, data); } + uint16_t read(offs_t offset) { return read_full(offset); } + void write(offs_t offset, uint16_t data) { write_full(offset, data); } DECLARE_READ16_MEMBER(read) { return read_full(offset); } DECLARE_WRITE16_MEMBER(write) { write_full(offset, data); } - UINT16 read_raw(offs_t offset) { return m_data[offset*2] | (m_data[offset*2+1] << 8); } - void write_raw(offs_t offset, UINT16 data) { m_data[offset*2] = data; m_data[offset*2+1] = data >> 8; } + uint16_t read_raw(offs_t offset) { return m_data[offset*2] | (m_data[offset*2+1] << 8); } + void write_raw(offs_t offset, uint16_t data) { m_data[offset*2] = data; m_data[offset*2+1] = data >> 8; } }; @@ -240,176 +240,176 @@ public: class intel_28f016s5_device : public intelfsh8_device { public: - intel_28f016s5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intel_28f016s5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fujitsu_29f160t_device : public intelfsh8_device { public: - fujitsu_29f160t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fujitsu_29f160t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fujitsu_29f016a_device : public intelfsh8_device { public: - fujitsu_29f016a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fujitsu_29f016a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fujitsu_29dl16x_device : public intelfsh8_device { public: - fujitsu_29dl16x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fujitsu_29dl16x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class atmel_29c010_device : public intelfsh8_device { public: - atmel_29c010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atmel_29c010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class amd_29f010_device : public intelfsh8_device { public: - amd_29f010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amd_29f010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class amd_29f040_device : public intelfsh8_device { public: - amd_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amd_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class amd_29f080_device : public intelfsh8_device { public: - amd_29f080_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amd_29f080_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class amd_29f400t_device : public intelfsh8_device { public: - amd_29f400t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amd_29f400t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class amd_29f800t_device : public intelfsh8_device { public: - amd_29f800t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amd_29f800t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class amd_29lv200t_device : public intelfsh8_device { public: - amd_29lv200t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amd_29lv200t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sharp_lh28f016s_device : public intelfsh8_device { public: - sharp_lh28f016s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sharp_lh28f016s_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sharp_lh28f016s_16bit_device : public intelfsh16_device { public: - sharp_lh28f016s_16bit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sharp_lh28f016s_16bit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class intel_e28f008sa_device : public intelfsh8_device { public: - intel_e28f008sa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intel_e28f008sa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class macronix_29l001mc_device : public intelfsh8_device { public: - macronix_29l001mc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + macronix_29l001mc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class macronix_29lv160tmc_device : public intelfsh8_device { public: - macronix_29lv160tmc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + macronix_29lv160tmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class panasonic_mn63f805mnp_device : public intelfsh8_device { public: - panasonic_mn63f805mnp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + panasonic_mn63f805mnp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sanyo_le26fv10n1ts_device : public intelfsh8_device { public: - sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sst_28sf040_device : public intelfsh8_device { public: - sst_28sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sst_28sf040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sst_39vf020_device : public intelfsh8_device { public: - sst_39vf020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sst_39vf020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms_29f040_device : public intelfsh8_device { public: - tms_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // 16-bit variants class sharp_lh28f400_device : public intelfsh16_device { public: - sharp_lh28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sharp_lh28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class intel_te28f160_device : public intelfsh16_device { public: - intel_te28f160_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intel_te28f160_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class intel_te28f320_device : public intelfsh16_device { public: - intel_te28f320_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intel_te28f320_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class intel_e28f400b_device : public intelfsh16_device { public: - intel_e28f400b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intel_e28f400b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sharp_unk128mbit_device : public intelfsh16_device { public: - sharp_unk128mbit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sharp_unk128mbit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class intel_28f320j3d_device : public intelfsh16_device { public: - intel_28f320j3d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intel_28f320j3d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class intel_28f320j5_device : public intelfsh16_device { public: - intel_28f320j5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + intel_28f320j5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class sst_39vf400a_device : public intelfsh16_device { public: - sst_39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sst_39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/machine/jvsdev.cpp b/src/devices/machine/jvsdev.cpp index c70f8a9fce6..6fb4fd76b18 100644 --- a/src/devices/machine/jvsdev.cpp +++ b/src/devices/machine/jvsdev.cpp @@ -9,7 +9,7 @@ void jvs_device::static_set_jvs_host_tag(device_t &device, const char *jvs_host_ jvsdev.jvs_host_tag = jvs_host_tag; } -jvs_device::jvs_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) +jvs_device::jvs_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), jvs_outputs(0), jvs_address(0), jvs_reset_counter(0) { jvs_host_tag = nullptr; @@ -21,17 +21,17 @@ const char *jvs_device::device_id() return ""; } -UINT8 jvs_device::command_format_version() +uint8_t jvs_device::command_format_version() { return 0x13; } -UINT8 jvs_device::jvs_standard_version() +uint8_t jvs_device::jvs_standard_version() { return 0x30; } -UINT8 jvs_device::comm_method_version() +uint8_t jvs_device::comm_method_version() { return 0x10; } @@ -44,7 +44,7 @@ void jvs_device::chain(jvs_device *dev) next_device = dev; } -void jvs_device::message(UINT8 dest, const UINT8 *send_buffer, UINT32 send_size, UINT8 *recv_buffer, UINT32 &recv_size) +void jvs_device::message(uint8_t dest, const uint8_t *send_buffer, uint32_t send_size, uint8_t *recv_buffer, uint32_t &recv_size) { recv_size = 0; @@ -63,8 +63,8 @@ void jvs_device::message(UINT8 dest, const UINT8 *send_buffer, UINT32 send_size, // dest=0xff is broadcast if(dest == 0xff || dest == jvs_address) { - const UINT8 *s = send_buffer; - UINT8 *d = recv_buffer; + const uint8_t *s = send_buffer; + uint8_t *d = recv_buffer; *d++ = 0x01; while(s < send_buffer + send_size) { int len = handle_message(s, send_size-(s-send_buffer), d); @@ -89,9 +89,9 @@ void jvs_device::message(UINT8 dest, const UINT8 *send_buffer, UINT32 send_size, next_device->message(dest, send_buffer, send_size, recv_buffer, recv_size); } -int jvs_device::handle_message(const UINT8 *send_buffer, UINT32 send_size, UINT8 *&recv_buffer) +int jvs_device::handle_message(const uint8_t *send_buffer, uint32_t send_size, uint8_t *&recv_buffer) { - UINT32 old_reset_counter = jvs_reset_counter; + uint32_t old_reset_counter = jvs_reset_counter; jvs_reset_counter = 0; switch(send_buffer[0]) { @@ -209,44 +209,44 @@ void jvs_device::device_reset() jvs_outputs = 0; } -void jvs_device::function_list(UINT8 *&buf) +void jvs_device::function_list(uint8_t *&buf) { } -bool jvs_device::coin_counters(UINT8 *&buf, UINT8 count) +bool jvs_device::coin_counters(uint8_t *&buf, uint8_t count) { return false; } -bool jvs_device::coin_add(UINT8 slot, INT32 count) +bool jvs_device::coin_add(uint8_t slot, int32_t count) { return false; } -bool jvs_device::switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switch) +bool jvs_device::switches(uint8_t *&buf, uint8_t count_players, uint8_t bytes_per_switch) { return false; } -bool jvs_device::analogs(UINT8 *&buf, UINT8 count) +bool jvs_device::analogs(uint8_t *&buf, uint8_t count) { return false; } -bool jvs_device::swoutputs(UINT8 count, const UINT8 *vals) +bool jvs_device::swoutputs(uint8_t count, const uint8_t *vals) { return false; } -bool jvs_device::swoutputs(UINT8 id, UINT8 val) +bool jvs_device::swoutputs(uint8_t id, uint8_t val) { return false; } -void jvs_device::handle_output(ioport_port *port, UINT8 id, UINT8 val) +void jvs_device::handle_output(ioport_port *port, uint8_t id, uint8_t val) { - UINT32 m = 1 << id; + uint32_t m = 1 << id; switch(val) { case 0: jvs_outputs &= ~m; break; case 1: jvs_outputs |= m; break; diff --git a/src/devices/machine/jvsdev.h b/src/devices/machine/jvsdev.h index 22a95e2b1a7..1cff880d8ea 100644 --- a/src/devices/machine/jvsdev.h +++ b/src/devices/machine/jvsdev.h @@ -13,17 +13,17 @@ class jvs_host; class jvs_device : public device_t { public: - jvs_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); + jvs_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_jvs_host_tag(device_t &device, const char *jvs_host_tag); void chain(jvs_device *dev); - void message(UINT8 dest, const UINT8 *send_buffer, UINT32 send_size, UINT8 *recv_buffer, UINT32 &recv_size); + void message(uint8_t dest, const uint8_t *send_buffer, uint32_t send_size, uint8_t *recv_buffer, uint32_t &recv_size); bool get_address_set_line(); protected: - UINT32 jvs_outputs; + uint32_t jvs_outputs; - void handle_output(ioport_port *port, UINT8 id, UINT8 val); + void handle_output(ioport_port *port, uint8_t id, uint8_t val); // device-level overrides virtual void device_start() override; @@ -31,24 +31,24 @@ protected: // JVS device overrides virtual const char *device_id(); - virtual UINT8 command_format_version(); - virtual UINT8 jvs_standard_version(); - virtual UINT8 comm_method_version(); - virtual void function_list(UINT8 *&buf); - virtual bool switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switch); - virtual bool coin_counters(UINT8 *&buf, UINT8 count); - virtual bool coin_add(UINT8 slot, INT32 count); - virtual bool analogs(UINT8 *&buf, UINT8 count); - virtual bool swoutputs(UINT8 count, const UINT8 *vals); - virtual bool swoutputs(UINT8 id, UINT8 val); + virtual uint8_t command_format_version(); + virtual uint8_t jvs_standard_version(); + virtual uint8_t comm_method_version(); + virtual void function_list(uint8_t *&buf); + virtual bool switches(uint8_t *&buf, uint8_t count_players, uint8_t bytes_per_switch); + virtual bool coin_counters(uint8_t *&buf, uint8_t count); + virtual bool coin_add(uint8_t slot, int32_t count); + virtual bool analogs(uint8_t *&buf, uint8_t count); + virtual bool swoutputs(uint8_t count, const uint8_t *vals); + virtual bool swoutputs(uint8_t id, uint8_t val); private: const char *jvs_host_tag; jvs_device *next_device; - UINT8 jvs_address; - UINT32 jvs_reset_counter; + uint8_t jvs_address; + uint32_t jvs_reset_counter; - int handle_message(const UINT8 *send_buffer, UINT32 send_size, UINT8 *&recv_buffer); + int handle_message(const uint8_t *send_buffer, uint32_t send_size, uint8_t *&recv_buffer); }; #endif diff --git a/src/devices/machine/jvshost.cpp b/src/devices/machine/jvshost.cpp index bca7f7c618c..fb8872751fb 100644 --- a/src/devices/machine/jvshost.cpp +++ b/src/devices/machine/jvshost.cpp @@ -28,13 +28,13 @@ void jvs_host::device_reset() memset(recv_buffer, 0, sizeof(recv_buffer)); } -jvs_host::jvs_host(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +jvs_host::jvs_host(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), send_size(0), recv_size(0), recv_is_encoded(false) { first_device = nullptr; } -void jvs_host::push(UINT8 val) +void jvs_host::push(uint8_t val) { send_buffer[send_size++] = val; } @@ -82,7 +82,7 @@ void jvs_host::commit_encoded() } -void jvs_host::get_raw_reply(const UINT8 *&buffer, UINT32 &size) +void jvs_host::get_raw_reply(const uint8_t *&buffer, uint32_t &size) { if(recv_is_encoded) { decode(recv_buffer, recv_size); @@ -92,7 +92,7 @@ void jvs_host::get_raw_reply(const UINT8 *&buffer, UINT32 &size) size = recv_size; } -void jvs_host::get_encoded_reply(const UINT8 *&buffer, UINT32 &size) +void jvs_host::get_encoded_reply(const uint8_t *&buffer, uint32_t &size) { if(!recv_is_encoded) { encode(recv_buffer, recv_size); @@ -113,20 +113,20 @@ bool jvs_host::get_address_set_line() } -void jvs_host::encode(UINT8 *buffer, UINT32 &size) +void jvs_host::encode(uint8_t *buffer, uint32_t &size) { if(!size) return; - UINT32 add = 1; - UINT8 sum = 0; - for(UINT32 i=0; i; // k033906_device - constructor //------------------------------------------------- -k033906_device::k033906_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k033906_device::k033906_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K033906, "K033906 PCI bridge", tag, owner, clock, "k033906", __FILE__) , m_reg_set(0) , m_voodoo(*this, finder_base::DUMMY_TAG) @@ -47,7 +47,7 @@ WRITE_LINE_MEMBER(k033906_device::set_reg) m_reg_set = state & 1; } -UINT32 k033906_device::reg_r(int reg) +uint32_t k033906_device::reg_r(int reg) { switch (reg) { @@ -63,7 +63,7 @@ UINT32 k033906_device::reg_r(int reg) //return 0; } -void k033906_device::reg_w(int reg, UINT32 data) +void k033906_device::reg_w(int reg, uint32_t data) { switch (reg) { diff --git a/src/devices/machine/k033906.h b/src/devices/machine/k033906.h index e493244ce81..20d4b076413 100644 --- a/src/devices/machine/k033906.h +++ b/src/devices/machine/k033906.h @@ -33,7 +33,7 @@ class k033906_device : public device_t { public: // construction/destruction - k033906_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k033906_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_voodoo_tag(device_t &device, const char *tag) { downcast(device).m_voodoo.set_tag(tag); } @@ -50,8 +50,8 @@ protected: private: - UINT32 reg_r(int reg); - void reg_w(int reg, UINT32 data); + uint32_t reg_r(int reg); + void reg_w(int reg, uint32_t data); /* i/o lines */ @@ -59,8 +59,8 @@ private: required_device m_voodoo; - UINT32 m_reg[256]; - UINT32 m_ram[32768]; + uint32_t m_reg[256]; + uint32_t m_ram[32768]; }; diff --git a/src/devices/machine/k053252.cpp b/src/devices/machine/k053252.cpp index b1fc225f022..bcd41295f9b 100644 --- a/src/devices/machine/k053252.cpp +++ b/src/devices/machine/k053252.cpp @@ -65,7 +65,7 @@ TODO: const device_type K053252 = &device_creator; -k053252_device::k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k053252_device::k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K053252, "K053252 Timing/Interrupt", tag, owner, clock, "k053252", __FILE__) , device_video_interface(mconfig, *this) , m_int1_en_cb(*this) diff --git a/src/devices/machine/k053252.h b/src/devices/machine/k053252.h index 54787a6ee78..577654559c8 100644 --- a/src/devices/machine/k053252.h +++ b/src/devices/machine/k053252.h @@ -34,7 +34,7 @@ class k053252_device : public device_t, public device_video_interface { public: - k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~k053252_device() {} template static devcb_base &set_int1_en_callback(device_t &device, _Object object) { return downcast(device).m_int1_en_cb.set_callback(object); } @@ -62,10 +62,10 @@ protected: private: // internal state - UINT8 m_regs[16]; - UINT16 m_hc,m_hfp,m_hbp; - UINT16 m_vc,m_vfp,m_vbp; - UINT8 m_vsw,m_hsw; + uint8_t m_regs[16]; + uint16_t m_hc,m_hfp,m_hbp; + uint16_t m_vc,m_vfp,m_vbp; + uint8_t m_vsw,m_hsw; devcb_write_line m_int1_en_cb; devcb_write_line m_int2_en_cb; diff --git a/src/devices/machine/k056230.cpp b/src/devices/machine/k056230.cpp index 6c143a02fb4..d666813951b 100644 --- a/src/devices/machine/k056230.cpp +++ b/src/devices/machine/k056230.cpp @@ -21,7 +21,7 @@ const device_type K056230 = &device_creator; // k056230_device - constructor //------------------------------------------------- -k056230_device::k056230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k056230_device::k056230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K056230, "K056230 LANC", tag, owner, clock, "k056230", __FILE__) , m_is_thunderh(0) , m_cpu(*this, finder_base::DUMMY_TAG) diff --git a/src/devices/machine/k056230.h b/src/devices/machine/k056230.h index 4fa8d165fd1..1b34ef40c5a 100644 --- a/src/devices/machine/k056230.h +++ b/src/devices/machine/k056230.h @@ -36,7 +36,7 @@ class k056230_device : public device_t { public: // construction/destruction - k056230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k056230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_cpu_tag(device_t &device, const char *tag) { downcast(device).m_cpu.set_tag(tag); } static void set_thunderh_hack(device_t &device, int thunderh) { downcast(device).m_is_thunderh = thunderh; } @@ -61,7 +61,7 @@ private: int m_is_thunderh; required_device m_cpu; - UINT32 m_ram[0x2000]; + uint32_t m_ram[0x2000]; }; diff --git a/src/devices/machine/kb3600.cpp b/src/devices/machine/kb3600.cpp index ca5fb5e7e76..fdb5f2ec429 100644 --- a/src/devices/machine/kb3600.cpp +++ b/src/devices/machine/kb3600.cpp @@ -42,7 +42,7 @@ const device_type AY3600 = &device_creator; // ay3600_device - constructor //------------------------------------------------- -ay3600_device::ay3600_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ay3600_device::ay3600_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AY3600, "AY-5-3600", tag, owner, clock, "ay3600", __FILE__), m_read_x0(*this), m_read_x1(*this), @@ -116,7 +116,7 @@ void ay3600_device::device_timer(emu_timer &timer, device_timer_id id, int param for (int x = 0; x < 9; x++) { - UINT16 data = 0; + uint16_t data = 0; switch(x) { @@ -191,9 +191,9 @@ void ay3600_device::device_timer(emu_timer &timer, device_timer_id id, int param // b_r - //------------------------------------------------- -UINT16 ay3600_device::b_r() +uint16_t ay3600_device::b_r() { - UINT16 data = m_b; + uint16_t data = m_b; m_write_data_ready(0); diff --git a/src/devices/machine/kb3600.h b/src/devices/machine/kb3600.h index 1d0529e7a0c..7b58d172301 100644 --- a/src/devices/machine/kb3600.h +++ b/src/devices/machine/kb3600.h @@ -101,10 +101,10 @@ class ay3600_device : public device_t { public: // construction/destruction - ay3600_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ay3600_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // public interface - UINT16 b_r(); + uint16_t b_r(); template static devcb_base &set_x0_cb(device_t &device, _Object rd) { return downcast(device).m_read_x0.set_callback(rd); } template static devcb_base &set_x1_cb(device_t &device, _Object rd) { return downcast(device).m_read_x1.set_callback(rd); } diff --git a/src/devices/machine/keyboard.cpp b/src/devices/machine/keyboard.cpp index d244bfc4d32..6347138c5f1 100644 --- a/src/devices/machine/keyboard.cpp +++ b/src/devices/machine/keyboard.cpp @@ -29,7 +29,7 @@ WRITE8_MEMBER( xxx_state::kbd_put ) namespace { -UINT8 const TRANSLATION_TABLE[][2][4][16] = { +uint8_t const TRANSLATION_TABLE[][2][4][16] = { { { // ANSI { '`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 0x08U, 0x7fU, 0x1bU }, @@ -247,7 +247,7 @@ generic_keyboard_device::generic_keyboard_device( char const *name, char const *tag, device_t *owner, - UINT32 clock, + uint32_t clock, char const *shortname, char const *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) @@ -260,7 +260,7 @@ generic_keyboard_device::generic_keyboard_device( } -generic_keyboard_device::generic_keyboard_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock) +generic_keyboard_device::generic_keyboard_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock) : generic_keyboard_device(mconfig, GENERIC_KEYBOARD, "Generic Keyboard", tag, owner, clock, "generic_keyboard", __FILE__) { } @@ -296,40 +296,40 @@ void generic_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, } -void generic_keyboard_device::key_make(UINT8 row, UINT8 column) +void generic_keyboard_device::key_make(uint8_t row, uint8_t column) { send_translated((row << 4) | column); typematic_start(row, column, typematic_delay(), typematic_period()); } -void generic_keyboard_device::key_repeat(UINT8 row, UINT8 column) +void generic_keyboard_device::key_repeat(uint8_t row, uint8_t column) { send_translated((row << 4) | column); } -void generic_keyboard_device::send_key(UINT8 code) +void generic_keyboard_device::send_key(uint8_t code) { m_keyboard_cb(offs_t(0), code); } -bool generic_keyboard_device::translate(UINT8 code, UINT8 &translated) const +bool generic_keyboard_device::translate(uint8_t code, uint8_t &translated) const { unsigned const row((code >> 4) & 0x03U); unsigned const col((code >> 0) & 0x0fU); unsigned const layout(m_config->read() & 0x0001U); - UINT16 const modifiers(m_modifiers->read()); + uint16_t const modifiers(m_modifiers->read()); bool const shift(bool(modifiers & 0x02U) != (bool(modifiers & 0x04U) && CAPS_TABLE[row][col])); bool const ctrl(modifiers & 0x01U); bool const meta(modifiers & 0x08U); unsigned const map(ctrl ? 2U : shift ? 1U : 0U); - UINT8 const result(TRANSLATION_TABLE[map][layout][row][col]); - if (result == UINT8(~0U)) + uint8_t const result(TRANSLATION_TABLE[map][layout][row][col]); + if (result == uint8_t(~0U)) { return false; } @@ -341,9 +341,9 @@ bool generic_keyboard_device::translate(UINT8 code, UINT8 &translated) const } -void generic_keyboard_device::will_scan_row(UINT8 row) +void generic_keyboard_device::will_scan_row(uint8_t row) { - UINT16 const modifiers(m_modifiers->read()); + uint16_t const modifiers(m_modifiers->read()); if (modifiers != m_last_modifiers) typematic_restart(typematic_delay(), typematic_period()); @@ -351,9 +351,9 @@ void generic_keyboard_device::will_scan_row(UINT8 row) } -void generic_keyboard_device::send_translated(UINT8 code) +void generic_keyboard_device::send_translated(uint8_t code) { - UINT8 translated; + uint8_t translated; if (translate(code, translated)) send_key(translated); } diff --git a/src/devices/machine/keyboard.h b/src/devices/machine/keyboard.h index 343c8991bcb..1d69996e564 100644 --- a/src/devices/machine/keyboard.h +++ b/src/devices/machine/keyboard.h @@ -36,7 +36,7 @@ INPUT_PORTS_EXTERN( generic_keyboard ); TYPE DECLARATIONS ***************************************************************************/ -template +template class device_matrix_keyboard_interface : public device_interface { protected: @@ -51,15 +51,15 @@ protected: void stop_processing(); void reset_key_state(); - void typematic_start(UINT8 row, UINT8 column, attotime const &delay, attotime const &interval); + void typematic_start(uint8_t row, uint8_t column, attotime const &delay, attotime const &interval); void typematic_restart(attotime const &delay, attotime const &interval); void typematic_stop(); - bool typematic_is(UINT8 row, UINT8 column) const { return (m_typematic_row == row) && (m_typematic_column == column); } + bool typematic_is(uint8_t row, uint8_t column) const { return (m_typematic_row == row) && (m_typematic_column == column); } - virtual void key_make(UINT8 row, UINT8 column) = 0; - virtual void key_repeat(UINT8 row, UINT8 column); - virtual void key_break(UINT8 row, UINT8 column); - virtual void will_scan_row(UINT8 row); + virtual void key_make(uint8_t row, uint8_t column) = 0; + virtual void key_repeat(uint8_t row, uint8_t column); + virtual void key_break(uint8_t row, uint8_t column); + virtual void will_scan_row(uint8_t row); bool are_all_keys_up(); @@ -76,10 +76,10 @@ private: emu_timer *m_typematic_timer; required_ioport m_key_rows[ROW_COUNT]; ioport_value m_key_states[ROW_COUNT]; - UINT8 m_next_row; - UINT8 m_processing; - UINT8 m_typematic_row; - UINT8 m_typematic_column; + uint8_t m_next_row; + uint8_t m_processing; + uint8_t m_typematic_row; + uint8_t m_typematic_column; }; @@ -92,14 +92,14 @@ public: char const *name, char const *tag, device_t *owner, - UINT32 clock, + uint32_t clock, char const *shortname, char const *source); generic_keyboard_device( const machine_config &mconfig, const char *tag, device_t *owner, - UINT32 clock); + uint32_t clock); template static devcb_base &set_keyboard_callback(device_t &device, Object object) { return downcast(device).m_keyboard_cb.set_callback(object); } @@ -109,23 +109,23 @@ 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 send_key(UINT8 code); - virtual bool translate(UINT8 code, UINT8 &translated) const; + virtual void key_make(uint8_t row, uint8_t column) override; + virtual void key_repeat(uint8_t row, uint8_t column) override; + virtual void send_key(uint8_t code); + virtual bool translate(uint8_t code, uint8_t &translated) const; required_ioport m_config; required_ioport m_modifiers; private: - virtual void will_scan_row(UINT8 row) override; + virtual void will_scan_row(uint8_t row) override; void typematic(); - void send_translated(UINT8 code); + void send_translated(uint8_t code); attotime typematic_delay() const; attotime typematic_period() const; - UINT16 m_last_modifiers; + uint16_t m_last_modifiers; devcb_write8 m_keyboard_cb; }; diff --git a/src/devices/machine/keyboard.ipp b/src/devices/machine/keyboard.ipp index b96954dd8bc..28681ba024d 100644 --- a/src/devices/machine/keyboard.ipp +++ b/src/devices/machine/keyboard.ipp @@ -15,7 +15,7 @@ #include -template +template template device_matrix_keyboard_interface::device_matrix_keyboard_interface(machine_config const &mconfig, device_t &device, T &&... tags) : device_interface(device, "matrix_keyboard") @@ -30,7 +30,7 @@ device_matrix_keyboard_interface::device_matrix_keyboard_interface(ma } -template +template void device_matrix_keyboard_interface::interface_pre_start() { m_scan_timer = device().timer_alloc(TIMER_ID_SCAN); @@ -40,7 +40,7 @@ void device_matrix_keyboard_interface::interface_pre_start() } -template +template void device_matrix_keyboard_interface::interface_post_start() { device().save_item(NAME(m_key_states)); @@ -51,7 +51,7 @@ void device_matrix_keyboard_interface::interface_post_start() } -template +template void device_matrix_keyboard_interface::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { switch (id) @@ -60,14 +60,14 @@ void device_matrix_keyboard_interface::device_timer(emu_timer &timer, scan_row(); break; case TIMER_ID_TYPEMATIC: - assert((m_typematic_row != UINT8(~0U)) || (m_typematic_column != UINT8(~0U))); + assert((m_typematic_row != uint8_t(~0U)) || (m_typematic_column != uint8_t(~0U))); key_repeat(m_typematic_row, m_typematic_column); break; } } -template +template void device_matrix_keyboard_interface::start_processing(const attotime &period) { m_processing = 1U; @@ -75,7 +75,7 @@ void device_matrix_keyboard_interface::start_processing(const attotim } -template +template void device_matrix_keyboard_interface::stop_processing() { m_scan_timer->reset(); @@ -83,7 +83,7 @@ void device_matrix_keyboard_interface::stop_processing() } -template +template void device_matrix_keyboard_interface::reset_key_state() { std::fill(std::begin(m_key_states), std::end(m_key_states), ioport_value(0U)); @@ -91,8 +91,8 @@ void device_matrix_keyboard_interface::reset_key_state() } -template -void device_matrix_keyboard_interface::typematic_start(UINT8 row, UINT8 column, attotime const &delay, attotime const &interval) +template +void device_matrix_keyboard_interface::typematic_start(uint8_t row, uint8_t column, attotime const &delay, attotime const &interval) { m_typematic_row = row; m_typematic_column = column; @@ -100,24 +100,24 @@ void device_matrix_keyboard_interface::typematic_start(UINT8 row, UIN } -template +template void device_matrix_keyboard_interface::typematic_restart(attotime const &delay, attotime const &interval) { - if ((m_typematic_row != UINT8(~0U)) || (m_typematic_column != UINT8(~0U))) + if ((m_typematic_row != uint8_t(~0U)) || (m_typematic_column != uint8_t(~0U))) m_typematic_timer->adjust(delay, 0, interval); } -template +template void device_matrix_keyboard_interface::typematic_stop() { - m_typematic_row = UINT8(~0U); - m_typematic_column = UINT8(~0U); + m_typematic_row = uint8_t(~0U); + m_typematic_column = uint8_t(~0U); m_typematic_timer->reset(); } -template +template void device_matrix_keyboard_interface::scan_row() { assert(m_next_row < ARRAY_LENGTH(m_key_rows)); @@ -130,7 +130,7 @@ void device_matrix_keyboard_interface::scan_row() ioport_value const change(state ^ keys); ioport_value mask(1U); - for (UINT8 column = 0U; m_processing && (state != keys); ++column, mask <<= 1) + for (uint8_t column = 0U; m_processing && (state != keys); ++column, mask <<= 1) { if (change & mask) { @@ -146,27 +146,27 @@ void device_matrix_keyboard_interface::scan_row() } -template -void device_matrix_keyboard_interface::key_repeat(UINT8 row, UINT8 column) +template +void device_matrix_keyboard_interface::key_repeat(uint8_t row, uint8_t column) { } -template -void device_matrix_keyboard_interface::key_break(UINT8 row, UINT8 column) +template +void device_matrix_keyboard_interface::key_break(uint8_t row, uint8_t column) { if (typematic_is(row, column)) typematic_stop(); } -template -void device_matrix_keyboard_interface::will_scan_row(UINT8 row) +template +void device_matrix_keyboard_interface::will_scan_row(uint8_t row) { } -template +template bool device_matrix_keyboard_interface::are_all_keys_up() { return 0U == std::accumulate( diff --git a/src/devices/machine/kr2376.cpp b/src/devices/machine/kr2376.cpp index 169a8b5f60d..8133143fd22 100644 --- a/src/devices/machine/kr2376.cpp +++ b/src/devices/machine/kr2376.cpp @@ -9,7 +9,7 @@ #include "emu.h" #include "kr2376.h" -static const UINT8 KR2376_KEY_CODES[3][8][11] = +static const uint8_t KR2376_KEY_CODES[3][8][11] = { // normal { @@ -66,7 +66,7 @@ static const UINT8 KR2376_KEY_CODES[3][8][11] = const device_type KR2376 = &device_creator; -kr2376_device::kr2376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +kr2376_device::kr2376_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, KR2376, "SMC KR2376", tag, owner, clock, "kr2376", __FILE__), m_write_strobe(*this) { diff --git a/src/devices/machine/kr2376.h b/src/devices/machine/kr2376.h index 080bfec4b90..d73ccfa4f58 100644 --- a/src/devices/machine/kr2376.h +++ b/src/devices/machine/kr2376.h @@ -54,7 +54,7 @@ enum kr2376_output_pin_t class kr2376_device : public device_t { public: - kr2376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kr2376_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~kr2376_device() {} template static devcb_base &set_strobe_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_strobe.set_callback(object); } diff --git a/src/devices/machine/laserdsc.cpp b/src/devices/machine/laserdsc.cpp index 40632fa42c6..6c20da364e4 100644 --- a/src/devices/machine/laserdsc.cpp +++ b/src/devices/machine/laserdsc.cpp @@ -31,21 +31,21 @@ //************************************************************************** // these specs code from IEC 60857, for NTSC players -const UINT32 LEAD_IN_MIN_RADIUS_IN_UM = 53500; // 53.5 mm -const UINT32 PROGRAM_MIN_RADIUS_IN_UM = 55000; // 55 mm -const UINT32 PROGRAM_MAX_RADIUS_IN_UM = 145000; // 145 mm -const UINT32 LEAD_OUT_MIN_SIZE_IN_UM = 2000; // 2 mm +const uint32_t LEAD_IN_MIN_RADIUS_IN_UM = 53500; // 53.5 mm +const uint32_t PROGRAM_MIN_RADIUS_IN_UM = 55000; // 55 mm +const uint32_t PROGRAM_MAX_RADIUS_IN_UM = 145000; // 145 mm +const uint32_t LEAD_OUT_MIN_SIZE_IN_UM = 2000; // 2 mm // the track pitch is defined as a range; we pick a nominal pitch // that ensures we can fit 54,000 tracks -//const UINT32 MIN_TRACK_PITCH_IN_NM = 1400; // 1.4 um -//const UINT32 MAX_TRACK_PITCH_IN_NM = 2000; // 2 um -const UINT32 NOMINAL_TRACK_PITCH_IN_NM = (PROGRAM_MAX_RADIUS_IN_UM - PROGRAM_MIN_RADIUS_IN_UM) * 1000 / 54000; +//const uint32_t MIN_TRACK_PITCH_IN_NM = 1400; // 1.4 um +//const uint32_t MAX_TRACK_PITCH_IN_NM = 2000; // 2 um +const uint32_t NOMINAL_TRACK_PITCH_IN_NM = (PROGRAM_MAX_RADIUS_IN_UM - PROGRAM_MIN_RADIUS_IN_UM) * 1000 / 54000; // we simulate extra lead-in and lead-out tracks -const UINT32 VIRTUAL_LEAD_IN_TRACKS = (PROGRAM_MIN_RADIUS_IN_UM - LEAD_IN_MIN_RADIUS_IN_UM) * 1000 / NOMINAL_TRACK_PITCH_IN_NM; -const UINT32 MAX_TOTAL_TRACKS = 54000; -const UINT32 VIRTUAL_LEAD_OUT_TRACKS = LEAD_OUT_MIN_SIZE_IN_UM * 1000 / NOMINAL_TRACK_PITCH_IN_NM; +const uint32_t VIRTUAL_LEAD_IN_TRACKS = (PROGRAM_MIN_RADIUS_IN_UM - LEAD_IN_MIN_RADIUS_IN_UM) * 1000 / NOMINAL_TRACK_PITCH_IN_NM; +const uint32_t MAX_TOTAL_TRACKS = 54000; +const uint32_t VIRTUAL_LEAD_OUT_TRACKS = LEAD_OUT_MIN_SIZE_IN_UM * 1000 / NOMINAL_TRACK_PITCH_IN_NM; @@ -57,7 +57,7 @@ const UINT32 VIRTUAL_LEAD_OUT_TRACKS = LEAD_OUT_MIN_SIZE_IN_UM * 1000 / NOMINAL_ // laserdisc_device - constructor //------------------------------------------------- -laserdisc_device::laserdisc_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) +laserdisc_device::laserdisc_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_sound_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -121,7 +121,7 @@ laserdisc_device::~laserdisc_device() // read from the disc //------------------------------------------------- -UINT32 laserdisc_device::get_field_code(laserdisc_field_code code, bool zero_if_squelched) +uint32_t laserdisc_device::get_field_code(laserdisc_field_code code, bool zero_if_squelched) { // return nothing if the video is off (external devices can't sense) if (zero_if_squelched && m_videosquelch) @@ -152,7 +152,7 @@ UINT32 laserdisc_device::get_field_code(laserdisc_field_code code, bool zero_if_ // screen_update - handle updating the screen //------------------------------------------------- -UINT32 laserdisc_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t laserdisc_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // handle the overlay if present screen_bitmap &overbitmap = m_overbitmap[m_overindex]; @@ -233,7 +233,7 @@ void laserdisc_device::static_set_audio(device_t &device, laserdisc_audio_delega // static_set_overlay - set the overlay parameters //------------------------------------------------- -void laserdisc_device::static_set_overlay(device_t &device, UINT32 width, UINT32 height, screen_update_ind16_delegate update) +void laserdisc_device::static_set_overlay(device_t &device, uint32_t width, uint32_t height, screen_update_ind16_delegate update) { laserdisc_device &ld = downcast(device); ld.m_overwidth = width; @@ -243,7 +243,7 @@ void laserdisc_device::static_set_overlay(device_t &device, UINT32 width, UINT32 ld.m_overupdate_rgb32 = screen_update_rgb32_delegate(); } -void laserdisc_device::static_set_overlay(device_t &device, UINT32 width, UINT32 height, screen_update_rgb32_delegate update) +void laserdisc_device::static_set_overlay(device_t &device, uint32_t width, uint32_t height, screen_update_rgb32_delegate update) { laserdisc_device &ld = downcast(device); ld.m_overwidth = width; @@ -259,7 +259,7 @@ void laserdisc_device::static_set_overlay(device_t &device, UINT32 width, UINT32 // memregion //------------------------------------------------- -void laserdisc_device::static_set_overlay_clip(device_t &device, INT32 minx, INT32 maxx, INT32 miny, INT32 maxy) +void laserdisc_device::static_set_overlay_clip(device_t &device, int32_t minx, int32_t maxx, int32_t miny, int32_t maxy) { downcast(device).m_overclip.set(minx, maxx, miny, maxy); } @@ -416,8 +416,8 @@ void laserdisc_device::device_timer(emu_timer &timer, device_timer_id id, int pa void laserdisc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { // compute AND values based on the squelch - INT16 leftand = (m_audiosquelch & 1) ? 0x0000 : 0xffff; - INT16 rightand = (m_audiosquelch & 2) ? 0x0000 : 0xffff; + int16_t leftand = (m_audiosquelch & 1) ? 0x0000 : 0xffff; + int16_t rightand = (m_audiosquelch & 2) ? 0x0000 : 0xffff; // see if we have enough samples to fill the buffer; if not, drop out int samples_avail = m_audiobufin - m_audiobufout; @@ -436,8 +436,8 @@ void laserdisc_device::sound_stream_update(sound_stream &stream, stream_sample_t // otherwise, stream from our buffer else { - INT16 *buffer0 = &m_audiobuffer[0][0]; - INT16 *buffer1 = &m_audiobuffer[1][0]; + int16_t *buffer0 = &m_audiobuffer[0][0]; + int16_t *buffer1 = &m_audiobuffer[1][0]; int sampout = m_audiobufout; // copy samples, clearing behind us as we go @@ -479,7 +479,7 @@ void laserdisc_device::sound_stream_update(sound_stream &stream, stream_sample_t // slider speed //------------------------------------------------- -void laserdisc_device::set_slider_speed(INT32 tracks_per_vsync) +void laserdisc_device::set_slider_speed(int32_t tracks_per_vsync) { // update to the current time update_slider_pos(); @@ -507,7 +507,7 @@ void laserdisc_device::set_slider_speed(INT32 tracks_per_vsync) // a certain number of tracks //------------------------------------------------- -void laserdisc_device::advance_slider(INT32 numtracks) +void laserdisc_device::advance_slider(int32_t numtracks) { // first update to the current time update_slider_pos(); @@ -550,9 +550,9 @@ laserdisc_device::slider_position laserdisc_device::get_slider_position() // that works for most situations //------------------------------------------------- -INT32 laserdisc_device::generic_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime, player_state_info &newstate) +int32_t laserdisc_device::generic_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime, player_state_info &newstate) { - INT32 advanceby = 0; + int32_t advanceby = 0; int frame; // start by assuming the state doesn't change @@ -688,7 +688,7 @@ INT32 laserdisc_device::generic_update(const vbi_metadata &vbi, int fieldnum, co // otherwise, if we got frame data from the VBI, update our seeking logic else if (m_player_state.m_substate == 0 && frame != FRAME_NOT_PRESENT) { - INT32 delta = (m_player_state.m_param - 2) - frame; + int32_t delta = (m_player_state.m_param - 2) - frame; // if we're within a couple of frames, just play until we hit it if (delta >= 0 && delta <= 2) @@ -772,7 +772,7 @@ void laserdisc_device::init_disc() throw emu_fatalerror("Laserdisc video must be interlaced!"); // determine the maximum track and allocate a frame buffer - UINT32 totalhunks = m_disc->hunk_count(); + uint32_t totalhunks = m_disc->hunk_count(); m_chdtracks = totalhunks / 2; // allocate memory for the precomputed per-frame metadata @@ -869,7 +869,7 @@ void laserdisc_device::init_audio() m_stream = stream_alloc(0, 2, 48000); // allocate audio buffers - m_audiomaxsamples = ((UINT64)m_samplerate * 1000000 + m_fps_times_1million - 1) / m_fps_times_1million; + m_audiomaxsamples = ((uint64_t)m_samplerate * 1000000 + m_fps_times_1million - 1) / m_fps_times_1million; m_audiobufsize = m_audiomaxsamples * 4; m_audiobuffer[0].resize(m_audiobufsize); m_audiobuffer[1].resize(m_audiobufsize); @@ -885,15 +885,15 @@ void laserdisc_device::init_audio() // given color pattern //------------------------------------------------- -void laserdisc_device::fillbitmap_yuy16(bitmap_yuy16 &bitmap, UINT8 yval, UINT8 cr, UINT8 cb) +void laserdisc_device::fillbitmap_yuy16(bitmap_yuy16 &bitmap, uint8_t yval, uint8_t cr, uint8_t cb) { - UINT16 color0 = (yval << 8) | cb; - UINT16 color1 = (yval << 8) | cr; + uint16_t color0 = (yval << 8) | cb; + uint16_t color1 = (yval << 8) | cr; // write 32 bits of color (2 pixels at a time) for (int y = 0; y < bitmap.height(); y++) { - UINT16 *dest = &bitmap.pix16(y); + uint16_t *dest = &bitmap.pix16(y); for (int x = 0; x < bitmap.width() / 2; x++) { *dest++ = color0; @@ -925,14 +925,14 @@ void laserdisc_device::update_slider_pos() // determine how many tracks we covered and advance if (m_attospertrack >= 0) { - INT32 tracks_covered = delta / m_attospertrack; + int32_t tracks_covered = delta / m_attospertrack; add_and_clamp_track(tracks_covered); if (tracks_covered != 0) m_sliderupdate += attotime(0, tracks_covered * m_attospertrack); } else { - INT32 tracks_covered = delta / -m_attospertrack; + int32_t tracks_covered = delta / -m_attospertrack; add_and_clamp_track(-tracks_covered); if (tracks_covered != 0) m_sliderupdate += attotime(0, tracks_covered * -m_attospertrack); @@ -986,10 +986,10 @@ laserdisc_device::frame_data &laserdisc_device::current_frame() void laserdisc_device::read_track_data() { // compute the chdhunk number we are going to read - INT32 chdtrack = m_curtrack - 1 - VIRTUAL_LEAD_IN_TRACKS; - chdtrack = (std::max)(chdtrack, 0); - chdtrack = (std::min)(chdtrack, m_chdtracks - 1); - UINT32 readhunk = chdtrack * 2 + m_fieldnum; + int32_t chdtrack = m_curtrack - 1 - VIRTUAL_LEAD_IN_TRACKS; + chdtrack = (std::max)(chdtrack, 0); + chdtrack = (std::min)(chdtrack, m_chdtracks - 1); + uint32_t readhunk = chdtrack * 2 + m_fieldnum; // cheat and look up the metadata we are about to retrieve vbi_metadata vbidata = { 0 }; @@ -1046,7 +1046,7 @@ void laserdisc_device::read_track_data() // set the VBI data for the new field from our precomputed data if (!m_vbidata.empty()) { - UINT32 vbiframe; + uint32_t vbiframe; vbi_metadata_unpack(&m_metadata[m_fieldnum], &vbiframe, &m_vbidata[readhunk * VBI_PACKED_BYTES]); } @@ -1118,7 +1118,7 @@ void laserdisc_device::process_track_data() if (m_avhuff_config.audio[chnum] == &m_audiobuffer[chnum][0]) { // move data to the end - UINT32 samplesleft = m_audiobufsize - m_audiobufin; + uint32_t samplesleft = m_audiobufsize - m_audiobufin; samplesleft = std::min(samplesleft, m_audiocursamples); memmove(&m_audiobuffer[chnum][m_audiobufin], &m_audiobuffer[chnum][0], samplesleft * 2); diff --git a/src/devices/machine/laserdsc.h b/src/devices/machine/laserdsc.h index 7816bfa2d21..ada53fdd4d0 100644 --- a/src/devices/machine/laserdsc.h +++ b/src/devices/machine/laserdsc.h @@ -115,7 +115,7 @@ class laserdisc_device; // delegates typedef delegate laserdisc_get_disc_delegate; -typedef delegate laserdisc_audio_delegate; +typedef delegate laserdisc_audio_delegate; // ======================> laserdisc_overlay_config @@ -140,7 +140,7 @@ class laserdisc_device : public device_t, { protected: // construction/destruction - laserdisc_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); + laserdisc_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 ~laserdisc_device(); public: @@ -149,14 +149,14 @@ public: // core control and status bool video_active() { return (!m_videosquelch && current_frame().m_numfields >= 2); } bitmap_yuy16 &get_video() { return (!video_active()) ? m_emptyframe : current_frame().m_visbitmap; } - UINT32 get_field_code(laserdisc_field_code code, bool zero_if_squelched); + uint32_t get_field_code(laserdisc_field_code code, bool zero_if_squelched); // video interface void video_enable(bool enable) { m_videoenable = enable; } void overlay_enable(bool enable) { m_overenable = enable; } // video update callback - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // configuration bool overlay_configured() const { return (m_overwidth > 0 && m_overheight > 0 && (!m_overupdate_ind16.isnull() || !m_overupdate_rgb32.isnull())); } @@ -166,9 +166,9 @@ public: // static configuration helpers static void static_set_get_disc(device_t &device, laserdisc_get_disc_delegate callback); static void static_set_audio(device_t &device, laserdisc_audio_delegate callback); - static void static_set_overlay(device_t &device, UINT32 width, UINT32 height, screen_update_ind16_delegate update); - static void static_set_overlay(device_t &device, UINT32 width, UINT32 height, screen_update_rgb32_delegate update); - static void static_set_overlay_clip(device_t &device, INT32 minx, INT32 maxx, INT32 miny, INT32 maxy); + static void static_set_overlay(device_t &device, uint32_t width, uint32_t height, screen_update_ind16_delegate update); + static void static_set_overlay(device_t &device, uint32_t width, uint32_t height, screen_update_rgb32_delegate update); + static void static_set_overlay_clip(device_t &device, int32_t minx, int32_t maxx, int32_t miny, int32_t maxy); static void static_set_overlay_position(device_t &device, float posx, float posy); static void static_set_overlay_scale(device_t &device, float scalex, float scaley); static void static_set_overlay_palette(device_t &device, const char *tag); @@ -228,14 +228,14 @@ protected: struct player_state_info { player_state m_state; // current state - INT32 m_substate; // internal sub-state; starts at 0 on any state change - INT32 m_param; // parameter for current state + int32_t m_substate; // internal sub-state; starts at 0 on any state change + int32_t m_param; // parameter for current state attotime m_endtime; // minimum ending time for current state }; // subclass overrides virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) = 0; - virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) = 0; + virtual int32_t player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) = 0; virtual void player_overlay(bitmap_yuy16 &bitmap) = 0; // device-level overrides @@ -251,10 +251,10 @@ protected: // subclass helpers void set_audio_squelch(bool squelchleft, bool squelchright) { m_stream->update(); m_audiosquelch = (squelchleft ? 1 : 0) | (squelchright ? 2 : 0); } void set_video_squelch(bool squelch) { m_videosquelch = squelch; } - void set_slider_speed(INT32 tracks_per_vsync); - void advance_slider(INT32 numtracks); + void set_slider_speed(int32_t tracks_per_vsync); + void advance_slider(int32_t numtracks); slider_position get_slider_position(); - INT32 generic_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime, player_state_info &curstate); + int32_t generic_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime, player_state_info &curstate); // general helpers bool is_start_of_frame(const vbi_metadata &vbi); @@ -270,16 +270,16 @@ private: { bitmap_yuy16 m_bitmap; // cached bitmap bitmap_yuy16 m_visbitmap; // wrapper around bitmap with only visible lines - UINT8 m_numfields; // number of fields in this frame - INT32 m_lastfield; // last absolute field number + uint8_t m_numfields; // number of fields in this frame + int32_t m_lastfield; // last absolute field number }; // internal helpers void init_disc(); void init_video(); void init_audio(); - void add_and_clamp_track(INT32 delta) { m_curtrack += delta; m_curtrack = std::max(m_curtrack, 1); m_curtrack = std::min(m_curtrack, INT32(m_maxtrack) - 1); } - void fillbitmap_yuy16(bitmap_yuy16 &bitmap, UINT8 yval, UINT8 cr, UINT8 cb); + void add_and_clamp_track(int32_t delta) { m_curtrack += delta; m_curtrack = std::max(m_curtrack, 1); m_curtrack = std::min(m_curtrack, int32_t(m_maxtrack) - 1); } + void fillbitmap_yuy16(bitmap_yuy16 &bitmap, uint8_t yval, uint8_t cr, uint8_t cb); void update_slider_pos(); void vblank_state_changed(screen_device &screen, bool vblank_state); frame_data ¤t_frame(); @@ -293,49 +293,49 @@ private: laserdisc_get_disc_delegate m_getdisc_callback; laserdisc_audio_delegate m_audio_callback; // audio streaming callback laserdisc_overlay_config m_orig_config; // original overlay configuration - UINT32 m_overwidth; // overlay screen width - UINT32 m_overheight; // overlay screen height + uint32_t m_overwidth; // overlay screen width + uint32_t m_overheight; // overlay screen height rectangle m_overclip; // overlay visarea screen_update_ind16_delegate m_overupdate_ind16; // overlay update delegate screen_update_rgb32_delegate m_overupdate_rgb32; // overlay update delegate // disc parameters chd_file * m_disc; // handle to the disc itself - std::vector m_vbidata; // pointer to precomputed VBI data + std::vector m_vbidata; // pointer to precomputed VBI data int m_width; // width of video int m_height; // height of video - UINT32 m_fps_times_1million; // frame rate of video + uint32_t m_fps_times_1million; // frame rate of video int m_samplerate; // audio samplerate int m_readresult; // result of the most recent read - UINT32 m_chdtracks; // number of tracks in the CHD + uint32_t m_chdtracks; // number of tracks in the CHD avhuff_decompress_config m_avhuff_config; // decompression configuration // async operations osd_work_queue * m_work_queue; // work queue - UINT32 m_queued_hunknum; // queued hunk + uint32_t m_queued_hunknum; // queued hunk // core states - UINT8 m_audiosquelch; // audio squelch state: bit 0 = audio 1, bit 1 = audio 2 - UINT8 m_videosquelch; // video squelch state: bit 0 = on/off - UINT8 m_fieldnum; // field number (0 or 1) - INT32 m_curtrack; // current track at this end of this vsync - UINT32 m_maxtrack; // maximum track number + uint8_t m_audiosquelch; // audio squelch state: bit 0 = audio 1, bit 1 = audio 2 + uint8_t m_videosquelch; // video squelch state: bit 0 = on/off + uint8_t m_fieldnum; // field number (0 or 1) + int32_t m_curtrack; // current track at this end of this vsync + uint32_t m_maxtrack; // maximum track number attoseconds_t m_attospertrack; // attoseconds per track, or 0 if not moving attotime m_sliderupdate; // time of last slider update // video data frame_data m_frame[3]; // circular list of frames - UINT8 m_videoindex; // index of the current video buffer + uint8_t m_videoindex; // index of the current video buffer bitmap_yuy16 m_emptyframe; // blank frame // audio data sound_stream * m_stream; - std::vector m_audiobuffer[2]; // buffer for audio samples - UINT32 m_audiobufsize; // size of buffer - UINT32 m_audiobufin; // input index - UINT32 m_audiobufout; // output index - UINT32 m_audiocursamples; // current samples this track - UINT32 m_audiomaxsamples; // maximum samples per track + std::vector m_audiobuffer[2]; // buffer for audio samples + uint32_t m_audiobufsize; // size of buffer + uint32_t m_audiobufin; // input index + uint32_t m_audiobufout; // output index + uint32_t m_audiocursamples; // current samples this track + uint32_t m_audiomaxsamples; // maximum samples per track // metadata vbi_metadata m_metadata[2]; // metadata parsed from the stream, for each field diff --git a/src/devices/machine/latch.cpp b/src/devices/machine/latch.cpp index 55aaf7dfeba..b6e04c6ec97 100644 --- a/src/devices/machine/latch.cpp +++ b/src/devices/machine/latch.cpp @@ -5,7 +5,7 @@ const device_type OUTPUT_LATCH = &device_creator; -output_latch_device::output_latch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +output_latch_device::output_latch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OUTPUT_LATCH, "Output Latch", tag, owner, clock, "output_latch", __FILE__), m_resolved(false), m_bit0(-1), @@ -39,7 +39,7 @@ void output_latch_device::device_start() save_item(NAME(m_bit7)); } -void output_latch_device::write(UINT8 data) +void output_latch_device::write(uint8_t data) { if (!m_resolved) { diff --git a/src/devices/machine/latch.h b/src/devices/machine/latch.h index 66e08614b66..d4e49ed838b 100644 --- a/src/devices/machine/latch.h +++ b/src/devices/machine/latch.h @@ -30,7 +30,7 @@ class output_latch_device : public device_t { public: - output_latch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + output_latch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_bit0_handler(device_t &device, _Object object) { return downcast(device).m_bit0_handler.set_callback(object); } template static devcb_base &set_bit1_handler(device_t &device, _Object object) { return downcast(device).m_bit1_handler.set_callback(object); } @@ -41,7 +41,7 @@ public: template static devcb_base &set_bit6_handler(device_t &device, _Object object) { return downcast(device).m_bit6_handler.set_callback(object); } template static devcb_base &set_bit7_handler(device_t &device, _Object object) { return downcast(device).m_bit7_handler.set_callback(object); } - void write(UINT8 data); + void write(uint8_t data); DECLARE_WRITE8_MEMBER(write) { write(data); } protected: diff --git a/src/devices/machine/latch8.cpp b/src/devices/machine/latch8.cpp index 9213f8e50c6..f201c6a95d1 100644 --- a/src/devices/machine/latch8.cpp +++ b/src/devices/machine/latch8.cpp @@ -11,16 +11,16 @@ #include "emu.h" #include "latch8.h" -void latch8_device::update(UINT8 new_val, UINT8 mask) +void latch8_device::update(uint8_t new_val, uint8_t mask) { - UINT8 old_val = m_value; + uint8_t old_val = m_value; m_value = (m_value & ~mask) | (new_val & mask); if (m_has_write) { int i; - UINT8 changed = old_val ^ m_value; + uint8_t changed = old_val ^ m_value; for (i=0; i<8; i++) if (((changed & (1<generic_space(), m_offset[i] , (m_value >> i) & 1); @@ -37,8 +37,8 @@ void latch8_device::update(UINT8 new_val, UINT8 mask) TIMER_CALLBACK_MEMBER( latch8_device::timerproc ) { - UINT8 new_val = param & 0xFF; - UINT8 mask = param >> 8; + uint8_t new_val = param & 0xFF; + uint8_t mask = param >> 8; update( new_val, mask); } @@ -47,7 +47,7 @@ TIMER_CALLBACK_MEMBER( latch8_device::timerproc ) READ8_MEMBER( latch8_device::read ) { - UINT8 res; + uint8_t res; assert(offset == 0); @@ -92,7 +92,7 @@ WRITE8_MEMBER( latch8_device::reset_w ) /* read bit x */ /* return (latch >> x) & 0x01 */ -UINT8 latch8_device::bitx_r( offs_t offset, int bit) +uint8_t latch8_device::bitx_r( offs_t offset, int bit) { assert( offset == 0); @@ -120,10 +120,10 @@ READ8_MEMBER( latch8_device::bit7_q_r) { return bitx_r(offset, 7) ^ 1; } /* write bit x from data into bit determined by offset */ /* latch = (latch & ~(1<> x) & 0x01) << offset) */ -void latch8_device::bitx_w(int bit, offs_t offset, UINT8 data) +void latch8_device::bitx_w(int bit, offs_t offset, uint8_t data) { - UINT8 mask = (1<> bit) & 0x01) << offset); + uint8_t mask = (1<> bit) & 0x01) << offset); assert( offset < 8); @@ -145,7 +145,7 @@ WRITE8_MEMBER( latch8_device::bit7_w ) { bitx_w(7, offset, data); } const device_type LATCH8 = &device_creator; -latch8_device::latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +latch8_device::latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LATCH8, "8 bit latch", tag, owner, clock, "latch8", __FILE__), m_value(0), m_has_write(0), diff --git a/src/devices/machine/latch8.h b/src/devices/machine/latch8.h index dce9ea6f87a..6d9ce374558 100644 --- a/src/devices/machine/latch8.h +++ b/src/devices/machine/latch8.h @@ -27,7 +27,7 @@ class latch8_device : public device_t { public: - latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); /* write & read full byte */ @@ -75,27 +75,27 @@ public: DECLARE_WRITE8_MEMBER( bit6_w ); DECLARE_WRITE8_MEMBER( bit7_w ); - static void set_maskout(device_t &device, UINT32 maskout) { downcast(device).m_maskout = maskout; } - static void set_xorvalue(device_t &device, UINT32 xorvalue) { downcast(device).m_xorvalue = xorvalue; } - static void set_nosync(device_t &device, UINT32 nosync) { downcast(device).m_nosync = nosync; } - - template static devcb_base &set_write_0(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[0] = offset; return downcast(device).m_write_0.set_callback(object); } - template static devcb_base &set_write_1(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[1] = offset; return downcast(device).m_write_1.set_callback(object); } - template static devcb_base &set_write_2(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[2] = offset; return downcast(device).m_write_2.set_callback(object); } - template static devcb_base &set_write_3(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[3] = offset; return downcast(device).m_write_3.set_callback(object); } - template static devcb_base &set_write_4(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[4] = offset; return downcast(device).m_write_4.set_callback(object); } - template static devcb_base &set_write_5(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[5] = offset; return downcast(device).m_write_5.set_callback(object); } - template static devcb_base &set_write_6(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[6] = offset; return downcast(device).m_write_6.set_callback(object); } - template static devcb_base &set_write_7(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[7] = offset; return downcast(device).m_write_7.set_callback(object); } - - template static devcb_base &set_read_0(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[0] = offset; return downcast(device).m_read_0.set_callback(object); } - template static devcb_base &set_read_1(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[1] = offset; return downcast(device).m_read_1.set_callback(object); } - template static devcb_base &set_read_2(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[2] = offset; return downcast(device).m_read_2.set_callback(object); } - template static devcb_base &set_read_3(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[3] = offset; return downcast(device).m_read_3.set_callback(object); } - template static devcb_base &set_read_4(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[4] = offset; return downcast(device).m_read_4.set_callback(object); } - template static devcb_base &set_read_5(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[5] = offset; return downcast(device).m_read_5.set_callback(object); } - template static devcb_base &set_read_6(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[6] = offset; return downcast(device).m_read_6.set_callback(object); } - template static devcb_base &set_read_7(device_t &device, _Object object, UINT32 offset) { downcast(device).m_offset[7] = offset; return downcast(device).m_read_7.set_callback(object); } + static void set_maskout(device_t &device, uint32_t maskout) { downcast(device).m_maskout = maskout; } + static void set_xorvalue(device_t &device, uint32_t xorvalue) { downcast(device).m_xorvalue = xorvalue; } + static void set_nosync(device_t &device, uint32_t nosync) { downcast(device).m_nosync = nosync; } + + template static devcb_base &set_write_0(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[0] = offset; return downcast(device).m_write_0.set_callback(object); } + template static devcb_base &set_write_1(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[1] = offset; return downcast(device).m_write_1.set_callback(object); } + template static devcb_base &set_write_2(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[2] = offset; return downcast(device).m_write_2.set_callback(object); } + template static devcb_base &set_write_3(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[3] = offset; return downcast(device).m_write_3.set_callback(object); } + template static devcb_base &set_write_4(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[4] = offset; return downcast(device).m_write_4.set_callback(object); } + template static devcb_base &set_write_5(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[5] = offset; return downcast(device).m_write_5.set_callback(object); } + template static devcb_base &set_write_6(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[6] = offset; return downcast(device).m_write_6.set_callback(object); } + template static devcb_base &set_write_7(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[7] = offset; return downcast(device).m_write_7.set_callback(object); } + + template static devcb_base &set_read_0(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[0] = offset; return downcast(device).m_read_0.set_callback(object); } + template static devcb_base &set_read_1(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[1] = offset; return downcast(device).m_read_1.set_callback(object); } + template static devcb_base &set_read_2(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[2] = offset; return downcast(device).m_read_2.set_callback(object); } + template static devcb_base &set_read_3(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[3] = offset; return downcast(device).m_read_3.set_callback(object); } + template static devcb_base &set_read_4(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[4] = offset; return downcast(device).m_read_4.set_callback(object); } + template static devcb_base &set_read_5(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[5] = offset; return downcast(device).m_read_5.set_callback(object); } + template static devcb_base &set_read_6(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[6] = offset; return downcast(device).m_read_6.set_callback(object); } + template static devcb_base &set_read_7(device_t &device, _Object object, uint32_t offset) { downcast(device).m_offset[7] = offset; return downcast(device).m_read_7.set_callback(object); } protected: // device-level overrides @@ -104,19 +104,19 @@ protected: virtual void device_validity_check(validity_checker &valid) const override; TIMER_CALLBACK_MEMBER( timerproc ); - void update(UINT8 new_val, UINT8 mask); - inline UINT8 bitx_r( offs_t offset, int bit); - inline void bitx_w(int bit, offs_t offset, UINT8 data); + void update(uint8_t new_val, uint8_t mask); + inline uint8_t bitx_r( offs_t offset, int bit); + inline void bitx_w(int bit, offs_t offset, uint8_t data); private: // internal state - UINT8 m_value; - UINT8 m_has_write; - UINT8 m_has_read; + uint8_t m_value; + uint8_t m_has_write; + uint8_t m_has_read; /* only for byte reads, does not affect bit reads and node_map */ - UINT32 m_maskout; - UINT32 m_xorvalue; /* after mask */ - UINT32 m_nosync; + uint32_t m_maskout; + uint32_t m_xorvalue; /* after mask */ + uint32_t m_nosync; devcb_write8 m_write_0; devcb_write8 m_write_1; @@ -136,7 +136,7 @@ private: devcb_read8 m_read_6; devcb_read8 m_read_7; - UINT32 m_offset[8]; + uint32_t m_offset[8]; }; extern const device_type LATCH8; diff --git a/src/devices/machine/lc89510.cpp b/src/devices/machine/lc89510.cpp index 9ad9f4cb37a..daa1498085f 100644 --- a/src/devices/machine/lc89510.cpp +++ b/src/devices/machine/lc89510.cpp @@ -11,7 +11,7 @@ const device_type LC89510 = &device_creator; -lc89510_device::lc89510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lc89510_device::lc89510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LC89510, "lc89510_device", tag, owner, clock, "lc89510", __FILE__) { } diff --git a/src/devices/machine/lc89510.h b/src/devices/machine/lc89510.h index 0d7ebedcf71..a254a40928b 100644 --- a/src/devices/machine/lc89510.h +++ b/src/devices/machine/lc89510.h @@ -6,7 +6,7 @@ class lc89510_device : public device_t { public: - lc89510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lc89510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/devices/machine/ldp1000.cpp b/src/devices/machine/ldp1000.cpp index 5e04009b1fa..2c9e8535a34 100644 --- a/src/devices/machine/ldp1000.cpp +++ b/src/devices/machine/ldp1000.cpp @@ -38,7 +38,7 @@ const device_type SONY_LDP1000 = &device_creator; // ldp1000_device - constructor //------------------------------------------------- -sony_ldp1000_device::sony_ldp1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sony_ldp1000_device::sony_ldp1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : laserdisc_device(mconfig, SONY_LDP1000, "Sony LDP-1000", tag, owner, clock, "ldp1000", __FILE__) { } @@ -104,7 +104,7 @@ void sony_ldp1000_device::player_vsync(const vbi_metadata &vbi, int fieldnum, co // the first visible line of the frame //------------------------------------------------- -INT32 sony_ldp1000_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) +int32_t sony_ldp1000_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { //printf("%d update\n",fieldnum); @@ -118,7 +118,7 @@ INT32 sony_ldp1000_device::player_update(const vbi_metadata &vbi, int fieldnum, READ8_MEMBER( sony_ldp1000_device::status_r ) { - UINT8 res = m_status; + uint8_t res = m_status; m_status = stat_undef; return res; } @@ -131,7 +131,7 @@ void sony_ldp1000_device::set_new_player_state(ldp1000_player_state which) } // TODO: probably don't even need a size ... -void sony_ldp1000_device::set_new_player_bcd(UINT8 data) +void sony_ldp1000_device::set_new_player_bcd(uint8_t data) { m_internal_bcd[m_index_state] = data; m_index_state ++; @@ -141,9 +141,9 @@ void sony_ldp1000_device::set_new_player_bcd(UINT8 data) m_status = stat_ack; } -UINT32 sony_ldp1000_device::bcd_to_raw() +uint32_t sony_ldp1000_device::bcd_to_raw() { - UINT32 res = 0; + uint32_t res = 0; for(int i=0;i<6;i++) res |= (m_internal_bcd[i] & 0xf) << i*4; return res; @@ -151,7 +151,7 @@ UINT32 sony_ldp1000_device::bcd_to_raw() void sony_ldp1000_device::exec_enter_cmd() { - //const UINT32 saved_frame = bcd_to_raw(); + //const uint32_t saved_frame = bcd_to_raw(); switch(m_player_state) { diff --git a/src/devices/machine/ldp1000.h b/src/devices/machine/ldp1000.h index 6d6f94a62c3..e5fc53f0d7e 100644 --- a/src/devices/machine/ldp1000.h +++ b/src/devices/machine/ldp1000.h @@ -34,7 +34,7 @@ class sony_ldp1000_device : public laserdisc_device { public: // construction/destruction - sony_ldp1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sony_ldp1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations TODO: both actually protected DECLARE_WRITE8_MEMBER( command_w ); @@ -48,7 +48,7 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; - virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; + virtual int32_t player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; virtual void player_overlay(bitmap_yuy16 &bitmap) override { } enum ldp1000_status { @@ -68,17 +68,17 @@ protected: }; private: - UINT8 m_command; + uint8_t m_command; ldp1000_status m_status; ldp1000_player_state m_player_state; bool m_audio_enable[2]; // TODO: sub-class into a specific internal player state void set_new_player_state(ldp1000_player_state which); - void set_new_player_bcd(UINT8 data); - UINT32 bcd_to_raw(); + void set_new_player_bcd(uint8_t data); + uint32_t bcd_to_raw(); void exec_enter_cmd(); - UINT8 m_internal_bcd[0x10]; - UINT8 m_index_state; + uint8_t m_internal_bcd[0x10]; + uint8_t m_index_state; }; diff --git a/src/devices/machine/ldp1450.cpp b/src/devices/machine/ldp1450.cpp index 2abf465f074..f30a154f013 100644 --- a/src/devices/machine/ldp1450.cpp +++ b/src/devices/machine/ldp1450.cpp @@ -45,7 +45,7 @@ const device_type SONY_LDP1450 = &device_creator; // ldp1450_device - constructor //------------------------------------------------- -sony_ldp1450_device::sony_ldp1450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sony_ldp1450_device::sony_ldp1450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : laserdisc_device(mconfig, SONY_LDP1450, "Sony LDP-1450", tag, owner, clock, "ldp1450", __FILE__) { } @@ -115,7 +115,7 @@ void sony_ldp1450_device::player_vsync(const vbi_metadata &vbi, int fieldnum, co // the first visible line of the frame //------------------------------------------------- -INT32 sony_ldp1450_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) +int32_t sony_ldp1450_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { //printf("%d update\n",fieldnum); @@ -133,7 +133,7 @@ void sony_ldp1450_device::set_new_player_state(ldp1450_player_state which) m_index_state = 0; } -void sony_ldp1450_device::set_new_player_bcd(UINT8 data) +void sony_ldp1450_device::set_new_player_bcd(uint8_t data) { printf("Frame data BCD %02x\n",data); @@ -145,9 +145,9 @@ void sony_ldp1450_device::set_new_player_bcd(UINT8 data) m_status = LDP_STAT_ACK; } -UINT32 sony_ldp1450_device::bcd_to_raw() +uint32_t sony_ldp1450_device::bcd_to_raw() { - UINT32 res = 0; + uint32_t res = 0; for(int i=0;i<6;i++) res |= (m_internal_bcd[i] & 0xf) << i*4; return res; @@ -155,7 +155,7 @@ UINT32 sony_ldp1450_device::bcd_to_raw() void sony_ldp1450_device::exec_enter_cmd() { - const UINT32 saved_frame = bcd_to_raw(); + const uint32_t saved_frame = bcd_to_raw(); switch(m_player_state) { @@ -175,7 +175,7 @@ void sony_ldp1450_device::exec_enter_cmd() m_player_state = player_standby; } -void sony_ldp1450_device::command_w(UINT8 data) +void sony_ldp1450_device::command_w(uint8_t data) { printf("CMD %02x\n",data); m_command = data; @@ -327,7 +327,7 @@ void sony_ldp1450_device::command_w(UINT8 data) break; case 0x60: /* Addr Inq (get current frame number) */ - for (UINT8 & elem : m_internal_bcd) + for (uint8_t & elem : m_internal_bcd) { printf("Return frame %02x\n",elem); m_status = elem; diff --git a/src/devices/machine/ldp1450.h b/src/devices/machine/ldp1450.h index 9380ede4cfd..efeefcfa044 100644 --- a/src/devices/machine/ldp1450.h +++ b/src/devices/machine/ldp1450.h @@ -33,11 +33,11 @@ class sony_ldp1450_device : public laserdisc_device { public: // construction/destruction - sony_ldp1450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sony_ldp1450_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations TODO: both actually protected - void command_w(UINT8 data); - UINT8 status_r() const { return m_status; } + void command_w(uint8_t data); + uint8_t status_r() const { return m_status; } protected: // device-level overrides @@ -47,14 +47,14 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; - virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; + virtual int32_t player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; virtual void player_overlay(bitmap_yuy16 &bitmap) override { } - UINT8 m_ld_frame_index; - UINT8 m_ld_frame[5]; - UINT8 m_ld_command_current_byte; - UINT8 m_ld_command_to_send[5]; - UINT8 m_ld_command_total_bytes; + uint8_t m_ld_frame_index; + uint8_t m_ld_frame[5]; + uint8_t m_ld_command_current_byte; + uint8_t m_ld_command_to_send[5]; + uint8_t m_ld_command_total_bytes; enum LD_INPUT_STATE { @@ -77,16 +77,16 @@ protected: }; private: - UINT8 m_command; - UINT8 m_status; + uint8_t m_command; + uint8_t m_status; ldp1450_player_state m_player_state; bool m_audio_enable[2]; void set_new_player_state(ldp1450_player_state which); - void set_new_player_bcd(UINT8 data); - UINT32 bcd_to_raw(); + void set_new_player_bcd(uint8_t data); + uint32_t bcd_to_raw(); void exec_enter_cmd(); - UINT8 m_internal_bcd[0x10]; - UINT8 m_index_state; + uint8_t m_internal_bcd[0x10]; + uint8_t m_index_state; }; diff --git a/src/devices/machine/ldpr8210.cpp b/src/devices/machine/ldpr8210.cpp index 12518a3ded9..e90b2df40e1 100644 --- a/src/devices/machine/ldpr8210.cpp +++ b/src/devices/machine/ldpr8210.cpp @@ -73,7 +73,7 @@ const device_type SIMUTREK_SPECIAL = &device_creator; // bitmaps for the characters -static const UINT8 text_bitmap[0x40][7] = +static const uint8_t text_bitmap[0x40][7] = { { 0 }, // @ { 0x20,0x50,0x88,0x88,0xf8,0x88,0x88 }, // A @@ -179,7 +179,7 @@ ROM_END // pioneer_pr8210_device - constructor //------------------------------------------------- -pioneer_pr8210_device::pioneer_pr8210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pioneer_pr8210_device::pioneer_pr8210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : laserdisc_device(mconfig, PIONEER_PR8210, "Pioneer PR-8210", tag, owner, clock, "pr8210", __FILE__), m_control(0), m_lastcommand(0), @@ -195,7 +195,7 @@ pioneer_pr8210_device::pioneer_pr8210_device(const machine_config &mconfig, cons { } -pioneer_pr8210_device::pioneer_pr8210_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) +pioneer_pr8210_device::pioneer_pr8210_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) : laserdisc_device(mconfig, type, name, tag, owner, clock, shortname, source), m_control(0), m_lastcommand(0), @@ -217,10 +217,10 @@ pioneer_pr8210_device::pioneer_pr8210_device(const machine_config &mconfig, devi // line is toggled //------------------------------------------------- -void pioneer_pr8210_device::control_w(UINT8 data) +void pioneer_pr8210_device::control_w(uint8_t data) { // set the new value and remember the last - UINT8 prev = m_control; + uint8_t prev = m_control; m_control = data; // handle rising edge @@ -258,7 +258,7 @@ void pioneer_pr8210_device::control_w(UINT8 data) if ((m_accumulator & 0x383) == 0x80) { // data is stored to the PIA in bit-reverse order - UINT8 newcommand = (m_accumulator >> 2) & 0x1f; + uint8_t newcommand = (m_accumulator >> 2) & 0x1f; m_pia.porta = BITSWAP8(newcommand, 0,1,2,3,4,5,6,7); // the MCU logic requires a 0 to execute many commands; however, nobody @@ -328,7 +328,7 @@ void pioneer_pr8210_device::device_timer(emu_timer &timer, device_timer_id id, i // logging if (LOG_VBLANK_VBI) { - UINT32 line1718 = get_field_code(LASERDISC_CODE_LINE1718, FALSE); + uint32_t line1718 = get_field_code(LASERDISC_CODE_LINE1718, FALSE); if ((line1718 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE) printf("%3d:VBI(%05d)\n", screen().vpos(), VBI_CAV_PICTURE(line1718)); else @@ -340,8 +340,8 @@ void pioneer_pr8210_device::device_timer(emu_timer &timer, device_timer_id id, i m_pia.vbi2 = 0xff; if (focus_on() && laser_on()) { - UINT32 line16 = get_field_code(LASERDISC_CODE_LINE16, FALSE); - UINT32 line1718 = get_field_code(LASERDISC_CODE_LINE1718, FALSE); + uint32_t line16 = get_field_code(LASERDISC_CODE_LINE16, FALSE); + uint32_t line1718 = get_field_code(LASERDISC_CODE_LINE1718, FALSE); if (line1718 == VBI_CODE_LEADIN) m_pia.vbi1 &= ~0x01; if (line1718 == VBI_CODE_LEADOUT) @@ -432,7 +432,7 @@ void pioneer_pr8210_device::player_vsync(const vbi_metadata &vbi, int fieldnum, // first visible line of the frame //------------------------------------------------- -INT32 pioneer_pr8210_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) +int32_t pioneer_pr8210_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { // logging if (LOG_VBLANK_VBI) @@ -481,7 +481,7 @@ void pioneer_pr8210_device::player_overlay(bitmap_yuy16 &bitmap) READ8_MEMBER( pioneer_pr8210_device::i8049_pia_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; switch (offset) { // (20-26) 7 characters for the chapter/frame @@ -529,7 +529,7 @@ READ8_MEMBER( pioneer_pr8210_device::i8049_pia_r ) WRITE8_MEMBER( pioneer_pr8210_device::i8049_pia_w ) { - UINT8 value; + uint8_t value; switch (offset) { // (20-30) 17 characters for the display @@ -611,7 +611,7 @@ READ8_MEMBER( pioneer_pr8210_device::i8049_bus_r ) $01 = (in) SLOW TIMER OUT */ - UINT8 result = 0x00; + uint8_t result = 0x00; // bus bit 6: slider position limit detector, inside and outside slider_position sliderpos = get_slider_position(); @@ -656,7 +656,7 @@ WRITE8_MEMBER( pioneer_pr8210_device::i8049_port1_w ) */ // set the new value - UINT8 prev = m_i8049_port1; + uint8_t prev = m_i8049_port1; m_i8049_port1 = data; // bit 7 selects the direction of slider movement for JUMP TRG and scanning @@ -713,7 +713,7 @@ WRITE8_MEMBER( pioneer_pr8210_device::i8049_port2_w ) */ // set the new value - UINT8 prev = m_i8049_port2; + uint8_t prev = m_i8049_port2; m_i8049_port2 = data; // on the falling edge of bit 5, start the slow timer @@ -756,7 +756,7 @@ READ8_MEMBER( pioneer_pr8210_device::i8049_t1_r ) // characters //------------------------------------------------- -void pioneer_pr8210_device::overlay_draw_group(bitmap_yuy16 &bitmap, const UINT8 *text, int count, float xstart) +void pioneer_pr8210_device::overlay_draw_group(bitmap_yuy16 &bitmap, const uint8_t *text, int count, float xstart) { // rease the background overlay_erase(bitmap, xstart, xstart + ((OVERLAY_X_PIXELS + 1) * count + 1) * OVERLAY_PIXEL_WIDTH); @@ -779,19 +779,19 @@ void pioneer_pr8210_device::overlay_draw_group(bitmap_yuy16 &bitmap, const UINT8 void pioneer_pr8210_device::overlay_erase(bitmap_yuy16 &bitmap, float xstart, float xend) { - UINT32 xmin = (UINT32)(xstart * 256.0f * float(bitmap.width())); - UINT32 xmax = (UINT32)(xend * 256.0f * float(bitmap.width())); + uint32_t xmin = (uint32_t)(xstart * 256.0f * float(bitmap.width())); + uint32_t xmax = (uint32_t)(xend * 256.0f * float(bitmap.width())); - for (UINT32 y = OVERLAY_Y; y < (OVERLAY_Y + (OVERLAY_Y_PIXELS + 2) * OVERLAY_PIXEL_HEIGHT); y++) + for (uint32_t y = OVERLAY_Y; y < (OVERLAY_Y + (OVERLAY_Y_PIXELS + 2) * OVERLAY_PIXEL_HEIGHT); y++) { - UINT16 *dest = &bitmap.pix16(y, xmin >> 8); - UINT16 ymax = *dest >> 8; - UINT16 ymin = ymax * 3 / 8; - UINT16 yres = ymin + ((ymax - ymin) * (xmin & 0xff)) / 256; + uint16_t *dest = &bitmap.pix16(y, xmin >> 8); + uint16_t ymax = *dest >> 8; + uint16_t ymin = ymax * 3 / 8; + uint16_t yres = ymin + ((ymax - ymin) * (xmin & 0xff)) / 256; *dest = (yres << 8) | (*dest & 0xff); dest++; - for (UINT32 x = (xmin | 0xff) + 1; x < xmax; x += 0x100) + for (uint32_t x = (xmin | 0xff) + 1; x < xmax; x += 0x100) { yres = (*dest >> 8) * 3 / 8; *dest = (yres << 8) | (*dest & 0xff); @@ -812,32 +812,32 @@ void pioneer_pr8210_device::overlay_erase(bitmap_yuy16 &bitmap, float xstart, fl // of the text overlay //------------------------------------------------- -void pioneer_pr8210_device::overlay_draw_char(bitmap_yuy16 &bitmap, UINT8 ch, float xstart) +void pioneer_pr8210_device::overlay_draw_char(bitmap_yuy16 &bitmap, uint8_t ch, float xstart) { - UINT32 xminbase = (UINT32)(xstart * 256.0f * float(bitmap.width())); - UINT32 xsize = (UINT32)(OVERLAY_PIXEL_WIDTH * 256.0f * float(bitmap.width())); + uint32_t xminbase = (uint32_t)(xstart * 256.0f * float(bitmap.width())); + uint32_t xsize = (uint32_t)(OVERLAY_PIXEL_WIDTH * 256.0f * float(bitmap.width())); // iterate over pixels - const UINT8 *chdataptr = &text_bitmap[ch & 0x3f][0]; - for (UINT32 y = 0; y < OVERLAY_Y_PIXELS; y++) + const uint8_t *chdataptr = &text_bitmap[ch & 0x3f][0]; + for (uint32_t y = 0; y < OVERLAY_Y_PIXELS; y++) { - UINT8 chdata = *chdataptr++; + uint8_t chdata = *chdataptr++; - for (UINT32 x = 0; x < OVERLAY_X_PIXELS; x++, chdata <<= 1) + for (uint32_t x = 0; x < OVERLAY_X_PIXELS; x++, chdata <<= 1) if (chdata & 0x80) { - UINT32 xmin = xminbase + x * xsize; - UINT32 xmax = xmin + xsize; - for (UINT32 yy = 0; yy < OVERLAY_PIXEL_HEIGHT; yy++) + uint32_t xmin = xminbase + x * xsize; + uint32_t xmax = xmin + xsize; + for (uint32_t yy = 0; yy < OVERLAY_PIXEL_HEIGHT; yy++) { - UINT16 *dest = &bitmap.pix16(OVERLAY_Y + (y + 1) * OVERLAY_PIXEL_HEIGHT + yy, xmin >> 8); - UINT16 ymax = 0xff; - UINT16 ymin = *dest >> 8; - UINT16 yres = ymin + ((ymax - ymin) * (~xmin & 0xff)) / 256; + uint16_t *dest = &bitmap.pix16(OVERLAY_Y + (y + 1) * OVERLAY_PIXEL_HEIGHT + yy, xmin >> 8); + uint16_t ymax = 0xff; + uint16_t ymin = *dest >> 8; + uint16_t yres = ymin + ((ymax - ymin) * (~xmin & 0xff)) / 256; *dest = (yres << 8) | (*dest & 0xff); dest++; - for (UINT32 xx = (xmin | 0xff) + 1; xx < xmax; xx += 0x100) + for (uint32_t xx = (xmin | 0xff) + 1; xx < xmax; xx += 0x100) *dest++ = 0xf080; ymax = 0xff; @@ -889,7 +889,7 @@ ROM_END // simutrek_special_device - constructor //------------------------------------------------- -simutrek_special_device::simutrek_special_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +simutrek_special_device::simutrek_special_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pioneer_pr8210_device(mconfig, SIMUTREK_SPECIAL, "Simutrek Modified PR-8210", tag, owner, clock, "simutrek", __FILE__), m_i8748_cpu(*this, "simutrek"), m_audio_squelch(0), @@ -907,7 +907,7 @@ simutrek_special_device::simutrek_special_device(const machine_config &mconfig, // port is written to //------------------------------------------------- -void simutrek_special_device::data_w(UINT8 data) +void simutrek_special_device::data_w(uint8_t data) { synchronize(TID_LATCH_DATA, data); if (LOG_SIMUTREK) @@ -1055,7 +1055,7 @@ READ8_MEMBER( simutrek_special_device::i8748_port2_r ) WRITE8_MEMBER( simutrek_special_device::i8748_port2_w ) { // update stat - UINT8 prev = m_i8748_port2; + uint8_t prev = m_i8748_port2; m_i8748_port2 = data; // bit $20 goes to the serial line diff --git a/src/devices/machine/ldpr8210.h b/src/devices/machine/ldpr8210.h index 3cca97ce7b7..b16c0ffb64b 100644 --- a/src/devices/machine/ldpr8210.h +++ b/src/devices/machine/ldpr8210.h @@ -45,15 +45,15 @@ extern const device_type SIMUTREK_SPECIAL; class pioneer_pia { public: - UINT8 frame[7]; // (20-26) 7 characters for the chapter/frame - UINT8 text[17]; // (20-30) 17 characters for the display - UINT8 control; // (40) control lines - UINT8 latchdisplay; // flag: set if the display was latched - UINT8 portb; // (60) port B value (LEDs) - UINT8 display; // (80) display enable - UINT8 porta; // (A0) port A value (from serial decoder) - UINT8 vbi1; // (C0) VBI decoding state 1 - UINT8 vbi2; // (E0) VBI decoding state 2 + uint8_t frame[7]; // (20-26) 7 characters for the chapter/frame + uint8_t text[17]; // (20-30) 17 characters for the display + uint8_t control; // (40) control lines + uint8_t latchdisplay; // flag: set if the display was latched + uint8_t portb; // (60) port B value (LEDs) + uint8_t display; // (80) display enable + uint8_t porta; // (A0) port A value (from serial decoder) + uint8_t vbi1; // (C0) VBI decoding state 1 + uint8_t vbi2; // (E0) VBI decoding state 2 }; @@ -64,11 +64,11 @@ class pioneer_pr8210_device : public laserdisc_device { public: // construction/destruction - pioneer_pr8210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - pioneer_pr8210_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); + pioneer_pr8210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + pioneer_pr8210_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); // input and output - void control_w(UINT8 data); + void control_w(uint8_t data); protected: // timer IDs @@ -88,7 +88,7 @@ protected: // subclass overrides virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; - virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; + virtual int32_t player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; virtual void player_overlay(bitmap_yuy16 &bitmap) override; // internal helpers @@ -111,14 +111,14 @@ public: protected: // internal overlay helpers - void overlay_draw_group(bitmap_yuy16 &bitmap, const UINT8 *text, int count, float xstart); + void overlay_draw_group(bitmap_yuy16 &bitmap, const uint8_t *text, int count, float xstart); void overlay_erase(bitmap_yuy16 &bitmap, float xstart, float xend); - void overlay_draw_char(bitmap_yuy16 &bitmap, UINT8 ch, float xstart); + void overlay_draw_char(bitmap_yuy16 &bitmap, uint8_t ch, float xstart); // internal state - UINT8 m_control; // control line state - UINT8 m_lastcommand; // last command seen - UINT16 m_accumulator; // bit accumulator + uint8_t m_control; // control line state + uint8_t m_lastcommand; // last command seen + uint16_t m_accumulator; // bit accumulator attotime m_lastcommandtime; // time of the last command attotime m_lastbittime; // time of last bit received attotime m_firstbittime; // time of first bit in command @@ -128,8 +128,8 @@ protected: attotime m_slowtrg; // time of the last SLOW TRG pioneer_pia m_pia; // PIA state bool m_vsync; // live VSYNC state - UINT8 m_i8049_port1; // 8049 port 1 state - UINT8 m_i8049_port2; // 8049 port 2 state + uint8_t m_i8049_port1; // 8049 port 1 state + uint8_t m_i8049_port2; // 8049 port 2 state }; @@ -139,12 +139,12 @@ class simutrek_special_device : public pioneer_pr8210_device { public: // construction/destruction - simutrek_special_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + simutrek_special_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // input and output - void data_w(UINT8 data); - UINT8 ready_r() const { return !m_data_ready; } - UINT8 status_r() const { return ((m_i8748_port2 & 0x03) == 0x03) ? ASSERT_LINE : CLEAR_LINE; } + void data_w(uint8_t data); + uint8_t ready_r() const { return !m_data_ready; } + uint8_t status_r() const { return ((m_i8748_port2 & 0x03) == 0x03) ? ASSERT_LINE : CLEAR_LINE; } // external controls void set_external_audio_squelch(int state); @@ -181,12 +181,12 @@ public: protected: // internal state required_device m_i8748_cpu; - UINT8 m_audio_squelch; // audio squelch value - UINT8 m_data; // parallel data for simutrek + uint8_t m_audio_squelch; // audio squelch value + uint8_t m_data; // parallel data for simutrek bool m_data_ready; // ready flag for simutrek data - UINT8 m_i8748_port2; // 8748 port 2 state - UINT8 m_controlnext; // latch to control next pair of fields - UINT8 m_controlthis; // latched value for our control over the current pair of fields + uint8_t m_i8748_port2; // 8748 port 2 state + uint8_t m_controlnext; // latch to control next pair of fields + uint8_t m_controlthis; // latched value for our control over the current pair of fields }; diff --git a/src/devices/machine/ldstub.h b/src/devices/machine/ldstub.h index e7ffe1898cd..41d638f42ae 100644 --- a/src/devices/machine/ldstub.h +++ b/src/devices/machine/ldstub.h @@ -46,20 +46,20 @@ class pioneer_pr7820_device : public laserdisc_device { public: // construction/destruction - pioneer_pr7820_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + pioneer_pr7820_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : laserdisc_device(mconfig, PIONEER_PR7820, "Pioneer PR-7820", tag, owner, clock, "pr7820", __FILE__) { } // input/output - UINT8 data_available_r() { return CLEAR_LINE; } - UINT8 ready_r() { return ASSERT_LINE; } - UINT8 data_r() { return 0; } - void data_w(UINT8 data) { } - void enter_w(UINT8 data) { } + uint8_t data_available_r() { return CLEAR_LINE; } + uint8_t ready_r() { return ASSERT_LINE; } + uint8_t data_r() { return 0; } + void data_w(uint8_t data) { } + void enter_w(uint8_t data) { } protected: // subclass overrides virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override { } - virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override { return fieldnum; } + virtual int32_t player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override { return fieldnum; } virtual void player_overlay(bitmap_yuy16 &bitmap) override { } }; @@ -70,18 +70,18 @@ class phillips_22vp932_device : public laserdisc_device { public: // construction/destruction - phillips_22vp932_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + phillips_22vp932_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : laserdisc_device(mconfig, PHILLIPS_22VP932, "Phillips 22VP932", tag, owner, clock, "22vp932", __FILE__) { } // input/output - UINT8 data_r() { return 0; } - void data_w(UINT8 data) { } - void enter_w(UINT8 data) { } + uint8_t data_r() { return 0; } + void data_w(uint8_t data) { } + void enter_w(uint8_t data) { } protected: // subclass overrides virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override { } - virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override { return fieldnum; } + virtual int32_t player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override { return fieldnum; } virtual void player_overlay(bitmap_yuy16 &bitmap) override { } }; diff --git a/src/devices/machine/ldv1000.cpp b/src/devices/machine/ldv1000.cpp index 81947c2b73f..e1b4f8e1a70 100644 --- a/src/devices/machine/ldv1000.cpp +++ b/src/devices/machine/ldv1000.cpp @@ -121,7 +121,7 @@ ROM_END // pioneer_ldv1000_device - constructor //------------------------------------------------- -pioneer_ldv1000_device::pioneer_ldv1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pioneer_ldv1000_device::pioneer_ldv1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : laserdisc_device(mconfig, PIONEER_LDV1000, "Pioneer LD-V1000", tag, owner, clock, "ldv1000", __FILE__), m_z80_cpu(*this, "ldv1000"), m_z80_ctc(*this, "ldvctc"), @@ -148,7 +148,7 @@ pioneer_ldv1000_device::pioneer_ldv1000_device(const machine_config &mconfig, co // LD-V1000 //------------------------------------------------- -void pioneer_ldv1000_device::data_w(UINT8 data) +void pioneer_ldv1000_device::data_w(uint8_t data) { m_command = data; if (LOG_COMMANDS) @@ -160,7 +160,7 @@ void pioneer_ldv1000_device::data_w(UINT8 data) // enter_w - set the state of the ENTER strobe //------------------------------------------------- -void pioneer_ldv1000_device::enter_w(UINT8 data) +void pioneer_ldv1000_device::enter_w(uint8_t data) { } @@ -234,7 +234,7 @@ void pioneer_ldv1000_device::device_timer(emu_timer &timer, device_timer_id id, case TID_VBI_DATA_FETCH: { // appears to return data in reverse order - UINT32 lines[3]; + uint32_t lines[3]; lines[0] = get_field_code(LASERDISC_CODE_LINE1718, false); lines[1] = get_field_code(LASERDISC_CODE_LINE17, false); lines[2] = get_field_code(LASERDISC_CODE_LINE16, false); @@ -246,8 +246,8 @@ void pioneer_ldv1000_device::device_timer(emu_timer &timer, device_timer_id id, // loop over lines for (int line = 0; line < 3; line++) { - UINT8 *dest = &m_vbi[line * 7]; - UINT32 data = lines[line]; + uint8_t *dest = &m_vbi[line * 7]; + uint32_t data = lines[line]; // the logic only processes leadin/leadout/frame number codes if (data == VBI_CODE_LEADIN || data == VBI_CODE_LEADOUT || (data & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE) @@ -328,7 +328,7 @@ void pioneer_ldv1000_device::player_vsync(const vbi_metadata &vbi, int fieldnum, // the first visible line of the frame //------------------------------------------------- -INT32 pioneer_ldv1000_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) +int32_t pioneer_ldv1000_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { if (LOG_FRAMES_SEEN) { @@ -389,7 +389,7 @@ WRITE8_MEMBER( pioneer_ldv1000_device::z80_decoder_display_port_w ) READ8_MEMBER( pioneer_ldv1000_device::z80_decoder_display_port_r ) { // reads from offset 3 constitute actual reads from the display and decoder chips - UINT8 result = 0; + uint8_t result = 0; if (offset == 3) { // selection 4 represents the VBI data reading @@ -411,7 +411,7 @@ READ8_MEMBER( pioneer_ldv1000_device::z80_decoder_display_port_r ) READ8_MEMBER( pioneer_ldv1000_device::z80_controller_r ) { // note that this is a cheesy implementation; the real thing relies on exquisite timing - UINT8 result = m_command ^ 0xff; + uint8_t result = m_command ^ 0xff; m_command = 0xff; return result; } @@ -467,7 +467,7 @@ READ8_MEMBER( pioneer_ldv1000_device::ppi0_portc_r ) $80 = DUMP (N20-1) -- code reads the state and waits for it to change */ - UINT8 result = 0x00; + uint8_t result = 0x00; if (!m_vsync) result |= 0x10; if (!m_vbiready) @@ -491,7 +491,7 @@ WRITE8_MEMBER( pioneer_ldv1000_device::ppi0_portc_w ) */ // set the new value - UINT8 prev = m_portc0; + uint8_t prev = m_portc0; m_portc0 = data; if (LOG_PORT_IO && ((data ^ prev) & 0x0f) != 0) { @@ -531,7 +531,7 @@ READ8_MEMBER( pioneer_ldv1000_device::ppi1_porta_r ) */ slider_position sliderpos = get_slider_position(); - UINT8 result = 0x00; + uint8_t result = 0x00; // bit 0: /FOCUS LOCK if (!focus_on()) @@ -581,7 +581,7 @@ WRITE8_MEMBER( pioneer_ldv1000_device::ppi1_portb_w ) */ // set the new value - UINT8 prev = m_portb1; + uint8_t prev = m_portb1; m_portb1 = data; if (LOG_PORT_IO && ((data ^ prev) & 0xff) != 0) { @@ -635,7 +635,7 @@ WRITE8_MEMBER( pioneer_ldv1000_device::ppi1_portc_w ) */ // set the new value - UINT8 prev = m_portc1; + uint8_t prev = m_portc1; m_portc1 = data; if (LOG_PORT_IO && ((data ^ prev) & 0xcf) != 0) { diff --git a/src/devices/machine/ldv1000.h b/src/devices/machine/ldv1000.h index 0ea017d4214..ea543159a33 100644 --- a/src/devices/machine/ldv1000.h +++ b/src/devices/machine/ldv1000.h @@ -51,16 +51,16 @@ class pioneer_ldv1000_device : public laserdisc_device { public: // construction/destruction - pioneer_ldv1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pioneer_ldv1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_command_strobe_callback(_cmd_strobe_cb latch) { m_command_strobe_cb.set_callback(latch); } // input and output - void data_w(UINT8 data); - void enter_w(UINT8 data); - UINT8 status_r() const { return m_status; } - UINT8 status_strobe_r() const { return (m_portc1 & 0x20) ? ASSERT_LINE : CLEAR_LINE; } - UINT8 command_strobe_r() const { return (m_portc1 & 0x10) ? ASSERT_LINE : CLEAR_LINE; } + void data_w(uint8_t data); + void enter_w(uint8_t data); + uint8_t status_r() const { return m_status; } + uint8_t status_strobe_r() const { return (m_portc1 & 0x20) ? ASSERT_LINE : CLEAR_LINE; } + uint8_t command_strobe_r() const { return (m_portc1 & 0x10) ? ASSERT_LINE : CLEAR_LINE; } protected: // timer IDs @@ -80,7 +80,7 @@ protected: // subclass overrides virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; - virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; + virtual int32_t player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; virtual void player_overlay(bitmap_yuy16 &bitmap) override { } // internal helpers @@ -111,24 +111,24 @@ protected: devcb_write_line m_command_strobe_cb; /* communication status */ - UINT8 m_command; /* command byte to the player */ - UINT8 m_status; /* status byte from the player */ + uint8_t m_command; /* command byte to the player */ + uint8_t m_status; /* status byte from the player */ bool m_vsync; /* VSYNC state */ /* I/O port states */ - UINT8 m_counter_start; /* starting value for counter */ - UINT8 m_counter; /* current counter value */ - UINT8 m_portc0; /* port C on PPI 0 */ - UINT8 m_portb1; /* port B on PPI 1 */ - UINT8 m_portc1; /* port C on PPI 1 */ + uint8_t m_counter_start; /* starting value for counter */ + uint8_t m_counter; /* current counter value */ + uint8_t m_portc0; /* port C on PPI 0 */ + uint8_t m_portb1; /* port B on PPI 1 */ + uint8_t m_portc1; /* port C on PPI 1 */ /* display/decode circuit emulation */ - UINT8 m_portselect; /* selection of which port to access */ - UINT8 m_display[2][20]; /* display lines */ - UINT8 m_dispindex; /* index within the display line */ - UINT8 m_vbi[7*3]; /* VBI data */ + uint8_t m_portselect; /* selection of which port to access */ + uint8_t m_display[2][20]; /* display lines */ + uint8_t m_dispindex; /* index within the display line */ + uint8_t m_vbi[7*3]; /* VBI data */ bool m_vbiready; /* VBI ready flag */ - UINT8 m_vbiindex; /* index within the VBI data */ + uint8_t m_vbiindex; /* index within the VBI data */ }; diff --git a/src/devices/machine/ldvp931.cpp b/src/devices/machine/ldvp931.cpp index 712f70c2b2e..d2d445f3336 100644 --- a/src/devices/machine/ldvp931.cpp +++ b/src/devices/machine/ldvp931.cpp @@ -86,7 +86,7 @@ ROM_END // phillips_22vp931_device - constructor //------------------------------------------------- -phillips_22vp931_device::phillips_22vp931_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +phillips_22vp931_device::phillips_22vp931_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : laserdisc_device(mconfig, PHILLIPS_22VP931, "Phillips 22VP931", tag, owner, clock, "22vp931", __FILE__), m_i8049_cpu(*this, "vp931"), m_tracktimer(nullptr), @@ -112,7 +112,7 @@ phillips_22vp931_device::phillips_22vp931_device(const machine_config &mconfig, // reset_w - write to the reset line //------------------------------------------------- -void phillips_22vp931_device::reset_w(UINT8 data) +void phillips_22vp931_device::reset_w(uint8_t data) { // control the CPU state m_i8049_cpu->set_input_line(INPUT_LINE_RESET, data); @@ -128,7 +128,7 @@ void phillips_22vp931_device::reset_w(UINT8 data) // 22VP931 //------------------------------------------------- -UINT8 phillips_22vp931_device::data_r() +uint8_t phillips_22vp931_device::data_r() { // if data is pending, clear the pending flag and notify any callbacks if (m_tocontroller_pending) @@ -200,9 +200,9 @@ void phillips_22vp931_device::device_timer(emu_timer &timer, device_timer_id id, { case TID_VBI_DATA_FETCH: { - UINT32 line = param >> 2; + uint32_t line = param >> 2; int which = param & 3; - UINT32 code = 0; + uint32_t code = 0; // fetch the code and compute the DATIC latched value if (line >= LASERDISC_CODE_LINE16 && line <= LASERDISC_CODE_LINE18) @@ -323,7 +323,7 @@ void phillips_22vp931_device::player_vsync(const vbi_metadata &vbi, int fieldnum // the first visible line of the frame //------------------------------------------------- -INT32 phillips_22vp931_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) +int32_t phillips_22vp931_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { // set the first VBI timer to go at the start of line 16 timer_set(screen().time_until_pos(16*2), TID_VBI_DATA_FETCH, LASERDISC_CODE_LINE16 << 2); @@ -389,7 +389,7 @@ WRITE8_MEMBER( phillips_22vp931_device::i8049_output1_w ) $01 = OSM */ - INT32 speed; + int32_t speed; if (LOG_PORTS && (m_i8049_out1 ^ data) & 0x08) { @@ -518,7 +518,7 @@ READ8_MEMBER( phillips_22vp931_device::i8049_port1_r ) $20 = P15 = (in) D105 */ - UINT8 result = 0x00; + uint8_t result = 0x00; if (!m_daticerp) result |= 0x40; return result; @@ -608,7 +608,7 @@ READ8_MEMBER( phillips_22vp931_device::i8049_port2_r ) $10 = P24 = (in) D124 -> 0 when data from controller is present, reset to 1 on a read */ - UINT8 result = 0x00; + uint8_t result = 0x00; if (!m_tocontroller_pending) result |= 0x20; if (!m_fromcontroller_pending) diff --git a/src/devices/machine/ldvp931.h b/src/devices/machine/ldvp931.h index b35fa988039..c6445e06510 100644 --- a/src/devices/machine/ldvp931.h +++ b/src/devices/machine/ldvp931.h @@ -48,14 +48,14 @@ public: typedef delegate data_ready_delegate; // construction/destruction - phillips_22vp931_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + phillips_22vp931_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // input and output - void data_w(UINT8 data) { synchronize(TID_DEFERRED_DATA, data); } - void reset_w(UINT8 data); - UINT8 data_r(); - UINT8 ready_r() { return m_fromcontroller_pending ? CLEAR_LINE : ASSERT_LINE; } - UINT8 data_available_r() { return m_tocontroller_pending ? ASSERT_LINE : CLEAR_LINE; } + void data_w(uint8_t data) { synchronize(TID_DEFERRED_DATA, data); } + void reset_w(uint8_t data); + uint8_t data_r(); + uint8_t ready_r() { return m_fromcontroller_pending ? CLEAR_LINE : ASSERT_LINE; } + uint8_t data_available_r() { return m_tocontroller_pending ? ASSERT_LINE : CLEAR_LINE; } // configuration void set_data_ready_callback(data_ready_delegate callback) { m_data_ready = callback; } @@ -81,7 +81,7 @@ protected: // subclass overrides virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; - virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; + virtual int32_t player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; virtual void player_overlay(bitmap_yuy16 &bitmap) override { } public: @@ -108,30 +108,30 @@ protected: data_ready_delegate m_data_ready; // data ready callback // I/O port states - UINT8 m_i8049_out0; // output 0 state - UINT8 m_i8049_out1; // output 1 state - UINT8 m_i8049_port1; // port 1 state + uint8_t m_i8049_out0; // output 0 state + uint8_t m_i8049_out1; // output 1 state + uint8_t m_i8049_port1; // port 1 state // DATIC circuit implementation - UINT8 m_daticval; // latched DATIC value - UINT8 m_daticerp; // /ERP value from DATIC - UINT8 m_datastrobe; // DATA STROBE line from DATIC + uint8_t m_daticval; // latched DATIC value + uint8_t m_daticerp; // /ERP value from DATIC + uint8_t m_datastrobe; // DATA STROBE line from DATIC // communication status - UINT8 m_reset_state; // state of the reset input - UINT8 m_fromcontroller; // command byte from the controller + uint8_t m_reset_state; // state of the reset input + uint8_t m_fromcontroller; // command byte from the controller bool m_fromcontroller_pending; // true if data is pending - UINT8 m_tocontroller; // command byte to the controller + uint8_t m_tocontroller; // command byte to the controller bool m_tocontroller_pending; // true if data is pending // tracking - INT8 m_trackdir; // direction of tracking - UINT8 m_trackstate; // state of tracking + int8_t m_trackdir; // direction of tracking + uint8_t m_trackstate; // state of tracking // debugging - UINT8 m_cmdbuf[3]; // 3 bytes worth of commands - UINT8 m_cmdcount; // number of command bytes seen - INT16 m_advanced; // number of frames advanced + uint8_t m_cmdbuf[3]; // 3 bytes worth of commands + uint8_t m_cmdcount; // number of command bytes seen + int16_t m_advanced; // number of frames advanced }; diff --git a/src/devices/machine/legscsi.cpp b/src/devices/machine/legscsi.cpp index 133fdd393b2..9b86bb0d111 100644 --- a/src/devices/machine/legscsi.cpp +++ b/src/devices/machine/legscsi.cpp @@ -2,7 +2,7 @@ // copyright-holders:smf #include "legscsi.h" -legacy_scsi_host_adapter::legacy_scsi_host_adapter(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +legacy_scsi_host_adapter::legacy_scsi_host_adapter(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_selected(0) , m_scsi_port(*this, finder_base::DUMMY_TAG) @@ -38,7 +38,7 @@ bool legacy_scsi_host_adapter::select(int id) return false; } -void legacy_scsi_host_adapter::send_command(UINT8 *data, int bytes) +void legacy_scsi_host_adapter::send_command(uint8_t *data, int bytes) { scsihle_device *scsidev = get_device(m_selected); if (scsidev != nullptr) @@ -84,7 +84,7 @@ int legacy_scsi_host_adapter::get_phase(void) } } -void legacy_scsi_host_adapter::read_data(UINT8 *data, int bytes) +void legacy_scsi_host_adapter::read_data(uint8_t *data, int bytes) { scsihle_device *scsidev = get_device(m_selected); if (scsidev != nullptr) @@ -97,7 +97,7 @@ void legacy_scsi_host_adapter::read_data(UINT8 *data, int bytes) } } -void legacy_scsi_host_adapter::write_data(UINT8 *data, int bytes) +void legacy_scsi_host_adapter::write_data(uint8_t *data, int bytes) { scsihle_device *scsidev = get_device(m_selected); if (scsidev != nullptr) @@ -110,7 +110,7 @@ void legacy_scsi_host_adapter::write_data(UINT8 *data, int bytes) } } -UINT8 legacy_scsi_host_adapter::get_status() +uint8_t legacy_scsi_host_adapter::get_status() { scsihle_device *scsidev = get_device(m_selected); if (scsidev != nullptr) diff --git a/src/devices/machine/legscsi.h b/src/devices/machine/legscsi.h index b3d8800972c..09384c8585d 100644 --- a/src/devices/machine/legscsi.h +++ b/src/devices/machine/legscsi.h @@ -13,7 +13,7 @@ class legacy_scsi_host_adapter : public device_t { public: - legacy_scsi_host_adapter(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + legacy_scsi_host_adapter(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 set_scsi_port(device_t &device, const char *tag) { downcast(device).m_scsi_port.set_tag(tag); } @@ -22,12 +22,12 @@ protected: void reset_bus(); bool select(int id); - void send_command(UINT8 *data, int bytes); + void send_command(uint8_t *data, int bytes); int get_length(); int get_phase(); - void read_data(UINT8 *data, int bytes); - void write_data(UINT8 *data, int bytes); - UINT8 get_status(); + void read_data(uint8_t *data, int bytes); + void write_data(uint8_t *data, int bytes); + uint8_t get_status(); private: int m_selected; diff --git a/src/devices/machine/lh5810.cpp b/src/devices/machine/lh5810.cpp index 88b9b8d51c7..a0a5ad0590d 100644 --- a/src/devices/machine/lh5810.cpp +++ b/src/devices/machine/lh5810.cpp @@ -27,7 +27,7 @@ const device_type LH5810 = &device_creator; // lh5810_device - constructor //------------------------------------------------- -lh5810_device::lh5810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lh5810_device::lh5810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LH5810, "LH5810", tag, owner, clock, "lh5810", __FILE__), m_porta_r_cb(*this), m_porta_w_cb(*this), diff --git a/src/devices/machine/lh5810.h b/src/devices/machine/lh5810.h index 63bff576958..dcfbf58fb6d 100644 --- a/src/devices/machine/lh5810.h +++ b/src/devices/machine/lh5810.h @@ -68,7 +68,7 @@ class lh5810_device : public device_t { public: // construction/destruction - lh5810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lh5810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_porta_r_callback(device_t &device, _Object object) { return downcast(device).m_porta_r_cb.set_callback(object); } template static devcb_base &set_porta_w_callback(device_t &device, _Object object) { return downcast(device).m_porta_w_cb.set_callback(object); } @@ -95,8 +95,8 @@ private: devcb_write_line m_out_int_cb; //IRQ callback - UINT8 m_reg[0x10]; - UINT8 m_irq; + uint8_t m_reg[0x10]; + uint8_t m_irq; }; diff --git a/src/devices/machine/linflash.cpp b/src/devices/machine/linflash.cpp index efc9583981b..5c49d224612 100644 --- a/src/devices/machine/linflash.cpp +++ b/src/devices/machine/linflash.cpp @@ -2,7 +2,7 @@ // copyright-holders:smf #include "linflash.h" -linear_flash_pccard_device::linear_flash_pccard_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) : +linear_flash_pccard_device::linear_flash_pccard_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_memory_interface(mconfig, *this), device_slot_card_interface(mconfig, *this), m_space(nullptr) @@ -21,7 +21,7 @@ const address_space_config *linear_flash_pccard_device::memory_space_config( add READ16_MEMBER( linear_flash_pccard_device::read_memory ) { - UINT16 data = m_space->read_word(offset * 2, mem_mask); + uint16_t data = m_space->read_word(offset * 2, mem_mask); //printf( "<%08x %04x %04x\n", offset, data, mem_mask ); return data; } @@ -47,7 +47,7 @@ static ADDRESS_MAP_START(linear_flash_pccard_16mb, AS_0, 16, linear_flash_pccard AM_RANGE(0x00c00000, 0x00ffffff) AM_DEVREADWRITE8("4u", intelfsh8_device, read, write, 0xff00) ADDRESS_MAP_END -linear_flash_pccard_16mb_device::linear_flash_pccard_16mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +linear_flash_pccard_16mb_device::linear_flash_pccard_16mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : linear_flash_pccard_device(mconfig, LINEAR_FLASH_PCCARD_16MB, "Linear Flash PCCARD (16MB)", tag, owner, clock, "linearflash16mb", __FILE__) { m_space_config = address_space_config("memory", ENDIANNESS_LITTLE, 16, 26, 0, *ADDRESS_MAP_NAME( linear_flash_pccard_16mb ) ); @@ -92,7 +92,7 @@ static ADDRESS_MAP_START(linear_flash_pccard_32mb, AS_0, 16, linear_flash_pccard AM_RANGE(0x01c00000, 0x01ffffff) AM_DEVREADWRITE8("8u", intelfsh8_device, read, write, 0xff00) ADDRESS_MAP_END -linear_flash_pccard_32mb_device::linear_flash_pccard_32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +linear_flash_pccard_32mb_device::linear_flash_pccard_32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : linear_flash_pccard_device(mconfig, LINEAR_FLASH_PCCARD_32MB, "Linear Flash PCCARD (32MB)", tag, owner, clock, "linearflash32mb", __FILE__) { m_space_config = address_space_config("memory", ENDIANNESS_LITTLE, 16, 26, 0, *ADDRESS_MAP_NAME( linear_flash_pccard_32mb ) ); @@ -161,7 +161,7 @@ static ADDRESS_MAP_START(linear_flash_pccard_64mb, AS_0, 16, linear_flash_pccard AM_RANGE(0x03c00000, 0x03ffffff) AM_DEVREADWRITE8("16u", intelfsh8_device, read, write, 0xff00) ADDRESS_MAP_END -linear_flash_pccard_64mb_device::linear_flash_pccard_64mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +linear_flash_pccard_64mb_device::linear_flash_pccard_64mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : linear_flash_pccard_device(mconfig, LINEAR_FLASH_PCCARD_64MB, "Linear Flash PCCARD (64MB)", tag, owner, clock, "linearflash64mb", __FILE__) { m_space_config = address_space_config("memory", ENDIANNESS_LITTLE, 16, 26, 0, *ADDRESS_MAP_NAME( linear_flash_pccard_64mb ) ); diff --git a/src/devices/machine/linflash.h b/src/devices/machine/linflash.h index e6acfcf4ef3..3d486b35c9f 100644 --- a/src/devices/machine/linflash.h +++ b/src/devices/machine/linflash.h @@ -19,7 +19,7 @@ public: virtual DECLARE_WRITE16_MEMBER(write_memory) override; protected: - linear_flash_pccard_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); + linear_flash_pccard_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-level overrides virtual void device_start() override; @@ -37,7 +37,7 @@ extern const device_type LINEAR_FLASH_PCCARD_16MB; class linear_flash_pccard_16mb_device : public linear_flash_pccard_device { public: - linear_flash_pccard_16mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + linear_flash_pccard_16mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -50,7 +50,7 @@ extern const device_type LINEAR_FLASH_PCCARD_32MB; class linear_flash_pccard_32mb_device : public linear_flash_pccard_device { public: - linear_flash_pccard_32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + linear_flash_pccard_32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -62,7 +62,7 @@ extern const device_type LINEAR_FLASH_PCCARD_64MB; class linear_flash_pccard_64mb_device : public linear_flash_pccard_device { public: - linear_flash_pccard_64mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + linear_flash_pccard_64mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides diff --git a/src/devices/machine/lpc-acpi.cpp b/src/devices/machine/lpc-acpi.cpp index 72d066affaa..50f5774aacf 100644 --- a/src/devices/machine/lpc-acpi.cpp +++ b/src/devices/machine/lpc-acpi.cpp @@ -36,13 +36,13 @@ DEVICE_ADDRESS_MAP_START(map, 32, lpc_acpi_device) AM_RANGE(0x70, 0x73) AM_READWRITE8 (sw_irq_gen_r, sw_irq_gen_w, 0x000000ff) ADDRESS_MAP_END -lpc_acpi_device::lpc_acpi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lpc_acpi_device::lpc_acpi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : lpc_device(mconfig, LPC_ACPI, "LPC ACPI", tag, owner, clock, "lpc_acpi", __FILE__) { } -void lpc_acpi_device::map_device(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 lpc_acpi_device::map_device(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) { io_space->install_device(io_offset, io_window_end, *this, &lpc_acpi_device::map); } diff --git a/src/devices/machine/lpc-acpi.h b/src/devices/machine/lpc-acpi.h index bde29170f04..68badc4c337 100644 --- a/src/devices/machine/lpc-acpi.h +++ b/src/devices/machine/lpc-acpi.h @@ -10,10 +10,10 @@ class lpc_acpi_device : public lpc_device { public: - lpc_acpi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lpc_acpi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual void map_device(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_device(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; DECLARE_READ16_MEMBER( pm1_sts_r); DECLARE_WRITE16_MEMBER(pm1_sts_w); @@ -74,11 +74,11 @@ protected: void device_reset() override; private: - UINT32 pm1_cnt, proc_cnt, gpe0_sts, gpe0_en, smi_en, smi_sts; - UINT16 pm1_sts, pm1_en, alt_gp_smi_en, alt_gp_smi_sts, devact_sts, devtrap_en; - UINT16 tco1_sts, tco2_sts, tco1_cnt, tco2_cnt; - UINT8 tco_rld, tco_tmr, tco_dat_in, tco_dat_out, tco_message1, tco_message2; - UINT8 tco_wdstatus, sw_irq_gen; + uint32_t pm1_cnt, proc_cnt, gpe0_sts, gpe0_en, smi_en, smi_sts; + uint16_t pm1_sts, pm1_en, alt_gp_smi_en, alt_gp_smi_sts, devact_sts, devtrap_en; + uint16_t tco1_sts, tco2_sts, tco1_cnt, tco2_cnt; + uint8_t tco_rld, tco_tmr, tco_dat_in, tco_dat_out, tco_message1, tco_message2; + uint8_t tco_wdstatus, sw_irq_gen; DECLARE_ADDRESS_MAP(map, 32); }; diff --git a/src/devices/machine/lpc-pit.cpp b/src/devices/machine/lpc-pit.cpp index 19a07373ec5..84c924263d0 100644 --- a/src/devices/machine/lpc-pit.cpp +++ b/src/devices/machine/lpc-pit.cpp @@ -11,13 +11,13 @@ DEVICE_ADDRESS_MAP_START(map, 32, lpc_pit_device) AM_RANGE(0x50, 0x53) AM_WRITE8 ( control_w, 0xff000000) ADDRESS_MAP_END -lpc_pit_device::lpc_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lpc_pit_device::lpc_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : lpc_device(mconfig, LPC_PIT, "LPC PIT", tag, owner, clock, "lpc_pit", __FILE__) { } -void lpc_pit_device::map_device(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 lpc_pit_device::map_device(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) { io_space->install_device(io_offset, io_window_end, *this, &lpc_pit_device::map); } diff --git a/src/devices/machine/lpc-pit.h b/src/devices/machine/lpc-pit.h index a9e96a7b401..25fad7f05d2 100644 --- a/src/devices/machine/lpc-pit.h +++ b/src/devices/machine/lpc-pit.h @@ -10,10 +10,10 @@ class lpc_pit_device : public lpc_device { public: - lpc_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lpc_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual void map_device(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_device(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; DECLARE_READ8_MEMBER( status_r); DECLARE_WRITE8_MEMBER(access_w); diff --git a/src/devices/machine/lpc-rtc.cpp b/src/devices/machine/lpc-rtc.cpp index 455ab99d2fb..985be52dfc8 100644 --- a/src/devices/machine/lpc-rtc.cpp +++ b/src/devices/machine/lpc-rtc.cpp @@ -14,19 +14,19 @@ DEVICE_ADDRESS_MAP_START(extmap, 32, lpc_rtc_device) AM_RANGE(0x70, 0x77) AM_READWRITE8(exttarget_r, exttarget_w, 0xff000000) ADDRESS_MAP_END -lpc_rtc_device::lpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lpc_rtc_device::lpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : lpc_device(mconfig, LPC_RTC, "LPC RTC", tag, owner, clock, "lpc_rtc", __FILE__), cur_index(0), cur_extindex(0) { } -void lpc_rtc_device::map_device(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 lpc_rtc_device::map_device(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) { io_space->install_device(io_offset, io_window_end, *this, &lpc_rtc_device::map); } -void lpc_rtc_device::map_extdevice(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 lpc_rtc_device::map_extdevice(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) { io_space->install_device(io_offset, io_window_end, *this, &lpc_rtc_device::extmap); } diff --git a/src/devices/machine/lpc-rtc.h b/src/devices/machine/lpc-rtc.h index f46a3ca2238..c4c1c611867 100644 --- a/src/devices/machine/lpc-rtc.h +++ b/src/devices/machine/lpc-rtc.h @@ -10,13 +10,13 @@ class lpc_rtc_device : public lpc_device { public: - lpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual void map_device(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_device(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; - virtual void map_extdevice(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); + virtual void map_extdevice(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); DECLARE_READ8_MEMBER( index_r); DECLARE_WRITE8_MEMBER( index_w); @@ -35,8 +35,8 @@ private: DECLARE_ADDRESS_MAP(map, 32); DECLARE_ADDRESS_MAP(extmap, 32); - UINT8 cur_index, cur_extindex; - UINT8 ram[256]; + uint8_t cur_index, cur_extindex; + uint8_t ram[256]; }; extern const device_type LPC_RTC; diff --git a/src/devices/machine/lpc.cpp b/src/devices/machine/lpc.cpp index afb51435f23..c2b7f681d0f 100644 --- a/src/devices/machine/lpc.cpp +++ b/src/devices/machine/lpc.cpp @@ -2,7 +2,7 @@ // copyright-holders:Olivier Galibert #include "lpc.h" -lpc_device::lpc_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) : +lpc_device::lpc_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) { } diff --git a/src/devices/machine/lpc.h b/src/devices/machine/lpc.h index 6ade06d03ff..c135b616202 100644 --- a/src/devices/machine/lpc.h +++ b/src/devices/machine/lpc.h @@ -7,10 +7,10 @@ class lpc_device : public device_t { public: - lpc_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); + lpc_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 map_device(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) = 0; + virtual void map_device(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) = 0; }; #endif diff --git a/src/devices/machine/lpci.cpp b/src/devices/machine/lpci.cpp index 004b50dfcaf..c5b53baa840 100644 --- a/src/devices/machine/lpci.cpp +++ b/src/devices/machine/lpci.cpp @@ -89,7 +89,7 @@ const device_type PCI_BUS_LEGACY = &device_creator; //------------------------------------------------- // pci_bus_legacy_device - constructor //------------------------------------------------- -pci_bus_legacy_device::pci_bus_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pci_bus_legacy_device::pci_bus_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCI_BUS_LEGACY, "PCI Bus Legacy", tag, owner, clock, "pci_bus_legacy", __FILE__), m_father(nullptr) { @@ -107,7 +107,7 @@ pci_bus_legacy_device::pci_bus_legacy_device(const machine_config &mconfig, cons READ32_MEMBER( pci_bus_legacy_device::read ) { - UINT32 result = 0xffffffff; + uint32_t result = 0xffffffff; int function, reg; offset %= 2; @@ -211,12 +211,12 @@ WRITE32_MEMBER( pci_bus_legacy_device::write ) READ64_MEMBER(pci_bus_legacy_device::read_64be) { - UINT64 result = 0; + uint64_t result = 0; mem_mask = flipendian_int64(mem_mask); if (ACCESSING_BITS_0_31) - result |= (UINT64)read(space, offset * 2 + 0, mem_mask >> 0) << 0; + result |= (uint64_t)read(space, offset * 2 + 0, mem_mask >> 0) << 0; if (ACCESSING_BITS_32_63) - result |= (UINT64)read(space, offset * 2 + 1, mem_mask >> 32) << 32; + result |= (uint64_t)read(space, offset * 2 + 1, mem_mask >> 32) << 32; return flipendian_int64(result); } diff --git a/src/devices/machine/lpci.h b/src/devices/machine/lpci.h index 849f27d206d..b53b3fe1ae0 100644 --- a/src/devices/machine/lpci.h +++ b/src/devices/machine/lpci.h @@ -15,8 +15,8 @@ // TYPE DEFINITIONS //************************************************************************** -typedef UINT32 (*pci_read_func)(device_t *pcibus, device_t *device, int function, int reg, UINT32 mem_mask); -typedef void (*pci_write_func)(device_t *pcibus, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask); +typedef uint32_t (*pci_read_func)(device_t *pcibus, device_t *device, int function, int reg, uint32_t mem_mask); +typedef void (*pci_write_func)(device_t *pcibus, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask); // ======================> pci_bus_legacy_device @@ -24,7 +24,7 @@ class pci_bus_legacy_device : public device_t { public: // construction/destruction - pci_bus_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pci_bus_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ32_MEMBER( read ); DECLARE_WRITE32_MEMBER( write ); @@ -47,19 +47,19 @@ protected: virtual void device_post_load() override; private: - UINT8 m_busnum; + uint8_t m_busnum; const char * m_devtag[32]; pci_read_func m_read_callback[32]; pci_write_func m_write_callback[32]; const char * m_father; device_t * m_device[32]; pci_bus_legacy_device * m_siblings[8]; - UINT8 m_siblings_busnum[8]; + uint8_t m_siblings_busnum[8]; int m_siblings_count; offs_t m_address; - INT8 m_devicenum; // device number we are addressing - INT8 m_busnumber; // pci bus number we are addressing + int8_t m_devicenum; // device number we are addressing + int8_t m_busnumber; // pci bus number we are addressing pci_bus_legacy_device * m_busnumaddr; // pci bus we are addressing }; diff --git a/src/devices/machine/m6m80011ap.cpp b/src/devices/machine/m6m80011ap.cpp index a8dea68d6ef..be1d92b2079 100644 --- a/src/devices/machine/m6m80011ap.cpp +++ b/src/devices/machine/m6m80011ap.cpp @@ -27,7 +27,7 @@ const device_type M6M80011AP = &device_creator; // m6m80011ap_device - constructor //------------------------------------------------- -m6m80011ap_device::m6m80011ap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m6m80011ap_device::m6m80011ap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M6M80011AP, "M6M80011AP EEPROM", tag, owner, clock, "m6m80011ap", __FILE__), device_nvram_interface(mconfig, *this), m_latch(0), m_reset_line(0), m_cmd_stream_pos(0), m_current_cmd(0), m_read_latch(0), m_current_addr(0), m_eeprom_we(0), m_eeprom_state() { diff --git a/src/devices/machine/m6m80011ap.h b/src/devices/machine/m6m80011ap.h index dfea6c06c14..cbd2e185669 100644 --- a/src/devices/machine/m6m80011ap.h +++ b/src/devices/machine/m6m80011ap.h @@ -43,7 +43,7 @@ class m6m80011ap_device : public device_t, { public: // construction/destruction - m6m80011ap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m6m80011ap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_READ_LINE_MEMBER( read_bit ); @@ -63,16 +63,16 @@ protected: virtual void nvram_write(emu_file &file) override; private: - UINT8 m_latch; - UINT8 m_reset_line; - UINT8 m_cmd_stream_pos; - UINT32 m_current_cmd; - UINT8 m_read_latch; - UINT8 m_current_addr; - UINT8 m_eeprom_we; + uint8_t m_latch; + uint8_t m_reset_line; + uint8_t m_cmd_stream_pos; + uint32_t m_current_cmd; + uint8_t m_read_latch; + uint8_t m_current_addr; + uint8_t m_eeprom_we; eeprom_cmd_t m_eeprom_state; - UINT16 m_eeprom_data[0x80]; + uint16_t m_eeprom_data[0x80]; }; diff --git a/src/devices/machine/mb14241.cpp b/src/devices/machine/mb14241.cpp index 44c49fb4e88..b4593172e27 100644 --- a/src/devices/machine/mb14241.cpp +++ b/src/devices/machine/mb14241.cpp @@ -17,7 +17,7 @@ const device_type MB14241 = &device_creator; -mb14241_device::mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb14241_device::mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MB14241, "MB14241 Data Shifter", tag, owner, clock, "mb14241", __FILE__), m_shift_data(0), m_shift_count(0) { } @@ -64,7 +64,7 @@ WRITE8_MEMBER( mb14241_device::shift_count_w ) WRITE8_MEMBER( mb14241_device::shift_data_w ) { - m_shift_data = (m_shift_data >> 8) | ((UINT16)data << 7); + m_shift_data = (m_shift_data >> 8) | ((uint16_t)data << 7); } READ8_MEMBER( mb14241_device::shift_result_r ) diff --git a/src/devices/machine/mb14241.h b/src/devices/machine/mb14241.h index 01c2d1b0dde..88d9e5e01b9 100644 --- a/src/devices/machine/mb14241.h +++ b/src/devices/machine/mb14241.h @@ -13,7 +13,7 @@ class mb14241_device : public device_t { public: - mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER ( shift_count_w ); DECLARE_WRITE8_MEMBER ( shift_data_w ); @@ -28,8 +28,8 @@ protected: private: // internal state - UINT16 m_shift_data; /* 15 bits only */ - UINT8 m_shift_count; /* 3 bits */ + uint16_t m_shift_data; /* 15 bits only */ + uint8_t m_shift_count; /* 3 bits */ }; extern const device_type MB14241; diff --git a/src/devices/machine/mb3773.cpp b/src/devices/machine/mb3773.cpp index d749d8abc1a..1819825fadd 100644 --- a/src/devices/machine/mb3773.cpp +++ b/src/devices/machine/mb3773.cpp @@ -27,7 +27,7 @@ const device_type MB3773 = &device_creator; // mb3773_device - constructor //------------------------------------------------- -mb3773_device::mb3773_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +mb3773_device::mb3773_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t(mconfig, MB3773, "MB3773 Power Supply Monitor", tag, owner, clock, "mb3773", __FILE__), m_watchdog_timer(nullptr), m_ck(0) { } diff --git a/src/devices/machine/mb3773.h b/src/devices/machine/mb3773.h index fa6fdd583fa..85142cdaf2b 100644 --- a/src/devices/machine/mb3773.h +++ b/src/devices/machine/mb3773.h @@ -29,7 +29,7 @@ class mb3773_device : { public: // construction/destruction - mb3773_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ); + mb3773_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); // I/O operations WRITE_LINE_MEMBER( write_line_ck ); diff --git a/src/devices/machine/mb8421.cpp b/src/devices/machine/mb8421.cpp index 0d3cb819a66..d50240db362 100644 --- a/src/devices/machine/mb8421.cpp +++ b/src/devices/machine/mb8421.cpp @@ -20,7 +20,7 @@ const device_type MB8421 = &device_creator; // mb8421_device - constructor //------------------------------------------------- -mb8421_device::mb8421_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb8421_device::mb8421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MB8421, "MB8421 DPSRAM", tag, owner, clock, "mb8421", __FILE__), m_intl_handler(*this), m_intr_handler(*this) diff --git a/src/devices/machine/mb8421.h b/src/devices/machine/mb8421.h index d1d23ab0691..a878eae6361 100644 --- a/src/devices/machine/mb8421.h +++ b/src/devices/machine/mb8421.h @@ -38,14 +38,14 @@ class mb8421_device : public device_t { public: - mb8421_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_intl_handler(device_t &device, _Object object) { return downcast(device).m_intl_handler.set_callback(object); } template static devcb_base &set_intr_handler(device_t &device, _Object object) { return downcast(device).m_intr_handler.set_callback(object); } DECLARE_READ_LINE_MEMBER( busy_r ) { return 0; } // _BUSY pin - not emulated - UINT8 peek(offs_t offset) { return m_ram[offset & 0x7ff]; } + uint8_t peek(offs_t offset) { return m_ram[offset & 0x7ff]; } DECLARE_WRITE8_MEMBER( left_w ); DECLARE_READ8_MEMBER( left_r ); @@ -58,7 +58,7 @@ protected: virtual void device_reset() override; private: - UINT8 m_ram[0x800]; + uint8_t m_ram[0x800]; devcb_write_line m_intl_handler; devcb_write_line m_intr_handler; diff --git a/src/devices/machine/mb87078.cpp b/src/devices/machine/mb87078.cpp index a94380456f5..5e0199697bb 100644 --- a/src/devices/machine/mb87078.cpp +++ b/src/devices/machine/mb87078.cpp @@ -104,7 +104,7 @@ static const int mb87078_gain_percent[66] = { const device_type MB87078 = &device_creator; -mb87078_device::mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb87078_device::mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MB87078, "MB87078 Volume Controller", tag, owner, clock, "mb87078", __FILE__), m_channel_latch(0), m_reset_comp(0), diff --git a/src/devices/machine/mb87078.h b/src/devices/machine/mb87078.h index 9eeb6c7526f..0192b86db25 100644 --- a/src/devices/machine/mb87078.h +++ b/src/devices/machine/mb87078.h @@ -25,7 +25,7 @@ class mb87078_device : public device_t { public: - mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mb87078_device() {} template static devcb_base &set_gain_changed_callback(device_t &device, _Object object) { return downcast(device).m_gain_changed_cb.set_callback(object); } @@ -57,8 +57,8 @@ private: // internal state int m_gain[4]; /* gain index 0-63,64,65 */ int m_channel_latch; /* current channel */ - UINT8 m_latch[2][4]; /* 6bit+3bit 4 data latches */ - UINT8 m_reset_comp; + uint8_t m_latch[2][4]; /* 6bit+3bit 4 data latches */ + uint8_t m_reset_comp; devcb_write8 m_gain_changed_cb; }; diff --git a/src/devices/machine/mb8795.cpp b/src/devices/machine/mb8795.cpp index 7f2c096023c..a427780578e 100644 --- a/src/devices/machine/mb8795.cpp +++ b/src/devices/machine/mb8795.cpp @@ -18,7 +18,7 @@ DEVICE_ADDRESS_MAP_START(map, 8, mb8795_device) AM_RANGE(0x8, 0xf) AM_READWRITE(mac_r, mac_w) // Mapping limitation, real is up to 0xd ADDRESS_MAP_END -mb8795_device::mb8795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mb8795_device::mb8795_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MB8795, "Fujitsu MB8795", tag, owner, clock, "mb8795", __FILE__), device_network_interface(mconfig, *this, 10), txstat(0), txmask(0), rxstat(0), rxmask(0), txmode(0), rxmode(0), txlen(0), rxlen(0), txcount(0), drq_tx(false), drq_rx(false), irq_tx(false), irq_rx(false), timer_tx(nullptr), timer_rx(nullptr), @@ -72,7 +72,7 @@ void mb8795_device::device_reset() start_send(); } -void mb8795_device::recv_cb(UINT8 *buf, int len) +void mb8795_device::recv_cb(uint8_t *buf, int len) { memcpy(rxbuf, buf, len); rxlen = len; @@ -191,7 +191,7 @@ void mb8795_device::start_send() timer_tx->adjust(attotime::zero); } -void mb8795_device::tx_dma_w(UINT8 data, bool eof) +void mb8795_device::tx_dma_w(uint8_t data, bool eof) { txbuf[txlen++] = data; if(txstat & EN_TXS_READY) { @@ -226,7 +226,7 @@ void mb8795_device::tx_dma_w(UINT8 data, bool eof) timer_tx->adjust(attotime::from_nsec(800)); } -void mb8795_device::rx_dma_r(UINT8 &data, bool &eof) +void mb8795_device::rx_dma_r(uint8_t &data, bool &eof) { drq_rx = false; if(!drq_rx_cb.isnull()) diff --git a/src/devices/machine/mb8795.h b/src/devices/machine/mb8795.h index 4811d38c04d..dede6ff48bf 100644 --- a/src/devices/machine/mb8795.h +++ b/src/devices/machine/mb8795.h @@ -24,7 +24,7 @@ class mb8795_device : public device_t, public device_network_interface { public: - mb8795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8795_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_tx_irq_wr_callback(device_t &device, _Object object) { return downcast(device).irq_tx_cb.set_callback(object); } template static devcb_base &set_rx_irq_wr_callback(device_t &device, _Object object) { return downcast(device).irq_rx_cb.set_callback(object); } @@ -50,15 +50,15 @@ public: DECLARE_READ8_MEMBER(mac_r); DECLARE_WRITE8_MEMBER(mac_w); - void tx_dma_w(UINT8 data, bool eof); - void rx_dma_r(UINT8 &data, bool &eof); + void tx_dma_w(uint8_t data, bool eof); + void rx_dma_r(uint8_t &data, bool &eof); 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 recv_cb(UINT8 *buf, int len) override; + virtual void recv_cb(uint8_t *buf, int len) override; private: enum { TIMER_TX, TIMER_RX }; @@ -101,10 +101,10 @@ private: EN_RST_RESET = 0x80 /* reset interface */ }; - UINT8 mac[6]; - UINT8 txbuf[2000], rxbuf[2000]; - UINT8 txstat, txmask, rxstat, rxmask, txmode, rxmode; - UINT16 txlen, rxlen, txcount; + uint8_t mac[6]; + uint8_t txbuf[2000], rxbuf[2000]; + uint8_t txstat, txmask, rxstat, rxmask, txmode, rxmode; + uint16_t txlen, rxlen, txcount; bool drq_tx, drq_rx, irq_tx, irq_rx; emu_timer *timer_tx, *timer_rx; diff --git a/src/devices/machine/mb89352.cpp b/src/devices/machine/mb89352.cpp index 1b0894c2007..a679e8081e4 100644 --- a/src/devices/machine/mb89352.cpp +++ b/src/devices/machine/mb89352.cpp @@ -115,7 +115,7 @@ const device_type MB89352A = &device_creator; * Device */ -mb89352_device::mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mb89352_device::mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : legacy_scsi_host_adapter(mconfig, MB89352A, "MB89352A", tag, owner, clock, "mb89352", __FILE__), m_irq_cb(*this), m_drq_cb(*this) @@ -161,7 +161,7 @@ void mb89352_device::device_stop() } // get the length of a SCSI command based on it's command byte type -int mb89352_device::get_scsi_cmd_len(UINT8 cbyte) +int mb89352_device::get_scsi_cmd_len(uint8_t cbyte) { int group; @@ -247,7 +247,7 @@ void mb89352_device::set_phase(int phase) READ8_MEMBER( mb89352_device::mb89352_r ) { - UINT8 ret; + uint8_t ret; switch(offset & 0x0f) { case 0x00: // BDID - Bus Device ID diff --git a/src/devices/machine/mb89352.h b/src/devices/machine/mb89352.h index faae5c4ab3f..26cfd272c80 100644 --- a/src/devices/machine/mb89352.h +++ b/src/devices/machine/mb89352.h @@ -60,7 +60,7 @@ class mb89352_device : public legacy_scsi_host_adapter { public: // construction/destruction - mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb89352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } template static devcb_base &set_drq_callback(device_t &device, _Object object) { return downcast(device).m_drq_cb.set_callback(object); } @@ -82,33 +82,33 @@ private: // internal device state goes here static const device_timer_id TIMER_TRANSFER = 0; - int get_scsi_cmd_len(UINT8 cbyte); - //void set_ints(UINT8 flag); + int get_scsi_cmd_len(uint8_t cbyte); + //void set_ints(uint8_t flag); devcb_write_line m_irq_cb; /* irq callback */ devcb_write_line m_drq_cb; /* drq callback */ - UINT8 m_phase; // current SCSI phase - UINT8 m_target; // current SCSI target - UINT8 m_bdid; // Bus device ID (SCSI ID of the bus?) - UINT8 m_ints; // Interrupt Sense - UINT8 m_temp; // Temporary register (To/From SCSI bus) - UINT8 m_data; // Data register - UINT8 m_scmd; // SPC Command register - UINT32 m_transfer_count; // byte transfer counter, also used as a timeout counter for selection. - UINT8 m_int_enable; - UINT8 m_sel_enable; - UINT8 m_resel_enable; - UINT8 m_parity_enable; - UINT8 m_arbit_enable; - UINT8 m_busfree_int_enable; - UINT8 m_line_status; - UINT8 m_spc_status; - UINT8 m_error_status; - UINT8 m_command_index; - UINT8 m_command[16]; - UINT32 m_transfer_index; - UINT8 m_buffer[512]; + uint8_t m_phase; // current SCSI phase + uint8_t m_target; // current SCSI target + uint8_t m_bdid; // Bus device ID (SCSI ID of the bus?) + uint8_t m_ints; // Interrupt Sense + uint8_t m_temp; // Temporary register (To/From SCSI bus) + uint8_t m_data; // Data register + uint8_t m_scmd; // SPC Command register + uint32_t m_transfer_count; // byte transfer counter, also used as a timeout counter for selection. + uint8_t m_int_enable; + uint8_t m_sel_enable; + uint8_t m_resel_enable; + uint8_t m_parity_enable; + uint8_t m_arbit_enable; + uint8_t m_busfree_int_enable; + uint8_t m_line_status; + uint8_t m_spc_status; + uint8_t m_error_status; + uint8_t m_command_index; + uint8_t m_command[16]; + uint32_t m_transfer_index; + uint8_t m_buffer[512]; emu_timer* m_transfer_timer; }; diff --git a/src/devices/machine/mb89363b.cpp b/src/devices/machine/mb89363b.cpp index 2e4f210a865..f4584971424 100644 --- a/src/devices/machine/mb89363b.cpp +++ b/src/devices/machine/mb89363b.cpp @@ -84,7 +84,7 @@ extern const device_type MB89363B = &device_creator; -mb89363b_device::mb89363b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb89363b_device::mb89363b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MB89363B, "MB89363 I/O", tag, owner, clock, "mb89363b", __FILE__), m_i8255_a(*this, "i8255_a"), m_i8255_b(*this, "i8255_b"), diff --git a/src/devices/machine/mb89363b.h b/src/devices/machine/mb89363b.h index 85b1913e6d1..cc880a4cead 100644 --- a/src/devices/machine/mb89363b.h +++ b/src/devices/machine/mb89363b.h @@ -66,7 +66,7 @@ class mb89363b_device : public device_t { public: // construction/destruction - mb89363b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb89363b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); diff --git a/src/devices/machine/mb89371.cpp b/src/devices/machine/mb89371.cpp index 1188f295725..22a81d8dbd6 100644 --- a/src/devices/machine/mb89371.cpp +++ b/src/devices/machine/mb89371.cpp @@ -12,7 +12,7 @@ const device_type MB89371 = &device_creator; -mb89371_device::mb89371_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +mb89371_device::mb89371_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t(mconfig, MB89371, "MB89371 Dual Serial UART", tag, owner, clock, "mb89371", __FILE__) { } diff --git a/src/devices/machine/mb89371.h b/src/devices/machine/mb89371.h index f7d5c1a2bad..dbdef609cdd 100644 --- a/src/devices/machine/mb89371.h +++ b/src/devices/machine/mb89371.h @@ -17,7 +17,7 @@ class mb89371_device : public device_t { public: // construction/destruction - mb89371_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb89371_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( read ); diff --git a/src/devices/machine/mc146818.cpp b/src/devices/machine/mc146818.cpp index 1b659a610a0..103ebf17409 100644 --- a/src/devices/machine/mc146818.cpp +++ b/src/devices/machine/mc146818.cpp @@ -30,7 +30,7 @@ const device_type MC146818 = &device_creator; // mc146818_device - constructor //------------------------------------------------- -mc146818_device::mc146818_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc146818_device::mc146818_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC146818, "MC146818 RTC", tag, owner, clock, "mc146818", __FILE__), device_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -46,7 +46,7 @@ mc146818_device::mc146818_device(const machine_config &mconfig, const char *tag, { } -mc146818_device::mc146818_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) +mc146818_device::mc146818_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_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -198,7 +198,7 @@ void mc146818_device::nvram_default() memory_region *region = memregion(DEVICE_SELF); if (region != nullptr) { - UINT32 bytes = region->bytes(); + uint32_t bytes = region->bytes(); if (bytes > data_size()) bytes = data_size(); @@ -516,7 +516,7 @@ void mc146818_device::update_irq() READ8_MEMBER( mc146818_device::read ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { case 0: diff --git a/src/devices/machine/mc146818.h b/src/devices/machine/mc146818.h index a4651171179..2c62086a4f4 100644 --- a/src/devices/machine/mc146818.h +++ b/src/devices/machine/mc146818.h @@ -57,8 +57,8 @@ class mc146818_device : public device_t, { public: // construction/destruction - mc146818_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - mc146818_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); + mc146818_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mc146818_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); // callbacks template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } @@ -171,8 +171,8 @@ private: // internal state - UINT8 m_index; - std::vector m_data; + uint8_t m_index; + std::vector m_data; attotime m_last_refresh; diff --git a/src/devices/machine/mc2661.cpp b/src/devices/machine/mc2661.cpp index f93dc1b5ab1..625459361b3 100644 --- a/src/devices/machine/mc2661.cpp +++ b/src/devices/machine/mc2661.cpp @@ -25,7 +25,7 @@ const device_type MC2661 = &device_creator; #define LOG 0 -UINT32 baud_rates[16] = +uint32_t baud_rates[16] = { 50, 75, 110, 135 /*134.5*/, 150, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 19200 }; @@ -94,7 +94,7 @@ enum // mc2661_device - constructor //------------------------------------------------- -mc2661_device::mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mc2661_device::mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC2661, "MC2661", tag, owner, clock, "mc2661", __FILE__), device_serial_interface(mconfig, *this), m_write_txd(*this), @@ -221,7 +221,7 @@ void mc2661_device::rcv_complete() READ8_MEMBER( mc2661_device::read ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0x03) { @@ -331,8 +331,8 @@ WRITE8_MEMBER( mc2661_device::write ) } if(m_mode_index == 1) { - UINT32 rx_baud = baud_rates[data & 0x0f]; - UINT32 tx_baud = baud_rates[data & 0x0f]; + uint32_t rx_baud = baud_rates[data & 0x0f]; + uint32_t tx_baud = baud_rates[data & 0x0f]; if(data & 0x10) // internal receiver clock { // if((m_mr[0] & 0x03) != 0) diff --git a/src/devices/machine/mc2661.h b/src/devices/machine/mc2661.h index a18aa0141f1..f60baf9eea8 100644 --- a/src/devices/machine/mc2661.h +++ b/src/devices/machine/mc2661.h @@ -79,7 +79,7 @@ class mc2661_device : public device_t, { public: // construction/destruction - mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_rxc(device_t &device, int clock) { downcast(device).m_rxc = clock; } static void static_set_txc(device_t &device, int clock) { downcast(device).m_txc = clock; } @@ -129,12 +129,12 @@ private: int m_rxc; int m_txc; - UINT8 m_rhr; - UINT8 m_thr; - UINT8 m_cr; - UINT8 m_sr; - UINT8 m_mr[2]; - UINT8 m_sync[3]; + uint8_t m_rhr; + uint8_t m_thr; + uint8_t m_cr; + uint8_t m_sr; + uint8_t m_mr[2]; + uint8_t m_sync[3]; int m_mode_index; int m_sync_index; diff --git a/src/devices/machine/mc68328.cpp b/src/devices/machine/mc68328.cpp index e2987c1d5f9..052565ae315 100644 --- a/src/devices/machine/mc68328.cpp +++ b/src/devices/machine/mc68328.cpp @@ -31,7 +31,7 @@ static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, co const device_type MC68328 = &device_creator; -mc68328_device::mc68328_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc68328_device::mc68328_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC68328, "MC68328 (DragonBall) Integrated Processor", tag, owner, clock, "mc68328", __FILE__), m_rtc(nullptr), m_pwm(nullptr), m_out_port_a_cb(*this), m_out_port_b_cb(*this), @@ -243,7 +243,7 @@ void mc68328_device::device_reset() } -void mc68328_device::set_interrupt_line(UINT32 line, UINT32 active) +void mc68328_device::set_interrupt_line(uint32_t line, uint32_t active) { if (active) { @@ -320,9 +320,9 @@ void mc68328_device::set_interrupt_line(UINT32 line, UINT32 active) void mc68328_device::poll_port_d_interrupts() { - UINT8 line_transitions = m_regs.pddataedge & m_regs.pdirqedge; - UINT8 line_holds = m_regs.pddata &~ m_regs.pdirqedge; - UINT8 line_interrupts = (line_transitions | line_holds) & m_regs.pdirqen; + uint8_t line_transitions = m_regs.pddataedge & m_regs.pdirqedge; + uint8_t line_holds = m_regs.pddata &~ m_regs.pdirqedge; + uint8_t line_interrupts = (line_transitions | line_holds) & m_regs.pdirqen; if (line_interrupts) { @@ -347,9 +347,9 @@ WRITE_LINE_MEMBER( mc68328_device::set_penirq_line ) } } -void mc68328_device::set_port_d_lines(UINT8 state, int bit) +void mc68328_device::set_port_d_lines(uint8_t state, int bit) { - UINT8 old_button_state = m_regs.pddata; + uint8_t old_button_state = m_regs.pddata; if (state & (1 << bit)) { @@ -365,9 +365,9 @@ void mc68328_device::set_port_d_lines(UINT8 state, int bit) poll_port_d_interrupts(); } -UINT32 mc68328_device::get_timer_frequency(UINT32 index) +uint32_t mc68328_device::get_timer_frequency(uint32_t index) { - UINT32 frequency = 0; + uint32_t frequency = 0; switch (m_regs.tctl[index] & TCTL_CLKSOURCE) { @@ -391,7 +391,7 @@ UINT32 mc68328_device::get_timer_frequency(UINT32 index) return frequency; } -void mc68328_device::maybe_start_timer(UINT32 index, UINT32 new_enable) +void mc68328_device::maybe_start_timer(uint32_t index, uint32_t new_enable) { if ((m_regs.tctl[index] & TCTL_TEN) == TCTL_TEN_ENABLE && (m_regs.tctl[index] & TCTL_CLKSOURCE) > TCTL_CLKSOURCE_STOP) { @@ -405,7 +405,7 @@ void mc68328_device::maybe_start_timer(UINT32 index, UINT32 new_enable) } else { - UINT32 frequency = get_timer_frequency(index); + uint32_t frequency = get_timer_frequency(index); attotime period = (attotime::from_hz(frequency) * m_regs.tcmp[index]); if (new_enable) @@ -422,14 +422,14 @@ void mc68328_device::maybe_start_timer(UINT32 index, UINT32 new_enable) } } -void mc68328_device::timer_compare_event(UINT32 index) +void mc68328_device::timer_compare_event(uint32_t index) { m_regs.tcn[index] = m_regs.tcmp[index]; m_regs.tstat[index] |= TSTAT_COMP; if ((m_regs.tctl[index] & TCTL_FRR) == TCTL_FRR_RESTART) { - UINT32 frequency = get_timer_frequency(index); + uint32_t frequency = get_timer_frequency(index); if (frequency > 0) { @@ -446,7 +446,7 @@ void mc68328_device::timer_compare_event(UINT32 index) } else { - UINT32 frequency = get_timer_frequency(index); + uint32_t frequency = get_timer_frequency(index); if (frequency > 0) { @@ -486,8 +486,8 @@ TIMER_CALLBACK_MEMBER( mc68328_device::pwm_transition ) if (((m_regs.pwmc & PWMC_POL) == 0 && (m_regs.pwmc & PWMC_PIN) != 0) || ((m_regs.pwmc & PWMC_POL) != 0 && (m_regs.pwmc & PWMC_PIN) == 0)) { - UINT32 frequency = 32768 * 506; - UINT32 divisor = 4 << (m_regs.pwmc & PWMC_CLKSEL); // ?? Datasheet says 2 <<, but then we're an octave higher than CoPilot. + uint32_t frequency = 32768 * 506; + uint32_t divisor = 4 << (m_regs.pwmc & PWMC_CLKSEL); // ?? Datasheet says 2 <<, but then we're an octave higher than CoPilot. attotime period; frequency /= divisor; @@ -502,8 +502,8 @@ TIMER_CALLBACK_MEMBER( mc68328_device::pwm_transition ) } else { - UINT32 frequency = 32768 * 506; - UINT32 divisor = 4 << (m_regs.pwmc & PWMC_CLKSEL); // ?? Datasheet says 2 <<, but then we're an octave higher than CoPilot. + uint32_t frequency = 32768 * 506; + uint32_t divisor = 4 << (m_regs.pwmc & PWMC_CLKSEL); // ?? Datasheet says 2 <<, but then we're an octave higher than CoPilot. attotime period; frequency /= divisor; @@ -524,7 +524,7 @@ TIMER_CALLBACK_MEMBER( mc68328_device::rtc_tick ) { if (m_regs.rtcctl & RTCCTL_ENABLE) { - UINT32 set_int = 0; + uint32_t set_int = 0; m_regs.hmsr++; @@ -600,9 +600,9 @@ TIMER_CALLBACK_MEMBER( mc68328_device::rtc_tick ) WRITE16_MEMBER( mc68328_device::write ) { - UINT32 address = offset << 1; - UINT16 temp16[4] = { 0 }; - UINT32 imr_old = m_regs.imr, imr_diff; + uint32_t address = offset << 1; + uint16_t temp16[4] = { 0 }; + uint32_t imr_old = m_regs.imr, imr_diff; switch (address) { @@ -1300,8 +1300,8 @@ WRITE16_MEMBER( mc68328_device::write ) if ((m_regs.pwmc & PWMC_PWMEN) != 0 && m_regs.pwmw != 0 && m_regs.pwmp != 0) { - UINT32 frequency = 32768 * 506; - UINT32 divisor = 4 << (m_regs.pwmc & PWMC_CLKSEL); // ?? Datasheet says 2 <<, but then we're an octave higher than CoPilot. + uint32_t frequency = 32768 * 506; + uint32_t divisor = 4 << (m_regs.pwmc & PWMC_CLKSEL); // ?? Datasheet says 2 <<, but then we're an octave higher than CoPilot. attotime period; frequency /= divisor; period = attotime::from_hz(frequency) * m_regs.pwmw; @@ -1794,8 +1794,8 @@ WRITE16_MEMBER( mc68328_device::write ) READ16_MEMBER( mc68328_device::read ) { - UINT16 temp16; - UINT32 address = offset << 1; + uint16_t temp16; + uint32_t address = offset << 1; switch (address) { @@ -2692,11 +2692,11 @@ READ16_MEMBER( mc68328_device::read ) } /* THIS IS PRETTY MUCH TOTALLY WRONG AND DOESN'T REFLECT THE MC68328'S INTERNAL FUNCTIONALITY AT ALL! */ -UINT32 mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 *video_ram = (UINT16 *)(machine().device(RAM_TAG)->pointer() + (m_regs.lssa & 0x00ffffff)); - UINT16 word; - UINT16 *line; + uint16_t *video_ram = (uint16_t *)(machine().device(RAM_TAG)->pointer() + (m_regs.lssa & 0x00ffffff)); + uint16_t word; + uint16_t *line; int y, x, b; if (m_regs.lckcon & LCKCON_LCDC_EN) diff --git a/src/devices/machine/mc68328.h b/src/devices/machine/mc68328.h index c01e2ab471b..ac58dff85c8 100644 --- a/src/devices/machine/mc68328.h +++ b/src/devices/machine/mc68328.h @@ -412,201 +412,201 @@ struct mc68328_regs_t { // $(FF)FFF000 - UINT8 scr; // System Control Register - UINT8 unused0[255]; + uint8_t scr; // System Control Register + uint8_t unused0[255]; // $(FF)FFF100 - UINT16 grpbasea; // Chip Select Group A Base Register - UINT16 grpbaseb; // Chip Select Group B Base Register - UINT16 grpbasec; // Chip Select Group C Base Register - UINT16 grpbased; // Chip Select Group D Base Register - UINT16 grpmaska; // Chip Select Group A Mask Register - UINT16 grpmaskb; // Chip Select Group B Mask Register - UINT16 grpmaskc; // Chip Select Group C Mask Register - UINT16 grpmaskd; // Chip Select Group D Mask Register - UINT32 csa0; // Group A Chip Select 0 Register - UINT32 csa1; // Group A Chip Select 1 Register - UINT32 csa2; // Group A Chip Select 2 Register - UINT32 csa3; // Group A Chip Select 3 Register - UINT32 csb0; // Group B Chip Select 0 Register - UINT32 csb1; // Group B Chip Select 1 Register - UINT32 csb2; // Group B Chip Select 2 Register - UINT32 csb3; // Group B Chip Select 3 Register - UINT32 csc0; // Group C Chip Select 0 Register - UINT32 csc1; // Group C Chip Select 1 Register - UINT32 csc2; // Group C Chip Select 2 Register - UINT32 csc3; // Group C Chip Select 3 Register - UINT32 csd0; // Group D Chip Select 0 Register - UINT32 csd1; // Group D Chip Select 1 Register - UINT32 csd2; // Group D Chip Select 2 Register - UINT32 csd3; // Group D Chip Select 3 Register - UINT8 unused1[176]; + uint16_t grpbasea; // Chip Select Group A Base Register + uint16_t grpbaseb; // Chip Select Group B Base Register + uint16_t grpbasec; // Chip Select Group C Base Register + uint16_t grpbased; // Chip Select Group D Base Register + uint16_t grpmaska; // Chip Select Group A Mask Register + uint16_t grpmaskb; // Chip Select Group B Mask Register + uint16_t grpmaskc; // Chip Select Group C Mask Register + uint16_t grpmaskd; // Chip Select Group D Mask Register + uint32_t csa0; // Group A Chip Select 0 Register + uint32_t csa1; // Group A Chip Select 1 Register + uint32_t csa2; // Group A Chip Select 2 Register + uint32_t csa3; // Group A Chip Select 3 Register + uint32_t csb0; // Group B Chip Select 0 Register + uint32_t csb1; // Group B Chip Select 1 Register + uint32_t csb2; // Group B Chip Select 2 Register + uint32_t csb3; // Group B Chip Select 3 Register + uint32_t csc0; // Group C Chip Select 0 Register + uint32_t csc1; // Group C Chip Select 1 Register + uint32_t csc2; // Group C Chip Select 2 Register + uint32_t csc3; // Group C Chip Select 3 Register + uint32_t csd0; // Group D Chip Select 0 Register + uint32_t csd1; // Group D Chip Select 1 Register + uint32_t csd2; // Group D Chip Select 2 Register + uint32_t csd3; // Group D Chip Select 3 Register + uint8_t unused1[176]; // $(FF)FFF200 - UINT16 pllcr; // PLL Control Register - UINT16 pllfsr; // PLL Frequency Select Register - UINT8 pad2[3]; - UINT8 pctlr; // Power Control Register - UINT8 unused3[248]; + uint16_t pllcr; // PLL Control Register + uint16_t pllfsr; // PLL Frequency Select Register + uint8_t pad2[3]; + uint8_t pctlr; // Power Control Register + uint8_t unused3[248]; // $(FF)FFF300 - UINT8 ivr; // Interrupt Vector Register - UINT8 unused4[1]; - UINT16 icr; // Interrupt Control Register - UINT32 imr; // Interrupt Mask Register - UINT32 iwr; // Interrupt Wakeup Enable Register - UINT32 isr; // Interrupt Status Register - UINT32 ipr; // Interrupt Pending Register - UINT8 unused5[236]; + uint8_t ivr; // Interrupt Vector Register + uint8_t unused4[1]; + uint16_t icr; // Interrupt Control Register + uint32_t imr; // Interrupt Mask Register + uint32_t iwr; // Interrupt Wakeup Enable Register + uint32_t isr; // Interrupt Status Register + uint32_t ipr; // Interrupt Pending Register + uint8_t unused5[236]; // $(FF)FFF400 - UINT8 padir; // Port A Direction Register - UINT8 padata; // Port A Data Register - UINT8 unused6[1]; - UINT8 pasel; // Port A Select Register - UINT8 unused7[4]; - - UINT8 pbdir; // Port B Direction Register - UINT8 pbdata; // Port B Data Register - UINT8 unused8[1]; - UINT8 pbsel; // Port B Select Register - UINT8 unused9[4]; - - UINT8 pcdir; // Port C Direction Register - UINT8 pcdata; // Port C Data Register - UINT8 unused10[1]; - UINT8 pcsel; // Port C Select Register - UINT8 unused11[4]; - - UINT8 pddir; // Port D Direction Register - UINT8 pddata; // Port D Data Register - UINT8 pdpuen; // Port D Pullup Enable Register - UINT8 unused12[1]; - UINT8 pdpol; // Port D Polarity Register - UINT8 pdirqen; // Port D IRQ Enable Register - UINT8 pddataedge; // Port D Data Edge Level - UINT8 pdirqedge; // Port D IRQ Edge Register - - UINT8 pedir; // Port E Direction Register - UINT8 pedata; // Port E Data Register - UINT8 pepuen; // Port E Pullup Enable Register - UINT8 pesel; // Port E Select Register - UINT8 unused14[4]; - - UINT8 pfdir; // Port F Direction Register - UINT8 pfdata; // Port F Data Register - UINT8 pfpuen; // Port F Pullup Enable Register - UINT8 pfsel; // Port F Select Register - UINT8 unused15[4]; - - UINT8 pgdir; // Port G Direction Register - UINT8 pgdata; // Port G Data Register - UINT8 pgpuen; // Port G Pullup Enable Register - UINT8 pgsel; // Port G Select Register - UINT8 unused16[4]; - - UINT8 pjdir; // Port J Direction Register - UINT8 pjdata; // Port J Data Register - UINT8 unused17[1]; - UINT8 pjsel; // Port J Select Register - UINT8 unused18[4]; - UINT8 pkdir; // Port K Direction Register - UINT8 pkdata; // Port K Data Register - UINT8 pkpuen; // Port K Pullup Enable Register - UINT8 pksel; // Port K Select Register - UINT8 unused19[4]; - - UINT8 pmdir; // Port M Direction Register - UINT8 pmdata; // Port M Data Register - UINT8 pmpuen; // Port M Pullup Enable Register - UINT8 pmsel; // Port M Select Register - UINT8 unused20[180]; + uint8_t padir; // Port A Direction Register + uint8_t padata; // Port A Data Register + uint8_t unused6[1]; + uint8_t pasel; // Port A Select Register + uint8_t unused7[4]; + + uint8_t pbdir; // Port B Direction Register + uint8_t pbdata; // Port B Data Register + uint8_t unused8[1]; + uint8_t pbsel; // Port B Select Register + uint8_t unused9[4]; + + uint8_t pcdir; // Port C Direction Register + uint8_t pcdata; // Port C Data Register + uint8_t unused10[1]; + uint8_t pcsel; // Port C Select Register + uint8_t unused11[4]; + + uint8_t pddir; // Port D Direction Register + uint8_t pddata; // Port D Data Register + uint8_t pdpuen; // Port D Pullup Enable Register + uint8_t unused12[1]; + uint8_t pdpol; // Port D Polarity Register + uint8_t pdirqen; // Port D IRQ Enable Register + uint8_t pddataedge; // Port D Data Edge Level + uint8_t pdirqedge; // Port D IRQ Edge Register + + uint8_t pedir; // Port E Direction Register + uint8_t pedata; // Port E Data Register + uint8_t pepuen; // Port E Pullup Enable Register + uint8_t pesel; // Port E Select Register + uint8_t unused14[4]; + + uint8_t pfdir; // Port F Direction Register + uint8_t pfdata; // Port F Data Register + uint8_t pfpuen; // Port F Pullup Enable Register + uint8_t pfsel; // Port F Select Register + uint8_t unused15[4]; + + uint8_t pgdir; // Port G Direction Register + uint8_t pgdata; // Port G Data Register + uint8_t pgpuen; // Port G Pullup Enable Register + uint8_t pgsel; // Port G Select Register + uint8_t unused16[4]; + + uint8_t pjdir; // Port J Direction Register + uint8_t pjdata; // Port J Data Register + uint8_t unused17[1]; + uint8_t pjsel; // Port J Select Register + uint8_t unused18[4]; + uint8_t pkdir; // Port K Direction Register + uint8_t pkdata; // Port K Data Register + uint8_t pkpuen; // Port K Pullup Enable Register + uint8_t pksel; // Port K Select Register + uint8_t unused19[4]; + + uint8_t pmdir; // Port M Direction Register + uint8_t pmdata; // Port M Data Register + uint8_t pmpuen; // Port M Pullup Enable Register + uint8_t pmsel; // Port M Select Register + uint8_t unused20[180]; // $(FF)FFF500 - UINT16 pwmc; // PWM Control Register - UINT16 pwmp; // PWM Period Register - UINT16 pwmw; // PWM Width Register - UINT16 pwmcnt; // PWN Counter - UINT8 unused21[248]; + uint16_t pwmc; // PWM Control Register + uint16_t pwmp; // PWM Period Register + uint16_t pwmw; // PWM Width Register + uint16_t pwmcnt; // PWN Counter + uint8_t unused21[248]; // $(FF)FFF600 - UINT16 tctl[2]; // Timer Control Register - UINT16 tprer[2]; // Timer Prescaler Register - UINT16 tcmp[2]; // Timer Compare Register - UINT16 tcr[2]; // Timer Capture Register - UINT16 tcn[2]; // Timer Counter - UINT16 tstat[2]; // Timer Status - UINT16 wctlr; // Watchdog Control Register - UINT16 wcmpr; // Watchdog Compare Register - UINT16 wcn; // Watchdog Counter - UINT8 tclear[2]; // Timer Clearable Status - UINT8 unused22[224]; + uint16_t tctl[2]; // Timer Control Register + uint16_t tprer[2]; // Timer Prescaler Register + uint16_t tcmp[2]; // Timer Compare Register + uint16_t tcr[2]; // Timer Capture Register + uint16_t tcn[2]; // Timer Counter + uint16_t tstat[2]; // Timer Status + uint16_t wctlr; // Watchdog Control Register + uint16_t wcmpr; // Watchdog Compare Register + uint16_t wcn; // Watchdog Counter + uint8_t tclear[2]; // Timer Clearable Status + uint8_t unused22[224]; // $(FF)FFF700 - UINT16 spisr; // SPIS Register - UINT8 unused23[254]; + uint16_t spisr; // SPIS Register + uint8_t unused23[254]; // $(FF)FFF800 - UINT16 spimdata; // SPIM Data Register - UINT16 spimcont; // SPIM Control/Status Register - UINT8 unused24[252]; + uint16_t spimdata; // SPIM Data Register + uint16_t spimcont; // SPIM Control/Status Register + uint8_t unused24[252]; // $(FF)FFF900 - UINT16 ustcnt; // UART Status/Control Register - UINT16 ubaud; // UART Baud Control Register - UINT16 urx; // UART RX Register - UINT16 utx; // UART TX Register - UINT16 umisc; // UART Misc Register - UINT8 unused25[246]; + uint16_t ustcnt; // UART Status/Control Register + uint16_t ubaud; // UART Baud Control Register + uint16_t urx; // UART RX Register + uint16_t utx; // UART TX Register + uint16_t umisc; // UART Misc Register + uint8_t unused25[246]; // $(FF)FFFA00 - UINT32 lssa; // Screen Starting Address Register - UINT8 unused26[1]; - UINT8 lvpw; // Virtual Page Width Register - UINT8 unused27[2]; - UINT16 lxmax; // Screen Width Register - UINT16 lymax; // Screen Height Register - UINT8 unused28[12]; - UINT16 lcxp; // Cursor X Position - UINT16 lcyp; // Cursor Y Position - UINT16 lcwch; // Cursor Width & Height Register - UINT8 unused29[1]; - UINT8 lblkc; // Blink Control Register - UINT8 lpicf; // Panel Interface Config Register - UINT8 lpolcf; // Polarity Config Register - UINT8 unused30[1]; - UINT8 lacdrc; // ACD (M) Rate Control Register - UINT8 unused31[1]; - UINT8 lpxcd; // Pixel Clock Divider Register - UINT8 unused32[1]; - UINT8 lckcon; // Clocking Control Register - UINT8 unused33[1]; - UINT8 llbar; // Last Buffer Address Register - UINT8 unused34[1]; - UINT8 lotcr; // Octet Terminal Count Register - UINT8 unused35[1]; - UINT8 lposr; // Panning Offset Register - UINT8 unused36[3]; - UINT8 lfrcm; // Frame Rate Control Modulation Register - UINT16 lgpmr; // Gray Palette Mapping Register - UINT8 unused37[204]; + uint32_t lssa; // Screen Starting Address Register + uint8_t unused26[1]; + uint8_t lvpw; // Virtual Page Width Register + uint8_t unused27[2]; + uint16_t lxmax; // Screen Width Register + uint16_t lymax; // Screen Height Register + uint8_t unused28[12]; + uint16_t lcxp; // Cursor X Position + uint16_t lcyp; // Cursor Y Position + uint16_t lcwch; // Cursor Width & Height Register + uint8_t unused29[1]; + uint8_t lblkc; // Blink Control Register + uint8_t lpicf; // Panel Interface Config Register + uint8_t lpolcf; // Polarity Config Register + uint8_t unused30[1]; + uint8_t lacdrc; // ACD (M) Rate Control Register + uint8_t unused31[1]; + uint8_t lpxcd; // Pixel Clock Divider Register + uint8_t unused32[1]; + uint8_t lckcon; // Clocking Control Register + uint8_t unused33[1]; + uint8_t llbar; // Last Buffer Address Register + uint8_t unused34[1]; + uint8_t lotcr; // Octet Terminal Count Register + uint8_t unused35[1]; + uint8_t lposr; // Panning Offset Register + uint8_t unused36[3]; + uint8_t lfrcm; // Frame Rate Control Modulation Register + uint16_t lgpmr; // Gray Palette Mapping Register + uint8_t unused37[204]; // $(FF)FFFB00 - UINT32 hmsr; // RTC Hours Minutes Seconds Register - UINT32 alarm; // RTC Alarm Register - UINT8 unused38[4]; - UINT16 rtcctl; // RTC Control Register - UINT16 rtcisr; // RTC Interrupt Status Register - UINT16 rtcienr; // RTC Interrupt Enable Register - UINT16 stpwtch; // Stopwatch Minutes - UINT8 unused42[1260]; + uint32_t hmsr; // RTC Hours Minutes Seconds Register + uint32_t alarm; // RTC Alarm Register + uint8_t unused38[4]; + uint16_t rtcctl; // RTC Control Register + uint16_t rtcisr; // RTC Interrupt Status Register + uint16_t rtcienr; // RTC Interrupt Enable Register + uint16_t stpwtch; // Stopwatch Minutes + uint8_t unused42[1260]; }; class mc68328_device : public device_t { public: - mc68328_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc68328_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mc68328_device() {} static void static_set_cpu_tag(device_t &device, const char *tag) { downcast(device).m_cpu.set_tag(tag); } @@ -639,9 +639,9 @@ public: DECLARE_WRITE16_MEMBER(write); DECLARE_READ16_MEMBER(read); DECLARE_WRITE_LINE_MEMBER(set_penirq_line); - void set_port_d_lines(UINT8 state, int bit); + void set_port_d_lines(uint8_t state, int bit); - 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 @@ -650,11 +650,11 @@ protected: private: // internal state - void set_interrupt_line(UINT32 line, UINT32 active); + void set_interrupt_line(uint32_t line, uint32_t active); void poll_port_d_interrupts(); - UINT32 get_timer_frequency(UINT32 index); - void maybe_start_timer(UINT32 index, UINT32 new_enable); - void timer_compare_event(UINT32 index); + uint32_t get_timer_frequency(uint32_t index); + void maybe_start_timer(uint32_t index, uint32_t new_enable); + void timer_compare_event(uint32_t index); void register_state_save(); diff --git a/src/devices/machine/mc6843.cpp b/src/devices/machine/mc6843.cpp index 04a7b6a0906..a7b0684d2cd 100644 --- a/src/devices/machine/mc6843.cpp +++ b/src/devices/machine/mc6843.cpp @@ -74,7 +74,7 @@ static const char *const mc6843_cmd[16] = const device_type MC6843 = &device_creator; -mc6843_device::mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6843_device::mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC6843, "MC6843 floppy controller", tag, owner, clock, "mc6843", __FILE__), m_write_irq(*this), m_CTAR(0), @@ -164,7 +164,7 @@ void mc6843_device::device_reset() -legacy_floppy_image_device* mc6843_device::floppy_image( UINT8 drive ) +legacy_floppy_image_device* mc6843_device::floppy_image( uint8_t drive ) { legacy_floppy_image_device *img = floppy_get_device( machine(), drive ); if (!img && owner()) { @@ -480,7 +480,7 @@ void mc6843_device::device_timer(emu_timer &timer, device_timer_id id, int param READ8_MEMBER( mc6843_device::read ) { - UINT8 data = 0; + uint8_t data = 0; switch ( offset ) { case 0: /* Data Input Register (DIR) */ @@ -680,7 +680,7 @@ WRITE8_MEMBER( mc6843_device::write ) else if ( (cmd == CMD_FFW) && FWF ) { /* assume we are formatting */ - UINT8 nibble; + uint8_t nibble; nibble = (data & 0x01) | ((data & 0x04) >> 1 )| @@ -704,9 +704,9 @@ WRITE8_MEMBER( mc6843_device::write ) { /* valid address id field */ legacy_floppy_image_device* img = floppy_image( ); - UINT8 track = m_data[1]; - UINT8 sector = m_data[3]; - UINT8 filler = 0xe5; /* standard Thomson filler */ + uint8_t track = m_data[1]; + uint8_t sector = m_data[3]; + uint8_t filler = 0xe5; /* standard Thomson filler */ LOG(( "%f %s mc6843_w: address id detected track=%i sector=%i\n", machine().time().as_double(), machine().describe_context(), track, sector)); img->floppy_drive_format_sector( m_side, sector, track, 0, sector, 0, filler ); } diff --git a/src/devices/machine/mc6843.h b/src/devices/machine/mc6843.h index 9dea3271e0d..73b21140f1a 100644 --- a/src/devices/machine/mc6843.h +++ b/src/devices/machine/mc6843.h @@ -19,7 +19,7 @@ class mc6843_device : public device_t { public: - mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mc6843_device() {} template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } @@ -46,30 +46,30 @@ private: devcb_write_line m_write_irq; /* registers */ - UINT8 m_CTAR; /* current track */ - UINT8 m_CMR; /* command */ - UINT8 m_ISR; /* interrupt status */ - UINT8 m_SUR; /* set-up */ - UINT8 m_STRA; /* status */ - UINT8 m_STRB; /* status */ - UINT8 m_SAR; /* sector address */ - UINT8 m_GCR; /* general count */ - UINT8 m_CCR; /* CRC control */ - UINT8 m_LTAR; /* logical address track (=track destination) */ + uint8_t m_CTAR; /* current track */ + uint8_t m_CMR; /* command */ + uint8_t m_ISR; /* interrupt status */ + uint8_t m_SUR; /* set-up */ + uint8_t m_STRA; /* status */ + uint8_t m_STRB; /* status */ + uint8_t m_SAR; /* sector address */ + uint8_t m_GCR; /* general count */ + uint8_t m_CCR; /* CRC control */ + uint8_t m_LTAR; /* logical address track (=track destination) */ /* internal state */ - UINT8 m_drive; - UINT8 m_side; - UINT8 m_data[128]; /* sector buffer */ - UINT32 m_data_size; /* size of data */ - UINT32 m_data_idx; /* current read/write position in data */ - UINT32 m_data_id; /* chrd_id for sector write */ - UINT8 m_index_pulse; + uint8_t m_drive; + uint8_t m_side; + uint8_t m_data[128]; /* sector buffer */ + uint32_t m_data_size; /* size of data */ + uint32_t m_data_idx; /* current read/write position in data */ + uint32_t m_data_id; /* chrd_id for sector write */ + uint8_t m_index_pulse; /* trigger delayed actions (bottom halves) */ emu_timer* m_timer_cont; - legacy_floppy_image_device* floppy_image(UINT8 drive); + legacy_floppy_image_device* floppy_image(uint8_t drive); legacy_floppy_image_device* floppy_image(); void status_update(); void cmd_end(); diff --git a/src/devices/machine/mc6846.cpp b/src/devices/machine/mc6846.cpp index 5958ba87f9b..d2cbc0ecdbb 100644 --- a/src/devices/machine/mc6846.cpp +++ b/src/devices/machine/mc6846.cpp @@ -45,7 +45,7 @@ const device_type MC6846 = &device_creator; -mc6846_device::mc6846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6846_device::mc6846_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC6846, "MC6846 Programmable Timer", tag, owner, clock, "mc6846", __FILE__), m_out_port_cb(*this), m_out_cp1_cb(*this), @@ -125,7 +125,7 @@ void mc6846_device::device_reset() } -inline UINT16 mc6846_device::counter() +inline uint16_t mc6846_device::counter() { if ( m_timer_started ) { @@ -477,7 +477,7 @@ WRITE8_MEMBER(mc6846_device::write) break; case 7: - m_latch = ( ((UINT16) m_time_MSB) << 8 ) + data; + m_latch = ( ((uint16_t) m_time_MSB) << 8 ) + data; LOG (( "%s %f: mc6846 COUNT write %i\n", machine().describe_context(), space.machine().time().as_double(), m_latch )); if (!(m_tcr & 0x38)) { @@ -541,28 +541,28 @@ void mc6846_device::set_input_cp2(int data) -UINT8 mc6846_device::get_output_port() +uint8_t mc6846_device::get_output_port() { return PORT; } -UINT8 mc6846_device::get_output_cto() +uint8_t mc6846_device::get_output_cto() { return CTO; } -UINT8 mc6846_device::get_output_cp2() +uint8_t mc6846_device::get_output_cp2() { return m_cp2_cpu; } -UINT16 mc6846_device::get_preset() +uint16_t mc6846_device::get_preset() { return m_preset; } diff --git a/src/devices/machine/mc6846.h b/src/devices/machine/mc6846.h index b174000b739..ef8794c1ebc 100644 --- a/src/devices/machine/mc6846.h +++ b/src/devices/machine/mc6846.h @@ -34,7 +34,7 @@ class mc6846_device : public device_t { public: - mc6846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6846_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mc6846_device() {} template static devcb_base &set_out_port_callback(device_t &device, _Object object) { return downcast(device).m_out_port_cb.set_callback(object); } @@ -53,12 +53,12 @@ public: void set_input_cp2(int data); /* polling from outside world */ - UINT8 get_output_port(); - UINT8 get_output_cto(); - UINT8 get_output_cp2(); + uint8_t get_output_port(); + uint8_t get_output_cto(); + uint8_t get_output_cp2(); /* partial access to internal state */ - UINT16 get_preset(); /* timer interval - 1 in us */ + uint16_t get_preset(); /* timer interval - 1 in us */ protected: // device-level overrides @@ -69,26 +69,26 @@ private: // internal state /* registers */ - UINT8 m_csr; /* 0,4: combination status register */ - UINT8 m_pcr; /* 1: peripheral control register */ - UINT8 m_ddr; /* 2: data direction register */ - UINT8 m_pdr; /* 3: peripheral data register (last cpu write) */ - UINT8 m_tcr; /* 5: timer control register */ + uint8_t m_csr; /* 0,4: combination status register */ + uint8_t m_pcr; /* 1: peripheral control register */ + uint8_t m_ddr; /* 2: data direction register */ + uint8_t m_pdr; /* 3: peripheral data register (last cpu write) */ + uint8_t m_tcr; /* 5: timer control register */ /* lines */ - UINT8 m_cp1; /* 1-bit input */ - UINT8 m_cp2; /* 1-bit input/output: last external write */ - UINT8 m_cp2_cpu; /* last cpu write */ - UINT8 m_cto; /* 1-bit timer output (unmasked) */ + uint8_t m_cp1; /* 1-bit input */ + uint8_t m_cp2; /* 1-bit input/output: last external write */ + uint8_t m_cp2_cpu; /* last cpu write */ + uint8_t m_cto; /* 1-bit timer output (unmasked) */ /* internal state */ - UINT8 m_time_MSB; /* MSB buffer register */ - UINT8 m_csr0_to_be_cleared; - UINT8 m_csr1_to_be_cleared; - UINT8 m_csr2_to_be_cleared; - UINT16 m_latch; /* timer latch */ - UINT16 m_preset; /* preset value */ - UINT8 m_timer_started; + uint8_t m_time_MSB; /* MSB buffer register */ + uint8_t m_csr0_to_be_cleared; + uint8_t m_csr1_to_be_cleared; + uint8_t m_csr2_to_be_cleared; + uint16_t m_latch; /* timer latch */ + uint16_t m_preset; /* preset value */ + uint8_t m_timer_started; /* timers */ emu_timer *m_interval; /* interval programmable timer */ @@ -111,7 +111,7 @@ private: int m_old_cif; int m_old_cto; - inline UINT16 counter(); + inline uint16_t counter(); inline void update_irq(); inline void update_cto(); inline void timer_launch(); diff --git a/src/devices/machine/mc6852.cpp b/src/devices/machine/mc6852.cpp index e4a5ffbf1fd..fe0c25e86da 100644 --- a/src/devices/machine/mc6852.cpp +++ b/src/devices/machine/mc6852.cpp @@ -48,7 +48,7 @@ const device_type MC6852 = &device_creator; // mc6852_device - constructor //------------------------------------------------- -mc6852_device::mc6852_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mc6852_device::mc6852_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC6852, "MC6852", tag, owner, clock, "mc6852", __FILE__), device_serial_interface(mconfig, *this), m_write_tx_data(*this), @@ -101,8 +101,8 @@ void mc6852_device::device_start() void mc6852_device::device_reset() { - m_rx_fifo = std::queue(); - m_tx_fifo = std::queue(); + m_rx_fifo = std::queue(); + m_tx_fifo = std::queue(); receive_register_reset(); transmit_register_reset(); @@ -163,7 +163,7 @@ void mc6852_device::rcv_complete() READ8_MEMBER( mc6852_device::read ) { - UINT8 data = 0; + uint8_t data = 0; if (BIT(offset, 0)) { diff --git a/src/devices/machine/mc6852.h b/src/devices/machine/mc6852.h index 4987c64729b..1e0bdeb00c4 100644 --- a/src/devices/machine/mc6852.h +++ b/src/devices/machine/mc6852.h @@ -66,7 +66,7 @@ class mc6852_device : public device_t, { public: // construction/destruction - mc6852_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6852_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_rx_clock(device_t &device, int clock) { downcast(device).m_rx_clock = clock; } static void set_tx_clock(device_t &device, int clock) { downcast(device).m_tx_clock = clock; } @@ -155,16 +155,16 @@ private: devcb_write_line m_write_sm_dtr; devcb_write_line m_write_tuf; - UINT8 m_status; // status register - UINT8 m_cr[3]; // control registers - UINT8 m_scr; // sync code register - UINT8 m_tdr; // transmit data register - UINT8 m_tsr; // transmit shift register - UINT8 m_rdr; // receive data register - UINT8 m_rsr; // receive shift register + uint8_t m_status; // status register + uint8_t m_cr[3]; // control registers + uint8_t m_scr; // sync code register + uint8_t m_tdr; // transmit data register + uint8_t m_tsr; // transmit shift register + uint8_t m_rdr; // receive data register + uint8_t m_rsr; // receive shift register - std::queue m_rx_fifo; - std::queue m_tx_fifo; + std::queue m_rx_fifo; + std::queue m_tx_fifo; int m_rx_clock; int m_tx_clock; diff --git a/src/devices/machine/mc6854.cpp b/src/devices/machine/mc6854.cpp index 3461d58dde5..079d138966e 100644 --- a/src/devices/machine/mc6854.cpp +++ b/src/devices/machine/mc6854.cpp @@ -167,7 +167,7 @@ static const int word_length[4] = { 5, 6, 7, 8 }; const device_type MC6854 = &device_creator; -mc6854_device::mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6854_device::mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC6854, "MC6854 ADLC", tag, owner, clock, "mc6854", __FILE__), m_out_irq_cb(*this), m_out_txd_cb(*this), @@ -262,14 +262,14 @@ void mc6854_device::device_reset() /* MC6854 fills bit queue */ -void mc6854_device::send_bits( UINT32 data, int len, int zi ) +void mc6854_device::send_bits( uint32_t data, int len, int zi ) { attotime expire; int i; if ( zi ) { /* zero-insertion mode */ - UINT32 d = 0; + uint32_t d = 0; int l = 0; for ( i = 0; i < len; i++, data >>= 1, l++ ) { @@ -310,7 +310,7 @@ void mc6854_device::send_bits( UINT32 data, int len, int zi ) /* CPU push -> tfifo[0] -> ... -> tfifo[MC6854_FIFO_SIZE-1] -> pop */ -void mc6854_device::tfifo_push( UINT8 data ) +void mc6854_device::tfifo_push( uint8_t data ) { int i; @@ -476,7 +476,7 @@ void mc6854_device::tfifo_clear( ) /* MC6854 pushes a field in the FIFO */ -void mc6854_device::rfifo_push( UINT8 d ) +void mc6854_device::rfifo_push( uint8_t d ) { int i, blen = 8; unsigned data = d; @@ -577,7 +577,7 @@ void mc6854_device::rfifo_terminate( ) /* CPU pops the FIFO */ -UINT8 mc6854_device::rfifo_pop( ) +uint8_t mc6854_device::rfifo_pop( ) { int i, data = m_rfifo[ MC6854_FIFO_SIZE - 1 ]; @@ -684,7 +684,7 @@ void mc6854_device::rfifo_clear( ) -int mc6854_device::send_frame( UINT8* data, int len ) +int mc6854_device::send_frame( uint8_t* data, int len ) { if ( m_rstate > 1 || m_tstate > 1 || RTS ) return -1; /* busy */ @@ -837,7 +837,7 @@ READ8_MEMBER( mc6854_device::read ) case 2: /* receiver data register */ case 3: { - UINT8 data = rfifo_pop( ); + uint8_t data = rfifo_pop( ); LOG(( "%f %s mc6854_r: get data $%02X\n", space.machine().time().as_double(), machine().describe_context(), data )); return data; diff --git a/src/devices/machine/mc6854.h b/src/devices/machine/mc6854.h index 9c665d0429b..7f6c3ef9fc3 100644 --- a/src/devices/machine/mc6854.h +++ b/src/devices/machine/mc6854.h @@ -18,8 +18,8 @@ #define MC6854_FIFO_SIZE 3 /* hardcoded size of the 6854 FIFO (this is a hardware limit) */ -typedef device_delegate mc6854_out_frame_delegate; -#define MC6854_OUT_FRAME_CB(name) void name(UINT8 * data, int length) +typedef device_delegate mc6854_out_frame_delegate; +#define MC6854_OUT_FRAME_CB(name) void name(uint8_t * data, int length) #define MCFG_MC6854_OUT_IRQ_CB(_devcb) \ @@ -41,7 +41,7 @@ typedef device_delegate mc6854_out_frame_delegat class mc6854_device : public device_t { public: - mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mc6854_device() {} template static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_cb.set_callback(object); } @@ -58,7 +58,7 @@ public: DECLARE_WRITE_LINE_MEMBER( set_rx ); /* high-level, frame-based interface */ - int send_frame( UINT8* data, int length ); /* ret -1 if busy */ + int send_frame( uint8_t* data, int length ); /* ret -1 if busy */ /* control lines */ DECLARE_WRITE_LINE_MEMBER( set_cts ); /* 1 = clear-to-send, 0 = busy */ @@ -88,27 +88,27 @@ private: devcb_write_line m_out_dtr_cb; /* 1 = data transmit ready, 0 = busy */ /* registers */ - UINT8 m_cr1, m_cr2, m_cr3, m_cr4; /* control registers */ - UINT8 m_sr1, m_sr2; /* status registers */ + uint8_t m_cr1, m_cr2, m_cr3, m_cr4; /* control registers */ + uint8_t m_sr1, m_sr2; /* status registers */ - UINT8 m_cts, m_dcd; + uint8_t m_cts, m_dcd; /* transmit state */ - UINT8 m_tstate; - UINT16 m_tfifo[MC6854_FIFO_SIZE]; /* X x 8-bit FIFO + full & last marker bits */ - UINT8 m_tones; /* counter for zero-insertion */ + uint8_t m_tstate; + uint16_t m_tfifo[MC6854_FIFO_SIZE]; /* X x 8-bit FIFO + full & last marker bits */ + uint8_t m_tones; /* counter for zero-insertion */ emu_timer *m_ttimer; /* when to ask for more data */ /* receive state */ - UINT8 m_rstate; - UINT32 m_rreg; /* shift register */ - UINT8 m_rones; /* count '1 bits */ - UINT8 m_rsize; /* bits in the shift register */ - UINT16 m_rfifo[MC6854_FIFO_SIZE]; /* X x 8-bit FIFO + full & addr marker bits */ + uint8_t m_rstate; + uint32_t m_rreg; /* shift register */ + uint8_t m_rones; /* count '1 bits */ + uint8_t m_rsize; /* bits in the shift register */ + uint16_t m_rfifo[MC6854_FIFO_SIZE]; /* X x 8-bit FIFO + full & addr marker bits */ /* frame-based interface*/ - UINT8 m_frame[MAX_FRAME_LENGTH]; - UINT32 m_flen, m_fpos; + uint8_t m_frame[MAX_FRAME_LENGTH]; + uint32_t m_flen, m_fpos; /* meaning of tstate / rtate: @@ -120,15 +120,15 @@ private: 6 = variable-length data field(s) */ - void send_bits( UINT32 data, int len, int zi ); - void tfifo_push( UINT8 data ); + void send_bits( uint32_t data, int len, int zi ); + void tfifo_push( uint8_t data ); void tfifo_terminate( ); TIMER_CALLBACK_MEMBER(tfifo_cb); void tfifo_clear( ); - void rfifo_push( UINT8 d ); + void rfifo_push( uint8_t d ); void rfifo_terminate( ); - UINT8 rfifo_pop( ); + uint8_t rfifo_pop( ); void rfifo_clear( ); void update_sr2( ); diff --git a/src/devices/machine/mc68681.cpp b/src/devices/machine/mc68681.cpp index de8ede60fda..577b9355c39 100644 --- a/src/devices/machine/mc68681.cpp +++ b/src/devices/machine/mc68681.cpp @@ -64,7 +64,7 @@ MACHINE_CONFIG_END // LIVE DEVICE //************************************************************************** -mc68681_device::mc68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc68681_device::mc68681_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC68681, "MC68681 DUART", tag, owner, clock, "mc68681", __FILE__), m_chanA(*this, CHANA_TAG), m_chanB(*this, CHANB_TAG), @@ -250,7 +250,7 @@ double mc68681_device::duart68681_get_ct_rate() return rate; } -UINT16 mc68681_device::duart68681_get_ct_count() +uint16_t mc68681_device::duart68681_get_ct_count() { double clock = duart68681_get_ct_rate(); return (duart_timer->remaining() * clock).as_double(); @@ -279,7 +279,7 @@ TIMER_CALLBACK_MEMBER( mc68681_device::duart_timer_callback ) // timer driving any serial channels? if (BIT(ACR, 7) == 1) { - UINT8 csr = m_chanA->get_chan_CSR(); + uint8_t csr = m_chanA->get_chan_CSR(); if ((csr & 0xf0) == 0xd0) // tx is timer driven { @@ -307,7 +307,7 @@ TIMER_CALLBACK_MEMBER( mc68681_device::duart_timer_callback ) update_interrupts(); } - int count = std::max(CTR.w.l, UINT16(1)); + int count = std::max(CTR.w.l, uint16_t(1)); duart68681_start_ct(count); } else @@ -322,7 +322,7 @@ TIMER_CALLBACK_MEMBER( mc68681_device::duart_timer_callback ) READ8_MEMBER( mc68681_device::read ) { - UINT8 r = 0xff; + uint8_t r = 0xff; offset &= 0xf; @@ -400,7 +400,7 @@ READ8_MEMBER( mc68681_device::read ) half_period = 0; } - int count = std::max(CTR.w.l, UINT16(1)); + int count = std::max(CTR.w.l, uint16_t(1)); duart68681_start_ct(count); break; } @@ -439,7 +439,7 @@ WRITE8_MEMBER( mc68681_device::write ) case 0x04: /* ACR */ { - UINT8 old_acr = ACR; + uint8_t old_acr = ACR; ACR = data; // bits 6-4: Counter/Timer Mode And Clock Source Select @@ -449,7 +449,7 @@ WRITE8_MEMBER( mc68681_device::write ) if (data & 0x40) { // Entering timer mode - UINT16 count = std::max(CTR.w.l, UINT16(1)); + uint16_t count = std::max(CTR.w.l, uint16_t(1)); half_period = 0; duart68681_start_ct(count); @@ -518,7 +518,7 @@ WRITE8_MEMBER( mc68681_device::write ) WRITE_LINE_MEMBER( mc68681_device::ip0_w ) { - UINT8 newIP = (IP_last_state & ~0x01) | ((state == ASSERT_LINE) ? 1 : 0); + uint8_t newIP = (IP_last_state & ~0x01) | ((state == ASSERT_LINE) ? 1 : 0); if (newIP != IP_last_state) { @@ -538,7 +538,7 @@ WRITE_LINE_MEMBER( mc68681_device::ip0_w ) WRITE_LINE_MEMBER( mc68681_device::ip1_w ) { - UINT8 newIP = (IP_last_state & ~0x02) | ((state == ASSERT_LINE) ? 2 : 0); + uint8_t newIP = (IP_last_state & ~0x02) | ((state == ASSERT_LINE) ? 2 : 0); if (newIP != IP_last_state) { @@ -558,7 +558,7 @@ WRITE_LINE_MEMBER( mc68681_device::ip1_w ) WRITE_LINE_MEMBER( mc68681_device::ip2_w ) { - UINT8 newIP = (IP_last_state & ~0x04) | ((state == ASSERT_LINE) ? 4 : 0); + uint8_t newIP = (IP_last_state & ~0x04) | ((state == ASSERT_LINE) ? 4 : 0); if (newIP != IP_last_state) { @@ -578,7 +578,7 @@ WRITE_LINE_MEMBER( mc68681_device::ip2_w ) WRITE_LINE_MEMBER( mc68681_device::ip3_w ) { - UINT8 newIP = (IP_last_state & ~0x08) | ((state == ASSERT_LINE) ? 8 : 0); + uint8_t newIP = (IP_last_state & ~0x08) | ((state == ASSERT_LINE) ? 8 : 0); if (newIP != IP_last_state) { @@ -598,14 +598,14 @@ WRITE_LINE_MEMBER( mc68681_device::ip3_w ) WRITE_LINE_MEMBER( mc68681_device::ip4_w ) { - UINT8 newIP = (IP_last_state & ~0x10) | ((state == ASSERT_LINE) ? 0x10 : 0); + uint8_t newIP = (IP_last_state & ~0x10) | ((state == ASSERT_LINE) ? 0x10 : 0); // TODO: special mode for ip4 (Ch. A Rx clock) IP_last_state = newIP; } WRITE_LINE_MEMBER( mc68681_device::ip5_w ) { - UINT8 newIP = (IP_last_state & ~0x20) | ((state == ASSERT_LINE) ? 0x20 : 0); + uint8_t newIP = (IP_last_state & ~0x20) | ((state == ASSERT_LINE) ? 0x20 : 0); // TODO: special mode for ip5 (Ch. B Tx clock) IP_last_state = newIP; } @@ -620,7 +620,7 @@ mc68681_channel *mc68681_device::get_channel(int chan) return m_chanB; } -int mc68681_device::calc_baud(int ch, UINT8 data) +int mc68681_device::calc_baud(int ch, uint8_t data) { int baud_rate; @@ -676,7 +676,7 @@ void mc68681_device::set_ISR_bits(int mask) // DUART channel class stuff -mc68681_channel::mc68681_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc68681_channel::mc68681_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC68681_CHANNEL, "MC68681 DUART CHANNEL", tag, owner, clock, "mc68681_channel", __FILE__), device_serial_interface(mconfig, *this), MR1(0), @@ -908,9 +908,9 @@ void mc68681_channel::update_interrupts() //logerror("DEBUG: 68681 int check: after receiver test, SR%c is %02X, ISR is %02X\n", (ch+0x41), duart68681->channel[ch].SR, duart68681->ISR); } -UINT8 mc68681_channel::read_rx_fifo() +uint8_t mc68681_channel::read_rx_fifo() { - UINT8 rv; + uint8_t rv; // printf("read_rx_fifo: rx_fifo_num %d\n", rx_fifo_num); @@ -935,9 +935,9 @@ UINT8 mc68681_channel::read_rx_fifo() return rv; } -UINT8 mc68681_channel::read_chan_reg(int reg) +uint8_t mc68681_channel::read_chan_reg(int reg) { - UINT8 rv = 0xff; + uint8_t rv = 0xff; switch (reg) { @@ -968,7 +968,7 @@ UINT8 mc68681_channel::read_chan_reg(int reg) return rv; } -void mc68681_channel::write_chan_reg(int reg, UINT8 data) +void mc68681_channel::write_chan_reg(int reg, uint8_t data) { switch (reg) { @@ -995,7 +995,7 @@ void mc68681_channel::write_chan_reg(int reg, UINT8 data) } } -void mc68681_channel::write_MR(UINT8 data) +void mc68681_channel::write_MR(uint8_t data) { if ( MR_ptr == 0 ) { @@ -1070,7 +1070,7 @@ void mc68681_channel::recalc_framing() set_data_frame(1, (MR1 & 3)+5, parity, stopbits); } -void mc68681_channel::write_CR(UINT8 data) +void mc68681_channel::write_CR(uint8_t data) { CR = data; @@ -1148,7 +1148,7 @@ void mc68681_channel::write_CR(UINT8 data) update_interrupts(); } -void mc68681_channel::write_TX(UINT8 data) +void mc68681_channel::write_TX(uint8_t data) { tx_data = data; @@ -1178,7 +1178,7 @@ void mc68681_channel::ACR_updated() write_chan_reg(1, CSR); } -UINT8 mc68681_channel::get_chan_CSR() +uint8_t mc68681_channel::get_chan_CSR() { return CSR; } diff --git a/src/devices/machine/mc68681.h b/src/devices/machine/mc68681.h index abae110dbac..f2093fc66cc 100644 --- a/src/devices/machine/mc68681.h +++ b/src/devices/machine/mc68681.h @@ -38,7 +38,7 @@ class mc68681_device; class mc68681_channel : public device_t, public device_serial_interface { public: - mc68681_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc68681_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -50,31 +50,31 @@ public: virtual void tra_complete() override; // Tx completed sending byte virtual void tra_callback() override; // Tx send bit - UINT8 read_chan_reg(int reg); - void write_chan_reg(int reg, UINT8 data); + uint8_t read_chan_reg(int reg); + void write_chan_reg(int reg, uint8_t data); void update_interrupts(); - UINT8 read_rx_fifo(); + uint8_t read_rx_fifo(); void ACR_updated(); - UINT8 get_chan_CSR(); + uint8_t get_chan_CSR(); private: /* Registers */ - UINT8 CR; /* Command register */ - UINT8 CSR; /* Clock select register */ - UINT8 MR1; /* Mode register 1 */ - UINT8 MR2; /* Mode register 2 */ - UINT8 MR_ptr; /* Mode register pointer */ - UINT8 SR; /* Status register */ + uint8_t CR; /* Command register */ + uint8_t CSR; /* Clock select register */ + uint8_t MR1; /* Mode register 1 */ + uint8_t MR2; /* Mode register 2 */ + uint8_t MR_ptr; /* Mode register pointer */ + uint8_t SR; /* Status register */ /* State */ int tx_baud_rate, rx_baud_rate; /* Receiver */ - UINT8 rx_enabled; - UINT8 rx_fifo[MC68681_RX_FIFO_SIZE]; + uint8_t rx_enabled; + uint8_t rx_fifo[MC68681_RX_FIFO_SIZE]; int rx_fifo_read_ptr; int rx_fifo_write_ptr; int rx_fifo_num; @@ -82,15 +82,15 @@ private: int m_ch; /* Transmitter */ - UINT8 tx_enabled; - UINT8 tx_data; - UINT8 tx_ready; + uint8_t tx_enabled; + uint8_t tx_data; + uint8_t tx_ready; mc68681_device *m_uart; - void write_MR(UINT8 data); - void write_CR(UINT8 data); - void write_TX(UINT8 data); + void write_MR(uint8_t data); + void write_CR(uint8_t data); + void write_TX(uint8_t data); void recalc_framing(); }; @@ -99,7 +99,7 @@ class mc68681_device : public device_t friend class mc68681_channel; public: - mc68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc68681_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_chanA; required_device m_chanB; @@ -110,10 +110,10 @@ public: // API DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); - UINT8 get_irq_vector() { m_read_vector = true; return IVR; } + uint8_t get_irq_vector() { m_read_vector = true; return IVR; } - DECLARE_WRITE_LINE_MEMBER( rx_a_w ) { m_chanA->device_serial_interface::rx_w((UINT8)state); } - DECLARE_WRITE_LINE_MEMBER( rx_b_w ) { m_chanB->device_serial_interface::rx_w((UINT8)state); } + DECLARE_WRITE_LINE_MEMBER( rx_a_w ) { m_chanA->device_serial_interface::rx_w((uint8_t)state); } + DECLARE_WRITE_LINE_MEMBER( rx_b_w ) { m_chanB->device_serial_interface::rx_w((uint8_t)state); } template static devcb_base &set_irq_cb(device_t &device, _Object object) { return downcast(device).write_irq.set_callback(object); } template static devcb_base &set_a_tx_cb(device_t &device, _Object object) { return downcast(device).write_a_tx.set_callback(object); } @@ -124,7 +124,7 @@ public: devcb_write_line write_irq, write_a_tx, write_b_tx; devcb_read8 read_inport; devcb_write8 write_outport; - INT32 ip3clk, ip4clk, ip5clk, ip6clk; + int32_t ip3clk, ip4clk, ip5clk, ip6clk; // new-style push handlers for input port bits DECLARE_WRITE_LINE_MEMBER( ip0_w ); @@ -144,28 +144,28 @@ private: TIMER_CALLBACK_MEMBER( duart_timer_callback ); /* registers */ - UINT8 ACR; /* Auxiliary Control Register */ - UINT8 IMR; /* Interrupt Mask Register */ - UINT8 ISR; /* Interrupt Status Register */ - UINT8 IVR; /* Interrupt Vector Register */ - UINT8 OPCR; /* Output Port Conf. Register */ - UINT8 OPR; /* Output Port Register */ + uint8_t ACR; /* Auxiliary Control Register */ + uint8_t IMR; /* Interrupt Mask Register */ + uint8_t ISR; /* Interrupt Status Register */ + uint8_t IVR; /* Interrupt Vector Register */ + uint8_t OPCR; /* Output Port Conf. Register */ + uint8_t OPR; /* Output Port Register */ PAIR CTR; /* Counter/Timer Preset Value */ - UINT8 IPCR; /* Input Port Control Register */ + uint8_t IPCR; /* Input Port Control Register */ bool m_read_vector; // if this is read and IRQ is active, it counts as pulling IACK /* state */ - UINT8 IP_last_state; /* last state of IP bits */ + uint8_t IP_last_state; /* last state of IP bits */ /* timer */ - UINT8 half_period; + uint8_t half_period; emu_timer *duart_timer; double duart68681_get_ct_rate(); - UINT16 duart68681_get_ct_count(); + uint16_t duart68681_get_ct_count(); void duart68681_start_ct(int count); - int calc_baud(int ch, UINT8 data); + int calc_baud(int ch, uint8_t data); int get_ch(mc68681_channel *ch) { return (ch == m_chanA) ? 0 : 1; } void clear_ISR_bits(int mask); void set_ISR_bits(int mask); diff --git a/src/devices/machine/mc68901.cpp b/src/devices/machine/mc68901.cpp index 4d35d2a2c44..fa6256f1871 100644 --- a/src/devices/machine/mc68901.cpp +++ b/src/devices/machine/mc68901.cpp @@ -189,7 +189,7 @@ inline void mc68901_device::check_interrupts() } } -inline void mc68901_device::take_interrupt(UINT16 mask) +inline void mc68901_device::take_interrupt(uint16_t mask) { m_ipr |= mask; @@ -315,7 +315,7 @@ inline void mc68901_device::gpio_input(int bit, int state) void mc68901_device::gpio_output() { - UINT8 new_gpio_output = m_gpip & m_ddr; + uint8_t new_gpio_output = m_gpip & m_ddr; if (m_gpio_output != new_gpio_output) { @@ -332,7 +332,7 @@ void mc68901_device::gpio_output() // mc68901_device - constructor //------------------------------------------------- -mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC68901, "MC68901 MFP", tag, owner, clock, "mc68901", __FILE__), device_serial_interface(mconfig, *this), m_timer_clock(0), @@ -571,7 +571,7 @@ READ8_MEMBER( mc68901_device::read ) case REGISTER_TSR: { /* clear UE bit (in reality, this won't be cleared until one full clock cycle of the transmitter has passed since the bit was set) */ - UINT8 tsr = m_tsr; + uint8_t tsr = m_tsr; m_tsr &= ~TSR_UNDERRUN_ERROR; return tsr; @@ -591,7 +591,7 @@ READ8_MEMBER( mc68901_device::read ) // register_w - //------------------------------------------------- -void mc68901_device::register_w(offs_t offset, UINT8 data) +void mc68901_device::register_w(offs_t offset, uint8_t data) { switch (offset) { diff --git a/src/devices/machine/mc68901.h b/src/devices/machine/mc68901.h index 9bbe8ee2280..a99fa0fe62d 100644 --- a/src/devices/machine/mc68901.h +++ b/src/devices/machine/mc68901.h @@ -94,7 +94,7 @@ class mc68901_device : public device_t, { public: // construction/destruction - mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_timer_clock(device_t &device, int timer_clock) { downcast(device).m_timer_clock = timer_clock; } static void set_rx_clock(device_t &device, int rx_clock) { downcast(device).m_rx_clock = rx_clock; } @@ -140,14 +140,14 @@ protected: virtual void rcv_complete() override; void check_interrupts(); - void take_interrupt(UINT16 mask); + void take_interrupt(uint16_t mask); void rx_buffer_full(); void rx_error(); void timer_count(int index); void timer_input(int index, int value); void gpio_input(int bit, int state); void gpio_output(); - void register_w(offs_t offset, UINT8 data); + void register_w(offs_t offset, uint8_t data); private: enum @@ -260,34 +260,34 @@ private: //int m_device_type; /* device type */ /* registers */ - UINT8 m_gpip; /* general purpose I/O register */ - UINT8 m_aer; /* active edge register */ - UINT8 m_ddr; /* data direction register */ - - UINT16 m_ier; /* interrupt enable register */ - UINT16 m_ipr; /* interrupt pending register */ - UINT16 m_isr; /* interrupt in-service register */ - UINT16 m_imr; /* interrupt mask register */ - UINT8 m_vr; /* vector register */ - - UINT8 m_tacr; /* timer A control register */ - UINT8 m_tbcr; /* timer B control register */ - UINT8 m_tcdcr; /* timers C and D control register */ - UINT8 m_tdr[4]; /* timer data registers */ - - UINT8 m_scr; /* synchronous character register */ - UINT8 m_ucr; /* USART control register */ - UINT8 m_tsr; /* transmitter status register */ - UINT8 m_rsr; /* receiver status register */ - UINT8 m_transmit_buffer; /* USART data register */ + uint8_t m_gpip; /* general purpose I/O register */ + uint8_t m_aer; /* active edge register */ + uint8_t m_ddr; /* data direction register */ + + uint16_t m_ier; /* interrupt enable register */ + uint16_t m_ipr; /* interrupt pending register */ + uint16_t m_isr; /* interrupt in-service register */ + uint16_t m_imr; /* interrupt mask register */ + uint8_t m_vr; /* vector register */ + + uint8_t m_tacr; /* timer A control register */ + uint8_t m_tbcr; /* timer B control register */ + uint8_t m_tcdcr; /* timers C and D control register */ + uint8_t m_tdr[4]; /* timer data registers */ + + uint8_t m_scr; /* synchronous character register */ + uint8_t m_ucr; /* USART control register */ + uint8_t m_tsr; /* transmitter status register */ + uint8_t m_rsr; /* receiver status register */ + uint8_t m_transmit_buffer; /* USART data register */ int m_transmit_pending; - UINT8 m_receive_buffer; + uint8_t m_receive_buffer; int m_receive_pending; - UINT8 m_gpio_input; - UINT8 m_gpio_output; + uint8_t m_gpio_input; + uint8_t m_gpio_output; /* counter timer state */ - UINT8 m_tmc[4]; /* timer main counters */ + uint8_t m_tmc[4]; /* timer main counters */ int m_ti[4]; /* timer in latch */ int m_to[4]; /* timer out latch */ @@ -295,7 +295,7 @@ private: //int m_irqlevel; /* interrupt level latch */ /* serial state */ - UINT8 m_next_rsr; /* receiver status register latch */ + uint8_t m_next_rsr; /* receiver status register latch */ int m_rsr_read; /* receiver status register read flag */ // timers diff --git a/src/devices/machine/mccs1850.cpp b/src/devices/machine/mccs1850.cpp index 28d29bab8bc..78f5eee020c 100644 --- a/src/devices/machine/mccs1850.cpp +++ b/src/devices/machine/mccs1850.cpp @@ -113,8 +113,8 @@ const device_type MCCS1850 = &device_creator; inline void mccs1850_device::check_interrupt() { - UINT8 status = m_ram[REGISTER_STATUS]; - UINT8 control = m_ram[REGISTER_CONTROL]; + uint8_t status = m_ram[REGISTER_STATUS]; + uint8_t control = m_ram[REGISTER_CONTROL]; bool interrupt = (((status & STATUS_AI) && (control & CONTROL_AE)) // alarm interrupt || ((status & STATUS_LB) && (control & CONTROL_LBE)) // low battery @@ -152,7 +152,7 @@ inline void mccs1850_device::set_pse_line(bool state) // read_register - //------------------------------------------------- -inline UINT8 mccs1850_device::read_register(offs_t offset) +inline uint8_t mccs1850_device::read_register(offs_t offset) { switch (offset) { @@ -182,7 +182,7 @@ inline UINT8 mccs1850_device::read_register(offs_t offset) // write_register - //------------------------------------------------- -inline void mccs1850_device::write_register(offs_t offset, UINT8 data) +inline void mccs1850_device::write_register(offs_t offset, uint8_t data) { switch (offset) { @@ -248,7 +248,7 @@ inline void mccs1850_device::write_register(offs_t offset, UINT8 data) inline void mccs1850_device::advance_seconds() { - UINT32 alarm = (m_ram[REGISTER_ALARM_LATCH] << 24) | (m_ram[REGISTER_ALARM_LATCH + 1] << 16) | (m_ram[REGISTER_ALARM_LATCH + 2] << 8) | m_ram[REGISTER_ALARM_LATCH + 3]; + uint32_t alarm = (m_ram[REGISTER_ALARM_LATCH] << 24) | (m_ram[REGISTER_ALARM_LATCH + 1] << 16) | (m_ram[REGISTER_ALARM_LATCH + 2] << 8) | m_ram[REGISTER_ALARM_LATCH + 3]; m_counter++; @@ -279,7 +279,7 @@ inline void mccs1850_device::advance_seconds() // mccs1850_device - constructor //------------------------------------------------- -mccs1850_device::mccs1850_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mccs1850_device::mccs1850_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MCCS1850, "MCCS1850", tag, owner, clock, "mccs1850", __FILE__), device_rtc_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -380,7 +380,7 @@ void mccs1850_device::nvram_default() if (machine().root_device().memregion(tag()) != nullptr) { - UINT8 *nvram = machine().root_device().memregion(tag())->base(); + uint8_t *nvram = machine().root_device().memregion(tag())->base(); // initialize NVRAM memcpy(m_ram, nvram, 0x20); diff --git a/src/devices/machine/mccs1850.h b/src/devices/machine/mccs1850.h index c029bc3e89b..c90bcae0d83 100644 --- a/src/devices/machine/mccs1850.h +++ b/src/devices/machine/mccs1850.h @@ -54,7 +54,7 @@ class mccs1850_device : public device_t, { public: // construction/destruction - mccs1850_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mccs1850_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_int_wr_callback(device_t &device, _Object object) { return downcast(device).int_cb.set_callback(object); } template static devcb_base &set_pse_wr_callback(device_t &device, _Object object) { return downcast(device).pse_cb.set_callback(object); } @@ -85,21 +85,21 @@ protected: private: inline void check_interrupt(); inline void set_pse_line(bool state); - inline UINT8 read_register(offs_t offset); - inline void write_register(offs_t offset, UINT8 data); + inline uint8_t read_register(offs_t offset); + inline void write_register(offs_t offset, uint8_t data); inline void advance_seconds(); static const device_timer_id TIMER_CLOCK = 0; devcb_write_line int_cb, pse_cb, nuc_cb; - UINT8 m_ram[0x80]; // RAM + uint8_t m_ram[0x80]; // RAM // power supply int m_pse; // power supply enable // counter - UINT32 m_counter; // seconds counter + uint32_t m_counter; // seconds counter // serial interface int m_ce; // chip enable @@ -107,9 +107,9 @@ private: int m_sdo; // serial data out int m_sdi; // serial data in int m_state; // serial interface state - UINT8 m_address; // address counter + uint8_t m_address; // address counter int m_bits; // bit counter - UINT8 m_shift; // shift register + uint8_t m_shift; // shift register // timers emu_timer *m_clock_timer; diff --git a/src/devices/machine/mcf5206e.cpp b/src/devices/machine/mcf5206e.cpp index cdc1a9b6477..a50950a04a8 100644 --- a/src/devices/machine/mcf5206e.cpp +++ b/src/devices/machine/mcf5206e.cpp @@ -206,7 +206,7 @@ WRITE8_MEMBER( mcf5206e_peripheral_device::ICR13_w ) } -inline UINT16 mcf5206e_peripheral_device::CSAR_r(int which, int offset, UINT16 mem_mask) +inline uint16_t mcf5206e_peripheral_device::CSAR_r(int which, int offset, uint16_t mem_mask) { if (offset==0) { @@ -220,7 +220,7 @@ inline UINT16 mcf5206e_peripheral_device::CSAR_r(int which, int offset, UINT16 m } } -inline void mcf5206e_peripheral_device::CSAR_w(int which, int offset, UINT16 data, UINT16 mem_mask) +inline void mcf5206e_peripheral_device::CSAR_w(int which, int offset, uint16_t data, uint16_t mem_mask) { if (offset==0) { @@ -233,19 +233,19 @@ inline void mcf5206e_peripheral_device::CSAR_w(int which, int offset, UINT16 dat } } -inline UINT32 mcf5206e_peripheral_device::CSMR_r(int which, UINT32 mem_mask) +inline uint32_t mcf5206e_peripheral_device::CSMR_r(int which, uint32_t mem_mask) { debuglog("%s: CSMR%d_r\n", this->machine().describe_context(), which); return m_CSMR[0]; } -inline void mcf5206e_peripheral_device::CSMR_w(int which, UINT32 data, UINT32 mem_mask) +inline void mcf5206e_peripheral_device::CSMR_w(int which, uint32_t data, uint32_t mem_mask) { COMBINE_DATA( &m_CSMR[0] ); debuglog("%s: CSMR%d_w %08x\n", this->machine().describe_context(), which, data); } -inline UINT16 mcf5206e_peripheral_device::CSCR_r(int which, int offset, UINT16 mem_mask) +inline uint16_t mcf5206e_peripheral_device::CSCR_r(int which, int offset, uint16_t mem_mask) { if (offset==1) { @@ -259,7 +259,7 @@ inline UINT16 mcf5206e_peripheral_device::CSCR_r(int which, int offset, UINT16 m } } -inline void mcf5206e_peripheral_device::CSCR_w(int which, int offset, UINT16 data, UINT16 mem_mask) +inline void mcf5206e_peripheral_device::CSCR_w(int which, int offset, uint16_t data, uint16_t mem_mask) { if (offset==1) { @@ -649,7 +649,7 @@ WRITE16_MEMBER( mcf5206e_peripheral_device::IMR_w) } } -void mcf5206e_peripheral_device::ICR_info(UINT8 ICR) +void mcf5206e_peripheral_device::ICR_info(uint8_t ICR) { debuglog(" (AutoVector) AVEC : %01x | ", (ICR&0x80)>>7); debuglog("(Interrupt Level) IL : %01x | ", (ICR&0x1c)>>2); // if autovector (AVEC) is used then the vectors referenced are at +24 (+0x18) + IL, ie the standard 68k autovectors, otherwise vector must be provided by device @@ -661,7 +661,7 @@ void mcf5206e_peripheral_device::ICR_info(UINT8 ICR) TIMER_CALLBACK_MEMBER(mcf5206e_peripheral_device::timer1_callback) { - UINT8 ICR = m_ICR[ICR9]; + uint8_t ICR = m_ICR[ICR9]; // technically we should do the vector check in the IRQ callback as well as various checks based on the IRQ masks before asserting the interrupt if (ICR & 0x80) // AVEC @@ -828,7 +828,7 @@ const device_type MCF5206E_PERIPHERAL = &device_creator; -microtouch_device::microtouch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +microtouch_device::microtouch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MICROTOUCH, "Microtouch Touchscreen", tag, owner, clock, "microtouch", __FILE__), device_serial_interface(mconfig, *this), m_rx_buffer_ptr(0), m_tx_buffer_num(0), m_tx_buffer_ptr(0), m_reset_done(0), m_format(0), m_mode(0), m_last_touch_state(0), m_last_x(0), m_last_y(0), @@ -28,7 +28,7 @@ microtouch_device::microtouch_device(const machine_config &mconfig, const char * { } -int microtouch_device::check_command( const char* commandtocheck, int command_len, UINT8* command_data ) +int microtouch_device::check_command( const char* commandtocheck, int command_len, uint8_t* command_data ) { if ( (command_len == (strlen(commandtocheck) + 2)) && (command_data[0] == 0x01) && @@ -43,7 +43,7 @@ int microtouch_device::check_command( const char* commandtocheck, int command_le } } -void microtouch_device::send_format_table_packet(UINT8 flag, int x, int y) +void microtouch_device::send_format_table_packet(uint8_t flag, int x, int y) { m_tx_buffer[m_tx_buffer_num++] = flag; // lower byte (7bits) of x coordinate diff --git a/src/devices/machine/microtch.h b/src/devices/machine/microtch.h index 4ee60abede7..070fb65d7e0 100644 --- a/src/devices/machine/microtch.h +++ b/src/devices/machine/microtch.h @@ -11,7 +11,7 @@ class microtouch_device : public device_serial_interface { public: - microtouch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + microtouch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &static_set_stx_callback(device_t &device, _Object object) { return downcast(device).m_out_stx_func.set_callback(object); } virtual ioport_constructor device_input_ports() const override; @@ -27,8 +27,8 @@ protected: virtual void tra_complete() override; virtual void rcv_complete() override; private: - int check_command( const char* commandtocheck, int command_len, UINT8* command_data ); - void send_format_table_packet(UINT8 flag, int x, int y); + int check_command( const char* commandtocheck, int command_len, uint8_t* command_data ); + void send_format_table_packet(uint8_t flag, int x, int y); void send_format_decimal_packet(int x, int y); void send_touch_packet(); @@ -44,11 +44,11 @@ private: MODE_STREAM, MODE_POINT }; - UINT8 m_rx_buffer[16]; + uint8_t m_rx_buffer[16]; int m_rx_buffer_ptr; - UINT8 m_tx_buffer[16]; - UINT8 m_tx_buffer_num; - UINT8 m_tx_buffer_ptr; + uint8_t m_tx_buffer[16]; + uint8_t m_tx_buffer_num; + uint8_t m_tx_buffer_ptr; int m_reset_done; int m_format; int m_mode; @@ -62,7 +62,7 @@ private: required_ioport m_touchy; emu_timer* m_timer; bool m_output_valid; - UINT8 m_output; + uint8_t m_output; }; extern const device_type MICROTOUCH; diff --git a/src/devices/machine/mm58167.cpp b/src/devices/machine/mm58167.cpp index 148d97260e8..b9174c75344 100644 --- a/src/devices/machine/mm58167.cpp +++ b/src/devices/machine/mm58167.cpp @@ -51,7 +51,7 @@ typedef enum // mm58167_device - constructor //------------------------------------------------- -mm58167_device::mm58167_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mm58167_device::mm58167_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MM58167, "National Semiconductor MM58167", tag, owner, clock, "mm58167", __FILE__), device_rtc_interface(mconfig, *this), m_irq_w(*this) @@ -186,7 +186,7 @@ READ8_MEMBER(mm58167_device::read) if (offset == R_CTL_IRQSTATUS && !space.debugger_access()) { // reading the IRQ status clears IRQ line and IRQ status - UINT8 data = m_regs[offset]; + uint8_t data = m_regs[offset]; m_regs[R_CTL_IRQSTATUS] = 0; m_irq_w(CLEAR_LINE); return data; diff --git a/src/devices/machine/mm58167.h b/src/devices/machine/mm58167.h index ab1a1d70eb2..7b5976ef72d 100644 --- a/src/devices/machine/mm58167.h +++ b/src/devices/machine/mm58167.h @@ -34,7 +34,7 @@ class mm58167_device : public device_t, { public: // construction/destruction - mm58167_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mm58167_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); diff --git a/src/devices/machine/mm58274c.cpp b/src/devices/machine/mm58274c.cpp index 0690f775b5d..412b5ac5239 100644 --- a/src/devices/machine/mm58274c.cpp +++ b/src/devices/machine/mm58274c.cpp @@ -47,7 +47,7 @@ enum const device_type MM58274C = &device_creator; -mm58274c_device::mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mm58274c_device::mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MM58274C, "National Semiconductor MM58274C", tag, owner, clock, "mm58274c", __FILE__), m_mode24(0), m_day1(0) diff --git a/src/devices/machine/mm58274c.h b/src/devices/machine/mm58274c.h index f92a795c6db..9c8505da49c 100644 --- a/src/devices/machine/mm58274c.h +++ b/src/devices/machine/mm58274c.h @@ -10,7 +10,7 @@ class mm58274c_device : public device_t { public: - mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mm58274c_device() {} static void set_mode24(device_t &device, int mode) { downcast(device).m_mode24 = mode; } diff --git a/src/devices/machine/mm74c922.cpp b/src/devices/machine/mm74c922.cpp index c822c783b33..7f9e3af798d 100644 --- a/src/devices/machine/mm74c922.cpp +++ b/src/devices/machine/mm74c922.cpp @@ -36,7 +36,7 @@ const device_type MM74C923 = &device_creator; // mm74c922_device - constructor //------------------------------------------------- -mm74c922_device::mm74c922_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mm74c922_device::mm74c922_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MM74C922, "MM74C922", tag, owner, clock, "mm74c922", __FILE__), m_write_da(*this), m_read_x1(*this), @@ -101,7 +101,7 @@ void mm74c922_device::device_timer(emu_timer &timer, device_timer_id id, int par // read - //------------------------------------------------- -UINT8 mm74c922_device::read() +uint8_t mm74c922_device::read() { if (LOG) logerror("MM74C922 '%s' Data Read: %02x\n", tag(), m_data); @@ -146,7 +146,7 @@ void mm74c922_device::clock_scan_counters() void mm74c922_device::detect_keypress() { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_x) { diff --git a/src/devices/machine/mm74c922.h b/src/devices/machine/mm74c922.h index 4cca5f6e9c3..38d23a78a94 100644 --- a/src/devices/machine/mm74c922.h +++ b/src/devices/machine/mm74c922.h @@ -79,7 +79,7 @@ class mm74c922_device : public device_t { public: // construction/destruction - mm74c922_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mm74c922_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_cap_osc(device_t &device, double value) { downcast(device).m_cap_osc = value; } static void static_set_cap_debounce(device_t &device, double value) { downcast(device).m_cap_debounce = value; } @@ -91,7 +91,7 @@ public: template static devcb_base &set_x4_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_x4.set_callback(object); } template static devcb_base &set_x5_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_x5.set_callback(object); } - UINT8 read(); + uint8_t read(); protected: // device-level overrides @@ -119,7 +119,7 @@ private: int m_x; // currently scanned column int m_y; // latched row - UINT8 m_data; // data latch + uint8_t m_data; // data latch int m_da; // data available flag int m_next_da; // next value of data available flag diff --git a/src/devices/machine/mos6526.cpp b/src/devices/machine/mos6526.cpp index 317c6b8555d..74b86246812 100644 --- a/src/devices/machine/mos6526.cpp +++ b/src/devices/machine/mos6526.cpp @@ -128,7 +128,7 @@ const device_type MOS5710 = &device_creator; inline void mos6526_device::update_pa() { - UINT8 pa = m_pra | (m_pa_in & ~m_ddra); + uint8_t pa = m_pra | (m_pa_in & ~m_ddra); if (m_pa != pa) { @@ -144,7 +144,7 @@ inline void mos6526_device::update_pa() inline void mos6526_device::update_pb() { - UINT8 pb = m_prb | (m_pb_in & ~m_ddrb); + uint8_t pb = m_prb | (m_pb_in & ~m_ddrb); if (CRA_PBON) { @@ -174,7 +174,7 @@ inline void mos6526_device::update_pb() // set_cra - control register A write //------------------------------------------------- -inline void mos6526_device::set_cra(UINT8 data) +inline void mos6526_device::set_cra(uint8_t data) { if (!CRA_STARTED && (data & CRA_START)) { @@ -204,7 +204,7 @@ inline void mos6526_device::set_cra(UINT8 data) // set_crb - control register B write //------------------------------------------------- -inline void mos6526_device::set_crb(UINT8 data) +inline void mos6526_device::set_crb(uint8_t data) { if (!CRB_STARTED && (data & CRB_START)) { @@ -220,7 +220,7 @@ inline void mos6526_device::set_crb(UINT8 data) // bcd_increment - //------------------------------------------------- -inline UINT8 mos6526_device::bcd_increment(UINT8 value) +inline uint8_t mos6526_device::bcd_increment(uint8_t value) { value++; @@ -237,10 +237,10 @@ inline UINT8 mos6526_device::bcd_increment(UINT8 value) inline void mos6526_device::clock_tod() { - UINT8 subsecond = (UINT8) (m_tod >> 0); - UINT8 second = (UINT8) (m_tod >> 8); - UINT8 minute = (UINT8) (m_tod >> 16); - UINT8 hour = (UINT8) (m_tod >> 24); + uint8_t subsecond = (uint8_t) (m_tod >> 0); + uint8_t second = (uint8_t) (m_tod >> 8); + uint8_t minute = (uint8_t) (m_tod >> 16); + uint8_t hour = (uint8_t) (m_tod >> 24); m_tod_count++; @@ -278,10 +278,10 @@ inline void mos6526_device::clock_tod() } } - m_tod = (((UINT32) subsecond) << 0) - | (((UINT32) second) << 8) - | (((UINT32) minute) << 16) - | (((UINT32) hour) << 24); + m_tod = (((uint32_t) subsecond) << 0) + | (((uint32_t) second) << 8) + | (((uint32_t) minute) << 16) + | (((uint32_t) hour) << 24); } @@ -300,7 +300,7 @@ inline void mos8520_device::clock_tod() // read_tod - time-of-day read //------------------------------------------------- -inline UINT8 mos6526_device::read_tod(int offset) +inline uint8_t mos6526_device::read_tod(int offset) { int shift = 8 * offset; @@ -319,7 +319,7 @@ inline UINT8 mos6526_device::read_tod(int offset) // write_tod - time-of-day write //------------------------------------------------- -inline void mos6526_device::write_tod(int offset, UINT8 data) +inline void mos6526_device::write_tod(int offset, uint8_t data) { int shift = 8 * offset; @@ -586,7 +586,7 @@ inline void mos6526_device::synchronize() // mos6526_device - constructor //------------------------------------------------- -mos6526_device::mos6526_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +mos6526_device::mos6526_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_execute_interface(mconfig, *this), m_icount(0), @@ -603,7 +603,7 @@ mos6526_device::mos6526_device(const machine_config &mconfig, device_type type, { } -mos6526_device::mos6526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6526_device::mos6526_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS6526, "MOS6526", tag, owner, clock, "mos6526", __FILE__), device_execute_interface(mconfig, *this), m_icount(0), @@ -619,13 +619,13 @@ mos6526_device::mos6526_device(const machine_config &mconfig, const char *tag, d m_write_pb(*this) { } -mos6526a_device::mos6526a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6526a_device::mos6526a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mos6526_device(mconfig, MOS6526A, "MOS6526A", tag, owner, clock, TYPE_6526A, "mos6526a", __FILE__) { } -mos8520_device::mos8520_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8520_device::mos8520_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mos6526_device(mconfig, MOS8520, "MOS8520", tag, owner, clock, TYPE_8520, "mos8520", __FILE__) { } -mos5710_device::mos5710_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos5710_device::mos5710_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mos6526_device(mconfig, MOS5710, "MOS5710", tag, owner, clock, TYPE_5710, "mos5710", __FILE__) { } @@ -804,7 +804,7 @@ READ8_MEMBER( mos6526_device::read ) if (space.debugger_access()) return 0xff; - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0x0f) { @@ -921,7 +921,7 @@ READ8_MEMBER( mos6526_device::read ) READ8_MEMBER( mos8520_device::read ) { - UINT8 data; + uint8_t data; switch (offset & 0x0f) { diff --git a/src/devices/machine/mos6526.h b/src/devices/machine/mos6526.h index 99bfab3abc3..cf3e89e9fa1 100644 --- a/src/devices/machine/mos6526.h +++ b/src/devices/machine/mos6526.h @@ -108,8 +108,8 @@ class mos6526_device : public device_t, { public: // construction/destruction - mos6526_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - mos6526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6526_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + mos6526_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_tod_clock(device_t &device, int clock) { downcast(device).m_tod_clock = clock; } @@ -125,9 +125,9 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - UINT8 pa_r() { return m_pa; } + uint8_t pa_r() { return m_pa; } DECLARE_READ8_MEMBER( pa_r ) { return pa_r(); } - UINT8 pb_r() { return m_pb; } + uint8_t pb_r() { return m_pb; } DECLARE_READ8_MEMBER( pb_r ) { return pb_r(); } DECLARE_READ_LINE_MEMBER( sp_r ) { return m_sp; } @@ -160,17 +160,17 @@ protected: inline void update_interrupt(); inline void update_pa(); inline void update_pb(); - inline void set_cra(UINT8 data); - inline void set_crb(UINT8 data); + inline void set_cra(uint8_t data); + inline void set_crb(uint8_t data); inline void serial_input(); inline void serial_output(); inline void clock_ta(); inline void clock_tb(); inline void clock_pipeline(); - inline UINT8 bcd_increment(UINT8 value); + inline uint8_t bcd_increment(uint8_t value); virtual inline void clock_tod(); - inline UINT8 read_tod(int offset); - inline void write_tod(int offset, UINT8 data); + inline uint8_t read_tod(int offset); + inline void write_tod(int offset, uint8_t data); inline void synchronize(); devcb_write_line m_write_irq; @@ -186,27 +186,27 @@ protected: bool m_irq; int m_ir0; int m_ir1; - UINT8 m_icr; - UINT8 m_imr; + uint8_t m_icr; + uint8_t m_imr; bool m_icr_read; // peripheral ports int m_pc; int m_flag; - UINT8 m_pra; - UINT8 m_prb; - UINT8 m_ddra; - UINT8 m_ddrb; - UINT8 m_pa; - UINT8 m_pb; - UINT8 m_pa_in; - UINT8 m_pb_in; + uint8_t m_pra; + uint8_t m_prb; + uint8_t m_ddra; + uint8_t m_ddrb; + uint8_t m_pa; + uint8_t m_pb; + uint8_t m_pa_in; + uint8_t m_pb_in; // serial int m_sp; int m_cnt; - UINT8 m_sdr; - UINT8 m_shift; + uint8_t m_sdr; + uint8_t m_shift; bool m_sdr_empty; int m_bits; @@ -231,18 +231,18 @@ protected: int m_load_b1; int m_load_b2; int m_oneshot_b0; - UINT16 m_ta; - UINT16 m_tb; - UINT16 m_ta_latch; - UINT16 m_tb_latch; - UINT8 m_cra; - UINT8 m_crb; + uint16_t m_ta; + uint16_t m_tb; + uint16_t m_ta_latch; + uint16_t m_tb_latch; + uint8_t m_cra; + uint8_t m_crb; // time-of-day int m_tod_count; - UINT32 m_tod; - UINT32 m_tod_latch; - UINT32 m_alarm; + uint32_t m_tod; + uint32_t m_tod_latch; + uint32_t m_alarm; bool m_tod_stopped; bool m_tod_latched; emu_timer *m_tod_timer; @@ -254,7 +254,7 @@ protected: class mos6526a_device : public mos6526_device { public: - mos6526a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6526a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -263,7 +263,7 @@ public: class mos8520_device : public mos6526_device { public: - mos8520_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8520_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -278,7 +278,7 @@ protected: class mos5710_device : public mos6526_device { public: - mos5710_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos5710_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); //DECLARE_READ8_MEMBER( read ); //DECLARE_WRITE8_MEMBER( write ); diff --git a/src/devices/machine/mos6529.cpp b/src/devices/machine/mos6529.cpp index ebae2ca6f5a..9c3a1c13b5b 100644 --- a/src/devices/machine/mos6529.cpp +++ b/src/devices/machine/mos6529.cpp @@ -35,7 +35,7 @@ const device_type MOS6529 = &device_creator; // mos6529_device - constructor //------------------------------------------------- -mos6529_device::mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6529_device::mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS6529, "MOS6529", tag, owner, clock, "mos6529", __FILE__), m_input(0), m_p0_handler(*this), diff --git a/src/devices/machine/mos6529.h b/src/devices/machine/mos6529.h index fe9f8a3e063..87763b0575a 100644 --- a/src/devices/machine/mos6529.h +++ b/src/devices/machine/mos6529.h @@ -67,7 +67,7 @@ class mos6529_device : public device_t { public: // construction/destruction - mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_p0_handler(device_t &device, _Object object) { return downcast(device).m_p0_handler.set_callback(object); } template static devcb_base &set_p1_handler(device_t &device, _Object object) { return downcast(device).m_p1_handler.set_callback(object); } @@ -94,7 +94,7 @@ protected: // device-level overrides virtual void device_start() override; - UINT8 m_input; + uint8_t m_input; devcb_write_line m_p0_handler; devcb_write_line m_p1_handler; diff --git a/src/devices/machine/mos6530.cpp b/src/devices/machine/mos6530.cpp index 46979b078f0..2a32917d0c4 100644 --- a/src/devices/machine/mos6530.cpp +++ b/src/devices/machine/mos6530.cpp @@ -40,7 +40,7 @@ enum const device_type MOS6530 = &device_creator; -mos6530_device::mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6530_device::mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS6530, "MOS6530 RRIOT", tag, owner, clock, "mos6530", __FILE__), m_in_pa_cb(*this), m_out_pa_cb(*this), @@ -118,7 +118,7 @@ void mos6530_device::device_reset() void mos6530_device::update_irqstate() { - UINT8 out = m_port[1].m_out; + uint8_t out = m_port[1].m_out; if (m_irqenable) out = ((m_irqstate & TIMER_FLAG) ? 0x00 : 0x80) | (out & 0x7F); @@ -131,7 +131,7 @@ void mos6530_device::update_irqstate() get_timer - return the current timer value -------------------------------------------------*/ -UINT8 mos6530_device::get_timer() +uint8_t mos6530_device::get_timer() { /* if idle, return 0 */ if (m_timerstate == TIMER_IDLE) @@ -198,9 +198,9 @@ WRITE8_MEMBER( mos6530_device::write ) /* if A2 == 1, we are writing to the timer */ if (offset & 0x04) { - static const UINT8 timershift[4] = { 0, 3, 6, 10 }; + static const uint8_t timershift[4] = { 0, 3, 6, 10 }; attotime curtime = space.machine().time(); - INT64 target; + int64_t target; /* A0-A1 contain the timer divisor */ m_timershift = timershift[offset & 3]; @@ -235,7 +235,7 @@ WRITE8_MEMBER( mos6530_device::write ) /* if A0 == 0, we are writing to the port's output */ else { - UINT8 olddata = port->m_out; + uint8_t olddata = port->m_out; port->m_out = data; if ((offset & 2) && m_irqenable) @@ -259,7 +259,7 @@ WRITE8_MEMBER( mos6530_device::write ) READ8_MEMBER( mos6530_device::read ) { - UINT8 val; + uint8_t val; /* if A2 == 1 and A0 == 1, we are reading interrupt flags */ if ((offset & 0x05) == 0x05) @@ -297,7 +297,7 @@ READ8_MEMBER( mos6530_device::read ) /* if A0 == 0, we are reading the port as an input */ else { - UINT8 out = port->m_out; + uint8_t out = port->m_out; if ((offset & 2) && m_irqenable) out = ((m_irqstate & TIMER_FLAG) ? 0x00 : 0x80) | (out & 0x7F); @@ -321,7 +321,7 @@ READ8_MEMBER( mos6530_device::read ) value -------------------------------------------------*/ -void mos6530_device::porta_in_set(UINT8 data, UINT8 mask) +void mos6530_device::porta_in_set(uint8_t data, uint8_t mask) { m_port[0].m_in = (m_port[0].m_in & ~mask) | (data & mask); } @@ -332,7 +332,7 @@ void mos6530_device::porta_in_set(UINT8 data, UINT8 mask) value -------------------------------------------------*/ -void mos6530_device::portb_in_set(UINT8 data, UINT8 mask) +void mos6530_device::portb_in_set(uint8_t data, uint8_t mask) { m_port[1].m_in = (m_port[1].m_in & ~mask) | (data & mask); } @@ -343,7 +343,7 @@ void mos6530_device::portb_in_set(UINT8 data, UINT8 mask) value -------------------------------------------------*/ -UINT8 mos6530_device::porta_in_get() +uint8_t mos6530_device::porta_in_get() { return m_port[0].m_in; } @@ -354,7 +354,7 @@ UINT8 mos6530_device::porta_in_get() value -------------------------------------------------*/ -UINT8 mos6530_device::portb_in_get() +uint8_t mos6530_device::portb_in_get() { return m_port[1].m_in; } @@ -365,7 +365,7 @@ UINT8 mos6530_device::portb_in_get() value -------------------------------------------------*/ -UINT8 mos6530_device::porta_out_get() +uint8_t mos6530_device::porta_out_get() { return m_port[0].m_out; } @@ -376,7 +376,7 @@ UINT8 mos6530_device::porta_out_get() value -------------------------------------------------*/ -UINT8 mos6530_device::portb_out_get() +uint8_t mos6530_device::portb_out_get() { return m_port[1].m_out; } diff --git a/src/devices/machine/mos6530.h b/src/devices/machine/mos6530.h index c60ff759a1b..db0bc5a0b4c 100644 --- a/src/devices/machine/mos6530.h +++ b/src/devices/machine/mos6530.h @@ -39,9 +39,9 @@ struct mos6530_port { - UINT8 m_in; - UINT8 m_out; - UINT8 m_ddr; + uint8_t m_in; + uint8_t m_out; + uint8_t m_ddr; }; /*************************************************************************** @@ -51,7 +51,7 @@ struct mos6530_port class mos6530_device : public device_t { public: - mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mos6530_device() {} template static devcb_base &set_in_pa_callback(device_t &device, _Object object) { return downcast(device).m_in_pa_cb.set_callback(object); } @@ -62,11 +62,11 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - UINT8 porta_in_get(); - UINT8 portb_in_get(); + uint8_t porta_in_get(); + uint8_t portb_in_get(); - UINT8 porta_out_get(); - UINT8 portb_out_get(); + uint8_t porta_out_get(); + uint8_t portb_out_get(); protected: // device-level overrides @@ -84,20 +84,20 @@ private: mos6530_port m_port[2]; - UINT8 m_irqstate; - UINT8 m_irqenable; + uint8_t m_irqstate; + uint8_t m_irqenable; - UINT8 m_timershift; - UINT8 m_timerstate; + uint8_t m_timershift; + uint8_t m_timerstate; emu_timer * m_timer; - UINT32 m_clock; + uint32_t m_clock; void update_irqstate(); - UINT8 get_timer(); + uint8_t get_timer(); - void porta_in_set(UINT8 data, UINT8 mask); - void portb_in_set(UINT8 data, UINT8 mask); + void porta_in_set(uint8_t data, uint8_t mask); + void portb_in_set(uint8_t data, uint8_t mask); enum { diff --git a/src/devices/machine/mos6530n.cpp b/src/devices/machine/mos6530n.cpp index 98e52547ccd..c28cf6a0d7d 100644 --- a/src/devices/machine/mos6530n.cpp +++ b/src/devices/machine/mos6530n.cpp @@ -73,7 +73,7 @@ ADDRESS_MAP_END READ8_MEMBER(mos6532_t::io_r) { offset &= 0x1f; - UINT8 ret = 0; + uint8_t ret = 0; if (offset == 0x00 || offset == 0x08 || offset == 0x10 || offset == 0x18) ret = pa_data_r(space, 0); if (offset == 0x01 || offset == 0x09 || offset == 0x11 || offset == 0x19) ret = pa_ddr_r(space, 0); @@ -113,7 +113,7 @@ WRITE8_MEMBER(mos6532_t::io_w) // mos6530_base_t - constructor //------------------------------------------------- -mos6530_base_t::mos6530_base_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) : +mos6530_base_t::mos6530_base_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), m_ram(*this, finder_base::DUMMY_TAG), m_rom(*this, DEVICE_SELF), @@ -177,7 +177,7 @@ mos6530_base_t::mos6530_base_t(const machine_config &mconfig, device_type type, // mos6530_t - constructor //------------------------------------------------- -mos6530_t::mos6530_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6530_t::mos6530_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mos6530_base_t(mconfig, MOS6530n, "MOS6530n", tag, owner, clock, "mos6530n", __FILE__) { } @@ -185,7 +185,7 @@ mos6530_t::mos6530_t(const machine_config &mconfig, const char *tag, device_t *o // mos6532_t - constructor //------------------------------------------------- -mos6532_t::mos6532_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6532_t::mos6532_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mos6530_base_t(mconfig, MOS6532n, "MOS6532n", tag, owner, clock, "mos6532n", __FILE__) { } @@ -322,9 +322,9 @@ void mos6530_base_t::device_timer(emu_timer &timer, device_timer_id id, int para void mos6530_base_t::update_pa() { - UINT8 out = m_pa_out; - UINT8 ddr = m_pa_ddr; - UINT8 data = (out & ddr) | (ddr ^ 0xff); + uint8_t out = m_pa_out; + uint8_t ddr = m_pa_ddr; + uint8_t data = (out & ddr) | (ddr ^ 0xff); if (m_out_pa_cb.isnull()) { @@ -350,9 +350,9 @@ void mos6530_base_t::update_pa() void mos6530_base_t::update_pb() { - UINT8 out = m_pb_out; - UINT8 ddr = m_pb_ddr; - UINT8 data = (out & ddr) | (ddr ^ 0xff); + uint8_t out = m_pb_out; + uint8_t ddr = m_pb_ddr; + uint8_t data = (out & ddr) | (ddr ^ 0xff); if (m_out_pb_cb.isnull()) { @@ -373,9 +373,9 @@ void mos6530_base_t::update_pb() void mos6530_t::update_pb() { - UINT8 out = m_pb_out; - UINT8 ddr = m_pb_ddr; - UINT8 data = (out & ddr) | (ddr ^ 0xff); + uint8_t out = m_pb_out; + uint8_t ddr = m_pb_ddr; + uint8_t data = (out & ddr) | (ddr ^ 0xff); if (m_ie_timer) { @@ -428,9 +428,9 @@ void mos6530_t::update_irq() // get_irq_flags - //------------------------------------------------- -UINT8 mos6530_base_t::get_irq_flags() +uint8_t mos6530_base_t::get_irq_flags() { - UINT8 data = 0; + uint8_t data = 0; if (m_irq_timer) data |= IRQ_TIMER; if (m_irq_edge) data |= IRQ_EDGE; @@ -438,9 +438,9 @@ UINT8 mos6530_base_t::get_irq_flags() return data; } -UINT8 mos6530_t::get_irq_flags() +uint8_t mos6530_t::get_irq_flags() { - UINT8 data = 0; + uint8_t data = 0; if (m_irq_timer) data |= IRQ_TIMER; @@ -454,9 +454,9 @@ UINT8 mos6530_t::get_irq_flags() void mos6530_base_t::edge_detect() { - UINT8 ddr_out = m_pa_ddr; - UINT8 ddr_in = m_pa_ddr ^ 0xff; - UINT8 data = (m_pa_out & ddr_out) | (m_pa_in & ddr_in); + uint8_t ddr_out = m_pa_ddr; + uint8_t ddr_in = m_pa_ddr ^ 0xff; + uint8_t data = (m_pa_out & ddr_out) | (m_pa_in & ddr_in); int state = BIT(data, 7); if ((m_pa7 ^ state) && (m_pa7_dir ^ state) == 0) @@ -505,7 +505,7 @@ void mos6530_base_t::pb_w(int bit, int state) READ8_MEMBER( mos6530_base_t::pa_data_r ) { - UINT8 in = 0; + uint8_t in = 0; if (m_in_pa_cb.isnull()) { @@ -523,10 +523,10 @@ READ8_MEMBER( mos6530_base_t::pa_data_r ) in = m_in_pa_cb(); } - UINT8 out = m_pa_out; - UINT8 ddr_out = m_pa_ddr; - UINT8 ddr_in = m_pa_ddr ^ 0xff; - UINT8 data = (out & ddr_out) | (in & ddr_in); + uint8_t out = m_pa_out; + uint8_t ddr_out = m_pa_ddr; + uint8_t ddr_in = m_pa_ddr ^ 0xff; + uint8_t data = (out & ddr_out) | (in & ddr_in); if (LOG) logerror("%s %s %s '%s' Port A Data In %02x\n", machine().time().as_string(), machine().describe_context(), name(), tag(), data); @@ -570,7 +570,7 @@ WRITE8_MEMBER( mos6530_base_t::pa_ddr_w ) READ8_MEMBER( mos6530_base_t::pb_data_r ) { - UINT8 in = 0; + uint8_t in = 0; if (m_in_pb_cb.isnull()) { @@ -588,10 +588,10 @@ READ8_MEMBER( mos6530_base_t::pb_data_r ) in = m_in_pb_cb(); } - UINT8 out = m_pb_out; - UINT8 ddr_out = m_pb_ddr; - UINT8 ddr_in = m_pb_ddr ^ 0xff; - UINT8 data = (out & ddr_out) | (in & ddr_in); + uint8_t out = m_pb_out; + uint8_t ddr_out = m_pb_ddr; + uint8_t ddr_in = m_pb_ddr ^ 0xff; + uint8_t data = (out & ddr_out) | (in & ddr_in); if (LOG) logerror("%s %s %s '%s' Port B Data In %02x\n", machine().time().as_string(), machine().describe_context(), name(), tag(), data); @@ -647,9 +647,9 @@ READ8_MEMBER( mos6530_base_t::timer_on_r ) return timer_r(true); } -UINT8 mos6530_base_t::timer_r(bool ie) +uint8_t mos6530_base_t::timer_r(bool ie) { - UINT8 data; + uint8_t data; live_sync(); @@ -676,7 +676,7 @@ UINT8 mos6530_base_t::timer_r(bool ie) READ8_MEMBER( mos6530_base_t::irq_r ) { - UINT8 data = get_irq_flags(); + uint8_t data = get_irq_flags(); if (!space.debugger_access()) { if (m_irq_edge) { @@ -703,7 +703,7 @@ WRITE8_MEMBER( mos6530_base_t::timer_on_w ) timer_w(offset, data, true); } -void mos6530_base_t::timer_w(offs_t offset, UINT8 data, bool ie) +void mos6530_base_t::timer_w(offs_t offset, uint8_t data, bool ie) { live_sync(); diff --git a/src/devices/machine/mos6530n.h b/src/devices/machine/mos6530n.h index b29fea9af93..05269ae81e7 100644 --- a/src/devices/machine/mos6530n.h +++ b/src/devices/machine/mos6530n.h @@ -188,7 +188,7 @@ class mos6530_base_t : public device_t { public: // construction/destruction - mos6530_base_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); + mos6530_base_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); 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_pa_rd_callback(device_t &device, _Object object) { return downcast(device).m_in_pa_cb.set_callback(object); } @@ -261,12 +261,12 @@ protected: void update_pa(); virtual void update_pb(); virtual void update_irq(); - virtual UINT8 get_irq_flags(); + virtual uint8_t get_irq_flags(); void edge_detect(); void pa_w(int bit, int state); void pb_w(int bit, int state); - void timer_w(offs_t offset, UINT8 data, bool ie); - UINT8 timer_r(bool ie); + void timer_w(offs_t offset, uint8_t data, bool ie); + uint8_t timer_r(bool ie); DECLARE_READ8_MEMBER( rom_r ) { return m_rom[offset]; } DECLARE_READ8_MEMBER( ram_r ) { return m_ram[offset]; } @@ -286,8 +286,8 @@ protected: DECLARE_WRITE8_MEMBER( timer_on_w ); DECLARE_WRITE8_MEMBER( edge_w ); - optional_shared_ptr m_ram; - optional_region_ptr m_rom; + optional_shared_ptr m_ram; + optional_region_ptr m_rom; devcb_write_line m_irq_cb; devcb_read8 m_in_pa_cb; @@ -327,15 +327,15 @@ protected: devcb_write_line m_out_pb6_cb; devcb_write_line m_out_pb7_cb; - UINT8 m_pa_in; - UINT8 m_pa_out; - UINT8 m_pa_ddr; + uint8_t m_pa_in; + uint8_t m_pa_out; + uint8_t m_pa_ddr; int m_pa7; int m_pa7_dir; - UINT8 m_pb_in; - UINT8 m_pb_out; - UINT8 m_pb_ddr; + uint8_t m_pb_in; + uint8_t m_pb_out; + uint8_t m_pb_ddr; bool m_ie_timer; bool m_irq_timer; @@ -343,7 +343,7 @@ protected: bool m_irq_edge; int m_prescale; - UINT8 m_timer; + uint8_t m_timer; enum { IDLE, @@ -356,7 +356,7 @@ protected: attotime tm, tm_irq; attotime period; int state, next_state; - UINT8 value; + uint8_t value; }; live_info cur_live, checkpoint_live; @@ -376,7 +376,7 @@ class mos6530_t : public mos6530_base_t { public: // construction/destruction - mos6530_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6530_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(rom_map, 8); virtual DECLARE_ADDRESS_MAP(ram_map, 8); @@ -388,7 +388,7 @@ protected: void update_pb() override; void update_irq() override; - UINT8 get_irq_flags() override; + uint8_t get_irq_flags() override; }; @@ -396,7 +396,7 @@ class mos6532_t : public mos6530_base_t { public: // construction/destruction - mos6532_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6532_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(ram_map, 8); virtual DECLARE_ADDRESS_MAP(io_map, 8); diff --git a/src/devices/machine/mos6551.cpp b/src/devices/machine/mos6551.cpp index 24901ee67e0..3bfc22219e5 100644 --- a/src/devices/machine/mos6551.cpp +++ b/src/devices/machine/mos6551.cpp @@ -12,7 +12,7 @@ const device_type MOS6551 = &device_creator; -mos6551_device::mos6551_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mos6551_device::mos6551_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS6551, "MOS6551", tag, owner, clock, "mos6551", __FILE__), m_internal_clock(*this, "clock"), m_irq_handler(*this), @@ -269,15 +269,15 @@ void mos6551_device::update_divider() m_internal_clock->set_clock_scale(scale); } -UINT8 mos6551_device::read_rdr() +uint8_t mos6551_device::read_rdr() { m_status &= ~(SR_PARITY_ERROR | SR_FRAMING_ERROR | SR_OVERRUN | SR_RDRF); return m_rdr; } -UINT8 mos6551_device::read_status() +uint8_t mos6551_device::read_status() { - UINT8 status = m_status; + uint8_t status = m_status; if (m_cts) { @@ -293,23 +293,23 @@ UINT8 mos6551_device::read_status() return status; } -UINT8 mos6551_device::read_command() +uint8_t mos6551_device::read_command() { return m_command; } -UINT8 mos6551_device::read_control() +uint8_t mos6551_device::read_control() { return m_control; } -void mos6551_device::write_tdr(UINT8 data) +void mos6551_device::write_tdr(uint8_t data) { m_tdr = data; m_status &= ~SR_TDRE; } -void mos6551_device::write_reset(UINT8 data) +void mos6551_device::write_reset(uint8_t data) { m_status &= ~SR_OVERRUN; m_irq_state &= ~(IRQ_DCD | IRQ_DSR); @@ -317,7 +317,7 @@ void mos6551_device::write_reset(UINT8 data) write_command(m_command & ~0x1f); } -void mos6551_device::write_control(UINT8 data) +void mos6551_device::write_control(uint8_t data) { m_control = data; @@ -338,7 +338,7 @@ void mos6551_device::write_control(UINT8 data) } } -void mos6551_device::write_command(UINT8 data) +void mos6551_device::write_command(uint8_t data) { m_command = data; @@ -437,7 +437,7 @@ int mos6551_device::stoplength() return m_divide; } -void mos6551_device::set_xtal(UINT32 xtal) +void mos6551_device::set_xtal(uint32_t xtal) { m_xtal = xtal; diff --git a/src/devices/machine/mos6551.h b/src/devices/machine/mos6551.h index 9567ccc02a4..8acc224bcf2 100644 --- a/src/devices/machine/mos6551.h +++ b/src/devices/machine/mos6551.h @@ -52,9 +52,9 @@ class mos6551_device : public device_t { public: - mos6551_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6551_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_xtal(device_t &device, UINT32 xtal) { downcast(device).set_xtal(xtal); } + static void set_xtal(device_t &device, uint32_t xtal) { downcast(device).set_xtal(xtal); } 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_txd_handler(device_t &device, _Object object) { return downcast(device).m_txd_handler.set_callback(object); } template static devcb_base &set_rxc_handler(device_t &device, _Object object) { return downcast(device).m_rxc_handler.set_callback(object); } @@ -73,7 +73,7 @@ public: DECLARE_WRITE_LINE_MEMBER(internal_clock); - void set_xtal(UINT32 clock); + void set_xtal(uint32_t clock); protected: virtual void device_start() override; @@ -134,15 +134,15 @@ private: void update_irq(); void update_divider(); - UINT8 read_rdr(); - UINT8 read_status(); - UINT8 read_command(); - UINT8 read_control(); + uint8_t read_rdr(); + uint8_t read_status(); + uint8_t read_command(); + uint8_t read_control(); - void write_tdr(UINT8 data); - void write_reset(UINT8 data); - void write_command(UINT8 data); - void write_control(UINT8 data); + void write_tdr(uint8_t data); + void write_reset(uint8_t data); + void write_command(uint8_t data); + void write_control(uint8_t data); int stoplength(); @@ -159,13 +159,13 @@ private: devcb_write_line m_rts_handler; devcb_write_line m_dtr_handler; - UINT8 m_control; - UINT8 m_command; - UINT8 m_status; - UINT8 m_tdr; - UINT8 m_rdr; + uint8_t m_control; + uint8_t m_command; + uint8_t m_status; + uint8_t m_tdr; + uint8_t m_rdr; - UINT8 m_irq_state; + uint8_t m_irq_state; int m_irq; int m_txd; @@ -173,7 +173,7 @@ private: int m_rts; int m_dtr; - UINT32 m_xtal; + uint32_t m_xtal; int m_divide; int m_cts; int m_dsr; diff --git a/src/devices/machine/mos6702.cpp b/src/devices/machine/mos6702.cpp index 9dc11e24af9..2f0e3d7a122 100644 --- a/src/devices/machine/mos6702.cpp +++ b/src/devices/machine/mos6702.cpp @@ -34,7 +34,7 @@ const device_type MOS6702 = &device_creator; // mos6702_device - constructor //------------------------------------------------- -mos6702_device::mos6702_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6702_device::mos6702_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS6702, "MOS6702", tag, owner, clock, "mos6702", __FILE__) { } diff --git a/src/devices/machine/mos6702.h b/src/devices/machine/mos6702.h index 191bff45bcc..fa41e46e15d 100644 --- a/src/devices/machine/mos6702.h +++ b/src/devices/machine/mos6702.h @@ -47,7 +47,7 @@ class mos6702_device : public device_t { public: // construction/destruction - mos6702_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6702_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); diff --git a/src/devices/machine/mos8706.cpp b/src/devices/machine/mos8706.cpp index ca07506423b..a5cad813b97 100644 --- a/src/devices/machine/mos8706.cpp +++ b/src/devices/machine/mos8706.cpp @@ -35,7 +35,7 @@ const device_type MOS8706 = &device_creator; // mos8706_device - constructor //------------------------------------------------- -mos8706_device::mos8706_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8706_device::mos8706_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS8706, "MOS8706", tag, owner, clock, "mos8706", __FILE__) { } diff --git a/src/devices/machine/mos8706.h b/src/devices/machine/mos8706.h index 2fd710e1337..91e00d2b342 100644 --- a/src/devices/machine/mos8706.h +++ b/src/devices/machine/mos8706.h @@ -50,7 +50,7 @@ class mos8706_device : public device_t { public: - mos8706_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8706_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); diff --git a/src/devices/machine/mos8722.cpp b/src/devices/machine/mos8722.cpp index 214a52faa21..9f081e5c4c0 100644 --- a/src/devices/machine/mos8722.cpp +++ b/src/devices/machine/mos8722.cpp @@ -68,7 +68,7 @@ static const offs_t RCR_TOP_ADDRESS[4] = { 0xf000, 0xf000, 0xe000, 0xc000 }; // mos8722_device - constructor //------------------------------------------------- -mos8722_device::mos8722_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mos8722_device::mos8722_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS8722, "MOS8722", tag, owner, clock, "mos8722", __FILE__), m_write_z80en(*this), m_write_fsdir(*this), @@ -119,7 +119,7 @@ void mos8722_device::device_reset() // read - register read //------------------------------------------------- -UINT8 mos8722_device::read(offs_t offset, UINT8 data) +uint8_t mos8722_device::read(offs_t offset, uint8_t data) { if (MCR_C64) return data; diff --git a/src/devices/machine/mos8722.h b/src/devices/machine/mos8722.h index 5cbe9681da3..a6991dad1d5 100644 --- a/src/devices/machine/mos8722.h +++ b/src/devices/machine/mos8722.h @@ -73,7 +73,7 @@ class mos8722_device : public device_t { public: // construction/destruction - mos8722_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8722_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_z80en_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_z80en.set_callback(object); } template static devcb_base &set_fsdir_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_fsdir.set_callback(object); } @@ -82,7 +82,7 @@ public: template static devcb_base &set_sense40_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_sense40.set_callback(object); } - UINT8 read(offs_t offset, UINT8 data); + uint8_t read(offs_t offset, uint8_t data); DECLARE_WRITE8_MEMBER( write ); DECLARE_READ_LINE_MEMBER( fsdir_r ); @@ -139,10 +139,10 @@ private: devcb_read_line m_read_exrom; devcb_read_line m_read_sense40; - UINT8 m_reg[16]; + uint8_t m_reg[16]; - UINT8 m_p0h_latch; - UINT8 m_p1h_latch; + uint8_t m_p0h_latch; + uint8_t m_p1h_latch; }; diff --git a/src/devices/machine/mos8726.cpp b/src/devices/machine/mos8726.cpp index eca6ada5187..621d4d4374f 100644 --- a/src/devices/machine/mos8726.cpp +++ b/src/devices/machine/mos8726.cpp @@ -40,7 +40,7 @@ const device_type MOS8726 = &device_creator; // mos8726_device - constructor //------------------------------------------------- -mos8726_device::mos8726_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8726_device::mos8726_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS8726, "MOS8726", tag, owner, clock, "mos8726", __FILE__), device_execute_interface(mconfig, *this), m_icount(0), @@ -90,7 +90,7 @@ void mos8726_device::execute_run() READ8_MEMBER( mos8726_device::read ) { - UINT8 data = 0; + uint8_t data = 0; return data; } diff --git a/src/devices/machine/mos8726.h b/src/devices/machine/mos8726.h index 8edc5e001d9..d8edd76d54d 100644 --- a/src/devices/machine/mos8726.h +++ b/src/devices/machine/mos8726.h @@ -70,7 +70,7 @@ class mos8726_device : public device_t, { public: // construction/destruction - mos8726_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8726_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); diff --git a/src/devices/machine/mpu401.cpp b/src/devices/machine/mpu401.cpp index 1dcbf1233f3..8562634db46 100644 --- a/src/devices/machine/mpu401.cpp +++ b/src/devices/machine/mpu401.cpp @@ -119,7 +119,7 @@ const tiny_rom_entry *mpu401_device::device_rom_region() const // mpu401_device - constructor //------------------------------------------------- -mpu401_device::mpu401_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mpu401_device::mpu401_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MPU401, "Roland MPU-401 I/O box", tag, owner, clock, "mpu401", __FILE__), m_ourcpu(*this, M6801_TAG), write_irq(*this) diff --git a/src/devices/machine/mpu401.h b/src/devices/machine/mpu401.h index 899ba727822..cf98056cc81 100644 --- a/src/devices/machine/mpu401.h +++ b/src/devices/machine/mpu401.h @@ -23,7 +23,7 @@ class mpu401_device : public device_t { public: // construction/destruction - mpu401_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mpu401_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; @@ -59,10 +59,10 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT8 m_port2; - UINT8 m_command; - UINT8 m_mpudata; - UINT8 m_gatearrstat; + uint8_t m_port2; + uint8_t m_command; + uint8_t m_mpudata; + uint8_t m_gatearrstat; emu_timer *m_timer; }; diff --git a/src/devices/machine/msm5832.cpp b/src/devices/machine/msm5832.cpp index 97e89eca2ff..51b98621f69 100644 --- a/src/devices/machine/msm5832.cpp +++ b/src/devices/machine/msm5832.cpp @@ -87,7 +87,7 @@ inline void msm5832_device::write_counter(int counter, int value) // msm5832_device - constructor //------------------------------------------------- -msm5832_device::msm5832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msm5832_device::msm5832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSM5832, "MSM5832", tag, owner, clock, "msm5832", __FILE__), device_rtc_interface(mconfig, *this), m_hold(0), @@ -163,7 +163,7 @@ void msm5832_device::rtc_clock_updated(int year, int month, int day, int day_of_ READ8_MEMBER( msm5832_device::data_r ) { - UINT8 data = 0; + uint8_t data = 0; if (m_cs && m_read) { @@ -217,7 +217,7 @@ WRITE8_MEMBER( msm5832_device::data_w ) // address_w - //------------------------------------------------- -void msm5832_device::address_w(UINT8 data) +void msm5832_device::address_w(uint8_t data) { if (LOG) logerror("MSM5832 Address: %01x\n", data & 0x0f); diff --git a/src/devices/machine/msm5832.h b/src/devices/machine/msm5832.h index d436d4ccc78..9e7b32f5a83 100644 --- a/src/devices/machine/msm5832.h +++ b/src/devices/machine/msm5832.h @@ -48,12 +48,12 @@ class msm5832_device : public device_t, { public: // construction/destruction - msm5832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msm5832_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( data_w ); - void address_w(UINT8 data); + void address_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER( adj_w ); DECLARE_WRITE_LINE_MEMBER( test_w ); @@ -77,7 +77,7 @@ private: inline int read_counter(int counter); inline void write_counter(int counter, int value); - UINT8 m_reg[13]; // registers + uint8_t m_reg[13]; // registers int m_hold; // counter hold int m_address; // address diff --git a/src/devices/machine/msm58321.cpp b/src/devices/machine/msm58321.cpp index a66f0ba9865..3919146eaaa 100644 --- a/src/devices/machine/msm58321.cpp +++ b/src/devices/machine/msm58321.cpp @@ -51,7 +51,7 @@ enum REGISTER_REF1 }; -static const char *reg_name(UINT8 address) +static const char *reg_name(uint8_t address) { switch(address) { @@ -171,7 +171,7 @@ inline void msm58321_device::write_counter(int address, int data) // msm58321_device - constructor //------------------------------------------------- -msm58321_device::msm58321_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msm58321_device::msm58321_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSM58321, "MSM58321", tag, owner, clock, "msm58321", __FILE__), device_rtc_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -333,7 +333,7 @@ void msm58321_device::nvram_write(emu_file &file) void msm58321_device::update_output() { - UINT8 data = 0xf; + uint8_t data = 0xf; if (m_cs1 && m_cs2 && m_read) { @@ -395,7 +395,7 @@ void msm58321_device::update_input() { if (m_cs1 && m_cs2) { - UINT8 data = m_d0_in | (m_d1_in << 1) | (m_d2_in << 2) | (m_d3_in << 3); + uint8_t data = m_d0_in | (m_d1_in << 1) | (m_d2_in << 2) | (m_d3_in << 3); if (m_address_write) { diff --git a/src/devices/machine/msm58321.h b/src/devices/machine/msm58321.h index b4f9de48053..ef6bf799bdd 100644 --- a/src/devices/machine/msm58321.h +++ b/src/devices/machine/msm58321.h @@ -60,7 +60,7 @@ class msm58321_device : public device_t, { public: // construction/destruction - msm58321_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msm58321_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_d0_handler(device_t &device, _Object object) { return downcast(device).m_d0_handler.set_callback(object); } @@ -132,8 +132,8 @@ private: int m_test; // test flag int m_cs1; // chip select 1 - UINT8 m_address; // address latch - UINT8 m_reg[13]; // registers + uint8_t m_address; // address latch + uint8_t m_reg[13]; // registers // timers emu_timer *m_clock_timer; diff --git a/src/devices/machine/msm6242.cpp b/src/devices/machine/msm6242.cpp index 9b0b35df2c3..33f029936dd 100644 --- a/src/devices/machine/msm6242.cpp +++ b/src/devices/machine/msm6242.cpp @@ -65,7 +65,7 @@ const device_type MSM6242 = &device_creator; // msm6242_device - constructor //------------------------------------------------- -msm6242_device::msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msm6242_device::msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSM6242, "MSM6242 RTC", tag, owner, clock, "msm6242", __FILE__), device_rtc_interface(mconfig, *this), m_out_int_handler(*this) @@ -168,7 +168,7 @@ void msm6242_device::device_timer(emu_timer &timer, device_timer_id id, int para // irq //------------------------------------------------- -void msm6242_device::irq(UINT8 irq_type) +void msm6242_device::irq(uint8_t irq_type) { // are we actually raising this particular IRQ? if (m_irq_flag == 1 && m_irq_type == irq_type) @@ -189,26 +189,26 @@ void msm6242_device::irq(UINT8 irq_type) // bump //------------------------------------------------- -UINT64 msm6242_device::bump(int rtc_register, UINT64 delta, UINT64 register_min, UINT64 register_range) +uint64_t msm6242_device::bump(int rtc_register, uint64_t delta, uint64_t register_min, uint64_t register_range) { - UINT64 carry = 0; + uint64_t carry = 0; if (delta > 0) { // get the register value - UINT64 register_value = (rtc_register == RTC_TICKS) + uint64_t register_value = (rtc_register == RTC_TICKS) ? m_tick : get_clock_register(rtc_register); // increment the value - UINT64 new_register_value = ((register_value - register_min + delta) % register_range) + register_min; + uint64_t new_register_value = ((register_value - register_min + delta) % register_range) + register_min; // calculate the cary carry = ((register_value - register_min) + delta) / register_range; // store the new register value if (rtc_register == RTC_TICKS) - m_tick = (UINT16) new_register_value; + m_tick = (uint16_t) new_register_value; else set_clock_register(rtc_register, (int) new_register_value); } @@ -222,7 +222,7 @@ UINT64 msm6242_device::bump(int rtc_register, UINT64 delta, UINT64 register_min, // current_time //------------------------------------------------- -UINT64 msm6242_device::current_time() +uint64_t msm6242_device::current_time() { return machine().time().as_ticks(clock()); } @@ -236,10 +236,10 @@ UINT64 msm6242_device::current_time() void msm6242_device::update_rtc_registers() { // get the absolute current time, in ticks - UINT64 curtime = current_time(); + uint64_t curtime = current_time(); // how long as it been since we last updated? - UINT64 delta = curtime - m_last_update_time; + uint64_t delta = curtime - m_last_update_time; // set current time m_last_update_time = curtime; @@ -286,7 +286,7 @@ void msm6242_device::update_rtc_registers() void msm6242_device::update_timer() { - UINT64 callback_ticks = 0; + uint64_t callback_ticks = 0; attotime callback_time = attotime::never; // we only need to call back if the IRQ flag is on, and we have a handler @@ -316,10 +316,10 @@ void msm6242_device::update_timer() if (callback_ticks > 0) { // get the current time - UINT64 curtime = current_time(); + uint64_t curtime = current_time(); // we need the absolute callback time, in ticks - UINT64 absolute_callback_ticks = curtime + callback_ticks; + uint64_t absolute_callback_ticks = curtime + callback_ticks; // convert that to an attotime attotime absolute_callback_time = attotime::from_ticks(absolute_callback_ticks, clock()); @@ -360,11 +360,11 @@ void msm6242_device::rtc_timer_callback() // get_clock_nibble //------------------------------------------------- -UINT8 msm6242_device::get_clock_nibble(int rtc_register, bool high) +uint8_t msm6242_device::get_clock_nibble(int rtc_register, bool high) { int value = get_clock_register(rtc_register); value /= high ? 10 : 1; - return (UINT8) ((value % 10) & 0x0F); + return (uint8_t) ((value % 10) & 0x0F); } @@ -373,7 +373,7 @@ UINT8 msm6242_device::get_clock_nibble(int rtc_register, bool high) // get_clock_nibble //------------------------------------------------- -const char *msm6242_device::irq_type_string(UINT8 irq_type) +const char *msm6242_device::irq_type_string(uint8_t irq_type) { switch(irq_type) { @@ -398,7 +398,7 @@ const char *msm6242_device::irq_type_string(UINT8 irq_type) READ8_MEMBER( msm6242_device::read ) { int hour, pm; - UINT8 result; + uint8_t result; // update the registers; they may have changed update_rtc_registers(); @@ -469,7 +469,7 @@ READ8_MEMBER( msm6242_device::read ) break; case MSM6242_REG_W: - result = (UINT8) (get_clock_register(RTC_DAY_OF_WEEK) - 1); + result = (uint8_t) (get_clock_register(RTC_DAY_OF_WEEK) - 1); break; case MSM6242_REG_CD: diff --git a/src/devices/machine/msm6242.h b/src/devices/machine/msm6242.h index 149d58eea38..30ce46c7a01 100644 --- a/src/devices/machine/msm6242.h +++ b/src/devices/machine/msm6242.h @@ -26,7 +26,7 @@ class msm6242_device : public device_t, { public: // construction/destruction - msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msm6242_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_int_handler(device_t &device, _Object object) { return downcast(device).m_out_int_handler.set_callback(object); } @@ -49,31 +49,31 @@ protected: private: static const int RTC_TICKS = ~0; - static const UINT8 IRQ_64THSECOND = 0; - static const UINT8 IRQ_SECOND = 1; - static const UINT8 IRQ_MINUTE = 2; - static const UINT8 IRQ_HOUR = 3; + static const uint8_t IRQ_64THSECOND = 0; + static const uint8_t IRQ_SECOND = 1; + static const uint8_t IRQ_MINUTE = 2; + static const uint8_t IRQ_HOUR = 3; // state - UINT8 m_reg[3]; - UINT8 m_irq_flag; - UINT8 m_irq_type; - UINT16 m_tick; + uint8_t m_reg[3]; + uint8_t m_irq_flag; + uint8_t m_irq_type; + uint16_t m_tick; // incidentals devcb_write_line m_out_int_handler; emu_timer * m_timer; - UINT64 m_last_update_time; // last update time, in clock cycles + uint64_t m_last_update_time; // last update time, in clock cycles // methods void rtc_timer_callback(); - UINT64 current_time(); - void irq(UINT8 irq_type); - UINT64 bump(int rtc_register, UINT64 delta, UINT64 register_min, UINT64 register_range); + uint64_t current_time(); + void irq(uint8_t irq_type); + uint64_t bump(int rtc_register, uint64_t delta, uint64_t register_min, uint64_t register_range); void update_rtc_registers(); void update_timer(); - UINT8 get_clock_nibble(int rtc_register, bool high); - static const char *irq_type_string(UINT8 irq_type); + uint8_t get_clock_nibble(int rtc_register, bool high); + static const char *irq_type_string(uint8_t irq_type); }; diff --git a/src/devices/machine/ncr5380.cpp b/src/devices/machine/ncr5380.cpp index fe62190d40f..37c05421424 100644 --- a/src/devices/machine/ncr5380.cpp +++ b/src/devices/machine/ncr5380.cpp @@ -78,7 +78,7 @@ const device_type NCR5380 = &device_creator; // ncr5380_device - constructor/destructor //------------------------------------------------- -ncr5380_device::ncr5380_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ncr5380_device::ncr5380_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : legacy_scsi_host_adapter(mconfig, NCR5380, "5380 SCSI", tag, owner, clock, "ncr5380", __FILE__), m_irq_cb(*this) { @@ -134,10 +134,10 @@ void ncr5380_device::device_stop() //------------------------------------------------- // Public API //------------------------------------------------- -UINT8 ncr5380_device::ncr5380_read_reg(UINT32 offset) +uint8_t ncr5380_device::ncr5380_read_reg(uint32_t offset) { int reg = offset & 7; - UINT8 rv; + uint8_t rv; switch( reg ) { @@ -218,7 +218,7 @@ UINT8 ncr5380_device::ncr5380_read_reg(UINT32 offset) return rv; } -void ncr5380_device::ncr5380_write_reg(UINT32 offset, UINT8 data) +void ncr5380_device::ncr5380_write_reg(uint32_t offset, uint8_t data) { int reg = offset & 7; diff --git a/src/devices/machine/ncr5380.h b/src/devices/machine/ncr5380.h index 77e8adc58b0..7acf34fe4f0 100644 --- a/src/devices/machine/ncr5380.h +++ b/src/devices/machine/ncr5380.h @@ -41,13 +41,13 @@ class ncr5380_device : public legacy_scsi_host_adapter { public: // construction/destruction - ncr5380_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ncr5380_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } // our API - UINT8 ncr5380_read_reg(UINT32 offset); - void ncr5380_write_reg(UINT32 offset, UINT8 data); + uint8_t ncr5380_read_reg(uint32_t offset); + void ncr5380_write_reg(uint32_t offset, uint8_t data); protected: // device-level overrides @@ -56,11 +56,11 @@ protected: virtual void device_stop() override; private: - UINT8 m_5380_Registers[8]; - UINT8 m_last_id; - UINT8 m_5380_Command[32]; - INT32 m_cmd_ptr, m_d_ptr, m_d_limit, m_next_req_flag; - UINT8 m_5380_Data[512]; + uint8_t m_5380_Registers[8]; + uint8_t m_last_id; + uint8_t m_5380_Command[32]; + int32_t m_cmd_ptr, m_d_ptr, m_d_limit, m_next_req_flag; + uint8_t m_5380_Data[512]; devcb_write_line m_irq_cb; /* irq callback */ }; diff --git a/src/devices/machine/ncr5380n.cpp b/src/devices/machine/ncr5380n.cpp index cffe173d73c..84e1c08184e 100644 --- a/src/devices/machine/ncr5380n.cpp +++ b/src/devices/machine/ncr5380n.cpp @@ -30,7 +30,7 @@ DEVICE_ADDRESS_MAP_START(map, 8, ncr5380n_device) AM_RANGE(0x7, 0x7) AM_READWRITE(resetparityirq_r, startdmainitrx_w) ADDRESS_MAP_END -ncr5380n_device::ncr5380n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ncr5380n_device::ncr5380n_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nscsi_device(mconfig, NCR5380N, "5380 SCSI (new)", tag, owner, clock, "ncr5380", __FILE__), tm(nullptr), status(0), istatus(0), m_mode(0), m_outdata(0), m_busstatus(0), m_dmalatch(0), m_icommand(0), m_tcommand(0), clock_conv(0), sync_offset(0), sync_period(0), bus_id(0), select_timeout(0), seq(0), tcount(0), mode(0), state(0), irq(false), drq(false), @@ -99,7 +99,7 @@ void ncr5380n_device::reset_disconnect() void ncr5380n_device::scsi_ctrl_changed() { - UINT32 ctrl = scsi_bus->ctrl_r(); + uint32_t ctrl = scsi_bus->ctrl_r(); // printf("scsi_ctrl_changed: lines now %x\n", ctrl); @@ -143,8 +143,8 @@ void ncr5380n_device::device_timer(emu_timer &timer, device_timer_id id, int par void ncr5380n_device::step(bool timeout) { - UINT32 ctrl = scsi_bus->ctrl_r(); - UINT32 data = scsi_bus->data_r(); + uint32_t ctrl = scsi_bus->ctrl_r(); + uint32_t data = scsi_bus->data_r(); if(0) printf("%s: state=%d.%d %s\n", @@ -318,11 +318,11 @@ WRITE8_MEMBER(ncr5380n_device::icmd_w) } // any control lines changing? - UINT8 mask = (data & IC_PHASEMASK) ^ (m_icommand & IC_PHASEMASK); + uint8_t mask = (data & IC_PHASEMASK) ^ (m_icommand & IC_PHASEMASK); if (mask) { // translate data to nscsi - UINT8 newdata; + uint8_t newdata; newdata = (data & IC_RST ? S_RST : 0) | (data & IC_ACK ? S_ACK : 0) | @@ -413,8 +413,8 @@ void ncr5380n_device::check_irq() READ8_MEMBER(ncr5380n_device::status_r) { - UINT32 ctrl = scsi_bus->ctrl_r(); - UINT8 res = status | + uint32_t ctrl = scsi_bus->ctrl_r(); + uint8_t res = status | (ctrl & S_RST ? ST_RST : 0) | (ctrl & S_BSY ? ST_BSY : 0) | (ctrl & S_REQ ? ST_REQ : 0) | @@ -433,8 +433,8 @@ WRITE8_MEMBER(ncr5380n_device::selenable_w) READ8_MEMBER(ncr5380n_device::busandstatus_r) { - UINT32 ctrl = scsi_bus->ctrl_r(); - UINT8 res = m_busstatus | + uint32_t ctrl = scsi_bus->ctrl_r(); + uint8_t res = m_busstatus | (ctrl & S_ATN ? BAS_ATN : 0) | (ctrl & S_ACK ? BAS_ACK : 0); @@ -470,7 +470,7 @@ WRITE8_MEMBER(ncr5380n_device::startdmainitrx_w) recv_byte(); } -void ncr5380n_device::dma_w(UINT8 val) +void ncr5380n_device::dma_w(uint8_t val) { // drop DRQ until we're ready for another byte drq_clear(); @@ -482,7 +482,7 @@ void ncr5380n_device::dma_w(UINT8 val) } } -UINT8 ncr5380n_device::dma_r() +uint8_t ncr5380n_device::dma_r() { // drop DRQ drq_clear(); diff --git a/src/devices/machine/ncr5380n.h b/src/devices/machine/ncr5380n.h index 444ef1af32d..fdb83159b50 100644 --- a/src/devices/machine/ncr5380n.h +++ b/src/devices/machine/ncr5380n.h @@ -22,7 +22,7 @@ class ncr5380n_device : public nscsi_device { public: - ncr5380n_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ncr5380n_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); } @@ -52,8 +52,8 @@ public: virtual void scsi_ctrl_changed() override; - UINT8 dma_r(); - void dma_w(UINT8 val); + uint8_t dma_r(); + void dma_w(uint8_t val); protected: virtual void device_start() override; @@ -189,10 +189,10 @@ private: emu_timer *tm; - UINT8 status, istatus, m_mode, m_outdata, m_busstatus, m_dmalatch; - UINT8 m_icommand, m_tcommand; - UINT8 clock_conv, sync_offset, sync_period, bus_id, select_timeout, seq; - UINT16 tcount; + uint8_t status, istatus, m_mode, m_outdata, m_busstatus, m_dmalatch; + uint8_t m_icommand, m_tcommand; + uint8_t clock_conv, sync_offset, sync_period, bus_id, select_timeout, seq; + uint16_t tcount; int mode; int state/*, xfr_phase*/; diff --git a/src/devices/machine/ncr5390.cpp b/src/devices/machine/ncr5390.cpp index 9de72de9afe..4ae2f6c5f7b 100644 --- a/src/devices/machine/ncr5390.cpp +++ b/src/devices/machine/ncr5390.cpp @@ -21,7 +21,7 @@ DEVICE_ADDRESS_MAP_START(map, 8, ncr5390_device) AM_RANGE(0x9, 0x9) AM_WRITE(clock_w) ADDRESS_MAP_END -ncr5390_device::ncr5390_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ncr5390_device::ncr5390_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nscsi_device(mconfig, NCR5390, "5390 SCSI", tag, owner, clock, "ncr5390", __FILE__), tm(nullptr), config(0), status(0), istatus(0), clock_conv(0), sync_offset(0), sync_period(0), bus_id(0), select_timeout(0), seq(0), tcount(0), mode(0), fifo_pos(0), command_pos(0), state(0), xfr_phase(0), command_length(0), dma_dir(0), irq(false), drq(false), m_irq_handler(*this), @@ -103,7 +103,7 @@ void ncr5390_device::reset_disconnect() void ncr5390_device::scsi_ctrl_changed() { - UINT32 ctrl = scsi_bus->ctrl_r(); + uint32_t ctrl = scsi_bus->ctrl_r(); if(ctrl & S_RST) { logerror("%s: scsi bus reset\n", tag()); return; @@ -119,9 +119,9 @@ void ncr5390_device::device_timer(emu_timer &timer, device_timer_id id, int para void ncr5390_device::step(bool timeout) { - UINT32 ctrl = scsi_bus->ctrl_r(); - UINT32 data = scsi_bus->data_r(); - UINT8 c = command[0] & 0x7f; + uint32_t ctrl = scsi_bus->ctrl_r(); + uint32_t data = scsi_bus->data_r(); + uint8_t c = command[0] & 0x7f; if(0) logerror("%s: state=%d.%d %s\n", @@ -569,9 +569,9 @@ WRITE8_MEMBER(ncr5390_device::tcount_hi_w) logerror("%s: tcount_hi_w %02x (%08x)\n", tag(), data, space.device().safe_pc()); } -UINT8 ncr5390_device::fifo_pop() +uint8_t ncr5390_device::fifo_pop() { - UINT8 r = fifo[0]; + uint8_t r = fifo[0]; fifo_pos--; memmove(fifo, fifo+1, fifo_pos); if((!fifo_pos) && tcount && dma_dir == DMA_OUT) @@ -579,7 +579,7 @@ UINT8 ncr5390_device::fifo_pop() return r; } -void ncr5390_device::fifo_push(UINT8 val) +void ncr5390_device::fifo_push(uint8_t val) { fifo[fifo_pos++] = val; if(!drq && dma_dir == DMA_IN) @@ -588,7 +588,7 @@ void ncr5390_device::fifo_push(UINT8 val) READ8_MEMBER(ncr5390_device::fifo_r) { - UINT8 r; + uint8_t r; if(fifo_pos) { r = fifo[0]; fifo_pos--; @@ -636,7 +636,7 @@ void ncr5390_device::command_pop_and_chain() void ncr5390_device::start_command() { - UINT8 c = command[0] & 0x7f; + uint8_t c = command[0] & 0x7f; if(!check_valid_command(c)) { logerror("%s: invalid command %02x\n", tag(), command[0]); istatus |= I_ILLEGAL; @@ -712,7 +712,7 @@ void ncr5390_device::start_command() } } -bool ncr5390_device::check_valid_command(UINT8 cmd) +bool ncr5390_device::check_valid_command(uint8_t cmd) { int subcmd = cmd & 15; switch((cmd >> 4) & 7) { @@ -724,7 +724,7 @@ bool ncr5390_device::check_valid_command(UINT8 cmd) return false; } -int ncr5390_device::derive_msg_size(UINT8 msg_id) +int ncr5390_device::derive_msg_size(uint8_t msg_id) { const static int sizes[8] = { 6, 10, 6, 6, 6, 12, 6, 10 }; return sizes[msg_id >> 5]; @@ -749,8 +749,8 @@ void ncr5390_device::check_irq() READ8_MEMBER(ncr5390_device::status_r) { - UINT32 ctrl = scsi_bus->ctrl_r(); - UINT8 res = status | (ctrl & S_MSG ? 4 : 0) | (ctrl & S_CTL ? 2 : 0) | (ctrl & S_INP ? 1 : 0); + uint32_t ctrl = scsi_bus->ctrl_r(); + uint8_t res = status | (ctrl & S_MSG ? 4 : 0) | (ctrl & S_CTL ? 2 : 0) | (ctrl & S_INP ? 1 : 0); logerror("%s: status_r %02x (%08x)\n", tag(), res, space.device().safe_pc()); if(irq) status &= ~(S_GROSS_ERROR|S_PARITY|S_TCC); @@ -765,7 +765,7 @@ WRITE8_MEMBER(ncr5390_device::bus_id_w) READ8_MEMBER(ncr5390_device::istatus_r) { - UINT8 res = istatus; + uint8_t res = istatus; istatus = 0; seq = 0; check_irq(); @@ -825,7 +825,7 @@ void ncr5390_device::dma_set(int dir) drq_set(); } -void ncr5390_device::dma_w(UINT8 val) +void ncr5390_device::dma_w(uint8_t val) { fifo_push(val); tcount--; @@ -833,9 +833,9 @@ void ncr5390_device::dma_w(UINT8 val) drq_clear(); } -UINT8 ncr5390_device::dma_r() +uint8_t ncr5390_device::dma_r() { - UINT8 r = fifo_pop(); + uint8_t r = fifo_pop(); if(!fifo_pos) drq_clear(); tcount--; diff --git a/src/devices/machine/ncr5390.h b/src/devices/machine/ncr5390.h index 7dfac6f5681..200e1acb57e 100644 --- a/src/devices/machine/ncr5390.h +++ b/src/devices/machine/ncr5390.h @@ -14,7 +14,7 @@ class ncr5390_device : public nscsi_device { public: - ncr5390_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ncr5390_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); } @@ -44,8 +44,8 @@ public: virtual void scsi_ctrl_changed() override; - UINT8 dma_r(); - void dma_w(UINT8 val); + uint8_t dma_r(); + void dma_w(uint8_t val); protected: virtual void device_start() override; @@ -184,10 +184,10 @@ private: emu_timer *tm; - UINT8 command[2], config, status, istatus; - UINT8 clock_conv, sync_offset, sync_period, bus_id, select_timeout, seq; - UINT8 fifo[16]; - UINT16 tcount; + uint8_t command[2], config, status, istatus; + uint8_t clock_conv, sync_offset, sync_period, bus_id, select_timeout, seq; + uint8_t fifo[16]; + uint16_t tcount; int mode, fifo_pos, command_pos; int state, xfr_phase; int command_length; @@ -202,8 +202,8 @@ private: void start_command(); void step(bool timeout); - bool check_valid_command(UINT8 cmd); - int derive_msg_size(UINT8 msg_id); + bool check_valid_command(uint8_t cmd); + int derive_msg_size(uint8_t msg_id); void function_complete(); void function_bus_complete(); void bus_complete(); @@ -215,8 +215,8 @@ private: void reset_soft(); void reset_disconnect(); - UINT8 fifo_pop(); - void fifo_push(UINT8 val); + uint8_t fifo_pop(); + void fifo_push(uint8_t val); void send_byte(); void recv_byte(); diff --git a/src/devices/machine/ncr539x.cpp b/src/devices/machine/ncr539x.cpp index 3d0a83b5246..67959d7fa08 100644 --- a/src/devices/machine/ncr539x.cpp +++ b/src/devices/machine/ncr539x.cpp @@ -116,7 +116,7 @@ const device_type NCR539X = &device_creator; // ncr539x_device - constructor/destructor //------------------------------------------------- -ncr539x_device::ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ncr539x_device::ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : legacy_scsi_host_adapter(mconfig, NCR539X, "539x SCSI", tag, owner, clock, "ncr539x", __FILE__), m_out_irq_cb(*this), m_out_drq_cb(*this) @@ -163,13 +163,13 @@ void ncr539x_device::device_reset() m_out_drq_cb(CLEAR_LINE); } -void ncr539x_device::dma_read_data(int bytes, UINT8 *pData) +void ncr539x_device::dma_read_data(int bytes, uint8_t *pData) { read_data(pData, bytes); } -void ncr539x_device::dma_write_data(int bytes, UINT8 *pData) +void ncr539x_device::dma_write_data(int bytes, uint8_t *pData) { write_data(pData, bytes); } @@ -292,7 +292,7 @@ void ncr539x_device::device_timer(emu_timer &timer, device_timer_id tid, int par READ8_MEMBER( ncr539x_device::read ) { - UINT8 rv = 0; + uint8_t rv = 0; #if VERBOSE #if VERBOSE_READS @@ -312,7 +312,7 @@ READ8_MEMBER( ncr539x_device::read ) case 2: // FIFO { - UINT8 fifo_bytes = m_fifo_internal_state & 0x1f; + uint8_t fifo_bytes = m_fifo_internal_state & 0x1f; if (!fifo_bytes) { @@ -753,7 +753,7 @@ void ncr539x_device::check_fifo_executable() } } -void ncr539x_device::fifo_write(UINT8 data) +void ncr539x_device::fifo_write(uint8_t data) { int phase = (m_status & 7); diff --git a/src/devices/machine/ncr539x.h b/src/devices/machine/ncr539x.h index 95b3655228d..3803a1ca975 100644 --- a/src/devices/machine/ncr539x.h +++ b/src/devices/machine/ncr539x.h @@ -27,7 +27,7 @@ class ncr539x_device : public legacy_scsi_host_adapter { public: // construction/destruction - ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ncr539x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_irq_callback(device_t &device, _Object object) { return downcast(device).m_out_irq_cb.set_callback(object); } template static devcb_base &set_out_drq_callback(device_t &device, _Object object) { return downcast(device).m_out_drq_cb.set_callback(object); } @@ -36,8 +36,8 @@ public: DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); - void dma_read_data(int bytes, UINT8 *pData); - void dma_write_data(int bytes, UINT8 *pData); + void dma_read_data(int bytes, uint8_t *pData); + void dma_write_data(int bytes, uint8_t *pData); protected: // device-level overrides @@ -46,37 +46,37 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - void fifo_write(UINT8 data); + void fifo_write(uint8_t data); void check_fifo_executable(); void exec_fifo(); void update_fifo_internal_state(int bytes); - UINT32 m_xfer_count; - UINT32 m_dma_size; - UINT8 m_command; - UINT8 m_last_id; - UINT8 m_timeout; - UINT8 m_sync_xfer_period; - UINT8 m_sync_offset; - UINT8 m_control1, m_control2, m_control3, m_control4; - UINT8 m_clock_factor; - UINT8 m_forced_test; - UINT8 m_data_alignment; + uint32_t m_xfer_count; + uint32_t m_dma_size; + uint8_t m_command; + uint8_t m_last_id; + uint8_t m_timeout; + uint8_t m_sync_xfer_period; + uint8_t m_sync_offset; + uint8_t m_control1, m_control2, m_control3, m_control4; + uint8_t m_clock_factor; + uint8_t m_forced_test; + uint8_t m_data_alignment; bool m_selected; bool m_chipid_available, m_chipid_lock; static const int m_fifo_size = 16; - UINT8 m_fifo_ptr, m_fifo_read_ptr, m_fifo[m_fifo_size]; + uint8_t m_fifo_ptr, m_fifo_read_ptr, m_fifo[m_fifo_size]; //int m_xfer_remaining; // amount in the FIFO when we're in data in phase // read-only registers - UINT8 m_status, m_irq_status, m_internal_state, m_fifo_internal_state; + uint8_t m_status, m_irq_status, m_internal_state, m_fifo_internal_state; static const int m_buffer_size = 2048; - UINT8 m_buffer[m_buffer_size]; + uint8_t m_buffer[m_buffer_size]; int m_buffer_offset, m_buffer_remaining, m_total_data; emu_timer *m_operation_timer; diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index e04d0f31a60..4fa344e4f4c 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -46,7 +46,7 @@ void netlist_mame_sub_interface::static_set_mult_offset(device_t &device, const } -netlist_mame_analog_input_t::netlist_mame_analog_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +netlist_mame_analog_input_t::netlist_mame_analog_input_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NETLIST_ANALOG_INPUT, "Netlist Analog Input", tag, owner, clock, "netlist_analog_input", __FILE__), netlist_mame_sub_interface(*owner), m_param(nullptr), @@ -82,7 +82,7 @@ void netlist_mame_analog_input_t::device_start() // netlist_mame_analog_output_t // ---------------------------------------------------------------------------------------- -netlist_mame_analog_output_t::netlist_mame_analog_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +netlist_mame_analog_output_t::netlist_mame_analog_output_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NETLIST_ANALOG_INPUT, "Netlist Analog Output", tag, owner, clock, "netlist_analog_output", __FILE__), netlist_mame_sub_interface(*owner), m_in("") @@ -117,7 +117,7 @@ void netlist_mame_analog_output_t::device_start() // netlist_mame_int_input_t // ---------------------------------------------------------------------------------------- -netlist_mame_int_input_t::netlist_mame_int_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +netlist_mame_int_input_t::netlist_mame_int_input_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NETLIST_INT_INPUT, "Netlist Logic Input", tag, owner, clock, "netlist_logic_input", __FILE__), netlist_mame_sub_interface(*owner), m_param(nullptr), @@ -127,7 +127,7 @@ netlist_mame_int_input_t::netlist_mame_int_input_t(const machine_config &mconfig { } -void netlist_mame_int_input_t::static_set_params(device_t &device, const char *param_name, const UINT32 mask, const UINT32 shift) +void netlist_mame_int_input_t::static_set_params(device_t &device, const char *param_name, const uint32_t mask, const uint32_t shift) { netlist_mame_int_input_t &netlist = downcast(device); LOG_DEV_CALLS(("static_set_params %s\n", device.tag())); @@ -151,7 +151,7 @@ void netlist_mame_int_input_t::device_start() // netlist_mame_logic_input_t // ---------------------------------------------------------------------------------------- -netlist_mame_logic_input_t::netlist_mame_logic_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +netlist_mame_logic_input_t::netlist_mame_logic_input_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NETLIST_LOGIC_INPUT, "Netlist Logic Input", tag, owner, clock, "netlist_logic_input", __FILE__), netlist_mame_sub_interface(*owner), m_param(nullptr), @@ -160,7 +160,7 @@ netlist_mame_logic_input_t::netlist_mame_logic_input_t(const machine_config &mco { } -void netlist_mame_logic_input_t::static_set_params(device_t &device, const char *param_name, const UINT32 shift) +void netlist_mame_logic_input_t::static_set_params(device_t &device, const char *param_name, const uint32_t shift) { netlist_mame_logic_input_t &netlist = downcast(device); LOG_DEV_CALLS(("static_set_params %s\n", device.tag())); @@ -183,7 +183,7 @@ void netlist_mame_logic_input_t::device_start() // netlist_mame_stream_input_t // ---------------------------------------------------------------------------------------- -netlist_mame_stream_input_t::netlist_mame_stream_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +netlist_mame_stream_input_t::netlist_mame_stream_input_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NETLIST_ANALOG_INPUT, "Netlist Stream Input", tag, owner, clock, "netlist_stream_input", __FILE__), netlist_mame_sub_interface(*owner), m_channel(0), @@ -220,7 +220,7 @@ void netlist_mame_stream_input_t::custom_netlist_additions(netlist::setup_t &set // netlist_mame_stream_output_t // ---------------------------------------------------------------------------------------- -netlist_mame_stream_output_t::netlist_mame_stream_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +netlist_mame_stream_output_t::netlist_mame_stream_output_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NETLIST_ANALOG_INPUT, "Netlist Stream Output", tag, owner, clock, "netlist_stream_output", __FILE__), netlist_mame_sub_interface(*owner), m_channel(0), @@ -294,7 +294,7 @@ static ADDRESS_MAP_START(program_dummy, AS_PROGRAM, 8, netlist_mame_device_t) AM_RANGE(0x000, 0x3ff) AM_ROM ADDRESS_MAP_END -netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NETLIST_CORE, "Netlist core device", tag, owner, clock, "netlist_core", __FILE__), m_icount(0), m_old(netlist::netlist_time::zero()), @@ -304,7 +304,7 @@ netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, cons { } -netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *file) +netlist_mame_device_t::netlist_mame_device_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 *file) : device_t(mconfig, type, name, tag, owner, clock, shortname, file), m_icount(0), m_old(netlist::netlist_time::zero()), @@ -418,7 +418,7 @@ void netlist_mame_device_t::update_time_x() { const netlist::netlist_time newt(netlist().time()); const netlist::netlist_time delta(newt - m_old + m_rem); - const UINT64 d = delta / m_div; + const uint64_t d = delta / m_div; m_old = newt; m_rem = delta - (m_div * d); m_icount -= d; @@ -452,17 +452,17 @@ ATTR_COLD void netlist_mame_device_t::save_state() } else if (s->m_dt.is_integral) { - if (s->m_dt.size == sizeof(INT64)) - save_pointer((INT64 *) s->m_ptr, s->m_name.cstr(), s->m_count); - else if (s->m_dt.size == sizeof(INT32)) - save_pointer((INT32 *) s->m_ptr, s->m_name.cstr(), s->m_count); - else if (s->m_dt.size == sizeof(INT16)) - save_pointer((INT16 *) s->m_ptr, s->m_name.cstr(), s->m_count); - else if (s->m_dt.size == sizeof(INT8)) - save_pointer((INT8 *) s->m_ptr, s->m_name.cstr(), s->m_count); + if (s->m_dt.size == sizeof(int64_t)) + save_pointer((int64_t *) s->m_ptr, s->m_name.cstr(), s->m_count); + else if (s->m_dt.size == sizeof(int32_t)) + save_pointer((int32_t *) s->m_ptr, s->m_name.cstr(), s->m_count); + else if (s->m_dt.size == sizeof(int16_t)) + save_pointer((int16_t *) s->m_ptr, s->m_name.cstr(), s->m_count); + else if (s->m_dt.size == sizeof(int8_t)) + save_pointer((int8_t *) s->m_ptr, s->m_name.cstr(), s->m_count); #if (PHAS_INT128) else if (s->m_dt.size == sizeof(INT128)) - save_pointer((INT64 *) s->m_ptr, s->m_name.cstr(), s->m_count * 2); + save_pointer((int64_t *) s->m_ptr, s->m_name.cstr(), s->m_count * 2); #endif else netlist().log().fatal("Unknown integral type size {1} for {2}\n", s->m_dt.size, s->m_name.cstr()); @@ -480,7 +480,7 @@ ATTR_COLD void netlist_mame_device_t::save_state() // netlist_mame_cpu_device_t // ---------------------------------------------------------------------------------------- -netlist_mame_cpu_device_t::netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +netlist_mame_cpu_device_t::netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : netlist_mame_device_t(mconfig, NETLIST_CPU, "Netlist CPU Device", tag, owner, clock, "netlist_cpu", __FILE__), device_execute_interface(mconfig, *this), device_state_interface(mconfig, *this), @@ -525,17 +525,17 @@ void netlist_mame_cpu_device_t::nl_register_devices() setup().factory().register_device( "NETDEV_CALLBACK", "nld_analog_callback", "-"); } -ATTR_COLD UINT64 netlist_mame_cpu_device_t::execute_clocks_to_cycles(UINT64 clocks) const +ATTR_COLD uint64_t netlist_mame_cpu_device_t::execute_clocks_to_cycles(uint64_t clocks) const { return clocks; } -ATTR_COLD UINT64 netlist_mame_cpu_device_t::execute_cycles_to_clocks(UINT64 cycles) const +ATTR_COLD uint64_t netlist_mame_cpu_device_t::execute_cycles_to_clocks(uint64_t cycles) const { return cycles; } -ATTR_COLD offs_t netlist_mame_cpu_device_t::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +ATTR_COLD offs_t netlist_mame_cpu_device_t::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { //char tmp[16]; unsigned startpc = pc; @@ -581,7 +581,7 @@ ATTR_HOT void netlist_mame_cpu_device_t::execute_run() // netlist_mame_sound_device_t // ---------------------------------------------------------------------------------------- -netlist_mame_sound_device_t::netlist_mame_sound_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +netlist_mame_sound_device_t::netlist_mame_sound_device_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : netlist_mame_device_t(mconfig, NETLIST_CPU, "Netlist Sound Device", tag, owner, clock, "netlist_sound", __FILE__), device_sound_interface(mconfig, *this) { diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h index a7e3da059c2..e1b5842fe5c 100644 --- a/src/devices/machine/netlist.h +++ b/src/devices/machine/netlist.h @@ -120,8 +120,8 @@ class netlist_mame_device_t : public device_t public: // construction/destruction - netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - netlist_mame_device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *file); + netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + netlist_mame_device_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 *file); virtual ~netlist_mame_device_t() { pstring::resetmem(); } static void static_set_constructor(device_t &device, void (*setup_func)(netlist::setup_t &)); @@ -184,7 +184,7 @@ class netlist_mame_cpu_device_t : public netlist_mame_device_t, public: // construction/destruction - netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~netlist_mame_cpu_device_t() {} protected: // netlist_mame_device_t @@ -202,15 +202,15 @@ protected: // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override; - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override; + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override; ATTR_HOT virtual void execute_run() override; // device_disasm_interface overrides - ATTR_COLD virtual UINT32 disasm_min_opcode_bytes() const override { return 1; } - ATTR_COLD virtual UINT32 disasm_max_opcode_bytes() const override { return 1; } - ATTR_COLD virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + ATTR_COLD virtual uint32_t disasm_min_opcode_bytes() const override { return 1; } + ATTR_COLD virtual uint32_t disasm_max_opcode_bytes() const override { return 1; } + ATTR_COLD virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; // device_memory_interface overrides @@ -258,7 +258,7 @@ class netlist_mame_sound_device_t : public netlist_mame_device_t, public: // construction/destruction - netlist_mame_sound_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + netlist_mame_sound_device_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~netlist_mame_sound_device_t() {} inline sound_stream *get_stream() { return m_stream; } @@ -341,7 +341,7 @@ class netlist_mame_analog_input_t : public device_t, public: // construction/destruction - netlist_mame_analog_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + netlist_mame_analog_input_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~netlist_mame_analog_input_t() { } static void static_set_name(device_t &device, const char *param_name); @@ -395,7 +395,7 @@ class netlist_mame_analog_output_t : public device_t, public: // construction/destruction - netlist_mame_analog_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + netlist_mame_analog_output_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~netlist_mame_analog_output_t() { } static void static_set_params(device_t &device, const char *in_name, netlist_analog_output_delegate adelegate); @@ -421,14 +421,14 @@ class netlist_mame_int_input_t : public device_t, public: // construction/destruction - netlist_mame_int_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + netlist_mame_int_input_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~netlist_mame_int_input_t() { } - static void static_set_params(device_t &device, const char *param_name, const UINT32 mask, const UINT32 shift); + static void static_set_params(device_t &device, const char *param_name, const uint32_t mask, const uint32_t shift); - inline void write(const UINT32 val) + inline void write(const uint32_t val) { - const UINT32 v = (val >> m_shift) & m_mask; + const uint32_t v = (val >> m_shift) & m_mask; if (v != (*m_param)()) synchronize(0, v); } @@ -452,8 +452,8 @@ protected: private: netlist::param_int_t *m_param; - UINT32 m_mask; - UINT32 m_shift; + uint32_t m_mask; + uint32_t m_shift; pstring m_param_name; }; @@ -467,14 +467,14 @@ class netlist_mame_logic_input_t : public device_t, public: // construction/destruction - netlist_mame_logic_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + netlist_mame_logic_input_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~netlist_mame_logic_input_t() { } - static void static_set_params(device_t &device, const char *param_name, const UINT32 shift); + static void static_set_params(device_t &device, const char *param_name, const uint32_t shift); - inline void write(const UINT32 val) + inline void write(const uint32_t val) { - const UINT32 v = (val >> m_shift) & 1; + const uint32_t v = (val >> m_shift) & 1; if (v != (*m_param)()) synchronize(0, v); } @@ -498,7 +498,7 @@ protected: private: netlist::param_logic_t *m_param; - UINT32 m_shift; + uint32_t m_shift; pstring m_param_name; }; @@ -512,7 +512,7 @@ class netlist_mame_stream_input_t : public device_t, public: // construction/destruction - netlist_mame_stream_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + netlist_mame_stream_input_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~netlist_mame_stream_input_t() { } static void static_set_params(device_t &device, int channel, const char *param_name); @@ -522,7 +522,7 @@ protected: virtual void device_start() override; virtual void custom_netlist_additions(netlist::setup_t &setup) override; private: - UINT32 m_channel; + uint32_t m_channel; pstring m_param_name; }; @@ -536,7 +536,7 @@ class netlist_mame_stream_output_t : public device_t, public: // construction/destruction - netlist_mame_stream_output_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + netlist_mame_stream_output_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~netlist_mame_stream_output_t() { } static void static_set_params(device_t &device, int channel, const char *out_name); @@ -546,7 +546,7 @@ protected: virtual void device_start() override; virtual void custom_netlist_additions(netlist::setup_t &setup) override; private: - UINT32 m_channel; + uint32_t m_channel; pstring m_out_name; }; // ---------------------------------------------------------------------------------------- diff --git a/src/devices/machine/nmc9306.cpp b/src/devices/machine/nmc9306.cpp index 85580a6a621..aa495a7791e 100644 --- a/src/devices/machine/nmc9306.cpp +++ b/src/devices/machine/nmc9306.cpp @@ -62,7 +62,7 @@ const device_type NMC9306 = &device_creator; // nmc9306_device - constructor //------------------------------------------------- -inline UINT16 nmc9306_device::read(offs_t offset) +inline uint16_t nmc9306_device::read(offs_t offset) { return m_register[offset]; } @@ -72,7 +72,7 @@ inline UINT16 nmc9306_device::read(offs_t offset) // nmc9306_device - constructor //------------------------------------------------- -inline void nmc9306_device::write(offs_t offset, UINT16 data) +inline void nmc9306_device::write(offs_t offset, uint16_t data) { if (m_ewen) { @@ -103,7 +103,7 @@ inline void nmc9306_device::erase(offs_t offset) // nmc9306_device - constructor //------------------------------------------------- -nmc9306_device::nmc9306_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nmc9306_device::nmc9306_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NMC9306, "NMC9306", tag, owner, clock, "nmc9306", __FILE__), device_nvram_interface(mconfig, *this), m_state(STATE_IDLE), diff --git a/src/devices/machine/nmc9306.h b/src/devices/machine/nmc9306.h index 92aba51965b..8812926189b 100644 --- a/src/devices/machine/nmc9306.h +++ b/src/devices/machine/nmc9306.h @@ -50,7 +50,7 @@ class nmc9306_device : public device_t, { public: // construction/destruction - nmc9306_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nmc9306_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( cs_w ); DECLARE_WRITE_LINE_MEMBER( sk_w ); @@ -67,17 +67,17 @@ protected: virtual void nvram_write(emu_file &file) override; private: - inline UINT16 read(offs_t offset); - inline void write(offs_t offset, UINT16 data); + inline uint16_t read(offs_t offset); + inline void write(offs_t offset, uint16_t data); inline void erase(offs_t offset); - UINT16 m_register[16]; + uint16_t m_register[16]; int m_bits; int m_state; - UINT8 m_command; - UINT8 m_address; - UINT16 m_data; + uint8_t m_command; + uint8_t m_address; + uint16_t m_data; bool m_ewen; int m_cs; int m_sk; diff --git a/src/devices/machine/nsc810.cpp b/src/devices/machine/nsc810.cpp index fb2f3466508..24707067761 100644 --- a/src/devices/machine/nsc810.cpp +++ b/src/devices/machine/nsc810.cpp @@ -22,7 +22,7 @@ const device_type NSC810 = &device_creator; -nsc810_device::nsc810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nsc810_device::nsc810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NSC810, "National Semiconductor NSC810", tag, owner, clock, "nsc810", __FILE__), m_portA_latch(0), m_portB_latch(0), m_portC_latch(0), m_ddrA(0), m_ddrB(0), m_ddrC(0), m_mode(0), m_timer0(nullptr), m_timer1(nullptr), m_timer0_mode(0), m_timer1_mode(0), m_timer0_counter(0), m_timer1_counter(0), m_timer0_base(0), m_timer1_base(0), m_timer0_running(false), m_timer1_running(false), m_timer0_clock(0), m_timer1_clock(0), m_ramselect(false), @@ -109,7 +109,7 @@ void nsc810_device::device_timer(emu_timer &timer, device_timer_id id, int param READ8_MEMBER(nsc810_device::read) { - UINT8 res = 0xff; + uint8_t res = 0xff; if(m_ramselect) { @@ -182,7 +182,7 @@ READ8_MEMBER(nsc810_device::read) WRITE8_MEMBER(nsc810_device::write) { - UINT32 rate; + uint32_t rate; if(m_ramselect) { diff --git a/src/devices/machine/nsc810.h b/src/devices/machine/nsc810.h index 036b197680d..aa17014eab5 100644 --- a/src/devices/machine/nsc810.h +++ b/src/devices/machine/nsc810.h @@ -15,7 +15,7 @@ class nsc810_device : public device_t { public: // construction/destruction - nsc810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nsc810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_portA_read_callback(device_t &device, _Object object) { return downcast(device).m_portA_r.set_callback(object); } template static devcb_base &set_portB_read_callback(device_t &device, _Object object) { return downcast(device).m_portB_r.set_callback(object); } @@ -26,8 +26,8 @@ public: template static devcb_base &set_timer0_callback(device_t &device, _Object object) { return downcast(device).m_timer0_out.set_callback(object); } template static devcb_base &set_timer1_callback(device_t &device, _Object object) { return downcast(device).m_timer1_out.set_callback(object); } - void set_timer0_clock(UINT32 clk) { m_timer0_clock = clk; } - void set_timer1_clock(UINT32 clk) { m_timer1_clock = clk; } + void set_timer0_clock(uint32_t clk) { m_timer0_clock = clk; } + void set_timer1_clock(uint32_t clk) { m_timer1_clock = clk; } DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); @@ -38,25 +38,25 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT8 m_portA_latch; - UINT8 m_portB_latch; - UINT8 m_portC_latch; - UINT8 m_ddrA; - UINT8 m_ddrB; - UINT8 m_ddrC; - UINT8 m_mode; + uint8_t m_portA_latch; + uint8_t m_portB_latch; + uint8_t m_portC_latch; + uint8_t m_ddrA; + uint8_t m_ddrB; + uint8_t m_ddrC; + uint8_t m_mode; emu_timer* m_timer0; emu_timer* m_timer1; - UINT8 m_timer0_mode; - UINT8 m_timer1_mode; - UINT16 m_timer0_counter; - UINT16 m_timer1_counter; - UINT16 m_timer0_base; - UINT16 m_timer1_base; + uint8_t m_timer0_mode; + uint8_t m_timer1_mode; + uint16_t m_timer0_counter; + uint16_t m_timer1_counter; + uint16_t m_timer0_base; + uint16_t m_timer1_base; bool m_timer0_running; bool m_timer1_running; - UINT32 m_timer0_clock; - UINT32 m_timer1_clock; + uint32_t m_timer0_clock; + uint32_t m_timer1_clock; bool m_ramselect; devcb_read8 m_portA_r; diff --git a/src/devices/machine/nscsi_bus.cpp b/src/devices/machine/nscsi_bus.cpp index d0508059758..7edbee58253 100644 --- a/src/devices/machine/nscsi_bus.cpp +++ b/src/devices/machine/nscsi_bus.cpp @@ -5,7 +5,7 @@ const device_type NSCSI_BUS = &device_creator; const device_type NSCSI_CONNECTOR = &device_creator; -nscsi_bus_device::nscsi_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nscsi_bus_device::nscsi_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NSCSI_BUS, "NSCSI Bus", tag, owner, clock, "nscsi_bus", __FILE__), data(0), ctrl(0) { devcnt = 0; @@ -42,7 +42,7 @@ void nscsi_bus_device::regen_ctrl(int refid) "dout", "din ", "cmd ", "stat", "4 ", "5 ", "mout", "min " }; - UINT32 octrl = ctrl; + uint32_t octrl = ctrl; ctrl = 0; for(int i=0; iscsi_ctrl_changed(); } -UINT32 nscsi_bus_device::data_r() const +uint32_t nscsi_bus_device::data_r() const { return data; } -UINT32 nscsi_bus_device::ctrl_r() const +uint32_t nscsi_bus_device::ctrl_r() const { return ctrl; } -void nscsi_bus_device::ctrl_w(int refid, UINT32 lines, UINT32 mask) +void nscsi_bus_device::ctrl_w(int refid, uint32_t lines, uint32_t mask) { - UINT32 c = dev[refid].ctrl; + uint32_t c = dev[refid].ctrl; dev[refid].ctrl = (c & ~mask) | (lines & mask); regen_ctrl(refid); } -void nscsi_bus_device::data_w(int refid, UINT32 lines) +void nscsi_bus_device::data_w(int refid, uint32_t lines) { dev[refid].data = lines; regen_data(); } -void nscsi_bus_device::ctrl_wait(int refid, UINT32 lines, UINT32 mask) +void nscsi_bus_device::ctrl_wait(int refid, uint32_t lines, uint32_t mask) { - UINT32 w = dev[refid].wait_ctrl; + uint32_t w = dev[refid].wait_ctrl; dev[refid].wait_ctrl = (w & ~mask) | (lines & mask); } @@ -132,7 +132,7 @@ void nscsi_bus_device::device_config_complete() } -nscsi_connector::nscsi_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nscsi_connector::nscsi_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NSCSI_CONNECTOR, "NSCSI Connector Abstraction", tag, owner, clock, "nscsi_connector", __FILE__), device_slot_interface(mconfig, *this) { @@ -151,7 +151,7 @@ nscsi_device *nscsi_connector::get_device() return dynamic_cast(get_card_device()); } -nscsi_device::nscsi_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) : +nscsi_device::nscsi_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_slot_card_interface(mconfig, *this) { @@ -175,7 +175,7 @@ void nscsi_device::device_start() save_item(NAME(scsi_id)); } -nscsi_full_device::nscsi_full_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) : +nscsi_full_device::nscsi_full_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) : nscsi_device(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -262,8 +262,8 @@ void nscsi_full_device::scsi_ctrl_changed() void nscsi_full_device::step(bool timeout) { - UINT32 ctrl = scsi_bus->ctrl_r(); - UINT32 data = scsi_bus->data_r(); + uint32_t ctrl = scsi_bus->ctrl_r(); + uint32_t data = scsi_bus->data_r(); if(ctrl & S_RST) { scsi_bus->data_w(scsi_refid, 0); scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); @@ -451,7 +451,7 @@ void nscsi_full_device::target_recv_byte() step(false); } -void nscsi_full_device::target_send_byte(UINT8 val) +void nscsi_full_device::target_send_byte(uint8_t val) { scsi_bus->ctrl_wait(scsi_refid, S_ACK, S_ACK); scsi_state = (scsi_state & STATE_MASK) | (SEND_BYTE_T_WAIT_ACK_1 << SUB_SHIFT); @@ -460,7 +460,7 @@ void nscsi_full_device::target_send_byte(UINT8 val) step(false); } -UINT8 nscsi_full_device::scsi_get_data(int id, int pos) +uint8_t nscsi_full_device::scsi_get_data(int id, int pos) { switch(id) { case SBUF_MAIN: @@ -472,7 +472,7 @@ UINT8 nscsi_full_device::scsi_get_data(int id, int pos) } } -void nscsi_full_device::scsi_put_data(int id, int pos, UINT8 data) +void nscsi_full_device::scsi_put_data(int id, int pos, uint8_t data) { switch(id) { case SBUF_MAIN: @@ -495,7 +495,7 @@ bool nscsi_full_device::command_done() { if(!data_buffer_pos) return false; - UINT8 h = scsi_cmdbuf[0]; + uint8_t h = scsi_cmdbuf[0]; switch(h >> 5) { case 0: return data_buffer_pos == 6; case 1: return data_buffer_pos == 10; @@ -531,7 +531,7 @@ nscsi_full_device::control *nscsi_full_device::buf_control_pop() return c; } -void nscsi_full_device::scsi_status_complete(UINT8 st) +void nscsi_full_device::scsi_status_complete(uint8_t st) { control *c; c = buf_control_push(); @@ -562,7 +562,7 @@ void nscsi_full_device::scsi_data_out(int buf, int size) c->param2 = size; } -void nscsi_full_device::sense(bool deferred, UINT8 key) +void nscsi_full_device::sense(bool deferred, uint8_t key) { memset(scsi_sense_buffer, 0, sizeof(scsi_sense_buffer)); scsi_sense_buffer[0] = deferred ? 0x71 : 0x70; diff --git a/src/devices/machine/nscsi_bus.h b/src/devices/machine/nscsi_bus.h index c0b35af248e..1bd967568c8 100644 --- a/src/devices/machine/nscsi_bus.h +++ b/src/devices/machine/nscsi_bus.h @@ -17,14 +17,14 @@ class nscsi_device; class nscsi_bus_device : public device_t { public: - nscsi_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nscsi_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void ctrl_w(int refid, UINT32 lines, UINT32 mask); - void data_w(int refid, UINT32 lines); - void ctrl_wait(int refid, UINT32 lines, UINT32 mask); + void ctrl_w(int refid, uint32_t lines, uint32_t mask); + void data_w(int refid, uint32_t lines); + void ctrl_wait(int refid, uint32_t lines, uint32_t mask); - UINT32 ctrl_r() const; - UINT32 data_r() const; + uint32_t ctrl_r() const; + uint32_t data_r() const; protected: virtual void device_start() override; @@ -34,14 +34,14 @@ protected: private: struct dev_t { nscsi_device *dev; - UINT32 ctrl, wait_ctrl; - UINT32 data; + uint32_t ctrl, wait_ctrl; + uint32_t data; }; dev_t dev[16]; int devcnt; - UINT32 data, ctrl; + uint32_t data, ctrl; void regen_data(); void regen_ctrl(int refid); @@ -51,7 +51,7 @@ class nscsi_connector: public device_t, public device_slot_interface { public: - nscsi_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nscsi_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~nscsi_connector(); nscsi_device *get_device(); @@ -86,7 +86,7 @@ public: S_PHASE_MASK = S_MSG|S_CTL|S_INP }; - nscsi_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); + nscsi_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); void connect_to_bus(nscsi_bus_device *bus, int refid, int default_scsi_id); virtual void scsi_ctrl_changed(); @@ -101,7 +101,7 @@ protected: class nscsi_full_device : public nscsi_device { public: - nscsi_full_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); + nscsi_full_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 scsi_ctrl_changed() override; protected: @@ -272,9 +272,9 @@ protected: SBUF_SENSE }; - UINT8 scsi_cmdbuf[4096], scsi_sense_buffer[8]; + uint8_t scsi_cmdbuf[4096], scsi_sense_buffer[8]; int scsi_cmdsize; - UINT8 scsi_identify; + uint8_t scsi_identify; virtual void device_start() override; virtual void device_reset() override; @@ -284,16 +284,16 @@ protected: virtual void scsi_command(); void scsi_unknown_command(); - void scsi_status_complete(UINT8 st); + void scsi_status_complete(uint8_t st); void scsi_data_in(int buf, int size); void scsi_data_out(int buf, int size); - void sense(bool deferred, UINT8 key); + void sense(bool deferred, uint8_t key); int get_lun(int def = 0); void bad_lun(); - virtual UINT8 scsi_get_data(int buf, int offset); - virtual void scsi_put_data(int buf, int offset, UINT8 data); + virtual uint8_t scsi_get_data(int buf, int offset); + virtual void scsi_put_data(int buf, int offset, uint8_t data); // Default delays: @@ -416,7 +416,7 @@ private: void step(bool timeout); void target_recv_byte(); - void target_send_byte(UINT8 val); + void target_send_byte(uint8_t val); void target_send_buffer_byte(); bool command_done(); }; diff --git a/src/devices/machine/nscsi_cb.cpp b/src/devices/machine/nscsi_cb.cpp index 94950098f6a..23c71d45bff 100644 --- a/src/devices/machine/nscsi_cb.cpp +++ b/src/devices/machine/nscsi_cb.cpp @@ -4,7 +4,7 @@ const device_type NSCSI_CB = &device_creator; -nscsi_callback_device::nscsi_callback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nscsi_callback_device::nscsi_callback_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nscsi_device(mconfig, NSCSI_CB, "SCSI callback (new)", tag, owner, clock, "nscsi_cb", __FILE__), m_write_rst(*this), m_write_atn(*this), diff --git a/src/devices/machine/nscsi_cb.h b/src/devices/machine/nscsi_cb.h index 547f288842b..4fab2021fe1 100644 --- a/src/devices/machine/nscsi_cb.h +++ b/src/devices/machine/nscsi_cb.h @@ -36,7 +36,7 @@ class nscsi_callback_device : public nscsi_device { public: - nscsi_callback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nscsi_callback_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_rst_callback(_line line) { m_write_rst.set_callback(line); } template void set_atn_callback(_line line) { m_write_atn.set_callback(line); } @@ -50,9 +50,9 @@ public: virtual void scsi_ctrl_changed() override; - UINT8 read() { return scsi_bus->data_r(); } + uint8_t read() { return scsi_bus->data_r(); } DECLARE_READ8_MEMBER( read ) { return read(); } - void write(UINT8 data) { scsi_bus->data_w(scsi_refid, data); } + void write(uint8_t data) { scsi_bus->data_w(scsi_refid, data); } DECLARE_WRITE8_MEMBER( write ) { write(data); } DECLARE_READ_LINE_MEMBER( rst_r ) { return (m_ctrl & S_RST) ? 1 : 0; } @@ -89,7 +89,7 @@ protected: devcb_write_line m_write_sel; devcb_write_line m_write_bsy; - UINT32 m_ctrl; + uint32_t m_ctrl; }; extern const device_type NSCSI_CB; diff --git a/src/devices/machine/nscsi_cd.cpp b/src/devices/machine/nscsi_cd.cpp index 2cc3dc48ae5..35e21a91ebf 100644 --- a/src/devices/machine/nscsi_cd.cpp +++ b/src/devices/machine/nscsi_cd.cpp @@ -5,7 +5,7 @@ const device_type NSCSI_CDROM = &device_creator; -nscsi_cdrom_device::nscsi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nscsi_cdrom_device::nscsi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nscsi_full_device(mconfig, NSCSI_CDROM, "SCSI CDROM", tag, owner, clock, "scsi_cdrom", __FILE__), cdrom(nullptr), bytes_per_sector(0), lba(0), cur_lba(0), blocks(0) { } @@ -40,7 +40,7 @@ machine_config_constructor nscsi_cdrom_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME(scsi_cdrom); } -UINT8 nscsi_cdrom_device::scsi_get_data(int id, int pos) +uint8_t nscsi_cdrom_device::scsi_get_data(int id, int pos) { if(id != 2) return nscsi_full_device::scsi_get_data(id, pos); @@ -136,7 +136,7 @@ void nscsi_cdrom_device::scsi_command() logerror("%s: command READ CAPACITY\n", tag()); - UINT32 temp = cdrom_get_track_start(cdrom, 0xaa); + uint32_t temp = cdrom_get_track_start(cdrom, 0xaa); temp--; // return the last used block on the disc scsi_cmdbuf[0] = (temp>>24) & 0xff; @@ -185,7 +185,7 @@ void nscsi_cdrom_device::scsi_command() scsi_cmdbuf[pos++] = 0x00; // medium type scsi_cmdbuf[pos++] = 0x80; // WP, cache - UINT32 temp = cdrom_get_track_start(cdrom, 0xaa); + uint32_t temp = cdrom_get_track_start(cdrom, 0xaa); temp--; // return the last used block on the disc scsi_cmdbuf[pos++] = 0x08; // Block descriptor length diff --git a/src/devices/machine/nscsi_cd.h b/src/devices/machine/nscsi_cd.h index a251d1a3e98..1299d9bfd8b 100644 --- a/src/devices/machine/nscsi_cd.h +++ b/src/devices/machine/nscsi_cd.h @@ -9,7 +9,7 @@ class nscsi_cdrom_device : public nscsi_full_device { public: - nscsi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nscsi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; protected: @@ -17,10 +17,10 @@ protected: virtual void device_reset() override; virtual void scsi_command() override; - virtual UINT8 scsi_get_data(int id, int pos) override; + virtual uint8_t scsi_get_data(int id, int pos) override; private: - UINT8 block[2048]; + uint8_t block[2048]; cdrom_file *cdrom; int bytes_per_sector; int lba, cur_lba, blocks; diff --git a/src/devices/machine/nscsi_hd.cpp b/src/devices/machine/nscsi_hd.cpp index d7d3ccb5e5b..a2179e34a77 100644 --- a/src/devices/machine/nscsi_hd.cpp +++ b/src/devices/machine/nscsi_hd.cpp @@ -5,12 +5,12 @@ const device_type NSCSI_HARDDISK = &device_creator; -nscsi_harddisk_device::nscsi_harddisk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nscsi_harddisk_device::nscsi_harddisk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nscsi_full_device(mconfig, NSCSI_HARDDISK, "SCSI HARDDISK", tag, owner, clock, "scsi_harddisk", __FILE__), harddisk(nullptr), lba(0), cur_lba(0), blocks(0), bytes_per_sector(0) { } -nscsi_harddisk_device::nscsi_harddisk_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) : +nscsi_harddisk_device::nscsi_harddisk_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) : nscsi_full_device(mconfig, type, name, tag, owner, clock, shortname, source), harddisk(nullptr), lba(0), cur_lba(0), blocks(0), bytes_per_sector(0) { } @@ -50,7 +50,7 @@ machine_config_constructor nscsi_harddisk_device::device_mconfig_additions() con return MACHINE_CONFIG_NAME(scsi_harddisk); } -UINT8 nscsi_harddisk_device::scsi_get_data(int id, int pos) +uint8_t nscsi_harddisk_device::scsi_get_data(int id, int pos) { if(id != 2) return nscsi_full_device::scsi_get_data(id, pos); @@ -65,7 +65,7 @@ UINT8 nscsi_harddisk_device::scsi_get_data(int id, int pos) return block[pos % bytes_per_sector]; } -void nscsi_harddisk_device::scsi_put_data(int id, int pos, UINT8 data) +void nscsi_harddisk_device::scsi_put_data(int id, int pos, uint8_t data) { if(id != 2) { nscsi_full_device::scsi_put_data(id, pos, data); @@ -194,7 +194,7 @@ void nscsi_harddisk_device::scsi_command() scsi_cmdbuf[pos++] = 0x00; // WP, cache hard_disk_info *info = hard_disk_get_info(harddisk); - UINT32 dsize = info->cylinders * info->heads * info->sectors - 1; + uint32_t dsize = info->cylinders * info->heads * info->sectors - 1; scsi_cmdbuf[pos++] = 0x08; // Block descriptor length scsi_cmdbuf[pos++] = 0x00; scsi_cmdbuf[pos++] = (dsize>>16) & 0xff; @@ -265,8 +265,8 @@ void nscsi_harddisk_device::scsi_command() scsi_cmdbuf[pos++] = 0x00; // RPL scsi_cmdbuf[pos++] = 0x00; // Rotational offset scsi_cmdbuf[pos++] = 0x00; // Reserved - scsi_cmdbuf[pos++] = UINT8(10000 >> 8); // Medium rotation rate - scsi_cmdbuf[pos++] = UINT8(10000); // Medium rotation rate + scsi_cmdbuf[pos++] = uint8_t(10000 >> 8); // Medium rotation rate + scsi_cmdbuf[pos++] = uint8_t(10000); // Medium rotation rate scsi_cmdbuf[pos++] = 0x00; // Reserved scsi_cmdbuf[pos++] = 0x00; // Reserved break; @@ -323,7 +323,7 @@ void nscsi_harddisk_device::scsi_command() logerror("%s: command READ CAPACITY\n", tag()); hard_disk_info *info = hard_disk_get_info(harddisk); - UINT32 size = info->cylinders * info->heads * info->sectors - 1; + uint32_t size = info->cylinders * info->heads * info->sectors - 1; scsi_cmdbuf[0] = (size>>24) & 0xff; scsi_cmdbuf[1] = (size>>16) & 0xff; diff --git a/src/devices/machine/nscsi_hd.h b/src/devices/machine/nscsi_hd.h index 2206b3e3a73..873f3b80c64 100644 --- a/src/devices/machine/nscsi_hd.h +++ b/src/devices/machine/nscsi_hd.h @@ -9,8 +9,8 @@ class nscsi_harddisk_device : public nscsi_full_device { public: - nscsi_harddisk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nscsi_harddisk_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); + nscsi_harddisk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nscsi_harddisk_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 machine_config_constructor device_mconfig_additions() const override; @@ -19,10 +19,10 @@ protected: virtual void device_reset() override; virtual void scsi_command() override; - virtual UINT8 scsi_get_data(int id, int pos) override; - virtual void scsi_put_data(int buf, int offset, UINT8 data) override; + virtual uint8_t scsi_get_data(int id, int pos) override; + virtual void scsi_put_data(int buf, int offset, uint8_t data) override; - UINT8 block[512]; + uint8_t block[512]; hard_disk_file *harddisk; int lba, cur_lba, blocks; int bytes_per_sector; diff --git a/src/devices/machine/nscsi_s1410.cpp b/src/devices/machine/nscsi_s1410.cpp index f1725329d9d..4f54f1c0b4a 100644 --- a/src/devices/machine/nscsi_s1410.cpp +++ b/src/devices/machine/nscsi_s1410.cpp @@ -4,7 +4,7 @@ const device_type NSCSI_S1410 = &device_creator; -nscsi_s1410_device::nscsi_s1410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +nscsi_s1410_device::nscsi_s1410_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nscsi_harddisk_device(mconfig, NSCSI_S1410, "S1410", tag, owner, clock, "scsi_s1410", __FILE__) { } @@ -60,7 +60,7 @@ void nscsi_s1410_device::scsi_command() blocks = (bytes_per_sector == 256) ? 32 : 17; int track_length = blocks*bytes_per_sector; - std::vector data(track_length); + std::vector data(track_length); memset(&data[0], 0xc6, track_length); if(!hard_disk_write(harddisk, lba, &data[0])) { @@ -120,7 +120,7 @@ void nscsi_s1410_device::scsi_command() } } -UINT8 nscsi_s1410_device::scsi_get_data(int id, int pos) +uint8_t nscsi_s1410_device::scsi_get_data(int id, int pos) { switch(scsi_cmdbuf[0]) { case SC_READ_SECTOR_BUFFER: @@ -131,7 +131,7 @@ UINT8 nscsi_s1410_device::scsi_get_data(int id, int pos) } } -void nscsi_s1410_device::scsi_put_data(int id, int pos, UINT8 data) +void nscsi_s1410_device::scsi_put_data(int id, int pos, uint8_t data) { switch(scsi_cmdbuf[0]) { case SC_FORMAT_ALT_TRACK: diff --git a/src/devices/machine/nscsi_s1410.h b/src/devices/machine/nscsi_s1410.h index 446cf18568d..52cb014e7dd 100644 --- a/src/devices/machine/nscsi_s1410.h +++ b/src/devices/machine/nscsi_s1410.h @@ -9,7 +9,7 @@ class nscsi_s1410_device : public nscsi_harddisk_device { public: - nscsi_s1410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nscsi_s1410_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // SCSI status returns @@ -65,10 +65,10 @@ protected: virtual void device_reset() override; virtual void scsi_command() override; - virtual UINT8 scsi_get_data(int id, int pos) override; - virtual void scsi_put_data(int buf, int offset, UINT8 data) override; + virtual uint8_t scsi_get_data(int id, int pos) override; + virtual void scsi_put_data(int buf, int offset, uint8_t data) override; - UINT8 params[8]; + uint8_t params[8]; }; extern const device_type NSCSI_S1410; diff --git a/src/devices/machine/nvram.cpp b/src/devices/machine/nvram.cpp index 3a88345eab3..b265bad4831 100644 --- a/src/devices/machine/nvram.cpp +++ b/src/devices/machine/nvram.cpp @@ -22,7 +22,7 @@ const device_type NVRAM = &device_creator; // nvram_device - constructor //------------------------------------------------- -nvram_device::nvram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nvram_device::nvram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NVRAM, "NVRAM", tag, owner, clock, "nvram", __FILE__), device_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -103,7 +103,7 @@ void nvram_device::nvram_default() // random values case DEFAULT_RANDOM: { - UINT8 *nvram = reinterpret_cast(m_base); + uint8_t *nvram = reinterpret_cast(m_base); for (int index = 0; index < m_length; index++) nvram[index] = machine().rand(); break; diff --git a/src/devices/machine/nvram.h b/src/devices/machine/nvram.h index 1d509882cf0..30ee2d9088a 100644 --- a/src/devices/machine/nvram.h +++ b/src/devices/machine/nvram.h @@ -77,7 +77,7 @@ public: }; // construction/destruction - nvram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nvram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_default_value(device_t &device, default_value value); diff --git a/src/devices/machine/pc_fdc.cpp b/src/devices/machine/pc_fdc.cpp index d72db5a0c45..9806abf6903 100644 --- a/src/devices/machine/pc_fdc.cpp +++ b/src/devices/machine/pc_fdc.cpp @@ -45,7 +45,7 @@ DEVICE_ADDRESS_MAP_START(map, 8, pc_fdc_at_device) AM_RANGE(0x7, 0x7) AM_READWRITE(dir_r, ccr_w) ADDRESS_MAP_END -pc_fdc_family_device::pc_fdc_family_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) : +pc_fdc_family_device::pc_fdc_family_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) : pc_fdc_interface(mconfig, type, name, tag, owner, clock, shortname, source), fdc(*this, "upd765"), intrq_cb(*this), drq_cb(*this) @@ -57,12 +57,12 @@ void pc_fdc_family_device::tc_w(bool state) fdc->tc_w(state); } -UINT8 pc_fdc_family_device::dma_r() +uint8_t pc_fdc_family_device::dma_r() { return fdc->dma_r(); } -void pc_fdc_family_device::dma_w(UINT8 data) +void pc_fdc_family_device::dma_w(uint8_t data) { fdc->dma_w(data); } @@ -104,7 +104,7 @@ void pc_fdc_family_device::device_reset() WRITE8_MEMBER( pc_fdc_family_device::dor_w ) { logerror("%s: dor = %02x\n", tag(), data); - UINT8 pdor = dor; + uint8_t pdor = dor; dor = data; for(int i=0; i<4; i++) @@ -140,7 +140,7 @@ WRITE8_MEMBER( pc_fdc_family_device::ccr_w ) fdc->set_rate(rates[data & 3]); } -UINT8 pc_fdc_family_device::do_dir_r() +uint8_t pc_fdc_family_device::do_dir_r() { if(floppy[dor & 3]) return floppy[dor & 3]->dskchg_r() ? 0x00 : 0x80; @@ -183,10 +183,10 @@ void pc_fdc_family_device::check_drq() drq_cb(drq); } -pc_fdc_xt_device::pc_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : pc_fdc_family_device(mconfig, PC_FDC_XT, "PC FDC XT", tag, owner, clock, "pc_fdc_xt", __FILE__) +pc_fdc_xt_device::pc_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pc_fdc_family_device(mconfig, PC_FDC_XT, "PC FDC XT", tag, owner, clock, "pc_fdc_xt", __FILE__) { } -pc_fdc_at_device::pc_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : pc_fdc_family_device(mconfig, PC_FDC_AT, "PC FDC AT", tag, owner, clock, "pc_fdc_at", __FILE__) +pc_fdc_at_device::pc_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pc_fdc_family_device(mconfig, PC_FDC_AT, "PC FDC AT", tag, owner, clock, "pc_fdc_at", __FILE__) { } diff --git a/src/devices/machine/pc_fdc.h b/src/devices/machine/pc_fdc.h index b94fab2a2ca..61785cda61a 100644 --- a/src/devices/machine/pc_fdc.h +++ b/src/devices/machine/pc_fdc.h @@ -26,7 +26,7 @@ class pc_fdc_family_device : public pc_fdc_interface { public: - pc_fdc_family_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); + pc_fdc_family_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_intrq_wr_callback(device_t &device, _Object object) { return downcast(device).intrq_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); } @@ -36,9 +36,9 @@ public: virtual DECLARE_ADDRESS_MAP(map, 8) override; virtual void tc_w(bool state) override; - virtual UINT8 dma_r() override; - virtual void dma_w(UINT8 data) override; - virtual UINT8 do_dir_r() override; + virtual uint8_t dma_r() override; + virtual void dma_w(uint8_t data) override; + virtual uint8_t do_dir_r() override; READ8_MEMBER(dor_r); WRITE8_MEMBER(dor_w); @@ -54,7 +54,7 @@ protected: bool irq, drq, fdc_drq, fdc_irq; devcb_write_line intrq_cb, drq_cb; - UINT8 dor; + uint8_t dor; floppy_image_device *floppy[4]; @@ -64,7 +64,7 @@ protected: class pc_fdc_xt_device : public pc_fdc_family_device { public: - pc_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_fdc_xt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; WRITE8_MEMBER(dor_fifo_w); @@ -72,7 +72,7 @@ public: class pc_fdc_at_device : public pc_fdc_family_device { public: - pc_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_fdc_at_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; diff --git a/src/devices/machine/pc_lpt.cpp b/src/devices/machine/pc_lpt.cpp index f483c7bb336..93652755d84 100644 --- a/src/devices/machine/pc_lpt.cpp +++ b/src/devices/machine/pc_lpt.cpp @@ -12,7 +12,7 @@ const device_type PC_LPT = &device_creator; -pc_lpt_device::pc_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pc_lpt_device::pc_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_LPT, "PC-LPT", tag, owner, clock, "pc_lpt", __FILE__), m_irq(1), m_data(0xff), m_control(0), diff --git a/src/devices/machine/pc_lpt.h b/src/devices/machine/pc_lpt.h index ca2a71f6524..3cf812276d9 100644 --- a/src/devices/machine/pc_lpt.h +++ b/src/devices/machine/pc_lpt.h @@ -21,7 +21,7 @@ class pc_lpt_device : public device_t { public: - pc_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_lpt_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); } @@ -69,8 +69,8 @@ private: // internal state int m_irq; - UINT8 m_data; - UINT8 m_control; + uint8_t m_data; + uint8_t m_control; int m_irq_enabled; int m_centronics_ack; diff --git a/src/devices/machine/pccard.cpp b/src/devices/machine/pccard.cpp index 3284c2c5d45..a937fe64739 100644 --- a/src/devices/machine/pccard.cpp +++ b/src/devices/machine/pccard.cpp @@ -22,7 +22,7 @@ WRITE16_MEMBER( pccard_interface::write_reg ) const device_type PCCARD_SLOT = &device_creator; -pccard_slot_device::pccard_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pccard_slot_device::pccard_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCCARD_SLOT, "PCCARD SLOT", tag, owner, clock, "pccard", __FILE__), device_slot_interface(mconfig, *this), m_pccard(nullptr) diff --git a/src/devices/machine/pccard.h b/src/devices/machine/pccard.h index 2068406d4b2..28f7da2f38d 100644 --- a/src/devices/machine/pccard.h +++ b/src/devices/machine/pccard.h @@ -24,7 +24,7 @@ class pccard_slot_device : public device_t, public device_slot_interface { public: - pccard_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pccard_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ_LINE_MEMBER(read_line_inserted); DECLARE_READ16_MEMBER(read_memory); diff --git a/src/devices/machine/pcf8593.cpp b/src/devices/machine/pcf8593.cpp index 48e002fdf2d..4620bbdf6cf 100644 --- a/src/devices/machine/pcf8593.cpp +++ b/src/devices/machine/pcf8593.cpp @@ -46,7 +46,7 @@ const device_type PCF8593 = &device_creator; // pcf8593_device - constructor //------------------------------------------------- -pcf8593_device::pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pcf8593_device::pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCF8593, "PCF8593 RTC", tag, owner, clock, "pcf8593", __FILE__), device_rtc_interface(mconfig, *this), device_nvram_interface(mconfig, *this) @@ -185,7 +185,7 @@ WRITE_LINE_MEMBER(pcf8593_device::scl_w) // A2 + xx + .. = write byte if ((m_data_recv[0] == 0xA2) && (m_data_recv_index >= 2)) { - UINT8 rtc_pos, rtc_val; + uint8_t rtc_pos, rtc_val; rtc_pos = m_data_recv[1] + (m_data_recv_index - 2); rtc_val = m_data_recv[m_data_recv_index]; //if (rtc_pos == 0) rtc_val = rtc_val & 3; // what is this doing here? diff --git a/src/devices/machine/pcf8593.h b/src/devices/machine/pcf8593.h index b2b09f9ebd0..9d3d9ce4ed7 100644 --- a/src/devices/machine/pcf8593.h +++ b/src/devices/machine/pcf8593.h @@ -33,7 +33,7 @@ class pcf8593_device : public device_t, public device_nvram_interface { public: - pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER(scl_w); DECLARE_WRITE_LINE_MEMBER(sda_w); @@ -60,16 +60,16 @@ private: static const device_timer_id TIMER_UPDATE_COUNTER = 0; // internal state - UINT8 m_data[16]; + uint8_t m_data[16]; int m_pin_scl; int m_pin_sda; int m_inp; int m_active; int m_bits; - UINT8 m_data_recv_index; - UINT8 m_data_recv[50]; - UINT8 m_mode; - UINT8 m_pos; + uint8_t m_data_recv_index; + uint8_t m_data_recv[50]; + uint8_t m_mode; + uint8_t m_pos; emu_timer * m_timer; enum { RTC_MODE_NONE, RTC_MODE_SEND, RTC_MODE_RECV }; }; diff --git a/src/devices/machine/pci-apic.cpp b/src/devices/machine/pci-apic.cpp index ce32692c7e6..b0fc3885c7f 100644 --- a/src/devices/machine/pci-apic.cpp +++ b/src/devices/machine/pci-apic.cpp @@ -4,7 +4,7 @@ const device_type APIC = &device_creator; -apic_device::apic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apic_device::apic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, APIC, "I/O Advanced Programmable Interrupt Controller", tag, owner, clock, "apic", __FILE__) { } diff --git a/src/devices/machine/pci-apic.h b/src/devices/machine/pci-apic.h index 4da0dc00bd3..8fffd1deb85 100644 --- a/src/devices/machine/pci-apic.h +++ b/src/devices/machine/pci-apic.h @@ -10,7 +10,7 @@ class apic_device : public pci_device { public: - apic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/machine/pci-ide.cpp b/src/devices/machine/pci-ide.cpp index 0f3f6f8cbb6..ab49e816c2c 100644 --- a/src/devices/machine/pci-ide.cpp +++ b/src/devices/machine/pci-ide.cpp @@ -4,7 +4,7 @@ const device_type IDE_PCI = &device_creator; -ide_pci_device::ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ide_pci_device::ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, IDE_PCI, "IDE PCI interface", tag, owner, clock, "ide_pci", __FILE__), m_ide(*this, "ide"), m_ide2(*this, "ide2"), @@ -94,7 +94,7 @@ void ide_pci_device::device_reset() READ32_MEMBER(ide_pci_device::ide_read_cs1) { // PCI offset starts at 0x3f4, idectrl expects 0x3f0 - UINT32 data = 0; + uint32_t data = 0; data = m_ide->read_cs1(space, ++offset, mem_mask); if (0) logerror("%s:ide_read_cs1 offset=%08X data=%08X mask=%08X\n", machine().describe_context(), offset, data, mem_mask); @@ -110,7 +110,7 @@ WRITE32_MEMBER(ide_pci_device::ide_write_cs1) READ32_MEMBER(ide_pci_device::ide2_read_cs1) { // PCI offset starts at 0x374, idectrl expects 0x370 - UINT32 data = 0; + uint32_t data = 0; data = m_ide2->read_cs1(space, ++offset, mem_mask); return data; } diff --git a/src/devices/machine/pci-ide.h b/src/devices/machine/pci-ide.h index e432f785d79..2d37ebef990 100644 --- a/src/devices/machine/pci-ide.h +++ b/src/devices/machine/pci-ide.h @@ -29,7 +29,7 @@ TODO: class ide_pci_device : public pci_device { public: - ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_ide; required_device m_ide2; virtual DECLARE_ADDRESS_MAP(config_map, 32) override; @@ -54,7 +54,7 @@ private: int m_irq_num; devcb_write_line m_irq_handler; - UINT32 m_config_data[0x10]; + uint32_t m_config_data[0x10]; DECLARE_ADDRESS_MAP(chan1_data_command_map, 32); DECLARE_ADDRESS_MAP(chan1_control_map, 32); DECLARE_ADDRESS_MAP(chan2_data_command_map, 32); diff --git a/src/devices/machine/pci-sata.cpp b/src/devices/machine/pci-sata.cpp index 65cc090848b..f8fdaf56db7 100644 --- a/src/devices/machine/pci-sata.cpp +++ b/src/devices/machine/pci-sata.cpp @@ -4,7 +4,7 @@ const device_type SATA = &device_creator; -sata_device::sata_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sata_device::sata_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, SATA, "SATA AHCI interface", tag, owner, clock, "sata", __FILE__) { } diff --git a/src/devices/machine/pci-sata.h b/src/devices/machine/pci-sata.h index 7075b49bb58..19dd69e95b3 100644 --- a/src/devices/machine/pci-sata.h +++ b/src/devices/machine/pci-sata.h @@ -10,7 +10,7 @@ class sata_device : public pci_device { public: - sata_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sata_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/machine/pci-smbus.cpp b/src/devices/machine/pci-smbus.cpp index 13d4d491570..fc6d589b64e 100644 --- a/src/devices/machine/pci-smbus.cpp +++ b/src/devices/machine/pci-smbus.cpp @@ -26,7 +26,7 @@ DEVICE_ADDRESS_MAP_START(map, 32, smbus_device) AM_RANGE(0x14, 0x17) AM_READ8 (notify_dhigh_r, 0xff000000) ADDRESS_MAP_END -smbus_device::smbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +smbus_device::smbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, SMBUS, "SMBUS interface", tag, owner, clock, "smbus", __FILE__) { } @@ -86,7 +86,7 @@ WRITE8_MEMBER (smbus_device::hst_cnt_w) if(xmit_slva != 0xa1) hst_sts = 4; else { - const UINT8 eeprom[256] = { + const uint8_t eeprom[256] = { 0x80, 0x08, 0x07, 0x0D, 0x0A, 0x02, 0x40, 0x00, 0x04, 0x50, 0x60, 0x00, 0x82, 0x08, 0x00, 0x01, 0x0E, 0x04, 0x08, 0x01, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x28, 0x3C, 0x28, 0x40, 0x60, 0x60, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x46, 0x28, 0x28, 0x55, 0x00, 0x00, diff --git a/src/devices/machine/pci-smbus.h b/src/devices/machine/pci-smbus.h index 2ff96befc9b..6dac1d711a2 100644 --- a/src/devices/machine/pci-smbus.h +++ b/src/devices/machine/pci-smbus.h @@ -10,7 +10,7 @@ class smbus_device : public pci_device { public: - smbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + smbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER (hst_sts_r); DECLARE_WRITE8_MEMBER (hst_sts_w); @@ -55,11 +55,11 @@ protected: private: DECLARE_ADDRESS_MAP(map, 32); - UINT16 slv_data; + uint16_t slv_data; - UINT8 hst_sts, hst_cnt, hst_cmd, xmit_slva, hst_d0, hst_d1; - UINT8 host_block_db, pec, rcv_slva, aux_sts, aux_ctl; - UINT8 smlink_pin_ctl, smbus_pin_ctl, slv_sts, slv_cmd, notify_daddr, notify_dlow, notify_dhigh; + uint8_t hst_sts, hst_cnt, hst_cmd, xmit_slva, hst_d0, hst_d1; + uint8_t host_block_db, pec, rcv_slva, aux_sts, aux_ctl; + uint8_t smlink_pin_ctl, smbus_pin_ctl, slv_sts, slv_cmd, notify_daddr, notify_dlow, notify_dhigh; }; extern const device_type SMBUS; diff --git a/src/devices/machine/pci-usb.cpp b/src/devices/machine/pci-usb.cpp index 56789e12eb3..8772d6d7555 100644 --- a/src/devices/machine/pci-usb.cpp +++ b/src/devices/machine/pci-usb.cpp @@ -8,7 +8,7 @@ const device_type USB_EHCI = &device_creator; DEVICE_ADDRESS_MAP_START(map, 32, usb_uhci_device) ADDRESS_MAP_END -usb_uhci_device::usb_uhci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +usb_uhci_device::usb_uhci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, USB_UHCI, "USB 1.1 UHCI interface", tag, owner, clock, "usb_uhci", __FILE__) { } @@ -27,7 +27,7 @@ void usb_uhci_device::device_reset() DEVICE_ADDRESS_MAP_START(map, 32, usb_ehci_device) ADDRESS_MAP_END -usb_ehci_device::usb_ehci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +usb_ehci_device::usb_ehci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, USB_EHCI, "USB 2.0 EHCI interface", tag, owner, clock, "usb_ehci", __FILE__) { } diff --git a/src/devices/machine/pci-usb.h b/src/devices/machine/pci-usb.h index 31541432efd..49b94200bb8 100644 --- a/src/devices/machine/pci-usb.h +++ b/src/devices/machine/pci-usb.h @@ -13,7 +13,7 @@ class usb_uhci_device : public pci_device { public: - usb_uhci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + usb_uhci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -25,7 +25,7 @@ private: class usb_ehci_device : public pci_device { public: - usb_ehci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + usb_ehci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/machine/pci.cpp b/src/devices/machine/pci.cpp index 88cdd21ab64..f5e4197b0b9 100644 --- a/src/devices/machine/pci.cpp +++ b/src/devices/machine/pci.cpp @@ -58,7 +58,7 @@ DEVICE_ADDRESS_MAP_START(config_map, 32, pci_bridge_device) AM_RANGE(0x3c, 0x3f) AM_READWRITE16(bridge_control_r, bridge_control_w, 0xffff0000) ADDRESS_MAP_END -pci_device::pci_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) +pci_device::pci_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_region(*this, DEVICE_SELF) { @@ -69,7 +69,7 @@ pci_device::pci_device(const machine_config &mconfig, device_type type, const ch is_multifunction_device = false; } -void pci_device::set_ids(UINT32 _main_id, UINT8 _revision, UINT32 _pclass, UINT32 _subsystem_id) +void pci_device::set_ids(uint32_t _main_id, uint8_t _revision, uint32_t _pclass, uint32_t _subsystem_id) { main_id = _main_id; revision = _revision; @@ -103,13 +103,13 @@ void pci_device::device_reset() { } -UINT32 pci_device::unmapped_r(offs_t offset, UINT32 mem_mask, int bank) +uint32_t pci_device::unmapped_r(offs_t offset, uint32_t mem_mask, int bank) { logerror("%s: unmapped read from %08x & %08x (%s)\n", machine().describe_context(), offset*4, mem_mask, bank_infos[bank].map.name()); return 0; } -void pci_device::unmapped_w(offs_t offset, UINT32 data, UINT32 mem_mask, int bank) +void pci_device::unmapped_w(offs_t offset, uint32_t data, uint32_t mem_mask, int bank) { logerror("%s: unmapped write to %08x = %08x & %08x (%s)\n", machine().describe_context(), offset*4, data, mem_mask, bank_infos[bank].map.name()); } @@ -148,7 +148,7 @@ WRITE32_MEMBER(pci_device::address_base_w) int bid = bank_reg_infos[offset].bank; if(bank_reg_infos[offset].hi) - bank_infos[bid].adr = (bank_infos[bid].adr & 0xffffffff) | (UINT64(data) << 32); + bank_infos[bid].adr = (bank_infos[bid].adr & 0xffffffff) | (uint64_t(data) << 32); else { bank_infos[bid].adr = (bank_infos[bid].adr & U64(0xffffffff00000000)) | data; } @@ -254,18 +254,18 @@ void pci_device::reset_all_mappings() { } -void pci_device::map_device(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 pci_device::map_device(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) { for(int i=0; iinstall_readwrite_handler(start, end, read32_delegate(FUNC(pci_device::unmapped0_r), this), write32_delegate(FUNC(pci_device::unmapped0_w), this)); break; case 1: space->install_readwrite_handler(start, end, read32_delegate(FUNC(pci_device::unmapped1_r), this), write32_delegate(FUNC(pci_device::unmapped1_w), this)); break; @@ -285,7 +285,7 @@ void pci_device::map_device(UINT64 memory_window_start, UINT64 memory_window_end } space->install_device_delegate(start, end, *this, bi.map); - logerror("map %s at %0*x-%0*x\n", bi.map.name(), bi.flags & M_IO ? 4 : 8, UINT32(start), bi.flags & M_IO ? 4 : 8, UINT32(end)); + logerror("map %s at %0*x-%0*x\n", bi.map.name(), bi.flags & M_IO ? 4 : 8, uint32_t(start), bi.flags & M_IO ? 4 : 8, uint32_t(end)); } map_extra(memory_window_start, memory_window_end, memory_offset, memory_space, @@ -293,20 +293,20 @@ void pci_device::map_device(UINT64 memory_window_start, UINT64 memory_window_end if(expansion_rom_base & 1) { logerror("map expansion rom at %08x-%08x\n", expansion_rom_base & ~1, (expansion_rom_base & ~1) + expansion_rom_size - 1); - UINT32 start = (expansion_rom_base & ~1) + memory_offset; - UINT32 end = start + expansion_rom_size - 1; + uint32_t start = (expansion_rom_base & ~1) + memory_offset; + uint32_t end = start + expansion_rom_size - 1; if(end > memory_window_end) end = memory_window_end; memory_space->install_rom(start, end, (void *)expansion_rom); } } -void pci_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 pci_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) { } -void pci_device::map_config(UINT8 device, address_space *config_space) +void pci_device::map_config(uint8_t device, address_space *config_space) { config_space->install_device(device << 12, (device << 12) | 0xfff, *this, &pci_device::config_map); } @@ -317,7 +317,7 @@ void pci_device::skip_map_regs(int count) assert(bank_reg_count <= 6); } -void pci_device::add_map(UINT64 size, int flags, address_map_delegate &map) +void pci_device::add_map(uint64_t size, int flags, address_map_delegate &map) { assert(bank_count < 6); int bid = bank_count++; @@ -344,7 +344,7 @@ void pci_device::add_map(UINT64 size, int flags, address_map_delegate &map) logerror("Device %s (%s) has 0x%x bytes of %s named %s\n", tag(), name(), size, flags & M_IO ? "io" : "memory", bank_infos[bid].map.name()); } -void pci_device::add_rom(const UINT8 *rom, UINT32 size) +void pci_device::add_rom(const uint8_t *rom, uint32_t size) { expansion_rom = rom; expansion_rom_size = size; @@ -356,13 +356,13 @@ void pci_device::add_rom_from_region() add_rom(m_region->base(), m_region->bytes()); } -void pci_device::set_map_address(int id, UINT64 adr) +void pci_device::set_map_address(int id, uint64_t adr) { bank_infos[id].adr = adr; remap_cb(); } -void pci_device::set_map_size(int id, UINT64 size) +void pci_device::set_map_size(int id, uint64_t size) { bank_infos[id].size = size; remap_cb(); @@ -374,7 +374,7 @@ void pci_device::set_map_flags(int id, int flags) remap_cb(); } -agp_device::agp_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) +agp_device::agp_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) : pci_device(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -391,14 +391,14 @@ void agp_device::device_reset() -pci_bridge_device::pci_bridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pci_bridge_device::pci_bridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, PCI_BRIDGE, "PCI-PCI Bridge", tag, owner, clock, "pci_bridge", __FILE__), device_memory_interface(mconfig, *this), configure_space_config("configuration_space", ENDIANNESS_LITTLE, 32, 20) { } -pci_bridge_device::pci_bridge_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) +pci_bridge_device::pci_bridge_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) : pci_device(mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), configure_space_config("configuration_space", ENDIANNESS_LITTLE, 32, 20) @@ -495,8 +495,8 @@ void pci_bridge_device::reset_all_mappings() iolimit = 0; } -void pci_bridge_device::map_device(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 pci_bridge_device::map_device(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) { for(int i = int(all_devices.size())-1; i>=0; i--) if(all_devices[i] != this) @@ -517,25 +517,25 @@ void pci_bridge_device::regenerate_config_mapping() sub_devices[i]->map_config(i, config_space); } -UINT32 pci_bridge_device::do_config_read(UINT8 bus, UINT8 device, UINT16 reg, UINT32 mem_mask) +uint32_t pci_bridge_device::do_config_read(uint8_t bus, uint8_t device, uint16_t reg, uint32_t mem_mask) { if(sub_devices[device]) { - UINT32 data = space(AS_PROGRAM).read_dword((device << 12) | reg, mem_mask); + uint32_t data = space(AS_PROGRAM).read_dword((device << 12) | reg, mem_mask); logerror("config_read %02x:%02x.%x:%02x %08x @ %08x\n", bus, device >> 3, device & 7, reg, data, mem_mask); return data; } else return 0xffffffff; } -UINT32 pci_bridge_device::propagate_config_read(UINT8 bus, UINT8 device, UINT16 reg, UINT32 mem_mask) +uint32_t pci_bridge_device::propagate_config_read(uint8_t bus, uint8_t device, uint16_t reg, uint32_t mem_mask) { - UINT32 data = 0xffffffff; + uint32_t data = 0xffffffff; for(unsigned int i=0; i != all_bridges.size(); i++) data &= all_bridges[i]->config_read(bus, device, reg, mem_mask); return data; } -UINT32 pci_bridge_device::config_read(UINT8 bus, UINT8 device, UINT16 reg, UINT32 mem_mask) +uint32_t pci_bridge_device::config_read(uint8_t bus, uint8_t device, uint16_t reg, uint32_t mem_mask) { if(bus == secondary_bus) return do_config_read(bus, device, reg, mem_mask); @@ -546,7 +546,7 @@ UINT32 pci_bridge_device::config_read(UINT8 bus, UINT8 device, UINT16 reg, UINT3 return 0xffffffff; } -void pci_bridge_device::do_config_write(UINT8 bus, UINT8 device, UINT16 reg, UINT32 data, UINT32 mem_mask) +void pci_bridge_device::do_config_write(uint8_t bus, uint8_t device, uint16_t reg, uint32_t data, uint32_t mem_mask) { if(sub_devices[device]) { space(AS_PROGRAM).write_dword((device << 12) | reg, data, mem_mask); @@ -554,13 +554,13 @@ void pci_bridge_device::do_config_write(UINT8 bus, UINT8 device, UINT16 reg, UIN } } -void pci_bridge_device::propagate_config_write(UINT8 bus, UINT8 device, UINT16 reg, UINT32 data, UINT32 mem_mask) +void pci_bridge_device::propagate_config_write(uint8_t bus, uint8_t device, uint16_t reg, uint32_t data, uint32_t mem_mask) { for(unsigned int i=0; i != all_bridges.size(); i++) all_bridges[i]->config_write(bus, device, reg, data, mem_mask); } -void pci_bridge_device::config_write(UINT8 bus, UINT8 device, UINT16 reg, UINT32 data, UINT32 mem_mask) +void pci_bridge_device::config_write(uint8_t bus, uint8_t device, uint16_t reg, uint32_t data, uint32_t mem_mask) { if(bus == secondary_bus) do_config_write(bus, device, reg, data, mem_mask); @@ -782,7 +782,7 @@ WRITE16_MEMBER(pci_bridge_device::bridge_control_w) } -agp_bridge_device::agp_bridge_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) +agp_bridge_device::agp_bridge_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) : pci_bridge_device(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -805,7 +805,7 @@ DEVICE_ADDRESS_MAP_START(io_configuration_access_map, 32, pci_host_device) ADDRESS_MAP_END -pci_host_device::pci_host_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) +pci_host_device::pci_host_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) : pci_bridge_device(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -867,7 +867,7 @@ WRITE32_MEMBER(pci_host_device::config_data_w) root_config_write((config_address >> 16) & 0xff, (config_address >> 8) & 0xff, config_address & 0xfc, data, mem_mask); } -UINT32 pci_host_device::root_config_read(UINT8 bus, UINT8 device, UINT16 reg, UINT32 mem_mask) +uint32_t pci_host_device::root_config_read(uint8_t bus, uint8_t device, uint16_t reg, uint32_t mem_mask) { if(bus == 0x00) return do_config_read(bus, device, reg, mem_mask); @@ -875,7 +875,7 @@ UINT32 pci_host_device::root_config_read(UINT8 bus, UINT8 device, UINT16 reg, UI return propagate_config_read(bus, device, reg, mem_mask); } -void pci_host_device::root_config_write(UINT8 bus, UINT8 device, UINT16 reg, UINT32 data, UINT32 mem_mask) +void pci_host_device::root_config_write(uint8_t bus, uint8_t device, uint16_t reg, uint32_t data, uint32_t mem_mask) { if(bus == 0x00) do_config_write(bus, device, reg, data, mem_mask); @@ -885,7 +885,7 @@ void pci_host_device::root_config_write(UINT8 bus, UINT8 device, UINT16 reg, UIN } -pci_root_device::pci_root_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pci_root_device::pci_root_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCI_ROOT,"PCI virtual root", tag, owner, clock, "pci_root", __FILE__) { } diff --git a/src/devices/machine/pci.h b/src/devices/machine/pci.h index 9650efa8132..245ca503009 100644 --- a/src/devices/machine/pci.h +++ b/src/devices/machine/pci.h @@ -30,24 +30,24 @@ public: mapper_cb remap_cb, remap_config_cb; - pci_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); + pci_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); - void set_ids(UINT32 main_id, UINT8 revision, UINT32 pclass, UINT32 subsystem_id); + void set_ids(uint32_t main_id, uint8_t revision, uint32_t pclass, uint32_t subsystem_id); void set_multifunction_device(bool enable); virtual void set_remap_cb(mapper_cb _remap_cb); virtual void reset_all_mappings(); - virtual void map_device(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); - 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); + virtual void map_device(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); + 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); - void map_config(UINT8 device, address_space *config_space); + void map_config(uint8_t device, address_space *config_space); virtual DECLARE_ADDRESS_MAP(config_map, 32); - UINT32 unmapped_r(offs_t offset, UINT32 mem_mask, int bank); - void unmapped_w(offs_t offset, UINT32 data, UINT32 mem_mask, int bank); + uint32_t unmapped_r(offs_t offset, uint32_t mem_mask, int bank); + void unmapped_w(offs_t offset, uint32_t data, uint32_t mem_mask, int bank); READ32_MEMBER (unmapped0_r); WRITE32_MEMBER(unmapped0_w); @@ -97,8 +97,8 @@ protected: // One of the two address_map_delegate map; - UINT64 adr; - UINT32 size; + uint64_t adr; + uint32_t size; int flags; }; @@ -110,36 +110,36 @@ protected: int bank_count, bank_reg_count; bank_reg_info bank_reg_infos[6]; - UINT32 main_id, subsystem_id; - UINT32 pclass; - UINT8 revision; - UINT16 command, command_mask, status; - const UINT8 *expansion_rom; - UINT32 expansion_rom_size; - UINT32 expansion_rom_base; + uint32_t main_id, subsystem_id; + uint32_t pclass; + uint8_t revision; + uint16_t command, command_mask, status; + const uint8_t *expansion_rom; + uint32_t expansion_rom_size; + uint32_t expansion_rom_base; bool is_multifunction_device; virtual void device_start() override; virtual void device_reset() override; void skip_map_regs(int count); - void add_map(UINT64 size, int flags, address_map_delegate &map); - template void add_map(UINT64 size, int flags, void (T::*map)(address_map &map, device_t &device), const char *name) { + void add_map(uint64_t size, int flags, address_map_delegate &map); + template void add_map(uint64_t size, int flags, void (T::*map)(address_map &map, device_t &device), const char *name) { address_map_delegate delegate(map, name, static_cast(this)); add_map(size, flags, delegate); } - void add_rom(const UINT8 *data, UINT32 size); + void add_rom(const uint8_t *data, uint32_t size); void add_rom_from_region(); - void set_map_address(int id, UINT64 adr); - void set_map_size(int id, UINT64 size); + void set_map_address(int id, uint64_t adr); + void set_map_size(int id, uint64_t size); void set_map_flags(int id, int flags); }; class agp_device : public pci_device { public: - agp_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); + agp_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: virtual void device_start() override; @@ -148,12 +148,12 @@ protected: class pci_bridge_device : public pci_device, public device_memory_interface { public: - pci_bridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - pci_bridge_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); + pci_bridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + pci_bridge_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 set_remap_cb(mapper_cb _remap_cb) override; - virtual void map_device(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_device(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; virtual void reset_all_mappings() override; virtual DECLARE_READ8_MEMBER(header_type_r) override; @@ -204,9 +204,9 @@ protected: std::vector all_devices; std::vector all_bridges; - UINT32 prefetch_baseu, prefetch_limitu; - UINT16 bridge_control, memory_base, memory_limit, prefetch_base, prefetch_limit, iobaseu, iolimitu; - UINT8 primary_bus, secondary_bus, subordinate_bus, iobase, iolimit; + uint32_t prefetch_baseu, prefetch_limitu; + uint16_t bridge_control, memory_base, memory_limit, prefetch_base, prefetch_limit, iobaseu, iolimitu; + uint8_t primary_bus, secondary_bus, subordinate_bus, iobase, iolimit; virtual void device_start() override; virtual void device_reset() override; @@ -215,12 +215,12 @@ protected: virtual device_t *bus_root(); virtual void regenerate_config_mapping(); - UINT32 do_config_read(UINT8 bus, UINT8 device, UINT16 reg, UINT32 mem_mask); - UINT32 propagate_config_read(UINT8 bus, UINT8 device, UINT16 reg, UINT32 mem_mask); - UINT32 config_read(UINT8 bus, UINT8 device, UINT16 reg, UINT32 mem_mask); - void do_config_write(UINT8 bus, UINT8 device, UINT16 reg, UINT32 data, UINT32 mem_mask); - void propagate_config_write(UINT8 bus, UINT8 device, UINT16 reg, UINT32 data, UINT32 mem_mask); - void config_write(UINT8 bus, UINT8 device, UINT16 reg, UINT32 data, UINT32 mem_mask); + uint32_t do_config_read(uint8_t bus, uint8_t device, uint16_t reg, uint32_t mem_mask); + uint32_t propagate_config_read(uint8_t bus, uint8_t device, uint16_t reg, uint32_t mem_mask); + uint32_t config_read(uint8_t bus, uint8_t device, uint16_t reg, uint32_t mem_mask); + void do_config_write(uint8_t bus, uint8_t device, uint16_t reg, uint32_t data, uint32_t mem_mask); + void propagate_config_write(uint8_t bus, uint8_t device, uint16_t reg, uint32_t data, uint32_t mem_mask); + void config_write(uint8_t bus, uint8_t device, uint16_t reg, uint32_t data, uint32_t mem_mask); private: address_space_config configure_space_config; @@ -228,7 +228,7 @@ private: class agp_bridge_device : public pci_bridge_device { public: - agp_bridge_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); + agp_bridge_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: virtual void device_start() override; @@ -239,35 +239,35 @@ class pci_host_device : public pci_bridge_device { public: DECLARE_ADDRESS_MAP(io_configuration_access_map, 32); - pci_host_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); + pci_host_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: address_space *memory_space, *io_space; - UINT64 memory_window_start, memory_window_end, memory_offset; - UINT64 io_window_start, io_window_end, io_offset; + uint64_t memory_window_start, memory_window_end, memory_offset; + uint64_t io_window_start, io_window_end, io_offset; virtual void device_start() override; virtual void device_reset() override; virtual device_t *bus_root() override; - UINT32 config_address; + uint32_t config_address; DECLARE_READ32_MEMBER(config_address_r); DECLARE_WRITE32_MEMBER(config_address_w); DECLARE_READ32_MEMBER(config_data_r); DECLARE_WRITE32_MEMBER(config_data_w); - UINT32 root_config_read(UINT8 bus, UINT8 device, UINT16 reg, UINT32 mem_mask); - void root_config_write(UINT8 bus, UINT8 device, UINT16 reg, UINT32 data, UINT32 mem_mask); + uint32_t root_config_read(uint8_t bus, uint8_t device, uint16_t reg, uint32_t mem_mask); + void root_config_write(uint8_t bus, uint8_t device, uint16_t reg, uint32_t data, uint32_t mem_mask); void regenerate_mapping(); }; class pci_root_device : public device_t { public: - pci_root_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pci_root_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/machine/pci9050.cpp b/src/devices/machine/pci9050.cpp index 718a64e0fa1..a7ccb5eff62 100644 --- a/src/devices/machine/pci9050.cpp +++ b/src/devices/machine/pci9050.cpp @@ -40,7 +40,7 @@ ADDRESS_MAP_END DEVICE_ADDRESS_MAP_START(empty, 32, pci9050_device) ADDRESS_MAP_END -pci9050_device::pci9050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pci9050_device::pci9050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, PCI9050, "PLX PCI9050 PCI to Local Bus Bridge", tag, owner, clock, "pci9050", __FILE__), m_user_input_handler(*this), m_user_output_handler(*this) { @@ -108,8 +108,8 @@ void pci9050_device::device_reset() void pci9050_device::remap_local(int id) { - UINT32 csbase = m_csbase[id]; - UINT32 lasrr = m_lasrr[id]; + uint32_t csbase = m_csbase[id]; + uint32_t lasrr = m_lasrr[id]; logerror("local bus %d csbase=%08x lasrr=%08x\n", id, csbase, lasrr); if(!(csbase & 1)) { @@ -130,7 +130,7 @@ void pci9050_device::remap_local(int id) return; } - UINT32 mask = ~(size - 1); + uint32_t mask = ~(size - 1); if(lasrr & 1) mask &= 0x0ffffffc; else @@ -280,7 +280,7 @@ WRITE32_MEMBER(pci9050_device::cntrl_w) { if (0) logerror("%06X:PCI9050 CNTRL write %08x\n", machine().device("maincpu")->safe_pc(), data); - UINT32 oldData = m_cntrl; + uint32_t oldData = m_cntrl; m_cntrl = data; remap_rom(); if ((oldData ^ m_cntrl) & 0x3000) diff --git a/src/devices/machine/pci9050.h b/src/devices/machine/pci9050.h index a9de08ba6c9..64778d02bfa 100644 --- a/src/devices/machine/pci9050.h +++ b/src/devices/machine/pci9050.h @@ -29,7 +29,7 @@ class pci9050_device : public pci_device { public: - pci9050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pci9050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // PCI9050 I/O register space handlers DECLARE_READ32_MEMBER( lasrr_r ); @@ -69,8 +69,8 @@ private: device_t *m_devices[4]; address_map_constructor m_maps[4]; - UINT32 m_lasrr[4], m_lasba[4], m_lasbrd[4], m_csbase[4]; - UINT32 m_eromrr, m_eromba, m_erombrd, m_intcsr, m_cntrl; + uint32_t m_lasrr[4], m_lasba[4], m_lasbrd[4], m_csbase[4]; + uint32_t m_eromrr, m_eromba, m_erombrd, m_intcsr, m_cntrl; void remap_local(int id); void remap_rom(); diff --git a/src/devices/machine/pckeybrd.cpp b/src/devices/machine/pckeybrd.cpp index 92e3bd973fd..5aa9e00541c 100644 --- a/src/devices/machine/pckeybrd.cpp +++ b/src/devices/machine/pckeybrd.cpp @@ -278,7 +278,7 @@ const at_keyboard_device::extended_keyboard_code at_keyboard_device::m_extended_ const device_type PC_KEYB = &device_creator; const device_type AT_KEYB = &device_creator; -pc_keyboard_device::pc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pc_keyboard_device::pc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PC_KEYB, "PC Keyboard", tag, owner, clock, "pc_keyb", __FILE__), m_type(KEYBOARD_TYPE_PC), m_ioport_0(*this, ":pc_keyboard_0"), @@ -293,7 +293,7 @@ pc_keyboard_device::pc_keyboard_device(const machine_config &mconfig, const char { } -pc_keyboard_device::pc_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) : +pc_keyboard_device::pc_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_ioport_0(*this, ":pc_keyboard_0"), m_ioport_1(*this, ":pc_keyboard_1"), @@ -307,7 +307,7 @@ pc_keyboard_device::pc_keyboard_device(const machine_config &mconfig, device_typ { } -at_keyboard_device::at_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +at_keyboard_device::at_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pc_keyboard_device(mconfig, AT_KEYB, "AT Keyboard", tag, owner, clock, "at_keyb", __FILE__), m_scan_code_set(1) { @@ -389,7 +389,7 @@ WRITE_LINE_MEMBER(pc_keyboard_device::enable) } /* insert a code into the buffer */ -void pc_keyboard_device::queue_insert(UINT8 data) +void pc_keyboard_device::queue_insert(uint8_t data) { if (LOG_KEYBOARD) logerror("keyboard queueing %.2x\n",data); @@ -523,9 +523,9 @@ void at_keyboard_device::helper(const char *codes) * scan keys and stuff make/break codes **************************************************************************/ -UINT32 pc_keyboard_device::readport(int port) +uint32_t pc_keyboard_device::readport(int port) { - UINT32 result = 0; + uint32_t result = 0; switch(port) { case 0: @@ -893,9 +893,9 @@ WRITE8_MEMBER(at_keyboard_device::write) unicode_char_to_at_keycode ***************************************************************************/ -UINT8 pc_keyboard_device::unicode_char_to_at_keycode(char32_t ch) +uint8_t pc_keyboard_device::unicode_char_to_at_keycode(char32_t ch) { - UINT8 b; + uint8_t b; switch(ch) { case '\033': b = 1; break; @@ -1037,7 +1037,7 @@ UINT8 pc_keyboard_device::unicode_char_to_at_keycode(char32_t ch) int pc_keyboard_device::queue_chars(const char32_t *text, size_t text_len) { int i; - UINT8 b; + uint8_t b; for (i = 0; (i < text_len) && ((queue_size()) + 4 < sizeof(m_queue)); i++) { diff --git a/src/devices/machine/pckeybrd.h b/src/devices/machine/pckeybrd.h index 58861fc288c..5b493f858e1 100644 --- a/src/devices/machine/pckeybrd.h +++ b/src/devices/machine/pckeybrd.h @@ -19,8 +19,8 @@ class pc_keyboard_device : public device_t { public: - pc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - pc_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); + pc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + pc_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); DECLARE_READ8_MEMBER(read); DECLARE_WRITE_LINE_MEMBER(enable); @@ -40,7 +40,7 @@ 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; - void queue_insert(UINT8 data); + void queue_insert(uint8_t data); void clear_buffer(void); int m_numlock; @@ -48,8 +48,8 @@ protected: private: void polling(void); - UINT32 readport(int port); - UINT8 unicode_char_to_at_keycode(char32_t ch); + uint32_t readport(int port); + uint8_t unicode_char_to_at_keycode(char32_t ch); virtual void standard_scancode_insert(int our_code, int pressed); virtual void extended_scancode_insert(int code, int pressed) { } @@ -59,13 +59,13 @@ private: bool charqueue_empty(); bool m_on; - UINT8 m_delay; /* 240/60 -> 0,25s */ - UINT8 m_repeat; /* 240/ 8 -> 30/s */ + uint8_t m_delay; /* 240/60 -> 0,25s */ + uint8_t m_repeat; /* 240/ 8 -> 30/s */ - UINT8 m_queue[256]; - UINT8 m_head; - UINT8 m_tail; - UINT8 m_make[128]; + uint8_t m_queue[256]; + uint8_t m_head; + uint8_t m_tail; + uint8_t m_make[128]; optional_ioport m_ioport_0; optional_ioport m_ioport_1; @@ -83,7 +83,7 @@ private: class at_keyboard_device : public pc_keyboard_device { public: - at_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + at_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( write ); diff --git a/src/devices/machine/pdc.cpp b/src/devices/machine/pdc.cpp index 445aeae094b..12dce85aa7f 100644 --- a/src/devices/machine/pdc.cpp +++ b/src/devices/machine/pdc.cpp @@ -306,7 +306,7 @@ ioport_constructor pdc_device::device_input_ports() const // pdc_device - constructor //------------------------------------------------- -pdc_device::pdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pdc_device::pdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDC, "ROLM PDC", tag, owner, clock, "pdc", __FILE__), m_pdccpu(*this, Z80_TAG), m_dma8237(*this, FDCDMA_TAG), @@ -388,7 +388,7 @@ WRITE8_MEMBER(pdc_device::i8237_dma_mem_w) READ8_MEMBER(pdc_device::i8237_fdc_dma_r) { - UINT8 ret = m_fdc->dma_r(); + uint8_t ret = m_fdc->dma_r(); if(TRACE_PDC_DMA) logerror("PDC: 8237 DMA CHANNEL 0 READ ADDRESS: %08X, DATA: %02X\n", offset, ret ); return ret; } @@ -401,8 +401,8 @@ WRITE8_MEMBER(pdc_device::i8237_fdc_dma_w) READ8_MEMBER(pdc_device::m68k_dma_r) { - UINT32 address; - UINT8 data; + uint32_t address; + uint8_t data; address = fdd_68k_dma_address++; data = m_m68k_r_cb(address); @@ -476,7 +476,7 @@ WRITE8_MEMBER(pdc_device::p0_7_w) READ8_MEMBER(pdc_device::fdd_68k_r) { - UINT8 address = offset + 0x21; + uint8_t address = offset + 0x21; switch(address) { default: @@ -486,7 +486,7 @@ READ8_MEMBER(pdc_device::fdd_68k_r) } WRITE8_MEMBER(pdc_device::fdd_68k_w) { - UINT8 address = offset + 0x21; + uint8_t address = offset + 0x21; switch(address) { case 0x21: /* Port 21: ?? */ @@ -546,7 +546,7 @@ READ8_MEMBER(pdc_device::p38_r) READ8_MEMBER(pdc_device::p39_r) { - UINT8 data = 1; + uint8_t data = 1; if(b_fdc_irq) data |= 8; // Set bit 3 if(TRACE_PDC_CMD) logerror("PDC: Port 0x39 READ: %02X, PC: %X\n", data, space.device().safe_pc()); return data; @@ -554,7 +554,7 @@ READ8_MEMBER(pdc_device::p39_r) WRITE8_MEMBER(pdc_device::p50_5f_w) { - UINT8 address = 0x50 + offset; + uint8_t address = 0x50 + offset; switch(address) { case 0x52: diff --git a/src/devices/machine/pdc.h b/src/devices/machine/pdc.h index 23cee250dcc..d4271fbe06d 100644 --- a/src/devices/machine/pdc.h +++ b/src/devices/machine/pdc.h @@ -35,7 +35,7 @@ class pdc_device : public device_t { public: /* Constructor and Destructor */ - pdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pdc_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; @@ -72,24 +72,24 @@ public: DECLARE_FLOPPY_FORMATS( floppy_formats ); /* Main CPU accessible registers */ - UINT8 reg_p0; - UINT8 reg_p1; - UINT8 reg_p2; - UINT8 reg_p3; - UINT8 reg_p4; - UINT8 reg_p5; - UINT8 reg_p6; - UINT8 reg_p7; - UINT8 reg_p21; - UINT8 reg_p38; - UINT32 fdd_68k_dma_address; /* FDD <-> m68k DMA read/write address */ + uint8_t reg_p0; + uint8_t reg_p1; + uint8_t reg_p2; + uint8_t reg_p3; + uint8_t reg_p4; + uint8_t reg_p5; + uint8_t reg_p6; + uint8_t reg_p7; + uint8_t reg_p21; + uint8_t reg_p38; + uint32_t fdd_68k_dma_address; /* FDD <-> m68k DMA read/write address */ protected: /* Device-level overrides */ virtual void device_start() override; virtual void device_reset() override; /* Protected variables */ - //UINT32 fdd_68k_dma_address; + //uint32_t fdd_68k_dma_address; bool b_fdc_irq; /* Attached devices */ @@ -100,7 +100,7 @@ protected: //required_device m_floppy; optional_device m_hdc9224; mfm_harddisk_device* m_harddisk; - required_shared_ptr m_pdc_ram; + required_shared_ptr m_pdc_ram; /* Callbacks */ devcb_read8 m_m68k_r_cb; diff --git a/src/devices/machine/pic8259.cpp b/src/devices/machine/pic8259.cpp index 3064e212850..b5120e886cf 100644 --- a/src/devices/machine/pic8259.cpp +++ b/src/devices/machine/pic8259.cpp @@ -27,7 +27,7 @@ void pic8259_device::device_timer(emu_timer &timer, device_timer_id id, int para /* check the various IRQs */ for (int n = 0, irq = m_prio; n < 8; n++, irq = (irq + 1) & 7) { - UINT8 mask = 1 << irq; + uint8_t mask = 1 << irq; /* is this IRQ in service and not cascading and sfnm? */ if ((m_isr & mask) && !(m_master && m_cascade && m_nested && (m_slave & mask))) @@ -59,7 +59,7 @@ void pic8259_device::device_timer(emu_timer &timer, device_timer_id id, int para void pic8259_device::set_irq_line(int irq, int state) { - UINT8 mask = (1 << irq); + uint8_t mask = (1 << irq); if (state) { @@ -88,11 +88,11 @@ void pic8259_device::set_irq_line(int irq, int state) } -UINT32 pic8259_device::acknowledge() +uint32_t pic8259_device::acknowledge() { for (int n = 0, irq = m_prio; n < 8; n++, irq = (irq + 1) & 7) { - UINT8 mask = 1 << irq; + uint8_t mask = 1 << irq; /* is this IRQ pending and enabled? */ if ((m_irr & mask) && !(m_imr & mask)) @@ -149,7 +149,7 @@ IRQ_CALLBACK_MEMBER(pic8259_device::inta_cb) READ8_MEMBER( pic8259_device::read ) { /* NPW 18-May-2003 - Changing 0xFF to 0x00 as per Ruslan */ - UINT8 data = 0x00; + uint8_t data = 0x00; switch(offset) { @@ -235,7 +235,7 @@ WRITE8_MEMBER( pic8259_device::write ) else if ((data & 0x18) == 0x00) { int n = data & 7; - UINT8 mask = 1 << n; + uint8_t mask = 1 << n; /* write OCW2 */ if (LOG_OCW) @@ -430,7 +430,7 @@ void pic8259_device::device_reset() const device_type PIC8259 = &device_creator; -pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PIC8259, "8259 PIC", tag, owner, clock, "pit8259", __FILE__) , m_out_int_func(*this) , m_sp_en_func(*this) diff --git a/src/devices/machine/pic8259.h b/src/devices/machine/pic8259.h index d02c74bca4f..50f8da14ca8 100644 --- a/src/devices/machine/pic8259.h +++ b/src/devices/machine/pic8259.h @@ -42,7 +42,7 @@ class pic8259_device : public device_t { public: - pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &static_set_out_int_callback(device_t &device, _Object object) { return downcast(device).m_out_int_func.set_callback(object); } template static devcb_base &static_set_sp_en_callback(device_t &device, _Object object) { return downcast(device).m_sp_en_func.set_callback(object); } @@ -50,7 +50,7 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - UINT32 acknowledge(); + uint32_t acknowledge(); DECLARE_WRITE_LINE_MEMBER( ir0_w ) { set_irq_line(0, state); } DECLARE_WRITE_LINE_MEMBER( ir1_w ) { set_irq_line(1, state); } @@ -94,34 +94,34 @@ private: pic8259_state_t m_state; - UINT8 m_isr; - UINT8 m_irr; - UINT8 m_prio; - UINT8 m_imr; - UINT8 m_irq_lines; + uint8_t m_isr; + uint8_t m_irr; + uint8_t m_prio; + uint8_t m_imr; + uint8_t m_irq_lines; - UINT8 m_input; - UINT8 m_ocw3; + uint8_t m_input; + uint8_t m_ocw3; - UINT8 m_master; + uint8_t m_master; /* ICW1 state */ - UINT8 m_level_trig_mode; - UINT8 m_vector_size; - UINT8 m_cascade; - UINT8 m_icw4_needed; - UINT32 m_vector_addr_low; + uint8_t m_level_trig_mode; + uint8_t m_vector_size; + uint8_t m_cascade; + uint8_t m_icw4_needed; + uint32_t m_vector_addr_low; /* ICW2 state */ - UINT8 m_base; - UINT8 m_vector_addr_high; + uint8_t m_base; + uint8_t m_vector_addr_high; /* ICW3 state */ - UINT8 m_slave; + uint8_t m_slave; /* ICW4 state */ - UINT8 m_nested; - UINT8 m_mode; - UINT8 m_auto_eoi; - UINT8 m_is_x86; + uint8_t m_nested; + uint8_t m_mode; + uint8_t m_auto_eoi; + uint8_t m_is_x86; }; extern const device_type PIC8259; diff --git a/src/devices/machine/pit8253.cpp b/src/devices/machine/pit8253.cpp index 978cb6a50b5..3c7ee7922f7 100644 --- a/src/devices/machine/pit8253.cpp +++ b/src/devices/machine/pit8253.cpp @@ -46,7 +46,7 @@ enum const device_type PIT8253 = &device_creator; -pit8253_device::pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pit8253_device::pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PIT8253, "8253 PIT", tag, owner, clock, "pit8253", __FILE__), m_clk0(0), m_clk1(0), @@ -57,7 +57,7 @@ pit8253_device::pit8253_device(const machine_config &mconfig, const char *tag, d { } -pit8253_device::pit8253_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) : +pit8253_device::pit8253_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_clk0(0), m_clk1(0), @@ -71,7 +71,7 @@ pit8253_device::pit8253_device(const machine_config &mconfig, device_type type, const device_type PIT8254 = &device_creator; -pit8254_device::pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pit8254_device::pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pit8253_device(mconfig, PIT8254, "8254 PIT", tag, owner, clock, "pit8254", __FILE__) { } @@ -190,7 +190,7 @@ void pit8253_device::device_reset() #define CTRL_BCD(control) (((control) >> 0) & 0x01) -inline UINT32 pit8253_device::adjusted_count(int bcd, UINT16 val) +inline uint32_t pit8253_device::adjusted_count(int bcd, uint16_t val) { if (!bcd) return (val == 0) ? 0x10000 : val; @@ -217,10 +217,10 @@ inline UINT32 pit8253_device::adjusted_count(int bcd, UINT16 val) /* This function subtracts 1 from timer->value "cycles" times, taking into account binary or BCD operation, and wrapping around from 0 to 0xFFFF or 0x9999 as necessary. */ -void pit8253_device::decrease_counter_value(pit8253_timer *timer, INT64 cycles) +void pit8253_device::decrease_counter_value(pit8253_timer *timer, int64_t cycles) { - UINT16 value; - UINT8 units, tens, hundreds, thousands; + uint16_t value; + uint8_t units, tens, hundreds, thousands; if (CTRL_BCD(timer->control) == 0) { @@ -309,13 +309,13 @@ void pit8253_device::set_output(pit8253_timer *timer, int output) /* This emulates timer "timer" for "elapsed_cycles" cycles and assumes no callbacks occur during that time. */ -void pit8253_device::simulate2(pit8253_timer *timer, INT64 elapsed_cycles) +void pit8253_device::simulate2(pit8253_timer *timer, int64_t elapsed_cycles) { - UINT32 adjusted_value; + uint32_t adjusted_value; int bcd = CTRL_BCD(timer->control); int mode = CTRL_MODE(timer->control); - static const UINT32 CYCLES_NEVER = (0xffffffff); - UINT32 cycles_to_output = 0; + static const uint32_t CYCLES_NEVER = (0xffffffff); + uint32_t cycles_to_output = 0; LOG2(("simulate2(): simulating %d cycles for %d in mode %d, bcd = %d, phase = %d, gate = %d, output %d, value = 0x%04x\n", (int)elapsed_cycles, timer->index, mode, bcd, timer->phase, timer->gate, timer->output, timer->value)); @@ -705,7 +705,7 @@ void pit8253_device::simulate2(pit8253_timer *timer, INT64 elapsed_cycles) /* This emulates timer "timer" for "elapsed_cycles" cycles, broken down into sections punctuated by callbacks. */ -void pit8253_device::simulate(pit8253_timer *timer, INT64 elapsed_cycles) +void pit8253_device::simulate(pit8253_timer *timer, int64_t elapsed_cycles) { if (elapsed_cycles > 0) simulate2(timer, elapsed_cycles); @@ -721,7 +721,7 @@ void pit8253_device::update(pit8253_timer *timer) years of time. Should be enough for now. */ attotime now = machine().time(); attotime elapsed_time = now - timer->last_updated; - INT64 elapsed_cycles = elapsed_time.as_double() * timer->clockin; + int64_t elapsed_cycles = elapsed_time.as_double() * timer->clockin; LOG1(("update(): timer %d, %d elapsed_cycles\n", timer->index, elapsed_cycles)); @@ -737,7 +737,7 @@ void pit8253_device::update(pit8253_timer *timer) /* We recycle bit 0 of timer->value to hold the phase in mode 3 when count is odd. Since read commands in mode 3 always return even numbers, we need to mask this bit off. */ -UINT16 pit8253_device::masked_value(pit8253_timer *timer) +uint16_t pit8253_device::masked_value(pit8253_timer *timer) { LOG2(("masked_value\n")); if (CTRL_MODE(timer->control) == 3) @@ -753,8 +753,8 @@ UINT16 pit8253_device::masked_value(pit8253_timer *timer) READ8_MEMBER( pit8253_device::read ) { pit8253_timer *timer = get_timer(offset); - UINT8 data; - UINT16 value; + uint8_t data; + uint16_t value; LOG2(("read(): offset %d\n", offset)); @@ -822,7 +822,7 @@ READ8_MEMBER( pit8253_device::read ) /* Loads a new value from the bus to the count register (CR) */ -void pit8253_device::load_count(pit8253_timer *timer, UINT16 newcount) +void pit8253_device::load_count(pit8253_timer *timer, uint16_t newcount) { int mode = CTRL_MODE(timer->control); LOG1(("load_count(): %04x\n", newcount)); @@ -854,7 +854,7 @@ void pit8253_device::load_count(pit8253_timer *timer, UINT16 newcount) void pit8253_device::readback(pit8253_timer *timer, int command) { - UINT16 value; + uint16_t value; update(timer); if ((command & 1) == 0) @@ -904,13 +904,13 @@ void pit8253_device::readback(pit8253_timer *timer, int command) } -void pit8253_device::readback_command(UINT8 data) +void pit8253_device::readback_command(uint8_t data) { /* Readback command. Illegal on 8253 */ /* Todo: find out what (if anything) the 8253 hardware actually does here. */ } -void pit8254_device::readback_command(UINT8 data) +void pit8254_device::readback_command(uint8_t data) { LOG1(("write(): readback %02x\n", data & 0x3f)); diff --git a/src/devices/machine/pit8253.h b/src/devices/machine/pit8253.h index e31ce8a3d19..568491ed600 100644 --- a/src/devices/machine/pit8253.h +++ b/src/devices/machine/pit8253.h @@ -54,8 +54,8 @@ class pit8253_device : public device_t { public: - pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - pit8253_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); + pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + pit8253_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); ~pit8253_device() {} // static configuration helpers @@ -106,12 +106,12 @@ protected: emu_timer *updatetimer; /* MAME timer to process updates */ - UINT16 value; /* current counter value ("CE" in Intel docs) */ - UINT16 latch; /* latched counter value ("OL" in Intel docs) */ - UINT16 count; /* new counter value ("CR" in Intel docs) */ - UINT8 control; /* 6-bit control byte */ - UINT8 status; /* status byte - 8254 only */ - UINT8 lowcount; /* LSB of new counter value for 16-bit writes */ + uint16_t value; /* current counter value ("CE" in Intel docs) */ + uint16_t latch; /* latched counter value ("OL" in Intel docs) */ + uint16_t count; /* new counter value ("CR" in Intel docs) */ + uint8_t control; /* 6-bit control byte */ + uint8_t status; /* status byte - 8254 only */ + uint8_t lowcount; /* LSB of new counter value for 16-bit writes */ int rmsb; /* 1 = Next read is MSB of 16-bit value */ int wmsb; /* 1 = Next write is MSB of 16-bit value */ int output; /* 0 = low, 1 = high */ @@ -124,7 +124,7 @@ protected: }; void readback(pit8253_timer *timer, int command); - virtual void readback_command(UINT8 data); + virtual void readback_command(uint8_t data); pit8253_timer *get_timer(int which); private: @@ -142,15 +142,15 @@ private: pit8253_timer m_timers[PIT8253_MAX_TIMER]; - inline UINT32 adjusted_count(int bcd, UINT16 val); - void decrease_counter_value(pit8253_timer *timer, INT64 cycles); + inline uint32_t adjusted_count(int bcd, uint16_t val); + void decrease_counter_value(pit8253_timer *timer, int64_t cycles); void load_counter_value(pit8253_timer *timer); void set_output(pit8253_timer *timer, int output); - void simulate2(pit8253_timer *timer, INT64 elapsed_cycles); - void simulate(pit8253_timer *timer, INT64 elapsed_cycles); + void simulate2(pit8253_timer *timer, int64_t elapsed_cycles); + void simulate(pit8253_timer *timer, int64_t elapsed_cycles); void update(pit8253_timer *timer); - UINT16 masked_value(pit8253_timer *timer); - void load_count(pit8253_timer *timer, UINT16 newcount); + uint16_t masked_value(pit8253_timer *timer); + void load_count(pit8253_timer *timer, uint16_t newcount); void gate_w(int gate, int state); void set_clock_signal(int timerno, int state); }; @@ -161,10 +161,10 @@ extern const device_type PIT8253; class pit8254_device : public pit8253_device { public: - pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual void readback_command(UINT8 data) override; + virtual void readback_command(uint8_t data) override; }; extern const device_type PIT8254; diff --git a/src/devices/machine/pla.cpp b/src/devices/machine/pla.cpp index f2310201771..3ca6da06d6c 100644 --- a/src/devices/machine/pla.cpp +++ b/src/devices/machine/pla.cpp @@ -17,7 +17,7 @@ const device_type PLA = &device_creator; // pla_device - constructor //------------------------------------------------- -pla_device::pla_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pla_device::pla_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PLA, "PLA", tag, owner, clock, "pla", __FILE__), m_region(*this, DEVICE_SELF), m_format(PLA_FMT_JEDBIN), @@ -40,8 +40,8 @@ void pla_device::device_start() assert(m_inputs < 32 && m_outputs <= 32); if (m_input_mask == 0) - m_input_mask = ((UINT64)1 << m_inputs) - 1; - m_input_mask = ((UINT64)m_input_mask << 32) | m_input_mask; + m_input_mask = ((uint64_t)1 << m_inputs) - 1; + m_input_mask = ((uint64_t)m_input_mask << 32) | m_input_mask; // parse fusemap parse_fusemap(); @@ -95,7 +95,7 @@ void pla_device::parse_fusemap() } // parse it - UINT32 fusenum = 0; + uint32_t fusenum = 0; for (int p = 0; p < m_terms; p++) { @@ -107,10 +107,10 @@ void pla_device::parse_fusemap() for (int i = 0; i < m_inputs; i++) { // complement - term->and_mask |= (UINT64)jed_get_fuse(&jed, fusenum++) << (i + 32); + term->and_mask |= (uint64_t)jed_get_fuse(&jed, fusenum++) << (i + 32); // true - term->and_mask |= (UINT64)jed_get_fuse(&jed, fusenum++) << i; + term->and_mask |= (uint64_t)jed_get_fuse(&jed, fusenum++) << i; } // OR mask @@ -140,7 +140,7 @@ void pla_device::parse_fusemap() // read - //------------------------------------------------- -UINT32 pla_device::read(UINT32 input) +uint32_t pla_device::read(uint32_t input) { // try the cache first if (input < m_cache_size) @@ -148,7 +148,7 @@ UINT32 pla_device::read(UINT32 input) for (auto cache2_entry : m_cache2) { - if ((UINT32)cache2_entry == input) + if ((uint32_t)cache2_entry == input) { // cache2 hit return cache2_entry >> 32; @@ -156,8 +156,8 @@ UINT32 pla_device::read(UINT32 input) } // cache miss, process terms - UINT64 inputs = ((~(UINT64)input << 32) | input) & m_input_mask; - UINT64 s = 0; + uint64_t inputs = ((~(uint64_t)input << 32) | input) & m_input_mask; + uint64_t s = 0; for (int i = 0; i < m_terms; ++i) { diff --git a/src/devices/machine/pla.h b/src/devices/machine/pla.h index 1fdffd023d9..91352752bd8 100644 --- a/src/devices/machine/pla.h +++ b/src/devices/machine/pla.h @@ -88,19 +88,19 @@ class pla_device : public device_t { public: // construction/destruction - pla_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pla_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - static void set_num_inputs(device_t &device, UINT32 i) { downcast(device).m_inputs = i; } - static void set_num_outputs(device_t &device, UINT32 o) { downcast(device).m_outputs = o; } - static void set_num_terms(device_t &device, UINT32 t) { downcast(device).m_terms = t; } - static void set_inputmask(device_t &device, UINT32 mask) { downcast(device).m_input_mask = mask; } // UINT32! + static void set_num_inputs(device_t &device, uint32_t i) { downcast(device).m_inputs = i; } + static void set_num_outputs(device_t &device, uint32_t o) { downcast(device).m_outputs = o; } + static void set_num_terms(device_t &device, uint32_t t) { downcast(device).m_terms = t; } + static void set_inputmask(device_t &device, uint32_t mask) { downcast(device).m_input_mask = mask; } // uint32_t! static void set_format(device_t &device, int format) { downcast(device).m_format = format; } - UINT32 inputs() { return m_inputs; } - UINT32 outputs() { return m_outputs; } + uint32_t inputs() { return m_inputs; } + uint32_t outputs() { return m_outputs; } - UINT32 read(UINT32 input); + uint32_t read(uint32_t input); protected: // device-level overrides @@ -113,21 +113,21 @@ private: int m_format; - UINT32 m_inputs; - UINT32 m_outputs; - UINT32 m_terms; - UINT64 m_input_mask; - UINT64 m_xor; + uint32_t m_inputs; + uint32_t m_outputs; + uint32_t m_terms; + uint64_t m_input_mask; + uint64_t m_xor; int m_cache_size; - std::vector m_cache; - UINT64 m_cache2[CACHE2_SIZE]; - UINT8 m_cache2_ptr; + std::vector m_cache; + uint64_t m_cache2[CACHE2_SIZE]; + uint8_t m_cache2_ptr; struct term { - UINT64 and_mask; - UINT64 or_mask; + uint64_t and_mask; + uint64_t or_mask; } m_term[MAX_TERMS]; }; diff --git a/src/devices/machine/r10696.cpp b/src/devices/machine/r10696.cpp index 819d31084e9..e04484fa32e 100644 --- a/src/devices/machine/r10696.cpp +++ b/src/devices/machine/r10696.cpp @@ -47,7 +47,7 @@ const device_type R10696 = &device_creator; -r10696_device::r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +r10696_device::r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, R10696, "Rockwell 10696", tag, owner, clock, "r10696", __FILE__), m_io_a(0), m_io_b(0), m_io_c(0), m_iord(*this), m_iowr(*this) @@ -86,9 +86,9 @@ void r10696_device::device_reset() WRITE8_MEMBER( r10696_device::io_w ) { assert(offset < 16); - const UINT8 io_a = m_io_a; - const UINT8 io_b = m_io_b; - const UINT8 io_c = m_io_c; + const uint8_t io_a = m_io_a; + const uint8_t io_b = m_io_b; + const uint8_t io_c = m_io_c; switch (offset) { case 0x0A: // Read Group A @@ -134,8 +134,8 @@ WRITE8_MEMBER( r10696_device::io_w ) READ8_MEMBER( r10696_device::io_r ) { assert(offset < 16); - UINT8 io_a, io_b, io_c; - UINT8 data = 0xf; + uint8_t io_a, io_b, io_c; + uint8_t data = 0xf; switch (offset) { case 0x0A: // Read Group A diff --git a/src/devices/machine/r10696.h b/src/devices/machine/r10696.h index b3e821a9ed9..16c3cd130bf 100644 --- a/src/devices/machine/r10696.h +++ b/src/devices/machine/r10696.h @@ -32,7 +32,7 @@ class r10696_device : public device_t { public: - r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~r10696_device() {} DECLARE_READ8_MEMBER ( io_r ); @@ -46,9 +46,9 @@ protected: virtual void device_reset() override; private: - UINT8 m_io_a; //!< input/output flip-flops group A - UINT8 m_io_b; //!< input/output flip-flops group B - UINT8 m_io_c; //!< input/output flip-flops group C + uint8_t m_io_a; //!< input/output flip-flops group A + uint8_t m_io_b; //!< input/output flip-flops group B + uint8_t m_io_c; //!< input/output flip-flops group C devcb_read8 m_iord; //!< input line (read, offset = group, data = 4 bits) devcb_write8 m_iowr; //!< output line (write, offset = group, data = 4 bits) }; diff --git a/src/devices/machine/r10788.cpp b/src/devices/machine/r10788.cpp index f6e9d65ecbf..f3efa531930 100644 --- a/src/devices/machine/r10788.cpp +++ b/src/devices/machine/r10788.cpp @@ -54,7 +54,7 @@ const device_type R10788 = &device_creator; -r10788_device::r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +r10788_device::r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, R10788, "Rockwell 10788", tag, owner, clock, "r10788", __FILE__), m_ktr(0), m_kts(0), m_kla(0), m_klb(0), m_mask_a(15), m_mask_b(15), m_ker(0), m_io_counter(0), m_scan_counter(0), @@ -111,7 +111,7 @@ void r10788_device::device_reset() */ void r10788_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - UINT8 data; + uint8_t data; switch (id) { case TIMER_DISPLAY: @@ -186,7 +186,7 @@ WRITE8_MEMBER( r10788_device::io_w ) READ8_MEMBER( r10788_device::io_r ) { assert(offset < 16); - UINT8 data = 0xf; + uint8_t data = 0xf; switch (offset) { case KTR: // Transfer Keyboard Return diff --git a/src/devices/machine/r10788.h b/src/devices/machine/r10788.h index d7428074abc..0faed89fcd2 100644 --- a/src/devices/machine/r10788.h +++ b/src/devices/machine/r10788.h @@ -30,7 +30,7 @@ class r10788_device : public device_t { public: - r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~r10788_device() {} enum { @@ -57,14 +57,14 @@ protected: private: static const device_timer_id TIMER_DISPLAY = 0; - UINT8 m_reg[2][16]; //!< display registers - UINT8 m_ktr; //!< transfer keyboard return value - UINT8 m_kts; //!< transfer keyboard strobe value - UINT8 m_kla; //!< display register A value - UINT8 m_klb; //!< display register B value - UINT8 m_mask_a; //!< display enable bits for A - UINT8 m_mask_b; //!< display enable bits for B - UINT8 m_ker; //!< keyboard error value + uint8_t m_reg[2][16]; //!< display registers + uint8_t m_ktr; //!< transfer keyboard return value + uint8_t m_kts; //!< transfer keyboard strobe value + uint8_t m_kla; //!< display register A value + uint8_t m_klb; //!< display register B value + uint8_t m_mask_a; //!< display enable bits for A + uint8_t m_mask_b; //!< display enable bits for B + uint8_t m_ker; //!< keyboard error value int m_io_counter; //!< current I/O register index int m_scan_counter; //!< current display scan devcb_write8 m_display; //!< display updater diff --git a/src/devices/machine/ra17xx.cpp b/src/devices/machine/ra17xx.cpp index c1252181c7d..f1e2d77fac0 100644 --- a/src/devices/machine/ra17xx.cpp +++ b/src/devices/machine/ra17xx.cpp @@ -54,7 +54,7 @@ const device_type RA17XX = &device_creator; -ra17xx_device::ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ra17xx_device::ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RA17XX, "Rockwell A17XX", tag, owner, clock, "ra17xx", __FILE__), m_enable(false), m_iord(*this), diff --git a/src/devices/machine/ra17xx.h b/src/devices/machine/ra17xx.h index 0bc1fc991e4..2b98beea94e 100644 --- a/src/devices/machine/ra17xx.h +++ b/src/devices/machine/ra17xx.h @@ -32,7 +32,7 @@ class ra17xx_device : public device_t { public: - ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~ra17xx_device() {} DECLARE_READ8_MEMBER ( io_r ); @@ -46,8 +46,8 @@ protected: virtual void device_reset() override; private: - UINT8 m_line[16]; //!< input/output flip-flops for 16 I/O lines - UINT8 m_bl; //!< value of BL during the most recent output + uint8_t m_line[16]; //!< input/output flip-flops for 16 I/O lines + uint8_t m_bl; //!< value of BL during the most recent output bool m_enable; //!< true if outputs are enabled devcb_read8 m_iord; //!< input line (read, offset = line, data = 0/1) devcb_write8 m_iowr; //!< output line (write, offset = line, data = 0/1) diff --git a/src/devices/machine/ram.cpp b/src/devices/machine/ram.cpp index 66e8b31cf4f..7a0bc2ac08a 100644 --- a/src/devices/machine/ram.cpp +++ b/src/devices/machine/ram.cpp @@ -27,7 +27,7 @@ const device_type RAM = &device_creator; // ram_device - constructor //------------------------------------------------- -ram_device::ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ram_device::ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RAM, "RAM", tag, owner, clock, "ram", __FILE__) { m_size = 0; @@ -73,7 +73,7 @@ void ram_device::device_validity_check(validity_checker &valid) const { const char *ramsize_string = nullptr; int is_valid = FALSE; - UINT32 specified_ram; + uint32_t specified_ram; const char *gamename_option; /* verify default ram value */ @@ -115,7 +115,7 @@ void ram_device::device_validity_check(validity_checker &valid) const /* try to parse each option */ while(p <= e) { - UINT32 option_ram_size = parse_string(p); + uint32_t option_ram_size = parse_string(p); if (option_ram_size == 0) osd_printf_error("Invalid RAM option: %s\n", p); @@ -171,9 +171,9 @@ void ram_device::device_validity_check(validity_checker &valid) const // integer value //------------------------------------------------- -UINT32 ram_device::parse_string(const char *s) +uint32_t ram_device::parse_string(const char *s) { - UINT32 ram; + uint32_t ram; char suffix = '\0'; sscanf(s, "%u%c", &ram, &suffix); @@ -207,7 +207,7 @@ UINT32 ram_device::parse_string(const char *s) // default_size //------------------------------------------------- -UINT32 ram_device::default_size(void) const +uint32_t ram_device::default_size(void) const { return parse_string(m_default_size); } diff --git a/src/devices/machine/ram.h b/src/devices/machine/ram.h index 73a62b61f8d..9cf7a9c2ad0 100644 --- a/src/devices/machine/ram.h +++ b/src/devices/machine/ram.h @@ -51,24 +51,24 @@ class ram_device : public device_t { public: // construction/destruction - ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // accessors - UINT32 size(void) const { return m_size; } - UINT32 mask(void) const { return m_size - 1; } - UINT8 *pointer(void) { return &m_pointer[0]; } - static UINT32 parse_string(const char *s); - UINT32 default_size(void) const; + uint32_t size(void) const { return m_size; } + uint32_t mask(void) const { return m_size - 1; } + uint8_t *pointer(void) { return &m_pointer[0]; } + static uint32_t parse_string(const char *s); + uint32_t default_size(void) const; const char *extra_options(void) const { return m_extra_options; } // read/write - UINT8 read(offs_t offset) { return m_pointer[offset % m_size]; } - void write(offs_t offset, UINT8 data) { m_pointer[offset % m_size] = data; } + uint8_t read(offs_t offset) { return m_pointer[offset % m_size]; } + void write(offs_t offset, uint8_t data) { m_pointer[offset % m_size] = data; } // inline configuration helpers static void static_set_default_size(device_t &device, const char *default_size) { downcast(device).m_default_size = default_size; } static void static_set_extra_options(device_t &device, const char *extra_options) { downcast(device).m_extra_options = extra_options; } - static void static_set_default_value(device_t &device, UINT8 default_value) { downcast(device).m_default_value = default_value; } + static void static_set_default_value(device_t &device, uint8_t default_value) { downcast(device).m_default_value = default_value; } protected: virtual void device_start(void) override; @@ -76,13 +76,13 @@ protected: private: // device state - UINT32 m_size; - std::vector m_pointer; + uint32_t m_size; + std::vector m_pointer; // device config const char *m_default_size; const char *m_extra_options; - UINT8 m_default_value; + uint8_t m_default_value; }; diff --git a/src/devices/machine/rf5c296.cpp b/src/devices/machine/rf5c296.cpp index f2da08685ab..80cd19d4a40 100644 --- a/src/devices/machine/rf5c296.cpp +++ b/src/devices/machine/rf5c296.cpp @@ -6,7 +6,7 @@ const device_type RF5C296 = &device_creator; -rf5c296_device::rf5c296_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +rf5c296_device::rf5c296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCCARD_SLOT, "PCCARD SLOT", tag, owner, clock, "pccard", __FILE__), m_rf5c296_reg(0), m_pccard(nullptr), m_pccard_name(nullptr) { } @@ -16,7 +16,7 @@ void rf5c296_device::device_start() m_pccard = machine().device(m_pccard_name); } -void rf5c296_device::reg_w(ATTR_UNUSED UINT8 reg, UINT8 data) +void rf5c296_device::reg_w(ATTR_UNUSED uint8_t reg, uint8_t data) { // fprintf(stderr, "rf5c296_reg_w %02x, %02x (%s)\n", reg, data, machine().describe_context()); switch (reg) @@ -35,7 +35,7 @@ void rf5c296_device::reg_w(ATTR_UNUSED UINT8 reg, UINT8 data) } } -UINT8 rf5c296_device::reg_r(ATTR_UNUSED UINT8 reg) +uint8_t rf5c296_device::reg_r(ATTR_UNUSED uint8_t reg) { // fprintf(stderr, "rf5c296_reg_r %02x (%s)\n", reg, machine().describe_context()); return 0x00; @@ -80,7 +80,7 @@ READ16_MEMBER(rf5c296_device::io_r) offset++; } - UINT16 data; + uint16_t data; switch( offset ) { diff --git a/src/devices/machine/rf5c296.h b/src/devices/machine/rf5c296.h index faab5e738fb..2f9037b240c 100644 --- a/src/devices/machine/rf5c296.h +++ b/src/devices/machine/rf5c296.h @@ -13,7 +13,7 @@ class rf5c296_device : public device_t { public: - rf5c296_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rf5c296_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers static void set_pccard_name(device_t &device, const char *name) { downcast(device).m_pccard_name = name; } @@ -28,8 +28,8 @@ protected: virtual void device_start() override; private: - void reg_w(ATTR_UNUSED UINT8 reg, UINT8 data); - UINT8 reg_r(ATTR_UNUSED UINT8 reg); + void reg_w(ATTR_UNUSED uint8_t reg, uint8_t data); + uint8_t reg_r(ATTR_UNUSED uint8_t reg); unsigned char m_rf5c296_reg; pccard_slot_device *m_pccard; diff --git a/src/devices/machine/roc10937.cpp b/src/devices/machine/roc10937.cpp index c932002e310..009e5109bbc 100644 --- a/src/devices/machine/roc10937.cpp +++ b/src/devices/machine/roc10937.cpp @@ -33,7 +33,7 @@ we actually have 18 segments, including the semicolon portions. 16-bit tables are used to hold the main characters, the rest are OR'd in */ -static const UINT16 roc10937charset[]= +static const uint16_t roc10937charset[]= { // FEDC BA98 7654 3210 0x507F, // 0101 0000 0111 1111 @. 0x44CF, // 0100 0100 1100 1111 A. @@ -125,7 +125,7 @@ static const int roc10937poslut[]= 0//15 }; -rocvfd_t::rocvfd_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) : +rocvfd_t::rocvfd_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) { m_port_val=0; @@ -178,7 +178,7 @@ void rocvfd_t::device_reset() } /////////////////////////////////////////////////////////////////////////// -UINT32 rocvfd_t::set_display(UINT32 segin) +uint32_t rocvfd_t::set_display(uint32_t segin) { return BITSWAP32(segin, 31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,11,9,15,13,12,8,10,14,7,6,5,4,3,2,1,0); @@ -246,7 +246,7 @@ void rocvfd_t::shift_clock(int state) /////////////////////////////////////////////////////////////////////////// const device_type ROC10937 = &device_creator; -roc10937_t::roc10937_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +roc10937_t::roc10937_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : rocvfd_t(mconfig, ROC10937, "Rockwell 10937 VFD controller and compatible", tag, owner, clock, "roc10937", __FILE__) { m_port_val=0; @@ -254,7 +254,7 @@ roc10937_t::roc10937_t(const machine_config &mconfig, const char *tag, device_t const device_type MSC1937 = &device_creator; -msc1937_t::msc1937_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msc1937_t::msc1937_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : rocvfd_t(mconfig, MSC1937, "OKI MSC1937 VFD controller", tag, owner, clock, "msc1937", __FILE__) { m_port_val=0; @@ -262,7 +262,7 @@ msc1937_t::msc1937_t(const machine_config &mconfig, const char *tag, device_t *o const device_type MIC10937 = &device_creator; -mic10937_t::mic10937_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mic10937_t::mic10937_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : rocvfd_t(mconfig, MIC10937, "Micrel MIC10937 VFD controller", tag, owner, clock, "mic10937", __FILE__) { m_port_val=0; @@ -270,7 +270,7 @@ mic10937_t::mic10937_t(const machine_config &mconfig, const char *tag, device_t const device_type S16LF01 = &device_creator; -s16lf01_t::s16lf01_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s16lf01_t::s16lf01_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : rocvfd_t(mconfig, S16LF01, "Samsung 16LF01 Series VFD controller and compatible", tag, owner, clock, "s16lf01", __FILE__) { m_port_val=0; @@ -329,7 +329,7 @@ void rocvfd_t::write_char(int data) const device_type ROC10957 = &device_creator; -roc10957_t::roc10957_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +roc10957_t::roc10957_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : rocvfd_t(mconfig, ROC10957, "Rockwell 10957 VFD controller and compatible", tag, owner, clock, "roc10957", __FILE__) { m_port_val=0; diff --git a/src/devices/machine/roc10937.h b/src/devices/machine/roc10937.h index 403b1bc98de..5a0b19bc5a3 100644 --- a/src/devices/machine/roc10937.h +++ b/src/devices/machine/roc10937.h @@ -59,15 +59,15 @@ class rocvfd_t : public device_t { public: - rocvfd_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); + rocvfd_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); // inline configuration helpers static void static_set_value(device_t &device, int val); virtual void update_display(); - UINT8 m_port_val; + uint8_t m_port_val; void shift_clock(int data); void write_char(int data); - UINT32 set_display(UINT32 segin); + uint32_t set_display(uint32_t segin); DECLARE_WRITE_LINE_MEMBER( sclk ); DECLARE_WRITE_LINE_MEMBER( data ); DECLARE_WRITE_LINE_MEMBER( por ); @@ -85,9 +85,9 @@ protected: int m_duty; int m_disp; int m_sclk; - UINT8 m_cursor; - UINT32 m_chars[16]; - UINT32 m_outputs[16]; + uint8_t m_cursor; + uint32_t m_chars[16]; + uint32_t m_outputs[16]; virtual void device_start() override; virtual void device_reset() override; @@ -97,29 +97,29 @@ protected: class roc10937_t : public rocvfd_t { public: - roc10937_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + roc10937_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class msc1937_t : public rocvfd_t { public: - msc1937_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msc1937_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mic10937_t : public rocvfd_t { public: - mic10937_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mic10937_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class roc10957_t : public rocvfd_t { public: - roc10957_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + roc10957_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void write_char(int data); }; class s16lf01_t : public rocvfd_t { public: - s16lf01_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s16lf01_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type ROC10937; diff --git a/src/devices/machine/rp5c01.cpp b/src/devices/machine/rp5c01.cpp index b2280909fa5..24095b763a5 100644 --- a/src/devices/machine/rp5c01.cpp +++ b/src/devices/machine/rp5c01.cpp @@ -167,7 +167,7 @@ inline void rp5c01_device::check_alarm() // rp5c01_device - constructor //------------------------------------------------- -rp5c01_device::rp5c01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rp5c01_device::rp5c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RP5C01, "RP5C01", tag, owner, clock, "rp5c01", __FILE__), device_rtc_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -305,7 +305,7 @@ void rp5c01_device::nvram_write(emu_file &file) READ8_MEMBER( rp5c01_device::read ) { - UINT8 data = 0; + uint8_t data = 0; offset &= 0x0f; switch (offset) diff --git a/src/devices/machine/rp5c01.h b/src/devices/machine/rp5c01.h index 0043cc19b6c..72b603cb2ad 100644 --- a/src/devices/machine/rp5c01.h +++ b/src/devices/machine/rp5c01.h @@ -52,7 +52,7 @@ class rp5c01_device : public device_t, { public: // construction/destruction - rp5c01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rp5c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_alarm_callback(device_t &device, _Object object) { return downcast(device).m_out_alarm_cb.set_callback(object); } static void remove_battery(device_t &device) { downcast(device).m_battery_backed = false; } @@ -89,11 +89,11 @@ private: devcb_write_line m_out_alarm_cb; bool m_battery_backed; - UINT8 m_reg[2][13]; // clock registers - UINT8 m_ram[13]; // RAM + uint8_t m_reg[2][13]; // clock registers + uint8_t m_ram[13]; // RAM - UINT8 m_mode; // mode register - UINT8 m_reset; // reset register + uint8_t m_mode; // mode register + uint8_t m_reset; // reset register int m_alarm; // alarm output int m_alarm_on; // alarm condition int m_1hz; // 1 Hz condition diff --git a/src/devices/machine/rp5c15.cpp b/src/devices/machine/rp5c15.cpp index 88989b41d7c..415ef887771 100644 --- a/src/devices/machine/rp5c15.cpp +++ b/src/devices/machine/rp5c15.cpp @@ -182,7 +182,7 @@ inline void rp5c15_device::check_alarm() // rp5c15_device - constructor //------------------------------------------------- -rp5c15_device::rp5c15_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rp5c15_device::rp5c15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RP5C15, "RP5C15", tag, owner, clock, "rp5c15", __FILE__), device_rtc_interface(mconfig, *this), m_out_alarm_cb(*this), @@ -294,7 +294,7 @@ void rp5c15_device::rtc_clock_updated(int year, int month, int day, int day_of_w READ8_MEMBER( rp5c15_device::read ) { - UINT8 data = 0; + uint8_t data = 0; offset &= 0x0f; switch (offset) diff --git a/src/devices/machine/rp5c15.h b/src/devices/machine/rp5c15.h index 4a10eaeae3c..2838c44aacb 100644 --- a/src/devices/machine/rp5c15.h +++ b/src/devices/machine/rp5c15.h @@ -49,7 +49,7 @@ class rp5c15_device : public device_t, { public: // construction/destruction - rp5c15_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rp5c15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_alarm_callback(device_t &device, _Object object) { return downcast(device).m_out_alarm_cb.set_callback(object); } template static devcb_base &set_out_clkout_callback(device_t &device, _Object object) { return downcast(device).m_out_clkout_cb.set_callback(object); } @@ -79,11 +79,11 @@ private: devcb_write_line m_out_alarm_cb; devcb_write_line m_out_clkout_cb; - UINT8 m_reg[2][13]; // clock registers - UINT8 m_ram[13]; // RAM + uint8_t m_reg[2][13]; // clock registers + uint8_t m_ram[13]; // RAM - UINT8 m_mode; // mode register - UINT8 m_reset; // reset register + uint8_t m_mode; // mode register + uint8_t m_reset; // reset register int m_alarm; // alarm output int m_alarm_on; // alarm condition int m_1hz; // 1 Hz condition diff --git a/src/devices/machine/rp5h01.cpp b/src/devices/machine/rp5h01.cpp index 033e2b18f4c..4ea067a88c6 100644 --- a/src/devices/machine/rp5h01.cpp +++ b/src/devices/machine/rp5h01.cpp @@ -20,7 +20,7 @@ #include "machine/rp5h01.h" // this is the contents of an unprogrammed PROM -UINT8 const rp5h01_device::s_initial_data[0x10] = +uint8_t const rp5h01_device::s_initial_data[0x10] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00 @@ -32,7 +32,7 @@ UINT8 const rp5h01_device::s_initial_data[0x10] = const device_type RP5H01 = &device_creator; -rp5h01_device::rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rp5h01_device::rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RP5H01, "RP5H01 6/7-bit Counter", tag, owner, clock, "rp5h01", __FILE__) , m_data(nullptr) , m_rom(*this, DEVICE_SELF, 0x10) diff --git a/src/devices/machine/rp5h01.h b/src/devices/machine/rp5h01.h index e1810b181ff..25d3e97853c 100644 --- a/src/devices/machine/rp5h01.h +++ b/src/devices/machine/rp5h01.h @@ -37,7 +37,7 @@ enum { class rp5h01_device : public device_t { public: - rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( enable_w ); /* /CE */ DECLARE_WRITE_LINE_MEMBER( reset_w ); /* RESET */ @@ -54,7 +54,7 @@ protected: virtual void device_reset() override; private: - static UINT8 const s_initial_data[0x10]; + static uint8_t const s_initial_data[0x10]; // internal state int m_counter; @@ -62,8 +62,8 @@ private: int m_enabled; /* chip enable */ int m_old_reset; /* reset pin state (level-triggered) */ int m_old_clock; /* clock pin state (level-triggered) */ - UINT8 const *m_data; - optional_region_ptr m_rom; + uint8_t const *m_data; + optional_region_ptr m_rom; }; extern const device_type RP5H01; diff --git a/src/devices/machine/rtc4543.cpp b/src/devices/machine/rtc4543.cpp index 619ae57ad4a..ee9fb86e800 100644 --- a/src/devices/machine/rtc4543.cpp +++ b/src/devices/machine/rtc4543.cpp @@ -46,14 +46,14 @@ const device_type RTC4543 = &device_creator; // rtc4543_device - constructor //------------------------------------------------- -rtc4543_device::rtc4543_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rtc4543_device::rtc4543_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RTC4543, "R4543 RTC", tag, owner, clock, "rtc4543", __FILE__), device_rtc_interface(mconfig, *this), data_cb(*this), m_ce(0), m_clk(0), m_wr(0), m_data(0), m_curbit(0), m_clock_timer(nullptr) { } -rtc4543_device::rtc4543_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *filename) +rtc4543_device::rtc4543_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 *filename) : device_t(mconfig, type, name, tag, owner, clock, shortname, filename), device_rtc_interface(mconfig, *this), data_cb(*this), m_ce(0), m_clk(0), m_wr(0), m_data(0), m_curbit(0), m_clock_timer(nullptr) @@ -353,7 +353,7 @@ const device_type JRC6355E = &device_creator; // jrc6355e_device - constructor //------------------------------------------------- -jrc6355e_device::jrc6355e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +jrc6355e_device::jrc6355e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : rtc4543_device(mconfig, JRC6355E, "JRC 6355E RTC", tag, owner, clock, "jrc6355e", __FILE__) { } diff --git a/src/devices/machine/rtc4543.h b/src/devices/machine/rtc4543.h index 9a252424eb2..b8fda782cf2 100644 --- a/src/devices/machine/rtc4543.h +++ b/src/devices/machine/rtc4543.h @@ -45,8 +45,8 @@ class rtc4543_device : public device_t, public: // construction/destruction - rtc4543_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - rtc4543_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *filename); + rtc4543_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + rtc4543_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 *filename); DECLARE_WRITE_LINE_MEMBER( ce_w ); DECLARE_WRITE_LINE_MEMBER( wr_w ); @@ -97,7 +97,7 @@ class jrc6355e_device : public rtc4543_device { public: // construction/destruction - jrc6355e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + jrc6355e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // rtc4543 overrides diff --git a/src/devices/machine/rtc65271.cpp b/src/devices/machine/rtc65271.cpp index 0c02e4fb176..23367bc7386 100644 --- a/src/devices/machine/rtc65271.cpp +++ b/src/devices/machine/rtc65271.cpp @@ -95,18 +95,18 @@ static const int SQW_freq_table[16] = */ /* - Increment a binary-encoded UINT8 + Increment a binary-encoded uint8_t */ -static UINT8 increment_binary(UINT8 data) +static uint8_t increment_binary(uint8_t data) { return data+1; } /* - Increment a BCD-encoded UINT8 + Increment a BCD-encoded uint8_t */ -static UINT8 increment_BCD(UINT8 data) +static uint8_t increment_BCD(uint8_t data) { if ((data & 0x0f) < 0x09) { @@ -127,9 +127,9 @@ static UINT8 increment_BCD(UINT8 data) /* - Convert a binary-encoded UINT8 to BCD + Convert a binary-encoded uint8_t to BCD */ -static UINT8 binary_to_BCD(UINT8 data) +static uint8_t binary_to_BCD(uint8_t data) { data %= 100; @@ -138,9 +138,9 @@ static UINT8 binary_to_BCD(UINT8 data) /* - Convert a BCD-encoded UINT8 to binary + Convert a BCD-encoded uint8_t to binary */ -static UINT8 BCD_to_binary(UINT8 data) +static uint8_t BCD_to_binary(uint8_t data) { if ((data & 0x0f) >= 0x0a) data = data - 0x0a + 0x10; @@ -175,7 +175,7 @@ void rtc65271_device::nvram_default() void rtc65271_device::nvram_read(emu_file &file) { - UINT8 buf; + uint8_t buf; /* version flag */ if (file.read(&buf, 1) != 1) @@ -261,7 +261,7 @@ void rtc65271_device::nvram_read(emu_file &file) void rtc65271_device::nvram_write(emu_file &file) { - UINT8 buf; + uint8_t buf; /* version flag */ @@ -300,7 +300,7 @@ void rtc65271_device::nvram_write(emu_file &file) xramsel: select RTC register if 0, XRAM if 1 offset: address (A0-A5 pins) */ -UINT8 rtc65271_device::read(int xramsel, offs_t offset) +uint8_t rtc65271_device::read(int xramsel, offs_t offset) { int reply; @@ -362,7 +362,7 @@ READ8_MEMBER( rtc65271_device::xram_r ) xramsel: select RTC register if 0, XRAM if 1 offset: address (A0-A5 pins) */ -void rtc65271_device::write(int xramsel, offs_t offset, UINT8 data) +void rtc65271_device::write(int xramsel, offs_t offset, uint8_t data) { if (xramsel) { @@ -508,7 +508,7 @@ TIMER_CALLBACK_MEMBER(rtc65271_device::rtc_end_update_cb) 31,28,31, 30,31,30, 31,31,30, 31,30,31 }; - UINT8 (*increment)(UINT8 data); + uint8_t (*increment)(uint8_t data); int c59, c23, c12, c11, c29; if (! (m_regs[reg_A] & reg_A_UIP)) @@ -652,7 +652,7 @@ const device_type RTC65271 = &device_creator; // rtc65271_device - constructor //------------------------------------------------- -rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RTC65271, "RTC-65271", tag, owner, clock, "rtc65271", __FILE__), device_nvram_interface(mconfig, *this), m_interrupt_cb(*this) diff --git a/src/devices/machine/rtc65271.h b/src/devices/machine/rtc65271.h index eb97ef6a778..961251f53b8 100644 --- a/src/devices/machine/rtc65271.h +++ b/src/devices/machine/rtc65271.h @@ -22,7 +22,7 @@ class rtc65271_device : public device_t, { public: // construction/destruction - rtc65271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rtc65271_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -39,8 +39,8 @@ public: DECLARE_WRITE8_MEMBER( rtc_w ); DECLARE_WRITE8_MEMBER( xram_w ); private: - UINT8 read(int xramsel, offs_t offset); - void write(int xramsel, offs_t offset, UINT8 data); + uint8_t read(int xramsel, offs_t offset); + void write(int xramsel, offs_t offset, uint8_t data); void field_interrupts(); TIMER_CALLBACK_MEMBER(rtc_SQW_cb); @@ -48,19 +48,19 @@ private: TIMER_CALLBACK_MEMBER(rtc_end_update_cb); /* 64 8-bit registers (10 clock registers, 4 control/status registers, and 50 bytes of user RAM) */ - UINT8 m_regs[64]; - UINT8 m_cur_reg; + uint8_t m_regs[64]; + uint8_t m_cur_reg; /* extended RAM: 4kbytes of battery-backed RAM (in pages of 32 bytes) */ - UINT8 m_xram[4096]; - UINT8 m_cur_xram_page; + uint8_t m_xram[4096]; + uint8_t m_cur_xram_page; /* update timer: called every second */ emu_timer *m_update_timer; /* SQW timer: called every periodic clock half-period */ emu_timer *m_SQW_timer; - UINT8 m_SQW_internal_state; + uint8_t m_SQW_internal_state; /* callback called when interrupt pin state changes (may be nullptr) */ devcb_write_line m_interrupt_cb; diff --git a/src/devices/machine/rtc9701.cpp b/src/devices/machine/rtc9701.cpp index 5023df7ec31..8a2bbc8915e 100644 --- a/src/devices/machine/rtc9701.cpp +++ b/src/devices/machine/rtc9701.cpp @@ -34,7 +34,7 @@ const device_type rtc9701 = &device_creator; // rtc9701_device - constructor //------------------------------------------------- -rtc9701_device::rtc9701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rtc9701_device::rtc9701_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, rtc9701, "RTC-9701", tag, owner, clock, "rtc9701", __FILE__), device_nvram_interface(mconfig, *this), m_latch(0), @@ -45,7 +45,7 @@ rtc9701_device::rtc9701_device(const machine_config &mconfig, const char *tag, d TIMER_CALLBACK_MEMBER(rtc9701_device::timer_callback) { - 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 }; int dpm_count; m_rtc.sec++; @@ -177,9 +177,9 @@ void rtc9701_device::nvram_write(emu_file &file) // rtc_read - used to route RTC reading registers //------------------------------------------------- -inline UINT8 rtc9701_device::rtc_read(UINT8 offset) +inline uint8_t rtc9701_device::rtc_read(uint8_t offset) { - UINT8 res; + uint8_t res; res = 0; @@ -198,7 +198,7 @@ inline UINT8 rtc9701_device::rtc_read(UINT8 offset) return res; } -inline void rtc9701_device::rtc_write(UINT8 offset,UINT8 data) +inline void rtc9701_device::rtc_write(uint8_t offset,uint8_t data) { switch(offset) { diff --git a/src/devices/machine/rtc9701.h b/src/devices/machine/rtc9701.h index c294cb5d9f1..450c0c7c789 100644 --- a/src/devices/machine/rtc9701.h +++ b/src/devices/machine/rtc9701.h @@ -40,7 +40,7 @@ enum rtc9701_state_t struct rtc_regs_t { - UINT8 sec, min, hour, day, wday, month, year; + uint8_t sec, min, hour, day, wday, month, year; }; @@ -51,7 +51,7 @@ class rtc9701_device : public device_t, { public: // construction/destruction - rtc9701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rtc9701_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations @@ -71,8 +71,8 @@ protected: virtual void nvram_default() override; virtual void nvram_read(emu_file &file) override; virtual void nvram_write(emu_file &file) override; - inline UINT8 rtc_read(UINT8 offset); - inline void rtc_write(UINT8 offset,UINT8 data); + inline uint8_t rtc_read(uint8_t offset); + inline void rtc_write(uint8_t offset,uint8_t data); int m_latch; int m_reset_line; @@ -86,10 +86,10 @@ protected: int rtc9701_address_pos; int rtc9701_current_address; - UINT16 rtc9701_current_data; + uint16_t rtc9701_current_data; int rtc9701_data_pos; - UINT16 rtc9701_data[0x100]; + uint16_t rtc9701_data[0x100]; rtc_regs_t m_rtc; }; diff --git a/src/devices/machine/s2636.cpp b/src/devices/machine/s2636.cpp index 9946114fe57..569f9d12599 100644 --- a/src/devices/machine/s2636.cpp +++ b/src/devices/machine/s2636.cpp @@ -127,7 +127,7 @@ int const s2636_device::OFFS_OBJ[s2636_device::OBJ_COUNT] = { 0x000, 0x010, 0x02 int const s2636_device::SCORE_START_X[2][s2636_device::SCORE_DIGITS] { { 48, 64, 96, 112 }, { 48, 64, 80, 96 } }; int const s2636_device::SCORE_START_Y[2] = { 20, 200 }; -UINT16 const s2636_device::SCORE_FONT[16][5] = +uint16_t const s2636_device::SCORE_FONT[16][5] = { { 0x0fff, 0x0f0f, 0x0f0f, 0x0f0f, 0x0fff }, { 0x0f00, 0x0f00, 0x0f00, 0x0f00, 0x0f00 }, @@ -155,7 +155,7 @@ UINT16 const s2636_device::SCORE_FONT[16][5] = const device_type S2636 = &device_creator; -s2636_device::s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s2636_device::s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S2636, "Signetics 2636", tag, owner, clock, "s2636", __FILE__) , device_video_interface(mconfig, *this) , device_sound_interface(mconfig, *this) @@ -245,7 +245,7 @@ void s2636_device::render_next_line() // pre-clear the line for convenience rectangle const &vis_area = m_screen->visible_area(); - UINT16 *const row = &m_bitmap.pix16(m_screen_line); + uint16_t *const row = &m_bitmap.pix16(m_screen_line); m_bitmap.plot_box(0, m_screen_line, m_bitmap.width(), 1, 0); if ((vis_area.min_y > m_screen_line) || (vis_area.max_y < m_screen_line)) @@ -296,8 +296,8 @@ void s2636_device::render_next_line() m_obj_cnt[i] -= obj_inc; // fetch appropriate line from object - UINT8 const obj_bits = m_registers[OFFS_OBJ[i] + OBJ_HEIGHT - 1 - (m_obj_cnt[i] >> 3)]; - UINT16 const obj_clr = object_color(i) | 0x08 | (0x10 << i); + uint8_t const obj_bits = m_registers[OFFS_OBJ[i] + OBJ_HEIGHT - 1 - (m_obj_cnt[i] >> 3)]; + uint16_t const obj_clr = object_color(i) | 0x08 | (0x10 << i); // blit it to the line ignoring intermediate pixels int const obj_h_cnt = m_registers[OFFS_OBJ[i] + (m_obj_dup[i] ? OFFS_HCB : OFFS_HC)] + m_x_offset; @@ -327,14 +327,14 @@ void s2636_device::render_next_line() } // let's take a look at the score display - UINT16 const bg_clr = m_registers[REG_BG_ENB_CLR] & 0x07; + uint16_t const bg_clr = m_registers[REG_BG_ENB_CLR] & 0x07; int const score_row = m_vis_line - m_y_offset - SCORE_START_Y[m_registers[REG_SCORE_FMT] & 0x01]; if ((0 <= score_row) && (SCORE_HEIGHT > score_row)) { int const (&score_start_x)[SCORE_DIGITS] = SCORE_START_X[(m_registers[REG_SCORE_FMT] >> 1) & 0x01]; for (int i = 0; i < SCORE_DIGITS; i++) { - UINT16 score_bits = SCORE_FONT[score_digit(i)][score_row >> 2]; + uint16_t score_bits = SCORE_FONT[score_digit(i)][score_row >> 2]; int screen_col = vis_area.min_x + ((score_start_x[i] + m_x_offset) * m_divider); while (score_bits && (vis_area.max_x >= screen_col)) { @@ -351,11 +351,11 @@ void s2636_device::render_next_line() bool const bg_draw = bg_enable && (0 <= bg_row) && (BG_HEIGHT > bg_row); int const bg_vbar_offs = OFFS_VBAR_DEF + ((bg_row / 20) << 2) + (((bg_row % 20) >= 2) ? 2 : 0); int const bg_hbar_offs = OFFS_HBAR_DEF + (bg_row / 40); - UINT16 const bg_vbar_bits = (UINT16(m_registers[bg_vbar_offs]) << 8) | UINT16(m_registers[bg_vbar_offs + 1]); - UINT8 const bg_hbar_bits = m_registers[bg_hbar_offs]; + uint16_t const bg_vbar_bits = (uint16_t(m_registers[bg_vbar_offs]) << 8) | uint16_t(m_registers[bg_vbar_offs + 1]); + uint8_t const bg_hbar_bits = m_registers[bg_hbar_offs]; bool const bg_hbar_stretch = bool(bg_hbar_bits & (1 << ((((bg_row % 40) >= 20) ? 3 : 0) + (((bg_row % 20) >= 11) ? 2 : ((bg_row % 20) >= 2) ? 1 : 0)))); int const bg_hbar_width = bg_hbar_stretch ? 8 : (0xc0 == (bg_hbar_bits & 0xc0)) ? 4 : (0x40 == (bg_hbar_bits & 0xc0)) ? 2 : 1; - UINT16 const scrn_clr = bg_enable ? ((m_registers[REG_BG_ENB_CLR] >> 4) & 0x07) : 0x00; + uint16_t const scrn_clr = bg_enable ? ((m_registers[REG_BG_ENB_CLR] >> 4) & 0x07) : 0x00; for (int screen_col = vis_area.min_x, x = 0; vis_area.max_x >= screen_col; x++) { @@ -406,7 +406,7 @@ void s2636_device::render_next_line() READ8_MEMBER( s2636_device::read_data ) { mask_offset(offset); - UINT8 data = m_registers[offset]; + uint8_t data = m_registers[offset]; // TODO: some locations are not readable, should return some garbage diff --git a/src/devices/machine/s2636.h b/src/devices/machine/s2636.h index 2a22aa323d7..ce46ee4581d 100644 --- a/src/devices/machine/s2636.h +++ b/src/devices/machine/s2636.h @@ -41,7 +41,7 @@ class s2636_device : public device_t, public device_sound_interface { public: - s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~s2636_device() {} static void set_offsets(device_t &device, int y_offset, int x_offset) @@ -130,16 +130,16 @@ private: static int const OFFS_OBJ[OBJ_COUNT]; - static UINT16 const SCORE_FONT[16][5]; + static uint16_t const SCORE_FONT[16][5]; static int const SCORE_START_X[2][SCORE_DIGITS]; static int const SCORE_START_Y[2]; static void mask_offset(offs_t &offset) { offset &= ((offset & 0x0c0) == 0x0c0) ? 0x0cf : 0x0ff; } - UINT8 object_scale(int obj) const { return (m_registers[REG_OBJ_SIZE] >> (2 * obj)) & 0x03; } - UINT8 object_color(int obj) const { return (m_registers[REG_OBJ_CLR_1_2 + (obj >> 1)] >> ((obj & 1) ? 0 : 3)) & 0x07; } - UINT8 score_digit(int digit) const { return (m_registers[REG_SCORE_1_2 + (digit >> 1)] >> ((digit & 1) ? 0 : 4)) & 0x0f; } + uint8_t object_scale(int obj) const { return (m_registers[REG_OBJ_SIZE] >> (2 * obj)) & 0x03; } + uint8_t object_color(int obj) const { return (m_registers[REG_OBJ_CLR_1_2 + (obj >> 1)] >> ((obj & 1) ? 0 : 3)) & 0x07; } + uint8_t score_digit(int digit) const { return (m_registers[REG_SCORE_1_2 + (digit >> 1)] >> ((digit & 1) ? 0 : 4)) & 0x0f; } void update_intreq(int value); @@ -153,7 +153,7 @@ private: bitmap_ind16 m_bitmap; // 256-byte register file (not all of this really exists) - UINT8 m_registers[0x100]; + uint8_t m_registers[0x100]; // tracking where we're up to in the screen update bool m_vrst; diff --git a/src/devices/machine/s3520cf.cpp b/src/devices/machine/s3520cf.cpp index e504e5b9022..f0f80d4c7fa 100644 --- a/src/devices/machine/s3520cf.cpp +++ b/src/devices/machine/s3520cf.cpp @@ -35,14 +35,14 @@ const device_type S3520CF = &device_creator; // s3520cf_device - constructor //------------------------------------------------- -s3520cf_device::s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s3520cf_device::s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S3520CF, "S-3520CF RTC", tag, owner, clock, "s3520cf", __FILE__), m_dir(0), m_latch(0), m_reset_line(0), m_read_latch(0), m_current_cmd(0), m_cmd_stream_pos(0), m_rtc_addr(0), m_mode(0), m_sysr(0), m_rtc_state() { } TIMER_CALLBACK_MEMBER(s3520cf_device::timer_callback) { - 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 }; int dpm_count; m_rtc.sec++; @@ -117,9 +117,9 @@ void s3520cf_device::device_reset() // rtc_read - used to route RTC reading registers //------------------------------------------------- -inline UINT8 s3520cf_device::rtc_read(UINT8 offset) +inline uint8_t s3520cf_device::rtc_read(uint8_t offset) { - UINT8 res; + uint8_t res; res = 0; @@ -156,7 +156,7 @@ inline UINT8 s3520cf_device::rtc_read(UINT8 offset) return res; } -inline void s3520cf_device::rtc_write(UINT8 offset,UINT8 data) +inline void s3520cf_device::rtc_write(uint8_t offset,uint8_t data) { if(offset == 0xf) { diff --git a/src/devices/machine/s3520cf.h b/src/devices/machine/s3520cf.h index b2b3fa452a6..beeea5d6cf0 100644 --- a/src/devices/machine/s3520cf.h +++ b/src/devices/machine/s3520cf.h @@ -32,7 +32,7 @@ enum s3520cf_state_t struct rtc_regs_t { - UINT8 sec, min, hour, day, wday, month, year; + uint8_t sec, min, hour, day, wday, month, year; }; @@ -42,7 +42,7 @@ class s3520cf_device : public device_t { public: // construction/destruction - s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_READ_LINE_MEMBER( read_bit ); @@ -57,17 +57,17 @@ protected: virtual void device_validity_check(validity_checker &valid) const override; virtual void device_start() override; virtual void device_reset() override; - inline UINT8 rtc_read(UINT8 offset); - inline void rtc_write(UINT8 offset,UINT8 data); + inline uint8_t rtc_read(uint8_t offset); + inline void rtc_write(uint8_t offset,uint8_t data); int m_dir; int m_latch; int m_reset_line; int m_read_latch; - UINT8 m_current_cmd; - UINT8 m_cmd_stream_pos; - UINT8 m_rtc_addr; - UINT8 m_mode, m_sysr; + uint8_t m_current_cmd; + uint8_t m_cmd_stream_pos; + uint8_t m_rtc_addr; + uint8_t m_mode, m_sysr; s3520cf_state_t m_rtc_state; rtc_regs_t m_rtc; diff --git a/src/devices/machine/s3c2400.cpp b/src/devices/machine/s3c2400.cpp index 8b9d4da016c..361410acf5c 100644 --- a/src/devices/machine/s3c2400.cpp +++ b/src/devices/machine/s3c2400.cpp @@ -33,14 +33,14 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, c #include "machine/s3c24xx.hxx" #undef DEVICE_S3C2400 -UINT32 s3c2400_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t s3c2400_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return s3c24xx_video_update(screen, bitmap, cliprect); } const device_type S3C2400 = &device_creator; -s3c2400_device::s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s3c2400_device::s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S3C2400, "Samsung S3C2400", tag, owner, clock, "s3c2400", __FILE__), m_palette(*this, finder_base::DUMMY_TAG), m_cpu(*this, ":maincpu"), @@ -133,7 +133,7 @@ void s3c2400_device::device_reset() s3c24xx_device_reset(); } -void s3c2400_device::s3c2400_uart_fifo_w(int uart, UINT8 data) +void s3c2400_device::s3c2400_uart_fifo_w(int uart, uint8_t data) { s3c24xx_uart_fifo_w(uart, data); } diff --git a/src/devices/machine/s3c2400.h b/src/devices/machine/s3c2400.h index fbd2e5e70d4..c1625d095fc 100644 --- a/src/devices/machine/s3c2400.h +++ b/src/devices/machine/s3c2400.h @@ -352,7 +352,7 @@ enum class s3c2400_device : public device_t { public: - s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~s3c2400_device(); // static configuration @@ -375,22 +375,22 @@ private: // internal state required_device m_palette; public: - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void s3c24xx_reset(); inline int iface_core_pin_r(int pin); void s3c24xx_lcd_reset(); - rgb_t s3c24xx_get_color_tft_16(UINT16 data); - rgb_t s3c24xx_get_color_stn_12(UINT16 data); - rgb_t s3c24xx_get_color_stn_08( UINT8 data); - rgb_t s3c24xx_get_color_stn_01(UINT8 data); - rgb_t s3c24xx_get_color_stn_02(UINT8 data); - rgb_t s3c24xx_get_color_stn_04(UINT8 data); + rgb_t s3c24xx_get_color_tft_16(uint16_t data); + rgb_t s3c24xx_get_color_stn_12(uint16_t data); + rgb_t s3c24xx_get_color_stn_08( uint8_t data); + rgb_t s3c24xx_get_color_stn_01(uint8_t data); + rgb_t s3c24xx_get_color_stn_02(uint8_t data); + rgb_t s3c24xx_get_color_stn_04(uint8_t data); rgb_t s3c24xx_get_color_tpal(); void s3c24xx_lcd_dma_reload(); void s3c24xx_lcd_dma_init(); - UINT32 s3c24xx_lcd_dma_read(); - UINT32 s3c24xx_lcd_dma_read_bits(int count); + uint32_t s3c24xx_lcd_dma_read(); + uint32_t s3c24xx_lcd_dma_read_bits(int count); void s3c24xx_lcd_render_tpal(); void s3c24xx_lcd_render_stn_01(); void s3c24xx_lcd_render_stn_02(); @@ -406,7 +406,7 @@ public: TIMER_CALLBACK_MEMBER( s3c24xx_lcd_timer_exp ); void s3c24xx_video_start(); void bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bitmap_src_1, bitmap_rgb32 &bitmap_src_2); - UINT32 s3c24xx_video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t s3c24xx_video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); READ32_MEMBER( s3c24xx_lcd_r ); int s3c24xx_lcd_configure_tft(); int s3c24xx_lcd_configure_stn(); @@ -418,18 +418,18 @@ public: READ32_MEMBER( s3c24xx_lcd_palette_r ); WRITE32_MEMBER( s3c24xx_lcd_palette_w ); void s3c24xx_clkpow_reset(); - UINT32 s3c24xx_get_fclk(); - UINT32 s3c24xx_get_hclk(); - UINT32 s3c24xx_get_pclk(); + uint32_t s3c24xx_get_fclk(); + uint32_t s3c24xx_get_hclk(); + uint32_t s3c24xx_get_pclk(); READ32_MEMBER( s3c24xx_clkpow_r ); WRITE32_MEMBER( s3c24xx_clkpow_w ); void s3c24xx_irq_reset(); void s3c24xx_check_pending_irq(); - void s3c24xx_request_irq(UINT32 int_type); + void s3c24xx_request_irq(uint32_t int_type); READ32_MEMBER( s3c24xx_irq_r ); WRITE32_MEMBER( s3c24xx_irq_w ); void s3c24xx_pwm_reset(); - UINT16 s3c24xx_pwm_calc_observation(int ch); + uint16_t s3c24xx_pwm_calc_observation(int ch); READ32_MEMBER( s3c24xx_pwm_r ); void s3c24xx_pwm_start(int timer); void s3c24xx_pwm_stop(int timer); @@ -444,8 +444,8 @@ public: void s3c24xx_dma_start(int ch); void s3c24xx_dma_stop(int ch); void s3c24xx_dma_recalc(int ch); - UINT32 s3c24xx_dma_r(UINT32 ch, UINT32 offset); - void s3c24xx_dma_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t s3c24xx_dma_r(uint32_t ch, uint32_t offset); + void s3c24xx_dma_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask); READ32_MEMBER( s3c24xx_dma_0_r ); READ32_MEMBER( s3c24xx_dma_1_r ); READ32_MEMBER( s3c24xx_dma_2_r ); @@ -456,9 +456,9 @@ public: WRITE32_MEMBER( s3c24xx_dma_3_w ); TIMER_CALLBACK_MEMBER( s3c24xx_dma_timer_exp ); void s3c24xx_gpio_reset(); - inline UINT32 iface_gpio_port_r(int port, UINT32 mask); - inline void iface_gpio_port_w(int port, UINT32 mask, UINT32 data); - UINT16 s3c24xx_gpio_get_mask( UINT32 con, int val); + inline uint32_t iface_gpio_port_r(int port, uint32_t mask); + inline void iface_gpio_port_w(int port, uint32_t mask, uint32_t data); + uint16_t s3c24xx_gpio_get_mask( uint32_t con, int val); READ32_MEMBER( s3c24xx_gpio_r ); WRITE32_MEMBER( s3c24xx_gpio_w ); void s3c24xx_memcon_reset(); @@ -468,18 +468,18 @@ public: READ32_MEMBER( s3c24xx_usb_host_r ); WRITE32_MEMBER( s3c24xx_usb_host_w ); void s3c24xx_uart_reset(); - UINT32 s3c24xx_uart_r(UINT32 ch, UINT32 offset); - void s3c24xx_uart_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t s3c24xx_uart_r(uint32_t ch, uint32_t offset); + void s3c24xx_uart_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask); READ32_MEMBER( s3c24xx_uart_0_r ); READ32_MEMBER( s3c24xx_uart_1_r ); WRITE32_MEMBER( s3c24xx_uart_0_w ); WRITE32_MEMBER( s3c24xx_uart_1_w ); - void s3c24xx_uart_fifo_w(int uart, UINT8 data); + void s3c24xx_uart_fifo_w(int uart, uint8_t data); void s3c24xx_usb_device_reset(); READ32_MEMBER( s3c24xx_usb_device_r ); WRITE32_MEMBER( s3c24xx_usb_device_w ); void s3c24xx_wdt_reset(); - UINT16 s3c24xx_wdt_calc_current_count(); + uint16_t s3c24xx_wdt_calc_current_count(); READ32_MEMBER( s3c24xx_wdt_r ); void s3c24xx_wdt_start(); void s3c24xx_wdt_stop(); @@ -492,8 +492,8 @@ public: inline int iface_i2c_sda_r(); void i2c_send_start(); void i2c_send_stop(); - UINT8 i2c_receive_byte(int ack); - int i2c_send_byte(UINT8 data); + uint8_t i2c_receive_byte(int ack); + int i2c_send_byte(uint8_t data); void iic_start(); void iic_stop(); void iic_resume(); @@ -501,7 +501,7 @@ public: WRITE32_MEMBER( s3c24xx_iic_w ); TIMER_CALLBACK_MEMBER( s3c24xx_iic_timer_exp ); void s3c24xx_iis_reset(); - inline void iface_i2s_data_w(int ch, UINT16 data); + inline void iface_i2s_data_w(int ch, uint16_t data); void s3c24xx_iis_start(); void s3c24xx_iis_stop(); void s3c24xx_iis_recalc(); @@ -517,13 +517,13 @@ public: void s3c24xx_rtc_check_alarm(); TIMER_CALLBACK_MEMBER( s3c24xx_rtc_timer_update_exp ); void s3c24xx_adc_reset(); - UINT32 iface_adc_data_r(int ch); + uint32_t iface_adc_data_r(int ch); READ32_MEMBER( s3c24xx_adc_r ); void s3c24xx_adc_start(); WRITE32_MEMBER( s3c24xx_adc_w ); void s3c24xx_spi_reset(); - UINT32 s3c24xx_spi_r(UINT32 ch, UINT32 offset); - void s3c24xx_spi_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t s3c24xx_spi_r(uint32_t ch, uint32_t offset); + void s3c24xx_spi_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask); READ32_MEMBER( s3c24xx_spi_0_r ); WRITE32_MEMBER( s3c24xx_spi_0_w ); void s3c24xx_mmc_reset(); @@ -533,7 +533,7 @@ public: void s3c24xx_device_start(); - void s3c2400_uart_fifo_w(int uart, UINT8 data); + void s3c2400_uart_fifo_w(int uart, uint8_t data); /******************************************************************************* TYPE DEFINITIONS @@ -541,201 +541,201 @@ public: struct s3c24xx_memcon_regs_t { - UINT32 data[0x34/4]; + uint32_t data[0x34/4]; }; struct s3c24xx_usbhost_regs_t { - UINT32 data[0x5C/4]; + uint32_t data[0x5C/4]; }; struct s3c24xx_irq_regs_t { - UINT32 srcpnd; - UINT32 intmod; - UINT32 intmsk; - UINT32 priority; - UINT32 intpnd; - UINT32 intoffset; + uint32_t srcpnd; + uint32_t intmod; + uint32_t intmsk; + uint32_t priority; + uint32_t intpnd; + uint32_t intoffset; }; struct s3c24xx_dma_regs_t { - UINT32 disrc; - UINT32 didst; - UINT32 dcon; - UINT32 dstat; - UINT32 dcsrc; - UINT32 dcdst; - UINT32 dmasktrig; + uint32_t disrc; + uint32_t didst; + uint32_t dcon; + uint32_t dstat; + uint32_t dcsrc; + uint32_t dcdst; + uint32_t dmasktrig; }; struct s3c24xx_clkpow_regs_t { - UINT32 locktime; - UINT32 mpllcon; - UINT32 upllcon; - UINT32 clkcon; - UINT32 clkslow; - UINT32 clkdivn; + uint32_t locktime; + uint32_t mpllcon; + uint32_t upllcon; + uint32_t clkcon; + uint32_t clkslow; + uint32_t clkdivn; }; struct s3c24xx_lcd_regs_t { - UINT32 lcdcon1; - UINT32 lcdcon2; - UINT32 lcdcon3; - UINT32 lcdcon4; - UINT32 lcdcon5; - UINT32 lcdsaddr1; - UINT32 lcdsaddr2; - UINT32 lcdsaddr3; - UINT32 redlut; - UINT32 greenlut; - UINT32 bluelut; - UINT32 reserved[8]; - UINT32 dithmode; - UINT32 tpal; + uint32_t lcdcon1; + uint32_t lcdcon2; + uint32_t lcdcon3; + uint32_t lcdcon4; + uint32_t lcdcon5; + uint32_t lcdsaddr1; + uint32_t lcdsaddr2; + uint32_t lcdsaddr3; + uint32_t redlut; + uint32_t greenlut; + uint32_t bluelut; + uint32_t reserved[8]; + uint32_t dithmode; + uint32_t tpal; }; struct s3c24xx_lcdpal_regs_t { - UINT32 data[0x400/4]; + uint32_t data[0x400/4]; }; struct s3c24xx_uart_regs_t { - UINT32 ulcon; - UINT32 ucon; - UINT32 ufcon; - UINT32 umcon; - UINT32 utrstat; - UINT32 uerstat; - UINT32 ufstat; - UINT32 umstat; - UINT32 utxh; - UINT32 urxh; - UINT32 ubrdiv; + uint32_t ulcon; + uint32_t ucon; + uint32_t ufcon; + uint32_t umcon; + uint32_t utrstat; + uint32_t uerstat; + uint32_t ufstat; + uint32_t umstat; + uint32_t utxh; + uint32_t urxh; + uint32_t ubrdiv; }; struct s3c24xx_pwm_regs_t { - UINT32 tcfg0; - UINT32 tcfg1; - UINT32 tcon; - UINT32 tcntb0; - UINT32 tcmpb0; - UINT32 tcnto0; - UINT32 tcntb1; - UINT32 tcmpb1; - UINT32 tcnto1; - UINT32 tcntb2; - UINT32 tcmpb2; - UINT32 tcnto2; - UINT32 tcntb3; - UINT32 tcmpb3; - UINT32 tcnto3; - UINT32 tcntb4; - UINT32 tcnto4; + uint32_t tcfg0; + uint32_t tcfg1; + uint32_t tcon; + uint32_t tcntb0; + uint32_t tcmpb0; + uint32_t tcnto0; + uint32_t tcntb1; + uint32_t tcmpb1; + uint32_t tcnto1; + uint32_t tcntb2; + uint32_t tcmpb2; + uint32_t tcnto2; + uint32_t tcntb3; + uint32_t tcmpb3; + uint32_t tcnto3; + uint32_t tcntb4; + uint32_t tcnto4; }; struct s3c24xx_usbdev_regs_t { - UINT32 data[0xBC/4]; + uint32_t data[0xBC/4]; }; struct s3c24xx_wdt_regs_t { - UINT32 wtcon; - UINT32 wtdat; - UINT32 wtcnt; + uint32_t wtcon; + uint32_t wtdat; + uint32_t wtcnt; }; struct s3c24xx_iic_regs_t { - UINT32 iiccon; - UINT32 iicstat; - UINT32 iicadd; - UINT32 iicds; + uint32_t iiccon; + uint32_t iicstat; + uint32_t iicadd; + uint32_t iicds; }; struct s3c24xx_iis_regs_t { - UINT32 iiscon; - UINT32 iismod; - UINT32 iispsr; - UINT32 iisfcon; - UINT32 iisfifo; + uint32_t iiscon; + uint32_t iismod; + uint32_t iispsr; + uint32_t iisfcon; + uint32_t iisfifo; }; struct s3c24xx_gpio_regs_t { - UINT32 gpacon; - UINT32 gpadat; - UINT32 gpbcon; - UINT32 gpbdat; - UINT32 gpbup; - UINT32 gpccon; - UINT32 gpcdat; - UINT32 gpcup; - UINT32 gpdcon; - UINT32 gpddat; - UINT32 gpdup; - UINT32 gpecon; - UINT32 gpedat; - UINT32 gpeup; - UINT32 gpfcon; - UINT32 gpfdat; - UINT32 gpfup; - UINT32 gpgcon; - UINT32 gpgdat; - UINT32 gpgup; - UINT32 opencr; - UINT32 misccr; - UINT32 extint; + uint32_t gpacon; + uint32_t gpadat; + uint32_t gpbcon; + uint32_t gpbdat; + uint32_t gpbup; + uint32_t gpccon; + uint32_t gpcdat; + uint32_t gpcup; + uint32_t gpdcon; + uint32_t gpddat; + uint32_t gpdup; + uint32_t gpecon; + uint32_t gpedat; + uint32_t gpeup; + uint32_t gpfcon; + uint32_t gpfdat; + uint32_t gpfup; + uint32_t gpgcon; + uint32_t gpgdat; + uint32_t gpgup; + uint32_t opencr; + uint32_t misccr; + uint32_t extint; }; struct s3c24xx_rtc_regs_t { - UINT32 rtccon; - UINT32 ticnt; - UINT32 reserved[2]; - UINT32 rtcalm; - UINT32 almsec; - UINT32 almmin; - UINT32 almhour; - UINT32 almday; - UINT32 almmon; - UINT32 almyear; - UINT32 rtcrst; - UINT32 bcdsec; - UINT32 bcdmin; - UINT32 bcdhour; - UINT32 bcdday; - UINT32 bcddow; - UINT32 bcdmon; - UINT32 bcdyear; + uint32_t rtccon; + uint32_t ticnt; + uint32_t reserved[2]; + uint32_t rtcalm; + uint32_t almsec; + uint32_t almmin; + uint32_t almhour; + uint32_t almday; + uint32_t almmon; + uint32_t almyear; + uint32_t rtcrst; + uint32_t bcdsec; + uint32_t bcdmin; + uint32_t bcdhour; + uint32_t bcdday; + uint32_t bcddow; + uint32_t bcdmon; + uint32_t bcdyear; }; struct s3c24xx_adc_regs_t { - UINT32 adccon; - UINT32 adcdat; + uint32_t adccon; + uint32_t adcdat; }; struct s3c24xx_spi_regs_t { - UINT32 spcon; - UINT32 spsta; - UINT32 sppin; - UINT32 sppre; - UINT32 sptdat; - UINT32 sprdat; + uint32_t spcon; + uint32_t spsta; + uint32_t sppin; + uint32_t sppre; + uint32_t sptdat; + uint32_t sprdat; }; struct s3c24xx_mmc_regs_t { - UINT32 data[0x40/4]; + uint32_t data[0x40/4]; }; struct s3c24xx_memcon_t @@ -770,18 +770,18 @@ public: s3c24xx_lcd_regs_t regs; emu_timer *timer; std::unique_ptr bitmap[2]; - UINT32 vramaddr_cur; - UINT32 vramaddr_max; - UINT32 offsize; - UINT32 pagewidth_cur; - UINT32 pagewidth_max; - UINT32 bppmode; - UINT32 bswp, hwswp; + uint32_t vramaddr_cur; + uint32_t vramaddr_max; + uint32_t offsize; + uint32_t pagewidth_cur; + uint32_t pagewidth_max; + uint32_t bppmode; + uint32_t bswp, hwswp; int vpos, hpos; double framerate; - UINT32 tpal; - UINT32 hpos_min, hpos_max, vpos_min, vpos_max; - UINT32 dma_data, dma_bits; + uint32_t tpal; + uint32_t hpos_min, hpos_max, vpos_min, vpos_max; + uint32_t dma_data, dma_bits; }; struct s3c24xx_lcdpal_t @@ -798,9 +798,9 @@ public: { s3c24xx_pwm_regs_t regs; emu_timer *timer[5]; - UINT32 cnt[5]; - UINT32 cmp[5]; - UINT32 freq[5]; + uint32_t cnt[5]; + uint32_t cmp[5]; + uint32_t freq[5]; }; struct s3c24xx_usbdev_t @@ -825,7 +825,7 @@ public: { s3c24xx_iis_regs_t regs; emu_timer *timer; - UINT16 fifo[16/2]; + uint16_t fifo[16/2]; int fifo_index; }; diff --git a/src/devices/machine/s3c2410.cpp b/src/devices/machine/s3c2410.cpp index c036b1f362c..0b1f00be67a 100644 --- a/src/devices/machine/s3c2410.cpp +++ b/src/devices/machine/s3c2410.cpp @@ -33,14 +33,14 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, c #include "machine/s3c24xx.hxx" #undef DEVICE_S3C2410 -UINT32 s3c2410_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t s3c2410_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return s3c24xx_video_update(screen, bitmap, cliprect); } const device_type S3C2410 = &device_creator; -s3c2410_device::s3c2410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s3c2410_device::s3c2410_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S3C2410, "S3C2410 MCU", tag, owner, clock, "s3c2410", __FILE__), m_palette(*this, finder_base::DUMMY_TAG), m_cpu(*this, ":maincpu"), @@ -142,7 +142,7 @@ void s3c2410_device::device_reset() s3c24xx_device_reset(); } -void s3c2410_device::s3c2410_uart_fifo_w( int uart, UINT8 data) +void s3c2410_device::s3c2410_uart_fifo_w( int uart, uint8_t data) { s3c24xx_uart_fifo_w( uart, data); } @@ -157,13 +157,13 @@ WRITE_LINE_MEMBER( s3c2410_device::frnb_w ) s3c24xx_pin_frnb_w(state); } -void s3c2410_device::s3c2410_nand_calculate_mecc( UINT8 *data, UINT32 size, UINT8 *mecc) +void s3c2410_device::s3c2410_nand_calculate_mecc( uint8_t *data, uint32_t size, uint8_t *mecc) { mecc[0] = mecc[1] = mecc[2] = mecc[3] = 0xFF; for (int i = 0; i < size; i++) nand_update_mecc( mecc, i, data[i]); } -void s3c2410_device::s3c2410_request_eint(UINT32 number) +void s3c2410_device::s3c2410_request_eint(uint32_t number) { s3c24xx_request_eint(number); } diff --git a/src/devices/machine/s3c2410.h b/src/devices/machine/s3c2410.h index 6e9b28a9146..3356f4d91fb 100644 --- a/src/devices/machine/s3c2410.h +++ b/src/devices/machine/s3c2410.h @@ -391,7 +391,7 @@ enum #define S3C24XX_SUBINT_TXD0 1 #define S3C24XX_SUBINT_RXD0 0 -static const UINT32 MAP_SUBINT_TO_INT[11] = +static const uint32_t MAP_SUBINT_TO_INT[11] = { S3C24XX_INT_UART0, S3C24XX_INT_UART0, S3C24XX_INT_UART0, S3C24XX_INT_UART1, S3C24XX_INT_UART1, S3C24XX_INT_UART1, @@ -438,7 +438,7 @@ static const UINT32 MAP_SUBINT_TO_INT[11] = class s3c2410_device : public device_t { public: - s3c2410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s3c2410_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~s3c2410_device(); // static configuration @@ -467,23 +467,23 @@ private: // internal state required_device m_palette; public: - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void s3c24xx_reset(); inline int iface_core_pin_r(int pin); void s3c24xx_lcd_reset(); - rgb_t s3c24xx_get_color_tft_16(UINT16 data); - rgb_t s3c24xx_get_color_tft_24(UINT32 data); - rgb_t s3c24xx_get_color_stn_12(UINT16 data); - rgb_t s3c24xx_get_color_stn_08( UINT8 data); - rgb_t s3c24xx_get_color_stn_01(UINT8 data); - rgb_t s3c24xx_get_color_stn_02(UINT8 data); - rgb_t s3c24xx_get_color_stn_04(UINT8 data); + rgb_t s3c24xx_get_color_tft_16(uint16_t data); + rgb_t s3c24xx_get_color_tft_24(uint32_t data); + rgb_t s3c24xx_get_color_stn_12(uint16_t data); + rgb_t s3c24xx_get_color_stn_08( uint8_t data); + rgb_t s3c24xx_get_color_stn_01(uint8_t data); + rgb_t s3c24xx_get_color_stn_02(uint8_t data); + rgb_t s3c24xx_get_color_stn_04(uint8_t data); rgb_t s3c24xx_get_color_tpal(); void s3c24xx_lcd_dma_reload(); void s3c24xx_lcd_dma_init(); - UINT32 s3c24xx_lcd_dma_read(); - UINT32 s3c24xx_lcd_dma_read_bits(int count); + uint32_t s3c24xx_lcd_dma_read(); + uint32_t s3c24xx_lcd_dma_read_bits(int count); void s3c24xx_lcd_render_tpal(); void s3c24xx_lcd_render_stn_01(); void s3c24xx_lcd_render_stn_02(); @@ -499,7 +499,7 @@ public: TIMER_CALLBACK_MEMBER( s3c24xx_lcd_timer_exp ); void s3c24xx_video_start(); void bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bitmap_src_1, bitmap_rgb32 &bitmap_src_2); - UINT32 s3c24xx_video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t s3c24xx_video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); READ32_MEMBER( s3c24xx_lcd_r ); int s3c24xx_lcd_configure_tft(); int s3c24xx_lcd_configure_stn(); @@ -511,22 +511,22 @@ public: READ32_MEMBER( s3c24xx_lcd_palette_r ); WRITE32_MEMBER( s3c24xx_lcd_palette_w ); void s3c24xx_clkpow_reset(); - UINT32 s3c24xx_get_fclk(); - UINT32 s3c24xx_get_hclk(); - UINT32 s3c24xx_get_pclk(); + uint32_t s3c24xx_get_fclk(); + uint32_t s3c24xx_get_hclk(); + uint32_t s3c24xx_get_pclk(); READ32_MEMBER( s3c24xx_clkpow_r ); WRITE32_MEMBER( s3c24xx_clkpow_w ); void s3c24xx_irq_reset(); void s3c24xx_check_pending_irq(); - void s3c24xx_request_irq(UINT32 int_type); + void s3c24xx_request_irq(uint32_t int_type); void s3c24xx_check_pending_subirq(); - void s3c24xx_request_subirq( UINT32 int_type); + void s3c24xx_request_subirq( uint32_t int_type); void s3c24xx_check_pending_eint(); - void s3c24xx_request_eint(UINT32 number); + void s3c24xx_request_eint(uint32_t number); READ32_MEMBER( s3c24xx_irq_r ); WRITE32_MEMBER( s3c24xx_irq_w ); void s3c24xx_pwm_reset(); - UINT16 s3c24xx_pwm_calc_observation(int ch); + uint16_t s3c24xx_pwm_calc_observation(int ch); READ32_MEMBER( s3c24xx_pwm_r ); void s3c24xx_pwm_start(int timer); void s3c24xx_pwm_stop(int timer); @@ -541,8 +541,8 @@ public: void s3c24xx_dma_start(int ch); void s3c24xx_dma_stop(int ch); void s3c24xx_dma_recalc(int ch); - UINT32 s3c24xx_dma_r(UINT32 ch, UINT32 offset); - void s3c24xx_dma_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t s3c24xx_dma_r(uint32_t ch, uint32_t offset); + void s3c24xx_dma_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask); READ32_MEMBER( s3c24xx_dma_0_r ); READ32_MEMBER( s3c24xx_dma_1_r ); READ32_MEMBER( s3c24xx_dma_2_r ); @@ -553,9 +553,9 @@ public: WRITE32_MEMBER( s3c24xx_dma_3_w ); TIMER_CALLBACK_MEMBER( s3c24xx_dma_timer_exp ); void s3c24xx_gpio_reset(); - inline UINT32 iface_gpio_port_r(int port, UINT32 mask); - inline void iface_gpio_port_w(int port, UINT32 mask, UINT32 data); - UINT16 s3c24xx_gpio_get_mask( UINT32 con, int val); + inline uint32_t iface_gpio_port_r(int port, uint32_t mask); + inline void iface_gpio_port_w(int port, uint32_t mask, uint32_t data); + uint16_t s3c24xx_gpio_get_mask( uint32_t con, int val); READ32_MEMBER( s3c24xx_gpio_r ); WRITE32_MEMBER( s3c24xx_gpio_w ); void s3c24xx_memcon_reset(); @@ -565,20 +565,20 @@ public: READ32_MEMBER( s3c24xx_usb_host_r ); WRITE32_MEMBER( s3c24xx_usb_host_w ); void s3c24xx_uart_reset(); - UINT32 s3c24xx_uart_r(UINT32 ch, UINT32 offset); - void s3c24xx_uart_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t s3c24xx_uart_r(uint32_t ch, uint32_t offset); + void s3c24xx_uart_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask); READ32_MEMBER( s3c24xx_uart_0_r ); READ32_MEMBER( s3c24xx_uart_1_r ); READ32_MEMBER( s3c24xx_uart_2_r ); WRITE32_MEMBER( s3c24xx_uart_0_w ); WRITE32_MEMBER( s3c24xx_uart_1_w ); WRITE32_MEMBER( s3c24xx_uart_2_w ); - void s3c24xx_uart_fifo_w(int uart, UINT8 data); + void s3c24xx_uart_fifo_w(int uart, uint8_t data); void s3c24xx_usb_device_reset(); READ32_MEMBER( s3c24xx_usb_device_r ); WRITE32_MEMBER( s3c24xx_usb_device_w ); void s3c24xx_wdt_reset(); - UINT16 s3c24xx_wdt_calc_current_count(); + uint16_t s3c24xx_wdt_calc_current_count(); READ32_MEMBER( s3c24xx_wdt_r ); void s3c24xx_wdt_start(); void s3c24xx_wdt_stop(); @@ -591,8 +591,8 @@ public: inline int iface_i2c_sda_r(); void i2c_send_start(); void i2c_send_stop(); - UINT8 i2c_receive_byte(int ack); - int i2c_send_byte(UINT8 data); + uint8_t i2c_receive_byte(int ack); + int i2c_send_byte(uint8_t data); void iic_start(); void iic_stop(); void iic_resume(); @@ -600,7 +600,7 @@ public: WRITE32_MEMBER( s3c24xx_iic_w ); TIMER_CALLBACK_MEMBER( s3c24xx_iic_timer_exp ); void s3c24xx_iis_reset(); - inline void iface_i2s_data_w(int ch, UINT16 data); + inline void iface_i2s_data_w(int ch, uint16_t data); void s3c24xx_iis_start(); void s3c24xx_iis_stop(); void s3c24xx_iis_recalc(); @@ -616,14 +616,14 @@ public: void s3c24xx_rtc_check_alarm(); TIMER_CALLBACK_MEMBER( s3c24xx_rtc_timer_update_exp ); void s3c24xx_adc_reset(); - UINT32 iface_adc_data_r(int ch); + uint32_t iface_adc_data_r(int ch); READ32_MEMBER( s3c24xx_adc_r ); void s3c24xx_adc_start(); WRITE32_MEMBER( s3c24xx_adc_w ); void s3c24xx_touch_screen(int state); void s3c24xx_spi_reset(); - UINT32 s3c24xx_spi_r(UINT32 ch, UINT32 offset); - void s3c24xx_spi_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t s3c24xx_spi_r(uint32_t ch, uint32_t offset); + void s3c24xx_spi_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask); READ32_MEMBER( s3c24xx_spi_0_r ); READ32_MEMBER( s3c24xx_spi_1_r ); WRITE32_MEMBER( s3c24xx_spi_0_w ); @@ -632,16 +632,16 @@ public: READ32_MEMBER( s3c24xx_sdi_r ); WRITE32_MEMBER( s3c24xx_sdi_w ); void s3c24xx_nand_reset(); - inline void iface_nand_command_w(UINT8 data); - inline void iface_nand_address_w(UINT8 data); - inline UINT8 iface_nand_data_r(); - inline void iface_nand_data_w(UINT8 data); - void nand_update_mecc( UINT8 *ecc, int pos, UINT8 data); - void s3c24xx_nand_update_ecc(UINT8 data); - void s3c24xx_nand_command_w(UINT8 data); - void s3c24xx_nand_address_w(UINT8 data); - UINT8 s3c24xx_nand_data_r(); - void s3c24xx_nand_data_w(UINT8 data); + inline void iface_nand_command_w(uint8_t data); + inline void iface_nand_address_w(uint8_t data); + inline uint8_t iface_nand_data_r(); + inline void iface_nand_data_w(uint8_t data); + void nand_update_mecc( uint8_t *ecc, int pos, uint8_t data); + void s3c24xx_nand_update_ecc(uint8_t data); + void s3c24xx_nand_command_w(uint8_t data); + void s3c24xx_nand_address_w(uint8_t data); + uint8_t s3c24xx_nand_data_r(); + void s3c24xx_nand_data_w(uint8_t data); READ32_MEMBER( s3c24xx_nand_r ); void s3c24xx_nand_init_ecc(); WRITE32_MEMBER( s3c24xx_nand_w ); @@ -650,10 +650,10 @@ public: void s3c24xx_device_reset(); void s3c24xx_device_start(); - void s3c2410_uart_fifo_w( int uart, UINT8 data); + void s3c2410_uart_fifo_w( int uart, uint8_t data); void s3c2410_touch_screen( int state); - void s3c2410_request_eint( UINT32 number); - void s3c2410_nand_calculate_mecc( UINT8 *data, UINT32 size, UINT8 *mecc); + void s3c2410_request_eint( uint32_t number); + void s3c2410_nand_calculate_mecc( uint8_t *data, uint32_t size, uint8_t *mecc); /******************************************************************************* TYPE DEFINITIONS @@ -661,247 +661,247 @@ public: struct s3c24xx_memcon_regs_t { - UINT32 data[0x34/4]; + uint32_t data[0x34/4]; }; struct s3c24xx_usbhost_regs_t { - UINT32 data[0x5C/4]; + uint32_t data[0x5C/4]; }; struct s3c24xx_irq_regs_t { - UINT32 srcpnd; - UINT32 intmod; - UINT32 intmsk; - UINT32 priority; - UINT32 intpnd; - UINT32 intoffset; - UINT32 subsrcpnd; - UINT32 intsubmsk; + uint32_t srcpnd; + uint32_t intmod; + uint32_t intmsk; + uint32_t priority; + uint32_t intpnd; + uint32_t intoffset; + uint32_t subsrcpnd; + uint32_t intsubmsk; }; struct s3c24xx_dma_regs_t { - UINT32 disrc; - UINT32 disrcc; - UINT32 didst; - UINT32 didstc; - UINT32 dcon; - UINT32 dstat; - UINT32 dcsrc; - UINT32 dcdst; - UINT32 dmasktrig; + uint32_t disrc; + uint32_t disrcc; + uint32_t didst; + uint32_t didstc; + uint32_t dcon; + uint32_t dstat; + uint32_t dcsrc; + uint32_t dcdst; + uint32_t dmasktrig; }; struct s3c24xx_clkpow_regs_t { - UINT32 locktime; - UINT32 mpllcon; - UINT32 upllcon; - UINT32 clkcon; - UINT32 clkslow; - UINT32 clkdivn; + uint32_t locktime; + uint32_t mpllcon; + uint32_t upllcon; + uint32_t clkcon; + uint32_t clkslow; + uint32_t clkdivn; }; struct s3c24xx_lcd_regs_t { - UINT32 lcdcon1; - UINT32 lcdcon2; - UINT32 lcdcon3; - UINT32 lcdcon4; - UINT32 lcdcon5; - UINT32 lcdsaddr1; - UINT32 lcdsaddr2; - UINT32 lcdsaddr3; - UINT32 redlut; - UINT32 greenlut; - UINT32 bluelut; - UINT32 reserved[8]; - UINT32 dithmode; - UINT32 tpal; - UINT32 lcdintpnd; - UINT32 lcdsrcpnd; - UINT32 lcdintmsk; - UINT32 lpcsel; + uint32_t lcdcon1; + uint32_t lcdcon2; + uint32_t lcdcon3; + uint32_t lcdcon4; + uint32_t lcdcon5; + uint32_t lcdsaddr1; + uint32_t lcdsaddr2; + uint32_t lcdsaddr3; + uint32_t redlut; + uint32_t greenlut; + uint32_t bluelut; + uint32_t reserved[8]; + uint32_t dithmode; + uint32_t tpal; + uint32_t lcdintpnd; + uint32_t lcdsrcpnd; + uint32_t lcdintmsk; + uint32_t lpcsel; }; struct s3c24xx_lcdpal_regs_t { - UINT32 data[0x400/4]; + uint32_t data[0x400/4]; }; struct s3c24xx_nand_regs_t { - UINT32 nfconf; - UINT32 nfcmd; - UINT32 nfaddr; - UINT32 nfdata; - UINT32 nfstat; - UINT32 nfecc; + uint32_t nfconf; + uint32_t nfcmd; + uint32_t nfaddr; + uint32_t nfdata; + uint32_t nfstat; + uint32_t nfecc; }; struct s3c24xx_uart_regs_t { - UINT32 ulcon; - UINT32 ucon; - UINT32 ufcon; - UINT32 umcon; - UINT32 utrstat; - UINT32 uerstat; - UINT32 ufstat; - UINT32 umstat; - UINT32 utxh; - UINT32 urxh; - UINT32 ubrdiv; + uint32_t ulcon; + uint32_t ucon; + uint32_t ufcon; + uint32_t umcon; + uint32_t utrstat; + uint32_t uerstat; + uint32_t ufstat; + uint32_t umstat; + uint32_t utxh; + uint32_t urxh; + uint32_t ubrdiv; }; struct s3c24xx_pwm_regs_t { - UINT32 tcfg0; - UINT32 tcfg1; - UINT32 tcon; - UINT32 tcntb0; - UINT32 tcmpb0; - UINT32 tcnto0; - UINT32 tcntb1; - UINT32 tcmpb1; - UINT32 tcnto1; - UINT32 tcntb2; - UINT32 tcmpb2; - UINT32 tcnto2; - UINT32 tcntb3; - UINT32 tcmpb3; - UINT32 tcnto3; - UINT32 tcntb4; - UINT32 tcnto4; + uint32_t tcfg0; + uint32_t tcfg1; + uint32_t tcon; + uint32_t tcntb0; + uint32_t tcmpb0; + uint32_t tcnto0; + uint32_t tcntb1; + uint32_t tcmpb1; + uint32_t tcnto1; + uint32_t tcntb2; + uint32_t tcmpb2; + uint32_t tcnto2; + uint32_t tcntb3; + uint32_t tcmpb3; + uint32_t tcnto3; + uint32_t tcntb4; + uint32_t tcnto4; }; struct s3c24xx_usbdev_regs_t { - UINT32 data[0x130/4]; + uint32_t data[0x130/4]; }; struct s3c24xx_wdt_regs_t { - UINT32 wtcon; - UINT32 wtdat; - UINT32 wtcnt; + uint32_t wtcon; + uint32_t wtdat; + uint32_t wtcnt; }; struct s3c24xx_iic_regs_t { - UINT32 iiccon; - UINT32 iicstat; - UINT32 iicadd; - UINT32 iicds; + uint32_t iiccon; + uint32_t iicstat; + uint32_t iicadd; + uint32_t iicds; }; struct s3c24xx_iis_regs_t { - UINT32 iiscon; - UINT32 iismod; - UINT32 iispsr; - UINT32 iisfcon; - UINT32 iisfifo; + uint32_t iiscon; + uint32_t iismod; + uint32_t iispsr; + uint32_t iisfcon; + uint32_t iisfifo; }; struct s3c24xx_gpio_regs_t { - UINT32 gpacon; - UINT32 gpadat; - UINT32 pad_08; - UINT32 pad_0c; - UINT32 gpbcon; - UINT32 gpbdat; - UINT32 gpbup; - UINT32 pad_1c; - UINT32 gpccon; - UINT32 gpcdat; - UINT32 gpcup; - UINT32 pad_2c; - UINT32 gpdcon; - UINT32 gpddat; - UINT32 gpdup; - UINT32 pad_3c; - UINT32 gpecon; - UINT32 gpedat; - UINT32 gpeup; - UINT32 pad_4c; - UINT32 gpfcon; - UINT32 gpfdat; - UINT32 gpfup; - UINT32 pad_5c; - UINT32 gpgcon; - UINT32 gpgdat; - UINT32 gpgup; - UINT32 pad_6c; - UINT32 gphcon; - UINT32 gphdat; - UINT32 gphup; - UINT32 pad_7c; - UINT32 misccr; - UINT32 dclkcon; - UINT32 extint0; - UINT32 extint1; - UINT32 extint2; - UINT32 eintflt0; - UINT32 eintflt1; - UINT32 eintflt2; - UINT32 eintflt3; - UINT32 eintmask; - UINT32 eintpend; - UINT32 gstatus0; - UINT32 gstatus1; - UINT32 gstatus2; - UINT32 gstatus3; - UINT32 gstatus4; + uint32_t gpacon; + uint32_t gpadat; + uint32_t pad_08; + uint32_t pad_0c; + uint32_t gpbcon; + uint32_t gpbdat; + uint32_t gpbup; + uint32_t pad_1c; + uint32_t gpccon; + uint32_t gpcdat; + uint32_t gpcup; + uint32_t pad_2c; + uint32_t gpdcon; + uint32_t gpddat; + uint32_t gpdup; + uint32_t pad_3c; + uint32_t gpecon; + uint32_t gpedat; + uint32_t gpeup; + uint32_t pad_4c; + uint32_t gpfcon; + uint32_t gpfdat; + uint32_t gpfup; + uint32_t pad_5c; + uint32_t gpgcon; + uint32_t gpgdat; + uint32_t gpgup; + uint32_t pad_6c; + uint32_t gphcon; + uint32_t gphdat; + uint32_t gphup; + uint32_t pad_7c; + uint32_t misccr; + uint32_t dclkcon; + uint32_t extint0; + uint32_t extint1; + uint32_t extint2; + uint32_t eintflt0; + uint32_t eintflt1; + uint32_t eintflt2; + uint32_t eintflt3; + uint32_t eintmask; + uint32_t eintpend; + uint32_t gstatus0; + uint32_t gstatus1; + uint32_t gstatus2; + uint32_t gstatus3; + uint32_t gstatus4; }; struct s3c24xx_rtc_regs_t { - UINT32 rtccon; - UINT32 ticnt; - UINT32 reserved[2]; - UINT32 rtcalm; - UINT32 almsec; - UINT32 almmin; - UINT32 almhour; - UINT32 almday; - UINT32 almmon; - UINT32 almyear; - UINT32 rtcrst; - UINT32 bcdsec; - UINT32 bcdmin; - UINT32 bcdhour; - UINT32 bcdday; - UINT32 bcddow; - UINT32 bcdmon; - UINT32 bcdyear; + uint32_t rtccon; + uint32_t ticnt; + uint32_t reserved[2]; + uint32_t rtcalm; + uint32_t almsec; + uint32_t almmin; + uint32_t almhour; + uint32_t almday; + uint32_t almmon; + uint32_t almyear; + uint32_t rtcrst; + uint32_t bcdsec; + uint32_t bcdmin; + uint32_t bcdhour; + uint32_t bcdday; + uint32_t bcddow; + uint32_t bcdmon; + uint32_t bcdyear; }; struct s3c24xx_adc_regs_t { - UINT32 adccon; - UINT32 adctsc; - UINT32 adcdly; - UINT32 adcdat0; - UINT32 adcdat1; + uint32_t adccon; + uint32_t adctsc; + uint32_t adcdly; + uint32_t adcdat0; + uint32_t adcdat1; }; struct s3c24xx_spi_regs_t { - UINT32 spcon; - UINT32 spsta; - UINT32 sppin; - UINT32 sppre; - UINT32 sptdat; - UINT32 sprdat; + uint32_t spcon; + uint32_t spsta; + uint32_t sppin; + uint32_t sppre; + uint32_t sptdat; + uint32_t sprdat; }; struct s3c24xx_sdi_regs_t { - UINT32 data[0x44/4]; + uint32_t data[0x44/4]; }; struct s3c24xx_memcon_t @@ -936,18 +936,18 @@ public: s3c24xx_lcd_regs_t regs; emu_timer *timer; std::unique_ptr bitmap[2]; - UINT32 vramaddr_cur; - UINT32 vramaddr_max; - UINT32 offsize; - UINT32 pagewidth_cur; - UINT32 pagewidth_max; - UINT32 bppmode; - UINT32 bswp, hwswp; + uint32_t vramaddr_cur; + uint32_t vramaddr_max; + uint32_t offsize; + uint32_t pagewidth_cur; + uint32_t pagewidth_max; + uint32_t bppmode; + uint32_t bswp, hwswp; int vpos, hpos; double framerate; - UINT32 tpal; - UINT32 hpos_min, hpos_max, vpos_min, vpos_max; - UINT32 dma_data, dma_bits; + uint32_t tpal; + uint32_t hpos_min, hpos_max, vpos_min, vpos_max; + uint32_t dma_data, dma_bits; }; struct s3c24xx_lcdpal_t @@ -958,7 +958,7 @@ public: struct s3c24xx_nand_t { s3c24xx_nand_regs_t regs; - UINT8 mecc[3]; + uint8_t mecc[3]; int ecc_pos, data_count; }; @@ -971,9 +971,9 @@ public: { s3c24xx_pwm_regs_t regs; emu_timer *timer[5]; - UINT32 cnt[5]; - UINT32 cmp[5]; - UINT32 freq[5]; + uint32_t cnt[5]; + uint32_t cmp[5]; + uint32_t freq[5]; }; struct s3c24xx_usbdev_t @@ -985,7 +985,7 @@ public: { s3c24xx_wdt_regs_t regs; emu_timer *timer; - UINT32 freq, cnt; + uint32_t freq, cnt; }; struct s3c24xx_iic_t @@ -999,7 +999,7 @@ public: { s3c24xx_iis_regs_t regs; emu_timer *timer; - UINT16 fifo[16/2]; + uint16_t fifo[16/2]; int fifo_index; }; @@ -1030,7 +1030,7 @@ public: s3c24xx_sdi_regs_t regs; }; - UINT8 m_steppingstone[4*1024]; + uint8_t m_steppingstone[4*1024]; s3c24xx_memcon_t m_memcon; s3c24xx_usbhost_t m_usbhost; s3c24xx_irq_t m_irq; diff --git a/src/devices/machine/s3c2440.cpp b/src/devices/machine/s3c2440.cpp index 9ad23516c8d..f55686203ab 100644 --- a/src/devices/machine/s3c2440.cpp +++ b/src/devices/machine/s3c2440.cpp @@ -33,14 +33,14 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, c #include "machine/s3c24xx.hxx" #undef DEVICE_S3C2440 -UINT32 s3c2440_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t s3c2440_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return s3c24xx_video_update( screen, bitmap, cliprect); } const device_type S3C2440 = &device_creator; -s3c2440_device::s3c2440_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s3c2440_device::s3c2440_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S3C2440, "Samsung S3C2440", tag, owner, clock, "s3c2440", __FILE__), m_palette(*this, finder_base::DUMMY_TAG), m_cpu(*this, ":maincpu"), @@ -148,7 +148,7 @@ void s3c2440_device::device_reset() } -void s3c2440_device::s3c2440_uart_fifo_w(int uart, UINT8 data) +void s3c2440_device::s3c2440_uart_fifo_w(int uart, uint8_t data) { s3c24xx_uart_fifo_w( uart, data); } @@ -158,12 +158,12 @@ void s3c2440_device::s3c2440_touch_screen(int state) s3c24xx_touch_screen( state); } -void s3c2440_device::s3c2440_request_irq(UINT32 int_type) +void s3c2440_device::s3c2440_request_irq(uint32_t int_type) { s3c24xx_request_irq( int_type); } -void s3c2440_device::s3c2440_request_eint(UINT32 number) +void s3c2440_device::s3c2440_request_eint(uint32_t number) { s3c24xx_request_eint( number); } diff --git a/src/devices/machine/s3c2440.h b/src/devices/machine/s3c2440.h index 58976ddcf1a..584c5f182f2 100644 --- a/src/devices/machine/s3c2440.h +++ b/src/devices/machine/s3c2440.h @@ -419,7 +419,7 @@ enum #define S3C24XX_SUBINT_TXD0 1 #define S3C24XX_SUBINT_RXD0 0 -static const UINT32 MAP_SUBINT_TO_INT[15] = +static const uint32_t MAP_SUBINT_TO_INT[15] = { S3C24XX_INT_UART0, S3C24XX_INT_UART0, S3C24XX_INT_UART0, S3C24XX_INT_UART1, S3C24XX_INT_UART1, S3C24XX_INT_UART1, @@ -469,7 +469,7 @@ static const UINT32 MAP_SUBINT_TO_INT[15] = class s3c2440_device : public device_t { public: - s3c2440_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s3c2440_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~s3c2440_device(); // static configuration @@ -499,23 +499,23 @@ private: // internal state required_device m_palette; public: - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void s3c24xx_reset(); inline int iface_core_pin_r(int pin); void s3c24xx_lcd_reset(); - rgb_t s3c24xx_get_color_tft_16(UINT16 data); - rgb_t s3c24xx_get_color_tft_24(UINT32 data); - rgb_t s3c24xx_get_color_stn_12(UINT16 data); - rgb_t s3c24xx_get_color_stn_08( UINT8 data); - rgb_t s3c24xx_get_color_stn_01(UINT8 data); - rgb_t s3c24xx_get_color_stn_02(UINT8 data); - rgb_t s3c24xx_get_color_stn_04(UINT8 data); + rgb_t s3c24xx_get_color_tft_16(uint16_t data); + rgb_t s3c24xx_get_color_tft_24(uint32_t data); + rgb_t s3c24xx_get_color_stn_12(uint16_t data); + rgb_t s3c24xx_get_color_stn_08( uint8_t data); + rgb_t s3c24xx_get_color_stn_01(uint8_t data); + rgb_t s3c24xx_get_color_stn_02(uint8_t data); + rgb_t s3c24xx_get_color_stn_04(uint8_t data); rgb_t s3c24xx_get_color_tpal(); void s3c24xx_lcd_dma_reload(); void s3c24xx_lcd_dma_init(); - UINT32 s3c24xx_lcd_dma_read(); - UINT32 s3c24xx_lcd_dma_read_bits(int count); + uint32_t s3c24xx_lcd_dma_read(); + uint32_t s3c24xx_lcd_dma_read_bits(int count); void s3c24xx_lcd_render_tpal(); void s3c24xx_lcd_render_stn_01(); void s3c24xx_lcd_render_stn_02(); @@ -531,7 +531,7 @@ public: TIMER_CALLBACK_MEMBER( s3c24xx_lcd_timer_exp ); void s3c24xx_video_start(); void bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bitmap_src_1, bitmap_rgb32 &bitmap_src_2); - UINT32 s3c24xx_video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t s3c24xx_video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); READ32_MEMBER( s3c24xx_lcd_r ); int s3c24xx_lcd_configure_tft(); int s3c24xx_lcd_configure_stn(); @@ -543,22 +543,22 @@ public: READ32_MEMBER( s3c24xx_lcd_palette_r ); WRITE32_MEMBER( s3c24xx_lcd_palette_w ); void s3c24xx_clkpow_reset(); - UINT32 s3c24xx_get_fclk(); - UINT32 s3c24xx_get_hclk(); - UINT32 s3c24xx_get_pclk(); + uint32_t s3c24xx_get_fclk(); + uint32_t s3c24xx_get_hclk(); + uint32_t s3c24xx_get_pclk(); READ32_MEMBER( s3c24xx_clkpow_r ); WRITE32_MEMBER( s3c24xx_clkpow_w ); void s3c24xx_irq_reset(); void s3c24xx_check_pending_irq(); - void s3c24xx_request_irq(UINT32 int_type); + void s3c24xx_request_irq(uint32_t int_type); void s3c24xx_check_pending_subirq(); - void s3c24xx_request_subirq( UINT32 int_type); + void s3c24xx_request_subirq( uint32_t int_type); void s3c24xx_check_pending_eint(); - void s3c24xx_request_eint(UINT32 number); + void s3c24xx_request_eint(uint32_t number); READ32_MEMBER( s3c24xx_irq_r ); WRITE32_MEMBER( s3c24xx_irq_w ); void s3c24xx_pwm_reset(); - UINT16 s3c24xx_pwm_calc_observation(int ch); + uint16_t s3c24xx_pwm_calc_observation(int ch); READ32_MEMBER( s3c24xx_pwm_r ); void s3c24xx_pwm_start(int timer); void s3c24xx_pwm_stop(int timer); @@ -573,8 +573,8 @@ public: void s3c24xx_dma_start(int ch); void s3c24xx_dma_stop(int ch); void s3c24xx_dma_recalc(int ch); - UINT32 s3c24xx_dma_r(UINT32 ch, UINT32 offset); - void s3c24xx_dma_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t s3c24xx_dma_r(uint32_t ch, uint32_t offset); + void s3c24xx_dma_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask); READ32_MEMBER( s3c24xx_dma_0_r ); READ32_MEMBER( s3c24xx_dma_1_r ); READ32_MEMBER( s3c24xx_dma_2_r ); @@ -585,9 +585,9 @@ public: WRITE32_MEMBER( s3c24xx_dma_3_w ); TIMER_CALLBACK_MEMBER( s3c24xx_dma_timer_exp ); void s3c24xx_gpio_reset(); - inline UINT32 iface_gpio_port_r(int port, UINT32 mask); - inline void iface_gpio_port_w(int port, UINT32 mask, UINT32 data); - UINT16 s3c24xx_gpio_get_mask( UINT32 con, int val); + inline uint32_t iface_gpio_port_r(int port, uint32_t mask); + inline void iface_gpio_port_w(int port, uint32_t mask, uint32_t data); + uint16_t s3c24xx_gpio_get_mask( uint32_t con, int val); READ32_MEMBER( s3c24xx_gpio_r ); WRITE32_MEMBER( s3c24xx_gpio_w ); void s3c24xx_memcon_reset(); @@ -597,20 +597,20 @@ public: READ32_MEMBER( s3c24xx_usb_host_r ); WRITE32_MEMBER( s3c24xx_usb_host_w ); void s3c24xx_uart_reset(); - UINT32 s3c24xx_uart_r(UINT32 ch, UINT32 offset); - void s3c24xx_uart_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t s3c24xx_uart_r(uint32_t ch, uint32_t offset); + void s3c24xx_uart_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask); READ32_MEMBER( s3c24xx_uart_0_r ); READ32_MEMBER( s3c24xx_uart_1_r ); READ32_MEMBER( s3c24xx_uart_2_r ); WRITE32_MEMBER( s3c24xx_uart_0_w ); WRITE32_MEMBER( s3c24xx_uart_1_w ); WRITE32_MEMBER( s3c24xx_uart_2_w ); - void s3c24xx_uart_fifo_w(int uart, UINT8 data); + void s3c24xx_uart_fifo_w(int uart, uint8_t data); void s3c24xx_usb_device_reset(); READ32_MEMBER( s3c24xx_usb_device_r ); WRITE32_MEMBER( s3c24xx_usb_device_w ); void s3c24xx_wdt_reset(); - UINT16 s3c24xx_wdt_calc_current_count(); + uint16_t s3c24xx_wdt_calc_current_count(); READ32_MEMBER( s3c24xx_wdt_r ); void s3c24xx_wdt_start(); void s3c24xx_wdt_stop(); @@ -623,8 +623,8 @@ public: inline int iface_i2c_sda_r(); void i2c_send_start(); void i2c_send_stop(); - UINT8 i2c_receive_byte(int ack); - int i2c_send_byte(UINT8 data); + uint8_t i2c_receive_byte(int ack); + int i2c_send_byte(uint8_t data); void iic_start(); void iic_stop(); void iic_resume(); @@ -632,7 +632,7 @@ public: WRITE32_MEMBER( s3c24xx_iic_w ); TIMER_CALLBACK_MEMBER( s3c24xx_iic_timer_exp ); void s3c24xx_iis_reset(); - inline void iface_i2s_data_w(int ch, UINT16 data); + inline void iface_i2s_data_w(int ch, uint16_t data); void s3c24xx_iis_start(); void s3c24xx_iis_stop(); void s3c24xx_iis_recalc(); @@ -648,14 +648,14 @@ public: void s3c24xx_rtc_check_alarm(); TIMER_CALLBACK_MEMBER( s3c24xx_rtc_timer_update_exp ); void s3c24xx_adc_reset(); - UINT32 iface_adc_data_r(int ch); + uint32_t iface_adc_data_r(int ch); READ32_MEMBER( s3c24xx_adc_r ); void s3c24xx_adc_start(); WRITE32_MEMBER( s3c24xx_adc_w ); void s3c24xx_touch_screen(int state); void s3c24xx_spi_reset(); - UINT32 s3c24xx_spi_r(UINT32 ch, UINT32 offset); - void s3c24xx_spi_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t s3c24xx_spi_r(uint32_t ch, uint32_t offset); + void s3c24xx_spi_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask); READ32_MEMBER( s3c24xx_spi_0_r ); READ32_MEMBER( s3c24xx_spi_1_r ); WRITE32_MEMBER( s3c24xx_spi_0_w ); @@ -664,17 +664,17 @@ public: READ32_MEMBER( s3c24xx_sdi_r ); WRITE32_MEMBER( s3c24xx_sdi_w ); void s3c24xx_nand_reset(); - inline void iface_nand_command_w(UINT8 data); - inline void iface_nand_address_w(UINT8 data); - inline UINT8 iface_nand_data_r(); - inline void iface_nand_data_w(UINT8 data); - void nand_update_mecc( UINT8 *ecc, int pos, UINT8 data); - void nand_update_secc( UINT8 *ecc, int pos, UINT8 data); - void s3c24xx_nand_update_ecc(UINT8 data); - void s3c24xx_nand_command_w(UINT8 data); - void s3c24xx_nand_address_w(UINT8 data); - UINT8 s3c24xx_nand_data_r(); - void s3c24xx_nand_data_w(UINT8 data); + inline void iface_nand_command_w(uint8_t data); + inline void iface_nand_address_w(uint8_t data); + inline uint8_t iface_nand_data_r(); + inline void iface_nand_data_w(uint8_t data); + void nand_update_mecc( uint8_t *ecc, int pos, uint8_t data); + void nand_update_secc( uint8_t *ecc, int pos, uint8_t data); + void s3c24xx_nand_update_ecc(uint8_t data); + void s3c24xx_nand_command_w(uint8_t data); + void s3c24xx_nand_address_w(uint8_t data); + uint8_t s3c24xx_nand_data_r(); + void s3c24xx_nand_data_w(uint8_t data); READ32_MEMBER( s3c24xx_nand_r ); void s3c24xx_nand_init_ecc(); WRITE32_MEMBER( s3c24xx_nand_w ); @@ -690,10 +690,10 @@ public: void s3c24xx_device_start(); - void s3c2440_uart_fifo_w( int uart, UINT8 data); + void s3c2440_uart_fifo_w( int uart, uint8_t data); void s3c2440_touch_screen( int state); - void s3c2440_request_irq( UINT32 int_type); - void s3c2440_request_eint( UINT32 number); + void s3c2440_request_irq( uint32_t int_type); + void s3c2440_request_eint( uint32_t number); /******************************************************************************* @@ -702,277 +702,277 @@ public: struct s3c24xx_memcon_regs_t { - UINT32 data[0x34/4]; + uint32_t data[0x34/4]; }; struct s3c24xx_usbhost_regs_t { - UINT32 data[0x5C/4]; + uint32_t data[0x5C/4]; }; struct s3c24xx_irq_regs_t { - UINT32 srcpnd; - UINT32 intmod; - UINT32 intmsk; - UINT32 priority; - UINT32 intpnd; - UINT32 intoffset; - UINT32 subsrcpnd; - UINT32 intsubmsk; + uint32_t srcpnd; + uint32_t intmod; + uint32_t intmsk; + uint32_t priority; + uint32_t intpnd; + uint32_t intoffset; + uint32_t subsrcpnd; + uint32_t intsubmsk; }; struct s3c24xx_dma_regs_t { - UINT32 disrc; - UINT32 disrcc; - UINT32 didst; - UINT32 didstc; - UINT32 dcon; - UINT32 dstat; - UINT32 dcsrc; - UINT32 dcdst; - UINT32 dmasktrig; + uint32_t disrc; + uint32_t disrcc; + uint32_t didst; + uint32_t didstc; + uint32_t dcon; + uint32_t dstat; + uint32_t dcsrc; + uint32_t dcdst; + uint32_t dmasktrig; }; struct s3c24xx_clkpow_regs_t { - UINT32 locktime; - UINT32 mpllcon; - UINT32 upllcon; - UINT32 clkcon; - UINT32 clkslow; - UINT32 clkdivn; - UINT32 camdivn; + uint32_t locktime; + uint32_t mpllcon; + uint32_t upllcon; + uint32_t clkcon; + uint32_t clkslow; + uint32_t clkdivn; + uint32_t camdivn; }; struct s3c24xx_lcd_regs_t { - UINT32 lcdcon1; - UINT32 lcdcon2; - UINT32 lcdcon3; - UINT32 lcdcon4; - UINT32 lcdcon5; - UINT32 lcdsaddr1; - UINT32 lcdsaddr2; - UINT32 lcdsaddr3; - UINT32 redlut; - UINT32 greenlut; - UINT32 bluelut; - UINT32 reserved[8]; - UINT32 dithmode; - UINT32 tpal; - UINT32 lcdintpnd; - UINT32 lcdsrcpnd; - UINT32 lcdintmsk; - UINT32 tconsel; + uint32_t lcdcon1; + uint32_t lcdcon2; + uint32_t lcdcon3; + uint32_t lcdcon4; + uint32_t lcdcon5; + uint32_t lcdsaddr1; + uint32_t lcdsaddr2; + uint32_t lcdsaddr3; + uint32_t redlut; + uint32_t greenlut; + uint32_t bluelut; + uint32_t reserved[8]; + uint32_t dithmode; + uint32_t tpal; + uint32_t lcdintpnd; + uint32_t lcdsrcpnd; + uint32_t lcdintmsk; + uint32_t tconsel; }; struct s3c24xx_lcdpal_regs_t { - UINT32 data[0x400/4]; + uint32_t data[0x400/4]; }; struct s3c24xx_nand_regs_t { - UINT32 nfconf; - UINT32 nfcont; - UINT32 nfcmd; - UINT32 nfaddr; - UINT32 nfdata; - UINT32 nfmeccd0; - UINT32 nfmeccd1; - UINT32 nfseccd; - UINT32 nfstat; - UINT32 nfestat0; - UINT32 nfestat1; - UINT32 nfmecc0; - UINT32 nfmecc1; - UINT32 nfsecc; - UINT32 nfsblk; - UINT32 nfeblk; + uint32_t nfconf; + uint32_t nfcont; + uint32_t nfcmd; + uint32_t nfaddr; + uint32_t nfdata; + uint32_t nfmeccd0; + uint32_t nfmeccd1; + uint32_t nfseccd; + uint32_t nfstat; + uint32_t nfestat0; + uint32_t nfestat1; + uint32_t nfmecc0; + uint32_t nfmecc1; + uint32_t nfsecc; + uint32_t nfsblk; + uint32_t nfeblk; }; struct s3c24xx_cam_regs_t { - UINT32 data[0xA4/4]; + uint32_t data[0xA4/4]; }; struct s3c24xx_uart_regs_t { - UINT32 ulcon; - UINT32 ucon; - UINT32 ufcon; - UINT32 umcon; - UINT32 utrstat; - UINT32 uerstat; - UINT32 ufstat; - UINT32 umstat; - UINT32 utxh; - UINT32 urxh; - UINT32 ubrdiv; + uint32_t ulcon; + uint32_t ucon; + uint32_t ufcon; + uint32_t umcon; + uint32_t utrstat; + uint32_t uerstat; + uint32_t ufstat; + uint32_t umstat; + uint32_t utxh; + uint32_t urxh; + uint32_t ubrdiv; }; struct s3c24xx_pwm_regs_t { - UINT32 tcfg0; - UINT32 tcfg1; - UINT32 tcon; - UINT32 tcntb0; - UINT32 tcmpb0; - UINT32 tcnto0; - UINT32 tcntb1; - UINT32 tcmpb1; - UINT32 tcnto1; - UINT32 tcntb2; - UINT32 tcmpb2; - UINT32 tcnto2; - UINT32 tcntb3; - UINT32 tcmpb3; - UINT32 tcnto3; - UINT32 tcntb4; - UINT32 tcnto4; + uint32_t tcfg0; + uint32_t tcfg1; + uint32_t tcon; + uint32_t tcntb0; + uint32_t tcmpb0; + uint32_t tcnto0; + uint32_t tcntb1; + uint32_t tcmpb1; + uint32_t tcnto1; + uint32_t tcntb2; + uint32_t tcmpb2; + uint32_t tcnto2; + uint32_t tcntb3; + uint32_t tcmpb3; + uint32_t tcnto3; + uint32_t tcntb4; + uint32_t tcnto4; }; struct s3c24xx_usbdev_regs_t { - UINT32 data[0x130/4]; + uint32_t data[0x130/4]; }; struct s3c24xx_wdt_regs_t { - UINT32 wtcon; - UINT32 wtdat; - UINT32 wtcnt; + uint32_t wtcon; + uint32_t wtdat; + uint32_t wtcnt; }; struct s3c24xx_iic_regs_t { - UINT32 iiccon; - UINT32 iicstat; - UINT32 iicadd; - UINT32 iicds; - UINT32 iiclc; + uint32_t iiccon; + uint32_t iicstat; + uint32_t iicadd; + uint32_t iicds; + uint32_t iiclc; }; struct s3c24xx_iis_regs_t { - UINT32 iiscon; - UINT32 iismod; - UINT32 iispsr; - UINT32 iisfcon; - UINT32 iisfifo; + uint32_t iiscon; + uint32_t iismod; + uint32_t iispsr; + uint32_t iisfcon; + uint32_t iisfifo; }; struct s3c24xx_gpio_regs_t { - UINT32 gpacon; - UINT32 gpadat; - UINT32 pad_08; - UINT32 pad_0c; - UINT32 gpbcon; - UINT32 gpbdat; - UINT32 gpbup; - UINT32 pad_1c; - UINT32 gpccon; - UINT32 gpcdat; - UINT32 gpcup; - UINT32 pad_2c; - UINT32 gpdcon; - UINT32 gpddat; - UINT32 gpdup; - UINT32 pad_3c; - UINT32 gpecon; - UINT32 gpedat; - UINT32 gpeup; - UINT32 pad_4c; - UINT32 gpfcon; - UINT32 gpfdat; - UINT32 gpfup; - UINT32 pad_5c; - UINT32 gpgcon; - UINT32 gpgdat; - UINT32 gpgup; - UINT32 pad_6c; - UINT32 gphcon; - UINT32 gphdat; - UINT32 gphup; - UINT32 pad_7c; - UINT32 misccr; - UINT32 dclkcon; - UINT32 extint0; - UINT32 extint1; - UINT32 extint2; - UINT32 eintflt0; - UINT32 eintflt1; - UINT32 eintflt2; - UINT32 eintflt3; - UINT32 eintmask; - UINT32 eintpend; - UINT32 gstatus0; - UINT32 gstatus1; - UINT32 gstatus2; - UINT32 gstatus3; - UINT32 gstatus4; - UINT32 pad_c0; - UINT32 pad_c4; - UINT32 pad_c8; - UINT32 mslcon; - UINT32 gpjcon; - UINT32 gpjdat; - UINT32 gpjup; + uint32_t gpacon; + uint32_t gpadat; + uint32_t pad_08; + uint32_t pad_0c; + uint32_t gpbcon; + uint32_t gpbdat; + uint32_t gpbup; + uint32_t pad_1c; + uint32_t gpccon; + uint32_t gpcdat; + uint32_t gpcup; + uint32_t pad_2c; + uint32_t gpdcon; + uint32_t gpddat; + uint32_t gpdup; + uint32_t pad_3c; + uint32_t gpecon; + uint32_t gpedat; + uint32_t gpeup; + uint32_t pad_4c; + uint32_t gpfcon; + uint32_t gpfdat; + uint32_t gpfup; + uint32_t pad_5c; + uint32_t gpgcon; + uint32_t gpgdat; + uint32_t gpgup; + uint32_t pad_6c; + uint32_t gphcon; + uint32_t gphdat; + uint32_t gphup; + uint32_t pad_7c; + uint32_t misccr; + uint32_t dclkcon; + uint32_t extint0; + uint32_t extint1; + uint32_t extint2; + uint32_t eintflt0; + uint32_t eintflt1; + uint32_t eintflt2; + uint32_t eintflt3; + uint32_t eintmask; + uint32_t eintpend; + uint32_t gstatus0; + uint32_t gstatus1; + uint32_t gstatus2; + uint32_t gstatus3; + uint32_t gstatus4; + uint32_t pad_c0; + uint32_t pad_c4; + uint32_t pad_c8; + uint32_t mslcon; + uint32_t gpjcon; + uint32_t gpjdat; + uint32_t gpjup; }; struct s3c24xx_rtc_regs_t { - UINT32 rtccon; - UINT32 ticnt; - UINT32 reserved[2]; - UINT32 rtcalm; - UINT32 almsec; - UINT32 almmin; - UINT32 almhour; - UINT32 almday; - UINT32 almmon; - UINT32 almyear; - UINT32 rtcrst; - UINT32 bcdsec; - UINT32 bcdmin; - UINT32 bcdhour; - UINT32 bcdday; - UINT32 bcddow; - UINT32 bcdmon; - UINT32 bcdyear; + uint32_t rtccon; + uint32_t ticnt; + uint32_t reserved[2]; + uint32_t rtcalm; + uint32_t almsec; + uint32_t almmin; + uint32_t almhour; + uint32_t almday; + uint32_t almmon; + uint32_t almyear; + uint32_t rtcrst; + uint32_t bcdsec; + uint32_t bcdmin; + uint32_t bcdhour; + uint32_t bcdday; + uint32_t bcddow; + uint32_t bcdmon; + uint32_t bcdyear; }; struct s3c24xx_adc_regs_t { - UINT32 adccon; - UINT32 adctsc; - UINT32 adcdly; - UINT32 adcdat0; - UINT32 adcdat1; - UINT32 adcupdn; + uint32_t adccon; + uint32_t adctsc; + uint32_t adcdly; + uint32_t adcdat0; + uint32_t adcdat1; + uint32_t adcupdn; }; struct s3c24xx_spi_regs_t { - UINT32 spcon; - UINT32 spsta; - UINT32 sppin; - UINT32 sppre; - UINT32 sptdat; - UINT32 sprdat; + uint32_t spcon; + uint32_t spsta; + uint32_t sppin; + uint32_t sppre; + uint32_t sptdat; + uint32_t sprdat; }; struct s3c24xx_sdi_regs_t { - UINT32 data[0x44/4]; + uint32_t data[0x44/4]; }; struct s3c24xx_ac97_regs_t { - UINT32 data[0x20/4]; + uint32_t data[0x20/4]; }; struct s3c24xx_memcon_t @@ -1007,18 +1007,18 @@ public: s3c24xx_lcd_regs_t regs; emu_timer *timer; std::unique_ptr bitmap[2]; - UINT32 vramaddr_cur; - UINT32 vramaddr_max; - UINT32 offsize; - UINT32 pagewidth_cur; - UINT32 pagewidth_max; - UINT32 bppmode; - UINT32 bswp, hwswp; + uint32_t vramaddr_cur; + uint32_t vramaddr_max; + uint32_t offsize; + uint32_t pagewidth_cur; + uint32_t pagewidth_max; + uint32_t bppmode; + uint32_t bswp, hwswp; int vpos, hpos; double framerate; - UINT32 tpal; - UINT32 hpos_min, hpos_max, vpos_min, vpos_max; - UINT32 dma_data, dma_bits; + uint32_t tpal; + uint32_t hpos_min, hpos_max, vpos_min, vpos_max; + uint32_t dma_data, dma_bits; }; struct s3c24xx_lcdpal_t @@ -1029,8 +1029,8 @@ public: struct s3c24xx_nand_t { s3c24xx_nand_regs_t regs; - UINT8 mecc[4]; - UINT8 secc[2]; + uint8_t mecc[4]; + uint8_t secc[2]; int ecc_pos, data_count; }; @@ -1048,9 +1048,9 @@ public: { s3c24xx_pwm_regs_t regs; emu_timer *timer[5]; - UINT32 cnt[5]; - UINT32 cmp[5]; - UINT32 freq[5]; + uint32_t cnt[5]; + uint32_t cmp[5]; + uint32_t freq[5]; }; struct s3c24xx_usbdev_t @@ -1075,7 +1075,7 @@ public: { s3c24xx_iis_regs_t regs; emu_timer *timer; - UINT16 fifo[16/2]; + uint16_t fifo[16/2]; int fifo_index; }; @@ -1112,7 +1112,7 @@ public: }; - UINT8 m_steppingstone[4*1024]; + uint8_t m_steppingstone[4*1024]; s3c24xx_memcon_t m_memcon; s3c24xx_usbhost_t m_usbhost; s3c24xx_irq_t m_irq; diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx index adb57cd1977..5019f40891f 100644 --- a/src/devices/machine/s3c24xx.hxx +++ b/src/devices/machine/s3c24xx.hxx @@ -19,8 +19,8 @@ #define CLOCK_MULTIPLIER 1 -#define BITS(x,m,n) (((x)>>(n))&(((UINT32)1<<((m)-(n)+1))-1)) -#define CLR_BITS(x,m,n) ((x) & ~((((UINT32)1 << ((m) - (n) + 1)) - 1) << n)) +#define BITS(x,m,n) (((x)>>(n))&(((uint32_t)1<<((m)-(n)+1))-1)) +#define CLR_BITS(x,m,n) ((x) & ~((((uint32_t)1 << ((m) - (n) + 1)) - 1) << n)) #if defined(DEVICE_S3C2400) @@ -131,11 +131,11 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_reset() lcd->timer->adjust( attotime::never); } -rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_tft_16(UINT16 data) +rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_tft_16(uint16_t data) { if ((m_lcd.regs.lcdcon5 & (1 << 11)) == 0) { - UINT8 r, g, b, i; + uint8_t r, g, b, i; r = (BITS( data, 15, 11) << 3); g = (BITS( data, 10, 6) << 3); b = (BITS( data, 5, 1) << 3); @@ -144,7 +144,7 @@ rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_tft_16(UINT16 data) } else { - UINT8 r, g, b; + uint8_t r, g, b; r = BITS( data, 15, 11) << 3; g = BITS( data, 10, 5) << 2; b = BITS( data, 4, 0) << 3; @@ -154,9 +154,9 @@ rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_tft_16(UINT16 data) #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) -rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_tft_24(UINT32 data) +rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_tft_24(uint32_t data) { - UINT8 r, g, b; + uint8_t r, g, b; r = BITS( data, 23, 16); g = BITS( data, 15, 8); b = BITS( data, 7, 0); @@ -165,25 +165,25 @@ rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_tft_24(UINT32 data) #endif -rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_12(UINT16 data) +rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_12(uint16_t data) { - UINT8 r, g, b; + uint8_t r, g, b; r = BITS( data, 11, 8) << 4; g = BITS( data, 7, 4) << 4; b = BITS( data, 3, 0) << 4; return rgb_t( r, g, b); } -rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_08( UINT8 data) +rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_08( uint8_t data) { - UINT8 r, g, b; + uint8_t r, g, b; r = ((m_lcd.regs.redlut >> (BITS( data, 7, 5) << 2)) & 0xF) << 4; g = ((m_lcd.regs.greenlut >> (BITS( data, 4, 2) << 2)) & 0xF) << 4; b = ((m_lcd.regs.bluelut >> (BITS( data, 1, 0) << 2)) & 0xF) << 4; return rgb_t( r, g, b); } -rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_01(UINT8 data) +rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_01(uint8_t data) { if ((data & 1) == 0) { @@ -195,16 +195,16 @@ rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_01(UINT8 data) } } -rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_02(UINT8 data) +rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_02(uint8_t data) { - UINT8 r, g, b; + uint8_t r, g, b; r = g = b = ((m_lcd.regs.bluelut >> (BITS( data, 1, 0) << 2)) & 0xF) << 4; return rgb_t( r, g, b); } -rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_04(UINT8 data) +rgb_t S3C24_CLASS_NAME::s3c24xx_get_color_stn_04(uint8_t data) { - UINT8 r, g, b; + uint8_t r, g, b; r = g = b = BITS( data, 3, 0) << 4; return rgb_t( r, g, b); } @@ -250,11 +250,11 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_dma_init() } #if 0 -UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() +uint32_t S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() { address_space& space = m_cpu->memory().space( AS_PROGRAM); - UINT8 *vram, data[4]; - vram = (UINT8 *)space.get_read_ptr( m_lcd.vramaddr_cur); + uint8_t *vram, data[4]; + vram = (uint8_t *)space.get_read_ptr( m_lcd.vramaddr_cur); for (int i = 0; i < 2; i++) { data[i*2+0] = *vram++; @@ -265,7 +265,7 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() { m_lcd.vramaddr_cur += m_lcd.offsize << 1; m_lcd.pagewidth_cur = 0; - vram = (UINT8 *)space.get_read_ptr( m_lcd.vramaddr_cur); + vram = (uint8_t *)space.get_read_ptr( m_lcd.vramaddr_cur); } } if (m_lcd.hwswp == 0) @@ -293,11 +293,11 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() } #endif -UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() +uint32_t S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() { address_space& space = m_cpu->memory().space( AS_PROGRAM); - UINT8 *vram, data[4]; - vram = (UINT8 *)space.get_read_ptr( m_lcd.vramaddr_cur); + uint8_t *vram, data[4]; + vram = (uint8_t *)space.get_read_ptr( m_lcd.vramaddr_cur); for (int i = 0; i < 2; i++) { if (m_lcd.hwswp == 0) @@ -348,7 +348,7 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() { m_lcd.vramaddr_cur += m_lcd.offsize << 1; m_lcd.pagewidth_cur = 0; - vram = (UINT8 *)space.get_read_ptr( m_lcd.vramaddr_cur); + vram = (uint8_t *)space.get_read_ptr( m_lcd.vramaddr_cur); } else { @@ -365,9 +365,9 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read() } } -UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read_bits(int count) +uint32_t S3C24_CLASS_NAME::s3c24xx_lcd_dma_read_bits(int count) { - UINT32 data; + uint32_t data; if (count <= m_lcd.dma_bits) { m_lcd.dma_bits -= count; @@ -384,7 +384,7 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read_bits(int count) } else { - UINT32 temp = s3c24xx_lcd_dma_read(); + uint32_t temp = s3c24xx_lcd_dma_read(); data = BITS( temp, 31, 32 - count); m_lcd.dma_data = temp << count; m_lcd.dma_bits = 32 - count; @@ -392,7 +392,7 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read_bits(int count) } else { - UINT32 temp = s3c24xx_lcd_dma_read(); + uint32_t temp = s3c24xx_lcd_dma_read(); data = (m_lcd.dma_data >> (32 - count)) | BITS( temp, 31, 32 - (count - m_lcd.dma_bits)); m_lcd.dma_data = temp << (count - m_lcd.dma_bits); m_lcd.dma_bits = 32 - (count - m_lcd.dma_bits); @@ -404,10 +404,10 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_lcd_dma_read_bits(int count) void S3C24_CLASS_NAME::s3c24xx_lcd_render_tpal() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 color = s3c24xx_get_color_tpal(); + uint32_t color = s3c24xx_get_color_tpal(); for (int y = m_lcd.vpos_min; y <= m_lcd.vpos_max; y++) { - UINT32 *scanline = &bitmap.pix32(y, m_lcd.hpos_min); + uint32_t *scanline = &bitmap.pix32(y, m_lcd.hpos_min); for (int x = m_lcd.hpos_min; x <= m_lcd.hpos_max; x++) { *scanline++ = color; @@ -418,10 +418,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tpal() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 32; j++) { if (m_flags & S3C24XX_INTERFACE_LCD_REVERSE) @@ -449,10 +449,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 16; j++) { *scanline++ = s3c24xx_get_color_stn_02((data >> 30) & 0x03); @@ -472,10 +472,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 8; j++) { *scanline++ = s3c24xx_get_color_stn_04((data >> 28) & 0x0F); @@ -495,10 +495,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 4; j++) { *scanline++ = s3c24xx_get_color_stn_08((data >> 24) & 0xFF); @@ -518,7 +518,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 16; i++) { *scanline++ = s3c24xx_get_color_stn_12(s3c24xx_lcd_dma_read_bits(12)); @@ -536,10 +536,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p() void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 2; j++) { *scanline++ = s3c24xx_get_color_stn_12((data >> 16) & 0x0FFF); @@ -559,10 +559,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 32; j++) { *scanline++ = m_palette->pen_color((data >> 31) & 0x01); @@ -582,10 +582,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01() void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 16; j++) { *scanline++ = m_palette->pen_color((data >> 30) & 0x03); @@ -605,10 +605,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02() void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 8; j++) { *scanline++ = m_palette->pen_color((data >> 28) & 0x0F); @@ -628,10 +628,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04() void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 4; j++) { *scanline++ = m_palette->pen_color((data >> 24) & 0xFF); @@ -651,10 +651,10 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08() void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_16() { bitmap_rgb32 &bitmap = *m_lcd.bitmap[0]; - UINT32 *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos); for (int i = 0; i < 4; i++) { - UINT32 data = s3c24xx_lcd_dma_read(); + uint32_t data = s3c24xx_lcd_dma_read(); for (int j = 0; j < 2; j++) { *scanline++ = s3c24xx_get_color_tft_16((data >> 16) & 0xFFFF); @@ -674,7 +674,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_16() TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_timer_exp ) { screen_device *screen = machine().first_screen(); - UINT32 tpalen; + uint32_t tpalen; verboselog( *this, 2, "LCD timer callback\n"); m_lcd.vpos = screen->vpos(); m_lcd.hpos = screen->hpos(); @@ -725,28 +725,28 @@ void S3C24_CLASS_NAME::bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bit { for (int y = 0; y < bitmap_dst.height(); y++) { - UINT32 *line0 = &bitmap_src_1.pix32(y); - UINT32 *line1 = &bitmap_src_2.pix32(y); - UINT32 *line2 = &bitmap_dst.pix32(y); + uint32_t *line0 = &bitmap_src_1.pix32(y); + uint32_t *line1 = &bitmap_src_2.pix32(y); + uint32_t *line2 = &bitmap_dst.pix32(y); for (int x = 0; x < bitmap_dst.width(); 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); line2[x] = (r << 16) | (g << 8) | b; } } } -UINT32 S3C24_CLASS_NAME::s3c24xx_video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t S3C24_CLASS_NAME::s3c24xx_video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_lcd.regs.lcdcon1 & (1 << 0)) { @@ -767,13 +767,13 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_video_update(screen_device &screen, bitmap_rgb3 READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_r ) { - UINT32 data = ((UINT32*)&m_lcd.regs)[offset]; + uint32_t data = ((uint32_t*)&m_lcd.regs)[offset]; switch (offset) { case S3C24XX_LCDCON1 : { // make sure line counter is going - UINT32 vpos = machine().first_screen()->vpos(); + uint32_t vpos = machine().first_screen()->vpos(); if (vpos < m_lcd.vpos_min) vpos = m_lcd.vpos_min; if (vpos > m_lcd.vpos_max) vpos = m_lcd.vpos_max; data = (data & ~0xFFFC0000) | ((m_lcd.vpos_max - vpos) << 18); @@ -781,7 +781,7 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_r ) break; case S3C24XX_LCDCON5 : { - UINT32 vpos = machine().first_screen()->vpos(); + uint32_t vpos = machine().first_screen()->vpos(); data = data & ~0x00018000; if (vpos < m_lcd.vpos_min) data = data | 0x00000000; if (vpos > m_lcd.vpos_max) data = data | 0x00018000; @@ -796,9 +796,9 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_r ) int S3C24_CLASS_NAME::s3c24xx_lcd_configure_tft() { screen_device *screen = machine().first_screen(); - UINT32 vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk; + uint32_t vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk; double framerate, vclk; - UINT32 width, height; + uint32_t width, height; rectangle visarea; verboselog( *this, 5, "s3c24xx_lcd_configure_tft\n"); vspw = BITS( m_lcd.regs.lcdcon2, 5, 0); @@ -836,9 +836,9 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure_tft() int S3C24_CLASS_NAME::s3c24xx_lcd_configure_stn() { screen_device *screen = machine().first_screen(); - UINT32 pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk; + uint32_t pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk; double vclk, framerate; - UINT32 width, height; + uint32_t width, height; rectangle visarea; verboselog( *this, 5, "s3c24xx_lcd_configure_stn\n"); pnrmode = BITS( m_lcd.regs.lcdcon1, 6, 5); @@ -881,7 +881,7 @@ int S3C24_CLASS_NAME::s3c24xx_lcd_configure_stn() int S3C24_CLASS_NAME::s3c24xx_lcd_configure() { - UINT32 bppmode; + uint32_t bppmode; verboselog( *this, 5, "s3c24xx_lcd_configure\n"); bppmode = BITS( m_lcd.regs.lcdcon1, 4, 1); if ((bppmode & (1 << 3)) == 0) @@ -925,9 +925,9 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_recalc() WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_w ) { - UINT32 old_value = ((UINT32*)&m_lcd.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_lcd.regs)[offset]; verboselog( *this, 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCD + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_lcd.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_lcd.regs)[offset]); switch (offset) { case S3C24XX_LCDCON1 : @@ -945,7 +945,7 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_w ) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_lcd_palette_r ) { - UINT32 data = m_lcdpal.regs.data[offset]; + uint32_t data = m_lcdpal.regs.data[offset]; verboselog( *this, 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data); return data; } @@ -986,9 +986,9 @@ void S3C24_CLASS_NAME::s3c24xx_clkpow_reset() clkpow->regs.clkslow = 4; } -UINT32 S3C24_CLASS_NAME::s3c24xx_get_fclk() +uint32_t S3C24_CLASS_NAME::s3c24xx_get_fclk() { - UINT32 mpllcon, clkslow, mdiv, pdiv, sdiv, fclk; + uint32_t mpllcon, clkslow, mdiv, pdiv, sdiv, fclk; double temp1, temp2; mpllcon = m_clkpow.regs.mpllcon; mdiv = BITS( mpllcon, 19, 12); @@ -1000,11 +1000,11 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_get_fclk() temp1 = 2 * (mdiv + 8) * (double)clock(); #endif temp2 = (double)((pdiv + 2) * (1 << sdiv)); - fclk = (UINT32)(temp1 / temp2); + fclk = (uint32_t)(temp1 / temp2); clkslow = m_clkpow.regs.clkslow; if (BIT( clkslow, 4) == 1) { - UINT32 slow_val = BITS( clkslow, 2, 0); + uint32_t slow_val = BITS( clkslow, 2, 0); if (slow_val > 0) { fclk = fclk / (2 * slow_val); @@ -1013,7 +1013,7 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_get_fclk() return fclk; } -UINT32 S3C24_CLASS_NAME::s3c24xx_get_hclk() +uint32_t S3C24_CLASS_NAME::s3c24xx_get_hclk() { #if defined(DEVICE_S3C2400) || defined(DEVICE_S3C2410) return s3c24xx_get_fclk() / (BIT( m_clkpow.regs.clkdivn, 1) + 1); @@ -1029,14 +1029,14 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_get_hclk() #endif } -UINT32 S3C24_CLASS_NAME::s3c24xx_get_pclk() +uint32_t S3C24_CLASS_NAME::s3c24xx_get_pclk() { return s3c24xx_get_hclk() / (1 << BIT( m_clkpow.regs.clkdivn, 0)); } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_clkpow_r ) { - UINT32 data = ((UINT32*)&m_clkpow.regs)[offset]; + uint32_t data = ((uint32_t*)&m_clkpow.regs)[offset]; verboselog( *this, 9, "(CLKPOW) %08X -> %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data); return data; } @@ -1044,7 +1044,7 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_clkpow_r ) WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_clkpow_w ) { verboselog( *this, 9, "(CLKPOW) %08X <- %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_clkpow.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_clkpow.regs)[offset]); switch (offset) { case S3C24XX_MPLLCON : @@ -1080,7 +1080,7 @@ void S3C24_CLASS_NAME::s3c24xx_irq_reset() void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() { - UINT32 temp; + uint32_t temp; // normal irq if ((m_irq.regs.intpnd == 0) && (m_irq.regs.intoffset == 0)) // without this "touryuu" crashes @@ -1088,7 +1088,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() temp = (m_irq.regs.srcpnd & ~m_irq.regs.intmsk) & ~m_irq.regs.intmod; if (temp != 0) { - UINT32 int_type = 0; + uint32_t int_type = 0; verboselog( *this, 5, "srcpnd %08X intmsk %08X intmod %08X\n", m_irq.regs.srcpnd, m_irq.regs.intmsk, m_irq.regs.intmod); while ((temp & 1) == 0) { @@ -1121,7 +1121,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() temp = (m_irq.regs.srcpnd & ~m_irq.regs.intmsk) & m_irq.regs.intmod; if (temp != 0) { - UINT32 int_type = 0; + uint32_t int_type = 0; while ((temp & 1) == 0) { int_type++; @@ -1145,7 +1145,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() } } -void S3C24_CLASS_NAME::s3c24xx_request_irq(UINT32 int_type) +void S3C24_CLASS_NAME::s3c24xx_request_irq(uint32_t int_type) { verboselog( *this, 5, "request irq %d\n", int_type); m_irq.regs.srcpnd |= (1 << int_type); @@ -1156,10 +1156,10 @@ void S3C24_CLASS_NAME::s3c24xx_request_irq(UINT32 int_type) void S3C24_CLASS_NAME::s3c24xx_check_pending_subirq() { - UINT32 temp = m_irq.regs.subsrcpnd & ~m_irq.regs.intsubmsk; + uint32_t temp = m_irq.regs.subsrcpnd & ~m_irq.regs.intsubmsk; if (temp != 0) { - UINT32 int_type = 0; + uint32_t int_type = 0; while ((temp & 1) == 0) { int_type++; @@ -1169,7 +1169,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_subirq() } } -ATTR_UNUSED void S3C24_CLASS_NAME::s3c24xx_request_subirq( UINT32 int_type) +ATTR_UNUSED void S3C24_CLASS_NAME::s3c24xx_request_subirq( uint32_t int_type) { verboselog( *this, 5, "request subirq %d\n", int_type); m_irq.regs.subsrcpnd |= (1 << int_type); @@ -1178,10 +1178,10 @@ ATTR_UNUSED void S3C24_CLASS_NAME::s3c24xx_request_subirq( UINT32 int_type) void S3C24_CLASS_NAME::s3c24xx_check_pending_eint() { - UINT32 temp = m_gpio.regs.eintpend & ~m_gpio.regs.eintmask; + uint32_t temp = m_gpio.regs.eintpend & ~m_gpio.regs.eintmask; if (temp != 0) { - UINT32 int_type = 0; + uint32_t int_type = 0; while ((temp & 1) == 0) { int_type++; @@ -1198,7 +1198,7 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_eint() } } -ATTR_UNUSED void S3C24_CLASS_NAME::s3c24xx_request_eint(UINT32 number) +ATTR_UNUSED void S3C24_CLASS_NAME::s3c24xx_request_eint(uint32_t number) { verboselog( *this, 5, "request external interrupt %d\n", number); if (number < 4) @@ -1216,16 +1216,16 @@ ATTR_UNUSED void S3C24_CLASS_NAME::s3c24xx_request_eint(UINT32 number) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_irq_r ) { - UINT32 data = ((UINT32*)&m_irq.regs)[offset]; + uint32_t data = ((uint32_t*)&m_irq.regs)[offset]; verboselog( *this, 9, "(IRQ) %08X -> %08X\n", S3C24XX_BASE_INT + (offset << 2), data); return data; } WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_irq_w ) { - UINT32 old_value = ((UINT32*)&m_irq.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_irq.regs)[offset]; verboselog( *this, 9, "(IRQ) %08X <- %08X\n", S3C24XX_BASE_INT + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_irq.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_irq.regs)[offset]); switch (offset) { case S3C24XX_SRCPND : @@ -1275,10 +1275,10 @@ void S3C24_CLASS_NAME::s3c24xx_pwm_reset() } } -UINT16 S3C24_CLASS_NAME::s3c24xx_pwm_calc_observation(int ch) +uint16_t S3C24_CLASS_NAME::s3c24xx_pwm_calc_observation(int ch) { double timeleft, x1, x2; - UINT32 cnto; + uint32_t cnto; timeleft = m_pwm.timer[ch]->remaining( ).as_double(); // printf( "timeleft %f freq %d cntb %d cmpb %d\n", timeleft, m_pwm.freq[ch], m_pwm.cnt[ch], m_pwm.cmp[ch]); x1 = 1 / ((double)m_pwm.freq[ch] / (m_pwm.cnt[ch]- m_pwm.cmp[ch] + 1)); @@ -1291,7 +1291,7 @@ UINT16 S3C24_CLASS_NAME::s3c24xx_pwm_calc_observation(int ch) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_pwm_r ) { - UINT32 data = ((UINT32*)&m_pwm.regs)[offset]; + uint32_t data = ((uint32_t*)&m_pwm.regs)[offset]; switch (offset) { case S3C24XX_TCNTO0 : @@ -1329,7 +1329,7 @@ void S3C24_CLASS_NAME::s3c24xx_pwm_start(int timer) const int mux_table[] = { 2, 4, 8, 16}; const int prescaler_shift[] = { 0, 0, 8, 8, 8}; const int mux_shift[] = { 0, 4, 8, 12, 16}; - UINT32 pclk, prescaler, mux, cnt, cmp, auto_reload; + uint32_t pclk, prescaler, mux, cnt, cmp, auto_reload; double freq, hz; verboselog( *this, 1, "PWM %d start\n", timer); pclk = s3c24xx_get_pclk(); @@ -1431,9 +1431,9 @@ void S3C24_CLASS_NAME::s3c24xx_pwm_recalc(int timer) WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_pwm_w ) { - UINT32 old_value = ((UINT32*)&m_pwm.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_pwm.regs)[offset]; verboselog( *this, 9, "(PWM) %08X <- %08X\n", S3C24XX_BASE_PWM + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_pwm.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_pwm.regs)[offset]); switch (offset) { case S3C24XX_TCON : @@ -1501,10 +1501,10 @@ void S3C24_CLASS_NAME::s3c24xx_dma_reload(int ch) void S3C24_CLASS_NAME::s3c24xx_dma_trigger(int ch) { s3c24xx_dma_regs_t *regs = &m_dma[ch].regs; - UINT32 curr_tc, curr_src, curr_dst; + uint32_t curr_tc, curr_src, curr_dst; address_space &space = m_cpu->memory().space( AS_PROGRAM); int dsz, inc_src, inc_dst, servmode, tsz; - const UINT32 ch_int[] = { S3C24XX_INT_DMA0, S3C24XX_INT_DMA1, S3C24XX_INT_DMA2, S3C24XX_INT_DMA3}; + const uint32_t ch_int[] = { S3C24XX_INT_DMA0, S3C24XX_INT_DMA1, S3C24XX_INT_DMA2, S3C24XX_INT_DMA3}; verboselog( *this, 5, "DMA %d trigger\n", ch); curr_tc = S3C24XX_DSTAT_GET_CURR_TC( regs->dstat); dsz = S3C24XX_DCON_GET_DSZ( regs->dcon); @@ -1584,9 +1584,9 @@ void S3C24_CLASS_NAME::s3c24xx_dma_request_pwm() void S3C24_CLASS_NAME::s3c24xx_dma_start(int ch) { - UINT32 addr_src, addr_dst, tc; + uint32_t addr_src, addr_dst, tc; s3c24xx_dma_regs_t *regs = &m_dma[ch].regs; - UINT32 dsz, tsz, reload; + uint32_t dsz, tsz, reload; int inc_src, inc_dst, _int, servmode, swhwsel, hwsrcsel; verboselog( *this, 1, "DMA %d start\n", ch); addr_src = S3C24XX_DISRC_GET_SADDR( regs->disrc); @@ -1632,15 +1632,15 @@ void S3C24_CLASS_NAME::s3c24xx_dma_recalc(int ch) } } -UINT32 S3C24_CLASS_NAME::s3c24xx_dma_r(UINT32 ch, UINT32 offset) +uint32_t S3C24_CLASS_NAME::s3c24xx_dma_r(uint32_t ch, uint32_t offset) { - return ((UINT32*)&m_dma[ch].regs)[offset]; + return ((uint32_t*)&m_dma[ch].regs)[offset]; } -void S3C24_CLASS_NAME::s3c24xx_dma_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask) +void S3C24_CLASS_NAME::s3c24xx_dma_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask) { - UINT32 old_value = ((UINT32*)&m_dma[ch].regs)[offset]; - COMBINE_DATA(&((UINT32*)&m_dma[ch].regs)[offset]); + uint32_t old_value = ((uint32_t*)&m_dma[ch].regs)[offset]; + COMBINE_DATA(&((uint32_t*)&m_dma[ch].regs)[offset]); switch (offset) { case S3C24XX_DCON : @@ -1667,28 +1667,28 @@ void S3C24_CLASS_NAME::s3c24xx_dma_w(UINT32 ch, UINT32 offset, UINT32 data, UINT READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_0_r ) { - UINT32 data = s3c24xx_dma_r( 0, offset); + uint32_t data = s3c24xx_dma_r( 0, offset); verboselog( *this, 9, "(DMA 0) %08X -> %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data); return data; } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_1_r ) { - UINT32 data = s3c24xx_dma_r( 1, offset); + uint32_t data = s3c24xx_dma_r( 1, offset); verboselog( *this, 9, "(DMA 1) %08X -> %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data); return data; } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_2_r ) { - UINT32 data = s3c24xx_dma_r( 2, offset); + uint32_t data = s3c24xx_dma_r( 2, offset); verboselog( *this, 9, "(DMA 2) %08X -> %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data); return data; } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_dma_3_r ) { - UINT32 data = s3c24xx_dma_r( 3, offset); + uint32_t data = s3c24xx_dma_r( 3, offset); verboselog( *this, 9, "(DMA 3) %08X -> %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data); return data; } @@ -1753,7 +1753,7 @@ void S3C24_CLASS_NAME::s3c24xx_gpio_reset() #endif } -UINT32 S3C24_CLASS_NAME::iface_gpio_port_r(int port, UINT32 mask) +uint32_t S3C24_CLASS_NAME::iface_gpio_port_r(int port, uint32_t mask) { if (!m_port_r_cb.isnull()) { @@ -1768,7 +1768,7 @@ UINT32 S3C24_CLASS_NAME::iface_gpio_port_r(int port, UINT32 mask) } } -void S3C24_CLASS_NAME::iface_gpio_port_w(int port, UINT32 mask, UINT32 data) +void S3C24_CLASS_NAME::iface_gpio_port_w(int port, uint32_t mask, uint32_t data) { if (!m_port_w_cb.isnull()) { @@ -1776,9 +1776,9 @@ void S3C24_CLASS_NAME::iface_gpio_port_w(int port, UINT32 mask, UINT32 data) } } -UINT16 S3C24_CLASS_NAME::s3c24xx_gpio_get_mask( UINT32 con, int val) +uint16_t S3C24_CLASS_NAME::s3c24xx_gpio_get_mask( uint32_t con, int val) { - UINT16 mask = 0; + uint16_t mask = 0; for (int i = 0; i < 16; i++) { if (((con >> (i << 1)) & 3) == val) @@ -1792,7 +1792,7 @@ UINT16 S3C24_CLASS_NAME::s3c24xx_gpio_get_mask( UINT32 con, int val) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_gpio_r ) { s3c24xx_gpio_t *gpio = &m_gpio; - UINT32 data = ((UINT32*)&m_gpio.regs)[offset]; + uint32_t data = ((uint32_t*)&m_gpio.regs)[offset]; switch (offset) { case S3C24XX_GPADAT : @@ -1853,10 +1853,10 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_gpio_w ) { s3c24xx_gpio_t *gpio = &m_gpio; #if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440) - UINT32 old_value = ((UINT32*)&m_gpio.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_gpio.regs)[offset]; #endif verboselog( *this, 9, "(GPIO) %08X <- %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_gpio.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_gpio.regs)[offset]); switch (offset) { case S3C24XX_GPADAT : @@ -1947,7 +1947,7 @@ void S3C24_CLASS_NAME::s3c24xx_memcon_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_memcon_r ) { assert(offset < ARRAY_LENGTH(m_memcon.regs.data)); - UINT32 data = m_memcon.regs.data[offset]; + uint32_t data = m_memcon.regs.data[offset]; verboselog( *this, 9, "(MEMCON) %08X -> %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data); return data; } @@ -1968,7 +1968,7 @@ void S3C24_CLASS_NAME::s3c24xx_usb_host_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_usb_host_r ) { - UINT32 data = m_usbhost.regs.data[offset]; + uint32_t data = m_usbhost.regs.data[offset]; switch (offset) { // HcCommandStatus @@ -2021,9 +2021,9 @@ void S3C24_CLASS_NAME::s3c24xx_uart_reset() } } -UINT32 S3C24_CLASS_NAME::s3c24xx_uart_r(UINT32 ch, UINT32 offset) +uint32_t S3C24_CLASS_NAME::s3c24xx_uart_r(uint32_t ch, uint32_t offset) { - UINT32 data = ((UINT32*)&m_uart[ch].regs)[offset]; + uint32_t data = ((uint32_t*)&m_uart[ch].regs)[offset]; switch (offset) { case S3C24XX_UTRSTAT : @@ -2033,7 +2033,7 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_uart_r(UINT32 ch, UINT32 offset) break; case S3C24XX_URXH : { - UINT8 rxdata = data & 0xFF; + uint8_t rxdata = data & 0xFF; verboselog( *this, 5, "UART %d read %02X (%c)\n", ch, rxdata, ((rxdata >= 32) && (rxdata < 128)) ? (char)rxdata : '?'); m_uart[ch].regs.utrstat &= ~1; // [bit 0] Receive buffer data ready } @@ -2042,9 +2042,9 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_uart_r(UINT32 ch, UINT32 offset) return data; } -void S3C24_CLASS_NAME::s3c24xx_uart_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask) +void S3C24_CLASS_NAME::s3c24xx_uart_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask) { - COMBINE_DATA(&((UINT32*)&m_uart[ch].regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_uart[ch].regs)[offset]); switch (offset) { case S3C24XX_UFCON : @@ -2054,7 +2054,7 @@ void S3C24_CLASS_NAME::s3c24xx_uart_w(UINT32 ch, UINT32 offset, UINT32 data, UIN break; case S3C24XX_UTXH : { - UINT8 txdata = data & 0xFF; + uint8_t txdata = data & 0xFF; verboselog( *this, 5, "UART %d write %02X (%c)\n", ch, txdata, ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?'); #ifdef UART_PRINTF printf( "%c", ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?'); @@ -2066,14 +2066,14 @@ void S3C24_CLASS_NAME::s3c24xx_uart_w(UINT32 ch, UINT32 offset, UINT32 data, UIN READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_0_r ) { - UINT32 data = s3c24xx_uart_r( 0, offset); + uint32_t data = s3c24xx_uart_r( 0, offset); // verboselog( *this, 9, "(UART 0) %08X -> %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data); return data; } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_1_r ) { - UINT32 data = s3c24xx_uart_r( 1, offset); + uint32_t data = s3c24xx_uart_r( 1, offset); // verboselog( *this, 9, "(UART 1) %08X -> %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data); return data; } @@ -2082,7 +2082,7 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_1_r ) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_2_r ) { - UINT32 data = s3c24xx_uart_r( 2, offset); + uint32_t data = s3c24xx_uart_r( 2, offset); // verboselog( *this, 9, "(UART 2) %08X -> %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data); return data; } @@ -2111,7 +2111,7 @@ WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_uart_2_w ) #endif -void S3C24_CLASS_NAME::s3c24xx_uart_fifo_w(int uart, UINT8 data) +void S3C24_CLASS_NAME::s3c24xx_uart_fifo_w(int uart, uint8_t data) { // printf( "s3c24xx_uart_fifo_w (%c)\n", data); m_uart[uart].regs.urxh = data; @@ -2143,7 +2143,7 @@ void S3C24_CLASS_NAME::s3c24xx_usb_device_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_usb_device_r ) { - UINT32 data = m_usbdev.regs.data[offset]; + uint32_t data = m_usbdev.regs.data[offset]; verboselog( *this, 9, "(USB D) %08X -> %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data); return data; } @@ -2168,10 +2168,10 @@ void S3C24_CLASS_NAME::s3c24xx_wdt_reset() #if defined(DEVICE_S3C2410) -UINT16 S3C24_CLASS_NAME::s3c24xx_wdt_calc_current_count() +uint16_t S3C24_CLASS_NAME::s3c24xx_wdt_calc_current_count() { double timeleft, x1, x2; - UINT32 cnt; + uint32_t cnt; timeleft = m_wdt.timer->remaining( ).as_double(); // printf( "timeleft %f freq %d cnt %d\n", timeleft, m_wdt.freq, m_wdt.cnt); x1 = 1 / ((double)m_wdt.freq / m_wdt.cnt); @@ -2184,7 +2184,7 @@ UINT16 S3C24_CLASS_NAME::s3c24xx_wdt_calc_current_count() #else -UINT16 S3C24_CLASS_NAME::s3c24xx_wdt_calc_current_count() +uint16_t S3C24_CLASS_NAME::s3c24xx_wdt_calc_current_count() { return 0; } @@ -2193,7 +2193,7 @@ UINT16 S3C24_CLASS_NAME::s3c24xx_wdt_calc_current_count() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_wdt_r ) { - UINT32 data = ((UINT32*)&m_wdt.regs)[offset]; + uint32_t data = ((uint32_t*)&m_wdt.regs)[offset]; switch (offset) { case S3C24XX_WTCNT : @@ -2212,7 +2212,7 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_wdt_r ) void S3C24_CLASS_NAME::s3c24xx_wdt_start() { - UINT32 pclk, prescaler, clock; + uint32_t pclk, prescaler, clock; double freq, hz; verboselog( *this, 1, "WDT start\n"); pclk = s3c24xx_get_pclk(); @@ -2249,9 +2249,9 @@ void S3C24_CLASS_NAME::s3c24xx_wdt_recalc() WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_wdt_w ) { - UINT32 old_value = ((UINT32*)&m_wdt.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_wdt.regs)[offset]; verboselog( *this, 9, "(WDT) %08X <- %08X\n", S3C24XX_BASE_WDT + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_wdt.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_wdt.regs)[offset]); switch (offset) { case S3C24XX_WTCON : @@ -2341,9 +2341,9 @@ void S3C24_CLASS_NAME::i2c_send_stop() iface_i2c_scl_w( 0); } -UINT8 S3C24_CLASS_NAME::i2c_receive_byte(int ack) +uint8_t S3C24_CLASS_NAME::i2c_receive_byte(int ack) { - UINT8 data = 0; + uint8_t data = 0; verboselog( *this, 5, "i2c_receive_byte ...\n"); iface_i2c_sda_w( 1); for (int i = 0; i < 8; i++) @@ -2360,7 +2360,7 @@ UINT8 S3C24_CLASS_NAME::i2c_receive_byte(int ack) return data; } -int S3C24_CLASS_NAME::i2c_send_byte(UINT8 data) +int S3C24_CLASS_NAME::i2c_send_byte(uint8_t data) { int ack; verboselog( *this, 5, "i2c_send_byte ...\n"); @@ -2416,7 +2416,7 @@ void S3C24_CLASS_NAME::iic_resume() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iic_r ) { - UINT32 data = ((UINT32*)&m_iic.regs)[offset]; + uint32_t data = ((uint32_t*)&m_iic.regs)[offset]; switch (offset) { case S3C24XX_IICSTAT : @@ -2431,9 +2431,9 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iic_r ) WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iic_w ) { - UINT32 old_value = ((UINT32*)&m_iic.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_iic.regs)[offset]; verboselog( *this, 9, "(IIC) %08X <- %08X\n", S3C24XX_BASE_IIC + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_iic.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_iic.regs)[offset]); switch (offset) { case S3C24XX_IICCON : @@ -2531,7 +2531,7 @@ void S3C24_CLASS_NAME::s3c24xx_iis_reset() iis->timer->adjust( attotime::never); } -void S3C24_CLASS_NAME::iface_i2s_data_w(int ch, UINT16 data) +void S3C24_CLASS_NAME::iface_i2s_data_w(int ch, uint16_t data) { if (!m_data_w_cb.isnull()) { @@ -2541,7 +2541,7 @@ void S3C24_CLASS_NAME::iface_i2s_data_w(int ch, UINT16 data) void S3C24_CLASS_NAME::s3c24xx_iis_start() { - const UINT32 codeclk_table[] = { 256, 384}; + const uint32_t codeclk_table[] = { 256, 384}; double freq; int pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk; verboselog( *this, 1, "IIS start\n"); @@ -2575,7 +2575,7 @@ void S3C24_CLASS_NAME::s3c24xx_iis_recalc() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iis_r ) { - UINT32 data = ((UINT32*)&m_iis.regs)[offset]; + uint32_t data = ((uint32_t*)&m_iis.regs)[offset]; #if 0 switch (offset) { @@ -2592,9 +2592,9 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iis_r ) WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_iis_w ) { - UINT32 old_value = ((UINT32*)&m_iis.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_iis.regs)[offset]; verboselog( *this, 9, "(IIS) %08X <- %08X\n", S3C24XX_BASE_IIS + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_iis.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_iis.regs)[offset]); switch (offset) { case S3C24XX_IISCON : @@ -2646,7 +2646,7 @@ void S3C24_CLASS_NAME::s3c24xx_rtc_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_rtc_r ) { - UINT32 data = ((UINT32*)&m_rtc.regs)[offset]; + uint32_t data = ((uint32_t*)&m_rtc.regs)[offset]; verboselog( *this, 9, "(RTC) %08X -> %08X\n", S3C24XX_BASE_RTC + (offset << 2), data); return data; } @@ -2655,7 +2655,7 @@ void S3C24_CLASS_NAME::s3c24xx_rtc_recalc() { if (m_rtc.regs.ticnt & (1 << 7)) { - UINT32 ttc; + uint32_t ttc; double freq; ttc = BITS( m_rtc.regs.ticnt, 6, 0); freq = 128 / (ttc + 1); @@ -2671,7 +2671,7 @@ void S3C24_CLASS_NAME::s3c24xx_rtc_recalc() WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_rtc_w ) { verboselog( *this, 9, "(RTC) %08X <- %08X\n", S3C24XX_BASE_RTC + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_rtc.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_rtc.regs)[offset]); switch (offset) { case S3C24XX_TICNT : @@ -2690,7 +2690,7 @@ TIMER_CALLBACK_MEMBER( S3C24_CLASS_NAME::s3c24xx_rtc_timer_tick_count_exp ) void S3C24_CLASS_NAME::s3c24xx_rtc_update() { - UINT32 bcdday_max; + uint32_t bcdday_max; // increase second m_rtc.regs.bcdsec = bcd_adjust( m_rtc.regs.bcdsec + 1); if (m_rtc.regs.bcdsec >= 0x60) @@ -2771,7 +2771,7 @@ void S3C24_CLASS_NAME::s3c24xx_adc_reset() #endif } -UINT32 S3C24_CLASS_NAME::iface_adc_data_r(int ch) +uint32_t S3C24_CLASS_NAME::iface_adc_data_r(int ch) { if (!m_data_r_cb.isnull()) { @@ -2792,7 +2792,7 @@ UINT32 S3C24_CLASS_NAME::iface_adc_data_r(int ch) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_adc_r ) { - UINT32 data = ((UINT32*)&m_adc.regs)[offset]; + uint32_t data = ((uint32_t*)&m_adc.regs)[offset]; switch (offset) { #if defined(DEVICE_S3C2400) @@ -2830,9 +2830,9 @@ void S3C24_CLASS_NAME::s3c24xx_adc_start() WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_adc_w ) { - UINT32 old_value = ((UINT32*)&m_adc.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_adc.regs)[offset]; verboselog( *this, 9, "(ADC) %08X <- %08X\n", S3C24XX_BASE_ADC + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_adc.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_adc.regs)[offset]); switch (offset) { case S3C24XX_ADCCON : @@ -2872,9 +2872,9 @@ void S3C24_CLASS_NAME::s3c24xx_spi_reset() } } -UINT32 S3C24_CLASS_NAME::s3c24xx_spi_r(UINT32 ch, UINT32 offset) +uint32_t S3C24_CLASS_NAME::s3c24xx_spi_r(uint32_t ch, uint32_t offset) { - UINT32 data = ((UINT32*)&m_spi[ch].regs)[offset]; + uint32_t data = ((uint32_t*)&m_spi[ch].regs)[offset]; switch (offset) { case S3C24XX_SPSTA : @@ -2886,14 +2886,14 @@ UINT32 S3C24_CLASS_NAME::s3c24xx_spi_r(UINT32 ch, UINT32 offset) return data; } -void S3C24_CLASS_NAME::s3c24xx_spi_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask) +void S3C24_CLASS_NAME::s3c24xx_spi_w(uint32_t ch, uint32_t offset, uint32_t data, uint32_t mem_mask) { - COMBINE_DATA(&((UINT32*)&m_spi[ch].regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_spi[ch].regs)[offset]); } READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_0_r ) { - UINT32 data = s3c24xx_spi_r( 0, offset); + uint32_t data = s3c24xx_spi_r( 0, offset); verboselog( *this, 9, "(SPI 0) %08X -> %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data); return data; } @@ -2902,7 +2902,7 @@ READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_0_r ) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_spi_1_r ) { - UINT32 data = s3c24xx_spi_r( 1, offset); + uint32_t data = s3c24xx_spi_r( 1, offset); verboselog( *this, 9, "(SPI 1) %08X -> %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data); return data; } @@ -2937,7 +2937,7 @@ void S3C24_CLASS_NAME::s3c24xx_mmc_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_mmc_r ) { - UINT32 data = m_mmc.regs.data[offset]; + uint32_t data = m_mmc.regs.data[offset]; verboselog( *this, 9, "(MMC) %08X -> %08X\n", S3C24XX_BASE_MMC + (offset << 2), data); return data; } @@ -2968,7 +2968,7 @@ void S3C24_CLASS_NAME::s3c24xx_sdi_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_sdi_r ) { - UINT32 data = m_sdi.regs.data[offset]; + uint32_t data = m_sdi.regs.data[offset]; verboselog( *this, 9, "(SDI) %08X -> %08X\n", S3C24XX_BASE_SDI + (offset << 2), data); return data; } @@ -2995,7 +2995,7 @@ void S3C24_CLASS_NAME::s3c24xx_nand_reset() #endif } -void S3C24_CLASS_NAME::iface_nand_command_w(UINT8 data) +void S3C24_CLASS_NAME::iface_nand_command_w(uint8_t data) { if (!m_command_w_cb.isnull()) { @@ -3003,7 +3003,7 @@ void S3C24_CLASS_NAME::iface_nand_command_w(UINT8 data) } } -void S3C24_CLASS_NAME::iface_nand_address_w(UINT8 data) +void S3C24_CLASS_NAME::iface_nand_address_w(uint8_t data) { if (!m_address_w_cb.isnull()) { @@ -3011,7 +3011,7 @@ void S3C24_CLASS_NAME::iface_nand_address_w(UINT8 data) } } -UINT8 S3C24_CLASS_NAME::iface_nand_data_r() +uint8_t S3C24_CLASS_NAME::iface_nand_data_r() { if (!m_nand_data_r_cb.isnull()) { @@ -3023,7 +3023,7 @@ UINT8 S3C24_CLASS_NAME::iface_nand_data_r() } } -void S3C24_CLASS_NAME::iface_nand_data_w(UINT8 data) +void S3C24_CLASS_NAME::iface_nand_data_w(uint8_t data) { if (!m_nand_data_w_cb.isnull()) { @@ -3031,10 +3031,10 @@ void S3C24_CLASS_NAME::iface_nand_data_w(UINT8 data) } } -void S3C24_CLASS_NAME::nand_update_mecc( UINT8 *ecc, int pos, UINT8 data) +void S3C24_CLASS_NAME::nand_update_mecc( uint8_t *ecc, int pos, uint8_t data) { int bit[8]; - UINT8 temp; + uint8_t temp; bit[0] = (data >> 0) & 1; bit[1] = (data >> 1) & 1; bit[2] = (data >> 2) & 1; @@ -3067,10 +3067,10 @@ void S3C24_CLASS_NAME::nand_update_mecc( UINT8 *ecc, int pos, UINT8 data) #if defined(DEVICE_S3C2440) -void S3C24_CLASS_NAME::nand_update_secc( UINT8 *ecc, int pos, UINT8 data) +void S3C24_CLASS_NAME::nand_update_secc( uint8_t *ecc, int pos, uint8_t data) { int bit[8]; - UINT8 temp; + uint8_t temp; bit[0] = (data >> 0) & 1; bit[1] = (data >> 1) & 1; bit[2] = (data >> 2) & 1; @@ -3096,10 +3096,10 @@ void S3C24_CLASS_NAME::nand_update_secc( UINT8 *ecc, int pos, UINT8 data) #endif -void S3C24_CLASS_NAME::s3c24xx_nand_update_ecc(UINT8 data) +void S3C24_CLASS_NAME::s3c24xx_nand_update_ecc(uint8_t data) { s3c24xx_nand_t *nand = &m_nand; - UINT8 temp[4]; + uint8_t temp[4]; #if defined(DEVICE_S3C2410) temp[0] = nand->mecc[0]; temp[1] = nand->mecc[1]; @@ -3129,29 +3129,29 @@ void S3C24_CLASS_NAME::s3c24xx_nand_update_ecc(UINT8 data) #endif } -void S3C24_CLASS_NAME::s3c24xx_nand_command_w(UINT8 data) +void S3C24_CLASS_NAME::s3c24xx_nand_command_w(uint8_t data) { verboselog( *this, 5, "NAND write command %02X\n", data); m_nand.data_count = 0; iface_nand_command_w( data); } -void S3C24_CLASS_NAME::s3c24xx_nand_address_w(UINT8 data) +void S3C24_CLASS_NAME::s3c24xx_nand_address_w(uint8_t data) { verboselog( *this, 5, "NAND write address %02X\n", data); m_nand.data_count = 0; iface_nand_address_w( data); } -UINT8 S3C24_CLASS_NAME::s3c24xx_nand_data_r() +uint8_t S3C24_CLASS_NAME::s3c24xx_nand_data_r() { - UINT8 data = iface_nand_data_r(); + uint8_t data = iface_nand_data_r(); verboselog( *this, 5, "NAND read data %02X [%04X]\n", data, m_nand.data_count++); s3c24xx_nand_update_ecc( data); return data; } -void S3C24_CLASS_NAME::s3c24xx_nand_data_w(UINT8 data) +void S3C24_CLASS_NAME::s3c24xx_nand_data_w(uint8_t data) { verboselog( *this, 5, "NAND write data %02X [%04X]\n", data, m_nand.data_count++); iface_nand_data_w( data); @@ -3160,7 +3160,7 @@ void S3C24_CLASS_NAME::s3c24xx_nand_data_w(UINT8 data) READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_nand_r ) { - UINT32 data = ((UINT32*)&m_nand.regs)[offset]; + uint32_t data = ((uint32_t*)&m_nand.regs)[offset]; switch (offset) { case S3C24XX_NFDATA : @@ -3226,9 +3226,9 @@ void S3C24_CLASS_NAME::s3c24xx_nand_init_ecc() WRITE32_MEMBER( S3C24_CLASS_NAME::s3c24xx_nand_w ) { - UINT32 old_value = ((UINT32*)&m_nand.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_nand.regs)[offset]; verboselog( *this, 9, "(NAND) %08X <- %08X (%08X)\n", S3C24XX_BASE_NAND + (offset << 2), data, mem_mask); - COMBINE_DATA(&((UINT32*)&m_nand.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_nand.regs)[offset]); switch (offset) { #if defined(DEVICE_S3C2410) @@ -3324,7 +3324,7 @@ void S3C24_CLASS_NAME::s3c24xx_cam_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_cam_r ) { - UINT32 data = m_cam.regs.data[offset]; + uint32_t data = m_cam.regs.data[offset]; verboselog( *this, 9, "(CAM) %08X -> %08X\n", S3C24XX_BASE_CAM + (offset << 2), data); return data; } @@ -3349,7 +3349,7 @@ void S3C24_CLASS_NAME::s3c24xx_ac97_reset() READ32_MEMBER( S3C24_CLASS_NAME::s3c24xx_ac97_r ) { - UINT32 data = m_ac97.regs.data[offset]; + uint32_t data = m_ac97.regs.data[offset]; verboselog( *this, 9, "(AC97) %08X -> %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data); return data; } @@ -3373,7 +3373,7 @@ void S3C24_CLASS_NAME::s3c24xx_nand_auto_boot() if ((om0 == 0) && (om1 == 0)) { int ncon = iface_core_pin_r( S3C24XX_CORE_PIN_NCON); - UINT8 *ptr = m_steppingstone; + uint8_t *ptr = m_steppingstone; int page_size, address_cycle; #if defined(DEVICE_S3C2410) page_size = 512; @@ -3386,7 +3386,7 @@ void S3C24_CLASS_NAME::s3c24xx_nand_auto_boot() address_cycle = 4; // byte-page-page-page } #elif defined(DEVICE_S3C2440) - UINT32 port_g = iface_gpio_port_r( S3C24XX_GPIO_PORT_G, 0); + uint32_t port_g = iface_gpio_port_r( S3C24XX_GPIO_PORT_G, 0); if (ncon == 0) { if (BIT( port_g, 13) == 0) diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index 7660918e1a5..826a94ae600 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -31,7 +31,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, c const device_type S3C44B0 = &device_creator; -s3c44b0_device::s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s3c44b0_device::s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S3C44B0, "Samsung S3C44B0", tag, owner, clock, "s3c44b0", __FILE__), m_cpu(nullptr), m_port_r_cb(*this), m_port_w_cb(*this), @@ -283,8 +283,8 @@ void s3c44b0_device::device_reset() #define CLOCK_MULTIPLIER 1 -#define BITS(x,m,n) (((x)>>(n))&(((UINT32)1<<((m)-(n)+1))-1)) -#define CLR_BITS(x,m,n) ((x) & ~((((UINT32)1 << ((m) - (n) + 1)) - 1) << n)) +#define BITS(x,m,n) (((x)>>(n))&(((uint32_t)1<<((m)-(n)+1))-1)) +#define CLR_BITS(x,m,n) ((x) & ~((((uint32_t)1 << ((m) - (n) + 1)) - 1) << n)) /*************************************************************************** @@ -293,24 +293,24 @@ void s3c44b0_device::device_reset() /* LCD Controller */ -rgb_t s3c44b0_device::lcd_get_color_stn_04(UINT8 data) +rgb_t s3c44b0_device::lcd_get_color_stn_04(uint8_t data) { - UINT8 r, g, b; + uint8_t r, g, b; r = g = b = BITS(data, 3, 0) << 4; return rgb_t(r, g, b); } -UINT8 s3c44b0_device::lcd_get_color_stn_08_r(UINT8 data) +uint8_t s3c44b0_device::lcd_get_color_stn_08_r(uint8_t data) { return ((m_lcd.regs.redlut >> (BITS(data, 7, 5) << 2)) & 0xf) << 4; } -UINT8 s3c44b0_device::lcd_get_color_stn_08_g(UINT8 data) +uint8_t s3c44b0_device::lcd_get_color_stn_08_g(uint8_t data) { return ((m_lcd.regs.greenlut >> (BITS(data, 4, 2) << 2)) & 0xf) << 4; } -UINT8 s3c44b0_device::lcd_get_color_stn_08_b(UINT8 data) +uint8_t s3c44b0_device::lcd_get_color_stn_08_b(uint8_t data) { return ((m_lcd.regs.bluelut >> (BITS(data, 1, 0) << 2)) & 0xf) << 4; } @@ -339,10 +339,10 @@ void s3c44b0_device::lcd_dma_init() lcd_dma_reload(); } -void s3c44b0_device::lcd_dma_read(int count, UINT8 *data) +void s3c44b0_device::lcd_dma_read(int count, uint8_t *data) { address_space &space = m_cpu->space(AS_PROGRAM); - UINT8 *vram = (UINT8 *)space.get_read_ptr(m_lcd.vramaddr_cur); + uint8_t *vram = (uint8_t *)space.get_read_ptr(m_lcd.vramaddr_cur); for (int i = 0; i < count / 2; i++) { if (m_lcd.bswp == 0) @@ -373,7 +373,7 @@ void s3c44b0_device::lcd_dma_read(int count, UINT8 *data) lcd_dma_reload(); } m_lcd.pagewidth_cur = 0; - vram = (UINT8 *)space.get_read_ptr(m_lcd.vramaddr_cur); + vram = (uint8_t *)space.get_read_ptr(m_lcd.vramaddr_cur); } else { @@ -385,8 +385,8 @@ void s3c44b0_device::lcd_dma_read(int count, UINT8 *data) void s3c44b0_device::lcd_render_stn_04() { - UINT8 *bitmap = m_lcd.bitmap.get() + ((m_lcd.vpos - m_lcd.vpos_min) * (m_lcd.hpos_max - m_lcd.hpos_min + 1)) + (m_lcd.hpos - m_lcd.hpos_min); - UINT8 data[16]; + uint8_t *bitmap = m_lcd.bitmap.get() + ((m_lcd.vpos - m_lcd.vpos_min) * (m_lcd.hpos_max - m_lcd.hpos_min + 1)) + (m_lcd.hpos - m_lcd.hpos_min); + uint8_t data[16]; lcd_dma_read(16, data); for (auto & elem : data) { @@ -411,12 +411,12 @@ void s3c44b0_device::lcd_render_stn_04() void s3c44b0_device::lcd_render_stn_08() { - UINT8 *bitmap = m_lcd.bitmap.get() + ((m_lcd.vpos - m_lcd.vpos_min) * (m_lcd.hpos_max - m_lcd.hpos_min + 1)) + (m_lcd.hpos - m_lcd.hpos_min); - UINT8 data[16]; + uint8_t *bitmap = m_lcd.bitmap.get() + ((m_lcd.vpos - m_lcd.vpos_min) * (m_lcd.hpos_max - m_lcd.hpos_min + 1)) + (m_lcd.hpos - m_lcd.hpos_min); + uint8_t data[16]; lcd_dma_read(16, data); for (auto & elem : data) { - UINT8 xxx[3]; + uint8_t xxx[3]; xxx[0] = lcd_get_color_stn_08_r(elem); xxx[1] = lcd_get_color_stn_08_g(elem); xxx[2] = lcd_get_color_stn_08_b(elem); @@ -499,7 +499,7 @@ void s3c44b0_device::video_start() // do nothing } -UINT32 s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_lcd.regs.lcdcon1 & (1 << 0)) { @@ -507,8 +507,8 @@ UINT32 s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitmap, { for (int y = 0; y < screen.height(); y++) { - UINT32 *scanline = &bitmap.pix32(y); - UINT8 *vram = m_lcd.bitmap.get() + y * (m_lcd.hpos_max - m_lcd.hpos_min + 1); + uint32_t *scanline = &bitmap.pix32(y); + uint8_t *vram = m_lcd.bitmap.get() + y * (m_lcd.hpos_max - m_lcd.hpos_min + 1); for (int x = 0; x < screen.width(); x++) { *scanline++ = rgb_t(vram[0], vram[1], vram[2]); @@ -521,7 +521,7 @@ UINT32 s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitmap, { for (int y = 0; y < screen.height(); y++) { - UINT32 *scanline = &bitmap.pix32(y); + uint32_t *scanline = &bitmap.pix32(y); memset(scanline, 0, screen.width() * 4); } } @@ -530,7 +530,7 @@ UINT32 s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitmap, READ32_MEMBER( s3c44b0_device::lcd_r ) { - UINT32 data = ((UINT32*)&m_lcd.regs)[offset]; + uint32_t data = ((uint32_t*)&m_lcd.regs)[offset]; switch (offset) { case S3C44B0_LCDCON1 : @@ -596,7 +596,7 @@ void s3c44b0_device::lcd_configure() { m_lcd.bitmap = nullptr; } - m_lcd.bitmap = std::make_unique((m_lcd.hpos_max - m_lcd.hpos_min + 1) * (m_lcd.vpos_max - m_lcd.vpos_min + 1) * 3); + m_lcd.bitmap = std::make_unique((m_lcd.hpos_max - m_lcd.hpos_min + 1) * (m_lcd.vpos_max - m_lcd.vpos_min + 1) * 3); m_lcd.frame_period = HZ_TO_ATTOSECONDS(m_lcd.framerate); m_lcd.scantime = m_lcd.frame_period / m_lcd.vpos_end; m_lcd.pixeltime = m_lcd.frame_period / (m_lcd.vpos_end * m_lcd.hpos_end); @@ -635,9 +635,9 @@ void s3c44b0_device::lcd_recalc() WRITE32_MEMBER( s3c44b0_device::lcd_w ) { - UINT32 old_value = ((UINT32*)&m_lcd.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_lcd.regs)[offset]; // verboselog( *this, 9, "(LCD) %08X <- %08X\n", S3C44B0_BASE_LCD + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_lcd.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_lcd.regs)[offset]); switch (offset) { case S3C44B0_LCDCON1 : @@ -654,19 +654,19 @@ WRITE32_MEMBER( s3c44b0_device::lcd_w ) /* Clock & Power Management */ -UINT32 s3c44b0_device::get_mclk() +uint32_t s3c44b0_device::get_mclk() { - UINT32 data, mdiv, pdiv, sdiv; + uint32_t data, mdiv, pdiv, sdiv; data = m_clkpow.regs.pllcon; mdiv = BITS(data, 19, 12); pdiv = BITS(data, 9, 4); sdiv = BITS(data, 1, 0); - return (UINT32)((double)((mdiv + 8) * clock()) / (double)((pdiv + 2) * (1 << sdiv))); + return (uint32_t)((double)((mdiv + 8) * clock()) / (double)((pdiv + 2) * (1 << sdiv))); } READ32_MEMBER( s3c44b0_device::clkpow_r ) { - UINT32 data = ((UINT32*)&m_clkpow.regs)[offset]; + uint32_t data = ((uint32_t*)&m_clkpow.regs)[offset]; verboselog( *this, 9, "(CLKPOW) %08X -> %08X\n", S3C44B0_BASE_CLKPOW + (offset << 2), data); return data; } @@ -674,7 +674,7 @@ READ32_MEMBER( s3c44b0_device::clkpow_r ) WRITE32_MEMBER( s3c44b0_device::clkpow_w ) { verboselog( *this, 9, "(CLKPOW) %08X <- %08X\n", S3C44B0_BASE_CLKPOW + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_clkpow.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_clkpow.regs)[offset]); switch (offset) { case S3C44B0_PLLCON : @@ -699,11 +699,11 @@ WRITE32_MEMBER( s3c44b0_device::clkpow_w ) void s3c44b0_device::check_pending_irq() { // normal irq - UINT32 temp = (m_irq.regs.intpnd & ~m_irq.regs.intmsk) & ~m_irq.regs.intmod; + uint32_t temp = (m_irq.regs.intpnd & ~m_irq.regs.intmsk) & ~m_irq.regs.intmod; if (temp != 0) { - UINT32 int_type = 0; + uint32_t int_type = 0; while ((temp & 1) == 0) { int_type++; @@ -728,7 +728,7 @@ void s3c44b0_device::check_pending_irq() temp = (m_irq.regs.intpnd & ~m_irq.regs.intmsk) & m_irq.regs.intmod; if (temp != 0) { - UINT32 int_type = 0; + uint32_t int_type = 0; while ((temp & 1) == 0) { int_type++; @@ -750,7 +750,7 @@ void s3c44b0_device::check_pending_irq() } } -void s3c44b0_device::request_irq(UINT32 int_type) +void s3c44b0_device::request_irq(uint32_t int_type) { verboselog( *this, 5, "request irq %d\n", int_type); m_irq.regs.intpnd |= (1 << int_type); @@ -759,10 +759,10 @@ void s3c44b0_device::request_irq(UINT32 int_type) void s3c44b0_device::check_pending_eint() { - UINT32 temp = m_gpio.regs.extintpnd; + uint32_t temp = m_gpio.regs.extintpnd; if (temp != 0) { - UINT32 int_type = 0; + uint32_t int_type = 0; while ((temp & 1) == 0) { int_type++; @@ -772,7 +772,7 @@ void s3c44b0_device::check_pending_eint() } } -void s3c44b0_device::request_eint(UINT32 number) +void s3c44b0_device::request_eint(uint32_t number) { verboselog( *this, 5, "request external interrupt %d\n", number); if (number < 4) @@ -788,7 +788,7 @@ void s3c44b0_device::request_eint(UINT32 number) READ32_MEMBER( s3c44b0_device::irq_r ) { - UINT32 data = ((UINT32*)&m_irq.regs)[offset]; + uint32_t data = ((uint32_t*)&m_irq.regs)[offset]; verboselog( *this, 9, "(IRQ) %08X -> %08X\n", S3C44B0_BASE_INT + (offset << 2), data); return data; } @@ -796,7 +796,7 @@ READ32_MEMBER( s3c44b0_device::irq_r ) WRITE32_MEMBER( s3c44b0_device::irq_w ) { verboselog( *this, 9, "(IRQ) %08X <- %08X\n", S3C44B0_BASE_INT + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_irq.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_irq.regs)[offset]); switch (offset) { case S3C44B0_INTMSK : @@ -822,10 +822,10 @@ WRITE32_MEMBER( s3c44b0_device::irq_w ) /* PWM Timer */ -UINT16 s3c44b0_device::pwm_calc_observation(int ch) +uint16_t s3c44b0_device::pwm_calc_observation(int ch) { double timeleft, x1, x2; - UINT32 cnto; + uint32_t cnto; timeleft = (m_pwm.timer[ch]->remaining()).as_double(); // printf( "timeleft %f freq %d cntb %d cmpb %d\n", timeleft, m_pwm.freq[ch], m_pwm.cnt[ch], m_pwm.cmp[ch]); x1 = 1 / ((double)m_pwm.freq[ch] / (m_pwm.cnt[ch]- m_pwm.cmp[ch] + 1)); @@ -838,7 +838,7 @@ UINT16 s3c44b0_device::pwm_calc_observation(int ch) READ32_MEMBER( s3c44b0_device::pwm_r ) { - UINT32 data = ((UINT32*)&m_pwm.regs)[offset]; + uint32_t data = ((uint32_t*)&m_pwm.regs)[offset]; switch (offset) { case S3C44B0_TCNTO0 : @@ -881,7 +881,7 @@ void s3c44b0_device::pwm_start(int timer) const int mux_table[] = { 2, 4, 8, 16}; const int prescaler_shift[] = { 0, 0, 8, 8, 16, 16}; const int mux_shift[] = { 0, 4, 8, 12, 16, 20}; - UINT32 mclk, prescaler, mux, cnt, cmp, auto_reload; + uint32_t mclk, prescaler, mux, cnt, cmp, auto_reload; double freq, hz; verboselog( *this, 1, "PWM %d start\n", timer); mclk = get_mclk(); @@ -993,9 +993,9 @@ void s3c44b0_device::pwm_recalc(int timer) WRITE32_MEMBER( s3c44b0_device::pwm_w ) { - UINT32 old_value = ((UINT32*)&m_pwm.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_pwm.regs)[offset]; verboselog( *this, 9, "(PWM) %08X <- %08X\n", S3C44B0_BASE_PWM + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_pwm.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_pwm.regs)[offset]); switch (offset) { case S3C44B0_TCON : @@ -1084,9 +1084,9 @@ void s3c44b0_device::i2c_send_stop() iface_i2c_scl_w(0); } -UINT8 s3c44b0_device::i2c_receive_byte(int ack) +uint8_t s3c44b0_device::i2c_receive_byte(int ack) { - UINT8 data = 0; + uint8_t data = 0; verboselog( *this, 5, "i2c_receive_byte ...\n"); iface_i2c_sda_w(1); for (int i = 0; i < 8; i++) @@ -1103,7 +1103,7 @@ UINT8 s3c44b0_device::i2c_receive_byte(int ack) return data; } -int s3c44b0_device::i2c_send_byte(UINT8 data) +int s3c44b0_device::i2c_send_byte(uint8_t data) { int ack; verboselog( *this, 5, "i2c_send_byte ...\n"); @@ -1159,7 +1159,7 @@ void s3c44b0_device::iic_resume() READ32_MEMBER( s3c44b0_device::iic_r ) { - UINT32 data = ((UINT32*)&m_iic.regs)[offset]; + uint32_t data = ((uint32_t*)&m_iic.regs)[offset]; switch (offset) { case S3C44B0_IICSTAT : @@ -1174,9 +1174,9 @@ READ32_MEMBER( s3c44b0_device::iic_r ) WRITE32_MEMBER( s3c44b0_device::iic_w ) { - UINT32 old_value = ((UINT32*)&m_iic.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_iic.regs)[offset]; verboselog( *this, 9, "(IIC) %08X <- %08X\n", S3C44B0_BASE_IIC + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_iic.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_iic.regs)[offset]); switch (offset) { case S3C44B0_IICCON : @@ -1268,7 +1268,7 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::iic_timer_exp ) /* I/O Port */ -inline UINT32 s3c44b0_device::iface_gpio_port_r(int port) +inline uint32_t s3c44b0_device::iface_gpio_port_r(int port) { if (!m_port_r_cb.isnull()) return (m_port_r_cb)(port); @@ -1276,7 +1276,7 @@ inline UINT32 s3c44b0_device::iface_gpio_port_r(int port) return 0; } -inline void s3c44b0_device::iface_gpio_port_w(int port, UINT32 data) +inline void s3c44b0_device::iface_gpio_port_w(int port, uint32_t data) { if (!m_port_w_cb.isnull()) (m_port_w_cb)(port, data, 0xffff); @@ -1284,7 +1284,7 @@ inline void s3c44b0_device::iface_gpio_port_w(int port, UINT32 data) READ32_MEMBER( s3c44b0_device::gpio_r ) { - UINT32 data = ((UINT32*)&m_gpio.regs)[offset]; + uint32_t data = ((uint32_t*)&m_gpio.regs)[offset]; switch (offset) { case S3C44B0_GPADAT : @@ -1329,9 +1329,9 @@ READ32_MEMBER( s3c44b0_device::gpio_r ) WRITE32_MEMBER( s3c44b0_device::gpio_w ) { - UINT32 old_value = ((UINT32*)&m_gpio.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_gpio.regs)[offset]; verboselog( *this, 9, "(GPIO) %08X <- %08X\n", S3C44B0_BASE_GPIO + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_gpio.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_gpio.regs)[offset]); switch (offset) { case S3C44B0_GPADAT : @@ -1380,9 +1380,9 @@ WRITE32_MEMBER( s3c44b0_device::gpio_w ) /* UART */ -UINT32 s3c44b0_device::uart_r(int ch, UINT32 offset) +uint32_t s3c44b0_device::uart_r(int ch, uint32_t offset) { - UINT32 data = ((UINT32*)&m_uart[ch].regs)[offset]; + uint32_t data = ((uint32_t*)&m_uart[ch].regs)[offset]; switch (offset) { case S3C44B0_UTRSTAT : @@ -1392,7 +1392,7 @@ UINT32 s3c44b0_device::uart_r(int ch, UINT32 offset) break; case S3C44B0_URXH : { - UINT8 rxdata = data & 0xFF; + uint8_t rxdata = data & 0xFF; verboselog( *this, 5, "UART %d read %02X (%c)\n", ch, rxdata, ((rxdata >= 32) && (rxdata < 128)) ? (char)rxdata : '?'); m_uart[ch].regs.utrstat &= ~1; // [bit 0] Receive buffer data ready } @@ -1401,14 +1401,14 @@ UINT32 s3c44b0_device::uart_r(int ch, UINT32 offset) return data; } -void s3c44b0_device::uart_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask) +void s3c44b0_device::uart_w(int ch, uint32_t offset, uint32_t data, uint32_t mem_mask) { - COMBINE_DATA(&((UINT32*)&m_uart[ch].regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_uart[ch].regs)[offset]); switch (offset) { case S3C44B0_UTXH : { - UINT8 txdata = data & 0xFF; + uint8_t txdata = data & 0xFF; verboselog( *this, 5, "UART %d write %02X (%c)\n", ch, txdata, ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?'); #ifdef UART_PRINTF printf( "%c", ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?'); @@ -1417,7 +1417,7 @@ void s3c44b0_device::uart_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask) break; case S3C44B0_UBRDIV : { - UINT32 mclk, hz; + uint32_t mclk, hz; mclk = get_mclk(); hz = (mclk / (m_uart->regs.ubrdiv + 1)) / 16; verboselog( *this, 5, "UART %d - mclk %08X hz %08X\n", ch, mclk, hz); @@ -1429,14 +1429,14 @@ void s3c44b0_device::uart_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask) READ32_MEMBER( s3c44b0_device::uart_0_r ) { - UINT32 data = uart_r(0, offset); + uint32_t data = uart_r(0, offset); // verboselog( *this, 9, "(UART 0) %08X -> %08X\n", S3C44B0_BASE_UART_0 + (offset << 2), data); return data; } READ32_MEMBER( s3c44b0_device::uart_1_r ) { - UINT32 data = uart_r(1, offset); + uint32_t data = uart_r(1, offset); // verboselog( *this, 9, "(UART 1) %08X -> %08X\n", S3C44B0_BASE_UART_1 + (offset << 2), data); return data; } @@ -1453,7 +1453,7 @@ WRITE32_MEMBER( s3c44b0_device::uart_1_w ) uart_w(1, offset, data, mem_mask); } -void s3c44b0_device::uart_fifo_w(int uart, UINT8 data) +void s3c44b0_device::uart_fifo_w(int uart, uint8_t data) { // printf("s3c44b0_uart_fifo_w (%c)\n", data); m_uart[uart].regs.urxh = data; @@ -1473,14 +1473,14 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::uart_timer_exp ) /* Watchdog Timer */ -UINT16 s3c44b0_device::wdt_calc_current_count() +uint16_t s3c44b0_device::wdt_calc_current_count() { return 0; } READ32_MEMBER( s3c44b0_device::wdt_r ) { - UINT32 data = ((UINT32*)&m_wdt.regs)[offset]; + uint32_t data = ((uint32_t*)&m_wdt.regs)[offset]; switch (offset) { case S3C44B0_WTCNT : @@ -1499,7 +1499,7 @@ READ32_MEMBER( s3c44b0_device::wdt_r ) void s3c44b0_device::wdt_start() { - UINT32 mclk, prescaler, clock; + uint32_t mclk, prescaler, clock; double freq, hz; verboselog( *this, 1, "WDT start\n"); mclk = get_mclk(); @@ -1528,9 +1528,9 @@ void s3c44b0_device::wdt_recalc() WRITE32_MEMBER( s3c44b0_device::wdt_w ) { - UINT32 old_value = ((UINT32*)&m_wdt.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_wdt.regs)[offset]; verboselog( *this, 9, "(WDT) %08X <- %08X\n", S3C44B0_BASE_WDT + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_wdt.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_wdt.regs)[offset]); switch (offset) { case S3C44B0_WTCON : @@ -1562,7 +1562,7 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::wdt_timer_exp ) READ32_MEMBER( s3c44b0_device::cpuwrap_r ) { - UINT32 data = ((UINT32*)&m_cpuwrap.regs)[offset]; + uint32_t data = ((uint32_t*)&m_cpuwrap.regs)[offset]; verboselog( *this, 9, "(CPUWRAP) %08X -> %08X\n", S3C44B0_BASE_CPU_WRAPPER + (offset << 2), data); return data; } @@ -1570,21 +1570,21 @@ READ32_MEMBER( s3c44b0_device::cpuwrap_r ) WRITE32_MEMBER( s3c44b0_device::cpuwrap_w ) { verboselog( *this, 9, "(CPUWRAP) %08X <- %08X\n", S3C44B0_BASE_CPU_WRAPPER + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_cpuwrap.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_cpuwrap.regs)[offset]); } /* A/D Converter */ READ32_MEMBER( s3c44b0_device::adc_r ) { - UINT32 data = ((UINT32*)&m_adc.regs)[offset]; + uint32_t data = ((uint32_t*)&m_adc.regs)[offset]; verboselog( *this, 9, "(ADC) %08X -> %08X\n", S3C44B0_BASE_ADC + (offset << 2), data); return data; } void s3c44b0_device::adc_start() { - UINT32 mclk, prescaler; + uint32_t mclk, prescaler; double freq, hz; verboselog( *this, 1, "ADC start\n"); mclk = get_mclk(); @@ -1611,9 +1611,9 @@ void s3c44b0_device::adc_recalc() WRITE32_MEMBER( s3c44b0_device::adc_w ) { - UINT32 old_value = ((UINT32*)&m_wdt.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_wdt.regs)[offset]; verboselog( *this, 9, "(ADC) %08X <- %08X\n", S3C44B0_BASE_ADC + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_adc.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_adc.regs)[offset]); switch (offset) { case S3C44B0_ADCCON : @@ -1639,14 +1639,14 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::adc_timer_exp ) READ32_MEMBER( s3c44b0_device::sio_r ) { - UINT32 data = ((UINT32*)&m_sio.regs)[offset]; + uint32_t data = ((uint32_t*)&m_sio.regs)[offset]; verboselog( *this, 9, "(SIO) %08X -> %08X\n", S3C44B0_BASE_SIO + (offset << 2), data); return data; } void s3c44b0_device::sio_start() { - UINT32 mclk, prescaler; + uint32_t mclk, prescaler; double freq, hz; verboselog( *this, 1, "SIO start\n"); mclk = get_mclk(); @@ -1675,9 +1675,9 @@ void s3c44b0_device::sio_recalc() WRITE32_MEMBER( s3c44b0_device::sio_w ) { - UINT32 old_value = ((UINT32*)&m_sio.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_sio.regs)[offset]; verboselog( *this, 9, "(SIO) %08X <- %08X\n", S3C44B0_BASE_SIO + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_sio.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_sio.regs)[offset]); switch (offset) { case S3C44B0_SIOCON : @@ -1706,7 +1706,7 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::sio_timer_exp ) /* IIS */ -inline void s3c44b0_device::iface_i2s_data_w(address_space &space, int ch, UINT16 data) +inline void s3c44b0_device::iface_i2s_data_w(address_space &space, int ch, uint16_t data) { if (!m_data_w_cb.isnull()) (m_data_w_cb)(ch, data, 0); @@ -1714,7 +1714,7 @@ inline void s3c44b0_device::iface_i2s_data_w(address_space &space, int ch, UINT1 void s3c44b0_device::iis_start() { - UINT32 mclk; + uint32_t mclk; int prescaler; double freq, hz; const int div[] = { 2, 4, 6, 8, 10, 12, 14, 16, 1, 0, 3, 0, 5, 0, 7, 0 }; @@ -1735,16 +1735,16 @@ void s3c44b0_device::iis_stop() READ32_MEMBER( s3c44b0_device::iis_r ) { - UINT32 data = ((UINT32*)&m_iis.regs)[offset]; + uint32_t data = ((uint32_t*)&m_iis.regs)[offset]; verboselog( *this, 9, "(IIS) %08X -> %08X\n", S3C44B0_BASE_IIS + (offset << 2), data); return data; } WRITE32_MEMBER( s3c44b0_device::iis_w ) { - UINT32 old_value = ((UINT32*)&m_iis.regs)[offset]; + uint32_t old_value = ((uint32_t*)&m_iis.regs)[offset]; verboselog( *this, 9, "(IIS) %08X <- %08X\n", S3C44B0_BASE_IIS + (offset << 2), data); - COMBINE_DATA(&((UINT32*)&m_iis.regs)[offset]); + COMBINE_DATA(&((uint32_t*)&m_iis.regs)[offset]); switch (offset) { case S3C44B0_IISCON : @@ -1797,7 +1797,7 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::iis_timer_exp ) void s3c44b0_device::zdma_trigger(int ch) { address_space &space = m_cpu->space(AS_PROGRAM); - UINT32 saddr, daddr; + uint32_t saddr, daddr; int dal, dst, opt, das, cnt; verboselog( *this, 5, "s3c44b0_zdma_trigger %d\n", ch); dst = BITS(m_zdma->regs.dcsrc, 31, 30); @@ -1853,16 +1853,16 @@ void s3c44b0_device::zdma_start(int ch) zdma_trigger(ch); } -UINT32 s3c44b0_device::zdma_r(int ch, UINT32 offset) +uint32_t s3c44b0_device::zdma_r(int ch, uint32_t offset) { - UINT32 data = ((UINT32*)&m_zdma[ch].regs)[offset]; + uint32_t data = ((uint32_t*)&m_zdma[ch].regs)[offset]; return data; } -void s3c44b0_device::zdma_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask) +void s3c44b0_device::zdma_w(int ch, uint32_t offset, uint32_t data, uint32_t mem_mask) { - UINT32 old_value = ((UINT32*)&m_zdma[ch].regs)[offset]; - COMBINE_DATA(&((UINT32*)&m_zdma[ch].regs)[offset]); + uint32_t old_value = ((uint32_t*)&m_zdma[ch].regs)[offset]; + COMBINE_DATA(&((uint32_t*)&m_zdma[ch].regs)[offset]); switch (offset) { case S3C44B0_DCON : @@ -1882,14 +1882,14 @@ void s3c44b0_device::zdma_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask) READ32_MEMBER( s3c44b0_device::zdma_0_r ) { - UINT32 data = zdma_r(0, offset); + uint32_t data = zdma_r(0, offset); verboselog( *this, 9, "(ZDMA 0) %08X -> %08X\n", S3C44B0_BASE_ZDMA_0 + (offset << 2), data); return data; } READ32_MEMBER( s3c44b0_device::zdma_1_r ) { - UINT32 data = zdma_r(1, offset); + uint32_t data = zdma_r(1, offset); verboselog( *this, 9, "(ZDMA 1) %08X -> %08X\n", S3C44B0_BASE_ZDMA_1 + (offset << 2), data); return data; } @@ -1917,7 +1917,7 @@ TIMER_CALLBACK_MEMBER( s3c44b0_device::zdma_timer_exp ) void s3c44b0_device::bdma_trigger(int ch) { address_space &space = m_cpu->space(AS_PROGRAM); - UINT32 saddr, daddr; + uint32_t saddr, daddr; int dal, dst, tdm, das, cnt; verboselog( *this, 5, "s3c44b0_bdma_trigger %d\n", ch); dst = BITS(m_bdma->regs.dcsrc, 31, 30); @@ -1967,9 +1967,9 @@ void s3c44b0_device::bdma_request_iis() bdma_trigger(0); } -UINT32 s3c44b0_device::bdma_r(int ch, UINT32 offset) +uint32_t s3c44b0_device::bdma_r(int ch, uint32_t offset) { - UINT32 data = ((UINT32*)&m_bdma[ch].regs)[offset]; + uint32_t data = ((uint32_t*)&m_bdma[ch].regs)[offset]; return data; } @@ -1996,10 +1996,10 @@ void s3c44b0_device::bdma_stop(int ch) m_bdma[ch].timer->adjust(attotime::never, ch); } -void s3c44b0_device::bdma_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask) +void s3c44b0_device::bdma_w(int ch, uint32_t offset, uint32_t data, uint32_t mem_mask) { - UINT32 old_value = ((UINT32*)&m_bdma[ch].regs)[offset]; - COMBINE_DATA(&((UINT32*)&m_bdma[ch].regs)[offset]); + uint32_t old_value = ((uint32_t*)&m_bdma[ch].regs)[offset]; + COMBINE_DATA(&((uint32_t*)&m_bdma[ch].regs)[offset]); switch (offset) { case S3C44B0_DICNT : @@ -2022,14 +2022,14 @@ void s3c44b0_device::bdma_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask) READ32_MEMBER( s3c44b0_device::bdma_0_r ) { - UINT32 data = bdma_r(0, offset); + uint32_t data = bdma_r(0, offset); verboselog( *this, 9, "(BDMA 0) %08X -> %08X\n", S3C44B0_BASE_BDMA_0 + (offset << 2), data); return data; } READ32_MEMBER( s3c44b0_device::bdma_1_r ) { - UINT32 data = bdma_r(1, offset); + uint32_t data = bdma_r(1, offset); verboselog( *this, 9, "(BDMA 1) %08X -> %08X\n", S3C44B0_BASE_BDMA_1 + (offset << 2), data); return data; } diff --git a/src/devices/machine/s3c44b0.h b/src/devices/machine/s3c44b0.h index 05b0c134532..116aa1843a5 100644 --- a/src/devices/machine/s3c44b0.h +++ b/src/devices/machine/s3c44b0.h @@ -286,192 +286,192 @@ struct s3c44b0_memcon_regs_t { - UINT32 data[0x34/4]; + uint32_t data[0x34/4]; }; struct s3c44b0_irq_regs_t { - UINT32 intcon; - UINT32 intpnd; - UINT32 intmod; - UINT32 intmsk; - UINT32 i_pslv; - UINT32 i_pmst; - UINT32 i_cslv; - UINT32 i_cmst; - UINT32 i_ispr; - UINT32 i_ispc; - UINT32 reserved[4]; - UINT32 f_ispr; - UINT32 f_ispc; + uint32_t intcon; + uint32_t intpnd; + uint32_t intmod; + uint32_t intmsk; + uint32_t i_pslv; + uint32_t i_pmst; + uint32_t i_cslv; + uint32_t i_cmst; + uint32_t i_ispr; + uint32_t i_ispc; + uint32_t reserved[4]; + uint32_t f_ispr; + uint32_t f_ispc; }; struct s3c44b0_dma_regs_t { - UINT32 dcon; - UINT32 disrc; - UINT32 didst; - UINT32 dicnt; - UINT32 dcsrc; - UINT32 dcdst; - UINT32 dccnt; + uint32_t dcon; + uint32_t disrc; + uint32_t didst; + uint32_t dicnt; + uint32_t dcsrc; + uint32_t dcdst; + uint32_t dccnt; }; struct s3c44b0_clkpow_regs_t { - UINT32 pllcon; - UINT32 clkcon; - UINT32 clkslow; - UINT32 locktime; + uint32_t pllcon; + uint32_t clkcon; + uint32_t clkslow; + uint32_t locktime; }; struct s3c44b0_lcd_regs_t { - UINT32 lcdcon1; - UINT32 lcdcon2; - UINT32 lcdsaddr1; - UINT32 lcdsaddr2; - UINT32 lcdsaddr3; - UINT32 redlut; - UINT32 greenlut; - UINT32 bluelut; - UINT32 reserved[8]; - UINT32 lcdcon3; - UINT32 dithmode; + uint32_t lcdcon1; + uint32_t lcdcon2; + uint32_t lcdsaddr1; + uint32_t lcdsaddr2; + uint32_t lcdsaddr3; + uint32_t redlut; + uint32_t greenlut; + uint32_t bluelut; + uint32_t reserved[8]; + uint32_t lcdcon3; + uint32_t dithmode; }; struct s3c44b0_uart_regs_t { - UINT32 ulcon; - UINT32 ucon; - UINT32 ufcon; - UINT32 umcon; - UINT32 utrstat; - UINT32 uerstat; - UINT32 ufstat; - UINT32 umstat; - UINT32 utxh; - UINT32 urxh; - UINT32 ubrdiv; + uint32_t ulcon; + uint32_t ucon; + uint32_t ufcon; + uint32_t umcon; + uint32_t utrstat; + uint32_t uerstat; + uint32_t ufstat; + uint32_t umstat; + uint32_t utxh; + uint32_t urxh; + uint32_t ubrdiv; }; struct s3c44b0_sio_regs_t { - UINT32 siocon; - UINT32 siodat; - UINT32 sbrdr; - UINT32 itvcnt; - UINT32 dcntz; + uint32_t siocon; + uint32_t siodat; + uint32_t sbrdr; + uint32_t itvcnt; + uint32_t dcntz; }; struct s3c44b0_pwm_regs_t { - UINT32 tcfg0; - UINT32 tcfg1; - UINT32 tcon; - UINT32 tcntb0; - UINT32 tcmpb0; - UINT32 tcnto0; - UINT32 tcntb1; - UINT32 tcmpb1; - UINT32 tcnto1; - UINT32 tcntb2; - UINT32 tcmpb2; - UINT32 tcnto2; - UINT32 tcntb3; - UINT32 tcmpb3; - UINT32 tcnto3; - UINT32 tcntb4; - UINT32 tcmpb4; - UINT32 tcnto4; - UINT32 tcntb5; - UINT32 tcnto5; + uint32_t tcfg0; + uint32_t tcfg1; + uint32_t tcon; + uint32_t tcntb0; + uint32_t tcmpb0; + uint32_t tcnto0; + uint32_t tcntb1; + uint32_t tcmpb1; + uint32_t tcnto1; + uint32_t tcntb2; + uint32_t tcmpb2; + uint32_t tcnto2; + uint32_t tcntb3; + uint32_t tcmpb3; + uint32_t tcnto3; + uint32_t tcntb4; + uint32_t tcmpb4; + uint32_t tcnto4; + uint32_t tcntb5; + uint32_t tcnto5; }; struct s3c44b0_wdt_regs_t { - UINT32 wtcon; - UINT32 wtdat; - UINT32 wtcnt; + uint32_t wtcon; + uint32_t wtdat; + uint32_t wtcnt; }; struct s3c44b0_iic_regs_t { - UINT32 iiccon; - UINT32 iicstat; - UINT32 iicadd; - UINT32 iicds; + uint32_t iiccon; + uint32_t iicstat; + uint32_t iicadd; + uint32_t iicds; }; struct s3c44b0_iis_regs_t { - UINT32 iiscon; - UINT32 iismod; - UINT32 iispsr; - UINT32 iisfcon; - UINT32 iisfifo; + uint32_t iiscon; + uint32_t iismod; + uint32_t iispsr; + uint32_t iisfcon; + uint32_t iisfifo; }; struct s3c44b0_gpio_regs_t { - UINT32 gpacon; - UINT32 gpadat; - UINT32 gpbcon; - UINT32 gpbdat; - UINT32 gpccon; - UINT32 gpcdat; - UINT32 gpcup; - UINT32 gpdcon; - UINT32 gpddat; - UINT32 gpdup; - UINT32 gpecon; - UINT32 gpedat; - UINT32 gpeup; - UINT32 gpfcon; - UINT32 gpfdat; - UINT32 gpfup; - UINT32 gpgcon; - UINT32 gpgdat; - UINT32 gpgup; - UINT32 spucr; - UINT32 extint; - UINT32 extintpnd; + uint32_t gpacon; + uint32_t gpadat; + uint32_t gpbcon; + uint32_t gpbdat; + uint32_t gpccon; + uint32_t gpcdat; + uint32_t gpcup; + uint32_t gpdcon; + uint32_t gpddat; + uint32_t gpdup; + uint32_t gpecon; + uint32_t gpedat; + uint32_t gpeup; + uint32_t gpfcon; + uint32_t gpfdat; + uint32_t gpfup; + uint32_t gpgcon; + uint32_t gpgdat; + uint32_t gpgup; + uint32_t spucr; + uint32_t extint; + uint32_t extintpnd; }; struct s3c44b0_rtc_regs_t { - UINT32 rtccon; - UINT32 reserved[3]; - UINT32 rtcalm; - UINT32 almsec; - UINT32 almmin; - UINT32 almhour; - UINT32 almday; - UINT32 almmon; - UINT32 almyear; - UINT32 rtcrst; - UINT32 bcdsec; - UINT32 bcdmin; - UINT32 bcdhour; - UINT32 bcdday; - UINT32 bcddow; - UINT32 bcdmon; - UINT32 bcdyear; - UINT32 ticnt; + uint32_t rtccon; + uint32_t reserved[3]; + uint32_t rtcalm; + uint32_t almsec; + uint32_t almmin; + uint32_t almhour; + uint32_t almday; + uint32_t almmon; + uint32_t almyear; + uint32_t rtcrst; + uint32_t bcdsec; + uint32_t bcdmin; + uint32_t bcdhour; + uint32_t bcdday; + uint32_t bcddow; + uint32_t bcdmon; + uint32_t bcdyear; + uint32_t ticnt; }; struct s3c44b0_adc_regs_t { - UINT32 adccon; - UINT32 adcpsr; - UINT32 adcdat; + uint32_t adccon; + uint32_t adcpsr; + uint32_t adcdat; }; struct s3c44b0_cpuwrap_regs_t { - UINT32 syscfg; - UINT32 ncachbe0; - UINT32 ncachbe1; + uint32_t syscfg; + uint32_t ncachbe0; + uint32_t ncachbe1; }; struct s3c44b0_memcon_t @@ -505,17 +505,17 @@ struct s3c44b0_lcd_t { s3c44b0_lcd_regs_t regs; emu_timer *timer; - std::unique_ptr bitmap; - UINT32 vramaddr_cur; - UINT32 vramaddr_max; - UINT32 offsize; - UINT32 pagewidth_cur; - UINT32 pagewidth_max; - UINT32 modesel; - UINT32 bswp; + std::unique_ptr bitmap; + uint32_t vramaddr_cur; + uint32_t vramaddr_max; + uint32_t offsize; + uint32_t pagewidth_cur; + uint32_t pagewidth_max; + uint32_t modesel; + uint32_t bswp; int vpos, hpos; double framerate; - UINT32 hpos_min, hpos_max, hpos_end, vpos_min, vpos_max, vpos_end; + uint32_t hpos_min, hpos_max, hpos_end, vpos_min, vpos_max, vpos_end; attotime frame_time; attoseconds_t frame_period, pixeltime, scantime; }; @@ -536,9 +536,9 @@ struct s3c44b0_pwm_t { s3c44b0_pwm_regs_t regs; emu_timer *timer[6]; - UINT32 cnt[6]; - UINT32 cmp[6]; - UINT32 freq[6]; + uint32_t cnt[6]; + uint32_t cmp[6]; + uint32_t freq[6]; }; struct s3c44b0_wdt_t @@ -558,7 +558,7 @@ struct s3c44b0_iis_t { s3c44b0_iis_regs_t regs; emu_timer *timer; - UINT16 fifo[16/2]; + uint16_t fifo[16/2]; int fifo_index; }; @@ -600,7 +600,7 @@ enum class s3c44b0_device : public device_t { public: - s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~s3c44b0_device() {} template static devcb_base &set_gpio_port_r_callback(device_t &device, _Object object) { return downcast(device).m_port_r_cb.set_callback(object); } @@ -647,8 +647,8 @@ public: DECLARE_WRITE32_MEMBER(bdma_0_w); DECLARE_WRITE32_MEMBER(bdma_1_w); - void request_eint(UINT32 number); - UINT32 video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void request_eint(uint32_t number); + uint32_t video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -658,13 +658,13 @@ protected: private: // internal state // LCD Controller - rgb_t lcd_get_color_stn_04(UINT8 data); - UINT8 lcd_get_color_stn_08_r(UINT8 data); - UINT8 lcd_get_color_stn_08_g(UINT8 data); - UINT8 lcd_get_color_stn_08_b(UINT8 data); + rgb_t lcd_get_color_stn_04(uint8_t data); + uint8_t lcd_get_color_stn_08_r(uint8_t data); + uint8_t lcd_get_color_stn_08_g(uint8_t data); + uint8_t lcd_get_color_stn_08_b(uint8_t data); void lcd_dma_reload(); void lcd_dma_init(); - void lcd_dma_read(int count, UINT8 *data); + void lcd_dma_read(int count, uint8_t *data); void lcd_render_stn_04(); void lcd_render_stn_08(); attotime time_until_pos(int vpos, int hpos); @@ -678,15 +678,15 @@ private: TIMER_CALLBACK_MEMBER(lcd_timer_exp); // Clock & Power Management - UINT32 get_mclk(); + uint32_t get_mclk(); // Interrupt Controller void check_pending_irq(); - void request_irq(UINT32 int_type); + void request_irq(uint32_t int_type); void check_pending_eint(); // PWM Timer - UINT16 pwm_calc_observation(int ch); + uint16_t pwm_calc_observation(int ch); void pwm_start(int timer); void pwm_stop(int timer); void pwm_recalc(int timer); @@ -699,25 +699,25 @@ private: inline int iface_i2c_sda_r(); void i2c_send_start(); void i2c_send_stop(); - UINT8 i2c_receive_byte(int ack); - int i2c_send_byte(UINT8 data); + uint8_t i2c_receive_byte(int ack); + int i2c_send_byte(uint8_t data); void iic_start(); void iic_stop(); void iic_resume(); TIMER_CALLBACK_MEMBER(iic_timer_exp); // I/O Port - inline UINT32 iface_gpio_port_r(int port); - inline void iface_gpio_port_w(int port, UINT32 data); + inline uint32_t iface_gpio_port_r(int port); + inline void iface_gpio_port_w(int port, uint32_t data); // UART - UINT32 uart_r(int ch, UINT32 offset); - void uart_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask); - void uart_fifo_w(int uart, UINT8 data); + uint32_t uart_r(int ch, uint32_t offset); + void uart_w(int ch, uint32_t offset, uint32_t data, uint32_t mem_mask); + void uart_fifo_w(int uart, uint8_t data); TIMER_CALLBACK_MEMBER(uart_timer_exp); // Watchdog Timer - UINT16 wdt_calc_current_count(); + uint16_t wdt_calc_current_count(); void wdt_start(); void wdt_stop(); void wdt_recalc(); @@ -736,7 +736,7 @@ private: TIMER_CALLBACK_MEMBER(sio_timer_exp); // IIS - inline void iface_i2s_data_w(address_space &space, int ch, UINT16 data); + inline void iface_i2s_data_w(address_space &space, int ch, uint16_t data); void iis_start(); void iis_stop(); TIMER_CALLBACK_MEMBER(iis_timer_exp); @@ -744,17 +744,17 @@ private: // ZDMA void zdma_trigger(int ch); void zdma_start(int ch); - UINT32 zdma_r(int ch, UINT32 offset); - void zdma_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t zdma_r(int ch, uint32_t offset); + void zdma_w(int ch, uint32_t offset, uint32_t data, uint32_t mem_mask); TIMER_CALLBACK_MEMBER(zdma_timer_exp); // BDMA void bdma_trigger(int ch); void bdma_request_iis(); - UINT32 bdma_r(int ch, UINT32 offset); + uint32_t bdma_r(int ch, uint32_t offset); void bdma_start(int ch); void bdma_stop(int ch); - void bdma_w(int ch, UINT32 offset, UINT32 data, UINT32 mem_mask); + void bdma_w(int ch, uint32_t offset, uint32_t data, uint32_t mem_mask); TIMER_CALLBACK_MEMBER(bdma_timer_exp); cpu_device *m_cpu; diff --git a/src/devices/machine/scnxx562.cpp b/src/devices/machine/scnxx562.cpp index e47d895bcd4..becc64aa893 100644 --- a/src/devices/machine/scnxx562.cpp +++ b/src/devices/machine/scnxx562.cpp @@ -141,7 +141,7 @@ machine_config_constructor duscc_device::device_mconfig_additions() const //------------------------------------------------- // duscc_device - constructor //------------------------------------------------- -duscc_device::duscc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +duscc_device::duscc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_z80daisy_interface(mconfig, *this), m_chanA(*this, CHANA_TAG), @@ -175,7 +175,7 @@ duscc_device::duscc_device(const machine_config &mconfig, device_type type, cons elem = 0; } -duscc_device::duscc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +duscc_device::duscc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DUSCC, "DUSCC", tag, owner, clock, "duscc", __FILE__), device_z80daisy_interface(mconfig, *this), m_chanA(*this, CHANA_TAG), @@ -203,16 +203,16 @@ duscc_device::duscc_device(const machine_config &mconfig, const char *tag, devic elem = 0; } -duscc26562_device::duscc26562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +duscc26562_device::duscc26562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : duscc_device(mconfig, DUSCC26562, "DUSCC 26562", tag, owner, clock, TYPE_DUSCC26562, "duscc26562", __FILE__){ } -duscc26C562_device::duscc26C562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +duscc26C562_device::duscc26C562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : duscc_device(mconfig, DUSCC26C562, "DUSCC 26C562", tag, owner, clock, TYPE_DUSCC26C562, "duscc26C562", __FILE__){ } -duscc68562_device::duscc68562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +duscc68562_device::duscc68562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : duscc_device(mconfig, DUSCC68562, "DUSCC 68562", tag, owner, clock, TYPE_DUSCC68562, "duscc68562", __FILE__){ } -duscc68C562_device::duscc68C562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +duscc68C562_device::duscc68C562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : duscc_device(mconfig, DUSCC68C562, "DUSCC 68C562", tag, owner, clock, TYPE_DUSCC68C562, "duscc68C562", __FILE__){ } //------------------------------------------------- @@ -434,7 +434,7 @@ void duscc_device::reset_interrupts() check_interrupts(); } -UINT8 duscc_device::modify_vector(UINT8 vec, int index, UINT8 src) +uint8_t duscc_device::modify_vector(uint8_t vec, int index, uint8_t src) { /* Interrupt Vector Modification @@ -494,8 +494,8 @@ UINT8 duscc_device::modify_vector(UINT8 vec, int index, UINT8 src) //------------------------------------------------- void duscc_device::trigger_interrupt(int index, int state) { - UINT8 vector = m_ivr; - UINT8 source = 0; + uint8_t vector = m_ivr; + uint8_t source = 0; int priority_level = 0; LOGINT(("%s %s:%c %02x \n",FUNCNAME, tag(), 'A' + index, state)); @@ -550,7 +550,7 @@ WRITE8_MEMBER( duscc_device::write ) //************************************************************************** // DUSCC CHANNEL //************************************************************************** -duscc_channel::duscc_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +duscc_channel::duscc_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DUSCC_CHANNEL, "DUSCC channel", tag, owner, clock, "duscc_channel", __FILE__), device_serial_interface(mconfig, *this), m_brg_rx_rate(0), @@ -871,13 +871,13 @@ void duscc_channel::device_timer(emu_timer &timer, device_timer_id id, int param mode, and if the TEOM on zero count or done control bit (TPR[4)) is asserted, the FIFOed send EOM command will be automatically asserted when the character which causes the count to go to zero is loaded into the transmit FIFO. */ -UINT8 duscc_channel::do_dusccreg_ctcr_r() +uint8_t duscc_channel::do_dusccreg_ctcr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_ctcr)); return m_ctcr; } -void duscc_channel::do_dusccreg_ctcr_w(UINT8 data) +void duscc_channel::do_dusccreg_ctcr_w(uint8_t data) { LOG(("%s(%02x) - not supported yet\n", FUNCNAME, data)); m_ctcr = data; @@ -889,16 +889,16 @@ void duscc_channel::do_dusccreg_ctcr_w(UINT8 data) from preset regsiter command or when.the counter/timer reaches zero count and the zero detect control bit (CTCR[6]) is negated. The minimum 16-bit counter/timer preset value is H'0002'. */ -UINT8 duscc_channel::do_dusccreg_ctprh_r() +uint8_t duscc_channel::do_dusccreg_ctprh_r() { - UINT8 ret = ((m_ctpr >> 8) & 0xff ); + uint8_t ret = ((m_ctpr >> 8) & 0xff ); LOG(("%s(%02x)\n", FUNCNAME, ret)); // return m_ctprh; return ret; } -void duscc_channel::do_dusccreg_ctprh_w(UINT8 data) +void duscc_channel::do_dusccreg_ctprh_w(uint8_t data) { LOG(("%s(%02x) - not supported yet\n", FUNCNAME, data)); // m_ctprh = data; @@ -912,15 +912,15 @@ void duscc_channel::do_dusccreg_ctprh_w(UINT8 data) from preset register command or when the counter/timer reaches zero count and the zero detect control bit (CTCR[6]) is negated. The minimum 16-bit counter/timer preset value is H'0002'. */ -UINT8 duscc_channel::do_dusccreg_ctprl_r() +uint8_t duscc_channel::do_dusccreg_ctprl_r() { - UINT8 ret = (m_ctpr & 0xff); + uint8_t ret = (m_ctpr & 0xff); LOG(("%s(%02x)\n", FUNCNAME, ret)); // return m_ctprl; return ret; } -void duscc_channel::do_dusccreg_ctprl_w(UINT8 data) +void duscc_channel::do_dusccreg_ctprl_w(uint8_t data) { LOG(("%s(%02x) - not supported yet\n", FUNCNAME, data)); // m_ctprl = data; @@ -935,9 +935,9 @@ void duscc_channel::do_dusccreg_ctprl_w(UINT8 data) the read being performed while the CIT is changing. This count may be continued after the register is read. */ -UINT8 duscc_channel::do_dusccreg_cth_r() +uint8_t duscc_channel::do_dusccreg_cth_r() { - UINT8 ret = ((m_ct >> 8) & 0xff ); + uint8_t ret = ((m_ct >> 8) & 0xff ); LOG(("%s(%02x)\n", FUNCNAME, ret)); return ret; @@ -949,9 +949,9 @@ UINT8 duscc_channel::do_dusccreg_cth_r() recommended that the CIT be stopped via a stop counter command before it is read, in order to prevent errors which may occur due to the read being performed while the CIT is changing. This count may be continued after the register is read. */ -UINT8 duscc_channel::do_dusccreg_ctl_r() +uint8_t duscc_channel::do_dusccreg_ctl_r() { - UINT8 ret = (m_ct & 0xff); + uint8_t ret = (m_ct & 0xff); LOG(("%s(%02x)\n", FUNCNAME, ret)); // return m_ctl; return ret; @@ -1029,7 +1029,7 @@ void duscc_channel::rcv_callback() void duscc_channel::rcv_complete() { - UINT8 data; + uint8_t data; receive_register_extract(); data = get_received_char(); @@ -1166,61 +1166,61 @@ int duscc_channel::get_tx_word_length() // register read methods - see correspondning write method for details on each register -UINT8 duscc_channel::do_dusccreg_cmr1_r() +uint8_t duscc_channel::do_dusccreg_cmr1_r() { LOG(("%s(%02x)\n", FUNCNAME, m_cmr1)); return m_cmr1; } -UINT8 duscc_channel::do_dusccreg_cmr2_r() +uint8_t duscc_channel::do_dusccreg_cmr2_r() { LOG(("%s(%02x)\n", FUNCNAME, m_cmr2)); return m_cmr2; } -UINT8 duscc_channel::do_dusccreg_s1r_r() +uint8_t duscc_channel::do_dusccreg_s1r_r() { LOG(("%s(%02x)\n", FUNCNAME, m_s1r)); return m_s1r; } -UINT8 duscc_channel::do_dusccreg_s2r_r() +uint8_t duscc_channel::do_dusccreg_s2r_r() { LOG(("%s(%02x)\n", FUNCNAME, m_s2r)); return m_s2r; } -UINT8 duscc_channel::do_dusccreg_tpr_r() +uint8_t duscc_channel::do_dusccreg_tpr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_tpr)); return m_tpr; } -UINT8 duscc_channel::do_dusccreg_ttr_r() +uint8_t duscc_channel::do_dusccreg_ttr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_ttr)); return m_ttr; } -UINT8 duscc_channel::do_dusccreg_rpr_r() +uint8_t duscc_channel::do_dusccreg_rpr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_rpr)); return m_rpr; } -UINT8 duscc_channel::do_dusccreg_rtr_r() +uint8_t duscc_channel::do_dusccreg_rtr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_rtr)); return m_rtr; } -UINT8 duscc_channel::do_dusccreg_omr_r() +uint8_t duscc_channel::do_dusccreg_omr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_omr)); return m_omr; } -UINT8 duscc_channel::do_dusccreg_pcr_r() +uint8_t duscc_channel::do_dusccreg_pcr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_pcr)); return m_pcr; @@ -1228,15 +1228,15 @@ UINT8 duscc_channel::do_dusccreg_pcr_r() /* Commands to the DUSCC are entered through the channel command register.A read of this register returns the last invoked command (with bits 4 and 5 set to 1). */ -UINT8 duscc_channel::do_dusccreg_ccr_r() +uint8_t duscc_channel::do_dusccreg_ccr_r() { LOG(("%s\n", FUNCNAME)); - return (UINT8) m_ccr | 1 << 4 | 1 << 5; + return (uint8_t) m_ccr | 1 << 4 | 1 << 5; } -UINT8 duscc_channel::do_dusccreg_rxfifo_r() +uint8_t duscc_channel::do_dusccreg_rxfifo_r() { - UINT8 data = 0; + uint8_t data = 0; LOGINT(("%s\n", FUNCNAME)); LOGRX((" - RX rp:%d wp:%d sz:%d\n", m_rx_fifo_rp, m_rx_fifo_wp, m_rx_fifo_sz)); @@ -1256,25 +1256,25 @@ UINT8 duscc_channel::do_dusccreg_rxfifo_r() LOGINT(("- RX FIFO empty despite RxREADY\n")); } - return (UINT8) data; + return (uint8_t) data; } -UINT8 duscc_channel::do_dusccreg_rsr_r() +uint8_t duscc_channel::do_dusccreg_rsr_r() { LOG(("%s: %02x\n", FUNCNAME, m_rsr)); - return (UINT8) m_rsr; + return (uint8_t) m_rsr; } -UINT8 duscc_channel::do_dusccreg_trsr_r() +uint8_t duscc_channel::do_dusccreg_trsr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_trsr)); return m_trsr; } -UINT8 duscc_channel::do_dusccreg_ictsr_r() +uint8_t duscc_channel::do_dusccreg_ictsr_r() { logerror("%s is not implemented yet\n", FUNCNAME); - return (UINT8) m_ictsr; + return (uint8_t) m_ictsr; } /* General Status Register (GSR) @@ -1298,21 +1298,21 @@ UINT8 duscc_channel::do_dusccreg_ictsr_r() FIFO to be read by the CPU. See description of OMR[3]. RxRDY is initially reset (negated) by a chip reset or when a 'reset Channel A receiver' command is invoked. */ -UINT8 duscc_channel::do_dusccreg_gsr_r() +uint8_t duscc_channel::do_dusccreg_gsr_r() { - static UINT8 old_gsr = 0; + static uint8_t old_gsr = 0; if (m_uart->m_gsr != old_gsr) LOG(("%s <- %02x\n", FUNCNAME, m_uart->m_gsr)); old_gsr = m_uart->m_gsr; return m_uart->m_gsr; } -UINT8 duscc_channel::do_dusccreg_ier_r() +uint8_t duscc_channel::do_dusccreg_ier_r() { LOGINT(("%s <- %02x\n", FUNCNAME, m_ier)); - return (UINT8) m_ier; + return (uint8_t) m_ier; } -UINT8 duscc_channel::do_dusccreg_cid_r() +uint8_t duscc_channel::do_dusccreg_cid_r() { LOG(("%s\n", FUNCNAME)); if ( m_uart->m_variant != SET_CMOS ) @@ -1329,7 +1329,7 @@ UINT8 duscc_channel::do_dusccreg_cid_r() return m_cid; } -UINT8 duscc_channel::do_dusccreg_ivr_ivrm_r() +uint8_t duscc_channel::do_dusccreg_ivr_ivrm_r() { LOG(("%s", FUNCNAME)); if ( m_index == duscc_device::CHANNEL_A ) @@ -1344,61 +1344,61 @@ UINT8 duscc_channel::do_dusccreg_ivr_ivrm_r() } } -UINT8 duscc_channel::do_dusccreg_icr_r() +uint8_t duscc_channel::do_dusccreg_icr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_uart->m_icr)); return m_uart->m_icr; } -UINT8 duscc_channel::do_dusccreg_mrr_r() +uint8_t duscc_channel::do_dusccreg_mrr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_mrr)); return m_mrr; } -UINT8 duscc_channel::do_dusccreg_ier1_r() +uint8_t duscc_channel::do_dusccreg_ier1_r() { LOG(("%s(%02x)\n", FUNCNAME, m_ier1)); return m_ier1; } -UINT8 duscc_channel::do_dusccreg_ier2_r() +uint8_t duscc_channel::do_dusccreg_ier2_r() { LOG(("%s(%02x)\n", FUNCNAME, m_ier2)); return m_ier2; } -UINT8 duscc_channel::do_dusccreg_ier3_r() +uint8_t duscc_channel::do_dusccreg_ier3_r() { LOG(("%s(%02x)\n", FUNCNAME, m_ier3)); return m_ier3; } -UINT8 duscc_channel::do_dusccreg_trcr_r() +uint8_t duscc_channel::do_dusccreg_trcr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_trcr)); return m_trcr; } -UINT8 duscc_channel::do_dusccreg_rflr_r() +uint8_t duscc_channel::do_dusccreg_rflr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_rflr)); return m_rflr; } -UINT8 duscc_channel::do_dusccreg_ftlr_r() +uint8_t duscc_channel::do_dusccreg_ftlr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_ftlr)); return m_ftlr; } -UINT8 duscc_channel::do_dusccreg_trmsr_r() +uint8_t duscc_channel::do_dusccreg_trmsr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_trmsr)); return m_trmsr; } -UINT8 duscc_channel::do_dusccreg_telr_r() +uint8_t duscc_channel::do_dusccreg_telr_r() { LOG(("%s(%02x)\n", FUNCNAME, m_telr)); return m_telr; @@ -1462,7 +1462,7 @@ UINT8 duscc_channel::do_dusccreg_telr_r() This mode is required when the external sync mode is selected. 111 Asynchronous. Start/stop format. */ -void duscc_channel::do_dusccreg_cmr1_w(UINT8 data) +void duscc_channel::do_dusccreg_cmr1_w(uint8_t data) { LOG(("%s(%02x)\n", FUNCNAME, data)); m_cmr1 = data; @@ -1540,7 +1540,7 @@ void duscc_channel::do_dusccreg_cmr1_w(UINT8 data) 111 CRC-CCITT: Divisor ~ x16+x12+x5+1, dividend preset to ones. The TX sends the calculated CRC inverted. The RX indicates an error if the computed CRC is not equal to H' FOB8'. Not valid for ASYNC mode. */ -void duscc_channel::do_dusccreg_cmr2_w(UINT8 data) +void duscc_channel::do_dusccreg_cmr2_w(uint8_t data) { LOG(("%s(%02x)\n", FUNCNAME, data)); m_cmr2 = data; @@ -1560,7 +1560,7 @@ void duscc_channel::do_dusccreg_cmr2_w(UINT8 data) BOP primary mode or secondary modes where address comparisons are not made, such as when extended addressing is specified. TODO: Add check in receive_data and set status bits accordingly */ -void duscc_channel::do_dusccreg_s1r_w(UINT8 data) +void duscc_channel::do_dusccreg_s1r_w(uint8_t data) { LOG(("%s(%02x) - not supported yet\n", FUNCNAME, data)); m_s1r = data; @@ -1574,7 +1574,7 @@ void duscc_channel::do_dusccreg_s1r_w(UINT8 data) the register even if parity is specified in CMR1[4:3J. However, a character received w~ parity error, when parity is specified, will not match. If parity Is specified, then any unused bits in this register must be programmed to zeros. In BOP secondary mode using two address octets, it contains the partial address used to compare the second received address octet.*/ -void duscc_channel::do_dusccreg_s2r_w(UINT8 data) +void duscc_channel::do_dusccreg_s2r_w(uint8_t data) { LOG(("%s(%02x) - not supported yet\n", FUNCNAME, data)); m_s2r = data; @@ -1620,7 +1620,7 @@ void duscc_channel::do_dusccreg_s2r_w(UINT8 data) fields is always 8 bits, and the value of this field only applies to the information (I) field, except for the last character of the I field, whose length is specified by OMR[7:5). */ -void duscc_channel::do_dusccreg_tpr_w(UINT8 data) +void duscc_channel::do_dusccreg_tpr_w(uint8_t data) { LOG(("%s(%02x) Setting up Transmit Parameters\n", FUNCNAME, data)); m_tpr = data; @@ -1664,7 +1664,7 @@ void duscc_channel::do_dusccreg_tpr_w(UINT8 data) 0110 300 1110 19.2K 0111 600 1111 38.4K */ -void duscc_channel::do_dusccreg_ttr_w(UINT8 data) +void duscc_channel::do_dusccreg_ttr_w(uint8_t data) { LOG(("%s(%02x) Setting up Transmit Timing\n", FUNCNAME, data)); m_ttr = data; @@ -1763,7 +1763,7 @@ void duscc_channel::do_dusccreg_ttr_w(UINT8 data) of bits assembled for the last character of the l-field is less than the value programmed in this field, RCL not zero (RSR[O]) is asserted and the actual number of bits received is given in TRSR[2:0]. */ -void duscc_channel::do_dusccreg_rpr_w(UINT8 data) +void duscc_channel::do_dusccreg_rpr_w(uint8_t data) { LOG(("%s(%02x) Setting up Receiver Parameters\n", FUNCNAME, data)); m_rpr = data; @@ -1800,7 +1800,7 @@ void duscc_channel::do_dusccreg_rpr_w(UINT8 data) [3:0] Bit Rate Select- This field selects an output from the bit rate generator to be used by the receiver circuits. The actual frequency output from the BRG is 32X the bit rate shown in Table 5.*/ -void duscc_channel::do_dusccreg_rtr_w(UINT8 data) +void duscc_channel::do_dusccreg_rtr_w(uint8_t data) { LOG(("%s(%02x) Setting up Receiver Timing\n", FUNCNAME, data)); m_rtr = data; @@ -1866,7 +1866,7 @@ void duscc_channel::do_dusccreg_rtr_w(UINT8 data) [0] Request-to-Send Output - This bit controls the TxDRQN/GP02N/RTSN and SYNOUTN/RTSN pin, when either is used as a RTS output. The output is High when the bit is a 0 and is Low when the bit is a 1. */ -void duscc_channel::do_dusccreg_omr_w(UINT8 data) +void duscc_channel::do_dusccreg_omr_w(uint8_t data) { LOG(("%s(%02x) Output and Miscellaneous Register\n", FUNCNAME, data)); m_omr = data; @@ -1910,7 +1910,7 @@ void duscc_channel::do_dusccreg_omr_w(UINT8 data) 110 The pin is an output for the transmitter shift register clock. 111 The pin is an output for the receiver shift register clock. */ -void duscc_channel::do_dusccreg_pcr_w(UINT8 data) +void duscc_channel::do_dusccreg_pcr_w(uint8_t data) { LOG(("%c %s(%02x)\n", 'A' + m_index, FUNCNAME, data)); m_pcr = data; @@ -1951,7 +1951,7 @@ void duscc_channel::do_dusccreg_pcr_w(UINT8 data) * TODO: * - support enable/disable of Tx/Rx using m_tra/m_rcv respectivelly */ -void duscc_channel::do_dusccreg_ccr_w(UINT8 data) +void duscc_channel::do_dusccreg_ccr_w(uint8_t data) { int rate; @@ -2053,7 +2053,7 @@ void duscc_channel::do_dusccreg_ccr_w(UINT8 data) return; } -void duscc_channel::do_dusccreg_txfifo_w(UINT8 data) +void duscc_channel::do_dusccreg_txfifo_w(uint8_t data) { LOGTX((" - TX %s(%02x)'%c'\n", FUNCNAME,data, isalnum(data) ? data : ' ')); @@ -2112,21 +2112,21 @@ void duscc_channel::do_dusccreg_txfifo_w(UINT8 data) character by character or on a block basis. For character by character status, the SR bits should be read and then cleared before reading the character data from RxFIFO. For block status, the status register is initially cleared and then read after the message is received. Asserted status bits can be programmed to generate an interrupt (see Interrupt Enable Register).*/ -void duscc_channel::do_dusccreg_rsr_w(UINT8 data) +void duscc_channel::do_dusccreg_rsr_w(uint8_t data) { LOG(("%c %s(%02x)\n", 'A' + m_index, FUNCNAME, data)); m_rsr &= ~data; // Clear only bits which are 1:s return; } -void duscc_channel::do_dusccreg_trsr_w(UINT8 data) +void duscc_channel::do_dusccreg_trsr_w(uint8_t data) { LOG(("%s: %02x - not supported yet\n", FUNCNAME, data)); m_trsr = data; return; } -void duscc_channel::do_dusccreg_ictsr_w(UINT8 data) +void duscc_channel::do_dusccreg_ictsr_w(uint8_t data) { LOG(("%s: %02x - not supported yet\n", FUNCNAME, data)); m_ictsr = data; @@ -2152,7 +2152,7 @@ void duscc_channel::do_dusccreg_ictsr_w(UINT8 data) [0) Channel A Receiver Ready - The assertion of this bit indicates that one or more characters are available in the Channel A receiver FIFO to be read by the CPU. See description of OMR[3]. RxRDY is initially reset (negated) by a chip reset or when a 'reset Channel A receiver' command is invoked.*/ -void duscc_channel::do_dusccreg_gsr_w(UINT8 data) +void duscc_channel::do_dusccreg_gsr_w(uint8_t data) { LOG(("%c %s(%02x)\n", 'A' + m_index, FUNCNAME, data)); m_uart->m_gsr &= (data & REG_GSR_XXREADY_MASK); // Reset only XXREADY bits, the rest needs to be reset by the source @@ -2162,7 +2162,7 @@ void duscc_channel::do_dusccreg_gsr_w(UINT8 data) /* Interrupt Enable Register (IERA, IERB) This register controls whether the assertion of bits in the channel's status registers causes an interrupt to be generated. An additional condition for an interrupt to be generated is that the channel's master interrupt enabled bit, ICR[O] or ICR[1], be asserted.*/ -void duscc_channel::do_dusccreg_ier_w(UINT8 data) +void duscc_channel::do_dusccreg_ier_w(uint8_t data) { LOGINT(("%c %s(%02x)\n", 'A' + m_index, FUNCNAME, data)); if (REG_IER_DCD_CTS & (data ^ m_ier)) LOGINT(("- DCD/CTS interrups %s\n", (data & REG_IER_DCD_CTS) ? "enabled" : "disabled" )); @@ -2178,14 +2178,14 @@ void duscc_channel::do_dusccreg_ier_w(UINT8 data) return; } -void duscc_channel::do_dusccreg_ivr_w(UINT8 data) +void duscc_channel::do_dusccreg_ivr_w(uint8_t data) { m_uart->m_ivr = data; LOG(("%s(%02x)\n", FUNCNAME, data)); return; } -void duscc_channel::do_dusccreg_icr_w(UINT8 data) +void duscc_channel::do_dusccreg_icr_w(uint8_t data) { m_uart->m_icr = data; LOG(("%s(%02x)\n", FUNCNAME, data)); @@ -2198,7 +2198,7 @@ void duscc_channel::do_dusccreg_icr_w(UINT8 data) return; } -void duscc_channel::do_dusccreg_sea_rea_w(UINT8 data) +void duscc_channel::do_dusccreg_sea_rea_w(uint8_t data) { LOG(("%s(%02x)\n", FUNCNAME, data)); if ( m_uart->m_variant != SET_CMOS ) @@ -2214,20 +2214,20 @@ void duscc_channel::do_dusccreg_sea_rea_w(UINT8 data) return; } -void duscc_channel::do_dusccreg_mrr_w(UINT8 data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } -void duscc_channel::do_dusccreg_ier1_w(UINT8 data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } -void duscc_channel::do_dusccreg_ier2_w(UINT8 data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } -void duscc_channel::do_dusccreg_ier3_w(UINT8 data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } -void duscc_channel::do_dusccreg_trcr_w(UINT8 data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } -void duscc_channel::do_dusccreg_ftlr_w(UINT8 data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } -void duscc_channel::do_dusccreg_trmsr_w(UINT8 data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } +void duscc_channel::do_dusccreg_mrr_w(uint8_t data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } +void duscc_channel::do_dusccreg_ier1_w(uint8_t data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } +void duscc_channel::do_dusccreg_ier2_w(uint8_t data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } +void duscc_channel::do_dusccreg_ier3_w(uint8_t data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } +void duscc_channel::do_dusccreg_trcr_w(uint8_t data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } +void duscc_channel::do_dusccreg_ftlr_w(uint8_t data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } +void duscc_channel::do_dusccreg_trmsr_w(uint8_t data){ logerror("%s is not implemented yet\n", FUNCNAME); return; } //------------------------------------------------- // control_read - read register //------------------------------------------------- -UINT8 duscc_channel::read(offs_t &offset) +uint8_t duscc_channel::read(offs_t &offset) { - UINT8 data = 0; + uint8_t data = 0; int reg = (offset | m_a7) & ~0x20; // Add extended rgisters and remove the channel B bit from offset LOG(("\"%s\" %s: %c : Register read '%02x' <- [%02x]", m_owner->tag(), FUNCNAME, 'A' + m_index, data, reg )); LOGR((" * %c Reg %02x -> %02x \n", 'A' + m_index, reg, data)); @@ -2275,7 +2275,7 @@ UINT8 duscc_channel::read(offs_t &offset) // write - write register //------------------------------------------------- -void duscc_channel::write(UINT8 data, offs_t &offset) +void duscc_channel::write(uint8_t data, offs_t &offset) { int reg = (offset | m_a7) & ~0x20; // Add extended rgisters and remove the channel B bit from offset @@ -2328,10 +2328,10 @@ void duscc_channel::write(UINT8 data, offs_t &offset) } /* Get data from top of fifo data but restore read pointer in case of exit latch lock */ -UINT8 duscc_channel::m_rx_fifo_rp_data() +uint8_t duscc_channel::m_rx_fifo_rp_data() { - UINT8 data; - UINT8 old_rp = m_rx_fifo_rp; + uint8_t data; + uint8_t old_rp = m_rx_fifo_rp; m_rx_fifo_rp_step(); data = m_rx_data_fifo[m_rx_fifo_rp]; m_rx_fifo_rp = old_rp; @@ -2370,7 +2370,7 @@ void duscc_channel::m_tx_fifo_rp_step() // receive_data - receive data word into fifo //------------------------------------------------- -void duscc_channel::receive_data(UINT8 data) +void duscc_channel::receive_data(uint8_t data) { LOG(("\"%s\": %c : Receive Data Byte '%02x'\n", m_owner->tag(), 'A' + m_index, data)); diff --git a/src/devices/machine/scnxx562.h b/src/devices/machine/scnxx562.h index 4ae46c1a5f6..58e2a57fe75 100644 --- a/src/devices/machine/scnxx562.h +++ b/src/devices/machine/scnxx562.h @@ -129,7 +129,7 @@ class duscc_channel : public device_t, friend class duscc_device; public: - duscc_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + duscc_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -143,84 +143,84 @@ public: virtual void rcv_complete() override; // read register handlers - UINT8 do_dusccreg_cmr1_r(); - UINT8 do_dusccreg_cmr2_r(); - UINT8 do_dusccreg_s1r_r(); - UINT8 do_dusccreg_s2r_r(); - UINT8 do_dusccreg_tpr_r(); - UINT8 do_dusccreg_ttr_r(); - UINT8 do_dusccreg_rpr_r(); - UINT8 do_dusccreg_rtr_r(); - UINT8 do_dusccreg_ctprh_r(); - UINT8 do_dusccreg_ctprl_r(); - UINT8 do_dusccreg_ctcr_r(); - UINT8 do_dusccreg_omr_r(); - UINT8 do_dusccreg_cth_r(); - UINT8 do_dusccreg_ctl_r(); - UINT8 do_dusccreg_pcr_r(); - UINT8 do_dusccreg_ccr_r(); - UINT8 do_dusccreg_rxfifo_r(); - UINT8 do_dusccreg_rsr_r(); - UINT8 do_dusccreg_trsr_r(); - UINT8 do_dusccreg_ictsr_r(); - UINT8 do_dusccreg_gsr_r(); - UINT8 do_dusccreg_ier_r(); - UINT8 do_dusccreg_cid_r(); - UINT8 do_dusccreg_ivr_ivrm_r(); - UINT8 do_dusccreg_icr_r(); - UINT8 do_dusccreg_mrr_r(); - UINT8 do_dusccreg_ier1_r(); - UINT8 do_dusccreg_ier2_r(); - UINT8 do_dusccreg_ier3_r(); - UINT8 do_dusccreg_trcr_r(); - UINT8 do_dusccreg_rflr_r(); - UINT8 do_dusccreg_ftlr_r(); - UINT8 do_dusccreg_trmsr_r(); - UINT8 do_dusccreg_telr_r(); + uint8_t do_dusccreg_cmr1_r(); + uint8_t do_dusccreg_cmr2_r(); + uint8_t do_dusccreg_s1r_r(); + uint8_t do_dusccreg_s2r_r(); + uint8_t do_dusccreg_tpr_r(); + uint8_t do_dusccreg_ttr_r(); + uint8_t do_dusccreg_rpr_r(); + uint8_t do_dusccreg_rtr_r(); + uint8_t do_dusccreg_ctprh_r(); + uint8_t do_dusccreg_ctprl_r(); + uint8_t do_dusccreg_ctcr_r(); + uint8_t do_dusccreg_omr_r(); + uint8_t do_dusccreg_cth_r(); + uint8_t do_dusccreg_ctl_r(); + uint8_t do_dusccreg_pcr_r(); + uint8_t do_dusccreg_ccr_r(); + uint8_t do_dusccreg_rxfifo_r(); + uint8_t do_dusccreg_rsr_r(); + uint8_t do_dusccreg_trsr_r(); + uint8_t do_dusccreg_ictsr_r(); + uint8_t do_dusccreg_gsr_r(); + uint8_t do_dusccreg_ier_r(); + uint8_t do_dusccreg_cid_r(); + uint8_t do_dusccreg_ivr_ivrm_r(); + uint8_t do_dusccreg_icr_r(); + uint8_t do_dusccreg_mrr_r(); + uint8_t do_dusccreg_ier1_r(); + uint8_t do_dusccreg_ier2_r(); + uint8_t do_dusccreg_ier3_r(); + uint8_t do_dusccreg_trcr_r(); + uint8_t do_dusccreg_rflr_r(); + uint8_t do_dusccreg_ftlr_r(); + uint8_t do_dusccreg_trmsr_r(); + uint8_t do_dusccreg_telr_r(); // write register handlers - void do_dusccreg_cmr1_w(UINT8 data); - void do_dusccreg_cmr2_w(UINT8 data); - void do_dusccreg_s1r_w(UINT8 data); - void do_dusccreg_s2r_w(UINT8 data); - void do_dusccreg_tpr_w(UINT8 data); - void do_dusccreg_ttr_w(UINT8 data); - void do_dusccreg_rpr_w(UINT8 data); - void do_dusccreg_rtr_w(UINT8 data); - void do_dusccreg_ctprh_w(UINT8 data); - void do_dusccreg_ctprl_w(UINT8 data); - void do_dusccreg_ctcr_w(UINT8 data); - void do_dusccreg_omr_w(UINT8 data); - void do_dusccreg_pcr_w(UINT8 data); - void do_dusccreg_ccr_w(UINT8 data); - void do_dusccreg_txfifo_w(UINT8 data); - void do_dusccreg_rsr_w(UINT8 data); - void do_dusccreg_trsr_w(UINT8 data); - void do_dusccreg_ictsr_w(UINT8 data); - void do_dusccreg_gsr_w(UINT8 data); - void do_dusccreg_ier_w(UINT8 data); - // void do_dusccreg_rea_w(UINT8 data); // Short cutted non complex feature - void do_dusccreg_ivr_w(UINT8 data); - void do_dusccreg_icr_w(UINT8 data); - void do_dusccreg_sea_rea_w(UINT8 data); // Short cutted non complex feature - void do_dusccreg_mrr_w(UINT8 data); - void do_dusccreg_ier1_w(UINT8 data); - void do_dusccreg_ier2_w(UINT8 data); - void do_dusccreg_ier3_w(UINT8 data); - void do_dusccreg_trcr_w(UINT8 data); - void do_dusccreg_ftlr_w(UINT8 data); - void do_dusccreg_trmsr_w(UINT8 data); - - UINT8 read(offs_t &offset); - void write(UINT8 data, offs_t &offset); - - // UINT8 data_read(); - // void data_write(UINT8 data); - - void receive_data(UINT8 data); + void do_dusccreg_cmr1_w(uint8_t data); + void do_dusccreg_cmr2_w(uint8_t data); + void do_dusccreg_s1r_w(uint8_t data); + void do_dusccreg_s2r_w(uint8_t data); + void do_dusccreg_tpr_w(uint8_t data); + void do_dusccreg_ttr_w(uint8_t data); + void do_dusccreg_rpr_w(uint8_t data); + void do_dusccreg_rtr_w(uint8_t data); + void do_dusccreg_ctprh_w(uint8_t data); + void do_dusccreg_ctprl_w(uint8_t data); + void do_dusccreg_ctcr_w(uint8_t data); + void do_dusccreg_omr_w(uint8_t data); + void do_dusccreg_pcr_w(uint8_t data); + void do_dusccreg_ccr_w(uint8_t data); + void do_dusccreg_txfifo_w(uint8_t data); + void do_dusccreg_rsr_w(uint8_t data); + void do_dusccreg_trsr_w(uint8_t data); + void do_dusccreg_ictsr_w(uint8_t data); + void do_dusccreg_gsr_w(uint8_t data); + void do_dusccreg_ier_w(uint8_t data); + // void do_dusccreg_rea_w(uint8_t data); // Short cutted non complex feature + void do_dusccreg_ivr_w(uint8_t data); + void do_dusccreg_icr_w(uint8_t data); + void do_dusccreg_sea_rea_w(uint8_t data); // Short cutted non complex feature + void do_dusccreg_mrr_w(uint8_t data); + void do_dusccreg_ier1_w(uint8_t data); + void do_dusccreg_ier2_w(uint8_t data); + void do_dusccreg_ier3_w(uint8_t data); + void do_dusccreg_trcr_w(uint8_t data); + void do_dusccreg_ftlr_w(uint8_t data); + void do_dusccreg_trmsr_w(uint8_t data); + + uint8_t read(offs_t &offset); + void write(uint8_t data, offs_t &offset); + + // uint8_t data_read(); + // void data_write(uint8_t data); + + void receive_data(uint8_t data); void m_tx_fifo_rp_step(); void m_rx_fifo_rp_step(); - UINT8 m_rx_fifo_rp_data(); + uint8_t m_rx_fifo_rp_data(); DECLARE_WRITE_LINE_MEMBER( write_rx ); DECLARE_WRITE_LINE_MEMBER( cts_w ); @@ -236,46 +236,46 @@ public: int m_rcv; // Register state - UINT8 m_cmr1; - UINT8 m_cmr2; - UINT8 m_s1r; - UINT8 m_s2r; - UINT8 m_tpr; - UINT8 m_ttr; - UINT8 m_rpr; - UINT8 m_rtr; - // UINT8 m_ctprh; - // UINT8 m_ctprl; + uint8_t m_cmr1; + uint8_t m_cmr2; + uint8_t m_s1r; + uint8_t m_s2r; + uint8_t m_tpr; + uint8_t m_ttr; + uint8_t m_rpr; + uint8_t m_rtr; + // uint8_t m_ctprh; + // uint8_t m_ctprl; unsigned int m_ctpr; - UINT8 m_ctcr; - UINT8 m_omr; - // UINT8 m_cth; - // UINT8 m_ctl; + uint8_t m_ctcr; + uint8_t m_omr; + // uint8_t m_cth; + // uint8_t m_ctl; unsigned int m_ct; - UINT8 m_pcr; - UINT8 m_ccr; - UINT8 m_txfifo[4]; - UINT8 m_rxfifo[4]; - UINT8 m_rsr; - UINT8 m_trsr; - UINT8 m_ictsr; - // UINT8 m_gsr; // moved to the device since it is global - UINT8 m_ier; - // UINT8 m_rea; - UINT8 m_cid; - //UINT8 m_ivr; - //UINT8 m_icr; - // UINT8 m_sea; - //UINT8 m_ivrm; - UINT8 m_mrr; - UINT8 m_ier1; - UINT8 m_ier2; - UINT8 m_ier3; - UINT8 m_trcr; - UINT8 m_rflr; - UINT8 m_ftlr; - UINT8 m_trmsr; - UINT8 m_telr; + uint8_t m_pcr; + uint8_t m_ccr; + uint8_t m_txfifo[4]; + uint8_t m_rxfifo[4]; + uint8_t m_rsr; + uint8_t m_trsr; + uint8_t m_ictsr; + // uint8_t m_gsr; // moved to the device since it is global + uint8_t m_ier; + // uint8_t m_rea; + uint8_t m_cid; + //uint8_t m_ivr; + //uint8_t m_icr; + // uint8_t m_sea; + //uint8_t m_ivrm; + uint8_t m_mrr; + uint8_t m_ier1; + uint8_t m_ier2; + uint8_t m_ier3; + uint8_t m_trcr; + uint8_t m_rflr; + uint8_t m_ftlr; + uint8_t m_trmsr; + uint8_t m_telr; protected: enum // Needs to be 0-3 in unmodified prio level @@ -495,8 +495,8 @@ protected: emu_timer *rtxc_timer; emu_timer *trxc_timer; - UINT8 m_rtxc; - UINT8 m_trxc; + uint8_t m_rtxc; + uint8_t m_trxc; enum @@ -513,9 +513,9 @@ protected: TIMER_ID_TRXC }; - UINT16 m_brg_rx_rate; - UINT16 m_brg_tx_rate; - UINT16 m_brg_const; + uint16_t m_brg_rx_rate; + uint16_t m_brg_tx_rate; + uint16_t m_brg_const; // TODO: Implement the 14.4K, 56K and 64K bauds available on the CDUSCC static unsigned int get_baudrate(unsigned int br) @@ -554,20 +554,20 @@ protected: /* FIFOs and rx/tx status */ /* Receiver */ - UINT8 m_rx_data_fifo[16]; // data FIFO - UINT8 m_rx_error_fifo[16]; // error FIFO + uint8_t m_rx_data_fifo[16]; // data FIFO + uint8_t m_rx_error_fifo[16]; // error FIFO int m_rx_fifo_rp; // FIFO read pointer int m_rx_fifo_wp; // FIFO write pointer int m_rx_fifo_sz; // FIFO size - UINT8 m_rx_error; // current error + uint8_t m_rx_error; // current error /* Transmitter */ - UINT8 m_tx_data_fifo[16]; // data FIFO - UINT8 m_tx_error_fifo[16]; // error FIFO + uint8_t m_tx_data_fifo[16]; // data FIFO + uint8_t m_tx_error_fifo[16]; // error FIFO int m_tx_fifo_rp; // FIFO read pointer int m_tx_fifo_wp; // FIFO write pointer int m_tx_fifo_sz; // FIFO size - UINT8 m_tx_error; // current error + uint8_t m_tx_error; // current error int m_rx_clock; // receive clock pulse count int m_rx_first; // first character received @@ -579,14 +579,14 @@ protected: int m_dcd; // data carrier detect latch // transmitter state - UINT8 m_tx_data; // transmit data register + uint8_t m_tx_data; // transmit data register int m_tx_clock; // transmit clock pulse count int m_dtr; // data terminal ready int m_rts; // request to send // synchronous state - UINT16 m_sync; // sync character + uint16_t m_sync; // sync character int m_rcv_mode; int m_index; @@ -607,8 +607,8 @@ class duscc_device : public device_t public: // construction/destruction - duscc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - duscc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + duscc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + duscc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_txda_callback(device_t &device, _Object object) { return downcast(device).m_out_txda_cb.set_callback(object); } template static devcb_base &set_out_dtra_callback(device_t &device, _Object object) { return downcast(device).m_out_dtra_cb.set_callback(object); } @@ -674,7 +674,7 @@ protected: // internal interrupt management void check_interrupts(); void reset_interrupts(); - UINT8 modify_vector(UINT8 vect, int i, UINT8 src); + uint8_t modify_vector(uint8_t vect, int i, uint8_t src); void trigger_interrupt(int index, int state); int get_channel_index(duscc_channel *ch) { return (ch == m_chanA) ? 0 : 1; } @@ -727,10 +727,10 @@ protected: int m_int_state[8]; // interrupt state int m_variant; - UINT8 m_gsr; - UINT8 m_ivr; - UINT8 m_ivrm; - UINT8 m_icr; + uint8_t m_gsr; + uint8_t m_ivr; + uint8_t m_ivrm; + uint8_t m_icr; enum { @@ -759,25 +759,25 @@ extern const device_type DUSCC68C562; class duscc26562_device : public duscc_device { public : - duscc26562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + duscc26562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class duscc26C562_device : public duscc_device { public : - duscc26C562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + duscc26C562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class duscc68562_device : public duscc_device { public : - duscc68562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + duscc68562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class duscc68C562_device : public duscc_device { public : - duscc68C562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + duscc68C562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; #endif // __SCNXX562_H__ diff --git a/src/devices/machine/serflash.cpp b/src/devices/machine/serflash.cpp index c8c3eb89797..8ba5cf91ad4 100644 --- a/src/devices/machine/serflash.cpp +++ b/src/devices/machine/serflash.cpp @@ -22,7 +22,7 @@ const device_type SERFLASH = &device_creator; // serflash_device - constructor //------------------------------------------------- -serflash_device::serflash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +serflash_device::serflash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SERFLASH, "Serial Flash", tag, owner, clock, "serflash", __FILE__), device_nvram_interface(mconfig, *this), m_length(0), m_region(nullptr), m_flash_state(), m_flash_enab(0), m_flash_cmd_seq(0), m_flash_cmd_prev(0), m_flash_addr_seq(0), m_flash_read_seq(0), m_flash_row(0), @@ -95,7 +95,7 @@ void serflash_device::nvram_read(emu_file &file) if (file.is_open()) { - UINT32 page; + uint32_t page; file.read(&page, 4); while (page < size) { @@ -118,7 +118,7 @@ void serflash_device::nvram_write(emu_file &file) if (m_length % FLASH_PAGE_SIZE) return; // region size must be multiple of flash page size int size = m_length / FLASH_PAGE_SIZE; - UINT32 page = 0; + uint32_t page = 0; while (page < size) { if (m_flashwritemap[page]) @@ -306,8 +306,8 @@ WRITE8_MEMBER( serflash_device::flash_addr_w ) READ8_MEMBER( serflash_device::flash_io_r ) { - UINT8 data = 0x00; -// UINT32 old; + uint8_t data = 0x00; +// uint32_t old; if (!m_flash_enab) return 0xff; @@ -376,7 +376,7 @@ READ8_MEMBER(serflash_device::n3d_flash_r) if (m_last_flash_cmd==0x00) { - UINT8 retdat = m_flash_page_data[m_flash_page_addr]; + uint8_t retdat = m_flash_page_data[m_flash_page_addr]; //logerror("n3d_flash_r %02x %04x\n", offset, m_flash_page_addr); diff --git a/src/devices/machine/serflash.h b/src/devices/machine/serflash.h index e72432cc109..b7df13b6957 100644 --- a/src/devices/machine/serflash.h +++ b/src/devices/machine/serflash.h @@ -42,7 +42,7 @@ class serflash_device : public device_t, public: // construction/destruction - serflash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + serflash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( flash_ready_r ); DECLARE_READ8_MEMBER( flash_io_r ); @@ -70,31 +70,31 @@ protected: // runtime state size_t m_length; - UINT8* m_region; + uint8_t* m_region; flash_state_t m_flash_state; - UINT8 m_flash_enab; + uint8_t m_flash_enab; - UINT8 m_flash_cmd_seq; - UINT32 m_flash_cmd_prev; + uint8_t m_flash_cmd_seq; + uint32_t m_flash_cmd_prev; - UINT8 m_flash_addr_seq; - UINT8 m_flash_read_seq; + uint8_t m_flash_addr_seq; + uint8_t m_flash_read_seq; - UINT16 m_flash_row, m_flash_col; + uint16_t m_flash_row, m_flash_col; int m_flash_page_addr; - UINT16 m_flash_page_index; + uint16_t m_flash_page_index; - std::vector m_flashwritemap; + std::vector m_flashwritemap; - UINT8 m_last_flash_cmd; + uint8_t m_last_flash_cmd; - UINT32 m_flash_addr; + uint32_t m_flash_addr; - UINT8 m_flash_page_data[FLASH_PAGE_SIZE]; + uint8_t m_flash_page_data[FLASH_PAGE_SIZE]; diff --git a/src/devices/machine/smartmed.cpp b/src/devices/machine/smartmed.cpp index d541f7ca52b..608122981af 100644 --- a/src/devices/machine/smartmed.cpp +++ b/src/devices/machine/smartmed.cpp @@ -27,16 +27,16 @@ /* machine-independent big-endian 32-bit integer */ struct UINT32BE { - UINT8 bytes[4]; + uint8_t bytes[4]; }; -static inline UINT32 get_UINT32BE(UINT32BE word) +static inline uint32_t get_UINT32BE(UINT32BE word) { return (word.bytes[0] << 24) | (word.bytes[1] << 16) | (word.bytes[2] << 8) | word.bytes[3]; } #ifdef UNUSED_FUNCTION -static inline void set_UINT32BE(UINT32BE *word, UINT32 data) +static inline void set_UINT32BE(UINT32BE *word, uint32_t data) { word->bytes[0] = (data >> 24) & 0xff; word->bytes[1] = (data >> 16) & 0xff; @@ -48,7 +48,7 @@ static inline void set_UINT32BE(UINT32BE *word, UINT32 data) /* SmartMedia image header */ struct SM_disk_image_header { - UINT8 version; + uint8_t version; UINT32BE page_data_size; UINT32BE page_total_size; UINT32BE num_pages; @@ -57,11 +57,11 @@ struct SM_disk_image_header struct disk_image_format_2_header { - UINT8 data1[3]; - UINT8 padding1[256-3]; - UINT8 data2[16]; - UINT8 data3[16]; - UINT8 padding2[768-32]; + uint8_t data1[3]; + uint8_t padding1[256-3]; + uint8_t data2[16]; + uint8_t data3[16]; + uint8_t padding2[768-32]; }; enum @@ -72,7 +72,7 @@ enum const device_type NAND = &device_creator; -nand_device::nand_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nand_device::nand_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAND, "NAND Flash Memory", tag, owner, clock, "nand", __FILE__), m_page_data_size(0), m_page_total_size(0), @@ -88,7 +88,7 @@ nand_device::nand_device(const machine_config &mconfig, const char *tag, device_ memset(m_id, 0, sizeof(m_id)); } -nand_device::nand_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) +nand_device::nand_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_page_data_size(0), m_page_total_size(0), @@ -119,7 +119,7 @@ void nand_device::device_start() m_accumulated_status = 0; m_mp_opcode = 0; m_mode_3065 = 0; - m_pagereg = std::make_unique(m_page_total_size); + m_pagereg = std::make_unique(m_page_total_size); #ifdef SMARTMEDIA_IMAGE_SAVE m_image_format = 0; @@ -150,8 +150,8 @@ image_init_result smartmedia_image_device::smartmedia_format_1() m_page_total_size = get_UINT32BE(custom_header.page_total_size); m_num_pages = get_UINT32BE(custom_header.num_pages); m_log2_pages_per_block = get_UINT32BE(custom_header.log2_pages_per_block); - m_data_ptr = auto_alloc_array(machine(), UINT8, m_page_total_size*m_num_pages); - m_data_uid_ptr = std::make_unique(256 + 16); + m_data_ptr = auto_alloc_array(machine(), uint8_t, m_page_total_size*m_num_pages); + m_data_uid_ptr = std::make_unique(256 + 16); m_mode = SM_M_INIT; m_pointer_mode = SM_PM_A; m_page_addr = 0; @@ -160,7 +160,7 @@ image_init_result smartmedia_image_device::smartmedia_format_1() if (!is_readonly()) m_status |= 0x80; m_accumulated_status = 0; - m_pagereg = std::make_unique(m_page_total_size); + m_pagereg = std::make_unique(m_page_total_size); memset( m_id, 0, sizeof( m_id)); m_id_len = 0; m_col_address_cycles = 1; @@ -189,7 +189,7 @@ image_init_result smartmedia_image_device::smartmedia_format_1() return image_init_result::PASS; } -int smartmedia_image_device::detect_geometry( UINT8 id1, UINT8 id2) +int smartmedia_image_device::detect_geometry( uint8_t id1, uint8_t id2) { int result = FALSE; @@ -245,8 +245,8 @@ image_init_result smartmedia_image_device::smartmedia_format_2() return image_init_result::FAIL; } - m_data_ptr = auto_alloc_array(machine(), UINT8, m_page_total_size*m_num_pages); - m_data_uid_ptr = std::make_unique(256 + 16); + m_data_ptr = auto_alloc_array(machine(), uint8_t, m_page_total_size*m_num_pages); + m_data_uid_ptr = std::make_unique(256 + 16); m_mode = SM_M_INIT; m_pointer_mode = SM_PM_A; m_page_addr = 0; @@ -255,7 +255,7 @@ image_init_result smartmedia_image_device::smartmedia_format_2() if (!is_readonly()) m_status |= 0x80; m_accumulated_status = 0; - m_pagereg = std::make_unique(m_page_total_size); + m_pagereg = std::make_unique(m_page_total_size); m_id_len = 3; memcpy( m_id, custom_header.data1, m_id_len); m_mp_opcode = 0; @@ -282,7 +282,7 @@ image_init_result smartmedia_image_device::smartmedia_format_2() image_init_result smartmedia_image_device::call_load() { image_init_result result; - UINT64 position; + uint64_t position; // try format 1 position = ftell(); result = smartmedia_format_1(); @@ -343,7 +343,7 @@ void smartmedia_image_device::call_unload() m_byte_addr = 0; m_status = 0xC0; m_accumulated_status = 0; - m_pagereg = std::make_unique(m_page_total_size); + m_pagereg = std::make_unique(m_page_total_size); memset( m_id, 0, sizeof( m_id)); m_id_len = 0; m_mp_opcode = 0; @@ -376,13 +376,13 @@ int nand_device::is_busy() void nand_device::set_data_ptr(void *ptr) { - m_data_ptr = (UINT8 *)ptr; + m_data_ptr = (uint8_t *)ptr; } /* write a byte to SmartMedia command port */ -void nand_device::command_w(UINT8 data) +void nand_device::command_w(uint8_t data) { if (!is_present()) return; @@ -593,7 +593,7 @@ void nand_device::command_w(UINT8 data) /* write a byte to SmartMedia address port */ -void nand_device::address_w(UINT8 data) +void nand_device::address_w(uint8_t data) { if (!is_present()) return; @@ -671,9 +671,9 @@ void nand_device::address_w(UINT8 data) /* read a byte from SmartMedia data port */ -UINT8 nand_device::data_r() +uint8_t nand_device::data_r() { - UINT8 reply = 0; + uint8_t reply = 0; if (!is_present()) return 0; @@ -732,7 +732,7 @@ UINT8 nand_device::data_r() /* write a byte to SmartMedia data port */ -void nand_device::data_w(UINT8 data) +void nand_device::data_w(uint8_t data) { if (!is_present()) return; @@ -779,7 +779,7 @@ void nand_device::device_reset() const device_type SMARTMEDIA = &device_creator; -smartmedia_image_device::smartmedia_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +smartmedia_image_device::smartmedia_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nand_device(mconfig, SMARTMEDIA, "SmartMedia Flash ROM", tag, owner, clock, "smartmedia", __FILE__), device_image_interface(mconfig, *this) { diff --git a/src/devices/machine/smartmed.h b/src/devices/machine/smartmed.h index f1da965c4e9..d2a7b926008 100644 --- a/src/devices/machine/smartmed.h +++ b/src/devices/machine/smartmed.h @@ -58,8 +58,8 @@ class nand_device : public device_t { public: // construction/destruction - nand_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - nand_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); + nand_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nand_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_rnb_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_rnb.set_callback(object); } @@ -141,10 +141,10 @@ public: int is_protected(); int is_busy(); - UINT8 data_r(); - void command_w(UINT8 data); - void address_w(UINT8 data); - void data_w(UINT8 data); + uint8_t data_r(); + void command_w(uint8_t data); + void address_w(uint8_t data); + void data_w(uint8_t data); void set_data_ptr(void *ptr); protected: @@ -159,8 +159,8 @@ protected: // 0 means no card loaded int m_log2_pages_per_block; // log2 of number of pages per erase block (usually 4 or 5) - UINT8* m_data_ptr; // FEEPROM data area - std::unique_ptr m_data_uid_ptr; + uint8_t* m_data_ptr; // FEEPROM data area + std::unique_ptr m_data_uid_ptr; sm_mode_t m_mode; // current operation mode pointer_sm_mode_t m_pointer_mode; // pointer mode @@ -172,9 +172,9 @@ protected: int m_status; // current status int m_accumulated_status; // accumulated status - std::unique_ptr m_pagereg; // page register used by program command - UINT8 m_id[5]; // chip ID - UINT8 m_mp_opcode; // multi-plane operation code + std::unique_ptr m_pagereg; // page register used by program command + uint8_t m_id[5]; // chip ID + uint8_t m_mp_opcode; // multi-plane operation code int m_mode_3065; @@ -202,7 +202,7 @@ class smartmedia_image_device : public nand_device, { public: // construction/destruction - smartmedia_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + smartmedia_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_MEMCARD; } @@ -225,7 +225,7 @@ protected: image_init_result smartmedia_format_1(); image_init_result smartmedia_format_2(); - int detect_geometry( UINT8 id1, UINT8 id2); + int detect_geometry( uint8_t id1, uint8_t id2); }; diff --git a/src/devices/machine/smc91c9x.cpp b/src/devices/machine/smc91c9x.cpp index a38be999136..3ac4bed1312 100644 --- a/src/devices/machine/smc91c9x.cpp +++ b/src/devices/machine/smc91c9x.cpp @@ -105,7 +105,7 @@ static const char *const ethernet_regname[64] = DEVICE INTERFACE ***************************************************************************/ -smc91c9x_device::smc91c9x_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) +smc91c9x_device::smc91c9x_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_irq_handler(*this) { @@ -183,7 +183,7 @@ void smc91c9x_device::device_reset() const device_type SMC91C94 = &device_creator; -smc91c94_device::smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +smc91c94_device::smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : smc91c9x_device(mconfig, SMC91C94, "SMC91C94 Ethernet Controller", tag, owner, clock, "smc91c94", __FILE__) { } @@ -191,7 +191,7 @@ smc91c94_device::smc91c94_device(const machine_config &mconfig, const char *tag, const device_type SMC91C96 = &device_creator; -smc91c96_device::smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +smc91c96_device::smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : smc91c9x_device(mconfig, SMC91C96, "SMC91C96", tag, owner, clock, "smc91c96", __FILE__) { } @@ -206,8 +206,8 @@ smc91c96_device::smc91c96_device(const machine_config &mconfig, const char *tag, void smc91c9x_device::update_ethernet_irq() { - UINT8 mask = m_reg[EREG_INTERRUPT] >> 8; - UINT8 state = m_reg[EREG_INTERRUPT] & 0xff; + uint8_t mask = m_reg[EREG_INTERRUPT] >> 8; + uint8_t state = m_reg[EREG_INTERRUPT] & 0xff; /* update the IRQ state */ m_irq_state = ((mask & state) != 0); @@ -255,7 +255,7 @@ void smc91c9x_device::finish_enqueue(int param) if (m_fifo_count < ETHER_RX_BUFFERS) { int buffer_len = ((m_tx[3] << 8) | m_tx[2]) & 0x7ff; - UINT8 *packet = &m_rx[m_fifo_count++ * ETHER_BUFFER_SIZE]; + uint8_t *packet = &m_rx[m_fifo_count++ * ETHER_BUFFER_SIZE]; int packet_len; /* compute the packet length */ @@ -299,7 +299,7 @@ void smc91c9x_device::finish_enqueue(int param) process_command - handle MMU commands -------------------------------------------------*/ -void smc91c9x_device::process_command(UINT16 data) +void smc91c9x_device::process_command(uint16_t data) { switch ((data >> 5) & 7) { @@ -377,7 +377,7 @@ void smc91c9x_device::process_command(UINT16 data) READ16_MEMBER( smc91c9x_device::read ) { - UINT32 result; + uint32_t result; /* determine the effective register */ offset %= 8; @@ -398,7 +398,7 @@ READ16_MEMBER( smc91c9x_device::read ) case EREG_DATA_0: /* data register */ case EREG_DATA_1: /* data register */ { - UINT8 *buffer = (m_reg[EREG_POINTER] & 0x8000) ? m_rx : m_tx; + uint8_t *buffer = (m_reg[EREG_POINTER] & 0x8000) ? m_rx : m_tx; int addr = m_reg[EREG_POINTER] & 0x7ff; result = buffer[addr++]; if (ACCESSING_BITS_8_15) @@ -421,7 +421,7 @@ READ16_MEMBER( smc91c9x_device::read ) WRITE16_MEMBER( smc91c9x_device::write ) { - // UINT16 olddata; + // uint16_t olddata; /* determine the effective register */ offset %= 8; @@ -513,7 +513,7 @@ WRITE16_MEMBER( smc91c9x_device::write ) case EREG_DATA_0: /* data register */ case EREG_DATA_1: /* data register */ { - UINT8 *buffer = (m_reg[EREG_POINTER] & 0x8000) ? m_rx : m_tx; + uint8_t *buffer = (m_reg[EREG_POINTER] & 0x8000) ? m_rx : m_tx; int addr = m_reg[EREG_POINTER] & 0x7ff; buffer[addr++] = data; if (ACCESSING_BITS_8_15) diff --git a/src/devices/machine/smc91c9x.h b/src/devices/machine/smc91c9x.h index f3e7032e0e2..f83d7a6a39a 100644 --- a/src/devices/machine/smc91c9x.h +++ b/src/devices/machine/smc91c9x.h @@ -21,7 +21,7 @@ class smc91c9x_device : public device_t { public: - smc91c9x_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); + smc91c9x_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); ~smc91c9x_device() {} template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } @@ -39,35 +39,35 @@ private: devcb_write_line m_irq_handler; /* raw register data and masks */ - UINT16 m_reg[64]; - UINT16 m_regmask[64]; + uint16_t m_reg[64]; + uint16_t m_regmask[64]; /* IRQ information */ - UINT8 m_irq_state; + uint8_t m_irq_state; /* allocate information */ - UINT8 m_alloc_count; + uint8_t m_alloc_count; /* transmit/receive FIFOs */ - UINT8 m_fifo_count; - UINT8 m_rx[ETHER_BUFFER_SIZE * ETHER_RX_BUFFERS]; - UINT8 m_tx[ETHER_BUFFER_SIZE]; + uint8_t m_fifo_count; + uint8_t m_rx[ETHER_BUFFER_SIZE * ETHER_RX_BUFFERS]; + uint8_t m_tx[ETHER_BUFFER_SIZE]; /* counters */ - UINT32 m_sent; - UINT32 m_recd; + uint32_t m_sent; + uint32_t m_recd; void update_ethernet_irq(); void update_stats(); void finish_enqueue(int param); - void process_command(UINT16 data); + void process_command(uint16_t data); }; class smc91c94_device : public smc91c9x_device { public: - smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type SMC91C94; @@ -75,7 +75,7 @@ extern const device_type SMC91C94; class smc91c96_device : public smc91c9x_device { public: - smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type SMC91C96; diff --git a/src/devices/machine/smpc.cpp b/src/devices/machine/smpc.cpp index 3825f2578a5..749f5bc8f8b 100644 --- a/src/devices/machine/smpc.cpp +++ b/src/devices/machine/smpc.cpp @@ -230,7 +230,7 @@ void saturn_state::smpc_system_reset() TIMER_CALLBACK_MEMBER( saturn_state::smpc_change_clock ) { - UINT32 xtal; + uint32_t xtal; if(LOG_SMPC) printf ("Clock change execute at (%d %d)\n",machine().first_screen()->hpos(),machine().first_screen()->vpos()); @@ -382,18 +382,18 @@ TIMER_CALLBACK_MEMBER( saturn_state::intback_peripheral ) if(LOG_PAD_CMD) printf("%d %d %d\n", m_smpc.intback_stage - 1, machine().first_screen()->vpos(), (int)machine().first_screen()->frame_number()); - UINT8 status1 = m_ctrl1 ? m_ctrl1->read_status() : 0xf0; - UINT8 status2 = m_ctrl2 ? m_ctrl2->read_status() : 0xf0; + uint8_t status1 = m_ctrl1 ? m_ctrl1->read_status() : 0xf0; + uint8_t status2 = m_ctrl2 ? m_ctrl2->read_status() : 0xf0; - UINT8 reg_offset = 0; - UINT8 ctrl1_offset = 0; // this is used when there is segatap or multitap connected - UINT8 ctrl2_offset = 0; // this is used when there is segatap or multitap connected + uint8_t reg_offset = 0; + uint8_t ctrl1_offset = 0; // this is used when there is segatap or multitap connected + uint8_t ctrl2_offset = 0; // this is used when there is segatap or multitap connected m_smpc.OREG[reg_offset++] = status1; // read ctrl1 for (int i = 0; i < (status1 & 0xf); i++) { - UINT8 id = m_ctrl1->read_id(i); + uint8_t id = m_ctrl1->read_id(i); m_smpc.OREG[reg_offset++] = id; for (int j = 0; j < (id & 0xf); j++) m_smpc.OREG[reg_offset++] = m_ctrl1->read_ctrl(j + ctrl1_offset); @@ -403,7 +403,7 @@ TIMER_CALLBACK_MEMBER( saturn_state::intback_peripheral ) // read ctrl2 for (int i = 0; i < (status2 & 0xf); i++) { - UINT8 id = m_ctrl2->read_id(i); + uint8_t id = m_ctrl2->read_id(i); m_smpc.OREG[reg_offset++] = id; for (int j = 0; j < (id & 0xf); j++) m_smpc.OREG[reg_offset++] = m_ctrl2->read_ctrl(j + ctrl2_offset); @@ -538,7 +538,7 @@ TIMER_CALLBACK_MEMBER( saturn_state::smpc_audio_reset_line_pulse ) * *******************************************/ -void saturn_state::smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_stv) +void saturn_state::smpc_comreg_exec(address_space &space, uint8_t data, uint8_t is_stv) { switch (data) { @@ -786,12 +786,12 @@ WRITE8_MEMBER( saturn_state::stv_SMPC_w ) * *******************************************/ -UINT8 saturn_state::smpc_th_control_mode(UINT8 pad_n) +uint8_t saturn_state::smpc_th_control_mode(uint8_t pad_n) { - UINT8 res = 0; + uint8_t res = 0; int th = (pad_n == 0) ? ((m_smpc.PDR1 >> 5) & 3) : ((m_smpc.PDR2 >> 5) & 3); - UINT16 ctrl_read = 0; + uint16_t ctrl_read = 0; if (m_ctrl1 && pad_n == 0) ctrl_read = m_ctrl1->read_direct(); if (m_ctrl2 && pad_n == 1) @@ -832,12 +832,12 @@ UINT8 saturn_state::smpc_th_control_mode(UINT8 pad_n) return res; } -UINT8 saturn_state::smpc_direct_mode(UINT8 pad_n) +uint8_t saturn_state::smpc_direct_mode(uint8_t pad_n) { int hshake = (pad_n == 0) ? ((m_smpc.PDR1 >> 5) & 3) : ((m_smpc.PDR2 >> 5) & 3); const int shift_bit[4] = { 4, 12, 8, 0 }; - UINT16 ctrl_read = 0; + uint16_t ctrl_read = 0; if (m_ctrl1 && pad_n == 0) ctrl_read = m_ctrl1->read_direct(); if (m_ctrl2 && pad_n == 1) @@ -850,7 +850,7 @@ UINT8 saturn_state::smpc_direct_mode(UINT8 pad_n) READ8_MEMBER( saturn_state::saturn_SMPC_r ) { - UINT8 return_data = 0; + uint8_t return_data = 0; if (!(offset & 1)) // avoid reading to even bytes (TODO: is it 0s or 1s?) return 0x00; @@ -871,7 +871,7 @@ READ8_MEMBER( saturn_state::saturn_SMPC_r ) { if ((m_smpc.IOSEL1 && offset == 0x75) || (m_smpc.IOSEL2 && offset == 0x77)) { - UINT8 cur_ddr; + uint8_t cur_ddr; if (((m_ctrl1 && m_ctrl1->read_id(0) != 0x02) || (m_ctrl2 && m_ctrl2->read_id(0) != 0x02)) && !(space.debugger_access())) { diff --git a/src/devices/machine/sonydriv.cpp b/src/devices/machine/sonydriv.cpp index 3c70a4664e7..8bede7912a0 100644 --- a/src/devices/machine/sonydriv.cpp +++ b/src/devices/machine/sonydriv.cpp @@ -76,7 +76,7 @@ struct floppy_t unsigned int loadedtrack_dirty : 1; /* has data in track buffer been modified? */ size_t loadedtrack_size; /* size of loaded track */ size_t loadedtrack_pos; /* position within loaded track */ - UINT8 *loadedtrack_data; /* pointer to track buffer */ + uint8_t *loadedtrack_data; /* pointer to track buffer */ int is_fdhd; /* is drive an FDHD? */ int is_400k; /* drive is single-sided, which means 400K */ @@ -106,7 +106,7 @@ static void load_track_data(device_t *device,int floppy_select) { int track_size; legacy_floppy_image_device *cur_image; - UINT8 *new_data; + uint8_t *new_data; floppy_t *f; f = &sony.floppy[floppy_select]; @@ -121,7 +121,7 @@ static void load_track_data(device_t *device,int floppy_select) track_size = floppy_get_track_size(fimg, f->head, cur_image->floppy_drive_get_current_track()); if (f->loadedtrack_data) auto_free(device->machine(),f->loadedtrack_data); - new_data = auto_alloc_array(device->machine(),UINT8,track_size); + new_data = auto_alloc_array(device->machine(),uint8_t,track_size); if (!new_data) { return; @@ -156,9 +156,9 @@ static void save_track_data(device_t *device, int floppy_select) -UINT8 sony_read_data(device_t *device) +uint8_t sony_read_data(device_t *device) { - UINT8 result = 0; + uint8_t result = 0; legacy_floppy_image_device *cur_image; floppy_t *f; @@ -184,7 +184,7 @@ UINT8 sony_read_data(device_t *device) -void sony_write_data(device_t *device,UINT8 data) +void sony_write_data(device_t *device,uint8_t data) { device_image_interface *cur_image; floppy_t *f; @@ -462,7 +462,7 @@ static void sony_doaction(device_t *device) } } -void sony_set_lines(device_t *device,UINT8 lines) +void sony_set_lines(device_t *device,uint8_t lines) { int old_sony_lines = sony.lines; @@ -531,7 +531,7 @@ const device_type FLOPPY_SONY = &device_creator; // sonydriv_floppy_image_device - constructor //------------------------------------------------- -sonydriv_floppy_image_device::sonydriv_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sonydriv_floppy_image_device::sonydriv_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : legacy_floppy_image_device(mconfig, FLOPPY_SONY, "Floppy Disk [Sony]", tag, owner, clock, "floppy_sonny", __FILE__) { } diff --git a/src/devices/machine/sonydriv.h b/src/devices/machine/sonydriv.h index 4a48ceb9f9d..b382efd47bf 100644 --- a/src/devices/machine/sonydriv.h +++ b/src/devices/machine/sonydriv.h @@ -24,21 +24,21 @@ enum }; #endif -void sony_set_lines(device_t *device,UINT8 lines); +void sony_set_lines(device_t *device,uint8_t lines); void sony_set_enable_lines(device_t *device,int enable_mask); void sony_set_sel_line(device_t *device,int sel); void sony_set_speed(int speed); -UINT8 sony_read_data(device_t *device); -void sony_write_data(device_t *device,UINT8 data); +uint8_t sony_read_data(device_t *device); +void sony_write_data(device_t *device,uint8_t data); int sony_read_status(device_t *device); class sonydriv_floppy_image_device : public legacy_floppy_image_device { public: // construction/destruction - sonydriv_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sonydriv_floppy_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void call_unload() override; protected: diff --git a/src/devices/machine/spchrom.cpp b/src/devices/machine/spchrom.cpp index 542be5b4ded..10e5ea2fc1e 100644 --- a/src/devices/machine/spchrom.cpp +++ b/src/devices/machine/spchrom.cpp @@ -25,7 +25,7 @@ // device type definition const device_type SPEECHROM = &device_creator; -speechrom_device::speechrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +speechrom_device::speechrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SPEECHROM, "SPEECHROM", tag, owner, clock, "speechrom", __FILE__), m_speechrom_data(nullptr), m_speechROMlen(0), m_speechROMaddr(0), m_load_pointer(0), diff --git a/src/devices/machine/spchrom.h b/src/devices/machine/spchrom.h index c72af249529..14c9824c267 100644 --- a/src/devices/machine/spchrom.h +++ b/src/devices/machine/spchrom.h @@ -14,7 +14,7 @@ class speechrom_device : public device_t { public: // construction/destruction - speechrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + speechrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); /// TODO: implement bus behaviour int read(int count); @@ -26,7 +26,7 @@ public: virtual void device_start() override; private: - UINT8 *m_speechrom_data; /* pointer to speech ROM data */ + uint8_t *m_speechrom_data; /* pointer to speech ROM data */ unsigned int m_speechROMlen; /* length of data pointed by speechrom_data, from 0 to 2^18 */ unsigned int m_speechROMaddr; /* 18 bit pointer in ROM */ int m_load_pointer; /* which 4-bit nibble will be affected by load address */ diff --git a/src/devices/machine/steppers.cpp b/src/devices/machine/steppers.cpp index 2f63c8529d3..8164e3706fd 100644 --- a/src/devices/machine/steppers.cpp +++ b/src/devices/machine/steppers.cpp @@ -43,7 +43,7 @@ const device_type STEPPER = &device_creator; -stepper_device::stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +stepper_device::stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, STEPPER, "Stepper Motor", tag, owner, clock, "stepper", __FILE__), m_optic_cb(*this) { @@ -121,7 +121,7 @@ void stepper_device::device_reset() /////////////////////////////////////////////////////////////////////////// -int stepper_device::update(UINT8 pattern) +int stepper_device::update(uint8_t pattern) { int changed = 0; diff --git a/src/devices/machine/steppers.h b/src/devices/machine/steppers.h index 4b180e75355..2f51c195507 100644 --- a/src/devices/machine/steppers.h +++ b/src/devices/machine/steppers.h @@ -101,11 +101,11 @@ extern const device_type STEPPER; class stepper_device : public device_t { public: - stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + stepper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_optic_handler(device_t &device, _Object object) { return downcast(device).m_optic_cb.set_callback(object); } - static void set_reel_type(device_t &device, UINT8 type) + static void set_reel_type(device_t &device, uint8_t type) { downcast(device).m_type = type; switch ( type ) @@ -131,11 +131,11 @@ public: break; } } - static void set_max_steps(device_t &device, INT16 steps) { downcast(device).m_max_steps = steps; } - static void set_start_index(device_t &device, INT16 index) { downcast(device).m_index_start = index; } - static void set_end_index(device_t &device, INT16 index) { downcast(device).m_index_end = index; } - static void set_index_pattern(device_t &device, INT16 index) { downcast(device).m_index_patt = index; } - static void set_init_phase(device_t &device, UINT8 phase) + static void set_max_steps(device_t &device, int16_t steps) { downcast(device).m_max_steps = steps; } + static void set_start_index(device_t &device, int16_t index) { downcast(device).m_index_start = index; } + static void set_end_index(device_t &device, int16_t index) { downcast(device).m_index_end = index; } + static void set_index_pattern(device_t &device, int16_t index) { downcast(device).m_index_patt = index; } + static void set_init_phase(device_t &device, uint8_t phase) { downcast(device).m_initphase = phase; downcast(device).m_phase = phase; @@ -143,7 +143,7 @@ public: } /* update a motor */ - int update(UINT8 pattern); + int update(uint8_t pattern); /* get current position in half steps */ int get_position() { return m_step_pos; } @@ -158,19 +158,19 @@ protected: virtual void device_reset() override; private: - UINT8 m_pattern; /* coil pattern */ - UINT8 m_old_pattern; /* old coil pattern */ - UINT8 m_initphase; - UINT8 m_phase; /* motor phase */ - UINT8 m_old_phase; /* old phase */ - UINT8 m_type; /* reel type */ - INT16 m_step_pos; /* step position 0 - max_steps */ - INT16 m_max_steps; /* maximum step position */ - INT32 m_abs_step_pos; /* absolute step position */ - INT16 m_index_start; /* start position of index (in half steps) */ - INT16 m_index_end; /* end position of index (in half steps) */ - INT16 m_index_patt; /* pattern needed on coils (0=don't care) */ - UINT8 m_optic; + uint8_t m_pattern; /* coil pattern */ + uint8_t m_old_pattern; /* old coil pattern */ + uint8_t m_initphase; + uint8_t m_phase; /* motor phase */ + uint8_t m_old_phase; /* old phase */ + uint8_t m_type; /* reel type */ + int16_t m_step_pos; /* step position 0 - max_steps */ + int16_t m_max_steps; /* maximum step position */ + int32_t m_abs_step_pos; /* absolute step position */ + int16_t m_index_start; /* start position of index (in half steps) */ + int16_t m_index_end; /* end position of index (in half steps) */ + int16_t m_index_patt; /* pattern needed on coils (0=don't care) */ + uint8_t m_optic; void update_optic(); devcb_write_line m_optic_cb; diff --git a/src/devices/machine/strata.cpp b/src/devices/machine/strata.cpp index 0bf396d83ef..4542acc9d9e 100644 --- a/src/devices/machine/strata.cpp +++ b/src/devices/machine/strata.cpp @@ -46,7 +46,7 @@ const device_type STRATAFLASH = &device_creator; -strataflash_device::strataflash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +strataflash_device::strataflash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, STRATAFLASH, "Intel 28F640J5", tag, owner, clock, "strataflash", __FILE__), device_nvram_interface(mconfig, *this) { @@ -74,7 +74,7 @@ void strataflash_device::nvram_read(emu_file &file) // TODO /* - UINT8 buf; + uint8_t buf; int i; // version flag @@ -93,7 +93,7 @@ void strataflash_device::nvram_read(emu_file &file) return 1; for (i = 0; i < FEEPROM_SIZE; i += 2) { - UINT16 *ptr = (UINT16 *) (&m_flashmemory[i]); + uint16_t *ptr = (uint16_t *) (&m_flashmemory[i]); *ptr = little_endianize_int16(*ptr); } @@ -102,7 +102,7 @@ void strataflash_device::nvram_read(emu_file &file) return 1; for (i = 0; i < PROT_REGS_SIZE; i += 2) { - UINT16 *ptr = (UINT16 *) (&m_prot_regs[i]); + uint16_t *ptr = (uint16_t *) (&m_prot_regs[i]); *ptr = little_endianize_int16(*ptr); } @@ -124,7 +124,7 @@ void strataflash_device::nvram_write(emu_file &file) // TODO /* - UINT8 buf; + uint8_t buf; int i; // version flag @@ -141,28 +141,28 @@ void strataflash_device::nvram_write(emu_file &file) // main FEEPROM area for (i = 0; i < FEEPROM_SIZE; i += 2) { - UINT16 *ptr = (UINT16 *) (&m_flashmemory[i]); + uint16_t *ptr = (uint16_t *) (&m_flashmemory[i]); *ptr = little_endianize_int16(*ptr); } if (file->write(m_flashmemory, FEEPROM_SIZE) != FEEPROM_SIZE) return 1; for (i = 0; i < FEEPROM_SIZE; i += 2) { - UINT16 *ptr = (UINT16 *) (&m_flashmemory[i]); + uint16_t *ptr = (uint16_t *) (&m_flashmemory[i]); *ptr = little_endianize_int16(*ptr); } // protection registers for (i = 0; i < PROT_REGS_SIZE; i += 2) { - UINT16 *ptr = (UINT16 *) (&m_prot_regs[i]); + uint16_t *ptr = (uint16_t *) (&m_prot_regs[i]); *ptr = little_endianize_int16(*ptr); } if (file->write(m_prot_regs, PROT_REGS_SIZE) != PROT_REGS_SIZE) return 1; for (i = 0; i < PROT_REGS_SIZE; i += 2) { - UINT16 *ptr = (UINT16 *) (&m_prot_regs[i]); + uint16_t *ptr = (uint16_t *) (&m_prot_regs[i]); *ptr = little_endianize_int16(*ptr); } @@ -184,7 +184,7 @@ void strataflash_device::device_start(void) m_mode = FM_NORMAL; m_status = 0x80; m_master_lock = 0; - m_flashmemory = std::make_unique(COMPLETE_SIZE); + m_flashmemory = std::make_unique(COMPLETE_SIZE); m_wrbuf = m_flashmemory.get() + FEEPROM_SIZE; m_prot_regs = m_wrbuf + WRBUF_SIZE; @@ -214,7 +214,7 @@ void strataflash_device::device_config_complete() /* read a 8/16-bit word from FEEPROM */ -UINT16 strataflash_device::read8_16(address_space& space, offs_t offset, bus_width_t bus_width) +uint16_t strataflash_device::read8_16(address_space& space, offs_t offset, bus_width_t bus_width) { switch (bus_width) { @@ -234,7 +234,7 @@ UINT16 strataflash_device::read8_16(address_space& space, offs_t offset, bus_wid case bw_8: return m_flashmemory[BYTE_XOR_LE(offset)]; case bw_16: - return *(UINT16*)(m_flashmemory.get()+offset); + return *(uint16_t*)(m_flashmemory.get()+offset); } break; case FM_READSTATUS: @@ -249,7 +249,7 @@ UINT16 strataflash_device::read8_16(address_space& space, offs_t offset, bus_wid case bw_8: return m_prot_regs[BYTE_XOR_LE(offset)]; case bw_16: - return *(UINT16*)(m_prot_regs+offset); + return *(uint16_t*)(m_prot_regs+offset); } } else @@ -404,7 +404,7 @@ UINT16 strataflash_device::read8_16(address_space& space, offs_t offset, bus_wid /* write a 8/16-bit word to FEEPROM */ -void strataflash_device::write8_16(address_space& space, offs_t offset, UINT16 data, bus_width_t bus_width) +void strataflash_device::write8_16(address_space& space, offs_t offset, uint16_t data, bus_width_t bus_width) { switch (bus_width) { @@ -562,7 +562,7 @@ void strataflash_device::write8_16(address_space& space, offs_t offset, UINT16 d m_flashmemory[BYTE_XOR_LE(offset)] &= data; break; case bw_16: - *(UINT16*)(m_flashmemory.get()+offset) &= data; + *(uint16_t*)(m_flashmemory.get()+offset) &= data; break; } } @@ -633,7 +633,7 @@ void strataflash_device::write8_16(address_space& space, offs_t offset, UINT16 d m_prot_regs[BYTE_XOR_LE(offset-0x100)] &= data; break; case bw_16: - *(UINT16*)(m_prot_regs+(offset-0x100)) &= data; + *(uint16_t*)(m_prot_regs+(offset-0x100)) &= data; break; } } diff --git a/src/devices/machine/strata.h b/src/devices/machine/strata.h index 5092d1e891e..76ba982e526 100644 --- a/src/devices/machine/strata.h +++ b/src/devices/machine/strata.h @@ -7,7 +7,7 @@ class strataflash_device : public device_t, public device_nvram_interface { public: - strataflash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + strataflash_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // 8-bit access DECLARE_READ8_MEMBER( read8 ); @@ -36,8 +36,8 @@ private: bw_16 }; - UINT16 read8_16(address_space& space, offs_t offset, bus_width_t bus_width); - void write8_16(address_space& space, offs_t offset, UINT16 data, bus_width_t bus_width); + uint16_t read8_16(address_space& space, offs_t offset, bus_width_t bus_width); + void write8_16(address_space& space, offs_t offset, uint16_t data, bus_width_t bus_width); enum fm_mode_t { @@ -63,10 +63,10 @@ private: offs_t m_wrbuf_base; // start address in write buffer command int m_wrbuf_len; // count converted into byte length in write buffer command int m_wrbuf_count; // current count in write buffer command - UINT8* m_wrbuf; // write buffer used by write buffer command - std::unique_ptr m_flashmemory; // main FEEPROM area - UINT8* m_blocklock; // block lock flags - UINT8* m_prot_regs; // protection registers + uint8_t* m_wrbuf; // write buffer used by write buffer command + std::unique_ptr m_flashmemory; // main FEEPROM area + uint8_t* m_blocklock; // block lock flags + uint8_t* m_prot_regs; // protection registers }; extern const device_type STRATAFLASH; diff --git a/src/devices/machine/stvcd.cpp b/src/devices/machine/stvcd.cpp index 84b9cd8fb51..7b6ac1f4bd5 100644 --- a/src/devices/machine/stvcd.cpp +++ b/src/devices/machine/stvcd.cpp @@ -79,10 +79,10 @@ int saturn_state::get_timing_command(void) } /* FIXME: assume Saturn CD-ROMs to have a 2 secs pre-gap for now. */ -int saturn_state::get_track_index(UINT32 fad) +int saturn_state::get_track_index(uint32_t fad) { - UINT32 rel_fad; - UINT8 track; + uint32_t rel_fad; + uint8_t track; if(cdrom_get_track_type(cdrom, cdrom_get_track(cdrom, fad)) != CD_TRACK_AUDIO) return 1; @@ -102,12 +102,12 @@ int saturn_state::sega_cdrom_get_adr_control(cdrom_file *file, int track) return BITSWAP8(cdrom_get_adr_control(file, cur_track),3,2,1,0,7,6,5,4); } -void saturn_state::cr_standard_return(UINT16 cur_status) +void saturn_state::cr_standard_return(uint16_t cur_status) { if ((cd_stat & 0x0f00) == CD_STAT_SEEK) { /* During seek state, values returned are from the target position */ - UINT8 seek_track = cdrom_get_track(cdrom, cd_fad_seek-150); + uint8_t seek_track = cdrom_get_track(cdrom, cd_fad_seek-150); cr1 = cur_status | (playtype << 7) | 0x00 | (cdda_repeat_count & 0xf); cr2 = (seek_track == 0xff) ? 0xffff : ((sega_cdrom_get_adr_control(cdrom, seek_track)<<8) | seek_track); @@ -129,7 +129,7 @@ void saturn_state::cr_standard_return(UINT16 cur_status) void saturn_state::cd_exec_command( void ) { - UINT32 temp; + uint32_t temp; if(cr1 != 0 && ((cr1 & 0xff00) != 0x5100) && @@ -301,7 +301,7 @@ void saturn_state::cd_exec_command( void ) case XFERTYPE32_GETDELETESECTOR: if (transpart->size > 0) { - INT32 i; + int32_t i; xfertype32 = XFERTYPE32_INVALID; @@ -342,8 +342,8 @@ void saturn_state::cd_exec_command( void ) break; case 0x10: // Play Disc. FAD is in lowest 7 bits of cr1 and all of cr2. - UINT32 start_pos,end_pos; - UINT8 play_mode; + uint32_t start_pos,end_pos; + uint8_t play_mode; CDROM_LOG(("%s:CD: Play Disc\n", machine().describe_context())) cd_stat = CD_STAT_PLAY; @@ -392,7 +392,7 @@ void saturn_state::cd_exec_command( void ) } else { - UINT8 end_track; + uint8_t end_track; end_track = (end_pos)>>8; fadstoplay = cdrom_get_track_start(cdrom, end_track) - cd_fad_seek; @@ -515,8 +515,8 @@ void saturn_state::cd_exec_command( void ) { case 0: // Get Q { - UINT32 msf_abs,msf_rel; - UINT8 track; + uint32_t msf_abs,msf_rel; + uint8_t track; cr1 = cd_stat | 0; cr2 = 10/2; cr3 = 0; @@ -584,7 +584,7 @@ void saturn_state::cd_exec_command( void ) case 0x30: // Set CD Device connection { - UINT8 parm; + uint8_t parm; // get operation parm = cr3>>8; @@ -630,7 +630,7 @@ void saturn_state::cd_exec_command( void ) // cr1 low + cr2 = FAD0, cr3 low + cr4 = FAD1 // cr3 hi = filter num. { - UINT8 fnum = (cr3>>8)&0xff; + uint8_t fnum = (cr3>>8)&0xff; CDROM_LOG(("%s:CD: Set Filter Range\n", machine().describe_context())) @@ -652,7 +652,7 @@ void saturn_state::cd_exec_command( void ) case 0x42: // Set Filter Subheader conditions { - UINT8 fnum = (cr3>>8)&0xff; + uint8_t fnum = (cr3>>8)&0xff; CDROM_LOG(("%s:CD: Set Filter Subheader conditions %x => chan %x masks %x fid %x vals %x\n", machine().describe_context(), fnum, cr1&0xff, cr2, cr3&0xff, cr4)) @@ -671,7 +671,7 @@ void saturn_state::cd_exec_command( void ) case 0x43: // Get Filter Subheader conditions { - UINT8 fnum = (cr3>>8)&0xff; + uint8_t fnum = (cr3>>8)&0xff; CDROM_LOG(("%s:CD: Set Filter Subheader conditions %x => chan %x masks %x fid %x vals %x\n", machine().describe_context(), fnum, cr1&0xff, cr2, cr3&0xff, cr4)) @@ -687,8 +687,8 @@ void saturn_state::cd_exec_command( void ) case 0x44: // Set Filter Mode { - UINT8 fnum = (cr3>>8)&0xff; - UINT8 mode = (cr1 & 0xff); + uint8_t fnum = (cr3>>8)&0xff; + uint8_t mode = (cr1 & 0xff); // initialize filter? if (mode & 0x80) @@ -709,7 +709,7 @@ void saturn_state::cd_exec_command( void ) case 0x45: // Get Filter Mode { - UINT8 fnum = (cr3>>8)&0xff; + uint8_t fnum = (cr3>>8)&0xff; cr1 = cd_stat | (filters[fnum].mode & 0xff); cr2 = 0; @@ -724,7 +724,7 @@ void saturn_state::cd_exec_command( void ) case 0x46: // Set Filter Connection { /* TODO: maybe condition false is cr3 low? */ - UINT8 fnum = (cr3>>8)&0xff; + uint8_t fnum = (cr3>>8)&0xff; CDROM_LOG(("%s:CD: Set Filter Connection %x => mode %x parm %04x\n", machine().describe_context(), fnum, cr1 & 0xf, cr2)) @@ -748,7 +748,7 @@ void saturn_state::cd_exec_command( void ) if((cr1 & 0xff) == 0x00) { - UINT8 bufnum = cr3>>8; + uint8_t bufnum = cr3>>8; if(bufnum < MAX_FILTERS) { @@ -842,7 +842,7 @@ void saturn_state::cd_exec_command( void ) case 0x51: // get # sectors used in a buffer { - UINT32 bufnum = cr3>>8; + uint32_t bufnum = cr3>>8; CDROM_LOG(("%s:CD: Get Sector Number (bufno %d) = %d blocks\n", machine().describe_context(), bufnum, cr4)) cr1 = cd_stat; @@ -873,16 +873,16 @@ void saturn_state::cd_exec_command( void ) case 0x52: // calculate actual size { - UINT32 bufnum = cr3>>8; - UINT32 sectoffs = cr2; - UINT32 numsect = cr4; + uint32_t bufnum = cr3>>8; + uint32_t sectoffs = cr2; + uint32_t numsect = cr4; CDROM_LOG(("%s:CD: Calculate actual size: buf %x offs %x numsect %x\n", machine().describe_context(), bufnum, sectoffs, numsect)) calcsize = 0; if (partitions[bufnum].size != -1) { - INT32 i; + int32_t i; for (i = 0; i < numsect; i++) { @@ -911,8 +911,8 @@ void saturn_state::cd_exec_command( void ) case 0x54: // get sector info { - UINT32 sectoffs = cr2 & 0xff; - UINT32 bufnum = cr3>>8; + uint32_t sectoffs = cr2 & 0xff; + uint32_t bufnum = cr3>>8; if (bufnum >= MAX_FILTERS || !partitions[bufnum].blocks[sectoffs]) { @@ -974,9 +974,9 @@ void saturn_state::cd_exec_command( void ) case 0x61: // get sector data { - UINT32 sectnum = cr4; - UINT32 sectofs = cr2; - UINT32 bufnum = cr3>>8; + uint32_t sectnum = cr4; + uint32_t sectofs = cr2; + uint32_t bufnum = cr3>>8; CDROM_LOG(("%s:CD: Get sector data (SN %d SO %d BN %d)\n", machine().describe_context(), sectnum, sectofs, bufnum)) @@ -1016,10 +1016,10 @@ void saturn_state::cd_exec_command( void ) case 0x62: // delete sector data { - UINT32 sectnum = cr4; - UINT32 sectofs = cr2; - UINT32 bufnum = cr3>>8; - INT32 i; + uint32_t sectnum = cr4; + uint32_t sectofs = cr2; + uint32_t bufnum = cr3>>8; + int32_t i; CDROM_LOG(("%s:CD: Delete sector data (SN %d SO %d BN %d)\n", machine().describe_context(), sectnum, sectofs, bufnum)) @@ -1069,9 +1069,9 @@ void saturn_state::cd_exec_command( void ) case 0x63: // get then delete sector data { - UINT32 sectnum = cr4; - UINT32 sectofs = cr2; - UINT32 bufnum = cr3>>8; + uint32_t sectnum = cr4; + uint32_t sectofs = cr2; + uint32_t bufnum = cr3>>8; CDROM_LOG(("%s:CD: Get and delete sector data (SN %d SO %d BN %d)\n", machine().describe_context(), sectnum, sectofs, bufnum)) @@ -1113,9 +1113,9 @@ void saturn_state::cd_exec_command( void ) case 0x64: // put sector data /* After Burner 2, Out Run, Fantasy Zone and Dungeon Master Nexus trips this */ { - UINT32 sectnum = cr4 & 0xff; - UINT32 sectofs = cr2; - UINT32 bufnum = cr3>>8; + uint32_t sectnum = cr4 & 0xff; + uint32_t sectofs = cr2; + uint32_t bufnum = cr3>>8; xfertype32 = XFERTYPE32_PUTSECTOR; @@ -1156,9 +1156,9 @@ void saturn_state::cd_exec_command( void ) case 0x66: // copy sector data /* TODO: Sword & Sorcery / Riglord Saga 2 */ { - UINT32 src_filter = (cr3>>8)&0xff; - UINT32 dst_filter = cr1&0xff; - UINT32 sectnum = cr4 & 0xff; + uint32_t src_filter = (cr3>>8)&0xff; + uint32_t dst_filter = cr1&0xff; + uint32_t sectnum = cr4 & 0xff; //cd_stat |= CD_STAT_TRANS; //transpart = &partitions[dst_filter]; @@ -1216,7 +1216,7 @@ void saturn_state::cd_exec_command( void ) case 0x71: // Read directory entry CDROM_LOG(("%s:CD: Read Directory Entry\n", machine().describe_context())) -// UINT32 read_dir; +// uint32_t read_dir; // read_dir = ((cr3&0xff)<<16)|cr4; @@ -1305,7 +1305,7 @@ void saturn_state::cd_exec_command( void ) case 0x74: // Read File CDROM_LOG(("%s:CD: Read File\n", machine().describe_context())) - UINT16 file_offset,file_filter,file_id,file_size; + uint16_t file_offset,file_filter,file_id,file_size; file_offset = ((cr1 & 0xff)<<8)|(cr2 & 0xff); /* correct? */ file_filter = cr3 >> 8; @@ -1421,7 +1421,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( saturn_state::stv_sector_cb ) // global functions void saturn_state::stvcd_reset( void ) { - INT32 i, j; + int32_t i, j; hirqmask = 0xffff; hirqreg = 0xffff; @@ -1507,9 +1507,9 @@ void saturn_state::stvcd_reset( void ) sh1_timer = machine().device("sh1_cmd"); } -saturn_state::blockT *saturn_state::cd_alloc_block(UINT8 *blknum) +saturn_state::blockT *saturn_state::cd_alloc_block(uint8_t *blknum) { - INT32 i; + int32_t i; // search the 200 available blocks for a free one for (i = 0; i < 200; i++) @@ -1538,9 +1538,9 @@ saturn_state::blockT *saturn_state::cd_alloc_block(UINT8 *blknum) void saturn_state::cd_free_block(blockT *blktofree) { - INT32 i; + int32_t i; - CDROM_LOG(("cd_free_block: %x\n", (UINT32)(uintptr_t)blktofree)) + CDROM_LOG(("cd_free_block: %x\n", (uint32_t)(uintptr_t)blktofree)) if(blktofree == nullptr) { @@ -1561,7 +1561,7 @@ void saturn_state::cd_free_block(blockT *blktofree) hirqreg &= ~BFUL; } -void saturn_state::cd_getsectoroffsetnum(UINT32 bufnum, UINT32 *sectoffs, UINT32 *sectnum) +void saturn_state::cd_getsectoroffsetnum(uint32_t bufnum, uint32_t *sectoffs, uint32_t *sectnum) { if (*sectoffs == 0xffff) { @@ -1576,9 +1576,9 @@ void saturn_state::cd_getsectoroffsetnum(UINT32 bufnum, UINT32 *sectoffs, UINT32 void saturn_state::cd_defragblocks(partitionT *part) { - UINT32 i, j; + uint32_t i, j; blockT *temp; - UINT8 temp2; + uint8_t temp2; for (i = 0; i < (MAX_BLOCKS-1); i++) { @@ -1598,9 +1598,9 @@ void saturn_state::cd_defragblocks(partitionT *part) } } -UINT16 saturn_state::cd_readWord(UINT32 addr) +uint16_t saturn_state::cd_readWord(uint32_t addr) { - UINT16 rv; + uint16_t rv; switch (addr & 0xffff) { @@ -1692,7 +1692,7 @@ UINT16 saturn_state::cd_readWord(UINT32 addr) case XFERTYPE_FILEINFO_254: // Lunar 2 if((xfercount % (6 * 2)) == 0) { - UINT32 temp = 2 + (xfercount / (0x6 * 2)); + uint32_t temp = 2 + (xfercount / (0x6 * 2)); // first 4 bytes = FAD finfbuf[0] = (curdir[temp].firstfad>>24)&0xff; @@ -1764,9 +1764,9 @@ UINT16 saturn_state::cd_readWord(UINT32 addr) } -UINT32 saturn_state::cd_readLong(UINT32 addr) +uint32_t saturn_state::cd_readLong(uint32_t addr) { - UINT32 rv = 0; + uint32_t rv = 0; switch (addr & 0xffff) { @@ -1800,7 +1800,7 @@ UINT32 saturn_state::cd_readLong(UINT32 addr) { if (xfertype32 == XFERTYPE32_GETDELETESECTOR) { - INT32 i; + int32_t i; CDROM_LOG(("Killing sectors in done\n")) @@ -1838,7 +1838,7 @@ UINT32 saturn_state::cd_readLong(UINT32 addr) } } -void saturn_state::cd_writeLong(UINT32 addr, UINT32 data) +void saturn_state::cd_writeLong(uint32_t addr, uint32_t data) { switch (addr & 0xffff) { @@ -1885,7 +1885,7 @@ void saturn_state::cd_writeLong(UINT32 addr, UINT32 data) } } -void saturn_state::cd_writeWord(UINT32 addr, UINT16 data) +void saturn_state::cd_writeWord(uint32_t addr, uint16_t data) { switch(addr & 0xffff) { @@ -1947,7 +1947,7 @@ void saturn_state::cd_writeWord(UINT32 addr, UINT16 data) READ32_MEMBER( saturn_state::stvcd_r ) { - UINT32 rv = 0; + uint32_t rv = 0; offset <<= 2; @@ -2057,11 +2057,11 @@ WRITE32_MEMBER( saturn_state::stvcd_w ) } // iso9660 parsing -void saturn_state::read_new_dir(UINT32 fileno) +void saturn_state::read_new_dir(uint32_t fileno) { int foundpd, i; - UINT32 cfad;//, dirfad; - UINT8 sect[2048]; + uint32_t cfad;//, dirfad; + uint8_t sect[2048]; if (fileno == 0xffffff) { @@ -2138,11 +2138,11 @@ void saturn_state::read_new_dir(UINT32 fileno) } // makes the directory pointed to by FAD current -void saturn_state::make_dir_current(UINT32 fad) +void saturn_state::make_dir_current(uint32_t fad) { int i; - UINT32 nextent, numentries; - std::vector sect(MAX_DIR_SIZE); + uint32_t nextent, numentries; + std::vector sect(MAX_DIR_SIZE); direntryT *curentry; memset(§[0], 0, MAX_DIR_SIZE); @@ -2343,7 +2343,7 @@ void saturn_state::cd_readTOC(void) tocbuf[tocptr+11] = fad&0xff; } -saturn_state::partitionT *saturn_state::cd_filterdata(filterT *flt, int trktype, UINT8 *p_ok) +saturn_state::partitionT *saturn_state::cd_filterdata(filterT *flt, int trktype, uint8_t *p_ok) { int match, keepgoing; partitionT *filterprt; @@ -2499,7 +2499,7 @@ saturn_state::partitionT *saturn_state::cd_filterdata(filterT *flt, int trktype, } // read a single sector off the CD, applying the current filter(s) as necessary -saturn_state::partitionT *saturn_state::cd_read_filtered_sector(INT32 fad, UINT8 *p_ok) +saturn_state::partitionT *saturn_state::cd_read_filtered_sector(int32_t fad, uint8_t *p_ok) { int trktype; @@ -2552,7 +2552,7 @@ void saturn_state::cd_playdata( void ) { if ((cd_stat & 0x0f00) == CD_STAT_SEEK) { - INT32 fad_diff; + int32_t fad_diff; //printf("PRE %08x %08x %08x %d\n",cd_curfad,cd_fad_seek,cd_stat,cd_fad_seek - cd_curfad); fad_diff = (cd_fad_seek - cd_curfad); @@ -2588,7 +2588,7 @@ void saturn_state::cd_playdata( void ) if (cdrom) { - UINT8 p_ok; + uint8_t p_ok; if(cdrom_get_track_type(cdrom, cdrom_get_track(cdrom, cd_curfad)) != CD_TRACK_AUDIO) { @@ -2639,7 +2639,7 @@ void saturn_state::cd_playdata( void ) } // loads a single sector off the CD, anywhere from FAD 150 on up -void saturn_state::cd_readblock(UINT32 fad, UINT8 *dat) +void saturn_state::cd_readblock(uint32_t fad, uint8_t *dat) { if (cdrom) { diff --git a/src/devices/machine/t10mmc.cpp b/src/devices/machine/t10mmc.cpp index b6f0fa68f34..bf16dc0d8d5 100644 --- a/src/devices/machine/t10mmc.cpp +++ b/src/devices/machine/t10mmc.cpp @@ -392,10 +392,10 @@ void t10mmc::ExecCommand() // // Read data from the device resulting from the execution of a command -void t10mmc::ReadData( UINT8 *data, int dataLength ) +void t10mmc::ReadData( uint8_t *data, int dataLength ) { - UINT32 temp; - UINT8 tmp_buffer[2048]; + uint32_t temp; + uint8_t tmp_buffer[2048]; switch ( command[0] ) { @@ -515,7 +515,7 @@ void t10mmc::ReadData( UINT8 *data, int dataLength ) data[6] = cdrom_get_track(m_cdrom, m_last_lba) + 1; // track data[7] = 0; // index - UINT32 frame = m_last_lba; + uint32_t frame = m_last_lba; if (msf) { @@ -603,7 +603,7 @@ void t10mmc::ReadData( UINT8 *data, int dataLength ) data[dptr++] = track; data[dptr++] = 0; - UINT32 tstart = cdrom_get_track_start(m_cdrom, cdrom_track); + uint32_t tstart = cdrom_get_track_start(m_cdrom, cdrom_track); if (msf) { @@ -633,7 +633,7 @@ void t10mmc::ReadData( UINT8 *data, int dataLength ) data[dptr++] = 1; data[dptr++] = 0; - UINT32 tstart = cdrom_get_track_start(m_cdrom, 0); + uint32_t tstart = cdrom_get_track_start(m_cdrom, 0); if (msf) { @@ -714,7 +714,7 @@ void t10mmc::ReadData( UINT8 *data, int dataLength ) // // Write data to the CD-ROM device as part of the execution of a command -void t10mmc::WriteData( UINT8 *data, int dataLength ) +void t10mmc::WriteData( uint8_t *data, int dataLength ) { switch (command[ 0 ]) { diff --git a/src/devices/machine/t10mmc.h b/src/devices/machine/t10mmc.h index 8b2f5a73cd7..b473a6f9c2b 100644 --- a/src/devices/machine/t10mmc.h +++ b/src/devices/machine/t10mmc.h @@ -24,8 +24,8 @@ public: virtual void SetDevice( void *device ) override; virtual void GetDevice( void **device ) override; 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 t10_start(device_t &device) override; @@ -57,11 +57,11 @@ protected: cdda_device *m_cdda; cdrom_file *m_cdrom; - UINT32 m_lba; - UINT32 m_blocks; - UINT32 m_last_lba; - UINT32 m_num_subblocks; - UINT32 m_cur_subblock; + uint32_t m_lba; + uint32_t m_blocks; + uint32_t m_last_lba; + uint32_t m_num_subblocks; + uint32_t m_cur_subblock; int m_audio_sense; device_t *m_device; diff --git a/src/devices/machine/t10sbc.cpp b/src/devices/machine/t10sbc.cpp index 623d73acf42..2ac7eb2fab3 100644 --- a/src/devices/machine/t10sbc.cpp +++ b/src/devices/machine/t10sbc.cpp @@ -138,7 +138,7 @@ void t10sbc::ExecCommand() } } -void t10sbc::ReadData( UINT8 *data, int dataLength ) +void t10sbc::ReadData( uint8_t *data, int dataLength ) { // if we're a drive without a disk, return all zeroes if (!m_disk) @@ -195,7 +195,7 @@ void t10sbc::ReadData( UINT8 *data, int dataLength ) case T10SBC_CMD_READ_CAPACITY: // READ CAPACITY { hard_disk_info *info; - UINT32 temp; + uint32_t temp; info = hard_disk_get_info(m_disk); @@ -222,7 +222,7 @@ void t10sbc::ReadData( UINT8 *data, int dataLength ) } } -void t10sbc::WriteData( UINT8 *data, int dataLength ) +void t10sbc::WriteData( uint8_t *data, int dataLength ) { if (!m_disk) { diff --git a/src/devices/machine/t10sbc.h b/src/devices/machine/t10sbc.h index 1ca570c89ca..4c3c45c0393 100644 --- a/src/devices/machine/t10sbc.h +++ b/src/devices/machine/t10sbc.h @@ -23,8 +23,8 @@ public: virtual void SetDevice( void *device ) override; virtual void GetDevice( void **device ) override; 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 t10_start(device_t &device) override; @@ -32,8 +32,8 @@ protected: harddisk_image_device *m_image; - UINT32 m_lba; - UINT32 m_blocks; + uint32_t m_lba; + uint32_t m_blocks; hard_disk_file *m_disk; device_t *m_device; diff --git a/src/devices/machine/t10spc.cpp b/src/devices/machine/t10spc.cpp index 906065e72ea..59547374f58 100644 --- a/src/devices/machine/t10spc.cpp +++ b/src/devices/machine/t10spc.cpp @@ -80,7 +80,7 @@ void t10spc::ExecCommand() } } -void t10spc::ReadData( UINT8 *data, int dataLength ) +void t10spc::ReadData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { @@ -123,7 +123,7 @@ void t10spc::ReadData( UINT8 *data, int dataLength ) } } -void t10spc::WriteData( UINT8 *data, int dataLength ) +void t10spc::WriteData( uint8_t *data, int dataLength ) { switch( command[ 0 ] ) { @@ -136,7 +136,7 @@ void t10spc::WriteData( UINT8 *data, int dataLength ) } } -void t10spc::SetCommand( UINT8 *_command, int _commandLength ) +void t10spc::SetCommand( uint8_t *_command, int _commandLength ) { if( _commandLength > sizeof( command ) ) { diff --git a/src/devices/machine/t10spc.h b/src/devices/machine/t10spc.h index abae1157bd2..025d0a5361e 100644 --- a/src/devices/machine/t10spc.h +++ b/src/devices/machine/t10spc.h @@ -22,10 +22,10 @@ public: virtual void SetDevice( void *device ) = 0; virtual void GetDevice( void **device ) = 0; - virtual void SetCommand( UINT8 *command, int commandLength ); + virtual void SetCommand( uint8_t *command, int commandLength ); virtual void ExecCommand(); - virtual void WriteData( UINT8 *data, int dataLength ); - virtual void ReadData( UINT8 *data, int dataLength ); + virtual void WriteData( uint8_t *data, int dataLength ); + virtual void ReadData( uint8_t *data, int dataLength ); void GetLength( int *transferLength ) { *transferLength = m_transfer_length; } virtual void GetPhase( int *phase ) { *phase = m_phase; } @@ -33,8 +33,8 @@ protected: virtual void t10_start(device_t &device); virtual void t10_reset(); - int SCSILengthFromUINT8( UINT8 *length ) { if( *length == 0 ) { return 256; } return *length; } - int SCSILengthFromUINT16( UINT8 *length ) { return ( *(length) << 8 ) | *(length + 1 ); } + int SCSILengthFromUINT8( uint8_t *length ) { if( *length == 0 ) { return 256; } return *length; } + int SCSILengthFromUINT16( uint8_t *length ) { return ( *(length) << 8 ) | *(length + 1 ); } enum sense_key_t { @@ -117,15 +117,15 @@ protected: void set_sense(sense_key_t key, sense_asc_ascq_t asc_ascq); - UINT8 command[ 32 ]; + uint8_t command[ 32 ]; int commandLength; int m_transfer_length; int m_phase; status_code_t m_status_code; - UINT8 m_sense_key; - UINT8 m_sense_asc; - UINT8 m_sense_ascq; - UINT32 m_sense_information; + uint8_t m_sense_key; + uint8_t m_sense_asc; + uint8_t m_sense_ascq; + uint32_t m_sense_information; int m_sector_bytes; device_t *m_device; }; diff --git a/src/devices/machine/tc009xlvc.cpp b/src/devices/machine/tc009xlvc.cpp index affda6fa455..c6ba0280728 100644 --- a/src/devices/machine/tc009xlvc.cpp +++ b/src/devices/machine/tc009xlvc.cpp @@ -27,8 +27,8 @@ WRITE8_MEMBER(tc0091lvc_device::tc0091lvc_paletteram_w) m_palette_ram[offset & 0x1ff] = data; { - UINT8 r,g,b,i; - UINT16 pal; + uint8_t r,g,b,i; + uint16_t pal; pal = (m_palette_ram[offset & ~1]<<0) | (m_palette_ram[offset | 1]<<8); @@ -164,7 +164,7 @@ static ADDRESS_MAP_START( tc0091lvc_map8, AS_0, 8, tc0091lvc_device ) AM_RANGE(0x080000, 0x0801ff) AM_READWRITE(tc0091lvc_paletteram_r,tc0091lvc_paletteram_w) ADDRESS_MAP_END -tc0091lvc_device::tc0091lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tc0091lvc_device::tc0091lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0091LVC, "Taito TC0091LVC", tag, owner, clock, "tc0091lvc", __FILE__) , device_memory_interface(mconfig, *this) , m_space_config("tc0091lvc", ENDIANNESS_LITTLE, 8,20, 0, nullptr, *ADDRESS_MAP_NAME(tc0091lvc_map8)) @@ -225,7 +225,7 @@ TILE_GET_INFO_MEMBER(tc0091lvc_device::get_bg1_tile_info) TILE_GET_INFO_MEMBER(tc0091lvc_device::get_tx_tile_info) { int attr = m_tvram[2 * tile_index + 1]; - UINT16 code = m_tvram[2 * tile_index] + uint16_t code = m_tvram[2 * tile_index] | ((attr & 0x07) << 8); SET_TILE_INFO_MEMBER(m_gfx_index, @@ -286,7 +286,7 @@ void tc0091lvc_device::device_start() //printf("m_gfx_index %d\n", m_gfx_index); palette_device &palette = m_gfxdecode->palette(); - m_gfxdecode->set_gfx(m_gfx_index, std::make_unique(palette, char_layout, (UINT8 *)m_pcg_ram, 0, palette.entries() / 16, 0)); + m_gfxdecode->set_gfx(m_gfx_index, std::make_unique(palette, char_layout, (uint8_t *)m_pcg_ram, 0, palette.entries() / 16, 0)); } void tc0091lvc_device::device_reset() @@ -299,7 +299,7 @@ const address_space_config *tc0091lvc_device::memory_space_config(address_spacen } -void tc0091lvc_device::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 global_flip ) +void tc0091lvc_device::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t global_flip ) { gfx_element *gfx = m_gfxdecode->gfx(1); int count; @@ -329,11 +329,11 @@ void tc0091lvc_device::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap } } -UINT32 tc0091lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tc0091lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT32 count; + uint32_t count; int x,y; - UINT8 global_flip; + uint8_t global_flip; bitmap.fill(m_gfxdecode->palette().black_pen(), cliprect); diff --git a/src/devices/machine/tc009xlvc.h b/src/devices/machine/tc009xlvc.h index 3f737cbf044..ec1c3e52e58 100644 --- a/src/devices/machine/tc009xlvc.h +++ b/src/devices/machine/tc009xlvc.h @@ -17,7 +17,7 @@ class tc0091lvc_device : public device_t, public device_memory_interface { public: - tc0091lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tc0091lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); @@ -46,14 +46,14 @@ public: TILE_GET_INFO_MEMBER(get_bg1_tile_info); TILE_GET_INFO_MEMBER(get_tx_tile_info); - UINT8 *m_pcg1_ram; - UINT8 *m_pcg2_ram; - UINT8 *m_vram0; - UINT8 *m_vram1; - UINT8 *m_sprram; - UINT8 *m_tvram; - UINT8 m_bg0_scroll[4]; - UINT8 m_bg1_scroll[4]; + uint8_t *m_pcg1_ram; + uint8_t *m_pcg2_ram; + uint8_t *m_vram0; + uint8_t *m_vram1; + uint8_t *m_sprram; + uint8_t *m_tvram; + uint8_t m_bg0_scroll[4]; + uint8_t m_bg1_scroll[4]; tilemap_t *bg0_tilemap; tilemap_t *bg1_tilemap; @@ -61,14 +61,14 @@ public: int m_gfx_index; // for RAM tiles - UINT8 m_palette_ram[0x200]; - UINT8 m_vregs[0x100]; - UINT8 m_bitmap_ram[0x20000]; - UINT8 m_pcg_ram[0x10000]; - UINT8 m_sprram_buffer[0x400]; + uint8_t m_palette_ram[0x200]; + uint8_t m_vregs[0x100]; + uint8_t m_bitmap_ram[0x20000]; + uint8_t m_pcg_ram[0x10000]; + uint8_t m_sprram_buffer[0x400]; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 global_flip); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t global_flip); void screen_eof(void); protected: diff --git a/src/devices/machine/terminal.cpp b/src/devices/machine/terminal.cpp index e4ffb2d3c3c..4f73b403adb 100644 --- a/src/devices/machine/terminal.cpp +++ b/src/devices/machine/terminal.cpp @@ -8,7 +8,7 @@ IMPLEMENTATION ***************************************************************************/ -static const UINT8 terminal_font[256*16] = +static const uint8_t terminal_font[256*16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -140,7 +140,7 @@ static const UINT8 terminal_font[256*16] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -generic_terminal_device::generic_terminal_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +generic_terminal_device::generic_terminal_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_palette(*this, "palette") , m_io_term_conf(*this, "TERM_CONF") @@ -153,7 +153,7 @@ generic_terminal_device::generic_terminal_device(const machine_config &mconfig, { } -generic_terminal_device::generic_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +generic_terminal_device::generic_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : generic_terminal_device(mconfig, GENERIC_TERMINAL, "Generic Terminal", tag, owner, clock, "generic_terminal", __FILE__) { } @@ -164,7 +164,7 @@ void generic_terminal_device::scroll_line() memset(m_buffer + TERMINAL_WIDTH*(TERMINAL_HEIGHT-1),0x20,TERMINAL_WIDTH); } -void generic_terminal_device::write_char(UINT8 data) +void generic_terminal_device::write_char(uint8_t data) { m_buffer[m_y_pos*TERMINAL_WIDTH+m_x_pos] = data; m_x_pos++; @@ -187,7 +187,7 @@ void generic_terminal_device::clear() m_y_pos = 0; } -void generic_terminal_device::term_write(UINT8 data) +void generic_terminal_device::term_write(uint8_t data) { if (data > 0x1f) { @@ -196,7 +196,7 @@ void generic_terminal_device::term_write(UINT8 data) } else { - const UINT16 options = m_io_term_conf->read(); + const uint16_t options = m_io_term_conf->read(); switch(data) { case 0x07: // bell @@ -209,7 +209,7 @@ void generic_terminal_device::term_write(UINT8 data) break; case 0x09: // horizontal tab - m_x_pos = (std::min)((m_x_pos & 0xf8) + 8, TERMINAL_WIDTH - 1); + m_x_pos = (std::min)((m_x_pos & 0xf8) + 8, TERMINAL_WIDTH - 1); break; case 0x0d: // carriage return @@ -245,12 +245,12 @@ void generic_terminal_device::term_write(UINT8 data) /*************************************************************************** VIDEO HARDWARE ***************************************************************************/ -UINT32 generic_terminal_device::update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t generic_terminal_device::update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - const UINT16 options = m_io_term_conf->read(); - UINT16 cursor = m_y_pos * TERMINAL_WIDTH + m_x_pos; - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + const uint16_t options = m_io_term_conf->read(); + uint16_t cursor = m_y_pos * TERMINAL_WIDTH + m_x_pos; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; switch (options & 0x030) { @@ -272,7 +272,7 @@ UINT32 generic_terminal_device::update(screen_device &device, bitmap_rgb32 &bitm { for (ra = 0; ra < 10; ra++) { - UINT32 *p = &bitmap.pix32(sy++); + uint32_t *p = &bitmap.pix32(sy++); for (x = ma; x < ma + TERMINAL_WIDTH; x++) { diff --git a/src/devices/machine/terminal.h b/src/devices/machine/terminal.h index 5b8112c9823..47988d64138 100644 --- a/src/devices/machine/terminal.h +++ b/src/devices/machine/terminal.h @@ -27,14 +27,14 @@ INPUT_PORTS_EXTERN( generic_terminal ); class generic_terminal_device : public device_t { public: - generic_terminal_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - generic_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + generic_terminal_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); + generic_terminal_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); } DECLARE_WRITE8_MEMBER(write) { term_write(data); } DECLARE_WRITE8_MEMBER(kbd_put); - UINT32 update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual ioport_constructor device_input_ports() const override; virtual machine_config_constructor device_mconfig_additions() const override; @@ -42,25 +42,25 @@ public: protected: enum { BELL_TIMER_ID = 20'000 }; - virtual void term_write(UINT8 data); + virtual void term_write(uint8_t data); 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(UINT8 code) { m_keyboard_cb((offs_t)0, code); } + virtual void send_key(uint8_t code) { m_keyboard_cb((offs_t)0, code); } optional_device m_palette; required_ioport m_io_term_conf; - UINT8 m_buffer[TERMINAL_WIDTH * 50]; // make big enough for teleprinter - UINT8 m_x_pos; + uint8_t m_buffer[TERMINAL_WIDTH * 50]; // make big enough for teleprinter + uint8_t m_x_pos; private: void scroll_line(); - void write_char(UINT8 data); + void write_char(uint8_t data); void clear(); - UINT8 m_framecnt; - UINT8 m_y_pos; + uint8_t m_framecnt; + uint8_t m_y_pos; emu_timer *m_bell_timer; required_device m_beeper; diff --git a/src/devices/machine/timehelp.h b/src/devices/machine/timehelp.h index 38adfdee502..fa779031344 100644 --- a/src/devices/machine/timehelp.h +++ b/src/devices/machine/timehelp.h @@ -16,17 +16,17 @@ class time_helper { public: - static inline UINT8 make_bcd(UINT8 data) + static inline uint8_t make_bcd(uint8_t data) { return (((data / 10) % 10) << 4) + (data % 10); } - static inline UINT8 from_bcd(UINT8 data) + static inline uint8_t from_bcd(uint8_t data) { return (((data >> 4) & 15) * 10) + (data & 15); } - static int inc_bcd(UINT8 *data, int mask, int min, int max) + static int inc_bcd(uint8_t *data, int mask, int min, int max) { int bcd = (*data + 1) & mask; int carry = 0; diff --git a/src/devices/machine/timekpr.cpp b/src/devices/machine/timekpr.cpp index e11cd089b1c..3cbef2330d4 100644 --- a/src/devices/machine/timekpr.cpp +++ b/src/devices/machine/timekpr.cpp @@ -63,7 +63,7 @@ const device_type MK48T12 = &device_creator; INLINE FUNCTIONS ***************************************************************************/ -static void counter_to_ram( UINT8 *data, int offset, int counter ) +static void counter_to_ram( uint8_t *data, int offset, int counter ) { if( offset >= 0 ) { @@ -71,7 +71,7 @@ static void counter_to_ram( UINT8 *data, int offset, int counter ) } } -static int counter_from_ram( UINT8 *data, int offset ) +static int counter_from_ram( uint8_t *data, int offset ) { if( offset >= 0 ) { @@ -88,7 +88,7 @@ static int counter_from_ram( UINT8 *data, int offset ) // timekeeper_device_config - constructor //------------------------------------------------- -timekeeper_device::timekeeper_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, int size) +timekeeper_device::timekeeper_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, int size) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) , device_nvram_interface(mconfig, *this) , m_default_data(*this, DEVICE_SELF, size) @@ -96,7 +96,7 @@ timekeeper_device::timekeeper_device(const machine_config &mconfig, device_type { } -m48t02_device::m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m48t02_device::m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : timekeeper_device(mconfig, M48T02, "M48T02 Timekeeper", tag, owner, clock, "m48t02", __FILE__, 0x800) { m_offset_control = 0x7f8; @@ -111,7 +111,7 @@ m48t02_device::m48t02_device(const machine_config &mconfig, const char *tag, dev m_offset_flags = -1; } -m48t35_device::m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m48t35_device::m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : timekeeper_device(mconfig, M48T35, "M48T35 Timekeeper", tag, owner, clock, "m48t35", __FILE__, 0x8000) { m_offset_control = 0x7ff8; @@ -126,7 +126,7 @@ m48t35_device::m48t35_device(const machine_config &mconfig, const char *tag, dev m_offset_flags = -1; } -m48t37_device::m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m48t37_device::m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : timekeeper_device(mconfig, M48T37, "M48T37 Timekeeper", tag, owner, clock, "m48t37", __FILE__, 0x8000) { m_offset_control = 0x7ff8; @@ -141,7 +141,7 @@ m48t37_device::m48t37_device(const machine_config &mconfig, const char *tag, dev m_offset_flags = 0x7ff0; } -m48t58_device::m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m48t58_device::m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : timekeeper_device(mconfig, M48T58, "M48T58 Timekeeper", tag, owner, clock, "m48t58", __FILE__, 0x2000) { m_offset_control = 0x1ff8; @@ -156,7 +156,7 @@ m48t58_device::m48t58_device(const machine_config &mconfig, const char *tag, dev m_offset_flags = -1; } -mk48t08_device::mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mk48t08_device::mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : timekeeper_device(mconfig, MK48T08, "MK48T08 Timekeeper", tag, owner, clock, "m48t08", __FILE__, 0x2000) { m_offset_control = 0x1ff8; @@ -171,7 +171,7 @@ mk48t08_device::mk48t08_device(const machine_config &mconfig, const char *tag, d m_offset_flags = 0x1ff0; } -mk48t12_device::mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mk48t12_device::mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : timekeeper_device(mconfig, MK48T12, "MK48T12 Timekeeper", tag, owner, clock, "m48t12", __FILE__, 0x2000) { m_offset_control = 0x7f8; @@ -277,13 +277,13 @@ void timekeeper_device::device_timer(emu_timer &timer, device_timer_id id, int p if( carry ) { - UINT8 maxdays; - static const UINT8 daysinmonth[] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; + uint8_t maxdays; + static const uint8_t daysinmonth[] = { 0x31, 0x28, 0x31, 0x30, 0x31, 0x30, 0x31, 0x31, 0x30, 0x31, 0x30, 0x31 }; time_helper::inc_bcd( &m_day, MASK_DAY, 0x01, 0x07 ); - UINT8 month = time_helper::from_bcd( m_month ); - UINT8 year = time_helper::from_bcd( m_year ); + uint8_t month = time_helper::from_bcd( m_month ); + uint8_t year = time_helper::from_bcd( m_year ); if( month == 2 && ( year % 4 ) == 0 ) { @@ -353,7 +353,7 @@ WRITE8_MEMBER( timekeeper_device::write ) READ8_MEMBER( timekeeper_device::read ) { - UINT8 result = m_data[ offset ]; + uint8_t result = m_data[ offset ]; if( offset == m_offset_date && type() == M48T58 ) { result &= ~DATE_BL; diff --git a/src/devices/machine/timekpr.h b/src/devices/machine/timekpr.h index e0e9aa6e60d..a9ecd6ae6b5 100644 --- a/src/devices/machine/timekpr.h +++ b/src/devices/machine/timekpr.h @@ -59,7 +59,7 @@ class timekeeper_device : public device_t, { protected: // construction/destruction - timekeeper_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, int size); + timekeeper_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, int size); public: DECLARE_WRITE8_MEMBER( write ); @@ -81,18 +81,18 @@ private: void counters_from_ram(); // internal state - UINT8 m_control; - UINT8 m_seconds; - UINT8 m_minutes; - UINT8 m_hours; - UINT8 m_day; - UINT8 m_date; - UINT8 m_month; - UINT8 m_year; - UINT8 m_century; - - std::vector m_data; - optional_region_ptr m_default_data; + uint8_t m_control; + uint8_t m_seconds; + uint8_t m_minutes; + uint8_t m_hours; + uint8_t m_day; + uint8_t m_date; + uint8_t m_month; + uint8_t m_year; + uint8_t m_century; + + std::vector m_data; + optional_region_ptr m_default_data; protected: int m_size; @@ -111,37 +111,37 @@ protected: class m48t02_device : public timekeeper_device { public: - m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class m48t35_device : public timekeeper_device { public: - m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class m48t37_device : public timekeeper_device { public: - m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class m48t58_device : public timekeeper_device { public: - m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mk48t08_device : public timekeeper_device { public: - mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mk48t12_device : public timekeeper_device { public: - mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mk48t12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // device type definition diff --git a/src/devices/machine/tmc0430.cpp b/src/devices/machine/tmc0430.cpp index dc1d8adc27e..d2547467abe 100644 --- a/src/devices/machine/tmc0430.cpp +++ b/src/devices/machine/tmc0430.cpp @@ -103,7 +103,7 @@ /* Constructor. */ -tmc0430_device::tmc0430_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmc0430_device::tmc0430_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMC0430, "TMC0430 device (GROM)", tag, owner, clock, "grom", __FILE__), m_gromready(*this), m_current_clock_level(CLEAR_LINE), @@ -202,7 +202,7 @@ WRITE8_MEMBER( tmc0430_device::set_lines ) WRITE_LINE_MEMBER( tmc0430_device::gclock_in ) { int bank = 0; - UINT16 baddr = 0; + uint16_t baddr = 0; // Wait for rising edge line_state oldlevel = (line_state)m_current_clock_level; @@ -277,7 +277,7 @@ READ8Z_MEMBER( tmc0430_device::readz ) { // Address reading is destructive *value = (m_address & 0xff00)>>8; - UINT8 lsb = (m_address & 0x00ff); + uint8_t lsb = (m_address & 0x00ff); m_address = (lsb << 8) | lsb; // see [1], section 2.5.3 if (TRACE_DETAIL) logerror("GROM %d return address %02x\n", m_ident>>13, *value); } diff --git a/src/devices/machine/tmc0430.h b/src/devices/machine/tmc0430.h index 9517f7ab40f..a8efe012bdc 100644 --- a/src/devices/machine/tmc0430.h +++ b/src/devices/machine/tmc0430.h @@ -16,8 +16,8 @@ extern const device_type TMC0430; #ifndef READ8Z_MEMBER -#define DECLARE_READ8Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 *value, ATTR_UNUSED UINT8 mem_mask = 0xff) -#define READ8Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 *value, ATTR_UNUSED UINT8 mem_mask) +#define DECLARE_READ8Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t *value, ATTR_UNUSED uint8_t mem_mask = 0xff) +#define READ8Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t *value, ATTR_UNUSED uint8_t mem_mask) #endif enum @@ -29,7 +29,7 @@ enum class tmc0430_device : public device_t { public: - tmc0430_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmc0430_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_ready_wr_callback(device_t &device, _Object object) { return downcast(device).m_gromready.set_callback(object); } @@ -97,13 +97,13 @@ private: // The address pointer is always expected to be in the range 0x0000 - 0xffff, even // when this GROM is not addressed. - UINT16 m_address; + uint16_t m_address; /* GROM data buffer. */ - UINT8 m_buffer; + uint8_t m_buffer; /* Pointer to the memory region contained in this GROM. */ - UINT8 *m_memptr; + uint8_t *m_memptr; }; #define MCFG_GROM_ADD(_tag, _ident, _region, _offset, _ready) \ diff --git a/src/devices/machine/tmp68301.cpp b/src/devices/machine/tmp68301.cpp index c2526699070..bd5326a08e6 100644 --- a/src/devices/machine/tmp68301.cpp +++ b/src/devices/machine/tmp68301.cpp @@ -92,14 +92,14 @@ READ16_MEMBER(tmp68301_device::pdr_r) WRITE16_MEMBER(tmp68301_device::pdr_w) { - UINT16 old = m_pdr; + uint16_t old = m_pdr; COMBINE_DATA(&m_pdr); m_pdr = (old & ~m_pdir) | (m_pdr & m_pdir); m_out_parallel_cb(0, m_pdr, mem_mask); } -tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMP68301, "TMP68301", tag, owner, clock, "tmp68301", __FILE__), device_memory_interface(mconfig, *this), m_in_parallel_cb(*this), @@ -172,7 +172,7 @@ const address_space_config *tmp68301_device::memory_space_config(address_spacenu // read_byte - read a byte at the given address //------------------------------------------------- -inline UINT16 tmp68301_device::read_word(offs_t address) +inline uint16_t tmp68301_device::read_word(offs_t address) { return space(AS_0).read_word(address << 1); } @@ -181,7 +181,7 @@ inline UINT16 tmp68301_device::read_word(offs_t address) // write_byte - write a byte at the given address //------------------------------------------------- -inline void tmp68301_device::write_word(offs_t address, UINT16 data) +inline void tmp68301_device::write_word(offs_t address, uint16_t data) { space(AS_0).write_word(address << 1, data); } @@ -196,9 +196,9 @@ IRQ_CALLBACK_MEMBER(tmp68301_device::irq_callback) TIMER_CALLBACK_MEMBER( tmp68301_device::timer_callback ) { int i = param; - UINT16 TCR = m_regs[(0x200 + i * 0x20)/2]; - UINT16 ICR = m_regs[0x8e/2+i]; // Interrupt Controller Register (ICR7..9) - UINT16 IVNR = m_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR) + uint16_t TCR = m_regs[(0x200 + i * 0x20)/2]; + uint16_t ICR = m_regs[0x8e/2+i]; // Interrupt Controller Register (ICR7..9) + uint16_t IVNR = m_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR) // logerror("s: callback timer %04X, j = %d\n",machine.describe_context(),i,tcount); @@ -228,9 +228,9 @@ TIMER_CALLBACK_MEMBER( tmp68301_device::timer_callback ) void tmp68301_device::update_timer( int i ) { - UINT16 TCR = m_regs[(0x200 + i * 0x20)/2]; - UINT16 MAX1 = m_regs[(0x204 + i * 0x20)/2]; - UINT16 MAX2 = m_regs[(0x206 + i * 0x20)/2]; + uint16_t TCR = m_regs[(0x200 + i * 0x20)/2]; + uint16_t MAX1 = m_regs[(0x204 + i * 0x20)/2]; + uint16_t MAX2 = m_regs[(0x206 + i * 0x20)/2]; int max = 0; attotime duration = attotime::zero; @@ -278,7 +278,7 @@ void tmp68301_device::update_irq_state() /* Take care of external interrupts */ - UINT16 IVNR = m_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR) + uint16_t IVNR = m_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR) for (i = 0; i < 3; i++) { @@ -286,7 +286,7 @@ void tmp68301_device::update_irq_state() !(m_imr & (1< static devcb_base &set_in_parallel_callback(device_t &device, _Object object) { return downcast(device).m_in_parallel_cb.set_callback(object); } @@ -63,25 +63,25 @@ private: devcb_write16 m_out_parallel_cb; // internal state - UINT16 m_regs[0x400]; + uint16_t m_regs[0x400]; - UINT8 m_IE[3]; // 3 External Interrupt Lines + uint8_t m_IE[3]; // 3 External Interrupt Lines emu_timer *m_tmp68301_timer[3]; // 3 Timers - UINT16 m_irq_vector[8]; + uint16_t m_irq_vector[8]; TIMER_CALLBACK_MEMBER( timer_callback ); void update_timer( int i ); void update_irq_state(); - UINT16 m_imr; - UINT16 m_iisr; - UINT16 m_scr; - UINT16 m_pdir; - UINT16 m_pdr; + uint16_t m_imr; + uint16_t m_iisr; + uint16_t m_scr; + uint16_t m_pdir; + uint16_t m_pdr; - 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); const address_space_config m_space_config; }; diff --git a/src/devices/machine/tms1024.cpp b/src/devices/machine/tms1024.cpp index 6e7d5c206e7..d9a268a1280 100644 --- a/src/devices/machine/tms1024.cpp +++ b/src/devices/machine/tms1024.cpp @@ -24,19 +24,19 @@ const device_type TMS1025 = &device_creator; // constructor //------------------------------------------------- -tms1024_device::tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1024_device::tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS1024, "TMS1024 I/O Expander", tag, owner, clock, "tms1024", __FILE__), m_h(0), m_s(0), m_std(0), m_write_port1(*this), m_write_port2(*this), m_write_port3(*this), m_write_port4(*this), m_write_port5(*this), m_write_port6(*this), m_write_port7(*this) { } -tms1024_device::tms1024_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) +tms1024_device::tms1024_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_h(0), m_s(0), m_std(0), m_write_port1(*this), m_write_port2(*this), m_write_port3(*this), m_write_port4(*this), m_write_port5(*this), m_write_port6(*this), m_write_port7(*this) { } -tms1025_device::tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms1025_device::tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms1024_device(mconfig, TMS1025, "TMS1025 I/O Expander", tag, owner, clock, "tms1025", __FILE__) { } diff --git a/src/devices/machine/tms1024.h b/src/devices/machine/tms1024.h index e351f87d2fb..323b083e841 100644 --- a/src/devices/machine/tms1024.h +++ b/src/devices/machine/tms1024.h @@ -64,8 +64,8 @@ enum class tms1024_device : public device_t { public: - tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms1024_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); + tms1024_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms1024_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_write_port1_callback(device_t &device, _Object object) { return downcast(device).m_write_port1.set_callback(object); } @@ -85,9 +85,9 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT8 m_h; // 4-bit data latch - UINT8 m_s; // 3-bit port select - UINT8 m_std; // strobe pin + uint8_t m_h; // 4-bit data latch + uint8_t m_s; // 3-bit port select + uint8_t m_std; // strobe pin // callbacks devcb_write8 m_write_port1, m_write_port2, m_write_port3, m_write_port4, m_write_port5, m_write_port6, m_write_port7; @@ -98,7 +98,7 @@ protected: class tms1025_device : public tms1024_device { public: - tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms1025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/machine/tms5501.cpp b/src/devices/machine/tms5501.cpp index 71f3f298cde..404f3eaacd5 100644 --- a/src/devices/machine/tms5501.cpp +++ b/src/devices/machine/tms5501.cpp @@ -17,7 +17,7 @@ #define LOG 0 -const UINT8 tms5501_device::rst_vector[] = { 0xc7, 0xcf, 0xd7, 0xdf, 0xe7, 0xef, 0xf7, 0xff }; +const uint8_t tms5501_device::rst_vector[] = { 0xc7, 0xcf, 0xd7, 0xdf, 0xe7, 0xef, 0xf7, 0xff }; @@ -53,7 +53,7 @@ ADDRESS_MAP_END // tms5501_device - constructor //------------------------------------------------- -tms5501_device::tms5501_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +tms5501_device::tms5501_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS5501, "TMS5501", tag, owner, clock, "tms5501", __FILE__), device_serial_interface(mconfig, *this), m_write_irq(*this), @@ -234,7 +234,7 @@ READ8_MEMBER( tms5501_device::rb_r ) READ8_MEMBER( tms5501_device::xi_r ) { - UINT8 data = m_read_xi(0); + uint8_t data = m_read_xi(0); if (m_cmd & CMD_XI7) { @@ -261,7 +261,7 @@ READ8_MEMBER( tms5501_device::rst_r ) READ8_MEMBER( tms5501_device::sta_r ) { - UINT8 data = m_sta; + uint8_t data = m_sta; m_sta &= ~STA_OE; @@ -463,7 +463,7 @@ WRITE_LINE_MEMBER( tms5501_device::sens_w ) // set_interrupt - //------------------------------------------------- -void tms5501_device::set_interrupt(UINT8 mask) +void tms5501_device::set_interrupt(uint8_t mask) { m_irq |= mask; @@ -507,9 +507,9 @@ void tms5501_device::check_interrupt() // get_vector - //------------------------------------------------- -UINT8 tms5501_device::get_vector() +uint8_t tms5501_device::get_vector() { - UINT8 rst = 0; + uint8_t rst = 0; for (int i = 0; i < 8; i++) { diff --git a/src/devices/machine/tms5501.h b/src/devices/machine/tms5501.h index b618266212c..e015bc3a23b 100644 --- a/src/devices/machine/tms5501.h +++ b/src/devices/machine/tms5501.h @@ -67,7 +67,7 @@ class tms5501_device : public device_t, { public: // construction/destruction - tms5501_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms5501_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); } template static devcb_base &set_xmt_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_xmt.set_callback(object); } @@ -81,7 +81,7 @@ public: DECLARE_WRITE_LINE_MEMBER( sens_w ); DECLARE_WRITE_LINE_MEMBER( xi7_w ); - UINT8 get_vector(); + uint8_t get_vector(); protected: // device-level overrides @@ -162,9 +162,9 @@ private: RR_STOP = 0x80 }; - static const UINT8 rst_vector[]; + static const uint8_t rst_vector[]; - void set_interrupt(UINT8 mask); + void set_interrupt(uint8_t mask); void check_interrupt(); devcb_write_line m_write_irq; @@ -172,13 +172,13 @@ private: devcb_read8 m_read_xi; devcb_write8 m_write_xo; - UINT8 m_irq; - UINT8 m_rb; - UINT8 m_sta; - UINT8 m_cmd; - UINT8 m_rr; - UINT8 m_tb; - UINT8 m_mr; + uint8_t m_irq; + uint8_t m_rb; + uint8_t m_sta; + uint8_t m_cmd; + uint8_t m_rr; + uint8_t m_tb; + uint8_t m_mr; int m_sens; int m_xi7; diff --git a/src/devices/machine/tms6100.cpp b/src/devices/machine/tms6100.cpp index 7242ca1312d..fd28ffeae2d 100644 --- a/src/devices/machine/tms6100.cpp +++ b/src/devices/machine/tms6100.cpp @@ -27,7 +27,7 @@ const device_type TMS6100 = &device_creator; -tms6100_device::tms6100_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) +tms6100_device::tms6100_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_rom(*this, DEVICE_SELF), m_reverse_bits(false), @@ -35,7 +35,7 @@ tms6100_device::tms6100_device(const machine_config &mconfig, device_type type, { } -tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock, "tms6100", __FILE__), m_rom(*this, DEVICE_SELF), m_reverse_bits(false), @@ -45,7 +45,7 @@ tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, d const device_type M58819 = &device_creator; -m58819_device::m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m58819_device::m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms6100_device(mconfig, M58819, "M58819S", tag, owner, clock, "m58819s", __FILE__) { } @@ -144,7 +144,7 @@ WRITE_LINE_MEMBER(tms6100_device::clk_w) if (m_cs) { // new command enabled on rising edge of m0/m1 - UINT8 m = m_m1 << 1 | m_m0; + uint8_t m = m_m1 << 1 | m_m0; if ((m & ~m_prev_m & 1) || (m & ~m_prev_m & 2)) handle_command(m); @@ -158,7 +158,7 @@ WRITE_LINE_MEMBER(tms6100_device::clk_w) // m0/m1 commands -void tms6100_device::handle_command(UINT8 cmd) +void tms6100_device::handle_command(uint8_t cmd) { enum { @@ -229,7 +229,7 @@ void tms6100_device::handle_command(UINT8 cmd) // the 8-step counter PLA is shared between LA and TB if (m_count < 4) { - const UINT8 shift = 4 * (m_count+1); + const uint8_t shift = 4 * (m_count+1); m_address = (m_address & ~(0xf << shift)) | (m_add << shift); } @@ -245,7 +245,7 @@ void tms6100_device::handle_command(UINT8 cmd) m_count = 0; // load new address bits (14 bits on TMS6100) - UINT16 rb = m_rom[m_address & m_rommask]; + uint16_t rb = m_rom[m_address & m_rommask]; m_address++; rb |= (m_rom[m_address & m_rommask] << 8); m_address = (m_address & ~0x3fff) | (rb & 0x3fff); diff --git a/src/devices/machine/tms6100.h b/src/devices/machine/tms6100.h index ae295dec4b2..0749424b0d7 100644 --- a/src/devices/machine/tms6100.h +++ b/src/devices/machine/tms6100.h @@ -94,8 +94,8 @@ class tms6100_device : public device_t { public: - tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms6100_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); + tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms6100_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 enable_4bit_mode(device_t &device) { downcast(device).m_4bit_mode = true; } @@ -113,22 +113,22 @@ protected: // device-level overrides virtual void device_start() override; - void handle_command(UINT8 cmd); + void handle_command(uint8_t cmd); // internal state - required_region_ptr m_rom; + required_region_ptr m_rom; bool m_reverse_bits; bool m_4bit_mode; - UINT32 m_rommask; - UINT32 m_address; // internal address + chipselect - UINT8 m_sa; // romdata shift register - UINT8 m_count; // TB/LA counter (-> PLA) - UINT8 m_prev_cmd; // previous handled command - UINT8 m_prev_m; // previous valid m0/m1 state + uint32_t m_rommask; + uint32_t m_address; // internal address + chipselect + uint8_t m_sa; // romdata shift register + uint8_t m_count; // TB/LA counter (-> PLA) + uint8_t m_prev_cmd; // previous handled command + uint8_t m_prev_m; // previous valid m0/m1 state - UINT8 m_add; // ADD/DATA pins input - UINT8 m_data; // ADD/DATA pins output + uint8_t m_add; // ADD/DATA pins input + uint8_t m_data; // ADD/DATA pins output int m_m0; int m_m1; int m_cs; // chipselect pin @@ -140,7 +140,7 @@ protected: class m58819_device : public tms6100_device { public: - m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides diff --git a/src/devices/machine/tms9901.cpp b/src/devices/machine/tms9901.cpp index 1ff3b7381f6..76a67caec7b 100644 --- a/src/devices/machine/tms9901.cpp +++ b/src/devices/machine/tms9901.cpp @@ -12,7 +12,7 @@ CE*| 5 36| S1 INT6*| 6 35| S2 INT5*| 7 34| INT7* / P15 - INT4*| 8 33| INT8* / P14 + INT4*| 8 33| int8_t* / P14 INT3*| 9 32| INT9* / P13 Phi*|10 31| INT10* / P12 INTREQ*|11 30| INT11* / P11 @@ -134,7 +134,7 @@ TODO: Tests on a real machine /* Constructor */ -tms9901_device::tms9901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9901_device::tms9901_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS9901, "TMS9901 Programmable System Interface", tag, owner, clock, "tms9901", __FILE__), m_read_block(*this), m_write_p0(*this), @@ -320,7 +320,7 @@ READ8_MEMBER( tms9901_device::read ) answer &= ~(m_pio_direction_mirror >> 8); answer |= (m_pio_output_mirror & m_pio_direction_mirror) >> 8; } - if (TRACE_PINS) logerror("%s: input on lines INT15..INT8 = %02x\n", tag(), answer); + if (TRACE_PINS) logerror("%s: input on lines INT15..int8_t = %02x\n", tag(), answer); break; case 2: /* exit timer mode */ diff --git a/src/devices/machine/tms9901.h b/src/devices/machine/tms9901.h index 60de51dd3f9..c38bc9e5064 100644 --- a/src/devices/machine/tms9901.h +++ b/src/devices/machine/tms9901.h @@ -56,7 +56,7 @@ enum class tms9901_device : public device_t { public: - tms9901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9901_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_single_int(int pin_number, int state); diff --git a/src/devices/machine/tms9902.cpp b/src/devices/machine/tms9902.cpp index 424bcfdd821..4750bda6d0e 100644 --- a/src/devices/machine/tms9902.cpp +++ b/src/devices/machine/tms9902.cpp @@ -64,7 +64,7 @@ enum /* Constructor */ -tms9902_device::tms9902_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9902_device::tms9902_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS9902, "TMS9902 ACC", tag, owner, clock, "tms9902", __FILE__), m_int_cb(*this), m_rcv_cb(*this), @@ -174,7 +174,7 @@ void tms9902_device::rcv_dsr(line_state state) the device that contains the UART. Unlike the real thing, we deliver complete bytes in one go. */ -void tms9902_device::rcv_data(UINT8 data) +void tms9902_device::rcv_data(uint8_t data) { // Put the received byte into the 1-byte receive buffer m_RBR = data; @@ -463,7 +463,7 @@ void tms9902_device::initiate_transmit() */ READ8_MEMBER( tms9902_device::cruread ) { - UINT8 answer = 0; + uint8_t answer = 0; offset &= 0x0003; @@ -509,7 +509,7 @@ READ8_MEMBER( tms9902_device::cruread ) return answer; } -static inline void set_bits8(UINT8 *reg, UINT8 bits, bool set) +static inline void set_bits8(uint8_t *reg, uint8_t bits, bool set) { if (set) *reg |= bits; @@ -517,7 +517,7 @@ static inline void set_bits8(UINT8 *reg, UINT8 bits, bool set) *reg &= ~bits; } -static inline void set_bits16(UINT16 *reg, UINT16 bits, bool set) +static inline void set_bits16(uint16_t *reg, uint16_t bits, bool set) { if (set) *reg |= bits; @@ -589,7 +589,7 @@ WRITE8_MEMBER( tms9902_device::cruwrite ) if (offset <= 10) { - UINT16 mask = (1 << offset); + uint16_t mask = (1 << offset); if (m_LDCTRL) { // Control Register mode. Values written to bits 0-7 are copied diff --git a/src/devices/machine/tms9902.h b/src/devices/machine/tms9902.h index f0ccf6c2b41..ff6ac128aba 100644 --- a/src/devices/machine/tms9902.h +++ b/src/devices/machine/tms9902.h @@ -47,7 +47,7 @@ extern const device_type TMS9902; class tms9902_device : public device_t { public: - tms9902_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9902_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_int_callback(device_t &device, _Object object) { return downcast(device).m_int_cb.set_callback(object); } template static devcb_base &set_rcv_callback(device_t &device, _Object object) { return downcast(device).m_rcv_cb.set_callback(object); } @@ -58,7 +58,7 @@ public: void rcv_cts(line_state state); void rcv_dsr(line_state state); - void rcv_data(UINT8 data); + void rcv_data(uint8_t data); void rcv_break(bool value); void rcv_framing_error(); void rcv_parity_error(); @@ -115,11 +115,11 @@ private: bool m_BRKON; // BRK-on request bool m_BRKout; // indicates the current BRK state - UINT8 m_XBR; // transmit buffer register - UINT8 m_XSR; // transmit shift register + uint8_t m_XBR; // transmit buffer register + uint8_t m_XSR; // transmit shift register /* receiver registers */ - UINT8 m_RBR; // Receive buffer register + uint8_t m_RBR; // Receive buffer register /* Interrupt enable flags */ bool m_DSCENB; // Data set change interrupt enable @@ -134,9 +134,9 @@ private: where clock1 = clock_rate / (CLK4M? 4:3) */ - UINT16 m_RDR; // Receive data rate + uint16_t m_RDR; // Receive data rate bool m_RDV8; // Receive data rate divider - UINT16 m_XDR; // Transmit data rate + uint16_t m_XDR; // Transmit data rate bool m_XDV8; // Transmit data rate divider /* Status flags */ @@ -161,13 +161,13 @@ private: bool m_ROVER; // Receiver overflow bool m_RPER; // Receive parity error - UINT8 m_RCL; // Character length + uint8_t m_RCL; // Character length bool m_ODDP; bool m_PENB; - UINT8 m_STOPB; + uint8_t m_STOPB; bool m_CLK4M; // /PHI input divide select - UINT8 m_TMR; /* interval timer */ + uint8_t m_TMR; /* interval timer */ /* clock registers */ emu_timer *m_dectimer; /* MESS timer, used to emulate the decrementer register */ diff --git a/src/devices/machine/upd1990a.cpp b/src/devices/machine/upd1990a.cpp index cfce446ba37..58703942c05 100644 --- a/src/devices/machine/upd1990a.cpp +++ b/src/devices/machine/upd1990a.cpp @@ -44,7 +44,7 @@ const device_type UPD4990A = &device_creator; // upd1990a_device - constructor //------------------------------------------------- -upd1990a_device::upd1990a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +upd1990a_device::upd1990a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_rtc_interface(mconfig, *this), m_write_data(*this), @@ -53,7 +53,7 @@ upd1990a_device::upd1990a_device(const machine_config &mconfig, device_type type { } -upd1990a_device::upd1990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd1990a_device::upd1990a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD1990A, "uPD1990A", tag, owner, clock, "upd1990a", __FILE__), device_rtc_interface(mconfig, *this), m_write_data(*this), @@ -62,7 +62,7 @@ upd1990a_device::upd1990a_device(const machine_config &mconfig, const char *tag, { } -upd4990a_device::upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd4990a_device::upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd1990a_device(mconfig, UPD4990A, "uPD4990A RTC", tag, owner, clock, TYPE_4990A, "upd4990a", __FILE__) { } diff --git a/src/devices/machine/upd1990a.h b/src/devices/machine/upd1990a.h index a526e920017..4f6d2900e40 100644 --- a/src/devices/machine/upd1990a.h +++ b/src/devices/machine/upd1990a.h @@ -53,8 +53,8 @@ class upd1990a_device : public device_t, { public: // construction/destruction - upd1990a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - upd1990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd1990a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + upd1990a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_data_callback(_data data) { m_write_data.set_callback(data); } template void set_tp_callback(_tp tp) { m_write_tp.set_callback(tp); } @@ -116,8 +116,8 @@ private: devcb_write_line m_write_data; devcb_write_line m_write_tp; - UINT8 m_time_counter[6]; // time counter - UINT8 m_shift_reg[7]; // shift register (40 bits, or 48 bits + serial command register) + uint8_t m_time_counter[6]; // time counter + uint8_t m_shift_reg[7]; // shift register (40 bits, or 48 bits + serial command register) int m_oe; // output enable int m_cs; // chip select @@ -149,7 +149,7 @@ private: class upd4990a_device : public upd1990a_device { public: - upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/machine/upd4701.cpp b/src/devices/machine/upd4701.cpp index 37e5d5dadd9..cae5c6196c3 100644 --- a/src/devices/machine/upd4701.cpp +++ b/src/devices/machine/upd4701.cpp @@ -18,7 +18,7 @@ const device_type UPD4701 = &device_creator; -upd4701_device::upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd4701_device::upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD4701, "uPD4701 Encoder", tag, owner, clock, "upd4701", __FILE__), m_cs(0), m_xy(0), m_ul(0), m_resetx(0), m_resety(0), m_latchx(0), m_latchy(0), m_startx(0), m_starty(0), m_x(0), m_y(0), m_switches(0), m_latchswitches(0), m_cf(0) { @@ -163,7 +163,7 @@ WRITE_LINE_MEMBER( upd4701_device::resety_w ) x_add -------------------------------------------------*/ -void upd4701_device::x_add( INT16 data ) +void upd4701_device::x_add( int16_t data ) { if (!m_resetx && data != 0) { @@ -180,7 +180,7 @@ void upd4701_device::x_add( INT16 data ) y_add -------------------------------------------------*/ -void upd4701_device::y_add( INT16 data ) +void upd4701_device::y_add( int16_t data ) { if (!m_resety && data != 0) { @@ -197,7 +197,7 @@ void upd4701_device::y_add( INT16 data ) switches_set -------------------------------------------------*/ -void upd4701_device::switches_set( UINT8 data ) +void upd4701_device::switches_set( uint8_t data ) { m_switches = data; } diff --git a/src/devices/machine/upd4701.h b/src/devices/machine/upd4701.h index d559e8e00b6..a21ca6413de 100644 --- a/src/devices/machine/upd4701.h +++ b/src/devices/machine/upd4701.h @@ -18,11 +18,11 @@ class upd4701_device : public device_t { public: - upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void x_add( INT16 data ); - void y_add( INT16 data ); - void switches_set( UINT8 data ); + void x_add( int16_t data ); + void y_add( int16_t data ); + void switches_set( uint8_t data ); DECLARE_WRITE_LINE_MEMBER( cs_w ); DECLARE_WRITE_LINE_MEMBER( xy_w ); diff --git a/src/devices/machine/upd4992.cpp b/src/devices/machine/upd4992.cpp index 29535e60c94..2e87bd63ecb 100644 --- a/src/devices/machine/upd4992.cpp +++ b/src/devices/machine/upd4992.cpp @@ -33,7 +33,7 @@ const device_type UPD4992 = &device_creator; // upd4992_device - constructor //------------------------------------------------- -upd4992_device::upd4992_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd4992_device::upd4992_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD4992, "uPD4992 RTC", tag, owner, clock, "upd4992", __FILE__), device_rtc_interface(mconfig, *this), m_timer_clock(nullptr) { diff --git a/src/devices/machine/upd4992.h b/src/devices/machine/upd4992.h index dc907fed516..9825e02e3ef 100644 --- a/src/devices/machine/upd4992.h +++ b/src/devices/machine/upd4992.h @@ -32,7 +32,7 @@ class upd4992_device : public device_t, { public: // construction/destruction - upd4992_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd4992_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE8_MEMBER( write ); @@ -55,7 +55,7 @@ private: }; emu_timer *m_timer_clock; - UINT8 m_rtc_regs[8]; + uint8_t m_rtc_regs[8]; }; diff --git a/src/devices/machine/upd7002.cpp b/src/devices/machine/upd7002.cpp index 30803adc481..ff5bae792ae 100644 --- a/src/devices/machine/upd7002.cpp +++ b/src/devices/machine/upd7002.cpp @@ -18,7 +18,7 @@ const device_type UPD7002 = &device_creator; -upd7002_device::upd7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7002_device::upd7002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD7002, "uPD7002", tag, owner, clock, "upd7002", __FILE__), m_status(0), m_data1(0), m_data0(0), m_digitalvalue(0), m_conversion_counter(0) { } diff --git a/src/devices/machine/upd7002.h b/src/devices/machine/upd7002.h index 0875549f7e8..16a57fcc281 100644 --- a/src/devices/machine/upd7002.h +++ b/src/devices/machine/upd7002.h @@ -31,7 +31,7 @@ typedef device_delegate upd7002_eoc_delegate; class upd7002_device : public device_t { public: - upd7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd7002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~upd7002_device() {} static void set_get_analogue_callback(device_t &device, upd7002_get_analogue_delegate callback) { downcast(device).m_get_analogue_cb = callback; } diff --git a/src/devices/machine/upd71071.cpp b/src/devices/machine/upd71071.cpp index 0bbe1c9b1f9..9dd7ef3affa 100644 --- a/src/devices/machine/upd71071.cpp +++ b/src/devices/machine/upd71071.cpp @@ -92,7 +92,7 @@ const device_type UPD71071 = &device_creator; -upd71071_device::upd71071_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd71071_device::upd71071_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD71071, "NEC uPD71071", tag, owner, clock, "upd71071", __FILE__), m_upd_clock(0), m_out_hreq_cb(*this), @@ -172,7 +172,7 @@ TIMER_CALLBACK_MEMBER(upd71071_device::dma_transfer_timer) { // single byte or word transfer int channel = param; - UINT16 data = 0; // data to transfer + uint16_t data = 0; // data to transfer switch (m_reg.mode_control[channel] & 0x0c) { @@ -336,7 +336,7 @@ int upd71071_device::dmarq(int state, int channel) READ8_MEMBER(upd71071_device::read) { - UINT8 ret = 0; + uint8_t ret = 0; logerror("DMA: read from register %02x\n",offset); switch(offset) diff --git a/src/devices/machine/upd71071.h b/src/devices/machine/upd71071.h index e63546a7f40..f1e223d353a 100644 --- a/src/devices/machine/upd71071.h +++ b/src/devices/machine/upd71071.h @@ -8,25 +8,25 @@ struct upd71071_reg { - UINT8 initialise; - UINT8 channel; - UINT16 count_current[4]; - UINT16 count_base[4]; - UINT32 address_current[4]; - UINT32 address_base[4]; - UINT16 device_control; - UINT8 mode_control[4]; - UINT8 status; - UINT8 temp_l; - UINT8 temp_h; - UINT8 request; - UINT8 mask; + uint8_t initialise; + uint8_t channel; + uint16_t count_current[4]; + uint16_t count_base[4]; + uint32_t address_current[4]; + uint32_t address_base[4]; + uint16_t device_control; + uint8_t mode_control[4]; + uint8_t status; + uint8_t temp_l; + uint8_t temp_h; + uint8_t request; + uint8_t mask; }; class upd71071_device : public device_t { public: - upd71071_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd71071_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~upd71071_device() {} static void static_set_cpu_tag(device_t &device, const char *tag) { downcast(device).m_cpu.set_tag(tag); } diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp index 7cf98458d1b..37b92a68a20 100644 --- a/src/devices/machine/upd765.cpp +++ b/src/devices/machine/upd765.cpp @@ -110,7 +110,7 @@ ADDRESS_MAP_END int upd765_family_device::rates[4] = { 500000, 300000, 250000, 1000000 }; -upd765_family_device::upd765_family_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) : +upd765_family_device::upd765_family_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) : pc_fdc_interface(mconfig, type, name, tag, owner, clock, shortname, source), intrq_cb(*this), drq_cb(*this), @@ -273,7 +273,7 @@ void upd765_family_device::set_floppy(floppy_image_device *flop) READ8_MEMBER(upd765_family_device::sra_r) { - UINT8 sra = 0; + uint8_t sra = 0; int fid = dor & 3; floppy_info &fi = flopi[fid]; if(fi.dir) @@ -307,7 +307,7 @@ READ8_MEMBER(upd765_family_device::dor_r) WRITE8_MEMBER(upd765_family_device::dor_w) { if (LOG) logerror("dor = %02x\n", data); - UINT8 diff = dor ^ data; + uint8_t diff = dor ^ data; dor = data; if(diff & 4) soft_reset(); @@ -331,7 +331,7 @@ WRITE8_MEMBER(upd765_family_device::tdr_w) READ8_MEMBER(upd765_family_device::msr_r) { - UINT32 msr = 0; + uint32_t msr = 0; switch(main_phase) { case PHASE_CMD: msr |= MSR_RQM; @@ -383,7 +383,7 @@ void upd765_family_device::set_rate(int rate) READ8_MEMBER(upd765_family_device::fifo_r) { - UINT8 r = 0xff; + uint8_t r = 0xff; switch(main_phase) { case PHASE_EXEC: if(internal_drq) @@ -441,7 +441,7 @@ WRITE8_MEMBER(upd765_family_device::fifo_w) } } -UINT8 upd765_family_device::do_dir_r() +uint8_t upd765_family_device::do_dir_r() { floppy_info &fi = flopi[dor & 3]; if(fi.dev) @@ -498,7 +498,7 @@ void upd765_family_device::disable_transfer() set_drq(false); } -void upd765_family_device::fifo_push(UINT8 data, bool internal) +void upd765_family_device::fifo_push(uint8_t data, bool internal) { if(fifo_pos == 16) { if(internal) { @@ -519,7 +519,7 @@ void upd765_family_device::fifo_push(UINT8 data, bool internal) } -UINT8 upd765_family_device::fifo_pop(bool internal) +uint8_t upd765_family_device::fifo_pop(bool internal) { if(!fifo_pos) { if(internal) { @@ -529,7 +529,7 @@ UINT8 upd765_family_device::fifo_pop(bool internal) } return 0; } - UINT8 r = fifo[0]; + uint8_t r = fifo[0]; fifo_pos--; memmove(fifo, fifo+1, fifo_pos); if(!fifo_write && !fifo_pos) @@ -558,12 +558,12 @@ WRITE8_MEMBER(upd765_family_device::mdma_w) dma_w(data); } -UINT8 upd765_family_device::dma_r() +uint8_t upd765_family_device::dma_r() { return fifo_pop(false); } -void upd765_family_device::dma_w(UINT8 data) +void upd765_family_device::dma_w(uint8_t data) { fifo_push(data, false); } @@ -884,7 +884,7 @@ void upd765_family_device::live_run(attotime limit) if(!scan_done) // TODO: handle stp, x68000 sets it to 0xff (as it would dtl)? { int slot = (cur_live.bit_counter >> 4)-1; - UINT8 data = fifo_pop(true); + uint8_t data = fifo_pop(true); if(!slot) st2 = (st2 & ~(ST2_SN)) | ST2_SH; @@ -1029,7 +1029,7 @@ void upd765_family_device::live_run(attotime limit) cur_live.crc = 0xcdb4; live_write_mfm(0xfe); } else if(cur_live.byte_counter < 20) { - UINT8 byte = fifo_pop(true); + uint8_t byte = fifo_pop(true); command[12+cur_live.byte_counter-16] = byte; live_write_mfm(byte); if(cur_live.byte_counter == 19) @@ -1065,7 +1065,7 @@ void upd765_family_device::live_run(attotime limit) cur_live.crc = 0xffff; live_write_raw(0xf57e); } else if(cur_live.byte_counter < 11) { - UINT8 byte = fifo_pop(true); + uint8_t byte = fifo_pop(true); command[12+cur_live.byte_counter-7] = byte; live_write_fm(byte); if(cur_live.byte_counter == 10) @@ -2010,7 +2010,7 @@ void upd765_family_device::read_track_continue(floppy_info &fi) } } -int upd765_family_device::calc_sector_size(UINT8 size) +int upd765_family_device::calc_sector_size(uint8_t size) { return size > 7 ? 16384 : 128 << size; } @@ -2368,17 +2368,17 @@ bool upd765_family_device::write_one_bit(const attotime &limit) return false; } -void upd765_family_device::live_write_raw(UINT16 raw) +void upd765_family_device::live_write_raw(uint16_t raw) { // if (LOG) logerror("write %04x %04x\n", raw, cur_live.crc); cur_live.shift_reg = raw; cur_live.data_bit_context = raw & 1; } -void upd765_family_device::live_write_mfm(UINT8 mfm) +void upd765_family_device::live_write_mfm(uint8_t mfm) { bool context = cur_live.data_bit_context; - UINT16 raw = 0; + uint16_t raw = 0; for(int i=0; i<8; i++) { bool bit = mfm & (0x80 >> i); if(!(bit || context)) @@ -2393,9 +2393,9 @@ void upd765_family_device::live_write_mfm(UINT8 mfm) // if (LOG) logerror("write %02x %04x %04x\n", mfm, cur_live.crc, raw); } -void upd765_family_device::live_write_fm(UINT8 fm) +void upd765_family_device::live_write_fm(uint8_t fm) { - UINT16 raw = 0xaaaa; + uint16_t raw = 0xaaaa; for(int i=0; i<8; i++) if(fm & (0x80 >> i)) raw |= 0x4000 >> (2*i); @@ -2418,67 +2418,67 @@ bool upd765_family_device::sector_matches() const cur_live.idbuf[3] == command[5]; } -upd765a_device::upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, UPD765A, "UPD765A", tag, owner, clock, "upd765a", __FILE__) +upd765a_device::upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, UPD765A, "UPD765A", tag, owner, clock, "upd765a", __FILE__) { dor_reset = 0x0c; } -upd765b_device::upd765b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, UPD765B, "UPD765B", tag, owner, clock, "upd765b", __FILE__) +upd765b_device::upd765b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, UPD765B, "UPD765B", tag, owner, clock, "upd765b", __FILE__) { dor_reset = 0x0c; } -i8272a_device::i8272a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, I8272A, "I8272A", tag, owner, clock, "i8272a", __FILE__) +i8272a_device::i8272a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, I8272A, "I8272A", tag, owner, clock, "i8272a", __FILE__) { dor_reset = 0x0c; } -upd72065_device::upd72065_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, UPD72065, "UPD72065", tag, owner, clock, "upd72065", __FILE__) +upd72065_device::upd72065_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, UPD72065, "UPD72065", tag, owner, clock, "upd72065", __FILE__) { dor_reset = 0x0c; } -smc37c78_device::smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, SMC37C78, "SMC37C78", tag, owner, clock, "smc37c78", __FILE__) +smc37c78_device::smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, SMC37C78, "SMC37C78", tag, owner, clock, "smc37c78", __FILE__) { ready_connected = false; select_connected = true; } -n82077aa_device::n82077aa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, N82077AA, "N82077AA", tag, owner, clock, "n82077aa", __FILE__) +n82077aa_device::n82077aa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, N82077AA, "N82077AA", tag, owner, clock, "n82077aa", __FILE__) { ready_connected = false; select_connected = true; } -pc_fdc_superio_device::pc_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC FDC SUPERIO", tag, owner, clock, "pc_fdc_superio", __FILE__) +pc_fdc_superio_device::pc_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC FDC SUPERIO", tag, owner, clock, "pc_fdc_superio", __FILE__) { ready_polled = false; ready_connected = false; select_connected = true; } -dp8473_device::dp8473_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "DP8473", tag, owner, clock, "dp8473", __FILE__) +dp8473_device::dp8473_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "DP8473", tag, owner, clock, "dp8473", __FILE__) { ready_polled = false; ready_connected = false; select_connected = true; } -pc8477a_device::pc8477a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC8477A", tag, owner, clock, "pc8477a", __FILE__) +pc8477a_device::pc8477a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC8477A", tag, owner, clock, "pc8477a", __FILE__) { ready_polled = true; ready_connected = false; select_connected = true; } -wd37c65c_device::wd37c65c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "WD37C65C", tag, owner, clock, "wd37c65c", __FILE__) +wd37c65c_device::wd37c65c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "WD37C65C", tag, owner, clock, "wd37c65c", __FILE__) { ready_polled = true; ready_connected = false; select_connected = true; } -mcs3201_device::mcs3201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +mcs3201_device::mcs3201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, MCS3201, "Motorola MCS3201", tag, owner, clock, "mcs3201", __FILE__), m_input_handler(*this) { @@ -2499,7 +2499,7 @@ READ8_MEMBER( mcs3201_device::input_r ) return m_input_handler(); } -tc8566af_device::tc8566af_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tc8566af_device::tc8566af_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd765_family_device(mconfig, TC8566AF, "TC8566AF", tag, owner, clock, "tc8566af", __FILE__) , m_cr1(0) { diff --git a/src/devices/machine/upd765.h b/src/devices/machine/upd765.h index 19da61d4712..36ca5ccd727 100644 --- a/src/devices/machine/upd765.h +++ b/src/devices/machine/upd765.h @@ -72,10 +72,10 @@ /* Interface required for PC ISA wrapping */ class pc_fdc_interface : public device_t { public: - typedef delegate byte_read_cb; - typedef delegate byte_write_cb; + typedef delegate byte_read_cb; + typedef delegate byte_write_cb; - pc_fdc_interface(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) {} + pc_fdc_interface(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) {} /* Note that the address map must cover and handle the whole 0-7 * range. The upd765, while conforming to the rest of the @@ -84,18 +84,18 @@ public: virtual DECLARE_ADDRESS_MAP(map, 8) = 0; - virtual UINT8 dma_r() = 0; - virtual void dma_w(UINT8 data) = 0; + virtual uint8_t dma_r() = 0; + virtual void dma_w(uint8_t data) = 0; virtual void tc_w(bool val) = 0; - virtual UINT8 do_dir_r() = 0; + virtual uint8_t do_dir_r() = 0; }; class upd765_family_device : public pc_fdc_interface { public: enum { MODE_AT, MODE_PS2, MODE_M30 }; - upd765_family_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); + upd765_family_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_intrq_wr_callback(device_t &device, _Object object) { return downcast(device).intrq_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); } @@ -116,10 +116,10 @@ public: DECLARE_READ8_MEMBER (dir_r); DECLARE_WRITE8_MEMBER(ccr_w); - virtual UINT8 do_dir_r() override; + virtual uint8_t do_dir_r() override; - UINT8 dma_r() override; - void dma_w(UINT8 data) override; + uint8_t dma_r() override; + void dma_w(uint8_t data) override; // Same as the previous ones, but as memory-mappable members DECLARE_READ8_MEMBER(mdma_r); @@ -285,7 +285,7 @@ protected: int id; int main_state, sub_state; int dir, counter; - UINT8 pcn, st0; + uint8_t pcn, st0; bool st0_filled; bool live, index, ready; }; @@ -296,12 +296,12 @@ protected: attotime tm; int state, next_state; floppy_info *fi; - UINT16 shift_reg; - UINT16 crc; + uint16_t shift_reg; + uint16_t crc; int bit_counter, byte_counter, previous_type; bool data_separator_phase, data_bit_context; - UINT8 data_reg; - UINT8 idbuf[6]; + uint8_t data_reg; + uint8_t idbuf[6]; fdc_pll_t pll; }; @@ -321,11 +321,11 @@ protected: int fifo_pos, fifo_expected, command_pos, result_pos, sectors_read; bool fifo_write; - UINT8 dor, dsr, msr, fifo[16], command[16], result[16]; - UINT8 st1, st2, st3; - UINT8 fifocfg, dor_reset; - UINT8 precomp, perpmode; - UINT16 spec; + uint8_t dor, dsr, msr, fifo[16], command[16], result[16]; + uint8_t st1, st2, st3; + uint8_t fifocfg, dor_reset; + uint8_t precomp, perpmode; + uint16_t spec; int sector_size; int cur_rate; @@ -360,14 +360,14 @@ protected: void delay_cycles(emu_timer *tm, int cycles); void check_irq(); void fifo_expect(int size, bool write); - void fifo_push(UINT8 data, bool internal); - UINT8 fifo_pop(bool internal); + void fifo_push(uint8_t data, bool internal); + uint8_t fifo_pop(bool internal); void set_drq(bool state); bool get_ready(int fid); void enable_transfer(); void disable_transfer(); - int calc_sector_size(UINT8 size); + int calc_sector_size(uint8_t size); void run_drive_ready_polling(); @@ -407,9 +407,9 @@ protected: void live_delay(int state); void live_sync(); void live_run(attotime limit = attotime::never); - void live_write_raw(UINT16 raw); - void live_write_fm(UINT8 fm); - void live_write_mfm(UINT8 mfm); + void live_write_raw(uint16_t raw); + void live_write_fm(uint8_t fm); + void live_write_mfm(uint8_t mfm); bool read_one_bit(const attotime &limit); bool write_one_bit(const attotime &limit); @@ -417,77 +417,77 @@ protected: class upd765a_device : public upd765_family_device { public: - upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class upd765b_device : public upd765_family_device { public: - upd765b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd765b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class i8272a_device : public upd765_family_device { public: - i8272a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8272a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class smc37c78_device : public upd765_family_device { public: - smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class upd72065_device : public upd765_family_device { public: - upd72065_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd72065_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class n82077aa_device : public upd765_family_device { public: - n82077aa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + n82077aa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class pc_fdc_superio_device : public upd765_family_device { public: - pc_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc_fdc_superio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class dp8473_device : public upd765_family_device { public: - dp8473_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dp8473_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class pc8477a_device : public upd765_family_device { public: - pc8477a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pc8477a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class wd37c65c_device : public upd765_family_device { public: - wd37c65c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd37c65c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; }; class mcs3201_device : public upd765_family_device { public: - mcs3201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mcs3201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_input_handler(device_t &device, _Object object) { return downcast(device).m_input_handler.set_callback(object); } @@ -504,7 +504,7 @@ private: class tc8566af_device : public upd765_family_device { public: - tc8566af_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tc8566af_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8) override; @@ -514,7 +514,7 @@ protected: virtual void device_start() override; private: - UINT8 m_cr1; + uint8_t m_cr1; }; extern const device_type UPD765A; diff --git a/src/devices/machine/v3021.cpp b/src/devices/machine/v3021.cpp index d7caf681c70..73f984fd67c 100644 --- a/src/devices/machine/v3021.cpp +++ b/src/devices/machine/v3021.cpp @@ -33,14 +33,14 @@ const device_type v3021 = &device_creator; // v3021_device - constructor //------------------------------------------------- -v3021_device::v3021_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v3021_device::v3021_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, v3021, "V3021 RTC", tag, owner, clock, "v3021", __FILE__), m_cal_mask(0), m_cal_com(0), m_cal_cnt(0), m_cal_val(0) { } TIMER_CALLBACK_MEMBER(v3021_device::timer_callback) { - 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 }; int dpm_count; m_rtc.sec++; @@ -116,7 +116,7 @@ void v3021_device::device_reset() READ8_MEMBER( v3021_device::read ) { - UINT8 calr = (m_cal_val & m_cal_mask) ? 1 : 0; + uint8_t calr = (m_cal_val & m_cal_mask) ? 1 : 0; m_cal_mask <<= 1; return calr; diff --git a/src/devices/machine/v3021.h b/src/devices/machine/v3021.h index ed13501e949..5a968e30bfb 100644 --- a/src/devices/machine/v3021.h +++ b/src/devices/machine/v3021.h @@ -30,7 +30,7 @@ struct rtc_regs_t { - UINT8 sec, min, hour, day, wday, month, year; + uint8_t sec, min, hour, day, wday, month, year; }; @@ -40,7 +40,7 @@ class v3021_device : public device_t { public: // construction/destruction - v3021_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v3021_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE8_MEMBER( write ); @@ -53,7 +53,7 @@ protected: virtual void device_start() override; virtual void device_reset() override; - UINT8 m_cal_mask,m_cal_com,m_cal_cnt,m_cal_val; + uint8_t m_cal_mask,m_cal_com,m_cal_cnt,m_cal_val; rtc_regs_t m_rtc; }; diff --git a/src/devices/machine/vrc4373.cpp b/src/devices/machine/vrc4373.cpp index c750d2fb580..81391b7625c 100644 --- a/src/devices/machine/vrc4373.cpp +++ b/src/devices/machine/vrc4373.cpp @@ -28,7 +28,7 @@ DEVICE_ADDRESS_MAP_START(target2_map, 32, vrc4373_device) AM_RANGE(0x00000000, 0xFFFFFFFF) AM_READWRITE( target2_r, target2_w) ADDRESS_MAP_END -vrc4373_device::vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vrc4373_device::vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_host_device(mconfig, VRC4373, "NEC VRC4373 System Controller", tag, owner, clock, "vrc4373", __FILE__), m_cpu_space(nullptr), m_cpu(nullptr), cpu_tag(nullptr), m_irq_num(-1), m_mem_config("memory_space", ENDIANNESS_LITTLE, 32, 32), @@ -65,7 +65,7 @@ void vrc4373_device::device_start() m_simm[0].reserve(0x02000000 / 4); // ROM - UINT32 romSize = m_romRegion->bytes(); + uint32_t romSize = m_romRegion->bytes(); m_cpu_space->install_rom(0x1fc00000, 0x1fc00000 + romSize - 1, m_romRegion->base()); // Nile register mapppings m_cpu_space->install_device(0x0f000000, 0x0f0000ff, *static_cast(this), &vrc4373_device::cpu_map); @@ -91,8 +91,8 @@ void vrc4373_device::device_reset() void vrc4373_device::map_cpu_space() { - UINT32 winStart, winEnd, winSize; - UINT32 regConfig; + uint32_t winStart, winEnd, winSize; + uint32_t regConfig; // VRC4373 is at 0x0f000000 to 0x0f0001ff // ROM region starts at 0x1f000000 @@ -171,10 +171,10 @@ void vrc4373_device::map_cpu_space() } } -void vrc4373_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 vrc4373_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) { - UINT32 winStart, winEnd, winSize; + uint32_t winStart, winEnd, winSize; // PCI Target Window 1 if (m_cpu_regs[NREG_PCITW1]&0x1000) { @@ -212,7 +212,7 @@ void vrc4373_device::set_cpu_tag(const char *_cpu_tag) // PCI bus control READ32_MEMBER (vrc4373_device::pcictrl_r) { - UINT32 result = 0; + uint32_t result = 0; if (LOG_NILE) logerror("%06X:nile pcictrl_r from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); return result; @@ -225,7 +225,7 @@ WRITE32_MEMBER (vrc4373_device::pcictrl_w) // PCI Master Window 1 READ32_MEMBER (vrc4373_device::master1_r) { - UINT32 result = this->space(AS_DATA).read_dword(m_pci1_laddr | (offset*4), mem_mask); + uint32_t result = this->space(AS_DATA).read_dword(m_pci1_laddr | (offset*4), mem_mask); if (LOG_NILE_MASTER) logerror("%06X:nile master1 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); return result; @@ -240,7 +240,7 @@ WRITE32_MEMBER (vrc4373_device::master1_w) // PCI Master Window 2 READ32_MEMBER (vrc4373_device::master2_r) { - UINT32 result = this->space(AS_DATA).read_dword(m_pci2_laddr | (offset*4), mem_mask); + uint32_t result = this->space(AS_DATA).read_dword(m_pci2_laddr | (offset*4), mem_mask); if (LOG_NILE_MASTER) logerror("%06X:nile master2 read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); return result; @@ -255,7 +255,7 @@ WRITE32_MEMBER (vrc4373_device::master2_w) // PCI Master IO Window READ32_MEMBER (vrc4373_device::master_io_r) { - UINT32 result = this->space(AS_IO).read_dword(m_pci_io_laddr | (offset*4), mem_mask); + uint32_t result = this->space(AS_IO).read_dword(m_pci_io_laddr | (offset*4), mem_mask); if (LOG_NILE_MASTER) logerror("%06X:nile master io read from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); return result; @@ -270,7 +270,7 @@ WRITE32_MEMBER (vrc4373_device::master_io_w) // PCI Target Window 1 READ32_MEMBER (vrc4373_device::target1_r) { - UINT32 result = m_cpu->space(AS_PROGRAM).read_dword(m_target1_laddr | (offset*4), mem_mask); + uint32_t result = m_cpu->space(AS_PROGRAM).read_dword(m_target1_laddr | (offset*4), mem_mask); if (LOG_NILE_TARGET) logerror("%08X:nile target1 read from offset %02X = %08X & %08X\n", m_cpu->device_t::safe_pc(), offset*4, result, mem_mask); return result; @@ -285,7 +285,7 @@ WRITE32_MEMBER (vrc4373_device::target1_w) // PCI Target Window 2 READ32_MEMBER (vrc4373_device::target2_r) { - UINT32 result = m_cpu->space(AS_PROGRAM).read_dword(m_target2_laddr | (offset*4), mem_mask); + uint32_t result = m_cpu->space(AS_PROGRAM).read_dword(m_target2_laddr | (offset*4), mem_mask); if (LOG_NILE_TARGET) logerror("%08X:nile target2 read from offset %02X = %08X & %08X\n", m_cpu->device_t::safe_pc(), offset*4, result, mem_mask); return result; @@ -311,7 +311,7 @@ TIMER_CALLBACK_MEMBER (vrc4373_device::dma_transfer) int pciSel = (m_cpu_regs[NREG_DMACR1+which*0xC] & DMA_MIO) ? AS_DATA : AS_IO; address_space *src, *dst; - UINT32 srcAddr, dstAddr; + uint32_t srcAddr, dstAddr; if (m_cpu_regs[NREG_DMACR1+which*0xC]&DMA_RW) { // Read data from PCI and write to cpu @@ -364,7 +364,7 @@ TIMER_CALLBACK_MEMBER (vrc4373_device::dma_transfer) // CPU I/F READ32_MEMBER (vrc4373_device::cpu_if_r) { - UINT32 result = m_cpu_regs[offset]; + uint32_t result = m_cpu_regs[offset]; switch (offset) { case NREG_PCICAR: result = config_address_r(space, offset); @@ -385,7 +385,7 @@ WRITE32_MEMBER(vrc4373_device::cpu_if_w) if (LOG_NILE) logerror("%06X:nile write to offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, data, mem_mask); - UINT32 modData, oldData; + uint32_t modData, oldData; oldData = m_cpu_regs[offset]; COMBINE_DATA(&m_cpu_regs[offset]); switch (offset) { diff --git a/src/devices/machine/vrc4373.h b/src/devices/machine/vrc4373.h index 81f500a11a3..a8328de813c 100644 --- a/src/devices/machine/vrc4373.h +++ b/src/devices/machine/vrc4373.h @@ -66,11 +66,11 @@ class vrc4373_device : public pci_host_device { public: - vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void reset_all_mappings() 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; void set_cpu_tag(const char *tag); @@ -117,14 +117,14 @@ private: void map_cpu_space(); - std::vector m_ram; + std::vector m_ram; - std::vector m_simm[4]; + std::vector m_simm[4]; - UINT32 m_cpu_regs[0x7c]; + uint32_t m_cpu_regs[0x7c]; - UINT32 m_pci1_laddr, m_pci2_laddr, m_pci_io_laddr; - UINT32 m_target1_laddr, m_target2_laddr; + uint32_t m_pci1_laddr, m_pci2_laddr, m_pci_io_laddr; + uint32_t m_target1_laddr, m_target2_laddr; required_memory_region m_romRegion; diff --git a/src/devices/machine/vt82c496.cpp b/src/devices/machine/vt82c496.cpp index eb2fff4e564..ecb8113d645 100644 --- a/src/devices/machine/vt82c496.cpp +++ b/src/devices/machine/vt82c496.cpp @@ -15,7 +15,7 @@ const device_type VT82C496 = &device_creator; -vt82c496_device::vt82c496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vt82c496_device::vt82c496_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VT82C496, "VIA VT82C496G system chipset", tag, owner, clock, "vt82c496", __FILE__), m_cpu_tag(nullptr), m_region_tag(nullptr), m_space(nullptr), m_ram(nullptr), m_rom(nullptr), m_reg_select(0) { } @@ -93,7 +93,7 @@ WRITE8_MEMBER(vt82c496_device::write) } } -void vt82c496_device::update_mem_c0(UINT8 data) +void vt82c496_device::update_mem_c0(uint8_t data) { if(data & 0x80) machine().root_device().membank("bios_cc_r")->set_base(m_ram->pointer()+0xcc000); @@ -144,7 +144,7 @@ void vt82c496_device::update_mem_c0(UINT8 data) m_space->nop_write(0xc0000,0xc3fff); } -void vt82c496_device::update_mem_d0(UINT8 data) +void vt82c496_device::update_mem_d0(uint8_t data) { if(data & 0x80) machine().root_device().membank("bios_dc_r")->set_base(m_ram->pointer()+0xdc000); @@ -195,7 +195,7 @@ void vt82c496_device::update_mem_d0(UINT8 data) m_space->nop_write(0xd0000,0xd3fff); } -void vt82c496_device::update_mem_e0(UINT8 data) +void vt82c496_device::update_mem_e0(uint8_t data) { if(data & 0x80) machine().root_device().membank("bios_e0_r")->set_base(m_ram->pointer()+0xe0000); diff --git a/src/devices/machine/vt82c496.h b/src/devices/machine/vt82c496.h index d6c1c34e819..c33bf241fb3 100644 --- a/src/devices/machine/vt82c496.h +++ b/src/devices/machine/vt82c496.h @@ -25,7 +25,7 @@ class vt82c496_device : public device_t { public: // construction/destruction - vt82c496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vt82c496_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_cpu(device_t &device, const char *tag) { dynamic_cast(device).m_cpu_tag = tag; } static void static_set_region(device_t &device, const char *tag) { dynamic_cast(device).m_region_tag = tag; } @@ -43,14 +43,14 @@ private: // cpu_device* m_maincpu; address_space* m_space; ram_device* m_ram; - UINT8* m_rom; + uint8_t* m_rom; - UINT8 m_reg[0x100]; - UINT8 m_reg_select; + uint8_t m_reg[0x100]; + uint8_t m_reg_select; - void update_mem_c0(UINT8 data); - void update_mem_d0(UINT8 data); - void update_mem_e0(UINT8 data); + void update_mem_c0(uint8_t data); + void update_mem_d0(uint8_t data); + void update_mem_e0(uint8_t data); }; // device type definition diff --git a/src/devices/machine/vt83c461.cpp b/src/devices/machine/vt83c461.cpp index 1957b848c9b..b6df812ec7e 100644 --- a/src/devices/machine/vt83c461.cpp +++ b/src/devices/machine/vt83c461.cpp @@ -18,7 +18,7 @@ const device_type VT83C461 = &device_creator; -vt83c461_device::vt83c461_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vt83c461_device::vt83c461_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ide_controller_32_device(mconfig, VT83C461, "VIA VT83C461", tag, owner, clock, "vt83c461", __FILE__), m_config_unknown(0), m_config_register_num(0) @@ -41,7 +41,7 @@ void vt83c461_device::device_start() READ32_MEMBER( vt83c461_device::read_config ) { - UINT32 result = 0; + uint32_t result = 0; /* logit */ LOG(("%s:IDE via config read at %X, mem_mask=%d\n", machine().describe_context(), offset, mem_mask)); diff --git a/src/devices/machine/vt83c461.h b/src/devices/machine/vt83c461.h index 1fbe3a475bb..2577fdd6dfa 100644 --- a/src/devices/machine/vt83c461.h +++ b/src/devices/machine/vt83c461.h @@ -32,7 +32,7 @@ class vt83c461_device : public ide_controller_32_device { public: - vt83c461_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vt83c461_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ32_MEMBER(read_config); DECLARE_WRITE32_MEMBER(write_config); @@ -41,9 +41,9 @@ protected: virtual void device_start() override; private: - UINT8 m_config_unknown; - UINT8 m_config_register[IDE_CONFIG_REGISTERS]; - UINT8 m_config_register_num; + uint8_t m_config_unknown; + uint8_t m_config_register[IDE_CONFIG_REGISTERS]; + uint8_t m_config_register_num; }; extern const device_type VT83C461; diff --git a/src/devices/machine/watchdog.cpp b/src/devices/machine/watchdog.cpp index 845094daaba..3dd1664d997 100644 --- a/src/devices/machine/watchdog.cpp +++ b/src/devices/machine/watchdog.cpp @@ -23,7 +23,7 @@ const device_type WATCHDOG_TIMER = &device_creator; // watchdog_timer_device - constructor //------------------------------------------------- -watchdog_timer_device::watchdog_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +watchdog_timer_device::watchdog_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WATCHDOG_TIMER, "Watchdog timer", tag, owner, clock, "watchdog", __FILE__), m_vblank_count(0), m_time(attotime::zero), @@ -37,7 +37,7 @@ watchdog_timer_device::watchdog_timer_device(const machine_config &mconfig, cons // to set the number of VBLANKs //------------------------------------------------- -void watchdog_timer_device::static_set_vblank_count(device_t &device, const char *screen_tag, INT32 count) +void watchdog_timer_device::static_set_vblank_count(device_t &device, const char *screen_tag, int32_t count) { watchdog_timer_device &watchdog = downcast(device); watchdog.m_screen_tag = screen_tag; diff --git a/src/devices/machine/watchdog.h b/src/devices/machine/watchdog.h index ee97e9026db..85f792203f8 100644 --- a/src/devices/machine/watchdog.h +++ b/src/devices/machine/watchdog.h @@ -31,16 +31,16 @@ class watchdog_timer_device : public device_t { public: // construction/destruction - watchdog_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + watchdog_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers - static void static_set_vblank_count(device_t &device, const char *screen_tag, INT32 count); + static void static_set_vblank_count(device_t &device, const char *screen_tag, int32_t count); static void static_set_time(device_t &device, attotime time); // watchdog control void watchdog_reset(); void watchdog_enable(bool enable = true); - INT32 get_vblank_counter() const { return m_counter; } + int32_t get_vblank_counter() const { return m_counter; } // read/write handlers DECLARE_WRITE8_MEMBER( reset_w ); @@ -63,13 +63,13 @@ private: void watchdog_vblank(screen_device &screen, bool vblank_state); // configuration data - INT32 m_vblank_count; // number of VBLANKs until resetting the machine + int32_t m_vblank_count; // number of VBLANKs until resetting the machine attotime m_time; // length of time until resetting the machine const char * m_screen_tag; // the tag of the screen this timer tracks // internal state bool m_enabled; // is the watchdog enabled? - INT32 m_counter; // counter for VBLANK tracking + int32_t m_counter; // counter for VBLANK tracking emu_timer * m_timer; // timer for triggering reset }; diff --git a/src/devices/machine/wd11c00_17.cpp b/src/devices/machine/wd11c00_17.cpp index 0f38c32c624..089d8dcbcdf 100644 --- a/src/devices/machine/wd11c00_17.cpp +++ b/src/devices/machine/wd11c00_17.cpp @@ -111,9 +111,9 @@ inline void wd11c00_17_device::increment_address() // read_data - //------------------------------------------------- -inline UINT8 wd11c00_17_device::read_data() +inline uint8_t wd11c00_17_device::read_data() { - UINT8 data = 0; + uint8_t data = 0; if (m_status & STATUS_BUSY) { @@ -130,7 +130,7 @@ inline UINT8 wd11c00_17_device::read_data() // write_data - //------------------------------------------------- -inline void wd11c00_17_device::write_data(UINT8 data) +inline void wd11c00_17_device::write_data(uint8_t data) { if (m_status & STATUS_BUSY) { @@ -175,7 +175,7 @@ inline void wd11c00_17_device::select() // wd11c00_17_device - constructor //------------------------------------------------- -wd11c00_17_device::wd11c00_17_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +wd11c00_17_device::wd11c00_17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WD11C00_17, "Western Digital WD11C00-17", tag, owner, clock, "wd11c00_17", __FILE__), m_out_irq5_cb(*this), m_out_drq3_cb(*this), @@ -240,7 +240,7 @@ void wd11c00_17_device::device_reset() READ8_MEMBER( wd11c00_17_device::io_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (offset) { @@ -304,7 +304,7 @@ WRITE8_MEMBER( wd11c00_17_device::io_w ) // dack_r - //------------------------------------------------- -UINT8 wd11c00_17_device::dack_r() +uint8_t wd11c00_17_device::dack_r() { return read_data(); } @@ -314,7 +314,7 @@ UINT8 wd11c00_17_device::dack_r() // dack_w - //------------------------------------------------- -void wd11c00_17_device::dack_w(UINT8 data) +void wd11c00_17_device::dack_w(uint8_t data) { write_data(data); } @@ -326,7 +326,7 @@ void wd11c00_17_device::dack_w(UINT8 data) READ8_MEMBER( wd11c00_17_device::read ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { diff --git a/src/devices/machine/wd11c00_17.h b/src/devices/machine/wd11c00_17.h index 7104e20c4dc..9bfcead7943 100644 --- a/src/devices/machine/wd11c00_17.h +++ b/src/devices/machine/wd11c00_17.h @@ -63,7 +63,7 @@ class wd11c00_17_device : public device_t { public: // construction/destruction - wd11c00_17_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd11c00_17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_irq5_callback(device_t &device, _Object object) { return downcast(device).m_out_irq5_cb.set_callback(object); } template static devcb_base &set_out_drq3_callback(device_t &device, _Object object) { return downcast(device).m_out_drq3_cb.set_callback(object); } @@ -80,8 +80,8 @@ public: DECLARE_READ8_MEMBER( io_r ); DECLARE_WRITE8_MEMBER( io_w ); - UINT8 dack_r(); - void dack_w(UINT8 data); + uint8_t dack_r(); + void dack_w(uint8_t data); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -103,8 +103,8 @@ protected: private: inline void check_interrupt(); inline void increment_address(); - inline UINT8 read_data(); - inline void write_data(UINT8 data); + inline uint8_t read_data(); + inline void write_data(uint8_t data); inline void software_reset(); inline void select(); @@ -120,8 +120,8 @@ private: devcb_read8 m_in_cs1010_cb; devcb_write8 m_out_cs1010_cb; - UINT8 m_status; - UINT8 m_mask; + uint8_t m_status; + uint8_t m_mask; offs_t m_ra; diff --git a/src/devices/machine/wd2010.cpp b/src/devices/machine/wd2010.cpp index a97b35b2517..5a65cffbd0e 100644 --- a/src/devices/machine/wd2010.cpp +++ b/src/devices/machine/wd2010.cpp @@ -142,7 +142,7 @@ const device_type WD2010 = &device_creator; // wd2010_device - constructor //------------------------------------------------- -wd2010_device::wd2010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +wd2010_device::wd2010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WD2010, "Western Digital WD2010", tag, owner, clock, "wd2010", __FILE__), m_out_intrq_cb(*this), m_out_bdrq_cb(*this), @@ -224,7 +224,7 @@ void wd2010_device::device_reset() READ8_MEMBER(wd2010_device::read) { - UINT8 data; + uint8_t data; switch (offset) { @@ -358,9 +358,9 @@ WRITE8_MEMBER(wd2010_device::write) //------------------------------------------------- // compute_correction - //------------------------------------------------- -void wd2010_device::compute_correction(UINT8 data) +void wd2010_device::compute_correction(uint8_t data) { - UINT8 newstatus = STATUS_RDY | STATUS_SC; + uint8_t newstatus = STATUS_RDY | STATUS_SC; complete_cmd(newstatus); } @@ -368,9 +368,9 @@ void wd2010_device::compute_correction(UINT8 data) //------------------------------------------------- // set_parameter - //------------------------------------------------- -void wd2010_device::set_parameter(UINT8 data) +void wd2010_device::set_parameter(uint8_t data) { - UINT8 newstatus = STATUS_RDY | STATUS_SC; + uint8_t newstatus = STATUS_RDY | STATUS_SC; complete_cmd(newstatus); } @@ -378,9 +378,9 @@ void wd2010_device::set_parameter(UINT8 data) //------------------------------------------------- // restore - //------------------------------------------------- -void wd2010_device::restore(UINT8 data) +void wd2010_device::restore(uint8_t data) { - UINT8 newstatus = STATUS_RDY | STATUS_SC; + uint8_t newstatus = STATUS_RDY | STATUS_SC; m_out_intrq_cb(CLEAR_LINE); // reset INTRQ, errors, set BUSY, CIP m_error = 0; @@ -450,9 +450,9 @@ void wd2010_device::restore(UINT8 data) // FIXME : step rate, drive change (!) // NOT IMPLEMENTED: IMPLIED SEEK ("wait until rising edge of SC signal") -void wd2010_device::seek(UINT8 data) +void wd2010_device::seek(uint8_t data) { - UINT8 newstatus = STATUS_RDY | STATUS_SC; + uint8_t newstatus = STATUS_RDY | STATUS_SC; m_out_intrq_cb(CLEAR_LINE); // reset INTRQ, errors, set BUSY, CIP m_error = 0; @@ -467,7 +467,7 @@ void wd2010_device::seek(UINT8 data) // Calculate number of steps by comparing the cylinder registers // HI/LO with the internally stored position. - UINT32 cylinder_registers = CYLINDER; + uint32_t cylinder_registers = CYLINDER; if (m_present_cylinder > cylinder_registers) { step_pulses = m_present_cylinder - cylinder_registers; @@ -535,9 +535,9 @@ void wd2010_device::seek(UINT8 data) //------------------------------------------------- // FIXME: multiple sector transfers, ID / CYL / HEAD / SIZE match // + ERROR HANDLING (...) -void wd2010_device::read_sector(UINT8 data) +void wd2010_device::read_sector(uint8_t data) { - UINT8 newstatus = STATUS_RDY | STATUS_SC; + uint8_t newstatus = STATUS_RDY | STATUS_SC; int intrq_at_end = 0; // (default) : (I = 1 INTRQ occurs when the command m_out_intrq_cb(CLEAR_LINE); // reset INTRQ, errors, set BUSY, CIP @@ -647,7 +647,7 @@ void wd2010_device::read_sector(UINT8 data) //------------------------------------------------- // FIXME: SEEK, SEEK_COMPLETE, Drive # change (!) // as well as CYL.register + internal CYL.register comparisons -void wd2010_device::write_sector(UINT8 data) +void wd2010_device::write_sector(uint8_t data) { m_error = 0; // De-assert ERROR + DRQ m_status &= ~(STATUS_DRQ); @@ -665,9 +665,9 @@ void wd2010_device::write_sector(UINT8 data) //------------------------------------------------- // write_sector (stage II) //------------------------------------------------- -void wd2010_device::complete_write_sector(UINT8 data) +void wd2010_device::complete_write_sector(uint8_t data) { - UINT8 newstatus = STATUS_RDY | STATUS_SC; + uint8_t newstatus = STATUS_RDY | STATUS_SC; m_out_bdrq_cb(0); // DE-Assert BDRQ (...and DRQ !) m_status &= ~(STATUS_DRQ); @@ -729,7 +729,7 @@ void wd2010_device::complete_write_sector(UINT8 data) // * does nothing right now * // ****************************************************** -void wd2010_device::auto_scan_id(UINT8 data) +void wd2010_device::auto_scan_id(uint8_t data) { static int last_drive; @@ -747,7 +747,7 @@ void wd2010_device::auto_scan_id(UINT8 data) // ****************************************************** // What to do here (just update present_cylinder with CYLINDER)...? -void wd2010_device::update_sdh(UINT8 new_sector_size, UINT8 new_head, UINT16 new_cylinder, UINT8 new_sectornr) +void wd2010_device::update_sdh(uint8_t new_sector_size, uint8_t new_head, uint16_t new_cylinder, uint8_t new_sectornr) { // "Update SDH" /* @@ -774,9 +774,9 @@ void wd2010_device::update_sdh(UINT8 new_sector_size, UINT8 new_head, UINT16 new // and writes this into the Present Cylinder Position Register. // FIXME: NO ID HANDLING (ID FOUND / NOT FOUND), NO BAD BLOCK; NO CRC -void wd2010_device::scan_id(UINT8 data) +void wd2010_device::scan_id(uint8_t data) { - UINT8 newstatus = STATUS_RDY; + uint8_t newstatus = STATUS_RDY; m_out_intrq_cb(CLEAR_LINE); m_error = 0; @@ -811,9 +811,9 @@ void wd2010_device::scan_id(UINT8 data) // SECTOR NUMBER REG.= number of bytes - 3 (for GAP 1 + 3) // = 40 decimal on DEC RD51 with WUTIL 3.2 //-------------------------------------------------------- -void wd2010_device::format(UINT8 data) +void wd2010_device::format(uint8_t data) { - UINT8 newstatus = STATUS_RDY; + uint8_t newstatus = STATUS_RDY; m_out_intrq_cb(CLEAR_LINE); m_error = 0; @@ -859,7 +859,7 @@ void wd2010_device::format(UINT8 data) return; } - // UINT8 format_sector_count = m_task_file[TASK_FILE_SECTOR_COUNT]; + // uint8_t format_sector_count = m_task_file[TASK_FILE_SECTOR_COUNT]; // do // { // < WRITE GAP 1 or GAP 3 > @@ -955,7 +955,7 @@ void wd2010_device::device_timer(emu_timer &timer, device_timer_id tid, int para } // Called by 'device_timer' - -void wd2010_device::complete_immediate(UINT8 status) +void wd2010_device::complete_immediate(uint8_t status) { // re-evaluate external signals at end of command status &= ~(STATUS_RDY | STATUS_WF | STATUS_SC); // RDY 0x40 / WF 0x20 / SC 0x10 @@ -983,7 +983,7 @@ void wd2010_device::complete_immediate(UINT8 status) m_out_bcr_cb(1); } -void wd2010_device::complete_cmd(UINT8 status) +void wd2010_device::complete_cmd(uint8_t status) { cmd_timer->adjust(attotime::from_msec(1), status); } diff --git a/src/devices/machine/wd2010.h b/src/devices/machine/wd2010.h index 204cb768385..ea9faa8a7f1 100644 --- a/src/devices/machine/wd2010.h +++ b/src/devices/machine/wd2010.h @@ -75,7 +75,7 @@ class wd2010_device : public device_t { public: // construction/destruction - wd2010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd2010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_intrq_callback(device_t &device, _Object object) { return downcast(device).m_out_intrq_cb.set_callback(object); } template static devcb_base &set_out_bdrq_callback(device_t &device, _Object object) { return downcast(device).m_out_bdrq_cb.set_callback(object); } @@ -106,16 +106,16 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - void compute_correction(UINT8 data); - void set_parameter(UINT8 data); - void restore(UINT8 data); - void seek(UINT8 data); - void read_sector(UINT8 data); - void write_sector(UINT8 data); - void scan_id(UINT8 data); - void update_sdh(UINT8 new_sector_size, UINT8 new_head, UINT16 new_cylinder, UINT8 new_sectornr); - void auto_scan_id(UINT8 data); - void format(UINT8 data); + void compute_correction(uint8_t data); + void set_parameter(uint8_t data); + void restore(uint8_t data); + void seek(uint8_t data); + void read_sector(uint8_t data); + void write_sector(uint8_t data); + void scan_id(uint8_t data); + void update_sdh(uint8_t new_sector_size, uint8_t new_head, uint16_t new_cylinder, uint8_t new_sectornr); + void auto_scan_id(uint8_t data); + void format(uint8_t data); devcb_write_line m_out_intrq_cb; devcb_write_line m_out_bdrq_cb; @@ -133,22 +133,22 @@ private: devcb_read_line m_in_tk000_cb; devcb_read_line m_in_sc_cb; - UINT8 m_status; - UINT8 m_error; - UINT8 m_task_file[8]; + uint8_t m_status; + uint8_t m_error; + uint8_t m_task_file[8]; emu_timer *cmd_timer; emu_timer *complete_write_when_buffer_ready_high; emu_timer *deassert_write_when_buffer_ready_low; emu_timer *deassert_read_when_buffer_ready_high; - void complete_write_sector(UINT8 status); - void complete_cmd(UINT8 status); - void complete_immediate(UINT8 status); + void complete_write_sector(uint8_t status); + void complete_cmd(uint8_t status); + void complete_immediate(uint8_t status); bool is_buffer_ready; - UINT32 m_present_cylinder; // Present Cylinder Position Register + uint32_t m_present_cylinder; // Present Cylinder Position Register }; // device type definition diff --git a/src/devices/machine/wd33c93.cpp b/src/devices/machine/wd33c93.cpp index 2ae5f9d370a..9489bea0485 100644 --- a/src/devices/machine/wd33c93.cpp +++ b/src/devices/machine/wd33c93.cpp @@ -137,7 +137,7 @@ #define SRCID_ER 0x80 /* convernience functions */ -UINT8 wd33c93_device::getunit( void ) +uint8_t wd33c93_device::getunit( void ) { /* return the destination unit id */ return regs[WD_DESTINATION_ID] & SRCID_MASK; @@ -215,7 +215,7 @@ void wd33c93_device::device_timer(emu_timer &timer, device_timer_id tid, int par } } -void wd33c93_device::complete_cmd( UINT8 status ) +void wd33c93_device::complete_cmd( uint8_t status ) { /* fire off a timer to complete the command */ cmd_timer->adjust( attotime::from_usec(1), status ); @@ -269,8 +269,8 @@ void wd33c93_device::disconnect_cmd() void wd33c93_device::select_cmd() { - UINT8 unit = getunit(); - UINT8 newstatus; + uint8_t unit = getunit(); + uint8_t newstatus; /* see if we can select that device */ if (select(unit)) @@ -305,8 +305,8 @@ void wd33c93_device::select_cmd() void wd33c93_device::selectxfer_cmd() { - UINT8 unit = getunit(); - UINT8 newstatus; + uint8_t unit = getunit(); + uint8_t newstatus; /* see if we can select that device */ if (select(unit)) @@ -398,7 +398,7 @@ void wd33c93_device::xferinfo_cmd() void wd33c93_device::dispatch_command() { /* get the command */ - UINT8 cmd = regs[WD_COMMAND] & 0x7f; + uint8_t cmd = regs[WD_COMMAND] & 0x7f; switch(cmd) { @@ -618,7 +618,7 @@ READ8_MEMBER(wd33c93_device::read) case 1: { - UINT8 ret; + uint8_t ret; /* if reading status, clear irq flag */ if ( sasr == WD_SCSI_STATUS ) @@ -723,7 +723,7 @@ READ8_MEMBER(wd33c93_device::read) return 0; } -wd33c93_device::wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wd33c93_device::wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : legacy_scsi_host_adapter(mconfig, WD33C93, "33C93 SCSI", tag, owner, clock, "wd33c93", __FILE__), m_irq_cb(*this) { @@ -762,7 +762,7 @@ void wd33c93_device::device_start() save_item( NAME( read_pending ) ); } -void wd33c93_device::dma_read_data( int bytes, UINT8 *pData ) +void wd33c93_device::dma_read_data( int bytes, uint8_t *pData ) { int len = bytes; @@ -787,7 +787,7 @@ void wd33c93_device::dma_read_data( int bytes, UINT8 *pData ) set_xfer_count(len); } -void wd33c93_device::dma_write_data(int bytes, UINT8 *pData) +void wd33c93_device::dma_write_data(int bytes, uint8_t *pData) { write_data(pData, bytes); } diff --git a/src/devices/machine/wd33c93.h b/src/devices/machine/wd33c93.h index b749131d692..b8929d8b791 100644 --- a/src/devices/machine/wd33c93.h +++ b/src/devices/machine/wd33c93.h @@ -54,15 +54,15 @@ class wd33c93_device : public legacy_scsi_host_adapter { public: // construction/destruction - wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd33c93_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); - void dma_read_data( int bytes, UINT8 *pData ); - void dma_write_data(int bytes, UINT8 *pData); + void dma_read_data( int bytes, uint8_t *pData ); + void dma_write_data(int bytes, uint8_t *pData); void clear_dma(); int get_dma_count(); @@ -72,11 +72,11 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT8 getunit( void ); + uint8_t getunit( void ); void set_xfer_count( int count ); int get_xfer_count( void ); void complete_immediate( int status ); - void complete_cmd( UINT8 status ); + void complete_cmd( uint8_t status ); void unimplemented_cmd(); void invalid_cmd(); void reset_cmd(); @@ -88,14 +88,14 @@ private: void xferinfo_cmd(); void dispatch_command(); - UINT8 sasr; - UINT8 regs[WD_AUXILIARY_STATUS+1]; - UINT8 fifo[FIFO_SIZE]; + uint8_t sasr; + uint8_t regs[WD_AUXILIARY_STATUS+1]; + uint8_t fifo[FIFO_SIZE]; int fifo_pos; - UINT8 temp_input[TEMP_INPUT_LEN]; + uint8_t temp_input[TEMP_INPUT_LEN]; int temp_input_pos; - UINT8 busphase; - UINT8 identify; + uint8_t busphase; + uint8_t identify; int read_pending; emu_timer *cmd_timer; emu_timer *service_req_timer; diff --git a/src/devices/machine/wd7600.cpp b/src/devices/machine/wd7600.cpp index cfd297a6cbe..8d60250dff1 100644 --- a/src/devices/machine/wd7600.cpp +++ b/src/devices/machine/wd7600.cpp @@ -95,7 +95,7 @@ void wd7600_device::static_set_keybctag(device_t &device, const char *tag) chip.m_keybctag = tag; } -wd7600_device::wd7600_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +wd7600_device::wd7600_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WD7600, "WD 7600 chipset", tag, owner, clock, "wd7600", __FILE__), m_read_ior(*this), m_write_iow(*this), @@ -153,7 +153,7 @@ void wd7600_device::device_start() m_keybc = downcast(machine().device(m_keybctag)); m_ram = ram_dev->pointer(); - UINT32 ram_size = ram_dev->size(); + uint32_t ram_size = ram_dev->size(); // install base memory m_space->install_ram(0x000000, 0x09ffff, m_ram); @@ -295,7 +295,7 @@ WRITE8_MEMBER( wd7600_device::keyb_data_w ) READ8_MEMBER( wd7600_device::keyb_data_r ) { - UINT8 ret = m_keybc->data_r(space,0); + uint8_t ret = m_keybc->data_r(space,0); // if(LOG) logerror("WD7600 '%s': keyboard data read %02x\n", tag(), ret); return ret; } @@ -372,7 +372,7 @@ READ8_MEMBER( wd7600_device::dma_read_word ) if (m_dma_channel == -1) return 0xff; - UINT16 result = m_space->read_word((page_offset() & 0xfe0000) | (offset << 1)); + uint16_t result = m_space->read_word((page_offset() & 0xfe0000) | (offset << 1)); m_dma_high_byte = result >> 8; return result; @@ -452,7 +452,7 @@ WRITE8_MEMBER( wd7600_device::a20_reset_w ) READ8_MEMBER( wd7600_device::a20_reset_r ) { - UINT8 ret = 0; + uint8_t ret = 0; if(m_alt_a20) ret |= 0x02; return ret; diff --git a/src/devices/machine/wd7600.h b/src/devices/machine/wd7600.h index 25050c9fb0c..8363018d30d 100644 --- a/src/devices/machine/wd7600.h +++ b/src/devices/machine/wd7600.h @@ -63,7 +63,7 @@ class wd7600_device : public device_t { public: // construction/destruction - wd7600_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd7600_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; @@ -110,9 +110,9 @@ public: DECLARE_READ8_MEMBER( dma1_ior1_r ) { return m_read_ior(1); } DECLARE_READ8_MEMBER( dma1_ior2_r ) { return m_read_ior(2); } DECLARE_READ8_MEMBER( dma1_ior3_r ) { return m_read_ior(3); } - DECLARE_READ8_MEMBER( dma2_ior1_r ) { UINT16 result = m_read_ior(5); m_dma_high_byte = result >> 8; return result; } - DECLARE_READ8_MEMBER( dma2_ior2_r ) { UINT16 result = m_read_ior(6); m_dma_high_byte = result >> 8; return result; } - DECLARE_READ8_MEMBER( dma2_ior3_r ) { UINT16 result = m_read_ior(7); m_dma_high_byte = result >> 8; return result; } + DECLARE_READ8_MEMBER( dma2_ior1_r ) { uint16_t result = m_read_ior(5); m_dma_high_byte = result >> 8; return result; } + DECLARE_READ8_MEMBER( dma2_ior2_r ) { uint16_t result = m_read_ior(6); m_dma_high_byte = result >> 8; return result; } + DECLARE_READ8_MEMBER( dma2_ior3_r ) { uint16_t result = m_read_ior(7); m_dma_high_byte = result >> 8; return result; } DECLARE_WRITE8_MEMBER( dma1_iow0_w ) { m_write_iow(0, data, 0xffff); } DECLARE_WRITE8_MEMBER( dma1_iow1_w ) { m_write_iow(1, data, 0xffff); } DECLARE_WRITE8_MEMBER( dma1_iow2_w ) { m_write_iow(2, data, 0xffff); } @@ -207,30 +207,30 @@ private: const char *m_isatag; const char *m_biostag; const char *m_keybctag; - UINT8 m_portb; + uint8_t m_portb; int m_iochck; int m_nmi_mask; int m_alt_a20; int m_ext_gatea20; int m_kbrst; int m_refresh_toggle; - UINT16 m_refresh_ctrl; - UINT16 m_memory_ctrl; - UINT16 m_chip_sel; - UINT16 m_split_start; - UINT8 m_bank_start[4]; - UINT16 m_diagnostic; + uint16_t m_refresh_ctrl; + uint16_t m_memory_ctrl; + uint16_t m_chip_sel; + uint16_t m_split_start; + uint8_t m_bank_start[4]; + uint16_t m_diagnostic; int m_dma_eop; - UINT8 m_dma_page[0x10]; - UINT8 m_dma_high_byte; + uint8_t m_dma_page[0x10]; + uint8_t m_dma_high_byte; int m_dma_channel; address_space *m_space; address_space *m_space_io; - UINT8 *m_isa; - UINT8 *m_bios; - UINT8 *m_ram; + uint8_t *m_isa; + uint8_t *m_bios; + uint8_t *m_ram; at_keyboard_controller_device *m_keybc; }; diff --git a/src/devices/machine/wd_fdc.cpp b/src/devices/machine/wd_fdc.cpp index 3db1b1113f6..c748b155aca 100644 --- a/src/devices/machine/wd_fdc.cpp +++ b/src/devices/machine/wd_fdc.cpp @@ -65,7 +65,7 @@ const device_type WD1773 = &device_creator; // Show state machine #define TRACE_STATE 0 -wd_fdc_t::wd_fdc_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) : +wd_fdc_t::wd_fdc_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), intrq_cb(*this), drq_cb(*this), @@ -1058,7 +1058,7 @@ void wd_fdc_t::do_cmd_w() } } -void wd_fdc_t::cmd_w(UINT8 val) +void wd_fdc_t::cmd_w(uint8_t val) { if (TRACE_COMP) logerror("Initiating command %02x\n", val); if (inverted_bus) val ^= 0xff; @@ -1088,7 +1088,7 @@ void wd_fdc_t::cmd_w(UINT8 val) } } -UINT8 wd_fdc_t::status_r() +uint8_t wd_fdc_t::status_r() { if(intrq && !(intrq_cond & I_IMM)) { intrq = false; @@ -1125,7 +1125,7 @@ UINT8 wd_fdc_t::status_r() status &= ~S_NRDY; } - UINT8 val = status; + uint8_t val = status; if (inverted_bus) val ^= 0xff; return val; @@ -1137,7 +1137,7 @@ void wd_fdc_t::do_track_w() track_buffer = -1; } -void wd_fdc_t::track_w(UINT8 val) +void wd_fdc_t::track_w(uint8_t val) { if (inverted_bus) val ^= 0xff; @@ -1149,9 +1149,9 @@ void wd_fdc_t::track_w(UINT8 val) delay_cycles(t_track, dden ? delay_register_commit*2 : delay_register_commit); } -UINT8 wd_fdc_t::track_r() +uint8_t wd_fdc_t::track_r() { - UINT8 val = track; + uint8_t val = track; if (inverted_bus) val ^= 0xff; return val; @@ -1163,7 +1163,7 @@ void wd_fdc_t::do_sector_w() sector_buffer = -1; } -void wd_fdc_t::sector_w(UINT8 val) +void wd_fdc_t::sector_w(uint8_t val) { if (inverted_bus) val ^= 0xff; @@ -1181,15 +1181,15 @@ void wd_fdc_t::sector_w(UINT8 val) delay_cycles(t_sector, dden ? delay_register_commit*2 : delay_register_commit); } -UINT8 wd_fdc_t::sector_r() +uint8_t wd_fdc_t::sector_r() { - UINT8 val = sector; + uint8_t val = sector; if (inverted_bus) val ^= 0xff; return val; } -void wd_fdc_t::data_w(UINT8 val) +void wd_fdc_t::data_w(uint8_t val) { if (inverted_bus) val ^= 0xff; @@ -1197,17 +1197,17 @@ void wd_fdc_t::data_w(UINT8 val) drop_drq(); } -UINT8 wd_fdc_t::data_r() +uint8_t wd_fdc_t::data_r() { drop_drq(); - UINT8 val = data; + uint8_t val = data; if (inverted_bus) val ^= 0xff; return val; } -void wd_fdc_t::gen_w(int reg, UINT8 val) +void wd_fdc_t::gen_w(int reg, uint8_t val) { switch(reg) { case 0: cmd_w(val); break; @@ -1217,7 +1217,7 @@ void wd_fdc_t::gen_w(int reg, UINT8 val) } } -UINT8 wd_fdc_t::gen_r(int reg) +uint8_t wd_fdc_t::gen_r(int reg) { switch(reg) { case 0: return status_r(); @@ -1495,17 +1495,17 @@ bool wd_fdc_t::write_one_bit(const attotime &limit) return false; } -void wd_fdc_t::live_write_raw(UINT16 raw) +void wd_fdc_t::live_write_raw(uint16_t raw) { if (TRACE_WRITE) logerror("write raw %04x, CRC=%04x\n", raw, cur_live.crc); cur_live.shift_reg = raw; cur_live.data_bit_context = raw & 1; } -void wd_fdc_t::live_write_mfm(UINT8 mfm) +void wd_fdc_t::live_write_mfm(uint8_t mfm) { bool context = cur_live.data_bit_context; - UINT16 raw = 0; + uint16_t raw = 0; for(int i=0; i<8; i++) { bool bit = mfm & (0x80 >> i); if(!(bit || context)) @@ -1520,9 +1520,9 @@ void wd_fdc_t::live_write_mfm(UINT8 mfm) } -void wd_fdc_t::live_write_fm(UINT8 fm) +void wd_fdc_t::live_write_fm(uint8_t fm) { - UINT16 raw = 0xaaaa; + uint16_t raw = 0xaaaa; for(int i=0; i<8; i++) if(fm & (0x80 >> i)) raw |= 0x4000 >> (2*i); @@ -2123,7 +2123,7 @@ void wd_fdc_t::drop_drq() } } -int wd_fdc_t::calc_sector_size(UINT8 size, UINT8 command) const +int wd_fdc_t::calc_sector_size(uint8_t size, uint8_t command) const { return 128 << (size & 3); } @@ -2133,7 +2133,7 @@ int wd_fdc_t::settle_time() const return 60000; } -wd_fdc_analog_t::wd_fdc_analog_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) : +wd_fdc_analog_t::wd_fdc_analog_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) : wd_fdc_t(mconfig, type, name, tag, owner, clock, shortname, source) { clock_ratio = 1; @@ -2185,7 +2185,7 @@ bool wd_fdc_analog_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_de return cur_pll.write_next_bit(bit, tm, floppy, limit); } -wd_fdc_digital_t::wd_fdc_digital_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) : +wd_fdc_digital_t::wd_fdc_digital_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) : wd_fdc_t(mconfig, type, name, tag, owner, clock, shortname, source) { clock_ratio = 4; @@ -2278,7 +2278,7 @@ int wd_fdc_digital_t::digital_pll_t::get_next_bit(attotime &tm, floppy_image_dev if(transition_time == 0xffff && !when.is_never() && etime >= when) transition_time = counter; if(slot < 8) { - UINT8 mask = 1 << slot; + uint8_t mask = 1 << slot; if(phase_add & mask) counter += 226; else if(phase_sub & mask) @@ -2302,15 +2302,15 @@ int wd_fdc_digital_t::digital_pll_t::get_next_bit(attotime &tm, floppy_image_dev int bit = transition_time != 0xffff; if(transition_time != 0xffff) { - static const UINT8 pha[8] = { 0xf, 0x7, 0x3, 0x1, 0, 0, 0, 0 }; - static const UINT8 phs[8] = { 0, 0, 0, 0, 0x1, 0x3, 0x7, 0xf }; - static const UINT8 freqa[4][8] = { + static const uint8_t pha[8] = { 0xf, 0x7, 0x3, 0x1, 0, 0, 0, 0 }; + static const uint8_t phs[8] = { 0, 0, 0, 0, 0x1, 0x3, 0x7, 0xf }; + static const uint8_t freqa[4][8] = { { 0xf, 0x7, 0x3, 0x1, 0, 0, 0, 0 }, { 0x7, 0x3, 0x1, 0, 0, 0, 0, 0 }, { 0x7, 0x3, 0x1, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0 } }; - static const UINT8 freqs[4][8] = { + static const uint8_t freqs[4][8] = { { 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0x1, 0x3, 0x7 }, { 0, 0, 0, 0, 0, 0x1, 0x3, 0x7 }, @@ -2364,7 +2364,7 @@ bool wd_fdc_digital_t::digital_pll_t::write_next_bit(bool bit, attotime &tm, flo attotime etime = ctime+delays[slot]; if(etime > limit) return true; - UINT16 pre_counter = counter; + uint16_t pre_counter = counter; counter += increment; if(bit && !(pre_counter & 0x400) && (counter & 0x400)) if(write_position < ARRAY_LENGTH(write_buffer)) @@ -2394,7 +2394,7 @@ void wd_fdc_digital_t::digital_pll_t::commit(floppy_image_device *floppy, const write_position = 0; } -fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1771, "FD1771", tag, owner, clock, "fd1771", __FILE__) +fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1771, "FD1771", tag, owner, clock, "fd1771", __FILE__) { const static int fd1771_step_times[4] = { 12000, 12000, 20000, 40000 }; @@ -2411,7 +2411,7 @@ fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -int fd1771_t::calc_sector_size(UINT8 size, UINT8 command) const +int fd1771_t::calc_sector_size(uint8_t size, uint8_t command) const { if(command & 0x08) return 128 << (size & 3); @@ -2419,7 +2419,7 @@ int fd1771_t::calc_sector_size(UINT8 size, UINT8 command) const return size ? size << 4 : 4096; } -fd1781_t::fd1781_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1781, "FD1781", tag, owner, clock, "fd1781", __FILE__) +fd1781_t::fd1781_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1781, "FD1781", tag, owner, clock, "fd1781", __FILE__) { const static int fd1781_step_times[4] = { 6000, 12000, 20000, 40000 }; @@ -2436,7 +2436,7 @@ fd1781_t::fd1781_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -int fd1781_t::calc_sector_size(UINT8 size, UINT8 command) const +int fd1781_t::calc_sector_size(uint8_t size, uint8_t command) const { if(command & 0x08) return 128 << (size & 3); @@ -2447,7 +2447,7 @@ int fd1781_t::calc_sector_size(UINT8 size, UINT8 command) const const int wd_fdc_t::fd179x_step_times[4] = { 6000, 12000, 20000, 30000 }; const int wd_fdc_t::fd176x_step_times[4] = { 12000, 24000, 40000, 60000 }; -fd1791_t::fd1791_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1791, "FD1791", tag, owner, clock, "fd1791", __FILE__) +fd1791_t::fd1791_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1791, "FD1791", tag, owner, clock, "fd1791", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2463,7 +2463,7 @@ fd1791_t::fd1791_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1792, "FD1792", tag, owner, clock, "fd1792", __FILE__) +fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1792, "FD1792", tag, owner, clock, "fd1792", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2479,7 +2479,7 @@ fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1793, "FD1793", tag, owner, clock, "fd1793", __FILE__) +fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1793, "FD1793", tag, owner, clock, "fd1793", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2495,7 +2495,7 @@ fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -kr1818vg93_t::kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, KR1818VG93, "KR1818VG93", tag, owner, clock, "kr1818vg93", __FILE__) +kr1818vg93_t::kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, KR1818VG93, "KR1818VG93", tag, owner, clock, "kr1818vg93", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2511,7 +2511,7 @@ kr1818vg93_t::kr1818vg93_t(const machine_config &mconfig, const char *tag, devic nonsticky_immint = true; } -fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1794, "FD1794", tag, owner, clock, "fd1794", __FILE__) +fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1794, "FD1794", tag, owner, clock, "fd1794", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2527,7 +2527,7 @@ fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1795, "FD1795", tag, owner, clock, "fd1795", __FILE__) +fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1795, "FD1795", tag, owner, clock, "fd1795", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2543,7 +2543,7 @@ fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -int fd1795_t::calc_sector_size(UINT8 size, UINT8 command) const +int fd1795_t::calc_sector_size(uint8_t size, uint8_t command) const { if(command & 0x08) return 128 << (size & 3); @@ -2551,7 +2551,7 @@ int fd1795_t::calc_sector_size(UINT8 size, UINT8 command) const return 128 << ((size + 1) & 3); } -fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1797, "FD1797", tag, owner, clock, "fd1797", __FILE__) +fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1797, "FD1797", tag, owner, clock, "fd1797", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2567,7 +2567,7 @@ fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -int fd1797_t::calc_sector_size(UINT8 size, UINT8 command) const +int fd1797_t::calc_sector_size(uint8_t size, uint8_t command) const { if(command & 0x08) return 128 << (size & 3); @@ -2575,7 +2575,7 @@ int fd1797_t::calc_sector_size(UINT8 size, UINT8 command) const return 128 << ((size + 1) & 3); } -mb8866_t::mb8866_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8866, "MB8866", tag, owner, clock, "mb8866", __FILE__) +mb8866_t::mb8866_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, MB8866, "MB8866", tag, owner, clock, "mb8866", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2591,7 +2591,7 @@ mb8866_t::mb8866_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8876, "MB8876", tag, owner, clock, "mb8876", __FILE__) +mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, MB8876, "MB8876", tag, owner, clock, "mb8876", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2607,7 +2607,7 @@ mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8877, "MB8877", tag, owner, clock, "mb8877", __FILE__) +mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, MB8877, "MB8877", tag, owner, clock, "mb8877", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 4; @@ -2623,7 +2623,7 @@ mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1761, "FD1761", tag, owner, clock, "fd1761", __FILE__) +fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1761, "FD1761", tag, owner, clock, "fd1761", __FILE__) { step_times = fd176x_step_times; delay_register_commit = 16; @@ -2639,7 +2639,7 @@ fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1763, "FD1763", tag, owner, clock, "fd1763", __FILE__) +fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1763, "FD1763", tag, owner, clock, "fd1763", __FILE__) { step_times = fd176x_step_times; delay_register_commit = 16; @@ -2655,7 +2655,7 @@ fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1765, "FD1765", tag, owner, clock, "fd1765", __FILE__) +fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1765, "FD1765", tag, owner, clock, "fd1765", __FILE__) { step_times = fd176x_step_times; delay_register_commit = 16; @@ -2671,7 +2671,7 @@ fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -int fd1765_t::calc_sector_size(UINT8 size, UINT8 command) const +int fd1765_t::calc_sector_size(uint8_t size, uint8_t command) const { if(command & 0x08) return 128 << (size & 3); @@ -2679,7 +2679,7 @@ int fd1765_t::calc_sector_size(UINT8 size, UINT8 command) const return 128 << ((size + 1) & 3); } -fd1767_t::fd1767_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1767, "FD1767", tag, owner, clock, "fd1767", __FILE__) +fd1767_t::fd1767_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, FD1767, "FD1767", tag, owner, clock, "fd1767", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 16; @@ -2695,7 +2695,7 @@ fd1767_t::fd1767_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -int fd1767_t::calc_sector_size(UINT8 size, UINT8 command) const +int fd1767_t::calc_sector_size(uint8_t size, uint8_t command) const { if(command & 0x08) return 128 << (size & 3); @@ -2703,7 +2703,7 @@ int fd1767_t::calc_sector_size(UINT8 size, UINT8 command) const return 128 << ((size + 1) & 3); } -wd2791_t::wd2791_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2791, "WD2791", tag, owner, clock, "wd2791", __FILE__) +wd2791_t::wd2791_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, WD2791, "WD2791", tag, owner, clock, "wd2791", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 16; @@ -2719,7 +2719,7 @@ wd2791_t::wd2791_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2793, "WD2793", tag, owner, clock, "wd2793", __FILE__) +wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, WD2793, "WD2793", tag, owner, clock, "wd2793", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 16; @@ -2735,7 +2735,7 @@ wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2795, "WD2795", tag, owner, clock, "wd2795", __FILE__) +wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, WD2795, "WD2795", tag, owner, clock, "wd2795", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 16; @@ -2751,7 +2751,7 @@ wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -int wd2795_t::calc_sector_size(UINT8 size, UINT8 command) const +int wd2795_t::calc_sector_size(uint8_t size, uint8_t command) const { if(command & 0x08) return 128 << (size & 3); @@ -2759,7 +2759,7 @@ int wd2795_t::calc_sector_size(UINT8 size, UINT8 command) const return 128 << ((size + 1) & 3); } -wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2797, "WD2797", tag, owner, clock, "wd2797", __FILE__) +wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_analog_t(mconfig, WD2797, "WD2797", tag, owner, clock, "wd2797", __FILE__) { step_times = fd179x_step_times; delay_register_commit = 16; @@ -2775,7 +2775,7 @@ wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -int wd2797_t::calc_sector_size(UINT8 size, UINT8 command) const +int wd2797_t::calc_sector_size(uint8_t size, uint8_t command) const { if(command & 0x08) return 128 << (size & 3); @@ -2783,7 +2783,7 @@ int wd2797_t::calc_sector_size(UINT8 size, UINT8 command) const return 128 << ((size + 1) & 3); } -wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1770, "WD1770", tag, owner, clock, "wd1770", __FILE__) +wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_digital_t(mconfig, WD1770, "WD1770", tag, owner, clock, "wd1770", __FILE__) { step_times = wd_digital_step_times; delay_register_commit = 32; @@ -2799,7 +2799,7 @@ wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *own nonsticky_immint = false; } -wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1772, "WD1772", tag, owner, clock, "wd1772", __FILE__) +wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_digital_t(mconfig, WD1772, "WD1772", tag, owner, clock, "wd1772", __FILE__) { const static int wd1772_step_times[4] = { 12000, 24000, 4000, 6000 }; @@ -2822,7 +2822,7 @@ int wd1772_t::settle_time() const return 30000; } -wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1773, "WD1773", tag, owner, clock, "wd1773", __FILE__) +wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wd_fdc_digital_t(mconfig, WD1773, "WD1773", tag, owner, clock, "wd1773", __FILE__) { step_times = wd_digital_step_times; delay_register_commit = 32; diff --git a/src/devices/machine/wd_fdc.h b/src/devices/machine/wd_fdc.h index 8aab3309264..3987fb89ea7 100644 --- a/src/devices/machine/wd_fdc.h +++ b/src/devices/machine/wd_fdc.h @@ -133,7 +133,7 @@ class wd_fdc_t : public device_t { public: - wd_fdc_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); + wd_fdc_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); template static devcb_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast(device).intrq_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); } @@ -147,28 +147,28 @@ public: void set_floppy(floppy_image_device *floppy); void set_force_ready(bool force_ready); - void cmd_w(UINT8 val); - UINT8 status_r(); + void cmd_w(uint8_t val); + uint8_t status_r(); DECLARE_READ8_MEMBER( status_r ) { return status_r(); } DECLARE_WRITE8_MEMBER( cmd_w ) { cmd_w(data); } - void track_w(UINT8 val); - UINT8 track_r(); + void track_w(uint8_t val); + uint8_t track_r(); DECLARE_READ8_MEMBER( track_r ) { return track_r(); } DECLARE_WRITE8_MEMBER( track_w ) { track_w(data); } - void sector_w(UINT8 val); - UINT8 sector_r(); + void sector_w(uint8_t val); + uint8_t sector_r(); DECLARE_READ8_MEMBER( sector_r ) { return sector_r(); } DECLARE_WRITE8_MEMBER( sector_w ) { sector_w(data); } - void data_w(UINT8 val); - UINT8 data_r(); + void data_w(uint8_t val); + uint8_t data_r(); DECLARE_READ8_MEMBER( data_r ) { return data_r(); } DECLARE_WRITE8_MEMBER( data_w ) { data_w(data); } - void gen_w(int reg, UINT8 val); - UINT8 gen_r(int reg); + void gen_w(int reg, uint8_t val); + uint8_t gen_r(int reg); DECLARE_READ8_MEMBER( read ) { return gen_r(offset);} DECLARE_WRITE8_MEMBER( write ) { gen_w(offset,data); } @@ -206,7 +206,7 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - virtual int calc_sector_size(UINT8 size, UINT8 command) const; + virtual int calc_sector_size(uint8_t size, uint8_t command) const; virtual int settle_time() const; virtual void pll_reset(bool fm, bool enmf, const attotime &when) = 0; @@ -332,12 +332,12 @@ private: attotime tm; int state, next_state; - UINT16 shift_reg; - UINT16 crc; + uint16_t shift_reg; + uint16_t crc; int bit_counter, byte_counter, previous_type; bool data_separator_phase, data_bit_context; - UINT8 data_reg; - UINT8 idbuf[6]; + uint8_t data_reg; + uint8_t idbuf[6]; }; enum { @@ -371,7 +371,7 @@ private: bool dden, status_type_1, intrq, drq, hld, hlt, enp, force_ready; int main_state, sub_state; - UINT8 command, track, sector, data, status, intrq_cond; + uint8_t command, track, sector, data, status, intrq_cond; int last_dir; int counter, motor_timeout, sector_size; @@ -383,7 +383,7 @@ private: devcb_write_line intrq_cb, drq_cb, hld_cb, enp_cb; devcb_read_line enmf_cb; - UINT8 format_last_byte; + uint8_t format_last_byte; int format_last_byte_count; std::string format_description_string; @@ -438,9 +438,9 @@ private: bool read_one_bit(const attotime &limit); bool write_one_bit(const attotime &limit); - void live_write_raw(UINT16 raw); - void live_write_mfm(UINT8 mfm); - void live_write_fm(UINT8 fm); + void live_write_raw(uint16_t raw); + void live_write_mfm(uint8_t mfm); + void live_write_fm(uint8_t fm); void drop_drq(); void set_drq(); @@ -448,7 +448,7 @@ private: class wd_fdc_analog_t : public wd_fdc_t { public: - wd_fdc_analog_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); + wd_fdc_analog_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); protected: virtual void pll_reset(bool fm, bool enmf, const attotime &when) override; @@ -466,7 +466,7 @@ private: class wd_fdc_digital_t : public wd_fdc_t { public: - wd_fdc_digital_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); + wd_fdc_digital_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); protected: static const int wd_digital_step_times[4]; @@ -482,12 +482,12 @@ protected: private: struct digital_pll_t { - UINT16 counter; - UINT16 increment; - UINT16 transition_time; - UINT8 history; - UINT8 slot; - UINT8 phase_add, phase_sub, freq_add, freq_sub; + uint16_t counter; + uint16_t increment; + uint16_t transition_time; + uint8_t history; + uint8_t slot; + uint8_t phase_add, phase_sub, freq_add, freq_sub; attotime ctime; attotime delays[42]; @@ -510,138 +510,138 @@ private: class fd1771_t : public wd_fdc_analog_t { public: - fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual int calc_sector_size(UINT8 size, UINT8 command) const override; + virtual int calc_sector_size(uint8_t size, uint8_t command) const override; }; class fd1781_t : public wd_fdc_analog_t { public: - fd1781_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1781_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual int calc_sector_size(UINT8 size, UINT8 command) const override; + virtual int calc_sector_size(uint8_t size, uint8_t command) const override; }; class fd1791_t : public wd_fdc_analog_t { public: - fd1791_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1791_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fd1792_t : public wd_fdc_analog_t { public: - fd1792_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1792_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fd1793_t : public wd_fdc_analog_t { public: - fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class kr1818vg93_t : public wd_fdc_analog_t { public: - kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fd1794_t : public wd_fdc_analog_t { public: - fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fd1795_t : public wd_fdc_analog_t { public: - fd1795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1795_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual int calc_sector_size(UINT8 size, UINT8 command) const override; + virtual int calc_sector_size(uint8_t size, uint8_t command) const override; }; class fd1797_t : public wd_fdc_analog_t { public: - fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual int calc_sector_size(UINT8 size, UINT8 command) const override; + virtual int calc_sector_size(uint8_t size, uint8_t command) const override; }; class mb8866_t : public wd_fdc_analog_t { public: - mb8866_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8866_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mb8876_t : public wd_fdc_analog_t { public: - mb8876_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8876_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mb8877_t : public wd_fdc_analog_t { public: - mb8877_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb8877_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fd1761_t : public wd_fdc_analog_t { public: - fd1761_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1761_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fd1763_t : public wd_fdc_analog_t { public: - fd1763_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1763_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class fd1765_t : public wd_fdc_analog_t { public: - fd1765_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1765_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual int calc_sector_size(UINT8 size, UINT8 command) const override; + virtual int calc_sector_size(uint8_t size, uint8_t command) const override; }; class fd1767_t : public wd_fdc_analog_t { public: - fd1767_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + fd1767_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual int calc_sector_size(UINT8 size, UINT8 command) const override; + virtual int calc_sector_size(uint8_t size, uint8_t command) const override; }; class wd2791_t : public wd_fdc_analog_t { public: - wd2791_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd2791_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER(enmf_w) { enmf = state ? false : true; } }; class wd2793_t : public wd_fdc_analog_t { public: - wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER(enmf_w) { enmf = state ? false : true; } }; class wd2795_t : public wd_fdc_analog_t { public: - wd2795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd2795_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual int calc_sector_size(UINT8 size, UINT8 command) const override; + virtual int calc_sector_size(uint8_t size, uint8_t command) const override; }; class wd2797_t : public wd_fdc_analog_t { public: - wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual int calc_sector_size(UINT8 size, UINT8 command) const override; + virtual int calc_sector_size(uint8_t size, uint8_t command) const override; }; class wd1770_t : public wd_fdc_digital_t { public: - wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class wd1772_t : public wd_fdc_digital_t { public: - wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual int settle_time() const override; @@ -649,7 +649,7 @@ protected: class wd1773_t : public wd_fdc_digital_t { public: - wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type FD1771; diff --git a/src/devices/machine/wozfdc.cpp b/src/devices/machine/wozfdc.cpp index d85b8110e82..22a76b941fe 100644 --- a/src/devices/machine/wozfdc.cpp +++ b/src/devices/machine/wozfdc.cpp @@ -44,17 +44,17 @@ const tiny_rom_entry *wozfdc_device::device_rom_region() const // LIVE DEVICE //************************************************************************** -wozfdc_device::wozfdc_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) : +wozfdc_device::wozfdc_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) { } -diskii_fdc::diskii_fdc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +diskii_fdc::diskii_fdc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wozfdc_device(mconfig, DISKII_FDC, "Apple Disk II floppy controller", tag, owner, clock, "d2fdc", __FILE__) { } -appleiii_fdc::appleiii_fdc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +appleiii_fdc::appleiii_fdc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : wozfdc_device(mconfig, DISKII_FDC, "Apple III floppy controller", tag, owner, clock, "a3fdc", __FILE__) { } @@ -313,17 +313,17 @@ void wozfdc_device::control(int offset) } } -UINT64 wozfdc_device::time_to_cycles(const attotime &tm) +uint64_t wozfdc_device::time_to_cycles(const attotime &tm) { // Clock is falling edges of the ~2Mhz clock // The 1021800 must be the controlling 6502's speed - UINT64 cycles = tm.as_ticks(clock()*2); + uint64_t cycles = tm.as_ticks(clock()*2); cycles = (cycles+1) >> 1; return cycles; } -attotime wozfdc_device::cycles_to_time(UINT64 cycles) +attotime wozfdc_device::cycles_to_time(uint64_t cycles) { return attotime::from_ticks(cycles*2+1, clock()*2); } @@ -347,9 +347,9 @@ void wozfdc_device::lss_sync() attotime next_flux = floppy ? floppy->get_next_transition(cycles_to_time(cycles-1)) : attotime::never; - UINT64 cycles_limit = time_to_cycles(machine().time()); - UINT64 cycles_next_flux = next_flux != attotime::never ? time_to_cycles(next_flux) : UINT64(-1); - UINT64 cycles_next_flux_down = cycles_next_flux != UINT64(-1) ? cycles_next_flux+1 : UINT64(-1); + uint64_t cycles_limit = time_to_cycles(machine().time()); + uint64_t cycles_next_flux = next_flux != attotime::never ? time_to_cycles(next_flux) : uint64_t(-1); + uint64_t cycles_next_flux_down = cycles_next_flux != uint64_t(-1) ? cycles_next_flux+1 : uint64_t(-1); if(cycles >= cycles_next_flux && cycles < cycles_next_flux_down) address &= ~0x10; @@ -357,14 +357,14 @@ void wozfdc_device::lss_sync() address |= 0x10; while(cycles < cycles_limit) { - UINT64 cycles_next_trans = cycles_limit; + uint64_t cycles_next_trans = cycles_limit; if(cycles_next_trans > cycles_next_flux && cycles < cycles_next_flux) cycles_next_trans = cycles_next_flux; if(cycles_next_trans > cycles_next_flux_down && cycles < cycles_next_flux_down) cycles_next_trans = cycles_next_flux_down; while(cycles < cycles_next_trans) { - UINT8 opcode = m_rom_p6[address]; + uint8_t opcode = m_rom_p6[address]; if(mode_write) { if((write_line_active && !(address & 0x80)) || @@ -413,8 +413,8 @@ void wozfdc_device::lss_sync() else if(cycles == cycles_next_flux_down) { address |= 0x10; next_flux = floppy ? floppy->get_next_transition(cycles_to_time(cycles)) : attotime::never; - cycles_next_flux = next_flux != attotime::never ? time_to_cycles(next_flux) : UINT64(-1); - cycles_next_flux_down = cycles_next_flux != UINT64(-1) ? cycles_next_flux+1 : UINT64(-1); + cycles_next_flux = next_flux != attotime::never ? time_to_cycles(next_flux) : uint64_t(-1); + cycles_next_flux_down = cycles_next_flux != uint64_t(-1) ? cycles_next_flux+1 : uint64_t(-1); } } } diff --git a/src/devices/machine/wozfdc.h b/src/devices/machine/wozfdc.h index 99e4177c7fb..cdf0b502de3 100644 --- a/src/devices/machine/wozfdc.h +++ b/src/devices/machine/wozfdc.h @@ -30,7 +30,7 @@ class wozfdc_device: public: // construction/destruction - wozfdc_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); + wozfdc_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); // optional information overrides virtual const tiny_rom_entry *device_rom_region() const override; @@ -51,18 +51,18 @@ private: MODE_IDLE, MODE_ACTIVE, MODE_DELAY }; - UINT64 cycles; - UINT8 data_reg, address; + uint64_t cycles; + uint8_t data_reg, address; attotime write_start_time; attotime write_buffer[32]; int write_position; bool write_line_active; - const UINT8 *m_rom_p6; - UINT8 last_6502_write; + const uint8_t *m_rom_p6; + uint8_t last_6502_write; bool mode_write, mode_load; int active; - UINT8 phases; + uint8_t phases; emu_timer *timer, *delay_timer; bool external_drive_select; bool external_io_select; @@ -72,8 +72,8 @@ private: void control(int offset); void phase(int ph, bool on); - UINT64 time_to_cycles(const attotime &tm); - attotime cycles_to_time(UINT64 cycles); + uint64_t time_to_cycles(const attotime &tm); + attotime cycles_to_time(uint64_t cycles); void a3_update_drive_sel(); void lss_start(); @@ -83,7 +83,7 @@ private: class diskii_fdc : public wozfdc_device { public: - diskii_fdc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + diskii_fdc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_reset() override; @@ -93,7 +93,7 @@ public: class appleiii_fdc : public wozfdc_device { public: - appleiii_fdc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + appleiii_fdc(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_reset() override; diff --git a/src/devices/machine/x2212.cpp b/src/devices/machine/x2212.cpp index 63d28a322e4..cb8cbe013d4 100644 --- a/src/devices/machine/x2212.cpp +++ b/src/devices/machine/x2212.cpp @@ -38,7 +38,7 @@ const device_type X2210 = &device_creator; // x2212_device - constructor //------------------------------------------------- -x2212_device::x2212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +x2212_device::x2212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, X2212, "X2212 NVRAM", tag, owner, clock, "x2212", __FILE__), device_memory_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -52,7 +52,7 @@ x2212_device::x2212_device(const machine_config &mconfig, const char *tag, devic { } -x2212_device::x2212_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, int size_data) +x2212_device::x2212_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, int size_data) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), device_nvram_interface(mconfig, *this), @@ -131,7 +131,7 @@ void x2212_device::nvram_default() void x2212_device::nvram_read(emu_file &file) { - UINT8 *buffer = (UINT8 *) alloca(m_size_data); + uint8_t *buffer = (uint8_t *) alloca(m_size_data); file.read(buffer, m_size_data); for (int byte = 0; byte < m_size_data; byte++) { @@ -152,7 +152,7 @@ void x2212_device::nvram_write(emu_file &file) if (m_auto_save) store(); - UINT8 *buffer = (UINT8 *) alloca(m_size_data); + uint8_t *buffer = (uint8_t *) alloca(m_size_data); for (int byte = 0; byte < m_size_data; byte++) buffer[byte] = m_e2prom->read_byte(byte); file.write(buffer, m_size_data); @@ -239,7 +239,7 @@ WRITE_LINE_MEMBER( x2212_device::recall ) } -x2210_device::x2210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +x2210_device::x2210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : x2212_device(mconfig, X2210, "X2210", tag, owner, clock, "x2210", __FILE__, 0x40) { } diff --git a/src/devices/machine/x2212.h b/src/devices/machine/x2212.h index ffcc1dcf84b..7c049f380e2 100644 --- a/src/devices/machine/x2212.h +++ b/src/devices/machine/x2212.h @@ -48,8 +48,8 @@ class x2212_device : public device_t, { public: // construction/destruction - x2212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - x2212_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, int size_data); + x2212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + x2212_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, int size_data); // inline configuration helpers static void static_set_auto_save(device_t &device); @@ -92,13 +92,13 @@ protected: bool m_array_recall; int m_size_data; - optional_region_ptr m_default_data; + optional_region_ptr m_default_data; }; class x2210_device : public x2212_device { public: - x2210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + x2210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/machine/x76f041.cpp b/src/devices/machine/x76f041.cpp index 481434abc77..682ecaff8de 100644 --- a/src/devices/machine/x76f041.cpp +++ b/src/devices/machine/x76f041.cpp @@ -34,7 +34,7 @@ inline void ATTR_PRINTF( 3, 4 ) x76f041_device::verboselog( int n_level, const c // device type definition const device_type X76F041 = &device_creator; -x76f041_device::x76f041_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +x76f041_device::x76f041_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t( mconfig, X76F041, "X76F041 Flash", tag, owner, clock, "x76f041", __FILE__ ), device_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -118,7 +118,7 @@ WRITE_LINE_MEMBER( x76f041_device::write_rst ) m_rst = state; } -UINT8 *x76f041_device::password() +uint8_t *x76f041_device::password() { switch( m_command & 0xe0 ) { @@ -509,7 +509,7 @@ void x76f041_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_write_password, region, sizeof( m_write_password ) ); region += sizeof( m_write_password ); diff --git a/src/devices/machine/x76f041.h b/src/devices/machine/x76f041.h index 5c453aad6ee..c0ca2ed4019 100644 --- a/src/devices/machine/x76f041.h +++ b/src/devices/machine/x76f041.h @@ -22,7 +22,7 @@ class x76f041_device : public device_t, { public: // construction/destruction - x76f041_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ); + x76f041_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); DECLARE_WRITE_LINE_MEMBER( write_cs ); DECLARE_WRITE_LINE_MEMBER( write_rst ); @@ -41,7 +41,7 @@ protected: private: inline void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, const char *s_fmt, ... ); - UINT8 *password(); + uint8_t *password(); void password_ok(); void load_address(); int data_offset(); @@ -113,13 +113,13 @@ private: int m_byte; int m_command; int m_address; - UINT8 m_write_buffer[ 8 ]; - UINT8 m_response_to_reset[ 4 ]; - UINT8 m_write_password[ 8 ]; - UINT8 m_read_password[ 8 ]; - UINT8 m_configuration_password[ 8 ]; - UINT8 m_configuration_registers[ 8 ]; - UINT8 m_data[ 512 ]; + uint8_t m_write_buffer[ 8 ]; + uint8_t m_response_to_reset[ 4 ]; + uint8_t m_write_password[ 8 ]; + uint8_t m_read_password[ 8 ]; + uint8_t m_configuration_password[ 8 ]; + uint8_t m_configuration_registers[ 8 ]; + uint8_t m_data[ 512 ]; }; diff --git a/src/devices/machine/x76f100.cpp b/src/devices/machine/x76f100.cpp index f254eed7ffc..7a03bf7bed1 100644 --- a/src/devices/machine/x76f100.cpp +++ b/src/devices/machine/x76f100.cpp @@ -32,7 +32,7 @@ inline void ATTR_PRINTF( 3, 4 ) x76f100_device::verboselog( int n_level, const c // device type definition const device_type X76F100 = &device_creator; -x76f100_device::x76f100_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +x76f100_device::x76f100_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t( mconfig, X76F100, "X76F100 Flash", tag, owner, clock, "x76f100", __FILE__ ), device_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -112,7 +112,7 @@ WRITE_LINE_MEMBER( x76f100_device::write_rst ) m_rst = state; } -UINT8 *x76f100_device::password() +uint8_t *x76f100_device::password() { if( ( m_command & 0xe1 ) == COMMAND_READ ) { @@ -402,7 +402,7 @@ void x76f100_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_write_password, region, sizeof( m_write_password )); region += sizeof( m_write_password ); diff --git a/src/devices/machine/x76f100.h b/src/devices/machine/x76f100.h index 5ce4b5241c9..d338b1482ac 100644 --- a/src/devices/machine/x76f100.h +++ b/src/devices/machine/x76f100.h @@ -22,7 +22,7 @@ class x76f100_device : public device_t, { public: // construction/destruction - x76f100_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ); + x76f100_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ); DECLARE_WRITE_LINE_MEMBER( write_cs ); DECLARE_WRITE_LINE_MEMBER( write_rst ); @@ -42,7 +42,7 @@ protected: private: inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4); - UINT8 *password(); + uint8_t *password(); void password_ok(); int data_offset(); @@ -79,11 +79,11 @@ private: int m_bit; int m_byte; int m_command; - UINT8 m_write_buffer[ 8 ]; - UINT8 m_response_to_reset[ 4 ]; - UINT8 m_write_password[ 8 ]; - UINT8 m_read_password[ 8 ]; - UINT8 m_data[ 112 ]; + uint8_t m_write_buffer[ 8 ]; + uint8_t m_response_to_reset[ 4 ]; + uint8_t m_write_password[ 8 ]; + uint8_t m_read_password[ 8 ]; + uint8_t m_data[ 112 ]; }; // device type definition diff --git a/src/devices/machine/ym2148.cpp b/src/devices/machine/ym2148.cpp index bdaef303d77..4f2e5d696ae 100644 --- a/src/devices/machine/ym2148.cpp +++ b/src/devices/machine/ym2148.cpp @@ -16,7 +16,7 @@ TODO: const device_type YM2148 = &device_creator; -ym2148_device::ym2148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym2148_device::ym2148_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YM2148, "YM2148", tag, owner, clock, "ym2148", __FILE__) , device_serial_interface(mconfig, *this) , m_txd_handler(*this) @@ -102,7 +102,7 @@ void ym2148_device::transmit_clock() /* if diserial has bits to send, make them so */ if (!is_transmit_register_empty()) { - UINT8 data = transmit_register_get_data_bit(); + uint8_t data = transmit_register_get_data_bit(); m_tx_busy = true; m_txd_handler(data); } @@ -197,7 +197,7 @@ WRITE8_MEMBER(ym2148_device::write) } -UINT8 ym2148_device::get_irq_vector() +uint8_t ym2148_device::get_irq_vector() { return (m_irq_state == ASSERT_LINE) ? m_irq_vector : m_external_irq_vector; } diff --git a/src/devices/machine/ym2148.h b/src/devices/machine/ym2148.h index 729b28e8fc2..5ca91bd8883 100644 --- a/src/devices/machine/ym2148.h +++ b/src/devices/machine/ym2148.h @@ -34,7 +34,7 @@ class ym2148_device : public device_t, { public: // construction/destruction - ym2148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym2148_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_txd_handler(device_t &device, _Object object) { return downcast(device).m_txd_handler.set_callback(object); } @@ -46,7 +46,7 @@ public: DECLARE_WRITE8_MEMBER(write); DECLARE_WRITE_LINE_MEMBER(write_rxd); - UINT8 get_irq_vector(); + uint8_t get_irq_vector(); protected: virtual void device_start() override; @@ -59,13 +59,13 @@ private: devcb_write8 m_port_write_handler; // write ST0-ST7 devcb_read8 m_port_read_handler; // read SD0-SD7 int m_irq_state; - UINT8 m_irq_vector; - UINT8 m_external_irq_vector; + uint8_t m_irq_vector; + uint8_t m_external_irq_vector; // Does this chip have 1 or 2 data registers? - UINT8 m_data_out; - UINT8 m_data_in; - UINT8 m_control; - UINT8 m_status; + uint8_t m_data_out; + uint8_t m_data_in; + uint8_t m_control; + uint8_t m_status; emu_timer *m_timer; int m_rxd; bool m_tx_busy; diff --git a/src/devices/machine/z80ctc.cpp b/src/devices/machine/z80ctc.cpp index a6cb090e30b..b4e072654cc 100644 --- a/src/devices/machine/z80ctc.cpp +++ b/src/devices/machine/z80ctc.cpp @@ -78,7 +78,7 @@ const device_type Z80CTC = &device_creator; // z80ctc_device - constructor //------------------------------------------------- -z80ctc_device::z80ctc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80ctc_device::z80ctc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80CTC, "Z80 CTC", tag, owner, clock, "z80ctc", __FILE__), device_z80daisy_interface(mconfig, *this), m_intr_cb(*this), @@ -354,7 +354,7 @@ attotime z80ctc_device::ctc_channel::period() const // read - read the channel's state //------------------------------------------------- -UINT8 z80ctc_device::ctc_channel::read() +uint8_t z80ctc_device::ctc_channel::read() { // if we're in counter mode, just return the count if ((m_mode & MODE) == MODE_COUNTER || (m_mode & WAITING_FOR_TRIG)) @@ -379,7 +379,7 @@ UINT8 z80ctc_device::ctc_channel::read() // write - handle writes to a channel //------------------------------------------------- -void z80ctc_device::ctc_channel::write(UINT8 data) +void z80ctc_device::ctc_channel::write(uint8_t data) { // if we're waiting for a time constant, this is it if ((m_mode & CONSTANT) == CONSTANT_LOAD) @@ -449,7 +449,7 @@ void z80ctc_device::ctc_channel::write(UINT8 data) // side-effects //------------------------------------------------- -void z80ctc_device::ctc_channel::trigger(UINT8 data) +void z80ctc_device::ctc_channel::trigger(uint8_t data) { // normalize data data = data ? 1 : 0; diff --git a/src/devices/machine/z80ctc.h b/src/devices/machine/z80ctc.h index 87e0011fdfa..71e36ccc52a 100644 --- a/src/devices/machine/z80ctc.h +++ b/src/devices/machine/z80ctc.h @@ -58,7 +58,7 @@ class z80ctc_device : public device_t, { public: // construction/destruction - z80ctc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80ctc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_intr_callback(device_t &device, _Object object) { return downcast(device).m_intr_cb.set_callback(object); } template static devcb_base &set_zc0_callback(device_t &device, _Object object) { return downcast(device).m_zc0_cb.set_callback(object); } @@ -73,7 +73,7 @@ public: DECLARE_WRITE_LINE_MEMBER( trg2 ); DECLARE_WRITE_LINE_MEMBER( trg3 ); - UINT16 get_channel_constant(UINT8 channel) { return m_channel[channel].m_tconst; } + uint16_t get_channel_constant(uint8_t channel) { return m_channel[channel].m_tconst; } protected: // device-level overrides @@ -98,21 +98,21 @@ private: void start(z80ctc_device *device, int index); void reset(); - UINT8 read(); - void write(UINT8 data); + uint8_t read(); + void write(uint8_t data); attotime period() const; - void trigger(UINT8 data); + void trigger(uint8_t data); TIMER_CALLBACK_MEMBER(timer_callback); z80ctc_device * m_device; // pointer back to our device int m_index; // our channel index - UINT16 m_mode; // current mode - UINT16 m_tconst; // time constant - UINT16 m_down; // down counter (clock mode only) - UINT8 m_extclk; // current signal from the external clock + uint16_t m_mode; // current mode + uint16_t m_tconst; // time constant + uint16_t m_down; // down counter (clock mode only) + uint8_t m_extclk; // current signal from the external clock emu_timer * m_timer; // array of active timers - UINT8 m_int_state; // interrupt status (for daisy chain) + uint8_t m_int_state; // interrupt status (for daisy chain) }; // internal state @@ -122,7 +122,7 @@ private: devcb_write_line m_zc2_cb; // channel 2 zero crossing callbacks devcb_write_line m_zc3_cb; // channel 3 zero crossing callbacks = nullptr ? - UINT8 m_vector; // interrupt vector + uint8_t m_vector; // interrupt vector attotime m_period16; // 16/system clock attotime m_period256; // 256/system clock ctc_channel m_channel[4]; // data for each channel diff --git a/src/devices/machine/z80dart.cpp b/src/devices/machine/z80dart.cpp index e976080881f..72086d5e00f 100644 --- a/src/devices/machine/z80dart.cpp +++ b/src/devices/machine/z80dart.cpp @@ -86,7 +86,7 @@ machine_config_constructor z80dart_device::device_mconfig_additions() const // z80dart_device - constructor //------------------------------------------------- -z80dart_device::z80dart_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +z80dart_device::z80dart_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_z80daisy_interface(mconfig, *this), m_chanA(*this, CHANA_TAG), @@ -116,7 +116,7 @@ z80dart_device::z80dart_device(const machine_config &mconfig, device_type type, elem = 0; } -z80dart_device::z80dart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80dart_device::z80dart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80DART, "Z80 DART", tag, owner, clock, "z80dart", __FILE__), device_z80daisy_interface(mconfig, *this), m_chanA(*this, CHANA_TAG), @@ -146,37 +146,37 @@ z80dart_device::z80dart_device(const machine_config &mconfig, const char *tag, d elem = 0; } -z80sio0_device::z80sio0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80sio0_device::z80sio0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80dart_device(mconfig, Z80SIO0, "Z80 SIO/0", tag, owner, clock, TYPE_SIO0, "z80sio0", __FILE__) { } -z80sio1_device::z80sio1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80sio1_device::z80sio1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80dart_device(mconfig, Z80SIO1, "Z80 SIO/1", tag, owner, clock, TYPE_SIO1, "z80sio1", __FILE__) { } -z80sio2_device::z80sio2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80sio2_device::z80sio2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80dart_device(mconfig, Z80SIO2, "Z80 SIO/2", tag, owner, clock, TYPE_SIO2, "z80sio2", __FILE__) { } -z80sio3_device::z80sio3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80sio3_device::z80sio3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80dart_device(mconfig, Z80SIO3, "Z80 SIO/3", tag, owner, clock, TYPE_SIO3, "z80sio3", __FILE__) { } -z80sio4_device::z80sio4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80sio4_device::z80sio4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80dart_device(mconfig, Z80SIO4, "Z80 SIO/4", tag, owner, clock, TYPE_SIO4, "z80sio4", __FILE__) { } -i8274_device::i8274_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8274_device::i8274_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80dart_device(mconfig, I8274, "I8274", tag, owner, clock, TYPE_I8274, "i8274", __FILE__) { } -upd7201_device::upd7201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7201_device::upd7201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80dart_device(mconfig, UPD7201, "uPD7201", tag, owner, clock, TYPE_UPD7201, "upd7201", __FILE__) { } @@ -353,7 +353,7 @@ void z80dart_device::reset_interrupts() void z80dart_device::trigger_interrupt(int index, int state) { - UINT8 vector = m_chanB->m_wr[2]; + uint8_t vector = m_chanB->m_wr[2]; int priority; if((m_variant == TYPE_I8274) || (m_variant == TYPE_UPD7201)) @@ -499,7 +499,7 @@ WRITE8_MEMBER( z80dart_device::ba_cd_w ) // dart_channel - constructor //------------------------------------------------- -z80dart_channel::z80dart_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80dart_channel::z80dart_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80DART_CHANNEL, "Z80 DART channel", tag, owner, clock, "z80dart_channel", __FILE__), device_serial_interface(mconfig, *this), m_rx_error(0), @@ -784,9 +784,9 @@ int z80dart_channel::get_tx_word_length() // control_read - read control register //------------------------------------------------- -UINT8 z80dart_channel::control_read() +uint8_t z80dart_channel::control_read() { - UINT8 data = 0; + uint8_t data = 0; int reg = m_wr[0] & WR0_REGISTER_MASK; @@ -820,7 +820,7 @@ UINT8 z80dart_channel::control_read() // control_write - write control register //------------------------------------------------- -void z80dart_channel::control_write(UINT8 data) +void z80dart_channel::control_write(uint8_t data) { int reg = m_wr[0] & WR0_REGISTER_MASK; @@ -997,9 +997,9 @@ void z80dart_channel::control_write(UINT8 data) // data_read - read data register //------------------------------------------------- -UINT8 z80dart_channel::data_read() +uint8_t z80dart_channel::data_read() { - UINT8 data = 0; + uint8_t data = 0; if (m_rx_fifo >= 0) { @@ -1029,7 +1029,7 @@ UINT8 z80dart_channel::data_read() // data_write - write data register //------------------------------------------------- -void z80dart_channel::data_write(UINT8 data) +void z80dart_channel::data_write(uint8_t data) { m_tx_data = data; @@ -1060,7 +1060,7 @@ void z80dart_channel::data_write(UINT8 data) // receive_data - receive data word //------------------------------------------------- -void z80dart_channel::receive_data(UINT8 data) +void z80dart_channel::receive_data(uint8_t data) { LOG(("Z80DART \"%s\" Channel %c : Receive Data Byte '%02x'\n", m_owner->tag(), 'A' + m_index, data)); diff --git a/src/devices/machine/z80dart.h b/src/devices/machine/z80dart.h index d1efa05fd30..a7eba9f8ac1 100644 --- a/src/devices/machine/z80dart.h +++ b/src/devices/machine/z80dart.h @@ -249,7 +249,7 @@ class z80dart_channel : public device_t, friend class z80dart_device; public: - z80dart_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80dart_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -262,13 +262,13 @@ public: virtual void rcv_callback() override; virtual void rcv_complete() override; - UINT8 control_read(); - void control_write(UINT8 data); + uint8_t control_read(); + void control_write(uint8_t data); - UINT8 data_read(); - void data_write(UINT8 data); + uint8_t data_read(); + void data_write(uint8_t data); - void receive_data(UINT8 data); + void receive_data(uint8_t data); DECLARE_WRITE_LINE_MEMBER( write_rx ); DECLARE_WRITE_LINE_MEMBER( cts_w ); @@ -282,8 +282,8 @@ public: int m_txc; // register state - UINT8 m_rr[3]; // read register - UINT8 m_wr[6]; // write register + uint8_t m_rr[3]; // read register + uint8_t m_wr[6]; // write register protected: enum @@ -428,15 +428,15 @@ protected: int get_tx_word_length(); // receiver state - UINT8 m_rx_data_fifo[3]; // receive data FIFO - UINT8 m_rx_error_fifo[3]; // receive error FIFO - UINT8 m_rx_error; // current receive error + uint8_t m_rx_data_fifo[3]; // receive data FIFO + uint8_t m_rx_error_fifo[3]; // receive error FIFO + uint8_t m_rx_error; // current receive error int m_rx_fifo; // receive FIFO pointer int m_rx_clock; // receive clock pulse count int m_rx_first; // first character received int m_rx_break; // receive break condition - UINT8 m_rx_rr0_latch; // read register 0 latched + uint8_t m_rx_rr0_latch; // read register 0 latched int m_rxd; int m_ri; // ring indicator latch @@ -444,14 +444,14 @@ protected: int m_dcd; // data carrier detect latch // transmitter state - UINT8 m_tx_data; // transmit data register + uint8_t m_tx_data; // transmit data register int m_tx_clock; // transmit clock pulse count int m_dtr; // data terminal ready int m_rts; // request to send // synchronous state - UINT16 m_sync; // sync character + uint16_t m_sync; // sync character int m_index; z80dart_device *m_uart; @@ -467,8 +467,8 @@ class z80dart_device : public device_t, public: // construction/destruction - z80dart_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - z80dart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80dart_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + z80dart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_txda_callback(device_t &device, _Object object) { return downcast(device).m_out_txda_cb.set_callback(object); } template static devcb_base &set_out_dtra_callback(device_t &device, _Object object) { return downcast(device).m_out_dtra_cb.set_callback(object); } @@ -603,7 +603,7 @@ class z80sio0_device : public z80dart_device { public: // construction/destruction - z80sio0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80sio0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -613,7 +613,7 @@ class z80sio1_device : public z80dart_device { public: // construction/destruction - z80sio1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80sio1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -623,7 +623,7 @@ class z80sio2_device : public z80dart_device { public: // construction/destruction - z80sio2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80sio2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -633,7 +633,7 @@ class z80sio3_device : public z80dart_device { public: // construction/destruction - z80sio3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80sio3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -643,7 +643,7 @@ class z80sio4_device : public z80dart_device { public: // construction/destruction - z80sio4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80sio4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -653,7 +653,7 @@ class i8274_device : public z80dart_device { public: // construction/destruction - i8274_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8274_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( inta_r ) { return m1_r(); }; }; @@ -665,7 +665,7 @@ class upd7201_device : public z80dart_device { public: // construction/destruction - upd7201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd7201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/machine/z80dma.cpp b/src/devices/machine/z80dma.cpp index bf5c4585234..58eb6587cfa 100644 --- a/src/devices/machine/z80dma.cpp +++ b/src/devices/machine/z80dma.cpp @@ -146,7 +146,7 @@ const device_type Z80DMA = &device_creator; // z80dma_device - constructor //------------------------------------------------- -z80dma_device::z80dma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80dma_device::z80dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80DMA, "Z80 DMA", tag, owner, clock, "z80dma", __FILE__), device_z80daisy_interface(mconfig, *this), m_out_busreq_cb(*this), @@ -367,7 +367,7 @@ void z80dma_device::trigger_interrupt(int level) void z80dma_device::do_read() { - UINT8 mode; + uint8_t mode; mode = TRANSFER_MODE; switch(mode) { @@ -428,7 +428,7 @@ void z80dma_device::do_transfer_write() void z80dma_device::do_search() { - UINT8 load_byte,match_byte; + uint8_t load_byte,match_byte; load_byte = m_latch | MASK_BYTE; match_byte = MATCH_BYTE | MASK_BYTE; //if (LOG) logerror("%02x %02x\n",load_byte,match_byte)); @@ -444,7 +444,7 @@ void z80dma_device::do_search() int z80dma_device::do_write() { int done; - UINT8 mode; + uint8_t mode; mode = TRANSFER_MODE; if (m_count == 0x0000) @@ -551,7 +551,7 @@ TIMER_CALLBACK_MEMBER(z80dma_device::timerproc) void z80dma_device::update_status() { - UINT16 pending_transfer; + uint16_t pending_transfer; attotime next; // no transfer is active right now; is there a transfer pending right now? @@ -591,9 +591,9 @@ void z80dma_device::update_status() // read - register read //------------------------------------------------- -UINT8 z80dma_device::read() +uint8_t z80dma_device::read() { - UINT8 res; + uint8_t res; if(m_read_num_follow == 0) // special case: Legend of Kage on X1 Turbo res = m_status; @@ -616,7 +616,7 @@ UINT8 z80dma_device::read() // write - register write //------------------------------------------------- -void z80dma_device::write(UINT8 data) +void z80dma_device::write(uint8_t data) { if (m_num_follow == 0) { @@ -717,7 +717,7 @@ void z80dma_device::write(UINT8 data) interrupt_check(); // Needs six reset commands to reset the DMA { - UINT8 WRi; + uint8_t WRi; for(WRi=0;WRi<7;WRi++) REG(WRi,m_reset_pointer) = 0; diff --git a/src/devices/machine/z80dma.h b/src/devices/machine/z80dma.h index 0b1916c5d5f..7080854ef5f 100644 --- a/src/devices/machine/z80dma.h +++ b/src/devices/machine/z80dma.h @@ -73,7 +73,7 @@ class z80dma_device : public device_t, { public: // construction/destruction - z80dma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_busreq_callback(device_t &device, _Object object) { return downcast(device).m_out_busreq_cb.set_callback(object); } template static devcb_base &set_out_int_callback(device_t &device, _Object object) { return downcast(device).m_out_int_cb.set_callback(object); } @@ -83,8 +83,8 @@ public: template static devcb_base &set_in_iorq_callback(device_t &device, _Object object) { return downcast(device).m_in_iorq_cb.set_callback(object); } template static devcb_base &set_out_iorq_callback(device_t &device, _Object object) { return downcast(device).m_out_iorq_cb.set_callback(object); } - UINT8 read(); - void write(UINT8 data); + uint8_t read(); + void write(uint8_t data); DECLARE_READ8_MEMBER( read ) { return read(); } DECLARE_WRITE8_MEMBER( write ) { write(data); } @@ -128,32 +128,32 @@ private: emu_timer *m_timer; - UINT16 m_regs[(6<<3)+1+1]; - UINT8 m_num_follow; - UINT8 m_cur_follow; - UINT8 m_regs_follow[5]; - UINT8 m_read_num_follow; - UINT8 m_read_cur_follow; - UINT8 m_read_regs_follow[7]; - UINT8 m_status; - UINT8 m_dma_enabled; + uint16_t m_regs[(6<<3)+1+1]; + uint8_t m_num_follow; + uint8_t m_cur_follow; + uint8_t m_regs_follow[5]; + uint8_t m_read_num_follow; + uint8_t m_read_cur_follow; + uint8_t m_read_regs_follow[7]; + uint8_t m_status; + uint8_t m_dma_enabled; - UINT16 m_addressA; - UINT16 m_addressB; - UINT16 m_count; + uint16_t m_addressA; + uint16_t m_addressB; + uint16_t m_count; int m_rdy; int m_force_ready; - UINT8 m_reset_pointer; + uint8_t m_reset_pointer; bool m_is_read; - UINT8 m_cur_cycle; - UINT8 m_latch; + uint8_t m_cur_cycle; + uint8_t m_latch; // interrupts int m_ip; // interrupt pending int m_ius; // interrupt under service - UINT8 m_vector; // interrupt vector + uint8_t m_vector; // interrupt vector }; diff --git a/src/devices/machine/z80pio.cpp b/src/devices/machine/z80pio.cpp index 6e24a0e68f0..f7e8927f181 100644 --- a/src/devices/machine/z80pio.cpp +++ b/src/devices/machine/z80pio.cpp @@ -38,7 +38,7 @@ const device_type Z80PIO = &device_creator; // z80pio_device - constructor //------------------------------------------------- -z80pio_device::z80pio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +z80pio_device::z80pio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80PIO, "Z80 PIO", tag, owner, clock, "z80pio", __FILE__), device_z80daisy_interface(mconfig, *this), m_out_int_cb(*this), @@ -233,7 +233,7 @@ WRITE8_MEMBER( z80pio_device::write_alt ) // control_read - control register read //------------------------------------------------- -UINT8 z80pio_device::control_read() +uint8_t z80pio_device::control_read() { return (m_port[PORT_A].m_icw & 0xc0) | (m_port[PORT_B].m_icw >> 4); } @@ -527,9 +527,9 @@ void z80pio_device::pio_port::strobe(bool state) // read - port I/O read //------------------------------------------------- -UINT8 z80pio_device::pio_port::read() +uint8_t z80pio_device::pio_port::read() { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_mode) { @@ -555,7 +555,7 @@ UINT8 z80pio_device::pio_port::read() // write - port I/O write //------------------------------------------------- -void z80pio_device::pio_port::write(UINT8 data) +void z80pio_device::pio_port::write(uint8_t data) { if (m_mode == MODE_BIT_CONTROL) { @@ -563,8 +563,8 @@ void z80pio_device::pio_port::write(UINT8 data) m_input = data; // fetch input data (ignore output lines) - UINT8 data = (m_input & m_ior) | (m_output & ~m_ior); - UINT8 mask = ~m_mask; + uint8_t data = (m_input & m_ior) | (m_output & ~m_ior); + uint8_t mask = ~m_mask; bool match = false; data &= mask; @@ -592,7 +592,7 @@ void z80pio_device::pio_port::write(UINT8 data) // control_write - control register write //------------------------------------------------- -void z80pio_device::pio_port::control_write(UINT8 data) +void z80pio_device::pio_port::control_write(uint8_t data) { switch (m_next_control_word) { @@ -696,9 +696,9 @@ void z80pio_device::pio_port::control_write(UINT8 data) // data_read - data register read //------------------------------------------------- -UINT8 z80pio_device::pio_port::data_read() +uint8_t z80pio_device::pio_port::data_read() { - UINT8 data = 0; + uint8_t data = 0; switch (m_mode) { @@ -756,7 +756,7 @@ UINT8 z80pio_device::pio_port::data_read() // data_write - data register write //------------------------------------------------- -void z80pio_device::pio_port::data_write(UINT8 data) +void z80pio_device::pio_port::data_write(uint8_t data) { switch (m_mode) { diff --git a/src/devices/machine/z80pio.h b/src/devices/machine/z80pio.h index 623f586891f..bc8cbf531f7 100644 --- a/src/devices/machine/z80pio.h +++ b/src/devices/machine/z80pio.h @@ -80,7 +80,7 @@ public: }; // construction/destruction - z80pio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80pio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_int_callback(device_t &device, _Object object) { return downcast(device).m_out_int_cb.set_callback(object); } template static devcb_base &set_in_pa_callback(device_t &device, _Object object) { return downcast(device).m_in_pa_cb.set_callback(object); } @@ -99,27 +99,27 @@ public: DECLARE_WRITE_LINE_MEMBER( strobe_b ) { strobe(PORT_B, state); } // control register I/O - UINT8 control_read(); - void control_write(int offset, UINT8 data) { m_port[offset & 1].control_write(data); } - void control_a_write(UINT8 data) { control_write(PORT_A, data); } - void control_b_write(UINT8 data) { control_write(PORT_B, data); } + uint8_t control_read(); + void control_write(int offset, uint8_t data) { m_port[offset & 1].control_write(data); } + void control_a_write(uint8_t data) { control_write(PORT_A, data); } + void control_b_write(uint8_t data) { control_write(PORT_B, data); } // data register I/O - UINT8 data_read(int offset) { return m_port[offset & 1].data_read(); } - void data_write(int offset, UINT8 data) { m_port[offset & 1].data_write(data); } - UINT8 data_a_read() { return data_read(PORT_A); } - UINT8 data_b_read() { return data_read(PORT_B); } - void data_a_write(UINT8 data) { data_write(PORT_A, data); } - void data_b_write(UINT8 data) { data_write(PORT_B, data); } + uint8_t data_read(int offset) { return m_port[offset & 1].data_read(); } + void data_write(int offset, uint8_t data) { m_port[offset & 1].data_write(data); } + uint8_t data_a_read() { return data_read(PORT_A); } + uint8_t data_b_read() { return data_read(PORT_B); } + void data_a_write(uint8_t data) { data_write(PORT_A, data); } + void data_b_write(uint8_t data) { data_write(PORT_B, data); } // port I/O - UINT8 port_read(int offset) { return m_port[offset & 1].read(); } - void port_write(int offset, UINT8 data) { m_port[offset & 1].write(data); } + uint8_t port_read(int offset) { return m_port[offset & 1].read(); } + void port_write(int offset, uint8_t data) { m_port[offset & 1].write(data); } void port_write(int offset, int bit, int state) { port_write(offset, (m_port[offset & 1].m_input & ~(1 << bit)) | (state << bit)); } - UINT8 port_a_read() { return port_read(PORT_A); } - UINT8 port_b_read() { return port_read(PORT_B); } - void port_a_write(UINT8 data) { port_write(PORT_A, data); } - void port_b_write(UINT8 data) { port_write(PORT_B, data); } + uint8_t port_a_read() { return port_read(PORT_A); } + uint8_t port_b_read() { return port_read(PORT_B); } + void port_a_write(uint8_t data) { port_write(PORT_A, data); } + void port_b_write(uint8_t data) { port_write(PORT_B, data); } DECLARE_WRITE8_MEMBER( pa_w ) { port_a_write(data); } DECLARE_READ8_MEMBER( pa_r ) { return port_a_read(); } DECLARE_WRITE8_MEMBER( pb_w ) { port_b_write(data); } @@ -207,13 +207,13 @@ private: void set_mode(int mode); void strobe(bool state); - UINT8 read(); - void write(UINT8 data); + uint8_t read(); + void write(uint8_t data); - void control_write(UINT8 data); + void control_write(uint8_t data); - UINT8 data_read(); - void data_write(UINT8 data); + uint8_t data_read(); + void data_write(uint8_t data); private: void check_interrupts() { m_device->check_interrupts(); } @@ -223,9 +223,9 @@ private: int m_mode; // mode register int m_next_control_word; // next control word - UINT8 m_input; // input latch - UINT8 m_output; // output latch - UINT8 m_ior; // input/output register + uint8_t m_input; // input latch + uint8_t m_output; // output latch + uint8_t m_ior; // input/output register bool m_rdy; // ready bool m_stb; // strobe @@ -233,9 +233,9 @@ private: bool m_ie; // interrupt enabled bool m_ip; // interrupt pending bool m_ius; // interrupt under service - UINT8 m_icw; // interrupt control word - UINT8 m_vector; // interrupt vector - UINT8 m_mask; // interrupt mask + uint8_t m_icw; // interrupt control word + uint8_t m_vector; // interrupt vector + uint8_t m_mask; // interrupt mask bool m_match; // logic equation match }; diff --git a/src/devices/machine/z80scc.cpp b/src/devices/machine/z80scc.cpp index 251596f6fac..d3bf9f69980 100644 --- a/src/devices/machine/z80scc.cpp +++ b/src/devices/machine/z80scc.cpp @@ -146,7 +146,7 @@ machine_config_constructor z80scc_device::device_mconfig_additions() const // z80scc_device - constructor //------------------------------------------------- -z80scc_device::z80scc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +z80scc_device::z80scc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_z80daisy_interface(mconfig, *this), m_chanA(*this, CHANA_TAG), @@ -176,7 +176,7 @@ z80scc_device::z80scc_device(const machine_config &mconfig, device_type type, co elem = 0; } -z80scc_device::z80scc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80scc_device::z80scc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80SCC, "Z80 SCC", tag, owner, clock, "z80scc", __FILE__), device_z80daisy_interface(mconfig, *this), m_chanA(*this, CHANA_TAG), @@ -202,28 +202,28 @@ z80scc_device::z80scc_device(const machine_config &mconfig, const char *tag, dev elem = 0; } -scc8030_device::scc8030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scc8030_device::scc8030_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80scc_device(mconfig, SCC8030, "SCC 8030", tag, owner, clock, TYPE_SCC8030, "scc8030", __FILE__){ } -scc80C30_device::scc80C30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scc80C30_device::scc80C30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80scc_device(mconfig, SCC80C30, "SCC 80C30", tag, owner, clock, TYPE_SCC80C30, "scc80C30", __FILE__){ } -scc80230_device::scc80230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scc80230_device::scc80230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80scc_device(mconfig, SCC80230, "SCC 80230", tag, owner, clock, TYPE_SCC80230, "scc80230", __FILE__){ } -scc8530_device::scc8530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scc8530_device::scc8530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80scc_device(mconfig, SCC8530N, "SCC 8530", tag, owner, clock, TYPE_SCC8530, "scc8530", __FILE__){ } -scc85C30_device::scc85C30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scc85C30_device::scc85C30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80scc_device(mconfig, SCC85C30, "SCC 85C30", tag, owner, clock, TYPE_SCC85C30, "scc85C30", __FILE__){ } -scc85230_device::scc85230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scc85230_device::scc85230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80scc_device(mconfig, SCC85230, "SCC 85230", tag, owner, clock, TYPE_SCC85230, "scc85230", __FILE__){ } -scc85233_device::scc85233_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scc85233_device::scc85233_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80scc_device(mconfig, SCC85233, "SCC 85233", tag, owner, clock, TYPE_SCC85233, "scc85233", __FILE__){ } -scc8523L_device::scc8523L_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scc8523L_device::scc8523L_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80scc_device(mconfig, SCC8523L, "SCC 8523L", tag, owner, clock, TYPE_SCC8523L, "scc8523L", __FILE__){ } //------------------------------------------------- @@ -403,7 +403,7 @@ void z80scc_device::reset_interrupts() check_interrupts(); } -UINT8 z80scc_device::modify_vector(UINT8 vec, int i, UINT8 src) +uint8_t z80scc_device::modify_vector(uint8_t vec, int i, uint8_t src) { /* Interrupt Vector Modification @@ -443,8 +443,8 @@ UINT8 z80scc_device::modify_vector(UINT8 vec, int i, UINT8 src) //------------------------------------------------- void z80scc_device::trigger_interrupt(int index, int state) { - UINT8 vector = m_chanA->m_rr2; - UINT8 source = 0; + uint8_t vector = m_chanA->m_rr2; + uint8_t source = 0; int priority; int prio_level = 0; @@ -558,7 +558,7 @@ READ8_MEMBER( z80scc_device::zbus_r ) { int ba = 0; int reg = 0x20; // Default point to a non register number - UINT8 data = 0; + uint8_t data = 0; /* Expell non- Z-Bus variants */ if ( !(m_variant & SET_Z80X30)) @@ -763,7 +763,7 @@ WRITE8_MEMBER( z80scc_device::ba_cd_inv_w ) // SCC_channel - constructor //------------------------------------------------- -z80scc_channel::z80scc_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80scc_channel::z80scc_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80SCC_CHANNEL, "Z80 SCC channel", tag, owner, clock, "z80scc_channel", __FILE__), device_serial_interface(mconfig, *this), #if LOCAL_BRG @@ -1114,7 +1114,7 @@ void z80scc_channel::rcv_callback() void z80scc_channel::rcv_complete() { - UINT8 data; + uint8_t data; receive_register_extract(); data = get_received_char(); @@ -1244,7 +1244,7 @@ int z80scc_channel::get_tx_word_length() * This register contains the status of the receive and transmit buffers; the * DCD, CTS, and SYNC inputs; the Transmit Underrun/EOM latch; and the * Break/Abort latch. */ -UINT8 z80scc_channel::do_sccreg_rr0() +uint8_t z80scc_channel::do_sccreg_rr0() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_rr0)); return m_rr0; @@ -1253,7 +1253,7 @@ UINT8 z80scc_channel::do_sccreg_rr0() /* * This register contains the Special Receive condition status bits and Residue * codes for the I-Field in the SDLC Receive Mode. */ -UINT8 z80scc_channel::do_sccreg_rr1() +uint8_t z80scc_channel::do_sccreg_rr1() { LOGR(("%s %s <- %02x\n",tag(), FUNCNAME, m_rr1)); return m_rr1; @@ -1265,7 +1265,7 @@ the vector returned is the vector actually stored in WR2. When this register is B, the vector returned includes status information in bits 1, 2 and 3 or in bits 6, 5 and 4, depending on the state of the Status High/Status Low bit in WR9 and independent of the state of the VIS bit in WR9."*/ -UINT8 z80scc_channel::do_sccreg_rr2() +uint8_t z80scc_channel::do_sccreg_rr2() { LOGR(("%s\n", FUNCNAME)); @@ -1303,7 +1303,7 @@ RR3 is the interrupt Pending register. The status of each of the interrupt Pendi reported in this register. This register exists only in Channel A. If this register is accessed in Channel B, all 0s are returned. The two unused bits are always returned as 0. Figure displays the bit positions for RR3." */ -UINT8 z80scc_channel::do_sccreg_rr3() +uint8_t z80scc_channel::do_sccreg_rr3() { LOGR(("%s\n", FUNCNAME)); return m_rr3; // TODO Update all bits of this status register @@ -1314,7 +1314,7 @@ UINT8 z80scc_channel::do_sccreg_rr3() /*On the ESCC, Read Register 4 reflects the contents of Write Register 4 provided the Extended Read option is enabled. Otherwise, this register returns an image of RR0. On the NMOS/CMOS version, a read to this location returns an image of RR0.*/ -UINT8 z80scc_channel::do_sccreg_rr4() +uint8_t z80scc_channel::do_sccreg_rr4() { LOGR(("%s\n", FUNCNAME)); if (m_uart->m_variant & (SET_ESCC | z80scc_device::TYPE_SCC85C30)) @@ -1327,7 +1327,7 @@ UINT8 z80scc_channel::do_sccreg_rr4() /*On the ESCC, Read Register 5 reflects the contents of Write Register 5 provided the Extended Read option is enabled. Otherwise, this register returns an image of RR1. On the NMOS/CMOS version, a read to this register returns an image of RR1.*/ -UINT8 z80scc_channel::do_sccreg_rr5() +uint8_t z80scc_channel::do_sccreg_rr5() { LOGR(("%s\n", FUNCNAME)); if (m_uart->m_variant & (SET_ESCC | z80scc_device::TYPE_SCC85C30)) @@ -1342,7 +1342,7 @@ UINT8 z80scc_channel::do_sccreg_rr5() register is readable only if the FIFO is enabled (refer to the description Write Register 15, bit D2, and SDLC Frame Status FIFO on page 126). Otherwise, this register is an image of RR2. On the NMOS version, a read to this register location returns an image of RR2.*/ -UINT8 z80scc_channel::do_sccreg_rr6() +uint8_t z80scc_channel::do_sccreg_rr6() { LOGR(("%s\n", FUNCNAME)); if (m_wr15 & WR15_STATUS_FIFO) @@ -1361,7 +1361,7 @@ UINT8 z80scc_channel::do_sccreg_rr6() description Write Register 15, bit D2). Otherwise this register is an image of RR3. Note, for proper operation of the FIFO and byte count logic, the registers should be read in the following order: RR7, RR6, RR1.*/ -UINT8 z80scc_channel::do_sccreg_rr7() +uint8_t z80scc_channel::do_sccreg_rr7() { LOGR(("%s\n", FUNCNAME)); if (!(m_uart->m_variant & (SET_NMOS))) @@ -1374,7 +1374,7 @@ UINT8 z80scc_channel::do_sccreg_rr7() #if 0 // Short cutted in control_read() /* RR8 is the Receive Data register. */ -UINT8 z80scc_channel::do_sccreg_rr8() +uint8_t z80scc_channel::do_sccreg_rr8() { return data_read(): } @@ -1384,7 +1384,7 @@ UINT8 z80scc_channel::do_sccreg_rr8() On the ESCC, Read Register 9 reflects the contents of Write Register 3 provided the Extended Read option has been enabled. On the NMOS/CMOS version, a read to this location returns an image of RR13. TODO: Check what is returned if Extended Read option is turned off */ -UINT8 z80scc_channel::do_sccreg_rr9() +uint8_t z80scc_channel::do_sccreg_rr9() { LOGR(("%s\n", FUNCNAME)); if (m_uart->m_variant & (SET_ESCC | z80scc_device::TYPE_SCC85C30)) @@ -1394,7 +1394,7 @@ UINT8 z80scc_channel::do_sccreg_rr9() } /* RR10 contains some SDLC related miscellaneous status bits. Unused bits are always 0. */ -UINT8 z80scc_channel::do_sccreg_rr10() +uint8_t z80scc_channel::do_sccreg_rr10() { LOGR(("%s\n", FUNCNAME)); logerror("%s() not implemented feature\n", FUNCNAME); @@ -1405,7 +1405,7 @@ UINT8 z80scc_channel::do_sccreg_rr10() On the ESCC, Read Register 11 reflects the contents of Write Register 10 provided the Extended Read option has been enabled. Otherwise, this register returns an image of RR15. On the NMOS/CMOS version, a read to this location returns an image of RR15.*/ -UINT8 z80scc_channel::do_sccreg_rr11() +uint8_t z80scc_channel::do_sccreg_rr11() { LOGR(("%s\n", FUNCNAME)); if (m_uart->m_variant & (SET_ESCC | z80scc_device::TYPE_SCC85C30)) @@ -1416,7 +1416,7 @@ UINT8 z80scc_channel::do_sccreg_rr11() /* RR12 returns the value stored in WR12, the lower byte of the time constant, for the BRG.*/ -UINT8 z80scc_channel::do_sccreg_rr12() +uint8_t z80scc_channel::do_sccreg_rr12() { LOGR(("%s\n", FUNCNAME)); return m_wr12; @@ -1424,7 +1424,7 @@ UINT8 z80scc_channel::do_sccreg_rr12() /* RR13 returns the value stored in WR13, the upper byte of the time constant for the BRG. */ -UINT8 z80scc_channel::do_sccreg_rr13() +uint8_t z80scc_channel::do_sccreg_rr13() { LOGR(("%s\n", FUNCNAME)); return m_wr13; @@ -1434,7 +1434,7 @@ UINT8 z80scc_channel::do_sccreg_rr13() On the ESCC, Read Register 14 reflects the contents of Write Register 7 Prime provided the Extended Read option has been enabled. Otherwise, this register returns an image of RR10. On the NMOS/CMOS version, a read to this location returns an image of RR10.*/ -UINT8 z80scc_channel::do_sccreg_rr14() +uint8_t z80scc_channel::do_sccreg_rr14() { LOGR(("%s\n", FUNCNAME)); if (m_uart->m_variant & (SET_ESCC | z80scc_device::TYPE_SCC85C30)) @@ -1446,7 +1446,7 @@ UINT8 z80scc_channel::do_sccreg_rr14() /* RR15 reflects the value stored in WR15, the External/Status IE bits. The two unused bits are always returned as Os. */ -UINT8 z80scc_channel::do_sccreg_rr15() +uint8_t z80scc_channel::do_sccreg_rr15() { LOGR(("%s\n", FUNCNAME)); logerror("%s() not implemented feature\n", FUNCNAME); @@ -1456,12 +1456,12 @@ UINT8 z80scc_channel::do_sccreg_rr15() //------------------------------------------------- // scc_register_read - read a SCC register //------------------------------------------------- -UINT8 z80scc_channel::scc_register_read( UINT8 reg) +uint8_t z80scc_channel::scc_register_read( uint8_t reg) { if (reg > 1) LOG(("%s %02x\n", FUNCNAME, reg)); - UINT8 data = 0; - UINT8 wreg = 0; + uint8_t data = 0; + uint8_t wreg = 0; /* Sort out 80X30 limitations in register access */ // if ((BIT(m_wr15, 2) == 0) || m_uart->m_variant == z80scc_device::TYPE_SCC8030) @@ -1517,9 +1517,9 @@ UINT8 z80scc_channel::scc_register_read( UINT8 reg) //------------------------------------------------- // control_read - read control register //------------------------------------------------- -UINT8 z80scc_channel::control_read() +uint8_t z80scc_channel::control_read() { - UINT8 data = 0; + uint8_t data = 0; int reg = m_uart->m_wr0_ptrbits; //m_wr0; int regmask = (WR0_REGISTER_MASK | (m_uart->m_wr0_ptrbits & WR0_POINT_HIGH)); @@ -1542,7 +1542,7 @@ UINT8 z80scc_channel::control_read() /* CRC Initialization Code handling - candidate for breaking out in a z80sio_base class Handle the WR0 CRC Reset/Init bits separatelly, needed by derived devices separatelly from the commands */ -void z80scc_channel::do_sccreg_wr0_resets(UINT8 data) +void z80scc_channel::do_sccreg_wr0_resets(uint8_t data) { LOG(("%s(%02x) %s",FUNCNAME, data, tag())); switch (data & WR0_CRC_RESET_CODE_MASK) @@ -1565,7 +1565,7 @@ void z80scc_channel::do_sccreg_wr0_resets(UINT8 data) } /**/ -void z80scc_channel::do_sccreg_wr0(UINT8 data) +void z80scc_channel::do_sccreg_wr0(uint8_t data) { m_wr0 = data; @@ -1666,7 +1666,7 @@ void z80scc_channel::do_sccreg_wr0(UINT8 data) } /* Write Register 1 is the control register for the various SCC interrupt and Wait/Request modes.*/ -void z80scc_channel::do_sccreg_wr1(UINT8 data) +void z80scc_channel::do_sccreg_wr1(uint8_t data) { LOG(("%s(%02x) \"%s\": %c : %s - %02x\n", FUNCNAME, data, m_owner->tag(), 'A' + m_index, FUNCNAME, data)); /* TODO: Sort out SCC specific behaviours from legacy SIO behaviours: @@ -1704,7 +1704,7 @@ void z80scc_channel::do_sccreg_wr1(UINT8 data) /*WR2 is the interrupt vector register. Only one vector register exists in the SCC, and it can be accessed through either channel. The interrupt vector can be modified by status information. This is controlled by the Vector Includes Status (VIS) and the Status High/Status Low bits in WR9.*/ -void z80scc_channel::do_sccreg_wr2(UINT8 data) +void z80scc_channel::do_sccreg_wr2(uint8_t data) { LOG(("%s(%02x) Setting the interrupt vector\n", FUNCNAME, data)); m_wr2 = data; @@ -1714,7 +1714,7 @@ void z80scc_channel::do_sccreg_wr2(UINT8 data) m_uart->check_interrupts(); } -void z80scc_channel::do_sccreg_wr3(UINT8 data) +void z80scc_channel::do_sccreg_wr3(uint8_t data) { LOG(("%s(%02x) Setting up the receiver\n", FUNCNAME, data)); m_wr3 = data; @@ -1725,7 +1725,7 @@ void z80scc_channel::do_sccreg_wr3(UINT8 data) receive_register_reset(); } -void z80scc_channel::do_sccreg_wr4(UINT8 data) +void z80scc_channel::do_sccreg_wr4(uint8_t data) { LOG(("%s(%02x) Setting up asynchronous frame format and clock\n", FUNCNAME, data)); if (data == m_wr4) @@ -1745,7 +1745,7 @@ void z80scc_channel::do_sccreg_wr4(UINT8 data) } } -void z80scc_channel::do_sccreg_wr5(UINT8 data) +void z80scc_channel::do_sccreg_wr5(uint8_t data) { LOG(("%s(%02x) Setting up the transmitter\n", FUNCNAME, data)); if (data == m_wr5) @@ -1754,7 +1754,7 @@ void z80scc_channel::do_sccreg_wr5(UINT8 data) } else { - // UINT8 old_wr5 = m_wr5; + // uint8_t old_wr5 = m_wr5; m_wr5 = data; LOG(("- Transmitter Enable %u\n", (data & WR5_TX_ENABLE) ? 1 : 0)); LOG(("- Transmitter Bits/Character %u\n", get_tx_word_length())); @@ -1772,20 +1772,20 @@ void z80scc_channel::do_sccreg_wr5(UINT8 data) } } -void z80scc_channel::do_sccreg_wr6(UINT8 data) +void z80scc_channel::do_sccreg_wr6(uint8_t data) { LOG(("%s(%02x) Transmit sync\n", FUNCNAME, data)); m_sync = (m_sync & 0xff00) | data; } -void z80scc_channel::do_sccreg_wr7(UINT8 data) +void z80scc_channel::do_sccreg_wr7(uint8_t data) { LOG(("%s(%02x) Receive sync\n", FUNCNAME, data)); m_sync = (data << 8) | (m_sync & 0xff); } /* WR8 is the transmit buffer register */ -void z80scc_channel::do_sccreg_wr8(UINT8 data) +void z80scc_channel::do_sccreg_wr8(uint8_t data) { LOG(("%s(%02x) \"%s\": %c : Transmit Buffer write %02x\n", FUNCNAME, data, m_owner->tag(), 'A' + m_index, data)); data_write(data); @@ -1795,7 +1795,7 @@ void z80scc_channel::do_sccreg_wr8(UINT8 data) exists in the SCC and is accessed from either channel. The Interrupt control bits are programmed at the same time as the Reset command, because these bits are only reset by a hardware reset note that the Z80X30 contains only one WR2 and WR9; these registers may be written from either channel.*/ -void z80scc_channel::do_sccreg_wr9(UINT8 data) +void z80scc_channel::do_sccreg_wr9(uint8_t data) { m_uart->m_wr9 = data; // There is only one WR9 register and is written from both channels A and B (if exists) @@ -1819,7 +1819,7 @@ void z80scc_channel::do_sccreg_wr9(UINT8 data) */ if (m_uart->m_variant & SET_Z80X30) { - UINT8 tmp_wr0 = m_wr0; // Save the Shift Left/Shift Right bits + uint8_t tmp_wr0 = m_wr0; // Save the Shift Left/Shift Right bits m_uart->device_reset(); // Restore the Shift Left/Shift Right bits m_wr0 &= 0xfc; @@ -1841,7 +1841,7 @@ void z80scc_channel::do_sccreg_wr9(UINT8 data) /* WR10 contains miscellaneous control bits for both the receiver and the transmitter. Bit positions for WR10 are displayed in Figure . On the ESCC and 85C30 with the Extended Read option enabled, this register may be read as RR11.*/ -void z80scc_channel::do_sccreg_wr10(UINT8 data) +void z80scc_channel::do_sccreg_wr10(uint8_t data) { m_wr10 = data; LOG(("\"%s\": %c : %s Misc Tx/Rx Control %02x - not implemented \n", m_owner->tag(), 'A' + m_index, FUNCNAME, data)); @@ -1850,7 +1850,7 @@ void z80scc_channel::do_sccreg_wr10(UINT8 data) /* WR11 is the Clock Mode Control register. The bits in this register control the sources of both the receive and transmit clocks, the type of signal on the /SYNC and /RTxC pins, and the direction of the /TRxC pin.*/ -void z80scc_channel::do_sccreg_wr11(UINT8 data) +void z80scc_channel::do_sccreg_wr11(uint8_t data) { LOG(("\"%s\": %c : %s Clock Mode Control %02x\n", m_owner->tag(), 'A' + m_index, FUNCNAME, data)); m_wr11 = data; @@ -1933,7 +1933,7 @@ void z80scc_channel::do_sccreg_wr11(UINT8 data) Time Constant = Clock Frequency / (2 * Desired Rate * Baud Rate Clock Period) - 2 */ -void z80scc_channel::do_sccreg_wr12(UINT8 data) +void z80scc_channel::do_sccreg_wr12(uint8_t data) { m_wr12 = data; update_serial(); @@ -1941,7 +1941,7 @@ void z80scc_channel::do_sccreg_wr12(UINT8 data) } /* WR13 contains the upper byte of the time constant for the baud rate generator. */ -void z80scc_channel::do_sccreg_wr13(UINT8 data) +void z80scc_channel::do_sccreg_wr13(uint8_t data) { m_wr13 = data; update_serial(); @@ -1950,7 +1950,7 @@ void z80scc_channel::do_sccreg_wr13(UINT8 data) /* WR14 contains some miscellaneous control bits */ -void z80scc_channel::do_sccreg_wr14(UINT8 data) +void z80scc_channel::do_sccreg_wr14(uint8_t data) { switch (data & WR14_DPLL_CMD_MASK) { @@ -2048,7 +2048,7 @@ void z80scc_channel::do_sccreg_wr14(UINT8 data) interrupt. This is true, even if an External/Status condition is pending at the time the bit is set*/ #define WR15EN "enabled" #define WR15NO "not implemented" -void z80scc_channel::do_sccreg_wr15(UINT8 data) +void z80scc_channel::do_sccreg_wr15(uint8_t data) { LOGINT(("%s(%02x) \"%s\": %c : External/Status Control Bits\n", FUNCNAME, data, m_owner->tag(), 'A' + m_index)); @@ -2063,7 +2063,7 @@ void z80scc_channel::do_sccreg_wr15(UINT8 data) m_wr15 = data; } -void z80scc_channel::scc_register_write(UINT8 reg, UINT8 data) +void z80scc_channel::scc_register_write(uint8_t reg, uint8_t data) { switch (reg) { @@ -2109,10 +2109,10 @@ with 0 before accessing WR0 or RR0.*/ // control_write - write control register //------------------------------------------------- -void z80scc_channel::control_write(UINT8 data) +void z80scc_channel::control_write(uint8_t data) { - UINT8 reg = m_uart->m_wr0_ptrbits; //m_wr0; - UINT8 regmask = (WR0_REGISTER_MASK | (m_uart->m_wr0_ptrbits & WR0_POINT_HIGH)); + uint8_t reg = m_uart->m_wr0_ptrbits; //m_wr0; + uint8_t regmask = (WR0_REGISTER_MASK | (m_uart->m_wr0_ptrbits & WR0_POINT_HIGH)); m_uart->m_wr0_ptrbits = 0; // The "Point High" command is only valid for one access @@ -2135,9 +2135,9 @@ void z80scc_channel::control_write(UINT8 data) // data_read - read data register from fifo //------------------------------------------------- -UINT8 z80scc_channel::data_read() +uint8_t z80scc_channel::data_read() { - UINT8 data = 0; + uint8_t data = 0; LOG(("%s \"%s\": %c : Data Register Read: ", FUNCNAME, m_owner->tag(), 'A' + m_index)); @@ -2199,10 +2199,10 @@ UINT8 z80scc_channel::data_read() } /* Get data from top of fifo data but restore read pointer in case of exit latch lock */ -UINT8 z80scc_channel::m_rx_fifo_rp_data() +uint8_t z80scc_channel::m_rx_fifo_rp_data() { - UINT8 data; - UINT8 old_rp = m_rx_fifo_rp; + uint8_t data; + uint8_t old_rp = m_rx_fifo_rp; m_rx_fifo_rp_step(); data = m_rx_data_fifo[m_rx_fifo_rp]; m_rx_fifo_rp = old_rp; @@ -2245,7 +2245,7 @@ WRITE8_MEMBER (z80scc_device::db_w) { m_chanB->data_write(data); } //------------------------------------------------- // data_write - write data register //------------------------------------------------- -void z80scc_channel::data_write(UINT8 data) +void z80scc_channel::data_write(uint8_t data) { /* Tx FIFO is full or...? */ if ( !(m_rr0 & RR0_TX_BUFFER_EMPTY) && // NMOS/CMOS 1 slot "FIFO" is controlled by the TBE bit instead of fifo logic @@ -2313,7 +2313,7 @@ void z80scc_channel::data_write(UINT8 data) // receive_data - receive data word into fifo //------------------------------------------------- -void z80scc_channel::receive_data(UINT8 data) +void z80scc_channel::receive_data(uint8_t data) { LOG(("\"%s\": %c : Receive Data Byte '%02x'\n", m_owner->tag(), 'A' + m_index, data)); diff --git a/src/devices/machine/z80scc.h b/src/devices/machine/z80scc.h index 69143eed02a..34c52ce5032 100644 --- a/src/devices/machine/z80scc.h +++ b/src/devices/machine/z80scc.h @@ -147,7 +147,7 @@ class z80scc_channel : public device_t, friend class z80scc_device; public: - z80scc_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80scc_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -161,54 +161,54 @@ public: virtual void rcv_complete() override; // read register handlers - UINT8 do_sccreg_rr0(); - UINT8 do_sccreg_rr1(); - UINT8 do_sccreg_rr2(); - UINT8 do_sccreg_rr3(); - UINT8 do_sccreg_rr4(); - UINT8 do_sccreg_rr5(); - UINT8 do_sccreg_rr6(); - UINT8 do_sccreg_rr7(); - UINT8 do_sccreg_rr7p(){ return 0; } // Needs to be implemented for Synchronous mode - // UINT8 do_sccreg_rr8(); Short cutted due to frequent use - UINT8 do_sccreg_rr9(); - UINT8 do_sccreg_rr10(); - UINT8 do_sccreg_rr11(); - UINT8 do_sccreg_rr12(); - UINT8 do_sccreg_rr13(); - UINT8 do_sccreg_rr14(); - UINT8 do_sccreg_rr15(); + uint8_t do_sccreg_rr0(); + uint8_t do_sccreg_rr1(); + uint8_t do_sccreg_rr2(); + uint8_t do_sccreg_rr3(); + uint8_t do_sccreg_rr4(); + uint8_t do_sccreg_rr5(); + uint8_t do_sccreg_rr6(); + uint8_t do_sccreg_rr7(); + uint8_t do_sccreg_rr7p(){ return 0; } // Needs to be implemented for Synchronous mode + // uint8_t do_sccreg_rr8(); Short cutted due to frequent use + uint8_t do_sccreg_rr9(); + uint8_t do_sccreg_rr10(); + uint8_t do_sccreg_rr11(); + uint8_t do_sccreg_rr12(); + uint8_t do_sccreg_rr13(); + uint8_t do_sccreg_rr14(); + uint8_t do_sccreg_rr15(); // write register handlers - void do_sccreg_wr0(UINT8 data); - void do_sccreg_wr0_resets(UINT8 data); - void do_sccreg_wr1(UINT8 data); - void do_sccreg_wr2(UINT8 data); - void do_sccreg_wr3(UINT8 data); - void do_sccreg_wr4(UINT8 data); - void do_sccreg_wr5(UINT8 data); - void do_sccreg_wr6(UINT8 data); - void do_sccreg_wr7(UINT8 data); - void do_sccreg_wr7p(UINT8 data){}; // Needs to be implemented for Synchronous mode - void do_sccreg_wr8(UINT8 data); - void do_sccreg_wr9(UINT8 data); - void do_sccreg_wr10(UINT8 data); - void do_sccreg_wr11(UINT8 data); - void do_sccreg_wr12(UINT8 data); - void do_sccreg_wr13(UINT8 data); - void do_sccreg_wr14(UINT8 data); - void do_sccreg_wr15(UINT8 data); - - UINT8 control_read(); - void control_write(UINT8 data); - - UINT8 data_read(); - void data_write(UINT8 data); - - void receive_data(UINT8 data); + void do_sccreg_wr0(uint8_t data); + void do_sccreg_wr0_resets(uint8_t data); + void do_sccreg_wr1(uint8_t data); + void do_sccreg_wr2(uint8_t data); + void do_sccreg_wr3(uint8_t data); + void do_sccreg_wr4(uint8_t data); + void do_sccreg_wr5(uint8_t data); + void do_sccreg_wr6(uint8_t data); + void do_sccreg_wr7(uint8_t data); + void do_sccreg_wr7p(uint8_t data){}; // Needs to be implemented for Synchronous mode + void do_sccreg_wr8(uint8_t data); + void do_sccreg_wr9(uint8_t data); + void do_sccreg_wr10(uint8_t data); + void do_sccreg_wr11(uint8_t data); + void do_sccreg_wr12(uint8_t data); + void do_sccreg_wr13(uint8_t data); + void do_sccreg_wr14(uint8_t data); + void do_sccreg_wr15(uint8_t data); + + uint8_t control_read(); + void control_write(uint8_t data); + + uint8_t data_read(); + void data_write(uint8_t data); + + void receive_data(uint8_t data); void m_tx_fifo_rp_step(); void m_rx_fifo_rp_step(); - UINT8 m_rx_fifo_rp_data(); + uint8_t m_rx_fifo_rp_data(); DECLARE_WRITE_LINE_MEMBER( write_rx ); DECLARE_WRITE_LINE_MEMBER( cts_w ); @@ -223,42 +223,42 @@ public: // Register state // read registers enum - UINT8 m_rr0; // REG_RR0_STATUS - UINT8 m_rr1; // REG_RR1_SPEC_RCV_COND - UINT8 m_rr2; // REG_RR2_INTERRUPT_VECT - UINT8 m_rr3; // REG_RR3_INTERUPPT_PEND - UINT8 m_rr4; // REG_RR4_WR4_OR_RR0 - UINT8 m_rr5; // REG_RR5_WR5_OR_RR0 - UINT8 m_rr6; // REG_RR6_LSB_OR_RR2 - UINT8 m_rr7; // REG_RR7_MSB_OR_RR3 - UINT8 m_rr7p; - UINT8 m_rr8; // REG_RR8_RECEIVE_DATA - UINT8 m_rr9; // REG_RR9_WR3_OR_RR13 - UINT8 m_rr10; // REG_RR10_MISC_STATUS - UINT8 m_rr11; // REG_RR11_WR10_OR_RR15 - UINT8 m_rr12; // REG_RR12_LO_TIME_CONST - UINT8 m_rr13; // REG_RR13_HI_TIME_CONST - UINT8 m_rr14; // REG_RR14_WR7_OR_R10 - UINT8 m_rr15; // REG_RR15_WR15_EXT_STAT + uint8_t m_rr0; // REG_RR0_STATUS + uint8_t m_rr1; // REG_RR1_SPEC_RCV_COND + uint8_t m_rr2; // REG_RR2_INTERRUPT_VECT + uint8_t m_rr3; // REG_RR3_INTERUPPT_PEND + uint8_t m_rr4; // REG_RR4_WR4_OR_RR0 + uint8_t m_rr5; // REG_RR5_WR5_OR_RR0 + uint8_t m_rr6; // REG_RR6_LSB_OR_RR2 + uint8_t m_rr7; // REG_RR7_MSB_OR_RR3 + uint8_t m_rr7p; + uint8_t m_rr8; // REG_RR8_RECEIVE_DATA + uint8_t m_rr9; // REG_RR9_WR3_OR_RR13 + uint8_t m_rr10; // REG_RR10_MISC_STATUS + uint8_t m_rr11; // REG_RR11_WR10_OR_RR15 + uint8_t m_rr12; // REG_RR12_LO_TIME_CONST + uint8_t m_rr13; // REG_RR13_HI_TIME_CONST + uint8_t m_rr14; // REG_RR14_WR7_OR_R10 + uint8_t m_rr15; // REG_RR15_WR15_EXT_STAT // write registers enum - UINT8 m_wr0; // REG_WR0_COMMAND_REGPT - UINT8 m_wr1; // REG_WR1_INT_DMA_ENABLE - UINT8 m_wr2; // REG_WR2_INT_VECTOR - UINT8 m_wr3; // REG_WR3_RX_CONTROL - UINT8 m_wr4; // REG_WR4_RX_TX_MODES - UINT8 m_wr5; // REG_WR5_TX_CONTROL - UINT8 m_wr6; // REG_WR6_SYNC_OR_SDLC_A - UINT8 m_wr7; // REG_WR7_SYNC_OR_SDLC_F - UINT8 m_wr7p; // - UINT8 m_wr8; // REG_WR8_TRANSMIT_DATA - // UINT8 m_wr9; // REG_WR9_MASTER_INT_CTRL - UINT8 m_wr10; // REG_WR10_MSC_RX_TX_CTRL - UINT8 m_wr11; // REG_WR11_CLOCK_MODES - UINT8 m_wr12; // REG_WR12_LO_BAUD_GEN - UINT8 m_wr13; // REG_WR13_HI_BAUD_GEN - UINT8 m_wr14; // REG_WR14_MISC_CTRL - UINT8 m_wr15; // REG_WR15_EXT_ST_INT_CTRL + uint8_t m_wr0; // REG_WR0_COMMAND_REGPT + uint8_t m_wr1; // REG_WR1_INT_DMA_ENABLE + uint8_t m_wr2; // REG_WR2_INT_VECTOR + uint8_t m_wr3; // REG_WR3_RX_CONTROL + uint8_t m_wr4; // REG_WR4_RX_TX_MODES + uint8_t m_wr5; // REG_WR5_TX_CONTROL + uint8_t m_wr6; // REG_WR6_SYNC_OR_SDLC_A + uint8_t m_wr7; // REG_WR7_SYNC_OR_SDLC_F + uint8_t m_wr7p; // + uint8_t m_wr8; // REG_WR8_TRANSMIT_DATA + // uint8_t m_wr9; // REG_WR9_MASTER_INT_CTRL + uint8_t m_wr10; // REG_WR10_MSC_RX_TX_CTRL + uint8_t m_wr11; // REG_WR11_CLOCK_MODES + uint8_t m_wr12; // REG_WR12_LO_BAUD_GEN + uint8_t m_wr13; // REG_WR13_HI_BAUD_GEN + uint8_t m_wr14; // REG_WR14_MISC_CTRL + uint8_t m_wr15; // REG_WR15_EXT_ST_INT_CTRL protected: enum @@ -541,15 +541,15 @@ protected: #if LOCAL_BRG emu_timer *baudtimer; - UINT16 m_brg_counter; + uint16_t m_brg_counter; #else unsigned int m_brg_rate; #endif unsigned int m_delayed_tx_brg_change; unsigned int m_brg_const; - void scc_register_write(UINT8 reg, UINT8 data); - UINT8 scc_register_read(UINT8 reg); + void scc_register_write(uint8_t reg, uint8_t data); + uint8_t scc_register_read(uint8_t reg); void update_serial(); void set_dtr(int state); void set_rts(int state); @@ -562,9 +562,9 @@ protected: void safe_transmit_register_reset(); // receiver state - UINT8 m_rx_data_fifo[8]; // receive data FIFO - UINT8 m_rx_error_fifo[8]; // receive error FIFO - UINT8 m_rx_error; // current receive error + uint8_t m_rx_data_fifo[8]; // receive data FIFO + uint8_t m_rx_error_fifo[8]; // receive error FIFO + uint8_t m_rx_error; // current receive error //int m_rx_fifo // receive FIFO pointer int m_rx_fifo_rp; // receive FIFO read pointer int m_rx_fifo_wp; // receive FIFO write pointer @@ -573,7 +573,7 @@ protected: int m_rx_clock; // receive clock pulse count int m_rx_first; // first character received int m_rx_break; // receive break condition - UINT8 m_rx_rr0_latch; // read register 0 latched + uint8_t m_rx_rr0_latch; // read register 0 latched int m_rxd; int m_ri; // ring indicator latch @@ -581,20 +581,20 @@ protected: int m_dcd; // data carrier detect latch // transmitter state - UINT8 m_tx_data_fifo[4]; // data FIFO - UINT8 m_tx_error_fifo[4]; // error FIFO + uint8_t m_tx_data_fifo[4]; // data FIFO + uint8_t m_tx_error_fifo[4]; // error FIFO int m_tx_fifo_rp; // FIFO read pointer int m_tx_fifo_wp; // FIFO write pointer int m_tx_fifo_sz; // FIFO size - UINT8 m_tx_error; // current error - // UINT8 m_tx_data; // transmit data register + uint8_t m_tx_error; // current error + // uint8_t m_tx_data; // transmit data register int m_tx_clock; // transmit clock pulse count int m_dtr; // data terminal ready int m_rts; // request to send // synchronous state - UINT16 m_sync; // sync character + uint16_t m_sync; // sync character int m_rcv_mode; int m_index; @@ -602,7 +602,7 @@ protected: // SCC specifics int m_ph; // Point high command to access regs 08-0f - UINT8 m_zc; + uint8_t m_zc; }; @@ -615,8 +615,8 @@ class z80scc_device : public device_t public: // construction/destruction - z80scc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - z80scc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80scc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + z80scc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_txda_callback(device_t &device, _Object object) { return downcast(device).m_out_txda_cb.set_callback(object); } template static devcb_base &set_out_dtra_callback(device_t &device, _Object object) { return downcast(device).m_out_dtra_cb.set_callback(object); } @@ -668,7 +668,7 @@ public: int m1_r(); // Single registers instances accessed from both channels - UINT8 m_wr9; // REG_WR9_MASTER_INT_CTRL + uint8_t m_wr9; // REG_WR9_MASTER_INT_CTRL DECLARE_WRITE_LINE_MEMBER( rxa_w ) { m_chanA->write_rx(state); } DECLARE_WRITE_LINE_MEMBER( rxb_w ) { m_chanB->write_rx(state); } @@ -700,7 +700,7 @@ protected: // internal interrupt management void check_interrupts(); void reset_interrupts(); - UINT8 modify_vector(UINT8 vect, int i, UINT8 src); + uint8_t modify_vector(uint8_t vect, int i, uint8_t src); void trigger_interrupt(int index, int state); @@ -765,55 +765,55 @@ protected: int m_int_source[6]; // interrupt source int m_variant; - UINT8 m_wr0_ptrbits; + uint8_t m_wr0_ptrbits; }; class scc8030_device : public z80scc_device { public : - scc8030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc8030_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class scc80C30_device : public z80scc_device { public : - scc80C30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc80C30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class scc80230_device : public z80scc_device { public : - scc80230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc80230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class scc8530_device : public z80scc_device { public : - scc8530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc8530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class scc85C30_device : public z80scc_device { public : - scc85C30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc85C30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class scc85230_device : public z80scc_device { public : - scc85230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc85230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class scc85233_device : public z80scc_device { public : - scc85233_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc85233_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class scc8523L_device : public z80scc_device { public : - scc8523L_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scc8523L_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // device type definition diff --git a/src/devices/machine/z80sio.cpp b/src/devices/machine/z80sio.cpp index db8be73850e..e5553ac0271 100644 --- a/src/devices/machine/z80sio.cpp +++ b/src/devices/machine/z80sio.cpp @@ -103,7 +103,7 @@ machine_config_constructor z80sio_device::device_mconfig_additions() const // z80sio_device - constructor //------------------------------------------------- -z80sio_device::z80sio_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +z80sio_device::z80sio_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_z80daisy_interface(mconfig, *this), m_chanA(*this, CHANA_TAG), @@ -133,7 +133,7 @@ z80sio_device::z80sio_device(const machine_config &mconfig, device_type type, co elem = 0; } -z80sio_device::z80sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80sio_device::z80sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80SIO, "Z80 SIO", tag, owner, clock, "z80sio", __FILE__), device_z80daisy_interface(mconfig, *this), m_chanA(*this, CHANA_TAG), @@ -331,7 +331,7 @@ void z80sio_device::reset_interrupts() //------------------------------------------------- void z80sio_device::trigger_interrupt(int index, int state) { - UINT8 vector = m_chanB->m_wr2; + uint8_t vector = m_chanB->m_wr2; int priority; LOG(("%s %s \n",FUNCNAME, tag())); @@ -479,7 +479,7 @@ WRITE8_MEMBER( z80sio_device::ba_cd_w ) //------------------------------------------------- // z80sio_channel - constructor //------------------------------------------------- -z80sio_channel::z80sio_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80sio_channel::z80sio_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80SIO_CHANNEL, "Z80 SIO channel", tag, owner, clock, "z80sio_channel", __FILE__), device_serial_interface(mconfig, *this), m_rx_error(0), @@ -707,7 +707,7 @@ void z80sio_channel::rcv_callback() //------------------------------------------------- void z80sio_channel::rcv_complete() { - UINT8 data; + uint8_t data; receive_register_extract(); data = get_received_char(); @@ -839,7 +839,7 @@ int z80sio_channel::get_tx_word_length() * This register contains the status of the receive and transmit buffers; the * DCD, CTS, and SYNC inputs; the Transmit Underrun/EOM latch; and the * Break/Abort latch. */ -UINT8 z80sio_channel::do_sioreg_rr0() +uint8_t z80sio_channel::do_sioreg_rr0() { LOG(("%s %s\n",FUNCNAME, tag())); return m_rr0; @@ -847,7 +847,7 @@ UINT8 z80sio_channel::do_sioreg_rr0() /* * This register contains the Special Receive condition status bits and Residue * codes for the I-Field in the SDLC Receive Mode. */ -UINT8 z80sio_channel::do_sioreg_rr1() +uint8_t z80sio_channel::do_sioreg_rr1() { LOG(("%s %s\n",FUNCNAME, tag())); return m_rr1; @@ -860,7 +860,7 @@ Register 1 section. When this register is read, the vector returned is modi- fied by the highest priority interrupting condition at the time of the read. If no interrupts are pending, the vector is modified with V3 = 0, V2 = 1, and V1 = 1. This register is read only through Channel B. */ -UINT8 z80sio_channel::do_sioreg_rr2() +uint8_t z80sio_channel::do_sioreg_rr2() { LOG(("%s %s\n",FUNCNAME, tag())); // channel B only @@ -872,10 +872,10 @@ UINT8 z80sio_channel::do_sioreg_rr2() // control_read - read control register //------------------------------------------------- -UINT8 z80sio_channel::control_read() +uint8_t z80sio_channel::control_read() { - UINT8 data = 0; - UINT8 reg = m_wr0 & WR0_REGISTER_MASK; + uint8_t data = 0; + uint8_t reg = m_wr0 & WR0_REGISTER_MASK; //LOG(("%s %s\n",FUNCNAME, tag())); if (reg != 0) @@ -899,7 +899,7 @@ UINT8 z80sio_channel::control_read() /* SIO CRC Initialization Code handling - candidate for breaking out in a z80sio_base class Handle the WR0 CRC Reset/Init bits separatelly, needed by derived devices separatelly from the commands */ -void z80sio_channel::do_sioreg_wr0_resets(UINT8 data) +void z80sio_channel::do_sioreg_wr0_resets(uint8_t data) { LOG(("%s %s\n",FUNCNAME, tag())); switch (data & WR0_CRC_RESET_CODE_MASK) @@ -921,7 +921,7 @@ void z80sio_channel::do_sioreg_wr0_resets(UINT8 data) } } -void z80sio_channel::do_sioreg_wr0(UINT8 data) +void z80sio_channel::do_sioreg_wr0(uint8_t data) { m_wr0 = data; switch (data & WR0_COMMAND_MASK) @@ -973,7 +973,7 @@ void z80sio_channel::do_sioreg_wr0(UINT8 data) do_sioreg_wr0_resets(data); } -void z80sio_channel::do_sioreg_wr1(UINT8 data) +void z80sio_channel::do_sioreg_wr1(uint8_t data) { /* TODO: implement vector modifications when WR1 bit D2 is changed */ m_wr1 = data; @@ -1004,7 +1004,7 @@ void z80sio_channel::do_sioreg_wr1(UINT8 data) } } -void z80sio_channel::do_sioreg_wr2(UINT8 data) +void z80sio_channel::do_sioreg_wr2(uint8_t data) { m_wr2 = data; if (m_index == z80sio_device::CHANNEL_B) @@ -1018,7 +1018,7 @@ void z80sio_channel::do_sioreg_wr2(UINT8 data) LOG(("Z80SIO \"%s\" Channel %c : Interrupt Vector %02x\n", m_owner->tag(), 'A' + m_index, data)); } -void z80sio_channel::do_sioreg_wr3(UINT8 data) +void z80sio_channel::do_sioreg_wr3(uint8_t data) { m_wr3 = data; LOG(("Z80SIO \"%s\" Channel %c : Receiver Enable %u\n", m_owner->tag(), 'A' + m_index, (data & WR3_RX_ENABLE) ? 1 : 0)); @@ -1026,7 +1026,7 @@ void z80sio_channel::do_sioreg_wr3(UINT8 data) LOG(("Z80SIO \"%s\" Channel %c : Receiver Bits/Character %u\n", m_owner->tag(), 'A' + m_index, get_rx_word_length())); } -void z80sio_channel::do_sioreg_wr4(UINT8 data) +void z80sio_channel::do_sioreg_wr4(uint8_t data) { m_wr4 = data; LOG(("Z80SIO \"%s\" Channel %c : Parity Enable %u\n", m_owner->tag(), 'A' + m_index, (data & WR4_PARITY_ENABLE) ? 1 : 0)); @@ -1035,7 +1035,7 @@ void z80sio_channel::do_sioreg_wr4(UINT8 data) LOG(("Z80SIO \"%s\" Channel %c : Clock Mode %uX\n", m_owner->tag(), 'A' + m_index, get_clock_mode())); } -void z80sio_channel::do_sioreg_wr5(UINT8 data) +void z80sio_channel::do_sioreg_wr5(uint8_t data) { m_wr5 = data; LOG(("Z80SIO \"%s\" Channel %c : Transmitter Enable %u\n", m_owner->tag(), 'A' + m_index, (data & WR5_TX_ENABLE) ? 1 : 0)); @@ -1045,13 +1045,13 @@ void z80sio_channel::do_sioreg_wr5(UINT8 data) LOG(("Z80SIO \"%s\" Channel %c : Data Terminal Ready %u\n", m_owner->tag(), 'A' + m_index, (data & WR5_DTR) ? 1 : 0)); } -void z80sio_channel::do_sioreg_wr6(UINT8 data) +void z80sio_channel::do_sioreg_wr6(uint8_t data) { LOG(("Z80SIO \"%s\" Channel %c : Transmit Sync %02x\n", m_owner->tag(), 'A' + m_index, data)); m_sync = (m_sync & 0xff00) | data; } -void z80sio_channel::do_sioreg_wr7(UINT8 data) +void z80sio_channel::do_sioreg_wr7(uint8_t data) { LOG(("Z80SIO \"%s\" Channel %c : Receive Sync %02x\n", m_owner->tag(), 'A' + m_index, data)); m_sync = (data << 8) | (m_sync & 0xff); @@ -1060,9 +1060,9 @@ void z80sio_channel::do_sioreg_wr7(UINT8 data) //------------------------------------------------- // control_write - write control register //------------------------------------------------- -void z80sio_channel::control_write(UINT8 data) +void z80sio_channel::control_write(uint8_t data) { - UINT8 reg = m_wr0 & WR0_REGISTER_MASK; + uint8_t reg = m_wr0 & WR0_REGISTER_MASK; if (reg != 0) { @@ -1091,9 +1091,9 @@ void z80sio_channel::control_write(UINT8 data) //------------------------------------------------- // data_read - read data register //------------------------------------------------- -UINT8 z80sio_channel::data_read() +uint8_t z80sio_channel::data_read() { - UINT8 data = 0; + uint8_t data = 0; if (m_rx_fifo >= 0) { @@ -1122,7 +1122,7 @@ UINT8 z80sio_channel::data_read() //------------------------------------------------- // data_write - write data register //------------------------------------------------- -void z80sio_channel::data_write(UINT8 data) +void z80sio_channel::data_write(uint8_t data) { m_tx_data = data; @@ -1151,7 +1151,7 @@ void z80sio_channel::data_write(UINT8 data) //------------------------------------------------- // receive_data - receive data word //------------------------------------------------- -void z80sio_channel::receive_data(UINT8 data) +void z80sio_channel::receive_data(uint8_t data) { LOG(("%s(%02x) %s:%c\n",FUNCNAME, data, tag(), 'A' + m_index)); diff --git a/src/devices/machine/z80sio.h b/src/devices/machine/z80sio.h index 3eac1e98d69..f0fe3148a6e 100644 --- a/src/devices/machine/z80sio.h +++ b/src/devices/machine/z80sio.h @@ -129,7 +129,7 @@ class z80sio_channel : public device_t, friend class z80sio_device; public: - z80sio_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80sio_channel(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -143,28 +143,28 @@ public: virtual void rcv_complete() override; // read register handlers - UINT8 do_sioreg_rr0(); - UINT8 do_sioreg_rr1(); - UINT8 do_sioreg_rr2(); + uint8_t do_sioreg_rr0(); + uint8_t do_sioreg_rr1(); + uint8_t do_sioreg_rr2(); // write register handlers - void do_sioreg_wr0(UINT8 data); - void do_sioreg_wr0_resets(UINT8 data); - void do_sioreg_wr1(UINT8 data); - void do_sioreg_wr2(UINT8 data); - void do_sioreg_wr3(UINT8 data); - void do_sioreg_wr4(UINT8 data); - void do_sioreg_wr5(UINT8 data); - void do_sioreg_wr6(UINT8 data); - void do_sioreg_wr7(UINT8 data); + void do_sioreg_wr0(uint8_t data); + void do_sioreg_wr0_resets(uint8_t data); + void do_sioreg_wr1(uint8_t data); + void do_sioreg_wr2(uint8_t data); + void do_sioreg_wr3(uint8_t data); + void do_sioreg_wr4(uint8_t data); + void do_sioreg_wr5(uint8_t data); + void do_sioreg_wr6(uint8_t data); + void do_sioreg_wr7(uint8_t data); - UINT8 control_read(); - void control_write(UINT8 data); + uint8_t control_read(); + void control_write(uint8_t data); - UINT8 data_read(); - void data_write(UINT8 data); + uint8_t data_read(); + void data_write(uint8_t data); - void receive_data(UINT8 data); + void receive_data(uint8_t data); DECLARE_WRITE_LINE_MEMBER( write_rx ); DECLARE_WRITE_LINE_MEMBER( cts_w ); @@ -179,18 +179,18 @@ public: // Register state // read registers enum - UINT8 m_rr0; // REG_RR0_STATUS - UINT8 m_rr1; // REG_RR1_SPEC_RCV_COND - UINT8 m_rr2; // REG_RR2_INTERRUPT_VECT + uint8_t m_rr0; // REG_RR0_STATUS + uint8_t m_rr1; // REG_RR1_SPEC_RCV_COND + uint8_t m_rr2; // REG_RR2_INTERRUPT_VECT // write registers enum - UINT8 m_wr0; // REG_WR0_COMMAND_REGPT - UINT8 m_wr1; // REG_WR1_INT_DMA_ENABLE - UINT8 m_wr2; // REG_WR2_INT_VECTOR - UINT8 m_wr3; // REG_WR3_RX_CONTROL - UINT8 m_wr4; // REG_WR4_RX_TX_MODES - UINT8 m_wr5; // REG_WR5_TX_CONTROL - UINT8 m_wr6; // REG_WR6_SYNC_OR_SDLC_A - UINT8 m_wr7; // REG_WR7_SYNC_OR_SDLC_F + uint8_t m_wr0; // REG_WR0_COMMAND_REGPT + uint8_t m_wr1; // REG_WR1_INT_DMA_ENABLE + uint8_t m_wr2; // REG_WR2_INT_VECTOR + uint8_t m_wr3; // REG_WR3_RX_CONTROL + uint8_t m_wr4; // REG_WR4_RX_TX_MODES + uint8_t m_wr5; // REG_WR5_TX_CONTROL + uint8_t m_wr6; // REG_WR6_SYNC_OR_SDLC_A + uint8_t m_wr7; // REG_WR7_SYNC_OR_SDLC_F int m_variant; // Set in device @@ -366,15 +366,15 @@ protected: int get_tx_word_length(); // receiver state - UINT8 m_rx_data_fifo[3]; // receive data FIFO - UINT8 m_rx_error_fifo[3]; // receive error FIFO - UINT8 m_rx_error; // current receive error + uint8_t m_rx_data_fifo[3]; // receive data FIFO + uint8_t m_rx_error_fifo[3]; // receive error FIFO + uint8_t m_rx_error; // current receive error int m_rx_fifo; // receive FIFO pointer int m_rx_clock; // receive clock pulse count int m_rx_first; // first character received int m_rx_break; // receive break condition - UINT8 m_rx_rr0_latch; // read register 0 latched + uint8_t m_rx_rr0_latch; // read register 0 latched int m_rxd; int m_sh; // sync hunt @@ -382,14 +382,14 @@ protected: int m_dcd; // data carrier detect latch // transmitter state - UINT8 m_tx_data; // transmit data register + uint8_t m_tx_data; // transmit data register int m_tx_clock; // transmit clock pulse count int m_dtr; // data terminal ready int m_rts; // request to send // synchronous state - UINT16 m_sync; // sync character + uint16_t m_sync; // sync character int m_index; z80sio_device *m_uart; @@ -405,8 +405,8 @@ class z80sio_device : public device_t, public: // construction/destruction - z80sio_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - z80sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80sio_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + z80sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_txda_callback(device_t &device, _Object object) { return downcast(device).m_out_txda_cb.set_callback(object); } template static devcb_base &set_out_dtra_callback(device_t &device, _Object object) { return downcast(device).m_out_dtra_cb.set_callback(object); } diff --git a/src/devices/machine/z80sti.cpp b/src/devices/machine/z80sti.cpp index e8900abd021..fb0e42fd725 100644 --- a/src/devices/machine/z80sti.cpp +++ b/src/devices/machine/z80sti.cpp @@ -63,7 +63,7 @@ const int z80sti_device::INT_LEVEL_TIMER[] = }; // interrupt vectors -const UINT8 z80sti_device::INT_VECTOR[] = +const uint8_t z80sti_device::INT_VECTOR[] = { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e @@ -82,7 +82,7 @@ const int z80sti_device::PRESCALER[] = { 0, 4, 10, 16, 50, 64, 100, 200 }; // z80sti_device - constructor //------------------------------------------------- -z80sti_device::z80sti_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +z80sti_device::z80sti_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z80STI, "Mostek MK3801", tag, owner, clock, "z80sti", __FILE__), device_serial_interface(mconfig, *this), device_z80daisy_interface(mconfig, *this), @@ -269,7 +269,7 @@ int z80sti_device::z80daisy_irq_ack() // find the first channel with an interrupt requested if (m_int_state[i] & Z80_DAISY_INT) { - UINT8 vector = (m_pvr & 0xe0) | INT_VECTOR[i]; + uint8_t vector = (m_pvr & 0xe0) | INT_VECTOR[i]; // clear interrupt, switch to the IEO state, and update the IRQs m_int_state[i] = Z80_DAISY_IEO; @@ -370,7 +370,7 @@ void z80sti_device::take_interrupt(int level) READ8_MEMBER( z80sti_device::read ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0x0f) { diff --git a/src/devices/machine/z80sti.h b/src/devices/machine/z80sti.h index f0db981ac9e..4f480da4a42 100644 --- a/src/devices/machine/z80sti.h +++ b/src/devices/machine/z80sti.h @@ -81,7 +81,7 @@ class z80sti_device : public device_t, { public: // construction/destruction - z80sti_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z80sti_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_out_int_callback(device_t &device, _Object object) { return downcast(device).m_out_int_cb.set_callback(object); } template static devcb_base &set_in_gpio_callback(device_t &device, _Object object) { return downcast(device).m_in_gpio_cb.set_callback(object); } @@ -173,7 +173,7 @@ private: static const int INT_LEVEL_GPIP[]; static const int INT_LEVEL_TIMER[]; - static const UINT8 INT_VECTOR[]; + static const uint8_t INT_VECTOR[]; static const int PRESCALER[]; // device-level overrides @@ -211,31 +211,31 @@ private: int m_tx_clock; // serial transmit clock // I/O state - UINT8 m_gpip; // general purpose I/O register - UINT8 m_aer; // active edge register - UINT8 m_ddr; // data direction register + uint8_t m_gpip; // general purpose I/O register + uint8_t m_aer; // active edge register + uint8_t m_ddr; // data direction register // interrupt state - UINT16 m_ier; // interrupt enable register - UINT16 m_ipr; // interrupt pending register - UINT16 m_isr; // interrupt in-service register - UINT16 m_imr; // interrupt mask register - UINT8 m_pvr; // interrupt vector register + uint16_t m_ier; // interrupt enable register + uint16_t m_ipr; // interrupt pending register + uint16_t m_isr; // interrupt in-service register + uint16_t m_imr; // interrupt mask register + uint8_t m_pvr; // interrupt vector register int m_int_state[16]; // interrupt state // timer state - UINT8 m_tabc; // timer A/B control register - UINT8 m_tcdc; // timer C/D control register - UINT8 m_tdr[4]; // timer data registers - UINT8 m_tmc[4]; // timer main counters + uint8_t m_tabc; // timer A/B control register + uint8_t m_tcdc; // timer C/D control register + uint8_t m_tdr[4]; // timer data registers + uint8_t m_tmc[4]; // timer main counters int m_to[4]; // timer out latch // serial state - UINT8 m_scr; // synchronous character register - UINT8 m_ucr; // USART control register - UINT8 m_tsr; // transmitter status register - UINT8 m_rsr; // receiver status register - UINT8 m_udr; // USART data register + uint8_t m_scr; // synchronous character register + uint8_t m_ucr; // USART control register + uint8_t m_tsr; // transmitter status register + uint8_t m_rsr; // receiver status register + uint8_t m_udr; // USART data register // timers emu_timer *m_timer[4]; // counter timers diff --git a/src/devices/machine/z8536.cpp b/src/devices/machine/z8536.cpp index 9a036d12b5a..4c36ab242ec 100644 --- a/src/devices/machine/z8536.cpp +++ b/src/devices/machine/z8536.cpp @@ -121,7 +121,7 @@ static const char *CTMS_DCS[] = { "Pulse", "One-shot", "Square Wave", "Do not us void z8536_device::get_interrupt_vector() { - UINT8 vector = 0xff; + uint8_t vector = 0xff; if (m_register[MASTER_INTERRUPT_CONTROL] & MICR_MIE) { @@ -249,9 +249,9 @@ void z8536_device::check_interrupt() // read_register - read from register //------------------------------------------------- -UINT8 z8536_device::read_register(offs_t offset) +uint8_t z8536_device::read_register(offs_t offset) { - UINT8 data; + uint8_t data; switch (offset) { @@ -326,7 +326,7 @@ UINT8 z8536_device::read_register(offs_t offset) // read_register - masked read from register //------------------------------------------------- -UINT8 z8536_device::read_register(offs_t offset, UINT8 mask) +uint8_t z8536_device::read_register(offs_t offset, uint8_t mask) { return read_register(offset) & mask; } @@ -336,7 +336,7 @@ UINT8 z8536_device::read_register(offs_t offset, UINT8 mask) // write_register - write to register //------------------------------------------------- -void z8536_device::write_register(offs_t offset, UINT8 data) +void z8536_device::write_register(offs_t offset, uint8_t data) { switch (offset) { @@ -500,7 +500,7 @@ void z8536_device::write_register(offs_t offset, UINT8 data) case PORT_C_DATA: { - UINT8 mask = (data & 0xf0) | (data >> 4); + uint8_t mask = (data & 0xf0) | (data >> 4); m_output[PORT_C] = (m_output[PORT_C] & mask) | ((data & 0x0f) & (mask ^ 0xff)); @@ -629,9 +629,9 @@ void z8536_device::write_register(offs_t offset, UINT8 data) // write_register - masked write to register //------------------------------------------------- -void z8536_device::write_register(offs_t offset, UINT8 data, UINT8 mask) +void z8536_device::write_register(offs_t offset, uint8_t data, uint8_t mask) { - UINT8 combined_data = (data & mask) | (m_register[offset] & (mask ^ 0xff)); + uint8_t combined_data = (data & mask) | (m_register[offset] & (mask ^ 0xff)); write_register(offset, combined_data); } @@ -794,9 +794,9 @@ void z8536_device::gate(device_timer_id id, int state) void z8536_device::match_pattern(int port) { - UINT8 pms = m_register[PORT_A_MODE_SPECIFICATION + (port << 3)]; - UINT8 pm = m_register[PORT_A_PATTERN_MASK + (port << 3)]; - UINT8 ddr = m_register[PORT_A_DATA_DIRECTION + (port << 3)]; + uint8_t pms = m_register[PORT_A_MODE_SPECIFICATION + (port << 3)]; + uint8_t pm = m_register[PORT_A_PATTERN_MASK + (port << 3)]; + uint8_t ddr = m_register[PORT_A_DATA_DIRECTION + (port << 3)]; switch ((pms & PMS_PMS_MASK) >> 1) { @@ -826,7 +826,7 @@ void z8536_device::external_port_w(int port, int bit, int state) case PORT_B: { assert((PORT_A_DATA_DIRECTION + (port << 3)) >= 0 && (PORT_A_DATA_DIRECTION + (port << 3)) < ARRAY_LENGTH(m_register)); - UINT8 ddr = m_register[PORT_A_DATA_DIRECTION + (port << 3)]; + uint8_t ddr = m_register[PORT_A_DATA_DIRECTION + (port << 3)]; if (!BIT(ddr, bit)) return; @@ -853,7 +853,7 @@ void z8536_device::external_port_w(int port, int bit, int state) // z8536_device - constructor //------------------------------------------------- -z8536_device::z8536_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +z8536_device::z8536_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Z8536, "Zilog Z8536", tag, owner, clock, "z8536", __FILE__), device_z80daisy_interface(mconfig, *this), m_write_irq(*this), @@ -992,7 +992,7 @@ void z8536_device::z80daisy_irq_reti() READ8_MEMBER( z8536_device::read ) { - UINT8 data = 0; + uint8_t data = 0; if (m_state == STATE_RESET) { diff --git a/src/devices/machine/z8536.h b/src/devices/machine/z8536.h index 4a6170e99ae..2110bdc87a2 100644 --- a/src/devices/machine/z8536.h +++ b/src/devices/machine/z8536.h @@ -77,7 +77,7 @@ class z8536_device : public device_t, { public: // construction/destruction - z8536_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + z8536_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); } template static devcb_base &set_pa_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_pa.set_callback(object); } @@ -297,10 +297,10 @@ private: void get_interrupt_vector(); void check_interrupt(); - UINT8 read_register(offs_t offset); - UINT8 read_register(offs_t offset, UINT8 mask); - void write_register(offs_t offset, UINT8 data); - void write_register(offs_t offset, UINT8 data, UINT8 mask); + uint8_t read_register(offs_t offset); + uint8_t read_register(offs_t offset, uint8_t mask); + void write_register(offs_t offset, uint8_t data); + void write_register(offs_t offset, uint8_t data, uint8_t mask); bool counter_enabled(device_timer_id id); bool counter_external_output(device_timer_id id); @@ -330,18 +330,18 @@ private: // register state int m_state; - UINT8 m_register[48]; - UINT8 m_pointer; + uint8_t m_register[48]; + uint8_t m_pointer; // input/output port state - UINT8 m_input[3]; - UINT8 m_output[3]; - UINT8 m_buffer[3]; - UINT8 m_match[3]; + uint8_t m_input[3]; + uint8_t m_output[3]; + uint8_t m_buffer[3]; + uint8_t m_match[3]; // timers emu_timer *m_timer; - UINT16 m_counter[3]; + uint16_t m_counter[3]; }; diff --git a/src/devices/sound/2203intf.cpp b/src/devices/sound/2203intf.cpp index 7fb9cf12609..daf27514d10 100644 --- a/src/devices/sound/2203intf.cpp +++ b/src/devices/sound/2203intf.cpp @@ -203,7 +203,7 @@ WRITE8_MEMBER( ym2203_device::write_port_w ) const device_type YM2203 = &device_creator; -ym2203_device::ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym2203_device::ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, YM2203, "YM2203", tag, owner, clock, PSG_TYPE_YM, 3, 2, "ym2203", __FILE__), m_irq_handler(*this) { diff --git a/src/devices/sound/2203intf.h b/src/devices/sound/2203intf.h index 973c824155f..24ffa5d3f9c 100644 --- a/src/devices/sound/2203intf.h +++ b/src/devices/sound/2203intf.h @@ -16,7 +16,7 @@ void ym2203_update_request(void *param); class ym2203_device : public ay8910_device { public: - ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym2203_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); } diff --git a/src/devices/sound/2608intf.cpp b/src/devices/sound/2608intf.cpp index 618a8aea4a8..54ce825357a 100644 --- a/src/devices/sound/2608intf.cpp +++ b/src/devices/sound/2608intf.cpp @@ -185,7 +185,7 @@ WRITE8_MEMBER( ym2608_device::write ) const device_type YM2608 = &device_creator; -ym2608_device::ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym2608_device::ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, YM2608, "YM2608", tag, owner, clock, PSG_TYPE_YM, 1, 2, "ym2608", __FILE__), m_irq_handler(*this), m_region(*this, DEVICE_SELF) diff --git a/src/devices/sound/2608intf.h b/src/devices/sound/2608intf.h index ea9f8a1cd4a..8d1cd9442fd 100644 --- a/src/devices/sound/2608intf.h +++ b/src/devices/sound/2608intf.h @@ -16,7 +16,7 @@ void ym2608_update_request(void *param); class ym2608_device : public ay8910_device { public: - ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym2608_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); } diff --git a/src/devices/sound/2610intf.cpp b/src/devices/sound/2610intf.cpp index 776ad96d009..b4bcb62c754 100644 --- a/src/devices/sound/2610intf.cpp +++ b/src/devices/sound/2610intf.cpp @@ -209,14 +209,14 @@ WRITE8_MEMBER( ym2610_device::write ) const device_type YM2610 = &device_creator; -ym2610_device::ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym2610_device::ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, YM2610, "YM2610", tag, owner, clock, PSG_TYPE_YM, 1, 0, "ym2610", __FILE__) , m_irq_handler(*this) , m_region(*this, DEVICE_SELF) { } -ym2610_device::ym2610_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) +ym2610_device::ym2610_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) : ay8910_device(mconfig, type, name, tag, owner, clock, PSG_TYPE_YM, 1, 0, shortname, source) , m_irq_handler(*this) , m_region(*this, DEVICE_SELF) @@ -225,7 +225,7 @@ ym2610_device::ym2610_device(const machine_config &mconfig, device_type type, co const device_type YM2610B = &device_creator; -ym2610b_device::ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym2610b_device::ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ym2610_device(mconfig, YM2610B, "YM2610B", tag, owner, clock, "ym2610b", __FILE__) { } diff --git a/src/devices/sound/2610intf.h b/src/devices/sound/2610intf.h index b41843053ab..94376220586 100644 --- a/src/devices/sound/2610intf.h +++ b/src/devices/sound/2610intf.h @@ -16,8 +16,8 @@ void ym2610_update_request(void *param); class ym2610_device : public ay8910_device { public: - ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ym2610_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); + ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ym2610_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_irq_handler(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } @@ -58,7 +58,7 @@ extern const device_type YM2610; class ym2610b_device : public ym2610_device { public: - ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void stream_generate(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; }; diff --git a/src/devices/sound/2612intf.cpp b/src/devices/sound/2612intf.cpp index ed9c8b060b0..90f8d2d0a09 100644 --- a/src/devices/sound/2612intf.cpp +++ b/src/devices/sound/2612intf.cpp @@ -165,14 +165,14 @@ WRITE8_MEMBER( ym2612_device::write ) const device_type YM2612 = &device_creator; -ym2612_device::ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym2612_device::ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YM2612, "YM2612", tag, owner, clock, "ym2612", __FILE__), device_sound_interface(mconfig, *this), m_irq_handler(*this) { } -ym2612_device::ym2612_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) +ym2612_device::ym2612_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_sound_interface(mconfig, *this), m_irq_handler(*this) @@ -192,7 +192,7 @@ void ym2612_device::device_config_complete() const device_type YM3438 = &device_creator; -ym3438_device::ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym3438_device::ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ym2612_device(mconfig, YM3438, "YM3438", tag, owner, clock, "ym3438", __FILE__) { } diff --git a/src/devices/sound/2612intf.h b/src/devices/sound/2612intf.h index 7a9751ab9d3..f7fa71ed6ae 100644 --- a/src/devices/sound/2612intf.h +++ b/src/devices/sound/2612intf.h @@ -16,8 +16,8 @@ class ym2612_device : public device_t, public device_sound_interface { public: - ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ym2612_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); + ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ym2612_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_irq_handler(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } @@ -58,7 +58,7 @@ extern const device_type YM2612; class ym3438_device : public ym2612_device { public: - ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type YM3438; diff --git a/src/devices/sound/262intf.cpp b/src/devices/sound/262intf.cpp index d14497e672e..e72088b0e84 100644 --- a/src/devices/sound/262intf.cpp +++ b/src/devices/sound/262intf.cpp @@ -137,7 +137,7 @@ WRITE8_MEMBER( ymf262_device::write ) const device_type YMF262 = &device_creator; -ymf262_device::ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ymf262_device::ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YMF262, "YMF262", tag, owner, clock, "ymf262", __FILE__), device_sound_interface(mconfig, *this), m_irq_handler(*this) diff --git a/src/devices/sound/262intf.h b/src/devices/sound/262intf.h index 7dcdbbec065..043743fd7a7 100644 --- a/src/devices/sound/262intf.h +++ b/src/devices/sound/262intf.h @@ -14,7 +14,7 @@ class ymf262_device : public device_t, public device_sound_interface { public: - ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ymf262_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); } diff --git a/src/devices/sound/315-5641.cpp b/src/devices/sound/315-5641.cpp index dbec291779f..7ee0f108ca9 100644 --- a/src/devices/sound/315-5641.cpp +++ b/src/devices/sound/315-5641.cpp @@ -7,7 +7,7 @@ const device_type SEGA_315_5641_PCM = &device_creator; -sega_315_5641_pcm_device::sega_315_5641_pcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_315_5641_pcm_device::sega_315_5641_pcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd7759_device(mconfig, SEGA_315_5641_PCM, "315-5641 PCM", tag, owner, clock, "315-5641_pcm", __FILE__), m_fifo_read(0), m_fifo_write(0) { } @@ -29,7 +29,7 @@ void sega_315_5641_pcm_device::advance_state() if (m_rombase == nullptr) { // Slave Mode: get data from FIFO buffer - UINT8 fiforead = (m_fifo_read + 1) & 0x3F; + uint8_t fiforead = (m_fifo_read + 1) & 0x3F; if (fiforead != m_fifo_write) { m_fifo_in = m_fifo_data[fiforead]; @@ -58,7 +58,7 @@ WRITE8_MEMBER( sega_315_5641_pcm_device::port_w ) } -UINT8 sega_315_5641_pcm_device::get_fifo_space() +uint8_t sega_315_5641_pcm_device::get_fifo_space() { return (m_fifo_read - m_fifo_write) & 0x3F; } diff --git a/src/devices/sound/315-5641.h b/src/devices/sound/315-5641.h index e8349236421..e92d8fe5875 100644 --- a/src/devices/sound/315-5641.h +++ b/src/devices/sound/315-5641.h @@ -11,15 +11,15 @@ class sega_315_5641_pcm_device : public upd7759_device { public: - sega_315_5641_pcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_315_5641_pcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT8 get_fifo_space(); + uint8_t get_fifo_space(); void advance_state() override; virtual DECLARE_WRITE8_MEMBER(port_w) override; - UINT8 m_fifo_data[0x40]; - UINT8 m_fifo_read; // last read offset (will read in m_fifo_read+1) - UINT8 m_fifo_write; // write offset + uint8_t m_fifo_data[0x40]; + uint8_t m_fifo_read; // last read offset (will read in m_fifo_read+1) + uint8_t m_fifo_write; // write offset protected: // device-level overrides diff --git a/src/devices/sound/3526intf.cpp b/src/devices/sound/3526intf.cpp index 4cc55081492..c58aa8562b6 100644 --- a/src/devices/sound/3526intf.cpp +++ b/src/devices/sound/3526intf.cpp @@ -171,7 +171,7 @@ WRITE8_MEMBER( ym3526_device::write_port_w ) { write(space, 1, data); } const device_type YM3526 = &device_creator; -ym3526_device::ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym3526_device::ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YM3526, "YM3526", tag, owner, clock, "ym3526", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), diff --git a/src/devices/sound/3526intf.h b/src/devices/sound/3526intf.h index 038c6e5d261..02ec88bfad4 100644 --- a/src/devices/sound/3526intf.h +++ b/src/devices/sound/3526intf.h @@ -14,7 +14,7 @@ class ym3526_device : public device_t, public device_sound_interface { public: - ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym3526_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); } diff --git a/src/devices/sound/3812intf.cpp b/src/devices/sound/3812intf.cpp index 5650668f659..895d16ff731 100644 --- a/src/devices/sound/3812intf.cpp +++ b/src/devices/sound/3812intf.cpp @@ -168,7 +168,7 @@ WRITE8_MEMBER( ym3812_device::write_port_w ) { write( space, 1, data); } const device_type YM3812 = &device_creator; -ym3812_device::ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym3812_device::ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YM3812, "YM3812", tag, owner, clock, "ym3812", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), diff --git a/src/devices/sound/3812intf.h b/src/devices/sound/3812intf.h index 5f0c1e47f00..c498d1c171b 100644 --- a/src/devices/sound/3812intf.h +++ b/src/devices/sound/3812intf.h @@ -14,7 +14,7 @@ class ym3812_device : public device_t, public device_sound_interface { public: - ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym3812_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); } diff --git a/src/devices/sound/8950intf.cpp b/src/devices/sound/8950intf.cpp index adc51009a0c..cd5278bc70d 100644 --- a/src/devices/sound/8950intf.cpp +++ b/src/devices/sound/8950intf.cpp @@ -203,7 +203,7 @@ WRITE8_MEMBER( y8950_device::write_port_w ) { write(space, 1, data); } const device_type Y8950 = &device_creator; -y8950_device::y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +y8950_device::y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, Y8950, "Y8950", tag, owner, clock, "y8950", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), diff --git a/src/devices/sound/8950intf.h b/src/devices/sound/8950intf.h index e548beffa62..a9bafad63d3 100644 --- a/src/devices/sound/8950intf.h +++ b/src/devices/sound/8950intf.h @@ -26,7 +26,7 @@ class y8950_device : public device_t, public device_sound_interface { public: - y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + y8950_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); } diff --git a/src/devices/sound/ad1848.cpp b/src/devices/sound/ad1848.cpp index cb2607362c1..ab8eb093e67 100644 --- a/src/devices/sound/ad1848.cpp +++ b/src/devices/sound/ad1848.cpp @@ -8,7 +8,7 @@ const device_type AD1848 = device_creator; -ad1848_device::ad1848_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ad1848_device::ad1848_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AD1848, "Analog Devices AD1848", tag, owner, clock, "ad1848", __FILE__), m_irq_cb(*this), m_drq_cb(*this), diff --git a/src/devices/sound/ad1848.h b/src/devices/sound/ad1848.h index 161172f9749..e6305ea19a6 100644 --- a/src/devices/sound/ad1848.h +++ b/src/devices/sound/ad1848.h @@ -15,7 +15,7 @@ class ad1848_device : public device_t { public: - ad1848_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ad1848_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); DECLARE_READ8_MEMBER(dack_r); @@ -30,30 +30,30 @@ protected: private: union { struct { - UINT8 linp; - UINT8 rinp; - UINT8 laux1; - UINT8 raux1; - UINT8 laux2; - UINT8 raux2; - UINT8 lout; - UINT8 rout; - UINT8 dform; - UINT8 iface; - UINT8 pinc; - UINT8 init; - UINT8 misc; - UINT8 mix; - UINT8 ubase; - UINT8 lbase; + uint8_t linp; + uint8_t rinp; + uint8_t laux1; + uint8_t raux1; + uint8_t laux2; + uint8_t raux2; + uint8_t lout; + uint8_t rout; + uint8_t dform; + uint8_t iface; + uint8_t pinc; + uint8_t init; + uint8_t misc; + uint8_t mix; + uint8_t ubase; + uint8_t lbase; }; - UINT8 idx[15]; + uint8_t idx[15]; } m_regs; - UINT8 m_addr; - UINT8 m_stat; - UINT16 m_count; - UINT32 m_samples; - UINT8 m_sam_cnt; + uint8_t m_addr; + uint8_t m_stat; + uint16_t m_count; + uint32_t m_samples; + uint8_t m_sam_cnt; bool m_play, m_mce, m_trd; devcb_write_line m_irq_cb; devcb_write_line m_drq_cb; diff --git a/src/devices/sound/aica.cpp b/src/devices/sound/aica.cpp index b434643437d..2f0a2810980 100644 --- a/src/devices/sound/aica.cpp +++ b/src/devices/sound/aica.cpp @@ -16,7 +16,7 @@ #define ICLIP16(x) (x<-32768)?-32768:((x>32767)?32767:x) #define SHIFT 12 -#define FIX(v) ((UINT32) ((float) (1<EG.volume>>EG_SHIFT)<<(SHIFT-10); } -UINT32 aica_device::Step(AICA_SLOT *slot) +uint32_t aica_device::Step(AICA_SLOT *slot) { int octave=(OCT(slot)^8)-8+SHIFT-10; - UINT32 Fn=FNS(slot) + (0x400); + uint32_t Fn=FNS(slot) + (0x400); if (octave >= 0) Fn<<=octave; else @@ -357,7 +357,7 @@ signed short aica_device::DecodeADPCM(int *PrevSignal, unsigned char Delta, int x += *PrevSignal; #if 0 // older implementation int x = *PrevQuant * quant_mul [Delta & 15]; - x = *PrevSignal + ((int)(x + ((UINT32)x >> 29)) >> 3); + x = *PrevSignal + ((int)(x + ((uint32_t)x >> 29)) >> 3); #endif *PrevSignal=ICLIP16(x); *PrevQuant=(*PrevQuant*TableQuant[Delta&7])>>ADPCMSHIFT; @@ -367,7 +367,7 @@ signed short aica_device::DecodeADPCM(int *PrevSignal, unsigned char Delta, int void aica_device::StartSlot(AICA_SLOT *slot) { - UINT64 start_offset; + uint64_t start_offset; slot->active=1; slot->Backwards=0; @@ -427,7 +427,7 @@ void aica_device::Init() m_AICARAM_LENGTH = m_ram_region->bytes(); m_RAM_MASK = m_AICARAM_LENGTH-1; m_RAM_MASK16 = m_RAM_MASK & 0x7ffffe; - m_DSP.AICARAM = (UINT16 *)m_AICARAM; + m_DSP.AICARAM = (uint16_t *)m_AICARAM; m_DSP.AICARAM_LENGTH = m_AICARAM_LENGTH/2; } @@ -439,7 +439,7 @@ void aica_device::Init() { float envDB=((float)(3*(i-0x3ff)))/32.0f; float scale=(float)(1<(44100); - m_buffertmpr=make_unique_clear(44100); + m_buffertmpl=make_unique_clear(44100); + m_buffertmpr=make_unique_clear(44100); // no "pend" m_udata.data[0xa0/2] = 0; @@ -658,7 +658,7 @@ void aica_device::UpdateReg(address_space &space, int reg) case 0x91: if(m_master) { - UINT32 time; + uint32_t time; m_TimPris[0]=1<<((m_udata.data[0x90/2]>>8)&0x7); m_TimCnt[0]=(m_udata.data[0x90/2]&0xff)<<8; @@ -677,7 +677,7 @@ void aica_device::UpdateReg(address_space &space, int reg) case 0x95: if(m_master) { - UINT32 time; + uint32_t time; m_TimPris[1]=1<<((m_udata.data[0x94/2]>>8)&0x7); m_TimCnt[1]=(m_udata.data[0x94/2]&0xff)<<8; @@ -696,7 +696,7 @@ void aica_device::UpdateReg(address_space &space, int reg) case 0x99: if(m_master) { - UINT32 time; + uint32_t time; m_TimPris[2]=1<<((m_udata.data[0x98/2]>>8)&0x7); m_TimCnt[2]=(m_udata.data[0x98/2]&0xff)<<8; @@ -808,10 +808,10 @@ void aica_device::UpdateRegR(address_space &space, int reg) { int slotnum = MSLC(); AICA_SLOT *slot=m_Slots + slotnum; - UINT16 LP; + uint16_t LP; if (!(AFSEL())) { - UINT16 SGC; + uint16_t SGC; int EG; LP = slot->lpend ? 0x8000 : 0x0000; @@ -1078,14 +1078,14 @@ void aica_device::TimersAddTicks(int ticks) } #endif -INT32 aica_device::UpdateSlot(AICA_SLOT *slot) +int32_t aica_device::UpdateSlot(AICA_SLOT *slot) { - INT32 sample; + int32_t sample; int step=slot->step; - UINT32 addr1,addr2,addr_select; // current and next sample addresses - UINT32 *addr[2] = {&addr1, &addr2}; // used for linear interpolation - UINT32 *slot_addr[2] = {&(slot->cur_addr), &(slot->nxt_addr)}; // - UINT32 chanlea = LEA(slot); + uint32_t addr1,addr2,addr_select; // current and next sample addresses + uint32_t *addr[2] = {&addr1, &addr2}; // used for linear interpolation + uint32_t *slot_addr[2] = {&(slot->cur_addr), &(slot->nxt_addr)}; // + uint32_t chanlea = LEA(slot); if(SSCTL(slot)!=0) //no FM or noise yet return 0; @@ -1117,30 +1117,30 @@ INT32 aica_device::UpdateSlot(AICA_SLOT *slot) if(PCMS(slot) == 1) // 8-bit signed { - INT8 *p1=(signed char *) (m_AICARAM+(((SA(slot)+addr1))&m_RAM_MASK)); - INT8 *p2=(signed char *) (m_AICARAM+(((SA(slot)+addr2))&m_RAM_MASK)); - INT32 s; - INT32 fpart=slot->cur_addr&((1<cur_addr&((1<>SHIFT); } else if (PCMS(slot) == 0) //16 bit signed { - UINT8 *p1=(UINT8 *) (m_AICARAM+((SA(slot)+addr1)&m_RAM_MASK)); - UINT8 *p2=(UINT8 *) (m_AICARAM+((SA(slot)+addr2)&m_RAM_MASK)); - INT32 s; - INT32 fpart=slot->cur_addr&((1<cur_addr&((1<>SHIFT); } else // 4-bit ADPCM { - UINT8 *base= slot->adbase; - INT32 s; + uint8_t *base= slot->adbase; + int32_t s; int cur_sample; //current ADPCM sample int nxt_sample; //next ADPCM sample - INT32 fpart=slot->cur_addr&((1< addr2 ? chanlea : addr2, curstep = slot->curstep; + int32_t fpart=slot->cur_addr&((1< addr2 ? chanlea : addr2, curstep = slot->curstep; if (slot->adbase) { @@ -1192,7 +1192,7 @@ INT32 aica_device::UpdateSlot(AICA_SLOT *slot) for (addr_select=0; addr_select<2; addr_select++) { - INT32 rem_addr; + int32_t rem_addr; switch(LPCTL(slot)) { case 0: //no loop @@ -1250,7 +1250,7 @@ void aica_device::DoMasterSamples(int nsamples) for(s=0;s>8; @@ -1355,7 +1355,7 @@ void aica_device::aica_exec_dma(address_space &space) { for(i=0;i < m_dma.dlg;i+=2) { - UINT16 tmp; + uint16_t tmp; tmp = m_AICARAM[m_dma.dmea]; tmp|= m_AICARAM[m_dma.dmea+1]<<8; w16(space, m_dma.drga, tmp); @@ -1435,7 +1435,7 @@ void aica_device::set_ram_base(void *base, int size) m_AICARAM_LENGTH = size; m_RAM_MASK = m_AICARAM_LENGTH-1; m_RAM_MASK16 = m_RAM_MASK & 0x7ffffe; - m_DSP.AICARAM = (UINT16 *)base; + m_DSP.AICARAM = (uint16_t *)base; m_DSP.AICARAM_LENGTH = size; } @@ -1446,7 +1446,7 @@ READ16_MEMBER( aica_device::read ) WRITE16_MEMBER( aica_device::write ) { - UINT16 tmp; + uint16_t tmp; tmp = r16(space, offset*2); COMBINE_DATA(&tmp); @@ -1470,7 +1470,7 @@ READ16_MEMBER( aica_device::midi_out_r ) const device_type AICA = &device_creator; -aica_device::aica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +aica_device::aica_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AICA, "AICA", tag, owner, clock, "aica", __FILE__), device_sound_interface(mconfig, *this), m_master(false), @@ -1636,7 +1636,7 @@ signed int aica_device::AICAALFO_Step(AICA_LFO_t *LFO) return p<<(SHIFT-LFO_SHIFT); } -void aica_device::AICALFO_ComputeStep(AICA_LFO_t *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO) +void aica_device::AICALFO_ComputeStep(AICA_LFO_t *LFO,uint32_t LFOF,uint32_t LFOWS,uint32_t LFOS,int ALFO) { float step=(float) LFOFreq[LFOF]*256.0f/(float)44100.0f; LFO->phase_step=(unsigned int) ((float) (1<(device).m_master = true; } static void set_roffset(device_t &device, int roffset) { downcast(device).m_roffset = roffset; } @@ -116,7 +116,7 @@ private: int Get_RR(int base,int R); void Compute_EG(AICA_SLOT *slot); int EG_Update(AICA_SLOT *slot); - UINT32 Step(AICA_SLOT *slot); + uint32_t Step(AICA_SLOT *slot); void Compute_LFO(AICA_SLOT *slot); void InitADPCM(int *PrevSignal, int *PrevQuant); inline signed short DecodeADPCM(int *PrevSignal, unsigned char Delta, int *PrevQuant); @@ -129,7 +129,7 @@ private: void UpdateRegR(address_space &space, int reg); void w16(address_space &space,unsigned int addr,unsigned short val); unsigned short r16(address_space &space, unsigned int addr); - inline INT32 UpdateSlot(AICA_SLOT *slot); + inline int32_t UpdateSlot(AICA_SLOT *slot); void DoMasterSamples(int nsamples); void aica_exec_dma(address_space &space); @@ -137,7 +137,7 @@ private: void AICALFO_Init(); inline signed int AICAPLFO_Step(AICA_LFO_t *LFO); inline signed int AICAALFO_Step(AICA_LFO_t *LFO); - void AICALFO_ComputeStep(AICA_LFO_t *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO); + void AICALFO_ComputeStep(AICA_LFO_t *LFO,uint32_t LFOF,uint32_t LFOWS,uint32_t LFOS,int ALFO); bool m_master; int m_roffset; /* offset in the region */ @@ -147,29 +147,29 @@ private: union { - UINT16 data[0xc0/2]; - UINT8 datab[0xc0]; + uint16_t data[0xc0/2]; + uint8_t datab[0xc0]; } m_udata; - UINT16 m_IRQL, m_IRQR; - UINT16 m_EFSPAN[0x48]; + uint16_t m_IRQL, m_IRQR; + uint16_t m_EFSPAN[0x48]; AICA_SLOT m_Slots[64]; signed short m_RINGBUF[64]; unsigned char m_BUFPTR; unsigned char *m_AICARAM; - UINT32 m_AICARAM_LENGTH, m_RAM_MASK, m_RAM_MASK16; + uint32_t m_AICARAM_LENGTH, m_RAM_MASK, m_RAM_MASK16; sound_stream * m_stream; - std::unique_ptr m_buffertmpl; - std::unique_ptr m_buffertmpr; + std::unique_ptr m_buffertmpl; + std::unique_ptr m_buffertmpr; - UINT32 m_IrqTimA; - UINT32 m_IrqTimBC; - UINT32 m_IrqMidi; + uint32_t m_IrqTimA; + uint32_t m_IrqTimBC; + uint32_t m_IrqMidi; - UINT8 m_MidiOutW,m_MidiOutR; - UINT8 m_MidiStack[16]; - UINT8 m_MidiW,m_MidiR; + uint8_t m_MidiOutW,m_MidiOutR; + uint8_t m_MidiStack[16]; + uint8_t m_MidiW,m_MidiR; int m_LPANTABLE[0x20000]; int m_RPANTABLE[0x20000]; @@ -177,18 +177,18 @@ private: int m_TimPris[3]; int m_TimCnt[3]; - UINT16 m_mcieb, m_mcipd; + uint16_t m_mcieb, m_mcipd; // timers emu_timer *m_timerA, *m_timerB, *m_timerC; // DMA stuff struct{ - UINT32 dmea; - UINT16 drga; - UINT16 dlg; - UINT8 dgate; - UINT8 ddir; + uint32_t dmea; + uint16_t drga; + uint16_t dlg; + uint8_t dgate; + uint8_t ddir; }m_dma; @@ -202,7 +202,7 @@ private: int m_length; signed short *m_RBUFDST; //this points to where the sample will be stored in the RingBuf - INT32 m_EG_TABLE[0x400]; + int32_t m_EG_TABLE[0x400]; int m_PLFO_TRI[256],m_PLFO_SQR[256],m_PLFO_SAW[256],m_PLFO_NOI[256]; int m_ALFO_TRI[256],m_ALFO_SQR[256],m_ALFO_SAW[256],m_ALFO_NOI[256]; int m_PSCALES[8][256]; diff --git a/src/devices/sound/aicadsp.cpp b/src/devices/sound/aicadsp.cpp index 816c0e78254..e556e01a68e 100644 --- a/src/devices/sound/aicadsp.cpp +++ b/src/devices/sound/aicadsp.cpp @@ -4,9 +4,9 @@ #include "emu.h" #include "aicadsp.h" -static UINT16 PACK(INT32 val) +static uint16_t PACK(int32_t val) { - UINT32 temp; + uint32_t temp; int sign,exponent,k; sign = (val >> 23) & 0x1; @@ -28,13 +28,13 @@ static UINT16 PACK(INT32 val) val |= sign << 15; val |= exponent << 11; - return (UINT16)val; + return (uint16_t)val; } -static INT32 UNPACK(UINT16 val) +static int32_t UNPACK(uint16_t val) { int sign,exponent,mantissa; - INT32 uval; + int32_t uval; sign = (val >> 15) & 0x1; exponent = (val >> 11) & 0xF; @@ -64,17 +64,17 @@ void aica_dsp_init(AICADSP *DSP) void aica_dsp_step(AICADSP *DSP) { - INT32 ACC=0; //26 bit - INT32 SHIFTED=0; //24 bit - INT32 X; //24 bit - INT32 Y=0; //13 bit - INT32 B; //26 bit - INT32 INPUTS=0; //24 bit - INT32 MEMVAL=0; - INT32 FRC_REG=0; //13 bit - INT32 Y_REG=0; //24 bit - UINT32 ADDR; - UINT32 ADRS_REG=0; //13 bit + int32_t ACC=0; //26 bit + int32_t SHIFTED=0; //24 bit + int32_t X; //24 bit + int32_t Y=0; //13 bit + int32_t B; //26 bit + int32_t INPUTS=0; //24 bit + int32_t MEMVAL=0; + int32_t FRC_REG=0; //13 bit + int32_t Y_REG=0; //24 bit + uint32_t ADDR; + uint32_t ADRS_REG=0; //13 bit int step; if(DSP->Stopped) @@ -89,42 +89,42 @@ void aica_dsp_step(AICADSP *DSP) #endif for(step=0;stepLastStep;++step) { - UINT16 *IPtr=DSP->MPRO+step*8; + uint16_t *IPtr=DSP->MPRO+step*8; // if(IPtr[0]==0 && IPtr[1]==0 && IPtr[2]==0 && IPtr[3]==0) // break; - UINT32 TRA=(IPtr[0]>>9)&0x7F; - UINT32 TWT=(IPtr[0]>>8)&0x01; - UINT32 TWA=(IPtr[0]>>1)&0x7F; - - UINT32 XSEL=(IPtr[2]>>15)&0x01; - UINT32 YSEL=(IPtr[2]>>13)&0x03; - UINT32 IRA=(IPtr[2]>>7)&0x3F; - UINT32 IWT=(IPtr[2]>>6)&0x01; - UINT32 IWA=(IPtr[2]>>1)&0x1F; - - UINT32 TABLE=(IPtr[4]>>15)&0x01; - UINT32 MWT=(IPtr[4]>>14)&0x01; - UINT32 MRD=(IPtr[4]>>13)&0x01; - UINT32 EWT=(IPtr[4]>>12)&0x01; - UINT32 EWA=(IPtr[4]>>8)&0x0F; - UINT32 ADRL=(IPtr[4]>>7)&0x01; - UINT32 FRCL=(IPtr[4]>>6)&0x01; - UINT32 SHIFT=(IPtr[4]>>4)&0x03; - UINT32 YRL=(IPtr[4]>>3)&0x01; - UINT32 NEGB=(IPtr[4]>>2)&0x01; - UINT32 ZERO=(IPtr[4]>>1)&0x01; - UINT32 BSEL=(IPtr[4]>>0)&0x01; - - UINT32 NOFL=(IPtr[6]>>15)&1; //???? - UINT32 COEF=step; - - UINT32 MASA=(IPtr[6]>>9)&0x1f; //??? - UINT32 ADREB=(IPtr[6]>>8)&0x1; - UINT32 NXADR=(IPtr[6]>>7)&0x1; - - INT64 v; + uint32_t TRA=(IPtr[0]>>9)&0x7F; + uint32_t TWT=(IPtr[0]>>8)&0x01; + uint32_t TWA=(IPtr[0]>>1)&0x7F; + + uint32_t XSEL=(IPtr[2]>>15)&0x01; + uint32_t YSEL=(IPtr[2]>>13)&0x03; + uint32_t IRA=(IPtr[2]>>7)&0x3F; + uint32_t IWT=(IPtr[2]>>6)&0x01; + uint32_t IWA=(IPtr[2]>>1)&0x1F; + + uint32_t TABLE=(IPtr[4]>>15)&0x01; + uint32_t MWT=(IPtr[4]>>14)&0x01; + uint32_t MRD=(IPtr[4]>>13)&0x01; + uint32_t EWT=(IPtr[4]>>12)&0x01; + uint32_t EWA=(IPtr[4]>>8)&0x0F; + uint32_t ADRL=(IPtr[4]>>7)&0x01; + uint32_t FRCL=(IPtr[4]>>6)&0x01; + uint32_t SHIFT=(IPtr[4]>>4)&0x03; + uint32_t YRL=(IPtr[4]>>3)&0x01; + uint32_t NEGB=(IPtr[4]>>2)&0x01; + uint32_t ZERO=(IPtr[4]>>1)&0x01; + uint32_t BSEL=(IPtr[4]>>0)&0x01; + + uint32_t NOFL=(IPtr[6]>>15)&1; //???? + uint32_t COEF=step; + + uint32_t MASA=(IPtr[6]>>9)&0x1f; //??? + uint32_t ADREB=(IPtr[6]>>8)&0x1; + uint32_t NXADR=(IPtr[6]>>7)&0x1; + + int64_t v; //operations are done at 24 bit precision #if 0 @@ -262,7 +262,7 @@ void aica_dsp_step(AICADSP *DSP) //if(Y&0x1000) // Y|=0xFFFFF000; - v=(((INT64) X*(INT64) Y)>>12); + v=(((int64_t) X*(int64_t) Y)>>12); ACC=(int) v+B; if(TWT) @@ -328,7 +328,7 @@ void aica_dsp_step(AICADSP *DSP) // fclose(f); } -void aica_dsp_setsample(AICADSP *DSP,INT32 sample,int SEL,int MXL) +void aica_dsp_setsample(AICADSP *DSP,int32_t sample,int SEL,int MXL) { //DSP->MIXS[SEL]+=sample<<(MXL+1)/*7*/; DSP->MIXS[SEL]+=sample; @@ -342,7 +342,7 @@ void aica_dsp_start(AICADSP *DSP) DSP->Stopped=0; for(i=127;i>=0;--i) { - UINT16 *IPtr=DSP->MPRO+i*8; + uint16_t *IPtr=DSP->MPRO+i*8; if(IPtr[0]!=0 || IPtr[2]!=0 || IPtr[4]!=0 || IPtr[6]!=0) break; diff --git a/src/devices/sound/aicadsp.h b/src/devices/sound/aicadsp.h index 36854807e28..54c2b2ab21e 100644 --- a/src/devices/sound/aicadsp.h +++ b/src/devices/sound/aicadsp.h @@ -9,33 +9,33 @@ struct AICADSP { //Config - UINT16 *AICARAM; - UINT32 AICARAM_LENGTH; - UINT32 RBP; //Ring buf pointer - UINT32 RBL; //Delay ram (Ring buffer) size in words + uint16_t *AICARAM; + uint32_t AICARAM_LENGTH; + uint32_t RBP; //Ring buf pointer + uint32_t RBL; //Delay ram (Ring buffer) size in words //context - INT16 COEF[128*2]; //16 bit signed - UINT16 MADRS[64*2]; //offsets (in words), 16 bit - UINT16 MPRO[128*4*2*2]; //128 steps 64 bit - INT32 TEMP[128]; //TEMP regs,24 bit signed - INT32 MEMS[32]; //MEMS regs,24 bit signed - UINT32 DEC; + int16_t COEF[128*2]; //16 bit signed + uint16_t MADRS[64*2]; //offsets (in words), 16 bit + uint16_t MPRO[128*4*2*2]; //128 steps 64 bit + int32_t TEMP[128]; //TEMP regs,24 bit signed + int32_t MEMS[32]; //MEMS regs,24 bit signed + uint32_t DEC; //input - INT32 MIXS[16]; //MIXS, 24 bit signed - INT16 EXTS[2]; //External inputs (CDDA) 16 bit signed + int32_t MIXS[16]; //MIXS, 24 bit signed + int16_t EXTS[2]; //External inputs (CDDA) 16 bit signed //output - INT16 EFREG[16]; //EFREG, 16 bit signed + int16_t EFREG[16]; //EFREG, 16 bit signed int Stopped; int LastStep; }; void aica_dsp_init(AICADSP *DSP); -void aica_dsp_setsample(AICADSP *DSP, INT32 sample, INT32 SEL, INT32 MXL); +void aica_dsp_setsample(AICADSP *DSP, int32_t sample, int32_t SEL, int32_t MXL); void aica_dsp_step(AICADSP *DSP); void aica_dsp_start(AICADSP *DSP); diff --git a/src/devices/sound/amiga.cpp b/src/devices/sound/amiga.cpp index d11e115a59e..accf0509705 100644 --- a/src/devices/sound/amiga.cpp +++ b/src/devices/sound/amiga.cpp @@ -33,7 +33,7 @@ const device_type AMIGA = &device_creator; // amiga_sound_device - constructor //------------------------------------------------- -amiga_sound_device::amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +amiga_sound_device::amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AMIGA, "Amiga Paula", tag, owner, clock, "amiga_paula", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr) @@ -95,7 +95,7 @@ void amiga_sound_device::dma_reload(audio_channel *chan) // data_w - manual mode data writer //------------------------------------------------- -void amiga_sound_device::data_w(int which, UINT16 data) +void amiga_sound_device::data_w(int which, uint16_t data) { m_channel[which].manualmode = true; } diff --git a/src/devices/sound/amiga.h b/src/devices/sound/amiga.h index e93ff6a86a3..b1b89e09cc5 100644 --- a/src/devices/sound/amiga.h +++ b/src/devices/sound/amiga.h @@ -23,11 +23,11 @@ class amiga_sound_device : public device_t, public device_sound_interface { public: - amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~amiga_sound_device() {} void update(); - void data_w(int which, UINT16 data); + void data_w(int which, uint16_t data); protected: // device-level overrides @@ -42,13 +42,13 @@ private: struct audio_channel { emu_timer *irq_timer; - UINT32 curlocation; - UINT16 curlength; - UINT16 curticks; - UINT8 index; + uint32_t curlocation; + uint16_t curlength; + uint16_t curticks; + uint8_t index; bool dma_enabled; bool manualmode; - INT8 latched; + int8_t latched; }; void dma_reload(audio_channel *chan); diff --git a/src/devices/sound/asc.cpp b/src/devices/sound/asc.cpp index c2692af9912..1b780d5fba9 100644 --- a/src/devices/sound/asc.cpp +++ b/src/devices/sound/asc.cpp @@ -45,7 +45,7 @@ const device_type ASC = &device_creator; // asc_device - constructor //------------------------------------------------- -asc_device::asc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +asc_device::asc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASC, "ASC", tag, owner, clock, "asc", __FILE__), device_sound_interface(mconfig, *this), write_irq(*this), @@ -131,7 +131,7 @@ void asc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp { stream_sample_t *outL, *outR; int i, ch; - static UINT32 wtoffs[2] = { 0, 0x200 }; + static uint32_t wtoffs[2] = { 0, 0x200 }; outL = outputs[0]; outR = outputs[1]; @@ -148,10 +148,10 @@ void asc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp case 1: // FIFO mode for (i = 0; i < samples; i++) { - INT8 smpll, smplr; + int8_t smpll, smplr; - smpll = (INT8)m_fifo_a[m_fifo_a_rdptr]^0x80; - smplr = (INT8)m_fifo_b[m_fifo_b_rdptr]^0x80; + smpll = (int8_t)m_fifo_a[m_fifo_a_rdptr]^0x80; + smplr = (int8_t)m_fifo_b[m_fifo_b_rdptr]^0x80; // don't advance the sample pointer if there are no more samples if (m_fifo_cap_a) @@ -212,8 +212,8 @@ void asc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp case 2: // wavetable mode for (i = 0; i < samples; i++) { - INT32 mixL, mixR; - INT8 smpl; + int32_t mixL, mixR; + int8_t smpl; mixL = mixR = 0; @@ -224,11 +224,11 @@ void asc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp if (ch < 2) { - smpl = (INT8)m_fifo_a[((m_phase[ch]>>15)&0x1ff) + wtoffs[ch&1]]; + smpl = (int8_t)m_fifo_a[((m_phase[ch]>>15)&0x1ff) + wtoffs[ch&1]]; } else { - smpl = (INT8)m_fifo_b[((m_phase[ch]>>15)&0x1ff) + wtoffs[ch&1]]; + smpl = (int8_t)m_fifo_b[((m_phase[ch]>>15)&0x1ff) + wtoffs[ch&1]]; } smpl ^= 0x80; @@ -251,7 +251,7 @@ void asc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp READ8_MEMBER( asc_device::read ) { - UINT8 rv; + uint8_t rv; // printf("ASC: read at %x\n", offset); diff --git a/src/devices/sound/asc.h b/src/devices/sound/asc.h index ba45288888d..6363732d219 100644 --- a/src/devices/sound/asc.h +++ b/src/devices/sound/asc.h @@ -65,7 +65,7 @@ class asc_device : public device_t, public device_sound_interface { public: // construction/destruction - asc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + asc_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); @@ -112,14 +112,14 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; // inline data - UINT8 m_chip_type; + uint8_t m_chip_type; - UINT8 m_fifo_a[0x400]; - UINT8 m_fifo_b[0x400]; + uint8_t m_fifo_a[0x400]; + uint8_t m_fifo_b[0x400]; - UINT8 m_regs[0x800]; + uint8_t m_regs[0x800]; - UINT32 m_phase[4], m_incr[4]; + uint32_t m_phase[4], m_incr[4]; int m_fifo_a_rdptr, m_fifo_b_rdptr; int m_fifo_a_wrptr, m_fifo_b_wrptr; diff --git a/src/devices/sound/astrocde.cpp b/src/devices/sound/astrocde.cpp index 11bb951dc06..2dd01fe0c52 100644 --- a/src/devices/sound/astrocde.cpp +++ b/src/devices/sound/astrocde.cpp @@ -57,7 +57,7 @@ const device_type ASTROCADE = &device_creator; // astrocade_device - constructor //------------------------------------------------- -astrocade_device::astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +astrocade_device::astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASTROCADE, "Astrocade", tag, owner, clock, "astrocade", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -72,8 +72,8 @@ astrocade_device::astrocade_device(const machine_config &mconfig, const char *ta m_c_count(0), m_c_state(0) { - memset(m_reg, 0, sizeof(UINT8)*8); - memset(m_bitswap, 0, sizeof(UINT8)*256); + memset(m_reg, 0, sizeof(uint8_t)*8); + memset(m_bitswap, 0, sizeof(uint8_t)*256); } @@ -105,9 +105,9 @@ void astrocade_device::device_start() void astrocade_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { stream_sample_t *dest = outputs[0]; - UINT16 noise_state; - UINT8 master_count; - UINT8 noise_clock; + uint16_t noise_state; + uint8_t master_count; + uint8_t noise_clock; /* load some locals */ master_count = m_master_count; diff --git a/src/devices/sound/astrocde.h b/src/devices/sound/astrocde.h index 96826a120c6..2feccd84437 100644 --- a/src/devices/sound/astrocde.h +++ b/src/devices/sound/astrocde.h @@ -27,7 +27,7 @@ class astrocade_device : public device_t, public device_sound_interface { public: - astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~astrocade_device() { } protected: @@ -47,24 +47,24 @@ private: private: sound_stream *m_stream; /* sound stream */ - UINT8 m_reg[8]; /* 8 control registers */ + uint8_t m_reg[8]; /* 8 control registers */ - UINT8 m_master_count; /* current master oscillator count */ - UINT16 m_vibrato_clock; /* current vibrato clock */ + uint8_t m_master_count; /* current master oscillator count */ + uint16_t m_vibrato_clock; /* current vibrato clock */ - UINT8 m_noise_clock; /* current noise generator clock */ - UINT16 m_noise_state; /* current noise LFSR state */ + uint8_t m_noise_clock; /* current noise generator clock */ + uint16_t m_noise_state; /* current noise LFSR state */ - UINT8 m_a_count; /* current tone generator A count */ - UINT8 m_a_state; /* current tone generator A state */ + uint8_t m_a_count; /* current tone generator A count */ + uint8_t m_a_state; /* current tone generator A state */ - UINT8 m_b_count; /* current tone generator B count */ - UINT8 m_b_state; /* current tone generator B state */ + uint8_t m_b_count; /* current tone generator B count */ + uint8_t m_b_state; /* current tone generator B state */ - UINT8 m_c_count; /* current tone generator C count */ - UINT8 m_c_state; /* current tone generator C state */ + uint8_t m_c_count; /* current tone generator C count */ + uint8_t m_c_state; /* current tone generator C state */ - UINT8 m_bitswap[256]; /* bitswap table */ + uint8_t m_bitswap[256]; /* bitswap table */ }; extern const device_type ASTROCADE; diff --git a/src/devices/sound/awacs.cpp b/src/devices/sound/awacs.cpp index 4784616cdf6..1685a37f370 100644 --- a/src/devices/sound/awacs.cpp +++ b/src/devices/sound/awacs.cpp @@ -24,7 +24,7 @@ const device_type AWACS = &device_creator; // awacs_device - constructor //------------------------------------------------- -awacs_device::awacs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +awacs_device::awacs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AWACS, "AWACS", tag, owner, clock, "awacs", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), m_play_ptr(0), m_buffer_size(0), m_buffer_num(0), m_playback_enable(false), m_dma_space(nullptr), m_dma_offset_0(0), m_dma_offset_1(0), m_timer(nullptr) { @@ -93,15 +93,15 @@ void awacs_device::sound_stream_update(sound_stream &stream, stream_sample_t **i { for (int i = 0; i < samples; i++) { - outL[i] = (INT16)m_dma_space->read_word(offset + m_play_ptr); - outR[i] = (INT16)m_dma_space->read_word(offset + m_play_ptr + 2); + outL[i] = (int16_t)m_dma_space->read_word(offset + m_play_ptr); + outR[i] = (int16_t)m_dma_space->read_word(offset + m_play_ptr + 2); m_play_ptr += 4; } // out of buffer? if (m_play_ptr >= m_buffer_size) { - UINT8 bufflag[2] = { 0x40, 0x80 }; + uint8_t bufflag[2] = { 0x40, 0x80 }; m_regs[0x18] |= bufflag[m_buffer_num]; m_buffer_num ^= 1; diff --git a/src/devices/sound/awacs.h b/src/devices/sound/awacs.h index 435508ef216..a18a23f4a54 100644 --- a/src/devices/sound/awacs.h +++ b/src/devices/sound/awacs.h @@ -40,7 +40,7 @@ class awacs_device : public device_t, public device_sound_interface { public: // construction/destruction - awacs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + awacs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); @@ -58,7 +58,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; // inline data - UINT8 m_regs[0x100]; + uint8_t m_regs[0x100]; int m_play_ptr, m_buffer_size, m_buffer_num; bool m_playback_enable; diff --git a/src/devices/sound/ay8910.cpp b/src/devices/sound/ay8910.cpp index 254df1bc73e..f3a5fd4dc5d 100644 --- a/src/devices/sound/ay8910.cpp +++ b/src/devices/sound/ay8910.cpp @@ -432,7 +432,7 @@ static const ay8910_device::mosfet_param ay8910_mosfet_param = * *************************************/ -static inline void build_3D_table(double rl, const ay8910_device::ay_ym_param *par, const ay8910_device::ay_ym_param *par_env, int normalize, double factor, int zero_is_off, INT32 *tab) +static inline void build_3D_table(double rl, const ay8910_device::ay_ym_param *par, const ay8910_device::ay_ym_param *par_env, int normalize, double factor, int zero_is_off, int32_t *tab) { double min = 10.0, max = 0.0; @@ -491,7 +491,7 @@ static inline void build_3D_table(double rl, const ay8910_device::ay_ym_param *p /* for (e=0;e<16;e++) printf("%d %d\n",e<<10, tab[e<<10]); */ } -static inline void build_single_table(double rl, const ay8910_device::ay_ym_param *par, int normalize, INT32 *tab, int zero_is_off) +static inline void build_single_table(double rl, const ay8910_device::ay_ym_param *par, int normalize, int32_t *tab, int zero_is_off) { int j; double rt; @@ -530,7 +530,7 @@ static inline void build_single_table(double rl, const ay8910_device::ay_ym_para } -static inline void build_mosfet_resistor_table(const ay8910_device::mosfet_param &par, const double rd, INT32 *tab) +static inline void build_mosfet_resistor_table(const ay8910_device::mosfet_param &par, const double rd, int32_t *tab) { int j; @@ -554,7 +554,7 @@ static inline void build_mosfet_resistor_table(const ay8910_device::mosfet_param } -UINT16 ay8910_device::mix_3D() +uint16_t ay8910_device::mix_3D() { int indx = 0, chan; @@ -1000,7 +1000,7 @@ void ay8910_device::ay8910_write_ym(int addr, uint8_t data) } } -UINT8 ay8910_device::ay8910_read_ym() +uint8_t ay8910_device::ay8910_read_ym() { device_type chip_type = type(); int r = m_register_latch; @@ -1049,13 +1049,13 @@ UINT8 ay8910_device::ay8910_read_ym() - YM2149: no anomaly */ if (chip_type == AY8910) { - const UINT8 mask[0x10]={ + const uint8_t mask[0x10]={ 0xff,0x0f,0xff,0x0f,0xff,0x0f,0x1f,0xff,0x1f,0x1f,0x1f,0xff,0xff,0x0f,0xff,0xff }; return m_regs[r] & mask[r]; } else if (chip_type == AY8914) { - const UINT8 mask[0x10]={ + const uint8_t mask[0x10]={ 0xff,0x0f,0xff,0x0f,0xff,0x0f,0x1f,0xff,0x3f,0x3f,0x3f,0xff,0xff,0x0f,0xff,0xff }; return m_regs[r] & mask[r]; @@ -1128,9 +1128,9 @@ static const int mapping8914to8910[16] = { 0, 2, 4, 11, 1, 3, 5, 12, 7, 6, 13, 8 READ8_MEMBER( ay8914_device::read ) { - UINT16 rv; + uint16_t rv; address_w(space, 0, mapping8914to8910[offset & 0xf]); - rv = (UINT16) data_r(space, 0); + rv = (uint16_t) data_r(space, 0); return rv; } @@ -1144,7 +1144,7 @@ WRITE8_MEMBER( ay8914_device::write ) const device_type AY8910 = &device_creator; -ay8910_device::ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ay8910_device::ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AY8910, "AY-3-8910A", tag, owner, clock, "ay8910", __FILE__), device_sound_interface(mconfig, *this), m_type(PSG_TYPE_AY), @@ -1186,7 +1186,7 @@ ay8910_device::ay8910_device(const machine_config &mconfig, const char *tag, dev m_res_load[0] = m_res_load[1] = m_res_load[2] = 1000; //Default values for resistor loads } -ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, +ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, psg_type_t psg_type, int streams, int ioports, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_sound_interface(mconfig, *this), @@ -1254,7 +1254,7 @@ void ay8910_device::set_type(psg_type_t psg_type) const device_type AY8912 = &device_creator; -ay8912_device::ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ay8912_device::ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, AY8912, "AY-3-8912A", tag, owner, clock, PSG_TYPE_AY, 3, 1, "ay8912", __FILE__) { } @@ -1262,7 +1262,7 @@ ay8912_device::ay8912_device(const machine_config &mconfig, const char *tag, dev const device_type AY8913 = &device_creator; -ay8913_device::ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ay8913_device::ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, AY8913, "AY-3-8913A", tag, owner, clock, PSG_TYPE_AY, 3, 0, "ay8913", __FILE__) { } @@ -1270,7 +1270,7 @@ ay8913_device::ay8913_device(const machine_config &mconfig, const char *tag, dev const device_type AY8914 = &device_creator; -ay8914_device::ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ay8914_device::ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, AY8914, "AY-3-8914", tag, owner, clock, PSG_TYPE_AY, 3, 2, "ay8914", __FILE__) { } @@ -1278,7 +1278,7 @@ ay8914_device::ay8914_device(const machine_config &mconfig, const char *tag, dev const device_type AY8930 = &device_creator; -ay8930_device::ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ay8930_device::ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, AY8930, "AY8930", tag, owner, clock, PSG_TYPE_AY, 3, 2, "ay8930", __FILE__) { } @@ -1286,7 +1286,7 @@ ay8930_device::ay8930_device(const machine_config &mconfig, const char *tag, dev const device_type YM2149 = &device_creator; -ym2149_device::ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym2149_device::ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, YM2149, "YM2149", tag, owner, clock, PSG_TYPE_YM, 3, 2, "ym2149", __FILE__) { } @@ -1294,7 +1294,7 @@ ym2149_device::ym2149_device(const machine_config &mconfig, const char *tag, dev const device_type YM3439 = &device_creator; -ym3439_device::ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym3439_device::ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, YM3439, "YM3439", tag, owner, clock, PSG_TYPE_YM, 3, 2, "ym3429", __FILE__) { } @@ -1302,7 +1302,7 @@ ym3439_device::ym3439_device(const machine_config &mconfig, const char *tag, dev const device_type YMZ284 = &device_creator; -ymz284_device::ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ymz284_device::ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, YMZ284, "YMZ284", tag, owner, clock, PSG_TYPE_YM, 1, 0, "ymz284", __FILE__) { } @@ -1310,7 +1310,7 @@ ymz284_device::ymz284_device(const machine_config &mconfig, const char *tag, dev const device_type YMZ294 = &device_creator; -ymz294_device::ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ymz294_device::ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ay8910_device(mconfig, YMZ294, "YMZ294", tag, owner, clock, PSG_TYPE_YM, 1, 0, "ymz294", __FILE__) { } diff --git a/src/devices/sound/ay8910.h b/src/devices/sound/ay8910.h index 43205b75ac3..6dfa3356508 100644 --- a/src/devices/sound/ay8910.h +++ b/src/devices/sound/ay8910.h @@ -101,9 +101,9 @@ public: }; // construction/destruction - ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, - UINT32 clock, psg_type_t psg_type, int streams, int ioports, const char *shortname, const char *source); + uint32_t clock, psg_type_t psg_type, int streams, int ioports, const char *shortname, const char *source); // static configuration helpers static void set_flags(device_t &device, int flags) { downcast(device).m_flags = flags; } @@ -161,7 +161,7 @@ protected: private: // internal helpers void set_type(psg_type_t psg_type); - inline UINT16 mix_3D(); + inline uint16_t mix_3D(); void ay8910_write_reg(int r, int v); void build_mixer_table(); void ay8910_statesave(); @@ -173,28 +173,28 @@ private: int m_ready; sound_stream *m_channel; bool m_active; - INT32 m_register_latch; - UINT8 m_regs[16]; - INT32 m_last_enable; - INT32 m_count[AY8910_NUM_CHANNELS]; - UINT8 m_output[AY8910_NUM_CHANNELS]; - UINT8 m_prescale_noise; - INT32 m_count_noise; - INT32 m_count_env; - INT8 m_env_step; - UINT32 m_env_volume; - UINT8 m_hold,m_alternate,m_attack,m_holding; - INT32 m_rng; - UINT8 m_env_step_mask; + int32_t m_register_latch; + uint8_t m_regs[16]; + int32_t m_last_enable; + int32_t m_count[AY8910_NUM_CHANNELS]; + uint8_t m_output[AY8910_NUM_CHANNELS]; + uint8_t m_prescale_noise; + int32_t m_count_noise; + int32_t m_count_env; + int8_t m_env_step; + uint32_t m_env_volume; + uint8_t m_hold,m_alternate,m_attack,m_holding; + int32_t m_rng; + uint8_t m_env_step_mask; /* init parameters ... */ int m_step; int m_zero_is_off; - UINT8 m_vol_enabled[AY8910_NUM_CHANNELS]; + uint8_t m_vol_enabled[AY8910_NUM_CHANNELS]; const ay_ym_param *m_par; const ay_ym_param *m_par_env; - INT32 m_vol_table[AY8910_NUM_CHANNELS][16]; - INT32 m_env_table[AY8910_NUM_CHANNELS][32]; - INT32 m_vol3d_table[8*32*32*32]; + int32_t m_vol_table[AY8910_NUM_CHANNELS][16]; + int32_t m_env_table[AY8910_NUM_CHANNELS][32]; + int32_t m_vol3d_table[8*32*32*32]; int m_flags; /* Flags */ int m_res_load[3]; /* Load on channel in ohms */ devcb_read8 m_port_a_read_cb; @@ -208,7 +208,7 @@ extern const device_type AY8910; class ay8912_device : public ay8910_device { public: - ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type AY8912; @@ -216,7 +216,7 @@ extern const device_type AY8912; class ay8913_device : public ay8910_device { public: - ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type AY8913; @@ -224,7 +224,7 @@ extern const device_type AY8913; class ay8914_device : public ay8910_device { public: - ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); /* AY8914 handlers needed due to different register map */ DECLARE_READ8_MEMBER( read ); @@ -236,7 +236,7 @@ extern const device_type AY8914; class ay8930_device : public ay8910_device { public: - ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type AY8930; @@ -244,7 +244,7 @@ extern const device_type AY8930; class ym2149_device : public ay8910_device { public: - ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type YM2149; @@ -252,7 +252,7 @@ extern const device_type YM2149; class ym3439_device : public ay8910_device { public: - ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type YM3439; @@ -260,7 +260,7 @@ extern const device_type YM3439; class ymz284_device : public ay8910_device { public: - ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type YMZ284; @@ -268,7 +268,7 @@ extern const device_type YMZ284; class ymz294_device : public ay8910_device { public: - ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type YMZ294; diff --git a/src/devices/sound/beep.cpp b/src/devices/sound/beep.cpp index 7997b590a86..0b343cbd0f7 100644 --- a/src/devices/sound/beep.cpp +++ b/src/devices/sound/beep.cpp @@ -31,7 +31,7 @@ const device_type BEEP = &device_creator; // beep_device - constructor //------------------------------------------------- -beep_device::beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +beep_device::beep_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BEEP, "Beep", tag, owner, clock, "beep", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -66,7 +66,7 @@ void beep_device::device_start() void beep_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { stream_sample_t *buffer = outputs[0]; - INT16 signal = m_signal; + int16_t signal = m_signal; int clock = 0, rate = BEEP_RATE / 2; /* get progress through wave */ @@ -124,7 +124,7 @@ WRITE_LINE_MEMBER(beep_device::set_state) // setting new frequency starts from beginning //------------------------------------------------- -void beep_device::set_clock(UINT32 frequency) +void beep_device::set_clock(uint32_t frequency) { if (m_frequency == frequency) return; diff --git a/src/devices/sound/beep.h b/src/devices/sound/beep.h index 0970e6f4a93..d8edefa834a 100644 --- a/src/devices/sound/beep.h +++ b/src/devices/sound/beep.h @@ -15,7 +15,7 @@ class beep_device : public device_t, public device_sound_interface { public: - beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + beep_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~beep_device() { } protected: @@ -27,14 +27,14 @@ protected: public: DECLARE_WRITE_LINE_MEMBER(set_state); // enable/disable sound output - void set_clock(UINT32 frequency); // output frequency + void set_clock(uint32_t frequency); // output frequency private: sound_stream *m_stream; /* stream number */ int m_enable; /* enable beep */ int m_frequency; /* set frequency - this can be changed using the appropiate function */ int m_incr; /* initial wave state */ - INT16 m_signal; /* current signal */ + int16_t m_signal; /* current signal */ }; extern const device_type BEEP; diff --git a/src/devices/sound/bsmt2000.cpp b/src/devices/sound/bsmt2000.cpp index e64702fb60a..0c975d105e5 100644 --- a/src/devices/sound/bsmt2000.cpp +++ b/src/devices/sound/bsmt2000.cpp @@ -69,7 +69,7 @@ ROM_END // bsmt2000_device - constructor //------------------------------------------------- -bsmt2000_device::bsmt2000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +bsmt2000_device::bsmt2000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BSMT2000, "BSMT2000", tag, owner, clock, "bsmt2000", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 32), @@ -218,7 +218,7 @@ void bsmt2000_device::rom_bank_updated() // read_status - return the write pending status //------------------------------------------------- -UINT16 bsmt2000_device::read_status() +uint16_t bsmt2000_device::read_status() { return m_write_pending ? 0 : 1; } @@ -229,7 +229,7 @@ UINT16 bsmt2000_device::read_status() // register select interface //------------------------------------------------- -void bsmt2000_device::write_reg(UINT16 data) +void bsmt2000_device::write_reg(uint16_t data) { synchronize(TIMER_ID_REG_WRITE, data); } @@ -240,7 +240,7 @@ void bsmt2000_device::write_reg(UINT16 data) // data port //------------------------------------------------- -void bsmt2000_device::write_data(UINT16 data) +void bsmt2000_device::write_data(uint16_t data) { synchronize(TIMER_ID_DATA_WRITE, data); @@ -283,7 +283,7 @@ READ16_MEMBER( bsmt2000_device::tms_data_r ) READ16_MEMBER( bsmt2000_device::tms_rom_r ) { // underlying logic assumes this is a sign-extended value - return (INT8)read_byte((m_rom_bank << 16) + m_rom_address); + return (int8_t)read_byte((m_rom_bank << 16) + m_rom_address); } diff --git a/src/devices/sound/bsmt2000.h b/src/devices/sound/bsmt2000.h index b23767c3626..c23ce6daf6a 100644 --- a/src/devices/sound/bsmt2000.h +++ b/src/devices/sound/bsmt2000.h @@ -43,15 +43,15 @@ class bsmt2000_device : public device_t, public: // construction/destruction - bsmt2000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + bsmt2000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_ready_callback(device_t &device, ready_callback callback); // public interface - UINT16 read_status(); - void write_reg(UINT16 data); - void write_data(UINT16 data); + uint16_t read_status(); + void write_reg(uint16_t data); + void write_data(uint16_t data); protected: // device-level overrides @@ -93,12 +93,12 @@ private: // internal state sound_stream * m_stream; tms32015_device * m_cpu; - UINT16 m_register_select; - UINT16 m_write_data; - UINT16 m_rom_address; - UINT16 m_rom_bank; - INT16 m_left_data; - INT16 m_right_data; + uint16_t m_register_select; + uint16_t m_write_data; + uint16_t m_rom_address; + uint16_t m_rom_bank; + int16_t m_left_data; + int16_t m_right_data; bool m_write_pending; }; diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp index 3e3efc193cb..b296dc2d57f 100644 --- a/src/devices/sound/c140.cpp +++ b/src/devices/sound/c140.cpp @@ -50,19 +50,19 @@ Unmapped registers: struct voice_registers { - UINT8 volume_right; - UINT8 volume_left; - UINT8 frequency_msb; - UINT8 frequency_lsb; - UINT8 bank; - UINT8 mode; - UINT8 start_msb; - UINT8 start_lsb; - UINT8 end_msb; - UINT8 end_lsb; - UINT8 loop_msb; - UINT8 loop_lsb; - UINT8 reserved[4]; + uint8_t volume_right; + uint8_t volume_left; + uint8_t frequency_msb; + uint8_t frequency_lsb; + uint8_t bank; + uint8_t mode; + uint8_t start_msb; + uint8_t start_lsb; + uint8_t end_msb; + uint8_t end_lsb; + uint8_t loop_msb; + uint8_t loop_lsb; + uint8_t reserved[4]; }; @@ -74,7 +74,7 @@ const device_type C140 = &device_creator; // LIVE DEVICE //************************************************************************** -static inline int limit(INT32 in) +static inline int limit(int32_t in) { if(in>0x7fff) return 0x7fff; else if(in<-0x8000) return -0x8000; @@ -86,7 +86,7 @@ static inline int limit(INT32 in) // c140_device - constructor //------------------------------------------------- -c140_device::c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c140_device::c140_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C140, "C140", tag, owner, clock, "c140", __FILE__) , device_sound_interface(mconfig, *this) , m_sample_rate(0) @@ -98,8 +98,8 @@ c140_device::c140_device(const machine_config &mconfig, const char *tag, device_ , m_rom_ptr(*this, DEVICE_SELF) , m_pRom(nullptr) { - memset(m_REG, 0, sizeof(UINT8)*0x200); - memset(m_pcmtbl, 0, sizeof(INT16)*8); + memset(m_REG, 0, sizeof(uint8_t)*0x200); + memset(m_pcmtbl, 0, sizeof(int16_t)*8); } @@ -119,7 +119,7 @@ void c140_device::device_start() } /* make decompress pcm table */ //2000.06.26 CAB - INT32 segbase = 0; + int32_t segbase = 0; for(int i = 0; i < 8; i++) { m_pcmtbl[i]=segbase; //segment base value @@ -134,8 +134,8 @@ void c140_device::device_start() } /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ - m_mixer_buffer_left = std::make_unique(m_sample_rate); - m_mixer_buffer_right = std::make_unique(m_sample_rate);; + m_mixer_buffer_left = std::make_unique(m_sample_rate); + m_mixer_buffer_right = std::make_unique(m_sample_rate);; save_item(NAME(m_REG)); @@ -167,24 +167,24 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in { int i,j; - INT32 rvol,lvol; - INT32 dt; - INT32 sdt; - INT32 st,ed,sz; + int32_t rvol,lvol; + int32_t dt; + int32_t sdt; + int32_t st,ed,sz; - INT8 *pSampleData; - INT32 frequency,delta,offset,pos; - INT32 cnt, voicecnt; - INT32 lastdt,prevdt,dltdt; + int8_t *pSampleData; + int32_t frequency,delta,offset,pos; + int32_t cnt, voicecnt; + int32_t lastdt,prevdt,dltdt; float pbase=(float)m_baserate*2.0f / (float)m_sample_rate; - INT16 *lmix, *rmix; + int16_t *lmix, *rmix; if(samples>m_sample_rate) samples=m_sample_rate; /* zap the contents of the mixer buffer */ - memset(m_mixer_buffer_left.get(), 0, samples * sizeof(INT16)); - memset(m_mixer_buffer_right.get(), 0, samples * sizeof(INT16)); + memset(m_mixer_buffer_left.get(), 0, samples * sizeof(int16_t)); + memset(m_mixer_buffer_right.get(), 0, samples * sizeof(int16_t)); /* get the number of voices to update */ voicecnt = (m_banking_type == C140_TYPE_ASIC219) ? 16 : 24; @@ -351,7 +351,7 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in stream_sample_t *dest2 = outputs[1]; for (i = 0; i < samples; i++) { - INT32 val; + int32_t val; val = 8 * (*lmix++); *dest1++ = limit(val); @@ -433,7 +433,7 @@ WRITE8_MEMBER( c140_device::c140_w ) void c140_device::set_base(void *base) { - m_pRom = (INT8 *)base; + m_pRom = (int8_t *)base; } @@ -464,7 +464,7 @@ long c140_device::find_sample(long adrs, long bank, int voice) { long newadr = 0; - static const INT16 asic219banks[4] = { 0x1f7, 0x1f1, 0x1f3, 0x1f5 }; + static const int16_t asic219banks[4] = { 0x1f7, 0x1f1, 0x1f3, 0x1f5 }; adrs=(bank<<16)+adrs; diff --git a/src/devices/sound/c140.h b/src/devices/sound/c140.h index a7662daae1e..fe37021e466 100644 --- a/src/devices/sound/c140.h +++ b/src/devices/sound/c140.h @@ -51,23 +51,23 @@ struct C140_VOICE sample_end(0), sample_loop(0) {} - INT32 ptoffset; - INT32 pos; - INT32 key; + int32_t ptoffset; + int32_t pos; + int32_t key; //--work - INT32 lastdt; - INT32 prevdt; - INT32 dltdt; + int32_t lastdt; + int32_t prevdt; + int32_t dltdt; //--reg - INT32 rvol; - INT32 lvol; - INT32 frequency; - INT32 bank; - INT32 mode; - - INT32 sample_start; - INT32 sample_end; - INT32 sample_loop; + int32_t rvol; + int32_t lvol; + int32_t frequency; + int32_t bank; + int32_t mode; + + int32_t sample_start; + int32_t sample_end; + int32_t sample_loop; }; @@ -77,7 +77,7 @@ class c140_device : public device_t, public device_sound_interface { public: - c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c140_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~c140_device() { } // static configuration @@ -106,15 +106,15 @@ private: sound_stream *m_stream; int m_banking_type; /* internal buffers */ - std::unique_ptr m_mixer_buffer_left; - std::unique_ptr m_mixer_buffer_right; + std::unique_ptr m_mixer_buffer_left; + std::unique_ptr m_mixer_buffer_right; int m_baserate; - optional_region_ptr m_rom_ptr; - INT8 *m_pRom; - UINT8 m_REG[0x200]; + optional_region_ptr m_rom_ptr; + int8_t *m_pRom; + uint8_t m_REG[0x200]; - INT16 m_pcmtbl[8]; //2000.06.26 CAB + int16_t m_pcmtbl[8]; //2000.06.26 CAB C140_VOICE m_voi[C140_MAX_VOICE]; }; diff --git a/src/devices/sound/c352.cpp b/src/devices/sound/c352.cpp index 95a64f503bf..c3b40b04e62 100644 --- a/src/devices/sound/c352.cpp +++ b/src/devices/sound/c352.cpp @@ -33,7 +33,7 @@ const device_type C352 = &device_creator; // c352_device - constructor //------------------------------------------------- -c352_device::c352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c352_device::c352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C352, "C352", tag, owner, clock, "c352", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 24) @@ -72,16 +72,16 @@ void c352_device::fetch_sample(c352_voice_t* v) } else { - INT8 s; + int8_t s; - s = (INT8)read_byte(v->pos); + s = (int8_t)read_byte(v->pos); if(v->flags & C352_FLG_MULAW) - v->sample = m_mulaw_table[(UINT8)s]; + v->sample = m_mulaw_table[(uint8_t)s]; else v->sample = s<<8; - UINT16 pos = v->pos&0xffff; + uint16_t pos = v->pos&0xffff; if((v->flags & C352_FLG_LOOP) && v->flags & C352_FLG_REVERSE) { @@ -124,7 +124,7 @@ void c352_device::sound_stream_update(sound_stream &stream, stream_sample_t **in { int i,j; - INT16 s; + int16_t s; stream_sample_t *buffer_fl = outputs[0]; stream_sample_t *buffer_fr = outputs[1]; stream_sample_t *buffer_rl = outputs[2]; @@ -169,33 +169,33 @@ void c352_device::sound_stream_update(sound_stream &stream, stream_sample_t **in out[3] += ((v->flags & C352_FLG_PHASEFR) ? -s * (v->vol_r&0xff) : s * (v->vol_r&0xff))>>8; } - *buffer_fl++ = (INT16) (out[0]>>3); - *buffer_fr++ = (INT16) (out[1]>>3); - *buffer_rl++ = (INT16) (out[2]>>3); - *buffer_rr++ = (INT16) (out[3]>>3); + *buffer_fl++ = (int16_t) (out[0]>>3); + *buffer_fr++ = (int16_t) (out[1]>>3); + *buffer_rl++ = (int16_t) (out[2]>>3); + *buffer_rr++ = (int16_t) (out[3]>>3); } } -UINT16 c352_device::read_reg16(unsigned long address) +uint16_t c352_device::read_reg16(unsigned long address) { m_stream->update(); const int reg_map[8] = { - offsetof(c352_voice_t,vol_f) / sizeof(UINT16), - offsetof(c352_voice_t,vol_r) / sizeof(UINT16), - offsetof(c352_voice_t,freq) / sizeof(UINT16), - offsetof(c352_voice_t,flags) / sizeof(UINT16), - offsetof(c352_voice_t,wave_bank) / sizeof(UINT16), - offsetof(c352_voice_t,wave_start) / sizeof(UINT16), - offsetof(c352_voice_t,wave_end) / sizeof(UINT16), - offsetof(c352_voice_t,wave_loop) / sizeof(UINT16), + offsetof(c352_voice_t,vol_f) / sizeof(uint16_t), + offsetof(c352_voice_t,vol_r) / sizeof(uint16_t), + offsetof(c352_voice_t,freq) / sizeof(uint16_t), + offsetof(c352_voice_t,flags) / sizeof(uint16_t), + offsetof(c352_voice_t,wave_bank) / sizeof(uint16_t), + offsetof(c352_voice_t,wave_start) / sizeof(uint16_t), + offsetof(c352_voice_t,wave_end) / sizeof(uint16_t), + offsetof(c352_voice_t,wave_loop) / sizeof(uint16_t), }; if(address < 0x100) - return *((UINT16*)&m_c352_v[address/8]+reg_map[address%8]); + return *((uint16_t*)&m_c352_v[address/8]+reg_map[address%8]); else return 0; @@ -208,14 +208,14 @@ void c352_device::write_reg16(unsigned long address, unsigned short val) const int reg_map[8] = { - offsetof(c352_voice_t,vol_f) / sizeof(UINT16), - offsetof(c352_voice_t,vol_r) / sizeof(UINT16), - offsetof(c352_voice_t,freq) / sizeof(UINT16), - offsetof(c352_voice_t,flags) / sizeof(UINT16), - offsetof(c352_voice_t,wave_bank) / sizeof(UINT16), - offsetof(c352_voice_t,wave_start) / sizeof(UINT16), - offsetof(c352_voice_t,wave_end) / sizeof(UINT16), - offsetof(c352_voice_t,wave_loop) / sizeof(UINT16), + offsetof(c352_voice_t,vol_f) / sizeof(uint16_t), + offsetof(c352_voice_t,vol_r) / sizeof(uint16_t), + offsetof(c352_voice_t,freq) / sizeof(uint16_t), + offsetof(c352_voice_t,flags) / sizeof(uint16_t), + offsetof(c352_voice_t,wave_bank) / sizeof(uint16_t), + offsetof(c352_voice_t,wave_start) / sizeof(uint16_t), + offsetof(c352_voice_t,wave_end) / sizeof(uint16_t), + offsetof(c352_voice_t,wave_loop) / sizeof(uint16_t), }; int i; @@ -223,7 +223,7 @@ void c352_device::write_reg16(unsigned long address, unsigned short val) if(address < 0x100) { //printf("w %04lx,%04x, %d\n", address, val, reg_map[address&7]); - *((UINT16*)&m_c352_v[address/8]+reg_map[address%8]) = val; + *((uint16_t*)&m_c352_v[address/8]+reg_map[address%8]) = val; } else if(address == 0x200) m_control = val; @@ -282,7 +282,7 @@ void c352_device::device_start() { x = -x; } - m_mulaw_table[i] = (UINT16)x; + m_mulaw_table[i] = (uint16_t)x; } // register save state info diff --git a/src/devices/sound/c352.h b/src/devices/sound/c352.h index f16c642c215..63d4e71b8f2 100644 --- a/src/devices/sound/c352.h +++ b/src/devices/sound/c352.h @@ -28,7 +28,7 @@ class c352_device : public device_t, { public: // construction/destruction - c352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_divider(device_t &device, int setting); @@ -73,21 +73,21 @@ private: struct c352_voice_t { - UINT32 pos; - UINT32 counter; + uint32_t pos; + uint32_t counter; - INT16 sample; - INT16 last_sample; + int16_t sample; + int16_t last_sample; - UINT16 vol_f; - UINT16 vol_r; - UINT16 freq; - UINT16 flags; + uint16_t vol_f; + uint16_t vol_r; + uint16_t freq; + uint16_t flags; - UINT16 wave_bank; - UINT16 wave_start; - UINT16 wave_end; - UINT16 wave_loop; + uint16_t wave_bank; + uint16_t wave_start; + uint16_t wave_end; + uint16_t wave_loop; }; @@ -95,10 +95,10 @@ private: int m_divider; c352_voice_t m_c352_v[32]; - INT16 m_mulaw_table[256]; + int16_t m_mulaw_table[256]; - UINT16 m_random; - UINT16 m_control; // control flags, purpose unknown. + uint16_t m_random; + uint16_t m_control; // control flags, purpose unknown. void fetch_sample(c352_voice_t* v); diff --git a/src/devices/sound/c6280.cpp b/src/devices/sound/c6280.cpp index a8a18cdf201..276a1962447 100644 --- a/src/devices/sound/c6280.cpp +++ b/src/devices/sound/c6280.cpp @@ -91,7 +91,7 @@ void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **i if((ch >= 4) && (m_channel[ch].m_noise_control & 0x80)) { /* Noise mode */ - UINT32 step = m_noise_freq_tab[(m_channel[ch].m_noise_control & 0x1F) ^ 0x1F]; + uint32_t step = m_noise_freq_tab[(m_channel[ch].m_noise_control & 0x1F) ^ 0x1F]; for (int i = 0; i < samples; i += 1) { static int data = 0; @@ -101,8 +101,8 @@ void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **i data = (machine().rand() & 1) ? 0x1F : 0; } m_channel[ch].m_noise_counter &= 0x7FF; - outputs[0][i] += (INT16)(vll * (data - 16)); - outputs[1][i] += (INT16)(vlr * (data - 16)); + outputs[0][i] += (int16_t)(vll * (data - 16)); + outputs[1][i] += (int16_t)(vlr * (data - 16)); } } else @@ -111,24 +111,24 @@ void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **i /* DDA mode */ for (int i = 0; i < samples; i++) { - outputs[0][i] += (INT16)(vll * (m_channel[ch].m_dda - 16)); - outputs[1][i] += (INT16)(vlr * (m_channel[ch].m_dda - 16)); + outputs[0][i] += (int16_t)(vll * (m_channel[ch].m_dda - 16)); + outputs[1][i] += (int16_t)(vlr * (m_channel[ch].m_dda - 16)); } } else { /* Waveform mode */ - UINT32 step = m_wave_freq_tab[m_channel[ch].m_frequency]; + uint32_t step = m_wave_freq_tab[m_channel[ch].m_frequency]; for (int i = 0; i < samples; i += 1) { int offset; - INT16 data; + int16_t data; offset = (m_channel[ch].m_counter >> 12) & 0x1F; m_channel[ch].m_counter += step; m_channel[ch].m_counter &= 0x1FFFF; data = m_channel[ch].m_waveform[offset]; - outputs[0][i] += (INT16)(vll * (data - 16)); - outputs[1][i] += (INT16)(vlr * (data - 16)); + outputs[0][i] += (int16_t)(vll * (data - 16)); + outputs[1][i] += (int16_t)(vlr * (data - 16)); } } } @@ -231,7 +231,7 @@ WRITE8_MEMBER( c6280_device::c6280_w ) const device_type C6280 = &device_creator; -c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C6280, "HuC6280", tag, owner, clock, "c6280", __FILE__) , device_sound_interface(mconfig, *this) , m_cpudevice(*this, finder_base::DUMMY_TAG) @@ -251,14 +251,14 @@ void c6280_device::calculate_clocks() for (int i = 0; i < 4096; i += 1) { double step = ((clock() / rate) * 4096) / (i + 1); - m_wave_freq_tab[(1 + i) & 0xFFF] = (UINT32)step; + m_wave_freq_tab[(1 + i) & 0xFFF] = (uint32_t)step; } /* Make noise frequency table */ for (int i = 0; i < 32; i += 1) { double step = ((clock() / rate) * 32) / (i+1); - m_noise_freq_tab[i] = (UINT32)step; + m_noise_freq_tab[i] = (uint32_t)step; } if (m_stream != nullptr) @@ -295,7 +295,7 @@ void c6280_device::device_start() double step = 48.0 / 32.0; for (int i = 0; i < 31; i++) { - m_volume_table[i] = (UINT16)level; + m_volume_table[i] = (uint16_t)level; level /= pow(10.0, step / 20.0); } m_volume_table[31] = 0; diff --git a/src/devices/sound/c6280.h b/src/devices/sound/c6280.h index 4949d693ef2..0c95dbfc1b9 100644 --- a/src/devices/sound/c6280.h +++ b/src/devices/sound/c6280.h @@ -11,7 +11,7 @@ class c6280_device : public device_t, public device_sound_interface { public: - c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_devicecpu_tag(device_t &device, const char *tag) { downcast(device).m_cpudevice.set_tag(tag); } @@ -31,28 +31,28 @@ private: void calculate_clocks(); struct channel { - UINT16 m_frequency; - UINT8 m_control; - UINT8 m_balance; - UINT8 m_waveform[32]; - UINT8 m_index; - INT16 m_dda; - UINT8 m_noise_control; - UINT32 m_noise_counter; - UINT32 m_counter; + uint16_t m_frequency; + uint8_t m_control; + uint8_t m_balance; + uint8_t m_waveform[32]; + uint8_t m_index; + int16_t m_dda; + uint8_t m_noise_control; + uint32_t m_noise_counter; + uint32_t m_counter; }; // internal state sound_stream *m_stream; required_device m_cpudevice; - UINT8 m_select; - UINT8 m_balance; - UINT8 m_lfo_frequency; - UINT8 m_lfo_control; + uint8_t m_select; + uint8_t m_balance; + uint8_t m_lfo_frequency; + uint8_t m_lfo_control; channel m_channel[8]; - INT16 m_volume_table[32]; - UINT32 m_noise_freq_tab[32]; - UINT32 m_wave_freq_tab[4096]; + int16_t m_volume_table[32]; + uint32_t m_noise_freq_tab[32]; + uint32_t m_wave_freq_tab[4096]; }; extern const device_type C6280; diff --git a/src/devices/sound/cdda.cpp b/src/devices/sound/cdda.cpp index e24127a65c1..f0fc9e4d000 100644 --- a/src/devices/sound/cdda.cpp +++ b/src/devices/sound/cdda.cpp @@ -18,8 +18,8 @@ void cdda_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { get_audio_data(&outputs[0][0], &outputs[1][0], samples); - m_audio_volume[0] = (INT16)outputs[0][0]; - m_audio_volume[1] = (INT16)outputs[1][0]; + m_audio_volume[0] = (int16_t)outputs[0][0]; + m_audio_volume[1] = (int16_t)outputs[1][0]; } //------------------------------------------------- @@ -29,7 +29,7 @@ void cdda_device::sound_stream_update(sound_stream &stream, stream_sample_t **in void cdda_device::device_start() { /* allocate an audio cache */ - m_audio_cache = std::make_unique(CD_MAX_SECTOR_DATA * MAX_SECTORS ); + m_audio_cache = std::make_unique(CD_MAX_SECTOR_DATA * MAX_SECTORS ); m_stream = machine().sound().stream_alloc(*this, 0, 2, 44100); @@ -69,7 +69,7 @@ void cdda_device::set_cdrom(void *file) Book audio track -------------------------------------------------*/ -void cdda_device::start_audio(UINT32 startlba, UINT32 numblocks) +void cdda_device::start_audio(uint32_t startlba, uint32_t numblocks) { m_stream->update(); m_audio_playing = TRUE; @@ -111,7 +111,7 @@ void cdda_device::pause_audio(int pause) (physical sector) during Red Book playback -------------------------------------------------*/ -UINT32 cdda_device::get_audio_lba() +uint32_t cdda_device::get_audio_lba() { m_stream->update(); return m_audio_lba; @@ -159,10 +159,10 @@ int cdda_device::audio_ended() converts it to 2 16-bit 44.1 kHz streams -------------------------------------------------*/ -void cdda_device::get_audio_data(stream_sample_t *bufL, stream_sample_t *bufR, UINT32 samples_wanted) +void cdda_device::get_audio_data(stream_sample_t *bufL, stream_sample_t *bufR, uint32_t samples_wanted) { int i; - INT16 *audio_cache = (INT16 *) m_audio_cache.get(); + int16_t *audio_cache = (int16_t *) m_audio_cache.get(); while (samples_wanted > 0) { @@ -190,8 +190,8 @@ void cdda_device::get_audio_data(stream_sample_t *bufL, stream_sample_t *bufR, U for (i = 0; i < samples; i++) { /* CD-DA data on the disc is big-endian */ - *bufL++ = (INT16) big_endianize_int16( audio_cache[ m_audio_bptr ] ); m_audio_bptr++; - *bufR++ = (INT16) big_endianize_int16( audio_cache[ m_audio_bptr ] ); m_audio_bptr++; + *bufL++ = (int16_t) big_endianize_int16( audio_cache[ m_audio_bptr ] ); m_audio_bptr++; + *bufR++ = (int16_t) big_endianize_int16( audio_cache[ m_audio_bptr ] ); m_audio_bptr++; } samples_wanted -= samples; @@ -248,14 +248,14 @@ void cdda_device::set_channel_volume(int channel, int volume) for either speaker, used for volume control display -------------------------------------------------*/ -INT16 cdda_device::get_channel_volume(int channel) +int16_t cdda_device::get_channel_volume(int channel) { return m_audio_volume[channel]; } const device_type CDDA = &device_creator; -cdda_device::cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdda_device::cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDDA, "CD/DA", tag, owner, clock, "cdda", __FILE__), device_sound_interface(mconfig, *this) { diff --git a/src/devices/sound/cdda.h b/src/devices/sound/cdda.h index 2d9b6d86584..1766921a1c1 100644 --- a/src/devices/sound/cdda.h +++ b/src/devices/sound/cdda.h @@ -11,18 +11,18 @@ class cdda_device : public device_t, public device_sound_interface { public: - cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_cdrom(void *file); - void start_audio(UINT32 startlba, UINT32 numblocks); + void start_audio(uint32_t startlba, uint32_t numblocks); void stop_audio(); void pause_audio(int pause); void set_volume(int volume); void set_channel_volume(int channel, int volume); - INT16 get_channel_volume(int channel); + int16_t get_channel_volume(int channel); - UINT32 get_audio_lba(); + uint32_t get_audio_lba(); int audio_active(); int audio_paused(); int audio_ended(); @@ -38,18 +38,18 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; private: - void get_audio_data(stream_sample_t *bufL, stream_sample_t *bufR, UINT32 samples_wanted); + void get_audio_data(stream_sample_t *bufL, stream_sample_t *bufR, uint32_t samples_wanted); // internal state sound_stream * m_stream; - INT8 m_audio_playing, m_audio_pause, m_audio_ended_normally; - UINT32 m_audio_lba, m_audio_length; + int8_t m_audio_playing, m_audio_pause, m_audio_ended_normally; + uint32_t m_audio_lba, m_audio_length; - std::unique_ptr m_audio_cache; - UINT32 m_audio_samples; - UINT32 m_audio_bptr; - INT16 m_audio_volume[2]; + std::unique_ptr m_audio_cache; + uint32_t m_audio_samples; + uint32_t m_audio_bptr; + int16_t m_audio_volume[2]; }; extern const device_type CDDA; diff --git a/src/devices/sound/cdp1863.cpp b/src/devices/sound/cdp1863.cpp index 63515aa7c43..c85a55ee4a5 100644 --- a/src/devices/sound/cdp1863.cpp +++ b/src/devices/sound/cdp1863.cpp @@ -46,7 +46,7 @@ const device_type CDP1863 = &device_creator; // cdp1863_device - constructor //------------------------------------------------- -cdp1863_device::cdp1863_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdp1863_device::cdp1863_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDP1863, "CDP1863", tag, owner, clock, "cdp1863", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -97,7 +97,7 @@ void cdp1863_device::sound_stream_update(sound_stream &stream, stream_sample_t * // reset the output stream memset(outputs[0], 0, samples * sizeof(*outputs[0])); - INT16 signal = m_signal; + int16_t signal = m_signal; stream_sample_t *buffer = outputs[0]; memset( buffer, 0, samples * sizeof(*buffer) ); @@ -162,7 +162,7 @@ WRITE8_MEMBER( cdp1863_device::str_w ) // str_w - latch write //------------------------------------------------- -void cdp1863_device::str_w(UINT8 data) +void cdp1863_device::str_w(uint8_t data) { m_latch = data; } diff --git a/src/devices/sound/cdp1863.h b/src/devices/sound/cdp1863.h index 738d6368e5f..6890490fe53 100644 --- a/src/devices/sound/cdp1863.h +++ b/src/devices/sound/cdp1863.h @@ -47,13 +47,13 @@ class cdp1863_device : public device_t, { public: // construction/destruction - cdp1863_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdp1863_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_clock2(device_t &device, int clock2); DECLARE_WRITE8_MEMBER( str_w ); - void str_w(UINT8 data); + void str_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER( oe_w ); @@ -76,7 +76,7 @@ private: // sound state int m_oe; // output enable int m_latch; // sound latch - INT16 m_signal; // current signal + int16_t m_signal; // current signal int m_incr; // initial wave state }; diff --git a/src/devices/sound/cdp1864.cpp b/src/devices/sound/cdp1864.cpp index 9b1d1807d96..fce034cc783 100644 --- a/src/devices/sound/cdp1864.cpp +++ b/src/devices/sound/cdp1864.cpp @@ -56,7 +56,7 @@ const device_type CDP1864 = &device_creator; // cdp1864_device - constructor //------------------------------------------------- -cdp1864_device::cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdp1864_device::cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDP1864, "CDP1864", tag, owner, clock, "cdp1864", __FILE__), device_sound_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -241,7 +241,7 @@ void cdp1864_device::sound_stream_update(sound_stream &stream, stream_sample_t * // reset the output stream memset(outputs[0], 0, samples * sizeof(*outputs[0])); - INT16 signal = m_signal; + int16_t signal = m_signal; stream_sample_t *buffer = outputs[0]; memset( buffer, 0, samples * sizeof(*buffer) ); @@ -405,7 +405,7 @@ WRITE_LINE_MEMBER( cdp1864_device::evs_w ) // update_screen - //------------------------------------------------- -UINT32 cdp1864_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cdp1864_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_disp) { @@ -447,7 +447,7 @@ void cdp1864_device::initialize_palette() for (int i = 0; i < 8; i++) { // foreground colors - UINT8 r = 0, g = 0, b = 0; + uint8_t r = 0, g = 0, b = 0; if (m_chr_r != RES_INF) r = combine_1_weights(color_weights_r, BIT(i, 0)); if (m_chr_b != RES_INF) b = combine_1_weights(color_weights_b, BIT(i, 1)); diff --git a/src/devices/sound/cdp1864.h b/src/devices/sound/cdp1864.h index b4a311caff0..f90e6005d2b 100644 --- a/src/devices/sound/cdp1864.h +++ b/src/devices/sound/cdp1864.h @@ -114,7 +114,7 @@ class cdp1864_device : public device_t, { public: // construction/destruction - cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_inlace_callback(_inlace inlace) { m_read_inlace.set_callback(inlace); } template void set_irq_callback(_irq irq) { m_write_irq.set_callback(irq); } @@ -138,7 +138,7 @@ public: DECLARE_WRITE_LINE_MEMBER( aoe_w ); DECLARE_WRITE_LINE_MEMBER( evs_w ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -189,7 +189,7 @@ private: // sound state int m_aoe; // audio on int m_latch; // sound latch - INT16 m_signal; // current signal + int16_t m_signal; // current signal int m_incr; // initial wave state // timers diff --git a/src/devices/sound/cdp1869.cpp b/src/devices/sound/cdp1869.cpp index 5f70edc8cef..7a76ed6d3d0 100644 --- a/src/devices/sound/cdp1869.cpp +++ b/src/devices/sound/cdp1869.cpp @@ -103,7 +103,7 @@ inline bool cdp1869_device::is_ntsc() // the given address //------------------------------------------------- -inline UINT8 cdp1869_device::read_page_ram_byte(offs_t pma) +inline uint8_t cdp1869_device::read_page_ram_byte(offs_t pma) { return space().read_byte(pma); } @@ -114,7 +114,7 @@ inline UINT8 cdp1869_device::read_page_ram_byte(offs_t pma) // the given address //------------------------------------------------- -inline void cdp1869_device::write_page_ram_byte(offs_t pma, UINT8 data) +inline void cdp1869_device::write_page_ram_byte(offs_t pma, uint8_t data) { space().write_byte(pma, data); } @@ -125,9 +125,9 @@ inline void cdp1869_device::write_page_ram_byte(offs_t pma, UINT8 data) // the given address //------------------------------------------------- -inline UINT8 cdp1869_device::read_char_ram_byte(offs_t pma, offs_t cma, UINT8 pmd) +inline uint8_t cdp1869_device::read_char_ram_byte(offs_t pma, offs_t cma, uint8_t pmd) { - UINT8 data = 0; + uint8_t data = 0; if (!m_in_char_ram_func.isnull()) { @@ -143,7 +143,7 @@ inline UINT8 cdp1869_device::read_char_ram_byte(offs_t pma, offs_t cma, UINT8 pm // the given address //------------------------------------------------- -inline void cdp1869_device::write_char_ram_byte(offs_t pma, offs_t cma, UINT8 pmd, UINT8 data) +inline void cdp1869_device::write_char_ram_byte(offs_t pma, offs_t cma, uint8_t pmd, uint8_t data) { if (!m_out_char_ram_func.isnull()) { @@ -156,7 +156,7 @@ inline void cdp1869_device::write_char_ram_byte(offs_t pma, offs_t cma, UINT8 pm // read_pcb - read page control bit //------------------------------------------------- -inline int cdp1869_device::read_pcb(offs_t pma, offs_t cma, UINT8 pmd) +inline int cdp1869_device::read_pcb(offs_t pma, offs_t cma, uint8_t pmd) { int pcb = 0; @@ -260,7 +260,7 @@ inline int cdp1869_device::get_lines() // get_pmemsize - get page memory size //------------------------------------------------- -inline UINT16 cdp1869_device::get_pmemsize(int cols, int rows) +inline uint16_t cdp1869_device::get_pmemsize(int cols, int rows) { int pmemsize = cols * rows; @@ -275,7 +275,7 @@ inline UINT16 cdp1869_device::get_pmemsize(int cols, int rows) // get_pma - get page memory address //------------------------------------------------- -inline UINT16 cdp1869_device::get_pma() +inline uint16_t cdp1869_device::get_pma() { if (m_dblpage) { @@ -340,7 +340,7 @@ inline int cdp1869_device::get_pen(int ccb0, int ccb1, int pcb) // cdp1869_device - constructor //------------------------------------------------- -cdp1869_device::cdp1869_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +cdp1869_device::cdp1869_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDP1869, "RCA CDP1869", tag, owner, clock, "cdp1869", __FILE__), device_sound_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -507,7 +507,7 @@ void cdp1869_device::sound_stream_update(sound_stream &stream, stream_sample_t * // reset the output stream memset(outputs[0], 0, samples * sizeof(*outputs[0])); - INT16 signal = m_signal; + int16_t signal = m_signal; stream_sample_t *buffer = outputs[0]; if (!m_toneoff && m_toneamp) @@ -565,7 +565,7 @@ void cdp1869_device::sound_stream_update(sound_stream &stream, stream_sample_t * // draw_line - draw character line //------------------------------------------------- -void cdp1869_device::draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color) +void cdp1869_device::draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, uint8_t data, int color) { int i; pen_t fg = m_palette->pen(color); @@ -610,13 +610,13 @@ void cdp1869_device::draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int // draw_char - draw character //------------------------------------------------- -void cdp1869_device::draw_char(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT16 pma) +void cdp1869_device::draw_char(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, uint16_t pma) { - UINT8 pmd = read_page_ram_byte(pma); + uint8_t pmd = read_page_ram_byte(pma); - for (UINT8 cma = 0; cma < get_lines(); cma++) + for (uint8_t cma = 0; cma < get_lines(); cma++) { - UINT8 data = read_char_ram_byte(pma, cma, pmd); + uint8_t data = read_char_ram_byte(pma, cma, pmd); int ccb0 = BIT(data, CCB0); int ccb1 = BIT(data, CCB1); @@ -816,8 +816,8 @@ WRITE8_MEMBER( cdp1869_device::out7_w ) READ8_MEMBER( cdp1869_device::char_ram_r ) { - UINT8 cma = offset & 0x0f; - UINT16 pma; + uint8_t cma = offset & 0x0f; + uint16_t pma; if (m_cmem) { @@ -833,7 +833,7 @@ READ8_MEMBER( cdp1869_device::char_ram_r ) cma &= 0x07; } - UINT8 pmd = read_page_ram_byte(pma); + uint8_t pmd = read_page_ram_byte(pma); return read_char_ram_byte(pma, cma, pmd); } @@ -845,8 +845,8 @@ READ8_MEMBER( cdp1869_device::char_ram_r ) WRITE8_MEMBER( cdp1869_device::char_ram_w ) { - UINT8 cma = offset & 0x0f; - UINT16 pma; + uint8_t cma = offset & 0x0f; + uint16_t pma; if (m_cmem) { @@ -862,7 +862,7 @@ WRITE8_MEMBER( cdp1869_device::char_ram_w ) cma &= 0x07; } - UINT8 pmd = read_page_ram_byte(pma); + uint8_t pmd = read_page_ram_byte(pma); write_char_ram_byte(pma, cma, pmd, data); } @@ -874,7 +874,7 @@ WRITE8_MEMBER( cdp1869_device::char_ram_w ) READ8_MEMBER( cdp1869_device::page_ram_r ) { - UINT16 pma; + uint16_t pma; if (m_cmem) { @@ -895,7 +895,7 @@ READ8_MEMBER( cdp1869_device::page_ram_r ) WRITE8_MEMBER( cdp1869_device::page_ram_w ) { - UINT16 pma; + uint16_t pma; if (m_cmem) { @@ -934,7 +934,7 @@ READ_LINE_MEMBER( cdp1869_device::pal_ntsc_r ) // update_screen - update screen //------------------------------------------------- -UINT32 cdp1869_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cdp1869_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { rectangle screen_rect, outer; @@ -982,8 +982,8 @@ UINT32 cdp1869_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap int cols = m_freshorz ? CDP1869_COLUMNS_FULL : CDP1869_COLUMNS_HALF; int rows = screen_rect.height() / height; - UINT16 pmemsize = get_pmemsize(cols, rows); - UINT16 addr = m_hma; + uint16_t pmemsize = get_pmemsize(cols, rows); + uint16_t addr = m_hma; for (int sy = 0; sy < rows; sy++) { diff --git a/src/devices/sound/cdp1869.h b/src/devices/sound/cdp1869.h index 23f538fb931..212476f670e 100644 --- a/src/devices/sound/cdp1869.h +++ b/src/devices/sound/cdp1869.h @@ -152,9 +152,9 @@ #define MCFG_CDP1869_SET_SCREEN MCFG_VIDEO_SET_SCREEN -#define CDP1869_CHAR_RAM_READ_MEMBER(name) UINT8 name(UINT16 pma, UINT8 cma, UINT8 pmd) -#define CDP1869_CHAR_RAM_WRITE_MEMBER(name) void name(UINT16 pma, UINT8 cma, UINT8 pmd, UINT8 data) -#define CDP1869_PCB_READ_MEMBER(name) int name(UINT16 pma, UINT8 cma, UINT8 pmd) +#define CDP1869_CHAR_RAM_READ_MEMBER(name) uint8_t name(uint16_t pma, uint8_t cma, uint8_t pmd) +#define CDP1869_CHAR_RAM_WRITE_MEMBER(name) void name(uint16_t pma, uint8_t cma, uint8_t pmd, uint8_t data) +#define CDP1869_PCB_READ_MEMBER(name) int name(uint16_t pma, uint8_t cma, uint8_t pmd) #define MCFG_CDP1869_PAL_NTSC_CALLBACK(_read) \ devcb = &cdp1869_device::set_pal_ntsc_rd_callback(*device, DEVCB_##_read); @@ -178,9 +178,9 @@ // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate cdp1869_char_ram_read_delegate; -typedef device_delegate cdp1869_char_ram_write_delegate; -typedef device_delegate cdp1869_pcb_read_delegate; +typedef device_delegate cdp1869_char_ram_read_delegate; +typedef device_delegate cdp1869_char_ram_write_delegate; +typedef device_delegate cdp1869_pcb_read_delegate; // ======================> cdp1869_device @@ -191,7 +191,7 @@ class cdp1869_device : public device_t, { public: // construction/destruction - cdp1869_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdp1869_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_pal_ntsc_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_pal_ntsc.set_callback(object); } template static devcb_base &set_prd_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_prd.set_callback(object); } @@ -221,7 +221,7 @@ public: DECLARE_READ_LINE_MEMBER( predisplay_r ); DECLARE_READ_LINE_MEMBER( pal_ntsc_r ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -237,20 +237,20 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; inline bool is_ntsc(); - inline UINT8 read_page_ram_byte(offs_t address); - inline void write_page_ram_byte(offs_t address, UINT8 data); - inline UINT8 read_char_ram_byte(offs_t pma, offs_t cma, UINT8 pmd); - inline void write_char_ram_byte(offs_t pma, offs_t cma, UINT8 pmd, UINT8 data); - inline int read_pcb(offs_t pma, offs_t cma, UINT8 pmd); + inline uint8_t read_page_ram_byte(offs_t address); + inline void write_page_ram_byte(offs_t address, uint8_t data); + inline uint8_t read_char_ram_byte(offs_t pma, offs_t cma, uint8_t pmd); + inline void write_char_ram_byte(offs_t pma, offs_t cma, uint8_t pmd, uint8_t data); + inline int read_pcb(offs_t pma, offs_t cma, uint8_t pmd); inline void update_prd_changed_timer(); inline rgb_t get_rgb(int i, int c, int l); inline int get_lines(); - inline UINT16 get_pmemsize(int cols, int rows); - inline UINT16 get_pma(); + inline uint16_t get_pmemsize(int cols, int rows); + inline uint16_t get_pma(); inline int get_pen(int ccb0, int ccb1, int pcb); - void draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT8 data, int color); - void draw_char(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, UINT16 pma); + void draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, uint8_t data, int color); + void draw_char(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, uint16_t pma); private: devcb_read_line m_read_pal_ntsc; @@ -276,21 +276,21 @@ private: int m_line16; // 16-line hi-res mode int m_line9; // 9 line mode int m_cfc; // color format control - UINT8 m_col; // character color control - UINT8 m_bkg; // background color - UINT16 m_pma; // page memory address - UINT16 m_hma; // home memory address + uint8_t m_col; // character color control + uint8_t m_bkg; // background color + uint16_t m_pma; // page memory address + uint16_t m_hma; // home memory address // sound state - INT16 m_signal; // current signal + int16_t m_signal; // current signal int m_incr; // initial wave state int m_toneoff; // tone off int m_wnoff; // white noise off - UINT8 m_tonediv; // tone divisor - UINT8 m_tonefreq; // tone range select - UINT8 m_toneamp; // tone output amplitude - UINT8 m_wnfreq; // white noise range select - UINT8 m_wnamp; // white noise output amplitude + uint8_t m_tonediv; // tone divisor + uint8_t m_tonefreq; // tone range select + uint8_t m_toneamp; // tone output amplitude + uint8_t m_wnfreq; // white noise range select + uint8_t m_wnamp; // white noise output amplitude }; diff --git a/src/devices/sound/cem3394.cpp b/src/devices/sound/cem3394.cpp index 5d345fa6507..4e264f5be1b 100644 --- a/src/devices/sound/cem3394.cpp +++ b/src/devices/sound/cem3394.cpp @@ -115,7 +115,7 @@ const device_type CEM3394 = &device_creator; // cem3394_device - constructor //------------------------------------------------- -cem3394_device::cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cem3394_device::cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CEM3394, "CEM3394", tag, owner, clock, "cem3394", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -149,9 +149,9 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t * { int int_volume = (m_volume * m_mixer_internal) / 256; int ext_volume = (m_volume * m_mixer_external) / 256; - UINT32 step = m_step, position, end_position = 0; + uint32_t step = m_step, position, end_position = 0; stream_sample_t *buffer = outputs[0]; - INT16 *mix, *ext; + int16_t *mix, *ext; int i; /* external volume is effectively 0 if no external function */ @@ -172,8 +172,8 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* if there's external stuff, fetch and process it now */ if (ext_volume != 0) { - UINT32 fposition = m_filter_position, fstep = m_filter_step, depth; - INT16 last_ext = m_last_ext; + uint32_t fposition = m_filter_position, fstep = m_filter_step, depth; + int16_t last_ext = m_last_ext; /* fetch the external data */ m_ext_cb(samples, m_external_buffer.get()); @@ -189,8 +189,8 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t * external sample to filter_freq by allowing only 2 transitions for every cycle */ for (i = 0, ext = m_external_buffer.get(), position = m_position; i < samples; i++, ext++) { - UINT32 newposition; - INT32 stepadjust; + uint32_t newposition; + int32_t stepadjust; /* update the position and compute the adjustment from a triangle wave */ if (position & (1 << (FRACTION_BITS - 1))) @@ -224,7 +224,7 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* odd value for volume) */ if (ENABLE_PULSE && (m_wave_select & WAVE_PULSE)) { - UINT32 pulse_width = m_pulse_width; + uint32_t pulse_width = m_pulse_width; /* if the width is wider than the step, we're guaranteed to hit it once per cycle */ if (pulse_width >= step) @@ -242,10 +242,10 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* otherwise, we compute a volume and watch for cycle boundary crossings */ else { - INT16 volume = 0x1932 * pulse_width / step; + int16_t volume = 0x1932 * pulse_width / step; for (i = 0, mix = m_mixer_buffer.get(), position = m_position; i < samples; i++, mix++) { - UINT32 newposition = position + step; + uint32_t newposition = position + step; if ((newposition ^ position) & ~FRACTION_MASK) *mix = volume; else @@ -258,7 +258,7 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* otherwise, clear the mixing buffer */ else - memset(m_mixer_buffer.get(), 0, sizeof(INT16) * samples); + memset(m_mixer_buffer.get(), 0, sizeof(int16_t) * samples); /* handle the sawtooth component; it maxes out at 0x2000, which is 27% larger */ /* than the pulse */ @@ -279,7 +279,7 @@ void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t * { for (i = 0, mix = m_mixer_buffer.get(), position = m_position; i < samples; i++, mix++) { - INT16 value; + int16_t value; if (position & (1 << (FRACTION_BITS - 1))) value = 0x2000 - ((position >> (FRACTION_BITS - 14)) & 0x1fff); else @@ -336,8 +336,8 @@ void cem3394_device::device_start() m_ext_cb.bind_relative_to(*owner()); /* allocate memory for a mixer buffer and external buffer (1 second should do it!) */ - m_mixer_buffer = std::make_unique(m_sample_rate); - m_external_buffer = std::make_unique(m_sample_rate); + m_mixer_buffer = std::make_unique(m_sample_rate); + m_external_buffer = std::make_unique(m_sample_rate); save_item(NAME(m_values)); save_item(NAME(m_wave_select)); @@ -380,7 +380,7 @@ double cem3394_device::compute_db(double voltage) } -UINT32 cem3394_device::compute_db_volume(double voltage) +uint32_t cem3394_device::compute_db_volume(double voltage) { double temp; @@ -406,7 +406,7 @@ UINT32 cem3394_device::compute_db_volume(double voltage) } /* convert from dB to volume and return */ - return (UINT32)(256.0 * pow(0.891251, temp)); + return (uint32_t)(256.0 * pow(0.891251, temp)); } @@ -428,7 +428,7 @@ void cem3394_device::set_voltage(int input, double voltage) /* frequency varies from -4.0 to +4.0, at 0.75V/octave */ case CEM3394_VCO_FREQUENCY: temp = m_vco_zero_freq * pow(2.0, -voltage * (1.0 / 0.75)); - m_step = (UINT32)(temp * m_inv_sample_rate * FRACTION_ONE_D); + m_step = (uint32_t)(temp * m_inv_sample_rate * FRACTION_ONE_D); break; /* wave select determines triangle/sawtooth enable */ @@ -454,7 +454,7 @@ void cem3394_device::set_voltage(int input, double voltage) temp = voltage * 0.5; if (LIMIT_WIDTH) temp = MINIMUM_WIDTH + (MAXIMUM_WIDTH - MINIMUM_WIDTH) * temp; - m_pulse_width = (UINT32)(temp * FRACTION_ONE_D); + m_pulse_width = (uint32_t)(temp * FRACTION_ONE_D); m_wave_select |= WAVE_PULSE; } break; @@ -482,18 +482,18 @@ void cem3394_device::set_voltage(int input, double voltage) /* filter frequency varies from -4.0 to +4.0, at 0.375V/octave */ case CEM3394_FILTER_FREQENCY: temp = m_filter_zero_freq * pow(2.0, -voltage * (1.0 / 0.375)); - m_filter_step = (UINT32)(temp * m_inv_sample_rate * FRACTION_ONE_D); + m_filter_step = (uint32_t)(temp * m_inv_sample_rate * FRACTION_ONE_D); break; /* modulation depth is 0.01 at 0V and 2.0 at 3.5V; how it grows from one to the other */ /* is still unclear at this point */ case CEM3394_MODULATION_AMOUNT: if (voltage < 0.0) - m_modulation_depth = (UINT32)(0.01 * FRACTION_ONE_D); + m_modulation_depth = (uint32_t)(0.01 * FRACTION_ONE_D); else if (voltage > 3.5) - m_modulation_depth = (UINT32)(2.00 * FRACTION_ONE_D); + m_modulation_depth = (uint32_t)(2.00 * FRACTION_ONE_D); else - m_modulation_depth = (UINT32)(((voltage * (1.0 / 3.5)) * 1.99 + 0.01) * FRACTION_ONE_D); + m_modulation_depth = (uint32_t)(((voltage * (1.0 / 3.5)) * 1.99 + 0.01) * FRACTION_ONE_D); break; /* this is not yet implemented */ diff --git a/src/devices/sound/cem3394.h b/src/devices/sound/cem3394.h index 88d2608bec1..67a8fce7cc8 100644 --- a/src/devices/sound/cem3394.h +++ b/src/devices/sound/cem3394.h @@ -47,7 +47,7 @@ class cem3394_device : public device_t, public device_sound_interface { public: - cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~cem3394_device() { } static void set_ext_input_callback(device_t &device, cem3394_ext_input_delegate callback) { downcast(device).m_ext_cb = callback; } @@ -78,7 +78,7 @@ public: private: double compute_db(double voltage); - UINT32 compute_db_volume(double voltage); + uint32_t compute_db_volume(double voltage); private: cem3394_ext_input_delegate m_ext_cb; /* callback to generate external samples */ @@ -88,27 +88,27 @@ private: double m_filter_zero_freq; /* frequency of filter at 0.0V */ double m_values[8]; /* raw values of registers */ - UINT8 m_wave_select; /* flags which waveforms are enabled */ + uint8_t m_wave_select; /* flags which waveforms are enabled */ - UINT32 m_volume; /* linear overall volume (0-256) */ - UINT32 m_mixer_internal; /* linear internal volume (0-256) */ - UINT32 m_mixer_external; /* linear external volume (0-256) */ + uint32_t m_volume; /* linear overall volume (0-256) */ + uint32_t m_mixer_internal; /* linear internal volume (0-256) */ + uint32_t m_mixer_external; /* linear external volume (0-256) */ - UINT32 m_position; /* current VCO frequency position (0.FRACTION_BITS) */ - UINT32 m_step; /* per-sample VCO step (0.FRACTION_BITS) */ + uint32_t m_position; /* current VCO frequency position (0.FRACTION_BITS) */ + uint32_t m_step; /* per-sample VCO step (0.FRACTION_BITS) */ - UINT32 m_filter_position; /* current filter frequency position (0.FRACTION_BITS) */ - UINT32 m_filter_step; /* per-sample filter step (0.FRACTION_BITS) */ - UINT32 m_modulation_depth; /* fraction of total by which we modulate (0.FRACTION_BITS) */ - INT16 m_last_ext; /* last external sample we read */ + uint32_t m_filter_position; /* current filter frequency position (0.FRACTION_BITS) */ + uint32_t m_filter_step; /* per-sample filter step (0.FRACTION_BITS) */ + uint32_t m_modulation_depth; /* fraction of total by which we modulate (0.FRACTION_BITS) */ + int16_t m_last_ext; /* last external sample we read */ - UINT32 m_pulse_width; /* fractional pulse width (0.FRACTION_BITS) */ + uint32_t m_pulse_width; /* fractional pulse width (0.FRACTION_BITS) */ double m_inv_sample_rate; int m_sample_rate; - std::unique_ptr m_mixer_buffer; - std::unique_ptr m_external_buffer; + std::unique_ptr m_mixer_buffer; + std::unique_ptr m_external_buffer; }; extern const device_type CEM3394; diff --git a/src/devices/sound/dac.h b/src/devices/sound/dac.h index c3983eee492..d9c0e345eca 100644 --- a/src/devices/sound/dac.h +++ b/src/devices/sound/dac.h @@ -192,7 +192,7 @@ class dac_device : public device_t, protected _dac_code { protected: - dac_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, double gain) + dac_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, double gain) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_sound_interface(mconfig, *this), _dac_code(gain) @@ -220,7 +220,7 @@ class dac_generator : public dac_device<_dac_code> { public: - dac_generator(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, double gain) : + dac_generator(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, double gain) : dac_device<_dac_code>(mconfig, type, name, tag, owner, clock, shortname, source, gain) { } @@ -235,7 +235,7 @@ class dac_generator : public dac_device<_dac_code> { public: - dac_generator(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, double gain) : + dac_generator(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, double gain) : dac_device<_dac_code>(mconfig, type, name, tag, owner, clock, shortname, source, gain) { } @@ -250,7 +250,7 @@ class dac_generator : public dac_device<_dac_code> { public: - dac_generator(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, double gain) : + dac_generator(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, double gain) : dac_device<_dac_code>(mconfig, type, name, tag, owner, clock, shortname, source, gain) { } @@ -271,7 +271,7 @@ extern const device_type _dac_type; \ class _dac_class : public dac_generator<_dac_interface, _dac_coding> \ {\ public: \ - _dac_class(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : \ + _dac_class(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : \ dac_generator(mconfig, _dac_type, _dac_description, tag, owner, clock, _dac_shortname, __FILE__, _dac_gain) {} \ }; \ DAC_GENERATOR_EPILOG(_dac_type, _dac_class) diff --git a/src/devices/sound/digitalk.cpp b/src/devices/sound/digitalk.cpp index d36bb77e4c3..8d8f40bf694 100644 --- a/src/devices/sound/digitalk.cpp +++ b/src/devices/sound/digitalk.cpp @@ -263,7 +263,7 @@ static const int pitch_vals[32] = { const device_type DIGITALKER = &device_creator; -digitalker_device::digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +digitalker_device::digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DIGITALKER, "Digitalker", tag, owner, clock, "digitalker", __FILE__), device_sound_interface(mconfig, *this), m_rom(*this, DEVICE_SELF), @@ -292,9 +292,9 @@ digitalker_device::digitalker_device(const machine_config &mconfig, const char * } -void digitalker_device::digitalker_write(UINT8 *adr, UINT8 vol, INT8 dac) +void digitalker_device::digitalker_write(uint8_t *adr, uint8_t vol, int8_t dac) { - INT16 v; + int16_t v; dac &= 15; if(dac >= 9) v = -pcm_levels[vol][15-dac]; @@ -305,7 +305,7 @@ void digitalker_device::digitalker_write(UINT8 *adr, UINT8 vol, INT8 dac) m_dac[(*adr)++] = v; } -UINT8 digitalker_device::digitalker_pitch_next(UINT8 val, UINT8 prev, int step) +uint8_t digitalker_device::digitalker_pitch_next(uint8_t val, uint8_t prev, int step) { int delta, nv; @@ -323,12 +323,12 @@ UINT8 digitalker_device::digitalker_pitch_next(UINT8 val, UINT8 prev, int step) return nv; } -void digitalker_device::digitalker_set_intr(UINT8 intr) +void digitalker_device::digitalker_set_intr(uint8_t intr) { m_intr = intr; } -void digitalker_device::digitalker_start_command(UINT8 cmd) +void digitalker_device::digitalker_start_command(uint8_t cmd) { m_bpos = ((m_rom[cmd*2] << 8) | m_rom[cmd*2+1]) & 0x3fff; m_cur_segment = m_segments = m_cur_repeat = m_repeats = 0; @@ -339,13 +339,13 @@ void digitalker_device::digitalker_start_command(UINT8 cmd) void digitalker_device::digitalker_step_mode_0() { - INT8 dac = 0; + int8_t dac = 0; int i, k, l; - UINT8 wpos = 0; - UINT8 h = m_rom[m_apos]; - UINT16 bits = 0x80; - UINT8 vol = h >> 5; - UINT8 pitch_id = m_cur_segment ? digitalker_pitch_next(h, m_prev_pitch, m_cur_repeat) : h & 0x1f; + uint8_t wpos = 0; + uint8_t h = m_rom[m_apos]; + uint16_t bits = 0x80; + uint8_t vol = h >> 5; + uint8_t pitch_id = m_cur_segment ? digitalker_pitch_next(h, m_prev_pitch, m_cur_repeat) : h & 0x1f; m_pitch = pitch_vals[pitch_id]; @@ -392,13 +392,13 @@ void digitalker_device::digitalker_step_mode_1() void digitalker_device::digitalker_step_mode_2() { - INT8 dac = 0; + int8_t dac = 0; int k, l; - UINT8 wpos=0; - UINT8 h = m_rom[m_apos]; - UINT16 bits = 0x80; - UINT8 vol = h >> 5; - UINT8 pitch_id = m_cur_segment ? digitalker_pitch_next(h, m_prev_pitch, m_cur_repeat) : h & 0x1f; + uint8_t wpos=0; + uint8_t h = m_rom[m_apos]; + uint16_t bits = 0x80; + uint8_t vol = h >> 5; + uint8_t pitch_id = m_cur_segment ? digitalker_pitch_next(h, m_prev_pitch, m_cur_repeat) : h & 0x1f; m_pitch = pitch_vals[pitch_id]; @@ -456,10 +456,10 @@ void digitalker_device::digitalker_step_mode_2() void digitalker_device::digitalker_step_mode_3() { - UINT8 h = m_rom[m_apos]; - UINT8 vol = h >> 5; - UINT16 bits; - UINT8 dac, apos, wpos; + uint8_t h = m_rom[m_apos]; + uint8_t vol = h >> 5; + uint16_t bits; + uint8_t dac, apos, wpos; int k, l; m_pitch = pitch_vals[h & 0x1f]; @@ -497,9 +497,9 @@ void digitalker_device::digitalker_step() if(m_stop_after == 0 && m_bpos == 0xffff) return; if(m_stop_after == 0) { - UINT8 v1 = m_rom[m_bpos++]; - UINT8 v2 = m_rom[m_bpos++]; - UINT8 v3 = m_rom[m_bpos++]; + uint8_t v1 = m_rom[m_bpos++]; + uint8_t v2 = m_rom[m_bpos++]; + uint8_t v3 = m_rom[m_bpos++]; m_apos = v2 | ((v3 << 8) & 0x3f00); m_segments = (v1 & 15) + 1; m_repeats = ((v1 >> 4) & 7) + 1; @@ -585,7 +585,7 @@ void digitalker_device::sound_stream_update(sound_stream &stream, stream_sample_ void digitalker_device::digitalker_cs_w(int line) { - UINT8 cs = line == ASSERT_LINE ? 1 : 0; + uint8_t cs = line == ASSERT_LINE ? 1 : 0; if(cs == m_cs) return; m_cs = cs; @@ -606,7 +606,7 @@ void digitalker_device::digitalker_cms_w(int line) void digitalker_device::digitalker_wr_w(int line) { - UINT8 wr = line == ASSERT_LINE ? 1 : 0; + uint8_t wr = line == ASSERT_LINE ? 1 : 0; if(wr == m_wr) return; m_wr = wr; diff --git a/src/devices/sound/digitalk.h b/src/devices/sound/digitalk.h index 4142a50e3e2..d63aeaa3eb9 100644 --- a/src/devices/sound/digitalk.h +++ b/src/devices/sound/digitalk.h @@ -24,7 +24,7 @@ class digitalker_device : public device_t, public device_sound_interface { public: - digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~digitalker_device() { } void digitalker_0_cs_w(int line); @@ -43,10 +43,10 @@ public: DECLARE_WRITE8_MEMBER(digitalker_data_w); private: - void digitalker_write(UINT8 *adr, UINT8 vol, INT8 dac); - UINT8 digitalker_pitch_next(UINT8 val, UINT8 prev, int step); - void digitalker_set_intr(UINT8 intr); - void digitalker_start_command(UINT8 cmd); + void digitalker_write(uint8_t *adr, uint8_t vol, int8_t dac); + uint8_t digitalker_pitch_next(uint8_t val, uint8_t prev, int step); + void digitalker_set_intr(uint8_t intr); + void digitalker_start_command(uint8_t cmd); void digitalker_step_mode_0(); void digitalker_step_mode_1(); void digitalker_step_mode_2(); @@ -59,40 +59,40 @@ private: void digitalker_register_for_save(); private: - required_region_ptr m_rom; + required_region_ptr m_rom; sound_stream *m_stream; // Port/lines state - UINT8 m_data; - UINT8 m_cs; - UINT8 m_cms; - UINT8 m_wr; - UINT8 m_intr; + uint8_t m_data; + uint8_t m_cs; + uint8_t m_cms; + uint8_t m_wr; + uint8_t m_intr; // Current decoding state - UINT16 m_bpos; - UINT16 m_apos; + uint16_t m_bpos; + uint16_t m_apos; - UINT8 m_mode; - UINT8 m_cur_segment; - UINT8 m_cur_repeat; - UINT8 m_segments; - UINT8 m_repeats; + uint8_t m_mode; + uint8_t m_cur_segment; + uint8_t m_cur_repeat; + uint8_t m_segments; + uint8_t m_repeats; - UINT8 m_prev_pitch; - UINT8 m_pitch; - UINT8 m_pitch_pos; + uint8_t m_prev_pitch; + uint8_t m_pitch; + uint8_t m_pitch_pos; - UINT8 m_stop_after; - UINT8 m_cur_dac; - UINT8 m_cur_bits; + uint8_t m_stop_after; + uint8_t m_cur_dac; + uint8_t m_cur_bits; // Zero-range size - UINT32 m_zero_count; // 0 for done + uint32_t m_zero_count; // 0 for done // Waveform and current index in it - UINT8 m_dac_index; // 128 for done - INT16 m_dac[128]; + uint8_t m_dac_index; // 128 for done + int16_t m_dac[128]; }; extern const device_type DIGITALKER; diff --git a/src/devices/sound/disc_cls.h b/src/devices/sound/disc_cls.h index b627106a75d..fbc8f2508f8 100644 --- a/src/devices/sound/disc_cls.h +++ b/src/devices/sound/disc_cls.h @@ -128,7 +128,7 @@ private: DISCRETE_CLASS(dso_csvlog, 0, FILE *m_csv_file; - INT64 m_sample_num; + int64_t m_sample_num; char m_name[32]; ); @@ -152,8 +152,8 @@ public: virtual void reset(void) override; private: ioport_port *m_port; - INT32 m_lastpval; - INT32 m_pmin; + int32_t m_lastpval; + int32_t m_pmin; double m_pscale; double m_min; double m_scale; @@ -167,11 +167,11 @@ class DISCRETE_CLASS_NAME(dss_input_data): public discrete_base_node, public dis DISCRETE_CLASS_CONSTRUCTOR(dss_input_data, base) public: virtual void reset(void) override; - virtual void input_write(int sub_node, UINT8 data ) override; + virtual void input_write(int sub_node, uint8_t data ) override; private: double m_gain; /* node gain */ double m_offset; /* node offset */ - UINT8 m_data; /* data written */ + uint8_t m_data; /* data written */ }; class DISCRETE_CLASS_NAME(dss_input_logic): public discrete_base_node, public discrete_input_interface @@ -180,11 +180,11 @@ class DISCRETE_CLASS_NAME(dss_input_logic): public discrete_base_node, public di DISCRETE_CLASS_DESTRUCTOR(dss_input_logic) public: virtual void reset(void) override; - virtual void input_write(int sub_node, UINT8 data ) override; + virtual void input_write(int sub_node, uint8_t data ) override; private: double m_gain; /* node gain */ double m_offset; /* node offset */ - UINT8 m_data; /* data written */ + uint8_t m_data; /* data written */ }; class DISCRETE_CLASS_NAME(dss_input_not): public discrete_base_node, public discrete_input_interface @@ -193,11 +193,11 @@ class DISCRETE_CLASS_NAME(dss_input_not): public discrete_base_node, public disc DISCRETE_CLASS_DESTRUCTOR(dss_input_not) public: virtual void reset(void) override; - virtual void input_write(int sub_node, UINT8 data ) override; + virtual void input_write(int sub_node, uint8_t data ) override; private: double m_gain; /* node gain */ double m_offset; /* node offset */ - UINT8 m_data; /* data written */ + uint8_t m_data; /* data written */ }; class DISCRETE_CLASS_NAME(dss_input_pulse): public discrete_base_node, public discrete_input_interface, public discrete_step_interface @@ -207,11 +207,11 @@ class DISCRETE_CLASS_NAME(dss_input_pulse): public discrete_base_node, public di public: virtual void step(void) override; virtual void reset(void) override; - virtual void input_write(int sub_node, UINT8 data ) override; + virtual void input_write(int sub_node, uint8_t data ) override; private: //double m_gain; /* node gain */ //double m_offset; /* node offset */ - UINT8 m_data; /* data written */ + uint8_t m_data; /* data written */ }; class DISCRETE_CLASS_NAME(dss_input_stream): public discrete_base_node, public discrete_input_interface, public discrete_step_interface @@ -222,22 +222,22 @@ public: virtual void step(void) override; virtual void reset(void) override; virtual void start(void) override; - virtual void input_write(int sub_node, UINT8 data ) override; + virtual void input_write(int sub_node, uint8_t data ) override; virtual bool is_buffered(void) { return false; } /* This is called by discrete_sound_device */ void stream_start(void); //protected: - UINT32 m_stream_in_number; + uint32_t m_stream_in_number; stream_sample_t *m_ptr; /* current in ptr for stream */ private: void stream_generate(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); double m_gain; /* node gain */ double m_offset; /* node offset */ - UINT8 m_data; /* data written */ - UINT8 m_is_buffered; + uint8_t m_data; /* data written */ + uint8_t m_is_buffered; /* the buffer stream */ sound_stream *m_buffer_stream; }; diff --git a/src/devices/sound/disc_dev.hxx b/src/devices/sound/disc_dev.hxx index da859e471ec..04508b796e1 100644 --- a/src/devices/sound/disc_dev.hxx +++ b/src/devices/sound/disc_dev.hxx @@ -68,8 +68,8 @@ DISCRETE_STEP(dsd_555_astbl) double v_cap = m_cap_voltage; /* Current voltage on capacitor, before dt */ double v_cap_next = 0; /* Voltage on capacitor, after dt */ double v_charge, exponent = 0; - UINT8 flip_flop = m_flip_flop; - UINT8 update_exponent = 0; + uint8_t flip_flop = m_flip_flop; + uint8_t update_exponent = 0; double v_out = 0.0; /* put commonly used stuff in local variables for speed */ @@ -598,8 +598,8 @@ DISCRETE_STEP(dsd_555_cc) double v_vcharge_limit; /* vIn and the junction voltage limit the max charging voltage from i */ double r_temp; /* play thing */ double exponent; - UINT8 update_exponent, update_t_rc; - UINT8 flip_flop = m_flip_flop; + uint8_t update_exponent, update_t_rc; + uint8_t flip_flop = m_flip_flop; double v_out = 0; diff --git a/src/devices/sound/disc_flt.h b/src/devices/sound/disc_flt.h index c60d25d107b..1ec801110a1 100644 --- a/src/devices/sound/disc_flt.h +++ b/src/devices/sound/disc_flt.h @@ -49,8 +49,8 @@ DISCRETE_CLASS_STEP_RESET(dst_crfilter, 1, double m_vCap; double m_rc; double m_exponent; - UINT8 m_has_rc_nodes; - //UINT8 m_is_fast; + uint8_t m_has_rc_nodes; + //uint8_t m_is_fast; ); DISCRETE_CLASS_STEP_RESET(dst_op_amp_filt, 1, @@ -148,8 +148,8 @@ DISCRETE_CLASS_STEP_RESET(dst_rcfilter, 1, double m_vCap; double m_rc; double m_exponent; - UINT8 m_has_rc_nodes; - UINT8 m_is_fast; + uint8_t m_has_rc_nodes; + uint8_t m_is_fast; ); DISCRETE_CLASS_STEP_RESET(dst_rcfilter_sw, 1, diff --git a/src/devices/sound/disc_inp.hxx b/src/devices/sound/disc_inp.hxx index 1116d074546..f8395835e01 100644 --- a/src/devices/sound/disc_inp.hxx +++ b/src/devices/sound/disc_inp.hxx @@ -44,7 +44,7 @@ DISCRETE_STEP(dss_adjustment) { - INT32 rawportval = m_port->read(); + int32_t rawportval = m_port->read(); /* only recompute if the value changed from last time */ if (UNEXPECTED(rawportval != m_lastpval)) @@ -128,9 +128,9 @@ DISCRETE_RESET(dss_input_data) set_output(0, m_data * m_gain + m_offset); } -void DISCRETE_CLASS_FUNC(dss_input_data, input_write)(int sub_node, UINT8 data ) +void DISCRETE_CLASS_FUNC(dss_input_data, input_write)(int sub_node, uint8_t data ) { - UINT8 new_data = 0; + uint8_t new_data = 0; new_data = data; @@ -155,9 +155,9 @@ DISCRETE_RESET(dss_input_logic) set_output(0, m_data * m_gain + m_offset); } -void DISCRETE_CLASS_FUNC(dss_input_logic, input_write)(int sub_node, UINT8 data ) +void DISCRETE_CLASS_FUNC(dss_input_logic, input_write)(int sub_node, uint8_t data ) { - UINT8 new_data = 0; + uint8_t new_data = 0; new_data = data ? 1 : 0; @@ -182,9 +182,9 @@ DISCRETE_RESET(dss_input_not) set_output(0, m_data * m_gain + m_offset); } -void DISCRETE_CLASS_FUNC(dss_input_not, input_write)(int sub_node, UINT8 data ) +void DISCRETE_CLASS_FUNC(dss_input_not, input_write)(int sub_node, uint8_t data ) { - UINT8 new_data = 0; + uint8_t new_data = 0; new_data = data ? 0 : 1; @@ -215,9 +215,9 @@ DISCRETE_RESET(dss_input_pulse) set_output(0, m_data); } -void DISCRETE_CLASS_FUNC(dss_input_pulse, input_write)(int sub_node, UINT8 data ) +void DISCRETE_CLASS_FUNC(dss_input_pulse, input_write)(int sub_node, uint8_t data ) { - UINT8 new_data = 0; + uint8_t new_data = 0; new_data = data ? 1 : 0; @@ -268,9 +268,9 @@ DISCRETE_RESET(dss_input_stream) m_data = 0; } -void DISCRETE_CLASS_FUNC(dss_input_stream, input_write)(int sub_node, UINT8 data ) +void DISCRETE_CLASS_FUNC(dss_input_stream, input_write)(int sub_node, uint8_t data ) { - UINT8 new_data = 0; + uint8_t new_data = 0; new_data = data; diff --git a/src/devices/sound/disc_mth.h b/src/devices/sound/disc_mth.h index bbe71e30f52..99c387b245a 100644 --- a/src/devices/sound/disc_mth.h +++ b/src/devices/sound/disc_mth.h @@ -64,12 +64,12 @@ DISCRETE_CLASS_STEP_RESET(dst_logic_jkff, 1, DISCRETE_CLASS_STEP_RESET(dst_logic_shift, 1, double m_t_left; /* time unused during last sample in seconds */ - UINT32 m_shift_data; - UINT32 m_bit_mask; - UINT8 m_clock_type; - UINT8 m_reset_on_high; - UINT8 m_shift_r; - UINT8 m_last; + uint32_t m_shift_data; + uint32_t m_bit_mask; + uint8_t m_clock_type; + uint8_t m_reset_on_high; + uint8_t m_shift_r; + uint8_t m_last; ); DISCRETE_CLASS_STEP(dst_lookup_table, 1, /* no context */ ); @@ -186,9 +186,9 @@ DISCRETE_CLASS_STEP_RESET(dst_mixer, 1, ); DISCRETE_CLASS_STEP_RESET(dst_op_amp, 1, - UINT8 m_has_cap; - UINT8 m_has_r1; - UINT8 m_has_r4; + uint8_t m_has_cap; + uint8_t m_has_r1; + uint8_t m_has_r4; double m_v_max; double m_i_fixed; double m_v_cap; @@ -223,8 +223,8 @@ DISCRETE_CLASS_STEP_RESET(dst_tvca_op_amp, 1, double m_v_cap3; /* charge on cap c3 */ double m_v_cap4; /* charge on cap c4 */ double m_r67; /* = r6 + r7 (for easy use later) */ - UINT8 m_has_c4; - UINT8 m_has_r4; + uint8_t m_has_c4; + uint8_t m_has_r4; ); DISCRETE_CLASS_STEP(dst_xtime_buffer, 1, /* no context */ ); diff --git a/src/devices/sound/disc_sys.hxx b/src/devices/sound/disc_sys.hxx index a166f71ce49..5c1a79f0ec9 100644 --- a/src/devices/sound/disc_sys.hxx +++ b/src/devices/sound/disc_sys.hxx @@ -94,13 +94,13 @@ DISCRETE_STOP( dso_wavlog ) DISCRETE_STEP( dso_wavlog ) { double val; - INT16 wave_data_l, wave_data_r; + int16_t wave_data_l, wave_data_r; /* Dump any wave logs */ /* get nodes to be logged and apply gain, then clip to 16 bit */ val = DISCRETE_INPUT(0) * DISCRETE_INPUT(1); val = (val < -32768) ? -32768 : (val > 32767) ? 32767 : val; - wave_data_l = (INT16)val; + wave_data_l = (int16_t)val; if (this->active_inputs() == 2) { /* DISCRETE_WAVLOG1 */ @@ -111,7 +111,7 @@ DISCRETE_STEP( dso_wavlog ) /* DISCRETE_WAVLOG2 */ val = DISCRETE_INPUT(2) * DISCRETE_INPUT(3); val = (val < -32768) ? -32768 : (val > 32767) ? 32767 : val; - wave_data_r = (INT16)val; + wave_data_r = (int16_t)val; wav_add_data_16lr(m_wavfile, &wave_data_l, &wave_data_r, 1); } diff --git a/src/devices/sound/disc_wav.h b/src/devices/sound/disc_wav.h index dc1dc11773b..37f00626dfa 100644 --- a/src/devices/sound/disc_wav.h +++ b/src/devices/sound/disc_wav.h @@ -28,11 +28,11 @@ DISCRETE_CLASS_STEP_RESET(dss_counter, 1, int m_out_type; int m_is_7492; int m_last_clock; - UINT32 m_last_count; - //UINT32 m_last; /* Last clock state */ - UINT32 m_min; - UINT32 m_max; - UINT32 m_diff; + uint32_t m_last_count; + //uint32_t m_last; /* Last clock state */ + uint32_t m_min; + uint32_t m_max; + uint32_t m_diff; double m_t_left; /* time unused during last sample in seconds */ ); @@ -43,10 +43,10 @@ DISCRETE_CLASS_STEP_RESET(dss_lfsr_noise, 2, double m_t_left; /* time unused during last sample in seconds */ //double m_sample_step; //double m_t; - UINT8 m_reset_on_high; - UINT8 m_invert_output; - UINT8 m_out_is_f0; - UINT8 m_out_lfsr_reg; + uint8_t m_reset_on_high; + uint8_t m_invert_output; + uint8_t m_out_is_f0; + uint8_t m_out_lfsr_reg; ); DISCRETE_CLASS_STEP_RESET(dss_noise, 2, @@ -153,10 +153,10 @@ private: DISCRETE_CLASS_STEP_RESET(dss_op_amp_osc, 1, const double * m_r[8]; /* pointers to resistor values */ int m_type; - UINT8 m_flip_flop; /* flip/flop output state */ - UINT8 m_flip_flop_xor; /* flip_flop ^ flip_flop_xor, 0 = discharge, 1 = charge */ - UINT8 m_output_type; - UINT8 m_has_enable; + uint8_t m_flip_flop; /* flip/flop output state */ + uint8_t m_flip_flop_xor; /* flip_flop ^ flip_flop_xor, 0 = discharge, 1 = charge */ + uint8_t m_output_type; + uint8_t m_has_enable; double m_v_out_high; double m_threshold_low; /* falling threshold */ double m_threshold_high; /* rising threshold */ @@ -181,7 +181,7 @@ DISCRETE_CLASS_STEP_RESET(dss_schmitt_osc, 1, double m_exponent; int m_state; /* state of the output */ int m_enable_type; - UINT8 m_input_is_voltage; + uint8_t m_input_is_voltage; ); /* Not yet implemented */ diff --git a/src/devices/sound/disc_wav.hxx b/src/devices/sound/disc_wav.hxx index a694f407d90..d767e6c6bd8 100644 --- a/src/devices/sound/disc_wav.hxx +++ b/src/devices/sound/disc_wav.hxx @@ -61,9 +61,9 @@ DISCRETE_STEP(dss_counter) double cycles; double ds_clock; int clock = 0, inc = 0; - UINT32 last_count = m_last_count; /* it is different then output in 7492 */ + uint32_t last_count = m_last_count; /* it is different then output in 7492 */ double x_time = 0; - UINT32 count = last_count; + uint32_t count = last_count; ds_clock = DSS_COUNTER__CLOCK; if (UNEXPECTED(m_clock_type == DISC_CLK_IS_FREQ)) @@ -647,10 +647,10 @@ DISCRETE_STEP(dss_op_amp_osc) double charge[2] = {0}; double x_time = 0; /* time since change happened */ double exponent; - UINT8 force_charge = 0; - UINT8 enable = DSS_OP_AMP_OSC__ENABLE; - UINT8 update_exponent = 0; - UINT8 flip_flop = m_flip_flop; + uint8_t force_charge = 0; + uint8_t enable = DSS_OP_AMP_OSC__ENABLE; + uint8_t update_exponent = 0; + uint8_t flip_flop = m_flip_flop; int count_f = 0; int count_r = 0; diff --git a/src/devices/sound/discrete.cpp b/src/devices/sound/discrete.cpp index 9bf5d4d470f..3a52c8b0eb0 100644 --- a/src/devices/sound/discrete.cpp +++ b/src/devices/sound/discrete.cpp @@ -110,7 +110,7 @@ public: virtual ~discrete_task(void) { } inline void step_nodes(void); - inline bool lock_threadid(INT32 threadid) + inline bool lock_threadid(int32_t threadid) { int expected = -1; return m_threadid.compare_exchange_weak(expected, threadid, std::memory_order_release,std::memory_order_relaxed); @@ -145,7 +145,7 @@ protected: discrete_device & m_device; private: - std::atomic m_threadid; + std::atomic m_threadid; volatile int m_samples; }; @@ -613,9 +613,9 @@ void discrete_device::discrete_sanity_check(const sound_block_list_t &block_list * *************************************/ -static UINT64 list_run_time(const node_list_t &list) +static uint64_t list_run_time(const node_list_t &list) { - UINT64 total = 0; + uint64_t total = 0; for_each(discrete_base_node **, node, &list) { @@ -626,9 +626,9 @@ static UINT64 list_run_time(const node_list_t &list) return total; } -static UINT64 step_list_run_time(const node_step_list_t &list) +static uint64_t step_list_run_time(const node_step_list_t &list) { - UINT64 total = 0; + uint64_t total = 0; for_each(discrete_step_interface **, node, &list) { @@ -640,8 +640,8 @@ static UINT64 step_list_run_time(const node_step_list_t &list) void discrete_device::display_profiling(void) { int count; - UINT64 total; - UINT64 tresh; + uint64_t total; + uint64_t tresh; double tt; /* calculate total time */ @@ -835,7 +835,7 @@ void discrete_device::static_set_intf(device_t &device, const discrete_block *in // discrete_device - constructor //------------------------------------------------- -discrete_device::discrete_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) +discrete_device::discrete_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, name, tag, owner, clock, "discrete", __FILE__), m_intf(nullptr), m_sample_rate(0), @@ -850,7 +850,7 @@ discrete_device::discrete_device(const machine_config &mconfig, device_type type { } -discrete_sound_device::discrete_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +discrete_sound_device::discrete_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : discrete_device(mconfig, DISCRETE, "DISCRETE", tag, owner, clock), device_sound_interface(mconfig, *this), m_stream(nullptr) @@ -1102,7 +1102,7 @@ READ8_MEMBER( discrete_device::read ) { const discrete_base_node *node = discrete_find_node(offset); - UINT8 data; + uint8_t data; /* Read the node input value if allowed */ if (node) @@ -1110,7 +1110,7 @@ READ8_MEMBER( discrete_device::read ) /* Bring the system up to now */ update_to_current_time(); - data = (UINT8) node->m_output[NODE_CHILD_NODE_NUM(offset)]; + data = (uint8_t) node->m_output[NODE_CHILD_NODE_NUM(offset)]; } else fatalerror("discrete_sound_r read from non-existent NODE_%02d\n", offset-NODE_00); diff --git a/src/devices/sound/discrete.h b/src/devices/sound/discrete.h index 1ebb8f12e9a..476e89b776e 100644 --- a/src/devices/sound/discrete.h +++ b/src/devices/sound/discrete.h @@ -3856,7 +3856,7 @@ struct discrete_lfsr_desc struct discrete_op_amp_osc_info { - UINT32 type; + uint32_t type; double r1; double r2; double r3; @@ -3908,7 +3908,7 @@ struct discrete_dac_r1_ladder struct discrete_integrate_info { - UINT32 type; + uint32_t type; double r1; // r1a + r1b double r2; // r2a + r2b double r3; // r3a + r3b @@ -3939,7 +3939,7 @@ struct discrete_mixer_desc struct discrete_op_amp_info { - UINT32 type; + uint32_t type; double r1; double r2; double r3; @@ -3952,7 +3952,7 @@ struct discrete_op_amp_info struct discrete_op_amp_1sht_info { - UINT32 type; + uint32_t type; double r1; double r2; double r3; @@ -4240,7 +4240,7 @@ class discrete_input_interface public: virtual ~discrete_input_interface() { } - virtual void input_write(int sub_node, UINT8 data ) = 0; + virtual void input_write(int sub_node, uint8_t data ) = 0; }; class discrete_sound_output_interface @@ -4282,7 +4282,7 @@ class discrete_device : public device_t protected: // construction/destruction - discrete_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); + discrete_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock); public: // inline configuration helpers @@ -4360,8 +4360,8 @@ private: /* profiling */ int m_profiling; - UINT64 m_total_samples; - UINT64 m_total_stream_updates; + uint64_t m_total_samples; + uint64_t m_total_stream_updates; }; // ======================> discrete_sound_device @@ -4371,7 +4371,7 @@ class discrete_sound_device : public discrete_device, { public: // construction/destruction - discrete_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + discrete_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~discrete_sound_device(void) { }; /* --------------------------------- */ diff --git a/src/devices/sound/dmadac.cpp b/src/devices/sound/dmadac.cpp index 24e89835d06..4ee9523ef7b 100644 --- a/src/devices/sound/dmadac.cpp +++ b/src/devices/sound/dmadac.cpp @@ -47,7 +47,7 @@ void dmadac_sound_device::device_start() { /* allocate a clear a buffer */ - m_buffer = make_unique_clear(BUFFER_SIZE); + m_buffer = make_unique_clear(BUFFER_SIZE); /* reset the state */ m_volume = 0x100; @@ -72,7 +72,7 @@ void dmadac_sound_device::device_start() * *************************************/ -void dmadac_transfer(dmadac_sound_device **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data) +void dmadac_transfer(dmadac_sound_device **devlist, uint8_t num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, int16_t *data) { int i; @@ -94,7 +94,7 @@ void dmadac_sound_device::flush() m_channel->update(); } -void dmadac_sound_device::transfer(int channel, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data) +void dmadac_sound_device::transfer(int channel, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, int16_t *data) { int j; @@ -102,7 +102,7 @@ void dmadac_sound_device::transfer(int channel, offs_t channel_spacing, offs_t f if (m_enabled) { int maxin = (m_bufout + BUFFER_SIZE - 1) % BUFFER_SIZE; - INT16 *src = data + channel * channel_spacing; + int16_t *src = data + channel * channel_spacing; int curin = m_bufin; /* copy the data */ @@ -130,7 +130,7 @@ void dmadac_sound_device::transfer(int channel, offs_t channel_spacing, offs_t f * *************************************/ -void dmadac_enable(dmadac_sound_device **devlist, UINT8 num_channels, UINT8 enable) +void dmadac_enable(dmadac_sound_device **devlist, uint8_t num_channels, uint8_t enable) { int i; @@ -142,7 +142,7 @@ void dmadac_enable(dmadac_sound_device **devlist, UINT8 num_channels, UINT8 enab } -void dmadac_sound_device::enable(UINT8 enable) +void dmadac_sound_device::enable(uint8_t enable) { m_channel->update(); m_enabled = enable; @@ -156,7 +156,7 @@ void dmadac_sound_device::enable(UINT8 enable) * *************************************/ -void dmadac_set_frequency(dmadac_sound_device **devlist, UINT8 num_channels, double frequency) +void dmadac_set_frequency(dmadac_sound_device **devlist, uint8_t num_channels, double frequency) { int i; @@ -179,7 +179,7 @@ void dmadac_sound_device::set_frequency(double frequency) * *************************************/ -void dmadac_set_volume(dmadac_sound_device **devlist, UINT8 num_channels, UINT16 volume) +void dmadac_set_volume(dmadac_sound_device **devlist, uint8_t num_channels, uint16_t volume) { int i; @@ -190,7 +190,7 @@ void dmadac_set_volume(dmadac_sound_device **devlist, UINT8 num_channels, UINT16 } } -void dmadac_sound_device::set_volume(UINT16 volume) +void dmadac_sound_device::set_volume(uint16_t volume) { m_channel->update(); m_volume = volume; @@ -198,7 +198,7 @@ void dmadac_sound_device::set_volume(UINT16 volume) const device_type DMADAC = &device_creator; -dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMADAC, "DMA-driven DAC", tag, owner, clock, "dmadac", __FILE__), device_sound_interface(mconfig, *this), m_buffer(nullptr), @@ -217,9 +217,9 @@ dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const ch void dmadac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { stream_sample_t *output = outputs[0]; - INT16 *source = m_buffer.get(); - UINT32 curout = m_bufout; - UINT32 curin = m_bufin; + int16_t *source = m_buffer.get(); + uint32_t curout = m_bufout; + uint32_t curin = m_bufin; int volume = m_volume; /* feed as much as we can */ diff --git a/src/devices/sound/dmadac.h b/src/devices/sound/dmadac.h index 6e0c4f47dd6..5350eadf872 100644 --- a/src/devices/sound/dmadac.h +++ b/src/devices/sound/dmadac.h @@ -17,13 +17,13 @@ class dmadac_sound_device : public device_t, public device_sound_interface { public: - dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void flush(); - void transfer(int channel, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data); - void enable(UINT8 enable); + void transfer(int channel, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, int16_t *data); + void enable(uint8_t enable); void set_frequency(double frequency); - void set_volume(UINT16 volume); + void set_volume(uint16_t volume); protected: // device-level overrides @@ -35,22 +35,22 @@ private: // internal state /* sound stream and buffers */ sound_stream * m_channel; - std::unique_ptr m_buffer; - UINT32 m_bufin; - UINT32 m_bufout; + std::unique_ptr m_buffer; + uint32_t m_bufin; + uint32_t m_bufout; /* per-channel parameters */ - INT16 m_volume; - UINT8 m_enabled; + int16_t m_volume; + uint8_t m_enabled; double m_frequency; }; extern const device_type DMADAC; -void dmadac_transfer(dmadac_sound_device **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data); -void dmadac_enable(dmadac_sound_device **devlist, UINT8 num_channels, UINT8 enable); -void dmadac_set_frequency(dmadac_sound_device **devlist, UINT8 num_channels, double frequency); -void dmadac_set_volume(dmadac_sound_device **devlist, UINT8 num_channels, UINT16 volume); +void dmadac_transfer(dmadac_sound_device **devlist, uint8_t num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, int16_t *data); +void dmadac_enable(dmadac_sound_device **devlist, uint8_t num_channels, uint8_t enable); +void dmadac_set_frequency(dmadac_sound_device **devlist, uint8_t num_channels, double frequency); +void dmadac_set_volume(dmadac_sound_device **devlist, uint8_t num_channels, uint16_t volume); #endif /* __DMADAC_H__ */ diff --git a/src/devices/sound/es1373.cpp b/src/devices/sound/es1373.cpp index efe1abb405d..be6f46bbbd6 100644 --- a/src/devices/sound/es1373.cpp +++ b/src/devices/sound/es1373.cpp @@ -22,7 +22,7 @@ DEVICE_ADDRESS_MAP_START(map, 32, es1373_device) AM_RANGE(0x00, 0x3f) AM_READWRITE (reg_r, reg_w) ADDRESS_MAP_END -es1373_device::es1373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +es1373_device::es1373_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, ES1373, "Creative Labs Ensoniq AudioPCI97 ES1373", tag, owner, clock, "es1373", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), m_eslog(nullptr), m_tempCount(0), m_timer(nullptr), m_memory_space(nullptr), m_cpu_tag(nullptr), m_cpu(nullptr), @@ -104,8 +104,8 @@ void es1373_device::device_reset() m_stream->update(); } -void es1373_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 es1373_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; } @@ -184,7 +184,7 @@ void es1373_device::sound_stream_update(sound_stream &stream, stream_sample_t ** //------------------------------------------------- // send_audio_out - Sends channel audio output data //------------------------------------------------- -void es1373_device::send_audio_out(chan_info& chan, UINT32 intr_mask, stream_sample_t *outL, stream_sample_t *outR, int samples) +void es1373_device::send_audio_out(chan_info& chan, uint32_t intr_mask, stream_sample_t *outL, stream_sample_t *outR, int samples) { // Only transfer PCI data if bus mastering is enabled // Fill initial half buffer @@ -192,7 +192,7 @@ void es1373_device::send_audio_out(chan_info& chan, UINT32 intr_mask, stream_sam chan.initialized = true; transfer_pci_audio(chan, ES_PCI_READ); } - //UINT32 sample_size = calc_size(chan.format); + //uint32_t sample_size = calc_size(chan.format); // Send data to sound stream bool buf_row_done; for (int i=0; i>16); + outL[i] = outR[i] = (int16_t)(m_sound_cache[chan.buf_rptr]>>16); chan.buf_rptr++; buf_row_done = true; } else { // Read low 16 bits - outL[i] = outR[i] = (INT16)(m_sound_cache[chan.buf_rptr]&0xffff); + outL[i] = outR[i] = (int16_t)(m_sound_cache[chan.buf_rptr]&0xffff); } break; case SCTRL_16BIT_STEREO: // The sound cache is 32 bit wide fifo, so each entry is one stereo 16 bit sample - outL[i] = (INT16) m_sound_cache[chan.buf_rptr]&0xffff; - outR[i] = (INT16) m_sound_cache[chan.buf_rptr]>>16; + outL[i] = (int16_t) m_sound_cache[chan.buf_rptr]&0xffff; + outR[i] = (int16_t) m_sound_cache[chan.buf_rptr]>>16; chan.buf_rptr++; buf_row_done = true; break; @@ -269,7 +269,7 @@ void es1373_device::send_audio_out(chan_info& chan, UINT32 intr_mask, stream_sam void es1373_device::transfer_pci_audio(chan_info& chan, int type) { - UINT32 pci_addr, data; + uint32_t pci_addr, data; pci_addr = chan.pci_addr + (chan.pci_count<<2); if (LOG_ES) logerror("%s: transfer_pci_audio start chan: %X pci_addr: %08X pci_count: %X pci_size: %X buf_rptr: %X buf_wptr: %X\n", @@ -298,7 +298,7 @@ void es1373_device::transfer_pci_audio(chan_info& chan, int type) } } -UINT32 es1373_device::calc_size(const UINT8 &format) +uint32_t es1373_device::calc_size(const uint8_t &format) { switch (format) { case SCTRL_8BIT_MONO: @@ -320,7 +320,7 @@ UINT32 es1373_device::calc_size(const UINT8 &format) READ32_MEMBER (es1373_device::reg_r) { - UINT32 result = m_es_regs[offset]; + uint32_t result = m_es_regs[offset]; switch (offset) { case ES_CODEC: break; diff --git a/src/devices/sound/es1373.h b/src/devices/sound/es1373.h index 4b77bdc2898..f1f0ca8e8d8 100644 --- a/src/devices/sound/es1373.h +++ b/src/devices/sound/es1373.h @@ -82,22 +82,22 @@ struct chan_info { bool int_en; bool loop_en; bool initialized; - UINT8 format; // Format of channel - UINT32 buf_wptr; // Address to sample cache memory - UINT32 buf_rptr; // Address to sample cache memory - UINT16 buf_count; // Number of samples that have been played - UINT16 buf_size; // Number of samples minus one to play - UINT32 pci_addr; // PCI Addresss for system memory accesses - UINT16 pci_count; // Number of 32 bits transfered - UINT16 pci_size; // Total number of words (32 bits) minus one in system memory + uint8_t format; // Format of channel + uint32_t buf_wptr; // Address to sample cache memory + uint32_t buf_rptr; // Address to sample cache memory + uint16_t buf_count; // Number of samples that have been played + uint16_t buf_size; // Number of samples minus one to play + uint32_t pci_addr; // PCI Addresss for system memory accesses + uint16_t pci_count; // Number of 32 bits transfered + uint16_t pci_size; // Total number of words (32 bits) minus one in system memory }; class es1373_device : public pci_device, public device_sound_interface { public: - es1373_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - 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; + es1373_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + 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; void set_irq_info(const char *tag, const int irq_num); @@ -120,23 +120,23 @@ protected: FILE *m_eslog; private: - UINT32 m_tempCount; + uint32_t m_tempCount; emu_timer *m_timer; address_space *m_memory_space; const char *m_cpu_tag; cpu_device *m_cpu; int m_irq_num; DECLARE_ADDRESS_MAP(map, 32); - UINT16 m_ac97_regs[0x80]; - UINT32 m_es_regs[0x10]; - UINT32 m_sound_cache[0x40]; - UINT16 m_src_ram[0x80]; + uint16_t m_ac97_regs[0x80]; + uint32_t m_es_regs[0x10]; + uint32_t m_sound_cache[0x40]; + uint16_t m_src_ram[0x80]; chan_info m_dac1; chan_info m_dac2; chan_info m_adc; void transfer_pci_audio(chan_info& chan, int type); - UINT32 calc_size(const UINT8 &format); - void send_audio_out(chan_info& chan, UINT32 intr_mask, stream_sample_t *outL, stream_sample_t *outR, int samples); + uint32_t calc_size(const uint8_t &format); + void send_audio_out(chan_info& chan, uint32_t intr_mask, stream_sample_t *outL, stream_sample_t *outR, int samples); }; diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp index 777a98e9834..591e72827ca 100644 --- a/src/devices/sound/es5503.cpp +++ b/src/devices/sound/es5503.cpp @@ -39,9 +39,9 @@ const device_type ES5503 = &device_creator; // useful constants -static const UINT16 wavesizes[8] = { 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 }; -static const UINT32 wavemasks[8] = { 0x1ff00, 0x1fe00, 0x1fc00, 0x1f800, 0x1f000, 0x1e000, 0x1c000, 0x18000 }; -static const UINT32 accmasks[8] = { 0xff, 0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff }; +static const uint16_t wavesizes[8] = { 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 }; +static const uint32_t wavemasks[8] = { 0x1ff00, 0x1fe00, 0x1fc00, 0x1f800, 0x1f000, 0x1e000, 0x1c000, 0x18000 }; +static const uint32_t accmasks[8] = { 0xff, 0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff }; static const int resshifts[8] = { 9, 10, 11, 12, 13, 14, 15, 16 }; //************************************************************************** @@ -52,7 +52,7 @@ static const int resshifts[8] = { 9, 10, 11, 12, 13, 14, 15, 16 }; // es5503_device - constructor //------------------------------------------------- -es5503_device::es5503_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +es5503_device::es5503_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ES5503, "Ensoniq ES5503", tag, owner, clock, "es5503", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 17), @@ -95,7 +95,7 @@ void es5503_device::rom_bank_updated() // chip = chip ptr // onum = oscillator # // type = 1 for 0 found in sample data, 0 for hit end of table size -void es5503_device::halt_osc(int onum, int type, UINT32 *accumulator, int resshift) +void es5503_device::halt_osc(int onum, int type, uint32_t *accumulator, int resshift) { ES5503Osc *pOsc = &oscillators[onum]; ES5503Osc *pPartner = &oscillators[onum^1]; @@ -108,8 +108,8 @@ void es5503_device::halt_osc(int onum, int type, UINT32 *accumulator, int resshi } else // preserve the relative phase of the oscillator when looping { - UINT16 wtsize = pOsc->wtsize - 1; - UINT32 altram = (*accumulator) >> resshift; + uint16_t wtsize = pOsc->wtsize - 1; + uint32_t altram = (*accumulator) >> resshift; if (altram > wtsize) { @@ -142,10 +142,10 @@ void es5503_device::halt_osc(int onum, int type, UINT32 *accumulator, int resshi void es5503_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - static INT32 mix[(44100/60)*2*8]; - INT32 *mixp; + static int32_t mix[(44100/60)*2*8]; + int32_t *mixp; int osc, snum, i; - UINT32 ramptr; + uint32_t ramptr; assert(samples < (44100/60)*2); memset(mix, 0, sizeof(mix)); @@ -158,15 +158,15 @@ void es5503_device::sound_stream_update(sound_stream &stream, stream_sample_t ** if (!(pOsc->control & 1) && ((pOsc->control >> 4) & (output_channels - 1)) == chan) { - UINT32 wtptr = pOsc->wavetblpointer & wavemasks[pOsc->wavetblsize], altram; - UINT32 acc = pOsc->accumulator; - UINT16 wtsize = pOsc->wtsize - 1; - UINT8 ctrl = pOsc->control; - UINT16 freq = pOsc->freq; - INT16 vol = pOsc->vol; - INT8 data = -128; + uint32_t wtptr = pOsc->wavetblpointer & wavemasks[pOsc->wavetblsize], altram; + uint32_t acc = pOsc->accumulator; + uint16_t wtsize = pOsc->wtsize - 1; + uint8_t ctrl = pOsc->control; + uint16_t freq = pOsc->freq; + int16_t vol = pOsc->vol; + int8_t data = -128; int resshift = resshifts[pOsc->resolution] - pOsc->wavetblsize; - UINT32 sizemask = accmasks[pOsc->wavetblsize]; + uint32_t sizemask = accmasks[pOsc->wavetblsize]; mixp = &mix[0] + chan; for (snum = 0; snum < samples; snum++) @@ -178,7 +178,7 @@ void es5503_device::sound_stream_update(sound_stream &stream, stream_sample_t ** // channel strobe is always valid when reading; this allows potentially banking per voice m_channel_strobe = (ctrl>>4) & 0xf; - data = (INT32)read_byte(ramptr + wtptr) ^ 0x80; + data = (int32_t)read_byte(ramptr + wtptr) ^ 0x80; if (read_byte(ramptr + wtptr) == 0x00) { @@ -274,7 +274,7 @@ void es5503_device::device_reset() READ8_MEMBER( es5503_device::read ) { - UINT8 retval; + uint8_t retval; int i; m_stream->update(); diff --git a/src/devices/sound/es5503.h b/src/devices/sound/es5503.h index 4982201463c..2c226471b3a 100644 --- a/src/devices/sound/es5503.h +++ b/src/devices/sound/es5503.h @@ -27,7 +27,7 @@ class es5503_device : public device_t, { public: // construction/destruction - es5503_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + es5503_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_channels(device_t &device, int channels); @@ -37,7 +37,7 @@ public: DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); - UINT8 get_channel_strobe() { return m_channel_strobe; } + uint8_t get_channel_strobe() { return m_channel_strobe; } sound_stream *m_stream; @@ -69,32 +69,32 @@ private: struct ES5503Osc { - UINT16 freq; - UINT16 wtsize; - UINT8 control; - UINT8 vol; - UINT8 data; - UINT32 wavetblpointer; - UINT8 wavetblsize; - UINT8 resolution; - - UINT32 accumulator; - UINT8 irqpend; + uint16_t freq; + uint16_t wtsize; + uint8_t control; + uint8_t vol; + uint8_t data; + uint32_t wavetblpointer; + uint8_t wavetblsize; + uint8_t resolution; + + uint32_t accumulator; + uint8_t irqpend; }; ES5503Osc oscillators[32]; - INT8 oscsenabled; // # of oscillators enabled + int8_t oscsenabled; // # of oscillators enabled int rege0; // contents of register 0xe0 - UINT8 m_channel_strobe; + uint8_t m_channel_strobe; int output_channels; - UINT32 output_rate; + uint32_t output_rate; emu_timer *m_timer; - void halt_osc(int onum, int type, UINT32 *accumulator, int resshift); + void halt_osc(int onum, int type, uint32_t *accumulator, int resshift); }; diff --git a/src/devices/sound/es5506.cpp b/src/devices/sound/es5506.cpp index 939a2f79a0c..5611857e83b 100644 --- a/src/devices/sound/es5506.cpp +++ b/src/devices/sound/es5506.cpp @@ -127,7 +127,7 @@ Ensoniq OTIS - ES5505 Ensoniq OTTO - #define CONTROL_STOPMASK (CONTROL_STOP1 | CONTROL_STOP0) -es550x_device::es550x_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) +es550x_device::es550x_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_sound_interface(mconfig, *this), m_stream(nullptr), @@ -165,7 +165,7 @@ es550x_device::es550x_device(const machine_config &mconfig, device_type type, co const device_type ES5506 = &device_creator; -es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : es550x_device(mconfig, ES5506, "ES5506", tag, owner, clock, "es5506", __FILE__) { } @@ -180,7 +180,7 @@ void es550x_device::device_start() void es5506_device::device_start() { int j; - UINT32 accum_mask; + uint32_t accum_mask; int channels = 1; /* 1 channel by default, for backward compatibility */ /* only override the number of channels if the value is in the valid range 1 .. 6 */ @@ -201,7 +201,7 @@ void es5506_device::device_start() memory_region *region0 = machine().root_device().memregion(m_region0); if (region0 != nullptr) { - m_region_base[0] = (UINT16 *)region0->base(); + m_region_base[0] = (uint16_t *)region0->base(); } } if (m_region1) @@ -209,7 +209,7 @@ void es5506_device::device_start() memory_region *region1 = machine().root_device().memregion(m_region1); if (region1 != nullptr) { - m_region_base[1] = (UINT16 *)region1->base(); + m_region_base[1] = (uint16_t *)region1->base(); } } if (m_region2) @@ -217,7 +217,7 @@ void es5506_device::device_start() memory_region *region2 = machine().root_device().memregion(m_region2); if (region2 != nullptr) { - m_region_base[2] = (UINT16 *)region2->base(); + m_region_base[2] = (uint16_t *)region2->base(); } } if (m_region3) @@ -225,7 +225,7 @@ void es5506_device::device_start() memory_region *region3 = machine().root_device().memregion(m_region3); if (region3 != nullptr) { - m_region_base[3] = (UINT16 *)region3->base(); + m_region_base[3] = (uint16_t *)region3->base(); } } @@ -257,7 +257,7 @@ void es5506_device::device_start() } /* allocate memory */ - m_scratch = make_unique_clear(2 * MAX_SAMPLE_CHUNK); + m_scratch = make_unique_clear(2 * MAX_SAMPLE_CHUNK); /* register save */ save_item(NAME(m_sample_rate)); @@ -339,7 +339,7 @@ void es550x_device::device_stop() const device_type ES5505 = &device_creator; -es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : es550x_device(mconfig, ES5505, "ES5505", tag, owner, clock, "es5505", __FILE__) { } @@ -351,7 +351,7 @@ es5505_device::es5505_device(const machine_config &mconfig, const char *tag, dev void es5505_device::device_start() { int j; - UINT32 accum_mask; + uint32_t accum_mask; int channels = 1; /* 1 channel by default, for backward compatibility */ /* only override the number of channels if the value is in the valid range 1 .. 4 */ @@ -369,12 +369,12 @@ void es5505_device::device_start() if (m_region0) { memory_region* region = machine().root_device().memregion(m_region0); - m_region_base[0] = region ? reinterpret_cast(region->base()) : nullptr; + m_region_base[0] = region ? reinterpret_cast(region->base()) : nullptr; } if (m_region1) { memory_region* region = machine().root_device().memregion(m_region1); - m_region_base[1] = region ? reinterpret_cast(region->base()) : nullptr; + m_region_base[1] = region ? reinterpret_cast(region->base()) : nullptr; } /* initialize the rest of the structure */ @@ -400,7 +400,7 @@ void es5505_device::device_start() } /* allocate memory */ - m_scratch = make_unique_clear(2 * MAX_SAMPLE_CHUNK); + m_scratch = make_unique_clear(2 * MAX_SAMPLE_CHUNK); /* register save */ save_item(NAME(m_sample_rate)); @@ -489,32 +489,32 @@ void es550x_device::compute_tables() int i; /* allocate ulaw lookup table */ - m_ulaw_lookup = make_unique_clear(1 << ULAW_MAXBITS); + m_ulaw_lookup = make_unique_clear(1 << ULAW_MAXBITS); /* generate ulaw lookup table */ for (i = 0; i < (1 << ULAW_MAXBITS); i++) { - UINT16 rawval = (i << (16 - ULAW_MAXBITS)) | (1 << (15 - ULAW_MAXBITS)); - UINT8 exponent = rawval >> 13; - UINT32 mantissa = (rawval << 3) & 0xffff; + uint16_t rawval = (i << (16 - ULAW_MAXBITS)) | (1 << (15 - ULAW_MAXBITS)); + uint8_t exponent = rawval >> 13; + uint32_t mantissa = (rawval << 3) & 0xffff; if (exponent == 0) - m_ulaw_lookup[i] = (INT16)mantissa >> 7; + m_ulaw_lookup[i] = (int16_t)mantissa >> 7; else { mantissa = (mantissa >> 1) | (~mantissa & 0x8000); - m_ulaw_lookup[i] = (INT16)mantissa >> (7 - exponent); + m_ulaw_lookup[i] = (int16_t)mantissa >> (7 - exponent); } } /* allocate volume lookup table */ - m_volume_lookup = make_unique_clear(4096); + m_volume_lookup = make_unique_clear(4096); /* generate volume lookup table */ for (i = 0; i < 4096; i++) { - UINT8 exponent = i >> 8; - UINT32 mantissa = (i & 0xff) | 0x100; + uint8_t exponent = i >> 8; + uint32_t mantissa = (i & 0xff) | 0x100; m_volume_lookup[i] = (mantissa << 11) >> (20 - exponent); } @@ -529,8 +529,8 @@ void es550x_device::compute_tables() ***********************************************************************************************/ #define interpolate(sample1, sample2, accum) \ - (sample1 * (INT32)(0x800 - (accum & 0x7ff)) + \ - sample2 * (INT32)(accum & 0x7ff)) >> 11; + (sample1 * (int32_t)(0x800 - (accum & 0x7ff)) + \ + sample2 * (int32_t)(accum & 0x7ff)) >> 11; @@ -544,11 +544,11 @@ void es550x_device::compute_tables() do \ { \ /* pole 1 is always low-pass using K1 */ \ - sample = ((INT32)(voice->k1 >> 2) * (sample - voice->o1n1) / 16384) + voice->o1n1; \ + sample = ((int32_t)(voice->k1 >> 2) * (sample - voice->o1n1) / 16384) + voice->o1n1; \ voice->o1n1 = sample; \ \ /* pole 2 is always low-pass using K1 */ \ - sample = ((INT32)(voice->k1 >> 2) * (sample - voice->o2n1) / 16384) + voice->o2n1; \ + sample = ((int32_t)(voice->k1 >> 2) * (sample - voice->o2n1) / 16384) + voice->o2n1; \ voice->o2n2 = voice->o2n1; \ voice->o2n1 = sample; \ \ @@ -557,45 +557,45 @@ do { \ case 0: \ /* pole 3 is high-pass using K2 */ \ - sample = sample - voice->o2n2 + ((INT32)(voice->k2 >> 2) * voice->o3n1) / 32768 + voice->o3n1 / 2; \ + sample = sample - voice->o2n2 + ((int32_t)(voice->k2 >> 2) * voice->o3n1) / 32768 + voice->o3n1 / 2; \ voice->o3n2 = voice->o3n1; \ voice->o3n1 = sample; \ \ /* pole 4 is high-pass using K2 */ \ - sample = sample - voice->o3n2 + ((INT32)(voice->k2 >> 2) * voice->o4n1) / 32768 + voice->o4n1 / 2; \ + sample = sample - voice->o3n2 + ((int32_t)(voice->k2 >> 2) * voice->o4n1) / 32768 + voice->o4n1 / 2; \ voice->o4n1 = sample; \ break; \ \ case CONTROL_LP3: \ /* pole 3 is low-pass using K1 */ \ - sample = ((INT32)(voice->k1 >> 2) * (sample - voice->o3n1) / 16384) + voice->o3n1; \ + sample = ((int32_t)(voice->k1 >> 2) * (sample - voice->o3n1) / 16384) + voice->o3n1; \ voice->o3n2 = voice->o3n1; \ voice->o3n1 = sample; \ \ /* pole 4 is high-pass using K2 */ \ - sample = sample - voice->o3n2 + ((INT32)(voice->k2 >> 2) * voice->o4n1) / 32768 + voice->o4n1 / 2; \ + sample = sample - voice->o3n2 + ((int32_t)(voice->k2 >> 2) * voice->o4n1) / 32768 + voice->o4n1 / 2; \ voice->o4n1 = sample; \ break; \ \ case CONTROL_LP4: \ /* pole 3 is low-pass using K2 */ \ - sample = ((INT32)(voice->k2 >> 2) * (sample - voice->o3n1) / 16384) + voice->o3n1; \ + sample = ((int32_t)(voice->k2 >> 2) * (sample - voice->o3n1) / 16384) + voice->o3n1; \ voice->o3n2 = voice->o3n1; \ voice->o3n1 = sample; \ \ /* pole 4 is low-pass using K2 */ \ - sample = ((INT32)(voice->k2 >> 2) * (sample - voice->o4n1) / 16384) + voice->o4n1; \ + sample = ((int32_t)(voice->k2 >> 2) * (sample - voice->o4n1) / 16384) + voice->o4n1; \ voice->o4n1 = sample; \ break; \ \ case CONTROL_LP4 | CONTROL_LP3: \ /* pole 3 is low-pass using K1 */ \ - sample = ((INT32)(voice->k1 >> 2) * (sample - voice->o3n1) / 16384) + voice->o3n1; \ + sample = ((int32_t)(voice->k1 >> 2) * (sample - voice->o3n1) / 16384) + voice->o3n1; \ voice->o3n2 = voice->o3n1; \ voice->o3n1 = sample; \ \ /* pole 4 is low-pass using K2 */ \ - sample = ((INT32)(voice->k2 >> 2) * (sample - voice->o4n1) / 16384) + voice->o4n1; \ + sample = ((int32_t)(voice->k2 >> 2) * (sample - voice->o4n1) / 16384) + voice->o4n1; \ voice->o4n1 = sample; \ break; \ } \ @@ -620,32 +620,32 @@ do /* ramp left volume */ \ if (voice->lvramp) \ { \ - voice->lvol += (INT8)voice->lvramp * count; \ - if ((INT32)voice->lvol < 0) voice->lvol = 0; \ + voice->lvol += (int8_t)voice->lvramp * count; \ + if ((int32_t)voice->lvol < 0) voice->lvol = 0; \ else if (voice->lvol > 0xffff) voice->lvol = 0xffff; \ } \ \ /* ramp right volume */ \ if (voice->rvramp) \ { \ - voice->rvol += (INT8)voice->rvramp * count; \ - if ((INT32)voice->rvol < 0) voice->rvol = 0; \ + voice->rvol += (int8_t)voice->rvramp * count; \ + if ((int32_t)voice->rvol < 0) voice->rvol = 0; \ else if (voice->rvol > 0xffff) voice->rvol = 0xffff; \ } \ \ /* ramp k1 filter constant */ \ - if (voice->k1ramp && ((INT32)voice->k1ramp >= 0 || !(voice->filtcount & 7))) \ + if (voice->k1ramp && ((int32_t)voice->k1ramp >= 0 || !(voice->filtcount & 7))) \ { \ - voice->k1 += (INT8)voice->k1ramp * count; \ - if ((INT32)voice->k1 < 0) voice->k1 = 0; \ + voice->k1 += (int8_t)voice->k1ramp * count; \ + if ((int32_t)voice->k1 < 0) voice->k1 = 0; \ else if (voice->k1 > 0xffff) voice->k1 = 0xffff; \ } \ \ /* ramp k2 filter constant */ \ - if (voice->k2ramp && ((INT32)voice->k2ramp >= 0 || !(voice->filtcount & 7))) \ + if (voice->k2ramp && ((int32_t)voice->k2ramp >= 0 || !(voice->filtcount & 7))) \ { \ - voice->k2 += (INT8)voice->k2ramp * count; \ - if ((INT32)voice->k2 < 0) voice->k2 = 0; \ + voice->k2 += (int8_t)voice->k2ramp * count; \ + if ((int32_t)voice->k2 < 0) voice->k2 = 0; \ else if (voice->k2 > 0xffff) voice->k2 = 0xffff; \ } \ \ @@ -748,10 +748,10 @@ do ***********************************************************************************************/ -void es550x_device::generate_dummy(es550x_voice *voice, UINT16 *base, INT32 *lbuffer, INT32 *rbuffer, int samples) +void es550x_device::generate_dummy(es550x_voice *voice, uint16_t *base, int32_t *lbuffer, int32_t *rbuffer, int samples) { - UINT32 freqcount = voice->freqcount; - UINT32 accum = voice->accum & voice->accum_mask; + uint32_t freqcount = voice->freqcount; + uint32_t accum = voice->accum & voice->accum_mask; /* outer loop, in case we switch directions */ while (samples > 0 && !(voice->control & CONTROL_STOPMASK)) @@ -809,12 +809,12 @@ alldone: ***********************************************************************************************/ -void es550x_device::generate_ulaw(es550x_voice *voice, UINT16 *base, INT32 *lbuffer, INT32 *rbuffer, int samples) +void es550x_device::generate_ulaw(es550x_voice *voice, uint16_t *base, int32_t *lbuffer, int32_t *rbuffer, int samples) { - UINT32 freqcount = voice->freqcount; - UINT32 accum = voice->accum & voice->accum_mask; - INT32 lvol = m_volume_lookup[voice->lvol >> 4]; - INT32 rvol = m_volume_lookup[voice->rvol >> 4]; + uint32_t freqcount = voice->freqcount; + uint32_t accum = voice->accum & voice->accum_mask; + int32_t lvol = m_volume_lookup[voice->lvol >> 4]; + int32_t rvol = m_volume_lookup[voice->rvol >> 4]; /* pre-add the bank offset */ base += voice->exbank; @@ -830,8 +830,8 @@ reverse: while (samples--) { /* fetch two samples */ - INT32 val1 = base[accum >> 11]; - INT32 val2 = base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; + int32_t val1 = base[accum >> 11]; + int32_t val2 = base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; /* decompress u-law */ val1 = m_ulaw_lookup[val1 >> (16 - ULAW_MAXBITS)]; @@ -868,8 +868,8 @@ reverse: while (samples--) { /* fetch two samples */ - INT32 val1 = base[accum >> 11]; - INT32 val2 = base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; + int32_t val1 = base[accum >> 11]; + int32_t val2 = base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; /* decompress u-law */ val1 = m_ulaw_lookup[val1 >> (16 - ULAW_MAXBITS)]; @@ -915,12 +915,12 @@ alldone: ***********************************************************************************************/ -void es550x_device::generate_pcm(es550x_voice *voice, UINT16 *base, INT32 *lbuffer, INT32 *rbuffer, int samples) +void es550x_device::generate_pcm(es550x_voice *voice, uint16_t *base, int32_t *lbuffer, int32_t *rbuffer, int samples) { - UINT32 freqcount = voice->freqcount; - UINT32 accum = voice->accum & voice->accum_mask; - INT32 lvol = m_volume_lookup[voice->lvol >> 4]; - INT32 rvol = m_volume_lookup[voice->rvol >> 4]; + uint32_t freqcount = voice->freqcount; + uint32_t accum = voice->accum & voice->accum_mask; + int32_t lvol = m_volume_lookup[voice->lvol >> 4]; + int32_t rvol = m_volume_lookup[voice->rvol >> 4]; /* pre-add the bank offset */ base += voice->exbank; @@ -936,8 +936,8 @@ reverse: while (samples--) { /* fetch two samples */ - INT32 val1 = (INT16)base[accum >> 11]; - INT32 val2 = (INT16)base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; + int32_t val1 = (int16_t)base[accum >> 11]; + int32_t val2 = (int16_t)base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; /* interpolate */ val1 = interpolate(val1, val2, accum); @@ -970,8 +970,8 @@ reverse: while (samples--) { /* fetch two samples */ - INT32 val1 = (INT16)base[accum >> 11]; - INT32 val2 = (INT16)base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; + int32_t val1 = (int16_t)base[accum >> 11]; + int32_t val2 = (int16_t)base[((accum + (1 << 11)) & voice->accum_mask) >> 11]; /* interpolate */ val1 = interpolate(val1, val2, accum); @@ -1013,7 +1013,7 @@ alldone: ***********************************************************************************************/ -void es5506_device::generate_samples(INT32 **outputs, int offset, int samples) +void es5506_device::generate_samples(int32_t **outputs, int offset, int samples) { int v; @@ -1024,14 +1024,14 @@ void es5506_device::generate_samples(INT32 **outputs, int offset, int samples) /* clear out the accumulators */ for (int i = 0; i < m_channels << 1; i++) { - memset(outputs[i] + offset, 0, sizeof(INT32) * samples); + memset(outputs[i] + offset, 0, sizeof(int32_t) * samples); } /* loop over voices */ for (v = 0; v <= m_active_voices; v++) { es550x_voice *voice = &m_voice[v]; - UINT16 *base = m_region_base[voice->control >> 14]; + uint16_t *base = m_region_base[voice->control >> 14]; /* special case: if end == start, stop the voice */ if (voice->start == voice->end) @@ -1041,8 +1041,8 @@ void es5506_device::generate_samples(INT32 **outputs, int offset, int samples) int channel = voice_channel % m_channels; int l = channel << 1; int r = l + 1; - INT32 *left = outputs[l] + offset; - INT32 *right = outputs[r] + offset; + int32_t *left = outputs[l] + offset; + int32_t *right = outputs[r] + offset; /* generate from the appropriate source */ if (!base) @@ -1076,7 +1076,7 @@ void es5506_device::generate_samples(INT32 **outputs, int offset, int samples) } } -void es5505_device::generate_samples(INT32 **outputs, int offset, int samples) +void es5505_device::generate_samples(int32_t **outputs, int offset, int samples) { int v; @@ -1087,14 +1087,14 @@ void es5505_device::generate_samples(INT32 **outputs, int offset, int samples) /* clear out the accumulators */ for (int i = 0; i < m_channels << 1; i++) { - memset(outputs[i] + offset, 0, sizeof(INT32) * samples); + memset(outputs[i] + offset, 0, sizeof(int32_t) * samples); } /* loop over voices */ for (v = 0; v <= m_active_voices; v++) { es550x_voice *voice = &m_voice[v]; - UINT16 *base = m_region_base[voice->control >> 14]; + uint16_t *base = m_region_base[voice->control >> 14]; // This special case does not appear to match the behaviour observed in the es5505 in // actual Ensoniq synthesizers: those, it turns out, do set loop start and end to the @@ -1110,8 +1110,8 @@ void es5505_device::generate_samples(INT32 **outputs, int offset, int samples) int channel = voice_channel % m_channels; int l = channel << 1; int r = l + 1; - INT32 *left = outputs[l] + offset; - INT32 *right = outputs[r] + offset; + int32_t *left = outputs[l] + offset; + int32_t *right = outputs[r] + offset; /* generate from the appropriate source */ if (!base) @@ -1153,7 +1153,7 @@ void es5505_device::generate_samples(INT32 **outputs, int offset, int samples) ***********************************************************************************************/ -inline void es5506_device::reg_write_low(es550x_voice *voice, offs_t offset, UINT32 data) +inline void es5506_device::reg_write_low(es550x_voice *voice, offs_t offset, uint32_t data) { switch (offset) { @@ -1249,7 +1249,7 @@ inline void es5506_device::reg_write_low(es550x_voice *voice, offs_t offset, UIN } } -inline void es5506_device::reg_write_high(es550x_voice *voice, offs_t offset, UINT32 data) +inline void es5506_device::reg_write_high(es550x_voice *voice, offs_t offset, uint32_t data) { switch (offset) { @@ -1278,37 +1278,37 @@ inline void es5506_device::reg_write_high(es550x_voice *voice, offs_t offset, UI break; case 0x20/8: /* O4(n-1) */ - voice->o4n1 = (INT32)(data << 14) >> 14; + voice->o4n1 = (int32_t)(data << 14) >> 14; if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "voice %d, O4(n-1)=%05x\n", m_current_page & 0x1f, voice->o4n1 & 0x3ffff); break; case 0x28/8: /* O3(n-1) */ - voice->o3n1 = (INT32)(data << 14) >> 14; + voice->o3n1 = (int32_t)(data << 14) >> 14; if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "voice %d, O3(n-1)=%05x\n", m_current_page & 0x1f, voice->o3n1 & 0x3ffff); break; case 0x30/8: /* O3(n-2) */ - voice->o3n2 = (INT32)(data << 14) >> 14; + voice->o3n2 = (int32_t)(data << 14) >> 14; if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "voice %d, O3(n-2)=%05x\n", m_current_page & 0x1f, voice->o3n2 & 0x3ffff); break; case 0x38/8: /* O2(n-1) */ - voice->o2n1 = (INT32)(data << 14) >> 14; + voice->o2n1 = (int32_t)(data << 14) >> 14; if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "voice %d, O2(n-1)=%05x\n", m_current_page & 0x1f, voice->o2n1 & 0x3ffff); break; case 0x40/8: /* O2(n-2) */ - voice->o2n2 = (INT32)(data << 14) >> 14; + voice->o2n2 = (int32_t)(data << 14) >> 14; if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "voice %d, O2(n-2)=%05x\n", m_current_page & 0x1f, voice->o2n2 & 0x3ffff); break; case 0x48/8: /* O1(n-1) */ - voice->o1n1 = (INT32)(data << 14) >> 14; + voice->o1n1 = (int32_t)(data << 14) >> 14; if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "voice %d, O1(n-1)=%05x\n", m_current_page & 0x1f, voice->o1n1 & 0x3ffff); break; @@ -1335,7 +1335,7 @@ inline void es5506_device::reg_write_high(es550x_voice *voice, offs_t offset, UI } } -inline void es5506_device::reg_write_test(es550x_voice *voice, offs_t offset, UINT32 data) +inline void es5506_device::reg_write_test(es550x_voice *voice, offs_t offset, uint32_t data) { switch (offset) { @@ -1449,9 +1449,9 @@ WRITE8_MEMBER( es5506_device::write ) ***********************************************************************************************/ -inline UINT32 es5506_device::reg_read_low(es550x_voice *voice, offs_t offset) +inline uint32_t es5506_device::reg_read_low(es550x_voice *voice, offs_t offset) { - UINT32 result = 0; + uint32_t result = 0; switch (offset) { @@ -1525,9 +1525,9 @@ inline UINT32 es5506_device::reg_read_low(es550x_voice *voice, offs_t offset) } -inline UINT32 es5506_device::reg_read_high(es550x_voice *voice, offs_t offset) +inline uint32_t es5506_device::reg_read_high(es550x_voice *voice, offs_t offset) { - UINT32 result = 0; + uint32_t result = 0; switch (offset) { @@ -1599,9 +1599,9 @@ inline UINT32 es5506_device::reg_read_high(es550x_voice *voice, offs_t offset) } return result; } -inline UINT32 es5506_device::reg_read_test(es550x_voice *voice, offs_t offset) +inline uint32_t es5506_device::reg_read_test(es550x_voice *voice, offs_t offset) { - UINT32 result = 0; + uint32_t result = 0; switch (offset) { @@ -1665,7 +1665,7 @@ void es5506_device::voice_bank_w(int voice, int bank) ***********************************************************************************************/ -inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask) +inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, uint16_t data, uint16_t mem_mask) { switch (offset) { @@ -1818,7 +1818,7 @@ inline void es5505_device::reg_write_low(es550x_voice *voice, offs_t offset, UIN } -inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask) +inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, uint16_t data, uint16_t mem_mask) { switch (offset) { @@ -1843,7 +1843,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, UI if (ACCESSING_BITS_0_7) voice->o4n1 = (voice->o4n1 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) - voice->o4n1 = (INT16)((voice->o4n1 & ~0xff00) | (data & 0xff00)); + voice->o4n1 = (int16_t)((voice->o4n1 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "%s:voice %d, O4(n-1)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o4n1 & 0x3ffff); break; @@ -1852,7 +1852,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, UI if (ACCESSING_BITS_0_7) voice->o3n1 = (voice->o3n1 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) - voice->o3n1 = (INT16)((voice->o3n1 & ~0xff00) | (data & 0xff00)); + voice->o3n1 = (int16_t)((voice->o3n1 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "%s:voice %d, O3(n-1)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o3n1 & 0x3ffff); break; @@ -1861,7 +1861,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, UI if (ACCESSING_BITS_0_7) voice->o3n2 = (voice->o3n2 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) - voice->o3n2 = (INT16)((voice->o3n2 & ~0xff00) | (data & 0xff00)); + voice->o3n2 = (int16_t)((voice->o3n2 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "%s:voice %d, O3(n-2)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o3n2 & 0x3ffff); break; @@ -1870,7 +1870,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, UI if (ACCESSING_BITS_0_7) voice->o2n1 = (voice->o2n1 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) - voice->o2n1 = (INT16)((voice->o2n1 & ~0xff00) | (data & 0xff00)); + voice->o2n1 = (int16_t)((voice->o2n1 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "%s:voice %d, O2(n-1)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o2n1 & 0x3ffff); break; @@ -1879,7 +1879,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, UI if (ACCESSING_BITS_0_7) voice->o2n2 = (voice->o2n2 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) - voice->o2n2 = (INT16)((voice->o2n2 & ~0xff00) | (data & 0xff00)); + voice->o2n2 = (int16_t)((voice->o2n2 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "%s:voice %d, O2(n-2)=%05x\n", machine().describe_context(), m_current_page & 0x1f, voice->o2n2 & 0x3ffff); break; @@ -1888,7 +1888,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, UI if (ACCESSING_BITS_0_7) voice->o1n1 = (voice->o1n1 & ~0x00ff) | (data & 0x00ff); if (ACCESSING_BITS_8_15) - voice->o1n1 = (INT16)((voice->o1n1 & ~0xff00) | (data & 0xff00)); + voice->o1n1 = (int16_t)((voice->o1n1 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", machine().describe_context(), m_current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum); break; @@ -1924,7 +1924,7 @@ inline void es5505_device::reg_write_high(es550x_voice *voice, offs_t offset, UI } -inline void es5505_device::reg_write_test(es550x_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask) +inline void es5505_device::reg_write_test(es550x_voice *voice, offs_t offset, uint16_t data, uint16_t mem_mask) { switch (offset) { @@ -1994,9 +1994,9 @@ WRITE16_MEMBER( es5505_device::write ) ***********************************************************************************************/ -inline UINT16 es5505_device::reg_read_low(es550x_voice *voice, offs_t offset) +inline uint16_t es5505_device::reg_read_low(es550x_voice *voice, offs_t offset) { - UINT16 result = 0; + uint16_t result = 0; switch (offset) { @@ -2072,9 +2072,9 @@ inline UINT16 es5505_device::reg_read_low(es550x_voice *voice, offs_t offset) } -inline UINT16 es5505_device::reg_read_high(es550x_voice *voice, offs_t offset) +inline uint16_t es5505_device::reg_read_high(es550x_voice *voice, offs_t offset) { - UINT16 result = 0; + uint16_t result = 0; switch (offset) { @@ -2146,9 +2146,9 @@ inline UINT16 es5505_device::reg_read_high(es550x_voice *voice, offs_t offset) } -inline UINT16 es5505_device::reg_read_test(es550x_voice *voice, offs_t offset) +inline uint16_t es5505_device::reg_read_test(es550x_voice *voice, offs_t offset) { - UINT16 result = 0; + uint16_t result = 0; switch (offset) { @@ -2192,7 +2192,7 @@ inline UINT16 es5505_device::reg_read_test(es550x_voice *voice, offs_t offset) READ16_MEMBER( es5505_device::read ) { es550x_voice *voice = &m_voice[m_current_page & 0x1f]; - UINT16 result; + uint16_t result; if (LOG_COMMANDS && m_eslog) fprintf(m_eslog, "read from %02x/%02x -> ", m_current_page, offset); @@ -2257,13 +2257,13 @@ void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t ** /* log the raw data */ if (m_wavraw) { /* determine left/right source data */ - INT32 *lsrc = m_scratch, *rsrc = m_scratch + length; + int32_t *lsrc = m_scratch, *rsrc = m_scratch + length; int channel; - memset(lsrc, 0, sizeof(INT32) * length * 2); + memset(lsrc, 0, sizeof(int32_t) * length * 2); /* loop over the output channels */ for (channel = 0; channel < m_channels; channel++) { - INT32 *l = outputs[(channel << 1)] + offset; - INT32 *r = outputs[(channel << 1) + 1] + offset; + int32_t *l = outputs[(channel << 1)] + offset; + int32_t *r = outputs[(channel << 1) + 1] + offset; /* add the current channel's samples to the WAV data */ for (samp = 0; samp < length; samp++) { lsrc[samp] += l[samp]; @@ -2303,13 +2303,13 @@ void es5505_device::sound_stream_update(sound_stream &stream, stream_sample_t ** /* log the raw data */ if (m_wavraw) { /* determine left/right source data */ - INT32 *lsrc = m_scratch, *rsrc = m_scratch + length; + int32_t *lsrc = m_scratch, *rsrc = m_scratch + length; int channel; - memset(lsrc, 0, sizeof(INT32) * length * 2); + memset(lsrc, 0, sizeof(int32_t) * length * 2); /* loop over the output channels */ for (channel = 0; channel < m_channels; channel++) { - INT32 *l = outputs[(channel << 1)] + offset; - INT32 *r = outputs[(channel << 1) + 1] + offset; + int32_t *l = outputs[(channel << 1)] + offset; + int32_t *r = outputs[(channel << 1) + 1] + offset; /* add the current channel's samples to the WAV data */ for (samp = 0; samp < length; samp++) { lsrc[samp] += l[samp]; diff --git a/src/devices/sound/es5506.h b/src/devices/sound/es5506.h index 4ccc9d2d3f6..4c367be82b8 100644 --- a/src/devices/sound/es5506.h +++ b/src/devices/sound/es5506.h @@ -83,39 +83,39 @@ struct es550x_voice accum_mask(0) {} /* external state */ - UINT32 control; /* control register */ - UINT32 freqcount; /* frequency count register */ - UINT32 start; /* start register */ - UINT32 lvol; /* left volume register */ - UINT32 end; /* end register */ - UINT32 lvramp; /* left volume ramp register */ - UINT32 accum; /* accumulator register */ - UINT32 rvol; /* right volume register */ - UINT32 rvramp; /* right volume ramp register */ - UINT32 ecount; /* envelope count register */ - UINT32 k2; /* k2 register */ - UINT32 k2ramp; /* k2 ramp register */ - UINT32 k1; /* k1 register */ - UINT32 k1ramp; /* k1 ramp register */ - INT32 o4n1; /* filter storage O4(n-1) */ - INT32 o3n1; /* filter storage O3(n-1) */ - INT32 o3n2; /* filter storage O3(n-2) */ - INT32 o2n1; /* filter storage O2(n-1) */ - INT32 o2n2; /* filter storage O2(n-2) */ - INT32 o1n1; /* filter storage O1(n-1) */ - UINT32 exbank; /* external address bank */ + uint32_t control; /* control register */ + uint32_t freqcount; /* frequency count register */ + uint32_t start; /* start register */ + uint32_t lvol; /* left volume register */ + uint32_t end; /* end register */ + uint32_t lvramp; /* left volume ramp register */ + uint32_t accum; /* accumulator register */ + uint32_t rvol; /* right volume register */ + uint32_t rvramp; /* right volume ramp register */ + uint32_t ecount; /* envelope count register */ + uint32_t k2; /* k2 register */ + uint32_t k2ramp; /* k2 ramp register */ + uint32_t k1; /* k1 register */ + uint32_t k1ramp; /* k1 ramp register */ + int32_t o4n1; /* filter storage O4(n-1) */ + int32_t o3n1; /* filter storage O3(n-1) */ + int32_t o3n2; /* filter storage O3(n-2) */ + int32_t o2n1; /* filter storage O2(n-1) */ + int32_t o2n2; /* filter storage O2(n-2) */ + int32_t o1n1; /* filter storage O1(n-1) */ + uint32_t exbank; /* external address bank */ /* internal state */ - UINT8 index; /* index of this voice */ - UINT8 filtcount; /* filter count */ - UINT32 accum_mask; + uint8_t index; /* index of this voice */ + uint8_t filtcount; /* filter count */ + uint32_t accum_mask; }; class es550x_device : public device_t, public device_sound_interface { public: - es550x_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); + es550x_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); ~es550x_device() {} static void set_region0(device_t &device, const char *region0) { downcast(device).m_region0 = region0; } @@ -139,25 +139,25 @@ protected: // internal state sound_stream *m_stream; /* which stream are we using */ int m_sample_rate; /* current sample rate */ - UINT16 * m_region_base[4]; /* pointer to the base of the region */ - UINT32 m_write_latch; /* currently accumulated data for write */ - UINT32 m_read_latch; /* currently accumulated data for read */ - UINT32 m_master_clock; /* master clock frequency */ - - UINT8 m_current_page; /* current register page */ - UINT8 m_active_voices; /* number of active voices */ - UINT8 m_mode; /* MODE register */ - UINT8 m_wst; /* W_ST register */ - UINT8 m_wend; /* W_END register */ - UINT8 m_lrend; /* LR_END register */ - UINT8 m_irqv; /* IRQV register */ + uint16_t * m_region_base[4]; /* pointer to the base of the region */ + uint32_t m_write_latch; /* currently accumulated data for write */ + uint32_t m_read_latch; /* currently accumulated data for read */ + uint32_t m_master_clock; /* master clock frequency */ + + uint8_t m_current_page; /* current register page */ + uint8_t m_active_voices; /* number of active voices */ + uint8_t m_mode; /* MODE register */ + uint8_t m_wst; /* W_ST register */ + uint8_t m_wend; /* W_END register */ + uint8_t m_lrend; /* LR_END register */ + uint8_t m_irqv; /* IRQV register */ es550x_voice m_voice[32]; /* the 32 voices */ - std::unique_ptr m_scratch; + std::unique_ptr m_scratch; - std::unique_ptr m_ulaw_lookup; - std::unique_ptr m_volume_lookup; + std::unique_ptr m_ulaw_lookup; + std::unique_ptr m_volume_lookup; #if MAKE_WAVS void * m_wavraw; /* raw waveform */ @@ -177,16 +177,16 @@ protected: void update_internal_irq_state(); void compute_tables(); - void generate_dummy(es550x_voice *voice, UINT16 *base, INT32 *lbuffer, INT32 *rbuffer, int samples); - void generate_ulaw(es550x_voice *voice, UINT16 *base, INT32 *lbuffer, INT32 *rbuffer, int samples); - void generate_pcm(es550x_voice *voice, UINT16 *base, INT32 *lbuffer, INT32 *rbuffer, int samples); + void generate_dummy(es550x_voice *voice, uint16_t *base, int32_t *lbuffer, int32_t *rbuffer, int samples); + void generate_ulaw(es550x_voice *voice, uint16_t *base, int32_t *lbuffer, int32_t *rbuffer, int samples); + void generate_pcm(es550x_voice *voice, uint16_t *base, int32_t *lbuffer, int32_t *rbuffer, int samples); }; class es5506_device : public es550x_device { public: - es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~es5506_device() {} DECLARE_READ8_MEMBER( read ); @@ -201,15 +201,15 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; - void generate_samples(INT32 **outputs, int offset, int samples); + void generate_samples(int32_t **outputs, int offset, int samples); private: - inline void reg_write_low(es550x_voice *voice, offs_t offset, UINT32 data); - inline void reg_write_high(es550x_voice *voice, offs_t offset, UINT32 data); - inline void reg_write_test(es550x_voice *voice, offs_t offset, UINT32 data); - inline UINT32 reg_read_low(es550x_voice *voice, offs_t offset); - inline UINT32 reg_read_high(es550x_voice *voice, offs_t offset); - inline UINT32 reg_read_test(es550x_voice *voice, offs_t offset); + inline void reg_write_low(es550x_voice *voice, offs_t offset, uint32_t data); + inline void reg_write_high(es550x_voice *voice, offs_t offset, uint32_t data); + inline void reg_write_test(es550x_voice *voice, offs_t offset, uint32_t data); + inline uint32_t reg_read_low(es550x_voice *voice, offs_t offset); + inline uint32_t reg_read_high(es550x_voice *voice, offs_t offset); + inline uint32_t reg_read_test(es550x_voice *voice, offs_t offset); }; extern const device_type ES5506; @@ -218,7 +218,7 @@ extern const device_type ES5506; class es5505_device : public es550x_device { public: - es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER( read ); DECLARE_WRITE16_MEMBER( write ); @@ -230,16 +230,16 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; - void generate_samples(INT32 **outputs, int offset, int samples); + void generate_samples(int32_t **outputs, int offset, int samples); private: // internal state - inline void reg_write_low(es550x_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask); - inline void reg_write_high(es550x_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask); - inline void reg_write_test(es550x_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask); - inline UINT16 reg_read_low(es550x_voice *voice, offs_t offset); - inline UINT16 reg_read_high(es550x_voice *voice, offs_t offset); - inline UINT16 reg_read_test(es550x_voice *voice, offs_t offset); + inline void reg_write_low(es550x_voice *voice, offs_t offset, uint16_t data, uint16_t mem_mask); + inline void reg_write_high(es550x_voice *voice, offs_t offset, uint16_t data, uint16_t mem_mask); + inline void reg_write_test(es550x_voice *voice, offs_t offset, uint16_t data, uint16_t mem_mask); + inline uint16_t reg_read_low(es550x_voice *voice, offs_t offset); + inline uint16_t reg_read_high(es550x_voice *voice, offs_t offset); + inline uint16_t reg_read_test(es550x_voice *voice, offs_t offset); }; extern const device_type ES5505; diff --git a/src/devices/sound/es8712.cpp b/src/devices/sound/es8712.cpp index e7fee35bbe8..e7f5aa1fd75 100644 --- a/src/devices/sound/es8712.cpp +++ b/src/devices/sound/es8712.cpp @@ -39,7 +39,7 @@ const device_type ES8712 = &device_creator; // es8712_device - constructor //------------------------------------------------- -es8712_device::es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +es8712_device::es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ES8712, "ES8712", tag, owner, clock, "es8712", __FILE__), device_sound_interface(mconfig, *this), m_rom(*this, DEVICE_SELF), @@ -156,7 +156,7 @@ void es8712_device::generate_adpcm(stream_sample_t *buffer, int samples) /* if this chip is active */ if (m_playing) { - UINT8 *base = &m_rom[m_bank_offset + m_base_offset]; + uint8_t *base = &m_rom[m_bank_offset + m_base_offset]; int sample = m_sample; int signal = m_signal; int count = m_count; diff --git a/src/devices/sound/es8712.h b/src/devices/sound/es8712.h index 74e61d232dc..a2f73209930 100644 --- a/src/devices/sound/es8712.h +++ b/src/devices/sound/es8712.h @@ -28,7 +28,7 @@ class es8712_device : public device_t, public device_sound_interface { public: - es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~es8712_device() { } protected: @@ -53,22 +53,22 @@ private: void es8712_state_save_register(); private: - required_region_ptr m_rom; + required_region_ptr m_rom; - UINT8 m_playing; /* 1 if we're actively playing */ + uint8_t m_playing; /* 1 if we're actively playing */ - UINT32 m_base_offset; /* pointer to the base memory location */ - UINT32 m_sample; /* current sample number */ - UINT32 m_count; /* total samples to play */ + uint32_t m_base_offset; /* pointer to the base memory location */ + uint32_t m_sample; /* current sample number */ + uint32_t m_count; /* total samples to play */ - UINT32 m_signal; /* current ADPCM signal */ - UINT32 m_step; /* current ADPCM step */ + uint32_t m_signal; /* current ADPCM signal */ + uint32_t m_step; /* current ADPCM step */ - UINT32 m_start; /* starting address for the next loop */ - UINT32 m_end; /* ending address for the next loop */ - UINT8 m_repeat; /* Repeat current sample when 1 */ + uint32_t m_start; /* starting address for the next loop */ + uint32_t m_end; /* ending address for the next loop */ + uint8_t m_repeat; /* Repeat current sample when 1 */ - INT32 m_bank_offset; + int32_t m_bank_offset; sound_stream *m_stream; /* which stream are we playing on? */ }; diff --git a/src/devices/sound/esqpump.cpp b/src/devices/sound/esqpump.cpp index 9873029e056..86c69195f4b 100644 --- a/src/devices/sound/esqpump.cpp +++ b/src/devices/sound/esqpump.cpp @@ -12,7 +12,7 @@ const device_type ESQ_5505_5510_PUMP = &device_creator; -esq_5505_5510_pump::esq_5505_5510_pump(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +esq_5505_5510_pump::esq_5505_5510_pump(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ESQ_5505_5510_PUMP, "ESQ_5505_5510_PUMP", tag, owner, clock, "esq_5505_5510_pump", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), m_timer(nullptr), m_otis(nullptr), m_esp(nullptr), m_esp_halted(true), ticks_spent_processing(0), samples_processed(0) @@ -54,7 +54,7 @@ void esq_5505_5510_pump::device_stop() void esq_5505_5510_pump::device_reset() { - INT64 nsec_per_sample = 100 * 16 * 21; + int64_t nsec_per_sample = 100 * 16 * 21; attotime sample_time(0, 1000000000 * nsec_per_sample); attotime initial_delay(0, 0); @@ -73,8 +73,8 @@ void esq_5505_5510_pump::sound_stream_update(sound_stream &stream, stream_sample { #define SAMPLE_SHIFT 4 // anything for the 'aux' output? - INT16 l = inputs[0][i] >> SAMPLE_SHIFT; - INT16 r = inputs[1][i] >> SAMPLE_SHIFT; + int16_t l = inputs[0][i] >> SAMPLE_SHIFT; + int16_t r = inputs[1][i] >> SAMPLE_SHIFT; // push the samples into the ESP m_esp->ser_w(0, inputs[2][i] >> SAMPLE_SHIFT); @@ -99,16 +99,16 @@ void esq_5505_5510_pump::sound_stream_update(sound_stream &stream, stream_sample #endif // read the processed result from the ESP and add to the saved AUX data - INT16 ll = m_esp->ser_r(6); - INT16 rr = m_esp->ser_r(7); + int16_t ll = m_esp->ser_r(6); + int16_t rr = m_esp->ser_r(7); l += ll; r += rr; #if !PUMP_FAKE_ESP_PROCESSING && PUMP_REPLACE_ESP_PROGRAM // if we're processing the fake program through the ESP, the result should just be that of adding the inputs - INT32 el = (inputs[2][i]) + (inputs[4][i]) + (inputs[6][i]); - INT32 er = (inputs[3][i]) + (inputs[5][i]) + (inputs[7][i]); - INT32 e_next = el + er; + int32_t el = (inputs[2][i]) + (inputs[4][i]) + (inputs[6][i]); + int32_t er = (inputs[3][i]) + (inputs[5][i]) + (inputs[7][i]); + int32_t e_next = el + er; e[(ei + 0x1d0f) % 0x4000] = e_next; if (l != e[ei]) { diff --git a/src/devices/sound/esqpump.h b/src/devices/sound/esqpump.h index 1fded404997..0752b8aa397 100644 --- a/src/devices/sound/esqpump.h +++ b/src/devices/sound/esqpump.h @@ -18,7 +18,7 @@ class esq_5505_5510_pump : public device_t, public device_sound_interface { public: - esq_5505_5510_pump(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esq_5505_5510_pump(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_otis(es5505_device *otis) { m_otis = otis; } void set_esp(es5510_device *esp) { m_esp = esp; } @@ -114,7 +114,7 @@ private: #endif #if !PUMP_FAKE_ESP_PROCESSING && PUMP_REPLACE_ESP_PROGRAM - INT16 e[0x4000]; + int16_t e[0x4000]; int ei; #endif }; diff --git a/src/devices/sound/flt_rc.cpp b/src/devices/sound/flt_rc.cpp index cf37a4fd6d8..1f53ee8581e 100644 --- a/src/devices/sound/flt_rc.cpp +++ b/src/devices/sound/flt_rc.cpp @@ -16,7 +16,7 @@ const device_type FILTER_RC = &device_creator; // filter_rc_device - constructor //------------------------------------------------- -filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FILTER_RC, "RC Filter", tag, owner, clock, "filter_rc", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), diff --git a/src/devices/sound/flt_rc.h b/src/devices/sound/flt_rc.h index e6bc72baaa7..e34b0811261 100644 --- a/src/devices/sound/flt_rc.h +++ b/src/devices/sound/flt_rc.h @@ -70,7 +70,7 @@ class filter_rc_device : public device_t, public device_sound_interface { public: - filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~filter_rc_device() { } // static configuration diff --git a/src/devices/sound/flt_vol.cpp b/src/devices/sound/flt_vol.cpp index e209e44a5ed..e92aec24532 100644 --- a/src/devices/sound/flt_vol.cpp +++ b/src/devices/sound/flt_vol.cpp @@ -11,7 +11,7 @@ const device_type FILTER_VOLUME = &device_creator; // filter_volume_device - constructor //------------------------------------------------- -filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FILTER_VOLUME, "Volume Filter", tag, owner, clock, "filter_volume", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), diff --git a/src/devices/sound/flt_vol.h b/src/devices/sound/flt_vol.h index f9b090002c3..08f49607158 100644 --- a/src/devices/sound/flt_vol.h +++ b/src/devices/sound/flt_vol.h @@ -27,7 +27,7 @@ class filter_volume_device : public device_t, public device_sound_interface { public: - filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~filter_volume_device() { } void flt_volume_set_volume(float volume); diff --git a/src/devices/sound/fm.cpp b/src/devices/sound/fm.cpp index b2a8eeea8b2..2a8436f3c89 100644 --- a/src/devices/sound/fm.cpp +++ b/src/devices/sound/fm.cpp @@ -199,8 +199,8 @@ static unsigned int sin_tab[SIN_LEN]; /* 0.75, 1.5, 3, 6, 12, 24, 48 (dB)*/ /* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/ -#define SC(db) (UINT32) ( db * (4.0/ENV_STEP) ) -static const UINT32 sl_table[16]={ +#define SC(db) (uint32_t) ( db * (4.0/ENV_STEP) ) +static const uint32_t sl_table[16]={ SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7), SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31) }; @@ -208,7 +208,7 @@ static const UINT32 sl_table[16]={ #define RATE_STEPS (8) -static const UINT8 eg_inc[19*RATE_STEPS]={ +static const uint8_t eg_inc[19*RATE_STEPS]={ /*cycle:0 1 2 3 4 5 6 7*/ /* 0 */ 0,1, 0,1, 0,1, 0,1, /* rates 00..11 0 (increment by 0 or 1) */ @@ -240,7 +240,7 @@ static const UINT8 eg_inc[19*RATE_STEPS]={ #define O(a) (a*RATE_STEPS) /*note that there is no O(17) in this table - it's directly in the code */ -static const UINT8 eg_rate_select[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ +static const uint8_t eg_rate_select[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ /* 32 infinite time rates */ O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), @@ -288,7 +288,7 @@ O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16) /*mask 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0, 0, 0, 0, 0 */ #define O(a) (a*1) -static const UINT8 eg_rate_shift[32+64+32]={ /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */ +static const uint8_t eg_rate_shift[32+64+32]={ /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */ /* 32 infinite time rates */ O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), @@ -330,7 +330,7 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0) }; #undef O -static const UINT8 dt_tab[4 * 32]={ +static const uint8_t dt_tab[4 * 32]={ /* this is YM2151 and YM2612 phase increment data (in 10.10 fixed point format)*/ /* FD=0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -349,12 +349,12 @@ static const UINT8 dt_tab[4 * 32]={ /* OPN key frequency number -> key code follow table */ /* fnum higher 4bit -> keycode lower 2bit */ -static const UINT8 opn_fktable[16] = {0,0,0,0,0,0,0,1,2,3,3,3,3,3,3,3}; +static const uint8_t opn_fktable[16] = {0,0,0,0,0,0,0,1,2,3,3,3,3,3,3,3}; /* 8 LFO speed parameters */ /* each value represents number of samples that one LFO level will last for */ -static const UINT32 lfo_samples_per_step[8] = {108, 77, 71, 67, 62, 44, 8, 5}; +static const uint32_t lfo_samples_per_step[8] = {108, 77, 71, 67, 62, 44, 8, 5}; @@ -375,7 +375,7 @@ static const UINT32 lfo_samples_per_step[8] = {108, 77, 71, 67, 62, 44, 8, 5}; 1 for 5.9 dB 0 for 11.8 dB */ -static const UINT8 lfo_ams_depth_shift[4] = {8, 3, 1, 0}; +static const uint8_t lfo_ams_depth_shift[4] = {8, 3, 1, 0}; @@ -399,7 +399,7 @@ static const UINT8 lfo_ams_depth_shift[4] = {8, 3, 1, 0}; samples (32*432=13824; 32 because we store only a quarter of whole waveform in the table below) */ -static const UINT8 lfo_pm_output[7*8][8]={ /* 7 bits meaningful (of F-NUMBER), 8 LFO output levels per one depth (out of 32), 8 LFO depths */ +static const uint8_t lfo_pm_output[7*8][8]={ /* 7 bits meaningful (of F-NUMBER), 8 LFO output levels per one depth (out of 32), 8 LFO depths */ /* FNUM BIT 4: 000 0001xxxx */ /* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, /* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -473,7 +473,7 @@ static const UINT8 lfo_pm_output[7*8][8]={ /* 7 bits meaningful (of F-NUMBER), 8 }; /* all 128 LFO PM waveforms */ -static INT32 lfo_pm_table[128*8*32]; /* 128 combinations of 7 bits meaningful (of F-NUMBER), 8 LFO depths, 32 LFO output levels per one depth */ +static int32_t lfo_pm_table[128*8*32]; /* 128 combinations of 7 bits meaningful (of F-NUMBER), 8 LFO depths, 32 LFO output levels per one depth */ @@ -522,42 +522,42 @@ static FILE *sample[1]; /* struct describing a single operator (SLOT) */ struct FM_SLOT { - INT32 *DT; /* detune :dt_tab[DT] */ - UINT8 KSR; /* key scale rate :3-KSR */ - UINT32 ar; /* attack rate */ - UINT32 d1r; /* decay rate */ - UINT32 d2r; /* sustain rate */ - UINT32 rr; /* release rate */ - UINT8 ksr; /* key scale rate :kcode>>(3-KSR) */ - UINT32 mul; /* multiple :ML_TABLE[ML] */ + int32_t *DT; /* detune :dt_tab[DT] */ + uint8_t KSR; /* key scale rate :3-KSR */ + uint32_t ar; /* attack rate */ + uint32_t d1r; /* decay rate */ + uint32_t d2r; /* sustain rate */ + uint32_t rr; /* release rate */ + uint8_t ksr; /* key scale rate :kcode>>(3-KSR) */ + uint32_t mul; /* multiple :ML_TABLE[ML] */ /* Phase Generator */ - UINT32 phase; /* phase counter */ - INT32 Incr; /* phase step */ + uint32_t phase; /* phase counter */ + int32_t Incr; /* phase step */ /* Envelope Generator */ - UINT8 state; /* phase type */ - UINT32 tl; /* total level: TL << 3 */ - INT32 volume; /* envelope counter */ - UINT32 sl; /* sustain level:sl_table[SL] */ - UINT32 vol_out; /* current output from EG circuit (without AM from LFO) */ - - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT8 eg_sh_d1r; /* (decay state) */ - UINT8 eg_sel_d1r; /* (decay state) */ - UINT8 eg_sh_d2r; /* (sustain state) */ - UINT8 eg_sel_d2r; /* (sustain state) */ - UINT8 eg_sh_rr; /* (release state) */ - UINT8 eg_sel_rr; /* (release state) */ - - UINT8 ssg; /* SSG-EG waveform */ - UINT8 ssgn; /* SSG-EG negated output */ - - UINT32 key; /* 0=last key was KEY OFF, 1=KEY ON */ + uint8_t state; /* phase type */ + uint32_t tl; /* total level: TL << 3 */ + int32_t volume; /* envelope counter */ + uint32_t sl; /* sustain level:sl_table[SL] */ + uint32_t vol_out; /* current output from EG circuit (without AM from LFO) */ + + uint8_t eg_sh_ar; /* (attack state) */ + uint8_t eg_sel_ar; /* (attack state) */ + uint8_t eg_sh_d1r; /* (decay state) */ + uint8_t eg_sel_d1r; /* (decay state) */ + uint8_t eg_sh_d2r; /* (sustain state) */ + uint8_t eg_sel_d2r; /* (sustain state) */ + uint8_t eg_sh_rr; /* (release state) */ + uint8_t eg_sel_rr; /* (release state) */ + + uint8_t ssg; /* SSG-EG waveform */ + uint8_t ssgn; /* SSG-EG negated output */ + + uint32_t key; /* 0=last key was KEY OFF, 1=KEY ON */ /* LFO */ - UINT32 AMmask; /* AM enable flag */ + uint32_t AMmask; /* AM enable flag */ }; @@ -565,24 +565,24 @@ struct FM_CH { FM_SLOT SLOT[4]; /* four SLOTs (operators) */ - UINT8 ALGO; /* algorithm */ - UINT8 FB; /* feedback shift */ - INT32 op1_out[2]; /* op1 output for feedback */ + uint8_t ALGO; /* algorithm */ + uint8_t FB; /* feedback shift */ + int32_t op1_out[2]; /* op1 output for feedback */ - INT32 *connect1; /* SLOT1 output pointer */ - INT32 *connect3; /* SLOT3 output pointer */ - INT32 *connect2; /* SLOT2 output pointer */ - INT32 *connect4; /* SLOT4 output pointer */ + int32_t *connect1; /* SLOT1 output pointer */ + int32_t *connect3; /* SLOT3 output pointer */ + int32_t *connect2; /* SLOT2 output pointer */ + int32_t *connect4; /* SLOT4 output pointer */ - INT32 *mem_connect;/* where to put the delayed sample (MEM) */ - INT32 mem_value; /* delayed sample (MEM) value */ + int32_t *mem_connect;/* where to put the delayed sample (MEM) */ + int32_t mem_value; /* delayed sample (MEM) value */ - INT32 pms; /* channel PMS */ - UINT8 ams; /* channel AMS */ + int32_t pms; /* channel PMS */ + uint8_t ams; /* channel AMS */ - UINT32 fc; /* fnum,blk:adjusted to sample rate */ - UINT8 kcode; /* key code: */ - UINT32 block_fnum; /* current blk/fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ + uint32_t fc; /* fnum,blk:adjusted to sample rate */ + uint8_t kcode; /* key code: */ + uint32_t block_fnum; /* current blk/fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ }; @@ -597,19 +597,19 @@ struct FM_ST #if FM_BUSY_FLAG_SUPPORT TIME_TYPE busy_expiry_time; /* expiry time of the busy status */ #endif - UINT8 address; /* address register */ - UINT8 irq; /* interrupt level */ - UINT8 irqmask; /* irq mask */ - UINT8 status; /* status flag */ - UINT32 mode; /* mode CSM / 3SLOT */ - UINT8 prescaler_sel; /* prescaler selector */ - UINT8 fn_h; /* freq latch */ - INT32 TA; /* timer a */ - INT32 TAC; /* timer a counter */ - UINT8 TB; /* timer b */ - INT32 TBC; /* timer b counter */ + uint8_t address; /* address register */ + uint8_t irq; /* interrupt level */ + uint8_t irqmask; /* irq mask */ + uint8_t status; /* status flag */ + uint32_t mode; /* mode CSM / 3SLOT */ + uint8_t prescaler_sel; /* prescaler selector */ + uint8_t fn_h; /* freq latch */ + int32_t TA; /* timer a */ + int32_t TAC; /* timer a counter */ + uint8_t TB; /* timer b */ + int32_t TBC; /* timer b counter */ /* local time tables */ - INT32 dt_tab[8][32]; /* DeTune table */ + int32_t dt_tab[8][32]; /* DeTune table */ /* Extention Timer and IRQ handler */ FM_TIMERHANDLER timer_handler; FM_IRQHANDLER IRQ_Handler; @@ -625,50 +625,50 @@ struct FM_ST /* OPN 3slot struct */ struct FM_3SLOT { - UINT32 fc[3]; /* fnum3,blk3: calculated */ - UINT8 fn_h; /* freq3 latch */ - UINT8 kcode[3]; /* key code */ - UINT32 block_fnum[3]; /* current fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ + uint32_t fc[3]; /* fnum3,blk3: calculated */ + uint8_t fn_h; /* freq3 latch */ + uint8_t kcode[3]; /* key code */ + uint32_t block_fnum[3]; /* current fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ }; /* OPN/A/B common state */ struct FM_OPN { - UINT8 type; /* chip type */ + uint8_t type; /* chip type */ FM_ST ST; /* general state */ FM_3SLOT SL3; /* 3 slot mode state */ FM_CH *P_CH; /* pointer of CH */ unsigned int pan[6*2]; /* fm channels output masks (0xffffffff = enable) */ - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/64/3 */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow;/* envelope generator timer overlfows every 3 samples (on real chip) */ + uint32_t eg_cnt; /* global envelope generator counter */ + uint32_t eg_timer; /* global envelope generator counter works at frequency = chipclock/64/3 */ + uint32_t eg_timer_add; /* step of eg_timer */ + uint32_t eg_timer_overflow;/* envelope generator timer overlfows every 3 samples (on real chip) */ /* there are 2048 FNUMs that can be generated using FNUM/BLK registers but LFO works with one more bit of a precision so we really need 4096 elements */ - UINT32 fn_table[4096]; /* fnumber->increment counter */ - UINT32 fn_max; /* maximal phase increment (used for phase overflow) */ + uint32_t fn_table[4096]; /* fnumber->increment counter */ + uint32_t fn_max; /* maximal phase increment (used for phase overflow) */ /* LFO */ - UINT32 LFO_AM; /* runtime LFO calculations helper */ - INT32 LFO_PM; /* runtime LFO calculations helper */ + uint32_t LFO_AM; /* runtime LFO calculations helper */ + int32_t LFO_PM; /* runtime LFO calculations helper */ - UINT32 lfo_cnt; - UINT32 lfo_inc; + uint32_t lfo_cnt; + uint32_t lfo_inc; - UINT32 lfo_freq[8]; /* LFO FREQ table */ + uint32_t lfo_freq[8]; /* LFO FREQ table */ - INT32 m2,c1,c2; /* Phase Modulation input for operators 2,3,4 */ - INT32 mem; /* one sample delay memory */ + int32_t m2,c1,c2; /* Phase Modulation input for operators 2,3,4 */ + int32_t mem; /* one sample delay memory */ - INT32 out_fm[8]; /* outputs of working channels */ + int32_t out_fm[8]; /* outputs of working channels */ #if (BUILD_YM2608||BUILD_YM2610||BUILD_YM2610B) - INT32 out_adpcm[4]; /* channel output NONE,LEFT,RIGHT or CENTER for YM2608/YM2610 ADPCM */ - INT32 out_delta[4]; /* channel output NONE,LEFT,RIGHT or CENTER for YM2608/YM2610 DELTAT*/ + int32_t out_adpcm[4]; /* channel output NONE,LEFT,RIGHT or CENTER for YM2608/YM2610 ADPCM */ + int32_t out_delta[4]; /* channel output NONE,LEFT,RIGHT or CENTER for YM2608/YM2610 DELTAT*/ #endif }; @@ -838,7 +838,7 @@ static inline void TimerBOver(FM_ST *ST) #if FM_BUSY_FLAG_SUPPORT #define FM_BUSY_CLEAR(ST) ((ST)->busy_expiry_time = UNDEFINED_TIME) -static inline UINT8 FM_STATUS_FLAG(FM_ST *ST) +static inline uint8_t FM_STATUS_FLAG(FM_ST *ST) { if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 ) { @@ -863,7 +863,7 @@ static inline void FM_BUSY_SET(FM_ST *ST,int busyclock ) -static inline void FM_KEYON(UINT8 type, FM_CH *CH , int s ) +static inline void FM_KEYON(uint8_t type, FM_CH *CH , int s ) { FM_SLOT *SLOT = &CH->SLOT[s]; if( !SLOT->key ) @@ -889,13 +889,13 @@ static inline void FM_KEYOFF(FM_CH *CH , int s ) /* set algorithm connection */ static void setup_connection( FM_OPN *OPN, FM_CH *CH, int ch ) { - INT32 *carrier = &OPN->out_fm[ch]; + int32_t *carrier = &OPN->out_fm[ch]; - INT32 **om1 = &CH->connect1; - INT32 **om2 = &CH->connect3; - INT32 **oc1 = &CH->connect2; + int32_t **om1 = &CH->connect1; + int32_t **om2 = &CH->connect3; + int32_t **oc1 = &CH->connect2; - INT32 **memc = &CH->mem_connect; + int32_t **memc = &CH->mem_connect; switch( CH->ALGO ) { @@ -989,9 +989,9 @@ static inline void set_tl(FM_CH *CH,FM_SLOT *SLOT , int v) } /* set attack rate & key scale */ -static inline void set_ar_ksr(UINT8 type, FM_CH *CH,FM_SLOT *SLOT,int v) +static inline void set_ar_ksr(uint8_t type, FM_CH *CH,FM_SLOT *SLOT,int v) { - UINT8 old_KSR = SLOT->KSR; + uint8_t old_KSR = SLOT->KSR; SLOT->ar = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1015,7 +1015,7 @@ static inline void set_ar_ksr(UINT8 type, FM_CH *CH,FM_SLOT *SLOT,int v) } /* set decay rate */ -static inline void set_dr(UINT8 type, FM_SLOT *SLOT,int v) +static inline void set_dr(uint8_t type, FM_SLOT *SLOT,int v) { SLOT->d1r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1024,7 +1024,7 @@ static inline void set_dr(UINT8 type, FM_SLOT *SLOT,int v) } /* set sustain rate */ -static inline void set_sr(UINT8 type, FM_SLOT *SLOT,int v) +static inline void set_sr(uint8_t type, FM_SLOT *SLOT,int v) { SLOT->d2r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1033,7 +1033,7 @@ static inline void set_sr(UINT8 type, FM_SLOT *SLOT,int v) } /* set release rate */ -static inline void set_sl_rr(UINT8 type, FM_SLOT *SLOT,int v) +static inline void set_sl_rr(uint8_t type, FM_SLOT *SLOT,int v) { SLOT->sl = sl_table[ v>>4 ]; @@ -1045,9 +1045,9 @@ static inline void set_sl_rr(UINT8 type, FM_SLOT *SLOT,int v) -static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm) +static inline signed int op_calc(uint32_t phase, unsigned int env, signed int pm) { - UINT32 p; + uint32_t p; p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + (pm<<15))) >> FREQ_SH ) & SIN_MASK ]; @@ -1056,9 +1056,9 @@ static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm) return tl_tab[p]; } -static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) +static inline signed int op_calc1(uint32_t phase, unsigned int env, signed int pm) { - UINT32 p; + uint32_t p; p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + pm )) >> FREQ_SH ) & SIN_MASK ]; @@ -1070,7 +1070,7 @@ static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) /* advance LFO to next sample */ static inline void advance_lfo(FM_OPN *OPN) { - UINT8 pos; + uint8_t pos; if (OPN->lfo_inc) /* LFO enabled ? */ { @@ -1147,7 +1147,7 @@ static void advance_eg_channel(FM_OPN *OPN, FM_SLOT *SLOT) { SLOT->volume += 4 * eg_inc[SLOT->eg_sel_d1r + ((OPN->eg_cnt>>SLOT->eg_sh_d1r)&7)]; - if ( SLOT->volume >= (INT32)(SLOT->sl) ) + if ( SLOT->volume >= (int32_t)(SLOT->sl) ) SLOT->state = EG_SUS; } } @@ -1157,7 +1157,7 @@ static void advance_eg_channel(FM_OPN *OPN, FM_SLOT *SLOT) { SLOT->volume += eg_inc[SLOT->eg_sel_d1r + ((OPN->eg_cnt>>SLOT->eg_sh_d1r)&7)]; - if ( SLOT->volume >= (INT32)(SLOT->sl) ) + if ( SLOT->volume >= (int32_t)(SLOT->sl) ) SLOT->state = EG_SUS; } } @@ -1236,7 +1236,7 @@ static void advance_eg_channel(FM_OPN *OPN, FM_SLOT *SLOT) } - out = ((UINT32)SLOT->volume); + out = ((uint32_t)SLOT->volume); /* negate output (changes come from alternate bit, init comes from attack bit) */ if ((SLOT->ssg&0x08) && (SLOT->ssgn&2) && (SLOT->state > EG_REL)) @@ -1259,15 +1259,15 @@ static void advance_eg_channel(FM_OPN *OPN, FM_SLOT *SLOT) #define volume_calc(OP) ((OP)->vol_out + (AM & (OP)->AMmask)) -static inline void update_phase_lfo_slot(FM_OPN *OPN, FM_SLOT *SLOT, INT32 pms, UINT32 block_fnum) +static inline void update_phase_lfo_slot(FM_OPN *OPN, FM_SLOT *SLOT, int32_t pms, uint32_t block_fnum) { - UINT32 fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; - INT32 lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + pms + OPN->LFO_PM ]; + uint32_t fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; + int32_t lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + pms + OPN->LFO_PM ]; if (lfo_fn_table_index_offset) /* LFO phase modulation active */ { - UINT8 blk; - UINT32 fn; + uint8_t blk; + uint32_t fn; int kc, fc; block_fnum = block_fnum*2 + lfo_fn_table_index_offset; @@ -1295,15 +1295,15 @@ static inline void update_phase_lfo_slot(FM_OPN *OPN, FM_SLOT *SLOT, INT32 pms, static inline void update_phase_lfo_channel(FM_OPN *OPN, FM_CH *CH) { - UINT32 block_fnum = CH->block_fnum; + uint32_t block_fnum = CH->block_fnum; - UINT32 fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; - INT32 lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + CH->pms + OPN->LFO_PM ]; + uint32_t fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; + int32_t lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + CH->pms + OPN->LFO_PM ]; if (lfo_fn_table_index_offset) /* LFO phase modulation active */ { - UINT8 blk; - UINT32 fn; + uint8_t blk; + uint32_t fn; int kc, fc, finc; block_fnum = block_fnum*2 + lfo_fn_table_index_offset; @@ -1348,7 +1348,7 @@ static inline void chan_calc(FM_OPN *OPN, FM_CH *CH, int chnum) { unsigned int eg_out; - UINT32 AM = OPN->LFO_AM >> CH->ams; + uint32_t AM = OPN->LFO_AM >> CH->ams; OPN->m2 = OPN->c1 = OPN->c2 = OPN->mem = 0; @@ -1357,7 +1357,7 @@ static inline void chan_calc(FM_OPN *OPN, FM_CH *CH, int chnum) eg_out = volume_calc(&CH->SLOT[SLOT1]); { - INT32 out = CH->op1_out[0] + CH->op1_out[1]; + int32_t out = CH->op1_out[0] + CH->op1_out[1]; CH->op1_out[0] = CH->op1_out[1]; if( !CH->connect1 ) @@ -1474,7 +1474,7 @@ static void refresh_fc_eg_chan(FM_OPN *OPN, FM_CH *CH ) } /* initialize time tables */ -static void init_timetables( FM_ST *ST , const UINT8 *dttable ) +static void init_timetables( FM_ST *ST , const uint8_t *dttable ) { int i,d; double rate; @@ -1490,7 +1490,7 @@ static void init_timetables( FM_ST *ST , const UINT8 *dttable ) for (i = 0;i <= 31;i++) { rate = ((double)dttable[d*32 + i]) * SIN_LEN * ST->freqbase * (1<dt_tab[d][i] = (INT32) rate; + ST->dt_tab[d][i] = (int32_t) rate; ST->dt_tab[d+4][i] = -ST->dt_tab[d][i]; #if 0 logerror("FM.C: DT [%2i %2i] = %8x \n", d, i, ST->dt_tab[d][i] ); @@ -1596,14 +1596,14 @@ static int init_tables(void) /* build LFO PM modulation table */ for(i = 0; i < 8; i++) /* 8 PM depths */ { - UINT8 fnum; + uint8_t fnum; for (fnum=0; fnum<128; fnum++) /* 7 bits meaningful of F-NUMBER */ { - UINT8 value; - UINT8 step; - UINT32 offset_depth = i; - UINT32 offset_fnum_bit; - UINT32 bit_tmp; + uint8_t value; + uint8_t step; + uint32_t offset_depth = i; + uint32_t offset_fnum_bit; + uint32_t bit_tmp; for (step=0; step<8; step++) { @@ -1653,7 +1653,7 @@ static void FMCloseTable( void ) /* CSM Key Controll */ -static inline void CSMKeyControll(UINT8 type, FM_CH *CH) +static inline void CSMKeyControll(uint8_t type, FM_CH *CH) { /* all key on then off (only for operators which were OFF!) */ if (!CH->SLOT[SLOT1].key) @@ -1756,7 +1756,7 @@ static void OPNSetPres(FM_OPN *OPN, int pres, int timer_prescaler, int SSGpres) { /* freq table for octave 7 */ /* OPN phase increment counter = 20bit */ - OPN->fn_table[i] = (UINT32)( (double)i * 32 * OPN->ST.freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ + OPN->fn_table[i] = (uint32_t)( (double)i * 32 * OPN->ST.freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ #if 0 logerror("FM.C: fn_table[%4i] = %08x (dec=%8i)\n", i, OPN->fn_table[i]>>6,OPN->fn_table[i]>>6 ); @@ -1764,7 +1764,7 @@ static void OPNSetPres(FM_OPN *OPN, int pres, int timer_prescaler, int SSGpres) } /* maximal frequency is required for Phase overflow calculation, register size is 17 bits (Nemesis) */ - OPN->fn_max = (UINT32)( (double)0x20000 * OPN->ST.freqbase * (1<<(FREQ_SH-10)) ); + OPN->fn_max = (uint32_t)( (double)0x20000 * OPN->ST.freqbase * (1<<(FREQ_SH-10)) ); /* LFO freq. table */ for(i = 0; i < 8; i++) @@ -1784,7 +1784,7 @@ static void OPNSetPres(FM_OPN *OPN, int pres, int timer_prescaler, int SSGpres) /* write a OPN mode register 0x20-0x2f */ static void OPNWriteMode(FM_OPN *OPN, int r, int v) { - UINT8 c; + uint8_t c; FM_CH *CH; switch(r) @@ -1836,7 +1836,7 @@ static void OPNWriteReg(FM_OPN *OPN, int r, int v) FM_CH *CH; FM_SLOT *SLOT; - UINT8 c = OPN_CHAN(r); + uint8_t c = OPN_CHAN(r); if (c == 3) return; /* 0xX3,0xX7,0xXB,0xXF */ @@ -1964,8 +1964,8 @@ static void OPNWriteReg(FM_OPN *OPN, int r, int v) { case 0: /* 0xa0-0xa2 : FNUM1 */ { - UINT32 fn = (((UINT32)( (OPN->ST.fn_h)&7))<<8) + v; - UINT8 blk = OPN->ST.fn_h>>3; + uint32_t fn = (((uint32_t)( (OPN->ST.fn_h)&7))<<8) + v; + uint8_t blk = OPN->ST.fn_h>>3; /* keyscale code */ CH->kcode = (blk<<2) | opn_fktable[fn >> 7]; /* phase increment counter */ @@ -1983,8 +1983,8 @@ static void OPNWriteReg(FM_OPN *OPN, int r, int v) case 2: /* 0xa8-0xaa : 3CH FNUM1 */ if(r < 0x100) { - UINT32 fn = (((UINT32)(OPN->SL3.fn_h&7))<<8) + v; - UINT8 blk = OPN->SL3.fn_h>>3; + uint32_t fn = (((uint32_t)(OPN->SL3.fn_h&7))<<8) + v; + uint8_t blk = OPN->SL3.fn_h>>3; /* keyscale code */ OPN->SL3.kcode[c]= (blk<<2) | opn_fktable[fn >> 7]; /* phase increment counter */ @@ -2090,7 +2090,7 @@ static void OPNPrescaler_w(FM_OPN *OPN , int addr, int pre_divider) /* here's the virtual YM2203(OPN) */ struct YM2203 { - UINT8 REGS[256]; /* registers */ + uint8_t REGS[256]; /* registers */ FM_OPN OPN; /* OPN state */ FM_CH CH[3]; /* channel state */ }; @@ -2306,7 +2306,7 @@ void ym2203_shutdown(void *chip) } /* YM2203 I/O interface */ -int ym2203_write(void *chip,int a,UINT8 v) +int ym2203_write(void *chip,int a,uint8_t v) { YM2203 *F2203 = (YM2203 *)chip; FM_OPN *OPN = &F2203->OPN; @@ -2347,11 +2347,11 @@ int ym2203_write(void *chip,int a,UINT8 v) return OPN->ST.irq; } -UINT8 ym2203_read(void *chip,int a) +uint8_t ym2203_read(void *chip,int a) { YM2203 *F2203 = (YM2203 *)chip; int addr = F2203->OPN.ST.address; - UINT8 ret = 0; + uint8_t ret = 0; if( !(a&1) ) { /* status port */ @@ -2394,42 +2394,42 @@ int ym2203_timer_over(void *chip,int c) /* ADPCM type A channel struct */ struct ADPCM_CH { - UINT8 flag; /* port state */ - UINT8 flagMask; /* arrived flag mask */ - UINT8 now_data; /* current ROM data */ - UINT32 now_addr; /* current ROM address */ - UINT32 now_step; - UINT32 step; - UINT32 start; /* sample data start address*/ - UINT32 end; /* sample data end address */ - UINT8 IL; /* Instrument Level */ - INT32 adpcm_acc; /* accumulator */ - INT32 adpcm_step; /* step */ - INT32 adpcm_out; /* (speedup) hiro-shi!! */ - INT8 vol_mul; /* volume in "0.75dB" steps */ - UINT8 vol_shift; /* volume in "-6dB" steps */ - INT32 *pan; /* &out_adpcm[OPN_xxxx] */ + uint8_t flag; /* port state */ + uint8_t flagMask; /* arrived flag mask */ + uint8_t now_data; /* current ROM data */ + uint32_t now_addr; /* current ROM address */ + uint32_t now_step; + uint32_t step; + uint32_t start; /* sample data start address*/ + uint32_t end; /* sample data end address */ + uint8_t IL; /* Instrument Level */ + int32_t adpcm_acc; /* accumulator */ + int32_t adpcm_step; /* step */ + int32_t adpcm_out; /* (speedup) hiro-shi!! */ + int8_t vol_mul; /* volume in "0.75dB" steps */ + uint8_t vol_shift; /* volume in "-6dB" steps */ + int32_t *pan; /* &out_adpcm[OPN_xxxx] */ }; /* here's the virtual YM2610 */ struct YM2610 { - UINT8 REGS[512]; /* registers */ + uint8_t REGS[512]; /* registers */ FM_OPN OPN; /* OPN state */ FM_CH CH[6]; /* channel state */ - UINT8 addr_A1; /* address line A1 */ + uint8_t addr_A1; /* address line A1 */ /* ADPCM-A unit */ - const UINT8 *pcmbuf; /* pcm rom buffer */ - UINT32 pcm_size; /* size of pcm rom */ - UINT8 adpcmTL; /* adpcmA total level */ + const uint8_t *pcmbuf; /* pcm rom buffer */ + uint32_t pcm_size; /* size of pcm rom */ + uint8_t adpcmTL; /* adpcmA total level */ ADPCM_CH adpcm[6]; /* adpcm channels */ - UINT32 adpcmreg[0x30]; /* registers */ - UINT8 adpcm_arrivedEndAddress; + uint32_t adpcmreg[0x30]; /* registers */ + uint8_t adpcm_arrivedEndAddress; YM_DELTAT deltaT; /* Delta-T ADPCM unit */ - UINT8 flagmask; /* YM2608 only */ - UINT8 irqmask; /* YM2608 only */ + uint8_t flagmask; /* YM2608 only */ + uint8_t irqmask; /* YM2608 only */ device_t *device; }; @@ -2481,8 +2481,8 @@ static void Init_ADPCMATable(void) /* ADPCM A (Non control type) : calculate one channel output */ static inline void ADPCMA_calc_chan( YM2610 *F2610, ADPCM_CH *ch ) { - UINT32 step; - UINT8 data; + uint32_t step; + uint8_t data; ch->now_step += ch->step; @@ -2544,7 +2544,7 @@ static inline void ADPCMA_calc_chan( YM2610 *F2610, ADPCM_CH *ch ) static void FM_ADPCMAWrite(YM2610 *F2610,int r,int v) { ADPCM_CH *adpcm = F2610->adpcm; - UINT8 c = r&0x07; + uint8_t c = r&0x07; F2610->adpcmreg[r] = v&0xff; /* stock data */ switch( r ) @@ -2558,7 +2558,7 @@ static void FM_ADPCMAWrite(YM2610 *F2610,int r,int v) if( (v>>c)&1 ) { /**** start adpcm ****/ - adpcm[c].step = (UINT32)((float)(1<OPN.ST.freqbase)/3.0f); + adpcm[c].step = (uint32_t)((float)(1<OPN.ST.freqbase)/3.0f); adpcm[c].now_addr = adpcm[c].start<<1; adpcm[c].now_step = 0; adpcm[c].adpcm_acc = 0; @@ -2737,7 +2737,7 @@ void ym2608_update_one(void *chip, FMSAMPLE **buffer, int length) int i,j; FMSAMPLE *bufL,*bufR; FM_CH *cch[6]; - INT32 *out_fm = OPN->out_fm; + int32_t *out_fm = OPN->out_fm; /* set bufer */ bufL = buffer[0]; @@ -2931,12 +2931,12 @@ static void YM2608_save_state(YM2608 *F2608, device_t *device) } #endif /* _STATE_H */ -static void YM2608_deltat_status_set(void *chip, UINT8 changebits) +static void YM2608_deltat_status_set(void *chip, uint8_t changebits) { YM2608 *F2608 = (YM2608 *)chip; FM_STATUS_SET(&(F2608->OPN.ST), changebits); } -static void YM2608_deltat_status_reset(void *chip, UINT8 changebits) +static void YM2608_deltat_status_reset(void *chip, uint8_t changebits) { YM2608 *F2608 = (YM2608 *)chip; FM_STATUS_RESET(&(F2608->OPN.ST), changebits); @@ -2971,7 +2971,7 @@ void * ym2608_init(void *param, device_t *device, int clock, int rate, F2608->OPN.ST.SSG = ssg; /* DELTA-T */ - F2608->deltaT.memory = (UINT8 *)pcmrom; + F2608->deltaT.memory = (uint8_t *)pcmrom; F2608->deltaT.memory_size = pcmsize; /*F2608->deltaT.write_time = 20.0 / clock;*/ /* a single byte write takes 20 cycles of main clock */ @@ -3054,9 +3054,9 @@ void ym2608_reset_chip(void *chip) for( i = 0; i < 6; i++ ) { if (i<=3) /* channels 0,1,2,3 */ - F2608->adpcm[i].step = (UINT32)((float)(1<OPN.ST.freqbase)/3.0f); + F2608->adpcm[i].step = (uint32_t)((float)(1<OPN.ST.freqbase)/3.0f); else /* channels 4 and 5 work with slower clock */ - F2608->adpcm[i].step = (UINT32)((float)(1<OPN.ST.freqbase)/6.0f); + F2608->adpcm[i].step = (uint32_t)((float)(1<OPN.ST.freqbase)/6.0f); F2608->adpcm[i].start = YM2608_ADPCM_ROM_addr[i*2]; F2608->adpcm[i].end = YM2608_ADPCM_ROM_addr[i*2+1]; @@ -3088,7 +3088,7 @@ void ym2608_reset_chip(void *chip) /* n = number */ /* a = address */ /* v = value */ -int ym2608_write(void *chip, int a,UINT8 v) +int ym2608_write(void *chip, int a,uint8_t v) { YM2608 *F2608 = (YM2608 *)chip; FM_OPN *OPN = &F2608->OPN; @@ -3184,11 +3184,11 @@ int ym2608_write(void *chip, int a,UINT8 v) return OPN->ST.irq; } -UINT8 ym2608_read(void *chip,int a) +uint8_t ym2608_read(void *chip,int a) { YM2608 *F2608 = (YM2608 *)chip; int addr = F2608->OPN.ST.address; - UINT8 ret = 0; + uint8_t ret = 0; switch( a&3 ) { @@ -3278,7 +3278,7 @@ void ym2610_update_one(void *chip, FMSAMPLE **buffer, int length) int i,j; FMSAMPLE *bufL,*bufR; FM_CH *cch[4]; - INT32 *out_fm = OPN->out_fm; + int32_t *out_fm = OPN->out_fm; /* buffer setup */ bufL = buffer[0]; @@ -3414,7 +3414,7 @@ void ym2610b_update_one(void *chip, FMSAMPLE **buffer, int length) int i,j; FMSAMPLE *bufL,*bufR; FM_CH *cch[6]; - INT32 *out_fm = OPN->out_fm; + int32_t *out_fm = OPN->out_fm; /* buffer setup */ bufL = buffer[0]; @@ -3612,12 +3612,12 @@ static void YM2610_save_state(YM2610 *F2610, device_t *device) } #endif /* _STATE_H */ -static void YM2610_deltat_status_set(void *chip, UINT8 changebits) +static void YM2610_deltat_status_set(void *chip, uint8_t changebits) { YM2610 *F2610 = (YM2610 *)chip; F2610->adpcm_arrivedEndAddress |= changebits; } -static void YM2610_deltat_status_reset(void *chip, UINT8 changebits) +static void YM2610_deltat_status_reset(void *chip, uint8_t changebits) { YM2610 *F2610 = (YM2610 *)chip; F2610->adpcm_arrivedEndAddress &= (~changebits); @@ -3652,10 +3652,10 @@ void *ym2610_init(void *param, device_t *device, int clock, int rate, F2610->OPN.ST.IRQ_Handler = IRQHandler; F2610->OPN.ST.SSG = ssg; /* ADPCM */ - F2610->pcmbuf = (const UINT8 *)pcmroma; + F2610->pcmbuf = (const uint8_t *)pcmroma; F2610->pcm_size = pcmsizea; /* DELTA-T */ - F2610->deltaT.memory = (UINT8 *)pcmromb; + F2610->deltaT.memory = (uint8_t *)pcmromb; F2610->deltaT.memory_size = pcmsizeb; F2610->deltaT.status_set_handler = YM2610_deltat_status_set; @@ -3691,18 +3691,18 @@ void ym2610_reset_chip(void *chip) std::string name(dev->tag()); /* setup PCM buffers again */ - F2610->pcmbuf = (const UINT8 *)dev->machine().root_device().memregion(name.c_str())->base(); + F2610->pcmbuf = (const uint8_t *)dev->machine().root_device().memregion(name.c_str())->base(); F2610->pcm_size = dev->machine().root_device().memregion(name.c_str())->bytes(); name.append(".deltat"); memory_region *deltat_region = dev->machine().root_device().memregion(name.c_str()); F2610->deltaT.memory = nullptr; if (deltat_region != nullptr) { - F2610->deltaT.memory = (UINT8 *)dev->machine().root_device().memregion(name.c_str())->base(); + F2610->deltaT.memory = (uint8_t *)dev->machine().root_device().memregion(name.c_str())->base(); } if(F2610->deltaT.memory == nullptr) { - F2610->deltaT.memory = (UINT8*)F2610->pcmbuf; + F2610->deltaT.memory = (uint8_t*)F2610->pcmbuf; F2610->deltaT.memory_size = F2610->pcm_size; } else @@ -3740,7 +3740,7 @@ void ym2610_reset_chip(void *chip) /**** ADPCM work initial ****/ for( i = 0; i < 6 ; i++ ) { - F2610->adpcm[i].step = (UINT32)((float)(1<OPN.ST.freqbase)/3.0f); + F2610->adpcm[i].step = (uint32_t)((float)(1<OPN.ST.freqbase)/3.0f); F2610->adpcm[i].now_addr = 0; F2610->adpcm[i].now_step = 0; F2610->adpcm[i].start = 0; @@ -3770,7 +3770,7 @@ void ym2610_reset_chip(void *chip) /* n = number */ /* a = address */ /* v = value */ -int ym2610_write(void *chip, int a, UINT8 v) +int ym2610_write(void *chip, int a, uint8_t v) { YM2610 *F2610 = (YM2610 *)chip; FM_OPN *OPN = &F2610->OPN; @@ -3823,7 +3823,7 @@ int ym2610_write(void *chip, int a, UINT8 v) case 0x1c: /* FLAG CONTROL : Extend Status Clear/Mask */ { - UINT8 statusmask = ~v; + uint8_t statusmask = ~v; /* set arrived flag mask */ for(ch=0;ch<6;ch++) F2610->adpcm[ch].flagMask = statusmask&(1<ST.irq; } -UINT8 ym2610_read(void *chip,int a) +uint8_t ym2610_read(void *chip,int a) { YM2610 *F2610 = (YM2610 *)chip; int addr = F2610->OPN.ST.address; - UINT8 ret = 0; + uint8_t ret = 0; switch( a&3) { diff --git a/src/devices/sound/fm.h b/src/devices/sound/fm.h index c558331168b..8db59a3642f 100644 --- a/src/devices/sound/fm.h +++ b/src/devices/sound/fm.h @@ -77,7 +77,7 @@ struct ssg_callbacks typedef stream_sample_t FMSAMPLE; /* #if (FM_SAMPLE_BITS==16) -typedef INT16 FMSAMPLE; +typedef int16_t FMSAMPLE; #endif #if (FM_SAMPLE_BITS==8) typedef unsigned char FMSAMPLE; diff --git a/src/devices/sound/fm2612.cpp b/src/devices/sound/fm2612.cpp index 22c1cad0f3c..40a7f317922 100644 --- a/src/devices/sound/fm2612.cpp +++ b/src/devices/sound/fm2612.cpp @@ -209,8 +209,8 @@ static unsigned int sin_tab[SIN_LEN]; /* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/ /* attenuation value (10 bits) = (SL << 2) << 3 */ -#define SC(db) (UINT32) ( db * (4.0/ENV_STEP) ) -static const UINT32 sl_table[16]={ +#define SC(db) (uint32_t) ( db * (4.0/ENV_STEP) ) +static const uint32_t sl_table[16]={ SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7), SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31) }; @@ -218,7 +218,7 @@ static const UINT32 sl_table[16]={ #define RATE_STEPS (8) -static const UINT8 eg_inc[19*RATE_STEPS]={ +static const uint8_t eg_inc[19*RATE_STEPS]={ /*cycle:0 1 2 3 4 5 6 7*/ /* 0 */ 0,1, 0,1, 0,1, 0,1, /* rates 00..11 0 (increment by 0 or 1) */ @@ -250,7 +250,7 @@ static const UINT8 eg_inc[19*RATE_STEPS]={ #define O(a) (a*RATE_STEPS) /*note that there is no O(17) in this table - it's directly in the code */ -static const UINT8 eg_rate_select2612[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ +static const uint8_t eg_rate_select2612[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ /* 32 infinite time rates (same as Rate 0) */ O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), @@ -302,7 +302,7 @@ O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16) /*mask 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0, 0, 0, 0, 0 */ #define O(a) (a*1) -static const UINT8 eg_rate_shift[32+64+32]={ /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */ +static const uint8_t eg_rate_shift[32+64+32]={ /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */ /* 32 infinite time rates */ /* O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), @@ -350,7 +350,7 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0) }; #undef O -static const UINT8 dt_tab[4 * 32]={ +static const uint8_t dt_tab[4 * 32]={ /* this is YM2151 and YM2612 phase increment data (in 10.10 fixed point format)*/ /* FD=0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -369,12 +369,12 @@ static const UINT8 dt_tab[4 * 32]={ /* OPN key frequency number -> key code follow table */ /* fnum higher 4bit -> keycode lower 2bit */ -static const UINT8 opn_fktable[16] = {0,0,0,0,0,0,0,1,2,3,3,3,3,3,3,3}; +static const uint8_t opn_fktable[16] = {0,0,0,0,0,0,0,1,2,3,3,3,3,3,3,3}; /* 8 LFO speed parameters */ /* each value represents number of samples that one LFO level will last for */ -static const UINT32 lfo_samples_per_step[8] = {108, 77, 71, 67, 62, 44, 8, 5}; +static const uint32_t lfo_samples_per_step[8] = {108, 77, 71, 67, 62, 44, 8, 5}; @@ -395,7 +395,7 @@ static const UINT32 lfo_samples_per_step[8] = {108, 77, 71, 67, 62, 44, 8, 5}; 1 for 5.9 dB 0 for 11.8 dB */ -static const UINT8 lfo_ams_depth_shift[4] = {8, 3, 1, 0}; +static const uint8_t lfo_ams_depth_shift[4] = {8, 3, 1, 0}; @@ -419,7 +419,7 @@ static const UINT8 lfo_ams_depth_shift[4] = {8, 3, 1, 0}; samples (32*432=13824; 32 because we store only a quarter of whole waveform in the table below) */ -static const UINT8 lfo_pm_output[7*8][8]={ /* 7 bits meaningful (of F-NUMBER), 8 LFO output levels per one depth (out of 32), 8 LFO depths */ +static const uint8_t lfo_pm_output[7*8][8]={ /* 7 bits meaningful (of F-NUMBER), 8 LFO output levels per one depth (out of 32), 8 LFO depths */ /* FNUM BIT 4: 000 0001xxxx */ /* DEPTH 0 */ {0, 0, 0, 0, 0, 0, 0, 0}, /* DEPTH 1 */ {0, 0, 0, 0, 0, 0, 0, 0}, @@ -493,7 +493,7 @@ static const UINT8 lfo_pm_output[7*8][8]={ /* 7 bits meaningful (of F-NUMBER), 8 }; /* all 128 LFO PM waveforms */ -static INT32 lfo_pm_table[128*8*32]; /* 128 combinations of 7 bits meaningful (of F-NUMBER), 8 LFO depths, 32 LFO output levels per one depth */ +static int32_t lfo_pm_table[128*8*32]; /* 128 combinations of 7 bits meaningful (of F-NUMBER), 8 LFO depths, 32 LFO output levels per one depth */ /* register number to channel number , slot offset */ #define OPN_CHAN(N) (N&3) @@ -538,42 +538,42 @@ static FILE *sample[1]; /* struct describing a single operator (SLOT) */ struct fm2612_FM_SLOT { - INT32 *DT; /* detune :dt_tab[DT] */ - UINT8 KSR; /* key scale rate :3-KSR */ - UINT32 ar; /* attack rate */ - UINT32 d1r; /* decay rate */ - UINT32 d2r; /* sustain rate */ - UINT32 rr; /* release rate */ - UINT8 ksr; /* key scale rate :kcode>>(3-KSR) */ - UINT32 mul; /* multiple :ML_TABLE[ML] */ + int32_t *DT; /* detune :dt_tab[DT] */ + uint8_t KSR; /* key scale rate :3-KSR */ + uint32_t ar; /* attack rate */ + uint32_t d1r; /* decay rate */ + uint32_t d2r; /* sustain rate */ + uint32_t rr; /* release rate */ + uint8_t ksr; /* key scale rate :kcode>>(3-KSR) */ + uint32_t mul; /* multiple :ML_TABLE[ML] */ /* Phase Generator */ - UINT32 phase; /* phase counter */ - INT32 Incr; /* phase step */ + uint32_t phase; /* phase counter */ + int32_t Incr; /* phase step */ /* Envelope Generator */ - UINT8 state; /* phase type */ - UINT32 tl; /* total level: TL << 3 */ - INT32 volume; /* envelope counter */ - UINT32 sl; /* sustain level:sl_table[SL] */ - UINT32 vol_out; /* current output from EG circuit (without AM from LFO) */ - - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT8 eg_sh_d1r; /* (decay state) */ - UINT8 eg_sel_d1r; /* (decay state) */ - UINT8 eg_sh_d2r; /* (sustain state) */ - UINT8 eg_sel_d2r; /* (sustain state) */ - UINT8 eg_sh_rr; /* (release state) */ - UINT8 eg_sel_rr; /* (release state) */ - - UINT8 ssg; /* SSG-EG waveform */ - UINT8 ssgn; /* SSG-EG negated output */ - - UINT8 key; /* 0=last key was KEY OFF, 1=KEY ON */ + uint8_t state; /* phase type */ + uint32_t tl; /* total level: TL << 3 */ + int32_t volume; /* envelope counter */ + uint32_t sl; /* sustain level:sl_table[SL] */ + uint32_t vol_out; /* current output from EG circuit (without AM from LFO) */ + + uint8_t eg_sh_ar; /* (attack state) */ + uint8_t eg_sel_ar; /* (attack state) */ + uint8_t eg_sh_d1r; /* (decay state) */ + uint8_t eg_sel_d1r; /* (decay state) */ + uint8_t eg_sh_d2r; /* (sustain state) */ + uint8_t eg_sel_d2r; /* (sustain state) */ + uint8_t eg_sh_rr; /* (release state) */ + uint8_t eg_sel_rr; /* (release state) */ + + uint8_t ssg; /* SSG-EG waveform */ + uint8_t ssgn; /* SSG-EG negated output */ + + uint8_t key; /* 0=last key was KEY OFF, 1=KEY ON */ /* LFO */ - UINT32 AMmask; /* AM enable flag */ + uint32_t AMmask; /* AM enable flag */ }; @@ -581,24 +581,24 @@ struct fm2612_FM_CH { fm2612_FM_SLOT SLOT[4]; /* four SLOTs (operators) */ - UINT8 ALGO; /* algorithm */ - UINT8 FB; /* feedback shift */ - INT32 op1_out[2]; /* op1 output for feedback */ + uint8_t ALGO; /* algorithm */ + uint8_t FB; /* feedback shift */ + int32_t op1_out[2]; /* op1 output for feedback */ - INT32 *connect1; /* SLOT1 output pointer */ - INT32 *connect3; /* SLOT3 output pointer */ - INT32 *connect2; /* SLOT2 output pointer */ - INT32 *connect4; /* SLOT4 output pointer */ + int32_t *connect1; /* SLOT1 output pointer */ + int32_t *connect3; /* SLOT3 output pointer */ + int32_t *connect2; /* SLOT2 output pointer */ + int32_t *connect4; /* SLOT4 output pointer */ - INT32 *mem_connect;/* where to put the delayed sample (MEM) */ - INT32 mem_value; /* delayed sample (MEM) value */ + int32_t *mem_connect;/* where to put the delayed sample (MEM) */ + int32_t mem_value; /* delayed sample (MEM) value */ - INT32 pms; /* channel PMS */ - UINT8 ams; /* channel AMS */ + int32_t pms; /* channel PMS */ + uint8_t ams; /* channel AMS */ - UINT32 fc; /* fnum,blk:adjusted to sample rate */ - UINT8 kcode; /* key code: */ - UINT32 block_fnum; /* current blk/fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ + uint32_t fc; /* fnum,blk:adjusted to sample rate */ + uint8_t kcode; /* key code: */ + uint32_t block_fnum; /* current blk/fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ }; @@ -608,24 +608,24 @@ struct fm2612_FM_ST void * param; /* this chip parameter */ double freqbase; /* frequency base */ int timer_prescaler; /* timer prescaler */ - UINT8 irq; /* interrupt level */ - UINT8 irqmask; /* irq mask */ + uint8_t irq; /* interrupt level */ + uint8_t irqmask; /* irq mask */ #if FM_BUSY_FLAG_SUPPORT TIME_TYPE busy_expiry_time; /* expiry time of the busy status */ #endif - UINT32 clock; /* master clock (Hz) */ - UINT32 rate; /* sampling rate (Hz) */ - UINT16 address; /* address register */ - UINT8 status; /* status flag */ - UINT32 mode; /* mode CSM / 3SLOT */ - UINT8 fn_h; /* freq latch */ - UINT8 prescaler_sel; /* prescaler selector */ - INT32 TA; /* timer a */ - INT32 TAC; /* timer a counter */ - UINT8 TB; /* timer b */ - INT32 TBC; /* timer b counter */ + uint32_t clock; /* master clock (Hz) */ + uint32_t rate; /* sampling rate (Hz) */ + uint16_t address; /* address register */ + uint8_t status; /* status flag */ + uint32_t mode; /* mode CSM / 3SLOT */ + uint8_t fn_h; /* freq latch */ + uint8_t prescaler_sel; /* prescaler selector */ + int32_t TA; /* timer a */ + int32_t TAC; /* timer a counter */ + uint8_t TB; /* timer b */ + int32_t TBC; /* timer b counter */ /* local time tables */ - INT32 dt_tab[8][32]; /* DeTune table */ + int32_t dt_tab[8][32]; /* DeTune table */ /* Extention Timer and IRQ handler */ FM_TIMERHANDLER timer_handler; FM_IRQHANDLER IRQ_Handler; @@ -641,58 +641,58 @@ struct fm2612_FM_ST /* OPN 3slot struct */ struct fm2612_FM_3SLOT { - UINT32 fc[3]; /* fnum3,blk3: calculated */ - UINT8 fn_h; /* freq3 latch */ - UINT8 kcode[3]; /* key code */ - UINT32 block_fnum[3]; /* current fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ - UINT8 key_csm; /* CSM mode Key-ON flag */ + uint32_t fc[3]; /* fnum3,blk3: calculated */ + uint8_t fn_h; /* freq3 latch */ + uint8_t kcode[3]; /* key code */ + uint32_t block_fnum[3]; /* current fnum value for this slot (can be different betweeen slots of one channel in 3slot mode) */ + uint8_t key_csm; /* CSM mode Key-ON flag */ }; /* OPN/A/B common state */ struct fm2612_FM_OPN { - UINT8 type; /* chip type */ + uint8_t type; /* chip type */ fm2612_FM_ST ST; /* general state */ fm2612_FM_3SLOT SL3; /* 3 slot mode state */ fm2612_FM_CH *P_CH; /* pointer of CH */ unsigned int pan[6*2]; /* fm channels output masks (0xffffffff = enable) */ - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/144/3 */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow;/* envelope generator timer overlfows every 3 samples (on real chip) */ + uint32_t eg_cnt; /* global envelope generator counter */ + uint32_t eg_timer; /* global envelope generator counter works at frequency = chipclock/144/3 */ + uint32_t eg_timer_add; /* step of eg_timer */ + uint32_t eg_timer_overflow;/* envelope generator timer overlfows every 3 samples (on real chip) */ /* there are 2048 FNUMs that can be generated using FNUM/BLK registers but LFO works with one more bit of a precision so we really need 4096 elements */ - UINT32 fn_table[4096]; /* fnumber->increment counter */ - UINT32 fn_max; /* maximal phase increment (used for phase overflow) */ + uint32_t fn_table[4096]; /* fnumber->increment counter */ + uint32_t fn_max; /* maximal phase increment (used for phase overflow) */ /* LFO */ - UINT8 lfo_cnt; /* current LFO phase (out of 128) */ - UINT32 lfo_timer; /* current LFO phase runs at LFO frequency */ - UINT32 lfo_timer_add; /* step of lfo_timer */ - UINT32 lfo_timer_overflow; /* LFO timer overflows every N samples (depends on LFO frequency) */ - UINT32 LFO_AM; /* current LFO AM step */ - UINT32 LFO_PM; /* current LFO PM step */ + uint8_t lfo_cnt; /* current LFO phase (out of 128) */ + uint32_t lfo_timer; /* current LFO phase runs at LFO frequency */ + uint32_t lfo_timer_add; /* step of lfo_timer */ + uint32_t lfo_timer_overflow; /* LFO timer overflows every N samples (depends on LFO frequency) */ + uint32_t LFO_AM; /* current LFO AM step */ + uint32_t LFO_PM; /* current LFO PM step */ - INT32 m2,c1,c2; /* Phase Modulation input for operators 2,3,4 */ - INT32 mem; /* one sample delay memory */ - INT32 out_fm[8]; /* outputs of working channels */ + int32_t m2,c1,c2; /* Phase Modulation input for operators 2,3,4 */ + int32_t mem; /* one sample delay memory */ + int32_t out_fm[8]; /* outputs of working channels */ }; /* here's the virtual YM2612 */ struct YM2612 { - UINT8 REGS[512]; /* registers */ + uint8_t REGS[512]; /* registers */ fm2612_FM_OPN OPN; /* OPN state */ fm2612_FM_CH CH[6]; /* channel state */ - UINT8 addr_A1; /* address line A1 */ + uint8_t addr_A1; /* address line A1 */ /* dac output (YM2612) */ int dacen; - INT32 dacout; + int32_t dacout; device_t *device; }; @@ -775,9 +775,9 @@ static inline void FM_KEYON(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) /* recalculate EG output */ if ((SLOT->ssg&0x08) && (SLOT->ssgn ^ (SLOT->ssg&0x04))) - SLOT->vol_out = ((UINT32)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; + SLOT->vol_out = ((uint32_t)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; else - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } SLOT->key = 1; @@ -808,7 +808,7 @@ static inline void FM_KEYOFF(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) } /* recalculate EG output */ - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } } } @@ -843,9 +843,9 @@ static inline void FM_KEYON_CSM(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH , int s ) /* recalculate EG output */ if ((SLOT->ssg&0x08) && (SLOT->ssgn ^ (SLOT->ssg&0x04))) - SLOT->vol_out = ((UINT32)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; + SLOT->vol_out = ((uint32_t)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; else - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } } @@ -873,7 +873,7 @@ static inline void FM_KEYOFF_CSM(fm2612_FM_CH *CH , int s ) } /* recalculate EG output */ - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } } } @@ -1005,7 +1005,7 @@ static inline void TimerBOver(fm2612_FM_ST *ST) #if FM_BUSY_FLAG_SUPPORT #define FM_BUSY_CLEAR(ST) ((ST)->busy_expiry_time = UNDEFINED_TIME) -static inline UINT8 FM_STATUS_FLAG(fm2612_FM_ST *ST) +static inline uint8_t FM_STATUS_FLAG(fm2612_FM_ST *ST) { if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 ) { @@ -1033,13 +1033,13 @@ static inline void FM_BUSY_SET(fm2612_FM_ST *ST,int busyclock ) /* set algorithm connection */ static void setup_connection(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH, int ch) { - INT32 *carrier = &OPN->out_fm[ch]; + int32_t *carrier = &OPN->out_fm[ch]; - INT32 **om1 = &CH->connect1; - INT32 **om2 = &CH->connect3; - INT32 **oc1 = &CH->connect2; + int32_t **om1 = &CH->connect1; + int32_t **om2 = &CH->connect3; + int32_t **oc1 = &CH->connect2; - INT32 **memc = &CH->mem_connect; + int32_t **memc = &CH->mem_connect; switch( CH->ALGO ) { @@ -1133,15 +1133,15 @@ static inline void set_tl(fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT , int v) /* recalculate EG output */ if ((SLOT->ssg&0x08) && (SLOT->ssgn ^ (SLOT->ssg&0x04)) && (SLOT->state > EG_REL)) - SLOT->vol_out = ((UINT32)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; + SLOT->vol_out = ((uint32_t)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; else - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } /* set attack rate & key scale */ -static inline void set_ar_ksr(UINT8 type, fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT,int v) +static inline void set_ar_ksr(uint8_t type, fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT,int v) { - UINT8 old_KSR = SLOT->KSR; + uint8_t old_KSR = SLOT->KSR; SLOT->ar = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1168,7 +1168,7 @@ static inline void set_ar_ksr(UINT8 type, fm2612_FM_CH *CH,fm2612_FM_SLOT *SLOT, } /* set decay rate */ -static inline void set_dr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) +static inline void set_dr(uint8_t type, fm2612_FM_SLOT *SLOT,int v) { SLOT->d1r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1177,7 +1177,7 @@ static inline void set_dr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) } /* set sustain rate */ -static inline void set_sr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) +static inline void set_sr(uint8_t type, fm2612_FM_SLOT *SLOT,int v) { SLOT->d2r = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -1186,12 +1186,12 @@ static inline void set_sr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) } /* set release rate */ -static inline void set_sl_rr(UINT8 type, fm2612_FM_SLOT *SLOT,int v) +static inline void set_sl_rr(uint8_t type, fm2612_FM_SLOT *SLOT,int v) { SLOT->sl = sl_table[ v>>4 ]; /* check EG state changes */ - if ((SLOT->state == EG_DEC) && (SLOT->volume >= (INT32)(SLOT->sl))) + if ((SLOT->state == EG_DEC) && (SLOT->volume >= (int32_t)(SLOT->sl))) SLOT->state = EG_SUS; SLOT->rr = 34 + ((v&0x0f)<<2); @@ -1254,9 +1254,9 @@ static void advance_eg_channel(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT) /* recalculate EG output */ if ((SLOT->ssg&0x08) && (SLOT->ssgn ^ (SLOT->ssg&0x04))) /* SSG-EG Output Inversion */ - SLOT->vol_out = ((UINT32)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; + SLOT->vol_out = ((uint32_t)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; else - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } break; @@ -1273,9 +1273,9 @@ static void advance_eg_channel(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT) /* recalculate EG output */ if (SLOT->ssgn ^ (SLOT->ssg&0x04)) /* SSG-EG Output Inversion */ - SLOT->vol_out = ((UINT32)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; + SLOT->vol_out = ((uint32_t)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; else - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } } @@ -1285,11 +1285,11 @@ static void advance_eg_channel(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT) SLOT->volume += eg_inc[SLOT->eg_sel_d1r + ((OPN->eg_cnt>>SLOT->eg_sh_d1r)&7)]; /* recalculate EG output */ - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } /* check phase transition*/ - if (SLOT->volume >= (INT32)(SLOT->sl)) + if (SLOT->volume >= (int32_t)(SLOT->sl)) SLOT->state = EG_SUS; } break; @@ -1307,9 +1307,9 @@ static void advance_eg_channel(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT) /* recalculate EG output */ if (SLOT->ssgn ^ (SLOT->ssg&0x04)) /* SSG-EG Output Inversion */ - SLOT->vol_out = ((UINT32)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; + SLOT->vol_out = ((uint32_t)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; else - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } } else @@ -1323,7 +1323,7 @@ static void advance_eg_channel(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT) /* do not change SLOT->state (verified on real chip) */ /* recalculate EG output */ - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } } break; @@ -1358,13 +1358,13 @@ static void advance_eg_channel(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT) } /* recalculate EG output */ - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } break; } - out = ((UINT32)SLOT->volume); + out = ((uint32_t)SLOT->volume); /* negate output (changes come from alternate bit, init comes from attack bit) */ if ((SLOT->ssg&0x08) && (SLOT->ssgn&2) && (SLOT->state > EG_REL)) @@ -1430,9 +1430,9 @@ static void update_ssg_eg_channel(fm2612_FM_SLOT *SLOT) /* recalculate EG output */ if (SLOT->ssgn ^ (SLOT->ssg&0x04)) - SLOT->vol_out = ((UINT32)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; + SLOT->vol_out = ((uint32_t)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; else - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; } /* next slot */ @@ -1442,17 +1442,17 @@ static void update_ssg_eg_channel(fm2612_FM_SLOT *SLOT) } -static inline void update_phase_lfo_slot(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT, INT32 pms, UINT32 block_fnum) +static inline void update_phase_lfo_slot(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLOT, int32_t pms, uint32_t block_fnum) { - UINT32 fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; - INT32 lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + pms + OPN->LFO_PM ]; + uint32_t fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; + int32_t lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + pms + OPN->LFO_PM ]; block_fnum = block_fnum*2 + lfo_fn_table_index_offset; if (lfo_fn_table_index_offset) /* LFO phase modulation active */ { - UINT8 blk = (block_fnum&0x7000) >> 12; - UINT32 fn = block_fnum & 0xfff; + uint8_t blk = (block_fnum&0x7000) >> 12; + uint32_t fn = block_fnum & 0xfff; /* recalculate keyscale code */ int kc = (blk<<2) | opn_fktable[(fn >> 7) & 0xf]; @@ -1474,17 +1474,17 @@ static inline void update_phase_lfo_slot(fm2612_FM_OPN *OPN, fm2612_FM_SLOT *SLO static inline void update_phase_lfo_channel(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH) { - UINT32 block_fnum = CH->block_fnum; + uint32_t block_fnum = CH->block_fnum; - UINT32 fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; - INT32 lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + CH->pms + OPN->LFO_PM ]; + uint32_t fnum_lfo = ((block_fnum & 0x7f0) >> 4) * 32 * 8; + int32_t lfo_fn_table_index_offset = lfo_pm_table[ fnum_lfo + CH->pms + OPN->LFO_PM ]; block_fnum = block_fnum*2 + lfo_fn_table_index_offset; if (lfo_fn_table_index_offset) /* LFO phase modulation active */ { - UINT8 blk = (block_fnum&0x7000) >> 12; - UINT32 fn = block_fnum & 0xfff; + uint8_t blk = (block_fnum&0x7000) >> 12; + uint32_t fn = block_fnum & 0xfff; /* recalculate keyscale code */ int kc = (blk<<2) | opn_fktable[(fn >> 7) & 0xf]; @@ -1574,9 +1574,9 @@ static void refresh_fc_eg_chan(fm2612_FM_OPN *OPN, fm2612_FM_CH *CH ) #define volume_calc(OP) ((OP)->vol_out + (AM & (OP)->AMmask)) -static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm) +static inline signed int op_calc(uint32_t phase, unsigned int env, signed int pm) { - UINT32 p; + uint32_t p; p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + (pm<<15))) >> FREQ_SH ) & SIN_MASK ]; @@ -1585,9 +1585,9 @@ static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm) return tl_tab[p]; } -static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) +static inline signed int op_calc1(uint32_t phase, unsigned int env, signed int pm) { - UINT32 p; + uint32_t p; p = (env<<3) + sin_tab[ ( ((signed int)((phase & ~FREQ_MASK) + pm )) >> FREQ_SH ) & SIN_MASK ]; @@ -1598,7 +1598,7 @@ static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm) static inline void chan_calc(YM2612 *F2612, fm2612_FM_OPN *OPN, fm2612_FM_CH *CH) { - UINT32 AM = OPN->LFO_AM >> CH->ams; + uint32_t AM = OPN->LFO_AM >> CH->ams; unsigned int eg_out = volume_calc(&CH->SLOT[SLOT1]); OPN->m2 = OPN->c1 = OPN->c2 = OPN->mem = 0; @@ -1606,7 +1606,7 @@ static inline void chan_calc(YM2612 *F2612, fm2612_FM_OPN *OPN, fm2612_FM_CH *CH *CH->mem_connect = CH->mem_value; /* restore delayed sample (MEM) value to m2 or c2 */ { - INT32 out = CH->op1_out[0] + CH->op1_out[1]; + int32_t out = CH->op1_out[0] + CH->op1_out[1]; CH->op1_out[0] = CH->op1_out[1]; if( !CH->connect1 ) @@ -1734,7 +1734,7 @@ static void FMsave_state_st(device_t *device,fm2612_FM_ST *ST) /* write a OPN mode register 0x20-0x2f */ static void OPNWriteMode(fm2612_FM_OPN *OPN, int r, int v) { - UINT8 c; + uint8_t c; fm2612_FM_CH *CH; switch(r) @@ -1788,7 +1788,7 @@ static void OPNWriteReg(fm2612_FM_OPN *OPN, int r, int v) fm2612_FM_CH *CH; fm2612_FM_SLOT *SLOT; - UINT8 c = OPN_CHAN(r); + uint8_t c = OPN_CHAN(r); if (c == 3) return; /* 0xX3,0xX7,0xXB,0xXF */ @@ -1834,9 +1834,9 @@ static void OPNWriteReg(fm2612_FM_OPN *OPN, int r, int v) /* recalculate EG output */ if ((SLOT->ssg&0x08) && (SLOT->ssgn ^ (SLOT->ssg&0x04)) && (SLOT->state > EG_REL)) - SLOT->vol_out = ((UINT32)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; + SLOT->vol_out = ((uint32_t)(0x200 - SLOT->volume) & MAX_ATT_INDEX) + SLOT->tl; else - SLOT->vol_out = (UINT32)SLOT->volume + SLOT->tl; + SLOT->vol_out = (uint32_t)SLOT->volume + SLOT->tl; /* SSG-EG envelope shapes : @@ -1920,8 +1920,8 @@ static void OPNWriteReg(fm2612_FM_OPN *OPN, int r, int v) { case 0: /* 0xa0-0xa2 : FNUM1 */ { - UINT32 fn = (((UINT32)( (OPN->ST.fn_h)&7))<<8) + v; - UINT8 blk = OPN->ST.fn_h>>3; + uint32_t fn = (((uint32_t)( (OPN->ST.fn_h)&7))<<8) + v; + uint8_t blk = OPN->ST.fn_h>>3; /* keyscale code */ CH->kcode = (blk<<2) | opn_fktable[(fn >> 7) & 0xf]; /* phase increment counter */ @@ -1939,8 +1939,8 @@ static void OPNWriteReg(fm2612_FM_OPN *OPN, int r, int v) case 2: /* 0xa8-0xaa : 3CH FNUM1 */ if(r < 0x100) { - UINT32 fn = (((UINT32)(OPN->SL3.fn_h&7))<<8) + v; - UINT8 blk = OPN->SL3.fn_h>>3; + uint32_t fn = (((uint32_t)(OPN->SL3.fn_h&7))<<8) + v; + uint8_t blk = OPN->SL3.fn_h>>3; /* keyscale code */ OPN->SL3.kcode[c]= (blk<<2) | opn_fktable[(fn >> 7) & 0xf]; /* phase increment counter */ @@ -1999,7 +1999,7 @@ static void init_timetables(fm2612_FM_OPN *OPN, double freqbase) for (i = 0;i <= 31;i++) { rate = ((double)dt_tab[d*32 + i]) * freqbase * (1<<(FREQ_SH-10)); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ - OPN->ST.dt_tab[d][i] = (INT32) rate; + OPN->ST.dt_tab[d][i] = (int32_t) rate; OPN->ST.dt_tab[d+4][i] = -OPN->ST.dt_tab[d][i]; } } @@ -2015,11 +2015,11 @@ static void init_timetables(fm2612_FM_OPN *OPN, double freqbase) /* where sample clock is M/144 */ /* this means the increment value for one clock sample is FNUM * 2^(B-1) = FNUM * 64 for octave 7 */ /* we also need to handle the ratio between the chip frequency and the emulated frequency (can be 1.0) */ - OPN->fn_table[i] = (UINT32)( (double)i * 32 * freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ + OPN->fn_table[i] = (uint32_t)( (double)i * 32 * freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ } /* maximal frequency is required for Phase overflow calculation, register size is 17 bits (Nemesis) */ - OPN->fn_max = (UINT32)( (double)0x20000 * freqbase * (1<<(FREQ_SH-10)) ); + OPN->fn_max = (uint32_t)( (double)0x20000 * freqbase * (1<<(FREQ_SH-10)) ); } /* prescaler set (and make time tables) */ @@ -2029,11 +2029,11 @@ static void OPNSetPres(fm2612_FM_OPN *OPN, int pres, int timer_prescaler, int SS OPN->ST.freqbase = (OPN->ST.rate) ? ((double)OPN->ST.clock / OPN->ST.rate) / pres : 0; /* EG is updated every 3 samples */ - OPN->eg_timer_add = (UINT32)((1<ST.freqbase); + OPN->eg_timer_add = (uint32_t)((1<ST.freqbase); OPN->eg_timer_overflow = ( 3 ) * (1<lfo_timer_add = (UINT32)((1<ST.freqbase); + OPN->lfo_timer_add = (uint32_t)((1<ST.freqbase); /* Timer base time */ OPN->ST.timer_prescaler = timer_prescaler; @@ -2132,14 +2132,14 @@ static void init_tables(void) /* build LFO PM modulation table */ for(i = 0; i < 8; i++) /* 8 PM depths */ { - UINT8 fnum; + uint8_t fnum; for (fnum=0; fnum<128; fnum++) /* 7 bits meaningful of F-NUMBER */ { - UINT8 value; - UINT8 step; - UINT32 offset_depth = i; - UINT32 offset_fnum_bit; - UINT32 bit_tmp; + uint8_t value; + uint8_t step; + uint32_t offset_depth = i; + uint32_t offset_fnum_bit; + uint32_t bit_tmp; for (step=0; step<8; step++) { @@ -2179,7 +2179,7 @@ void ym2612_update_one(void *chip, FMSAMPLE **buffer, int length) { YM2612 *F2612 = (YM2612 *)chip; fm2612_FM_OPN *OPN = &F2612->OPN; - INT32 *out_fm = OPN->out_fm; + int32_t *out_fm = OPN->out_fm; int i; FMSAMPLE *bufL,*bufR; fm2612_FM_CH *cch[6]; @@ -2463,7 +2463,7 @@ void ym2612_reset_chip(void *chip) /* n = number */ /* a = address */ /* v = value */ -int ym2612_write(void *chip, int a, UINT8 v) +int ym2612_write(void *chip, int a, uint8_t v) { YM2612 *F2612 = (YM2612 *)chip; int addr; @@ -2527,7 +2527,7 @@ int ym2612_write(void *chip, int a, UINT8 v) return F2612->OPN.ST.irq; } -UINT8 ym2612_read(void *chip,int a) +uint8_t ym2612_read(void *chip,int a) { YM2612 *F2612 = (YM2612 *)chip; diff --git a/src/devices/sound/fmopl.cpp b/src/devices/sound/fmopl.cpp index b3bfe156593..d113a8ddec5 100644 --- a/src/devices/sound/fmopl.cpp +++ b/src/devices/sound/fmopl.cpp @@ -197,53 +197,53 @@ static FILE *sample[1]; struct OPL_SLOT { - UINT32 ar; /* attack rate: AR<<2 */ - UINT32 dr; /* decay rate: DR<<2 */ - UINT32 rr; /* release rate:RR<<2 */ - UINT8 KSR; /* key scale rate */ - UINT8 ksl; /* keyscale level */ - UINT8 ksr; /* key scale rate: kcode>>KSR */ - UINT8 mul; /* multiple: mul_tab[ML] */ + uint32_t ar; /* attack rate: AR<<2 */ + uint32_t dr; /* decay rate: DR<<2 */ + uint32_t rr; /* release rate:RR<<2 */ + uint8_t KSR; /* key scale rate */ + uint8_t ksl; /* keyscale level */ + uint8_t ksr; /* key scale rate: kcode>>KSR */ + uint8_t mul; /* multiple: mul_tab[ML] */ /* Phase Generator */ - UINT32 Cnt; /* frequency counter */ - UINT32 Incr; /* frequency counter step */ - UINT8 FB; /* feedback shift value */ - INT32 *connect1; /* slot1 output pointer */ - INT32 op1_out[2]; /* slot1 output for feedback */ - UINT8 CON; /* connection (algorithm) type */ + uint32_t Cnt; /* frequency counter */ + uint32_t Incr; /* frequency counter step */ + uint8_t FB; /* feedback shift value */ + int32_t *connect1; /* slot1 output pointer */ + int32_t op1_out[2]; /* slot1 output for feedback */ + uint8_t CON; /* connection (algorithm) type */ /* Envelope Generator */ - UINT8 eg_type; /* percussive/non-percussive mode */ - UINT8 state; /* phase type */ - UINT32 TL; /* total level: TL << 2 */ - INT32 TLL; /* adjusted now TL */ - INT32 volume; /* envelope counter */ - UINT32 sl; /* sustain level: sl_tab[SL] */ - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT8 eg_sh_dr; /* (decay state) */ - UINT8 eg_sel_dr; /* (decay state) */ - UINT8 eg_sh_rr; /* (release state) */ - UINT8 eg_sel_rr; /* (release state) */ - UINT32 key; /* 0 = KEY OFF, >0 = KEY ON */ + uint8_t eg_type; /* percussive/non-percussive mode */ + uint8_t state; /* phase type */ + uint32_t TL; /* total level: TL << 2 */ + int32_t TLL; /* adjusted now TL */ + int32_t volume; /* envelope counter */ + uint32_t sl; /* sustain level: sl_tab[SL] */ + uint8_t eg_sh_ar; /* (attack state) */ + uint8_t eg_sel_ar; /* (attack state) */ + uint8_t eg_sh_dr; /* (decay state) */ + uint8_t eg_sel_dr; /* (decay state) */ + uint8_t eg_sh_rr; /* (release state) */ + uint8_t eg_sel_rr; /* (release state) */ + uint32_t key; /* 0 = KEY OFF, >0 = KEY ON */ /* LFO */ - UINT32 AMmask; /* LFO Amplitude Modulation enable mask */ - UINT8 vib; /* LFO Phase Modulation enable flag (active high)*/ + uint32_t AMmask; /* LFO Amplitude Modulation enable mask */ + uint8_t vib; /* LFO Phase Modulation enable flag (active high)*/ /* waveform select */ - UINT16 wavetable; + uint16_t wavetable; }; struct OPL_CH { OPL_SLOT SLOT[2]; /* phase generator state */ - UINT32 block_fnum; /* block+fnum */ - UINT32 fc; /* Freq. Increment base */ - UINT32 ksl_base; /* KeyScaleLevel Base step */ - UINT8 kcode; /* key code (for key scaling) */ + uint32_t block_fnum; /* block+fnum */ + uint32_t fc; /* Freq. Increment base */ + uint32_t ksl_base; /* KeyScaleLevel Base step */ + uint8_t kcode; /* key code (for key scaling) */ }; /* OPL state */ @@ -252,34 +252,34 @@ struct FM_OPL /* FM channel slots */ OPL_CH P_CH[9]; /* OPL/OPL2 chips have 9 channels*/ - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/72 */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow; /* envelope generator timer overlfows every 1 sample (on real chip) */ + uint32_t eg_cnt; /* global envelope generator counter */ + uint32_t eg_timer; /* global envelope generator counter works at frequency = chipclock/72 */ + uint32_t eg_timer_add; /* step of eg_timer */ + uint32_t eg_timer_overflow; /* envelope generator timer overlfows every 1 sample (on real chip) */ - UINT8 rhythm; /* Rhythm mode */ + uint8_t rhythm; /* Rhythm mode */ - UINT32 fn_tab[1024]; /* fnumber->increment counter */ + uint32_t fn_tab[1024]; /* fnumber->increment counter */ /* LFO */ - UINT32 LFO_AM; - INT32 LFO_PM; + uint32_t LFO_AM; + int32_t LFO_PM; - UINT8 lfo_am_depth; - UINT8 lfo_pm_depth_range; - UINT32 lfo_am_cnt; - UINT32 lfo_am_inc; - UINT32 lfo_pm_cnt; - UINT32 lfo_pm_inc; + uint8_t lfo_am_depth; + uint8_t lfo_pm_depth_range; + uint32_t lfo_am_cnt; + uint32_t lfo_am_inc; + uint32_t lfo_pm_cnt; + uint32_t lfo_pm_inc; - UINT32 noise_rng; /* 23 bit noise shift register */ - UINT32 noise_p; /* current noise 'phase' */ - UINT32 noise_f; /* current noise period */ + uint32_t noise_rng; /* 23 bit noise shift register */ + uint32_t noise_p; /* current noise 'phase' */ + uint32_t noise_f; /* current noise period */ - UINT8 wavesel; /* waveform select enable flag */ + uint8_t wavesel; /* waveform select enable flag */ - UINT32 T[2]; /* timer counters */ - UINT8 st[2]; /* timer enable */ + uint32_t T[2]; /* timer counters */ + uint8_t st[2]; /* timer enable */ #if BUILD_Y8950 /* Delta-T ADPCM unit (Y8950) */ @@ -287,8 +287,8 @@ struct FM_OPL YM_DELTAT *deltat; /* Keyboard and I/O ports interface */ - UINT8 portDirection; - UINT8 portLatch; + uint8_t portDirection; + uint8_t portLatch; OPL_PORTHANDLER_R porthandler_r; OPL_PORTHANDLER_W porthandler_w; void * port_param; @@ -305,14 +305,14 @@ struct FM_OPL OPL_UPDATEHANDLER UpdateHandler;/* stream update handler */ void *UpdateParam; /* stream update parameter */ - UINT8 type; /* chip type */ - UINT8 address; /* address register */ - UINT8 status; /* status flag */ - UINT8 statusmask; /* status mask */ - UINT8 mode; /* Reg.08 : CSM,notesel,etc. */ + uint8_t type; /* chip type */ + uint8_t address; /* address register */ + uint8_t status; /* status flag */ + uint8_t statusmask; /* status mask */ + uint8_t mode; /* Reg.08 : CSM,notesel,etc. */ - UINT32 clock; /* master clock (Hz) */ - UINT32 rate; /* sampling rate (Hz) */ + uint32_t clock; /* master clock (Hz) */ + uint32_t rate; /* sampling rate (Hz) */ double freqbase; /* frequency base */ attotime TimerBase; /* Timer base time (==sampling time)*/ device_t *device; @@ -320,7 +320,7 @@ struct FM_OPL signed int phase_modulation; /* phase modulation input (SLOT 2) */ signed int output[1]; #if BUILD_Y8950 - INT32 output_deltat[4]; /* for Y8950 DELTA-T, chip is mono, that 4 here is just for safety */ + int32_t output_deltat[4]; /* for Y8950 DELTA-T, chip is mono, that 4 here is just for safety */ #endif }; @@ -385,13 +385,13 @@ static const double ksl_tab[8*16]= #undef DV /* 0 / 3.0 / 1.5 / 6.0 dB/OCT */ -static const UINT32 ksl_shift[4] = { 31, 1, 2, 0 }; +static const uint32_t ksl_shift[4] = { 31, 1, 2, 0 }; /* sustain level table (3dB per step) */ /* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/ -#define SC(db) (UINT32) ( db * (2.0/ENV_STEP) ) -static const UINT32 sl_tab[16]={ +#define SC(db) (uint32_t) ( db * (2.0/ENV_STEP) ) +static const uint32_t sl_tab[16]={ SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7), SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31) }; @@ -506,7 +506,7 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), /* multiple table */ #define ML 2 -static const UINT8 mul_tab[16]= { +static const uint8_t mul_tab[16]= { /* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */ ML/2, 1*ML, 2*ML, 3*ML, 4*ML, 5*ML, 6*ML, 7*ML, 8*ML, 9*ML,10*ML,10*ML,12*ML,12*ML,15*ML,15*ML @@ -543,7 +543,7 @@ static unsigned int sin_tab[SIN_LEN * 4]; #define LFO_AM_TAB_ELEMENTS 210 -static const UINT8 lfo_am_table[LFO_AM_TAB_ELEMENTS] = { +static const uint8_t lfo_am_table[LFO_AM_TAB_ELEMENTS] = { 0,0,0,0,0,0,0, 1,1,1,1, 2,2,2,2, @@ -599,7 +599,7 @@ static const UINT8 lfo_am_table[LFO_AM_TAB_ELEMENTS] = { }; /* LFO Phase Modulation table (verified on real YM3812) */ -static const INT8 lfo_pm_table[8*8*2] = { +static const int8_t lfo_pm_table[8*8*2] = { /* FNUM2/FNUM = 00 0xxxxxxx (0x0000) */ 0, 0, 0, 0, 0, 0, 0, 0, /*LFO PM depth = 0*/ 0, 0, 0, 0, 0, 0, 0, 0, /*LFO PM depth = 1*/ @@ -701,12 +701,12 @@ static inline void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag) /* advance LFO to next sample */ static inline void advance_lfo(FM_OPL *OPL) { - UINT8 tmp; + uint8_t tmp; /* LFO */ OPL->lfo_am_cnt += OPL->lfo_am_inc; - if (OPL->lfo_am_cnt >= ((UINT32)LFO_AM_TAB_ELEMENTS<lfo_am_cnt -= ((UINT32)LFO_AM_TAB_ELEMENTS<lfo_am_cnt >= ((uint32_t)LFO_AM_TAB_ELEMENTS<lfo_am_cnt -= ((uint32_t)LFO_AM_TAB_ELEMENTS<lfo_am_cnt >> LFO_SH ]; @@ -821,7 +821,7 @@ static inline void advance(FM_OPL *OPL) /* Phase Generator */ if(op->vib) { - UINT8 block; + uint8_t block; unsigned int block_fnum = CH->block_fnum; unsigned int fnum_lfo = (block_fnum&0x0380) >> 7; @@ -862,7 +862,7 @@ static inline void advance(FM_OPL *OPL) while (i) { /* - UINT32 j; + uint32_t j; j = ( (OPL->noise_rng) ^ (OPL->noise_rng>>14) ^ (OPL->noise_rng>>15) ^ (OPL->noise_rng>>22) ) & 1; OPL->noise_rng = (j<<22) | (OPL->noise_rng>>1); */ @@ -883,9 +883,9 @@ static inline void advance(FM_OPL *OPL) } -static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc(uint32_t phase, unsigned int env, signed int pm, unsigned int wave_tab) { - UINT32 p; + uint32_t p; p = (env<<4) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + (pm<<16))) >> FREQ_SH ) & SIN_MASK) ]; @@ -894,9 +894,9 @@ static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm, return tl_tab[p]; } -static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc1(uint32_t phase, unsigned int env, signed int pm, unsigned int wave_tab) { - UINT32 p; + uint32_t p; p = (env<<4) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + pm )) >> FREQ_SH ) & SIN_MASK) ]; @@ -906,7 +906,7 @@ static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, } -#define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (OPL->LFO_AM & (OP)->AMmask)) +#define volume_calc(OP) ((OP)->TLL + ((uint32_t)(OP)->volume) + (OPL->LFO_AM & (OP)->AMmask)) /* calculate output */ static inline void OPL_CALC_CH( FM_OPL *OPL, OPL_CH *CH ) @@ -1051,7 +1051,7 @@ static inline void OPL_CALC_RH( FM_OPL *OPL, OPL_CH *CH, unsigned int noise ) /* when res1 = 0 phase = 0x000 | 0xd0; */ /* when res1 = 1 phase = 0x200 | (0xd0>>2); */ - UINT32 phase = res1 ? (0x200|(0xd0>>2)) : 0xd0; + uint32_t phase = res1 ? (0x200|(0xd0>>2)) : 0xd0; /* enable gate based on frequency of operator 2 in channel 8 */ unsigned char bit5e= ((SLOT8_2->Cnt>>FREQ_SH)>>5)&1; @@ -1092,7 +1092,7 @@ static inline void OPL_CALC_RH( FM_OPL *OPL, OPL_CH *CH, unsigned int noise ) /* when bit8 = 0 phase = 0x100; */ /* when bit8 = 1 phase = 0x200; */ - UINT32 phase = bit8 ? 0x200 : 0x100; + uint32_t phase = bit8 ? 0x200 : 0x100; /* Noise bit XOR'es phase by 0x100 */ /* when noisebit = 0 pass the phase from calculation above */ @@ -1122,7 +1122,7 @@ static inline void OPL_CALC_RH( FM_OPL *OPL, OPL_CH *CH, unsigned int noise ) /* when res1 = 0 phase = 0x000 | 0x100; */ /* when res1 = 1 phase = 0x200 | 0x100; */ - UINT32 phase = res1 ? 0x300 : 0x100; + uint32_t phase = res1 ? 0x300 : 0x100; /* enable gate based on frequency of operator 2 in channel 8 */ unsigned char bit5e= ((SLOT8_2->Cnt>>FREQ_SH)>>5)&1; @@ -1275,7 +1275,7 @@ static void OPL_initalize(FM_OPL *OPL) for( i=0 ; i < 1024 ; i++ ) { /* opn phase increment counter = 20bit */ - OPL->fn_tab[i] = (UINT32)( (double)i * 64 * OPL->freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ + OPL->fn_tab[i] = (uint32_t)( (double)i * 64 * OPL->freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ #if 0 logerror("FMOPL.C: fn_tab[%4i] = %08x (dec=%8i)\n", i, OPL->fn_tab[i]>>6, OPL->fn_tab[i]>>6 ); @@ -1294,7 +1294,7 @@ static void OPL_initalize(FM_OPL *OPL) logerror("FMOPL.C: ksl_tab[oct=%2i] =",i); for (j=0; j<16; j++) { - logerror("%08x ", static_cast(ksl_tab[i*16+j]) ); + logerror("%08x ", static_cast(ksl_tab[i*16+j]) ); } logerror("\n"); } @@ -1319,7 +1319,7 @@ static void OPL_initalize(FM_OPL *OPL) } -static inline void FM_KEYON(OPL_SLOT *SLOT, UINT32 key_set) +static inline void FM_KEYON(OPL_SLOT *SLOT, uint32_t key_set) { if( !SLOT->key ) { @@ -1331,7 +1331,7 @@ static inline void FM_KEYON(OPL_SLOT *SLOT, UINT32 key_set) SLOT->key |= key_set; } -static inline void FM_KEYOFF(OPL_SLOT *SLOT, UINT32 key_clr) +static inline void FM_KEYOFF(OPL_SLOT *SLOT, uint32_t key_clr) { if( SLOT->key ) { @@ -1478,8 +1478,8 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v) } else { /* set IRQ mask ,timer enable*/ - UINT8 st1 = v&1; - UINT8 st2 = (v>>1)&1; + uint8_t st1 = v&1; + uint8_t st2 = (v>>1)&1; /* IRQRST,T1MSK,t2MSK,EOSMSK,BRMSK,x,ST2,ST1 */ OPL_STATUS_RESET(OPL, v & (0x78-0x08) ); @@ -1658,11 +1658,11 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v) /* update */ if(CH->block_fnum != block_fnum) { - UINT8 block = block_fnum >> 10; + uint8_t block = block_fnum >> 10; CH->block_fnum = block_fnum; - CH->ksl_base = static_cast(ksl_tab[block_fnum>>6]); + CH->ksl_base = static_cast(ksl_tab[block_fnum>>6]); CH->fc = OPL->fn_tab[block_fnum&0x03ff] >> (7-block); /* BLK 2,1,0 bits -> bits 3,2,1 of kcode */ @@ -1790,8 +1790,8 @@ static void OPL_postload(FM_OPL *OPL) OPL_CH *CH = &OPL->P_CH[ch]; /* Look up key scale level */ - UINT32 block_fnum = CH->block_fnum; - CH->ksl_base = static_cast(ksl_tab[block_fnum >> 6]); + uint32_t block_fnum = CH->block_fnum; + CH->ksl_base = static_cast(ksl_tab[block_fnum >> 6]); CH->fc = OPL->fn_tab[block_fnum & 0x03ff] >> (7 - (block_fnum >> 10)); for( slot=0 ; slot < 2 ; slot++ ) @@ -1928,7 +1928,7 @@ static void OPL_save_state(FM_OPL *OPL, device_t *device) device->machine().save().register_postload(save_prepost_delegate(FUNC(OPL_postload), OPL)); } -static void OPL_clock_changed(FM_OPL *OPL, UINT32 clock, UINT32 rate) +static void OPL_clock_changed(FM_OPL *OPL, uint32_t clock, uint32_t rate) { OPL->clock = clock; OPL->rate = rate; @@ -1941,7 +1941,7 @@ static void OPL_clock_changed(FM_OPL *OPL, UINT32 clock, UINT32 rate) /* Create one of virtual YM3812/YM3526/Y8950 */ /* 'clock' is chip clock in Hz */ /* 'rate' is sampling rate */ -static FM_OPL *OPLCreate(device_t *device, UINT32 clock, UINT32 rate, int type) +static FM_OPL *OPLCreate(device_t *device, uint32_t clock, uint32_t rate, int type) { char *ptr; FM_OPL *OPL; @@ -1957,7 +1957,7 @@ static FM_OPL *OPLCreate(device_t *device, UINT32 clock, UINT32 rate, int type) #endif /* allocate memory block */ - ptr = (char *)auto_alloc_array_clear(device->machine(), UINT8, state_size); + ptr = (char *)auto_alloc_array_clear(device->machine(), uint8_t, state_size); OPL = (FM_OPL *)ptr; @@ -2053,7 +2053,7 @@ static unsigned char OPLRead(FM_OPL *OPL,int a) case 0x0f: /* ADPCM-DATA */ if(OPL->type&OPL_TYPE_ADPCM) { - UINT8 val; + uint8_t val; val = YM_DELTAT_ADPCM_Read(OPL->deltat); /*logerror("Y8950: read ADPCM value read=%02x\n",val);*/ @@ -2125,12 +2125,12 @@ static int OPLTimerOver(FM_OPL *OPL,int c) #if (BUILD_YM3812) -void ym3812_clock_changed(void *chip, UINT32 clock, UINT32 rate) +void ym3812_clock_changed(void *chip, uint32_t clock, uint32_t rate) { OPL_clock_changed((FM_OPL *)chip, clock, rate); } -void * ym3812_init(device_t *device, UINT32 clock, UINT32 rate) +void * ym3812_init(device_t *device, uint32_t clock, uint32_t rate) { /* emulator create */ FM_OPL *YM3812 = OPLCreate(device,clock,rate,OPL_TYPE_YM3812); @@ -2200,7 +2200,7 @@ void ym3812_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void * void ym3812_update_one(void *chip, OPLSAMPLE *buffer, int length) { FM_OPL *OPL = (FM_OPL *)chip; - UINT8 rhythm = OPL->rhythm&0x20; + uint8_t rhythm = OPL->rhythm&0x20; OPLSAMPLE *buf = buffer; int i; @@ -2258,12 +2258,12 @@ void ym3812_update_one(void *chip, OPLSAMPLE *buffer, int length) #if (BUILD_YM3526) -void ym3526_clock_changed(void *chip, UINT32 clock, UINT32 rate) +void ym3526_clock_changed(void *chip, uint32_t clock, uint32_t rate) { OPL_clock_changed((FM_OPL *)chip, clock, rate); } -void *ym3526_init(device_t *device, UINT32 clock, UINT32 rate) +void *ym3526_init(device_t *device, uint32_t clock, uint32_t rate) { /* emulator create */ FM_OPL *YM3526 = OPLCreate(device,clock,rate,OPL_TYPE_YM3526); @@ -2332,7 +2332,7 @@ void ym3526_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void * void ym3526_update_one(void *chip, OPLSAMPLE *buffer, int length) { FM_OPL *OPL = (FM_OPL *)chip; - UINT8 rhythm = OPL->rhythm&0x20; + uint8_t rhythm = OPL->rhythm&0x20; OPLSAMPLE *buf = buffer; int i; @@ -2391,18 +2391,18 @@ void ym3526_update_one(void *chip, OPLSAMPLE *buffer, int length) #if BUILD_Y8950 -static void Y8950_deltat_status_set(void *chip, UINT8 changebits) +static void Y8950_deltat_status_set(void *chip, uint8_t changebits) { FM_OPL *Y8950 = (FM_OPL *)chip; OPL_STATUS_SET(Y8950, changebits); } -static void Y8950_deltat_status_reset(void *chip, UINT8 changebits) +static void Y8950_deltat_status_reset(void *chip, uint8_t changebits) { FM_OPL *Y8950 = (FM_OPL *)chip; OPL_STATUS_RESET(Y8950, changebits); } -void *y8950_init(device_t *device, UINT32 clock, UINT32 rate) +void *y8950_init(device_t *device, uint32_t clock, uint32_t rate) { /* emulator create */ FM_OPL *Y8950 = OPLCreate(device,clock,rate,OPL_TYPE_Y8950); @@ -2472,7 +2472,7 @@ void y8950_set_update_handler(void *chip,OPL_UPDATEHANDLER UpdateHandler,void *p void y8950_set_delta_t_memory(void *chip, void * deltat_mem_ptr, int deltat_mem_size ) { FM_OPL *OPL = (FM_OPL *)chip; - OPL->deltat->memory = (UINT8 *)(deltat_mem_ptr); + OPL->deltat->memory = (uint8_t *)(deltat_mem_ptr); OPL->deltat->memory_size = deltat_mem_size; } @@ -2487,7 +2487,7 @@ void y8950_update_one(void *chip, OPLSAMPLE *buffer, int length) { int i; FM_OPL *OPL = (FM_OPL *)chip; - UINT8 rhythm = OPL->rhythm&0x20; + uint8_t rhythm = OPL->rhythm&0x20; YM_DELTAT *DELTAT = OPL->deltat; OPLSAMPLE *buf = buffer; diff --git a/src/devices/sound/fmopl.h b/src/devices/sound/fmopl.h index 55d8b49c6e9..89c19876fa6 100644 --- a/src/devices/sound/fmopl.h +++ b/src/devices/sound/fmopl.h @@ -16,21 +16,21 @@ /* compiler dependence */ #ifndef __OSDCOMM_H__ #define __OSDCOMM_H__ -typedef unsigned char UINT8; /* unsigned 8bit */ -typedef unsigned short UINT16; /* unsigned 16bit */ -typedef unsigned int UINT32; /* unsigned 32bit */ -typedef signed char INT8; /* signed 8bit */ -typedef signed short INT16; /* signed 16bit */ -typedef signed int INT32; /* signed 32bit */ +typedef unsigned char uint8_t; /* unsigned 8bit */ +typedef unsigned short uint16_t; /* unsigned 16bit */ +typedef unsigned int uint32_t; /* unsigned 32bit */ +typedef signed char int8_t; /* signed 8bit */ +typedef signed short int16_t; /* signed 16bit */ +typedef signed int int32_t; /* signed 32bit */ #endif /* __OSDCOMM_H__ */ typedef stream_sample_t OPLSAMPLE; /* #if (OPL_SAMPLE_BITS==16) -typedef INT16 OPLSAMPLE; +typedef int16_t OPLSAMPLE; #endif #if (OPL_SAMPLE_BITS==8) -typedef INT8 OPLSAMPLE; +typedef int8_t OPLSAMPLE; #endif */ @@ -43,8 +43,8 @@ typedef unsigned char (*OPL_PORTHANDLER_R)(void *param); #if BUILD_YM3812 -void *ym3812_init(device_t *device, UINT32 clock, UINT32 rate); -void ym3812_clock_changed(void *chip, UINT32 clock, UINT32 rate); +void *ym3812_init(device_t *device, uint32_t clock, uint32_t rate); +void ym3812_clock_changed(void *chip, uint32_t clock, uint32_t rate); void ym3812_shutdown(void *chip); void ym3812_reset_chip(void *chip); int ym3812_write(void *chip, int a, int v); @@ -68,8 +68,8 @@ void ym3812_set_update_handler(void *chip, OPL_UPDATEHANDLER UpdateHandler, void ** 'clock' is the chip clock in Hz ** 'rate' is sampling rate */ -void *ym3526_init(device_t *device, UINT32 clock, UINT32 rate); -void ym3526_clock_changed(void *chip, UINT32 clock, UINT32 rate); +void *ym3526_init(device_t *device, uint32_t clock, uint32_t rate); +void ym3526_clock_changed(void *chip, uint32_t clock, uint32_t rate); /* shutdown the YM3526 emulators*/ void ym3526_shutdown(void *chip); void ym3526_reset_chip(void *chip); @@ -99,7 +99,7 @@ void y8950_set_port_handler(void *chip, OPL_PORTHANDLER_W PortHandler_w, OPL_POR void y8950_set_keyboard_handler(void *chip, OPL_PORTHANDLER_W KeyboardHandler_w, OPL_PORTHANDLER_R KeyboardHandler_r, void *param); void y8950_set_delta_t_memory(void *chip, void * deltat_mem_ptr, int deltat_mem_size ); -void * y8950_init(device_t *device, UINT32 clock, UINT32 rate); +void * y8950_init(device_t *device, uint32_t clock, uint32_t rate); void y8950_shutdown(void *chip); void y8950_reset_chip(void *chip); int y8950_write(void *chip, int a, int v); diff --git a/src/devices/sound/gaelco.cpp b/src/devices/sound/gaelco.cpp index f62ad347bc3..a86fa265ffd 100644 --- a/src/devices/sound/gaelco.cpp +++ b/src/devices/sound/gaelco.cpp @@ -56,12 +56,12 @@ static wav_file* wavraw; // Raw waveform const device_type GAELCO_GAE1 = &device_creator; -gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gaelco_gae1_device(mconfig, GAELCO_GAE1, "Gaelco GAE1", tag, owner, clock, "gaelco_gae1", __FILE__) { } -gaelco_gae1_device::gaelco_gae1_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) +gaelco_gae1_device::gaelco_gae1_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_sound_interface(mconfig, *this) , m_stream(nullptr) @@ -266,7 +266,7 @@ void gaelco_gae1_device::device_stop() const device_type GAELCO_CG1V = &device_creator; -gaelco_cg1v_device::gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gaelco_cg1v_device::gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gaelco_gae1_device(mconfig, GAELCO_CG1V, "Gaelco CG1V", tag, owner, clock, "gaelco_cg1v", __FILE__) { } diff --git a/src/devices/sound/gaelco.h b/src/devices/sound/gaelco.h index 91b90158667..b17c72e3de0 100644 --- a/src/devices/sound/gaelco.h +++ b/src/devices/sound/gaelco.h @@ -40,8 +40,8 @@ class gaelco_gae1_device : public device_t, public device_sound_interface { public: - gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - gaelco_gae1_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); + gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + gaelco_gae1_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); ~gaelco_gae1_device() { } static void set_snd_data_tag(device_t &device, const char *tag) { downcast(device).m_snd_data.set_tag(tag); } @@ -68,14 +68,14 @@ public: private: sound_stream *m_stream; /* our stream */ - required_region_ptr m_snd_data; /* PCM data */ + required_region_ptr m_snd_data; /* PCM data */ int m_banks[4]; /* start of each ROM bank */ gaelco_sound_channel m_channel[GAELCO_NUM_CHANNELS]; /* 7 stereo channels */ - UINT16 m_sndregs[0x38]; + uint16_t m_sndregs[0x38]; // Table for converting from 8 to 16 bits with volume control - INT16 m_volume_table[GAELCO_VOLUME_LEVELS][256]; + int16_t m_volume_table[GAELCO_VOLUME_LEVELS][256]; }; extern const device_type GAELCO_GAE1; @@ -87,7 +87,7 @@ extern const device_type GAELCO_GAE1; class gaelco_cg1v_device : public gaelco_gae1_device { public: - gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type GAELCO_CG1V; diff --git a/src/devices/sound/gb.cpp b/src/devices/sound/gb.cpp index 33d71f09446..15e65c3a5e0 100644 --- a/src/devices/sound/gb.cpp +++ b/src/devices/sound/gb.cpp @@ -84,20 +84,20 @@ const device_type CGB04_APU = &device_creator; // gameboy_sound_device - constructor //------------------------------------------------- -gameboy_sound_device::gameboy_sound_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) +gameboy_sound_device::gameboy_sound_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_sound_interface(mconfig, *this) { } -dmg_apu_device::dmg_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmg_apu_device::dmg_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gameboy_sound_device(mconfig, DMG_APU, "LR35902 APU", tag, owner, clock, "dmg_apu", __FILE__) { } -cgb04_apu_device::cgb04_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cgb04_apu_device::cgb04_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gameboy_sound_device(mconfig, CGB04_APU, "CGB04 APU", tag, owner, clock, "cgb04_apu", __FILE__) { } @@ -255,10 +255,10 @@ void gameboy_sound_device::tick_length(struct SOUND &snd) } -INT32 gameboy_sound_device::calculate_next_sweep(struct SOUND &snd) +int32_t gameboy_sound_device::calculate_next_sweep(struct SOUND &snd) { snd.sweep_neg_mode_used = (snd.sweep_direction < 0); - INT32 new_frequency = snd.frequency + snd.sweep_direction * (snd.frequency >> snd.sweep_shift); + int32_t new_frequency = snd.frequency + snd.sweep_direction * (snd.frequency >> snd.sweep_shift); if (new_frequency > 0x7FF) { @@ -271,7 +271,7 @@ INT32 gameboy_sound_device::calculate_next_sweep(struct SOUND &snd) void gameboy_sound_device::apply_next_sweep(struct SOUND &snd) { - INT32 new_frequency = calculate_next_sweep(snd); + int32_t new_frequency = calculate_next_sweep(snd); if (snd.on && snd.sweep_shift > 0) { @@ -309,7 +309,7 @@ void gameboy_sound_device::tick_envelope(struct SOUND &snd) if (snd.envelope_count) { - INT8 new_envelope_value = snd.envelope_value + snd.envelope_direction; + int8_t new_envelope_value = snd.envelope_value + snd.envelope_direction; if (new_envelope_value >= 0 && new_envelope_value <= 15) { @@ -331,7 +331,7 @@ bool gameboy_sound_device::dac_enabled(struct SOUND &snd) } -void gameboy_sound_device::update_square_channel(struct SOUND &snd, UINT64 cycles) +void gameboy_sound_device::update_square_channel(struct SOUND &snd, uint64_t cycles) { if (snd.on) { @@ -377,7 +377,7 @@ void gameboy_sound_device::update_square_channel(struct SOUND &snd, UINT64 cycle } -void dmg_apu_device::update_wave_channel(struct SOUND &snd, UINT64 cycles) +void dmg_apu_device::update_wave_channel(struct SOUND &snd, uint64_t cycles) { if (snd.on) { @@ -442,7 +442,7 @@ void dmg_apu_device::update_wave_channel(struct SOUND &snd, UINT64 cycles) } -void cgb04_apu_device::update_wave_channel(struct SOUND &snd, UINT64 cycles) +void cgb04_apu_device::update_wave_channel(struct SOUND &snd, uint64_t cycles) { if (snd.on) { @@ -504,7 +504,7 @@ void cgb04_apu_device::update_wave_channel(struct SOUND &snd, UINT64 cycles) } -void gameboy_sound_device::update_noise_channel(struct SOUND &snd, UINT64 cycles) +void gameboy_sound_device::update_noise_channel(struct SOUND &snd, uint64_t cycles) { while (cycles > 0) { @@ -531,7 +531,7 @@ void gameboy_sound_device::update_noise_channel(struct SOUND &snd, UINT64 cycles /* Using a Polynomial Counter (aka Linear Feedback Shift Register) Mode 4 has a 15 bit counter so we need to shift the bits around accordingly */ - UINT16 feedback = ((snd.noise_lfsr >> 1) ^ snd.noise_lfsr) & 1; + uint16_t feedback = ((snd.noise_lfsr >> 1) ^ snd.noise_lfsr) & 1; snd.noise_lfsr = (snd.noise_lfsr >> 1) | (feedback << 14); if (snd.noise_short) { @@ -555,15 +555,15 @@ void gameboy_sound_device::update_state() if (m_snd_control.on) { - UINT64 cycles = attotime_to_clocks(now - m_last_updated); + uint64_t cycles = attotime_to_clocks(now - m_last_updated); - UINT64 old_cycles = m_snd_control.cycles; + uint64_t old_cycles = m_snd_control.cycles; m_snd_control.cycles += cycles; if ((old_cycles / FRAME_CYCLES) != (m_snd_control.cycles / FRAME_CYCLES)) { // Left over cycles in current frame - UINT64 cycles_current_frame = FRAME_CYCLES - (old_cycles & (FRAME_CYCLES - 1)); + uint64_t cycles_current_frame = FRAME_CYCLES - (old_cycles & (FRAME_CYCLES - 1)); update_square_channel(m_snd_1, cycles_current_frame); update_square_channel(m_snd_2, cycles_current_frame); @@ -626,7 +626,7 @@ void gameboy_sound_device::update_state() } -UINT64 gameboy_sound_device::noise_period_cycles() +uint64_t gameboy_sound_device::noise_period_cycles() { static const int divisor[8] = { 8, 16,32, 48, 64, 80, 96, 112 }; return divisor[m_snd_4.reg[3] & 7] << (m_snd_4.reg[3] >> 4); @@ -663,7 +663,7 @@ READ8_MEMBER( cgb04_apu_device::wave_r ) READ8_MEMBER( gameboy_sound_device::sound_r ) { - static const UINT8 read_mask[0x40] = + static const uint8_t read_mask[0x40] = { 0x80,0x3F,0x00,0xFF,0xBF,0xFF,0x3F,0x00,0xFF,0xBF,0x7F,0xFF,0x9F,0xFF,0xBF,0xFF, 0xFF,0x00,0x00,0xBF,0x00,0x00,0x70,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, @@ -769,10 +769,10 @@ void dmg_apu_device::corrupt_wave_ram() } -void gameboy_sound_device::sound_w_internal( int offset, UINT8 data ) +void gameboy_sound_device::sound_w_internal( int offset, uint8_t data ) { /* Store the value */ - UINT8 old_data = m_snd_regs[offset]; + uint8_t old_data = m_snd_regs[offset]; if (m_snd_control.on) { diff --git a/src/devices/sound/gb.h b/src/devices/sound/gb.h index 2ccc6d69d27..2a1ff031464 100644 --- a/src/devices/sound/gb.h +++ b/src/devices/sound/gb.h @@ -9,8 +9,8 @@ class gameboy_sound_device : public device_t, public device_sound_interface { public: - gameboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - gameboy_sound_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); + gameboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + gameboy_sound_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); DECLARE_READ8_MEMBER(sound_r); virtual DECLARE_READ8_MEMBER(wave_r) = 0; @@ -78,41 +78,41 @@ protected: struct SOUND { /* Common */ - UINT8 reg[5]; + uint8_t reg[5]; bool on; - UINT8 channel; - UINT8 length; - UINT8 length_mask; + uint8_t channel; + uint8_t length; + uint8_t length_mask; bool length_counting; bool length_enabled; /* Mode 1, 2, 3 */ - UINT64 cycles_left; - INT8 duty; + uint64_t cycles_left; + int8_t duty; /* Mode 1, 2, 4 */ bool envelope_enabled; - INT8 envelope_value; - INT8 envelope_direction; - UINT8 envelope_time; - UINT8 envelope_count; - INT8 signal; + int8_t envelope_value; + int8_t envelope_direction; + uint8_t envelope_time; + uint8_t envelope_count; + int8_t signal; /* Mode 1 */ - UINT16 frequency; - UINT16 frequency_counter; + uint16_t frequency; + uint16_t frequency_counter; bool sweep_enabled; bool sweep_neg_mode_used; - UINT8 sweep_shift; - INT32 sweep_direction; - UINT8 sweep_time; - UINT8 sweep_count; + uint8_t sweep_shift; + int32_t sweep_direction; + uint8_t sweep_time; + uint8_t sweep_count; /* Mode 3 */ - UINT8 level; - UINT8 offset; - UINT32 duty_count; - INT8 current_sample; + uint8_t level; + uint8_t offset; + uint32_t duty_count; + int8_t current_sample; bool sample_reading; /* Mode 4 */ bool noise_short; - UINT16 noise_lfsr; + uint16_t noise_lfsr; }; struct SOUND m_snd_1; @@ -122,31 +122,31 @@ protected: struct { - UINT8 on; - UINT8 vol_left; - UINT8 vol_right; - UINT8 mode1_left; - UINT8 mode1_right; - UINT8 mode2_left; - UINT8 mode2_right; - UINT8 mode3_left; - UINT8 mode3_right; - UINT8 mode4_left; - UINT8 mode4_right; - UINT64 cycles; + uint8_t on; + uint8_t vol_left; + uint8_t vol_right; + uint8_t mode1_left; + uint8_t mode1_right; + uint8_t mode2_left; + uint8_t mode2_right; + uint8_t mode3_left; + uint8_t mode3_right; + uint8_t mode4_left; + uint8_t mode4_right; + uint64_t cycles; bool wave_ram_locked; } m_snd_control; - UINT8 m_snd_regs[0x30]; + uint8_t m_snd_regs[0x30]; attotime m_last_updated; emu_timer *m_timer; virtual void apu_power_off() = 0; - void sound_w_internal(int offset, UINT8 data); - void update_square_channel(struct SOUND &snd, UINT64 cycles); - virtual void update_wave_channel(struct SOUND &snd, UINT64 cycles) = 0; - void update_noise_channel(struct SOUND &snd, UINT64 cycles); - INT32 calculate_next_sweep(struct SOUND &snd); + void sound_w_internal(int offset, uint8_t data); + void update_square_channel(struct SOUND &snd, uint64_t cycles); + virtual void update_wave_channel(struct SOUND &snd, uint64_t cycles) = 0; + void update_noise_channel(struct SOUND &snd, uint64_t cycles); + int32_t calculate_next_sweep(struct SOUND &snd); void apply_next_sweep(struct SOUND &snd); void tick_length(struct SOUND &snd); void tick_sweep(struct SOUND &snd); @@ -154,7 +154,7 @@ protected: void update_state(); bool dac_enabled(struct SOUND &snd); virtual void corrupt_wave_ram() { }; - UINT64 noise_period_cycles(); + uint64_t noise_period_cycles(); TIMER_CALLBACK_MEMBER(timer_callback); }; @@ -162,7 +162,7 @@ protected: class dmg_apu_device : public gameboy_sound_device { public: - dmg_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmg_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(wave_r) override; virtual DECLARE_WRITE8_MEMBER(wave_w) override; @@ -171,14 +171,14 @@ public: protected: virtual void apu_power_off() override; virtual void corrupt_wave_ram() override; - virtual void update_wave_channel(struct SOUND &snd, UINT64 cycles) override; + virtual void update_wave_channel(struct SOUND &snd, uint64_t cycles) override; }; class cgb04_apu_device : public gameboy_sound_device { public: - cgb04_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cgb04_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(wave_r) override; virtual DECLARE_WRITE8_MEMBER(wave_w) override; @@ -187,7 +187,7 @@ public: protected: virtual void device_reset() override; virtual void apu_power_off() override; - virtual void update_wave_channel(struct SOUND &snd, UINT64 cycles) override; + virtual void update_wave_channel(struct SOUND &snd, uint64_t cycles) override; }; diff --git a/src/devices/sound/hc55516.cpp b/src/devices/sound/hc55516.cpp index 5c291804a90..2bfbd6342ec 100644 --- a/src/devices/sound/hc55516.cpp +++ b/src/devices/sound/hc55516.cpp @@ -25,7 +25,7 @@ const device_type HC55516 = &device_creator; -hc55516_device::hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hc55516_device::hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HC55516, "HC-55516", tag, owner, clock, "hc55516", __FILE__), device_sound_interface(mconfig, *this), m_channel(nullptr), @@ -45,7 +45,7 @@ hc55516_device::hc55516_device(const machine_config &mconfig, const char *tag, d m_leak(0) { } -hc55516_device::hc55516_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) +hc55516_device::hc55516_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_sound_interface(mconfig, *this), m_channel(nullptr), @@ -96,7 +96,7 @@ void hc55516_device::device_reset() const device_type MC3417 = &device_creator; -mc3417_device::mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc3417_device::mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hc55516_device(mconfig, MC3417, "MC3417", tag, owner, clock, "mc3417", __FILE__) { } @@ -113,7 +113,7 @@ void mc3417_device::device_start() const device_type MC3418 = &device_creator; -mc3418_device::mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc3418_device::mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hc55516_device(mconfig, MC3418, "MC3418", tag, owner, clock, "mc3418", __FILE__) { } @@ -128,7 +128,7 @@ void mc3418_device::device_start() } -void hc55516_device::start_common(UINT8 _shiftreg_mask, int _active_clock_hi) +void hc55516_device::start_common(uint8_t _shiftreg_mask, int _active_clock_hi) { /* compute the fixed charge, decay, and leak time constants */ m_charge = pow(exp(-1.0), 1.0 / (FILTER_CHARGE_TC * 16000.0)); @@ -168,7 +168,7 @@ inline int hc55516_device::is_active_clock_transition(int clock_state) inline int hc55516_device::current_clock_state() { - return ((UINT64)m_update_count * clock() * 2 / SAMPLE_RATE) & 0x01; + return ((uint64_t)m_update_count * clock() * 2 / SAMPLE_RATE) & 0x01; } @@ -220,7 +220,7 @@ void hc55516_device::process_digit() void hc55516_device::clock_w(int state) { - UINT8 clock_state = state ? TRUE : FALSE; + uint8_t clock_state = state ? TRUE : FALSE; /* only makes sense for setups with a software driven clock */ assert(!is_external_oscillator()); @@ -273,7 +273,7 @@ void hc55516_device::sound_stream_update(sound_stream &stream, stream_sample_t * { stream_sample_t *buffer = outputs[0]; int i; - INT32 sample, slope; + int32_t sample, slope; /* zero-length? bail */ if (samples == 0) @@ -292,7 +292,7 @@ void hc55516_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* compute the interpolation slope */ sample = m_curr_sample; - slope = ((INT32)m_next_sample - sample) / samples; + slope = ((int32_t)m_next_sample - sample) / samples; m_curr_sample = m_next_sample; if (is_external_oscillator()) @@ -300,7 +300,7 @@ void hc55516_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* external oscillator */ for (i = 0; i < samples; i++, sample += slope) { - UINT8 clock_state; + uint8_t clock_state; *buffer++ = sample; diff --git a/src/devices/sound/hc55516.h b/src/devices/sound/hc55516.h index cabfa02e92a..a7c93415645 100644 --- a/src/devices/sound/hc55516.h +++ b/src/devices/sound/hc55516.h @@ -9,8 +9,8 @@ class hc55516_device : public device_t, public device_sound_interface { public: - hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - hc55516_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); + hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + hc55516_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); ~hc55516_device() {} /* sets the digit (0 or 1) */ @@ -31,22 +31,22 @@ protected: // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; - void start_common(UINT8 _shiftreg_mask, int _active_clock_hi); + void start_common(uint8_t _shiftreg_mask, int _active_clock_hi); // internal state sound_stream *m_channel; int m_active_clock_hi; - UINT8 m_shiftreg_mask; + uint8_t m_shiftreg_mask; - UINT8 m_last_clock_state; - UINT8 m_digit; - UINT8 m_new_digit; - UINT8 m_shiftreg; + uint8_t m_last_clock_state; + uint8_t m_digit; + uint8_t m_new_digit; + uint8_t m_shiftreg; - INT16 m_curr_sample; - INT16 m_next_sample; + int16_t m_curr_sample; + int16_t m_next_sample; - UINT32 m_update_count; + uint32_t m_update_count; double m_filter; double m_integrator; @@ -66,7 +66,7 @@ extern const device_type HC55516; class mc3417_device : public hc55516_device { public: - mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -80,7 +80,7 @@ extern const device_type MC3417; class mc3418_device : public hc55516_device { public: - mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc3418_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/devices/sound/i5000.cpp b/src/devices/sound/i5000.cpp index 11dc147f0b0..f8719923be5 100644 --- a/src/devices/sound/i5000.cpp +++ b/src/devices/sound/i5000.cpp @@ -23,7 +23,7 @@ // device type definition const device_type I5000_SND = &device_creator; -i5000snd_device::i5000snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i5000snd_device::i5000snd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I5000_SND, "I5000", tag, owner, clock, "i5000snd", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), m_rom_base(nullptr), m_rom_mask(0) { @@ -45,7 +45,7 @@ void i5000snd_device::device_start() // create the stream m_stream = machine().sound().stream_alloc(*this, 0, 2, clock() / 0x400); - m_rom_base = (UINT16 *)device().machine().root_device().memregion(":i5000snd")->base(); + m_rom_base = (uint16_t *)device().machine().root_device().memregion(":i5000snd")->base(); m_rom_mask = device().machine().root_device().memregion(":i5000snd")->bytes() / 2 - 1; // register for savestates @@ -93,7 +93,7 @@ bool i5000snd_device::read_sample(int ch) // handle command if (m_channels[ch].sample == 0x7f7f) { - UINT16 cmd = m_rom_base[m_channels[ch].address]; + uint16_t cmd = m_rom_base[m_channels[ch].address]; m_channels[ch].address = (m_channels[ch].address + 1) & m_rom_mask; // volume envelope? or loop sample? @@ -117,8 +117,8 @@ void i5000snd_device::sound_stream_update(sound_stream &stream, stream_sample_t { for (int i = 0; i < samples; i++) { - INT32 mix_l = 0; - INT32 mix_r = 0; + int32_t mix_l = 0; + int32_t mix_r = 0; // loop over all channels for (int ch = 0; ch < 16; ch++) @@ -162,7 +162,7 @@ void i5000snd_device::sound_stream_update(sound_stream &stream, stream_sample_t } -void i5000snd_device::write_reg16(UINT8 reg, UINT16 data) +void i5000snd_device::write_reg16(uint8_t reg, uint16_t data) { // channel regs if (reg < 0x40) @@ -199,9 +199,9 @@ void i5000snd_device::write_reg16(UINT8 reg, UINT16 data) { if (data & (1 << ch) && !m_channels[ch].is_playing) { - UINT32 address = m_regs[ch << 2 | 1] << 16 | m_regs[ch << 2]; - UINT16 start = m_rom_base[(address + 0) & m_rom_mask]; - UINT16 param = m_rom_base[(address + 1) & m_rom_mask]; + uint32_t address = m_regs[ch << 2 | 1] << 16 | m_regs[ch << 2]; + uint16_t start = m_rom_base[(address + 0) & m_rom_mask]; + uint16_t param = m_rom_base[(address + 1) & m_rom_mask]; // check sample start ID if (start != 0x7f7f) @@ -267,7 +267,7 @@ void i5000snd_device::write_reg16(UINT8 reg, UINT16 data) READ16_MEMBER( i5000snd_device::read ) { - UINT16 ret = 0; + uint16_t ret = 0; m_stream->update(); switch (offset) diff --git a/src/devices/sound/i5000.h b/src/devices/sound/i5000.h index fce3659d072..26880fe7c79 100644 --- a/src/devices/sound/i5000.h +++ b/src/devices/sound/i5000.h @@ -34,7 +34,7 @@ class i5000snd_device : public device_t, { public: // construction/destruction - i5000snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i5000snd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER(read); DECLARE_WRITE16_MEMBER(write); @@ -54,14 +54,14 @@ private: bool is_playing; oki_adpcm_state m_adpcm; - UINT32 address; + uint32_t address; int freq_timer; int freq_base; int freq_min; - UINT16 sample; - UINT8 shift_pos; - UINT8 shift_amount; - UINT8 shift_mask; + uint16_t sample; + uint8_t shift_pos; + uint8_t shift_amount; + uint8_t shift_mask; int vol_r; int vol_l; int output_r; @@ -71,15 +71,15 @@ private: channel_t m_channels[16]; - UINT16 m_regs[0x80]; + uint16_t m_regs[0x80]; - UINT16 *m_rom_base; - UINT32 m_rom_mask; + uint16_t *m_rom_base; + uint32_t m_rom_mask; int m_lut_volume[0x100]; bool read_sample(int ch); - void write_reg16(UINT8 reg, UINT16 data); + void write_reg16(uint8_t reg, uint16_t data); }; diff --git a/src/devices/sound/ics2115.cpp b/src/devices/sound/ics2115.cpp index f42d1ee52e2..523fe4e2bbc 100644 --- a/src/devices/sound/ics2115.cpp +++ b/src/devices/sound/ics2115.cpp @@ -17,7 +17,7 @@ // device type definition const device_type ICS2115 = &device_creator; -ics2115_device::ics2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ics2115_device::ics2115_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ICS2115, "ICS2115", tag, owner, clock, "ics2115", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), m_rom(*this, DEVICE_SELF), @@ -48,14 +48,14 @@ void ics2115_device::device_start() } //u-Law table as per MIL-STD-188-113 - UINT16 lut[8]; - UINT16 lut_initial = 33 << 2; //shift up 2-bits for 16-bit range. + uint16_t lut[8]; + uint16_t lut_initial = 33 << 2; //shift up 2-bits for 16-bit range. for(int i = 0; i < 8; i++) lut[i] = (lut_initial << i) - lut_initial; for(int i = 0; i < 256; i++) { - UINT8 exponent = (~i >> 4) & 0x07; - UINT8 mantissa = ~i & 0x0f; - INT16 value = lut[exponent] + (mantissa << (exponent + 3)); + uint8_t exponent = (~i >> 4) & 0x07; + uint8_t mantissa = ~i & 0x0f; + int16_t value = lut[exponent] + (mantissa << (exponent + 3)); m_ulaw[i] = (i & 0x80) ? -value : value; } @@ -180,7 +180,7 @@ int ics2115_voice::update_volume_envelope() return ret; } -/*UINT32 ics2115_voice::next_address() +/*uint32_t ics2115_voice::next_address() { //Patent 6,246,774 B1, Column 111, Row 25 //LEN BLEN DIR BC NextAddress @@ -242,8 +242,8 @@ int ics2115_voice::update_oscillator() //TODO: proper interpolation for uLaw (fill_output doesn't use this) and 8-bit samples (looping) stream_sample_t ics2115_device::get_sample(ics2115_voice& voice) { - UINT32 curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12); - UINT32 nextaddr; + uint32_t curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12); + uint32_t nextaddr; if (voice.state.bitflags.on && voice.osc_conf.bitflags.loop && !voice.osc_conf.bitflags.loop_bidir && (voice.osc.left < (voice.osc.fc <<2))) { @@ -254,15 +254,15 @@ stream_sample_t ics2115_device::get_sample(ics2115_voice& voice) nextaddr = curaddr + 2; - INT16 sample1, sample2; + int16_t sample1, sample2; if (voice.osc_conf.bitflags.eightbit) { - sample1 = ((INT8)m_rom[curaddr]) << 8; - sample2 = ((INT8)m_rom[curaddr + 1]) << 8; + sample1 = ((int8_t)m_rom[curaddr]) << 8; + sample2 = ((int8_t)m_rom[curaddr + 1]) << 8; } else { - sample1 = m_rom[curaddr + 0] | (((INT8)m_rom[curaddr + 1]) << 8); - sample2 = m_rom[nextaddr+ 0] | (((INT8)m_rom[nextaddr+ 1]) << 8); - //sample2 = m_rom[curaddr + 2] | (((INT8)m_rom[curaddr + 3]) << 8); + sample1 = m_rom[curaddr + 0] | (((int8_t)m_rom[curaddr + 1]) << 8); + sample2 = m_rom[nextaddr+ 0] | (((int8_t)m_rom[nextaddr+ 1]) << 8); + //sample2 = m_rom[curaddr + 2] | (((int8_t)m_rom[curaddr + 3]) << 8); } //no need for interpolation since it's around 1 note a cycle? @@ -271,12 +271,12 @@ stream_sample_t ics2115_device::get_sample(ics2115_voice& voice) //linear interpolation as in US patent 6,246,774 B1, column 2 row 59 //LEN=1, BLEN=0, DIR=0, start+end interpolation - INT32 sample, diff; - UINT16 fract; + int32_t sample, diff; + uint16_t fract; diff = sample2 - sample1; fract = (voice.osc.acc >> 3) & 0x1ff; - sample = (((INT32)sample1 << 9) + diff * fract) >> 9; + sample = (((int32_t)sample1 << 9) + diff * fract) >> 9; //sample = sample1; return sample; } @@ -304,14 +304,14 @@ void ics2115_voice::update_ramp() { int ics2115_device::fill_output(ics2115_voice& voice, stream_sample_t *outputs[2], int samples) { bool irq_invalid = false; - UINT16 fine = 1 << (3*(voice.vol.incr >> 6)); + uint16_t fine = 1 << (3*(voice.vol.incr >> 6)); voice.vol.add = (voice.vol.incr & 0x3F)<< (10 - fine); for (int i = 0; i < samples; i++) { - UINT32 volacc = (voice.vol.acc >> 10) & 0xffff; - UINT32 volume = (m_volume[volacc >> 4] * voice.state.bitflags.ramp) >> 6; - UINT16 vleft = volume; //* (255 - voice.vol.pan) / 0x80]; - UINT16 vright = volume; //* (voice.vol.pan + 1) / 0x80]; + uint32_t volacc = (voice.vol.acc >> 10) & 0xffff; + uint32_t volume = (m_volume[volacc >> 4] * voice.state.bitflags.ramp) >> 6; + uint16_t vleft = volume; //* (255 - voice.vol.pan) / 0x80]; + uint16_t vright = volume; //* (voice.vol.pan + 1) / 0x80]; //From GUS doc: //In general, it is necessary to remember that all voices are being summed in to the @@ -320,7 +320,7 @@ int ics2115_device::fill_output(ics2115_voice& voice, stream_sample_t *outputs[2 //(austere note: this will of course fix some of the glitches due to multiple transition) stream_sample_t sample; if(voice.osc_conf.bitflags.ulaw) { - UINT32 curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12); + uint32_t curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12); sample = m_ulaw[m_rom[curaddr]]; } else @@ -359,13 +359,13 @@ void ics2115_device::sound_stream_update(sound_stream &stream, stream_sample_t * #endif /* #ifdef ICS2115_DEBUG - UINT32 curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12); + uint32_t curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12); stream_sample_t sample; if(voice.osc_conf.bitflags.ulaw) sample = m_ulaw[m_rom[curaddr]]; else sample = get_sample(voice); - printf("[%06x=%04x]", curaddr, (INT16)sample); + printf("[%06x=%04x]", curaddr, (int16_t)sample); #endif */ if(fill_output(voice, outputs, samples)) @@ -410,8 +410,8 @@ void ics2115_device::sound_stream_update(sound_stream &stream, stream_sample_t * } //Helper Function (Reads off current register) -UINT16 ics2115_device::reg_read() { - UINT16 ret; +uint16_t ics2115_device::reg_read() { + uint16_t ret; ics2115_voice& voice = m_voice[m_osc_select]; switch(m_reg_select) { @@ -564,7 +564,7 @@ UINT16 ics2115_device::reg_read() { return ret; } -void ics2115_device::reg_write(UINT8 data, bool msb) { +void ics2115_device::reg_write(uint8_t data, bool msb) { ics2115_voice& voice = m_voice[m_osc_select]; switch(m_reg_select) { @@ -759,7 +759,7 @@ void ics2115_device::reg_write(UINT8 data, bool msb) { READ8_MEMBER(ics2115_device::read) { - UINT8 ret = 0; + uint8_t ret = 0; switch(offset) { case 0: @@ -782,7 +782,7 @@ READ8_MEMBER(ics2115_device::read) ret = m_reg_select; break; case 2: - ret = (UINT8)(reg_read()); + ret = (uint8_t)(reg_read()); break; case 3: ret = reg_read() >> 8; @@ -873,10 +873,10 @@ TIMER_CALLBACK_MEMBER( ics2115_device::timer_cb_1 ) void ics2115_device::recalc_timer(int timer) { //Old regression-based formula (minus constant) - //UINT64 period = m_timer[timer].preset * (m_timer[timer].scale << 16) / 60; + //uint64_t period = m_timer[timer].preset * (m_timer[timer].scale << 16) / 60; //New formula based on O.Galibert's reverse engineering of ICS2115 card firmware - UINT64 period = ((m_timer[timer].scale & 0x1f) + 1) * (m_timer[timer].preset + 1); + uint64_t period = ((m_timer[timer].scale & 0x1f) + 1) * (m_timer[timer].preset + 1); period = (period << (4 + (m_timer[timer].scale >> 5)))*78125/2646; if(m_timer[timer].period != period) { diff --git a/src/devices/sound/ics2115.h b/src/devices/sound/ics2115.h index ee6bab23934..c383b1e11f7 100644 --- a/src/devices/sound/ics2115.h +++ b/src/devices/sound/ics2115.h @@ -22,60 +22,60 @@ struct ics2115_voice { struct { - INT32 left; - UINT32 acc, start, end; - UINT16 fc; - UINT8 ctl, saddr; + int32_t left; + uint32_t acc, start, end; + uint16_t fc; + uint8_t ctl, saddr; } osc; struct { - INT32 left; - UINT32 add; - UINT32 start, end; - UINT32 acc; - UINT16 regacc; - UINT8 incr; - UINT8 pan, mode; + int32_t left; + uint32_t add; + uint32_t start, end; + uint32_t acc; + uint16_t regacc; + uint8_t incr; + uint8_t pan, mode; } vol; union { struct { - UINT8 ulaw : 1; - UINT8 stop : 1; //stops wave + vol envelope - UINT8 eightbit : 1; - UINT8 loop : 1; - UINT8 loop_bidir : 1; - UINT8 irq : 1; - UINT8 invert : 1; - UINT8 irq_pending: 1; + uint8_t ulaw : 1; + uint8_t stop : 1; //stops wave + vol envelope + uint8_t eightbit : 1; + uint8_t loop : 1; + uint8_t loop_bidir : 1; + uint8_t irq : 1; + uint8_t invert : 1; + uint8_t irq_pending: 1; //IRQ on variable? } bitflags; - UINT8 value; + uint8_t value; } osc_conf; union { struct { - UINT8 done : 1; //indicates ramp has stopped - UINT8 stop : 1; //stops the ramp - UINT8 rollover : 1; //rollover (TODO) - UINT8 loop : 1; - UINT8 loop_bidir : 1; - UINT8 irq : 1; //enable IRQ generation - UINT8 invert : 1; //invert direction - UINT8 irq_pending: 1; //(read only) IRQ pending + uint8_t done : 1; //indicates ramp has stopped + uint8_t stop : 1; //stops the ramp + uint8_t rollover : 1; //rollover (TODO) + uint8_t loop : 1; + uint8_t loop_bidir : 1; + uint8_t irq : 1; //enable IRQ generation + uint8_t invert : 1; //invert direction + uint8_t irq_pending: 1; //(read only) IRQ pending //noenvelope == (done | disable) } bitflags; - UINT8 value; + uint8_t value; } vol_ctrl; //Possibly redundant state. => improvements of wavetable logic //may lead to its elimination. union { struct { - UINT8 on : 1; - UINT8 ramp : 7; // 100 0000 = 0x40 maximum + uint8_t on : 1; + uint8_t ramp : 7; // 100 0000 = 0x40 maximum } bitflags; - UINT8 value; + uint8_t value; } state; bool playing(); @@ -90,20 +90,20 @@ class ics2115_device : public device_t, public device_sound_interface { public: // construction/destruction - ics2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ics2115_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); - //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); TIMER_CALLBACK_MEMBER(timer_cb_0); TIMER_CALLBACK_MEMBER(timer_cb_1); sound_stream *m_stream; - static const UINT16 revision = 0x1; + static const uint16_t revision = 0x1; protected: @@ -115,33 +115,33 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; // internal state - required_region_ptr m_rom; + required_region_ptr m_rom; devcb_write_line m_irq_cb; - INT16 m_ulaw[256]; - UINT16 m_volume[4096]; + int16_t m_ulaw[256]; + uint16_t m_volume[4096]; static const int volume_bits = 15; ics2115_voice m_voice[32]; struct { - UINT8 scale, preset; + uint8_t scale, preset; emu_timer *timer; - UINT64 period; /* in nsec */ + uint64_t period; /* in nsec */ } m_timer[2]; - UINT8 m_active_osc; - UINT8 m_osc_select; - UINT8 m_reg_select; - UINT8 m_irq_enabled, m_irq_pending; + uint8_t m_active_osc; + uint8_t m_osc_select; + uint8_t m_reg_select; + uint8_t m_irq_enabled, m_irq_pending; bool m_irq_on; //Unknown variable, seems to be effected by 0x12. Further investigation //Required. - UINT8 m_vmode; + uint8_t m_vmode; //internal register helper functions - UINT16 reg_read(); - void reg_write(UINT8 data, bool msb); + uint16_t reg_read(); + void reg_write(uint8_t data, bool msb); void recalc_timer(int timer); void keyon(); void recalc_irq(); diff --git a/src/devices/sound/iremga20.cpp b/src/devices/sound/iremga20.cpp index 8f5daf20762..2a9e1433e81 100644 --- a/src/devices/sound/iremga20.cpp +++ b/src/devices/sound/iremga20.cpp @@ -46,7 +46,7 @@ const device_type IREMGA20 = &device_creator; // iremga20_device - constructor //------------------------------------------------- -iremga20_device::iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +iremga20_device::iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IREMGA20, "Irem GA20", tag, owner, clock, "iremga20", __FILE__), device_sound_interface(mconfig, *this), m_rom(*this, DEVICE_SELF), @@ -103,8 +103,8 @@ void iremga20_device::device_reset() void iremga20_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - UINT32 rate[4], pos[4], frac[4], end[4], vol[4], play[4]; - UINT8 *pSamples; + uint32_t rate[4], pos[4], frac[4], end[4], vol[4], play[4]; + uint8_t *pSamples; stream_sample_t *outL, *outR; int i, sampleout; diff --git a/src/devices/sound/iremga20.h b/src/devices/sound/iremga20.h index daf1469df74..4c5c064871e 100644 --- a/src/devices/sound/iremga20.h +++ b/src/devices/sound/iremga20.h @@ -27,16 +27,16 @@ struct IremGA20_channel_def { - UINT32 rate; - UINT32 size; - UINT32 start; - UINT32 pos; - UINT32 frac; - UINT32 end; - UINT32 volume; - UINT32 pan; - UINT32 effect; - UINT32 play; + uint32_t rate; + uint32_t size; + uint32_t start; + uint32_t pos; + uint32_t frac; + uint32_t end; + uint32_t volume; + uint32_t pan; + uint32_t effect; + uint32_t play; }; @@ -46,7 +46,7 @@ class iremga20_device : public device_t, public device_sound_interface { public: - iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~iremga20_device() { } protected: @@ -65,9 +65,9 @@ private: void iremga20_reset(); private: - required_region_ptr m_rom; + required_region_ptr m_rom; sound_stream *m_stream; - UINT16 m_regs[0x40]; + uint16_t m_regs[0x40]; IremGA20_channel_def m_channel[4]; }; diff --git a/src/devices/sound/k005289.cpp b/src/devices/sound/k005289.cpp index aa0fa52c110..0a0f004417f 100644 --- a/src/devices/sound/k005289.cpp +++ b/src/devices/sound/k005289.cpp @@ -53,7 +53,7 @@ const device_type K005289 = &device_creator; // k005289_device - constructor //------------------------------------------------- -k005289_device::k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k005289_device::k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K005289, "K005289 SCC", tag, owner, clock, "k005289", __FILE__), device_sound_interface(mconfig, *this), m_sound_prom(*this, DEVICE_SELF), @@ -111,7 +111,7 @@ void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t * int i,v,f; /* zap the contents of the mixer buffer */ - memset(m_mixer_buffer.get(), 0, samples * sizeof(INT16)); + memset(m_mixer_buffer.get(), 0, samples * sizeof(int16_t)); v=m_volume[0]; f=m_frequency[0]; @@ -178,7 +178,7 @@ void k005289_device::make_mixer_table(int voices) int gain = 16; /* allocate memory */ - m_mixer_table = std::make_unique(256 * voices); + m_mixer_table = std::make_unique(256 * voices); /* find the middle of the table */ m_mixer_lookup = m_mixer_table.get() + (128 * voices); diff --git a/src/devices/sound/k005289.h b/src/devices/sound/k005289.h index ad085ba9482..a84378fac98 100644 --- a/src/devices/sound/k005289.h +++ b/src/devices/sound/k005289.h @@ -22,7 +22,7 @@ class k005289_device : public device_t, public device_sound_interface { public: - k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~k005289_device() { } protected: @@ -43,20 +43,20 @@ public: private: void make_mixer_table(int voices); - required_region_ptr m_sound_prom; + required_region_ptr m_sound_prom; sound_stream *m_stream; int m_rate; /* mixer tables and internal buffers */ - std::unique_ptr m_mixer_table; - INT16 *m_mixer_lookup; + std::unique_ptr m_mixer_table; + int16_t *m_mixer_lookup; std::unique_ptr m_mixer_buffer; - UINT32 m_counter[2]; - UINT16 m_frequency[2]; - UINT16 m_freq_latch[2]; - UINT16 m_waveform[2]; - UINT8 m_volume[2]; + uint32_t m_counter[2]; + uint16_t m_frequency[2]; + uint16_t m_freq_latch[2]; + uint16_t m_waveform[2]; + uint8_t m_volume[2]; }; extern const device_type K005289; diff --git a/src/devices/sound/k007232.cpp b/src/devices/sound/k007232.cpp index 1272f7b579b..81e4f19eec7 100644 --- a/src/devices/sound/k007232.cpp +++ b/src/devices/sound/k007232.cpp @@ -147,7 +147,7 @@ static const float kdaca_fn[][2] = { const device_type K007232 = &device_creator; -k007232_device::k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k007232_device::k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K007232, "K007232 PCM Controller", tag, owner, clock, "k007232", __FILE__), device_sound_interface(mconfig, *this), m_rom(*this, DEVICE_SELF), diff --git a/src/devices/sound/k007232.h b/src/devices/sound/k007232.h index 31ab2f4f3a5..d8083ebf867 100644 --- a/src/devices/sound/k007232.h +++ b/src/devices/sound/k007232.h @@ -19,7 +19,7 @@ class k007232_device : public device_t, public device_sound_interface { public: - k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~k007232_device() {} template static devcb_base &set_port_write_handler(device_t &device, _Object object) { return downcast(device).m_port_write_handler.set_callback(object); } @@ -50,21 +50,21 @@ protected: private: // internal state - required_region_ptr m_rom; + required_region_ptr m_rom; - UINT8 m_vol[KDAC_A_PCM_MAX][2]; /* volume for the left and right channel */ - UINT32 m_addr[KDAC_A_PCM_MAX]; - UINT32 m_start[KDAC_A_PCM_MAX]; - UINT32 m_step[KDAC_A_PCM_MAX]; - UINT32 m_bank[KDAC_A_PCM_MAX]; + uint8_t m_vol[KDAC_A_PCM_MAX][2]; /* volume for the left and right channel */ + uint32_t m_addr[KDAC_A_PCM_MAX]; + uint32_t m_start[KDAC_A_PCM_MAX]; + uint32_t m_step[KDAC_A_PCM_MAX]; + uint32_t m_bank[KDAC_A_PCM_MAX]; int m_play[KDAC_A_PCM_MAX]; - UINT8 m_wreg[0x10]; /* write data */ + uint8_t m_wreg[0x10]; /* write data */ - UINT32 m_pcmlimit; + uint32_t m_pcmlimit; sound_stream * m_stream; - UINT32 m_fncode[0x200]; + uint32_t m_fncode[0x200]; devcb_write8 m_port_write_handler; }; diff --git a/src/devices/sound/k051649.cpp b/src/devices/sound/k051649.cpp index dde61572d44..7877d949a9c 100644 --- a/src/devices/sound/k051649.cpp +++ b/src/devices/sound/k051649.cpp @@ -43,7 +43,7 @@ const device_type K051649 = &device_creator; // k051649_device - constructor //------------------------------------------------- -k051649_device::k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k051649_device::k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K051649, "K051649 SCC1", tag, owner, clock, "k051649", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -121,7 +121,7 @@ void k051649_device::sound_stream_update(sound_stream &stream, stream_sample_t * const signed char *w = voice[j].waveram; int v=voice[j].volume * voice[j].key; int c=voice[j].counter; - int step = ((INT64)m_mclock * (1 << FREQ_BITS)) / (float)((voice[j].frequency + 1) * 16 * (m_rate / 32)) + 0.5f; + int step = ((int64_t)m_mclock * (1 << FREQ_BITS)) / (float)((voice[j].frequency + 1) * 16 * (m_rate / 32)) + 0.5f; mix = m_mixer_buffer.get(); @@ -272,7 +272,7 @@ void k051649_device::make_mixer_table(int voices) int i; // allocate memory - m_mixer_table = std::make_unique(512 * voices); + m_mixer_table = std::make_unique(512 * voices); // find the middle of the table m_mixer_lookup = m_mixer_table.get() + (256 * voices); diff --git a/src/devices/sound/k051649.h b/src/devices/sound/k051649.h index f5e4997f02c..787413d257e 100644 --- a/src/devices/sound/k051649.h +++ b/src/devices/sound/k051649.h @@ -46,7 +46,7 @@ class k051649_device : public device_t, public device_sound_interface { public: - k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~k051649_device() { } protected: @@ -81,12 +81,12 @@ private: int m_rate; /* mixer tables and internal buffers */ - std::unique_ptr m_mixer_table; - INT16 *m_mixer_lookup; + std::unique_ptr m_mixer_table; + int16_t *m_mixer_lookup; std::unique_ptr m_mixer_buffer; /* chip registers */ - UINT8 m_test; + uint8_t m_test; }; extern const device_type K051649; diff --git a/src/devices/sound/k053260.cpp b/src/devices/sound/k053260.cpp index 5f1a1a3abfc..992912f46f2 100644 --- a/src/devices/sound/k053260.cpp +++ b/src/devices/sound/k053260.cpp @@ -73,7 +73,7 @@ const device_type K053260 = &device_creator; // k053260_device - constructor //------------------------------------------------- -k053260_device::k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k053260_device::k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K053260, "K053260 KDSC", tag, owner, clock, "k053260", __FILE__) , device_sound_interface(mconfig, *this) , device_rom_interface(mconfig, *this, 21) @@ -141,7 +141,7 @@ WRITE8_MEMBER( k053260_device::main_write ) READ8_MEMBER( k053260_device::read ) { offset &= 0x3f; - UINT8 ret = 0; + uint8_t ret = 0; switch (offset) { @@ -196,7 +196,7 @@ WRITE8_MEMBER( k053260_device::write ) case 0x28: // key on/off { - UINT8 rising_edge = data & ~m_keyon; + uint8_t rising_edge = data & ~m_keyon; for (int i = 0; i < 4; i++) { @@ -334,7 +334,7 @@ void k053260_device::KDSC_Voice::voice_reset() update_pan_volume(); } -void k053260_device::KDSC_Voice::set_register(offs_t offset, UINT8 data) +void k053260_device::KDSC_Voice::set_register(offs_t offset, uint8_t data) { switch (offset & 0x7) { @@ -365,13 +365,13 @@ void k053260_device::KDSC_Voice::set_register(offs_t offset, UINT8 data) } } -void k053260_device::KDSC_Voice::set_loop_kadpcm(UINT8 data) +void k053260_device::KDSC_Voice::set_loop_kadpcm(uint8_t data) { m_loop = BIT(data, 0); m_kadpcm = BIT(data, 4); } -void k053260_device::KDSC_Voice::set_pan(UINT8 data) +void k053260_device::KDSC_Voice::set_pan(uint8_t data) { m_pan = data & 0x7; update_pan_volume(); @@ -408,7 +408,7 @@ void k053260_device::KDSC_Voice::play(stream_sample_t *outputs) { m_counter = m_counter - 0x1000 + m_pitch; - UINT32 bytepos = ++m_position >> ( m_kadpcm ? 1 : 0 ); + uint32_t bytepos = ++m_position >> ( m_kadpcm ? 1 : 0 ); /* Yes, _pre_increment. Playback must start 1 byte position after the start address written to the register, or else ADPCM sounds will @@ -432,12 +432,12 @@ void k053260_device::KDSC_Voice::play(stream_sample_t *outputs) } } - UINT8 romdata = m_device->read_byte(m_start + bytepos); + uint8_t romdata = m_device->read_byte(m_start + bytepos); if (m_kadpcm) { if (m_position & 1) romdata >>= 4; // decode low nybble, then high nybble - static const INT8 kadpcm_table[] = {0,1,2,4,8,16,32,64,-128,-64,-32,-16,-8,-4,-2,-1}; + static const int8_t kadpcm_table[] = {0,1,2,4,8,16,32,64,-128,-64,-32,-16,-8,-4,-2,-1}; m_output += kadpcm_table[romdata & 0xf]; } else @@ -450,9 +450,9 @@ void k053260_device::KDSC_Voice::play(stream_sample_t *outputs) outputs[1] += m_output * m_pan_volume[1]; } -UINT8 k053260_device::KDSC_Voice::read_rom() +uint8_t k053260_device::KDSC_Voice::read_rom() { - UINT32 offs = m_start + m_position; + uint32_t offs = m_start + m_position; m_position = (m_position + 1) & 0xffff; diff --git a/src/devices/sound/k053260.h b/src/devices/sound/k053260.h index 7ac63bfced3..dc5cd431c8b 100644 --- a/src/devices/sound/k053260.h +++ b/src/devices/sound/k053260.h @@ -36,7 +36,7 @@ class k053260_device : public device_t, public device_rom_interface { public: - k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~k053260_device() { } DECLARE_READ8_MEMBER( main_read ); @@ -60,9 +60,9 @@ private: sound_stream * m_stream; // live state - UINT8 m_portdata[4]; - UINT8 m_keyon; - UINT8 m_mode; + uint8_t m_portdata[4]; + uint8_t m_keyon; + uint8_t m_mode; // per voice state class KDSC_Voice @@ -74,35 +74,35 @@ private: inline void voice_start(k053260_device &device, int index); inline void voice_reset(); - inline void set_register(offs_t offset, UINT8 data); - inline void set_loop_kadpcm(UINT8 data); - inline void set_pan(UINT8 data); + inline void set_register(offs_t offset, uint8_t data); + inline void set_loop_kadpcm(uint8_t data); + inline void set_pan(uint8_t data); inline void update_pan_volume(); inline void key_on(); inline void key_off(); inline void play(stream_sample_t *outputs); inline bool playing() { return m_playing; } - inline UINT8 read_rom(); + inline uint8_t read_rom(); private: // pointer to owning device k053260_device *m_device; // live state - UINT32 m_position; - UINT16 m_pan_volume[2]; - UINT16 m_counter; - INT8 m_output; + uint32_t m_position; + uint16_t m_pan_volume[2]; + uint16_t m_counter; + int8_t m_output; bool m_playing; // per voice registers - UINT32 m_start; - UINT16 m_length; - UINT16 m_pitch; - UINT8 m_volume; + uint32_t m_start; + uint16_t m_length; + uint16_t m_pitch; + uint8_t m_volume; // bit packed registers - UINT8 m_pan; + uint8_t m_pan; bool m_loop; bool m_kadpcm; } m_voice[4]; diff --git a/src/devices/sound/k054539.cpp b/src/devices/sound/k054539.cpp index 41a2161569b..c275494557a 100644 --- a/src/devices/sound/k054539.cpp +++ b/src/devices/sound/k054539.cpp @@ -17,7 +17,7 @@ const device_type K054539 = &device_creator; #define VERBOSE 0 #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -k054539_device::k054539_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k054539_device::k054539_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K054539, "K054539 ADPCM", tag, owner, clock, "k054539", __FILE__), device_sound_interface(mconfig, *this), flags(0), @@ -108,13 +108,13 @@ void k054539_device::sound_stream_update(sound_stream &stream, stream_sample_t * { #define VOL_CAP 1.80 - static const INT16 dpcm[16] = { + static const int16_t dpcm[16] = { 0 * 0x100, 1 * 0x100, 4 * 0x100, 9 * 0x100, 16 * 0x100, 25 * 0x100, 36 * 0x100, 49 * 0x100, -64 * 0x100, -49 * 0x100, -36 * 0x100, -25 * 0x100, -16 * 0x100, -9 * 0x100, -4 * 0x100, -1 * 0x100 }; - INT16 *rbase = (INT16 *)ram.get(); + int16_t *rbase = (int16_t *)ram.get(); if(!(regs[0x22f] & 1)) return; @@ -199,12 +199,12 @@ void k054539_device::sound_stream_update(sound_stream &stream, stream_sample_t * cur_pos += pdelta; cur_pval = cur_val; - cur_val = (INT16)(m_rom[cur_pos] << 8); - if(cur_val == (INT16)0x8000 && (base2[1] & 1)) { + cur_val = (int16_t)(m_rom[cur_pos] << 8); + if(cur_val == (int16_t)0x8000 && (base2[1] & 1)) { cur_pos = (base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask; - cur_val = (INT16)(m_rom[cur_pos] << 8); + cur_val = (int16_t)(m_rom[cur_pos] << 8); } - if(cur_val == (INT16)0x8000) { + if(cur_val == (int16_t)0x8000) { keyoff(ch); cur_val = 0; break; @@ -222,12 +222,12 @@ void k054539_device::sound_stream_update(sound_stream &stream, stream_sample_t * cur_pos += pdelta; cur_pval = cur_val; - cur_val = (INT16)(m_rom[cur_pos] | m_rom[cur_pos+1]<<8); - if(cur_val == (INT16)0x8000 && (base2[1] & 1)) { + cur_val = (int16_t)(m_rom[cur_pos] | m_rom[cur_pos+1]<<8); + if(cur_val == (int16_t)0x8000 && (base2[1] & 1)) { cur_pos = (base1[0x08] | (base1[0x09] << 8) | (base1[0x0a] << 16)) & rom_mask; - cur_val = (INT16)(m_rom[cur_pos] | m_rom[cur_pos+1]<<8); + cur_val = (int16_t)(m_rom[cur_pos] | m_rom[cur_pos+1]<<8); } - if(cur_val == (INT16)0x8000) { + if(cur_val == (int16_t)0x8000) { keyoff(ch); cur_val = 0; break; @@ -283,7 +283,7 @@ void k054539_device::sound_stream_update(sound_stream &stream, stream_sample_t * } lval += cur_val * lvol; rval += cur_val * rvol; - rbase[(rdelta + reverb_pos) & 0x1fff] += INT16(cur_val*rbvol); + rbase[(rdelta + reverb_pos) & 0x1fff] += int16_t(cur_val*rbvol); chan->pos = cur_pos; chan->pfrac = cur_pfrac; @@ -297,8 +297,8 @@ void k054539_device::sound_stream_update(sound_stream &stream, stream_sample_t * } } reverb_pos = (reverb_pos + 1) & 0x1fff; - outputs[0][sample] = INT16(lval); - outputs[1][sample] = INT16(rval); + outputs[0][sample] = int16_t(lval); + outputs[1][sample] = int16_t(rval); } } @@ -315,7 +315,7 @@ void k054539_device::init_chip() memset(posreg_latch, 0, sizeof(posreg_latch)); //* flags |= UPDATE_AT_KEYON; //* make it default until proven otherwise - ram = std::make_unique(0x4000); + ram = std::make_unique(0x4000); reverb_pos = 0; cur_ptr = 0; memset(ram.get(), 0, 0x4000); @@ -387,8 +387,8 @@ WRITE8_MEMBER(k054539_device::write) { if(data & (1<(device).m_apan_cb = callback; } @@ -80,34 +80,34 @@ protected: private: struct channel { - UINT32 pos; - UINT32 pfrac; - INT32 val; - INT32 pval; + uint32_t pos; + uint32_t pfrac; + int32_t val; + int32_t pval; }; double voltab[256]; double pantab[0xf]; double gain[8]; - UINT8 posreg_latch[8][3]; + uint8_t posreg_latch[8][3]; int flags; unsigned char regs[0x230]; - std::unique_ptr ram; + std::unique_ptr ram; int reverb_pos; - INT32 cur_ptr; + int32_t cur_ptr; int cur_limit; unsigned char *cur_zone; - required_region_ptr m_rom; - UINT32 rom_mask; + required_region_ptr m_rom; + uint32_t rom_mask; channel channels[8]; sound_stream *stream; emu_timer *m_timer; - UINT32 m_timer_state; + uint32_t m_timer_state; devcb_write_line m_timer_handler; k054539_cb_delegate m_apan_cb; diff --git a/src/devices/sound/k056800.cpp b/src/devices/sound/k056800.cpp index 908a0b2d42c..19e572d2c72 100644 --- a/src/devices/sound/k056800.cpp +++ b/src/devices/sound/k056800.cpp @@ -20,7 +20,7 @@ const device_type K056800 = &device_creator; // k056800_device - constructor //------------------------------------------------- -k056800_device::k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +k056800_device::k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K056800, "K056800 MIRAC", tag, owner, clock, "k056800", __FILE__), m_int_pending(false), m_int_enabled(false), m_int_handler(*this) { @@ -60,8 +60,8 @@ void k056800_device::device_reset() READ8_MEMBER( k056800_device::host_r ) { - UINT32 r = offset & 7; - UINT8 data = 0; + uint32_t r = offset & 7; + uint8_t data = 0; switch (r) { @@ -82,7 +82,7 @@ READ8_MEMBER( k056800_device::host_r ) WRITE8_MEMBER( k056800_device::host_w ) { - UINT32 r = offset & 7; + uint32_t r = offset & 7; switch (r) { @@ -120,8 +120,8 @@ WRITE8_MEMBER( k056800_device::host_w ) READ8_MEMBER( k056800_device::sound_r ) { - UINT32 r = offset & 7; - UINT8 data = 0; + uint32_t r = offset & 7; + uint8_t data = 0; switch (r) { @@ -139,7 +139,7 @@ READ8_MEMBER( k056800_device::sound_r ) WRITE8_MEMBER( k056800_device::sound_w ) { - UINT32 r = offset & 7; + uint32_t r = offset & 7; switch (r) { diff --git a/src/devices/sound/k056800.h b/src/devices/sound/k056800.h index 8126fa6b868..d17a8943c5e 100644 --- a/src/devices/sound/k056800.h +++ b/src/devices/sound/k056800.h @@ -29,7 +29,7 @@ class k056800_device : public device_t { public: // construction/destruction - k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template static devcb_base &set_int_handler(device_t &device, _Object object) { return downcast(device).m_int_handler.set_callback(object); } @@ -48,8 +48,8 @@ private: // internal state bool m_int_pending; bool m_int_enabled; - UINT8 m_host_to_snd_regs[4]; - UINT8 m_snd_to_host_regs[2]; + uint8_t m_host_to_snd_regs[4]; + uint8_t m_snd_to_host_regs[2]; devcb_write_line m_int_handler; }; diff --git a/src/devices/sound/l7a1045_l6028_dsp_a.cpp b/src/devices/sound/l7a1045_l6028_dsp_a.cpp index ef2e4991b9c..1b3f2ced640 100644 --- a/src/devices/sound/l7a1045_l6028_dsp_a.cpp +++ b/src/devices/sound/l7a1045_l6028_dsp_a.cpp @@ -100,7 +100,7 @@ const device_type L7A1045 = &device_creator; // l7a1045_sound_device - constructor //------------------------------------------------- -l7a1045_sound_device::l7a1045_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +l7a1045_sound_device::l7a1045_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, L7A1045, "L7A1045 L6028 DSP-A", tag, owner, clock, "l7a1045_custom", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -137,17 +137,17 @@ void l7a1045_sound_device::sound_stream_update(sound_stream &stream, stream_samp { l7a1045_voice *vptr = &m_voice[i]; - UINT32 start = vptr->start; - UINT32 end = vptr->end; - UINT32 step = 0x400; + uint32_t start = vptr->start; + uint32_t end = vptr->end; + uint32_t step = 0x400; - UINT32 pos = vptr->pos; - UINT32 frac = vptr->frac; + uint32_t pos = vptr->pos; + uint32_t frac = vptr->frac; for (int j = 0; j < samples; j++) { - INT32 sample; - UINT8 data; + int32_t sample; + uint8_t data; pos += (frac >> 12); frac &= 0xfff; @@ -168,7 +168,7 @@ void l7a1045_sound_device::sound_stream_update(sound_stream &stream, stream_samp data = m_rom[(start + pos) & m_rom.mask()]; - sample = ((INT8)(data & 0xfc)) << (3 - (data & 3)); + sample = ((int8_t)(data & 0xfc)) << (3 - (data & 3)); frac += step; outputs[0][j] += ((sample * vptr->l_volume) >> 9); @@ -302,8 +302,8 @@ READ16_MEMBER(l7a1045_sound_device::sound_data_r) { case 0x00: { - UINT32 current_addr; - UINT16 res; + uint32_t current_addr; + uint16_t res; current_addr = vptr->start + vptr->pos; if(offset == 0) diff --git a/src/devices/sound/l7a1045_l6028_dsp_a.h b/src/devices/sound/l7a1045_l6028_dsp_a.h index 49c5670263d..4d2f7692c44 100644 --- a/src/devices/sound/l7a1045_l6028_dsp_a.h +++ b/src/devices/sound/l7a1045_l6028_dsp_a.h @@ -10,17 +10,17 @@ struct l7a1045_voice pos(0), frac(0), l_volume(0), r_volume(0) { - //memset(regs, 0, sizeof(UINT32)*8); + //memset(regs, 0, sizeof(uint32_t)*8); start = 0; } - UINT32 start; - UINT32 end; + uint32_t start; + uint32_t end; bool mode; - UINT32 pos; - UINT32 frac; - UINT16 l_volume; - UINT16 r_volume; + uint32_t pos; + uint32_t frac; + uint16_t l_volume; + uint16_t r_volume; }; // ======================> l7a1045_sound_device @@ -29,10 +29,10 @@ class l7a1045_sound_device : public device_t, public device_sound_interface { public: - l7a1045_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + l7a1045_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~l7a1045_sound_device() { } -// void set_base(INT8* base) { m_base = base; } +// void set_base(int8_t* base) { m_base = base; } DECLARE_WRITE16_MEMBER( l7a1045_sound_w ); DECLARE_READ16_MEMBER( l7a1045_sound_r ); @@ -47,14 +47,14 @@ protected: private: sound_stream *m_stream; l7a1045_voice m_voice[32]; - UINT32 m_key; - required_region_ptr m_rom; + uint32_t m_key; + required_region_ptr m_rom; - UINT8 m_audiochannel; - UINT8 m_audioregister; + uint8_t m_audiochannel; + uint8_t m_audioregister; struct l7a1045_48bit_data { - UINT16 dat[3]; + uint16_t dat[3]; }; l7a1045_48bit_data m_audiodat[0x10][0x20]; diff --git a/src/devices/sound/lmc1992.cpp b/src/devices/sound/lmc1992.cpp index f4007ea875d..a55b26075ce 100644 --- a/src/devices/sound/lmc1992.cpp +++ b/src/devices/sound/lmc1992.cpp @@ -138,7 +138,7 @@ inline void lmc1992_device::execute_command(int addr, int data) // lmc1992_device - constructor //------------------------------------------------- -lmc1992_device::lmc1992_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lmc1992_device::lmc1992_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LMC1992, "LMC1992", tag, owner, clock, "lmc1992", __FILE__), device_sound_interface(mconfig, *this) { @@ -218,9 +218,9 @@ WRITE_LINE_MEMBER( lmc1992_device::enable_w ) { if ((m_enable == 0) && (state == 1)) { - UINT8 device_addr = (m_si & 0xc000) >> 14; - UINT8 addr = (m_si & 0x3800) >> 11; - UINT8 data = (m_si & 0x07e0) >> 5; + uint8_t device_addr = (m_si & 0xc000) >> 14; + uint8_t addr = (m_si & 0x3800) >> 11; + uint8_t data = (m_si & 0x07e0) >> 5; if (device_addr == MICROWIRE_DEVICE_ADDRESS) { diff --git a/src/devices/sound/lmc1992.h b/src/devices/sound/lmc1992.h index 198b8e46dd3..d38003de183 100644 --- a/src/devices/sound/lmc1992.h +++ b/src/devices/sound/lmc1992.h @@ -71,7 +71,7 @@ class lmc1992_device : public device_t, { public: // construction/destruction - lmc1992_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lmc1992_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER( clock_w ); DECLARE_WRITE_LINE_MEMBER( data_w ); @@ -92,7 +92,7 @@ private: int m_enable; // enable latch int m_data; // data latch int m_clk; // clock latch - UINT16 m_si; // serial in shift register + uint16_t m_si; // serial in shift register int m_input; // input select int m_bass; // bass diff --git a/src/devices/sound/mas3507d.cpp b/src/devices/sound/mas3507d.cpp index 7b081d0a4bf..ecf54a5b9f4 100644 --- a/src/devices/sound/mas3507d.cpp +++ b/src/devices/sound/mas3507d.cpp @@ -10,7 +10,7 @@ // device type definition const device_type MAS3507D = &device_creator; -mas3507d_device::mas3507d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mas3507d_device::mas3507d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MAS3507D, "MAS3507D", tag, owner, clock, "mas3507d", __FILE__), device_sound_interface(mconfig, *this), i2c_bus_state(), i2c_bus_address(), i2c_scli(false), i2c_sclo(false), i2c_sdai(false), i2c_sdao(false), i2c_bus_curbit(0), i2c_bus_curval(0), i2c_subdest(), i2c_command(), i2c_bytecount(0), i2c_io_bank(0), i2c_io_adr(0), i2c_io_count(0), i2c_io_val(0) @@ -108,13 +108,13 @@ int mas3507d_device::i2c_sda_r() return i2c_sdai && i2c_sdao; } -bool mas3507d_device::i2c_device_got_address(UINT8 address) +bool mas3507d_device::i2c_device_got_address(uint8_t address) { i2c_subdest = UNDEFINED; return (address & 0xfe) == 0x3a; } -void mas3507d_device::i2c_device_got_byte(UINT8 byte) +void mas3507d_device::i2c_device_got_byte(uint8_t byte) { switch(i2c_subdest) { case UNDEFINED: @@ -196,8 +196,8 @@ void mas3507d_device::i2c_device_got_byte(UINT8 byte) case 5: i2c_io_adr |= byte; break; } if(i2c_bytecount >= 6) { - UINT32 i2c_wordid = (i2c_bytecount - 6) >> 2; - UINT32 i2c_offset = (i2c_bytecount - 6) & 3; + uint32_t i2c_wordid = (i2c_bytecount - 6) >> 2; + uint32_t i2c_offset = (i2c_bytecount - 6) & 3; if(i2c_wordid >= i2c_io_count) { i2c_nak(); return; @@ -225,7 +225,7 @@ void mas3507d_device::i2c_device_got_stop() logerror("MAS I2C: got stop\n"); } -void mas3507d_device::mem_write(int bank, UINT32 adr, UINT32 val) +void mas3507d_device::mem_write(int bank, uint32_t adr, uint32_t val) { switch(adr | (bank ? 0x10000 : 0)) { case 0x0032f: logerror("MAS3507D: OutputConfig = %05x\n", val); break; @@ -237,7 +237,7 @@ void mas3507d_device::mem_write(int bank, UINT32 adr, UINT32 val) } } -void mas3507d_device::reg_write(UINT32 adr, UINT32 val) +void mas3507d_device::reg_write(uint32_t adr, uint32_t val) { switch(adr) { case 0x8e: logerror("MAS3507D: DCCF = %05x\n", val); break; @@ -250,7 +250,7 @@ void mas3507d_device::reg_write(UINT32 adr, UINT32 val) } } -void mas3507d_device::run_program(UINT32 adr) +void mas3507d_device::run_program(uint32_t adr) { switch(adr) { case 0xfcb: logerror("MAS3507D: validate OutputConfig\n"); break; diff --git a/src/devices/sound/mas3507d.h b/src/devices/sound/mas3507d.h index 1244f152ede..844a09c47aa 100644 --- a/src/devices/sound/mas3507d.h +++ b/src/devices/sound/mas3507d.h @@ -24,7 +24,7 @@ class mas3507d_device : public device_t, public device_sound_interface { public: // construction/destruction - mas3507d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mas3507d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); int i2c_scl_r(); int i2c_sda_r(); @@ -42,23 +42,23 @@ private: bool i2c_scli, i2c_sclo, i2c_sdai, i2c_sdao; int i2c_bus_curbit; - UINT8 i2c_bus_curval; + uint8_t i2c_bus_curval; void i2c_nak(); - bool i2c_device_got_address(UINT8 address); - void i2c_device_got_byte(UINT8 byte); + bool i2c_device_got_address(uint8_t address); + void i2c_device_got_byte(uint8_t byte); void i2c_device_got_stop(); enum { UNDEFINED, CONTROL, DATA, BAD } i2c_subdest; enum { CMD_BAD, CMD_RUN, CMD_READ_CTRL, CMD_WRITE_REG, CMD_WRITE_MEM, CMD_READ_REG, CMD_READ_MEM } i2c_command; int i2c_bytecount; - UINT32 i2c_io_bank, i2c_io_adr, i2c_io_count, i2c_io_val; + uint32_t i2c_io_bank, i2c_io_adr, i2c_io_count, i2c_io_val; - void mem_write(int bank, UINT32 adr, UINT32 val); - void run_program(UINT32 adr); - void reg_write(UINT32 adr, UINT32 val); + void mem_write(int bank, uint32_t adr, uint32_t val); + void run_program(uint32_t adr); + void reg_write(uint32_t adr, uint32_t val); }; diff --git a/src/devices/sound/mea8000.cpp b/src/devices/sound/mea8000.cpp index 481561a7fcf..c3fd263aaba 100644 --- a/src/devices/sound/mea8000.cpp +++ b/src/devices/sound/mea8000.cpp @@ -114,7 +114,7 @@ static const int pi_table[32] = const device_type MEA8000 = &device_creator; -mea8000_device::mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mea8000_device::mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MEA8000, "Philips / Signetics MEA 8000 speech synthesizer", tag, owner, clock, "mea8000", __FILE__), device_sound_interface(mconfig, *this), m_write_req(*this), @@ -205,12 +205,12 @@ void mea8000_device::init_tables() } -#ifndef FLOAT_MODE /* UINT16 version */ +#ifndef FLOAT_MODE /* uint16_t version */ /* linear interpolation */ -int mea8000_device::interp( UINT16 org, UINT16 dst ) +int mea8000_device::interp( uint16_t org, uint16_t dst ) { return org + (((dst - org) * m_framepos) >> m_framelog); } diff --git a/src/devices/sound/mea8000.h b/src/devices/sound/mea8000.h index 155249729b9..ec468a309fb 100644 --- a/src/devices/sound/mea8000.h +++ b/src/devices/sound/mea8000.h @@ -46,9 +46,9 @@ struct filter_t double bw, last_bw; /* band-width, in Hz */ double output, last_output; /* filter state */ #else - UINT16 fm, last_fm; - UINT16 bw, last_bw; - INT32 output, last_output; + uint16_t fm, last_fm; + uint16_t bw, last_bw; + int32_t output, last_output; #endif }; @@ -56,7 +56,7 @@ class mea8000_device : public device_t, public device_sound_interface { public: - mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mea8000_device() {} template static devcb_base &set_req_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_req.set_callback(object); } @@ -75,8 +75,8 @@ private: int accept_byte(); void update_req(); void init_tables(); -#ifndef FLOAT_MODE /* UINT16 version */ - int interp(UINT16 org, UINT16 dst); +#ifndef FLOAT_MODE /* uint16_t version */ + int interp(uint16_t org, uint16_t dst); int filter_step(int i, int input); int noise_gen(); int freq_gen(); @@ -101,25 +101,25 @@ private: /* state */ mea8000_state m_state; /* current state */ - UINT8 m_buf[4]; /* store 4 consecutive data to form a frame info */ - UINT8 m_bufpos; /* new byte to write in frame info buffer */ + uint8_t m_buf[4]; /* store 4 consecutive data to form a frame info */ + uint8_t m_bufpos; /* new byte to write in frame info buffer */ - UINT8 m_cont; /* if no data 0=stop 1=repeat last frame */ - UINT8 m_roe; /* enable req output, now unimplemented */ + uint8_t m_cont; /* if no data 0=stop 1=repeat last frame */ + uint8_t m_roe; /* enable req output, now unimplemented */ - UINT16 m_framelength; /* in samples */ - UINT16 m_framepos; /* in samples */ - UINT16 m_framelog; /* log2 of framelength */ + uint16_t m_framelength; /* in samples */ + uint16_t m_framepos; /* in samples */ + uint16_t m_framelog; /* log2 of framelength */ - INT16 m_lastsample, m_sample; /* output samples are interpolated */ + int16_t m_lastsample, m_sample; /* output samples are interpolated */ - UINT32 m_phi; /* absolute phase for frequency / noise generator */ + uint32_t m_phi; /* absolute phase for frequency / noise generator */ filter_t m_f[4]; /* filters */ - UINT16 m_last_ampl, m_ampl; /* amplitude * 1000 */ - UINT16 m_last_pitch, m_pitch; /* pitch of sawtooth signal, in Hz */ - UINT8 m_noise; + uint16_t m_last_ampl, m_ampl; /* amplitude * 1000 */ + uint16_t m_last_pitch, m_pitch; /* pitch of sawtooth signal, in Hz */ + uint8_t m_noise; emu_timer *m_timer; sound_stream * m_stream; diff --git a/src/devices/sound/mos6560.cpp b/src/devices/sound/mos6560.cpp index f7c31e96ea9..6d35f6bc9f1 100644 --- a/src/devices/sound/mos6560.cpp +++ b/src/devices/sound/mos6560.cpp @@ -155,14 +155,14 @@ static const rgb_t PALETTE_MOS[] = IMPLEMENTATION *****************************************************************************/ -inline UINT8 mos6560_device::read_videoram(offs_t offset) +inline uint8_t mos6560_device::read_videoram(offs_t offset) { m_last_data = space(AS_0).read_byte(offset & 0x3fff); return m_last_data; } -inline UINT8 mos6560_device::read_colorram(offs_t offset) +inline uint8_t mos6560_device::read_colorram(offs_t offset) { return space(AS_1).read_byte(offset & 0x3ff); } @@ -171,7 +171,7 @@ inline UINT8 mos6560_device::read_colorram(offs_t offset) draw_character -------------------------------------------------*/ -void mos6560_device::draw_character( int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color ) +void mos6560_device::draw_character( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color ) { int y, code; @@ -195,7 +195,7 @@ void mos6560_device::draw_character( int ybegin, int yend, int ch, int yoff, int draw_character_multi -------------------------------------------------*/ -void mos6560_device::draw_character_multi( int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color ) +void mos6560_device::draw_character_multi( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color ) { int y, code; @@ -455,7 +455,7 @@ WRITE_LINE_MEMBER( mos6560_device::lp_w ) // TODO } -UINT8 mos6560_device::bus_r() +uint8_t mos6560_device::bus_r() { return m_last_data; } @@ -481,7 +481,7 @@ void mos6560_device::raster_interrupt_gen() main screen bitmap -------------------------------------------------*/ -UINT32 mos6560_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mos6560_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); @@ -626,7 +626,7 @@ void mos6560_device::sound_start() /* buffer for fastest played sample for 5 second so we have enough data for min 5 second */ m_noisesize = NOISE_FREQUENCY_MAX * NOISE_BUFFER_SIZE_SEC; - m_noise = std::make_unique(m_noisesize); + m_noise = std::make_unique(m_noisesize); { int noiseshift = 0x7ffff8; char data; @@ -661,11 +661,11 @@ void mos6560_device::sound_start() if (m_tonesize > 0) { - m_tone = std::make_unique(m_tonesize); + m_tone = std::make_unique(m_tonesize); for (i = 0; i < m_tonesize; i++) { - m_tone[i] = (INT16)(sin (2 * M_PI * i / m_tonesize) * 127 + 0.5); + m_tone[i] = (int16_t)(sin (2 * M_PI * i / m_tonesize) * 127 + 0.5); } } else @@ -688,7 +688,7 @@ static ADDRESS_MAP_START( mos6560_colorram_map, AS_1, 8, mos6560_device ) AM_RANGE(0x000, 0x3ff) AM_RAM ADDRESS_MAP_END -mos6560_device::mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +mos6560_device::mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), device_sound_interface(mconfig, *this), @@ -701,7 +701,7 @@ mos6560_device::mos6560_device(const machine_config &mconfig, device_type type, { } -mos6560_device::mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6560_device::mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS6560, "MOS6560", tag, owner, clock, "mos6560", __FILE__), device_memory_interface(mconfig, *this), device_sound_interface(mconfig, *this), @@ -714,10 +714,10 @@ mos6560_device::mos6560_device(const machine_config &mconfig, const char *tag, d { } -mos6561_device::mos6561_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6561_device::mos6561_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :mos6560_device(mconfig, MOS6561, "MOS6561", tag, owner, clock, TYPE_6561, "mos6561", __FILE__) { } -mos656x_attack_ufo_device::mos656x_attack_ufo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos656x_attack_ufo_device::mos656x_attack_ufo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :mos6560_device(mconfig, MOS656X_ATTACK_UFO, "MOS656X", tag, owner, clock, TYPE_ATTACK_UFO, "mos656x_attack_ufo", __FILE__) { } diff --git a/src/devices/sound/mos6560.h b/src/devices/sound/mos6560.h index d84897027d5..c004a6252a4 100644 --- a/src/devices/sound/mos6560.h +++ b/src/devices/sound/mos6560.h @@ -135,8 +135,8 @@ class mos6560_device : public device_t, public device_video_interface { public: - mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6560_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_potx_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_potx.set_callback(object); } template static devcb_base &set_poty_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_poty.set_callback(object); } @@ -146,11 +146,11 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - UINT8 bus_r(); + uint8_t bus_r(); DECLARE_WRITE_LINE_MEMBER( lp_w ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: enum @@ -173,11 +173,11 @@ protected: // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; - inline UINT8 read_videoram(offs_t offset); - inline UINT8 read_colorram(offs_t offset); + inline uint8_t read_videoram(offs_t offset); + inline uint8_t read_colorram(offs_t offset); - void draw_character( int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color ); - void draw_character_multi( int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color ); + void draw_character( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color ); + void draw_character_multi( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color ); void drawlines( int first, int last ); void soundport_w( int offset, int data ); void sound_start(); @@ -191,7 +191,7 @@ protected: devcb_read8 m_read_potx; devcb_read8 m_read_poty; - UINT8 m_reg[16]; + uint8_t m_reg[16]; bitmap_rgb32 m_bitmap; @@ -204,16 +204,16 @@ protected: int m_chargenaddr, m_videoaddr; /* values in videoformat */ - UINT16 m_backgroundcolor, m_framecolor, m_helpercolor; + uint16_t m_backgroundcolor, m_framecolor, m_helpercolor; /* arrays for bit to color conversion without condition checking */ - UINT16 m_mono[2], m_monoinverted[2], m_multi[4], m_multiinverted[4]; + uint16_t m_mono[2], m_monoinverted[2], m_multi[4], m_multiinverted[4]; /* video chip settings */ int m_total_xsize, m_total_ysize, m_total_lines, m_total_vretracerate; /* DMA */ - UINT8 m_last_data; + uint8_t m_last_data; /* sound part */ int m_tone1pos, m_tone2pos, m_tone3pos, @@ -223,8 +223,8 @@ protected: m_noisesamples; /* count of samples to give out per tone */ sound_stream *m_channel; - std::unique_ptr m_tone; - std::unique_ptr m_noise; + std::unique_ptr m_tone; + std::unique_ptr m_noise; emu_timer *m_line_timer; }; @@ -236,7 +236,7 @@ class mos6561_device : public mos6560_device { public: // construction/destruction - mos6561_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6561_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -246,7 +246,7 @@ class mos656x_attack_ufo_device : public mos6560_device { public: // construction/destruction - mos656x_attack_ufo_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos656x_attack_ufo_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/sound/mos6581.cpp b/src/devices/sound/mos6581.cpp index 6f9a4ae24cb..47ec1909467 100644 --- a/src/devices/sound/mos6581.cpp +++ b/src/devices/sound/mos6581.cpp @@ -37,7 +37,7 @@ const device_type MOS8580 = &device_creator; // mos6581_device - constructor //------------------------------------------------- -mos6581_device::mos6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +mos6581_device::mos6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_sound_interface(mconfig, *this), m_read_potx(*this), @@ -48,7 +48,7 @@ mos6581_device::mos6581_device(const machine_config &mconfig, device_type type, m_token = global_alloc_clear(); } -mos6581_device::mos6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6581_device::mos6581_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS6581, "MOS6581", tag, owner, clock, "mos6581", __FILE__), device_sound_interface(mconfig, *this), m_read_potx(*this), @@ -68,7 +68,7 @@ mos6581_device::~mos6581_device() // mos8580_device - constructor //------------------------------------------------- -mos8580_device::mos8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8580_device::mos8580_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mos6581_device(mconfig, MOS8580, "MOS8580", tag, owner, clock, TYPE_8580, "mos8580", __FILE__) { } @@ -126,7 +126,7 @@ void mos6581_device::sound_stream_update(sound_stream &stream, stream_sample_t * READ8_MEMBER( mos6581_device::read ) { - UINT8 data; + uint8_t data; switch (offset & 0x1f) { diff --git a/src/devices/sound/mos6581.h b/src/devices/sound/mos6581.h index f0e31e7dab0..d0a0e611e17 100644 --- a/src/devices/sound/mos6581.h +++ b/src/devices/sound/mos6581.h @@ -56,8 +56,8 @@ class mos6581_device : public device_t, public device_sound_interface { public: - mos6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - mos6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + mos6581_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~mos6581_device(); template static devcb_base &set_potx_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_potx.set_callback(object); } @@ -97,7 +97,7 @@ private: class mos8580_device : public mos6581_device { public: - mos8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8580_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/sound/mos7360.cpp b/src/devices/sound/mos7360.cpp index 6478d931111..ca70ad888ea 100644 --- a/src/devices/sound/mos7360.cpp +++ b/src/devices/sound/mos7360.cpp @@ -219,7 +219,7 @@ inline int mos7360_device::rastercolumn() return (int) ((machine().time().as_double() - m_rastertime) * TED7360_VRETRACERATE * m_lines * 57 * 8 + 0.5); } -inline UINT8 mos7360_device::read_ram(offs_t offset) +inline uint8_t mos7360_device::read_ram(offs_t offset) { int rom = m_rom; m_rom = 0; @@ -231,7 +231,7 @@ inline UINT8 mos7360_device::read_ram(offs_t offset) return m_last_data; } -inline UINT8 mos7360_device::read_rom(offs_t offset) +inline uint8_t mos7360_device::read_rom(offs_t offset) { int rom = m_rom; m_rom = 1; @@ -253,7 +253,7 @@ inline UINT8 mos7360_device::read_rom(offs_t offset) // mos7360_device - constructor //------------------------------------------------- -mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos7360_device::mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MOS7360, "MOS7360", tag, owner, clock, "mos7360", __FILE__), device_memory_interface(mconfig, *this), device_sound_interface(mconfig, *this), @@ -297,11 +297,11 @@ void mos7360_device::device_start() // buffer for fastest played sample for 5 second so we have enough data for min 5 second m_noisesize = NOISE_FREQUENCY_MAX * NOISE_BUFFER_SIZE_SEC; - m_noise = std::make_unique(m_noisesize); + m_noise = std::make_unique(m_noisesize); { int noiseshift = 0x7ffff8; - UINT8 data; + uint8_t data; for (int i = 0; i < m_noisesize; i++) { @@ -507,7 +507,7 @@ void mos7360_device::sound_stream_update(sound_stream &stream, stream_sample_t * } -void mos7360_device::draw_character(int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color) +void mos7360_device::draw_character(int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color) { int y, code; @@ -814,9 +814,9 @@ void mos7360_device::soundport_w(int offset, int data) // read - register read //------------------------------------------------- -UINT8 mos7360_device::read(address_space &space, offs_t offset, int &cs0, int &cs1) +uint8_t mos7360_device::read(address_space &space, offs_t offset, int &cs0, int &cs1) { - UINT8 val = m_last_data; + uint8_t val = m_last_data; cs0 = cs0_r(offset); cs1 = cs1_r(offset); @@ -898,7 +898,7 @@ UINT8 mos7360_device::read(address_space &space, offs_t offset, int &cs0, int &c // write - register write //------------------------------------------------- -void mos7360_device::write(address_space &space, offs_t offset, UINT8 data, int &cs0, int &cs1) +void mos7360_device::write(address_space &space, offs_t offset, uint8_t data, int &cs0, int &cs1) { int old; @@ -1137,7 +1137,7 @@ void mos7360_device::write(address_space &space, offs_t offset, UINT8 data, int // update_screen - update screen //------------------------------------------------- -UINT32 mos7360_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mos7360_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); diff --git a/src/devices/sound/mos7360.h b/src/devices/sound/mos7360.h index cba7b398762..fc80ff14b8b 100644 --- a/src/devices/sound/mos7360.h +++ b/src/devices/sound/mos7360.h @@ -94,8 +94,8 @@ class mos7360_device : public device_t, { public: // construction/destruction - //mos7360_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); - mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + //mos7360_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock); + mos7360_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_callbacks(const char *cpu_tag, _irq irq, _k k) { m_cpu_tag = cpu_tag; @@ -105,10 +105,10 @@ public: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; - UINT8 read(address_space &space, offs_t offset, int &cs0, int &cs1); - void write(address_space &space, offs_t offset, UINT8 data, int &cs0, int &cs1); + uint8_t read(address_space &space, offs_t offset, int &cs0, int &cs1); + void write(address_space &space, offs_t offset, uint8_t data, int &cs0, int &cs1); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: enum @@ -136,10 +136,10 @@ protected: inline void set_interrupt(int mask); inline void clear_interrupt(int mask); inline int rastercolumn(); - inline UINT8 read_ram(offs_t offset); - inline UINT8 read_rom(offs_t offset); + inline uint8_t read_ram(offs_t offset); + inline uint8_t read_rom(offs_t offset); - void draw_character(int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color); + void draw_character(int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color); void draw_character_multi(int ybegin, int yend, int ch, int yoff, int xoff); void draw_bitmap(int ybegin, int yend, int ch, int yoff, int xoff); void draw_bitmap_multi(int ybegin, int yend, int ch, int yoff, int xoff); @@ -160,8 +160,8 @@ protected: cpu_device *m_cpu; sound_stream *m_stream; - UINT8 m_reg[0x20]; - UINT8 m_last_data; + uint8_t m_reg[0x20]; + uint8_t m_last_data; bitmap_rgb32 m_bitmap; @@ -179,13 +179,13 @@ protected: int m_x_begin, m_x_end; int m_y_begin, m_y_end; - UINT16 m_c16_bitmap[2], m_bitmapmulti[4], m_mono[2], m_monoinversed[2], m_multi[4], m_ecmcolor[2], m_colors[5]; + uint16_t m_c16_bitmap[2], m_bitmapmulti[4], m_mono[2], m_monoinversed[2], m_multi[4], m_ecmcolor[2], m_colors[5]; int m_rasterline, m_lastline; double m_rastertime; /* sound part */ - std::unique_ptr m_noise; + std::unique_ptr m_noise; int m_tone1pos, m_tone2pos, m_tone1samples, m_tone2samples, m_noisesize, /* number of samples */ diff --git a/src/devices/sound/mpeg_audio.cpp b/src/devices/sound/mpeg_audio.cpp index bf024383a06..26433ae73e9 100644 --- a/src/devices/sound/mpeg_audio.cpp +++ b/src/devices/sound/mpeg_audio.cpp @@ -11,7 +11,7 @@ mpeg_audio::mpeg_audio(const void *_base, unsigned int _accepted, bool lsb_first, int _position_align) { - base = (const UINT8 *)_base; + base = (const uint8_t *)_base; accepted = _accepted; do_gb = lsb_first ? do_gb_lsb : do_gb_msb; position_align = _position_align ? _position_align - 1 : 0; diff --git a/src/devices/sound/mpeg_audio.h b/src/devices/sound/mpeg_audio.h index 428d18f63bc..57ed805a79a 100644 --- a/src/devices/sound/mpeg_audio.h +++ b/src/devices/sound/mpeg_audio.h @@ -74,7 +74,7 @@ private: static const band_info band_infos[18]; static const double synthesis_filter[512]; - const UINT8 *base; + const uint8_t *base; int accepted, position_align; int sampling_rate, last_frame_number; diff --git a/src/devices/sound/msm5205.cpp b/src/devices/sound/msm5205.cpp index ae925a513b8..c61762ee3ca 100644 --- a/src/devices/sound/msm5205.cpp +++ b/src/devices/sound/msm5205.cpp @@ -57,7 +57,7 @@ const device_type MSM5205 = &device_creator; const device_type MSM6585 = &device_creator; -msm5205_device::msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msm5205_device::msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSM5205, "MSM5205", tag, owner, clock, "msm5205", __FILE__), device_sound_interface(mconfig, *this), m_prescaler(0), @@ -67,7 +67,7 @@ msm5205_device::msm5205_device(const machine_config &mconfig, const char *tag, d { } -msm5205_device::msm5205_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) +msm5205_device::msm5205_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_sound_interface(mconfig, *this), m_prescaler(0), @@ -78,7 +78,7 @@ msm5205_device::msm5205_device(const machine_config &mconfig, device_type type, } -msm6585_device::msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msm6585_device::msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msm5205_device(mconfig, MSM6585, "MSM6585", tag, owner, clock, "msm6585", __FILE__) { } @@ -295,7 +295,7 @@ void msm5205_device::set_volume(int volume) m_stream->set_output_gain(0,volume / 100.0); } -void msm5205_device::change_clock_w(INT32 clock) +void msm5205_device::change_clock_w(int32_t clock) { attotime period; diff --git a/src/devices/sound/msm5205.h b/src/devices/sound/msm5205.h index 6730fea7b88..d780d137c36 100644 --- a/src/devices/sound/msm5205.h +++ b/src/devices/sound/msm5205.h @@ -43,8 +43,8 @@ class msm5205_device : public device_t, public device_sound_interface { public: - msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - msm5205_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); + msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + msm5205_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); ~msm5205_device() {} static void set_prescaler_selector(device_t &device, int select) { downcast(device).m_select = select; } @@ -62,7 +62,7 @@ public: void playmode_w(int select); void set_volume(int volume); - void change_clock_w(INT32 clock); + void change_clock_w(int32_t clock); protected: // device-level overrides @@ -78,15 +78,15 @@ protected: // internal state sound_stream * m_stream; /* number of stream system */ - INT32 m_mod_clock; /* clock rate */ + int32_t m_mod_clock; /* clock rate */ emu_timer *m_timer; /* VCLK callback timer */ - INT32 m_data; /* next adpcm data */ - INT32 m_vclk; /* vclk signal (external mode) */ - INT32 m_reset; /* reset pin signal */ - INT32 m_prescaler; /* prescaler selector S1 and S2 */ - INT32 m_bitwidth; /* bit width selector -3B/4B */ - INT32 m_signal; /* current ADPCM signal */ - INT32 m_step; /* current ADPCM step */ + int32_t m_data; /* next adpcm data */ + int32_t m_vclk; /* vclk signal (external mode) */ + int32_t m_reset; /* reset pin signal */ + int32_t m_prescaler; /* prescaler selector S1 and S2 */ + int32_t m_bitwidth; /* bit width selector -3B/4B */ + int32_t m_signal; /* current ADPCM signal */ + int32_t m_step; /* current ADPCM step */ int m_diff_lookup[49*16]; int m_select; devcb_write_line m_vclk_cb; @@ -97,7 +97,7 @@ extern const device_type MSM5205; class msm6585_device : public msm5205_device { public: - msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; diff --git a/src/devices/sound/msm5232.cpp b/src/devices/sound/msm5232.cpp index 5411dc29558..ed8adaa5415 100644 --- a/src/devices/sound/msm5232.cpp +++ b/src/devices/sound/msm5232.cpp @@ -13,7 +13,7 @@ const device_type MSM5232 = &device_creator; -msm5232_device::msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +msm5232_device::msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSM5232, "MSM5232", tag, owner, clock, "msm5232", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), m_noise_cnt(0), m_noise_step(0), m_noise_rng(0), m_noise_clocks(0), m_UpdateStep(0), m_control1(0), m_control2(0), m_gate(0), m_chip_clock(0), m_rate(0), m_gate_handler_cb(*this) @@ -148,7 +148,7 @@ void msm5232_device::static_set_capacitors(device_t &device, double cap1, double /* Chip has 88x12bits ROM (addressing (in hex) from 0x00 to 0x57) */ #define ROM(counter,bindiv) (counter|(bindiv<<9)) -static const UINT16 MSM5232_ROM[88]={ +static const uint16_t MSM5232_ROM[88]={ /* higher values are Programmable Counter data (9 bits) */ /* lesser values are Binary Counter shift data (3 bits) */ @@ -370,7 +370,7 @@ WRITE8_MEMBER( msm5232_device::write ) if ( m_voi[ch].pitch != (data&0x7f) ) { int n; - UINT16 pg; + uint16_t pg; m_voi[ch].pitch = data&0x7f; diff --git a/src/devices/sound/msm5232.h b/src/devices/sound/msm5232.h index e861aa2725e..cee3fe1c09e 100644 --- a/src/devices/sound/msm5232.h +++ b/src/devices/sound/msm5232.h @@ -13,23 +13,23 @@ devcb = &msm5232_device::set_gate_handler_callback(*device, DEVCB_##_devcb); struct VOICE { - UINT8 mode; + uint8_t mode; int TG_count_period; int TG_count; - UINT8 TG_cnt; /* 7 bits binary counter (frequency output) */ - UINT8 TG_out16; /* bit number (of TG_cnt) for 16' output */ - UINT8 TG_out8; /* bit number (of TG_cnt) for 8' output */ - UINT8 TG_out4; /* bit number (of TG_cnt) for 4' output */ - UINT8 TG_out2; /* bit number (of TG_cnt) for 2' output */ + uint8_t TG_cnt; /* 7 bits binary counter (frequency output) */ + uint8_t TG_out16; /* bit number (of TG_cnt) for 16' output */ + uint8_t TG_out8; /* bit number (of TG_cnt) for 8' output */ + uint8_t TG_out4; /* bit number (of TG_cnt) for 4' output */ + uint8_t TG_out2; /* bit number (of TG_cnt) for 2' output */ int egvol; int eg_sect; int counter; int eg; - UINT8 eg_arm; /* attack/release mode */ + uint8_t eg_arm; /* attack/release mode */ double ar_rate; double dr_rate; @@ -45,7 +45,7 @@ class msm5232_device : public device_t, public device_sound_interface { public: - msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~msm5232_device() {} static void static_set_capacitors(device_t &device, double cap1, double cap2, double cap3, double cap4, double cap5, double cap6, double cap7, double cap8); @@ -69,10 +69,10 @@ protected: VOICE m_voi[8]; - UINT32 m_EN_out16[2]; /* enable 16' output masks for both groups (0-disabled ; ~0 -enabled) */ - UINT32 m_EN_out8[2]; /* enable 8' output masks */ - UINT32 m_EN_out4[2]; /* enable 4' output masks */ - UINT32 m_EN_out2[2]; /* enable 2' output masks */ + uint32_t m_EN_out16[2]; /* enable 16' output masks for both groups (0-disabled ; ~0 -enabled) */ + uint32_t m_EN_out8[2]; /* enable 8' output masks */ + uint32_t m_EN_out4[2]; /* enable 4' output masks */ + uint32_t m_EN_out2[2]; /* enable 2' output masks */ int m_noise_cnt; int m_noise_step; @@ -85,8 +85,8 @@ protected: double m_ar_tbl[8]; double m_dr_tbl[16]; - UINT8 m_control1; - UINT8 m_control2; + uint8_t m_control1; + uint8_t m_control2; int m_gate; /* current state of the GATE output */ diff --git a/src/devices/sound/multipcm.cpp b/src/devices/sound/multipcm.cpp index 3138faed45e..5742b67395f 100644 --- a/src/devices/sound/multipcm.cpp +++ b/src/devices/sound/multipcm.cpp @@ -63,7 +63,7 @@ const double multipcm_device::BASE_TIMES[64] = { 0.45, 0.45, 0.45, 0.45 }; -const INT32 multipcm_device::VALUE_TO_CHANNEL[32] = +const int32_t multipcm_device::VALUE_TO_CHANNEL[32] = { 0, 1, 2, 3, 4, 5, 6 , -1, 7, 8, 9, 10,11,12,13, -1, @@ -71,12 +71,12 @@ const INT32 multipcm_device::VALUE_TO_CHANNEL[32] = 21,22,23,24,25,26,27, -1, }; -const UINT32 multipcm_device::TL_SHIFT = 12; -const UINT32 multipcm_device::EG_SHIFT = 16; +const uint32_t multipcm_device::TL_SHIFT = 12; +const uint32_t multipcm_device::EG_SHIFT = 16; -void multipcm_device::init_sample(sample_t *sample, UINT32 index) +void multipcm_device::init_sample(sample_t *sample, uint32_t index) { - UINT32 address = index * 12; + uint32_t address = index * 12; sample->m_start = (read_byte(address) << 16) | (read_byte(address + 1) << 8) | read_byte(address + 2); sample->m_loop = (read_byte(address + 3) << 8) | read_byte(address + 4); @@ -91,7 +91,7 @@ void multipcm_device::init_sample(sample_t *sample, UINT32 index) sample->m_lfo_amplitude_reg = read_byte(address + 11) & 0xf; } -INT32 multipcm_device::envelope_generator_update(slot_t *slot) +int32_t multipcm_device::envelope_generator_update(slot_t *slot) { switch(slot->m_envelope_gen.m_state) { @@ -140,9 +140,9 @@ INT32 multipcm_device::envelope_generator_update(slot_t *slot) return m_linear_to_exp_volume[slot->m_envelope_gen.m_volume >> EG_SHIFT]; } -UINT32 multipcm_device::get_rate(UINT32 *steps, UINT32 rate, UINT32 val) +uint32_t multipcm_device::get_rate(uint32_t *steps, uint32_t rate, uint32_t val) { - INT32 r = 4 * val + rate; + int32_t r = 4 * val + rate; if (val == 0) { return steps[0]; @@ -160,12 +160,12 @@ UINT32 multipcm_device::get_rate(UINT32 *steps, UINT32 rate, UINT32 val) void multipcm_device::envelope_generator_calc(slot_t *slot) { - INT32 octave = ((slot->m_regs[3] >> 4) - 1) & 0xf; + int32_t octave = ((slot->m_regs[3] >> 4) - 1) & 0xf; if (octave & 8) { octave = octave - 16; } - INT32 rate; + int32_t rate; if (slot->m_sample.m_key_rate_scale != 0xf) { rate = (octave + slot->m_sample.m_key_rate_scale) * 2 + ((slot->m_regs[3] >> 3) & 1); @@ -187,7 +187,7 @@ void multipcm_device::envelope_generator_calc(slot_t *slot) LFO SECTION *****************************/ -const UINT32 multipcm_device::LFO_SHIFT = 8; +const uint32_t multipcm_device::LFO_SHIFT = 8; const float multipcm_device::LFO_FREQ[8] = // In Hertz { @@ -227,9 +227,9 @@ const float multipcm_device::AMPLITUDE_SCALE_LIMIT[8] = // In Decibels void multipcm_device::lfo_init() { - m_pitch_table = auto_alloc_array_clear(machine(), INT32, 256); - m_amplitude_table = auto_alloc_array_clear(machine(), INT32, 256); - for (INT32 i = 0; i < 256; ++i) + m_pitch_table = auto_alloc_array_clear(machine(), int32_t, 256); + m_amplitude_table = auto_alloc_array_clear(machine(), int32_t, 256); + for (int32_t i = 0; i < 256; ++i) { if (i < 64) { @@ -258,13 +258,13 @@ void multipcm_device::lfo_init() } } - m_pitch_scale_tables = auto_alloc_array_clear(machine(), INT32*, 8); - m_amplitude_scale_tables = auto_alloc_array_clear(machine(), INT32*, 8); - for (INT32 table = 0; table < 8; ++table) + m_pitch_scale_tables = auto_alloc_array_clear(machine(), int32_t*, 8); + m_amplitude_scale_tables = auto_alloc_array_clear(machine(), int32_t*, 8); + for (int32_t table = 0; table < 8; ++table) { float limit = PHASE_SCALE_LIMIT[table]; - m_pitch_scale_tables[table] = auto_alloc_array_clear(machine(), INT32, 256); - for(INT32 i = -128; i < 128; ++i) + m_pitch_scale_tables[table] = auto_alloc_array_clear(machine(), int32_t, 256); + for(int32_t i = -128; i < 128; ++i) { const float value = (limit * (float)i) / 128.0f; const float converted = powf(2.0f, value / 1200.0f); @@ -272,8 +272,8 @@ void multipcm_device::lfo_init() } limit = -AMPLITUDE_SCALE_LIMIT[table]; - m_amplitude_scale_tables[table] = auto_alloc_array_clear(machine(), INT32, 256); - for(INT32 i = 0; i < 256; ++i) + m_amplitude_scale_tables[table] = auto_alloc_array_clear(machine(), int32_t, 256); + for(int32_t i = 0; i < 256; ++i) { const float value = (limit * (float)i) / 256.0f; const float converted = powf(10.0f, value / 20.0f); @@ -282,32 +282,32 @@ void multipcm_device::lfo_init() } } -UINT32 multipcm_device::value_to_fixed(const UINT32 bits, const float value) +uint32_t multipcm_device::value_to_fixed(const uint32_t bits, const float value) { const float float_shift = (float)(1 << bits); - return (UINT32)(float_shift * value); + return (uint32_t)(float_shift * value); } -INT32 multipcm_device::pitch_lfo_step(lfo_t *lfo) +int32_t multipcm_device::pitch_lfo_step(lfo_t *lfo) { lfo->m_phase += lfo->m_phase_step; - INT32 p = lfo->m_table[(lfo->m_phase >> LFO_SHIFT) & 0xff]; + int32_t p = lfo->m_table[(lfo->m_phase >> LFO_SHIFT) & 0xff]; p = lfo->m_scale[p]; return p << (TL_SHIFT - LFO_SHIFT); } -INT32 multipcm_device::amplitude_lfo_step(lfo_t *lfo) +int32_t multipcm_device::amplitude_lfo_step(lfo_t *lfo) { lfo->m_phase += lfo->m_phase_step; - INT32 p = lfo->m_table[(lfo->m_phase >> LFO_SHIFT) & 0xff]; + int32_t p = lfo->m_table[(lfo->m_phase >> LFO_SHIFT) & 0xff]; p = lfo->m_scale[p]; return p << (TL_SHIFT - LFO_SHIFT); } -void multipcm_device::lfo_compute_step(lfo_t *lfo, UINT32 lfo_frequency, UINT32 lfo_scale, INT32 amplitude_lfo) +void multipcm_device::lfo_compute_step(lfo_t *lfo, uint32_t lfo_frequency, uint32_t lfo_scale, int32_t amplitude_lfo) { float step = (float)LFO_FREQ[lfo_frequency] * 256.0f / (float)m_rate; - lfo->m_phase_step = (UINT32)((float)(1 << LFO_SHIFT) * step); + lfo->m_phase_step = (uint32_t)((float)(1 << LFO_SHIFT) * step); if (amplitude_lfo) { lfo->m_table = m_amplitude_table; @@ -320,7 +320,7 @@ void multipcm_device::lfo_compute_step(lfo_t *lfo, UINT32 lfo_frequency, UINT32 } } -void multipcm_device::write_slot(slot_t *slot, INT32 reg, UINT8 data) +void multipcm_device::write_slot(slot_t *slot, int32_t reg, uint8_t data) { slot->m_regs[reg] = data; @@ -342,8 +342,8 @@ void multipcm_device::write_slot(slot_t *slot, INT32 reg, UINT8 data) case 2: //Pitch case 3: { - UINT32 oct = ((slot->m_regs[3] >> 4) - 1) & 0xf; - UINT32 pitch = ((slot->m_regs[3] & 0xf) << 6) | (slot->m_regs[2] >> 2); + uint32_t oct = ((slot->m_regs[3] >> 4) - 1) & 0xf; + uint32_t pitch = ((slot->m_regs[3] & 0xf) << 6) | (slot->m_regs[2] >> 2); pitch = m_freq_step_table[pitch]; if (oct & 0x8) { @@ -457,7 +457,7 @@ WRITE8_MEMBER( multipcm_device::write ) /* MAME/M1 access functions */ -void multipcm_device::set_bank(UINT32 leftoffs, UINT32 rightoffs) +void multipcm_device::set_bank(uint32_t leftoffs, uint32_t rightoffs) { m_bank_left = leftoffs; m_bank_right = rightoffs; @@ -466,7 +466,7 @@ void multipcm_device::set_bank(UINT32 leftoffs, UINT32 rightoffs) const device_type MULTIPCM = &device_creator; -multipcm_device::multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +multipcm_device::multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MULTIPCM, "Sega/Yamaha 315-5560", tag, owner, clock, "multipcm", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 24), @@ -512,14 +512,14 @@ void multipcm_device::device_start() m_stream = machine().sound().stream_alloc(*this, 0, 2, m_rate); // Volume + pan table - m_left_pan_table = auto_alloc_array_clear(machine(), INT32, 0x800); - m_right_pan_table = auto_alloc_array_clear(machine(), INT32, 0x800); - for (INT32 level = 0; level < 0x80; ++level) + m_left_pan_table = auto_alloc_array_clear(machine(), int32_t, 0x800); + m_right_pan_table = auto_alloc_array_clear(machine(), int32_t, 0x800); + for (int32_t level = 0; level < 0x80; ++level) { const float vol_db = (float)level * (-24.0f) / 64.0f; const float total_level = powf(10.0f, vol_db / 20.0f) / 4.0f; - for (INT32 pan = 0; pan < 0x10; ++pan) + for (int32_t pan = 0; pan < 0x10; ++pan) { float pan_left, pan_right; if (pan == 0x8) @@ -536,7 +536,7 @@ void multipcm_device::device_start() { pan_left = 1.0; - const INT32 inverted_pan = 0x10 - pan; + const int32_t inverted_pan = 0x10 - pan; const float pan_vol_db = (float)inverted_pan * (-12.0f) / 4.0f; pan_right = pow(10.0f, pan_vol_db / 20.0f); @@ -566,18 +566,18 @@ void multipcm_device::device_start() } //Pitch steps - m_freq_step_table = auto_alloc_array_clear(machine(), UINT32, 0x400); - for (INT32 i = 0; i < 0x400; ++i) + m_freq_step_table = auto_alloc_array_clear(machine(), uint32_t, 0x400); + for (int32_t i = 0; i < 0x400; ++i) { const float fcent = m_rate * (1024.0f + (float)i) / 1024.0f; m_freq_step_table[i] = value_to_fixed(TL_SHIFT, fcent); } // Envelope steps - m_attack_step = auto_alloc_array_clear(machine(), UINT32, 0x40); - m_decay_release_step = auto_alloc_array_clear(machine(), UINT32, 0x40); + m_attack_step = auto_alloc_array_clear(machine(), uint32_t, 0x40); + m_decay_release_step = auto_alloc_array_clear(machine(), uint32_t, 0x40); const double attack_rate_to_decay_rate = 14.32833; - for (INT32 i = 0; i < 0x40; ++i) + for (int32_t i = 0; i < 0x40; ++i) { // Times are based on 44100Hz clock, adjust to real chip clock m_attack_step[i] = (float)(0x400 << EG_SHIFT) / (float)(BASE_TIMES[i] * 44100.0 / 1000.0); @@ -588,13 +588,13 @@ void multipcm_device::device_start() m_decay_release_step[0] = m_decay_release_step[1] = m_decay_release_step[2] = m_decay_release_step[3] = 0; // Total level interpolation steps - m_total_level_steps = auto_alloc_array_clear(machine(), INT32, 2); + m_total_level_steps = auto_alloc_array_clear(machine(), int32_t, 2); m_total_level_steps[0] = -(float)(0x80 << TL_SHIFT) / (78.2f * 44100.0f / 1000.0f); // lower m_total_level_steps[1] = (float)(0x80 << TL_SHIFT) / (78.2f * 2 * 44100.0f / 1000.0f); // raise // build the linear->exponential ramps - m_linear_to_exp_volume = auto_alloc_array_clear(machine(), INT32, 0x400); - for(INT32 i = 0; i < 0x400; ++i) + m_linear_to_exp_volume = auto_alloc_array_clear(machine(), int32_t, 0x400); + for(int32_t i = 0; i < 0x400; ++i) { const float db = -(96.0f - (96.0f * (float)i / (float)0x400)); const float exp_volume = powf(10.0f, db / 20.0f); @@ -608,7 +608,7 @@ void multipcm_device::device_start() // Slots m_slots = auto_alloc_array_clear(machine(), slot_t, 28); - for (INT32 slot = 0; slot < 28; ++slot) + for (int32_t slot = 0; slot < 28; ++slot) { m_slots[slot].m_slot_index = slot; m_slots[slot].m_playing = false; @@ -645,7 +645,7 @@ void multipcm_device::device_start() // clamp_to_int16 - clamp a 32-bit value to 16 bits //----------------------------------------------------- -INT16 multipcm_device::clamp_to_int16(INT32 value) +int16_t multipcm_device::clamp_to_int16(int32_t value) { if (value < -32768) { @@ -655,14 +655,14 @@ INT16 multipcm_device::clamp_to_int16(INT32 value) { return 32767; } - return (INT16)value; + return (int16_t)value; } //------------------------------------------------- // sound_stream_update - handle a stream update //------------------------------------------------- -void multipcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, INT32 samples) +void multipcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int32_t samples) { stream_sample_t *datap[2]; @@ -672,21 +672,21 @@ void multipcm_device::sound_stream_update(sound_stream &stream, stream_sample_t memset(datap[0], 0, sizeof(*datap[0]) * samples); memset(datap[1], 0, sizeof(*datap[1]) * samples); - for (INT32 i = 0; i < samples; ++i) + for (int32_t i = 0; i < samples; ++i) { - INT32 smpl = 0; - INT32 smpr = 0; - for (INT32 sl = 0; sl < 28; ++sl) + int32_t smpl = 0; + int32_t smpr = 0; + for (int32_t sl = 0; sl < 28; ++sl) { slot_t *slot = m_slots + sl; if (slot->m_playing) { - UINT32 vol = (slot->m_total_level >> TL_SHIFT) | (slot->m_pan << 7); - UINT32 adr = slot->m_offset >> TL_SHIFT; - UINT32 step = slot->m_step; - INT32 csample = (INT16) (read_byte(slot->m_base + adr) << 8); - INT32 fpart = slot->m_offset & ((1 << TL_SHIFT) - 1); - INT32 sample = (csample * fpart + slot->m_prev_sample * ((1 << TL_SHIFT) - fpart)) >> TL_SHIFT; + uint32_t vol = (slot->m_total_level >> TL_SHIFT) | (slot->m_pan << 7); + uint32_t adr = slot->m_offset >> TL_SHIFT; + uint32_t step = slot->m_step; + int32_t csample = (int16_t) (read_byte(slot->m_base + adr) << 8); + int32_t fpart = slot->m_offset & ((1 << TL_SHIFT) - 1); + int32_t sample = (csample * fpart + slot->m_prev_sample * ((1 << TL_SHIFT) - fpart)) >> TL_SHIFT; if (slot->m_regs[6] & 7) // Vibrato enabled { diff --git a/src/devices/sound/multipcm.h b/src/devices/sound/multipcm.h index a1ca8ed4272..0dcaa0abe6d 100644 --- a/src/devices/sound/multipcm.h +++ b/src/devices/sound/multipcm.h @@ -10,13 +10,13 @@ class multipcm_device : public device_t, public device_rom_interface { public: - multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~multipcm_device() {} DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( read ); - void set_bank(UINT32 leftoffs, UINT32 rightoffs); + void set_bank(uint32_t leftoffs, uint32_t rightoffs); protected: // device-level overrides @@ -32,17 +32,17 @@ protected: private: struct sample_t { - UINT32 m_start; - UINT32 m_loop; - UINT32 m_end; - UINT8 m_attack_reg; - UINT8 m_decay1_reg; - UINT8 m_decay2_reg; - UINT8 m_decay_level; - UINT8 m_release_reg; - UINT8 m_key_rate_scale; - UINT8 m_lfo_vibrato_reg; - UINT8 m_lfo_amplitude_reg; + uint32_t m_start; + uint32_t m_loop; + uint32_t m_end; + uint8_t m_attack_reg; + uint8_t m_decay1_reg; + uint8_t m_decay2_reg; + uint8_t m_decay_level; + uint8_t m_release_reg; + uint8_t m_key_rate_scale; + uint8_t m_lfo_vibrato_reg; + uint8_t m_lfo_amplitude_reg; }; enum state_t @@ -55,39 +55,39 @@ private: struct envelope_gen_t { - INT32 m_volume; + int32_t m_volume; state_t m_state; - INT32 step; + int32_t step; //step vals - INT32 m_attack_rate; // Attack - INT32 m_decay1_rate; // Decay1 - INT32 m_decay2_rate; // Decay2 - INT32 m_release_rate; // Release - INT32 m_decay_level; // Decay level + int32_t m_attack_rate; // Attack + int32_t m_decay1_rate; // Decay1 + int32_t m_decay2_rate; // Decay2 + int32_t m_release_rate; // Release + int32_t m_decay_level; // Decay level }; struct lfo_t { - UINT16 m_phase; - UINT32 m_phase_step; - INT32 *m_table; - INT32 *m_scale; + uint16_t m_phase; + uint32_t m_phase_step; + int32_t *m_table; + int32_t *m_scale; }; struct slot_t { - UINT8 m_slot_index; - UINT8 m_regs[8]; + uint8_t m_slot_index; + uint8_t m_regs[8]; bool m_playing; sample_t m_sample; - UINT32 m_base; - UINT32 m_offset; - UINT32 m_step; - UINT32 m_pan; - UINT32 m_total_level; - UINT32 m_dest_total_level; - INT32 m_total_level_step; - INT32 m_prev_sample; + uint32_t m_base; + uint32_t m_offset; + uint32_t m_step; + uint32_t m_pan; + uint32_t m_total_level; + uint32_t m_dest_total_level; + int32_t m_total_level_step; + int32_t m_prev_sample; envelope_gen_t m_envelope_gen; lfo_t m_pitch_lfo; // Pitch lfo lfo_t m_amplitude_lfo; // AM lfo @@ -96,53 +96,53 @@ private: // internal state sound_stream *m_stream; slot_t *m_slots; - UINT32 m_cur_slot; - UINT32 m_address; - UINT32 m_bank_right; - UINT32 m_bank_left; + uint32_t m_cur_slot; + uint32_t m_address; + uint32_t m_bank_right; + uint32_t m_bank_left; float m_rate; - UINT32 *m_attack_step; - UINT32 *m_decay_release_step; // Envelope step tables - UINT32 *m_freq_step_table; // Frequency step table + uint32_t *m_attack_step; + uint32_t *m_decay_release_step; // Envelope step tables + uint32_t *m_freq_step_table; // Frequency step table - INT32 *m_left_pan_table; - INT32 *m_right_pan_table; - INT32 *m_linear_to_exp_volume; - INT32 *m_total_level_steps; + int32_t *m_left_pan_table; + int32_t *m_right_pan_table; + int32_t *m_linear_to_exp_volume; + int32_t *m_total_level_steps; - INT32 *m_pitch_table; - INT32 **m_pitch_scale_tables; - INT32 *m_amplitude_table; - INT32 **m_amplitude_scale_tables; + int32_t *m_pitch_table; + int32_t **m_pitch_scale_tables; + int32_t *m_amplitude_table; + int32_t **m_amplitude_scale_tables; - UINT32 value_to_fixed(const UINT32 bits, const float value); + uint32_t value_to_fixed(const uint32_t bits, const float value); - void init_sample(sample_t *sample, UINT32 index); + void init_sample(sample_t *sample, uint32_t index); // Internal LFO functions void lfo_init(); - void lfo_compute_step(lfo_t *lfo, UINT32 lfo_frequency, UINT32 LFOS, INT32 amplitude_lfo); - INT32 pitch_lfo_step(lfo_t *lfo); - INT32 amplitude_lfo_step(lfo_t *lfo); + void lfo_compute_step(lfo_t *lfo, uint32_t lfo_frequency, uint32_t LFOS, int32_t amplitude_lfo); + int32_t pitch_lfo_step(lfo_t *lfo); + int32_t amplitude_lfo_step(lfo_t *lfo); // Internal envelope functions - INT32 envelope_generator_update(slot_t *slot); + int32_t envelope_generator_update(slot_t *slot); void envelope_generator_calc(slot_t *slot); - UINT32 get_rate(UINT32 *steps, UINT32 rate, UINT32 val); + uint32_t get_rate(uint32_t *steps, uint32_t rate, uint32_t val); - void write_slot(slot_t *slot, INT32 reg, UINT8 data); + void write_slot(slot_t *slot, int32_t reg, uint8_t data); - INT16 clamp_to_int16(INT32 value); + int16_t clamp_to_int16(int32_t value); - static const UINT32 TL_SHIFT; + static const uint32_t TL_SHIFT; - static const INT32 VALUE_TO_CHANNEL[32]; + static const int32_t VALUE_TO_CHANNEL[32]; - static const UINT32 EG_SHIFT; + static const uint32_t EG_SHIFT; static const double BASE_TIMES[64]; - static const UINT32 LFO_SHIFT; + static const uint32_t LFO_SHIFT; static const float LFO_FREQ[8]; static const float PHASE_SCALE_LIMIT[8]; static const float AMPLITUDE_SCALE_LIMIT[8]; diff --git a/src/devices/sound/n63701x.cpp b/src/devices/sound/n63701x.cpp index d544eb6e4ee..0d9cd66134b 100644 --- a/src/devices/sound/n63701x.cpp +++ b/src/devices/sound/n63701x.cpp @@ -31,7 +31,7 @@ static const int vol_table[4] = { 26, 84, 200, 258 }; // device type definition const device_type NAMCO_63701X = &device_creator; -namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_63701X, "Namco 63701X", tag, owner, clock, "namco_63701x", __FILE__), device_sound_interface(mconfig, *this), m_rom(*this, DEVICE_SELF), @@ -75,7 +75,7 @@ void namco_63701x_device::sound_stream_update(sound_stream &stream, stream_sampl if (v->playing) { - UINT8 *base = m_rom + v->base_addr; + uint8_t *base = m_rom + v->base_addr; int pos = v->position; int vol = vol_table[v->volume]; int p; diff --git a/src/devices/sound/n63701x.h b/src/devices/sound/n63701x.h index 430406b3078..335bd4f387d 100644 --- a/src/devices/sound/n63701x.h +++ b/src/devices/sound/n63701x.h @@ -44,7 +44,7 @@ class namco_63701x_device : public device_t, public device_sound_interface { public: - namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~namco_63701x_device() { } protected: @@ -58,7 +58,7 @@ public: DECLARE_WRITE8_MEMBER(namco_63701x_w); private: - required_region_ptr m_rom; + required_region_ptr m_rom; voice_63701x m_voices[2]; sound_stream *m_stream; /* channel assigned by the mixer */ }; diff --git a/src/devices/sound/namco.cpp b/src/devices/sound/namco.cpp index 9bddba97783..6bf7eba166a 100644 --- a/src/devices/sound/namco.cpp +++ b/src/devices/sound/namco.cpp @@ -35,7 +35,7 @@ const device_type NAMCO = &device_creator; const device_type NAMCO_15XX = &device_creator; const device_type NAMCO_CUS30 = &device_creator; -namco_audio_device::namco_audio_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) +namco_audio_device::namco_audio_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, __FILE__) , device_sound_interface(mconfig, *this) , m_wave_ptr(*this, DEVICE_SELF) @@ -53,17 +53,17 @@ namco_audio_device::namco_audio_device(const machine_config &mconfig, device_typ { } -namco_device::namco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_device::namco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : namco_audio_device(mconfig, NAMCO, "Namco", tag, owner, clock, "namco", __FILE__) { } -namco_15xx_device::namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_15xx_device::namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :namco_audio_device(mconfig, NAMCO_15XX, "Namco 15XX", tag, owner, clock, "namco_15xx", __FILE__) { } -namco_cus30_device::namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_cus30_device::namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : namco_audio_device(mconfig, NAMCO_CUS30, "Namco CUS30", tag, owner, clock, "namco_cus30", __FILE__) { } @@ -81,7 +81,7 @@ void namco_audio_device::device_start() /* extract globals from the interface */ m_last_channel = m_channel_list + m_voices; - m_soundregs = auto_alloc_array_clear(machine(), UINT8, 0x400); + m_soundregs = auto_alloc_array_clear(machine(), uint8_t, 0x400); /* adjust internal clock */ m_namco_clock = clock(); @@ -148,11 +148,11 @@ void namco_audio_device::device_start() /* update the decoded waveform data */ -void namco_audio_device::update_namco_waveform(int offset, UINT8 data) +void namco_audio_device::update_namco_waveform(int offset, uint8_t data) { if (m_wave_size == 1) { - INT16 wdata; + int16_t wdata; int v; /* use full byte, first 4 high bits, then low 4 bits */ @@ -176,14 +176,14 @@ void namco_audio_device::update_namco_waveform(int offset, UINT8 data) /* build the decoded waveform table */ -void namco_audio_device::build_decoded_waveform(UINT8 *rgnbase) +void namco_audio_device::build_decoded_waveform(uint8_t *rgnbase) { - INT16 *p; + int16_t *p; int size; int offset; int v; - m_wavedata = (rgnbase != nullptr) ? rgnbase : auto_alloc_array_clear(machine(), UINT8, 0x400); + m_wavedata = (rgnbase != nullptr) ? rgnbase : auto_alloc_array_clear(machine(), uint8_t, 0x400); /* 20pacgal has waves in RAM but old sound system */ if (rgnbase == nullptr && m_voices != 3) @@ -197,7 +197,7 @@ void namco_audio_device::build_decoded_waveform(UINT8 *rgnbase) size = 32 * 8; /* 32 samples, 8 waveforms */ } - p = auto_alloc_array(machine(), INT16, size * MAX_VOLUME); + p = auto_alloc_array(machine(), int16_t, size * MAX_VOLUME); for (v = 0; v < MAX_VOLUME; v++) { @@ -215,7 +215,7 @@ void namco_audio_device::build_decoded_waveform(UINT8 *rgnbase) /* generate sound by oversampling */ -UINT32 namco_audio_device::namco_update_one(stream_sample_t *buffer, int length, const INT16 *wave, UINT32 counter, UINT32 freq) +uint32_t namco_audio_device::namco_update_one(stream_sample_t *buffer, int length, const int16_t *wave, uint32_t counter, uint32_t freq) { while (length-- > 0) { @@ -677,10 +677,10 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, stream_sample { int hold_time = 1 << (m_f_fracbits - 16); int hold = voice->noise_hold; - UINT32 delta = f << 4; - UINT32 c = voice->noise_counter; - INT16 l_noise_data = OUTPUT_LEVEL(0x07 * (lv >> 1)); - INT16 r_noise_data = OUTPUT_LEVEL(0x07 * (rv >> 1)); + uint32_t delta = f << 4; + uint32_t c = voice->noise_counter; + int16_t l_noise_data = OUTPUT_LEVEL(0x07 * (lv >> 1)); + int16_t r_noise_data = OUTPUT_LEVEL(0x07 * (rv >> 1)); int i; /* add our contribution */ @@ -729,12 +729,12 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, stream_sample if (voice->frequency) { /* save the counter for this voice */ - UINT32 c = voice->counter; + uint32_t c = voice->counter; /* only update if we have non-zero left volume */ if (lv) { - const INT16 *lw = &m_waveform[lv][voice->waveform_select * 32]; + const int16_t *lw = &m_waveform[lv][voice->waveform_select * 32]; /* generate sound into the buffer */ c = namco_update_one(lmix, samples, lw, voice->counter, voice->frequency); @@ -743,7 +743,7 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, stream_sample /* only update if we have non-zero right volume */ if (rv) { - const INT16 *rw = &m_waveform[rv][voice->waveform_select * 32]; + const int16_t *rw = &m_waveform[rv][voice->waveform_select * 32]; /* generate sound into the buffer */ c = namco_update_one(rmix, samples, rw, voice->counter, voice->frequency); @@ -781,9 +781,9 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, stream_sample { int hold_time = 1 << (m_f_fracbits - 16); int hold = voice->noise_hold; - UINT32 delta = f << 4; - UINT32 c = voice->noise_counter; - INT16 noise_data = OUTPUT_LEVEL(0x07 * (v >> 1)); + uint32_t delta = f << 4; + uint32_t c = voice->noise_counter; + int16_t noise_data = OUTPUT_LEVEL(0x07 * (v >> 1)); int i; /* add our contribution */ @@ -825,7 +825,7 @@ void namco_audio_device::sound_stream_update(sound_stream &stream, stream_sample /* only update if we have non-zero volume and frequency */ if (v && voice->frequency) { - const INT16 *w = &m_waveform[v][voice->waveform_select * 32]; + const int16_t *w = &m_waveform[v][voice->waveform_select * 32]; /* generate sound into buffer and update the counter for this voice */ voice->counter = namco_update_one(mix, samples, w, voice->counter, voice->frequency); diff --git a/src/devices/sound/namco.h b/src/devices/sound/namco.h index 4bd09c5d3a1..ab9347021c2 100644 --- a/src/devices/sound/namco.h +++ b/src/devices/sound/namco.h @@ -21,22 +21,22 @@ /* this structure defines the parameters for a channel */ struct sound_channel { - UINT32 frequency; - UINT32 counter; - INT32 volume[2]; - INT32 noise_sw; - INT32 noise_state; - INT32 noise_seed; - UINT32 noise_counter; - INT32 noise_hold; - INT32 waveform_select; + uint32_t frequency; + uint32_t counter; + int32_t volume[2]; + int32_t noise_sw; + int32_t noise_state; + int32_t noise_seed; + uint32_t noise_counter; + int32_t noise_hold; + int32_t waveform_select; }; class namco_audio_device : public device_t, public device_sound_interface { public: - namco_audio_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); + namco_audio_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); ~namco_audio_device() {} // static configuration @@ -49,22 +49,22 @@ protected: // internal state - void build_decoded_waveform( UINT8 *rgnbase ); - void update_namco_waveform(int offset, UINT8 data); - UINT32 namco_update_one(stream_sample_t *buffer, int length, const INT16 *wave, UINT32 counter, UINT32 freq); + void build_decoded_waveform( uint8_t *rgnbase ); + void update_namco_waveform(int offset, uint8_t data); + uint32_t namco_update_one(stream_sample_t *buffer, int length, const int16_t *wave, uint32_t counter, uint32_t freq); /* waveform region */ - optional_region_ptr m_wave_ptr; + optional_region_ptr m_wave_ptr; /* data about the sound system */ sound_channel m_channel_list[MAX_VOICES]; sound_channel *m_last_channel; - UINT8 *m_soundregs; - UINT8 *m_wavedata; + uint8_t *m_soundregs; + uint8_t *m_wavedata; /* global sound parameters */ int m_wave_size; - INT32 m_sound_enable; + int32_t m_sound_enable; sound_stream *m_stream; int m_namco_clock; int m_sample_rate; @@ -74,7 +74,7 @@ protected: int m_stereo; /* set to 1 to indicate stereo (e.g., System 1) */ /* decoded waveform table */ - INT16 *m_waveform[MAX_VOLUME]; + int16_t *m_waveform[MAX_VOLUME]; virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; }; @@ -82,7 +82,7 @@ protected: class namco_device : public namco_audio_device { public: - namco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( pacman_sound_enable_w ); DECLARE_WRITE8_MEMBER( pacman_sound_w ); @@ -101,7 +101,7 @@ extern const device_type NAMCO; class namco_15xx_device : public namco_audio_device { public: - namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( namco_15xx_w ); DECLARE_READ8_MEMBER( sharedram_r ); @@ -118,7 +118,7 @@ extern const device_type NAMCO_15XX; class namco_cus30_device : public namco_audio_device { public: - namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( namcos1_cus30_w ); /* wavedata + sound registers + RAM */ DECLARE_READ8_MEMBER( namcos1_cus30_r ); diff --git a/src/devices/sound/nes_apu.cpp b/src/devices/sound/nes_apu.cpp index 97e65fdc35f..7ffab7c9009 100644 --- a/src/devices/sound/nes_apu.cpp +++ b/src/devices/sound/nes_apu.cpp @@ -103,7 +103,7 @@ static void create_noise(uint8 *buf, const int bits, int size) const device_type NES_APU = &device_creator; -nesapu_device::nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nesapu_device::nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NES_APU, "N2A03 APU", tag, owner, clock, "nesapu", __FILE__), device_sound_interface(mconfig, *this), m_apu_incsize(0.0), diff --git a/src/devices/sound/nes_apu.h b/src/devices/sound/nes_apu.h index 020b8a7d4e6..d1caa1c7fbc 100644 --- a/src/devices/sound/nes_apu.h +++ b/src/devices/sound/nes_apu.h @@ -47,7 +47,7 @@ class nesapu_device : public device_t, public device_sound_interface { public: - nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~nesapu_device() {} static void set_cpu_tag(device_t &device, const char *tag) { downcast(device).m_cpu_tag = tag; } diff --git a/src/devices/sound/nes_defs.h b/src/devices/sound/nes_defs.h index 5ba6ed3bca1..94dc75b18f7 100644 --- a/src/devices/sound/nes_defs.h +++ b/src/devices/sound/nes_defs.h @@ -35,13 +35,13 @@ #endif /* REGULAR TYPE DEFINITIONS */ -typedef INT8 int8; -typedef INT16 int16; -typedef INT32 int32; -typedef UINT8 uint8; -typedef UINT16 uint16; -typedef UINT32 uint32; -typedef UINT8 boolean; +typedef int8_t int8; +typedef int16_t int16; +typedef int32_t int32; +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +typedef uint8_t boolean; /* QUEUE TYPES */ diff --git a/src/devices/sound/nile.cpp b/src/devices/sound/nile.cpp index ecb193d005a..09a8d02ce21 100644 --- a/src/devices/sound/nile.cpp +++ b/src/devices/sound/nile.cpp @@ -52,7 +52,7 @@ enum const device_type NILE = &device_creator; -nile_device::nile_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +nile_device::nile_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NILE, "NiLe", tag, owner, clock, "nile", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -79,12 +79,12 @@ void nile_device::device_start() void nile_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - UINT8 *sound_ram = &m_sound_ram[0]; + uint8_t *sound_ram = &m_sound_ram[0]; int v, i, snum; - UINT16 *slot; - INT32 mix[48000*2]; - INT32 *mixp; - INT16 sample; + uint16_t *slot; + int32_t mix[48000*2]; + int32_t *mixp; + int16_t sample; int sptr, eptr, freq, lsptr, leptr; lsptr=leptr=0; @@ -110,8 +110,8 @@ void nile_device::sound_stream_update(sound_stream &stream, stream_sample_t **in { sample = sound_ram[sptr + m_vpos[v]]<<8; - *mixp++ += (sample * (INT32)slot[NILE_REG_VOL_R]) >> 16; - *mixp++ += (sample * (INT32)slot[NILE_REG_VOL_L]) >> 16; + *mixp++ += (sample * (int32_t)slot[NILE_REG_VOL_R]) >> 16; + *mixp++ += (sample * (int32_t)slot[NILE_REG_VOL_L]) >> 16; m_frac[v] += freq; m_vpos[v] += m_frac[v]>>16; @@ -164,7 +164,7 @@ void nile_device::sound_stream_update(sound_stream &stream, stream_sample_t **in WRITE16_MEMBER( nile_device::nile_sndctrl_w ) { - UINT16 ctrl=m_ctrl; + uint16_t ctrl=m_ctrl; m_stream->update(); diff --git a/src/devices/sound/nile.h b/src/devices/sound/nile.h index 0a298d6b9b8..20a4f6140a1 100644 --- a/src/devices/sound/nile.h +++ b/src/devices/sound/nile.h @@ -28,7 +28,7 @@ class nile_device : public device_t, public device_sound_interface { public: - nile_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nile_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~nile_device() { } protected: @@ -46,12 +46,12 @@ public: private: sound_stream *m_stream; - required_region_ptr m_sound_ram; - UINT16 m_sound_regs[0x80]; + required_region_ptr m_sound_ram; + uint16_t m_sound_regs[0x80]; int m_vpos[NILE_VOICES]; int m_frac[NILE_VOICES]; int m_lponce[NILE_VOICES]; - UINT16 m_ctrl; + uint16_t m_ctrl; }; extern const device_type NILE; diff --git a/src/devices/sound/okiadpcm.cpp b/src/devices/sound/okiadpcm.cpp index 611f7e2f13f..8fc33565aaf 100644 --- a/src/devices/sound/okiadpcm.cpp +++ b/src/devices/sound/okiadpcm.cpp @@ -18,7 +18,7 @@ // ADPCM state and tables bool oki_adpcm_state::s_tables_computed = false; -const INT8 oki_adpcm_state::s_index_shift[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; +const int8_t oki_adpcm_state::s_index_shift[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; int oki_adpcm_state::s_diff_lookup[49*16]; //------------------------------------------------- @@ -38,7 +38,7 @@ void oki_adpcm_state::reset() // changes //------------------------------------------------- -INT16 oki_adpcm_state::clock(UINT8 nibble) +int16_t oki_adpcm_state::clock(uint8_t nibble) { // update the signal m_signal += s_diff_lookup[m_step * 16 + (nibble & 15)]; @@ -74,7 +74,7 @@ void oki_adpcm_state::compute_tables() s_tables_computed = true; // nibble to bit map - static const INT8 nbl2bit[16][4] = + static const int8_t nbl2bit[16][4] = { { 1, 0, 0, 0}, { 1, 0, 0, 1}, { 1, 0, 1, 0}, { 1, 0, 1, 1}, { 1, 1, 0, 0}, { 1, 1, 0, 1}, { 1, 1, 1, 0}, { 1, 1, 1, 1}, @@ -107,7 +107,7 @@ void oki_adpcm_state::compute_tables() // ADPCM state and tables bool oki_adpcm2_state::s_tables_computed = false; -const INT8 oki_adpcm2_state::s_index_shift[8] = { -2, -2, -2, -2, 2, 6, 9, 11 }; +const int8_t oki_adpcm2_state::s_index_shift[8] = { -2, -2, -2, -2, 2, 6, 9, 11 }; int oki_adpcm2_state::s_diff_lookup[49*16]; //------------------------------------------------- @@ -127,7 +127,7 @@ void oki_adpcm2_state::reset() // changes //------------------------------------------------- -INT16 oki_adpcm2_state::clock(UINT8 nibble) +int16_t oki_adpcm2_state::clock(uint8_t nibble) { // update the signal m_signal += s_diff_lookup[m_step * 16 + (nibble & 15)]; @@ -163,7 +163,7 @@ void oki_adpcm2_state::compute_tables() s_tables_computed = true; // nibble to bit map - static const INT8 nbl2bit[16][4] = + static const int8_t nbl2bit[16][4] = { { 1, 0, 0, 0}, { 1, 0, 0, 1}, { 1, 0, 1, 0}, { 1, 0, 1, 1}, { 1, 1, 0, 0}, { 1, 1, 0, 1}, { 1, 1, 1, 0}, { 1, 1, 1, 1}, diff --git a/src/devices/sound/okiadpcm.h b/src/devices/sound/okiadpcm.h index 311ee9d404f..3c2dc91dcce 100644 --- a/src/devices/sound/okiadpcm.h +++ b/src/devices/sound/okiadpcm.h @@ -23,13 +23,13 @@ public: oki_adpcm_state() { compute_tables(); reset(); } void reset(); - INT16 clock(UINT8 nibble); + int16_t clock(uint8_t nibble); - INT32 m_signal; - INT32 m_step; + int32_t m_signal; + int32_t m_step; private: - static const INT8 s_index_shift[8]; + static const int8_t s_index_shift[8]; static int s_diff_lookup[49*16]; static void compute_tables(); @@ -47,13 +47,13 @@ public: oki_adpcm2_state() { compute_tables(); reset(); } void reset(); - INT16 clock(UINT8 nibble); + int16_t clock(uint8_t nibble); - INT32 m_signal; - INT32 m_step; + int32_t m_signal; + int32_t m_step; private: - static const INT8 s_index_shift[8]; + static const int8_t s_index_shift[8]; static int s_diff_lookup[49*16]; static void compute_tables(); diff --git a/src/devices/sound/okim6258.cpp b/src/devices/sound/okim6258.cpp index e317696efa6..57a87dd71fa 100644 --- a/src/devices/sound/okim6258.cpp +++ b/src/devices/sound/okim6258.cpp @@ -46,7 +46,7 @@ const device_type OKIM6258 = &device_creator; // okim6258_device - constructor //------------------------------------------------- -okim6258_device::okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +okim6258_device::okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OKIM6258, "OKI6258", tag, owner, clock, "okim6258", __FILE__), device_sound_interface(mconfig, *this), m_status(0), @@ -159,7 +159,7 @@ void okim6258_device::sound_stream_update(sound_stream &stream, stream_sample_t int nibble = (m_data_in >> nibble_shift) & 0xf; /* Output to the buffer */ - INT16 sample = clock_adpcm(nibble); + int16_t sample = clock_adpcm(nibble); nibble_shift ^= 4; @@ -198,10 +198,10 @@ void okim6258_device::okim6258_state_save_register() } -INT16 okim6258_device::clock_adpcm(UINT8 nibble) +int16_t okim6258_device::clock_adpcm(uint8_t nibble) { - INT32 max = (1 << (m_output_bits - 1)) - 1; - INT32 min = -(1 << (m_output_bits - 1)); + int32_t max = (1 << (m_output_bits - 1)) - 1; + int32_t min = -(1 << (m_output_bits - 1)); m_signal += diff_lookup[m_step * 16 + (nibble & 15)]; diff --git a/src/devices/sound/okim6258.h b/src/devices/sound/okim6258.h index 2e8d6f1891c..ad8985ad5cd 100644 --- a/src/devices/sound/okim6258.h +++ b/src/devices/sound/okim6258.h @@ -45,7 +45,7 @@ class okim6258_device : public device_t, public device_sound_interface { public: - okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~okim6258_device() { } // static configuration @@ -73,24 +73,24 @@ public: private: void okim6258_state_save_register(); - INT16 clock_adpcm(UINT8 nibble); + int16_t clock_adpcm(uint8_t nibble); private: - UINT8 m_status; - - UINT32 m_master_clock; /* master clock frequency */ - UINT32 m_start_divider; - UINT32 m_divider; /* master clock divider */ - UINT8 m_adpcm_type; /* 3/4 bit ADPCM select */ - UINT8 m_data_in; /* ADPCM data-in register */ - UINT8 m_nibble_shift; /* nibble select */ + uint8_t m_status; + + uint32_t m_master_clock; /* master clock frequency */ + uint32_t m_start_divider; + uint32_t m_divider; /* master clock divider */ + uint8_t m_adpcm_type; /* 3/4 bit ADPCM select */ + uint8_t m_data_in; /* ADPCM data-in register */ + uint8_t m_nibble_shift; /* nibble select */ sound_stream *m_stream; /* which stream are we playing on? */ - UINT8 m_output_bits; /* D/A precision is 10-bits but 12-bit data can be + uint8_t m_output_bits; /* D/A precision is 10-bits but 12-bit data can be output serially to an external DAC */ - INT32 m_signal; - INT32 m_step; + int32_t m_signal; + int32_t m_step; }; extern const device_type OKIM6258; diff --git a/src/devices/sound/okim6295.cpp b/src/devices/sound/okim6295.cpp index e350992c0db..d1aa03c9c41 100644 --- a/src/devices/sound/okim6295.cpp +++ b/src/devices/sound/okim6295.cpp @@ -51,7 +51,7 @@ const device_type OKIM6295 = &device_creator; // volume lookup table. The manual lists only 9 steps, ~3dB per step. Given the dB values, // that seems to map to a 5-bit volume control. Any volume parameter beyond the 9th index // results in silent playback. -const UINT8 okim6295_device::s_volume_table[16] = +const uint8_t okim6295_device::s_volume_table[16] = { 0x20, // 0 dB 0x16, // -3.2 dB @@ -80,7 +80,7 @@ const UINT8 okim6295_device::s_volume_table[16] = // okim6295_device - constructor //------------------------------------------------- -okim6295_device::okim6295_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +okim6295_device::okim6295_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OKIM6295, "OKI6295", tag, owner, clock, "okim6295", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 18), @@ -206,9 +206,9 @@ void okim6295_device::set_pin7(int pin7) // read_status - read the status register //------------------------------------------------- -UINT8 okim6295_device::read_status() +uint8_t okim6295_device::read_status() { - UINT8 result = 0xf0; // naname expects bits 4-7 to be 1 + uint8_t result = 0xf0; // naname expects bits 4-7 to be 1 // set the bit to 1 if something is playing on a given channel m_stream->update(); @@ -234,7 +234,7 @@ READ8_MEMBER( okim6295_device::read ) // write_command - write to the command register //------------------------------------------------- -void okim6295_device::write_command(UINT8 command) +void okim6295_device::write_command(uint8_t command) { // if a command is pending, process the second half if (m_command != -1) diff --git a/src/devices/sound/okim6295.h b/src/devices/sound/okim6295.h index 661e4bb54ad..87310cedb29 100644 --- a/src/devices/sound/okim6295.h +++ b/src/devices/sound/okim6295.h @@ -58,7 +58,7 @@ class okim6295_device : public device_t, { public: // construction/destruction - okim6295_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + okim6295_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_pin7(device_t &device, int pin7); @@ -66,8 +66,8 @@ public: // runtime configuration void set_pin7(int pin7); - UINT8 read_status(); - void write_command(UINT8 command); + uint8_t read_status(); + void write_command(uint8_t command); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -95,9 +95,9 @@ protected: oki_adpcm_state m_adpcm; // current ADPCM state bool m_playing; offs_t m_base_offset; // pointer to the base memory location - UINT32 m_sample; // current sample number - UINT32 m_count; // total samples to play - INT8 m_volume; // output volume + uint32_t m_sample; // current sample number + uint32_t m_count; // total samples to play + int8_t m_volume; // output volume }; // configuration state @@ -107,11 +107,11 @@ protected: static const int OKIM6295_VOICES = 4; okim_voice m_voice[OKIM6295_VOICES]; - INT32 m_command; + int32_t m_command; sound_stream * m_stream; - UINT8 m_pin7_state; + uint8_t m_pin7_state; - static const UINT8 s_volume_table[16]; + static const uint8_t s_volume_table[16]; }; diff --git a/src/devices/sound/okim6376.cpp b/src/devices/sound/okim6376.cpp index e4a74eefdb5..47dd68a0b8f 100644 --- a/src/devices/sound/okim6376.cpp +++ b/src/devices/sound/okim6376.cpp @@ -112,7 +112,7 @@ static void reset_adpcm(struct ADPCMVoice *voice) const device_type OKIM6376 = &device_creator; -okim6376_device::okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +okim6376_device::okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OKIM6376, "OKI6376", tag, owner, clock, "okim6376", __FILE__), device_sound_interface(mconfig, *this), m_region_base(*this, DEVICE_SELF), @@ -202,7 +202,7 @@ void okim6376_device::device_reset() ***********************************************************************************************/ -static INT16 clock_adpcm(struct ADPCMVoice *voice, UINT8 nibble) +static int16_t clock_adpcm(struct ADPCMVoice *voice, uint8_t nibble) { voice->signal += diff_lookup[voice->step * 16 + (nibble & 15)]; @@ -300,12 +300,12 @@ void okim6376_device::oki_process(int channel, int command) ***********************************************************************************************/ -void okim6376_device::generate_adpcm(struct ADPCMVoice *voice, INT16 *buffer, int samples,int channel) +void okim6376_device::generate_adpcm(struct ADPCMVoice *voice, int16_t *buffer, int samples,int channel) { /* if this voice is active */ if (voice->playing) { - UINT8 *base = m_region_base + voice->base_offset; + uint8_t *base = m_region_base + voice->base_offset; int sample = voice->sample; int count = voice->count; @@ -551,7 +551,7 @@ void okim6376_device::sound_stream_update(sound_stream &stream, stream_sample_t { struct ADPCMVoice *voice = &m_voice[i]; stream_sample_t *buffer = outputs[0]; - INT16 sample_data[MAX_SAMPLE_CHUNK]; + int16_t sample_data[MAX_SAMPLE_CHUNK]; int remaining = samples; if (i == 0) //channel 1 is the only channel to affect NAR { diff --git a/src/devices/sound/okim6376.h b/src/devices/sound/okim6376.h index df5255291b1..a514e8528dd 100644 --- a/src/devices/sound/okim6376.h +++ b/src/devices/sound/okim6376.h @@ -10,22 +10,22 @@ /* struct describing a single playing ADPCM voice */ struct ADPCMVoice { - UINT8 playing; /* 1 if we are actively playing */ + uint8_t playing; /* 1 if we are actively playing */ - UINT32 base_offset; /* pointer to the base memory location */ - UINT32 sample; /* current sample number */ - UINT32 count; /* total samples to play */ + uint32_t base_offset; /* pointer to the base memory location */ + uint32_t sample; /* current sample number */ + uint32_t count; /* total samples to play */ - UINT32 volume; /* output volume */ - INT32 signal; - INT32 step; + uint32_t volume; /* output volume */ + int32_t signal; + int32_t step; }; class okim6376_device : public device_t, public device_sound_interface { public: - okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~okim6376_device() {} DECLARE_WRITE8_MEMBER( write ); @@ -50,28 +50,28 @@ protected: private: // internal state - required_region_ptr m_region_base; /* pointer to the base of the region */ + required_region_ptr m_region_base; /* pointer to the base of the region */ #define OKIM6376_VOICES 2 struct ADPCMVoice m_voice[OKIM6376_VOICES]; - INT32 m_command[OKIM6376_VOICES]; - INT32 m_latch; /* Command data is held before transferring to either channel */ - UINT8 m_stage[OKIM6376_VOICES];/* If a sample is playing, flag that we have a command staged */ + int32_t m_command[OKIM6376_VOICES]; + int32_t m_latch; /* Command data is held before transferring to either channel */ + uint8_t m_stage[OKIM6376_VOICES];/* If a sample is playing, flag that we have a command staged */ sound_stream *m_stream; /* which stream are we playing on? */ - UINT32 m_master_clock; /* master clock frequency */ - UINT8 m_divisor; /* can be 8,10,16, and is read out of ROM data */ - UINT8 m_channel; - UINT8 m_nar; /* Next Address Ready */ - UINT8 m_nartimer; - UINT8 m_busy; - UINT8 m_ch2; /* 2CH pin - enables Channel 2 operation */ - UINT8 m_st; /* STart */ - UINT8 m_st_pulses; /* Keep track of attenuation */ - UINT8 m_ch2_update; /* Pulse shape */ - UINT8 m_st_update; + uint32_t m_master_clock; /* master clock frequency */ + uint8_t m_divisor; /* can be 8,10,16, and is read out of ROM data */ + uint8_t m_channel; + uint8_t m_nar; /* Next Address Ready */ + uint8_t m_nartimer; + uint8_t m_busy; + uint8_t m_ch2; /* 2CH pin - enables Channel 2 operation */ + uint8_t m_st; /* STart */ + uint8_t m_st_pulses; /* Keep track of attenuation */ + uint8_t m_ch2_update; /* Pulse shape */ + uint8_t m_st_update; void oki_process(int channel, int command); - void generate_adpcm(struct ADPCMVoice *voice, INT16 *buffer, int samples,int channel); + void generate_adpcm(struct ADPCMVoice *voice, int16_t *buffer, int samples,int channel); void postload(); void okim6376_state_save_register(); void adpcm_state_save_register(struct ADPCMVoice *voice, int index); diff --git a/src/devices/sound/okim9810.cpp b/src/devices/sound/okim9810.cpp index 09675991997..1e687b4be9d 100644 --- a/src/devices/sound/okim9810.cpp +++ b/src/devices/sound/okim9810.cpp @@ -21,7 +21,7 @@ const device_type OKIM9810 = &device_creator; // volume lookup table. The manual lists a full 16 steps, 2dB per step. // Given the dB values, that seems to map to a 7-bit volume control. -const UINT8 okim9810_device::okim_voice::s_volume_table[16] = +const uint8_t okim9810_device::okim_voice::s_volume_table[16] = { 0x80, // 0 dB 0x65, // -2 dB @@ -42,7 +42,7 @@ const UINT8 okim9810_device::okim_voice::s_volume_table[16] = }; // sampling frequency lookup table. -const UINT32 okim9810_device::s_sampling_freq_table[16] = +const uint32_t okim9810_device::s_sampling_freq_table[16] = { 4000, 8000, @@ -72,7 +72,7 @@ const UINT32 okim9810_device::s_sampling_freq_table[16] = // okim9810_device - constructor //------------------------------------------------- -okim9810_device::okim9810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +okim9810_device::okim9810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OKIM9810, "OKI9810", tag, owner, clock, "okim9810", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 24), @@ -191,10 +191,10 @@ void okim9810_device::sound_stream_update(sound_stream &stream, stream_sample_t // read_status - read the status register //------------------------------------------------- -UINT8 okim9810_device::read_status() +uint8_t okim9810_device::read_status() { - UINT8 result = 0x00; - UINT8 channelMask = 0x01; + uint8_t result = 0x00; + uint8_t channelMask = 0x01; for (int i = 0; i < OKIM9810_VOICES; i++, channelMask <<= 1) { if (!m_voice[i].m_playing) @@ -219,17 +219,17 @@ READ8_MEMBER( okim9810_device::read ) //------------------------------------------------- // The command is written when the CMD pin is low -void okim9810_device::write_command(UINT8 data) +void okim9810_device::write_command(uint8_t data) { - const UINT8 cmd = (data & 0xf8) >> 3; - const UINT8 channel = (data & 0x07); + const uint8_t cmd = (data & 0xf8) >> 3; + const uint8_t channel = (data & 0x07); switch(cmd) { case 0x00: // START { osd_printf_debug("START channel mask %02x\n", m_TMP_register); - UINT8 channelMask = 0x01; + uint8_t channelMask = 0x01; for (int i = 0; i < OKIM9810_VOICES; i++, channelMask <<= 1) { if (channelMask & m_TMP_register) @@ -251,7 +251,7 @@ void okim9810_device::write_command(UINT8 data) case 0x01: // STOP { osd_printf_debug("STOP channel mask %02x\n", m_TMP_register); - UINT8 channelMask = 0x01; + uint8_t channelMask = 0x01; for (int i = 0; i < OKIM9810_VOICES; i++, channelMask <<= 1) { if (channelMask & m_TMP_register) @@ -265,7 +265,7 @@ void okim9810_device::write_command(UINT8 data) case 0x02: // LOOP { osd_printf_debug("LOOP channel mask %02x\n", m_TMP_register); - UINT8 channelMask = 0x01; + uint8_t channelMask = 0x01; for (int i = 0; i < OKIM9810_VOICES; i++, channelMask <<= 1) { if (channelMask & m_TMP_register) @@ -304,13 +304,13 @@ void okim9810_device::write_command(UINT8 data) const offs_t base = m_TMP_register * 8; offs_t startAddr; - UINT8 startFlags = read_byte(base + 0); + uint8_t startFlags = read_byte(base + 0); startAddr = read_byte(base + 1) << 16; startAddr |= read_byte(base + 2) << 8; startAddr |= read_byte(base + 3) << 0; offs_t endAddr; - UINT8 endFlags = read_byte(base + 4); + uint8_t endFlags = read_byte(base + 4); endAddr = read_byte(base + 5) << 16; endAddr |= read_byte(base + 6) << 8; endAddr |= read_byte(base + 7) << 0; @@ -367,8 +367,8 @@ void okim9810_device::write_command(UINT8 data) } case 0x08: // PAN { - const UINT8 leftVolIndex = (m_TMP_register & 0xf0) >> 4; - const UINT8 rightVolIndex = m_TMP_register & 0x0f; + const uint8_t leftVolIndex = (m_TMP_register & 0xf0) >> 4; + const uint8_t rightVolIndex = m_TMP_register & 0x0f; osd_printf_debug("PAN channel %d left index: %02x right index: %02x (%02x)\n", channel, leftVolIndex, rightVolIndex, m_TMP_register); osd_printf_debug("\tChannel %d left -> %d right -> %d\n", channel, leftVolIndex, rightVolIndex); m_voice[channel].m_pan_volume_left = leftVolIndex; @@ -394,7 +394,7 @@ WRITE8_MEMBER( okim9810_device::write ) //----------------------------------------------------------- // TMP is written when the CMD pin is high -void okim9810_device::write_TMP_register(UINT8 data) +void okim9810_device::write_TMP_register(uint8_t data) { m_TMP_register = data; } @@ -440,9 +440,9 @@ okim9810_device::okim_voice::okim_voice() void okim9810_device::okim_voice::generate_audio(device_rom_interface &rom, stream_sample_t **buffers, int samples, - const UINT8 global_volume, - const UINT32 clock, - const UINT8 filter_type) + const uint8_t global_volume, + const uint32_t clock, + const uint8_t filter_type) { // skip if not active if (!m_playing) @@ -453,11 +453,11 @@ void okim9810_device::okim_voice::generate_audio(device_rom_interface &rom, stream_sample_t *outR = buffers[1]; // get left and right volumes - UINT8 volume_scale_left = volume_scale(global_volume, m_channel_volume, m_pan_volume_left); - UINT8 volume_scale_right = volume_scale(global_volume, m_channel_volume, m_pan_volume_right); + uint8_t volume_scale_left = volume_scale(global_volume, m_channel_volume, m_pan_volume_left); + uint8_t volume_scale_right = volume_scale(global_volume, m_channel_volume, m_pan_volume_right); // total samples per byte - UINT32 totalInterpSamples = clock / m_samplingFreq; + uint32_t totalInterpSamples = clock / m_samplingFreq; // loop while we still have samples to generate while (samples-- != 0) @@ -475,13 +475,13 @@ void okim9810_device::okim_voice::generate_audio(device_rom_interface &rom, case OKIM9810_ADPCM_PLAYBACK: { m_adpcm.reset(); - m_startSample = (INT32)m_adpcm.clock(nibble0); + m_startSample = (int32_t)m_adpcm.clock(nibble0); break; } case OKIM9810_ADPCM2_PLAYBACK: { m_adpcm2.reset(); - m_startSample = (INT32)m_adpcm2.clock(nibble0); + m_startSample = (int32_t)m_adpcm2.clock(nibble0); break; } default: @@ -500,12 +500,12 @@ void okim9810_device::okim_voice::generate_audio(device_rom_interface &rom, { case OKIM9810_ADPCM_PLAYBACK: { - m_endSample = (INT32)m_adpcm.clock(nibble1); + m_endSample = (int32_t)m_adpcm.clock(nibble1); break; } case OKIM9810_ADPCM2_PLAYBACK: { - m_endSample = (INT32)m_adpcm2.clock(nibble1); + m_endSample = (int32_t)m_adpcm2.clock(nibble1); break; } default: @@ -515,7 +515,7 @@ void okim9810_device::okim_voice::generate_audio(device_rom_interface &rom, // TODO: Interpolate using proper numeric types. float progress = (float)m_interpSampleNum / (float)totalInterpSamples; - INT32 interpValue = (INT32)((float)m_startSample + (((float)m_endSample-(float)m_startSample) * progress)); + int32_t interpValue = (int32_t)((float)m_startSample + (((float)m_endSample-(float)m_startSample) * progress)); // if filtering is unwanted if (filter_type != OKIM9810_SECONDARY_FILTER && filter_type != OKIM9810_PRIMARY_FILTER) @@ -523,10 +523,10 @@ void okim9810_device::okim_voice::generate_audio(device_rom_interface &rom, // output to the stereo buffers, scaling by the volume // signal in range -2048..2047, volume in range 2..128 => signal * volume / 8 in range -32768..32767 - INT32 interpValueL = (interpValue * (INT32)volume_scale_left) / 8; + int32_t interpValueL = (interpValue * (int32_t)volume_scale_left) / 8; *outL++ += interpValueL; - INT32 interpValueR = (interpValue * (INT32)volume_scale_right) / 8; + int32_t interpValueR = (interpValue * (int32_t)volume_scale_right) / 8; *outR++ += interpValueR; // if the interpsample has reached its end, move on to the next sample @@ -560,14 +560,14 @@ void okim9810_device::okim_voice::generate_audio(device_rom_interface &rom, // Returns a value from the volume lookup table. //------------------------------------------------- -UINT8 okim9810_device::okim_voice::volume_scale(const UINT8 global_volume_index, - const UINT8 channel_volume_index, - const UINT8 pan_volume_index) const +uint8_t okim9810_device::okim_voice::volume_scale(const uint8_t global_volume_index, + const uint8_t channel_volume_index, + const uint8_t pan_volume_index) const { - const UINT8& V = channel_volume_index; - const UINT8& L = pan_volume_index; - const UINT8& O = global_volume_index; - UINT32 index = (V+L) + (O*3); + const uint8_t& V = channel_volume_index; + const uint8_t& L = pan_volume_index; + const uint8_t& O = global_volume_index; + uint32_t index = (V+L) + (O*3); if (index > 15) index = 15; diff --git a/src/devices/sound/okim9810.h b/src/devices/sound/okim9810.h index b4878c0cff2..61dd46b779f 100644 --- a/src/devices/sound/okim9810.h +++ b/src/devices/sound/okim9810.h @@ -72,11 +72,11 @@ class okim9810_device : public device_t, { public: // construction/destruction - okim9810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + okim9810_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT8 read_status(); - void write_TMP_register(UINT8 command); - void write_command(UINT8 command); + uint8_t read_status(); + void write_TMP_register(uint8_t command); + void write_command(uint8_t command); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -103,53 +103,53 @@ protected: void generate_audio(device_rom_interface &rom, stream_sample_t **buffers, int samples, - const UINT8 global_volume, - const UINT32 clock, - const UINT8 filter_type); + const uint8_t global_volume, + const uint32_t clock, + const uint8_t filter_type); // computes volume scale from 3 volume numbers - UINT8 volume_scale(const UINT8 global_volume, - const UINT8 channel_volume, - const UINT8 pan_volume) const; + uint8_t volume_scale(const uint8_t global_volume, + const uint8_t channel_volume, + const uint8_t pan_volume) const; oki_adpcm_state m_adpcm; // current ADPCM state oki_adpcm2_state m_adpcm2; // current ADPCM2 state - UINT8 m_playbackAlgo; // current playback method + uint8_t m_playbackAlgo; // current playback method bool m_looping; - UINT8 m_startFlags; - UINT8 m_endFlags; + uint8_t m_startFlags; + uint8_t m_endFlags; offs_t m_base_offset; // pointer to the base memory location - UINT32 m_count; // total samples to play - UINT32 m_samplingFreq; // voice sampling frequency + uint32_t m_count; // total samples to play + uint32_t m_samplingFreq; // voice sampling frequency bool m_playing; // playback state - UINT32 m_sample; // current sample number + uint32_t m_sample; // current sample number - UINT8 m_channel_volume; // volume index set with the CVOL command - UINT8 m_pan_volume_left; // volume index set with the PAN command - UINT8 m_pan_volume_right; // volume index set with the PAN command + uint8_t m_channel_volume; // volume index set with the CVOL command + uint8_t m_pan_volume_left; // volume index set with the PAN command + uint8_t m_pan_volume_right; // volume index set with the PAN command - INT32 m_startSample; // interpolation state - sample to interpolate from - INT32 m_endSample; // interpolation state - sample to interpolate to - UINT32 m_interpSampleNum; // interpolation state - fraction between start & end + int32_t m_startSample; // interpolation state - sample to interpolate from + int32_t m_endSample; // interpolation state - sample to interpolate to + uint32_t m_interpSampleNum; // interpolation state - fraction between start & end - static const UINT8 s_volume_table[16]; + static const uint8_t s_volume_table[16]; }; // internal state sound_stream* m_stream; - UINT8 m_TMP_register; + uint8_t m_TMP_register; - UINT8 m_global_volume; // volume index set with the OPT command - UINT8 m_filter_type; // interpolation filter type set with the OPT command - UINT8 m_output_level; // flag stating if a voltage follower is connected + uint8_t m_global_volume; // volume index set with the OPT command + uint8_t m_filter_type; // interpolation filter type set with the OPT command + uint8_t m_output_level; // flag stating if a voltage follower is connected static const int OKIM9810_VOICES = 8; okim_voice m_voice[OKIM9810_VOICES]; - static const UINT32 s_sampling_freq_table[16]; + static const uint32_t s_sampling_freq_table[16]; }; diff --git a/src/devices/sound/pcd3311.cpp b/src/devices/sound/pcd3311.cpp index 799e96b4311..96c7c122cf4 100644 --- a/src/devices/sound/pcd3311.cpp +++ b/src/devices/sound/pcd3311.cpp @@ -26,7 +26,7 @@ const device_type PCD3311 = &device_creator; // pcd3311_t - constructor //------------------------------------------------- -pcd3311_t::pcd3311_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pcd3311_t::pcd3311_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCD3311, "PCD3311", tag, owner, clock, "pcd3311", __FILE__), device_sound_interface(mconfig, *this) { diff --git a/src/devices/sound/pcd3311.h b/src/devices/sound/pcd3311.h index 0467afc416c..81c8fa7e089 100644 --- a/src/devices/sound/pcd3311.h +++ b/src/devices/sound/pcd3311.h @@ -37,7 +37,7 @@ class pcd3311_t : public device_t, { public: // construction/destruction - pcd3311_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pcd3311_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( write ) { m_data = data; } DECLARE_WRITE_LINE_MEMBER( strobe_w ) { m_strobe = state; } @@ -55,7 +55,7 @@ private: int m_a0; int m_mode; int m_strobe; - UINT8 m_data; + uint8_t m_data; }; diff --git a/src/devices/sound/pci-ac97.cpp b/src/devices/sound/pci-ac97.cpp index 84018534e46..21c9f108aee 100644 --- a/src/devices/sound/pci-ac97.cpp +++ b/src/devices/sound/pci-ac97.cpp @@ -16,7 +16,7 @@ ADDRESS_MAP_END DEVICE_ADDRESS_MAP_START(bus_mastering_map, 32, ac97_device) ADDRESS_MAP_END -ac97_device::ac97_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ac97_device::ac97_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, AC97, "AC97 audio", tag, owner, clock, "ac97", __FILE__) { } diff --git a/src/devices/sound/pci-ac97.h b/src/devices/sound/pci-ac97.h index 185a89084e2..00cddfd29ef 100644 --- a/src/devices/sound/pci-ac97.h +++ b/src/devices/sound/pci-ac97.h @@ -10,7 +10,7 @@ class ac97_device : public pci_device { public: - ac97_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ac97_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp index ecbef5c3b11..97ac8fb6258 100644 --- a/src/devices/sound/pokey.cpp +++ b/src/devices/sound/pokey.cpp @@ -177,7 +177,7 @@ const device_type POKEY = &device_creator; // okim9810_device - constructor //------------------------------------------------- -pokey_device::pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pokey_device::pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, POKEY, "POKEY", tag, owner, clock, "pokey", __FILE__), device_sound_interface(mconfig, *this), device_execute_interface(mconfig, *this), @@ -424,7 +424,7 @@ void pokey_device::device_timer(emu_timer &timer, device_timer_id id, int param, case SYNC_WRITE: { offs_t offset = (param >> 8) & 0xff; - UINT8 data = param & 0xff; + uint8_t data = param & 0xff; write_internal(offset, data); } break; @@ -455,9 +455,9 @@ void pokey_device::execute_run() debugger_instruction_hook(this, 0); //m_pc); // instruction fetch - //UINT16 op = opcode_read(); + //uint16_t op = opcode_read(); - UINT32 new_out = step_one_clock(); + uint32_t new_out = step_one_clock(); if (m_output != new_out) { //printf("forced update %08d %08x\n", m_icount, m_output); @@ -482,7 +482,7 @@ void pokey_device::step_keyboard() m_kbd_cnt = 0; if (!m_keyboard_r.isnull()) { - UINT8 ret = m_keyboard_r(m_kbd_cnt); + uint8_t ret = m_keyboard_r(m_kbd_cnt); switch (m_kbd_cnt) { @@ -569,7 +569,7 @@ void pokey_device::step_keyboard() void pokey_device::step_pot() { int pot; - UINT8 upd = 0; + uint8_t upd = 0; m_pot_counter++; for (pot = 0; pot < 8; pot++) { @@ -590,10 +590,10 @@ void pokey_device::step_pot() * */ -UINT32 pokey_device::step_one_clock(void) +uint32_t pokey_device::step_one_clock(void) { int ch, clk; - UINT32 sum = 0; + uint32_t sum = 0; int clock_triggered[3] = {0,0,0}; int base_clock = (m_AUDCTL & CLK_15KHZ) ? CLK_114 : CLK_28; @@ -718,7 +718,7 @@ void pokey_device::sound_stream_update(sound_stream &stream, stream_sample_t **i if (m_output_type == LEGACY_LINEAR) { - INT32 out = 0; + int32_t out = 0; for (int i = 0; i < 4; i++) out += ((m_output >> (4*i)) & 0x0f); out *= POKEY_DEFAULT_GAIN; @@ -787,7 +787,7 @@ void pokey_device::sound_stream_update(sound_stream &stream, stream_sample_t **i } else if (m_output_type == DISCRETE_VAR_R) { - INT32 out = m_voltab[m_output]; + int32_t out = m_voltab[m_output]; while( samples > 0 ) { *buffer++ = out; @@ -805,7 +805,7 @@ READ8_MEMBER( pokey_device::read ) return read(offset); } -UINT8 pokey_device::read(offs_t offset) +uint8_t pokey_device::read(offs_t offset) { int data, pot; @@ -902,7 +902,7 @@ UINT8 pokey_device::read(offs_t offset) // write - memory interface for write //------------------------------------------------- -void pokey_device::write(offs_t offset, UINT8 data) +void pokey_device::write(offs_t offset, uint8_t data) { synchronize(SYNC_WRITE, (offset<<8) | data); } @@ -912,7 +912,7 @@ WRITE8_MEMBER( pokey_device::write ) write(offset, data); } -void pokey_device::write_internal(offs_t offset, UINT8 data) +void pokey_device::write_internal(offs_t offset, uint8_t data) { /* determine which address was changed */ switch (offset & 15) @@ -1338,11 +1338,11 @@ void pokey_device::vol_init() } -void pokey_device::poly_init_4_5(UINT32 *poly, int size, int xorbit, int invert) +void pokey_device::poly_init_4_5(uint32_t *poly, int size, int xorbit, int invert) { int mask = (1 << size) - 1; int i; - UINT32 lfsr = 0; + uint32_t lfsr = 0; LOG_POLY(("poly %d\n", size)); for( i = 0; i < mask; i++ ) @@ -1357,11 +1357,11 @@ void pokey_device::poly_init_4_5(UINT32 *poly, int size, int xorbit, int invert) } } -void pokey_device::poly_init_9_17(UINT32 *poly, int size) +void pokey_device::poly_init_9_17(uint32_t *poly, int size) { int mask = (1 << size) - 1; int i; - UINT32 lfsr =mask; + uint32_t lfsr =mask; LOG_RAND(("rand %d\n", size)); diff --git a/src/devices/sound/pokey.h b/src/devices/sound/pokey.h index f555ae4b5b0..45d33b62e8d 100644 --- a/src/devices/sound/pokey.h +++ b/src/devices/sound/pokey.h @@ -55,10 +55,10 @@ // CALLBACK HANDLERS //************************************************************************** -typedef device_delegate pokey_kb_cb_delegate; +typedef device_delegate pokey_kb_cb_delegate; typedef device_delegate pokey_int_cb_delegate; -#define POKEY_KEYBOARD_CB_MEMBER(_name) UINT8 _name(UINT8 k543210) +#define POKEY_KEYBOARD_CB_MEMBER(_name) uint8_t _name(uint8_t k543210) #define POKEY_INTERRUPT_CB_MEMBER(_name) void _name(int mask) @@ -208,7 +208,7 @@ public: }; // construction/destruction - pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_pot0_r_callback(device_t &device, _Object object) { return downcast(device).m_pot0_r_cb.set_callback(object); } template static devcb_base &set_pot1_r_callback(device_t &device, _Object object) { return downcast(device).m_pot1_r_cb.set_callback(object); } @@ -228,8 +228,8 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - 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); DECLARE_WRITE_LINE_MEMBER( sid_w ); // pin 24 void serin_ready(int after); @@ -254,7 +254,7 @@ protected: virtual void execute_run() override; - //virtual UINT32 execute_min_cycles() const { return 114; } + //virtual uint32_t execute_min_cycles() const { return 114; } // other internal states int m_icount; @@ -266,14 +266,14 @@ private: public: pokey_channel(); pokey_device *m_parent; - UINT8 m_INTMask; - UINT8 m_AUDF; /* AUDFx (D200, D202, D204, D206) */ - UINT8 m_AUDC; /* AUDCx (D201, D203, D205, D207) */ - INT32 m_borrow_cnt; /* borrow counter */ - INT32 m_counter; /* channel counter */ - UINT8 m_output; /* channel output signal (1 active, 0 inactive) */ - UINT8 m_filter_sample; /* high-pass filter sample */ - UINT8 m_div2; /* division by 2 */ + uint8_t m_INTMask; + uint8_t m_AUDF; /* AUDFx (D200, D202, D204, D206) */ + uint8_t m_AUDC; /* AUDCx (D201, D203, D205, D207) */ + int32_t m_borrow_cnt; /* borrow counter */ + int32_t m_counter; /* channel counter */ + uint8_t m_output; /* channel output signal (1 active, 0 inactive) */ + uint8_t m_filter_sample; /* high-pass filter sample */ + uint8_t m_div2; /* division by 2 */ inline void sample(void) { m_filter_sample = m_output; } inline void reset_channel(void) { m_counter = m_AUDF ^ 0xff; } @@ -305,12 +305,12 @@ private: static const int POKEY_CHANNELS = 4; - UINT32 step_one_clock(); + uint32_t step_one_clock(); void step_keyboard(); void step_pot(); - void poly_init_4_5(UINT32 *poly, int size, int xorbit, int invert); - void poly_init_9_17(UINT32 *poly, int size); + void poly_init_4_5(uint32_t *poly, int size, int xorbit, int invert); + void poly_init_9_17(uint32_t *poly, int size); void vol_init(); inline void process_channel(int ch); @@ -318,21 +318,21 @@ private: char *audc2str(int val); char *audctl2str(int val); - void write_internal(offs_t offset, UINT8 data); + void write_internal(offs_t offset, uint8_t data); // internal state sound_stream* m_stream; pokey_channel m_channel[POKEY_CHANNELS]; - UINT32 m_output; /* raw output */ + uint32_t m_output; /* raw output */ double m_out_filter; /* filtered output */ - INT32 m_clock_cnt[3]; /* clock counters */ - UINT32 m_p4; /* poly4 index */ - UINT32 m_p5; /* poly5 index */ - UINT32 m_p9; /* poly9 index */ - UINT32 m_p17; /* poly17 index */ + int32_t m_clock_cnt[3]; /* clock counters */ + uint32_t m_p4; /* poly4 index */ + uint32_t m_p5; /* poly5 index */ + uint32_t m_p9; /* poly9 index */ + uint32_t m_p17; /* poly17 index */ devcb_read8 m_pot0_r_cb; devcb_read8 m_pot1_r_cb; @@ -349,29 +349,29 @@ private: pokey_kb_cb_delegate m_keyboard_r; pokey_int_cb_delegate m_irq_f; - UINT8 m_POTx[8]; /* POTx (R/D200-D207) */ - UINT8 m_AUDCTL; /* AUDCTL (W/D208) */ - UINT8 m_ALLPOT; /* ALLPOT (R/D208) */ - UINT8 m_KBCODE; /* KBCODE (R/D209) */ - UINT8 m_SERIN; /* SERIN (R/D20D) */ - UINT8 m_SEROUT; /* SEROUT (W/D20D) */ - UINT8 m_IRQST; /* IRQST (R/D20E) */ - UINT8 m_IRQEN; /* IRQEN (W/D20E) */ - UINT8 m_SKSTAT; /* SKSTAT (R/D20F) */ - UINT8 m_SKCTL; /* SKCTL (W/D20F) */ - - UINT8 m_pot_counter; - UINT8 m_kbd_cnt; - UINT8 m_kbd_latch; - UINT8 m_kbd_state; + uint8_t m_POTx[8]; /* POTx (R/D200-D207) */ + uint8_t m_AUDCTL; /* AUDCTL (W/D208) */ + uint8_t m_ALLPOT; /* ALLPOT (R/D208) */ + uint8_t m_KBCODE; /* KBCODE (R/D209) */ + uint8_t m_SERIN; /* SERIN (R/D20D) */ + uint8_t m_SEROUT; /* SEROUT (W/D20D) */ + uint8_t m_IRQST; /* IRQST (R/D20E) */ + uint8_t m_IRQEN; /* IRQEN (W/D20E) */ + uint8_t m_SKSTAT; /* SKSTAT (R/D20F) */ + uint8_t m_SKCTL; /* SKCTL (W/D20F) */ + + uint8_t m_pot_counter; + uint8_t m_kbd_cnt; + uint8_t m_kbd_latch; + uint8_t m_kbd_state; attotime m_clock_period; - UINT32 m_poly4[0x0f]; - UINT32 m_poly5[0x1f]; - UINT32 m_poly9[0x1ff]; - UINT32 m_poly17[0x1ffff]; - UINT32 m_voltab[0x10000]; + uint32_t m_poly4[0x0f]; + uint32_t m_poly5[0x1f]; + uint32_t m_poly9[0x1ff]; + uint32_t m_poly17[0x1ffff]; + uint32_t m_voltab[0x10000]; }; diff --git a/src/devices/sound/qs1000.cpp b/src/devices/sound/qs1000.cpp index 481677fb107..a85bc8fa707 100644 --- a/src/devices/sound/qs1000.cpp +++ b/src/devices/sound/qs1000.cpp @@ -174,7 +174,7 @@ ROM_END //------------------------------------------------- // qs1000_device - constructor //------------------------------------------------- -qs1000_device::qs1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +qs1000_device::qs1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, QS1000, "QS1000", tag, owner, clock, "qs1000", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 24), @@ -267,7 +267,7 @@ void qs1000_device::device_start() //------------------------------------------------- // serial_in - send data to the chip //------------------------------------------------- -void qs1000_device::serial_in(UINT8 data) +void qs1000_device::serial_in(uint8_t data) { m_serial_data_in = data; @@ -475,9 +475,9 @@ void qs1000_device::sound_stream_update(sound_stream &stream, stream_sample_t ** // Iterate over voices and accumulate sample data for (auto & chan : m_channels) { - UINT8 lvol = chan.m_regs[6]; - UINT8 rvol = chan.m_regs[7]; - UINT8 vol = chan.m_regs[8]; + uint8_t lvol = chan.m_regs[6]; + uint8_t rvol = chan.m_regs[7]; + uint8_t vol = chan.m_regs[8]; if (chan.m_flags & QS1000_PLAYING) { @@ -508,12 +508,12 @@ void qs1000_device::sound_stream_update(sound_stream &stream, stream_sample_t ** if (chan.m_start + chan.m_adpcm_addr >= chan.m_loop_end) chan.m_adpcm_addr = chan.m_loop_start - chan.m_start; - UINT8 data = read_byte(chan.m_start + (chan.m_adpcm_addr >> 1)); - UINT8 nibble = (chan.m_adpcm_addr & 1 ? data : data >> 4) & 0xf; + uint8_t data = read_byte(chan.m_start + (chan.m_adpcm_addr >> 1)); + uint8_t nibble = (chan.m_adpcm_addr & 1 ? data : data >> 4) & 0xf; chan.m_adpcm_signal = chan.m_adpcm.clock(nibble); } - INT8 result = (chan.m_adpcm_signal >> 4); + int8_t result = (chan.m_adpcm_signal >> 4); chan.m_acc += chan.m_freq; chan.m_addr = (chan.m_addr + (chan.m_acc >> 18)) & QS1000_ADDRESS_MASK; chan.m_acc &= ((1 << 18) - 1); @@ -541,7 +541,7 @@ void qs1000_device::sound_stream_update(sound_stream &stream, stream_sample_t ** } } - INT8 result = read_byte(chan.m_addr) - 128; + int8_t result = read_byte(chan.m_addr) - 128; chan.m_acc += chan.m_freq; chan.m_addr = (chan.m_addr + (chan.m_acc >> 18)) & QS1000_ADDRESS_MASK; @@ -558,12 +558,12 @@ void qs1000_device::sound_stream_update(sound_stream &stream, stream_sample_t ** void qs1000_device::start_voice(int ch) { - UINT32 table_addr = (m_channels[ch].m_regs[0x01] << 16) | (m_channels[ch].m_regs[0x02] << 8) | m_channels[ch].m_regs[0x03]; + uint32_t table_addr = (m_channels[ch].m_regs[0x01] << 16) | (m_channels[ch].m_regs[0x02] << 8) | m_channels[ch].m_regs[0x03]; // Fetch the sound information - UINT16 freq = (read_byte(table_addr + 0) << 8) | read_byte(table_addr + 1); - UINT16 word1 = (read_byte(table_addr + 2) << 8) | read_byte(table_addr + 3); - UINT16 base = (read_byte(table_addr + 4) << 8) | read_byte(table_addr + 5); + uint16_t freq = (read_byte(table_addr + 0) << 8) | read_byte(table_addr + 1); + uint16_t word1 = (read_byte(table_addr + 2) << 8) | read_byte(table_addr + 3); + uint16_t base = (read_byte(table_addr + 4) << 8) | read_byte(table_addr + 5); if (LOGGING_ENABLED) printf("[%.6x] Freq:%.4x ????:%.4x Addr:%.4x\n", table_addr, freq, word1, base); @@ -573,16 +573,16 @@ void qs1000_device::start_voice(int ch) return; // Fetch the sample pointers and flags - UINT8 byte0 = read_byte(base); + uint8_t byte0 = read_byte(base); - UINT32 start_addr; + uint32_t start_addr; start_addr = byte0 << 16; start_addr |= read_byte(base + 1) << 8; start_addr |= read_byte(base + 2) << 0; start_addr &= QS1000_ADDRESS_MASK; - UINT32 loop_start; + uint32_t loop_start; loop_start = (byte0 & 0xf0) << 16; loop_start |= read_byte(base + 3) << 12; @@ -590,7 +590,7 @@ void qs1000_device::start_voice(int ch) loop_start |= read_byte(base + 5) >> 4; loop_start &= QS1000_ADDRESS_MASK; - UINT32 loop_end; + uint32_t loop_end; loop_end = (byte0 & 0xf0) << 16; loop_end |= (read_byte(base + 5) & 0xf) << 16; @@ -598,17 +598,17 @@ void qs1000_device::start_voice(int ch) loop_end |= read_byte(base + 7); loop_end &= QS1000_ADDRESS_MASK; - UINT8 byte8 = read_byte(base + 8); + uint8_t byte8 = read_byte(base + 8); if (LOGGING_ENABLED) { - UINT8 byte9 = read_byte(base + 9); - UINT8 byte10 = read_byte(base + 10); - UINT8 byte11 = read_byte(base + 11); - UINT8 byte12 = read_byte(base + 12); - UINT8 byte13 = read_byte(base + 13); - UINT8 byte14 = read_byte(base + 14); - UINT8 byte15 = read_byte(base + 15); + uint8_t byte9 = read_byte(base + 9); + uint8_t byte10 = read_byte(base + 10); + uint8_t byte11 = read_byte(base + 11); + uint8_t byte12 = read_byte(base + 12); + uint8_t byte13 = read_byte(base + 13); + uint8_t byte14 = read_byte(base + 14); + uint8_t byte15 = read_byte(base + 15); printf("[%.6x] Sample Start:%.6x Loop Start:%.6x Loop End:%.6x Params: %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x\n", base, start_addr, loop_start, loop_end, byte8, byte9, byte10, byte11, byte12, byte13, byte14, byte15); } diff --git a/src/devices/sound/qs1000.h b/src/devices/sound/qs1000.h index 122a1cc0950..b7f2f07b45e 100644 --- a/src/devices/sound/qs1000.h +++ b/src/devices/sound/qs1000.h @@ -59,7 +59,7 @@ class qs1000_device : public device_t, { public: // construction/destruction - qs1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + qs1000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_external_rom(device_t &device, bool external_rom) { downcast(device).m_external_rom = external_rom; } template static devcb_base &set_in_p1_callback(device_t &device, _Object object) { return downcast(device).m_in_p1_cb.set_callback(object); } @@ -71,7 +71,7 @@ public: //template static devcb_base &set_serial_w_callback(device_t &device, _Object object) { return downcast(device).m_serial_w_cb.set_callback(object); } // external - void serial_in(UINT8 data); + void serial_in(uint8_t data); void set_irq(int state); protected: @@ -132,22 +132,22 @@ public: required_device m_cpu; // Wavetable engine - UINT8 m_serial_data_in; - UINT8 m_wave_regs[18]; + uint8_t m_serial_data_in; + uint8_t m_wave_regs[18]; struct qs1000_channel { - UINT32 m_acc; - INT32 m_adpcm_signal; - UINT32 m_start; - UINT32 m_addr; - UINT32 m_adpcm_addr; - UINT32 m_loop_start; - UINT32 m_loop_end; - UINT16 m_freq; - UINT16 m_flags; - - UINT8 m_regs[16]; // FIXME + uint32_t m_acc; + int32_t m_adpcm_signal; + uint32_t m_start; + uint32_t m_addr; + uint32_t m_adpcm_addr; + uint32_t m_loop_start; + uint32_t m_loop_end; + uint16_t m_freq; + uint16_t m_flags; + + uint8_t m_regs[16]; // FIXME oki_adpcm_state m_adpcm; }; diff --git a/src/devices/sound/qsound.cpp b/src/devices/sound/qsound.cpp index 43bad4aa960..ddc94045d36 100644 --- a/src/devices/sound/qsound.cpp +++ b/src/devices/sound/qsound.cpp @@ -67,7 +67,7 @@ ROM_END // qsound_device - constructor //------------------------------------------------- -qsound_device::qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +qsound_device::qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, QSOUND, "Q-Sound", tag, owner, clock, "qsound", __FILE__), device_sound_interface(mconfig, *this), m_cpu(*this, "qsound"), @@ -182,7 +182,7 @@ void qsound_device::sound_stream_update(sound_stream &stream, stream_sample_t ** } } - INT8 sample = read_sample(elem.bank | elem.address); + int8_t sample = read_sample(elem.bank | elem.address); *lmix++ += ((sample * elem.lvol * elem.vol) >> 14); *rmix++ += ((sample * elem.rvol * elem.vol) >> 14); } @@ -222,7 +222,7 @@ READ8_MEMBER(qsound_device::qsound_r) } -void qsound_device::write_data(UINT8 address, UINT16 data) +void qsound_device::write_data(uint8_t address, uint16_t data) { int ch = 0, reg; diff --git a/src/devices/sound/qsound.h b/src/devices/sound/qsound.h index 3b2e3d82c50..7c73b4ddf63 100644 --- a/src/devices/sound/qsound.h +++ b/src/devices/sound/qsound.h @@ -32,7 +32,7 @@ class qsound_device : public device_t, public device_sound_interface { public: - qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~qsound_device() { } DECLARE_WRITE8_MEMBER(qsound_w); @@ -50,29 +50,29 @@ protected: private: struct qsound_channel { - UINT32 bank; // bank - UINT32 address; // start/cur address - UINT16 loop; // loop address - UINT16 end; // end address - UINT32 freq; // frequency - UINT16 vol; // master volume + uint32_t bank; // bank + uint32_t address; // start/cur address + uint16_t loop; // loop address + uint16_t end; // end address + uint32_t freq; // frequency + uint16_t vol; // master volume // work variables bool enabled; // key on / key off int lvol; // left volume int rvol; // right volume - UINT32 step_ptr; // current offset counter + uint32_t step_ptr; // current offset counter } m_channel[16]; required_device m_cpu; - required_region_ptr m_sample_rom; + required_region_ptr m_sample_rom; int m_pan_table[33]; // pan volume table - UINT16 m_data; // register latch data + uint16_t m_data; // register latch data sound_stream *m_stream; // audio stream - inline INT8 read_sample(UINT32 offset) { return m_sample_rom[offset & m_sample_rom.mask()]; } - void write_data(UINT8 address, UINT16 data); + inline int8_t read_sample(uint32_t offset) { return m_sample_rom[offset & m_sample_rom.mask()]; } + void write_data(uint8_t address, uint16_t data); }; extern const device_type QSOUND; diff --git a/src/devices/sound/rf5c400.cpp b/src/devices/sound/rf5c400.cpp index 6eaa2245ca9..c6bfe8797d2 100644 --- a/src/devices/sound/rf5c400.cpp +++ b/src/devices/sound/rf5c400.cpp @@ -65,7 +65,7 @@ const device_type RF5C400 = &device_creator; // rf5c400_device - constructor //------------------------------------------------- -rf5c400_device::rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rf5c400_device::rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RF5C400, "RF5C400", tag, owner, clock, "rf5c400", __FILE__), device_sound_interface(mconfig, *this), m_rom(*this, DEVICE_SELF), @@ -94,11 +94,11 @@ void rf5c400_device::device_start() void rf5c400_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { int i, ch; - INT16 *rom = m_rom; - UINT32 end, loop; - UINT64 pos; - UINT8 vol, lvol, rvol, type; - UINT8 env_phase; + int16_t *rom = m_rom; + uint32_t end, loop; + uint64_t pos; + uint8_t vol, lvol, rvol, type; + uint8_t env_phase; double env_level, env_step, env_rstep; memset(outputs[0], 0, samples * sizeof(*outputs[0])); @@ -126,8 +126,8 @@ void rf5c400_device::sound_stream_update(sound_stream &stream, stream_sample_t * for (i=0; i < samples; i++) { - INT16 tmp; - INT32 sample; + int16_t tmp; + int32_t sample; if (env_phase == PHASE_NONE) break; @@ -138,10 +138,10 @@ void rf5c400_device::sound_stream_update(sound_stream &stream, stream_sample_t * sample = tmp; break; case TYPE_8LOW: - sample = (INT16)(tmp << 8); + sample = (int16_t)(tmp << 8); break; case TYPE_8HIGH: - sample = (INT16)(tmp & 0xFF00); + sample = (int16_t)(tmp & 0xFF00); break; default: sample = 0; @@ -217,7 +217,7 @@ void rf5c400_device::sound_stream_update(sound_stream &stream, stream_sample_t * /*****************************************************************************/ -UINT8 rf5c400_device::decode80(UINT8 val) +uint8_t rf5c400_device::decode80(uint8_t val) { if (val & 0x80) { @@ -235,7 +235,7 @@ void rf5c400_device::rf5c400_init_chip() { double max=255.0; for (i = 0; i < 256; i++) { - volume_table[i]=(UINT16)max; + volume_table[i]=(uint16_t)max; max /= pow(10.0,(double)((4.5/(256.0/16.0))/20)); } for(i = 0; i < 0x48; i++) { @@ -340,7 +340,7 @@ void rf5c400_device::rf5c400_init_chip() /*****************************************************************************/ -static UINT16 rf5c400_status = 0; +static uint16_t rf5c400_status = 0; READ16_MEMBER( rf5c400_device::rf5c400_r ) { switch(offset) @@ -427,7 +427,7 @@ WRITE16_MEMBER( rf5c400_device::rf5c400_w ) case 0x12: // memory r/w address, bits 23 - 16 { m_ext_mem_address &= 0xffff; - m_ext_mem_address |= (UINT32)(data) << 16; + m_ext_mem_address |= (uint32_t)(data) << 16; break; } case 0x13: // memory write data diff --git a/src/devices/sound/rf5c400.h b/src/devices/sound/rf5c400.h index bc30301d9cd..5ec45d35baf 100644 --- a/src/devices/sound/rf5c400.h +++ b/src/devices/sound/rf5c400.h @@ -46,27 +46,27 @@ struct rf5c400_channel env_scale(0.0) { } - UINT16 startH; - UINT16 startL; - UINT16 freq; - UINT16 endL; - UINT16 endHloopH; - UINT16 loopL; - UINT16 pan; - UINT16 effect; - UINT16 volume; - - UINT16 attack; - UINT16 decay; - UINT16 release; - - UINT16 cutoff; - - UINT64 pos; - UINT64 step; - UINT16 keyon; - - UINT8 env_phase; + uint16_t startH; + uint16_t startL; + uint16_t freq; + uint16_t endL; + uint16_t endHloopH; + uint16_t loopL; + uint16_t pan; + uint16_t effect; + uint16_t volume; + + uint16_t attack; + uint16_t decay; + uint16_t release; + + uint16_t cutoff; + + uint64_t pos; + uint64_t step; + uint16_t keyon; + + uint8_t env_phase; double env_level; double env_step; double env_scale; @@ -79,7 +79,7 @@ class rf5c400_device : public device_t, public device_sound_interface { public: - rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~rf5c400_device() { } protected: @@ -95,12 +95,12 @@ public: private: void rf5c400_init_chip(); - UINT8 decode80(UINT8 val); + uint8_t decode80(uint8_t val); private: - required_region_ptr m_rom; + required_region_ptr m_rom; - UINT32 m_rommask; + uint32_t m_rommask; sound_stream *m_stream; @@ -110,8 +110,8 @@ private: rf5c400_channel m_channels[32]; - UINT32 m_ext_mem_address; - UINT16 m_ext_mem_data; + uint32_t m_ext_mem_address; + uint16_t m_ext_mem_data; }; extern const device_type RF5C400; diff --git a/src/devices/sound/rf5c68.cpp b/src/devices/sound/rf5c68.cpp index 8b5273bf5c4..7faedb54398 100644 --- a/src/devices/sound/rf5c68.cpp +++ b/src/devices/sound/rf5c68.cpp @@ -20,7 +20,7 @@ const device_type RF5C68 = &device_creator; // rf5c68_device - constructor //------------------------------------------------- -rf5c68_device::rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +rf5c68_device::rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RF5C68, "RF5C68", tag, owner, clock, "rf5c68", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -28,7 +28,7 @@ rf5c68_device::rf5c68_device(const machine_config &mconfig, const char *tag, dev m_wbank(0), m_enable(0) { - memset(m_data, 0, sizeof(UINT8)*0x10000); + memset(m_data, 0, sizeof(uint8_t)*0x10000); } @@ -142,7 +142,7 @@ void rf5c68_device::sound_stream_update(sound_stream &stream, stream_sample_t ** READ8_MEMBER( rf5c68_device::rf5c68_r ) { - UINT8 shift; + uint8_t shift; m_stream->update(); shift = (offset & 1) ? 11 + 8 : 11; diff --git a/src/devices/sound/rf5c68.h b/src/devices/sound/rf5c68.h index b8ebe577e0e..f16271f1518 100644 --- a/src/devices/sound/rf5c68.h +++ b/src/devices/sound/rf5c68.h @@ -44,13 +44,13 @@ struct rf5c68_pcm_channel step(0), loopst(0) {} - UINT8 enable; - UINT8 env; - UINT8 pan; - UINT8 start; - UINT32 addr; - UINT16 step; - UINT16 loopst; + uint8_t enable; + uint8_t env; + uint8_t pan; + uint8_t start; + uint32_t addr; + uint16_t step; + uint16_t loopst; }; @@ -60,7 +60,7 @@ class rf5c68_device : public device_t, public device_sound_interface { public: - rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~rf5c68_device() { } static void set_end_callback(device_t &device, rf5c68_sample_end_cb_delegate callback) { downcast(device).m_sample_end_cb = callback; } @@ -82,10 +82,10 @@ public: private: sound_stream* m_stream; rf5c68_pcm_channel m_chan[RF5C68_NUM_CHANNELS]; - UINT8 m_cbank; - UINT8 m_wbank; - UINT8 m_enable; - UINT8 m_data[0x10000]; + uint8_t m_cbank; + uint8_t m_wbank; + uint8_t m_enable; + uint8_t m_data[0x10000]; rf5c68_sample_end_cb_delegate m_sample_end_cb; }; diff --git a/src/devices/sound/s14001a.cpp b/src/devices/sound/s14001a.cpp index 8cc27dbe261..3eea3dee24d 100644 --- a/src/devices/sound/s14001a.cpp +++ b/src/devices/sound/s14001a.cpp @@ -109,7 +109,7 @@ and off as it normally does during speech). Once START has gone low-high-low, th // device definition const device_type S14001A = &device_creator; -s14001a_device::s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s14001a_device::s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, S14001A, "S14001A", tag, owner, clock, "s14001a", __FILE__), device_sound_interface(mconfig, *this), m_SpeechRom(*this, DEVICE_SELF), @@ -190,7 +190,7 @@ void s14001a_device::sound_stream_update(sound_stream &stream, stream_sample_t * for (int i = 0; i < samples; i++) { Clock(); - INT16 sample = m_uOutputP2 - 7; // range -7..8 + int16_t sample = m_uOutputP2 - 7; // range -7..8 outputs[0][i] = sample * 0xf00; } } @@ -230,7 +230,7 @@ WRITE_LINE_MEMBER(s14001a_device::start_w) if (m_bStart) m_uStateP1 = WORDWAIT; } -void s14001a_device::set_clock(UINT32 clock) +void s14001a_device::set_clock(uint32_t clock) { m_stream->update(); m_stream->set_sample_rate(clock); @@ -241,7 +241,7 @@ void s14001a_device::set_clock(UINT32 clock) Device emulation **************************************************************************/ -UINT8 s14001a_device::readmem(UINT16 offset, bool phase) +uint8_t s14001a_device::readmem(uint16_t offset, bool phase) { offset &= 0xfff; // 11-bit internal return ((m_ext_read_handler.isnull()) ? m_SpeechRom[offset & (m_SpeechRom.bytes() - 1)] : m_ext_read_handler(offset)); @@ -387,8 +387,8 @@ bool s14001a_device::Clock() // end statistics // modify output - UINT8 uDeltaP2; // signal line - UINT8 uIncrementP2; // signal lines + uint8_t uDeltaP2; // signal line + uint8_t uIncrementP2; // signal lines bool bAddP2; // signal line uDeltaP2 = Mux8To2(m_bVoicedP2, m_uLengthP2 & 0x03, // pitch period quater counter @@ -471,7 +471,7 @@ bool s14001a_device::Clock() return true; } -UINT8 s14001a_device::Mux8To2(bool bVoicedP2, UINT8 uPPQtrP2, UINT8 uDeltaAdrP2, UINT8 uRomDataP2) +uint8_t s14001a_device::Mux8To2(bool bVoicedP2, uint8_t uPPQtrP2, uint8_t uDeltaAdrP2, uint8_t uRomDataP2) { // pick two bits of rom data as delta @@ -494,7 +494,7 @@ UINT8 s14001a_device::Mux8To2(bool bVoicedP2, UINT8 uPPQtrP2, UINT8 uDeltaAdrP2, return 0xFF; } -void s14001a_device::CalculateIncrement(bool bVoicedP2, UINT8 uPPQtrP2, bool bPPQStartP2, UINT8 uDelta, UINT8 uDeltaOldP2, UINT8 &uDeltaOldP1, UINT8 &uIncrementP2, bool &bAddP2) +void s14001a_device::CalculateIncrement(bool bVoicedP2, uint8_t uPPQtrP2, bool bPPQStartP2, uint8_t uDelta, uint8_t uDeltaOldP2, uint8_t &uDeltaOldP1, uint8_t &uIncrementP2, bool &bAddP2) { // uPPQtr, pitch period quarter counter; 2 lsb of uLength // bPPStart, start of a pitch period @@ -505,7 +505,7 @@ void s14001a_device::CalculateIncrement(bool bVoicedP2, UINT8 uPPQtrP2, bool bPP { uDeltaOldP2 = 0x02; } - static const UINT8 uIncrements[4][4] = + static const uint8_t uIncrements[4][4] = { // 00 01 10 11 { 3, 3, 1, 1,}, // 00 @@ -532,11 +532,11 @@ void s14001a_device::CalculateIncrement(bool bVoicedP2, UINT8 uPPQtrP2, bool bPP if (bVoicedP2 && bPPQStartP2 && MIRROR) uIncrementP2 = 0; // no change when first starting mirroring } -UINT8 s14001a_device::CalculateOutput(bool bVoiced, bool bXSilence, UINT8 uPPQtr, bool bPPQStart, UINT8 uLOutput, UINT8 uIncrementP2, bool bAddP2) +uint8_t s14001a_device::CalculateOutput(bool bVoiced, bool bXSilence, uint8_t uPPQtr, bool bPPQStart, uint8_t uLOutput, uint8_t uIncrementP2, bool bAddP2) { // implemented to mimic silicon (a bit) // limits output to 0x00 and 0x0f - UINT8 uTmp; // used for subtraction + uint8_t uTmp; // used for subtraction #define SILENCE (uPPQtr&0x02) @@ -569,7 +569,7 @@ void s14001a_device::ClearStatistics() m_uNControlWords = 0; } -void s14001a_device::GetStatistics(UINT32 &uNPitchPeriods, UINT32 &uNVoiced, UINT32 &uNControlWords) +void s14001a_device::GetStatistics(uint32_t &uNPitchPeriods, uint32_t &uNVoiced, uint32_t &uNControlWords) { uNPitchPeriods = m_uNPitchPeriods; uNVoiced = m_uNVoiced; diff --git a/src/devices/sound/s14001a.h b/src/devices/sound/s14001a.h index 46c6fd6b0cb..1b1c8e1eda9 100644 --- a/src/devices/sound/s14001a.h +++ b/src/devices/sound/s14001a.h @@ -19,7 +19,7 @@ class s14001a_device : public device_t, public device_sound_interface { public: - s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~s14001a_device() {} // static configuration helpers @@ -31,7 +31,7 @@ public: DECLARE_WRITE_LINE_MEMBER(start_w); // START (pin 10) DECLARE_WRITE8_MEMBER(data_w); // 6-bit word - void set_clock(UINT32 clock); // set new CLK frequency + void set_clock(uint32_t clock); // set new CLK frequency void force_update(); // update stream, eg. before external ROM bankswitch protected: @@ -42,22 +42,22 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; private: - required_region_ptr m_SpeechRom; + required_region_ptr m_SpeechRom; sound_stream * m_stream; devcb_write_line m_bsy_handler; devcb_read8 m_ext_read_handler; - UINT8 readmem(UINT16 offset, bool phase); + uint8_t readmem(uint16_t offset, bool phase); bool Clock(); // called once to toggle external clock twice // emulator helper functions - UINT8 Mux8To2(bool bVoicedP2, UINT8 uPPQtrP2, UINT8 uDeltaAdrP2, UINT8 uRomDataP2); - void CalculateIncrement(bool bVoicedP2, UINT8 uPPQtrP2, bool bPPQStartP2, UINT8 uDeltaP2, UINT8 uDeltaOldP2, UINT8 &uDeltaOldP1, UINT8 &uIncrementP2, bool &bAddP2); - UINT8 CalculateOutput(bool bVoicedP2, bool bXSilenceP2, UINT8 uPPQtrP2, bool bPPQStartP2, UINT8 uLOutputP2, UINT8 uIncrementP2, bool bAddP2); + uint8_t Mux8To2(bool bVoicedP2, uint8_t uPPQtrP2, uint8_t uDeltaAdrP2, uint8_t uRomDataP2); + void CalculateIncrement(bool bVoicedP2, uint8_t uPPQtrP2, bool bPPQStartP2, uint8_t uDeltaP2, uint8_t uDeltaOldP2, uint8_t &uDeltaOldP1, uint8_t &uIncrementP2, bool &bAddP2); + uint8_t CalculateOutput(bool bVoicedP2, bool bXSilenceP2, uint8_t uPPQtrP2, bool bPPQStartP2, uint8_t uLOutputP2, uint8_t uIncrementP2, bool bAddP2); void ClearStatistics(); - void GetStatistics(UINT32 &uNPitchPeriods, UINT32 &uNVoiced, UINT32 &uNControlWords); - void SetPrintLevel(UINT32 uPrintLevel) { m_uPrintLevel = uPrintLevel; } + void GetStatistics(uint32_t &uNPitchPeriods, uint32_t &uNVoiced, uint32_t &uNControlWords); + void SetPrintLevel(uint32_t uPrintLevel) { m_uPrintLevel = uPrintLevel; } // internal state bool m_bPhase1; // 1 bit internal clock @@ -78,15 +78,15 @@ private: states m_uStateP1; // 3 bits states m_uStateP2; - UINT16 m_uDAR13To05P1; // 9 MSBs of delta address register - UINT16 m_uDAR13To05P2; // incrementing uDAR05To13 advances ROM address by 8 bytes + uint16_t m_uDAR13To05P1; // 9 MSBs of delta address register + uint16_t m_uDAR13To05P2; // incrementing uDAR05To13 advances ROM address by 8 bytes - UINT16 m_uDAR04To00P1; // 5 LSBs of delta address register - UINT16 m_uDAR04To00P2; // 3 address ROM, 2 mux 8 bits of data into 2 bit delta + uint16_t m_uDAR04To00P1; // 5 LSBs of delta address register + uint16_t m_uDAR04To00P2; // 3 address ROM, 2 mux 8 bits of data into 2 bit delta // carry indicates end of quarter pitch period (32 cycles) - UINT16 m_uCWARP1; // 12 bits Control Word Address Register (syllable) - UINT16 m_uCWARP2; + uint16_t m_uCWARP1; // 12 bits Control Word Address Register (syllable) + uint16_t m_uCWARP2; bool m_bStopP1; bool m_bStopP2; @@ -94,42 +94,42 @@ private: bool m_bVoicedP2; bool m_bSilenceP1; bool m_bSilenceP2; - UINT8 m_uLengthP1; // 7 bits, upper three loaded from ROM length - UINT8 m_uLengthP2; // middle two loaded from ROM repeat and/or uXRepeat + uint8_t m_uLengthP1; // 7 bits, upper three loaded from ROM length + uint8_t m_uLengthP2; // middle two loaded from ROM repeat and/or uXRepeat // bit 0 indicates mirror in voiced mode // bit 1 indicates internal silence in voiced mode // incremented each pitch period quarter - UINT8 m_uXRepeatP1; // 2 bits, loaded from ROM repeat - UINT8 m_uXRepeatP2; - UINT8 m_uDeltaOldP1; // 2 bit old delta - UINT8 m_uDeltaOldP2; - UINT8 m_uOutputP1; // 4 bits audio output, calculated during phase 1 + uint8_t m_uXRepeatP1; // 2 bits, loaded from ROM repeat + uint8_t m_uXRepeatP2; + uint8_t m_uDeltaOldP1; // 2 bit old delta + uint8_t m_uDeltaOldP2; + uint8_t m_uOutputP1; // 4 bits audio output, calculated during phase 1 // derived signals bool m_bDAR04To00CarryP2; bool m_bPPQCarryP2; bool m_bRepeatCarryP2; bool m_bLengthCarryP2; - UINT16 m_RomAddrP1; // rom address + uint16_t m_RomAddrP1; // rom address // output pins - UINT8 m_uOutputP2; // output changes on phase2 - UINT16 m_uRomAddrP2; // address pins change on phase 2 + uint8_t m_uOutputP2; // output changes on phase2 + uint16_t m_uRomAddrP2; // address pins change on phase 2 bool m_bBusyP1; // busy changes on phase 1 // input pins bool m_bStart; - UINT8 m_uWord; // 6 bit word noumber to be spoken + uint8_t m_uWord; // 6 bit word noumber to be spoken // emulator variables // statistics - UINT32 m_uNPitchPeriods; - UINT32 m_uNVoiced; - UINT32 m_uNControlWords; + uint32_t m_uNPitchPeriods; + uint32_t m_uNVoiced; + uint32_t m_uNControlWords; // diagnostic output - UINT32 m_uPrintLevel; + uint32_t m_uPrintLevel; }; extern const device_type S14001A; diff --git a/src/devices/sound/saa1099.cpp b/src/devices/sound/saa1099.cpp index 22ec858a36c..4ea28c6adcf 100644 --- a/src/devices/sound/saa1099.cpp +++ b/src/devices/sound/saa1099.cpp @@ -78,7 +78,7 @@ static const int amplitude_lookup[16] = { 12*32767/16, 13*32767/16, 14*32767/16, 15*32767/16 }; -static const UINT8 envelope[8][64] = { +static const uint8_t envelope[8][64] = { /* zero amplitude */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -133,7 +133,7 @@ const device_type SAA1099 = &device_creator; // saa1099_device - constructor //------------------------------------------------- -saa1099_device::saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saa1099_device::saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SAA1099, "SAA1099", tag, owner, clock, "saa1099", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), diff --git a/src/devices/sound/saa1099.h b/src/devices/sound/saa1099.h index b2c67e66edd..b14e7142440 100644 --- a/src/devices/sound/saa1099.h +++ b/src/devices/sound/saa1099.h @@ -71,7 +71,7 @@ class saa1099_device : public device_t, public device_sound_interface { public: - saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~saa1099_device() { } protected: diff --git a/src/devices/sound/samples.cpp b/src/devices/sound/samples.cpp index 44627261377..1d0c3c8c179 100644 --- a/src/devices/sound/samples.cpp +++ b/src/devices/sound/samples.cpp @@ -45,7 +45,7 @@ const device_type SAMPLES = &device_creator; // samples_device - constructors //------------------------------------------------- -samples_device::samples_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +samples_device::samples_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SAMPLES, "Samples", tag, owner, clock, "samples", __FILE__), device_sound_interface(mconfig, *this), m_channels(0), @@ -53,7 +53,7 @@ samples_device::samples_device(const machine_config &mconfig, const char *tag, d { } -samples_device::samples_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) +samples_device::samples_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_sound_interface(mconfig, *this), m_channels(0), @@ -70,7 +70,7 @@ samples_device::samples_device(const machine_config &mconfig, device_type type, // start - start playing a loaded sample //------------------------------------------------- -void samples_device::start(UINT8 channel, UINT32 samplenum, bool loop) +void samples_device::start(uint8_t channel, uint32_t samplenum, bool loop) { // if samples are disabled, just return quietly if (m_sample.empty()) @@ -91,7 +91,7 @@ void samples_device::start(UINT8 channel, UINT32 samplenum, bool loop) chan.pos = 0; chan.frac = 0; chan.basefreq = sample.frequency; - chan.step = (INT64(chan.basefreq) << FRAC_BITS) / machine().sample_rate(); + chan.step = (int64_t(chan.basefreq) << FRAC_BITS) / machine().sample_rate(); chan.loop = loop; } @@ -101,7 +101,7 @@ void samples_device::start(UINT8 channel, UINT32 samplenum, bool loop) // provided sample //------------------------------------------------- -void samples_device::start_raw(UINT8 channel, const INT16 *sampledata, UINT32 samples, UINT32 frequency, bool loop) +void samples_device::start_raw(uint8_t channel, const int16_t *sampledata, uint32_t samples, uint32_t frequency, bool loop) { assert(channel < m_channels); @@ -116,7 +116,7 @@ void samples_device::start_raw(UINT8 channel, const INT16 *sampledata, UINT32 sa chan.pos = 0; chan.frac = 0; chan.basefreq = frequency; - chan.step = (INT64(chan.basefreq) << FRAC_BITS) / machine().sample_rate(); + chan.step = (int64_t(chan.basefreq) << FRAC_BITS) / machine().sample_rate(); chan.loop = loop; } @@ -126,14 +126,14 @@ void samples_device::start_raw(UINT8 channel, const INT16 *sampledata, UINT32 sa // a sample //------------------------------------------------- -void samples_device::set_frequency(UINT8 channel, UINT32 freq) +void samples_device::set_frequency(uint8_t channel, uint32_t freq) { assert(channel < m_channels); // force an update before we start channel_t &chan = m_channel[channel]; chan.stream->update(); - chan.step = (INT64(freq) << FRAC_BITS) / machine().sample_rate(); + chan.step = (int64_t(freq) << FRAC_BITS) / machine().sample_rate(); } @@ -142,7 +142,7 @@ void samples_device::set_frequency(UINT8 channel, UINT32 freq) // sample //------------------------------------------------- -void samples_device::set_volume(UINT8 channel, float volume) +void samples_device::set_volume(uint8_t channel, float volume) { assert(channel < m_channels); @@ -156,7 +156,7 @@ void samples_device::set_volume(UINT8 channel, float volume) // pause - pause playback on a channel //------------------------------------------------- -void samples_device::pause(UINT8 channel, bool pause) +void samples_device::pause(uint8_t channel, bool pause) { assert(channel < m_channels); @@ -170,7 +170,7 @@ void samples_device::pause(UINT8 channel, bool pause) // stop - stop playback on a channel //------------------------------------------------- -void samples_device::stop(UINT8 channel) +void samples_device::stop(uint8_t channel) { assert(channel < m_channels); @@ -188,7 +188,7 @@ void samples_device::stop(UINT8 channel) void samples_device::stop_all() { // just iterate over channels and stop them - for (UINT8 channel = 0; channel < m_channels; channel++) + for (uint8_t channel = 0; channel < m_channels; channel++) stop(channel); } @@ -198,7 +198,7 @@ void samples_device::stop_all() // a channel being played //------------------------------------------------- -UINT32 samples_device::base_frequency(UINT8 channel) const +uint32_t samples_device::base_frequency(uint8_t channel) const { assert(channel < m_channels); @@ -214,7 +214,7 @@ UINT32 samples_device::base_frequency(UINT8 channel) const // playing on the given channel //------------------------------------------------- -bool samples_device::playing(UINT8 channel) const +bool samples_device::playing(uint8_t channel) const { assert(channel < m_channels); @@ -333,18 +333,18 @@ void samples_device::sound_stream_update(sound_stream &stream, stream_sample_t * if (chan.source != nullptr && !chan.paused) { // load some info locally - UINT32 pos = chan.pos; - UINT32 frac = chan.frac; - UINT32 step = chan.step; - const INT16 *sample = chan.source; - UINT32 sample_length = chan.source_length; + uint32_t pos = chan.pos; + uint32_t frac = chan.frac; + uint32_t step = chan.step; + const int16_t *sample = chan.source; + uint32_t sample_length = chan.source_length; while (samples--) { // do a linear interp on the sample - INT32 sample1 = sample[pos]; - INT32 sample2 = sample[(pos + 1) % sample_length]; - INT32 fracmult = frac >> (FRAC_BITS - 14); + int32_t sample1 = sample[pos]; + int32_t sample2 = sample[(pos + 1) % sample_length]; + int32_t fracmult = frac >> (FRAC_BITS - 14); *buffer++ = ((0x4000 - fracmult) * sample1 + fracmult * sample2) >> 14; // advance @@ -392,8 +392,8 @@ void samples_device::sound_stream_update(sound_stream &stream, stream_sample_t * bool samples_device::read_sample(emu_file &file, sample_t &sample) { // read the core header and make sure it's a proper file - UINT8 buf[4]; - UINT32 offset = file.read(buf, 4); + uint8_t buf[4]; + uint32_t offset = file.read(buf, 4); if (offset < 4) { osd_printf_warning("Unable to read %s, 0-byte file?\n", file.filename()); @@ -419,10 +419,10 @@ bool samples_device::read_sample(emu_file &file, sample_t &sample) bool samples_device::read_wav_sample(emu_file &file, sample_t &sample) { // we already read the opening 'RIFF' tag - UINT32 offset = 4; + uint32_t offset = 4; // get the total size - UINT32 filesize; + uint32_t filesize; offset += file.read(&filesize, 4); if (offset < 8) { @@ -446,7 +446,7 @@ bool samples_device::read_wav_sample(emu_file &file, sample_t &sample) } // seek until we find a format tag - UINT32 length; + uint32_t length; while (1) { offset += file.read(buf, 4); @@ -466,7 +466,7 @@ bool samples_device::read_wav_sample(emu_file &file, sample_t &sample) } // read the format -- make sure it is PCM - UINT16 temp16; + uint16_t temp16; offset += file.read(&temp16, 2); temp16 = little_endianize_int16(temp16); if (temp16 != 1) @@ -485,7 +485,7 @@ bool samples_device::read_wav_sample(emu_file &file, sample_t &sample) } // sample rate - UINT32 rate; + uint32_t rate; offset += file.read(&rate, 4); rate = little_endianize_int32(rate); @@ -493,7 +493,7 @@ bool samples_device::read_wav_sample(emu_file &file, sample_t &sample) offset += file.read(buf, 6); // bits/sample - UINT16 bits; + uint16_t bits; offset += file.read(&bits, 2); bits = little_endianize_int16(bits); if (bits != 8 && bits != 16) @@ -542,9 +542,9 @@ bool samples_device::read_wav_sample(emu_file &file, sample_t &sample) file.read(&sample.data[0], length); // convert 8-bit data to signed samples - UINT8 *tempptr = reinterpret_cast(&sample.data[0]); - for (INT32 sindex = length - 1; sindex >= 0; sindex--) - sample.data[sindex] = INT8(tempptr[sindex] ^ 0x80) * 256; + uint8_t *tempptr = reinterpret_cast(&sample.data[0]); + for (int32_t sindex = length - 1; sindex >= 0; sindex--) + sample.data[sindex] = int8_t(tempptr[sindex] ^ 0x80) * 256; } else { @@ -554,7 +554,7 @@ bool samples_device::read_wav_sample(emu_file &file, sample_t &sample) // swap high/low on big-endian systems if (ENDIANNESS_NATIVE != ENDIANNESS_LITTLE) - for (UINT32 sindex = 0; sindex < length / 2; sindex++) + for (uint32_t sindex = 0; sindex < length / 2; sindex++) sample.data[sindex] = little_endianize_int16(sample.data[sindex]); } return true; diff --git a/src/devices/sound/samples.h b/src/devices/sound/samples.h index f1512853a6a..288d46f4d51 100644 --- a/src/devices/sound/samples.h +++ b/src/devices/sound/samples.h @@ -42,27 +42,27 @@ class samples_device : public device_t, { public: // construction/destruction - samples_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + samples_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - static void static_set_channels(device_t &device, UINT8 channels) { downcast(device).m_channels = channels; } + static void static_set_channels(device_t &device, uint8_t channels) { downcast(device).m_channels = channels; } static void static_set_samples_names(device_t &device, const char *const *names) { downcast(device).m_names = names; } static void set_samples_start_callback(device_t &device, samples_start_cb_delegate callback) { downcast(device).m_samples_start_cb = callback; } // getters - bool playing(UINT8 channel) const; - UINT32 base_frequency(UINT8 channel) const; + bool playing(uint8_t channel) const; + uint32_t base_frequency(uint8_t channel) const; // start/stop helpers - void start(UINT8 channel, UINT32 samplenum, bool loop = false); - void start_raw(UINT8 channel, const INT16 *sampledata, UINT32 samples, UINT32 frequency, bool loop = false); - void pause(UINT8 channel, bool pause = true); - void stop(UINT8 channel); + void start(uint8_t channel, uint32_t samplenum, bool loop = false); + void start_raw(uint8_t channel, const int16_t *sampledata, uint32_t samples, uint32_t frequency, bool loop = false); + void pause(uint8_t channel, bool pause = true); + void stop(uint8_t channel); void stop_all(); // dynamic control - void set_frequency(UINT8 channel, UINT32 frequency); - void set_volume(UINT8 channel, float volume); + void set_frequency(uint8_t channel, uint32_t frequency); + void set_volume(uint8_t channel, float volume); // helpers struct sample_t @@ -70,19 +70,19 @@ public: // shouldn't need a copy, but in case it happens, catch it here sample_t &operator=(const sample_t &rhs) { assert(false); return *this; } - UINT32 frequency; // frequency of the sample - std::vector data; // 16-bit signed data + uint32_t frequency; // frequency of the sample + std::vector data; // 16-bit signed data }; static bool read_sample(emu_file &file, sample_t &sample); // interface - UINT8 m_channels; // number of discrete audio channels needed + uint8_t m_channels; // number of discrete audio channels needed const char *const *m_names; // array of sample names samples_start_cb_delegate m_samples_start_cb; // optional callback protected: // subclasses can do it this way - samples_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); + samples_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-level overrides virtual void device_start() override; @@ -96,13 +96,13 @@ protected: struct channel_t { sound_stream * stream; - const INT16 * source; - INT32 source_length; - INT32 source_num; - UINT32 pos; - UINT32 frac; - UINT32 step; - UINT32 basefreq; + const int16_t * source; + int32_t source_length; + int32_t source_num; + uint32_t pos; + uint32_t frac; + uint32_t step; + uint32_t basefreq; bool loop; bool paused; }; @@ -117,9 +117,9 @@ protected: std::vector m_sample; // internal constants - static const UINT8 FRAC_BITS = 24; - static const UINT32 FRAC_ONE = 1 << FRAC_BITS; - static const UINT32 FRAC_MASK = FRAC_ONE - 1; + static const uint8_t FRAC_BITS = 24; + static const uint32_t FRAC_ONE = 1 << FRAC_BITS; + static const uint32_t FRAC_MASK = FRAC_ONE - 1; }; // iterator, since lots of people are interested in these devices diff --git a/src/devices/sound/sb0400.cpp b/src/devices/sound/sb0400.cpp index 343cb6aecaa..43aff7dc9b3 100644 --- a/src/devices/sound/sb0400.cpp +++ b/src/devices/sound/sb0400.cpp @@ -7,7 +7,7 @@ const device_type SB0400 = &device_creator; DEVICE_ADDRESS_MAP_START(map, 32, sb0400_device) ADDRESS_MAP_END -sb0400_device::sb0400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sb0400_device::sb0400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, SB0400, "Creative Labs SB0400 Audigy2 Value", tag, owner, clock, "sb0400", __FILE__) { } diff --git a/src/devices/sound/sb0400.h b/src/devices/sound/sb0400.h index a83ce69dbd8..cf4c899b9ee 100644 --- a/src/devices/sound/sb0400.h +++ b/src/devices/sound/sb0400.h @@ -12,7 +12,7 @@ class sb0400_device : public pci_device { public: - sb0400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sb0400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/sound/scsp.cpp b/src/devices/sound/scsp.cpp index 4f5311def8e..faf02ccf6a1 100644 --- a/src/devices/sound/scsp.cpp +++ b/src/devices/sound/scsp.cpp @@ -39,7 +39,7 @@ #define SHIFT 12 #define LFO_SHIFT 8 -#define FIX(v) ((UINT32) ((float) (1<; -scsp_device::scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scsp_device::scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SCSP, "SCSP", tag, owner, clock, "scsp", __FILE__), device_sound_interface(mconfig, *this), m_roffset(0), @@ -241,8 +241,8 @@ unsigned char scsp_device::DecodeSCI(unsigned char irq) void scsp_device::CheckPendingIRQ() { - UINT32 pend=m_udata.data[0x20/2]; - UINT32 en=m_udata.data[0x1e/2]; + uint32_t pend=m_udata.data[0x20/2]; + uint32_t en=m_udata.data[0x1e/2]; if(m_MidiW!=m_MidiR) { m_udata.data[0x20/2] |= 8; @@ -279,7 +279,7 @@ void scsp_device::CheckPendingIRQ() m_irq_cb((offs_t)0, CLEAR_LINE); } -void scsp_device::MainCheckPendingIRQ(UINT16 irq_type) +void scsp_device::MainCheckPendingIRQ(uint16_t irq_type) { m_mcipd |= irq_type; @@ -293,7 +293,7 @@ void scsp_device::MainCheckPendingIRQ(UINT16 irq_type) void scsp_device::ResetInterrupts() { - UINT32 reset = m_udata.data[0x22/2]; + uint32_t reset = m_udata.data[0x22/2]; if (reset & 0x40) { @@ -434,10 +434,10 @@ int scsp_device::EG_Update(SCSP_SLOT *slot) return (slot->EG.volume>>EG_SHIFT)<<(SHIFT-10); } -UINT32 scsp_device::Step(SCSP_SLOT *slot) +uint32_t scsp_device::Step(SCSP_SLOT *slot) { int octave=(OCT(slot)^8)-8+SHIFT-10; - UINT32 Fn=FNS(slot)+(1 << 10); + uint32_t Fn=FNS(slot)+(1 << 10); if (octave >= 0) { Fn<<=octave; @@ -461,7 +461,7 @@ void scsp_device::Compute_LFO(SCSP_SLOT *slot) void scsp_device::StartSlot(SCSP_SLOT *slot) { - UINT32 start_offset; + uint32_t start_offset; slot->active=1; start_offset = PCM8B(slot) ? SA(slot) : SA(slot) & 0x7FFFE; @@ -522,7 +522,7 @@ void scsp_device::init() { m_SCSPRAM = ram_region->base(); m_SCSPRAM_LENGTH = ram_region->bytes(); - m_DSP.SCSPRAM = (UINT16 *)m_SCSPRAM; + m_DSP.SCSPRAM = (uint16_t *)m_SCSPRAM; m_DSP.SCSPRAM_LENGTH = m_SCSPRAM_LENGTH / 2; m_SCSPRAM += m_roffset; } @@ -535,7 +535,7 @@ void scsp_device::init() { float envDB=((float)(3*(i-0x3ff)))/32.0f; float scale=(float)(1<(44100); - m_buffertmpr=make_unique_clear(44100); + m_buffertmpl=make_unique_clear(44100); + m_buffertmpr=make_unique_clear(44100); // no "pend" m_udata.data[0x20/2] = 0; @@ -726,7 +726,7 @@ void scsp_device::UpdateReg(address_space &space, int reg) case 0x19: if(m_Master) { - UINT32 time; + uint32_t time; m_TimPris[0]=1<<((m_udata.data[0x18/2]>>8)&0x7); m_TimCnt[0]=(m_udata.data[0x18/2]&0xff)<<8; @@ -745,7 +745,7 @@ void scsp_device::UpdateReg(address_space &space, int reg) case 0x1b: if(m_Master) { - UINT32 time; + uint32_t time; m_TimPris[1]=1<<((m_udata.data[0x1A/2]>>8)&0x7); m_TimCnt[1]=(m_udata.data[0x1A/2]&0xff)<<8; @@ -764,7 +764,7 @@ void scsp_device::UpdateReg(address_space &space, int reg) case 0x1D: if(m_Master) { - UINT32 time; + uint32_t time; m_TimPris[2]=1<<((m_udata.data[0x1C/2]>>8)&0x7); m_TimCnt[2]=(m_udata.data[0x1C/2]&0xff)<<8; @@ -1066,13 +1066,13 @@ unsigned short scsp_device::r16(address_space &space, unsigned int addr) #define REVSIGN(v) ((~v)+1) -inline INT32 scsp_device::UpdateSlot(SCSP_SLOT *slot) +inline int32_t scsp_device::UpdateSlot(SCSP_SLOT *slot) { - INT32 sample; + int32_t sample; int step=slot->step; - UINT32 addr1,addr2,addr_select; // current and next sample addresses - UINT32 *addr[2] = {&addr1, &addr2}; // used for linear interpolation - UINT32 *slot_addr[2] = {&(slot->cur_addr), &(slot->nxt_addr)}; // + uint32_t addr1,addr2,addr_select; // current and next sample addresses + uint32_t *addr[2] = {&addr1, &addr2}; // used for linear interpolation + uint32_t *slot_addr[2] = {&(slot->cur_addr), &(slot->nxt_addr)}; // if(SSCTL(slot)!=0) //no FM or noise yet return 0; @@ -1096,7 +1096,7 @@ inline INT32 scsp_device::UpdateSlot(SCSP_SLOT *slot) if(MDL(slot)!=0 || MDXSL(slot)!=0 || MDYSL(slot)!=0) { - INT32 smp=(m_RINGBUF[(m_BUFPTR+MDXSL(slot))&63]+m_RINGBUF[(m_BUFPTR+MDYSL(slot))&63])/2; + int32_t smp=(m_RINGBUF[(m_BUFPTR+MDXSL(slot))&63]+m_RINGBUF[(m_BUFPTR+MDYSL(slot))&63])/2; smp<<=0xA; // associate cycle with 1024 smp>>=0x1A-MDL(slot); // ex. for MDL=0xF, sample range corresponds to +/- 64 pi (32=2^5 cycles) so shift by 11 (16-5 == 0x1A-0xF) @@ -1107,20 +1107,20 @@ inline INT32 scsp_device::UpdateSlot(SCSP_SLOT *slot) if(PCM8B(slot)) //8 bit signed { - INT8 *p1=(signed char *) (m_SCSPRAM+BYTE_XOR_BE(((SA(slot)+addr1))&0x7FFFF)); - INT8 *p2=(signed char *) (m_SCSPRAM+BYTE_XOR_BE(((SA(slot)+addr2))&0x7FFFF)); + int8_t *p1=(signed char *) (m_SCSPRAM+BYTE_XOR_BE(((SA(slot)+addr1))&0x7FFFF)); + int8_t *p2=(signed char *) (m_SCSPRAM+BYTE_XOR_BE(((SA(slot)+addr2))&0x7FFFF)); //sample=(p[0])<<8; - INT32 s; - INT32 fpart=slot->cur_addr&((1<cur_addr&((1<>SHIFT); } else //16 bit signed (endianness?) { - INT16 *p1=(signed short *) (m_SCSPRAM+((SA(slot)+addr1)&0x7FFFE)); - INT16 *p2=(signed short *) (m_SCSPRAM+((SA(slot)+addr2)&0x7FFFE)); - INT32 s; - INT32 fpart=slot->cur_addr&((1<cur_addr&((1<>SHIFT); } @@ -1128,7 +1128,7 @@ inline INT32 scsp_device::UpdateSlot(SCSP_SLOT *slot) if(SBCTL(slot)&0x1) sample ^= 0x7FFF; if(SBCTL(slot)&0x2) - sample = (INT16)(sample^0x8000); + sample = (int16_t)(sample^0x8000); if(slot->Backwards) slot->cur_addr-=step; @@ -1147,7 +1147,7 @@ inline INT32 scsp_device::UpdateSlot(SCSP_SLOT *slot) for (addr_select=0;addr_select<2;addr_select++) { - INT32 rem_addr; + int32_t rem_addr; switch(LPCTL(slot)) { case 0: //no loop @@ -1235,7 +1235,7 @@ void scsp_device::DoMasterSamples(int nsamples) for(s=0;s>8; @@ -1352,7 +1352,7 @@ void scsp_device::exec_dma(address_space &space) { for(i=0;i < m_dma.dtlg;i+=2) { - UINT16 tmp; + uint16_t tmp; tmp = m_SCSPRAM[m_dma.dmea]; tmp|= m_SCSPRAM[m_dma.dmea+1]<<8; w16(space, m_dma.drga, tmp); @@ -1391,7 +1391,7 @@ int IRQCB(void *param) void scsp_device::set_ram_base(void *base) { m_SCSPRAM = (unsigned char *)base; - m_DSP.SCSPRAM = (UINT16 *)base; + m_DSP.SCSPRAM = (uint16_t *)base; m_SCSPRAM_LENGTH = 0x80000; m_DSP.SCSPRAM_LENGTH = 0x80000/2; } @@ -1405,7 +1405,7 @@ READ16_MEMBER( scsp_device::read ) WRITE16_MEMBER( scsp_device::write ) { - UINT16 tmp; + uint16_t tmp; m_stream->update(); @@ -1546,7 +1546,7 @@ signed int scsp_device::ALFO_Step(SCSP_LFO_t *LFO) return p<<(SHIFT-LFO_SHIFT); } -void scsp_device::LFO_ComputeStep(SCSP_LFO_t *LFO,UINT32 LFOF,UINT32 LFOWS,UINT32 LFOS,int ALFO) +void scsp_device::LFO_ComputeStep(SCSP_LFO_t *LFO,uint32_t LFOF,uint32_t LFOWS,uint32_t LFOS,int ALFO) { float step=(float) LFOFreq[LFOF]*256.0f/(float)44100; LFO->phase_step=(unsigned int) ((float) (1<(device).m_roffset = roffset; } template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } @@ -107,34 +107,34 @@ private: union { - UINT16 data[0x30/2]; - UINT8 datab[0x30]; + uint16_t data[0x30/2]; + uint8_t datab[0x30]; } m_udata; SCSP_SLOT m_Slots[32]; - INT16 m_RINGBUF[128]; - UINT8 m_BUFPTR; + int16_t m_RINGBUF[128]; + uint8_t m_BUFPTR; #if FM_DELAY - INT16 m_DELAYBUF[FM_DELAY]; - UINT8 m_DELAYPTR; + int16_t m_DELAYBUF[FM_DELAY]; + uint8_t m_DELAYPTR; #endif - UINT8 *m_SCSPRAM; - UINT32 m_SCSPRAM_LENGTH; + uint8_t *m_SCSPRAM; + uint32_t m_SCSPRAM_LENGTH; char m_Master; sound_stream * m_stream; - std::unique_ptr m_buffertmpl; - std::unique_ptr m_buffertmpr; + std::unique_ptr m_buffertmpl; + std::unique_ptr m_buffertmpr; - UINT32 m_IrqTimA; - UINT32 m_IrqTimBC; - UINT32 m_IrqMidi; + uint32_t m_IrqTimA; + uint32_t m_IrqTimBC; + uint32_t m_IrqMidi; - UINT8 m_MidiOutW, m_MidiOutR; - UINT8 m_MidiStack[32]; - UINT8 m_MidiW, m_MidiR; + uint8_t m_MidiOutW, m_MidiOutR; + uint8_t m_MidiStack[32]; + uint8_t m_MidiW, m_MidiR; - INT32 m_EG_TABLE[0x400]; + int32_t m_EG_TABLE[0x400]; int m_LPANTABLE[0x10000]; int m_RPANTABLE[0x10000]; @@ -148,15 +148,15 @@ private: // DMA stuff struct { - UINT32 dmea; - UINT16 drga; - UINT16 dtlg; - UINT8 dgate; - UINT8 ddir; + uint32_t dmea; + uint16_t drga; + uint16_t dtlg; + uint8_t dgate; + uint8_t ddir; } m_dma; - UINT16 m_mcieb; - UINT16 m_mcipd; + uint16_t m_mcieb; + uint16_t m_mcipd; int m_ARTABLE[64], m_DRTABLE[64]; @@ -167,7 +167,7 @@ private: int m_length; - INT16 *m_RBUFDST; //this points to where the sample will be stored in the RingBuf + int16_t *m_RBUFDST; //this points to where the sample will be stored in the RingBuf //LFO int m_PLFO_TRI[256], m_PLFO_SQR[256], m_PLFO_SAW[256], m_PLFO_NOI[256]; @@ -176,9 +176,9 @@ private: int m_ASCALES[8][256]; void exec_dma(address_space &space); /*state DMA transfer function*/ - UINT8 DecodeSCI(UINT8 irq); + uint8_t DecodeSCI(uint8_t irq); void CheckPendingIRQ(); - void MainCheckPendingIRQ(UINT16 irq_type); + void MainCheckPendingIRQ(uint16_t irq_type); void ResetInterrupts(); TIMER_CALLBACK_MEMBER( timerA_cb ); TIMER_CALLBACK_MEMBER( timerB_cb ); @@ -188,7 +188,7 @@ private: int Get_RR(int base, int R); void Compute_EG(SCSP_SLOT *slot); int EG_Update(SCSP_SLOT *slot); - UINT32 Step(SCSP_SLOT *slot); + uint32_t Step(SCSP_SLOT *slot); void Compute_LFO(SCSP_SLOT *slot); void StartSlot(SCSP_SLOT *slot); void StopSlot(SCSP_SLOT *slot, int keyoff); @@ -197,16 +197,16 @@ private: void UpdateReg(address_space &space, int reg); void UpdateSlotRegR(int slot, int reg); void UpdateRegR(address_space &space, int reg); - void w16(address_space &space, UINT32 addr, UINT16 val); - UINT16 r16(address_space &space, UINT32 addr); - inline INT32 UpdateSlot(SCSP_SLOT *slot); + void w16(address_space &space, uint32_t addr, uint16_t val); + uint16_t r16(address_space &space, uint32_t addr); + inline int32_t UpdateSlot(SCSP_SLOT *slot); void DoMasterSamples(int nsamples); //LFO void LFO_Init(); - INT32 PLFO_Step(SCSP_LFO_t *LFO); - INT32 ALFO_Step(SCSP_LFO_t *LFO); - void LFO_ComputeStep(SCSP_LFO_t *LFO, UINT32 LFOF, UINT32 LFOWS, UINT32 LFOS, int ALFO); + int32_t PLFO_Step(SCSP_LFO_t *LFO); + int32_t ALFO_Step(SCSP_LFO_t *LFO); + void LFO_ComputeStep(SCSP_LFO_t *LFO, uint32_t LFOF, uint32_t LFOWS, uint32_t LFOS, int ALFO); }; extern const device_type SCSP; diff --git a/src/devices/sound/scspdsp.cpp b/src/devices/sound/scspdsp.cpp index 734f1a073cc..aa98600577e 100644 --- a/src/devices/sound/scspdsp.cpp +++ b/src/devices/sound/scspdsp.cpp @@ -3,9 +3,9 @@ #include "emu.h" #include "scspdsp.h" -static UINT16 PACK(INT32 val) +static uint16_t PACK(int32_t val) { - UINT32 temp; + uint32_t temp; int sign,exponent,k; sign = (val >> 23) & 0x1; @@ -27,13 +27,13 @@ static UINT16 PACK(INT32 val) val |= sign << 15; val |= exponent << 11; - return (UINT16)val; + return (uint16_t)val; } -static INT32 UNPACK(UINT16 val) +static int32_t UNPACK(uint16_t val) { int sign,exponent,mantissa; - INT32 uval; + int32_t uval; sign = (val >> 15) & 0x1; exponent = (val >> 11) & 0xF; @@ -63,17 +63,17 @@ void SCSPDSP_Init(SCSPDSP *DSP) void SCSPDSP_Step(SCSPDSP *DSP) { - INT32 ACC=0; //26 bit - INT32 SHIFTED=0; //24 bit - INT32 X; //24 bit - INT32 Y=0; //13 bit - INT32 B; //26 bit - INT32 INPUTS; //24 bit - INT32 MEMVAL=0; - INT32 FRC_REG=0; //13 bit - INT32 Y_REG=0; //24 bit - UINT32 ADDR; - UINT32 ADRS_REG=0; //13 bit + int32_t ACC=0; //26 bit + int32_t SHIFTED=0; //24 bit + int32_t X; //24 bit + int32_t Y=0; //13 bit + int32_t B; //26 bit + int32_t INPUTS; //24 bit + int32_t MEMVAL=0; + int32_t FRC_REG=0; //13 bit + int32_t Y_REG=0; //24 bit + uint32_t ADDR; + uint32_t ADRS_REG=0; //13 bit int step; if(DSP->Stopped) @@ -88,42 +88,42 @@ void SCSPDSP_Step(SCSPDSP *DSP) #endif for(step=0;stepLastStep;++step) { - UINT16 *IPtr=DSP->MPRO+step*4; + uint16_t *IPtr=DSP->MPRO+step*4; // if(IPtr[0]==0 && IPtr[1]==0 && IPtr[2]==0 && IPtr[3]==0) // break; - UINT32 TRA=(IPtr[0]>>8)&0x7F; - UINT32 TWT=(IPtr[0]>>7)&0x01; - UINT32 TWA=(IPtr[0]>>0)&0x7F; - - UINT32 XSEL=(IPtr[1]>>15)&0x01; - UINT32 YSEL=(IPtr[1]>>13)&0x03; - UINT32 IRA=(IPtr[1]>>6)&0x3F; - UINT32 IWT=(IPtr[1]>>5)&0x01; - UINT32 IWA=(IPtr[1]>>0)&0x1F; - - UINT32 TABLE=(IPtr[2]>>15)&0x01; - UINT32 MWT=(IPtr[2]>>14)&0x01; - UINT32 MRD=(IPtr[2]>>13)&0x01; - UINT32 EWT=(IPtr[2]>>12)&0x01; - UINT32 EWA=(IPtr[2]>>8)&0x0F; - UINT32 ADRL=(IPtr[2]>>7)&0x01; - UINT32 FRCL=(IPtr[2]>>6)&0x01; - UINT32 SHIFT=(IPtr[2]>>4)&0x03; - UINT32 YRL=(IPtr[2]>>3)&0x01; - UINT32 NEGB=(IPtr[2]>>2)&0x01; - UINT32 ZERO=(IPtr[2]>>1)&0x01; - UINT32 BSEL=(IPtr[2]>>0)&0x01; - - UINT32 NOFL=(IPtr[3]>>15)&1; //???? - UINT32 COEF=(IPtr[3]>>9)&0x3f; - - UINT32 MASA=(IPtr[3]>>2)&0x1f; //??? - UINT32 ADREB=(IPtr[3]>>1)&0x1; - UINT32 NXADR=(IPtr[3]>>0)&0x1; - - INT64 v; + uint32_t TRA=(IPtr[0]>>8)&0x7F; + uint32_t TWT=(IPtr[0]>>7)&0x01; + uint32_t TWA=(IPtr[0]>>0)&0x7F; + + uint32_t XSEL=(IPtr[1]>>15)&0x01; + uint32_t YSEL=(IPtr[1]>>13)&0x03; + uint32_t IRA=(IPtr[1]>>6)&0x3F; + uint32_t IWT=(IPtr[1]>>5)&0x01; + uint32_t IWA=(IPtr[1]>>0)&0x1F; + + uint32_t TABLE=(IPtr[2]>>15)&0x01; + uint32_t MWT=(IPtr[2]>>14)&0x01; + uint32_t MRD=(IPtr[2]>>13)&0x01; + uint32_t EWT=(IPtr[2]>>12)&0x01; + uint32_t EWA=(IPtr[2]>>8)&0x0F; + uint32_t ADRL=(IPtr[2]>>7)&0x01; + uint32_t FRCL=(IPtr[2]>>6)&0x01; + uint32_t SHIFT=(IPtr[2]>>4)&0x03; + uint32_t YRL=(IPtr[2]>>3)&0x01; + uint32_t NEGB=(IPtr[2]>>2)&0x01; + uint32_t ZERO=(IPtr[2]>>1)&0x01; + uint32_t BSEL=(IPtr[2]>>0)&0x01; + + uint32_t NOFL=(IPtr[3]>>15)&1; //???? + uint32_t COEF=(IPtr[3]>>9)&0x3f; + + uint32_t MASA=(IPtr[3]>>2)&0x1f; //??? + uint32_t ADREB=(IPtr[3]>>1)&0x1; + uint32_t NXADR=(IPtr[3]>>0)&0x1; + + int64_t v; //operations are done at 24 bit precision #if 0 @@ -264,7 +264,7 @@ void SCSPDSP_Step(SCSPDSP *DSP) //if(Y&0x1000) // Y|=0xFFFFF000; - v=(((INT64) X*(INT64) Y)>>12); + v=(((int64_t) X*(int64_t) Y)>>12); ACC=(int) v+B; if(TWT) @@ -331,7 +331,7 @@ void SCSPDSP_Step(SCSPDSP *DSP) // fclose(f); } -void SCSPDSP_SetSample(SCSPDSP *DSP,INT32 sample,int SEL,int MXL) +void SCSPDSP_SetSample(SCSPDSP *DSP,int32_t sample,int SEL,int MXL) { //DSP->MIXS[SEL]+=sample<<(MXL+1)/*7*/; DSP->MIXS[SEL]+=sample; @@ -345,7 +345,7 @@ void SCSPDSP_Start(SCSPDSP *DSP) DSP->Stopped=0; for(i=127;i>=0;--i) { - UINT16 *IPtr=DSP->MPRO+i*4; + uint16_t *IPtr=DSP->MPRO+i*4; if(IPtr[0]!=0 || IPtr[1]!=0 || IPtr[2]!=0 || IPtr[3]!=0) break; diff --git a/src/devices/sound/scspdsp.h b/src/devices/sound/scspdsp.h index 319b3ebe099..7b8e4eda2dc 100644 --- a/src/devices/sound/scspdsp.h +++ b/src/devices/sound/scspdsp.h @@ -9,33 +9,33 @@ struct SCSPDSP { //Config - UINT16 *SCSPRAM; - UINT32 SCSPRAM_LENGTH; - UINT32 RBP; //Ring buf pointer - UINT32 RBL; //Delay ram (Ring buffer) size in words + uint16_t *SCSPRAM; + uint32_t SCSPRAM_LENGTH; + uint32_t RBP; //Ring buf pointer + uint32_t RBL; //Delay ram (Ring buffer) size in words //context - INT16 COEF[64]; //16 bit signed - UINT16 MADRS[32]; //offsets (in words), 16 bit - UINT16 MPRO[128*4]; //128 steps 64 bit - INT32 TEMP[128]; //TEMP regs,24 bit signed - INT32 MEMS[32]; //MEMS regs,24 bit signed - UINT32 DEC; + int16_t COEF[64]; //16 bit signed + uint16_t MADRS[32]; //offsets (in words), 16 bit + uint16_t MPRO[128*4]; //128 steps 64 bit + int32_t TEMP[128]; //TEMP regs,24 bit signed + int32_t MEMS[32]; //MEMS regs,24 bit signed + uint32_t DEC; //input - INT32 MIXS[16]; //MIXS, 24 bit signed - INT16 EXTS[2]; //External inputs (CDDA) 16 bit signed + int32_t MIXS[16]; //MIXS, 24 bit signed + int16_t EXTS[2]; //External inputs (CDDA) 16 bit signed //output - INT16 EFREG[16]; //EFREG, 16 bit signed + int16_t EFREG[16]; //EFREG, 16 bit signed int Stopped; int LastStep; }; void SCSPDSP_Init(SCSPDSP *DSP); -void SCSPDSP_SetSample(SCSPDSP *DSP, INT32 sample, INT32 SEL, INT32 MXL); +void SCSPDSP_SetSample(SCSPDSP *DSP, int32_t sample, int32_t SEL, int32_t MXL); void SCSPDSP_Step(SCSPDSP *DSP); void SCSPDSP_Start(SCSPDSP *DSP); diff --git a/src/devices/sound/segapcm.cpp b/src/devices/sound/segapcm.cpp index f239d469c09..a8be5c3a351 100644 --- a/src/devices/sound/segapcm.cpp +++ b/src/devices/sound/segapcm.cpp @@ -16,7 +16,7 @@ const device_type SEGAPCM = &device_creator; // segapcm_device - constructor //------------------------------------------------- -segapcm_device::segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segapcm_device::segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGAPCM, "Sega PCM", tag, owner, clock, "segapcm", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 21), @@ -37,11 +37,11 @@ void segapcm_device::device_start() { int mask; - m_ram = std::make_unique(0x800); + m_ram = std::make_unique(0x800); memset(m_ram.get(), 0xff, 0x800); - m_bankshift = (UINT8) m_bank; + m_bankshift = (uint8_t) m_bank; mask = m_bank >> 16; if (!mask) mask = BANK_MASK7 >> 16; @@ -100,21 +100,21 @@ void segapcm_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* loop over channels */ for (int ch = 0; ch < 16; ch++) { - UINT8 *regs = m_ram.get()+8*ch; + uint8_t *regs = m_ram.get()+8*ch; /* only process active channels */ if (!(regs[0x86]&1)) { int offset = (regs[0x86] & m_bankmask) << m_bankshift; - UINT32 addr = (regs[0x85] << 16) | (regs[0x84] << 8) | m_low[ch]; - UINT32 loop = (regs[0x05] << 16) | (regs[0x04] << 8); - UINT8 end = regs[6] + 1; + uint32_t addr = (regs[0x85] << 16) | (regs[0x84] << 8) | m_low[ch]; + uint32_t loop = (regs[0x05] << 16) | (regs[0x04] << 8); + uint8_t end = regs[6] + 1; int i; /* loop over samples on this channel */ for (i = 0; i < samples; i++) { - INT8 v; + int8_t v; /* handle looping if we've hit the end */ if ((addr >> 16) == end) diff --git a/src/devices/sound/segapcm.h b/src/devices/sound/segapcm.h index 0d4d5e2ec5e..2ba7769f7d9 100644 --- a/src/devices/sound/segapcm.h +++ b/src/devices/sound/segapcm.h @@ -39,7 +39,7 @@ class segapcm_device : public device_t, public device_rom_interface { public: - segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~segapcm_device() { } // static configuration @@ -59,8 +59,8 @@ protected: virtual void rom_bank_updated() override; private: - std::unique_ptr m_ram; - UINT8 m_low[16]; + std::unique_ptr m_ram; + uint8_t m_low[16]; int m_bank; int m_bankshift; int m_bankmask; diff --git a/src/devices/sound/sid.cpp b/src/devices/sound/sid.cpp index a2a406c13d6..0f36c54e179 100644 --- a/src/devices/sound/sid.cpp +++ b/src/devices/sound/sid.cpp @@ -27,15 +27,15 @@ static float filterResTable[16]; #define maxLogicalVoices 4 static const int mix16monoMiddleIndex = 256*maxLogicalVoices/2; -static UINT16 mix16mono[256*maxLogicalVoices]; +static uint16_t mix16mono[256*maxLogicalVoices]; -static UINT16 zero16bit=0; /* either signed or unsigned */ -//UINT32 splitBufferLen; +static uint16_t zero16bit=0; /* either signed or unsigned */ +//uint32_t splitBufferLen; static void MixerInit(int threeVoiceAmplify) { long si; - UINT16 ui; + uint16_t ui; long ampDiv = maxLogicalVoices; if (threeVoiceAmplify) @@ -46,9 +46,9 @@ static void MixerInit(int threeVoiceAmplify) /* Mixing formulas are optimized by sample input value. */ si = (-128*maxLogicalVoices) * 256; - for (ui = 0; ui < sizeof(mix16mono)/sizeof(UINT16); ui++ ) + for (ui = 0; ui < sizeof(mix16mono)/sizeof(uint16_t); ui++ ) { - mix16mono[ui] = (UINT16)(si/ampDiv) + zero16bit; + mix16mono[ui] = (uint16_t)(si/ampDiv) + zero16bit; si+=256; } @@ -98,13 +98,13 @@ static inline void syncEm(SID6581_t *This) } -void sidEmuFillBuffer(SID6581_t *This, stream_sample_t *buffer, UINT32 bufferLen ) +void sidEmuFillBuffer(SID6581_t *This, stream_sample_t *buffer, uint32_t bufferLen ) { -//void* fill16bitMono( SID6581_t *This, void* buffer, UINT32 numberOfSamples ) +//void* fill16bitMono( SID6581_t *This, void* buffer, uint32_t numberOfSamples ) for ( ; bufferLen > 0; bufferLen-- ) { - *buffer++ = (INT16) mix16mono[(unsigned)(mix16monoMiddleIndex + *buffer++ = (int16_t) mix16mono[(unsigned)(mix16monoMiddleIndex +(*This->optr1.outProc)(&This->optr1) +(*This->optr2.outProc)(&This->optr2) +(This->optr3.outProc(&This->optr3)&This->optr3_outputmask) @@ -154,7 +154,7 @@ int sidEmuReset(SID6581_t *This) static void filterTableInit(running_machine &machine) { int sample_rate = machine.sample_rate(); - UINT16 uk; + uint16_t uk; /* Parameter calculation has not been moved to a separate function */ /* by purpose. */ const float filterRefFreq = 44100.0f; @@ -230,8 +230,8 @@ void sid6581_init (SID6581_t *This) - This->PCMsid = (UINT32)(This->PCMfreq * (16777216.0 / This->clock)); - This->PCMsidNoise = (UINT32)((This->clock*256.0)/This->PCMfreq); + This->PCMsid = (uint32_t)(This->PCMfreq * (16777216.0 / This->clock)); + This->PCMsidNoise = (uint32_t)((This->clock*256.0)/This->PCMfreq); This->filter.Enabled = TRUE; @@ -281,7 +281,7 @@ void sid6581_port_w (SID6581_t *This, int offset, int data) } if ( This->filter.Enabled ) { - This->filter.Value = 0x7ff & ( (This->reg[0x15]&7) | ( (UINT16)This->reg[0x16] << 3 )); + This->filter.Value = 0x7ff & ( (This->reg[0x15]&7) | ( (uint16_t)This->reg[0x16] << 3 )); if (This->filter.Type == 0x20) This->filter.Dy = bandPassParam ? bandPassParam[This->filter.Value] : 0.0f; else diff --git a/src/devices/sound/sid.h b/src/devices/sound/sid.h index 9fb8a6dc5bb..095f711bdc8 100644 --- a/src/devices/sound/sid.h +++ b/src/devices/sound/sid.h @@ -19,35 +19,35 @@ struct SID6581_t sound_stream *mixer_channel; // mame stream/ mixer channel int type; - UINT32 clock; + uint32_t clock; - UINT16 PCMfreq; // samplerate of the current systems soundcard/DAC - UINT32 PCMsid, PCMsidNoise; + uint16_t PCMfreq; // samplerate of the current systems soundcard/DAC + uint32_t PCMsid, PCMsidNoise; #if 0 /* following depends on type */ ptr2sidVoidFunc ModeNormalTable[16]; ptr2sidVoidFunc ModeRingTable[16]; // for speed reason it could be better to make them global! - UINT8* waveform30; - UINT8* waveform50; - UINT8* waveform60; - UINT8* waveform70; + uint8_t* waveform30; + uint8_t* waveform50; + uint8_t* waveform60; + uint8_t* waveform70; #endif int reg[0x20]; // bool sidKeysOn[0x20], sidKeysOff[0x20]; - UINT8 masterVolume; - UINT16 masterVolumeAmplIndex; + uint8_t masterVolume; + uint16_t masterVolumeAmplIndex; struct { int Enabled; - UINT8 Type, CurType; + uint8_t Type, CurType; float Dy, ResDy; - UINT16 Value; + uint16_t Value; } filter; sidOperator optr1, optr2, optr3; @@ -61,6 +61,6 @@ int sidEmuReset(SID6581_t *This); int sid6581_port_r (running_machine &machine, SID6581_t *This, int offset); void sid6581_port_w (SID6581_t *This, int offset, int data); -void sidEmuFillBuffer(SID6581_t *This, stream_sample_t *buffer, UINT32 bufferLen ); +void sidEmuFillBuffer(SID6581_t *This, stream_sample_t *buffer, uint32_t bufferLen ); #endif /* __SID_H__ */ diff --git a/src/devices/sound/side6581.h b/src/devices/sound/side6581.h index 9fb28ffd6d0..4870d96008c 100644 --- a/src/devices/sound/side6581.h +++ b/src/devices/sound/side6581.h @@ -15,7 +15,7 @@ // C64 C PAL, MOS 6581R4 1686 S // -static const UINT8 releaseTab[] = +static const uint8_t releaseTab[] = { 255, 255, 254, 254, 253, 253, 252, 252, 251, 251, 250, 250, 249, 249, 248, 248, 247, 247, 246, 246, 245, 245, 244, 244, 243, 243, 242, 242, 241, 241, diff --git a/src/devices/sound/sidenvel.cpp b/src/devices/sound/sidenvel.cpp index 2fa17166638..e998558bdf5 100644 --- a/src/devices/sound/sidenvel.cpp +++ b/src/devices/sound/sidenvel.cpp @@ -39,13 +39,13 @@ #include "side6581.h" #include "sidenvel.h" -const UINT8 masterVolumeLevels[16] = +const uint8_t masterVolumeLevels[16] = { 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 }; -static UINT16 masterAmplModTable[16*256]; +static uint16_t masterAmplModTable[16*256]; static const float attackTimes[16] = { @@ -79,23 +79,23 @@ static const float decayReleaseTimes[16] = static float attackRates[16]; static float decayReleaseRates[16]; #elif defined(DIRECT_FIXPOINT) - static UINT32 attackRates[16]; - static UINT32 decayReleaseRates[16]; + static uint32_t attackRates[16]; + static uint32_t decayReleaseRates[16]; #else - static UINT32 attackRates[16]; - static UINT32 attackRatesP[16]; - static UINT32 decayReleaseRates[16]; - static UINT32 decayReleaseRatesP[16]; + static uint32_t attackRates[16]; + static uint32_t attackRatesP[16]; + static uint32_t decayReleaseRates[16]; + static uint32_t decayReleaseRatesP[16]; #endif -static const UINT32 attackTabLen = 255; -static UINT32 releaseTabLen; -static UINT32 releasePos[256]; +static const uint32_t attackTabLen = 255; +static uint32_t releaseTabLen; +static uint32_t releasePos[256]; -void enveEmuInit( UINT32 updateFreq, int measuredValues ) +void enveEmuInit( uint32_t updateFreq, int measuredValues ) { - UINT32 i, j, k; + uint32_t i, j, k; releaseTabLen = sizeof(releaseTab); for ( i = 0; i < 256; i++ ) @@ -120,10 +120,10 @@ void enveEmuInit( UINT32 updateFreq, int measuredValues ) { for ( j = 0; j < 256; j++ ) { - UINT16 tmpVol = j; + uint16_t tmpVol = j; if (measuredValues) { - tmpVol = (UINT16) ((293.0*(1-exp(j/-130.0)))+4.0); + tmpVol = (uint16_t) ((293.0*(1-exp(j/-130.0)))+4.0); if (j == 0) tmpVol = 0; if (tmpVol > 255) @@ -147,24 +147,24 @@ void enveEmuInit( UINT32 updateFreq, int measuredValues ) scaledenvelen = 1; decayReleaseRates[i] = releaseTabLen / scaledenvelen; #elif defined(DIRECT_FIXPOINT) - UINT32 scaledenvelen = (UINT32)floor(( attackTimes[i] * updateFreq ) / 1000UL ); + uint32_t scaledenvelen = (uint32_t)floor(( attackTimes[i] * updateFreq ) / 1000UL ); if (scaledenvelen == 0) scaledenvelen = 1; attackRates[i] = (attackTabLen << 16) / scaledenvelen; - scaledenvelen = (UINT32)floor(( decayReleaseTimes[i] * updateFreq ) / 1000UL ); + scaledenvelen = (uint32_t)floor(( decayReleaseTimes[i] * updateFreq ) / 1000UL ); if (scaledenvelen == 0) scaledenvelen = 1; decayReleaseRates[i] = (releaseTabLen << 16) / scaledenvelen; #else - UINT32 scaledenvelen = (UINT32)(/*floor*/(( attackTimes[i] * updateFreq ) / 1000UL )); + uint32_t scaledenvelen = (uint32_t)(/*floor*/(( attackTimes[i] * updateFreq ) / 1000UL )); if (scaledenvelen == 0) scaledenvelen = 1; attackRates[i] = attackTabLen / scaledenvelen; attackRatesP[i] = (( attackTabLen % scaledenvelen ) * 65536UL ) / scaledenvelen; - scaledenvelen = (UINT32)(/*floor*/(( decayReleaseTimes[i] * updateFreq ) / 1000UL )); + scaledenvelen = (uint32_t)(/*floor*/(( decayReleaseTimes[i] * updateFreq ) / 1000UL )); if (scaledenvelen == 0) scaledenvelen = 1; decayReleaseRates[i] = releaseTabLen / scaledenvelen; @@ -195,24 +195,24 @@ void enveEmuResetOperator(sidOperator* pVoice) pVoice->enveShortAttackCount = 0; } -static inline UINT16 enveEmuStartAttack(sidOperator*); -static inline UINT16 enveEmuStartDecay(sidOperator*); -static inline UINT16 enveEmuStartRelease(sidOperator*); -static inline UINT16 enveEmuAlterAttack(sidOperator*); -static inline UINT16 enveEmuAlterDecay(sidOperator*); -static inline UINT16 enveEmuAlterSustain(sidOperator*); -static inline UINT16 enveEmuAlterSustainDecay(sidOperator*); -static inline UINT16 enveEmuAlterRelease(sidOperator*); -static inline UINT16 enveEmuAttack(sidOperator*); -static inline UINT16 enveEmuDecay(sidOperator*); -static inline UINT16 enveEmuSustain(sidOperator*); -static inline UINT16 enveEmuSustainDecay(sidOperator*); -static inline UINT16 enveEmuRelease(sidOperator*); -static inline UINT16 enveEmuMute(sidOperator*); - -static inline UINT16 enveEmuStartShortAttack(sidOperator*); -static inline UINT16 enveEmuAlterShortAttack(sidOperator*); -static inline UINT16 enveEmuShortAttack(sidOperator*); +static inline uint16_t enveEmuStartAttack(sidOperator*); +static inline uint16_t enveEmuStartDecay(sidOperator*); +static inline uint16_t enveEmuStartRelease(sidOperator*); +static inline uint16_t enveEmuAlterAttack(sidOperator*); +static inline uint16_t enveEmuAlterDecay(sidOperator*); +static inline uint16_t enveEmuAlterSustain(sidOperator*); +static inline uint16_t enveEmuAlterSustainDecay(sidOperator*); +static inline uint16_t enveEmuAlterRelease(sidOperator*); +static inline uint16_t enveEmuAttack(sidOperator*); +static inline uint16_t enveEmuDecay(sidOperator*); +static inline uint16_t enveEmuSustain(sidOperator*); +static inline uint16_t enveEmuSustainDecay(sidOperator*); +static inline uint16_t enveEmuRelease(sidOperator*); +static inline uint16_t enveEmuMute(sidOperator*); + +static inline uint16_t enveEmuStartShortAttack(sidOperator*); +static inline uint16_t enveEmuAlterShortAttack(sidOperator*); +static inline uint16_t enveEmuShortAttack(sidOperator*); const ptr2sidUwordFunc enveModeTable[] = @@ -258,7 +258,7 @@ static inline void enveEmuEnveAdvance(sidOperator* pVoice) /* */ /* Only used in the beginning. */ -static inline UINT16 enveEmuMute(sidOperator* pVoice) +static inline uint16_t enveEmuMute(sidOperator* pVoice) { return 0; } @@ -267,10 +267,10 @@ static inline UINT16 enveEmuMute(sidOperator* pVoice) /* Release */ /* */ -static inline UINT16 enveEmuRelease(sidOperator* pVoice) +static inline uint16_t enveEmuRelease(sidOperator* pVoice) { #ifdef SID_FPUENVE - pVoice->enveStep = (UINT16)pVoice->fenveStep; + pVoice->enveStep = (uint16_t)pVoice->fenveStep; #endif #if defined(DIRECT_FIXPOINT) && !defined(SID_FPUENVE) if ( pVoice->enveStep.w[HI] >= releaseTabLen ) @@ -293,9 +293,9 @@ static inline UINT16 enveEmuRelease(sidOperator* pVoice) } } -static inline UINT16 enveEmuAlterRelease(sidOperator* pVoice) +static inline uint16_t enveEmuAlterRelease(sidOperator* pVoice) { - UINT8 release = pVoice->SIDSR & 0x0F; + uint8_t release = pVoice->SIDSR & 0x0F; #ifdef SID_FPUENVE pVoice->fenveStepAdd = decayReleaseRates[release]; #elif defined(DIRECT_FIXPOINT) @@ -308,7 +308,7 @@ static inline UINT16 enveEmuAlterRelease(sidOperator* pVoice) return enveEmuRelease(pVoice); } -static inline UINT16 enveEmuStartRelease(sidOperator* pVoice) +static inline uint16_t enveEmuStartRelease(sidOperator* pVoice) { pVoice->ADSRctrl = ENVE_RELEASE; #ifdef SID_FPUENVE @@ -327,15 +327,15 @@ static inline UINT16 enveEmuStartRelease(sidOperator* pVoice) /* Sustain */ /* */ -static inline UINT16 enveEmuSustain(sidOperator* pVoice) +static inline uint16_t enveEmuSustain(sidOperator* pVoice) { return masterAmplModTable[pVoice->sid->masterVolumeAmplIndex+pVoice->enveVol]; } -static inline UINT16 enveEmuSustainDecay(sidOperator* pVoice) +static inline uint16_t enveEmuSustainDecay(sidOperator* pVoice) { #ifdef SID_FPUENVE - pVoice->enveStep = (UINT16)pVoice->fenveStep; + pVoice->enveStep = (uint16_t)pVoice->fenveStep; #endif #if defined(DIRECT_FIXPOINT) && !defined(SID_FPUENVE) if ( pVoice->enveStep.w[HI] >= releaseTabLen ) @@ -368,9 +368,9 @@ static inline UINT16 enveEmuSustainDecay(sidOperator* pVoice) } /* This is the same as enveEmuStartSustainDecay(). */ -static inline UINT16 enveEmuAlterSustainDecay(sidOperator* pVoice) +static inline uint16_t enveEmuAlterSustainDecay(sidOperator* pVoice) { - UINT8 decay = pVoice->SIDAD & 0x0F ; + uint8_t decay = pVoice->SIDAD & 0x0F ; #ifdef SID_FPUENVE pVoice->fenveStepAdd = decayReleaseRates[decay]; #elif defined(DIRECT_FIXPOINT) @@ -384,7 +384,7 @@ static inline UINT16 enveEmuAlterSustainDecay(sidOperator* pVoice) } /* This is the same as enveEmuStartSustain(). */ -static inline UINT16 enveEmuAlterSustain(sidOperator* pVoice) +static inline uint16_t enveEmuAlterSustain(sidOperator* pVoice) { if ( pVoice->enveVol > pVoice->enveSusVol ) { @@ -404,10 +404,10 @@ static inline UINT16 enveEmuAlterSustain(sidOperator* pVoice) /* Decay */ /* */ -static inline UINT16 enveEmuDecay(sidOperator* pVoice) +static inline uint16_t enveEmuDecay(sidOperator* pVoice) { #ifdef SID_FPUENVE - pVoice->enveStep = (UINT16)pVoice->fenveStep; + pVoice->enveStep = (uint16_t)pVoice->fenveStep; #endif #if defined(DIRECT_FIXPOINT) && !defined(SID_FPUENVE) if ( pVoice->enveStep.w[HI] >= releaseTabLen ) @@ -439,9 +439,9 @@ static inline UINT16 enveEmuDecay(sidOperator* pVoice) } } -static inline UINT16 enveEmuAlterDecay(sidOperator* pVoice) +static inline uint16_t enveEmuAlterDecay(sidOperator* pVoice) { - UINT8 decay = pVoice->SIDAD & 0x0F ; + uint8_t decay = pVoice->SIDAD & 0x0F ; #ifdef SID_FPUENVE pVoice->fenveStepAdd = decayReleaseRates[decay]; #elif defined(DIRECT_FIXPOINT) @@ -454,7 +454,7 @@ static inline UINT16 enveEmuAlterDecay(sidOperator* pVoice) return enveEmuDecay(pVoice); } -static inline UINT16 enveEmuStartDecay(sidOperator* pVoice) +static inline uint16_t enveEmuStartDecay(sidOperator* pVoice) { pVoice->ADSRctrl = ENVE_DECAY; #ifdef SID_FPUENVE @@ -471,10 +471,10 @@ static inline UINT16 enveEmuStartDecay(sidOperator* pVoice) /* Attack */ /* */ -static inline UINT16 enveEmuAttack(sidOperator* pVoice) +static inline uint16_t enveEmuAttack(sidOperator* pVoice) { #ifdef SID_FPUENVE - pVoice->enveStep = (UINT16)pVoice->fenveStep; + pVoice->enveStep = (uint16_t)pVoice->fenveStep; #endif #if defined(DIRECT_FIXPOINT) && !defined(SID_FPUENVE) if ( pVoice->enveStep.w[HI] > attackTabLen ) @@ -494,9 +494,9 @@ static inline UINT16 enveEmuAttack(sidOperator* pVoice) } } -static inline UINT16 enveEmuAlterAttack(sidOperator* pVoice) +static inline uint16_t enveEmuAlterAttack(sidOperator* pVoice) { - UINT8 attack = pVoice->SIDAD >> 4; + uint8_t attack = pVoice->SIDAD >> 4; #ifdef SID_FPUENVE pVoice->fenveStepAdd = attackRates[attack]; #elif defined(DIRECT_FIXPOINT) @@ -509,7 +509,7 @@ static inline UINT16 enveEmuAlterAttack(sidOperator* pVoice) return enveEmuAttack(pVoice); } -static inline UINT16 enveEmuStartAttack(sidOperator* pVoice) +static inline uint16_t enveEmuStartAttack(sidOperator* pVoice) { pVoice->ADSRctrl = ENVE_ATTACK; #ifdef SID_FPUENVE @@ -531,10 +531,10 @@ static inline UINT16 enveEmuStartAttack(sidOperator* pVoice) /*#include */ /*#include */ -static inline UINT16 enveEmuShortAttack(sidOperator* pVoice) +static inline uint16_t enveEmuShortAttack(sidOperator* pVoice) { #ifdef SID_FPUENVE - pVoice->enveStep = (UINT16)pVoice->fenveStep; + pVoice->enveStep = (uint16_t)pVoice->fenveStep; #endif #if defined(DIRECT_FIXPOINT) && !defined(SID_FPUENVE) if ((pVoice->enveStep.w[HI] > attackTabLen) || @@ -556,9 +556,9 @@ static inline UINT16 enveEmuShortAttack(sidOperator* pVoice) return masterAmplModTable[ pVoice->sid->masterVolumeAmplIndex + pVoice->enveVol ]; } -static inline UINT16 enveEmuAlterShortAttack(sidOperator* pVoice) +static inline uint16_t enveEmuAlterShortAttack(sidOperator* pVoice) { - UINT8 attack = pVoice->SIDAD >> 4; + uint8_t attack = pVoice->SIDAD >> 4; #ifdef SID_FPUENVE pVoice->fenveStepAdd = attackRates[attack]; #elif defined(DIRECT_FIXPOINT) @@ -571,7 +571,7 @@ static inline UINT16 enveEmuAlterShortAttack(sidOperator* pVoice) return enveEmuShortAttack(pVoice); } -static inline UINT16 enveEmuStartShortAttack(sidOperator* pVoice) +static inline uint16_t enveEmuStartShortAttack(sidOperator* pVoice) { pVoice->ADSRctrl = ENVE_SHORTATTACK; #ifdef SID_FPUENVE diff --git a/src/devices/sound/sidenvel.h b/src/devices/sound/sidenvel.h index 72f303b8110..61bd57b20e8 100644 --- a/src/devices/sound/sidenvel.h +++ b/src/devices/sound/sidenvel.h @@ -10,12 +10,12 @@ #define __SIDENVEL_H__ -extern void enveEmuInit(UINT32 updateFreq, int measuredValues); +extern void enveEmuInit(uint32_t updateFreq, int measuredValues); void enveEmuResetOperator(sidOperator* pVoice); extern const ptr2sidUwordFunc enveModeTable[]; // -> envelope.cpp -extern const UINT8 masterVolumeLevels[16]; // -> envelope.cpp +extern const uint8_t masterVolumeLevels[16]; // -> envelope.cpp enum { diff --git a/src/devices/sound/sidvoice.cpp b/src/devices/sound/sidvoice.cpp index 33f4039891a..636dca3ccba 100644 --- a/src/devices/sound/sidvoice.cpp +++ b/src/devices/sound/sidvoice.cpp @@ -7,42 +7,42 @@ #include "sidw6581.h" #include "sidw8580.h" -static UINT8 triangleTable[4096]; -static UINT8 sawtoothTable[4096]; -static UINT8 squareTable[2*4096]; -static const UINT8* waveform30; -static const UINT8* waveform50; -static const UINT8* waveform60; -static const UINT8* waveform70; +static uint8_t triangleTable[4096]; +static uint8_t sawtoothTable[4096]; +static uint8_t squareTable[2*4096]; +static const uint8_t* waveform30; +static const uint8_t* waveform50; +static const uint8_t* waveform60; +static const uint8_t* waveform70; #if defined(LARGE_NOISE_TABLE) - static UINT8 noiseTableMSB[1<<8]; - static UINT8 noiseTableLSB[1L<<16]; + static uint8_t noiseTableMSB[1<<8]; + static uint8_t noiseTableLSB[1L<<16]; #else - static UINT8 noiseTableMSB[1<<8]; - static UINT8 noiseTableMID[1<<8]; - static UINT8 noiseTableLSB[1<<8]; + static uint8_t noiseTableMSB[1<<8]; + static uint8_t noiseTableMID[1<<8]; + static uint8_t noiseTableLSB[1<<8]; #endif -static std::unique_ptr ampMod1x8; +static std::unique_ptr ampMod1x8; -static const UINT32 noiseSeed = 0x7ffff8; +static const uint32_t noiseSeed = 0x7ffff8; void sidInitMixerEngine(running_machine &machine) { - UINT16 uk; - INT32 si, sj ; + uint16_t uk; + int32_t si, sj ; /* 8-bit volume modulation tables. */ float filterAmpl = 0.7f; - ampMod1x8=std::make_unique(256*256); + ampMod1x8=std::make_unique(256*256); uk = 0; for ( si = 0; si < 256; si++ ) { for ( sj = -128; sj < 128; sj++, uk++ ) { - ampMod1x8[uk] = (INT8)(((si*sj)/255)*filterAmpl); + ampMod1x8[uk] = (int8_t)(((si*sj)/255)*filterAmpl); } } @@ -92,7 +92,7 @@ static inline void noiseAdvance(sidOperator* pVoice) static inline void noiseAdvanceHp(sidOperator* pVoice) { - UINT32 tmp = pVoice->noiseStepAdd; + uint32_t tmp = pVoice->noiseStepAdd; while (tmp >= (1L<<20)) { tmp -= (1L<<20); @@ -300,9 +300,9 @@ static inline void waveCalcCycleLen(sidOperator* pVoice) /* else */ { #if defined(DIRECT_FIXPOINT) - UINT16 diff = pVoice->cycleLenCount - pVoice->cycleLen.w[HI]; + uint16_t diff = pVoice->cycleLenCount - pVoice->cycleLen.w[HI]; #else - UINT16 diff = pVoice->cycleLenCount - pVoice->cycleLen; + uint16_t diff = pVoice->cycleLenCount - pVoice->cycleLen; #endif if ( pVoice->wavePre[diff].len != pVoice->cycleLenCount ) { @@ -339,7 +339,7 @@ static inline void waveCalcFilter(sidOperator* pVoice) tmp = (float)pVoice->filtIO - pVoice->filtLow; tmp -= pVoice->filtRef * pVoice->sid->filter.ResDy; pVoice->filtRef += ( tmp * (pVoice->sid->filter.Dy) ); - pVoice->filtIO = (INT8)(pVoice->filtRef-pVoice->filtLow/4); + pVoice->filtIO = (int8_t)(pVoice->filtRef-pVoice->filtLow/4); } else if (pVoice->sid->filter.Type == 0x40) { @@ -353,7 +353,7 @@ static inline void waveCalcFilter(sidOperator* pVoice) tmp2 = -128; if (tmp2 > 127) tmp2 = 127; - pVoice->filtIO = (INT8)tmp2; + pVoice->filtIO = (int8_t)tmp2; } else { @@ -368,23 +368,23 @@ static inline void waveCalcFilter(sidOperator* pVoice) if ( pVoice->sid->filter.Type == 0x10 ) { - pVoice->filtIO = (INT8)pVoice->filtLow; + pVoice->filtIO = (int8_t)pVoice->filtLow; } else if ( pVoice->sid->filter.Type == 0x30 ) { - pVoice->filtIO = (INT8)pVoice->filtLow; + pVoice->filtIO = (int8_t)pVoice->filtLow; } else if ( pVoice->sid->filter.Type == 0x50 ) { - pVoice->filtIO = (INT8)(sample - (tmp >> 1)); + pVoice->filtIO = (int8_t)(sample - (tmp >> 1)); } else if ( pVoice->sid->filter.Type == 0x60 ) { - pVoice->filtIO = (INT8)tmp; + pVoice->filtIO = (int8_t)tmp; } else if ( pVoice->sid->filter.Type == 0x70 ) { - pVoice->filtIO = (INT8)(sample - (tmp >> 1)); + pVoice->filtIO = (int8_t)(sample - (tmp >> 1)); } } } @@ -395,14 +395,14 @@ static inline void waveCalcFilter(sidOperator* pVoice) } } -static INT8 waveCalcMute(sidOperator* pVoice) +static int8_t waveCalcMute(sidOperator* pVoice) { (*pVoice->ADSRproc)(pVoice); /* just process envelope */ return pVoice->filtIO;//&pVoice->outputMask; } -INT8 sidWaveCalcNormal(sidOperator* pVoice) +int8_t sidWaveCalcNormal(sidOperator* pVoice) { if ( pVoice->cycleLenCount <= 0 ) { @@ -428,7 +428,7 @@ INT8 sidWaveCalcNormal(sidOperator* pVoice) } -static INT8 waveCalcRangeCheck(sidOperator* pVoice) +static int8_t waveCalcRangeCheck(sidOperator* pVoice) { #if defined(DIRECT_FIXPOINT) pVoice->waveStepOld = pVoice->waveStep.w[HI]; @@ -458,10 +458,10 @@ static INT8 waveCalcRangeCheck(sidOperator* pVoice) void sidEmuSet(sidOperator* pVoice) { - UINT8 enveTemp, newWave, oldWave; - UINT8 ADtemp; - UINT8 SRtemp; - UINT8 tmpSusVol; + uint8_t enveTemp, newWave, oldWave; + uint8_t ADtemp; + uint8_t SRtemp; + uint8_t tmpSusVol; pVoice->SIDfreq = pVoice->reg[0]|(pVoice->reg[1]<<8); @@ -713,7 +713,7 @@ void sidEmuSet2(sidOperator* pVoice) void sidInitWaveformTables(int type) { int i,j; - UINT16 k; + uint16_t k; k = 0; for ( i = 0; i < 256; i++ ) @@ -766,10 +766,10 @@ void sidInitWaveformTables(int type) { #if defined(LARGE_NOISE_TABLE) - UINT32 ni; + uint32_t ni; for (ni = 0; ni < sizeof(noiseTableLSB); ni++) { - noiseTableLSB[ni] = (UINT8) + noiseTableLSB[ni] = (uint8_t) (((ni >> (13-4)) & 0x10) | ((ni >> (11-3)) & 0x08) | ((ni >> (7-2)) & 0x04) | @@ -778,29 +778,29 @@ void sidInitWaveformTables(int type) } for (ni = 0; ni < sizeof(noiseTableMSB); ni++) { - noiseTableMSB[ni] = (UINT8) + noiseTableMSB[ni] = (uint8_t) (((ni << (7-(22-16))) & 0x80) | ((ni << (6-(20-16))) & 0x40) | ((ni << (5-(16-16))) & 0x20)); } #else - UINT32 ni; + uint32_t ni; for (ni = 0; ni < sizeof(noiseTableLSB); ni++) { - noiseTableLSB[ni] = (UINT8) + noiseTableLSB[ni] = (uint8_t) (((ni >> (7-2)) & 0x04) | ((ni >> (4-1)) & 0x02) | ((ni >> (2-0)) & 0x01)); } for (ni = 0; ni < sizeof(noiseTableMID); ni++) { - noiseTableMID[ni] = (UINT8) + noiseTableMID[ni] = (uint8_t) (((ni >> (13-8-4)) & 0x10) | ((ni << (3-(11-8))) & 0x08)); } for (ni = 0; ni < sizeof(noiseTableMSB); ni++) { - noiseTableMSB[ni] = (UINT8) + noiseTableMSB[ni] = (uint8_t) (((ni << (7-(22-16))) & 0x80) | ((ni << (6-(20-16))) & 0x40) | ((ni << (5-(16-16))) & 0x20)); diff --git a/src/devices/sound/sidvoice.h b/src/devices/sound/sidvoice.h index f0aebf50f08..cf32eb7f066 100644 --- a/src/devices/sound/sidvoice.h +++ b/src/devices/sound/sidvoice.h @@ -14,12 +14,12 @@ struct sw_storage { - UINT16 len; + uint16_t len; #if defined(DIRECT_FIXPOINT) - UINT32 stp; + uint32_t stp; #else - UINT32 pnt; - INT16 stp; + uint32_t pnt; + int16_t stp; #endif }; @@ -28,45 +28,45 @@ struct SID6581_t; struct sidOperator { SID6581_t *sid; - UINT8 reg[7]; - UINT32 SIDfreq; - UINT16 SIDpulseWidth; - UINT8 SIDctrl; - UINT8 SIDAD, SIDSR; + uint8_t reg[7]; + uint32_t SIDfreq; + uint16_t SIDpulseWidth; + uint8_t SIDctrl; + uint8_t SIDAD, SIDSR; sidOperator* carrier; sidOperator* modulator; int sync; - UINT16 pulseIndex, newPulseIndex; - UINT16 curSIDfreq; - UINT16 curNoiseFreq; + uint16_t pulseIndex, newPulseIndex; + uint16_t curSIDfreq; + uint16_t curNoiseFreq; - UINT8 output;//, outputMask; + uint8_t output;//, outputMask; char filtVoiceMask; int filtEnabled; float filtLow, filtRef; - INT8 filtIO; + int8_t filtIO; - INT32 cycleLenCount; + int32_t cycleLenCount; #if defined(DIRECT_FIXPOINT) cpuLword cycleLen, cycleAddLen; #else - UINT32 cycleAddLenPnt; - UINT16 cycleLen, cycleLenPnt; + uint32_t cycleAddLenPnt; + uint16_t cycleLen, cycleLenPnt; #endif - INT8(*outProc)(sidOperator *); + int8_t(*outProc)(sidOperator *); void(*waveProc)(sidOperator *); #if defined(DIRECT_FIXPOINT) cpuLword waveStep, waveStepAdd; #else - UINT16 waveStep, waveStepAdd; - UINT32 waveStepPnt, waveStepAddPnt; + uint16_t waveStep, waveStepAdd; + uint32_t waveStepPnt, waveStepAddPnt; #endif - UINT16 waveStepOld; + uint16_t waveStepOld; struct sw_storage wavePre[2]; #if defined(DIRECT_FIXPOINT) && defined(LARGE_NOISE_TABLE) @@ -74,38 +74,38 @@ struct sidOperator #elif defined(DIRECT_FIXPOINT) cpuLBword noiseReg; #else - UINT32 noiseReg; + uint32_t noiseReg; #endif - UINT32 noiseStep, noiseStepAdd; - UINT8 noiseOutput; + uint32_t noiseStep, noiseStepAdd; + uint8_t noiseOutput; int noiseIsLocked; - UINT8 ADSRctrl; + uint8_t ADSRctrl; // int gateOnCtrl, gateOffCtrl; - UINT16 (*ADSRproc)(sidOperator *); + uint16_t (*ADSRproc)(sidOperator *); #ifdef SID_FPUENVE float fenveStep, fenveStepAdd; - UINT32 enveStep; + uint32_t enveStep; #elif defined(DIRECT_FIXPOINT) cpuLword enveStep, enveStepAdd; #else - UINT16 enveStep, enveStepAdd; - UINT32 enveStepPnt, enveStepAddPnt; + uint16_t enveStep, enveStepAdd; + uint32_t enveStepPnt, enveStepAddPnt; #endif - UINT8 enveVol, enveSusVol; - UINT16 enveShortAttackCount; + uint8_t enveVol, enveSusVol; + uint16_t enveShortAttackCount; }; -typedef INT8 (*ptr2sidFunc)(sidOperator *); -typedef UINT16 (*ptr2sidUwordFunc)(sidOperator *); +typedef int8_t (*ptr2sidFunc)(sidOperator *); +typedef uint16_t (*ptr2sidUwordFunc)(sidOperator *); typedef void (*ptr2sidVoidFunc)(sidOperator *); void sidClearOperator( sidOperator* pVoice ); void sidEmuSet(sidOperator* pVoice); void sidEmuSet2(sidOperator* pVoice); -INT8 sidWaveCalcNormal(sidOperator* pVoice); +int8_t sidWaveCalcNormal(sidOperator* pVoice); void sidInitWaveformTables(int type); void sidInitMixerEngine(running_machine &machine); diff --git a/src/devices/sound/sidw6581.h b/src/devices/sound/sidw6581.h index b37f7693c54..2f9a79d2fcf 100644 --- a/src/devices/sound/sidw6581.h +++ b/src/devices/sound/sidw6581.h @@ -10,7 +10,7 @@ * Copyright Dag Lem */ -static const UINT8 waveform30_6581[4096] = +static const uint8_t waveform30_6581[4096] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, @@ -270,7 +270,7 @@ static const UINT8 waveform30_6581[4096] = 0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3e,0x3e,0x3f,0x3f,0x7f,0x7f,0x7f,0x7f }; -static const UINT8 waveform50_6581[4096+4096] = +static const uint8_t waveform50_6581[4096+4096] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, @@ -530,7 +530,7 @@ static const UINT8 waveform50_6581[4096+4096] = 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; -static const UINT8 waveform60_6581[4096+4096] = +static const uint8_t waveform60_6581[4096+4096] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, @@ -790,7 +790,7 @@ static const UINT8 waveform60_6581[4096+4096] = 0x70,0x7c,0x7c,0x7f,0x7c,0x7f,0x7f,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f }; -static const UINT8 waveform70_6581[4096+4096] = +static const uint8_t waveform70_6581[4096+4096] = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, diff --git a/src/devices/sound/sidw8580.h b/src/devices/sound/sidw8580.h index e1f0c10ec8e..cb5b4a1c6ab 100644 --- a/src/devices/sound/sidw8580.h +++ b/src/devices/sound/sidw8580.h @@ -11,7 +11,7 @@ * Created with Deadman's Raw Data to C Header converter */ -static const UINT8 waveform30_8580[4096] = +static const uint8_t waveform30_8580[4096] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -357,7 +357,7 @@ static const UINT8 waveform30_8580[4096] = 0xff,0xff,0xff,0xff }; -static const UINT8 waveform50_8580[4096+4096] = +static const uint8_t waveform50_8580[4096+4096] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -703,7 +703,7 @@ static const UINT8 waveform50_8580[4096+4096] = 0x00,0x00,0x00,0x00 }; -static const UINT8 waveform60_8580[4096+4096] = +static const uint8_t waveform60_8580[4096+4096] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -1049,7 +1049,7 @@ static const UINT8 waveform60_8580[4096+4096] = 0xff,0xff,0xff,0xff }; -static const UINT8 waveform70_8580[4096+4096] = +static const uint8_t waveform70_8580[4096+4096] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, diff --git a/src/devices/sound/sn76477.cpp b/src/devices/sound/sn76477.cpp index 111e127aa82..d6a9ebbe35e 100644 --- a/src/devices/sound/sn76477.cpp +++ b/src/devices/sound/sn76477.cpp @@ -142,7 +142,7 @@ static const double out_neg_gain[] = const device_type SN76477 = &device_creator; -sn76477_device::sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sn76477_device::sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SN76477, "SN76477", tag, owner, clock, "sn76477", __FILE__), device_sound_interface(mconfig, *this), m_enable(0), @@ -417,7 +417,7 @@ double sn76477_device::compute_vco_duty_cycle() /* no measure, just a number */ } -UINT32 sn76477_device::compute_noise_gen_freq() /* in Hz */ +uint32_t sn76477_device::compute_noise_gen_freq() /* in Hz */ { /* this formula was derived using the data points below @@ -447,7 +447,7 @@ UINT32 sn76477_device::compute_noise_gen_freq() /* in Hz */ 3.3M 487.59 */ - UINT32 ret = 0; + uint32_t ret = 0; if ((m_noise_clock_res >= NOISE_MIN_CLOCK_RES) && (m_noise_clock_res <= NOISE_MAX_CLOCK_RES)) @@ -907,7 +907,7 @@ void sn76477_device::close_wav_file() } -void sn76477_device::add_wav_data(INT16 data_l, INT16 data_r) +void sn76477_device::add_wav_data(int16_t data_l, int16_t data_r) { wav_add_data_16lr(m_file, &data_l, &data_r, 1); } @@ -926,9 +926,9 @@ void sn76477_device::intialize_noise() } -inline UINT32 sn76477_device::generate_next_real_noise_bit() +inline uint32_t sn76477_device::generate_next_real_noise_bit() { - UINT32 out = ((m_rng >> 28) & 1) ^ ((m_rng >> 0) & 1); + uint32_t out = ((m_rng >> 28) & 1) ^ ((m_rng >> 0) & 1); /* if bits 0-4 and 28 are all zero then force the output to 1 */ if ((m_rng & 0x1000001f) == 0) @@ -1700,7 +1700,7 @@ void sn76477_device::sound_stream_update(sound_stream &stream, stream_sample_t * double vco_cap_charging_step; double vco_cap_discharging_step; double vco_cap_voltage_max; - UINT32 noise_gen_freq; + uint32_t noise_gen_freq; double noise_filter_cap_charging_step; double noise_filter_cap_discharging_step; double attack_decay_cap_charging_step; @@ -1918,7 +1918,7 @@ void sn76477_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* mix the output, if enabled, or not saturated by the VCO */ if (!m_enable && (m_vco_cap_voltage <= VCO_CAP_VOLTAGE_MAX)) { - UINT32 out; + uint32_t out; /* enabled */ switch (m_mixer_mode) @@ -1989,8 +1989,8 @@ void sn76477_device::sound_stream_update(sound_stream &stream, stream_sample_t * if (LOG_WAV && LOG_WAV_ENABLED_ONLY && !m_enable) { - INT16 log_data_l; - INT16 log_data_r; + int16_t log_data_l; + int16_t log_data_r; switch (LOG_WAV_VALUE_L) { diff --git a/src/devices/sound/sn76477.h b/src/devices/sound/sn76477.h index ed83fb7aa80..19b331bacdf 100644 --- a/src/devices/sound/sn76477.h +++ b/src/devices/sound/sn76477.h @@ -93,7 +93,7 @@ class sn76477_device : public device_t, public device_sound_interface { public: - sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~sn76477_device() {} static void set_noise_params(device_t &device, double clock_res, double filter_res, double filter_cap) @@ -132,21 +132,21 @@ public: dev.m_one_shot_cap = cap; dev.m_one_shot_res = res; } - static void set_vco_mode(device_t &device, UINT32 mode) { downcast(device).m_vco_mode = mode; } - static void set_mixer_params(device_t &device, UINT32 a, UINT32 b, UINT32 c) + static void set_vco_mode(device_t &device, uint32_t mode) { downcast(device).m_vco_mode = mode; } + static void set_mixer_params(device_t &device, uint32_t a, uint32_t b, uint32_t c) { sn76477_device &dev = downcast(device); dev.m_mixer_a = a; dev.m_mixer_b = b; dev.m_mixer_c = c; } - static void set_envelope_params(device_t &device, UINT32 env1, UINT32 env2) + static void set_envelope_params(device_t &device, uint32_t env1, uint32_t env2) { sn76477_device &dev = downcast(device); dev.m_envelope_1 = env1; dev.m_envelope_2 = env2; } - static void set_enable(device_t &device, UINT32 enable) { downcast(device).m_enable = enable; } + static void set_enable(device_t &device, uint32_t enable) { downcast(device).m_enable = enable; } /* these functions take 0 or 1 as a logic input */ @@ -199,35 +199,35 @@ protected: private: /* chip's external interface */ - UINT32 m_enable; - UINT32 m_envelope_mode; - UINT32 m_vco_mode; - UINT32 m_mixer_mode; + uint32_t m_enable; + uint32_t m_envelope_mode; + uint32_t m_vco_mode; + uint32_t m_mixer_mode; double m_one_shot_res; double m_one_shot_cap; - UINT32 m_one_shot_cap_voltage_ext; + uint32_t m_one_shot_cap_voltage_ext; double m_slf_res; double m_slf_cap; - UINT32 m_slf_cap_voltage_ext; + uint32_t m_slf_cap_voltage_ext; double m_vco_voltage; double m_vco_res; double m_vco_cap; - UINT32 m_vco_cap_voltage_ext; + uint32_t m_vco_cap_voltage_ext; double m_noise_clock_res; - UINT32 m_noise_clock_ext; - UINT32 m_noise_clock; + uint32_t m_noise_clock_ext; + uint32_t m_noise_clock; double m_noise_filter_res; double m_noise_filter_cap; - UINT32 m_noise_filter_cap_voltage_ext; + uint32_t m_noise_filter_cap_voltage_ext; double m_attack_res; double m_decay_res; double m_attack_decay_cap; - UINT32 m_attack_decay_cap_voltage_ext; + uint32_t m_attack_decay_cap_voltage_ext; double m_amplitude_res; double m_feedback_res; @@ -235,30 +235,30 @@ private: // internal state double m_one_shot_cap_voltage; /* voltage on the one-shot cap */ - UINT32 m_one_shot_running_ff; /* 1 = one-shot running, 0 = stopped */ + uint32_t m_one_shot_running_ff; /* 1 = one-shot running, 0 = stopped */ double m_slf_cap_voltage; /* voltage on the SLF cap */ - UINT32 m_slf_out_ff; /* output of the SLF */ + uint32_t m_slf_out_ff; /* output of the SLF */ double m_vco_cap_voltage; /* voltage on the VCO cap */ - UINT32 m_vco_out_ff; /* output of the VCO */ - UINT32 m_vco_alt_pos_edge_ff; /* keeps track of the # of positive edges for VCO Alt envelope */ + uint32_t m_vco_out_ff; /* output of the VCO */ + uint32_t m_vco_alt_pos_edge_ff; /* keeps track of the # of positive edges for VCO Alt envelope */ double m_noise_filter_cap_voltage; /* voltage on the noise filter cap */ - UINT32 m_real_noise_bit_ff; /* the current noise bit before filtering */ - UINT32 m_filtered_noise_bit_ff; /* the noise bit after filtering */ - UINT32 m_noise_gen_count; /* noise freq emulation */ + uint32_t m_real_noise_bit_ff; /* the current noise bit before filtering */ + uint32_t m_filtered_noise_bit_ff; /* the noise bit after filtering */ + uint32_t m_noise_gen_count; /* noise freq emulation */ double m_attack_decay_cap_voltage; /* voltage on the attack/decay cap */ - UINT32 m_rng; /* current value of the random number generator */ + uint32_t m_rng; /* current value of the random number generator */ // configured by the drivers and used to setup m_mixer_mode & m_envelope_mode at start - UINT32 m_mixer_a; - UINT32 m_mixer_b; - UINT32 m_mixer_c; - UINT32 m_envelope_1; - UINT32 m_envelope_2; + uint32_t m_mixer_a; + uint32_t m_mixer_b; + uint32_t m_mixer_c; + uint32_t m_envelope_1; + uint32_t m_envelope_2; /* others */ sound_stream *m_channel; /* returned by stream_create() */ @@ -272,7 +272,7 @@ private: double compute_slf_cap_discharging_rate(); double compute_vco_cap_charging_discharging_rate(); double compute_vco_duty_cycle(); - UINT32 compute_noise_gen_freq(); + uint32_t compute_noise_gen_freq(); double compute_noise_filter_cap_charging_rate(); double compute_noise_filter_cap_discharging_rate(); double compute_attack_decay_cap_charging_rate(); @@ -298,10 +298,10 @@ private: void open_wav_file(); void close_wav_file(); - void add_wav_data(INT16 data_l, INT16 data_r); + void add_wav_data(int16_t data_l, int16_t data_r); void intialize_noise(); - inline UINT32 generate_next_real_noise_bit(); + inline uint32_t generate_next_real_noise_bit(); void state_save_register(); }; diff --git a/src/devices/sound/sn76496.cpp b/src/devices/sound/sn76496.cpp index f39fc04bc38..59b63f7e7ec 100644 --- a/src/devices/sound/sn76496.cpp +++ b/src/devices/sound/sn76496.cpp @@ -132,7 +132,7 @@ sn76496_base_device::sn76496_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, int feedbackmask, int noisetap1, int noisetap2, bool negate, bool stereo, int clockdivider, int sega, - device_t *owner, UINT32 clock, const char *shortname, const char *source) + device_t *owner, uint32_t clock, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_sound_interface(mconfig, *this), @@ -147,34 +147,34 @@ sn76496_base_device::sn76496_base_device(const machine_config &mconfig, device_t { } -sn76496_device::sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sn76496_device::sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, SN76496, "SN76496", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76496", __FILE__) { } -u8106_device::u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +u8106_device::u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, U8106, "U8106", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "u8106", __FILE__) { } -y2404_device::y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +y2404_device::y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, Y2404, "Y2404", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "y2404", __FILE__) { } -sn76489_device::sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sn76489_device::sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, SN76489, "SN76489", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "sn76489", __FILE__) { } -sn76489a_device::sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sn76489a_device::sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, SN76489A, "SN76489A", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76489a", __FILE__) { } -sn76494_device::sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sn76494_device::sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, SN76494, "SN76494", tag, 0x10000, 0x04, 0x08, false, false, 1, true, owner, clock, "sn76494", __FILE__) { } -sn94624_device::sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sn94624_device::sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, SN94624, "SN94624", tag, 0x4000, 0x01, 0x02, true, false, 1, true, owner, clock, "sn94624", __FILE__) { } -ncr7496_device::ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ncr7496_device::ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, NCR7496, "NCR7496", tag, 0x8000, 0x02, 0x20, false, false, 8, true, owner, clock, "ncr7496", __FILE__) { } -gamegear_device::gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gamegear_device::gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, GAMEGEAR, "Game Gear PSG", tag, 0x8000, 0x01, 0x08, true, true, 8, false, owner, clock, "gamegear_psg", __FILE__) { } -segapsg_device::segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segapsg_device::segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sn76496_base_device(mconfig, SEGAPSG, "SEGA VDP PSG", tag, 0x8000, 0x01, 0x08, true, false, 8, false, owner, clock, "segapsg", __FILE__) { } @@ -246,7 +246,7 @@ WRITE8_MEMBER( sn76496_base_device::stereo_w ) else fatalerror("sn76496_base_device: Call to stereo write with mono chip!\n"); } -void sn76496_base_device::write(UINT8 data) +void sn76496_base_device::write(uint8_t data) { int n, r, c; @@ -335,8 +335,8 @@ void sn76496_base_device::sound_stream_update(sound_stream &stream, stream_sampl stream_sample_t *lbuffer = outputs[0]; stream_sample_t *rbuffer = (m_stereo)? outputs[1] : nullptr; - INT16 out; - INT16 out2 = 0; + int16_t out; + int16_t out2 = 0; while (samples > 0) { diff --git a/src/devices/sound/sn76496.h b/src/devices/sound/sn76496.h index 28a685959ad..936df36ea24 100644 --- a/src/devices/sound/sn76496.h +++ b/src/devices/sound/sn76496.h @@ -25,13 +25,13 @@ class sn76496_base_device : public device_t, public device_sound_interface public: sn76496_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, int feedbackmask, int noisetap1, int noisetap2, bool negate, bool stereo, int clockdivider, int sega, - device_t *owner, UINT32 clock, const char *shortname, const char *source); + device_t *owner, uint32_t clock, const char *shortname, const char *source); // static configuration helpers template static devcb_base &set_ready_handler(device_t &device, _Object object) { return downcast(device).m_ready_handler.set_callback(object); } DECLARE_WRITE8_MEMBER( stereo_w ); - void write(UINT8 data); + void write(uint8_t data); DECLARE_WRITE8_MEMBER( write ); DECLARE_READ_LINE_MEMBER( ready_r ) { return m_ready_state ? 1 : 0; } @@ -50,95 +50,95 @@ private: sound_stream* m_sound; - const INT32 m_feedback_mask; // mask for feedback - const INT32 m_whitenoise_tap1; // mask for white noise tap 1 (higher one, usually bit 14) - const INT32 m_whitenoise_tap2; // mask for white noise tap 2 (lower one, usually bit 13) + const int32_t m_feedback_mask; // mask for feedback + const int32_t m_whitenoise_tap1; // mask for white noise tap 1 (higher one, usually bit 14) + const int32_t m_whitenoise_tap2; // mask for white noise tap 2 (lower one, usually bit 13) const bool m_negate; // output negate flag const bool m_stereo; // whether we're dealing with stereo or not - const INT32 m_clock_divider; // clock divider + const int32_t m_clock_divider; // clock divider const bool m_sega_style_psg; // flag for if frequency zero acts as if it is one more than max (0x3ff+1) or if it acts like 0; AND if the initial register is pointing to 0x3 instead of 0x0 AND if the volume reg is preloaded with 0xF instead of 0x0 - INT32 m_vol_table[16]; // volume table (for 4-bit to db conversion) - INT32 m_register[8]; // registers - INT32 m_last_register; // last register written - INT32 m_volume[4]; // db volume of voice 0-2 and noise - UINT32 m_RNG; // noise generator LFSR - INT32 m_current_clock; - INT32 m_stereo_mask; // the stereo output mask - INT32 m_period[4]; // Length of 1/2 of waveform - INT32 m_count[4]; // Position within the waveform - INT32 m_output[4]; // 1-bit output of each channel, pre-volume - INT32 m_cycles_to_ready; // number of cycles until the READY line goes active + int32_t m_vol_table[16]; // volume table (for 4-bit to db conversion) + int32_t m_register[8]; // registers + int32_t m_last_register; // last register written + int32_t m_volume[4]; // db volume of voice 0-2 and noise + uint32_t m_RNG; // noise generator LFSR + int32_t m_current_clock; + int32_t m_stereo_mask; // the stereo output mask + int32_t m_period[4]; // Length of 1/2 of waveform + int32_t m_count[4]; // Position within the waveform + int32_t m_output[4]; // 1-bit output of each channel, pre-volume + int32_t m_cycles_to_ready; // number of cycles until the READY line goes active }; // SN76496: Whitenoise verified, phase verified, periodic verified (by Michael Zapf) class sn76496_device : public sn76496_base_device { public: - sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // U8106 not verified yet. todo: verify; (a custom marked sn76489? only used on mr. do and maybe other universal games) class u8106_device : public sn76496_base_device { public: - u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // Y2404 not verified yet. todo: verify; (don't be fooled by the Y, it's a TI chip, not Yamaha) class y2404_device : public sn76496_base_device { public: - y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // SN76489 not verified yet. todo: verify; class sn76489_device : public sn76496_base_device { public: - sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // SN76489A: whitenoise verified, phase verified, periodic verified (by plgdavid) class sn76489a_device : public sn76496_base_device { public: - sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // SN76494 not verified, (according to datasheet: same as sn76489a but without the /8 divider) class sn76494_device : public sn76496_base_device { public: - sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // SN94624 whitenoise verified, phase verified, period verified; verified by PlgDavid class sn94624_device : public sn76496_base_device { public: - sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // NCR7496 not verified; info from smspower wiki class ncr7496_device : public sn76496_base_device { public: - ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // Verified by Justin Kerk class gamegear_device : public sn76496_base_device { public: - gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // todo: verify; from smspower wiki, assumed to have same invert as gamegear class segapsg_device : public sn76496_base_device { public: - segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; #endif /* __SN76496_H__ */ diff --git a/src/devices/sound/snkwave.cpp b/src/devices/sound/snkwave.cpp index 79a6ed1bcb4..a682dbe2bbd 100644 --- a/src/devices/sound/snkwave.cpp +++ b/src/devices/sound/snkwave.cpp @@ -21,7 +21,7 @@ const device_type SNKWAVE = &device_creator; // snkwave_device - constructor //------------------------------------------------- -snkwave_device::snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +snkwave_device::snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNKWAVE, "SNK Wave", tag, owner, clock, "snkwave", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -85,7 +85,7 @@ void snkwave_device::sound_stream_update(sound_stream &stream, stream_sample_t * while (samples-- > 0) { int loops; - INT16 out = 0; + int16_t out = 0; loops = 1 << CLOCK_SHIFT; while (loops > 0) @@ -142,7 +142,7 @@ WRITE8_MEMBER( snkwave_device::snkwave_w ) So the sequence 01234567 will play as 89ABCDEF76543210 */ -void snkwave_device::update_waveform(unsigned int offset, UINT8 data) +void snkwave_device::update_waveform(unsigned int offset, uint8_t data) { assert(offset < SNKWAVE_WAVEFORM_LENGTH/4); diff --git a/src/devices/sound/snkwave.h b/src/devices/sound/snkwave.h index 07c45c96134..f825cbab2b4 100644 --- a/src/devices/sound/snkwave.h +++ b/src/devices/sound/snkwave.h @@ -28,7 +28,7 @@ class snkwave_device : public device_t, public device_sound_interface { public: - snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~snkwave_device() { } protected: @@ -42,7 +42,7 @@ public: DECLARE_WRITE8_MEMBER( snkwave_w ); private: - void update_waveform(unsigned int offset, UINT8 data); + void update_waveform(unsigned int offset, uint8_t data); private: sound_stream *m_stream; @@ -50,12 +50,12 @@ private: int m_sample_rate; // data about the sound system - UINT32 m_frequency; - UINT32 m_counter; + uint32_t m_frequency; + uint32_t m_counter; int m_waveform_position; // decoded waveform table - INT16 m_waveform[SNKWAVE_WAVEFORM_LENGTH]; + int16_t m_waveform[SNKWAVE_WAVEFORM_LENGTH]; }; extern const device_type SNKWAVE; diff --git a/src/devices/sound/sp0250.cpp b/src/devices/sound/sp0250.cpp index 004cd6d6921..6f33d6bdfa0 100644 --- a/src/devices/sound/sp0250.cpp +++ b/src/devices/sound/sp0250.cpp @@ -36,7 +36,7 @@ should be 312, but 312 = 39*8 so it doesn't look right because a divider by 39 i const device_type SP0250 = &device_creator; -sp0250_device::sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sp0250_device::sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SP0250, "SP0250", tag, owner, clock, "sp0250", __FILE__), device_sound_interface(mconfig, *this), m_amp(0), @@ -93,15 +93,15 @@ void sp0250_device::device_start() save_item(NAME(m_fifo_pos)); } -static UINT16 sp0250_ga(UINT8 v) +static uint16_t sp0250_ga(uint8_t v) { return (v & 0x1f) << (v>>5); } -static INT16 sp0250_gc(UINT8 v) +static int16_t sp0250_gc(uint8_t v) { // Internal ROM to the chip, cf. manual - static const UINT16 coefs[128] = + static const uint16_t coefs[128] = { 0, 9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, 105, 113, 121, 129, 137, 145, 153, 161, 169, 177, 185, 193, 201, 203, 217, 225, 233, 241, 249, @@ -112,7 +112,7 @@ static INT16 sp0250_gc(UINT8 v) 479, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511 }; - INT16 res = coefs[v & 0x7f]; + int16_t res = coefs[v & 0x7f]; if (!(v & 0x80)) res = -res; @@ -171,7 +171,7 @@ WRITE8_MEMBER( sp0250_device::write ) } -UINT8 sp0250_device::drq_r() +uint8_t sp0250_device::drq_r() { m_stream->update(); return (m_fifo_pos == 15) ? CLEAR_LINE : ASSERT_LINE; @@ -189,7 +189,7 @@ void sp0250_device::sound_stream_update(sound_stream &stream, stream_sample_t ** { if (m_playing) { - INT16 z0; + int16_t z0; int f; if (m_voiced) diff --git a/src/devices/sound/sp0250.h b/src/devices/sound/sp0250.h index ab3b11220ff..e9f8e40829a 100644 --- a/src/devices/sound/sp0250.h +++ b/src/devices/sound/sp0250.h @@ -9,13 +9,13 @@ class sp0250_device : public device_t, public device_sound_interface { public: - sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~sp0250_device() {} template static devcb_base &set_drq_callback(device_t &device, _Object object) { return downcast(device).m_drq.set_callback(object); } DECLARE_WRITE8_MEMBER( write ); - UINT8 drq_r(); + uint8_t drq_r(); protected: // device-level overrides @@ -26,22 +26,22 @@ protected: private: // internal state - INT16 m_amp; - UINT8 m_pitch; - UINT8 m_repeat; + int16_t m_amp; + uint8_t m_pitch; + uint8_t m_repeat; int m_pcount, m_rcount; int m_playing; - UINT32 m_RNG; + uint32_t m_RNG; sound_stream * m_stream; int m_voiced; - UINT8 m_fifo[15]; + uint8_t m_fifo[15]; int m_fifo_pos; devcb_write_line m_drq; struct { - INT16 F, B; - INT16 z1, z2; + int16_t F, B; + int16_t z1, z2; } m_filter[6]; void load_values(); diff --git a/src/devices/sound/sp0256.cpp b/src/devices/sound/sp0256.cpp index 5467f3910ae..c735fafaa3b 100644 --- a/src/devices/sound/sp0256.cpp +++ b/src/devices/sound/sp0256.cpp @@ -52,7 +52,7 @@ /* qtbl -- Coefficient Quantization Table. This comes from a */ /* SP0250 data sheet, and should be correct for SP0256. */ /* ======================================================================== */ -static const INT16 qtbl[128] = +static const int16_t qtbl[128] = { 0, 9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, 105, 113, 121, @@ -82,7 +82,7 @@ const device_type SP0256 = &device_creator; // LIVE DEVICE //************************************************************************** -sp0256_device::sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sp0256_device::sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SP0256, "SP0256", tag, owner, clock, "sp0256", __FILE__), device_sound_interface(mconfig, *this), m_rom(*this, DEVICE_SELF), @@ -112,7 +112,7 @@ void sp0256_device::device_start() /* -------------------------------------------------------------------- */ /* Allocate a scratch buffer for generating ~10kHz samples. */ /* -------------------------------------------------------------------- */ - m_scratch = std::make_unique(SCBUF_SIZE); + m_scratch = std::make_unique(SCBUF_SIZE); save_pointer(NAME(m_scratch.get()), SCBUF_SIZE); m_sc_head = m_sc_tail = 0; @@ -202,7 +202,7 @@ void sp0256_device::device_reset() /* ======================================================================== */ /* LIMIT -- Limiter function for digital sample output. */ /* ======================================================================== */ -static inline INT16 limit(INT16 s) +static inline int16_t limit(int16_t s) { #ifdef HIGH_QUALITY /* Higher quality than the original, but who cares? */ if (s > 8191) return 8191; @@ -217,10 +217,10 @@ static inline INT16 limit(INT16 s) /* ======================================================================== */ /* LPC12_UPDATE -- Update the 12-pole filter, outputting samples. */ /* ======================================================================== */ -static inline int lpc12_update(struct lpc12_t *f, int num_samp, INT16 *out, UINT32 *optr) +static inline int lpc12_update(struct lpc12_t *f, int num_samp, int16_t *out, uint32_t *optr) { int i, j; - INT16 samp; + int16_t samp; int do_int; int oidx = *optr; @@ -412,7 +412,7 @@ static inline void lpc12_regdec(struct lpc12_t *f) enum { AM = 0, PR, B0, F0, B1, F1, B2, F2, B3, F3, B4, F4, B5, F5, IA, IP }; -static const UINT16 sp0256_datafmt[] = +static const uint16_t sp0256_datafmt[] = { /* -------------------------------------------------------------------- */ /* OPCODE 1111: PAUSE */ @@ -686,7 +686,7 @@ static const UINT16 sp0256_datafmt[] = /* 176 */ CR( 5, 0, IP, 0, 0, 0, 0), /* Per. Intr. */ }; -static const INT16 sp0256_df_idx[16 * 8] = +static const int16_t sp0256_df_idx[16 * 8] = { /* OPCODE 0000 */ -1, -1, -1, -1, -1, -1, -1, -1, /* OPCODE 1000 */ -1, -1, -1, -1, -1, -1, -1, -1, @@ -709,7 +709,7 @@ static const INT16 sp0256_df_idx[16 * 8] = /* ======================================================================== */ /* BITREV32 -- Bit-reverse a 32-bit number. */ /* ======================================================================== */ -static inline UINT32 bitrev32(UINT32 val) +static inline uint32_t bitrev32(uint32_t val) { val = ((val & 0xFFFF0000) >> 16) | ((val & 0x0000FFFF) << 16); val = ((val & 0xFF00FF00) >> 8) | ((val & 0x00FF00FF) << 8); @@ -723,7 +723,7 @@ static inline UINT32 bitrev32(UINT32 val) /* ======================================================================== */ /* BITREV8 -- Bit-reverse a 8-bit number. */ /* ======================================================================== */ -static inline UINT8 bitrev8(UINT8 val) +static inline uint8_t bitrev8(uint8_t val) { val = ((val & 0xF0) >> 4) | ((val & 0x0F) << 4); val = ((val & 0xCC) >> 2) | ((val & 0x33) << 2); @@ -735,7 +735,7 @@ static inline UINT8 bitrev8(UINT8 val) /* ======================================================================== */ /* BITREVBUFF -- Bit-reverse a buffer. */ /* ======================================================================== */ -void sp0256_device::bitrevbuff(UINT8 *buffer, unsigned int start, unsigned int length) +void sp0256_device::bitrevbuff(uint8_t *buffer, unsigned int start, unsigned int length) { for (unsigned int i = start; i < length; i++ ) buffer[i] = bitrev8(buffer[i]); @@ -744,10 +744,10 @@ void sp0256_device::bitrevbuff(UINT8 *buffer, unsigned int start, unsigned int l /* ======================================================================== */ /* SP0256_GETB -- Get up to 8 bits at the current PC. */ /* ======================================================================== */ -UINT32 sp0256_device::getb( int len ) +uint32_t sp0256_device::getb( int len ) { - UINT32 data; - UINT32 d0, d1; + uint32_t data; + uint32_t d0, d1; /* -------------------------------------------------------------------- */ /* Fetch data from the FIFO or from the MASK */ @@ -806,9 +806,9 @@ UINT32 sp0256_device::getb( int len ) /* ======================================================================== */ void sp0256_device::micro() { - UINT8 immed4; - UINT8 opcode; - UINT16 cr; + uint8_t immed4; + uint8_t opcode; + uint16_t cr; int ctrl_xfer; int repeat; int i, idx0, idx1; @@ -886,7 +886,7 @@ void sp0256_device::micro() /* Otherwise, this is an RTS / HLT. */ /* -------------------------------------------------------- */ { - UINT32 btrg; + uint32_t btrg; /* ---------------------------------------------------- */ /* Figure out our branch target. */ @@ -1031,7 +1031,7 @@ void sp0256_device::micro() for (i = idx0; i <= idx1; i++) { int len, shf, delta, field, prm, clra, clr5; - INT8 value; + int8_t value; /* ------------------------------------------------------------ */ /* Get the control word and pull out some important fields. */ diff --git a/src/devices/sound/sp0256.h b/src/devices/sound/sp0256.h index a721d4b8854..4b13885e92c 100644 --- a/src/devices/sound/sp0256.h +++ b/src/devices/sound/sp0256.h @@ -45,12 +45,12 @@ struct lpc12_t { int rpt, cnt; /* Repeat counter, Period down-counter. */ - UINT32 per, rng; /* Period, Amplitude, Random Number Generator */ + uint32_t per, rng; /* Period, Amplitude, Random Number Generator */ int amp; - INT16 f_coef[6]; /* F0 through F5. */ - INT16 b_coef[6]; /* B0 through B5. */ - INT16 z_data[6][2]; /* Time-delay data for the filter stages. */ - UINT8 r[16]; /* The encoded register set. */ + int16_t f_coef[6]; /* F0 through F5. */ + int16_t b_coef[6]; /* B0 through B5. */ + int16_t z_data[6][2]; /* Time-delay data for the filter stages. */ + uint8_t r[16]; /* The encoded register set. */ int interp; }; @@ -58,7 +58,7 @@ class sp0256_device : public device_t, public device_sound_interface { public: - sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~sp0256_device() { } template static devcb_base &set_data_request_callback(device_t &device, _Object object) { return downcast(device).m_drq_cb.set_callback(object); } @@ -72,7 +72,7 @@ public: TIMER_CALLBACK_MEMBER(set_lrq_timer_proc); void set_clock(int clock); - void bitrevbuff(UINT8 *buffer, unsigned int start, unsigned int length); + void bitrevbuff(uint8_t *buffer, unsigned int start, unsigned int length); protected: // device-level overrides @@ -83,9 +83,9 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; private: - UINT32 getb(int len); + uint32_t getb(int len); void micro(); - required_region_ptr m_rom; /* 64K ROM. */ + required_region_ptr m_rom; /* 64K ROM. */ sound_stream *m_stream; /* MAME core sound stream */ devcb_write_line m_drq_cb; /* Data request callback */ devcb_write_line m_sby_cb; /* Standby callback */ @@ -95,9 +95,9 @@ private: int m_silent; /* Flag: SP0256 is silent. */ - std::unique_ptr m_scratch; /* Scratch buffer for audio. */ - UINT32 m_sc_head; /* Head pointer into scratch circular buf */ - UINT32 m_sc_tail; /* Tail pointer into scratch circular buf */ + std::unique_ptr m_scratch; /* Scratch buffer for audio. */ + uint32_t m_sc_head; /* Head pointer into scratch circular buf */ + uint32_t m_sc_tail; /* Tail pointer into scratch circular buf */ struct lpc12_t m_filt; /* 12-pole filter */ int m_lrq; /* Load ReQuest. == 0 if we can accept a load */ @@ -106,13 +106,13 @@ private: int m_stack; /* Microcontroller's PC stack. */ int m_fifo_sel; /* True when executing from FIFO. */ int m_halted; /* True when CPU is halted. */ - UINT32 m_mode; /* Mode register. */ - UINT32 m_page; /* Page set by SETPAGE */ + uint32_t m_mode; /* Mode register. */ + uint32_t m_page; /* Page set by SETPAGE */ - UINT32 m_fifo_head; /* FIFO head pointer (where new data goes). */ - UINT32 m_fifo_tail; /* FIFO tail pointer (where data comes from). */ - UINT32 m_fifo_bitp; /* FIFO bit-pointer (for partial decles). */ - UINT16 m_fifo[64]; /* The 64-decle FIFO. */ + uint32_t m_fifo_head; /* FIFO head pointer (where new data goes). */ + uint32_t m_fifo_tail; /* FIFO tail pointer (where data comes from). */ + uint32_t m_fifo_bitp; /* FIFO bit-pointer (for partial decles). */ + uint16_t m_fifo[64]; /* The 64-decle FIFO. */ emu_timer *m_lrq_timer; }; diff --git a/src/devices/sound/speaker.cpp b/src/devices/sound/speaker.cpp index 7872351a0e3..4ddb9548a6b 100644 --- a/src/devices/sound/speaker.cpp +++ b/src/devices/sound/speaker.cpp @@ -75,7 +75,7 @@ #include "emu.h" #include "sound/speaker.h" -static const INT16 default_levels[2] = {0, 32767}; +static const int16_t default_levels[2] = {0, 32767}; // Internal oversampling factor (interm. samples vs stream samples) static const int RATE_MULTIPLIER = 4; @@ -83,7 +83,7 @@ static const int RATE_MULTIPLIER = 4; const device_type SPEAKER_SOUND = &device_creator; -speaker_sound_device::speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +speaker_sound_device::speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SPEAKER_SOUND, "Filtered 1-bit DAC", tag, owner, clock, "speaker_sound", __FILE__), device_sound_interface(mconfig, *this), m_num_levels(2), diff --git a/src/devices/sound/speaker.h b/src/devices/sound/speaker.h index 8b2bce895d0..a2286cee14d 100644 --- a/src/devices/sound/speaker.h +++ b/src/devices/sound/speaker.h @@ -26,11 +26,11 @@ class speaker_sound_device : public device_t, public device_sound_interface { public: - speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~speaker_sound_device() {} // static configuration - static void static_set_levels(device_t &device, int num_levels, const INT16 *levels) { downcast(device).m_num_levels = num_levels; downcast(device).m_levels = levels;} + static void static_set_levels(device_t &device, int num_levels, const int16_t *levels) { downcast(device).m_num_levels = num_levels; downcast(device).m_levels = levels;} void level_w(int new_level); @@ -84,7 +84,7 @@ private: double m_prevx, m_prevy; int m_num_levels; /* optional: number of levels (if not two) */ - const INT16 *m_levels; /* optional: pointer to level lookup table */ + const int16_t *m_levels; /* optional: pointer to level lookup table */ }; extern const device_type SPEAKER_SOUND; diff --git a/src/devices/sound/spu.cpp b/src/devices/sound/spu.cpp index b4e585a211a..a222a5626de 100644 --- a/src/devices/sound/spu.cpp +++ b/src/devices/sound/spu.cpp @@ -456,7 +456,7 @@ struct spu_device::voiceinfo inloopcache, forceloop, _pad; - INT64 keyontime; + int64_t keyontime; }; // @@ -475,7 +475,7 @@ public: *prev; }; - std::vector buffer; + std::vector buffer; unsigned int head, tail, in, @@ -954,7 +954,7 @@ static int shift_register15(int &shift) // spu_device - constructor //------------------------------------------------- -spu_device::spu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +spu_device::spu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SPU, "SPU", tag, owner, clock, "spu", __FILE__), device_sound_interface(mconfig, *this), m_irq_handler(*this), @@ -1455,14 +1455,14 @@ void spu_device::update_voice_events(voiceinfo *vi) { // Calculate time until end of sample in output samples - vi->samplestoend=(unsigned int)((((INT64)(vi->play.cache->dend-vi->play.ptr)<<12)-vi->dptr)+(vi->pitch-1))/vi->pitch; + vi->samplestoend=(unsigned int)((((int64_t)(vi->play.cache->dend-vi->play.ptr)<<12)-vi->dptr)+(vi->pitch-1))/vi->pitch; if (vi->inloopcache) { // Voice is inside loop cache, return time until end of that if lower assert(vi->lcptrloop_cache->len); vi->samplestoend=min(vi->samplestoend, - (unsigned int)((((INT64)(vi->loop_cache->len-vi->lcptr)<<12)-vi->dptr)+(vi->pitch-1))/vi->pitch); + (unsigned int)((((int64_t)(vi->loop_cache->len-vi->lcptr)<<12)-vi->dptr)+(vi->pitch-1))/vi->pitch); } // Calculate time until next IRQ in output samples @@ -1472,7 +1472,7 @@ void spu_device::update_voice_events(voiceinfo *vi) { // Convert IRQ input sample distance to output samples - vi->samplestoirq=(unsigned int)(((((INT64)irqdist)<<12)-vi->dptr)+(vi->pitch-1))/vi->pitch; + vi->samplestoirq=(unsigned int)(((((int64_t)irqdist)<<12)-vi->dptr)+(vi->pitch-1))/vi->pitch; } else { vi->samplestoirq=spu_infinity; @@ -1894,7 +1894,7 @@ void spu_device::generate_voice(const unsigned int v, if (noiseptr) { - INT64 dptr=((INT64)n*vi->pitch)+vi->dptr; + int64_t dptr=((int64_t)n*vi->pitch)+vi->dptr; unsigned int d=(unsigned int)(dptr>>12); vi->dptr=(unsigned int)(dptr&0xfff); vi->play.ptr+=d; @@ -1950,7 +1950,7 @@ void spu_device::generate_voice(const unsigned int v, // Linear interpolation enabled, calculate how many samples we will // read from input data - INT64 fracend=(((INT64)(n-1))*vi->pitch)+dptr; + int64_t fracend=(((int64_t)(n-1))*vi->pitch)+dptr; unsigned int end=(unsigned int)(fracend>>12); // Get pointer to last sample of input data @@ -2470,8 +2470,8 @@ void spu_device::generate_cdda(void *ptr, const unsigned int sz) while ((cdda_buffer->get_bytes_in()) && (n--)) { - INT16 vl = ((sp[0]*voll)>>15); - INT16 vr = ((sp[1]*volr)>>15); + int16_t vl = ((sp[0]*voll)>>15); + int16_t vr = ((sp[1]*volr)>>15); // if the volume adjusted samples are stored here, vibribbon does nothing *(signed short *)(spu_ram+m_cd_out_ptr)=sp[0]; @@ -2507,8 +2507,8 @@ void spu_device::generate_cdda(void *ptr, const unsigned int sz) } else if(((spureg.irq_addr << 3) < 0x800) && (spureg.ctrl & spuctrl_irq_enable)) { - UINT16 irq_addr = (spureg.irq_addr << 3) & ~0x400; - UINT32 end = m_cd_out_ptr + (sz >> 1); + uint16_t irq_addr = (spureg.irq_addr << 3) & ~0x400; + uint32_t end = m_cd_out_ptr + (sz >> 1); if(((m_cd_out_ptr < irq_addr) && (end > irq_addr)) || ((m_cd_out_ptr > (end & 0x3ff)) && ((end & 0x3ff) > irq_addr))) m_irq_handler(1); m_cd_out_ptr = end & 0x3fe; @@ -2773,12 +2773,12 @@ void spu_device::update_timing() void spu_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { stream_sample_t *outL, *outR; - INT16 temp[44100], *src; + int16_t temp[44100], *src; outL = outputs[0]; outR = outputs[1]; - generate(temp, samples*4); // second parameter is bytes, * 2 (size of INT16) * 2 (stereo) + generate(temp, samples*4); // second parameter is bytes, * 2 (size of int16_t) * 2 (stereo) src = &temp[0]; for (int i = 0; i < samples; i++) @@ -2792,9 +2792,9 @@ void spu_device::sound_stream_update(sound_stream &stream, stream_sample_t **inp // // -void spu_device::start_dma(UINT8 *mainram, bool to_spu, UINT32 size) +void spu_device::start_dma(uint8_t *mainram, bool to_spu, uint32_t size) { - UINT32 st=spureg.trans_addr<<3, en=st+size; + uint32_t st=spureg.trans_addr<<3, en=st+size; if (en>(512*1024)) { @@ -3064,16 +3064,16 @@ void spu_device::flush_cdda(const unsigned int sector) } } -void spu_device::dma_read( UINT32 *p_n_ram, UINT32 n_address, INT32 n_size ) +void spu_device::dma_read( uint32_t *p_n_ram, uint32_t n_address, int32_t n_size ) { - UINT8 *psxram = (UINT8 *)p_n_ram; + uint8_t *psxram = (uint8_t *)p_n_ram; start_dma(psxram + n_address, false, n_size*4); } -void spu_device::dma_write( UINT32 *p_n_ram, UINT32 n_address, INT32 n_size ) +void spu_device::dma_write( uint32_t *p_n_ram, uint32_t n_address, int32_t n_size ) { - UINT8 *psxram = (UINT8 *)p_n_ram; + uint8_t *psxram = (uint8_t *)p_n_ram; // printf("SPU DMA write from %x, size %x\n", n_address, n_size); diff --git a/src/devices/sound/spu.h b/src/devices/sound/spu.h index 8cb1e461b95..019b49426fc 100644 --- a/src/devices/sound/spu.h +++ b/src/devices/sound/spu.h @@ -70,7 +70,7 @@ protected: cur_generate_sample, dirty_flags; - UINT16 m_cd_out_ptr; + uint16_t m_cd_out_ptr; signed short xa_last[4]; bool status_enabled, @@ -221,18 +221,18 @@ protected: static reverb_preset *find_reverb_preset(const unsigned short *param); public: - spu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + spu_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); } - void dma_read( UINT32 *ram, UINT32 n_address, INT32 n_size ); - void dma_write( UINT32 *ram, UINT32 n_address, INT32 n_size ); + void dma_read( uint32_t *ram, uint32_t n_address, int32_t n_size ); + void dma_write( uint32_t *ram, uint32_t n_address, int32_t n_size ); void reinit_sound(); void kill_sound(); - void start_dma(UINT8 *mainram, bool to_spu, UINT32 size); + void start_dma(uint8_t *mainram, bool to_spu, uint32_t size); bool play_xa(const unsigned int sector, const unsigned char *sec); bool play_cdda(const unsigned int sector, const unsigned char *sec); void flush_xa(const unsigned int sector=0); diff --git a/src/devices/sound/st0016.cpp b/src/devices/sound/st0016.cpp index 59a2c3bdc7d..e4bfdadd959 100644 --- a/src/devices/sound/st0016.cpp +++ b/src/devices/sound/st0016.cpp @@ -24,7 +24,7 @@ const device_type ST0016 = &device_creator; // st0016_device - constructor //------------------------------------------------- -st0016_device::st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +st0016_device::st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ST0016, "ST0016 (Audio)", tag, owner, clock, "st0016_audio", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -33,7 +33,7 @@ st0016_device::st0016_device(const machine_config &mconfig, const char *tag, dev memset(m_vpos, 0, sizeof(int)*8); memset(m_frac, 0, sizeof(int)*8); memset(m_lponce, 0, sizeof(int)*8); - memset(m_regs, 0, sizeof(UINT8)*0x100); + memset(m_regs, 0, sizeof(uint8_t)*0x100); } @@ -61,9 +61,9 @@ void st0016_device::sound_stream_update(sound_stream &stream, stream_sample_t ** { int v, i, snum; unsigned char *slot; - INT32 mix[48000*2]; - INT32 *mixp; - INT16 sample; + int32_t mix[48000*2]; + int32_t *mixp; + int16_t sample; int sptr, eptr, freq, lsptr, leptr; memset(mix, 0, sizeof(mix[0])*samples*2); diff --git a/src/devices/sound/st0016.h b/src/devices/sound/st0016.h index 6eb9f521ef6..8a621d0114a 100644 --- a/src/devices/sound/st0016.h +++ b/src/devices/sound/st0016.h @@ -23,7 +23,7 @@ class st0016_device : public device_t, public device_sound_interface { public: - st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~st0016_device() { } template static devcb_base &set_soundram_callback(device_t &device, _Object object) { return downcast(device).m_ram_read_cb.set_callback(object); } @@ -45,7 +45,7 @@ private: int m_vpos[8]; int m_frac[8]; int m_lponce[8]; - UINT8 m_regs[0x100]; + uint8_t m_regs[0x100]; }; extern const device_type ST0016; diff --git a/src/devices/sound/t6721a.cpp b/src/devices/sound/t6721a.cpp index d5c48f89e4b..2ad0f4f7e76 100644 --- a/src/devices/sound/t6721a.cpp +++ b/src/devices/sound/t6721a.cpp @@ -35,7 +35,7 @@ const device_type T6721A = &device_creator; // t6721a_device - constructor //------------------------------------------------- -t6721a_device::t6721a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +t6721a_device::t6721a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, T6721A, "T6721A", tag, owner, clock, "t6721a", __FILE__), device_sound_interface(mconfig, *this), m_write_eos(*this), diff --git a/src/devices/sound/t6721a.h b/src/devices/sound/t6721a.h index 51f952cdf80..784050ab553 100644 --- a/src/devices/sound/t6721a.h +++ b/src/devices/sound/t6721a.h @@ -67,7 +67,7 @@ class t6721a_device : public device_t, public device_sound_interface { public: - t6721a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + t6721a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers template void set_eos_callback(_eos eos) { m_write_eos.set_callback(eos); } diff --git a/src/devices/sound/t6w28.cpp b/src/devices/sound/t6w28.cpp index 25303ec4f1b..7fe2260516b 100644 --- a/src/devices/sound/t6w28.cpp +++ b/src/devices/sound/t6w28.cpp @@ -349,7 +349,7 @@ void t6w28_device::set_enable(bool enable) const device_type T6W28 = &device_creator; -t6w28_device::t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +t6w28_device::t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, T6W28, "T6W28", tag, owner, clock, "t6w28", __FILE__), device_sound_interface(mconfig, *this) { diff --git a/src/devices/sound/t6w28.h b/src/devices/sound/t6w28.h index 7e3cc39f7e4..e40a41e4401 100644 --- a/src/devices/sound/t6w28.h +++ b/src/devices/sound/t6w28.h @@ -9,7 +9,7 @@ class t6w28_device : public device_t, public device_sound_interface { public: - t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( write ); void set_enable( bool enable ); @@ -27,17 +27,17 @@ private: sound_stream *m_channel; int m_sample_rate; int m_vol_table[16]; /* volume table */ - INT32 m_register[16]; /* registers */ - INT32 m_last_register[2]; /* last register written */ - INT32 m_volume[8]; /* volume of voice 0-2 and noise */ - UINT32 m_rng[2]; /* noise generator */ - INT32 m_noise_mode[2]; /* active noise mode */ - INT32 m_feedback_mask; /* mask for feedback */ - INT32 m_whitenoise_taps; /* mask for white noise taps */ - INT32 m_whitenoise_invert; /* white noise invert flag */ - INT32 m_period[8]; - INT32 m_count[8]; - INT32 m_output[8]; + int32_t m_register[16]; /* registers */ + int32_t m_last_register[2]; /* last register written */ + int32_t m_volume[8]; /* volume of voice 0-2 and noise */ + uint32_t m_rng[2]; /* noise generator */ + int32_t m_noise_mode[2]; /* active noise mode */ + int32_t m_feedback_mask; /* mask for feedback */ + int32_t m_whitenoise_taps; /* mask for white noise taps */ + int32_t m_whitenoise_invert; /* white noise invert flag */ + int32_t m_period[8]; + int32_t m_count[8]; + int32_t m_output[8]; bool m_enabled; }; diff --git a/src/devices/sound/tc8830f.cpp b/src/devices/sound/tc8830f.cpp index 1db6ab5bad4..2c862824d29 100644 --- a/src/devices/sound/tc8830f.cpp +++ b/src/devices/sound/tc8830f.cpp @@ -24,7 +24,7 @@ // device type definition const device_type TC8830F = &device_creator; -tc8830f_device::tc8830f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tc8830f_device::tc8830f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC8830F, "TC8830F", tag, owner, clock, "tc8830f", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), m_playing(false), @@ -81,7 +81,7 @@ void tc8830f_device::device_clock_changed() void tc8830f_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - INT32 mix = 0; + int32_t mix = 0; for (int i = 0; i < samples; i++) { @@ -149,7 +149,7 @@ void tc8830f_device::reset() } -void tc8830f_device::write_p(UINT8 data) +void tc8830f_device::write_p(uint8_t data) { m_stream->update(); data &= 0xf; @@ -231,7 +231,7 @@ void tc8830f_device::write_p(UINT8 data) m_phrase = (m_phrase & 0x0f) | (data << 4 & 0x30); // update addresses and start - UINT8 offs = m_phrase * 4; + uint8_t offs = m_phrase * 4; m_address = (m_mem[offs] | m_mem[offs|1]<<8 | m_mem[offs|2]<<16) & m_mem.mask(); offs += 4; m_stop_address = (m_mem[offs] | m_mem[offs|1]<<8 | m_mem[offs|2]<<16) & m_mem.mask(); diff --git a/src/devices/sound/tc8830f.h b/src/devices/sound/tc8830f.h index 7b7059152ca..b34c9c35110 100644 --- a/src/devices/sound/tc8830f.h +++ b/src/devices/sound/tc8830f.h @@ -32,10 +32,10 @@ class tc8830f_device : public device_t, { public: // construction/destruction - tc8830f_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tc8830f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void reset(); - void write_p(UINT8 data); + void write_p(uint8_t data); sound_stream *m_stream; @@ -49,18 +49,18 @@ protected: private: bool m_playing; - UINT32 m_address; - UINT32 m_stop_address; - UINT8 m_bitcount; - UINT8 m_bitrate; - UINT8 m_prevbits; + uint32_t m_address; + uint32_t m_stop_address; + uint8_t m_bitcount; + uint8_t m_bitrate; + uint8_t m_prevbits; int m_delta; int m_output; - UINT8 m_command; + uint8_t m_command; int m_cmd_rw; - UINT8 m_phrase; + uint8_t m_phrase; - required_region_ptr m_mem; + required_region_ptr m_mem; }; diff --git a/src/devices/sound/tiaintf.cpp b/src/devices/sound/tiaintf.cpp index a16fe0698dc..f2158d8941b 100644 --- a/src/devices/sound/tiaintf.cpp +++ b/src/devices/sound/tiaintf.cpp @@ -16,7 +16,7 @@ const device_type TIA = &device_creator; // tia_device - constructor //------------------------------------------------- -tia_device::tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tia_device::tia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TIA, "TIA", tag, owner, clock, "tia_sound", __FILE__), device_sound_interface(mconfig, *this), m_channel(nullptr), diff --git a/src/devices/sound/tiaintf.h b/src/devices/sound/tiaintf.h index 37d9f276459..1995b2f55c6 100644 --- a/src/devices/sound/tiaintf.h +++ b/src/devices/sound/tiaintf.h @@ -25,7 +25,7 @@ class tia_device : public device_t, public device_sound_interface { public: - tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tia_device() { } protected: diff --git a/src/devices/sound/tiasound.cpp b/src/devices/sound/tiasound.cpp index 71b7b5a107e..944f6aa33d1 100644 --- a/src/devices/sound/tiasound.cpp +++ b/src/devices/sound/tiasound.cpp @@ -91,11 +91,11 @@ struct tia { /* structures to hold the 6 tia sound control bytes */ - UINT8 AUDC[2]; /* AUDCx (15, 16) */ - UINT8 AUDF[2]; /* AUDFx (17, 18) */ - INT16 AUDV[2]; /* AUDVx (19, 1A) */ + uint8_t AUDC[2]; /* AUDCx (15, 16) */ + uint8_t AUDF[2]; /* AUDFx (17, 18) */ + int16_t AUDV[2]; /* AUDVx (19, 1A) */ - INT16 Outvol[2]; /* last output volume for each channel */ + int16_t Outvol[2]; /* last output volume for each channel */ int tia_gain; /* initialized in tia_sound_init() */ @@ -108,26 +108,26 @@ struct tia /* HJB: poly bits are initialized at runtime */ - UINT8 Bit4[POLY4_SIZE]; - UINT8 Bit5[POLY5_SIZE]; - UINT8 Bit9[POLY9_SIZE]; + uint8_t Bit4[POLY4_SIZE]; + uint8_t Bit5[POLY5_SIZE]; + uint8_t Bit9[POLY9_SIZE]; - UINT8 P4[2]; /* Position pointer for the 4-bit POLY array */ - UINT8 P5[2]; /* Position pointer for the 5-bit POLY array */ - UINT16 P9[2]; /* Position pointer for the 9-bit POLY array */ + uint8_t P4[2]; /* Position pointer for the 4-bit POLY array */ + uint8_t P5[2]; /* Position pointer for the 5-bit POLY array */ + uint16_t P9[2]; /* Position pointer for the 9-bit POLY array */ - UINT8 Div_n_cnt[2]; /* Divide by n counter. one for each channel */ - UINT8 Div_n_max[2]; /* Divide by n maximum, one for each channel */ - UINT8 Div_3_cnt[2]; /* Div 3 counter, used for POLY5_DIV3 mode */ + uint8_t Div_n_cnt[2]; /* Divide by n counter. one for each channel */ + uint8_t Div_n_max[2]; /* Divide by n maximum, one for each channel */ + uint8_t Div_3_cnt[2]; /* Div 3 counter, used for POLY5_DIV3 mode */ /* In my routines, I treat the sample output as another divide by N counter. */ /* For better accuracy, the Samp_n_cnt has a fixed binary decimal point */ /* which has 8 binary digits to the right of the decimal point. */ - UINT16 Samp_n_max; /* Sample max, multiplied by 256 */ - UINT16 Samp_n_cnt; /* Sample cnt. */ + uint16_t Samp_n_max; /* Sample max, multiplied by 256 */ + uint16_t Samp_n_cnt; /* Sample cnt. */ int oversampling; /* Added oversampling for sample_rate > clock_rate */ }; @@ -138,7 +138,7 @@ struct tia /* has a 13:18 ratio (of course, 13+18 = 31). This could also be */ /* implemented by using counters. */ -static const UINT8 Div31[POLY5_SIZE] = +static const uint8_t Div31[POLY5_SIZE] = {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -159,11 +159,11 @@ static const UINT8 Div31[POLY5_SIZE] = /* */ /*****************************************************************************/ -void tia_write(void *_chip, offs_t offset, UINT8 data) +void tia_write(void *_chip, offs_t offset, uint8_t data) { struct tia *chip = (struct tia *)_chip; - UINT16 new_val; - UINT8 chan; + uint16_t new_val; + uint8_t chan; /* determine which address was changed */ switch (offset) @@ -263,10 +263,10 @@ void tia_write(void *_chip, offs_t offset, UINT8 data) void tia_process(void *_chip, stream_sample_t *buffer, int length) { struct tia *chip = (struct tia *)_chip; - UINT8 audc0, audc1; - UINT8 div_n_cnt0, div_n_cnt1; - UINT8 p5_0, p5_1; - INT16 audv0, audv1, outvol_0, outvol_1; + uint8_t audc0, audc1; + uint8_t div_n_cnt0, div_n_cnt1; + uint8_t p5_0, p5_1; + int16_t audv0, audv1, outvol_0, outvol_1; audc0 = chip->AUDC[0]; audc1 = chip->AUDC[1]; @@ -513,7 +513,7 @@ void tia_process(void *_chip, stream_sample_t *buffer, int length) } -static void poly_init(UINT8 *poly, int size, int f0, int f1) +static void poly_init(uint8_t *poly, int size, int f0, int f1) { int mask = (1 << size) - 1; int i, x = mask; @@ -575,12 +575,12 @@ void *tia_sound_init(device_t *device, int clock, int sample_rate, int gain) poly_init(chip->Bit9, 9, 9, 5); /* calculate the sample 'divide by N' value based on the playback freq. */ - chip->Samp_n_max = ((UINT16)(UINT32)clock << 8) / sample_rate; + chip->Samp_n_max = ((uint16_t)(uint32_t)clock << 8) / sample_rate; chip->Samp_n_cnt = chip->Samp_n_max; /* initialize all bits of the sample counter */ if (chip->Samp_n_max < 256) /* we need to use oversampling for sample_rate > clock_rate */ { - chip->Samp_n_max = ((UINT16)(UINT32)sample_rate << 8) / clock; + chip->Samp_n_max = ((uint16_t)(uint32_t)sample_rate << 8) / clock; chip->Samp_n_cnt = chip->Samp_n_max; chip->oversampling = 1; } diff --git a/src/devices/sound/tiasound.h b/src/devices/sound/tiasound.h index a73b63c9cbe..522e95b85ab 100644 --- a/src/devices/sound/tiasound.h +++ b/src/devices/sound/tiasound.h @@ -42,6 +42,6 @@ void *tia_sound_init(device_t *device, int clock, int sample_rate, int gain); void tia_sound_free(void *chip); void tia_process (void *chip, stream_sample_t *buffer, int length); -void tia_write(void *chip, offs_t offset, UINT8 data); +void tia_write(void *chip, offs_t offset, uint8_t data); #endif /* __TIASOUND_H__ */ diff --git a/src/devices/sound/tms3615.cpp b/src/devices/sound/tms3615.cpp index a37cc81a654..ae39d751db6 100644 --- a/src/devices/sound/tms3615.cpp +++ b/src/devices/sound/tms3615.cpp @@ -21,7 +21,7 @@ const device_type TMS3615 = &device_creator; // tms3615_device - constructor //------------------------------------------------- -tms3615_device::tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms3615_device::tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS3615, "TMS3615", tag, owner, clock, "tms3615", __FILE__), device_sound_interface(mconfig, *this), m_channel(nullptr), diff --git a/src/devices/sound/tms3615.h b/src/devices/sound/tms3615.h index 33f561b114f..71ca5ac080e 100644 --- a/src/devices/sound/tms3615.h +++ b/src/devices/sound/tms3615.h @@ -31,7 +31,7 @@ class tms3615_device : public device_t, public device_sound_interface { public: - tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tms3615_device() { } protected: diff --git a/src/devices/sound/tms36xx.cpp b/src/devices/sound/tms36xx.cpp index d8052d7651a..5f1a8db2def 100644 --- a/src/devices/sound/tms36xx.cpp +++ b/src/devices/sound/tms36xx.cpp @@ -320,7 +320,7 @@ const device_type TMS36XX = &device_creator; // tms36xx_device - constructor //------------------------------------------------- -tms36xx_device::tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms36xx_device::tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS36XX, "TMS36XX", tag, owner, clock, "tms36xx", __FILE__), device_sound_interface(mconfig, *this), m_subtype(nullptr), diff --git a/src/devices/sound/tms36xx.h b/src/devices/sound/tms36xx.h index 8bb13316771..21a1365b150 100644 --- a/src/devices/sound/tms36xx.h +++ b/src/devices/sound/tms36xx.h @@ -43,7 +43,7 @@ class tms36xx_device : public device_t, public device_sound_interface { public: - tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tms36xx_device() { } static void set_subtype(device_t &device, int type) diff --git a/src/devices/sound/tms5110.cpp b/src/devices/sound/tms5110.cpp index 709c23d0a92..3112e80076b 100644 --- a/src/devices/sound/tms5110.cpp +++ b/src/devices/sound/tms5110.cpp @@ -65,7 +65,7 @@ #include "emu.h" #include "tms5110.h" -static INT16 clip_analog(INT16 cliptemp); +static int16_t clip_analog(int16_t cliptemp); /* *****optional defines***** */ @@ -176,7 +176,7 @@ void tms5110_device::set_variant(int variant) m_variant = variant; } -void tms5110_device::new_int_write(UINT8 rc, UINT8 m0, UINT8 m1, UINT8 addr) +void tms5110_device::new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr) { if (!m_m0_cb.isnull()) m_m0_cb(m0); @@ -191,7 +191,7 @@ void tms5110_device::new_int_write(UINT8 rc, UINT8 m0, UINT8 m1, UINT8 addr) } } -void tms5110_device::new_int_write_addr(UINT8 addr) +void tms5110_device::new_int_write_addr(uint8_t addr) { new_int_write(1, 0, 1, addr); // romclk 1, m0 0, m1 1, addr bus nybble = xxxx new_int_write(0, 0, 1, addr); // romclk 0, m0 0, m1 1, addr bus nybble = xxxx @@ -199,7 +199,7 @@ void tms5110_device::new_int_write_addr(UINT8 addr) new_int_write(0, 0, 0, addr); // romclk 0, m0 0, m1 0, addr bus nybble = xxxx } -UINT8 tms5110_device::new_int_read() +uint8_t tms5110_device::new_int_read() { new_int_write(1, 1, 0, 0); // romclk 1, m0 1, m1 0, addr bus nybble = 0/open bus new_int_write(0, 1, 0, 0); // romclk 0, m0 1, m1 0, addr bus nybble = 0/open bus @@ -348,11 +348,11 @@ void tms5110_device::perform_dummy_read() ***********************************************************************************************/ -void tms5110_device::process(INT16 *buffer, unsigned int size) +void tms5110_device::process(int16_t *buffer, unsigned int size) { int buf_count=0; int i, bitout; - INT32 this_sample; + int32_t this_sample; /* loop until the buffer is full or we've stopped speaking */ while (size > 0) @@ -501,9 +501,9 @@ void tms5110_device::process(INT16 *buffer, unsigned int size) * disabled, forcing all samples beyond 51d to be == 51d */ if (m_pitch_count >= 51) - m_excitation_data = (INT8)m_coeff->chirptable[51]; + m_excitation_data = (int8_t)m_coeff->chirptable[51]; else /*m_pitch_count < 51*/ - m_excitation_data = (INT8)m_coeff->chirptable[m_pitch_count]; + m_excitation_data = (int8_t)m_coeff->chirptable[m_pitch_count]; } // Update LFSR *20* times every sample (once per T cycle), like patent shows @@ -627,7 +627,7 @@ void tms5110_device::process(INT16 *buffer, unsigned int size) ***********************************************************************************************/ -static INT16 clip_analog(INT16 cliptemp) +static int16_t clip_analog(int16_t cliptemp) { /* clipping, just like the patent shows: * the top 10 bits of this result are visible on the digital output IO pin. @@ -669,9 +669,9 @@ static INT16 clip_analog(INT16 cliptemp) output, this makes almost no difference in the computation. **********************************************************************************************/ -static INT32 matrix_multiply(INT32 a, INT32 b) +static int32_t matrix_multiply(int32_t a, int32_t b) { - INT32 result; + int32_t result; while (a>511) { a-=1024; } while (a<-512) { a+=1024; } while (b>16383) { b-=32768; } @@ -692,7 +692,7 @@ static INT32 matrix_multiply(INT32 a, INT32 b) ***********************************************************************************************/ -INT32 tms5110_device::lattice_filter() +int32_t tms5110_device::lattice_filter() { // Lattice filter here // Aug/05/07: redone as unrolled loop, for clarity - LN @@ -727,7 +727,7 @@ INT32 tms5110_device::lattice_filter() m_u[1] = m_u[2] - matrix_multiply(m_current_k[1], m_x[1]); m_u[0] = m_u[1] - matrix_multiply(m_current_k[0], m_x[0]); #ifdef DEBUG_LATTICE - INT32 err = m_x[9] + matrix_multiply(m_current_k[9], m_u[9]); //x_10, real chip doesn't use or calculate this + int32_t err = m_x[9] + matrix_multiply(m_current_k[9], m_u[9]); //x_10, real chip doesn't use or calculate this #endif m_x[9] = m_x[8] + matrix_multiply(m_current_k[8], m_u[8]); m_x[8] = m_x[7] + matrix_multiply(m_current_k[7], m_u[7]); @@ -1316,7 +1316,7 @@ READ8_MEMBER( tms5110_device::romclk_hack_r ) void tms5110_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - INT16 sample_data[MAX_SAMPLE_CHUNK]; + int16_t sample_data[MAX_SAMPLE_CHUNK]; stream_sample_t *buffer = outputs[0]; /* loop while we still have samples to generate */ @@ -1410,7 +1410,7 @@ void tmsprom_device::register_for_save_states() void tmsprom_device::update_prom_cnt() { - UINT8 prev_val = m_prom[m_prom_cnt] | 0x0200; + uint8_t prev_val = m_prom[m_prom_cnt] | 0x0200; if (m_enable && (prev_val & (1<; -tms5110_device::tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms5110_device::tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5110_device(mconfig, TMS5110, "TMS5110", tag, owner, clock, "tms5110", __FILE__) { } -tms5110_device::tms5110_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) +tms5110_device::tms5110_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_sound_interface(mconfig, *this) , m_table(*this, DEVICE_SELF) @@ -1543,56 +1543,56 @@ tms5110_device::tms5110_device(const machine_config &mconfig, device_type type, const device_type TMS5100 = &device_creator; -tms5100_device::tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms5100_device::tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5110_device(mconfig, TMS5100, "TMS5100", tag, owner, clock, "tms5100", __FILE__) { } const device_type TMC0281 = &device_creator; -tmc0281_device::tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmc0281_device::tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5110_device(mconfig, TMC0281, "TMC0281", tag, owner, clock, "tmc0281", __FILE__) { } const device_type TMS5100A = &device_creator; -tms5100a_device::tms5100a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms5100a_device::tms5100a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5110_device(mconfig, TMS5100A, "TMS5100A", tag, owner, clock, "tms5100a", __FILE__) { } const device_type TMC0281D = &device_creator; -tmc0281d_device::tmc0281d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmc0281d_device::tmc0281d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5110_device(mconfig, TMC0281D, "TMC0281D", tag, owner, clock, "tmc0281d", __FILE__) { } const device_type CD2801 = &device_creator; -cd2801_device::cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cd2801_device::cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5110_device(mconfig, CD2801, "CD2801", tag, owner, clock, "cd2801", __FILE__) { } const device_type CD2802 = &device_creator; -cd2802_device::cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cd2802_device::cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5110_device(mconfig, CD2802, "CD2802", tag, owner, clock, "cd2802", __FILE__) { } const device_type TMS5110A = &device_creator; -tms5110a_device::tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms5110a_device::tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5110_device(mconfig, TMS5110A, "TMS5110A", tag, owner, clock, "tms5110a", __FILE__) { } const device_type M58817 = &device_creator; -m58817_device::m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m58817_device::m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5110_device(mconfig, M58817, "M58817", tag, owner, clock, "m58817", __FILE__) { } @@ -1600,7 +1600,7 @@ m58817_device::m58817_device(const machine_config &mconfig, const char *tag, dev const device_type TMSPROM = &device_creator; -tmsprom_device::tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tmsprom_device::tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMSPROM, "TMSPROM", tag, owner, clock, "tmsprom", __FILE__), m_rom(*this, DEVICE_SELF), m_prom(*this, finder_base::DUMMY_TAG, 0x20), diff --git a/src/devices/sound/tms5110.h b/src/devices/sound/tms5110.h index 8cba11e64f3..ac7ec87d1d4 100644 --- a/src/devices/sound/tms5110.h +++ b/src/devices/sound/tms5110.h @@ -46,8 +46,8 @@ class tms5110_device : public device_t, public device_sound_interface { public: - tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms5110_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); + tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms5110_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_m0_callback(device_t &device, _Object object) { return downcast(device).m_m0_cb.set_callback(object); } template static devcb_base &set_m1_callback(device_t &device, _Object object) { return downcast(device).m_m1_cb.set_callback(object); } @@ -78,27 +78,27 @@ protected: void set_variant(int variant); - UINT8 m_SPEN; /* set on speak command, cleared on stop command or reset command */ - UINT8 m_TALK; /* set on SPEN & RESETL4(pc12->pc0 transition), cleared on stop command or reset command */ + uint8_t m_SPEN; /* set on speak command, cleared on stop command or reset command */ + uint8_t m_TALK; /* set on SPEN & RESETL4(pc12->pc0 transition), cleared on stop command or reset command */ #define TALK_STATUS (m_SPEN|m_TALKD) - UINT8 m_TALKD; /* TALK(TCON) value, latched every RESETL4 */ + uint8_t m_TALKD; /* TALK(TCON) value, latched every RESETL4 */ sound_stream *m_stream; private: - void new_int_write(UINT8 rc, UINT8 m0, UINT8 m1, UINT8 addr); - void new_int_write_addr(UINT8 addr); - UINT8 new_int_read(); + void new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr); + void new_int_write_addr(uint8_t addr); + uint8_t new_int_read(); void register_for_save_states(); int extract_bits(int count); void perform_dummy_read(); - INT32 lattice_filter(); - void process(INT16 *buffer, unsigned int size); + int32_t lattice_filter(); + void process(int16_t *buffer, unsigned int size); void PDC_set(int data); void parse_frame(); // internal state /* table */ - optional_region_ptr m_table; + optional_region_ptr m_table; /* coefficient tables */ int m_variant; /* Variant of the 5110 - see tms5110.h */ @@ -107,17 +107,17 @@ private: const struct tms5100_coeffs *m_coeff; /* these contain global status bits */ - UINT8 m_PDC; - UINT8 m_CTL_pins; - UINT8 m_state; + uint8_t m_PDC; + uint8_t m_CTL_pins; + uint8_t m_state; /* Rom interface */ - UINT32 m_address; - UINT8 m_next_is_address; - UINT8 m_schedule_dummy_read; - UINT8 m_addr_bit; + uint32_t m_address; + uint8_t m_next_is_address; + uint8_t m_schedule_dummy_read; + uint8_t m_addr_bit; /* read byte */ - UINT8 m_CTL_buffer; + uint8_t m_CTL_buffer; /* callbacks */ devcb_write_line m_m0_cb; // the M0 line @@ -132,52 +132,52 @@ private: /* these contain data describing the current and previous voice frames */ #define OLD_FRAME_SILENCE_FLAG m_OLDE // 1 if E=0, 0 otherwise. #define OLD_FRAME_UNVOICED_FLAG m_OLDP // 1 if P=0 (unvoiced), 0 if voiced - UINT8 m_OLDE; - UINT8 m_OLDP; + uint8_t m_OLDE; + uint8_t m_OLDP; #define NEW_FRAME_STOP_FLAG (m_new_frame_energy_idx == 0xF) // 1 if this is a stop (Energy = 0xF) frame #define NEW_FRAME_SILENCE_FLAG (m_new_frame_energy_idx == 0) // ditto as above #define NEW_FRAME_UNVOICED_FLAG (m_new_frame_pitch_idx == 0) // ditto as above - UINT8 m_new_frame_energy_idx; - UINT8 m_new_frame_pitch_idx; - UINT8 m_new_frame_k_idx[10]; + uint8_t m_new_frame_energy_idx; + uint8_t m_new_frame_pitch_idx; + uint8_t m_new_frame_k_idx[10]; /* these are all used to contain the current state of the sound generation */ #ifndef PERFECT_INTERPOLATION_HACK - INT16 m_current_energy; - INT16 m_current_pitch; - INT16 m_current_k[10]; + int16_t m_current_energy; + int16_t m_current_pitch; + int16_t m_current_k[10]; #else - UINT8 m_old_frame_energy_idx; - UINT8 m_old_frame_pitch_idx; - UINT8 m_old_frame_k_idx[10]; - UINT8 m_old_zpar; - UINT8 m_old_uv_zpar; - - INT32 m_current_energy; - INT32 m_current_pitch; - INT32 m_current_k[10]; + uint8_t m_old_frame_energy_idx; + uint8_t m_old_frame_pitch_idx; + uint8_t m_old_frame_k_idx[10]; + uint8_t m_old_zpar; + uint8_t m_old_uv_zpar; + + int32_t m_current_energy; + int32_t m_current_pitch; + int32_t m_current_k[10]; #endif - UINT16 m_previous_energy; /* needed for lattice filter to match patent */ + uint16_t m_previous_energy; /* needed for lattice filter to match patent */ - UINT8 m_subcycle; /* contains the current subcycle for a given PC: 0 is A' (only used on SPKSLOW mode on 51xx), 1 is A, 2 is B */ - UINT8 m_subc_reload; /* contains 1 for normal speech, 0 when SPKSLOW is active */ - UINT8 m_PC; /* current parameter counter (what param is being interpolated), ranges from 0 to 12 */ + uint8_t m_subcycle; /* contains the current subcycle for a given PC: 0 is A' (only used on SPKSLOW mode on 51xx), 1 is A, 2 is B */ + uint8_t m_subc_reload; /* contains 1 for normal speech, 0 when SPKSLOW is active */ + uint8_t m_PC; /* current parameter counter (what param is being interpolated), ranges from 0 to 12 */ /* NOTE: the interpolation period counts 1,2,3,4,5,6,7,0 for divide by 8,8,8,4,4,2,2,1 */ - UINT8 m_IP; /* the current interpolation period */ - UINT8 m_inhibit; /* If 1, interpolation is inhibited until the DIV1 period */ - UINT8 m_uv_zpar; /* If 1, zero k5 thru k10 coefficients */ - UINT8 m_zpar; /* If 1, zero ALL parameters. */ - UINT8 m_pitch_zero; /* circuit 412; pitch is forced to zero under certain circumstances */ - UINT16 m_pitch_count; /* pitch counter; provides chirp rom address */ + uint8_t m_IP; /* the current interpolation period */ + uint8_t m_inhibit; /* If 1, interpolation is inhibited until the DIV1 period */ + uint8_t m_uv_zpar; /* If 1, zero k5 thru k10 coefficients */ + uint8_t m_zpar; /* If 1, zero ALL parameters. */ + uint8_t m_pitch_zero; /* circuit 412; pitch is forced to zero under certain circumstances */ + uint16_t m_pitch_count; /* pitch counter; provides chirp rom address */ - INT32 m_u[11]; - INT32 m_x[10]; + int32_t m_u[11]; + int32_t m_x[10]; - UINT16 m_RNG; /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 TODO: no it isn't */ - INT16 m_excitation_data; + uint16_t m_RNG; /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 TODO: no it isn't */ + int16_t m_excitation_data; /* The TMS51xx has two different ways of providing output data: the analog speaker pins (which were usually used) and the Digital I/O pin. @@ -186,12 +186,12 @@ private: resolution of the output data. TODO: add a way to set/reset this other than the FORCE_DIGITAL define */ - UINT8 m_digital_select; + uint8_t m_digital_select; - INT32 m_speech_rom_bitnum; + int32_t m_speech_rom_bitnum; - UINT8 m_romclk_hack_timer_started; - UINT8 m_romclk_hack_state; + uint8_t m_romclk_hack_timer_started; + uint8_t m_romclk_hack_state; emu_timer *m_romclk_hack_timer; }; @@ -201,7 +201,7 @@ extern const device_type TMS5110; class tms5100_device : public tms5110_device { public: - tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -212,7 +212,7 @@ extern const device_type TMS5100; class tmc0281_device : public tms5110_device { public: - tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -223,7 +223,7 @@ extern const device_type TMC0281; class tms5100a_device : public tms5110_device { public: - tms5100a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms5100a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -234,7 +234,7 @@ extern const device_type TMS5100A; class tmc0281d_device : public tms5110_device { public: - tmc0281d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmc0281d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -245,7 +245,7 @@ extern const device_type TMC0281D; class cd2801_device : public tms5110_device { public: - cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -256,7 +256,7 @@ extern const device_type CD2801; class cd2802_device : public tms5110_device { public: - cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -267,7 +267,7 @@ extern const device_type CD2802; class tms5110a_device : public tms5110_device { public: - tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -278,7 +278,7 @@ extern const device_type TMS5110A; class m58817_device : public tms5110_device { public: - m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( status_r ); @@ -296,17 +296,17 @@ extern const device_type M58817; class tmsprom_device : public device_t { public: - tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_region(device_t &device, const char *region) { downcast(device).m_prom.set_tag(region); } - static void set_rom_size(device_t &device, UINT32 rom_size) { downcast(device).m_rom_size = rom_size; } - static void set_pdc_bit(device_t &device, UINT8 pdc_bit) { downcast(device).m_pdc_bit = pdc_bit; } - static void set_ctl1_bit(device_t &device, UINT8 ctl1_bit) { downcast(device).m_ctl1_bit = ctl1_bit; } - static void set_ctl2_bit(device_t &device, UINT8 ctl2_bit) { downcast(device).m_ctl2_bit = ctl2_bit; } - static void set_ctl4_bit(device_t &device, UINT8 ctl4_bit) { downcast(device).m_ctl4_bit = ctl4_bit; } - static void set_ctl8_bit(device_t &device, UINT8 ctl8_bit) { downcast(device).m_ctl8_bit = ctl8_bit; } - static void set_reset_bit(device_t &device, UINT8 reset_bit) { downcast(device).m_reset_bit = reset_bit; } - static void set_stop_bit(device_t &device, UINT8 stop_bit) { downcast(device).m_stop_bit = stop_bit; } + static void set_rom_size(device_t &device, uint32_t rom_size) { downcast(device).m_rom_size = rom_size; } + static void set_pdc_bit(device_t &device, uint8_t pdc_bit) { downcast(device).m_pdc_bit = pdc_bit; } + static void set_ctl1_bit(device_t &device, uint8_t ctl1_bit) { downcast(device).m_ctl1_bit = ctl1_bit; } + static void set_ctl2_bit(device_t &device, uint8_t ctl2_bit) { downcast(device).m_ctl2_bit = ctl2_bit; } + static void set_ctl4_bit(device_t &device, uint8_t ctl4_bit) { downcast(device).m_ctl4_bit = ctl4_bit; } + static void set_ctl8_bit(device_t &device, uint8_t ctl8_bit) { downcast(device).m_ctl8_bit = ctl8_bit; } + static void set_reset_bit(device_t &device, uint8_t reset_bit) { downcast(device).m_reset_bit = reset_bit; } + static void set_stop_bit(device_t &device, uint8_t stop_bit) { downcast(device).m_stop_bit = stop_bit; } template static devcb_base &set_pdc_callback(device_t &device, _Object object) { return downcast(device).m_pdc_cb.set_callback(object); } template static devcb_base &set_ctl_callback(device_t &device, _Object object) { return downcast(device).m_ctl_cb.set_callback(object); } @@ -330,26 +330,26 @@ private: // internal state /* Rom interface */ - UINT32 m_address; + uint32_t m_address; /* ctl lines */ - UINT8 m_m0; - UINT8 m_enable; - UINT32 m_base_address; - UINT8 m_bit; + uint8_t m_m0; + uint8_t m_enable; + uint32_t m_base_address; + uint8_t m_bit; int m_prom_cnt; - required_region_ptr m_rom; - required_region_ptr m_prom; - UINT32 m_rom_size; /* individual rom_size */ - UINT8 m_pdc_bit; /* bit # of pdc line */ + required_region_ptr m_rom; + required_region_ptr m_prom; + uint32_t m_rom_size; /* individual rom_size */ + uint8_t m_pdc_bit; /* bit # of pdc line */ /* virtual bit 8: constant 0, virtual bit 9:constant 1 */ - UINT8 m_ctl1_bit; /* bit # of ctl1 line */ - UINT8 m_ctl2_bit; /* bit # of ctl2 line */ - UINT8 m_ctl4_bit; /* bit # of ctl4 line */ - UINT8 m_ctl8_bit; /* bit # of ctl8 line */ - UINT8 m_reset_bit; /* bit # of rom reset */ - UINT8 m_stop_bit; /* bit # of stop */ + uint8_t m_ctl1_bit; /* bit # of ctl1 line */ + uint8_t m_ctl2_bit; /* bit # of ctl2 line */ + uint8_t m_ctl4_bit; /* bit # of ctl4 line */ + uint8_t m_ctl8_bit; /* bit # of ctl8 line */ + uint8_t m_reset_bit; /* bit # of rom reset */ + uint8_t m_stop_bit; /* bit # of stop */ devcb_write_line m_pdc_cb; /* tms pdc func */ devcb_write8 m_ctl_cb; /* tms ctl func */ diff --git a/src/devices/sound/tms5110r.hxx b/src/devices/sound/tms5110r.hxx index 45fe4c984b2..6aea0f8c7e4 100644 --- a/src/devices/sound/tms5110r.hxx +++ b/src/devices/sound/tms5110r.hxx @@ -82,8 +82,8 @@ struct tms5100_coeffs unsigned short energytable[MAX_SCALE]; unsigned short pitchtable[MAX_SCALE]; int ktable[MAX_K][MAX_SCALE]; - INT16 chirptable[MAX_CHIRP_SIZE]; - INT8 interp_coeff[8]; + int16_t chirptable[MAX_CHIRP_SIZE]; + int8_t interp_coeff[8]; }; /* common, shared coefficients */ diff --git a/src/devices/sound/tms5220.cpp b/src/devices/sound/tms5220.cpp index d9da8b973bd..4bab38b52bd 100644 --- a/src/devices/sound/tms5220.cpp +++ b/src/devices/sound/tms5220.cpp @@ -294,7 +294,7 @@ in MCU code). Look for a 16-pin chip at U6 labeled "ECHO-3 SN". #include "emu.h" #include "tms5220.h" -static INT16 clip_analog(INT16 cliptemp); +static int16_t clip_analog(int16_t cliptemp); /* *****optional defines***** */ @@ -391,7 +391,7 @@ static INT16 clip_analog(INT16 cliptemp); // ctl bus is switching direction, next will be above #define CTL_STATE_NEXT_OUTPUT (4) -static const UINT8 reload_table[4] = { 0, 2, 4, 6 }; //sample count reload for 5220c and cd2501ecd only; 5200 and 5220 always reload with 0; keep in mind this is loaded on IP=0 PC=12 subcycle=1 so it immediately will increment after one sample, effectively being 1,3,5,7 as in the comments above. +static const uint8_t reload_table[4] = { 0, 2, 4, 6 }; //sample count reload for 5220c and cd2501ecd only; 5200 and 5220 always reload with 0; keep in mind this is loaded on IP=0 PC=12 subcycle=1 so it immediately will increment after one sample, effectively being 1,3,5,7 as in the comments above. // Pull in the ROM tables #include "tms5110r.hxx" @@ -557,7 +557,7 @@ static void printbits(long data, int num) tms5220_device::new_int_write -- wrap a write to the VSM ***********************************************************************************************/ -void tms5220_device::new_int_write(UINT8 rc, UINT8 m0, UINT8 m1, UINT8 addr) +void tms5220_device::new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr) { if (!m_m0_cb.isnull()) m_m0_cb(m0); @@ -577,7 +577,7 @@ void tms5220_device::new_int_write(UINT8 rc, UINT8 m0, UINT8 m1, UINT8 addr) tms5220_device::new_int_write_addr -- wrap a 'load address' set of writes to the VSM ***********************************************************************************************/ -void tms5220_device::new_int_write_addr(UINT8 addr) +void tms5220_device::new_int_write_addr(uint8_t addr) { new_int_write(1, 0, 1, addr); // romclk 1, m0 0, m1 1, addr bus nybble = xxxx new_int_write(0, 0, 1, addr); // romclk 0, m0 0, m1 1, addr bus nybble = xxxx @@ -590,7 +590,7 @@ void tms5220_device::new_int_write_addr(UINT8 addr) tms5220_device::new_int_write_addr -- wrap a 'read bit' set of writes to the VSM ***********************************************************************************************/ -UINT8 tms5220_device::new_int_read() +uint8_t tms5220_device::new_int_read() { new_int_write(1, 1, 0, 0); // romclk 1, m0 1, m1 0, addr bus nybble = 0/open bus new_int_write(0, 1, 0, 0); // romclk 0, m0 1, m1 0, addr bus nybble = 0/open bus @@ -911,11 +911,11 @@ int tms5220_device::int_read() ***********************************************************************************************/ -void tms5220_device::process(INT16 *buffer, unsigned int size) +void tms5220_device::process(int16_t *buffer, unsigned int size) { int buf_count=0; int i, bitout; - INT32 this_sample; + int32_t this_sample; #ifdef VERBOSE logerror("process called with size of %d; IP=%d, PC=%d, subcycle=%d, m_SPEN=%d, m_TALK=%d, m_TALKD=%d\n", size, m_IP, m_PC, m_subcycle, m_SPEN, m_TALK, m_TALKD); @@ -1072,9 +1072,9 @@ void tms5220_device::process(INT16 *buffer, unsigned int size) * disabled, forcing all samples beyond 51d to be == 51d */ if (m_pitch_count >= 51) - m_excitation_data = (INT8)m_coeff->chirptable[51]; + m_excitation_data = (int8_t)m_coeff->chirptable[51]; else /*m_pitch_count < 51*/ - m_excitation_data = (INT8)m_coeff->chirptable[m_pitch_count]; + m_excitation_data = (int8_t)m_coeff->chirptable[m_pitch_count]; } // Update LFSR *20* times every sample (once per T cycle), like patent shows @@ -1206,7 +1206,7 @@ void tms5220_device::process(INT16 *buffer, unsigned int size) ***********************************************************************************************/ -static INT16 clip_analog(INT16 cliptemp) +static int16_t clip_analog(int16_t cliptemp) { /* clipping, just like the patent shows: * the top 10 bits of this result are visible on the digital output IO pin. @@ -1248,9 +1248,9 @@ static INT16 clip_analog(INT16 cliptemp) output, this makes almost no difference in the computation. **********************************************************************************************/ -static INT32 matrix_multiply(INT32 a, INT32 b) +static int32_t matrix_multiply(int32_t a, int32_t b) { - INT32 result; + int32_t result; while (a>511) { a-=1024; } while (a<-512) { a+=1024; } while (b>16383) { b-=32768; } @@ -1271,7 +1271,7 @@ static INT32 matrix_multiply(INT32 a, INT32 b) ***********************************************************************************************/ -INT32 tms5220_device::lattice_filter() +int32_t tms5220_device::lattice_filter() { // Lattice filter here // Aug/05/07: redone as unrolled loop, for clarity - LN @@ -1306,7 +1306,7 @@ INT32 tms5220_device::lattice_filter() m_u[1] = m_u[2] - matrix_multiply(m_current_k[1], m_x[1]); m_u[0] = m_u[1] - matrix_multiply(m_current_k[0], m_x[0]); #ifdef DEBUG_LATTICE - INT32 err = m_x[9] + matrix_multiply(m_current_k[9], m_u[9]); //x_10, real chip doesn't use or calculate this + int32_t err = m_x[9] + matrix_multiply(m_current_k[9], m_u[9]); //x_10, real chip doesn't use or calculate this #endif m_x[9] = m_x[8] + matrix_multiply(m_current_k[8], m_u[8]); m_x[8] = m_x[7] + matrix_multiply(m_current_k[7], m_u[7]); @@ -1824,7 +1824,7 @@ void tms5220_device::device_timer(emu_timer &timer, device_timer_id id, int para */ WRITE_LINE_MEMBER( tms5220_device::rsq_w ) { - UINT8 new_val; + uint8_t new_val; m_true_timing = 1; state &= 0x01; @@ -1876,7 +1876,7 @@ WRITE_LINE_MEMBER( tms5220_device::rsq_w ) */ WRITE_LINE_MEMBER( tms5220_device::wsq_w ) { - UINT8 new_val; + uint8_t new_val; m_true_timing = 1; state &= 0x01; @@ -1940,8 +1940,8 @@ WRITE_LINE_MEMBER( tms5220_device::wsq_w ) */ WRITE8_MEMBER( tms5220_device::combined_rsq_wsq_w ) { - UINT8 new_val; - UINT8 falling_edges; + uint8_t new_val; + uint8_t falling_edges; m_true_timing = 1; #ifdef DEBUG_RS_WS logerror("/RS and /WS written with %d and %d respectively\n", (data&2)>>1, data&1); @@ -2132,7 +2132,7 @@ READ_LINE_MEMBER( tms5220_device::intq_r ) void tms5220_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - INT16 sample_data[MAX_SAMPLE_CHUNK]; + int16_t sample_data[MAX_SAMPLE_CHUNK]; stream_sample_t *buffer = outputs[0]; /* loop while we still have samples to generate */ @@ -2167,7 +2167,7 @@ void tms5220_device::set_frequency(int frequency) const device_type TMS5220C = &device_creator; -tms5220c_device::tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms5220c_device::tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5220_device(mconfig, TMS5220C, "TMS5220C", tag, owner, clock, "tms5220c", __FILE__) { } @@ -2175,7 +2175,7 @@ tms5220c_device::tms5220c_device(const machine_config &mconfig, const char *tag, const device_type TMS5220 = &device_creator; -tms5220_device::tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms5220_device::tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS5220, "TMS5220", tag, owner, clock, "tms5220", __FILE__), device_sound_interface(mconfig, *this), m_irq_handler(*this), @@ -2189,7 +2189,7 @@ tms5220_device::tms5220_device(const machine_config &mconfig, const char *tag, d { } -tms5220_device::tms5220_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) +tms5220_device::tms5220_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_sound_interface(mconfig, *this), m_irq_handler(*this), @@ -2216,7 +2216,7 @@ void tms5220_device::device_config_complete() const device_type CD2501E = &device_creator; -cd2501e_device::cd2501e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cd2501e_device::cd2501e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5220_device(mconfig, CD2501E, "CD2501E", tag, owner, clock, "cd2501e", __FILE__) { } @@ -2224,7 +2224,7 @@ cd2501e_device::cd2501e_device(const machine_config &mconfig, const char *tag, d const device_type TMS5200 = &device_creator; -tms5200_device::tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms5200_device::tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5220_device(mconfig, TMS5200, "TMS5200", tag, owner, clock, "tms5200", __FILE__) { } @@ -2232,7 +2232,7 @@ tms5200_device::tms5200_device(const machine_config &mconfig, const char *tag, d const device_type CD2501ECD = &device_creator; -cd2501ecd_device::cd2501ecd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cd2501ecd_device::cd2501ecd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms5220_device(mconfig, CD2501ECD, "CD2501ECD", tag, owner, clock, "cd2501ecd", __FILE__) { } diff --git a/src/devices/sound/tms5220.h b/src/devices/sound/tms5220.h index 4e17dd53574..f31fadf7184 100644 --- a/src/devices/sound/tms5220.h +++ b/src/devices/sound/tms5220.h @@ -54,8 +54,8 @@ class tms5220_device : public device_t, public device_sound_interface { public: - tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms5220_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); + tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms5220_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_irq_handler(device_t &device, _Object object) { return downcast(device).m_irq_handler.set_callback(object); } @@ -105,9 +105,9 @@ protected: private: // 51xx and VSM related - void new_int_write(UINT8 rc, UINT8 m0, UINT8 m1, UINT8 addr); - void new_int_write_addr(UINT8 addr); - UINT8 new_int_read(); + void new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr); + void new_int_write_addr(uint8_t addr); + uint8_t new_int_read(); void perform_dummy_read(); // 52xx or common void register_for_save_states(); @@ -118,8 +118,8 @@ private: int ready_read(); int cycles_to_ready(); int int_read(); - void process(INT16 *buffer, unsigned int size); - INT32 lattice_filter(); + void process(int16_t *buffer, unsigned int size); + int32_t lattice_filter(); void process_command(unsigned char cmd); void parse_frame(); void set_interrupt_state(int state); @@ -134,93 +134,93 @@ private: const struct tms5100_coeffs *m_coeff; /* these contain global status bits */ - UINT8 m_PDC; - UINT8 m_CTL_pins; - UINT8 m_state; + uint8_t m_PDC; + uint8_t m_CTL_pins; + uint8_t m_state; /* New VSM interface */ - UINT32 m_address; - UINT8 m_next_is_address; - UINT8 m_schedule_dummy_read; - UINT8 m_addr_bit; + uint32_t m_address; + uint8_t m_next_is_address; + uint8_t m_schedule_dummy_read; + uint8_t m_addr_bit; /* read byte */ - UINT8 m_CTL_buffer; + uint8_t m_CTL_buffer; /* Old VSM interface; R Nabet : These have been added to emulate speech Roms */ - //UINT8 m_schedule_dummy_read; /* set after each load address, so that next read operation is preceded by a dummy read */ - UINT8 m_data_register; /* data register, used by read command */ - UINT8 m_RDB_flag; /* whether we should read data register or status register */ + //uint8_t m_schedule_dummy_read; /* set after each load address, so that next read operation is preceded by a dummy read */ + uint8_t m_data_register; /* data register, used by read command */ + uint8_t m_RDB_flag; /* whether we should read data register or status register */ /* these contain data that describes the 128-bit data FIFO */ - UINT8 m_fifo[FIFO_SIZE]; - UINT8 m_fifo_head; - UINT8 m_fifo_tail; - UINT8 m_fifo_count; - UINT8 m_fifo_bits_taken; + uint8_t m_fifo[FIFO_SIZE]; + uint8_t m_fifo_head; + uint8_t m_fifo_tail; + uint8_t m_fifo_count; + uint8_t m_fifo_bits_taken; /* these contain global status bits */ - UINT8 m_previous_TALK_STATUS; /* this is the OLD value of TALK_STATUS (i.e. previous value of m_SPEN|m_TALKD), needed for generating interrupts on a falling TALK_STATUS edge */ - UINT8 m_SPEN; /* set on speak(or speak external and BL falling edge) command, cleared on stop command, reset command, or buffer out */ - UINT8 m_DDIS; /* If 1, DDIS is 1, i.e. Speak External command in progress, writes go to FIFO. */ - UINT8 m_TALK; /* set on SPEN & RESETL4(pc12->pc0 transition), cleared on stop command or reset command */ + uint8_t m_previous_TALK_STATUS; /* this is the OLD value of TALK_STATUS (i.e. previous value of m_SPEN|m_TALKD), needed for generating interrupts on a falling TALK_STATUS edge */ + uint8_t m_SPEN; /* set on speak(or speak external and BL falling edge) command, cleared on stop command, reset command, or buffer out */ + uint8_t m_DDIS; /* If 1, DDIS is 1, i.e. Speak External command in progress, writes go to FIFO. */ + uint8_t m_TALK; /* set on SPEN & RESETL4(pc12->pc0 transition), cleared on stop command or reset command */ #define TALK_STATUS (m_SPEN|m_TALKD) - UINT8 m_TALKD; /* TALK(TCON) value, latched every RESETL4 */ - UINT8 m_buffer_low; /* If 1, FIFO has less than 8 bytes in it */ - UINT8 m_buffer_empty; /* If 1, FIFO is empty */ - UINT8 m_irq_pin; /* state of the IRQ pin (output) */ - UINT8 m_ready_pin; /* state of the READY pin (output) */ + uint8_t m_TALKD; /* TALK(TCON) value, latched every RESETL4 */ + uint8_t m_buffer_low; /* If 1, FIFO has less than 8 bytes in it */ + uint8_t m_buffer_empty; /* If 1, FIFO is empty */ + uint8_t m_irq_pin; /* state of the IRQ pin (output) */ + uint8_t m_ready_pin; /* state of the READY pin (output) */ /* these contain data describing the current and previous voice frames */ #define OLD_FRAME_SILENCE_FLAG m_OLDE // 1 if E=0, 0 otherwise. #define OLD_FRAME_UNVOICED_FLAG m_OLDP // 1 if P=0 (unvoiced), 0 if voiced - UINT8 m_OLDE; - UINT8 m_OLDP; + uint8_t m_OLDE; + uint8_t m_OLDP; #define NEW_FRAME_STOP_FLAG (m_new_frame_energy_idx == 0xF) // 1 if this is a stop (Energy = 0xF) frame #define NEW_FRAME_SILENCE_FLAG (m_new_frame_energy_idx == 0) // ditto as above #define NEW_FRAME_UNVOICED_FLAG (m_new_frame_pitch_idx == 0) // ditto as above - UINT8 m_new_frame_energy_idx; - UINT8 m_new_frame_pitch_idx; - UINT8 m_new_frame_k_idx[10]; + uint8_t m_new_frame_energy_idx; + uint8_t m_new_frame_pitch_idx; + uint8_t m_new_frame_k_idx[10]; /* these are all used to contain the current state of the sound generation */ #ifndef PERFECT_INTERPOLATION_HACK - INT16 m_current_energy; - INT16 m_current_pitch; - INT16 m_current_k[10]; + int16_t m_current_energy; + int16_t m_current_pitch; + int16_t m_current_k[10]; #else - UINT8 m_old_frame_energy_idx; - UINT8 m_old_frame_pitch_idx; - UINT8 m_old_frame_k_idx[10]; - UINT8 m_old_zpar; - UINT8 m_old_uv_zpar; - - INT32 m_current_energy; - INT32 m_current_pitch; - INT32 m_current_k[10]; + uint8_t m_old_frame_energy_idx; + uint8_t m_old_frame_pitch_idx; + uint8_t m_old_frame_k_idx[10]; + uint8_t m_old_zpar; + uint8_t m_old_uv_zpar; + + int32_t m_current_energy; + int32_t m_current_pitch; + int32_t m_current_k[10]; #endif - UINT16 m_previous_energy; /* needed for lattice filter to match patent */ + uint16_t m_previous_energy; /* needed for lattice filter to match patent */ - UINT8 m_subcycle; /* contains the current subcycle for a given PC: 0 is A' (only used on SPKSLOW mode on 51xx), 1 is A, 2 is B */ - UINT8 m_subc_reload; /* contains 1 for normal speech, 0 when SPKSLOW is active */ - UINT8 m_PC; /* current parameter counter (what param is being interpolated), ranges from 0 to 12 */ + uint8_t m_subcycle; /* contains the current subcycle for a given PC: 0 is A' (only used on SPKSLOW mode on 51xx), 1 is A, 2 is B */ + uint8_t m_subc_reload; /* contains 1 for normal speech, 0 when SPKSLOW is active */ + uint8_t m_PC; /* current parameter counter (what param is being interpolated), ranges from 0 to 12 */ /* NOTE: the interpolation period counts 1,2,3,4,5,6,7,0 for divide by 8,8,8,4,4,2,2,1 */ - UINT8 m_IP; /* the current interpolation period */ - UINT8 m_inhibit; /* If 1, interpolation is inhibited until the DIV1 period */ - UINT8 m_uv_zpar; /* If 1, zero k5 thru k10 coefficients */ - UINT8 m_zpar; /* If 1, zero ALL parameters. */ - UINT8 m_pitch_zero; /* circuit 412; pitch is forced to zero under certain circumstances */ - UINT8 m_c_variant_rate; /* only relevant for tms5220C's multi frame rate feature; is the actual 4 bit value written on a 0x2* or 0x0* command */ - UINT16 m_pitch_count; /* pitch counter; provides chirp rom address */ + uint8_t m_IP; /* the current interpolation period */ + uint8_t m_inhibit; /* If 1, interpolation is inhibited until the DIV1 period */ + uint8_t m_uv_zpar; /* If 1, zero k5 thru k10 coefficients */ + uint8_t m_zpar; /* If 1, zero ALL parameters. */ + uint8_t m_pitch_zero; /* circuit 412; pitch is forced to zero under certain circumstances */ + uint8_t m_c_variant_rate; /* only relevant for tms5220C's multi frame rate feature; is the actual 4 bit value written on a 0x2* or 0x0* command */ + uint16_t m_pitch_count; /* pitch counter; provides chirp rom address */ - INT32 m_u[11]; - INT32 m_x[10]; + int32_t m_u[11]; + int32_t m_x[10]; - UINT16 m_RNG; /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 TODO: no it isn't */ - INT16 m_excitation_data; + uint16_t m_RNG; /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 TODO: no it isn't */ + int16_t m_excitation_data; /* The TMS52xx has two different ways of providing output data: the analog speaker pin (which was usually used) and the Digital I/O pin. @@ -229,20 +229,20 @@ private: resolution of the output data. TODO: add a way to set/reset this other than the FORCE_DIGITAL define */ - UINT8 m_digital_select; + uint8_t m_digital_select; /* io_ready: page 3 of the datasheet specifies that READY will be asserted until * data is available or processed by the system. */ - UINT8 m_io_ready; + uint8_t m_io_ready; /* flag for "true" timing involving rs/ws */ - UINT8 m_true_timing; + uint8_t m_true_timing; /* rsws - state, rs bit 1, ws bit 0 */ - UINT8 m_rs_ws; - UINT8 m_read_latch; - UINT8 m_write_latch; + uint8_t m_rs_ws; + uint8_t m_read_latch; + uint8_t m_write_latch; sound_stream *m_stream; int m_clock; @@ -270,7 +270,7 @@ extern const device_type TMS5220; class tms5220c_device : public tms5220_device { public: - tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -281,7 +281,7 @@ extern const device_type TMS5220C; class cd2501e_device : public tms5220_device { public: - cd2501e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cd2501e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -292,7 +292,7 @@ extern const device_type CD2501E; class tms5200_device : public tms5220_device { public: - tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -303,7 +303,7 @@ extern const device_type TMS5200; class cd2501ecd_device : public tms5220_device { public: - cd2501ecd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cd2501ecd_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/devices/sound/upd1771.cpp b/src/devices/sound/upd1771.cpp index cef6a1c26d4..57aa4faa4dc 100644 --- a/src/devices/sound/upd1771.cpp +++ b/src/devices/sound/upd1771.cpp @@ -233,7 +233,7 @@ static unsigned char noise_tbl[]= const device_type UPD1771C = &device_creator; -upd1771c_device::upd1771c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd1771c_device::upd1771c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD1771C, "NEC uPD1771C 017", tag, owner, clock, "upd1771c", __FILE__), device_sound_interface(mconfig, *this), m_ack_handler(*this) @@ -391,13 +391,13 @@ WRITE8_MEMBER( upd1771c_device::write ) m_index = 0; m_nw_timbre = (m_packet[1] & 0xe0) >> 5; - m_nw_period = ((UINT32)m_packet[2] + 1) << 7; + m_nw_period = ((uint32_t)m_packet[2] + 1) << 7; m_nw_volume = m_packet[3] & 0x1f; //very long clocked periods.. used for engine drones - m_n_period[0] = (((UINT32)m_packet[4]) + 1) << 7; - m_n_period[1] = (((UINT32)m_packet[5]) + 1) << 7; - m_n_period[2] = (((UINT32)m_packet[6]) + 1) << 7; + m_n_period[0] = (((uint32_t)m_packet[4]) + 1) << 7; + m_n_period[1] = (((uint32_t)m_packet[5]) + 1) << 7; + m_n_period[2] = (((uint32_t)m_packet[6]) + 1) << 7; m_n_volume[0] = m_packet[7] & 0x1f; m_n_volume[1] = m_packet[8] & 0x1f; diff --git a/src/devices/sound/upd1771.h b/src/devices/sound/upd1771.h index 46ca16e0158..2cf8b7ce6c6 100644 --- a/src/devices/sound/upd1771.h +++ b/src/devices/sound/upd1771.h @@ -25,7 +25,7 @@ class upd1771c_device : public device_t, public device_sound_interface { public: - upd1771c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd1771c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~upd1771c_device() {} template static devcb_base &set_ack_handler(device_t &device, _Object object) { return downcast(device).m_ack_handler.set_callback(object); } @@ -50,33 +50,33 @@ private: TIMER_CALLBACK_MEMBER(ack_callback); - UINT8 m_packet[MAX_PACKET_SIZE]; - UINT32 m_index; - UINT8 m_expected_bytes; + uint8_t m_packet[MAX_PACKET_SIZE]; + uint32_t m_index; + uint8_t m_expected_bytes; - UINT8 m_state;//0:silence, 1 noise, 2 tone - UINT8 m_pc3; + uint8_t m_state;//0:silence, 1 noise, 2 tone + uint8_t m_pc3; //tone - UINT8 m_t_timbre; //[0; 7] - UINT8 m_t_offset; //[0; 32] - UINT16 m_t_period; //[0;255] - UINT8 m_t_volume; //[0; 31] - UINT8 m_t_tpos;//timbre pos - UINT16 m_t_ppos;//period pos + uint8_t m_t_timbre; //[0; 7] + uint8_t m_t_offset; //[0; 32] + uint16_t m_t_period; //[0;255] + uint8_t m_t_volume; //[0; 31] + uint8_t m_t_tpos;//timbre pos + uint16_t m_t_ppos;//period pos //noise wavetable LFSR - UINT8 m_nw_timbre; //[0; 7] - UINT8 m_nw_volume; //[0; 31] - UINT32 m_nw_period; - UINT32 m_nw_tpos; //timbre pos - UINT32 m_nw_ppos; //period pos + uint8_t m_nw_timbre; //[0; 7] + uint8_t m_nw_volume; //[0; 31] + uint32_t m_nw_period; + uint32_t m_nw_tpos; //timbre pos + uint32_t m_nw_ppos; //period pos //noise pulse components - UINT8 m_n_value[3]; //[0;1] - UINT16 m_n_volume[3]; //[0; 31] - UINT32 m_n_period[3]; - UINT32 m_n_ppos[3]; //period pos + uint8_t m_n_value[3]; //[0;1] + uint16_t m_n_volume[3]; //[0; 31] + uint32_t m_n_period[3]; + uint32_t m_n_ppos[3]; //period pos }; extern const device_type UPD1771C; diff --git a/src/devices/sound/upd7752.cpp b/src/devices/sound/upd7752.cpp index ccb07e56dc7..ccdb6c490d1 100644 --- a/src/devices/sound/upd7752.cpp +++ b/src/devices/sound/upd7752.cpp @@ -34,7 +34,7 @@ ADDRESS_MAP_END // upd7752_device - constructor //------------------------------------------------- -upd7752_device::upd7752_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7752_device::upd7752_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD7752, "uPD7752", tag, owner, clock, "upd7752", __FILE__), device_sound_interface(mconfig, *this), device_memory_interface(mconfig, *this), m_stream(nullptr), @@ -96,7 +96,7 @@ void upd7752_device::sound_stream_update(sound_stream &stream, stream_sample_t * // INLINE HELPERS //************************************************************************** -inline UINT8 upd7752_device::readbyte(offs_t address) +inline uint8_t upd7752_device::readbyte(offs_t address) { return space().read_byte(address); } @@ -105,7 +105,7 @@ inline UINT8 upd7752_device::readbyte(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void upd7752_device::writebyte(offs_t address, UINT8 data) +inline void upd7752_device::writebyte(offs_t address, uint8_t data) { space().write_byte(address, data); } @@ -114,7 +114,7 @@ inline void upd7752_device::writebyte(offs_t address, UINT8 data) // READ/WRITE HANDLERS //************************************************************************** -void upd7752_device::status_change(UINT8 flag,bool type) +void upd7752_device::status_change(uint8_t flag,bool type) { if(type == true) m_status |= flag; diff --git a/src/devices/sound/upd7752.h b/src/devices/sound/upd7752.h index d801cef0bbe..13085eab5bb 100644 --- a/src/devices/sound/upd7752.h +++ b/src/devices/sound/upd7752.h @@ -37,7 +37,7 @@ class upd7752_device : public device_t, { public: // construction/destruction - upd7752_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd7752_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE8_MEMBER( write ); @@ -55,12 +55,12 @@ protected: private: sound_stream *m_stream; const address_space_config m_space_config; - UINT8 m_status; - UINT16 m_ram_addr; - UINT8 m_mode; - void status_change(UINT8 flag,bool type); - inline UINT8 readbyte(offs_t address); - inline void writebyte(offs_t address, UINT8 data); + uint8_t m_status; + uint16_t m_ram_addr; + uint8_t m_mode; + void status_change(uint8_t flag,bool type); + inline uint8_t readbyte(offs_t address); + inline void writebyte(offs_t address, uint8_t data); }; diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp index 78cdf5ce24a..e3f3ae10253 100644 --- a/src/devices/sound/upd7759.cpp +++ b/src/devices/sound/upd7759.cpp @@ -144,7 +144,7 @@ #define FRAC_MASK (FRAC_ONE - 1) -upd775x_device::upd775x_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) +upd775x_device::upd775x_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_sound_interface(mconfig, *this) , m_channel(nullptr) @@ -181,14 +181,14 @@ upd775x_device::upd775x_device(const machine_config &mconfig, device_type type, const device_type UPD7759 = &device_creator; -upd7759_device::upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7759_device::upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd775x_device(mconfig, UPD7759, "uPD7759", tag, owner, clock, "upd7759", __FILE__) , m_timer(nullptr) { } -upd7759_device::upd7759_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) +upd7759_device::upd7759_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) : upd775x_device(mconfig, type, name, tag, owner, clock, shortname, source) , m_timer(nullptr) { @@ -197,7 +197,7 @@ upd7759_device::upd7759_device(const machine_config &mconfig, device_type type, const device_type UPD7756 = &device_creator; -upd7756_device::upd7756_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7756_device::upd7756_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : upd775x_device(mconfig, UPD7756, "uPD7756", tag, owner, clock, "upd7756", __FILE__) { } @@ -234,7 +234,7 @@ void upd7759_device::device_start() m_rom = m_rombase; if (m_rombase != nullptr) { - UINT32 romsize = m_rombase.bytes(); + uint32_t romsize = m_rombase.bytes(); if (romsize >= 0x20000) { m_rommask = 0x1ffff; @@ -315,7 +315,7 @@ void upd7756_device::device_start() m_rom = m_rombase; if (m_rombase != nullptr) { - UINT32 romsize = m_rombase.bytes(); + uint32_t romsize = m_rombase.bytes(); if (romsize >= 0x20000) { m_rommask = 0x1ffff; @@ -696,7 +696,7 @@ void upd775x_device::advance_state() void upd7759_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { - UINT8 olddrq = m_drq; + uint8_t olddrq = m_drq; switch (id) { @@ -746,7 +746,7 @@ void upd775x_device::postload() WRITE_LINE_MEMBER( upd775x_device::reset_w ) { /* update the reset value */ - UINT8 oldreset = m_reset; + uint8_t oldreset = m_reset; m_reset = (state != 0); /* update the stream first */ @@ -760,7 +760,7 @@ WRITE_LINE_MEMBER( upd775x_device::reset_w ) WRITE_LINE_MEMBER( upd7759_device::start_w ) { /* update the start value */ - UINT8 oldstart = m_start; + uint8_t oldstart = m_start; m_start = (state != 0); logerror("upd7759_start_w: %d->%d\n", oldstart, m_start); @@ -782,7 +782,7 @@ WRITE_LINE_MEMBER( upd7759_device::start_w ) WRITE_LINE_MEMBER( upd7756_device::start_w ) { /* update the start value */ - UINT8 oldstart = m_start; + uint8_t oldstart = m_start; m_start = (state != 0); logerror("upd7759_start_w: %d->%d\n", oldstart, m_start); @@ -812,7 +812,7 @@ READ_LINE_MEMBER( upd775x_device::busy_r ) } -void upd775x_device::set_bank_base(UINT32 base) +void upd775x_device::set_bank_base(uint32_t base) { assert(m_rombase != nullptr); m_rom = m_rombase + base; @@ -825,10 +825,10 @@ void upd775x_device::set_bank_base(UINT32 base) void upd775x_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - INT32 clocks_left = m_clocks_left; - INT16 sample = m_sample; - UINT32 step = m_step; - UINT32 pos = m_pos; + int32_t clocks_left = m_clocks_left; + int16_t sample = m_sample; + uint32_t step = m_step; + uint32_t pos = m_pos; stream_sample_t *buffer = outputs[0]; /* loop until done */ diff --git a/src/devices/sound/upd7759.h b/src/devices/sound/upd7759.h index 27ecd86f651..f075c41c1dc 100644 --- a/src/devices/sound/upd7759.h +++ b/src/devices/sound/upd7759.h @@ -37,7 +37,7 @@ class upd775x_device : public device_t, public device_sound_interface { public: - upd775x_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); + upd775x_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); ~upd775x_device() {} template static devcb_base &set_drq_callback(device_t &device, _Object object) { return downcast(device).m_drqcallback.set_callback(object); } @@ -61,44 +61,44 @@ protected: sound_stream *m_channel; /* stream channel for playback */ /* chip configuration */ - UINT8 m_sample_offset_shift; /* header sample address shift (access data > 0xffff) */ + uint8_t m_sample_offset_shift; /* header sample address shift (access data > 0xffff) */ /* internal clock to output sample rate mapping */ - UINT32 m_pos; /* current output sample position */ - UINT32 m_step; /* step value per output sample */ + uint32_t m_pos; /* current output sample position */ + uint32_t m_step; /* step value per output sample */ attotime m_clock_period; /* clock period */ /* I/O lines */ - UINT8 m_fifo_in; /* last data written to the sound chip */ - UINT8 m_reset; /* current state of the RESET line */ - UINT8 m_start; /* current state of the START line */ - UINT8 m_drq; /* current state of the DRQ line */ + uint8_t m_fifo_in; /* last data written to the sound chip */ + uint8_t m_reset; /* current state of the RESET line */ + uint8_t m_start; /* current state of the START line */ + uint8_t m_drq; /* current state of the DRQ line */ /* internal state machine */ - INT8 m_state; /* current overall chip state */ - INT32 m_clocks_left; /* number of clocks left in this state */ - UINT16 m_nibbles_left; /* number of ADPCM nibbles left to process */ - UINT8 m_repeat_count; /* number of repeats remaining in current repeat block */ - INT8 m_post_drq_state; /* state we will be in after the DRQ line is dropped */ - INT32 m_post_drq_clocks; /* clocks that will be left after the DRQ line is dropped */ - UINT8 m_req_sample; /* requested sample number */ - UINT8 m_last_sample; /* last sample number available */ - UINT8 m_block_header; /* header byte */ - UINT8 m_sample_rate; /* number of UPD clocks per ADPCM nibble */ - UINT8 m_first_valid_header; /* did we get our first valid header yet? */ - UINT32 m_offset; /* current ROM offset */ - UINT32 m_repeat_offset; /* current ROM repeat offset */ + int8_t m_state; /* current overall chip state */ + int32_t m_clocks_left; /* number of clocks left in this state */ + uint16_t m_nibbles_left; /* number of ADPCM nibbles left to process */ + uint8_t m_repeat_count; /* number of repeats remaining in current repeat block */ + int8_t m_post_drq_state; /* state we will be in after the DRQ line is dropped */ + int32_t m_post_drq_clocks; /* clocks that will be left after the DRQ line is dropped */ + uint8_t m_req_sample; /* requested sample number */ + uint8_t m_last_sample; /* last sample number available */ + uint8_t m_block_header; /* header byte */ + uint8_t m_sample_rate; /* number of UPD clocks per ADPCM nibble */ + uint8_t m_first_valid_header; /* did we get our first valid header yet? */ + uint32_t m_offset; /* current ROM offset */ + uint32_t m_repeat_offset; /* current ROM repeat offset */ /* ADPCM processing */ - INT8 m_adpcm_state; /* ADPCM state index */ - UINT8 m_adpcm_data; /* current byte of ADPCM data */ - INT16 m_sample; /* current sample value */ + int8_t m_adpcm_state; /* ADPCM state index */ + uint8_t m_adpcm_data; /* current byte of ADPCM data */ + int16_t m_sample; /* current sample value */ /* ROM access */ - optional_region_ptr m_rombase; /* pointer to ROM data or nullptr for slave mode */ - UINT8 * m_rom; /* pointer to ROM data or nullptr for slave mode */ - UINT32 m_romoffset; /* ROM offset to make save/restore easier */ - UINT32 m_rommask; /* maximum address offset */ + optional_region_ptr m_rombase; /* pointer to ROM data or nullptr for slave mode */ + uint8_t * m_rom; /* pointer to ROM data or nullptr for slave mode */ + uint32_t m_romoffset; /* ROM offset to make save/restore easier */ + uint32_t m_rommask; /* maximum address offset */ devcb_write_line m_drqcallback; @@ -109,8 +109,8 @@ protected: class upd7759_device : public upd775x_device { public: - upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - upd7759_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); + upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + upd7759_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); enum { @@ -130,7 +130,7 @@ public: class upd7756_device : public upd775x_device { public: - upd7756_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd7756_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; diff --git a/src/devices/sound/vlm5030.cpp b/src/devices/sound/vlm5030.cpp index 901f0478297..a982965186e 100644 --- a/src/devices/sound/vlm5030.cpp +++ b/src/devices/sound/vlm5030.cpp @@ -159,7 +159,7 @@ static const int vlm5030_speed_table[8] = const device_type VLM5030 = &device_creator; -vlm5030_device::vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vlm5030_device::vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VLM5030, "VLM5030", tag, owner, clock, "vlm5030", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 16), @@ -343,7 +343,7 @@ void vlm5030_device::update() } /* setup parameteroption when RST=H */ -void vlm5030_device::setup_parameter(UINT8 param) +void vlm5030_device::setup_parameter(uint8_t param) { /* latch parameter value */ m_parameter = param; @@ -395,7 +395,7 @@ READ_LINE_MEMBER( vlm5030_device::bsy ) /* latch contoll data */ WRITE8_MEMBER( vlm5030_device::data_w ) { - m_latch_data = (UINT8)data; + m_latch_data = (uint8_t)data; } /* set RST pin level : reset / set table address A8-A15 */ @@ -591,7 +591,7 @@ void vlm5030_device::sound_stream_update(sound_stream &stream, stream_sample_t * if (u[0] > 511) buffer[buf_count] = 511<<6; else if (u[0] < -511) - buffer[buf_count] = UINT32(-511)<<6; + buffer[buf_count] = uint32_t(-511)<<6; else buffer[buf_count] = (u[0] << 6); buf_count++; diff --git a/src/devices/sound/vlm5030.h b/src/devices/sound/vlm5030.h index fb94de09ca3..a1f41e03434 100644 --- a/src/devices/sound/vlm5030.h +++ b/src/devices/sound/vlm5030.h @@ -9,7 +9,7 @@ public device_sound_interface, public device_rom_interface { public: - vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~vlm5030_device() {} /* get BSY pin level */ @@ -50,48 +50,48 @@ private: /* need to save state */ - UINT16 m_address; - UINT8 m_pin_BSY; - UINT8 m_pin_ST; - UINT8 m_pin_VCU; - UINT8 m_pin_RST; - UINT8 m_latch_data; - UINT16 m_vcu_addr_h; - UINT8 m_parameter; - UINT8 m_phase; + uint16_t m_address; + uint8_t m_pin_BSY; + uint8_t m_pin_ST; + uint8_t m_pin_VCU; + uint8_t m_pin_RST; + uint8_t m_latch_data; + uint16_t m_vcu_addr_h; + uint8_t m_parameter; + uint8_t m_phase; /* state of option paramter */ int m_frame_size; int m_pitch_offset; - UINT8 m_interp_step; + uint8_t m_interp_step; - UINT8 m_interp_count; /* number of interp periods */ - UINT8 m_sample_count; /* sample number within interp */ - UINT8 m_pitch_count; + uint8_t m_interp_count; /* number of interp periods */ + uint8_t m_sample_count; /* sample number within interp */ + uint8_t m_pitch_count; /* these contain data describing the current and previous voice frames */ - UINT16 m_old_energy; - UINT8 m_old_pitch; - INT16 m_old_k[10]; - UINT16 m_target_energy; - UINT8 m_target_pitch; - INT16 m_target_k[10]; + uint16_t m_old_energy; + uint8_t m_old_pitch; + int16_t m_old_k[10]; + uint16_t m_target_energy; + uint8_t m_target_pitch; + int16_t m_target_k[10]; - UINT16 m_new_energy; - UINT8 m_new_pitch; - INT16 m_new_k[10]; + uint16_t m_new_energy; + uint8_t m_new_pitch; + int16_t m_new_k[10]; /* these are all used to contain the current state of the sound generation */ unsigned int m_current_energy; unsigned int m_current_pitch; int m_current_k[10]; - INT32 m_x[10]; + int32_t m_x[10]; int get_bits(int sbit,int bits); int parse_frame(); void update(); - void setup_parameter(UINT8 param); + void setup_parameter(uint8_t param); void restore_state(); }; diff --git a/src/devices/sound/volt_reg.cpp b/src/devices/sound/volt_reg.cpp index 11ac2ad47c2..42a20d53950 100644 --- a/src/devices/sound/volt_reg.cpp +++ b/src/devices/sound/volt_reg.cpp @@ -12,7 +12,7 @@ const device_type VOLTAGE_REGULATOR = &device_creator; -voltage_regulator_device::voltage_regulator_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +voltage_regulator_device::voltage_regulator_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VOLTAGE_REGULATOR, "Voltage Regulator", tag, owner, clock, "volt_reg", __FILE__), device_sound_interface(mconfig, *this), m_output(0) diff --git a/src/devices/sound/volt_reg.h b/src/devices/sound/volt_reg.h index d8ca9b163f5..968a996dd93 100644 --- a/src/devices/sound/volt_reg.h +++ b/src/devices/sound/volt_reg.h @@ -22,7 +22,7 @@ class voltage_regulator_device : public device_t, public: static void set_output(device_t &device, double analogue_dc) { downcast(device).m_output = (analogue_dc * 32768) / 5.0f; } - voltage_regulator_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + voltage_regulator_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~voltage_regulator_device() { } virtual bool issound() override { return false; } diff --git a/src/devices/sound/votrax.cpp b/src/devices/sound/votrax.cpp index 3ce91bf6de8..505ccd3d0a6 100644 --- a/src/devices/sound/votrax.cpp +++ b/src/devices/sound/votrax.cpp @@ -31,8 +31,8 @@ // note that according to the patent timing circuit, p1/p2 and phi1/phi2 // run 4x faster than all references in the patent text -const UINT32 P_CLOCK_BIT = 5; // 5 according to timing diagram -const UINT32 PHI_CLOCK_BIT = 3; // 3 according to timing diagram +const uint32_t P_CLOCK_BIT = 5; // 5 according to timing diagram +const uint32_t PHI_CLOCK_BIT = 3; // 3 according to timing diagram @@ -94,7 +94,7 @@ const double votrax_sc01_device::s_glottal_wave[16] = // votrax_sc01_device - constructor //------------------------------------------------- -votrax_sc01_device::votrax_sc01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +votrax_sc01_device::votrax_sc01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VOTRAX_SC01, "Votrax SC-01", tag, owner, clock, "votrax", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -123,7 +123,7 @@ WRITE8_MEMBER( votrax_sc01_device::write ) // only 6 bits matter m_phoneme = data & 0x3f; -const UINT8 *rom = m_rom + (m_phoneme << 3); +const uint8_t *rom = m_rom + (m_phoneme << 3); osd_printf_debug("%s: STROBE %s (F1=%X F2=%X FC=%X F3=%X F2Q=%X VA=%X FA=%X CL=%X CLD=%X VD=%X PAC=%X PH=%02X)\n", machine().time().as_string(3), s_phoneme_table[m_phoneme], rom[0] >> 4, rom[1] >> 4, rom[2] >> 4, rom[3] >> 4, rom[4] >> 4, rom[5] >> 4, rom[6] >> 4, @@ -263,7 +263,7 @@ void votrax_sc01_device::update_subphoneme_clock_period() double period = 1000e-12 * (rx * (1.0 + 9e3 / 1e3) + 9e3); // convert to master clock cycles and round up - m_subphoneme_period = UINT32(ceil(period * double(m_master_clock_freq))); + m_subphoneme_period = uint32_t(ceil(period * double(m_master_clock_freq))); } //------------------------------------------------- @@ -271,7 +271,7 @@ void votrax_sc01_device::update_subphoneme_clock_period() // a grid of bit-selected caps //------------------------------------------------- -double votrax_sc01_device::bits_to_caps(UINT32 value, int caps_count, const double *caps_values) +double votrax_sc01_device::bits_to_caps(uint32_t value, int caps_count, const double *caps_values) { double sum = 0; for(int i=0; i> 4) & 7)]; + uint8_t romdata = m_rom[(m_phoneme << 3) | ((m_counter_34 >> 4) & 7)]; // update the ROM data; ROM format is (upper nibble/lower nibble) // +00 = F1 parameter / 0 @@ -683,8 +683,8 @@ osd_printf_debug("counter=%d\n", m_counter_84); // +07 = Phoneme timing (full 7 bits) // latch a new value from ROM on phi2 - UINT8 a = m_latch_72 & 7; - UINT8 romdata_swapped; + uint8_t a = m_latch_72 & 7; + uint8_t romdata_swapped; if (phi2_rising) { switch (a) @@ -723,7 +723,7 @@ osd_printf_debug("counter=%d\n", m_counter_84); { m_latch_80 = romdata & 0x7f; osd_printf_debug("[PH=%02X]\n", m_latch_80); - UINT32 old_period = m_subphoneme_period; + uint32_t old_period = m_subphoneme_period; update_subphoneme_clock_period(); m_subphoneme_count = (m_subphoneme_count * m_subphoneme_period) / old_period; m_phoneme_timer->adjust(attotime::zero); @@ -739,9 +739,9 @@ osd_printf_debug("[PH=%02X]\n", m_latch_80); //============================================== // determine the TC output from the counters (note that TC requires ET) - UINT8 counter_222_tc = (m_counter_222 == 0xf); - UINT8 counter_220_tc = (m_counter_220 == 0xf && counter_222_tc); - UINT8 counter_224_tc = (m_counter_224 == 0xf && counter_222_tc); + uint8_t counter_222_tc = (m_counter_222 == 0xf); + uint8_t counter_220_tc = (m_counter_220 == 0xf && counter_222_tc); + uint8_t counter_224_tc = (m_counter_224 == 0xf && counter_222_tc); // clock glottal counter 224 on rising edge of a0 if (a0_rising) @@ -807,7 +807,7 @@ osd_printf_debug("[PH=%02X]\n", m_latch_80); // derive glottal circuit output signals #if !TEMP_HACKS - UINT8 old_glottal_sync = m_glottal_sync; + uint8_t old_glottal_sync = m_glottal_sync; #endif m_glottal_sync = (m_counter_234 == 0); glottal_out = s_glottal_wave[m_counter_234]; @@ -819,10 +819,10 @@ osd_printf_debug("[PH=%02X]\n", m_latch_80); //============================================== // divide 1.25k clock by 2 (lower-left of 46) - UINT8 old_0625_clock = m_0625_clock; + uint8_t old_0625_clock = m_0625_clock; if (_125k_rising) m_0625_clock = !m_0625_clock; - UINT8 _0625_rising = (old_0625_clock ^ m_0625_clock) & m_0625_clock; + uint8_t _0625_rising = (old_0625_clock ^ m_0625_clock) & m_0625_clock; // update counter above if (_0625_rising) @@ -845,7 +845,7 @@ osd_printf_debug("[PH=%02X]\n", m_latch_80); #endif // determine the read/write signal - UINT8 ram_write = 0; + uint8_t ram_write = 0; switch (a) { // write if not FF and low 2 bits of latch @@ -877,7 +877,7 @@ osd_printf_debug("[PH=%02X]\n", m_latch_80); // (note we consolidate the serial addition and clocking steps here) if (ram_write) { - UINT8 old = (m_latch_168 << 4) | m_latch_170; + uint8_t old = (m_latch_168 << 4) | m_latch_170; m_ram[a] = old - (old >> 3) + ((romdata & 0xf0) >> 3); } @@ -904,8 +904,8 @@ osd_printf_debug("[PH=%02X]\n", m_latch_80); #if TEMP_HACKS if (phi2_rising) #else - UINT8 old_phi2_glottal = (old_phi2 & old_glottal_sync); - UINT8 new_phi2_glottal = m_phi2 & m_glottal_sync; + uint8_t old_phi2_glottal = (old_phi2 & old_glottal_sync); + uint8_t new_phi2_glottal = m_phi2 & m_glottal_sync; if ((old_phi2_glottal ^ new_phi2_glottal) & new_phi2_glottal) #endif switch (a) @@ -941,10 +941,10 @@ osd_printf_debug("[PH=%02X]\n", m_latch_80); //============================================== // nose is clocked by the NOR of /FA and P1 - UINT8 old_noise_clock = m_noise_clock; + uint8_t old_noise_clock = m_noise_clock; m_noise_clock = !((m_fa == 0) | m_p1); - UINT8 noise_clock_rising = (old_noise_clock ^ m_noise_clock) & m_noise_clock; - UINT8 noise_clock_falling = (old_noise_clock ^ m_noise_clock) & old_noise_clock; + uint8_t noise_clock_rising = (old_noise_clock ^ m_noise_clock) & m_noise_clock; + uint8_t noise_clock_falling = (old_noise_clock ^ m_noise_clock) & old_noise_clock; // falling edge clocks the shift register if (noise_clock_falling) @@ -962,7 +962,7 @@ osd_printf_debug("[PH=%02X]\n", m_latch_80); // input at the low end is ((d1+4 ^ d2+5) ^ (d4+4 ^ d4+5)) ^ !(counter2 | counter3) // output is tapped at d3+4 - UINT32 old_shift = m_shift_252; + uint32_t old_shift = m_shift_252; m_shift_252 <<= 1; m_shift_252 |= ((BIT(old_shift, 17) ^ BIT(old_shift, 9)) ^ (BIT(old_shift, 3) ^ BIT(old_shift, 4))) ^ ((m_counter_250 & 0xc) == 0); @@ -1109,7 +1109,7 @@ osd_printf_debug("[PH=%02X]\n", m_latch_80); // TODO: apply closure circuit (undocumented) // output the current result - *dest++ = INT16(s4_out * 4000); + *dest++ = int16_t(s4_out * 4000); } } @@ -1318,7 +1318,7 @@ void votrax_sc01_device::device_reset() void votrax_sc01_device::device_clock_changed() { // compute new frequency of the master clock, and update if changed - UINT32 newfreq = clock(); + uint32_t newfreq = clock(); if (newfreq != m_master_clock_freq) { // if we have a stream @@ -1329,7 +1329,7 @@ void votrax_sc01_device::device_clock_changed() } // determine how many clock ticks remained on the phoneme timer - UINT64 remaining = m_phoneme_timer->remaining().as_ticks(m_master_clock_freq); + uint64_t remaining = m_phoneme_timer->remaining().as_ticks(m_master_clock_freq); // recompute the master clock m_master_clock_freq = newfreq; @@ -1363,7 +1363,7 @@ osd_printf_debug("%s: REQUEST\n", timer.machine().time().as_string(3)); } // account for the rest of this subphoneme clock - UINT32 clocks_until_request = 0; + uint32_t clocks_until_request = 0; if (m_counter_84 != 0) { if (m_subphoneme_count < m_subphoneme_period) @@ -1372,6 +1372,6 @@ osd_printf_debug("%s: REQUEST\n", timer.machine().time().as_string(3)); } // plus 1/2 - clocks_until_request = std::max(clocks_until_request, UINT32(1 << P_CLOCK_BIT) / 2); + clocks_until_request = std::max(clocks_until_request, uint32_t(1 << P_CLOCK_BIT) / 2); timer.adjust(attotime::from_ticks(clocks_until_request, m_master_clock_freq)); } diff --git a/src/devices/sound/votrax.h b/src/devices/sound/votrax.h index 6c8a75763ca..adf6b429dad 100644 --- a/src/devices/sound/votrax.h +++ b/src/devices/sound/votrax.h @@ -35,7 +35,7 @@ class votrax_sc01_device : public device_t, { public: // construction/destruction - votrax_sc01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + votrax_sc01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_request_callback(device_t &device, _Object object) { return downcast(device).m_request_cb.set_callback(object); } @@ -58,7 +58,7 @@ protected: private: // internal helpers void update_subphoneme_clock_period(); - static double bits_to_caps(UINT32 value, int caps_count, const double *caps_values); + static double bits_to_caps(uint32_t value, int caps_count, const double *caps_values); static void shift_hist(double val, double *hist_array, int hist_size); static void filter_s_to_z(const double *k, double fs, double *a, double *b); static double apply_filter(const double *x, const double *y, const double *a, const double *b); @@ -66,72 +66,72 @@ private: // internal state sound_stream * m_stream; // output stream emu_timer * m_phoneme_timer; // phoneme timer - const UINT8 * m_rom; // pointer to our ROM + const uint8_t * m_rom; // pointer to our ROM // inputs - UINT8 m_inflection; // 2-bit inflection value - UINT8 m_phoneme; // 6-bit phoneme value + uint8_t m_inflection; // 2-bit inflection value + uint8_t m_phoneme; // 6-bit phoneme value // outputs devcb_write_line m_request_cb; // callback for request - UINT8 m_request_state; // request as seen to the outside world - UINT8 m_internal_request; // request managed by stream timing + uint8_t m_request_state; // request as seen to the outside world + uint8_t m_internal_request; // request managed by stream timing // timing circuit - UINT32 m_master_clock_freq; // frequency of the master clock - UINT8 m_master_clock; // master clock - UINT16 m_counter_34; // ripple counter @ 34 - UINT8 m_latch_70; // 4-bit latch @ 70 - UINT8 m_latch_72; // 4-bit latch @ 72 - UINT8 m_beta1; // beta1 clock state - UINT8 m_p2; // P2 clock state - UINT8 m_p1; // P1 clock state - UINT8 m_phi2; // phi2 clock state - UINT8 m_phi1; // phi1 clock state - UINT8 m_phi2_20; // alternate phi2 clock state (20kHz) - UINT8 m_phi1_20; // alternate phi1 clock state (20kHz) - UINT32 m_subphoneme_period; // period of the subphoneme timer - UINT32 m_subphoneme_count; // number of ticks executed already - UINT8 m_clock_88; // subphoneme clock output @ 88 - UINT8 m_latch_42; // D flip-flop @ 42 - UINT8 m_counter_84; // 4-bit phoneme counter @ 84 - UINT8 m_latch_92; // 2-bit latch @ 92 + uint32_t m_master_clock_freq; // frequency of the master clock + uint8_t m_master_clock; // master clock + uint16_t m_counter_34; // ripple counter @ 34 + uint8_t m_latch_70; // 4-bit latch @ 70 + uint8_t m_latch_72; // 4-bit latch @ 72 + uint8_t m_beta1; // beta1 clock state + uint8_t m_p2; // P2 clock state + uint8_t m_p1; // P1 clock state + uint8_t m_phi2; // phi2 clock state + uint8_t m_phi1; // phi1 clock state + uint8_t m_phi2_20; // alternate phi2 clock state (20kHz) + uint8_t m_phi1_20; // alternate phi1 clock state (20kHz) + uint32_t m_subphoneme_period; // period of the subphoneme timer + uint32_t m_subphoneme_count; // number of ticks executed already + uint8_t m_clock_88; // subphoneme clock output @ 88 + uint8_t m_latch_42; // D flip-flop @ 42 + uint8_t m_counter_84; // 4-bit phoneme counter @ 84 + uint8_t m_latch_92; // 2-bit latch @ 92 // low parameter clocking bool m_srff_132; // S/R flip-flop @ 132 bool m_srff_114; // S/R flip-flop @ 114 bool m_srff_112; // S/R flip-flop @ 112 bool m_srff_142; // S/R flip-flop @ 142 - UINT8 m_latch_80; // phoneme timing latch @ 80 + uint8_t m_latch_80; // phoneme timing latch @ 80 // glottal circuit - UINT8 m_counter_220; // 4-bit counter @ 220 - UINT8 m_counter_222; // 4-bit counter @ 222 - UINT8 m_counter_224; // 4-bit counter @ 224 - UINT8 m_counter_234; // 4-bit counter @ 234 - UINT8 m_counter_236; // 4-bit counter @ 236 - UINT8 m_fgate; // FGATE signal - UINT8 m_glottal_sync; // Glottal Sync signal + uint8_t m_counter_220; // 4-bit counter @ 220 + uint8_t m_counter_222; // 4-bit counter @ 222 + uint8_t m_counter_224; // 4-bit counter @ 224 + uint8_t m_counter_234; // 4-bit counter @ 234 + uint8_t m_counter_236; // 4-bit counter @ 236 + uint8_t m_fgate; // FGATE signal + uint8_t m_glottal_sync; // Glottal Sync signal // transition circuit - UINT8 m_0625_clock; // state of 0.625kHz clock - UINT8 m_counter_46; // 4-bit counter in block @ 46 - UINT8 m_latch_46; // 4-bit latch in block @ 46 - UINT8 m_ram[8]; // RAM to hold parameters - UINT8 m_latch_168; // 4-bit latch @ 168 - UINT8 m_latch_170; // 4-bit latch @ 170 - UINT8 m_f1; // latched 4-bit F1 value - UINT8 m_f2; // latched 5-bit F2 value - UINT8 m_fc; // latched 4-bit FC value - UINT8 m_f3; // latched 4-bit F3 value - UINT8 m_f2q; // latched 4-bit F2Q value - UINT8 m_va; // latched 4-bit VA value - UINT8 m_fa; // latched 4-bit FA value + uint8_t m_0625_clock; // state of 0.625kHz clock + uint8_t m_counter_46; // 4-bit counter in block @ 46 + uint8_t m_latch_46; // 4-bit latch in block @ 46 + uint8_t m_ram[8]; // RAM to hold parameters + uint8_t m_latch_168; // 4-bit latch @ 168 + uint8_t m_latch_170; // 4-bit latch @ 170 + uint8_t m_f1; // latched 4-bit F1 value + uint8_t m_f2; // latched 5-bit F2 value + uint8_t m_fc; // latched 4-bit FC value + uint8_t m_f3; // latched 4-bit F3 value + uint8_t m_f2q; // latched 4-bit F2Q value + uint8_t m_va; // latched 4-bit VA value + uint8_t m_fa; // latched 4-bit FA value // noise generator circuit - UINT8 m_noise_clock; // clock input to noise generator - UINT32 m_shift_252; // shift register @ 252 - UINT8 m_counter_250; // 4-bit counter @ 250 + uint8_t m_noise_clock; // clock input to noise generator + uint32_t m_shift_252; // shift register @ 252 + uint8_t m_counter_250; // 4-bit counter @ 250 // stages outputs history double m_ni_hist[4]; diff --git a/src/devices/sound/vrc6.cpp b/src/devices/sound/vrc6.cpp index c3673afc2b3..267477b751c 100644 --- a/src/devices/sound/vrc6.cpp +++ b/src/devices/sound/vrc6.cpp @@ -29,7 +29,7 @@ const device_type VRC6 = &device_creator; // vrc6snd_device - constructor //------------------------------------------------- -vrc6snd_device::vrc6snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vrc6snd_device::vrc6snd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VRC6, "VRC6 sound", tag, owner, clock, "vrc6snd", __FILE__), device_sound_interface(mconfig, *this), m_freqctrl(0), m_sawrate(0), m_sawfrql(0), m_sawfrqh(0), m_sawclock(0), m_sawaccum(0), m_stream(nullptr) { @@ -89,7 +89,7 @@ void vrc6snd_device::device_reset() void vrc6snd_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { stream_sample_t *out = outputs[0]; - INT16 tmp; + int16_t tmp; int i; // check global halt bit @@ -201,7 +201,7 @@ void vrc6snd_device::sound_stream_update(sound_stream &stream, stream_sample_t * } // sum 2 4-bit pulses, 1 5-bit saw = unsigned 6 bit output - tmp = (INT16)(UINT8)(m_output[0] + m_output[1] + m_output[2]); + tmp = (int16_t)(uint8_t)(m_output[0] + m_output[1] + m_output[2]); tmp <<= 8; out[i] = tmp; diff --git a/src/devices/sound/vrc6.h b/src/devices/sound/vrc6.h index ba4bf2026bb..6e1afe6f8ef 100644 --- a/src/devices/sound/vrc6.h +++ b/src/devices/sound/vrc6.h @@ -32,7 +32,7 @@ class vrc6snd_device : public device_t, public device_sound_interface { public: // construction/destruction - vrc6snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vrc6snd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER(write); @@ -44,11 +44,11 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; private: - UINT8 m_freqctrl, m_pulsectrl[2], m_sawrate; - UINT8 m_pulsefrql[2], m_pulsefrqh[2], m_pulseduty[2]; - UINT8 m_sawfrql, m_sawfrqh, m_sawclock, m_sawaccum; - UINT16 m_ticks[3]; - UINT8 m_output[3]; + uint8_t m_freqctrl, m_pulsectrl[2], m_sawrate; + uint8_t m_pulsefrql[2], m_pulsefrqh[2], m_pulseduty[2]; + uint8_t m_sawfrql, m_sawfrqh, m_sawclock, m_sawaccum; + uint16_t m_ticks[3]; + uint8_t m_output[3]; sound_stream *m_stream; }; diff --git a/src/devices/sound/vrender0.cpp b/src/devices/sound/vrender0.cpp index 7226f35d304..76f186e4b52 100644 --- a/src/devices/sound/vrender0.cpp +++ b/src/devices/sound/vrender0.cpp @@ -83,7 +83,7 @@ const device_type VRENDER0 = &device_creator; // vrender0_device - constructor //------------------------------------------------- -vrender0_device::vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vrender0_device::vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VRENDER0, "VRender0", tag, owner, clock, "vrender0", __FILE__), device_sound_interface(mconfig, *this), m_TexBase(nullptr), @@ -133,7 +133,7 @@ WRITE32_MEMBER(vrender0_device::vr0_snd_write) data&=0xffff; if(data&0x8000) { - UINT32 c=data&0x1f; + uint32_t c=data&0x1f; STATUS|=1<>0)&0xff; - UINT32 NCH=(m_SOUNDREGS[0x600/4]>>8)&0xff; - UINT32 CT1=(m_SOUNDREGS[0x600/4]>>16)&0xff; - UINT32 CT2=(m_SOUNDREGS[0x600/4]>>24)&0xff; + uint32_t CLK=(m_SOUNDREGS[0x600/4]>>0)&0xff; + uint32_t NCH=(m_SOUNDREGS[0x600/4]>>8)&0xff; + uint32_t CT1=(m_SOUNDREGS[0x600/4]>>16)&0xff; + uint32_t CT2=(m_SOUNDREGS[0x600/4]>>24)&0xff; int div; int s; if(CT1&0x20) - SAMPLES=(INT16 *)m_TexBase; + SAMPLES=(int16_t *)m_TexBase; else - SAMPLES=(INT16 *)m_FBBase; + SAMPLES=(int16_t *)m_FBBase; if(CLK) div=((30<<16)|0x8000)/(CLK+1); @@ -187,20 +187,20 @@ void vrender0_device::VR0_RenderAudio(int nsamples, stream_sample_t *l, stream_s for(i=0;i<=NCH;++i) { signed int sample; - UINT32 cur=CURSADDR(i); - UINT32 a=LOOPBEGIN(i)+(cur>>10); - UINT8 Mode=m_SOUNDREGS[(0x20/4)*i+0x8/4]>>24; + uint32_t cur=CURSADDR(i); + uint32_t a=LOOPBEGIN(i)+(cur>>10); + uint8_t Mode=m_SOUNDREGS[(0x20/4)*i+0x8/4]>>24; signed int LVOL=m_SOUNDREGS[(0x20/4)*i+0xc/4]>>24; signed int RVOL=m_SOUNDREGS[(0x20/4)*i+0x10/4]>>24; - INT32 DSADD=(DSADDR(i)*div)>>16; + int32_t DSADD=(DSADDR(i)*div)>>16; if(!(st&(1<>=8; sample=(signed short)ULawTo16[s&0xff]; @@ -209,7 +209,7 @@ void vrender0_device::VR0_RenderAudio(int nsamples, stream_sample_t *l, stream_s { if(Mode&0x20) //8bit { - UINT16 s=SAMPLES[a]; + uint16_t s=SAMPLES[a]; if((cur&0x200)) s>>=8; sample=(signed short) (((signed char) (s&0xff))<<8); @@ -231,7 +231,7 @@ void vrender0_device::VR0_RenderAudio(int nsamples, stream_sample_t *l, stream_s break; } } -// UINT32 v=(ENVVOL(i))>>8; +// uint32_t v=(ENVVOL(i))>>8; // sample=(sample*v)>>16; lsample+=(sample*LVOL)>>8; rsample+=(sample*RVOL)>>8; diff --git a/src/devices/sound/vrender0.h b/src/devices/sound/vrender0.h index 490e1ff617b..ebf93b71378 100644 --- a/src/devices/sound/vrender0.h +++ b/src/devices/sound/vrender0.h @@ -29,7 +29,7 @@ class vrender0_device : public device_t, public device_sound_interface { public: - vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~vrender0_device() { } // static configuration @@ -38,7 +38,7 @@ public: DECLARE_READ32_MEMBER( vr0_snd_read ); DECLARE_WRITE32_MEMBER( vr0_snd_write ); - void set_areas(UINT32 *texture, UINT32 *frame); + void set_areas(uint32_t *texture, uint32_t *frame); protected: // device-level overrides @@ -48,11 +48,11 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; private: - UINT32 *m_TexBase; - UINT32 *m_FBBase; - UINT32 m_SOUNDREGS[0x10000/4]; + uint32_t *m_TexBase; + uint32_t *m_FBBase; + uint32_t m_SOUNDREGS[0x10000/4]; sound_stream *m_stream; - UINT32 m_reg_base; + uint32_t m_reg_base; void VR0_RenderAudio(int nsamples, stream_sample_t *l, stream_sample_t *r); }; diff --git a/src/devices/sound/wave.cpp b/src/devices/sound/wave.cpp index 650389b332e..dd2b78a583b 100644 --- a/src/devices/sound/wave.cpp +++ b/src/devices/sound/wave.cpp @@ -30,7 +30,7 @@ void wave_device::static_set_cassette_tag(device_t &device, const char *cassette const device_type WAVE = &device_creator; -wave_device::wave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +wave_device::wave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WAVE, "Wave", tag, owner, clock, "wave", __FILE__), device_sound_interface(mconfig, *this), m_cass(nullptr) { @@ -96,9 +96,9 @@ void wave_device::sound_stream_update(sound_stream &stream, stream_sample_t **in for (i = samples - 1; i >= 0; i--) { - left_buffer[i] = ((INT16 *) left_buffer)[i]; + left_buffer[i] = ((int16_t *) left_buffer)[i]; if (speakers > 1) - right_buffer[i] = ((INT16 *) right_buffer)[i]; + right_buffer[i] = ((int16_t *) right_buffer)[i]; } } else diff --git a/src/devices/sound/wave.h b/src/devices/sound/wave.h index fde443b90e4..2725ecd8709 100644 --- a/src/devices/sound/wave.h +++ b/src/devices/sound/wave.h @@ -16,7 +16,7 @@ class wave_device : public device_t, public device_sound_interface { public: - wave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_cassette_tag(device_t &device, const char *cassette_tag); diff --git a/src/devices/sound/x1_010.cpp b/src/devices/sound/x1_010.cpp index e1689df139c..377a229e0cb 100644 --- a/src/devices/sound/x1_010.cpp +++ b/src/devices/sound/x1_010.cpp @@ -85,7 +85,7 @@ struct X1_010_CHANNEL { const device_type X1_010 = &device_creator; -x1_010_device::x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +x1_010_device::x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, X1_010, "X1-010", tag, owner, clock, "x1_010", __FILE__), device_sound_interface(mconfig, *this), m_region(*this, DEVICE_SELF), @@ -168,7 +168,7 @@ WRITE8_MEMBER( x1_010_device::write ) READ16_MEMBER( x1_010_device::word_r ) { - UINT16 ret; + uint16_t ret; ret = m_HI_WORD_BUF[offset]<<8; ret += (read( space, offset )&0xff); @@ -192,9 +192,9 @@ void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t ** { X1_010_CHANNEL *reg; int ch, i, volL, volR, freq, div; - INT8 *start, *end, data; - UINT8 *env; - UINT32 smp_offs, smp_step, env_offs, env_step, delta; + int8_t *start, *end, data; + uint8_t *env; + uint32_t smp_offs, smp_step, env_offs, env_step, delta; // mixer buffer zero clear memset( outputs[0], 0, samples*sizeof(*outputs[0]) ); @@ -218,7 +218,7 @@ void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t ** // Meta Fox does write the frequency register, but this is a hack to make it "work" with the current setup // This is broken for Arbalester (it writes 8), but that'll be fixed later. if( freq == 0 ) freq = 4; - smp_step = (UINT32)((float)m_base_clock/8192.0f + smp_step = (uint32_t)((float)m_base_clock/8192.0f *freq*(1<volume*128+0x1000]); + start = (int8_t *)&(m_reg[reg->volume*128+0x1000]); smp_offs = m_smp_offset[ch]; freq = ((reg->pitch_hi<<8)+reg->frequency)>>div; - smp_step = (UINT32)((float)m_base_clock/128.0f/1024.0f/4.0f*freq*(1<end*128]); + env = (uint8_t *)&(m_reg[reg->end*128]); env_offs = m_env_offset[ch]; - env_step = (UINT32)((float)m_base_clock/128.0f/1024.0f/4.0f*reg->start*(1<start*(1< m_region; // ROM + required_region_ptr m_region; // ROM int m_rate; // Output sampling rate (Hz) int m_adr; // address sound_stream * m_stream; // Stream handle int m_sound_enable; // sound output enable/disable - UINT8 m_reg[0x2000]; // X1-010 Register & wave form area - UINT8 m_HI_WORD_BUF[0x2000]; // X1-010 16bit access ram check avoidance work - UINT32 m_smp_offset[SETA_NUM_CHANNELS]; - UINT32 m_env_offset[SETA_NUM_CHANNELS]; + uint8_t m_reg[0x2000]; // X1-010 Register & wave form area + uint8_t m_HI_WORD_BUF[0x2000]; // X1-010 16bit access ram check avoidance work + uint32_t m_smp_offset[SETA_NUM_CHANNELS]; + uint32_t m_env_offset[SETA_NUM_CHANNELS]; - UINT32 m_base_clock; + uint32_t m_base_clock; }; extern const device_type X1_010; diff --git a/src/devices/sound/ym2151.cpp b/src/devices/sound/ym2151.cpp index a753e6ede27..bc6e57cb7ea 100644 --- a/src/devices/sound/ym2151.cpp +++ b/src/devices/sound/ym2151.cpp @@ -31,7 +31,7 @@ const device_type YM2151 = &device_creator; #define ENV_QUIET (TL_TAB_LEN>>3) -const UINT8 ym2151_device::eg_inc[19*RATE_STEPS] = { +const uint8_t ym2151_device::eg_inc[19*RATE_STEPS] = { /*cycle:0 1 2 3 4 5 6 7*/ /* 0 */ 0,1, 0,1, 0,1, 0,1, /* rates 00..11 0 (increment by 0 or 1) */ @@ -63,7 +63,7 @@ const UINT8 ym2151_device::eg_inc[19*RATE_STEPS] = { #define O(a) (a*RATE_STEPS) /*note that there is no O(17) in this table - it's directly in the code */ -const UINT8 ym2151_device::eg_rate_select[32+64+32] = { /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ +const uint8_t ym2151_device::eg_rate_select[32+64+32] = { /* Envelope Generator rates (32 + 64 rates + 32 RKS) */ /* 32 dummy (infinite time) rates */ O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18), @@ -109,7 +109,7 @@ const UINT8 ym2151_device::eg_rate_select[32+64+32] = { /* Envelope Generator /*mask 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0, 0, 0, 0, 0 */ #define O(a) (a*1) -const UINT8 ym2151_device::eg_rate_shift[32+64+32] = { /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */ +const uint8_t ym2151_device::eg_rate_shift[32+64+32] = { /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */ /* 32 infinite time rates */ O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0), @@ -160,14 +160,14 @@ const UINT8 ym2151_device::eg_rate_shift[32+64+32] = { /* Envelope Generator * DT2=0 DT2=1 DT2=2 DT2=3 * 0 600 781 950 */ -const UINT32 ym2151_device::dt2_tab[4] = { 0, 384, 500, 608 }; +const uint32_t ym2151_device::dt2_tab[4] = { 0, 384, 500, 608 }; /* DT1 defines offset in Hertz from base note * This table is converted while initialization... * Detune table shown in YM2151 User's Manual is wrong (verified on the real chip) */ -const UINT8 ym2151_device::dt1_tab[4*32] = { /* 4*32 DT1 values */ +const uint8_t ym2151_device::dt1_tab[4*32] = { /* 4*32 DT1 values */ /* DT1=0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -185,7 +185,7 @@ const UINT8 ym2151_device::dt1_tab[4*32] = { /* 4*32 DT1 values */ 8, 8, 9,10,11,12,13,14,16,17,19,20,22,22,22,22 }; -const UINT16 ym2151_device::phaseinc_rom[768] = { +const uint16_t ym2151_device::phaseinc_rom[768] = { 1299,1300,1301,1302,1303,1304,1305,1306,1308,1309,1310,1311,1313,1314,1315,1316, 1318,1319,1320,1321,1322,1323,1324,1325,1327,1328,1329,1330,1332,1333,1334,1335, 1337,1338,1339,1340,1341,1342,1343,1344,1346,1347,1348,1349,1351,1352,1353,1354, @@ -255,7 +255,7 @@ const UINT16 ym2151_device::phaseinc_rom[768] = { some 0x80 could be 0x81 as well as some 0x00 could be 0x01. */ -const UINT8 ym2151_device::lfo_noise_waveform[256] = { +const uint8_t ym2151_device::lfo_noise_waveform[256] = { 0xFF,0xEE,0xD3,0x80,0x58,0xDA,0x7F,0x94,0x9E,0xE3,0xFA,0x00,0x4D,0xFA,0xFF,0x6A, 0x7A,0xDE,0x49,0xF6,0x00,0x33,0xBB,0x63,0x91,0x60,0x51,0xFF,0x00,0xD8,0x7F,0xDE, 0xDC,0x73,0x21,0x85,0xB2,0x9C,0x5D,0x24,0xCD,0x91,0x9E,0x76,0x7F,0x20,0xFB,0xF3, @@ -404,7 +404,7 @@ void ym2151_device::init_tables() } } -void ym2151_device::YM2151Operator::key_on(UINT32 key_set, UINT32 eg_cnt) +void ym2151_device::YM2151Operator::key_on(uint32_t key_set, uint32_t eg_cnt) { if (!key) { @@ -421,7 +421,7 @@ void ym2151_device::YM2151Operator::key_on(UINT32 key_set, UINT32 eg_cnt) } -void ym2151_device::YM2151Operator::key_off(UINT32 key_set) +void ym2151_device::YM2151Operator::key_off(uint32_t key_set) { if (key) { @@ -437,7 +437,7 @@ void ym2151_device::YM2151Operator::key_off(UINT32 key_set) void ym2151_device::envelope_KONKOFF(YM2151Operator * op, int v) { // m1, m2, c1, c2 - static UINT8 masks[4] = { 0x08, 0x20, 0x10, 0x40 }; + static uint8_t masks[4] = { 0x08, 0x20, 0x10, 0x40 }; for(int i=0; i != 4; i++) if (v & masks[i]) /* M1 */ op[i].key_on(1, eg_cnt); @@ -540,8 +540,8 @@ void ym2151_device::set_connect(YM2151Operator *om1, int cha, int v) void ym2151_device::refresh_EG(YM2151Operator * op) { - UINT32 kc; - UINT32 v; + uint32_t kc; + uint32_t v; kc = op->kc; @@ -764,7 +764,7 @@ void ym2151_device::write_reg(int r, int v) v &= 0x7f; if (v != op->kc) { - UINT32 kc, kc_channel; + uint32_t kc, kc_channel; kc_channel = (v - (v>>2))*64; kc_channel += 768; @@ -801,7 +801,7 @@ void ym2151_device::write_reg(int r, int v) v >>= 2; if (v != (op->kc_i & 63)) { - UINT32 kc_channel; + uint32_t kc_channel; kc_channel = v; kc_channel |= (op->kc_i & ~63); @@ -827,8 +827,8 @@ void ym2151_device::write_reg(int r, int v) case 0x40: /* DT1, MUL */ { - UINT32 olddt1_i = op->dt1_i; - UINT32 oldmul = op->mul; + uint32_t olddt1_i = op->dt1_i; + uint32_t oldmul = op->mul; op->dt1_i = (v&0x70)<<1; op->mul = (v&0x0f) ? (v&0x0f)<<1: 1; @@ -847,8 +847,8 @@ void ym2151_device::write_reg(int r, int v) case 0x80: /* KS, AR */ { - UINT32 oldks = op->ks; - UINT32 oldar = op->ar; + uint32_t oldks = op->ks; + uint32_t oldar = op->ar; op->ks = 5-(v>>6); op->ar = (v&0x1f) ? 32 + ((v&0x1f)<<1) : 0; @@ -888,7 +888,7 @@ void ym2151_device::write_reg(int r, int v) case 0xc0: /* DT2, D2R */ { - UINT32 olddt2 = op->dt2; + uint32_t olddt2 = op->dt2; op->dt2 = dt2_tab[ v>>6 ]; if (op->dt2 != olddt2) op->freq = ( (freq[ op->kc_i + op->dt2 ] + op->dt1) * op->mul ) >> 1; @@ -1023,7 +1023,7 @@ void ym2151_device::device_start() int ym2151_device::op_calc(YM2151Operator * OP, unsigned int env, signed int pm) { - UINT32 p; + uint32_t p; p = (env<<3) + sin_tab[ ( ((signed int)((OP->phase & ~FREQ_MASK) + (pm<<15))) >> FREQ_SH ) & SIN_MASK ]; @@ -1036,8 +1036,8 @@ int ym2151_device::op_calc(YM2151Operator * OP, unsigned int env, signed int pm) int ym2151_device::op_calc1(YM2151Operator * OP, unsigned int env, signed int pm) { - UINT32 p; - INT32 i; + uint32_t p; + int32_t i; i = (OP->phase & ~FREQ_MASK) + pm; @@ -1056,13 +1056,13 @@ int ym2151_device::op_calc1(YM2151Operator * OP, unsigned int env, signed int pm -#define volume_calc(OP) ((OP)->tl + ((UINT32)(OP)->volume) + (AM & (OP)->AMmask)) +#define volume_calc(OP) ((OP)->tl + ((uint32_t)(OP)->volume) + (AM & (OP)->AMmask)) void ym2151_device::chan_calc(unsigned int chan) { YM2151Operator *op; unsigned int env; - UINT32 AM = 0; + uint32_t AM = 0; m2 = c1 = c2 = mem = 0; op = &oper[chan*4]; /* M1 */ @@ -1073,7 +1073,7 @@ void ym2151_device::chan_calc(unsigned int chan) AM = lfa << (op->ams-1); env = volume_calc(op); { - INT32 out = op->fb_out_prev + op->fb_out_curr; + int32_t out = op->fb_out_prev + op->fb_out_curr; op->fb_out_prev = op->fb_out_curr; if (!op->connect) @@ -1113,7 +1113,7 @@ void ym2151_device::chan7_calc() { YM2151Operator *op; unsigned int env; - UINT32 AM = 0; + uint32_t AM = 0; m2 = c1 = c2 = mem = 0; op = &oper[7*4]; /* M1 */ @@ -1124,7 +1124,7 @@ void ym2151_device::chan7_calc() AM = lfa << (op->ams-1); env = volume_calc(op); { - INT32 out = op->fb_out_prev + op->fb_out_curr; + int32_t out = op->fb_out_prev + op->fb_out_curr; op->fb_out_prev = op->fb_out_curr; if (!op->connect) @@ -1154,7 +1154,7 @@ void ym2151_device::chan7_calc() env = volume_calc(op+3); /* C2 */ if (noise & 0x80) { - UINT32 noiseout; + uint32_t noiseout; noiseout = 0; if (env < 0x3ff) @@ -1557,7 +1557,7 @@ void ym2151_device::advance() noise_p &= 0xffff; while (i) { - UINT32 j; + uint32_t j; j = ( (noise_rng ^ (noise_rng>>3) ) & 1) ^ 1; noise_rng = (j<<16) | (noise_rng>>1); i--; @@ -1571,7 +1571,7 @@ void ym2151_device::advance() { if (op->pms) /* only when phase modulation from LFO is enabled for this channel */ { - INT32 mod_ind = lfp; /* -128..+127 (8bits signed) */ + int32_t mod_ind = lfp; /* -128..+127 (8bits signed) */ if (op->pms < 6) mod_ind >>= (6 - op->pms); else @@ -1579,7 +1579,7 @@ void ym2151_device::advance() if (mod_ind) { - UINT32 kc_channel = op->kc_i + mod_ind; + uint32_t kc_channel = op->kc_i + mod_ind; (op+0)->phase += ( (freq[ kc_channel + (op+0)->dt2 ] + (op+0)->dt1) * (op+0)->mul ) >> 1; (op+1)->phase += ( (freq[ kc_channel + (op+1)->dt2 ] + (op+1)->dt1) * (op+1)->mul ) >> 1; (op+2)->phase += ( (freq[ kc_channel + (op+2)->dt2 ] + (op+2)->dt1) * (op+2)->mul ) >> 1; @@ -1649,7 +1649,7 @@ void ym2151_device::advance() // ym2151_device - constructor //------------------------------------------------- -ym2151_device::ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym2151_device::ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YM2151, "YM2151", tag, owner, clock, "ym2151", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), diff --git a/src/devices/sound/ym2151.h b/src/devices/sound/ym2151.h index a3e46774485..960a906d2d0 100644 --- a/src/devices/sound/ym2151.h +++ b/src/devices/sound/ym2151.h @@ -61,7 +61,7 @@ class ym2151_device : public device_t, { public: // construction/destruction - ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym2151_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_irqhandler.set_callback(object); } @@ -111,69 +111,69 @@ private: int tl_tab[TL_TAB_LEN]; unsigned int sin_tab[SIN_LEN]; - UINT32 d1l_tab[16]; + uint32_t d1l_tab[16]; - static const UINT8 eg_inc[19*RATE_STEPS]; - static const UINT8 eg_rate_select[32+64+32]; - static const UINT8 eg_rate_shift[32+64+32]; - static const UINT32 dt2_tab[4]; - static const UINT8 dt1_tab[4*32]; - static const UINT16 phaseinc_rom[768]; - static const UINT8 lfo_noise_waveform[256]; + static const uint8_t eg_inc[19*RATE_STEPS]; + static const uint8_t eg_rate_select[32+64+32]; + static const uint8_t eg_rate_shift[32+64+32]; + static const uint32_t dt2_tab[4]; + static const uint8_t dt1_tab[4*32]; + static const uint16_t phaseinc_rom[768]; + static const uint8_t lfo_noise_waveform[256]; /* struct describing a single operator */ struct YM2151Operator { - UINT32 phase; /* accumulated operator phase */ - UINT32 freq; /* operator frequency count */ - INT32 dt1; /* current DT1 (detune 1 phase inc/decrement) value */ - UINT32 mul; /* frequency count multiply */ - UINT32 dt1_i; /* DT1 index * 32 */ - UINT32 dt2; /* current DT2 (detune 2) value */ + uint32_t phase; /* accumulated operator phase */ + uint32_t freq; /* operator frequency count */ + int32_t dt1; /* current DT1 (detune 1 phase inc/decrement) value */ + uint32_t mul; /* frequency count multiply */ + uint32_t dt1_i; /* DT1 index * 32 */ + uint32_t dt2; /* current DT2 (detune 2) value */ signed int *connect; /* operator output 'direction' */ /* only M1 (operator 0) is filled with this data: */ signed int *mem_connect; /* where to put the delayed sample (MEM) */ - INT32 mem_value; /* delayed sample (MEM) value */ + int32_t mem_value; /* delayed sample (MEM) value */ /* channel specific data; note: each operator number 0 contains channel specific data */ - UINT32 fb_shift; /* feedback shift value for operators 0 in each channel */ - INT32 fb_out_curr; /* operator feedback value (used only by operators 0) */ - INT32 fb_out_prev; /* previous feedback value (used only by operators 0) */ - UINT32 kc; /* channel KC (copied to all operators) */ - UINT32 kc_i; /* just for speedup */ - UINT32 pms; /* channel PMS */ - UINT32 ams; /* channel AMS */ + uint32_t fb_shift; /* feedback shift value for operators 0 in each channel */ + int32_t fb_out_curr; /* operator feedback value (used only by operators 0) */ + int32_t fb_out_prev; /* previous feedback value (used only by operators 0) */ + uint32_t kc; /* channel KC (copied to all operators) */ + uint32_t kc_i; /* just for speedup */ + uint32_t pms; /* channel PMS */ + uint32_t ams; /* channel AMS */ /* end of channel specific data */ - UINT32 AMmask; /* LFO Amplitude Modulation enable mask */ - UINT32 state; /* Envelope state: 4-attack(AR) 3-decay(D1R) 2-sustain(D2R) 1-release(RR) 0-off */ - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT32 tl; /* Total attenuation Level */ - INT32 volume; /* current envelope attenuation level */ - UINT8 eg_sh_d1r; /* (decay state) */ - UINT8 eg_sel_d1r; /* (decay state) */ - UINT32 d1l; /* envelope switches to sustain state after reaching this level */ - UINT8 eg_sh_d2r; /* (sustain state) */ - UINT8 eg_sel_d2r; /* (sustain state) */ - UINT8 eg_sh_rr; /* (release state) */ - UINT8 eg_sel_rr; /* (release state) */ - - UINT32 key; /* 0=last key was KEY OFF, 1=last key was KEY ON */ - - UINT32 ks; /* key scale */ - UINT32 ar; /* attack rate */ - UINT32 d1r; /* decay rate */ - UINT32 d2r; /* sustain rate */ - UINT32 rr; /* release rate */ - - UINT32 reserved0; /**/ - UINT32 reserved1; /**/ - - void key_on(UINT32 key_set, UINT32 eg_cnt); - void key_off(UINT32 key_set); + uint32_t AMmask; /* LFO Amplitude Modulation enable mask */ + uint32_t state; /* Envelope state: 4-attack(AR) 3-decay(D1R) 2-sustain(D2R) 1-release(RR) 0-off */ + uint8_t eg_sh_ar; /* (attack state) */ + uint8_t eg_sel_ar; /* (attack state) */ + uint32_t tl; /* Total attenuation Level */ + int32_t volume; /* current envelope attenuation level */ + uint8_t eg_sh_d1r; /* (decay state) */ + uint8_t eg_sel_d1r; /* (decay state) */ + uint32_t d1l; /* envelope switches to sustain state after reaching this level */ + uint8_t eg_sh_d2r; /* (sustain state) */ + uint8_t eg_sel_d2r; /* (sustain state) */ + uint8_t eg_sh_rr; /* (release state) */ + uint8_t eg_sel_rr; /* (release state) */ + + uint32_t key; /* 0=last key was KEY OFF, 1=last key was KEY ON */ + + uint32_t ks; /* key scale */ + uint32_t ar; /* attack rate */ + uint32_t d1r; /* decay rate */ + uint32_t d2r; /* sustain rate */ + uint32_t rr; /* release rate */ + + uint32_t reserved0; /**/ + uint32_t reserved1; /**/ + + void key_on(uint32_t key_set, uint32_t eg_cnt); + void key_off(uint32_t key_set); }; signed int chanout[8]; @@ -182,38 +182,38 @@ private: YM2151Operator oper[32]; /* the 32 operators */ - UINT32 pan[16]; /* channels output masks (0xffffffff = enable) */ + uint32_t pan[16]; /* channels output masks (0xffffffff = enable) */ - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/64/3 */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow; /* envelope generator timer overlfows every 3 samples (on real chip) */ + uint32_t eg_cnt; /* global envelope generator counter */ + uint32_t eg_timer; /* global envelope generator counter works at frequency = chipclock/64/3 */ + uint32_t eg_timer_add; /* step of eg_timer */ + uint32_t eg_timer_overflow; /* envelope generator timer overlfows every 3 samples (on real chip) */ - UINT32 lfo_phase; /* accumulated LFO phase (0 to 255) */ - UINT32 lfo_timer; /* LFO timer */ - UINT32 lfo_timer_add; /* step of lfo_timer */ - UINT32 lfo_overflow; /* LFO generates new output when lfo_timer reaches this value */ - UINT32 lfo_counter; /* LFO phase increment counter */ - UINT32 lfo_counter_add; /* step of lfo_counter */ - UINT8 lfo_wsel; /* LFO waveform (0-saw, 1-square, 2-triangle, 3-random noise) */ - UINT8 amd; /* LFO Amplitude Modulation Depth */ - INT8 pmd; /* LFO Phase Modulation Depth */ - UINT32 lfa; /* LFO current AM output */ - INT32 lfp; /* LFO current PM output */ + uint32_t lfo_phase; /* accumulated LFO phase (0 to 255) */ + uint32_t lfo_timer; /* LFO timer */ + uint32_t lfo_timer_add; /* step of lfo_timer */ + uint32_t lfo_overflow; /* LFO generates new output when lfo_timer reaches this value */ + uint32_t lfo_counter; /* LFO phase increment counter */ + uint32_t lfo_counter_add; /* step of lfo_counter */ + uint8_t lfo_wsel; /* LFO waveform (0-saw, 1-square, 2-triangle, 3-random noise) */ + uint8_t amd; /* LFO Amplitude Modulation Depth */ + int8_t pmd; /* LFO Phase Modulation Depth */ + uint32_t lfa; /* LFO current AM output */ + int32_t lfp; /* LFO current PM output */ - UINT8 test; /* TEST register */ - UINT8 ct; /* output control pins (bit1-CT2, bit0-CT1) */ + uint8_t test; /* TEST register */ + uint8_t ct; /* output control pins (bit1-CT2, bit0-CT1) */ - UINT32 noise; /* noise enable/period register (bit 7 - noise enable, bits 4-0 - noise period */ - UINT32 noise_rng; /* 17 bit noise shift register */ - UINT32 noise_p; /* current noise 'phase'*/ - UINT32 noise_f; /* current noise period */ + uint32_t noise; /* noise enable/period register (bit 7 - noise enable, bits 4-0 - noise period */ + uint32_t noise_rng; /* 17 bit noise shift register */ + uint32_t noise_p; /* current noise 'phase'*/ + uint32_t noise_f; /* current noise period */ - UINT32 csm_req; /* CSM KEY ON / KEY OFF sequence request */ + uint32_t csm_req; /* CSM KEY ON / KEY OFF sequence request */ - UINT32 irq_enable; /* IRQ enable for timer B (bit 3) and timer A (bit 2); bit 7 - CSM mode (keyon to all slots, everytime timer A overflows) */ - UINT32 status; /* chip status (BUSY, IRQ Flags) */ - UINT8 connect[8]; /* channels connections */ + uint32_t irq_enable; /* IRQ enable for timer B (bit 3) and timer A (bit 2); bit 7 - CSM mode (keyon to all slots, everytime timer A overflows) */ + uint32_t status; /* chip status (BUSY, IRQ Flags) */ + uint8_t connect[8]; /* channels connections */ emu_timer *timer_A, *timer_A_irq_off; emu_timer *timer_B, *timer_B_irq_off; @@ -222,10 +222,10 @@ private: attotime timer_B_time[256]; /* timer B times for MAME */ int irqlinestate; - UINT32 timer_A_index; /* timer A index */ - UINT32 timer_B_index; /* timer B index */ - UINT32 timer_A_index_old; /* timer A previous index */ - UINT32 timer_B_index_old; /* timer B previous index */ + uint32_t timer_A_index; /* timer A index */ + uint32_t timer_B_index; /* timer B index */ + uint32_t timer_A_index_old; /* timer A previous index */ + uint32_t timer_B_index_old; /* timer B previous index */ /* Frequency-deltas to get the closest frequency possible. * There are 11 octaves because of DT2 (max 950 cents over base frequency) @@ -243,18 +243,18 @@ private: * 9 note code + DT2 + LFO PM * 10 note code + DT2 + LFO PM */ - UINT32 freq[11*768]; /* 11 octaves, 768 'cents' per octave */ + uint32_t freq[11*768]; /* 11 octaves, 768 'cents' per octave */ /* Frequency deltas for DT1. These deltas alter operator frequency * after it has been taken from frequency-deltas table. */ - INT32 dt1_freq[8*32]; /* 8 DT1 levels, 32 KC values */ + int32_t dt1_freq[8*32]; /* 8 DT1 levels, 32 KC values */ - UINT32 noise_tab[32]; /* 17bit Noise Generator periods */ + uint32_t noise_tab[32]; /* 17bit Noise Generator periods */ // internal state sound_stream * m_stream; - UINT8 m_lastreg; + uint8_t m_lastreg; devcb_write_line m_irqhandler; devcb_write8 m_portwritehandler; diff --git a/src/devices/sound/ym2413.cpp b/src/devices/sound/ym2413.cpp index 5fd92f9946f..aa3aba490cb 100644 --- a/src/devices/sound/ym2413.cpp +++ b/src/devices/sound/ym2413.cpp @@ -119,13 +119,13 @@ const double ym2413_device::ksl_tab[8*16] = #undef DV /* 0 / 1.5 / 3.0 / 6.0 dB/OCT, confirmed on a real YM2413 (the application manual is incorrect) */ -const UINT32 ym2413_device::ksl_shift[4] = { 31, 2, 1, 0 }; +const uint32_t ym2413_device::ksl_shift[4] = { 31, 2, 1, 0 }; /* sustain level table (3dB per step) */ /* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,45 (dB)*/ -#define SC(db) (UINT32) ( db * (1.0/ENV_STEP) ) -const UINT32 ym2413_device::sl_tab[16] = { +#define SC(db) (uint32_t) ( db * (1.0/ENV_STEP) ) +const uint32_t ym2413_device::sl_tab[16] = { SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7), SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(15) }; @@ -237,7 +237,7 @@ const unsigned char ym2413_device::eg_rate_shift[16+64+16] = { /* Envelope Ge /* multiple table */ #define ML 2 -const UINT8 ym2413_device::mul_tab[16]= { +const uint8_t ym2413_device::mul_tab[16]= { /* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */ ML/2, 1*ML, 2*ML, 3*ML, 4*ML, 5*ML, 6*ML, 7*ML, 8*ML, 9*ML,10*ML,10*ML,12*ML,12*ML,15*ML,15*ML @@ -260,7 +260,7 @@ const UINT8 ym2413_device::mul_tab[16]= { We use data>>1, until we find what it really is on real chip... */ -const UINT8 ym2413_device::lfo_am_table[LFO_AM_TAB_ELEMENTS] = { +const uint8_t ym2413_device::lfo_am_table[LFO_AM_TAB_ELEMENTS] = { 0,0,0,0,0,0,0, 1,1,1,1, 2,2,2,2, @@ -316,7 +316,7 @@ const UINT8 ym2413_device::lfo_am_table[LFO_AM_TAB_ELEMENTS] = { }; /* LFO Phase Modulation table (verified on real YM2413) */ -const INT8 ym2413_device::lfo_pm_table[8*8] = { +const int8_t ym2413_device::lfo_pm_table[8*8] = { /* FNUM2/FNUM = 0 00xxxxxx (0x0000) */ 0, 0, 0, 0, 0, 0, 0, 0, @@ -413,8 +413,8 @@ void ym2413_device::advance_lfo() { /* LFO */ lfo_am_cnt += lfo_am_inc; - if (lfo_am_cnt >= ((UINT32)LFO_AM_TAB_ELEMENTS<= ((uint32_t)LFO_AM_TAB_ELEMENTS<> LFO_SH ] >> 1; @@ -591,7 +591,7 @@ void ym2413_device::advance() /* Phase Generator */ if(op->vib) { - UINT8 block; + uint8_t block; unsigned int fnum_lfo = 8*((CH->block_fnum&0x01c0) >> 6); unsigned int block_fnum = CH->block_fnum * 2; @@ -631,7 +631,7 @@ void ym2413_device::advance() while (i) { /* - UINT32 j; + uint32_t j; j = ( (noise_rng) ^ (noise_rng>>14) ^ (noise_rng>>15) ^ (noise_rng>>22) ) & 1; noise_rng = (j<<22) | (noise_rng>>1); */ @@ -652,9 +652,9 @@ void ym2413_device::advance() } -int ym2413_device::op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +int ym2413_device::op_calc(uint32_t phase, unsigned int env, signed int pm, unsigned int wave_tab) { - UINT32 p; + uint32_t p; p = (env<<5) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + (pm<<17))) >> FREQ_SH ) & SIN_MASK) ]; @@ -663,10 +663,10 @@ int ym2413_device::op_calc(UINT32 phase, unsigned int env, signed int pm, unsign return tl_tab[p]; } -int ym2413_device::op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +int ym2413_device::op_calc1(uint32_t phase, unsigned int env, signed int pm, unsigned int wave_tab) { - UINT32 p; - INT32 i; + uint32_t p; + int32_t i; i = (phase & ~FREQ_MASK) + pm; @@ -682,7 +682,7 @@ int ym2413_device::op_calc1(UINT32 phase, unsigned int env, signed int pm, unsig } -#define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (LFO_AM & (OP)->AMmask)) +#define volume_calc(OP) ((OP)->TLL + ((uint32_t)(OP)->volume) + (LFO_AM & (OP)->AMmask)) /* calculate output */ void ym2413_device::chan_calc( OPLL_CH *CH ) @@ -831,7 +831,7 @@ void ym2413_device::rhythm_calc( OPLL_CH *CH, unsigned int noise ) /* when res1 = 0 phase = 0x000 | 0xd0; */ /* when res1 = 1 phase = 0x200 | (0xd0>>2); */ - UINT32 phase = res1 ? (0x200|(0xd0>>2)) : 0xd0; + uint32_t phase = res1 ? (0x200|(0xd0>>2)) : 0xd0; /* enable gate based on frequency of operator 2 in channel 8 */ unsigned char bit5e= ((SLOT8_2->phase>>FREQ_SH)>>5)&1; @@ -872,7 +872,7 @@ void ym2413_device::rhythm_calc( OPLL_CH *CH, unsigned int noise ) /* when bit8 = 0 phase = 0x100; */ /* when bit8 = 1 phase = 0x200; */ - UINT32 phase = bit8 ? 0x200 : 0x100; + uint32_t phase = bit8 ? 0x200 : 0x100; /* Noise bit XOR'es phase by 0x100 */ /* when noisebit = 0 pass the phase from calculation above */ @@ -902,7 +902,7 @@ void ym2413_device::rhythm_calc( OPLL_CH *CH, unsigned int noise ) /* when res1 = 0 phase = 0x000 | 0x100; */ /* when res1 = 1 phase = 0x200 | 0x100; */ - UINT32 phase = res1 ? 0x300 : 0x100; + uint32_t phase = res1 ? 0x300 : 0x100; /* enable gate based on frequency of operator 2 in channel 8 */ unsigned char bit5e= ((SLOT8_2->phase>>FREQ_SH)>>5)&1; @@ -919,7 +919,7 @@ void ym2413_device::rhythm_calc( OPLL_CH *CH, unsigned int noise ) } -void ym2413_device::key_on(OPLL_SLOT *SLOT, UINT32 key_set) +void ym2413_device::key_on(OPLL_SLOT *SLOT, uint32_t key_set) { if( !SLOT->key ) { @@ -930,7 +930,7 @@ void ym2413_device::key_on(OPLL_SLOT *SLOT, UINT32 key_set) SLOT->key |= key_set; } -void ym2413_device::key_off(OPLL_SLOT *SLOT, UINT32 key_clr) +void ym2413_device::key_off(OPLL_SLOT *SLOT, uint32_t key_clr) { if( SLOT->key ) { @@ -949,8 +949,8 @@ void ym2413_device::key_off(OPLL_SLOT *SLOT, UINT32 key_clr) void ym2413_device::calc_fcslot(OPLL_CH *CH, OPLL_SLOT *SLOT) { int ksr; - UINT32 SLOT_rs; - UINT32 SLOT_dp; + uint32_t SLOT_rs; + uint32_t SLOT_dp; /* (frequency) phase increment counter */ SLOT->freq = CH->fc * SLOT->mul; @@ -1072,7 +1072,7 @@ void ym2413_device::set_sl_rr(int slot,int v) SLOT->eg_sel_rr = eg_rate_select[SLOT->rr + SLOT->ksr ]; } -void ym2413_device::load_instrument(UINT32 chan, UINT32 slot, UINT8* inst ) +void ym2413_device::load_instrument(uint32_t chan, uint32_t slot, uint8_t* inst ) { set_mul (slot, inst[0]); set_mul (slot+1, inst[1]); @@ -1084,11 +1084,11 @@ void ym2413_device::load_instrument(UINT32 chan, UINT32 slot, UINT8* inst ) set_sl_rr (slot+1, inst[7]); } -void ym2413_device::update_instrument_zero( UINT8 r ) +void ym2413_device::update_instrument_zero( uint8_t r ) { - UINT8* inst = &inst_tab[0][0]; /* point to user instrument */ - UINT32 chan; - UINT32 chan_max; + uint8_t* inst = &inst_tab[0][0]; /* point to user instrument */ + uint32_t chan; + uint32_t chan_max; chan_max = 9; if (rhythm & 0x20) @@ -1176,7 +1176,7 @@ void ym2413_device::write_reg(int r, int v) { OPLL_CH *CH; OPLL_SLOT *SLOT; - UINT8 *inst; + uint8_t *inst; int chan; int slot; @@ -1352,14 +1352,14 @@ void ym2413_device::write_reg(int r, int v) /* update */ if(CH->block_fnum != block_fnum) { - UINT8 block; + uint8_t block; CH->block_fnum = block_fnum; /* BLK 2,1,0 bits -> bits 3,2,1 of kcode, FNUM MSB -> kcode LSB */ CH->kcode = (block_fnum&0x0f00)>>8; - CH->ksl_base = static_cast(ksl_tab[block_fnum>>5]); + CH->ksl_base = static_cast(ksl_tab[block_fnum>>5]); block_fnum = block_fnum * 2; block = (block_fnum&0x1c00) >> 10; @@ -1378,7 +1378,7 @@ void ym2413_device::write_reg(int r, int v) case 0x30: /* inst 4 MSBs, VOL 4 LSBs */ { - UINT8 old_instvol; + uint8_t old_instvol; chan = r&0x0f; @@ -1677,7 +1677,7 @@ WRITE8_MEMBER( ym2413_device::data_port_w ) const device_type YM2413 = &device_creator; -ym2413_device::ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ym2413_device::ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YM2413, "YM2413", tag, owner, clock, "ym2413", __FILE__), device_sound_interface(mconfig, *this) { diff --git a/src/devices/sound/ym2413.h b/src/devices/sound/ym2413.h index 5a7164faec9..33f72db1ef8 100644 --- a/src/devices/sound/ym2413.h +++ b/src/devices/sound/ym2413.h @@ -11,7 +11,7 @@ class ym2413_device : public device_t, public device_sound_interface { public: - ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( write ); @@ -31,44 +31,44 @@ protected: private: struct OPLL_SLOT { - UINT32 ar; /* attack rate: AR<<2 */ - UINT32 dr; /* decay rate: DR<<2 */ - UINT32 rr; /* release rate:RR<<2 */ - UINT8 KSR; /* key scale rate */ - UINT8 ksl; /* keyscale level */ - UINT8 ksr; /* key scale rate: kcode>>KSR */ - UINT8 mul; /* multiple: mul_tab[ML] */ + uint32_t ar; /* attack rate: AR<<2 */ + uint32_t dr; /* decay rate: DR<<2 */ + uint32_t rr; /* release rate:RR<<2 */ + uint8_t KSR; /* key scale rate */ + uint8_t ksl; /* keyscale level */ + uint8_t ksr; /* key scale rate: kcode>>KSR */ + uint8_t mul; /* multiple: mul_tab[ML] */ /* Phase Generator */ - UINT32 phase; /* frequency counter */ - UINT32 freq; /* frequency counter step */ - UINT8 fb_shift; /* feedback shift value */ - INT32 op1_out[2]; /* slot1 output for feedback */ + uint32_t phase; /* frequency counter */ + uint32_t freq; /* frequency counter step */ + uint8_t fb_shift; /* feedback shift value */ + int32_t op1_out[2]; /* slot1 output for feedback */ /* Envelope Generator */ - UINT8 eg_type; /* percussive/nonpercussive mode*/ - UINT8 state; /* phase type */ - UINT32 TL; /* total level: TL << 2 */ - INT32 TLL; /* adjusted now TL */ - INT32 volume; /* envelope counter */ - UINT32 sl; /* sustain level: sl_tab[SL] */ - - UINT8 eg_sh_dp; /* (dump state) */ - UINT8 eg_sel_dp; /* (dump state) */ - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT8 eg_sh_dr; /* (decay state) */ - UINT8 eg_sel_dr; /* (decay state) */ - UINT8 eg_sh_rr; /* (release state for non-perc.)*/ - UINT8 eg_sel_rr; /* (release state for non-perc.)*/ - UINT8 eg_sh_rs; /* (release state for perc.mode)*/ - UINT8 eg_sel_rs; /* (release state for perc.mode)*/ - - UINT32 key; /* 0 = KEY OFF, >0 = KEY ON */ + uint8_t eg_type; /* percussive/nonpercussive mode*/ + uint8_t state; /* phase type */ + uint32_t TL; /* total level: TL << 2 */ + int32_t TLL; /* adjusted now TL */ + int32_t volume; /* envelope counter */ + uint32_t sl; /* sustain level: sl_tab[SL] */ + + uint8_t eg_sh_dp; /* (dump state) */ + uint8_t eg_sel_dp; /* (dump state) */ + uint8_t eg_sh_ar; /* (attack state) */ + uint8_t eg_sel_ar; /* (attack state) */ + uint8_t eg_sh_dr; /* (decay state) */ + uint8_t eg_sel_dr; /* (decay state) */ + uint8_t eg_sh_rr; /* (release state for non-perc.)*/ + uint8_t eg_sel_rr; /* (release state for non-perc.)*/ + uint8_t eg_sh_rs; /* (release state for perc.mode)*/ + uint8_t eg_sel_rs; /* (release state for perc.mode)*/ + + uint32_t key; /* 0 = KEY OFF, >0 = KEY ON */ /* LFO */ - UINT32 AMmask; /* LFO Amplitude Modulation enable mask */ - UINT8 vib; /* LFO Phase Modulation enable flag (active high)*/ + uint32_t AMmask; /* LFO Amplitude Modulation enable mask */ + uint8_t vib; /* LFO Phase Modulation enable flag (active high)*/ /* waveform select */ unsigned int wavetable; @@ -78,11 +78,11 @@ private: { OPLL_SLOT SLOT[2]; /* phase generator state */ - UINT32 block_fnum; /* block+fnum */ - UINT32 fc; /* Freq. freqement base */ - UINT32 ksl_base; /* KeyScaleLevel Base step */ - UINT8 kcode; /* key code (for key scaling) */ - UINT8 sus; /* sus on/off (release speed in percussive mode)*/ + uint32_t block_fnum; /* block+fnum */ + uint32_t fc; /* Freq. freqement base */ + uint32_t ksl_base; /* KeyScaleLevel Base step */ + uint8_t kcode; /* key code (for key scaling) */ + uint8_t sus; /* sus on/off (release speed in percussive mode)*/ }; enum { @@ -107,14 +107,14 @@ private: }; static const double ksl_tab[8*16]; - static const UINT32 ksl_shift[4]; - static const UINT32 sl_tab[16]; + static const uint32_t ksl_shift[4]; + static const uint32_t sl_tab[16]; static const unsigned char eg_inc[15*RATE_STEPS]; static const unsigned char eg_rate_select[16+64+16]; static const unsigned char eg_rate_shift[16+64+16]; - static const UINT8 mul_tab[16]; - static const UINT8 lfo_am_table[LFO_AM_TAB_ELEMENTS]; - static const INT8 lfo_pm_table[8*8]; + static const uint8_t mul_tab[16]; + static const uint8_t lfo_am_table[LFO_AM_TAB_ELEMENTS]; + static const int8_t lfo_pm_table[8*8]; static const unsigned char table[19][8]; int tl_tab[TL_TAB_LEN]; @@ -125,26 +125,26 @@ private: OPLL_CH P_CH[9]; /* OPLL chips have 9 channels*/ - UINT8 instvol_r[9]; /* instrument/volume (or volume/volume in percussive mode)*/ + uint8_t instvol_r[9]; /* instrument/volume (or volume/volume in percussive mode)*/ - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/72 */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow; /* envelope generator timer overlfows every 1 sample (on real chip) */ + uint32_t eg_cnt; /* global envelope generator counter */ + uint32_t eg_timer; /* global envelope generator counter works at frequency = chipclock/72 */ + uint32_t eg_timer_add; /* step of eg_timer */ + uint32_t eg_timer_overflow; /* envelope generator timer overlfows every 1 sample (on real chip) */ - UINT8 rhythm; /* Rhythm mode */ + uint8_t rhythm; /* Rhythm mode */ /* LFO */ - UINT32 LFO_AM; - INT32 LFO_PM; - UINT32 lfo_am_cnt; - UINT32 lfo_am_inc; - UINT32 lfo_pm_cnt; - UINT32 lfo_pm_inc; + uint32_t LFO_AM; + int32_t LFO_PM; + uint32_t lfo_am_cnt; + uint32_t lfo_am_inc; + uint32_t lfo_pm_cnt; + uint32_t lfo_pm_inc; - UINT32 noise_rng; /* 23 bit noise shift register */ - UINT32 noise_p; /* current noise 'phase' */ - UINT32 noise_f; /* current noise period */ + uint32_t noise_rng; /* 23 bit noise shift register */ + uint32_t noise_p; /* current noise 'phase' */ + uint32_t noise_f; /* current noise period */ /* instrument settings */ @@ -154,11 +154,11 @@ private: 16 -bass drum settings 17,18 - other percussion instruments */ - UINT8 inst_tab[19][8]; + uint8_t inst_tab[19][8]; - UINT32 fn_tab[1024]; /* fnumber->increment counter */ + uint32_t fn_tab[1024]; /* fnumber->increment counter */ - UINT8 address; /* address register */ + uint8_t address; /* address register */ signed int output[2]; @@ -168,20 +168,20 @@ private: int limit( int val, int max, int min ); void advance_lfo(); void advance(); - int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab); - int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab); + int op_calc(uint32_t phase, unsigned int env, signed int pm, unsigned int wave_tab); + int op_calc1(uint32_t phase, unsigned int env, signed int pm, unsigned int wave_tab); void chan_calc( OPLL_CH *CH ); void rhythm_calc( OPLL_CH *CH, unsigned int noise ); - void key_on(OPLL_SLOT *SLOT, UINT32 key_set); - void key_off(OPLL_SLOT *SLOT, UINT32 key_clr); + void key_on(OPLL_SLOT *SLOT, uint32_t key_set); + void key_off(OPLL_SLOT *SLOT, uint32_t key_clr); void calc_fcslot(OPLL_CH *CH, OPLL_SLOT *SLOT); void set_mul(int slot,int v); void set_ksl_tl(int chan,int v); void set_ksl_wave_fb(int chan,int v); void set_ar_dr(int slot,int v); void set_sl_rr(int slot,int v); - void load_instrument(UINT32 chan, UINT32 slot, UINT8* inst ); - void update_instrument_zero( UINT8 r ); + void load_instrument(uint32_t chan, uint32_t slot, uint8_t* inst ); + void update_instrument_zero( uint8_t r ); void write_reg(int r, int v); }; diff --git a/src/devices/sound/ymdeltat.cpp b/src/devices/sound/ymdeltat.cpp index ad8c0f12b13..68ad3add2e8 100644 --- a/src/devices/sound/ymdeltat.cpp +++ b/src/devices/sound/ymdeltat.cpp @@ -78,13 +78,13 @@ /* Forecast to next Forecast (rate = *8) */ /* 1/8 , 3/8 , 5/8 , 7/8 , 9/8 , 11/8 , 13/8 , 15/8 */ -static const INT32 ym_deltat_decode_tableB1[16] = { +static const int32_t ym_deltat_decode_tableB1[16] = { 1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9, -11, -13, -15, }; /* delta to next delta (rate= *64) */ /* 0.9 , 0.9 , 0.9 , 0.9 , 1.2 , 1.6 , 2.0 , 2.4 */ -static const INT32 ym_deltat_decode_tableB2[16] = { +static const int32_t ym_deltat_decode_tableB2[16] = { 57, 57, 57, 57, 77, 102, 128, 153, 57, 57, 57, 57, 77, 102, 128, 153 }; @@ -101,9 +101,9 @@ void YM_DELTAT_BRDY_callback(YM_DELTAT *DELTAT) } #endif -UINT8 YM_DELTAT_ADPCM_Read(YM_DELTAT *DELTAT) +uint8_t YM_DELTAT_ADPCM_Read(YM_DELTAT *DELTAT) { - UINT8 v = 0; + uint8_t v = 0; /* external memory read */ if ( (DELTAT->portstate & 0xe0)==0x20 ) @@ -153,7 +153,7 @@ UINT8 YM_DELTAT_ADPCM_Read(YM_DELTAT *DELTAT) /* 0-DRAM x1, 1-ROM, 2-DRAM x8, 3-ROM (3 is bad setting - not allowed by the manual) */ -static const UINT8 dram_rightshift[4]={3,0,0,0}; +static const uint8_t dram_rightshift[4]={3,0,0,0}; /* DELTA-T ADPCM write register */ void YM_DELTAT_ADPCM_Write(YM_DELTAT *DELTAT,int r,int v) @@ -383,12 +383,12 @@ value: START, REC, MEMDAT, REPEAT, SPOFF, x,x,RESET meaning: case 0x09: /* DELTA-N L (ADPCM Playback Prescaler) */ case 0x0a: /* DELTA-N H */ DELTAT->delta = (DELTAT->reg[0xa]*0x0100 | DELTAT->reg[0x9]); - DELTAT->step = (UINT32)( (double)(DELTAT->delta /* *(1<<(YM_DELTAT_SHIFT-16)) */ ) * (DELTAT->freqbase) ); + DELTAT->step = (uint32_t)( (double)(DELTAT->delta /* *(1<<(YM_DELTAT_SHIFT-16)) */ ) * (DELTAT->freqbase) ); /*logerror("DELTAT deltan:09=%2x 0a=%2x\n",DELTAT->reg[0x9], DELTAT->reg[0xa]);*/ break; case 0x0b: /* Output level control (volume, linear) */ { - INT32 oldvol = DELTAT->volume; + int32_t oldvol = DELTAT->volume; DELTAT->volume = (v&0xff) * (DELTAT->output_range/256) / YM_DELTAT_DECODE_RANGE; /* v * ((1<<16)>>8) >> 15; * thus: v * (1<<8) >> 15; @@ -426,7 +426,7 @@ void YM_DELTAT_ADPCM_Reset(YM_DELTAT *DELTAT,int pan,int emulation_mode,device_t DELTAT->prev_acc = 0; DELTAT->adpcmd = 127; DELTAT->adpcml = 0; - DELTAT->emulation_mode = (UINT8)emulation_mode; + DELTAT->emulation_mode = (uint8_t)emulation_mode; DELTAT->portstate = (emulation_mode == YM_DELTAT_EMULATION_MODE_YM2610) ? 0x20 : 0; DELTAT->control2 = (emulation_mode == YM_DELTAT_EMULATION_MODE_YM2610) ? 0x01 : 0; /* default setting depends on the emulation mode. MSX demo called "facdemo_4" doesn't setup control2 register at all and still works */ DELTAT->DRAMportshift = dram_rightshift[DELTAT->control2 & 3]; @@ -440,7 +440,7 @@ void YM_DELTAT_ADPCM_Reset(YM_DELTAT *DELTAT,int pan,int emulation_mode,device_t (DELTAT->status_set_handler)(DELTAT->status_change_which_chip, DELTAT->status_change_BRDY_bit); } -void YM_DELTAT_postload(YM_DELTAT *DELTAT,UINT8 *regs) +void YM_DELTAT_postload(YM_DELTAT *DELTAT,uint8_t *regs) { int r; @@ -478,7 +478,7 @@ void YM_DELTAT_savestate(device_t *device,YM_DELTAT *DELTAT) static inline void YM_DELTAT_synthesis_from_external_memory(YM_DELTAT *DELTAT) { - UINT32 step; + uint32_t step; int data; DELTAT->now_step += DELTAT->step; @@ -559,7 +559,7 @@ static inline void YM_DELTAT_synthesis_from_external_memory(YM_DELTAT *DELTAT) static inline void YM_DELTAT_synthesis_from_CPU_memory(YM_DELTAT *DELTAT) { - UINT32 step; + uint32_t step; int data; DELTAT->now_step += DELTAT->step; diff --git a/src/devices/sound/ymdeltat.h b/src/devices/sound/ymdeltat.h index 2786f527a38..10c3df7c52e 100644 --- a/src/devices/sound/ymdeltat.h +++ b/src/devices/sound/ymdeltat.h @@ -11,46 +11,46 @@ #define YM_DELTAT_EMULATION_MODE_YM2610 1 -typedef void (*STATUS_CHANGE_HANDLER)(void *chip, UINT8 status_bits); +typedef void (*STATUS_CHANGE_HANDLER)(void *chip, uint8_t status_bits); /* DELTA-T (adpcm type B) struct */ struct YM_DELTAT { /* AT: rearranged and tigntened structure */ - UINT8 *memory; - INT32 *output_pointer;/* pointer of output pointers */ - INT32 *pan; /* pan : &output_pointer[pan] */ + uint8_t *memory; + int32_t *output_pointer;/* pointer of output pointers */ + int32_t *pan; /* pan : &output_pointer[pan] */ double freqbase; #if 0 double write_time; /* Y8950: 10 cycles of main clock; YM2608: 20 cycles of main clock */ double read_time; /* Y8950: 8 cycles of main clock; YM2608: 18 cycles of main clock */ #endif - UINT32 memory_size; + uint32_t memory_size; int output_range; - UINT32 now_addr; /* current address */ - UINT32 now_step; /* currect step */ - UINT32 step; /* step */ - UINT32 start; /* start address */ - UINT32 limit; /* limit address */ - UINT32 end; /* end address */ - UINT32 delta; /* delta scale */ - INT32 volume; /* current volume */ - INT32 acc; /* shift Measurement value*/ - INT32 adpcmd; /* next Forecast */ - INT32 adpcml; /* current value */ - INT32 prev_acc; /* leveling value */ - UINT8 now_data; /* current rom data */ - UINT8 CPU_data; /* current data from reg 08 */ - UINT8 portstate; /* port status */ - UINT8 control2; /* control reg: SAMPLE, DA/AD, RAM TYPE (x8bit / x1bit), ROM/RAM */ - UINT8 portshift; /* address bits shift-left: + uint32_t now_addr; /* current address */ + uint32_t now_step; /* currect step */ + uint32_t step; /* step */ + uint32_t start; /* start address */ + uint32_t limit; /* limit address */ + uint32_t end; /* end address */ + uint32_t delta; /* delta scale */ + int32_t volume; /* current volume */ + int32_t acc; /* shift Measurement value*/ + int32_t adpcmd; /* next Forecast */ + int32_t adpcml; /* current value */ + int32_t prev_acc; /* leveling value */ + uint8_t now_data; /* current rom data */ + uint8_t CPU_data; /* current data from reg 08 */ + uint8_t portstate; /* port status */ + uint8_t control2; /* control reg: SAMPLE, DA/AD, RAM TYPE (x8bit / x1bit), ROM/RAM */ + uint8_t portshift; /* address bits shift-left: ** 8 for YM2610, ** 5 for Y8950 and YM2608 */ - UINT8 DRAMportshift; /* address bits shift-right: + uint8_t DRAMportshift; /* address bits shift-right: ** 0 for ROM and x8bit DRAMs, ** 3 for x1 DRAMs */ - UINT8 memread; /* needed for reading/writing external memory */ + uint8_t memread; /* needed for reading/writing external memory */ /* handlers and parameters for the status flags support */ STATUS_CHANGE_HANDLER status_set_handler; @@ -60,28 +60,28 @@ struct YM_DELTAT { /* AT: rearranged and tigntened structure */ ** bits of the status register */ void * status_change_which_chip; /* this chip id */ - UINT8 status_change_EOS_bit; /* 1 on End Of Sample (record/playback/cycle time of AD/DA converting has passed)*/ - UINT8 status_change_BRDY_bit; /* 1 after recording 2 datas (2x4bits) or after reading/writing 1 data */ - UINT8 status_change_ZERO_bit; /* 1 if silence lasts for more than 290 miliseconds on ADPCM recording */ + uint8_t status_change_EOS_bit; /* 1 on End Of Sample (record/playback/cycle time of AD/DA converting has passed)*/ + uint8_t status_change_BRDY_bit; /* 1 after recording 2 datas (2x4bits) or after reading/writing 1 data */ + uint8_t status_change_ZERO_bit; /* 1 if silence lasts for more than 290 miliseconds on ADPCM recording */ /* neither Y8950 nor YM2608 can generate IRQ when PCMBSY bit changes, so instead of above, ** the statusflag gets ORed with PCM_BSY (below) (on each read of statusflag of Y8950 and YM2608) */ - UINT8 PCM_BSY; /* 1 when ADPCM is playing; Y8950/YM2608 only */ + uint8_t PCM_BSY; /* 1 when ADPCM is playing; Y8950/YM2608 only */ - UINT8 reg[16]; /* adpcm registers */ - UINT8 emulation_mode; /* which chip we're emulating */ + uint8_t reg[16]; /* adpcm registers */ + uint8_t emulation_mode; /* which chip we're emulating */ device_t *device; }; /*void YM_DELTAT_BRDY_callback(YM_DELTAT *DELTAT);*/ -UINT8 YM_DELTAT_ADPCM_Read(YM_DELTAT *DELTAT); +uint8_t YM_DELTAT_ADPCM_Read(YM_DELTAT *DELTAT); void YM_DELTAT_ADPCM_Write(YM_DELTAT *DELTAT,int r,int v); void YM_DELTAT_ADPCM_Reset(YM_DELTAT *DELTAT,int pan,int emulation_mode, device_t *device); void YM_DELTAT_ADPCM_CALC(YM_DELTAT *DELTAT); -void YM_DELTAT_postload(YM_DELTAT *DELTAT,UINT8 *regs); +void YM_DELTAT_postload(YM_DELTAT *DELTAT,uint8_t *regs); void YM_DELTAT_savestate(device_t *device,YM_DELTAT *DELTAT); #endif /* __YMDELTAT_H__ */ diff --git a/src/devices/sound/ymf262.cpp b/src/devices/sound/ymf262.cpp index 13db00967ae..c5829f69850 100644 --- a/src/devices/sound/ymf262.cpp +++ b/src/devices/sound/ymf262.cpp @@ -139,48 +139,48 @@ static FILE *sample[1]; struct OPL3_SLOT { - UINT32 ar; /* attack rate: AR<<2 */ - UINT32 dr; /* decay rate: DR<<2 */ - UINT32 rr; /* release rate:RR<<2 */ - UINT8 KSR; /* key scale rate */ - UINT8 ksl; /* keyscale level */ - UINT8 ksr; /* key scale rate: kcode>>KSR */ - UINT8 mul; /* multiple: mul_tab[ML] */ + uint32_t ar; /* attack rate: AR<<2 */ + uint32_t dr; /* decay rate: DR<<2 */ + uint32_t rr; /* release rate:RR<<2 */ + uint8_t KSR; /* key scale rate */ + uint8_t ksl; /* keyscale level */ + uint8_t ksr; /* key scale rate: kcode>>KSR */ + uint8_t mul; /* multiple: mul_tab[ML] */ /* Phase Generator */ - UINT32 Cnt; /* frequency counter */ - UINT32 Incr; /* frequency counter step */ - UINT8 FB; /* feedback shift value */ - INT32 *connect; /* slot output pointer */ - INT32 op1_out[2]; /* slot1 output for feedback */ - UINT8 CON; /* connection (algorithm) type */ + uint32_t Cnt; /* frequency counter */ + uint32_t Incr; /* frequency counter step */ + uint8_t FB; /* feedback shift value */ + int32_t *connect; /* slot output pointer */ + int32_t op1_out[2]; /* slot1 output for feedback */ + uint8_t CON; /* connection (algorithm) type */ /* Envelope Generator */ - UINT8 eg_type; /* percussive/non-percussive mode */ - UINT8 state; /* phase type */ - UINT32 TL; /* total level: TL << 2 */ - INT32 TLL; /* adjusted now TL */ - INT32 volume; /* envelope counter */ - UINT32 sl; /* sustain level: sl_tab[SL] */ - - UINT32 eg_m_ar; /* (attack state) */ - UINT8 eg_sh_ar; /* (attack state) */ - UINT8 eg_sel_ar; /* (attack state) */ - UINT32 eg_m_dr; /* (decay state) */ - UINT8 eg_sh_dr; /* (decay state) */ - UINT8 eg_sel_dr; /* (decay state) */ - UINT32 eg_m_rr; /* (release state) */ - UINT8 eg_sh_rr; /* (release state) */ - UINT8 eg_sel_rr; /* (release state) */ - - UINT32 key; /* 0 = KEY OFF, >0 = KEY ON */ + uint8_t eg_type; /* percussive/non-percussive mode */ + uint8_t state; /* phase type */ + uint32_t TL; /* total level: TL << 2 */ + int32_t TLL; /* adjusted now TL */ + int32_t volume; /* envelope counter */ + uint32_t sl; /* sustain level: sl_tab[SL] */ + + uint32_t eg_m_ar; /* (attack state) */ + uint8_t eg_sh_ar; /* (attack state) */ + uint8_t eg_sel_ar; /* (attack state) */ + uint32_t eg_m_dr; /* (decay state) */ + uint8_t eg_sh_dr; /* (decay state) */ + uint8_t eg_sel_dr; /* (decay state) */ + uint32_t eg_m_rr; /* (release state) */ + uint8_t eg_sh_rr; /* (release state) */ + uint8_t eg_sel_rr; /* (release state) */ + + uint32_t key; /* 0 = KEY OFF, >0 = KEY ON */ /* LFO */ - UINT32 AMmask; /* LFO Amplitude Modulation enable mask */ - UINT8 vib; /* LFO Phase Modulation enable flag (active high)*/ + uint32_t AMmask; /* LFO Amplitude Modulation enable mask */ + uint8_t vib; /* LFO Phase Modulation enable flag (active high)*/ /* waveform select */ - UINT8 waveform_number; + uint8_t waveform_number; unsigned int wavetable; //unsigned char reserved[128-84];//speedup: pump up the struct size to power of 2 @@ -192,10 +192,10 @@ struct OPL3_CH { OPL3_SLOT SLOT[2]; - UINT32 block_fnum; /* block+fnum */ - UINT32 fc; /* Freq. Increment base */ - UINT32 ksl_base; /* KeyScaleLevel Base step */ - UINT8 kcode; /* key code (for key scaling) */ + uint32_t block_fnum; /* block+fnum */ + uint32_t fc; /* Freq. Increment base */ + uint32_t ksl_base; /* KeyScaleLevel Base step */ + uint8_t kcode; /* key code (for key scaling) */ /* there are 12 2-operator channels which can be combined in pairs @@ -207,7 +207,7 @@ struct OPL3_CH 10 and 13, 11 and 14 */ - UINT8 extended; /* set to 1 if this channel forms up a 4op channel with another channel(only used by first of pair of channels, ie 0,1,2 and 9,10,11) */ + uint8_t extended; /* set to 1 if this channel forms up a 4op channel with another channel(only used by first of pair of channels, ie 0,1,2 and 9,10,11) */ unsigned char reserved[512-272];//speedup:pump up the struct size to power of 2 @@ -218,47 +218,47 @@ struct OPL3 { OPL3_CH P_CH[18]; /* OPL3 chips have 18 channels */ - UINT32 pan[18*4]; /* channels output masks (0xffffffff = enable); 4 masks per one channel */ - UINT32 pan_ctrl_value[18]; /* output control values 1 per one channel (1 value contains 4 masks) */ + uint32_t pan[18*4]; /* channels output masks (0xffffffff = enable); 4 masks per one channel */ + uint32_t pan_ctrl_value[18]; /* output control values 1 per one channel (1 value contains 4 masks) */ signed int chanout[18]; signed int phase_modulation; /* phase modulation input (SLOT 2) */ signed int phase_modulation2; /* phase modulation input (SLOT 3 in 4 operator channels) */ - UINT32 eg_cnt; /* global envelope generator counter */ - UINT32 eg_timer; /* global envelope generator counter works at frequency = chipclock/288 (288=8*36) */ - UINT32 eg_timer_add; /* step of eg_timer */ - UINT32 eg_timer_overflow; /* envelope generator timer overlfows every 1 sample (on real chip) */ + uint32_t eg_cnt; /* global envelope generator counter */ + uint32_t eg_timer; /* global envelope generator counter works at frequency = chipclock/288 (288=8*36) */ + uint32_t eg_timer_add; /* step of eg_timer */ + uint32_t eg_timer_overflow; /* envelope generator timer overlfows every 1 sample (on real chip) */ - UINT32 fn_tab[1024]; /* fnumber->increment counter */ + uint32_t fn_tab[1024]; /* fnumber->increment counter */ /* LFO */ - UINT32 LFO_AM; - INT32 LFO_PM; + uint32_t LFO_AM; + int32_t LFO_PM; - UINT8 lfo_am_depth; - UINT8 lfo_pm_depth_range; - UINT32 lfo_am_cnt; - UINT32 lfo_am_inc; - UINT32 lfo_pm_cnt; - UINT32 lfo_pm_inc; + uint8_t lfo_am_depth; + uint8_t lfo_pm_depth_range; + uint32_t lfo_am_cnt; + uint32_t lfo_am_inc; + uint32_t lfo_pm_cnt; + uint32_t lfo_pm_inc; - UINT32 noise_rng; /* 23 bit noise shift register */ - UINT32 noise_p; /* current noise 'phase' */ - UINT32 noise_f; /* current noise period */ + uint32_t noise_rng; /* 23 bit noise shift register */ + uint32_t noise_p; /* current noise 'phase' */ + uint32_t noise_f; /* current noise period */ - UINT8 OPL3_mode; /* OPL3 extension enable flag */ + uint8_t OPL3_mode; /* OPL3 extension enable flag */ - UINT8 rhythm; /* Rhythm mode */ + uint8_t rhythm; /* Rhythm mode */ int T[2]; /* timer counters */ - UINT8 st[2]; /* timer enable */ + uint8_t st[2]; /* timer enable */ - UINT32 address; /* address register */ - UINT8 status; /* status flag */ - UINT8 statusmask; /* status mask */ + uint32_t address; /* address register */ + uint8_t status; /* status flag */ + uint8_t statusmask; /* status mask */ - UINT8 nts; /* NTS (note select) */ + uint8_t nts; /* NTS (note select) */ /* external event callback handlers */ OPL3_TIMERHANDLER timer_handler;/* TIMER handler */ @@ -268,7 +268,7 @@ struct OPL3 OPL3_UPDATEHANDLER UpdateHandler;/* stream update handler */ void *UpdateParam; /* stream update parameter */ - UINT8 type; /* chip type */ + uint8_t type; /* chip type */ int clock; /* master clock (Hz) */ int rate; /* sampling rate (Hz) */ double freqbase; /* frequency base */ @@ -337,13 +337,13 @@ static const double ksl_tab[8*16]= #undef DV /* 0 / 3.0 / 1.5 / 6.0 dB/OCT */ -static const UINT32 ksl_shift[4] = { 31, 1, 2, 0 }; +static const uint32_t ksl_shift[4] = { 31, 1, 2, 0 }; /* sustain level table (3dB per step) */ /* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/ -#define SC(db) (UINT32) ( db * (2.0/ENV_STEP) ) -static const UINT32 sl_tab[16]={ +#define SC(db) (uint32_t) ( db * (2.0/ENV_STEP) ) +static const uint32_t sl_tab[16]={ SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7), SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31) }; @@ -458,7 +458,7 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0), /* multiple table */ #define ML 2 -static const UINT8 mul_tab[16]= { +static const uint8_t mul_tab[16]= { /* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */ ML/2, 1*ML, 2*ML, 3*ML, 4*ML, 5*ML, 6*ML, 7*ML, 8*ML, 9*ML,10*ML,10*ML,12*ML,12*ML,15*ML,15*ML @@ -499,7 +499,7 @@ static unsigned int sin_tab[SIN_LEN * 8]; #define LFO_AM_TAB_ELEMENTS 210 -static const UINT8 lfo_am_table[LFO_AM_TAB_ELEMENTS] = { +static const uint8_t lfo_am_table[LFO_AM_TAB_ELEMENTS] = { 0,0,0,0,0,0,0, 1,1,1,1, 2,2,2,2, @@ -555,7 +555,7 @@ static const UINT8 lfo_am_table[LFO_AM_TAB_ELEMENTS] = { }; /* LFO Phase Modulation table (verified on real YM3812) */ -static const INT8 lfo_pm_table[8*8*2] = { +static const int8_t lfo_pm_table[8*8*2] = { /* FNUM2/FNUM = 00 0xxxxxxx (0x0000) */ 0, 0, 0, 0, 0, 0, 0, 0, /*LFO PM depth = 0*/ 0, 0, 0, 0, 0, 0, 0, 0, /*LFO PM depth = 1*/ @@ -658,12 +658,12 @@ static inline void OPL3_STATUSMASK_SET(OPL3 *chip,int flag) /* advance LFO to next sample */ static inline void advance_lfo(OPL3 *chip) { - UINT8 tmp; + uint8_t tmp; /* LFO */ chip->lfo_am_cnt += chip->lfo_am_inc; - if (chip->lfo_am_cnt >= ((UINT32)LFO_AM_TAB_ELEMENTS<lfo_am_cnt -= ((UINT32)LFO_AM_TAB_ELEMENTS<lfo_am_cnt >= ((uint32_t)LFO_AM_TAB_ELEMENTS<lfo_am_cnt -= ((uint32_t)LFO_AM_TAB_ELEMENTS<lfo_am_cnt >> LFO_SH ]; @@ -783,7 +783,7 @@ static inline void advance(OPL3 *chip) /* Phase Generator */ if(op->vib) { - UINT8 block; + uint8_t block; unsigned int block_fnum = CH->block_fnum; unsigned int fnum_lfo = (block_fnum&0x0380) >> 7; @@ -824,7 +824,7 @@ static inline void advance(OPL3 *chip) while (i) { /* - UINT32 j; + uint32_t j; j = ( (chip->noise_rng) ^ (chip->noise_rng>>14) ^ (chip->noise_rng>>15) ^ (chip->noise_rng>>22) ) & 1; chip->noise_rng = (j<<22) | (chip->noise_rng>>1); */ @@ -845,9 +845,9 @@ static inline void advance(OPL3 *chip) } -static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc(uint32_t phase, unsigned int env, signed int pm, unsigned int wave_tab) { - UINT32 p; + uint32_t p; p = (env<<4) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + (pm<<16))) >> FREQ_SH ) & SIN_MASK) ]; @@ -856,9 +856,9 @@ static inline signed int op_calc(UINT32 phase, unsigned int env, signed int pm, return tl_tab[p]; } -static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, unsigned int wave_tab) +static inline signed int op_calc1(uint32_t phase, unsigned int env, signed int pm, unsigned int wave_tab) { - UINT32 p; + uint32_t p; p = (env<<4) + sin_tab[wave_tab + ((((signed int)((phase & ~FREQ_MASK) + pm))>>FREQ_SH) & SIN_MASK)]; @@ -868,7 +868,7 @@ static inline signed int op_calc1(UINT32 phase, unsigned int env, signed int pm, } -#define volume_calc(OP) ((OP)->TLL + ((UINT32)(OP)->volume) + (chip->LFO_AM & (OP)->AMmask)) +#define volume_calc(OP) ((OP)->TLL + ((uint32_t)(OP)->volume) + (chip->LFO_AM & (OP)->AMmask)) /* calculate output of a standard 2 operator channel (or 1st part of a 4-op channel) */ @@ -1043,7 +1043,7 @@ static inline void chan_calc_rhythm( OPL3 *chip, OPL3_CH *CH, unsigned int noise /* when res1 = 0 phase = 0x000 | 0xd0; */ /* when res1 = 1 phase = 0x200 | (0xd0>>2); */ - UINT32 phase = res1 ? (0x200|(0xd0>>2)) : 0xd0; + uint32_t phase = res1 ? (0x200|(0xd0>>2)) : 0xd0; /* enable gate based on frequency of operator 2 in channel 8 */ unsigned char bit5e= ((SLOT8_2->Cnt>>FREQ_SH)>>5)&1; @@ -1084,7 +1084,7 @@ static inline void chan_calc_rhythm( OPL3 *chip, OPL3_CH *CH, unsigned int noise /* when bit8 = 0 phase = 0x100; */ /* when bit8 = 1 phase = 0x200; */ - UINT32 phase = bit8 ? 0x200 : 0x100; + uint32_t phase = bit8 ? 0x200 : 0x100; /* Noise bit XOR'es phase by 0x100 */ /* when noisebit = 0 pass the phase from calculation above */ @@ -1114,7 +1114,7 @@ static inline void chan_calc_rhythm( OPL3 *chip, OPL3_CH *CH, unsigned int noise /* when res1 = 0 phase = 0x000 | 0x100; */ /* when res1 = 1 phase = 0x200 | 0x100; */ - UINT32 phase = res1 ? 0x300 : 0x100; + uint32_t phase = res1 ? 0x300 : 0x100; /* enable gate based on frequency of operator 2 in channel 8 */ unsigned char bit5e= ((SLOT8_2->Cnt>>FREQ_SH)>>5)&1; @@ -1320,7 +1320,7 @@ static void OPL3_initalize(OPL3 *chip) for( i=0 ; i < 1024 ; i++ ) { /* opn phase increment counter = 20bit */ - chip->fn_tab[i] = (UINT32)( (double)i * 64 * chip->freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ + chip->fn_tab[i] = (uint32_t)( (double)i * 64 * chip->freqbase * (1<<(FREQ_SH-10)) ); /* -10 because chip works with 10.10 fixed point, while we use 16.16 */ #if 0 logerror("YMF262.C: fn_tab[%4i] = %08x (dec=%8i)\n", i, chip->fn_tab[i]>>6, chip->fn_tab[i]>>6 ); @@ -1339,7 +1339,7 @@ static void OPL3_initalize(OPL3 *chip) logerror("YMF262.C: ksl_tab[oct=%2i] =",i); for (j=0; j<16; j++) { - logerror("%08x ", static_cast(ksl_tab[i*16+j]) ); + logerror("%08x ", static_cast(ksl_tab[i*16+j]) ); } logerror("\n"); } @@ -1364,7 +1364,7 @@ static void OPL3_initalize(OPL3 *chip) } -static inline void FM_KEYON(OPL3_SLOT *SLOT, UINT32 key_set) +static inline void FM_KEYON(OPL3_SLOT *SLOT, uint32_t key_set) { if( !SLOT->key ) { @@ -1376,7 +1376,7 @@ static inline void FM_KEYON(OPL3_SLOT *SLOT, UINT32 key_set) SLOT->key |= key_set; } -static inline void FM_KEYOFF(OPL3_SLOT *SLOT, UINT32 key_clr) +static inline void FM_KEYOFF(OPL3_SLOT *SLOT, uint32_t key_clr) { if( SLOT->key ) { @@ -1630,7 +1630,7 @@ static void OPL3WriteReg(OPL3 *chip, int r, int v) case 0x104: /* 6 channels enable */ { - UINT8 prev; + uint8_t prev; CH = &chip->P_CH[0]; /* channel 0 */ prev = CH->extended; @@ -1716,8 +1716,8 @@ static void OPL3WriteReg(OPL3 *chip, int r, int v) } else { /* set IRQ mask ,timer enable */ - UINT8 st1 = v & 1; - UINT8 st2 = (v>>1) & 1; + uint8_t st1 = v & 1; + uint8_t st2 = (v>>1) & 1; /* IRQRST,T1MSK,t2MSK,x,x,x,ST2,ST1 */ OPL3_STATUS_RESET(chip, v & 0x60); @@ -1938,11 +1938,11 @@ static void OPL3WriteReg(OPL3 *chip, int r, int v) /* update */ if(CH->block_fnum != block_fnum) { - UINT8 block = block_fnum >> 10; + uint8_t block = block_fnum >> 10; CH->block_fnum = block_fnum; - CH->ksl_base = static_cast(ksl_tab[block_fnum>>6]); + CH->ksl_base = static_cast(ksl_tab[block_fnum>>6]); CH->fc = chip->fn_tab[block_fnum&0x03ff] >> (7-block); /* BLK 2,1,0 bits -> bits 3,2,1 of kcode */ @@ -2088,7 +2088,7 @@ static void OPL3WriteReg(OPL3 *chip, int r, int v) case 9: case 10: case 11: if (CH->extended) { - UINT8 conn = (CH->SLOT[SLOT1].CON<<1) | ((CH+3)->SLOT[SLOT1].CON<<0); + uint8_t conn = (CH->SLOT[SLOT1].CON<<1) | ((CH+3)->SLOT[SLOT1].CON<<0); switch(conn) { case 0: @@ -2140,7 +2140,7 @@ static void OPL3WriteReg(OPL3 *chip, int r, int v) case 12: case 13: case 14: if ((CH-3)->extended) { - UINT8 conn = ((CH-3)->SLOT[SLOT1].CON<<1) | (CH->SLOT[SLOT1].CON<<0); + uint8_t conn = ((CH-3)->SLOT[SLOT1].CON<<1) | (CH->SLOT[SLOT1].CON<<0); switch(conn) { case 0: @@ -2487,7 +2487,7 @@ void ymf262_update_one(void *_chip, OPL3SAMPLE **buffers, int length) int i; OPL3 *chip = (OPL3 *)_chip; signed int *chanout = chip->chanout; - UINT8 rhythm = chip->rhythm&0x20; + uint8_t rhythm = chip->rhythm&0x20; OPL3SAMPLE *ch_a = buffers[0]; OPL3SAMPLE *ch_b = buffers[1]; diff --git a/src/devices/sound/ymf262.h b/src/devices/sound/ymf262.h index ef8e2fbf47a..638a551c92c 100644 --- a/src/devices/sound/ymf262.h +++ b/src/devices/sound/ymf262.h @@ -11,21 +11,21 @@ /* compiler dependence */ #ifndef __OSDCOMM_H__ #define __OSDCOMM_H__ -typedef unsigned char UINT8; /* unsigned 8bit */ -typedef unsigned short UINT16; /* unsigned 16bit */ -typedef unsigned int UINT32; /* unsigned 32bit */ -typedef signed char INT8; /* signed 8bit */ -typedef signed short INT16; /* signed 16bit */ -typedef signed int INT32; /* signed 32bit */ +typedef unsigned char uint8_t; /* unsigned 8bit */ +typedef unsigned short uint16_t; /* unsigned 16bit */ +typedef unsigned int uint32_t; /* unsigned 32bit */ +typedef signed char int8_t; /* signed 8bit */ +typedef signed short int16_t; /* signed 16bit */ +typedef signed int int32_t; /* signed 32bit */ #endif typedef stream_sample_t OPL3SAMPLE; /* #if (OPL3_SAMPLE_BITS==16) -typedef INT16 OPL3SAMPLE; +typedef int16_t OPL3SAMPLE; #endif #if (OPL3_SAMPLE_BITS==8) -typedef INT8 OPL3SAMPLE; +typedef int8_t OPL3SAMPLE; #endif */ diff --git a/src/devices/sound/ymf271.cpp b/src/devices/sound/ymf271.cpp index 653285f18a1..ed58c45d316 100644 --- a/src/devices/sound/ymf271.cpp +++ b/src/devices/sound/ymf271.cpp @@ -217,7 +217,7 @@ void ymf271_device::calculate_step(YMF271Slot *slot) st /= (double)(524288/65536); // pre-multiply with 65536 - slot->step = (UINT32)st; + slot->step = (uint32_t)st; } else { @@ -230,7 +230,7 @@ void ymf271_device::calculate_step(YMF271Slot *slot) st /= (double)(536870912/65536); // pre-multiply with 65536 - slot->step = (UINT32)st; + slot->step = (uint32_t)st; } } @@ -404,11 +404,11 @@ void ymf271_device::update_lfo(YMF271Slot *slot) calculate_step(slot); } -INT64 ymf271_device::calculate_slot_volume(YMF271Slot *slot) +int64_t ymf271_device::calculate_slot_volume(YMF271Slot *slot) { - INT64 volume; - INT64 env_volume; - INT64 lfo_volume = 65536; + int64_t volume; + int64_t env_volume; + int64_t lfo_volume = 65536; switch (slot->ams) { @@ -425,12 +425,12 @@ INT64 ymf271_device::calculate_slot_volume(YMF271Slot *slot) return volume; } -void ymf271_device::update_pcm(int slotnum, INT32 *mixp, int length) +void ymf271_device::update_pcm(int slotnum, int32_t *mixp, int length) { int i; - INT64 final_volume; - INT16 sample; - INT64 ch0_vol, ch1_vol; //, ch2_vol, ch3_vol; + int64_t final_volume; + int16_t sample; + int64_t ch0_vol, ch1_vol; //, ch2_vol, ch3_vol; YMF271Slot *slot = &m_slots[slotnum]; @@ -449,17 +449,17 @@ void ymf271_device::update_pcm(int slotnum, INT32 *mixp, int length) // loop if ((slot->stepptr>>16) > slot->endaddr) { - slot->stepptr = slot->stepptr - ((UINT64)slot->endaddr<<16) + ((UINT64)slot->loopaddr<<16); + slot->stepptr = slot->stepptr - ((uint64_t)slot->endaddr<<16) + ((uint64_t)slot->loopaddr<<16); if ((slot->stepptr>>16) > slot->endaddr) { // overflow slot->stepptr &= 0xffff; - slot->stepptr |= ((UINT64)slot->loopaddr<<16); + slot->stepptr |= ((uint64_t)slot->loopaddr<<16); if ((slot->stepptr>>16) > slot->endaddr) { // still overflow? (triggers in rdft2, rarely) slot->stepptr &= 0xffff; - slot->stepptr |= ((UINT64)slot->endaddr<<16); + slot->stepptr |= ((uint64_t)slot->endaddr<<16); } } } @@ -500,10 +500,10 @@ void ymf271_device::update_pcm(int slotnum, INT32 *mixp, int length) } // calculates the output of one FM operator -INT64 ymf271_device::calculate_op(int slotnum, INT64 inp) +int64_t ymf271_device::calculate_op(int slotnum, int64_t inp) { YMF271Slot *slot = &m_slots[slotnum]; - INT64 env, slot_output, slot_input = 0; + int64_t env, slot_output, slot_input = 0; update_envelope(slot); update_lfo(slot); @@ -528,7 +528,7 @@ INT64 ymf271_device::calculate_op(int slotnum, INT64 inp) return slot_output; } -void ymf271_device::set_feedback(int slotnum, INT64 inp) +void ymf271_device::set_feedback(int slotnum, int64_t inp) { YMF271Slot *slot = &m_slots[slotnum]; slot->feedback_modulation1 = (((inp << (SIN_BITS-2)) * feedback_level[slot->feedback]) / 16); @@ -542,7 +542,7 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t ** { int i, j; int op; - INT32 *mixp; + int32_t *mixp; memset(m_mix_buffer.get(), 0, sizeof(m_mix_buffer[0])*samples*2); @@ -573,8 +573,8 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t ** { for (i = 0; i < samples; i++) { - INT64 output1 = 0, output2 = 0, output3 = 0, output4 = 0; - INT64 phase_mod1, phase_mod2, phase_mod3; + int64_t output1 = 0, output2 = 0, output3 = 0, output4 = 0; + int64_t phase_mod1, phase_mod2, phase_mod3; switch (m_slots[slot1].algorithm) { // <--------| @@ -799,8 +799,8 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t ** { for (i = 0; i < samples; i++) { - INT64 output1 = 0, output3 = 0; - INT64 phase_mod1, phase_mod3; + int64_t output1 = 0, output3 = 0; + int64_t phase_mod1, phase_mod3; switch (m_slots[slot1].algorithm & 3) { // <--------| @@ -862,8 +862,8 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t ** { for (i = 0; i < samples; i++) { - INT64 output1 = 0, output2 = 0, output3 = 0; - INT64 phase_mod1, phase_mod3; + int64_t output1 = 0, output2 = 0, output3 = 0; + int64_t phase_mod1, phase_mod3; switch (m_slots[slot1].algorithm & 7) { // <--------| @@ -984,7 +984,7 @@ void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t ** } } -void ymf271_device::write_register(int slotnum, int reg, UINT8 data) +void ymf271_device::write_register(int slotnum, int reg, uint8_t data) { YMF271Slot *slot = &m_slots[slotnum]; @@ -1089,7 +1089,7 @@ void ymf271_device::write_register(int slotnum, int reg, UINT8 data) } } -void ymf271_device::ymf271_write_fm(int bank, UINT8 address, UINT8 data) +void ymf271_device::ymf271_write_fm(int bank, uint8_t address, uint8_t data) { int groupnum = fm_tab[address & 0xf]; if (groupnum == -1) @@ -1187,7 +1187,7 @@ void ymf271_device::ymf271_write_fm(int bank, UINT8 address, UINT8 data) } } -void ymf271_device::ymf271_write_pcm(UINT8 address, UINT8 data) +void ymf271_device::ymf271_write_pcm(uint8_t address, uint8_t data) { int slotnum = pcm_tab[address & 0xf]; if (slotnum == -1) @@ -1301,7 +1301,7 @@ void ymf271_device::device_timer(emu_timer &timer, device_timer_id id, int param } } -UINT8 ymf271_device::ymf271_read_memory(UINT32 offset) +uint8_t ymf271_device::ymf271_read_memory(uint32_t offset) { if (m_ext_read_handler.isnull()) { @@ -1319,7 +1319,7 @@ UINT8 ymf271_device::ymf271_read_memory(UINT32 offset) return m_ext_read_handler(offset); } -void ymf271_device::ymf271_write_timer(UINT8 address, UINT8 data) +void ymf271_device::ymf271_write_timer(uint8_t address, uint8_t data) { if ((address & 0xf0) == 0) { @@ -1487,7 +1487,7 @@ READ8_MEMBER( ymf271_device::read ) if (!m_ext_rw) return 0xff; - UINT8 ret = m_ext_readlatch; + uint8_t ret = m_ext_readlatch; m_ext_address = (m_ext_address + 1) & 0x7fffff; m_ext_readlatch = ymf271_read_memory(m_ext_address); return ret; @@ -1505,7 +1505,7 @@ void ymf271_device::init_tables() int i, j; for (i = 0; i < 8; i++) - m_lut_waves[i] = std::make_unique(SIN_LEN); + m_lut_waves[i] = std::make_unique(SIN_LEN); for (i = 0; i < 4*8; i++) m_lut_plfo[i>>3][i&7] = std::make_unique(LFO_LENGTH); @@ -1519,25 +1519,25 @@ void ymf271_device::init_tables() double m2 = sin( ((i*4)+1) * M_PI / SIN_LEN ); // Waveform 0: sin(wt) (0 <= wt <= 2PI) - m_lut_waves[0][i] = (INT16)(m * MAXOUT); + m_lut_waves[0][i] = (int16_t)(m * MAXOUT); // Waveform 1: sin?(wt) (0 <= wt <= PI) -sin?(wt) (PI <= wt <= 2PI) - m_lut_waves[1][i] = (i < (SIN_LEN/2)) ? (INT16)((m * m) * MAXOUT) : (INT16)((m * m) * MINOUT); + m_lut_waves[1][i] = (i < (SIN_LEN/2)) ? (int16_t)((m * m) * MAXOUT) : (int16_t)((m * m) * MINOUT); // Waveform 2: sin(wt) (0 <= wt <= PI) -sin(wt) (PI <= wt <= 2PI) - m_lut_waves[2][i] = (i < (SIN_LEN/2)) ? (INT16)(m * MAXOUT) : (INT16)(-m * MAXOUT); + m_lut_waves[2][i] = (i < (SIN_LEN/2)) ? (int16_t)(m * MAXOUT) : (int16_t)(-m * MAXOUT); // Waveform 3: sin(wt) (0 <= wt <= PI) 0 - m_lut_waves[3][i] = (i < (SIN_LEN/2)) ? (INT16)(m * MAXOUT) : 0; + m_lut_waves[3][i] = (i < (SIN_LEN/2)) ? (int16_t)(m * MAXOUT) : 0; // Waveform 4: sin(2wt) (0 <= wt <= PI) 0 - m_lut_waves[4][i] = (i < (SIN_LEN/2)) ? (INT16)(m2 * MAXOUT) : 0; + m_lut_waves[4][i] = (i < (SIN_LEN/2)) ? (int16_t)(m2 * MAXOUT) : 0; // Waveform 5: |sin(2wt)| (0 <= wt <= PI) 0 - m_lut_waves[5][i] = (i < (SIN_LEN/2)) ? (INT16)(fabs(m2) * MAXOUT) : 0; + m_lut_waves[5][i] = (i < (SIN_LEN/2)) ? (int16_t)(fabs(m2) * MAXOUT) : 0; // Waveform 6: 1 (0 <= wt <= 2PI) - m_lut_waves[6][i] = (INT16)(1 * MAXOUT); + m_lut_waves[6][i] = (int16_t)(1 * MAXOUT); m_lut_waves[7][i] = 0; } @@ -1717,7 +1717,7 @@ void ymf271_device::device_start() init_state(); m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()/384); - m_mix_buffer = std::make_unique(44100*2); + m_mix_buffer = std::make_unique(44100*2); } //------------------------------------------------- @@ -1746,7 +1746,7 @@ void ymf271_device::device_reset() const device_type YMF271 = &device_creator; -ymf271_device::ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ymf271_device::ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YMF271, "YMF271", tag, owner, clock, "ymf271", __FILE__) , device_sound_interface(mconfig, *this) , m_timerA(0) diff --git a/src/devices/sound/ymf271.h b/src/devices/sound/ymf271.h index 39d51a64d05..84e221048e0 100644 --- a/src/devices/sound/ymf271.h +++ b/src/devices/sound/ymf271.h @@ -19,7 +19,7 @@ class ymf271_device : public device_t, public device_sound_interface { public: - ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ymf271_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); } @@ -41,51 +41,51 @@ protected: private: struct YMF271Slot { - UINT8 ext_en; - UINT8 ext_out; - UINT8 lfoFreq; - UINT8 lfowave; - UINT8 pms, ams; - UINT8 detune; - UINT8 multiple; - UINT8 tl; - UINT8 keyscale; - UINT8 ar; - UINT8 decay1rate, decay2rate; - UINT8 decay1lvl; - UINT8 relrate; - UINT8 block; - UINT8 fns_hi; - UINT32 fns; - UINT8 feedback; - UINT8 waveform; - UINT8 accon; - UINT8 algorithm; - UINT8 ch0_level, ch1_level, ch2_level, ch3_level; - - UINT32 startaddr; - UINT32 loopaddr; - UINT32 endaddr; - UINT8 altloop; - UINT8 fs; - UINT8 srcnote, srcb; - - UINT32 step; - UINT64 stepptr; - - UINT8 active; - UINT8 bits; + uint8_t ext_en; + uint8_t ext_out; + uint8_t lfoFreq; + uint8_t lfowave; + uint8_t pms, ams; + uint8_t detune; + uint8_t multiple; + uint8_t tl; + uint8_t keyscale; + uint8_t ar; + uint8_t decay1rate, decay2rate; + uint8_t decay1lvl; + uint8_t relrate; + uint8_t block; + uint8_t fns_hi; + uint32_t fns; + uint8_t feedback; + uint8_t waveform; + uint8_t accon; + uint8_t algorithm; + uint8_t ch0_level, ch1_level, ch2_level, ch3_level; + + uint32_t startaddr; + uint32_t loopaddr; + uint32_t endaddr; + uint8_t altloop; + uint8_t fs; + uint8_t srcnote, srcb; + + uint32_t step; + uint64_t stepptr; + + uint8_t active; + uint8_t bits; // envelope generator - INT32 volume; - INT32 env_state; - INT32 env_attack_step; // volume increase step in attack state - INT32 env_decay1_step; - INT32 env_decay2_step; - INT32 env_release_step; + int32_t volume; + int32_t env_state; + int32_t env_attack_step; // volume increase step in attack state + int32_t env_decay1_step; + int32_t env_decay2_step; + int32_t env_release_step; - INT64 feedback_modulation0; - INT64 feedback_modulation1; + int64_t feedback_modulation0; + int64_t feedback_modulation1; int lfo_phase, lfo_step; int lfo_amplitude; @@ -94,7 +94,7 @@ private: struct YMF271Group { - UINT8 sync, pfm; + uint8_t sync, pfm; }; void init_state(); @@ -104,15 +104,15 @@ private: void init_envelope(YMF271Slot *slot); void init_lfo(YMF271Slot *slot); void update_lfo(YMF271Slot *slot); - INT64 calculate_slot_volume(YMF271Slot *slot); - void update_pcm(int slotnum, INT32 *mixp, int length); - INT64 calculate_op(int slotnum, INT64 inp); - void set_feedback(int slotnum, INT64 inp); - void write_register(int slotnum, int reg, UINT8 data); - void ymf271_write_fm(int bank, UINT8 address, UINT8 data); - void ymf271_write_pcm(UINT8 address, UINT8 data); - void ymf271_write_timer(UINT8 address, UINT8 data); - UINT8 ymf271_read_memory(UINT32 offset); + int64_t calculate_slot_volume(YMF271Slot *slot); + void update_pcm(int slotnum, int32_t *mixp, int length); + int64_t calculate_op(int slotnum, int64_t inp); + void set_feedback(int slotnum, int64_t inp); + void write_register(int slotnum, int reg, uint8_t data); + void ymf271_write_fm(int bank, uint8_t address, uint8_t data); + void ymf271_write_pcm(uint8_t address, uint8_t data); + void ymf271_write_timer(uint8_t address, uint8_t data); + uint8_t ymf271_read_memory(uint32_t offset); inline int get_keyscaled_rate(int rate, int keycode, int keyscale); inline int get_internal_keycode(int block, int fns); @@ -120,7 +120,7 @@ private: inline bool check_envelope_end(YMF271Slot *slot); // lookup tables - std::unique_ptr m_lut_waves[8]; + std::unique_ptr m_lut_waves[8]; std::unique_ptr m_lut_plfo[4][8]; std::unique_ptr m_lut_alfo[4]; double m_lut_ar[64]; @@ -134,26 +134,26 @@ private: YMF271Slot m_slots[48]; YMF271Group m_groups[12]; - UINT8 m_regs_main[0x10]; + uint8_t m_regs_main[0x10]; - UINT32 m_timerA; - UINT32 m_timerB; - UINT8 m_irqstate; - UINT8 m_status; - UINT8 m_enable; + uint32_t m_timerA; + uint32_t m_timerB; + uint8_t m_irqstate; + uint8_t m_status; + uint8_t m_enable; - UINT32 m_ext_address; - UINT8 m_ext_rw; - UINT8 m_ext_readlatch; + uint32_t m_ext_address; + uint8_t m_ext_rw; + uint8_t m_ext_readlatch; - optional_region_ptr m_mem_base; - UINT32 m_mem_size; - UINT32 m_clock; + optional_region_ptr m_mem_base; + uint32_t m_mem_size; + uint32_t m_clock; emu_timer *m_timA; emu_timer *m_timB; sound_stream *m_stream; - std::unique_ptr m_mix_buffer; + std::unique_ptr m_mix_buffer; devcb_write_line m_irq_handler; devcb_read8 m_ext_read_handler; diff --git a/src/devices/sound/ymf278b.cpp b/src/devices/sound/ymf278b.cpp index 7a0baaf75da..0403f6e21d0 100644 --- a/src/devices/sound/ymf278b.cpp +++ b/src/devices/sound/ymf278b.cpp @@ -82,10 +82,10 @@ int ymf278b_device::compute_rate(YMF278BSlot *slot, int val) return res; } -UINT32 ymf278b_device::compute_decay_env_vol_step(YMF278BSlot *slot, int val) +uint32_t ymf278b_device::compute_decay_env_vol_step(YMF278BSlot *slot, int val) { int rate; - UINT32 res; + uint32_t res; // rate override with damping/pseudo reverb if (slot->DAMP) @@ -109,7 +109,7 @@ UINT32 ymf278b_device::compute_decay_env_vol_step(YMF278BSlot *slot, int val) void ymf278b_device::compute_freq_step(YMF278BSlot *slot) { - UINT32 step; + uint32_t step; int oct; oct = slot->octave; @@ -215,9 +215,9 @@ void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t * { int i, j; YMF278BSlot *slot; - INT16 sample = 0; - INT32 *mixp; - INT32 vl, vr; + int16_t sample = 0; + int32_t *mixp; + int32_t vl, vr; if (&stream == m_stream_ymf262) { @@ -282,7 +282,7 @@ void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t * // update envelope slot->env_vol += slot->env_vol_step; - if (((INT32)(slot->env_vol - slot->env_vol_lim)) >= 0) + if (((int32_t)(slot->env_vol - slot->env_vol_lim)) >= 0) { slot->env_step++; compute_envelope(slot); @@ -352,7 +352,7 @@ void ymf278b_device::device_timer(emu_timer &timer, device_timer_id id, int para /**************************************************************************/ -void ymf278b_device::A_w(UINT8 reg, UINT8 data) +void ymf278b_device::A_w(uint8_t reg, uint8_t data) { // FM register array 0 (compatible with YMF262) switch(reg) @@ -416,7 +416,7 @@ void ymf278b_device::A_w(UINT8 reg, UINT8 data) } } -void ymf278b_device::B_w(UINT8 reg, UINT8 data) +void ymf278b_device::B_w(uint8_t reg, uint8_t data) { // FM register array 1 (compatible with YMF262) switch(reg) @@ -452,7 +452,7 @@ void ymf278b_device::retrigger_note(YMF278BSlot *slot) compute_envelope(slot); } -void ymf278b_device::C_w(UINT8 reg, UINT8 data) +void ymf278b_device::C_w(uint8_t reg, uint8_t data) { // Handle slot registers specifically if (reg >= 0x08 && reg <= 0xf7) @@ -466,8 +466,8 @@ void ymf278b_device::C_w(UINT8 reg, UINT8 data) case 0: { attotime period; - UINT32 offset; - UINT8 p[12]; + uint32_t offset; + uint8_t p[12]; int i; slot->wave &= 0x100; @@ -719,7 +719,7 @@ WRITE8_MEMBER( ymf278b_device::write ) READ8_MEMBER( ymf278b_device::read ) { - UINT8 ret = 0; + uint8_t ret = 0; switch (offset) { @@ -727,7 +727,7 @@ READ8_MEMBER( ymf278b_device::read ) case 0: { // bits 0 and 1 are only valid if NEW2 is set - UINT8 newbits = 0; + uint8_t newbits = 0; if (m_exp & 2) newbits = (m_status_ld << 1) | m_status_busy; @@ -983,7 +983,7 @@ void ymf278b_device::device_start() } m_stream = machine().sound().stream_alloc(*this, 0, 2, clock()/768); - m_mix_buffer = std::make_unique(44100*2); + m_mix_buffer = std::make_unique(44100*2); // rate tables precompute_rate_tables(); @@ -1027,7 +1027,7 @@ void ymf278b_device::device_start() const device_type YMF278B = &device_creator; -ymf278b_device::ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ymf278b_device::ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YMF278B, "YMF278B", tag, owner, clock, "ymf278b", __FILE__), device_sound_interface(mconfig, *this), device_rom_interface(mconfig, *this, 22), diff --git a/src/devices/sound/ymf278b.h b/src/devices/sound/ymf278b.h index 6542621a625..8426ae6ec15 100644 --- a/src/devices/sound/ymf278b.h +++ b/src/devices/sound/ymf278b.h @@ -17,7 +17,7 @@ class ymf278b_device : public device_t, public device_rom_interface { public: - ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ymf278b_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); } @@ -45,94 +45,94 @@ protected: private: struct YMF278BSlot { - INT16 wave; /* wavetable number */ - INT16 F_NUMBER; /* frequency */ - INT8 octave; /* octave */ - INT8 preverb; /* pseudo-reverb */ - INT8 DAMP; /* damping */ - INT8 CH; /* output channel */ - INT8 LD; /* level direct */ - INT8 TL; /* total level */ - INT8 pan; /* panpot */ - INT8 LFO; /* LFO */ - INT8 VIB; /* vibrato */ - INT8 AM; /* tremolo */ - - INT8 AR; /* attack rate */ - INT8 D1R; /* decay 1 rate */ - INT8 DL; /* decay level */ - INT8 D2R; /* decay 2 rate */ - INT8 RC; /* rate correction */ - INT8 RR; /* release rate */ - - UINT32 step; /* fixed-point frequency step */ - UINT64 stepptr; /* fixed-point pointer into the sample */ - - INT8 active; /* channel is playing */ - INT8 KEY_ON; /* slot keyed on */ - INT8 bits; /* width of the samples */ - UINT32 startaddr; - UINT32 loopaddr; - UINT32 endaddr; + int16_t wave; /* wavetable number */ + int16_t F_NUMBER; /* frequency */ + int8_t octave; /* octave */ + int8_t preverb; /* pseudo-reverb */ + int8_t DAMP; /* damping */ + int8_t CH; /* output channel */ + int8_t LD; /* level direct */ + int8_t TL; /* total level */ + int8_t pan; /* panpot */ + int8_t LFO; /* LFO */ + int8_t VIB; /* vibrato */ + int8_t AM; /* tremolo */ + + int8_t AR; /* attack rate */ + int8_t D1R; /* decay 1 rate */ + int8_t DL; /* decay level */ + int8_t D2R; /* decay 2 rate */ + int8_t RC; /* rate correction */ + int8_t RR; /* release rate */ + + uint32_t step; /* fixed-point frequency step */ + uint64_t stepptr; /* fixed-point pointer into the sample */ + + int8_t active; /* channel is playing */ + int8_t KEY_ON; /* slot keyed on */ + int8_t bits; /* width of the samples */ + uint32_t startaddr; + uint32_t loopaddr; + uint32_t endaddr; int env_step; - UINT32 env_vol; - UINT32 env_vol_step; - UINT32 env_vol_lim; - INT8 env_preverb; + uint32_t env_vol; + uint32_t env_vol_step; + uint32_t env_vol_lim; + int8_t env_preverb; int num; /* slot number (for debug only) */ }; int compute_rate(YMF278BSlot *slot, int val); - UINT32 compute_decay_env_vol_step(YMF278BSlot *slot, int val); + uint32_t compute_decay_env_vol_step(YMF278BSlot *slot, int val); void compute_freq_step(YMF278BSlot *slot); void compute_envelope(YMF278BSlot *slot); void irq_check(); - void A_w(UINT8 reg, UINT8 data); - void B_w(UINT8 reg, UINT8 data); + void A_w(uint8_t reg, uint8_t data); + void B_w(uint8_t reg, uint8_t data); void retrigger_note(YMF278BSlot *slot); - void C_w(UINT8 reg, UINT8 data); + void C_w(uint8_t reg, uint8_t data); void timer_busy_start(int is_pcm); void precompute_rate_tables(); void register_save_state(); // internal state - UINT8 m_pcmregs[256]; + uint8_t m_pcmregs[256]; YMF278BSlot m_slots[24]; - INT8 m_wavetblhdr; - INT8 m_memmode; - INT32 m_memadr; + int8_t m_wavetblhdr; + int8_t m_memmode; + int32_t m_memadr; - UINT8 m_status_busy, m_status_ld; + uint8_t m_status_busy, m_status_ld; emu_timer *m_timer_busy; emu_timer *m_timer_ld; - UINT8 m_exp; + uint8_t m_exp; - INT32 m_fm_l, m_fm_r; - INT32 m_pcm_l, m_pcm_r; + int32_t m_fm_l, m_fm_r; + int32_t m_pcm_l, m_pcm_r; attotime m_timer_base; - UINT8 m_timer_a_count, m_timer_b_count; - UINT8 m_enable, m_current_irq; + uint8_t m_timer_a_count, m_timer_b_count; + uint8_t m_enable, m_current_irq; int m_irq_line; - UINT8 m_port_C, m_port_AB, m_lastport; + uint8_t m_port_C, m_port_AB, m_lastport; // precomputed tables - UINT32 m_lut_ar[64]; // attack rate - UINT32 m_lut_dr[64]; // decay rate - INT32 m_volume[256*4]; // precalculated attenuation values with some margin for envelope and pan levels + uint32_t m_lut_ar[64]; // attack rate + uint32_t m_lut_dr[64]; // decay rate + int32_t m_volume[256*4]; // precalculated attenuation values with some margin for envelope and pan levels int m_pan_left[16],m_pan_right[16]; // pan volume offsets - INT32 m_mix_level[8]; + int32_t m_mix_level[8]; emu_timer *m_timer_a, *m_timer_b; int m_clock; sound_stream * m_stream; - std::unique_ptr m_mix_buffer; + std::unique_ptr m_mix_buffer; devcb_write_line m_irq_handler; - UINT8 m_last_fm_data; + uint8_t m_last_fm_data; // ymf262 void *m_ymf262; diff --git a/src/devices/sound/ymz280b.cpp b/src/devices/sound/ymz280b.cpp index 9809c110c7a..dd3e45e4529 100644 --- a/src/devices/sound/ymz280b.cpp +++ b/src/devices/sound/ymz280b.cpp @@ -56,7 +56,7 @@ static const int index_scale[8] = { 0x0e6, 0x0e6, 0x0e6, 0x0e6, 0x133, 0x199, 0x static int diff_lookup[16]; -UINT8 ymz280b_device::ymz280b_read_memory(UINT32 offset) +uint8_t ymz280b_device::ymz280b_read_memory(uint32_t offset) { if (m_ext_read_handler.isnull()) { @@ -110,7 +110,7 @@ void ymz280b_device::update_step(struct YMZ280BVoice *voice) frequency = m_master_clock * (double)((voice->fnum & 0x0ff) + 1) * (1.0 / 256.0); else frequency = m_master_clock * (double)((voice->fnum & 0x1ff) + 1) * (1.0 / 256.0); - voice->output_step = (UINT32)(frequency * (double)FRAC_ONE / INTERNAL_SAMPLE_RATE); + voice->output_step = (uint32_t)(frequency * (double)FRAC_ONE / INTERNAL_SAMPLE_RATE); } @@ -184,7 +184,7 @@ static void compute_tables(void) ***********************************************************************************************/ -int ymz280b_device::generate_adpcm(struct YMZ280BVoice *voice, INT16 *buffer, int samples) +int ymz280b_device::generate_adpcm(struct YMZ280BVoice *voice, int16_t *buffer, int samples) { int position = voice->position; int signal = voice->signal; @@ -296,7 +296,7 @@ int ymz280b_device::generate_adpcm(struct YMZ280BVoice *voice, INT16 *buffer, in ***********************************************************************************************/ -int ymz280b_device::generate_pcm8(struct YMZ280BVoice *voice, INT16 *buffer, int samples) +int ymz280b_device::generate_pcm8(struct YMZ280BVoice *voice, int16_t *buffer, int samples) { int position = voice->position; int val; @@ -311,7 +311,7 @@ int ymz280b_device::generate_pcm8(struct YMZ280BVoice *voice, INT16 *buffer, int val = ymz280b_read_memory(position / 2); /* output to the buffer, scaling by the volume */ - *buffer++ = (INT8)val * 256; + *buffer++ = (int8_t)val * 256; samples--; /* next! */ @@ -334,7 +334,7 @@ int ymz280b_device::generate_pcm8(struct YMZ280BVoice *voice, INT16 *buffer, int val = ymz280b_read_memory(position / 2); /* output to the buffer, scaling by the volume */ - *buffer++ = (INT8)val * 256; + *buffer++ = (int8_t)val * 256; samples--; /* next! */ @@ -366,7 +366,7 @@ int ymz280b_device::generate_pcm8(struct YMZ280BVoice *voice, INT16 *buffer, int ***********************************************************************************************/ -int ymz280b_device::generate_pcm16(struct YMZ280BVoice *voice, INT16 *buffer, int samples) +int ymz280b_device::generate_pcm16(struct YMZ280BVoice *voice, int16_t *buffer, int samples) { int position = voice->position; int val; @@ -378,7 +378,7 @@ int ymz280b_device::generate_pcm16(struct YMZ280BVoice *voice, INT16 *buffer, in while (samples) { /* fetch the current value */ - val = (INT16)((ymz280b_read_memory(position / 2 + 1) << 8) + ymz280b_read_memory(position / 2 + 0)); + val = (int16_t)((ymz280b_read_memory(position / 2 + 1) << 8) + ymz280b_read_memory(position / 2 + 0)); /* output to the buffer, scaling by the volume */ *buffer++ = val; @@ -401,7 +401,7 @@ int ymz280b_device::generate_pcm16(struct YMZ280BVoice *voice, INT16 *buffer, in while (samples) { /* fetch the current value */ - val = (INT16)((ymz280b_read_memory(position / 2 + 1) << 8) + ymz280b_read_memory(position / 2 + 0)); + val = (int16_t)((ymz280b_read_memory(position / 2 + 1) << 8) + ymz280b_read_memory(position / 2 + 0)); /* output to the buffer, scaling by the volume */ *buffer++ = val; @@ -449,13 +449,13 @@ void ymz280b_device::sound_stream_update(sound_stream &stream, stream_sample_t * for (v = 0; v < 8; v++) { struct YMZ280BVoice *voice = &m_voice[v]; - INT16 prev = voice->last_sample; - INT16 curr = voice->curr_sample; - INT16 *curr_data = m_scratch.get(); - INT32 *ldest = lacc; - INT32 *rdest = racc; - UINT32 new_samples, samples_left; - UINT32 final_pos; + int16_t prev = voice->last_sample; + int16_t curr = voice->curr_sample; + int16_t *curr_data = m_scratch.get(); + int32_t *ldest = lacc; + int32_t *rdest = racc; + uint32_t new_samples, samples_left; + uint32_t final_pos; int remaining = samples; int lvol = voice->output_left; int rvol = voice->output_right; @@ -473,7 +473,7 @@ void ymz280b_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* interpolate */ while (remaining > 0 && voice->output_pos < FRAC_ONE) { - int interp_sample = (((INT32)prev * (FRAC_ONE - voice->output_pos)) + ((INT32)curr * voice->output_pos)) >> FRAC_BITS; + int interp_sample = (((int32_t)prev * (FRAC_ONE - voice->output_pos)) + ((int32_t)curr * voice->output_pos)) >> FRAC_BITS; *ldest++ += interp_sample * lvol; *rdest++ += interp_sample * rvol; voice->output_pos += voice->output_step; @@ -537,7 +537,7 @@ void ymz280b_device::sound_stream_update(sound_stream &stream, stream_sample_t * /* interpolate */ while (remaining > 0 && voice->output_pos < FRAC_ONE) { - int interp_sample = (((INT32)prev * (FRAC_ONE - voice->output_pos)) + ((INT32)curr * voice->output_pos)) >> FRAC_BITS; + int interp_sample = (((int32_t)prev * (FRAC_ONE - voice->output_pos)) + ((int32_t)curr * voice->output_pos)) >> FRAC_BITS; *ldest++ += interp_sample * lvol; *rdest++ += interp_sample * rvol; voice->output_pos += voice->output_step; @@ -601,7 +601,7 @@ void ymz280b_device::device_start() /* allocate memory */ assert(MAX_SAMPLE_CHUNK < 0x10000); - m_scratch = std::make_unique(MAX_SAMPLE_CHUNK); + m_scratch = std::make_unique(MAX_SAMPLE_CHUNK); /* state save */ save_item(NAME(m_current_register)); @@ -886,7 +886,7 @@ void ymz280b_device::write_to_register(int data) int ymz280b_device::compute_status() { - UINT8 result; + uint8_t result; /* force an update */ m_stream->update(); @@ -916,7 +916,7 @@ READ8_MEMBER( ymz280b_device::read ) return 0xff; /* read from external memory */ - UINT8 ret = m_ext_readlatch; + uint8_t ret = m_ext_readlatch; m_ext_readlatch = ymz280b_read_memory(m_ext_mem_address); m_ext_mem_address = (m_ext_mem_address + 1) & 0xffffff; return ret; @@ -942,7 +942,7 @@ WRITE8_MEMBER( ymz280b_device::write ) const device_type YMZ280B = &device_creator; -ymz280b_device::ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ymz280b_device::ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YMZ280B, "YMZ280B", tag, owner, clock, "ymz280b", __FILE__), device_sound_interface(mconfig, *this), m_current_register(0), diff --git a/src/devices/sound/ymz280b.h b/src/devices/sound/ymz280b.h index 44cd6e16665..09e29ae3971 100644 --- a/src/devices/sound/ymz280b.h +++ b/src/devices/sound/ymz280b.h @@ -29,7 +29,7 @@ class ymz280b_device : public device_t, public device_sound_interface { public: - ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ymz280b_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); } @@ -54,74 +54,74 @@ private: /* struct describing a single playing ADPCM voice */ struct YMZ280BVoice { - UINT8 playing; /* 1 if we are actively playing */ + uint8_t playing; /* 1 if we are actively playing */ bool ended; /* indicate voice has ended in case samples_left is 0 */ - UINT8 keyon; /* 1 if the key is on */ - UINT8 looping; /* 1 if looping is enabled */ - UINT8 mode; /* current playback mode */ - UINT16 fnum; /* frequency */ - UINT8 level; /* output level */ - UINT8 pan; /* panning */ - - UINT32 start; /* start address, in nibbles */ - UINT32 stop; /* stop address, in nibbles */ - UINT32 loop_start; /* loop start address, in nibbles */ - UINT32 loop_end; /* loop end address, in nibbles */ - UINT32 position; /* current position, in nibbles */ - - INT32 signal; /* current ADPCM signal */ - INT32 step; /* current ADPCM step */ - - INT32 loop_signal; /* signal at loop start */ - INT32 loop_step; /* step at loop start */ - UINT32 loop_count; /* number of loops so far */ - - INT32 output_left; /* output volume (left) */ - INT32 output_right; /* output volume (right) */ - INT32 output_step; /* step value for frequency conversion */ - INT32 output_pos; /* current fractional position */ - INT16 last_sample; /* last sample output */ - INT16 curr_sample; /* current sample target */ - UINT8 irq_schedule; /* 1 if the IRQ state is updated by timer */ + uint8_t keyon; /* 1 if the key is on */ + uint8_t looping; /* 1 if looping is enabled */ + uint8_t mode; /* current playback mode */ + uint16_t fnum; /* frequency */ + uint8_t level; /* output level */ + uint8_t pan; /* panning */ + + uint32_t start; /* start address, in nibbles */ + uint32_t stop; /* stop address, in nibbles */ + uint32_t loop_start; /* loop start address, in nibbles */ + uint32_t loop_end; /* loop end address, in nibbles */ + uint32_t position; /* current position, in nibbles */ + + int32_t signal; /* current ADPCM signal */ + int32_t step; /* current ADPCM step */ + + int32_t loop_signal; /* signal at loop start */ + int32_t loop_step; /* step at loop start */ + uint32_t loop_count; /* number of loops so far */ + + int32_t output_left; /* output volume (left) */ + int32_t output_right; /* output volume (right) */ + int32_t output_step; /* step value for frequency conversion */ + int32_t output_pos; /* current fractional position */ + int16_t last_sample; /* last sample output */ + int16_t curr_sample; /* current sample target */ + uint8_t irq_schedule; /* 1 if the IRQ state is updated by timer */ emu_timer *timer; }; - UINT8 ymz280b_read_memory(UINT32 offset); + uint8_t ymz280b_read_memory(uint32_t offset); void update_irq_state(); void update_step(struct YMZ280BVoice *voice); void update_volumes(struct YMZ280BVoice *voice); void update_irq_state_timer_common(int voicenum); - int generate_adpcm(struct YMZ280BVoice *voice, INT16 *buffer, int samples); - int generate_pcm8(struct YMZ280BVoice *voice, INT16 *buffer, int samples); - int generate_pcm16(struct YMZ280BVoice *voice, INT16 *buffer, int samples); + int generate_adpcm(struct YMZ280BVoice *voice, int16_t *buffer, int samples); + int generate_pcm8(struct YMZ280BVoice *voice, int16_t *buffer, int samples); + int generate_pcm16(struct YMZ280BVoice *voice, int16_t *buffer, int samples); void write_to_register(int data); int compute_status(); // internal state struct YMZ280BVoice m_voice[8]; /* the 8 voices */ - UINT8 m_current_register; /* currently accessible register */ - UINT8 m_status_register; /* current status register */ - UINT8 m_irq_state; /* current IRQ state */ - UINT8 m_irq_mask; /* current IRQ mask */ - UINT8 m_irq_enable; /* current IRQ enable */ - UINT8 m_keyon_enable; /* key on enable */ - UINT8 m_ext_mem_enable; /* external memory enable */ - UINT8 m_ext_readlatch; /* external memory prefetched data */ - UINT32 m_ext_mem_address_hi; - UINT32 m_ext_mem_address_mid; - UINT32 m_ext_mem_address; /* where the CPU can read the ROM */ + uint8_t m_current_register; /* currently accessible register */ + uint8_t m_status_register; /* current status register */ + uint8_t m_irq_state; /* current IRQ state */ + uint8_t m_irq_mask; /* current IRQ mask */ + uint8_t m_irq_enable; /* current IRQ enable */ + uint8_t m_keyon_enable; /* key on enable */ + uint8_t m_ext_mem_enable; /* external memory enable */ + uint8_t m_ext_readlatch; /* external memory prefetched data */ + uint32_t m_ext_mem_address_hi; + uint32_t m_ext_mem_address_mid; + uint32_t m_ext_mem_address; /* where the CPU can read the ROM */ devcb_write_line m_irq_handler; /* IRQ callback */ devcb_read8 m_ext_read_handler; /* external RAM read handler */ devcb_write8 m_ext_write_handler;/* external RAM write handler */ double m_master_clock; /* master clock frequency */ - UINT8 *m_mem_base; /* pointer to the base of external memory */ - UINT32 m_mem_size; + uint8_t *m_mem_base; /* pointer to the base of external memory */ + uint32_t m_mem_size; sound_stream *m_stream; /* which stream are we using */ - std::unique_ptr m_scratch; + std::unique_ptr m_scratch; #if MAKE_WAVS void *m_wavresample; /* resampled waveform */ #endif diff --git a/src/devices/sound/ymz770.cpp b/src/devices/sound/ymz770.cpp index f6a9c17c0b0..b30c3c1c783 100644 --- a/src/devices/sound/ymz770.cpp +++ b/src/devices/sound/ymz770.cpp @@ -30,7 +30,7 @@ const device_type YMZ770 = &device_creator; // ymz770_device - constructor //------------------------------------------------- -ymz770_device::ymz770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ymz770_device::ymz770_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, YMZ770, "Yamaha YMZ770", tag, owner, clock, "ymz770", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), m_cur_reg(0), @@ -138,15 +138,15 @@ void ymz770_device::sound_stream_update(sound_stream &stream, stream_sample_t ** else { int reg = *elem.seqdata++; - UINT8 data = *elem.seqdata++; + uint8_t data = *elem.seqdata++; switch (reg) { case 0x0f: if (elem.seqcontrol & 1) { // loop sequence - UINT8 sqn = elem.sequence; - UINT32 pptr = m_rom[(4*sqn)+1+0x400]<<16 | m_rom[(4*sqn)+2+0x400]<<8 | m_rom[(4*sqn)+3+0x400]; + uint8_t sqn = elem.sequence; + uint32_t pptr = m_rom[(4*sqn)+1+0x400]<<16 | m_rom[(4*sqn)+2+0x400]<<8 | m_rom[(4*sqn)+3+0x400]; elem.seqdata = &m_rom[pptr]; } else @@ -166,7 +166,7 @@ void ymz770_device::sound_stream_update(sound_stream &stream, stream_sample_t ** } // process channels - INT32 mix = 0; + int32_t mix = 0; for (auto & elem : m_channels) { @@ -188,7 +188,7 @@ retry: if (elem.control & 1) { // loop sample - UINT8 phrase = elem.phrase; + uint8_t phrase = elem.phrase; elem.atbl = m_rom[(4*phrase)+0] >> 4 & 7; elem.pptr = 8*(m_rom[(4*phrase)+1]<<16 | m_rom[(4*phrase)+2]<<8 | m_rom[(4*phrase)+3]); } @@ -244,7 +244,7 @@ WRITE8_MEMBER( ymz770_device::write ) } -void ymz770_device::internal_reg_write(UINT8 reg, UINT8 data) +void ymz770_device::internal_reg_write(uint8_t reg, uint8_t data) { // global registers if (reg < 0x40) @@ -293,7 +293,7 @@ void ymz770_device::internal_reg_write(UINT8 reg, UINT8 data) case 3: if (data & 6) { - UINT8 phrase = m_channels[ch].phrase; + uint8_t phrase = m_channels[ch].phrase; m_channels[ch].atbl = m_rom[(4*phrase)+0] >> 4 & 7; m_channels[ch].pptr = 8*(m_rom[(4*phrase)+1]<<16 | m_rom[(4*phrase)+2]<<8 | m_rom[(4*phrase)+3]); m_channels[ch].last_block = false; @@ -323,8 +323,8 @@ void ymz770_device::internal_reg_write(UINT8 reg, UINT8 data) case 1: if (data & 6) { - UINT8 sqn = m_channels[ch].sequence; - UINT32 pptr = m_rom[(4*sqn)+1+0x400]<<16 | m_rom[(4*sqn)+2+0x400]<<8 | m_rom[(4*sqn)+3+0x400]; + uint8_t sqn = m_channels[ch].sequence; + uint32_t pptr = m_rom[(4*sqn)+1+0x400]<<16 | m_rom[(4*sqn)+2+0x400]<<8 | m_rom[(4*sqn)+3+0x400]; m_channels[ch].seqdata = &m_rom[pptr]; m_channels[ch].seqdelay = 0; m_channels[ch].is_seq_playing = true; diff --git a/src/devices/sound/ymz770.h b/src/devices/sound/ymz770.h index a52dbba8e3a..3fdc104dc2c 100644 --- a/src/devices/sound/ymz770.h +++ b/src/devices/sound/ymz770.h @@ -38,32 +38,32 @@ class ymz770_device : public device_t, public device_sound_interface { struct ymz_channel { - UINT8 phrase; - UINT8 pan; - UINT8 volume; - UINT8 control; + uint8_t phrase; + uint8_t pan; + uint8_t volume; + uint8_t control; bool is_playing, last_block; mpeg_audio *decoder; - INT16 output_data[0x1000]; + int16_t output_data[0x1000]; int output_remaining; int output_ptr; int atbl; int pptr; - UINT8 sequence; - UINT8 seqcontrol; - UINT8 seqdelay; - UINT8 *seqdata; + uint8_t sequence; + uint8_t seqcontrol; + uint8_t seqdelay; + uint8_t *seqdata; bool is_seq_playing; }; public: // construction/destruction - ymz770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ymz770_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER(write); @@ -77,16 +77,16 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; - void internal_reg_write(UINT8 reg, UINT8 data); + void internal_reg_write(uint8_t reg, uint8_t data); // data - UINT8 m_cur_reg; - UINT8 m_mute; // mute chip - UINT8 m_doen; // digital output enable - UINT8 m_vlma; // overall AAM volume - UINT8 m_bsl; // boost level - UINT8 m_cpl; // clip limiter - required_region_ptr m_rom; + uint8_t m_cur_reg; + uint8_t m_mute; // mute chip + uint8_t m_doen; // digital output enable + uint8_t m_vlma; // overall AAM volume + uint8_t m_bsl; // boost level + uint8_t m_cpl; // clip limiter + required_region_ptr m_rom; ymz_channel m_channels[8]; }; diff --git a/src/devices/sound/zsg2.cpp b/src/devices/sound/zsg2.cpp index 805acd892cc..c767c6a042e 100644 --- a/src/devices/sound/zsg2.cpp +++ b/src/devices/sound/zsg2.cpp @@ -65,7 +65,7 @@ const device_type ZSG2 = &device_creator; // zsg2_device - constructor //------------------------------------------------- -zsg2_device::zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +zsg2_device::zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ZSG2, "ZSG-2", tag, owner, clock, "zsg2", __FILE__), device_sound_interface(mconfig, *this), m_mem_base(*this, DEVICE_SELF), @@ -88,12 +88,12 @@ void zsg2_device::device_start() m_stream = stream_alloc(0, 2, clock() / 768); m_mem_blocks = m_mem_base.length(); - m_mem_copy = make_unique_clear(m_mem_blocks); - m_full_samples = make_unique_clear(m_mem_blocks * 4 + 4); // +4 is for empty block + m_mem_copy = make_unique_clear(m_mem_blocks); + m_full_samples = make_unique_clear(m_mem_blocks * 4 + 4); // +4 is for empty block // register for savestates - save_pointer(NAME(m_mem_copy.get()), m_mem_blocks / sizeof(UINT32)); - save_pointer(NAME(m_full_samples.get()), (m_mem_blocks * 4 + 4) / sizeof(INT16)); + save_pointer(NAME(m_mem_copy.get()), m_mem_blocks / sizeof(uint32_t)); + save_pointer(NAME(m_full_samples.get()), (m_mem_blocks * 4 + 4) / sizeof(int16_t)); save_item(NAME(m_read_address)); for (int ch = 0; ch < 48; ch++) @@ -151,7 +151,7 @@ void zsg2_device::device_reset() /******************************************************************************/ -UINT32 zsg2_device::read_memory(UINT32 offset) +uint32_t zsg2_device::read_memory(uint32_t offset) { if (offset >= m_mem_blocks) return 0; @@ -162,9 +162,9 @@ UINT32 zsg2_device::read_memory(UINT32 offset) return m_ext_read_handler(offset); } -INT16 *zsg2_device::prepare_samples(UINT32 offset) +int16_t *zsg2_device::prepare_samples(uint32_t offset) { - UINT32 block = read_memory(offset); + uint32_t block = read_memory(offset); if (block == 0) return &m_full_samples[m_mem_blocks]; // overflow or 0 @@ -183,7 +183,7 @@ INT16 *zsg2_device::prepare_samples(UINT32 offset) m_full_samples[offset|3] = (block >> (8+1) & 0x40) | (block >> (16+2) & 0x20) | (block >> (24+3) & 0x10) | (block & 0xf); // sign-extend and shift - UINT8 shift = block >> 4 & 0xf; + uint8_t shift = block >> 4 & 0xf; for (int i = offset; i < (offset + 4); i++) { m_full_samples[i] <<= 9; @@ -202,8 +202,8 @@ void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **in { for (int i = 0; i < samples; i++) { - INT32 mix_l = 0; - INT32 mix_r = 0; + int32_t mix_l = 0; + int32_t mix_r = 0; // loop over all channels for (auto & elem : m_chan) @@ -229,7 +229,7 @@ void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **in elem.samples = prepare_samples(elem.page | elem.cur_pos); } - INT32 sample = (elem.samples[elem.step_ptr >> 14 & 3] * elem.vol) >> 16; + int32_t sample = (elem.samples[elem.step_ptr >> 14 & 3] * elem.vol) >> 16; mix_l += (sample * elem.panl + sample * (0x1f - elem.panr)) >> 5; mix_r += (sample * elem.panr + sample * (0x1f - elem.panl)) >> 5; @@ -243,7 +243,7 @@ void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **in /******************************************************************************/ -void zsg2_device::chan_w(int ch, int reg, UINT16 data) +void zsg2_device::chan_w(int ch, int reg, uint16_t data) { switch (reg) { @@ -318,7 +318,7 @@ void zsg2_device::chan_w(int ch, int reg, UINT16 data) m_chan[ch].v[reg] = data; } -UINT16 zsg2_device::chan_r(int ch, int reg) +uint16_t zsg2_device::chan_r(int ch, int reg) { switch (reg) { @@ -336,7 +336,7 @@ UINT16 zsg2_device::chan_r(int ch, int reg) /******************************************************************************/ -void zsg2_device::control_w(int reg, UINT16 data) +void zsg2_device::control_w(int reg, uint16_t data) { switch (reg) { @@ -391,7 +391,7 @@ void zsg2_device::control_w(int reg, UINT16 data) } } -UINT16 zsg2_device::control_r(int reg) +uint16_t zsg2_device::control_r(int reg) { switch (reg) { diff --git a/src/devices/sound/zsg2.h b/src/devices/sound/zsg2.h index c88e2c60cc5..e894562fa7f 100644 --- a/src/devices/sound/zsg2.h +++ b/src/devices/sound/zsg2.h @@ -29,7 +29,7 @@ class zsg2_device : public device_t, public device_sound_interface { public: - zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~zsg2_device() { } // static configuration helpers @@ -50,40 +50,40 @@ private: // 16 registers per channel, 48 channels struct zchan { - UINT16 v[16]; + uint16_t v[16]; bool is_playing; - INT16 *samples; - UINT32 cur_pos; - UINT32 step_ptr; - UINT32 step; - UINT32 start_pos; - UINT32 end_pos; - UINT32 loop_pos; - UINT32 page; - UINT16 vol; - UINT16 flags; - UINT8 panl; - UINT8 panr; + int16_t *samples; + uint32_t cur_pos; + uint32_t step_ptr; + uint32_t step; + uint32_t start_pos; + uint32_t end_pos; + uint32_t loop_pos; + uint32_t page; + uint16_t vol; + uint16_t flags; + uint8_t panl; + uint8_t panr; }; zchan m_chan[48]; - required_region_ptr m_mem_base; - UINT32 m_read_address; - std::unique_ptr m_mem_copy; - UINT32 m_mem_blocks; - std::unique_ptr m_full_samples; + required_region_ptr m_mem_base; + uint32_t m_read_address; + std::unique_ptr m_mem_copy; + uint32_t m_mem_blocks; + std::unique_ptr m_full_samples; sound_stream *m_stream; devcb_read32 m_ext_read_handler; - UINT32 read_memory(UINT32 offset); - void chan_w(int ch, int reg, UINT16 data); - UINT16 chan_r(int ch, int reg); - void control_w(int reg, UINT16 data); - UINT16 control_r(int reg); - INT16 *prepare_samples(UINT32 offset); + uint32_t read_memory(uint32_t offset); + void chan_w(int ch, int reg, uint16_t data); + uint16_t chan_r(int ch, int reg); + void control_w(int reg, uint16_t data); + uint16_t control_r(int reg); + int16_t *prepare_samples(uint32_t offset); }; extern const device_type ZSG2; diff --git a/src/devices/video/315_5124.cpp b/src/devices/video/315_5124.cpp index 50a8c5bf3a1..eb6985203e2 100644 --- a/src/devices/video/315_5124.cpp +++ b/src/devices/video/315_5124.cpp @@ -97,12 +97,12 @@ PAL frame timing #define BOTTOM_BORDER 4 #define BOTTOM_BLANKING 5 -static const UINT8 ntsc_192[6] = { 3, 13, 27, 192, 24, 3 }; -static const UINT8 ntsc_224[6] = { 3, 13, 11, 224, 8, 3 }; -static const UINT8 ntsc_240[6] = { 3, 13, 3, 240, 0, 3 }; -static const UINT8 pal_192[6] = { 3, 13, 54, 192, 48, 3 }; -static const UINT8 pal_224[6] = { 3, 13, 38, 224, 32, 3 }; -static const UINT8 pal_240[6] = { 3, 13, 30, 240, 24, 3 }; +static const uint8_t ntsc_192[6] = { 3, 13, 27, 192, 24, 3 }; +static const uint8_t ntsc_224[6] = { 3, 13, 11, 224, 8, 3 }; +static const uint8_t ntsc_240[6] = { 3, 13, 3, 240, 0, 3 }; +static const uint8_t pal_192[6] = { 3, 13, 54, 192, 48, 3 }; +static const uint8_t pal_224[6] = { 3, 13, 38, 224, 32, 3 }; +static const uint8_t pal_240[6] = { 3, 13, 30, 240, 24, 3 }; const device_type SEGA315_5124 = &device_creator; @@ -160,7 +160,7 @@ static ADDRESS_MAP_START( sega315_5124, AS_0, 8, sega315_5124_device ) ADDRESS_MAP_END -sega315_5124_device::sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega315_5124_device::sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t( mconfig, SEGA315_5124, "Sega 315-5124 VDP", tag, owner, clock, "sega315_5124", __FILE__) , device_memory_interface(mconfig, *this) , device_video_interface(mconfig, *this) @@ -177,7 +177,7 @@ sega315_5124_device::sega315_5124_device(const machine_config &mconfig, const ch } -sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 cram_size, UINT8 palette_offset, bool supports_224_240, const char *shortname, const char *source) +sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, bool supports_224_240, const char *shortname, const char *source) : device_t( mconfig, type, name, tag, owner, clock, shortname, source) , device_memory_interface(mconfig, *this) , device_video_interface(mconfig, *this) @@ -194,13 +194,13 @@ sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_t } -sega315_5246_device::sega315_5246_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega315_5246_device::sega315_5246_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega315_5124_device( mconfig, SEGA315_5246, "Sega 315-5246 VDP", tag, owner, clock, SEGA315_5124_CRAM_SIZE, 0, true, "sega315_5246", __FILE__) { } -sega315_5378_device::sega315_5378_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega315_5378_device::sega315_5378_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega315_5124_device( mconfig, SEGA315_5378, "Sega 315-5378 VDP", tag, owner, clock, SEGA315_5378_CRAM_SIZE, 0x10, true, "sega315_5378", __FILE__) { } @@ -554,7 +554,7 @@ void sega315_5124_device::process_line_timer() READ8_MEMBER( sega315_5124_device::vram_read ) { - UINT8 temp; + uint8_t temp; /* SMS 2 & GG behaviour. Seems like the latched data is passed straight through */ /* to the address register when in the middle of doing a command. */ @@ -627,7 +627,7 @@ void sega315_5124_device::check_pending_flags() READ8_MEMBER( sega315_5124_device::register_read ) { - UINT8 temp; + uint8_t temp; check_pending_flags(); temp = m_status; @@ -780,19 +780,19 @@ WRITE8_MEMBER( sega315_5124_device::register_write ) } -UINT16 sega315_5124_device::get_name_table_row(int row) +uint16_t sega315_5124_device::get_name_table_row(int row) { return ((row >> 3) << 6) & (((m_reg[0x02] & 0x01) << 10) | 0x3bff); } -UINT16 sega315_5246_device::get_name_table_row(int row) +uint16_t sega315_5246_device::get_name_table_row(int row) { return (row >> 3) << 6; } -UINT16 sega315_5378_device::get_name_table_row(int row) +uint16_t sega315_5378_device::get_name_table_row(int row) { return (row >> 3) << 6; } @@ -804,7 +804,7 @@ void sega315_5124_device::draw_scanline_mode4( int *line_buffer, int *priority_s int y_scroll, scroll_mod; int pixel_x, pixel_plot_x; int bit_plane_0, bit_plane_1, bit_plane_2, bit_plane_3; - UINT16 name_table_address; + uint16_t name_table_address; /* if top 2 rows of screen not affected by horizontal scrolling, then x_scroll = 0 */ /* else x_scroll = m_reg8copy */ @@ -826,7 +826,7 @@ void sega315_5124_device::draw_scanline_mode4( int *line_buffer, int *priority_s /* Draw background layer */ for (tile_column = 0; tile_column < 33; tile_column++) { - UINT16 tile_data; + uint16_t tile_data; int tile_selected, palette_selected, horiz_selected, vert_selected, priority_select; int tile_line; @@ -854,8 +854,8 @@ void sega315_5124_device::draw_scanline_mode4( int *line_buffer, int *priority_s for (pixel_x = 0; pixel_x < 8; pixel_x++) { - UINT8 pen_bit_0, pen_bit_1, pen_bit_2, pen_bit_3; - UINT8 pen_selected; + uint8_t pen_bit_0, pen_bit_1, pen_bit_2, pen_bit_3; + uint8_t pen_selected; pen_bit_0 = (bit_plane_0 >> (7 - pixel_x)) & 0x01; pen_bit_1 = (bit_plane_1 >> (7 - pixel_x)) & 0x01; @@ -949,7 +949,7 @@ void sega315_5124_device::select_sprites( int line ) { int sprite_x = space().read_byte( m_sprite_base + sprite_index + 1 ); int sprite_tile_selected = space().read_byte( m_sprite_base + sprite_index + 2 ); - UINT8 flags = space().read_byte( m_sprite_base + sprite_index + 3 ); + uint8_t flags = space().read_byte( m_sprite_base + sprite_index + 3 ); int sprite_line = parse_line - sprite_y; @@ -1054,7 +1054,7 @@ void sega315_5124_device::draw_sprites_mode4( int *line_buffer, int *priority_se { bool sprite_col_occurred = false; int sprite_col_x = 255; - UINT8 collision_buffer[256]; + uint8_t collision_buffer[256]; int plot_min_x = 0; if (m_display_disabled || m_sprite_count == 0) @@ -1072,21 +1072,21 @@ void sega315_5124_device::draw_sprites_mode4( int *line_buffer, int *priority_se { int sprite_x = m_sprite_x[sprite_buffer_index]; int sprite_tile_selected = m_sprite_tile_selected[sprite_buffer_index]; - UINT16 sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index]; + uint16_t sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index]; - UINT8 bit_plane_0 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x00); - UINT8 bit_plane_1 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x01); - UINT8 bit_plane_2 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x02); - UINT8 bit_plane_3 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x03); + uint8_t bit_plane_0 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x00); + uint8_t bit_plane_1 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x01); + uint8_t bit_plane_2 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x02); + uint8_t bit_plane_3 = space().read_byte((sprite_tile_selected << 5) + sprite_pattern_line + 0x03); for (int pixel_x = 0; pixel_x < 8; pixel_x++) { int pixel_plot_x; - UINT8 pen_bit_0 = (bit_plane_0 >> (7 - pixel_x)) & 0x01; - UINT8 pen_bit_1 = (bit_plane_1 >> (7 - pixel_x)) & 0x01; - UINT8 pen_bit_2 = (bit_plane_2 >> (7 - pixel_x)) & 0x01; - UINT8 pen_bit_3 = (bit_plane_3 >> (7 - pixel_x)) & 0x01; - UINT8 pen_selected = (pen_bit_3 << 3 | pen_bit_2 << 2 | pen_bit_1 << 1 | pen_bit_0) | 0x10; + uint8_t pen_bit_0 = (bit_plane_0 >> (7 - pixel_x)) & 0x01; + uint8_t pen_bit_1 = (bit_plane_1 >> (7 - pixel_x)) & 0x01; + uint8_t pen_bit_2 = (bit_plane_2 >> (7 - pixel_x)) & 0x01; + uint8_t pen_bit_3 = (bit_plane_3 >> (7 - pixel_x)) & 0x01; + uint8_t pen_selected = (pen_bit_3 << 3 | pen_bit_2 << 2 | pen_bit_1 << 1 | pen_bit_0) | 0x10; if (pen_selected == 0x10) { @@ -1155,7 +1155,7 @@ void sega315_5124_device::draw_sprites_tms9918_mode( int *line_buffer, int line { bool sprite_col_occurred = false; int sprite_col_x = 255; - UINT8 collision_buffer[256]; + uint8_t collision_buffer[256]; if (m_display_disabled || m_sprite_count == 0) return; @@ -1167,8 +1167,8 @@ void sega315_5124_device::draw_sprites_tms9918_mode( int *line_buffer, int line { int sprite_x = m_sprite_x[sprite_buffer_index]; int sprite_tile_selected = m_sprite_tile_selected[sprite_buffer_index]; - UINT16 sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index]; - UINT8 flags = m_sprite_flags[sprite_buffer_index]; + uint16_t sprite_pattern_line = m_sprite_pattern_line[sprite_buffer_index]; + uint8_t flags = m_sprite_flags[sprite_buffer_index]; int pen_selected = m_palette_offset + ( flags & 0x0f ); if (flags & 0x80) @@ -1182,7 +1182,7 @@ void sega315_5124_device::draw_sprites_tms9918_mode( int *line_buffer, int line sprite_x += (m_sprite_zoom > 1 ? 16 : 8); } - UINT8 pattern = space().read_byte( sprite_pattern_line + sprite_tile_selected * 8 ); + uint8_t pattern = space().read_byte( sprite_pattern_line + sprite_tile_selected * 8 ); for (int pixel_x = 0; pixel_x < 8; pixel_x++) { @@ -1237,7 +1237,7 @@ void sega315_5124_device::draw_scanline_mode2( int *line_buffer, int line ) { int tile_column; int pixel_x, pixel_plot_x; - UINT16 name_table_base, color_base, pattern_base; + uint16_t name_table_base, color_base, pattern_base; int pattern_mask, color_mask, pattern_offset; name_table_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32); @@ -1250,16 +1250,16 @@ void sega315_5124_device::draw_scanline_mode2( int *line_buffer, int line ) /* Draw background layer */ for (tile_column = 0; tile_column < 32; tile_column++) { - UINT8 name = space().read_byte( name_table_base + tile_column ); - UINT8 pattern; - UINT8 colors; + uint8_t name = space().read_byte( name_table_base + tile_column ); + uint8_t pattern; + uint8_t colors; pattern = space().read_byte(pattern_base + (((pattern_offset + name) & pattern_mask) * 8) + (line & 0x07) ); colors = space().read_byte(color_base + (((pattern_offset + name) & color_mask) * 8) + (line & 0x07) ); for (pixel_x = 0; pixel_x < 8; pixel_x++) { - UINT8 pen_selected; + uint8_t pen_selected; if (pattern & (1 << (7 - pixel_x))) { @@ -1287,7 +1287,7 @@ void sega315_5124_device::draw_scanline_mode0( int *line_buffer, int line ) { int tile_column; int pixel_x, pixel_plot_x; - UINT16 name_base, color_base, pattern_base; + uint16_t name_base, color_base, pattern_base; name_base = ((m_reg[0x02] & 0x0f) << 10) + ((line >> 3) * 32); color_base = ((m_reg[0x03] << 6) & (VRAM_SIZE - 1)); @@ -1296,9 +1296,9 @@ void sega315_5124_device::draw_scanline_mode0( int *line_buffer, int line ) /* Draw background layer */ for (tile_column = 0; tile_column < 32; tile_column++) { - UINT8 name = space().read_byte( name_base + tile_column ); - UINT8 pattern; - UINT8 colors; + uint8_t name = space().read_byte( name_base + tile_column ); + uint8_t pattern; + uint8_t colors; pattern = space().read_byte( pattern_base + (name * 8) + (line & 0x07) ); colors = space().read_byte( color_base + ( name >> 3 ) ); @@ -1391,8 +1391,8 @@ void sega315_5124_device::draw_scanline( int pixel_offset_x, int pixel_plot_y, i void sega315_5124_device::blit_scanline( int *line_buffer, int *priority_selected, int pixel_offset_x, int pixel_plot_y, int line ) { - UINT32 *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x); - UINT8 *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x); + uint32_t *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x); + uint8_t *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x); int x = 0; if (m_vdp_mode == 4 && (m_reg[0x00] & 0x20)) @@ -1423,8 +1423,8 @@ void sega315_5378_device::blit_scanline( int *line_buffer, int *priority_selecte } else { - UINT32 *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x); - UINT8 *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x); + uint32_t *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x); + uint8_t *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x); int x = 0; /* border on left side of the GG active screen */ @@ -1521,9 +1521,9 @@ void sega315_5378_device::update_palette() } -void sega315_5124_device::cram_write(UINT8 data) +void sega315_5124_device::cram_write(uint8_t data) { - UINT16 address = m_addr & m_cram_mask; + uint16_t address = m_addr & m_cram_mask; if (data != m_CRAM[address]) { m_CRAM[address] = data; @@ -1532,7 +1532,7 @@ void sega315_5124_device::cram_write(UINT8 data) } -void sega315_5378_device::cram_write(UINT8 data) +void sega315_5378_device::cram_write(uint8_t data) { if (m_sega315_5124_compatibility_mode) { @@ -1542,7 +1542,7 @@ void sega315_5378_device::cram_write(UINT8 data) { if (m_addr & 1) { - UINT16 address = (m_addr & m_cram_mask) & ~1; + uint16_t address = (m_addr & m_cram_mask) & ~1; if (m_buffer != m_CRAM[address] || data != m_CRAM[address + 1]) { m_CRAM[address] = m_buffer; @@ -1554,7 +1554,7 @@ void sega315_5378_device::cram_write(UINT8 data) } -UINT32 sega315_5124_device::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t sega315_5124_device::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { copybitmap(bitmap, m_tmpbitmap, 0, 0, 0, 0, cliprect); return 0; diff --git a/src/devices/video/315_5124.h b/src/devices/video/315_5124.h index d34d54d91d0..7cc8cdaf642 100644 --- a/src/devices/video/315_5124.h +++ b/src/devices/video/315_5124.h @@ -60,8 +60,8 @@ class sega315_5124_device : public device_t, { public: // construction/destruction - sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - sega315_5124_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 cram_size, UINT8 palette_offset, bool supports_224_240, const char *shortname, const char *source); + sega315_5124_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + sega315_5124_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint8_t cram_size, uint8_t palette_offset, bool supports_224_240, const char *shortname, const char *source); static void set_signal_type(device_t &device, bool is_pal) { downcast(device).m_is_pal = is_pal; } @@ -88,7 +88,7 @@ public: bitmap_ind8 &get_y1_bitmap() { return m_y1_bitmap; }; /* update the screen */ - UINT32 screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ); + uint32_t screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ); virtual void set_sega315_5124_compatibility_mode( bool sega315_5124_compatibility_mode ) { }; @@ -96,10 +96,10 @@ protected: void set_display_settings(); void set_frame_timing(); virtual void update_palette(); - virtual void cram_write(UINT8 data); + virtual void cram_write(uint8_t data); virtual void draw_scanline( int pixel_offset_x, int pixel_plot_y, int line ); virtual void blit_scanline( int *line_buffer, int *priority_selected, int pixel_offset_x, int pixel_plot_y, int line ); - virtual UINT16 get_name_table_row(int row); + virtual uint16_t get_name_table_row(int row); void process_line_timer(); void select_sprites( int line ); void draw_scanline_mode4( int *line_buffer, int *priority_selected, int line ); @@ -119,38 +119,38 @@ protected: void vdp_postload(); - UINT8 m_reg[16]; /* All the registers */ - UINT8 m_status; /* Status register */ - UINT8 m_pending_status; /* Pending status flags */ - UINT8 m_reg8copy; /* Internal copy of register 8 (X-Scroll) */ - UINT8 m_reg9copy; /* Internal copy of register 9 (Y-Scroll) */ - UINT8 m_addrmode; /* Type of VDP action */ - UINT16 m_addr; /* Contents of internal VDP address register */ - UINT8 m_cram_size; /* CRAM size */ - UINT8 m_cram_mask; /* Mask to switch between SMS and GG CRAM sizes */ + uint8_t m_reg[16]; /* All the registers */ + uint8_t m_status; /* Status register */ + uint8_t m_pending_status; /* Pending status flags */ + uint8_t m_reg8copy; /* Internal copy of register 8 (X-Scroll) */ + uint8_t m_reg9copy; /* Internal copy of register 9 (Y-Scroll) */ + uint8_t m_addrmode; /* Type of VDP action */ + uint16_t m_addr; /* Contents of internal VDP address register */ + uint8_t m_cram_size; /* CRAM size */ + uint8_t m_cram_mask; /* Mask to switch between SMS and GG CRAM sizes */ int m_cram_dirty; /* Have there been any changes to the CRAM area */ int m_pending_reg_write; int m_pending_sprcol_x; - UINT8 m_buffer; + uint8_t m_buffer; bool m_sega315_5124_compatibility_mode; /* when true, GG VDP behaves as SMS VDP */ int m_irq_state; /* The status of the IRQ line of the VDP */ int m_vdp_mode; /* Current mode of the VDP: 0,1,2,3,4 */ int m_y_pixels; /* 192, 224, 240 */ int m_draw_time; - UINT8 m_line_counter; - UINT8 m_hcounter; - UINT8 m_CRAM[SEGA315_5378_CRAM_SIZE]; /* CRAM */ - const UINT8 *m_frame_timing; + uint8_t m_line_counter; + uint8_t m_hcounter; + uint8_t m_CRAM[SEGA315_5378_CRAM_SIZE]; /* CRAM */ + const uint8_t *m_frame_timing; bitmap_rgb32 m_tmpbitmap; bitmap_ind8 m_y1_bitmap; - UINT8 m_palette_offset; + uint8_t m_palette_offset; bool m_supports_224_240; bool m_display_disabled; - UINT16 m_sprite_base; - UINT16 m_sprite_pattern_line[8]; + uint16_t m_sprite_base; + uint16_t m_sprite_pattern_line[8]; int m_sprite_tile_selected[8]; int m_sprite_x[8]; - UINT8 m_sprite_flags[8]; + uint8_t m_sprite_flags[8]; int m_sprite_count; int m_sprite_height; int m_sprite_zoom; @@ -187,17 +187,17 @@ protected: class sega315_5246_device : public sega315_5124_device { public: - sega315_5246_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega315_5246_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - virtual UINT16 get_name_table_row(int row) override; + virtual uint16_t get_name_table_row(int row) override; }; class sega315_5378_device : public sega315_5124_device { public: - sega315_5378_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega315_5378_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_PALETTE_INIT( sega315_5378 ); @@ -208,9 +208,9 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; virtual void update_palette() override; - virtual void cram_write(UINT8 data) override; + virtual void cram_write(uint8_t data) override; virtual void blit_scanline( int *line_buffer, int *priority_selected, int pixel_offset_x, int pixel_plot_y, int line ) override; - virtual UINT16 get_name_table_row(int row) override; + virtual uint16_t get_name_table_row(int row) override; }; diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp index f82e63f60b6..520c2c45980 100644 --- a/src/devices/video/315_5313.cpp +++ b/src/devices/video/315_5313.cpp @@ -14,7 +14,7 @@ const device_type SEGA315_5313 = &device_creator; -sega315_5313_device::sega315_5313_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega315_5313_device::sega315_5313_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sega315_5124_device(mconfig, SEGA315_5313, "Sega 315-5313 Megadrive VDP", tag, owner, clock, SEGA315_5124_CRAM_SIZE, 0, true, "sega315_5313", __FILE__), m_render_bitmap(nullptr), m_render_line(nullptr), m_render_line_raw(nullptr), m_megadriv_scanline_timer(nullptr), m_sndirqline_callback(*this), @@ -93,11 +93,11 @@ void sega315_5313_device::device_start() m_32x_interrupt_func.bind_relative_to(*owner()); m_32x_scanline_helper_func.bind_relative_to(*owner()); - m_vram = std::make_unique(0x10000/2); - m_cram = std::make_unique(0x80/2); - m_vsram = std::make_unique(0x80/2); - m_regs = std::make_unique(0x40/2); - m_internal_sprite_attribute_table = std::make_unique(0x400/2); + m_vram = std::make_unique(0x10000/2); + m_cram = std::make_unique(0x80/2); + m_vsram = std::make_unique(0x80/2); + m_regs = std::make_unique(0x40/2); + m_internal_sprite_attribute_table = std::make_unique(0x400/2); memset(m_vram.get(), 0x00, 0x10000); memset(m_cram.get(), 0x00, 0x80); @@ -132,15 +132,15 @@ void sega315_5313_device::device_start() save_item(NAME(m_vblank_flag)); save_item(NAME(m_total_scanlines)); - m_sprite_renderline = std::make_unique(1024); - m_highpri_renderline = std::make_unique(320); - m_video_renderline = std::make_unique(320); + m_sprite_renderline = std::make_unique(1024); + m_highpri_renderline = std::make_unique(320); + m_video_renderline = std::make_unique(320); - m_palette_lookup = std::make_unique(0x40); - m_palette_lookup_sprite = std::make_unique(0x40); + m_palette_lookup = std::make_unique(0x40); + m_palette_lookup_sprite = std::make_unique(0x40); - m_palette_lookup_shadow = std::make_unique(0x40); - m_palette_lookup_highlight = std::make_unique(0x40); + m_palette_lookup_shadow = std::make_unique(0x40); + m_palette_lookup_highlight = std::make_unique(0x40); memset(m_palette_lookup.get(),0x00,0x40*2); memset(m_palette_lookup_sprite.get(),0x00,0x40*2); @@ -152,9 +152,9 @@ void sega315_5313_device::device_start() if (!m_use_alt_timing) m_render_bitmap = std::make_unique(320, 512); // allocate maximum sizes we're going to use, it's safer. else - m_render_line = std::make_unique(320); + m_render_line = std::make_unique(320); - m_render_line_raw = std::make_unique(320); + m_render_line_raw = std::make_unique(320); // FIXME: are these all needed? I'm pretty sure some of these (most?) are just helpers which don't need to be saved, // but better safe than sorry... @@ -213,9 +213,9 @@ void sega315_5313_device::device_reset_old() -void sega315_5313_device::vdp_vram_write(UINT16 data) +void sega315_5313_device::vdp_vram_write(uint16_t data) { - UINT16 sprite_base_address = MEGADRIVE_REG0C_RS1?((MEGADRIVE_REG05_SPRITE_ADDR&0x7e)<<9):((MEGADRIVE_REG05_SPRITE_ADDR&0x7f)<<9); + uint16_t sprite_base_address = MEGADRIVE_REG0C_RS1?((MEGADRIVE_REG05_SPRITE_ADDR&0x7e)<<9):((MEGADRIVE_REG05_SPRITE_ADDR&0x7f)<<9); int spritetable_size = MEGADRIVE_REG0C_RS1?0x400:0x200; int lowlimit = sprite_base_address; int highlimit = sprite_base_address+spritetable_size; @@ -240,7 +240,7 @@ void sega315_5313_device::vdp_vram_write(UINT16 data) m_vdp_address &= 0xffff; } -void sega315_5313_device::vdp_vsram_write(UINT16 data) +void sega315_5313_device::vdp_vsram_write(uint16_t data) { m_vsram[(m_vdp_address&0x7e)>>1] = data; @@ -275,7 +275,7 @@ void sega315_5313_device::write_cram_value(int offset, int data) } } -void sega315_5313_device::vdp_cram_write(UINT16 data) +void sega315_5313_device::vdp_cram_write(uint16_t data) { int offset; offset = (m_vdp_address&0x7e)>>1; @@ -383,7 +383,7 @@ void sega315_5313_device::data_port_w(int data) -void sega315_5313_device::vdp_set_register(int regnum, UINT8 value) +void sega315_5313_device::vdp_set_register(int regnum, uint8_t value) { m_regs[regnum] = value; @@ -445,7 +445,7 @@ void sega315_5313_device::update_code_and_address(void) // if either SVP CPU or segaCD is present, there is a 'lag' we have to compensate for // hence, for segacd and svp we set m_dma_delay to the appropriate value at start -inline UINT16 sega315_5313_device::vdp_get_word_from_68k_mem(UINT32 source) +inline uint16_t sega315_5313_device::vdp_get_word_from_68k_mem(uint32_t source) { // should we limit the valid areas here? // how does this behave with the segacd etc? @@ -489,13 +489,13 @@ inline UINT16 sega315_5313_device::vdp_get_word_from_68k_mem(UINT32 source) as the 68k address bus isn't accessed */ /* Wani Wani World, James Pond 3, Pirates Gold! */ -void sega315_5313_device::insta_vram_copy(UINT32 source, UINT16 length) +void sega315_5313_device::insta_vram_copy(uint32_t source, uint16_t length) { int x; for (x=0;x>1)&0x00ff; @@ -517,7 +517,7 @@ void sega315_5313_device::insta_vram_copy(UINT32 source, UINT16 length) } /* Instant, but we pause the 68k a bit */ -void sega315_5313_device::insta_68k_to_vram_dma(UINT32 source,int length) +void sega315_5313_device::insta_68k_to_vram_dma(uint32_t source,int length) { int count; @@ -544,7 +544,7 @@ void sega315_5313_device::insta_68k_to_vram_dma(UINT32 source,int length) } -void sega315_5313_device::insta_68k_to_cram_dma(UINT32 source,UINT16 length) +void sega315_5313_device::insta_68k_to_cram_dma(uint32_t source,uint16_t length) { int count; @@ -572,7 +572,7 @@ void sega315_5313_device::insta_68k_to_cram_dma(UINT32 source,UINT16 length) } -void sega315_5313_device::insta_68k_to_vsram_dma(UINT32 source,UINT16 length) +void sega315_5313_device::insta_68k_to_vsram_dma(uint32_t source,uint16_t length) { int count; @@ -605,8 +605,8 @@ void sega315_5313_device::handle_dma_bits() #if 0 if (m_vdp_code&0x20) { - UINT32 source; - UINT16 length; + uint32_t source; + uint16_t length; source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8) | ((MEGADRIVE_REG17_DMASOURCE3&0xff)<<16))<<1; length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8))<<1; osd_printf_debug("%s 68k DMAtran set source %06x length %04x dest %04x enabled %01x code %02x %02x\n", machine().describe_context(), source, length, m_vdp_address,MEGADRIVE_REG01_DMA_ENABLE, m_vdp_code,MEGADRIVE_REG0F_AUTO_INC); @@ -620,8 +620,8 @@ void sega315_5313_device::handle_dma_bits() { if (MEGADRIVE_REG17_DMATYPE==0x0 || MEGADRIVE_REG17_DMATYPE==0x1) { - UINT32 source; - UINT16 length; + uint32_t source; + uint16_t length; source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8) | ((MEGADRIVE_REG17_DMASOURCE3&0x7f)<<16))<<1; length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8))<<1; @@ -641,8 +641,8 @@ void sega315_5313_device::handle_dma_bits() } else if (MEGADRIVE_REG17_DMATYPE==0x3) { - UINT32 source; - UINT16 length; + uint32_t source; + uint16_t length; source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8)); // source (byte offset) length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8)); // length in bytes //osd_printf_debug("setting vram copy mode length registers are %02x %02x other regs! %02x %02x %02x(Mode Bits %02x) Enable %02x\n", MEGADRIVE_REG13_DMALENGTH1, MEGADRIVE_REG14_DMALENGTH2, MEGADRIVE_REG15_DMASOURCE1, MEGADRIVE_REG16_DMASOURCE2, MEGADRIVE_REG17_DMASOURCE3, MEGADRIVE_REG17_DMATYPE, MEGADRIVE_REG01_DMA_ENABLE); @@ -654,8 +654,8 @@ void sega315_5313_device::handle_dma_bits() { if (MEGADRIVE_REG17_DMATYPE==0x0 || MEGADRIVE_REG17_DMATYPE==0x1) { - UINT32 source; - UINT16 length; + uint32_t source; + uint16_t length; source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8) | ((MEGADRIVE_REG17_DMASOURCE3&0x7f)<<16))<<1; length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8))<<1; @@ -681,8 +681,8 @@ void sega315_5313_device::handle_dma_bits() { if (MEGADRIVE_REG17_DMATYPE==0x0 || MEGADRIVE_REG17_DMATYPE==0x1) { - UINT32 source; - UINT16 length; + uint32_t source; + uint16_t length; source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8) | ((MEGADRIVE_REG17_DMASOURCE3&0x7f)<<16))<<1; length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8))<<1; @@ -720,8 +720,8 @@ void sega315_5313_device::handle_dma_bits() } else if (MEGADRIVE_REG17_DMATYPE==0x3) { - UINT32 source; - UINT16 length; + uint32_t source; + uint16_t length; source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8)); // source (byte offset) length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8)); // length in bytes //osd_printf_debug("setting vram copy mode length registers are %02x %02x other regs! %02x %02x %02x(Mode Bits %02x) Enable %02x\n", MEGADRIVE_REG13_DMALENGTH1, MEGADRIVE_REG14_DMALENGTH2, MEGADRIVE_REG15_DMASOURCE1, MEGADRIVE_REG16_DMASOURCE2, MEGADRIVE_REG17_DMASOURCE3, MEGADRIVE_REG17_DMATYPE, MEGADRIVE_REG01_DMA_ENABLE); @@ -821,24 +821,24 @@ WRITE16_MEMBER( sega315_5313_device::vdp_w ) } } -UINT16 sega315_5313_device::vdp_vram_r(void) +uint16_t sega315_5313_device::vdp_vram_r(void) { return MEGADRIV_VDP_VRAM((m_vdp_address&0xfffe)>>1); } -UINT16 sega315_5313_device::vdp_vsram_r(void) +uint16_t sega315_5313_device::vdp_vsram_r(void) { return m_vsram[(m_vdp_address&0x7e)>>1]; } -UINT16 sega315_5313_device::vdp_cram_r(void) +uint16_t sega315_5313_device::vdp_cram_r(void) { return m_cram[(m_vdp_address&0x7e)>>1]; } -UINT16 sega315_5313_device::data_port_r() +uint16_t sega315_5313_device::data_port_r() { - UINT16 retdata=0; + uint16_t retdata=0; //return machine().rand(); @@ -953,7 +953,7 @@ PAL, 256x224 -UINT16 sega315_5313_device::ctrl_port_r() +uint16_t sega315_5313_device::ctrl_port_r() { /* Battletoads is very fussy about the vblank flag it wants it to be 1. in scanline 224 */ @@ -975,7 +975,7 @@ UINT16 sega315_5313_device::ctrl_port_r() int fifo_empty = 1; int fifo_full = 0; - UINT16 hpos = get_hposition(); + uint16_t hpos = get_hposition(); if (hpos>400) hblank_flag = 1; if (hpos>460) hblank_flag = 0; @@ -1022,7 +1022,7 @@ UINT16 sega315_5313_device::ctrl_port_r() (m_vdp_pal << 0); // PAL MODE FLAG checked by striker for region prot.. } -static const UINT8 vc_ntsc_224[] = +static const uint8_t vc_ntsc_224[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, @@ -1043,7 +1043,7 @@ static const UINT8 vc_ntsc_224[] = 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -static const UINT8 vc_ntsc_240[] = +static const uint8_t vc_ntsc_240[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, @@ -1064,7 +1064,7 @@ static const UINT8 vc_ntsc_240[] = 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 }; -static const UINT8 vc_pal_224[] = +static const uint8_t vc_pal_224[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, @@ -1088,7 +1088,7 @@ static const UINT8 vc_pal_224[] = 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -static const UINT8 vc_pal_240[] = +static const uint8_t vc_pal_240[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, @@ -1113,9 +1113,9 @@ static const UINT8 vc_pal_240[] = }; -UINT16 sega315_5313_device::get_hposition() +uint16_t sega315_5313_device::get_hposition() { - UINT16 value4; + uint16_t value4; if (!m_use_alt_timing) { @@ -1125,7 +1125,7 @@ UINT16 sega315_5313_device::get_hposition() 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 */ { @@ -1150,14 +1150,14 @@ int sega315_5313_device::get_scanline_counter() } -UINT16 sega315_5313_device::megadriv_read_hv_counters() +uint16_t sega315_5313_device::megadriv_read_hv_counters() { /* Bubble and Squeek wants vcount=0xe0 */ /* Dracula is very sensitive to this */ /* Marvel Land is sensitive to this */ int vpos = get_scanline_counter(); - UINT16 hpos = get_hposition(); + uint16_t hpos = get_hposition(); // if (hpos>424) vpos++; // fixes dracula, breaks road rash if (hpos>460) vpos++; // when does vpos increase.. also on sms, check game gear manual.. @@ -1188,7 +1188,7 @@ UINT16 sega315_5313_device::megadriv_read_hv_counters() READ16_MEMBER( sega315_5313_device::vdp_r ) { - UINT16 retvalue = 0; + uint16_t retvalue = 0; @@ -1274,7 +1274,7 @@ void sega315_5313_device::render_spriteline_to_spritebuffer(int scanline) int screenwidth; int maxsprites=0; int maxpixels=0; - UINT16 base_address=0; + uint16_t base_address=0; @@ -1299,7 +1299,7 @@ void sega315_5313_device::render_spriteline_to_spritebuffer(int scanline) int drawypos; int /*drawwidth,*/ drawheight; int spritemask = 0; - UINT8 height,width,link,xflip,yflip,colour,pri; + uint8_t height,width,link,xflip,yflip,colour,pri; /* Get Sprite Attribs */ spritenum = 0; @@ -1308,7 +1308,7 @@ void sega315_5313_device::render_spriteline_to_spritebuffer(int scanline) do { - //UINT16 value1,value2,value3,value4; + //uint16_t value1,value2,value3,value4; //value1 = m_vram[((base_address>>1)+spritenum*4)+0x0]; //value2 = m_vram[((base_address>>1)+spritenum*4)+0x1]; @@ -1383,9 +1383,9 @@ void sega315_5313_device::render_spriteline_to_spritebuffer(int scanline) if (!xflip) { - UINT16 base_addr; + uint16_t base_addr; int xxx; - UINT32 gfxdata; + uint32_t gfxdata; int loopcount; if(m_imode == 3) @@ -1414,9 +1414,9 @@ void sega315_5313_device::render_spriteline_to_spritebuffer(int scanline) } else { - UINT16 base_addr; + uint16_t base_addr; int xxx; - UINT32 gfxdata; + uint32_t gfxdata; int loopcount; @@ -1461,20 +1461,20 @@ void sega315_5313_device::render_spriteline_to_spritebuffer(int scanline) /* Clean up this function (!) */ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) { - UINT16 base_a; - UINT16 base_w=0; - UINT16 base_b; - - UINT16 size; - UINT16 hsize = 64; - UINT16 vsize = 64; - UINT16 window_right; -// UINT16 window_hpos; - UINT16 window_down; -// UINT16 window_vpos; - UINT16 hscroll_base; -// UINT8 vscroll_mode; -// UINT8 hscroll_mode; + uint16_t base_a; + uint16_t base_w=0; + uint16_t base_b; + + uint16_t size; + uint16_t hsize = 64; + uint16_t vsize = 64; + uint16_t window_right; +// uint16_t window_hpos; + uint16_t window_down; +// uint16_t window_vpos; + uint16_t hscroll_base; +// uint8_t vscroll_mode; +// uint8_t hscroll_mode; int window_firstline; int window_lastline; int window_firstcol; @@ -1731,7 +1731,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) if (!tile_xflip) { /* 8 pixels */ - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=hscroll_part;shift<8;shift++) @@ -1742,7 +1742,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) } else { - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=hscroll_part;shift<8;shift++) { @@ -1799,7 +1799,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) if (!tile_xflip) { /* 8 pixels */ - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<8;shift++) @@ -1810,7 +1810,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) } else { - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<8;shift++) { @@ -1866,7 +1866,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) if (!tile_xflip) { /* 8 pixels */ - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<(hscroll_part);shift++) @@ -1877,7 +1877,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) } else { - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<(hscroll_part);shift++) { @@ -1951,7 +1951,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) if (!tile_xflip) { /* 8 pixels */ - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<8;shift++) @@ -1971,7 +1971,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) } else { - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<8;shift++) { @@ -2028,7 +2028,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) if (!tile_xflip) { /* 8 pixels */ - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<8;shift++) @@ -2048,7 +2048,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) } else { - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<8;shift++) { @@ -2146,7 +2146,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) if (!tile_xflip) { /* 8 pixels */ - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=hscroll_part;shift<8;shift++) @@ -2166,7 +2166,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) } else { - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=hscroll_part;shift<8;shift++) { @@ -2238,7 +2238,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) if (!tile_xflip) { /* 8 pixels */ - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<8;shift++) @@ -2258,7 +2258,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) } else { - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<8;shift++) { @@ -2326,7 +2326,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) if (!tile_xflip) { /* 8 pixels */ - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<(hscroll_part);shift++) @@ -2346,7 +2346,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) } else { - UINT32 gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); + uint32_t gfxdata = (MEGADRIV_VDP_VRAM(tile_addr+0)<<16)|MEGADRIV_VDP_VRAM(tile_addr+1); int shift; for (shift=0;shift<(hscroll_part);shift++) { @@ -2385,7 +2385,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) if (m_sprite_renderline[x+128] & 0x40) { - UINT8 spritedata; + uint8_t spritedata; spritedata = m_sprite_renderline[x+128]&0x3f; if ((spritedata==0x0e) || (spritedata==0x1e) || (spritedata==0x2e)) @@ -2458,7 +2458,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) { if (m_sprite_renderline[x+128] & 0x80) { - UINT8 spritedata; + uint8_t spritedata; spritedata = m_sprite_renderline[x+128]&0x3f; if (spritedata==0x3e) @@ -2485,7 +2485,7 @@ void sega315_5313_device::render_videoline_to_videobuffer(int scanline) /* This converts our render buffer to real screen colours */ void sega315_5313_device::render_videobuffer_to_screenbuffer(int scanline) { - UINT16 *lineptr; + uint16_t *lineptr; @@ -2502,7 +2502,7 @@ void sega315_5313_device::render_videobuffer_to_screenbuffer(int scanline) for (int x = 0; x < 320; x++) { - UINT32 dat = m_video_renderline[x]; + uint32_t dat = m_video_renderline[x]; if (!(dat & 0x20000)) m_render_line_raw[x] = 0x100; diff --git a/src/devices/video/315_5313.h b/src/devices/video/315_5313.h index dc897265009..592c0be54e5 100644 --- a/src/devices/video/315_5313.h +++ b/src/devices/video/315_5313.h @@ -175,7 +175,7 @@ // Temporary solution while 32x VDP mixing and scanline interrupting is moved outside MD VDP -typedef device_delegate md_32x_scanline_delegate; +typedef device_delegate md_32x_scanline_delegate; typedef device_delegate md_32x_interrupt_delegate; typedef device_delegate md_32x_scanline_helper_delegate; @@ -192,7 +192,7 @@ typedef device_delegate md_32x_scanline_helper_delegate; class sega315_5313_device : public sega315_5124_device { public: - sega315_5313_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega315_5313_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_sndirqline_callback(device_t &device, _Object object) { return downcast(device).m_sndirqline_callback.set_callback(object); } template static devcb_base &set_lv6irqline_callback(device_t &device, _Object object) { return downcast(device).m_lv6irqline_callback.set_callback(object); } @@ -241,14 +241,14 @@ public: } std::unique_ptr m_render_bitmap; - std::unique_ptr m_render_line; - std::unique_ptr m_render_line_raw; + std::unique_ptr m_render_line; + std::unique_ptr m_render_line_raw; TIMER_DEVICE_CALLBACK_MEMBER( megadriv_scanline_timer_callback_alt_timing ); TIMER_DEVICE_CALLBACK_MEMBER( megadriv_scanline_timer_callback ); timer_device* m_megadriv_scanline_timer; - inline UINT16 vdp_get_word_from_68k_mem(UINT32 source); + inline uint16_t vdp_get_word_from_68k_mem(uint32_t source); protected: virtual void device_start() override; @@ -267,12 +267,12 @@ protected: private: int m_command_pending; // 2nd half of command pending.. - UINT16 m_command_part1; - UINT16 m_command_part2; - UINT8 m_vdp_code; - UINT16 m_vdp_address; - UINT8 m_vram_fill_pending; - UINT16 m_vram_fill_length; + uint16_t m_command_part1; + uint16_t m_command_part2; + uint8_t m_vdp_code; + uint16_t m_vdp_address; + uint8_t m_vram_fill_pending; + uint16_t m_vram_fill_length; int m_irq4counter; int m_imode_odd_frame; int m_sprite_collision; @@ -295,13 +295,13 @@ private: int m_use_cram; // c2 uses it's own palette ram, so it sets this to 0 int m_dma_delay; // SVP and SegaCD have some 'lag' in DMA transfers - std::unique_ptr m_regs; - std::unique_ptr m_vram; - std::unique_ptr m_cram; - std::unique_ptr m_vsram; + std::unique_ptr m_regs; + std::unique_ptr m_vram; + std::unique_ptr m_cram; + std::unique_ptr m_vsram; /* The VDP keeps a 0x400 byte on-chip cache of the Sprite Attribute Table to speed up processing, Castlevania Bloodlines abuses this on the upside down level */ - std::unique_ptr m_internal_sprite_attribute_table; + std::unique_ptr m_internal_sprite_attribute_table; // these are used internally by the VDP to schedule when after the start of a scanline // to trigger the various interrupts / rendering to our bitmap, bit of a hack really @@ -309,29 +309,29 @@ private: emu_timer* m_irq4_on_timer; emu_timer* m_render_timer; - UINT16 vdp_vram_r(void); - UINT16 vdp_vsram_r(void); - UINT16 vdp_cram_r(void); + uint16_t vdp_vram_r(void); + uint16_t vdp_vsram_r(void); + uint16_t vdp_cram_r(void); - void insta_68k_to_cram_dma(UINT32 source,UINT16 length); - void insta_68k_to_vsram_dma(UINT32 source,UINT16 length); - void insta_68k_to_vram_dma(UINT32 source,int length); - void insta_vram_copy(UINT32 source, UINT16 length); + void insta_68k_to_cram_dma(uint32_t source,uint16_t length); + void insta_68k_to_vsram_dma(uint32_t source,uint16_t length); + void insta_68k_to_vram_dma(uint32_t source,int length); + void insta_vram_copy(uint32_t source, uint16_t length); - void vdp_vram_write(UINT16 data); - void vdp_cram_write(UINT16 data); + void vdp_vram_write(uint16_t data); + void vdp_cram_write(uint16_t data); void write_cram_value(int offset, int data); - void vdp_vsram_write(UINT16 data); + void vdp_vsram_write(uint16_t data); - void vdp_set_register(int regnum, UINT8 value); + void vdp_set_register(int regnum, uint8_t value); void handle_dma_bits(); - UINT16 get_hposition(); - UINT16 megadriv_read_hv_counters(); + uint16_t get_hposition(); + uint16_t megadriv_read_hv_counters(); - UINT16 ctrl_port_r(); - UINT16 data_port_r(); + uint16_t ctrl_port_r(); + uint16_t data_port_r(); void data_port_w(int data); void ctrl_port_w(int data); void update_code_and_address(void); @@ -342,13 +342,13 @@ private: void render_videobuffer_to_screenbuffer(int scanline); /* variables used during emulation - not saved */ - std::unique_ptr m_sprite_renderline; - std::unique_ptr m_highpri_renderline; - std::unique_ptr m_video_renderline; - std::unique_ptr m_palette_lookup; - std::unique_ptr m_palette_lookup_sprite; // for C2 - std::unique_ptr m_palette_lookup_shadow; - std::unique_ptr m_palette_lookup_highlight; + std::unique_ptr m_sprite_renderline; + std::unique_ptr m_highpri_renderline; + std::unique_ptr m_video_renderline; + std::unique_ptr m_palette_lookup; + std::unique_ptr m_palette_lookup_sprite; // for C2 + std::unique_ptr m_palette_lookup_shadow; + std::unique_ptr m_palette_lookup_highlight; address_space *m_space68k; m68000_base_device* m_cpu68k; diff --git a/src/devices/video/bufsprite.h b/src/devices/video/bufsprite.h index 70975527c32..7e5fdc2e1aa 100644 --- a/src/devices/video/bufsprite.h +++ b/src/devices/video/bufsprite.h @@ -53,17 +53,17 @@ class buffered_spriteram_device : public device_t { public: // construction - buffered_spriteram_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock) + buffered_spriteram_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, "Buffered Sprite RAM", tag, owner, clock, "buffered_spriteram", __FILE__), m_spriteram(*this, DEVICE_SELF) { } // getters _Type *live() const { return m_spriteram; } _Type *buffer() { return &m_buffered[0]; } - UINT32 bytes() const { return m_spriteram.bytes(); } + uint32_t bytes() const { return m_spriteram.bytes(); } // operations - _Type *copy(UINT32 srcoffset = 0, UINT32 srclength = 0x7fffffff) + _Type *copy(uint32_t srcoffset = 0, uint32_t srclength = 0x7fffffff) { assert(m_spriteram != nullptr); if (m_spriteram != nullptr) @@ -98,45 +98,45 @@ private: // ======================> buffered_spriteram8_device -class buffered_spriteram8_device : public buffered_spriteram_device +class buffered_spriteram8_device : public buffered_spriteram_device { public: // construction - buffered_spriteram8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : buffered_spriteram_device(mconfig, BUFFERED_SPRITERAM8, tag, owner, clock) { } + buffered_spriteram8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : buffered_spriteram_device(mconfig, BUFFERED_SPRITERAM8, tag, owner, clock) { } }; // ======================> buffered_spriteram16_device -class buffered_spriteram16_device : public buffered_spriteram_device +class buffered_spriteram16_device : public buffered_spriteram_device { public: // construction - buffered_spriteram16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : buffered_spriteram_device(mconfig, BUFFERED_SPRITERAM16, tag, owner, clock) { } + buffered_spriteram16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : buffered_spriteram_device(mconfig, BUFFERED_SPRITERAM16, tag, owner, clock) { } }; // ======================> buffered_spriteram32_device -class buffered_spriteram32_device : public buffered_spriteram_device +class buffered_spriteram32_device : public buffered_spriteram_device { public: // construction - buffered_spriteram32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : buffered_spriteram_device(mconfig, BUFFERED_SPRITERAM32, tag, owner, clock) { } + buffered_spriteram32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : buffered_spriteram_device(mconfig, BUFFERED_SPRITERAM32, tag, owner, clock) { } }; // ======================> buffered_spriteram64_device -class buffered_spriteram64_device : public buffered_spriteram_device +class buffered_spriteram64_device : public buffered_spriteram_device { public: // construction - buffered_spriteram64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : buffered_spriteram_device(mconfig, BUFFERED_SPRITERAM64, tag, owner, clock) { } + buffered_spriteram64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : buffered_spriteram_device(mconfig, BUFFERED_SPRITERAM64, tag, owner, clock) { } }; diff --git a/src/devices/video/cdp1861.cpp b/src/devices/video/cdp1861.cpp index a02309decca..a853f4acd90 100644 --- a/src/devices/video/cdp1861.cpp +++ b/src/devices/video/cdp1861.cpp @@ -38,7 +38,7 @@ const device_type CDP1861 = &device_creator; // cdp1861_device - constructor //------------------------------------------------- -cdp1861_device::cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdp1861_device::cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDP1861, "CDP1861", tag, owner, clock, "cdp1861", __FILE__), device_video_interface(mconfig, *this), m_write_irq(*this), @@ -239,7 +239,7 @@ WRITE_LINE_MEMBER( cdp1861_device::disp_off_w ) // screen_update - //------------------------------------------------- -UINT32 cdp1861_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cdp1861_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_disp) { diff --git a/src/devices/video/cdp1861.h b/src/devices/video/cdp1861.h index 08b76bd59cc..ba85da6311c 100644 --- a/src/devices/video/cdp1861.h +++ b/src/devices/video/cdp1861.h @@ -93,7 +93,7 @@ class cdp1861_device : public device_t, { public: // construction/destruction - cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdp1861_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); } template static devcb_base &set_dma_out_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_dma_out.set_callback(object); } @@ -103,7 +103,7 @@ public: DECLARE_WRITE_LINE_MEMBER( disp_on_w ); DECLARE_WRITE_LINE_MEMBER( disp_off_w ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); bitmap_rgb32 m_bitmap; diff --git a/src/devices/video/cdp1862.cpp b/src/devices/video/cdp1862.cpp index e75cb66c888..ed471a4da8e 100644 --- a/src/devices/video/cdp1862.cpp +++ b/src/devices/video/cdp1862.cpp @@ -75,7 +75,7 @@ inline void cdp1862_device::initialize_palette() // cdp1862_device - constructor //------------------------------------------------- -cdp1862_device::cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cdp1862_device::cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CDP1862, "CDP1862", tag, owner, clock, "cdp1862", __FILE__), device_video_interface(mconfig, *this), m_read_rd(*this), @@ -188,7 +188,7 @@ WRITE_LINE_MEMBER( cdp1862_device::con_w ) // screen_update - //------------------------------------------------- -UINT32 cdp1862_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cdp1862_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); diff --git a/src/devices/video/cdp1862.h b/src/devices/video/cdp1862.h index 36e04689500..11f1ed35d20 100644 --- a/src/devices/video/cdp1862.h +++ b/src/devices/video/cdp1862.h @@ -70,7 +70,7 @@ class cdp1862_device : public device_t, { public: // construction/destruction - cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_rd_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_rd.set_callback(object); } template static devcb_base &set_bd_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_bd.set_callback(object); } @@ -83,7 +83,7 @@ public: DECLARE_WRITE_LINE_MEMBER( bkg_w ); DECLARE_WRITE_LINE_MEMBER( con_w ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides diff --git a/src/devices/video/clgd542x.cpp b/src/devices/video/clgd542x.cpp index f7950c879a9..163c80ccccf 100644 --- a/src/devices/video/clgd542x.cpp +++ b/src/devices/video/clgd542x.cpp @@ -41,17 +41,17 @@ const device_type CIRRUS_GD5428 = &device_creator; const device_type CIRRUS_GD5430 = &device_creator; -cirrus_gd5428_device::cirrus_gd5428_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cirrus_gd5428_device::cirrus_gd5428_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, CIRRUS_GD5428, "Cirrus Logic GD5428", tag, owner, clock, "clgd5428", __FILE__) { } -cirrus_gd5428_device::cirrus_gd5428_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) +cirrus_gd5428_device::cirrus_gd5428_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) : svga_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -cirrus_gd5430_device::cirrus_gd5430_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cirrus_gd5430_device::cirrus_gd5430_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cirrus_gd5428_device(mconfig, CIRRUS_GD5430, "Cirrus Logic GD5430", tag, owner, clock, "clgd5430", __FILE__) { } @@ -133,13 +133,13 @@ void cirrus_gd5428_device::device_reset() m_blt_system_transfer = false; } -UINT32 cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,bit; - UINT32 ptr = (vga.svga_intf.vram_size - 0x4000); // cursor patterns are stored in the last 16kB of VRAM + uint32_t ptr = (vga.svga_intf.vram_size - 0x4000); // cursor patterns are stored in the last 16kB of VRAM svga_device::screen_update(screen, bitmap, cliprect); - /*UINT8 cur_mode =*/ pc_vga_choosevideomode(); + /*uint8_t cur_mode =*/ pc_vga_choosevideomode(); if(m_cursor_attr & 0x01) // hardware cursor enabled { // draw hardware graphics cursor @@ -152,9 +152,9 @@ UINT32 cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32 & { for(bit=0;bit<8;bit++) { - UINT8 pixel1 = vga.memory[ptr % vga.svga_intf.vram_size] >> (7-bit); - UINT8 pixel2 = vga.memory[(ptr+512) % vga.svga_intf.vram_size] >> (7-bit); - UINT8 output = ((pixel1 & 0x01) << 1) | (pixel2 & 0x01); + uint8_t pixel1 = vga.memory[ptr % vga.svga_intf.vram_size] >> (7-bit); + uint8_t pixel2 = vga.memory[(ptr+512) % vga.svga_intf.vram_size] >> (7-bit); + uint8_t output = ((pixel1 & 0x01) << 1) | (pixel2 & 0x01); switch(output) { case 0: // transparent - do nothing @@ -182,9 +182,9 @@ UINT32 cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32 & { for(bit=0;bit<8;bit++) { - UINT8 pixel1 = vga.memory[ptr % vga.svga_intf.vram_size] >> (7-bit); - UINT8 pixel2 = vga.memory[(ptr+128) % vga.svga_intf.vram_size] >> (7-bit); - UINT8 output = ((pixel1 & 0x01) << 1) | (pixel2 & 0x01); + uint8_t pixel1 = vga.memory[ptr % vga.svga_intf.vram_size] >> (7-bit); + uint8_t pixel2 = vga.memory[(ptr+128) % vga.svga_intf.vram_size] >> (7-bit); + uint8_t output = ((pixel1 & 0x01) << 1) | (pixel2 & 0x01); switch(output) { case 0: // transparent - do nothing @@ -210,9 +210,9 @@ UINT32 cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32 & void cirrus_gd5428_device::cirrus_define_video_mode() { - UINT8 divisor = 1; + uint8_t divisor = 1; float clock; - UINT8 clocksel = (vga.miscellaneous_output & 0xc) >> 2; + uint8_t clocksel = (vga.miscellaneous_output & 0xc) >> 2; svga.rgb8_en = 0; svga.rgb15_en = 0; @@ -244,9 +244,9 @@ void cirrus_gd5428_device::cirrus_define_video_mode() recompute_params_clock(divisor, (int)clock); } -UINT16 cirrus_gd5428_device::offset() +uint16_t cirrus_gd5428_device::offset() { - UINT16 off = vga_device::offset(); + uint16_t off = vga_device::offset(); if (svga.rgb8_en == 1) // guess off <<= 2; @@ -262,7 +262,7 @@ UINT16 cirrus_gd5428_device::offset() void cirrus_gd5428_device::start_bitblt() { - UINT32 x,y; + uint32_t x,y; if(m_blt_mode & 0x01) { @@ -284,7 +284,7 @@ void cirrus_gd5428_device::start_bitblt() if(m_blt_mode & 0x10) // 16-bit colour expansion / transparency width { // use GR0/1/10/11 background/foreground regs - UINT16 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-((x/2) % 8)) & 0x01) ? ((m_gr11 << 8) | vga.gc.enable_set_reset) : ((m_gr10 << 8) | vga.gc.set_reset); + uint16_t pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-((x/2) % 8)) & 0x01) ? ((m_gr11 << 8) | vga.gc.enable_set_reset) : ((m_gr10 << 8) | vga.gc.set_reset); if(m_blt_dest_current & 1) copy_pixel(pixel >> 8, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); @@ -295,7 +295,7 @@ void cirrus_gd5428_device::start_bitblt() } else { - UINT8 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs + uint8_t pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs copy_pixel(pixel, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't increment if a pattern (it's only 8 bits) @@ -343,7 +343,7 @@ void cirrus_gd5428_device::start_bitblt() void cirrus_gd5428_device::start_reverse_bitblt() { - UINT32 x,y; + uint32_t x,y; if(LOG_BLIT) logerror("CL: Reverse BitBLT started: Src: %06x Dst: %06x Width: %i Height %i ROP: %02x Mode: %02x\n",m_blt_source,m_blt_dest,m_blt_width,m_blt_height,m_blt_rop,m_blt_mode); @@ -360,7 +360,7 @@ void cirrus_gd5428_device::start_reverse_bitblt() if(m_blt_mode & 0x10) // 16-bit colour expansion / transparency width { // use GR0/1/10/11 background/foreground regs - UINT16 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-((x/2) % 8)) & 0x01) ? ((m_gr11 << 8) | vga.gc.enable_set_reset) : ((m_gr10 << 8) | vga.gc.set_reset); + uint16_t pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-((x/2) % 8)) & 0x01) ? ((m_gr11 << 8) | vga.gc.enable_set_reset) : ((m_gr10 << 8) | vga.gc.set_reset); if(m_blt_dest_current & 1) copy_pixel(pixel >> 8, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); @@ -371,7 +371,7 @@ void cirrus_gd5428_device::start_reverse_bitblt() } else { - UINT8 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs + uint8_t pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs copy_pixel(pixel, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]); if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't decrement if a pattern (it's only 8 bits) @@ -432,7 +432,7 @@ void cirrus_gd5428_device::start_system_bitblt() void cirrus_gd5428_device::blit_dword() { // TODO: add support for reverse direction - UINT8 x,pixel; + uint8_t x,pixel; for(x=0;x<32;x+=8) { @@ -459,7 +459,7 @@ void cirrus_gd5428_device::blit_dword() void cirrus_gd5428_device::blit_byte() { // TODO: add support for reverse direction - UINT8 x,pixel; + uint8_t x,pixel; for(x=0;x<8;x++) { @@ -486,9 +486,9 @@ void cirrus_gd5428_device::blit_byte() } } -void cirrus_gd5428_device::copy_pixel(UINT8 src, UINT8 dst) +void cirrus_gd5428_device::copy_pixel(uint8_t src, uint8_t dst) { - UINT8 res = src; + uint8_t res = src; switch(m_blt_rop) { @@ -522,9 +522,9 @@ void cirrus_gd5428_device::copy_pixel(UINT8 src, UINT8 dst) vga.memory[m_blt_dest_current % vga.svga_intf.vram_size] = res; } -UINT8 cirrus_gd5428_device::cirrus_seq_reg_read(UINT8 index) +uint8_t cirrus_gd5428_device::cirrus_seq_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; res = 0xff; @@ -581,7 +581,7 @@ UINT8 cirrus_gd5428_device::cirrus_seq_reg_read(UINT8 index) return res; } -void cirrus_gd5428_device::cirrus_seq_reg_write(UINT8 index, UINT8 data) +void cirrus_gd5428_device::cirrus_seq_reg_write(uint8_t index, uint8_t data) { if(LOG_REG) logerror("CL: SEQ write %02x to SR%02x\n",data,index); switch(index) @@ -673,9 +673,9 @@ void cirrus_gd5428_device::cirrus_seq_reg_write(UINT8 index, UINT8 data) } } -UINT8 cirrus_gd5428_device::cirrus_gc_reg_read(UINT8 index) +uint8_t cirrus_gd5428_device::cirrus_gc_reg_read(uint8_t index) { - UINT8 res = 0xff; + uint8_t res = 0xff; switch(index) { @@ -795,7 +795,7 @@ UINT8 cirrus_gd5428_device::cirrus_gc_reg_read(UINT8 index) return res; } -void cirrus_gd5428_device::cirrus_gc_reg_write(UINT8 index, UINT8 data) +void cirrus_gd5428_device::cirrus_gc_reg_write(uint8_t index, uint8_t data) { if(LOG_REG) logerror("CL: GC write %02x to GR%02x\n",data,index); switch(index) @@ -926,7 +926,7 @@ void cirrus_gd5428_device::cirrus_gc_reg_write(UINT8 index, UINT8 data) READ8_MEMBER(cirrus_gd5428_device::port_03c0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; switch(offset) { @@ -1018,7 +1018,7 @@ WRITE8_MEMBER(cirrus_gd5428_device::port_03c0_w) READ8_MEMBER(cirrus_gd5428_device::port_03b0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3b0) { @@ -1038,7 +1038,7 @@ READ8_MEMBER(cirrus_gd5428_device::port_03b0_r) READ8_MEMBER(cirrus_gd5428_device::port_03d0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3d0) { @@ -1092,9 +1092,9 @@ WRITE8_MEMBER(cirrus_gd5428_device::port_03d0_w) cirrus_define_video_mode(); } -UINT8 cirrus_gd5428_device::cirrus_crtc_reg_read(UINT8 index) +uint8_t cirrus_gd5428_device::cirrus_crtc_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; switch(index) { @@ -1121,7 +1121,7 @@ UINT8 cirrus_gd5428_device::cirrus_crtc_reg_read(UINT8 index) return res; } -void cirrus_gd5428_device::cirrus_crtc_reg_write(UINT8 index, UINT8 data) +void cirrus_gd5428_device::cirrus_crtc_reg_write(uint8_t index, uint8_t data) { if(LOG_REG) logerror("CL: CRTC write %02x to CR%02x\n",data,index); switch(index) @@ -1159,10 +1159,10 @@ void cirrus_gd5428_device::cirrus_crtc_reg_write(UINT8 index, UINT8 data) } -inline UINT8 cirrus_gd5428_device::cirrus_vga_latch_write(int offs, UINT8 data) +inline uint8_t cirrus_gd5428_device::cirrus_vga_latch_write(int offs, uint8_t data) { - UINT8 res = 0; - UINT8 mode_mask = (gc_mode_ext & 0x04) ? 0x07 : 0x03; + uint8_t res = 0; + uint8_t mode_mask = (gc_mode_ext & 0x04) ? 0x07 : 0x03; switch (vga.gc.write_mode & mode_mask) { case 0: @@ -1197,9 +1197,9 @@ inline UINT8 cirrus_gd5428_device::cirrus_vga_latch_write(int offs, UINT8 data) READ8_MEMBER(cirrus_gd5428_device::mem_r) { - UINT32 addr; - UINT8 bank; - UINT8 cur_mode = pc_vga_choosevideomode(); + uint32_t addr; + uint8_t bank; + uint8_t cur_mode = pc_vga_choosevideomode(); if(gc_locked || offset >= 0x10000 || cur_mode == TEXT_MODE || cur_mode == SCREEN_OFF) return vga_device::mem_r(space,offset,mem_mask); @@ -1220,7 +1220,7 @@ READ8_MEMBER(cirrus_gd5428_device::mem_r) if(svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb24_en) { - UINT8 data = 0; + uint8_t data = 0; if(gc_mode_ext & 0x01) { if(offset & 0x10000) @@ -1274,8 +1274,8 @@ READ8_MEMBER(cirrus_gd5428_device::mem_r) if (vga.gc.read_mode) { - UINT8 byte,layer; - UINT8 fill_latch; + uint8_t byte,layer; + uint8_t fill_latch; data=0; for(byte=0;byte<8;byte++) @@ -1299,8 +1299,8 @@ READ8_MEMBER(cirrus_gd5428_device::mem_r) else { // TODO: Lines up in 16-colour mode, likely different for 256-colour modes (docs say video addresses are shifted right 3 places) - UINT8 i,data; -// UINT8 bits = ((gc_mode_ext & 0x08) && (vga.gc.write_mode == 1)) ? 8 : 4; + uint8_t i,data; +// uint8_t bits = ((gc_mode_ext & 0x08) && (vga.gc.write_mode == 1)) ? 8 : 4; data = 0; //printf("%08x\n",offset); @@ -1328,9 +1328,9 @@ READ8_MEMBER(cirrus_gd5428_device::mem_r) WRITE8_MEMBER(cirrus_gd5428_device::mem_w) { - UINT32 addr; - UINT8 bank; - UINT8 cur_mode = pc_vga_choosevideomode(); + uint32_t addr; + uint8_t bank; + uint8_t cur_mode = pc_vga_choosevideomode(); if(m_blt_system_transfer) { @@ -1490,8 +1490,8 @@ WRITE8_MEMBER(cirrus_gd5428_device::mem_w) { // TODO: Lines up in 16-colour mode, likely different for 256-colour modes (docs say video addresses are shifted right 3 places) - UINT8 i; -// UINT8 bits = ((gc_mode_ext & 0x08) && (vga.gc.write_mode == 1)) ? 8 : 4; + uint8_t i; +// uint8_t bits = ((gc_mode_ext & 0x08) && (vga.gc.write_mode == 1)) ? 8 : 4; for(i=0;i<4;i++) { diff --git a/src/devices/video/clgd542x.h b/src/devices/video/clgd542x.h index ba9b442b360..685233773b7 100644 --- a/src/devices/video/clgd542x.h +++ b/src/devices/video/clgd542x.h @@ -16,8 +16,8 @@ class cirrus_gd5428_device : public svga_device { public: // construction/destruction - cirrus_gd5428_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - cirrus_gd5428_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); + cirrus_gd5428_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + cirrus_gd5428_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 READ8_MEMBER(port_03c0_r) override; virtual WRITE8_MEMBER(port_03c0_w) override; virtual READ8_MEMBER(port_03b0_r) override; @@ -27,84 +27,84 @@ public: virtual READ8_MEMBER(mem_r) override; virtual WRITE8_MEMBER(mem_w) override; - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - virtual UINT16 offset() override; + virtual uint16_t offset() override; - UINT8 m_chip_id; + uint8_t m_chip_id; - UINT8 gc_mode_ext; - UINT8 gc_bank_0; - UINT8 gc_bank_1; + uint8_t gc_mode_ext; + uint8_t gc_bank_0; + uint8_t gc_bank_1; bool gc_locked; - UINT8 m_lock_reg; - UINT8 m_gr10; // high byte of background colour (in 15/16bpp) - UINT8 m_gr11; // high byte of foreground colour (in 15/16bpp) + uint8_t m_lock_reg; + uint8_t m_gr10; // high byte of background colour (in 15/16bpp) + uint8_t m_gr11; // high byte of foreground colour (in 15/16bpp) - UINT8 m_cr19; - UINT8 m_cr1a; - UINT8 m_cr1b; + uint8_t m_cr19; + uint8_t m_cr1a; + uint8_t m_cr1b; // hardware cursor - UINT16 m_cursor_x; - UINT16 m_cursor_y; - UINT16 m_cursor_addr; - UINT8 m_cursor_attr; + uint16_t m_cursor_x; + uint16_t m_cursor_y; + uint16_t m_cursor_addr; + uint8_t m_cursor_attr; bool m_ext_palette_enabled; - struct { UINT8 red, green, blue; } m_ext_palette[16]; // extra palette, colour 0 is cursor background, colour 15 is cursor foreground, colour 2 is overscan border colour + struct { uint8_t red, green, blue; } m_ext_palette[16]; // extra palette, colour 0 is cursor background, colour 15 is cursor foreground, colour 2 is overscan border colour // BitBLT engine - UINT8 m_blt_status; - UINT8 m_blt_rop; - UINT8 m_blt_mode; - UINT32 m_blt_source; - UINT32 m_blt_dest; - UINT16 m_blt_source_pitch; - UINT16 m_blt_dest_pitch; - UINT16 m_blt_height; - UINT16 m_blt_width; - UINT32 m_blt_source_current; - UINT32 m_blt_dest_current; - UINT16 m_blt_trans_colour; - UINT16 m_blt_trans_colour_mask; + uint8_t m_blt_status; + uint8_t m_blt_rop; + uint8_t m_blt_mode; + uint32_t m_blt_source; + uint32_t m_blt_dest; + uint16_t m_blt_source_pitch; + uint16_t m_blt_dest_pitch; + uint16_t m_blt_height; + uint16_t m_blt_width; + uint32_t m_blt_source_current; + uint32_t m_blt_dest_current; + uint16_t m_blt_trans_colour; + uint16_t m_blt_trans_colour_mask; bool m_blt_system_transfer; // blit from system memory - UINT8 m_blt_system_count; - UINT32 m_blt_system_buffer; - UINT16 m_blt_pixel_count; - UINT16 m_blt_scan_count; - - UINT8 m_scratchpad1; - UINT8 m_scratchpad2; - UINT8 m_scratchpad3; - UINT8 m_vclk_num[4]; - UINT8 m_vclk_denom[4]; - - inline UINT8 cirrus_vga_latch_write(int offs, UINT8 data); + uint8_t m_blt_system_count; + uint32_t m_blt_system_buffer; + uint16_t m_blt_pixel_count; + uint16_t m_blt_scan_count; + + uint8_t m_scratchpad1; + uint8_t m_scratchpad2; + uint8_t m_scratchpad3; + uint8_t m_vclk_num[4]; + uint8_t m_vclk_denom[4]; + + inline uint8_t cirrus_vga_latch_write(int offs, uint8_t data); private: void cirrus_define_video_mode(); - UINT8 cirrus_seq_reg_read(UINT8 index); - void cirrus_seq_reg_write(UINT8 index, UINT8 data); - UINT8 cirrus_gc_reg_read(UINT8 index); - void cirrus_gc_reg_write(UINT8 index, UINT8 data); - UINT8 cirrus_crtc_reg_read(UINT8 index); - void cirrus_crtc_reg_write(UINT8 index, UINT8 data); + uint8_t cirrus_seq_reg_read(uint8_t index); + void cirrus_seq_reg_write(uint8_t index, uint8_t data); + uint8_t cirrus_gc_reg_read(uint8_t index); + void cirrus_gc_reg_write(uint8_t index, uint8_t data); + uint8_t cirrus_crtc_reg_read(uint8_t index); + void cirrus_crtc_reg_write(uint8_t index, uint8_t data); void start_bitblt(); void start_reverse_bitblt(); void start_system_bitblt(); void blit_dword(); void blit_byte(); // used for colour expanded system-to-vram bitblts - void copy_pixel(UINT8 src, UINT8 dst); + void copy_pixel(uint8_t src, uint8_t dst); }; class cirrus_gd5430_device : public cirrus_gd5428_device { public: - cirrus_gd5430_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cirrus_gd5430_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; }; diff --git a/src/devices/video/crt9007.cpp b/src/devices/video/crt9007.cpp index 84ec673ec8b..1992a369df9 100644 --- a/src/devices/video/crt9007.cpp +++ b/src/devices/video/crt9007.cpp @@ -233,7 +233,7 @@ ADDRESS_MAP_END // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT8 crt9007_t::readbyte(offs_t address) +inline uint8_t crt9007_t::readbyte(offs_t address) { return space().read_byte(address); } @@ -449,7 +449,7 @@ inline void crt9007_t::recompute_parameters() // crt9007_t - constructor //------------------------------------------------- -crt9007_t::crt9007_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +crt9007_t::crt9007_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CRT9007, "SMC CRT9007", tag, owner, clock, "crt9007", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -668,7 +668,7 @@ const address_space_config *crt9007_t::memory_space_config(address_spacenum spac READ8_MEMBER( crt9007_t::read ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { diff --git a/src/devices/video/crt9007.h b/src/devices/video/crt9007.h index 8a812a73899..67d43d6ce40 100644 --- a/src/devices/video/crt9007.h +++ b/src/devices/video/crt9007.h @@ -99,7 +99,7 @@ class crt9007_t : public device_t, { public: // construction/destruction - crt9007_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crt9007_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_character_width(device_t &device, int value) { downcast(device).m_hpixels_per_column = value; } @@ -143,7 +143,7 @@ private: TIMER_DMA }; - inline UINT8 readbyte(offs_t address); + inline uint8_t readbyte(offs_t address); inline void trigger_interrupt(int line); inline void update_cblank_line(); @@ -172,8 +172,8 @@ private: devcb_write_line m_write_sld; // registers - UINT8 m_reg[0x3d]; - UINT8 m_status; + uint8_t m_reg[0x3d]; + uint8_t m_status; int m_disp; int m_hpixels_per_column; diff --git a/src/devices/video/crt9021.cpp b/src/devices/video/crt9021.cpp index d72baff2b2b..7b469ce100a 100644 --- a/src/devices/video/crt9021.cpp +++ b/src/devices/video/crt9021.cpp @@ -60,7 +60,7 @@ const device_type CRT9021 = &device_creator; // crt9021_t - constructor //------------------------------------------------- -crt9021_t::crt9021_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +crt9021_t::crt9021_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CRT9021, "SMC CRT9021", tag, owner, clock, "crt9021", __FILE__), device_video_interface(mconfig, *this), m_data(0), @@ -179,7 +179,7 @@ WRITE_LINE_MEMBER( crt9021_t::vsync_w ) // screen_update - update screen //------------------------------------------------- -UINT32 crt9021_t::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t crt9021_t::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_bitmap.fill(rgb_t::black, cliprect); diff --git a/src/devices/video/crt9021.h b/src/devices/video/crt9021.h index 7d38f207d3e..049c96013b5 100644 --- a/src/devices/video/crt9021.h +++ b/src/devices/video/crt9021.h @@ -36,7 +36,7 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define CRT9021_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int y, int x, UINT8 video, int intout) +#define CRT9021_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int y, int x, uint8_t video, int intout) #define MCFG_CRT9021_DRAW_CHARACTER_CALLBACK_OWNER(_class, _method) \ @@ -47,7 +47,7 @@ // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate crt9021_draw_character_delegate; +typedef device_delegate crt9021_draw_character_delegate; // ======================> crt9021_t @@ -57,11 +57,11 @@ class crt9021_t : public device_t, { public: // construction/destruction - crt9021_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crt9021_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_display_callback(device_t &device, crt9021_draw_character_delegate callback) { downcast(device).m_display_cb = callback; } - void write(UINT8 data) { m_data = data; } + void write(uint8_t data) { m_data = data; } DECLARE_WRITE8_MEMBER( write ) { write(data); } DECLARE_WRITE_LINE_MEMBER( ms0_w ) { m_ms0 = state; } DECLARE_WRITE_LINE_MEMBER( ms1_w ) { m_ms1 = state; } @@ -83,7 +83,7 @@ public: DECLARE_WRITE_LINE_MEMBER( sl3_w ) { m_sl3 = state; } DECLARE_WRITE_LINE_MEMBER( vsync_w ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -103,7 +103,7 @@ private: bitmap_rgb32 m_bitmap; // inputs - UINT8 m_data; + uint8_t m_data; int m_ms0; int m_ms1; int m_revid; @@ -125,7 +125,7 @@ private: int m_vsync; // outputs - UINT8 m_sr; + uint8_t m_sr; int m_intout; int m_sl; }; diff --git a/src/devices/video/crt9212.cpp b/src/devices/video/crt9212.cpp index 0535afa169b..79bed06d43f 100644 --- a/src/devices/video/crt9212.cpp +++ b/src/devices/video/crt9212.cpp @@ -34,7 +34,7 @@ const device_type CRT9212 = &device_creator; // crt9212_t - constructor //------------------------------------------------- -crt9212_t::crt9212_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +crt9212_t::crt9212_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CRT9212, "SMC CRT9212", tag, owner, clock, "crt9212", __FILE__), m_write_dout(*this), m_write_rof(*this), diff --git a/src/devices/video/crt9212.h b/src/devices/video/crt9212.h index 011cc8467a8..4972c607e20 100644 --- a/src/devices/video/crt9212.h +++ b/src/devices/video/crt9212.h @@ -68,7 +68,7 @@ class crt9212_t : public device_t { public: // construction/destruction - crt9212_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crt9212_t(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_wen2(device_t &device, int state) { downcast(device).m_wen2 = state; } @@ -96,7 +96,7 @@ private: devcb_write_line m_write_wof; // inputs - UINT8 m_data; + uint8_t m_data; int m_clrcnt; int m_tog; int m_ren; @@ -108,10 +108,10 @@ private: // internal state bool m_clrcnt_edge; - UINT8 m_data_latch; + uint8_t m_data_latch; int m_ren_int; int m_wen_int; - UINT8 m_ram[CRT9212_RAM_SIZE][2]; + uint8_t m_ram[CRT9212_RAM_SIZE][2]; int m_buffer; int m_rac; int m_wac; diff --git a/src/devices/video/crtc_ega.cpp b/src/devices/video/crtc_ega.cpp index 0841adcc69a..83d34a5cf3a 100644 --- a/src/devices/video/crtc_ega.cpp +++ b/src/devices/video/crtc_ega.cpp @@ -18,7 +18,7 @@ const device_type CRTC_EGA = &device_creator; -crtc_ega_device::crtc_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crtc_ega_device::crtc_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CRTC_EGA, "crtc_EGA", tag, owner, clock, "crtc_ega", __FILE__), device_video_interface(mconfig, *this, false), m_res_out_de_cb(*this), @@ -50,7 +50,7 @@ WRITE8_MEMBER( crtc_ega_device::address_w ) READ8_MEMBER( crtc_ega_device::register_r ) { - UINT8 ret = 0; + uint8_t ret = 0; switch (m_register_address_latch) { @@ -136,15 +136,15 @@ WRITE8_MEMBER( crtc_ega_device::register_w ) void crtc_ega_device::recompute_parameters(bool postload) { - UINT16 hsync_on_pos, hsync_off_pos, vsync_on_pos, vsync_off_pos; + uint16_t hsync_on_pos, hsync_off_pos, vsync_on_pos, vsync_off_pos; /* compute the screen sizes */ - UINT16 horiz_pix_total = (m_horiz_char_total + 2) * m_hpixels_per_column; - UINT16 vert_pix_total = m_vert_total + 1; + uint16_t horiz_pix_total = (m_horiz_char_total + 2) * m_hpixels_per_column; + uint16_t vert_pix_total = m_vert_total + 1; /* determine the visible area, avoid division by 0 */ - UINT16 max_visible_x = ( m_horiz_disp + 1 ) * m_hpixels_per_column - 1; - UINT16 max_visible_y = m_vert_disp_end; + uint16_t max_visible_x = ( m_horiz_disp + 1 ) * m_hpixels_per_column - 1; + uint16_t max_visible_y = m_vert_disp_end; /* determine the syncing positions */ int horiz_sync_char_width = ( m_horiz_retr_end + 1 ) - ( m_horiz_retr_start & 0x1f ); @@ -412,7 +412,7 @@ void crtc_ega_device::device_timer(emu_timer &timer, device_timer_id id, int par case TIMER_HSYNC_ON: { - INT8 hsync_width = ( 0x20 | m_horiz_blank_end ) - ( m_horiz_blank_start & 0x1f ); + int8_t hsync_width = ( 0x20 | m_horiz_blank_end ) - ( m_horiz_blank_start & 0x1f ); if ( hsync_width <= 0 ) { @@ -439,7 +439,7 @@ void crtc_ega_device::device_timer(emu_timer &timer, device_timer_id id, int par } -UINT16 crtc_ega_device::get_ma() +uint16_t crtc_ega_device::get_ma() { update_counters(); @@ -447,7 +447,7 @@ UINT16 crtc_ega_device::get_ma() } -UINT8 crtc_ega_device::get_ra() +uint8_t crtc_ega_device::get_ra() { return m_raster_counter; } @@ -490,7 +490,7 @@ void crtc_ega_device::set_hpixels_per_column(int hpixels_per_column) void crtc_ega_device::update_cursor_state() { /* save and increment cursor counter */ - UINT8 last_cursor_blink_count = m_cursor_blink_count; + uint8_t last_cursor_blink_count = m_cursor_blink_count; m_cursor_blink_count = m_cursor_blink_count + 1; /* switch on cursor blinking mode */ @@ -521,13 +521,13 @@ void crtc_ega_device::update_cursor_state() } -UINT32 crtc_ega_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t crtc_ega_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { assert(bitmap.valid()); if (m_has_valid_parameters) { - UINT16 y; + uint16_t y; assert(!m_row_update_cb.isnull()); @@ -545,7 +545,7 @@ UINT32 crtc_ega_device::screen_update(screen_device &screen, bitmap_ind16 &bitma for (y = cliprect.min_y; y <= cliprect.max_y; y++) { /* compute the current raster line */ - UINT8 ra = y % (m_max_ras_addr + 1); + uint8_t ra = y % (m_max_ras_addr + 1); /* check if the cursor is visible and is on this scanline */ int cursor_visible = m_cursor_state && @@ -555,7 +555,7 @@ UINT32 crtc_ega_device::screen_update(screen_device &screen, bitmap_ind16 &bitma (m_cursor_addr < (m_current_disp_addr + ( m_horiz_disp + 1 ))); /* compute the cursor X position, or -1 if not visible */ - INT8 cursor_x = cursor_visible ? (m_cursor_addr - m_current_disp_addr) : -1; + int8_t cursor_x = cursor_visible ? (m_cursor_addr - m_current_disp_addr) : -1; /* call the external system to draw it */ m_row_update_cb(bitmap, cliprect, m_current_disp_addr, ra, y, m_horiz_disp + 1, cursor_x); diff --git a/src/devices/video/crtc_ega.h b/src/devices/video/crtc_ega.h index 0030d865d76..b5a3dbd7480 100644 --- a/src/devices/video/crtc_ega.h +++ b/src/devices/video/crtc_ega.h @@ -14,16 +14,16 @@ /* callback definitions */ typedef device_delegate crtc_ega_begin_update_delegate; -typedef device_delegate crtc_ega_row_update_delegate; +typedef device_delegate crtc_ega_row_update_delegate; typedef device_delegate crtc_ega_end_update_delegate; #define CRTC_EGA_BEGIN_UPDATE(_name) void _name(bitmap_ind16 &bitmap, const rectangle &cliprect) #define CRTC_EGA_ROW_UPDATE(_name) void _name(bitmap_ind16 &bitmap, \ - const rectangle &cliprect, UINT16 ma, UINT8 ra, \ - UINT16 y, UINT8 x_count, INT8 cursor_x) + const rectangle &cliprect, uint16_t ma, uint8_t ra, \ + uint16_t y, uint8_t x_count, int8_t cursor_x) #define CRTC_EGA_END_UPDATE(_name) void _name(bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -59,7 +59,7 @@ class crtc_ega_device : public device_t, public device_video_interface { public: - crtc_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crtc_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_res_out_de_callback(device_t &device, _Object object) { return downcast(device).m_res_out_de_cb.set_callback(object); } @@ -85,10 +85,10 @@ public: DECLARE_WRITE8_MEMBER( register_w ); /* return the current value on the MA0-MA15 pins */ - UINT16 get_ma(); + uint16_t get_ma(); /* return the current value on the RA0-RA4 pins */ - UINT8 get_ra(); + uint8_t get_ra(); /* simulates the LO->HI clocking of the light pen pin */ void assert_light_pen_input(); @@ -102,7 +102,7 @@ public: /* updates the screen -- this will call begin_update(), */ /* followed by update_row() reapeatedly and after all row */ /* updating is complete, end_update() */ - 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 @@ -132,43 +132,43 @@ private: crtc_ega_end_update_delegate m_end_update_cb; /* ega/vga register file */ - UINT8 m_horiz_char_total; /* 0x00 */ - UINT8 m_horiz_disp; /* 0x01 */ - UINT8 m_horiz_blank_start; /* 0x02 */ - UINT8 m_horiz_blank_end; /* 0x03/0x05 */ - UINT8 m_ena_vert_access; /* 0x03 */ - UINT8 m_de_skew; /* 0x03 */ - UINT8 m_horiz_retr_start; /* 0x04 */ - UINT8 m_horiz_retr_end; /* 0x05 */ - UINT8 m_horiz_retr_skew; /* 0x05 */ - UINT16 m_vert_total; /* 0x06/0x07 */ - UINT8 m_preset_row_scan; /* 0x08 */ - UINT8 m_byte_panning; /* 0x08 */ - UINT8 m_max_ras_addr; /* 0x09 */ - UINT8 m_scan_doubling; /* 0x09 */ - UINT8 m_cursor_start_ras; /* 0x0a */ - UINT8 m_cursor_disable; /* 0x0a */ - UINT8 m_cursor_end_ras; /* 0x0b */ - UINT8 m_cursor_skew; /* 0x0b */ - UINT16 m_disp_start_addr; /* 0x0c/0x0d */ - UINT16 m_cursor_addr; /* 0x0e/0x0f */ - UINT16 m_light_pen_addr; /* 0x10/0x11 */ - UINT16 m_vert_retr_start; /* 0x10/0x07 */ - UINT8 m_vert_retr_end; /* 0x11 */ - UINT8 m_protect; /* 0x11 */ - UINT8 m_bandwidth; /* 0x11 */ - UINT16 m_vert_disp_end; /* 0x12/0x07 */ - UINT8 m_offset; /* 0x13 */ - UINT8 m_underline_loc; /* 0x14 */ - UINT16 m_vert_blank_start; /* 0x15/0x07/0x09 */ - UINT8 m_vert_blank_end; /* 0x16 */ - UINT8 m_mode_control; /* 0x17 */ - UINT16 m_line_compare; /* 0x18/0x07/0x09 */ + uint8_t m_horiz_char_total; /* 0x00 */ + uint8_t m_horiz_disp; /* 0x01 */ + uint8_t m_horiz_blank_start; /* 0x02 */ + uint8_t m_horiz_blank_end; /* 0x03/0x05 */ + uint8_t m_ena_vert_access; /* 0x03 */ + uint8_t m_de_skew; /* 0x03 */ + uint8_t m_horiz_retr_start; /* 0x04 */ + uint8_t m_horiz_retr_end; /* 0x05 */ + uint8_t m_horiz_retr_skew; /* 0x05 */ + uint16_t m_vert_total; /* 0x06/0x07 */ + uint8_t m_preset_row_scan; /* 0x08 */ + uint8_t m_byte_panning; /* 0x08 */ + uint8_t m_max_ras_addr; /* 0x09 */ + uint8_t m_scan_doubling; /* 0x09 */ + uint8_t m_cursor_start_ras; /* 0x0a */ + uint8_t m_cursor_disable; /* 0x0a */ + uint8_t m_cursor_end_ras; /* 0x0b */ + uint8_t m_cursor_skew; /* 0x0b */ + uint16_t m_disp_start_addr; /* 0x0c/0x0d */ + uint16_t m_cursor_addr; /* 0x0e/0x0f */ + uint16_t m_light_pen_addr; /* 0x10/0x11 */ + uint16_t m_vert_retr_start; /* 0x10/0x07 */ + uint8_t m_vert_retr_end; /* 0x11 */ + uint8_t m_protect; /* 0x11 */ + uint8_t m_bandwidth; /* 0x11 */ + uint16_t m_vert_disp_end; /* 0x12/0x07 */ + uint8_t m_offset; /* 0x13 */ + uint8_t m_underline_loc; /* 0x14 */ + uint16_t m_vert_blank_start; /* 0x15/0x07/0x09 */ + uint8_t m_vert_blank_end; /* 0x16 */ + uint8_t m_mode_control; /* 0x17 */ + uint16_t m_line_compare; /* 0x18/0x07/0x09 */ /* other internal state */ - UINT8 m_register_address_latch; + uint8_t m_register_address_latch; bool m_cursor_state; /* 0 = off, 1 = on */ - UINT8 m_cursor_blink_count; + uint8_t m_cursor_blink_count; int m_hpixels_per_column; /* number of pixels per video memory address */ /* output signals */ @@ -179,16 +179,16 @@ private: int m_de; /* internal counters */ - UINT8 m_character_counter; - UINT8 m_hsync_width_counter; - UINT16 m_line_counter; - UINT8 m_raster_counter; - UINT8 m_vsync_width_counter; + uint8_t m_character_counter; + uint8_t m_hsync_width_counter; + uint16_t m_line_counter; + uint8_t m_raster_counter; + uint8_t m_vsync_width_counter; bool m_line_enable_ff; /* Internal flip flop which is set when the line_counter is reset and reset when vert_disp is reached */ - UINT8 m_vsync_ff; - UINT8 m_adjust_active; - UINT16 m_line_address; - INT16 m_cursor_x; + uint8_t m_vsync_ff; + uint8_t m_adjust_active; + uint16_t m_line_address; + int16_t m_cursor_x; /* timers */ static const device_timer_id TIMER_LINE = 0; @@ -208,16 +208,16 @@ private: emu_timer *m_light_pen_latch_timer; /* computed values - do NOT state save these! */ - UINT16 m_horiz_pix_total; - UINT16 m_vert_pix_total; - UINT16 m_max_visible_x; - UINT16 m_max_visible_y; - UINT16 m_hsync_on_pos; - UINT16 m_hsync_off_pos; - UINT16 m_vsync_on_pos; - UINT16 m_vsync_off_pos; - UINT16 m_current_disp_addr; /* the display address currently drawn */ - UINT8 m_light_pen_latched; + uint16_t m_horiz_pix_total; + uint16_t m_vert_pix_total; + uint16_t m_max_visible_x; + uint16_t m_max_visible_y; + uint16_t m_hsync_on_pos; + uint16_t m_hsync_off_pos; + uint16_t m_vsync_on_pos; + uint16_t m_vsync_off_pos; + uint16_t m_current_disp_addr; /* the display address currently drawn */ + uint8_t m_light_pen_latched; bool m_has_valid_parameters; void recompute_parameters(bool postload); diff --git a/src/devices/video/dl1416.cpp b/src/devices/video/dl1416.cpp index b017e9994e1..63ec3300a22 100644 --- a/src/devices/video/dl1416.cpp +++ b/src/devices/video/dl1416.cpp @@ -56,7 +56,7 @@ #define CURSOR_OFF (0) /* character set DL1416T */ -static const UINT16 dl1416t_segments[128] = { +static const uint16_t dl1416t_segments[128] = { SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */ SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */ SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, SEG_UNDEF, /* undefined */ @@ -96,7 +96,7 @@ static const UINT16 dl1416t_segments[128] = { DEVICE INTERFACE *****************************************************************************/ -dl1416_device::dl1416_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) +dl1416_device::dl1416_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_write_enable(FALSE), m_chip_enable(FALSE), @@ -132,7 +132,7 @@ void dl1416_device::device_start() void dl1416_device::device_reset() { int i; - UINT16 pattern; + uint16_t pattern; /* disable all lines */ m_chip_enable = FALSE; m_write_enable = FALSE; @@ -165,7 +165,7 @@ void dl1416_device::device_reset() const device_type DL1416B = &device_creator; -dl1416b_device::dl1416b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dl1416b_device::dl1416b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dl1416_device(mconfig, DL1416B, "DL1416B", tag, owner, clock, "dl1416b", __FILE__) { } @@ -173,7 +173,7 @@ dl1416b_device::dl1416b_device(const machine_config &mconfig, const char *tag, d const device_type DL1416T = &device_creator; -dl1416t_device::dl1416t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dl1416t_device::dl1416t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dl1416_device(mconfig, DL1416T, "DL1416T", tag, owner, clock, "dl1416t", __FILE__) { } diff --git a/src/devices/video/dl1416.h b/src/devices/video/dl1416.h index e3526bd95be..5eb084bfddb 100644 --- a/src/devices/video/dl1416.h +++ b/src/devices/video/dl1416.h @@ -31,7 +31,7 @@ class dl1416_device : public device_t { public: - dl1416_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); + dl1416_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); ~dl1416_device() {} template static devcb_base &set_update_handler(device_t &device, _Object object) { return downcast(device).m_update.set_callback(object); } @@ -54,14 +54,14 @@ private: int m_cursor_enable; devcb_write16 m_update; - UINT16 m_digit_ram[4]; // holds the digit code for each position - UINT8 m_cursor_state[4]; // holds the cursor state for each position, 0=off, 1=on + uint16_t m_digit_ram[4]; // holds the digit code for each position + uint8_t m_cursor_state[4]; // holds the cursor state for each position, 0=off, 1=on }; class dl1416b_device : public dl1416_device { public: - dl1416b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dl1416b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type DL1416B; @@ -69,7 +69,7 @@ extern const device_type DL1416B; class dl1416t_device : public dl1416_device { public: - dl1416t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dl1416t_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type DL1416T; diff --git a/src/devices/video/dm9368.cpp b/src/devices/video/dm9368.cpp index 16dee4e420f..2b6502782bd 100644 --- a/src/devices/video/dm9368.cpp +++ b/src/devices/video/dm9368.cpp @@ -25,7 +25,7 @@ const device_type DM9368 = &device_creator; #define LOG 0 -const UINT8 dm9368_device::m_segment_data[16] = +const uint8_t dm9368_device::m_segment_data[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x67, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 }; @@ -40,7 +40,7 @@ const UINT8 dm9368_device::m_segment_data[16] = // dm9368_device - constructor //------------------------------------------------- -dm9368_device::dm9368_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dm9368_device::dm9368_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DM9368, "DM9368 7-Segment Decoder", tag, owner, clock, "dm9368", __FILE__), device_output_interface(mconfig, *this), m_write_rbo(*this), @@ -69,10 +69,10 @@ void dm9368_device::device_start() // a_w - //------------------------------------------------- -void dm9368_device::a_w(UINT8 data) +void dm9368_device::a_w(uint8_t data) { int a = data & 0x0f; - UINT8 value = 0; + uint8_t value = 0; if (!m_rbi && !a) { diff --git a/src/devices/video/dm9368.h b/src/devices/video/dm9368.h index 23f34de94ad..35364054124 100644 --- a/src/devices/video/dm9368.h +++ b/src/devices/video/dm9368.h @@ -46,9 +46,9 @@ class dm9368_device : public device_t, { public: // construction/destruction - dm9368_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dm9368_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void a_w(UINT8 data); + void a_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER( rbi_w ) { m_rbi = state; } DECLARE_READ_LINE_MEMBER( rbo_r ) { return m_rbo; } @@ -63,7 +63,7 @@ private: int m_rbi; int m_rbo; - static const UINT8 m_segment_data[]; + static const uint8_t m_segment_data[]; }; diff --git a/src/devices/video/ef9340_1.cpp b/src/devices/video/ef9340_1.cpp index 39654a32ba9..204646654e4 100644 --- a/src/devices/video/ef9340_1.cpp +++ b/src/devices/video/ef9340_1.cpp @@ -17,13 +17,13 @@ const device_type EF9340_1 = &device_creator; -static const UINT8 bgr2rgb[8] = +static const uint8_t bgr2rgb[8] = { 0x00, 0x04, 0x02, 0x06, 0x01, 0x05, 0x03, 0x07 }; -ef9340_1_device::ef9340_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ef9340_1_device::ef9340_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EF9340_1, "EF9340+EF9341", tag, owner, clock, "ef9340_1", __FILE__) , device_video_interface(mconfig, *this), m_line_timer(nullptr) //, m_start_vpos(START_Y) @@ -84,7 +84,7 @@ void ef9340_1_device::device_timer(emu_timer &timer, device_timer_id id, int par } -UINT16 ef9340_1_device::ef9340_get_c_addr(UINT8 x, UINT8 y) +uint16_t ef9340_1_device::ef9340_get_c_addr(uint8_t x, uint8_t y) { if ( ( y & 0x18 ) == 0x18 ) { @@ -113,9 +113,9 @@ void ef9340_1_device::ef9340_inc_c() } -UINT16 ef9340_1_device::external_chargen_address(UINT8 b, UINT8 slice) +uint16_t ef9340_1_device::external_chargen_address(uint8_t b, uint8_t slice) { - UINT8 cc = b & 0x7f; + uint8_t cc = b & 0x7f; if ( slice & 8 ) { @@ -127,7 +127,7 @@ UINT16 ef9340_1_device::external_chargen_address(UINT8 b, UINT8 slice) } -void ef9340_1_device::ef9341_write( UINT8 command, UINT8 b, UINT8 data ) +void ef9340_1_device::ef9341_write( uint8_t command, uint8_t b, uint8_t data ) { logerror("ef9341 %s write, t%s, data %02X\n", command ? "command" : "data", b ? "B" : "A", data ); @@ -174,7 +174,7 @@ void ef9340_1_device::ef9341_write( UINT8 command, UINT8 b, UINT8 data ) { if ( b ) { - UINT16 addr = ef9340_get_c_addr( m_ef9340.X, m_ef9340.Y ) & 0x3ff; + uint16_t addr = ef9340_get_c_addr( m_ef9340.X, m_ef9340.Y ) & 0x3ff; m_ef9341.TB = data; m_ef9341.busy = 0x80; @@ -204,9 +204,9 @@ void ef9340_1_device::ef9341_write( UINT8 command, UINT8 b, UINT8 data ) case 0x80: /* Write slice */ { - UINT8 a = m_ef934x_ram_a[addr]; - UINT8 b = m_ef934x_ram_b[addr]; - UINT8 slice = ( m_ef9340.M & 0x0f ) % 10; + uint8_t a = m_ef934x_ram_a[addr]; + uint8_t b = m_ef934x_ram_b[addr]; + uint8_t slice = ( m_ef9340.M & 0x0f ) % 10; if ( b >= 0xa0 ) { @@ -232,9 +232,9 @@ void ef9340_1_device::ef9341_write( UINT8 command, UINT8 b, UINT8 data ) } -UINT8 ef9340_1_device::ef9341_read( UINT8 command, UINT8 b ) +uint8_t ef9340_1_device::ef9341_read( uint8_t command, uint8_t b ) { - UINT8 data; + uint8_t data; logerror("ef9341 %s read, t%s\n", command ? "command" : "data", b ? "B" : "A" ); if ( command ) @@ -301,12 +301,12 @@ void ef9340_1_device::ef9340_scanline(int vpos) for ( int x = 0; x < 40; x++ ) { - UINT16 addr = ef9340_get_c_addr( x, y_row ); - UINT8 a = m_ef934x_ram_a[addr]; - UINT8 b = m_ef934x_ram_b[addr]; - UINT8 fg = 0; - UINT8 bg = 0; - UINT8 char_data = 0x00; + uint16_t addr = ef9340_get_c_addr( x, y_row ); + uint8_t a = m_ef934x_ram_a[addr]; + uint8_t b = m_ef934x_ram_b[addr]; + uint8_t fg = 0; + uint8_t bg = 0; + uint8_t char_data = 0x00; if ( a & 0x80 ) { diff --git a/src/devices/video/ef9340_1.h b/src/devices/video/ef9340_1.h index d92cbb5cf54..9e0a4dc69b3 100644 --- a/src/devices/video/ef9340_1.h +++ b/src/devices/video/ef9340_1.h @@ -26,12 +26,12 @@ class ef9340_1_device : public device_t, { public: // construction/destruction - ef9340_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ef9340_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); inline bitmap_ind16 *get_bitmap() { return &m_tmp_bitmap; } - void ef9341_write( UINT8 command, UINT8 b, UINT8 data ); - UINT8 ef9341_read( UINT8 command, UINT8 b ); + void ef9341_write( uint8_t command, uint8_t b, uint8_t data ); + uint8_t ef9341_read( uint8_t command, uint8_t b ); protected: // device-level overrides @@ -39,11 +39,11 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - inline UINT16 ef9340_get_c_addr(UINT8 x, UINT8 y); + inline uint16_t ef9340_get_c_addr(uint8_t x, uint8_t y); inline void ef9340_inc_c(); // Calculate the external chargen address for a character and slice - inline UINT16 external_chargen_address(UINT8 b, UINT8 slice); + inline uint16_t external_chargen_address(uint8_t b, uint8_t slice); void ef9340_scanline(int vpos); @@ -56,22 +56,22 @@ protected: struct { - UINT8 TA; - UINT8 TB; - UINT8 busy; + uint8_t TA; + uint8_t TB; + uint8_t busy; } m_ef9341; struct { - UINT8 X; - UINT8 Y; - UINT8 Y0; - UINT8 R; - UINT8 M; + uint8_t X; + uint8_t Y; + uint8_t Y0; + uint8_t R; + uint8_t M; int max_vpos; } m_ef9340; - UINT8 m_ef934x_ram_a[1024]; - UINT8 m_ef934x_ram_b[1024]; - UINT8 m_ef934x_ext_char_ram[2048]; /* The G7400 has 2KB of external ram hooked up. The datasheet only describes how to hookup 1KB. */ + uint8_t m_ef934x_ram_a[1024]; + uint8_t m_ef934x_ram_b[1024]; + uint8_t m_ef934x_ext_char_ram[2048]; /* The G7400 has 2KB of external ram hooked up. The datasheet only describes how to hookup 1KB. */ }; diff --git a/src/devices/video/ef9341_chargen.h b/src/devices/video/ef9341_chargen.h index d33db19d18e..b9ae0a5992d 100644 --- a/src/devices/video/ef9341_chargen.h +++ b/src/devices/video/ef9341_chargen.h @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol -static const UINT8 ef9341_char_set[2][128][10] = { +static const uint8_t ef9341_char_set[2][128][10] = { // Alphanumeric character set (128 characters) { { 0x00,0x38,0x44,0x40,0x20,0x10,0x00,0x10,0x00,0x00 }, diff --git a/src/devices/video/ef9345.cpp b/src/devices/video/ef9345.cpp index 1ff335946ae..c8ff12252dd 100644 --- a/src/devices/video/ef9345.cpp +++ b/src/devices/video/ef9345.cpp @@ -47,29 +47,29 @@ const address_space_config *ef9345_device::memory_space_config(address_spacenum //************************************************************************** // calculate the internal RAM offset -inline UINT16 ef9345_device::indexram(UINT8 r) +inline uint16_t ef9345_device::indexram(uint8_t r) { - UINT8 x = m_registers[r]; - UINT8 y = m_registers[r - 1]; + uint8_t x = m_registers[r]; + uint8_t y = m_registers[r - 1]; if (y < 8) y &= 1; return ((x&0x3f) | ((x & 0x40) << 6) | ((x & 0x80) << 4) | ((y & 0x1f) << 6) | ((y & 0x20) << 8)); } // calculate the internal ROM offset -inline UINT16 ef9345_device::indexrom(UINT8 r) +inline uint16_t ef9345_device::indexrom(uint8_t r) { - UINT8 x = m_registers[r]; - UINT8 y = m_registers[r - 1]; + uint8_t x = m_registers[r]; + uint8_t y = m_registers[r - 1]; if (y < 8) y &= 1; return((x&0x3f)|((x&0x40)<<6)|((x&0x80)<<4)|((y&0x1f)<<6)); } // increment x -inline void ef9345_device::inc_x(UINT8 r) +inline void ef9345_device::inc_x(uint8_t r) { - UINT8 i = (m_registers[r] & 0x3f) + 1; + uint8_t i = (m_registers[r] & 0x3f) + 1; if (i > 39) { i -= 40; @@ -79,9 +79,9 @@ inline void ef9345_device::inc_x(UINT8 r) } // increment y -inline void ef9345_device::inc_y(UINT8 r) +inline void ef9345_device::inc_y(uint8_t r) { - UINT8 i = (m_registers[r] & 0x1f) + 1; + uint8_t i = (m_registers[r] & 0x1f) + 1; if (i > 31) i -= 24; m_registers[r] = (m_registers[r] & 0xe0) | i; @@ -96,7 +96,7 @@ inline void ef9345_device::inc_y(UINT8 r) // ef9345_device - constructor //------------------------------------------------- -ef9345_device::ef9345_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ef9345_device::ef9345_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EF9345, "EF9345", tag, owner, clock, "ef9345", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -207,7 +207,7 @@ void ef9345_device::set_busy_flag(int period) } // draw a char in 40 char line mode -void ef9345_device::draw_char_40(UINT8 *c, UINT16 x, UINT16 y) +void ef9345_device::draw_char_40(uint8_t *c, uint16_t x, uint16_t y) { //verify size limit if (y * 10 >= m_screen->height() || x * 8 >= m_screen->width()) @@ -220,7 +220,7 @@ void ef9345_device::draw_char_40(UINT8 *c, UINT16 x, UINT16 y) } // draw a char in 80 char line mode -void ef9345_device::draw_char_80(UINT8 *c, UINT16 x, UINT16 y) +void ef9345_device::draw_char_80(uint8_t *c, uint16_t x, uint16_t y) { // verify size limit if (y * 10 >= m_screen->height() || x * 6 >= m_screen->width()) @@ -237,7 +237,7 @@ void ef9345_device::draw_char_80(UINT8 *c, UINT16 x, UINT16 y) void ef9345_device::set_video_mode(void) { m_char_mode = ((m_pat & 0x80) >> 5) | ((m_tgs & 0xc0) >> 6); - UINT16 new_width = (m_char_mode == MODE12x80 || m_char_mode == MODE8x80) ? 492 : 336; + uint16_t new_width = (m_char_mode == MODE12x80 || m_char_mode == MODE8x80) ? 492 : 336; if (m_screen->width() != new_width) { @@ -263,7 +263,7 @@ void ef9345_device::set_video_mode(void) // initialize the ef9345 accented chars void ef9345_device::init_accented_chars(void) { - UINT16 i, j; + uint16_t i, j; for(j = 0; j < 0x10; j++) for(i = 0; i < 0x200; i++) m_acc_char[(j << 9) + i] = m_charset[0x0600 + i]; @@ -296,7 +296,7 @@ void ef9345_device::init_accented_chars(void) } // read a char in charset or in m_videoram -UINT8 ef9345_device::read_char(UINT8 index, UINT16 addr) +uint8_t ef9345_device::read_char(uint8_t index, uint16_t addr) { if (index < 0x04) return m_charset[0x0800*index + addr]; @@ -309,7 +309,7 @@ UINT8 ef9345_device::read_char(UINT8 index, UINT16 addr) } // calculate the dial position of the char -UINT8 ef9345_device::get_dial(UINT8 x, UINT8 attrib) +uint8_t ef9345_device::get_dial(uint8_t x, uint8_t attrib) { if (x > 0 && m_last_dial[x-1] == 1) //top right m_last_dial[x] = 2; @@ -334,9 +334,9 @@ UINT8 ef9345_device::get_dial(UINT8 x, UINT8 attrib) } // zoom the char -void ef9345_device::zoom(UINT8 *pix, UINT16 n) +void ef9345_device::zoom(uint8_t *pix, uint16_t n) { - UINT8 i, j; + uint8_t i, j; if ((n & 0x0a) == 0) for(i = 0; i < 80; i += 8) // 1, 4, 5 for(j = 7; j > 0; j--) @@ -360,9 +360,9 @@ void ef9345_device::zoom(UINT8 *pix, UINT16 n) // calculate the address of the char x,y -UINT16 ef9345_device::indexblock(UINT16 x, UINT16 y) +uint16_t ef9345_device::indexblock(uint16_t x, uint16_t y) { - UINT16 i = x, j; + uint16_t i = x, j; j = (y == 0) ? ((m_tgs & 0x20) >> 5) : ((m_ror & 0x1f) + y - 1); //right side of a double width character @@ -377,10 +377,10 @@ UINT16 ef9345_device::indexblock(UINT16 x, UINT16 y) } // draw bichrome character (40 columns) -void ef9345_device::bichrome40(UINT8 type, UINT16 address, UINT8 dial, UINT16 iblock, UINT16 x, UINT16 y, UINT8 c0, UINT8 c1, UINT8 insert, UINT8 flash, UINT8 hided, UINT8 negative, UINT8 underline) +void ef9345_device::bichrome40(uint8_t type, uint16_t address, uint8_t dial, uint16_t iblock, uint16_t x, uint16_t y, uint8_t c0, uint8_t c1, uint8_t insert, uint8_t flash, uint8_t hided, uint8_t negative, uint8_t underline) { - UINT16 i; - UINT8 pix[80]; + uint16_t i; + uint8_t pix[80]; if (flash && m_pat & 0x40 && m_blink) c1 = c0; //flash @@ -435,9 +435,9 @@ void ef9345_device::bichrome40(UINT8 type, UINT16 address, UINT8 dial, UINT16 ib // generate the pixel table for(i = 0; i < 40; i+=4) { - UINT8 ch = read_char(type, address + i); + uint8_t ch = read_char(type, address + i); - for (UINT8 b=0; b<8; b++) + for (uint8_t b=0; b<8; b++) pix[i*2 + b] = (ch & (1<> 1, ramx, ramy, ramblock; - UINT16 ramindex; + uint8_t i, j, n, col[8], pix[80]; + uint8_t lowresolution = (b & 0x02) >> 1, ramx, ramy, ramblock; + uint16_t ramindex; //quadrichrome don't suppor double size m_last_dial[x] = 0; @@ -494,7 +494,7 @@ void ef9345_device::quadrichrome40(UINT8 c, UINT8 b, UINT8 a, UINT16 x, UINT16 y //fill pixel table for(i = 0, j = 0; i < 10; i++) { - UINT8 ch = read_char(0x0c, ramindex + 4 * (i >> lowresolution)); + uint8_t ch = read_char(0x0c, ramindex + 4 * (i >> lowresolution)); pix[j] = pix[j + 1] = col[(ch & 0x03) >> 0]; j += 2; pix[j] = pix[j + 1] = col[(ch & 0x0c) >> 2]; j += 2; pix[j] = pix[j + 1] = col[(ch & 0x30) >> 4]; j += 2; @@ -505,10 +505,10 @@ void ef9345_device::quadrichrome40(UINT8 c, UINT8 b, UINT8 a, UINT16 x, UINT16 y } // draw bichrome character (80 columns) -void ef9345_device::bichrome80(UINT8 c, UINT8 a, UINT16 x, UINT16 y) +void ef9345_device::bichrome80(uint8_t c, uint8_t a, uint16_t x, uint16_t y) { - UINT8 c0, c1, pix[60]; - UINT16 i, j, d; + uint8_t c0, c1, pix[60]; + uint16_t i, j, d; c1 = (a & 1) ? (m_dor >> 4) & 7 : m_dor & 7; //foreground color = DOR c0 = m_mat & 7; //background color = MAT @@ -535,8 +535,8 @@ void ef9345_device::bichrome80(UINT8 c, UINT8 a, UINT16 x, UINT16 y) for(i=0, j=0; i < 10; i++) { - UINT8 ch = read_char(0, d + 4 * i); - for (UINT8 b=0; b<6; b++) + uint8_t ch = read_char(0, d + 4 * i); + for (uint8_t b=0; b<6; b++) pix[j++] = (ch & (1< 1) ? indexblock(x, y / 2) : indexblock(x, y); a = m_videoram->read_byte(m_block + iblock); @@ -625,10 +625,10 @@ void ef9345_device::makechar_16x40(UINT16 x, UINT16 y) } // generate 24 bits 40 columns char -void ef9345_device::makechar_24x40(UINT16 x, UINT16 y) +void ef9345_device::makechar_24x40(uint16_t x, uint16_t y) { - UINT8 a, b, c, c0, c1, i, f, m, n, u, type, dial; - UINT16 address, iblock; + uint8_t a, b, c, c0, c1, i, f, m, n, u, type, dial; + uint16_t address, iblock; iblock = (m_mat & 0x80 && y > 1) ? indexblock(x, y / 2) : indexblock(x, y); c = m_videoram->read_byte(m_block + iblock); @@ -660,14 +660,14 @@ void ef9345_device::makechar_24x40(UINT16 x, UINT16 y) } // generate 12 bits 80 columns char -void ef9345_device::makechar_12x80(UINT16 x, UINT16 y) +void ef9345_device::makechar_12x80(uint16_t x, uint16_t y) { - UINT16 iblock = indexblock(x, y); + uint16_t iblock = indexblock(x, y); bichrome80(m_videoram->read_byte(m_block + iblock), (m_videoram->read_byte(m_block + iblock + 0x1000) >> 4) & 0x0f, 2 * x + 1, y + 1); bichrome80(m_videoram->read_byte(m_block + iblock + 0x0800), m_videoram->read_byte(m_block + iblock + 0x1000) & 0x0f, 2 * x + 2, y + 1); } -void ef9345_device::draw_border(UINT16 line) +void ef9345_device::draw_border(uint16_t line) { if (m_char_mode == MODE12x80 || m_char_mode == MODE8x80) for(int i = 0; i < 82; i++) @@ -677,7 +677,7 @@ void ef9345_device::draw_border(UINT16 line) draw_char_40(m_border, i, line); } -void ef9345_device::makechar(UINT16 x, UINT16 y) +void ef9345_device::makechar(uint16_t x, uint16_t y) { switch (m_char_mode) { @@ -701,13 +701,13 @@ void ef9345_device::makechar(UINT16 x, UINT16 y) } // Execute EF9345 command -void ef9345_device::ef9345_exec(UINT8 cmd) +void ef9345_device::ef9345_exec(uint8_t cmd) { m_state = 0; if ((m_registers[5] & 0x3f) == 39) m_state |= 0x10; //S4(LXa) set if ((m_registers[7] & 0x3f) == 39) m_state |= 0x20; //S5(LXm) set - UINT16 a = indexram(7); + uint16_t a = indexram(7); switch(cmd) { @@ -782,21 +782,21 @@ void ef9345_device::ef9345_exec(UINT8 cmd) if (cmd&1) inc_x(5); break; - case 0x50: //KRL: 80 UINT8 - 12 bits write - case 0x51: //KRL: 80 UINT8 - 12 bits write + inc + case 0x50: //KRL: 80 uint8_t - 12 bits write + case 0x51: //KRL: 80 uint8_t - 12 bits write + inc set_busy_flag(12.5); m_videoram->write_byte(a, m_registers[1]); switch((a / 0x0800) & 1) { case 0: { - UINT8 tmp_data = m_videoram->read_byte(a + 0x1000); + uint8_t tmp_data = m_videoram->read_byte(a + 0x1000); m_videoram->write_byte(a + 0x1000, (tmp_data & 0x0f) | (m_registers[3] & 0xf0)); break; } case 1: { - UINT8 tmp_data = m_videoram->read_byte(a + 0x0800); + uint8_t tmp_data = m_videoram->read_byte(a + 0x0800); m_videoram->write_byte(a + 0x0800, (tmp_data & 0xf0) | (m_registers[3] & 0x0f)); break; } @@ -808,8 +808,8 @@ void ef9345_device::ef9345_exec(UINT8 cmd) inc_x(7); } break; - case 0x58: //KRL: 80 UINT8 - 12 bits read - case 0x59: //KRL: 80 UINT8 - 12 bits read + inc + case 0x58: //KRL: 80 uint8_t - 12 bits read + case 0x59: //KRL: 80 uint8_t - 12 bits read + inc set_busy_flag(11.5); m_registers[1] = m_videoram->read_byte(a); switch((a / 0x0800) & 1) @@ -892,10 +892,10 @@ void ef9345_device::ef9345_exec(UINT8 cmd) case 0xf9: //MVT: move triple buffer AP->MP stop case 0xfa: //MVT: move triple buffer AP->MP nostop { - UINT16 i, a1, a2; - UINT8 n = (cmd>>4) - 0x0c; - UINT8 r1 = (cmd&0x04) ? 7 : 5; - UINT8 r2 = (cmd&0x04) ? 5 : 7; + uint16_t i, a1, a2; + uint8_t n = (cmd>>4) - 0x0c; + uint8_t r1 = (cmd&0x04) ? 7 : 5; + uint8_t r2 = (cmd&0x04) ? 5 : 7; int busy = 2; for(i = 0; i < 1280; i++) @@ -941,15 +941,15 @@ void ef9345_device::ef9345_exec(UINT8 cmd) EF9345 interface **************************************************************/ -UINT32 ef9345_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t ef9345_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_screen_out, 0, 0, 0, 0, cliprect); return 0; } -void ef9345_device::update_scanline(UINT16 scanline) +void ef9345_device::update_scanline(uint16_t scanline) { - UINT16 i; + uint16_t i; if (scanline == 250) m_state &= 0xfb; diff --git a/src/devices/video/ef9345.h b/src/devices/video/ef9345.h index c6790b00a39..86d05e115c6 100644 --- a/src/devices/video/ef9345.h +++ b/src/devices/video/ef9345.h @@ -30,7 +30,7 @@ class ef9345_device : public device_t, { public: // construction/destruction - ef9345_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ef9345_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration static void static_set_palette_tag(device_t &device, const char *tag); @@ -38,8 +38,8 @@ public: // device interface DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( data_w ); - void update_scanline(UINT16 scanline); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void update_scanline(uint16_t scanline); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -54,54 +54,54 @@ protected: const address_space_config m_space_config; // inline helper - inline UINT16 indexram(UINT8 r); - inline UINT16 indexrom(UINT8 r); - inline void inc_x(UINT8 r); - inline void inc_y(UINT8 r); + inline uint16_t indexram(uint8_t r); + inline uint16_t indexrom(uint8_t r); + inline void inc_x(uint8_t r); + inline void inc_y(uint8_t r); private: void set_busy_flag(int period); - void draw_char_40(UINT8 *c, UINT16 x, UINT16 y); - void draw_char_80(UINT8 *c, UINT16 x, UINT16 y); + void draw_char_40(uint8_t *c, uint16_t x, uint16_t y); + void draw_char_80(uint8_t *c, uint16_t x, uint16_t y); void set_video_mode(void); void init_accented_chars(void); - UINT8 read_char(UINT8 index, UINT16 addr); - UINT8 get_dial(UINT8 x, UINT8 attrib); - void zoom(UINT8 *pix, UINT16 n); - UINT16 indexblock(UINT16 x, UINT16 y); - void bichrome40(UINT8 type, UINT16 address, UINT8 dial, UINT16 iblock, UINT16 x, UINT16 y, UINT8 c0, UINT8 c1, UINT8 insert, UINT8 flash, UINT8 hided, UINT8 negative, UINT8 underline); - void quadrichrome40(UINT8 c, UINT8 b, UINT8 a, UINT16 x, UINT16 y); - void bichrome80(UINT8 c, UINT8 a, UINT16 x, UINT16 y); - void makechar(UINT16 x, UINT16 y); - void draw_border(UINT16 line); - void makechar_16x40(UINT16 x, UINT16 y); - void makechar_24x40(UINT16 x, UINT16 y); - void makechar_12x80(UINT16 x, UINT16 y); - void ef9345_exec(UINT8 cmd); + uint8_t read_char(uint8_t index, uint16_t addr); + uint8_t get_dial(uint8_t x, uint8_t attrib); + void zoom(uint8_t *pix, uint16_t n); + uint16_t indexblock(uint16_t x, uint16_t y); + void bichrome40(uint8_t type, uint16_t address, uint8_t dial, uint16_t iblock, uint16_t x, uint16_t y, uint8_t c0, uint8_t c1, uint8_t insert, uint8_t flash, uint8_t hided, uint8_t negative, uint8_t underline); + void quadrichrome40(uint8_t c, uint8_t b, uint8_t a, uint16_t x, uint16_t y); + void bichrome80(uint8_t c, uint8_t a, uint16_t x, uint16_t y); + void makechar(uint16_t x, uint16_t y); + void draw_border(uint16_t line); + void makechar_16x40(uint16_t x, uint16_t y); + void makechar_24x40(uint16_t x, uint16_t y); + void makechar_12x80(uint16_t x, uint16_t y); + void ef9345_exec(uint8_t cmd); // internal state static const device_timer_id BUSY_TIMER = 0; static const device_timer_id BLINKING_TIMER = 1; - required_region_ptr m_charset; + required_region_ptr m_charset; address_space *m_videoram; - UINT8 m_bf; //busy flag - UINT8 m_char_mode; //40 or 80 chars for line - UINT8 m_acc_char[0x2000]; //accented chars - UINT8 m_registers[8]; //registers R0-R7 - UINT8 m_state; //status register - UINT8 m_tgs,m_mat,m_pat,m_dor,m_ror; //indirect registers - UINT8 m_border[80]; //border color - UINT16 m_block; //current memory block - UINT16 m_ram_base[4]; //index of ram charset - UINT8 m_blink; //cursor status - UINT8 m_last_dial[40]; //last chars dial (for determinate the zoom position) - UINT8 m_latchc0; //background color latch - UINT8 m_latchm; //hided atribute latch - UINT8 m_latchi; //insert atribute latch - UINT8 m_latchu; //underline atribute latch + uint8_t m_bf; //busy flag + uint8_t m_char_mode; //40 or 80 chars for line + uint8_t m_acc_char[0x2000]; //accented chars + uint8_t m_registers[8]; //registers R0-R7 + uint8_t m_state; //status register + uint8_t m_tgs,m_mat,m_pat,m_dor,m_ror; //indirect registers + uint8_t m_border[80]; //border color + uint16_t m_block; //current memory block + uint16_t m_ram_base[4]; //index of ram charset + uint8_t m_blink; //cursor status + uint8_t m_last_dial[40]; //last chars dial (for determinate the zoom position) + uint8_t m_latchc0; //background color latch + uint8_t m_latchm; //hided atribute latch + uint8_t m_latchi; //insert atribute latch + uint8_t m_latchu; //underline atribute latch bitmap_rgb32 m_screen_out; diff --git a/src/devices/video/ef9364.cpp b/src/devices/video/ef9364.cpp index aae29e5d6e3..a228bb2cbec 100644 --- a/src/devices/video/ef9364.cpp +++ b/src/devices/video/ef9364.cpp @@ -56,7 +56,7 @@ const address_space_config *ef9364_device::memory_space_config(address_spacenum // ef9364_device - constructor //------------------------------------------------- -ef9364_device::ef9364_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ef9364_device::ef9364_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EF9364, "EF9364", tag, owner, clock, "ef9364", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -94,7 +94,7 @@ void ef9364_device::static_set_nb_of_pages(device_t &device, int nb_of_pages ) // into the palette //------------------------------------------------- -void ef9364_device::set_color_entry( int index, UINT8 r, UINT8 g, UINT8 b ) +void ef9364_device::set_color_entry( int index, uint8_t r, uint8_t g, uint8_t b ) { if( index < 2 ) { @@ -164,7 +164,7 @@ void ef9364_device::device_reset() void ef9364_device::set_video_mode(void) { - UINT16 new_width = bitplane_xres; + uint16_t new_width = bitplane_xres; if (m_screen->width() != new_width) { @@ -183,7 +183,7 @@ void ef9364_device::set_video_mode(void) // ( No border for the moment ;) ) //------------------------------------------------- -void ef9364_device::draw_border(UINT16 line) +void ef9364_device::draw_border(uint16_t line) { } @@ -191,7 +191,7 @@ void ef9364_device::draw_border(UINT16 line) // screen_update: Framebuffer video ouput //------------------------------------------------- -UINT32 ef9364_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t ef9364_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,r; unsigned char c; @@ -234,7 +234,7 @@ UINT32 ef9364_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, // update_scanline: Scanline callback //------------------------------------------------- -void ef9364_device::update_scanline(UINT16 scanline) +void ef9364_device::update_scanline(uint16_t scanline) { if (scanline == vsync_scanline_pos) { @@ -251,7 +251,7 @@ void ef9364_device::update_scanline(UINT16 scanline) // data_w: Registers write access callback //------------------------------------------------- -void ef9364_device::command_w(UINT8 cmd) +void ef9364_device::command_w(uint8_t cmd) { int x,y,i,j; @@ -353,7 +353,7 @@ void ef9364_device::command_w(UINT8 cmd) } } -void ef9364_device::char_latch_w(UINT8 data) +void ef9364_device::char_latch_w(uint8_t data) { char_latch = data; } diff --git a/src/devices/video/ef9364.h b/src/devices/video/ef9364.h index b9ea73395e5..2adc99905ee 100644 --- a/src/devices/video/ef9364.h +++ b/src/devices/video/ef9364.h @@ -40,7 +40,7 @@ class ef9364_device : public device_t, { public: // construction/destruction - ef9364_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ef9364_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration static void static_set_palette_tag(device_t &device, const char *tag); @@ -48,12 +48,12 @@ public: // device interface - void update_scanline(UINT16 scanline); - void set_color_entry( int index, UINT8 r, UINT8 g, UINT8 b ); + void update_scanline(uint16_t scanline); + void set_color_entry( int index, uint8_t r, uint8_t g, uint8_t b ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void char_latch_w(UINT8 data); - void command_w(UINT8 cmd); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void char_latch_w(uint8_t data); + void command_w(uint8_t cmd); protected: // device-level overrides @@ -70,18 +70,18 @@ protected: private: void set_video_mode(void); - void draw_border(UINT16 line); + void draw_border(uint16_t line); // internal state - required_region_ptr m_charset; + required_region_ptr m_charset; address_space *m_textram; - UINT8 x_curs_pos; - UINT8 y_curs_pos; - UINT8 char_latch; + uint8_t x_curs_pos; + uint8_t y_curs_pos; + uint8_t char_latch; - UINT8 m_border[80]; //border color + uint8_t m_border[80]; //border color rgb_t palette[2]; int nb_of_pages; @@ -91,7 +91,7 @@ private: int cursor_cnt; int cursor_state; - UINT32 clock_freq; + uint32_t clock_freq; bitmap_rgb32 m_screen_out; required_device m_palette; diff --git a/src/devices/video/ef9365.cpp b/src/devices/video/ef9365.cpp index 758638b7c6b..bdad2330743 100644 --- a/src/devices/video/ef9365.cpp +++ b/src/devices/video/ef9365.cpp @@ -170,7 +170,7 @@ const address_space_config *ef9365_device::memory_space_config(address_spacenum // ef9365_device - constructor //------------------------------------------------- -ef9365_device::ef9365_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ef9365_device::ef9365_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EF9365, "EF9365", tag, owner, clock, "ef9365", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -264,7 +264,7 @@ void ef9365_device::static_set_display_mode(device_t &device, int display_mode ) // into the palette //------------------------------------------------- -void ef9365_device::set_color_entry( int index, UINT8 r, UINT8 g, UINT8 b ) +void ef9365_device::set_color_entry( int index, uint8_t r, uint8_t g, uint8_t b ) { if( index < nb_of_colors ) { @@ -281,7 +281,7 @@ void ef9365_device::set_color_entry( int index, UINT8 r, UINT8 g, UINT8 b ) // used by the chip to draw/fill the memory //------------------------------------------------- -void ef9365_device::set_color_filler( UINT8 color ) +void ef9365_device::set_color_filler( uint8_t color ) { m_current_color = color; } @@ -445,7 +445,7 @@ void ef9365_device::set_y_reg(unsigned int y) void ef9365_device::set_video_mode(void) { - UINT16 new_width = bitplane_xres; + uint16_t new_width = bitplane_xres; if (m_screen->width() != new_width) { @@ -464,7 +464,7 @@ void ef9365_device::set_video_mode(void) // bitplane words //------------------------------------------------- -UINT8 ef9365_device::get_last_readback_word(int bitplane_number, int * pixel_offset) +uint8_t ef9365_device::get_last_readback_word(int bitplane_number, int * pixel_offset) { if( pixel_offset ) *pixel_offset = m_readback_latch_pix_offset; @@ -484,7 +484,7 @@ UINT8 ef9365_device::get_last_readback_word(int bitplane_number, int * pixel_off // ( No border for the moment ;) ) //------------------------------------------------- -void ef9365_device::draw_border(UINT16 line) +void ef9365_device::draw_border(uint16_t line) { } @@ -950,7 +950,7 @@ void ef9365_device::screen_scanning( int force_clear ) // ef9365_exec: EF936X Command decoder and execution //------------------------------------------------- -void ef9365_device::ef9365_exec(UINT8 cmd) +void ef9365_device::ef9365_exec(uint8_t cmd) { int tmp_delta_x,tmp_delta_y; int busy_cycles = 0; @@ -1149,7 +1149,7 @@ void ef9365_device::ef9365_exec(UINT8 cmd) // screen_update: Framebuffer video ouput //------------------------------------------------- -UINT32 ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int i,j,ptr,p; unsigned char color_index; @@ -1182,7 +1182,7 @@ UINT32 ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, // update_scanline: Scanline callback //------------------------------------------------- -void ef9365_device::update_scanline(UINT16 scanline) +void ef9365_device::update_scanline(uint16_t scanline) { if (scanline == vsync_scanline_pos) { diff --git a/src/devices/video/ef9365.h b/src/devices/video/ef9365.h index 2a75636ca0a..4352076528f 100644 --- a/src/devices/video/ef9365.h +++ b/src/devices/video/ef9365.h @@ -40,7 +40,7 @@ class ef9365_device : public device_t, { public: // construction/destruction - ef9365_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ef9365_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration static void static_set_palette_tag(device_t &device, const char *tag); @@ -52,13 +52,13 @@ public: DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( data_w ); - void update_scanline(UINT16 scanline); - void set_color_filler( UINT8 color ); - void set_color_entry( int index, UINT8 r, UINT8 g, UINT8 b ); + void update_scanline(uint16_t scanline); + void set_color_filler( uint8_t color ); + void set_color_entry( int index, uint8_t r, uint8_t g, uint8_t b ); - UINT8 get_last_readback_word(int bitplane_number, int * pixel_offset); + uint8_t get_last_readback_word(int bitplane_number, int * pixel_offset); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -87,8 +87,8 @@ private: void screen_scanning( int force_clear ); void set_busy_flag(int period); void set_video_mode(void); - void draw_border(UINT16 line); - void ef9365_exec(UINT8 cmd); + void draw_border(uint16_t line); + void ef9365_exec(uint8_t cmd); int cycles_to_us(int cycles); void dump_bitplanes_word(); void update_interrupts(); @@ -96,32 +96,32 @@ private: // internal state static const device_timer_id BUSY_TIMER = 0; - required_region_ptr m_charset; + required_region_ptr m_charset; address_space *m_videoram; - UINT8 m_irq_state; - UINT8 m_irq_vb; - UINT8 m_irq_lb; - UINT8 m_irq_rdy; - UINT8 m_current_color; - UINT8 m_bf; //busy flag - UINT8 m_registers[0x10]; //registers - UINT8 m_state; //status register - UINT8 m_border[80]; //border color + uint8_t m_irq_state; + uint8_t m_irq_vb; + uint8_t m_irq_lb; + uint8_t m_irq_rdy; + uint8_t m_current_color; + uint8_t m_bf; //busy flag + uint8_t m_registers[0x10]; //registers + uint8_t m_state; //status register + uint8_t m_border[80]; //border color rgb_t palette[256]; // 8 bitplanes max -> 256 colors max int nb_of_bitplanes; int nb_of_colors; int bitplane_xres; int bitplane_yres; - UINT16 overflow_mask_x; - UINT16 overflow_mask_y; + uint16_t overflow_mask_x; + uint16_t overflow_mask_y; int vsync_scanline_pos; - UINT8 m_readback_latch[EF936X_MAX_BITPLANES]; // Last DRAM Readback buffer (Filled after a Direct Memory Access Request command) + uint8_t m_readback_latch[EF936X_MAX_BITPLANES]; // Last DRAM Readback buffer (Filled after a Direct Memory Access Request command) int m_readback_latch_pix_offset; - UINT32 clock_freq; + uint32_t clock_freq; bitmap_rgb32 m_screen_out; // timers diff --git a/src/devices/video/epic12.cpp b/src/devices/video/epic12.cpp index 4417172c744..dab2e84a748 100644 --- a/src/devices/video/epic12.cpp +++ b/src/devices/video/epic12.cpp @@ -9,7 +9,7 @@ const device_type EPIC12 = &device_creator; -epic12_device::epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +epic12_device::epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EPIC12, "EP1C12 Blitter", tag, owner, clock, "epic12", __FILE__), device_video_interface(mconfig, *this), m_ram16(nullptr), m_gfx_size(0), m_bitmaps(nullptr), m_use_ram(nullptr), m_main_ramsize(0), m_main_rammask(0), m_maincpu(nullptr), m_ram16_copy(nullptr), m_work_queue(nullptr) @@ -45,7 +45,7 @@ void epic12_device::device_start() m_clip = m_bitmaps->cliprect(); m_clip.set(0, 0x2000-1, 0, 0x1000-1); - m_ram16_copy = std::make_unique(m_main_ramsize/2); + m_ram16_copy = std::make_unique(m_main_ramsize/2); m_blitter_delay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(epic12_device::blitter_delay_callback),this)); m_blitter_delay_timer->adjust(attotime::never); @@ -106,15 +106,15 @@ void epic12_device::device_reset() } // todo, get these into the device class without ruining performance -UINT8 epic12_device_colrtable[0x20][0x40]; -UINT8 epic12_device_colrtable_rev[0x20][0x40]; -UINT8 epic12_device_colrtable_add[0x20][0x20]; -UINT64 epic12_device_blit_delay; +uint8_t epic12_device_colrtable[0x20][0x40]; +uint8_t epic12_device_colrtable_rev[0x20][0x40]; +uint8_t epic12_device_colrtable_add[0x20][0x20]; +uint64_t epic12_device_blit_delay; -inline UINT16 epic12_device::READ_NEXT_WORD(offs_t *addr) +inline uint16_t epic12_device::READ_NEXT_WORD(offs_t *addr) { -// UINT16 data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower - UINT16 data = m_use_ram[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)]; +// uint16_t data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower + uint16_t data = m_use_ram[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)]; *addr += 2; @@ -122,10 +122,10 @@ inline UINT16 epic12_device::READ_NEXT_WORD(offs_t *addr) return data; } -inline UINT16 epic12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr) +inline uint16_t epic12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr) { -// UINT16 data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower - UINT16 data = m_ram16[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)]; +// uint16_t data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower + uint16_t data = m_ram16[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)]; m_ram16_copy[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)] = data; *addr += 2; @@ -137,7 +137,7 @@ inline UINT16 epic12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr) inline void epic12_device::gfx_upload_shadow_copy(address_space &space, offs_t *addr) { - UINT32 x,y, dimx,dimy; + uint32_t x,y, dimx,dimy; COPY_NEXT_WORD(space, addr); COPY_NEXT_WORD(space, addr); COPY_NEXT_WORD(space, addr); @@ -159,8 +159,8 @@ inline void epic12_device::gfx_upload_shadow_copy(address_space &space, offs_t * inline void epic12_device::gfx_upload(offs_t *addr) { - UINT32 x,y, dst_p,dst_x_start,dst_y_start, dimx,dimy; - UINT32 *dst; + uint32_t x,y, dst_p,dst_x_start,dst_y_start, dimx,dimy; + uint32_t *dst; // 0x20000000 READ_NEXT_WORD(addr); @@ -189,7 +189,7 @@ inline void epic12_device::gfx_upload(offs_t *addr) for (x = 0; x < dimx; x++) { - UINT16 pendat = READ_NEXT_WORD(addr); + uint16_t pendat = READ_NEXT_WORD(addr); // real hw would upload the gfxword directly, but our VRAM is 32-bit, so convert it. //dst[dst_x_start + x] = pendat; *dst++ = ((pendat&0x8000)<<14) | ((pendat&0x7c00)<<9) | ((pendat&0x03e0)<<6) | ((pendat&0x001f)<<3); // --t- ---- rrrr r--- gggg g--- bbbb b--- format @@ -310,10 +310,10 @@ inline void epic12_device::gfx_draw_shadow_copy(address_space &space, offs_t *ad COPY_NEXT_WORD(space, addr); COPY_NEXT_WORD(space, addr); COPY_NEXT_WORD(space, addr); - COPY_NEXT_WORD(space, addr); // UINT16 dst_x_start = COPY_NEXT_WORD(space, addr); - COPY_NEXT_WORD(space, addr); // UINT16 dst_y_start = COPY_NEXT_WORD(space, addr); - UINT16 w = COPY_NEXT_WORD(space, addr); - UINT16 h = COPY_NEXT_WORD(space, addr); + COPY_NEXT_WORD(space, addr); // uint16_t dst_x_start = COPY_NEXT_WORD(space, addr); + COPY_NEXT_WORD(space, addr); // uint16_t dst_y_start = COPY_NEXT_WORD(space, addr); + uint16_t w = COPY_NEXT_WORD(space, addr); + uint16_t h = COPY_NEXT_WORD(space, addr); COPY_NEXT_WORD(space, addr); COPY_NEXT_WORD(space, addr); @@ -333,16 +333,16 @@ inline void epic12_device::gfx_draw(offs_t *addr) clr_t tint_clr; int tinted = 0; - UINT16 attr = READ_NEXT_WORD(addr); - UINT16 alpha = READ_NEXT_WORD(addr); - UINT16 src_x = READ_NEXT_WORD(addr); - UINT16 src_y = READ_NEXT_WORD(addr); - UINT16 dst_x_start = READ_NEXT_WORD(addr); - UINT16 dst_y_start = READ_NEXT_WORD(addr); - UINT16 w = READ_NEXT_WORD(addr); - UINT16 h = READ_NEXT_WORD(addr); - UINT16 tint_r = READ_NEXT_WORD(addr); - UINT16 tint_gb = READ_NEXT_WORD(addr); + uint16_t attr = READ_NEXT_WORD(addr); + uint16_t alpha = READ_NEXT_WORD(addr); + uint16_t src_x = READ_NEXT_WORD(addr); + uint16_t src_y = READ_NEXT_WORD(addr); + uint16_t dst_x_start = READ_NEXT_WORD(addr); + uint16_t dst_y_start = READ_NEXT_WORD(addr); + uint16_t w = READ_NEXT_WORD(addr); + uint16_t h = READ_NEXT_WORD(addr); + uint16_t tint_r = READ_NEXT_WORD(addr); + uint16_t tint_gb = READ_NEXT_WORD(addr); // 0: +alpha // 1: +source @@ -362,8 +362,8 @@ inline void epic12_device::gfx_draw(offs_t *addr) flipy = attr & 0x0400; flipx = attr & 0x0800; - const UINT8 d_alpha = ((alpha & 0x00ff) )>>3; - const UINT8 s_alpha = ((alpha & 0xff00) >> 8 )>>3; + const uint8_t d_alpha = ((alpha & 0x00ff) )>>3; + const uint8_t s_alpha = ((alpha & 0xff00) >> 8 )>>3; // src_p = 0; src_x = src_x & 0x1fff; @@ -549,7 +549,7 @@ void epic12_device::gfx_create_shadow_copy(address_space &space) while (1) { - UINT16 data = COPY_NEXT_WORD(space, &addr); + uint16_t data = COPY_NEXT_WORD(space, &addr); switch( data & 0xf000 ) { @@ -591,7 +591,7 @@ void epic12_device::gfx_exec(void) while (1) { - UINT16 data = READ_NEXT_WORD(&addr); + uint16_t data = READ_NEXT_WORD(&addr); switch( data & 0xf000 ) { @@ -633,7 +633,7 @@ void epic12_device::gfx_exec_unsafe(void) while (1) { - UINT16 data = READ_NEXT_WORD(&addr); + uint16_t data = READ_NEXT_WORD(&addr); switch( data & 0xf000 ) { diff --git a/src/devices/video/epic12.h b/src/devices/video/epic12.h index 5e6301b44f8..07edae65a79 100644 --- a/src/devices/video/epic12.h +++ b/src/devices/video/epic12.h @@ -9,14 +9,14 @@ epic12_device::set_mainramsize(*device, _rgn); -extern UINT8 epic12_device_colrtable[0x20][0x40]; -extern UINT8 epic12_device_colrtable_rev[0x20][0x40]; -extern UINT8 epic12_device_colrtable_add[0x20][0x20]; -extern UINT64 epic12_device_blit_delay; +extern uint8_t epic12_device_colrtable[0x20][0x40]; +extern uint8_t epic12_device_colrtable_rev[0x20][0x40]; +extern uint8_t epic12_device_colrtable_add[0x20][0x20]; +extern uint64_t epic12_device_blit_delay; struct _clr_t { - UINT8 b,g,r,t; + uint8_t b,g,r,t; }; typedef struct _clr_t clr_t; @@ -24,12 +24,12 @@ typedef struct _clr_t clr_t; union colour_t { clr_t trgb; - UINT32 u32; + uint32_t u32; }; typedef void (*epic12_device_blitfunction)(bitmap_rgb32 *, const rectangle *, - UINT32 *, /* gfx */ + uint32_t *, /* gfx */ int , /* src_x */ int , /* src_y */ const int , /* dst_x_start */ @@ -37,8 +37,8 @@ typedef void (*epic12_device_blitfunction)(bitmap_rgb32 *, int , /* dimx */ int , /* dimy */ const int , /* flipy */ - const UINT8 , /* s_alpha */ - const UINT8 , /* d_alpha */ + const uint8_t , /* s_alpha */ + const uint8_t , /* d_alpha */ //int , /* tint */ const clr_t * ); @@ -47,14 +47,14 @@ class epic12_device : public device_t, public device_video_interface { public: - epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_rambase(UINT16* rambase) { m_ram16 = rambase; } + void set_rambase(uint16_t* rambase) { m_ram16 = rambase; } void set_delay_scale(int delay_scale) { m_delay_scale = delay_scale; } void set_is_unsafe(int is_unsafe) { m_is_unsafe = is_unsafe; } void set_cpu_device(cpu_device* maincpu) { m_maincpu = maincpu; } - inline UINT16 READ_NEXT_WORD(offs_t *addr); + inline uint16_t READ_NEXT_WORD(offs_t *addr); static void set_mainramsize(device_t &device, int ramsize) { @@ -70,16 +70,16 @@ public: void draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT16* m_ram16; - UINT32 m_gfx_addr; - UINT32 m_gfx_scroll_0_x, m_gfx_scroll_0_y; - UINT32 m_gfx_scroll_1_x, m_gfx_scroll_1_y; + uint16_t* m_ram16; + uint32_t m_gfx_addr; + uint32_t m_gfx_scroll_0_x, m_gfx_scroll_0_y; + uint32_t m_gfx_scroll_1_x, m_gfx_scroll_1_y; int m_gfx_size; std::unique_ptr m_bitmaps; rectangle m_clip; - UINT16* m_use_ram; + uint16_t* m_use_ram; int m_main_ramsize; // type D has double the main ram int m_main_rammask; @@ -92,13 +92,13 @@ public: // thread safe mode, with no delays & shadow ram copy DECLARE_READ32_MEMBER(blitter_r); DECLARE_WRITE32_MEMBER(blitter_w); - UINT32 m_gfx_addr_shadowcopy; - UINT32 m_gfx_scroll_0_x_shadowcopy, m_gfx_scroll_0_y_shadowcopy; - UINT32 m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_y_shadowcopy; - std::unique_ptr m_ram16_copy; + uint32_t m_gfx_addr_shadowcopy; + uint32_t m_gfx_scroll_0_x_shadowcopy, m_gfx_scroll_0_y_shadowcopy; + uint32_t m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_y_shadowcopy; + std::unique_ptr m_ram16_copy; inline void gfx_upload_shadow_copy(address_space &space, offs_t *addr); inline void gfx_create_shadow_copy(address_space &space); - inline UINT16 COPY_NEXT_WORD(address_space &space, offs_t *addr); + inline uint16_t COPY_NEXT_WORD(address_space &space, offs_t *addr); inline void gfx_draw_shadow_copy(address_space &space, offs_t *addr); inline void gfx_upload(offs_t *addr); inline void gfx_draw(offs_t *addr); @@ -115,7 +115,7 @@ public: static void *blit_request_callback_unsafe(void *param, int threadid); #define BLIT_FUNCTION static void -#define BLIT_PARAMS bitmap_rgb32 *bitmap, const rectangle *clip, UINT32 *gfx, int src_x, int src_y, const int dst_x_start, const int dst_y_start, int dimx, int dimy, const int flipy, const UINT8 s_alpha, const UINT8 d_alpha, const clr_t *tint_clr +#define BLIT_PARAMS bitmap_rgb32 *bitmap, const rectangle *clip, uint32_t *gfx, int src_x, int src_y, const int dst_x_start, const int dst_y_start, int dimx, int dimy, const int flipy, const uint8_t s_alpha, const uint8_t d_alpha, const clr_t *tint_clr BLIT_FUNCTION draw_sprite_f0_ti0_plain(BLIT_PARAMS); BLIT_FUNCTION draw_sprite_f0_ti0_tr1_s0_d0(BLIT_PARAMS); @@ -652,7 +652,7 @@ public: - static inline void pen_to_clr(UINT32 pen, clr_t *clr) + static inline void pen_to_clr(uint32_t pen, clr_t *clr) { // --t- ---- rrrr r--- gggg g--- bbbb b--- format clr->r = (pen >> (16+3));// & 0x1f; @@ -668,7 +668,7 @@ public: // convert separate r,g,b biases (0..80..ff) to clr_t (-1f..0..1f) - static inline void tint_to_clr(UINT8 r, UINT8 g, UINT8 b, clr_t *clr) + static inline void tint_to_clr(uint8_t r, uint8_t g, uint8_t b, clr_t *clr) { clr->r = r>>2; clr->g = g>>2; @@ -676,7 +676,7 @@ public: }; // clr_t to r5g5b5 - static inline UINT32 clr_to_pen(const clr_t *clr) + static inline uint32_t clr_to_pen(const clr_t *clr) { // --t- ---- rrrr r--- gggg g--- bbbb b--- format return (clr->r << (16+3)) | (clr->g << (8+3)) | (clr->b << 3); @@ -686,7 +686,7 @@ public: }; - static inline void clr_add_with_clr_mul_fixed(clr_t *clr, const clr_t *clr0, const UINT8 mulfixed_val, const clr_t *mulfixed_clr0) + static inline void clr_add_with_clr_mul_fixed(clr_t *clr, const clr_t *clr0, const uint8_t mulfixed_val, const clr_t *mulfixed_clr0) { clr->r = epic12_device_colrtable_add[clr0->r][epic12_device_colrtable[(mulfixed_clr0->r)][mulfixed_val]]; clr->g = epic12_device_colrtable_add[clr0->g][epic12_device_colrtable[(mulfixed_clr0->g)][mulfixed_val]]; @@ -707,7 +707,7 @@ public: clr->b = epic12_device_colrtable_add[clr0->r][epic12_device_colrtable[(clr1->b)][(clr1->b)]]; } - static inline void clr_add_with_clr_mul_fixed_rev(clr_t *clr, const clr_t *clr0, const UINT8 val, const clr_t *clr1) + static inline void clr_add_with_clr_mul_fixed_rev(clr_t *clr, const clr_t *clr0, const uint8_t val, const clr_t *clr1) { clr->r = epic12_device_colrtable_add[clr0->r][epic12_device_colrtable_rev[val][(clr1->r)]]; clr->g = epic12_device_colrtable_add[clr0->g][epic12_device_colrtable_rev[val][(clr1->g)]]; @@ -787,14 +787,14 @@ public: clr0->b = epic12_device_colrtable_rev[(clr2->b)][(clr1->b)]; } - static inline void clr_mul_fixed(clr_t *clr, const UINT8 val, const clr_t *clr0) + static inline void clr_mul_fixed(clr_t *clr, const uint8_t val, const clr_t *clr0) { clr->r = epic12_device_colrtable[val][(clr0->r)]; clr->g = epic12_device_colrtable[val][(clr0->g)]; clr->b = epic12_device_colrtable[val][(clr0->b)]; } - static inline void clr_mul_fixed_rev(clr_t *clr, const UINT8 val, const clr_t *clr0) + static inline void clr_mul_fixed_rev(clr_t *clr, const uint8_t val, const clr_t *clr0) { clr->r = epic12_device_colrtable_rev[val][(clr0->r)]; clr->g = epic12_device_colrtable_rev[val][(clr0->g)]; diff --git a/src/devices/video/epic12in.hxx b/src/devices/video/epic12in.hxx index 8bb6beb97f4..13f29e6f609 100644 --- a/src/devices/video/epic12in.hxx +++ b/src/devices/video/epic12in.hxx @@ -4,7 +4,7 @@ void epic12_device::FUNCNAME(BLIT_PARAMS) { - UINT32* gfx2; + uint32_t* gfx2; int y, yf; #if REALLY_SIMPLE == 0 @@ -35,12 +35,12 @@ void epic12_device::FUNCNAME(BLIT_PARAMS) #if REALLY_SIMPLE == 1 #if TRANSPARENT == 1 - UINT32 pen; + uint32_t pen; #endif #else - UINT32 pen; + uint32_t pen; #endif - UINT32 *bmp; + uint32_t *bmp; #if FLIPX == 1 src_x += (dimx-1); @@ -94,15 +94,15 @@ void epic12_device::FUNCNAME(BLIT_PARAMS) #if BLENDED == 1 #if _SMODE == 0 #if _DMODE == 0 - const UINT8* salpha_table = epic12_device_colrtable[s_alpha]; - const UINT8* dalpha_table = epic12_device_colrtable[d_alpha]; + const uint8_t* salpha_table = epic12_device_colrtable[s_alpha]; + const uint8_t* dalpha_table = epic12_device_colrtable[d_alpha]; #endif #if _DMODE == 5 - const UINT8* salpha_table = epic12_device_colrtable[s_alpha]; + const uint8_t* salpha_table = epic12_device_colrtable[s_alpha]; #endif #if _DMODE == 1 - const UINT8* salpha_table = epic12_device_colrtable[s_alpha]; + const uint8_t* salpha_table = epic12_device_colrtable[s_alpha]; #endif #endif @@ -110,7 +110,7 @@ void epic12_device::FUNCNAME(BLIT_PARAMS) #if _SMODE == 2 #if _DMODE == 0 - const UINT8* dalpha_table = epic12_device_colrtable[d_alpha]; + const uint8_t* dalpha_table = epic12_device_colrtable[d_alpha]; #endif #endif #endif @@ -130,12 +130,12 @@ void epic12_device::FUNCNAME(BLIT_PARAMS) #endif #if 1 - const UINT32* end = bmp+(dimx-startx); + const uint32_t* end = bmp+(dimx-startx); #else // maybe we can do some SSE type optimizations on larger blocks? right now this just results in more code and slower compiling tho. const int width = dimx-startx; - const UINT32* end = bmp+(width); + const uint32_t* end = bmp+(width); if (width<0) return; diff --git a/src/devices/video/fixfreq.cpp b/src/devices/video/fixfreq.cpp index d75232808e9..486b8e909e3 100644 --- a/src/devices/video/fixfreq.cpp +++ b/src/devices/video/fixfreq.cpp @@ -33,7 +33,7 @@ // device type definition const device_type FIXFREQ = &device_creator; -fixedfreq_device::fixedfreq_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) +fixedfreq_device::fixedfreq_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_video_interface(mconfig, *this, false), m_htotal(0), m_vtotal(0), m_vid(0), m_last_x(0), m_last_y(0), m_cur_bm(0), // default to NTSC "704x480@30i" @@ -52,7 +52,7 @@ fixedfreq_device::fixedfreq_device(const machine_config &mconfig, device_type ty { } -fixedfreq_device::fixedfreq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +fixedfreq_device::fixedfreq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FIXFREQ, "Fixed Frequency Monochrome Monitor", tag, owner, clock, "fixfreq", __FILE__), device_video_interface(mconfig, *this, false), // default to NTSC "704x480@30i" @@ -226,7 +226,7 @@ int fixedfreq_device::sync_separator(const attotime &time, double newval) return ret; } -UINT32 fixedfreq_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t fixedfreq_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, *m_bitmap[!m_cur_bm], 0, 0, 0, 0, cliprect); diff --git a/src/devices/video/fixfreq.h b/src/devices/video/fixfreq.h index 38fde1c5f3b..fa39a0b9de6 100644 --- a/src/devices/video/fixfreq.h +++ b/src/devices/video/fixfreq.h @@ -71,11 +71,11 @@ class fixedfreq_device : public device_t, { public: // construction/destruction - fixedfreq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - fixedfreq_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); + fixedfreq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + fixedfreq_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); // inline configuration helpers - static void set_minitor_clock(device_t &device, UINT32 clock) { downcast(device).m_monitor_clock = clock; } + static void set_minitor_clock(device_t &device, uint32_t clock) { downcast(device).m_monitor_clock = clock; } static void set_fieldcount(device_t &device, int count) { downcast(device).m_fieldcount = count; } static void set_threshold(device_t &device, double threshold) { downcast(device).m_sync_threshold = threshold; } static void set_gain(device_t &device, double gain) { downcast(device).m_gain = gain; } @@ -96,7 +96,7 @@ public: dev.m_vbackporch = backporch; } - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); NETDEV_ANALOG_CALLBACK_MEMBER(update_vid); @@ -130,7 +130,7 @@ private: int m_cur_bm; /* adjustable by drivers */ - UINT32 m_monitor_clock; + uint32_t m_monitor_clock; int m_hvisible; int m_hfrontporch; int m_hsync; diff --git a/src/devices/video/gb_lcd.cpp b/src/devices/video/gb_lcd.cpp index a1ebbb721b6..40b4ff38a44 100644 --- a/src/devices/video/gb_lcd.cpp +++ b/src/devices/video/gb_lcd.cpp @@ -228,7 +228,7 @@ enum { OAM fingerprints taken from Wilbert Pol's own unit. */ -static const UINT8 dmg_oam_fingerprint[0x100] = { +static const uint8_t dmg_oam_fingerprint[0x100] = { 0xD8, 0xE6, 0xB3, 0x89, 0xEC, 0xDE, 0x11, 0x62, 0x0B, 0x7E, 0x48, 0x9E, 0xB9, 0x6E, 0x26, 0xC9, 0x36, 0xF4, 0x7D, 0xE4, 0xD9, 0xCE, 0xFA, 0x5E, 0xA3, 0x77, 0x60, 0xFC, 0x1C, 0x64, 0x8B, 0xAC, 0xB6, 0x74, 0x3F, 0x9A, 0x0E, 0xFE, 0xEA, 0xA9, 0x40, 0x3A, 0x7A, 0xB6, 0xF2, 0xED, 0xA8, 0x3E, @@ -247,7 +247,7 @@ static const UINT8 dmg_oam_fingerprint[0x100] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const UINT8 mgb_oam_fingerprint[0x100] = { +static const uint8_t mgb_oam_fingerprint[0x100] = { 0xB9, 0xE9, 0x0D, 0x69, 0xBB, 0x7F, 0x00, 0x80, 0xE9, 0x7B, 0x79, 0xA2, 0xFD, 0xCF, 0xD8, 0x0A, 0x87, 0xEF, 0x44, 0x11, 0xFE, 0x37, 0x10, 0x21, 0xFA, 0xFF, 0x00, 0x17, 0xF6, 0x4F, 0x83, 0x03, 0x3A, 0xF4, 0x00, 0x24, 0xBB, 0xAE, 0x05, 0x01, 0xFF, 0xF7, 0x12, 0x48, 0xA7, 0x5E, 0xF6, 0x28, @@ -266,7 +266,7 @@ static const UINT8 mgb_oam_fingerprint[0x100] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const UINT8 cgb_oam_fingerprint[0x100] = { +static const uint8_t cgb_oam_fingerprint[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, @@ -288,7 +288,7 @@ static const UINT8 cgb_oam_fingerprint[0x100] = { /* For an AGS in CGB mode this data is: */ #if 0 -static const UINT8 ags_oam_fingerprint[0x100] = { +static const uint8_t ags_oam_fingerprint[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, @@ -316,7 +316,7 @@ const device_type CGB_PPU = &device_creator; -dmg_ppu_device::dmg_ppu_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, UINT32 vram_size) +dmg_ppu_device::dmg_ppu_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, uint32_t vram_size) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) , device_video_interface(mconfig, *this) , m_lr35902(*this, finder_base::DUMMY_TAG) @@ -327,7 +327,7 @@ dmg_ppu_device::dmg_ppu_device(const machine_config &mconfig, device_type type, { } -dmg_ppu_device::dmg_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dmg_ppu_device::dmg_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DMG_PPU, "DMG PPU", tag, owner, clock, "dmg_ppu", __FILE__) , device_video_interface(mconfig, *this) , m_lr35902(*this, finder_base::DUMMY_TAG) @@ -338,19 +338,19 @@ dmg_ppu_device::dmg_ppu_device(const machine_config &mconfig, const char *tag, d m_enable_experimental_engine = true; } -mgb_ppu_device::mgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mgb_ppu_device::mgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmg_ppu_device(mconfig, MGB_PPU, "MGB PPU", tag, owner, clock, "mgb_ppu", __FILE__, 0x2000) { m_enable_experimental_engine = true; } -sgb_ppu_device::sgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sgb_ppu_device::sgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmg_ppu_device(mconfig, SGB_PPU, "SGB PPU", tag, owner, clock, "sgb_ppu", __FILE__, 0x2000) { m_enable_experimental_engine = false; } -cgb_ppu_device::cgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cgb_ppu_device::cgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dmg_ppu_device(mconfig, CGB_PPU, "CGB PPU", tag, owner, clock, "cgb_ppu", __FILE__, 0x4000) { m_enable_experimental_engine = false; @@ -365,8 +365,8 @@ void dmg_ppu_device::common_start() { m_screen->register_screen_bitmap(m_bitmap); save_item(NAME(m_bitmap)); - m_oam = make_unique_clear(m_oam_size); - m_vram = make_unique_clear(m_vram_size); + m_oam = make_unique_clear(m_oam_size); + m_vram = make_unique_clear(m_vram_size); machine().save().register_postload(save_prepost_delegate(FUNC(dmg_ppu_device::videoptr_restore), this)); m_lcd_timer = timer_alloc(); @@ -518,7 +518,7 @@ void sgb_ppu_device::device_start() { common_start(); - m_sgb_tile_data = make_unique_clear(0x2000); + m_sgb_tile_data = make_unique_clear(0x2000); save_pointer(NAME(m_sgb_tile_data.get()), 0x2000); memset(m_sgb_tile_map, 0, sizeof(m_sgb_tile_map)); @@ -673,7 +673,7 @@ void cgb_ppu_device::device_reset() -inline void dmg_ppu_device::plot_pixel(int x, int y, UINT16 color) +inline void dmg_ppu_device::plot_pixel(int x, int y, uint16_t color) { m_bitmap.pix16(y, x) = color; } @@ -735,7 +735,7 @@ void dmg_ppu_device::select_sprites() /* If video hardware is enabled and sprites are enabled */ if ((LCDCONT & ENABLED) && (LCDCONT & SPRITES_ENABLED)) { - UINT8 sprite_occurs[32]; + uint8_t sprite_occurs[32]; memset(sprite_occurs, 0, sizeof(sprite_occurs)); @@ -802,7 +802,7 @@ void dmg_ppu_device::select_sprites() } -void dmg_ppu_device::update_line_state(UINT64 cycles) +void dmg_ppu_device::update_line_state(uint64_t cycles) { // Can the bg tilemap select bit be changed while drawing the screen? => yes // Can scroll-y be changed while drawing the screen? => yes @@ -855,7 +855,7 @@ LOG(("scrollx_to_apply: %u\n", m_line.scrollx_to_apply)); } } - UINT8 next_tile_cycle = m_line.tile_cycle + 1; + uint8_t next_tile_cycle = m_line.tile_cycle + 1; switch (m_line.tile_cycle) { @@ -1056,7 +1056,7 @@ LOG(("enable window, m_current_line = %u, WNDPOSY = %u, WNDPOSX = %u, m_line.win void dmg_ppu_device::update_sprites() { - UINT8 height, tilemask, line, *vram; + uint8_t height, tilemask, line, *vram; int yindex; if (LCDCONT & LARGE_SPRITES) @@ -1077,7 +1077,7 @@ void dmg_ppu_device::update_sprites() for (int i = m_sprCount - 1; i >= 0; i--) { int oam_address = m_sprite[i] * 4; - UINT16 *spal = (m_oam[oam_address + 3] & 0x10) ? m_gb_spal1 : m_gb_spal0; + uint16_t *spal = (m_oam[oam_address + 3] & 0x10) ? m_gb_spal1 : m_gb_spal0; int xindex = m_oam[oam_address + 1] - 8; int adr = (m_oam[oam_address + 2] & tilemask) * 16; @@ -1094,7 +1094,7 @@ void dmg_ppu_device::update_sprites() { adr += (line - m_oam[oam_address]) * 2; } - UINT16 data = (vram[adr + 1] << 8) | vram[adr]; + uint16_t data = (vram[adr + 1] << 8) | vram[adr]; switch (m_oam[oam_address + 3] & 0xA0) { @@ -1139,7 +1139,7 @@ void dmg_ppu_device::update_sprites() } -void dmg_ppu_device::update_scanline(UINT32 cycles_to_go) +void dmg_ppu_device::update_scanline(uint32_t cycles_to_go) { if (m_enable_experimental_engine) { @@ -1203,8 +1203,8 @@ void dmg_ppu_device::update_scanline(UINT32 cycles_to_go) } while (l < 2) { - UINT8 xindex, *map, *tiles; - UINT16 data; + uint8_t xindex, *map, *tiles; + uint16_t data; int i, tile_index; if (!m_layer[l].enabled) @@ -1288,8 +1288,8 @@ void dmg_ppu_device::update_scanline(UINT32 cycles_to_go) void sgb_ppu_device::update_sprites() { - UINT8 height, tilemask, line, *vram; - INT16 yindex; + uint8_t height, tilemask, line, *vram; + int16_t yindex; if (LCDCONT & LARGE_SPRITES) { @@ -1312,8 +1312,8 @@ void sgb_ppu_device::update_sprites() { int oam_address = m_sprite[i] * 4; int adr = (m_oam[oam_address + 2] & tilemask) * 16; - UINT16 *spal = (m_oam[oam_address + 3] & 0x10) ? m_gb_spal1 : m_gb_spal0; - UINT16 xindex = m_oam[oam_address + 1] - 8; + uint16_t *spal = (m_oam[oam_address + 3] & 0x10) ? m_gb_spal1 : m_gb_spal0; + uint16_t xindex = m_oam[oam_address + 1] - 8; if (m_oam[oam_address + 3] & 0x40) /* flip y ? */ { @@ -1323,11 +1323,11 @@ void sgb_ppu_device::update_sprites() { adr += (line - m_oam[oam_address]) * 2; } - UINT16 data = (vram[adr + 1] << 8) | vram[adr]; + uint16_t data = (vram[adr + 1] << 8) | vram[adr]; /* Find the palette to use */ // If sprite started before the start of the line we may need to pick a different pal_map entry? - UINT8 pal = m_sgb_pal_map[(xindex < 0) ? 0 : (xindex >> 3)][((yindex - SGB_YOFFSET) >> 3)] << 2; + uint8_t pal = m_sgb_pal_map[(xindex < 0) ? 0 : (xindex >> 3)][((yindex - SGB_YOFFSET) >> 3)] << 2; /* Offset to center of screen */ xindex += SGB_XOFFSET; @@ -1377,15 +1377,15 @@ void sgb_ppu_device::update_sprites() void sgb_ppu_device::refresh_border() { - UINT16 data, data2; - UINT8 *tiles, *tiles2; + uint16_t data, data2; + uint8_t *tiles, *tiles2; - for (UINT16 yidx = 0; yidx < 224; yidx++) + for (uint16_t yidx = 0; yidx < 224; yidx++) { - UINT8 *map = m_sgb_tile_map + ((yidx >> 3) * 64); - UINT16 xindex = 0; + uint8_t *map = m_sgb_tile_map + ((yidx >> 3) * 64); + uint16_t xindex = 0; - for (UINT16 xidx = 0; xidx < 64; xidx += 2) + for (uint16_t xidx = 0; xidx < 64; xidx += 2) { if (map[xidx + 1] & 0x80) /* Vertical flip */ tiles = m_sgb_tile_data.get() + ((7 - (yidx % 8)) << 1); @@ -1393,14 +1393,14 @@ void sgb_ppu_device::refresh_border() tiles = m_sgb_tile_data.get() + ((yidx % 8) << 1); tiles2 = tiles + 16; - UINT8 pal = (map[xidx + 1] & 0x1C) >> 2; + uint8_t pal = (map[xidx + 1] & 0x1C) >> 2; if (pal == 0) pal = 1; pal <<= 4; if (m_sgb_border_hack) { /* A few games do weird stuff */ - UINT8 tileno = map[xidx]; + uint8_t tileno = map[xidx]; if (tileno >= 128) tileno = ((64 + tileno) % 128) + 128; else tileno = (64 + tileno) % 128; data = tiles[tileno * 32] | (tiles[(tileno * 32) + 1] << 8); @@ -1414,7 +1414,7 @@ void sgb_ppu_device::refresh_border() for (int i = 0; i < 8; i++) { - UINT8 colour; + uint8_t colour; if ((map[xidx + 1] & 0x40)) /* Horizontal flip */ { colour = ((data & 0x0001) ? 1 : 0) | ((data & 0x0100) ? 2 : 0) | @@ -1444,7 +1444,7 @@ void sgb_ppu_device::refresh_border() } } -void sgb_ppu_device::update_scanline(UINT32 cycles_to_go) +void sgb_ppu_device::update_scanline(uint32_t cycles_to_go) { g_profiler.start(PROFILER_VIDEO); @@ -1534,8 +1534,8 @@ void sgb_ppu_device::update_scanline(UINT32 cycles_to_go) } while (l < 2) { - UINT8 xindex, sgb_palette, *map, *tiles; - UINT16 data; + uint8_t xindex, sgb_palette, *map, *tiles; + uint16_t data; int i, tile_index; if (!m_layer[l].enabled) @@ -1623,7 +1623,7 @@ void sgb_ppu_device::update_scanline(UINT32 cycles_to_go) void cgb_ppu_device::update_sprites() { - UINT8 height, tilemask, line; + uint8_t height, tilemask, line; int yindex; if (LCDCONT & LARGE_SPRITES) @@ -1642,10 +1642,10 @@ void cgb_ppu_device::update_sprites() for (int i = m_sprCount - 1; i >= 0; i--) { - const UINT16 oam_address = m_sprite[i] * 4; - UINT8 pal; + const uint16_t oam_address = m_sprite[i] * 4; + uint8_t pal; int xindex = m_oam[oam_address + 1] - 8; - UINT16 adr = ((m_oam[oam_address + 3] & 0x08) << 10) + (m_oam[oam_address + 2] & tilemask) * 16; + uint16_t adr = ((m_oam[oam_address + 3] & 0x08) << 10) + (m_oam[oam_address + 2] & tilemask) * 16; if (xindex < -7 || xindex > 160) { @@ -1667,7 +1667,7 @@ void cgb_ppu_device::update_sprites() adr += (line - m_oam[oam_address]) * 2; } - UINT16 data = (m_vram[adr + 1] << 8) | m_vram[adr]; + uint16_t data = (m_vram[adr + 1] << 8) | m_vram[adr]; switch (m_oam[oam_address + 3] & 0xA0) { @@ -1734,7 +1734,7 @@ void cgb_ppu_device::update_sprites() } } -void cgb_ppu_device::update_scanline(UINT32 cycles_to_go) +void cgb_ppu_device::update_scanline(uint32_t cycles_to_go) { g_profiler.start(PROFILER_VIDEO); @@ -1795,8 +1795,8 @@ void cgb_ppu_device::update_scanline(UINT32 cycles_to_go) } while (l < 2) { - UINT8 xindex, *map, *tiles, *gbcmap; - UINT16 data; + uint8_t xindex, *map, *tiles, *gbcmap; + uint16_t data; int i, tile_index; if (!m_layer[l].enabled) @@ -1917,7 +1917,7 @@ void cgb_ppu_device::update_scanline(UINT32 cycles_to_go) } -UINT32 dmg_ppu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dmg_ppu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; @@ -1944,7 +1944,7 @@ void dmg_ppu_device::device_timer(emu_timer &timer, device_timer_id id, int para } -void dmg_ppu_device::update_oam_dma_state(UINT64 cycles) +void dmg_ppu_device::update_oam_dma_state(uint64_t cycles) { if (m_oam_dma_cycles_left > 0) { @@ -2041,7 +2041,7 @@ void dmg_ppu_device::update_state() assert(now >= m_last_updated); - UINT64 cycles = m_lr35902->attotime_to_cycles(now - m_last_updated); + uint64_t cycles = m_lr35902->attotime_to_cycles(now - m_last_updated); update_oam_dma_state(cycles); @@ -2073,7 +2073,7 @@ void dmg_ppu_device::update_state() while (m_cycles_left == 0) { - UINT16 state_cycles = 0; + uint16_t state_cycles = 0; m_state = m_next_state; @@ -2417,7 +2417,7 @@ LOG(("window should trigger = %s, m_current_line = %u, m_window_y = %u\n", m_lin // CGB specific code -void cgb_ppu_device::update_hdma_state(UINT64 cycles) +void cgb_ppu_device::update_hdma_state(uint64_t cycles) { if (m_hdma_cycles_to_start > 0) { @@ -2434,7 +2434,7 @@ void cgb_ppu_device::update_hdma_state(UINT64 cycles) } -void cgb_ppu_device::hdma_trans(UINT16 length) +void cgb_ppu_device::hdma_trans(uint16_t length) { LOG(("hdma_trans\n")); m_hdma_length = length; @@ -2446,8 +2446,8 @@ void cgb_ppu_device::hdma_trans(UINT16 length) void cgb_ppu_device::hdma_trans_execute() { LOG(("hdma_trans_execute\n")); - UINT16 length = m_hdma_length; - UINT16 src, dst; + uint16_t length = m_hdma_length; + uint16_t src, dst; src = (HDMA1 << 8) | (HDMA2 & 0xF0); // 102 Dalmatians uses destination 0000 and expects data to be DMAed. @@ -2458,8 +2458,8 @@ void cgb_ppu_device::hdma_trans_execute() { if (dst & 0x8000) { - UINT16 src_high = src & 0xF000; - UINT8 source = 0xFF; + uint16_t src_high = src & 0xF000; + uint8_t source = 0xFF; if (src_high < 0x8000 || (src_high >= 0xA000 && src_high < 0xE000)) { source = m_program_space->read_byte(src); @@ -2497,7 +2497,7 @@ void cgb_ppu_device::update_state() attotime now = machine().time(); - UINT64 cycles = m_lr35902->attotime_to_cycles(now - m_last_updated); + uint64_t cycles = m_lr35902->attotime_to_cycles(now - m_last_updated); update_oam_dma_state(cycles); update_hdma_state(cycles); @@ -2521,7 +2521,7 @@ void cgb_ppu_device::update_state() while (m_cycles_left == 0) { - UINT16 state_cycles = 0; + uint16_t state_cycles = 0; m_state = m_next_state; @@ -2832,7 +2832,7 @@ void cgb_ppu_device::update_state() } -void dmg_ppu_device::lcd_switch_on(UINT8 new_data) +void dmg_ppu_device::lcd_switch_on(uint8_t new_data) { m_current_line = 0; m_previous_line = 153; @@ -2940,7 +2940,7 @@ READ8_MEMBER(dmg_ppu_device::video_r) } -bool dmg_ppu_device::stat_write(UINT8 new_data) +bool dmg_ppu_device::stat_write(uint8_t new_data) { LOG(("stat_write: old_data = %02x, new_data = %02x\n", LCDSTAT & 0x78, new_data & 0x78)); @@ -3227,7 +3227,7 @@ READ8_MEMBER(cgb_ppu_device::video_r) } -bool cgb_ppu_device::stat_write(UINT8 new_data) +bool cgb_ppu_device::stat_write(uint8_t new_data) { LOG(("stat_write: old_data = %02x, new_data = %02x\n", LCDSTAT & 0x78, new_data & 0x78)); @@ -3511,7 +3511,7 @@ WRITE8_MEMBER(cgb_ppu_device::video_w) // Super Game Boy -void sgb_ppu_device::sgb_io_write_pal(int offs, UINT8 *data) +void sgb_ppu_device::sgb_io_write_pal(int offs, uint8_t *data) { switch (offs) { @@ -3557,7 +3557,7 @@ void sgb_ppu_device::sgb_io_write_pal(int offs, UINT8 *data) break; case 0x04: /* ATTR_BLK */ { - UINT8 I, J, K, o; + uint8_t I, J, K, o; for( K = 0; K < data[1]; K++ ) { o = K * 6; @@ -3576,7 +3576,7 @@ void sgb_ppu_device::sgb_io_write_pal(int offs, UINT8 *data) break; case 0x05: /* ATTR_LIN */ { - UINT8 J, K; + uint8_t J, K; if( data[1] > 15 ) data[1] = 15; for( K = 0; K < data[1]; K++ ) @@ -3600,7 +3600,7 @@ void sgb_ppu_device::sgb_io_write_pal(int offs, UINT8 *data) break; case 0x06: /* ATTR_DIV */ { - UINT8 I, J; + uint8_t I, J; if( data[1] & 0x40 ) /* Vertical */ { for( I = 0; I < data[2]; I++ ) @@ -3647,8 +3647,8 @@ void sgb_ppu_device::sgb_io_write_pal(int offs, UINT8 *data) break; case 0x07: /* ATTR_CHR */ { - UINT16 I, sets; - UINT8 x, y; + uint16_t I, sets; + uint8_t x, y; sets = (data[3] | (data[4] << 8) ); if( sets > 360 ) sets = 360; @@ -3751,28 +3751,28 @@ void sgb_ppu_device::sgb_io_write_pal(int offs, UINT8 *data) break; case 0x0A: /* PAL_SET */ { - UINT16 index_; + uint16_t index_; /* Palette 0 */ - index_ = (UINT16)(data[1] | (data[2] << 8)) * 4; + index_ = (uint16_t)(data[1] | (data[2] << 8)) * 4; m_sgb_pal[0] = m_sgb_pal_data[index_]; m_sgb_pal[1] = m_sgb_pal_data[index_ + 1]; m_sgb_pal[2] = m_sgb_pal_data[index_ + 2]; m_sgb_pal[3] = m_sgb_pal_data[index_ + 3]; /* Palette 1 */ - index_ = (UINT16)(data[3] | (data[4] << 8)) * 4; + index_ = (uint16_t)(data[3] | (data[4] << 8)) * 4; m_sgb_pal[4] = m_sgb_pal_data[index_]; m_sgb_pal[5] = m_sgb_pal_data[index_ + 1]; m_sgb_pal[6] = m_sgb_pal_data[index_ + 2]; m_sgb_pal[7] = m_sgb_pal_data[index_ + 3]; /* Palette 2 */ - index_ = (UINT16)(data[5] | (data[6] << 8)) * 4; + index_ = (uint16_t)(data[5] | (data[6] << 8)) * 4; m_sgb_pal[8] = m_sgb_pal_data[index_]; m_sgb_pal[9] = m_sgb_pal_data[index_ + 1]; m_sgb_pal[10] = m_sgb_pal_data[index_ + 2]; m_sgb_pal[11] = m_sgb_pal_data[index_ + 3]; /* Palette 3 */ - index_ = (UINT16)(data[7] | (data[8] << 8)) * 4; + index_ = (uint16_t)(data[7] | (data[8] << 8)) * 4; m_sgb_pal[12] = m_sgb_pal_data[index_]; m_sgb_pal[13] = m_sgb_pal_data[index_ + 1]; m_sgb_pal[14] = m_sgb_pal_data[index_ + 2]; @@ -3798,7 +3798,7 @@ void sgb_ppu_device::sgb_io_write_pal(int offs, UINT8 *data) break; case 0x0B: /* PAL_TRN */ { - UINT16 col; + uint16_t col; for (int i = 0; i < 2048; i++ ) { @@ -3833,7 +3833,7 @@ void sgb_ppu_device::sgb_io_write_pal(int offs, UINT8 *data) break; case 0x14: /* PCT_TRN */ { - UINT16 col; + uint16_t col; if (m_sgb_border_hack) { memcpy(m_sgb_tile_map, m_vram.get() + 0x1000, 2048); diff --git a/src/devices/video/gb_lcd.h b/src/devices/video/gb_lcd.h index a275bd820ce..93c4ae7cabe 100644 --- a/src/devices/video/gb_lcd.h +++ b/src/devices/video/gb_lcd.h @@ -14,16 +14,16 @@ struct layer_struct { - UINT8 enabled; - UINT8 *bg_tiles; - UINT8 *bg_map; - UINT8 xindex; - UINT8 xshift; - UINT8 xstart; - UINT8 xend; + uint8_t enabled; + uint8_t *bg_tiles; + uint8_t *bg_map; + uint8_t xindex; + uint8_t xshift; + uint8_t xstart; + uint8_t xend; /* GBC specific */ - UINT8 *gbc_map; - INT16 bgline; + uint8_t *gbc_map; + int16_t bgline; }; @@ -31,12 +31,12 @@ class dmg_ppu_device : public device_t, public device_video_interface { public: - dmg_ppu_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, UINT32 vram_size); - dmg_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dmg_ppu_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, uint32_t vram_size); + dmg_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_lr35902_tag(device_t &device, const char *tag) { downcast(device).m_lr35902.set_tag(tag); } - 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); DECLARE_READ8_MEMBER(vram_r); DECLARE_WRITE8_MEMBER(vram_w); @@ -66,12 +66,12 @@ protected: LY_LYC_FLAG = 0x04 }; - inline void plot_pixel(int x, int y, UINT16 color); + inline void plot_pixel(int x, int y, uint16_t color); void select_sprites(); void calculate_window_cycles(); virtual void update_sprites(); - virtual void update_scanline(UINT32 cycles_to_go); + virtual void update_scanline(uint32_t cycles_to_go); // device-level overrides virtual void device_start() override; @@ -88,14 +88,14 @@ protected: // state variables bitmap_ind16 m_bitmap; - UINT8 m_sgb_atf_data[4050]; /* (SGB) Attributes files */ - UINT32 m_sgb_atf; - UINT16 m_sgb_pal_data[4096]; - UINT8 m_sgb_pal_map[20][18]; - UINT16 m_sgb_pal[128]; - std::unique_ptr m_sgb_tile_data; - UINT8 m_sgb_tile_map[2048]; - UINT8 m_sgb_window_mask; + uint8_t m_sgb_atf_data[4050]; /* (SGB) Attributes files */ + uint32_t m_sgb_atf; + uint16_t m_sgb_pal_data[4096]; + uint8_t m_sgb_pal_map[20][18]; + uint16_t m_sgb_pal[128]; + std::unique_ptr m_sgb_tile_data; + uint8_t m_sgb_tile_map[2048]; + uint8_t m_sgb_window_mask; // this is temporarily needed for a bunch of games which draw the border differently... int m_sgb_border_hack; @@ -104,57 +104,57 @@ protected: static constexpr unsigned NR_GB_VID_REGS = 0x40; - UINT8 m_vid_regs[NR_GB_VID_REGS]; - UINT8 m_bg_zbuf[160]; + uint8_t m_vid_regs[NR_GB_VID_REGS]; + uint8_t m_bg_zbuf[160]; - UINT16 m_cgb_bpal[32]; /* CGB current background palette table */ - UINT16 m_cgb_spal[32]; /* CGB current sprite palette table */ + uint16_t m_cgb_bpal[32]; /* CGB current background palette table */ + uint16_t m_cgb_spal[32]; /* CGB current sprite palette table */ - UINT16 m_gb_bpal[4]; /* Background palette */ - UINT16 m_gb_spal0[4]; /* Sprite 0 palette */ - UINT16 m_gb_spal1[4]; /* Sprite 1 palette */ + uint16_t m_gb_bpal[4]; /* Background palette */ + uint16_t m_gb_spal0[4]; /* Sprite 0 palette */ + uint16_t m_gb_spal1[4]; /* Sprite 1 palette */ /* WIP Things used to render current line */ struct { // Background/window data - UINT8 tile_cycle; - UINT8 tile_count; - UINT8 y; - UINT16 pattern_address; - UINT8 pattern; - UINT16 tile_address; - UINT8 plane0; - UINT8 plane1; - UINT16 shift_register; + uint8_t tile_cycle; + uint8_t tile_count; + uint8_t y; + uint16_t pattern_address; + uint8_t pattern; + uint16_t tile_address; + uint8_t plane0; + uint8_t plane1; + uint16_t shift_register; // Sprite data struct { bool enabled; - UINT8 x; - UINT8 y; - UINT8 pattern; - UINT8 flags; - UINT8 tile_plane_0; - UINT8 tile_plane_1; + uint8_t x; + uint8_t y; + uint8_t pattern; + uint8_t flags; + uint8_t tile_plane_0; + uint8_t tile_plane_1; } sprite[10]; - UINT8 sprite_delay_cycles; + uint8_t sprite_delay_cycles; // other internal data bool starting; // Inital fetches when (re)starting the rendering engine. - UINT8 sequence_counter; + uint8_t sequence_counter; bool drawing; bool start_drawing; - UINT8 scrollx_delay; - UINT8 scrollx_to_apply; - UINT8 pixels_drawn; - UINT16 window_compare_position; + uint8_t scrollx_delay; + uint8_t scrollx_to_apply; + uint8_t pixels_drawn; + uint16_t window_compare_position; bool window_active; - UINT8 scrollx; + uint8_t scrollx; // To keep track of when changes to WNDPOSY/WNDPOSX should kick in - UINT8 window_start_y[16]; - UINT8 window_start_x[16]; + uint8_t window_start_y[16]; + uint8_t window_start_x[16]; int window_start_y_index; // To keep track of when changes to LCDCONT should kick in for window - UINT8 window_enable[16]; + uint8_t window_enable[16]; int window_enable_index; bool window_should_trigger; } m_line; @@ -179,16 +179,16 @@ protected: int m_hdma_enabled; int m_hdma_possible; int m_hdma_cycles_to_start; - UINT16 m_hdma_length; + uint16_t m_hdma_length; struct layer_struct m_layer[2]; emu_timer *m_lcd_timer; int m_oam_dma_start_cycles; int m_oam_dma_cycles_left; - UINT16 m_oam_dma_source_address; + uint16_t m_oam_dma_source_address; int m_gbc_mode; - UINT8 m_window_x; - UINT8 m_window_y; - UINT8 m_old_curline; + uint8_t m_window_x; + uint8_t m_window_y; + uint8_t m_old_curline; // Interrupt related bool m_stat_mode0_int; bool m_stat_mode1_int; @@ -198,44 +198,44 @@ protected: bool m_stat_write_int; bool m_stat_int; - std::unique_ptr m_vram; // Pointer to VRAM - std::unique_ptr m_oam; // Pointer to OAM memory + std::unique_ptr m_vram; // Pointer to VRAM + std::unique_ptr m_oam; // Pointer to OAM memory bool m_oam_dma_processing; - UINT8 m_gb_tile_no_mod; - UINT32 m_gb_chrgen_offs; // GB Character generator - UINT32 m_gb_bgdtab_offs; // GB Background character table - UINT32 m_gb_wndtab_offs; // GB Window character table - UINT32 m_gbc_chrgen_offs; // CGB Character generator - UINT32 m_gbc_bgdtab_offs; // CGB Background character table - UINT32 m_gbc_wndtab_offs; // CGB Window character table + uint8_t m_gb_tile_no_mod; + uint32_t m_gb_chrgen_offs; // GB Character generator + uint32_t m_gb_bgdtab_offs; // GB Background character table + uint32_t m_gb_wndtab_offs; // GB Window character table + uint32_t m_gbc_chrgen_offs; // CGB Character generator + uint32_t m_gbc_bgdtab_offs; // CGB Background character table + uint32_t m_gbc_wndtab_offs; // CGB Window character table int m_vram_bank; attotime m_last_updated; - UINT64 m_cycles_left; + uint64_t m_cycles_left; int m_next_state; bool m_updating_state; bool m_enable_experimental_engine; virtual void videoptr_restore(); - virtual bool stat_write(UINT8 new_data); + virtual bool stat_write(uint8_t new_data); void increment_scanline(); - void lcd_switch_on(UINT8 new_data); - void update_oam_dma_state(UINT64 cycles); + void lcd_switch_on(uint8_t new_data); + void update_oam_dma_state(uint64_t cycles); void check_stat_irq(); void clear_line_state(); - void update_line_state(UINT64 cycles); + void update_line_state(uint64_t cycles); void check_start_of_window(); private: - UINT32 m_oam_size; - UINT32 m_vram_size; + uint32_t m_oam_size; + uint32_t m_vram_size; }; class mgb_ppu_device : public dmg_ppu_device { public: - mgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: @@ -247,9 +247,9 @@ protected: class sgb_ppu_device : public dmg_ppu_device { public: - sgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void sgb_io_write_pal(int offs, UINT8 *data); + void sgb_io_write_pal(int offs, uint8_t *data); protected: @@ -258,7 +258,7 @@ protected: virtual void device_reset() override; virtual void update_sprites() override; - virtual void update_scanline(UINT32 cycles_to_go) override; + virtual void update_scanline(uint32_t cycles_to_go) override; void refresh_border(); }; @@ -266,7 +266,7 @@ protected: class cgb_ppu_device : public dmg_ppu_device { public: - cgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cgb_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_READ8_MEMBER(video_r) override; virtual DECLARE_WRITE8_MEMBER(video_w) override; @@ -278,13 +278,13 @@ protected: virtual void device_reset() override; virtual void update_sprites() override; - virtual void update_scanline(UINT32 cycles_to_go) override; + virtual void update_scanline(uint32_t cycles_to_go) override; virtual void update_state() override; virtual void videoptr_restore() override; - virtual bool stat_write(UINT8 new_data) override; - void update_hdma_state(UINT64 cycles); - void hdma_trans(UINT16 length); + virtual bool stat_write(uint8_t new_data) override; + void update_hdma_state(uint64_t cycles); + void hdma_trans(uint16_t length); void hdma_trans_execute(); }; diff --git a/src/devices/video/gba_lcd.cpp b/src/devices/video/gba_lcd.cpp index 0d66df6de18..398c8542673 100644 --- a/src/devices/video/gba_lcd.cpp +++ b/src/devices/video/gba_lcd.cpp @@ -78,7 +78,7 @@ static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, co class object { public: - object(device_t &device, UINT16 *oam, int index) + object(device_t &device, uint16_t *oam, int index) : m_device(device) { m_attr0 = oam[(4 * index) + 0]; @@ -89,7 +89,7 @@ public: int pos_y() { return m_attr0 & 0x00ff; } bool roz() { return m_attr0 & 0x0100; } bool roz_double() { return m_attr0 & 0x0200; } - UINT16 mode_mask() { return m_attr0 & 0x0c00; } + uint16_t mode_mask() { return m_attr0 & 0x0c00; } bool mosaic() { return m_attr0 & 0x1000; } bool palette_256() { return m_attr0 & 0x2000; } @@ -102,7 +102,7 @@ public: int priority() { return (m_attr2 & 0x0c00) >> 10; } int palette() { return (m_attr2 & 0xf000) >> 8; } - enum class mode : UINT16 + enum class mode : uint16_t { normal = 0x0000, alpha = 0x0400, @@ -133,14 +133,14 @@ public: private: device_t &m_device; - UINT16 m_attr0; - UINT16 m_attr1; - UINT16 m_attr2; + uint16_t m_attr0; + uint16_t m_attr1; + uint16_t m_attr2; }; const device_type GBA_LCD = &device_creator; -gba_lcd_device::gba_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gba_lcd_device::gba_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GBA_LCD, "GBA LCD", tag, owner, clock, "gba_lcd", __FILE__) , device_video_interface(mconfig, *this) , m_int_hblank_cb(*this) @@ -151,9 +151,9 @@ gba_lcd_device::gba_lcd_device(const machine_config &mconfig, const char *tag, d { } -inline UINT8 gba_lcd_device::bg_video_mode() +inline uint8_t gba_lcd_device::bg_video_mode() { - UINT8 mode = DISPCNT & 0x0007; + uint8_t mode = DISPCNT & 0x0007; if (mode > 5) { @@ -184,27 +184,27 @@ inline bool gba_lcd_device::is_set(dispstat flag) return DISPSTAT & underlying_value(flag); } -inline bool gba_lcd_device::is_set(UINT16 bgxcnt, bgcnt flag) +inline bool gba_lcd_device::is_set(uint16_t bgxcnt, bgcnt flag) { return bgxcnt & underlying_value(flag); } -inline UINT8 gba_lcd_device::bg_priority(UINT16 bgxcnt) +inline uint8_t gba_lcd_device::bg_priority(uint16_t bgxcnt) { return bgxcnt & 0x0003; } -inline UINT32 gba_lcd_device::bg_char_base(UINT16 bgxcnt) +inline uint32_t gba_lcd_device::bg_char_base(uint16_t bgxcnt) { return ((bgxcnt & 0x003c) >> 2) * 0x4000; } -inline UINT32 gba_lcd_device::bg_screen_base(UINT16 bgxcnt) +inline uint32_t gba_lcd_device::bg_screen_base(uint16_t bgxcnt) { return ((bgxcnt & 0x1f00) >> 8) * 0x800; } -inline void gba_lcd_device::bg_screen_size(UINT16 bgxcnt, bool text, int &width, int &height) +inline void gba_lcd_device::bg_screen_size(uint16_t bgxcnt, bool text, int &width, int &height) { static const int size_table[2][4][2] = { @@ -219,7 +219,7 @@ inline void gba_lcd_device::bg_screen_size(UINT16 bgxcnt, bool text, int &width, height = size_table[mode][size][1]; } -inline UINT16 gba_lcd_device::mosaic_size(size_type type) +inline uint16_t gba_lcd_device::mosaic_size(size_type type) { return ((MOSAIC >> (4 * underlying_value(type))) & 0xf) + 1; } @@ -229,12 +229,12 @@ inline gba_lcd_device::sfx gba_lcd_device::color_sfx() return enum_value(BLDCNT & 0x00c0); } -inline UINT8 gba_lcd_device::color_sfx_target(target id) +inline uint8_t gba_lcd_device::color_sfx_target(target id) { return (BLDCNT >> (8 * underlying_value(id))) & 0x3f; } -inline void gba_lcd_device::update_mask(UINT8* mask, int y) +inline void gba_lcd_device::update_mask(uint8_t* mask, int y) { bool inwin0 = false; bool inwin1 = false; @@ -262,7 +262,7 @@ inline void gba_lcd_device::update_mask(UINT8* mask, int y) void gba_lcd_device::draw_scanline(int y) { - UINT16 *scanline = &m_bitmap.pix16(y); + uint16_t *scanline = &m_bitmap.pix16(y); if (is_set(dispcnt::forced_blank)) { @@ -273,9 +273,9 @@ void gba_lcd_device::draw_scanline(int y) return; } - UINT8 mode = bg_video_mode(); + uint8_t mode = bg_video_mode(); - UINT8 submode; + uint8_t submode; if (is_set(dispcnt::win0_en) || is_set(dispcnt::win1_en) || is_set(dispcnt::obj_win_en)) submode = 2; else if (color_sfx() != sfx::none) @@ -325,7 +325,7 @@ void gba_lcd_device::draw_scanline(int y) break; } - UINT8 mask[240]; + uint8_t mask[240]; // draw objects draw_oam(m_scanline[4], y); @@ -340,12 +340,12 @@ void gba_lcd_device::draw_scanline(int y) memset(mask, 0xff, sizeof(mask)); } - UINT32 backdrop = ((UINT16 *)m_pram.get())[0] | 0x30000000; + uint32_t backdrop = ((uint16_t *)m_pram.get())[0] | 0x30000000; for (auto x = 0; x < 240; x++) { - UINT32 color = backdrop; - UINT8 top = 0x20; + uint32_t color = backdrop; + uint8_t top = 0x20; for (auto l = 0; l < 5; l++) { @@ -360,8 +360,8 @@ void gba_lcd_device::draw_scanline(int y) { if (submode != 0 || top == 0x10) { - UINT32 back = backdrop; - UINT8 top2 = 0x20; + uint32_t back = backdrop; + uint8_t top2 = 0x20; for (auto l = 0; l < 4; l++) { @@ -402,8 +402,8 @@ void gba_lcd_device::draw_scanline(int y) break; case sfx::alpha: { - UINT32 back = backdrop; - UINT8 top2 = 0x20; + uint32_t back = backdrop; + uint8_t top2 = 0x20; for (auto l = 0; l < 5; l++) { @@ -435,17 +435,17 @@ void gba_lcd_device::draw_scanline(int y) } } -void gba_lcd_device::draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, dispcnt bg_enable, UINT32 ctrl, INT32 X, INT32 Y, INT32 PA, INT32 PB, INT32 PC, INT32 PD, internal_reg ¤tx, internal_reg ¤ty, int depth) +void gba_lcd_device::draw_roz_bitmap_scanline(uint32_t *scanline, int ypos, dispcnt bg_enable, uint32_t ctrl, int32_t X, int32_t Y, int32_t PA, int32_t PB, int32_t PC, int32_t PD, internal_reg ¤tx, internal_reg ¤ty, int depth) { if (!is_set(bg_enable)) return; - UINT8 *src8 = (UINT8 *)m_vram.get(); - UINT16 *src16 = (UINT16 *)m_vram.get(); - UINT16 *palette = (UINT16 *)m_pram.get(); - INT32 sx = (depth == 4) ? 160 : 240; - INT32 sy = (depth == 4) ? 128 : 160; - UINT32 prio = (bg_priority(ctrl) << 25) + 0x1000000; + uint8_t *src8 = (uint8_t *)m_vram.get(); + uint16_t *src16 = (uint16_t *)m_vram.get(); + uint16_t *palette = (uint16_t *)m_pram.get(); + int32_t sx = (depth == 4) ? 160 : 240; + int32_t sy = (depth == 4) ? 128 : 160; + uint32_t prio = (bg_priority(ctrl) << 25) + 0x1000000; if (is_set(dispcnt::alt_frame_sel)) { @@ -484,19 +484,19 @@ void gba_lcd_device::draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, dispcn currenty.status += PD; } - INT32 cx = currentx.status; - INT32 cy = currenty.status; + int32_t cx = currentx.status; + int32_t cy = currenty.status; if (is_set(ctrl, bgcnt::mosaic_en)) { - UINT16 mosaic_line = mosaic_size(size_type::bg_v); - INT32 tempy = (ypos / mosaic_line) * mosaic_line; + uint16_t mosaic_line = mosaic_size(size_type::bg_v); + int32_t tempy = (ypos / mosaic_line) * mosaic_line; cx = X + tempy * PB; cy = Y + tempy * PD; } - INT32 pixx = cx >> 8; - INT32 pixy = cy >> 8; + int32_t pixx = cx >> 8; + int32_t pixy = cy >> 8; for (auto x = 0; x < 240; x++) { @@ -504,7 +504,7 @@ void gba_lcd_device::draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, dispcn { if (depth == 8) { - UINT8 color = src8[pixy * sx + pixx]; + uint8_t color = src8[pixy * sx + pixx]; if (color) scanline[x] = palette[color] | prio; } @@ -523,10 +523,10 @@ void gba_lcd_device::draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, dispcn if (is_set(ctrl, bgcnt::mosaic_en)) { - UINT16 mosaicx = mosaic_size(size_type::bg_h); + uint16_t mosaicx = mosaic_size(size_type::bg_h); if (mosaicx > 1) { - INT32 m = 1; + int32_t m = 1; for (auto x = 0; x < 239; x++) { scanline[x + 1] = scanline[x]; @@ -541,16 +541,16 @@ void gba_lcd_device::draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, dispcn } } -void gba_lcd_device::draw_roz_scanline(UINT32 *scanline, int ypos, dispcnt bg_enable, UINT32 ctrl, INT32 X, INT32 Y, INT32 PA, INT32 PB, INT32 PC, INT32 PD, internal_reg ¤tx, internal_reg ¤ty) +void gba_lcd_device::draw_roz_scanline(uint32_t *scanline, int ypos, dispcnt bg_enable, uint32_t ctrl, int32_t X, int32_t Y, int32_t PA, int32_t PB, int32_t PC, int32_t PD, internal_reg ¤tx, internal_reg ¤ty) { if (!is_set(bg_enable)) return; - UINT8 *mgba_vram = (UINT8 *)m_vram.get(); - UINT16 *pgba_pram = (UINT16 *)m_pram.get(); - UINT32 priority = (bg_priority(ctrl) << 25) + 0x1000000; - UINT32 base = bg_char_base(ctrl); - UINT32 mapbase = bg_screen_base(ctrl); + uint8_t *mgba_vram = (uint8_t *)m_vram.get(); + uint16_t *pgba_pram = (uint16_t *)m_pram.get(); + uint32_t priority = (bg_priority(ctrl) << 25) + 0x1000000; + uint32_t base = bg_char_base(ctrl); + uint32_t mapbase = bg_screen_base(ctrl); // size of map in submaps int width, height; @@ -584,19 +584,19 @@ void gba_lcd_device::draw_roz_scanline(UINT32 *scanline, int ypos, dispcnt bg_en currenty.status += PD; } - INT32 cx = currentx.status; - INT32 cy = currenty.status; + int32_t cx = currentx.status; + int32_t cy = currenty.status; if (is_set(ctrl, bgcnt::mosaic_en)) { - UINT16 mosaic_line = mosaic_size(size_type::bg_v); + uint16_t mosaic_line = mosaic_size(size_type::bg_v); int y = ypos % mosaic_line; cx -= y * PB; cy -= y * PD; } - INT32 pixx = cx >> 8; - INT32 pixy = cy >> 8; + int32_t pixx = cx >> 8; + int32_t pixy = cy >> 8; if (is_set(ctrl, bgcnt::wraparound_en)) { @@ -618,8 +618,8 @@ void gba_lcd_device::draw_roz_scanline(UINT32 *scanline, int ypos, dispcnt bg_en int tiley = pixy & 7; // shall we shift for is_set(ctrl, bgcnt::palette_256)? or is not effective for ROZ? - UINT32 tile = mgba_vram[mapbase + (pixx >> 3) + (pixy >> 3) * (width >> 3)]; - UINT16 pixel = mgba_vram[base + (tile << 6) + (tiley << 3) + tilex]; + uint32_t tile = mgba_vram[mapbase + (pixx >> 3) + (pixy >> 3) * (width >> 3)]; + uint16_t pixel = mgba_vram[base + (tile << 6) + (tiley << 3) + tilex]; // plot it if (pixel) @@ -647,7 +647,7 @@ void gba_lcd_device::draw_roz_scanline(UINT32 *scanline, int ypos, dispcnt bg_en if (is_set(ctrl, bgcnt::mosaic_en)) { - UINT16 mosaicx = mosaic_size(size_type::bg_h); + uint16_t mosaicx = mosaic_size(size_type::bg_h); if (mosaicx > 1) { int m = 1; @@ -665,24 +665,24 @@ void gba_lcd_device::draw_roz_scanline(UINT32 *scanline, int ypos, dispcnt bg_en } } -void gba_lcd_device::draw_bg_scanline(UINT32 *scanline, int ypos, dispcnt bg_enable, UINT32 ctrl, UINT32 hofs, UINT32 vofs) +void gba_lcd_device::draw_bg_scanline(uint32_t *scanline, int ypos, dispcnt bg_enable, uint32_t ctrl, uint32_t hofs, uint32_t vofs) { if (!is_set(bg_enable)) return; - UINT8 *vram = (UINT8*)m_vram.get(); - UINT16 *palette = (UINT16 *)m_pram.get(); - UINT8 *chardata = &vram[bg_char_base(ctrl)]; - UINT16 *screendata = (UINT16 *)&vram[bg_screen_base(ctrl)]; - UINT32 priority = (bg_priority(ctrl) << 25) + 0x1000000; - UINT16 mosaicx = mosaic_size(size_type::bg_h); - UINT16 mosaicy = mosaic_size(size_type::bg_v); + uint8_t *vram = (uint8_t*)m_vram.get(); + uint16_t *palette = (uint16_t *)m_pram.get(); + uint8_t *chardata = &vram[bg_char_base(ctrl)]; + uint16_t *screendata = (uint16_t *)&vram[bg_screen_base(ctrl)]; + uint32_t priority = (bg_priority(ctrl) << 25) + 0x1000000; + uint16_t mosaicx = mosaic_size(size_type::bg_h); + uint16_t mosaicy = mosaic_size(size_type::bg_v); int width, height; bg_screen_size(ctrl, true, width, height); - INT32 pixx = hofs % width; - INT32 pixy = (vofs + ypos) % height; + int32_t pixx = hofs % width; + int32_t pixy = (vofs + ypos) % height; if (is_set(ctrl, bgcnt::mosaic_en) && ypos % mosaicy) { @@ -700,18 +700,18 @@ void gba_lcd_device::draw_bg_scanline(UINT32 *scanline, int ypos, dispcnt bg_ena } } - INT32 stride = (pixy >> 3) << 5; + int32_t stride = (pixy >> 3) << 5; - UINT16 *src = screendata + 0x400 * (pixx >> 8) + ((pixx & 255) >> 3) + stride; + uint16_t *src = screendata + 0x400 * (pixx >> 8) + ((pixx & 255) >> 3) + stride; for (auto x = 0; x < 240; x++) { - UINT16 data = *src; - INT32 tile = tile_number(data); - INT32 tilex = pixx & 7; - INT32 tiley = pixy & 7; - UINT8 color; - UINT8 palindex; + uint16_t data = *src; + int32_t tile = tile_number(data); + int32_t tilex = pixx & 7; + int32_t tiley = pixy & 7; + uint8_t color; + uint8_t palindex; if (tile_hflip(data)) tilex = 7 - tilex; @@ -770,7 +770,7 @@ void gba_lcd_device::draw_bg_scanline(UINT32 *scanline, int ypos, dispcnt bg_ena if (is_set(ctrl, bgcnt::mosaic_en) && mosaicx > 1) { - INT32 m = 1; + int32_t m = 1; for (auto x = 0; x < 239; x++) { scanline[x+1] = scanline[x]; @@ -784,13 +784,13 @@ void gba_lcd_device::draw_bg_scanline(UINT32 *scanline, int ypos, dispcnt bg_ena } } -void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) +void gba_lcd_device::draw_oam_window(uint32_t *scanline, int y) { if (!is_set(dispcnt::obj_win_en)) return; - UINT16 *oam = (UINT16 *)m_oam.get(); - UINT8 *src = (UINT8 *)m_vram.get(); + uint16_t *oam = (uint16_t *)m_oam.get(); + uint8_t *src = (uint8_t *)m_vram.get(); for (auto obj_index = 127; obj_index >= 0; obj_index--) { @@ -799,13 +799,13 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) if (obj.mode_enum() != object::mode::window) continue; - UINT32 tile_number = obj.tile_number(); + uint32_t tile_number = obj.tile_number(); if (bg_video_mode() > 2 && tile_number < 0x200) continue; - INT32 sx = obj.pos_x(); - INT32 sy = obj.pos_y(); + int32_t sx = obj.pos_x(); + int32_t sy = obj.pos_y(); if (sy > 160) sy -= 256; @@ -815,8 +815,8 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) if (obj.roz()) { - INT32 fx = width; - INT32 fy = height; + int32_t fx = width; + int32_t fy = height; if (obj.roz_double()) { @@ -824,7 +824,7 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) fy *= 2; } - INT32 cury = y - sy; + int32_t cury = y - sy; if (cury < 0 || cury >= fy) continue; @@ -833,13 +833,13 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) continue; int rot = obj.roz_param(); - INT16 dx = (INT16)oam[(rot << 4) + 3]; - INT16 dmx = (INT16)oam[(rot << 4) + 7]; - INT16 dy = (INT16)oam[(rot << 4) + 11]; - INT16 dmy = (INT16)oam[(rot << 4) + 15]; + int16_t dx = (int16_t)oam[(rot << 4) + 3]; + int16_t dmx = (int16_t)oam[(rot << 4) + 7]; + int16_t dy = (int16_t)oam[(rot << 4) + 11]; + int16_t dmy = (int16_t)oam[(rot << 4) + 15]; - INT32 rx = (width << 7) - (fx >> 1) * dx - (fy >> 1) * dmx + cury * dmx; - INT32 ry = (height << 7) - (fx >> 1) * dy - (fy >> 1) * dmy + cury * dmy; + int32_t rx = (width << 7) - (fx >> 1) * dx - (fy >> 1) * dmx + cury * dmx; + int32_t ry = (height << 7) - (fx >> 1) * dy - (fy >> 1) * dmy + cury * dmy; int inc = 32; @@ -852,12 +852,12 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) for (auto x = 0; x < fx; x++) { - INT32 ax = rx >> 8; - INT32 ay = ry >> 8; + int32_t ax = rx >> 8; + int32_t ay = ry >> 8; if (ax >= 0 && ax < sx && ay >= 0 && ay < sy) { - UINT8 color = src[0x10000 + ((((tile_number + (ay >> 3) * inc) << 5) + ((ay & 0x07) << 3) + ((ax >> 3) << 6) + (ax & 0x07)) & 0x7fff)]; + uint8_t color = src[0x10000 + ((((tile_number + (ay >> 3) * inc) << 5) + ((ay & 0x07) << 3) + ((ax >> 3) << 6) + (ax & 0x07)) & 0x7fff)]; if (color) scanline[sx] = 1; @@ -875,12 +875,12 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) for (auto x = 0; x < fx; x++) { - INT32 ax = rx >> 8; - INT32 ay = ry >> 8; + int32_t ax = rx >> 8; + int32_t ay = ry >> 8; if (ax >= 0 && ax < sx && ay >= 0 && ay < sy) { - UINT8 color = src[0x10000 + ((((tile_number + (ay >> 3) * inc) << 5) + ((ay & 0x07) << 2) + ((ax >> 3) << 5) + ((ax & 0x07) >> 1)) & 0x7fff)]; + uint8_t color = src[0x10000 + ((((tile_number + (ay >> 3) * inc) << 5) + ((ay & 0x07) << 2) + ((ax >> 3) << 5) + ((ax & 0x07) >> 1)) & 0x7fff)]; if (ax & 1) color >>= 4; @@ -903,7 +903,7 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) if (obj.roz_double()) continue; - INT32 cury = y - sy; + int32_t cury = y - sy; if (cury < 0 || cury >= height) continue; @@ -916,7 +916,7 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) if (obj.vflip()) cury = height - cury - 1; - INT32 ax = obj.hflip() ? (width - 1) : 0; + int32_t ax = obj.hflip() ? (width - 1) : 0; if (obj.palette_256()) { @@ -925,7 +925,7 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) else tile_number &= 0x3fe; - UINT32 address = 0x10000 + ((((tile_number + (cury >> 3) * inc) << 5) + ((cury & 7) << 3) + ((ax >> 3) << 6) + (ax & 7)) & 0x7fff); + uint32_t address = 0x10000 + ((((tile_number + (cury >> 3) * inc) << 5) + ((cury & 7) << 3) + ((ax >> 3) << 6) + (ax & 7)) & 0x7fff); if (obj.hflip()) ax = 7; @@ -934,7 +934,7 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) { if (sx < 240) { - UINT8 color = src[address]; + uint8_t color = src[address]; if (color) scanline[sx] = 1; @@ -977,7 +977,7 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) if (is_set(dispcnt::vram_map_1d)) inc = width >> 3; - UINT32 address = 0x10000 + ((((tile_number + (cury >> 3) * inc) << 5) + ((cury & 0x07) << 2) + ((ax >> 3) << 5) + ((ax & 0x07) >> 1)) & 0x7fff); + uint32_t address = 0x10000 + ((((tile_number + (cury >> 3) * inc) << 5) + ((cury & 0x07) << 2) + ((ax >> 3) << 5) + ((ax & 0x07) >> 1)) & 0x7fff); if (obj.hflip()) { @@ -987,7 +987,7 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) { if (sx < 240) { - UINT8 color = src[address]; + uint8_t color = src[address]; if (x & 1) color >>= 4; else @@ -1019,7 +1019,7 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) { if (sx < 240) { - UINT8 color = src[address]; + uint8_t color = src[address]; if (x & 1) color >>= 4; @@ -1051,17 +1051,17 @@ void gba_lcd_device::draw_oam_window(UINT32 *scanline, int y) } } -void gba_lcd_device::draw_oam(UINT32 *scanline, int y) +void gba_lcd_device::draw_oam(uint32_t *scanline, int y) { if (!is_set(dispcnt::obj_en)) return; - INT32 mosaiccnt = 0; - UINT16 mosaicx = mosaic_size(size_type::obj_h); - UINT16 mosaicy = mosaic_size(size_type::obj_v); - UINT16 *oam = (UINT16 *)m_oam.get(); - UINT8 *src = (UINT8 *)m_vram.get(); - UINT16 *palette = (UINT16 *)m_pram.get(); + int32_t mosaiccnt = 0; + uint16_t mosaicx = mosaic_size(size_type::obj_h); + uint16_t mosaicy = mosaic_size(size_type::obj_v); + uint16_t *oam = (uint16_t *)m_oam.get(); + uint8_t *src = (uint8_t *)m_vram.get(); + uint16_t *palette = (uint16_t *)m_pram.get(); for (auto obj_index = 0; obj_index < 128; obj_index++) { @@ -1070,27 +1070,27 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) if (obj.mode_enum() == object::mode::window) continue; - UINT32 priority = obj.priority(); - UINT32 prio = (priority << 25) | (obj.mode_mask() << 6); + uint32_t priority = obj.priority(); + uint32_t prio = (priority << 25) | (obj.mode_mask() << 6); int width, height; obj.size(width, height); - UINT32 tile_number = obj.tile_number(); + uint32_t tile_number = obj.tile_number(); if (bg_video_mode() > 2 && tile_number < 0x200) continue; if (obj.roz()) { - INT32 sx = obj.pos_x(); - INT32 sy = obj.pos_y(); + int32_t sx = obj.pos_x(); + int32_t sy = obj.pos_y(); if (sy > 160) sy -= 256; - INT32 fx = width; - INT32 fy = height; + int32_t fx = width; + int32_t fy = height; if (obj.roz_double()) { @@ -1098,7 +1098,7 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) fy *= 2; } - INT32 cury = y - sy; + int32_t cury = y - sy; if (cury < 0 || cury >= fy) continue; @@ -1106,20 +1106,20 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) if (sx >= 240 && ((sx + fx) % 512) >= 240) continue; - INT32 oamparam = obj.roz_param(); + int32_t oamparam = obj.roz_param(); - INT16 dx = (INT16)oam[(oamparam << 4) + 3]; - INT16 dmx = (INT16)oam[(oamparam << 4) + 7]; - INT16 dy = (INT16)oam[(oamparam << 4) + 11]; - INT16 dmy = (INT16)oam[(oamparam << 4) + 15]; + int16_t dx = (int16_t)oam[(oamparam << 4) + 3]; + int16_t dmx = (int16_t)oam[(oamparam << 4) + 7]; + int16_t dy = (int16_t)oam[(oamparam << 4) + 11]; + int16_t dmy = (int16_t)oam[(oamparam << 4) + 15]; if (obj.mosaic()) cury -= (cury % mosaicy); - INT32 rx = (width << 7) - (fx >> 1) * dx - (fy >> 1) * dmx + cury * dmx; - INT32 ry = (height << 7) - (fx >> 1) * dy - (fy >> 1) * dmy + cury * dmy; + int32_t rx = (width << 7) - (fx >> 1) * dx - (fy >> 1) * dmx + cury * dmx; + int32_t ry = (height << 7) - (fx >> 1) * dy - (fy >> 1) * dmy + cury * dmy; - INT32 inc = 32; + int32_t inc = 32; if (obj.palette_256()) { @@ -1130,12 +1130,12 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) for (auto x = 0; x < fx; x++) { - INT32 pixx = rx >> 8; - INT32 pixy = ry >> 8; + int32_t pixx = rx >> 8; + int32_t pixy = ry >> 8; if (!(pixx < 0 || pixx >= width || pixy < 0 || pixy >= height || sx >= 240)) { - UINT8 color = src[0x10000 + ((((tile_number + (pixy >> 3) * inc) << 5) + ((pixy & 7) << 3) + ((pixx >> 3) << 6) + (pixx & 7)) & 0x7fff)]; + uint8_t color = src[0x10000 + ((((tile_number + (pixy >> 3) * inc) << 5) + ((pixy & 7) << 3) + ((pixx >> 3) << 6) + (pixx & 7)) & 0x7fff)]; if (color == 0 && priority < ((scanline[sx] >> 25) & 3)) { @@ -1170,12 +1170,12 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) for (auto x = 0; x < fx; x++) { - INT32 pixx = rx >> 8; - INT32 pixy = ry >> 8; + int32_t pixx = rx >> 8; + int32_t pixy = ry >> 8; if (!(pixx < 0 || pixx >= width || pixy < 0 || pixy >= height || sx >= 240)) { - UINT8 color = src[0x10000 + ((((tile_number + (pixy >> 3) * inc) << 5) + ((pixy & 7) << 2) + ((pixx >> 3) << 5) + ((pixx & 7) >> 1)) & 0x7fff)]; + uint8_t color = src[0x10000 + ((((tile_number + (pixy >> 3) * inc) << 5) + ((pixy & 7) << 2) + ((pixx >> 3) << 5) + ((pixx & 7) >> 1)) & 0x7fff)]; if (pixx & 1) color >>= 4; @@ -1215,13 +1215,13 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) if (obj.roz_double()) continue; - INT32 sx = obj.pos_x(); - INT32 sy = obj.pos_y(); + int32_t sx = obj.pos_x(); + int32_t sy = obj.pos_y(); if (sy > 160) sy -= 256; - INT32 cury = y - sy; + int32_t cury = y - sy; if (cury < 0 || cury >= height) continue; @@ -1229,12 +1229,12 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) if (sx >= 240 && ((sx + width) % 512) >= 240) continue; - INT32 inc = 32; + int32_t inc = 32; if (obj.vflip()) cury = height - cury - 1; - INT32 pixx = obj.hflip() ? (width - 1) : 0; + int32_t pixx = obj.hflip() ? (width - 1) : 0; if (obj.mosaic()) cury -= (cury % mosaicy); @@ -1246,7 +1246,7 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) else tile_number &= 0x3fe; - UINT32 address = 0x10000 + ((((tile_number + (cury >> 3) * inc) << 5) + ((cury & 7) << 3) + ((pixx >> 3) << 6) + (pixx & 7)) & 0x7fff); + uint32_t address = 0x10000 + ((((tile_number + (cury >> 3) * inc) << 5) + ((cury & 7) << 3) + ((pixx >> 3) << 6) + (pixx & 7)) & 0x7fff); if (obj.hflip()) pixx = 7; @@ -1255,7 +1255,7 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) { if (sx < 240) { - UINT8 color = src[address]; + uint8_t color = src[address]; if (color == 0 && priority < ((scanline[sx] >> 25) & 3)) { @@ -1315,7 +1315,7 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) if (is_set(dispcnt::vram_map_1d)) inc = width >> 3; - UINT32 address = 0x10000 + ((((tile_number + (cury >> 3) * inc) << 5) + ((cury & 7) << 2) + ((pixx >> 3) << 5) + ((pixx & 7) >> 1)) & 0x7fff); + uint32_t address = 0x10000 + ((((tile_number + (cury >> 3) * inc) << 5) + ((cury & 7) << 2) + ((pixx >> 3) << 5) + ((pixx & 7) >> 1)) & 0x7fff); if (obj.hflip()) { @@ -1324,7 +1324,7 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) { if (sx < 240) { - UINT8 color = src[address]; + uint8_t color = src[address]; if (x & 1) color >>= 4; @@ -1371,7 +1371,7 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) { if (sx < 240) { - UINT8 color = src[address]; + uint8_t color = src[address]; if (x & 1) color >>= 4; @@ -1422,10 +1422,10 @@ void gba_lcd_device::draw_oam(UINT32 *scanline, int y) inline bool gba_lcd_device::is_in_window_h(int x, int window) { - UINT16 reg = (window == 0) ? WIN0H : WIN1H; + uint16_t reg = (window == 0) ? WIN0H : WIN1H; - UINT8 x0 = reg >> 8; - UINT8 x1 = reg & 0x00ff; + uint8_t x0 = reg >> 8; + uint8_t x1 = reg & 0x00ff; if (x0 <= x1) { @@ -1443,10 +1443,10 @@ inline bool gba_lcd_device::is_in_window_h(int x, int window) inline bool gba_lcd_device::is_in_window_v(int y, int window) { - UINT16 reg = (window == 0) ? WIN0V : WIN1V; + uint16_t reg = (window == 0) ? WIN0V : WIN1V; - UINT8 v0 = reg >> 8; - UINT8 v1 = reg & 0x00ff; + uint8_t v0 = reg >> 8; + uint8_t v1 = reg & 0x00ff; if ((v0 == v1) && (v0 >= 0xe8)) return true; @@ -1470,7 +1470,7 @@ static const int coeff[32] = { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }; -inline UINT32 gba_lcd_device::alpha_blend(UINT32 color0, UINT32 color1) +inline uint32_t gba_lcd_device::alpha_blend(uint32_t color0, uint32_t color1) { int ca = coeff[BLDALPHA & 0x1f]; int cb = coeff[(BLDALPHA >> 8) & 0x1f]; @@ -1497,7 +1497,7 @@ inline UINT32 gba_lcd_device::alpha_blend(UINT32 color0, UINT32 color1) return color0; } -inline UINT32 gba_lcd_device::increase_brightness(UINT32 color) +inline uint32_t gba_lcd_device::increase_brightness(uint32_t color) { int cc = coeff[BLDY & 0x1f]; @@ -1516,7 +1516,7 @@ inline UINT32 gba_lcd_device::increase_brightness(UINT32 color) return (color & 0xffff0000) | (b << 10) | (g << 5) | r; } -inline UINT32 gba_lcd_device::decrease_brightness(UINT32 color) +inline uint32_t gba_lcd_device::decrease_brightness(uint32_t color) { int cc = coeff[BLDY & 0x1f]; @@ -1553,7 +1553,7 @@ static const char *reg_names[] = { READ32_MEMBER(gba_lcd_device::video_r) { - UINT32 retval = 0; + uint32_t retval = 0; switch (offset) { @@ -1618,7 +1618,7 @@ WRITE32_MEMBER(gba_lcd_device::video_w) } } -static inline UINT32 combine_data_32_16(UINT32 prev, UINT32 data, UINT32 mem_mask) +static inline uint32_t combine_data_32_16(uint32_t prev, uint32_t data, uint32_t mem_mask) { COMBINE_DATA(&prev); @@ -1757,11 +1757,11 @@ TIMER_CALLBACK_MEMBER(gba_lcd_device::perform_scan) PALETTE_INIT_MEMBER(gba_lcd_device, gba) { - for (UINT8 b = 0; b < 32; b++) + for (uint8_t b = 0; b < 32; b++) { - for (UINT8 g = 0; g < 32; g++) + for (uint8_t g = 0; g < 32; g++) { - for (UINT8 r = 0; r < 32; r++) + for (uint8_t r = 0; r < 32; r++) { palette.set_pen_color((b << 10) | (g << 5) | r, pal5bit(r), pal5bit(g), pal5bit(b)); } @@ -1769,7 +1769,7 @@ PALETTE_INIT_MEMBER(gba_lcd_device, gba) } } -UINT32 gba_lcd_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gba_lcd_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); @@ -1785,9 +1785,9 @@ void gba_lcd_device::device_start() m_dma_hblank_cb.resolve(); m_dma_vblank_cb.resolve(); - m_pram = make_unique_clear(0x400 / 4); - m_vram = make_unique_clear(0x18000 / 4); - m_oam = make_unique_clear(0x400 / 4); + m_pram = make_unique_clear(0x400 / 4); + m_vram = make_unique_clear(0x18000 / 4); + m_oam = make_unique_clear(0x400 / 4); m_screen->register_screen_bitmap(m_bitmap); diff --git a/src/devices/video/gba_lcd.h b/src/devices/video/gba_lcd.h index e71fa745243..9632cc4d25c 100644 --- a/src/devices/video/gba_lcd.h +++ b/src/devices/video/gba_lcd.h @@ -61,24 +61,24 @@ protected: static constexpr unsigned REG_BASE = BASE; // 32-bit Register - UINT32 &WORD(unsigned x) { return m_regs[(x - REG_BASE) / 4]; } - const UINT32 &WORD(unsigned x) const { return m_regs[(x - REG_BASE) / 4]; } + uint32_t &WORD(unsigned x) { return m_regs[(x - REG_BASE) / 4]; } + const uint32_t &WORD(unsigned x) const { return m_regs[(x - REG_BASE) / 4]; } // 16-bit Register, Upper Half-Word - UINT16 HWHI(unsigned x) const { return UINT16(WORD(x) >> 16); } + uint16_t HWHI(unsigned x) const { return uint16_t(WORD(x) >> 16); } // 16-bit Register, Lower Half-Word - UINT16 HWLO(unsigned x) const { return UINT16(WORD(x)); } + uint16_t HWLO(unsigned x) const { return uint16_t(WORD(x)); } - UINT32 &WORD_SET(unsigned x, UINT32 y) { return WORD(x) |= y; } - UINT32 &HWHI_SET(unsigned x, UINT16 y) { return WORD(x) |= UINT32(y) << 16; } - UINT32 &HWLO_SET(unsigned x, UINT16 y) { return WORD(x) |= UINT32(y); } + uint32_t &WORD_SET(unsigned x, uint32_t y) { return WORD(x) |= y; } + uint32_t &HWHI_SET(unsigned x, uint16_t y) { return WORD(x) |= uint32_t(y) << 16; } + uint32_t &HWLO_SET(unsigned x, uint16_t y) { return WORD(x) |= uint32_t(y); } - UINT32 &WORD_RESET(unsigned x, UINT32 y) { return WORD(x) &= ~y; } - UINT32 &HWHI_RESET(unsigned x, UINT16 y) { return WORD(x) &= ~(UINT32(y) << 16); } - UINT32 &HWLO_RESET(unsigned x, UINT16 y) { return WORD(x) &= ~UINT32(y); } + uint32_t &WORD_RESET(unsigned x, uint32_t y) { return WORD(x) &= ~y; } + uint32_t &HWHI_RESET(unsigned x, uint16_t y) { return WORD(x) &= ~(uint32_t(y) << 16); } + uint32_t &HWLO_RESET(unsigned x, uint16_t y) { return WORD(x) &= ~uint32_t(y); } - UINT32 m_regs[COUNT]; + uint32_t m_regs[COUNT]; }; @@ -88,9 +88,9 @@ class gba_lcd_device , protected gba_registers<0x060 / 4, 0x000> { public: - gba_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gba_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - 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); DECLARE_READ32_MEMBER(video_r); DECLARE_WRITE32_MEMBER(video_w); @@ -138,14 +138,14 @@ protected: private: struct internal_reg { - INT32 status; + int32_t status; bool update; }; internal_reg m_bg2x, m_bg2y, m_bg3x, m_bg3y; - UINT8 bg_video_mode(); + uint8_t bg_video_mode(); - enum class dispcnt : UINT16 + enum class dispcnt : uint16_t { alt_frame_sel = 0x0010, vram_map_1d = 0x0040, @@ -161,7 +161,7 @@ private: }; bool is_set(dispcnt flag); - enum class dispstat : UINT16 + enum class dispstat : uint16_t { vblank = 0x0001, hblank = 0x0002, @@ -174,18 +174,18 @@ private: void clear(dispstat flag); bool is_set(dispstat flag); - enum class bgcnt : UINT16 + enum class bgcnt : uint16_t { mosaic_en = 0x0040, palette_256 = 0x0080, wraparound_en = 0x2000 }; - bool is_set(UINT16 bgxcnt, bgcnt flag); + bool is_set(uint16_t bgxcnt, bgcnt flag); - UINT8 bg_priority(UINT16 bgxcnt); - UINT32 bg_char_base(UINT16 bgxcnt); - UINT32 bg_screen_base(UINT16 bgxcnt); - void bg_screen_size(UINT16 bgxcnt, bool text, int &width, int &height); + uint8_t bg_priority(uint16_t bgxcnt); + uint32_t bg_char_base(uint16_t bgxcnt); + uint32_t bg_screen_base(uint16_t bgxcnt); + void bg_screen_size(uint16_t bgxcnt, bool text, int &width, int &height); enum class size_type { @@ -194,9 +194,9 @@ private: obj_h, obj_v }; - UINT16 mosaic_size(size_type type); + uint16_t mosaic_size(size_type type); - enum class sfx : UINT16 + enum class sfx : uint16_t { none = 0x0000, alpha = 0x0040, @@ -210,26 +210,26 @@ private: first = 0, second }; - UINT8 color_sfx_target(target id); - - UINT16 tile_number(UINT16 vram_data) { return vram_data & 0x03ff; } - bool tile_hflip(UINT16 vram_data) { return vram_data & 0x0400; } - bool tile_vflip(UINT16 vram_data) { return vram_data & 0x0800; } - - void update_mask(UINT8 *mask, int y); - void draw_roz_bitmap_scanline(UINT32 *scanline, int ypos, dispcnt bg_enable, UINT32 ctrl, INT32 X, INT32 Y, INT32 PA, INT32 PB, INT32 PC, INT32 PD, internal_reg ¤tx, internal_reg ¤ty, int depth); - void draw_roz_scanline(UINT32 *scanline, int ypos, dispcnt bg_enable, UINT32 ctrl, INT32 X, INT32 Y, INT32 PA, INT32 PB, INT32 PC, INT32 PD, internal_reg ¤tx, internal_reg ¤ty); - void draw_bg_scanline(UINT32 *scanline, int ypos, dispcnt bg_enable, UINT32 ctrl, UINT32 hofs, UINT32 vofs); - void draw_oam_window(UINT32 *scanline, int y); - void draw_oam(UINT32 *scanline, int y); + uint8_t color_sfx_target(target id); + + uint16_t tile_number(uint16_t vram_data) { return vram_data & 0x03ff; } + bool tile_hflip(uint16_t vram_data) { return vram_data & 0x0400; } + bool tile_vflip(uint16_t vram_data) { return vram_data & 0x0800; } + + void update_mask(uint8_t *mask, int y); + void draw_roz_bitmap_scanline(uint32_t *scanline, int ypos, dispcnt bg_enable, uint32_t ctrl, int32_t X, int32_t Y, int32_t PA, int32_t PB, int32_t PC, int32_t PD, internal_reg ¤tx, internal_reg ¤ty, int depth); + void draw_roz_scanline(uint32_t *scanline, int ypos, dispcnt bg_enable, uint32_t ctrl, int32_t X, int32_t Y, int32_t PA, int32_t PB, int32_t PC, int32_t PD, internal_reg ¤tx, internal_reg ¤ty); + void draw_bg_scanline(uint32_t *scanline, int ypos, dispcnt bg_enable, uint32_t ctrl, uint32_t hofs, uint32_t vofs); + void draw_oam_window(uint32_t *scanline, int y); + void draw_oam(uint32_t *scanline, int y); void draw_scanline(int y); bool is_in_window_h(int x, int window); bool is_in_window_v(int y, int window); - UINT32 alpha_blend(UINT32 color0, UINT32 color1); - UINT32 increase_brightness(UINT32 color); - UINT32 decrease_brightness(UINT32 color); + uint32_t alpha_blend(uint32_t color0, uint32_t color1); + uint32_t increase_brightness(uint32_t color); + uint32_t decrease_brightness(uint32_t color); devcb_write_line m_int_hblank_cb; /* H-Blank interrupt callback function */ devcb_write_line m_int_vblank_cb; /* V-Blank interrupt callback function */ @@ -237,18 +237,18 @@ private: devcb_write_line m_dma_hblank_cb; /* H-Blank DMA request callback function */ devcb_write_line m_dma_vblank_cb; /* V-Blank DMA request callback function */ - std::unique_ptr m_pram; - std::unique_ptr m_vram; - std::unique_ptr m_oam; + std::unique_ptr m_pram; + std::unique_ptr m_vram; + std::unique_ptr m_oam; emu_timer *m_scan_timer, *m_hbl_timer; bitmap_ind16 m_bitmap; - UINT32 m_scanline[6][240]; + uint32_t m_scanline[6][240]; // constants - static constexpr UINT32 TRANSPARENT_PIXEL = 0x80000000; + static constexpr uint32_t TRANSPARENT_PIXEL = 0x80000000; }; #endif /* GBA_LCD_H_ */ diff --git a/src/devices/video/gf4500.cpp b/src/devices/video/gf4500.cpp index 4ad49d4acf7..36927109fa1 100644 --- a/src/devices/video/gf4500.cpp +++ b/src/devices/video/gf4500.cpp @@ -26,7 +26,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, c } } -#define BITS(x,m,n) (((x)>>(n))&(((UINT32)1<<((m)-(n)+1))-1)) +#define BITS(x,m,n) (((x)>>(n))&(((uint32_t)1<<((m)-(n)+1))-1)) #define GF4500_FRAMEBUF_OFFSET 0x20000 @@ -34,7 +34,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, c const device_type GF4500 = &device_creator; -gf4500_device::gf4500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gf4500_device::gf4500_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GF4500, "NVIDIA GoForce 4500", tag, owner, clock, "gf4500", __FILE__), m_data(nullptr), m_screen_x(0), m_screen_y(0), m_screen_x_max(0), m_screen_y_max(0), m_screen_x_min(0), m_screen_y_min(0) { } @@ -56,7 +56,7 @@ void gf4500_device::device_config_complete() void gf4500_device::device_start() { - m_data = make_unique_clear(0x140000/4); + m_data = make_unique_clear(0x140000/4); save_pointer(NAME(m_data.get()), 0x140000/4); save_item(NAME(m_screen_x)); @@ -78,32 +78,32 @@ void gf4500_device::device_reset() } -void gf4500_device::vram_write16( UINT16 data ) +void gf4500_device::vram_write16( uint16_t data ) { if ((m_screen_x < m_screen_x_max) && (m_screen_y < m_screen_y_max)) { - UINT16 *vram = (UINT16 *)((UINT8 *)m_data.get() + GF4500_FRAMEBUF_OFFSET + (((m_screen_y_min + m_screen_y) * (320 + 1)) + (m_screen_x_min + m_screen_x)) * 2); + uint16_t *vram = (uint16_t *)((uint8_t *)m_data.get() + GF4500_FRAMEBUF_OFFSET + (((m_screen_y_min + m_screen_y) * (320 + 1)) + (m_screen_x_min + m_screen_x)) * 2); *vram = data; m_screen_x++; } } -static rgb_t gf4500_get_color_16( UINT16 data ) +static rgb_t gf4500_get_color_16( uint16_t data ) { - UINT8 r, g, b; + uint8_t r, g, b; r = BITS(data, 15, 11) << 3; g = BITS(data, 10, 5) << 2; b = BITS(data, 4, 0) << 3; return rgb_t(r, g, b); } -UINT32 gf4500_device::screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t gf4500_device::screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT16 *vram = (UINT16 *)(m_data.get() + GF4500_FRAMEBUF_OFFSET / 4); + uint16_t *vram = (uint16_t *)(m_data.get() + GF4500_FRAMEBUF_OFFSET / 4); int x, y; for (y = 0; y < 240; y++) { - UINT32 *scanline = &bitmap.pix32(y); + uint32_t *scanline = &bitmap.pix32(y); for (x = 0; x < 320; x++) { *scanline++ = gf4500_get_color_16(*vram++); @@ -115,7 +115,7 @@ UINT32 gf4500_device::screen_update(screen_device &device, bitmap_rgb32 &bitmap, READ32_MEMBER( gf4500_device::read ) { - UINT32 data = m_data[offset]; + uint32_t data = m_data[offset]; switch (offset) { case 0x4c / 4: diff --git a/src/devices/video/gf4500.h b/src/devices/video/gf4500.h index aa8bf8ebf63..35cc432b8b4 100644 --- a/src/devices/video/gf4500.h +++ b/src/devices/video/gf4500.h @@ -15,14 +15,14 @@ class gf4500_device : public device_t { public: - gf4500_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gf4500_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~gf4500_device() {} DECLARE_READ32_MEMBER( read ); DECLARE_WRITE32_MEMBER( write ); - UINT32 screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -33,9 +33,9 @@ protected: private: // internal state - void vram_write16(UINT16 data); + void vram_write16(uint16_t data); - std::unique_ptr m_data; + std::unique_ptr m_data; int m_screen_x; int m_screen_y; int m_screen_x_max; diff --git a/src/devices/video/gf7600gs.cpp b/src/devices/video/gf7600gs.cpp index 85b6b2f06da..8c79865d490 100644 --- a/src/devices/video/gf7600gs.cpp +++ b/src/devices/video/gf7600gs.cpp @@ -13,7 +13,7 @@ ADDRESS_MAP_END DEVICE_ADDRESS_MAP_START(map3, 32, geforce_7600gs_device) ADDRESS_MAP_END -geforce_7600gs_device::geforce_7600gs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +geforce_7600gs_device::geforce_7600gs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, GEFORCE_7600GS, "NVidia GeForce 7600GS", tag, owner, clock, "geforce_7600gs", __FILE__) { } diff --git a/src/devices/video/gf7600gs.h b/src/devices/video/gf7600gs.h index ddd36edae40..f2a44ca903a 100644 --- a/src/devices/video/gf7600gs.h +++ b/src/devices/video/gf7600gs.h @@ -10,7 +10,7 @@ class geforce_7600gs_device : public pci_device { public: - geforce_7600gs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + geforce_7600gs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/video/hd44102.cpp b/src/devices/video/hd44102.cpp index e9a1a9d014d..6598cbceb10 100644 --- a/src/devices/video/hd44102.cpp +++ b/src/devices/video/hd44102.cpp @@ -67,7 +67,7 @@ inline void hd44102_device::count_up_or_down() // hd44102_device - constructor //------------------------------------------------- -hd44102_device::hd44102_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd44102_device::hd44102_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HD44102, "HD44102", tag, owner, clock, "hd44102", __FILE__), device_video_interface(mconfig, *this), m_cs2(0), @@ -127,7 +127,7 @@ void hd44102_device::device_reset() READ8_MEMBER( hd44102_device::read ) { - UINT8 data = 0; + uint8_t data = 0; if (m_cs2) { @@ -228,7 +228,7 @@ WRITE8_MEMBER( hd44102_device::control_w ) READ8_MEMBER( hd44102_device::data_r ) { - UINT8 data = m_output; + uint8_t data = m_output; m_output = m_ram[m_x][m_y]; @@ -264,7 +264,7 @@ WRITE_LINE_MEMBER( hd44102_device::cs2_w ) // update_screen - update screen //------------------------------------------------- -UINT32 hd44102_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hd44102_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y = 0; y < 50; y++) { @@ -272,7 +272,7 @@ UINT32 hd44102_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap for (int x = 0; x < 32; x++) { - UINT8 data = m_ram[z / 8][y]; + uint8_t data = m_ram[z / 8][y]; int sy = m_sy + z; int sx = m_sx + y; diff --git a/src/devices/video/hd44102.h b/src/devices/video/hd44102.h index fb3ef81fceb..848515c2274 100644 --- a/src/devices/video/hd44102.h +++ b/src/devices/video/hd44102.h @@ -37,7 +37,7 @@ class hd44102_device : public device_t, { public: // construction/destruction - hd44102_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd44102_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_offsets(device_t &device, int sx, int sy); @@ -47,7 +47,7 @@ public: DECLARE_WRITE_LINE_MEMBER( cs2_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 @@ -63,10 +63,10 @@ private: inline void count_up_or_down(); - UINT8 m_ram[4][50]; // display memory + uint8_t m_ram[4][50]; // display memory - UINT8 m_status; // status register - UINT8 m_output; // output register + uint8_t m_status; // status register + uint8_t m_output; // output register int m_cs2; // chip select int m_page; // display start page diff --git a/src/devices/video/hd44352.cpp b/src/devices/video/hd44352.cpp index c13cf80f818..381fab18967 100644 --- a/src/devices/video/hd44352.cpp +++ b/src/devices/video/hd44352.cpp @@ -34,7 +34,7 @@ const device_type HD44352 = &device_creator; // hd44352_device - constructor //------------------------------------------------- -hd44352_device::hd44352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock): +hd44352_device::hd44352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock): device_t(mconfig, HD44352, "hd44352", tag, owner, clock, "hd44352", __FILE__), m_on_cb(*this), m_char_rom(*this, DEVICE_SELF) @@ -133,9 +133,9 @@ void hd44352_device::device_timer(emu_timer &timer, device_timer_id id, int para // device interface //************************************************************************** -UINT32 hd44352_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hd44352_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 cw = m_char_width; + uint8_t cw = m_char_width; bitmap.fill(0, cliprect); @@ -149,7 +149,7 @@ UINT32 hd44352_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap //draw the cursor for (int c=0; c>5) & 0x07, m_video_ram[a][py*16*cw + px*cw + c + m_scroll * 48], m_cursor[c]); + uint8_t d = compute_newval((m_cursor_status>>5) & 0x07, m_video_ram[a][py*16*cw + px*cw + c + m_scroll * 48], m_cursor[c]); for (int b=0; b<8; b++) { bitmap.pix16(py*8 + b, a*cw*16 + px*cw + c) = BIT(d, 7-b); @@ -160,7 +160,7 @@ UINT32 hd44352_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap { for (int c=0; c>4) & 0x0f) { @@ -409,7 +409,7 @@ void hd44352_device::data_write(UINT8 data) case LCD_CURSOR_CHAR: if (m_byte_count<1) { - UINT8 char_code = ((data<<4)&0xf0) | ((data>>4)&0x0f); + uint8_t char_code = ((data<<4)&0xf0) | ((data>>4)&0x0f); for (int i=0; i<8; i++) m_cursor[i] = get_char(char_code*8 + i); @@ -434,7 +434,7 @@ void hd44352_device::data_write(UINT8 data) } } -UINT8 hd44352_device::data_read() +uint8_t hd44352_device::data_read() { return m_data_bus; } diff --git a/src/devices/video/hd44352.h b/src/devices/video/hd44352.h index 0974ed90a9d..f5546f93e91 100644 --- a/src/devices/video/hd44352.h +++ b/src/devices/video/hd44352.h @@ -27,16 +27,16 @@ class hd44352_device : { public: // construction/destruction - hd44352_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd44352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_on_callback(device_t &device, _Object object) { return downcast(device).m_on_cb.set_callback(object); } // device interface - UINT8 data_read(); - void data_write(UINT8 data); - void control_write(UINT8 data); + uint8_t data_read(); + void data_write(uint8_t data); + void control_write(uint8_t data); - 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 @@ -46,34 +46,34 @@ protected: virtual void device_validity_check(validity_checker &valid) const override; private: - UINT8 compute_newval(UINT8 type, UINT8 oldval, UINT8 newval); - UINT8 get_char(UINT16 pos); + uint8_t compute_newval(uint8_t type, uint8_t oldval, uint8_t newval); + uint8_t get_char(uint16_t pos); static const device_timer_id ON_TIMER = 1; emu_timer *m_on_timer; - UINT8 m_video_ram[2][0x180]; - UINT8 m_control_lines; - UINT8 m_data_bus; - UINT8 m_par[3]; - UINT8 m_state; - UINT16 m_bank; - UINT16 m_offset; - UINT8 m_char_width; - UINT8 m_lcd_on; - UINT8 m_scroll; - UINT32 m_contrast; - - UINT8 m_custom_char[4][8]; // 4 chars * 8 bytes - UINT8 m_byte_count; - UINT8 m_cursor_status; - UINT8 m_cursor[8]; - UINT8 m_cursor_x; - UINT8 m_cursor_y; - UINT8 m_cursor_lcd; + uint8_t m_video_ram[2][0x180]; + uint8_t m_control_lines; + uint8_t m_data_bus; + uint8_t m_par[3]; + uint8_t m_state; + uint16_t m_bank; + uint16_t m_offset; + uint8_t m_char_width; + uint8_t m_lcd_on; + uint8_t m_scroll; + uint32_t m_contrast; + + uint8_t m_custom_char[4][8]; // 4 chars * 8 bytes + uint8_t m_byte_count; + uint8_t m_cursor_status; + uint8_t m_cursor[8]; + uint8_t m_cursor_x; + uint8_t m_cursor_y; + uint8_t m_cursor_lcd; devcb_write_line m_on_cb; // ON line callback - required_region_ptr m_char_rom; + required_region_ptr m_char_rom; }; // device type definition diff --git a/src/devices/video/hd44780.cpp b/src/devices/video/hd44780.cpp index 0911ac877d8..65aef6fc39a 100644 --- a/src/devices/video/hd44780.cpp +++ b/src/devices/video/hd44780.cpp @@ -45,20 +45,20 @@ ROM_END // hd44780_device - constructor //------------------------------------------------- -hd44780_device::hd44780_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd44780_device::hd44780_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hd44780_device(mconfig, HD44780, "HD44780 A00", tag, owner, clock, "hd44780_a00", __FILE__) { set_charset_type(CHARSET_HD44780_A00); } -hd44780_device::hd44780_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) +hd44780_device::hd44780_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_cgrom(nullptr) , m_cgrom_region(*this, DEVICE_SELF) { } -ks0066_f05_device::ks0066_f05_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ks0066_f05_device::ks0066_f05_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hd44780_device(mconfig, KS0066_F05, "KS0066 F05", tag, owner, clock, "ks0066_f05", __FILE__) { set_charset_type(CHARSET_KS0066_F05); @@ -177,7 +177,7 @@ void hd44780_device::set_charset_type(int type) m_charset_type = type; } -void hd44780_device::set_busy_flag(UINT16 usec) +void hd44780_device::set_busy_flag(uint16_t usec) { m_busy_flag = true; m_busy_timer->adjust( attotime::from_usec( usec ) ); @@ -232,7 +232,7 @@ void hd44780_device::update_nibble(int rs, int rw) m_nibble = !m_nibble; } -inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8 pos, UINT8 y, UINT8 x, int state) +inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, uint8_t line, uint8_t pos, uint8_t y, uint8_t x, int state) { if (!m_pixel_update_cb.isnull()) { @@ -240,7 +240,7 @@ inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8 } else { - UINT8 line_height = (m_char_size == 8) ? m_char_size : m_char_size + 1; + uint8_t line_height = (m_char_size == 8) ? m_char_size : m_char_size + 1; if (m_lines <= 2) { @@ -273,19 +273,19 @@ inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8 // device interface //************************************************************************** -const UINT8 *hd44780_device::render() +const uint8_t *hd44780_device::render() { memset(m_render_buf, 0, sizeof(m_render_buf)); if (m_display_on) { - UINT8 line_size = 80 / m_num_line; + uint8_t line_size = 80 / m_num_line; for (int line = 0; line < m_num_line; line++) { for (int pos = 0; pos < line_size; pos++) { - UINT16 char_pos = line * 0x40 + ((pos + m_disp_shift) % line_size); + uint16_t char_pos = line * 0x40 + ((pos + m_disp_shift) % line_size); int char_base; if (m_ddram[char_pos] < 0x10) @@ -302,8 +302,8 @@ const UINT8 *hd44780_device::render() char_base = m_ddram[char_pos] * 0x10; } - const UINT8 * charset = (m_ddram[char_pos] < 0x10) ? m_cgram : m_cgrom; - UINT8 *dest = m_render_buf + 16 * (line * line_size + pos); + const uint8_t * charset = (m_ddram[char_pos] < 0x10) ? m_cgram : m_cgrom; + uint8_t *dest = m_render_buf + 16 * (line * line_size + pos); memcpy (dest, charset + char_base, m_char_size); if (char_pos == m_ac) @@ -322,18 +322,18 @@ const UINT8 *hd44780_device::render() return m_render_buf; } -UINT32 hd44780_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hd44780_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); - const UINT8 *img = render(); + const uint8_t *img = render(); - UINT8 line_size = 80 / m_num_line; + uint8_t line_size = 80 / m_num_line; for (int line = 0; line < m_num_line; line++) { for (int pos = 0; pos < line_size; pos++) { - const UINT8 *src = img + 16 * (line * line_size + pos); + const uint8_t *src = img + 16 * (line * line_size + pos); for (int y = 0; y < m_char_size; y++) for (int x = 0; x < 5; x++) pixel_update(bitmap, line, pos, y, x, BIT(src[y], 4 - x)); @@ -543,7 +543,7 @@ WRITE8_MEMBER(hd44780_device::data_write) READ8_MEMBER(hd44780_device::data_read) { - UINT8 data = (m_active_ram == DDRAM) ? m_ddram[m_ac] : m_cgram[m_ac]; + uint8_t data = (m_active_ram == DDRAM) ? m_ddram[m_ac] : m_cgram[m_ac]; if (LOG) logerror("HD44780 '%s': %sRAM read %x %c\n", tag(), m_active_ram == DDRAM ? "DD" : "CG", m_ac, data); diff --git a/src/devices/video/hd44780.h b/src/devices/video/hd44780.h index d63a64e1023..bb62a27d1d8 100644 --- a/src/devices/video/hd44780.h +++ b/src/devices/video/hd44780.h @@ -28,8 +28,8 @@ // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate hd44780_pixel_update_delegate; -#define HD44780_PIXEL_UPDATE(name) void name(bitmap_ind16 &bitmap, UINT8 line, UINT8 pos, UINT8 y, UINT8 x, int state) +typedef device_delegate hd44780_pixel_update_delegate; +#define HD44780_PIXEL_UPDATE(name) void name(bitmap_ind16 &bitmap, uint8_t line, uint8_t pos, uint8_t y, uint8_t x, int state) // ======================> hd44780_device @@ -38,8 +38,8 @@ class hd44780_device : public device_t { public: // construction/destruction - hd44780_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - hd44780_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); + hd44780_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + hd44780_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 static void static_set_lcd_size(device_t &device, int _lines, int _chars) { hd44780_device &dev=downcast(device); dev.m_lines = _lines; dev.m_chars = _chars; } @@ -53,8 +53,8 @@ public: virtual DECLARE_WRITE8_MEMBER(data_write); virtual DECLARE_READ8_MEMBER(data_read); - const UINT8 *render(); - virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + const uint8_t *render(); + virtual uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -84,12 +84,12 @@ protected: private: // internal helper - void set_busy_flag(UINT16 usec); + void set_busy_flag(uint16_t usec); void correct_ac(); void update_ac(int direction); void update_nibble(int rs, int rw); void shift_display(int direction); - void pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8 pos, UINT8 y, UINT8 x, int state); + void pixel_update(bitmap_ind16 &bitmap, uint8_t line, uint8_t pos, uint8_t y, uint8_t x, int state); // internal state static const device_timer_id TIMER_BUSY = 0; @@ -98,35 +98,35 @@ private: emu_timer * m_blink_timer; emu_timer * m_busy_timer; - UINT8 m_lines; // number of lines - UINT8 m_chars; // chars for line + uint8_t m_lines; // number of lines + uint8_t m_chars; // chars for line hd44780_pixel_update_delegate m_pixel_update_cb; // pixel update callback bool m_busy_flag; // busy flag - UINT8 m_ddram[0x80]; // internal display data RAM - UINT8 m_cgram[0x40]; // internal chargen RAM - UINT8 const *m_cgrom; - optional_region_ptr m_cgrom_region; // internal chargen ROM + uint8_t m_ddram[0x80]; // internal display data RAM + uint8_t m_cgram[0x40]; // internal chargen RAM + uint8_t const *m_cgrom; + optional_region_ptr m_cgrom_region; // internal chargen ROM int m_ac; // address counter - UINT8 m_dr; // data register - UINT8 m_ir; // instruction register - UINT8 m_active_ram; // DDRAM or CGRAM + uint8_t m_dr; // data register + uint8_t m_ir; // instruction register + uint8_t m_active_ram; // DDRAM or CGRAM bool m_display_on; // display on/off bool m_cursor_on; // cursor on/off bool m_blink_on; // blink on/off bool m_shift_on; // shift on/off int m_disp_shift; // display shift int m_direction; // auto increment/decrement (-1 or +1) - UINT8 m_data_len; // interface data length 4 or 8 bit - UINT8 m_num_line; // number of lines - UINT8 m_char_size; // char size 5x8 or 5x10 + uint8_t m_data_len; // interface data length 4 or 8 bit + uint8_t m_num_line; // number of lines + uint8_t m_char_size; // char size 5x8 or 5x10 bool m_blink; bool m_first_cmd; int m_rs_state; int m_rw_state; bool m_nibble; int m_charset_type; - UINT8 m_render_buf[80 * 16]; + uint8_t m_render_buf[80 * 16]; enum { DDRAM, CGRAM }; }; @@ -137,7 +137,7 @@ class ks0066_f05_device : public hd44780_device { public: // construction/destruction - ks0066_f05_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ks0066_f05_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; // device type definition diff --git a/src/devices/video/hd61830.cpp b/src/devices/video/hd61830.cpp index 82b19051def..51a5ae3ab35 100644 --- a/src/devices/video/hd61830.cpp +++ b/src/devices/video/hd61830.cpp @@ -70,7 +70,7 @@ const int MODE_DISPLAY_ON = 0x20; // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT8 hd61830_device::readbyte(offs_t address) +inline uint8_t hd61830_device::readbyte(offs_t address) { return space().read_byte(address); } @@ -80,7 +80,7 @@ inline UINT8 hd61830_device::readbyte(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void hd61830_device::writebyte(offs_t address, UINT8 data) +inline void hd61830_device::writebyte(offs_t address, uint8_t data) { space().write_byte(address, data); } @@ -95,7 +95,7 @@ inline void hd61830_device::writebyte(offs_t address, UINT8 data) // hd61830_device - constructor //------------------------------------------------- -hd61830_device::hd61830_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +hd61830_device::hd61830_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HD61830, "HD61830 LCDC", tag, owner, clock, "hd61830", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -218,7 +218,7 @@ WRITE8_MEMBER( hd61830_device::control_w ) READ8_MEMBER( hd61830_device::data_r ) { - UINT8 data = m_dor; + uint8_t data = m_dor; if (LOG) logerror("HD61830 '%s' Display Data Read %02x\n", tag(), m_dor); @@ -326,7 +326,7 @@ WRITE8_MEMBER( hd61830_device::data_w ) case INSTRUCTION_CLEAR_BIT: { int bit = data & 0x07; - UINT8 md = readbyte(m_cac); + uint8_t md = readbyte(m_cac); md &= ~(1 << bit); @@ -341,7 +341,7 @@ WRITE8_MEMBER( hd61830_device::data_w ) case INSTRUCTION_SET_BIT: { int bit = data & 0x07; - UINT8 md = readbyte(m_cac); + uint8_t md = readbyte(m_cac); md |= 1 << bit; @@ -367,12 +367,12 @@ WRITE8_MEMBER( hd61830_device::data_w ) // draw_scanline - draw one graphics scanline //------------------------------------------------- -UINT16 hd61830_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 ra) +uint16_t hd61830_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, uint16_t ra) { for (int sx = 0; sx < m_hn; sx+=2) { - UINT8 data1 = readbyte(ra++); - UINT8 data2 = readbyte(ra++); + uint8_t data1 = readbyte(ra++); + uint8_t data2 = readbyte(ra++); for (int x = 0; x < m_hp; x++) { @@ -395,8 +395,8 @@ UINT16 hd61830_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &clip void hd61830_device::update_graphics(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 rac1 = m_dsa; - UINT16 rac2 = rac1 + (m_nx * m_hn); + uint16_t rac1 = m_dsa; + uint16_t rac2 = rac1 + (m_nx * m_hn); for (int y = 0; y < m_nx; y++) { /* draw upper half scanline */ @@ -412,7 +412,7 @@ void hd61830_device::update_graphics(bitmap_ind16 &bitmap, const rectangle &clip // draw_char - draw a char //------------------------------------------------- -void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 ma, int x, int y, UINT8 md) +void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t ma, int x, int y, uint8_t md) { for (int cl = 0; cl < m_vp; cl++) { @@ -420,7 +420,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, { int sy = y * m_vp + cl; int sx = x * m_hp + cr; - UINT8 data; + uint8_t data; if (m_mcr & MODE_EXTERNAL_CG) { @@ -428,7 +428,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, } else { - UINT16 addr = 0; + uint16_t addr = 0; if (md >= 0x20 && md < 0x80 && cl < 7) { @@ -485,13 +485,13 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, void hd61830_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 ma = 0; + uint16_t ma = 0; for (int y = 0; y < (m_nx / m_vp); y++) { for (int x = 0; x < m_hn; x+=2) { - UINT8 md1 = readbyte(ma); - UINT8 md2 = readbyte(ma+1); + uint8_t md1 = readbyte(ma); + uint8_t md2 = readbyte(ma+1); draw_char(bitmap, cliprect, ma, x, y, md1); draw_char(bitmap, cliprect, ma+1, x+1, y, md2); @@ -506,7 +506,7 @@ void hd61830_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect // update_screen - update screen //------------------------------------------------- -UINT32 hd61830_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hd61830_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_mcr & MODE_DISPLAY_ON) { diff --git a/src/devices/video/hd61830.h b/src/devices/video/hd61830.h index 18a2b2e5cc2..443aede5b9d 100644 --- a/src/devices/video/hd61830.h +++ b/src/devices/video/hd61830.h @@ -36,7 +36,7 @@ class hd61830_device : public device_t, { public: // construction/destruction - hd61830_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd61830_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_rd_rd_callback(device_t &device, _Object object) { return downcast(device).m_read_rd.set_callback(object); } @@ -46,7 +46,7 @@ public: DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( data_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 @@ -58,8 +58,8 @@ protected: // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; - inline UINT8 readbyte(offs_t address); - inline void writebyte(offs_t address, UINT8 data); + inline uint8_t readbyte(offs_t address); + inline void writebyte(offs_t address, uint8_t data); private: enum @@ -81,9 +81,9 @@ private: void set_busy_flag(); - UINT16 draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 ra); + uint16_t draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, uint16_t ra); void update_graphics(bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 ma, int x, int y, UINT8 md); + void draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t ma, int x, int y, uint8_t md); void update_text(bitmap_ind16 &bitmap, const rectangle &cliprect); devcb_read8 m_read_rd; @@ -93,12 +93,12 @@ private: bool m_bf; // busy flag - UINT8 m_ir; // instruction register - UINT8 m_mcr; // mode control register - UINT8 m_dor; // data output register + uint8_t m_ir; // instruction register + uint8_t m_mcr; // mode control register + uint8_t m_dor; // data output register - UINT16 m_dsa; // display start address - UINT16 m_cac; // cursor address counter + uint16_t m_dsa; // display start address + uint16_t m_cac; // cursor address counter int m_vp; // vertical character pitch int m_hp; // horizontal character pitch @@ -112,7 +112,7 @@ private: // address space configurations const address_space_config m_space_config; - required_region_ptr m_char_rom; + required_region_ptr m_char_rom; }; diff --git a/src/devices/video/hd63484.cpp b/src/devices/video/hd63484.cpp index 1c42ab62266..fd37c54f702 100644 --- a/src/devices/video/hd63484.cpp +++ b/src/devices/video/hd63484.cpp @@ -21,7 +21,7 @@ // hd63484_device - constructor //------------------------------------------------- -hd63484_device::hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd63484_device::hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HD63484, "HD63484 CRTC", tag, owner, clock, "hd63484", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -360,7 +360,7 @@ const tiny_rom_entry *hd63484_device::device_rom_region() const // readword - read a word at the given address //------------------------------------------------- -inline UINT16 hd63484_device::readword(offs_t address) +inline uint16_t hd63484_device::readword(offs_t address) { return space().read_word(address << 1); } @@ -370,7 +370,7 @@ inline UINT16 hd63484_device::readword(offs_t address) // writeword - write a word at the given address //------------------------------------------------- -inline void hd63484_device::writeword(offs_t address, UINT16 data) +inline void hd63484_device::writeword(offs_t address, uint16_t data) { space().write_word(address << 1, data); } @@ -400,7 +400,7 @@ inline void hd63484_device::fifo_w_clear() m_sr |= HD63484_SR_WFE; } -inline void hd63484_device::queue_w(UINT8 data) +inline void hd63484_device::queue_w(uint8_t data) { if (m_fifo_ptr < 15) { @@ -420,7 +420,7 @@ inline void hd63484_device::queue_w(UINT8 data) } } -inline void hd63484_device::dequeue_w(UINT8 *data) +inline void hd63484_device::dequeue_w(uint8_t *data) { int i; @@ -456,7 +456,7 @@ inline void hd63484_device::fifo_r_clear() m_sr &= ~HD63484_SR_RFF; } -inline void hd63484_device::queue_r(UINT8 data) +inline void hd63484_device::queue_r(uint8_t data) { if (m_fifo_r_ptr < 15) { @@ -476,7 +476,7 @@ inline void hd63484_device::queue_r(UINT8 data) } } -inline void hd63484_device::dequeue_r(UINT8 *data) +inline void hd63484_device::dequeue_r(uint8_t *data) { int i; @@ -534,7 +534,7 @@ inline void hd63484_device::recompute_parameters() IMPLEMENTATION *****************************************************************************/ -int hd63484_device::translate_command(UINT16 data) +int hd63484_device::translate_command(uint16_t data) { /* annoying switch-case sequence, but it's the only way to get invalid commands ... */ switch (data) @@ -629,7 +629,7 @@ int hd63484_device::get_bpp() return 1; } -void hd63484_device::calc_offset(INT16 x, INT16 y, UINT32 &offset, UINT8 &bit_pos) +void hd63484_device::calc_offset(int16_t x, int16_t y, uint32_t &offset, uint8_t &bit_pos) { int bpp = get_bpp(); int ppw = 16 / bpp; @@ -655,18 +655,18 @@ void hd63484_device::calc_offset(INT16 x, INT16 y, UINT32 &offset, UINT8 &bit_po bit_pos *= bpp; } -UINT16 hd63484_device::get_dot(INT16 x, INT16 y) +uint16_t hd63484_device::get_dot(int16_t x, int16_t y) { - UINT8 bpp = get_bpp(); - UINT32 offset = 0; - UINT8 bit_pos = 0; + uint8_t bpp = get_bpp(); + uint32_t offset = 0; + uint8_t bit_pos = 0; calc_offset(x, y, offset, bit_pos); return (readword(offset) >> bit_pos) & ((1 << bpp) - 1); } -bool hd63484_device::set_dot(INT16 x, INT16 y, INT16 px, INT16 py) +bool hd63484_device::set_dot(int16_t x, int16_t y, int16_t px, int16_t py) { int xs = m_pex - m_psx + 1; int ys = m_pey - m_psy + 1; @@ -683,12 +683,12 @@ bool hd63484_device::set_dot(INT16 x, INT16 y, INT16 px, INT16 py) int pix = (m_pram[yp & 0x0f] >> (xp & 0x0f)) & 0x01; - UINT8 col = (m_cr >> 3) & 0x03; - UINT8 bpp = get_bpp(); - UINT16 mask = (1 << bpp) - 1; - UINT16 xmask = (16 / bpp) - 1; - UINT16 cl0 = (m_cl0 >> ((x & xmask) * bpp)) & mask; - UINT16 cl1 = (m_cl1 >> ((x & xmask) * bpp)) & mask; + uint8_t col = (m_cr >> 3) & 0x03; + uint8_t bpp = get_bpp(); + uint16_t mask = (1 << bpp) - 1; + uint16_t xmask = (16 / bpp) - 1; + uint16_t cl0 = (m_cl0 >> ((x & xmask) * bpp)) & mask; + uint16_t cl1 = (m_cl1 >> ((x & xmask) * bpp)) & mask; switch (col) { @@ -710,21 +710,21 @@ bool hd63484_device::set_dot(INT16 x, INT16 y, INT16 px, INT16 py) return false; } -bool hd63484_device::set_dot(INT16 x, INT16 y, UINT16 color) +bool hd63484_device::set_dot(int16_t x, int16_t y, uint16_t color) { - UINT8 bpp = get_bpp(); - UINT32 offset = 0; - UINT8 bit_pos = 0; - UINT8 opm = m_cr & 0x07; - UINT8 area = (m_cr >> 5) & 0x07; + uint8_t bpp = get_bpp(); + uint32_t offset = 0; + uint8_t bit_pos = 0; + uint8_t opm = m_cr & 0x07; + uint8_t area = (m_cr >> 5) & 0x07; calc_offset(x, y, offset, bit_pos); - UINT16 mask = ((1 << bpp) - 1) << bit_pos; - UINT16 color_shifted = (color << bit_pos) & mask; + uint16_t mask = ((1 << bpp) - 1) << bit_pos; + uint16_t color_shifted = (color << bit_pos) & mask; - UINT16 data = readword(offset); - UINT16 res = data; + uint16_t data = readword(offset); + uint16_t res = data; switch (opm) { @@ -766,10 +766,10 @@ bool hd63484_device::set_dot(INT16 x, INT16 y, UINT16 color) return false; // TODO: return area detection status } -void hd63484_device::draw_line(INT16 sx, INT16 sy, INT16 ex, INT16 ey) +void hd63484_device::draw_line(int16_t sx, int16_t sy, int16_t ex, int16_t ey) { - UINT16 delta_x = abs(ex - sx) * 2; - UINT16 delta_y = abs(ey - sy) * 2; + uint16_t delta_x = abs(ex - sx) * 2; + uint16_t delta_y = abs(ey - sy) * 2; int dir_x = (ex < sx) ? -1 : ((ex > sx) ? +1 : 0); int dir_y = (ey < sy) ? -1 : ((ey > sy) ? +1 : 0); int pram_pos = 0; @@ -810,7 +810,7 @@ void hd63484_device::draw_line(INT16 sx, INT16 sy, INT16 ex, INT16 ey) } } -void hd63484_device::draw_ellipse(INT16 cx, INT16 cy, double dx, double dy, double s_angol, double e_angol, bool c) +void hd63484_device::draw_ellipse(int16_t cx, int16_t cy, double dx, double dy, double s_angol, double e_angol, bool c) { double inc = 1.0 / (std::max(dx, dy) * 100); for (double angol = s_angol; fabs(angol - e_angol) >= inc*2; angol += inc * (c ? -1 : +1)) @@ -824,7 +824,7 @@ void hd63484_device::draw_ellipse(INT16 cx, INT16 cy, double dx, double dy, doub } } -void hd63484_device::paint(INT16 sx, INT16 sy) +void hd63484_device::paint(int16_t sx, int16_t sy) { /* This is not accurate since real hardware can only paint 4 'unpaintable' areas, @@ -833,28 +833,28 @@ void hd63484_device::paint(INT16 sx, INT16 sy) in case the read FIFO is full, so all 'unpaintable' areas are painted. Also CP is not in the correct position after this command. */ - UINT8 e = BIT(m_cr, 8); - UINT8 bpp = get_bpp(); - UINT16 mask = (1 << bpp) - 1; - UINT16 xmask = (16 / bpp) - 1; + uint8_t e = BIT(m_cr, 8); + uint8_t bpp = get_bpp(); + uint16_t mask = (1 << bpp) - 1; + uint16_t xmask = (16 / bpp) - 1; for (int ydir=0; ydir<2; ydir++) - for(UINT16 y=0;y<0x7fff; y++) + for(uint16_t y=0;y<0x7fff; y++) { bool limit = true; bool unpaintable_up = false; bool unpaintable_dn = false; for (int xdir=0; xdir<2; xdir++) - for(UINT16 x=0; x<0x7fff; x++) + for(uint16_t x=0; x<0x7fff; x++) { - INT16 px = sx + (xdir ? -x : x); - INT16 py = sy + (ydir ? -y : y); + int16_t px = sx + (xdir ? -x : x); + int16_t py = sy + (ydir ? -y : y); - UINT16 dot = get_dot(px, py); - UINT16 edg = (m_edg >> (px & xmask) * bpp) & mask; - UINT16 cl0 = (m_cl0 >> (px & xmask) * bpp) & mask; - UINT16 cl1 = (m_cl1 >> (px & xmask) * bpp) & mask; + uint16_t dot = get_dot(px, py); + uint16_t edg = (m_edg >> (px & xmask) * bpp) & mask; + uint16_t cl0 = (m_cl0 >> (px & xmask) * bpp) & mask; + uint16_t cl1 = (m_cl1 >> (px & xmask) * bpp) & mask; if ((e && dot != edg) || (!e && dot == edg) || dot == cl0 || dot == cl1) break; @@ -880,7 +880,7 @@ void hd63484_device::paint(INT16 sx, INT16 sy) } } -UINT16 hd63484_device::command_rpr_exec() +uint16_t hd63484_device::command_rpr_exec() { switch(m_cr & 0x1f) { @@ -980,21 +980,21 @@ void hd63484_device::command_wpr_exec() void hd63484_device::command_clr_exec() { - UINT8 mm = m_cr & 0x03; - UINT16 d = m_pr[0]; - INT16 ax = (INT16)m_pr[1]; - INT16 ay = (INT16)m_pr[2]; + uint8_t mm = m_cr & 0x03; + uint16_t d = m_pr[0]; + int16_t ax = (int16_t)m_pr[1]; + int16_t ay = (int16_t)m_pr[2]; int d0_inc = (ax < 0) ? -1 : 1; int d1_inc = (ay < 0) ? -1 : 1; - for(INT16 d1=0; d1!=ay+d1_inc; d1+=d1_inc) + for(int16_t d1=0; d1!=ay+d1_inc; d1+=d1_inc) { - for(INT16 d0=0; d0!=ax+d0_inc; d0+=d0_inc) + for(int16_t d0=0; d0!=ax+d0_inc; d0+=d0_inc) { - UINT32 offset = m_rwp[m_rwp_dn] - d1 * m_mwr[m_rwp_dn] + d0; - UINT16 data = readword(offset); - UINT16 res = 0; + uint32_t offset = m_rwp[m_rwp_dn] - d1 * m_mwr[m_rwp_dn] + d0; + uint16_t data = readword(offset); + uint16_t res = 0; if (BIT(m_cr, 10)) { @@ -1027,12 +1027,12 @@ void hd63484_device::command_clr_exec() void hd63484_device::command_cpy_exec() { - UINT8 mm = m_cr & 0x03; - UINT8 dsd = (m_cr >> 8) & 0x07; - UINT8 s = BIT(m_cr, 11); - UINT32 SA = ((m_pr[0] & 0xff) << 12) | ((m_pr[1]&0xfff0) >> 4); - INT16 DX = (INT16)m_pr[s ? 3 : 2]; - INT16 DY = (INT16)m_pr[s ? 2 : 3]; + uint8_t mm = m_cr & 0x03; + uint8_t dsd = (m_cr >> 8) & 0x07; + uint8_t s = BIT(m_cr, 11); + uint32_t SA = ((m_pr[0] & 0xff) << 12) | ((m_pr[1]&0xfff0) >> 4); + int16_t DX = (int16_t)m_pr[s ? 3 : 2]; + int16_t DY = (int16_t)m_pr[s ? 2 : 3]; int sd0_inc = (DX < 0) ? -1 : 1; int sd1_inc = (DY < 0) ? -1 : 1; @@ -1048,11 +1048,11 @@ void hd63484_device::command_cpy_exec() dd1_inc = dsd & 0x01 ? -1 : +1; } - for(INT16 sd1=0, dd1=0; sd1!=DY+sd1_inc; sd1+=sd1_inc, dd1+=dd1_inc) + for(int16_t sd1=0, dd1=0; sd1!=DY+sd1_inc; sd1+=sd1_inc, dd1+=dd1_inc) { - for(INT16 sd0=0, dd0=0; sd0!=DX+sd0_inc; sd0+=sd0_inc, dd0+=dd0_inc) + for(int16_t sd0=0, dd0=0; sd0!=DX+sd0_inc; sd0+=sd0_inc, dd0+=dd0_inc) { - UINT32 src_offset, dst_offset; + uint32_t src_offset, dst_offset; if (s) src_offset = SA + sd1 - sd0 * m_mwr[m_rwp_dn]; @@ -1064,8 +1064,8 @@ void hd63484_device::command_cpy_exec() else dst_offset = m_rwp[m_rwp_dn] + dd0 - dd1 * m_mwr[m_rwp_dn]; - UINT16 src_data = readword(src_offset); - UINT16 dst_data = readword(dst_offset); + uint16_t src_data = readword(src_offset); + uint16_t dst_data = readword(dst_offset); if (BIT(m_cr, 12)) { @@ -1098,8 +1098,8 @@ void hd63484_device::command_cpy_exec() void hd63484_device::command_line_exec() { - INT16 x = (INT16)m_pr[0]; - INT16 y = (INT16)m_pr[1]; + int16_t x = (int16_t)m_pr[0]; + int16_t y = (int16_t)m_pr[1]; if (BIT(m_cr, 10)) { @@ -1115,8 +1115,8 @@ void hd63484_device::command_line_exec() void hd63484_device::command_rct_exec() { - INT16 dX = m_pr[0]; - INT16 dY = m_pr[1]; + int16_t dX = m_pr[0]; + int16_t dY = m_pr[1]; if (BIT(m_cr, 10)) // relative (RRCT) { @@ -1146,12 +1146,12 @@ void hd63484_device::command_rct_exec() void hd63484_device::command_gcpy_exec() { - UINT8 dsd = (m_cr >> 8) & 0x07; - UINT8 s = BIT(m_cr, 11); - INT16 Xs = (INT16)m_pr[0]; - INT16 Ys = (INT16)m_pr[1]; - INT16 DX = (INT16)m_pr[s ? 3 : 2]; - INT16 DY = (INT16)m_pr[s ? 2 : 3]; + uint8_t dsd = (m_cr >> 8) & 0x07; + uint8_t s = BIT(m_cr, 11); + int16_t Xs = (int16_t)m_pr[0]; + int16_t Ys = (int16_t)m_pr[1]; + int16_t DX = (int16_t)m_pr[s ? 3 : 2]; + int16_t DY = (int16_t)m_pr[s ? 2 : 3]; if (BIT(m_cr, 12)) // relative (RGCPY) { @@ -1173,11 +1173,11 @@ void hd63484_device::command_gcpy_exec() dd1_inc = dsd & 0x01 ? -1 : +1; } - for(INT16 sd1=0, dd1=0; sd1!=DY+sd1_inc; sd1+=sd1_inc, dd1+=dd1_inc) + for(int16_t sd1=0, dd1=0; sd1!=DY+sd1_inc; sd1+=sd1_inc, dd1+=dd1_inc) { - for(INT16 sd0=0, dd0=0; sd0!=DX+sd0_inc; sd0+=sd0_inc, dd0+=dd0_inc) + for(int16_t sd0=0, dd0=0; sd0!=DX+sd0_inc; sd0+=sd0_inc, dd0+=dd0_inc) { - UINT16 color; + uint16_t color; if (s) color = get_dot(Xs + sd1, Ys + sd0); else @@ -1199,8 +1199,8 @@ void hd63484_device::command_gcpy_exec() void hd63484_device::command_frct_exec() { - INT16 X = (INT16)m_pr[0]; - INT16 Y = (INT16)m_pr[1]; + int16_t X = (int16_t)m_pr[0]; + int16_t Y = (int16_t)m_pr[1]; if (!BIT(m_cr, 10)) { @@ -1211,9 +1211,9 @@ void hd63484_device::command_frct_exec() int d0_inc = (X < 0) ? -1 : 1; int d1_inc = (Y < 0) ? -1 : 1; - for(INT16 d1=0; d1!=Y+d1_inc; d1+=d1_inc) + for(int16_t d1=0; d1!=Y+d1_inc; d1+=d1_inc) { - for(INT16 d0=0; d0!=X+d0_inc; d0+=d0_inc) + for(int16_t d0=0; d0!=X+d0_inc; d0+=d0_inc) set_dot(m_cpx + d0, m_cpy + d1, d0, d1); } @@ -1222,13 +1222,13 @@ void hd63484_device::command_frct_exec() void hd63484_device::command_ptn_exec() { - INT16 szx = ((m_pr[0] >> 0) & 0xff); - INT16 szy = ((m_pr[0] >> 8) & 0xff); - UINT8 sl_sd = (m_cr >> 8) & 0x0f; - INT16 px = 0; - INT16 py = 0; + int16_t szx = ((m_pr[0] >> 0) & 0xff); + int16_t szy = ((m_pr[0] >> 8) & 0xff); + uint8_t sl_sd = (m_cr >> 8) & 0x0f; + int16_t px = 0; + int16_t py = 0; - for(INT16 d1=0; d1!=szy+1; d1++) + for(int16_t d1=0; d1!=szy+1; d1++) { switch (sl_sd) { @@ -1250,7 +1250,7 @@ void hd63484_device::command_ptn_exec() case 0x0f: px = +d1; py = 0; break; } - for(INT16 d0=0; d0!=szx+1; d0++) + for(int16_t d0=0; d0!=szx+1; d0++) { set_dot(m_cpx + px, m_cpy + py, d0, d1); @@ -1308,13 +1308,13 @@ void hd63484_device::command_plg_exec() { if (BIT(m_cr, 10)) { - ex = sx + (INT16)m_pr[1 + i * 2]; - ey = sy + (INT16)m_pr[1 + i * 2 + 1]; + ex = sx + (int16_t)m_pr[1 + i * 2]; + ey = sy + (int16_t)m_pr[1 + i * 2 + 1]; } else { - ex = (INT16)m_pr[1 + i * 2]; - ey = (INT16)m_pr[1 + i * 2 + 1]; + ex = (int16_t)m_pr[1 + i * 2]; + ey = (int16_t)m_pr[1 + i * 2 + 1]; } draw_line(sx, sy, ex, ey); @@ -1338,10 +1338,10 @@ void hd63484_device::command_plg_exec() void hd63484_device::command_arc_exec() { - INT16 xc = (INT16)m_pr[0]; - INT16 yc = (INT16)m_pr[1]; - INT16 xe = (INT16)m_pr[2]; - INT16 ye = (INT16)m_pr[3]; + int16_t xc = (int16_t)m_pr[0]; + int16_t yc = (int16_t)m_pr[1]; + int16_t xe = (int16_t)m_pr[2]; + int16_t ye = (int16_t)m_pr[3]; if (BIT(m_cr, 10)) { @@ -1365,12 +1365,12 @@ void hd63484_device::command_arc_exec() void hd63484_device::command_earc_exec() { - UINT16 a = m_pr[0]; - UINT16 b = m_pr[1]; - INT16 xc = (INT16)m_pr[2]; - INT16 yc = (INT16)m_pr[3]; - INT16 xe = (INT16)m_pr[4]; - INT16 ye = (INT16)m_pr[5]; + uint16_t a = m_pr[0]; + uint16_t b = m_pr[1]; + int16_t xc = (int16_t)m_pr[2]; + int16_t yc = (int16_t)m_pr[3]; + int16_t xe = (int16_t)m_pr[4]; + int16_t ye = (int16_t)m_pr[5]; if (BIT(m_cr, 10)) { @@ -1396,7 +1396,7 @@ void hd63484_device::command_earc_exec() void hd63484_device::process_fifo() { - UINT8 data; + uint8_t data; dequeue_w(&data); @@ -1450,7 +1450,7 @@ void hd63484_device::process_fifo() if (m_param_ptr == 0) { if (CMD_LOG) logerror("HD63484 '%s': RPR (%d)\n", tag(), m_cr & 0x1f); - UINT16 data = command_rpr_exec(); + uint16_t data = command_rpr_exec(); queue_r((data >> 8) & 0xff); queue_r((data >> 0) & 0xff); command_end_seq(); @@ -1522,7 +1522,7 @@ void hd63484_device::process_fifo() if (m_param_ptr == 0) { if (CMD_LOG) logerror("HD63484 '%s': RD\n", tag()); - UINT16 data = readword(m_rwp[m_rwp_dn]); + uint16_t data = readword(m_rwp[m_rwp_dn]); queue_r((data >> 8) & 0xff); queue_r((data >> 0) & 0xff); m_rwp[m_rwp_dn]+=1; @@ -1546,9 +1546,9 @@ void hd63484_device::process_fifo() if(m_param_ptr == 1) { if (CMD_LOG) logerror("HD63484 '%s': MOD (%d) 0x%04x\n", tag(), m_cr & 0x03, m_pr[0]); - UINT16 d = m_pr[0]; - UINT16 data = readword(m_rwp[m_rwp_dn]); - UINT16 res = 0; + uint16_t d = m_pr[0]; + uint16_t data = readword(m_rwp[m_rwp_dn]); + uint16_t res = 0; switch(m_cr & 0x03) { @@ -1578,9 +1578,9 @@ void hd63484_device::process_fifo() if (CMD_LOG) { if (BIT(m_cr, 10)) - logerror("HD63484 '%s': SCLR (%d) 0x%04x, %d, %d\n", tag(), m_cr & 0x03, m_pr[0], (INT16)m_pr[1], (INT16)m_pr[2]); + logerror("HD63484 '%s': SCLR (%d) 0x%04x, %d, %d\n", tag(), m_cr & 0x03, m_pr[0], (int16_t)m_pr[1], (int16_t)m_pr[2]); else - logerror("HD63484 '%s': CLR 0x%04x, %d, %d\n", tag(), m_pr[0], (INT16)m_pr[1], (INT16)m_pr[2]); + logerror("HD63484 '%s': CLR 0x%04x, %d, %d\n", tag(), m_pr[0], (int16_t)m_pr[1], (int16_t)m_pr[2]); } command_clr_exec(); @@ -1595,9 +1595,9 @@ void hd63484_device::process_fifo() if (CMD_LOG) { if (BIT(m_cr, 12)) - logerror("HD63484 '%s': SCPY (%d, %d, %d) 0x%x, 0x%x, %d, %d\n", tag(), BIT(m_cr, 11), (m_cr >> 8) & 0x07, m_cr & 0x07, m_pr[0] & 0xff, (m_pr[1]&0xfff0) >> 4, (INT16)m_pr[2], (INT16)m_pr[3]); + logerror("HD63484 '%s': SCPY (%d, %d, %d) 0x%x, 0x%x, %d, %d\n", tag(), BIT(m_cr, 11), (m_cr >> 8) & 0x07, m_cr & 0x07, m_pr[0] & 0xff, (m_pr[1]&0xfff0) >> 4, (int16_t)m_pr[2], (int16_t)m_pr[3]); else - logerror("HD63484 '%s': CPY (%d, %d) 0x%x, 0x%x, %d, %d\n", tag(), BIT(m_cr, 11), (m_cr >> 8) & 0x07, m_pr[0] & 0xff, (m_pr[1]&0xfff0) >> 4, (INT16)m_pr[2], (INT16)m_pr[3]); + logerror("HD63484 '%s': CPY (%d, %d) 0x%x, 0x%x, %d, %d\n", tag(), BIT(m_cr, 11), (m_cr >> 8) & 0x07, m_pr[0] & 0xff, (m_pr[1]&0xfff0) >> 4, (int16_t)m_pr[2], (int16_t)m_pr[3]); } command_cpy_exec(); @@ -1609,16 +1609,16 @@ void hd63484_device::process_fifo() case COMMAND_RMOVE: if (m_param_ptr == 2) { - if (CMD_LOG) logerror("HD63484 '%s': %cMOVE %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', (INT16)m_pr[0], (INT16)m_pr[1]); + if (CMD_LOG) logerror("HD63484 '%s': %cMOVE %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', (int16_t)m_pr[0], (int16_t)m_pr[1]); if (BIT(m_cr, 10)) { - m_cpx += (INT16)m_pr[0]; - m_cpy += (INT16)m_pr[1]; + m_cpx += (int16_t)m_pr[0]; + m_cpy += (int16_t)m_pr[1]; } else { - m_cpx = (INT16)m_pr[0]; - m_cpy = (INT16)m_pr[1]; + m_cpx = (int16_t)m_pr[0]; + m_cpy = (int16_t)m_pr[1]; } command_end_seq(); } @@ -1628,7 +1628,7 @@ void hd63484_device::process_fifo() case COMMAND_ARCT: if (m_param_ptr == 2) { - if (CMD_LOG) logerror("HD63484 '%s': %cRTC (%d, %d, %d) %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (INT16)m_pr[0], (INT16)m_pr[1]); + if (CMD_LOG) logerror("HD63484 '%s': %cRTC (%d, %d, %d) %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (int16_t)m_pr[0], (int16_t)m_pr[1]); command_rct_exec(); command_end_seq(); } @@ -1638,7 +1638,7 @@ void hd63484_device::process_fifo() case COMMAND_ALINE: if (m_param_ptr == 2) { - if (CMD_LOG) logerror("HD63484 '%s': %cLINE (%d, %d, %d) %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (INT16)m_pr[0], (INT16)m_pr[1]); + if (CMD_LOG) logerror("HD63484 '%s': %cLINE (%d, %d, %d) %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (int16_t)m_pr[0], (int16_t)m_pr[1]); command_line_exec(); command_end_seq(); } @@ -1657,7 +1657,7 @@ void hd63484_device::process_fifo() { logerror("HD63484 '%s': %cPL%c (%d, %d, %d) %d", tag(), BIT(m_cr, 10) ? 'R' : 'A', m_cr & 0x2000 ? 'G' : 'L', (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, m_pr[0]); for (int i=0; i> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, m_pr[0]); - UINT16 r = m_pr[0] & 0x1fff; + uint16_t r = m_pr[0] & 0x1fff; draw_ellipse(m_cpx, m_cpy, r, r, DEGREE_TO_RADIAN(0), DEGREE_TO_RADIAN(360), BIT(m_cr, 8)); command_end_seq(); } @@ -1691,7 +1691,7 @@ void hd63484_device::process_fifo() case COMMAND_RARC: if(m_param_ptr == 4) { - if (CMD_LOG) logerror("HD63484 '%s': %cARC (%d, %d, %d, %d) %d, %d, %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', BIT(m_cr, 8), (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (INT16)m_pr[0], (INT16)m_pr[1], (INT16)m_pr[2], (INT16)m_pr[3]); + if (CMD_LOG) logerror("HD63484 '%s': %cARC (%d, %d, %d, %d) %d, %d, %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', BIT(m_cr, 8), (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (int16_t)m_pr[0], (int16_t)m_pr[1], (int16_t)m_pr[2], (int16_t)m_pr[3]); command_arc_exec(); command_end_seq(); } @@ -1711,7 +1711,7 @@ void hd63484_device::process_fifo() case COMMAND_RFRCT: if (m_param_ptr == 2) { - if (CMD_LOG) logerror("HD63484 '%s': %cFRCT (%d, %d, %d) %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (INT16)m_pr[0], (INT16)m_pr[1]); + if (CMD_LOG) logerror("HD63484 '%s': %cFRCT (%d, %d, %d) %d, %d\n", tag(), BIT(m_cr, 10) ? 'R' : 'A', (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (int16_t)m_pr[0], (int16_t)m_pr[1]); command_frct_exec(); command_end_seq(); @@ -1749,7 +1749,7 @@ void hd63484_device::process_fifo() case COMMAND_AGCPY: if (m_param_ptr == 4) { - if (CMD_LOG) logerror("HD63484 '%s': %cGCPY (%d, %d, %d, %d, %d) %d, %d, %d, %d\n", tag(), BIT(m_cr, 12) ? 'R' : 'A', (m_cr >> 11) & 0x01, (m_cr >> 8) & 0x07, (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (INT16)m_pr[0], (INT16)m_pr[1], (INT16)m_pr[2], (INT16)m_pr[3]); + if (CMD_LOG) logerror("HD63484 '%s': %cGCPY (%d, %d, %d, %d, %d) %d, %d, %d, %d\n", tag(), BIT(m_cr, 12) ? 'R' : 'A', (m_cr >> 11) & 0x01, (m_cr >> 8) & 0x07, (m_cr >> 5) & 0x07, (m_cr >> 3) & 0x03, (m_cr >> 0) & 0x07, (int16_t)m_pr[0], (int16_t)m_pr[1], (int16_t)m_pr[2], (int16_t)m_pr[3]); command_gcpy_exec(); command_end_seq(); @@ -1769,9 +1769,9 @@ void hd63484_device::exec_abort_sequence() m_sr = HD63484_SR_WFR | HD63484_SR_WFE | HD63484_SR_CED; // hard-set to 0x23 } -UINT16 hd63484_device::video_registers_r(int offset) +uint16_t hd63484_device::video_registers_r(int offset) { - UINT16 res = (m_vreg[offset] << 8) | (m_vreg[offset+1] & 0xff); + uint16_t res = (m_vreg[offset] << 8) | (m_vreg[offset+1] & 0xff); switch(offset) { @@ -1793,7 +1793,7 @@ UINT16 hd63484_device::video_registers_r(int offset) void hd63484_device::video_registers_w(int offset) { - UINT16 vreg_data; + uint16_t vreg_data; vreg_data = (m_vreg[offset]<<8)|(m_vreg[offset+1]&0xff); @@ -1913,11 +1913,11 @@ READ16_MEMBER( hd63484_device::status_r ) READ16_MEMBER( hd63484_device::data_r ) { - UINT16 res; + uint16_t res; if(m_ar == 0) // FIFO read { - UINT8 data; + uint8_t data; dequeue_r(&data); res = (data & 0xff) << 8; @@ -1963,7 +1963,7 @@ WRITE8_MEMBER( hd63484_device::address_w ) READ8_MEMBER( hd63484_device::data_r ) { - UINT8 res = 0xff; + uint8_t res = 0xff; if(m_ar < 2) // FIFO read dequeue_r(&res); @@ -2046,9 +2046,9 @@ void hd63484_device::draw_graphics_line(bitmap_ind16 &bitmap, const rectangle &c { int bpp = get_bpp(); int ppw = 16 / bpp; - UINT32 mask = (1 << bpp) - 1; - UINT32 base_offs = m_sar[layer_n] + (y - vs) * m_mwr[layer_n]; - UINT32 wind_offs = m_sar[3] + (y - m_vws) * m_mwr[3]; + uint32_t mask = (1 << bpp) - 1; + uint32_t base_offs = m_sar[layer_n] + (y - vs) * m_mwr[layer_n]; + uint32_t wind_offs = m_sar[3] + (y - m_vws) * m_mwr[3]; int step = (m_omr & 0x08) ? 2 : 1; int gai = (m_omr>>4) & 0x07; int ppmc = ppw * (1 << gai) / step; // TODO: GAI > 3 @@ -2071,7 +2071,7 @@ void hd63484_device::draw_graphics_line(bitmap_ind16 &bitmap, const rectangle &c for(int x=cliprect.min_x; x<=cliprect.max_x; x+=ppw) { - UINT16 data = 0; + uint16_t data = 0; if (ins_window && x >= ws * ppmc && x < (ws + m_hww) * ppmc) { data = readword(wind_offs); @@ -2099,7 +2099,7 @@ void hd63484_device::draw_graphics_line(bitmap_ind16 &bitmap, const rectangle &c // update_screen - //------------------------------------------------- -UINT32 hd63484_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hd63484_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int l0 = cliprect.min_y + (BIT(m_dcr, 13) ? m_sp[0] : 0); int l1 = l0 + m_sp[1]; diff --git a/src/devices/video/hd63484.h b/src/devices/video/hd63484.h index c2d927f96a7..b30df47ba3c 100644 --- a/src/devices/video/hd63484.h +++ b/src/devices/video/hd63484.h @@ -16,7 +16,7 @@ #include "emu.h" -typedef device_delegate hd63484_display_delegate; +typedef device_delegate hd63484_display_delegate; /*************************************************************************** @@ -36,7 +36,7 @@ typedef device_delegate hd63484_device @@ -47,7 +47,7 @@ class hd63484_device : public device_t, { public: // construction/destruction - hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_display_callback(device_t &device, hd63484_display_delegate callback) { downcast(device).m_display_cb = callback; } static void static_set_auto_configure_screen(device_t &device, bool auto_configure_screen) { downcast(device).m_auto_configure_screen = auto_configure_screen; } @@ -62,7 +62,7 @@ public: DECLARE_READ8_MEMBER( status_r ); DECLARE_READ8_MEMBER( data_r ); - UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual const tiny_rom_entry *device_rom_region() const override; virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; @@ -72,30 +72,30 @@ protected: virtual void device_reset() override; //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - inline UINT16 readword(offs_t address); - inline void writeword(offs_t address, UINT16 data); + inline uint16_t readword(offs_t address); + inline void writeword(offs_t address, uint16_t data); private: inline void inc_ar(int value); inline void fifo_w_clear(); - inline void queue_w(UINT8 data); - inline void dequeue_w(UINT8 *data); + inline void queue_w(uint8_t data); + inline void dequeue_w(uint8_t *data); inline void fifo_r_clear(); - inline void queue_r(UINT8 data); - inline void dequeue_r(UINT8 *data); + inline void queue_r(uint8_t data); + inline void dequeue_r(uint8_t *data); inline void recompute_parameters(); inline void command_end_seq(); - void calc_offset(INT16 x, INT16 y, UINT32 &offset, UINT8 &bit_pos); + void calc_offset(int16_t x, int16_t y, uint32_t &offset, uint8_t &bit_pos); int get_bpp(); - UINT16 get_dot(INT16 x, INT16 y); - bool set_dot(INT16 x, INT16 y, INT16 px, INT16 py); - bool set_dot(INT16 x, INT16 y, UINT16 color); - void draw_line(INT16 sx, INT16 sy, INT16 ex, INT16 ey); - void draw_ellipse(INT16 cx, INT16 cy, double dx, double dy, double s_angol, double e_angol, bool c); - void paint(INT16 sx, INT16 sy); + uint16_t get_dot(int16_t x, int16_t y); + bool set_dot(int16_t x, int16_t y, int16_t px, int16_t py); + bool set_dot(int16_t x, int16_t y, uint16_t color); + void draw_line(int16_t sx, int16_t sy, int16_t ex, int16_t ey); + void draw_ellipse(int16_t cx, int16_t cy, double dx, double dy, double s_angol, double e_angol, bool c); + void paint(int16_t sx, int16_t sy); void command_wpr_exec(); - UINT16 command_rpr_exec(); + uint16_t command_rpr_exec(); void command_clr_exec(); void command_cpy_exec(); void command_rct_exec(); @@ -109,9 +109,9 @@ private: void process_fifo(); void exec_abort_sequence(); - UINT16 video_registers_r(int offset); + uint16_t video_registers_r(int offset); void video_registers_w(int offset); - int translate_command(UINT16 data); + int translate_command(uint16_t data); void draw_graphics_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int vs, int y, int layer_n, bool active, bool ins_window); void register_save_state(); @@ -119,71 +119,71 @@ private: hd63484_display_delegate m_display_cb; bool m_auto_configure_screen; - UINT8 m_ar; - UINT8 m_vreg[0x100]; - UINT8 m_sr; + uint8_t m_ar; + uint8_t m_vreg[0x100]; + uint8_t m_sr; - UINT8 m_fifo[16]; /* FIFO W data queue */ + uint8_t m_fifo[16]; /* FIFO W data queue */ int m_fifo_ptr; /* FIFO W pointer */ - UINT8 m_fifo_r[16]; /* FIFO R data queue */ + uint8_t m_fifo_r[16]; /* FIFO R data queue */ int m_fifo_r_ptr; /* FIFO R pointer */ - UINT16 m_cr; - UINT16 m_pr[0x100]; /* parameter byte register */ + uint16_t m_cr; + uint16_t m_pr[0x100]; /* parameter byte register */ int m_param_ptr; /* parameter pointer */ - UINT32 m_rwp[4]; - UINT8 m_rwp_dn; - - UINT32 m_org_dpa; - UINT8 m_org_dn; - UINT8 m_org_dpd; - UINT16 m_cl0; - UINT16 m_cl1; - UINT16 m_ccmp; - UINT16 m_mask; - - INT16 m_cpx; - INT16 m_cpy; - - UINT16 m_mwr[4]; - UINT8 m_mwr_chr[4]; - - UINT32 m_sar[4]; - UINT8 m_sda[4]; - - UINT16 m_pram[0x10]; - UINT8 m_dn; - - UINT16 m_ccr; - UINT16 m_omr; - UINT16 m_edg; - UINT16 m_dcr; - - UINT16 m_hc, m_hds, m_hdw, m_hws, m_hww; - UINT16 m_sp[3]; - UINT8 m_hsw; - - UINT16 m_vc, m_vws, m_vww, m_vds; - UINT8 m_vsw; - - UINT16 m_ppy; - UINT16 m_pzcy; - UINT16 m_ppx; - UINT16 m_pzcx; - UINT16 m_psx; - UINT16 m_pex; - UINT16 m_pzx; - UINT16 m_psy; - UINT16 m_pzy; - UINT16 m_pey; - - UINT16 m_xmin; - UINT16 m_ymin; - UINT16 m_xmax; - UINT16 m_ymax; + uint32_t m_rwp[4]; + uint8_t m_rwp_dn; + + uint32_t m_org_dpa; + uint8_t m_org_dn; + uint8_t m_org_dpd; + uint16_t m_cl0; + uint16_t m_cl1; + uint16_t m_ccmp; + uint16_t m_mask; + + int16_t m_cpx; + int16_t m_cpy; + + uint16_t m_mwr[4]; + uint8_t m_mwr_chr[4]; + + uint32_t m_sar[4]; + uint8_t m_sda[4]; + + uint16_t m_pram[0x10]; + uint8_t m_dn; + + uint16_t m_ccr; + uint16_t m_omr; + uint16_t m_edg; + uint16_t m_dcr; + + uint16_t m_hc, m_hds, m_hdw, m_hws, m_hww; + uint16_t m_sp[3]; + uint8_t m_hsw; + + uint16_t m_vc, m_vws, m_vww, m_vds; + uint8_t m_vsw; + + uint16_t m_ppy; + uint16_t m_pzcy; + uint16_t m_ppx; + uint16_t m_pzcx; + uint16_t m_psx; + uint16_t m_pex; + uint16_t m_pzx; + uint16_t m_psy; + uint16_t m_pzy; + uint16_t m_pey; + + uint16_t m_xmin; + uint16_t m_ymin; + uint16_t m_xmax; + uint16_t m_ymax; const address_space_config m_space_config; }; diff --git a/src/devices/video/hd66421.cpp b/src/devices/video/hd66421.cpp index 513b028336f..5b597416222 100644 --- a/src/devices/video/hd66421.cpp +++ b/src/devices/video/hd66421.cpp @@ -92,7 +92,7 @@ const address_space_config *hd66421_device::memory_space_config(address_spacenum // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT8 hd66421_device::readbyte(offs_t address) +inline uint8_t hd66421_device::readbyte(offs_t address) { return space().read_byte(address); } @@ -102,7 +102,7 @@ inline UINT8 hd66421_device::readbyte(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void hd66421_device::writebyte(offs_t address, UINT8 data) +inline void hd66421_device::writebyte(offs_t address, uint8_t data) { space().write_byte(address, data); } @@ -116,7 +116,7 @@ inline void hd66421_device::writebyte(offs_t address, UINT8 data) // hd66421_device - constructor //------------------------------------------------- -hd66421_device::hd66421_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd66421_device::hd66421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HD66421, "Hitachi HD66421 LCD Controller", tag, owner, clock, "hd66421", __FILE__), device_memory_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 17, 0, nullptr, *ADDRESS_MAP_NAME(hd66421)), @@ -180,7 +180,7 @@ WRITE8_MEMBER( hd66421_device::reg_dat_w ) case LCD_REG_RAM : { - UINT8 r1; + uint8_t r1; writebyte(m_y * (HD66421_WIDTH / 4) + m_x, data); r1 = m_reg[LCD_REG_CONTROL_2]; if (r1 & 0x02) @@ -201,12 +201,12 @@ WRITE8_MEMBER( hd66421_device::reg_dat_w ) } } -void hd66421_device::plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color) +void hd66421_device::plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color) { - bitmap.pix16(y, x) = (UINT16)color; + bitmap.pix16(y, x) = (uint16_t)color; } -UINT32 hd66421_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hd66421_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { pen_t pen[4]; diff --git a/src/devices/video/hd66421.h b/src/devices/video/hd66421.h index e02382f4fac..d7a00d91107 100644 --- a/src/devices/video/hd66421.h +++ b/src/devices/video/hd66421.h @@ -44,7 +44,7 @@ class hd66421_device : public device_t, { public: // construction/destruction - hd66421_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd66421_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( reg_idx_r ); DECLARE_WRITE8_MEMBER( reg_idx_w ); @@ -52,7 +52,7 @@ public: DECLARE_WRITE8_MEMBER( reg_dat_w ); DECLARE_PALETTE_INIT(hd66421); - UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -65,13 +65,13 @@ protected: // address space configurations const address_space_config m_space_config; - inline UINT8 readbyte(offs_t address); - inline void writebyte(offs_t address, UINT8 data); + inline uint8_t readbyte(offs_t address); + inline void writebyte(offs_t address, uint8_t data); - void plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color); + void plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color); private: - UINT8 m_cmd, m_reg[32]; + uint8_t m_cmd, m_reg[32]; int m_x, m_y; required_device m_palette; }; diff --git a/src/devices/video/huc6202.cpp b/src/devices/video/huc6202.cpp index bbe29e2ade0..989875fd99d 100644 --- a/src/devices/video/huc6202.cpp +++ b/src/devices/video/huc6202.cpp @@ -14,7 +14,7 @@ const device_type HUC6202 = &device_creator; -huc6202_device::huc6202_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +huc6202_device::huc6202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HUC6202, "HuC6202 VPC", tag, owner, clock, "huc6202", __FILE__), m_next_pixel_0_cb(*this), m_time_til_next_event_0_cb(*this), @@ -34,10 +34,10 @@ huc6202_device::huc6202_device(const machine_config &mconfig, const char *tag, d READ16_MEMBER( huc6202_device::next_pixel ) { - UINT16 data = huc6270_device::HUC6270_BACKGROUND; + uint16_t data = huc6270_device::HUC6270_BACKGROUND; - UINT16 data_0 = m_next_pixel_0_cb( 0, 0xffff ); - UINT16 data_1 = m_next_pixel_1_cb( 0, 0xffff ); + uint16_t data_0 = m_next_pixel_0_cb( 0, 0xffff ); + uint16_t data_1 = m_next_pixel_1_cb( 0, 0xffff ); if ( data_0 == huc6270_device::HUC6270_SPRITE && data_1 == huc6270_device::HUC6270_SPRITE ) { @@ -63,7 +63,7 @@ READ16_MEMBER( huc6202_device::next_pixel ) } else { - UINT8 prio_index = m_prio_map[ m_map_index ]; + uint8_t prio_index = m_prio_map[ m_map_index ]; if ( m_prio[ prio_index ].dev0_enabled && data_0 != huc6270_device::HUC6270_SPRITE ) { @@ -152,8 +152,8 @@ READ16_MEMBER( huc6202_device::next_pixel ) READ16_MEMBER( huc6202_device::time_until_next_event ) { - UINT16 next_event_clocks_0 = m_time_til_next_event_0_cb( 0, 0xffff ); - UINT16 next_event_clocks_1 = m_time_til_next_event_1_cb( 0, 0xffff ); + uint16_t next_event_clocks_0 = m_time_til_next_event_0_cb( 0, 0xffff ); + uint16_t next_event_clocks_1 = m_time_til_next_event_1_cb( 0, 0xffff ); return std::min( next_event_clocks_0, next_event_clocks_1 ); } @@ -175,7 +175,7 @@ WRITE_LINE_MEMBER( huc6202_device::hsync_changed ) READ8_MEMBER( huc6202_device::read ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; switch ( offset & 7 ) { diff --git a/src/devices/video/huc6202.h b/src/devices/video/huc6202.h index c9920bd333e..57d28adae25 100644 --- a/src/devices/video/huc6202.h +++ b/src/devices/video/huc6202.h @@ -53,7 +53,7 @@ class huc6202_device : public device_t { public: // construction/destruction - huc6202_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + huc6202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_next_pixel_0_callback(device_t &device, _Object object) { return downcast(device).m_next_pixel_0_cb.set_callback(object); } template static devcb_base &set_time_til_next_event_0_callback(device_t &device, _Object object) { return downcast(device).m_time_til_next_event_0_cb.set_callback(object); } @@ -110,16 +110,16 @@ private: devcb_write8 m_write_1_cb; struct { - UINT8 prio_type; - UINT8 dev0_enabled; - UINT8 dev1_enabled; + uint8_t prio_type; + uint8_t dev0_enabled; + uint8_t dev1_enabled; } m_prio[4]; - UINT16 m_window1; - UINT16 m_window2; + uint16_t m_window1; + uint16_t m_window2; int m_io_device; int m_map_index; int m_map_dirty; - UINT8 m_prio_map[512]; + uint8_t m_prio_map[512]; }; diff --git a/src/devices/video/huc6260.cpp b/src/devices/video/huc6260.cpp index ca9a9b0510d..8a90b800bd9 100644 --- a/src/devices/video/huc6260.cpp +++ b/src/devices/video/huc6260.cpp @@ -45,7 +45,7 @@ PALETTE_INIT_MEMBER(huc6260_device, huc6260) const device_type HUC6260 = &device_creator; -huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HUC6260, "HuC6260 VCE", tag, owner, clock, "huc6260", __FILE__), device_video_interface(mconfig, *this), m_next_pixel_data_cb(*this), @@ -62,7 +62,7 @@ void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int para int hpos = m_screen->hpos(); int h = m_last_h; int v = m_last_v; - UINT16 *bitmap_line = &m_bmp->pix16(v); + uint16_t *bitmap_line = &m_bmp->pix16(v); while ( h != hpos || v != vpos ) { @@ -146,7 +146,7 @@ void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int para /* Ask our slave device for time until next possible event */ { - UINT16 next_event_clocks = m_time_til_next_event_cb( 0, 0xffff ); + uint16_t next_event_clocks = m_time_til_next_event_cb( 0, 0xffff ); int event_hpos, event_vpos; /* Adjust for pixel clocks per pixel */ @@ -198,7 +198,7 @@ WRITE8_MEMBER(huc6260_device::palette_direct_write) READ8_MEMBER( huc6260_device::read ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; switch ( offset & 7 ) { diff --git a/src/devices/video/huc6260.h b/src/devices/video/huc6260.h index 85552fbd265..7c1cb117f39 100644 --- a/src/devices/video/huc6260.h +++ b/src/devices/video/huc6260.h @@ -38,7 +38,7 @@ class huc6260_device : public device_t, { public: // construction/destruction - huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_next_pixel_data_callback(device_t &device, _Object object) { return downcast(device).m_next_pixel_data_cb.set_callback(object); } template static devcb_base &set_time_til_next_event_callback(device_t &device, _Object object) { return downcast(device).m_time_til_next_event_cb.set_callback(object); } @@ -79,13 +79,13 @@ private: /* Callback function which gets called when hsync changes */ devcb_write_line m_hsync_changed_cb; - UINT16 m_palette[512]; - UINT16 m_address; - UINT8 m_greyscales; /* Should the HuC6260 output grey or color graphics */ - UINT8 m_blur; /* Should the edges of graphics be blurred/Select screen height 0=262, 1=263 */ - UINT8 m_pixels_per_clock; /* Number of pixels to output per colour clock */ - UINT16 m_pixel_data; - UINT8 m_pixel_clock; + uint16_t m_palette[512]; + uint16_t m_address; + uint8_t m_greyscales; /* Should the HuC6260 output grey or color graphics */ + uint8_t m_blur; /* Should the edges of graphics be blurred/Select screen height 0=262, 1=263 */ + uint8_t m_pixels_per_clock; /* Number of pixels to output per colour clock */ + uint16_t m_pixel_data; + uint8_t m_pixel_clock; emu_timer *m_timer; std::unique_ptr m_bmp; diff --git a/src/devices/video/huc6261.cpp b/src/devices/video/huc6261.cpp index 69caa26008e..91e02b86654 100644 --- a/src/devices/video/huc6261.cpp +++ b/src/devices/video/huc6261.cpp @@ -25,7 +25,7 @@ const device_type HUC6261 = &device_creator; -huc6261_device::huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +huc6261_device::huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HUC6261, "HuC6261", tag, owner, clock, "huc6261", __FILE__), device_video_interface(mconfig, *this), m_huc6270_a_tag(nullptr), m_huc6270_b_tag(nullptr), m_huc6270_a(nullptr), m_huc6270_b(nullptr), m_last_h(0), m_last_v(0), m_height(0), m_address(0), m_palette_latch(0), m_register(0), m_control(0), m_pixels_per_clock(0), m_pixel_data(0), m_pixel_clock(0), m_timer(nullptr), m_bmp(nullptr) { @@ -34,9 +34,9 @@ huc6261_device::huc6261_device(const machine_config &mconfig, const char *tag, d { for ( int vr = 0; vr < 256; vr++ ) { - INT32 r,g,b; - INT32 u = ur - 128; - INT32 v = vr - 128; + int32_t r,g,b; + int32_t u = ur - 128; + int32_t v = vr - 128; r = - 1.13983 * v; g = -0.35465 * u - 0.58060 * v; @@ -50,11 +50,11 @@ huc6261_device::huc6261_device(const machine_config &mconfig, const char *tag, d } -inline UINT32 huc6261_device::yuv2rgb(UINT32 yuv) +inline uint32_t huc6261_device::yuv2rgb(uint32_t yuv) { - INT32 r, g, b; - UINT8 y = yuv >> 16; - UINT16 uv = yuv & 0xffff; + int32_t r, g, b; + uint8_t y = yuv >> 16; + uint16_t uv = yuv & 0xffff; r = y + m_uv_lookup[uv][0]; g = y + m_uv_lookup[uv][1]; @@ -76,7 +76,7 @@ void huc6261_device::device_timer(emu_timer &timer, device_timer_id id, int para int hpos = m_screen->hpos(); int h = m_last_h; int v = m_last_v; - UINT32 *bitmap_line = &m_bmp->pix32(v); + uint32_t *bitmap_line = &m_bmp->pix32(v); while ( h != hpos || v != vpos ) { @@ -161,7 +161,7 @@ void huc6261_device::device_timer(emu_timer &timer, device_timer_id id, int para /* Ask our slave device for time until next possible event */ { - UINT16 next_event_clocks = HUC6261_WPF; //m_get_time_til_next_event( 0, 0xffff ); + uint16_t next_event_clocks = HUC6261_WPF; //m_get_time_til_next_event( 0, 0xffff ); int event_hpos, event_vpos; /* Adjust for pixel clocks per pixel */ @@ -200,15 +200,15 @@ void huc6261_device::video_update( bitmap_rgb32 &bitmap, const rectangle &clipre READ16_MEMBER( huc6261_device::read ) { - UINT16 data = 0xFFFF; + uint16_t data = 0xFFFF; switch ( offset & 1 ) { /* Status info */ case 0x00: { - UINT16 vpos = m_screen->vpos(); - UINT16 hpos = m_screen->hpos(); + uint16_t vpos = m_screen->vpos(); + uint16_t hpos = m_screen->hpos(); data = ( vpos << 5 ) | ( m_register & 0x1F); diff --git a/src/devices/video/huc6261.h b/src/devices/video/huc6261.h index ab04cd01c22..a6f5b0f55a2 100644 --- a/src/devices/video/huc6261.h +++ b/src/devices/video/huc6261.h @@ -31,7 +31,7 @@ class huc6261_device : public device_t, { public: // construction/destruction - huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_vdc1_tag(device_t &device, const char *tag) { downcast(device).m_huc6270_a_tag = tag; } static void set_vdc2_tag(device_t &device, const char *tag) { downcast(device).m_huc6270_b_tag = tag; } @@ -40,7 +40,7 @@ public: DECLARE_READ16_MEMBER( read ); DECLARE_WRITE16_MEMBER( write ); - inline UINT32 yuv2rgb(UINT32 yuv); + inline uint32_t yuv2rgb(uint32_t yuv); protected: // device-level overrides @@ -58,20 +58,20 @@ private: int m_last_v; int m_height; - UINT16 m_palette[512]; - UINT16 m_address; - UINT16 m_palette_latch; - UINT16 m_register; - UINT16 m_control; - UINT8 m_priority[7]; + uint16_t m_palette[512]; + uint16_t m_address; + uint16_t m_palette_latch; + uint16_t m_register; + uint16_t m_control; + uint8_t m_priority[7]; - UINT8 m_pixels_per_clock; /* Number of pixels to output per colour clock */ - UINT16 m_pixel_data; - UINT8 m_pixel_clock; + uint8_t m_pixels_per_clock; /* Number of pixels to output per colour clock */ + uint16_t m_pixel_data; + uint8_t m_pixel_clock; emu_timer *m_timer; std::unique_ptr m_bmp; - INT32 m_uv_lookup[65536][3]; + int32_t m_uv_lookup[65536][3]; }; diff --git a/src/devices/video/huc6270.cpp b/src/devices/video/huc6270.cpp index 027d75bb05f..a0ee56cf8e4 100644 --- a/src/devices/video/huc6270.cpp +++ b/src/devices/video/huc6270.cpp @@ -94,9 +94,9 @@ ALLOW_SAVE_TYPE(huc6270_device::huc6270_h_state); const device_type HUC6270 = &device_creator; -const UINT8 huc6270_device::vram_increments[4] = { 1, 32, 64, 128 }; +const uint8_t huc6270_device::vram_increments[4] = { 1, 32, 64, 128 }; -huc6270_device::huc6270_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +huc6270_device::huc6270_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HUC6270, "HuC6270 VDC", tag, owner, clock, "huc6270", __FILE__), m_vram_size(0), m_irq_changed_cb(*this) @@ -109,7 +109,7 @@ huc6270_device::huc6270_device(const machine_config &mconfig, const char *tag, d */ inline void huc6270_device::fetch_bat_tile_row() { - UINT16 bat_data, data1, data2, data3, data4, tile_palette; + uint16_t bat_data, data1, data2, data3, data4, tile_palette; int i; bat_data = m_vram[ m_bat_address & m_vram_mask ]; @@ -122,7 +122,7 @@ inline void huc6270_device::fetch_bat_tile_row() for ( i = 7; i >= 0; i-- ) { - UINT16 c = ( data1 & 0x01 ) | ( data2 & 0x02 ) | ( data3 & 0x04 ) | ( data4 & 0x08 ); + uint16_t c = ( data1 & 0x01 ) | ( data2 & 0x02 ) | ( data3 & 0x04 ) | ( data4 & 0x08 ); /* Colour 0 for background tiles is always taken from palette 0 */ if ( c ) @@ -144,7 +144,7 @@ void huc6270_device::add_sprite( int index, int x, int pattern, int line, int fl if ( i < 16 ) { - UINT32 b0, b1, b2, b3; + uint32_t b0, b1, b2, b3; int j; if ( flip_x ) @@ -177,7 +177,7 @@ void huc6270_device::add_sprite( int index, int x, int pattern, int line, int fl for ( j = 15; j >= 0; j-- ) { - UINT8 data = ( b3 & 0x08 ) | ( b2 & 0x04 ) | ( b1 & 0x02 ) | ( b0 & 0x01 ); + uint8_t data = ( b3 & 0x08 ) | ( b2 & 0x04 ) | ( b1 & 0x02 ) | ( b0 & 0x01 ); if ( data ) { @@ -369,7 +369,7 @@ inline void huc6270_device::next_horz_state() m_horz_to_go = ( m_hdr & 0x7F ) + 1; { static const int width_shift[4] = { 5, 6, 7, 7 }; - UINT16 v; + uint16_t v; v = ( m_byr_latched ) & ( ( m_mwr & 0x40 ) ? 0x1FF : 0xFF ); m_bat_row = v & 7; @@ -409,7 +409,7 @@ inline void huc6270_device::next_horz_state() READ16_MEMBER( huc6270_device::next_pixel ) { - UINT16 data = HUC6270_SPRITE; + uint16_t data = HUC6270_SPRITE; /* Check if we're on an active display line */ if ( m_vert_state == HUC6270_VDW ) @@ -417,7 +417,7 @@ READ16_MEMBER( huc6270_device::next_pixel ) /* Check if we're in active display area */ if ( m_horz_state == HUC6270_HDW ) { - UINT8 sprite_data = m_sprite_row[ m_sprite_row_index ] & 0x00FF; + uint8_t sprite_data = m_sprite_row[ m_sprite_row_index ] & 0x00FF; int collission = ( m_sprite_row[ m_sprite_row_index ] & 0x8000 ) ? 1 : 0; if ( m_cr & 0x80 ) @@ -511,7 +511,7 @@ WRITE_LINE_MEMBER( huc6270_device::vsync_changed ) if (LOG) logerror("doing dma sour = %04x, desr = %04x, lenr = %04x\n", m_sour, m_desr, m_lenr ); do { - UINT16 data = m_vram[ m_sour & m_vram_mask ]; + uint16_t data = m_vram[ m_sour & m_vram_mask ]; m_vram[ m_desr & m_vram_mask ] = data; m_sour += sour_inc; m_desr += desr_inc; @@ -579,7 +579,7 @@ WRITE_LINE_MEMBER( huc6270_device::hsync_changed ) READ8_MEMBER( huc6270_device::read ) { - UINT8 data = 0x00; + uint8_t data = 0x00; switch ( offset & 3 ) { @@ -804,10 +804,10 @@ void huc6270_device::device_start() /* Resolve callbacks */ m_irq_changed_cb.resolve_safe(); - m_vram = make_unique_clear(m_vram_size/sizeof(UINT16)); + m_vram = make_unique_clear(m_vram_size/sizeof(uint16_t)); m_vram_mask = (m_vram_size >> 1) - 1; - save_pointer(NAME(m_vram.get()), m_vram_size/sizeof(UINT16)); + save_pointer(NAME(m_vram.get()), m_vram_size/sizeof(uint16_t)); save_item(NAME(m_register_index)); save_item(NAME(m_mawr)); diff --git a/src/devices/video/huc6270.h b/src/devices/video/huc6270.h index fdaca3b4f5c..fb80aaa08a4 100644 --- a/src/devices/video/huc6270.h +++ b/src/devices/video/huc6270.h @@ -21,9 +21,9 @@ class huc6270_device : public device_t { public: // construction/destruction - huc6270_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + huc6270_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_vram_size(device_t &device, UINT32 vram_size) { downcast(device).m_vram_size = vram_size; } + static void set_vram_size(device_t &device, uint32_t vram_size) { downcast(device).m_vram_size = vram_size; } template static devcb_base &set_irq_changed_callback(device_t &device, _Object object) { return downcast(device).m_irq_changed_cb.set_callback(object); } DECLARE_READ8_MEMBER( read ); @@ -37,8 +37,8 @@ public: DECLARE_WRITE_LINE_MEMBER( vsync_changed ); DECLARE_WRITE_LINE_MEMBER( hsync_changed ); - static const UINT16 HUC6270_SPRITE = 0x0100; // sprite colour information - static const UINT16 HUC6270_BACKGROUND = 0x0000; // background colour information + static const uint16_t HUC6270_SPRITE = 0x0100; // sprite colour information + static const uint16_t HUC6270_BACKGROUND = 0x0000; // background colour information protected: // device-level overrides @@ -70,34 +70,34 @@ private: /* Size of Video ram (mandatory) */ - UINT32 m_vram_size; + uint32_t m_vram_size; /* Callback for when the irq line may have changed (mandatory) */ devcb_write_line m_irq_changed_cb; - UINT8 m_register_index; + uint8_t m_register_index; /* HuC6270 registers */ - UINT16 m_mawr; - UINT16 m_marr; - UINT16 m_vrr; - UINT16 m_vwr; - UINT16 m_cr; - UINT16 m_rcr; - UINT16 m_bxr; - UINT16 m_byr; - UINT16 m_mwr; - UINT16 m_hsr; - UINT16 m_hdr; - UINT16 m_vpr; - UINT16 m_vdw; - UINT16 m_vcr; - UINT16 m_dcr; - UINT16 m_sour; - UINT16 m_desr; - UINT16 m_lenr; - UINT16 m_dvssr; - UINT8 m_status; + uint16_t m_mawr; + uint16_t m_marr; + uint16_t m_vrr; + uint16_t m_vwr; + uint16_t m_cr; + uint16_t m_rcr; + uint16_t m_bxr; + uint16_t m_byr; + uint16_t m_mwr; + uint16_t m_hsr; + uint16_t m_hdr; + uint16_t m_vpr; + uint16_t m_vdw; + uint16_t m_vcr; + uint16_t m_dcr; + uint16_t m_sour; + uint16_t m_desr; + uint16_t m_lenr; + uint16_t m_dvssr; + uint8_t m_status; /* To keep track of external hsync and vsync signals */ int m_hsync; @@ -114,24 +114,24 @@ private: int m_dvssr_written; int m_satb_countdown; int m_dma_enabled; - UINT16 m_byr_latched; - UINT16 m_bxr_latched; - UINT16 m_bat_address; - UINT16 m_bat_address_mask; - UINT16 m_bat_row; - UINT16 m_bat_column; - UINT8 m_bat_tile_row[8]; + uint16_t m_byr_latched; + uint16_t m_bxr_latched; + uint16_t m_bat_address; + uint16_t m_bat_address_mask; + uint16_t m_bat_row; + uint16_t m_bat_column; + uint8_t m_bat_tile_row[8]; /* Internal sprite attribute table. SATB DMA is used to transfer data from VRAM to this internal table. */ - UINT16 m_sat[4*64]; + uint16_t m_sat[4*64]; int m_sprites_this_line; int m_sprite_row_index; - UINT16 m_sprite_row[1024]; - std::unique_ptr m_vram; - UINT16 m_vram_mask; + uint16_t m_sprite_row[1024]; + std::unique_ptr m_vram; + uint16_t m_vram_mask; - const static UINT8 vram_increments[4]; + const static uint8_t vram_increments[4]; }; diff --git a/src/devices/video/huc6272.cpp b/src/devices/video/huc6272.cpp index f76dd257d7f..dce9cb7fe5c 100644 --- a/src/devices/video/huc6272.cpp +++ b/src/devices/video/huc6272.cpp @@ -42,7 +42,7 @@ const address_space_config *huc6272_device::memory_space_config(address_spacenum // read_dword - read a dword at the given address //------------------------------------------------- -inline UINT32 huc6272_device::read_dword(offs_t address) +inline uint32_t huc6272_device::read_dword(offs_t address) { return space().read_dword(address << 2); } @@ -52,7 +52,7 @@ inline UINT32 huc6272_device::read_dword(offs_t address) // write_dword - write a dword at the given address //------------------------------------------------- -inline void huc6272_device::write_dword(offs_t address, UINT32 data) +inline void huc6272_device::write_dword(offs_t address, uint32_t data) { space().write_dword(address << 2, data); } @@ -65,7 +65,7 @@ inline void huc6272_device::write_dword(offs_t address, UINT32 data) // huc6272_device - constructor //------------------------------------------------- -huc6272_device::huc6272_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +huc6272_device::huc6272_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, huc6272, "huc6272", tag, owner, clock, "huc6272", __FILE__), device_memory_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 32, 32, 0, nullptr, *ADDRESS_MAP_NAME(huc6272_vram)) @@ -107,7 +107,7 @@ void huc6272_device::device_reset() READ32_MEMBER( huc6272_device::read ) { - UINT32 res = 0; + uint32_t res = 0; if((offset & 1) == 0) { diff --git a/src/devices/video/huc6272.h b/src/devices/video/huc6272.h index 27bd14636e2..9a2e173f919 100644 --- a/src/devices/video/huc6272.h +++ b/src/devices/video/huc6272.h @@ -32,7 +32,7 @@ class huc6272_device : public device_t, { public: // construction/destruction - huc6272_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + huc6272_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE32_MEMBER( write ); @@ -47,19 +47,19 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; private: - inline UINT32 read_dword(offs_t address); - inline void write_dword(offs_t address, UINT32 data); - UINT8 m_register; - UINT32 m_kram_addr_r, m_kram_addr_w; - UINT16 m_kram_inc_r,m_kram_inc_w; - UINT8 m_kram_page_r,m_kram_page_w; - UINT32 m_page_setting; - UINT8 m_bgmode[4]; + inline uint32_t read_dword(offs_t address); + inline void write_dword(offs_t address, uint32_t data); + uint8_t m_register; + uint32_t m_kram_addr_r, m_kram_addr_w; + uint16_t m_kram_inc_r,m_kram_inc_w; + uint8_t m_kram_page_r,m_kram_page_w; + uint32_t m_page_setting; + uint8_t m_bgmode[4]; struct{ - UINT8 addr; - UINT8 ctrl; - UINT16 data[16]; + uint8_t addr; + uint8_t ctrl; + uint16_t data[16]; }m_micro_prg; const address_space_config m_space_config; diff --git a/src/devices/video/i8244.cpp b/src/devices/video/i8244.cpp index 8adb5b5ed15..81cab914fb6 100644 --- a/src/devices/video/i8244.cpp +++ b/src/devices/video/i8244.cpp @@ -20,7 +20,7 @@ const device_type I8245 = &device_creator; // Kevtris verified that the data below matches a dump // taken from a real chip. -static const UINT8 c_shape[0x40 * 8] = +static const uint8_t c_shape[0x40 * 8] = { 0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00, // 0 0x18,0x38,0x18,0x18,0x18,0x18,0x3C,0x00, @@ -91,7 +91,7 @@ static const UINT8 c_shape[0x40 * 8] = // Background and grid information is stored in RGB format // while the character and sprite colors are stored in BGR // format. -static const UINT8 bgr2rgb[8] = +static const uint8_t bgr2rgb[8] = { 0x00, 0x04, 0x02, 0x06, 0x01, 0x05, 0x03, 0x07 }; @@ -101,7 +101,7 @@ static const UINT8 bgr2rgb[8] = // i8244_device - constructor //------------------------------------------------- -i8244_device::i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8244_device::i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8244, "I8244", tag, owner, clock, "i8244", __FILE__) , device_sound_interface(mconfig, *this) , device_video_interface(mconfig, *this) @@ -114,7 +114,7 @@ i8244_device::i8244_device(const machine_config &mconfig, const char *tag, devic } -i8244_device::i8244_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int lines, const char *shortname, const char *source) +i8244_device::i8244_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int lines, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) , device_sound_interface(mconfig, *this) , device_video_interface(mconfig, *this) @@ -127,7 +127,7 @@ i8244_device::i8244_device(const machine_config &mconfig, device_type type, cons } -i8245_device::i8245_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +i8245_device::i8245_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : i8244_device(mconfig, I8245, "I8245", tag, owner, clock, i8245_device::LINES, "i8245", __FILE__) { } @@ -184,7 +184,7 @@ void i8244_device::device_reset() PALETTE_INIT_MEMBER(i8244_device, i8244) { - static const UINT8 i8244_colors[3*16] = + static const uint8_t i8244_colors[3*16] = { 0x00, 0x00, 0x00, // i r g b 0x00, 0x00, 0xAA, // i r g B @@ -285,7 +285,7 @@ offs_t i8244_device::fix_register_mirrors( offs_t offset ) READ8_MEMBER(i8244_device::read) { - UINT8 data; + uint8_t data; offset = fix_register_mirrors( offset ); @@ -398,16 +398,16 @@ READ_LINE_MEMBER(i8244_device::hblank) void i8244_device::render_scanline(int vpos) { // Some local constants for this method - //static const UINT8 COLLISION_SPRITE_0 = 0x01; - //static const UINT8 COLLISION_SPRITE_1 = 0x02; - //static const UINT8 COLLISION_SPRITE_2 = 0x04; - //static const UINT8 COLLISION_SPRITE_3 = 0x08; - static const UINT8 COLLISION_VERTICAL_GRID = 0x10; - static const UINT8 COLLISION_HORIZ_GRID_DOTS = 0x20; - //static const UINT8 COLLISION_EXTERNAL_UNUSED = 0x40; - static const UINT8 COLLISION_CHARACTERS = 0x80; + //static const uint8_t COLLISION_SPRITE_0 = 0x01; + //static const uint8_t COLLISION_SPRITE_1 = 0x02; + //static const uint8_t COLLISION_SPRITE_2 = 0x04; + //static const uint8_t COLLISION_SPRITE_3 = 0x08; + static const uint8_t COLLISION_VERTICAL_GRID = 0x10; + static const uint8_t COLLISION_HORIZ_GRID_DOTS = 0x20; + //static const uint8_t COLLISION_EXTERNAL_UNUSED = 0x40; + static const uint8_t COLLISION_CHARACTERS = 0x80; - UINT8 collision_map[160]; + uint8_t collision_map[160]; if ( vpos == m_start_vpos ) { @@ -431,7 +431,7 @@ void i8244_device::render_scanline(int vpos) /* Display grid if enabled */ if ( m_vdc.s.control & 0x08 ) { - UINT16 color = ( m_vdc.s.color & 7 ) | ( ( m_vdc.s.color >> 3 ) & 0x08 ); + uint16_t color = ( m_vdc.s.color & 7 ) | ( ( m_vdc.s.color >> 3 ) & 0x08 ); int x_grid_offset = 8; int y_grid_offset = 24; int width = 16; @@ -510,12 +510,12 @@ void i8244_device::render_scanline(int vpos) if ( y >= 0x0E && y <= scanline && scanline < y + height * 2 ) { - UINT16 color = 8 + bgr2rgb[ ( ( m_vdc.s.foreground[i].color >> 1 ) & 0x07 ) ]; + uint16_t color = 8 + bgr2rgb[ ( ( m_vdc.s.foreground[i].color >> 1 ) & 0x07 ) ]; int offset = ( m_vdc.s.foreground[i].ptr | ( ( m_vdc.s.foreground[i].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( scanline - y ) >> 1 ); - UINT8 chr = c_shape[ offset & 0x1FF ]; + uint8_t chr = c_shape[ offset & 0x1FF ]; int x = m_vdc.s.foreground[i].x; - for ( UINT8 m = 0x80; m > 0; m >>= 1, x++ ) + for ( uint8_t m = 0x80; m > 0; m >>= 1, x++ ) { if ( chr & m ) { @@ -557,11 +557,11 @@ void i8244_device::render_scanline(int vpos) { if ( y <= scanline && scanline < y + char_height * 2 ) { - UINT16 color = 8 + bgr2rgb[ ( ( m_vdc.s.quad[i].single[j].color >> 1 ) & 0x07 ) ]; + uint16_t color = 8 + bgr2rgb[ ( ( m_vdc.s.quad[i].single[j].color >> 1 ) & 0x07 ) ]; int offset = ( m_vdc.s.quad[i].single[j].ptr | ( ( m_vdc.s.quad[i].single[j].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( scanline - y ) >> 1 ); - UINT8 chr = c_shape[ offset & 0x1FF ]; + uint8_t chr = c_shape[ offset & 0x1FF ]; - for ( UINT8 m = 0x80; m > 0; m >>= 1, x++ ) + for ( uint8_t m = 0x80; m > 0; m >>= 1, x++ ) { if ( chr & m ) { @@ -603,8 +603,8 @@ void i8244_device::render_scanline(int vpos) /* Zoomed sprite */ if ( y <= scanline && scanline < y + height * 4 ) { - UINT16 color = 8 + bgr2rgb[ ( ( m_vdc.s.sprites[i].color >> 3 ) & 0x07 ) ]; - UINT8 chr = m_vdc.s.shape[i][ ( ( scanline - y ) >> 2 ) ]; + uint16_t color = 8 + bgr2rgb[ ( ( m_vdc.s.sprites[i].color >> 3 ) & 0x07 ) ]; + uint8_t chr = m_vdc.s.shape[i][ ( ( scanline - y ) >> 2 ) ]; int x = m_vdc.s.sprites[i].x; int x_shift = 0; @@ -622,7 +622,7 @@ void i8244_device::render_scanline(int vpos) } x_shift <<= 1; - for ( UINT8 m = 0x01; m > 0; m <<= 1, x += 2 ) + for ( uint8_t m = 0x01; m > 0; m <<= 1, x += 2 ) { if ( chr & m ) { @@ -670,8 +670,8 @@ void i8244_device::render_scanline(int vpos) /* Regular sprite */ if ( y <= scanline && scanline < y + height * 2 ) { - UINT16 color = 8 + bgr2rgb[ ( ( m_vdc.s.sprites[i].color >> 3 ) & 0x07 ) ]; - UINT8 chr = m_vdc.s.shape[i][ ( ( scanline - y ) >> 1 ) ]; + uint16_t color = 8 + bgr2rgb[ ( ( m_vdc.s.sprites[i].color >> 3 ) & 0x07 ) ]; + uint8_t chr = m_vdc.s.shape[i][ ( ( scanline - y ) >> 1 ) ]; int x = m_vdc.s.sprites[i].x; int x_shift = 0; @@ -688,7 +688,7 @@ void i8244_device::render_scanline(int vpos) break; } - for ( UINT8 m = 0x01; m > 0; m <<= 1, x++ ) + for ( uint8_t m = 0x01; m > 0; m <<= 1, x++ ) { if ( chr & m ) { @@ -734,7 +734,7 @@ void i8244_device::render_scanline(int vpos) void i8244_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - UINT32 old_signal, signal; + uint32_t old_signal, signal; int ii; int period; stream_sample_t *buffer = outputs[0]; @@ -758,7 +758,7 @@ void i8244_device::sound_stream_update(sound_stream &stream, stream_sample_t **i if ( m_vdc.s.sound & 0x10 ) { /* Noise tap is on bits 0 and 5 and fed back to bits 15 (and 23!) */ - UINT32 new_bit = ( ( old_signal ) ^ ( old_signal >> 5 ) ) & 0x01; + uint32_t new_bit = ( ( old_signal ) ^ ( old_signal >> 5 ) ) & 0x01; signal = ( old_signal & 0xFF0000 ) | ( ( old_signal & 0xFFFF ) >> 1 ) | ( new_bit << 15 ) | ( new_bit << 23 ); } m_vdc.s.shift3 = signal & 0xFF; @@ -790,7 +790,7 @@ void i8244_device::sound_stream_update(sound_stream &stream, stream_sample_t **i } -UINT32 i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap( bitmap, m_tmp_bitmap, 0, 0, 0, 0, cliprect ); diff --git a/src/devices/video/i8244.h b/src/devices/video/i8244.h index b946f7bd2c0..4827a3c278e 100644 --- a/src/devices/video/i8244.h +++ b/src/devices/video/i8244.h @@ -40,34 +40,34 @@ ***************************************************************************/ union vdc_t { - UINT8 reg[0x100]; + uint8_t reg[0x100]; struct { struct { - UINT8 y,x,color,res; + uint8_t y,x,color,res; } sprites[4]; struct { - UINT8 y,x,ptr,color; + uint8_t y,x,ptr,color; } foreground[12]; struct { struct { - UINT8 y,x,ptr,color; + uint8_t y,x,ptr,color; } single[4]; } quad[4]; - UINT8 shape[4][8]; - UINT8 control; - UINT8 status; - UINT8 collision; - UINT8 color; - UINT8 y; - UINT8 x; - UINT8 res; - UINT8 shift1; - UINT8 shift2; - UINT8 shift3; - UINT8 sound; - UINT8 res2[5+0x10]; - UINT8 hgrid[2][0x10]; - UINT8 vgrid[0x10]; + uint8_t shape[4][8]; + uint8_t control; + uint8_t status; + uint8_t collision; + uint8_t color; + uint8_t y; + uint8_t x; + uint8_t res; + uint8_t shift1; + uint8_t shift2; + uint8_t shift3; + uint8_t sound; + uint8_t res2[5+0x10]; + uint8_t hgrid[2][0x10]; + uint8_t vgrid[0x10]; } s; }; @@ -80,8 +80,8 @@ class i8244_device : public device_t { public: // construction/destruction - i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - i8244_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int lines, const char *shortname, const char *source); + i8244_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + i8244_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, int lines, const char *shortname, const char *source); // static configuration helpers static void set_screen_tag(device_t &device, const char *screen_tag) { downcast(device).m_screen_tag = screen_tag; } @@ -94,7 +94,7 @@ public: DECLARE_READ_LINE_MEMBER(hblank); DECLARE_PALETTE_INIT(i8244); - 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); inline bitmap_ind16 *get_bitmap() { return &m_tmp_bitmap; } @@ -122,7 +122,7 @@ protected: offs_t fix_register_mirrors( offs_t offset ); // Local constants - static const UINT8 VDC_CONTROL_REG_STROBE_XY = 0x02; + static const uint8_t VDC_CONTROL_REG_STROBE_XY = 0x02; /* timers */ static const device_timer_id TIMER_LINE = 0; @@ -142,11 +142,11 @@ protected: int m_screen_lines; vdc_t m_vdc; - UINT16 m_sh_count; - UINT8 m_x_beam_pos; - UINT8 m_y_beam_pos; - UINT8 m_control_status; - UINT8 m_collision_status; + uint16_t m_sh_count; + uint8_t m_x_beam_pos; + uint8_t m_y_beam_pos; + uint8_t m_control_status; + uint8_t m_collision_status; int m_iff; }; @@ -155,7 +155,7 @@ class i8245_device : public i8244_device { public: // construction/destruction - i8245_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8245_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static const int LINES = 312; }; diff --git a/src/devices/video/i82730.cpp b/src/devices/video/i82730.cpp index 8cd78863df3..bad69058f31 100644 --- a/src/devices/video/i82730.cpp +++ b/src/devices/video/i82730.cpp @@ -51,7 +51,7 @@ const char *i82730_device::m_command_names[] = // i82730_device - constructor //------------------------------------------------- -i82730_device::i82730_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +i82730_device::i82730_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I82730, "I82730", tag, owner, clock, "i82730", __FILE__), device_video_interface(mconfig, *this), m_sint_handler(*this), @@ -119,14 +119,14 @@ void i82730_device::device_reset() // MEMORY ACCESS //************************************************************************** -UINT8 i82730_device::read_byte(offs_t address) +uint8_t i82730_device::read_byte(offs_t address) { return m_program->read_byte(address); } -UINT16 i82730_device::read_word(offs_t address) +uint16_t i82730_device::read_word(offs_t address) { - UINT16 data; + uint16_t data; if (sysbus_16bit() && WORD_ALIGNED(address)) { @@ -141,12 +141,12 @@ UINT16 i82730_device::read_word(offs_t address) return data; } -void i82730_device::write_byte(offs_t address, UINT8 data) +void i82730_device::write_byte(offs_t address, uint8_t data) { m_program->write_byte(address, data); } -void i82730_device::write_word(offs_t address, UINT16 data) +void i82730_device::write_word(offs_t address, uint16_t data) { if (sysbus_16bit() && WORD_ALIGNED(address)) { @@ -166,7 +166,7 @@ void i82730_device::write_word(offs_t address, UINT16 data) void i82730_device::update_interrupts() { - UINT16 code = m_status & ~m_intmask & ~(VDIP | DIP); + uint16_t code = m_status & ~m_intmask & ~(VDIP | DIP); write_word(m_cbp + 20, code); if (code) @@ -175,24 +175,24 @@ void i82730_device::update_interrupts() void i82730_device::mode_set() { - UINT32 mptr = (read_word(m_cbp + 32) << 16) | read_word(m_cbp + 30); - UINT16 tmp; + uint32_t mptr = (read_word(m_cbp + 32) << 16) | read_word(m_cbp + 30); + uint16_t tmp; tmp = read_word(mptr); m_dma_burst_space = tmp & 0x7f; m_dma_burst_length = (tmp >> 8) & 0x7f; tmp = read_word(mptr + 2); - UINT8 hsyncstp = tmp & 0xff; - UINT8 line_length = (tmp >> 8) & 0xff; + uint8_t hsyncstp = tmp & 0xff; + uint8_t line_length = (tmp >> 8) & 0xff; tmp = read_word(mptr + 4); - UINT8 hfldstp = tmp & 0xff; + uint8_t hfldstp = tmp & 0xff; m_hfldstrt = (tmp >> 8) & 0xff; tmp = read_word(mptr + 6); - UINT8 hbrdstp = tmp & 0xff; - UINT8 hbrdstrt = (tmp >> 8) & 0xff; + uint8_t hbrdstp = tmp & 0xff; + uint8_t hbrdstrt = (tmp >> 8) & 0xff; tmp = read_word(mptr + 8); m_margin = tmp & 0x1f; @@ -204,7 +204,7 @@ void i82730_device::mode_set() m_field_attribute_mask = tmp & 0x7fff; tmp = read_word(mptr + 26); - UINT16 frame_length = tmp & 0x7ff; + uint16_t frame_length = tmp & 0x7ff; tmp = read_word(mptr + 28); m_vsyncstp = tmp & 0x7ff; @@ -244,8 +244,8 @@ void i82730_device::mode_set() void i82730_device::execute_command() { - UINT8 command = read_byte(m_cbp + 1); - UINT16 tmp; + uint8_t command = read_byte(m_cbp + 1); + uint16_t tmp; if (VERBOSE_COMMANDS && command < ARRAY_LENGTH(m_command_names)) logerror("%s('%s'): executing command: %s [cbp = %08x]\n", shortname(), basetag(), m_command_names[command], m_cbp); @@ -344,7 +344,7 @@ void i82730_device::load_row() while (!finished) { - UINT16 data = read_word(m_sptr); + uint16_t data = read_word(m_sptr); m_sptr += 2; if (BIT(data, 15)) @@ -420,7 +420,7 @@ TIMER_CALLBACK_MEMBER( i82730_device::row_update ) } else if (y >= m_vfldstrt && y < m_vfldstp) { - UINT8 lc = (y - m_vfldstrt) % (m_lpr + 1); + uint8_t lc = (y - m_vfldstrt) % (m_lpr + 1); // call driver m_update_row_cb(m_bitmap, m_row[m_row_index].data, lc, y - m_vsyncstp, m_row[m_row_index].count); @@ -438,7 +438,7 @@ TIMER_CALLBACK_MEMBER( i82730_device::row_update ) } else if (y >= m_vfldstp + m_margin + 1 && y < m_vfldstp + m_margin + 1 + m_lpr + 1) { - UINT8 lc = (y - (m_vfldstp + m_margin + 1)) % (m_lpr + 1); + uint8_t lc = (y - (m_vfldstp + m_margin + 1)) % (m_lpr + 1); m_sptr = (read_word(m_cbp + 36) << 16) | read_word(m_cbp + 34); load_row(); @@ -482,7 +482,7 @@ WRITE_LINE_MEMBER( i82730_device::ca_w ) m_ibp = (read_word(0xfffffffe) << 16) | read_word(0xfffffffc); // get system configuration byte - UINT8 scb = read_byte(m_ibp + 6); + uint8_t scb = read_byte(m_ibp + 6); // clear busy write_word(m_ibp, read_word(m_ibp) & 0xff00); @@ -520,7 +520,7 @@ WRITE_LINE_MEMBER( i82730_device::irst_w ) m_sint_handler(0); } -UINT32 i82730_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t i82730_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, m_hfldstrt * 16, 0, cliprect); return 0; diff --git a/src/devices/video/i82730.h b/src/devices/video/i82730.h index 97d9bd70b0d..3b78eb64ac4 100644 --- a/src/devices/video/i82730.h +++ b/src/devices/video/i82730.h @@ -35,10 +35,10 @@ // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate i82730_update_row_delegate; +typedef device_delegate i82730_update_row_delegate; #define I82730_UPDATE_ROW(name) \ - void name(bitmap_rgb32 &bitmap, UINT16 *data, UINT8 lc, UINT16 y, int x_count) + void name(bitmap_rgb32 &bitmap, uint16_t *data, uint8_t lc, uint16_t y, int x_count) // ======================> i82730_device @@ -47,7 +47,7 @@ class i82730_device : public device_t, public device_video_interface { public: // construction/destruction - i82730_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i82730_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // callbacks template static devcb_base &set_sint_handler(device_t &device, _Object object) @@ -57,7 +57,7 @@ public: static void set_cpu_tag(device_t &device, device_t *owner, const char *tag); static void set_update_row_callback(device_t &device, i82730_update_row_delegate callback) { downcast(device).m_update_row_cb = callback; } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(ca_w); DECLARE_WRITE_LINE_MEMBER(irst_w); @@ -85,10 +85,10 @@ private: bool sysbus_16bit() { return BIT(m_sysbus, 0); } - UINT8 read_byte(offs_t address); - UINT16 read_word(offs_t address); - void write_byte(offs_t address, UINT8 data); - void write_word(offs_t address, UINT16 data); + uint8_t read_byte(offs_t address); + uint16_t read_word(offs_t address); + void write_byte(offs_t address, uint8_t data); + void write_word(offs_t address, uint16_t data); void update_interrupts(); void mode_set(); @@ -113,18 +113,18 @@ private: int m_ca; // internal registers - UINT8 m_sysbus; - UINT32 m_ibp; - UINT32 m_cbp; - UINT16 m_intmask; - UINT16 m_status; + uint8_t m_sysbus; + uint32_t m_ibp; + uint32_t m_cbp; + uint16_t m_intmask; + uint16_t m_status; int m_list_switch; int m_auto_line_feed; - UINT8 m_max_dma_count; + uint8_t m_max_dma_count; - UINT32 m_lptr; - UINT32 m_sptr; + uint32_t m_lptr; + uint32_t m_sptr; int m_dma_burst_space; int m_dma_burst_length; @@ -133,7 +133,7 @@ private: int m_hfldstrt; int m_margin; int m_lpr; - UINT16 m_field_attribute_mask; + uint16_t m_field_attribute_mask; int m_vsyncstp; int m_vfldstrt; int m_vfldstp; @@ -143,7 +143,7 @@ private: // row buffers struct row_buffer { - UINT16 data[200]; + uint16_t data[200]; int count; }; diff --git a/src/devices/video/i8275.cpp b/src/devices/video/i8275.cpp index 433f222cb92..273792e7f07 100644 --- a/src/devices/video/i8275.cpp +++ b/src/devices/video/i8275.cpp @@ -91,7 +91,7 @@ const device_type I8275 = &device_creator; // i8275_device - constructor //------------------------------------------------- -i8275_device::i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +i8275_device::i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, I8275, "I8275 CRTC", tag, owner, clock, "i8275x", __FILE__), device_video_interface(mconfig, *this), m_write_irq(*this), @@ -315,7 +315,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param, int vsp = 0; int rvv = 0; - UINT8 data = (end_of_row || m_end_of_screen) ? 0 : m_buffer[!m_buffer_dma][sx]; + uint8_t data = (end_of_row || m_end_of_screen) ? 0 : m_buffer[!m_buffer_dma][sx]; if (data & 0x80) { @@ -367,7 +367,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param, m_hlgt = (data & CA_H) ? 1 : 0; m_vsp = (data & CA_B) ? 1 : 0; - UINT8 ca; + uint8_t ca; int cccc = (data >> 2) & 0x0f; if (line_counter < UNDERLINE) @@ -448,7 +448,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param, READ8_MEMBER( i8275_device::read ) { - UINT8 data; + uint8_t data; if (offset & 0x01) { @@ -643,7 +643,7 @@ WRITE_LINE_MEMBER( i8275_device::lpen_w ) // screen_update - //------------------------------------------------- -UINT32 i8275_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t i8275_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (!(m_status & ST_VE)) { diff --git a/src/devices/video/i8275.h b/src/devices/video/i8275.h index 04a726f54ab..859647ef725 100644 --- a/src/devices/video/i8275.h +++ b/src/devices/video/i8275.h @@ -42,7 +42,7 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define I8275_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int x, int y, UINT8 linecount, UINT8 charcode, UINT8 lineattr, UINT8 lten, UINT8 rvv, UINT8 vsp, UINT8 gpa, UINT8 hlgt) +#define I8275_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint8_t lineattr, uint8_t lten, uint8_t rvv, uint8_t vsp, uint8_t gpa, uint8_t hlgt) #define MCFG_I8275_CHARACTER_WIDTH(_value) \ @@ -69,7 +69,7 @@ // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate i8275_draw_character_delegate; +typedef device_delegate i8275_draw_character_delegate; // ======================> i8275_device @@ -79,7 +79,7 @@ class i8275_device : public device_t, { public: // construction/destruction - i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_character_width(device_t &device, int value) { downcast(device).m_hpixels_per_column = value; } static void static_set_display_callback(device_t &device, i8275_draw_character_delegate callback) { downcast(device).m_display_cb = callback; } @@ -96,7 +96,7 @@ public: DECLARE_WRITE_LINE_MEMBER( lpen_w ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -189,13 +189,13 @@ protected: bitmap_rgb32 m_bitmap; - UINT8 m_status; - UINT8 m_param[REG_DMA + 1]; + uint8_t m_status; + uint8_t m_param[REG_DMA + 1]; int m_param_idx; int m_param_end; - UINT8 m_buffer[2][80]; - UINT8 m_fifo[2][16]; + uint8_t m_buffer[2][80]; + uint8_t m_fifo[2][16]; int m_buffer_idx; int m_fifo_idx; bool m_fifo_next; @@ -219,7 +219,7 @@ protected: int m_cursor_blink; int m_char_blink; - UINT8 m_stored_attr; + uint8_t m_stored_attr; // timers emu_timer *m_hrtc_on_timer; diff --git a/src/devices/video/jangou_blitter.cpp b/src/devices/video/jangou_blitter.cpp index 032ed96a4ed..914c6b0e7ad 100644 --- a/src/devices/video/jangou_blitter.cpp +++ b/src/devices/video/jangou_blitter.cpp @@ -34,7 +34,7 @@ const device_type JANGOU_BLITTER = &device_creator; // jangou_blitter_device - constructor //------------------------------------------------- -jangou_blitter_device::jangou_blitter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +jangou_blitter_device::jangou_blitter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JANGOU_BLITTER, "Jangou Blitter Custom Chip", tag, owner, clock, "jangou_blitter", __FILE__) { } @@ -75,7 +75,7 @@ void jangou_blitter_device::device_reset() //************************************************************************** // TODO: inline these -UINT8 jangou_blitter_device::gfx_nibble( UINT32 niboffset ) +uint8_t jangou_blitter_device::gfx_nibble( uint32_t niboffset ) { if (niboffset & 1) return (m_gfxrom[(niboffset >> 1) & m_gfxrommask] & 0xf0) >> 4; @@ -83,7 +83,7 @@ UINT8 jangou_blitter_device::gfx_nibble( UINT32 niboffset ) return (m_gfxrom[(niboffset >> 1) & m_gfxrommask] & 0x0f); } -void jangou_blitter_device::plot_gfx_pixel( UINT8 pix, int x, int y ) +void jangou_blitter_device::plot_gfx_pixel( uint8_t pix, int x, int y ) { if (y < 0 || y >= 256) return; @@ -138,8 +138,8 @@ WRITE8_MEMBER( jangou_blitter_device::process_w ) { int drawx = (x + xcount) & 0xff; int drawy = (y + ycount) & 0xff; - UINT8 dat = gfx_nibble(src + count); - UINT8 cur_pen = m_pen_data[dat & 0x0f]; + uint8_t dat = gfx_nibble(src + count); + uint8_t cur_pen = m_pen_data[dat & 0x0f]; //dat = cur_pen_lo | (cur_pen_hi << 4); @@ -153,7 +153,7 @@ WRITE8_MEMBER( jangou_blitter_device::process_w ) } } - //UINT32 new_src = src + count; + //uint32_t new_src = src + count; // update source and height after blitter operation // TODO: Jangou doesn't agree with this, later HW? @@ -170,7 +170,7 @@ WRITE8_MEMBER( jangou_blitter_device::process_w ) // Sexy Gal swaps around upper src address WRITE8_MEMBER( jangou_blitter_device::alt_process_w ) { - const UINT8 translate_addr[7] = { 0, 1, 6, 2, 3, 4, 5 }; + const uint8_t translate_addr[7] = { 0, 1, 6, 2, 3, 4, 5 }; process_w(space,translate_addr[offset],data); } diff --git a/src/devices/video/jangou_blitter.h b/src/devices/video/jangou_blitter.h index d5d6e92a55f..031a0cc7ebe 100644 --- a/src/devices/video/jangou_blitter.h +++ b/src/devices/video/jangou_blitter.h @@ -30,7 +30,7 @@ class jangou_blitter_device : public device_t { public: // construction/destruction - jangou_blitter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + jangou_blitter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE8_MEMBER( process_w ); @@ -39,7 +39,7 @@ public: DECLARE_WRITE8_MEMBER( bltflip_w ); DECLARE_READ_LINE_MEMBER( status_r ); - UINT8 m_blit_buffer[256 * 256]; + uint8_t m_blit_buffer[256 * 256]; protected: // device-level overrides @@ -47,12 +47,12 @@ protected: virtual void device_reset() override; private: - void plot_gfx_pixel( UINT8 pix, int x, int y ); - UINT8 gfx_nibble( UINT32 niboffset ); - UINT8 m_pen_data[0x10]; - UINT8 m_blit_data[7]; - UINT8 *m_gfxrom; - UINT32 m_gfxrommask; + void plot_gfx_pixel( uint8_t pix, int x, int y ); + uint8_t gfx_nibble( uint32_t niboffset ); + uint8_t m_pen_data[0x10]; + uint8_t m_blit_data[7]; + uint8_t *m_gfxrom; + uint32_t m_gfxrommask; bool m_bltflip; }; diff --git a/src/devices/video/m50458.cpp b/src/devices/video/m50458.cpp index 25d3d04fba8..44f92f0fd51 100644 --- a/src/devices/video/m50458.cpp +++ b/src/devices/video/m50458.cpp @@ -149,7 +149,7 @@ const address_space_config *m50458_device::memory_space_config(address_spacenum // read_word - read a word at the given address //------------------------------------------------- -inline UINT16 m50458_device::read_word(offs_t address) +inline uint16_t m50458_device::read_word(offs_t address) { return space().read_word(address << 1); } @@ -158,7 +158,7 @@ inline UINT16 m50458_device::read_word(offs_t address) // write_word - write a word at the given address //------------------------------------------------- -inline void m50458_device::write_word(offs_t address, UINT16 data) +inline void m50458_device::write_word(offs_t address, uint16_t data) { space().write_word(address << 1, data); } @@ -172,7 +172,7 @@ inline void m50458_device::write_word(offs_t address, UINT16 data) // m50458_device - constructor //------------------------------------------------- -m50458_device::m50458_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m50458_device::m50458_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M50458, "M50458 OSD", tag, owner, clock, "m50458", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -197,15 +197,15 @@ void m50458_device::device_validity_check(validity_checker &valid) const void m50458_device::device_start() { - UINT16 tmp; - UINT8 *pcg = memregion("m50458")->base(); + uint16_t tmp; + uint8_t *pcg = memregion("m50458")->base(); int tile; int yi; - UINT16 src,dst; + uint16_t src,dst; /* Create an array for shadow gfx */ /* this will spread the source ROM into four directions (up-left, up-right, down-left, down-right) thus creating a working shadow copy */ - m_shadow_gfx = make_unique_clear(0x1200); + m_shadow_gfx = make_unique_clear(0x1200); for(tile=0;tile<0x80;tile++) { @@ -320,11 +320,11 @@ WRITE_LINE_MEMBER( m50458_device::set_clock_line ) // update_screen - //------------------------------------------------- -UINT32 m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; - UINT8 *pcg = memregion("m50458")->base(); - UINT8 bg_r,bg_g,bg_b; + uint8_t *pcg = memregion("m50458")->base(); + uint8_t bg_r,bg_g,bg_b; /* TODO: there's probably a way to control the brightness in this */ bg_r = m_phase & 1 ? 0xdf : 0; @@ -337,7 +337,7 @@ UINT32 m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, for(x=0;x<24;x++) { int xi,yi; - UINT16 tile; + uint16_t tile; int y_base = y; if(y != 0 && m_scrr > 1) { y_base+=(m_scrr - 1); } @@ -350,11 +350,11 @@ UINT32 m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, { for(xi=4;xi<16;xi++) /* TODO: remove 4 / 16 / -4 offset once that the ROM is fixed */ { - UINT8 pix; - UINT8 color = (tile & 0x700) >> 8; - UINT16 offset = ((tile & 0x7f)*36+yi*2); + uint8_t pix; + uint8_t color = (tile & 0x700) >> 8; + uint16_t offset = ((tile & 0x7f)*36+yi*2); int res_y,res_x; - UINT8 xh,yh; + uint8_t xh,yh; if(xi>=8) pix = ((pcg[offset+1] >> (7-(xi & 0x7))) & 1) << 1; @@ -385,7 +385,7 @@ UINT32 m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, if(pix != 0) { - UINT8 r,g,b; + uint8_t r,g,b; if(pix & 2) { diff --git a/src/devices/video/m50458.h b/src/devices/video/m50458.h index d11f39cedec..15c8e03ff00 100644 --- a/src/devices/video/m50458.h +++ b/src/devices/video/m50458.h @@ -40,7 +40,7 @@ class m50458_device : public device_t, { public: // construction/destruction - m50458_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m50458_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE_LINE_MEMBER( write_bit ); @@ -55,7 +55,7 @@ public: DECLARE_WRITE16_MEMBER(vreg_126_w); DECLARE_WRITE16_MEMBER(vreg_127_w); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual const tiny_rom_entry *device_rom_region() const override; protected: @@ -68,24 +68,24 @@ protected: int m_latch; int m_reset_line; int m_clock_line; - UINT16 m_current_cmd; + uint16_t m_current_cmd; int m_cmd_stream_pos; - UINT16 m_osd_addr; - std::unique_ptr m_shadow_gfx; + uint16_t m_osd_addr; + std::unique_ptr m_shadow_gfx; - UINT8 m_bg_pen; - UINT8 m_phase; - UINT8 m_scrf,m_scrr; - UINT8 m_space; - UINT8 m_hsz1,m_hsz2,m_hsz3; - UINT8 m_vsz1,m_vsz2,m_vsz3; - UINT8 m_blink; + uint8_t m_bg_pen; + uint8_t m_phase; + uint8_t m_scrf,m_scrr; + uint8_t m_space; + uint8_t m_hsz1,m_hsz2,m_hsz3; + uint8_t m_vsz1,m_vsz2,m_vsz3; + uint8_t m_blink; m50458_state_t m_osd_state; private: - 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); const address_space_config m_space_config; }; diff --git a/src/devices/video/mb90082.cpp b/src/devices/video/mb90082.cpp index 8fe8749e422..8c9d2cf80be 100644 --- a/src/devices/video/mb90082.cpp +++ b/src/devices/video/mb90082.cpp @@ -63,7 +63,7 @@ const address_space_config *mb90082_device::memory_space_config(address_spacenum // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT16 mb90082_device::read_word(offs_t address) +inline uint16_t mb90082_device::read_word(offs_t address) { return space().read_word(address << 1); } @@ -72,7 +72,7 @@ inline UINT16 mb90082_device::read_word(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void mb90082_device::write_word(offs_t address, UINT16 data) +inline void mb90082_device::write_word(offs_t address, uint16_t data) { space().write_word(address << 1, data); } @@ -85,7 +85,7 @@ inline void mb90082_device::write_word(offs_t address, UINT16 data) // mb90082_device - constructor //------------------------------------------------- -mb90082_device::mb90082_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb90082_device::mb90082_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MB90082, "MB90082 OSD", tag, owner, clock, "mb90082", __FILE__), device_memory_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 16, 16, 0, nullptr, *ADDRESS_MAP_NAME(mb90082_vram)) @@ -139,7 +139,7 @@ WRITE_LINE_MEMBER( mb90082_device::set_cs_line ) WRITE8_MEMBER( mb90082_device::write ) { - UINT16 dat; + uint16_t dat; switch(m_cmd_ff) { @@ -199,12 +199,12 @@ WRITE8_MEMBER( mb90082_device::write ) m_cmd_ff ^= 1; } -UINT32 mb90082_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mb90082_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; - UINT8 *pcg = memregion("mb90082")->base(); - UINT16 tile,attr; - UINT8 bg_r,bg_g,bg_b; + uint8_t *pcg = memregion("mb90082")->base(); + uint16_t tile,attr; + uint8_t bg_r,bg_g,bg_b; /* TODO: there's probably a way to control the brightness in this */ bg_b = m_uc & 1 ? 0xdf : 0; @@ -226,9 +226,9 @@ UINT32 mb90082_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap { for(xi=0;xi<16;xi++) { - UINT8 pix; - UINT8 color = (attr & 0x70) >> 4; - UINT8 r,g,b; + uint8_t pix; + uint8_t color = (attr & 0x70) >> 4; + uint8_t r,g,b; pix = (pcg[(tile*8)+(yi >> 1)] >> (7-(xi >> 1))) & 1; diff --git a/src/devices/video/mb90082.h b/src/devices/video/mb90082.h index 905d906055f..493c8fc0079 100644 --- a/src/devices/video/mb90082.h +++ b/src/devices/video/mb90082.h @@ -38,13 +38,13 @@ class mb90082_device : public device_t, { public: // construction/destruction - mb90082_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb90082_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE8_MEMBER( write ); DECLARE_WRITE_LINE_MEMBER( set_cs_line ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual const tiny_rom_entry *device_rom_region() const override; protected: @@ -55,17 +55,17 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; private: - UINT8 m_cmd_ff; - UINT8 m_cmd,m_cmd_param; - UINT8 m_reset_line; + uint8_t m_cmd_ff; + uint8_t m_cmd,m_cmd_param; + uint8_t m_reset_line; - UINT16 m_osd_addr; - UINT8 m_fil; - UINT8 m_uc; - UINT8 m_attr; + uint16_t m_osd_addr; + uint8_t m_fil; + uint8_t m_uc; + uint8_t m_attr; - 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); const address_space_config m_space_config; }; diff --git a/src/devices/video/mb_vcu.cpp b/src/devices/video/mb_vcu.cpp index 4389fdfb9b5..ae3c7c2b386 100644 --- a/src/devices/video/mb_vcu.cpp +++ b/src/devices/video/mb_vcu.cpp @@ -109,7 +109,7 @@ const address_space_config *mb_vcu_device::memory_space_config(address_spacenum // read_byte - read a byte at the given address //------------------------------------------------- -inline UINT8 mb_vcu_device::read_byte(offs_t address) +inline uint8_t mb_vcu_device::read_byte(offs_t address) { return space(AS_0).read_byte(address); } @@ -118,7 +118,7 @@ inline UINT8 mb_vcu_device::read_byte(offs_t address) // write_byte - write a byte at the given address //------------------------------------------------- -inline void mb_vcu_device::write_byte(offs_t address, UINT8 data) +inline void mb_vcu_device::write_byte(offs_t address, uint8_t data) { space(AS_0).write_byte(address, data); } @@ -127,7 +127,7 @@ inline void mb_vcu_device::write_byte(offs_t address, UINT8 data) // read_byte - read a byte at the given i/o //------------------------------------------------- -inline UINT8 mb_vcu_device::read_io(offs_t address) +inline uint8_t mb_vcu_device::read_io(offs_t address) { return space(AS_1).read_byte(address); } @@ -136,7 +136,7 @@ inline UINT8 mb_vcu_device::read_io(offs_t address) // write_byte - write a byte at the given i/o //------------------------------------------------- -inline void mb_vcu_device::write_io(offs_t address, UINT8 data) +inline void mb_vcu_device::write_io(offs_t address, uint8_t data) { space(AS_1).write_byte(address, data); } @@ -150,7 +150,7 @@ inline void mb_vcu_device::write_io(offs_t address, UINT8 data) // mb_vcu_device - constructor //------------------------------------------------- -mb_vcu_device::mb_vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mb_vcu_device::mb_vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MB_VCU, "Mazer Blazer custom VCU", tag, owner, clock, "mb_vcu", __FILE__) , device_memory_interface(mconfig, *this) , device_video_interface(mconfig, *this) @@ -178,8 +178,8 @@ void mb_vcu_device::device_validity_check(validity_checker &valid) const void mb_vcu_device::device_start() { // TODO: m_screen_tag - m_ram = make_unique_clear(0x800); - m_palram = make_unique_clear(0x100); + m_ram = make_unique_clear(0x800); + m_palram = make_unique_clear(0x100); { static const int resistances_r[2] = { 4700, 2200 }; @@ -230,7 +230,7 @@ void mb_vcu_device::device_reset() //************************************************************************** // READ/WRITE HANDLERS //************************************************************************** -// UINT8 *pcg = memregion("sub2")->base(); +// uint8_t *pcg = memregion("sub2")->base(); READ8_MEMBER( mb_vcu_device::read_ram ) { @@ -280,10 +280,10 @@ READ8_MEMBER( mb_vcu_device::load_gfx ) { int xi,yi; int dstx,dsty; - UINT8 dot; + uint8_t dot; int bits = 0; - UINT8 pen = 0; - UINT8 cur_layer; + uint8_t pen = 0; + uint8_t cur_layer; // cur_layer = (m_mode & 0x3); cur_layer = 0; @@ -386,7 +386,7 @@ READ8_MEMBER( mb_vcu_device::load_set_clr ) { int xi,yi; int dstx,dsty; -// UINT8 dot; +// uint8_t dot; int bits = 0; if(m_mode == 0x13 || m_mode == 0x03) { @@ -497,10 +497,10 @@ WRITE8_MEMBER( mb_vcu_device::vbank_w ) // update_screen - //------------------------------------------------- -UINT32 mb_vcu_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mb_vcu_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; - UINT8 dot; + uint8_t dot; bitmap.fill(0x100,cliprect); diff --git a/src/devices/video/mb_vcu.h b/src/devices/video/mb_vcu.h index e5fe1b2e62e..8c15ded23dc 100644 --- a/src/devices/video/mb_vcu.h +++ b/src/devices/video/mb_vcu.h @@ -18,7 +18,7 @@ class mb_vcu_device : public device_t, { public: // construction/destruction - mb_vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mb_vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration static void static_set_palette_tag(device_t &device, const char *tag); @@ -37,7 +37,7 @@ public: DECLARE_READ8_MEMBER( mb_vcu_paletteram_r ); DECLARE_WRITE8_MEMBER( mb_vcu_paletteram_w ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof(void); protected: @@ -47,25 +47,25 @@ protected: virtual void device_reset() override; virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; private: - inline UINT8 read_byte(offs_t address); - inline void write_byte(offs_t address, UINT8 data); - inline UINT8 read_io(offs_t address); - inline void write_io(offs_t address, UINT8 data); + inline uint8_t read_byte(offs_t address); + inline void write_byte(offs_t address, uint8_t data); + inline uint8_t read_io(offs_t address); + inline void write_io(offs_t address, uint8_t data); const address_space_config m_videoram_space_config; const address_space_config m_paletteram_space_config; - UINT8 m_status; - std::unique_ptr m_ram; - std::unique_ptr m_palram; - UINT16 m_param_offset_latch; - - INT16 m_xpos, m_ypos; - UINT8 m_color1, m_color2; - UINT8 m_mode; - UINT16 m_pix_xsize, m_pix_ysize; - UINT8 m_vregs[4]; - UINT8 m_bk_color; - UINT8 m_vbank; + uint8_t m_status; + std::unique_ptr m_ram; + std::unique_ptr m_palram; + uint16_t m_param_offset_latch; + + int16_t m_xpos, m_ypos; + uint8_t m_color1, m_color2; + uint8_t m_mode; + uint16_t m_pix_xsize, m_pix_ysize; + uint8_t m_vregs[4]; + uint8_t m_bk_color; + uint8_t m_vbank; double m_weights_r[2]; double m_weights_g[3]; diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp index fb52c855ecc..2830bc8d4b1 100644 --- a/src/devices/video/mc6845.cpp +++ b/src/devices/video/mc6845.cpp @@ -89,7 +89,7 @@ const device_type MOS8568 = &device_creator; #define ATTR_ALTERNATE_CHARSET BIT(attr, 7) -mc6845_device::mc6845_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) +mc6845_device::mc6845_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_video_interface(mconfig, *this, false), m_show_border_area(true), @@ -106,7 +106,7 @@ mc6845_device::mc6845_device(const machine_config &mconfig, device_type type, co { } -mc6845_device::mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6845_device::mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MC6845, "MC6845 CRTC", tag, owner, clock, "mc6845", __FILE__), device_video_interface(mconfig, *this, false), m_show_border_area(true), @@ -147,7 +147,7 @@ WRITE8_MEMBER( mc6845_device::address_w ) READ8_MEMBER( mc6845_device::status_r ) { - UINT8 ret = 0; + uint8_t ret = 0; /* VBLANK bit */ if (m_supports_status_reg_d5 && !m_line_enable_ff) @@ -167,7 +167,7 @@ READ8_MEMBER( mc6845_device::status_r ) READ8_MEMBER( mc6845_device::register_r ) { - UINT8 ret = 0; + uint8_t ret = 0; switch (m_register_address_latch) { @@ -286,7 +286,7 @@ WRITE8_MEMBER( mos8563_device::address_w ) READ8_MEMBER( mos8563_device::status_r ) { - UINT8 ret = m_revision; + uint8_t ret = m_revision; /* VBLANK bit */ if (!m_line_enable_ff) @@ -306,7 +306,7 @@ READ8_MEMBER( mos8563_device::status_r ) READ8_MEMBER( mos8563_device::register_r ) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; switch (m_register_address_latch) { @@ -418,12 +418,12 @@ WRITE8_MEMBER( mos8563_device::register_w ) } -inline UINT8 mos8563_device::read_videoram(offs_t offset) +inline uint8_t mos8563_device::read_videoram(offs_t offset) { return space(AS_0).read_byte(offset); } -inline void mos8563_device::write_videoram(offs_t offset, UINT8 data) +inline void mos8563_device::write_videoram(offs_t offset, uint8_t data) { space(AS_0).write_byte(offset, data); } @@ -461,23 +461,23 @@ READ_LINE_MEMBER( mc6845_device::vsync_r ) void mc6845_device::recompute_parameters(bool postload) { - UINT16 hsync_on_pos, hsync_off_pos, vsync_on_pos, vsync_off_pos; + uint16_t hsync_on_pos, hsync_off_pos, vsync_on_pos, vsync_off_pos; - UINT16 video_char_height = m_max_ras_addr + (MODE_INTERLACE_AND_VIDEO ? m_interlace_adjust : m_noninterlace_adjust); // fix garbage at the bottom of the screen (eg victor9k) + uint16_t video_char_height = m_max_ras_addr + (MODE_INTERLACE_AND_VIDEO ? m_interlace_adjust : m_noninterlace_adjust); // fix garbage at the bottom of the screen (eg victor9k) // Would be useful for 'interlace and video' mode support... - // UINT16 frame_char_height = (MODE_INTERLACE_AND_VIDEO ? m_max_ras_addr / 2 : m_max_ras_addr) + 1; + // uint16_t frame_char_height = (MODE_INTERLACE_AND_VIDEO ? m_max_ras_addr / 2 : m_max_ras_addr) + 1; /* compute the screen sizes */ - UINT16 horiz_pix_total = (m_horiz_char_total + 1) * m_hpixels_per_column; - UINT16 vert_pix_total = (m_vert_char_total + 1) * video_char_height + m_vert_total_adj; + uint16_t horiz_pix_total = (m_horiz_char_total + 1) * m_hpixels_per_column; + uint16_t vert_pix_total = (m_vert_char_total + 1) * video_char_height + m_vert_total_adj; /* determine the visible area, avoid division by 0 */ - UINT16 max_visible_x = m_horiz_disp * m_hpixels_per_column - 1; - UINT16 max_visible_y = m_vert_disp * video_char_height - 1; + uint16_t max_visible_x = m_horiz_disp * m_hpixels_per_column - 1; + uint16_t max_visible_y = m_vert_disp * video_char_height - 1; /* determine the syncing positions */ - UINT8 horiz_sync_char_width = m_sync_width & 0x0f; - UINT8 vert_sync_pix_width = m_supports_vert_sync_width ? (m_sync_width >> 4) & 0x0f : 0x10; + uint8_t horiz_sync_char_width = m_sync_width & 0x0f; + uint8_t vert_sync_pix_width = m_supports_vert_sync_width ? (m_sync_width >> 4) & 0x0f : 0x10; if (horiz_sync_char_width == 0) horiz_sync_char_width = 0x10; @@ -646,7 +646,7 @@ void mc6845_device::handle_line_timer() /* Check if VSYNC is active */ if ( m_vsync_ff ) { - UINT8 vsync_width = m_supports_vert_sync_width ? (m_sync_width >> 4) & 0x0f : 0; + uint8_t vsync_width = m_supports_vert_sync_width ? (m_sync_width >> 4) & 0x0f : 0; m_vsync_width_counter = ( m_vsync_width_counter + 1 ) & 0x0F; @@ -776,7 +776,7 @@ void mc6845_device::device_timer(emu_timer &timer, device_timer_id id, int param case TIMER_HSYNC_ON: { - UINT8 hsync_width = ( m_sync_width & 0x0f ) ? ( m_sync_width & 0x0f ) : 0x10; + uint8_t hsync_width = ( m_sync_width & 0x0f ) ? ( m_sync_width & 0x0f ) : 0x10; m_hsync_width_counter = 0; set_hsync( TRUE ); @@ -827,7 +827,7 @@ void mos8563_device::device_timer(emu_timer &timer, device_timer_id id, int para { case TIMER_BLOCK_COPY: { - UINT8 data = VSS_COPY ? read_videoram(m_block_addr++) : m_data; + uint8_t data = VSS_COPY ? read_videoram(m_block_addr++) : m_data; write_videoram(m_update_addr++, data); @@ -848,7 +848,7 @@ void mos8563_device::device_timer(emu_timer &timer, device_timer_id id, int para } -UINT16 mc6845_device::get_ma() +uint16_t mc6845_device::get_ma() { update_counters(); @@ -856,7 +856,7 @@ UINT16 mc6845_device::get_ma() } -UINT8 mc6845_device::get_ra() +uint8_t mc6845_device::get_ra() { return m_raster_counter; } @@ -899,7 +899,7 @@ void mc6845_device::set_hpixels_per_column(int hpixels_per_column) void mc6845_device::update_cursor_state() { /* save and increment cursor counter */ - UINT8 last_cursor_blink_count = m_cursor_blink_count; + uint8_t last_cursor_blink_count = m_cursor_blink_count; m_cursor_blink_count = m_cursor_blink_count + 1; /* switch on cursor blinking mode */ @@ -927,10 +927,10 @@ void mc6845_device::update_cursor_state() } -UINT8 mc6845_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint8_t mc6845_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect) { /* compute the current raster line */ - UINT8 ra = y % (m_max_ras_addr + (MODE_INTERLACE_AND_VIDEO ? m_interlace_adjust : m_noninterlace_adjust)); + uint8_t ra = y % (m_max_ras_addr + (MODE_INTERLACE_AND_VIDEO ? m_interlace_adjust : m_noninterlace_adjust)); /* check if the cursor is visible and is on this scanline */ int cursor_visible = m_cursor_state && @@ -940,7 +940,7 @@ UINT8 mc6845_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle (m_cursor_addr < (m_current_disp_addr + m_horiz_disp)); /* compute the cursor X position, or -1 if not visible */ - INT8 cursor_x = cursor_visible ? (m_cursor_addr - m_current_disp_addr) : -1; + int8_t cursor_x = cursor_visible ? (m_cursor_addr - m_current_disp_addr) : -1; int de = (y < m_max_visible_y) ? 1 : 0; int vbp = m_vert_pix_total - m_vsync_off_pos; if (vbp < 0) vbp = 0; @@ -950,9 +950,9 @@ UINT8 mc6845_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle /* call the external system to draw it */ if (MODE_ROW_COLUMN_ADDRESSING) { - UINT8 cc = 0; - UINT8 cr = y / (m_max_ras_addr + (MODE_INTERLACE_AND_VIDEO ? m_interlace_adjust : m_noninterlace_adjust)); - UINT16 ma = (cr << 8) | cc; + uint8_t cc = 0; + uint8_t cr = y / (m_max_ras_addr + (MODE_INTERLACE_AND_VIDEO ? m_interlace_adjust : m_noninterlace_adjust)); + uint16_t ma = (cr << 8) | cc; m_update_row_cb(bitmap, cliprect, ma, ra, y, m_horiz_disp, cursor_x, de, hbp, vbp); } @@ -969,7 +969,7 @@ UINT8 mc6845_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle } -UINT32 mc6845_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mc6845_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { assert(bitmap.valid()); @@ -988,7 +988,7 @@ UINT32 mc6845_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, } /* for each row in the visible region */ - for (UINT16 y = cliprect.min_y; y <= cliprect.max_y; y++) + for (uint16_t y = cliprect.min_y; y <= cliprect.max_y; y++) { this->draw_scanline(y, bitmap, cliprect); } @@ -1301,7 +1301,7 @@ void mos8563_device::device_start() m_revision = 1; // initialize video RAM - UINT8 data = 0xff; + uint8_t data = 0xff; for (offs_t offset = 0; offset < 0x10000; offset++) { @@ -1402,66 +1402,66 @@ static ADDRESS_MAP_START( mos8563_videoram_map, AS_0, 8, mos8563_device ) ADDRESS_MAP_END -r6545_1_device::r6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +r6545_1_device::r6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, R6545_1, "R6545-1 CRTC", tag, owner, clock, "r6545_1", __FILE__) { } -h46505_device::h46505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +h46505_device::h46505_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, H46505, "H46505 CRTC", tag, owner, clock, "h46505", __FILE__) { } -mc6845_1_device::mc6845_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6845_1_device::mc6845_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, MC6845_1, "MC6845-1 CRTC", tag, owner, clock, "mc6845_1", __FILE__) { } -hd6845_device::hd6845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd6845_device::hd6845_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, HD6845, "HD6845 CRTC", tag, owner, clock, "hd6845", __FILE__) { } -c6545_1_device::c6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +c6545_1_device::c6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, C6545_1, "C6545-1 CRTC", tag, owner, clock, "c6545_1", __FILE__) { } -sy6545_1_device::sy6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sy6545_1_device::sy6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, SY6545_1, "SY6545-1 CRTC", tag, owner, clock, "sy6545_1", __FILE__) { } -sy6845e_device::sy6845e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sy6845e_device::sy6845e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, SY6845E, "SY6845E CRTC", tag, owner, clock, "sy6845e", __FILE__) { } -hd6345_device::hd6345_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hd6345_device::hd6345_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, HD6345, "HD6345 CRTC", tag, owner, clock, "hd6345", __FILE__) { } -ams40041_device::ams40041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ams40041_device::ams40041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, AMS40041, "AMS40041 CRTC", tag, owner, clock, "ams40041", __FILE__) { } -ams40489_device::ams40489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ams40489_device::ams40489_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, AMS40489, "AMS40489 ASIC (CRTC)", tag, owner, clock, "ams40489", __FILE__) { } -mos8563_device::mos8563_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) +mos8563_device::mos8563_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) : mc6845_device(mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, nullptr, *ADDRESS_MAP_NAME(mos8563_videoram_map)), @@ -1471,7 +1471,7 @@ mos8563_device::mos8563_device(const machine_config &mconfig, device_type type, } -mos8563_device::mos8563_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8563_device::mos8563_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6845_device(mconfig, MOS8563, "MOS8563", tag, owner, clock, "mos8563", __FILE__), device_memory_interface(mconfig, *this), m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, nullptr, *ADDRESS_MAP_NAME(mos8563_videoram_map)), @@ -1481,7 +1481,7 @@ mos8563_device::mos8563_device(const machine_config &mconfig, const char *tag, d } -mos8568_device::mos8568_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8568_device::mos8568_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mos8563_device(mconfig, MOS8568, "MOS8568", tag, owner, clock, "mos8568", __FILE__) { } @@ -1525,7 +1525,7 @@ void mos8563_device::update_cursor_state() mc6845_device::update_cursor_state(); /* save and increment character blink counter */ - UINT8 last_char_blink_count = m_char_blink_count; + uint8_t last_char_blink_count = m_char_blink_count; m_char_blink_count++; /* switch on character blinking mode */ @@ -1542,9 +1542,9 @@ void mos8563_device::update_cursor_state() } -UINT8 mos8563_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint8_t mos8563_device::draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 ra = mc6845_device::draw_scanline(y, bitmap, cliprect); + uint8_t ra = mc6845_device::draw_scanline(y, bitmap, cliprect); if (ra == m_max_ras_addr) m_current_disp_addr = (m_current_disp_addr + m_row_addr_incr) & 0x3fff; @@ -1560,14 +1560,14 @@ MC6845_UPDATE_ROW( mos8563_device::vdc_update_row ) ra += (m_vert_scroll & 0x0f); ra &= 0x0f; - UINT8 cth = (m_horiz_char >> 4) + (HSS_DBL ? 0 : 1); - UINT8 cdh = (m_horiz_char & 0x0f) + (HSS_DBL ? 0 : 1); - UINT8 cdv = m_vert_char_disp; + uint8_t cth = (m_horiz_char >> 4) + (HSS_DBL ? 0 : 1); + uint8_t cdh = (m_horiz_char & 0x0f) + (HSS_DBL ? 0 : 1); + uint8_t cdv = m_vert_char_disp; for (int column = 0; column < x_count; column++) { - UINT8 code = read_videoram(ma + column); - UINT8 attr = 0; + uint8_t code = read_videoram(ma + column); + uint8_t attr = 0; int fg = m_color >> 4; int bg = m_color & 0x0f; @@ -1615,7 +1615,7 @@ MC6845_UPDATE_ROW( mos8563_device::vdc_update_row ) font_addr = ((m_char_base_addr & 0xc0) << 8) | (ATTR_ALTERNATE_CHARSET << 13) | (code << 5) | (ra & 0x1f); } - UINT8 data = read_videoram(font_addr); + uint8_t data = read_videoram(font_addr); if (ra >= cdv) data = 0; if (ATTR_UNDERLINE && (ra == m_underline_ras)) data = 0xff; diff --git a/src/devices/video/mc6845.h b/src/devices/video/mc6845.h index f530485b886..ddae73483b3 100644 --- a/src/devices/video/mc6845.h +++ b/src/devices/video/mc6845.h @@ -71,10 +71,10 @@ typedef device_delegate mc6845_begin_update_delegate; #define MC6845_BEGIN_UPDATE(name) void name(bitmap_rgb32 &bitmap, const rectangle &cliprect) -typedef device_delegate mc6845_update_row_delegate; -#define MC6845_UPDATE_ROW(name) void name(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, \ - UINT16 y, UINT8 x_count, INT8 cursor_x, int de, int hbp, int vbp) +typedef device_delegate mc6845_update_row_delegate; +#define MC6845_UPDATE_ROW(name) void name(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t ma, uint8_t ra, \ + uint16_t y, uint8_t x_count, int8_t cursor_x, int de, int hbp, int vbp) typedef device_delegate mc6845_end_update_delegate; #define MC6845_END_UPDATE(name) void name(bitmap_rgb32 &bitmap, const rectangle &cliprect) @@ -99,8 +99,8 @@ class mc6845_device : public device_t, public: // construction/destruction - mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - mc6845_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); + mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mc6845_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 set_show_border_area(device_t &device, bool show) { downcast(device).m_show_border_area = show; } static void set_visarea_adjust(device_t &device, int min_x, int max_x, int min_y, int max_y) @@ -150,10 +150,10 @@ public: DECLARE_READ_LINE_MEMBER( vsync_r ); /* return the current value on the MA0-MA13 pins */ - UINT16 get_ma(); + uint16_t get_ma(); /* return the current value on the RA0-RA4 pins */ - UINT8 get_ra(); + uint8_t get_ra(); /* simulates the LO->HI clocking of the light pen pin (pin 3) */ void assert_light_pen_input(); @@ -167,7 +167,7 @@ public: /* updates the screen -- this will call begin_update(), followed by update_row() repeatedly and after all row updating is complete, end_update() */ - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -184,27 +184,27 @@ protected: bool m_supports_transparent; /* register file */ - UINT8 m_horiz_char_total; /* 0x00 */ - UINT8 m_horiz_disp; /* 0x01 */ - UINT8 m_horiz_sync_pos; /* 0x02 */ - UINT8 m_sync_width; /* 0x03 */ - UINT8 m_vert_char_total; /* 0x04 */ - UINT8 m_vert_total_adj; /* 0x05 */ - UINT8 m_vert_disp; /* 0x06 */ - UINT8 m_vert_sync_pos; /* 0x07 */ - UINT8 m_mode_control; /* 0x08 */ - UINT8 m_max_ras_addr; /* 0x09 */ - UINT8 m_cursor_start_ras; /* 0x0a */ - UINT8 m_cursor_end_ras; /* 0x0b */ - UINT16 m_disp_start_addr; /* 0x0c/0x0d */ - UINT16 m_cursor_addr; /* 0x0e/0x0f */ - UINT16 m_light_pen_addr; /* 0x10/0x11 */ - UINT16 m_update_addr; /* 0x12/0x13 */ + uint8_t m_horiz_char_total; /* 0x00 */ + uint8_t m_horiz_disp; /* 0x01 */ + uint8_t m_horiz_sync_pos; /* 0x02 */ + uint8_t m_sync_width; /* 0x03 */ + uint8_t m_vert_char_total; /* 0x04 */ + uint8_t m_vert_total_adj; /* 0x05 */ + uint8_t m_vert_disp; /* 0x06 */ + uint8_t m_vert_sync_pos; /* 0x07 */ + uint8_t m_mode_control; /* 0x08 */ + uint8_t m_max_ras_addr; /* 0x09 */ + uint8_t m_cursor_start_ras; /* 0x0a */ + uint8_t m_cursor_end_ras; /* 0x0b */ + uint16_t m_disp_start_addr; /* 0x0c/0x0d */ + uint16_t m_cursor_addr; /* 0x0e/0x0f */ + uint16_t m_light_pen_addr; /* 0x10/0x11 */ + uint16_t m_update_addr; /* 0x12/0x13 */ /* other internal state */ - UINT8 m_register_address_latch; + uint8_t m_register_address_latch; bool m_cursor_state; - UINT8 m_cursor_blink_count; + uint8_t m_cursor_blink_count; bool m_update_ready_bit; /* output signals */ int m_cur; @@ -213,18 +213,18 @@ protected: int m_de; /* internal counters */ - UINT8 m_character_counter; /* Not used yet */ - UINT8 m_hsync_width_counter; /* Not used yet */ - UINT8 m_line_counter; - UINT8 m_raster_counter; - UINT8 m_adjust_counter; - UINT8 m_vsync_width_counter; + uint8_t m_character_counter; /* Not used yet */ + uint8_t m_hsync_width_counter; /* Not used yet */ + uint8_t m_line_counter; + uint8_t m_raster_counter; + uint8_t m_adjust_counter; + uint8_t m_vsync_width_counter; bool m_line_enable_ff; /* Internal flip flop which is set when the line_counter is reset and reset when vert_disp is reached */ - UINT8 m_vsync_ff; - UINT8 m_adjust_active; - UINT16 m_line_address; - INT16 m_cursor_x; + uint8_t m_vsync_ff; + uint8_t m_adjust_active; + uint16_t m_line_address; + int16_t m_cursor_x; /* timers */ static const device_timer_id TIMER_LINE = 0; @@ -249,17 +249,17 @@ protected: /* computed values - do NOT state save these! */ /* These computed are used to define the screen parameters for a driver */ - UINT16 m_horiz_pix_total; - UINT16 m_vert_pix_total; - UINT16 m_max_visible_x; - UINT16 m_max_visible_y; - UINT16 m_hsync_on_pos; - UINT16 m_hsync_off_pos; - UINT16 m_vsync_on_pos; - UINT16 m_vsync_off_pos; + uint16_t m_horiz_pix_total; + uint16_t m_vert_pix_total; + uint16_t m_max_visible_x; + uint16_t m_max_visible_y; + uint16_t m_hsync_on_pos; + uint16_t m_hsync_off_pos; + uint16_t m_vsync_on_pos; + uint16_t m_vsync_off_pos; bool m_has_valid_parameters; - UINT16 m_current_disp_addr; /* the display address currently drawn (used only in mc6845_update) */ + uint16_t m_current_disp_addr; /* the display address currently drawn (used only in mc6845_update) */ bool m_light_pen_latched; attotime m_upd_time; @@ -274,7 +274,7 @@ protected: void set_cur(int state); void handle_line_timer(); virtual void update_cursor_state(); - virtual UINT8 draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual uint8_t draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect); /************************ interface CRTC - driver @@ -330,7 +330,7 @@ protected: class mc6845_1_device : public mc6845_device { public: - mc6845_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6845_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -340,7 +340,7 @@ protected: class r6545_1_device : public mc6845_device { public: - r6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + r6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -350,7 +350,7 @@ protected: class c6545_1_device : public mc6845_device { public: - c6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + c6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -360,7 +360,7 @@ protected: class h46505_device : public mc6845_device { public: - h46505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + h46505_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -370,7 +370,7 @@ protected: class hd6845_device : public mc6845_device { public: - hd6845_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd6845_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -380,7 +380,7 @@ protected: class sy6545_1_device : public mc6845_device { public: - sy6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sy6545_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -390,7 +390,7 @@ protected: class sy6845e_device : public mc6845_device { public: - sy6845e_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sy6845e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -400,7 +400,7 @@ protected: class hd6345_device : public mc6845_device { public: - hd6345_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hd6345_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -410,7 +410,7 @@ protected: class ams40041_device : public mc6845_device { public: - ams40041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ams40041_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -420,7 +420,7 @@ protected: class ams40489_device : public mc6845_device { public: - ams40489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ams40489_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; @@ -431,8 +431,8 @@ class mos8563_device : public mc6845_device, public device_memory_interface { public: - mos8563_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); - mos8563_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8563_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); + mos8563_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; @@ -443,8 +443,8 @@ public: DECLARE_READ8_MEMBER( register_r ); DECLARE_WRITE8_MEMBER( register_w ); - inline UINT8 read_videoram(offs_t offset); - inline void write_videoram(offs_t offset, UINT8 data); + inline uint8_t read_videoram(offs_t offset); + inline void write_videoram(offs_t offset, uint8_t data); MC6845_UPDATE_ROW( vdc_update_row ); @@ -458,33 +458,33 @@ protected: const address_space_config m_videoram_space_config; required_device m_palette; - UINT8 m_char_buffer[80]; - UINT8 m_attr_buffer[80]; + uint8_t m_char_buffer[80]; + uint8_t m_attr_buffer[80]; bool m_char_blink_state; - UINT8 m_char_blink_count; + uint8_t m_char_blink_count; /* register file */ - UINT16 m_attribute_addr; /* 0x14/0x15 */ - UINT8 m_horiz_char; /* 0x16 */ - UINT8 m_vert_char_disp; /* 0x17 */ - UINT8 m_vert_scroll; /* 0x18 */ - UINT8 m_horiz_scroll; /* 0x19 */ - UINT8 m_color; /* 0x1a */ - UINT8 m_row_addr_incr; /* 0x1b */ - UINT8 m_char_base_addr; /* 0x1c */ - UINT8 m_underline_ras; /* 0x1d */ - UINT8 m_word_count; /* 0x1e */ - UINT8 m_data; /* 0x1f */ - UINT16 m_block_addr; /* 0x20/0x21 */ - UINT16 m_de_begin; /* 0x22/0x23 */ - UINT8 m_dram_refresh; /* 0x24 */ - UINT8 m_sync_polarity; /* 0x25 */ + uint16_t m_attribute_addr; /* 0x14/0x15 */ + uint8_t m_horiz_char; /* 0x16 */ + uint8_t m_vert_char_disp; /* 0x17 */ + uint8_t m_vert_scroll; /* 0x18 */ + uint8_t m_horiz_scroll; /* 0x19 */ + uint8_t m_color; /* 0x1a */ + uint8_t m_row_addr_incr; /* 0x1b */ + uint8_t m_char_base_addr; /* 0x1c */ + uint8_t m_underline_ras; /* 0x1d */ + uint8_t m_word_count; /* 0x1e */ + uint8_t m_data; /* 0x1f */ + uint16_t m_block_addr; /* 0x20/0x21 */ + uint16_t m_de_begin; /* 0x22/0x23 */ + uint8_t m_dram_refresh; /* 0x24 */ + uint8_t m_sync_polarity; /* 0x25 */ int m_revision; virtual void update_cursor_state() override; - virtual UINT8 draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual uint8_t draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; static const device_timer_id TIMER_BLOCK_COPY = 9; @@ -494,7 +494,7 @@ protected: class mos8568_device : public mos8563_device { public: - mos8568_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8568_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides diff --git a/src/devices/video/mc6847.cpp b/src/devices/video/mc6847.cpp index 638c68d5d8d..4c07d65033f 100644 --- a/src/devices/video/mc6847.cpp +++ b/src/devices/video/mc6847.cpp @@ -97,7 +97,7 @@ #define LOG_INPUT 0 -const UINT32 mc6847_base_device::s_palette[mc6847_base_device::PALETTE_LENGTH] = +const uint32_t mc6847_base_device::s_palette[mc6847_base_device::PALETTE_LENGTH] = { rgb_t(0x07, 0xff, 0x00), /* GREEN */ rgb_t(0xff, 0xff, 0x00), /* YELLOW */ @@ -129,8 +129,8 @@ const UINT32 mc6847_base_device::s_palette[mc6847_base_device::PALETTE_LENGTH] = // ctor //------------------------------------------------- -mc6847_friend_device::mc6847_friend_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, - const UINT8 *fontdata, bool is_mc6847t1, double tpfs, int field_sync_falling_edge_scanline, bool supports_partial_body_scanlines, const char *shortname, const char *source) +mc6847_friend_device::mc6847_friend_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, + const uint8_t *fontdata, bool is_mc6847t1, double tpfs, int field_sync_falling_edge_scanline, bool supports_partial_body_scanlines, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), m_write_hsync(*this), m_write_fsync(*this), @@ -474,7 +474,7 @@ void mc6847_friend_device::enter_bottom_border(void) // record_border_scanline //------------------------------------------------- -void mc6847_friend_device::record_border_scanline(UINT16 physical_scanline) +void mc6847_friend_device::record_border_scanline(uint16_t physical_scanline) { } @@ -484,11 +484,11 @@ void mc6847_friend_device::record_border_scanline(UINT16 physical_scanline) // get_clocks_since_hsync //------------------------------------------------- -INT32 mc6847_friend_device::get_clocks_since_hsync() +int32_t mc6847_friend_device::get_clocks_since_hsync() { - UINT64 hsync_on_clocks = attotime_to_clocks(m_hsync_on_timer->start()); - UINT64 current_clocks = attotime_to_clocks(machine().time()); - return (INT32) (current_clocks - hsync_on_clocks); + uint64_t hsync_on_clocks = attotime_to_clocks(m_hsync_on_timer->start()); + uint64_t current_clocks = attotime_to_clocks(machine().time()); + return (int32_t) (current_clocks - hsync_on_clocks); } @@ -505,7 +505,7 @@ void mc6847_friend_device::video_flush() // 3. We're in the body if (m_supports_partial_body_scanlines && !m_recording_scanline && (m_logical_scanline_zone == SCANLINE_ZONE_BODY)) { - UINT32 new_partial_scanline_clocks = get_clocks_since_hsync(); + uint32_t new_partial_scanline_clocks = get_clocks_since_hsync(); if (m_partial_scanline_clocks < new_partial_scanline_clocks) { if (LOG_FLUSH) @@ -546,7 +546,7 @@ const char *mc6847_friend_device::describe_context(void) // ctor //------------------------------------------------- -mc6847_base_device::mc6847_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const UINT8 *fontdata, double tpfs, const char *shortname, const char *source) : +mc6847_base_device::mc6847_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const uint8_t *fontdata, double tpfs, const char *shortname, const char *source) : mc6847_friend_device(mconfig, type, name, tag, owner, clock, fontdata, (type == MC6847T1_NTSC) || (type == MC6847T1_PAL), tpfs, 25+191, true, shortname, source), m_input_cb(*this), m_black_and_white(false), @@ -625,9 +625,9 @@ void mc6847_base_device::device_reset() // input //------------------------------------------------- -UINT8 mc6847_base_device::input(UINT16 address) +uint8_t mc6847_base_device::input(uint16_t address) { - UINT8 data = m_input_cb(address); + uint8_t data = m_input_cb(address); if (LOG_INPUT) logerror("%s: input: address=0x%04X data=0x%02X\n", describe_context(), address, data); return data; @@ -640,17 +640,17 @@ UINT8 mc6847_base_device::input(UINT16 address) //------------------------------------------------- template -void mc6847_base_device::record_scanline_res(int scanline, INT32 start_pos, INT32 end_pos) +void mc6847_base_device::record_scanline_res(int scanline, int32_t start_pos, int32_t end_pos) { // determine the "sample_modulo" (e.g. - for 32 samples per row, query the video RAM every // position, for 16 samples per row, query every other position) const int sample_modulo = 32 / sample_count; static_assert((32 / sample_modulo) == sample_count, "Expected 32 to be divisible by sample_count"); - UINT8 current_sample_count = (start_pos > 0) ? m_data[scanline].m_sample_count : 0; + uint8_t current_sample_count = (start_pos > 0) ? m_data[scanline].m_sample_count : 0; // main loop - for (INT32 pos = start_pos; pos < end_pos; pos++) + for (int32_t pos = start_pos; pos < end_pos; pos++) { // set address at beginning of line if (pos == 0) @@ -660,7 +660,7 @@ void mc6847_base_device::record_scanline_res(int scanline, INT32 start_pos, INT3 if ((pos % sample_modulo) == 0) { // input data - UINT8 data = input(m_video_address++); + uint8_t data = input(m_video_address++); if (pos < 32) { @@ -684,7 +684,7 @@ void mc6847_base_device::record_scanline_res(int scanline, INT32 start_pos, INT3 // record_body_scanline //------------------------------------------------- -inline void mc6847_base_device::record_body_scanline(UINT16 physical_scanline, UINT16 scanline, INT32 start_pos, INT32 end_pos) +inline void mc6847_base_device::record_body_scanline(uint16_t physical_scanline, uint16_t scanline, int32_t start_pos, int32_t end_pos) { // sanity checks assert(scanline < 192); @@ -736,7 +736,7 @@ inline void mc6847_base_device::record_body_scanline(UINT16 physical_scanline, U // record_body_scanline //------------------------------------------------- -void mc6847_base_device::record_body_scanline(UINT16 physical_scanline, UINT16 scanline) +void mc6847_base_device::record_body_scanline(uint16_t physical_scanline, uint16_t scanline) { record_body_scanline(physical_scanline, scanline, 0, 32); } @@ -747,10 +747,10 @@ void mc6847_base_device::record_body_scanline(UINT16 physical_scanline, UINT16 s // record_partial_body_scanline //------------------------------------------------- -void mc6847_base_device::record_partial_body_scanline(UINT16 physical_scanline, UINT16 scanline, INT32 start_clock, INT32 end_clock) +void mc6847_base_device::record_partial_body_scanline(uint16_t physical_scanline, uint16_t scanline, int32_t start_clock, int32_t end_clock) { - INT32 start_pos = std::max(scanline_position_from_clock(start_clock), 0); - INT32 end_pos = std::min(scanline_position_from_clock(end_clock), 42); + int32_t start_pos = std::max(scanline_position_from_clock(start_clock), 0); + int32_t end_pos = std::min(scanline_position_from_clock(end_clock), 42); if (start_pos < end_pos) record_body_scanline(physical_scanline, scanline, start_pos, end_pos); @@ -762,7 +762,7 @@ void mc6847_base_device::record_partial_body_scanline(UINT16 physical_scanline, // scanline_position_from_clock //------------------------------------------------- -INT32 mc6847_base_device::scanline_position_from_clock(INT32 clocks_since_hsync) +int32_t mc6847_base_device::scanline_position_from_clock(int32_t clocks_since_hsync) { return (clocks_since_hsync - 20) / 4; } @@ -786,7 +786,7 @@ void mc6847_base_device::field_sync_changed(bool line) // border_value //------------------------------------------------- -inline mc6847_base_device::pixel_t mc6847_base_device::border_value(UINT8 mode, const pixel_t *palette, bool is_mc6847t1) +inline mc6847_base_device::pixel_t mc6847_base_device::border_value(uint8_t mode, const pixel_t *palette, bool is_mc6847t1) { pixel_t result; switch(mc6847_friend_device::border_value(mode, is_mc6847t1)) @@ -815,7 +815,7 @@ inline mc6847_base_device::pixel_t mc6847_base_device::border_value(UINT8 mode, // update //------------------------------------------------- -UINT32 mc6847_base_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mc6847_base_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int base_x = 32; int base_y = 25; @@ -899,7 +899,7 @@ UINT32 mc6847_base_device::screen_update(screen_device &screen, bitmap_rgb32 &bi // CHARACTER MAP //************************************************************************** -mc6847_friend_device::character_map::character_map(const UINT8 *text_fontdata, bool is_mc6847t1) +mc6847_friend_device::character_map::character_map(const uint8_t *text_fontdata, bool is_mc6847t1) { int mode, i; @@ -914,14 +914,14 @@ mc6847_friend_device::character_map::character_map(const UINT8 *text_fontdata, b // loop through all modes for (mode = 0; mode < ARRAY_LENGTH(m_entries); mode++) { - const UINT8 *fontdata; - UINT8 character_mask; - UINT8 color_shift_0 = 0; - UINT8 color_shift_1 = 0; - UINT8 color_mask_0 = 0x00; - UINT8 color_mask_1 = 0x00; - UINT16 color_base_0; - UINT16 color_base_1; + const uint8_t *fontdata; + uint8_t character_mask; + uint8_t color_shift_0 = 0; + uint8_t color_shift_1 = 0; + uint8_t color_mask_0 = 0x00; + uint8_t color_mask_1 = 0x00; + uint16_t color_base_0; + uint16_t color_base_1; if ((mode & MODE_INTEXT) && !is_mc6847t1) { @@ -977,7 +977,7 @@ mc6847_friend_device::character_map::character_map(const UINT8 *text_fontdata, b // pal_round_fontdata8x12 //------------------------------------------------- -const UINT8 mc6847_friend_device::pal_round_fontdata8x12[] = +const uint8_t mc6847_friend_device::pal_round_fontdata8x12[] = { 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00, @@ -1085,7 +1085,7 @@ const UINT8 mc6847_friend_device::pal_round_fontdata8x12[] = // pal_square_fontdata8x12 //------------------------------------------------- -const UINT8 mc6847_friend_device::pal_square_fontdata8x12[] = +const uint8_t mc6847_friend_device::pal_square_fontdata8x12[] = { 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00, @@ -1193,7 +1193,7 @@ const UINT8 mc6847_friend_device::pal_square_fontdata8x12[] = // ntsc_round_fontdata8x12 //------------------------------------------------- -const UINT8 mc6847_friend_device::ntsc_round_fontdata8x12[] = +const uint8_t mc6847_friend_device::ntsc_round_fontdata8x12[] = { 0x00, 0x00, 0x38, 0x44, 0x04, 0x34, 0x4C, 0x4C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x7C, 0x44, 0x44, 0x00, 0x00, 0x00, @@ -1301,7 +1301,7 @@ const UINT8 mc6847_friend_device::ntsc_round_fontdata8x12[] = // ntsc_square_fontdata8x12 //------------------------------------------------- -const UINT8 mc6847_friend_device::ntsc_square_fontdata8x12[] = +const uint8_t mc6847_friend_device::ntsc_square_fontdata8x12[] = { 0x00, 0x00, 0x00, 0x1C, 0x22, 0x02, 0x1A, 0x2A, 0x2A, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00, @@ -1409,7 +1409,7 @@ const UINT8 mc6847_friend_device::ntsc_square_fontdata8x12[] = // s68047_fontdata8x12 //------------------------------------------------- -const UINT8 mc6847_friend_device::s68047_fontdata8x12[] = +const uint8_t mc6847_friend_device::s68047_fontdata8x12[] = { 0x00, 0x00, 0x00, 0x1C, 0x22, 0x2A, 0x2A, 0x2C, 0x20, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x22, 0x3E, 0x22, 0x22, 0x00, 0x00, @@ -1517,7 +1517,7 @@ const UINT8 mc6847_friend_device::s68047_fontdata8x12[] = // semigraphics4_fontdata8x12 //------------------------------------------------- -const UINT8 mc6847_friend_device::semigraphics4_fontdata8x12[] = +const uint8_t mc6847_friend_device::semigraphics4_fontdata8x12[] = { /* Block Graphics (Semigraphics 4 Graphics ) */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1544,7 +1544,7 @@ const UINT8 mc6847_friend_device::semigraphics4_fontdata8x12[] = // semigraphics6_fontdata8x12 //------------------------------------------------- -const UINT8 mc6847_friend_device::semigraphics6_fontdata8x12[] = +const uint8_t mc6847_friend_device::semigraphics6_fontdata8x12[] = { /* Semigraphics 6 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1694,7 +1694,7 @@ void mc6847_base_device::artifacter::update_colors(pixel_t c0, pixel_t c1) 0.000, 0.000, 0.236 /* [14] - black-red (reverse 13) */ }; - static const UINT8 artifact_correction[128] = + static const uint8_t artifact_correction[128] = { 0, 0, 0, 0, 0, 6, 0, 2, 5, 7, 5, 7, 1, 3, 1, 11, @@ -1749,9 +1749,9 @@ void mc6847_base_device::artifacter::update_colors(pixel_t c0, pixel_t c1) // artifacter::update //------------------------------------------------- -mc6847_base_device::pixel_t mc6847_base_device::artifacter::mix_color(double factor, UINT8 c0, UINT8 c1) +mc6847_base_device::pixel_t mc6847_base_device::artifacter::mix_color(double factor, uint8_t c0, uint8_t c1) { - return (UINT32) (UINT8) ((c0 * (1.0 - factor)) + (c1 * (0.0 + factor)) + 0.5); + return (uint32_t) (uint8_t) ((c0 * (1.0 - factor)) + (c1 * (0.0 + factor)) + 0.5); } @@ -1775,7 +1775,7 @@ const device_type M5C6847P1 = &device_creator; // mc6847_ntsc_device //------------------------------------------------- -mc6847_ntsc_device::mc6847_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6847_ntsc_device::mc6847_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6847_base_device(mconfig, MC6847_NTSC, "MC6847_NTSC", tag, owner, clock, ntsc_square_fontdata8x12, 262.0, "mc6847_ntsc", __FILE__) { } @@ -1786,7 +1786,7 @@ mc6847_ntsc_device::mc6847_ntsc_device(const machine_config &mconfig, const char // mc6847_pal_device //------------------------------------------------- -mc6847_pal_device::mc6847_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6847_pal_device::mc6847_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6847_base_device(mconfig, MC6847_PAL, "MC6847_PAL", tag, owner, clock, pal_square_fontdata8x12, 313.0, "mc6847_pal", __FILE__) { } @@ -1797,7 +1797,7 @@ mc6847_pal_device::mc6847_pal_device(const machine_config &mconfig, const char * // mc6847y_ntsc_device //------------------------------------------------- -mc6847y_ntsc_device::mc6847y_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6847y_ntsc_device::mc6847y_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6847_base_device(mconfig, MC6847Y_NTSC, "MC6847Y_NTSC", tag, owner, clock, ntsc_square_fontdata8x12, 262.5, "mc6847y", __FILE__) { } @@ -1808,7 +1808,7 @@ mc6847y_ntsc_device::mc6847y_ntsc_device(const machine_config &mconfig, const ch // mc6847y_pal_device //------------------------------------------------- -mc6847y_pal_device::mc6847y_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6847y_pal_device::mc6847y_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6847_base_device(mconfig, MC6847Y_PAL, "MC6847Y_PAL", tag, owner, clock, pal_square_fontdata8x12, 313.0, "mc6847y_pal", __FILE__) { } @@ -1819,7 +1819,7 @@ mc6847y_pal_device::mc6847y_pal_device(const machine_config &mconfig, const char // mc6847t1_ntsc_device //------------------------------------------------- -mc6847t1_ntsc_device::mc6847t1_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6847t1_ntsc_device::mc6847t1_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6847_base_device(mconfig, MC6847T1_NTSC, "MC6847T1_NTSC", tag, owner, clock, ntsc_round_fontdata8x12, 262.0, "mc6847t1_ntsc", __FILE__) { } @@ -1830,7 +1830,7 @@ mc6847t1_ntsc_device::mc6847t1_ntsc_device(const machine_config &mconfig, const // mc6847t1_pal_device //------------------------------------------------- -mc6847t1_pal_device::mc6847t1_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mc6847t1_pal_device::mc6847t1_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6847_base_device(mconfig, MC6847T1_PAL, "MC6847T1_PAL", tag, owner, clock, pal_round_fontdata8x12, 313.0, "mc6847t1_pal", __FILE__) { } @@ -1841,7 +1841,7 @@ mc6847t1_pal_device::mc6847t1_pal_device(const machine_config &mconfig, const ch // s68047_device //------------------------------------------------- -s68047_device::s68047_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s68047_device::s68047_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6847_base_device(mconfig, S68047, "S68047", tag, owner, clock, s68047_fontdata8x12, 262.0, "s68047", __FILE__) { } @@ -1862,7 +1862,7 @@ void s68047_device::hack_black_becomes_blue(bool flag) set_custom_palette( flag ? s_s68047_hack_palette : nullptr ); } -const UINT32 s68047_device::s_s68047_hack_palette[16] = +const uint32_t s68047_device::s_s68047_hack_palette[16] = { rgb_t(0x07, 0xff, 0x00), /* GREEN */ rgb_t(0xff, 0xff, 0x00), /* YELLOW */ @@ -1890,7 +1890,7 @@ const UINT32 s68047_device::s_s68047_hack_palette[16] = // m5c6847p1_device //------------------------------------------------- -m5c6847p1_device::m5c6847p1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m5c6847p1_device::m5c6847p1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mc6847_base_device(mconfig, M5C6847P1, "M5C6847P-1", tag, owner, clock, ntsc_square_fontdata8x12, 262.5, "m5c6847p1", __FILE__) { } diff --git a/src/devices/video/mc6847.h b/src/devices/video/mc6847.h index ac8279080e0..3a4bfdd3f67 100644 --- a/src/devices/video/mc6847.h +++ b/src/devices/video/mc6847.h @@ -63,8 +63,8 @@ mc6847_base_device::set_black_and_white(*device, _bw); -typedef device_delegate mc6847_get_char_rom_delegate; -#define MC6847_GET_CHARROM_MEMBER(_name) UINT8 _name(UINT8 ch, int line) +typedef device_delegate mc6847_get_char_rom_delegate; +#define MC6847_GET_CHARROM_MEMBER(_name) uint8_t _name(uint8_t ch, int line) #define ARTIFACTING_TAG "artifacting" @@ -90,18 +90,18 @@ public: static void set_get_char_rom(device_t &device, mc6847_get_char_rom_delegate callback) { downcast(device).m_charrom_cb = callback; } protected: - mc6847_friend_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, - const UINT8 *fontdata, bool is_mc6847t1, double tpfs, int field_sync_falling_edge_scanline, bool supports_partial_body_scanlines, const char *shortname, const char *source); + mc6847_friend_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, + const uint8_t *fontdata, bool is_mc6847t1, double tpfs, int field_sync_falling_edge_scanline, bool supports_partial_body_scanlines, const char *shortname, const char *source); // video mode constants - static const UINT8 MODE_AG = 0x80; - static const UINT8 MODE_GM2 = 0x40; - static const UINT8 MODE_GM1 = 0x20; - static const UINT8 MODE_GM0 = 0x10; - static const UINT8 MODE_CSS = 0x08; - static const UINT8 MODE_AS = 0x04; - static const UINT8 MODE_INTEXT = 0x02; - static const UINT8 MODE_INV = 0x01; + static const uint8_t MODE_AG = 0x80; + static const uint8_t MODE_GM2 = 0x40; + static const uint8_t MODE_GM1 = 0x20; + static const uint8_t MODE_GM0 = 0x10; + static const uint8_t MODE_CSS = 0x08; + static const uint8_t MODE_AS = 0x04; + static const uint8_t MODE_INTEXT = 0x02; + static const uint8_t MODE_INV = 0x01; // timer constants static const device_timer_id TIMER_FRAME = 0; @@ -110,23 +110,23 @@ protected: static const device_timer_id TIMER_FSYNC = 3; // fonts - static const UINT8 pal_round_fontdata8x12[]; - static const UINT8 pal_square_fontdata8x12[]; - static const UINT8 ntsc_round_fontdata8x12[]; - static const UINT8 ntsc_square_fontdata8x12[]; - static const UINT8 semigraphics4_fontdata8x12[]; - static const UINT8 semigraphics6_fontdata8x12[]; - static const UINT8 s68047_fontdata8x12[]; + static const uint8_t pal_round_fontdata8x12[]; + static const uint8_t pal_square_fontdata8x12[]; + static const uint8_t ntsc_round_fontdata8x12[]; + static const uint8_t ntsc_square_fontdata8x12[]; + static const uint8_t semigraphics4_fontdata8x12[]; + static const uint8_t semigraphics6_fontdata8x12[]; + static const uint8_t s68047_fontdata8x12[]; // pixel definitions - typedef UINT32 pixel_t; + typedef uint32_t pixel_t; pixel_t *bitmap_addr(bitmap_rgb32 &bitmap, int y, int x) { return &bitmap.pix32(y, x); } - static UINT8 simplify_mode(UINT8 data, UINT8 mode) + static uint8_t simplify_mode(uint8_t data, uint8_t mode) { // simplifies MC6847 modes to drop mode flags that are not significant return mode & ~((mode & MODE_AG) ? (MODE_AS | MODE_INV) : 0); @@ -137,29 +137,29 @@ protected: { public: // constructor that sets up the font data - character_map(const UINT8 *fontdata, bool is_mc6847t1); + character_map(const uint8_t *fontdata, bool is_mc6847t1); // optimized template function that emits a single character template - ATTR_FORCE_INLINE void emit_character(UINT8 mode, const UINT8 *data, int length, pixel_t *RESTRICT pixels, int y, const pixel_t *palette) + ATTR_FORCE_INLINE void emit_character(uint8_t mode, const uint8_t *data, int length, pixel_t *RESTRICT pixels, int y, const pixel_t *palette) { for (int i = 0; i < length; i++) { // get the character - UINT8 character = data[i]; + uint8_t character = data[i]; // based on the mode, determine which entry to use const entry *e = &m_entries[mode % ARRAY_LENGTH(m_entries)]; // identify the character in the font data - const UINT8 *font_character = e->m_fontdata + (character & e->m_character_mask) * 12; + const uint8_t *font_character = e->m_fontdata + (character & e->m_character_mask) * 12; // get the particular slice out - UINT8 font_character_slice = font_character[y % 12]; + uint8_t font_character_slice = font_character[y % 12]; // get the two colors - UINT16 color_base_0 = e->m_color_base_0 + ((character >> e->m_color_shift_0) & e->m_color_mask_0); - UINT16 color_base_1 = e->m_color_base_1 + ((character >> e->m_color_shift_1) & e->m_color_mask_1); + uint16_t color_base_0 = e->m_color_base_0 + ((character >> e->m_color_shift_0) & e->m_color_mask_0); + uint16_t color_base_1 = e->m_color_base_1 + ((character >> e->m_color_shift_1) & e->m_color_mask_1); pixel_t color_0 = palette[color_base_0]; pixel_t color_1 = palette[color_base_1]; @@ -177,26 +177,26 @@ protected: private: struct entry { - const UINT8 *m_fontdata; - UINT8 m_character_mask; - UINT8 m_color_shift_0; - UINT8 m_color_shift_1; - UINT8 m_color_mask_0; - UINT8 m_color_mask_1; - UINT16 m_color_base_0; - UINT16 m_color_base_1; + const uint8_t *m_fontdata; + uint8_t m_character_mask; + uint8_t m_color_shift_0; + uint8_t m_color_shift_1; + uint8_t m_color_mask_0; + uint8_t m_color_mask_1; + uint16_t m_color_base_0; + uint16_t m_color_base_1; }; // lookup table for MC6847 modes to determine font data and color entry m_entries[128]; // text font data calculated on startup - UINT8 m_text_fontdata_inverse[64*12]; - UINT8 m_text_fontdata_lower_case[64*12]; - UINT8 m_text_fontdata_lower_case_inverse[64*12]; + uint8_t m_text_fontdata_inverse[64*12]; + uint8_t m_text_fontdata_lower_case[64*12]; + uint8_t m_text_fontdata_lower_case_inverse[64*12]; // optimized function that tests a single bit - ATTR_FORCE_INLINE pixel_t bit_test(UINT8 data, int shift, pixel_t color_0, pixel_t color_1) + ATTR_FORCE_INLINE pixel_t bit_test(uint8_t data, int shift, pixel_t color_0, pixel_t color_1) { return data & (0x80 >> shift) ? color_1 : color_0; } @@ -214,7 +214,7 @@ protected: // artifacting application template - ATTR_FORCE_INLINE void process_artifacts(pixel_t *pixels, UINT8 mode, const pixel_t *palette) + ATTR_FORCE_INLINE void process_artifacts(pixel_t *pixels, uint8_t mode, const pixel_t *palette) { if (((mode & (MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0)) == (MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0)) && (m_artifacting != 0)) @@ -229,7 +229,7 @@ protected: int x, i; for (x = 0; x < 256; x += 2) { - UINT8 val = ((pixels[(x - 2) * xscale] == c1) ? 0x20 : 0x00) + uint8_t val = ((pixels[(x - 2) * xscale] == c1) ? 0x20 : 0x00) | ((pixels[(x - 1) * xscale] == c1) ? 0x10 : 0x00) | ((pixels[(x + 0) * xscale] == c1) ? 0x08 : 0x00) | ((pixels[(x + 1) * xscale] == c1) ? 0x04 : 0x00) @@ -257,7 +257,7 @@ protected: pixel_t m_expanded_colors[128]; void update_colors(pixel_t c0, pixel_t c1); - static pixel_t mix_color(double factor, UINT8 c0, UINT8 c1); + static pixel_t mix_color(double factor, uint8_t c0, uint8_t c1); }; enum border_color_t @@ -291,9 +291,9 @@ protected: virtual void horizontal_sync_changed(bool line); virtual void field_sync_changed(bool line); virtual void enter_bottom_border(void); - virtual void record_border_scanline(UINT16 physical_scanline); - virtual void record_body_scanline(UINT16 physical_scanline, UINT16 logical_scanline) = 0; - virtual void record_partial_body_scanline(UINT16 physical_scanline, UINT16 logical_scanline, INT32 start_clock, INT32 end_clock) = 0; + virtual void record_border_scanline(uint16_t physical_scanline); + virtual void record_body_scanline(uint16_t physical_scanline, uint16_t logical_scanline) = 0; + virtual void record_partial_body_scanline(uint16_t physical_scanline, uint16_t logical_scanline, int32_t start_clock, int32_t end_clock) = 0; // miscellaneous void video_flush(void); @@ -305,12 +305,12 @@ protected: // converts to B&W static pixel_t black_and_white(rgb_t color) { - UINT8 average_color = (color.r() + color.g() + color.b()) / 3; + uint8_t average_color = (color.r() + color.g() + color.b()) / 3; return rgb_t(average_color, average_color, average_color); } // changes the geometry - ATTR_FORCE_INLINE void set_geometry(UINT16 top_border_scanlines, UINT16 body_scanlines, bool wide) + ATTR_FORCE_INLINE void set_geometry(uint16_t top_border_scanlines, uint16_t body_scanlines, bool wide) { if (UNEXPECTED((m_top_border_scanlines != top_border_scanlines) || (m_body_scanlines != body_scanlines) @@ -324,7 +324,7 @@ protected: } // calculates the border color - static ATTR_FORCE_INLINE border_color_t border_value(UINT8 mode, bool is_mc6847t1) + static ATTR_FORCE_INLINE border_color_t border_value(uint8_t mode, bool is_mc6847t1) { border_color_t result; @@ -374,7 +374,7 @@ protected: // template function for emitting graphics bytes template - ATTR_FORCE_INLINE void emit_graphics(const UINT8 *data, int length, pixel_t *RESTRICT pixels, UINT16 color_base, const pixel_t *RESTRICT palette) + ATTR_FORCE_INLINE void emit_graphics(const uint8_t *data, int length, pixel_t *RESTRICT pixels, uint16_t color_base, const pixel_t *RESTRICT palette) { for (int i = 0; i < length; i++) { @@ -382,7 +382,7 @@ protected: { for (int k = 0; k < xscale; k++) { - UINT16 color = color_base + ((data[i] >> (8 - (j + 1) * bits_per_pixel)) & ((1 << bits_per_pixel) - 1)); + uint16_t color = color_base + ((data[i] >> (8 - (j + 1) * bits_per_pixel)) & ((1 << bits_per_pixel) - 1)); pixels[(i * (8 / bits_per_pixel) + j) * xscale + k] = palette[color]; } } @@ -391,7 +391,7 @@ protected: // template function for external bytes template - ATTR_FORCE_INLINE void emit_extbytes(const UINT8 *data, int length, pixel_t *RESTRICT pixels, UINT16 color_base, const pixel_t *RESTRICT palette) + ATTR_FORCE_INLINE void emit_extbytes(const uint8_t *data, int length, pixel_t *RESTRICT pixels, uint16_t color_base, const pixel_t *RESTRICT palette) { for (int i = 0; i < length; i++) { @@ -399,7 +399,7 @@ protected: { for (int k = 0; k < xscale; k++) { - UINT16 color = color_base + BIT(data[i], 7-j); + uint16_t color = color_base + BIT(data[i], 7-j); pixels[(i * (8 / bits_per_pixel) + j) * xscale + k] = palette[color]; } } @@ -408,10 +408,10 @@ protected: // template function for emitting samples template - UINT32 emit_mc6847_samples(UINT8 mode, const UINT8 *data, int length, pixel_t *RESTRICT pixels, const pixel_t *RESTRICT palette, + uint32_t emit_mc6847_samples(uint8_t mode, const uint8_t *data, int length, pixel_t *RESTRICT pixels, const pixel_t *RESTRICT palette, mc6847_get_char_rom_delegate get_char_rom, int x, int y) { - UINT32 result; + uint32_t result; if (mode & MODE_AG) { /* graphics */ @@ -452,7 +452,7 @@ protected: /* external ROM */ for (int i = 0; i < length; i++) { - UINT8 byte = m_charrom_cb(data[i], y % 12) ^ (mode & MODE_INV ? 0xFF : 0x00); + uint8_t byte = m_charrom_cb(data[i], y % 12) ^ (mode & MODE_INV ? 0xFF : 0x00); emit_extbytes<1, xscale>(&byte, 1, &pixels[i * 8], (mode & MODE_CSS) ? 14 : 12, palette); } result = length * 8 * xscale; @@ -488,25 +488,25 @@ private: int m_field_sync_falling_edge_scanline; bool m_wide; bool m_video_changed; - UINT16 m_top_border_scanlines; - UINT16 m_body_scanlines; + uint16_t m_top_border_scanlines; + uint16_t m_body_scanlines; bool m_recording_scanline; bool m_supports_partial_body_scanlines; // video state - UINT16 m_physical_scanline; - UINT16 m_logical_scanline; - UINT16 m_logical_scanline_zone; + uint16_t m_physical_scanline; + uint16_t m_logical_scanline; + uint16_t m_logical_scanline_zone; bool m_horizontal_sync; bool m_field_sync; - UINT32 m_partial_scanline_clocks; + uint32_t m_partial_scanline_clocks; // functions void change_horizontal_sync(bool line); void change_field_sync(bool line); void update_field_sync_timer(void); void next_scanline(void); - INT32 get_clocks_since_hsync(); + int32_t get_clocks_since_hsync(); // debugging const char *scanline_zone_string(scanline_zone zone); @@ -518,13 +518,13 @@ class mc6847_base_device : public mc6847_friend_device public: template static devcb_base &set_input_callback(device_t &device, _Object object) { return downcast(device).m_input_cb.set_callback(object); } - static void set_get_fixed_mode(device_t &device, UINT8 mode) { downcast(device).m_fixed_mode = mode; } + static void set_get_fixed_mode(device_t &device, uint8_t mode) { downcast(device).m_fixed_mode = mode; } static void set_black_and_white(device_t &device, bool bw) { downcast(device).m_black_and_white = bw; } /* updates the screen -- this will call begin_update(), followed by update_row() reapeatedly and after all row updating is complete, end_update() */ - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // mode changing operations DECLARE_WRITE_LINE_MEMBER( ag_w ) { change_mode(MODE_AG, state); } @@ -537,7 +537,7 @@ public: DECLARE_WRITE_LINE_MEMBER( inv_w ) { change_mode(MODE_INV, state); } protected: - mc6847_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const UINT8 *fontdata, double tpfs, const char *shortname, const char *source); + mc6847_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const uint8_t *fontdata, double tpfs, const char *shortname, const char *source); // device-level overrides virtual void device_start() override; @@ -546,8 +546,8 @@ protected: // other overrides virtual void field_sync_changed(bool line) override; - virtual void record_body_scanline(UINT16 physical_scanline, UINT16 scanline) override; - virtual void record_partial_body_scanline(UINT16 physical_scanline, UINT16 logical_scanline, INT32 start_clock, INT32 end_clock) override; + virtual void record_body_scanline(uint16_t physical_scanline, uint16_t scanline) override; + virtual void record_partial_body_scanline(uint16_t physical_scanline, uint16_t logical_scanline, int32_t start_clock, int32_t end_clock) override; void set_custom_palette(const pixel_t *custom_palette) { @@ -560,14 +560,14 @@ protected: private: struct video_scanline { - UINT8 m_sample_count; - UINT8 m_mode[32]; - UINT8 m_data[32]; + uint8_t m_sample_count; + uint8_t m_mode[32]; + uint8_t m_data[32]; }; // palette static const int PALETTE_LENGTH = 16; - static const UINT32 s_palette[PALETTE_LENGTH]; + static const uint32_t s_palette[PALETTE_LENGTH]; // callbacks @@ -578,24 +578,24 @@ private: bool m_black_and_white; // incidentals - UINT8 m_fixed_mode; - UINT8 m_fixed_mode_mask; + uint8_t m_fixed_mode; + uint8_t m_fixed_mode_mask; const pixel_t *m_palette; pixel_t m_bw_palette[PALETTE_LENGTH]; // state - UINT8 m_mode; - UINT16 m_video_address; + uint8_t m_mode; + uint16_t m_video_address; bool m_dirty; video_scanline m_data[192]; - void change_mode(UINT8 mode, int state) + void change_mode(uint8_t mode, int state) { // sanity check, to ensure that we're not changing fixed modes assert((mode & m_fixed_mode_mask) == 0); // calculate new mode - UINT8 new_mode; + uint8_t new_mode; if (state) new_mode = m_mode | mode; else @@ -620,16 +620,16 @@ private: void setup_fixed_mode(); // runtime functions - void record_body_scanline(UINT16 physical_scanline, UINT16 scanline, INT32 start_pos, INT32 end_pos); - pixel_t border_value(UINT8 mode, const pixel_t *palette, bool is_mc6847t1); + void record_body_scanline(uint16_t physical_scanline, uint16_t scanline, int32_t start_pos, int32_t end_pos); + pixel_t border_value(uint8_t mode, const pixel_t *palette, bool is_mc6847t1); // template function for doing video update collection template - void record_scanline_res(int scanline, INT32 start_pos, INT32 end_pos); + void record_scanline_res(int scanline, int32_t start_pos, int32_t end_pos); // miscellaneous - UINT8 input(UINT16 address); - INT32 scanline_position_from_clock(INT32 clocks_since_hsync); + uint8_t input(uint16_t address); + int32_t scanline_position_from_clock(int32_t clocks_since_hsync); }; @@ -640,54 +640,54 @@ private: class mc6847_ntsc_device : public mc6847_base_device { public: - mc6847_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6847_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mc6847_pal_device : public mc6847_base_device { public: - mc6847_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6847_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mc6847y_ntsc_device : public mc6847_base_device { public: - mc6847y_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6847y_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mc6847y_pal_device : public mc6847_base_device { public: - mc6847y_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6847y_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mc6847t1_ntsc_device : public mc6847_base_device { public: - mc6847t1_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6847t1_ntsc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class mc6847t1_pal_device : public mc6847_base_device { public: - mc6847t1_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mc6847t1_pal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class s68047_device : public mc6847_base_device { public: - s68047_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s68047_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void hack_black_becomes_blue(bool flag); private: - static const UINT32 s_s68047_hack_palette[16]; + static const uint32_t s_s68047_hack_palette[16]; }; class m5c6847p1_device : public mc6847_base_device { public: - m5c6847p1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m5c6847p1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/video/mga2064w.cpp b/src/devices/video/mga2064w.cpp index 161c9560da9..e3d054f8b75 100644 --- a/src/devices/video/mga2064w.cpp +++ b/src/devices/video/mga2064w.cpp @@ -4,7 +4,7 @@ const device_type MGA2064W = &device_creator; -mga2064w_device::mga2064w_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mga2064w_device::mga2064w_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, MGA2064W, "Matrox Millennium", tag, owner, clock, "mga2064w", __FILE__) { } diff --git a/src/devices/video/mga2064w.h b/src/devices/video/mga2064w.h index e00e569b498..844f75254d1 100644 --- a/src/devices/video/mga2064w.h +++ b/src/devices/video/mga2064w.h @@ -10,7 +10,7 @@ class mga2064w_device : public pci_device { public: - mga2064w_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mga2064w_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override; diff --git a/src/devices/video/mos6566.cpp b/src/devices/video/mos6566.cpp index b9aab52bb3e..ab34a1894d6 100644 --- a/src/devices/video/mos6566.cpp +++ b/src/devices/video/mos6566.cpp @@ -277,7 +277,7 @@ inline void mos6566_device::clear_interrupt( int mask ) } } -inline UINT8 mos6566_device::read_videoram(offs_t offset) +inline uint8_t mos6566_device::read_videoram(offs_t offset) { //logerror("cycle %u VRAM %04x BA %u AEC %u\n", m_cycle, offset & 0x3fff, m_ba, m_aec); m_last_data = space(AS_0).read_byte(offset & 0x3fff); @@ -285,7 +285,7 @@ inline UINT8 mos6566_device::read_videoram(offs_t offset) return m_last_data; } -inline UINT8 mos6566_device::read_colorram(offs_t offset) +inline uint8_t mos6566_device::read_colorram(offs_t offset) { return space(AS_1).read_byte(offset & 0x3ff); } @@ -412,7 +412,7 @@ inline void mos6566_device::sample_border() inline void mos6566_device::check_sprite_dma() { int i; - UINT8 mask = 1; + uint8_t mask = 1; for (i = 0; i < 8; i++, mask <<= 1) if (SPRITEON(i) && ((m_rasterline & 0xff) == SPRITE_Y_POS(i))) @@ -429,7 +429,7 @@ inline void mos6566_device::matrix_access() { if (!m_is_bad_line) return; - UINT16 adr = (m_vc & 0x03ff) | VIDEOADDR; + uint16_t adr = (m_vc & 0x03ff) | VIDEOADDR; // we're in the second clock phase m_phi0 = 1; @@ -452,7 +452,7 @@ inline void mos6566_device::graphics_access() { if (m_display_state == 1) { - UINT16 adr; + uint16_t adr; if (HIRESON) adr = ((m_vc & 0x03ff) << 3) | m_bitmapaddr | m_rc; else @@ -476,7 +476,7 @@ inline void mos6566_device::draw_background() { if (m_draw_this_line) { - UINT8 c; + uint8_t c; switch (GFXMODE) { @@ -508,10 +508,10 @@ inline void mos6566_device::draw_background() } } -inline void mos6566_device::draw_mono( UINT16 p, UINT8 c0, UINT8 c1 ) +inline void mos6566_device::draw_mono( uint16_t p, uint8_t c0, uint8_t c1 ) { - UINT8 c[2]; - UINT8 data = m_gfx_data; + uint8_t c[2]; + uint8_t data = m_gfx_data; c[0] = c0; c[1] = c1; @@ -534,10 +534,10 @@ inline void mos6566_device::draw_mono( UINT16 p, UINT8 c0, UINT8 c1 ) m_fore_coll_buf[p + 0] = data & 1; } -inline void mos6566_device::draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, UINT8 c3 ) +inline void mos6566_device::draw_multi( uint16_t p, uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3 ) { - UINT8 c[4]; - UINT8 data = m_gfx_data; + uint8_t c[4]; + uint8_t data = m_gfx_data; c[0] = c0; c[1] = c1; @@ -572,12 +572,12 @@ inline void mos6566_device::draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, // mos6566_device - constructor //------------------------------------------------- -mos6566_device::mos6566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6566_device::mos6566_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : mos6566_device(mconfig, MOS6566, "MOS6566", tag, owner, clock, TYPE_6566, "mos6566", __FILE__) { } -mos6566_device::mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +mos6566_device::mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -597,28 +597,28 @@ mos6566_device::mos6566_device(const machine_config &mconfig, device_type type, { } -mos6567_device::mos6567_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6567_device::mos6567_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :mos6566_device(mconfig, MOS6567, "MOS6567", tag, owner, clock, TYPE_6567, "mos6567", __FILE__) { } -mos6567_device::mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +mos6567_device::mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) :mos6566_device(mconfig, type, name, tag, owner, clock, variant, shortname, source) { } -mos8562_device::mos8562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8562_device::mos8562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :mos6567_device(mconfig, MOS8562, "MOS8562", tag, owner, clock, TYPE_8562, "mos8562", __FILE__) { } -mos8564_device::mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8564_device::mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :mos6567_device(mconfig, MOS8564, "MOS8564", tag, owner, clock, TYPE_8564, "mos8564", __FILE__) { } -mos6569_device::mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos6569_device::mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :mos6566_device(mconfig, MOS6566, "MOS6569", tag, owner, clock, TYPE_6569, "mos6569", __FILE__) { } -mos6569_device::mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source) +mos6569_device::mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source) :mos6566_device(mconfig, type, name, tag, owner, clock, variant, shortname, source) { } -mos8565_device::mos8565_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8565_device::mos8565_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :mos6569_device(mconfig, MOS8565, "MOS8565", tag, owner, clock, TYPE_8565, "mos8565", __FILE__) { } -mos8566_device::mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mos8566_device::mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :mos6569_device(mconfig, MOS8566, "MOS8566", tag, owner, clock, TYPE_8566, "mos8566", __FILE__) { } @@ -846,8 +846,8 @@ void mos6566_device::execute_run() { do { - UINT8 cpu_cycles = m_cpu->total_cycles() & 0xff; - UINT8 vic_cycles = total_cycles() & 0xff; + uint8_t cpu_cycles = m_cpu->total_cycles() & 0xff; + uint8_t vic_cycles = total_cycles() & 0xff; m_phi0 = 0; @@ -857,7 +857,7 @@ void mos6566_device::execute_run() set_aec(CLEAR_LINE); int i; - UINT8 mask; + uint8_t mask; if (m_rasterline == VIC2_FIRST_DMA_LINE) m_bad_lines_enabled = SCREENON; @@ -1434,8 +1434,8 @@ void mos6569_device::execute_run() { do { - UINT8 cpu_cycles = m_cpu->total_cycles() & 0xff; - UINT8 vic_cycles = total_cycles() & 0xff; + uint8_t cpu_cycles = m_cpu->total_cycles() & 0xff; + uint8_t vic_cycles = total_cycles() & 0xff; m_phi0 = 0; @@ -1445,7 +1445,7 @@ void mos6569_device::execute_run() set_aec(CLEAR_LINE); int i; - UINT8 mask; + uint8_t mask; if ((m_rasterline == VIC2_FIRST_DMA_LINE) && !m_bad_lines_enabled) m_bad_lines_enabled = SCREENON; @@ -1999,7 +1999,7 @@ void mos6566_device::draw_graphics() { if (m_draw_this_line == 0) { - UINT16 p = m_graphic_x + XSCROLL; + uint16_t p = m_graphic_x + XSCROLL; m_fore_coll_buf[p + 7] = 0; m_fore_coll_buf[p + 6] = 0; m_fore_coll_buf[p + 5] = 0; @@ -2011,7 +2011,7 @@ void mos6566_device::draw_graphics() } else if (m_ud_border_on) { - UINT16 p = m_graphic_x + XSCROLL; + uint16_t p = m_graphic_x + XSCROLL; m_fore_coll_buf[p + 7] = 0; m_fore_coll_buf[p + 6] = 0; m_fore_coll_buf[p + 5] = 0; @@ -2024,8 +2024,8 @@ void mos6566_device::draw_graphics() } else { - UINT8 tmp_col; - UINT16 p = m_graphic_x + XSCROLL; + uint8_t tmp_col; + uint16_t p = m_graphic_x + XSCROLL; switch (GFXMODE) { case 0: @@ -2117,10 +2117,10 @@ void mos6566_device::draw_graphics() void mos6566_device::draw_sprites() { int i; - UINT8 snum, sbit; - UINT8 spr_coll = 0, gfx_coll = 0; - UINT32 plane0_l, plane0_r, plane1_l, plane1_r; - UINT32 sdata_l, sdata_r; + uint8_t snum, sbit; + uint8_t spr_coll = 0, gfx_coll = 0; + uint32_t plane0_l, plane0_r, plane1_l, plane1_r; + uint32_t sdata_l, sdata_r; for (i = 0; i < 0x400; i++) m_spr_coll_buf[i] = 0; @@ -2129,9 +2129,9 @@ void mos6566_device::draw_sprites() { if ((m_spr_draw & sbit) && (SPRITE_X_POS(snum) <= (403 - (VIC2_FIRSTCOLUMN + 1)))) { - UINT16 p = SPRITE_X_POS(snum) + VIC2_X_2_EMU(0) + 8; - UINT8 color = SPRITE_COLOR(snum); - UINT32 sdata = (m_spr_draw_data[snum][0] << 24) | (m_spr_draw_data[snum][1] << 16) | (m_spr_draw_data[snum][2] << 8); + uint16_t p = SPRITE_X_POS(snum) + VIC2_X_2_EMU(0) + 8; + uint8_t color = SPRITE_COLOR(snum); + uint32_t sdata = (m_spr_draw_data[snum][0] << 24) | (m_spr_draw_data[snum][1] << 16) | (m_spr_draw_data[snum][2] << 8); if (SPRITE_X_EXPAND(snum)) { @@ -2148,7 +2148,7 @@ void mos6566_device::draw_sprites() plane1_r = (sdata_r & 0xaaaaaaaa) | (sdata_r & 0xaaaaaaaa) >> 1; for (i = 0; i < 32; i++, plane0_l <<= 1, plane1_l <<= 1) { - UINT8 col; + uint8_t col; if (plane1_l & 0x80000000) { @@ -2195,7 +2195,7 @@ void mos6566_device::draw_sprites() for (; i < 48; i++, plane0_r <<= 1, plane1_r <<= 1) { - UINT8 col; + uint8_t col; if(plane1_r & 0x80000000) { @@ -2303,12 +2303,12 @@ void mos6566_device::draw_sprites() { if (SPRITE_MULTICOLOR(snum)) { - UINT32 plane0 = (sdata & 0x55555555) | (sdata & 0x55555555) << 1; - UINT32 plane1 = (sdata & 0xaaaaaaaa) | (sdata & 0xaaaaaaaa) >> 1; + uint32_t plane0 = (sdata & 0x55555555) | (sdata & 0x55555555) << 1; + uint32_t plane1 = (sdata & 0xaaaaaaaa) | (sdata & 0xaaaaaaaa) >> 1; for (i = 0; i < 24; i++, plane0 <<= 1, plane1 <<= 1) { - UINT8 col; + uint8_t col; if (plane1 & 0x80000000) { @@ -2412,7 +2412,7 @@ void mos6566_device::draw_sprites() // screen_update - //------------------------------------------------- -UINT32 mos6566_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mos6566_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(PALETTE_MOS[0], cliprect); @@ -2429,7 +2429,7 @@ UINT32 mos6566_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap READ8_MEMBER( mos6566_device::read ) { - UINT8 val = 0; + uint8_t val = 0; offset &= 0x3f; diff --git a/src/devices/video/mos6566.h b/src/devices/video/mos6566.h index 81096055db7..2b8c5ecd820 100644 --- a/src/devices/video/mos6566.h +++ b/src/devices/video/mos6566.h @@ -211,8 +211,8 @@ class mos6566_device : public device_t, { public: // construction/destruction - mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); - mos6566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); + mos6566_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_cpu_tag(device_t &device, const char *tag) { downcast(device).m_cpu.set_tag(tag); } template static devcb_base &set_irq_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_irq.set_callback(object); } @@ -231,9 +231,9 @@ public: DECLARE_READ_LINE_MEMBER( ba_r ) { return m_ba; } // bus available DECLARE_READ_LINE_MEMBER( aec_r ) { return m_aec; } // address enable control - UINT8 bus_r() { return m_last_data; } + uint8_t bus_r() { return m_last_data; } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: enum @@ -267,8 +267,8 @@ protected: inline void set_ba(int state); inline void set_aec(int state); inline void bad_line_ba(); - inline UINT8 read_videoram(offs_t offset); - inline UINT8 read_colorram(offs_t offset); + inline uint8_t read_videoram(offs_t offset); + inline uint8_t read_colorram(offs_t offset); inline void idle_access(); inline void spr_ba(int num); inline void spr_ptr_access( int num ); @@ -282,8 +282,8 @@ protected: inline void matrix_access(); inline void graphics_access(); inline void draw_background(); - inline void draw_mono( UINT16 p, UINT8 c0, UINT8 c1 ); - inline void draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, UINT8 c3 ); + inline void draw_mono( uint16_t p, uint8_t c0, uint8_t c1 ); + inline void draw_multi( uint16_t p, uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3 ); void draw_graphics(); void draw_sprites(); @@ -297,74 +297,74 @@ protected: int m_phi0; int m_ba; int m_aec; - UINT8 m_aec_delay; + uint8_t m_aec_delay; int m_rdy_cycles; - UINT8 m_reg[0x80]; + uint8_t m_reg[0x80]; int m_on; /* rastering of the screen */ - UINT16 m_chargenaddr, m_videoaddr, m_bitmapaddr; + uint16_t m_chargenaddr, m_videoaddr, m_bitmapaddr; bitmap_rgb32 m_bitmap; - UINT16 m_colors[4], m_spritemulti[4]; + uint16_t m_colors[4], m_spritemulti[4]; int m_rasterline; - UINT8 m_cycle; - UINT16 m_raster_x; - UINT16 m_graphic_x; - UINT8 m_last_data; + uint8_t m_cycle; + uint16_t m_raster_x; + uint16_t m_graphic_x; + uint8_t m_last_data; int m_lp; /* convert multicolor byte to background/foreground for sprite collision */ - UINT16 m_expandx[256]; - UINT16 m_expandx_multi[256]; + uint16_t m_expandx[256]; + uint16_t m_expandx_multi[256]; /* Display */ - UINT16 m_dy_start; - UINT16 m_dy_stop; + uint16_t m_dy_start; + uint16_t m_dy_stop; /* GFX */ - UINT8 m_draw_this_line; - UINT8 m_is_bad_line; - UINT8 m_bad_lines_enabled; - UINT8 m_display_state; - UINT8 m_char_data; - UINT8 m_gfx_data; - UINT8 m_color_data; - UINT8 m_last_char_data; - UINT8 m_matrix_line[40]; // Buffer for video line, read in Bad Lines - UINT8 m_color_line[40]; // Buffer for color line, read in Bad Lines - UINT8 m_vblanking; - UINT16 m_ml_index; - UINT8 m_rc; - UINT16 m_vc; - UINT16 m_vc_base; - UINT8 m_ref_cnt; + uint8_t m_draw_this_line; + uint8_t m_is_bad_line; + uint8_t m_bad_lines_enabled; + uint8_t m_display_state; + uint8_t m_char_data; + uint8_t m_gfx_data; + uint8_t m_color_data; + uint8_t m_last_char_data; + uint8_t m_matrix_line[40]; // Buffer for video line, read in Bad Lines + uint8_t m_color_line[40]; // Buffer for color line, read in Bad Lines + uint8_t m_vblanking; + uint16_t m_ml_index; + uint8_t m_rc; + uint16_t m_vc; + uint16_t m_vc_base; + uint8_t m_ref_cnt; /* Sprites */ - UINT8 m_spr_coll_buf[0x400]; // Buffer for sprite-sprite collisions and priorities - UINT8 m_fore_coll_buf[0x400]; // Buffer for foreground-sprite collisions and priorities - UINT8 m_spr_draw_data[8][4]; // Sprite data for drawing - UINT8 m_spr_exp_y; - UINT8 m_spr_dma_on; - UINT8 m_spr_draw; - UINT8 m_spr_disp_on; - UINT16 m_spr_ptr[8]; - UINT8 m_spr_data[8][4]; - UINT16 m_mc_base[8]; // Sprite data counter bases - UINT16 m_mc[8]; // Sprite data counters + uint8_t m_spr_coll_buf[0x400]; // Buffer for sprite-sprite collisions and priorities + uint8_t m_fore_coll_buf[0x400]; // Buffer for foreground-sprite collisions and priorities + uint8_t m_spr_draw_data[8][4]; // Sprite data for drawing + uint8_t m_spr_exp_y; + uint8_t m_spr_dma_on; + uint8_t m_spr_draw; + uint8_t m_spr_disp_on; + uint16_t m_spr_ptr[8]; + uint8_t m_spr_data[8][4]; + uint16_t m_mc_base[8]; // Sprite data counter bases + uint16_t m_mc[8]; // Sprite data counters /* Border */ - UINT8 m_border_on; - UINT8 m_ud_border_on; - UINT8 m_border_on_sample[5]; - UINT8 m_border_color_sample[0x400 / 8]; // Samples of border color at each "displayed" cycle + uint8_t m_border_on; + uint8_t m_ud_border_on; + uint8_t m_border_on_sample[5]; + uint8_t m_border_color_sample[0x400 / 8]; // Samples of border color at each "displayed" cycle /* Cycles */ - UINT64 m_first_ba_cycle; - UINT8 m_device_suspended; + uint64_t m_first_ba_cycle; + uint8_t m_device_suspended; }; @@ -374,8 +374,8 @@ class mos6567_device : public mos6566_device { public: // construction/destruction - mos6567_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); + mos6567_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); }; @@ -385,7 +385,7 @@ class mos8562_device : public mos6567_device { public: // construction/destruction - mos8562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8562_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -395,11 +395,11 @@ class mos8564_device : public mos6567_device { public: // construction/destruction - mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks / 8); } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 8); } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks / 8); } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 8); } }; @@ -409,8 +409,8 @@ class mos6569_device : public mos6566_device { public: // construction/destruction - mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant, const char *shortname, const char *source); + mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, uint32_t variant, const char *shortname, const char *source); // device-level overrides virtual void execute_run() override; @@ -423,7 +423,7 @@ class mos8565_device : public mos6569_device { public: // construction/destruction - mos8565_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8565_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; @@ -433,11 +433,11 @@ class mos8566_device : public mos6569_device { public: // construction/destruction - mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // device_execute_interface overrides - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const override { return (clocks / 8); } - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const override { return (cycles * 8); } + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const override { return (clocks / 8); } + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const override { return (cycles * 8); } }; diff --git a/src/devices/video/msm6222b.cpp b/src/devices/video/msm6222b.cpp index ac3c92b6807..c8eb8f5b790 100644 --- a/src/devices/video/msm6222b.cpp +++ b/src/devices/video/msm6222b.cpp @@ -21,19 +21,19 @@ ROM_START( msm6222b_01 ) ROM_LOAD( "msm6222b-01.bin", 0x0000, 0x1000, CRC(8ffa8521) SHA1(e108b520e6d20459a7bbd5958bbfa1d551a690bd) ) ROM_END -msm6222b_device::msm6222b_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) : +msm6222b_device::msm6222b_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), cursor_direction(false), cursor_blinking(false), two_line(false), shift_on_write(false), double_height(false), cursor_on(false), display_on(false), adc(0), shift(0), m_cgrom(*this, finder_base::DUMMY_TAG) { } -msm6222b_device::msm6222b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +msm6222b_device::msm6222b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSM6222B, "msm6222b-xx", tag, owner, clock, "msm6222b", __FILE__), cursor_direction(false), cursor_blinking(false), two_line(false), shift_on_write(false), double_height(false), cursor_on(false), display_on(false), adc(0), shift(0), m_cgrom(*this, DEVICE_SELF) { } -msm6222b_01_device::msm6222b_01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +msm6222b_01_device::msm6222b_01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : msm6222b_device(mconfig, MSM6222B_01, "msm6222b-01", tag, owner, clock, "msm6222b", __FILE__) { // load the fixed cgrom @@ -61,7 +61,7 @@ void msm6222b_device::device_start() shift = 0; } -void msm6222b_device::control_w(UINT8 data) +void msm6222b_device::control_w(uint8_t data) { int cmd; for(cmd = 7; cmd >= 0 && !(data & (1<= 140800; else return clocks % 204800 >= 102400; } -const UINT8 *msm6222b_device::render() +const uint8_t *msm6222b_device::render() { memset(render_buf, 0, 80*16); if(!display_on) @@ -212,7 +212,7 @@ const UINT8 *msm6222b_device::render() int char_height = double_height ? 11 : 8; for(int i=0; i<80; i++) { - UINT8 c = ddram[(i+shift) % 80]; + uint8_t c = ddram[(i+shift) % 80]; if(c < 16) memcpy(render_buf + 16*i, double_height ? cgram + 8*(c & 6) : cgram + 8*(c & 7), char_height); else if (m_cgrom.found()) diff --git a/src/devices/video/msm6222b.h b/src/devices/video/msm6222b.h index aecd70f3931..c09bb0ee973 100644 --- a/src/devices/video/msm6222b.h +++ b/src/devices/video/msm6222b.h @@ -21,28 +21,28 @@ class msm6222b_device : public device_t { public: - msm6222b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - msm6222b_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); + msm6222b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + msm6222b_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); - void control_w(UINT8 data); - UINT8 control_r(); - void data_w(UINT8 data); + void control_w(uint8_t data); + uint8_t control_r(); + void data_w(uint8_t data); // Character n bits are at bytes n*16..n*16+7 when 8-high, +10 when 11-high. Only the low 5 bits are used. // In one line mode n = 0..79. In two line mode first line is 0..39 and second is 40..79. - const UINT8 *render(); + const uint8_t *render(); protected: virtual void device_start() override; private: - UINT8 cgram[8*8]; - UINT8 ddram[80]; - UINT8 render_buf[80*16]; + uint8_t cgram[8*8]; + uint8_t ddram[80]; + uint8_t render_buf[80*16]; bool cursor_direction, cursor_blinking, two_line, shift_on_write, double_height, cursor_on, display_on; - UINT8 adc, shift; + uint8_t adc, shift; protected: - optional_region_ptr m_cgrom; + optional_region_ptr m_cgrom; void cursor_step(bool direction); void shift_step(bool direction); @@ -51,7 +51,7 @@ protected: class msm6222b_01_device : public msm6222b_device { public: - msm6222b_01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msm6222b_01_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/devices/video/msm6255.cpp b/src/devices/video/msm6255.cpp index 6ae565cce9f..50f0e1da71f 100644 --- a/src/devices/video/msm6255.cpp +++ b/src/devices/video/msm6255.cpp @@ -74,7 +74,7 @@ ADDRESS_MAP_END // msm6255_device - constructor //------------------------------------------------- -msm6255_device::msm6255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +msm6255_device::msm6255_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MSM6255, "MSM6255", tag, owner, clock, "msm6255", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -153,7 +153,7 @@ WRITE8_MEMBER( msm6255_device::ir_w ) READ8_MEMBER( msm6255_device::dr_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (m_ir) { @@ -247,7 +247,7 @@ WRITE8_MEMBER( msm6255_device::dr_w ) // read_byte - //------------------------------------------------- -UINT8 msm6255_device::read_byte(UINT16 ma, UINT8 ra) +uint8_t msm6255_device::read_byte(uint16_t ma, uint8_t ra) { offs_t offset; @@ -315,19 +315,19 @@ void msm6255_device::update_cursor() // draw_scanline - //------------------------------------------------- -void msm6255_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 ma, UINT8 ra) +void msm6255_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, uint16_t ma, uint8_t ra) { - UINT8 hp = (m_pr & PR_HP_MASK) + 1; - UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; - UINT8 cpu = m_cpr & CPR_CPU_MASK; - UINT8 cpd = m_cpr & CPR_CPD_MASK; - UINT16 car = (m_cur << 8) | m_clr; + uint8_t hp = (m_pr & PR_HP_MASK) + 1; + uint8_t hn = (m_hnr & HNR_HN_MASK) + 1; + uint8_t cpu = m_cpr & CPR_CPU_MASK; + uint8_t cpd = m_cpr & CPR_CPD_MASK; + uint16_t car = (m_cur << 8) | m_clr; int sx, x; for (sx = 0; sx < hn; sx++) { - UINT8 data = read_byte(ma, ra); + uint8_t data = read_byte(ma, ra); if (m_cursor) { @@ -358,9 +358,9 @@ void msm6255_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &clipre void msm6255_device::update_graphics(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; - UINT8 nx = (m_dvr & DVR_DN_MASK) + 1; - UINT16 sar = (m_sur << 8) | m_slr; + uint8_t hn = (m_hnr & HNR_HN_MASK) + 1; + uint8_t nx = (m_dvr & DVR_DN_MASK) + 1; + uint16_t sar = (m_sur << 8) | m_slr; int y; @@ -370,7 +370,7 @@ void msm6255_device::update_graphics(bitmap_ind16 &bitmap, const rectangle &clip for (y = 0; y < nx; y++) { // draw upper half scanline - UINT16 ma = sar + (y * hn); + uint16_t ma = sar + (y * hn); draw_scanline(bitmap, cliprect, y, ma); // draw lower half scanline @@ -386,10 +386,10 @@ void msm6255_device::update_graphics(bitmap_ind16 &bitmap, const rectangle &clip void msm6255_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; - UINT8 vp = (m_pr & PR_VP_MASK) + 1; - UINT8 nx = (m_dvr & DVR_DN_MASK) + 1; - UINT16 sar = (m_sur << 8) | m_slr; + uint8_t hn = (m_hnr & HNR_HN_MASK) + 1; + uint8_t vp = (m_pr & PR_VP_MASK) + 1; + uint8_t nx = (m_dvr & DVR_DN_MASK) + 1; + uint16_t sar = (m_sur << 8) | m_slr; int sy, y; @@ -400,7 +400,7 @@ void msm6255_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect for (y = 0; y < vp; y++) { // draw upper half scanline - UINT16 ma = sar + ((sy * vp) + y) * hn; + uint16_t ma = sar + ((sy * vp) + y) * hn; draw_scanline(bitmap, cliprect, (sy * vp) + y, ma, y); // draw lower half scanline @@ -415,7 +415,7 @@ void msm6255_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect // update_screen - update screen //------------------------------------------------- -UINT32 msm6255_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t msm6255_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_mor & MOR_DISPLAY_ON) { diff --git a/src/devices/video/msm6255.h b/src/devices/video/msm6255.h index c686656988f..b4b73d633a4 100644 --- a/src/devices/video/msm6255.h +++ b/src/devices/video/msm6255.h @@ -27,7 +27,7 @@ class msm6255_device : public device_t, { public: // construction/destruction - msm6255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + msm6255_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual DECLARE_ADDRESS_MAP(map, 8); @@ -37,7 +37,7 @@ public: DECLARE_READ8_MEMBER( dr_r ); DECLARE_WRITE8_MEMBER( dr_w ); - UINT32 screen_update(screen_device &device, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &device, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -62,25 +62,25 @@ private: REGISTER_CUR }; - UINT8 read_byte(UINT16 ma, UINT8 ra); + uint8_t read_byte(uint16_t ma, uint8_t ra); void update_cursor(); - void draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 ma, UINT8 ra = 0); + void draw_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, uint16_t ma, uint8_t ra = 0); void update_graphics(bitmap_ind16 &bitmap, const rectangle &cliprect); void update_text(bitmap_ind16 &bitmap, const rectangle &cliprect); const address_space_config m_space_config; - UINT8 m_ir; // instruction register - UINT8 m_mor; // mode control register - UINT8 m_pr; // character pitch register - UINT8 m_hnr; // horizontal character number register - UINT8 m_dvr; // duty number register - UINT8 m_cpr; // cursor form register - UINT8 m_slr; // start address (lower) register - UINT8 m_sur; // start address (upper) register - UINT8 m_clr; // cursor address (lower) register - UINT8 m_cur; // cursor address (upper) register + uint8_t m_ir; // instruction register + uint8_t m_mor; // mode control register + uint8_t m_pr; // character pitch register + uint8_t m_hnr; // horizontal character number register + uint8_t m_dvr; // duty number register + uint8_t m_cpr; // cursor form register + uint8_t m_slr; // start address (lower) register + uint8_t m_sur; // start address (upper) register + uint8_t m_clr; // cursor address (lower) register + uint8_t m_cur; // cursor address (upper) register int m_cursor; // is cursor displayed int m_frame; // frame counter diff --git a/src/devices/video/pc_vga.cpp b/src/devices/video/pc_vga.cpp index 5bdd16b4869..4e31bf99514 100644 --- a/src/devices/video/pc_vga.cpp +++ b/src/devices/video/pc_vga.cpp @@ -125,71 +125,71 @@ const device_type ATI_VGA = &device_creator; const device_type IBM8514A = &device_creator; const device_type MACH8 = &device_creator; -vga_device::vga_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) +vga_device::vga_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_palette(*this, "^palette"), m_screen(*this,"^screen") { } -vga_device::vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vga_device::vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VGA, "VGA", tag, owner, clock, "vga", __FILE__), m_palette(*this, "^palette"), m_screen(*this,"^screen") { } -svga_device::svga_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) +svga_device::svga_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) : vga_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -tseng_vga_device::tseng_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tseng_vga_device::tseng_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, TSENG_VGA, "TSENG LABS VGA", tag, owner, clock, "tseng_vga", __FILE__) { } -s3_vga_device::s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s3_vga_device::s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ati_vga_device(mconfig, S3_VGA, "S3 Graphics VGA", tag, owner, clock, "s3_vga", __FILE__) { } -s3_vga_device::s3_vga_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) +s3_vga_device::s3_vga_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) : ati_vga_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -gamtor_vga_device::gamtor_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gamtor_vga_device::gamtor_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, GAMTOR_VGA, "GAMTOR VGA", tag, owner, clock, "gamtor_vga", __FILE__) { } -ati_vga_device::ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ati_vga_device::ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, ATI_VGA, "ATI VGA", tag, owner, clock, "ati_vga", __FILE__) { } -ati_vga_device::ati_vga_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) +ati_vga_device::ati_vga_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) : svga_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -ibm8514a_device::ibm8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ibm8514a_device::ibm8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IBM8514A, "IBM8514A Video", tag, owner, clock, "ibm8514a", __FILE__) { } -ibm8514a_device::ibm8514a_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) +ibm8514a_device::ibm8514a_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) { } -mach8_device::mach8_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) +mach8_device::mach8_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) : ibm8514a_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -mach8_device::mach8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +mach8_device::mach8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ibm8514a_device(mconfig, MACH8, "MACH8", tag, owner, clock, "mach8", __FILE__) { } @@ -324,7 +324,7 @@ void mach8_device::device_start() memset(&mach8, 0, sizeof(mach8)); } -UINT16 vga_device::offset() +uint16_t vga_device::offset() { // popmessage("Offset: %04x %s %s **",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD"); if(vga.crtc.dw) @@ -337,13 +337,13 @@ UINT16 vga_device::offset() void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 ch, attr; - UINT8 bits; - UINT32 font_base; - UINT32 *bitmapline; + uint8_t ch, attr; + uint8_t bits; + uint32_t font_base; + uint32_t *bitmapline; int width=CHAR_WIDTH, height = (vga.crtc.maximum_scan_line) * (vga.crtc.scan_doubling + 1); int pos, line, column, mask, w, h, addr; - UINT8 blink_en,fore_col,back_col; + uint8_t blink_en,fore_col,back_col; pen_t pen; if(vga.crtc.cursor_enable) @@ -415,7 +415,7 @@ void vga_device::vga_vh_ega(bitmap_rgb32 &bitmap, const rectangle &cliprect) { int pos, line, column, c, addr, i, yi; int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1); - UINT32 *bitmapline; + uint32_t *bitmapline; pen_t pen; int pel_shift = (vga.attribute.pel_shift & 7); @@ -460,8 +460,8 @@ void vga_device::vga_vh_ega(bitmap_rgb32 &bitmap, const rectangle &cliprect) void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect) { int pos, line, column, c, addr, curr_addr; - UINT32 *bitmapline; - UINT16 mask_comp; + uint32_t *bitmapline; + uint16_t mask_comp; int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1); int yi; int xi; @@ -533,10 +533,10 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect) void vga_device::vga_vh_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *bitmapline; + uint32_t *bitmapline; int height = (vga.crtc.scan_doubling + 1); int x,xi,y,yi; - UINT32 addr; + uint32_t addr; pen_t pen; int width; @@ -568,10 +568,10 @@ void vga_device::vga_vh_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect) void vga_device::vga_vh_mono(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *bitmapline; + uint32_t *bitmapline; int height = (vga.crtc.scan_doubling + 1); int x,xi,y,yi; - UINT32 addr; + uint32_t addr; pen_t pen; int width; @@ -604,13 +604,13 @@ void vga_device::vga_vh_mono(bitmap_rgb32 &bitmap, const rectangle &cliprect) void svga_device::svga_vh_rgb8(bitmap_rgb32 &bitmap, const rectangle &cliprect) { int pos, line, column, c, addr, curr_addr; - UINT32 *bitmapline; - UINT16 mask_comp; + uint32_t *bitmapline; + uint16_t mask_comp; int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1); int yi; int xi; - UINT8 start_shift; -// UINT16 line_length; + uint8_t start_shift; +// uint16_t line_length; /* line compare is screen sensitive */ mask_comp = 0x3ff; @@ -661,8 +661,8 @@ void svga_device::svga_vh_rgb15(bitmap_rgb32 &bitmap, const rectangle &cliprect) int xm; int pos, line, column, c, addr, curr_addr; - UINT32 *bitmapline; -// UINT16 mask_comp; + uint32_t *bitmapline; +// uint16_t mask_comp; /* line compare is screen sensitive */ // mask_comp = 0xff | (TLINES & 0x300); @@ -705,8 +705,8 @@ void svga_device::svga_vh_rgb16(bitmap_rgb32 &bitmap, const rectangle &cliprect) int xm; int pos, line, column, c, addr, curr_addr; - UINT32 *bitmapline; -// UINT16 mask_comp; + uint32_t *bitmapline; +// uint16_t mask_comp; /* line compare is screen sensitive */ // mask_comp = 0xff | (TLINES & 0x300); @@ -748,9 +748,9 @@ void svga_device::svga_vh_rgb24(bitmap_rgb32 &bitmap, const rectangle &cliprect) int yi; int xm; int pos, line, column, c, addr, curr_addr; - UINT32 *bitmapline; + uint32_t *bitmapline; -// UINT16 mask_comp; +// uint16_t mask_comp; /* line compare is screen sensitive */ // mask_comp = 0xff | (TLINES & 0x300); @@ -789,9 +789,9 @@ void svga_device::svga_vh_rgb32(bitmap_rgb32 &bitmap, const rectangle &cliprect) int yi; int xm; int pos, line, column, c, addr, curr_addr; - UINT32 *bitmapline; + uint32_t *bitmapline; -// UINT16 mask_comp; +// uint16_t mask_comp; /* line compare is screen sensitive */ // mask_comp = 0xff | (TLINES & 0x300); @@ -821,7 +821,7 @@ void svga_device::svga_vh_rgb32(bitmap_rgb32 &bitmap, const rectangle &cliprect) } } -UINT8 vga_device::pc_vga_choosevideomode() +uint8_t vga_device::pc_vga_choosevideomode() { int i; @@ -882,7 +882,7 @@ UINT8 vga_device::pc_vga_choosevideomode() } -UINT8 svga_device::pc_vga_choosevideomode() +uint8_t svga_device::pc_vga_choosevideomode() { int i; @@ -963,9 +963,9 @@ UINT8 svga_device::pc_vga_choosevideomode() } -UINT32 vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 cur_mode = pc_vga_choosevideomode(); + uint8_t cur_mode = pc_vga_choosevideomode(); switch(cur_mode) { case SCREEN_OFF: bitmap.fill (m_palette->black_pen(), cliprect);break; @@ -979,9 +979,9 @@ UINT32 vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, co return 0; } -UINT32 svga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t svga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 cur_mode = pc_vga_choosevideomode(); + uint8_t cur_mode = pc_vga_choosevideomode(); switch(cur_mode) { @@ -1001,9 +1001,9 @@ UINT32 svga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c return 0; } -UINT32 s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 cur_mode; + uint8_t cur_mode; svga_device::screen_update(screen, bitmap, cliprect); @@ -1013,14 +1013,14 @@ UINT32 s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, // TODO: support 16 bit and greater video modes if(s3.cursor_mode & 0x01) // if cursor is enabled { - UINT32 src; - UINT32* dst; - UINT8 val; + uint32_t src; + uint32_t* dst; + uint8_t val; int x,y; - UINT16 cx = s3.cursor_x & 0x07ff; - UINT16 cy = s3.cursor_y & 0x07ff; - UINT32 bg_col; - UINT32 fg_col; + uint16_t cx = s3.cursor_x & 0x07ff; + uint16_t cy = s3.cursor_y & 0x07ff; + uint32_t bg_col; + uint32_t fg_col; if(cur_mode == SCREEN_OFF || cur_mode == TEXT_MODE || cur_mode == MONO_MODE || cur_mode == CGA_MODE || cur_mode == EGA_MODE) return 0; // cursor only works in VGA or SVGA modes @@ -1030,7 +1030,7 @@ UINT32 s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, if(cur_mode == RGB16_MODE) { int r,g,b; - UINT16 datax; + uint16_t datax; datax = s3.cursor_bg[0]|s3.cursor_bg[1]<<8; r = (datax&0xf800)>>11; @@ -1067,8 +1067,8 @@ UINT32 s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, dst = &bitmap.pix32(cy + y, cx); for(x=0;x<64;x++) { - UINT16 bita = (vga.memory[(src+1) % vga.svga_intf.vram_size] | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16)); - UINT16 bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size] | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16)); + uint16_t bita = (vga.memory[(src+1) % vga.svga_intf.vram_size] | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16)); + uint16_t bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size] | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16)); val = ((bita & 0x01) << 1) | (bitb & 0x01); if(s3.extended_dac_ctrl & 0x10) { // X11 mode @@ -1118,9 +1118,9 @@ UINT32 s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, /***************************************************************************/ -inline UINT8 vga_device::vga_latch_write(int offs, UINT8 data) +inline uint8_t vga_device::vga_latch_write(int offs, uint8_t data) { - UINT8 res = 0; + uint8_t res = 0; switch (vga.gc.write_mode & 3) { case 0: @@ -1145,9 +1145,9 @@ inline UINT8 vga_device::vga_latch_write(int offs, UINT8 data) return res; } -UINT8 vga_device::crtc_reg_read(UINT8 index) +uint8_t vga_device::crtc_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; res = 0xff; @@ -1264,7 +1264,7 @@ void vga_device::recompute_params_clock(int divisor, int xtal) { int vblank_period,hblank_period; attoseconds_t refresh; - UINT8 hclock_m = (!GRAPHIC_MODE) ? CHAR_WIDTH : 8; + uint8_t hclock_m = (!GRAPHIC_MODE) ? CHAR_WIDTH : 8; int pixel_clock; /* safety check */ @@ -1293,7 +1293,7 @@ void vga_device::recompute_params() recompute_params_clock(1, (vga.miscellaneous_output & 0xc) ? XTAL_28_63636MHz : XTAL_25_1748MHz); } -void vga_device::crtc_reg_write(UINT8 index, UINT8 data) +void vga_device::crtc_reg_write(uint8_t index, uint8_t data) { /* Doom does this */ // if(vga.crtc.protect_enable && index <= 0x07) @@ -1444,7 +1444,7 @@ void vga_device::crtc_reg_write(UINT8 index, UINT8 data) } } -void vga_device::seq_reg_write(UINT8 index, UINT8 data) +void vga_device::seq_reg_write(uint8_t index, uint8_t data) { switch(index) { @@ -1462,10 +1462,10 @@ void vga_device::seq_reg_write(UINT8 index, UINT8 data) } } -UINT8 vga_device::vga_vblank() +uint8_t vga_device::vga_vblank() { - UINT8 res; - UINT16 vblank_start,vblank_end,vpos; + uint8_t res; + uint16_t vblank_start,vblank_end,vpos; /* calculate vblank start / end positions */ res = 0; @@ -1493,7 +1493,7 @@ UINT8 vga_device::vga_vblank() READ8_MEMBER(vga_device::vga_crtc_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (offset) { case 4: @@ -1503,7 +1503,7 @@ READ8_MEMBER(vga_device::vga_crtc_r) data = crtc_reg_read(vga.crtc.index); break; case 0xa: - UINT8 hsync,vsync; + uint8_t hsync,vsync; vga.attribute.state = 0; data = 0; @@ -1576,15 +1576,15 @@ WRITE8_MEMBER(vga_device::vga_crtc_w) READ8_MEMBER(vga_device::port_03b0_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (CRTC_PORT_ADDR==0x3b0) data=vga_crtc_r(space, offset, mem_mask); return data; } -UINT8 vga_device::gc_reg_read(UINT8 index) +uint8_t vga_device::gc_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; switch(index) { @@ -1632,7 +1632,7 @@ UINT8 vga_device::gc_reg_read(UINT8 index) READ8_MEMBER(vga_device::port_03c0_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (offset) { @@ -1749,7 +1749,7 @@ READ8_MEMBER(vga_device::port_03c0_r) READ8_MEMBER(vga_device::port_03d0_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (CRTC_PORT_ADDR == 0x3d0) data = vga_crtc_r(space, offset, mem_mask); if(offset == 8) @@ -1770,7 +1770,7 @@ WRITE8_MEMBER(vga_device::port_03b0_w) vga_crtc_w(space, offset, data, mem_mask); } -void vga_device::attribute_reg_write(UINT8 index, UINT8 data) +void vga_device::attribute_reg_write(uint8_t index, uint8_t data) { if((index & 0x30) == 0) { @@ -1791,7 +1791,7 @@ void vga_device::attribute_reg_write(UINT8 index, UINT8 data) } } -void vga_device::gc_reg_write(UINT8 index,UINT8 data) +void vga_device::gc_reg_write(uint8_t index,uint8_t data) { switch(index) { @@ -1996,8 +1996,8 @@ READ8_MEMBER(vga_device::mem_r) if (vga.gc.read_mode) { - UINT8 byte,layer; - UINT8 fill_latch; + uint8_t byte,layer; + uint8_t fill_latch; data=0; for(byte=0;byte<8;byte++) @@ -2021,7 +2021,7 @@ READ8_MEMBER(vga_device::mem_r) else { // TODO: Guesswork, probably not right - UINT8 i,data; + uint8_t i,data; data = 0; //printf("%08x\n",offset); @@ -2066,7 +2066,7 @@ WRITE8_MEMBER(vga_device::mem_w) } { - UINT8 i; + uint8_t i; for(i=0;i<4;i++) { @@ -2212,9 +2212,9 @@ void tseng_vga_device::tseng_define_video_mode() recompute_params_clock(divisor, xtal); } -UINT8 tseng_vga_device::tseng_crtc_reg_read(UINT8 index) +uint8_t tseng_vga_device::tseng_crtc_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; if(index <= 0x18) res = crtc_reg_read(index); @@ -2238,7 +2238,7 @@ UINT8 tseng_vga_device::tseng_crtc_reg_read(UINT8 index) return res; } -void tseng_vga_device::tseng_crtc_reg_write(UINT8 index, UINT8 data) +void tseng_vga_device::tseng_crtc_reg_write(uint8_t index, uint8_t data) { if(index <= 0x18) crtc_reg_write(index,data); @@ -2260,9 +2260,9 @@ void tseng_vga_device::tseng_crtc_reg_write(UINT8 index, UINT8 data) } } -UINT8 tseng_vga_device::tseng_seq_reg_read(UINT8 index) +uint8_t tseng_vga_device::tseng_seq_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; res = 0xff; @@ -2282,7 +2282,7 @@ UINT8 tseng_vga_device::tseng_seq_reg_read(UINT8 index) return res; } -void tseng_vga_device::tseng_seq_reg_write(UINT8 index, UINT8 data) +void tseng_vga_device::tseng_seq_reg_write(uint8_t index, uint8_t data) { if(index <= 0x04) { @@ -2303,7 +2303,7 @@ void tseng_vga_device::tseng_seq_reg_write(UINT8 index, UINT8 data) READ8_MEMBER(tseng_vga_device::port_03b0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3b0) { @@ -2349,7 +2349,7 @@ WRITE8_MEMBER(tseng_vga_device::port_03b0_w) tseng_define_video_mode(); } -void tseng_vga_device::tseng_attribute_reg_write(UINT8 index, UINT8 data) +void tseng_vga_device::tseng_attribute_reg_write(uint8_t index, uint8_t data) { switch(index) { @@ -2385,7 +2385,7 @@ void tseng_vga_device::tseng_attribute_reg_write(UINT8 index, UINT8 data) READ8_MEMBER(tseng_vga_device::port_03c0_r) { - UINT8 res; + uint8_t res; switch(offset) { @@ -2467,7 +2467,7 @@ WRITE8_MEMBER(tseng_vga_device::port_03c0_w) READ8_MEMBER(tseng_vga_device::port_03d0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3d0) { @@ -2543,7 +2543,7 @@ S3 implementation ******************************************/ -UINT16 s3_vga_device::offset() +uint16_t s3_vga_device::offset() { //popmessage("Offset: %04x %s %s %s",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",(s3.memory_config & 0x08)?"31":"--"); if(s3.memory_config & 0x08) @@ -2551,9 +2551,9 @@ UINT16 s3_vga_device::offset() return vga_device::offset(); } -UINT8 s3_vga_device::s3_crtc_reg_read(UINT8 index) +uint8_t s3_vga_device::s3_crtc_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; if(index <= 0x18) res = crtc_reg_read(index); @@ -2711,7 +2711,7 @@ void s3_vga_device::s3_define_video_mode() recompute_params_clock(divisor, xtal); } -void s3_vga_device::s3_crtc_reg_write(UINT8 index, UINT8 data) +void s3_vga_device::s3_crtc_reg_write(uint8_t index, uint8_t data) { if(index <= 0x18) crtc_reg_write(index,data); @@ -3014,9 +3014,9 @@ bit 0 Vertical Total bit 10. Bit 10 of the Vertical Total register (3d4h } } -UINT8 s3_vga_device::s3_seq_reg_read(UINT8 index) +uint8_t s3_vga_device::s3_seq_reg_read(uint8_t index) { - UINT8 res = 0xff; + uint8_t res = 0xff; if(index <= 0x0c) res = vga.sequencer.data[index]; @@ -3049,7 +3049,7 @@ UINT8 s3_vga_device::s3_seq_reg_read(UINT8 index) return res; } -void s3_vga_device::s3_seq_reg_write(UINT8 index, UINT8 data) +void s3_vga_device::s3_seq_reg_write(uint8_t index, uint8_t data) { if(index <= 0x0c) { @@ -3098,7 +3098,7 @@ void s3_vga_device::s3_seq_reg_write(UINT8 index, UINT8 data) READ8_MEMBER(s3_vga_device::port_03b0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3b0) { @@ -3135,7 +3135,7 @@ WRITE8_MEMBER(s3_vga_device::port_03b0_w) READ8_MEMBER(s3_vga_device::port_03c0_r) { - UINT8 res; + uint8_t res; switch(offset) { @@ -3165,7 +3165,7 @@ WRITE8_MEMBER(s3_vga_device::port_03c0_w) READ8_MEMBER(s3_vga_device::port_03d0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3d0) { @@ -3202,7 +3202,7 @@ WRITE8_MEMBER(s3_vga_device::port_03d0_w) READ8_MEMBER(ati_vga_device::port_03c0_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch(offset) { @@ -3220,12 +3220,12 @@ READ8_MEMBER(ati_vga_device::port_03c0_r) /* accelerated ports, TBD ... */ -void ibm8514a_device::ibm8514_write_fg(UINT32 offset) +void ibm8514a_device::ibm8514_write_fg(uint32_t offset) { address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); offset %= m_vga->vga.svga_intf.vram_size; - UINT8 dst = m_vga->mem_linear_r(space,offset,0xff); - UINT8 src = 0; + uint8_t dst = m_vga->mem_linear_r(space,offset,0xff); + uint8_t src = 0; // check clipping rectangle if((ibm8514.current_cmd & 0xe000) == 0xc000) // BitBLT writes to the destination X/Y, so check that instead @@ -3309,12 +3309,12 @@ void ibm8514a_device::ibm8514_write_fg(UINT32 offset) } } -void ibm8514a_device::ibm8514_write_bg(UINT32 offset) +void ibm8514a_device::ibm8514_write_bg(uint32_t offset) { address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); offset %= m_vga->vga.svga_intf.vram_size; - UINT8 dst = m_vga->mem_linear_r(space,offset,0xff); - UINT8 src = 0; + uint8_t dst = m_vga->mem_linear_r(space,offset,0xff); + uint8_t src = 0; // check clipping rectangle if((ibm8514.current_cmd & 0xe000) == 0xc000) // BitBLT writes to the destination X/Y, so check that instead @@ -3398,10 +3398,10 @@ void ibm8514a_device::ibm8514_write_bg(UINT32 offset) } } -void ibm8514a_device::ibm8514_write(UINT32 offset, UINT32 src) +void ibm8514a_device::ibm8514_write(uint32_t offset, uint32_t src) { int data_size = 8; - UINT32 xfer; + uint32_t xfer; switch(ibm8514.pixel_control & 0x00c0) { @@ -3494,7 +3494,7 @@ bit 0-7 Queue State. */ READ16_MEMBER(ibm8514a_device::ibm8514_gpstatus_r) { - UINT16 ret = 0x0000; + uint16_t ret = 0x0000; //if(LOG_8514) logerror("S3: 9AE8 read\n"); if(ibm8514.gpbusy == true) @@ -3504,9 +3504,9 @@ READ16_MEMBER(ibm8514a_device::ibm8514_gpstatus_r) return ret; } -void ibm8514a_device::ibm8514_draw_vector(UINT8 len, UINT8 dir, bool draw) +void ibm8514a_device::ibm8514_draw_vector(uint8_t len, uint8_t dir, bool draw) { - UINT32 offset; + uint32_t offset; int x = 0; while(x <= len) @@ -3636,8 +3636,8 @@ WRITE16_MEMBER(ibm8514a_device::ibm8514_cmd_w) { int x,y; int pattern_x,pattern_y; - UINT32 off,src; - UINT8 readmask; + uint32_t off,src; + uint8_t readmask; ibm8514.current_cmd = data; ibm8514.src_x = 0; @@ -3670,13 +3670,13 @@ WRITE16_MEMBER(ibm8514a_device::ibm8514_cmd_w) else { // Not perfect, but will do for now. - INT16 dx = ibm8514.rect_width; - INT16 dy = ibm8514.line_axial_step >> 1; - INT16 err = ibm8514.line_errorterm; + int16_t dx = ibm8514.rect_width; + int16_t dy = ibm8514.line_axial_step >> 1; + int16_t err = ibm8514.line_errorterm; int sx = (data & 0x0020) ? 1 : -1; int sy = (data & 0x0080) ? 1 : -1; int count = 0; - INT16 temp; + int16_t temp; if(LOG_8514) logerror("8514/A: Command (%04x) - Line (Bresenham) - %i,%i Axial %i, Diagonal %i, Error %i, Major Axis %i, Minor Axis %i\n",ibm8514.current_cmd, ibm8514.curr_x,ibm8514.curr_y,ibm8514.line_axial_step,ibm8514.line_diagonal_step,ibm8514.line_errorterm,ibm8514.rect_width,ibm8514.rect_height); @@ -3988,11 +3988,11 @@ Note: The upper byte must be written for the SSV command to be executed. */ void ibm8514a_device::ibm8514_wait_draw_ssv() { - UINT8 len = ibm8514.wait_vector_len; - UINT8 dir = ibm8514.wait_vector_dir; + uint8_t len = ibm8514.wait_vector_len; + uint8_t dir = ibm8514.wait_vector_dir; bool draw = ibm8514.wait_vector_draw; - UINT8 count = ibm8514.wait_vector_count; - UINT32 offset; + uint8_t count = ibm8514.wait_vector_count; + uint32_t offset; int x; int data_size; @@ -4074,10 +4074,10 @@ void ibm8514a_device::ibm8514_wait_draw_ssv() } } -void ibm8514a_device::ibm8514_draw_ssv(UINT8 data) +void ibm8514a_device::ibm8514_draw_ssv(uint8_t data) { - UINT8 len = data & 0x0f; - UINT8 dir = (data & 0xe0) >> 5; + uint8_t len = data & 0x0f; + uint8_t dir = (data & 0xe0) >> 5; bool draw = (data & 0x10) ? true : false; ibm8514_draw_vector(len,dir,draw); @@ -4118,12 +4118,12 @@ WRITE16_MEMBER(ibm8514a_device::ibm8514_ssv_w) void ibm8514a_device::ibm8514_wait_draw_vector() { - UINT8 len = ibm8514.wait_vector_len; - UINT8 dir = ibm8514.wait_vector_dir; + uint8_t len = ibm8514.wait_vector_len; + uint8_t dir = ibm8514.wait_vector_dir; bool draw = ibm8514.wait_vector_draw; - UINT8 count = ibm8514.wait_vector_count; - UINT32 offset; - UINT8 data_size = 0; + uint8_t count = ibm8514.wait_vector_count; + uint32_t offset; + uint8_t data_size = 0; int x; if(ibm8514.bus_size == 0) // 8-bit @@ -4414,7 +4414,7 @@ bit 0-2 (911-928) READ-REG-SEL. Read Register Select. Selects the register void ibm8514a_device::ibm8514_wait_draw() { int x, data_size = 8; - UINT32 off; + uint32_t off; // the data in the pixel transfer register or written to VRAM masks the rectangle output if(ibm8514.bus_size == 0) // 8-bit @@ -4965,7 +4965,7 @@ WRITE8_MEMBER(gamtor_vga_device::mem_w) READ8_MEMBER(gamtor_vga_device::port_03b0_r) { - UINT8 res; + uint8_t res; switch(offset) { @@ -4989,7 +4989,7 @@ WRITE8_MEMBER(gamtor_vga_device::port_03b0_w) READ8_MEMBER(gamtor_vga_device::port_03c0_r) { - UINT8 res; + uint8_t res; switch(offset) { @@ -5013,7 +5013,7 @@ WRITE8_MEMBER(gamtor_vga_device::port_03c0_w) READ8_MEMBER(gamtor_vga_device::port_03d0_r) { - UINT8 res; + uint8_t res; switch(offset) { @@ -5035,7 +5035,7 @@ WRITE8_MEMBER(gamtor_vga_device::port_03d0_w) } } -UINT16 ati_vga_device::offset() +uint16_t ati_vga_device::offset() { //popmessage("Offset: %04x %s %s %s %s",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",(ati.ext_reg[0x33] & 0x40) ? "PEL" : "---",(ati.ext_reg[0x30] & 0x20) ? "256" : "---"); if(ati.ext_reg[0x30] & 0x20) // likely wrong, gets 640x400/480 SVGA and tweaked 256 colour modes displaying correctly in Fractint. @@ -5049,7 +5049,7 @@ UINT16 ati_vga_device::offset() void ati_vga_device::ati_define_video_mode() { int clock; - UINT8 clock_type; + uint8_t clock_type; int div = ((ati.ext_reg[0x38] & 0xc0) >> 6) + 1; int divisor = 1; @@ -5161,7 +5161,7 @@ WRITE8_MEMBER(ati_vga_device::mem_w) READ8_MEMBER(ati_vga_device::ati_port_ext_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; switch(offset) { diff --git a/src/devices/video/pc_vga.h b/src/devices/video/pc_vga.h index 0e7652ee4ea..bdd2f66532d 100644 --- a/src/devices/video/pc_vga.h +++ b/src/devices/video/pc_vga.h @@ -39,11 +39,11 @@ class vga_device : public device_t public: // construction/destruction - vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - vga_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); + vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + vga_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 zero(); - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual READ8_MEMBER(port_03b0_r); virtual WRITE8_MEMBER(port_03b0_w); @@ -66,24 +66,24 @@ protected: void vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect); void vga_vh_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect); void vga_vh_mono(bitmap_rgb32 &bitmap, const rectangle &cliprect); - virtual UINT8 pc_vga_choosevideomode(); + virtual uint8_t pc_vga_choosevideomode(); void recompute_params_clock(int divisor, int xtal); - UINT8 crtc_reg_read(UINT8 index); + uint8_t crtc_reg_read(uint8_t index); void recompute_params(); - void crtc_reg_write(UINT8 index, UINT8 data); - void seq_reg_write(UINT8 index, UINT8 data); - UINT8 vga_vblank(); + void crtc_reg_write(uint8_t index, uint8_t data); + void seq_reg_write(uint8_t index, uint8_t data); + uint8_t vga_vblank(); READ8_MEMBER(vga_crtc_r); WRITE8_MEMBER(vga_crtc_w); - UINT8 gc_reg_read(UINT8 index); - void attribute_reg_write(UINT8 index, UINT8 data); - void gc_reg_write(UINT8 index,UINT8 data); - virtual UINT16 offset(); - inline UINT8 vga_latch_write(int offs, UINT8 data); - inline UINT8 rotate_right(UINT8 val) { return (val >> vga.gc.rotate_count) | (val << (8 - vga.gc.rotate_count)); } - inline UINT8 vga_logical_op(UINT8 data, UINT8 plane, UINT8 mask) + uint8_t gc_reg_read(uint8_t index); + void attribute_reg_write(uint8_t index, uint8_t data); + void gc_reg_write(uint8_t index,uint8_t data); + virtual uint16_t offset(); + inline uint8_t vga_latch_write(int offs, uint8_t data); + inline uint8_t rotate_right(uint8_t val) { return (val >> vga.gc.rotate_count) | (val << (8 - vga.gc.rotate_count)); } + inline uint8_t vga_logical_op(uint8_t data, uint8_t plane, uint8_t mask) { - UINT8 res = 0; + uint8_t res = 0; switch(vga.gc.logical_op & 3) { @@ -115,117 +115,117 @@ protected: int crtc_regcount; } svga_intf; - std::vector memory; - UINT32 pens[16]; /* the current 16 pens */ + std::vector memory; + uint32_t pens[16]; /* the current 16 pens */ - UINT8 miscellaneous_output; - UINT8 feature_control; + uint8_t miscellaneous_output; + uint8_t feature_control; struct { - UINT8 index; - UINT8 data[0x100]; - UINT8 map_mask; + uint8_t index; + uint8_t data[0x100]; + uint8_t map_mask; struct { - UINT8 A, B; + uint8_t A, B; }char_sel; } sequencer; /* An empty comment at the start of the line indicates that register is currently unused */ struct { - UINT8 index; - UINT8 data[0x100]; - UINT16 horz_total; - UINT16 horz_disp_end; - /**/ UINT8 horz_blank_start; - /**/ UINT8 horz_blank_end; - /**/ UINT8 horz_retrace_start; - /**/ UINT8 horz_retrace_skew; - /**/ UINT8 horz_retrace_end; - /**/ UINT8 disp_enable_skew; - /**/ UINT8 evra; - UINT16 vert_total; - UINT16 vert_disp_end; - /**/ UINT16 vert_retrace_start; - /**/ UINT8 vert_retrace_end; - /**/ UINT16 vert_blank_start; - UINT16 line_compare; - /**/ UINT32 cursor_addr; - /**/ UINT8 byte_panning; - /**/ UINT8 preset_row_scan; - UINT8 scan_doubling; - /**/ UINT8 maximum_scan_line; - /**/ UINT8 cursor_enable; - /**/ UINT8 cursor_scan_start; - /**/ UINT8 cursor_skew; - /**/ UINT8 cursor_scan_end; - UINT32 start_addr; - UINT32 start_addr_latch; - /**/ UINT8 protect_enable; - /**/ UINT8 bandwidth; - /**/ UINT16 offset; - /**/ UINT8 word_mode; - /**/ UINT8 dw; - /**/ UINT8 div4; - /**/ UINT8 underline_loc; - /**/ UINT16 vert_blank_end; - UINT8 sync_en; - /**/ UINT8 aw; - /**/ UINT8 div2; - /**/ UINT8 sldiv; - /**/ UINT8 map14; - /**/ UINT8 map13; - /**/ UINT8 irq_clear; - /**/ UINT8 irq_disable; + uint8_t index; + uint8_t data[0x100]; + uint16_t horz_total; + uint16_t horz_disp_end; + /**/ uint8_t horz_blank_start; + /**/ uint8_t horz_blank_end; + /**/ uint8_t horz_retrace_start; + /**/ uint8_t horz_retrace_skew; + /**/ uint8_t horz_retrace_end; + /**/ uint8_t disp_enable_skew; + /**/ uint8_t evra; + uint16_t vert_total; + uint16_t vert_disp_end; + /**/ uint16_t vert_retrace_start; + /**/ uint8_t vert_retrace_end; + /**/ uint16_t vert_blank_start; + uint16_t line_compare; + /**/ uint32_t cursor_addr; + /**/ uint8_t byte_panning; + /**/ uint8_t preset_row_scan; + uint8_t scan_doubling; + /**/ uint8_t maximum_scan_line; + /**/ uint8_t cursor_enable; + /**/ uint8_t cursor_scan_start; + /**/ uint8_t cursor_skew; + /**/ uint8_t cursor_scan_end; + uint32_t start_addr; + uint32_t start_addr_latch; + /**/ uint8_t protect_enable; + /**/ uint8_t bandwidth; + /**/ uint16_t offset; + /**/ uint8_t word_mode; + /**/ uint8_t dw; + /**/ uint8_t div4; + /**/ uint8_t underline_loc; + /**/ uint16_t vert_blank_end; + uint8_t sync_en; + /**/ uint8_t aw; + /**/ uint8_t div2; + /**/ uint8_t sldiv; + /**/ uint8_t map14; + /**/ uint8_t map13; + /**/ uint8_t irq_clear; + /**/ uint8_t irq_disable; } crtc; struct { - UINT8 index; - UINT8 latch[4]; - UINT8 set_reset; - UINT8 enable_set_reset; - UINT8 color_compare; - UINT8 logical_op; - UINT8 rotate_count; - UINT8 shift256; - UINT8 shift_reg; - UINT8 read_map_sel; - UINT8 read_mode; - UINT8 write_mode; - UINT8 color_dont_care; - UINT8 bit_mask; - UINT8 alpha_dis; - UINT8 memory_map_sel; - UINT8 host_oe; - UINT8 chain_oe; + uint8_t index; + uint8_t latch[4]; + uint8_t set_reset; + uint8_t enable_set_reset; + uint8_t color_compare; + uint8_t logical_op; + uint8_t rotate_count; + uint8_t shift256; + uint8_t shift_reg; + uint8_t read_map_sel; + uint8_t read_mode; + uint8_t write_mode; + uint8_t color_dont_care; + uint8_t bit_mask; + uint8_t alpha_dis; + uint8_t memory_map_sel; + uint8_t host_oe; + uint8_t chain_oe; } gc; struct { - UINT8 index, data[0x15]; int state; - UINT8 prot_bit; - UINT8 pel_shift; - UINT8 pel_shift_latch; + uint8_t index, data[0x15]; int state; + uint8_t prot_bit; + uint8_t pel_shift; + uint8_t pel_shift_latch; } attribute; struct { - UINT8 read_index, write_index, mask; + uint8_t read_index, write_index, mask; int read; int state; - struct { UINT8 red, green, blue; } color[0x100]; + struct { uint8_t red, green, blue; } color[0x100]; int dirty; } dac; struct { - UINT8 visible; + uint8_t visible; } cursor; /* oak vga */ - struct { UINT8 reg; } oak; + struct { uint8_t reg; } oak; } vga; emu_timer *m_vblank_timer; @@ -243,27 +243,27 @@ class svga_device : public vga_device { public: // construction/destruction - svga_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); + svga_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 zero() override; - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; protected: void svga_vh_rgb8(bitmap_rgb32 &bitmap, const rectangle &cliprect); void svga_vh_rgb15(bitmap_rgb32 &bitmap, const rectangle &cliprect); void svga_vh_rgb16(bitmap_rgb32 &bitmap, const rectangle &cliprect); void svga_vh_rgb24(bitmap_rgb32 &bitmap, const rectangle &cliprect); void svga_vh_rgb32(bitmap_rgb32 &bitmap, const rectangle &cliprect); - virtual UINT8 pc_vga_choosevideomode() override; + virtual uint8_t pc_vga_choosevideomode() override; virtual void device_start() override; struct { - UINT8 bank_r,bank_w; - UINT8 rgb8_en; - UINT8 rgb15_en; - UINT8 rgb16_en; - UINT8 rgb24_en; - UINT8 rgb32_en; - UINT8 id; + uint8_t bank_r,bank_w; + uint8_t rgb8_en; + uint8_t rgb15_en; + uint8_t rgb16_en; + uint8_t rgb24_en; + uint8_t rgb32_en; + uint8_t id; }svga; }; @@ -272,8 +272,8 @@ protected: class ibm8514a_device : public device_t { public: - ibm8514a_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); - ibm8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ibm8514a_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); + ibm8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_vga(const char* tag) { m_vga_tag.assign(tag); } void set_vga_owner() { m_vga = dynamic_cast(owner()); } @@ -327,54 +327,54 @@ public: void ibm8514_wait_draw(); struct { - UINT16 htotal; // Horizontal total (9 bits) - UINT16 vtotal; // Vertical total adjust (3 bits), Vertical total base (9 bit) - UINT16 vdisp; - UINT16 vsync; - UINT16 subctrl; - UINT16 substatus; - UINT16 ssv; - UINT16 ec0; - UINT16 ec1; - UINT16 ec2; - UINT16 ec3; + uint16_t htotal; // Horizontal total (9 bits) + uint16_t vtotal; // Vertical total adjust (3 bits), Vertical total base (9 bit) + uint16_t vdisp; + uint16_t vsync; + uint16_t subctrl; + uint16_t substatus; + uint16_t ssv; + uint16_t ec0; + uint16_t ec1; + uint16_t ec2; + uint16_t ec3; bool gpbusy; bool data_avail; - INT16 dest_x; - INT16 dest_y; - INT16 curr_x; - INT16 curr_y; - INT16 prev_x; - INT16 prev_y; - INT16 line_axial_step; - INT16 line_diagonal_step; - INT16 line_errorterm; - UINT16 current_cmd; - UINT16 src_x; - UINT16 src_y; - INT16 scissors_left; - INT16 scissors_right; - INT16 scissors_top; - INT16 scissors_bottom; - UINT16 rect_width; - UINT16 rect_height; - UINT32 fgcolour; - UINT32 bgcolour; - UINT16 fgmix; - UINT16 bgmix; - UINT32 pixel_xfer; - UINT16 pixel_control; - UINT8 bus_size; - UINT8 multifunc_sel; - UINT16 multifunc_misc; - UINT32 read_mask; - UINT32 write_mask; + int16_t dest_x; + int16_t dest_y; + int16_t curr_x; + int16_t curr_y; + int16_t prev_x; + int16_t prev_y; + int16_t line_axial_step; + int16_t line_diagonal_step; + int16_t line_errorterm; + uint16_t current_cmd; + uint16_t src_x; + uint16_t src_y; + int16_t scissors_left; + int16_t scissors_right; + int16_t scissors_top; + int16_t scissors_bottom; + uint16_t rect_width; + uint16_t rect_height; + uint32_t fgcolour; + uint32_t bgcolour; + uint16_t fgmix; + uint16_t bgmix; + uint32_t pixel_xfer; + uint16_t pixel_control; + uint8_t bus_size; + uint8_t multifunc_sel; + uint16_t multifunc_misc; + uint32_t read_mask; + uint32_t write_mask; int state; - UINT8 wait_vector_len; - UINT8 wait_vector_dir; + uint8_t wait_vector_len; + uint8_t wait_vector_dir; bool wait_vector_draw; - UINT8 wait_vector_count; + uint8_t wait_vector_count; } ibm8514; protected: @@ -383,17 +383,17 @@ protected: vga_device* m_vga; // for pass-through std::string m_vga_tag; // pass-through device tag private: - void ibm8514_draw_vector(UINT8 len, UINT8 dir, bool draw); + void ibm8514_draw_vector(uint8_t len, uint8_t dir, bool draw); void ibm8514_wait_draw_ssv(); - void ibm8514_draw_ssv(UINT8 data); + void ibm8514_draw_ssv(uint8_t data); void ibm8514_wait_draw_vector(); - void ibm8514_write_fg(UINT32 offset); - void ibm8514_write_bg(UINT32 offset); - void ibm8514_write(UINT32 offset, UINT32 src); + void ibm8514_write_fg(uint32_t offset); + void ibm8514_write_bg(uint32_t offset); + void ibm8514_write(uint32_t offset, uint32_t src); - //UINT8* m_vram; // the original 8514/A has it's own VRAM, but most VGA+8514 combination cards will have + //uint8_t* m_vram; // the original 8514/A has it's own VRAM, but most VGA+8514 combination cards will have // only one set of VRAM, so this will only be needed in standalone 8514/A cards - //UINT32 m_vramsize; + //uint32_t m_vramsize; }; // device type definition @@ -411,8 +411,8 @@ extern const device_type IBM8514A; class mach8_device : public ibm8514a_device { public: - mach8_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); - mach8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mach8_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); + mach8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); READ16_MEMBER(mach8_ec0_r); WRITE16_MEMBER(mach8_ec0_w); @@ -444,10 +444,10 @@ protected: virtual void device_start() override; struct { - UINT16 scratch0; - UINT16 scratch1; - UINT16 linedraw; - UINT16 clksel; + uint16_t scratch0; + uint16_t scratch1; + uint16_t linedraw; + uint16_t clksel; } mach8; }; @@ -468,7 +468,7 @@ class tseng_vga_device : public svga_device { public: // construction/destruction - tseng_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tseng_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual READ8_MEMBER(port_03b0_r) override; virtual WRITE8_MEMBER(port_03b0_w) override; @@ -484,22 +484,22 @@ protected: private: void tseng_define_video_mode(); - UINT8 tseng_crtc_reg_read(UINT8 index); - void tseng_crtc_reg_write(UINT8 index, UINT8 data); - UINT8 tseng_seq_reg_read(UINT8 index); - void tseng_seq_reg_write(UINT8 index, UINT8 data); - void tseng_attribute_reg_write(UINT8 index, UINT8 data); + uint8_t tseng_crtc_reg_read(uint8_t index); + void tseng_crtc_reg_write(uint8_t index, uint8_t data); + uint8_t tseng_seq_reg_read(uint8_t index); + void tseng_seq_reg_write(uint8_t index, uint8_t data); + void tseng_attribute_reg_write(uint8_t index, uint8_t data); struct { - UINT8 reg_3d8; - UINT8 dac_ctrl; - UINT8 dac_state; - UINT8 horz_overflow; - UINT8 aux_ctrl; + uint8_t reg_3d8; + uint8_t dac_ctrl; + uint8_t dac_state; + uint8_t horz_overflow; + uint8_t aux_ctrl; bool ext_reg_ena; - UINT8 misc1; - UINT8 misc2; + uint8_t misc1; + uint8_t misc2; }et4k; }; @@ -515,8 +515,8 @@ class ati_vga_device : public svga_device { public: // construction/destruction - ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ati_vga_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); + ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ati_vga_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 READ8_MEMBER(mem_r) override; virtual WRITE8_MEMBER(mem_w) override; @@ -527,7 +527,7 @@ public: WRITE8_MEMBER(ati_port_ext_w); virtual machine_config_constructor device_mconfig_additions() const override; - virtual UINT16 offset() override; + virtual uint16_t offset() override; mach8_device* get_8514() { return m_8514; } protected: @@ -536,9 +536,9 @@ private: void ati_define_video_mode(); struct { - UINT8 ext_reg[64]; - UINT8 ext_reg_select; - UINT8 vga_chip_id; + uint8_t ext_reg[64]; + uint8_t ext_reg_select; + uint8_t vga_chip_id; } ati; mach8_device* m_8514; }; @@ -553,8 +553,8 @@ class s3_vga_device : public ati_vga_device { public: // construction/destruction - s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - s3_vga_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); + s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + s3_vga_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 READ8_MEMBER(port_03b0_r) override; virtual WRITE8_MEMBER(port_03b0_w) override; @@ -565,7 +565,7 @@ public: virtual READ8_MEMBER(mem_r) override; virtual WRITE8_MEMBER(mem_w) override; - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; virtual machine_config_constructor device_mconfig_additions() const override; virtual TIMER_CALLBACK_MEMBER(vblank_timer_cb) override; @@ -577,58 +577,58 @@ protected: virtual void device_reset() override; struct { - UINT8 memory_config; - UINT8 ext_misc_ctrl_2; - UINT8 crt_reg_lock; - UINT8 reg_lock1; - UINT8 reg_lock2; - UINT8 enable_8514; - UINT8 enable_s3d; - UINT8 cr3a; - UINT8 cr42; - UINT8 cr43; - UINT8 cr53; - UINT8 id_high; - UINT8 id_low; - UINT8 revision; - UINT8 id_cr30; - UINT32 strapping; // power-on strapping bits - UINT8 sr10; // MCLK PLL - UINT8 sr11; // MCLK PLL - UINT8 sr12; // DCLK PLL - UINT8 sr13; // DCLK PLL - UINT8 sr15; // CLKSYN control 2 - UINT8 sr17; // CLKSYN test - UINT8 clk_pll_r; // individual DCLK PLL values - UINT8 clk_pll_m; - UINT8 clk_pll_n; + uint8_t memory_config; + uint8_t ext_misc_ctrl_2; + uint8_t crt_reg_lock; + uint8_t reg_lock1; + uint8_t reg_lock2; + uint8_t enable_8514; + uint8_t enable_s3d; + uint8_t cr3a; + uint8_t cr42; + uint8_t cr43; + uint8_t cr53; + uint8_t id_high; + uint8_t id_low; + uint8_t revision; + uint8_t id_cr30; + uint32_t strapping; // power-on strapping bits + uint8_t sr10; // MCLK PLL + uint8_t sr11; // MCLK PLL + uint8_t sr12; // DCLK PLL + uint8_t sr13; // DCLK PLL + uint8_t sr15; // CLKSYN control 2 + uint8_t sr17; // CLKSYN test + uint8_t clk_pll_r; // individual DCLK PLL values + uint8_t clk_pll_m; + uint8_t clk_pll_n; // data for memory-mapped I/O - UINT16 mmio_9ae8; - UINT16 mmio_bee8; - UINT16 mmio_96e8; + uint16_t mmio_9ae8; + uint16_t mmio_bee8; + uint16_t mmio_96e8; // hardware graphics cursor - UINT8 cursor_mode; - UINT16 cursor_x; - UINT16 cursor_y; - UINT16 cursor_start_addr; - UINT8 cursor_pattern_x; // cursor pattern origin - UINT8 cursor_pattern_y; - UINT8 cursor_fg[4]; - UINT8 cursor_bg[4]; - UINT8 cursor_fg_ptr; - UINT8 cursor_bg_ptr; - UINT8 extended_dac_ctrl; + uint8_t cursor_mode; + uint16_t cursor_x; + uint16_t cursor_y; + uint16_t cursor_start_addr; + uint8_t cursor_pattern_x; // cursor pattern origin + uint8_t cursor_pattern_y; + uint8_t cursor_fg[4]; + uint8_t cursor_bg[4]; + uint8_t cursor_fg_ptr; + uint8_t cursor_bg_ptr; + uint8_t extended_dac_ctrl; } s3; - virtual UINT16 offset() override; + virtual uint16_t offset() override; private: - UINT8 s3_crtc_reg_read(UINT8 index); + uint8_t s3_crtc_reg_read(uint8_t index); void s3_define_video_mode(void); - void s3_crtc_reg_write(UINT8 index, UINT8 data); - UINT8 s3_seq_reg_read(UINT8 index); - void s3_seq_reg_write(UINT8 index, UINT8 data); + void s3_crtc_reg_write(uint8_t index, uint8_t data); + uint8_t s3_seq_reg_read(uint8_t index); + void s3_seq_reg_write(uint8_t index, uint8_t data); ibm8514a_device* m_8514; }; @@ -641,7 +641,7 @@ class gamtor_vga_device : public svga_device { public: // construction/destruction - gamtor_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gamtor_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual READ8_MEMBER(port_03b0_r) override; diff --git a/src/devices/video/pcd8544.cpp b/src/devices/video/pcd8544.cpp index a0de1762fa9..73430cfbdd5 100644 --- a/src/devices/video/pcd8544.cpp +++ b/src/devices/video/pcd8544.cpp @@ -26,7 +26,7 @@ const device_type PCD8544 = &device_creator; // pcd8544_device - constructor //------------------------------------------------- -pcd8544_device::pcd8544_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +pcd8544_device::pcd8544_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCD8544, "PCD8544", tag, owner, clock, "pcd8544", __FILE__) { } @@ -75,7 +75,7 @@ void pcd8544_device::device_reset() m_dc = 0; } -void pcd8544_device::exec_command(UINT8 cmd) +void pcd8544_device::exec_command(uint8_t cmd) { if (m_mode & 0x01) { @@ -145,7 +145,7 @@ void pcd8544_device::exec_command(UINT8 cmd) } } -void pcd8544_device::write_data(UINT8 data) +void pcd8544_device::write_data(uint8_t data) { m_vram[m_addr_y * 84 + m_addr_x] = data; @@ -201,7 +201,7 @@ WRITE_LINE_MEMBER(pcd8544_device::dc_w) m_dc = state; } -UINT32 pcd8544_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pcd8544_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if ((m_mode & 0x04) == 0) { diff --git a/src/devices/video/pcd8544.h b/src/devices/video/pcd8544.h index bfcd802823b..e8066f6eb65 100644 --- a/src/devices/video/pcd8544.h +++ b/src/devices/video/pcd8544.h @@ -16,8 +16,8 @@ // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate pcd8544_screen_update_delegate; -#define PCD8544_SCREEN_UPDATE(name) void name(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect , UINT8 *vram, int inv) +typedef device_delegate pcd8544_screen_update_delegate; +#define PCD8544_SCREEN_UPDATE(name) void name(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect , uint8_t *vram, int inv) #define MCFG_PCD8544_ADD( _tag ) \ MCFG_DEVICE_ADD( _tag, PCD8544, 0 ) @@ -32,22 +32,22 @@ class pcd8544_device : public device_t { public: // construction/destruction - pcd8544_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pcd8544_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_screen_update_cb(device_t &device, pcd8544_screen_update_delegate _cb) { downcast(device).m_screen_update_cb = _cb; } // device interface DECLARE_WRITE_LINE_MEMBER(sdin_w); DECLARE_WRITE_LINE_MEMBER(sclk_w); DECLARE_WRITE_LINE_MEMBER(dc_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 virtual void device_start() override; virtual void device_reset() override; - void exec_command(UINT8 cmd); - void write_data(UINT8 data); + void exec_command(uint8_t cmd); + void write_data(uint8_t data); private: pcd8544_screen_update_delegate m_screen_update_cb; // screen update callback @@ -55,15 +55,15 @@ private: int m_sclk; int m_dc; int m_bits; - UINT8 m_mode; - UINT8 m_control; - UINT8 m_op_vol; - UINT8 m_bias; - UINT8 m_temp_coef; - UINT8 m_indata; - UINT8 m_addr_y; - UINT8 m_addr_x; - UINT8 m_vram[6*84]; // 4032 bit video ram + uint8_t m_mode; + uint8_t m_control; + uint8_t m_op_vol; + uint8_t m_bias; + uint8_t m_temp_coef; + uint8_t m_indata; + uint8_t m_addr_y; + uint8_t m_addr_x; + uint8_t m_vram[6*84]; // 4032 bit video ram }; // device type definition diff --git a/src/devices/video/poly.h b/src/devices/video/poly.h index 11e078b8186..d67e570826f 100644 --- a/src/devices/video/poly.h +++ b/src/devices/video/poly.h @@ -110,7 +110,7 @@ public: // a single extent describes a span and a list of parameter extents struct extent_t { - INT16 startx, stopx; // starting (inclusive)/ending (exclusive) endpoints + int16_t startx, stopx; // starting (inclusive)/ending (exclusive) endpoints struct { _BaseType start; // parameter value at start @@ -120,11 +120,11 @@ public: }; // delegate type for scanline callbacks - typedef delegate render_delegate; + typedef delegate render_delegate; // construction/destruction - poly_manager(running_machine &machine, UINT8 flags = 0); - poly_manager(screen_device &screen, UINT8 flags = 0); + poly_manager(running_machine &machine, uint8_t flags = 0); + poly_manager(screen_device &screen, uint8_t flags = 0); virtual ~poly_manager(); // getters @@ -139,17 +139,17 @@ public: _ObjectData &object_data_last() const { return m_object.last(); } // tiles - UINT32 render_tile(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &v1, const vertex_t &v2); + uint32_t render_tile(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &v1, const vertex_t &v2); // triangles - UINT32 render_triangle(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &v1, const vertex_t &v2, const vertex_t &v3); - UINT32 render_triangle_fan(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v); - UINT32 render_triangle_strip(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v); - UINT32 render_triangle_custom(const rectangle &cliprect, render_delegate callback, int startscanline, int numscanlines, const extent_t *extents); + uint32_t render_triangle(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &v1, const vertex_t &v2, const vertex_t &v3); + uint32_t render_triangle_fan(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v); + uint32_t render_triangle_strip(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v); + uint32_t render_triangle_custom(const rectangle &cliprect, render_delegate callback, int startscanline, int numscanlines, const extent_t *extents); // polygons template - UINT32 render_polygon(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t *v); + uint32_t render_polygon(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t *v); // public helpers int zclip_if_less(int numverts, const vertex_t *v, vertex_t *outv, int paramcount, _BaseType clipval); @@ -166,12 +166,12 @@ private: // internal unit of work struct work_unit { - std::atomic count_next; // number of scanlines and index of next item to process + std::atomic count_next; // number of scanlines and index of next item to process polygon_info * polygon; // pointer to polygon - INT16 scanline; // starting scanline - UINT16 previtem; // index of previous item in the same bucket + int16_t scanline; // starting scanline + uint16_t previtem; // index of previous item in the same bucket #ifndef PTR64 - UINT32 dummy; // pad to 16 bytes + uint32_t dummy; // pad to 16 bytes #endif extent_t extent[SCANLINES_PER_BUCKET]; // array of scanline extents }; @@ -187,7 +187,7 @@ private: // construction poly_array(running_machine &machine, poly_manager &manager) : m_manager(manager), - m_base(make_unique_clear(k_itemsize * _Count)), + m_base(make_unique_clear(k_itemsize * _Count)), m_next(0), m_max(0), m_waits(0) { } @@ -204,7 +204,7 @@ private: int waits() const { return m_waits; } int itemsize() const { return k_itemsize; } int allocated() const { return _Count; } - int indexof(_Type &item) const { int result = (reinterpret_cast(&item) - m_base.get()) / k_itemsize; assert(result >= 0 && result < _Count); return result; } + int indexof(_Type &item) const { int result = (reinterpret_cast(&item) - m_base.get()) / k_itemsize; assert(result >= 0 && result < _Count); return result; } // operations void reset() { m_next = 0; } @@ -215,7 +215,7 @@ private: private: // internal state poly_manager & m_manager; - std::unique_ptr m_base; + std::unique_ptr m_base; int m_next; int m_max; int m_waits; @@ -227,9 +227,9 @@ private: typedef poly_array unit_array; // round in a cross-platform consistent manner - inline INT32 round_coordinate(_BaseType value) + inline int32_t round_coordinate(_BaseType value) { - INT32 result = poly_floor(value); + int32_t result = poly_floor(value); if ((value > 0) && (result < 0)) return INT_MAX-1; @@ -265,19 +265,19 @@ private: unit_array m_unit; // array of work units // misc data - UINT8 m_flags; // flags + uint8_t m_flags; // flags // buckets - UINT16 m_unit_bucket[TOTAL_BUCKETS]; // buckets for tracking unit usage + uint16_t m_unit_bucket[TOTAL_BUCKETS]; // buckets for tracking unit usage // statistics - UINT32 m_tiles; // number of tiles queued - UINT32 m_triangles; // number of triangles queued - UINT32 m_quads; // number of quads queued - UINT64 m_pixels; // number of pixels rendered + uint32_t m_tiles; // number of tiles queued + uint32_t m_triangles; // number of triangles queued + uint32_t m_quads; // number of quads queued + uint64_t m_pixels; // number of pixels rendered #if KEEP_POLY_STATISTICS - UINT32 m_conflicts[WORK_MAX_THREADS]; // number of conflicts found, per thread - UINT32 m_resolved[WORK_MAX_THREADS]; // number of conflicts resolved, per thread + uint32_t m_conflicts[WORK_MAX_THREADS]; // number of conflicts found, per thread + uint32_t m_resolved[WORK_MAX_THREADS]; // number of conflicts resolved, per thread #endif }; @@ -287,7 +287,7 @@ private: //------------------------------------------------- template -poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::poly_manager(running_machine &machine, UINT8 flags) +poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::poly_manager(running_machine &machine, uint8_t flags) : m_machine(machine), m_screen(nullptr), m_queue(nullptr), @@ -314,7 +314,7 @@ poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::poly_manager(runnin template -poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::poly_manager(screen_device &screen, UINT8 flags) +poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::poly_manager(screen_device &screen, uint8_t flags) : m_machine(screen.machine()), m_screen(&screen), m_queue(nullptr), @@ -361,9 +361,9 @@ poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::~poly_manager() printf("Total triangles = %d\n", m_triangles); printf("Total quads = %d\n", m_quads); if (m_pixels > 1000000000) - printf("Total pixels = %d%09d\n", (UINT32)(m_pixels / 1000000000), (UINT32)(m_pixels % 1000000000)); + printf("Total pixels = %d%09d\n", (uint32_t)(m_pixels / 1000000000), (uint32_t)(m_pixels % 1000000000)); else - printf("Total pixels = %d\n", (UINT32)m_pixels); + printf("Total pixels = %d\n", (uint32_t)m_pixels); printf("Conflicts: %d resolved, %d total\n", resolved, conflicts); printf("Units: %5d used, %5d allocated, %5d waits, %4d bytes each, %7d total\n", m_unit.max(), m_unit.allocated(), m_unit.waits(), m_unit.itemsize(), m_unit.allocated() * m_unit.itemsize()); @@ -390,7 +390,7 @@ void *poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::work_item_cal work_unit &unit = *(work_unit *)param; polygon_info &polygon = *unit.polygon; int count = unit.count_next & 0xffff; - UINT32 orig_count_next; + uint32_t orig_count_next; // if our previous item isn't done yet, enqueue this item to the end and proceed if (unit.previtem != 0xffff) @@ -398,8 +398,8 @@ void *poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::work_item_cal work_unit &prevunit = polygon.m_owner->m_unit[unit.previtem]; if (prevunit.count_next != 0) { - UINT32 unitnum = polygon.m_owner->m_unit.indexof(unit); - UINT32 new_count_next; + uint32_t unitnum = polygon.m_owner->m_unit.indexof(unit); + uint32_t new_count_next; // attempt to atomically swap in this new value do @@ -505,7 +505,7 @@ _ObjectData &poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::object //------------------------------------------------- template -UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tile(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &_v1, const vertex_t &_v2) +uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tile(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &_v1, const vertex_t &_v2) { const vertex_t *v1 = &_v1; const vertex_t *v2 = &_v2; @@ -519,12 +519,12 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tile( } // compute some integral X/Y vertex values - INT32 v1y = round_coordinate(v1->y); - INT32 v2y = round_coordinate(v2->y); + int32_t v1y = round_coordinate(v1->y); + int32_t v2y = round_coordinate(v2->y); // clip coordinates - INT32 v1yclip = v1y; - INT32 v2yclip = v2y + ((m_flags & POLYFLAG_INCLUDE_BOTTOM_EDGE) ? 1 : 0); + int32_t v1yclip = v1y; + int32_t v2yclip = v2y + ((m_flags & POLYFLAG_INCLUDE_BOTTOM_EDGE) ? 1 : 0); v1yclip = std::max(v1yclip, cliprect.min_y); v2yclip = std::min(v2yclip, cliprect.max_y + 1); if (v2yclip - v1yclip <= 0) @@ -554,13 +554,13 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tile( } // clamp to full pixels - INT32 istartx = round_coordinate(v1->x); - INT32 istopx = round_coordinate(v2->x); + int32_t istartx = round_coordinate(v1->x); + int32_t istopx = round_coordinate(v2->x); // force start < stop if (istartx > istopx) { - INT32 temp = istartx; + int32_t temp = istartx; istartx = istopx; istopx = temp; } @@ -578,17 +578,17 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tile( return 0; // compute the X extents for each scanline - INT32 pixels = 0; - UINT32 startunit = m_unit.count(); - INT32 scaninc = 1; - for (INT32 curscan = v1yclip; curscan < v2yclip; curscan += scaninc) + int32_t pixels = 0; + uint32_t startunit = m_unit.count(); + int32_t scaninc = 1; + for (int32_t curscan = v1yclip; curscan < v2yclip; curscan += scaninc) { - UINT32 bucketnum = ((UINT32)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; - UINT32 unit_index = m_unit.count(); + uint32_t bucketnum = ((uint32_t)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; + uint32_t unit_index = m_unit.count(); work_unit &unit = m_unit.next(); // determine how much to advance to hit the next bucket - scaninc = SCANLINES_PER_BUCKET - (UINT32)curscan % SCANLINES_PER_BUCKET; + scaninc = SCANLINES_PER_BUCKET - (uint32_t)curscan % SCANLINES_PER_BUCKET; // fill in the work unit basics unit.polygon = &polygon; @@ -637,7 +637,7 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_tile( //------------------------------------------------- template -UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &_v1, const vertex_t &_v2, const vertex_t &_v3) +uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t &_v1, const vertex_t &_v2, const vertex_t &_v3) { const vertex_t *v1 = &_v1; const vertex_t *v2 = &_v2; @@ -664,12 +664,12 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_trian } // compute some integral X/Y vertex values - INT32 v1y = round_coordinate(v1->y); - INT32 v3y = round_coordinate(v3->y); + int32_t v1y = round_coordinate(v1->y); + int32_t v3y = round_coordinate(v3->y); // clip coordinates - INT32 v1yclip = v1y; - INT32 v3yclip = v3y + ((m_flags & POLYFLAG_INCLUDE_BOTTOM_EDGE) ? 1 : 0); + int32_t v1yclip = v1y; + int32_t v3yclip = v3y + ((m_flags & POLYFLAG_INCLUDE_BOTTOM_EDGE) ? 1 : 0); v1yclip = std::max(v1yclip, cliprect.min_y); v3yclip = std::min(v3yclip, cliprect.max_y + 1); if (v3yclip - v1yclip <= 0) @@ -736,17 +736,17 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_trian } // compute the X extents for each scanline - INT32 pixels = 0; - UINT32 startunit = m_unit.count(); - INT32 scaninc = 1; - for (INT32 curscan = v1yclip; curscan < v3yclip; curscan += scaninc) + int32_t pixels = 0; + uint32_t startunit = m_unit.count(); + int32_t scaninc = 1; + for (int32_t curscan = v1yclip; curscan < v3yclip; curscan += scaninc) { - UINT32 bucketnum = ((UINT32)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; - UINT32 unit_index = m_unit.count(); + uint32_t bucketnum = ((uint32_t)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; + uint32_t unit_index = m_unit.count(); work_unit &unit = m_unit.next(); // determine how much to advance to hit the next bucket - scaninc = SCANLINES_PER_BUCKET - (UINT32)curscan % SCANLINES_PER_BUCKET; + scaninc = SCANLINES_PER_BUCKET - (uint32_t)curscan % SCANLINES_PER_BUCKET; // fill in the work unit basics unit.polygon = &polygon; @@ -768,13 +768,13 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_trian stopx = v2->x + (fully - v2->y) * dxdy_v2v3; // clamp to full pixels - INT32 istartx = round_coordinate(startx); - INT32 istopx = round_coordinate(stopx); + int32_t istartx = round_coordinate(startx); + int32_t istopx = round_coordinate(stopx); // force start < stop if (istartx > istopx) { - INT32 temp = istartx; + int32_t temp = istartx; istartx = istopx; istopx = temp; } @@ -825,10 +825,10 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_trian //------------------------------------------------- template -UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle_fan(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v) +uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle_fan(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v) { // iterate over vertices - UINT32 pixels = 0; + uint32_t pixels = 0; for (int vertnum = 2; vertnum < numverts; vertnum++) pixels += render_triangle(cliprect, callback, paramcount, v[0], v[vertnum - 1], v[vertnum]); return pixels; @@ -841,10 +841,10 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_trian //------------------------------------------------- template -UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle_strip(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v) +uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle_strip(const rectangle &cliprect, render_delegate callback, int paramcount, int numverts, const vertex_t *v) { // iterate over vertices - UINT32 pixels = 0; + uint32_t pixels = 0; for (int vertnum = 2; vertnum < numverts; vertnum++) pixels += render_triangle(cliprect, callback, paramcount, v[vertnum - 2], v[vertnum - 1], v[vertnum]); return pixels; @@ -857,11 +857,11 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_trian //------------------------------------------------- template -UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle_custom(const rectangle &cliprect, render_delegate callback, int startscanline, int numscanlines, const extent_t *extents) +uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_triangle_custom(const rectangle &cliprect, render_delegate callback, int startscanline, int numscanlines, const extent_t *extents) { // clip coordinates - INT32 v1yclip = std::max(startscanline, cliprect.min_y); - INT32 v3yclip = std::min(startscanline + numscanlines, cliprect.max_y + 1); + int32_t v1yclip = std::max(startscanline, cliprect.min_y); + int32_t v3yclip = std::min(startscanline + numscanlines, cliprect.max_y + 1); if (v3yclip - v1yclip <= 0) return 0; @@ -869,17 +869,17 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_trian polygon_info &polygon = polygon_alloc(0, 0, v1yclip, v3yclip, callback); // compute the X extents for each scanline - INT32 pixels = 0; - UINT32 startunit = m_unit.count(); - INT32 scaninc = 1; - for (INT32 curscan = v1yclip; curscan < v3yclip; curscan += scaninc) + int32_t pixels = 0; + uint32_t startunit = m_unit.count(); + int32_t scaninc = 1; + for (int32_t curscan = v1yclip; curscan < v3yclip; curscan += scaninc) { - UINT32 bucketnum = ((UINT32)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; - UINT32 unit_index = m_unit.count(); + uint32_t bucketnum = ((uint32_t)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; + uint32_t unit_index = m_unit.count(); work_unit &unit = m_unit.next(); // determine how much to advance to hit the next bucket - scaninc = SCANLINES_PER_BUCKET - (UINT32)curscan % SCANLINES_PER_BUCKET; + scaninc = SCANLINES_PER_BUCKET - (uint32_t)curscan % SCANLINES_PER_BUCKET; // fill in the work unit basics unit.polygon = &polygon; @@ -892,7 +892,7 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_trian for (int extnum = 0; extnum < unit.count_next; extnum++) { const extent_t &srcextent = extents[(curscan + extnum) - startscanline]; - INT32 istartx = srcextent.startx, istopx = srcextent.stopx; + int32_t istartx = srcextent.startx, istopx = srcextent.stopx; // apply left/right clipping if (istartx < cliprect.min_x) @@ -942,7 +942,7 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_trian template template -UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_polygon(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t *v) +uint32_t poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_polygon(const rectangle &cliprect, render_delegate callback, int paramcount, const vertex_t *v) { // determine min/max Y vertices _BaseType minx = v[0].x; @@ -962,12 +962,12 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_polyg } // determine start/end scanlines - INT32 miny = round_coordinate(v[minv].y); - INT32 maxy = round_coordinate(v[maxv].y); + int32_t miny = round_coordinate(v[minv].y); + int32_t maxy = round_coordinate(v[maxv].y); // clip coordinates - INT32 minyclip = miny; - INT32 maxyclip = maxy + ((m_flags & POLYFLAG_INCLUDE_BOTTOM_EDGE) ? 1 : 0); + int32_t minyclip = miny; + int32_t maxyclip = maxy + ((m_flags & POLYFLAG_INCLUDE_BOTTOM_EDGE) ? 1 : 0); minyclip = std::max(minyclip, cliprect.min_y); maxyclip = std::min(maxyclip, cliprect.max_y + 1); if (maxyclip - minyclip <= 0) @@ -1044,17 +1044,17 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_polyg } // compute the X extents for each scanline - INT32 pixels = 0; - UINT32 startunit = m_unit.count(); - INT32 scaninc = 1; - for (INT32 curscan = minyclip; curscan < maxyclip; curscan += scaninc) + int32_t pixels = 0; + uint32_t startunit = m_unit.count(); + int32_t scaninc = 1; + for (int32_t curscan = minyclip; curscan < maxyclip; curscan += scaninc) { - UINT32 bucketnum = ((UINT32)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; - UINT32 unit_index = m_unit.count(); + uint32_t bucketnum = ((uint32_t)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; + uint32_t unit_index = m_unit.count(); work_unit &unit = m_unit.next(); // determine how much to advance to hit the next bucket - scaninc = SCANLINES_PER_BUCKET - (UINT32)curscan % SCANLINES_PER_BUCKET; + scaninc = SCANLINES_PER_BUCKET - (uint32_t)curscan % SCANLINES_PER_BUCKET; // fill in the work unit basics unit.polygon = &polygon; @@ -1076,8 +1076,8 @@ UINT32 poly_manager<_BaseType, _ObjectData, _MaxParams, _MaxPolys>::render_polyg _BaseType stopx = redge->v1->x + (fully - redge->v1->y) * redge->dxdy; // clamp to full pixels - INT32 istartx = round_coordinate(startx); - INT32 istopx = round_coordinate(stopx); + int32_t istartx = round_coordinate(startx); + int32_t istopx = round_coordinate(stopx); // compute parameter starting points and deltas extent_t &extent = unit.extent[extnum]; diff --git a/src/devices/video/polylgcy.cpp b/src/devices/video/polylgcy.cpp index 0d6a872ed6d..5e8383062ca 100644 --- a/src/devices/video/polylgcy.cpp +++ b/src/devices/video/polylgcy.cpp @@ -49,8 +49,8 @@ struct polygon_info; /* tri_extent describes start/end points for a scanline */ struct tri_extent { - INT16 startx; /* starting X coordinate (inclusive) */ - INT16 stopx; /* ending X coordinate (exclusive) */ + int16_t startx; /* starting X coordinate (inclusive) */ + int16_t stopx; /* ending X coordinate (exclusive) */ }; @@ -88,11 +88,11 @@ struct poly_section struct work_unit_shared { polygon_info * polygon; /* pointer to polygon */ - std::atomic count_next; /* number of scanlines and index of next item to process */ - INT16 scanline; /* starting scanline and count */ - UINT16 previtem; /* index of previous item in the same bucket */ + std::atomic count_next; /* number of scanlines and index of next item to process */ + int16_t scanline; /* starting scanline and count */ + uint16_t previtem; /* index of previous item in the same bucket */ #ifndef PTR64 - UINT32 dummy; /* pad to 16 bytes */ + uint32_t dummy; /* pad to 16 bytes */ #endif }; @@ -128,11 +128,11 @@ struct polygon_info legacy_poly_manager * poly; /* pointer back to the poly manager */ void * dest; /* pointer to the destination we are rendering to */ void * extra; /* extra data pointer */ - UINT8 numparams; /* number of parameters for this polygon */ - UINT8 numverts; /* number of vertices in this polygon */ + uint8_t numparams; /* number of parameters for this polygon */ + uint8_t numverts; /* number of vertices in this polygon */ poly_draw_scanline_func callback; /* callback to handle a scanline's worth of work */ - INT32 xorigin; /* X origin for all parameters */ - INT32 yorigin; /* Y origin for all parameters */ + int32_t xorigin; /* X origin for all parameters */ + int32_t yorigin; /* Y origin for all parameters */ poly_param param[MAX_VERTEX_PARAMS];/* array of parameter data */ }; @@ -145,46 +145,46 @@ struct legacy_poly_manager /* triangle work units */ work_unit ** unit; /* array of work unit pointers */ - UINT32 unit_next; /* index of next unit to allocate */ - UINT32 unit_count; /* number of work units available */ + uint32_t unit_next; /* index of next unit to allocate */ + uint32_t unit_count; /* number of work units available */ size_t unit_size; /* size of each work unit, in bytes */ /* quad work units */ - UINT32 quadunit_next; /* index of next unit to allocate */ - UINT32 quadunit_count; /* number of work units available */ + uint32_t quadunit_next; /* index of next unit to allocate */ + uint32_t quadunit_count; /* number of work units available */ size_t quadunit_size; /* size of each work unit, in bytes */ /* poly data */ polygon_info ** polygon; /* array of polygon pointers */ - UINT32 polygon_next; /* index of next polygon to allocate */ - UINT32 polygon_count; /* number of polygon items available */ + uint32_t polygon_next; /* index of next polygon to allocate */ + uint32_t polygon_count; /* number of polygon items available */ size_t polygon_size; /* size of each polygon, in bytes */ /* extra data */ void ** extra; /* array of extra data pointers */ - UINT32 extra_next; /* index of next extra data to allocate */ - UINT32 extra_count; /* number of extra data items available */ + uint32_t extra_next; /* index of next extra data to allocate */ + uint32_t extra_count; /* number of extra data items available */ size_t extra_size; /* size of each extra data, in bytes */ /* misc data */ - UINT8 flags; /* flags */ + uint8_t flags; /* flags */ /* buckets */ - UINT16 unit_bucket[TOTAL_BUCKETS]; /* buckets for tracking unit usage */ + uint16_t unit_bucket[TOTAL_BUCKETS]; /* buckets for tracking unit usage */ /* statistics */ - UINT32 triangles; /* number of triangles queued */ - UINT32 quads; /* number of quads queued */ - UINT64 pixels; /* number of pixels rendered */ + uint32_t triangles; /* number of triangles queued */ + uint32_t quads; /* number of quads queued */ + uint64_t pixels; /* number of pixels rendered */ #if KEEP_STATISTICS - UINT32 unit_waits; /* number of times we waited for a unit */ - UINT32 unit_max; /* maximum units used */ - UINT32 polygon_waits; /* number of times we waited for a polygon */ - UINT32 polygon_max; /* maximum polygons used */ - UINT32 extra_waits; /* number of times we waited for an extra data */ - UINT32 extra_max; /* maximum extra data used */ - UINT32 conflicts[WORK_MAX_THREADS]; /* number of conflicts found, per thread */ - UINT32 resolved[WORK_MAX_THREADS]; /* number of conflicts resolved, per thread */ + uint32_t unit_waits; /* number of times we waited for a unit */ + uint32_t unit_max; /* maximum units used */ + uint32_t polygon_waits; /* number of times we waited for a polygon */ + uint32_t polygon_max; /* maximum polygons used */ + uint32_t extra_waits; /* number of times we waited for an extra data */ + uint32_t extra_max; /* maximum extra data used */ + uint32_t conflicts[WORK_MAX_THREADS]; /* number of conflicts found, per thread */ + uint32_t resolved[WORK_MAX_THREADS]; /* number of conflicts resolved, per thread */ #endif }; @@ -194,7 +194,7 @@ struct legacy_poly_manager FUNCTION PROTOTYPES ***************************************************************************/ -static void **allocate_array(running_machine &machine, size_t *itemsize, UINT32 itemcount); +static void **allocate_array(running_machine &machine, size_t *itemsize, uint32_t itemcount); static void *poly_item_callback(void *param, int threadid); static void poly_state_presave(legacy_poly_manager *poly); @@ -210,9 +210,9 @@ static void poly_state_presave(legacy_poly_manager *poly); down -------------------------------------------------*/ -static inline INT32 round_coordinate(float value) +static inline int32_t round_coordinate(float value) { - INT32 result = floor(value); + int32_t result = floor(value); return result + (value - (float)result > 0.5f); } @@ -222,7 +222,7 @@ static inline INT32 round_coordinate(float value) a simple tri_extent to a full poly_extent -------------------------------------------------*/ -static inline void convert_tri_extent_to_poly_extent(poly_extent *dstextent, const tri_extent *srcextent, const polygon_info *polygon, INT32 y) +static inline void convert_tri_extent_to_poly_extent(poly_extent *dstextent, const tri_extent *srcextent, const polygon_info *polygon, int32_t y) { /* copy start/stop always */ dstextent->startx = srcextent->startx; @@ -310,7 +310,7 @@ static inline polygon_info *allocate_polygon(legacy_poly_manager *poly, int miny manager -------------------------------------------------*/ -legacy_poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, UINT8 flags) +legacy_poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, uint8_t flags) { legacy_poly_manager *poly; @@ -363,9 +363,9 @@ void poly_free(legacy_poly_manager *poly) printf("Total triangles = %d\n", poly->triangles); printf("Total quads = %d\n", poly->quads); if (poly->pixels > 1000000000) - printf("Total pixels = %d%09d\n", (UINT32)(poly->pixels / 1000000000), (UINT32)(poly->pixels % 1000000000)); + printf("Total pixels = %d%09d\n", (uint32_t)(poly->pixels / 1000000000), (uint32_t)(poly->pixels % 1000000000)); else - printf("Total pixels = %d\n", (UINT32)poly->pixels); + printf("Total pixels = %d\n", (uint32_t)poly->pixels); printf("Conflicts: %d resolved, %d total\n", resolved, conflicts); printf("Units: %5d used, %5d allocated, %5d waits, %4d bytes each, %7d total\n", poly->unit_max, poly->unit_count, poly->unit_waits, poly->unit_size, poly->unit_count * poly->unit_size); printf("Polygons: %5d used, %5d allocated, %5d waits, %4d bytes each, %7d total\n", poly->polygon_max, poly->polygon_count, poly->polygon_waits, poly->polygon_size, poly->polygon_count * poly->polygon_size); @@ -462,16 +462,16 @@ void *poly_get_extra_data(legacy_poly_manager *poly) triangle given 3 vertexes -------------------------------------------------*/ -UINT32 poly_render_triangle(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3) +uint32_t poly_render_triangle(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3) { float dxdy_v1v2, dxdy_v1v3, dxdy_v2v3; const poly_vertex *tv; - INT32 curscan, scaninc; + int32_t curscan, scaninc; polygon_info *polygon; - INT32 v1yclip, v3yclip; - INT32 v1y, v3y, v1x; - INT32 pixels = 0; - UINT32 startunit; + int32_t v1yclip, v3yclip; + int32_t v1y, v3y, v1x; + int32_t pixels = 0; + uint32_t startunit; /* first sort by Y */ if (v2->y < v1->y) @@ -530,13 +530,13 @@ UINT32 poly_render_triangle(legacy_poly_manager *poly, void *dest, const rectang startunit = poly->unit_next; for (curscan = v1yclip; curscan < v3yclip; curscan += scaninc) { - UINT32 bucketnum = ((UINT32)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; - UINT32 unit_index = poly->unit_next++; + uint32_t bucketnum = ((uint32_t)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; + uint32_t unit_index = poly->unit_next++; tri_work_unit *unit = &poly->unit[unit_index]->tri; int extnum; /* determine how much to advance to hit the next bucket */ - scaninc = SCANLINES_PER_BUCKET - (UINT32)curscan % SCANLINES_PER_BUCKET; + scaninc = SCANLINES_PER_BUCKET - (uint32_t)curscan % SCANLINES_PER_BUCKET; /* fill in the work unit basics */ unit->shared.polygon = polygon; @@ -551,7 +551,7 @@ UINT32 poly_render_triangle(legacy_poly_manager *poly, void *dest, const rectang float fully = (float)(curscan + extnum) + 0.5f; float startx = v1->x + (fully - v1->y) * dxdy_v1v3; float stopx; - INT32 istartx, istopx; + int32_t istartx, istopx; /* compute the ending X based on which part of the triangle we're in */ if (fully < v2->y) @@ -566,7 +566,7 @@ UINT32 poly_render_triangle(legacy_poly_manager *poly, void *dest, const rectang /* force start < stop */ if (istartx > istopx) { - INT32 temp = istartx; + int32_t temp = istartx; istartx = istopx; istopx = temp; } @@ -645,9 +645,9 @@ UINT32 poly_render_triangle(legacy_poly_manager *poly, void *dest, const rectang triangles in a fan -------------------------------------------------*/ -UINT32 poly_render_triangle_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) +uint32_t poly_render_triangle_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) { - UINT32 pixels = 0; + uint32_t pixels = 0; int vertnum; /* iterate over vertices */ @@ -662,13 +662,13 @@ UINT32 poly_render_triangle_fan(legacy_poly_manager *poly, void *dest, const rec render of an object, given specific extents -------------------------------------------------*/ -UINT32 poly_render_triangle_custom(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents) +uint32_t poly_render_triangle_custom(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents) { - INT32 curscan, scaninc; + int32_t curscan, scaninc; polygon_info *polygon; - INT32 v1yclip, v3yclip; - INT32 pixels = 0; - UINT32 startunit; + int32_t v1yclip, v3yclip; + int32_t pixels = 0; + uint32_t startunit; /* clip coordinates */ v1yclip = std::max(startscanline, cliprect.min_y); @@ -691,13 +691,13 @@ UINT32 poly_render_triangle_custom(legacy_poly_manager *poly, void *dest, const startunit = poly->unit_next; for (curscan = v1yclip; curscan < v3yclip; curscan += scaninc) { - UINT32 bucketnum = ((UINT32)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; - UINT32 unit_index = poly->unit_next++; + uint32_t bucketnum = ((uint32_t)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; + uint32_t unit_index = poly->unit_next++; tri_work_unit *unit = &poly->unit[unit_index]->tri; int extnum; /* determine how much to advance to hit the next bucket */ - scaninc = SCANLINES_PER_BUCKET - (UINT32)curscan % SCANLINES_PER_BUCKET; + scaninc = SCANLINES_PER_BUCKET - (uint32_t)curscan % SCANLINES_PER_BUCKET; /* fill in the work unit basics */ unit->shared.polygon = polygon; @@ -710,12 +710,12 @@ UINT32 poly_render_triangle_custom(legacy_poly_manager *poly, void *dest, const for (extnum = 0; extnum < unit->shared.count_next; extnum++) { const poly_extent *extent = &extents[(curscan + extnum) - startscanline]; - INT32 istartx = extent->startx, istopx = extent->stopx; + int32_t istartx = extent->startx, istopx = extent->stopx; /* force start < stop */ if (istartx > istopx) { - INT32 temp = istartx; + int32_t temp = istartx; istartx = istopx; istopx = temp; } @@ -758,19 +758,19 @@ UINT32 poly_render_triangle_custom(legacy_poly_manager *poly, void *dest, const given 4 vertexes -------------------------------------------------*/ -UINT32 poly_render_quad(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4) +uint32_t poly_render_quad(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4) { poly_edge fedgelist[3], bedgelist[3]; const poly_edge *ledge, *redge; const poly_vertex *v[4]; poly_edge *edgeptr; int minv, maxv, curv; - INT32 minyclip, maxyclip; - INT32 miny, maxy; - INT32 curscan, scaninc; + int32_t minyclip, maxyclip; + int32_t miny, maxy; + int32_t curscan, scaninc; polygon_info *polygon; - INT32 pixels = 0; - UINT32 startunit; + int32_t pixels = 0; + uint32_t startunit; assert(poly->flags & POLYFLAG_ALLOW_QUADS); @@ -882,13 +882,13 @@ UINT32 poly_render_quad(legacy_poly_manager *poly, void *dest, const rectangle & startunit = poly->unit_next; for (curscan = minyclip; curscan < maxyclip; curscan += scaninc) { - UINT32 bucketnum = ((UINT32)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; - UINT32 unit_index = poly->unit_next++; + uint32_t bucketnum = ((uint32_t)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; + uint32_t unit_index = poly->unit_next++; quad_work_unit *unit = &poly->unit[unit_index]->quad; int extnum; /* determine how much to advance to hit the next bucket */ - scaninc = SCANLINES_PER_BUCKET - (UINT32)curscan % SCANLINES_PER_BUCKET; + scaninc = SCANLINES_PER_BUCKET - (uint32_t)curscan % SCANLINES_PER_BUCKET; /* fill in the work unit basics */ unit->shared.polygon = polygon; @@ -902,7 +902,7 @@ UINT32 poly_render_quad(legacy_poly_manager *poly, void *dest, const rectangle & { float fully = (float)(curscan + extnum) + 0.5f; float startx, stopx; - INT32 istartx, istopx; + int32_t istartx, istopx; int paramnum; /* compute the ending X based on which part of the triangle we're in */ @@ -978,9 +978,9 @@ UINT32 poly_render_quad(legacy_poly_manager *poly, void *dest, const rectangle & quads in a fan -------------------------------------------------*/ -UINT32 poly_render_quad_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) +uint32_t poly_render_quad_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) { - UINT32 pixels = 0; + uint32_t pixels = 0; int vertnum; /* iterate over vertices */ @@ -1000,18 +1000,18 @@ UINT32 poly_render_quad_fan(legacy_poly_manager *poly, void *dest, const rectang to 32 vertices -------------------------------------------------*/ -UINT32 poly_render_polygon(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) +uint32_t poly_render_polygon(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) { poly_edge fedgelist[MAX_POLYGON_VERTS - 1], bedgelist[MAX_POLYGON_VERTS - 1]; const poly_edge *ledge, *redge; poly_edge *edgeptr; int minv, maxv, curv; - INT32 minyclip, maxyclip; - INT32 miny, maxy; - INT32 curscan, scaninc; + int32_t minyclip, maxyclip; + int32_t miny, maxy; + int32_t curscan, scaninc; polygon_info *polygon; - INT32 pixels = 0; - UINT32 startunit; + int32_t pixels = 0; + uint32_t startunit; int vertnum; assert(poly->flags & POLYFLAG_ALLOW_QUADS); @@ -1114,13 +1114,13 @@ UINT32 poly_render_polygon(legacy_poly_manager *poly, void *dest, const rectangl startunit = poly->unit_next; for (curscan = minyclip; curscan < maxyclip; curscan += scaninc) { - UINT32 bucketnum = ((UINT32)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; - UINT32 unit_index = poly->unit_next++; + uint32_t bucketnum = ((uint32_t)curscan / SCANLINES_PER_BUCKET) % TOTAL_BUCKETS; + uint32_t unit_index = poly->unit_next++; quad_work_unit *unit = &poly->unit[unit_index]->quad; int extnum; /* determine how much to advance to hit the next bucket */ - scaninc = SCANLINES_PER_BUCKET - (UINT32)curscan % SCANLINES_PER_BUCKET; + scaninc = SCANLINES_PER_BUCKET - (uint32_t)curscan % SCANLINES_PER_BUCKET; /* fill in the work unit basics */ unit->shared.polygon = polygon; @@ -1134,7 +1134,7 @@ UINT32 poly_render_polygon(legacy_poly_manager *poly, void *dest, const rectangl { float fully = (float)(curscan + extnum) + 0.5f; float startx, stopx; - INT32 istartx, istopx; + int32_t istartx, istopx; int paramnum; /* compute the ending X based on which part of the triangle we're in */ @@ -1251,7 +1251,7 @@ int poly_zclip_if_less(int numverts, const poly_vertex *v, poly_vertex *outv, in allocate_array - allocate an array of pointers -------------------------------------------------*/ -static void **allocate_array(running_machine &machine, size_t *itemsize, UINT32 itemcount) +static void **allocate_array(running_machine &machine, size_t *itemsize, uint32_t itemcount) { void **ptrarray; int itemnum; @@ -1267,11 +1267,11 @@ static void **allocate_array(running_machine &machine, size_t *itemsize, UINT32 ptrarray = auto_alloc_array_clear(machine, void *, itemcount); /* allocate the actual items */ - ptrarray[0] = auto_alloc_array_clear(machine, UINT8, *itemsize * itemcount); + ptrarray[0] = auto_alloc_array_clear(machine, uint8_t, *itemsize * itemcount); /* initialize the pointer array */ for (itemnum = 1; itemnum < itemcount; itemnum++) - ptrarray[itemnum] = (UINT8 *)ptrarray[0] + *itemsize * itemnum; + ptrarray[itemnum] = (uint8_t *)ptrarray[0] + *itemsize * itemnum; return ptrarray; } @@ -1288,7 +1288,7 @@ static void *poly_item_callback(void *param, int threadid) work_unit *unit = (work_unit *)param; polygon_info *polygon = unit->shared.polygon; int count = unit->shared.count_next & 0xffff; - UINT32 orig_count_next; + uint32_t orig_count_next; int curscan; /* if our previous item isn't done yet, enqueue this item to the end and proceed */ @@ -1297,8 +1297,8 @@ static void *poly_item_callback(void *param, int threadid) work_unit *prevunit = polygon->poly->unit[unit->shared.previtem]; if (prevunit->shared.count_next != 0) { - UINT32 unitnum = ((UINT8 *)unit - (UINT8 *)polygon->poly->unit[0]) / polygon->poly->unit_size; - UINT32 new_count_next; + uint32_t unitnum = ((uint8_t *)unit - (uint8_t *)polygon->poly->unit[0]) / polygon->poly->unit_size; + uint32_t new_count_next; /* attempt to atomically swap in this new value */ do diff --git a/src/devices/video/polylgcy.h b/src/devices/video/polylgcy.h index bc409d77db5..fe7f13205f4 100644 --- a/src/devices/video/polylgcy.h +++ b/src/devices/video/polylgcy.h @@ -80,14 +80,14 @@ struct poly_param_extent /* poly_extent describes start/end points for a scanline, along with per-scanline parameters */ struct poly_extent { - INT16 startx; /* starting X coordinate (inclusive) */ - INT16 stopx; /* ending X coordinate (exclusive) */ + int16_t startx; /* starting X coordinate (inclusive) */ + int16_t stopx; /* ending X coordinate (exclusive) */ poly_param_extent param[MAX_VERTEX_PARAMS]; /* starting and dx values for each parameter */ }; /* callback routine to process a batch of scanlines in a triangle */ -typedef void (*poly_draw_scanline_func)(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); +typedef void (*poly_draw_scanline_func)(void *dest, int32_t scanline, const poly_extent *extent, const void *extradata, int threadid); @@ -99,7 +99,7 @@ typedef void (*poly_draw_scanline_func)(void *dest, INT32 scanline, const poly_e /* ----- initialization/teardown ----- */ /* allocate a new poly manager that can render triangles */ -legacy_poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, UINT8 flags); +legacy_poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, uint8_t flags); /* free a poly manager */ void poly_free(legacy_poly_manager *poly); @@ -119,30 +119,30 @@ void *poly_get_extra_data(legacy_poly_manager *poly); /* ----- core triangle rendering ----- */ /* render a single triangle given 3 vertexes */ -UINT32 poly_render_triangle(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3); +uint32_t poly_render_triangle(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3); /* render a set of triangles in a fan */ -UINT32 poly_render_triangle_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); +uint32_t poly_render_triangle_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); /* perform a custom render of an object, given specific extents */ -UINT32 poly_render_triangle_custom(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents); +uint32_t poly_render_triangle_custom(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents); /* ----- core quad rendering ----- */ /* render a single quad given 4 vertexes */ -UINT32 poly_render_quad(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4); +uint32_t poly_render_quad(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4); /* render a set of quads in a fan */ -UINT32 poly_render_quad_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); +uint32_t poly_render_quad_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); /* ----- core polygon rendering ----- */ /* render a single polygon up to 32 vertices */ -UINT32 poly_render_polygon(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); +uint32_t poly_render_polygon(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); diff --git a/src/devices/video/psx.cpp b/src/devices/video/psx.cpp index 1caf2a92284..d621949b819 100644 --- a/src/devices/video/psx.cpp +++ b/src/devices/video/psx.cpp @@ -22,7 +22,7 @@ const device_type CXD8561BQ = &device_creator; const device_type CXD8561CQ = &device_creator; const device_type CXD8654Q = &device_creator; -psxgpu_device::psxgpu_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) : +psxgpu_device::psxgpu_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_vblank_handler(*this) #if DEBUG_VIEWER @@ -51,44 +51,44 @@ void psxgpu_device::device_reset( void ) gpu_reset(); } -cxd8514q_device::cxd8514q_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cxd8514q_device::cxd8514q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psxgpu_device(mconfig, CXD8514Q, "CXD8514Q GPU", tag, owner, clock, "cxd8514q", __FILE__) { } -cxd8538q_device::cxd8538q_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cxd8538q_device::cxd8538q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psxgpu_device(mconfig, CXD8538Q, "CXD8538Q GPU", tag, owner, clock, "cxd8538q", __FILE__) { } -cxd8561q_device::cxd8561q_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cxd8561q_device::cxd8561q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psxgpu_device(mconfig, CXD8561Q, "CXD8561Q GPU", tag, owner, clock, "cxd8561q", __FILE__) { } -cxd8561bq_device::cxd8561bq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cxd8561bq_device::cxd8561bq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psxgpu_device(mconfig, CXD8561BQ, "CXD8561BQ", tag, owner, clock, "cxd8561bq", __FILE__) { } -cxd8561cq_device::cxd8561cq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cxd8561cq_device::cxd8561cq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psxgpu_device(mconfig, CXD8561CQ, "CXD8561CQ GPU", tag, owner, clock, "cxd8561cq", __FILE__) { } -cxd8654q_device::cxd8654q_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cxd8654q_device::cxd8654q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : psxgpu_device(mconfig, CXD8654Q, "CXD8654Q GPU", tag, owner, clock, "cxd8654q", __FILE__) { } -static const UINT16 m_p_n_nextpointlist4[] = { 1, 3, 0, 2 }; -static const UINT16 m_p_n_prevpointlist4[] = { 2, 0, 3, 1 }; -static const UINT16 m_p_n_nextpointlist4b[] = { 0, 3, 1, 2 }; -static const UINT16 m_p_n_prevpointlist4b[] = { 0, 2, 3, 1 }; -static const UINT16 m_p_n_nextpointlist3[] = { 1, 2, 0 }; -static const UINT16 m_p_n_prevpointlist3[] = { 2, 0, 1 }; +static const uint16_t m_p_n_nextpointlist4[] = { 1, 3, 0, 2 }; +static const uint16_t m_p_n_prevpointlist4[] = { 2, 0, 3, 1 }; +static const uint16_t m_p_n_nextpointlist4b[] = { 0, 3, 1, 2 }; +static const uint16_t m_p_n_prevpointlist4b[] = { 0, 2, 3, 1 }; +static const uint16_t m_p_n_nextpointlist3[] = { 1, 2, 0 }; +static const uint16_t m_p_n_prevpointlist3[] = { 2, 0, 1 }; -#define SINT11( x ) ( ( (INT32)( x ) << 21 ) >> 21 ) +#define SINT11( x ) ( ( (int32_t)( x ) << 21 ) >> 21 ) #define COORD_X( a ) ( a.sw.l ) #define COORD_Y( a ) ( a.sw.h ) @@ -163,15 +163,15 @@ void psxgpu_device::DebugMesh( int n_coordx, int n_coordy ) { PAIR n_x; PAIR n_y; - INT32 n_xstart; - INT32 n_ystart; - INT32 n_xend; - INT32 n_yend; - INT32 n_xlen; - INT32 n_ylen; - INT32 n_len; - INT32 n_dx; - INT32 n_dy; + int32_t n_xstart; + int32_t n_ystart; + int32_t n_xend; + int32_t n_yend; + int32_t n_xlen; + int32_t n_ylen; + int32_t n_len; + int32_t n_dx; + int32_t n_dy; n_xstart = m_debug.n_coordx[ n_coord ]; n_xend = n_coordx; @@ -212,14 +212,14 @@ void psxgpu_device::DebugMesh( int n_coordx, int n_coordy ) n_len = 1; } - n_dx = (INT32)( ( n_xend << 16 ) - n_x.d ) / n_len; - n_dy = (INT32)( ( n_yend << 16 ) - n_y.d ) / n_len; + n_dx = (int32_t)( ( n_xend << 16 ) - n_x.d ) / n_len; + n_dy = (int32_t)( ( n_yend << 16 ) - n_y.d ) / n_len; while( n_len > 0 ) { - if( (INT16)n_x.w.h >= 0 && - (INT16)n_y.w.h >= 0 && - (INT16)n_x.w.h <= width - 1 && - (INT16)n_y.w.h <= height - 1 ) + if( (int16_t)n_x.w.h >= 0 && + (int16_t)n_y.w.h >= 0 && + (int16_t)n_x.w.h <= width - 1 && + (int16_t)n_y.w.h <= height - 1 ) { if( m_debug.mesh->pix16(n_y.w.h, n_x.w.h) != 0xffff ) m_debug.mesh->pix16(n_y.w.h, n_x.w.h) = n_colour; @@ -328,7 +328,7 @@ int psxgpu_device::DebugMeshDisplay( bitmap_ind16 &bitmap, const rectangle &clip int psxgpu_device::DebugTextureDisplay( bitmap_ind16 &bitmap ) { - UINT32 n_y; + uint32_t n_y; if( m_debug.b_texture ) { @@ -340,7 +340,7 @@ int psxgpu_device::DebugTextureDisplay( bitmap_ind16 &bitmap ) int n_x; int n_xi; int n_yi; - UINT16 p_n_interleave[ 1024 ]; + uint16_t p_n_interleave[ 1024 ]; for( n_x = 0; n_x < width; n_x++ ) { @@ -454,7 +454,7 @@ void psxgpu_device::psx_gpu_init( int n_gputype ) int n_shade; int n_shaded; int width = 1024; - int height = ( vramSize / width ) / sizeof( UINT16 ); + int height = ( vramSize / width ) / sizeof( uint16_t ); m_n_gputype = n_gputype; @@ -469,7 +469,7 @@ void psxgpu_device::psx_gpu_init( int n_gputype ) n_lightgun_y = 0; b_reverseflag = 0; - p_vram = make_unique_clear(width * height ); + p_vram = make_unique_clear(width * height ); for( n_line = 0; n_line < 1024; n_line++ ) { @@ -568,7 +568,7 @@ void psxgpu_device::psx_gpu_init( int n_gputype ) } // icky!!! - machine().save().save_memory( this, "globals", nullptr, 0, "m_packet", (UINT8 *)&m_packet, 1, sizeof( m_packet ) ); + machine().save().save_memory( this, "globals", nullptr, 0, "m_packet", (uint8_t *)&m_packet, 1, sizeof( m_packet ) ); save_pointer(NAME(p_vram.get()), width * height ); save_item(NAME(n_gpu_buffer_offset)); @@ -605,10 +605,10 @@ void psxgpu_device::psx_gpu_init( int n_gputype ) machine().save().register_postload( save_prepost_delegate( FUNC( psxgpu_device::updatevisiblearea ), this ) ); } -UINT32 psxgpu_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t psxgpu_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT32 n_x; - UINT32 n_y; + uint32_t n_x; + uint32_t n_y; int n_top; int n_line; int n_lines; @@ -661,8 +661,8 @@ UINT32 psxgpu_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, n_overscanleft = 0x260; } - n_top = (INT32)n_vert_disstart - n_overscantop; - n_lines = (INT32)n_vert_disend - (INT32)n_vert_disstart; + n_top = (int32_t)n_vert_disstart - n_overscantop; + n_lines = (int32_t)n_vert_disend - (int32_t)n_vert_disstart; if( n_top < 0 ) { n_y = -n_top; @@ -692,8 +692,8 @@ UINT32 psxgpu_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, bitmap.fill(0, clip); } - n_left = ( ( (INT32)n_horiz_disstart - n_overscanleft ) * (INT32)n_screenwidth ) / 2560; - n_columns = ( ( ( (INT32)n_horiz_disend - n_horiz_disstart ) * (INT32)n_screenwidth ) / 2560 ); + n_left = ( ( (int32_t)n_horiz_disstart - n_overscanleft ) * (int32_t)n_screenwidth ) / 2560; + n_columns = ( ( ( (int32_t)n_horiz_disend - n_horiz_disstart ) * (int32_t)n_screenwidth ) / 2560 ); if( n_left < 0 ) { n_x = -n_left; @@ -724,15 +724,15 @@ UINT32 psxgpu_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, n_line = n_lines; while( n_line > 0 ) { - UINT16 *p_n_src = p_p_vram[ n_y + n_displaystarty ] + 3 * n_x + n_displaystartx; - UINT16 *p_n_dest = &bitmap.pix16(n_y + n_top, n_x + n_left); + uint16_t *p_n_src = p_p_vram[ n_y + n_displaystarty ] + 3 * n_x + n_displaystartx; + uint16_t *p_n_dest = &bitmap.pix16(n_y + n_top, n_x + n_left); n_column = n_columns; while( n_column > 0 ) { - UINT32 n_g0r0 = *( p_n_src++ ); - UINT32 n_r1b0 = *( p_n_src++ ); - UINT32 n_b1g1 = *( p_n_src++ ); + uint32_t n_g0r0 = *( p_n_src++ ); + uint32_t n_r1b0 = *( p_n_src++ ); + uint32_t n_b1g1 = *( p_n_src++ ); *( p_n_dest++ ) = p_n_g0r0[ n_g0r0 ] | p_n_b0[ n_r1b0 ]; n_column--; @@ -775,7 +775,7 @@ f e| d c| b| a 9| 8 7| 6 5| 4| 3 2 1 0 |iy|ix|ty| | tp| abr|ty| tx */ -void psxgpu_device::decode_tpage( UINT32 tpage ) +void psxgpu_device::decode_tpage( uint32_t tpage ) { if( m_n_gputype == 2 ) { @@ -931,7 +931,7 @@ void psxgpu_device::decode_tpage( UINT32 tpage ) n_b.d += n_db; #define SOLIDFILL( PIXELUPDATE ) \ - if( n_distance > ( (INT32)n_drawarea_x2 - drawx ) + 1 ) \ + if( n_distance > ( (int32_t)n_drawarea_x2 - drawx ) + 1 ) \ { \ n_distance = ( n_drawarea_x2 - drawx ) + 1; \ } \ @@ -1062,7 +1062,7 @@ void psxgpu_device::decode_tpage( UINT32 tpage ) TEXTURE_ENDLOOP #define TEXTUREFILL( PIXELUPDATE, TXU, TXV ) \ - if( n_distance > ( (INT32)n_drawarea_x2 - drawx ) + 1 ) \ + if( n_distance > ( (int32_t)n_drawarea_x2 - drawx ) + 1 ) \ { \ n_distance = ( n_drawarea_x2 - drawx ) + 1; \ } \ @@ -1359,36 +1359,36 @@ static inline int CullVertex( int a, int b ) void psxgpu_device::FlatPolygon( int n_points ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; PAIR n_r; PAIR n_g; PAIR n_b; PAIR n_cx1; PAIR n_cx2; - INT32 n_dx1; - INT32 n_dx2; + int32_t n_dx1; + int32_t n_dx2; - UINT8 n_cmd; + uint8_t n_cmd; - INT32 n_distance; + int32_t n_distance; - UINT16 n_point; - UINT16 n_rightpoint; - UINT16 n_leftpoint; - const UINT16 *p_n_rightpointlist; - const UINT16 *p_n_leftpointlist; + uint16_t n_point; + uint16_t n_rightpoint; + uint16_t n_leftpoint; + const uint16_t *p_n_rightpointlist; + const uint16_t *p_n_leftpointlist; - UINT16 *p_vram; + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 1 ) @@ -1439,7 +1439,7 @@ void psxgpu_device::FlatPolygon( int n_points ) { break; } - n_dx1 = (INT32)( ( COORD_X( m_packet.FlatPolygon.vertex[ n_leftpoint ].n_coord ) << 16 ) - n_cx1.d ) / n_distance; + n_dx1 = (int32_t)( ( COORD_X( m_packet.FlatPolygon.vertex[ n_leftpoint ].n_coord ) << 16 ) - n_cx1.d ) / n_distance; } if( n_y == COORD_Y( m_packet.FlatPolygon.vertex[ n_rightpoint ].n_coord ) ) { @@ -1458,27 +1458,27 @@ void psxgpu_device::FlatPolygon( int n_points ) { break; } - n_dx2 = (INT32)( ( COORD_X( m_packet.FlatPolygon.vertex[ n_rightpoint ].n_coord ) << 16 ) - n_cx2.d ) / n_distance; + n_dx2 = (int32_t)( ( COORD_X( m_packet.FlatPolygon.vertex[ n_rightpoint ].n_coord ) << 16 ) - n_cx2.d ) / n_distance; } int drawy = n_y + n_drawoffset_y; - if( (INT16)n_cx1.sw.h != (INT16)n_cx2.sw.h && drawy >= (INT32)n_drawarea_y1 && drawy <= (INT32)n_drawarea_y2 ) + if( (int16_t)n_cx1.sw.h != (int16_t)n_cx2.sw.h && drawy >= (int32_t)n_drawarea_y1 && drawy <= (int32_t)n_drawarea_y2 ) { - if( (INT16)n_cx1.sw.h < (INT16)n_cx2.sw.h ) + if( (int16_t)n_cx1.sw.h < (int16_t)n_cx2.sw.h ) { n_x = n_cx1.sw.h; - n_distance = (INT16)n_cx2.sw.h - n_x; + n_distance = (int16_t)n_cx2.sw.h - n_x; } else { n_x = n_cx2.sw.h; - n_distance = (INT16)n_cx1.sw.h - n_x; + n_distance = (int16_t)n_cx1.sw.h - n_x; } int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_distance -= ( n_drawarea_x1 - drawx ); drawx = n_drawarea_x1; @@ -1494,23 +1494,23 @@ void psxgpu_device::FlatPolygon( int n_points ) void psxgpu_device::FlatTexturedPolygon( int n_points ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; int n_tx; int n_ty; - UINT8 n_cmd; + uint8_t n_cmd; - UINT32 n_clutx; - UINT32 n_cluty; + uint32_t n_clutx; + uint32_t n_cluty; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; PAIR n_r; PAIR n_g; @@ -1524,24 +1524,24 @@ void psxgpu_device::FlatTexturedPolygon( int n_points ) PAIR n_cv1; PAIR n_cu2; PAIR n_cv2; - INT32 n_du; - INT32 n_dv; - INT32 n_dx1; - INT32 n_dx2; - INT32 n_du1; - INT32 n_dv1; - INT32 n_du2; - INT32 n_dv2; - - INT32 n_distance; - UINT16 n_point; - UINT16 n_rightpoint; - UINT16 n_leftpoint; - const UINT16 *p_n_rightpointlist; - const UINT16 *p_n_leftpointlist; - UINT16 *p_clut; - UINT16 *p_vram; - UINT32 n_bgr; + int32_t n_du; + int32_t n_dv; + int32_t n_dx1; + int32_t n_dx2; + int32_t n_du1; + int32_t n_dv1; + int32_t n_du2; + int32_t n_dv2; + + int32_t n_distance; + uint16_t n_point; + uint16_t n_rightpoint; + uint16_t n_leftpoint; + const uint16_t *p_n_rightpointlist; + const uint16_t *p_n_leftpointlist; + uint16_t *p_clut; + uint16_t *p_vram; + uint32_t n_bgr; #if DEBUG_VIEWER if( m_debug.n_skip == 2 ) @@ -1619,9 +1619,9 @@ void psxgpu_device::FlatTexturedPolygon( int n_points ) { break; } - n_dx1 = (INT32)( ( COORD_X( m_packet.FlatTexturedPolygon.vertex[ n_leftpoint ].n_coord ) << 16 ) - n_cx1.d ) / n_distance; - n_du1 = (INT32)( ( TEXTURE_U( m_packet.FlatTexturedPolygon.vertex[ n_leftpoint ].n_texture ) << 16 ) - n_cu1.d ) / n_distance; - n_dv1 = (INT32)( ( TEXTURE_V( m_packet.FlatTexturedPolygon.vertex[ n_leftpoint ].n_texture ) << 16 ) - n_cv1.d ) / n_distance; + n_dx1 = (int32_t)( ( COORD_X( m_packet.FlatTexturedPolygon.vertex[ n_leftpoint ].n_coord ) << 16 ) - n_cx1.d ) / n_distance; + n_du1 = (int32_t)( ( TEXTURE_U( m_packet.FlatTexturedPolygon.vertex[ n_leftpoint ].n_texture ) << 16 ) - n_cu1.d ) / n_distance; + n_dv1 = (int32_t)( ( TEXTURE_V( m_packet.FlatTexturedPolygon.vertex[ n_leftpoint ].n_texture ) << 16 ) - n_cv1.d ) / n_distance; } if( n_y == COORD_Y( m_packet.FlatTexturedPolygon.vertex[ n_rightpoint ].n_coord ) ) { @@ -1642,39 +1642,39 @@ void psxgpu_device::FlatTexturedPolygon( int n_points ) { break; } - n_dx2 = (INT32)( ( COORD_X( m_packet.FlatTexturedPolygon.vertex[ n_rightpoint ].n_coord ) << 16 ) - n_cx2.d ) / n_distance; - n_du2 = (INT32)( ( TEXTURE_U( m_packet.FlatTexturedPolygon.vertex[ n_rightpoint ].n_texture ) << 16 ) - n_cu2.d ) / n_distance; - n_dv2 = (INT32)( ( TEXTURE_V( m_packet.FlatTexturedPolygon.vertex[ n_rightpoint ].n_texture ) << 16 ) - n_cv2.d ) / n_distance; + n_dx2 = (int32_t)( ( COORD_X( m_packet.FlatTexturedPolygon.vertex[ n_rightpoint ].n_coord ) << 16 ) - n_cx2.d ) / n_distance; + n_du2 = (int32_t)( ( TEXTURE_U( m_packet.FlatTexturedPolygon.vertex[ n_rightpoint ].n_texture ) << 16 ) - n_cu2.d ) / n_distance; + n_dv2 = (int32_t)( ( TEXTURE_V( m_packet.FlatTexturedPolygon.vertex[ n_rightpoint ].n_texture ) << 16 ) - n_cv2.d ) / n_distance; } int drawy = n_y + n_drawoffset_y; - if( (INT16)n_cx1.sw.h != (INT16)n_cx2.sw.h && drawy >= (INT32)n_drawarea_y1 && drawy <= (INT32)n_drawarea_y2 ) + if( (int16_t)n_cx1.sw.h != (int16_t)n_cx2.sw.h && drawy >= (int32_t)n_drawarea_y1 && drawy <= (int32_t)n_drawarea_y2 ) { - if( (INT16)n_cx1.sw.h < (INT16)n_cx2.sw.h ) + if( (int16_t)n_cx1.sw.h < (int16_t)n_cx2.sw.h ) { n_x = n_cx1.sw.h; - n_distance = (INT16)n_cx2.sw.h - n_x; + n_distance = (int16_t)n_cx2.sw.h - n_x; n_u.d = n_cu1.d; n_v.d = n_cv1.d; - n_du = (INT32)( n_cu2.d - n_cu1.d ) / n_distance; - n_dv = (INT32)( n_cv2.d - n_cv1.d ) / n_distance; + n_du = (int32_t)( n_cu2.d - n_cu1.d ) / n_distance; + n_dv = (int32_t)( n_cv2.d - n_cv1.d ) / n_distance; } else { n_x = n_cx2.sw.h; - n_distance = (INT16)n_cx1.sw.h - n_x; + n_distance = (int16_t)n_cx1.sw.h - n_x; n_u.d = n_cu2.d; n_v.d = n_cv2.d; - n_du = (INT32)( n_cu1.d - n_cu2.d ) / n_distance; - n_dv = (INT32)( n_cv1.d - n_cv2.d ) / n_distance; + n_du = (int32_t)( n_cu1.d - n_cu2.d ) / n_distance; + n_dv = (int32_t)( n_cv1.d - n_cv2.d ) / n_distance; } int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_u.d += n_du * ( n_drawarea_x1 - drawx ); n_v.d += n_dv * ( n_drawarea_x1 - drawx ); @@ -1696,18 +1696,18 @@ void psxgpu_device::FlatTexturedPolygon( int n_points ) void psxgpu_device::GouraudPolygon( int n_points ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; - UINT8 n_cmd; + uint8_t n_cmd; PAIR n_r; PAIR n_g; @@ -1720,27 +1720,27 @@ void psxgpu_device::GouraudPolygon( int n_points ) PAIR n_cr2; PAIR n_cg2; PAIR n_cb2; - INT32 n_dr; - INT32 n_dg; - INT32 n_db; - INT32 n_dx1; - INT32 n_dx2; - INT32 n_dr1; - INT32 n_dg1; - INT32 n_db1; - INT32 n_dr2; - INT32 n_dg2; - INT32 n_db2; - - INT32 n_distance; - - UINT16 n_point; - UINT16 n_rightpoint; - UINT16 n_leftpoint; - const UINT16 *p_n_rightpointlist; - const UINT16 *p_n_leftpointlist; - - UINT16 *p_vram; + int32_t n_dr; + int32_t n_dg; + int32_t n_db; + int32_t n_dx1; + int32_t n_dx2; + int32_t n_dr1; + int32_t n_dg1; + int32_t n_db1; + int32_t n_dr2; + int32_t n_dg2; + int32_t n_db2; + + int32_t n_distance; + + uint16_t n_point; + uint16_t n_rightpoint; + uint16_t n_leftpoint; + const uint16_t *p_n_rightpointlist; + const uint16_t *p_n_leftpointlist; + + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 3 ) @@ -1802,10 +1802,10 @@ void psxgpu_device::GouraudPolygon( int n_points ) { break; } - n_dx1 = (INT32)( ( COORD_X( m_packet.GouraudPolygon.vertex[ n_leftpoint ].n_coord ) << 16 ) - n_cx1.d ) / n_distance; - n_dr1 = (INT32)( ( BGR_R( m_packet.GouraudPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cr1.d ) / n_distance; - n_dg1 = (INT32)( ( BGR_G( m_packet.GouraudPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cg1.d ) / n_distance; - n_db1 = (INT32)( ( BGR_B( m_packet.GouraudPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cb1.d ) / n_distance; + n_dx1 = (int32_t)( ( COORD_X( m_packet.GouraudPolygon.vertex[ n_leftpoint ].n_coord ) << 16 ) - n_cx1.d ) / n_distance; + n_dr1 = (int32_t)( ( BGR_R( m_packet.GouraudPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cr1.d ) / n_distance; + n_dg1 = (int32_t)( ( BGR_G( m_packet.GouraudPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cg1.d ) / n_distance; + n_db1 = (int32_t)( ( BGR_B( m_packet.GouraudPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cb1.d ) / n_distance; } if( n_y == COORD_Y( m_packet.GouraudPolygon.vertex[ n_rightpoint ].n_coord ) ) { @@ -1827,44 +1827,44 @@ void psxgpu_device::GouraudPolygon( int n_points ) { break; } - n_dx2 = (INT32)( ( COORD_X( m_packet.GouraudPolygon.vertex[ n_rightpoint ].n_coord ) << 16 ) - n_cx2.d ) / n_distance; - n_dr2 = (INT32)( ( BGR_R( m_packet.GouraudPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cr2.d ) / n_distance; - n_dg2 = (INT32)( ( BGR_G( m_packet.GouraudPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cg2.d ) / n_distance; - n_db2 = (INT32)( ( BGR_B( m_packet.GouraudPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cb2.d ) / n_distance; + n_dx2 = (int32_t)( ( COORD_X( m_packet.GouraudPolygon.vertex[ n_rightpoint ].n_coord ) << 16 ) - n_cx2.d ) / n_distance; + n_dr2 = (int32_t)( ( BGR_R( m_packet.GouraudPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cr2.d ) / n_distance; + n_dg2 = (int32_t)( ( BGR_G( m_packet.GouraudPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cg2.d ) / n_distance; + n_db2 = (int32_t)( ( BGR_B( m_packet.GouraudPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cb2.d ) / n_distance; } int drawy = n_y + n_drawoffset_y; - if( (INT16)n_cx1.sw.h != (INT16)n_cx2.sw.h && drawy >= (INT32)n_drawarea_y1 && drawy <= (INT32)n_drawarea_y2 ) + if( (int16_t)n_cx1.sw.h != (int16_t)n_cx2.sw.h && drawy >= (int32_t)n_drawarea_y1 && drawy <= (int32_t)n_drawarea_y2 ) { - if( (INT16)n_cx1.sw.h < (INT16)n_cx2.sw.h ) + if( (int16_t)n_cx1.sw.h < (int16_t)n_cx2.sw.h ) { n_x = n_cx1.sw.h; - n_distance = (INT16)n_cx2.sw.h - n_x; + n_distance = (int16_t)n_cx2.sw.h - n_x; n_r.d = n_cr1.d; n_g.d = n_cg1.d; n_b.d = n_cb1.d; - n_dr = (INT32)( n_cr2.d - n_cr1.d ) / n_distance; - n_dg = (INT32)( n_cg2.d - n_cg1.d ) / n_distance; - n_db = (INT32)( n_cb2.d - n_cb1.d ) / n_distance; + n_dr = (int32_t)( n_cr2.d - n_cr1.d ) / n_distance; + n_dg = (int32_t)( n_cg2.d - n_cg1.d ) / n_distance; + n_db = (int32_t)( n_cb2.d - n_cb1.d ) / n_distance; } else { n_x = n_cx2.sw.h; - n_distance = (INT16)n_cx1.sw.h - n_x; + n_distance = (int16_t)n_cx1.sw.h - n_x; n_r.d = n_cr2.d; n_g.d = n_cg2.d; n_b.d = n_cb2.d; - n_dr = (INT32)( n_cr1.d - n_cr2.d ) / n_distance; - n_dg = (INT32)( n_cg1.d - n_cg2.d ) / n_distance; - n_db = (INT32)( n_cb1.d - n_cb2.d ) / n_distance; + n_dr = (int32_t)( n_cr1.d - n_cr2.d ) / n_distance; + n_dg = (int32_t)( n_cg1.d - n_cg2.d ) / n_distance; + n_db = (int32_t)( n_cb1.d - n_cb2.d ) / n_distance; } int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_r.d += n_dr * ( n_drawarea_x1 - drawx ); n_g.d += n_dg * ( n_drawarea_x1 - drawx ); @@ -1889,23 +1889,23 @@ void psxgpu_device::GouraudPolygon( int n_points ) void psxgpu_device::GouraudTexturedPolygon( int n_points ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; int n_tx; int n_ty; - UINT8 n_cmd; + uint8_t n_cmd; - UINT32 n_clutx; - UINT32 n_cluty; + uint32_t n_clutx; + uint32_t n_cluty; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; PAIR n_r; PAIR n_g; @@ -1925,33 +1925,33 @@ void psxgpu_device::GouraudTexturedPolygon( int n_points ) PAIR n_cr2; PAIR n_cg2; PAIR n_cb2; - INT32 n_dr; - INT32 n_dg; - INT32 n_db; - INT32 n_du; - INT32 n_dv; - INT32 n_dx1; - INT32 n_dx2; - INT32 n_dr1; - INT32 n_dg1; - INT32 n_db1; - INT32 n_dr2; - INT32 n_dg2; - INT32 n_db2; - INT32 n_du1; - INT32 n_dv1; - INT32 n_du2; - INT32 n_dv2; - - INT32 n_distance; - UINT16 n_point; - UINT16 n_rightpoint; - UINT16 n_leftpoint; - const UINT16 *p_n_rightpointlist; - const UINT16 *p_n_leftpointlist; - UINT16 *p_clut; - UINT16 *p_vram; - UINT32 n_bgr; + int32_t n_dr; + int32_t n_dg; + int32_t n_db; + int32_t n_du; + int32_t n_dv; + int32_t n_dx1; + int32_t n_dx2; + int32_t n_dr1; + int32_t n_dg1; + int32_t n_db1; + int32_t n_dr2; + int32_t n_dg2; + int32_t n_db2; + int32_t n_du1; + int32_t n_dv1; + int32_t n_du2; + int32_t n_dv2; + + int32_t n_distance; + uint16_t n_point; + uint16_t n_rightpoint; + uint16_t n_leftpoint; + const uint16_t *p_n_rightpointlist; + const uint16_t *p_n_leftpointlist; + uint16_t *p_clut; + uint16_t *p_vram; + uint32_t n_bgr; #if DEBUG_VIEWER if( m_debug.n_skip == 4 ) @@ -2037,13 +2037,13 @@ void psxgpu_device::GouraudTexturedPolygon( int n_points ) { break; } - n_dx1 = (INT32)( ( COORD_X( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_coord ) << 16 ) - n_cx1.d ) / n_distance; + n_dx1 = (int32_t)( ( COORD_X( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_coord ) << 16 ) - n_cx1.d ) / n_distance; switch( n_cmd & 0x01 ) { case 0x00: - n_dr1 = (INT32)( ( BGR_R( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cr1.d ) / n_distance; - n_dg1 = (INT32)( ( BGR_G( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cg1.d ) / n_distance; - n_db1 = (INT32)( ( BGR_B( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cb1.d ) / n_distance; + n_dr1 = (int32_t)( ( BGR_R( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cr1.d ) / n_distance; + n_dg1 = (int32_t)( ( BGR_G( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cg1.d ) / n_distance; + n_db1 = (int32_t)( ( BGR_B( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_bgr ) << 16 ) - n_cb1.d ) / n_distance; break; case 0x01: n_dr1 = 0; @@ -2051,8 +2051,8 @@ void psxgpu_device::GouraudTexturedPolygon( int n_points ) n_db1 = 0; break; } - n_du1 = (INT32)( ( TEXTURE_U( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_texture ) << 16 ) - n_cu1.d ) / n_distance; - n_dv1 = (INT32)( ( TEXTURE_V( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_texture ) << 16 ) - n_cv1.d ) / n_distance; + n_du1 = (int32_t)( ( TEXTURE_U( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_texture ) << 16 ) - n_cu1.d ) / n_distance; + n_dv1 = (int32_t)( ( TEXTURE_V( m_packet.GouraudTexturedPolygon.vertex[ n_leftpoint ].n_texture ) << 16 ) - n_cv1.d ) / n_distance; } if( n_y == COORD_Y( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_coord ) ) { @@ -2086,13 +2086,13 @@ void psxgpu_device::GouraudTexturedPolygon( int n_points ) { break; } - n_dx2 = (INT32)( ( COORD_X( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_coord ) << 16 ) - n_cx2.d ) / n_distance; + n_dx2 = (int32_t)( ( COORD_X( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_coord ) << 16 ) - n_cx2.d ) / n_distance; switch( n_cmd & 0x01 ) { case 0x00: - n_dr2 = (INT32)( ( BGR_R( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cr2.d ) / n_distance; - n_dg2 = (INT32)( ( BGR_G( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cg2.d ) / n_distance; - n_db2 = (INT32)( ( BGR_B( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cb2.d ) / n_distance; + n_dr2 = (int32_t)( ( BGR_R( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cr2.d ) / n_distance; + n_dg2 = (int32_t)( ( BGR_G( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cg2.d ) / n_distance; + n_db2 = (int32_t)( ( BGR_B( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_bgr ) << 16 ) - n_cb2.d ) / n_distance; break; case 0x01: n_dr2 = 0; @@ -2100,50 +2100,50 @@ void psxgpu_device::GouraudTexturedPolygon( int n_points ) n_db2 = 0; break; } - n_du2 = (INT32)( ( TEXTURE_U( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_texture ) << 16 ) - n_cu2.d ) / n_distance; - n_dv2 = (INT32)( ( TEXTURE_V( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_texture ) << 16 ) - n_cv2.d ) / n_distance; + n_du2 = (int32_t)( ( TEXTURE_U( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_texture ) << 16 ) - n_cu2.d ) / n_distance; + n_dv2 = (int32_t)( ( TEXTURE_V( m_packet.GouraudTexturedPolygon.vertex[ n_rightpoint ].n_texture ) << 16 ) - n_cv2.d ) / n_distance; } int drawy = n_y + n_drawoffset_y; - if( (INT16)n_cx1.sw.h != (INT16)n_cx2.sw.h && drawy >= (INT32)n_drawarea_y1 && drawy <= (INT32)n_drawarea_y2 ) + if( (int16_t)n_cx1.sw.h != (int16_t)n_cx2.sw.h && drawy >= (int32_t)n_drawarea_y1 && drawy <= (int32_t)n_drawarea_y2 ) { - if( (INT16)n_cx1.sw.h < (INT16)n_cx2.sw.h ) + if( (int16_t)n_cx1.sw.h < (int16_t)n_cx2.sw.h ) { n_x = n_cx1.sw.h; - n_distance = (INT16)n_cx2.sw.h - n_x; + n_distance = (int16_t)n_cx2.sw.h - n_x; n_r.d = n_cr1.d; n_g.d = n_cg1.d; n_b.d = n_cb1.d; n_u.d = n_cu1.d; n_v.d = n_cv1.d; - n_dr = (INT32)( n_cr2.d - n_cr1.d ) / n_distance; - n_dg = (INT32)( n_cg2.d - n_cg1.d ) / n_distance; - n_db = (INT32)( n_cb2.d - n_cb1.d ) / n_distance; - n_du = (INT32)( n_cu2.d - n_cu1.d ) / n_distance; - n_dv = (INT32)( n_cv2.d - n_cv1.d ) / n_distance; + n_dr = (int32_t)( n_cr2.d - n_cr1.d ) / n_distance; + n_dg = (int32_t)( n_cg2.d - n_cg1.d ) / n_distance; + n_db = (int32_t)( n_cb2.d - n_cb1.d ) / n_distance; + n_du = (int32_t)( n_cu2.d - n_cu1.d ) / n_distance; + n_dv = (int32_t)( n_cv2.d - n_cv1.d ) / n_distance; } else { n_x = n_cx2.sw.h; - n_distance = (INT16)n_cx1.sw.h - n_x; + n_distance = (int16_t)n_cx1.sw.h - n_x; n_r.d = n_cr2.d; n_g.d = n_cg2.d; n_b.d = n_cb2.d; n_u.d = n_cu2.d; n_v.d = n_cv2.d; - n_dr = (INT32)( n_cr1.d - n_cr2.d ) / n_distance; - n_dg = (INT32)( n_cg1.d - n_cg2.d ) / n_distance; - n_db = (INT32)( n_cb1.d - n_cb2.d ) / n_distance; - n_du = (INT32)( n_cu1.d - n_cu2.d ) / n_distance; - n_dv = (INT32)( n_cv1.d - n_cv2.d ) / n_distance; + n_dr = (int32_t)( n_cr1.d - n_cr2.d ) / n_distance; + n_dg = (int32_t)( n_cg1.d - n_cg2.d ) / n_distance; + n_db = (int32_t)( n_cb1.d - n_cb2.d ) / n_distance; + n_du = (int32_t)( n_cu1.d - n_cu2.d ) / n_distance; + n_dv = (int32_t)( n_cv1.d - n_cv2.d ) / n_distance; } int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_r.d += n_dr * ( n_drawarea_x1 - drawx ); n_g.d += n_dg * ( n_drawarea_x1 - drawx ); @@ -2176,19 +2176,19 @@ void psxgpu_device::MonochromeLine( void ) { PAIR n_x; PAIR n_y; - INT32 n_dx; - INT32 n_dy; - INT32 n_len; - INT32 n_xlen; - INT32 n_ylen; - INT32 n_xstart; - INT32 n_ystart; - INT32 n_xend; - INT32 n_yend; - UINT32 n_r; - UINT32 n_g; - UINT32 n_b; - UINT16 *p_vram; + int32_t n_dx; + int32_t n_dy; + int32_t n_len; + int32_t n_xlen; + int32_t n_ylen; + int32_t n_xstart; + int32_t n_ystart; + int32_t n_xend; + int32_t n_yend; + uint32_t n_r; + uint32_t n_g; + uint32_t n_b; + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 5 ) @@ -2244,16 +2244,16 @@ void psxgpu_device::MonochromeLine( void ) n_x.sw.h = n_xstart; n_x.sw.l = 0; n_y.sw.h = n_ystart; n_y.sw.l = 0; - n_dx = (INT32)( ( n_xend << 16 ) - n_x.d ) / n_len; - n_dy = (INT32)( ( n_yend << 16 ) - n_y.d ) / n_len; + n_dx = (int32_t)( ( n_xend << 16 ) - n_x.d ) / n_len; + n_dy = (int32_t)( ( n_yend << 16 ) - n_y.d ) / n_len; while( n_len > 0 ) { int drawx = n_x.sw.h + n_drawoffset_x; int drawy = n_y.sw.h + n_drawoffset_y; - if( drawx >= (INT32)n_drawarea_x1 && drawy >= (INT32)n_drawarea_y1 && - drawx <= (INT32)n_drawarea_x2 && drawy <= (INT32)n_drawarea_y2 ) + if( drawx >= (int32_t)n_drawarea_x1 && drawy >= (int32_t)n_drawarea_y1 && + drawx <= (int32_t)n_drawarea_x2 && drawy <= (int32_t)n_drawarea_y2 ) { p_vram = p_p_vram[ drawy ] + drawx; WRITE_PIXEL( @@ -2271,18 +2271,18 @@ void psxgpu_device::GouraudLine( void ) { PAIR n_x; PAIR n_y; - INT32 n_dx; - INT32 n_dy; - INT32 n_dr; - INT32 n_dg; - INT32 n_db; - INT32 n_distance; - INT32 n_xlen; - INT32 n_ylen; - INT32 n_xstart; - INT32 n_ystart; - INT32 n_xend; - INT32 n_yend; + int32_t n_dx; + int32_t n_dy; + int32_t n_dr; + int32_t n_dg; + int32_t n_db; + int32_t n_distance; + int32_t n_xlen; + int32_t n_ylen; + int32_t n_xstart; + int32_t n_ystart; + int32_t n_xend; + int32_t n_yend; PAIR n_r; PAIR n_g; PAIR n_b; @@ -2292,7 +2292,7 @@ void psxgpu_device::GouraudLine( void ) PAIR n_cr2; PAIR n_cg2; PAIR n_cb2; - UINT16 *p_vram; + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 6 ) @@ -2354,19 +2354,19 @@ void psxgpu_device::GouraudLine( void ) n_distance = 1; } - n_dx = (INT32)( ( n_xend << 16 ) - n_x.sd ) / n_distance; - n_dy = (INT32)( ( n_yend << 16 ) - n_y.sd ) / n_distance; - n_dr = (INT32)( n_cr2.d - n_cr1.d ) / n_distance; - n_dg = (INT32)( n_cg2.d - n_cg1.d ) / n_distance; - n_db = (INT32)( n_cb2.d - n_cb1.d ) / n_distance; + n_dx = (int32_t)( ( n_xend << 16 ) - n_x.sd ) / n_distance; + n_dy = (int32_t)( ( n_yend << 16 ) - n_y.sd ) / n_distance; + n_dr = (int32_t)( n_cr2.d - n_cr1.d ) / n_distance; + n_dg = (int32_t)( n_cg2.d - n_cg1.d ) / n_distance; + n_db = (int32_t)( n_cb2.d - n_cb1.d ) / n_distance; while( n_distance > 0 ) { int drawx = n_x.sw.h + n_drawoffset_x; int drawy = n_y.sw.h + n_drawoffset_y; - if( drawx >= (INT32)n_drawarea_x1 && drawy >= (INT32)n_drawarea_y1 && - drawx <= (INT32)n_drawarea_x2 && drawy <= (INT32)n_drawarea_y2 ) + if( drawx >= (int32_t)n_drawarea_x1 && drawy >= (int32_t)n_drawarea_y1 && + drawx <= (int32_t)n_drawarea_x2 && drawy <= (int32_t)n_drawarea_y2 ) { p_vram = p_p_vram[ drawy ] + drawx; WRITE_PIXEL( @@ -2388,11 +2388,11 @@ void psxgpu_device::FrameBufferRectangleDraw( void ) PAIR n_r; PAIR n_g; PAIR n_b; - INT32 n_distance; - INT32 n_h; - INT16 n_y; - INT16 n_x; - UINT16 *p_vram; + int32_t n_distance; + int32_t n_h; + int16_t n_y; + int16_t n_x; + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 7 ) @@ -2435,26 +2435,26 @@ void psxgpu_device::FrameBufferRectangleDraw( void ) void psxgpu_device::FlatRectangle( void ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; - UINT8 n_cmd; + uint8_t n_cmd; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; PAIR n_r; PAIR n_g; PAIR n_b; - INT32 n_distance; - INT32 n_h; - UINT16 *p_vram; + int32_t n_distance; + int32_t n_h; + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 8 ) @@ -2486,11 +2486,11 @@ void psxgpu_device::FlatRectangle( void ) int drawy = n_y + n_drawoffset_y; - if( n_distance > 0 && drawy >= (INT32)n_drawarea_y1 && drawy <= (INT32)n_drawarea_y2 ) + if( n_distance > 0 && drawy >= (int32_t)n_drawarea_y1 && drawy <= (int32_t)n_drawarea_y2 ) { int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_distance -= ( n_drawarea_x1 - drawx ); drawx = n_drawarea_x1; @@ -2505,26 +2505,26 @@ void psxgpu_device::FlatRectangle( void ) void psxgpu_device::FlatRectangle8x8( void ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; - UINT8 n_cmd; + uint8_t n_cmd; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; PAIR n_r; PAIR n_g; PAIR n_b; - INT32 n_distance; - INT32 n_h; - UINT16 *p_vram; + int32_t n_distance; + int32_t n_h; + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 9 ) @@ -2556,11 +2556,11 @@ void psxgpu_device::FlatRectangle8x8( void ) int drawy = n_y + n_drawoffset_y; - if( n_distance > 0 && drawy >= (INT32)n_drawarea_y1 && drawy <= (INT32)n_drawarea_y2 ) + if( n_distance > 0 && drawy >= (int32_t)n_drawarea_y1 && drawy <= (int32_t)n_drawarea_y2 ) { int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_distance -= ( n_drawarea_x1 - drawx ); drawx = n_drawarea_x1; @@ -2575,26 +2575,26 @@ void psxgpu_device::FlatRectangle8x8( void ) void psxgpu_device::FlatRectangle16x16( void ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; - UINT8 n_cmd; + uint8_t n_cmd; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; PAIR n_r; PAIR n_g; PAIR n_b; - INT32 n_distance; - INT32 n_h; - UINT16 *p_vram; + int32_t n_distance; + int32_t n_h; + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 10 ) @@ -2626,11 +2626,11 @@ void psxgpu_device::FlatRectangle16x16( void ) int drawy = n_y + n_drawoffset_y; - if( n_distance > 0 && n_y >= (INT32)n_drawarea_y1 && n_y <= (INT32)n_drawarea_y2 ) + if( n_distance > 0 && n_y >= (int32_t)n_drawarea_y1 && n_y <= (int32_t)n_drawarea_y2 ) { int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_distance -= ( n_drawarea_x1 - drawx ); drawx = n_drawarea_x1; @@ -2645,37 +2645,37 @@ void psxgpu_device::FlatRectangle16x16( void ) void psxgpu_device::FlatTexturedRectangle( void ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; int n_tx; int n_ty; - UINT8 n_cmd; + uint8_t n_cmd; - UINT32 n_clutx; - UINT32 n_cluty; + uint32_t n_clutx; + uint32_t n_cluty; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; PAIR n_r; PAIR n_g; PAIR n_b; - UINT8 n_u; - UINT8 n_v; + uint8_t n_u; + uint8_t n_v; int n_du; int n_dv; - INT16 n_distance; - UINT32 n_h; - UINT16 *p_vram; - UINT16 *p_clut; - UINT16 n_bgr; + int16_t n_distance; + uint32_t n_h; + uint16_t *p_vram; + uint16_t *p_clut; + uint16_t n_bgr; #if DEBUG_VIEWER if( m_debug.n_skip == 11 ) @@ -2727,11 +2727,11 @@ void psxgpu_device::FlatTexturedRectangle( void ) int drawy = n_y + n_drawoffset_y; - if( n_distance > 0 && drawy >= (INT32)n_drawarea_y1 && drawy <= (INT32)n_drawarea_y2 ) + if( n_distance > 0 && drawy >= (int32_t)n_drawarea_y1 && drawy <= (int32_t)n_drawarea_y2 ) { int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_u += ( n_drawarea_x1 - drawx ) * n_du; n_distance -= ( n_drawarea_x1 - drawx ); @@ -2748,37 +2748,37 @@ void psxgpu_device::FlatTexturedRectangle( void ) void psxgpu_device::Sprite8x8( void ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; int n_tx; int n_ty; - UINT8 n_cmd; + uint8_t n_cmd; - UINT32 n_clutx; - UINT32 n_cluty; + uint32_t n_clutx; + uint32_t n_cluty; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; PAIR n_r; PAIR n_g; PAIR n_b; - UINT8 n_u; - UINT8 n_v; + uint8_t n_u; + uint8_t n_v; int n_du; int n_dv; - INT16 n_distance; - UINT32 n_h; - UINT16 *p_vram; - UINT16 *p_clut; - UINT16 n_bgr; + int16_t n_distance; + uint32_t n_h; + uint16_t *p_vram; + uint16_t *p_clut; + uint16_t n_bgr; #if DEBUG_VIEWER if( m_debug.n_skip == 12 ) @@ -2830,11 +2830,11 @@ void psxgpu_device::Sprite8x8( void ) int drawy = n_y + n_drawoffset_y; - if( n_distance > 0 && drawy >= (INT32)n_drawarea_y1 && drawy <= (INT32)n_drawarea_y2 ) + if( n_distance > 0 && drawy >= (int32_t)n_drawarea_y1 && drawy <= (int32_t)n_drawarea_y2 ) { int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_u += ( n_drawarea_x1 - drawx ) * n_du; n_distance -= ( n_drawarea_x1 - drawx ); @@ -2851,37 +2851,37 @@ void psxgpu_device::Sprite8x8( void ) void psxgpu_device::Sprite16x16( void ) { - INT16 n_y; - INT16 n_x; + int16_t n_y; + int16_t n_x; int n_tx; int n_ty; - UINT8 n_cmd; + uint8_t n_cmd; - UINT32 n_clutx; - UINT32 n_cluty; + uint32_t n_clutx; + uint32_t n_cluty; - UINT16 *p_n_f; - UINT16 *p_n_redb; - UINT16 *p_n_greenb; - UINT16 *p_n_blueb; - UINT16 *p_n_redtrans; - UINT16 *p_n_greentrans; - UINT16 *p_n_bluetrans; + uint16_t *p_n_f; + uint16_t *p_n_redb; + uint16_t *p_n_greenb; + uint16_t *p_n_blueb; + uint16_t *p_n_redtrans; + uint16_t *p_n_greentrans; + uint16_t *p_n_bluetrans; PAIR n_r; PAIR n_g; PAIR n_b; - UINT8 n_u; - UINT8 n_v; + uint8_t n_u; + uint8_t n_v; int n_du; int n_dv; - INT16 n_distance; - UINT32 n_h; - UINT16 *p_vram; - UINT16 *p_clut; - UINT16 n_bgr; + int16_t n_distance; + uint32_t n_h; + uint16_t *p_vram; + uint16_t *p_clut; + uint16_t n_bgr; #if DEBUG_VIEWER if( m_debug.n_skip == 13 ) @@ -2933,11 +2933,11 @@ void psxgpu_device::Sprite16x16( void ) int drawy = n_y + n_drawoffset_y; - if( n_distance > 0 && drawy >= (INT32)n_drawarea_y1 && drawy <= (INT32)n_drawarea_y2 ) + if( n_distance > 0 && drawy >= (int32_t)n_drawarea_y1 && drawy <= (int32_t)n_drawarea_y2 ) { int drawx = n_x + n_drawoffset_x; - if( ( (INT32)n_drawarea_x1 - drawx ) > 0 ) + if( ( (int32_t)n_drawarea_x1 - drawx ) > 0 ) { n_u += ( n_drawarea_x1 - drawx ) * n_du; n_distance -= ( n_drawarea_x1 - drawx ); @@ -2954,12 +2954,12 @@ void psxgpu_device::Sprite16x16( void ) void psxgpu_device::Dot( void ) { - INT32 n_x; - INT32 n_y; - UINT32 n_r; - UINT32 n_g; - UINT32 n_b; - UINT16 *p_vram; + int32_t n_x; + int32_t n_y; + uint32_t n_r; + uint32_t n_g; + uint32_t n_b; + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 14 ) @@ -2979,8 +2979,8 @@ void psxgpu_device::Dot( void ) int drawx = n_x + n_drawoffset_x; int drawy = n_y + n_drawoffset_y; - if( drawx >= (INT32)n_drawarea_x1 && drawy >= (INT32)n_drawarea_y1 && - drawx <= (INT32)n_drawarea_x2 && drawy <= (INT32)n_drawarea_y2 ) + if( drawx >= (int32_t)n_drawarea_x1 && drawy >= (int32_t)n_drawarea_y1 && + drawx <= (int32_t)n_drawarea_x2 && drawy <= (int32_t)n_drawarea_y2 ) { p_vram = p_p_vram[ drawy ] + drawx; WRITE_PIXEL( @@ -2992,13 +2992,13 @@ void psxgpu_device::Dot( void ) void psxgpu_device::MoveImage( void ) { - INT16 n_w; - INT16 n_h; - INT16 n_srcx; - INT16 n_srcy; - INT16 n_dsty; - INT16 n_dstx; - UINT16 *p_vram; + int16_t n_w; + int16_t n_h; + int16_t n_srcx; + int16_t n_srcy; + int16_t n_dsty; + int16_t n_dstx; + uint16_t *p_vram; #if DEBUG_VIEWER if( m_debug.n_skip == 15 ) @@ -3035,16 +3035,16 @@ void psxgpu_device::MoveImage( void ) } } -void psxgpu_device::dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void psxgpu_device::dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { gpu_write( &p_n_psxram[ n_address / 4 ], n_size ); } -void psxgpu_device::gpu_write( UINT32 *p_ram, INT32 n_size ) +void psxgpu_device::gpu_write( uint32_t *p_ram, int32_t n_size ) { while( n_size > 0 ) { - UINT32 data = *( p_ram ); + uint32_t data = *( p_ram ); verboselog( *this, 2, "PSX Packet #%u %08x\n", n_gpu_buffer_offset, data ); m_packet.n_entry[ n_gpu_buffer_offset ] = data; @@ -3281,8 +3281,8 @@ void psxgpu_device::gpu_write( UINT32 *p_ram, INT32 n_size ) { verboselog( *this, 1, "%02x: rectangle %d,%d %d,%d\n", m_packet.n_entry[ 0 ] >> 24, - (INT16)( m_packet.n_entry[ 1 ] & 0xffff ), (INT16)( m_packet.n_entry[ 1 ] >> 16 ), - (INT16)( m_packet.n_entry[ 2 ] & 0xffff ), (INT16)( m_packet.n_entry[ 2 ] >> 16 ) ); + (int16_t)( m_packet.n_entry[ 1 ] & 0xffff ), (int16_t)( m_packet.n_entry[ 1 ] >> 16 ), + (int16_t)( m_packet.n_entry[ 2 ] & 0xffff ), (int16_t)( m_packet.n_entry[ 2 ] >> 16 ) ); FlatRectangle(); n_gpu_buffer_offset = 0; } @@ -3299,7 +3299,7 @@ void psxgpu_device::gpu_write( UINT32 *p_ram, INT32 n_size ) { verboselog( *this, 1, "%02x: sprite %d,%d %u,%u %08x, %08x\n", m_packet.n_entry[ 0 ] >> 24, - (INT16)( m_packet.n_entry[ 1 ] & 0xffff ), (INT16)( m_packet.n_entry[ 1 ] >> 16 ), + (int16_t)( m_packet.n_entry[ 1 ] & 0xffff ), (int16_t)( m_packet.n_entry[ 1 ] >> 16 ), m_packet.n_entry[ 3 ] & 0xffff, m_packet.n_entry[ 3 ] >> 16, m_packet.n_entry[ 0 ], m_packet.n_entry[ 2 ] ); FlatTexturedRectangle(); @@ -3316,7 +3316,7 @@ void psxgpu_device::gpu_write( UINT32 *p_ram, INT32 n_size ) { verboselog( *this, 1, "%02x: dot %d,%d %08x\n", m_packet.n_entry[ 0 ] >> 24, - (INT16)( m_packet.n_entry[ 1 ] & 0xffff ), (INT16)( m_packet.n_entry[ 1 ] >> 16 ), + (int16_t)( m_packet.n_entry[ 1 ] & 0xffff ), (int16_t)( m_packet.n_entry[ 1 ] >> 16 ), m_packet.n_entry[ 0 ] & 0xffffff ); Dot(); n_gpu_buffer_offset = 0; @@ -3403,10 +3403,10 @@ void psxgpu_device::gpu_write( UINT32 *p_ram, INT32 n_size ) } else { - UINT32 n_pixel; + uint32_t n_pixel; for( n_pixel = 0; n_pixel < 2; n_pixel++ ) { - UINT16 *p_vram; + uint16_t *p_vram; verboselog( *this, 2, "send image to framebuffer ( pixel %u,%u = %u )\n", ( n_vramx + m_packet.n_entry[ 1 ] ) & 1023, @@ -3668,18 +3668,18 @@ WRITE32_MEMBER( psxgpu_device::write ) } -void psxgpu_device::dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void psxgpu_device::dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { gpu_read( &p_n_psxram[ n_address / 4 ], n_size ); } -void psxgpu_device::gpu_read( UINT32 *p_ram, INT32 n_size ) +void psxgpu_device::gpu_read( uint32_t *p_ram, int32_t n_size ) { while( n_size > 0 ) { if( ( n_gpustatus & ( 1L << 0x1b ) ) != 0 ) { - UINT32 n_pixel; + uint32_t n_pixel; PAIR data; verboselog( *this, 2, "copy image from frame buffer ( %d, %d )\n", n_vramx, n_vramy ); @@ -3723,7 +3723,7 @@ void psxgpu_device::gpu_read( UINT32 *p_ram, INT32 n_size ) READ32_MEMBER( psxgpu_device::read ) { - UINT32 data; + uint32_t data; switch( offset ) { @@ -3789,7 +3789,7 @@ void psxgpu_device::lightgun_set( int n_x, int n_y ) PALETTE_INIT_MEMBER( psxgpu_device, psx ) { - UINT32 n_colour; + uint32_t n_colour; for( n_colour = 0; n_colour < 0x10000; n_colour++ ) { diff --git a/src/devices/video/psx.h b/src/devices/video/psx.h index ae96761cb02..f60ff1d6e88 100644 --- a/src/devices/video/psx.h +++ b/src/devices/video/psx.h @@ -95,7 +95,7 @@ struct GOURAUDTEXTUREDVERTEX union PACKET { - UINT32 n_entry[ 16 ]; + uint32_t n_entry[ 16 ]; struct { @@ -189,17 +189,17 @@ class psxgpu_device : public device_t { public: // construction/destruction - psxgpu_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); + psxgpu_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 machine_config_constructor device_mconfig_additions() const override; // static configuration helpers template static devcb_base &set_vblank_handler(device_t &device, _Object object) { return downcast(device).m_vblank_handler.set_callback(object); } - UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE32_MEMBER( write ); DECLARE_READ32_MEMBER( read ); - void dma_read( UINT32 *ram, UINT32 n_address, INT32 n_size ); - void dma_write( UINT32 *ram, UINT32 n_address, INT32 n_size ); + void dma_read( uint32_t *ram, uint32_t n_address, int32_t n_size ); + void dma_write( uint32_t *ram, uint32_t n_address, int32_t n_size ); void lightgun_set( int, int ); int vramSize; void vblank(screen_device &screen, bool vblank_state); @@ -211,7 +211,7 @@ protected: private: void updatevisiblearea(); - void decode_tpage( UINT32 tpage ); + void decode_tpage( uint32_t tpage ); void FlatPolygon( int n_points ); void FlatTexturedPolygon( int n_points ); void GouraudPolygon( int n_points ); @@ -229,77 +229,77 @@ private: void MoveImage( void ); void psx_gpu_init( int n_gputype ); void gpu_reset(); - void gpu_read( UINT32 *p_ram, INT32 n_size ); - void gpu_write( UINT32 *p_ram, INT32 n_size ); - - INT32 m_n_tx; - INT32 m_n_ty; - INT32 n_abr; - INT32 n_tp; - INT32 n_ix; - INT32 n_iy; - INT32 n_ti; - - std::unique_ptr p_vram; - UINT32 n_vramx; - UINT32 n_vramy; - UINT32 n_twy; - UINT32 n_twx; - UINT32 n_twh; - UINT32 n_tww; - UINT32 n_drawarea_x1; - UINT32 n_drawarea_y1; - UINT32 n_drawarea_x2; - UINT32 n_drawarea_y2; - UINT32 n_horiz_disstart; - UINT32 n_horiz_disend; - UINT32 n_vert_disstart; - UINT32 n_vert_disend; - UINT32 b_reverseflag; - INT32 n_drawoffset_x; - INT32 n_drawoffset_y; - UINT32 m_n_displaystartx; - UINT32 n_displaystarty; + void gpu_read( uint32_t *p_ram, int32_t n_size ); + void gpu_write( uint32_t *p_ram, int32_t n_size ); + + int32_t m_n_tx; + int32_t m_n_ty; + int32_t n_abr; + int32_t n_tp; + int32_t n_ix; + int32_t n_iy; + int32_t n_ti; + + std::unique_ptr p_vram; + uint32_t n_vramx; + uint32_t n_vramy; + uint32_t n_twy; + uint32_t n_twx; + uint32_t n_twh; + uint32_t n_tww; + uint32_t n_drawarea_x1; + uint32_t n_drawarea_y1; + uint32_t n_drawarea_x2; + uint32_t n_drawarea_y2; + uint32_t n_horiz_disstart; + uint32_t n_horiz_disend; + uint32_t n_vert_disstart; + uint32_t n_vert_disend; + uint32_t b_reverseflag; + int32_t n_drawoffset_x; + int32_t n_drawoffset_y; + uint32_t m_n_displaystartx; + uint32_t n_displaystarty; int m_n_gputype; - UINT32 n_gpustatus; - UINT32 n_gpuinfo; - UINT32 n_gpu_buffer_offset; - UINT32 n_lightgun_x; - UINT32 n_lightgun_y; - UINT32 n_screenwidth; - UINT32 n_screenheight; + uint32_t n_gpustatus; + uint32_t n_gpuinfo; + uint32_t n_gpu_buffer_offset; + uint32_t n_lightgun_x; + uint32_t n_lightgun_y; + uint32_t n_screenwidth; + uint32_t n_screenheight; PACKET m_packet; - UINT16 *p_p_vram[ 1024 ]; - - UINT16 p_n_redshade[ MAX_LEVEL * MAX_SHADE ]; - UINT16 p_n_greenshade[ MAX_LEVEL * MAX_SHADE ]; - UINT16 p_n_blueshade[ MAX_LEVEL * MAX_SHADE ]; - UINT16 p_n_redlevel[ 0x10000 ]; - UINT16 p_n_greenlevel[ 0x10000 ]; - UINT16 p_n_bluelevel[ 0x10000 ]; - - UINT16 p_n_f025[ MAX_LEVEL * MAX_SHADE ]; - UINT16 p_n_f05[ MAX_LEVEL * MAX_SHADE ]; - UINT16 p_n_f1[ MAX_LEVEL * MAX_SHADE ]; - UINT16 p_n_redb05[ 0x10000 ]; - UINT16 p_n_greenb05[ 0x10000 ]; - UINT16 p_n_blueb05[ 0x10000 ]; - UINT16 p_n_redb1[ 0x10000 ]; - UINT16 p_n_greenb1[ 0x10000 ]; - UINT16 p_n_blueb1[ 0x10000 ]; - UINT16 p_n_redaddtrans[ MAX_LEVEL * MAX_LEVEL ]; - UINT16 p_n_greenaddtrans[ MAX_LEVEL * MAX_LEVEL ]; - UINT16 p_n_blueaddtrans[ MAX_LEVEL * MAX_LEVEL ]; - UINT16 p_n_redsubtrans[ MAX_LEVEL * MAX_LEVEL ]; - UINT16 p_n_greensubtrans[ MAX_LEVEL * MAX_LEVEL ]; - UINT16 p_n_bluesubtrans[ MAX_LEVEL * MAX_LEVEL ]; - - UINT16 p_n_g0r0[ 0x10000 ]; - UINT16 p_n_b0[ 0x10000 ]; - UINT16 p_n_r1[ 0x10000 ]; - UINT16 p_n_b1g1[ 0x10000 ]; + uint16_t *p_p_vram[ 1024 ]; + + uint16_t p_n_redshade[ MAX_LEVEL * MAX_SHADE ]; + uint16_t p_n_greenshade[ MAX_LEVEL * MAX_SHADE ]; + uint16_t p_n_blueshade[ MAX_LEVEL * MAX_SHADE ]; + uint16_t p_n_redlevel[ 0x10000 ]; + uint16_t p_n_greenlevel[ 0x10000 ]; + uint16_t p_n_bluelevel[ 0x10000 ]; + + uint16_t p_n_f025[ MAX_LEVEL * MAX_SHADE ]; + uint16_t p_n_f05[ MAX_LEVEL * MAX_SHADE ]; + uint16_t p_n_f1[ MAX_LEVEL * MAX_SHADE ]; + uint16_t p_n_redb05[ 0x10000 ]; + uint16_t p_n_greenb05[ 0x10000 ]; + uint16_t p_n_blueb05[ 0x10000 ]; + uint16_t p_n_redb1[ 0x10000 ]; + uint16_t p_n_greenb1[ 0x10000 ]; + uint16_t p_n_blueb1[ 0x10000 ]; + uint16_t p_n_redaddtrans[ MAX_LEVEL * MAX_LEVEL ]; + uint16_t p_n_greenaddtrans[ MAX_LEVEL * MAX_LEVEL ]; + uint16_t p_n_blueaddtrans[ MAX_LEVEL * MAX_LEVEL ]; + uint16_t p_n_redsubtrans[ MAX_LEVEL * MAX_LEVEL ]; + uint16_t p_n_greensubtrans[ MAX_LEVEL * MAX_LEVEL ]; + uint16_t p_n_bluesubtrans[ MAX_LEVEL * MAX_LEVEL ]; + + uint16_t p_n_g0r0[ 0x10000 ]; + uint16_t p_n_b0[ 0x10000 ]; + uint16_t p_n_r1[ 0x10000 ]; + uint16_t p_n_b1g1[ 0x10000 ]; devcb_write_line m_vblank_handler; @@ -320,42 +320,42 @@ class cxd8514q_device : public psxgpu_device { public: // construction/destruction - cxd8514q_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8514q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8538q_device : public psxgpu_device { public: // construction/destruction - cxd8538q_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8538q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8561q_device : public psxgpu_device { public: // construction/destruction - cxd8561q_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8561q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8561bq_device : public psxgpu_device { public: // construction/destruction - cxd8561bq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8561bq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8561cq_device : public psxgpu_device { public: // construction/destruction - cxd8561cq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8561cq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class cxd8654q_device : public psxgpu_device { public: // construction/destruction - cxd8654q_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cxd8654q_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; #endif diff --git a/src/devices/video/ramdac.cpp b/src/devices/video/ramdac.cpp index 5d22db9442c..9b5220bd1eb 100644 --- a/src/devices/video/ramdac.cpp +++ b/src/devices/video/ramdac.cpp @@ -40,7 +40,7 @@ const device_type RAMDAC = &device_creator; // ramdac_device - constructor //------------------------------------------------- -ramdac_device::ramdac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ramdac_device::ramdac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, RAMDAC, "RAMDAC", tag, owner, clock, "ramdac", __FILE__), device_memory_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 10, 0, nullptr, *ADDRESS_MAP_NAME(ramdac_palram)), @@ -74,7 +74,7 @@ const address_space_config *ramdac_device::memory_space_config(address_spacenum // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT8 ramdac_device::readbyte(offs_t address) +inline uint8_t ramdac_device::readbyte(offs_t address) { return space().read_byte(address); } @@ -84,7 +84,7 @@ inline UINT8 ramdac_device::readbyte(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void ramdac_device::writebyte(offs_t address, UINT8 data) +inline void ramdac_device::writebyte(offs_t address, uint8_t data) { space().write_byte(address, data); } @@ -104,7 +104,7 @@ void ramdac_device::device_validity_check(validity_checker &valid) const void ramdac_device::device_start() { - m_palram = make_unique_clear(1 << 10); + m_palram = make_unique_clear(1 << 10); } @@ -128,7 +128,7 @@ void ramdac_device::device_reset() // [0] = W register, [1] = R register //************************************************************************** -inline void ramdac_device::reg_increment(UINT8 inc_type) +inline void ramdac_device::reg_increment(uint8_t inc_type) { m_int_index[inc_type]++; if(m_int_index[inc_type] == 3) @@ -157,7 +157,7 @@ WRITE8_MEMBER( ramdac_device::index_r_w ) READ8_MEMBER( ramdac_device::pal_r ) { - UINT8 res; + uint8_t res; res = readbyte(m_pal_index[m_split_read_reg] | (m_int_index[m_split_read_reg] << 8)); reg_increment(m_split_read_reg); return res; @@ -186,7 +186,7 @@ READ8_MEMBER( ramdac_device::ramdac_pal_r ) WRITE8_MEMBER( ramdac_device::ramdac_rgb666_w ) { - UINT16 pal_offs; + uint16_t pal_offs; m_palram[offset] = data & 0x3f; pal_offs = (offset & 0xff); @@ -197,7 +197,7 @@ WRITE8_MEMBER( ramdac_device::ramdac_rgb666_w ) WRITE8_MEMBER( ramdac_device::ramdac_rgb888_w ) { - UINT16 pal_offs; + uint16_t pal_offs; m_palram[offset] = data; pal_offs = (offset & 0xff); diff --git a/src/devices/video/ramdac.h b/src/devices/video/ramdac.h index 804bdc68c79..08bfa2cab92 100644 --- a/src/devices/video/ramdac.h +++ b/src/devices/video/ramdac.h @@ -41,11 +41,11 @@ class ramdac_device : public device_t, { public: // construction/destruction - ramdac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ramdac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration static void static_set_palette_tag(device_t &device, const char *tag); - static void static_set_color_base(device_t &device, UINT32 color_base) { downcast(device).m_color_base = color_base; } + static void static_set_color_base(device_t &device, uint32_t color_base) { downcast(device).m_color_base = color_base; } static void set_split_read(device_t &device, int split) { downcast(device).m_split_read_reg = split; } // I/O operations @@ -67,21 +67,21 @@ protected: virtual void device_validity_check(validity_checker &valid) const override; virtual void device_start() override; virtual void device_reset() override; - inline UINT8 readbyte(offs_t address); - inline void writebyte(offs_t address, UINT8 data); - inline void reg_increment(UINT8 inc_type); + inline uint8_t readbyte(offs_t address); + inline void writebyte(offs_t address, uint8_t data); + inline void reg_increment(uint8_t inc_type); private: - UINT8 m_pal_index[2]; - UINT8 m_pal_mask; - UINT8 m_int_index[2]; - std::unique_ptr m_palram; + uint8_t m_pal_index[2]; + uint8_t m_pal_mask; + uint8_t m_int_index[2]; + std::unique_ptr m_palram; const address_space_config m_space_config; required_device m_palette; - UINT32 m_color_base; - UINT8 m_split_read_reg; // read register index is separated, seen in rltennis + uint32_t m_color_base; + uint8_t m_split_read_reg; // read register index is separated, seen in rltennis }; diff --git a/src/devices/video/saa5050.cpp b/src/devices/video/saa5050.cpp index 17bed03ffca..5953e1a0d24 100644 --- a/src/devices/video/saa5050.cpp +++ b/src/devices/video/saa5050.cpp @@ -173,7 +173,7 @@ const tiny_rom_entry *saa5057_device::device_rom_region() const // saa5050_device - constructor //------------------------------------------------- -saa5050_device::saa5050_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) : +saa5050_device::saa5050_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_char_rom(*this, "chargen"), m_read_d(*this), @@ -184,7 +184,7 @@ saa5050_device::saa5050_device(const machine_config &mconfig, device_type type, { } -saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SAA5050, "SAA5050 Video", tag, owner, clock, "saa5050", __FILE__), m_char_rom(*this, "chargen"), m_read_d(*this), @@ -195,25 +195,25 @@ saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, d { } -saa5051_device::saa5051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saa5051_device::saa5051_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saa5050_device(mconfig, SAA5051, "SAA5051", tag, owner, clock, "saa5051", __FILE__) { } -saa5052_device::saa5052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saa5052_device::saa5052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saa5050_device(mconfig, SAA5052, "SAA5052", tag, owner, clock, "saa5052", __FILE__) { } -saa5053_device::saa5053_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saa5053_device::saa5053_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saa5050_device(mconfig, SAA5053, "SAA5053", tag, owner, clock, "saa5053", __FILE__) { } -saa5054_device::saa5054_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saa5054_device::saa5054_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saa5050_device(mconfig, SAA5054, "SAA5054", tag, owner, clock, "saa5054", __FILE__) { } -saa5055_device::saa5055_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saa5055_device::saa5055_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saa5050_device(mconfig, SAA5055, "SAA5055", tag, owner, clock, "saa5055", __FILE__) { } -saa5056_device::saa5056_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saa5056_device::saa5056_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saa5050_device(mconfig, SAA5056, "SAA5056", tag, owner, clock, "saa5056", __FILE__) { } -saa5057_device::saa5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +saa5057_device::saa5057_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : saa5050_device(mconfig, SAA5057, "SAA5057", tag, owner, clock, "saa5057", __FILE__) { } @@ -268,7 +268,7 @@ void saa5050_device::device_reset() // process_control_character - //------------------------------------------------- -void saa5050_device::process_control_character(UINT8 data) +void saa5050_device::process_control_character(uint8_t data) { m_hold_clear = false; m_hold_off = false; @@ -372,9 +372,9 @@ void saa5050_device::set_next_chartype() // get_gfx_data - graphics generator //------------------------------------------------- -UINT16 saa5050_device::get_gfx_data(UINT8 data, offs_t row, bool separated) +uint16_t saa5050_device::get_gfx_data(uint8_t data, offs_t row, bool separated) { - UINT16 c = 0; + uint16_t c = 0; switch (row >> 1) { case 0: case 1: @@ -416,9 +416,9 @@ UINT16 saa5050_device::get_gfx_data(UINT8 data, offs_t row, bool separated) // get_rom_data - read rom //------------------------------------------------- -UINT16 saa5050_device::get_rom_data(UINT8 data, offs_t row) +uint16_t saa5050_device::get_rom_data(uint8_t data, offs_t row) { - UINT16 c; + uint16_t c; if (row < 0 || row >= 20) { c = 0; @@ -436,7 +436,7 @@ UINT16 saa5050_device::get_rom_data(UINT8 data, offs_t row) // character_rounding //------------------------------------------------- -UINT16 saa5050_device::character_rounding(UINT16 a, UINT16 b) +uint16_t saa5050_device::character_rounding(uint16_t a, uint16_t b) { return a | ((a >> 1) & b & ~(b >> 1)) | ((a << 1) & b & ~(b << 1)); } @@ -446,7 +446,7 @@ UINT16 saa5050_device::character_rounding(UINT16 a, UINT16 b) // get_character_data - //------------------------------------------------- -void saa5050_device::get_character_data(UINT8 data) +void saa5050_device::get_character_data(uint8_t data) { m_double_height_old = m_double_height; m_prev_col = m_fg; @@ -565,7 +565,7 @@ WRITE_LINE_MEMBER( saa5050_device::lose_w ) // write - character data write //------------------------------------------------- -void saa5050_device::write(UINT8 data) +void saa5050_device::write(uint8_t data) { m_code = data & 0x7f; } @@ -614,7 +614,7 @@ int saa5050_device::get_rgb() // screen_update - //------------------------------------------------- -UINT32 saa5050_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t saa5050_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { dew_w(1); dew_w(0); @@ -632,7 +632,7 @@ UINT32 saa5050_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap for (int sx = 0; sx < m_cols; sx++) { - UINT8 code = m_read_d(video_ram_addr++); + uint8_t code = m_read_d(video_ram_addr++); write(code & 0x7f); diff --git a/src/devices/video/saa5050.h b/src/devices/video/saa5050.h index 9c53ba896c6..aa854dbee18 100644 --- a/src/devices/video/saa5050.h +++ b/src/devices/video/saa5050.h @@ -55,8 +55,8 @@ class saa5050_device : public device_t { public: // construction/destruction - saa5050_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); - saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saa5050_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); + saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_screen_size(device_t &device, int cols, int rows, int size) { downcast(device).m_cols = cols; downcast(device).m_rows = rows; downcast(device).m_size = size; } @@ -68,7 +68,7 @@ public: DECLARE_WRITE_LINE_MEMBER( crs_w ); DECLARE_WRITE_LINE_MEMBER( dew_w ); DECLARE_WRITE_LINE_MEMBER( lose_w ); - void write(UINT8 data); + void write(uint8_t data); DECLARE_WRITE_LINE_MEMBER( f1_w ); DECLARE_WRITE_LINE_MEMBER( tr6_w ); int get_rgb(); @@ -76,7 +76,7 @@ public: // NOTE: the following are provided for convenience only, SAA5050 is not a display controller // this emulates the common setup where bit 7 of data inverts the display, and the // bottom half of a double height row gets the same character data as the top half - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -120,23 +120,23 @@ private: RELEASE_GRAPHICS }; - void process_control_character(UINT8 data); + void process_control_character(uint8_t data); void set_next_chartype(); - UINT16 get_gfx_data(UINT8 data, offs_t row, bool separated); - UINT16 get_rom_data(UINT8 data, offs_t row); - UINT16 character_rounding(UINT16 a, UINT16 b); - void get_character_data(UINT8 data); + uint16_t get_gfx_data(uint8_t data, offs_t row, bool separated); + uint16_t get_rom_data(uint8_t data, offs_t row); + uint16_t character_rounding(uint16_t a, uint16_t b); + void get_character_data(uint8_t data); - required_region_ptr m_char_rom; + required_region_ptr m_char_rom; devcb_read8 m_read_d; - UINT8 m_code; - UINT8 m_held_char; - UINT8 m_next_chartype; - UINT8 m_curr_chartype; - UINT8 m_held_chartype; - UINT16 m_char_data; + uint8_t m_code; + uint8_t m_held_char; + uint8_t m_next_chartype; + uint8_t m_curr_chartype; + uint8_t m_held_chartype; + uint16_t m_char_data; int m_bit; rgb_t m_color; int m_crs; @@ -169,7 +169,7 @@ class saa5051_device : public saa5050_device { public: // construction/destruction - saa5051_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saa5051_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; @@ -182,7 +182,7 @@ class saa5052_device : public saa5050_device { public: // construction/destruction - saa5052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saa5052_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; @@ -195,7 +195,7 @@ class saa5053_device : public saa5050_device { public: // construction/destruction - saa5053_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saa5053_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; @@ -208,7 +208,7 @@ class saa5054_device : public saa5050_device { public: // construction/destruction - saa5054_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saa5054_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; @@ -221,7 +221,7 @@ class saa5055_device : public saa5050_device { public: // construction/destruction - saa5055_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saa5055_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; @@ -234,7 +234,7 @@ class saa5056_device : public saa5050_device { public: // construction/destruction - saa5056_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saa5056_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; @@ -247,7 +247,7 @@ class saa5057_device : public saa5050_device { public: // construction/destruction - saa5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + saa5057_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; diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp index 7257f1685d4..feeb2e46c7f 100644 --- a/src/devices/video/scn2674.cpp +++ b/src/devices/video/scn2674.cpp @@ -17,7 +17,7 @@ static ADDRESS_MAP_START( scn2674_vram, AS_0, 8, scn2674_device ) AM_RANGE(0x0000, 0xffff) AM_NOP ADDRESS_MAP_END -scn2674_device::scn2674_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +scn2674_device::scn2674_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SCN2674_VIDEO, "Signetics SCN2674 AVDC", tag, owner, clock, "scn2674_device", __FILE__), device_video_interface(mconfig, *this), device_memory_interface(mconfig, *this), @@ -113,7 +113,7 @@ void scn2674_device::device_reset() } // 15 Initialization Registers (8-bit each) -void scn2674_device::write_init_regs(UINT8 data) +void scn2674_device::write_init_regs(uint8_t data) { LOG2674(("scn2674_write_init_regs %02x %02x\n",m_IR_pointer,data)); @@ -182,7 +182,7 @@ void scn2674_device::write_init_regs(UINT8 data) case 7: { - const UINT8 vsync_table[4] = {3,1,5,7}; + const uint8_t vsync_table[4] = {3,1,5,7}; m_IR7_cursor_underline_position = (data & 0x0f); m_IR7_cursor_rate_divisor = ((data & 0x10)>>4 ? 64:32); m_IR7_cursor_blink = (data & 0x20)>>5; @@ -263,9 +263,9 @@ void scn2674_device::write_init_regs(UINT8 data) if (m_IR_pointer>14)m_IR_pointer=14; } -void scn2674_device::write_command(UINT8 data) +void scn2674_device::write_command(uint8_t data) { - UINT8 operand; + uint8_t operand; int i; @@ -717,8 +717,8 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para dw = m_screen1_h >> 6; if(!charrow) { - UINT16 addr = (m_screen2_h << 8) | m_screen2_l; - UINT16 line = space().read_word(addr); + uint16_t addr = (m_screen2_h << 8) | m_screen2_l; + uint16_t line = space().read_word(addr); m_screen1_h = (line >> 8); m_screen1_l = line & 0xff; if(m_IR0_double_ht_wd) @@ -743,7 +743,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para else if(dw == 3) tilerow = (charrow + m_IR0_scanline_per_char_row) >> 1; - UINT16 address = m_address; + uint16_t address = m_address; for(int i = 0; i < m_IR5_character_per_row; i++) { @@ -773,7 +773,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para } } -UINT32 scn2674_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t scn2674_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (!m_display_enabled) m_bitmap.fill(rgb_t::black); diff --git a/src/devices/video/scn2674.h b/src/devices/video/scn2674.h index 6c4f5361525..9d2617050fe 100644 --- a/src/devices/video/scn2674.h +++ b/src/devices/video/scn2674.h @@ -18,16 +18,16 @@ #define MCFG_SCN2674_DRAW_CHARACTER_CALLBACK_OWNER(_class, _method) \ scn2674_device::static_set_display_callback(*device, scn2674_device::draw_character_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); -#define SCN2674_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int x, int y, UINT8 linecount, UINT8 charcode, UINT16 address, UINT8 cursor, UINT8 dw, UINT8 lg, UINT8 ul, UINT8 blink) +#define SCN2674_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int x, int y, uint8_t linecount, uint8_t charcode, uint16_t address, uint8_t cursor, uint8_t dw, uint8_t lg, uint8_t ul, uint8_t blink) class scn2674_device : public device_t, public device_video_interface, public device_memory_interface { public: - scn2674_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + scn2674_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - typedef device_delegate draw_character_delegate; + typedef device_delegate draw_character_delegate; // static configuration template static devcb_base &set_irq_callback(device_t &device, _Object object) { return downcast(device).m_irq_cb.set_callback(object); } @@ -40,7 +40,7 @@ public: DECLARE_READ8_MEMBER( buffer_r ) { return m_buffer; } DECLARE_WRITE8_MEMBER( buffer_w ) { m_buffer = data; } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_0) ? &m_space_config : nullptr; } protected: @@ -52,70 +52,70 @@ private: bitmap_rgb32 m_bitmap; devcb_write_line m_irq_cb; - UINT8 m_IR_pointer; - UINT8 m_screen1_l; - UINT8 m_screen1_h; - UINT8 m_cursor_l; - UINT8 m_cursor_h; - UINT8 m_screen2_l; - UINT8 m_screen2_h; - UINT8 m_irq_register; - UINT8 m_status_register; - UINT8 m_irq_mask; - UINT8 m_gfx_enabled; - UINT8 m_display_enabled; - UINT8 m_display_enabled_field; - UINT8 m_display_enabled_scanline; - UINT8 m_cursor_enabled; - UINT8 m_hpixels_per_column; - UINT8 m_text_hpixels_per_column; - UINT8 m_gfx_hpixels_per_column; - UINT8 m_IR0_double_ht_wd; - UINT8 m_IR0_scanline_per_char_row; - UINT8 m_IR0_sync_select; - UINT8 m_IR0_buffer_mode_select; - UINT8 m_IR1_interlace_enable; - UINT8 m_IR1_equalizing_constant; - UINT8 m_IR2_row_table; - UINT8 m_IR2_horz_sync_width; - UINT8 m_IR2_horz_back_porch; - UINT8 m_IR3_vert_front_porch; - UINT8 m_IR3_vert_back_porch; - UINT8 m_IR4_rows_per_screen; - UINT8 m_IR4_character_blink_rate_divisor; - UINT8 m_IR5_character_per_row; - UINT8 m_IR6_cursor_first_scanline; - UINT8 m_IR6_cursor_last_scanline; - UINT8 m_IR7_cursor_underline_position; - UINT8 m_IR7_cursor_rate_divisor; - UINT8 m_IR7_cursor_blink; - UINT8 m_IR7_vsync_width; - UINT8 m_IR8_display_buffer_first_address_LSB; - UINT8 m_IR9_display_buffer_first_address_MSB; - UINT8 m_IR9_display_buffer_last_address; - UINT8 m_IR10_display_pointer_address_lower; - UINT8 m_IR11_display_pointer_address_upper; - UINT8 m_IR11_reset_scanline_counter_on_scrollup; - UINT8 m_IR11_reset_scanline_counter_on_scrolldown; - UINT8 m_IR12_scroll_start; - UINT8 m_IR12_split_register_1; - UINT8 m_IR13_scroll_end; - UINT8 m_IR13_split_register_2; - UINT8 m_IR14_scroll_lines; - UINT8 m_IR14_double_1; - UINT8 m_IR14_double_2; - UINT8 m_spl1; - UINT8 m_spl2; - UINT8 m_dbl1; - UINT8 m_buffer; + uint8_t m_IR_pointer; + uint8_t m_screen1_l; + uint8_t m_screen1_h; + uint8_t m_cursor_l; + uint8_t m_cursor_h; + uint8_t m_screen2_l; + uint8_t m_screen2_h; + uint8_t m_irq_register; + uint8_t m_status_register; + uint8_t m_irq_mask; + uint8_t m_gfx_enabled; + uint8_t m_display_enabled; + uint8_t m_display_enabled_field; + uint8_t m_display_enabled_scanline; + uint8_t m_cursor_enabled; + uint8_t m_hpixels_per_column; + uint8_t m_text_hpixels_per_column; + uint8_t m_gfx_hpixels_per_column; + uint8_t m_IR0_double_ht_wd; + uint8_t m_IR0_scanline_per_char_row; + uint8_t m_IR0_sync_select; + uint8_t m_IR0_buffer_mode_select; + uint8_t m_IR1_interlace_enable; + uint8_t m_IR1_equalizing_constant; + uint8_t m_IR2_row_table; + uint8_t m_IR2_horz_sync_width; + uint8_t m_IR2_horz_back_porch; + uint8_t m_IR3_vert_front_porch; + uint8_t m_IR3_vert_back_porch; + uint8_t m_IR4_rows_per_screen; + uint8_t m_IR4_character_blink_rate_divisor; + uint8_t m_IR5_character_per_row; + uint8_t m_IR6_cursor_first_scanline; + uint8_t m_IR6_cursor_last_scanline; + uint8_t m_IR7_cursor_underline_position; + uint8_t m_IR7_cursor_rate_divisor; + uint8_t m_IR7_cursor_blink; + uint8_t m_IR7_vsync_width; + uint8_t m_IR8_display_buffer_first_address_LSB; + uint8_t m_IR9_display_buffer_first_address_MSB; + uint8_t m_IR9_display_buffer_last_address; + uint8_t m_IR10_display_pointer_address_lower; + uint8_t m_IR11_display_pointer_address_upper; + uint8_t m_IR11_reset_scanline_counter_on_scrollup; + uint8_t m_IR11_reset_scanline_counter_on_scrolldown; + uint8_t m_IR12_scroll_start; + uint8_t m_IR12_split_register_1; + uint8_t m_IR13_scroll_end; + uint8_t m_IR13_split_register_2; + uint8_t m_IR14_scroll_lines; + uint8_t m_IR14_double_1; + uint8_t m_IR14_double_2; + uint8_t m_spl1; + uint8_t m_spl2; + uint8_t m_dbl1; + uint8_t m_buffer; int m_linecounter; - UINT16 m_address; + uint16_t m_address; int m_start1change; - UINT8 m_irq_state; + uint8_t m_irq_state; - void write_init_regs(UINT8 data); - void write_command(UINT8 data); + void write_init_regs(uint8_t data); + void write_command(uint8_t data); void recompute_parameters(); draw_character_delegate m_display_cb; diff --git a/src/devices/video/sed1200.cpp b/src/devices/video/sed1200.cpp index 6d88b288714..583b2c955c9 100644 --- a/src/devices/video/sed1200.cpp +++ b/src/devices/video/sed1200.cpp @@ -31,27 +31,27 @@ ROM_START( sed1200x0b ) ROM_LOAD( "sed1200-b.bin", 0x000, 0x800, CRC(d0741f51) SHA1(c8c856f1357286a2c8c806af81724a828345357e)) ROM_END -sed1200_device::sed1200_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) : +sed1200_device::sed1200_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), cursor_direction(false), cursor_blinking(false), cursor_full(false), cursor_on(false), display_on(false), cursor_address(0), cgram_address(0), cgrom(nullptr) { } -sed1200d0a_device::sed1200d0a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sed1200d0a_device::sed1200d0a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sed1200_device(mconfig, SED1200D0A, "sed1200d-0a", tag, owner, clock, "sed1200", __FILE__) { } -sed1200f0a_device::sed1200f0a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sed1200f0a_device::sed1200f0a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sed1200_device(mconfig, SED1200F0A, "sed1200f-0a", tag, owner, clock, "sed1200", __FILE__) { } -sed1200d0b_device::sed1200d0b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sed1200d0b_device::sed1200d0b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sed1200_device(mconfig, SED1200D0B, "sed1200d-0b", tag, owner, clock, "sed1200", __FILE__) { } -sed1200f0b_device::sed1200f0b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sed1200f0b_device::sed1200f0b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : sed1200_device(mconfig, SED1200F0B, "sed1200f-0b", tag, owner, clock, "sed1200", __FILE__) { } @@ -99,7 +99,7 @@ void sed1200_device::soft_reset() cgram_address = 0x00; } -void sed1200_device::control_w(UINT8 data) +void sed1200_device::control_w(uint8_t data) { switch(data) { case 0x04: case 0x05: @@ -140,12 +140,12 @@ void sed1200_device::control_w(UINT8 data) } } -UINT8 sed1200_device::control_r() +uint8_t sed1200_device::control_r() { return 0x00; } -void sed1200_device::data_w(UINT8 data) +void sed1200_device::data_w(uint8_t data) { ddram[cursor_address] = data; cursor_step(); @@ -166,14 +166,14 @@ void sed1200_device::cursor_step() } } -const UINT8 *sed1200_device::render() +const uint8_t *sed1200_device::render() { memset(render_buf, 0, 20*8); if(!display_on) return render_buf; for(int i=0; i<20; i++) { - UINT8 c = ddram[i]; + uint8_t c = ddram[i]; if(c < 4) memcpy(render_buf + 8*i, cgram + 8*c, 8); else if(cgrom) diff --git a/src/devices/video/sed1200.h b/src/devices/video/sed1200.h index d82461fe6da..454e3585968 100644 --- a/src/devices/video/sed1200.h +++ b/src/devices/video/sed1200.h @@ -29,24 +29,24 @@ class sed1200_device : public device_t { public: - sed1200_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); + sed1200_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); - void control_w(UINT8 data); - UINT8 control_r(); - void data_w(UINT8 data); + void control_w(uint8_t data); + uint8_t control_r(); + void data_w(uint8_t data); - const UINT8 *render(); + const uint8_t *render(); protected: virtual void device_start() override; private: - UINT8 cgram[4*8]; - UINT8 ddram[10*2]; - UINT8 render_buf[20*8]; + uint8_t cgram[4*8]; + uint8_t ddram[10*2]; + uint8_t render_buf[20*8]; bool cursor_direction, cursor_blinking, cursor_full, cursor_on, display_on; - UINT8 cursor_address, cgram_address; - const UINT8 *cgrom; + uint8_t cursor_address, cgram_address; + const uint8_t *cgrom; void soft_reset(); void cursor_step(); @@ -54,7 +54,7 @@ private: class sed1200d0a_device : public sed1200_device { public: - sed1200d0a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sed1200d0a_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; @@ -62,7 +62,7 @@ protected: class sed1200f0a_device : public sed1200_device { public: - sed1200f0a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sed1200f0a_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; @@ -70,7 +70,7 @@ protected: class sed1200d0b_device : public sed1200_device { public: - sed1200d0b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sed1200d0b_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; @@ -78,7 +78,7 @@ protected: class sed1200f0b_device : public sed1200_device { public: - sed1200f0b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sed1200f0b_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/devices/video/sed1330.cpp b/src/devices/video/sed1330.cpp index 71c4a9fd069..acce37b1806 100644 --- a/src/devices/video/sed1330.cpp +++ b/src/devices/video/sed1330.cpp @@ -86,7 +86,7 @@ ROM_END // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT8 sed1330_device::readbyte(offs_t address) +inline uint8_t sed1330_device::readbyte(offs_t address) { return space().read_byte(address); } @@ -96,7 +96,7 @@ inline UINT8 sed1330_device::readbyte(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void sed1330_device::writebyte(offs_t address, UINT8 data) +inline void sed1330_device::writebyte(offs_t address, uint8_t data) { space().write_byte(address, data); } @@ -138,7 +138,7 @@ inline void sed1330_device::increment_csr() // sed1330_device - constructor //------------------------------------------------- -sed1330_device::sed1330_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sed1330_device::sed1330_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SED1330, "SED1330", tag, owner, clock, "sed1330", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -278,7 +278,7 @@ WRITE8_MEMBER( sed1330_device::command_w ) READ8_MEMBER( sed1330_device::data_r ) { - UINT8 data = readbyte(m_csr); + uint8_t data = readbyte(m_csr); if (LOG) logerror("SED1330 '%s' Memory Read %02x from %04x\n", tag(), data, m_csr); @@ -567,7 +567,7 @@ WRITE8_MEMBER( sed1330_device::data_w ) // draw_text_scanline - //------------------------------------------------- -void sed1330_device::draw_text_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 va) +void sed1330_device::draw_text_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, uint16_t va) { int sx, x; @@ -608,13 +608,13 @@ void sed1330_device::draw_text_scanline(bitmap_ind16 &bitmap, const rectangle &c // draw_graphics_scanline - //------------------------------------------------- -void sed1330_device::draw_graphics_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 va) +void sed1330_device::draw_graphics_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, uint16_t va) { int sx, x; for (sx = 0; sx < m_cr; sx++) { - UINT8 data = readbyte(va++); + uint8_t data = readbyte(va++); for (x = 0; x < m_fx; x++) { @@ -646,10 +646,10 @@ void sed1330_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect { for (y = 0; y < m_sl1; y++) { - UINT16 sad1 = m_sad1 + ((y / m_fy) * m_ap); - UINT16 sad2 = m_sad2 + (y * m_ap); - UINT16 sad3 = m_sad3 + ((y / m_fy) * m_ap); - UINT16 sad4 = m_sad4 + (y * m_ap); + uint16_t sad1 = m_sad1 + ((y / m_fy) * m_ap); + uint16_t sad2 = m_sad2 + (y * m_ap); + uint16_t sad3 = m_sad3 + ((y / m_fy) * m_ap); + uint16_t sad4 = m_sad4 + (y * m_ap); // draw graphics display page 2 scanline draw_graphics_scanline(bitmap, cliprect, y, sad2); @@ -671,7 +671,7 @@ void sed1330_device::update_text(bitmap_ind16 &bitmap, const rectangle &cliprect // screen_update - //------------------------------------------------- -UINT32 sed1330_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sed1330_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_d) { diff --git a/src/devices/video/sed1330.h b/src/devices/video/sed1330.h index 135caeca01b..5f4ceba6a0c 100644 --- a/src/devices/video/sed1330.h +++ b/src/devices/video/sed1330.h @@ -38,7 +38,7 @@ class sed1330_device : public device_t, { public: // construction/destruction - sed1330_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sed1330_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; @@ -49,7 +49,7 @@ public: DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( data_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 @@ -59,26 +59,26 @@ protected: // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; - inline UINT8 readbyte(offs_t address); - inline void writebyte(offs_t address, UINT8 m_data); + inline uint8_t readbyte(offs_t address); + inline void writebyte(offs_t address, uint8_t m_data); inline void increment_csr(); - void draw_text_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 va); - void draw_graphics_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, UINT16 va); + void draw_text_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, uint16_t va); + void draw_graphics_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, uint16_t va); void update_graphics(bitmap_ind16 &bitmap, const rectangle &cliprect); void update_text(bitmap_ind16 &bitmap, const rectangle &cliprect); private: int m_bf; // busy flag - UINT8 m_ir; // instruction register - UINT8 m_dor; // data output register + uint8_t m_ir; // instruction register + uint8_t m_dor; // data output register int m_pbc; // parameter byte counter int m_d; // display enabled int m_sleep; // sleep mode - UINT16 m_sag; // character generator RAM start address + uint16_t m_sag; // character generator RAM start address int m_m0; // character generator ROM (0=internal, 1=external) int m_m1; // character generator RAM D6 correction (0=no, 1=yes) int m_m2; // height of character bitmaps (0=8, 1=16 pixels) @@ -91,18 +91,18 @@ private: int m_cr; // visible line width in characters int m_tcr; // total line width in characters (including horizontal blanking) int m_lf; // frame height in lines - UINT16 m_ap; // virtual screen line width in characters + uint16_t m_ap; // virtual screen line width in characters - UINT16 m_sad1; // display page 1 start address - UINT16 m_sad2; // display page 2 start address - UINT16 m_sad3; // display page 3 start address - UINT16 m_sad4; // display page 4 start address + uint16_t m_sad1; // display page 1 start address + uint16_t m_sad2; // display page 2 start address + uint16_t m_sad3; // display page 3 start address + uint16_t m_sad4; // display page 4 start address int m_sl1; // display block 1 height in lines int m_sl2; // display block 2 height in lines int m_hdotscr; // horizontal dot scroll in pixels int m_fp; // display page flash control - UINT16 m_csr; // cursor address register + uint16_t m_csr; // cursor address register int m_cd; // cursor increment direction int m_crx; // cursor width int m_cry; // cursor height or location diff --git a/src/devices/video/sed1520.cpp b/src/devices/video/sed1520.cpp index d868600595c..7d65e9a76af 100644 --- a/src/devices/video/sed1520.cpp +++ b/src/devices/video/sed1520.cpp @@ -28,7 +28,7 @@ const device_type SED1520 = &device_creator; // sed1520_device - constructor //------------------------------------------------- -sed1520_device::sed1520_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sed1520_device::sed1520_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SED1520, "SED1520", tag, owner, clock, "sed1520", __FILE__), m_lcd_on(0), m_busy(0), m_page(0), m_column(0), m_old_column(0), m_start_line(0), m_adc(0), m_static_drive(0), m_modify_write(false), m_screen_update_func(nullptr) @@ -78,7 +78,7 @@ void sed1520_device::device_reset() // device interface //************************************************************************** -UINT32 sed1520_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sed1520_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_lcd_on) { @@ -146,7 +146,7 @@ WRITE8_MEMBER(sed1520_device::control_write) READ8_MEMBER(sed1520_device::status_read) { - UINT8 data = (m_busy << 7) | (m_adc << 6) | (m_lcd_on << 5); + uint8_t data = (m_busy << 7) | (m_adc << 6) | (m_lcd_on << 5); return data; } @@ -158,7 +158,7 @@ WRITE8_MEMBER(sed1520_device::data_write) READ8_MEMBER(sed1520_device::data_read) { - UINT8 data = m_vram[(m_page * 80 + m_column) % sizeof(m_vram)]; + uint8_t data = m_vram[(m_page * 80 + m_column) % sizeof(m_vram)]; if (!m_modify_write) m_column = (m_column + 1) % 80; return data; diff --git a/src/devices/video/sed1520.h b/src/devices/video/sed1520.h index 654fd010060..29bc5b1dd15 100644 --- a/src/devices/video/sed1520.h +++ b/src/devices/video/sed1520.h @@ -20,8 +20,8 @@ // TYPE DEFINITIONS //************************************************************************** -typedef UINT32 (*sed1520_screen_update_func)(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *vram, int start_line, int adc); -#define SED1520_UPDATE_CB(name) UINT32 name(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *vram, int start_line, int adc) +typedef uint32_t (*sed1520_screen_update_func)(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *vram, int start_line, int adc); +#define SED1520_UPDATE_CB(name) uint32_t name(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *vram, int start_line, int adc) // ======================> sed1520_device @@ -30,7 +30,7 @@ class sed1520_device : public device_t { public: // construction/destruction - sed1520_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sed1520_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers static void static_set_screen_update_cb(device_t &device, sed1520_screen_update_func _cb) { downcast(device).m_screen_update_func = _cb; } @@ -42,7 +42,7 @@ public: virtual DECLARE_READ8_MEMBER(status_read); virtual DECLARE_WRITE8_MEMBER(data_write); virtual DECLARE_READ8_MEMBER(data_read); - 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 @@ -51,18 +51,18 @@ protected: private: // internal state - UINT8 m_lcd_on; - UINT8 m_busy; - UINT8 m_page; - UINT8 m_column; - UINT8 m_old_column; - UINT8 m_start_line; - UINT8 m_adc; - UINT8 m_static_drive; + uint8_t m_lcd_on; + uint8_t m_busy; + uint8_t m_page; + uint8_t m_column; + uint8_t m_old_column; + uint8_t m_start_line; + uint8_t m_adc; + uint8_t m_static_drive; bool m_modify_write; sed1520_screen_update_func m_screen_update_func; - UINT8 m_vram[0x140]; + uint8_t m_vram[0x140]; }; diff --git a/src/devices/video/snes_ppu.cpp b/src/devices/video/snes_ppu.cpp index 603b19e1a93..4a585fa94b7 100644 --- a/src/devices/video/snes_ppu.cpp +++ b/src/devices/video/snes_ppu.cpp @@ -157,10 +157,10 @@ #if SNES_LAYER_DEBUG /* red green blue purple yellow cyan grey white */ -static const UINT16 dbg_mode_colours[8] = { 0x1f, 0x3e0, 0x7c00, 0x7c1f, 0x3ff, 0x7fe0, 0x4210, 0x7fff }; +static const uint16_t dbg_mode_colours[8] = { 0x1f, 0x3e0, 0x7c00, 0x7c1f, 0x3ff, 0x7fe0, 0x4210, 0x7fff }; #endif /* SNES_LAYER_DEBUG */ -static const UINT16 table_obj_offset[8][8] = +static const uint16_t table_obj_offset[8][8] = { { (0*32), (0*32)+32, (0*32)+64, (0*32)+96, (0*32)+128, (0*32)+160, (0*32)+192, (0*32)+224 }, { (16*32), (16*32)+32, (16*32)+64, (16*32)+96, (16*32)+128, (16*32)+160, (16*32)+192, (16*32)+224 }, @@ -200,7 +200,7 @@ const device_type SNES_PPU = &device_creator; // snes_ppu_device - constructor //------------------------------------------------- -snes_ppu_device::snes_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +snes_ppu_device::snes_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES_PPU, "SNES PPU", tag, owner, clock, "snes_ppu", __FILE__), device_video_interface(mconfig, *this), m_openbus_cb(*this), @@ -221,9 +221,9 @@ void snes_ppu_device::device_start() { m_openbus_cb.resolve_safe(0); - m_vram = std::make_unique(SNES_VRAM_SIZE); - m_cgram = std::make_unique(SNES_CGRAM_SIZE/2); - m_oam_ram = std::make_unique(SNES_OAM_SIZE/2); + m_vram = std::make_unique(SNES_VRAM_SIZE); + m_cgram = std::make_unique(SNES_CGRAM_SIZE/2); + m_oam_ram = std::make_unique(SNES_OAM_SIZE/2); for (int i = 0; i < 2; i++) { @@ -404,10 +404,10 @@ void snes_ppu_device::device_reset() memset(m_vram.get(), 0, SNES_VRAM_SIZE); /* Init Palette RAM */ - memset((UINT8 *)m_cgram.get(), 0, SNES_CGRAM_SIZE); + memset((uint8_t *)m_cgram.get(), 0, SNES_CGRAM_SIZE); /* Init oam RAM */ - memset((UINT8 *)m_oam_ram.get(), 0xff, SNES_OAM_SIZE); + memset((uint8_t *)m_oam_ram.get(), 0xff, SNES_OAM_SIZE); // other initializations to 0 memset(m_regs, 0, sizeof(m_regs)); @@ -478,9 +478,9 @@ void snes_ppu_device::device_reset() * Get the proper color (direct or from cgram) *****************************************/ -inline UINT16 snes_ppu_device::get_bgcolor( UINT8 direct_colors, UINT16 palette, UINT8 color ) +inline uint16_t snes_ppu_device::get_bgcolor( uint8_t direct_colors, uint16_t palette, uint8_t color ) { - UINT16 c; + uint16_t c; if (direct_colors) { @@ -502,7 +502,7 @@ inline UINT16 snes_ppu_device::get_bgcolor( UINT8 direct_colors, UINT16 palette, * proper scanline *****************************************/ -inline void snes_ppu_device::set_scanline_pixel( int screen, INT16 x, UINT16 color, UINT8 priority, UINT8 layer, int blend ) +inline void snes_ppu_device::set_scanline_pixel( int screen, int16_t x, uint16_t color, uint8_t priority, uint8_t layer, int blend ) { m_scanlines[screen].buffer[x] = color; m_scanlines[screen].priority[x] = priority; @@ -533,10 +533,10 @@ inline void snes_ppu_device::set_scanline_pixel( int screen, INT16 x, UINT16 col * or lores) *****************************************/ -inline void snes_ppu_device::draw_bgtile_lores( UINT8 layer, INT16 ii, UINT8 colour, UINT16 pal, UINT8 direct_colors, UINT8 priority ) +inline void snes_ppu_device::draw_bgtile_lores( uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority ) { int screen; - UINT16 c; + uint16_t c; for (screen = SNES_MAINSCREEN; screen <= SNES_SUBSCREEN; screen++) { @@ -544,8 +544,8 @@ inline void snes_ppu_device::draw_bgtile_lores( UINT8 layer, INT16 ii, UINT8 col { if (m_scanlines[screen].priority[ii] <= priority) { - UINT8 clr = colour; - UINT8 clipmask = m_clipmasks[layer][ii]; + uint8_t clr = colour; + uint8_t clipmask = m_clipmasks[layer][ii]; #if SNES_LAYER_DEBUG if (m_debug_options.windows_disabled) @@ -567,10 +567,10 @@ inline void snes_ppu_device::draw_bgtile_lores( UINT8 layer, INT16 ii, UINT8 col } } -inline void snes_ppu_device::draw_bgtile_hires( UINT8 layer, INT16 ii, UINT8 colour, UINT16 pal, UINT8 direct_colors, UINT8 priority ) +inline void snes_ppu_device::draw_bgtile_hires( uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority ) { int screen; - UINT16 c; + uint16_t c; for (screen = SNES_MAINSCREEN; screen <= SNES_SUBSCREEN; screen++) { @@ -579,8 +579,8 @@ inline void snes_ppu_device::draw_bgtile_hires( UINT8 layer, INT16 ii, UINT8 col { if (m_scanlines[screen].priority[ii >> 1] <= priority) { - UINT8 clr = colour; - UINT8 clipmask = m_clipmasks[layer][ii >> 1]; + uint8_t clr = colour; + uint8_t clipmask = m_clipmasks[layer][ii >> 1]; #if SNES_LAYER_DEBUG if (m_debug_options.windows_disabled) @@ -602,19 +602,19 @@ inline void snes_ppu_device::draw_bgtile_hires( UINT8 layer, INT16 ii, UINT8 col } } -inline void snes_ppu_device::draw_oamtile( INT16 ii, UINT8 colour, UINT16 pal, UINT8 priority ) +inline void snes_ppu_device::draw_oamtile( int16_t ii, uint8_t colour, uint16_t pal, uint8_t priority ) { int screen; int blend; - UINT16 c; - INT16 pos = ii & 0x1ff; + uint16_t c; + int16_t pos = ii & 0x1ff; for (screen = SNES_MAINSCREEN; screen <= SNES_SUBSCREEN; screen++) { if (pos >= 0 && pos < SNES_SCR_WIDTH && m_scanlines[screen].enable) { - UINT8 clr = colour; - UINT8 clipmask = m_clipmasks[SNES_OAM][pos]; + uint8_t clr = colour; + uint8_t clipmask = m_clipmasks[SNES_OAM][pos]; #if SNES_LAYER_DEBUG if (m_debug_options.windows_disabled) @@ -645,10 +645,10 @@ inline void snes_ppu_device::draw_oamtile( INT16 ii, UINT8 colour, UINT16 pal, U * (depending on layer and resolution) *****************************************/ -inline void snes_ppu_device::draw_tile( UINT8 planes, UINT8 layer, UINT32 tileaddr, INT16 x, UINT8 priority, UINT8 flip, UINT8 direct_colors, UINT16 pal, UINT8 hires ) +inline void snes_ppu_device::draw_tile( uint8_t planes, uint8_t layer, uint32_t tileaddr, int16_t x, uint8_t priority, uint8_t flip, uint8_t direct_colors, uint16_t pal, uint8_t hires ) { - UINT8 plane[8]; - INT16 ii, jj; + uint8_t plane[8]; + int16_t ii, jj; int x_mos; for (ii = 0; ii < planes / 2; ii++) @@ -659,8 +659,8 @@ inline void snes_ppu_device::draw_tile( UINT8 planes, UINT8 layer, UINT32 tilead for (ii = x; ii < (x + 8); ii++) { - UINT8 colour = 0; - UINT8 mosaic = m_layer[layer].mosaic_enabled; + uint8_t colour = 0; + uint8_t mosaic = m_layer[layer].mosaic_enabled; #if SNES_LAYER_DEBUG if (m_debug_options.mosaic_disabled) @@ -728,9 +728,9 @@ inline void snes_ppu_device::draw_tile( UINT8 planes, UINT8 layer, UINT32 tilead * Find the address in VRAM of the tile (x,y) *********************************************/ -inline UINT32 snes_ppu_device::get_tmap_addr( UINT8 layer, UINT8 tile_size, UINT32 base, UINT32 x, UINT32 y ) +inline uint32_t snes_ppu_device::get_tmap_addr( uint8_t layer, uint8_t tile_size, uint32_t base, uint32_t x, uint32_t y ) { - UINT32 res = base; + uint32_t res = base; x >>= (3 + tile_size); y >>= (3 + tile_size); @@ -751,19 +751,19 @@ inline UINT32 snes_ppu_device::get_tmap_addr( UINT8 layer, UINT8 tile_size, UINT * Update an entire line of tiles. *********************************************/ -inline void snes_ppu_device::update_line( UINT16 curline, UINT8 layer, UINT8 priority_b, UINT8 priority_a, UINT8 color_depth, UINT8 hires, UINT8 offset_per_tile, UINT8 direct_colors ) +inline void snes_ppu_device::update_line( uint16_t curline, uint8_t layer, uint8_t priority_b, uint8_t priority_a, uint8_t color_depth, uint8_t hires, uint8_t offset_per_tile, uint8_t direct_colors ) { - UINT32 tmap, tile, xoff, yoff, charaddr, addr; - UINT16 ii = 0, vflip, hflip, pal, pal_direct, tilemap; - UINT8 xscroll, priority; - INT8 yscroll; + uint32_t tmap, tile, xoff, yoff, charaddr, addr; + uint16_t ii = 0, vflip, hflip, pal, pal_direct, tilemap; + uint8_t xscroll, priority; + int8_t yscroll; int tile_incr = 0; - UINT16 opt_bit = (layer == SNES_BG1) ? 13 : (layer == SNES_BG2) ? 14 : 0; - UINT8 tile_size; + uint16_t opt_bit = (layer == SNES_BG1) ? 13 : (layer == SNES_BG2) ? 14 : 0; + uint8_t tile_size; /* variables depending on color_depth */ - UINT8 color_planes = 2 << color_depth; + uint8_t color_planes = 2 << color_depth; /* below we cheat to simplify the code: 8BPP should have 0 pal offset, not 0x100 (but we take care of this by later using pal % FIXED_COLOUR) */ - UINT8 color_shift = 2 << color_depth; + uint8_t color_shift = 2 << color_depth; #if SNES_LAYER_DEBUG if (m_debug_options.bg_disabled[layer]) @@ -801,14 +801,14 @@ inline void snes_ppu_device::update_line( UINT16 curline, UINT8 layer, UINT8 pri while (ii < 256 + (8 << tile_size)) { // determine the horizontal position (Bishojo Janshi Suchi Pai & Desert Figther have tile_size & hires == 1) - UINT32 xpos = xoff + (ii << (tile_size * hires)); - UINT32 ypos = yoff + curline; + uint32_t xpos = xoff + (ii << (tile_size * hires)); + uint32_t ypos = yoff + curline; if (offset_per_tile != SNES_OPT_NONE) { int opt_x = ii + (xoff & 7); - UINT32 haddr, vaddr; - UINT16 hval, vval; + uint32_t haddr, vaddr; + uint16_t hval, vval; if (opt_x >= 8) { @@ -936,15 +936,15 @@ inline void snes_ppu_device::update_line( UINT16 curline, UINT8 layer, UINT8 pri #define MODE7_CLIP(x) (((x) & 0x2000) ? ((x) | ~0x03ff) : ((x) & 0x03ff)) -void snes_ppu_device::update_line_mode7( UINT16 curline, UINT8 layer, UINT8 priority_b, UINT8 priority_a ) +void snes_ppu_device::update_line_mode7( uint16_t curline, uint8_t layer, uint8_t priority_b, uint8_t priority_a ) { - UINT32 tiled; - INT16 ma, mb, mc, md; - INT32 xc, yc, tx, ty, sx, sy, hs, vs, xpos, xdir, x0, y0; - UINT8 priority = priority_b; - UINT8 colour = 0; - UINT16 *mosaic_x, *mosaic_y; - UINT16 c; + uint32_t tiled; + int16_t ma, mb, mc, md; + int32_t xc, yc, tx, ty, sx, sy, hs, vs, xpos, xdir, x0, y0; + uint8_t priority = priority_b; + uint8_t colour = 0; + uint16_t *mosaic_x, *mosaic_y; + uint16_t c; int screen; #if SNES_LAYER_DEBUG @@ -1073,8 +1073,8 @@ void snes_ppu_device::update_line_mode7( UINT16 curline, UINT8 layer, UINT8 prio { if (m_scanlines[screen].enable) { - UINT8 clr = colour; - UINT8 clipmask = m_clipmasks[layer][xpos]; + uint8_t clr = colour; + uint8_t clipmask = m_clipmasks[layer][xpos]; #if SNES_LAYER_DEBUG if (m_debug_options.windows_disabled) @@ -1162,10 +1162,10 @@ void snes_ppu_device::update_obsel( void ) void snes_ppu_device::oam_list_build( void ) { - UINT8 *oamram = (UINT8 *)m_oam_ram.get(); - INT16 oam = 0x1ff; - UINT16 oam_extra = oam + 0x20; - UINT16 extra = 0; + uint8_t *oamram = (uint8_t *)m_oam_ram.get(); + int16_t oam = 0x1ff; + uint16_t oam_extra = oam + 0x20; + uint16_t extra = 0; int ii; m_update_oam_list = 0; // eventually, we can optimize the code by only calling this function when there is a change in size @@ -1247,7 +1247,7 @@ void snes_ppu_device::oam_list_build( void ) * scanline *********************************************/ -int snes_ppu_device::is_sprite_on_scanline( UINT16 curline, UINT8 sprite ) +int snes_ppu_device::is_sprite_on_scanline( uint16_t curline, uint8_t sprite ) { //if sprite is entirely offscreen and doesn't wrap around to the left side of the screen, //then it is not counted. this *should* be 256, and not 255, even though dot 256 is offscreen. @@ -1272,16 +1272,16 @@ int snes_ppu_device::is_sprite_on_scanline( UINT16 curline, UINT8 sprite ) * scanline. *********************************************/ -void snes_ppu_device::update_objects_rto( UINT16 curline ) +void snes_ppu_device::update_objects_rto( uint16_t curline ) { int ii, jj, active_sprite; - UINT8 range_over, time_over; - INT8 xs, ys; - UINT8 line; - UINT8 height, width, vflip, hflip, priority, pal; - UINT16 tile; - INT16 x, y; - UINT32 name_sel; + uint8_t range_over, time_over; + int8_t xs, ys; + uint8_t line; + uint8_t height, width, vflip, hflip, priority, pal; + uint16_t tile; + int16_t x, y; + uint32_t name_sel; oam_list_build(); @@ -1353,7 +1353,7 @@ void snes_ppu_device::update_objects_rto( UINT16 curline ) for (jj = 0; jj < width; jj++) { - INT16 xx = (x + (jj << 3)) & 0x1ff; + int16_t xx = (x + (jj << 3)) & 0x1ff; if (x != 256 && xx >= 256 && (xx + 7) < 512) continue; @@ -1386,10 +1386,10 @@ void snes_ppu_device::update_objects_rto( UINT16 curline ) * Update an entire line of sprites. *********************************************/ -void snes_ppu_device::update_objects( UINT8 priority_oam0, UINT8 priority_oam1, UINT8 priority_oam2, UINT8 priority_oam3 ) +void snes_ppu_device::update_objects( uint8_t priority_oam0, uint8_t priority_oam1, uint8_t priority_oam2, uint8_t priority_oam3 ) { - UINT8 pri, priority[4]; - UINT32 charaddr; + uint8_t pri, priority[4]; + uint32_t charaddr; int ii; #if SNES_LAYER_DEBUG @@ -1447,7 +1447,7 @@ void snes_ppu_device::update_objects( UINT8 priority_oam0, UINT8 priority_oam1, * Update Mode X line. *********************************************/ -void snes_ppu_device::update_mode_0( UINT16 curline ) +void snes_ppu_device::update_mode_0( uint16_t curline ) { #if SNES_LAYER_DEBUG if (m_debug_options.mode_disabled[0]) @@ -1461,7 +1461,7 @@ void snes_ppu_device::update_mode_0( UINT16 curline ) update_line(curline, SNES_BG4, 1, 4, SNES_COLOR_DEPTH_2BPP, 0, SNES_OPT_NONE, 0); } -void snes_ppu_device::update_mode_1( UINT16 curline ) +void snes_ppu_device::update_mode_1( uint16_t curline ) { #if SNES_LAYER_DEBUG if (m_debug_options.mode_disabled[1]) @@ -1484,7 +1484,7 @@ void snes_ppu_device::update_mode_1( UINT16 curline ) } } -void snes_ppu_device::update_mode_2( UINT16 curline ) +void snes_ppu_device::update_mode_2( uint16_t curline ) { #if SNES_LAYER_DEBUG if (m_debug_options.mode_disabled[2]) @@ -1496,7 +1496,7 @@ void snes_ppu_device::update_mode_2( UINT16 curline ) update_line(curline, SNES_BG2, 1, 5, SNES_COLOR_DEPTH_4BPP, 0, SNES_OPT_MODE2, 0); } -void snes_ppu_device::update_mode_3( UINT16 curline ) +void snes_ppu_device::update_mode_3( uint16_t curline ) { #if SNES_LAYER_DEBUG if (m_debug_options.mode_disabled[3]) @@ -1508,7 +1508,7 @@ void snes_ppu_device::update_mode_3( UINT16 curline ) update_line(curline, SNES_BG2, 1, 5, SNES_COLOR_DEPTH_4BPP, 0, SNES_OPT_NONE, 0); } -void snes_ppu_device::update_mode_4( UINT16 curline ) +void snes_ppu_device::update_mode_4( uint16_t curline ) { #if SNES_LAYER_DEBUG if (m_debug_options.mode_disabled[4]) @@ -1520,7 +1520,7 @@ void snes_ppu_device::update_mode_4( UINT16 curline ) update_line(curline, SNES_BG2, 1, 5, SNES_COLOR_DEPTH_2BPP, 0, SNES_OPT_MODE4, 0); } -void snes_ppu_device::update_mode_5( UINT16 curline ) +void snes_ppu_device::update_mode_5( uint16_t curline ) { #if SNES_LAYER_DEBUG if (m_debug_options.mode_disabled[5]) @@ -1532,7 +1532,7 @@ void snes_ppu_device::update_mode_5( UINT16 curline ) update_line(curline, SNES_BG2, 1, 5, SNES_COLOR_DEPTH_2BPP, 1, SNES_OPT_NONE, 0); } -void snes_ppu_device::update_mode_6( UINT16 curline ) +void snes_ppu_device::update_mode_6( uint16_t curline ) { #if SNES_LAYER_DEBUG if (m_debug_options.mode_disabled[6]) @@ -1543,7 +1543,7 @@ void snes_ppu_device::update_mode_6( UINT16 curline ) update_line(curline, SNES_BG1, 2, 5, SNES_COLOR_DEPTH_4BPP, 1, SNES_OPT_MODE6, 0); } -void snes_ppu_device::update_mode_7( UINT16 curline ) +void snes_ppu_device::update_mode_7( uint16_t curline ) { #if SNES_LAYER_DEBUG if (m_debug_options.mode_disabled[7]) @@ -1569,7 +1569,7 @@ void snes_ppu_device::update_mode_7( UINT16 curline ) * Draw the whole screen (Mode 0 -> 7). *********************************************/ -void snes_ppu_device::draw_screens( UINT16 curline ) +void snes_ppu_device::draw_screens( uint16_t curline ) { switch (m_mode) { @@ -1599,8 +1599,8 @@ void snes_ppu_device::draw_screens( UINT16 curline ) void snes_ppu_device::update_windowmasks( void ) { - UINT16 ii, jj; - INT8 w1, w2; + uint16_t ii, jj; + int8_t w1, w2; m_update_windows = 0; /* reset the flag */ @@ -1688,7 +1688,7 @@ void snes_ppu_device::update_offsets( void ) * color math. *****************************************/ -inline void snes_ppu_device::draw_blend( UINT16 offset, UINT16 *colour, UINT8 prevent_color_math, UINT8 black_pen_clip, int switch_screens ) +inline void snes_ppu_device::draw_blend( uint16_t offset, uint16_t *colour, uint8_t prevent_color_math, uint8_t black_pen_clip, int switch_screens ) { #if SNES_LAYER_DEBUG if (m_debug_options.colormath_disabled) @@ -1712,7 +1712,7 @@ inline void snes_ppu_device::draw_blend( UINT16 offset, UINT16 *colour, UINT8 pr (prevent_color_math == SNES_CLIP_IN && !m_clipmasks[SNES_COLOR][offset]) || (prevent_color_math == SNES_CLIP_OUT && m_clipmasks[SNES_COLOR][offset])) { - UINT16 r, g, b; + uint16_t r, g, b; struct SNES_SCANLINE *subscreen; int clip_max = 0; // if add then clip to 0x1f, if sub then clip to 0 @@ -1816,14 +1816,14 @@ inline void snes_ppu_device::draw_blend( UINT16 offset, UINT16 *colour, UINT8 pr * the optimized averaging algorithm. *********************************************/ -void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, UINT16 curline ) +void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline ) { - UINT16 ii; + uint16_t ii; int x; int fade; struct SNES_SCANLINE *scanline1, *scanline2; - UINT16 c; - UINT16 prev_colour = 0; + uint16_t c; + uint16_t prev_colour = 0; int blurring = m_options.read_safe(0) & 0x01; g_profiler.start(PROFILER_VIDEO); @@ -1898,7 +1898,7 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, UINT16 curline ) for (x = 0; x < SNES_SCR_WIDTH; x++) { int r, g, b, hires; - UINT16 tmp_col[2]; + uint16_t tmp_col[2]; hires = (m_mode != 5 && m_mode != 6 && !m_pseudo_hires) ? 0 : 1; /* in hires, the first pixel (of 512) is subscreen pixel, then the first mainscreen pixel follows, and so on... */ @@ -1979,12 +1979,12 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, UINT16 curline ) /* CPU <-> PPU comms */ // full graphic variables -static const UINT16 vram_fgr_inctab[4] = { 1, 32, 128, 128 }; -static const UINT16 vram_fgr_inccnts[4] = { 0, 32, 64, 128 }; -static const UINT16 vram_fgr_shiftab[4] = { 0, 5, 6, 7 }; +static const uint16_t vram_fgr_inctab[4] = { 1, 32, 128, 128 }; +static const uint16_t vram_fgr_inccnts[4] = { 0, 32, 64, 128 }; +static const uint16_t vram_fgr_shiftab[4] = { 0, 5, 6, 7 }; // utility function - latches the H/V counters. Used by IRQ, writes to WRIO, etc. -void snes_ppu_device::set_latch_hv(INT16 x, INT16 y) +void snes_ppu_device::set_latch_hv(int16_t x, int16_t y) { m_beam.latch_vert = y; m_beam.latch_horz = x; @@ -2037,14 +2037,14 @@ void snes_ppu_device::dynamic_res_change() when interlace is active. *************************************************/ -inline UINT32 snes_ppu_device::get_vram_address() +inline uint32_t snes_ppu_device::get_vram_address() { - UINT32 addr = m_vmadd; + uint32_t addr = m_vmadd; if (m_vram_fgr_count) { - UINT32 rem = addr & m_vram_fgr_mask; - UINT32 faddr = (addr & ~m_vram_fgr_mask) + (rem >> m_vram_fgr_shift) + ((rem & (m_vram_fgr_count - 1)) << 3); + uint32_t rem = addr & m_vram_fgr_mask; + uint32_t faddr = (addr & ~m_vram_fgr_mask) + (rem >> m_vram_fgr_shift) + ((rem & (m_vram_fgr_count - 1)) << 3); return faddr << 1; } @@ -2053,16 +2053,16 @@ inline UINT32 snes_ppu_device::get_vram_address() READ8_MEMBER( snes_ppu_device::vram_read ) { - UINT8 res; + uint8_t res; offset &= 0xffff; // only 64KB are present on SNES if (m_screen_disabled) res = m_vram[offset]; else { - UINT16 v = m_screen->vpos(); - UINT16 h = m_screen->hpos(); - UINT16 ls = (((m_stat78 & 0x10) == SNES_NTSC ? 525 : 625) >> 1) - 1; + uint16_t v = m_screen->vpos(); + uint16_t h = m_screen->hpos(); + uint16_t ls = (((m_stat78 & 0x10) == SNES_NTSC ? 525 : 625) >> 1) - 1; if (m_interlace == 2) ls++; @@ -2095,8 +2095,8 @@ WRITE8_MEMBER( snes_ppu_device::vram_write ) m_vram[offset] = data; else { - UINT16 v = m_screen->vpos(); - UINT16 h = m_screen->hpos(); + uint16_t v = m_screen->vpos(); + uint16_t h = m_screen->hpos(); if (v == 0) { if (h <= 4) @@ -2161,7 +2161,7 @@ READ8_MEMBER( snes_ppu_device::oam_read ) if (!m_screen_disabled) { - UINT16 v = m_screen->vpos(); + uint16_t v = m_screen->vpos(); if (v < m_beam.last_visible_line) offset = 0x010c; @@ -2179,7 +2179,7 @@ WRITE8_MEMBER( snes_ppu_device::oam_write ) if (!m_screen_disabled) { - UINT16 v = m_screen->vpos(); + uint16_t v = m_screen->vpos(); if (v < m_beam.last_visible_line) offset = 0x010c; @@ -2214,21 +2214,21 @@ WRITE8_MEMBER( snes_ppu_device::oam_write ) READ8_MEMBER( snes_ppu_device::cgram_read ) { - UINT8 res; + uint8_t res; offset &= 0x1ff; #if 0 if (!m_screen_disabled) { - UINT16 v = m_screen->vpos(); - UINT16 h = m_screen->hpos(); + uint16_t v = m_screen->vpos(); + uint16_t h = m_screen->hpos(); if (v < m_beam.last_visible_line && h >= 128 && h < 1096) offset = 0x1ff; } #endif - res = ((UINT8 *)m_cgram.get())[offset]; + res = ((uint8_t *)m_cgram.get())[offset]; // CGRAM palette data format is 15-bits (0,bbbbb,ggggg,rrrrr). // Highest bit is simply ignored. @@ -2248,8 +2248,8 @@ WRITE8_MEMBER( snes_ppu_device::cgram_write ) // writes to the cgram address if (!m_screen_disabled) { - UINT16 v = m_screen->vpos(); - UINT16 h = m_screen->hpos(); + uint16_t v = m_screen->vpos(); + uint16_t h = m_screen->hpos(); if (v < m_beam.last_visible_line && h >= 128 && h < 1096) offset = 0x1ff; @@ -2261,12 +2261,12 @@ WRITE8_MEMBER( snes_ppu_device::cgram_write ) if (offset & 0x01) data &= 0x7f; - ((UINT8 *)m_cgram.get())[offset] = data; + ((uint8_t *)m_cgram.get())[offset] = data; } -UINT8 snes_ppu_device::read(address_space &space, UINT32 offset, UINT8 wrio_bit7) +uint8_t snes_ppu_device::read(address_space &space, uint32_t offset, uint8_t wrio_bit7) { - UINT8 value; + uint8_t value; switch (offset) { @@ -2293,21 +2293,21 @@ UINT8 snes_ppu_device::read(address_space &space, UINT32 offset, UINT8 wrio_bit7 case MPYL: /* Multiplication result (low) */ { /* Perform 16bit * 8bit multiply */ - UINT32 c = (INT16)m_mode7.matrix_a * (INT8)(m_mode7.matrix_b >> 8); + uint32_t c = (int16_t)m_mode7.matrix_a * (int8_t)(m_mode7.matrix_b >> 8); m_ppu1_open_bus = c & 0xff; return m_ppu1_open_bus; } case MPYM: /* Multiplication result (mid) */ { /* Perform 16bit * 8bit multiply */ - UINT32 c = (INT16)m_mode7.matrix_a * (INT8)(m_mode7.matrix_b >> 8); + uint32_t c = (int16_t)m_mode7.matrix_a * (int8_t)(m_mode7.matrix_b >> 8); m_ppu1_open_bus = (c >> 8) & 0xff; return m_ppu1_open_bus; } case MPYH: /* Multiplication result (high) */ { /* Perform 16bit * 8bit multiply */ - UINT32 c = (INT16)m_mode7.matrix_a * (INT8)(m_mode7.matrix_b >> 8); + uint32_t c = (int16_t)m_mode7.matrix_a * (int8_t)(m_mode7.matrix_b >> 8); m_ppu1_open_bus = (c >> 16) & 0xff; return m_ppu1_open_bus; } @@ -2327,7 +2327,7 @@ UINT8 snes_ppu_device::read(address_space &space, UINT32 offset, UINT8 wrio_bit7 return m_ppu1_open_bus; case RVMDATAL: /* Read data from VRAM (low) */ { - UINT32 addr = get_vram_address(); + uint32_t addr = get_vram_address(); m_ppu1_open_bus = m_vram_read_buffer & 0xff; if (!m_vram_fgr_high) @@ -2342,7 +2342,7 @@ UINT8 snes_ppu_device::read(address_space &space, UINT32 offset, UINT8 wrio_bit7 } case RVMDATAH: /* Read data from VRAM (high) */ { - UINT32 addr = get_vram_address(); + uint32_t addr = get_vram_address(); m_ppu1_open_bus = (m_vram_read_buffer >> 8) & 0xff; if (m_vram_fgr_high) @@ -2413,7 +2413,7 @@ UINT8 snes_ppu_device::read(address_space &space, UINT32 offset, UINT8 wrio_bit7 } -void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) +void snes_ppu_device::write(address_space &space, uint32_t offset, uint8_t data) { switch (offset) { @@ -2573,7 +2573,7 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) break; case VMADDL: /* Address for VRAM read/write (low) */ { - UINT32 addr; + uint32_t addr; m_vmadd = (m_vmadd & 0xff00) | (data << 0); addr = get_vram_address(); m_vram_read_buffer = vram_read(space, addr); @@ -2582,7 +2582,7 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) break; case VMADDH: /* Address for VRAM read/write (high) */ { - UINT32 addr; + uint32_t addr; m_vmadd = (m_vmadd & 0x00ff) | (data << 8); addr = get_vram_address(); m_vram_read_buffer = vram_read(space, addr); @@ -2591,7 +2591,7 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) break; case VMDATAL: /* 2118: Data for VRAM write (low) */ { - UINT32 addr = get_vram_address(); + uint32_t addr = get_vram_address(); vram_write(space, addr, data); if (!m_vram_fgr_high) @@ -2600,7 +2600,7 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) return; case VMDATAH: /* 2119: Data for VRAM write (high) */ { - UINT32 addr = get_vram_address(); + uint32_t addr = get_vram_address(); vram_write(space, addr + 1, data); if (m_vram_fgr_high) @@ -2783,7 +2783,7 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) case COLDATA: /* Fixed colour data for fixed colour addition/subtraction */ { /* Store it in the extra space we made in the CGRAM. It doesn't really go there, but it's as good a place as any. */ - UINT8 r, g, b; + uint8_t r, g, b; /* Get existing value. */ r = m_cgram[FIXED_COLOUR] & 0x1f; @@ -2833,10 +2833,10 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) popmessage MSG2; \ } -UINT8 snes_ppu_device::dbg_video( UINT16 curline ) +uint8_t snes_ppu_device::dbg_video( uint16_t curline ) { int i; - UINT8 toggles = m_debug1.read_safe(0); + uint8_t toggles = m_debug1.read_safe(0); m_debug_options.select_pri[SNES_BG1] = (toggles & 0x03); m_debug_options.select_pri[SNES_BG2] = (toggles & 0x0c) >> 2; m_debug_options.select_pri[SNES_BG3] = (toggles & 0x30) >> 4; diff --git a/src/devices/video/snes_ppu.h b/src/devices/video/snes_ppu.h index 79bcf34f7b7..d8ca3fee814 100644 --- a/src/devices/video/snes_ppu.h +++ b/src/devices/video/snes_ppu.h @@ -57,10 +57,10 @@ struct SNES_SCANLINE { int enable, clip; - UINT16 buffer[SNES_SCR_WIDTH]; - UINT8 priority[SNES_SCR_WIDTH]; - UINT8 layer[SNES_SCR_WIDTH]; - UINT8 blend_exception[SNES_SCR_WIDTH]; + uint16_t buffer[SNES_SCR_WIDTH]; + uint8_t priority[SNES_SCR_WIDTH]; + uint8_t layer[SNES_SCR_WIDTH]; + uint8_t blend_exception[SNES_SCR_WIDTH]; }; // ======================> snes_ppu_device @@ -70,98 +70,98 @@ class snes_ppu_device : public device_t, { public: // construction/destruction - snes_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers template static devcb_base &static_set_open_bus_callback(device_t &device, _Object object) { return downcast(device).m_openbus_cb.set_callback(object); } - UINT8 m_regs[0x40]; + uint8_t m_regs[0x40]; SNES_SCANLINE m_scanlines[2]; struct { /* clipmasks */ - UINT8 window1_enabled, window1_invert; - UINT8 window2_enabled, window2_invert; - UINT8 wlog_mask; + uint8_t window1_enabled, window1_invert; + uint8_t window2_enabled, window2_invert; + uint8_t wlog_mask; /* color math enabled */ - UINT8 color_math; + uint8_t color_math; - UINT8 charmap; - UINT8 tilemap; - UINT8 tilemap_size; + uint8_t charmap; + uint8_t tilemap; + uint8_t tilemap_size; - UINT8 tile_size; - UINT8 mosaic_enabled; // actually used only for layers 0->3! + uint8_t tile_size; + uint8_t mosaic_enabled; // actually used only for layers 0->3! - UINT8 main_window_enabled; - UINT8 sub_window_enabled; - UINT8 main_bg_enabled; - UINT8 sub_bg_enabled; + uint8_t main_window_enabled; + uint8_t sub_window_enabled; + uint8_t main_bg_enabled; + uint8_t sub_bg_enabled; - UINT16 hoffs; - UINT16 voffs; + uint16_t hoffs; + uint16_t voffs; } m_layer[6]; // this is for the BG1 - BG2 - BG3 - BG4 - OBJ - color layers struct { - UINT8 address_low; - UINT8 address_high; - UINT8 saved_address_low; - UINT8 saved_address_high; - UINT16 address; - UINT16 priority_rotation; - UINT8 next_charmap; - UINT8 next_size; - UINT8 size; - UINT32 next_name_select; - UINT32 name_select; - UINT8 first_sprite; - UINT8 flip; - UINT16 write_latch; + uint8_t address_low; + uint8_t address_high; + uint8_t saved_address_low; + uint8_t saved_address_high; + uint16_t address; + uint16_t priority_rotation; + uint8_t next_charmap; + uint8_t next_size; + uint8_t size; + uint32_t next_name_select; + uint32_t name_select; + uint8_t first_sprite; + uint8_t flip; + uint16_t write_latch; } m_oam; struct { - UINT16 latch_horz; - UINT16 latch_vert; - UINT16 current_vert; - UINT8 last_visible_line; - UINT8 interlace_count; + uint16_t latch_horz; + uint16_t latch_vert; + uint16_t current_vert; + uint8_t last_visible_line; + uint8_t interlace_count; } m_beam; struct { - UINT8 repeat; - UINT8 hflip; - UINT8 vflip; - INT16 matrix_a; - INT16 matrix_b; - INT16 matrix_c; - INT16 matrix_d; - INT16 origin_x; - INT16 origin_y; - UINT16 hor_offset; - UINT16 ver_offset; - UINT8 extbg; + uint8_t repeat; + uint8_t hflip; + uint8_t vflip; + int16_t matrix_a; + int16_t matrix_b; + int16_t matrix_c; + int16_t matrix_d; + int16_t origin_x; + int16_t origin_y; + uint16_t hor_offset; + uint16_t ver_offset; + uint8_t extbg; } m_mode7; struct OAM { - UINT16 tile; - INT16 x, y; - UINT8 size, vflip, hflip, priority_bits, pal; + uint16_t tile; + int16_t x, y; + uint8_t size, vflip, hflip, priority_bits, pal; int height, width; }; struct OAM m_oam_spritelist[SNES_SCR_WIDTH / 2]; - UINT8 m_oam_itemlist[32]; + uint8_t m_oam_itemlist[32]; struct TILELIST { - INT16 x; - UINT16 priority, pal, tileaddr; + int16_t x; + uint16_t priority, pal, tileaddr; int hflip; }; @@ -170,96 +170,96 @@ public: #if SNES_LAYER_DEBUG struct DEBUGOPTS { - UINT8 bg_disabled[5]; - UINT8 mode_disabled[8]; - UINT8 draw_subscreen; - UINT8 windows_disabled; - UINT8 mosaic_disabled; - UINT8 colormath_disabled; - UINT8 sprite_reversed; - UINT8 select_pri[5]; + uint8_t bg_disabled[5]; + uint8_t mode_disabled[8]; + uint8_t draw_subscreen; + uint8_t windows_disabled; + uint8_t mosaic_disabled; + uint8_t colormath_disabled; + uint8_t sprite_reversed; + uint8_t select_pri[5]; }; struct DEBUGOPTS m_debug_options; - UINT8 dbg_video( UINT16 curline ); + uint8_t dbg_video( uint16_t curline ); #endif - UINT8 m_mosaic_size; - UINT8 m_clip_to_black; - UINT8 m_prevent_color_math; - UINT8 m_sub_add_mode; - UINT8 m_bg3_priority_bit; - UINT8 m_direct_color; - UINT8 m_ppu_last_scroll; /* as per Anomie's doc and Theme Park, all scroll regs shares (but mode 7 ones) the same + uint8_t m_mosaic_size; + uint8_t m_clip_to_black; + uint8_t m_prevent_color_math; + uint8_t m_sub_add_mode; + uint8_t m_bg3_priority_bit; + uint8_t m_direct_color; + uint8_t m_ppu_last_scroll; /* as per Anomie's doc and Theme Park, all scroll regs shares (but mode 7 ones) the same 'previous' scroll value */ - UINT8 m_mode7_last_scroll; /* as per Anomie's doc mode 7 scroll regs use a different value, shared with mode 7 matrix! */ - - UINT8 m_ppu1_open_bus, m_ppu2_open_bus; - UINT8 m_ppu1_version, m_ppu2_version; - UINT8 m_window1_left, m_window1_right, m_window2_left, m_window2_right; - - UINT16 m_mosaic_table[16][4096]; - UINT8 m_clipmasks[6][SNES_SCR_WIDTH]; - UINT8 m_update_windows; - UINT8 m_update_offsets; - UINT8 m_update_oam_list; - UINT8 m_mode; - UINT8 m_interlace; //doubles the visible resolution - UINT8 m_obj_interlace; - UINT8 m_screen_brightness; - UINT8 m_screen_disabled; - UINT8 m_pseudo_hires; - UINT8 m_color_modes; - UINT8 m_stat77; - UINT8 m_stat78; - - UINT16 m_htmult; /* in 512 wide, we run HTOTAL double and halve it on latching */ - UINT16 m_cgram_address; /* CGRAM address */ - UINT8 m_read_ophct; - UINT8 m_read_opvct; - UINT16 m_vram_fgr_high; - UINT16 m_vram_fgr_increment; - UINT16 m_vram_fgr_count; - UINT16 m_vram_fgr_mask; - UINT16 m_vram_fgr_shift; - UINT16 m_vram_read_buffer; - UINT16 m_vmadd; - - inline UINT16 get_bgcolor(UINT8 direct_colors, UINT16 palette, UINT8 color); - inline void set_scanline_pixel(int screen, INT16 x, UINT16 color, UINT8 priority, UINT8 layer, int blend); - inline void draw_bgtile_lores(UINT8 layer, INT16 ii, UINT8 colour, UINT16 pal, UINT8 direct_colors, UINT8 priority); - inline void draw_bgtile_hires(UINT8 layer, INT16 ii, UINT8 colour, UINT16 pal, UINT8 direct_colors, UINT8 priority); - inline void draw_oamtile(INT16 ii, UINT8 colour, UINT16 pal, UINT8 priority); - inline void draw_tile(UINT8 planes, UINT8 layer, UINT32 tileaddr, INT16 x, UINT8 priority, UINT8 flip, UINT8 direct_colors, UINT16 pal, UINT8 hires); - inline UINT32 get_tmap_addr(UINT8 layer, UINT8 tile_size, UINT32 base, UINT32 x, UINT32 y); - inline void update_line(UINT16 curline, UINT8 layer, UINT8 priority_b, UINT8 priority_a, UINT8 color_depth, UINT8 hires, UINT8 offset_per_tile, UINT8 direct_colors); - void update_line_mode7(UINT16 curline, UINT8 layer, UINT8 priority_b, UINT8 priority_a); + uint8_t m_mode7_last_scroll; /* as per Anomie's doc mode 7 scroll regs use a different value, shared with mode 7 matrix! */ + + uint8_t m_ppu1_open_bus, m_ppu2_open_bus; + uint8_t m_ppu1_version, m_ppu2_version; + uint8_t m_window1_left, m_window1_right, m_window2_left, m_window2_right; + + uint16_t m_mosaic_table[16][4096]; + uint8_t m_clipmasks[6][SNES_SCR_WIDTH]; + uint8_t m_update_windows; + uint8_t m_update_offsets; + uint8_t m_update_oam_list; + uint8_t m_mode; + uint8_t m_interlace; //doubles the visible resolution + uint8_t m_obj_interlace; + uint8_t m_screen_brightness; + uint8_t m_screen_disabled; + uint8_t m_pseudo_hires; + uint8_t m_color_modes; + uint8_t m_stat77; + uint8_t m_stat78; + + uint16_t m_htmult; /* in 512 wide, we run HTOTAL double and halve it on latching */ + uint16_t m_cgram_address; /* CGRAM address */ + uint8_t m_read_ophct; + uint8_t m_read_opvct; + uint16_t m_vram_fgr_high; + uint16_t m_vram_fgr_increment; + uint16_t m_vram_fgr_count; + uint16_t m_vram_fgr_mask; + uint16_t m_vram_fgr_shift; + uint16_t m_vram_read_buffer; + uint16_t m_vmadd; + + inline uint16_t get_bgcolor(uint8_t direct_colors, uint16_t palette, uint8_t color); + inline void set_scanline_pixel(int screen, int16_t x, uint16_t color, uint8_t priority, uint8_t layer, int blend); + inline void draw_bgtile_lores(uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority); + inline void draw_bgtile_hires(uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority); + inline void draw_oamtile(int16_t ii, uint8_t colour, uint16_t pal, uint8_t priority); + inline void draw_tile(uint8_t planes, uint8_t layer, uint32_t tileaddr, int16_t x, uint8_t priority, uint8_t flip, uint8_t direct_colors, uint16_t pal, uint8_t hires); + inline uint32_t get_tmap_addr(uint8_t layer, uint8_t tile_size, uint32_t base, uint32_t x, uint32_t y); + inline void update_line(uint16_t curline, uint8_t layer, uint8_t priority_b, uint8_t priority_a, uint8_t color_depth, uint8_t hires, uint8_t offset_per_tile, uint8_t direct_colors); + void update_line_mode7(uint16_t curline, uint8_t layer, uint8_t priority_b, uint8_t priority_a); void update_obsel(void); void oam_list_build(void); - int is_sprite_on_scanline(UINT16 curline, UINT8 sprite); - void update_objects_rto(UINT16 curline); - void update_objects(UINT8 priority_oam0, UINT8 priority_oam1, UINT8 priority_oam2, UINT8 priority_oam3); - void update_mode_0(UINT16 curline); - void update_mode_1(UINT16 curline); - void update_mode_2(UINT16 curline); - void update_mode_3(UINT16 curline); - void update_mode_4(UINT16 curline); - void update_mode_5(UINT16 curline); - void update_mode_6(UINT16 curline); - void update_mode_7(UINT16 curline); - void draw_screens(UINT16 curline); + int is_sprite_on_scanline(uint16_t curline, uint8_t sprite); + void update_objects_rto(uint16_t curline); + void update_objects(uint8_t priority_oam0, uint8_t priority_oam1, uint8_t priority_oam2, uint8_t priority_oam3); + void update_mode_0(uint16_t curline); + void update_mode_1(uint16_t curline); + void update_mode_2(uint16_t curline); + void update_mode_3(uint16_t curline); + void update_mode_4(uint16_t curline); + void update_mode_5(uint16_t curline); + void update_mode_6(uint16_t curline); + void update_mode_7(uint16_t curline); + void draw_screens(uint16_t curline); void update_windowmasks(void); void update_offsets(void); - inline void draw_blend(UINT16 offset, UINT16 *colour, UINT8 prevent_color_math, UINT8 black_pen_clip, int switch_screens); - void refresh_scanline(bitmap_rgb32 &bitmap, UINT16 curline); + inline void draw_blend(uint16_t offset, uint16_t *colour, uint8_t prevent_color_math, uint8_t black_pen_clip, int switch_screens); + void refresh_scanline(bitmap_rgb32 &bitmap, uint16_t curline); - inline INT16 current_x() { return m_screen->hpos() / m_htmult; } - inline INT16 current_y() { return m_screen->vpos(); } - void set_latch_hv(INT16 x, INT16 y); + inline int16_t current_x() { return m_screen->hpos() / m_htmult; } + inline int16_t current_y() { return m_screen->vpos(); } + void set_latch_hv(int16_t x, int16_t y); void dynamic_res_change(); - inline UINT32 get_vram_address(); + inline uint32_t get_vram_address(); - UINT8 read(address_space &space, UINT32 offset, UINT8 wrio_bit7); - void write(address_space &space, UINT32 offset, UINT8 data); + uint8_t read(address_space &space, uint32_t offset, uint8_t wrio_bit7); + void write(address_space &space, uint32_t offset, uint8_t data); DECLARE_READ8_MEMBER( oam_read ); DECLARE_WRITE8_MEMBER( oam_write ); @@ -267,9 +267,9 @@ public: DECLARE_WRITE8_MEMBER( cgram_write ); DECLARE_READ8_MEMBER( vram_read ); DECLARE_WRITE8_MEMBER( vram_write ); - std::unique_ptr m_oam_ram; /* Object Attribute Memory */ - std::unique_ptr m_cgram; /* Palette RAM */ - std::unique_ptr m_vram; /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */ + std::unique_ptr m_oam_ram; /* Object Attribute Memory */ + std::unique_ptr m_cgram; /* Palette RAM */ + std::unique_ptr m_vram; /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */ protected: // device-level overrides diff --git a/src/devices/video/sprite.cpp b/src/devices/video/sprite.cpp index 7567f0dd0ac..32911a7bc18 100644 --- a/src/devices/video/sprite.cpp +++ b/src/devices/video/sprite.cpp @@ -37,7 +37,7 @@ sparse_dirty_bitmap::sparse_dirty_bitmap(int width, int height, int granularity) // dirty -- dirty a region //------------------------------------------------- -void sparse_dirty_bitmap::dirty(INT32 left, INT32 right, INT32 top, INT32 bottom) +void sparse_dirty_bitmap::dirty(int32_t left, int32_t right, int32_t top, int32_t bottom) { // compute a rectangle in dirty space, and fill it with 1 rectangle rect(left >> m_granularity, right >> m_granularity, top >> m_granularity, bottom >> m_granularity); @@ -52,7 +52,7 @@ void sparse_dirty_bitmap::dirty(INT32 left, INT32 right, INT32 top, INT32 bottom // clean a region -- dirty a region //------------------------------------------------- -void sparse_dirty_bitmap::clean(INT32 left, INT32 right, INT32 top, INT32 bottom) +void sparse_dirty_bitmap::clean(int32_t left, int32_t right, int32_t top, int32_t bottom) { // if right or bottom intersect the edge of the bitmap, round up int round = (1 << m_granularity) - 1; @@ -113,7 +113,7 @@ sparse_dirty_rect *sparse_dirty_bitmap::first_dirty_rect(const rectangle &clipre // loop over all grid rows that intersect our cliprect for (int y = sy; y <= ey; y++) { - UINT8 *dirtybase = &m_bitmap.pix(y); + uint8_t *dirtybase = &m_bitmap.pix(y); sparse_dirty_rect *currect = nullptr; // loop over all grid columns that intersect our cliprect diff --git a/src/devices/video/sprite.h b/src/devices/video/sprite.h index c48a8ae0665..2b5b38d49d5 100644 --- a/src/devices/video/sprite.h +++ b/src/devices/video/sprite.h @@ -41,12 +41,12 @@ public: // dirtying operations - partially interecting tiles are dirtied void dirty(const rectangle &rect) { dirty(rect.left(), rect.right(), rect.top(), rect.bottom()); } - void dirty(INT32 left, INT32 right, INT32 top, INT32 bottom); + void dirty(int32_t left, int32_t right, int32_t top, int32_t bottom); void dirty_all() { dirty(0, m_width - 1, 0, m_height - 1); } // cleaning operations - partially intersecting tiles are NOT cleaned void clean(const rectangle &rect) { clean(rect.left(), rect.right(), rect.top(), rect.bottom()); } - void clean(INT32 left, INT32 right, INT32 top, INT32 bottom); + void clean(int32_t left, int32_t right, int32_t top, int32_t bottom); void clean_all() { clean(0, m_width - 1, 0, m_height - 1); } // convert to rect list @@ -94,14 +94,14 @@ protected: public: // getters - INT32 xorigin() const { return m_xorigin; } - INT32 yorigin() const { return m_yorigin; } + int32_t xorigin() const { return m_xorigin; } + int32_t yorigin() const { return m_yorigin; } _BitmapType &bitmap() { return m_bitmap; } sparse_dirty_rect *first_dirty_rect() { return m_dirty.first_dirty_rect(); } sparse_dirty_rect *first_dirty_rect(const rectangle &cliprect) { return m_dirty.first_dirty_rect(cliprect); } _SpriteRAMType *spriteram() const { return m_spriteram; } - UINT32 spriteram_bytes() const { return m_spriteram_bytes; } - UINT32 spriteram_elements() const { return m_spriteram_bytes / sizeof(_SpriteRAMType); } + uint32_t spriteram_bytes() const { return m_spriteram_bytes; } + uint32_t spriteram_elements() const { return m_spriteram_bytes / sizeof(_SpriteRAMType); } _SpriteRAMType *buffer() { return &m_buffer[0]; } // static configuration @@ -110,10 +110,10 @@ public: static void static_set_origin(device_t &device, int xorigin, int yorigin) { static_set_xorigin(device, xorigin); static_set_yorigin(device, yorigin); } // configuration - void set_spriteram(_SpriteRAMType *base, UINT32 bytes) { m_spriteram = base; m_spriteram_bytes = bytes; m_buffer.resize(m_spriteram_bytes / sizeof(_SpriteRAMType)); } - void set_origin(INT32 xorigin = 0, INT32 yorigin = 0) { m_xorigin = xorigin; m_yorigin = yorigin; } - void set_xorigin(INT32 xorigin) { m_xorigin = xorigin; } - void set_yorigin(INT32 yorigin) { m_yorigin = yorigin; } + void set_spriteram(_SpriteRAMType *base, uint32_t bytes) { m_spriteram = base; m_spriteram_bytes = bytes; m_buffer.resize(m_spriteram_bytes / sizeof(_SpriteRAMType)); } + void set_origin(int32_t xorigin = 0, int32_t yorigin = 0) { m_xorigin = xorigin; m_yorigin = yorigin; } + void set_xorigin(int32_t xorigin) { m_xorigin = xorigin; } + void set_yorigin(int32_t yorigin) { m_yorigin = yorigin; } // buffering void copy_to_buffer() { memcpy(m_buffer, m_spriteram, m_spriteram_bytes); } @@ -181,16 +181,16 @@ protected: // subclass helpers void mark_dirty(const rectangle &rect) { mark_dirty(rect.left(), rect.right(), rect.top(), rect.bottom()); } - void mark_dirty(INT32 left, INT32 right, INT32 top, INT32 bottom) { m_dirty.dirty(left - m_xorigin, right - m_xorigin, top - m_yorigin, bottom - m_yorigin); } + void mark_dirty(int32_t left, int32_t right, int32_t top, int32_t bottom) { m_dirty.dirty(left - m_xorigin, right - m_xorigin, top - m_yorigin, bottom - m_yorigin); } private: // configuration - INT32 m_xorigin; // X origin for drawing - INT32 m_yorigin; // Y origin for drawing + int32_t m_xorigin; // X origin for drawing + int32_t m_yorigin; // Y origin for drawing // memory pointers and buffers _SpriteRAMType * m_spriteram; // pointer to spriteram pointer - INT32 m_spriteram_bytes; // size of sprite RAM in bytes + int32_t m_spriteram_bytes; // size of sprite RAM in bytes std::vector<_SpriteRAMType> m_buffer; // buffered spriteram for those that use it // bitmaps @@ -198,13 +198,13 @@ private: sparse_dirty_bitmap m_dirty; // dirty bitmap }; -typedef sprite_device sprite8_device_ind16; -typedef sprite_device sprite16_device_ind16; -typedef sprite_device sprite32_device_ind16; +typedef sprite_device sprite8_device_ind16; +typedef sprite_device sprite16_device_ind16; +typedef sprite_device sprite32_device_ind16; -typedef sprite_device sprite8_device_ind32; -typedef sprite_device sprite16_device_ind32; -typedef sprite_device sprite32_device_ind32; +typedef sprite_device sprite8_device_ind32; +typedef sprite_device sprite16_device_ind32; +typedef sprite_device sprite32_device_ind32; #endif // __SPRITE_H__ diff --git a/src/devices/video/stvvdp1.cpp b/src/devices/video/stvvdp1.cpp index 5968759c8dc..fdbdc59faff 100644 --- a/src/devices/video/stvvdp1.cpp +++ b/src/devices/video/stvvdp1.cpp @@ -24,14 +24,14 @@ Framebuffer todo: enum { FRAC_SHIFT = 16 }; struct spoint { - INT32 x, y; - INT32 u, v; + int32_t x, y; + int32_t u, v; }; struct shaded_point { - INT32 x,y; - INT32 r,g,b; + int32_t x,y; + int32_t r,g,b; }; #define RGB_R(_color) (_color & 0x1f) @@ -40,7 +40,7 @@ struct shaded_point #define SWAP_INT32(_a,_b) \ { \ - INT32 t; \ + int32_t t; \ t = _a; \ _a = _b; \ _b = t; \ @@ -48,7 +48,7 @@ struct shaded_point #define SWAP_INT32PTR(_p1, _p2) \ { \ - INT32 *p; \ + int32_t *p; \ p = _p1; \ _p1 = _p2; \ _p2 = p; \ @@ -161,7 +161,7 @@ READ16_MEMBER( saturn_state::saturn_vdp1_regs_r ) /* MODR register, read register for the other VDP1 regs (Shienryu SS version abuses of this during intro) */ case 0x16/2: - UINT16 modr; + uint16_t modr; modr = 0x1000; //vdp1 VER modr |= (STV_VDP1_PTM >> 1) << 8; // PTM1 @@ -208,7 +208,7 @@ void saturn_state::stv_clear_framebuffer( int which_framebuffer ) } if ( VDP1_LOG ) logerror( "Clearing %d framebuffer\n", m_vdp1.framebuffer_current_draw ); -// memset( m_vdp1.framebuffer[ which_framebuffer ], m_vdp1.ewdr, 1024 * 256 * sizeof(UINT16) * 2 ); +// memset( m_vdp1.framebuffer[ which_framebuffer ], m_vdp1.ewdr, 1024 * 256 * sizeof(uint16_t) * 2 ); } @@ -337,7 +337,7 @@ READ32_MEMBER ( saturn_state::saturn_vdp1_vram_r ) WRITE32_MEMBER ( saturn_state::saturn_vdp1_vram_w ) { - UINT8 *vdp1 = m_vdp1.gfx_decode.get(); + uint8_t *vdp1 = m_vdp1.gfx_decode.get(); COMBINE_DATA (&m_vdp1_vram[offset]); @@ -398,7 +398,7 @@ WRITE32_MEMBER ( saturn_state::saturn_vdp1_framebuffer0_w ) READ32_MEMBER ( saturn_state::saturn_vdp1_framebuffer0_r ) { - UINT32 result = 0; + uint32_t result = 0; //popmessage ("STV VDP1 Framebuffer 0 READ offset %08x",offset); if ( STV_VDP1_TVM & 1 ) { @@ -514,7 +514,7 @@ void saturn_state::stv_clear_gouraud_shading(void) memset( &stv_gouraud_shading, 0, sizeof( stv_gouraud_shading ) ); } -UINT8 saturn_state::stv_read_gouraud_table( void ) +uint8_t saturn_state::stv_read_gouraud_table( void ) { int gaddr; @@ -533,7 +533,7 @@ UINT8 saturn_state::stv_read_gouraud_table( void ) } } -static inline INT32 _shading( INT32 color, INT32 correction ) +static inline int32_t _shading( int32_t color, int32_t correction ) { correction = (correction >> 16) & 0x1f; color += (correction - 16); @@ -544,9 +544,9 @@ static inline INT32 _shading( INT32 color, INT32 correction ) return color; } -UINT16 saturn_state::stv_vdp1_apply_gouraud_shading( int x, int y, UINT16 pix ) +uint16_t saturn_state::stv_vdp1_apply_gouraud_shading( int x, int y, uint16_t pix ) { - INT32 r,g,b, msb; + int32_t r,g,b, msb; msb = pix & 0x8000; @@ -574,9 +574,9 @@ UINT16 saturn_state::stv_vdp1_apply_gouraud_shading( int x, int y, UINT16 pix ) return msb | b << 10 | g << 5 | r; } -void saturn_state::stv_vdp1_setup_shading_for_line(INT32 y, INT32 x1, INT32 x2, - INT32 r1, INT32 g1, INT32 b1, - INT32 r2, INT32 g2, INT32 b2) +void saturn_state::stv_vdp1_setup_shading_for_line(int32_t y, int32_t x1, int32_t x2, + int32_t r1, int32_t g1, int32_t b1, + int32_t r2, int32_t g2, int32_t b2) { int xx1 = x1>>FRAC_SHIFT; int xx2 = x2>>FRAC_SHIFT; @@ -592,8 +592,8 @@ void saturn_state::stv_vdp1_setup_shading_for_line(INT32 y, INT32 x1, INT32 x2, if ( (y >= 0) && (y < 512) ) { - INT32 dx; - INT32 gbd, ggd, grd; + int32_t dx; + int32_t gbd, ggd, grd; dx = xx2 - xx1; @@ -629,11 +629,11 @@ void saturn_state::stv_vdp1_setup_shading_for_line(INT32 y, INT32 x1, INT32 x2, } void saturn_state::stv_vdp1_setup_shading_for_slope( - INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 *nx1, INT32 *nx2, - INT32 r1, INT32 r2, INT32 slr1, INT32 slr2, INT32 *nr1, INT32 *nr2, - INT32 g1, INT32 g2, INT32 slg1, INT32 slg2, INT32 *ng1, INT32 *ng2, - INT32 b1, INT32 b2, INT32 slb1, INT32 slb2, INT32 *nb1, INT32 *nb2, - INT32 _y1, INT32 y2) + int32_t x1, int32_t x2, int32_t sl1, int32_t sl2, int32_t *nx1, int32_t *nx2, + int32_t r1, int32_t r2, int32_t slr1, int32_t slr2, int32_t *nr1, int32_t *nr2, + int32_t g1, int32_t g2, int32_t slg1, int32_t slg2, int32_t *ng1, int32_t *ng2, + int32_t b1, int32_t b2, int32_t slb1, int32_t slb2, int32_t *nb1, int32_t *nb2, + int32_t _y1, int32_t y2) { if(x1 > x2 || (x1==x2 && sl1 > sl2)) { SWAP_INT32(x1,x2); @@ -677,13 +677,13 @@ void saturn_state::stv_vdp1_setup_shading_for_slope( void saturn_state::stv_vdp1_setup_shading(const struct spoint* q, const rectangle &cliprect) { - INT32 x1, x2, delta, cury, limy; - INT32 r1, g1, b1, r2, g2, b2; - INT32 sl1, slg1, slb1, slr1; - INT32 sl2, slg2, slb2, slr2; + int32_t x1, x2, delta, cury, limy; + int32_t r1, g1, b1, r2, g2, b2; + int32_t sl1, slg1, slb1, slr1; + int32_t sl2, slg2, slb2, slr2; int pmin, pmax, i, ps1, ps2; struct shaded_point p[8]; - UINT16 gd[4]; + uint16_t gd[4]; if ( stv_read_gouraud_table() == 0 ) return; @@ -864,7 +864,7 @@ void saturn_state::drawpixel_poly(int x, int y, int patterndata, int offsetcnt) void saturn_state::drawpixel_8bpp_trans(int x, int y, int patterndata, int offsetcnt) { - UINT16 pix; + uint16_t pix; pix = m_vdp1.gfx_decode[patterndata+offsetcnt]; if ( pix & 0xff ) @@ -875,7 +875,7 @@ void saturn_state::drawpixel_8bpp_trans(int x, int y, int patterndata, int offse void saturn_state::drawpixel_4bpp_notrans(int x, int y, int patterndata, int offsetcnt) { - UINT16 pix; + uint16_t pix; pix = m_vdp1.gfx_decode[patterndata+offsetcnt/2]; pix = offsetcnt&1 ? (pix & 0x0f) : ((pix & 0xf0)>>4); @@ -884,7 +884,7 @@ void saturn_state::drawpixel_4bpp_notrans(int x, int y, int patterndata, int off void saturn_state::drawpixel_4bpp_trans(int x, int y, int patterndata, int offsetcnt) { - UINT16 pix; + uint16_t pix; pix = m_vdp1.gfx_decode[patterndata+offsetcnt/2]; pix = offsetcnt&1 ? (pix & 0x0f) : ((pix & 0xf0)>>4); @@ -1081,10 +1081,10 @@ void saturn_state::stv_vdp1_set_drawpixel( void ) void saturn_state::vdp1_fill_slope(const rectangle &cliprect, int patterndata, int xsize, - INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 *nx1, INT32 *nx2, - INT32 u1, INT32 u2, INT32 slu1, INT32 slu2, INT32 *nu1, INT32 *nu2, - INT32 v1, INT32 v2, INT32 slv1, INT32 slv2, INT32 *nv1, INT32 *nv2, - INT32 _y1, INT32 y2) + int32_t x1, int32_t x2, int32_t sl1, int32_t sl2, int32_t *nx1, int32_t *nx2, + int32_t u1, int32_t u2, int32_t slu1, int32_t slu2, int32_t *nu1, int32_t *nu2, + int32_t v1, int32_t v2, int32_t slv1, int32_t slv2, int32_t *nv1, int32_t *nv2, + int32_t _y1, int32_t y2) { if(_y1 > cliprect.max_y) return; @@ -1115,7 +1115,7 @@ void saturn_state::vdp1_fill_slope(const rectangle &cliprect, int patterndata, i } if(x1 > x2 || (x1==x2 && sl1 > sl2)) { - INT32 t, *tp; + int32_t t, *tp; t = x1; x1 = x2; x2 = t; @@ -1149,11 +1149,11 @@ void saturn_state::vdp1_fill_slope(const rectangle &cliprect, int patterndata, i while(_y1 < y2) { if(_y1 >= cliprect.min_y) { - INT32 slux = 0, slvx = 0; + int32_t slux = 0, slvx = 0; int xx1 = x1>>FRAC_SHIFT; int xx2 = x2>>FRAC_SHIFT; - INT32 u = u1; - INT32 v = v1; + int32_t u = u1; + int32_t v = v1; if(xx1 != xx2) { int delta = xx2-xx1; slux = (u2-u1)/delta; @@ -1194,8 +1194,8 @@ void saturn_state::vdp1_fill_slope(const rectangle &cliprect, int patterndata, i *nv2 = v2; } -void saturn_state::vdp1_fill_line(const rectangle &cliprect, int patterndata, int xsize, INT32 y, - INT32 x1, INT32 x2, INT32 u1, INT32 u2, INT32 v1, INT32 v2) +void saturn_state::vdp1_fill_line(const rectangle &cliprect, int patterndata, int xsize, int32_t y, + int32_t x1, int32_t x2, int32_t u1, int32_t u2, int32_t v1, int32_t v2) { int xx1 = x1>>FRAC_SHIFT; int xx2 = x2>>FRAC_SHIFT; @@ -1204,9 +1204,9 @@ void saturn_state::vdp1_fill_line(const rectangle &cliprect, int patterndata, in return; if(xx1 <= cliprect.max_x || xx2 >= cliprect.min_x) { - INT32 slux = 0, slvx = 0; - INT32 u = u1; - INT32 v = v1; + int32_t slux = 0, slvx = 0; + int32_t u = u1; + int32_t v = v1; if(xx1 != xx2) { int delta = xx2-xx1; slux = (u2-u1)/delta; @@ -1232,7 +1232,7 @@ void saturn_state::vdp1_fill_line(const rectangle &cliprect, int patterndata, in void saturn_state::vdp1_fill_quad(const rectangle &cliprect, int patterndata, int xsize, const struct spoint *q) { - INT32 sl1, sl2, slu1, slu2, slv1, slv2, cury, limy, x1, x2, u1, u2, v1, v2, delta; + int32_t sl1, sl2, slu1, slu2, slv1, slv2, cury, limy, x1, x2, u1, u2, v1, v2, delta; int pmin, pmax, i, ps1, ps2; struct spoint p[8]; @@ -1369,12 +1369,12 @@ void saturn_state::vdp1_fill_quad(const rectangle &cliprect, int patterndata, in int saturn_state::x2s(int v) { - return (INT32)(INT16)v + m_vdp1.local_x; + return (int32_t)(int16_t)v + m_vdp1.local_x; } int saturn_state::y2s(int v) { - return (INT32)(INT16)v + m_vdp1.local_y; + return (int32_t)(int16_t)v + m_vdp1.local_y; } void saturn_state::stv_vdp1_draw_line(const rectangle &cliprect) @@ -1544,14 +1544,14 @@ void saturn_state::stv_vdp1_draw_scaled_sprite(const rectangle &cliprect) x = stv2_current_sprite.CMDXA; y = stv2_current_sprite.CMDYA; - screen_width = (INT16)stv2_current_sprite.CMDXB; + screen_width = (int16_t)stv2_current_sprite.CMDXB; if ( (screen_width < 0) && zoompoint) { screen_width = -screen_width; direction |= 1; } - screen_height = (INT16)stv2_current_sprite.CMDYB; + screen_height = (int16_t)stv2_current_sprite.CMDYB; if ( (screen_height < 0) && zoompoint ) { screen_height_negative = 1; @@ -1673,7 +1673,7 @@ void saturn_state::stv_vdp1_draw_normal_sprite(const rectangle &cliprect, int sp int x, xsize, drawxpos; int direction; int patterndata; - UINT8 shading; + uint8_t shading; int su, u, dux, duy; int maxdrawypos, maxdrawxpos; @@ -1975,9 +1975,9 @@ void saturn_state::stv_vdp1_process_list( void ) break; case 0x000a: - if (VDP1_LOG) logerror ("Sprite List Local Co-Ordinate Set (%d %d)\n",(INT16)stv2_current_sprite.CMDXA,(INT16)stv2_current_sprite.CMDYA); - m_vdp1.local_x = (INT16)stv2_current_sprite.CMDXA; - m_vdp1.local_y = (INT16)stv2_current_sprite.CMDYA; + if (VDP1_LOG) logerror ("Sprite List Local Co-Ordinate Set (%d %d)\n",(int16_t)stv2_current_sprite.CMDXA,(int16_t)stv2_current_sprite.CMDYA); + m_vdp1.local_x = (int16_t)stv2_current_sprite.CMDXA; + m_vdp1.local_y = (int16_t)stv2_current_sprite.CMDYA; break; default: @@ -2097,9 +2097,9 @@ void saturn_state::video_update_vdp1( void ) void saturn_state::stv_vdp1_state_save_postload( void ) { - UINT8 *vdp1 = m_vdp1.gfx_decode.get(); + uint8_t *vdp1 = m_vdp1.gfx_decode.get(); int offset; - UINT32 data; + uint32_t data; m_vdp1.framebuffer_mode = -1; m_vdp1.framebuffer_double_interlace = -1; @@ -2119,17 +2119,17 @@ void saturn_state::stv_vdp1_state_save_postload( void ) int saturn_state::stv_vdp1_start ( void ) { - m_vdp1_regs = make_unique_clear(0x020/2 ); - m_vdp1_vram = make_unique_clear(0x100000/4 ); - m_vdp1.gfx_decode = std::make_unique(0x100000 ); + m_vdp1_regs = make_unique_clear(0x020/2 ); + m_vdp1_vram = make_unique_clear(0x100000/4 ); + m_vdp1.gfx_decode = std::make_unique(0x100000 ); stv_vdp1_shading_data = std::make_unique(); - m_vdp1.framebuffer[0] = std::make_unique(1024 * 256 * 2 ); /* *2 is for double interlace */ - m_vdp1.framebuffer[1] = std::make_unique(1024 * 256 * 2 ); + m_vdp1.framebuffer[0] = std::make_unique(1024 * 256 * 2 ); /* *2 is for double interlace */ + m_vdp1.framebuffer[1] = std::make_unique(1024 * 256 * 2 ); - m_vdp1.framebuffer_display_lines = auto_alloc_array(machine(), UINT16 *, 512); - m_vdp1.framebuffer_draw_lines = auto_alloc_array(machine(), UINT16 *, 512); + m_vdp1.framebuffer_display_lines = auto_alloc_array(machine(), uint16_t *, 512); + m_vdp1.framebuffer_draw_lines = auto_alloc_array(machine(), uint16_t *, 512); m_vdp1.framebuffer_width = m_vdp1.framebuffer_height = 0; m_vdp1.framebuffer_mode = -1; diff --git a/src/devices/video/stvvdp2.cpp b/src/devices/video/stvvdp2.cpp index 93a4d6d79fd..cd4325fd2b6 100644 --- a/src/devices/video/stvvdp2.cpp +++ b/src/devices/video/stvvdp2.cpp @@ -2102,9 +2102,9 @@ bit-> /----15----|----14----|----13----|----12----|----11----|----10----|----09 #define mul_fixed32( a, b ) mul_32x32_shift( a, b, 16 ) -void saturn_state::stv_vdp2_fill_rotation_parameter_table( UINT8 rot_parameter ) +void saturn_state::stv_vdp2_fill_rotation_parameter_table( uint8_t rot_parameter ) { - UINT32 address; + uint32_t address; address = (((STV_VDP2_RPTAU << 16) | STV_VDP2_RPTAL) << 1); if ( rot_parameter == 1 ) @@ -2190,7 +2190,7 @@ void saturn_state::stv_vdp2_fill_rotation_parameter_table( UINT8 rot_parameter ) } /* check if RGB layer has rotation applied */ -UINT8 saturn_state::stv_vdp2_is_rotation_applied(void) +uint8_t saturn_state::stv_vdp2_is_rotation_applied(void) { #define _FIXED_1 (0x00010000) #define _FIXED_0 (0x00000000) @@ -2216,7 +2216,7 @@ UINT8 saturn_state::stv_vdp2_is_rotation_applied(void) } } -UINT8 saturn_state::stv_vdp2_are_map_registers_equal(void) +uint8_t saturn_state::stv_vdp2_are_map_registers_equal(void) { int i; @@ -2264,11 +2264,11 @@ void saturn_state::stv_vdp2_check_fade_control_for_layer( void ) #define STV_VDP2_CP_NBG2_CPDR 0x6 #define STV_VDP2_CP_NBG3_CPDR 0x7 -UINT8 saturn_state::stv_vdp2_check_vram_cycle_pattern_registers( UINT8 access_command_pnmdr, UINT8 access_command_cpdr, UINT8 bitmap_enable ) +uint8_t saturn_state::stv_vdp2_check_vram_cycle_pattern_registers( uint8_t access_command_pnmdr, uint8_t access_command_cpdr, uint8_t bitmap_enable ) { int i; - UINT8 access_command_ok = 0; - UINT16 cp_regs[8]; + uint8_t access_command_ok = 0; + uint16_t cp_regs[8]; cp_regs[0] = STV_VDP2_CYCA0L; cp_regs[1] = STV_VDP2_CYCA0U; cp_regs[2] = STV_VDP2_CYCA1L; @@ -2318,7 +2318,7 @@ UINT8 saturn_state::stv_vdp2_check_vram_cycle_pattern_registers( UINT8 access_co return access_command_ok == 3 ? 1 : 0; } -static inline UINT32 stv_add_blend(UINT32 a, UINT32 b) +static inline uint32_t stv_add_blend(uint32_t a, uint32_t b) { rgb_t rb = (a & 0xff00ff) + (b & 0xff00ff); rgb_t g = (a & 0x00ff00) + (b & 0x00ff00); @@ -2380,7 +2380,7 @@ void saturn_state::stv_vdp2_compute_color_offset_UINT32(rgb_t *rgb, int cor) void saturn_state::stv_vdp2_drawgfxzoom( 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 transparency,int transparent_color,int scalex, int scaley, int sprite_screen_width, int sprite_screen_height, int alpha) { @@ -2417,7 +2417,7 @@ void saturn_state::stv_vdp2_drawgfxzoom( if( gfx ) { 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; @@ -2489,8 +2489,8 @@ void saturn_state::stv_vdp2_drawgfxzoom( { for( y=sy; y>16) * gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; for( x=sx; x>16) * gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; for( x=sx; x>16) * gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; for( x=sx; x>16) * gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; for( x=sx; xget_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; @@ -2690,8 +2690,8 @@ void saturn_state::stv_vdp2_drawgfxzoom_rgb555( { for( y=sy; y>16)*16; - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = gfxdata + (y_index>>16)*16; + uint32_t *dest = &dest_bmp.pix32(y); int r,g,b,data; int x, x_index = x_index_base; @@ -2717,8 +2717,8 @@ void saturn_state::stv_vdp2_drawgfxzoom_rgb555( { for( y=sy; y>16)*16; - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = gfxdata + (y_index>>16)*16; + uint32_t *dest = &dest_bmp.pix32(y); int r,g,b,data; int x, x_index = x_index_base; @@ -2744,8 +2744,8 @@ void saturn_state::stv_vdp2_drawgfxzoom_rgb555( { for( y=sy; y>16)*16; - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = gfxdata + (y_index>>16)*16; + uint32_t *dest = &dest_bmp.pix32(y); int r,g,b,data; int x, x_index = x_index_base; @@ -2771,8 +2771,8 @@ void saturn_state::stv_vdp2_drawgfxzoom_rgb555( { for( y=sy; y>16)*16; - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = gfxdata + (y_index>>16)*16; + uint32_t *dest = &dest_bmp.pix32(y); int r,g,b,data; int x, x_index = x_index_base; @@ -2800,10 +2800,10 @@ void saturn_state::stv_vdp2_drawgfxzoom_rgb555( } -void saturn_state::stv_vdp2_drawgfx_rgb555( bitmap_rgb32 &dest_bmp, const rectangle &clip, UINT32 code, int flipx, int flipy, int sx, int sy, int transparency, int alpha) +void saturn_state::stv_vdp2_drawgfx_rgb555( bitmap_rgb32 &dest_bmp, const rectangle &clip, uint32_t code, int flipx, int flipy, int sx, int sy, int transparency, int alpha) { rectangle myclip; - UINT8* gfxdata; + uint8_t* gfxdata; int sprite_screen_width, sprite_screen_height; gfxdata = m_vdp2.gfx_decode.get() + code * 0x20; @@ -2877,9 +2877,9 @@ void saturn_state::stv_vdp2_drawgfx_rgb555( bitmap_rgb32 &dest_bmp, const rectan for( y=sy; y>16)*16; - UINT32 *dest = &dest_bmp.pix32(y); - UINT16 data; + const uint8_t *source = gfxdata + (y_index>>16)*16; + uint32_t *dest = &dest_bmp.pix32(y); + uint16_t data; int x, x_index = x_index_base; for( x=sx; x>16)*32; - UINT32 *dest = &dest_bmp.pix32(y); - UINT32 data; + const uint8_t *source = gfxdata + (y_index>>16)*32; + uint32_t *dest = &dest_bmp.pix32(y); + uint32_t data; int x, x_index = x_index_base; @@ -3027,11 +3027,11 @@ void saturn_state::stv_vdp2_drawgfx_rgb888( bitmap_rgb32 &dest_bmp, const rectan } void saturn_state::stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, - UINT32 code,UINT32 color, int flipx,int flipy,int offsx,int offsy, + uint32_t code,uint32_t color, int flipx,int flipy,int offsx,int offsy, int transparent_color, int alpha) { 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 x_index_base, y_index, sx, sy, ex, ey; int xinc, yinc; @@ -3083,8 +3083,8 @@ void saturn_state::stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle { for (y = sy; y < ey; y++) { - const UINT8 *source = source_base + y_index*gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + y_index*gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x_index = x_index_base; for (x = sx; x < ex; x++) { @@ -3104,11 +3104,11 @@ void saturn_state::stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle } void saturn_state::stv_vdp2_drawgfx_transpen(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, - UINT32 code,UINT32 color, int flipx,int flipy,int offsx,int offsy, + uint32_t code,uint32_t color, int flipx,int flipy,int offsx,int offsy, int transparent_color) { 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 x_index_base, y_index, sx, sy, ex, ey; int xinc, yinc; @@ -3160,8 +3160,8 @@ void saturn_state::stv_vdp2_drawgfx_transpen(bitmap_rgb32 &dest_bmp,const rectan { for (y = sy; y < ey; y++) { - const UINT8 *source = source_base + y_index*gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + y_index*gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x_index = x_index_base; for (x = sx; x < ex; x++) { @@ -3185,12 +3185,12 @@ void saturn_state::draw_4bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &clipr int xsize, ysize, xsize_mask, ysize_mask; int xsrc,ysrc,xdst,ydst; int src_offs; - UINT8* vram = m_vdp2.gfx_decode.get(); - UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000; + uint8_t* vram = m_vdp2.gfx_decode.get(); + uint32_t map_offset = stv2_current_tilemap.bitmap_map * 0x20000; int scrollx = stv2_current_tilemap.scrollx; int scrolly = stv2_current_tilemap.scrolly; - UINT16 dot_data; - UINT16 pal_bank; + uint16_t dot_data; + uint16_t pal_bank; xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; ysize = (stv2_current_tilemap.bitmap_size & 1) ? 512 : 256; @@ -3241,12 +3241,12 @@ void saturn_state::draw_8bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &clipr int xsize, ysize, xsize_mask, ysize_mask; int xsrc,ysrc,xdst,ydst; int src_offs; - UINT8* vram = m_vdp2.gfx_decode.get(); - UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000; + uint8_t* vram = m_vdp2.gfx_decode.get(); + uint32_t map_offset = stv2_current_tilemap.bitmap_map * 0x20000; int scrollx = stv2_current_tilemap.scrollx; int scrolly = stv2_current_tilemap.scrolly; - UINT16 dot_data; - UINT16 pal_bank; + uint16_t dot_data; + uint16_t pal_bank; int xf, yf; xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; @@ -3300,12 +3300,12 @@ void saturn_state::draw_11bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &clip int xsize, ysize, xsize_mask, ysize_mask; int xsrc,ysrc,xdst,ydst; int src_offs; - UINT8* vram = m_vdp2.gfx_decode.get(); - UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000; + uint8_t* vram = m_vdp2.gfx_decode.get(); + uint32_t map_offset = stv2_current_tilemap.bitmap_map * 0x20000; int scrollx = stv2_current_tilemap.scrollx; int scrolly = stv2_current_tilemap.scrolly; - UINT16 dot_data; - UINT16 pal_bank; + uint16_t dot_data; + uint16_t pal_bank; int xf, yf; xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; @@ -3358,12 +3358,12 @@ void saturn_state::draw_rgb15_bitmap(bitmap_rgb32 &bitmap, const rectangle &clip int xsize, ysize, xsize_mask, ysize_mask; int xsrc,ysrc,xdst,ydst; int src_offs; - UINT8* vram = m_vdp2.gfx_decode.get(); - UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000; + uint8_t* vram = m_vdp2.gfx_decode.get(); + uint32_t map_offset = stv2_current_tilemap.bitmap_map * 0x20000; int scrollx = stv2_current_tilemap.scrollx; int scrolly = stv2_current_tilemap.scrolly; int r,g,b; - UINT16 dot_data; + uint16_t dot_data; int xf, yf; xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; @@ -3416,12 +3416,12 @@ void saturn_state::draw_rgb32_bitmap(bitmap_rgb32 &bitmap, const rectangle &clip int xsize, ysize, xsize_mask, ysize_mask; int xsrc,ysrc,xdst,ydst; int src_offs; - UINT8* vram = m_vdp2.gfx_decode.get(); - UINT32 map_offset = stv2_current_tilemap.bitmap_map * 0x20000; + uint8_t* vram = m_vdp2.gfx_decode.get(); + uint32_t map_offset = stv2_current_tilemap.bitmap_map * 0x20000; int scrollx = stv2_current_tilemap.scrollx; int scrolly = stv2_current_tilemap.scrolly; int r,g,b; - UINT32 dot_data; + uint32_t dot_data; int xf, yf; xsize = (stv2_current_tilemap.bitmap_size & 2) ? 1024 : 512; @@ -3724,8 +3724,8 @@ void saturn_state::stv_vdp2_draw_basic_tilemap(bitmap_rgb32 &bitmap, const recta } } - scalex = (INT32)((INT64)S64(0x100000000) / (INT64)stv2_current_tilemap.incx); - scaley = (INT32)((INT64)S64(0x100000000) / (INT64)stv2_current_tilemap.incy); + scalex = (int32_t)((int64_t)S64(0x100000000) / (int64_t)stv2_current_tilemap.incx); + scaley = (int32_t)((int64_t)S64(0x100000000) / (int64_t)stv2_current_tilemap.incy); tilesizex = scalex * 8; tilesizey = scaley * 8; drawypos = drawxpos = 0; @@ -4191,12 +4191,12 @@ void saturn_state::stv_vdp2_check_tilemap_with_linescroll(bitmap_rgb32 &bitmap, int cur_line = cliprect.min_y; int address; int active_functions = 0; - INT32 scroll_values[3], prev_scroll_values[3]; + int32_t scroll_values[3], prev_scroll_values[3]; int i; int scroll_values_equal; int lines; - INT16 main_scrollx, main_scrolly; -// INT32 incx; + int16_t main_scrollx, main_scrolly; +// int32_t incx; int linescroll_enable, vertical_linescroll_enable, linezoom_enable; int vertical_linescroll_index = -1; @@ -4327,10 +4327,10 @@ void saturn_state::stv_vdp2_check_tilemap_with_linescroll(bitmap_rgb32 &bitmap, void saturn_state::stv_vdp2_draw_line(bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; - UINT8* gfxdata = m_vdp2.gfx_decode.get(); - UINT32 base_offs,base_mask; - UINT32 pix; - UINT8 interlace; + uint8_t* gfxdata = m_vdp2.gfx_decode.get(); + uint32_t base_offs,base_mask; + uint32_t pix; + uint8_t interlace; interlace = (STV_VDP2_LSMD == 3)+1; @@ -4346,7 +4346,7 @@ void saturn_state::stv_vdp2_draw_line(bitmap_rgb32 &bitmap, const rectangle &cli for(x=cliprect.min_x;x<=cliprect.max_x;x++) { - UINT16 pen; + uint16_t pen; pen = (gfxdata[base_offs+0]<<8)|gfxdata[base_offs+1]; pix = bitmap.pix32(y, x); @@ -4357,11 +4357,11 @@ void saturn_state::stv_vdp2_draw_line(bitmap_rgb32 &bitmap, const rectangle &cli } } -void saturn_state::stv_vdp2_draw_mosaic(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 is_roz) +void saturn_state::stv_vdp2_draw_mosaic(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t is_roz) { int x,y,xi,yi; - UINT8 h_size,v_size; - UINT32 pix; + uint8_t h_size,v_size; + uint32_t pix; h_size = STV_VDP2_MZSZH+1; v_size = STV_VDP2_MZSZV+1; @@ -4512,20 +4512,20 @@ void saturn_state::stv_vdp2_copy_roz_bitmap(bitmap_rgb32 &bitmap, int planerenderedsizex, int planerenderedsizey) { - INT32 xsp, ysp, xp, yp, dx, dy, x, y, xs, ys, dxs, dys; - INT32 vcnt, hcnt; - INT32 kx, ky; - INT8 use_coeff_table, coeff_table_mode, coeff_table_size, coeff_table_shift; - INT8 screen_over_process; - UINT8 vcnt_shift, hcnt_shift; - UINT8 coeff_msb; - UINT32 *coeff_table_base, coeff_table_offset; - INT32 coeff_table_val; - UINT32 address; - UINT32 *line; + int32_t xsp, ysp, xp, yp, dx, dy, x, y, xs, ys, dxs, dys; + int32_t vcnt, hcnt; + int32_t kx, ky; + int8_t use_coeff_table, coeff_table_mode, coeff_table_size, coeff_table_shift; + int8_t screen_over_process; + uint8_t vcnt_shift, hcnt_shift; + uint8_t coeff_msb; + uint32_t *coeff_table_base, coeff_table_offset; + int32_t coeff_table_val; + uint32_t address; + uint32_t *line; rgb_t pix; - //UINT32 coeff_line_color_screen_data; - INT32 clipxmask = 0, clipymask = 0; + //uint32_t coeff_line_color_screen_data; + int32_t clipxmask = 0, clipymask = 0; vcnt_shift = ((STV_VDP2_LSMD & 3) == 3); @@ -4891,7 +4891,7 @@ void saturn_state::stv_vdp2_copy_roz_bitmap(bitmap_rgb32 &bitmap, void saturn_state::stv_vdp2_draw_NBG0(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 base_mask; + uint32_t base_mask; base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff; @@ -4918,7 +4918,7 @@ void saturn_state::stv_vdp2_draw_NBG0(bitmap_rgb32 &bitmap, const rectangle &cli if ( STV_VDP2_N0CCEN ) { stv2_current_tilemap.colour_calculation_enabled = 1; - stv2_current_tilemap.alpha = ((UINT16)(0x1f-STV_VDP2_N0CCRT)*0xff)/0x1f; + stv2_current_tilemap.alpha = ((uint16_t)(0x1f-STV_VDP2_N0CCRT)*0xff)/0x1f; } else { @@ -4992,7 +4992,7 @@ void saturn_state::stv_vdp2_draw_NBG0(bitmap_rgb32 &bitmap, const rectangle &cli void saturn_state::stv_vdp2_draw_NBG1(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 base_mask; + uint32_t base_mask; base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff; @@ -5018,7 +5018,7 @@ void saturn_state::stv_vdp2_draw_NBG1(bitmap_rgb32 &bitmap, const rectangle &cli if ( STV_VDP2_N1CCEN ) { stv2_current_tilemap.colour_calculation_enabled = 1; - stv2_current_tilemap.alpha = ((UINT16)(0x1f-STV_VDP2_N1CCRT)*0xff)/0x1f; + stv2_current_tilemap.alpha = ((uint16_t)(0x1f-STV_VDP2_N1CCRT)*0xff)/0x1f; } else { @@ -5118,7 +5118,7 @@ void saturn_state::stv_vdp2_draw_NBG2(bitmap_rgb32 &bitmap, const rectangle &cli if ( STV_VDP2_N2CCEN ) { stv2_current_tilemap.colour_calculation_enabled = 1; - stv2_current_tilemap.alpha = ((UINT16)(0x1f-STV_VDP2_N2CCRT)*0xff)/0x1f; + stv2_current_tilemap.alpha = ((uint16_t)(0x1f-STV_VDP2_N2CCRT)*0xff)/0x1f; } else { @@ -5221,7 +5221,7 @@ void saturn_state::stv_vdp2_draw_NBG3(bitmap_rgb32 &bitmap, const rectangle &cli if ( STV_VDP2_N3CCEN ) { stv2_current_tilemap.colour_calculation_enabled = 1; - stv2_current_tilemap.alpha = ((UINT16)(0x1f-STV_VDP2_N3CCRT)*0xff)/0x1f; + stv2_current_tilemap.alpha = ((uint16_t)(0x1f-STV_VDP2_N3CCRT)*0xff)/0x1f; } else { @@ -5299,8 +5299,8 @@ void saturn_state::stv_vdp2_draw_rotation_screen(bitmap_rgb32 &bitmap, const rec rectangle roz_clip_rect, mycliprect; int planesizex = 0, planesizey = 0; int planerenderedsizex, planerenderedsizey; - UINT8 colour_calculation_enabled; - UINT8 fade_control; + uint8_t colour_calculation_enabled; + uint8_t fade_control; if ( iRP == 1) { @@ -5501,7 +5501,7 @@ void saturn_state::stv_vdp2_draw_RBG0(bitmap_rgb32 &bitmap, const rectangle &cli if ( STV_VDP2_R0CCEN ) { stv2_current_tilemap.colour_calculation_enabled = 1; - stv2_current_tilemap.alpha = ((UINT16)(0x1f-STV_VDP2_R0CCRT)*0xff)/0x1f; + stv2_current_tilemap.alpha = ((uint16_t)(0x1f-STV_VDP2_R0CCRT)*0xff)/0x1f; } else { @@ -5581,9 +5581,9 @@ void saturn_state::stv_vdp2_draw_RBG0(bitmap_rgb32 &bitmap, const rectangle &cli void saturn_state::stv_vdp2_draw_back(bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; - UINT8* gfxdata = m_vdp2.gfx_decode.get(); - UINT32 base_offs,base_mask; - UINT8 interlace; + uint8_t* gfxdata = m_vdp2.gfx_decode.get(); + uint32_t base_offs,base_mask; + uint8_t interlace; interlace = (STV_VDP2_LSMD == 3)+1; @@ -5605,7 +5605,7 @@ void saturn_state::stv_vdp2_draw_back(bitmap_rgb32 &bitmap, const rectangle &cli for(x=cliprect.min_x;x<=cliprect.max_x;x++) { int r,g,b; - UINT16 dot; + uint16_t dot; dot = (gfxdata[base_offs+0]<<8)|gfxdata[base_offs+1]; b = pal5bit((dot & 0x7c00) >> 10); @@ -5627,7 +5627,7 @@ READ32_MEMBER ( saturn_state::saturn_vdp2_vram_r ) WRITE32_MEMBER ( saturn_state::saturn_vdp2_vram_w ) { - UINT8* gfxdata = m_vdp2.gfx_decode.get(); + uint8_t* gfxdata = m_vdp2.gfx_decode.get(); COMBINE_DATA(&m_vdp2_vram[offset]); @@ -5769,7 +5769,7 @@ READ32_MEMBER ( saturn_state::saturn_vdp2_cram_r ) WRITE32_MEMBER ( saturn_state::saturn_vdp2_cram_w ) { int r,g,b; - UINT8 cmode0; + uint8_t cmode0; cmode0 = (STV_VDP2_CRMD & 3) == 0; @@ -5819,7 +5819,7 @@ void saturn_state::refresh_palette_data( void ) { int r,g,b; int c_i; - UINT8 bank; + uint8_t bank; switch( STV_VDP2_CRMD ) { @@ -5943,7 +5943,7 @@ int saturn_state::get_pixel_clock( void ) } /* TODO: hblank position and hblank firing doesn't really match HW behaviour. */ -UINT8 saturn_state::get_hblank( void ) +uint8_t saturn_state::get_hblank( void ) { const rectangle &visarea = machine().first_screen()->visible_area(); int cur_h = machine().first_screen()->hpos(); @@ -5954,7 +5954,7 @@ UINT8 saturn_state::get_hblank( void ) return 0; } -UINT8 saturn_state::get_vblank( void ) +uint8_t saturn_state::get_vblank( void ) { int cur_v,vblank; cur_v = machine().first_screen()->vpos(); @@ -5967,7 +5967,7 @@ UINT8 saturn_state::get_vblank( void ) return 0; } -UINT8 saturn_state::get_odd_bit( void ) +uint8_t saturn_state::get_odd_bit( void ) { if(STV_VDP2_HRES & 4) //exclusive monitor mode makes this bit to be always 1 return 1; @@ -6057,9 +6057,9 @@ int saturn_state::get_vcounter( void ) void saturn_state::stv_vdp2_state_save_postload( void ) { - UINT8 *gfxdata = m_vdp2.gfx_decode.get(); + uint8_t *gfxdata = m_vdp2.gfx_decode.get(); int offset; - UINT32 data; + uint32_t data; for ( offset = 0; offset < 0x100000/4; offset++ ) { @@ -6101,10 +6101,10 @@ int saturn_state::stv_vdp2_start ( void ) { machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(saturn_state::stv_vdp2_exit), this)); - m_vdp2_regs = make_unique_clear(0x040000/2 ); - m_vdp2_vram = make_unique_clear(0x100000/4 ); - m_vdp2_cram = make_unique_clear(0x080000/4 ); - m_vdp2.gfx_decode = std::make_unique(0x100000 ); + m_vdp2_regs = make_unique_clear(0x040000/2 ); + m_vdp2_vram = make_unique_clear(0x100000/4 ); + m_vdp2_cram = make_unique_clear(0x080000/4 ); + m_vdp2.gfx_decode = std::make_unique(0x100000 ); // m_gfxdecode->gfx(0)->granularity()=4; // m_gfxdecode->gfx(1)->granularity()=4; @@ -6203,8 +6203,8 @@ void saturn_state::stv_vdp2_fade_effects( void ) Note:We have to use temporary storages because palette_get_color must use variables setted with unsigned int8 */ - INT16 t_r,t_g,t_b; - UINT8 r,g,b; + int16_t t_r,t_g,t_b; + uint8_t r,g,b; rgb_t color; int i; //popmessage("%04x %04x",STV_VDP2_CLOFEN,STV_VDP2_CLOFSL); @@ -6336,7 +6336,7 @@ void saturn_state::stv_vdp2_get_window1_coordinates(int *s_x, int *e_x, int *s_y } -int saturn_state::get_window_pixel(int s_x,int e_x,int s_y,int e_y,int x, int y,UINT8 win_num) +int saturn_state::get_window_pixel(int s_x,int e_x,int s_y,int e_y,int x, int y,uint8_t win_num) { int res; @@ -6405,35 +6405,35 @@ int saturn_state::stv_vdp2_apply_window_on_layer(rectangle &cliprect) } } -void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 pri) +void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t pri) { int x,y,r,g,b; int i; - UINT16 pix; - UINT16 *framebuffer_line; - UINT32 *bitmap_line, *bitmap_line2 = nullptr; - UINT8 interlace_framebuffer; - UINT8 double_x; - static const UINT16 sprite_colormask_table[] = { + uint16_t pix; + uint16_t *framebuffer_line; + uint32_t *bitmap_line, *bitmap_line2 = nullptr; + uint8_t interlace_framebuffer; + uint8_t double_x; + static const uint16_t sprite_colormask_table[] = { 0x07ff, 0x07ff, 0x07ff, 0x07ff, 0x03ff, 0x07ff, 0x03ff, 0x01ff, 0x007f, 0x003f, 0x003f, 0x003f, 0x00ff, 0x00ff, 0x00ff, 0x00ff }; - static const UINT16 priority_shift_table[] = { 14, 13, 14, 13, 13, 12, 12, 12, 7, 7, 6, 0, 7, 7, 6, 0 }; - static const UINT16 priority_mask_table[] = { 3, 7, 1, 3, 3, 7, 7, 7, 1, 1, 3, 0, 1, 1, 3, 0 }; - static const UINT16 ccrr_shift_table[] = { 11, 11, 11, 11, 10, 11, 10, 9, 0, 6, 0, 6, 0, 6, 0, 6 }; - static const UINT16 ccrr_mask_table[] = { 7, 3, 7, 3, 7, 1, 3, 7, 0, 1, 0, 3, 0, 1, 0, 3 }; - static const UINT16 shadow_mask_table[] = { 0, 0, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0, 0, 0, 0, 0, 0, 0, 0 }; - UINT16 alpha_enabled; + static const uint16_t priority_shift_table[] = { 14, 13, 14, 13, 13, 12, 12, 12, 7, 7, 6, 0, 7, 7, 6, 0 }; + static const uint16_t priority_mask_table[] = { 3, 7, 1, 3, 3, 7, 7, 7, 1, 1, 3, 0, 1, 1, 3, 0 }; + static const uint16_t ccrr_shift_table[] = { 11, 11, 11, 11, 10, 11, 10, 9, 0, 6, 0, 6, 0, 6, 0, 6 }; + static const uint16_t ccrr_mask_table[] = { 7, 3, 7, 3, 7, 1, 3, 7, 0, 1, 0, 3, 0, 1, 0, 3 }; + static const uint16_t shadow_mask_table[] = { 0, 0, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0, 0, 0, 0, 0, 0, 0, 0 }; + uint16_t alpha_enabled; int sprite_type; int sprite_colormask; int color_offset_pal; int sprite_shadow; - UINT16 sprite_priority_shift, sprite_priority_mask, sprite_ccrr_shift, sprite_ccrr_mask; - UINT8 priority; - UINT8 ccr = 0; - UINT8 sprite_priorities[8]; - UINT8 sprite_ccr[8]; + uint16_t sprite_priority_shift, sprite_priority_mask, sprite_ccrr_shift, sprite_ccrr_mask; + uint8_t priority; + uint8_t ccr = 0; + uint8_t sprite_priorities[8]; + uint8_t sprite_ccr[8]; int sprite_color_mode = STV_VDP2_SPCLMD; if ( (stv_sprite_priorities_usage_valid == 1) && (stv_sprite_priorities_used[pri] == 0) ) @@ -6644,7 +6644,7 @@ void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, } else { - bitmap_line[x] = alpha_blend_r32( bitmap_line[x], rgb_t(r, g ,b), ((UINT16)(0x1f-ccr)*0xff)/0x1f); + bitmap_line[x] = alpha_blend_r32( bitmap_line[x], rgb_t(r, g ,b), ((uint16_t)(0x1f-ccr)*0xff)/0x1f); } } else @@ -6691,7 +6691,7 @@ void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, } else { - bitmap_line[x] = alpha_blend_r32( bitmap_line[x], m_palette->pen(pix), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); + bitmap_line[x] = alpha_blend_r32( bitmap_line[x], m_palette->pen(pix), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); } } else @@ -6792,15 +6792,15 @@ void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, { if(double_x) { - bitmap_line[x*2] = alpha_blend_r32( bitmap_line[x*2], rgb_t(r, g, b), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); - if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = alpha_blend_r32( bitmap_line2[x*2], rgb_t(r, g, b), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); - bitmap_line[x*2+1] = alpha_blend_r32( bitmap_line[x*2+1], rgb_t(r, g, b), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); - if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = alpha_blend_r32( bitmap_line2[x*2+1], rgb_t(r, g, b), ((UINT16)(0x1f-ccr)*0xff)/0x1f); + bitmap_line[x*2] = alpha_blend_r32( bitmap_line[x*2], rgb_t(r, g, b), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); + if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = alpha_blend_r32( bitmap_line2[x*2], rgb_t(r, g, b), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); + bitmap_line[x*2+1] = alpha_blend_r32( bitmap_line[x*2+1], rgb_t(r, g, b), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); + if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = alpha_blend_r32( bitmap_line2[x*2+1], rgb_t(r, g, b), ((uint16_t)(0x1f-ccr)*0xff)/0x1f); } else { - bitmap_line[x] = alpha_blend_r32( bitmap_line[x], rgb_t(r, g, b), ((UINT16)(0x1f-ccr)*0xff)/0x1f); - if ( interlace_framebuffer == 1 ) bitmap_line2[x] = alpha_blend_r32( bitmap_line2[x], rgb_t(r, g, b), ((UINT16)(0x1f-ccr)*0xff)/0x1f); + bitmap_line[x] = alpha_blend_r32( bitmap_line[x], rgb_t(r, g, b), ((uint16_t)(0x1f-ccr)*0xff)/0x1f); + if ( interlace_framebuffer == 1 ) bitmap_line2[x] = alpha_blend_r32( bitmap_line2[x], rgb_t(r, g, b), ((uint16_t)(0x1f-ccr)*0xff)/0x1f); } } } @@ -6886,15 +6886,15 @@ void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, { if(double_x) { - bitmap_line[x*2] = alpha_blend_r32( bitmap_line[x*2], m_palette->pen(pix), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); - if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = alpha_blend_r32( bitmap_line2[x], m_palette->pen(pix), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); - bitmap_line[x*2+1] = alpha_blend_r32( bitmap_line[x*2+1], m_palette->pen(pix), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); - if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = alpha_blend_r32( bitmap_line2[x], m_palette->pen(pix), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); + bitmap_line[x*2] = alpha_blend_r32( bitmap_line[x*2], m_palette->pen(pix), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); + if ( interlace_framebuffer == 1 ) bitmap_line2[x*2] = alpha_blend_r32( bitmap_line2[x], m_palette->pen(pix), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); + bitmap_line[x*2+1] = alpha_blend_r32( bitmap_line[x*2+1], m_palette->pen(pix), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); + if ( interlace_framebuffer == 1 ) bitmap_line2[x*2+1] = alpha_blend_r32( bitmap_line2[x], m_palette->pen(pix), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); } else { - bitmap_line[x] = alpha_blend_r32( bitmap_line[x], m_palette->pen(pix), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); - if ( interlace_framebuffer == 1 ) bitmap_line2[x] = alpha_blend_r32( bitmap_line2[x], m_palette->pen(pix), ((UINT16)(0x1f-ccr)*0xff)/0x1f ); + bitmap_line[x] = alpha_blend_r32( bitmap_line[x], m_palette->pen(pix), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); + if ( interlace_framebuffer == 1 ) bitmap_line2[x] = alpha_blend_r32( bitmap_line2[x], m_palette->pen(pix), ((uint16_t)(0x1f-ccr)*0xff)/0x1f ); } } } @@ -6926,7 +6926,7 @@ void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, stv_sprite_priorities_usage_valid = 1; } -UINT32 saturn_state::screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t saturn_state::screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { stv_vdp2_fade_effects(); @@ -6934,7 +6934,7 @@ UINT32 saturn_state::screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 if(STV_VDP2_DISP) { - UINT8 pri; + uint8_t pri; stv_sprite_priorities_usage_valid = 0; memset(stv_sprite_priorities_used, 0, sizeof(stv_sprite_priorities_used)); diff --git a/src/devices/video/t6a04.cpp b/src/devices/video/t6a04.cpp index 71b8e89d3bb..72df41a52d9 100644 --- a/src/devices/video/t6a04.cpp +++ b/src/devices/video/t6a04.cpp @@ -36,7 +36,7 @@ void t6a04_device::device_validity_check(validity_checker &valid) const // t6a04_device - constructor //------------------------------------------------- -t6a04_device::t6a04_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +t6a04_device::t6a04_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, T6A04, "T6A04", tag, owner, clock, "t6a04", __FILE__), m_busy_flag(0), m_display_on(0), m_contrast(0), m_xpos(0), m_ypos(0), m_zpos(0), m_direction(0), m_active_counter(0), m_word_len(0), m_opa1(0), m_opa2(0), m_output_reg(0), m_height(0), @@ -94,17 +94,17 @@ void t6a04_device::device_reset() // device interface //************************************************************************** -UINT32 t6a04_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t t6a04_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 ypages = m_width>>3; - UINT8 last_line = m_zpos + m_height; + uint8_t ypages = m_width>>3; + uint8_t last_line = m_zpos + m_height; if (m_display_on) { for (int y=0; y=0; b--) { @@ -193,9 +193,9 @@ WRITE8_MEMBER(t6a04_device::data_write) { //6bit mode data = data<<0x02; - UINT8 start_bit = m_ypos * 6; - UINT8 pos_bit = start_bit & 0x07; - UINT8 *ti82_video = &m_lcd_ram[(m_xpos*15)+(start_bit>>3)]; + uint8_t start_bit = m_ypos * 6; + uint8_t pos_bit = start_bit & 0x07; + uint8_t *ti82_video = &m_lcd_ram[(m_xpos*15)+(start_bit>>3)]; ti82_video[0] = (ti82_video[0] & ~(0xFC>>pos_bit)) | (data>>pos_bit); if(pos_bit>0x02) @@ -211,8 +211,8 @@ WRITE8_MEMBER(t6a04_device::data_write) READ8_MEMBER(t6a04_device::data_read) { - UINT8 data = m_output_reg; - UINT8 output_reg; + uint8_t data = m_output_reg; + uint8_t output_reg; if (m_word_len) { @@ -222,9 +222,9 @@ READ8_MEMBER(t6a04_device::data_read) else { //6bit mode - UINT8 start_bit = m_ypos * 6; - UINT8 pos_bit = start_bit & 7; - UINT8 *ti82_video = &m_lcd_ram[(m_xpos*15)+(start_bit>>3)]; + uint8_t start_bit = m_ypos * 6; + uint8_t pos_bit = start_bit & 7; + uint8_t *ti82_video = &m_lcd_ram[(m_xpos*15)+(start_bit>>3)]; output_reg = ((((*ti82_video)<<8)+ti82_video[1])>>(10-pos_bit)); } diff --git a/src/devices/video/t6a04.h b/src/devices/video/t6a04.h index 70d2c938855..fb5cb23d92c 100644 --- a/src/devices/video/t6a04.h +++ b/src/devices/video/t6a04.h @@ -21,7 +21,7 @@ class t6a04_device : public device_t { public: // construction/destruction - t6a04_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + t6a04_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_size(device_t &device, int w, int h) { @@ -36,7 +36,7 @@ public: DECLARE_WRITE8_MEMBER(data_write); DECLARE_READ8_MEMBER(data_read); - 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 @@ -45,22 +45,22 @@ protected: virtual void device_validity_check(validity_checker &valid) const override; private: - UINT8 m_busy_flag; - UINT8 m_lcd_ram[960]; //7680 bit (64*120) - UINT8 m_display_on; - UINT8 m_contrast; - UINT8 m_xpos; - UINT8 m_ypos; - UINT8 m_zpos; - INT8 m_direction; - UINT8 m_active_counter; - UINT8 m_word_len; - UINT8 m_opa1; - UINT8 m_opa2; - UINT8 m_output_reg; - - UINT8 m_height; // number of lines - UINT8 m_width; // pixels for line + uint8_t m_busy_flag; + uint8_t m_lcd_ram[960]; //7680 bit (64*120) + uint8_t m_display_on; + uint8_t m_contrast; + uint8_t m_xpos; + uint8_t m_ypos; + uint8_t m_zpos; + int8_t m_direction; + uint8_t m_active_counter; + uint8_t m_word_len; + uint8_t m_opa1; + uint8_t m_opa2; + uint8_t m_output_reg; + + uint8_t m_height; // number of lines + uint8_t m_width; // pixels for line }; // device type definition diff --git a/src/devices/video/tea1002.cpp b/src/devices/video/tea1002.cpp index ba518e6a6ac..b42d7d7a8f3 100644 --- a/src/devices/video/tea1002.cpp +++ b/src/devices/video/tea1002.cpp @@ -49,7 +49,7 @@ const device_type TEA1002 = &device_creator; // paula_device - constructor //------------------------------------------------- -tea1002_device::tea1002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +tea1002_device::tea1002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TEA1002, "TEA1002 PAL colour encoder", tag, owner, clock, "tea1002", __FILE__) { } diff --git a/src/devices/video/tea1002.h b/src/devices/video/tea1002.h index b06d798b720..d5107beec93 100644 --- a/src/devices/video/tea1002.h +++ b/src/devices/video/tea1002.h @@ -45,7 +45,7 @@ class tea1002_device : public device_t { public: // construction/destruction - tea1002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tea1002_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); rgb_t color(int index); diff --git a/src/devices/video/tlc34076.cpp b/src/devices/video/tlc34076.cpp index b695ce08ed7..476b2f38829 100644 --- a/src/devices/video/tlc34076.cpp +++ b/src/devices/video/tlc34076.cpp @@ -41,7 +41,7 @@ const device_type TLC34076 = &device_creator; //------------------------------------------------- // tlc34076_device - constructor //------------------------------------------------- -tlc34076_device::tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tlc34076_device::tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TLC34076, "TLC34076 VIP", tag, owner, clock, "tlc34076", __FILE__), m_dacbits(6) { @@ -138,7 +138,7 @@ const rgb_t *tlc34076_device::get_pens() READ8_MEMBER( tlc34076_device::read ) { - UINT8 result; + uint8_t result; /* keep in range */ offset &= 0x0f; @@ -173,7 +173,7 @@ READ8_MEMBER( tlc34076_device::read ) WRITE8_MEMBER( tlc34076_device::write ) { -// UINT8 oldval; +// uint8_t oldval; /* keep in range */ offset &= 0x0f; diff --git a/src/devices/video/tlc34076.h b/src/devices/video/tlc34076.h index cd66143d9b7..6375ecdf4be 100644 --- a/src/devices/video/tlc34076.h +++ b/src/devices/video/tlc34076.h @@ -34,7 +34,7 @@ class tlc34076_device : public device_t { public: // construction/destruction - tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers static void static_set_bits(device_t &device, tlc34076_bits bits); @@ -51,12 +51,12 @@ protected: private: // internal state - UINT8 m_local_paletteram[0x300]; - UINT8 m_regs[0x10]; - UINT8 m_palettedata[3]; - UINT8 m_writeindex; - UINT8 m_readindex; - UINT8 m_dacbits; + uint8_t m_local_paletteram[0x300]; + uint8_t m_regs[0x10]; + uint8_t m_palettedata[3]; + uint8_t m_writeindex; + uint8_t m_readindex; + uint8_t m_dacbits; rgb_t m_pens[0x100]; }; diff --git a/src/devices/video/tms34061.cpp b/src/devices/video/tms34061.cpp index 8d535b2951a..3c7aebcc357 100644 --- a/src/devices/video/tms34061.cpp +++ b/src/devices/video/tms34061.cpp @@ -29,7 +29,7 @@ const device_type TMS34061 = &device_creator; -tms34061_device::tms34061_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms34061_device::tms34061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS34061, "TMS34061 VSC", tag, owner, clock, "tms34061", __FILE__), device_video_interface(mconfig, *this), m_rowshift(0), @@ -61,10 +61,10 @@ void tms34061_device::device_start() m_vrammask = m_vramsize - 1; /* allocate memory for VRAM */ - m_vram = auto_alloc_array_clear(machine(), UINT8, m_vramsize + 256 * 2); + m_vram = auto_alloc_array_clear(machine(), uint8_t, m_vramsize + 256 * 2); /* allocate memory for latch RAM */ - m_latchram = auto_alloc_array_clear(machine(), UINT8, m_vramsize + 256 * 2); + m_latchram = auto_alloc_array_clear(machine(), uint8_t, m_vramsize + 256 * 2); /* add some buffer space for VRAM and latch RAM */ m_vram += 256; @@ -168,7 +168,7 @@ TIMER_CALLBACK_MEMBER( tms34061_device::interrupt ) * *************************************/ -void tms34061_device::register_w(address_space &space, offs_t offset, UINT8 data) +void tms34061_device::register_w(address_space &space, offs_t offset, uint8_t data) { int scanline; int regnum = offset >> 2; @@ -239,10 +239,10 @@ void tms34061_device::register_w(address_space &space, offs_t offset, UINT8 data * *************************************/ -UINT8 tms34061_device::register_r(address_space &space, offs_t offset) +uint8_t tms34061_device::register_r(address_space &space, offs_t offset) { int regnum = offset >> 2; - UINT16 result; + uint16_t result; /* extract the correct portion of the register */ if (regnum < ARRAY_LENGTH(m_regs)) @@ -361,7 +361,7 @@ void tms34061_device::adjust_xyaddress(int offset) } -void tms34061_device::xypixel_w(address_space &space, int offset, UINT8 data) +void tms34061_device::xypixel_w(address_space &space, int offset, uint8_t data) { /* determine the offset, then adjust it */ offs_t pixeloffs = m_regs[TMS34061_XYADDRESS]; @@ -381,7 +381,7 @@ void tms34061_device::xypixel_w(address_space &space, int offset, UINT8 data) } -UINT8 tms34061_device::xypixel_r(address_space &space, int offset) +uint8_t tms34061_device::xypixel_r(address_space &space, int offset) { /* determine the offset, then adjust it */ offs_t pixeloffs = m_regs[TMS34061_XYADDRESS]; @@ -406,7 +406,7 @@ UINT8 tms34061_device::xypixel_r(address_space &space, int offset) * *************************************/ -void tms34061_device::write(address_space &space, int col, int row, int func, UINT8 data) +void tms34061_device::write(address_space &space, int col, int row, int func, uint8_t data) { offs_t offs; @@ -468,7 +468,7 @@ void tms34061_device::write(address_space &space, int col, int row, int func, UI } -UINT8 tms34061_device::read(address_space &space, int col, int row, int func) +uint8_t tms34061_device::read(address_space &space, int col, int row, int func) { int result = 0; offs_t offs; diff --git a/src/devices/video/tms34061.h b/src/devices/video/tms34061.h index 814bf8b39c8..c82bebd2db9 100644 --- a/src/devices/video/tms34061.h +++ b/src/devices/video/tms34061.h @@ -51,10 +51,10 @@ enum /* display state structure */ struct tms34061_display { - UINT8 blanked; /* true if blanked */ - UINT8 *vram; /* base of VRAM */ - UINT8 *latchram; /* base of latch RAM */ - UINT16 *regs; /* pointer to array of registers */ + uint8_t blanked; /* true if blanked */ + uint8_t *vram; /* base of VRAM */ + uint8_t *latchram; /* base of latch RAM */ + uint16_t *regs; /* pointer to array of registers */ offs_t dispstart; /* display start */ }; @@ -68,15 +68,15 @@ class tms34061_device : public device_t, { public: // construction/destruction - tms34061_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms34061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - static void set_rowshift(device_t &device, UINT8 rowshift) { downcast(device).m_rowshift = rowshift; } - static void set_vram_size(device_t &device, UINT32 vramsize) { downcast(device).m_vramsize = vramsize; } + static void set_rowshift(device_t &device, uint8_t rowshift) { downcast(device).m_rowshift = rowshift; } + static void set_vram_size(device_t &device, uint32_t vramsize) { downcast(device).m_vramsize = vramsize; } template static devcb_base &set_interrupt_callback(device_t &device, _Object object) { return downcast(device).m_interrupt_cb.set_callback(object); } /* reads/writes to the 34061 */ - UINT8 read(address_space &space, int col, int row, int func); - void write(address_space &space, int col, int row, int func, UINT8 data); + uint8_t read(address_space &space, int col, int row, int func); + void write(address_space &space, int col, int row, int func, uint8_t data); /* latch settings */ DECLARE_READ8_MEMBER( latch_r ); @@ -93,27 +93,27 @@ protected: virtual void device_reset() override; private: - UINT8 m_rowshift; /* VRAM address is (row << rowshift) | col */ - UINT32 m_vramsize; /* size of video RAM */ + uint8_t m_rowshift; /* VRAM address is (row << rowshift) | col */ + uint32_t m_vramsize; /* size of video RAM */ devcb_write_line m_interrupt_cb; /* interrupt gen callback */ - UINT16 m_regs[TMS34061_REGCOUNT]; - UINT16 m_xmask; - UINT8 m_yshift; - UINT32 m_vrammask; - UINT8 * m_vram; - UINT8 * m_latchram; - UINT8 m_latchdata; - UINT8 * m_shiftreg; + uint16_t m_regs[TMS34061_REGCOUNT]; + uint16_t m_xmask; + uint8_t m_yshift; + uint32_t m_vrammask; + uint8_t * m_vram; + uint8_t * m_latchram; + uint8_t m_latchdata; + uint8_t * m_shiftreg; emu_timer * m_timer; void update_interrupts(void); TIMER_CALLBACK_MEMBER( interrupt ); - void register_w(address_space &space, offs_t offset, UINT8 data); - UINT8 register_r(address_space &space, offs_t offset); + void register_w(address_space &space, offs_t offset, uint8_t data); + uint8_t register_r(address_space &space, offs_t offset); void adjust_xyaddress(int offset); - void xypixel_w(address_space &space, int offset, UINT8 data); - UINT8 xypixel_r(address_space &space, int offset); + void xypixel_w(address_space &space, int offset, uint8_t data); + uint8_t xypixel_r(address_space &space, int offset); }; // device type definition diff --git a/src/devices/video/tms3556.cpp b/src/devices/video/tms3556.cpp index 716b1c0269d..0543cdfb332 100644 --- a/src/devices/video/tms3556.cpp +++ b/src/devices/video/tms3556.cpp @@ -56,7 +56,7 @@ const address_space_config *tms3556_device::memory_space_config(address_spacenum // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT8 tms3556_device::readbyte(offs_t address) +inline uint8_t tms3556_device::readbyte(offs_t address) { return space().read_byte(address&0xFFFF); } @@ -66,7 +66,7 @@ inline UINT8 tms3556_device::readbyte(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void tms3556_device::writebyte(offs_t address, UINT8 data) +inline void tms3556_device::writebyte(offs_t address, uint8_t data) { space().write_byte(address&0xFFFF, data); } @@ -80,7 +80,7 @@ inline void tms3556_device::writebyte(offs_t address, UINT8 data) // tms3556_device - constructor //------------------------------------------------- -tms3556_device::tms3556_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms3556_device::tms3556_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TMS3556, "Texas Instruments VDP TMS3556", tag, owner, clock, "tms3556", __FILE__), device_memory_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 17, 0, nullptr, *ADDRESS_MAP_NAME(tms3556)), @@ -137,7 +137,7 @@ void tms3556_device::device_start() /*static const char *const tms3556_mode_names[] = { "DISPLAY OFF", "TEXT", "GRAPHIC", "MIXED" };*/ -UINT32 tms3556_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tms3556_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; @@ -150,7 +150,7 @@ UINT32 tms3556_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap READ8_MEMBER( tms3556_device::vram_r ) { - UINT8 ret; + uint8_t ret; if (m_bamp_written) { m_bamp_written=false; m_vdp_acmpxy_mode=dma_write; @@ -324,7 +324,7 @@ READ8_MEMBER( tms3556_device::initptr_r ) // top and bottom borders, and screen off mode) //------------------------------------------------- -void tms3556_device::draw_line_empty(UINT16 *ln) +void tms3556_device::draw_line_empty(uint16_t *ln) { int i; @@ -341,10 +341,10 @@ void tms3556_device::draw_line_empty(UINT16 *ln) // (called by draw_line_text and draw_line_mixed) //------------------------------------------------- -void tms3556_device::draw_line_text_common(UINT16 *ln) +void tms3556_device::draw_line_text_common(uint16_t *ln) { int pattern, x, xx, i, name_offset; - UINT16 fg, bg; + uint16_t fg, bg; offs_t nametbl_base; offs_t patterntbl_base[4]; int name_hi, name_lo; @@ -411,7 +411,7 @@ void tms3556_device::draw_line_text_common(UINT16 *ln) { /* single width */ for (xx = 0; xx < 8; xx++) { - UINT16 color = (pattern & 0x80) ? fg : bg; + uint16_t color = (pattern & 0x80) ? fg : bg; #if TMS3556_DOUBLE_WIDTH *ln++ = color; #endif @@ -427,7 +427,7 @@ void tms3556_device::draw_line_text_common(UINT16 *ln) pattern <<= 4; for (xx = 0; xx < 4; xx++) { - UINT16 color = (pattern & 0x80) ? fg : bg; + uint16_t color = (pattern & 0x80) ? fg : bg; #if TMS3556_DOUBLE_WIDTH *ln++ = color; *ln++ = color; #endif @@ -455,7 +455,7 @@ void tms3556_device::draw_line_text_common(UINT16 *ln) // (called by draw_line_bitmap and draw_line_mixed) //------------------------------------------------- -void tms3556_device::draw_line_bitmap_common(UINT16 *ln) +void tms3556_device::draw_line_bitmap_common(uint16_t *ln) { int x, xx; offs_t nametbl_base; @@ -476,7 +476,7 @@ void tms3556_device::draw_line_bitmap_common(UINT16 *ln) name_r = readbyte(nametbl_base + m_name_offset + 2); for (xx = 0; xx < 8; xx++) { - UINT16 color = ((name_b >> 5) & 0x4) | ((name_g >> 6) & 0x2) | ((name_r >> 7) & 0x1); + uint16_t color = ((name_b >> 5) & 0x4) | ((name_g >> 6) & 0x2) | ((name_r >> 7) & 0x1); #if TMS3556_DOUBLE_WIDTH *ln++ = color; #endif @@ -500,7 +500,7 @@ void tms3556_device::draw_line_bitmap_common(UINT16 *ln) // draw_line_text - draw a line in text mode //------------------------------------------------- -void tms3556_device::draw_line_text(UINT16 *ln) +void tms3556_device::draw_line_text(uint16_t *ln) { if (m_char_line_counter == 0) m_char_line_counter = 10; @@ -513,7 +513,7 @@ void tms3556_device::draw_line_text(UINT16 *ln) // draw_line_bitmap - draw a line in bitmap mode //------------------------------------------------- -void tms3556_device::draw_line_bitmap(UINT16 *ln) +void tms3556_device::draw_line_bitmap(uint16_t *ln) { draw_line_bitmap_common(ln); m_bg_color = (readbyte(m_address_regs[2] + m_name_offset) >> 5) & 0x7; @@ -525,7 +525,7 @@ void tms3556_device::draw_line_bitmap(UINT16 *ln) // draw_line_mixed - draw a line in mixed mode //------------------------------------------------- -void tms3556_device::draw_line_mixed(UINT16 *ln) +void tms3556_device::draw_line_mixed(uint16_t *ln) { if (m_cg_flag) { /* bitmap line */ @@ -558,7 +558,7 @@ void tms3556_device::draw_line_mixed(UINT16 *ln) void tms3556_device::draw_line(bitmap_ind16 &bmp, int line) { int double_lines; - UINT16 *ln, *ln2; + uint16_t *ln, *ln2; // if (m_control_regs[4] & 0x??) // { // interlaced mode diff --git a/src/devices/video/tms3556.h b/src/devices/video/tms3556.h index d367a3efc48..7568f6443b9 100644 --- a/src/devices/video/tms3556.h +++ b/src/devices/video/tms3556.h @@ -69,7 +69,7 @@ class tms3556_device : public device_t, { public: // construction/destruction - tms3556_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms3556_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( vram_r ); DECLARE_WRITE8_MEMBER( vram_w ); @@ -79,7 +79,7 @@ public: void interrupt(running_machine &machine); - 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 @@ -91,22 +91,22 @@ protected: // address space configurations const address_space_config m_space_config; - inline UINT8 readbyte(offs_t address); - inline void writebyte(offs_t address, UINT8 data); + inline uint8_t readbyte(offs_t address); + inline void writebyte(offs_t address, uint8_t data); - void draw_line_empty(UINT16 *ln); - void draw_line_text_common(UINT16 *ln); - void draw_line_bitmap_common(UINT16 *ln); - void draw_line_text(UINT16 *ln); - void draw_line_bitmap(UINT16 *ln); - void draw_line_mixed(UINT16 *ln); + void draw_line_empty(uint16_t *ln); + void draw_line_text_common(uint16_t *ln); + void draw_line_bitmap_common(uint16_t *ln); + void draw_line_text(uint16_t *ln); + void draw_line_bitmap(uint16_t *ln); + void draw_line_mixed(uint16_t *ln); void draw_line(bitmap_ind16 &bmp, int line); void interrupt_start_vblank(void); private: // registers - UINT8 m_control_regs[8]; - UINT16 m_address_regs[8]; + uint8_t m_control_regs[8]; + uint16_t m_address_regs[8]; // register interface int m_reg_access_phase; @@ -115,8 +115,8 @@ private: int m_bamp_written; int m_colrow; dma_mode_tt m_vdp_acmpxy_mode; - UINT16 m_vdp_acmpxy; - UINT16 m_vdp_acmp; + uint16_t m_vdp_acmpxy; + uint16_t m_vdp_acmp; int m_init_read; int m_scanline; // scanline counter diff --git a/src/devices/video/tms9927.cpp b/src/devices/video/tms9927.cpp index 446305cd60d..08a4efd8ef5 100644 --- a/src/devices/video/tms9927.cpp +++ b/src/devices/video/tms9927.cpp @@ -10,8 +10,8 @@ #include "video/tms9927.h" -static const UINT8 chars_per_row_value[8] = { 20, 32, 40, 64, 72, 80, 96, 132 }; -static const UINT8 skew_bits_value[4] = { 0, 1, 2, 2 }; +static const uint8_t chars_per_row_value[8] = { 20, 32, 40, 64, 72, 80, 96, 132 }; +static const uint8_t skew_bits_value[4] = { 0, 1, 2, 2 }; #define HCOUNT (m_reg[0] + 1) @@ -34,13 +34,13 @@ const device_type CRT5027 = &device_creator; const device_type CRT5037 = &device_creator; const device_type CRT5057 = &device_creator; -tms9927_device::tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9927_device::tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9927_device(mconfig, TMS9927, "TMS9927 VTC", tag, owner, clock, "tms9927", __FILE__) { memset(m_reg, 0x00, sizeof(m_reg)); } -tms9927_device::tms9927_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) +tms9927_device::tms9927_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_video_interface(mconfig, *this) , m_write_vsyn(*this) @@ -51,17 +51,17 @@ tms9927_device::tms9927_device(const machine_config &mconfig, device_type type, memset(m_reg, 0x00, sizeof(m_reg)); } -crt5027_device::crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crt5027_device::crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9927_device(mconfig, CRT5027, "CRT5027", tag, owner, clock, "crt5027", __FILE__) { } -crt5037_device::crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crt5037_device::crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9927_device(mconfig, CRT5037, "CRT5037", tag, owner, clock, "crt5037", __FILE__) { } -crt5057_device::crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +crt5057_device::crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9927_device(mconfig, CRT5057, "CRT5057", tag, owner, clock, "crt5057", __FILE__) { } @@ -269,7 +269,7 @@ int tms9927_device::cursor_bounds(rectangle &bounds) void tms9927_device::recompute_parameters(int postload) { - UINT16 offset_hpix, offset_vpix; + uint16_t offset_hpix, offset_vpix; attoseconds_t refresh; rectangle visarea; diff --git a/src/devices/video/tms9927.h b/src/devices/video/tms9927.h index ba8e25f9e79..cc5d55ada2c 100644 --- a/src/devices/video/tms9927.h +++ b/src/devices/video/tms9927.h @@ -24,8 +24,8 @@ class tms9927_device : public device_t, public device_video_interface { public: - tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms9927_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); + tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms9927_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); ~tms9927_device() {} template static devcb_base &set_vsyn_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_vsyn.set_callback(object); } @@ -61,18 +61,18 @@ private: int m_hpixels_per_column; /* number of pixels per video memory address */ // internal state - optional_region_ptr m_selfload; + optional_region_ptr m_selfload; /* live state */ - UINT32 m_clock; - UINT8 m_reg[9]; - UINT8 m_start_datarow; - UINT8 m_reset; + uint32_t m_clock; + uint8_t m_reg[9]; + uint8_t m_start_datarow; + uint8_t m_reset; /* derived state; no need to save */ - UINT8 m_valid_config; - UINT16 m_total_hpix, m_total_vpix; - UINT16 m_visible_hpix, m_visible_vpix; + uint8_t m_valid_config; + uint16_t m_total_hpix, m_total_vpix; + uint16_t m_visible_hpix, m_visible_vpix; int m_vsyn; @@ -84,7 +84,7 @@ extern const device_type TMS9927; class crt5027_device : public tms9927_device { public: - crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type CRT5027; @@ -92,7 +92,7 @@ extern const device_type CRT5027; class crt5037_device : public tms9927_device { public: - crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type CRT5037; @@ -100,7 +100,7 @@ extern const device_type CRT5037; class crt5057_device : public tms9927_device { public: - crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; extern const device_type CRT5057; diff --git a/src/devices/video/tms9928a.cpp b/src/devices/video/tms9928a.cpp index 5f4fcec92ec..0a1fcfa17da 100644 --- a/src/devices/video/tms9928a.cpp +++ b/src/devices/video/tms9928a.cpp @@ -54,7 +54,7 @@ static ADDRESS_MAP_START(memmap, AS_DATA, 8, tms9928a_device) AM_RANGE(0x0000, 0x3fff) AM_RAM ADDRESS_MAP_END -tms9928a_device::tms9928a_device( const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool is_50hz, bool is_reva, bool is_99, const char *shortname, const char *source) +tms9928a_device::tms9928a_device( const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, bool is_50hz, bool is_reva, bool is_99, const char *shortname, const char *source) : device_t( mconfig, type, name, tag, owner, clock, shortname, source), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -69,7 +69,7 @@ tms9928a_device::tms9928a_device( const machine_config &mconfig, device_type typ } -tms9928a_device::tms9928a_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock ) +tms9928a_device::tms9928a_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t( mconfig, TMS9928A, "TMS9928A VDP", tag, owner, clock, "tms9928a", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -84,37 +84,37 @@ tms9928a_device::tms9928a_device( const machine_config &mconfig, const char *tag // static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap)); } -tms9129_device::tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9129_device::tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9928a_device( mconfig, TMS9129, "TMS9129", tag, owner, clock, true, true, false, "tms9129", __FILE__) { } -tms9918_device::tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9918_device::tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9928a_device( mconfig, TMS9918, "TMS9918", tag, owner, clock, false, false, true, "tms9918", __FILE__) { } -tms9918a_device::tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9918a_device::tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9928a_device( mconfig, TMS9918A, "TMS9918A", tag, owner, clock, false, true, true, "tms9918a", __FILE__) { } -tms9118_device::tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9118_device::tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9928a_device( mconfig, TMS9118, "TMS9118 VDP", tag, owner, clock, false, true, false, "tms9118", __FILE__) { } -tms9128_device::tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9128_device::tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9928a_device( mconfig, TMS9128, "TMS9128 VDP", tag, owner, clock, false, true, false, "tms9128", __FILE__) { } -tms9929_device::tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9929_device::tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9928a_device( mconfig, TMS9929, "TMS9929", tag, owner, clock, true, false, true, "tms9929", __FILE__) { } -tms9929a_device::tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tms9929a_device::tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tms9928a_device( mconfig, TMS9929A, "TMS9929A", tag, owner, clock, true, true, true, "tms9929a", __FILE__) { } READ8_MEMBER( tms9928a_device::read ) { - UINT8 value = 0; + uint8_t value = 0; if ((offset & 1) == 0) value = vram_read(space, 0); @@ -137,7 +137,7 @@ READ8_MEMBER( tms9928a_device::vram_read ) // prevent debugger from changing the address base if (space.debugger_access()) return 0; - UINT8 data = m_ReadAhead; + uint8_t data = m_ReadAhead; m_ReadAhead = m_vram_space->read_byte(m_Addr); m_Addr = (m_Addr + 1) & (m_vram_size - 1); @@ -164,7 +164,7 @@ READ8_MEMBER( tms9928a_device::register_read ) // prevent debugger from changing the internal state if (space.debugger_access()) return 0; - UINT8 data = m_StatusReg; + uint8_t data = m_StatusReg; m_StatusReg = m_FifthSprite; check_interrupt(); @@ -177,7 +177,7 @@ READ8_MEMBER( tms9928a_device::register_read ) void tms9928a_device::check_interrupt() { // trigger if vblank and interrupt-enable bits are set - UINT8 b = (m_StatusReg & 0x80 && m_Regs[1] & 0x20) ? 1 : 0; + uint8_t b = (m_StatusReg & 0x80 && m_Regs[1] & 0x20) ? 1 : 0; if (b != m_INT) { @@ -205,9 +205,9 @@ void tms9928a_device::update_table_masks() } -void tms9928a_device::change_register(UINT8 reg, UINT8 val) +void tms9928a_device::change_register(uint8_t reg, uint8_t val) { - static const UINT8 Mask[8] = + static const uint8_t Mask[8] = { 0x03, 0xfb, 0x0f, 0xff, 0x07, 0x7f, 0x07, 0xff }; static const char *const modes[] = { @@ -217,7 +217,7 @@ void tms9928a_device::change_register(UINT8 reg, UINT8 val) "Mode 1+2+3 (BOGUS)" }; - UINT8 prev = m_Regs[reg]; + uint8_t prev = m_Regs[reg]; val &= Mask[reg]; m_Regs[reg] = val; @@ -334,8 +334,8 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par int raw_vpos = m_screen->vpos(); int vpos = raw_vpos * m_vertical_size / m_screen->height(); - UINT16 BackColour = m_Regs[7] & 15; - UINT32 *p = &m_tmpbmp.pix32(vpos); + uint16_t BackColour = m_Regs[7] & 15; + uint32_t *p = &m_tmpbmp.pix32(vpos); int y = vpos - m_top_border; @@ -367,13 +367,13 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par case 0: /* MODE 0 */ // if (vpos==100 ) popmessage("TMS9928A MODE 0"); { - UINT16 addr = m_nametbl + ( ( y & 0xF8 ) << 2 ); + uint16_t addr = m_nametbl + ( ( y & 0xF8 ) << 2 ); for ( int x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 256; x+= 8, addr++ ) { - UINT8 charcode = m_vram_space->read_byte( addr ); - UINT8 pattern = m_vram_space->read_byte( m_pattern + ( charcode << 3 ) + ( y & 7 ) ); - UINT8 colour = m_vram_space->read_byte( m_colour + ( charcode >> 3 ) ); + uint8_t charcode = m_vram_space->read_byte( addr ); + uint8_t pattern = m_vram_space->read_byte( m_pattern + ( charcode << 3 ) + ( y & 7 ) ); + uint8_t colour = m_vram_space->read_byte( m_colour + ( charcode >> 3 ) ); rgb_t fg = m_palette[(colour >> 4) ? (colour >> 4) : BackColour]; rgb_t bg = m_palette[(colour & 15) ? (colour & 15) : BackColour]; @@ -386,7 +386,7 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par case 1: /* MODE 1 */ //if (vpos==100 ) popmessage("TMS9928A MODE 1"); { - UINT16 addr = m_nametbl + ( ( y >> 3 ) * 40 ); + uint16_t addr = m_nametbl + ( ( y >> 3 ) * 40 ); rgb_t fg = m_palette[(m_Regs[7] >> 4) ? (m_Regs[7] >> 4) : BackColour]; rgb_t bg = m_palette[BackColour]; @@ -396,8 +396,8 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par for ( int x = TMS9928A_HORZ_DISPLAY_START + 6; x < TMS9928A_HORZ_DISPLAY_START + 246; x+= 6, addr++ ) { - UINT16 charcode = m_vram_space->read_byte( addr ); - UINT8 pattern = m_vram_space->read_byte( m_pattern + ( charcode << 3 ) + ( y & 7 ) ); + uint16_t charcode = m_vram_space->read_byte( addr ); + uint8_t pattern = m_vram_space->read_byte( m_pattern + ( charcode << 3 ) + ( y & 7 ) ); for ( int i = 0; i < 6; pattern <<= 1, i++ ) p[x+i] = ( pattern & 0x80 ) ? fg : bg; @@ -412,13 +412,13 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par case 2: /* MODE 2 */ //if (vpos==100 ) popmessage("TMS9928A MODE 2"); { - UINT16 addr = m_nametbl + ( ( y >> 3 ) * 32 ); + uint16_t addr = m_nametbl + ( ( y >> 3 ) * 32 ); for ( int x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 256; x+= 8, addr++ ) { - UINT16 charcode = m_vram_space->read_byte( addr ) + ( ( y >> 6 ) << 8 ); - UINT8 pattern = m_vram_space->read_byte( m_pattern + ( ( charcode & m_patternmask ) << 3 ) + ( y & 7 ) ); - UINT8 colour = m_vram_space->read_byte( m_colour + ( ( charcode & m_colourmask ) << 3 ) + ( y & 7 ) ); + uint16_t charcode = m_vram_space->read_byte( addr ) + ( ( y >> 6 ) << 8 ); + uint8_t pattern = m_vram_space->read_byte( m_pattern + ( ( charcode & m_patternmask ) << 3 ) + ( y & 7 ) ); + uint8_t colour = m_vram_space->read_byte( m_colour + ( ( charcode & m_colourmask ) << 3 ) + ( y & 7 ) ); rgb_t fg = m_palette[(colour >> 4) ? (colour >> 4) : BackColour]; rgb_t bg = m_palette[(colour & 15) ? (colour & 15) : BackColour]; @@ -431,7 +431,7 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par case 3: /* MODE 1+2 */ //if (vpos==100) popmessage("TMS9928A MODE1+2"); { - UINT16 addr = m_nametbl + ( ( y >> 3 ) * 40 ); + uint16_t addr = m_nametbl + ( ( y >> 3 ) * 40 ); rgb_t fg = m_palette[(m_Regs[7] >> 4) ? (m_Regs[7] >> 4) : BackColour]; rgb_t bg = m_palette[BackColour]; @@ -441,8 +441,8 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par for ( int x = TMS9928A_HORZ_DISPLAY_START + 6; x < TMS9928A_HORZ_DISPLAY_START + 246; x+= 6, addr++ ) { - UINT16 charcode = ( m_vram_space->read_byte( addr ) + ( ( y >> 6 ) << 8 ) ) & m_patternmask; - UINT8 pattern = m_vram_space->read_byte( m_pattern + ( charcode << 3 ) + ( y & 7 ) ); + uint16_t charcode = ( m_vram_space->read_byte( addr ) + ( ( y >> 6 ) << 8 ) ) & m_patternmask; + uint8_t pattern = m_vram_space->read_byte( m_pattern + ( charcode << 3 ) + ( y & 7 ) ); for ( int i = 0; i < 6; pattern <<= 1, i++ ) p[x+i] = ( pattern & 0x80 ) ? fg : bg; @@ -457,12 +457,12 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par case 4: /* MODE 3 */ //if (vpos==100 ) popmessage("TMS9928A MODE 3"); { - UINT16 addr = m_nametbl + ( ( y >> 3 ) * 32 ); + uint16_t addr = m_nametbl + ( ( y >> 3 ) * 32 ); for ( int x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 256; x+= 8, addr++ ) { - UINT8 charcode = m_vram_space->read_byte( addr ); - UINT8 colour = m_vram_space->read_byte( m_pattern + ( charcode << 3 ) + ( ( y >> 2 ) & 7 ) ); + uint8_t charcode = m_vram_space->read_byte( addr ); + uint8_t colour = m_vram_space->read_byte( m_pattern + ( charcode << 3 ) + ( ( y >> 2 ) & 7 ) ); rgb_t fg = m_palette[(colour >> 4) ? (colour >> 4) : BackColour]; rgb_t bg = m_palette[(colour & 15) ? (colour & 15) : BackColour]; @@ -497,12 +497,12 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par case 6: /* MODE 2+3 */ //if (vpos==100 ) popmessage("TMS9928A MODE 2+3"); { - UINT16 addr = m_nametbl + ( ( y >> 3 ) * 32 ); + uint16_t addr = m_nametbl + ( ( y >> 3 ) * 32 ); for ( int x = TMS9928A_HORZ_DISPLAY_START; x < TMS9928A_HORZ_DISPLAY_START + 256; x+= 8, addr++ ) { - UINT8 charcode = m_vram_space->read_byte( addr ); - UINT8 colour = m_vram_space->read_byte( m_pattern + ( ( ( charcode + ( ( y >> 2 ) & 7 ) + ( ( y >> 6 ) << 8 ) ) & m_patternmask ) << 3 ) ); + uint8_t charcode = m_vram_space->read_byte( addr ); + uint8_t colour = m_vram_space->read_byte( m_pattern + ( ( ( charcode + ( ( y >> 2 ) & 7 ) + ( ( y >> 6 ) << 8 ) ) & m_patternmask ) << 3 ) ); rgb_t fg = m_palette[(colour >> 4) ? (colour >> 4) : BackColour]; rgb_t bg = m_palette[(colour & 15) ? (colour & 15) : BackColour]; @@ -521,14 +521,14 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par } else { - UINT8 sprite_size = ( m_Regs[1] & 0x02 ) ? 16 : 8; - UINT8 sprite_mag = m_Regs[1] & 0x01; - UINT8 sprite_height = sprite_size * ( sprite_mag + 1 ); - UINT8 spr_drawn[32+256+32] = { 0 }; - UINT8 num_sprites = 0; + uint8_t sprite_size = ( m_Regs[1] & 0x02 ) ? 16 : 8; + uint8_t sprite_mag = m_Regs[1] & 0x01; + uint8_t sprite_height = sprite_size * ( sprite_mag + 1 ); + uint8_t spr_drawn[32+256+32] = { 0 }; + uint8_t num_sprites = 0; bool fifth_encountered = false; - for ( UINT16 sprattr = 0; sprattr < 128; sprattr += 4 ) + for ( uint16_t sprattr = 0; sprattr < 128; sprattr += 4 ) { int spr_y = m_vram_space->read_byte( m_spriteattribute + sprattr + 0 ); @@ -548,9 +548,9 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par if ( spr_y <= y && y < spr_y + sprite_height ) { int spr_x = m_vram_space->read_byte( m_spriteattribute + sprattr + 1 ); - UINT8 sprcode = m_vram_space->read_byte( m_spriteattribute + sprattr + 2 ); - UINT8 sprcol = m_vram_space->read_byte( m_spriteattribute + sprattr + 3 ); - UINT16 pataddr = m_spritepattern + ( ( sprite_size == 16 ) ? sprcode & ~0x03 : sprcode ) * 8; + uint8_t sprcode = m_vram_space->read_byte( m_spriteattribute + sprattr + 2 ); + uint8_t sprcol = m_vram_space->read_byte( m_spriteattribute + sprattr + 3 ); + uint16_t pataddr = m_spritepattern + ( ( sprite_size == 16 ) ? sprcode & ~0x03 : sprcode ) * 8; num_sprites++; @@ -566,7 +566,7 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par else pataddr += ( ( y - spr_y ) & 0x0F ); - UINT8 pattern = m_vram_space->read_byte( pataddr ); + uint8_t pattern = m_vram_space->read_byte( pataddr ); if ( sprcol & 0x80 ) spr_x -= 32; @@ -630,7 +630,7 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par } -UINT32 tms9928a_device::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t tms9928a_device::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { copybitmap( bitmap, m_tmpbmp, 0, 0, 0, 0, cliprect ); return 0; diff --git a/src/devices/video/tms9928a.h b/src/devices/video/tms9928a.h index d05a2d936c4..37103e47c41 100644 --- a/src/devices/video/tms9928a.h +++ b/src/devices/video/tms9928a.h @@ -85,8 +85,8 @@ class tms9928a_device : public device_t, { public: // construction/destruction - tms9928a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms9928a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, bool is_50hz, bool is_reva, bool is_99, const char *shortname, const char *source); + tms9928a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tms9928a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, bool is_50hz, bool is_reva, bool is_99, const char *shortname, const char *source); static void set_vram_size(device_t &device, int vram_size) { downcast(device).m_vram_size = vram_size; } template static devcb_base &set_out_int_line_callback(device_t &device, _Object object) { return downcast(device).m_out_int_line_cb.set_callback(object); } @@ -101,7 +101,7 @@ public: DECLARE_WRITE8_MEMBER( register_write ); /* update the screen */ - UINT32 screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ); + uint32_t screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ); bitmap_rgb32 &get_bitmap() { return m_tmpbmp; } /* RESET pin */ @@ -117,7 +117,7 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_DATA) const override { return (spacenum == AS_DATA) ? &m_space_config : nullptr; } private: - void change_register(UINT8 reg, UINT8 val); + void change_register(uint8_t reg, uint8_t val); void check_interrupt(); void update_backdrop(); void update_table_masks(); @@ -131,18 +131,18 @@ private: devcb_write_line m_out_gromclk_cb; // GROMCLK line is optional; if present, pulse it by XTAL/24 rate /* TMS9928A internal settings */ - UINT8 m_ReadAhead; - UINT8 m_Regs[8]; - UINT8 m_StatusReg; - UINT8 m_FifthSprite; - UINT8 m_latch; - UINT8 m_INT; - UINT16 m_Addr; - UINT16 m_colour; - UINT16 m_pattern; - UINT16 m_nametbl; - UINT16 m_spriteattribute; - UINT16 m_spritepattern; + uint8_t m_ReadAhead; + uint8_t m_Regs[8]; + uint8_t m_StatusReg; + uint8_t m_FifthSprite; + uint8_t m_latch; + uint8_t m_INT; + uint16_t m_Addr; + uint16_t m_colour; + uint16_t m_pattern; + uint16_t m_nametbl; + uint16_t m_spriteattribute; + uint16_t m_spritepattern; int m_colourmask; int m_patternmask; bool m_50hz; @@ -157,7 +157,7 @@ private: bitmap_rgb32 m_tmpbmp; emu_timer *m_line_timer; emu_timer *m_gromclk_timer; - UINT8 m_mode; + uint8_t m_mode; /* emulation settings */ int m_top_border; @@ -168,49 +168,49 @@ private: class tms9918_device : public tms9928a_device { public: - tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms9918a_device : public tms9928a_device { public: - tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms9118_device : public tms9928a_device { public: - tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms9128_device : public tms9928a_device { public: - tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms9929_device : public tms9928a_device { public: - tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms9929a_device : public tms9928a_device { public: - tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; class tms9129_device : public tms9928a_device { public: - tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; diff --git a/src/devices/video/upd3301.cpp b/src/devices/video/upd3301.cpp index aa00eaeda44..46a544839b8 100644 --- a/src/devices/video/upd3301.cpp +++ b/src/devices/video/upd3301.cpp @@ -74,7 +74,7 @@ const device_type UPD3301 = &device_creator; // upd3301_device - constructor //------------------------------------------------- -upd3301_device::upd3301_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +upd3301_device::upd3301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD3301, "UPD3301", tag, owner, clock, "upd3301", __FILE__), device_video_interface(mconfig, *this), m_write_int(*this), @@ -224,7 +224,7 @@ void upd3301_device::device_timer(emu_timer &timer, device_timer_id id, int para READ8_MEMBER( upd3301_device::read ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0x01) { @@ -462,7 +462,7 @@ void upd3301_device::draw_scanline() for (int sx = 0; sx < m_h; sx++) { int y = m_y + lc; - UINT8 cc = m_data_fifo[sx][!m_input_fifo]; + uint8_t cc = m_data_fifo[sx][!m_input_fifo]; int hlgt = 0; // TODO int rvv = 0; // TODO int vsp = 0; // TODO @@ -483,7 +483,7 @@ void upd3301_device::draw_scanline() // update_screen - //------------------------------------------------- -UINT32 upd3301_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t upd3301_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_bitmap = &bitmap; if (m_status & STATUS_VE) diff --git a/src/devices/video/upd3301.h b/src/devices/video/upd3301.h index 0507eb25e6c..ddb08116ae4 100644 --- a/src/devices/video/upd3301.h +++ b/src/devices/video/upd3301.h @@ -42,7 +42,7 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define UPD3301_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int y, int sx, UINT8 cc, UINT8 lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa) +#define UPD3301_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int y, int sx, uint8_t cc, uint8_t lc, int hlgt, int rvv, int vsp, int sl0, int sl12, int csr, int gpa) #define MCFG_UPD3301_CHARACTER_WIDTH(_value) \ @@ -69,7 +69,7 @@ // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate upd3301_draw_character_delegate; +typedef device_delegate upd3301_draw_character_delegate; // ======================> upd3301_device @@ -79,7 +79,7 @@ class upd3301_device : public device_t, { public: // construction/destruction - upd3301_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd3301_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_character_width(device_t &device, int value) { downcast(device).m_width = value; } static void static_set_display_callback(device_t &device, upd3301_draw_character_delegate callback) { downcast(device).m_display_cb = callback; } @@ -96,7 +96,7 @@ public: DECLARE_READ_LINE_MEMBER( hrtc_r ); DECLARE_READ_LINE_MEMBER( vrtc_r ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -139,12 +139,12 @@ private: // live state int m_mode; // command mode - UINT8 m_status; // status register + uint8_t m_status; // status register int m_param_count; // parameter count // FIFOs - UINT8 m_data_fifo[80][2]; // row data FIFO - UINT8 m_attr_fifo[40][2]; // attribute FIFO + uint8_t m_data_fifo[80][2]; // row data FIFO + uint8_t m_attr_fifo[40][2]; // attribute FIFO int m_data_fifo_pos; // row data FIFO position int m_attr_fifo_pos; // attribute FIFO position int m_input_fifo; // which FIFO is in input mode diff --git a/src/devices/video/upd7220.cpp b/src/devices/video/upd7220.cpp index dc7601dc16c..cc6d9a1ffca 100644 --- a/src/devices/video/upd7220.cpp +++ b/src/devices/video/upd7220.cpp @@ -190,7 +190,7 @@ const tiny_rom_entry *upd7220_device::device_rom_region() const // readbyte - read a byte at the given address //------------------------------------------------- -inline UINT8 upd7220_device::readbyte(offs_t address) +inline uint8_t upd7220_device::readbyte(offs_t address) { return space().read_byte(address); } @@ -200,18 +200,18 @@ inline UINT8 upd7220_device::readbyte(offs_t address) // writebyte - write a byte at the given address //------------------------------------------------- -inline void upd7220_device::writebyte(offs_t address, UINT8 data) +inline void upd7220_device::writebyte(offs_t address, uint8_t data) { space().write_byte(address, data); } -inline UINT16 upd7220_device::readword(offs_t address) +inline uint16_t upd7220_device::readword(offs_t address) { return space().read_word(address); } -inline void upd7220_device::writeword(offs_t address, UINT16 data) +inline void upd7220_device::writeword(offs_t address, uint16_t data) { space().write_word(address, data); } @@ -272,7 +272,7 @@ inline void upd7220_device::fifo_set_direction(int dir) // queue - //------------------------------------------------- -inline void upd7220_device::queue(UINT8 data, int flag) +inline void upd7220_device::queue(uint8_t data, int flag) { if (m_fifo_ptr < 15) { @@ -300,7 +300,7 @@ inline void upd7220_device::queue(UINT8 data, int flag) // dequeue - //------------------------------------------------- -inline void upd7220_device::dequeue(UINT8 *data, int *flag) +inline void upd7220_device::dequeue(uint8_t *data, int *flag) { *data = m_fifo[0]; *flag = m_fifo_flag[0]; @@ -451,7 +451,7 @@ inline void upd7220_device::reset_figs_param() // read_vram - //------------------------------------------------- -inline void upd7220_device::read_vram(UINT8 type, UINT8 mod) +inline void upd7220_device::read_vram(uint8_t type, uint8_t mod) { if (type == 1) { @@ -492,9 +492,9 @@ inline void upd7220_device::read_vram(UINT8 type, UINT8 mod) // write_vram - //------------------------------------------------- -inline void upd7220_device::write_vram(UINT8 type, UINT8 mod) +inline void upd7220_device::write_vram(uint8_t type, uint8_t mod) { - UINT16 result; + uint16_t result; if (type == 1) { @@ -575,7 +575,7 @@ inline void upd7220_device::write_vram(UINT8 type, UINT8 mod) // get_text_partition - //------------------------------------------------- -inline void upd7220_device::get_text_partition(int index, UINT32 *sad, UINT16 *len, int *im, int *wd) +inline void upd7220_device::get_text_partition(int index, uint32_t *sad, uint16_t *len, int *im, int *wd) { *sad = ((m_ra[(index * 4) + 1] & 0x1f) << 8) | m_ra[(index * 4) + 0]; *len = ((m_ra[(index * 4) + 3] & 0x3f) << 4) | (m_ra[(index * 4) + 2] >> 4); @@ -588,7 +588,7 @@ inline void upd7220_device::get_text_partition(int index, UINT32 *sad, UINT16 *l // get_graphics_partition - //------------------------------------------------- -inline void upd7220_device::get_graphics_partition(int index, UINT32 *sad, UINT16 *len, int *im, int *wd) +inline void upd7220_device::get_graphics_partition(int index, uint32_t *sad, uint16_t *len, int *im, int *wd) { *sad = ((m_ra[(index * 4) + 2] & 0x03) << 16) | (m_ra[(index * 4) + 1] << 8) | m_ra[(index * 4) + 0]; *len = ((m_ra[(index * 4) + 3] & 0x3f) << 4) | (m_ra[(index * 4) + 2] >> 4); @@ -606,7 +606,7 @@ inline void upd7220_device::get_graphics_partition(int index, UINT32 *sad, UINT1 // upd7220_device - constructor //------------------------------------------------- -upd7220_device::upd7220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +upd7220_device::upd7220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD7220, "uPD7220", tag, owner, clock, "upd7220", __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -784,11 +784,11 @@ void upd7220_device::device_timer(emu_timer &timer, device_timer_id id, int para // draw_pixel - //------------------------------------------------- -void upd7220_device::draw_pixel(int x, int y, int xi, UINT16 tile_data) +void upd7220_device::draw_pixel(int x, int y, int xi, uint16_t tile_data) { - UINT32 addr = ((y * (m_pitch << (m_figs.m_gd ? 0 : 1))) + (x >> 3)) & 0x3ffff; - UINT16 data = readword(addr); - UINT16 new_pixel = (tile_data & (1 << (xi & 0xf))) ? (1 << (x & 0xf)) : 0; + uint32_t addr = ((y * (m_pitch << (m_figs.m_gd ? 0 : 1))) + (x >> 3)) & 0x3ffff; + uint16_t data = readword(addr); + uint16_t new_pixel = (tile_data & (1 << (xi & 0xf))) ? (1 << (x & 0xf)) : 0; switch(m_bitmap_mod) { @@ -815,9 +815,9 @@ void upd7220_device::draw_pixel(int x, int y, int xi, UINT16 tile_data) void upd7220_device::draw_line(int x, int y) { int xi, yi; - int d = (m_figs.m_d & 0x2000) ? (INT16)(m_figs.m_d | 0xe000) : m_figs.m_d; - int d2 = (m_figs.m_d2 & 0x2000) ? (INT16)(m_figs.m_d2 | 0xe000) : m_figs.m_d2; - UINT16 pattern = (m_ra[8]) | (m_ra[9]<<8); + int d = (m_figs.m_d & 0x2000) ? (int16_t)(m_figs.m_d | 0xe000) : m_figs.m_d; + int d2 = (m_figs.m_d2 & 0x2000) ? (int16_t)(m_figs.m_d2 | 0xe000) : m_figs.m_d2; + uint16_t pattern = (m_ra[8]) | (m_ra[9]<<8); const int dot_dir[4] = {1, -1, -1, 1}; LOG(("uPD7220 line check: %d %d %02x %08x %d %d %d\n",x,y,m_figs.m_dir,m_ead,m_figs.m_d1,m_figs.m_dc,m_bitmap_mod)); @@ -868,7 +868,7 @@ void upd7220_device::draw_arc(int x, int y) { int xi = m_figs.m_d + 1, yi = 0, err = -m_figs.m_d; int x0, y0; - UINT16 pattern = (m_ra[8]) | (m_ra[9]<<8); + uint16_t pattern = (m_ra[8]) | (m_ra[9]<<8); const int dot_dir[4] = {1, -1, -1, 1}; switch(m_figs.m_dir & 3) @@ -934,8 +934,8 @@ void upd7220_device::draw_rectangle(int x, int y) int i; const int rect_x_dir[8] = { 0, 1, 0,-1, 1, 1,-1,-1 }; const int rect_y_dir[8] = { 1, 0,-1, 0, 1,-1,-1, 1 }; - UINT8 rect_type,rect_dir; - UINT16 pattern = (m_ra[8]) | (m_ra[9]<<8); + uint8_t rect_type,rect_dir; + uint16_t pattern = (m_ra[8]) | (m_ra[9]<<8); LOG(("uPD7220 rectangle check: %d %d %02x %08x\n",x,y,m_figs.m_dir,m_ead)); @@ -989,7 +989,7 @@ void upd7220_device::draw_rectangle(int x, int y) void upd7220_device::draw_char(int x, int y) { int isize,psize; - UINT16 tile_data; + uint16_t tile_data; LOG(("uPD7220 char check: %d %d %02x %08x %d %d %02x\n",x,y,m_figs.m_dir,m_ead,m_figs.m_d,m_figs.m_dc,m_figs.m_figure_type)); @@ -1045,7 +1045,7 @@ void upd7220_device::draw_char(int x, int y) // translate_command - //------------------------------------------------- -int upd7220_device::translate_command(UINT8 data) +int upd7220_device::translate_command(uint8_t data) { int command = COMMAND_INVALID; @@ -1097,9 +1097,9 @@ int upd7220_device::translate_command(UINT8 data) void upd7220_device::process_fifo() { - UINT8 data; + uint8_t data; int flag; - UINT16 eff_pitch = m_pitch >> m_figs.m_gd; + uint16_t eff_pitch = m_pitch >> m_figs.m_gd; dequeue(&data, &flag); @@ -1266,7 +1266,7 @@ void upd7220_device::process_fifo() case COMMAND_CURS: /* cursor position specify */ if (m_param_ptr >= 3) { - UINT8 upper_addr = (m_param_ptr == 3) ? 0 : (m_pr[3] & 0x03); + uint8_t upper_addr = (m_param_ptr == 3) ? 0 : (m_pr[3] & 0x03); m_ead = (upper_addr << 16) | (m_pr[2] << 8) | m_pr[1]; @@ -1402,7 +1402,7 @@ void upd7220_device::process_fifo() case COMMAND_CURD: /* cursor address read */ { - UINT16 dad = 1 << m_dad; + uint16_t dad = 1 << m_dad; fifo_set_direction(FIFO_READ); queue(m_ead & 0xff, 0); @@ -1458,7 +1458,7 @@ void upd7220_device::continue_command() READ8_MEMBER( upd7220_device::read ) { - UINT8 data; + uint8_t data; if (offset & 1) { @@ -1570,8 +1570,8 @@ WRITE_LINE_MEMBER( upd7220_device::lpen_w ) void upd7220_device::update_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 addr, sad; - UINT16 len; + uint32_t addr, sad; + uint16_t len; int im, wd; int y, sy = 0; @@ -1596,7 +1596,7 @@ void upd7220_device::update_text(bitmap_rgb32 &bitmap, const rectangle &cliprect // draw_graphics_line - //------------------------------------------------- -void upd7220_device::draw_graphics_line(bitmap_rgb32 &bitmap, UINT32 addr, int y, int wd, int pitch) +void upd7220_device::draw_graphics_line(bitmap_rgb32 &bitmap, uint32_t addr, int y, int wd, int pitch) { int sx, al = bitmap.cliprect().height(); @@ -1616,12 +1616,12 @@ void upd7220_device::draw_graphics_line(bitmap_rgb32 &bitmap, UINT32 addr, int y void upd7220_device::update_graphics(bitmap_rgb32 &bitmap, const rectangle &cliprect, int force_bitmap) { - UINT32 addr, sad; - UINT16 len; + uint32_t addr, sad; + uint16_t len; int im, wd, area; int y = 0, tsy = 0, bsy = 0; bool mixed = ((m_mode & UPD7220_MODE_DISPLAY_MASK) == UPD7220_MODE_DISPLAY_MIXED); - UINT8 interlace = ((m_mode & UPD7220_MODE_INTERLACE_MASK) == UPD7220_MODE_INTERLACE_ON) ? 0 : 1; + uint8_t interlace = ((m_mode & UPD7220_MODE_INTERLACE_MASK) == UPD7220_MODE_INTERLACE_ON) ? 0 : 1; for (area = 0; area < 4; area++) { @@ -1676,7 +1676,7 @@ void upd7220_device::update_graphics(bitmap_rgb32 &bitmap, const rectangle &clip // update_screen - //------------------------------------------------- -UINT32 upd7220_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t upd7220_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_de) { diff --git a/src/devices/video/upd7220.h b/src/devices/video/upd7220.h index efad745aa4b..97251e4f0f9 100644 --- a/src/devices/video/upd7220.h +++ b/src/devices/video/upd7220.h @@ -42,8 +42,8 @@ // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define UPD7220_DISPLAY_PIXELS_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int y, int x, UINT32 address) -#define UPD7220_DRAW_TEXT_LINE_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, UINT32 addr, int y, int wd, int pitch, int lr, int cursor_on, int cursor_addr) +#define UPD7220_DISPLAY_PIXELS_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int y, int x, uint32_t address) +#define UPD7220_DRAW_TEXT_LINE_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, uint32_t addr, int y, int wd, int pitch, int lr, int cursor_on, int cursor_addr) #define MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(_class, _method) \ @@ -70,8 +70,8 @@ // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate upd7220_display_pixels_delegate; -typedef device_delegate upd7220_draw_text_delegate; +typedef device_delegate upd7220_display_pixels_delegate; +typedef device_delegate upd7220_draw_text_delegate; // ======================> upd7220_device @@ -82,7 +82,7 @@ class upd7220_device : public device_t, { public: // construction/destruction - upd7220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd7220_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void static_set_display_pixels_callback(device_t &device, upd7220_display_pixels_delegate callback) { downcast(device).m_display_cb = callback; } static void static_set_draw_text_callback(device_t &device, upd7220_draw_text_delegate callback) { downcast(device).m_draw_text_cb = callback; } @@ -101,7 +101,7 @@ public: DECLARE_WRITE_LINE_MEMBER( ext_sync_w ); DECLARE_WRITE_LINE_MEMBER( lpen_w ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual const tiny_rom_entry *device_rom_region() const override; virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; @@ -119,35 +119,35 @@ private: TIMER_BLANK }; - inline UINT8 readbyte(offs_t address); - inline void writebyte(offs_t address, UINT8 data); - inline UINT16 readword(offs_t address); - inline void writeword(offs_t address, UINT16 data); + inline uint8_t readbyte(offs_t address); + inline void writebyte(offs_t address, uint8_t data); + inline uint16_t readword(offs_t address); + inline void writeword(offs_t address, uint16_t data); inline void fifo_clear(); inline int fifo_param_count(); inline void fifo_set_direction(int dir); - inline void queue(UINT8 data, int flag); - inline void dequeue(UINT8 *data, int *flag); + inline void queue(uint8_t data, int flag); + inline void dequeue(uint8_t *data, int *flag); inline void update_vsync_timer(int state); inline void update_hsync_timer(int state); inline void update_blank_timer(int state); inline void recompute_parameters(); inline void reset_figs_param(); - inline void read_vram(UINT8 type, UINT8 mod); - inline void write_vram(UINT8 type, UINT8 mod); - inline void get_text_partition(int index, UINT32 *sad, UINT16 *len, int *im, int *wd); - inline void get_graphics_partition(int index, UINT32 *sad, UINT16 *len, int *im, int *wd); + inline void read_vram(uint8_t type, uint8_t mod); + inline void write_vram(uint8_t type, uint8_t mod); + inline void get_text_partition(int index, uint32_t *sad, uint16_t *len, int *im, int *wd); + inline void get_graphics_partition(int index, uint32_t *sad, uint16_t *len, int *im, int *wd); - void draw_pixel(int x, int y, int xi, UINT16 tile_data); + void draw_pixel(int x, int y, int xi, uint16_t tile_data); void draw_line(int x, int y); void draw_rectangle(int x, int y); void draw_arc(int x, int y); void draw_char(int x, int y); - int translate_command(UINT8 data); + int translate_command(uint8_t data); void process_fifo(); void continue_command(); void update_text(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void draw_graphics_line(bitmap_rgb32 &bitmap, UINT32 addr, int y, int wd, int pitch); + void draw_graphics_line(bitmap_rgb32 &bitmap, uint32_t addr, int y, int wd, int pitch); void update_graphics(bitmap_rgb32 &bitmap, const rectangle &cliprect, int force_bitmap); upd7220_display_pixels_delegate m_display_cb; @@ -158,26 +158,26 @@ private: devcb_write_line m_write_vsync; devcb_write_line m_write_blank; - UINT16 m_mask; // mask register - UINT8 m_pitch; // number of word addresses in display memory in the horizontal direction - UINT32 m_ead; // execute word address - UINT16 m_dad; // dot address within the word - UINT32 m_lad; // light pen address + uint16_t m_mask; // mask register + uint8_t m_pitch; // number of word addresses in display memory in the horizontal direction + uint32_t m_ead; // execute word address + uint16_t m_dad; // dot address within the word + uint32_t m_lad; // light pen address - UINT8 m_ra[16]; // parameter RAM + uint8_t m_ra[16]; // parameter RAM int m_ra_addr; // parameter RAM address - UINT8 m_sr; // status register - UINT8 m_cr; // command register - UINT8 m_pr[17]; // parameter byte register + uint8_t m_sr; // status register + uint8_t m_cr; // command register + uint8_t m_pr[17]; // parameter byte register int m_param_ptr; // parameter pointer - UINT8 m_fifo[16]; // FIFO data queue + uint8_t m_fifo[16]; // FIFO data queue int m_fifo_flag[16]; // FIFO flag queue int m_fifo_ptr; // FIFO pointer int m_fifo_dir; // FIFO direction - UINT8 m_mode; // mode of operation + uint8_t m_mode; // mode of operation int m_de; // display enabled int m_m; // 0 = accept external vertical sync (slave mode) / 1 = generate & output vertical sync (master mode) @@ -200,17 +200,17 @@ private: int m_disp; // display zoom factor int m_gchr; // zoom factor for graphics character writing and area filling - UINT8 m_bitmap_mod; + uint8_t m_bitmap_mod; struct { - UINT8 m_dir; // figs param 0: drawing direction - UINT8 m_figure_type; // figs param 1: figure type - UINT16 m_dc; // figs param 2: - UINT8 m_gd; // mixed mode only - UINT16 m_d; // figs param 3: - UINT16 m_d1; // figs param 4: - UINT16 m_d2; // figs param 5: - UINT16 m_dm; // figs param 6: + uint8_t m_dir; // figs param 0: drawing direction + uint8_t m_figure_type; // figs param 1: figure type + uint16_t m_dc; // figs param 2: + uint8_t m_gd; // mixed mode only + uint16_t m_d; // figs param 3: + uint16_t m_d1; // figs param 4: + uint16_t m_d2; // figs param 5: + uint16_t m_dm; // figs param 6: } m_figs; // timers diff --git a/src/devices/video/upd7227.cpp b/src/devices/video/upd7227.cpp index 99800496a28..8cc0d97867e 100644 --- a/src/devices/video/upd7227.cpp +++ b/src/devices/video/upd7227.cpp @@ -41,7 +41,7 @@ ADDRESS_MAP_END // upd7227_device - constructor //------------------------------------------------- -upd7227_device::upd7227_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +upd7227_device::upd7227_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, UPD7227, "uPD7227", tag, owner, clock, "upd7227", __FILE__), device_memory_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_BIG, 8, 7, 0, *ADDRESS_MAP_NAME(upd7227_map)), @@ -106,7 +106,7 @@ const address_space_config *upd7227_device::memory_space_config(address_spacenum // update_screen - update screen //------------------------------------------------- -UINT32 upd7227_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t upd7227_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/devices/video/upd7227.h b/src/devices/video/upd7227.h index 681f63a7c17..2b39e1c0d22 100644 --- a/src/devices/video/upd7227.h +++ b/src/devices/video/upd7227.h @@ -36,7 +36,7 @@ class upd7227_device : public device_t, { public: // construction/destruction - upd7227_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + upd7227_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_set_offsets(device_t &device, int sx, int sy); @@ -47,7 +47,7 @@ public: DECLARE_WRITE_LINE_MEMBER( si_w ); DECLARE_READ_LINE_MEMBER( so_r ); - 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 diff --git a/src/devices/video/v9938.cpp b/src/devices/video/v9938.cpp index 210377946e1..141448d463a 100644 --- a/src/devices/video/v9938.cpp +++ b/src/devices/video/v9938.cpp @@ -88,7 +88,7 @@ const device_type V9938 = &device_creator; const device_type V9958 = &device_creator; -v99x8_device::v99x8_device(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, device_t *owner, UINT32 clock) +v99x8_device::v99x8_device(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), device_memory_interface(mconfig, *this), device_video_interface(mconfig, *this), @@ -122,13 +122,13 @@ v99x8_device::v99x8_device(const machine_config &mconfig, device_type type, cons static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap)); } -v9938_device::v9938_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v9938_device::v9938_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : v99x8_device(mconfig, V9938, "V9938 VDP", "v9938", tag, owner, clock) { m_model = MODEL_V9938; } -v9958_device::v9958_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +v9958_device::v9958_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : v99x8_device(mconfig, V9938, "V9958 VDP", "v9958", tag, owner, clock) { m_model = MODEL_V9958; @@ -321,12 +321,12 @@ to emulate this. Also it keeps the palette a reasonable size. :) */ -UINT16 v99x8_device::s_pal_indYJK[0x20000]; +uint16_t v99x8_device::s_pal_indYJK[0x20000]; PALETTE_INIT_MEMBER(v9958_device, v9958) { int r,g,b,y,j,k,i,k0,j0,n; - UINT8 pal[19268*3]; + uint8_t pal[19268*3]; // init v9938 512-color palette for (i=0;i<512;i++) @@ -382,7 +382,7 @@ PALETTE_INIT_MEMBER(v9958_device, v9958) LOG( ("Table creation failed - %d colours out of 19286 created\n", i)); } -UINT32 v99x8_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t v99x8_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; @@ -409,9 +409,9 @@ WRITE8_MEMBER( v99x8_device::write ) } } -UINT8 v99x8_device::vram_r() +uint8_t v99x8_device::vram_r() { - UINT8 ret; + uint8_t ret; int address; address = ((int)m_cont_reg[14] << 14) | m_address_latch; @@ -444,10 +444,10 @@ UINT8 v99x8_device::vram_r() return ret; } -UINT8 v99x8_device::status_r() +uint8_t v99x8_device::status_r() { int reg; - UINT8 ret; + uint8_t ret; m_cmd_write_first = 0; @@ -515,7 +515,7 @@ UINT8 v99x8_device::status_r() return ret; } -void v99x8_device::palette_w(UINT8 data) +void v99x8_device::palette_w(uint8_t data) { int indexp; @@ -540,7 +540,7 @@ void v99x8_device::palette_w(UINT8 data) } } -void v99x8_device::vram_w(UINT8 data) +void v99x8_device::vram_w(uint8_t data) { int address; @@ -569,7 +569,7 @@ void v99x8_device::vram_w(UINT8 data) } } -void v99x8_device::command_w(UINT8 data) +void v99x8_device::command_w(uint8_t data) { if (m_cmd_write_first) { @@ -581,7 +581,7 @@ void v99x8_device::command_w(UINT8 data) else { m_address_latch = - (((UINT16)data << 8) | m_cmd_write) & 0x3fff; + (((uint16_t)data << 8) | m_cmd_write) & 0x3fff; if ( !(data & 0x40) ) vram_r (); // read ahead! } @@ -594,7 +594,7 @@ void v99x8_device::command_w(UINT8 data) } } -void v99x8_device::register_w(UINT8 data) +void v99x8_device::register_w(uint8_t data) { int reg; @@ -606,7 +606,7 @@ void v99x8_device::register_w(UINT8 data) m_cont_reg[17] = (m_cont_reg[17] + 1) & 0x3f; } -void v99x8_device::static_set_vram_size(device_t &device, UINT32 vram_size) +void v99x8_device::static_set_vram_size(device_t &device, uint32_t vram_size) { downcast(device).m_vram_size = vram_size; } @@ -730,7 +730,7 @@ void v99x8_device::device_reset() void v99x8_device::reset_palette() { // taken from V9938 Technical Data book, page 148. it's in G-R-B format - static const UINT8 pal16[16*3] = { + static const uint8_t pal16[16*3] = { 0, 0, 0, // 0: black/transparent 0, 0, 0, // 1: black 6, 1, 1, // 2: medium green @@ -804,7 +804,7 @@ int v99x8_device::vram_read(int offset) void v99x8_device::check_int() { - UINT8 n; + uint8_t n; n = ( (m_cont_reg[1] & 0x20) && (m_stat_reg[0] & 0x80) /*&& m_vblank_int*/) || ( (m_stat_reg[1] & 0x01) && (m_cont_reg[0] & 0x10) ); @@ -838,7 +838,7 @@ void v99x8_device::check_int() void v99x8_device::register_write (int reg, int data) { - static UINT8 const reg_mask[] = + static uint8_t const reg_mask[] = { 0x7e, 0x7b, 0x7f, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0xfb, 0xbf, 0x07, 0x03, 0xff, 0xff, 0x07, 0x0f, @@ -931,9 +931,9 @@ inline bool v99x8_device::v9938_second_field() } -void v99x8_device::default_border(const pen_t *pens, UINT16 *ln) +void v99x8_device::default_border(const pen_t *pens, uint16_t *ln) { - UINT16 pen; + uint16_t pen; int i; pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]]; @@ -941,9 +941,9 @@ void v99x8_device::default_border(const pen_t *pens, UINT16 *ln) while (i--) *ln++ = pen; } -void v99x8_device::graphic7_border(const pen_t *pens, UINT16 *ln) +void v99x8_device::graphic7_border(const pen_t *pens, uint16_t *ln) { - UINT16 pen; + uint16_t pen; int i; pen = pens[m_pal_ind256[m_cont_reg[7]]]; @@ -951,11 +951,11 @@ void v99x8_device::graphic7_border(const pen_t *pens, UINT16 *ln) while (i--) *ln++ = pen; } -void v99x8_device::graphic5_border(const pen_t *pens, UINT16 *ln) +void v99x8_device::graphic5_border(const pen_t *pens, uint16_t *ln) { int i; - UINT16 pen0; - UINT16 pen1; + uint16_t pen0; + uint16_t pen1; pen1 = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]]; pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; @@ -963,10 +963,10 @@ void v99x8_device::graphic5_border(const pen_t *pens, UINT16 *ln) while (i--) { *ln++ = pen0; *ln++ = pen1; } } -void v99x8_device::mode_text1(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_text1(const pen_t *pens, uint16_t *ln, int line) { int pattern, x, xx, name, xxx; - UINT16 fg, bg, pen; + uint16_t fg, bg, pen; int nametbl_addr, patterntbl_addr; patterntbl_addr = m_cont_reg[4] << 11; @@ -1000,10 +1000,10 @@ void v99x8_device::mode_text1(const pen_t *pens, UINT16 *ln, int line) while (xxx--) *ln++ = pen; } -void v99x8_device::mode_text2(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_text2(const pen_t *pens, uint16_t *ln, int line) { int pattern, x, charcode, name, xxx, patternmask, colourmask; - UINT16 fg, bg, fg0, bg0, pen; + uint16_t fg, bg, fg0, bg0, pen; int nametbl_addr, patterntbl_addr, colourtbl_addr; patterntbl_addr = m_cont_reg[4] << 11; @@ -1067,11 +1067,11 @@ void v99x8_device::mode_text2(const pen_t *pens, UINT16 *ln, int line) while (xxx--) *ln++ = pen; } -void v99x8_device::mode_multi(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_multi(const pen_t *pens, uint16_t *ln, int line) { int nametbl_addr, patterntbl_addr, colour; int name, line2, x, xx; - UINT16 pen, pen_bg; + uint16_t pen, pen_bg; nametbl_addr = (m_cont_reg[2] << 10); patterntbl_addr = (m_cont_reg[4] << 11); @@ -1113,9 +1113,9 @@ void v99x8_device::mode_multi(const pen_t *pens, UINT16 *ln, int line) while (xx--) *ln++ = pen_bg; } -void v99x8_device::mode_graphic1(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_graphic1(const pen_t *pens, uint16_t *ln, int line) { - UINT16 fg, bg, pen; + uint16_t fg, bg, pen; int nametbl_addr, patterntbl_addr, colourtbl_addr; int pattern, x, xx, line2, name, charcode, colour, xxx; @@ -1152,9 +1152,9 @@ void v99x8_device::mode_graphic1(const pen_t *pens, UINT16 *ln, int line) while (xx--) *ln++ = pen; } -void v99x8_device::mode_graphic23(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_graphic23(const pen_t *pens, uint16_t *ln, int line) { - UINT16 fg, bg, pen; + uint16_t fg, bg, pen; int nametbl_addr, patterntbl_addr, colourtbl_addr; int pattern, x, xx, line2, name, charcode, colour, colourmask, patternmask, xxx; @@ -1193,11 +1193,11 @@ void v99x8_device::mode_graphic23(const pen_t *pens, UINT16 *ln, int line) while (xx--) *ln++ = pen; } -void v99x8_device::mode_graphic4(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_graphic4(const pen_t *pens, uint16_t *ln, int line) { int nametbl_addr, colour; int line2, linemask, x, xx; - UINT16 pen, pen_bg; + uint16_t pen, pen_bg; linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7; @@ -1226,12 +1226,12 @@ void v99x8_device::mode_graphic4(const pen_t *pens, UINT16 *ln, int line) while (xx--) *ln++ = pen_bg; } -void v99x8_device::mode_graphic5(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_graphic5(const pen_t *pens, uint16_t *ln, int line) { int nametbl_addr, colour; int line2, linemask, x, xx; - UINT16 pen_bg0[4]; - UINT16 pen_bg1[4]; + uint16_t pen_bg0[4]; + uint16_t pen_bg1[4]; linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7; @@ -1271,12 +1271,12 @@ void v99x8_device::mode_graphic5(const pen_t *pens, UINT16 *ln, int line) while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; } } -void v99x8_device::mode_graphic6(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_graphic6(const pen_t *pens, uint16_t *ln, int line) { - UINT8 colour; + uint8_t colour; int line2, linemask, x, xx, nametbl_addr; - UINT16 pen_bg, fg0; - UINT16 fg1; + uint16_t pen_bg, fg0; + uint16_t fg1; linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7; @@ -1320,11 +1320,11 @@ void v99x8_device::mode_graphic6(const pen_t *pens, UINT16 *ln, int line) while (xx--) *ln++ = pen_bg; } -void v99x8_device::mode_graphic7(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_graphic7(const pen_t *pens, uint16_t *ln, int line) { - UINT8 colour; + uint8_t colour; int line2, linemask, x, xx, nametbl_addr; - UINT16 pen, pen_bg; + uint16_t pen, pen_bg; linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7; @@ -1438,9 +1438,9 @@ void v99x8_device::mode_graphic7(const pen_t *pens, UINT16 *ln, int line) while (xx--) *ln++ = pen_bg; } -void v99x8_device::mode_unknown(const pen_t *pens, UINT16 *ln, int line) +void v99x8_device::mode_unknown(const pen_t *pens, uint16_t *ln, int line) { - UINT16 fg, bg; + uint16_t fg, bg; int x; fg = pens[m_pal_ind16[m_cont_reg[7] >> 4]]; @@ -1456,7 +1456,7 @@ void v99x8_device::mode_unknown(const pen_t *pens, UINT16 *ln, int line) while (x--) *ln++ = bg; } -void v99x8_device::default_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col) +void v99x8_device::default_draw_sprite(const pen_t *pens, uint16_t *ln, uint8_t *col) { int i; ln += m_offset_x * 2; @@ -1475,7 +1475,7 @@ void v99x8_device::default_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col } } -void v99x8_device::graphic5_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col) +void v99x8_device::graphic5_draw_sprite(const pen_t *pens, uint16_t *ln, uint8_t *col) { int i; ln += m_offset_x * 2; @@ -1495,9 +1495,9 @@ void v99x8_device::graphic5_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *co } -void v99x8_device::graphic7_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col) +void v99x8_device::graphic7_draw_sprite(const pen_t *pens, uint16_t *ln, uint8_t *col) { - static const UINT16 g7_ind16[16] = { + static const uint16_t g7_ind16[16] = { 0, 2, 192, 194, 48, 50, 240, 242, 482, 7, 448, 455, 56, 63, 504, 511 }; int i; @@ -1519,7 +1519,7 @@ void v99x8_device::graphic7_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *co } -void v99x8_device::sprite_mode1 (int line, UINT8 *col) +void v99x8_device::sprite_mode1 (int line, uint8_t *col) { int attrtbl_addr, patterntbl_addr, pattern_addr; int x, y, p, height, c, p2, i, n, pattern; @@ -1640,7 +1640,7 @@ void v99x8_device::sprite_mode1 (int line, UINT8 *col) m_stat_reg[0] = (m_stat_reg[0] & 0xa0) | p; } -void v99x8_device::sprite_mode2 (int line, UINT8 *col) +void v99x8_device::sprite_mode2 (int line, uint8_t *col) { int attrtbl_addr, patterntbl_addr, pattern_addr, colourtbl_addr; int x, i, y, p, height, c, p2, n, pattern, colourmask, first_cc_seen; @@ -1855,8 +1855,8 @@ void v99x8_device::refresh_16(int line) { const pen_t *pens = m_palette->pens(); bool double_lines = false; - UINT8 col[256]; - UINT16 *ln, *ln2 = nullptr; + uint8_t col[256]; + uint16_t *ln, *ln2 = nullptr; if (m_cont_reg[9] & 0x08) { @@ -2145,7 +2145,7 @@ post_loop /*************************************************************/ /** Variables visible only in this module **/ /*************************************************************/ -static const UINT8 Mask[4] = { 0x0F,0x03,0x0F,0xFF }; +static const uint8_t Mask[4] = { 0x0F,0x03,0x0F,0xFF }; static const int PPB[4] = { 2,4,2,1 }; static const int PPL[4] = { 256,512,512,256 }; @@ -2183,7 +2183,7 @@ static const int lmmm_timing[8]={ /** VDPVRMP() **********************************************/ /** Calculate addr of a pixel in vram **/ /*************************************************************/ -inline int v99x8_device::VDPVRMP(UINT8 M,int MX,int X,int Y) +inline int v99x8_device::VDPVRMP(uint8_t M,int MX,int X,int Y) { switch(M) { @@ -2199,7 +2199,7 @@ inline int v99x8_device::VDPVRMP(UINT8 M,int MX,int X,int Y) /** VDPpoint5() ***********************************************/ /** Get a pixel on screen 5 **/ /*************************************************************/ -inline UINT8 v99x8_device::VDPpoint5(int MXS, int SX, int SY) +inline uint8_t v99x8_device::VDPpoint5(int MXS, int SX, int SY) { return (m_vram_space->read_byte(VDP_VRMP5(MXS, SX, SY)) >> (((~SX)&1)<<2) @@ -2209,7 +2209,7 @@ inline UINT8 v99x8_device::VDPpoint5(int MXS, int SX, int SY) /** VDPpoint6() ***********************************************/ /** Get a pixel on screen 6 **/ /*************************************************************/ -inline UINT8 v99x8_device::VDPpoint6(int MXS, int SX, int SY) +inline uint8_t v99x8_device::VDPpoint6(int MXS, int SX, int SY) { return (m_vram_space->read_byte(VDP_VRMP6(MXS, SX, SY)) >> (((~SX)&3)<<1) @@ -2219,7 +2219,7 @@ inline UINT8 v99x8_device::VDPpoint6(int MXS, int SX, int SY) /** VDPpoint7() ***********************************************/ /** Get a pixel on screen 7 **/ /*************************************************************/ -inline UINT8 v99x8_device::VDPpoint7(int MXS, int SX, int SY) +inline uint8_t v99x8_device::VDPpoint7(int MXS, int SX, int SY) { return (m_vram_space->read_byte(VDP_VRMP7(MXS, SX, SY)) >> (((~SX)&1)<<2) @@ -2229,7 +2229,7 @@ inline UINT8 v99x8_device::VDPpoint7(int MXS, int SX, int SY) /** VDPpoint8() ***********************************************/ /** Get a pixel on screen 8 **/ /*************************************************************/ -inline UINT8 v99x8_device::VDPpoint8(int MXS, int SX, int SY) +inline uint8_t v99x8_device::VDPpoint8(int MXS, int SX, int SY) { return m_vram_space->read_byte(VDP_VRMP8(MXS, SX, SY)); } @@ -2237,7 +2237,7 @@ inline UINT8 v99x8_device::VDPpoint8(int MXS, int SX, int SY) /** VDPpoint() ************************************************/ /** Get a pixel on a screen **/ /*************************************************************/ -inline UINT8 v99x8_device::VDPpoint(UINT8 SM, int MXS, int SX, int SY) +inline uint8_t v99x8_device::VDPpoint(uint8_t SM, int MXS, int SX, int SY) { switch(SM) { @@ -2254,11 +2254,11 @@ inline UINT8 v99x8_device::VDPpoint(UINT8 SM, int MXS, int SX, int SY) /** Low level function to set a pixel on a screen **/ /** Make it inline to make it fast **/ /*************************************************************/ -inline void v99x8_device::VDPpsetlowlevel(int addr, UINT8 CL, UINT8 M, UINT8 OP) +inline void v99x8_device::VDPpsetlowlevel(int addr, uint8_t CL, uint8_t M, uint8_t OP) { // If this turns out to be too slow, get a pointer to the address space // and work directly on it. - UINT8 val = m_vram_space->read_byte(addr); + uint8_t val = m_vram_space->read_byte(addr); switch (OP) { case 0: val = (val & M) | CL; break; @@ -2281,18 +2281,18 @@ inline void v99x8_device::VDPpsetlowlevel(int addr, UINT8 CL, UINT8 M, UINT8 OP) /** VDPpset5() ***********************************************/ /** Set a pixel on screen 5 **/ /*************************************************************/ -inline void v99x8_device::VDPpset5(int MXD, int DX, int DY, UINT8 CL, UINT8 OP) +inline void v99x8_device::VDPpset5(int MXD, int DX, int DY, uint8_t CL, uint8_t OP) { - UINT8 SH = ((~DX)&1)<<2; + uint8_t SH = ((~DX)&1)<<2; VDPpsetlowlevel(VDP_VRMP5(MXD, DX, DY), CL << SH, ~(15<= 5) && (m_mode <= 8)) ? (m_mode-5) : 0; + uint8_t SM=((m_mode >= 5) && (m_mode <= 8)) ? (m_mode-5) : 0; m_stat_reg[7]=m_cont_reg[44]&=Mask[SM]; VDP_PSET(SM, m_mmc.MXD, m_mmc.ADX, m_mmc.DY, m_cont_reg[44], m_mmc.LO); @@ -2659,7 +2659,7 @@ void v99x8_device::hmmv_engine() int NY=m_mmc.NY; int ADX=m_mmc.ADX; int ANX=m_mmc.ANX; - UINT8 CL=m_mmc.CL; + uint8_t CL=m_mmc.CL; int MXD = m_mmc.MXD; int cnt; int delta; @@ -2852,7 +2852,7 @@ void v99x8_device::hmmc_engine() /** VDPWrite() ***********************************************/ /** Use this function to transfer pixel(s) from CPU to m_ **/ /*************************************************************/ -void v99x8_device::cpu_to_vdp(UINT8 V) +void v99x8_device::cpu_to_vdp(uint8_t V) { m_stat_reg[2]&=0x7F; m_stat_reg[7]=m_cont_reg[44]=V; @@ -2862,7 +2862,7 @@ void v99x8_device::cpu_to_vdp(UINT8 V) /** VDPRead() ************************************************/ /** Use this function to transfer pixel(s) from VDP to CPU. **/ /*************************************************************/ -UINT8 v99x8_device::vdp_to_cpu() +uint8_t v99x8_device::vdp_to_cpu() { m_stat_reg[2]&=0x7F; if(m_vdp_engine&&(m_vdp_ops_count>0)) (this->*m_vdp_engine)(); @@ -2872,7 +2872,7 @@ UINT8 v99x8_device::vdp_to_cpu() /** report_vdp_command() ***************************************/ /** Report VDP Command to be executed **/ /*************************************************************/ -void v99x8_device::report_vdp_command(UINT8 Op) +void v99x8_device::report_vdp_command(uint8_t Op) { static const char *const Ops[16] = { @@ -2885,7 +2885,7 @@ void v99x8_device::report_vdp_command(UINT8 Op) " LMMV"," LMMM"," LMCM"," LMMC"," HMMV"," HMMM"," YMMM"," HMMC" }; - UINT8 CL, CM, LO; + uint8_t CL, CM, LO; int SX,SY, DX,DY, NX,NY; // Fetch arguments @@ -2910,7 +2910,7 @@ void v99x8_device::report_vdp_command(UINT8 Op) /** VDPDraw() ************************************************/ /** Perform a given V9938 operation Op. **/ /*************************************************************/ -UINT8 v99x8_device::command_unit_w(UINT8 Op) +uint8_t v99x8_device::command_unit_w(uint8_t Op) { int SM; @@ -2998,7 +2998,7 @@ UINT8 v99x8_device::command_unit_w(UINT8 Op) m_mmc.MXS = (m_cont_reg[45] & 0x10) != 0; m_mmc.MXD = (m_cont_reg[45] & 0x20) != 0; - // Argument depends on UINT8 or dot operation + // Argument depends on uint8_t or dot operation if ((m_mmc.CM & 0x0C) == 0x0C) { m_mmc.TX = m_cont_reg[45]&0x04? -PPB[SM]:PPB[SM]; m_mmc.NX = ((m_cont_reg[40]+((int)m_cont_reg[41]<<8)) & 1023)/PPB[SM]; diff --git a/src/devices/video/v9938.h b/src/devices/video/v9938.h index c2f9d356666..ae95f47ff0d 100644 --- a/src/devices/video/v9938.h +++ b/src/devices/video/v9938.h @@ -76,7 +76,7 @@ class v99x8_device : public device_t, { protected: // construction/destruction - v99x8_device(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, device_t *owner, UINT32 clock); + v99x8_device(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, device_t *owner, uint32_t clock); public: template void set_interrupt_callback(_irq irq) { @@ -86,19 +86,19 @@ public: bitmap_ind16 &get_bitmap() { return m_bitmap; } void update_mouse_state(int mx_delta, int my_delta, int button_state); - 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); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - UINT8 vram_r(); - UINT8 status_r(); - void palette_w(UINT8 data); - void vram_w(UINT8 data); - void command_w(UINT8 data); - void register_w(UINT8 data); + uint8_t vram_r(); + uint8_t status_r(); + void palette_w(uint8_t data); + void vram_w(uint8_t data); + void command_w(uint8_t data); + void register_w(uint8_t data); - static void static_set_vram_size(device_t &device, UINT32 vram_size); + static void static_set_vram_size(device_t &device, uint32_t vram_size); /* RESET pin */ void reset_line(int state) { if (state==ASSERT_LINE) device_reset(); } @@ -137,57 +137,57 @@ protected: private: // internal helpers - inline int position_offset(UINT8 value) { value &= 0x0f; return (value < 8) ? -value : 16 - value; } + inline int position_offset(uint8_t value) { value &= 0x0f; return (value < 8) ? -value : 16 - value; } void reset_palette(); void vram_write(int offset, int data); int vram_read(int offset); void check_int(); void register_write(int reg, int data); - void default_border(const pen_t *pens, UINT16 *ln); - void graphic7_border(const pen_t *pens, UINT16 *ln); - void graphic5_border(const pen_t *pens, UINT16 *ln); - void mode_text1(const pen_t *pens, UINT16 *ln, int line); - void mode_text2(const pen_t *pens, UINT16 *ln, int line); - void mode_multi(const pen_t *pens, UINT16 *ln, int line); - void mode_graphic1(const pen_t *pens, UINT16 *ln, int line); - void mode_graphic23(const pen_t *pens, UINT16 *ln, int line); - void mode_graphic4(const pen_t *pens, UINT16 *ln, int line); - void mode_graphic5(const pen_t *pens, UINT16 *ln, int line); - void mode_graphic6(const pen_t *pens, UINT16 *ln, int line); - void mode_graphic7(const pen_t *pens, UINT16 *ln, int line); + void default_border(const pen_t *pens, uint16_t *ln); + void graphic7_border(const pen_t *pens, uint16_t *ln); + void graphic5_border(const pen_t *pens, uint16_t *ln); + void mode_text1(const pen_t *pens, uint16_t *ln, int line); + void mode_text2(const pen_t *pens, uint16_t *ln, int line); + void mode_multi(const pen_t *pens, uint16_t *ln, int line); + void mode_graphic1(const pen_t *pens, uint16_t *ln, int line); + void mode_graphic23(const pen_t *pens, uint16_t *ln, int line); + void mode_graphic4(const pen_t *pens, uint16_t *ln, int line); + void mode_graphic5(const pen_t *pens, uint16_t *ln, int line); + void mode_graphic6(const pen_t *pens, uint16_t *ln, int line); + void mode_graphic7(const pen_t *pens, uint16_t *ln, int line); // template void mode_yae(const pen_t *pens, _PixelType *ln, int line); // template void mode_yjk(const pen_t *pens, _PixelType *ln, int line); - void mode_unknown(const pen_t *pens, UINT16 *ln, int line); - void default_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col); - void graphic5_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col); - void graphic7_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col); + void mode_unknown(const pen_t *pens, uint16_t *ln, int line); + void default_draw_sprite(const pen_t *pens, uint16_t *ln, uint8_t *col); + void graphic5_draw_sprite(const pen_t *pens, uint16_t *ln, uint8_t *col); + void graphic7_draw_sprite(const pen_t *pens, uint16_t *ln, uint8_t *col); - void sprite_mode1(int line, UINT8 *col); - void sprite_mode2(int line, UINT8 *col); + void sprite_mode1(int line, uint8_t *col); + void sprite_mode2(int line, uint8_t *col); void set_mode(); void refresh_16(int line); void refresh_line(int line); void interrupt_start_vblank(); - int VDPVRMP(UINT8 M, int MX, int X, int Y); + int VDPVRMP(uint8_t M, int MX, int X, int Y); - UINT8 VDPpoint5(int MXS, int SX, int SY); - UINT8 VDPpoint6(int MXS, int SX, int SY); - UINT8 VDPpoint7(int MXS, int SX, int SY); - UINT8 VDPpoint8(int MXS, int SX, int SY); + uint8_t VDPpoint5(int MXS, int SX, int SY); + uint8_t VDPpoint6(int MXS, int SX, int SY); + uint8_t VDPpoint7(int MXS, int SX, int SY); + uint8_t VDPpoint8(int MXS, int SX, int SY); - UINT8 VDPpoint(UINT8 SM, int MXS, int SX, int SY); + uint8_t VDPpoint(uint8_t SM, int MXS, int SX, int SY); - void VDPpsetlowlevel(int addr, UINT8 CL, UINT8 M, UINT8 OP); + void VDPpsetlowlevel(int addr, uint8_t CL, uint8_t M, uint8_t OP); - void VDPpset5(int MXD, int DX, int DY, UINT8 CL, UINT8 OP); - void VDPpset6(int MXD, int DX, int DY, UINT8 CL, UINT8 OP); - void VDPpset7(int MXD, int DX, int DY, UINT8 CL, UINT8 OP); - void VDPpset8(int MXD, int DX, int DY, UINT8 CL, UINT8 OP); + void VDPpset5(int MXD, int DX, int DY, uint8_t CL, uint8_t OP); + void VDPpset6(int MXD, int DX, int DY, uint8_t CL, uint8_t OP); + void VDPpset7(int MXD, int DX, int DY, uint8_t CL, uint8_t OP); + void VDPpset8(int MXD, int DX, int DY, uint8_t CL, uint8_t OP); - void VDPpset(UINT8 SM, int MXD, int DX, int DY, UINT8 CL, UINT8 OP); + void VDPpset(uint8_t SM, int MXD, int DX, int DY, uint8_t CL, uint8_t OP); int get_vdp_timing_value(const int *); @@ -204,37 +204,37 @@ private: inline bool v9938_second_field(); - void cpu_to_vdp(UINT8 V); - UINT8 vdp_to_cpu(); - void report_vdp_command(UINT8 Op); - UINT8 command_unit_w(UINT8 Op); + void cpu_to_vdp(uint8_t V); + uint8_t vdp_to_cpu(); + void report_vdp_command(uint8_t Op); + uint8_t command_unit_w(uint8_t Op); void update_command(); // general int m_offset_x, m_offset_y, m_visible_y, m_mode; // palette int m_pal_write_first, m_cmd_write_first; - UINT8 m_pal_write, m_cmd_write; - UINT8 m_pal_reg[32], m_stat_reg[10], m_cont_reg[48], m_read_ahead; - UINT8 m_v9958_sp_mode; + uint8_t m_pal_write, m_cmd_write; + uint8_t m_pal_reg[32], m_stat_reg[10], m_cont_reg[48], m_read_ahead; + uint8_t m_v9958_sp_mode; // memory - UINT16 m_address_latch; + uint16_t m_address_latch; int m_vram_size; // interrupt - UINT8 m_int_state; + uint8_t m_int_state; devcb_write_line m_int_callback; int m_scanline; // blinking int m_blink, m_blink_count; // mouse - UINT8 m_mx_delta, m_my_delta; + uint8_t m_mx_delta, m_my_delta; // mouse & lightpen - UINT8 m_button_state; + uint8_t m_button_state; // palette - UINT16 m_pal_ind16[16]; - UINT16 m_pal_ind256[256]; + uint16_t m_pal_ind16[16]; + uint16_t m_pal_ind256[256]; // render bitmap bitmap_ind16 m_bitmap; // Command unit @@ -245,39 +245,39 @@ private: int NX,NY; int MX; int ASX,ADX,ANX; - UINT8 CL; - UINT8 LO; - UINT8 CM; - UINT8 MXS, MXD; + uint8_t CL; + uint8_t LO; + uint8_t CM; + uint8_t MXS, MXD; } m_mmc; int m_vdp_ops_count; void (v99x8_device::*m_vdp_engine)(); struct v99x8_mode { - UINT8 m; - void (v99x8_device::*visible_16)(const pen_t *, UINT16*, int); - void (v99x8_device::*border_16)(const pen_t *, UINT16*); - void (v99x8_device::*sprites)(int, UINT8*); - void (v99x8_device::*draw_sprite_16)(const pen_t *, UINT16*, UINT8*); + uint8_t m; + void (v99x8_device::*visible_16)(const pen_t *, uint16_t*, int); + void (v99x8_device::*border_16)(const pen_t *, uint16_t*); + void (v99x8_device::*sprites)(int, uint8_t*); + void (v99x8_device::*draw_sprite_16)(const pen_t *, uint16_t*, uint8_t*); } ; static const v99x8_mode s_modes[]; required_device m_palette; emu_timer *m_line_timer; - UINT8 m_pal_ntsc; + uint8_t m_pal_ntsc; int m_scanline_start; int m_vblank_start; int m_scanline_max; int m_height; protected: - static UINT16 s_pal_indYJK[0x20000]; + static uint16_t s_pal_indYJK[0x20000]; }; class v9938_device : public v99x8_device { public: - v9938_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v9938_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_PALETTE_INIT(v9938); protected: @@ -287,7 +287,7 @@ protected: class v9958_device : public v99x8_device { public: - v9958_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + v9958_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_PALETTE_INIT(v9958); diff --git a/src/devices/video/vector.cpp b/src/devices/video/vector.cpp index 41140496c58..feb9a7e9a5c 100644 --- a/src/devices/video/vector.cpp +++ b/src/devices/video/vector.cpp @@ -67,7 +67,7 @@ void vector_options::init(emu_options& options) // device type definition const device_type VECTOR = &device_creator; -vector_device::vector_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vector_device::vector_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VECTOR, "VECTOR", tag, owner, clock, "vector_device", __FILE__), device_video_interface(mconfig, *this), m_vector_list(nullptr), @@ -143,9 +143,9 @@ void vector_device::clear_list(void) } -UINT32 vector_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t vector_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 flags = PRIMFLAG_ANTIALIAS(1) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD) | PRIMFLAG_VECTOR(1); + uint32_t flags = PRIMFLAG_ANTIALIAS(1) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD) | PRIMFLAG_VECTOR(1); const rectangle &visarea = screen.visible_area(); float xscale = 1.0f / (65536 * visarea.width()); float yscale = 1.0f / (65536 * visarea.height()); diff --git a/src/devices/video/vector.h b/src/devices/video/vector.h index 682ac71e7a4..130cbb6b2fb 100644 --- a/src/devices/video/vector.h +++ b/src/devices/video/vector.h @@ -46,9 +46,9 @@ class vector_device : public device_t, public device_video_interface { public: // construction/destruction - vector_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vector_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void clear_list(); void add_point(int x, int y, rgb_t color, int intensity); diff --git a/src/devices/video/vic4567.cpp b/src/devices/video/vic4567.cpp index 2172ba766b1..9e30e8b9d30 100644 --- a/src/devices/video/vic4567.cpp +++ b/src/devices/video/vic4567.cpp @@ -144,7 +144,7 @@ const device_type VIC3 = &device_creator; -vic3_device::vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vic3_device::vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIC3, "4567 VIC III", tag, owner, clock, "vic3", __FILE__), device_video_interface(mconfig, *this), m_type(VIC4567_NTSC), @@ -186,7 +186,7 @@ void vic3_device::device_start() m_lightpen_x_cb.resolve_safe(0); m_lightpen_y_cb.resolve_safe(0); - m_screenptr[0] = auto_alloc_array(machine(), UINT8, 216 * 656 / 8); + m_screenptr[0] = auto_alloc_array(machine(), uint8_t, 216 * 656 / 8); for (int i = 1; i < 216; i++) m_screenptr[i] = m_screenptr[i - 1] + 656 / 8; @@ -416,7 +416,7 @@ TIMER_CALLBACK_MEMBER( vic3_device::timer_timeout ) } } -void vic3_device::draw_character( int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color, int start_x, int end_x ) +void vic3_device::draw_character( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color, int start_x, int end_x ) { int code; @@ -560,7 +560,7 @@ void vic3_device::sprite_collision( int nr, int y, int x, int mask ) else if (xdiff < 0) value = m_sprites[i].bitmap[y][0] >> (-xdiff); else { - UINT8 *vp = m_sprites[i].bitmap[y]+(xdiff >> 3); + uint8_t *vp = m_sprites[i].bitmap[y]+(xdiff >> 3); value = ((vp[1] | (*vp << 8)) >> (8 - (xdiff & 7) )) & 0xff; } @@ -2033,7 +2033,7 @@ void vic3_device::raster_interrupt_gen() } } -UINT32 vic3_device::video_update( bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t vic3_device::video_update( bitmap_ind16 &bitmap, const rectangle &cliprect ) { copybitmap(bitmap, *m_bitmap, 0, 0, 0, 0, cliprect); return 0; diff --git a/src/devices/video/vic4567.h b/src/devices/video/vic4567.h index b4b179d43d5..d44f89e61bb 100644 --- a/src/devices/video/vic4567.h +++ b/src/devices/video/vic4567.h @@ -32,7 +32,7 @@ struct vic3_sprite /* buffer for currently painted line */ int paintedline[8]; - UINT8 bitmap[8][SPRITE_BASE_X_SIZE * 2 / 8 + 1 /*for simplier sprite collision detection*/]; + uint8_t bitmap[8][SPRITE_BASE_X_SIZE * 2 / 8 + 1 /*for simplier sprite collision detection*/]; }; @@ -124,7 +124,7 @@ class vic3_device : public device_t, public device_video_interface { public: - vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~vic3_device() {} static void static_set_cpu_tag(device_t &device, const char *tag) { downcast(device).m_cpu.set_tag(tag); } @@ -143,7 +143,7 @@ public: DECLARE_READ8_MEMBER(port_r); void raster_interrupt_gen(); - UINT32 video_update(bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t video_update(bitmap_ind16 &bitmap, const rectangle &cliprect); protected: // device-level overrides @@ -157,7 +157,7 @@ private: inline int getforeground16(int y, int x); void set_interrupt(int mask); void clear_interrupt(int mask); - void draw_character(int ybegin, int yend, int ch, int yoff, int xoff, UINT16 *color, int start_x, int end_x); + void draw_character(int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color, int start_x, int end_x); void draw_character_multi(int ybegin, int yend, int ch, int yoff, int xoff, int start_x, int end_x); void draw_bitmap(int ybegin, int yend, int ch, int yoff, int xoff, int start_x, int end_x); void draw_bitmap_multi(int ybegin, int yend, int ch, int yoff, int xoff, int start_x, int end_x); @@ -178,18 +178,18 @@ private: required_device m_cpu; - UINT8 m_reg[0x80]; + uint8_t m_reg[0x80]; int m_on; /* rastering of the screen */ int m_lines; - UINT16 m_chargenaddr, m_videoaddr, m_bitmapaddr; + uint16_t m_chargenaddr, m_videoaddr, m_bitmapaddr; std::unique_ptr m_bitmap; int m_x_begin, m_x_end; int m_y_begin, m_y_end; - UINT16 m_c64_bitmap[2], m_bitmapmulti[4], m_mono[2], m_multi[4], m_ecmcolor[2], m_colors[4], m_spritemulti[4]; + uint16_t m_c64_bitmap[2], m_bitmapmulti[4], m_mono[2], m_multi[4], m_ecmcolor[2], m_colors[4], m_spritemulti[4]; int m_lastline, m_rasterline; @@ -197,15 +197,15 @@ private: int m_columns, m_rows; /* background/foreground for sprite collision */ - UINT8 *m_screenptr[216], m_shift[216]; + uint8_t *m_screenptr[216], m_shift[216]; /* convert multicolor byte to background/foreground for sprite collision */ - UINT8 m_foreground[256]; - UINT16 m_expandx[256]; - UINT16 m_expandx_multi[256]; + uint8_t m_foreground[256]; + uint16_t m_expandx[256]; + uint16_t m_expandx_multi[256]; /* converts sprite multicolor info to info for background collision checking */ - UINT8 m_multi_collision[256]; + uint8_t m_multi_collision[256]; vic3_sprite m_sprites[8]; @@ -228,9 +228,9 @@ private: devcb_read8 m_c64_mem_r_cb; /* palette - vic3 specific items (the ones above are used for VIC II as well) */ - UINT8 m_palette_red[0x100]; - UINT8 m_palette_green[0x100]; - UINT8 m_palette_blue[0x100]; + uint8_t m_palette_red[0x100]; + uint8_t m_palette_green[0x100]; + uint8_t m_palette_blue[0x100]; int m_palette_dirty; required_device m_palette; diff --git a/src/devices/video/vooddefs.h b/src/devices/video/vooddefs.h index 7ccfcabb057..f579d7454db 100644 --- a/src/devices/video/vooddefs.h +++ b/src/devices/video/vooddefs.h @@ -36,9 +36,9 @@ static inline void fifo_reset(fifo_state *f) } -static inline void fifo_add(fifo_state *f, UINT32 data) +static inline void fifo_add(fifo_state *f, uint32_t data) { - INT32 next_in; + int32_t next_in; /* compute the value of 'in' after we add this item */ next_in = f->in + 1; @@ -54,14 +54,14 @@ static inline void fifo_add(fifo_state *f, UINT32 data) } -static inline UINT32 fifo_remove(fifo_state *f) +static inline uint32_t fifo_remove(fifo_state *f) { - UINT32 data = 0xffffffff; + uint32_t data = 0xffffffff; /* as long as we have data, we can do it */ if (f->out != f->in) { - INT32 next_out; + int32_t next_out; /* fetch the data */ data = f->base[f->out]; @@ -76,7 +76,7 @@ static inline UINT32 fifo_remove(fifo_state *f) } -static inline UINT32 fifo_peek(fifo_state *f) +static inline uint32_t fifo_peek(fifo_state *f) { return f->base[f->out]; } @@ -94,18 +94,18 @@ static inline int fifo_full(fifo_state *f) } -static inline INT32 fifo_items(fifo_state *f) +static inline int32_t fifo_items(fifo_state *f) { - INT32 items = f->in - f->out; + int32_t items = f->in - f->out; if (items < 0) items += f->size; return items; } -static inline INT32 fifo_space(fifo_state *f) +static inline int32_t fifo_space(fifo_state *f) { - INT32 items = f->in - f->out; + int32_t items = f->in - f->out; if (items < 0) items += f->size; return f->size - 1 - items; @@ -132,12 +132,12 @@ static inline INT32 fifo_space(fifo_state *f) * *************************************/ -static inline INT32 fast_reciplog(INT64 value, INT32 *log2) +static inline int32_t fast_reciplog(int64_t value, int32_t *log2) { - extern UINT32 voodoo_reciplog[]; - UINT32 temp, recip, rlog; - UINT32 interp; - UINT32 *table; + extern uint32_t voodoo_reciplog[]; + uint32_t temp, recip, rlog; + uint32_t interp; + uint32_t *table; int neg = FALSE; int lz, exp = 0; @@ -151,11 +151,11 @@ static inline INT32 fast_reciplog(INT64 value, INT32 *log2) /* if we've spilled out of 32 bits, push it down under 32 */ if (value & U64(0xffff00000000)) { - temp = (UINT32)(value >> 16); + temp = (uint32_t)(value >> 16); exp -= 16; } else - temp = (UINT32)value; + temp = (uint32_t)value; /* if the resulting value is 0, the reciprocal is infinite */ if (UNEXPECTED(temp == 0)) @@ -171,7 +171,7 @@ static inline INT32 fast_reciplog(INT64 value, INT32 *log2) /* compute a pointer to the table entries we want */ /* math is a bit funny here because we shift one less than we need to in order */ - /* to account for the fact that there are two UINT32's per table entry */ + /* to account for the fact that there are two uint32_t's per table entry */ table = &voodoo_reciplog[(temp >> (31 - RECIPLOG_LOOKUP_BITS - 1)) & ((2 << RECIPLOG_LOOKUP_BITS) - 2)]; /* compute the interpolation value */ @@ -210,10 +210,10 @@ static inline INT32 fast_reciplog(INT64 value, INT32 *log2) * *************************************/ -static inline INT32 float_to_int32(UINT32 data, int fixedbits) +static inline int32_t float_to_int32(uint32_t data, int fixedbits) { int exponent = ((data >> 23) & 0xff) - 127 - 23 + fixedbits; - INT32 result = (data & 0x7fffff) | 0x800000; + int32_t result = (data & 0x7fffff) | 0x800000; if (exponent < 0) { if (exponent > -32) @@ -234,10 +234,10 @@ static inline INT32 float_to_int32(UINT32 data, int fixedbits) } -static inline INT64 float_to_int64(UINT32 data, int fixedbits) +static inline int64_t float_to_int64(uint32_t data, int fixedbits) { int exponent = ((data >> 23) & 0xff) - 127 - 23 + fixedbits; - INT64 result = (data & 0x7fffff) | 0x800000; + int64_t result = (data & 0x7fffff) | 0x800000; if (exponent < 0) { if (exponent > -64) @@ -265,7 +265,7 @@ static inline INT64 float_to_int64(UINT32 data, int fixedbits) * *************************************/ -static inline UINT32 normalize_color_path(UINT32 eff_color_path) +static inline uint32_t normalize_color_path(uint32_t eff_color_path) { /* ignore the subpixel adjust and texture enable flags */ eff_color_path &= ~((1 << 26) | (1 << 27)); @@ -274,7 +274,7 @@ static inline UINT32 normalize_color_path(UINT32 eff_color_path) } -static inline UINT32 normalize_alpha_mode(UINT32 eff_alpha_mode) +static inline uint32_t normalize_alpha_mode(uint32_t eff_alpha_mode) { /* always ignore alpha ref value */ eff_alpha_mode &= ~(0xff << 24); @@ -291,7 +291,7 @@ static inline UINT32 normalize_alpha_mode(UINT32 eff_alpha_mode) } -static inline UINT32 normalize_fog_mode(UINT32 eff_fog_mode) +static inline uint32_t normalize_fog_mode(uint32_t eff_fog_mode) { /* if not doing fogging, ignore all the other fog bits */ if (!FOGMODE_ENABLE_FOG(eff_fog_mode)) @@ -301,7 +301,7 @@ static inline UINT32 normalize_fog_mode(UINT32 eff_fog_mode) } -static inline UINT32 normalize_fbz_mode(UINT32 eff_fbz_mode) +static inline uint32_t normalize_fbz_mode(uint32_t eff_fbz_mode) { /* ignore the draw buffer */ eff_fbz_mode &= ~(3 << 14); @@ -310,7 +310,7 @@ static inline UINT32 normalize_fbz_mode(UINT32 eff_fbz_mode) } -static inline UINT32 normalize_tex_mode(UINT32 eff_tex_mode) +static inline uint32_t normalize_tex_mode(uint32_t eff_tex_mode) { /* ignore the NCC table and seq_8_downld flags */ eff_tex_mode &= ~((1 << 5) | (1 << 31)); @@ -327,9 +327,9 @@ static inline UINT32 normalize_tex_mode(UINT32 eff_tex_mode) } -static inline UINT32 compute_raster_hash(const raster_info *info) +static inline uint32_t compute_raster_hash(const raster_info *info) { - UINT32 hash; + uint32_t hash; /* make a hash */ hash = info->eff_color_path; @@ -361,11 +361,11 @@ static inline UINT32 compute_raster_hash(const raster_info *info) #define DITHER_G(val,dith) ((((val) << 2) - ((val) >> 4) + ((val) >> 6) + (dith)) >> 2) #define DECLARE_DITHER_POINTERS \ - const UINT8 *dither_lookup = nullptr; \ - const UINT8 *dither4 = nullptr; \ - const UINT8 *dither = nullptr + const uint8_t *dither_lookup = nullptr; \ + const uint8_t *dither4 = nullptr; \ + const uint8_t *dither = nullptr #define DECLARE_DITHER_POINTERS_NO_DITHER_VAR \ - const UINT8 *dither_lookup = nullptr; + const uint8_t *dither_lookup = nullptr; #define COMPUTE_DITHER_POINTERS(FBZMODE, YY) \ do \ { \ @@ -412,7 +412,7 @@ do if (FBZMODE_ENABLE_DITHERING(FBZMODE)) \ { \ /* look up the dither value from the appropriate matrix */ \ - const UINT8 *dith = &DITHER_LOOKUP[((XX) & 3) << 1]; \ + const uint8_t *dith = &DITHER_LOOKUP[((XX) & 3) << 1]; \ \ /* apply dithering to R,G,B */ \ (RR) = dith[((RR) << 3) + 0]; \ @@ -439,10 +439,10 @@ while (0) #define CLAMPED_ARGB(ITERR, ITERG, ITERB, ITERA, FBZCP, RESULT) \ do \ { \ - r = (INT32)(ITERR) >> 12; \ - g = (INT32)(ITERG) >> 12; \ - b = (INT32)(ITERB) >> 12; \ - a = (INT32)(ITERA) >> 12; \ + r = (int32_t)(ITERR) >> 12; \ + g = (int32_t)(ITERG) >> 12; \ + b = (int32_t)(ITERB) >> 12; \ + a = (int32_t)(ITERA) >> 12; \ \ if (FBZCP_RGBZW_CLAMP(FBZCP) == 0) \ { \ @@ -484,10 +484,10 @@ do } \ while (0) -static inline rgbaint_t ATTR_FORCE_INLINE clampARGB(const rgbaint_t &iterargb, UINT32 FBZCP) +static inline rgbaint_t ATTR_FORCE_INLINE clampARGB(const rgbaint_t &iterargb, uint32_t FBZCP) { rgbaint_t result(iterargb); - //rgbaint_t colorint((INT32) (itera>>12), (INT32) (iterr>>12), (INT32) (iterg>>12), (INT32) (iterb>>12)); + //rgbaint_t colorint((int32_t) (itera>>12), (int32_t) (iterr>>12), (int32_t) (iterg>>12), (int32_t) (iterb>>12)); result.shr_imm(12); if (FBZCP_RGBZW_CLAMP(FBZCP) == 0) @@ -502,7 +502,7 @@ static inline rgbaint_t ATTR_FORCE_INLINE clampARGB(const rgbaint_t &iterargb, U //else if (r == 0x100) temp.set(result); temp.cmpeq_imm(0x100); - // Shift by 1 so that INT32 result is not negative + // Shift by 1 so that int32_t result is not negative temp.shr_imm(1); // result.rgb.r = 0xff; result.or_reg(temp); @@ -518,7 +518,7 @@ static inline rgbaint_t ATTR_FORCE_INLINE clampARGB(const rgbaint_t &iterargb, U #define CLAMPED_Z(ITERZ, FBZCP, RESULT) \ do \ { \ - (RESULT) = (INT32)(ITERZ) >> 12; \ + (RESULT) = (int32_t)(ITERZ) >> 12; \ if (FBZCP_RGBZW_CLAMP(FBZCP) == 0) \ { \ (RESULT) &= 0xfffff; \ @@ -540,7 +540,7 @@ while (0) #define CLAMPED_W(ITERW, FBZCP, RESULT) \ do \ { \ - (RESULT) = (INT16)((ITERW) >> 32); \ + (RESULT) = (int16_t)((ITERW) >> 32); \ if (FBZCP_RGBZW_CLAMP(FBZCP) == 0) \ { \ (RESULT) &= 0xffff; \ @@ -583,7 +583,7 @@ do /* tricky range version */ \ else \ { \ - INT32 low, high, test; \ + int32_t low, high, test; \ int results = 0; \ \ /* check blue */ \ @@ -631,7 +631,7 @@ do } \ while (0) -static inline bool ATTR_FORCE_INLINE chromaKeyTest(voodoo_device *vd, stats_block *stats, UINT32 fbzModeReg, rgbaint_t rgbaIntColor) +static inline bool ATTR_FORCE_INLINE chromaKeyTest(voodoo_device *vd, stats_block *stats, uint32_t fbzModeReg, rgbaint_t rgbaIntColor) { if (FBZMODE_ENABLE_CHROMAKEY(fbzModeReg)) { @@ -650,7 +650,7 @@ static inline bool ATTR_FORCE_INLINE chromaKeyTest(voodoo_device *vd, stats_bloc /* tricky range version */ else { - INT32 low, high, test; + int32_t low, high, test; int results; /* check blue */ @@ -720,7 +720,7 @@ do } \ while (0) -static inline bool alphaMaskTest(stats_block *stats, UINT32 fbzModeReg, UINT8 alpha) +static inline bool alphaMaskTest(stats_block *stats, uint32_t fbzModeReg, uint8_t alpha) { if (FBZMODE_ENABLE_ALPHA_MASK(fbzModeReg)) { @@ -744,7 +744,7 @@ do { \ if (ALPHAMODE_ALPHATEST(ALPHAMODE)) \ { \ - UINT8 alpharef = (VV)->reg[alphaMode].rgb.a; \ + uint8_t alpharef = (VV)->reg[alphaMode].rgb.a; \ switch (ALPHAMODE_ALPHAFUNCTION(ALPHAMODE)) \ { \ case 0: /* alphaOP = never */ \ @@ -806,11 +806,11 @@ do } \ while (0) -static inline bool ATTR_FORCE_INLINE alphaTest(voodoo_device *vd, stats_block *stats, UINT32 alphaModeReg, UINT8 alpha) +static inline bool ATTR_FORCE_INLINE alphaTest(voodoo_device *vd, stats_block *stats, uint32_t alphaModeReg, uint8_t alpha) { if (ALPHAMODE_ALPHATEST(alphaModeReg)) { - UINT8 alpharef = vd->reg[alphaMode].rgb.a; + uint8_t alpharef = vd->reg[alphaMode].rgb.a; switch (ALPHAMODE_ALPHAFUNCTION(alphaModeReg)) { case 0: /* alphaOP = never */ @@ -1035,7 +1035,7 @@ do } \ while (0) -static inline void ATTR_FORCE_INLINE alphaBlend(UINT32 FBZMODE, UINT32 ALPHAMODE, INT32 x, const UINT8 *dither, int dpix, UINT16 *depth, rgbaint_t &preFog, rgbaint_t &srcColor) +static inline void ATTR_FORCE_INLINE alphaBlend(uint32_t FBZMODE, uint32_t ALPHAMODE, int32_t x, const uint8_t *dither, int dpix, uint16_t *depth, rgbaint_t &preFog, rgbaint_t &srcColor) { if (ALPHAMODE_ALPHABLEND(ALPHAMODE)) { @@ -1248,7 +1248,7 @@ do if (FOGMODE_ENABLE_FOG(FOGMODE)) \ { \ rgb_union fogcolor = (VV)->reg[fogColor]; \ - INT32 fr, fg, fb; \ + int32_t fr, fg, fb; \ \ /* constant fog bypasses everything else */ \ if (FOGMODE_FOG_CONSTANT(FOGMODE)) \ @@ -1261,7 +1261,7 @@ do /* non-constant fog comes from several sources */ \ else \ { \ - INT32 fogblend = 0; \ + int32_t fogblend = 0; \ \ /* if fog_add is zero, we start with the fog color */ \ if (FOGMODE_FOG_ADD(FOGMODE) == 0) \ @@ -1286,8 +1286,8 @@ do { \ case 0: /* fog table */ \ { \ - INT32 delta = (VV)->fbi.fogdelta[fogdepth >> 10]; \ - INT32 deltaval; \ + int32_t delta = (VV)->fbi.fogdelta[fogdepth >> 10]; \ + int32_t deltaval; \ \ /* perform the multiply against lower 8 bits of wfloat */ \ deltaval = (delta & (VV)->fbi.fogdelta_mask) * \ @@ -1353,12 +1353,12 @@ do } \ while (0) -static inline void ATTR_FORCE_INLINE applyFogging(voodoo_device *vd, UINT32 fogModeReg, UINT32 fbzCpReg, INT32 x, const UINT8 *dither4, INT32 fogDepth, - rgbaint_t &color, INT32 iterz, INT64 iterw, UINT8 itera) +static inline void ATTR_FORCE_INLINE applyFogging(voodoo_device *vd, uint32_t fogModeReg, uint32_t fbzCpReg, int32_t x, const uint8_t *dither4, int32_t fogDepth, + rgbaint_t &color, int32_t iterz, int64_t iterw, uint8_t itera) { if (FOGMODE_ENABLE_FOG(fogModeReg)) { - UINT32 color_alpha = color.get_a(); + uint32_t color_alpha = color.get_a(); /* constant fog bypasses everything else */ rgbaint_t fogColorLocal(vd->reg[fogColor].u); @@ -1383,7 +1383,7 @@ static inline void ATTR_FORCE_INLINE applyFogging(voodoo_device *vd, UINT32 fogM /* non-constant fog comes from several sources */ else { - INT32 fogblend = 0; + int32_t fogblend = 0; /* if fog_add is zero, we start with the fog color */ if (FOGMODE_FOG_ADD(fogModeReg)) @@ -1405,8 +1405,8 @@ static inline void ATTR_FORCE_INLINE applyFogging(voodoo_device *vd, UINT32 fogM { case 0: /* fog table */ { - INT32 delta = vd->fbi.fogdelta[fogDepth >> 10]; - INT32 deltaval; + int32_t delta = vd->fbi.fogdelta[fogDepth >> 10]; + int32_t deltaval; /* perform the multiply against lower 8 bits of wfloat */ deltaval = (delta & vd->fbi.fogdelta_mask) * @@ -1488,20 +1488,20 @@ static inline void ATTR_FORCE_INLINE applyFogging(voodoo_device *vd, UINT32 fogM #define TEXTURE_PIPELINE(TT, XX, DITHER4, TEXMODE, COTHER, LOOKUP, LODBASE, ITERS, ITERT, ITERW, RESULT) \ do \ { \ - INT32 blendr, blendg, blendb, blenda; \ - INT32 tr, tg, tb, ta; \ - INT32 s, t, lod, ilod; \ - INT32 smax, tmax; \ - UINT32 texbase; \ + int32_t blendr, blendg, blendb, blenda; \ + int32_t tr, tg, tb, ta; \ + int32_t s, t, lod, ilod; \ + int32_t smax, tmax; \ + uint32_t texbase; \ rgb_union c_local; \ \ /* determine the S/T/LOD values for this texture */ \ if (TEXMODE_ENABLE_PERSPECTIVE(TEXMODE)) \ { \ if (USE_FAST_RECIP) { \ - const INT32 oow = fast_reciplog((ITERW), &lod); \ - s = ((INT64)oow * (ITERS)) >> 29; \ - t = ((INT64)oow * (ITERT)) >> 29; \ + const int32_t oow = fast_reciplog((ITERW), &lod); \ + s = ((int64_t)oow * (ITERS)) >> 29; \ + t = ((int64_t)oow * (ITERT)) >> 29; \ } else { \ multi_reciplog(ITERS, ITERT, ITERW, lod, s, t); \ } \ @@ -1545,7 +1545,7 @@ do { \ /* point sampled */ \ \ - UINT32 texel0; \ + uint32_t texel0; \ \ /* adjust S/T for the LOD and strip off the fractions */ \ s >>= ilod + 18; \ @@ -1563,12 +1563,12 @@ do /* fetch texel data */ \ if (TEXMODE_FORMAT(TEXMODE) < 8) \ { \ - texel0 = *(UINT8 *)&(TT)->ram[(texbase + t + s) & (TT)->mask]; \ + texel0 = *(uint8_t *)&(TT)->ram[(texbase + t + s) & (TT)->mask]; \ c_local.u = (LOOKUP)[texel0]; \ } \ else \ { \ - texel0 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s)) & (TT)->mask]; \ + texel0 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t + s)) & (TT)->mask]; \ if (TEXMODE_FORMAT(TEXMODE) >= 10 && TEXMODE_FORMAT(TEXMODE) <= 12) \ c_local.u = (LOOKUP)[texel0]; \ else \ @@ -1580,9 +1580,9 @@ do { \ /* bilinear filtered */ \ \ - UINT32 texel0, texel1, texel2, texel3; \ - UINT32 sfrac, tfrac; \ - INT32 s1, t1; \ + uint32_t texel0, texel1, texel2, texel3; \ + uint32_t sfrac, tfrac; \ + int32_t s1, t1; \ \ /* adjust S/T for the LOD and strip off all but the low 8 bits of */ \ /* the fraction */ \ @@ -1624,10 +1624,10 @@ do /* fetch texel data */ \ if (TEXMODE_FORMAT(TEXMODE) < 8) \ { \ - texel0 = *(UINT8 *)&(TT)->ram[(texbase + t + s) & (TT)->mask]; \ - texel1 = *(UINT8 *)&(TT)->ram[(texbase + t + s1) & (TT)->mask]; \ - texel2 = *(UINT8 *)&(TT)->ram[(texbase + t1 + s) & (TT)->mask]; \ - texel3 = *(UINT8 *)&(TT)->ram[(texbase + t1 + s1) & (TT)->mask]; \ + texel0 = *(uint8_t *)&(TT)->ram[(texbase + t + s) & (TT)->mask]; \ + texel1 = *(uint8_t *)&(TT)->ram[(texbase + t + s1) & (TT)->mask]; \ + texel2 = *(uint8_t *)&(TT)->ram[(texbase + t1 + s) & (TT)->mask]; \ + texel3 = *(uint8_t *)&(TT)->ram[(texbase + t1 + s1) & (TT)->mask]; \ texel0 = (LOOKUP)[texel0]; \ texel1 = (LOOKUP)[texel1]; \ texel2 = (LOOKUP)[texel2]; \ @@ -1635,10 +1635,10 @@ do } \ else \ { \ - texel0 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s)) & (TT)->mask]; \ - texel1 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s1)) & (TT)->mask];\ - texel2 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t1 + s)) & (TT)->mask];\ - texel3 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t1 + s1)) & (TT)->mask];\ + texel0 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t + s)) & (TT)->mask]; \ + texel1 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t + s1)) & (TT)->mask];\ + texel2 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t1 + s)) & (TT)->mask];\ + texel3 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t1 + s1)) & (TT)->mask];\ if (TEXMODE_FORMAT(TEXMODE) >= 10 && TEXMODE_FORMAT(TEXMODE) <= 12) \ { \ texel0 = (LOOKUP)[texel0]; \ @@ -1831,8 +1831,8 @@ while (0) #define PIXEL_PIPELINE_BEGIN(vd, STATS, XX, YY, FBZCOLORPATH, FBZMODE, ITERZ, ITERW) \ do \ { \ - INT32 depthval, wfloat, fogdepth, biasdepth; \ - INT32 r, g, b, a; \ + int32_t depthval, wfloat, fogdepth, biasdepth; \ + int32_t r, g, b, a; \ \ (STATS)->pixels_in++; \ \ @@ -1870,7 +1870,7 @@ do wfloat = 0x0000; \ else \ { \ - UINT32 temp = (UINT32)(ITERW); \ + uint32_t temp = (uint32_t)(ITERW); \ if (!(temp & 0xffff0000)) \ wfloat = 0xffff; \ else \ @@ -1883,7 +1883,7 @@ do /* add the bias for fog selection*/ \ if (FBZMODE_ENABLE_DEPTH_BIAS(FBZMODE)) \ { \ - fogdepth += (INT16)vd->reg[zaColor].u; \ + fogdepth += (int16_t)vd->reg[zaColor].u; \ CLAMP(fogdepth, 0, 0xffff); \ } \ \ @@ -1900,7 +1900,7 @@ do depthval = 0x0000; \ else \ { \ - UINT32 temp = (ITERZ << 4); \ + uint32_t temp = (ITERZ << 4); \ if (!(temp & 0xffff0000)) \ depthval = 0xffff; \ else \ @@ -1914,7 +1914,7 @@ do biasdepth = depthval; \ if (FBZMODE_ENABLE_DEPTH_BIAS(FBZMODE)) \ { \ - biasdepth += (INT16)vd->reg[zaColor].u; \ + biasdepth += (int16_t)vd->reg[zaColor].u; \ CLAMP(biasdepth, 0, 0xffff); \ } @@ -1925,14 +1925,14 @@ do /* handle depth buffer testing */ \ if (FBZMODE_ENABLE_DEPTHBUF(FBZMODE)) \ { \ - INT32 depthsource; \ + int32_t depthsource; \ \ /* the source depth is either the iterated W/Z+bias or a */ \ /* constant value */ \ if (FBZMODE_DEPTH_SOURCE_COMPARE(FBZMODE) == 0) \ depthsource = biasdepth; \ else \ - depthsource = (UINT16)vd->reg[zaColor].u; \ + depthsource = (uint16_t)vd->reg[zaColor].u; \ \ /* test against the depth buffer */ \ switch (FBZMODE_DEPTH_FUNCTION(FBZMODE)) \ @@ -1996,12 +1996,12 @@ do } \ while (0) -static inline bool ATTR_FORCE_INLINE depthTest(UINT16 zaColorReg, stats_block *stats, INT32 destDepth, UINT32 fbzModeReg, INT32 biasdepth) +static inline bool ATTR_FORCE_INLINE depthTest(uint16_t zaColorReg, stats_block *stats, int32_t destDepth, uint32_t fbzModeReg, int32_t biasdepth) { /* handle depth buffer testing */ if (FBZMODE_ENABLE_DEPTHBUF(fbzModeReg)) { - INT32 depthsource; + int32_t depthsource; /* the source depth is either the iterated W/Z+bias or a */ /* constant value */ @@ -2151,12 +2151,12 @@ while (0) /* Expects the following declarations to be outside of this scope: - INT32 r, g, b, a; + int32_t r, g, b, a; */ #define COLORPATH_PIPELINE(VV, STATS, FBZCOLORPATH, FBZMODE, ALPHAMODE, TEXELARGB, ITERZ, ITERW, ITERARGB) \ do \ { \ - INT32 blendr, blendg, blendb, blenda; \ + int32_t blendr, blendg, blendb, blenda; \ rgb_union c_other; \ rgb_union c_local; \ \ @@ -2238,7 +2238,7 @@ do { \ int temp; \ CLAMPED_Z(ITERZ, FBZCOLORPATH, temp); \ - c_local.rgb.a = (UINT8)temp; \ + c_local.rgb.a = (uint8_t)temp; \ break; \ } \ \ @@ -2246,7 +2246,7 @@ do { \ int temp; \ CLAMPED_W(ITERW, FBZCOLORPATH, temp); /* Voodoo 2 only */ \ - c_local.rgb.a = (UINT8)temp; \ + c_local.rgb.a = (uint8_t)temp; \ break; \ } \ } \ @@ -2407,8 +2407,8 @@ do } \ while (0) -static inline bool ATTR_FORCE_INLINE combineColor(voodoo_device *vd, stats_block *STATS, UINT32 FBZCOLORPATH, UINT32 FBZMODE, UINT32 ALPHAMODE, - rgbaint_t TEXELARGB, INT32 ITERZ, INT64 ITERW, rgbaint_t &srcColor) +static inline bool ATTR_FORCE_INLINE combineColor(voodoo_device *vd, stats_block *STATS, uint32_t FBZCOLORPATH, uint32_t FBZMODE, uint32_t ALPHAMODE, + rgbaint_t TEXELARGB, int32_t ITERZ, int64_t ITERW, rgbaint_t &srcColor) { rgbaint_t c_other; rgbaint_t c_local; @@ -2496,7 +2496,7 @@ static inline bool ATTR_FORCE_INLINE combineColor(voodoo_device *vd, stats_block { int temp; CLAMPED_Z(ITERZ, FBZCOLORPATH, temp); - c_local.set_a((UINT8) temp); + c_local.set_a((uint8_t) temp); break; } @@ -2504,14 +2504,14 @@ static inline bool ATTR_FORCE_INLINE combineColor(voodoo_device *vd, stats_block { int temp; CLAMPED_W(ITERW, FBZCOLORPATH, temp); /* Voodoo 2 only */ - c_local.set_a((UINT8) temp); + c_local.set_a((uint8_t) temp); break; } } - UINT8 a_other = c_other.get_a(); - UINT8 a_local = c_local.get_a(); - UINT8 tmp; + uint8_t a_other = c_other.get_a(); + uint8_t a_local = c_local.get_a(); + uint8_t tmp; rgbaint_t add_val(c_local); /* select zero or c_other */ @@ -2658,24 +2658,24 @@ static inline bool ATTR_FORCE_INLINE combineColor(voodoo_device *vd, stats_block #define RASTERIZER(name, TMUS, FBZCOLORPATH, FBZMODE, ALPHAMODE, FOGMODE, TEXMODE0, TEXMODE1) \ \ -void voodoo_device::raster_##name(void *destbase, INT32 y, const poly_extent *extent, const void *extradata, int threadid) \ +void voodoo_device::raster_##name(void *destbase, int32_t y, const poly_extent *extent, const void *extradata, int threadid) \ { \ const poly_extra_data *extra = (const poly_extra_data *)extradata; \ voodoo_device *vd = extra->device; \ stats_block *stats = &vd->thread_stats[threadid]; \ DECLARE_DITHER_POINTERS; \ - INT32 startx = extent->startx; \ - INT32 stopx = extent->stopx; \ + int32_t startx = extent->startx; \ + int32_t stopx = extent->stopx; \ rgbaint_t iterargb, iterargbDelta; \ - INT32 iterz; \ - INT64 iterw, iterw0 = 0, iterw1 = 0; \ - INT64 iters0 = 0, iters1 = 0; \ - INT64 itert0 = 0, itert1 = 0; \ - UINT16 *depth; \ - UINT16 *dest; \ - INT32 dx, dy; \ - INT32 scry; \ - INT32 x; \ + int32_t iterz; \ + int64_t iterw, iterw0 = 0, iterw1 = 0; \ + int64_t iters0 = 0, iters1 = 0; \ + int64_t itert0 = 0, itert1 = 0; \ + uint16_t *depth; \ + uint16_t *dest; \ + int32_t dx, dy; \ + int32_t scry; \ + int32_t x; \ \ /* determine the screen Y */ \ scry = y; \ @@ -2688,7 +2688,7 @@ void voodoo_device::raster_##name(void *destbase, INT32 y, const poly_extent *ex /* apply clipping */ \ if (FBZMODE_ENABLE_CLIPPING(FBZMODE)) \ { \ - INT32 tempclip; \ + int32_t tempclip; \ \ /* Y clipping buys us the whole scanline */ \ if (scry < ((vd->reg[clipLowYHighY].u >> 16) & 0x3ff) || \ @@ -2717,16 +2717,16 @@ void voodoo_device::raster_##name(void *destbase, INT32 y, const poly_extent *ex } \ \ /* get pointers to the target buffer and depth buffer */ \ - dest = (UINT16 *)destbase + scry * vd->fbi.rowpixels; \ - depth = (vd->fbi.auxoffs != ~0) ? ((UINT16 *)(vd->fbi.ram + vd->fbi.auxoffs) + scry * vd->fbi.rowpixels) : nullptr; \ + dest = (uint16_t *)destbase + scry * vd->fbi.rowpixels; \ + depth = (vd->fbi.auxoffs != ~0) ? ((uint16_t *)(vd->fbi.ram + vd->fbi.auxoffs) + scry * vd->fbi.rowpixels) : nullptr; \ \ /* compute the starting parameters */ \ dx = startx - (extra->ax >> 4); \ dy = y - (extra->ay >> 4); \ - INT32 iterr = extra->startr + dy * extra->drdy + dx * extra->drdx; \ - INT32 iterg = extra->startg + dy * extra->dgdy + dx * extra->dgdx; \ - INT32 iterb = extra->startb + dy * extra->dbdy + dx * extra->dbdx; \ - INT32 itera = extra->starta + dy * extra->dady + dx * extra->dadx; \ + int32_t iterr = extra->startr + dy * extra->drdy + dx * extra->drdx; \ + int32_t iterg = extra->startg + dy * extra->dgdy + dx * extra->dgdx; \ + int32_t iterb = extra->startb + dy * extra->dbdy + dx * extra->dbdx; \ + int32_t itera = extra->starta + dy * extra->dady + dx * extra->dadx; \ iterargb.set(itera, iterr, iterg, iterb); \ iterargbDelta.set(extra->dadx, extra->drdx, extra->dgdx, extra->dbdx); \ iterz = extra->startz + dy * extra->dzdy + dx * extra->dzdx; \ @@ -2753,13 +2753,13 @@ void voodoo_device::raster_##name(void *destbase, INT32 y, const poly_extent *ex /* pixel pipeline part 1 handles depth setup and stippling */ \ PIXEL_PIPELINE_BEGIN(vd, stats, x, y, FBZCOLORPATH, FBZMODE, iterz, iterw); \ /* depth testing */ \ - if (!depthTest((UINT16) vd->reg[zaColor].u, stats, depth[x], FBZMODE, biasdepth)) \ + if (!depthTest((uint16_t) vd->reg[zaColor].u, stats, depth[x], FBZMODE, biasdepth)) \ goto skipdrawdepth; \ \ /* run the texture pipeline on TMU1 to produce a value in texel */ \ /* note that they set LOD min to 8 to "disable" a TMU */ \ if (TMUS >= 2 && vd->tmu[1].lodmin < (8 << 8)) { \ - INT32 tmp; \ + int32_t tmp; \ const rgbaint_t texelZero(0); \ texel = genTexture(&vd->tmu[1], x, dither4, TEXMODE1, vd->tmu[1].lookup, extra->lodbase1, \ iters1, itert1, iterw1, tmp); \ @@ -2772,7 +2772,7 @@ void voodoo_device::raster_##name(void *destbase, INT32 y, const poly_extent *ex { \ if (!vd->send_config) \ { \ - INT32 lod0; \ + int32_t lod0; \ rgbaint_t texelT0; \ texelT0 = genTexture(&vd->tmu[0], x, dither4, TEXMODE0, vd->tmu[0].lookup, extra->lodbase0, \ iters0, itert0, iterw0, lod0); \ @@ -2819,23 +2819,23 @@ void voodoo_device::raster_##name(void *destbase, INT32 y, const poly_extent *ex // The return value is coded as a 24.8 value. // The maximum error using a 4 bit lookup from the mantissa is 0.0875, which is less than 1/2 lsb (0.125) for 2 bits of fraction. // ****************************************************************************************************************************** -static inline INT32 ATTR_FORCE_INLINE new_log2(double &value) +static inline int32_t ATTR_FORCE_INLINE new_log2(double &value) { - static const INT32 new_log2_table[16] = {0, 22, 44, 63, 82, 100, 118, 134, 150, 165, 179, 193, 207, 220, 232, 244}; - UINT64 ival = *((UINT64 *)&value); + static const int32_t new_log2_table[16] = {0, 22, 44, 63, 82, 100, 118, 134, 150, 165, 179, 193, 207, 220, 232, 244}; + uint64_t ival = *((uint64_t *)&value); // We zero the result if negative so don't worry about the sign bit - INT32 exp = (ival>>52); + int32_t exp = (ival>>52); exp -= 1023+32; exp <<= 8; - UINT32 addr = (UINT64)(ival>>48) & 0xf; + uint32_t addr = (uint64_t)(ival>>48) & 0xf; exp += new_log2_table[addr]; // Return 0 if negative - return (ival & ((UINT64)1<<63)) ? 0 : exp; + return (ival & ((uint64_t)1<<63)) ? 0 : exp; } // Computes A/C and B/C and returns log2 of 1/C // A, B and C are 16.32 values. The results are 24.8. -static inline void ATTR_FORCE_INLINE multi_reciplog(INT64 valueA, INT64 valueB, INT64 valueC, INT32 &log, INT32 &resA, INT32 &resB) +static inline void ATTR_FORCE_INLINE multi_reciplog(int64_t valueA, int64_t valueB, int64_t valueC, int32_t &log, int32_t &resA, int32_t &resB) { double recip = double(1ULL<<(47-39))/valueC; double resAD = valueA * recip; @@ -2847,20 +2847,20 @@ static inline void ATTR_FORCE_INLINE multi_reciplog(INT64 valueA, INT64 valueB, } -static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, const UINT8 *dither4, const UINT32 TEXMODE, rgb_t *LOOKUP, INT32 LODBASE, INT64 ITERS, INT64 ITERT, INT64 ITERW, INT32 &lod) +static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, int32_t x, const uint8_t *dither4, const uint32_t TEXMODE, rgb_t *LOOKUP, int32_t LODBASE, int64_t ITERS, int64_t ITERT, int64_t ITERW, int32_t &lod) { rgbaint_t result; - INT32 s, t, ilod; + int32_t s, t, ilod; /* determine the S/T/LOD values for this texture */ lod = (LODBASE); if (TEXMODE_ENABLE_PERSPECTIVE(TEXMODE)) { - INT32 wLog; + int32_t wLog; if (USE_FAST_RECIP) { - const INT32 oow = fast_reciplog((ITERW), &wLog); - s = ((INT64)oow * (ITERS)) >> (29+10); - t = ((INT64)oow * (ITERT)) >> (29+10); + const int32_t oow = fast_reciplog((ITERW), &wLog); + s = ((int64_t)oow * (ITERS)) >> (29+10); + t = ((int64_t)oow * (ITERT)) >> (29+10); } else { multi_reciplog(ITERS, ITERT, ITERW, wLog, s, t); } @@ -2893,11 +2893,11 @@ static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, con ilod++; /* fetch the texture base */ - UINT32 texbase = (TT)->lodoffset[ilod]; + uint32_t texbase = (TT)->lodoffset[ilod]; /* compute the maximum s and t values at this LOD */ - INT32 smax = (TT)->wmask >> ilod; - INT32 tmax = (TT)->hmask >> ilod; + int32_t smax = (TT)->wmask >> ilod; + int32_t tmax = (TT)->hmask >> ilod; /* determine whether we are point-sampled or bilinear */ if ((lod == (TT)->lodmin && !TEXMODE_MAGNIFICATION_FILTER(TEXMODE)) || @@ -2905,7 +2905,7 @@ static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, con { /* point sampled */ - UINT32 texel0; + uint32_t texel0; /* adjust S/T for the LOD and strip off the fractions */ s >>= ilod + (18-10); @@ -2923,12 +2923,12 @@ static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, con /* fetch texel data */ if (TEXMODE_FORMAT(TEXMODE) < 8) { - texel0 = *(UINT8 *)&(TT)->ram[(texbase + t + s) & (TT)->mask]; + texel0 = *(uint8_t *)&(TT)->ram[(texbase + t + s) & (TT)->mask]; result.set((LOOKUP)[texel0]); } else { - texel0 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s)) & (TT)->mask]; + texel0 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t + s)) & (TT)->mask]; if (TEXMODE_FORMAT(TEXMODE) >= 10 && TEXMODE_FORMAT(TEXMODE) <= 12) result.set((LOOKUP)[texel0]); else @@ -2939,9 +2939,9 @@ static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, con { /* bilinear filtered */ - UINT32 texel0, texel1, texel2, texel3; - UINT32 sfrac, tfrac; - INT32 s1, t1; + uint32_t texel0, texel1, texel2, texel3; + uint32_t sfrac, tfrac; + int32_t s1, t1; /* adjust S/T for the LOD and strip off all but the low 8 bits of */ /* the fraction */ @@ -3000,10 +3000,10 @@ static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, con /* fetch texel data */ if (TEXMODE_FORMAT(TEXMODE) < 8) { - texel0 = *(UINT8 *)&(TT)->ram[(texbase + t + s)]; - texel1 = *(UINT8 *)&(TT)->ram[(texbase + t + s1)]; - texel2 = *(UINT8 *)&(TT)->ram[(texbase + t1 + s)]; - texel3 = *(UINT8 *)&(TT)->ram[(texbase + t1 + s1)]; + texel0 = *(uint8_t *)&(TT)->ram[(texbase + t + s)]; + texel1 = *(uint8_t *)&(TT)->ram[(texbase + t + s1)]; + texel2 = *(uint8_t *)&(TT)->ram[(texbase + t1 + s)]; + texel3 = *(uint8_t *)&(TT)->ram[(texbase + t1 + s1)]; texel0 = (LOOKUP)[texel0]; texel1 = (LOOKUP)[texel1]; texel2 = (LOOKUP)[texel2]; @@ -3011,10 +3011,10 @@ static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, con } else { - texel0 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s))]; - texel1 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s1))]; - texel2 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t1 + s))]; - texel3 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t1 + s1))]; + texel0 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t + s))]; + texel1 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t + s1))]; + texel2 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t1 + s))]; + texel3 = *(uint16_t *)&(TT)->ram[(texbase + 2*(t1 + s1))]; if (TEXMODE_FORMAT(TEXMODE) >= 10 && TEXMODE_FORMAT(TEXMODE) <= 12) { texel0 = (LOOKUP)[texel0]; @@ -3038,12 +3038,12 @@ static inline rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, con return result; } -static inline rgbaint_t ATTR_FORCE_INLINE combineTexture(tmu_state *TT, const UINT32 TEXMODE, rgbaint_t c_local, rgbaint_t c_other, INT32 lod) +static inline rgbaint_t ATTR_FORCE_INLINE combineTexture(tmu_state *TT, const uint32_t TEXMODE, rgbaint_t c_local, rgbaint_t c_other, int32_t lod) { - INT32 a_other = c_other.get_a(); - INT32 a_local = c_local.get_a(); + int32_t a_other = c_other.get_a(); + int32_t a_local = c_local.get_a(); rgbaint_t add_val = c_local; - UINT8 tmp; + uint8_t tmp; /* select zero/other for RGB */ if (TEXMODE_TC_ZERO_OTHER(TEXMODE)) diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index 0242e3cf4bf..4982a227dfd 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -186,11 +186,11 @@ bits(7:4) and bit(24)), X, and Y: static const rectangle global_cliprect(-4096, 4095, -4096, 4095); /* fast dither lookup */ -static UINT8 dither4_lookup[256*16*2]; -static UINT8 dither2_lookup[256*16*2]; +static uint8_t dither4_lookup[256*16*2]; +static uint8_t dither2_lookup[256*16*2]; /* fast reciprocal+log2 lookup */ -UINT32 voodoo_reciplog[(2 << RECIPLOG_LOOKUP_BITS) + 2]; +uint32_t voodoo_reciplog[(2 << RECIPLOG_LOOKUP_BITS) + 2]; @@ -260,7 +260,7 @@ int voodoo_device::voodoo_update(bitmap_rgb32 &bitmap, const rectangle &cliprect /* if the CLUT is dirty, recompute the pens array */ if (fbi.clut_dirty) { - UINT8 rtable[32], gtable[64], btable[32]; + uint8_t rtable[32], gtable[64], btable[32]; /* Voodoo/Voodoo-2 have an internal 33-entry CLUT */ if (vd_type <= TYPE_VOODOO_2) @@ -337,8 +337,8 @@ int voodoo_device::voodoo_update(bitmap_rgb32 &bitmap, const rectangle &cliprect for (y = cliprect.min_y; y <= cliprect.max_y; y++) if (y >= fbi.yoffs) { - UINT16 *src = (UINT16 *)(fbi.ram + fbi.rgboffs[drawbuf]) + (y - fbi.yoffs) * fbi.rowpixels - fbi.xoffs; - UINT32 *dst = &bitmap.pix32(y); + uint16_t *src = (uint16_t *)(fbi.ram + fbi.rgboffs[drawbuf]) + (y - fbi.yoffs) * fbi.rowpixels - fbi.xoffs; + uint32_t *dst = &bitmap.pix32(y); for (x = cliprect.min_x; x <= cliprect.max_x; x++) dst[x] = fbi.pen[src[x]]; } @@ -359,8 +359,8 @@ int voodoo_device::voodoo_update(bitmap_rgb32 &bitmap, const rectangle &cliprect { for (y = cliprect.min_y; y <= cliprect.max_y; y++) { - UINT16 *src = (UINT16 *)(fbi.ram + fbi.auxoffs) + (y - fbi.yoffs) * fbi.rowpixels - fbi.xoffs; - UINT32 *dst = &bitmap.pix32(y); + uint16_t *src = (uint16_t *)(fbi.ram + fbi.auxoffs) + (y - fbi.yoffs) * fbi.rowpixels - fbi.xoffs; + uint32_t *dst = &bitmap.pix32(y); for (x = cliprect.min_x; x <= cliprect.max_x; x++) dst[x] = ((src[x] << 8) & 0xff0000) | ((src[x] >> 0) & 0xff00) | ((src[x] >> 8) & 0xff); } @@ -391,7 +391,7 @@ int voodoo_device::voodoo_is_stalled() } -void voodoo_device::voodoo_set_init_enable(UINT32 newval) +void voodoo_device::voodoo_set_init_enable(uint32_t newval) { voodoo_device *vd = this; vd->pci.init_enable = newval; @@ -412,7 +412,7 @@ void voodoo_device::init_fbi(voodoo_device* vd,fbi_state *f, void *memory, int f int pen; /* allocate frame buffer RAM and set pointers */ - f->ram = (UINT8 *)memory; + f->ram = (uint8_t *)memory; f->mask = fbmem - 1; f->rgboffs[0] = f->rgboffs[1] = f->rgboffs[2] = 0; f->auxoffs = ~0; @@ -498,7 +498,7 @@ void voodoo_device::init_tmu_shared(tmu_shared_state *s) void voodoo_device::init_tmu(voodoo_device* vd, tmu_state *t, voodoo_reg *reg, void *memory, int tmem) { /* allocate texture RAM */ - t->ram = (UINT8 *)memory; + t->ram = (uint8_t *)memory; t->mask = tmem - 1; t->reg = reg; t->regdirty = TRUE; @@ -1020,10 +1020,10 @@ void voodoo_device::soft_reset(voodoo_device *vd) void voodoo_device::recompute_video_memory(voodoo_device *vd) { - UINT32 buffer_pages = FBIINIT2_VIDEO_BUFFER_OFFSET(vd->reg[fbiInit2].u); - UINT32 fifo_start_page = FBIINIT4_MEMORY_FIFO_START_ROW(vd->reg[fbiInit4].u); - UINT32 fifo_last_page = FBIINIT4_MEMORY_FIFO_STOP_ROW(vd->reg[fbiInit4].u); - UINT32 memory_config; + uint32_t buffer_pages = FBIINIT2_VIDEO_BUFFER_OFFSET(vd->reg[fbiInit2].u); + uint32_t fifo_start_page = FBIINIT4_MEMORY_FIFO_START_ROW(vd->reg[fbiInit4].u); + uint32_t fifo_last_page = FBIINIT4_MEMORY_FIFO_STOP_ROW(vd->reg[fbiInit4].u); + uint32_t memory_config; int buf; /* memory config is determined differently between V1 and V2 */ @@ -1092,7 +1092,7 @@ void voodoo_device::recompute_video_memory(voodoo_device *vd) /* is it valid and enabled? */ if (fifo_start_page <= fifo_last_page && FBIINIT0_ENABLE_MEMORY_FIFO(vd->reg[fbiInit0].u)) { - vd->fbi.fifo.base = (UINT32 *)(vd->fbi.ram + fifo_start_page * 0x1000); + vd->fbi.fifo.base = (uint32_t *)(vd->fbi.ram + fifo_start_page * 0x1000); vd->fbi.fifo.size = (fifo_last_page + 1 - fifo_start_page) * 0x1000 / 4; if (vd->fbi.fifo.size > 65536*2) vd->fbi.fifo.size = 65536*2; @@ -1126,7 +1126,7 @@ void voodoo_device::recompute_video_memory(voodoo_device *vd) * *************************************/ -static void ncc_table_write(ncc_table *n, offs_t regnum, UINT32 data) +static void ncc_table_write(ncc_table *n, offs_t regnum, uint32_t data) { /* I/Q entries reference the plaette if the high bit is set */ if (regnum >= 4 && (data & 0x80000000) && n->palette) @@ -1169,18 +1169,18 @@ static void ncc_table_write(ncc_table *n, offs_t regnum, UINT32 data) else if (regnum < 8) { regnum &= 3; - n->ir[regnum] = (INT32)(data << 5) >> 23; - n->ig[regnum] = (INT32)(data << 14) >> 23; - n->ib[regnum] = (INT32)(data << 23) >> 23; + n->ir[regnum] = (int32_t)(data << 5) >> 23; + n->ig[regnum] = (int32_t)(data << 14) >> 23; + n->ib[regnum] = (int32_t)(data << 23) >> 23; } /* the final four entries are the Q RGB values */ else { regnum &= 3; - n->qr[regnum] = (INT32)(data << 5) >> 23; - n->qg[regnum] = (INT32)(data << 14) >> 23; - n->qb[regnum] = (INT32)(data << 23) >> 23; + n->qr[regnum] = (int32_t)(data << 5) >> 23; + n->qg[regnum] = (int32_t)(data << 14) >> 23; + n->qb[regnum] = (int32_t)(data << 23) >> 23; } /* mark the table dirty */ @@ -1227,15 +1227,15 @@ static void ncc_table_update(ncc_table *n) * *************************************/ -static void dacdata_w(dac_state *d, UINT8 regnum, UINT8 data) +static void dacdata_w(dac_state *d, uint8_t regnum, uint8_t data) { d->reg[regnum] = data; } -static void dacdata_r(dac_state *d, UINT8 regnum) +static void dacdata_r(dac_state *d, uint8_t regnum) { - UINT8 result = 0xff; + uint8_t result = 0xff; /* switch off the DAC register requested */ switch (regnum) @@ -1270,13 +1270,13 @@ static void dacdata_r(dac_state *d, UINT8 regnum) static void recompute_texture_params(tmu_state *t) { int bppscale; - UINT32 base; + uint32_t base; int lod; /* extract LOD parameters */ t->lodmin = TEXLOD_LODMIN(t->reg[tLOD].u) << 6; t->lodmax = TEXLOD_LODMAX(t->reg[tLOD].u) << 6; - t->lodbias = (INT8)(TEXLOD_LODBIAS(t->reg[tLOD].u) << 2) << 4; + t->lodbias = (int8_t)(TEXLOD_LODBIAS(t->reg[tLOD].u) << 2) << 4; /* determine which LODs are present */ t->lodmask = 0x1ff; @@ -1335,7 +1335,7 @@ static void recompute_texture_params(tmu_state *t) { if (t->lodmask & (1 << (lod - 1))) { - UINT32 size = ((t->wmask >> (lod - 1)) + 1) * ((t->hmask >> (lod - 1)) + 1); + uint32_t size = ((t->wmask >> (lod - 1)) + 1) * ((t->hmask >> (lod - 1)) + 1); if (size < 4) size = 4; base += size << bppscale; } @@ -1350,7 +1350,7 @@ static void recompute_texture_params(tmu_state *t) /* compute the detail parameters */ t->detailmax = TEXDETAIL_DETAIL_MAX(t->reg[tDetail].u); - t->detailbias = (INT8)(TEXDETAIL_DETAIL_BIAS(t->reg[tDetail].u) << 2) << 6; + t->detailbias = (int8_t)(TEXDETAIL_DETAIL_BIAS(t->reg[tDetail].u) << 2) << 6; t->detailscale = TEXDETAIL_DETAIL_SCALE(t->reg[tDetail].u); /* ensure that the NCC tables are up to date */ @@ -1371,10 +1371,10 @@ static void recompute_texture_params(tmu_state *t) } -static inline INT32 prepare_tmu(tmu_state *t) +static inline int32_t prepare_tmu(tmu_state *t) { - INT64 texdx, texdy; - INT32 lodbase; + int64_t texdx, texdy; + int32_t lodbase; /* if the texture parameters are dirty, update them */ if (t->regdirty) @@ -1383,8 +1383,8 @@ static inline INT32 prepare_tmu(tmu_state *t) } /* compute (ds^2 + dt^2) in both X and Y as 28.36 numbers */ - texdx = (INT64)(t->dsdx >> 14) * (INT64)(t->dsdx >> 14) + (INT64)(t->dtdx >> 14) * (INT64)(t->dtdx >> 14); - texdy = (INT64)(t->dsdy >> 14) * (INT64)(t->dsdy >> 14) + (INT64)(t->dtdy >> 14) * (INT64)(t->dtdy >> 14); + texdx = (int64_t)(t->dsdx >> 14) * (int64_t)(t->dsdx >> 14) + (int64_t)(t->dtdx >> 14) * (int64_t)(t->dtdx >> 14); + texdy = (int64_t)(t->dsdy >> 14) * (int64_t)(t->dsdy >> 14) + (int64_t)(t->dtdy >> 14) * (int64_t)(t->dtdy >> 14); /* pick whichever is larger and shift off some high bits -> 28.20 */ if (texdx < texdy) @@ -1416,9 +1416,9 @@ static inline INT32 prepare_tmu(tmu_state *t) static int cmdfifo_compute_expected_depth(voodoo_device *vd, cmdfifo_info *f) { - UINT32 *fifobase = (UINT32 *)vd->fbi.ram; - UINT32 readptr = f->rdptr; - UINT32 command = fifobase[readptr / 4]; + uint32_t *fifobase = (uint32_t *)vd->fbi.ram; + uint32_t readptr = f->rdptr; + uint32_t command = fifobase[readptr / 4]; int i, count = 0; /* low 3 bits specify the packet type */ @@ -1554,12 +1554,12 @@ static int cmdfifo_compute_expected_depth(voodoo_device *vd, cmdfifo_info *f) * *************************************/ -UINT32 voodoo_device::cmdfifo_execute(voodoo_device *vd, cmdfifo_info *f) +uint32_t voodoo_device::cmdfifo_execute(voodoo_device *vd, cmdfifo_info *f) { - UINT32 *fifobase = (UINT32 *)vd->fbi.ram; - UINT32 readptr = f->rdptr; - UINT32 *src = &fifobase[readptr / 4]; - UINT32 command = *src++; + uint32_t *fifobase = (uint32_t *)vd->fbi.ram; + uint32_t readptr = f->rdptr; + uint32_t *src = &fifobase[readptr / 4]; + uint32_t command = *src++; int count, inc, code, i; setup_vertex svert = {0}; offs_t target; @@ -1868,15 +1868,15 @@ UINT32 voodoo_device::cmdfifo_execute(voodoo_device *vd, cmdfifo_info *f) { if (LOG_CMDFIFO) vd->device->logerror(" PACKET TYPE 5: FB count=%d dest=%08X bd2=%X bdN=%X\n", count, target, (command >> 26) & 15, (command >> 22) & 15); - UINT32 addr = target * 4; + uint32_t addr = target * 4; for (i=0; i < count; i++) { - UINT32 data = *src++; + uint32_t data = *src++; - vd->fbi.ram[BYTE_XOR_LE(addr + 0)] = (UINT8)(data); - vd->fbi.ram[BYTE_XOR_LE(addr + 1)] = (UINT8)(data >> 8); - vd->fbi.ram[BYTE_XOR_LE(addr + 2)] = (UINT8)(data >> 16); - vd->fbi.ram[BYTE_XOR_LE(addr + 3)] = (UINT8)(data >> 24); + vd->fbi.ram[BYTE_XOR_LE(addr + 0)] = (uint8_t)(data); + vd->fbi.ram[BYTE_XOR_LE(addr + 1)] = (uint8_t)(data >> 8); + vd->fbi.ram[BYTE_XOR_LE(addr + 2)] = (uint8_t)(data >> 16); + vd->fbi.ram[BYTE_XOR_LE(addr + 3)] = (uint8_t)(data >> 24); addr += 4; } @@ -1939,7 +1939,7 @@ UINT32 voodoo_device::cmdfifo_execute(voodoo_device *vd, cmdfifo_info *f) * *************************************/ -INT32 voodoo_device::cmdfifo_execute_if_ready(voodoo_device* vd, cmdfifo_info *f) +int32_t voodoo_device::cmdfifo_execute_if_ready(voodoo_device* vd, cmdfifo_info *f) { int needed_depth; int cycles; @@ -1967,10 +1967,10 @@ INT32 voodoo_device::cmdfifo_execute_if_ready(voodoo_device* vd, cmdfifo_info *f * *************************************/ -void voodoo_device::cmdfifo_w(voodoo_device *vd, cmdfifo_info *f, offs_t offset, UINT32 data) +void voodoo_device::cmdfifo_w(voodoo_device *vd, cmdfifo_info *f, offs_t offset, uint32_t data) { - UINT32 addr = f->base + offset * 4; - UINT32 *fifobase = (UINT32 *)vd->fbi.ram; + uint32_t addr = f->base + offset * 4; + uint32_t *fifobase = (uint32_t *)vd->fbi.ram; if (LOG_CMDFIFO_VERBOSE) vd->device->logerror("CMDFIFO_w(%04X) = %08X\n", offset, data); @@ -2024,15 +2024,15 @@ void voodoo_device::cmdfifo_w(voodoo_device *vd, cmdfifo_info *f, offs_t offset, /* execute if we can */ if (!vd->pci.op_pending) { - INT32 cycles = cmdfifo_execute_if_ready(vd, f); + int32_t cycles = cmdfifo_execute_if_ready(vd, f); if (cycles > 0) { vd->pci.op_pending = TRUE; vd->pci.op_end_time = vd->device->machine().time() + attotime(0, (attoseconds_t)cycles * vd->attoseconds_per_cycle); if (LOG_FIFO_VERBOSE) vd->device->logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", vd->index, - vd->device->machine().time().seconds(), (UINT32)(vd->device->machine().time().attoseconds() >> 32), (UINT32)vd->device->machine().time().attoseconds(), - vd->pci.op_end_time.seconds(), (UINT32)(vd->pci.op_end_time.attoseconds() >> 32), (UINT32)vd->pci.op_end_time.attoseconds()); + vd->device->machine().time().seconds(), (uint32_t)(vd->device->machine().time().attoseconds() >> 32), (uint32_t)vd->device->machine().time().attoseconds(), + vd->pci.op_end_time.seconds(), (uint32_t)(vd->pci.op_end_time.attoseconds() >> 32), (uint32_t)vd->pci.op_end_time.attoseconds()); } } } @@ -2133,13 +2133,13 @@ void voodoo_device::stall_cpu(voodoo_device *vd, int state, attotime current_tim * *************************************/ -INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) +int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t data) { - UINT32 origdata = data; - INT32 cycles = 0; - INT64 data64; - UINT8 regnum; - UINT8 chips; + uint32_t origdata = data; + int32_t cycles = 0; + int64_t data64; + uint8_t regnum; + uint8_t chips; /* statistics */ vd->stats.reg_writes++; @@ -2170,129 +2170,129 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) case fvertexAx: data = float_to_int32(data, 4); case vertexAx: - if (chips & 1) vd->fbi.ax = (INT16)data; + if (chips & 1) vd->fbi.ax = (int16_t)data; break; case fvertexAy: data = float_to_int32(data, 4); case vertexAy: - if (chips & 1) vd->fbi.ay = (INT16)data; + if (chips & 1) vd->fbi.ay = (int16_t)data; break; case fvertexBx: data = float_to_int32(data, 4); case vertexBx: - if (chips & 1) vd->fbi.bx = (INT16)data; + if (chips & 1) vd->fbi.bx = (int16_t)data; break; case fvertexBy: data = float_to_int32(data, 4); case vertexBy: - if (chips & 1) vd->fbi.by = (INT16)data; + if (chips & 1) vd->fbi.by = (int16_t)data; break; case fvertexCx: data = float_to_int32(data, 4); case vertexCx: - if (chips & 1) vd->fbi.cx = (INT16)data; + if (chips & 1) vd->fbi.cx = (int16_t)data; break; case fvertexCy: data = float_to_int32(data, 4); case vertexCy: - if (chips & 1) vd->fbi.cy = (INT16)data; + if (chips & 1) vd->fbi.cy = (int16_t)data; break; /* RGB data is 12.12 formatted fixed point */ case fstartR: data = float_to_int32(data, 12); case startR: - if (chips & 1) vd->fbi.startr = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.startr = (int32_t)(data << 8) >> 8; break; case fstartG: data = float_to_int32(data, 12); case startG: - if (chips & 1) vd->fbi.startg = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.startg = (int32_t)(data << 8) >> 8; break; case fstartB: data = float_to_int32(data, 12); case startB: - if (chips & 1) vd->fbi.startb = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.startb = (int32_t)(data << 8) >> 8; break; case fstartA: data = float_to_int32(data, 12); case startA: - if (chips & 1) vd->fbi.starta = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.starta = (int32_t)(data << 8) >> 8; break; case fdRdX: data = float_to_int32(data, 12); case dRdX: - if (chips & 1) vd->fbi.drdx = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.drdx = (int32_t)(data << 8) >> 8; break; case fdGdX: data = float_to_int32(data, 12); case dGdX: - if (chips & 1) vd->fbi.dgdx = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.dgdx = (int32_t)(data << 8) >> 8; break; case fdBdX: data = float_to_int32(data, 12); case dBdX: - if (chips & 1) vd->fbi.dbdx = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.dbdx = (int32_t)(data << 8) >> 8; break; case fdAdX: data = float_to_int32(data, 12); case dAdX: - if (chips & 1) vd->fbi.dadx = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.dadx = (int32_t)(data << 8) >> 8; break; case fdRdY: data = float_to_int32(data, 12); case dRdY: - if (chips & 1) vd->fbi.drdy = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.drdy = (int32_t)(data << 8) >> 8; break; case fdGdY: data = float_to_int32(data, 12); case dGdY: - if (chips & 1) vd->fbi.dgdy = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.dgdy = (int32_t)(data << 8) >> 8; break; case fdBdY: data = float_to_int32(data, 12); case dBdY: - if (chips & 1) vd->fbi.dbdy = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.dbdy = (int32_t)(data << 8) >> 8; break; case fdAdY: data = float_to_int32(data, 12); case dAdY: - if (chips & 1) vd->fbi.dady = (INT32)(data << 8) >> 8; + if (chips & 1) vd->fbi.dady = (int32_t)(data << 8) >> 8; break; /* Z data is 20.12 formatted fixed point */ case fstartZ: data = float_to_int32(data, 12); case startZ: - if (chips & 1) vd->fbi.startz = (INT32)data; + if (chips & 1) vd->fbi.startz = (int32_t)data; break; case fdZdX: data = float_to_int32(data, 12); case dZdX: - if (chips & 1) vd->fbi.dzdx = (INT32)data; + if (chips & 1) vd->fbi.dzdx = (int32_t)data; break; case fdZdY: data = float_to_int32(data, 12); case dZdY: - if (chips & 1) vd->fbi.dzdy = (INT32)data; + if (chips & 1) vd->fbi.dzdy = (int32_t)data; break; /* S,T data is 14.18 formatted fixed point, converted to 16.32 internally */ @@ -2302,8 +2302,8 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) if (chips & 4) vd->tmu[1].starts = data64; break; case startS: - if (chips & 2) vd->tmu[0].starts = (INT64)(INT32)data << 14; - if (chips & 4) vd->tmu[1].starts = (INT64)(INT32)data << 14; + if (chips & 2) vd->tmu[0].starts = (int64_t)(int32_t)data << 14; + if (chips & 4) vd->tmu[1].starts = (int64_t)(int32_t)data << 14; break; case fstartT: @@ -2312,8 +2312,8 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) if (chips & 4) vd->tmu[1].startt = data64; break; case startT: - if (chips & 2) vd->tmu[0].startt = (INT64)(INT32)data << 14; - if (chips & 4) vd->tmu[1].startt = (INT64)(INT32)data << 14; + if (chips & 2) vd->tmu[0].startt = (int64_t)(int32_t)data << 14; + if (chips & 4) vd->tmu[1].startt = (int64_t)(int32_t)data << 14; break; case fdSdX: @@ -2322,8 +2322,8 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) if (chips & 4) vd->tmu[1].dsdx = data64; break; case dSdX: - if (chips & 2) vd->tmu[0].dsdx = (INT64)(INT32)data << 14; - if (chips & 4) vd->tmu[1].dsdx = (INT64)(INT32)data << 14; + if (chips & 2) vd->tmu[0].dsdx = (int64_t)(int32_t)data << 14; + if (chips & 4) vd->tmu[1].dsdx = (int64_t)(int32_t)data << 14; break; case fdTdX: @@ -2332,8 +2332,8 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) if (chips & 4) vd->tmu[1].dtdx = data64; break; case dTdX: - if (chips & 2) vd->tmu[0].dtdx = (INT64)(INT32)data << 14; - if (chips & 4) vd->tmu[1].dtdx = (INT64)(INT32)data << 14; + if (chips & 2) vd->tmu[0].dtdx = (int64_t)(int32_t)data << 14; + if (chips & 4) vd->tmu[1].dtdx = (int64_t)(int32_t)data << 14; break; case fdSdY: @@ -2342,8 +2342,8 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) if (chips & 4) vd->tmu[1].dsdy = data64; break; case dSdY: - if (chips & 2) vd->tmu[0].dsdy = (INT64)(INT32)data << 14; - if (chips & 4) vd->tmu[1].dsdy = (INT64)(INT32)data << 14; + if (chips & 2) vd->tmu[0].dsdy = (int64_t)(int32_t)data << 14; + if (chips & 4) vd->tmu[1].dsdy = (int64_t)(int32_t)data << 14; break; case fdTdY: @@ -2352,8 +2352,8 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) if (chips & 4) vd->tmu[1].dtdy = data64; break; case dTdY: - if (chips & 2) vd->tmu[0].dtdy = (INT64)(INT32)data << 14; - if (chips & 4) vd->tmu[1].dtdy = (INT64)(INT32)data << 14; + if (chips & 2) vd->tmu[0].dtdy = (int64_t)(int32_t)data << 14; + if (chips & 4) vd->tmu[1].dtdy = (int64_t)(int32_t)data << 14; break; /* W data is 2.30 formatted fixed point, converted to 16.32 internally */ @@ -2364,9 +2364,9 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) if (chips & 4) vd->tmu[1].startw = data64; break; case startW: - if (chips & 1) vd->fbi.startw = (INT64)(INT32)data << 2; - if (chips & 2) vd->tmu[0].startw = (INT64)(INT32)data << 2; - if (chips & 4) vd->tmu[1].startw = (INT64)(INT32)data << 2; + if (chips & 1) vd->fbi.startw = (int64_t)(int32_t)data << 2; + if (chips & 2) vd->tmu[0].startw = (int64_t)(int32_t)data << 2; + if (chips & 4) vd->tmu[1].startw = (int64_t)(int32_t)data << 2; break; case fdWdX: @@ -2376,9 +2376,9 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) if (chips & 4) vd->tmu[1].dwdx = data64; break; case dWdX: - if (chips & 1) vd->fbi.dwdx = (INT64)(INT32)data << 2; - if (chips & 2) vd->tmu[0].dwdx = (INT64)(INT32)data << 2; - if (chips & 4) vd->tmu[1].dwdx = (INT64)(INT32)data << 2; + if (chips & 1) vd->fbi.dwdx = (int64_t)(int32_t)data << 2; + if (chips & 2) vd->tmu[0].dwdx = (int64_t)(int32_t)data << 2; + if (chips & 4) vd->tmu[1].dwdx = (int64_t)(int32_t)data << 2; break; case fdWdY: @@ -2388,9 +2388,9 @@ INT32 voodoo_device::register_w(voodoo_device *vd, offs_t offset, UINT32 data) if (chips & 4) vd->tmu[1].dwdy = data64; break; case dWdY: - if (chips & 1) vd->fbi.dwdy = (INT64)(INT32)data << 2; - if (chips & 2) vd->tmu[0].dwdy = (INT64)(INT32)data << 2; - if (chips & 4) vd->tmu[1].dwdy = (INT64)(INT32)data << 2; + if (chips & 1) vd->fbi.dwdy = (int64_t)(int32_t)data << 2; + if (chips & 2) vd->tmu[0].dwdy = (int64_t)(int32_t)data << 2; + if (chips & 4) vd->tmu[1].dwdy = (int64_t)(int32_t)data << 2; break; /* setup bits */ @@ -2876,12 +2876,12 @@ default_case: * Voodoo LFB writes * *************************************/ -INT32 voodoo_device::lfb_direct_w(voodoo_device *vd, offs_t offset, UINT32 data, UINT32 mem_mask) +int32_t voodoo_device::lfb_direct_w(voodoo_device *vd, offs_t offset, uint32_t data, uint32_t mem_mask) { - UINT16 *dest; - UINT32 destmax; + uint16_t *dest; + uint32_t destmax; int x, y; - UINT32 bufoffs; + uint32_t bufoffs; /* statistics */ vd->stats.lfb_writes++; @@ -2906,11 +2906,11 @@ INT32 voodoo_device::lfb_direct_w(voodoo_device *vd, offs_t offset, UINT32 data, offset <<= 1; x = offset & ((1 << vd->fbi.lfb_stride) - 1); y = (offset >> vd->fbi.lfb_stride); - dest = (UINT16 *)(vd->fbi.ram + vd->fbi.lfb_base*4); + dest = (uint16_t *)(vd->fbi.ram + vd->fbi.lfb_base*4); destmax = (vd->fbi.mask + 1 - vd->fbi.lfb_base*4) / 2; bufoffs = y * vd->fbi.rowpixels + x; if (bufoffs >= destmax) { - vd->device->logerror("lfb_direct_w: Buffer offset out of bounds x=%i y=%i offset=%08X bufoffs=%08X data=%08X\n", x, y, offset, (UINT32) bufoffs, data); + vd->device->logerror("lfb_direct_w: Buffer offset out of bounds x=%i y=%i offset=%08X bufoffs=%08X data=%08X\n", x, y, offset, (uint32_t) bufoffs, data); return 0; } if (ACCESSING_BITS_0_15) @@ -2921,10 +2921,10 @@ INT32 voodoo_device::lfb_direct_w(voodoo_device *vd, offs_t offset, UINT32 data, return 0; } -INT32 voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, UINT32 data, UINT32 mem_mask) +int32_t voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, uint32_t data, uint32_t mem_mask) { - UINT16 *dest, *depth; - UINT32 destmax, depthmax; + uint16_t *dest, *depth; + uint32_t destmax, depthmax; int sr[2], sg[2], sb[2], sa[2], sz[2]; int x, y, scry, mask; int pix, destbuf; @@ -3137,27 +3137,27 @@ INT32 voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, UINT32 data, UINT32 switch (destbuf) { case 0: /* front buffer */ - dest = (UINT16 *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.frontbuf]); + dest = (uint16_t *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.frontbuf]); destmax = (vd->fbi.mask + 1 - vd->fbi.rgboffs[vd->fbi.frontbuf]) / 2; vd->fbi.video_changed = TRUE; break; case 1: /* back buffer */ - dest = (UINT16 *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.backbuf]); + dest = (uint16_t *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.backbuf]); destmax = (vd->fbi.mask + 1 - vd->fbi.rgboffs[vd->fbi.backbuf]) / 2; break; default: /* reserved */ return 0; } - depth = (UINT16 *)(vd->fbi.ram + vd->fbi.auxoffs); + depth = (uint16_t *)(vd->fbi.ram + vd->fbi.auxoffs); depthmax = (vd->fbi.mask + 1 - vd->fbi.auxoffs) / 2; /* simple case: no pipeline */ if (!LFBMODE_ENABLE_PIXEL_PIPELINE(vd->reg[lfbMode].u)) { DECLARE_DITHER_POINTERS_NO_DITHER_VAR; - UINT32 bufoffs; + uint32_t bufoffs; if (LOG_LFB) vd->device->logerror("VOODOO.%d.LFB:write raw mode %X (%d,%d) = %08X & %08X\n", vd->index, LFBMODE_WRITE_FORMAT(vd->reg[lfbMode].u), x, y, data, mem_mask); @@ -3239,14 +3239,14 @@ INT32 voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, UINT32 data, UINT32 if (mask & 0x0f) { stats_block *stats = &vd->fbi.lfb_stats; - INT64 iterw; + int64_t iterw; if (LFBMODE_WRITE_W_SELECT(vd->reg[lfbMode].u)) { - iterw = (UINT32) vd->reg[zaColor].u << 16; + iterw = (uint32_t) vd->reg[zaColor].u << 16; } else { // The most significant fractional bits of 16.32 W are set to z - iterw = (UINT32) sz[pix] << 16; + iterw = (uint32_t) sz[pix] << 16; } - INT32 iterz = sz[pix] << 12; + int32_t iterz = sz[pix] << 12; /* apply clipping */ if (FBZMODE_ENABLE_CLIPPING(vd->reg[fbzMode].u)) @@ -3270,8 +3270,8 @@ INT32 voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, UINT32 data, UINT32 //PIXEL_PIPELINE_BEGIN(v, stats, x, y, vd->reg[fbzColorPath].u, vd->reg[fbzMode].u, iterz, iterw); // Start PIXEL_PIPE_BEGIN copy //#define PIXEL_PIPELINE_BEGIN(VV, STATS, XX, YY, FBZCOLORPATH, FBZMODE, ITERZ, ITERW) - INT32 fogdepth, biasdepth; - INT32 r, g, b, a; + int32_t fogdepth, biasdepth; + int32_t r, g, b, a; (stats)->pixels_in++; @@ -3306,11 +3306,11 @@ INT32 voodoo_device::lfb_w(voodoo_device* vd, offs_t offset, UINT32 data, UINT32 // End PIXEL_PIPELINE_BEGIN COPY // Depth testing value for lfb pipeline writes is directly from write data, no biasing is used - fogdepth = biasdepth = (UINT32) sz[pix]; + fogdepth = biasdepth = (uint32_t) sz[pix]; /* Perform depth testing */ - if (!depthTest((UINT16) vd->reg[zaColor].u, stats, depth[x], vd->reg[fbzMode].u, biasdepth)) + if (!depthTest((uint16_t) vd->reg[zaColor].u, stats, depth[x], vd->reg[fbzMode].u, biasdepth)) goto nextpixel; /* use the RGBA we stashed above */ @@ -3352,7 +3352,7 @@ nextpixel: * *************************************/ -INT32 voodoo_device::texture_w(voodoo_device *vd, offs_t offset, UINT32 data) +int32_t voodoo_device::texture_w(voodoo_device *vd, offs_t offset, uint32_t data) { int tmunum = (offset >> 19) & 0x03; tmu_state *t; @@ -3385,8 +3385,8 @@ INT32 voodoo_device::texture_w(voodoo_device *vd, offs_t offset, UINT32 data) if (TEXMODE_FORMAT(t->reg[textureMode].u) < 8) { int lod, tt, ts; - UINT32 tbaseaddr; - UINT8 *dest; + uint32_t tbaseaddr; + uint8_t *dest; /* extract info */ if (vd->vd_type <= TYPE_VOODOO_2) @@ -3430,8 +3430,8 @@ INT32 voodoo_device::texture_w(voodoo_device *vd, offs_t offset, UINT32 data) else { int lod, tt, ts; - UINT32 tbaseaddr; - UINT16 *dest; + uint32_t tbaseaddr; + uint16_t *dest; /* extract info */ if (vd->vd_type <= TYPE_VOODOO_2) @@ -3458,7 +3458,7 @@ INT32 voodoo_device::texture_w(voodoo_device *vd, offs_t offset, UINT32 data) } /* write the two words in little-endian order */ - dest = (UINT16 *)t->ram; + dest = (uint16_t *)t->ram; tbaseaddr &= t->mask; tbaseaddr >>= 1; dest[BYTE_XOR_LE(tbaseaddr + 0)] = (data >> 0) & 0xffff; @@ -3478,7 +3478,7 @@ INT32 voodoo_device::texture_w(voodoo_device *vd, offs_t offset, UINT32 data) void voodoo_device::flush_fifos(voodoo_device *vd, attotime current_time) { - static UINT8 in_flush; + static uint8_t in_flush; /* check for recursive calls */ if (in_flush) @@ -3488,21 +3488,21 @@ void voodoo_device::flush_fifos(voodoo_device *vd, attotime current_time) if (!vd->pci.op_pending) fatalerror("flush_fifos called with no pending operation\n"); if (LOG_FIFO_VERBOSE) vd->device->logerror("VOODOO.%d.FIFO:flush_fifos start -- pending=%d.%08X%08X cur=%d.%08X%08X\n", vd->index, - vd->pci.op_end_time.seconds(), (UINT32)(vd->pci.op_end_time.attoseconds() >> 32), (UINT32)vd->pci.op_end_time.attoseconds(), - current_time.seconds(), (UINT32)(current_time.attoseconds() >> 32), (UINT32)current_time.attoseconds()); + vd->pci.op_end_time.seconds(), (uint32_t)(vd->pci.op_end_time.attoseconds() >> 32), (uint32_t)vd->pci.op_end_time.attoseconds(), + current_time.seconds(), (uint32_t)(current_time.attoseconds() >> 32), (uint32_t)current_time.attoseconds()); /* loop while we still have cycles to burn */ while (vd->pci.op_end_time <= current_time) { - INT32 extra_cycles = 0; - INT32 cycles; + int32_t extra_cycles = 0; + int32_t cycles; /* loop over 0-cycle stuff; this constitutes the bulk of our writes */ do { fifo_state *fifo; - UINT32 address; - UINT32 data; + uint32_t address; + uint32_t data; /* we might be in CMDFIFO mode */ if (vd->fbi.cmdfifo[0].enable) @@ -3557,7 +3557,7 @@ void voodoo_device::flush_fifos(voodoo_device *vd, attotime current_time) cycles = texture_w(vd, address, data); else { - UINT32 mem_mask = 0xffffffff; + uint32_t mem_mask = 0xffffffff; /* compute mem_mask */ if (address & 0x80000000) @@ -3586,12 +3586,12 @@ void voodoo_device::flush_fifos(voodoo_device *vd, attotime current_time) vd->pci.op_end_time += attotime(0, (attoseconds_t)cycles * vd->attoseconds_per_cycle); if (LOG_FIFO_VERBOSE) vd->device->logerror("VOODOO.%d.FIFO:update -- pending=%d.%08X%08X cur=%d.%08X%08X\n", vd->index, - vd->pci.op_end_time.seconds(), (UINT32)(vd->pci.op_end_time.attoseconds() >> 32), (UINT32)vd->pci.op_end_time.attoseconds(), - current_time.seconds(), (UINT32)(current_time.attoseconds() >> 32), (UINT32)current_time.attoseconds()); + vd->pci.op_end_time.seconds(), (uint32_t)(vd->pci.op_end_time.attoseconds() >> 32), (uint32_t)vd->pci.op_end_time.attoseconds(), + current_time.seconds(), (uint32_t)(current_time.attoseconds() >> 32), (uint32_t)current_time.attoseconds()); } if (LOG_FIFO_VERBOSE) vd->device->logerror("VOODOO.%d.FIFO:flush_fifos end -- pending command complete at %d.%08X%08X\n", vd->index, - vd->pci.op_end_time.seconds(), (UINT32)(vd->pci.op_end_time.attoseconds() >> 32), (UINT32)vd->pci.op_end_time.attoseconds()); + vd->pci.op_end_time.seconds(), (uint32_t)(vd->pci.op_end_time.attoseconds() >> 32), (uint32_t)vd->pci.op_end_time.attoseconds()); in_flush = FALSE; } @@ -3622,7 +3622,7 @@ WRITE32_MEMBER( voodoo_device::voodoo_w ) /* special handling for registers */ if ((offset & 0xc00000/4) == 0) { - UINT8 access; + uint8_t access; /* some special stuff for Voodoo 2 */ if (vd_type >= TYPE_VOODOO_2) @@ -3703,8 +3703,8 @@ WRITE32_MEMBER( voodoo_device::voodoo_w ) pci.op_end_time = machine().time() + attotime(0, (attoseconds_t)cycles * attoseconds_per_cycle); if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", index, - machine().time().seconds(), (UINT32)(machine().time().attoseconds() >> 32), (UINT32)machine().time().attoseconds(), - pci.op_end_time.seconds(), (UINT32)(pci.op_end_time.attoseconds() >> 32), (UINT32)pci.op_end_time.attoseconds()); + machine().time().seconds(), (uint32_t)(machine().time().attoseconds() >> 32), (uint32_t)machine().time().attoseconds(), + pci.op_end_time.seconds(), (uint32_t)(pci.op_end_time.attoseconds() >> 32), (uint32_t)pci.op_end_time.attoseconds()); } g_profiler.stop(); return; @@ -3733,7 +3733,7 @@ WRITE32_MEMBER( voodoo_device::voodoo_w ) if (FBIINIT0_ENABLE_MEMORY_FIFO(reg[fbiInit0].u) && fifo_space(&pci.fifo) <= 2 * FBIINIT4_MEMORY_FIFO_LWM(reg[fbiInit4].u)) { - UINT8 valid[4]; + uint8_t valid[4]; /* determine which types of data can go to the memory FIFO */ valid[0] = TRUE; @@ -3783,10 +3783,10 @@ WRITE32_MEMBER( voodoo_device::voodoo_w ) * *************************************/ -static UINT32 register_r(voodoo_device *vd, offs_t offset) +static uint32_t register_r(voodoo_device *vd, offs_t offset) { int regnum = offset & 0xff; - UINT32 result; + uint32_t result; /* statistics */ vd->stats.reg_reads++; @@ -3964,12 +3964,12 @@ static UINT32 register_r(voodoo_device *vd, offs_t offset) * *************************************/ -static UINT32 lfb_r(voodoo_device *vd, offs_t offset, bool lfb_3d) +static uint32_t lfb_r(voodoo_device *vd, offs_t offset, bool lfb_3d) { - UINT16 *buffer; - UINT32 bufmax; - UINT32 bufoffs; - UINT32 data; + uint16_t *buffer; + uint32_t bufmax; + uint32_t bufoffs; + uint32_t data; int x, y, scry, destbuf; /* statistics */ @@ -3987,19 +3987,19 @@ static UINT32 lfb_r(voodoo_device *vd, offs_t offset, bool lfb_3d) switch (destbuf) { case 0: /* front buffer */ - buffer = (UINT16 *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.frontbuf]); + buffer = (uint16_t *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.frontbuf]); bufmax = (vd->fbi.mask + 1 - vd->fbi.rgboffs[vd->fbi.frontbuf]) / 2; break; case 1: /* back buffer */ - buffer = (UINT16 *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.backbuf]); + buffer = (uint16_t *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.backbuf]); bufmax = (vd->fbi.mask + 1 - vd->fbi.rgboffs[vd->fbi.backbuf]) / 2; break; case 2: /* aux buffer */ if (vd->fbi.auxoffs == ~0) return 0xffffffff; - buffer = (UINT16 *)(vd->fbi.ram + vd->fbi.auxoffs); + buffer = (uint16_t *)(vd->fbi.ram + vd->fbi.auxoffs); bufmax = (vd->fbi.mask + 1 - vd->fbi.auxoffs) / 2; break; @@ -4013,7 +4013,7 @@ static UINT32 lfb_r(voodoo_device *vd, offs_t offset, bool lfb_3d) scry = (vd->fbi.yorigin - y) & 0x3ff; } else { // Direct lfb access - buffer = (UINT16 *)(vd->fbi.ram + vd->fbi.lfb_base*4); + buffer = (uint16_t *)(vd->fbi.ram + vd->fbi.lfb_base*4); bufmax = (vd->fbi.mask + 1 - vd->fbi.lfb_base*4) / 2; scry = y; } @@ -4021,7 +4021,7 @@ static UINT32 lfb_r(voodoo_device *vd, offs_t offset, bool lfb_3d) /* advance pointers to the proper row */ bufoffs = scry * vd->fbi.rowpixels + x; if (bufoffs >= bufmax) { - vd->device->logerror("LFB_R: Buffer offset out of bounds x=%i y=%i lfb_3d=%i offset=%08X bufoffs=%08X\n", x, y, lfb_3d, offset, (UINT32) bufoffs); + vd->device->logerror("LFB_R: Buffer offset out of bounds x=%i y=%i lfb_3d=%i offset=%08X bufoffs=%08X\n", x, y, lfb_3d, offset, (uint32_t) bufoffs); return 0xffffffff; } @@ -4078,7 +4078,7 @@ READ32_MEMBER( voodoo_device::voodoo_r ) READ32_MEMBER( voodoo_banshee_device::banshee_agp_r ) { - UINT32 result; + uint32_t result; offset &= 0x1ff/4; @@ -4138,7 +4138,7 @@ READ32_MEMBER( voodoo_banshee_device::banshee_agp_r ) READ32_MEMBER( voodoo_banshee_device::banshee_r ) { - UINT32 result = 0xffffffff; + uint32_t result = 0xffffffff; /* if we have something pending, flush the FIFOs up to the current time */ if (pci.op_pending) @@ -4172,7 +4172,7 @@ READ32_MEMBER( voodoo_banshee_device::banshee_r ) READ32_MEMBER( voodoo_banshee_device::banshee_fb_r ) { - UINT32 result = 0xffffffff; + uint32_t result = 0xffffffff; /* if we have something pending, flush the FIFOs up to the current time */ if (pci.op_pending) @@ -4184,7 +4184,7 @@ READ32_MEMBER( voodoo_banshee_device::banshee_fb_r ) logerror("%s:banshee_fb_r(%X)\n", machine().describe_context(), offset*4); #endif if (offset*4 <= fbi.mask) - result = ((UINT32 *)fbi.ram)[offset]; + result = ((uint32_t *)fbi.ram)[offset]; else logerror("%s:banshee_fb_r(%X) Access out of bounds\n", machine().describe_context(), offset*4); } @@ -4199,7 +4199,7 @@ READ32_MEMBER( voodoo_banshee_device::banshee_fb_r ) READ8_MEMBER( voodoo_banshee_device::banshee_vga_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; offset &= 0x1f; @@ -4294,7 +4294,7 @@ READ8_MEMBER( voodoo_banshee_device::banshee_vga_r ) READ32_MEMBER( voodoo_banshee_device::banshee_io_r ) { - UINT32 result; + uint32_t result; offset &= 0xff/4; @@ -4342,7 +4342,7 @@ READ32_MEMBER( voodoo_banshee_device::banshee_rom_r ) return 0xffffffff; } -static void blit_2d(voodoo_device *vd, UINT32 data) +static void blit_2d(voodoo_device *vd, uint32_t data) { switch (vd->banshee.blt_cmd) { @@ -4367,7 +4367,7 @@ static void blit_2d(voodoo_device *vd, UINT32 data) case 3: // Host-to-screen blit { - UINT32 addr = vd->banshee.blt_dst_base; + uint32_t addr = vd->banshee.blt_dst_base; addr += (vd->banshee.blt_dst_y * vd->banshee.blt_dst_stride) + (vd->banshee.blt_dst_x * vd->banshee.blt_dst_bpp); @@ -4438,7 +4438,7 @@ static void blit_2d(voodoo_device *vd, UINT32 data) } } -INT32 voodoo_device::banshee_2d_w(voodoo_device *vd, offs_t offset, UINT32 data) +int32_t voodoo_device::banshee_2d_w(voodoo_device *vd, offs_t offset, uint32_t data) { switch (offset) { @@ -4730,7 +4730,7 @@ WRITE32_MEMBER( voodoo_banshee_device::banshee_w ) WRITE32_MEMBER( voodoo_banshee_device::banshee_fb_w ) { - UINT32 addr = offset*4; + uint32_t addr = offset*4; /* if we have something pending, flush the FIFOs up to the current time */ if (pci.op_pending) @@ -4745,7 +4745,7 @@ WRITE32_MEMBER( voodoo_banshee_device::banshee_fb_w ) else { if (offset*4 <= fbi.mask) - COMBINE_DATA(&((UINT32 *)fbi.ram)[offset]); + COMBINE_DATA(&((uint32_t *)fbi.ram)[offset]); else logerror("%s:banshee_fb_w Out of bounds (%X) = %08X & %08X\n", machine().describe_context(), offset*4, data, mem_mask); #if LOG_LFB @@ -4819,7 +4819,7 @@ WRITE8_MEMBER( voodoo_banshee_device::banshee_vga_w ) WRITE32_MEMBER( voodoo_banshee_device::banshee_io_w ) { - UINT32 old; + uint32_t old; offset &= 0xff/4; old = banshee.io[offset]; @@ -4922,11 +4922,11 @@ WRITE32_MEMBER( voodoo_banshee_device::banshee_io_w ) device start callback -------------------------------------------------*/ -void voodoo_device::common_start_voodoo(UINT8 type) +void voodoo_device::common_start_voodoo(uint8_t type) { const raster_info *info; void *fbmem, *tmumem[2]; - UINT32 tmumem0, tmumem1; + uint32_t tmumem0, tmumem1; int val; /* validate configuration */ @@ -4951,9 +4951,9 @@ void voodoo_device::common_start_voodoo(UINT8 type) /* n ranges from 1.0000 to 2.0000 */ for (val = 0; val <= (1 << RECIPLOG_LOOKUP_BITS); val++) { - UINT32 value = (1 << RECIPLOG_LOOKUP_BITS) + val; + uint32_t value = (1 << RECIPLOG_LOOKUP_BITS) + val; voodoo_reciplog[val*2 + 0] = (1 << (RECIPLOG_LOOKUP_PREC + RECIPLOG_LOOKUP_BITS)) / value; - voodoo_reciplog[val*2 + 1] = (UINT32)(LOGB2((double)value / (double)(1 << RECIPLOG_LOOKUP_BITS)) * (double)(1 << RECIPLOG_LOOKUP_PREC)); + voodoo_reciplog[val*2 + 1] = (uint32_t)(LOGB2((double)value / (double)(1 << RECIPLOG_LOOKUP_BITS)) * (double)(1 << RECIPLOG_LOOKUP_PREC)); } /* create dithering tables */ @@ -5052,14 +5052,14 @@ void voodoo_device::common_start_voodoo(UINT8 type) if (vd_type <= TYPE_VOODOO_2) { /* separate FB/TMU memory */ - fbmem = auto_alloc_array(machine(), UINT8, m_fbmem << 20); - tmumem[0] = auto_alloc_array(machine(), UINT8, m_tmumem0 << 20); - tmumem[1] = (m_tmumem1 != 0) ? auto_alloc_array(machine(), UINT8, m_tmumem1 << 20) : nullptr; + fbmem = auto_alloc_array(machine(), uint8_t, m_fbmem << 20); + tmumem[0] = auto_alloc_array(machine(), uint8_t, m_tmumem0 << 20); + tmumem[1] = (m_tmumem1 != 0) ? auto_alloc_array(machine(), uint8_t, m_tmumem1 << 20) : nullptr; } else { /* shared memory */ - tmumem[0] = tmumem[1] = fbmem = auto_alloc_array(machine(), UINT8, m_fbmem << 20); + tmumem[0] = tmumem[1] = fbmem = auto_alloc_array(machine(), uint8_t, m_fbmem << 20); tmumem0 = m_fbmem; if (vd_type == TYPE_VOODOO_3) tmumem1 = m_fbmem; @@ -5118,16 +5118,16 @@ void voodoo_device::common_start_voodoo(UINT8 type) command -------------------------------------------------*/ -INT32 voodoo_device::fastfill(voodoo_device *vd) +int32_t voodoo_device::fastfill(voodoo_device *vd) { int sx = (vd->reg[clipLeftRight].u >> 16) & 0x3ff; int ex = (vd->reg[clipLeftRight].u >> 0) & 0x3ff; int sy = (vd->reg[clipLowYHighY].u >> 16) & 0x3ff; int ey = (vd->reg[clipLowYHighY].u >> 0) & 0x3ff; poly_extent extents[64]; - UINT16 dithermatrix[16]; - UINT16 *drawbuf = nullptr; - UINT32 pixels = 0; + uint16_t dithermatrix[16]; + uint16_t *drawbuf = nullptr; + uint32_t pixels = 0; int extnum, x, y; /* if we're not clearing either, take no time */ @@ -5142,11 +5142,11 @@ INT32 voodoo_device::fastfill(voodoo_device *vd) switch (destbuf) { case 0: /* front buffer */ - drawbuf = (UINT16 *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.frontbuf]); + drawbuf = (uint16_t *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.frontbuf]); break; case 1: /* back buffer */ - drawbuf = (UINT16 *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.backbuf]); + drawbuf = (uint16_t *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.backbuf]); break; default: /* reserved */ @@ -5198,7 +5198,7 @@ INT32 voodoo_device::fastfill(voodoo_device *vd) command -------------------------------------------------*/ -INT32 voodoo_device::swapbuffer(voodoo_device* vd, UINT32 data) +int32_t voodoo_device::swapbuffer(voodoo_device* vd, uint32_t data) { /* set the don't swap value for Voodoo 2 */ vd->fbi.vblank_swap_pending = TRUE; @@ -5223,10 +5223,10 @@ INT32 voodoo_device::swapbuffer(voodoo_device* vd, UINT32 data) command -------------------------------------------------*/ -INT32 voodoo_device::triangle(voodoo_device *vd) +int32_t voodoo_device::triangle(voodoo_device *vd) { int texcount; - UINT16 *drawbuf; + uint16_t *drawbuf; int destbuf; int pixels; @@ -5244,8 +5244,8 @@ INT32 voodoo_device::triangle(voodoo_device *vd) /* perform subpixel adjustments */ if (FBZCP_CCA_SUBPIXEL_ADJUST(vd->reg[fbzColorPath].u)) { - INT32 dx = 8 - (vd->fbi.ax & 15); - INT32 dy = 8 - (vd->fbi.ay & 15); + int32_t dx = 8 - (vd->fbi.ax & 15); + int32_t dy = 8 - (vd->fbi.ay & 15); /* adjust iterated R,G,B,A and W/Z */ vd->fbi.startr += (dy * vd->fbi.drdy + dx * vd->fbi.drdx) >> 4; @@ -5280,12 +5280,12 @@ INT32 voodoo_device::triangle(voodoo_device *vd) switch (destbuf) { case 0: /* front buffer */ - drawbuf = (UINT16 *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.frontbuf]); + drawbuf = (uint16_t *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.frontbuf]); vd->fbi.video_changed = TRUE; break; case 1: /* back buffer */ - drawbuf = (UINT16 *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.backbuf]); + drawbuf = (uint16_t *)(vd->fbi.ram + vd->fbi.rgboffs[vd->fbi.backbuf]); break; default: /* reserved */ @@ -5314,7 +5314,7 @@ INT32 voodoo_device::triangle(voodoo_device *vd) command -------------------------------------------------*/ -INT32 voodoo_device::begin_triangle(voodoo_device *vd) +int32_t voodoo_device::begin_triangle(voodoo_device *vd) { setup_vertex *sv = &vd->fbi.svert[2]; @@ -5346,7 +5346,7 @@ INT32 voodoo_device::begin_triangle(voodoo_device *vd) command -------------------------------------------------*/ -INT32 voodoo_device::draw_triangle(voodoo_device *vd) +int32_t voodoo_device::draw_triangle(voodoo_device *vd) { setup_vertex *sv = &vd->fbi.svert[2]; int cycles = 0; @@ -5391,7 +5391,7 @@ INT32 voodoo_device::draw_triangle(voodoo_device *vd) parameters and render the triangle -------------------------------------------------*/ -INT32 voodoo_device::setup_and_draw_triangle(voodoo_device *vd) +int32_t voodoo_device::setup_and_draw_triangle(voodoo_device *vd) { float dx1, dy1, dx2, dy2; float divisor, tdiv; @@ -5420,12 +5420,12 @@ INT32 voodoo_device::setup_and_draw_triangle(voodoo_device *vd) divisor = 1.0f / divisor; /* grab the X/Ys at least */ - vd->fbi.ax = (INT16)(vd->fbi.svert[0].x * 16.0f); - vd->fbi.ay = (INT16)(vd->fbi.svert[0].y * 16.0f); - vd->fbi.bx = (INT16)(vd->fbi.svert[1].x * 16.0f); - vd->fbi.by = (INT16)(vd->fbi.svert[1].y * 16.0f); - vd->fbi.cx = (INT16)(vd->fbi.svert[2].x * 16.0f); - vd->fbi.cy = (INT16)(vd->fbi.svert[2].y * 16.0f); + vd->fbi.ax = (int16_t)(vd->fbi.svert[0].x * 16.0f); + vd->fbi.ay = (int16_t)(vd->fbi.svert[0].y * 16.0f); + vd->fbi.bx = (int16_t)(vd->fbi.svert[1].x * 16.0f); + vd->fbi.by = (int16_t)(vd->fbi.svert[1].y * 16.0f); + vd->fbi.cx = (int16_t)(vd->fbi.svert[2].x * 16.0f); + vd->fbi.cy = (int16_t)(vd->fbi.svert[2].y * 16.0f); /* compute the dx/dy values */ dx1 = vd->fbi.svert[0].y - vd->fbi.svert[2].y; @@ -5437,38 +5437,38 @@ INT32 voodoo_device::setup_and_draw_triangle(voodoo_device *vd) tdiv = divisor * 4096.0f; if (vd->reg[sSetupMode].u & (1 << 0)) { - vd->fbi.startr = (INT32)(vd->fbi.svert[0].r * 4096.0f); - vd->fbi.drdx = (INT32)(((vd->fbi.svert[0].r - vd->fbi.svert[1].r) * dx1 - (vd->fbi.svert[0].r - vd->fbi.svert[2].r) * dx2) * tdiv); - vd->fbi.drdy = (INT32)(((vd->fbi.svert[0].r - vd->fbi.svert[2].r) * dy1 - (vd->fbi.svert[0].r - vd->fbi.svert[1].r) * dy2) * tdiv); - vd->fbi.startg = (INT32)(vd->fbi.svert[0].g * 4096.0f); - vd->fbi.dgdx = (INT32)(((vd->fbi.svert[0].g - vd->fbi.svert[1].g) * dx1 - (vd->fbi.svert[0].g - vd->fbi.svert[2].g) * dx2) * tdiv); - vd->fbi.dgdy = (INT32)(((vd->fbi.svert[0].g - vd->fbi.svert[2].g) * dy1 - (vd->fbi.svert[0].g - vd->fbi.svert[1].g) * dy2) * tdiv); - vd->fbi.startb = (INT32)(vd->fbi.svert[0].b * 4096.0f); - vd->fbi.dbdx = (INT32)(((vd->fbi.svert[0].b - vd->fbi.svert[1].b) * dx1 - (vd->fbi.svert[0].b - vd->fbi.svert[2].b) * dx2) * tdiv); - vd->fbi.dbdy = (INT32)(((vd->fbi.svert[0].b - vd->fbi.svert[2].b) * dy1 - (vd->fbi.svert[0].b - vd->fbi.svert[1].b) * dy2) * tdiv); + vd->fbi.startr = (int32_t)(vd->fbi.svert[0].r * 4096.0f); + vd->fbi.drdx = (int32_t)(((vd->fbi.svert[0].r - vd->fbi.svert[1].r) * dx1 - (vd->fbi.svert[0].r - vd->fbi.svert[2].r) * dx2) * tdiv); + vd->fbi.drdy = (int32_t)(((vd->fbi.svert[0].r - vd->fbi.svert[2].r) * dy1 - (vd->fbi.svert[0].r - vd->fbi.svert[1].r) * dy2) * tdiv); + vd->fbi.startg = (int32_t)(vd->fbi.svert[0].g * 4096.0f); + vd->fbi.dgdx = (int32_t)(((vd->fbi.svert[0].g - vd->fbi.svert[1].g) * dx1 - (vd->fbi.svert[0].g - vd->fbi.svert[2].g) * dx2) * tdiv); + vd->fbi.dgdy = (int32_t)(((vd->fbi.svert[0].g - vd->fbi.svert[2].g) * dy1 - (vd->fbi.svert[0].g - vd->fbi.svert[1].g) * dy2) * tdiv); + vd->fbi.startb = (int32_t)(vd->fbi.svert[0].b * 4096.0f); + vd->fbi.dbdx = (int32_t)(((vd->fbi.svert[0].b - vd->fbi.svert[1].b) * dx1 - (vd->fbi.svert[0].b - vd->fbi.svert[2].b) * dx2) * tdiv); + vd->fbi.dbdy = (int32_t)(((vd->fbi.svert[0].b - vd->fbi.svert[2].b) * dy1 - (vd->fbi.svert[0].b - vd->fbi.svert[1].b) * dy2) * tdiv); } /* set up alpha */ if (vd->reg[sSetupMode].u & (1 << 1)) { - vd->fbi.starta = (INT32)(vd->fbi.svert[0].a * 4096.0f); - vd->fbi.dadx = (INT32)(((vd->fbi.svert[0].a - vd->fbi.svert[1].a) * dx1 - (vd->fbi.svert[0].a - vd->fbi.svert[2].a) * dx2) * tdiv); - vd->fbi.dady = (INT32)(((vd->fbi.svert[0].a - vd->fbi.svert[2].a) * dy1 - (vd->fbi.svert[0].a - vd->fbi.svert[1].a) * dy2) * tdiv); + vd->fbi.starta = (int32_t)(vd->fbi.svert[0].a * 4096.0f); + vd->fbi.dadx = (int32_t)(((vd->fbi.svert[0].a - vd->fbi.svert[1].a) * dx1 - (vd->fbi.svert[0].a - vd->fbi.svert[2].a) * dx2) * tdiv); + vd->fbi.dady = (int32_t)(((vd->fbi.svert[0].a - vd->fbi.svert[2].a) * dy1 - (vd->fbi.svert[0].a - vd->fbi.svert[1].a) * dy2) * tdiv); } /* set up Z */ if (vd->reg[sSetupMode].u & (1 << 2)) { - vd->fbi.startz = (INT32)(vd->fbi.svert[0].z * 4096.0f); - vd->fbi.dzdx = (INT32)(((vd->fbi.svert[0].z - vd->fbi.svert[1].z) * dx1 - (vd->fbi.svert[0].z - vd->fbi.svert[2].z) * dx2) * tdiv); - vd->fbi.dzdy = (INT32)(((vd->fbi.svert[0].z - vd->fbi.svert[2].z) * dy1 - (vd->fbi.svert[0].z - vd->fbi.svert[1].z) * dy2) * tdiv); + vd->fbi.startz = (int32_t)(vd->fbi.svert[0].z * 4096.0f); + vd->fbi.dzdx = (int32_t)(((vd->fbi.svert[0].z - vd->fbi.svert[1].z) * dx1 - (vd->fbi.svert[0].z - vd->fbi.svert[2].z) * dx2) * tdiv); + vd->fbi.dzdy = (int32_t)(((vd->fbi.svert[0].z - vd->fbi.svert[2].z) * dy1 - (vd->fbi.svert[0].z - vd->fbi.svert[1].z) * dy2) * tdiv); } /* set up Wb */ tdiv = divisor * 65536.0f * 65536.0f; if (vd->reg[sSetupMode].u & (1 << 3)) { - vd->fbi.startw = vd->tmu[0].startw = vd->tmu[1].startw = (INT64)(vd->fbi.svert[0].wb * 65536.0f * 65536.0f); + vd->fbi.startw = vd->tmu[0].startw = vd->tmu[1].startw = (int64_t)(vd->fbi.svert[0].wb * 65536.0f * 65536.0f); vd->fbi.dwdx = vd->tmu[0].dwdx = vd->tmu[1].dwdx = ((vd->fbi.svert[0].wb - vd->fbi.svert[1].wb) * dx1 - (vd->fbi.svert[0].wb - vd->fbi.svert[2].wb) * dx2) * tdiv; vd->fbi.dwdy = vd->tmu[0].dwdy = vd->tmu[1].dwdy = ((vd->fbi.svert[0].wb - vd->fbi.svert[2].wb) * dy1 - (vd->fbi.svert[0].wb - vd->fbi.svert[1].wb) * dy2) * tdiv; } @@ -5476,7 +5476,7 @@ INT32 voodoo_device::setup_and_draw_triangle(voodoo_device *vd) /* set up W0 */ if (vd->reg[sSetupMode].u & (1 << 4)) { - vd->tmu[0].startw = vd->tmu[1].startw = (INT64)(vd->fbi.svert[0].w0 * 65536.0f * 65536.0f); + vd->tmu[0].startw = vd->tmu[1].startw = (int64_t)(vd->fbi.svert[0].w0 * 65536.0f * 65536.0f); vd->tmu[0].dwdx = vd->tmu[1].dwdx = ((vd->fbi.svert[0].w0 - vd->fbi.svert[1].w0) * dx1 - (vd->fbi.svert[0].w0 - vd->fbi.svert[2].w0) * dx2) * tdiv; vd->tmu[0].dwdy = vd->tmu[1].dwdy = ((vd->fbi.svert[0].w0 - vd->fbi.svert[2].w0) * dy1 - (vd->fbi.svert[0].w0 - vd->fbi.svert[1].w0) * dy2) * tdiv; } @@ -5484,10 +5484,10 @@ INT32 voodoo_device::setup_and_draw_triangle(voodoo_device *vd) /* set up S0,T0 */ if (vd->reg[sSetupMode].u & (1 << 5)) { - vd->tmu[0].starts = vd->tmu[1].starts = (INT64)(vd->fbi.svert[0].s0 * 65536.0f * 65536.0f); + vd->tmu[0].starts = vd->tmu[1].starts = (int64_t)(vd->fbi.svert[0].s0 * 65536.0f * 65536.0f); vd->tmu[0].dsdx = vd->tmu[1].dsdx = ((vd->fbi.svert[0].s0 - vd->fbi.svert[1].s0) * dx1 - (vd->fbi.svert[0].s0 - vd->fbi.svert[2].s0) * dx2) * tdiv; vd->tmu[0].dsdy = vd->tmu[1].dsdy = ((vd->fbi.svert[0].s0 - vd->fbi.svert[2].s0) * dy1 - (vd->fbi.svert[0].s0 - vd->fbi.svert[1].s0) * dy2) * tdiv; - vd->tmu[0].startt = vd->tmu[1].startt = (INT64)(vd->fbi.svert[0].t0 * 65536.0f * 65536.0f); + vd->tmu[0].startt = vd->tmu[1].startt = (int64_t)(vd->fbi.svert[0].t0 * 65536.0f * 65536.0f); vd->tmu[0].dtdx = vd->tmu[1].dtdx = ((vd->fbi.svert[0].t0 - vd->fbi.svert[1].t0) * dx1 - (vd->fbi.svert[0].t0 - vd->fbi.svert[2].t0) * dx2) * tdiv; vd->tmu[0].dtdy = vd->tmu[1].dtdy = ((vd->fbi.svert[0].t0 - vd->fbi.svert[2].t0) * dy1 - (vd->fbi.svert[0].t0 - vd->fbi.svert[1].t0) * dy2) * tdiv; } @@ -5495,7 +5495,7 @@ INT32 voodoo_device::setup_and_draw_triangle(voodoo_device *vd) /* set up W1 */ if (vd->reg[sSetupMode].u & (1 << 6)) { - vd->tmu[1].startw = (INT64)(vd->fbi.svert[0].w1 * 65536.0f * 65536.0f); + vd->tmu[1].startw = (int64_t)(vd->fbi.svert[0].w1 * 65536.0f * 65536.0f); vd->tmu[1].dwdx = ((vd->fbi.svert[0].w1 - vd->fbi.svert[1].w1) * dx1 - (vd->fbi.svert[0].w1 - vd->fbi.svert[2].w1) * dx2) * tdiv; vd->tmu[1].dwdy = ((vd->fbi.svert[0].w1 - vd->fbi.svert[2].w1) * dy1 - (vd->fbi.svert[0].w1 - vd->fbi.svert[1].w1) * dy2) * tdiv; } @@ -5503,10 +5503,10 @@ INT32 voodoo_device::setup_and_draw_triangle(voodoo_device *vd) /* set up S1,T1 */ if (vd->reg[sSetupMode].u & (1 << 7)) { - vd->tmu[1].starts = (INT64)(vd->fbi.svert[0].s1 * 65536.0f * 65536.0f); + vd->tmu[1].starts = (int64_t)(vd->fbi.svert[0].s1 * 65536.0f * 65536.0f); vd->tmu[1].dsdx = ((vd->fbi.svert[0].s1 - vd->fbi.svert[1].s1) * dx1 - (vd->fbi.svert[0].s1 - vd->fbi.svert[2].s1) * dx2) * tdiv; vd->tmu[1].dsdy = ((vd->fbi.svert[0].s1 - vd->fbi.svert[2].s1) * dy1 - (vd->fbi.svert[0].s1 - vd->fbi.svert[1].s1) * dy2) * tdiv; - vd->tmu[1].startt = (INT64)(vd->fbi.svert[0].t1 * 65536.0f * 65536.0f); + vd->tmu[1].startt = (int64_t)(vd->fbi.svert[0].t1 * 65536.0f * 65536.0f); vd->tmu[1].dtdx = ((vd->fbi.svert[0].t1 - vd->fbi.svert[1].t1) * dx1 - (vd->fbi.svert[0].t1 - vd->fbi.svert[2].t1) * dx2) * tdiv; vd->tmu[1].dtdy = ((vd->fbi.svert[0].t1 - vd->fbi.svert[2].t1) * dy1 - (vd->fbi.svert[0].t1 - vd->fbi.svert[1].t1) * dy2) * tdiv; } @@ -5522,7 +5522,7 @@ INT32 voodoo_device::setup_and_draw_triangle(voodoo_device *vd) setup and create the work item -------------------------------------------------*/ -INT32 voodoo_device::triangle_create_work_item(voodoo_device* vd, UINT16 *drawbuf, int texcount) +int32_t voodoo_device::triangle_create_work_item(voodoo_device* vd, uint16_t *drawbuf, int texcount) { poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(vd->poly); @@ -5704,7 +5704,7 @@ raster_info *voodoo_device::find_rasterizer(voodoo_device *vd, int texcount) void voodoo_device::dump_rasterizer_stats(voodoo_device *vd) { - static UINT8 display_index; + static uint8_t display_index; raster_info *cur, *best; int hash; @@ -5744,7 +5744,7 @@ void voodoo_device::dump_rasterizer_stats(voodoo_device *vd) } } -voodoo_device::voodoo_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) +voodoo_device::voodoo_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_fbmem(0), m_tmumem0(0), @@ -5793,7 +5793,7 @@ void voodoo_device::device_stop() const device_type VOODOO_1 = &device_creator; -voodoo_1_device::voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +voodoo_1_device::voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : voodoo_device(mconfig, VOODOO_1, "3dfx Voodoo Graphics", tag, owner, clock, "voodoo_1", __FILE__) { } @@ -5810,7 +5810,7 @@ void voodoo_1_device::device_start() const device_type VOODOO_2 = &device_creator; -voodoo_2_device::voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +voodoo_2_device::voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : voodoo_device(mconfig, VOODOO_2, "3dfx Voodoo 2", tag, owner, clock, "voodoo_2", __FILE__) { } @@ -5827,12 +5827,12 @@ void voodoo_2_device::device_start() const device_type VOODOO_BANSHEE = &device_creator; -voodoo_banshee_device::voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +voodoo_banshee_device::voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : voodoo_device(mconfig, VOODOO_BANSHEE, "3dfx Voodoo Banshee", tag, owner, clock, "voodoo_banshee", __FILE__) { } -voodoo_banshee_device::voodoo_banshee_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) +voodoo_banshee_device::voodoo_banshee_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) : voodoo_device(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -5849,7 +5849,7 @@ void voodoo_banshee_device::device_start() const device_type VOODOO_3 = &device_creator; -voodoo_3_device::voodoo_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +voodoo_3_device::voodoo_3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : voodoo_banshee_device(mconfig, VOODOO_3, "3dfx Voodoo 3", tag, owner, clock, "voodoo_3", __FILE__) { } @@ -5874,13 +5874,13 @@ void voodoo_3_device::device_start() implementation of the 'fastfill' command -------------------------------------------------*/ -void voodoo_device::raster_fastfill(void *destbase, INT32 y, const poly_extent *extent, const void *extradata, int threadid) +void voodoo_device::raster_fastfill(void *destbase, int32_t y, const poly_extent *extent, const void *extradata, int threadid) { const poly_extra_data *extra = (const poly_extra_data *)extradata; voodoo_device* vd = extra->device; stats_block *stats = &vd->thread_stats[threadid]; - INT32 startx = extent->startx; - INT32 stopx = extent->stopx; + int32_t startx = extent->startx; + int32_t stopx = extent->stopx; int scry, x; /* determine the screen Y */ @@ -5891,14 +5891,14 @@ void voodoo_device::raster_fastfill(void *destbase, INT32 y, const poly_extent * /* fill this RGB row */ if (FBZMODE_RGB_BUFFER_MASK(vd->reg[fbzMode].u)) { - const UINT16 *ditherow = &extra->dither[(y & 3) * 4]; - UINT64 expanded = *(UINT64 *)ditherow; - UINT16 *dest = (UINT16 *)destbase + scry * vd->fbi.rowpixels; + const uint16_t *ditherow = &extra->dither[(y & 3) * 4]; + uint64_t expanded = *(uint64_t *)ditherow; + uint16_t *dest = (uint16_t *)destbase + scry * vd->fbi.rowpixels; for (x = startx; x < stopx && (x & 3) != 0; x++) dest[x] = ditherow[x & 3]; for ( ; x < (stopx & ~3); x += 4) - *(UINT64 *)&dest[x] = expanded; + *(uint64_t *)&dest[x] = expanded; for ( ; x < stopx; x++) dest[x] = ditherow[x & 3]; stats->pixels_out += stopx - startx; @@ -5907,14 +5907,14 @@ void voodoo_device::raster_fastfill(void *destbase, INT32 y, const poly_extent * /* fill this dest buffer row */ if (FBZMODE_AUX_BUFFER_MASK(vd->reg[fbzMode].u) && vd->fbi.auxoffs != ~0) { - UINT16 depth = vd->reg[zaColor].u; - UINT64 expanded = ((UINT64)depth << 48) | ((UINT64)depth << 32) | (depth << 16) | depth; - UINT16 *dest = (UINT16 *)(vd->fbi.ram + vd->fbi.auxoffs) + scry * vd->fbi.rowpixels; + uint16_t depth = vd->reg[zaColor].u; + uint64_t expanded = ((uint64_t)depth << 48) | ((uint64_t)depth << 32) | (depth << 16) | depth; + uint16_t *dest = (uint16_t *)(vd->fbi.ram + vd->fbi.auxoffs) + scry * vd->fbi.rowpixels; for (x = startx; x < stopx && (x & 3) != 0; x++) dest[x] = depth; for ( ; x < (stopx & ~3); x += 4) - *(UINT64 *)&dest[x] = expanded; + *(uint64_t *)&dest[x] = expanded; for ( ; x < stopx; x++) dest[x] = depth; } diff --git a/src/devices/video/voodoo.h b/src/devices/video/voodoo.h index 9fc41b6b533..0dc3e1d4fbf 100644 --- a/src/devices/video/voodoo.h +++ b/src/devices/video/voodoo.h @@ -339,7 +339,7 @@ enum * *************************************/ -static const UINT8 register_alias_map[0x40] = +static const uint8_t register_alias_map[0x40] = { vdstatus, 0x004/4, vertexAx, vertexAy, vertexBx, vertexBy, vertexCx, vertexCy, @@ -368,7 +368,7 @@ static const UINT8 register_alias_map[0x40] = * *************************************/ -static const UINT8 voodoo_register_access[0x100] = +static const uint8_t voodoo_register_access[0x100] = { /* 0x000 */ REG_RP, 0, REG_WPF, REG_WPF, @@ -459,7 +459,7 @@ static const UINT8 voodoo_register_access[0x100] = }; -static const UINT8 voodoo2_register_access[0x100] = +static const uint8_t voodoo2_register_access[0x100] = { /* 0x000 */ REG_RP, REG_RWPT, REG_WPF, REG_WPF, @@ -550,7 +550,7 @@ static const UINT8 voodoo2_register_access[0x100] = }; -static const UINT8 banshee_register_access[0x100] = +static const uint8_t banshee_register_access[0x100] = { /* 0x000 */ REG_RP, REG_RWPT, REG_WPF, REG_WPF, @@ -1009,7 +1009,7 @@ static const char *const banshee_agp_reg_name[] = * *************************************/ -static const UINT8 dither_matrix_4x4[16] = +static const uint8_t dither_matrix_4x4[16] = { 0, 8, 2, 10, 12, 4, 14, 6, @@ -1017,7 +1017,7 @@ static const UINT8 dither_matrix_4x4[16] = 15, 7, 13, 5 }; -static const UINT8 dither_matrix_2x2[16] = +static const uint8_t dither_matrix_2x2[16] = { 2, 10, 2, 10, 14, 6, 14, 6, @@ -1046,7 +1046,7 @@ static const UINT8 dither_matrix_2x2[16] = (b) = (((val) >> 3) & 0xf8) | (((val) >> 8) & 0x07); \ (c) = (((val) << 2) & 0xf8) | (((val) >> 3) & 0x07); #define EXTRACT_1555_TO_8888(val, a, b, c, d) \ - (a) = ((INT16)(val) >> 15) & 0xff; \ + (a) = ((int16_t)(val) >> 15) & 0xff; \ EXTRACT_x555_TO_888(val, b, c, d) #define EXTRACT_5551_TO_8888(val, a, b, c, d) \ EXTRACT_555x_TO_888(val, a, b, c) \ @@ -1369,17 +1369,17 @@ class voodoo_device; struct rgba { #ifdef LSB_FIRST - UINT8 b, g, r, a; + uint8_t b, g, r, a; #else - UINT8 a, r, g, b; + uint8_t a, r, g, b; #endif }; union voodoo_reg { - INT32 i; - UINT32 u; + int32_t i; + uint32_t u; float f; rgba rgb; }; @@ -1388,25 +1388,25 @@ union voodoo_reg struct voodoo_stats { - UINT8 lastkey; /* last key state */ - UINT8 display; /* display stats? */ - INT32 swaps; /* total swaps */ - INT32 stalls; /* total stalls */ - INT32 total_triangles; /* total triangles */ - INT32 total_pixels_in; /* total pixels in */ - INT32 total_pixels_out; /* total pixels out */ - INT32 total_chroma_fail; /* total chroma fail */ - INT32 total_zfunc_fail; /* total z func fail */ - INT32 total_afunc_fail; /* total a func fail */ - INT32 total_clipped; /* total clipped */ - INT32 total_stippled; /* total stippled */ - INT32 lfb_writes; /* LFB writes */ - INT32 lfb_reads; /* LFB reads */ - INT32 reg_writes; /* register writes */ - INT32 reg_reads; /* register reads */ - INT32 tex_writes; /* texture writes */ - INT32 texture_mode[16]; /* 16 different texture modes */ - UINT8 render_override; /* render override */ + uint8_t lastkey; /* last key state */ + uint8_t display; /* display stats? */ + int32_t swaps; /* total swaps */ + int32_t stalls; /* total stalls */ + int32_t total_triangles; /* total triangles */ + int32_t total_pixels_in; /* total pixels in */ + int32_t total_pixels_out; /* total pixels out */ + int32_t total_chroma_fail; /* total chroma fail */ + int32_t total_zfunc_fail; /* total z func fail */ + int32_t total_afunc_fail; /* total a func fail */ + int32_t total_clipped; /* total clipped */ + int32_t total_stippled; /* total stippled */ + int32_t lfb_writes; /* LFB writes */ + int32_t lfb_reads; /* LFB reads */ + int32_t reg_writes; /* register writes */ + int32_t reg_reads; /* register reads */ + int32_t tex_writes; /* texture writes */ + int32_t texture_mode[16]; /* 16 different texture modes */ + uint8_t render_override; /* render override */ char buffer[1024]; /* string */ }; @@ -1414,59 +1414,59 @@ struct voodoo_stats /* note that this structure is an even 64 bytes long */ struct stats_block { - INT32 pixels_in; /* pixels in statistic */ - INT32 pixels_out; /* pixels out statistic */ - INT32 chroma_fail; /* chroma test fail statistic */ - INT32 zfunc_fail; /* z function test fail statistic */ - INT32 afunc_fail; /* alpha function test fail statistic */ - INT32 clip_fail; /* clipping fail statistic */ - INT32 stipple_count; /* stipple statistic */ - INT32 filler[64/4 - 7]; /* pad this structure to 64 bytes */ + int32_t pixels_in; /* pixels in statistic */ + int32_t pixels_out; /* pixels out statistic */ + int32_t chroma_fail; /* chroma test fail statistic */ + int32_t zfunc_fail; /* z function test fail statistic */ + int32_t afunc_fail; /* alpha function test fail statistic */ + int32_t clip_fail; /* clipping fail statistic */ + int32_t stipple_count; /* stipple statistic */ + int32_t filler[64/4 - 7]; /* pad this structure to 64 bytes */ }; struct fifo_state { - UINT32 * base; /* base of the FIFO */ - INT32 size; /* size of the FIFO */ - INT32 in; /* input pointer */ - INT32 out; /* output pointer */ + uint32_t * base; /* base of the FIFO */ + int32_t size; /* size of the FIFO */ + int32_t in; /* input pointer */ + int32_t out; /* output pointer */ }; struct cmdfifo_info { - UINT8 enable; /* enabled? */ - UINT8 count_holes; /* count holes? */ - UINT32 base; /* base address in framebuffer RAM */ - UINT32 end; /* end address in framebuffer RAM */ - UINT32 rdptr; /* current read pointer */ - UINT32 amin; /* minimum address */ - UINT32 amax; /* maximum address */ - UINT32 depth; /* current depth */ - UINT32 holes; /* number of holes */ + uint8_t enable; /* enabled? */ + uint8_t count_holes; /* count holes? */ + uint32_t base; /* base address in framebuffer RAM */ + uint32_t end; /* end address in framebuffer RAM */ + uint32_t rdptr; /* current read pointer */ + uint32_t amin; /* minimum address */ + uint32_t amax; /* maximum address */ + uint32_t depth; /* current depth */ + uint32_t holes; /* number of holes */ }; struct pci_state { fifo_state fifo; /* PCI FIFO */ - UINT32 init_enable; /* initEnable value */ - UINT8 stall_state; /* state of the system if we're stalled */ - UINT8 op_pending; /* true if an operation is pending */ + uint32_t init_enable; /* initEnable value */ + uint8_t stall_state; /* state of the system if we're stalled */ + uint8_t op_pending; /* true if an operation is pending */ attotime op_end_time; /* time when the pending operation ends */ emu_timer * continue_timer; /* timer to use to continue processing */ - UINT32 fifo_mem[64*2]; /* memory backing the PCI FIFO */ + uint32_t fifo_mem[64*2]; /* memory backing the PCI FIFO */ }; struct ncc_table { - UINT8 dirty; /* is the texel lookup dirty? */ + uint8_t dirty; /* is the texel lookup dirty? */ voodoo_reg * reg; /* pointer to our registers */ - INT32 ir[4], ig[4], ib[4]; /* I values for R,G,B */ - INT32 qr[4], qg[4], qb[4]; /* Q values for R,G,B */ - INT32 y[16]; /* Y values */ + int32_t ir[4], ig[4], ib[4]; /* I values for R,G,B */ + int32_t qr[4], qg[4], qb[4]; /* Q values for R,G,B */ + int32_t y[16]; /* Y values */ rgb_t * palette; /* pointer to associated RGB palette */ rgb_t * palettea; /* pointer to associated ARGB palette */ rgb_t texel[256]; /* texel lookup */ @@ -1475,33 +1475,33 @@ struct ncc_table struct tmu_state { - UINT8 * ram; /* pointer to our RAM */ - UINT32 mask; /* mask to apply to pointers */ + uint8_t * ram; /* pointer to our RAM */ + uint32_t mask; /* mask to apply to pointers */ voodoo_reg * reg; /* pointer to our register base */ - UINT32 regdirty; /* true if the LOD/mode/base registers have changed */ + uint32_t regdirty; /* true if the LOD/mode/base registers have changed */ - UINT32 texaddr_mask; /* mask for texture address */ - UINT8 texaddr_shift; /* shift for texture address */ + uint32_t texaddr_mask; /* mask for texture address */ + uint8_t texaddr_shift; /* shift for texture address */ - INT64 starts, startt; /* starting S,T (14.18) */ - INT64 startw; /* starting W (2.30) */ - INT64 dsdx, dtdx; /* delta S,T per X */ - INT64 dwdx; /* delta W per X */ - INT64 dsdy, dtdy; /* delta S,T per Y */ - INT64 dwdy; /* delta W per Y */ + int64_t starts, startt; /* starting S,T (14.18) */ + int64_t startw; /* starting W (2.30) */ + int64_t dsdx, dtdx; /* delta S,T per X */ + int64_t dwdx; /* delta W per X */ + int64_t dsdy, dtdy; /* delta S,T per Y */ + int64_t dwdy; /* delta W per Y */ - INT32 lodmin, lodmax; /* min, max LOD values */ - INT32 lodbias; /* LOD bias */ - UINT32 lodmask; /* mask of available LODs */ - UINT32 lodoffset[9]; /* offset of texture base for each LOD */ - INT32 detailmax; /* detail clamp */ - INT32 detailbias; /* detail bias */ - UINT8 detailscale; /* detail scale */ + int32_t lodmin, lodmax; /* min, max LOD values */ + int32_t lodbias; /* LOD bias */ + uint32_t lodmask; /* mask of available LODs */ + uint32_t lodoffset[9]; /* offset of texture base for each LOD */ + int32_t detailmax; /* detail clamp */ + int32_t detailbias; /* detail bias */ + uint8_t detailscale; /* detail scale */ - UINT32 wmask; /* mask for the current texture width */ - UINT32 hmask; /* mask for the current texture height */ + uint32_t wmask; /* mask for the current texture width */ + uint32_t hmask; /* mask for the current texture height */ - UINT32 bilinear_mask; /* mask for bilinear resolution (0xf0 for V1, 0xff for V2) */ + uint32_t bilinear_mask; /* mask for bilinear resolution (0xf0 for V1, 0xff for V2) */ ncc_table ncc[2]; /* two NCC tables */ @@ -1538,75 +1538,75 @@ struct setup_vertex struct fbi_state { - UINT8 * ram; /* pointer to frame buffer RAM */ - UINT32 mask; /* mask to apply to pointers */ - UINT32 rgboffs[3]; /* word offset to 3 RGB buffers */ - UINT32 auxoffs; /* word offset to 1 aux buffer */ - - UINT8 frontbuf; /* front buffer index */ - UINT8 backbuf; /* back buffer index */ - UINT8 swaps_pending; /* number of pending swaps */ - UINT8 video_changed; /* did the frontbuffer video change? */ - - UINT32 yorigin; /* Y origin subtract value */ - UINT32 lfb_base; /* base of LFB in memory */ - UINT8 lfb_stride; /* stride of LFB accesses in bits */ - - UINT32 width; /* width of current frame buffer */ - UINT32 height; /* height of current frame buffer */ - UINT32 xoffs; /* horizontal offset (back porch) */ - UINT32 yoffs; /* vertical offset (back porch) */ - UINT32 vsyncscan; /* vertical sync scanline */ - UINT32 rowpixels; /* pixels per row */ - UINT32 tile_width; /* width of video tiles */ - UINT32 tile_height; /* height of video tiles */ - UINT32 x_tiles; /* number of tiles in the X direction */ + uint8_t * ram; /* pointer to frame buffer RAM */ + uint32_t mask; /* mask to apply to pointers */ + uint32_t rgboffs[3]; /* word offset to 3 RGB buffers */ + uint32_t auxoffs; /* word offset to 1 aux buffer */ + + uint8_t frontbuf; /* front buffer index */ + uint8_t backbuf; /* back buffer index */ + uint8_t swaps_pending; /* number of pending swaps */ + uint8_t video_changed; /* did the frontbuffer video change? */ + + uint32_t yorigin; /* Y origin subtract value */ + uint32_t lfb_base; /* base of LFB in memory */ + uint8_t lfb_stride; /* stride of LFB accesses in bits */ + + uint32_t width; /* width of current frame buffer */ + uint32_t height; /* height of current frame buffer */ + uint32_t xoffs; /* horizontal offset (back porch) */ + uint32_t yoffs; /* vertical offset (back porch) */ + uint32_t vsyncscan; /* vertical sync scanline */ + uint32_t rowpixels; /* pixels per row */ + uint32_t tile_width; /* width of video tiles */ + uint32_t tile_height; /* height of video tiles */ + uint32_t x_tiles; /* number of tiles in the X direction */ emu_timer * vblank_timer; /* VBLANK timer */ - UINT8 vblank; /* VBLANK state */ - UINT8 vblank_count; /* number of VBLANKs since last swap */ - UINT8 vblank_swap_pending; /* a swap is pending, waiting for a vblank */ - UINT8 vblank_swap; /* swap when we hit this count */ - UINT8 vblank_dont_swap; /* don't actually swap when we hit this point */ + uint8_t vblank; /* VBLANK state */ + uint8_t vblank_count; /* number of VBLANKs since last swap */ + uint8_t vblank_swap_pending; /* a swap is pending, waiting for a vblank */ + uint8_t vblank_swap; /* swap when we hit this count */ + uint8_t vblank_dont_swap; /* don't actually swap when we hit this point */ /* triangle setup info */ - UINT8 cheating_allowed; /* allow cheating? */ - INT32 sign; /* triangle sign */ - INT16 ax, ay; /* vertex A x,y (12.4) */ - INT16 bx, by; /* vertex B x,y (12.4) */ - INT16 cx, cy; /* vertex C x,y (12.4) */ - INT32 startr, startg, startb, starta; /* starting R,G,B,A (12.12) */ - INT32 startz; /* starting Z (20.12) */ - INT64 startw; /* starting W (16.32) */ - INT32 drdx, dgdx, dbdx, dadx; /* delta R,G,B,A per X */ - INT32 dzdx; /* delta Z per X */ - INT64 dwdx; /* delta W per X */ - INT32 drdy, dgdy, dbdy, dady; /* delta R,G,B,A per Y */ - INT32 dzdy; /* delta Z per Y */ - INT64 dwdy; /* delta W per Y */ + uint8_t cheating_allowed; /* allow cheating? */ + int32_t sign; /* triangle sign */ + int16_t ax, ay; /* vertex A x,y (12.4) */ + int16_t bx, by; /* vertex B x,y (12.4) */ + int16_t cx, cy; /* vertex C x,y (12.4) */ + int32_t startr, startg, startb, starta; /* starting R,G,B,A (12.12) */ + int32_t startz; /* starting Z (20.12) */ + int64_t startw; /* starting W (16.32) */ + int32_t drdx, dgdx, dbdx, dadx; /* delta R,G,B,A per X */ + int32_t dzdx; /* delta Z per X */ + int64_t dwdx; /* delta W per X */ + int32_t drdy, dgdy, dbdy, dady; /* delta R,G,B,A per Y */ + int32_t dzdy; /* delta Z per Y */ + int64_t dwdy; /* delta W per Y */ stats_block lfb_stats; /* LFB-access statistics */ - UINT8 sverts; /* number of vertices ready */ + uint8_t sverts; /* number of vertices ready */ setup_vertex svert[3]; /* 3 setup vertices */ fifo_state fifo; /* framebuffer memory fifo */ cmdfifo_info cmdfifo[2]; /* command FIFOs */ - UINT8 fogblend[64]; /* 64-entry fog table */ - UINT8 fogdelta[64]; /* 64-entry fog table */ - UINT8 fogdelta_mask; /* mask for for delta (0xff for V1, 0xfc for V2) */ + uint8_t fogblend[64]; /* 64-entry fog table */ + uint8_t fogdelta[64]; /* 64-entry fog table */ + uint8_t fogdelta_mask; /* mask for for delta (0xff for V1, 0xfc for V2) */ rgb_t pen[65536]; /* mapping from pixels to pens */ rgb_t clut[512]; /* clut gamma data */ - UINT8 clut_dirty; /* do we need to recompute? */ + uint8_t clut_dirty; /* do we need to recompute? */ }; struct dac_state { - UINT8 reg[8]; /* 8 registers */ - UINT8 read_result; /* pending read result */ + uint8_t reg[8]; /* 8 registers */ + uint8_t read_result; /* pending read result */ }; @@ -1614,17 +1614,17 @@ struct raster_info { raster_info * next; /* pointer to next entry with the same hash */ poly_draw_scanline_func callback; /* callback pointer */ - UINT8 is_generic; /* TRUE if this is one of the generic rasterizers */ - UINT8 display; /* display index */ - UINT32 hits; /* how many hits (pixels) we've used this for */ - UINT32 polys; /* how many polys we've used this for */ - UINT32 eff_color_path; /* effective fbzColorPath value */ - UINT32 eff_alpha_mode; /* effective alphaMode value */ - UINT32 eff_fog_mode; /* effective fogMode value */ - UINT32 eff_fbz_mode; /* effective fbzMode value */ - UINT32 eff_tex_mode_0; /* effective textureMode value for TMU #0 */ - UINT32 eff_tex_mode_1; /* effective textureMode value for TMU #1 */ - UINT32 hash; + uint8_t is_generic; /* TRUE if this is one of the generic rasterizers */ + uint8_t display; /* display index */ + uint32_t hits; /* how many hits (pixels) we've used this for */ + uint32_t polys; /* how many polys we've used this for */ + uint32_t eff_color_path; /* effective fbzColorPath value */ + uint32_t eff_alpha_mode; /* effective alphaMode value */ + uint32_t eff_fog_mode; /* effective fogMode value */ + uint32_t eff_fbz_mode; /* effective fbzMode value */ + uint32_t eff_tex_mode_0; /* effective textureMode value for TMU #0 */ + uint32_t eff_tex_mode_1; /* effective textureMode value for TMU #1 */ + uint32_t hash; }; @@ -1633,64 +1633,64 @@ struct poly_extra_data voodoo_device * device; raster_info * info; /* pointer to rasterizer information */ - INT16 ax, ay; /* vertex A x,y (12.4) */ - INT32 startr, startg, startb, starta; /* starting R,G,B,A (12.12) */ - INT32 startz; /* starting Z (20.12) */ - INT64 startw; /* starting W (16.32) */ - INT32 drdx, dgdx, dbdx, dadx; /* delta R,G,B,A per X */ - INT32 dzdx; /* delta Z per X */ - INT64 dwdx; /* delta W per X */ - INT32 drdy, dgdy, dbdy, dady; /* delta R,G,B,A per Y */ - INT32 dzdy; /* delta Z per Y */ - INT64 dwdy; /* delta W per Y */ - - INT64 starts0, startt0; /* starting S,T (14.18) */ - INT64 startw0; /* starting W (2.30) */ - INT64 ds0dx, dt0dx; /* delta S,T per X */ - INT64 dw0dx; /* delta W per X */ - INT64 ds0dy, dt0dy; /* delta S,T per Y */ - INT64 dw0dy; /* delta W per Y */ - INT32 lodbase0; /* used during rasterization */ - - INT64 starts1, startt1; /* starting S,T (14.18) */ - INT64 startw1; /* starting W (2.30) */ - INT64 ds1dx, dt1dx; /* delta S,T per X */ - INT64 dw1dx; /* delta W per X */ - INT64 ds1dy, dt1dy; /* delta S,T per Y */ - INT64 dw1dy; /* delta W per Y */ - INT32 lodbase1; /* used during rasterization */ - - UINT16 dither[16]; /* dither matrix, for fastfill */ + int16_t ax, ay; /* vertex A x,y (12.4) */ + int32_t startr, startg, startb, starta; /* starting R,G,B,A (12.12) */ + int32_t startz; /* starting Z (20.12) */ + int64_t startw; /* starting W (16.32) */ + int32_t drdx, dgdx, dbdx, dadx; /* delta R,G,B,A per X */ + int32_t dzdx; /* delta Z per X */ + int64_t dwdx; /* delta W per X */ + int32_t drdy, dgdy, dbdy, dady; /* delta R,G,B,A per Y */ + int32_t dzdy; /* delta Z per Y */ + int64_t dwdy; /* delta W per Y */ + + int64_t starts0, startt0; /* starting S,T (14.18) */ + int64_t startw0; /* starting W (2.30) */ + int64_t ds0dx, dt0dx; /* delta S,T per X */ + int64_t dw0dx; /* delta W per X */ + int64_t ds0dy, dt0dy; /* delta S,T per Y */ + int64_t dw0dy; /* delta W per Y */ + int32_t lodbase0; /* used during rasterization */ + + int64_t starts1, startt1; /* starting S,T (14.18) */ + int64_t startw1; /* starting W (2.30) */ + int64_t ds1dx, dt1dx; /* delta S,T per X */ + int64_t dw1dx; /* delta W per X */ + int64_t ds1dy, dt1dy; /* delta S,T per Y */ + int64_t dw1dy; /* delta W per Y */ + int32_t lodbase1; /* used during rasterization */ + + uint16_t dither[16]; /* dither matrix, for fastfill */ }; struct banshee_info { - UINT32 io[0x40]; /* I/O registers */ - UINT32 agp[0x80]; /* AGP registers */ - UINT8 vga[0x20]; /* VGA registers */ - UINT8 crtc[0x27]; /* VGA CRTC registers */ - UINT8 seq[0x05]; /* VGA sequencer registers */ - UINT8 gc[0x05]; /* VGA graphics controller registers */ - UINT8 att[0x15]; /* VGA attribute registers */ - UINT8 attff; /* VGA attribute flip-flop */ - - UINT32 blt_regs[0x20]; /* 2D Blitter registers */ - UINT32 blt_dst_base; - UINT32 blt_dst_x; - UINT32 blt_dst_y; - UINT32 blt_dst_width; - UINT32 blt_dst_height; - UINT32 blt_dst_stride; - UINT32 blt_dst_bpp; - UINT32 blt_cmd; - UINT32 blt_src_base; - UINT32 blt_src_x; - UINT32 blt_src_y; - UINT32 blt_src_width; - UINT32 blt_src_height; - UINT32 blt_src_stride; - UINT32 blt_src_bpp; + uint32_t io[0x40]; /* I/O registers */ + uint32_t agp[0x80]; /* AGP registers */ + uint8_t vga[0x20]; /* VGA registers */ + uint8_t crtc[0x27]; /* VGA CRTC registers */ + uint8_t seq[0x05]; /* VGA sequencer registers */ + uint8_t gc[0x05]; /* VGA graphics controller registers */ + uint8_t att[0x15]; /* VGA attribute registers */ + uint8_t attff; /* VGA attribute flip-flop */ + + uint32_t blt_regs[0x20]; /* 2D Blitter registers */ + uint32_t blt_dst_base; + uint32_t blt_dst_x; + uint32_t blt_dst_y; + uint32_t blt_dst_width; + uint32_t blt_dst_height; + uint32_t blt_dst_stride; + uint32_t blt_dst_bpp; + uint32_t blt_cmd; + uint32_t blt_src_base; + uint32_t blt_src_x; + uint32_t blt_src_y; + uint32_t blt_src_width; + uint32_t blt_src_height; + uint32_t blt_src_stride; + uint32_t blt_src_bpp; }; @@ -1753,7 +1753,7 @@ struct stats_block; class voodoo_device : public device_t { public: - voodoo_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); + voodoo_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); ~voodoo_device(); @@ -1768,11 +1768,11 @@ public: DECLARE_WRITE32_MEMBER( voodoo_w ); // access to legacy token - void common_start_voodoo(UINT8 type); + void common_start_voodoo(uint8_t type); - UINT8 m_fbmem; - UINT8 m_tmumem0; - UINT8 m_tmumem1; + uint8_t m_fbmem; + uint8_t m_tmumem0; + uint8_t m_tmumem1; const char * m_screen; const char * m_cputag; devcb_write_line m_vblank; @@ -1787,46 +1787,46 @@ public: int voodoo_update(bitmap_rgb32 &bitmap, const rectangle &cliprect); int voodoo_get_type(); int voodoo_is_stalled(); - void voodoo_set_init_enable(UINT32 newval); + void voodoo_set_init_enable(uint32_t newval); // not all of these need to be static, review. static void check_stalled_cpu(voodoo_device* vd, attotime current_time); static void flush_fifos( voodoo_device* vd, attotime current_time); static void init_fbi(voodoo_device *vd, fbi_state *f, void *memory, int fbmem); - static INT32 register_w(voodoo_device *vd, offs_t offset, UINT32 data); - static INT32 swapbuffer(voodoo_device *vd, UINT32 data); + static int32_t register_w(voodoo_device *vd, offs_t offset, uint32_t data); + static int32_t swapbuffer(voodoo_device *vd, uint32_t data); static void init_tmu(voodoo_device *vd, tmu_state *t, voodoo_reg *reg, void *memory, int tmem); - static INT32 lfb_w(voodoo_device *vd, offs_t offset, UINT32 data, UINT32 mem_mask); - static INT32 texture_w(voodoo_device *vd, offs_t offset, UINT32 data); - static INT32 lfb_direct_w(voodoo_device *vd, offs_t offset, UINT32 data, UINT32 mem_mask); - static INT32 banshee_2d_w(voodoo_device *vd, offs_t offset, UINT32 data); + static int32_t lfb_w(voodoo_device *vd, offs_t offset, uint32_t data, uint32_t mem_mask); + static int32_t texture_w(voodoo_device *vd, offs_t offset, uint32_t data); + static int32_t lfb_direct_w(voodoo_device *vd, offs_t offset, uint32_t data, uint32_t mem_mask); + static int32_t banshee_2d_w(voodoo_device *vd, offs_t offset, uint32_t data); static void stall_cpu(voodoo_device *vd, int state, attotime current_time); static void soft_reset(voodoo_device *vd); static void recompute_video_memory(voodoo_device *vd); - static INT32 fastfill(voodoo_device *vd); - static INT32 triangle(voodoo_device *vd); - static INT32 begin_triangle(voodoo_device *vd); - static INT32 draw_triangle(voodoo_device *vd); - static INT32 setup_and_draw_triangle(voodoo_device *vd); - static INT32 triangle_create_work_item(voodoo_device* vd,UINT16 *drawbuf, int texcount); + static int32_t fastfill(voodoo_device *vd); + static int32_t triangle(voodoo_device *vd); + static int32_t begin_triangle(voodoo_device *vd); + static int32_t draw_triangle(voodoo_device *vd); + static int32_t setup_and_draw_triangle(voodoo_device *vd); + static int32_t triangle_create_work_item(voodoo_device* vd,uint16_t *drawbuf, int texcount); static raster_info *add_rasterizer(voodoo_device *vd, const raster_info *cinfo); static raster_info *find_rasterizer(voodoo_device *vd, int texcount); static void dump_rasterizer_stats(voodoo_device *vd); static void init_tmu_shared(tmu_shared_state *s); static void swap_buffers(voodoo_device *vd); - static UINT32 cmdfifo_execute(voodoo_device *vd, cmdfifo_info *f); - static INT32 cmdfifo_execute_if_ready(voodoo_device* vd, cmdfifo_info *f); - static void cmdfifo_w(voodoo_device *vd, cmdfifo_info *f, offs_t offset, UINT32 data); + static uint32_t cmdfifo_execute(voodoo_device *vd, cmdfifo_info *f); + static int32_t cmdfifo_execute_if_ready(voodoo_device* vd, cmdfifo_info *f); + static void cmdfifo_w(voodoo_device *vd, cmdfifo_info *f, offs_t offset, uint32_t data); - static void raster_fastfill(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); - static void raster_generic_0tmu(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); - static void raster_generic_1tmu(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); - static void raster_generic_2tmu(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); + static void raster_fastfill(void *dest, int32_t scanline, const poly_extent *extent, const void *extradata, int threadid); + static void raster_generic_0tmu(void *dest, int32_t scanline, const poly_extent *extent, const void *extradata, int threadid); + static void raster_generic_1tmu(void *dest, int32_t scanline, const poly_extent *extent, const void *extradata, int threadid); + static void raster_generic_2tmu(void *dest, int32_t scanline, const poly_extent *extent, const void *extradata, int threadid); #define RASTERIZER_HEADER(name) \ - static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, const void *extradata, int threadid); + static void raster_##name(void *destbase, int32_t y, const poly_extent *extent, const void *extradata, int threadid); #define RASTERIZER_ENTRY(fbzcp, alpha, fog, fbz, tex0, tex1) \ RASTERIZER_HEADER(fbzcp##_##alpha##_##fog##_##fbz##_##tex0##_##tex1) #include "voodoo_rast.hxx" @@ -1842,21 +1842,21 @@ protected: virtual void device_reset() override; public: // voodoo_state - UINT8 index; /* index of board */ + uint8_t index; /* index of board */ voodoo_device *device; /* pointer to our containing device */ screen_device *screen; /* the screen we are acting on */ device_t *cpu; /* the CPU we interact with */ - UINT8 vd_type; /* type of system */ - UINT8 chipmask; /* mask for which chips are available */ - UINT32 freq; /* operating frequency */ + uint8_t vd_type; /* type of system */ + uint8_t chipmask; /* mask for which chips are available */ + uint32_t freq; /* operating frequency */ attoseconds_t attoseconds_per_cycle; /* attoseconds per cycle */ - UINT32 extra_cycles; /* extra cycles not yet accounted for */ + uint32_t extra_cycles; /* extra cycles not yet accounted for */ int trigger; /* trigger used for stalling */ voodoo_reg reg[0x400]; /* raw registers */ - const UINT8 * regaccess; /* register access array */ + const uint8_t * regaccess; /* register access array */ const char *const * regnames; /* register names array */ - UINT8 alt_regmap; /* enable alternate register map? */ + uint8_t alt_regmap; /* enable alternate register map? */ pci_state pci; /* PCI state */ dac_state dac; /* DAC state */ @@ -1872,21 +1872,21 @@ public: voodoo_stats stats; /* internal statistics */ offs_t last_status_pc; /* PC of last status description (for logging) */ - UINT32 last_status_value; /* value of last status read (for logging) */ + uint32_t last_status_value; /* value of last status read (for logging) */ int next_rasterizer; /* next rasterizer index */ raster_info rasterizer[MAX_RASTERIZERS]; /* array of rasterizers */ raster_info * raster_hash[RASTER_HASH_SIZE]; /* hash table of rasterizers */ bool send_config; - UINT32 tmu_config; + uint32_t tmu_config; }; class voodoo_1_device : public voodoo_device { public: - voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -1897,7 +1897,7 @@ extern const device_type VOODOO_1; class voodoo_2_device : public voodoo_device { public: - voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_start() override; @@ -1908,8 +1908,8 @@ extern const device_type VOODOO_2; class voodoo_banshee_device : public voodoo_device { public: - voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - voodoo_banshee_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); + voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + voodoo_banshee_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); DECLARE_READ32_MEMBER( banshee_r ); DECLARE_WRITE32_MEMBER( banshee_w ); @@ -1933,7 +1933,7 @@ extern const device_type VOODOO_BANSHEE; class voodoo_3_device : public voodoo_banshee_device { public: - voodoo_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + voodoo_3_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/devices/video/voodoo_pci.cpp b/src/devices/video/voodoo_pci.cpp index 9426028589b..0fe6811eefa 100644 --- a/src/devices/video/voodoo_pci.cpp +++ b/src/devices/video/voodoo_pci.cpp @@ -73,7 +73,7 @@ DEVICE_ADDRESS_MAP_START(io_map, 32, voodoo_pci_device) AM_RANGE(0x000, 0x0ff) AM_DEVREADWRITE("voodoo", voodoo_banshee_device, banshee_io_r, banshee_io_w) ADDRESS_MAP_END -voodoo_pci_device::voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +voodoo_pci_device::voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pci_device(mconfig, VOODOO_PCI, "Voodoo PCI", tag, owner, clock, "voodoo_pci", __FILE__), m_voodoo(*this, "voodoo"), m_fbmem(2), m_tmumem0(0), m_tmumem1(0) { @@ -90,7 +90,7 @@ void voodoo_pci_device::device_start() voodoo_device::static_set_fbmem(*m_voodoo, m_fbmem); voodoo_device::static_set_tmumem(*m_voodoo, m_tmumem0, m_tmumem1); switch (m_type) { - //void set_ids(UINT32 main_id, UINT8 revision, UINT32 pclass, UINT32 subsystem_id); + //void set_ids(uint32_t main_id, uint8_t revision, uint32_t pclass, uint32_t subsystem_id); case TYPE_VOODOO_1: set_ids(0x121a0001, 0x02, 0x030000, 0x000000); break; @@ -127,21 +127,21 @@ void voodoo_pci_device::device_reset() pci_device::device_reset(); } -void voodoo_pci_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 voodoo_pci_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) { logerror("%s: map_extra\n", this->tag()); // Map VGA legacy access // Should really be dependent on voodoo VGAINIT0 bit 8 and IO base + 0xc3 bit 0 if (m_type>=TYPE_VOODOO_BANSHEE) { - UINT64 start = io_offset + 0x3b0; - UINT64 end = io_offset + 0x3df; + uint64_t start = io_offset + 0x3b0; + uint64_t end = io_offset + 0x3df; io_space->install_readwrite_handler(start, end, read32_delegate(FUNC(voodoo_pci_device::vga_r), this), write32_delegate(FUNC(voodoo_pci_device::vga_w), this)); - logerror("%s: map %s at %0*x-%0*x\n", this->tag(), "vga_r/w", 4, UINT32(start), 4, UINT32(end)); + logerror("%s: map %s at %0*x-%0*x\n", this->tag(), "vga_r/w", 4, uint32_t(start), 4, uint32_t(end)); } } -UINT32 voodoo_pci_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t voodoo_pci_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return m_voodoo->voodoo_update(bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } @@ -149,7 +149,7 @@ UINT32 voodoo_pci_device::screen_update(screen_device &screen, bitmap_rgb32 &bit // PCI bus control READ32_MEMBER (voodoo_pci_device::pcictrl_r) { - UINT32 result = m_pcictrl_reg[offset]; + uint32_t result = m_pcictrl_reg[offset]; if (1) logerror("%06X:voodoo_pci_device pcictrl_r from offset %02X = %08X & %08X\n", space.device().safe_pc(), offset*4, result, mem_mask); return result; @@ -172,7 +172,7 @@ WRITE32_MEMBER (voodoo_pci_device::pcictrl_w) // VGA legacy accesses READ32_MEMBER(voodoo_pci_device::vga_r) { - UINT32 result = 0; + uint32_t result = 0; if (ACCESSING_BITS_0_7) result |= downcast(m_voodoo.target())->banshee_vga_r(space, offset * 4 + 0 + 0xb0, mem_mask >> 0) << 0; if (ACCESSING_BITS_8_15) diff --git a/src/devices/video/voodoo_pci.h b/src/devices/video/voodoo_pci.h index 46660ff71d0..a15cd034612 100644 --- a/src/devices/video/voodoo_pci.h +++ b/src/devices/video/voodoo_pci.h @@ -21,12 +21,12 @@ class voodoo_pci_device : public pci_device { public: - voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - 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; + voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + 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; // optional information overrides virtual machine_config_constructor device_mconfig_additions() const override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual DECLARE_ADDRESS_MAP(config_map, 32) override; void set_cpu_tag(const char *tag); @@ -50,7 +50,7 @@ private: int m_fbmem, m_tmumem0, m_tmumem1; const char *m_cpu_tag; - UINT32 m_pcictrl_reg[0x10]; + uint32_t m_pcictrl_reg[0x10]; DECLARE_ADDRESS_MAP(voodoo_reg_map, 32); DECLARE_ADDRESS_MAP(banshee_reg_map, 32); DECLARE_ADDRESS_MAP(lfb_map, 32); diff --git a/src/devices/video/zeus2.cpp b/src/devices/video/zeus2.cpp index 0a7a1ddc448..f7229f96123 100644 --- a/src/devices/video/zeus2.cpp +++ b/src/devices/video/zeus2.cpp @@ -20,7 +20,7 @@ zeus2_renderer::zeus2_renderer(zeus2_device *state) const device_type ZEUS2 = &device_creator; -zeus2_device::zeus2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +zeus2_device::zeus2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ZEUS2, "Midway Zeus2", tag, owner, clock, "zeus2", __FILE__), m_vblank(*this), m_irq(*this), m_atlantis(0) { @@ -67,9 +67,9 @@ TIMER_CALLBACK_MEMBER(zeus2_device::int_timer_callback) void zeus2_device::device_start() { /* allocate memory for "wave" RAM */ - waveram = auto_alloc_array(machine(), UINT32, WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8/4); - m_frameColor = std::make_unique(WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 2); - m_frameDepth = std::make_unique(WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 2); + waveram = auto_alloc_array(machine(), uint32_t, WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 8/4); + m_frameColor = std::make_unique(WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 2); + m_frameDepth = std::make_unique(WAVERAM1_WIDTH * WAVERAM1_HEIGHT * 2); /* initialize polygon engine */ poly = auto_alloc(machine(), zeus2_renderer(this)); @@ -147,7 +147,7 @@ void zeus2_device::device_stop() myfile.open(fileName.c_str(), std::ios::out | std::ios::trunc | std::ios::binary); if (myfile.is_open()) - myfile.write((char *)waveram, WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 2 * sizeof(UINT32)); + myfile.write((char *)waveram, WAVERAM0_WIDTH * WAVERAM0_HEIGHT * 2 * sizeof(uint32_t)); myfile.close(); #endif @@ -194,7 +194,7 @@ void zeus2_device::device_stop() * *************************************/ -UINT32 zeus2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t zeus2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // Wait until configuration is completed before transfering anything if (m_zeusbase[0x30] == 0) @@ -213,10 +213,10 @@ UINT32 zeus2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, int xoffs = screen.visible_area().min_x; for (y = cliprect.min_y; y <= cliprect.max_y; y++) { - UINT32 *colorptr = &m_frameColor[frame_addr_from_xy(0, y, false)]; - UINT32 *dest = &bitmap.pix32(y); + uint32_t *colorptr = &m_frameColor[frame_addr_from_xy(0, y, false)]; + uint32_t *dest = &bitmap.pix32(y); for (x = cliprect.min_x; x <= cliprect.max_x; x++) { - UINT32 bufX = x - xoffs; + uint32_t bufX = x - xoffs; dest[x] = colorptr[bufX]; } } @@ -244,15 +244,15 @@ UINT32 zeus2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, int xoffs = screen.visible_area().min_x; for (y = cliprect.min_y; y <= cliprect.max_y; y++) { - UINT32 *dest = &bitmap.pix32(y); + uint32_t *dest = &bitmap.pix32(y); for (x = cliprect.min_x; x <= cliprect.max_x; x++) { if (1) { - UINT8 tex = get_texel_8bit((UINT64 *)base, y, x, texel_width); + uint8_t tex = get_texel_8bit((uint64_t *)base, y, x, texel_width); dest[x] = (tex << 16) | (tex << 8) | tex; } else { - dest[x] = ((UINT32 *)(base))[((y * WAVERAM1_WIDTH)) + x - xoffs]; + dest[x] = ((uint32_t *)(base))[((y * WAVERAM1_WIDTH)) + x - xoffs]; } } } @@ -276,7 +276,7 @@ READ32_MEMBER( zeus2_device::zeus2_r ) offset != 0x48 && offset != 0x49 && offset != 0x54 && offset != 0x58 && offset != 0x59 && offset != 0x5a); logit &= LOG_REGS; - UINT32 result = m_zeusbase[offset]; + uint32_t result = m_zeusbase[offset]; #if TRACK_REG_USAGE regread_count[offset]++; #endif @@ -342,9 +342,9 @@ WRITE32_MEMBER( zeus2_device::zeus2_w ) * *************************************/ -void zeus2_device::zeus2_register32_w(offs_t offset, UINT32 data, int logit) +void zeus2_device::zeus2_register32_w(offs_t offset, uint32_t data, int logit) { - UINT32 oldval = m_zeusbase[offset]; + uint32_t oldval = m_zeusbase[offset]; #if TRACK_REG_USAGE regwrite_count[offset]++; @@ -388,7 +388,7 @@ if (regdata_count[offset] < 256) * *************************************/ -void zeus2_device::zeus2_register_update(offs_t offset, UINT32 oldval, int logit) +void zeus2_device::zeus2_register_update(offs_t offset, uint32_t oldval, int logit) { /* handle the writes; only trigger on low accesses */ switch (offset) @@ -446,7 +446,7 @@ void zeus2_device::zeus2_register_update(offs_t offset, UINT32 oldval, int logit case 0x38: { - UINT32 temp = m_zeusbase[0x38]; + uint32_t temp = m_zeusbase[0x38]; m_zeusbase[0x38] = oldval; m_screen->update_partial(m_screen->vpos()); log_fifo = machine().input().code_pressed(KEYCODE_L); @@ -493,7 +493,7 @@ void zeus2_device::zeus2_register_update(offs_t offset, UINT32 oldval, int logit else if ((((m_zeusbase[0x40] >> 24) & 0xff) == 0x38) || (((m_zeusbase[0x40] >> 24) & 0xff) == 0x2d)) { // Direct command buffer - m_directCmd = (UINT32*)waveram0_ptr_from_expanded_addr(m_zeusbase[0x41]); + m_directCmd = (uint32_t*)waveram0_ptr_from_expanded_addr(m_zeusbase[0x41]); if (logit) logerror("\t-- direct cmd: %08X addr: %08X", m_zeusbase[0x40], m_zeusbase[0x41]); { @@ -521,8 +521,8 @@ void zeus2_device::zeus2_register_update(offs_t offset, UINT32 oldval, int logit } } if (1 && logit) { - UINT32 *wavePtr = (UINT32*)WAVERAM_BLOCK0(m_zeusbase[0x41]); - UINT32 waveData; + uint32_t *wavePtr = (uint32_t*)WAVERAM_BLOCK0(m_zeusbase[0x41]); + uint32_t waveData; int size = m_zeusbase[0x40] & 0xff; logerror("\n Setup size=%d [40]=%08X [41]=%08X [4e]=%08X\n", zeus_quad_size, m_zeusbase[0x40], m_zeusbase[0x41], m_zeusbase[0x4e]); for (int i = 0; i <= size; ++i) { @@ -616,8 +616,8 @@ void zeus2_device::zeus2_register_update(offs_t offset, UINT32 oldval, int logit // crusnexo: 0x007831FF => clear one frame // thegrid: 0x008831FF => clear one frame // thegrid: 0x0079FFFF => clear entire frame buffer at 51=0 then 51=00800000, only seen at initial tests in thegrid - UINT32 addr = frame_addr_from_phys_addr(m_zeusbase[0x51]); - UINT32 numBytes = (m_zeusbase[0x50] & 0xffff) + 1; + uint32_t addr = frame_addr_from_phys_addr(m_zeusbase[0x51]); + uint32_t numBytes = (m_zeusbase[0x50] & 0xffff) + 1; numBytes *= 0x40; if (m_zeusbase[0x50] & 0x10000) { addr = 0x0; @@ -673,7 +673,7 @@ void zeus2_device::zeus2_register_update(offs_t offset, UINT32 oldval, int logit /* thegrid uses this to write either left or right halves of pixels */ //if (m_zeusbase[0x50] == 0x00e90000) //{ - // UINT32 addr = frame_addr_from_reg51(); + // uint32_t addr = frame_addr_from_reg51(); // if (m_zeusbase[0x57] & 1) // m_frameColor[addr] = m_zeusbase[0x58]; // if (m_zeusbase[0x57] & 4) @@ -725,14 +725,14 @@ void zeus2_device::zeus2_register_update(offs_t offset, UINT32 oldval, int logit /************************************* * Load pal table from waveram *************************************/ -void zeus2_device::load_pal_table(void *wavePtr, UINT32 ctrl, int logit) +void zeus2_device::load_pal_table(void *wavePtr, uint32_t ctrl, int logit) { - UINT32 *tablePtr = m_pal_table; + uint32_t *tablePtr = m_pal_table; int count = ctrl & 0xff; - UINT32 cmd = ctrl >> 24; + uint32_t cmd = ctrl >> 24; if (cmd == 0x0) { // Convert from RGB555 - UINT16 *src = (UINT16*)wavePtr; + uint16_t *src = (uint16_t*)wavePtr; for (int i = 0; i <= count; ++i) { *tablePtr++ = conv_rgb555_to_rgb32(*src++); *tablePtr++ = conv_rgb555_to_rgb32(*src++); @@ -741,7 +741,7 @@ void zeus2_device::load_pal_table(void *wavePtr, UINT32 ctrl, int logit) } } else if (cmd==0xc0) { // The data seems to be in ARGB32 format - UINT32 *src = (UINT32*)wavePtr; + uint32_t *src = (uint32_t*)wavePtr; for (int i = 0; i <= count; ++i) { *tablePtr++ = *src++; *tablePtr++ = *src++; @@ -755,7 +755,7 @@ void zeus2_device::load_pal_table(void *wavePtr, UINT32 ctrl, int logit) * *************************************/ -void zeus2_device::zeus2_pointer_write(UINT8 which, UINT32 value, int logit) +void zeus2_device::zeus2_pointer_write(uint8_t which, uint32_t value, int logit) { #if TRACK_REG_USAGE subregwrite_count[which]++; @@ -826,7 +826,7 @@ if (subregdata_count[which] < 256) * Process the FIFO *************************************/ -int zeus2_device::zeus2_fifo_process(const UINT32 *data, int numwords) +int zeus2_device::zeus2_fifo_process(const uint32_t *data, int numwords) { int dataoffs = 0; @@ -999,10 +999,10 @@ int zeus2_device::zeus2_fifo_process(const UINT32 *data, int numwords) if (numwords < 3) return FALSE; // Direct write to frame buffer - m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((UINT16)data[1]); - m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((UINT16)(data[1] >> 16)); - m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((UINT16)data[2]); - m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((UINT16)(data[2] >> 16)); + m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((uint16_t)data[1]); + m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((uint16_t)(data[1] >> 16)); + m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((uint16_t)data[2]); + m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32((uint16_t)(data[2] >> 16)); } else if (numwords < 12) return FALSE; //print_fifo_command(data, numwords, "\n"); @@ -1026,12 +1026,12 @@ int zeus2_device::zeus2_fifo_process(const UINT32 *data, int numwords) * Draw a model in waveram *************************************/ -void zeus2_device::zeus2_draw_model(UINT32 baseaddr, UINT16 count, int logit) +void zeus2_device::zeus2_draw_model(uint32_t baseaddr, uint16_t count, int logit) { - UINT32 databuffer[32]; + uint32_t databuffer[32]; int databufcount = 0; int model_done = FALSE; - UINT32 texdata = 0; + uint32_t texdata = 0; if (logit) logerror(" -- model @ %08X, len %04X\n", baseaddr, count); @@ -1051,8 +1051,8 @@ void zeus2_device::zeus2_draw_model(UINT32 baseaddr, UINT16 count, int logit) for (curoffs = 0; curoffs <= count; curoffs++) { int countneeded = 2; - UINT8 cmd; - UINT8 subCmd; + uint8_t cmd; + uint8_t subCmd; /* accumulate 2 words of data */ databuffer[databufcount++] = WAVERAM_READ32(base, curoffs * 2 + 0); @@ -1118,9 +1118,9 @@ void zeus2_device::zeus2_draw_model(UINT32 baseaddr, UINT16 count, int logit) case 0x38: /* crusnexo/thegrid */ if (subCmd == 0x38) { // Direct commands from waveram buffer - //UINT32 cmdData[2]; + //uint32_t cmdData[2]; //for (int subIndex = 0; subIndex < 2; ++subIndex) { - // UINT32 offset = (databuffer[subIndex] & 0xff) * 6; + // uint32_t offset = (databuffer[subIndex] & 0xff) * 6; // //printf("directRead curoffs: 0x%X\n", curoffs); // for (int cmdIndex = 0; cmdIndex < 3; ++cmdIndex) { // cmdData[0] = m_directCmd[offset + cmdIndex * 2 + 0]; @@ -1140,8 +1140,8 @@ void zeus2_device::zeus2_draw_model(UINT32 baseaddr, UINT16 count, int logit) // } //} //void *palbase = waveram0_ptr_from_expanded_addr(m_zeusbase[0x41]); - //UINT8 texel = databuffer[0]; - //UINT32 color = WAVERAM_READ16(palbase, texel); + //uint8_t texel = databuffer[0]; + //uint32_t color = WAVERAM_READ16(palbase, texel); //m_frameDepth[m_renderAddr] = 0; //m_frameColor[m_renderAddr++] = conv_rgb555_to_rgb32(color); //texel = databuffer[1]; @@ -1187,7 +1187,7 @@ void zeus2_device::zeus2_draw_model(UINT32 baseaddr, UINT16 count, int logit) /************************************* * Draw a quad *************************************/ -void zeus2_renderer::zeus2_draw_quad(const UINT32 *databuffer, UINT32 texdata, int logit) +void zeus2_renderer::zeus2_draw_quad(const uint32_t *databuffer, uint32_t texdata, int logit) { z2_poly_vertex clipvert[8]; z2_poly_vertex vert[4]; @@ -1196,8 +1196,8 @@ void zeus2_renderer::zeus2_draw_quad(const UINT32 *databuffer, UINT32 texdata, i // int val1, val2, texwshift; int numverts; int i; - // INT16 normal[3]; - // INT32 rotnormal[3]; + // int16_t normal[3]; + // int32_t rotnormal[3]; if (logit) m_state->logerror("quad %d\n", m_state->zeus_quad_size); @@ -1262,53 +1262,53 @@ void zeus2_renderer::zeus2_draw_quad(const UINT32 *databuffer, UINT32 texdata, i if (m_state->m_atlantis) { // Atlantis quad 14 texdata = databuffer[1]; - vert[0].x = (INT16)databuffer[2]; - vert[0].y = (INT16)databuffer[3]; - vert[0].p[0] = (INT16)databuffer[4]; + vert[0].x = (int16_t)databuffer[2]; + vert[0].y = (int16_t)databuffer[3]; + vert[0].p[0] = (int16_t)databuffer[4]; vert[0].p[1] = (databuffer[5] >> 0) & 0xff; vert[0].p[2] = (databuffer[5] >> 8) & 0xff; - vert[1].x = (INT16)(databuffer[2] >> 16); - vert[1].y = (INT16)(databuffer[3] >> 16); - vert[1].p[0] = (INT16)(databuffer[4] >> 16); + vert[1].x = (int16_t)(databuffer[2] >> 16); + vert[1].y = (int16_t)(databuffer[3] >> 16); + vert[1].p[0] = (int16_t)(databuffer[4] >> 16); vert[1].p[1] = (databuffer[5] >> 16) & 0xff; vert[1].p[2] = (databuffer[5] >> 24) & 0xff; - vert[2].x = (INT16)databuffer[6]; - vert[2].y = (INT16)databuffer[7]; - vert[2].p[0] = (INT16)databuffer[8]; + vert[2].x = (int16_t)databuffer[6]; + vert[2].y = (int16_t)databuffer[7]; + vert[2].p[0] = (int16_t)databuffer[8]; vert[2].p[1] = (databuffer[9] >> 0) & 0xff; vert[2].p[2] = (databuffer[9] >> 8) & 0xff; - vert[3].x = (INT16)(databuffer[6] >> 16); - vert[3].y = (INT16)(databuffer[7] >> 16); - vert[3].p[0] = (INT16)(databuffer[8] >> 16); + vert[3].x = (int16_t)(databuffer[6] >> 16); + vert[3].y = (int16_t)(databuffer[7] >> 16); + vert[3].p[0] = (int16_t)(databuffer[8] >> 16); vert[3].p[1] = (databuffer[9] >> 16) & 0xff; vert[3].p[2] = (databuffer[9] >> 24) & 0xff; } else { //printf("R40: %06X\n", m_state->m_renderRegs[0x40]); - vert[0].x = (INT16)databuffer[2]; - vert[0].y = (INT16)databuffer[3]; - vert[0].p[0] = (INT16)databuffer[6]; + vert[0].x = (int16_t)databuffer[2]; + vert[0].y = (int16_t)databuffer[3]; + vert[0].p[0] = (int16_t)databuffer[6]; vert[0].p[1] = (databuffer[1] >> 2) & 0xff; vert[0].p[2] = (databuffer[1] >> 18) & 0xff; - vert[1].x = (INT16)(databuffer[2] >> 16); - vert[1].y = (INT16)(databuffer[3] >> 16); - vert[1].p[0] = (INT16)(databuffer[6] >> 16); + vert[1].x = (int16_t)(databuffer[2] >> 16); + vert[1].y = (int16_t)(databuffer[3] >> 16); + vert[1].p[0] = (int16_t)(databuffer[6] >> 16); vert[1].p[1] = (databuffer[4] >> 2) & 0xff; vert[1].p[2] = (databuffer[4] >> 12) & 0xff; - vert[2].x = (INT16)databuffer[8]; - vert[2].y = (INT16)databuffer[9]; - vert[2].p[0] = (INT16)databuffer[7]; + vert[2].x = (int16_t)databuffer[8]; + vert[2].y = (int16_t)databuffer[9]; + vert[2].p[0] = (int16_t)databuffer[7]; vert[2].p[1] = (databuffer[4] >> 22) & 0xff; vert[2].p[2] = (databuffer[5] >> 2) & 0xff; - vert[3].x = (INT16)(databuffer[8] >> 16); - vert[3].y = (INT16)(databuffer[9] >> 16); - vert[3].p[0] = (INT16)(databuffer[7] >> 16); + vert[3].x = (int16_t)(databuffer[8] >> 16); + vert[3].y = (int16_t)(databuffer[9] >> 16); + vert[3].p[0] = (int16_t)(databuffer[7] >> 16); vert[3].p[1] = (databuffer[5] >> 12) & 0xff; vert[3].p[2] = (databuffer[5] >> 22) & 0xff; } @@ -1317,43 +1317,43 @@ void zeus2_renderer::zeus2_draw_quad(const UINT32 *databuffer, UINT32 texdata, i if (m_state->zeus_quad_size == 14) { // buffer 10-13 ???? 00000000 1FF7FC00 00000000 1FF7FC00 -- mwskinsa quad 14 /* 10:13 16 bit coordinates */ - unknown[0] = (INT16)databuffer[10]; - unknown[1] = (INT16)(databuffer[10] >> 16); - unknown[2] = (INT16)databuffer[11]; - unknown[3] = (INT16)(databuffer[11] >> 16); - unknown[4] = (INT16)databuffer[12]; - unknown[5] = (INT16)(databuffer[12] >> 16); - unknown[6] = (INT16)databuffer[13]; - unknown[7] = (INT16)(databuffer[13] >> 16); + unknown[0] = (int16_t)databuffer[10]; + unknown[1] = (int16_t)(databuffer[10] >> 16); + unknown[2] = (int16_t)databuffer[11]; + unknown[3] = (int16_t)(databuffer[11] >> 16); + unknown[4] = (int16_t)databuffer[12]; + unknown[5] = (int16_t)(databuffer[12] >> 16); + unknown[6] = (int16_t)databuffer[13]; + unknown[7] = (int16_t)(databuffer[13] >> 16); unknownFloat[0] = m_state->convert_float(databuffer[10]); unknownFloat[1] = m_state->convert_float(databuffer[11]); unknownFloat[2] = m_state->convert_float(databuffer[12]); unknownFloat[3] = m_state->convert_float(databuffer[13]); } /* - vert[0].x = (INT16)databuffer[1]; - vert[0].y = (INT16)databuffer[3]; - vert[0].p[0] = (INT16)databuffer[5]; - vert[0].p[1] = (UINT16)databuffer[2]; - vert[0].p[2] = (UINT16)(databuffer[2] >> 16); - - vert[1].x = (INT16)(databuffer[1] >> 16); - vert[1].y = (INT16)(databuffer[3] >> 16); - vert[1].p[0] = (INT16)(databuffer[5] >> 16); - vert[1].p[1] = (UINT16)databuffer[4]; - vert[1].p[2] = (UINT16)(databuffer[4] >> 16); - - vert[2].x = (INT16)databuffer[9]; - vert[2].y = (INT16)databuffer[10]; - vert[2].p[0] = (INT16)databuffer[11]; - vert[2].p[1] = (UINT16)databuffer[6]; - vert[2].p[2] = (UINT16)(databuffer[6] >> 16); - - vert[3].x = (INT16)(databuffer[9] >> 16); - vert[3].y = (INT16)(databuffer[10] >> 16); - vert[3].p[0] = (INT16)(databuffer[11] >> 16); - vert[3].p[1] = (UINT16)databuffer[7]; - vert[3].p[2] = (UINT16)(databuffer[7] >> 16); + vert[0].x = (int16_t)databuffer[1]; + vert[0].y = (int16_t)databuffer[3]; + vert[0].p[0] = (int16_t)databuffer[5]; + vert[0].p[1] = (uint16_t)databuffer[2]; + vert[0].p[2] = (uint16_t)(databuffer[2] >> 16); + + vert[1].x = (int16_t)(databuffer[1] >> 16); + vert[1].y = (int16_t)(databuffer[3] >> 16); + vert[1].p[0] = (int16_t)(databuffer[5] >> 16); + vert[1].p[1] = (uint16_t)databuffer[4]; + vert[1].p[2] = (uint16_t)(databuffer[4] >> 16); + + vert[2].x = (int16_t)databuffer[9]; + vert[2].y = (int16_t)databuffer[10]; + vert[2].p[0] = (int16_t)databuffer[11]; + vert[2].p[1] = (uint16_t)databuffer[6]; + vert[2].p[2] = (uint16_t)(databuffer[6] >> 16); + + vert[3].x = (int16_t)(databuffer[9] >> 16); + vert[3].y = (int16_t)(databuffer[10] >> 16); + vert[3].p[0] = (int16_t)(databuffer[11] >> 16); + vert[3].p[1] = (uint16_t)databuffer[7]; + vert[3].p[2] = (uint16_t)(databuffer[7] >> 16); */ int logextra = 1; @@ -1396,7 +1396,7 @@ void zeus2_renderer::zeus2_draw_quad(const UINT32 *databuffer, UINT32 texdata, i // back face cull using polygon normal and first vertex if (1 && i == 0) { - INT8 normal[3]; + int8_t normal[3]; float rotnormal[3]; normal[0] = databuffer[0] >> 0; @@ -1522,7 +1522,7 @@ void zeus2_renderer::zeus2_draw_quad(const UINT32 *databuffer, UINT32 texdata, i //default: //{ - // static UINT8 hits[0x10000]; + // static uint8_t hits[0x10000]; // if (!hits[(texdata & 0xffff)]) // { // hits[(texdata & 0xffff)] = 1; @@ -1563,31 +1563,31 @@ void zeus2_renderer::zeus2_draw_quad(const UINT32 *databuffer, UINT32 texdata, i * Rasterizers *************************************/ -void zeus2_renderer::render_poly_8bit(INT32 scanline, const extent_t& extent, const zeus2_poly_extra_data& object, int threadid) +void zeus2_renderer::render_poly_8bit(int32_t scanline, const extent_t& extent, const zeus2_poly_extra_data& object, int threadid) { - INT32 curz = extent.param[0].start; - INT32 curu = extent.param[1].start; - INT32 curv = extent.param[2].start; - // INT32 curi = extent.param[3].start; - INT32 dzdx = extent.param[0].dpdx; - INT32 dudx = extent.param[1].dpdx; - INT32 dvdx = extent.param[2].dpdx; - // INT32 didx = extent.param[3].dpdx; + int32_t curz = extent.param[0].start; + int32_t curu = extent.param[1].start; + int32_t curv = extent.param[2].start; + // int32_t curi = extent.param[3].start; + int32_t dzdx = extent.param[0].dpdx; + int32_t dudx = extent.param[1].dpdx; + int32_t dvdx = extent.param[2].dpdx; + // int32_t didx = extent.param[3].dpdx; const void *texbase = object.texbase; //const void *palbase = object.palbase; - UINT16 transcolor = object.transcolor; + uint16_t transcolor = object.transcolor; int texwidth = object.texwidth; int x; - UINT32 addr = m_state->frame_addr_from_xy(0, scanline, true); - UINT16 *depthptr = &m_state->m_frameDepth[addr]; - UINT32 *colorptr = &m_state->m_frameColor[addr]; + uint32_t addr = m_state->frame_addr_from_xy(0, scanline, true); + uint16_t *depthptr = &m_state->m_frameDepth[addr]; + uint32_t *colorptr = &m_state->m_frameColor[addr]; for (x = extent.startx; x < extent.stopx; x++) { bool depth_pass = true; if (object.depth_test_enable) { - //UINT16 *depthptr = WAVERAM_PTRDEPTH(m_state->zeus_renderbase, scanline, x); - INT32 depth = (curz >> 16) + object.zoffset; + //uint16_t *depthptr = WAVERAM_PTRDEPTH(m_state->zeus_renderbase, scanline, x); + int32_t depth = (curz >> 16) + object.zoffset; //if (depth > 0x7fff) depth = 0x7fff; if (depth > 0xffff) depth = 0xffff; if (depth < 0 || depth > depthptr[x]) @@ -1600,22 +1600,22 @@ void zeus2_renderer::render_poly_8bit(INT32 scanline, const extent_t& extent, co int v0 = (curv >> 8);// & 255; int u1 = (u0 + 1); int v1 = (v0 + 1); - UINT8 texel0 = m_state->get_texel_8bit(texbase, v0, u0, texwidth); + uint8_t texel0 = m_state->get_texel_8bit(texbase, v0, u0, texwidth); if (texel0 == object.transcolor) continue; - UINT8 texel1 = m_state->get_texel_8bit(texbase, v0, u1, texwidth); - UINT8 texel2 = m_state->get_texel_8bit(texbase, v1, u0, texwidth); - UINT8 texel3 = m_state->get_texel_8bit(texbase, v1, u1, texwidth); + uint8_t texel1 = m_state->get_texel_8bit(texbase, v0, u1, texwidth); + uint8_t texel2 = m_state->get_texel_8bit(texbase, v1, u0, texwidth); + uint8_t texel3 = m_state->get_texel_8bit(texbase, v1, u1, texwidth); if (texel0 != transcolor) { - UINT32 color0 = m_state->m_pal_table[texel0]; - UINT32 color1 = m_state->m_pal_table[texel1]; - UINT32 color2 = m_state->m_pal_table[texel2]; - UINT32 color3 = m_state->m_pal_table[texel3]; - //UINT32 color0 = WAVERAM_READ16(palbase, texel0); - //UINT32 color1 = WAVERAM_READ16(palbase, texel1); - //UINT32 color2 = WAVERAM_READ16(palbase, texel2); - //UINT32 color3 = WAVERAM_READ16(palbase, texel3); + uint32_t color0 = m_state->m_pal_table[texel0]; + uint32_t color1 = m_state->m_pal_table[texel1]; + uint32_t color2 = m_state->m_pal_table[texel2]; + uint32_t color3 = m_state->m_pal_table[texel3]; + //uint32_t color0 = WAVERAM_READ16(palbase, texel0); + //uint32_t color1 = WAVERAM_READ16(palbase, texel1); + //uint32_t color2 = WAVERAM_READ16(palbase, texel2); + //uint32_t color3 = WAVERAM_READ16(palbase, texel3); //color0 = ((color0 & 0x7c00) << 9) | ((color0 & 0x3e0) << 6) | ((color0 & 0x1f) << 3); //color1 = ((color1 & 0x7c00) << 9) | ((color1 & 0x3e0) << 6) | ((color1 & 0x1f) << 3); //color2 = ((color2 & 0x7c00) << 9) | ((color2 & 0x3e0) << 6) | ((color2 & 0x1f) << 3); @@ -1637,7 +1637,7 @@ void zeus2_renderer::render_poly_8bit(INT32 scanline, const extent_t& extent, co * Debugging tools *************************************/ -void zeus2_device::log_fifo_command(const UINT32 *data, int numwords, const char *suffix) +void zeus2_device::log_fifo_command(const uint32_t *data, int numwords, const char *suffix) { int wordnum; logerror("Zeus cmd %02X :", data[0] >> 24); @@ -1646,7 +1646,7 @@ void zeus2_device::log_fifo_command(const UINT32 *data, int numwords, const char logerror("%s", suffix); } -void zeus2_device::print_fifo_command(const UINT32 *data, int numwords, const char *suffix) +void zeus2_device::print_fifo_command(const uint32_t *data, int numwords, const char *suffix) { int wordnum; printf("Zeus cmd %02X :", data[0] >> 24); @@ -1655,7 +1655,7 @@ void zeus2_device::print_fifo_command(const UINT32 *data, int numwords, const ch printf("%s", suffix); } -void zeus2_device::log_render_info(UINT32 texdata) +void zeus2_device::log_render_info(uint32_t texdata) { logerror("-- RMode0 R40 = %08X texdata = %08X", m_renderRegs[0x40], texdata); logerror("\n-- RMode1 "); diff --git a/src/devices/video/zeus2.h b/src/devices/video/zeus2.h index c4bcda80db3..9df29cfc830 100644 --- a/src/devices/video/zeus2.h +++ b/src/devices/video/zeus2.h @@ -37,13 +37,13 @@ struct zeus2_poly_extra_data { const void * palbase; const void * texbase; - UINT16 solidcolor; - INT16 zoffset; - UINT16 transcolor; - UINT16 texwidth; - UINT16 color; - UINT32 alpha; - UINT32 ctrl_word; + uint16_t solidcolor; + int16_t zoffset; + uint16_t transcolor; + uint16_t texwidth; + uint16_t color; + uint32_t alpha; + uint32_t ctrl_word; bool blend_enable; bool depth_test_enable; bool depth_write_enable; @@ -53,18 +53,18 @@ struct zeus2_poly_extra_data * Macros *************************************/ -#define WAVERAM_BLOCK0(blocknum) ((void *)((UINT8 *)waveram + 8 * (blocknum))) -#define WAVERAM_BLOCK0_EXT(blocknum) ((void *)((UINT8 *)m_state->waveram + 8 * (blocknum))) +#define WAVERAM_BLOCK0(blocknum) ((void *)((uint8_t *)waveram + 8 * (blocknum))) +#define WAVERAM_BLOCK0_EXT(blocknum) ((void *)((uint8_t *)m_state->waveram + 8 * (blocknum))) -#define WAVERAM_PTR8(base, bytenum) ((UINT8 *)(base) + BYTE4_XOR_LE(bytenum)) +#define WAVERAM_PTR8(base, bytenum) ((uint8_t *)(base) + BYTE4_XOR_LE(bytenum)) #define WAVERAM_READ8(base, bytenum) (*WAVERAM_PTR8(base, bytenum)) #define WAVERAM_WRITE8(base, bytenum, data) do { *WAVERAM_PTR8(base, bytenum) = (data); } while (0) -#define WAVERAM_PTR16(base, wordnum) ((UINT16 *)(base) + BYTE_XOR_LE(wordnum)) +#define WAVERAM_PTR16(base, wordnum) ((uint16_t *)(base) + BYTE_XOR_LE(wordnum)) #define WAVERAM_READ16(base, wordnum) (*WAVERAM_PTR16(base, wordnum)) #define WAVERAM_WRITE16(base, wordnum, data) do { *WAVERAM_PTR16(base, wordnum) = (data); } while (0) -#define WAVERAM_PTR32(base, dwordnum) ((UINT32 *)(base) + (dwordnum)) +#define WAVERAM_PTR32(base, dwordnum) ((uint32_t *)(base) + (dwordnum)) #define WAVERAM_READ32(base, dwordnum) (*WAVERAM_PTR32(base, dwordnum)) #define WAVERAM_WRITE32(base, dwordnum, data) do { *WAVERAM_PTR32(base, dwordnum) = (data); } while (0) @@ -78,9 +78,9 @@ class zeus2_renderer : public poly_manager m_frameColor; - std::unique_ptr m_frameDepth; - UINT32 m_pal_table[0x100]; + uint32_t *waveram; + std::unique_ptr m_frameColor; + std::unique_ptr m_frameDepth; + uint32_t m_pal_table[0x100]; emu_timer *int_timer; emu_timer *vblank_timer; @@ -156,25 +156,25 @@ protected: private: TIMER_CALLBACK_MEMBER(int_timer_callback); - void zeus2_register32_w(offs_t offset, UINT32 data, int logit); - void zeus2_register_update(offs_t offset, UINT32 oldval, int logit); - int zeus2_fifo_process(const UINT32 *data, int numwords); - void zeus2_pointer_write(UINT8 which, UINT32 value, int logit); - void load_pal_table(void *wavePtr, UINT32 ctrl, int logit); - void zeus2_draw_model(UINT32 baseaddr, UINT16 count, int logit); - void log_fifo_command(const UINT32 *data, int numwords, const char *suffix); - void print_fifo_command(const UINT32 *data, int numwords, const char *suffix); - void log_render_info(UINT32 texdata); + void zeus2_register32_w(offs_t offset, uint32_t data, int logit); + void zeus2_register_update(offs_t offset, uint32_t oldval, int logit); + int zeus2_fifo_process(const uint32_t *data, int numwords); + void zeus2_pointer_write(uint8_t which, uint32_t value, int logit); + void load_pal_table(void *wavePtr, uint32_t ctrl, int logit); + void zeus2_draw_model(uint32_t baseaddr, uint16_t count, int logit); + void log_fifo_command(const uint32_t *data, int numwords, const char *suffix); + void print_fifo_command(const uint32_t *data, int numwords, const char *suffix); + void log_render_info(uint32_t texdata); /************************************* * Member variables *************************************/ - UINT8 log_fifo; + uint8_t log_fifo; - UINT32 zeus_fifo[20]; - UINT8 zeus_fifo_words; + uint32_t zeus_fifo[20]; + uint8_t zeus_fifo_words; - UINT32 m_fill_color; - UINT32 m_fill_depth; + uint32_t m_fill_color; + uint32_t m_fill_depth; int m_yScale; @@ -183,7 +183,7 @@ private: struct reg_info { struct reg_info *next; - UINT32 value; + uint32_t value; }; reg_info *regdata[0x80]; @@ -198,7 +198,7 @@ public: /************************************* * Inlines for block addressing *************************************/ - inline float convert_float(UINT32 val) + inline float convert_float(uint32_t val) { if (m_atlantis) { return reinterpret_cast(val); @@ -207,35 +207,35 @@ public: return tms3203x_device::fp_to_float(val); } - inline UINT32 frame_addr_from_xy(UINT32 x, UINT32 y, bool render) + inline uint32_t frame_addr_from_xy(uint32_t x, uint32_t y, bool render) { - UINT32 addr = render ? frame_addr_from_phys_addr(m_renderRegs[0x4] << (15 + m_yScale)) + uint32_t addr = render ? frame_addr_from_phys_addr(m_renderRegs[0x4] << (15 + m_yScale)) : frame_addr_from_phys_addr((m_zeusbase[0x38] >> 1) << (m_yScale << 1)); addr += (y << (9 + m_yScale)) + x; return addr; } // Convert 0xRRRRCCCC to frame buffer addresss - //inline UINT32 frame_addr_from_expanded_addr(UINT32 addr) + //inline uint32_t frame_addr_from_expanded_addr(uint32_t addr) //{ // return (((addr & 0x3ff0000) >> (16 - 9 + 1)) | (addr & 0x1ff)) << 1; //} // Convert Physical 0xRRRRCCCC to frame buffer addresss // Based on address reg 51 (no scaling) - inline UINT32 frame_addr_from_phys_addr(UINT32 physAddr) + inline uint32_t frame_addr_from_phys_addr(uint32_t physAddr) { - UINT32 addr = (((physAddr & 0x3ff0000) >> (16 - 9)) | (physAddr & 0x1ff)) << 1; + uint32_t addr = (((physAddr & 0x3ff0000) >> (16 - 9)) | (physAddr & 0x1ff)) << 1; return addr; } // Read from frame buffer inline void frame_read() { - UINT32 addr = frame_addr_from_phys_addr(m_zeusbase[0x51]); + uint32_t addr = frame_addr_from_phys_addr(m_zeusbase[0x51]); m_zeusbase[0x58] = m_frameColor[addr]; m_zeusbase[0x59] = m_frameColor[addr + 1]; - m_zeusbase[0x5a] = *(UINT32*)&m_frameDepth[addr]; + m_zeusbase[0x5a] = *(uint32_t*)&m_frameDepth[addr]; if (m_zeusbase[0x5e] & 0x40) { m_zeusbase[0x51]++; @@ -247,7 +247,7 @@ public: // Write to frame buffer inline void frame_write() { - UINT32 addr = frame_addr_from_phys_addr(m_zeusbase[0x51]); + uint32_t addr = frame_addr_from_phys_addr(m_zeusbase[0x51]); if (m_zeusbase[0x57] & 0x1) m_frameColor[addr] = m_zeusbase[0x58]; if (m_zeusbase[0x5e] & 0x20) { @@ -258,7 +258,7 @@ public: if (m_zeusbase[0x57] & 0x4) m_frameColor[addr + 1] = m_zeusbase[0x59]; if (m_zeusbase[0x57] & 0x10) - *(UINT32*)&m_frameDepth[addr] = m_zeusbase[0x5a]; + *(uint32_t*)&m_frameDepth[addr] = m_zeusbase[0x5a]; } if (m_zeusbase[0x5e] & 0x40) @@ -269,16 +269,16 @@ public: } } - inline void *waveram0_ptr_from_expanded_addr(UINT32 addr) + inline void *waveram0_ptr_from_expanded_addr(uint32_t addr) { - UINT32 blocknum = (addr % WAVERAM0_WIDTH) + ((addr >> 16) % WAVERAM0_HEIGHT) * WAVERAM0_WIDTH; + uint32_t blocknum = (addr % WAVERAM0_WIDTH) + ((addr >> 16) % WAVERAM0_HEIGHT) * WAVERAM0_WIDTH; return WAVERAM_BLOCK0(blocknum); } #ifdef UNUSED_FUNCTION - inline void *waveram0_ptr_from_texture_addr(UINT32 addr, int width) + inline void *waveram0_ptr_from_texture_addr(uint32_t addr, int width) { - UINT32 blocknum = ((addr & ~1) * width) / 8; + uint32_t blocknum = ((addr & ~1) * width) / 8; return WAVERAM_BLOCK0(blocknum); } #endif @@ -286,13 +286,13 @@ public: /************************************* * Inlines for rendering *************************************/ - inline UINT32 conv_rgb555_to_rgb32(UINT16 color) + inline uint32_t conv_rgb555_to_rgb32(uint16_t color) { return ((color & 0x7c00) << 9) | ((color & 0x3e0) << 6) | ((color & 0x1f) << 3); } #ifdef UNUSED_FUNCTION - inline void WAVERAM_plot(int y, int x, UINT32 color) + inline void WAVERAM_plot(int y, int x, uint32_t color) { if (zeus_cliprect.contains(x, y)) WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); @@ -300,7 +300,7 @@ public: #endif #ifdef UNUSED_FUNCTION - inline void waveram_plot_depth(int y, int x, UINT32 color, UINT16 depth) + inline void waveram_plot_depth(int y, int x, uint32_t color, uint16_t depth) { if (zeus_cliprect.contains(x, y)) { @@ -311,11 +311,11 @@ public: #endif #ifdef UNUSED_FUNCTION - inline void waveram_plot_check_depth(int y, int x, UINT32 color, UINT16 depth) + inline void waveram_plot_check_depth(int y, int x, uint32_t color, uint16_t depth) { if (zeus_cliprect.contains(x, y)) { - UINT16 *depthptr = WAVERAM_PTRDEPTH(zeus_renderbase, y, x); + uint16_t *depthptr = WAVERAM_PTRDEPTH(zeus_renderbase, y, x); if (depth <= *depthptr) { WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); @@ -326,11 +326,11 @@ public: #endif #ifdef UNUSED_FUNCTION - inline void waveram_plot_check_depth_nowrite(int y, int x, UINT32 color, UINT16 depth) + inline void waveram_plot_check_depth_nowrite(int y, int x, uint32_t color, uint16_t depth) { if (zeus_cliprect.contains(x, y)) { - UINT16 *depthptr = WAVERAM_PTRDEPTH(zeus_renderbase, y, x); + uint16_t *depthptr = WAVERAM_PTRDEPTH(zeus_renderbase, y, x); if (depth <= *depthptr) WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); } @@ -339,16 +339,16 @@ public: /************************************* * Inlines for texel accesses *************************************/ - inline UINT8 get_texel_8bit(const void *base, int y, int x, int width) + inline uint8_t get_texel_8bit(const void *base, int y, int x, int width) { - UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 4) << 3) + ((y & 1) << 2) + (x & 3); + uint32_t byteoffs = (y / 2) * (width * 2) + ((x / 4) << 3) + ((y & 1) << 2) + (x & 3); return WAVERAM_READ8(base, byteoffs); } #ifdef UNUSED_FUNCTION - inline UINT8 get_texel_4bit(const void *base, int y, int x, int width) + inline uint8_t get_texel_4bit(const void *base, int y, int x, int width) { - UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 8) << 3) + ((y & 1) << 2) + ((x / 2) & 3); + uint32_t byteoffs = (y / 2) * (width * 2) + ((x / 8) << 3) + ((y & 1) << 2) + ((x / 2) & 3); return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f; } #endif diff --git a/src/emu/addrmap.cpp b/src/emu/addrmap.cpp index a8fe7281d1d..4cba3760c27 100644 --- a/src/emu/addrmap.cpp +++ b/src/emu/addrmap.cpp @@ -78,7 +78,7 @@ void address_map_entry::set_mask(offs_t _mask) // retrieve a submap from a device //------------------------------------------------- -void address_map_entry::set_submap(const char *tag, address_map_delegate func, int bits, UINT64 mask) +void address_map_entry::set_submap(const char *tag, address_map_delegate func, int bits, uint64_t mask) { if(!bits) bits = m_map.m_databits; @@ -101,7 +101,7 @@ void address_map_entry::set_submap(const char *tag, address_map_delegate func, i // 8-bit read/write handlers //------------------------------------------------- -void address_map_entry::internal_set_handler(read8_delegate func, UINT64 unitmask) +void address_map_entry::internal_set_handler(read8_delegate func, uint64_t unitmask) { assert(!func.isnull()); assert(unitmask_is_appropriate(8, unitmask, func.name())); @@ -113,7 +113,7 @@ void address_map_entry::internal_set_handler(read8_delegate func, UINT64 unitmas } -void address_map_entry::internal_set_handler(write8_delegate func, UINT64 unitmask) +void address_map_entry::internal_set_handler(write8_delegate func, uint64_t unitmask) { assert(!func.isnull()); assert(unitmask_is_appropriate(8, unitmask, func.name())); @@ -125,7 +125,7 @@ void address_map_entry::internal_set_handler(write8_delegate func, UINT64 unitma } -void address_map_entry::internal_set_handler(read8_delegate rfunc, write8_delegate wfunc, UINT64 unitmask) +void address_map_entry::internal_set_handler(read8_delegate rfunc, write8_delegate wfunc, uint64_t unitmask) { internal_set_handler(rfunc, unitmask); internal_set_handler(wfunc, unitmask); @@ -137,7 +137,7 @@ void address_map_entry::internal_set_handler(read8_delegate rfunc, write8_delega // 16-bit read/write handlers //------------------------------------------------- -void address_map_entry::internal_set_handler(read16_delegate func, UINT64 unitmask) +void address_map_entry::internal_set_handler(read16_delegate func, uint64_t unitmask) { assert(!func.isnull()); assert(unitmask_is_appropriate(16, unitmask, func.name())); @@ -149,7 +149,7 @@ void address_map_entry::internal_set_handler(read16_delegate func, UINT64 unitma } -void address_map_entry::internal_set_handler(write16_delegate func, UINT64 unitmask) +void address_map_entry::internal_set_handler(write16_delegate func, uint64_t unitmask) { assert(!func.isnull()); assert(unitmask_is_appropriate(16, unitmask, func.name())); @@ -161,7 +161,7 @@ void address_map_entry::internal_set_handler(write16_delegate func, UINT64 unitm } -void address_map_entry::internal_set_handler(read16_delegate rfunc, write16_delegate wfunc, UINT64 unitmask) +void address_map_entry::internal_set_handler(read16_delegate rfunc, write16_delegate wfunc, uint64_t unitmask) { internal_set_handler(rfunc, unitmask); internal_set_handler(wfunc, unitmask); @@ -173,7 +173,7 @@ void address_map_entry::internal_set_handler(read16_delegate rfunc, write16_dele // 32-bit read/write handlers //------------------------------------------------- -void address_map_entry::internal_set_handler(read32_delegate func, UINT64 unitmask) +void address_map_entry::internal_set_handler(read32_delegate func, uint64_t unitmask) { assert(!func.isnull()); assert(unitmask_is_appropriate(32, unitmask, func.name())); @@ -185,7 +185,7 @@ void address_map_entry::internal_set_handler(read32_delegate func, UINT64 unitma } -void address_map_entry::internal_set_handler(write32_delegate func, UINT64 unitmask) +void address_map_entry::internal_set_handler(write32_delegate func, uint64_t unitmask) { assert(!func.isnull()); assert(unitmask_is_appropriate(32, unitmask, func.name())); @@ -197,7 +197,7 @@ void address_map_entry::internal_set_handler(write32_delegate func, UINT64 unitm } -void address_map_entry::internal_set_handler(read32_delegate rfunc, write32_delegate wfunc, UINT64 unitmask) +void address_map_entry::internal_set_handler(read32_delegate rfunc, write32_delegate wfunc, uint64_t unitmask) { internal_set_handler(rfunc, unitmask); internal_set_handler(wfunc, unitmask); @@ -209,7 +209,7 @@ void address_map_entry::internal_set_handler(read32_delegate rfunc, write32_dele // 64-bit read/write handlers //------------------------------------------------- -void address_map_entry::internal_set_handler(read64_delegate func, UINT64 unitmask) +void address_map_entry::internal_set_handler(read64_delegate func, uint64_t unitmask) { assert(!func.isnull()); assert(unitmask_is_appropriate(64, unitmask, func.name())); @@ -221,7 +221,7 @@ void address_map_entry::internal_set_handler(read64_delegate func, UINT64 unitma } -void address_map_entry::internal_set_handler(write64_delegate func, UINT64 unitmask) +void address_map_entry::internal_set_handler(write64_delegate func, uint64_t unitmask) { assert(!func.isnull()); assert(unitmask_is_appropriate(64, unitmask, func.name())); @@ -233,7 +233,7 @@ void address_map_entry::internal_set_handler(write64_delegate func, UINT64 unitm } -void address_map_entry::internal_set_handler(read64_delegate rfunc, write64_delegate wfunc, UINT64 unitmask) +void address_map_entry::internal_set_handler(read64_delegate rfunc, write64_delegate wfunc, uint64_t unitmask) { internal_set_handler(rfunc, unitmask); internal_set_handler(wfunc, unitmask); @@ -259,7 +259,7 @@ void address_map_entry::set_handler(setoffset_delegate func) // provided unitmask is valid and expected //------------------------------------------------- -bool address_map_entry::unitmask_is_appropriate(UINT8 width, UINT64 unitmask, const char *string) +bool address_map_entry::unitmask_is_appropriate(uint8_t width, uint64_t unitmask, const char *string) { // if no mask, this must match the default width of the map if (unitmask == 0) @@ -274,12 +274,12 @@ bool address_map_entry::unitmask_is_appropriate(UINT8 width, UINT64 unitmask, co throw emu_fatalerror("Handler %s is a %d-bit handler and is too wide to be used in a %d-bit address map", string, width, m_map.m_databits); // the mask must represent whole units of width - UINT32 basemask = (width == 8) ? 0xff : (width == 16) ? 0xffff : 0xffffffff; - UINT64 singlemask = basemask; + uint32_t basemask = (width == 8) ? 0xff : (width == 16) ? 0xffff : 0xffffffff; + uint64_t singlemask = basemask; while (singlemask != 0) { if ((unitmask & singlemask) != 0 && (unitmask & singlemask) != singlemask) - throw emu_fatalerror("Handler %s specified a mask of %08X%08X; needs to be in even chunks of %X", string, (UINT32)(unitmask >> 32), (UINT32)unitmask, basemask); + throw emu_fatalerror("Handler %s specified a mask of %08X%08X; needs to be in even chunks of %X", string, (uint32_t)(unitmask >> 32), (uint32_t)unitmask, basemask); singlemask <<= width; } return true; @@ -398,7 +398,7 @@ address_map::address_map(device_t &device, address_map_entry *entry) // address_map - constructor dynamic device mapping case //---------------------------------------------------------- -address_map::address_map(const address_space &space, offs_t start, offs_t end, int bits, UINT64 unitmask, device_t &device, address_map_delegate submap_delegate) +address_map::address_map(const address_space &space, offs_t start, offs_t end, int bits, uint64_t unitmask, device_t &device, address_map_delegate submap_delegate) : m_spacenum(space.spacenum()), m_databits(space.data_width()), m_unmapval(space.unmap()), @@ -440,7 +440,7 @@ address_map::~address_map() // values //------------------------------------------------- -void address_map::configure(address_spacenum spacenum, UINT8 databits) +void address_map::configure(address_spacenum spacenum, uint8_t databits) { assert(m_spacenum == spacenum); if (m_databits == 0xff) @@ -536,14 +536,14 @@ void address_map::uplift_submaps(running_machine &machine, device_t &device, dev offs_t mirror_address_mask = (databytes - 1) & ~(entry_bytes - 1); - UINT64 entry_mask = (2ULL << (entry_bits-1)) - 1; + uint64_t entry_mask = (2ULL << (entry_bits-1)) - 1; int slot_offset[8]; int slot_count = 0; int max_slot_count = m_databits / entry_bits; int slot_xor_mask = endian == ENDIANNESS_LITTLE ? 0 : max_slot_count - 1; - UINT64 global_mask = entry->m_read.m_mask; + uint64_t global_mask = entry->m_read.m_mask; // zero means all if (!global_mask) global_mask = ~global_mask; @@ -612,10 +612,10 @@ void address_map::uplift_submaps(running_machine &machine, device_t &device, dev if (mdata.m_bits == 0 && entry_bits != m_databits) mdata.m_bits = entry_bits; - UINT64 mask = 0; + uint64_t mask = 0; if (mdata.m_bits != m_databits) { - UINT64 unitmask = mdata.m_mask ? mdata.m_mask : entry_mask; + uint64_t unitmask = mdata.m_mask ? mdata.m_mask : entry_mask; for (int slot = start_slot; slot <= end_slot; slot++) mask |= unitmask << slot_offset[slot]; } @@ -667,8 +667,8 @@ void address_map::map_validity_check(validity_checker &valid, const device_t &de // loop over entries and look for errors for (address_map_entry &entry : m_entrylist) { - UINT32 bytestart = spaceconfig.addr2byte(entry.m_addrstart); - UINT32 byteend = spaceconfig.addr2byte_end(entry.m_addrend); + uint32_t bytestart = spaceconfig.addr2byte(entry.m_addrstart); + uint32_t byteend = spaceconfig.addr2byte_end(entry.m_addrend); // look for overlapping entries if (!detected_overlap) diff --git a/src/emu/addrmap.h b/src/emu/addrmap.h index 3bcea1a3f47..e440d0cd8b5 100644 --- a/src/emu/addrmap.h +++ b/src/emu/addrmap.h @@ -59,8 +59,8 @@ public: m_tag(nullptr) { } map_handler_type m_type; // type of the handler - UINT8 m_bits; // width of the handler in bits, or 0 for default - UINT64 m_mask; // mask for which lanes apply + uint8_t m_bits; // width of the handler in bits, or 0 for default + uint64_t m_mask; // mask for which lanes apply const char * m_name; // name of the handler const char * m_tag; // tag for I/O ports and banks }; @@ -104,7 +104,7 @@ public: void set_handler(setoffset_delegate func); // submap referencing - void set_submap(const char *tag, address_map_delegate func, int bits, UINT64 mask); + void set_submap(const char *tag, address_map_delegate func, int bits, uint64_t mask); // public state address_map_entry * m_next; // pointer to the next entry @@ -147,28 +147,28 @@ public: protected: // internal handler setters for 8-bit functions - void internal_set_handler(read8_delegate func, UINT64 mask); - void internal_set_handler(write8_delegate func, UINT64 mask); - void internal_set_handler(read8_delegate rfunc, write8_delegate wfunc, UINT64 mask); + void internal_set_handler(read8_delegate func, uint64_t mask); + void internal_set_handler(write8_delegate func, uint64_t mask); + void internal_set_handler(read8_delegate rfunc, write8_delegate wfunc, uint64_t mask); // internal handler setters for 16-bit functions - void internal_set_handler(read16_delegate func, UINT64 mask); - void internal_set_handler(write16_delegate func, UINT64 mask); - void internal_set_handler(read16_delegate rfunc, write16_delegate wfunc, UINT64 mask); + void internal_set_handler(read16_delegate func, uint64_t mask); + void internal_set_handler(write16_delegate func, uint64_t mask); + void internal_set_handler(read16_delegate rfunc, write16_delegate wfunc, uint64_t mask); // internal handler setters for 32-bit functions - void internal_set_handler(read32_delegate func, UINT64 mask); - void internal_set_handler(write32_delegate func, UINT64 mask); - void internal_set_handler(read32_delegate rfunc, write32_delegate wfunc, UINT64 mask); + void internal_set_handler(read32_delegate func, uint64_t mask); + void internal_set_handler(write32_delegate func, uint64_t mask); + void internal_set_handler(read32_delegate rfunc, write32_delegate wfunc, uint64_t mask); // internal handler setters for 64-bit functions - void internal_set_handler(read64_delegate func, UINT64 mask); - void internal_set_handler(write64_delegate func, UINT64 mask); - void internal_set_handler(read64_delegate rfunc, write64_delegate wfunc, UINT64 mask); + void internal_set_handler(read64_delegate func, uint64_t mask); + void internal_set_handler(write64_delegate func, uint64_t mask); + void internal_set_handler(read64_delegate rfunc, write64_delegate wfunc, uint64_t mask); private: // helper functions - bool unitmask_is_appropriate(UINT8 width, UINT64 unitmask, const char *string); + bool unitmask_is_appropriate(uint8_t width, uint64_t unitmask, const char *string); }; @@ -201,9 +201,9 @@ public: void set_handler(read16_delegate rfunc, write16_delegate wfunc) { internal_set_handler(rfunc, wfunc, 0); } // 8-bit handlers - void set_handler(read8_delegate func, UINT16 mask) { internal_set_handler(func, mask); } - void set_handler(write8_delegate func, UINT16 mask) { internal_set_handler(func, mask); } - void set_handler(read8_delegate rfunc, write8_delegate wfunc, UINT16 mask) { internal_set_handler(rfunc, wfunc, mask); } + void set_handler(read8_delegate func, uint16_t mask) { internal_set_handler(func, mask); } + void set_handler(write8_delegate func, uint16_t mask) { internal_set_handler(func, mask); } + void set_handler(read8_delegate rfunc, write8_delegate wfunc, uint16_t mask) { internal_set_handler(rfunc, wfunc, mask); } }; @@ -221,14 +221,14 @@ public: void set_handler(read32_delegate rfunc, write32_delegate wfunc) { internal_set_handler(rfunc, wfunc, 0); } // 16-bit handlers - void set_handler(read16_delegate func, UINT32 mask) { internal_set_handler(func, mask); } - void set_handler(write16_delegate func, UINT32 mask) { internal_set_handler(func, mask); } - void set_handler(read16_delegate rfunc, write16_delegate wfunc, UINT32 mask) { internal_set_handler(rfunc, wfunc, mask); } + void set_handler(read16_delegate func, uint32_t mask) { internal_set_handler(func, mask); } + void set_handler(write16_delegate func, uint32_t mask) { internal_set_handler(func, mask); } + void set_handler(read16_delegate rfunc, write16_delegate wfunc, uint32_t mask) { internal_set_handler(rfunc, wfunc, mask); } // 8-bit handlers - void set_handler(read8_delegate func, UINT32 mask) { internal_set_handler(func, mask); } - void set_handler(write8_delegate func, UINT32 mask) { internal_set_handler(func, mask); } - void set_handler(read8_delegate rfunc, write8_delegate wfunc, UINT32 mask) { internal_set_handler(rfunc, wfunc, mask); } + void set_handler(read8_delegate func, uint32_t mask) { internal_set_handler(func, mask); } + void set_handler(write8_delegate func, uint32_t mask) { internal_set_handler(func, mask); } + void set_handler(read8_delegate rfunc, write8_delegate wfunc, uint32_t mask) { internal_set_handler(rfunc, wfunc, mask); } }; @@ -246,19 +246,19 @@ public: void set_handler(read64_delegate rfunc, write64_delegate wfunc) { internal_set_handler(rfunc, wfunc, 0); } // 32-bit handlers - void set_handler(read32_delegate func, UINT64 mask) { internal_set_handler(func, mask); } - void set_handler(write32_delegate func, UINT64 mask) { internal_set_handler(func, mask); } - void set_handler(read32_delegate rfunc, write32_delegate wfunc, UINT64 mask) { internal_set_handler(rfunc, wfunc, mask); } + void set_handler(read32_delegate func, uint64_t mask) { internal_set_handler(func, mask); } + void set_handler(write32_delegate func, uint64_t mask) { internal_set_handler(func, mask); } + void set_handler(read32_delegate rfunc, write32_delegate wfunc, uint64_t mask) { internal_set_handler(rfunc, wfunc, mask); } // 16-bit handlers - void set_handler(read16_delegate func, UINT64 mask) { internal_set_handler(func, mask); } - void set_handler(write16_delegate func, UINT64 mask) { internal_set_handler(func, mask); } - void set_handler(read16_delegate rfunc, write16_delegate wfunc, UINT64 mask) { internal_set_handler(rfunc, wfunc, mask); } + void set_handler(read16_delegate func, uint64_t mask) { internal_set_handler(func, mask); } + void set_handler(write16_delegate func, uint64_t mask) { internal_set_handler(func, mask); } + void set_handler(read16_delegate rfunc, write16_delegate wfunc, uint64_t mask) { internal_set_handler(rfunc, wfunc, mask); } // 8-bit handlers - void set_handler(read8_delegate func, UINT64 mask) { internal_set_handler(func, mask); } - void set_handler(write8_delegate func, UINT64 mask) { internal_set_handler(func, mask); } - void set_handler(read8_delegate rfunc, write8_delegate wfunc, UINT64 mask) { internal_set_handler(rfunc, wfunc, mask); } + void set_handler(read8_delegate func, uint64_t mask) { internal_set_handler(func, mask); } + void set_handler(write8_delegate func, uint64_t mask) { internal_set_handler(func, mask); } + void set_handler(read8_delegate rfunc, write8_delegate wfunc, uint64_t mask) { internal_set_handler(rfunc, wfunc, mask); } }; @@ -271,15 +271,15 @@ public: // construction/destruction address_map(device_t &device, address_spacenum spacenum); address_map(device_t &device, address_map_entry *entry); - address_map(const address_space &space, offs_t start, offs_t end, int bits, UINT64 unitmask, device_t &device, address_map_delegate submap_delegate); + address_map(const address_space &space, offs_t start, offs_t end, int bits, uint64_t unitmask, device_t &device, address_map_delegate submap_delegate); ~address_map(); // configuration - void configure(address_spacenum _spacenum, UINT8 _databits); + void configure(address_spacenum _spacenum, uint8_t _databits); // setters void set_global_mask(offs_t mask); - void set_unmap_value(UINT8 value) { m_unmapval = value; } + void set_unmap_value(uint8_t value) { m_unmapval = value; } // add a new entry of the given type address_map_entry8 *add(device_t &device, offs_t start, offs_t end, address_map_entry8 *ptr); @@ -289,8 +289,8 @@ public: // public data address_spacenum m_spacenum; // space number of the map - UINT8 m_databits; // data bits represented by the map - UINT8 m_unmapval; // unmapped memory value + uint8_t m_databits; // data bits represented by the map + uint8_t m_unmapval; // unmapped memory value offs_t m_globalmask; // global mask simple_list m_entrylist; // list of entries diff --git a/src/emu/attotime.cpp b/src/emu/attotime.cpp index 7f7b2005b94..6df7487dfc7 100644 --- a/src/emu/attotime.cpp +++ b/src/emu/attotime.cpp @@ -29,7 +29,7 @@ const attotime attotime::never(ATTOTIME_MAX_SECONDS, 0); // constant //------------------------------------------------- -attotime &attotime::operator*=(UINT32 factor) +attotime &attotime::operator*=(uint32_t factor) { // if one of the items is attotime::never, return attotime::never if (m_seconds >= ATTOTIME_MAX_SECONDS) @@ -40,17 +40,17 @@ attotime &attotime::operator*=(UINT32 factor) return *this = zero; // split attoseconds into upper and lower halves which fit into 32 bits - UINT32 attolo; - UINT32 attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo); + uint32_t attolo; + uint32_t attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo); // scale the lower half, then split into high/low parts - UINT64 temp = mulu_32x32(attolo, factor); - UINT32 reslo; + uint64_t temp = mulu_32x32(attolo, factor); + uint32_t reslo; temp = divu_64x32_rem(temp, ATTOSECONDS_PER_SECOND_SQRT, &reslo); // scale the upper half, then split into high/low parts temp += mulu_32x32(attohi, factor); - UINT32 reshi; + uint32_t reshi; temp = divu_64x32_rem(temp, ATTOSECONDS_PER_SECOND_SQRT, &reshi); // scale the seconds @@ -69,7 +69,7 @@ attotime &attotime::operator*=(UINT32 factor) // operator/= - divide an attotime by a constant //------------------------------------------------- -attotime &attotime::operator/=(UINT32 factor) +attotime &attotime::operator/=(uint32_t factor) { // if one of the items is attotime::never, return attotime::never if (m_seconds >= ATTOTIME_MAX_SECONDS) @@ -80,20 +80,20 @@ attotime &attotime::operator/=(UINT32 factor) return *this; // split attoseconds into upper and lower halves which fit into 32 bits - UINT32 attolo; - UINT32 attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo); + uint32_t attolo; + uint32_t attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo); // divide the seconds and get the remainder - UINT32 remainder; + uint32_t remainder; m_seconds = divu_64x32_rem(m_seconds, factor, &remainder); // combine the upper half of attoseconds with the remainder and divide that - UINT64 temp = (INT64)attohi + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT); - UINT32 reshi = divu_64x32_rem(temp, factor, &remainder); + uint64_t temp = (int64_t)attohi + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT); + uint32_t reshi = divu_64x32_rem(temp, factor, &remainder); // combine the lower half of attoseconds with the remainder and divide that temp = attolo + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT); - UINT32 reslo = divu_64x32_rem(temp, factor, &remainder); + uint32_t reslo = divu_64x32_rem(temp, factor, &remainder); // round based on the remainder m_attoseconds = (attoseconds_t)reslo + mulu_32x32(reshi, ATTOSECONDS_PER_SECOND_SQRT); @@ -129,7 +129,7 @@ const char *attotime::as_string(int precision) const // case 2: we want 9 or fewer digits of precision else if (precision <= 9) { - UINT32 upper = m_attoseconds / ATTOSECONDS_PER_SECOND_SQRT; + uint32_t upper = m_attoseconds / ATTOSECONDS_PER_SECOND_SQRT; int temp = precision; while (temp < 9) { @@ -142,8 +142,8 @@ const char *attotime::as_string(int precision) const // case 3: more than 9 digits of precision else { - UINT32 lower; - UINT32 upper = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &lower); + uint32_t lower; + uint32_t upper = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &lower); int temp = precision; while (temp < 18) { diff --git a/src/emu/attotime.h b/src/emu/attotime.h index e90a4911126..c99a1d953df 100644 --- a/src/emu/attotime.h +++ b/src/emu/attotime.h @@ -44,8 +44,8 @@ //************************************************************************** // core components of the attotime structure -typedef INT64 attoseconds_t; -typedef INT32 seconds_t; +typedef int64_t attoseconds_t; +typedef int32_t seconds_t; // core definitions const attoseconds_t ATTOSECONDS_PER_SECOND_SQRT = 1'000'000'000; @@ -110,7 +110,7 @@ public: // conversion to other forms constexpr double as_double() const { return double(m_seconds) + ATTOSECONDS_TO_DOUBLE(m_attoseconds); } constexpr attoseconds_t as_attoseconds() const; - UINT64 as_ticks(UINT32 frequency) const; + uint64_t as_ticks(uint32_t frequency) const; /** Convert to string using at @p precision */ const char *as_string(int precision = 9) const; @@ -120,23 +120,23 @@ public: constexpr seconds_t seconds() const { return m_seconds; } static attotime from_double(double _time); - static attotime from_ticks(UINT64 ticks, UINT32 frequency); + static attotime from_ticks(uint64_t ticks, uint32_t frequency); /** Create an attotime from a integer count of seconds @seconds */ - static constexpr attotime from_seconds(INT32 seconds) { return attotime(seconds, 0); } + static constexpr attotime from_seconds(int32_t seconds) { return attotime(seconds, 0); } /** Create an attotime from a integer count of milliseconds @msec */ - static constexpr attotime from_msec(INT64 msec) { return attotime(msec / 1000, (msec % 1000) * (ATTOSECONDS_PER_SECOND / 1000)); } + static constexpr attotime from_msec(int64_t msec) { return attotime(msec / 1000, (msec % 1000) * (ATTOSECONDS_PER_SECOND / 1000)); } /** Create an attotime from a integer count of microseconds @usec */ - static constexpr attotime from_usec(INT64 usec) { return attotime(usec / 1000000, (usec % 1000000) * (ATTOSECONDS_PER_SECOND / 1000000)); } + static constexpr attotime from_usec(int64_t usec) { return attotime(usec / 1000000, (usec % 1000000) * (ATTOSECONDS_PER_SECOND / 1000000)); } /** Create an attotime from a integer count of nanoseconds @nsec */ - static constexpr attotime from_nsec(INT64 nsec) { return attotime(nsec / 1000000000, (nsec % 1000000000) * (ATTOSECONDS_PER_SECOND / 1000000000)); } + static constexpr attotime from_nsec(int64_t nsec) { return attotime(nsec / 1000000000, (nsec % 1000000000) * (ATTOSECONDS_PER_SECOND / 1000000000)); } /** Create an attotime from at the given frequency @frequency */ static attotime from_hz(double frequency) { assert(frequency > 0); double d = 1 / frequency; return attotime(floor(d), modf(d, &d) * ATTOSECONDS_PER_SECOND); } // math attotime &operator+=(const attotime &right); attotime &operator-=(const attotime &right); - attotime &operator*=(UINT32 factor); - attotime &operator/=(UINT32 factor); + attotime &operator*=(uint32_t factor); + attotime &operator/=(uint32_t factor); // members seconds_t m_seconds; @@ -246,14 +246,14 @@ inline attotime &attotime::operator-=(const attotime &right) /** handle multiplication by an integral factor; defined in terms of the assignment operators */ -inline attotime operator*(const attotime &left, UINT32 factor) +inline attotime operator*(const attotime &left, uint32_t factor) { attotime result = left; result *= factor; return result; } -inline attotime operator*(UINT32 factor, const attotime &right) +inline attotime operator*(uint32_t factor, const attotime &right) { attotime result = right; result *= factor; @@ -261,7 +261,7 @@ inline attotime operator*(UINT32 factor, const attotime &right) } /** handle division by an integral factor; defined in terms of the assignment operators */ -inline attotime operator/(const attotime &left, UINT32 factor) +inline attotime operator/(const attotime &left, uint32_t factor) { attotime result = left; result /= factor; @@ -332,24 +332,24 @@ inline constexpr attoseconds_t attotime::as_attoseconds() const /** as_ticks - convert to ticks at @p frequency */ -inline UINT64 attotime::as_ticks(UINT32 frequency) const +inline uint64_t attotime::as_ticks(uint32_t frequency) const { - UINT32 fracticks = (attotime(0, m_attoseconds) * frequency).m_seconds; + uint32_t fracticks = (attotime(0, m_attoseconds) * frequency).m_seconds; return mulu_32x32(m_seconds, frequency) + fracticks; } /** Create an attotime from a tick count @ticks at the given frequency @frequency */ -inline attotime attotime::from_ticks(UINT64 ticks, UINT32 frequency) +inline attotime attotime::from_ticks(uint64_t ticks, uint32_t frequency) { attoseconds_t attos_per_tick = HZ_TO_ATTOSECONDS(frequency); if (ticks < frequency) return attotime(0, ticks * attos_per_tick); - UINT32 remainder; - INT32 secs = divu_64x32_rem(ticks, frequency, &remainder); - return attotime(secs, (UINT64)remainder * attos_per_tick); + uint32_t remainder; + int32_t secs = divu_64x32_rem(ticks, frequency, &remainder); + return attotime(secs, (uint64_t)remainder * attos_per_tick); } /** Create an attotime from floating point count of seconds @p _time */ diff --git a/src/emu/bookkeeping.h b/src/emu/bookkeeping.h index 7285a40f058..277501b5d2a 100644 --- a/src/emu/bookkeeping.h +++ b/src/emu/bookkeeping.h @@ -69,10 +69,10 @@ private: // internal state running_machine & m_machine; // reference to our machine - UINT32 m_dispensed_tickets; - UINT32 m_coin_count[COIN_COUNTERS]; - UINT32 m_coinlockedout[COIN_COUNTERS]; - UINT32 m_lastcoin[COIN_COUNTERS]; + uint32_t m_dispensed_tickets; + uint32_t m_coin_count[COIN_COUNTERS]; + uint32_t m_coinlockedout[COIN_COUNTERS]; + uint32_t m_lastcoin[COIN_COUNTERS]; }; #endif /* __BOOKKEEPING_H__ */ diff --git a/src/emu/crsshair.cpp b/src/emu/crsshair.cpp index c55d1c46c4d..0ae90ea32cc 100644 --- a/src/emu/crsshair.cpp +++ b/src/emu/crsshair.cpp @@ -29,7 +29,7 @@ ***************************************************************************/ /* raw bitmap */ -static const UINT8 crosshair_raw_top[] = +static const uint8_t crosshair_raw_top[] = { 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00, 0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00, @@ -206,8 +206,8 @@ void render_crosshair::create_bitmap() for (y = 0; y < CROSSHAIR_RAW_SIZE / 2; y++) { /* assume it is mirrored vertically */ - UINT32 *dest0 = &m_bitmap->pix32(y); - UINT32 *dest1 = &m_bitmap->pix32(CROSSHAIR_RAW_SIZE - 1 - y); + uint32_t *dest0 = &m_bitmap->pix32(y); + uint32_t *dest1 = &m_bitmap->pix32(CROSSHAIR_RAW_SIZE - 1 - y); /* extract to two rows simultaneously */ for (x = 0; x < CROSSHAIR_RAW_SIZE; x++) @@ -225,7 +225,7 @@ void render_crosshair::create_bitmap() // animate - update the crosshair state //------------------------------------------------- -void render_crosshair::animate(UINT16 auto_time) +void render_crosshair::animate(uint16_t auto_time) { // read all the port values if (m_used) @@ -263,7 +263,7 @@ void render_crosshair::animate(UINT16 auto_time) // draw - render the crosshair to the container //------------------------------------------------- -void render_crosshair::draw(render_container &container, UINT8 fade) +void render_crosshair::draw(render_container &container, uint8_t fade) { // add a quad assuming a 4:3 screen (this is not perfect) container.add_quad(m_x - 0.03f, m_y - 0.04f, m_x + 0.03f, m_y + 0.04f, @@ -414,7 +414,7 @@ void crosshair_manager::config_load(config_type cfg_type, xml_data_node *parentn mode = xml_get_attribute_int(crosshairnode, "mode", CROSSHAIR_VISIBILITY_DEFAULT); if (mode >= CROSSHAIR_VISIBILITY_OFF && mode <= CROSSHAIR_VISIBILITY_AUTO) { - crosshair.set_mode((UINT8)mode); + crosshair.set_mode((uint8_t)mode); /* set visibility as specified by mode */ /* auto mode starts with visibility off */ crosshair.set_visible(mode == CROSSHAIR_VISIBILITY_ON); @@ -432,7 +432,7 @@ void crosshair_manager::config_load(config_type cfg_type, xml_data_node *parentn { auto_time = xml_get_attribute_int(crosshairnode, "val", CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT); if ((auto_time >= CROSSHAIR_VISIBILITY_AUTOTIME_MIN) && (auto_time <= CROSSHAIR_VISIBILITY_AUTOTIME_MAX)) - m_auto_time = (UINT8)auto_time; + m_auto_time = (uint8_t)auto_time; } } diff --git a/src/emu/crsshair.h b/src/emu/crsshair.h index a20c3303d91..609109d8b72 100644 --- a/src/emu/crsshair.h +++ b/src/emu/crsshair.h @@ -50,7 +50,7 @@ public: running_machine &machine() const { return m_machine; } int player() const { return m_player; } bool is_used() const { return m_used; } - UINT8 mode() const { return m_mode; } + uint8_t mode() const { return m_mode; } bool is_visible() const { return m_visible; } screen_device *screen() const { return m_screen; } float x() const { return m_x; } @@ -59,7 +59,7 @@ public: // setters void set_used(bool used) { m_used = used; } - void set_mode(UINT8 mode) { m_mode = mode; } + void set_mode(uint8_t mode) { m_mode = mode; } void set_visible(bool visible) { m_visible = visible; } void set_screen(screen_device *screen) { m_screen = screen; } //void setxy(float x, float y); @@ -67,8 +67,8 @@ public: void set_default_bitmap(); // updates - void animate(UINT16 auto_time); - void draw(render_container &container, UINT8 fade); + void animate(uint16_t auto_time); + void draw(render_container &container, uint8_t fade); private: // private helpers @@ -78,7 +78,7 @@ private: running_machine & m_machine; // reference to our machine int m_player; // player number bool m_used; // usage for this crosshair - UINT8 m_mode; // visibility mode for this crosshair + uint8_t m_mode; // visibility mode for this crosshair bool m_visible; // visibility for this crosshair std::unique_ptr m_bitmap; // bitmap for this crosshair render_texture * m_texture; // texture for this crosshair @@ -87,7 +87,7 @@ private: float m_y; // current Y position float m_last_x; // last X position float m_last_y; // last Y position - UINT16 m_time; // time since last movement + uint16_t m_time; // time since last movement std::string m_name; // name of png file }; @@ -109,8 +109,8 @@ public: // getters running_machine &machine() const { return m_machine; } render_crosshair &get_crosshair(int player) const { assert(player >= 0 && player < MAX_PLAYERS); assert(m_crosshair[player] != nullptr); return *m_crosshair[player]; } - UINT16 auto_time() const { return m_auto_time; } - void set_auto_time(UINT16 auto_time) { m_auto_time = auto_time; } + uint16_t auto_time() const { return m_auto_time; } + void set_auto_time(uint16_t auto_time) { m_auto_time = auto_time; } private: void exit(); @@ -124,9 +124,9 @@ private: bool m_usage; // true if any crosshairs are used std::unique_ptr m_crosshair[MAX_PLAYERS]; // per-player crosshair state - UINT8 m_fade; // color fading factor - UINT8 m_animation_counter; // animation frame index - UINT16 m_auto_time; // time in seconds to turn invisible + uint8_t m_fade; // color fading factor + uint8_t m_animation_counter; // animation frame index + uint16_t m_auto_time; // time in seconds to turn invisible }; #endif /* __CRSSHAIR_H__ */ diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index a2e0d43a0c1..323a0e2c746 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -49,15 +49,15 @@ bool debugger_commands::cheat_address_is_valid(address_space &space, offs_t addr the current cheat width, if signed -------------------------------------------------*/ -UINT64 debugger_commands::cheat_sign_extend(const cheat_system *cheatsys, UINT64 value) +uint64_t debugger_commands::cheat_sign_extend(const cheat_system *cheatsys, uint64_t value) { if (cheatsys->signed_cheat) { switch (cheatsys->width) { - case 1: value = (INT8)value; break; - case 2: value = (INT16)value; break; - case 4: value = (INT32)value; break; + case 1: value = (int8_t)value; break; + case 2: value = (int16_t)value; break; + case 4: value = (int32_t)value; break; } } return value; @@ -67,7 +67,7 @@ UINT64 debugger_commands::cheat_sign_extend(const cheat_system *cheatsys, UINT64 cheat_byte_swap - swap a value -------------------------------------------------*/ -UINT64 debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, UINT64 value) +uint64_t debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, uint64_t value) { if (cheatsys->swapped_cheat) { @@ -88,7 +88,7 @@ UINT64 debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, UINT64 v and swapping if necessary -------------------------------------------------*/ -UINT64 debugger_commands::cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address) +uint64_t debugger_commands::cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address) { return cheat_sign_extend(cheatsys, cheat_byte_swap(cheatsys, m_cpu.read_memory(space, address, cheatsys->width, TRUE))); } @@ -111,7 +111,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu /* add all single-entry save state globals */ for (int itemnum = 0; itemnum < MAX_GLOBALS; itemnum++) { - UINT32 valsize, valcount; + uint32_t valsize, valcount; void *base; /* stop when we run out of items */ @@ -281,7 +281,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu execute_min - return the minimum of two values -------------------------------------------------*/ -UINT64 debugger_commands::execute_min(symbol_table &table, void *ref, int params, const UINT64 *param) +uint64_t debugger_commands::execute_min(symbol_table &table, void *ref, int params, const uint64_t *param) { return (param[0] < param[1]) ? param[0] : param[1]; } @@ -291,7 +291,7 @@ UINT64 debugger_commands::execute_min(symbol_table &table, void *ref, int params execute_max - return the maximum of two values -------------------------------------------------*/ -UINT64 debugger_commands::execute_max(symbol_table &table, void *ref, int params, const UINT64 *param) +uint64_t debugger_commands::execute_max(symbol_table &table, void *ref, int params, const uint64_t *param) { return (param[0] > param[1]) ? param[0] : param[1]; } @@ -301,7 +301,7 @@ UINT64 debugger_commands::execute_max(symbol_table &table, void *ref, int params execute_if - if (a) return b; else return c; -------------------------------------------------*/ -UINT64 debugger_commands::execute_if(symbol_table &table, void *ref, int params, const UINT64 *param) +uint64_t debugger_commands::execute_if(symbol_table &table, void *ref, int params, const uint64_t *param) { return param[0] ? param[1] : param[2]; } @@ -316,15 +316,15 @@ UINT64 debugger_commands::execute_if(symbol_table &table, void *ref, int params, global_get - symbol table getter for globals -------------------------------------------------*/ -UINT64 debugger_commands::global_get(symbol_table &table, void *ref) +uint64_t debugger_commands::global_get(symbol_table &table, void *ref) { global_entry *global = (global_entry *)ref; switch (global->size) { - case 1: return *(UINT8 *)global->base; - case 2: return *(UINT16 *)global->base; - case 4: return *(UINT32 *)global->base; - case 8: return *(UINT64 *)global->base; + case 1: return *(uint8_t *)global->base; + case 2: return *(uint16_t *)global->base; + case 4: return *(uint32_t *)global->base; + case 8: return *(uint64_t *)global->base; } return ~0; } @@ -334,15 +334,15 @@ UINT64 debugger_commands::global_get(symbol_table &table, void *ref) global_set - symbol table setter for globals -------------------------------------------------*/ -void debugger_commands::global_set(symbol_table &table, void *ref, UINT64 value) +void debugger_commands::global_set(symbol_table &table, void *ref, uint64_t value) { global_entry *global = (global_entry *)ref; switch (global->size) { - case 1: *(UINT8 *)global->base = value; break; - case 2: *(UINT16 *)global->base = value; break; - case 4: *(UINT32 *)global->base = value; break; - case 8: *(UINT64 *)global->base = value; break; + case 1: *(uint8_t *)global->base = value; break; + case 2: *(uint16_t *)global->base = value; break; + case 4: *(uint32_t *)global->base = value; break; + case 8: *(uint64_t *)global->base = value; break; } } @@ -357,7 +357,7 @@ void debugger_commands::global_set(symbol_table &table, void *ref, UINT64 value) number parameter -------------------------------------------------*/ -bool debugger_commands::validate_number_parameter(const char *param, UINT64 *result) +bool debugger_commands::validate_number_parameter(const char *param, uint64_t *result) { /* nullptr parameter does nothing and returns no error */ if (param == nullptr) @@ -432,7 +432,7 @@ bool debugger_commands::validate_cpu_parameter(const char *param, device_t **res return true; /* then evaluate as an expression; on an error assume it was a tag */ - UINT64 cpunum; + uint64_t cpunum; try { parsed_expression expression(m_cpu.get_visible_symtable(), param, &cpunum); @@ -552,7 +552,7 @@ void debugger_commands::execute_help(int ref, int params, const char *param[]) void debugger_commands::execute_print(int ref, int params, const char *param[]) { /* validate the other parameters */ - UINT64 values[MAX_COMMAND_PARAMS]; + uint64_t values[MAX_COMMAND_PARAMS]; for (int i = 0; i < params; i++) if (!validate_number_parameter(param[i], &values[i])) return; @@ -568,7 +568,7 @@ void debugger_commands::execute_print(int ref, int params, const char *param[]) mini_printf - safe printf to a buffer -------------------------------------------------*/ -int debugger_commands::mini_printf(char *buffer, const char *format, int params, UINT64 *param) +int debugger_commands::mini_printf(char *buffer, const char *format, int params, uint64_t *param) { const char *f = format; char *p = buffer; @@ -624,11 +624,11 @@ int debugger_commands::mini_printf(char *buffer, const char *format, int params, m_console.printf("Not enough parameters for format!\n"); return 0; } - if ((UINT32)(*param >> 32) != 0) - p += sprintf(p, zerofill ? "%0*X" : "%*X", (width <= 8) ? 1 : width - 8, (UINT32)(*param >> 32)); + if ((uint32_t)(*param >> 32) != 0) + p += sprintf(p, zerofill ? "%0*X" : "%*X", (width <= 8) ? 1 : width - 8, (uint32_t)(*param >> 32)); else if (width > 8) p += sprintf(p, zerofill ? "%0*X" : "%*X", width - 8, 0); - p += sprintf(p, zerofill ? "%0*X" : "%*X", (width < 8) ? width : 8, (UINT32)*param); + p += sprintf(p, zerofill ? "%0*X" : "%*X", (width < 8) ? width : 8, (uint32_t)*param); param++; params--; break; @@ -640,7 +640,7 @@ int debugger_commands::mini_printf(char *buffer, const char *format, int params, m_console.printf("Not enough parameters for format!\n"); return 0; } - p += sprintf(p, zerofill ? "%0*d" : "%*d", width, (UINT32)*param); + p += sprintf(p, zerofill ? "%0*d" : "%*d", width, (uint32_t)*param); param++; params--; break; @@ -665,7 +665,7 @@ int debugger_commands::mini_printf(char *buffer, const char *format, int params, void debugger_commands::execute_printf(int ref, int params, const char *param[]) { /* validate the other parameters */ - UINT64 values[MAX_COMMAND_PARAMS]; + uint64_t values[MAX_COMMAND_PARAMS]; for (int i = 1; i < params; i++) if (!validate_number_parameter(param[i], &values[i])) return; @@ -684,7 +684,7 @@ void debugger_commands::execute_printf(int ref, int params, const char *param[]) void debugger_commands::execute_logerror(int ref, int params, const char *param[]) { /* validate the other parameters */ - UINT64 values[MAX_COMMAND_PARAMS]; + uint64_t values[MAX_COMMAND_PARAMS]; for (int i = 1; i < params; i++) if (!validate_number_parameter(param[i], &values[i])) return; @@ -703,7 +703,7 @@ void debugger_commands::execute_logerror(int ref, int params, const char *param[ void debugger_commands::execute_tracelog(int ref, int params, const char *param[]) { /* validate the other parameters */ - UINT64 values[MAX_COMMAND_PARAMS]; + uint64_t values[MAX_COMMAND_PARAMS]; for (int i = 1; i < params; i++) if (!validate_number_parameter(param[i], &values[i])) return; @@ -732,7 +732,7 @@ void debugger_commands::execute_quit(int ref, int params, const char *param[]) void debugger_commands::execute_do(int ref, int params, const char *param[]) { - UINT64 dummy; + uint64_t dummy; validate_number_parameter(param[0], &dummy); } @@ -744,7 +744,7 @@ void debugger_commands::execute_do(int ref, int params, const char *param[]) void debugger_commands::execute_step(int ref, int params, const char *param[]) { /* if we have a parameter, use it */ - UINT64 steps = 1; + uint64_t steps = 1; if (!validate_number_parameter(param[0], &steps)) return; @@ -759,7 +759,7 @@ void debugger_commands::execute_step(int ref, int params, const char *param[]) void debugger_commands::execute_over(int ref, int params, const char *param[]) { /* if we have a parameter, use it */ - UINT64 steps = 1; + uint64_t steps = 1; if (!validate_number_parameter(param[0], &steps)) return; @@ -783,7 +783,7 @@ void debugger_commands::execute_out(int ref, int params, const char *param[]) void debugger_commands::execute_go(int ref, int params, const char *param[]) { - UINT64 addr = ~0; + uint64_t addr = ~0; /* if we have a parameter, use it instead */ if (!validate_number_parameter(param[0], &addr)) @@ -810,7 +810,7 @@ void debugger_commands::execute_go_vblank(int ref, int params, const char *param void debugger_commands::execute_go_interrupt(int ref, int params, const char *param[]) { - UINT64 irqline = -1; + uint64_t irqline = -1; /* if we have a parameter, use it instead */ if (!validate_number_parameter(param[0], &irqline)) @@ -826,7 +826,7 @@ void debugger_commands::execute_go_interrupt(int ref, int params, const char *pa void debugger_commands::execute_go_time(int ref, int params, const char *param[]) { - UINT64 milliseconds = -1; + uint64_t milliseconds = -1; /* if we have a parameter, use it instead */ if (!validate_number_parameter(param[0], &milliseconds)) @@ -987,7 +987,7 @@ void debugger_commands::execute_observe(int ref, int params, const char *param[] void debugger_commands::execute_comment_add(int ref, int params, const char *param[]) { device_t *cpu; - UINT64 address; + uint64_t address; /* param 1 is the address for the comment */ if (!validate_number_parameter(param[0], &address)) @@ -1017,7 +1017,7 @@ void debugger_commands::execute_comment_add(int ref, int params, const char *par void debugger_commands::execute_comment_del(int ref, int params, const char *param[]) { device_t *cpu; - UINT64 address; + uint64_t address; /* param 1 can either be a command or the address for the comment */ if (!validate_number_parameter(param[0], &address)) @@ -1093,7 +1093,7 @@ void debugger_commands::execute_bpset(int ref, int params, const char *param[]) { device_t *cpu; const char *action = nullptr; - UINT64 address; + uint64_t address; int bpnum; /* CPU is implicit */ @@ -1126,7 +1126,7 @@ void debugger_commands::execute_bpset(int ref, int params, const char *param[]) void debugger_commands::execute_bpclear(int ref, int params, const char *param[]) { - UINT64 bpindex; + uint64_t bpindex; /* if 0 parameters, clear all */ if (params == 0) @@ -1146,9 +1146,9 @@ void debugger_commands::execute_bpclear(int ref, int params, const char *param[] if (device.debug()->breakpoint_clear(bpindex)) found = true; if (found) - m_console.printf("Breakpoint %X cleared\n", (UINT32)bpindex); + m_console.printf("Breakpoint %X cleared\n", (uint32_t)bpindex); else - m_console.printf("Invalid breakpoint number %X\n", (UINT32)bpindex); + m_console.printf("Invalid breakpoint number %X\n", (uint32_t)bpindex); } } @@ -1160,7 +1160,7 @@ void debugger_commands::execute_bpclear(int ref, int params, const char *param[] void debugger_commands::execute_bpdisenable(int ref, int params, const char *param[]) { - UINT64 bpindex; + uint64_t bpindex; /* if 0 parameters, clear all */ if (params == 0) @@ -1183,9 +1183,9 @@ void debugger_commands::execute_bpdisenable(int ref, int params, const char *par if (device.debug()->breakpoint_enable(bpindex, ref)) found = true; if (found) - m_console.printf("Breakpoint %X %s\n", (UINT32)bpindex, ref ? "enabled" : "disabled"); + m_console.printf("Breakpoint %X %s\n", (uint32_t)bpindex, ref ? "enabled" : "disabled"); else - m_console.printf("Invalid breakpoint number %X\n", (UINT32)bpindex); + m_console.printf("Invalid breakpoint number %X\n", (uint32_t)bpindex); } } @@ -1233,7 +1233,7 @@ void debugger_commands::execute_wpset(int ref, int params, const char *param[]) { address_space *space; const char *action = nullptr; - UINT64 address, length; + uint64_t address, length; int type; int wpnum; @@ -1284,7 +1284,7 @@ void debugger_commands::execute_wpset(int ref, int params, const char *param[]) void debugger_commands::execute_wpclear(int ref, int params, const char *param[]) { - UINT64 wpindex; + uint64_t wpindex; /* if 0 parameters, clear all */ if (params == 0) @@ -1304,9 +1304,9 @@ void debugger_commands::execute_wpclear(int ref, int params, const char *param[] if (device.debug()->watchpoint_clear(wpindex)) found = true; if (found) - m_console.printf("Watchpoint %X cleared\n", (UINT32)wpindex); + m_console.printf("Watchpoint %X cleared\n", (uint32_t)wpindex); else - m_console.printf("Invalid watchpoint number %X\n", (UINT32)wpindex); + m_console.printf("Invalid watchpoint number %X\n", (uint32_t)wpindex); } } @@ -1318,7 +1318,7 @@ void debugger_commands::execute_wpclear(int ref, int params, const char *param[] void debugger_commands::execute_wpdisenable(int ref, int params, const char *param[]) { - UINT64 wpindex; + uint64_t wpindex; /* if 0 parameters, clear all */ if (params == 0) @@ -1341,9 +1341,9 @@ void debugger_commands::execute_wpdisenable(int ref, int params, const char *par if (device.debug()->watchpoint_enable(wpindex, ref)) found = true; if (found) - m_console.printf("Watchpoint %X %s\n", (UINT32)wpindex, ref ? "enabled" : "disabled"); + m_console.printf("Watchpoint %X %s\n", (uint32_t)wpindex, ref ? "enabled" : "disabled"); else - m_console.printf("Invalid watchpoint number %X\n", (UINT32)wpindex); + m_console.printf("Invalid watchpoint number %X\n", (uint32_t)wpindex); } } @@ -1426,7 +1426,7 @@ void debugger_commands::execute_rpset(int ref, int params, const char *param[]) void debugger_commands::execute_rpclear(int ref, int params, const char *param[]) { - UINT64 rpindex; + uint64_t rpindex; /* if 0 parameters, clear all */ if (params == 0) @@ -1446,9 +1446,9 @@ void debugger_commands::execute_rpclear(int ref, int params, const char *param[] if (device.debug()->registerpoint_clear(rpindex)) found = true; if (found) - m_console.printf("Registerpoint %X cleared\n", (UINT32)rpindex); + m_console.printf("Registerpoint %X cleared\n", (uint32_t)rpindex); else - m_console.printf("Invalid registerpoint number %X\n", (UINT32)rpindex); + m_console.printf("Invalid registerpoint number %X\n", (uint32_t)rpindex); } } @@ -1460,7 +1460,7 @@ void debugger_commands::execute_rpclear(int ref, int params, const char *param[] void debugger_commands::execute_rpdisenable(int ref, int params, const char *param[]) { - UINT64 rpindex; + uint64_t rpindex; /* if 0 parameters, clear all */ if (params == 0) @@ -1483,9 +1483,9 @@ void debugger_commands::execute_rpdisenable(int ref, int params, const char *par if (device.debug()->registerpoint_enable(rpindex, ref)) found = true; if (found) - m_console.printf("Registerpoint %X %s\n", (UINT32)rpindex, ref ? "enabled" : "disabled"); + m_console.printf("Registerpoint %X %s\n", (uint32_t)rpindex, ref ? "enabled" : "disabled"); else - m_console.printf("Invalid registerpoint number %X\n", (UINT32)rpindex); + m_console.printf("Invalid registerpoint number %X\n", (uint32_t)rpindex); } } @@ -1552,10 +1552,10 @@ void debugger_commands::execute_hotspot(int ref, int params, const char *param[] device_t *device = nullptr; if (!validate_cpu_parameter((params > 0) ? param[0] : nullptr, &device)) return; - UINT64 count = 64; + uint64_t count = 64; if (!validate_number_parameter(param[1], &count)) return; - UINT64 threshhold = 250; + uint64_t threshhold = 250; if (!validate_number_parameter(param[2], &threshhold)) return; @@ -1602,10 +1602,10 @@ void debugger_commands::execute_stateload(int ref, int params, const char *param void debugger_commands::execute_save(int ref, int params, const char *param[]) { - UINT64 offset, endoffset, length; + uint64_t offset, endoffset, length; address_space *space; FILE *f; - UINT64 i; + uint64_t i; /* validate parameters */ if (!validate_number_parameter(param[1], &offset)) @@ -1630,7 +1630,7 @@ void debugger_commands::execute_save(int ref, int params, const char *param[]) /* now write the data out */ for (i = offset; i <= endoffset; i++) { - UINT8 byte = m_cpu.read_byte(*space, i, TRUE); + uint8_t byte = m_cpu.read_byte(*space, i, TRUE); fwrite(&byte, 1, 1, f); } @@ -1646,10 +1646,10 @@ void debugger_commands::execute_save(int ref, int params, const char *param[]) void debugger_commands::execute_load(int ref, int params, const char *param[]) { - UINT64 offset, endoffset, length; + uint64_t offset, endoffset, length; address_space *space; FILE *f; - UINT64 i; + uint64_t i; /* validate parameters */ if (!validate_number_parameter(param[1], &offset)) @@ -1672,7 +1672,7 @@ void debugger_commands::execute_load(int ref, int params, const char *param[]) } /* now read the data in, ignore endoffset and load entire file if length has been set to zero (offset-1) */ - UINT8 byte; + uint8_t byte; for (i = offset; i <= endoffset || endoffset == offset - 1 ; i++) { fread(&byte, 1, 1, f); @@ -1697,23 +1697,23 @@ void debugger_commands::execute_load(int ref, int params, const char *param[]) void debugger_commands::execute_dump(int ref, int params, const char *param[]) { /* validate parameters */ - UINT64 offset; + uint64_t offset; if (!validate_number_parameter(param[1], &offset)) return; - UINT64 length; + uint64_t length; if (!validate_number_parameter(param[2], &length)) return; - UINT64 width = 0; + uint64_t width = 0; if (!validate_number_parameter(param[3], &width)) return; - UINT64 ascii = 1; + uint64_t ascii = 1; if (!validate_number_parameter(param[4], &ascii)) return; - UINT64 rowsize = 16; + uint64_t rowsize = 16; if (!validate_number_parameter(param[5], &rowsize)) return; @@ -1737,7 +1737,7 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[]) return; } - UINT64 endoffset = space->address_to_byte(offset + length - 1) & space->bytemask(); + uint64_t endoffset = space->address_to_byte(offset + length - 1) & space->bytemask(); offset = space->address_to_byte(offset) & space->bytemask(); /* open the file */ @@ -1751,23 +1751,23 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[]) /* now write the data out */ util::ovectorstream output; output.reserve(200); - for (UINT64 i = offset; i <= endoffset; i += rowsize) + for (uint64_t i = offset; i <= endoffset; i += rowsize) { output.clear(); output.rdbuf()->clear(); /* print the address */ - util::stream_format(output, "%0*X: ", space->logaddrchars(), (UINT32)space->byte_to_address(i)); + util::stream_format(output, "%0*X: ", space->logaddrchars(), (uint32_t)space->byte_to_address(i)); /* print the bytes */ - for (UINT64 j = 0; j < rowsize; j += width) + for (uint64_t j = 0; j < rowsize; j += width) { if (i + j <= endoffset) { offs_t curaddr = i + j; if (space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr)) { - UINT64 value = m_cpu.read_memory(*space, i + j, width, TRUE); + uint64_t value = m_cpu.read_memory(*space, i + j, width, TRUE); util::stream_format(output, " %0*X", width * 2, value); } else @@ -1783,12 +1783,12 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[]) if (ascii) { util::stream_format(output, " "); - for (UINT64 j = 0; j < rowsize && (i + j) <= endoffset; j++) + for (uint64_t j = 0; j < rowsize && (i + j) <= endoffset; j++) { offs_t curaddr = i + j; if (space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr)) { - UINT8 byte = m_cpu.read_byte(*space, i + j, TRUE); + uint8_t byte = m_cpu.read_byte(*space, i + j, TRUE); util::stream_format(output, "%c", (byte >= 32 && byte < 127) ? byte : '.'); } else @@ -1815,11 +1815,11 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[]) void debugger_commands::execute_cheatinit(int ref, int params, const char *param[]) { - UINT64 offset, length = 0, real_length = 0; + uint64_t offset, length = 0, real_length = 0; address_space *space; - UINT32 active_cheat = 0; - UINT64 curaddr; - UINT8 i, region_count = 0; + uint32_t active_cheat = 0; + uint64_t curaddr; + uint8_t i, region_count = 0; cheat_region_map cheat_region[100]; @@ -1969,10 +1969,10 @@ void debugger_commands::execute_cheatinit(int ref, int params, const char *param void debugger_commands::execute_cheatnext(int ref, int params, const char *param[]) { address_space *space; - UINT64 cheatindex; - UINT32 active_cheat = 0; - UINT8 condition; - UINT64 comp_value = 0; + uint64_t cheatindex; + uint32_t active_cheat = 0; + uint8_t condition; + uint64_t comp_value = 0; enum { @@ -2038,9 +2038,9 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param for (cheatindex = 0; cheatindex < m_cheat.cheatmap.size(); cheatindex += 1) if (m_cheat.cheatmap[cheatindex].state == 1) { - UINT64 cheat_value = cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset); - UINT64 comp_byte = (ref == 0) ? m_cheat.cheatmap[cheatindex].previous_value : m_cheat.cheatmap[cheatindex].first_value; - UINT8 disable_byte = FALSE; + uint64_t cheat_value = cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset); + uint64_t comp_byte = (ref == 0) ? m_cheat.cheatmap[cheatindex].previous_value : m_cheat.cheatmap[cheatindex].first_value; + uint8_t disable_byte = FALSE; switch (condition) { @@ -2065,30 +2065,30 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param case CHEAT_DECREASE: if (m_cheat.signed_cheat) - disable_byte = ((INT64)cheat_value >= (INT64)comp_byte); + disable_byte = ((int64_t)cheat_value >= (int64_t)comp_byte); else - disable_byte = ((UINT64)cheat_value >= (UINT64)comp_byte); + disable_byte = ((uint64_t)cheat_value >= (uint64_t)comp_byte); break; case CHEAT_INCREASE: if (m_cheat.signed_cheat) - disable_byte = ((INT64)cheat_value <= (INT64)comp_byte); + disable_byte = ((int64_t)cheat_value <= (int64_t)comp_byte); else - disable_byte = ((UINT64)cheat_value <= (UINT64)comp_byte); + disable_byte = ((uint64_t)cheat_value <= (uint64_t)comp_byte); break; case CHEAT_DECREASE_OR_EQUAL: if (m_cheat.signed_cheat) - disable_byte = ((INT64)cheat_value > (INT64)comp_byte); + disable_byte = ((int64_t)cheat_value > (int64_t)comp_byte); else - disable_byte = ((UINT64)cheat_value > (UINT64)comp_byte); + disable_byte = ((uint64_t)cheat_value > (uint64_t)comp_byte); break; case CHEAT_INCREASE_OR_EQUAL: if (m_cheat.signed_cheat) - disable_byte = ((INT64)cheat_value < (INT64)comp_byte); + disable_byte = ((int64_t)cheat_value < (int64_t)comp_byte); else - disable_byte = ((UINT64)cheat_value < (UINT64)comp_byte); + disable_byte = ((uint64_t)cheat_value < (uint64_t)comp_byte); break; case CHEAT_DECREASEOF: @@ -2101,16 +2101,16 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param case CHEAT_SMALLEROF: if (m_cheat.signed_cheat) - disable_byte = ((INT64)cheat_value >= (INT64)comp_value); + disable_byte = ((int64_t)cheat_value >= (int64_t)comp_value); else - disable_byte = ((UINT64)cheat_value >= (UINT64)comp_value); + disable_byte = ((uint64_t)cheat_value >= (uint64_t)comp_value); break; case CHEAT_GREATEROF: if (m_cheat.signed_cheat) - disable_byte = ((INT64)cheat_value <= (INT64)comp_value); + disable_byte = ((int64_t)cheat_value <= (int64_t)comp_value); else - disable_byte = ((UINT64)cheat_value <= (UINT64)comp_value); + disable_byte = ((uint64_t)cheat_value <= (uint64_t)comp_value); break; case CHEAT_CHANGEDBY: if (cheat_value > comp_byte) @@ -2148,9 +2148,9 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param char spaceletter, sizeletter; address_space *space; device_t *cpu; - UINT32 active_cheat = 0; - UINT64 cheatindex; - UINT64 sizemask; + uint32_t active_cheat = 0; + uint64_t cheatindex; + uint64_t sizemask; FILE *f = nullptr; if (!validate_cpu_space_parameter(m_cheat.cpu, AS_PROGRAM, space)) @@ -2185,7 +2185,7 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param { if (m_cheat.cheatmap[cheatindex].state == 1) { - UINT64 value = cheat_byte_swap(&m_cheat, cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset)) & sizemask; + uint64_t value = cheat_byte_swap(&m_cheat, cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset)) & sizemask; offs_t address = space->byte_to_address(m_cheat.cheatmap[cheatindex].offset); if (params > 0) @@ -2226,8 +2226,8 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param void debugger_commands::execute_cheatundo(int ref, int params, const char *param[]) { - UINT64 cheatindex; - UINT32 undo_count = 0; + uint64_t cheatindex; + uint32_t undo_count = 0; if (m_cheat.undo > 0) { @@ -2255,10 +2255,10 @@ void debugger_commands::execute_cheatundo(int ref, int params, const char *param void debugger_commands::execute_find(int ref, int params, const char *param[]) { - UINT64 offset, endoffset, length; + uint64_t offset, endoffset, length; address_space *space; - UINT64 data_to_find[256]; - UINT8 data_size[256]; + uint64_t data_to_find[256]; + uint8_t data_size[256]; int cur_data_size; int data_count = 0; int found = 0; @@ -2300,10 +2300,10 @@ void debugger_commands::execute_find(int ref, int params, const char *param[]) { /* check for a 'b','w','d',or 'q' prefix */ data_size[data_count] = cur_data_size; - if (tolower((UINT8)pdata[0]) == 'b' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 1; pdata += 2; } - if (tolower((UINT8)pdata[0]) == 'w' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 2; pdata += 2; } - if (tolower((UINT8)pdata[0]) == 'd' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 4; pdata += 2; } - if (tolower((UINT8)pdata[0]) == 'q' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 8; pdata += 2; } + if (tolower((uint8_t)pdata[0]) == 'b' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 1; pdata += 2; } + if (tolower((uint8_t)pdata[0]) == 'w' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 2; pdata += 2; } + if (tolower((uint8_t)pdata[0]) == 'd' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 4; pdata += 2; } + if (tolower((uint8_t)pdata[0]) == 'q' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 8; pdata += 2; } /* look for a wildcard */ if (!strcmp(pdata, "?")) @@ -2316,7 +2316,7 @@ void debugger_commands::execute_find(int ref, int params, const char *param[]) } /* now search */ - for (UINT64 i = offset; i <= endoffset; i += data_size[0]) + for (uint64_t i = offset; i <= endoffset; i += data_size[0]) { int suboffset = 0; int match = 1; @@ -2326,10 +2326,10 @@ void debugger_commands::execute_find(int ref, int params, const char *param[]) { switch (data_size[j]) { - case 1: match = ((UINT8)m_cpu.read_byte(*space, i + suboffset, TRUE) == (UINT8)data_to_find[j]); break; - case 2: match = ((UINT16)m_cpu.read_word(*space, i + suboffset, TRUE) == (UINT16)data_to_find[j]); break; - case 4: match = ((UINT32)m_cpu.read_dword(*space, i + suboffset, TRUE) == (UINT32)data_to_find[j]); break; - case 8: match = ((UINT64)m_cpu.read_qword(*space, i + suboffset, TRUE) == (UINT64)data_to_find[j]); break; + case 1: match = ((uint8_t)m_cpu.read_byte(*space, i + suboffset, TRUE) == (uint8_t)data_to_find[j]); break; + case 2: match = ((uint16_t)m_cpu.read_word(*space, i + suboffset, TRUE) == (uint16_t)data_to_find[j]); break; + case 4: match = ((uint32_t)m_cpu.read_dword(*space, i + suboffset, TRUE) == (uint32_t)data_to_find[j]); break; + case 8: match = ((uint64_t)m_cpu.read_qword(*space, i + suboffset, TRUE) == (uint64_t)data_to_find[j]); break; default: /* all other cases are wildcards */ break; } suboffset += data_size[j] & 0x0f; @@ -2339,7 +2339,7 @@ void debugger_commands::execute_find(int ref, int params, const char *param[]) if (match) { found++; - m_console.printf("Found at %0*X\n", space->addrchars(), (UINT32)space->byte_to_address(i)); + m_console.printf("Found at %0*X\n", space->addrchars(), (uint32_t)space->byte_to_address(i)); } } @@ -2355,7 +2355,7 @@ void debugger_commands::execute_find(int ref, int params, const char *param[]) void debugger_commands::execute_dasm(int ref, int params, const char *param[]) { - UINT64 offset, length, bytes = 1; + uint64_t offset, length, bytes = 1; int minbytes, maxbytes, byteswidth; address_space *space, *decrypted_space; FILE *f; @@ -2402,7 +2402,7 @@ void debugger_commands::execute_dasm(int ref, int params, const char *param[]) /* now write the data out */ util::ovectorstream output; output.reserve(512); - for (UINT64 i = 0; i < length; ) + for (uint64_t i = 0; i < length; ) { int pcbyte = space->address_to_byte(offset + i) & space->bytemask(); char disasm[200]; @@ -2413,13 +2413,13 @@ void debugger_commands::execute_dasm(int ref, int params, const char *param[]) output.rdbuf()->clear(); /* print the address */ - stream_format(output, "%0*X: ", space->logaddrchars(), (UINT32)space->byte_to_address(pcbyte)); + stream_format(output, "%0*X: ", space->logaddrchars(), (uint32_t)space->byte_to_address(pcbyte)); /* make sure we can translate the address */ tempaddr = pcbyte; if (space->device().memory().translate(space->spacenum(), TRANSLATE_FETCH_DEBUG, tempaddr)) { - UINT8 opbuf[64], argbuf[64]; + uint8_t opbuf[64], argbuf[64]; /* fetch the bytes up to the maximum */ for (numbytes = 0; numbytes < maxbytes; numbytes++) @@ -2573,7 +2573,7 @@ void debugger_commands::execute_history(int ref, int params, const char *param[] else decrypted_space = space; - UINT64 count = device_debug::HISTORY_SIZE; + uint64_t count = device_debug::HISTORY_SIZE; if (!validate_number_parameter(param[1], &count)) return; @@ -2597,7 +2597,7 @@ void debugger_commands::execute_history(int ref, int params, const char *param[] /* fetch the bytes up to the maximum */ offs_t pcbyte = space->address_to_byte(pc) & space->bytemask(); - UINT8 opbuf[64], argbuf[64]; + uint8_t opbuf[64], argbuf[64]; for (int numbytes = 0; numbytes < maxbytes; numbytes++) { opbuf[numbytes] = m_cpu.read_opcode(*decrypted_space, pcbyte + numbytes, 1); @@ -2619,7 +2619,7 @@ void debugger_commands::execute_history(int ref, int params, const char *param[] void debugger_commands::execute_trackpc(int ref, int params, const char *param[]) { // Gather the on/off switch (if present) - UINT64 turnOn = true; + uint64_t turnOn = true; if (!validate_number_parameter(param[0], &turnOn)) return; @@ -2629,7 +2629,7 @@ void debugger_commands::execute_trackpc(int ref, int params, const char *param[] return; // Should we clear the existing data? - UINT64 clear = false; + uint64_t clear = false; if (!validate_number_parameter(param[2], &clear)) return; @@ -2661,7 +2661,7 @@ void debugger_commands::execute_trackpc(int ref, int params, const char *param[] void debugger_commands::execute_trackmem(int ref, int params, const char *param[]) { // Gather the on/off switch (if present) - UINT64 turnOn = true; + uint64_t turnOn = true; if (!validate_number_parameter(param[0], &turnOn)) return; @@ -2671,7 +2671,7 @@ void debugger_commands::execute_trackmem(int ref, int params, const char *param[ return; // Should we clear the existing data? - UINT64 clear = false; + uint64_t clear = false; if (!validate_number_parameter(param[2], &clear)) return; @@ -2699,7 +2699,7 @@ void debugger_commands::execute_trackmem(int ref, int params, const char *param[ void debugger_commands::execute_pcatmem(int ref, int params, const char *param[]) { // Gather the required address parameter - UINT64 address; + uint64_t address; if (!validate_number_parameter(param[0], &address)) return; @@ -2715,7 +2715,7 @@ void debugger_commands::execute_pcatmem(int ref, int params, const char *param[] // Get the value of memory at the address const int native_data_width = space->data_width() / 8; - const UINT64 data = m_cpu.read_memory(*space, space->address_to_byte(address), native_data_width, true); + const uint64_t data = m_cpu.read_memory(*space, space->address_to_byte(address), native_data_width, true); // Recover the pc & print const address_spacenum space_num = (address_spacenum)ref; @@ -2791,7 +2791,7 @@ void debugger_commands::execute_map(int ref, int params, const char *param[]) { address_space *space; offs_t taddress; - UINT64 address; + uint64_t address; int intention; /* validate parameters */ @@ -2899,7 +2899,7 @@ void debugger_commands::execute_symlist(int ref, int params, const char **param) { const symbol_entry *entry = symtable->find(namelist[symnum]); assert(entry != nullptr); - UINT64 value = entry->value(); + uint64_t value = entry->value(); /* only display "register" type symbols */ m_console.printf("%s = %X", namelist[symnum], value); diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h index eae6fc611d3..b65b49b68ea 100644 --- a/src/emu/debug/debugcmd.h +++ b/src/emu/debug/debugcmd.h @@ -29,7 +29,7 @@ public: bool validate_boolean_parameter(const char *param, bool *result); /* validates a parameter as a numeric value */ - bool validate_number_parameter(const char *param, UINT64 *result); + bool validate_number_parameter(const char *param, uint64_t *result); /* validates a parameter as a cpu */ bool validate_cpu_parameter(const char *param, device_t **result); @@ -41,55 +41,55 @@ private: struct global_entry { void * base; - UINT32 size; + uint32_t size; }; struct cheat_map { - UINT64 offset; - UINT64 first_value; - UINT64 previous_value; - UINT8 state:1; - UINT8 undo:7; + uint64_t offset; + uint64_t first_value; + uint64_t previous_value; + uint8_t state:1; + uint8_t undo:7; }; // TODO [RH 31 May 2016]: Move this cheat stuff into its own class struct cheat_system { char cpu[2]; - UINT8 width; + uint8_t width; std::vector cheatmap; - UINT8 undo; - UINT8 signed_cheat; - UINT8 swapped_cheat; + uint8_t undo; + uint8_t signed_cheat; + uint8_t swapped_cheat; }; struct cheat_region_map { - UINT64 offset; - UINT64 endoffset; + uint64_t offset; + uint64_t endoffset; const char *share; - UINT8 disabled; + uint8_t disabled; }; bool debug_command_parameter_expression(const char *param, parsed_expression &result); bool debug_command_parameter_command(const char *param); bool cheat_address_is_valid(address_space &space, offs_t address); - UINT64 cheat_sign_extend(const cheat_system *cheatsys, UINT64 value); - UINT64 cheat_byte_swap(const cheat_system *cheatsys, UINT64 value); - UINT64 cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address); + uint64_t cheat_sign_extend(const cheat_system *cheatsys, uint64_t value); + uint64_t cheat_byte_swap(const cheat_system *cheatsys, uint64_t value); + uint64_t cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address); - UINT64 execute_min(symbol_table &table, void *ref, int params, const UINT64 *param); - UINT64 execute_max(symbol_table &table, void *ref, int params, const UINT64 *param); - UINT64 execute_if(symbol_table &table, void *ref, int params, const UINT64 *param); + uint64_t execute_min(symbol_table &table, void *ref, int params, const uint64_t *param); + uint64_t execute_max(symbol_table &table, void *ref, int params, const uint64_t *param); + uint64_t execute_if(symbol_table &table, void *ref, int params, const uint64_t *param); - UINT64 global_get(symbol_table &table, void *ref); - void global_set(symbol_table &table, void *ref, UINT64 value); + uint64_t global_get(symbol_table &table, void *ref); + void global_set(symbol_table &table, void *ref, uint64_t value); - int mini_printf(char *buffer, const char *format, int params, UINT64 *param); + int mini_printf(char *buffer, const char *format, int params, uint64_t *param); void execute_trace_internal(int ref, int params, const char *param[], bool trace_over); diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp index b90c9e0d556..8d40bf6c449 100644 --- a/src/emu/debug/debugcon.cpp +++ b/src/emu/debug/debugcon.cpp @@ -165,12 +165,12 @@ CMDERR debugger_console::internal_execute_command(bool execute, int params, char return CMDERR_NONE; /* the first parameter has the command and the real first parameter; separate them */ - for (p = param[0]; *p && isspace((UINT8)*p); p++) { } - for (command = p; *p && !isspace((UINT8)*p); p++) { } + for (p = param[0]; *p && isspace((uint8_t)*p); p++) { } + for (command = p; *p && !isspace((uint8_t)*p); p++) { } if (*p != 0) { *p++ = 0; - for ( ; *p && isspace((UINT8)*p); p++) { } + for ( ; *p && isspace((uint8_t)*p); p++) { } if (*p != 0) param[0] = p; else @@ -270,7 +270,7 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo case '+': if (parendex == 0 && paramcount == 1 && p[1] == '+') isexpr = TRUE; *p = c; break; case '=': if (parendex == 0 && paramcount == 1) isexpr = TRUE; *p = c; break; case 0: foundend = TRUE; break; - default: *p = tolower((UINT8)c); break; + default: *p = tolower((uint8_t)c); break; } } } @@ -289,7 +289,7 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo command_start = params[0]; /* allow for "do" commands */ - if (tolower((UINT8)command_start[0] == 'd') && tolower((UINT8)command_start[1] == 'o') && isspace((UINT8)command_start[2])) + if (tolower((uint8_t)command_start[0] == 'd') && tolower((uint8_t)command_start[1] == 'o') && isspace((uint8_t)command_start[2])) { isexpr = TRUE; command_start += 3; @@ -300,7 +300,7 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo { try { - UINT64 expresult; + uint64_t expresult; parsed_expression expression(m_machine.debugger().cpu().get_visible_symtable(), command_start, &expresult); } catch (expression_error &err) @@ -367,7 +367,7 @@ CMDERR debugger_console::validate_command(const char *command) register_command - register a command handler -------------------------------------------------*/ -void debugger_console::register_command(const char *command, UINT32 flags, int ref, int minparams, int maxparams, std::function handler) +void debugger_console::register_command(const char *command, uint32_t flags, int ref, int minparams, int maxparams, std::function handler) { assert_always(m_machine.phase() == MACHINE_PHASE_INIT, "Can only call register_command() at init time!"); assert_always((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call register_command() when debugger is not running"); diff --git a/src/emu/debug/debugcon.h b/src/emu/debug/debugcon.h index e6e5145119a..7a06c68c5f1 100644 --- a/src/emu/debug/debugcon.h +++ b/src/emu/debug/debugcon.h @@ -67,7 +67,7 @@ ***************************************************************************/ /* CMDERR is an error code for command evaluation */ -typedef UINT32 CMDERR; +typedef uint32_t CMDERR; class debugger_console { @@ -77,7 +77,7 @@ public: /* command handling */ CMDERR execute_command(const char *command, bool echo); CMDERR validate_command(const char *command); - void register_command(const char *command, UINT32 flags, int ref, int minparams, int maxparams, std::function handler); + void register_command(const char *command, uint32_t flags, int ref, int minparams, int maxparams, std::function handler); /* console management */ void vprintf(util::format_argument_pack const &args); @@ -118,7 +118,7 @@ private: const char * params; const char * help; std::function handler; - UINT32 flags; + uint32_t flags; int ref; int minparams; int maxparams; diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index e0c4d3b514d..45cf761fe1a 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -52,7 +52,7 @@ debugger_cpu::debugger_cpu(running_machine &machine) { screen_device *first_screen = m_machine.first_screen(); - m_tempvar = make_unique_clear(NUM_TEMP_VARIABLES); + m_tempvar = make_unique_clear(NUM_TEMP_VARIABLES); /* create a global symbol table */ m_symtable = std::make_unique(&m_machine); @@ -357,7 +357,7 @@ bool debugger_cpu::comment_load(bool is_inline) memory space -------------------------------------------------*/ -UINT8 debugger_cpu::read_byte(address_space &space, offs_t address, int apply_translation) +uint8_t debugger_cpu::read_byte(address_space &space, offs_t address, int apply_translation) { device_memory_interface &memory = space.device().memory(); @@ -369,8 +369,8 @@ UINT8 debugger_cpu::read_byte(address_space &space, offs_t address, int apply_tr space.set_debugger_access(true); /* translate if necessary; if not mapped, return 0xff */ - UINT64 custom; - UINT8 result; + uint64_t custom; + uint8_t result; if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) { result = 0xff; @@ -396,16 +396,16 @@ UINT8 debugger_cpu::read_byte(address_space &space, offs_t address, int apply_tr memory space -------------------------------------------------*/ -UINT16 debugger_cpu::read_word(address_space &space, offs_t address, int apply_translation) +uint16_t debugger_cpu::read_word(address_space &space, offs_t address, int apply_translation) { /* mask against the logical byte mask */ address &= space.logbytemask(); - UINT16 result; + uint16_t result; if (!WORD_ALIGNED(address)) { /* if this is misaligned read, or if there are no word readers, just read two bytes */ - UINT8 byte0 = read_byte(space, address + 0, apply_translation); - UINT8 byte1 = read_byte(space, address + 1, apply_translation); + uint8_t byte0 = read_byte(space, address + 0, apply_translation); + uint8_t byte1 = read_byte(space, address + 1, apply_translation); /* based on the endianness, the result is assembled differently */ if (space.endianness() == ENDIANNESS_LITTLE) @@ -422,7 +422,7 @@ UINT16 debugger_cpu::read_word(address_space &space, offs_t address, int apply_t space.set_debugger_access(true); /* translate if necessary; if not mapped, return 0xffff */ - UINT64 custom; + uint64_t custom; if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) { result = 0xffff; @@ -450,16 +450,16 @@ UINT16 debugger_cpu::read_word(address_space &space, offs_t address, int apply_t memory space -------------------------------------------------*/ -UINT32 debugger_cpu::read_dword(address_space &space, offs_t address, int apply_translation) +uint32_t debugger_cpu::read_dword(address_space &space, offs_t address, int apply_translation) { /* mask against the logical byte mask */ address &= space.logbytemask(); - UINT32 result; + uint32_t result; if (!DWORD_ALIGNED(address)) { /* if this is a misaligned read, or if there are no dword readers, just read two words */ - UINT16 word0 = read_word(space, address + 0, apply_translation); - UINT16 word1 = read_word(space, address + 2, apply_translation); + uint16_t word0 = read_word(space, address + 0, apply_translation); + uint16_t word1 = read_word(space, address + 2, apply_translation); /* based on the endianness, the result is assembled differently */ if (space.endianness() == ENDIANNESS_LITTLE) @@ -475,7 +475,7 @@ UINT32 debugger_cpu::read_dword(address_space &space, offs_t address, int apply_ m_debugger_access = true; space.set_debugger_access(true); - UINT64 custom; + uint64_t custom; if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) { /* translate if necessary; if not mapped, return 0xffffffff */ result = 0xffffffff; @@ -503,22 +503,22 @@ UINT32 debugger_cpu::read_dword(address_space &space, offs_t address, int apply_ memory space -------------------------------------------------*/ -UINT64 debugger_cpu::read_qword(address_space &space, offs_t address, int apply_translation) +uint64_t debugger_cpu::read_qword(address_space &space, offs_t address, int apply_translation) { /* mask against the logical byte mask */ address &= space.logbytemask(); - UINT64 result; + uint64_t result; if (!QWORD_ALIGNED(address)) { /* if this is a misaligned read, or if there are no qword readers, just read two dwords */ - UINT32 dword0 = read_dword(space, address + 0, apply_translation); - UINT32 dword1 = read_dword(space, address + 4, apply_translation); + uint32_t dword0 = read_dword(space, address + 0, apply_translation); + uint32_t dword1 = read_dword(space, address + 4, apply_translation); /* based on the endianness, the result is assembled differently */ if (space.endianness() == ENDIANNESS_LITTLE) - result = dword0 | ((UINT64)dword1 << 32); + result = dword0 | ((uint64_t)dword1 << 32); else - result = dword1 | ((UINT64)dword0 << 32); + result = dword1 | ((uint64_t)dword0 << 32); } else { /* otherwise, this proceeds like the byte case */ @@ -529,10 +529,10 @@ UINT64 debugger_cpu::read_qword(address_space &space, offs_t address, int apply_ space.set_debugger_access(true); /* translate if necessary; if not mapped, return 0xffffffffffffffff */ - UINT64 custom; + uint64_t custom; if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address)) { - result = ~(UINT64)0; + result = ~(uint64_t)0; } else if (memory.read(space.spacenum(), address, 8, custom)) { /* if there is a custom read handler, and it returns true, use that value */ @@ -557,9 +557,9 @@ UINT64 debugger_cpu::read_qword(address_space &space, offs_t address, int apply_ from the specified memory space -------------------------------------------------*/ -UINT64 debugger_cpu::read_memory(address_space &space, offs_t address, int size, int apply_translation) +uint64_t debugger_cpu::read_memory(address_space &space, offs_t address, int size, int apply_translation) { - UINT64 result = ~(UINT64)0 >> (64 - 8*size); + uint64_t result = ~(uint64_t)0 >> (64 - 8*size); switch (size) { case 1: result = read_byte(space, address, apply_translation); break; @@ -576,7 +576,7 @@ UINT64 debugger_cpu::read_memory(address_space &space, offs_t address, int size, memory space -------------------------------------------------*/ -void debugger_cpu::write_byte(address_space &space, offs_t address, UINT8 data, int apply_translation) +void debugger_cpu::write_byte(address_space &space, offs_t address, uint8_t data, int apply_translation) { device_memory_interface &memory = space.device().memory(); @@ -612,7 +612,7 @@ void debugger_cpu::write_byte(address_space &space, offs_t address, UINT8 data, memory space -------------------------------------------------*/ -void debugger_cpu::write_word(address_space &space, offs_t address, UINT16 data, int apply_translation) +void debugger_cpu::write_word(address_space &space, offs_t address, uint16_t data, int apply_translation) { /* mask against the logical byte mask */ address &= space.logbytemask(); @@ -667,7 +667,7 @@ void debugger_cpu::write_word(address_space &space, offs_t address, UINT16 data, memory space -------------------------------------------------*/ -void debugger_cpu::write_dword(address_space &space, offs_t address, UINT32 data, int apply_translation) +void debugger_cpu::write_dword(address_space &space, offs_t address, uint32_t data, int apply_translation) { /* mask against the logical byte mask */ address &= space.logbytemask(); @@ -721,7 +721,7 @@ void debugger_cpu::write_dword(address_space &space, offs_t address, UINT32 data memory space -------------------------------------------------*/ -void debugger_cpu::write_qword(address_space &space, offs_t address, UINT64 data, int apply_translation) +void debugger_cpu::write_qword(address_space &space, offs_t address, uint64_t data, int apply_translation) { /* mask against the logical byte mask */ address &= space.logbytemask(); @@ -776,7 +776,7 @@ void debugger_cpu::write_qword(address_space &space, offs_t address, UINT64 data specified memory space -------------------------------------------------*/ -void debugger_cpu::write_memory(address_space &space, offs_t address, UINT64 data, int size, int apply_translation) +void debugger_cpu::write_memory(address_space &space, offs_t address, uint64_t data, int size, int apply_translation) { switch (size) { @@ -793,11 +793,11 @@ void debugger_cpu::write_memory(address_space &space, offs_t address, UINT64 dat given offset from opcode space -------------------------------------------------*/ -UINT64 debugger_cpu::read_opcode(address_space &space, offs_t address, int size) +uint64_t debugger_cpu::read_opcode(address_space &space, offs_t address, int size) { device_memory_interface &memory = space.device().memory(); - UINT64 result = ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size)), result2; + uint64_t result = ~(uint64_t)0 & (~(uint64_t)0 >> (64 - 8*size)), result2; /* keep in logical range */ address &= space.logbytemask(); @@ -816,8 +816,8 @@ UINT64 debugger_cpu::read_opcode(address_space &space, offs_t address, int size) if (size > space.data_width() / 8) { int halfsize = size / 2; - UINT64 r0 = read_opcode(space, address + 0, halfsize); - UINT64 r1 = read_opcode(space, address + halfsize, halfsize); + uint64_t r0 = read_opcode(space, address + 0, halfsize); + uint64_t r1 = read_opcode(space, address + halfsize, halfsize); if (space.endianness() == ENDIANNESS_LITTLE) return r0 | (r1 << (8 * halfsize)); @@ -1005,7 +1005,7 @@ void debugger_cpu::process_source_file() /* strip whitespace */ int i = (int)strlen(buf); - while((i > 0) && (isspace((UINT8)buf[i-1]))) + while((i > 0) && (isspace((uint8_t)buf[i-1]))) buf[--i] = '\0'; /* execute the command */ @@ -1040,7 +1040,7 @@ device_t* debugger_cpu::expression_get_device(const char *tag) space -------------------------------------------------*/ -UINT64 debugger_cpu::expression_read_memory(void *param, const char *name, expression_space spacenum, UINT32 address, int size) +uint64_t debugger_cpu::expression_read_memory(void *param, const char *name, expression_space spacenum, uint32_t address, int size) { switch (spacenum) { @@ -1126,9 +1126,9 @@ UINT64 debugger_cpu::expression_read_memory(void *param, const char *name, expre directly from an opcode or RAM pointer -------------------------------------------------*/ -UINT64 debugger_cpu::expression_read_program_direct(address_space &space, int opcode, offs_t address, int size) +uint64_t debugger_cpu::expression_read_program_direct(address_space &space, int opcode, offs_t address, int size) { - UINT8 *base; + uint8_t *base; /* adjust the address into a byte address, but not if being called recursively */ if ((opcode & 2) == 0) @@ -1140,8 +1140,8 @@ UINT64 debugger_cpu::expression_read_program_direct(address_space &space, int op int halfsize = size / 2; /* read each half, from lower address to upper address */ - UINT64 r0 = expression_read_program_direct(space, opcode | 2, address + 0, halfsize); - UINT64 r1 = expression_read_program_direct(space, opcode | 2, address + halfsize, halfsize); + uint64_t r0 = expression_read_program_direct(space, opcode | 2, address + 0, halfsize); + uint64_t r1 = expression_read_program_direct(space, opcode | 2, address + halfsize, halfsize); /* assemble based on the target endianness */ if (space.endianness() == ENDIANNESS_LITTLE) @@ -1157,7 +1157,7 @@ UINT64 debugger_cpu::expression_read_program_direct(address_space &space, int op offs_t lowmask = space.data_width() / 8 - 1; /* get the base of memory, aligned to the address minus the lowbits */ - base = (UINT8 *)space.get_read_ptr(address & ~lowmask); + base = (uint8_t *)space.get_read_ptr(address & ~lowmask); /* if we have a valid base, return the appropriate byte */ if (base != nullptr) @@ -1178,10 +1178,10 @@ UINT64 debugger_cpu::expression_read_program_direct(address_space &space, int op from a memory region -------------------------------------------------*/ -UINT64 debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t address, int size) +uint64_t debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t address, int size) { memory_region *region = m_machine.root_device().memregion(rgntag); - UINT64 result = ~(UINT64)0 >> (64 - 8*size); + uint64_t result = ~(uint64_t)0 >> (64 - 8*size); /* make sure we get a valid base before proceeding */ if (region != nullptr) @@ -1190,7 +1190,7 @@ UINT64 debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t ad if (size > 1) { int halfsize = size / 2; - UINT64 r0, r1; + uint64_t r0, r1; /* read each half, from lower address to upper address */ r0 = expression_read_memory_region(rgntag, address + 0, halfsize); @@ -1207,8 +1207,8 @@ UINT64 debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t ad else if (address < region->bytes()) { /* lowmask specified which address bits are within the databus width */ - UINT32 lowmask = region->bytewidth() - 1; - UINT8 *base = region->base() + (address & ~lowmask); + uint32_t lowmask = region->bytewidth() - 1; + uint8_t *base = region->base() + (address & ~lowmask); /* if we have a valid base, return the appropriate byte */ if (region->endianness() == ENDIANNESS_LITTLE) @@ -1227,7 +1227,7 @@ UINT64 debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t ad space -------------------------------------------------*/ -void debugger_cpu::expression_write_memory(void *param, const char *name, expression_space spacenum, UINT32 address, int size, UINT64 data) +void debugger_cpu::expression_write_memory(void *param, const char *name, expression_space spacenum, uint32_t address, int size, uint64_t data) { device_t *device = nullptr; device_memory_interface *memory; @@ -1299,7 +1299,7 @@ void debugger_cpu::expression_write_memory(void *param, const char *name, expres directly to an opcode or RAM pointer -------------------------------------------------*/ -void debugger_cpu::expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, UINT64 data) +void debugger_cpu::expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, uint64_t data) { /* adjust the address into a byte address, but not if being called recursively */ if ((opcode & 2) == 0) @@ -1311,8 +1311,8 @@ void debugger_cpu::expression_write_program_direct(address_space &space, int opc int halfsize = size / 2; /* break apart based on the target endianness */ - UINT64 halfmask = ~(UINT64)0 >> (64 - 8 * halfsize); - UINT64 r0, r1; + uint64_t halfmask = ~(uint64_t)0 >> (64 - 8 * halfsize); + uint64_t r0, r1; if (space.endianness() == ENDIANNESS_LITTLE) { r0 = data & halfmask; @@ -1336,7 +1336,7 @@ void debugger_cpu::expression_write_program_direct(address_space &space, int opc offs_t lowmask = space.data_width() / 8 - 1; /* get the base of memory, aligned to the address minus the lowbits */ - UINT8 *base = (UINT8 *)space.get_read_ptr(address & ~lowmask); + uint8_t *base = (uint8_t *)space.get_read_ptr(address & ~lowmask); /* if we have a valid base, write the appropriate byte */ if (base != nullptr) @@ -1356,7 +1356,7 @@ void debugger_cpu::expression_write_program_direct(address_space &space, int opc from a memory region -------------------------------------------------*/ -void debugger_cpu::expression_write_memory_region(const char *rgntag, offs_t address, int size, UINT64 data) +void debugger_cpu::expression_write_memory_region(const char *rgntag, offs_t address, int size, uint64_t data) { memory_region *region = m_machine.root_device().memregion(rgntag); @@ -1369,8 +1369,8 @@ void debugger_cpu::expression_write_memory_region(const char *rgntag, offs_t add int halfsize = size / 2; /* break apart based on the target endianness */ - UINT64 halfmask = ~(UINT64)0 >> (64 - 8 * halfsize); - UINT64 r0, r1; + uint64_t halfmask = ~(uint64_t)0 >> (64 - 8 * halfsize); + uint64_t r0, r1; if (region->endianness() == ENDIANNESS_LITTLE) { r0 = data & halfmask; @@ -1391,8 +1391,8 @@ void debugger_cpu::expression_write_memory_region(const char *rgntag, offs_t add else if (address < region->bytes()) { /* lowmask specified which address bits are within the databus width */ - UINT32 lowmask = region->bytewidth() - 1; - UINT8 *base = region->base() + (address & ~lowmask); + uint32_t lowmask = region->bytewidth() - 1; + uint8_t *base = region->base() + (address & ~lowmask); /* if we have a valid base, set the appropriate byte */ if (region->endianness() == ENDIANNESS_LITTLE) @@ -1491,7 +1491,7 @@ expression_error::error_code debugger_cpu::expression_validate(void *param, cons get_beamx - get beam horizontal position -------------------------------------------------*/ -UINT64 debugger_cpu::get_beamx(symbol_table &table, void *ref) +uint64_t debugger_cpu::get_beamx(symbol_table &table, void *ref) { screen_device *screen = reinterpret_cast(ref); return (screen != nullptr) ? screen->hpos() : 0; @@ -1502,7 +1502,7 @@ UINT64 debugger_cpu::get_beamx(symbol_table &table, void *ref) get_beamy - get beam vertical position -------------------------------------------------*/ -UINT64 debugger_cpu::get_beamy(symbol_table &table, void *ref) +uint64_t debugger_cpu::get_beamy(symbol_table &table, void *ref) { screen_device *screen = reinterpret_cast(ref); return (screen != nullptr) ? screen->vpos() : 0; @@ -1513,7 +1513,7 @@ UINT64 debugger_cpu::get_beamy(symbol_table &table, void *ref) get_frame - get current frame number -------------------------------------------------*/ -UINT64 debugger_cpu::get_frame(symbol_table &table, void *ref) +uint64_t debugger_cpu::get_frame(symbol_table &table, void *ref) { screen_device *screen = reinterpret_cast(ref); return (screen != nullptr) ? screen->frame_number() : 0; @@ -1525,7 +1525,7 @@ UINT64 debugger_cpu::get_frame(symbol_table &table, void *ref) 'cpunum' symbol -------------------------------------------------*/ -UINT64 debugger_cpu::get_cpunum(symbol_table &table, void *ref) +uint64_t debugger_cpu::get_cpunum(symbol_table &table, void *ref) { execute_interface_iterator iter(m_machine.root_device()); return iter.indexof(m_visiblecpu->execute()); @@ -1825,7 +1825,7 @@ void device_debug::instruction_hook(offs_t curpc) // are we tracking our recent pc visits? if (m_track_pc) { - const UINT32 crc = compute_opcode_crc32(curpc); + const uint32_t crc = compute_opcode_crc32(curpc); m_track_pc_set.insert(dasm_pc_tag(curpc, crc)); } @@ -1952,7 +1952,7 @@ void device_debug::instruction_hook(offs_t curpc) // memory read happens //------------------------------------------------- -void device_debug::memory_read_hook(address_space &space, offs_t address, UINT64 mem_mask) +void device_debug::memory_read_hook(address_space &space, offs_t address, uint64_t mem_mask) { // check watchpoints watchpoint_check(space, WATCHPOINT_READ, address, 0, mem_mask); @@ -1969,7 +1969,7 @@ void device_debug::memory_read_hook(address_space &space, offs_t address, UINT64 // memory write happens //------------------------------------------------- -void device_debug::memory_write_hook(address_space &space, offs_t address, UINT64 data, UINT64 mem_mask) +void device_debug::memory_write_hook(address_space &space, offs_t address, uint64_t data, uint64_t mem_mask) { if (m_track_mem) { @@ -2134,7 +2134,7 @@ void device_debug::go_exception(int exception) // delay elapses //------------------------------------------------- -void device_debug::go_milliseconds(UINT64 milliseconds) +void device_debug::go_milliseconds(uint64_t milliseconds) { assert(m_exec != nullptr); @@ -2165,7 +2165,7 @@ void device_debug::halt_on_next_instruction_impl(util::format_argument_pack::iterator, bool> const inserted = m_comment_set.insert(newComment); if (!inserted.second) @@ -2553,7 +2553,7 @@ void device_debug::comment_add(offs_t addr, const char *comment, rgb_t color) bool device_debug::comment_remove(offs_t addr) { - const UINT32 crc = compute_opcode_crc32(addr); + const uint32_t crc = compute_opcode_crc32(addr); size_t const removed = m_comment_set.erase(dasm_comment(addr, crc, "", 0xffffffff)); if (removed != 0U) m_comment_change++; return removed != 0U; @@ -2566,7 +2566,7 @@ bool device_debug::comment_remove(offs_t addr) const char *device_debug::comment_text(offs_t addr) const { - const UINT32 crc = compute_opcode_crc32(addr); + const uint32_t crc = compute_opcode_crc32(addr); auto comment = m_comment_set.find(dasm_comment(addr, crc, "", 0)); if (comment == m_comment_set.end()) return nullptr; return comment->m_text.c_str(); @@ -2608,7 +2608,7 @@ bool device_debug::comment_import(xml_data_node &cpunode,bool is_inline) offs_t address = xml_get_attribute_int(datanode, "address", 0); rgb_t color = xml_get_attribute_int(datanode, "color", 0); - UINT32 crc; + uint32_t crc; sscanf(xml_get_attribute_string(datanode, "crc", nullptr), "%08X", &crc); // add the new comment @@ -2626,7 +2626,7 @@ bool device_debug::comment_import(xml_data_node &cpunode,bool is_inline) // the opcode bytes at the given address //------------------------------------------------- -UINT32 device_debug::compute_opcode_crc32(offs_t pc) const +uint32_t device_debug::compute_opcode_crc32(offs_t pc) const { // Basically the same thing as dasm_wrapped, but with some tiny savings assert(m_memory != nullptr); @@ -2637,7 +2637,7 @@ UINT32 device_debug::compute_opcode_crc32(offs_t pc) const offs_t pcbyte = space.address_to_byte(pc) & space.bytemask(); // fetch the bytes up to the maximum - UINT8 opbuf[64], argbuf[64]; + uint8_t opbuf[64], argbuf[64]; int maxbytes = (m_disasm != nullptr) ? m_disasm->max_opcode_bytes() : 1; for (int numbytes = 0; numbytes < maxbytes; numbytes++) { @@ -2645,7 +2645,7 @@ UINT32 device_debug::compute_opcode_crc32(offs_t pc) const argbuf[numbytes] = m_device.machine().debugger().cpu().read_opcode(space, pcbyte + numbytes, 1); } - UINT32 numbytes = maxbytes; + uint32_t numbytes = maxbytes; if (m_disasm != nullptr) { // disassemble to our buffer @@ -2881,12 +2881,12 @@ void device_debug::watchpoint_update_flags(address_space &space) // for a given CPU and address space //------------------------------------------------- -void device_debug::watchpoint_check(address_space& space, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask) +void device_debug::watchpoint_check(address_space& space, int type, offs_t address, uint64_t value_to_write, uint64_t mem_mask) { space.machine().debugger().cpu().watchpoint_check(space, type, address, value_to_write, mem_mask, m_wplist); } -void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask, device_debug::watchpoint** wplist) +void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t address, uint64_t value_to_write, uint64_t mem_mask, device_debug::watchpoint** wplist) { // if we're within debugger code, don't stop if (m_within_instruction_hook || m_debugger_access) @@ -2915,7 +2915,7 @@ void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t addre } // (1<<(size*8))-1 won't work when size is 8; let's just use a lut - static const UINT64 masks[] = {0, + static const uint64_t masks[] = {0, 0xff, 0xffff, 0xffffff, @@ -2962,9 +2962,9 @@ void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t addre { buffer = string_format("Stopped at watchpoint %X writing %s to %08X (PC=%X)", wp->index(), sizes[size], space.byte_to_address(address), pc); if (value_to_write >> 32) - buffer.append(string_format(" (data=%X%08X)", (UINT32)(value_to_write >> 32), (UINT32)value_to_write)); + buffer.append(string_format(" (data=%X%08X)", (uint32_t)(value_to_write >> 32), (uint32_t)value_to_write)); else - buffer.append(string_format(" (data=%X)", (UINT32)value_to_write)); + buffer.append(string_format(" (data=%X)", (uint32_t)value_to_write)); } else buffer = string_format("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->index(), sizes[size], space.byte_to_address(address), pc); @@ -3029,7 +3029,7 @@ void device_debug::hotspot_check(address_space &space, offs_t address) // buffer and then disassembling them //------------------------------------------------- -UINT32 device_debug::dasm_wrapped(std::string &buffer, offs_t pc) +uint32_t device_debug::dasm_wrapped(std::string &buffer, offs_t pc) { assert(m_memory != nullptr && m_disasm != nullptr); @@ -3039,7 +3039,7 @@ UINT32 device_debug::dasm_wrapped(std::string &buffer, offs_t pc) offs_t pcbyte = space.address_to_byte(pc) & space.bytemask(); // fetch the bytes up to the maximum - UINT8 opbuf[64], argbuf[64]; + uint8_t opbuf[64], argbuf[64]; int maxbytes = m_disasm->max_opcode_bytes(); for (int numbytes = 0; numbytes < maxbytes; numbytes++) { @@ -3050,7 +3050,7 @@ UINT32 device_debug::dasm_wrapped(std::string &buffer, offs_t pc) // disassemble to our buffer char diasmbuf[200]; memset(diasmbuf, 0x00, 200); - UINT32 result = m_disasm->disassemble(diasmbuf, pc, opbuf, argbuf); + uint32_t result = m_disasm->disassemble(diasmbuf, pc, opbuf, argbuf); buffer.assign(diasmbuf); return result; } @@ -3061,7 +3061,7 @@ UINT32 device_debug::dasm_wrapped(std::string &buffer, offs_t pc) // current instruction pointer //------------------------------------------------- -UINT64 device_debug::get_current_pc(symbol_table &table, void *ref) +uint64_t device_debug::get_current_pc(symbol_table &table, void *ref) { device_t *device = reinterpret_cast(table.globalref()); return device->safe_pcbase(); @@ -3073,7 +3073,7 @@ UINT64 device_debug::get_current_pc(symbol_table &table, void *ref) // 'cycles' symbol //------------------------------------------------- -UINT64 device_debug::get_cycles(symbol_table &table, void *ref) +uint64_t device_debug::get_cycles(symbol_table &table, void *ref) { device_t *device = reinterpret_cast(table.globalref()); return device->debug()->m_exec->cycles_remaining(); @@ -3085,7 +3085,7 @@ UINT64 device_debug::get_cycles(symbol_table &table, void *ref) // 'totalcycles' symbol //------------------------------------------------- -UINT64 device_debug::get_totalcycles(symbol_table &table, void *ref) +uint64_t device_debug::get_totalcycles(symbol_table &table, void *ref) { device_t *device = reinterpret_cast(table.globalref()); return device->debug()->m_total_cycles; @@ -3097,7 +3097,7 @@ UINT64 device_debug::get_totalcycles(symbol_table &table, void *ref) // 'lastinstructioncycles' symbol //------------------------------------------------- -UINT64 device_debug::get_lastinstructioncycles(symbol_table &table, void *ref) +uint64_t device_debug::get_lastinstructioncycles(symbol_table &table, void *ref) { device_t *device = reinterpret_cast(table.globalref()); device_debug *debug = device->debug(); @@ -3110,7 +3110,7 @@ UINT64 device_debug::get_lastinstructioncycles(symbol_table &table, void *ref) // symbols //------------------------------------------------- -UINT64 device_debug::get_logunmap(symbol_table &table, void *ref) +uint64_t device_debug::get_logunmap(symbol_table &table, void *ref) { address_space &space = *reinterpret_cast(table.globalref()); return space.log_unmap(); @@ -3122,7 +3122,7 @@ UINT64 device_debug::get_logunmap(symbol_table &table, void *ref) // symbols //------------------------------------------------- -void device_debug::set_logunmap(symbol_table &table, void *ref, UINT64 value) +void device_debug::set_logunmap(symbol_table &table, void *ref, uint64_t value) { address_space &space = *reinterpret_cast(table.globalref()); space.set_log_unmap(value ? true : false); @@ -3134,7 +3134,7 @@ void device_debug::set_logunmap(symbol_table &table, void *ref, UINT64 value) // state symbols //------------------------------------------------- -UINT64 device_debug::get_state(symbol_table &table, void *ref) +uint64_t device_debug::get_state(symbol_table &table, void *ref) { device_t *device = reinterpret_cast(table.globalref()); return device->debug()->m_state->state_int(reinterpret_cast(ref)); @@ -3146,7 +3146,7 @@ UINT64 device_debug::get_state(symbol_table &table, void *ref) // state symbols //------------------------------------------------- -void device_debug::set_state(symbol_table &table, void *ref, UINT64 value) +void device_debug::set_state(symbol_table &table, void *ref, uint64_t value) { device_t *device = reinterpret_cast(table.globalref()); device->debug()->m_state->set_state_int(reinterpret_cast(ref), value); @@ -3454,7 +3454,7 @@ void device_debug::tracer::flush() // dasm_pc_tag - constructor //------------------------------------------------- -device_debug::dasm_pc_tag::dasm_pc_tag(const offs_t& address, const UINT32& crc) +device_debug::dasm_pc_tag::dasm_pc_tag(const offs_t& address, const uint32_t& crc) : m_address(address), m_crc(crc) { @@ -3466,7 +3466,7 @@ device_debug::dasm_pc_tag::dasm_pc_tag(const offs_t& address, const UINT32& crc) device_debug::dasm_memory_access::dasm_memory_access(const address_spacenum& address_space, const offs_t& address, - const UINT64& data, + const uint64_t& data, const offs_t& pc) : m_address_space(address_space), m_address(address), @@ -3479,7 +3479,7 @@ device_debug::dasm_memory_access::dasm_memory_access(const address_spacenum& add // dasm_comment - constructor //------------------------------------------------- -device_debug::dasm_comment::dasm_comment(offs_t address, UINT32 crc, const char *text, rgb_t color) +device_debug::dasm_comment::dasm_comment(offs_t address, uint32_t crc, const char *text, rgb_t color) : dasm_pc_tag(address, crc), m_text(text), m_color(std::move(color)) diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index 7ec39ba4863..fd403c17a74 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -22,9 +22,9 @@ // CONSTANTS //************************************************************************** -const UINT8 WATCHPOINT_READ = 1; -const UINT8 WATCHPOINT_WRITE = 2; -const UINT8 WATCHPOINT_READWRITE = WATCHPOINT_READ | WATCHPOINT_WRITE; +const uint8_t WATCHPOINT_READ = 1; +const uint8_t WATCHPOINT_WRITE = 2; +const uint8_t WATCHPOINT_READWRITE = WATCHPOINT_READ | WATCHPOINT_WRITE; const int COMMENT_VERSION = 1; @@ -127,7 +127,7 @@ public: address_space & m_space; // address space int m_index; // user reported index bool m_enabled; // enabled? - UINT8 m_type; // type (read/write) + uint8_t m_type; // type (read/write) offs_t m_address; // start address offs_t m_length; // length of watch area parsed_expression m_condition; // condition @@ -179,8 +179,8 @@ public: void interrupt_hook(int irqline); void exception_hook(int exception); void instruction_hook(offs_t curpc); - void memory_read_hook(address_space &space, offs_t address, UINT64 mem_mask); - void memory_write_hook(address_space &space, offs_t address, UINT64 data, UINT64 mem_mask); + void memory_read_hook(address_space &space, offs_t address, uint64_t mem_mask); + void memory_write_hook(address_space &space, offs_t address, uint64_t data, uint64_t mem_mask); // hooks into our operations void set_instruction_hook(debug_instruction_hook_func hook); @@ -199,7 +199,7 @@ public: void go_vblank(); void go_interrupt(int irqline = -1); void go_exception(int exception); - void go_milliseconds(UINT64 milliseconds); + void go_milliseconds(uint64_t milliseconds); void go_next_device(); template @@ -240,11 +240,11 @@ public: void comment_add(offs_t address, const char *comment, rgb_t color); bool comment_remove(offs_t addr); const char *comment_text(offs_t addr) const; - UINT32 comment_count() const { return m_comment_set.size(); } - UINT32 comment_change_count() const { return m_comment_change; } + uint32_t comment_count() const { return m_comment_set.size(); } + uint32_t comment_change_count() const { return m_comment_change; } bool comment_export(xml_data_node &node); bool comment_import(xml_data_node &node,bool is_inline); - UINT32 compute_opcode_crc32(offs_t pc) const; + uint32_t compute_opcode_crc32(offs_t pc) const; // history offs_t history_pc(int index) const; @@ -259,7 +259,7 @@ public: void set_track_mem(bool value) { m_track_mem = value; } offs_t track_mem_pc_from_space_address_data(const address_spacenum& space, const offs_t& address, - const UINT64& data) const; + const uint64_t& data) const; void track_mem_data_clear() { m_track_mem_set.clear(); } // tracing @@ -279,24 +279,24 @@ private: // internal helpers void prepare_for_step_overout(offs_t pc); - UINT32 dasm_wrapped(std::string &buffer, offs_t pc); + uint32_t dasm_wrapped(std::string &buffer, offs_t pc); // breakpoint and watchpoint helpers void breakpoint_update_flags(); void breakpoint_check(offs_t pc); void watchpoint_update_flags(address_space &space); - void watchpoint_check(address_space &space, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask); + void watchpoint_check(address_space &space, int type, offs_t address, uint64_t value_to_write, uint64_t mem_mask); void hotspot_check(address_space &space, offs_t address); // symbol get/set callbacks - static UINT64 get_current_pc(symbol_table &table, void *ref); - static UINT64 get_cycles(symbol_table &table, void *ref); - static UINT64 get_totalcycles(symbol_table &table, void *ref); - static UINT64 get_lastinstructioncycles(symbol_table &table, void *ref); - static UINT64 get_logunmap(symbol_table &table, void *ref); - static void set_logunmap(symbol_table &table, void *ref, UINT64 value); - static UINT64 get_state(symbol_table &table, void *ref); - static void set_state(symbol_table &table, void *ref, UINT64 value); + static uint64_t get_current_pc(symbol_table &table, void *ref); + static uint64_t get_cycles(symbol_table &table, void *ref); + static uint64_t get_totalcycles(symbol_table &table, void *ref); + static uint64_t get_lastinstructioncycles(symbol_table &table, void *ref); + static uint64_t get_logunmap(symbol_table &table, void *ref); + static void set_logunmap(symbol_table &table, void *ref, uint64_t value); + static uint64_t get_state(symbol_table &table, void *ref); + static void set_state(symbol_table &table, void *ref, uint64_t value); // basic device information device_t & m_device; // device we are attached to @@ -306,7 +306,7 @@ private: device_disasm_interface * m_disasm; // disasm interface, if present // global state - UINT32 m_flags; // debugging flags for this CPU + uint32_t m_flags; // debugging flags for this CPU symbol_table m_symtable; // symbol table for expression evaluation debug_instruction_hook_func m_instrhook; // per-instruction callback hook @@ -320,12 +320,12 @@ private: int m_stopirq; // stop IRQ number for DEBUG_FLAG_STOP_INTERRUPT int m_stopexception; // stop exception number for DEBUG_FLAG_STOP_EXCEPTION attotime m_endexectime; // ending time of the current execution - UINT64 m_total_cycles; // current total cycles - UINT64 m_last_total_cycles; // last total cycles + uint64_t m_total_cycles; // current total cycles + uint64_t m_last_total_cycles; // last total cycles // history offs_t m_pc_history[HISTORY_SIZE]; // history of recent PCs - UINT32 m_pc_history_index; // current history index + uint32_t m_pc_history_index; // current history index // breakpoints and watchpoints breakpoint * m_bplist; // list of breakpoints @@ -366,7 +366,7 @@ private: offs_t m_access; // access address offs_t m_pc; // PC of the access address_space * m_space; // space where the access occurred - UINT32 m_count; // number of hits + uint32_t m_count; // number of hits }; std::vector m_hotspots; // hotspot list int m_hotspot_threshhold; // threshhold for the number of hits to print @@ -375,7 +375,7 @@ private: class dasm_pc_tag { public: - dasm_pc_tag(const offs_t& address, const UINT32& crc); + dasm_pc_tag(const offs_t& address, const uint32_t& crc); // required to be included in a set bool operator < (const dasm_pc_tag& rhs) const @@ -386,7 +386,7 @@ private: } offs_t m_address; // Stores [nothing] for a given address & crc32 - UINT32 m_crc; + uint32_t m_crc; }; std::set m_track_pc_set; bool m_track_pc; @@ -395,13 +395,13 @@ private: class dasm_comment : public dasm_pc_tag { public: - dasm_comment(offs_t address, UINT32 crc, const char *text, rgb_t color); + dasm_comment(offs_t address, uint32_t crc, const char *text, rgb_t color); std::string m_text; // Stores comment text & color for a given address & crc32 rgb_t m_color; }; std::set m_comment_set; // collection of comments - UINT32 m_comment_change; // change counter for comments + uint32_t m_comment_change; // change counter for comments // memory tracking class dasm_memory_access @@ -409,7 +409,7 @@ private: public: dasm_memory_access(const address_spacenum& address_space, const offs_t& address, - const UINT64& data, + const uint64_t& data, const offs_t& pc); // required to be included in a set @@ -426,31 +426,31 @@ private: // Stores the PC for a given address, memory region, and data value address_spacenum m_address_space; offs_t m_address; - UINT64 m_data; + uint64_t m_data; mutable offs_t m_pc; }; std::set m_track_mem_set; bool m_track_mem; // internal flag values - static const UINT32 DEBUG_FLAG_OBSERVING = 0x00000001; // observing this CPU - static const UINT32 DEBUG_FLAG_HISTORY = 0x00000002; // tracking this CPU's history - static const UINT32 DEBUG_FLAG_TRACING = 0x00000004; // tracing this CPU - static const UINT32 DEBUG_FLAG_TRACING_OVER = 0x00000008; // tracing this CPU with step over behavior - static const UINT32 DEBUG_FLAG_HOOKED = 0x00000010; // per-instruction callback hook - static const UINT32 DEBUG_FLAG_STEPPING = 0x00000020; // CPU is single stepping - static const UINT32 DEBUG_FLAG_STEPPING_OVER = 0x00000040; // CPU is stepping over a function - static const UINT32 DEBUG_FLAG_STEPPING_OUT = 0x00000080; // CPU is stepping out of a function - static const UINT32 DEBUG_FLAG_STOP_PC = 0x00000100; // there is a pending stop at cpu->breakpc - static const UINT32 DEBUG_FLAG_STOP_INTERRUPT = 0x00000400; // there is a pending stop on the next interrupt - static const UINT32 DEBUG_FLAG_STOP_EXCEPTION = 0x00000800; // there is a pending stop on the next exception - static const UINT32 DEBUG_FLAG_STOP_VBLANK = 0x00001000; // there is a pending stop on the next VBLANK - static const UINT32 DEBUG_FLAG_STOP_TIME = 0x00002000; // there is a pending stop at cpu->stoptime - static const UINT32 DEBUG_FLAG_LIVE_BP = 0x00010000; // there are live breakpoints for this CPU - - static const UINT32 DEBUG_FLAG_STEPPING_ANY = DEBUG_FLAG_STEPPING | DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT; - static const UINT32 DEBUG_FLAG_TRACING_ANY = DEBUG_FLAG_TRACING | DEBUG_FLAG_TRACING_OVER; - static const UINT32 DEBUG_FLAG_TRANSIENT = DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC | + static const uint32_t DEBUG_FLAG_OBSERVING = 0x00000001; // observing this CPU + static const uint32_t DEBUG_FLAG_HISTORY = 0x00000002; // tracking this CPU's history + static const uint32_t DEBUG_FLAG_TRACING = 0x00000004; // tracing this CPU + static const uint32_t DEBUG_FLAG_TRACING_OVER = 0x00000008; // tracing this CPU with step over behavior + static const uint32_t DEBUG_FLAG_HOOKED = 0x00000010; // per-instruction callback hook + static const uint32_t DEBUG_FLAG_STEPPING = 0x00000020; // CPU is single stepping + static const uint32_t DEBUG_FLAG_STEPPING_OVER = 0x00000040; // CPU is stepping over a function + static const uint32_t DEBUG_FLAG_STEPPING_OUT = 0x00000080; // CPU is stepping out of a function + static const uint32_t DEBUG_FLAG_STOP_PC = 0x00000100; // there is a pending stop at cpu->breakpc + static const uint32_t DEBUG_FLAG_STOP_INTERRUPT = 0x00000400; // there is a pending stop on the next interrupt + static const uint32_t DEBUG_FLAG_STOP_EXCEPTION = 0x00000800; // there is a pending stop on the next exception + static const uint32_t DEBUG_FLAG_STOP_VBLANK = 0x00001000; // there is a pending stop on the next VBLANK + static const uint32_t DEBUG_FLAG_STOP_TIME = 0x00002000; // there is a pending stop at cpu->stoptime + static const uint32_t DEBUG_FLAG_LIVE_BP = 0x00010000; // there are live breakpoints for this CPU + + static const uint32_t DEBUG_FLAG_STEPPING_ANY = DEBUG_FLAG_STEPPING | DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT; + static const uint32_t DEBUG_FLAG_TRACING_ANY = DEBUG_FLAG_TRACING | DEBUG_FLAG_TRACING_OVER; + static const uint32_t DEBUG_FLAG_TRANSIENT = DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC | DEBUG_FLAG_STOP_INTERRUPT | DEBUG_FLAG_STOP_EXCEPTION | DEBUG_FLAG_STOP_VBLANK | DEBUG_FLAG_STOP_TIME; }; @@ -510,46 +510,46 @@ public: /* ----- debugger memory accessors ----- */ /* return a byte from the specified memory space */ - UINT8 read_byte(address_space &space, offs_t address, int apply_translation); + uint8_t read_byte(address_space &space, offs_t address, int apply_translation); /* return a word from the specified memory space */ - UINT16 read_word(address_space &space, offs_t address, int apply_translation); + uint16_t read_word(address_space &space, offs_t address, int apply_translation); /* return a dword from the specified memory space */ - UINT32 read_dword(address_space &space, offs_t address, int apply_translation); + uint32_t read_dword(address_space &space, offs_t address, int apply_translation); /* return a qword from the specified memory space */ - UINT64 read_qword(address_space &space, offs_t address, int apply_translation); + uint64_t read_qword(address_space &space, offs_t address, int apply_translation); /* return 1,2,4 or 8 bytes from the specified memory space */ - UINT64 read_memory(address_space &space, offs_t address, int size, int apply_translation); + uint64_t read_memory(address_space &space, offs_t address, int size, int apply_translation); /* write a byte to the specified memory space */ - void write_byte(address_space &space, offs_t address, UINT8 data, int apply_translation); + void write_byte(address_space &space, offs_t address, uint8_t data, int apply_translation); /* write a word to the specified memory space */ - void write_word(address_space &space, offs_t address, UINT16 data, int apply_translation); + void write_word(address_space &space, offs_t address, uint16_t data, int apply_translation); /* write a dword to the specified memory space */ - void write_dword(address_space &space, offs_t address, UINT32 data, int apply_translation); + void write_dword(address_space &space, offs_t address, uint32_t data, int apply_translation); /* write a qword to the specified memory space */ - void write_qword(address_space &space, offs_t address, UINT64 data, int apply_translation); + void write_qword(address_space &space, offs_t address, uint64_t data, int apply_translation); /* write 1,2,4 or 8 bytes to the specified memory space */ - void write_memory(address_space &space, offs_t address, UINT64 data, int size, int apply_translation); + void write_memory(address_space &space, offs_t address, uint64_t data, int size, int apply_translation); /* read 1,2,4 or 8 bytes at the given offset from opcode space */ - UINT64 read_opcode(address_space &space, offs_t offset, int size); + uint64_t read_opcode(address_space &space, offs_t offset, int size); // getters bool within_instruction_hook() const { return m_within_instruction_hook; } bool memory_modified() const { return m_memory_modified; } int execution_state() const { return m_execution_state; } device_t *live_cpu() { return m_livecpu; } - UINT32 get_breakpoint_index() { return m_bpindex++; } - UINT32 get_watchpoint_index() { return m_wpindex++; } - UINT32 get_registerpoint_index() { return m_rpindex++; } + uint32_t get_breakpoint_index() { return m_bpindex++; } + uint32_t get_watchpoint_index() { return m_wpindex++; } + uint32_t get_registerpoint_index() { return m_rpindex++; } // setters void set_visible_cpu(device_t * visiblecpu) { m_visiblecpu = visiblecpu; } @@ -568,26 +568,26 @@ public: void ensure_comments_loaded(); void reset_transient_flags(); void process_source_file(); - void watchpoint_check(address_space& space, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask, device_debug::watchpoint** wplist); + void watchpoint_check(address_space& space, int type, offs_t address, uint64_t value_to_write, uint64_t mem_mask, device_debug::watchpoint** wplist); private: static const size_t NUM_TEMP_VARIABLES; /* expression handlers */ - UINT64 expression_read_memory(void *param, const char *name, expression_space space, UINT32 address, int size); - UINT64 expression_read_program_direct(address_space &space, int opcode, offs_t address, int size); - UINT64 expression_read_memory_region(const char *rgntag, offs_t address, int size); - void expression_write_memory(void *param, const char *name, expression_space space, UINT32 address, int size, UINT64 data); - void expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, UINT64 data); - void expression_write_memory_region(const char *rgntag, offs_t address, int size, UINT64 data); + uint64_t expression_read_memory(void *param, const char *name, expression_space space, uint32_t address, int size); + uint64_t expression_read_program_direct(address_space &space, int opcode, offs_t address, int size); + uint64_t expression_read_memory_region(const char *rgntag, offs_t address, int size); + void expression_write_memory(void *param, const char *name, expression_space space, uint32_t address, int size, uint64_t data); + void expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, uint64_t data); + void expression_write_memory_region(const char *rgntag, offs_t address, int size, uint64_t data); expression_error::error_code expression_validate(void *param, const char *name, expression_space space); device_t* expression_get_device(const char *tag); /* variable getters/setters */ - UINT64 get_cpunum(symbol_table &table, void *ref); - UINT64 get_beamx(symbol_table &table, void *ref); - UINT64 get_beamy(symbol_table &table, void *ref); - UINT64 get_frame(symbol_table &table, void *ref); + uint64_t get_cpunum(symbol_table &table, void *ref); + uint64_t get_beamx(symbol_table &table, void *ref); + uint64_t get_beamy(symbol_table &table, void *ref); + uint64_t get_frame(symbol_table &table, void *ref); /* internal helpers */ void on_vblank(screen_device &device, bool vblank_state); @@ -610,13 +610,13 @@ private: int m_execution_state; device_t * m_stop_when_not_device; // stop execution when the device ceases to be this - UINT32 m_bpindex; - UINT32 m_wpindex; - UINT32 m_rpindex; + uint32_t m_bpindex; + uint32_t m_wpindex; + uint32_t m_rpindex; - UINT64 m_wpdata; - UINT64 m_wpaddr; - std::unique_ptr m_tempvar; + uint64_t m_wpdata; + uint64_t m_wpaddr; + std::unique_ptr m_tempvar; osd_ticks_t m_last_periodic_update_time; diff --git a/src/emu/debug/debughlp.cpp b/src/emu/debug/debughlp.cpp index 3f690d0889b..601bed4a440 100644 --- a/src/emu/debug/debughlp.cpp +++ b/src/emu/debug/debughlp.cpp @@ -1518,7 +1518,7 @@ const char *debug_get_help(const char *tag) /* make a lowercase copy of the tag */ for (i = 0; i <= taglen; i++) - tagcopy[i] = tolower((UINT8)tag[i]); + tagcopy[i] = tolower((uint8_t)tag[i]); /* find a match */ for (i = 0; i < ARRAY_LENGTH(static_help_list); i++) diff --git a/src/emu/debug/debugvw.cpp b/src/emu/debug/debugvw.cpp index bfeec537118..c66034ef26b 100644 --- a/src/emu/debug/debugvw.cpp +++ b/src/emu/debug/debugvw.cpp @@ -506,7 +506,7 @@ bool debug_view_expression::recompute() // recompute the value of the expression try { - UINT64 newresult = m_parsed.execute(); + uint64_t newresult = m_parsed.execute(); if (newresult != m_result) { m_result = newresult; diff --git a/src/emu/debug/debugvw.h b/src/emu/debug/debugvw.h index 2f5d8c16872..1dcdc9120c5 100644 --- a/src/emu/debug/debugvw.h +++ b/src/emu/debug/debugvw.h @@ -43,15 +43,15 @@ enum debug_view_notification // attribute bits for debug_view_char.attrib -const UINT8 DCA_NORMAL = 0x00; // black on white -const UINT8 DCA_CHANGED = 0x01; // red foreground -const UINT8 DCA_SELECTED = 0x02; // light red background -const UINT8 DCA_INVALID = 0x04; // dark blue foreground -const UINT8 DCA_DISABLED = 0x08; // darker foreground -const UINT8 DCA_ANCILLARY = 0x10; // grey background -const UINT8 DCA_CURRENT = 0x20; // yellow background -const UINT8 DCA_COMMENT = 0x40; // green foreground -const UINT8 DCA_VISITED = 0x80; // light blue background +const uint8_t DCA_NORMAL = 0x00; // black on white +const uint8_t DCA_CHANGED = 0x01; // red foreground +const uint8_t DCA_SELECTED = 0x02; // light red background +const uint8_t DCA_INVALID = 0x04; // dark blue foreground +const uint8_t DCA_DISABLED = 0x08; // darker foreground +const uint8_t DCA_ANCILLARY = 0x10; // grey background +const uint8_t DCA_CURRENT = 0x20; // yellow background +const uint8_t DCA_COMMENT = 0x40; // green foreground +const uint8_t DCA_VISITED = 0x80; // light blue background // special characters that can be passed to process_char() @@ -90,8 +90,8 @@ typedef void (*debug_view_osd_update_func)(debug_view &view, void *osdprivate); // a single "character" in the debug view has an ASCII value and an attribute byte struct debug_view_char { - UINT8 byte; - UINT8 attrib; + uint8_t byte; + uint8_t attrib; }; @@ -101,8 +101,8 @@ class debug_view_xy public: debug_view_xy(int _x = 0, int _y = 0) : x(_x), y(_y) { } - INT32 x; - INT32 y; + int32_t x; + int32_t y; }; @@ -208,7 +208,7 @@ protected: // update info bool m_recompute; // does this view require a recomputation? - UINT8 m_update_level; // update level; updates when this hits 0 + uint8_t m_update_level; // update level; updates when this hits 0 bool m_update_pending; // true if there is a pending update bool m_osd_update_pending; // true if there is a pending update std::vector m_viewdata; // current array of view data @@ -259,8 +259,8 @@ public: // getters running_machine &machine() const { return m_machine; } bool dirty() const { return m_dirty; } - UINT64 last_value() const { return m_result; } - UINT64 value() { recompute(); return m_result; } + uint64_t last_value() const { return m_result; } + uint64_t value() { recompute(); return m_result; } const char *string() const { return m_string.c_str(); } symbol_table *context() const { return m_parsed.symbols(); } @@ -276,7 +276,7 @@ private: // internal state running_machine & m_machine; // reference to the machine bool m_dirty; // true if the expression needs to be re-evaluated - UINT64 m_result; // last result from the expression + uint64_t m_result; // last result from the expression parsed_expression m_parsed; // parsed expression data std::string m_string; // copy of the expression string }; diff --git a/src/emu/debug/dvbpoints.cpp b/src/emu/debug/dvbpoints.cpp index 8e716e32939..d7cd9527913 100644 --- a/src/emu/debug/dvbpoints.cpp +++ b/src/emu/debug/dvbpoints.cpp @@ -266,7 +266,7 @@ void debug_view_breakpoints::view_update() pad_ostream_to_length(linebuf, tableBreaks[5]); auto const &text(linebuf.vec()); - for (UINT32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) + for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) { dest->byte = (i < text.size()) ? text[i] : ' '; dest->attrib = DCA_ANCILLARY; @@ -298,7 +298,7 @@ void debug_view_breakpoints::view_update() pad_ostream_to_length(linebuf, tableBreaks[5]); auto const &text(linebuf.vec()); - for (UINT32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) + for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) { dest->byte = (i < text.size()) ? text[i] : ' '; dest->attrib = DCA_NORMAL; @@ -311,7 +311,7 @@ void debug_view_breakpoints::view_update() else { // Fill the remaining vertical space - for (UINT32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) + for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) { dest->byte = ' '; dest->attrib = DCA_NORMAL; diff --git a/src/emu/debug/dvdisasm.cpp b/src/emu/debug/dvdisasm.cpp index b793a7a553e..3dab8d13dd3 100644 --- a/src/emu/debug/dvdisasm.cpp +++ b/src/emu/debug/dvdisasm.cpp @@ -133,8 +133,8 @@ void debug_view_disasm::view_notify(debug_view_notification type) void debug_view_disasm::view_char(int chval) { debug_view_xy origcursor = m_cursor; - UINT8 end_buffer = 3; - INT32 temp; + uint8_t end_buffer = 3; + int32_t temp; switch (chval) { @@ -250,7 +250,7 @@ offs_t debug_view_disasm::find_pc_backwards(offs_t targetpc, int numinstrs) { // fill the buffer up to the target offs_t curpcbyte = source.m_space.address_to_byte(curpc) & source.m_space.logbytemask(); - UINT8 opbuf[1024], argbuf[1024]; + uint8_t opbuf[1024], argbuf[1024]; while (curpcbyte < fillpcbyte) { fillpcbyte--; @@ -397,7 +397,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines) offs_t physpcbyte = pcbyte; if (source.m_space.device().memory().translate(source.m_space.spacenum(), TRANSLATE_FETCH_DEBUG, physpcbyte)) { - UINT8 opbuf[64], argbuf[64]; + uint8_t opbuf[64], argbuf[64]; // fetch the bytes up to the maximum for (numbytes = 0; numbytes < maxbytes; numbytes++) @@ -466,14 +466,14 @@ void debug_view_disasm::view_update() m_recompute = true; // if we're tracking a value, make sure it is visible - UINT64 previous = m_expression.last_value(); - UINT64 result = m_expression.value(); + uint64_t previous = m_expression.last_value(); + uint64_t result = m_expression.value(); if (result != previous) { offs_t resultbyte = source.m_space.address_to_byte(result) & source.m_space.logbytemask(); // see if the new result is an address we already have - UINT32 row; + uint32_t row; for (row = 0; row < m_byteaddress.size(); row++) if (m_byteaddress[row] == resultbyte) break; @@ -512,7 +512,7 @@ recompute: else { // determine the addresses of what we will display - offs_t backpc = find_pc_backwards((UINT32)m_expression.value(), m_backwards_steps); + offs_t backpc = find_pc_backwards((uint32_t)m_expression.value(), m_backwards_steps); // put ourselves back in the top left m_topleft.y = 0; @@ -527,9 +527,9 @@ recompute: if (pcbyte != m_last_pcbyte) { // find the row with the PC on it - for (UINT32 row = 0; row < m_visible.y; row++) + for (uint32_t row = 0; row < m_visible.y; row++) { - UINT32 effrow = m_topleft.y + row; + uint32_t effrow = m_topleft.y + row; if (effrow >= m_byteaddress.size()) break; if (pcbyte == m_byteaddress[effrow]) @@ -552,13 +552,13 @@ recompute: // loop over visible rows debug_view_char *dest = &m_viewdata[0]; - for (UINT32 row = 0; row < m_visible.y; row++) + for (uint32_t row = 0; row < m_visible.y; row++) { - UINT32 effrow = m_topleft.y + row; - UINT32 col = 0; + uint32_t effrow = m_topleft.y + row; + uint32_t col = 0; // if this visible row is valid, add it to the buffer - UINT8 attrib = DCA_NORMAL; + uint8_t attrib = DCA_NORMAL; if (effrow < m_byteaddress.size()) { // if we're on the line with the PC, recompute and hilight it @@ -583,10 +583,10 @@ recompute: // get the effective string const char *data = &m_dasm.vec()[effrow * m_total.x]; - UINT32 len = (UINT32)strlen(data); + uint32_t len = (uint32_t)strlen(data); // copy data - UINT32 effcol = m_topleft.x; + uint32_t effcol = m_topleft.x; while (col < m_visible.x && effcol < len) { dest->byte = data[effcol++]; @@ -658,7 +658,7 @@ void debug_view_disasm::set_right_column(disasm_right_column contents) // instructions displayed before the home address //------------------------------------------------- -void debug_view_disasm::set_backward_steps(UINT32 steps) +void debug_view_disasm::set_backward_steps(uint32_t steps) { begin_update(); m_backwards_steps = steps; @@ -672,7 +672,7 @@ void debug_view_disasm::set_backward_steps(UINT32 steps) // of the main disassembly section //------------------------------------------------- -void debug_view_disasm::set_disasm_width(UINT32 width) +void debug_view_disasm::set_disasm_width(uint32_t width) { begin_update(); m_dasm_width = width; diff --git a/src/emu/debug/dvdisasm.h b/src/emu/debug/dvdisasm.h index 662d5102425..32a4e70eba5 100644 --- a/src/emu/debug/dvdisasm.h +++ b/src/emu/debug/dvdisasm.h @@ -69,15 +69,15 @@ public: // getters const char *expression() const { return m_expression.string(); } disasm_right_column right_column() const { return m_right_column; } - UINT32 backward_steps() const { return m_backwards_steps; } - UINT32 disasm_width() const { return m_dasm_width; } + uint32_t backward_steps() const { return m_backwards_steps; } + uint32_t disasm_width() const { return m_dasm_width; } offs_t selected_address(); // setters void set_expression(const char *expression); void set_right_column(disasm_right_column contents); - void set_backward_steps(UINT32 steps); - void set_disasm_width(UINT32 width); + void set_backward_steps(uint32_t steps); + void set_disasm_width(uint32_t width); void set_selected_address(offs_t address); protected: @@ -96,11 +96,11 @@ private: // internal state disasm_right_column m_right_column; // right column contents - UINT32 m_backwards_steps; // number of backwards steps - UINT32 m_dasm_width; // width of the disassembly area - UINT8 * m_last_direct_raw; // last direct raw value - UINT8 * m_last_direct_decrypted;// last direct decrypted value - UINT32 m_last_change_count; // last comment change count + uint32_t m_backwards_steps; // number of backwards steps + uint32_t m_dasm_width; // width of the disassembly area + uint8_t * m_last_direct_raw; // last direct raw value + uint8_t * m_last_direct_decrypted;// last direct decrypted value + uint32_t m_last_change_count; // last comment change count offs_t m_last_pcbyte; // last PC byte value int m_divider1, m_divider2; // left and right divider columns int m_divider3; // comment divider column diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp index 51899cdf54f..84c0c911a1a 100644 --- a/src/emu/debug/dvmemory.cpp +++ b/src/emu/debug/dvmemory.cpp @@ -67,7 +67,7 @@ debug_view_memory_source::debug_view_memory_source(const char *name, memory_regi m_length(region.bytes()), m_offsetxor(ENDIAN_VALUE_NE_NNE(region.endianness(), 0, region.bytewidth() - 1)), m_endianness(region.endianness()), - m_prefsize(std::min(region.bytewidth(), 8)) + m_prefsize(std::min(region.bytewidth(), 8)) { } @@ -157,7 +157,7 @@ void debug_view_memory::enumerate_sources() for (int itemnum = 0; itemnum < 10000; itemnum++) { // stop when we run out of items - UINT32 valsize, valcount; + uint32_t valsize, valcount; void *base; const char *itemname = machine().save().indexed_item(itemnum, base, valsize, valcount); if (itemname == nullptr) @@ -211,11 +211,11 @@ void debug_view_memory::view_notify(debug_view_notification type) // whose 32 bit representation is value //------------------------------------------------- -static inline float uint32_to_float(UINT32 value) +static inline float uint32_to_float(uint32_t value) { union { float f; - UINT32 i; + uint32_t i; } v; v.i = value; @@ -227,11 +227,11 @@ static inline float uint32_to_float(UINT32 value) // whose 64 bit representation is value //------------------------------------------------- -static inline float uint64_to_double(UINT64 value) +static inline float uint64_to_double(uint64_t value) { union { double f; - UINT64 i; + uint64_t i; } v; v.i = value; @@ -255,18 +255,18 @@ void debug_view_memory::view_update() const memory_view_pos &posdata = s_memory_pos_table[m_data_format]; // loop over visible rows - for (UINT32 row = 0; row < m_visible.y; row++) + for (uint32_t row = 0; row < m_visible.y; row++) { debug_view_char *destmin = &m_viewdata[row * m_visible.x]; debug_view_char *destmax = destmin + m_visible.x; debug_view_char *destrow = destmin - m_topleft.x; - UINT32 effrow = m_topleft.y + row; + uint32_t effrow = m_topleft.y + row; // reset the line of data; section 1 is normal, others are ancillary, cursor is selected debug_view_char *dest = destmin; for (int ch = 0; ch < m_visible.x; ch++, dest++) { - UINT32 effcol = m_topleft.x + ch; + uint32_t effcol = m_topleft.x + ch; dest->byte = ' '; dest->attrib = DCA_ANCILLARY; if (m_section[1].contains(effcol)) @@ -298,13 +298,13 @@ void debug_view_memory::view_update() int spacing = posdata.m_spacing; if (m_data_format <= 8) { - UINT64 chunkdata; + uint64_t chunkdata; bool ismapped = read(m_bytes_per_chunk, addrbyte + chunknum * m_bytes_per_chunk, chunkdata); dest = destrow + m_section[1].m_pos + 1 + chunkindex * spacing; for (int ch = 0; ch < posdata.m_spacing; ch++, dest++) if (dest >= destmin && dest < destmax) { - UINT8 shift = posdata.m_shift[ch]; + uint8_t shift = posdata.m_shift[ch]; if (shift < 64) dest->byte = ismapped ? "0123456789ABCDEF"[(chunkdata >> shift) & 0x0f] : '*'; } @@ -312,7 +312,7 @@ void debug_view_memory::view_update() else { int ch; char valuetext[64]; - UINT64 chunkdata = 0; + uint64_t chunkdata = 0; floatx80 chunkdata80 = { 0, 0 }; bool ismapped; @@ -325,7 +325,7 @@ void debug_view_memory::view_update() switch (m_data_format) { case 9: - sprintf(valuetext, "%.8g", uint32_to_float((UINT32)chunkdata)); + sprintf(valuetext, "%.8g", uint32_to_float((uint32_t)chunkdata)); break; case 10: sprintf(valuetext, "%.24g", uint64_to_double(chunkdata)); @@ -358,7 +358,7 @@ void debug_view_memory::view_update() for (int ch = 0; ch < m_bytes_per_row; ch++, dest++) if (dest >= destmin && dest < destmax) { - UINT64 chval; + uint64_t chval; bool ismapped = read(1, addrbyte + ch, chval); dest->byte = (ismapped && isprint(chval)) ? chval : '.'; } @@ -396,7 +396,7 @@ void debug_view_memory::view_char(int chval) break; case DCH_PUP: - for (UINT32 delta = (m_visible.y - 2) * m_bytes_per_row; delta > 0; delta -= m_bytes_per_row) + for (uint32_t delta = (m_visible.y - 2) * m_bytes_per_row; delta > 0; delta -= m_bytes_per_row) if (pos.m_address >= m_byte_offset + delta) { pos.m_address -= delta; @@ -405,7 +405,7 @@ void debug_view_memory::view_char(int chval) break; case DCH_PDOWN: - for (UINT32 delta = (m_visible.y - 2) * m_bytes_per_row; delta > 0; delta -= m_bytes_per_row) + for (uint32_t delta = (m_visible.y - 2) * m_bytes_per_row; delta > 0; delta -= m_bytes_per_row) if (pos.m_address <= m_maxaddr - delta) { pos.m_address += delta; @@ -450,13 +450,13 @@ void debug_view_memory::view_char(int chval) if (hexchar == nullptr) break; - UINT64 data; + uint64_t data; bool ismapped = read(m_bytes_per_chunk, pos.m_address, data); if (!ismapped) break; - data &= ~((UINT64)0x0f << pos.m_shift); - data |= (UINT64)(hexchar - hexvals) << pos.m_shift; + data &= ~((uint64_t)0x0f << pos.m_shift); + data |= (uint64_t)(hexchar - hexvals) << pos.m_shift; write(m_bytes_per_chunk, pos.m_address, data); // fall through to the right-arrow press } @@ -550,7 +550,7 @@ void debug_view_memory::recompute() // if we are viewing a space with a minimum chunk size, clamp the bytes per chunk if (source.m_space != nullptr && source.m_space->byte_to_address(1) > 1) { - UINT32 min_bytes_per_chunk = source.m_space->byte_to_address(1); + uint32_t min_bytes_per_chunk = source.m_space->byte_to_address(1); while (m_bytes_per_chunk < min_bytes_per_chunk) { m_bytes_per_chunk *= 2; @@ -591,7 +591,7 @@ void debug_view_memory::recompute() } // derive total sizes from that - m_total.y = ((UINT64)m_maxaddr - (UINT64)m_byte_offset + (UINT64)m_bytes_per_row /*- 1*/) / m_bytes_per_row; + m_total.y = ((uint64_t)m_maxaddr - (uint64_t)m_byte_offset + (uint64_t)m_bytes_per_row /*- 1*/) / m_bytes_per_row; // reset the current cursor position set_cursor_pos(pos); @@ -733,7 +733,7 @@ void debug_view_memory::set_cursor_pos(cursor_pos pos) // read - generic memory view data reader //------------------------------------------------- -bool debug_view_memory::read(UINT8 size, offs_t offs, UINT64 &data) +bool debug_view_memory::read(uint8_t size, offs_t offs, uint64_t &data) { const debug_view_memory_source &source = downcast(*m_source); @@ -743,7 +743,7 @@ bool debug_view_memory::read(UINT8 size, offs_t offs, UINT64 &data) offs_t dummyaddr = offs; bool ismapped = m_no_translation ? true : source.m_memintf->translate(source.m_space->spacenum(), TRANSLATE_READ_DEBUG, dummyaddr); - data = ~(UINT64)0; + data = ~(uint64_t)0; if (ismapped) { switch (size) @@ -762,7 +762,7 @@ bool debug_view_memory::read(UINT8 size, offs_t offs, UINT64 &data) { size /= 2; - UINT64 data0, data1; + uint64_t data0, data1; bool ismapped = read(size, offs + 0 * size, data0); ismapped |= read(size, offs + 1 * size, data1); @@ -777,7 +777,7 @@ bool debug_view_memory::read(UINT8 size, offs_t offs, UINT64 &data) offs ^= source.m_offsetxor; if (offs >= source.m_length) return false; - data = *((UINT8 *)source.m_base + offs); + data = *((uint8_t *)source.m_base + offs); return true; } @@ -786,9 +786,9 @@ bool debug_view_memory::read(UINT8 size, offs_t offs, UINT64 &data) // read - read a 80 bit value //------------------------------------------------- -bool debug_view_memory::read(UINT8 size, offs_t offs, floatx80 &data) +bool debug_view_memory::read(uint8_t size, offs_t offs, floatx80 &data) { - UINT64 t; + uint64_t t; bool mappedhi, mappedlo; const debug_view_memory_source &source = downcast(*m_source); @@ -811,7 +811,7 @@ bool debug_view_memory::read(UINT8 size, offs_t offs, floatx80 &data) // write - generic memory view data writer //------------------------------------------------- -void debug_view_memory::write(UINT8 size, offs_t offs, UINT64 data) +void debug_view_memory::write(uint8_t size, offs_t offs, uint64_t data) { const debug_view_memory_source &source = downcast(*m_source); @@ -849,7 +849,7 @@ void debug_view_memory::write(UINT8 size, offs_t offs, UINT64 data) offs ^= source.m_offsetxor; if (offs >= source.m_length) return; - *((UINT8 *)source.m_base + offs) = data; + *((uint8_t *)source.m_base + offs) = data; // hack for FD1094 editing #ifdef FD1094_HACK @@ -881,7 +881,7 @@ void debug_view_memory::set_expression(const char *expression) // chunks displayed across a row //------------------------------------------------- -void debug_view_memory::set_chunks_per_row(UINT32 rowchunks) +void debug_view_memory::set_chunks_per_row(uint32_t rowchunks) { if (rowchunks < 1) return; diff --git a/src/emu/debug/dvmemory.h b/src/emu/debug/dvmemory.h index 3b15748ed2e..695ba5909b0 100644 --- a/src/emu/debug/dvmemory.h +++ b/src/emu/debug/dvmemory.h @@ -37,7 +37,7 @@ private: offs_t m_length; // length of memory offs_t m_offsetxor; // XOR to apply to offsets endianness_t m_endianness; // endianness of memory - UINT8 m_prefsize; // preferred bytes per chunk + uint8_t m_prefsize; // preferred bytes per chunk }; @@ -54,7 +54,7 @@ public: // getters const char *expression() const { return m_expression.string(); } int get_data_format() { flush_updates(); return m_data_format; } - UINT32 chunks_per_row() { flush_updates(); return m_chunks_per_row; } + uint32_t chunks_per_row() { flush_updates(); return m_chunks_per_row; } bool reverse() const { return m_reverse_view; } bool ascii() const { return m_ascii_view; } bool physical() const { return m_no_translation; } @@ -62,7 +62,7 @@ public: // setters void set_expression(const char *expression); - void set_chunks_per_row(UINT32 rowchunks); + void set_chunks_per_row(uint32_t rowchunks); void set_data_format(int format); // 1-8 current values 9 32bit floating point void set_reverse(bool reverse); void set_ascii(bool reverse); @@ -78,9 +78,9 @@ protected: private: struct cursor_pos { - cursor_pos(offs_t address = 0, UINT8 shift = 0) : m_address(address), m_shift(shift) { } + cursor_pos(offs_t address = 0, uint8_t shift = 0) : m_address(address), m_shift(shift) { } offs_t m_address; - UINT8 m_shift; + uint8_t m_shift; }; // internal helpers @@ -95,36 +95,36 @@ private: void end_update_and_set_cursor_pos(cursor_pos pos) { set_cursor_pos(pos); end_update(); } // memory access - bool read(UINT8 size, offs_t offs, UINT64 &data); - void write(UINT8 size, offs_t offs, UINT64 data); - bool read(UINT8 size, offs_t offs, floatx80 &data); + bool read(uint8_t size, offs_t offs, uint64_t &data); + void write(uint8_t size, offs_t offs, uint64_t data); + bool read(uint8_t size, offs_t offs, floatx80 &data); // internal state debug_view_expression m_expression; // expression describing the start address - UINT32 m_chunks_per_row; // number of chunks displayed per line - UINT8 m_bytes_per_chunk; // bytes per chunk + uint32_t m_chunks_per_row; // number of chunks displayed per line + uint8_t m_bytes_per_chunk; // bytes per chunk int m_data_format; // 1-8 current values 9 32bit floating point bool m_reverse_view; // reverse-endian view? bool m_ascii_view; // display ASCII characters? bool m_no_translation; // don't run addresses through the cpu translation hook bool m_edit_enabled; // can modify contents ? offs_t m_maxaddr; // (derived) maximum address to display - UINT32 m_bytes_per_row; // (derived) number of bytes displayed per line - UINT32 m_byte_offset; // (derived) offset of starting visible byte + uint32_t m_bytes_per_row; // (derived) number of bytes displayed per line + uint32_t m_byte_offset; // (derived) offset of starting visible byte std::string m_addrformat; // (derived) format string to use to print addresses struct section { bool contains(int x) const { return x >= m_pos && x < m_pos + m_width; } - INT32 m_pos; /* starting position */ - INT32 m_width; /* width of this section */ + int32_t m_pos; /* starting position */ + int32_t m_width; /* width of this section */ }; section m_section[3]; // (derived) 3 sections to manage struct memory_view_pos { - UINT8 m_spacing; /* spacing between each entry */ - UINT8 m_shift[24]; /* shift for each character */ + uint8_t m_spacing; /* spacing between each entry */ + uint8_t m_shift[24]; /* shift for each character */ }; static const memory_view_pos s_memory_pos_table[12]; // table for rendering at different data formats diff --git a/src/emu/debug/dvstate.cpp b/src/emu/debug/dvstate.cpp index 62d792cc9a7..fe3ea7d8082 100644 --- a/src/emu/debug/dvstate.cpp +++ b/src/emu/debug/dvstate.cpp @@ -142,7 +142,7 @@ void debug_view_state::recompute() // count the entries and determine the maximum tag and value sizes std::size_t count = 0; std::size_t maxtaglen = 0; - UINT8 maxvallen = 0; + uint8_t maxvallen = 0; for (auto const &item : m_state_list) { count++; @@ -152,8 +152,8 @@ void debug_view_state::recompute() // set the current divider and total cols m_divider = unsigned(1U + maxtaglen + 1U); - m_total.x = UINT32(1U + maxtaglen + 2U + maxvallen + 1U); - m_total.y = UINT32(count); + m_total.x = uint32_t(1U + maxtaglen + 2U + maxvallen + 1U); + m_total.y = uint32_t(count); m_topleft.x = 0; m_topleft.y = 0; @@ -187,17 +187,17 @@ void debug_view_state::view_update() // get cycle count if we have an execute interface debug_view_state_source const &source(downcast(*m_source)); - UINT64 const total_cycles(source.m_execintf ? source.m_execintf->total_cycles() : 0); + uint64_t const total_cycles(source.m_execintf ? source.m_execintf->total_cycles() : 0); bool const cycles_changed(m_last_update != total_cycles); // loop over rows auto it(m_state_list.begin()); screen_device const *const screen(machine().first_screen()); debug_view_char *dest(&m_viewdata[0]); - for (INT32 index = 0, limit = m_topleft.y + m_visible.y; (index < limit) || (it != m_state_list.end()); ++index) + for (int32_t index = 0, limit = m_topleft.y + m_visible.y; (index < limit) || (it != m_state_list.end()); ++index) { bool const visible((index >= m_topleft.y) && (index < limit)); - UINT32 col(0); + uint32_t col(0); if (it != m_state_list.end()) { @@ -254,11 +254,11 @@ void debug_view_state::view_update() if (visible) { // see if we changed - const UINT8 attrib(curitem.changed() ? DCA_CHANGED: DCA_NORMAL); + const uint8_t attrib(curitem.changed() ? DCA_CHANGED: DCA_NORMAL); // build up a string char temp[256]; - UINT32 len(0); + uint32_t len(0); if (curitem.m_symbol.length() < (m_divider - 1)) { memset(&temp[len], ' ', m_divider - 1 - curitem.m_symbol.length()); @@ -278,7 +278,7 @@ void debug_view_state::view_update() temp[len] = 0; // copy data - for (UINT32 effcol = m_topleft.x; (col < m_visible.x) && (effcol < len); ++dest, ++col) + for (uint32_t effcol = m_topleft.x; (col < m_visible.x) && (effcol < len); ++dest, ++col) { dest->byte = temp[effcol++]; dest->attrib = attrib | ((effcol <= m_divider) ? DCA_ANCILLARY : DCA_NORMAL); @@ -305,7 +305,7 @@ void debug_view_state::view_update() // state_item - constructor //------------------------------------------------- -debug_view_state::state_item::state_item(int index, const char *name, UINT8 valuechars) +debug_view_state::state_item::state_item(int index, const char *name, uint8_t valuechars) : m_lastval(0) , m_currval(0) , m_index(index) @@ -319,7 +319,7 @@ debug_view_state::state_item::state_item(int index, const char *name, UINT8 valu // update - update value and save previous //------------------------------------------------- -void debug_view_state::state_item::update(UINT64 newval, bool save) +void debug_view_state::state_item::update(uint64_t newval, bool save) { if (save) m_lastval = m_currval; diff --git a/src/emu/debug/dvstate.h b/src/emu/debug/dvstate.h index 14faf8177b9..ffc24d6ba57 100644 --- a/src/emu/debug/dvstate.h +++ b/src/emu/debug/dvstate.h @@ -53,24 +53,24 @@ private: class state_item { public: - state_item(int index, const char *name, UINT8 valuechars); + state_item(int index, const char *name, uint8_t valuechars); state_item(const state_item &) = default; state_item(state_item &&) = default; state_item &operator=(const state_item &) = default; state_item &operator=(state_item &&) = default; - UINT64 value() const { return m_currval; } + uint64_t value() const { return m_currval; } bool changed() const { return m_lastval != m_currval; } int index() const { return m_index; } - UINT8 value_length() const { return m_vallen; } + uint8_t value_length() const { return m_vallen; } - void update(UINT64 newval, bool save); + void update(uint64_t newval, bool save); private: - UINT64 m_lastval; // last value - UINT64 m_currval; // current value + uint64_t m_lastval; // last value + uint64_t m_currval; // current value int m_index; // index - UINT8 m_vallen; // number of value chars + uint8_t m_vallen; // number of value chars public: std::string m_symbol; // symbol @@ -83,7 +83,7 @@ private: // internal state int m_divider; // dividing column - UINT64 m_last_update; // execution counter at last update + uint64_t m_last_update; // execution counter at last update std::vector m_state_list; // state data // constants diff --git a/src/emu/debug/dvtext.cpp b/src/emu/debug/dvtext.cpp index af4bbba1852..3a86e0eb877 100644 --- a/src/emu/debug/dvtext.cpp +++ b/src/emu/debug/dvtext.cpp @@ -53,7 +53,7 @@ void debug_view_textbuf::view_update() m_total.x = 80; // determine the starting sequence number - UINT32 curseq = 0; + uint32_t curseq = 0; if (!m_at_bottom) { curseq = m_topseq; @@ -72,16 +72,16 @@ void debug_view_textbuf::view_update() // loop over visible rows debug_view_char *dest = &m_viewdata[0]; - for (UINT32 row = 0; row < m_visible.y; row++) + for (uint32_t row = 0; row < m_visible.y; row++) { const char *line = text_buffer_get_seqnum_line(&m_textbuf, curseq++); - UINT32 col = 0; + uint32_t col = 0; // if this visible row is valid, add it to the buffer if (line != nullptr) { size_t len = strlen(line); - UINT32 effcol = m_topleft.x; + uint32_t effcol = m_topleft.x; // copy data while (col < m_visible.x && effcol < len) diff --git a/src/emu/debug/dvtext.h b/src/emu/debug/dvtext.h index 8ec67c3158c..7a0efbb9a61 100644 --- a/src/emu/debug/dvtext.h +++ b/src/emu/debug/dvtext.h @@ -38,7 +38,7 @@ private: // internal state text_buffer & m_textbuf; /* pointer to the text buffer */ bool m_at_bottom; /* are we tracking new stuff being added? */ - UINT32 m_topseq; /* sequence number of the top line */ + uint32_t m_topseq; /* sequence number of the top line */ }; diff --git a/src/emu/debug/dvwpoints.cpp b/src/emu/debug/dvwpoints.cpp index b186cee4d71..68f7d9d5389 100644 --- a/src/emu/debug/dvwpoints.cpp +++ b/src/emu/debug/dvwpoints.cpp @@ -300,7 +300,7 @@ void debug_view_watchpoints::view_update() pad_ostream_to_length(linebuf, tableBreaks[7]); auto const &text(linebuf.vec()); - for (UINT32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) + for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) { dest->byte = (i < text.size()) ? text[i] : ' '; dest->attrib = DCA_ANCILLARY; @@ -339,7 +339,7 @@ void debug_view_watchpoints::view_update() pad_ostream_to_length(linebuf, tableBreaks[7]); auto const &text(linebuf.vec()); - for (UINT32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) + for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++) { dest->byte = (i < text.size()) ? text[i] : ' '; dest->attrib = DCA_NORMAL; diff --git a/src/emu/debug/express.cpp b/src/emu/debug/express.cpp index 000ff270937..7c3cc74b3d0 100644 --- a/src/emu/debug/express.cpp +++ b/src/emu/debug/express.cpp @@ -112,24 +112,24 @@ class integer_symbol_entry : public symbol_entry { public: // construction/destruction - integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, UINT64 *ptr = nullptr); - integer_symbol_entry(symbol_table &table, const char *name, UINT64 constval); + integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, uint64_t *ptr = nullptr); + integer_symbol_entry(symbol_table &table, const char *name, uint64_t constval); integer_symbol_entry(symbol_table &table, const char *name, void *ref, symbol_table::getter_func getter, symbol_table::setter_func setter); // symbol access virtual bool is_lval() const override; - virtual UINT64 value() const override; - virtual void set_value(UINT64 newvalue) override; + virtual uint64_t value() const override; + virtual void set_value(uint64_t newvalue) override; private: // internal helpers - static UINT64 internal_getter(symbol_table &table, void *symref); - static void internal_setter(symbol_table &table, void *symref, UINT64 value); + static uint64_t internal_getter(symbol_table &table, void *symref); + static void internal_setter(symbol_table &table, void *symref, uint64_t value); // internal state symbol_table::getter_func m_getter; symbol_table::setter_func m_setter; - UINT64 m_value; + uint64_t m_value; }; @@ -142,16 +142,16 @@ public: // symbol access virtual bool is_lval() const override; - virtual UINT64 value() const override; - virtual void set_value(UINT64 newvalue) override; + virtual uint64_t value() const override; + virtual void set_value(uint64_t newvalue) override; // execution helper - virtual UINT64 execute(int numparams, const UINT64 *paramlist); + virtual uint64_t execute(int numparams, const uint64_t *paramlist); private: // internal state - UINT16 m_minparams; - UINT16 m_maxparams; + uint16_t m_minparams; + uint16_t m_maxparams; symbol_table::execute_func m_execute; }; @@ -231,7 +231,7 @@ symbol_entry::~symbol_entry() // integer_symbol_entry - constructor //------------------------------------------------- -integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, UINT64 *ptr) +integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, uint64_t *ptr) : symbol_entry(table, SMT_INTEGER, name, (ptr == nullptr) ? &m_value : ptr), m_getter(internal_getter), m_setter((rw == symbol_table::READ_ONLY) ? nullptr : internal_setter), @@ -240,7 +240,7 @@ integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name } -integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, UINT64 constval) +integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, uint64_t constval) : symbol_entry(table, SMT_INTEGER, name, &m_value), m_getter(internal_getter), m_setter(nullptr), @@ -272,7 +272,7 @@ bool integer_symbol_entry::is_lval() const // value - return the value of this symbol //------------------------------------------------- -UINT64 integer_symbol_entry::value() const +uint64_t integer_symbol_entry::value() const { return m_getter(m_table, m_ref); } @@ -282,7 +282,7 @@ UINT64 integer_symbol_entry::value() const // set_value - set the value of this symbol //------------------------------------------------- -void integer_symbol_entry::set_value(UINT64 newvalue) +void integer_symbol_entry::set_value(uint64_t newvalue) { if (m_setter != nullptr) m_setter(m_table, m_ref, newvalue); @@ -296,9 +296,9 @@ void integer_symbol_entry::set_value(UINT64 newvalue) // returning the value of a variable //------------------------------------------------- -UINT64 integer_symbol_entry::internal_getter(symbol_table &table, void *symref) +uint64_t integer_symbol_entry::internal_getter(symbol_table &table, void *symref) { - return *(UINT64 *)symref; + return *(uint64_t *)symref; } @@ -307,9 +307,9 @@ UINT64 integer_symbol_entry::internal_getter(symbol_table &table, void *symref) // the value of a variable //------------------------------------------------- -void integer_symbol_entry::internal_setter(symbol_table &table, void *symref, UINT64 value) +void integer_symbol_entry::internal_setter(symbol_table &table, void *symref, uint64_t value) { - *(UINT64 *)symref = value; + *(uint64_t *)symref = value; } @@ -345,7 +345,7 @@ bool function_symbol_entry::is_lval() const // value - return the value of this symbol //------------------------------------------------- -UINT64 function_symbol_entry::value() const +uint64_t function_symbol_entry::value() const { throw emu_fatalerror("Symbol '%s' is a function and cannot be used in this context", m_name.c_str()); } @@ -355,7 +355,7 @@ UINT64 function_symbol_entry::value() const // set_value - set the value of this symbol //------------------------------------------------- -void function_symbol_entry::set_value(UINT64 newvalue) +void function_symbol_entry::set_value(uint64_t newvalue) { throw emu_fatalerror("Symbol '%s' is a function and cannot be written", m_name.c_str()); } @@ -365,7 +365,7 @@ void function_symbol_entry::set_value(UINT64 newvalue) // execute - execute the function //------------------------------------------------- -UINT64 function_symbol_entry::execute(int numparams, const UINT64 *paramlist) +uint64_t function_symbol_entry::execute(int numparams, const uint64_t *paramlist) { if (numparams < m_minparams) throw emu_fatalerror("Function '%s' requires at least %d parameters", m_name.c_str(), m_minparams); @@ -396,7 +396,7 @@ symbol_table::symbol_table(void *globalref, symbol_table *parent) //------------------------------------------------- -// add - add a new UINT64 pointer symbol +// add - add a new uint64_t pointer symbol //------------------------------------------------- void symbol_table::configure_memory(void *param, valid_func valid, read_func read, write_func write) @@ -409,10 +409,10 @@ void symbol_table::configure_memory(void *param, valid_func valid, read_func rea //------------------------------------------------- -// add - add a new UINT64 pointer symbol +// add - add a new uint64_t pointer symbol //------------------------------------------------- -void symbol_table::add(const char *name, read_write rw, UINT64 *ptr) +void symbol_table::add(const char *name, read_write rw, uint64_t *ptr) { m_symlist.erase(name); m_symlist.emplace(name, std::make_unique(*this, name, rw, ptr)); @@ -423,7 +423,7 @@ void symbol_table::add(const char *name, read_write rw, UINT64 *ptr) // add - add a new value symbol //------------------------------------------------- -void symbol_table::add(const char *name, UINT64 value) +void symbol_table::add(const char *name, uint64_t value) { m_symlist.erase(name); m_symlist.emplace(name, std::make_unique(*this, name, value)); @@ -474,7 +474,7 @@ symbol_entry *symbol_table::find_deep(const char *symbol) // value - return the value of a symbol //------------------------------------------------- -UINT64 symbol_table::value(const char *symbol) +uint64_t symbol_table::value(const char *symbol) { symbol_entry *entry = find_deep(symbol); return (entry != nullptr) ? entry->value() : 0; @@ -485,7 +485,7 @@ UINT64 symbol_table::value(const char *symbol) // set_value - set the value of a symbol //------------------------------------------------- -void symbol_table::set_value(const char *symbol, UINT64 value) +void symbol_table::set_value(const char *symbol, uint64_t value) { symbol_entry *entry = find_deep(symbol); if (entry != nullptr) @@ -516,7 +516,7 @@ expression_error::error_code symbol_table::memory_valid(const char *name, expres // memory_value - return a value read from memory //------------------------------------------------- -UINT64 symbol_table::memory_value(const char *name, expression_space space, UINT32 offset, int size) +uint64_t symbol_table::memory_value(const char *name, expression_space space, uint32_t offset, int size) { // walk up the table hierarchy to find the owner for (symbol_table *symtable = this; symtable != nullptr; symtable = symtable->m_parent) @@ -535,7 +535,7 @@ UINT64 symbol_table::memory_value(const char *name, expression_space space, UINT // set_memory_value - write a value to memory //------------------------------------------------- -void symbol_table::set_memory_value(const char *name, expression_space space, UINT32 offset, int size, UINT64 value) +void symbol_table::set_memory_value(const char *name, expression_space space, uint32_t offset, int size, uint64_t value) { // walk up the table hierarchy to find the owner for (symbol_table *symtable = this; symtable != nullptr; symtable = symtable->m_parent) @@ -558,7 +558,7 @@ void symbol_table::set_memory_value(const char *name, expression_space space, UI // parsed_expression - constructor //------------------------------------------------- -parsed_expression::parsed_expression(symbol_table *symtable, const char *expression, UINT64 *result) +parsed_expression::parsed_expression(symbol_table *symtable, const char *expression, uint64_t *result) : m_symtable(symtable), m_token_stack_ptr(0) { @@ -627,7 +627,7 @@ void parsed_expression::print_tokens(FILE *out) break; case parse_token::NUMBER: - fprintf(out, "NUMBER: %08X%08X\n", (UINT32)(token->value.i >> 32), (UINT32)token->value.i); + fprintf(out, "NUMBER: %08X%08X\n", (uint32_t)(token->value.i >> 32), (uint32_t)token->value.i); break; case parse_token::STRING: @@ -635,7 +635,7 @@ void parsed_expression::print_tokens(FILE *out) break; case parse_token::SYMBOL: - fprintf(out, "SYMBOL: %08X%08X\n", (UINT32)(token->value.i >> 32), (UINT32)token->value.i); + fprintf(out, "SYMBOL: %08X%08X\n", (uint32_t)(token->value.i >> 32), (uint32_t)token->value.i); break; case parse_token::OPERATOR: @@ -708,7 +708,7 @@ void parsed_expression::parse_string_into_tokens() while (string[0] != 0) { // ignore any whitespace - while (string[0] != 0 && isspace((UINT8)string[0])) + while (string[0] != 0 && isspace((uint8_t)string[0])) string++; if (string[0] == 0) break; @@ -717,7 +717,7 @@ void parsed_expression::parse_string_into_tokens() parse_token &token = m_tokenlist.append(*global_alloc(parse_token(string - stringstart))); // switch off the first character - switch (tolower((UINT8)string[0])) + switch (tolower((uint8_t)string[0])) { case '(': string += 1, token.configure_operator(TVL_LPAREN, 0); @@ -865,7 +865,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& while (1) { static const char valid[] = "abcdefghijklmnopqrstuvwxyz0123456789_$#.:"; - char val = tolower((UINT8)string[0]); + char val = tolower((uint8_t)string[0]); if (val == 0 || strchr(valid, val) == nullptr) break; buffer.append(&val, 1); @@ -965,12 +965,12 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& void parsed_expression::parse_number(parse_token &token, const char *string, int base, expression_error::error_code errcode) { // parse the actual value - UINT64 value = 0; + uint64_t value = 0; while (*string != 0) { // look up the number's value, stopping if not valid static const char numbers[] = "0123456789abcdef"; - const char *ptr = strchr(numbers, tolower((UINT8)*string)); + const char *ptr = strchr(numbers, tolower((uint8_t)*string)); if (ptr == nullptr) break; @@ -980,7 +980,7 @@ void parsed_expression::parse_number(parse_token &token, const char *string, int break; // shift previous digits up and add in new digit - value = (value * (UINT64)base) + digit; + value = (value * (uint64_t)base) + digit; string++; } @@ -1001,7 +1001,7 @@ void parsed_expression::parse_quoted_char(parse_token &token, const char *&strin { // accumulate the value of the character token string++; - UINT64 value = 0; + uint64_t value = 0; while (string[0] != 0) { // allow '' to mean a nested single quote @@ -1011,7 +1011,7 @@ void parsed_expression::parse_quoted_char(parse_token &token, const char *&strin break; string++; } - value = (value << 8) | (UINT8)*string++; + value = (value << 8) | (uint8_t)*string++; } // if we didn't find the ending quote, report an error @@ -1388,7 +1388,7 @@ inline void parsed_expression::pop_token_rval(parse_token &token) // of tokens //------------------------------------------------- -UINT64 parsed_expression::execute_tokens() +uint64_t parsed_expression::execute_tokens() { // reset the token stack m_token_stack_ptr = 0; @@ -1674,7 +1674,7 @@ parsed_expression::parse_token::parse_token(int offset) // for a SYMBOL token //------------------------------------------------- -UINT64 parsed_expression::parse_token::get_lval_value(symbol_table *table) +uint64_t parsed_expression::parse_token::get_lval_value(symbol_table *table) { // get the value of a symbol if (is_symbol()) @@ -1693,7 +1693,7 @@ UINT64 parsed_expression::parse_token::get_lval_value(symbol_table *table) // for a SYMBOL token //------------------------------------------------- -inline void parsed_expression::parse_token::set_lval_value(symbol_table *table, UINT64 value) +inline void parsed_expression::parse_token::set_lval_value(symbol_table *table, uint64_t value) { // set the value of a symbol if (is_symbol()) @@ -1713,7 +1713,7 @@ inline void parsed_expression::parse_token::set_lval_value(symbol_table *table, void parsed_expression::execute_function(parse_token &token) { // pop off all pushed parameters - UINT64 funcparams[MAX_FUNCTION_PARAMS]; + uint64_t funcparams[MAX_FUNCTION_PARAMS]; symbol_entry *symbol = nullptr; int paramcount = 0; while (paramcount < MAX_FUNCTION_PARAMS) diff --git a/src/emu/debug/express.h b/src/emu/debug/express.h index bae298ada7e..7618bfada20 100644 --- a/src/emu/debug/express.h +++ b/src/emu/debug/express.h @@ -129,8 +129,8 @@ public: // symbol access virtual bool is_lval() const = 0; - virtual UINT64 value() const = 0; - virtual void set_value(UINT64 newvalue) = 0; + virtual uint64_t value() const = 0; + virtual void set_value(uint64_t newvalue) = 0; protected: // internal state @@ -150,16 +150,16 @@ class symbol_table { public: // callback functions for getting/setting a symbol value - typedef std::function getter_func; - typedef std::function setter_func; + typedef std::function getter_func; + typedef std::function setter_func; // callback functions for function execution - typedef std::function execute_func; + typedef std::function execute_func; // callback functions for memory reads/writes typedef std::function valid_func; - typedef std::function read_func; - typedef std::function write_func; + typedef std::function read_func; + typedef std::function write_func; enum read_write { @@ -179,21 +179,21 @@ public: void configure_memory(void *param, valid_func valid, read_func read, write_func write); // symbol access - void add(const char *name, read_write rw, UINT64 *ptr = nullptr); - void add(const char *name, UINT64 constvalue); + void add(const char *name, read_write rw, uint64_t *ptr = nullptr); + void add(const char *name, uint64_t constvalue); void add(const char *name, void *ref, getter_func getter, setter_func setter = nullptr); void add(const char *name, void *ref, int minparams, int maxparams, execute_func execute); symbol_entry *find(const char *name) const { if (name) { auto search = m_symlist.find(name); if (search != m_symlist.end()) return search->second.get(); else return nullptr; } else return nullptr; } symbol_entry *find_deep(const char *name); // value getter/setter - UINT64 value(const char *symbol); - void set_value(const char *symbol, UINT64 value); + uint64_t value(const char *symbol); + void set_value(const char *symbol, uint64_t value); // memory accessors expression_error::error_code memory_valid(const char *name, expression_space space); - UINT64 memory_value(const char *name, expression_space space, UINT32 offset, int size); - void set_memory_value(const char *name, expression_space space, UINT32 offset, int size, UINT64 value); + uint64_t memory_value(const char *name, expression_space space, uint32_t offset, int size); + void set_memory_value(const char *name, expression_space space, uint32_t offset, int size, uint64_t value); private: // internal state @@ -216,7 +216,7 @@ class parsed_expression public: // construction/destruction parsed_expression(const parsed_expression &src) { copy(src); } - parsed_expression(symbol_table *symtable = nullptr, const char *expression = nullptr, UINT64 *result = nullptr); + parsed_expression(symbol_table *symtable = nullptr, const char *expression = nullptr, uint64_t *result = nullptr); // operators parsed_expression &operator=(const parsed_expression &src) { copy(src); return *this; } @@ -231,7 +231,7 @@ public: // execution void parse(const char *string); - UINT64 execute() { return execute_tokens(); } + uint64_t execute() { return execute_tokens(); } private: // a single token @@ -279,15 +279,15 @@ private: bool is_memory() const { return (m_type == MEMORY); } bool is_symbol() const { return (m_type == SYMBOL); } bool is_operator() const { return (m_type == OPERATOR); } - bool is_operator(UINT8 type) const { return (m_type == OPERATOR && optype() == type); } + bool is_operator(uint8_t type) const { return (m_type == OPERATOR && optype() == type); } bool is_lval() const { return ((m_type == SYMBOL && m_symbol->is_lval()) || m_type == MEMORY); } - UINT64 value() const { assert(m_type == NUMBER); return m_value; } - UINT32 address() const { assert(m_type == MEMORY); return m_value; } + uint64_t value() const { assert(m_type == NUMBER); return m_value; } + uint32_t address() const { assert(m_type == MEMORY); return m_value; } symbol_entry *symbol() const { assert(m_type == SYMBOL); return m_symbol; } - UINT8 optype() const { assert(m_type == OPERATOR); return (m_flags & TIN_OPTYPE_MASK) >> TIN_OPTYPE_SHIFT; } - UINT8 precedence() const { assert(m_type == OPERATOR); return (m_flags & TIN_PRECEDENCE_MASK) >> TIN_PRECEDENCE_SHIFT; } + uint8_t optype() const { assert(m_type == OPERATOR); return (m_flags & TIN_OPTYPE_MASK) >> TIN_OPTYPE_SHIFT; } + uint8_t precedence() const { assert(m_type == OPERATOR); return (m_flags & TIN_PRECEDENCE_MASK) >> TIN_PRECEDENCE_SHIFT; } bool is_function_separator() const { assert(m_type == OPERATOR); return ((m_flags & TIN_FUNCTION_MASK) != 0); } bool right_to_left() const { assert(m_type == OPERATOR); return ((m_flags & TIN_RIGHT_TO_LEFT_MASK) != 0); } expression_space memory_space() const { assert(m_type == OPERATOR || m_type == MEMORY); return expression_space((m_flags & TIN_MEMORY_SPACE_MASK) >> TIN_MEMORY_SPACE_SHIFT); } @@ -297,11 +297,11 @@ private: parse_token &set_offset(int offset) { m_offset = offset; return *this; } parse_token &set_offset(const parse_token &src) { m_offset = src.m_offset; return *this; } parse_token &set_offset(const parse_token &src1, const parse_token &src2) { m_offset = std::min(src1.m_offset, src2.m_offset); return *this; } - parse_token &configure_number(UINT64 value) { m_type = NUMBER; m_value = value; return *this; } + parse_token &configure_number(uint64_t value) { m_type = NUMBER; m_value = value; return *this; } parse_token &configure_string(const char *string) { m_type = STRING; m_string = string; return *this; } - parse_token &configure_memory(UINT32 address, parse_token &memoryat) { m_type = MEMORY; m_value = address; m_flags = memoryat.m_flags; m_string = memoryat.m_string; return *this; } + parse_token &configure_memory(uint32_t address, parse_token &memoryat) { m_type = MEMORY; m_value = address; m_flags = memoryat.m_flags; m_string = memoryat.m_string; return *this; } parse_token &configure_symbol(symbol_entry &symbol) { m_type = SYMBOL; m_symbol = &symbol; return *this; } - parse_token &configure_operator(UINT8 optype, UINT8 precedence) + parse_token &configure_operator(uint8_t optype, uint8_t precedence) { m_type = OPERATOR; m_flags = ((optype << TIN_OPTYPE_SHIFT) & TIN_OPTYPE_MASK) | ((precedence << TIN_PRECEDENCE_SHIFT) & TIN_PRECEDENCE_MASK); return *this; } parse_token &set_function_separator() { assert(m_type == OPERATOR); m_flags |= TIN_FUNCTION_MASK; return *this; } @@ -311,16 +311,16 @@ private: parse_token &set_memory_source(const char *string) { assert(m_type == OPERATOR || m_type == MEMORY); m_string = string; return *this; } // access - UINT64 get_lval_value(symbol_table *symtable); - void set_lval_value(symbol_table *symtable, UINT64 value); + uint64_t get_lval_value(symbol_table *symtable); + void set_lval_value(symbol_table *symtable, uint64_t value); private: // internal state parse_token * m_next; // next token in list token_type m_type; // type of token int m_offset; // offset within the string - UINT64 m_value; // integral value - UINT32 m_flags; // additional flags/info + uint64_t m_value; // integral value + uint32_t m_flags; // additional flags/info const char * m_string; // associated string symbol_entry * m_symbol; // symbol pointer }; @@ -366,7 +366,7 @@ private: parse_token *peek_token(int count); void pop_token_lval(parse_token &token); void pop_token_rval(parse_token &token); - UINT64 execute_tokens(); + uint64_t execute_tokens(); void execute_function(parse_token &token); // constants diff --git a/src/emu/debug/textbuf.cpp b/src/emu/debug/textbuf.cpp index 5f2fbf8280b..3e5202476c4 100644 --- a/src/emu/debug/textbuf.cpp +++ b/src/emu/debug/textbuf.cpp @@ -28,15 +28,15 @@ struct text_buffer { char * buffer; - INT32 * lineoffs; - INT32 bufsize; - INT32 bufstart; - INT32 bufend; - INT32 linesize; - INT32 linestart; - INT32 lineend; - UINT32 linestartseq; - INT32 maxwidth; + int32_t * lineoffs; + int32_t bufsize; + int32_t bufstart; + int32_t bufend; + int32_t linesize; + int32_t linestart; + int32_t lineend; + uint32_t linestartseq; + int32_t maxwidth; }; @@ -50,9 +50,9 @@ struct text_buffer currently held in the buffer -------------------------------------------------*/ -static inline INT32 buffer_used(text_buffer *text) +static inline int32_t buffer_used(text_buffer *text) { - INT32 used = text->bufend - text->bufstart; + int32_t used = text->bufend - text->bufstart; if (used < 0) used += text->bufsize; return used; @@ -64,7 +64,7 @@ static inline INT32 buffer_used(text_buffer *text) available in the buffer -------------------------------------------------*/ -static inline INT32 buffer_space(text_buffer *text) +static inline int32_t buffer_space(text_buffer *text) { return text->bufsize - buffer_used(text); } @@ -81,7 +81,7 @@ static inline INT32 buffer_space(text_buffer *text) text_buffer_alloc - allocate a new text buffer -------------------------------------------------*/ -text_buffer *text_buffer_alloc(UINT32 bytes, UINT32 lines) +text_buffer *text_buffer_alloc(uint32_t bytes, uint32_t lines) { text_buffer *text; @@ -99,7 +99,7 @@ text_buffer *text_buffer_alloc(UINT32 bytes, UINT32 lines) } /* allocate memory for the lines array */ - text->lineoffs = global_alloc_array_nothrow(INT32, lines); + text->lineoffs = global_alloc_array_nothrow(int32_t, lines); if (!text->lineoffs) { global_free_array(text->buffer); @@ -179,11 +179,11 @@ void text_buffer_print(text_buffer *text, const char *data) void text_buffer_print_wrap(text_buffer *text, const char *data, int wrapcol) { - INT32 stopcol = (wrapcol < MAX_LINE_LENGTH) ? wrapcol : MAX_LINE_LENGTH; - INT32 needed_space; + int32_t stopcol = (wrapcol < MAX_LINE_LENGTH) ? wrapcol : MAX_LINE_LENGTH; + int32_t needed_space; /* we need to ensure there is enough space for this string plus enough for the max line length */ - needed_space = (INT32)strlen(data) + MAX_LINE_LENGTH; + needed_space = (int32_t)strlen(data) + MAX_LINE_LENGTH; /* make space in the buffer if we need to */ while (buffer_space(text) < needed_space && text->linestart != text->lineend) @@ -278,7 +278,7 @@ void text_buffer_print_wrap(text_buffer *text, const char *data, int wrapcol) width of all lines seen so far -------------------------------------------------*/ -UINT32 text_buffer_max_width(text_buffer *text) +uint32_t text_buffer_max_width(text_buffer *text) { return text->maxwidth; } @@ -289,9 +289,9 @@ UINT32 text_buffer_max_width(text_buffer *text) lines in the text buffer -------------------------------------------------*/ -UINT32 text_buffer_num_lines(text_buffer *text) +uint32_t text_buffer_num_lines(text_buffer *text) { - INT32 lines = text->lineend + 1 - text->linestart; + int32_t lines = text->lineend + 1 - text->linestart; if (lines <= 0) lines += text->linesize; return lines; @@ -303,7 +303,7 @@ UINT32 text_buffer_num_lines(text_buffer *text) line index into a sequence number -------------------------------------------------*/ -UINT32 text_buffer_line_index_to_seqnum(text_buffer *text, UINT32 index) +uint32_t text_buffer_line_index_to_seqnum(text_buffer *text, uint32_t index) { return text->linestartseq + index; } @@ -314,10 +314,10 @@ UINT32 text_buffer_line_index_to_seqnum(text_buffer *text, UINT32 index) an indexed line in the buffer -------------------------------------------------*/ -const char *text_buffer_get_seqnum_line(text_buffer *text, UINT32 seqnum) +const char *text_buffer_get_seqnum_line(text_buffer *text, uint32_t seqnum) { - UINT32 numlines = text_buffer_num_lines(text); - UINT32 index = seqnum - text->linestartseq; + uint32_t numlines = text_buffer_num_lines(text); + uint32_t index = seqnum - text->linestartseq; if (index >= numlines) return nullptr; return &text->buffer[text->lineoffs[(text->linestart + index) % text->linesize]]; diff --git a/src/emu/debug/textbuf.h b/src/emu/debug/textbuf.h index c30ff63d6de..e9b65c503a7 100644 --- a/src/emu/debug/textbuf.h +++ b/src/emu/debug/textbuf.h @@ -25,7 +25,7 @@ struct text_buffer; ***************************************************************************/ /* allocate a new text buffer */ -text_buffer *text_buffer_alloc(UINT32 bytes, UINT32 lines); +text_buffer *text_buffer_alloc(uint32_t bytes, uint32_t lines); /* free a text buffer */ void text_buffer_free(text_buffer *text); @@ -40,16 +40,16 @@ void text_buffer_print(text_buffer *text, const char *data); void text_buffer_print_wrap(text_buffer *text, const char *data, int wrapcol); /* get the maximum width of lines seen so far */ -UINT32 text_buffer_max_width(text_buffer *text); +uint32_t text_buffer_max_width(text_buffer *text); /* get the current number of lines in the buffer */ -UINT32 text_buffer_num_lines(text_buffer *text); +uint32_t text_buffer_num_lines(text_buffer *text); /* get an absolute sequence number for a given line */ -UINT32 text_buffer_line_index_to_seqnum(text_buffer *text, UINT32 index); +uint32_t text_buffer_line_index_to_seqnum(text_buffer *text, uint32_t index); /* get a sequenced line from the text buffer */ -const char *text_buffer_get_seqnum_line(text_buffer *text, UINT32 seqnum); +const char *text_buffer_get_seqnum_line(text_buffer *text, uint32_t seqnum); #endif /* __TEXTBUF_H__ */ diff --git a/src/emu/devcb.cpp b/src/emu/devcb.cpp index d54c25e530b..d3b89700fe4 100644 --- a/src/emu/devcb.cpp +++ b/src/emu/devcb.cpp @@ -20,7 +20,7 @@ // devcb_base - constructor //------------------------------------------------- -devcb_base::devcb_base(device_t &device, UINT64 defmask) +devcb_base::devcb_base(device_t &device, uint64_t defmask) : m_device(device), m_rshift(0), m_mask(defmask), @@ -107,7 +107,7 @@ void devcb_base::resolve_space() // devcb_read_base - constructor //------------------------------------------------- -devcb_read_base::devcb_read_base(device_t &device, UINT64 defmask) +devcb_read_base::devcb_read_base(device_t &device, uint64_t defmask) : devcb_base(device, defmask), m_adapter(nullptr) { @@ -221,7 +221,7 @@ void devcb_read_base::resolve() // the given value //------------------------------------------------- -void devcb_read_base::resolve_safe(UINT64 none_constant_value) +void devcb_read_base::resolve_safe(uint64_t none_constant_value) { // convert to a constant if none specified if (m_type == CALLBACK_NONE) @@ -238,7 +238,7 @@ void devcb_read_base::resolve_safe(UINT64 none_constant_value) // unresolved adapter //------------------------------------------------- -UINT64 devcb_read_base::read_unresolved_adapter(address_space &space, offs_t offset, UINT64 mask) +uint64_t devcb_read_base::read_unresolved_adapter(address_space &space, offs_t offset, uint64_t mask) { throw emu_fatalerror("Attempted to read through an unresolved devcb item"); } @@ -248,7 +248,7 @@ UINT64 devcb_read_base::read_unresolved_adapter(address_space &space, offs_t off // read_line_adapter - read from a line delegate //------------------------------------------------- -UINT64 devcb_read_base::read_line_adapter(address_space &space, offs_t offset, UINT64 mask) +uint64_t devcb_read_base::read_line_adapter(address_space &space, offs_t offset, uint64_t mask) { return shift_mask_xor(m_readline() & 1); } @@ -258,7 +258,7 @@ UINT64 devcb_read_base::read_line_adapter(address_space &space, offs_t offset, U // read8_adapter - read from an 8-bit delegate //------------------------------------------------- -UINT64 devcb_read_base::read8_adapter(address_space &space, offs_t offset, UINT64 mask) +uint64_t devcb_read_base::read8_adapter(address_space &space, offs_t offset, uint64_t mask) { return shift_mask_xor(m_read8(space, offset, unshift_mask(mask))); } @@ -268,7 +268,7 @@ UINT64 devcb_read_base::read8_adapter(address_space &space, offs_t offset, UINT6 // read16_adapter - read from a 16-bit delegate //------------------------------------------------- -UINT64 devcb_read_base::read16_adapter(address_space &space, offs_t offset, UINT64 mask) +uint64_t devcb_read_base::read16_adapter(address_space &space, offs_t offset, uint64_t mask) { return shift_mask_xor(m_read16(space, offset, unshift_mask(mask))); } @@ -278,7 +278,7 @@ UINT64 devcb_read_base::read16_adapter(address_space &space, offs_t offset, UINT // read32_adapter - read from a 32-bit delegate //------------------------------------------------- -UINT64 devcb_read_base::read32_adapter(address_space &space, offs_t offset, UINT64 mask) +uint64_t devcb_read_base::read32_adapter(address_space &space, offs_t offset, uint64_t mask) { return shift_mask_xor(m_read32(space, offset, unshift_mask(mask))); } @@ -288,7 +288,7 @@ UINT64 devcb_read_base::read32_adapter(address_space &space, offs_t offset, UINT // read64_adapter - read from a 64-bit delegate //------------------------------------------------- -UINT64 devcb_read_base::read64_adapter(address_space &space, offs_t offset, UINT64 mask) +uint64_t devcb_read_base::read64_adapter(address_space &space, offs_t offset, uint64_t mask) { return shift_mask_xor(m_read64(space, offset, unshift_mask(mask))); } @@ -298,7 +298,7 @@ UINT64 devcb_read_base::read64_adapter(address_space &space, offs_t offset, UINT // read_ioport - read from an I/O port //------------------------------------------------- -UINT64 devcb_read_base::read_ioport_adapter(address_space &space, offs_t offset, UINT64 mask) +uint64_t devcb_read_base::read_ioport_adapter(address_space &space, offs_t offset, uint64_t mask) { return shift_mask_xor(m_target.ioport->read()); } @@ -309,7 +309,7 @@ UINT64 devcb_read_base::read_ioport_adapter(address_space &space, offs_t offset, // constant //------------------------------------------------- -UINT64 devcb_read_base::read_logged_adapter(address_space &space, offs_t offset, UINT64 mask) +uint64_t devcb_read_base::read_logged_adapter(address_space &space, offs_t offset, uint64_t mask) { m_device.logerror("%s: read %s\n", m_device.machine().describe_context(), m_target_tag); return shift_mask_xor(m_target_int); @@ -320,7 +320,7 @@ UINT64 devcb_read_base::read_logged_adapter(address_space &space, offs_t offset, // read_constant - read from a constant //------------------------------------------------- -UINT64 devcb_read_base::read_constant_adapter(address_space &space, offs_t offset, UINT64 mask) +uint64_t devcb_read_base::read_constant_adapter(address_space &space, offs_t offset, uint64_t mask) { return shift_mask_xor(m_target_int); } @@ -335,7 +335,7 @@ UINT64 devcb_read_base::read_constant_adapter(address_space &space, offs_t offse // devcb_write_base - constructor //------------------------------------------------- -devcb_write_base::devcb_write_base(device_t &device, UINT64 defmask) +devcb_write_base::devcb_write_base(device_t &device, uint64_t defmask) : devcb_base(device, defmask), m_adapter(nullptr) { @@ -458,7 +458,7 @@ void devcb_write_base::resolve_safe() // unresolved adapter //------------------------------------------------- -void devcb_write_base::write_unresolved_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write_unresolved_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { throw emu_fatalerror("Attempted to write through an unresolved devcb item"); } @@ -468,7 +468,7 @@ void devcb_write_base::write_unresolved_adapter(address_space &space, offs_t off // write_line_adapter - write from a line delegate //------------------------------------------------- -void devcb_write_base::write_line_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write_line_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { m_writeline(unshift_mask_xor(data) & 1); } @@ -478,7 +478,7 @@ void devcb_write_base::write_line_adapter(address_space &space, offs_t offset, U // write8_adapter - write from an 8-bit delegate //------------------------------------------------- -void devcb_write_base::write8_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write8_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { m_write8(space, offset, unshift_mask_xor(data), unshift_mask(mask)); } @@ -488,7 +488,7 @@ void devcb_write_base::write8_adapter(address_space &space, offs_t offset, UINT6 // write16_adapter - write from a 16-bit delegate //------------------------------------------------- -void devcb_write_base::write16_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write16_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { m_write16(space, offset, unshift_mask_xor(data), unshift_mask(mask)); } @@ -498,7 +498,7 @@ void devcb_write_base::write16_adapter(address_space &space, offs_t offset, UINT // write32_adapter - write from a 32-bit delegate //------------------------------------------------- -void devcb_write_base::write32_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write32_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { m_write32(space, offset, unshift_mask_xor(data), unshift_mask(mask)); } @@ -508,7 +508,7 @@ void devcb_write_base::write32_adapter(address_space &space, offs_t offset, UINT // write64_adapter - write from a 64-bit delegate //------------------------------------------------- -void devcb_write_base::write64_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write64_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { m_write64(space, offset, unshift_mask_xor(data), unshift_mask(mask)); } @@ -518,7 +518,7 @@ void devcb_write_base::write64_adapter(address_space &space, offs_t offset, UINT // write_ioport - write from an I/O port //------------------------------------------------- -void devcb_write_base::write_ioport_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write_ioport_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { if (m_target.ioport) m_target.ioport->write(unshift_mask_xor(data)); @@ -530,7 +530,7 @@ void devcb_write_base::write_ioport_adapter(address_space &space, offs_t offset, // adapter //------------------------------------------------- -void devcb_write_base::write_logged_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write_logged_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { m_device.logerror("%s: unresolved devcb write\n", m_device.machine().describe_context()); } @@ -540,7 +540,7 @@ void devcb_write_base::write_logged_adapter(address_space &space, offs_t offset, // write_constant - write from a constant //------------------------------------------------- -void devcb_write_base::write_noop_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write_noop_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { // constant for writes is a no-op } @@ -551,7 +551,7 @@ void devcb_write_base::write_noop_adapter(address_space &space, offs_t offset, U // input line //------------------------------------------------- -void devcb_write_base::write_inputline_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void devcb_write_base::write_inputline_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { m_target.device->execute().set_input_line(m_target_int, unshift_mask_xor(data) & 1); } diff --git a/src/emu/devcb.h b/src/emu/devcb.h index d84d3bca1dc..0440413f417 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -98,7 +98,7 @@ protected: }; // construction/destruction - devcb_base(device_t &device, UINT64 defmask); + devcb_base(device_t &device, uint64_t defmask); public: // getters @@ -107,8 +107,8 @@ public: // additional configuration devcb_base &set_space(const char *device, address_spacenum space = AS_0) { m_space_tag = device; m_space_num = space; return *this; } devcb_base &set_rshift(int rshift) { m_rshift = rshift; return *this; } - devcb_base &set_mask(UINT64 mask) { m_mask = mask; return *this; } - devcb_base &set_xor(UINT64 xorval) { m_xor = xorval; return *this; } + devcb_base &set_mask(uint64_t mask) { m_mask = mask; return *this; } + devcb_base &set_xor(uint64_t xorval) { m_xor = xorval; return *this; } // construction helper classes class null_desc @@ -127,16 +127,16 @@ public: class constant_desc { public: - constant_desc(UINT64 value) { m_value = value; } - UINT64 m_value; + constant_desc(uint64_t value) { m_value = value; } + uint64_t m_value; }; class logger_desc { public: - logger_desc(const char *string, UINT64 value = 0) { m_string = string; m_value = value; } + logger_desc(const char *string, uint64_t value = 0) { m_string = string; m_value = value; } const char *m_string; - UINT64 m_value; + uint64_t m_value; }; class inputline_desc @@ -156,9 +156,9 @@ public: protected: // internal helpers - inline UINT64 shift_mask_xor(UINT64 value) const { return (((m_rshift < 0) ? (value << -m_rshift) : (value >> m_rshift)) ^ m_xor) & m_mask; } - inline UINT64 unshift_mask(UINT64 value) const { return (m_rshift < 0) ? ((value & m_mask) >> -m_rshift) : ((value & m_mask) << m_rshift); } - inline UINT64 unshift_mask_xor(UINT64 value) const { return (m_rshift < 0) ? (((value ^ m_xor) & m_mask) >> -m_rshift) : (((value ^ m_xor) & m_mask) << m_rshift); } + inline uint64_t shift_mask_xor(uint64_t value) const { return (((m_rshift < 0) ? (value << -m_rshift) : (value >> m_rshift)) ^ m_xor) & m_mask; } + inline uint64_t unshift_mask(uint64_t value) const { return (m_rshift < 0) ? ((value & m_mask) >> -m_rshift) : ((value & m_mask) << m_rshift); } + inline uint64_t unshift_mask_xor(uint64_t value) const { return (m_rshift < 0) ? (((value ^ m_xor) & m_mask) >> -m_rshift) : (((value ^ m_xor) & m_mask) << m_rshift); } void reset(callback_type type = CALLBACK_NONE); void resolve_ioport(); void resolve_inputline(); @@ -176,7 +176,7 @@ protected: device_t & m_device; // reference to our owning device callback_type m_type; // type of callback registered const char * m_target_tag; // tag of target object - UINT64 m_target_int; // integer value of target object + uint64_t m_target_int; // integer value of target object const char * m_space_tag; // tag of address space device address_spacenum m_space_num; // address space number of space device @@ -184,8 +184,8 @@ protected: address_space * m_space; // target address space callback_target m_target; // resolved pointer to target object int m_rshift; // right shift to apply to data read - UINT64 m_mask; // mask to apply to data read - UINT64 m_xor; // XOR to apply to data read + uint64_t m_mask; // mask to apply to data read + uint64_t m_xor; // XOR to apply to data read }; @@ -195,7 +195,7 @@ class devcb_read_base : public devcb_base { protected: // construction/destruction - devcb_read_base(device_t &device, UINT64 defmask); + devcb_read_base(device_t &device, uint64_t defmask); public: // callback configuration @@ -208,22 +208,22 @@ public: // resolution void resolve(); - void resolve_safe(UINT64 none_constant_value); + void resolve_safe(uint64_t none_constant_value); protected: // internal helpers void reset(callback_type type = CALLBACK_NONE); // adapters - UINT64 read_unresolved_adapter(address_space &space, offs_t offset, UINT64 mask); - UINT64 read_line_adapter(address_space &space, offs_t offset, UINT64 mask); - UINT64 read8_adapter(address_space &space, offs_t offset, UINT64 mask); - UINT64 read16_adapter(address_space &space, offs_t offset, UINT64 mask); - UINT64 read32_adapter(address_space &space, offs_t offset, UINT64 mask); - UINT64 read64_adapter(address_space &space, offs_t offset, UINT64 mask); - UINT64 read_ioport_adapter(address_space &space, offs_t offset, UINT64 mask); - UINT64 read_logged_adapter(address_space &space, offs_t offset, UINT64 mask); - UINT64 read_constant_adapter(address_space &space, offs_t offset, UINT64 mask); + uint64_t read_unresolved_adapter(address_space &space, offs_t offset, uint64_t mask); + uint64_t read_line_adapter(address_space &space, offs_t offset, uint64_t mask); + uint64_t read8_adapter(address_space &space, offs_t offset, uint64_t mask); + uint64_t read16_adapter(address_space &space, offs_t offset, uint64_t mask); + uint64_t read32_adapter(address_space &space, offs_t offset, uint64_t mask); + uint64_t read64_adapter(address_space &space, offs_t offset, uint64_t mask); + uint64_t read_ioport_adapter(address_space &space, offs_t offset, uint64_t mask); + uint64_t read_logged_adapter(address_space &space, offs_t offset, uint64_t mask); + uint64_t read_constant_adapter(address_space &space, offs_t offset, uint64_t mask); // configuration read_line_delegate m_readline; // copy of registered line reader @@ -233,7 +233,7 @@ protected: read64_delegate m_read64; // copy of registered 64-bit reader // derived state - typedef UINT64 (devcb_read_base::*adapter_func)(address_space &, offs_t, UINT64); + typedef uint64_t (devcb_read_base::*adapter_func)(address_space &, offs_t, uint64_t); adapter_func m_adapter; // actual callback to invoke }; @@ -244,7 +244,7 @@ class devcb_write_base : public devcb_base { protected: // construction/destruction - devcb_write_base(device_t &device, UINT64 defmask); + devcb_write_base(device_t &device, uint64_t defmask); public: // callback configuration @@ -264,16 +264,16 @@ protected: void reset(callback_type type = CALLBACK_NONE); // adapters - void write_unresolved_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); - void write_line_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); - void write8_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); - void write16_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); - void write32_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); - void write64_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); - void write_ioport_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); - void write_logged_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); - void write_noop_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); - void write_inputline_adapter(address_space &space, offs_t offset, UINT64 data, UINT64 mask); + void write_unresolved_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); + void write_line_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); + void write8_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); + void write16_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); + void write32_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); + void write64_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); + void write_ioport_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); + void write_logged_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); + void write_noop_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); + void write_inputline_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask); // configuration write_line_delegate m_writeline; // copy of registered line writer @@ -283,7 +283,7 @@ protected: write64_delegate m_write64; // copy of registered 64-bit writer // derived state - typedef void (devcb_write_base::*adapter_func)(address_space &, offs_t, UINT64, UINT64); + typedef void (devcb_write_base::*adapter_func)(address_space &, offs_t, uint64_t, uint64_t); adapter_func m_adapter; // actual callback to invoke }; @@ -305,8 +305,8 @@ class devcb_read8 : public devcb_read_base { public: devcb_read8(device_t &device) : devcb_read_base(device, 0xff) { } - UINT8 operator()(offs_t offset = 0, UINT8 mask = 0xff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; } - UINT8 operator()(address_space &space, offs_t offset = 0, UINT8 mask = 0xff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; } + uint8_t operator()(offs_t offset = 0, uint8_t mask = 0xff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; } + uint8_t operator()(address_space &space, offs_t offset = 0, uint8_t mask = 0xff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; } }; @@ -316,8 +316,8 @@ class devcb_read16 : public devcb_read_base { public: devcb_read16(device_t &device) : devcb_read_base(device, 0xffff) { } - UINT16 operator()(offs_t offset = 0, UINT16 mask = 0xffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; } - UINT16 operator()(address_space &space, offs_t offset = 0, UINT16 mask = 0xffff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; } + uint16_t operator()(offs_t offset = 0, uint16_t mask = 0xffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; } + uint16_t operator()(address_space &space, offs_t offset = 0, uint16_t mask = 0xffff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; } }; @@ -327,8 +327,8 @@ class devcb_read32 : public devcb_read_base { public: devcb_read32(device_t &device) : devcb_read_base(device, 0xffffffff) { } - UINT32 operator()(offs_t offset = 0, UINT32 mask = 0xffffffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; } - UINT32 operator()(address_space &space, offs_t offset = 0, UINT32 mask = 0xffffffff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; } + uint32_t operator()(offs_t offset = 0, uint32_t mask = 0xffffffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; } + uint32_t operator()(address_space &space, offs_t offset = 0, uint32_t mask = 0xffffffff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; } }; @@ -338,8 +338,8 @@ class devcb_read64 : public devcb_read_base { public: devcb_read64(device_t &device) : devcb_read_base(device, U64(0xffffffffffffffff)) { } - UINT64 operator()(offs_t offset = 0, UINT64 mask = U64(0xffffffffffffffff)) { return (this->*m_adapter)(*m_space, offset, mask) & mask; } - UINT64 operator()(address_space &space, offs_t offset = 0, UINT64 mask = U64(0xffffffffffffffff)) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; } + uint64_t operator()(offs_t offset = 0, uint64_t mask = U64(0xffffffffffffffff)) { return (this->*m_adapter)(*m_space, offset, mask) & mask; } + uint64_t operator()(address_space &space, offs_t offset = 0, uint64_t mask = U64(0xffffffffffffffff)) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; } }; @@ -360,9 +360,9 @@ class devcb_write8 : public devcb_write_base { public: devcb_write8(device_t &device) : devcb_write_base(device, 0xff) { } - void operator()(UINT8 data, UINT8 mask = 0xff) { (this->*m_adapter)(*m_space, 0, data, mask); } - void operator()(offs_t offset, UINT8 data, UINT8 mask = 0xff) { (this->*m_adapter)(*m_space, offset, data, mask); } - void operator()(address_space &space, offs_t offset, UINT8 data, UINT8 mask = 0xff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); } + void operator()(uint8_t data, uint8_t mask = 0xff) { (this->*m_adapter)(*m_space, 0, data, mask); } + void operator()(offs_t offset, uint8_t data, uint8_t mask = 0xff) { (this->*m_adapter)(*m_space, offset, data, mask); } + void operator()(address_space &space, offs_t offset, uint8_t data, uint8_t mask = 0xff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); } }; @@ -372,9 +372,9 @@ class devcb_write16 : public devcb_write_base { public: devcb_write16(device_t &device) : devcb_write_base(device, 0xffff) { } - void operator()(UINT16 data, UINT16 mask = 0xffff) { (this->*m_adapter)(*m_space, 0, data, mask); } - void operator()(offs_t offset, UINT16 data, UINT16 mask = 0xffff) { (this->*m_adapter)(*m_space, offset, data, mask); } - void operator()(address_space &space, offs_t offset, UINT16 data, UINT16 mask = 0xffff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); } + void operator()(uint16_t data, uint16_t mask = 0xffff) { (this->*m_adapter)(*m_space, 0, data, mask); } + void operator()(offs_t offset, uint16_t data, uint16_t mask = 0xffff) { (this->*m_adapter)(*m_space, offset, data, mask); } + void operator()(address_space &space, offs_t offset, uint16_t data, uint16_t mask = 0xffff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); } }; @@ -384,9 +384,9 @@ class devcb_write32 : public devcb_write_base { public: devcb_write32(device_t &device) : devcb_write_base(device, 0xffffffff) { } - void operator()(UINT32 data, UINT32 mask = 0xffffffff) { (this->*m_adapter)(*m_space, 0, data, mask); } - void operator()(offs_t offset, UINT32 data, UINT32 mask = 0xffffffff) { (this->*m_adapter)(*m_space, offset, data, mask); } - void operator()(address_space &space, offs_t offset, UINT32 data, UINT32 mask = 0xffffffff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); } + void operator()(uint32_t data, uint32_t mask = 0xffffffff) { (this->*m_adapter)(*m_space, 0, data, mask); } + void operator()(offs_t offset, uint32_t data, uint32_t mask = 0xffffffff) { (this->*m_adapter)(*m_space, offset, data, mask); } + void operator()(address_space &space, offs_t offset, uint32_t data, uint32_t mask = 0xffffffff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); } }; @@ -396,9 +396,9 @@ class devcb_write64 : public devcb_write_base { public: devcb_write64(device_t &device) : devcb_write_base(device, U64(0xffffffffffffffff)) { } - void operator()(UINT64 data, UINT64 mask = U64(0xffffffffffffffff)) { (this->*m_adapter)(*m_space, 0, data, mask); } - void operator()(offs_t offset, UINT64 data, UINT64 mask = U64(0xffffffffffffffff)) { (this->*m_adapter)(*m_space, offset, data, mask); } - void operator()(address_space &space, offs_t offset, UINT64 data, UINT64 mask = U64(0xffffffffffffffff)) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); } + void operator()(uint64_t data, uint64_t mask = U64(0xffffffffffffffff)) { (this->*m_adapter)(*m_space, 0, data, mask); } + void operator()(offs_t offset, uint64_t data, uint64_t mask = U64(0xffffffffffffffff)) { (this->*m_adapter)(*m_space, offset, data, mask); } + void operator()(address_space &space, offs_t offset, uint64_t data, uint64_t mask = U64(0xffffffffffffffff)) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); } }; diff --git a/src/emu/devcpu.cpp b/src/emu/devcpu.cpp index 43460235b19..42e48ce588d 100644 --- a/src/emu/devcpu.cpp +++ b/src/emu/devcpu.cpp @@ -21,7 +21,7 @@ // cpu_device - constructor //------------------------------------------------- -cpu_device::cpu_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) +cpu_device::cpu_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_execute_interface(mconfig, *this), device_memory_interface(mconfig, *this), diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h index d2f4a1f1394..bfd299ed5ff 100644 --- a/src/emu/devcpu.h +++ b/src/emu/devcpu.h @@ -54,7 +54,7 @@ //************************************************************************** #define CPU_DISASSEMBLE_NAME(name) cpu_disassemble_##name -#define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) +#define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(cpu_device *device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options) #define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram, options) @@ -79,7 +79,7 @@ public: protected: // construction/destruction - cpu_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); + cpu_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 ~cpu_device(); private: @@ -88,7 +88,7 @@ private: }; -typedef offs_t (*cpu_disassemble_func)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); +typedef offs_t (*cpu_disassemble_func)(cpu_device *device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options); #endif /* __CPUINTRF_H__ */ diff --git a/src/emu/devfind.cpp b/src/emu/devfind.cpp index 82165ab42e7..90daaa0a499 100644 --- a/src/emu/devfind.cpp +++ b/src/emu/devfind.cpp @@ -22,23 +22,23 @@ template class object_finder_base; template class object_finder_base; template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; - -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; -template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; + +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; +template class object_finder_base; template class memory_region_finder; template class memory_region_finder; @@ -49,41 +49,41 @@ template class memory_bank_finder; template class ioport_finder; template class ioport_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; - -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; -template class region_ptr_finder; - -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; - -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; -template class shared_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; + +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; +template class region_ptr_finder; + +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; + +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; +template class shared_ptr_finder; @@ -119,7 +119,7 @@ finder_base::~finder_base() // find_memregion - find memory region //------------------------------------------------- -void *finder_base::find_memregion(UINT8 width, size_t &length, bool required) const +void *finder_base::find_memregion(uint8_t width, size_t &length, bool required) const { // look up the region and return nullptr if not found memory_region *const region = m_base.memregion(m_tag); @@ -194,7 +194,7 @@ bool finder_base::validate_memregion(size_t bytes, bool required) const // find_memshare - find memory share //------------------------------------------------- -void *finder_base::find_memshare(UINT8 width, size_t &bytes, bool required) const +void *finder_base::find_memshare(uint8_t width, size_t &bytes, bool required) const { // look up the share and return nullptr if not found memory_share *share = m_base.memshare(m_tag); diff --git a/src/emu/devfind.h b/src/emu/devfind.h index 7aa8bdcd5d1..b68bea2d46a 100644 --- a/src/emu/devfind.h +++ b/src/emu/devfind.h @@ -205,7 +205,7 @@ protected: /// found. /// \return Base pointer of the memeroy region if a matching region /// is found, or nullptr otherwise. - void *find_memregion(UINT8 width, size_t &length, bool required) const; + void *find_memregion(uint8_t width, size_t &length, bool required) const; /// \brief Check that memory region exists /// @@ -240,7 +240,7 @@ protected: /// found. /// \return Pointer to base of memory share if a matching memory /// share is found, or nullptr otherwise. - void *find_memshare(UINT8 width, size_t &bytes, bool required) const; + void *find_memshare(uint8_t width, size_t &bytes, bool required) const; /// \brief Log if object was not found /// @@ -646,12 +646,12 @@ public: /// \brief Get length in units of elements /// \return Length in units of elements or zero if no matching /// memory region has been found. - UINT32 length() const { return m_length; } + uint32_t length() const { return m_length; } /// \brief Get length in units of bytes /// \return Length in units of bytes or zero if no matching memory /// region has been found. - UINT32 bytes() const { return m_length * sizeof(PointerType); } + uint32_t bytes() const { return m_length * sizeof(PointerType); } /// \brief Get index mask /// @@ -659,7 +659,7 @@ public: /// used as a mask for index values if the length is a power of two. /// Result is undefined if no matching memory region has been found. /// \return Length in units of elements minus one. - UINT32 mask() const { return m_length - 1; } + uint32_t mask() const { return m_length - 1; } private: /// \brief Find memory region base pointer @@ -726,7 +726,7 @@ class shared_ptr_finder : public object_finder_base { public: // construction/destruction - shared_ptr_finder(device_t &base, char const *tag, UINT8 width = sizeof(PointerType) * 8) + shared_ptr_finder(device_t &base, char const *tag, uint8_t width = sizeof(PointerType) * 8) : object_finder_base(base, tag) , m_width(width) , m_bytes(0) @@ -738,14 +738,14 @@ public: PointerType &operator[](int index) const { return this->m_target[index]; } // getter for explicit fetching - UINT32 bytes() const { return m_bytes; } - UINT32 mask() const { return m_bytes - 1; } // FIXME: wrong when sizeof(PointerType) != 1 + uint32_t bytes() const { return m_bytes; } + uint32_t mask() const { return m_bytes - 1; } // FIXME: wrong when sizeof(PointerType) != 1 // setter for setting the object void set_target(PointerType *target, size_t bytes) { this->m_target = target; m_bytes = bytes; } // dynamic allocation of a shared pointer - void allocate(UINT32 entries) + void allocate(uint32_t entries) { assert(m_allocated.empty()); m_allocated.resize(entries); @@ -764,7 +764,7 @@ private: } // internal state - UINT8 const m_width; + uint8_t const m_width; size_t m_bytes; std::vector m_allocated; }; @@ -788,23 +788,23 @@ extern template class object_finder_base; extern template class object_finder_base; extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; - -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; -extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; + +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; +extern template class object_finder_base; extern template class memory_region_finder; extern template class memory_region_finder; @@ -815,41 +815,41 @@ extern template class memory_bank_finder; extern template class ioport_finder; extern template class ioport_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; - -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; -extern template class region_ptr_finder; - -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; - -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; -extern template class shared_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; + +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; +extern template class region_ptr_finder; + +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; + +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; +extern template class shared_ptr_finder; #endif // MAME_EMU_DEVFIND_H /** \} */ diff --git a/src/emu/device.cpp b/src/emu/device.cpp index 7ad9d740a2c..2e612694bd5 100644 --- a/src/emu/device.cpp +++ b/src/emu/device.cpp @@ -23,7 +23,7 @@ // from the provided config //------------------------------------------------- -device_t::device_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) +device_t::device_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) : m_type(type), m_name(name), m_shortname(shortname), @@ -157,7 +157,7 @@ std::string device_t::parameter(const char *tag) const // a device //------------------------------------------------- -void device_t::static_set_clock(device_t &device, UINT32 clock) +void device_t::static_set_clock(device_t &device, uint32_t clock) { // derive the clock from our owner if requested if ((clock & 0xff000000) == 0xff000000) @@ -237,7 +237,7 @@ void device_t::reset() // unscaled clock //------------------------------------------------- -void device_t::set_unscaled_clock(UINT32 clock) +void device_t::set_unscaled_clock(uint32_t clock) { m_unscaled_clock = clock; m_clock = m_unscaled_clock * m_clock_scale; @@ -265,15 +265,15 @@ void device_t::set_clock_scale(double clockscale) // clock ticks to an attotime //------------------------------------------------- -attotime device_t::clocks_to_attotime(UINT64 numclocks) const +attotime device_t::clocks_to_attotime(uint64_t numclocks) const { if (numclocks < m_clock) return attotime(0, numclocks * m_attoseconds_per_clock); else { - UINT32 remainder; - UINT32 quotient = divu_64x32_rem(numclocks, m_clock, &remainder); - return attotime(quotient, (UINT64)remainder * (UINT64)m_attoseconds_per_clock); + uint32_t remainder; + uint32_t quotient = divu_64x32_rem(numclocks, m_clock, &remainder); + return attotime(quotient, (uint64_t)remainder * (uint64_t)m_attoseconds_per_clock); } } @@ -283,9 +283,9 @@ attotime device_t::clocks_to_attotime(UINT64 numclocks) const // attotime to CPU clock ticks //------------------------------------------------- -UINT64 device_t::attotime_to_clocks(const attotime &duration) const +uint64_t device_t::attotime_to_clocks(const attotime &duration) const { - return mulu_32x32(duration.seconds(), m_clock) + (UINT64)duration.attoseconds() / (UINT64)m_attoseconds_per_clock; + return mulu_32x32(duration.seconds(), m_clock) + (uint64_t)duration.attoseconds() / (uint64_t)m_attoseconds_per_clock; } diff --git a/src/emu/device.h b/src/emu/device.h index eedfebc0d91..efc389f1823 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -81,19 +81,19 @@ class device_missing_dependencies : public emu_exception { }; // a device_type is simply a pointer to its alloc function -typedef device_t *(*device_type)(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +typedef device_t *(*device_type)(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // this template function creates a stub which constructs a device template -device_t *device_creator(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +device_t *device_creator(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) { return global_alloc_clear<_DeviceClass>(mconfig, tag, owner, clock); } // timer IDs for devices -typedef UINT32 device_timer_id; +typedef uint32_t device_timer_id; // ======================> device_t @@ -194,7 +194,7 @@ class device_t : public delegate_late_bind protected: // construction/destruction - device_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); + device_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); public: virtual ~device_t(); @@ -209,15 +209,15 @@ public: const char *source() const { return m_source.c_str(); } device_t *owner() const { return m_owner; } device_t *next() const { return m_next; } - UINT32 configured_clock() const { return m_configured_clock; } + uint32_t configured_clock() const { return m_configured_clock; } const machine_config &mconfig() const { return m_machine_config; } const input_device_default *input_ports_defaults() const { return m_input_defaults; } const std::vector &rom_region_vector() const; const rom_entry *rom_region() const { return rom_region_vector().data(); } machine_config_constructor machine_config_additions() const { return device_mconfig_additions(); } ioport_constructor input_ports() const { return device_input_ports(); } - UINT8 default_bios() const { return m_default_bios; } - UINT8 system_bios() const { return m_system_bios; } + uint8_t default_bios() const { return m_default_bios; } + uint8_t system_bios() const { return m_system_bios; } std::string default_bios_tag() const { return m_default_bios_tag; } // interface helpers @@ -255,7 +255,7 @@ public: std::string parameter(const char *tag) const; // configuration helpers - static void static_set_clock(device_t &device, UINT32 clock); + static void static_set_clock(device_t &device, uint32_t clock); static void static_set_input_default(device_t &device, const input_device_default *config) { device.m_input_defaults = config; } static void static_set_default_bios_tag(device_t &device, const char *tag) { std::string default_bios_tag(tag); device.m_default_bios_tag = default_bios_tag; } @@ -267,13 +267,13 @@ public: void reset(); // clock/timing accessors - UINT32 clock() const { return m_clock; } - UINT32 unscaled_clock() const { return m_unscaled_clock; } - void set_unscaled_clock(UINT32 clock); + uint32_t clock() const { return m_clock; } + uint32_t unscaled_clock() const { return m_unscaled_clock; } + void set_unscaled_clock(uint32_t clock); double clock_scale() const { return m_clock_scale; } void set_clock_scale(double clockscale); - attotime clocks_to_attotime(UINT64 clocks) const; - UINT64 attotime_to_clocks(const attotime &duration) const; + attotime clocks_to_attotime(uint64_t clocks) const; + uint64_t attotime_to_clocks(const attotime &duration) const; // timer interfaces emu_timer *timer_alloc(device_timer_id id = 0, void *ptr = nullptr); @@ -285,15 +285,15 @@ public: template void ATTR_COLD save_item(_ItemType &value, const char *valname, int index = 0) { assert(m_save != nullptr); m_save->save_item(this, name(), tag(), index, value, valname); } template - void ATTR_COLD save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { assert(m_save != nullptr); m_save->save_pointer(this, name(), tag(), index, value, valname, count); } + void ATTR_COLD save_pointer(_ItemType *value, const char *valname, uint32_t count, int index = 0) { assert(m_save != nullptr); m_save->save_pointer(this, name(), tag(), index, value, valname, count); } // debugging device_debug *debug() const { return m_debug.get(); } offs_t safe_pc() const; offs_t safe_pcbase() const; - void set_default_bios(UINT8 bios) { m_default_bios = bios; } - void set_system_bios(UINT8 bios) { m_system_bios = bios; } + void set_default_bios(uint8_t bios) { m_default_bios = bios; } + void set_system_bios(uint8_t bios) { m_system_bios = bios; } bool findit(bool isvalidation = false) const; // misc @@ -345,9 +345,9 @@ protected: interface_list m_interfaces; // container for list of interfaces // device clocks - UINT32 m_configured_clock; // originally configured device clock - UINT32 m_unscaled_clock; // current unscaled device clock - UINT32 m_clock; // current device clock, after scaling + uint32_t m_configured_clock; // originally configured device clock + uint32_t m_unscaled_clock; // current unscaled device clock + uint32_t m_clock; // current device clock, after scaling double m_clock_scale; // clock scale factor attoseconds_t m_attoseconds_per_clock;// period in attoseconds @@ -355,8 +355,8 @@ protected: const machine_config & m_machine_config; // reference to the machine's configuration const input_device_default *m_input_defaults; // devices input ports default overrides - UINT8 m_system_bios; // the system BIOS we wish to load - UINT8 m_default_bios; // the default system BIOS + uint8_t m_system_bios; // the system BIOS we wish to load + uint8_t m_default_bios; // the default system BIOS std::string m_default_bios_tag; // tag of the default system BIOS private: diff --git a/src/emu/didisasm.cpp b/src/emu/didisasm.cpp index 9c10087d6c2..bce58d975f5 100644 --- a/src/emu/didisasm.cpp +++ b/src/emu/didisasm.cpp @@ -64,7 +64,7 @@ void device_disasm_interface::static_set_dasm_override(device_t &device, dasm_ov // disassemble - interface for disassembly //------------------------------------------------- -offs_t device_disasm_interface::disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t device_disasm_interface::disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { offs_t result = 0; diff --git a/src/emu/didisasm.h b/src/emu/didisasm.h index d92c90acc3b..eb56e552132 100644 --- a/src/emu/didisasm.h +++ b/src/emu/didisasm.h @@ -23,12 +23,12 @@ //************************************************************************** // Disassembler constants -const UINT32 DASMFLAG_SUPPORTED = 0x80000000; // are disassembly flags supported? -const UINT32 DASMFLAG_STEP_OUT = 0x40000000; // this instruction should be the end of a step out sequence -const UINT32 DASMFLAG_STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards -const UINT32 DASMFLAG_OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over -const UINT32 DASMFLAG_OVERINSTSHIFT = 27; // bits to shift after masking to get the value -const UINT32 DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length +const uint32_t DASMFLAG_SUPPORTED = 0x80000000; // are disassembly flags supported? +const uint32_t DASMFLAG_STEP_OUT = 0x40000000; // this instruction should be the end of a step out sequence +const uint32_t DASMFLAG_STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards +const uint32_t DASMFLAG_OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over +const uint32_t DASMFLAG_OVERINSTSHIFT = 27; // bits to shift after masking to get the value +const uint32_t DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length @@ -53,7 +53,7 @@ const UINT32 DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain t // TYPE DEFINITIONS //************************************************************************** -typedef device_delegate dasm_override_delegate; +typedef device_delegate dasm_override_delegate; // ======================> device_disasm_interface @@ -66,20 +66,20 @@ public: virtual ~device_disasm_interface(); // configuration access - UINT32 min_opcode_bytes() const { return disasm_min_opcode_bytes(); } - UINT32 max_opcode_bytes() const { return disasm_max_opcode_bytes(); } + uint32_t min_opcode_bytes() const { return disasm_min_opcode_bytes(); } + uint32_t max_opcode_bytes() const { return disasm_max_opcode_bytes(); } // static inline configuration helpers static void static_set_dasm_override(device_t &device, dasm_override_delegate dasm_override); // interface for disassembly - offs_t disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options = 0); + offs_t disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options = 0); protected: // required operation overrides - virtual UINT32 disasm_min_opcode_bytes() const = 0; - virtual UINT32 disasm_max_opcode_bytes() const = 0; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) = 0; + virtual uint32_t disasm_min_opcode_bytes() const = 0; + virtual uint32_t disasm_max_opcode_bytes() const = 0; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) = 0; // interface-level overrides virtual void interface_pre_start() override; diff --git a/src/emu/diexec.cpp b/src/emu/diexec.cpp index b92a5a8b31c..ca253d766ce 100644 --- a/src/emu/diexec.cpp +++ b/src/emu/diexec.cpp @@ -154,7 +154,7 @@ bool device_execute_interface::executing() const // remaining in this timeslice //------------------------------------------------- -INT32 device_execute_interface::cycles_remaining() const +int32_t device_execute_interface::cycles_remaining() const { return executing() ? *m_icountptr : 0; } @@ -235,7 +235,7 @@ void device_execute_interface::suspend_resume_changed() // suspend - set a suspend reason for this device //------------------------------------------------- -void device_execute_interface::suspend(UINT32 reason, bool eatcycles) +void device_execute_interface::suspend(uint32_t reason, bool eatcycles) { if (TEMPLOG) printf("suspend %s (%X)\n", device().tag(), reason); // set the suspend reason and eat cycles flag @@ -250,7 +250,7 @@ if (TEMPLOG) printf("suspend %s (%X)\n", device().tag(), reason); // device //------------------------------------------------- -void device_execute_interface::resume(UINT32 reason) +void device_execute_interface::resume(uint32_t reason) { if (TEMPLOG) printf("resume %s (%X)\n", device().tag(), reason); // clear the suspend reason and eat cycles flag @@ -333,7 +333,7 @@ attotime device_execute_interface::local_time() const // cycles executed on this device //------------------------------------------------- -UINT64 device_execute_interface::total_cycles() const +uint64_t device_execute_interface::total_cycles() const { if (executing()) { @@ -350,7 +350,7 @@ UINT64 device_execute_interface::total_cycles() const // of clocks to cycles, rounding down if necessary //------------------------------------------------- -UINT64 device_execute_interface::execute_clocks_to_cycles(UINT64 clocks) const +uint64_t device_execute_interface::execute_clocks_to_cycles(uint64_t clocks) const { return clocks; } @@ -361,7 +361,7 @@ UINT64 device_execute_interface::execute_clocks_to_cycles(UINT64 clocks) const // of cycles to clocks, rounding down if necessary //------------------------------------------------- -UINT64 device_execute_interface::execute_cycles_to_clocks(UINT64 cycles) const +uint64_t device_execute_interface::execute_cycles_to_clocks(uint64_t cycles) const { return cycles; } @@ -373,7 +373,7 @@ UINT64 device_execute_interface::execute_cycles_to_clocks(UINT64 cycles) const // operation can take //------------------------------------------------- -UINT32 device_execute_interface::execute_min_cycles() const +uint32_t device_execute_interface::execute_min_cycles() const { return 1; } @@ -385,7 +385,7 @@ UINT32 device_execute_interface::execute_min_cycles() const // operation can take //------------------------------------------------- -UINT32 device_execute_interface::execute_max_cycles() const +uint32_t device_execute_interface::execute_max_cycles() const { return 1; } @@ -396,7 +396,7 @@ UINT32 device_execute_interface::execute_max_cycles() const // of input lines for the device //------------------------------------------------- -UINT32 device_execute_interface::execute_input_lines() const +uint32_t device_execute_interface::execute_input_lines() const { return 0; } @@ -407,7 +407,7 @@ UINT32 device_execute_interface::execute_input_lines() const // IRQ vector when an acknowledge is processed //------------------------------------------------- -UINT32 device_execute_interface::execute_default_irq_vector() const +uint32_t device_execute_interface::execute_default_irq_vector() const { return 0; } @@ -419,7 +419,7 @@ UINT32 device_execute_interface::execute_default_irq_vector() const // spinning devices for performance optimization) //------------------------------------------------- -void device_execute_interface::execute_burn(INT32 cycles) +void device_execute_interface::execute_burn(int32_t cycles) { // by default, do nothing } @@ -584,7 +584,7 @@ void device_execute_interface::interface_clock_changed() m_attoseconds_per_cycle = HZ_TO_ATTOSECONDS(m_cycles_per_second); // update the device's divisor - INT64 attos = m_attoseconds_per_cycle; + int64_t attos = m_attoseconds_per_cycle; m_divshift = 0; while (attos >= (1UL << 31)) { @@ -803,7 +803,7 @@ if (TEMPLOG) printf("empty_queue(%s,%d,%d)\n", m_execute->device().tag(), m_line // loop over all events for (int curevent = 0; curevent < m_qindex; curevent++) { - INT32 input_event = m_queue[curevent]; + int32_t input_event = m_queue[curevent]; // set the input line state and vector m_curstate = input_event & 0xff; diff --git a/src/emu/diexec.h b/src/emu/diexec.h index 25b3237b87a..3a0f5bfa53a 100644 --- a/src/emu/diexec.h +++ b/src/emu/diexec.h @@ -23,14 +23,14 @@ //************************************************************************** // suspension reasons for executing devices -const UINT32 SUSPEND_REASON_HALT = 0x0001; // HALT line set (or equivalent) -const UINT32 SUSPEND_REASON_RESET = 0x0002; // RESET line set (or equivalent) -const UINT32 SUSPEND_REASON_SPIN = 0x0004; // currently spinning -const UINT32 SUSPEND_REASON_TRIGGER = 0x0008; // waiting for a trigger -const UINT32 SUSPEND_REASON_DISABLE = 0x0010; // disabled (due to disable flag) -const UINT32 SUSPEND_REASON_TIMESLICE = 0x0020; // waiting for the next timeslice -const UINT32 SUSPEND_REASON_CLOCK = 0x0040; // currently not clocked -const UINT32 SUSPEND_ANY_REASON = ~0; // all of the above +const uint32_t SUSPEND_REASON_HALT = 0x0001; // HALT line set (or equivalent) +const uint32_t SUSPEND_REASON_RESET = 0x0002; // RESET line set (or equivalent) +const uint32_t SUSPEND_REASON_SPIN = 0x0004; // currently spinning +const uint32_t SUSPEND_REASON_TRIGGER = 0x0008; // waiting for a trigger +const uint32_t SUSPEND_REASON_DISABLE = 0x0010; // disabled (due to disable flag) +const uint32_t SUSPEND_REASON_TIMESLICE = 0x0020; // waiting for the next timeslice +const uint32_t SUSPEND_REASON_CLOCK = 0x0040; // currently not clocked +const uint32_t SUSPEND_ANY_REASON = ~0; // all of the above // I/O line states @@ -71,7 +71,7 @@ enum // MACROS //************************************************************************** -#define TIMER_CALLBACK_MEMBER(name) void name(void *ptr, INT32 param) +#define TIMER_CALLBACK_MEMBER(name) void name(void *ptr, int32_t param) // IRQ callback to be called by device implementations when an IRQ is actually taken #define IRQ_CALLBACK_MEMBER(func) int func(device_t &device, int irqline) @@ -138,14 +138,14 @@ public: // configuration access bool disabled() const { return m_disabled; } - UINT64 clocks_to_cycles(UINT64 clocks) const { return execute_clocks_to_cycles(clocks); } - UINT64 cycles_to_clocks(UINT64 cycles) const { return execute_cycles_to_clocks(cycles); } - UINT32 min_cycles() const { return execute_min_cycles(); } - UINT32 max_cycles() const { return execute_max_cycles(); } - attotime cycles_to_attotime(UINT64 cycles) const { return device().clocks_to_attotime(cycles_to_clocks(cycles)); } - UINT64 attotime_to_cycles(const attotime &duration) const { return clocks_to_cycles(device().attotime_to_clocks(duration)); } - UINT32 input_lines() const { return execute_input_lines(); } - UINT32 default_irq_vector() const { return execute_default_irq_vector(); } + uint64_t clocks_to_cycles(uint64_t clocks) const { return execute_clocks_to_cycles(clocks); } + uint64_t cycles_to_clocks(uint64_t cycles) const { return execute_cycles_to_clocks(cycles); } + uint32_t min_cycles() const { return execute_min_cycles(); } + uint32_t max_cycles() const { return execute_max_cycles(); } + attotime cycles_to_attotime(uint64_t cycles) const { return device().clocks_to_attotime(cycles_to_clocks(cycles)); } + uint64_t attotime_to_cycles(const attotime &duration) const { return clocks_to_cycles(device().attotime_to_clocks(duration)); } + uint32_t input_lines() const { return execute_input_lines(); } + uint32_t default_irq_vector() const { return execute_default_irq_vector(); } // static inline configuration helpers static void static_set_disable(device_t &device); @@ -156,7 +156,7 @@ public: // execution management device_scheduler &scheduler() const { assert(m_scheduler != nullptr); return *m_scheduler; } bool executing() const; - INT32 cycles_remaining() const; + int32_t cycles_remaining() const; void eat_cycles(int cycles); void adjust_icount(int delta); void abort_timeslice(); @@ -168,9 +168,9 @@ public: int input_state(int linenum) const { return m_input[linenum].m_curstate; } // suspend/resume - void suspend(UINT32 reason, bool eatcycles); - void resume(UINT32 reason); - bool suspended(UINT32 reason = SUSPEND_ANY_REASON) const { return (m_nextsuspend & reason) != 0; } + void suspend(uint32_t reason, bool eatcycles); + void resume(uint32_t reason); + bool suspended(uint32_t reason = SUSPEND_ANY_REASON) const { return (m_nextsuspend & reason) != 0; } void yield() { suspend(SUSPEND_REASON_TIMESLICE, false); } void spin() { suspend(SUSPEND_REASON_TIMESLICE, true); } void spin_until_trigger(int trigid) { suspend_until_trigger(trigid, true); } @@ -184,7 +184,7 @@ public: // time and cycle accounting attotime local_time() const; - UINT64 total_cycles() const; + uint64_t total_cycles() const; // required operation overrides void run() { execute_run(); } @@ -195,18 +195,18 @@ public: protected: // clock and cycle information getters - virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const; - virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const; - virtual UINT32 execute_min_cycles() const; - virtual UINT32 execute_max_cycles() const; + virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const; + virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const; + virtual uint32_t execute_min_cycles() const; + virtual uint32_t execute_max_cycles() const; // input line information getters - virtual UINT32 execute_input_lines() const; - virtual UINT32 execute_default_irq_vector() const; + virtual uint32_t execute_input_lines() const; + virtual uint32_t execute_default_irq_vector() const; // optional operation overrides virtual void execute_run() = 0; - virtual void execute_burn(INT32 cycles); + virtual void execute_burn(int32_t cycles); virtual void execute_set_input(int linenum, int state); // interface-level overrides @@ -239,10 +239,10 @@ protected: device_execute_interface *m_execute;// pointer to the execute interface int m_linenum; // which input line we are - INT32 m_stored_vector; // most recently written vector - INT32 m_curvector; // most recently processed vector - UINT8 m_curstate; // most recently processed state - INT32 m_queue[32]; // queue of pending events + int32_t m_stored_vector; // most recently written vector + int32_t m_curvector; // most recently processed vector + uint8_t m_curstate; // most recently processed state + int32_t m_queue[32]; // queue of pending events int m_qindex; // index within the queue private: @@ -274,19 +274,19 @@ protected: int m_cycles_stolen; // number of cycles we artificially stole // suspend states - UINT32 m_suspend; // suspend reason mask (0 = not suspended) - UINT32 m_nextsuspend; // pending suspend reason mask - UINT8 m_eatcycles; // true if we eat cycles while suspended - UINT8 m_nexteatcycles; // pending value - INT32 m_trigger; // pending trigger to release a trigger suspension - INT32 m_inttrigger; // interrupt trigger index + uint32_t m_suspend; // suspend reason mask (0 = not suspended) + uint32_t m_nextsuspend; // pending suspend reason mask + uint8_t m_eatcycles; // true if we eat cycles while suspended + uint8_t m_nexteatcycles; // pending value + int32_t m_trigger; // pending trigger to release a trigger suspension + int32_t m_inttrigger; // interrupt trigger index // clock and timing information - UINT64 m_totalcycles; // total device cycles executed + uint64_t m_totalcycles; // total device cycles executed attotime m_localtime; // local time, relative to the timer system's global time - INT32 m_divisor; // 32-bit attoseconds_per_cycle divisor - UINT8 m_divshift; // right shift amount to fit the divisor into 32 bits - UINT32 m_cycles_per_second; // cycles per second, adjusted for multipliers + int32_t m_divisor; // 32-bit attoseconds_per_cycle divisor + uint8_t m_divshift; // right shift amount to fit the divisor into 32 bits + uint32_t m_cycles_per_second; // cycles per second, adjusted for multipliers attoseconds_t m_attoseconds_per_cycle; // attoseconds per adjusted clock cycle private: diff --git a/src/emu/digfx.cpp b/src/emu/digfx.cpp index 3ab059ee5e0..56fe96865b9 100644 --- a/src/emu/digfx.cpp +++ b/src/emu/digfx.cpp @@ -124,23 +124,23 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo) // local variables to hold mutable copies of gfx layout data gfx_layout glcopy; - std::vector extxoffs(0); - std::vector extyoffs(0); + std::vector extxoffs(0); + std::vector extyoffs(0); // loop over all elements - for (UINT8 curgfx = 0; curgfx < MAX_GFX_ELEMENTS && gfxdecodeinfo[curgfx].gfxlayout != nullptr; curgfx++) + for (uint8_t curgfx = 0; curgfx < MAX_GFX_ELEMENTS && gfxdecodeinfo[curgfx].gfxlayout != nullptr; curgfx++) { const gfx_decode_entry &gfx = gfxdecodeinfo[curgfx]; // extract the scale factors and xormask - UINT32 xscale = GFXENTRY_GETXSCALE(gfx.flags); - UINT32 yscale = GFXENTRY_GETYSCALE(gfx.flags); - UINT32 xormask = GFXENTRY_ISREVERSE(gfx.flags) ? 7 : 0; + uint32_t xscale = GFXENTRY_GETXSCALE(gfx.flags); + uint32_t yscale = GFXENTRY_GETYSCALE(gfx.flags); + uint32_t xormask = GFXENTRY_ISREVERSE(gfx.flags) ? 7 : 0; // resolve the region - UINT32 region_length; - const UINT8 *region_base; - UINT8 region_width; + uint32_t region_length; + const uint8_t *region_base; + uint8_t region_width; endianness_t region_endianness; if (gfx.memory_region != nullptr) @@ -151,7 +151,7 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo) memory_share *share = basedevice.memshare(gfx.memory_region); assert(share != nullptr); region_length = 8 * share->bytes(); - region_base = reinterpret_cast(share->ptr()); + region_base = reinterpret_cast(share->ptr()); region_width = share->bytewidth(); region_endianness = share->endianness(); } @@ -205,8 +205,8 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo) // copy the X and Y offsets into our temporary arrays extxoffs.resize(glcopy.width * xscale); extyoffs.resize(glcopy.height * yscale); - memcpy(&extxoffs[0], (glcopy.extxoffs != nullptr) ? glcopy.extxoffs : glcopy.xoffset, glcopy.width * sizeof(UINT32)); - memcpy(&extyoffs[0], (glcopy.extyoffs != nullptr) ? glcopy.extyoffs : glcopy.yoffset, glcopy.height * sizeof(UINT32)); + memcpy(&extxoffs[0], (glcopy.extxoffs != nullptr) ? glcopy.extxoffs : glcopy.xoffset, glcopy.width * sizeof(uint32_t)); + memcpy(&extyoffs[0], (glcopy.extyoffs != nullptr) ? glcopy.extyoffs : glcopy.yoffset, glcopy.height * sizeof(uint32_t)); // always use the extended offsets here glcopy.extxoffs = &extxoffs[0]; @@ -229,7 +229,7 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo) // loop over all the planes, converting fractions for (int j = 0; j < glcopy.planes; j++) { - UINT32 value1 = glcopy.planeoffset[j]; + uint32_t value1 = glcopy.planeoffset[j]; if (IS_FRAC(value1)) { assert(region_length != 0); @@ -240,7 +240,7 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo) // loop over all the X/Y offsets, converting fractions for (int j = 0; j < glcopy.width; j++) { - UINT32 value2 = extxoffs[j]; + uint32_t value2 = extxoffs[j]; if (IS_FRAC(value2)) { assert(region_length != 0); @@ -250,7 +250,7 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo) for (int j = 0; j < glcopy.height; j++) { - UINT32 value3 = extyoffs[j]; + uint32_t value3 = extyoffs[j]; if (IS_FRAC(value3)) { assert(region_length != 0); @@ -328,7 +328,7 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con else gfxregion = device().owner()->subtag(region); - UINT32 region_length = valid.region_length(gfxregion.c_str()); + uint32_t region_length = valid.region_length(gfxregion.c_str()); if (region_length == 0) osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion.c_str()); diff --git a/src/emu/digfx.h b/src/emu/digfx.h index a31625399e6..9ce8c354db8 100644 --- a/src/emu/digfx.h +++ b/src/emu/digfx.h @@ -23,9 +23,9 @@ // CONSTANTS //************************************************************************** -const UINT8 MAX_GFX_ELEMENTS = 32; -const UINT16 MAX_GFX_PLANES = 8; -const UINT16 MAX_GFX_SIZE = 32; +const uint8_t MAX_GFX_ELEMENTS = 32; +const uint16_t MAX_GFX_PLANES = 8; +const uint16_t MAX_GFX_SIZE = 32; @@ -160,29 +160,29 @@ class palette_device; struct gfx_layout { - UINT32 xoffs(int x) const { return (extxoffs != nullptr) ? extxoffs[x] : xoffset[x]; } - UINT32 yoffs(int y) const { return (extyoffs != nullptr) ? extyoffs[y] : yoffset[y]; } - - UINT16 width; // pixel width of each element - UINT16 height; // pixel height of each element - UINT32 total; // total number of elements, or RGN_FRAC() - UINT16 planes; // number of bitplanes - UINT32 planeoffset[MAX_GFX_PLANES]; // bit offset of each bitplane - UINT32 xoffset[MAX_GFX_SIZE]; // bit offset of each horizontal pixel - UINT32 yoffset[MAX_GFX_SIZE]; // bit offset of each vertical pixel - UINT32 charincrement; // distance between two consecutive elements (in bits) - const UINT32 * extxoffs; // extended X offset array for really big layouts - const UINT32 * extyoffs; // extended Y offset array for really big layouts + uint32_t xoffs(int x) const { return (extxoffs != nullptr) ? extxoffs[x] : xoffset[x]; } + uint32_t yoffs(int y) const { return (extyoffs != nullptr) ? extyoffs[y] : yoffset[y]; } + + uint16_t width; // pixel width of each element + uint16_t height; // pixel height of each element + uint32_t total; // total number of elements, or RGN_FRAC() + uint16_t planes; // number of bitplanes + uint32_t planeoffset[MAX_GFX_PLANES]; // bit offset of each bitplane + uint32_t xoffset[MAX_GFX_SIZE]; // bit offset of each horizontal pixel + uint32_t yoffset[MAX_GFX_SIZE]; // bit offset of each vertical pixel + uint32_t charincrement; // distance between two consecutive elements (in bits) + const uint32_t * extxoffs; // extended X offset array for really big layouts + const uint32_t * extyoffs; // extended Y offset array for really big layouts }; struct gfx_decode_entry { const char * memory_region; // memory region where the data resides - UINT32 start; // offset of beginning of data to decode + uint32_t start; // offset of beginning of data to decode const gfx_layout *gfxlayout; // pointer to gfx_layout describing the layout; nullptr marks the end of the array - UINT16 color_codes_start; // offset in the color lookup table where color codes start - UINT16 total_color_codes; // total number of color codes - UINT32 flags; // flags and optional scaling factors + uint16_t color_codes_start; // offset in the color lookup table where color codes start + uint16_t total_color_codes; // total number of color codes + uint32_t flags; // flags and optional scaling factors }; // ======================> device_gfx_interface @@ -201,13 +201,13 @@ public: // getters palette_device &palette() const { assert(m_palette != nullptr); return *m_palette; } - gfx_element *gfx(UINT8 index) const { assert(index < MAX_GFX_ELEMENTS); return m_gfx[index].get(); } + gfx_element *gfx(uint8_t index) const { assert(index < MAX_GFX_ELEMENTS); return m_gfx[index].get(); } // decoding void decode_gfx(const gfx_decode_entry *gfxdecodeinfo); void decode_gfx() { decode_gfx(m_gfxdecodeinfo); } - void set_gfx(UINT8 index, std::unique_ptr &&element) { assert(index < MAX_GFX_ELEMENTS); m_gfx[index] = std::move(element); } + void set_gfx(uint8_t index, std::unique_ptr &&element) { assert(index < MAX_GFX_ELEMENTS); m_gfx[index] = std::move(element); } protected: // interface-level overrides diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index c555204ad38..cf945be1517 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -177,7 +177,7 @@ void device_image_interface::device_compute_hash(util::hash_collection &hashes, if (partialhash) partialhash(hashes, (const unsigned char*)data, length, types); else - hashes.compute(reinterpret_cast(data), length, types); + hashes.compute(reinterpret_cast(data), length, types); } //------------------------------------------------- @@ -431,7 +431,7 @@ const std::string &device_image_interface::working_directory() // get_software_region //------------------------------------------------- -UINT8 *device_image_interface::get_software_region(const char *tag) +uint8_t *device_image_interface::get_software_region(const char *tag) { char full_tag[256]; @@ -448,7 +448,7 @@ UINT8 *device_image_interface::get_software_region(const char *tag) // image_get_software_region_length //------------------------------------------------- -UINT32 device_image_interface::get_software_region_length(const char *tag) +uint32_t device_image_interface::get_software_region_length(const char *tag) { char full_tag[256]; @@ -473,7 +473,7 @@ const char *device_image_interface::get_feature(const char *feature_name) // load_software_region - //------------------------------------------------- -bool device_image_interface::load_software_region(const char *tag, optional_shared_ptr &ptr) +bool device_image_interface::load_software_region(const char *tag, optional_shared_ptr &ptr) { size_t size = get_software_region_length(tag); @@ -498,11 +498,11 @@ bool device_image_interface::load_software_region(const char *tag, optional_shar void device_image_interface::run_hash(void (*partialhash)(util::hash_collection &, const unsigned char *, unsigned long, const char *), util::hash_collection &hashes, const char *types) { - UINT32 size; - std::vector buf; + uint32_t size; + std::vector buf; hashes.reset(); - size = (UINT32) length(); + size = (uint32_t) length(); buf.resize(size); memset(&buf[0], 0, size); @@ -527,7 +527,7 @@ void device_image_interface::image_checkhash() device_image_partialhash_func partialhash; // only calculate CRC if it hasn't been calculated, and the open_mode is read only - UINT32 crcval; + uint32_t crcval; if (!m_hash.crc(crcval) && is_readonly() && !m_created) { // do not cause a linear read of 600 megs please @@ -547,9 +547,9 @@ void device_image_interface::image_checkhash() return; } -UINT32 device_image_interface::crc() +uint32_t device_image_interface::crc() { - UINT32 crc = 0; + uint32_t crc = 0; image_checkhash(); m_hash.crc(crc); @@ -741,7 +741,7 @@ image_error_t device_image_interface::image_error_from_file_error(osd_file::erro // specific path //------------------------------------------------- -image_error_t device_image_interface::load_image_by_path(UINT32 open_flags, const std::string &path) +image_error_t device_image_interface::load_image_by_path(uint32_t open_flags, const std::string &path) { std::string revised_path; @@ -786,9 +786,9 @@ int device_image_interface::reopen_for_write(const std::string &path) // flags to use, and in what order //------------------------------------------------- -std::vector device_image_interface::determine_open_plan(bool is_create) +std::vector device_image_interface::determine_open_plan(bool is_create) { - std::vector open_plan; + std::vector open_plan; // emit flags into a vector if (!is_create && is_readable() && is_writeable()) @@ -822,13 +822,13 @@ static void dump_wrong_and_correct_checksums(const util::hash_collection &hashes // and hash signatures of a file //------------------------------------------------- -static int verify_length_and_hash(emu_file *file, const char *name, UINT32 explength, const util::hash_collection &hashes) +static int verify_length_and_hash(emu_file *file, const char *name, uint32_t explength, const util::hash_collection &hashes) { int retVal = 0; if (file==nullptr) return 0; // verify length - UINT32 actlength = file->size(); + uint32_t actlength = file->size(); if (explength != actlength) { osd_printf_error("%s WRONG LENGTH (expected: %d found: %d)\n", name, explength, actlength); @@ -879,14 +879,14 @@ bool device_image_interface::load_software(software_list_device &swlist, const c { osd_file::error filerr = osd_file::error::NOT_FOUND; - UINT32 crc = 0; + uint32_t crc = 0; bool has_crc = util::hash_collection(ROM_GETHASHDATA(romp)).crc(crc); const software_info *swinfo = swlist.find(swname); if (swinfo == nullptr) return false; - UINT32 supported = swinfo->supported(); + uint32_t supported = swinfo->supported(); if (supported == SOFTWARE_SUPPORTED_PARTIAL) osd_printf_error("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist.list_name().c_str()); if (supported == SOFTWARE_SUPPORTED_NO) @@ -984,7 +984,7 @@ image_init_result device_image_interface::load_internal(const std::string &path, if (core_opens_image_file()) { // determine open plan - std::vector open_plan = determine_open_plan(is_create); + std::vector open_plan = determine_open_plan(is_create); // attempt to open the file in various ways for (auto iter = open_plan.cbegin(); !m_file && iter != open_plan.cend(); iter++) @@ -1491,7 +1491,7 @@ std::string device_image_interface::software_get_default_slot(const char *defaul //---------------------------------------------------------------------------- -static int image_fseek_thunk(void *file, INT64 offset, int whence) +static int image_fseek_thunk(void *file, int64_t offset, int whence) { device_image_interface *image = (device_image_interface *) file; return image->fseek(offset, whence); @@ -1509,7 +1509,7 @@ static size_t image_fwrite_thunk(void *file, const void *buffer, size_t length) return image->fwrite(buffer, length); } -static UINT64 image_fsize_thunk(void *file) +static uint64_t image_fsize_thunk(void *file) { device_image_interface *image = (device_image_interface *) file; return image->length(); diff --git a/src/emu/diimage.h b/src/emu/diimage.h index f36b5e7c835..91a8e0d452e 100644 --- a/src/emu/diimage.h +++ b/src/emu/diimage.h @@ -179,16 +179,16 @@ public: bool is_filetype(const std::string &candidate_filetype) { return !core_stricmp(filetype().c_str(), candidate_filetype.c_str()); } bool is_open() const { return bool(m_file); } util::core_file &image_core_file() const { return *m_file; } - UINT64 length() { check_for_file(); return m_file->size(); } + uint64_t length() { check_for_file(); return m_file->size(); } bool is_readonly() const { return m_readonly; } - UINT32 fread(void *buffer, UINT32 length) { check_for_file(); return m_file->read(buffer, length); } - UINT32 fread(optional_shared_ptr &ptr, UINT32 length) { ptr.allocate(length); return fread(ptr.target(), length); } - UINT32 fread(optional_shared_ptr &ptr, UINT32 length, offs_t offset) { ptr.allocate(length); return fread(ptr + offset, length - offset); } - UINT32 fwrite(const void *buffer, UINT32 length) { check_for_file(); return m_file->write(buffer, length); } - int fseek(INT64 offset, int whence) { check_for_file(); return m_file->seek(offset, whence); } - UINT64 ftell() { check_for_file(); return m_file->tell(); } + uint32_t fread(void *buffer, uint32_t length) { check_for_file(); return m_file->read(buffer, length); } + uint32_t fread(optional_shared_ptr &ptr, uint32_t length) { ptr.allocate(length); return fread(ptr.target(), length); } + uint32_t fread(optional_shared_ptr &ptr, uint32_t length, offs_t offset) { ptr.allocate(length); return fread(ptr + offset, length - offset); } + uint32_t fwrite(const void *buffer, uint32_t length) { check_for_file(); return m_file->write(buffer, length); } + int fseek(int64_t offset, int whence) { check_for_file(); return m_file->seek(offset, whence); } + uint64_t ftell() { check_for_file(); return m_file->tell(); } int fgetc() { char ch; if (fread(&ch, 1) != 1) ch = '\0'; return ch; } - char *fgets(char *buffer, UINT32 length) { check_for_file(); return m_file->gets(buffer, length); } + char *fgets(char *buffer, uint32_t length) { check_for_file(); return m_file->gets(buffer, length); } int image_feof() { check_for_file(); return m_file->eof(); } void *ptr() {check_for_file(); return const_cast(m_file->buffer()); } // configuration access @@ -197,7 +197,7 @@ public: const std::string &longname() const { return m_longname; } const std::string &manufacturer() const { return m_manufacturer; } const std::string &year() const { return m_year; } - UINT32 supported() const { return m_supported; } + uint32_t supported() const { return m_supported; } const software_info *software_entry() const { return m_software_info_ptr; } const software_part *part_entry() const { return m_software_part_ptr; } @@ -207,12 +207,12 @@ public: void set_working_directory(const char *working_directory) { m_working_directory = working_directory; } const std::string &working_directory(); - UINT8 *get_software_region(const char *tag); - UINT32 get_software_region_length(const char *tag); + uint8_t *get_software_region(const char *tag); + uint32_t get_software_region_length(const char *tag); const char *get_feature(const char *feature_name); - bool load_software_region(const char *tag, optional_shared_ptr &ptr); + bool load_software_region(const char *tag, optional_shared_ptr &ptr); - UINT32 crc(); + uint32_t crc(); util::hash_collection& hash() { return m_hash; } void battery_load(void *buffer, int length, int fill); @@ -255,7 +255,7 @@ protected: virtual const bool use_software_list_file_extension_for_filetype() const { return false; } image_init_result load_internal(const std::string &path, bool is_create, int create_format, util::option_resolution *create_args, bool just_load); - image_error_t load_image_by_path(UINT32 open_flags, const std::string &path); + image_error_t load_image_by_path(uint32_t open_flags, const std::string &path); void clear(); bool is_loaded(); @@ -308,7 +308,7 @@ protected: private: static image_error_t image_error_from_file_error(osd_file::error filerr); bool schedule_postload_hard_reset_if_needed(); - std::vector determine_open_plan(bool is_create); + std::vector determine_open_plan(bool is_create); // creation info formatlist_type m_formatlist; @@ -320,7 +320,7 @@ private: std::string m_longname; std::string m_manufacturer; std::string m_year; - UINT32 m_supported; + uint32_t m_supported; // flags bool m_readonly; diff --git a/src/emu/dimemory.cpp b/src/emu/dimemory.cpp index 0081062c38c..6071f5c2405 100644 --- a/src/emu/dimemory.cpp +++ b/src/emu/dimemory.cpp @@ -50,7 +50,7 @@ address_space_config::address_space_config() @param internal @param defmap */ -address_space_config::address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, address_map_constructor internal, address_map_constructor defmap) +address_space_config::address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, address_map_constructor internal, address_map_constructor defmap) : m_name(name), m_endianness(endian), m_databus_width(datawidth), @@ -64,7 +64,7 @@ address_space_config::address_space_config(const char *name, endianness_t endian { } -address_space_config::address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, UINT8 logwidth, UINT8 pageshift, address_map_constructor internal, address_map_constructor defmap) +address_space_config::address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, uint8_t logwidth, uint8_t pageshift, address_map_constructor internal, address_map_constructor defmap) : m_name(name), m_endianness(endian), m_databus_width(datawidth), @@ -78,7 +78,7 @@ address_space_config::address_space_config(const char *name, endianness_t endian { } -address_space_config::address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, address_map_delegate internal, address_map_delegate defmap) +address_space_config::address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, address_map_delegate internal, address_map_delegate defmap) : m_name(name), m_endianness(endian), m_databus_width(datawidth), @@ -94,7 +94,7 @@ address_space_config::address_space_config(const char *name, endianness_t endian { } -address_space_config::address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, UINT8 logwidth, UINT8 pageshift, address_map_delegate internal, address_map_delegate defmap) +address_space_config::address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, uint8_t logwidth, uint8_t pageshift, address_map_delegate internal, address_map_delegate defmap) : m_name(name), m_endianness(endian), m_databus_width(datawidth), @@ -189,7 +189,7 @@ bool device_memory_interface::memory_translate(address_spacenum spacenum, int in // handled by bypassing the memory system //------------------------------------------------- -bool device_memory_interface::memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value) +bool device_memory_interface::memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) { // by default, we don't do anything return false; @@ -204,7 +204,7 @@ bool device_memory_interface::memory_read(address_spacenum spacenum, offs_t offs // handled by bypassing the memory system //------------------------------------------------- -bool device_memory_interface::memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value) +bool device_memory_interface::memory_write(address_spacenum spacenum, offs_t offset, int size, uint64_t value) { // by default, we don't do anything return false; @@ -220,7 +220,7 @@ bool device_memory_interface::memory_write(address_spacenum spacenum, offs_t off // system //------------------------------------------------- -bool device_memory_interface::memory_readop(offs_t offset, int size, UINT64 &value) +bool device_memory_interface::memory_readop(offs_t offset, int size, uint64_t &value) { // by default, we don't do anything return false; diff --git a/src/emu/dimemory.h b/src/emu/dimemory.h index 6bd85ff5e5e..67aef5abcd9 100644 --- a/src/emu/dimemory.h +++ b/src/emu/dimemory.h @@ -100,9 +100,9 @@ public: bool translate(address_spacenum spacenum, int intention, offs_t &address) { return memory_translate(spacenum, intention, address); } // read/write access - bool read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value) { return memory_read(spacenum, offset, size, value); } - bool write(address_spacenum spacenum, offs_t offset, int size, UINT64 value) { return memory_write(spacenum, offset, size, value); } - bool readop(offs_t offset, int size, UINT64 &value) { return memory_readop(offset, size, value); } + bool read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) { return memory_read(spacenum, offset, size, value); } + bool write(address_spacenum spacenum, offs_t offset, int size, uint64_t value) { return memory_write(spacenum, offset, size, value); } + bool readop(offs_t offset, int size, uint64_t &value) { return memory_readop(offset, size, value); } // deliberately ambiguous functions; if you have the memory interface // just use it @@ -114,9 +114,9 @@ protected: // optional operation overrides virtual bool memory_translate(address_spacenum spacenum, int intention, offs_t &address); - virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value); - virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value); - virtual bool memory_readop(offs_t offset, int size, UINT64 &value); + virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value); + virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, uint64_t value); + virtual bool memory_readop(offs_t offset, int size, uint64_t &value); // interface-level overrides virtual void interface_validity_check(validity_checker &valid) const override; diff --git a/src/emu/dinetwork.cpp b/src/emu/dinetwork.cpp index 26acbfcf479..03bbd409721 100644 --- a/src/emu/dinetwork.cpp +++ b/src/emu/dinetwork.cpp @@ -16,13 +16,13 @@ device_network_interface::~device_network_interface() { } -int device_network_interface::send(UINT8 *buf, int len) const +int device_network_interface::send(uint8_t *buf, int len) const { if(!m_dev) return 0; return m_dev->send(buf, len); } -void device_network_interface::recv_cb(UINT8 *buf, int len) +void device_network_interface::recv_cb(uint8_t *buf, int len) { } diff --git a/src/emu/dinetwork.h b/src/emu/dinetwork.h index dd78dbcea15..44ca6113a22 100644 --- a/src/emu/dinetwork.h +++ b/src/emu/dinetwork.h @@ -19,8 +19,8 @@ public: bool get_promisc() const { return m_promisc; } int get_interface() const { return m_intf; } - int send(UINT8 *buf, int len) const; - virtual void recv_cb(UINT8 *buf, int len); + int send(uint8_t *buf, int len) const; + virtual void recv_cb(uint8_t *buf, int len); protected: bool m_promisc; diff --git a/src/emu/dipty.cpp b/src/emu/dipty.cpp index a2ada675307..7fab9b53a32 100644 --- a/src/emu/dipty.cpp +++ b/src/emu/dipty.cpp @@ -51,7 +51,7 @@ bool device_pty_interface::is_open() const return m_opened; } -ssize_t device_pty_interface::read(UINT8 *rx_chars , size_t count) const +ssize_t device_pty_interface::read(uint8_t *rx_chars , size_t count) const { std::uint32_t actual_bytes; if (m_opened && m_pty_master->read(rx_chars, 0, count, actual_bytes) == osd_file::error::NONE) @@ -60,7 +60,7 @@ ssize_t device_pty_interface::read(UINT8 *rx_chars , size_t count) const return -1; } -void device_pty_interface::write(UINT8 tx_char) const +void device_pty_interface::write(uint8_t tx_char) const { std::uint32_t actual_bytes; if (m_opened) diff --git a/src/emu/dipty.h b/src/emu/dipty.h index 10549e52ccb..f9b38232c80 100644 --- a/src/emu/dipty.h +++ b/src/emu/dipty.h @@ -29,8 +29,8 @@ public: bool is_open() const; - ssize_t read(UINT8 *rx_chars , size_t count) const; - void write(UINT8 tx_char) const; + ssize_t read(uint8_t *rx_chars , size_t count) const; + void write(uint8_t tx_char) const; bool is_slave_connected() const; diff --git a/src/emu/dirom.cpp b/src/emu/dirom.cpp index 84b4e6a8c4b..85cd3e3c6b3 100644 --- a/src/emu/dirom.cpp +++ b/src/emu/dirom.cpp @@ -1,7 +1,7 @@ #include "emu.h" -device_rom_interface::device_rom_interface(const machine_config &mconfig, device_t &device, UINT8 addrwidth, endianness_t endian, UINT8 datawidth) : +device_rom_interface::device_rom_interface(const machine_config &mconfig, device_t &device, uint8_t addrwidth, endianness_t endian, uint8_t datawidth) : device_memory_interface(mconfig, device), m_rom_config("rom", endian, datawidth, addrwidth) { @@ -41,10 +41,10 @@ void device_rom_interface::reset_bank() m_bank->set_entry(m_cur_bank); } -void device_rom_interface::set_rom(const void *base, UINT32 size) +void device_rom_interface::set_rom(const void *base, uint32_t size) { - UINT32 mend = m_rom_config.addr_width() == 32 ? 0xffffffff : (1 << m_rom_config.addr_width()) - 1; - UINT32 rend = size-1; + uint32_t mend = m_rom_config.addr_width() == 32 ? 0xffffffff : (1 << m_rom_config.addr_width()) - 1; + uint32_t rend = size-1; m_bank_count = mend == 0xffffffff ? 1 : (rend+1) / (mend+1); if(m_bank_count < 1) m_bank_count = 1; @@ -57,7 +57,7 @@ void device_rom_interface::set_rom(const void *base, UINT32 size) } else { // Round up to the nearest power-of-two-minus-one - UINT32 rmask = rend; + uint32_t rmask = rend; rmask |= rmask >> 1; rmask |= rmask >> 2; rmask |= rmask >> 4; @@ -85,7 +85,7 @@ void device_rom_interface::interface_pre_start() if(reg) set_rom(reg->base(), reg->bytes()); else { - UINT32 end = m_rom_config.addr_width() == 32 ? 0xffffffff : (1 << m_rom_config.addr_width()) - 1; + uint32_t end = m_rom_config.addr_width() == 32 ? 0xffffffff : (1 << m_rom_config.addr_width()) - 1; space().unmap_read(0, end); } } diff --git a/src/emu/dirom.h b/src/emu/dirom.h index aebe0b950c5..cc8ee590ea9 100644 --- a/src/emu/dirom.h +++ b/src/emu/dirom.h @@ -20,15 +20,15 @@ class device_rom_interface : public device_memory_interface { public: - device_rom_interface(const machine_config &mconfig, device_t &device, UINT8 addrwidth, endianness_t endian = ENDIANNESS_LITTLE, UINT8 datawidth = 8); + device_rom_interface(const machine_config &mconfig, device_t &device, uint8_t addrwidth, endianness_t endian = ENDIANNESS_LITTLE, uint8_t datawidth = 8); virtual ~device_rom_interface(); - inline UINT8 read_byte(offs_t byteaddress) { return m_rom_direct->read_byte(byteaddress); } - inline UINT16 read_word(offs_t byteaddress) { return m_rom_direct->read_word(byteaddress); } - inline UINT32 read_dword(offs_t byteaddress) { return m_rom_direct->read_dword(byteaddress); } - inline UINT64 read_qword(offs_t byteaddress) { return m_rom_direct->read_qword(byteaddress); } + inline uint8_t read_byte(offs_t byteaddress) { return m_rom_direct->read_byte(byteaddress); } + inline uint16_t read_word(offs_t byteaddress) { return m_rom_direct->read_word(byteaddress); } + inline uint32_t read_dword(offs_t byteaddress) { return m_rom_direct->read_dword(byteaddress); } + inline uint64_t read_qword(offs_t byteaddress) { return m_rom_direct->read_qword(byteaddress); } - void set_rom(const void *base, UINT32 size); + void set_rom(const void *base, uint32_t size); void set_rom_bank(int bank); protected: diff --git a/src/emu/dirtc.cpp b/src/emu/dirtc.cpp index 3dd961c2aa6..12c7b5c1098 100644 --- a/src/emu/dirtc.cpp +++ b/src/emu/dirtc.cpp @@ -87,7 +87,7 @@ void device_rtc_interface::set_current_time(const system_time &systime) // convert_to_bcd - //------------------------------------------------- -UINT8 device_rtc_interface::convert_to_bcd(int val) +uint8_t device_rtc_interface::convert_to_bcd(int val) { return ((val / 10) << 4) | (val % 10); } @@ -97,7 +97,7 @@ UINT8 device_rtc_interface::convert_to_bcd(int val) // bcd_to_integer - //------------------------------------------------- -int device_rtc_interface::bcd_to_integer(UINT8 val) +int device_rtc_interface::bcd_to_integer(uint8_t val) { return (((val & 0xf0) >> 4) * 10) + (val & 0x0f); } diff --git a/src/emu/dirtc.h b/src/emu/dirtc.h index cbae4dfecd8..d486250ffac 100644 --- a/src/emu/dirtc.h +++ b/src/emu/dirtc.h @@ -53,8 +53,8 @@ public: bool has_battery() const { return rtc_battery_backed(); } protected: - static UINT8 convert_to_bcd(int val); - static int bcd_to_integer(UINT8 val); + static uint8_t convert_to_bcd(int val); + static int bcd_to_integer(uint8_t val); void set_clock_register(int register, int value); int get_clock_register(int register); diff --git a/src/emu/diserial.cpp b/src/emu/diserial.cpp index 182360fab3a..1ede715908f 100644 --- a/src/emu/diserial.cpp +++ b/src/emu/diserial.cpp @@ -295,7 +295,7 @@ void device_serial_interface::receive_register_update_bit(int bit) void device_serial_interface::receive_register_extract() { - UINT8 data; + uint8_t data; receive_register_reset(); @@ -369,7 +369,7 @@ void device_serial_interface::transmit_register_add_bit(int bit) /* generate data in stream format ready for transfer */ -void device_serial_interface::transmit_register_setup(UINT8 data_byte) +void device_serial_interface::transmit_register_setup(uint8_t data_byte) { int i; unsigned char transmit_data; @@ -434,7 +434,7 @@ void device_serial_interface::transmit_register_setup(UINT8 data_byte) /* get a bit from the transmit register */ -UINT8 device_serial_interface::transmit_register_get_data_bit() +uint8_t device_serial_interface::transmit_register_get_data_bit() { int bit; diff --git a/src/emu/diserial.h b/src/emu/diserial.h index 1d4d957a041..9f67ccbd973 100644 --- a/src/emu/diserial.h +++ b/src/emu/diserial.h @@ -92,20 +92,20 @@ protected: void set_rcv_rate(const attotime &rate); void set_tra_rate(const attotime &rate); - void set_rcv_rate(UINT32 clock, int div) { set_rcv_rate((clock && div) ? (attotime::from_hz(clock) * div) : attotime::never); } - void set_tra_rate(UINT32 clock, int div) { set_tra_rate((clock && div) ? (attotime::from_hz(clock) * div) : attotime::never); } + void set_rcv_rate(uint32_t clock, int div) { set_rcv_rate((clock && div) ? (attotime::from_hz(clock) * div) : attotime::never); } + void set_tra_rate(uint32_t clock, int div) { set_tra_rate((clock && div) ? (attotime::from_hz(clock) * div) : attotime::never); } void set_rcv_rate(int baud) { set_rcv_rate(baud ? attotime::from_hz(baud) : attotime::never); } void set_tra_rate(int baud) { set_tra_rate(baud ? attotime::from_hz(baud) : attotime::never); } void set_rate(const attotime &rate) { set_rcv_rate(rate); set_tra_rate(rate); } - void set_rate(UINT32 clock, int div) { set_rcv_rate(clock, div); set_tra_rate(clock, div); } + void set_rate(uint32_t clock, int div) { set_rcv_rate(clock, div); set_tra_rate(clock, div); } void set_rate(int baud) { set_rcv_rate(baud); set_tra_rate(baud); } void transmit_register_reset(); void transmit_register_add_bit(int bit); - void transmit_register_setup(UINT8 data_byte); - UINT8 transmit_register_get_data_bit(); + void transmit_register_setup(uint8_t data_byte); + uint8_t transmit_register_get_data_bit(); - UINT8 serial_helper_get_parity(UINT8 data) { return m_serial_parity_table[data]; } + uint8_t serial_helper_get_parity(uint8_t data) { return m_serial_parity_table[data]; } bool is_receive_register_full(); bool is_transmit_register_empty(); @@ -114,7 +114,7 @@ protected: bool is_receive_framing_error() const { return m_rcv_framing_error; } bool is_receive_parity_error() const { return m_rcv_parity_error; } - UINT8 get_received_char() const { return m_rcv_byte_received; } + uint8_t get_received_char() const { return m_rcv_byte_received; } virtual void tra_callback() { } virtual void rcv_callback() { receive_register_update_bit(m_rcv_line); } @@ -137,48 +137,48 @@ protected: private: enum { TRA_TIMER_ID = 10000, RCV_TIMER_ID }; - UINT8 m_serial_parity_table[256]; + uint8_t m_serial_parity_table[256]; // Data frame // number of start bits int m_df_start_bit_count; // length of word in bits - UINT8 m_df_word_length; + uint8_t m_df_word_length; // parity state - UINT8 m_df_parity; + uint8_t m_df_parity; // number of stop bits - UINT8 m_df_stop_bit_count; + uint8_t m_df_stop_bit_count; // Receive register /* data */ - UINT16 m_rcv_register_data; + uint16_t m_rcv_register_data; /* flags */ - UINT8 m_rcv_flags; + uint8_t m_rcv_flags; /* bit count received */ - UINT8 m_rcv_bit_count_received; + uint8_t m_rcv_bit_count_received; /* length of data to receive - includes data bits, parity bit and stop bit */ - UINT8 m_rcv_bit_count; + uint8_t m_rcv_bit_count; /* the byte of data received */ - UINT8 m_rcv_byte_received; + uint8_t m_rcv_byte_received; bool m_rcv_framing_error; bool m_rcv_parity_error; // Transmit register /* data */ - UINT16 m_tra_register_data; + uint16_t m_tra_register_data; /* flags */ - UINT8 m_tra_flags; + uint8_t m_tra_flags; /* number of bits transmitted */ - UINT8 m_tra_bit_count_transmitted; + uint8_t m_tra_bit_count_transmitted; /* length of data to send */ - UINT8 m_tra_bit_count; + uint8_t m_tra_bit_count; emu_timer *m_rcv_clock; emu_timer *m_tra_clock; attotime m_rcv_rate; attotime m_tra_rate; - UINT8 m_rcv_line; + uint8_t m_rcv_line; int m_tra_clock_state, m_rcv_clock_state; @@ -187,7 +187,7 @@ private: }; -template +template class device_buffered_serial_interface : public device_serial_interface { protected: @@ -219,7 +219,7 @@ protected: m_empty = 1U; } - void transmit_byte(UINT8 byte) + void transmit_byte(uint8_t byte) { assert(!m_empty || (m_head == m_tail)); assert(m_head < ARRAY_LENGTH(m_fifo)); @@ -260,11 +260,11 @@ protected: } private: - virtual void received_byte(UINT8 byte) = 0; + virtual void received_byte(uint8_t byte) = 0; - UINT8 m_fifo[FIFO_LENGTH]; - UINT32 m_head = 0U, m_tail = 0U; - UINT8 m_empty = 1U; + uint8_t m_fifo[FIFO_LENGTH]; + uint32_t m_head = 0U, m_tail = 0U; + uint8_t m_empty = 1U; }; #endif // MAME_EMU_DISERIAL_H diff --git a/src/emu/dislot.h b/src/emu/dislot.h index a5e6d3edfc1..f7b404a635d 100644 --- a/src/emu/dislot.h +++ b/src/emu/dislot.h @@ -77,7 +77,7 @@ public: const char *default_bios() const { return m_default_bios; } machine_config_constructor machine_config() const { return m_machine_config; } const input_device_default *input_device_defaults() const { return m_input_device_defaults; } - UINT32 clock() const { return m_clock; } + uint32_t clock() const { return m_clock; } private: // internal state @@ -87,7 +87,7 @@ private: const char *m_default_bios; machine_config_constructor m_machine_config; const input_device_default *m_input_device_defaults; - UINT32 m_clock; + uint32_t m_clock; }; @@ -108,7 +108,7 @@ public: static void static_set_option_default_bios(device_t &device, const char *option, const char *default_bios) { static_option(device, option)->m_default_bios = default_bios; } static void static_set_option_machine_config(device_t &device, const char *option, const machine_config_constructor machine_config) { static_option(device, option)->m_machine_config = machine_config; } static void static_set_option_device_input_defaults(device_t &device, const char *option, const input_device_default *default_input) { static_option(device, option)->m_input_device_defaults = default_input; } - static void static_set_option_clock(device_t &device, const char *option, UINT32 default_clock) { static_option(device, option)->m_clock = default_clock; } + static void static_set_option_clock(device_t &device, const char *option, uint32_t default_clock) { static_option(device, option)->m_clock = default_clock; } bool fixed() const { return m_fixed; } const char *default_option() const { return m_default_option; } const std::unordered_map> &option_list() const { return m_options; } diff --git a/src/emu/disound.cpp b/src/emu/disound.cpp index 52087560191..1450d1a56c4 100644 --- a/src/emu/disound.cpp +++ b/src/emu/disound.cpp @@ -42,7 +42,7 @@ device_sound_interface::~device_sound_interface() // a new route to the device //------------------------------------------------- -void device_sound_interface::static_add_route(device_t &device, UINT32 output, const char *target, double gain, UINT32 input, UINT32 mixoutput) +void device_sound_interface::static_add_route(device_t &device, uint32_t output, const char *target, double gain, uint32_t input, uint32_t mixoutput) { // find our sound interface device_sound_interface *sound; @@ -357,7 +357,7 @@ void device_sound_interface::interface_pre_reset() // sound_route - constructor //------------------------------------------------- -device_sound_interface::sound_route::sound_route(int output, int input, float gain, const char *target, UINT32 mixoutput) +device_sound_interface::sound_route::sound_route(int output, int input, float gain, const char *target, uint32_t mixoutput) : m_output(output), m_input(input), m_mixoutput(mixoutput), @@ -461,7 +461,7 @@ void device_mixer_interface::sound_stream_update(sound_stream &stream, stream_sa memset(outputs[output], 0, samples * sizeof(outputs[0][0])); // loop over samples - const UINT8 *outmap = &m_outputmap[0]; + const uint8_t *outmap = &m_outputmap[0]; for (int pos = 0; pos < samples; pos++) { // for each input, add it to the appropriate output diff --git a/src/emu/disound.h b/src/emu/disound.h index 2fca3860283..a47ce6ba919 100644 --- a/src/emu/disound.h +++ b/src/emu/disound.h @@ -68,11 +68,11 @@ public: class sound_route { public: - sound_route(int output, int input, float gain, const char *target, UINT32 mixoutput); + sound_route(int output, int input, float gain, const char *target, uint32_t mixoutput); - UINT32 m_output; // output index, or ALL_OUTPUTS - UINT32 m_input; // target input index - UINT32 m_mixoutput; // target mixer output + uint32_t m_output; // output index, or ALL_OUTPUTS + uint32_t m_input; // target input index + uint32_t m_mixoutput; // target mixer output float m_gain; // gain std::string m_target; // target tag }; @@ -87,7 +87,7 @@ public: const std::vector> &routes() const { return m_route_list; } // static inline configuration helpers - static void static_add_route(device_t &device, UINT32 output, const char *target, double gain, UINT32 input = AUTO_ALLOC_INPUT, UINT32 mixoutput = 0); + static void static_add_route(device_t &device, uint32_t output, const char *target, double gain, uint32_t input = AUTO_ALLOC_INPUT, uint32_t mixoutput = 0); static void static_reset_routes(device_t &device); // sound stream update overrides @@ -141,8 +141,8 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; // internal state - UINT8 m_outputs; // number of outputs - std::vector m_outputmap; // map of inputs to outputs + uint8_t m_outputs; // number of outputs + std::vector m_outputmap; // map of inputs to outputs sound_stream * m_mixer_stream; // mixing stream }; diff --git a/src/emu/dispatch.cpp b/src/emu/dispatch.cpp index 4df4d3f610b..61a786e5cb6 100644 --- a/src/emu/dispatch.cpp +++ b/src/emu/dispatch.cpp @@ -9,31 +9,31 @@ const device_type DEVCB_LINE_DISPATCH_4 = &device_creator >; const device_type DEVCB_LINE_DISPATCH_6 = &device_creator >; -template<> devcb_line_dispatch_device<2>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +template<> devcb_line_dispatch_device<2>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DEVCB_LINE_DISPATCH_2, "Line dispatcher (2 slots)", tag, owner, clock, "devcb_line_dispatch", __FILE__) { init_fwd(); } -template<> devcb_line_dispatch_device<3>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +template<> devcb_line_dispatch_device<3>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DEVCB_LINE_DISPATCH_3, "Line dispatcher (3 slots)", tag, owner, clock, "devcb_line_dispatch", __FILE__) { init_fwd(); } -template<> devcb_line_dispatch_device<4>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +template<> devcb_line_dispatch_device<4>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DEVCB_LINE_DISPATCH_4, "Line dispatcher (4 slots)", tag, owner, clock, "devcb_line_dispatch", __FILE__) { init_fwd(); } -template<> devcb_line_dispatch_device<5>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +template<> devcb_line_dispatch_device<5>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DEVCB_LINE_DISPATCH_5, "Line dispatcher (5 slots)", tag, owner, clock, "devcb_line_dispatch", __FILE__) { init_fwd(); } -template<> devcb_line_dispatch_device<6>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +template<> devcb_line_dispatch_device<6>::devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DEVCB_LINE_DISPATCH_6, "Line dispatcher (6 slots)", tag, owner, clock, "devcb_line_dispatch", __FILE__) { init_fwd(); diff --git a/src/emu/dispatch.h b/src/emu/dispatch.h index dbaaeb32a96..e6409373295 100644 --- a/src/emu/dispatch.h +++ b/src/emu/dispatch.h @@ -31,7 +31,7 @@ extern const device_type DEVCB_LINE_DISPATCH_6; template class devcb_line_dispatch_device : public device_t { public: - devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + devcb_line_dispatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DEVCB_LINE_DISPATCH_2, "DEVCB_LINE_DISPATCH_2", tag, owner, clock, "devcb_line_dispatch_2", __FILE__) { } void init_fwd() { diff --git a/src/emu/distate.cpp b/src/emu/distate.cpp index a4607fb6885..29730ec427b 100644 --- a/src/emu/distate.cpp +++ b/src/emu/distate.cpp @@ -15,7 +15,7 @@ // GLOBAL VARIABLES //************************************************************************** -const UINT64 device_state_entry::k_decimal_divisor[] = +const uint64_t device_state_entry::k_decimal_divisor[] = { 1, 10, @@ -49,7 +49,7 @@ const UINT64 device_state_entry::k_decimal_divisor[] = // device_state_entry - constructor //------------------------------------------------- -device_state_entry::device_state_entry(int index, const char *symbol, void *dataptr, UINT8 size, device_state_interface *dev) +device_state_entry::device_state_entry(int index, const char *symbol, void *dataptr, uint8_t size, device_state_interface *dev) : m_device_state(dev), m_index(index), m_dataptr(dataptr), @@ -128,20 +128,20 @@ void device_state_entry::format_from_mask() // make up a format based on the mask int width = 0; - for (UINT64 tempmask = m_datamask; tempmask != 0; tempmask >>= 4) + for (uint64_t tempmask = m_datamask; tempmask != 0; tempmask >>= 4) width++; m_format = string_format("%%0%dX", width); } //------------------------------------------------- -// value - return the current value as a UINT64 +// value - return the current value as a uint64_t //------------------------------------------------- -UINT64 device_state_entry::value() const +uint64_t device_state_entry::value() const { // pick up the value - UINT64 result; + uint64_t result; switch (m_datasize) { default: @@ -162,7 +162,7 @@ UINT64 device_state_entry::value() const std::string device_state_entry::format(const char *string, bool maxout) const { std::string dest; - UINT64 result = value(); + uint64_t result = value(); // parse the format bool leadzero = false; @@ -344,10 +344,10 @@ std::string device_state_entry::format(const char *string, bool maxout) const //------------------------------------------------- -// set_value - set the value from a UINT64 +// set_value - set the value from a uint64_t //------------------------------------------------- -void device_state_entry::set_value(UINT64 value) const +void device_state_entry::set_value(uint64_t value) const { // apply the mask value &= m_datamask; @@ -408,10 +408,10 @@ device_state_interface::~device_state_interface() //------------------------------------------------- // state_int - return the value of the given piece -// of indexed state as a UINT64 +// of indexed state as a uint64_t //------------------------------------------------- -UINT64 device_state_interface::state_int(int index) +uint64_t device_state_interface::state_int(int index) { // nullptr or out-of-range entry returns 0 const device_state_entry *entry = state_find_entry(index); @@ -468,10 +468,10 @@ int device_state_interface::state_string_max_length(int index) //------------------------------------------------- // set_state_int - set the value of the given -// piece of indexed state from a UINT64 +// piece of indexed state from a uint64_t //------------------------------------------------- -void device_state_interface::set_state_int(int index, UINT64 value) +void device_state_interface::set_state_int(int index, uint64_t value) { // nullptr or out-of-range entry is a no-op const device_state_entry *entry = state_find_entry(index); @@ -510,10 +510,10 @@ void device_state_interface::set_state_string(int index, const char *string) //------------------------------------------------- // state_add - return the value of the given -// pieces of indexed state as a UINT64 +// pieces of indexed state as a uint64_t //------------------------------------------------- -device_state_entry &device_state_interface::state_add(int index, const char *symbol, void *data, UINT8 size) +device_state_entry &device_state_interface::state_add(int index, const char *symbol, void *data, uint8_t size) { // assert validity of incoming parameters assert(size == 1 || size == 2 || size == 4 || size == 8); diff --git a/src/emu/distate.h b/src/emu/distate.h index c608e832775..602f909fec6 100644 --- a/src/emu/distate.h +++ b/src/emu/distate.h @@ -46,13 +46,13 @@ class device_state_entry friend class device_state_interface; public: // construction/destruction - device_state_entry(int index, const char *symbol, void *dataptr, UINT8 size, device_state_interface *dev); + device_state_entry(int index, const char *symbol, void *dataptr, uint8_t size, device_state_interface *dev); device_state_entry(int index, device_state_interface *dev); public: // post-construction modifiers - device_state_entry &mask(UINT64 _mask) { m_datamask = _mask; format_from_mask(); return *this; } - device_state_entry &signed_mask(UINT64 _mask) { m_datamask = _mask; m_flags |= DSF_IMPORT_SEXT; format_from_mask(); return *this; } + device_state_entry &mask(uint64_t _mask) { m_datamask = _mask; format_from_mask(); return *this; } + device_state_entry &signed_mask(uint64_t _mask) { m_datamask = _mask; m_flags |= DSF_IMPORT_SEXT; format_from_mask(); return *this; } device_state_entry &formatstr(const char *_format); device_state_entry &callimport() { m_flags |= DSF_IMPORT; return *this; } device_state_entry &callexport() { m_flags |= DSF_EXPORT; return *this; } @@ -68,12 +68,12 @@ public: protected: // device state flags - static const UINT8 DSF_NOSHOW = 0x01; // don't display this entry in the registers view - static const UINT8 DSF_IMPORT = 0x02; // call the import function after writing new data - static const UINT8 DSF_IMPORT_SEXT = 0x04; // sign-extend the data when writing new data - static const UINT8 DSF_EXPORT = 0x08; // call the export function prior to fetching the data - static const UINT8 DSF_CUSTOM_STRING = 0x10; // set if the format has a custom string - static const UINT8 DSF_DIVIDER = 0x20; // set if this is a divider entry + static const uint8_t DSF_NOSHOW = 0x01; // don't display this entry in the registers view + static const uint8_t DSF_IMPORT = 0x02; // call the import function after writing new data + static const uint8_t DSF_IMPORT_SEXT = 0x04; // sign-extend the data when writing new data + static const uint8_t DSF_EXPORT = 0x08; // call the export function prior to fetching the data + static const uint8_t DSF_CUSTOM_STRING = 0x10; // set if the format has a custom string + static const uint8_t DSF_DIVIDER = 0x20; // set if this is a divider entry // helpers bool needs_custom_string() const { return ((m_flags & DSF_CUSTOM_STRING) != 0); } @@ -81,28 +81,28 @@ protected: // return the current value -- only for our friends who handle export bool needs_export() const { return ((m_flags & DSF_EXPORT) != 0); } - UINT64 value() const; + uint64_t value() const; std::string format(const char *string, bool maxout = false) const; // set the current value -- only for our friends who handle import bool needs_import() const { return ((m_flags & DSF_IMPORT) != 0); } - void set_value(UINT64 value) const; + void set_value(uint64_t value) const; void set_value(const char *string) const; // statics - static const UINT64 k_decimal_divisor[20]; // divisors for outputting decimal values + static const uint64_t k_decimal_divisor[20]; // divisors for outputting decimal values // public state description device_state_interface *m_device_state; // link to parent device state - UINT32 m_index; // index by which this item is referred + uint32_t m_index; // index by which this item is referred generic_ptr m_dataptr; // pointer to where the data lives - UINT64 m_datamask; // mask that applies to the data - UINT8 m_datasize; // size of the data - UINT8 m_flags; // flags for this data + uint64_t m_datamask; // mask that applies to the data + uint8_t m_datasize; // size of the data + uint8_t m_flags; // flags for this data std::string m_symbol; // symbol for display; all lower-case version for expressions std::string m_format; // supported formats bool m_default_format; // true if we are still using default format - UINT64 m_sizemask; // mask derived from the data size + uint64_t m_sizemask; // mask derived from the data size }; @@ -121,16 +121,16 @@ public: const std::vector> &state_entries() const { return m_state_list; } // state getters - UINT64 state_int(int index); + uint64_t state_int(int index); std::string state_string(int index) const; int state_string_max_length(int index); offs_t pc() { return state_int(STATE_GENPC); } offs_t pcbase() { return state_int(STATE_GENPCBASE); } offs_t sp() { return state_int(STATE_GENSP); } - UINT64 flags() { return state_int(STATE_GENFLAGS); } + uint64_t flags() { return state_int(STATE_GENFLAGS); } // state setters - void set_state_int(int index, UINT64 value); + void set_state_int(int index, uint64_t value); void set_state_string(int index, const char *string); void set_pc(offs_t pc) { set_state_int(STATE_GENPC, pc); } @@ -147,7 +147,7 @@ public: // protected eventually { return state_add(index, symbol, &data, sizeof(data)); } - device_state_entry &state_add(int index, const char *symbol, void *data, UINT8 size); + device_state_entry &state_add(int index, const char *symbol, void *data, uint8_t size); // add a new divider entry device_state_entry &state_add_divider(int index); diff --git a/src/emu/divtlb.cpp b/src/emu/divtlb.cpp index 9240fa5ad94..942202afc35 100644 --- a/src/emu/divtlb.cpp +++ b/src/emu/divtlb.cpp @@ -250,7 +250,7 @@ void device_vtlb_interface::vtlb_load(int entrynum, int numpages, offs_t address // vtlb_dynload - load a dynamic VTLB entry //------------------------------------------------- -void device_vtlb_interface::vtlb_dynload(UINT32 index, offs_t address, vtlb_entry value) +void device_vtlb_interface::vtlb_dynload(uint32_t index, offs_t address, vtlb_entry value) { vtlb_entry entry = m_table[index]; diff --git a/src/emu/divtlb.h b/src/emu/divtlb.h index 219de2c4ca9..31439d97db9 100644 --- a/src/emu/divtlb.h +++ b/src/emu/divtlb.h @@ -37,7 +37,7 @@ ***************************************************************************/ /* represents an entry in the VTLB */ -typedef UINT32 vtlb_entry; +typedef uint32_t vtlb_entry; // ======================> device_vtlb_interface @@ -56,7 +56,7 @@ public: // filling int vtlb_fill(offs_t address, int intention); void vtlb_load(int entrynum, int numpages, offs_t address, vtlb_entry value); - void vtlb_dynload(UINT32 index, offs_t address, vtlb_entry value); + void vtlb_dynload(uint32_t index, offs_t address, vtlb_entry value); // flushing void vtlb_flush_dynamic(); diff --git a/src/emu/drawgfx.cpp b/src/emu/drawgfx.cpp index fcb7b0b3fec..bca40bb769b 100644 --- a/src/emu/drawgfx.cpp +++ b/src/emu/drawgfx.cpp @@ -16,7 +16,7 @@ ***************************************************************************/ // if this line errors during compile, the size of NO_PRIORITY is wrong and I need to use something else -UINT8 no_priority_size_is_wrong[2 * (sizeof(NO_PRIORITY) == 3) - 1]; +uint8_t no_priority_size_is_wrong[2 * (sizeof(NO_PRIORITY) == 3) - 1]; bitmap_ind8 drawgfx_dummy_priority_bitmap; @@ -31,7 +31,7 @@ bitmap_ind8 drawgfx_dummy_priority_bitmap; offset -------------------------------------------------*/ -static inline int readbit(const UINT8 *src, unsigned int bitnum) +static inline int readbit(const uint8_t *src, unsigned int bitnum) { return src[bitnum / 8] & (0x80 >> (bitnum % 8)); } @@ -43,7 +43,7 @@ static inline int readbit(const UINT8 *src, unsigned int bitnum) than the width -------------------------------------------------*/ -static inline INT32 normalize_xscroll(const bitmap_t &bitmap, INT32 xscroll) +static inline int32_t normalize_xscroll(const bitmap_t &bitmap, int32_t xscroll) { return (xscroll >= 0) ? xscroll % bitmap.width() : (bitmap.width() - (-xscroll) % bitmap.width()); } @@ -55,7 +55,7 @@ static inline INT32 normalize_xscroll(const bitmap_t &bitmap, INT32 xscroll) than the height -------------------------------------------------*/ -static inline INT32 normalize_yscroll(const bitmap_t &bitmap, INT32 yscroll) +static inline int32_t normalize_yscroll(const bitmap_t &bitmap, int32_t yscroll) { return (yscroll >= 0) ? yscroll % bitmap.height() : (bitmap.height() - (-yscroll) % bitmap.height()); } @@ -68,7 +68,7 @@ static inline INT32 normalize_yscroll(const bitmap_t &bitmap, INT32 yscroll) const device_type GFXDECODE = &device_creator; -gfxdecode_device::gfxdecode_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +gfxdecode_device::gfxdecode_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GFXDECODE, "gfxdecode", tag, owner, clock, "gfxdecode", __FILE__), device_gfx_interface(mconfig, *this) { @@ -86,7 +86,7 @@ gfxdecode_device::gfxdecode_device(const machine_config &mconfig, const char *ta // gfx_element - constructor //------------------------------------------------- -gfx_element::gfx_element(palette_device &palette, UINT8 *base, UINT16 width, UINT16 height, UINT32 rowbytes, UINT32 total_colors, UINT32 color_base, UINT32 color_granularity) +gfx_element::gfx_element(palette_device &palette, uint8_t *base, uint16_t width, uint16_t height, uint32_t rowbytes, uint32_t total_colors, uint32_t color_base, uint32_t color_granularity) : m_palette(&palette), m_width(width), m_height(height), @@ -111,7 +111,7 @@ gfx_element::gfx_element(palette_device &palette, UINT8 *base, UINT16 width, UIN { } -gfx_element::gfx_element(palette_device &palette, const gfx_layout &gl, const UINT8 *srcdata, UINT32 xormask, UINT32 total_colors, UINT32 color_base) +gfx_element::gfx_element(palette_device &palette, const gfx_layout &gl, const uint8_t *srcdata, uint32_t xormask, uint32_t total_colors, uint32_t color_base) : m_palette(&palette), m_width(0), m_height(0), @@ -143,7 +143,7 @@ gfx_element::gfx_element(palette_device &palette, const gfx_layout &gl, const UI // set_layout - set the layout for a gfx_element //------------------------------------------------- -void gfx_element::set_layout(const gfx_layout &gl, const UINT8 *srcdata) +void gfx_element::set_layout(const gfx_layout &gl, const uint8_t *srcdata) { m_srcdata = srcdata; @@ -174,7 +174,7 @@ void gfx_element::set_layout(const gfx_layout &gl, const UINT8 *srcdata) // RAW graphics must have a pointer up front assert(srcdata != nullptr); - m_gfxdata = const_cast(srcdata); + m_gfxdata = const_cast(srcdata); } // decoded graphics case @@ -217,7 +217,7 @@ void gfx_element::set_layout(const gfx_layout &gl, const UINT8 *srcdata) // set_raw_layout - set the layout for a gfx_element //------------------------------------------------- -void gfx_element::set_raw_layout(const UINT8 *srcdata, UINT32 width, UINT32 height, UINT32 total, UINT32 linemod, UINT32 charmod) +void gfx_element::set_raw_layout(const uint8_t *srcdata, uint32_t width, uint32_t height, uint32_t total, uint32_t linemod, uint32_t charmod) { gfx_layout layout = { 0 }; layout.width = width; @@ -235,11 +235,11 @@ void gfx_element::set_raw_layout(const UINT8 *srcdata, UINT32 width, UINT32 heig // set_source - set the source data for a gfx_element //------------------------------------------------- -void gfx_element::set_source(const UINT8 *source) +void gfx_element::set_source(const uint8_t *source) { m_srcdata = source; memset(&m_dirty[0], 1, elements()); - if (m_layout_is_raw) m_gfxdata = const_cast(source); + if (m_layout_is_raw) m_gfxdata = const_cast(source); } @@ -248,7 +248,7 @@ void gfx_element::set_source(const UINT8 *source) // and total elements for a gfx_element //------------------------------------------------- -void gfx_element::set_source_and_total(const UINT8 *source, UINT32 total) +void gfx_element::set_source_and_total(const uint8_t *source, uint32_t total) { m_srcdata = source; m_total_elements = total; @@ -263,7 +263,7 @@ void gfx_element::set_source_and_total(const UINT8 *source, UINT32 total) if (m_layout_is_raw) { - m_gfxdata = const_cast(source); + m_gfxdata = const_cast(source); } else { @@ -278,7 +278,7 @@ void gfx_element::set_source_and_total(const UINT8 *source, UINT32 total) // set_source_clip - set a source clipping rect //------------------------------------------------- -void gfx_element::set_source_clip(UINT32 xoffs, UINT32 width, UINT32 yoffs, UINT32 height) +void gfx_element::set_source_clip(uint32_t xoffs, uint32_t width, uint32_t yoffs, uint32_t height) { assert(xoffs < m_origwidth); assert(yoffs < m_origheight); @@ -296,13 +296,13 @@ void gfx_element::set_source_clip(UINT32 xoffs, UINT32 width, UINT32 yoffs, UINT // decode - decode a single character //------------------------------------------------- -void gfx_element::decode(UINT32 code) +void gfx_element::decode(uint32_t code) { // don't decode GFX_RAW if (!m_layout_is_raw) { // zap the data to 0 - UINT8 *decode_base = m_gfxdata + code * m_char_modulo; + uint8_t *decode_base = m_gfxdata + code * m_char_modulo; memset(decode_base, 0, m_char_modulo); // iterate over planes @@ -317,7 +317,7 @@ void gfx_element::decode(UINT32 code) for (int y = 0; y < m_origheight; y++) { int yoffs = planeoffs + m_layout_yoffset[y]; - UINT8 *dp = decode_base + y * m_line_modulo; + uint8_t *dp = decode_base + y * m_line_modulo; // iterate over columns for (int x = 0; x < m_origwidth; x++) @@ -331,8 +331,8 @@ void gfx_element::decode(UINT32 code) if (code < m_pen_usage.size()) { // iterate over data, creating a bitmask of live pens - const UINT8 *dp = m_gfxdata + code * m_char_modulo; - UINT32 usage = 0; + const uint8_t *dp = m_gfxdata + code * m_char_modulo; + uint32_t usage = 0; for (int y = 0; y < m_origheight; y++) { for (int x = 0; x < m_origwidth; x++) @@ -360,21 +360,21 @@ void gfx_element::decode(UINT32 code) -------------------------------------------------*/ void gfx_element::opaque(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty) { color = colorbase() + granularity() * (color % colors()); code %= elements(); DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_OPAQUE, NO_PRIORITY); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_OPAQUE, NO_PRIORITY); } void gfx_element::opaque(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty) { const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); code %= elements(); DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); } @@ -384,8 +384,8 @@ void gfx_element::opaque(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::transpen(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t trans_pen) { // special case invalid pens to opaque if (trans_pen > 0xff) @@ -396,7 +396,7 @@ void gfx_element::transpen(bitmap_ind16 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~(1 << trans_pen)) == 0) return; @@ -408,12 +408,12 @@ void gfx_element::transpen(bitmap_ind16 &dest, const rectangle &cliprect, // render color = colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); } void gfx_element::transpen(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t trans_pen) { // special case invalid pens to opaque if (trans_pen > 0xff) @@ -424,7 +424,7 @@ void gfx_element::transpen(bitmap_rgb32 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~(1 << trans_pen)) == 0) return; @@ -436,7 +436,7 @@ void gfx_element::transpen(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY); } @@ -447,8 +447,8 @@ void gfx_element::transpen(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t trans_pen) { // early out if completely transparent code %= elements(); @@ -457,12 +457,12 @@ void gfx_element::transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, // render DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); } void gfx_element::transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t trans_pen) { // early out if completely transparent code %= elements(); @@ -471,7 +471,7 @@ void gfx_element::transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, // render DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT32, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); } @@ -482,8 +482,8 @@ void gfx_element::transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::transmask(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 trans_mask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t trans_mask) { // special case 0 mask to opaque if (trans_mask == 0) @@ -494,7 +494,7 @@ void gfx_element::transmask(bitmap_ind16 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~trans_mask) == 0) return; @@ -506,12 +506,12 @@ void gfx_element::transmask(bitmap_ind16 &dest, const rectangle &cliprect, // render color = colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSMASK, NO_PRIORITY); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_TRANSMASK, NO_PRIORITY); } void gfx_element::transmask(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 trans_mask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t trans_mask) { // special case 0 mask to opaque if (trans_mask == 0) @@ -522,7 +522,7 @@ void gfx_element::transmask(bitmap_rgb32 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~trans_mask) == 0) return; @@ -534,7 +534,7 @@ void gfx_element::transmask(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY); } @@ -545,8 +545,8 @@ void gfx_element::transmask(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::transtable(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - const UINT8 *pentable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + const uint8_t *pentable) { assert(pentable != nullptr); @@ -555,12 +555,12 @@ void gfx_element::transtable(bitmap_ind16 &dest, const rectangle &cliprect, const pen_t *shadowtable = m_palette->shadow_table(); code %= elements(); DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSTABLE16, NO_PRIORITY); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_TRANSTABLE16, NO_PRIORITY); } void gfx_element::transtable(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - const UINT8 *pentable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + const uint8_t *pentable) { assert(pentable != nullptr); @@ -569,7 +569,7 @@ void gfx_element::transtable(bitmap_rgb32 &dest, const rectangle &cliprect, const pen_t *shadowtable = m_palette->shadow_table(); code %= elements(); DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSTABLE32, NO_PRIORITY); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANSTABLE32, NO_PRIORITY); } @@ -580,8 +580,8 @@ void gfx_element::transtable(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::alpha(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 trans_pen, UINT8 alpha_val) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t trans_pen, uint8_t alpha_val) { // special case alpha = 0xff if (alpha_val == 0xff) @@ -595,7 +595,7 @@ void gfx_element::alpha(bitmap_rgb32 &dest, const rectangle &cliprect, // get final code and color, and grab lookup tables const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32, NO_PRIORITY); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN_ALPHA32, NO_PRIORITY); } @@ -610,8 +610,8 @@ void gfx_element::alpha(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -621,12 +621,12 @@ void gfx_element::zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, color = colorbase() + granularity() * (color % colors()); code %= elements(); DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_OPAQUE, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_OPAQUE, NO_PRIORITY); } void gfx_element::zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -636,7 +636,7 @@ void gfx_element::zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); code %= elements(); DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); } @@ -646,8 +646,8 @@ void gfx_element::zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, uint32_t trans_pen) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -662,7 +662,7 @@ void gfx_element::zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~(1 << trans_pen)) == 0) return; @@ -674,12 +674,12 @@ void gfx_element::zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, // render color = colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); } void gfx_element::zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, uint32_t trans_pen) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -694,7 +694,7 @@ void gfx_element::zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~(1 << trans_pen)) == 0) return; @@ -706,7 +706,7 @@ void gfx_element::zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY); } @@ -717,8 +717,8 @@ void gfx_element::zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, uint32_t trans_pen) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -731,12 +731,12 @@ void gfx_element::zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprec // render DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); } void gfx_element::zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, uint32_t trans_pen) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -749,7 +749,7 @@ void gfx_element::zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprec // render DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); } @@ -760,8 +760,8 @@ void gfx_element::zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprec -------------------------------------------------*/ void gfx_element::zoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, UINT32 trans_mask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, uint32_t trans_mask) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -776,7 +776,7 @@ void gfx_element::zoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~trans_mask) == 0) return; @@ -788,12 +788,12 @@ void gfx_element::zoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, // render color = colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSMASK, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_TRANSMASK, NO_PRIORITY); } void gfx_element::zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, UINT32 trans_mask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, uint32_t trans_mask) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -808,7 +808,7 @@ void gfx_element::zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~trans_mask) == 0) return; @@ -820,7 +820,7 @@ void gfx_element::zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY); } @@ -831,8 +831,8 @@ void gfx_element::zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::zoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, const UINT8 *pentable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, const uint8_t *pentable) { assert(pentable != nullptr); @@ -845,12 +845,12 @@ void gfx_element::zoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, const pen_t *shadowtable = m_palette->shadow_table(); code %= elements(); DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSTABLE16, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_TRANSTABLE16, NO_PRIORITY); } void gfx_element::zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, const UINT8 *pentable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, const uint8_t *pentable) { assert(pentable != nullptr); @@ -863,7 +863,7 @@ void gfx_element::zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, const pen_t *shadowtable = m_palette->shadow_table(); code %= elements(); DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSTABLE32, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_TRANSTABLE32, NO_PRIORITY); } @@ -874,8 +874,8 @@ void gfx_element::zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, UINT32 trans_pen, UINT8 alpha_val) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, uint32_t trans_pen, uint8_t alpha_val) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -893,7 +893,7 @@ void gfx_element::zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); DECLARE_NO_PRIORITY; - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32, NO_PRIORITY); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN_ALPHA32, NO_PRIORITY); } @@ -909,8 +909,8 @@ void gfx_element::zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::prio_opaque(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask) { // high bit of the mask is implicitly on pmask |= 1 << 31; @@ -918,12 +918,12 @@ void gfx_element::prio_opaque(bitmap_ind16 &dest, const rectangle &cliprect, // render color = colorbase() + granularity() * (color % colors()); code %= elements(); - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_OPAQUE_PRIORITY, UINT8); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_OPAQUE_PRIORITY, uint8_t); } void gfx_element::prio_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask) { // high bit of the mask is implicitly on pmask |= 1 << 31; @@ -931,7 +931,7 @@ void gfx_element::prio_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); code %= elements(); - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE_PRIORITY, UINT8); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_OPAQUE_PRIORITY, uint8_t); } @@ -942,8 +942,8 @@ void gfx_element::prio_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::prio_transpen(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, uint32_t trans_pen) { // special case invalid pens to opaque if (trans_pen > 0xff) @@ -954,7 +954,7 @@ void gfx_element::prio_transpen(bitmap_ind16 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~(1 << trans_pen)) == 0) return; @@ -968,12 +968,12 @@ void gfx_element::prio_transpen(bitmap_ind16 &dest, const rectangle &cliprect, // render color = colorbase() + granularity() * (color % colors()); - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, UINT8); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, uint8_t); } void gfx_element::prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, uint32_t trans_pen) { // special case invalid pens to opaque if (trans_pen > 0xff) @@ -984,7 +984,7 @@ void gfx_element::prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~(1 << trans_pen)) == 0) return; @@ -998,7 +998,7 @@ void gfx_element::prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, UINT8); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, uint8_t); } @@ -1009,8 +1009,8 @@ void gfx_element::prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::prio_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, uint32_t trans_pen) { // early out if completely transparent code %= elements(); @@ -1021,12 +1021,12 @@ void gfx_element::prio_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprec pmask |= 1 << 31; // render - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, UINT8); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, uint8_t); } void gfx_element::prio_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, uint32_t trans_pen) { // early out if completely transparent code %= elements(); @@ -1037,7 +1037,7 @@ void gfx_element::prio_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprec pmask |= 1 << 31; // render - DRAWGFX_CORE(UINT32, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, UINT8); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, uint8_t); } @@ -1048,8 +1048,8 @@ void gfx_element::prio_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprec -------------------------------------------------*/ void gfx_element::prio_transmask(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, UINT32 trans_mask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, uint32_t trans_mask) { // special case 0 mask to opaque if (trans_mask == 0) @@ -1060,7 +1060,7 @@ void gfx_element::prio_transmask(bitmap_ind16 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~trans_mask) == 0) return; @@ -1074,12 +1074,12 @@ void gfx_element::prio_transmask(bitmap_ind16 &dest, const rectangle &cliprect, // render color = colorbase() + granularity() * (color % colors()); - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSMASK_PRIORITY, UINT8); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_TRANSMASK_PRIORITY, uint8_t); } void gfx_element::prio_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, UINT32 trans_mask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, uint32_t trans_mask) { // special case 0 mask to opaque if (trans_mask == 0) @@ -1090,7 +1090,7 @@ void gfx_element::prio_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~trans_mask) == 0) return; @@ -1104,7 +1104,7 @@ void gfx_element::prio_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, UINT8); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, uint8_t); } @@ -1116,8 +1116,8 @@ void gfx_element::prio_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::prio_transtable(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, const uint8_t *pentable) { assert(pentable != nullptr); @@ -1128,12 +1128,12 @@ void gfx_element::prio_transtable(bitmap_ind16 &dest, const rectangle &cliprect, color = colorbase() + granularity() * (color % colors()); const pen_t *shadowtable = m_palette->shadow_table(); code %= elements(); - DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY, UINT8); + DRAWGFX_CORE(uint16_t, PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY, uint8_t); } void gfx_element::prio_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, const uint8_t *pentable) { assert(pentable != nullptr); @@ -1144,7 +1144,7 @@ void gfx_element::prio_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); const pen_t *shadowtable = m_palette->shadow_table(); code %= elements(); - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY, UINT8); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY, uint8_t); } @@ -1156,8 +1156,8 @@ void gfx_element::prio_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::prio_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, UINT32 trans_pen, UINT8 alpha_val) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, uint32_t trans_pen, uint8_t alpha_val) { // special case alpha = 0xff if (alpha_val == 0xff) @@ -1173,7 +1173,7 @@ void gfx_element::prio_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY, UINT8); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY, uint8_t); } @@ -1189,8 +1189,8 @@ void gfx_element::prio_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, -------------------------------------------------*/ void gfx_element::prio_zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -1202,12 +1202,12 @@ void gfx_element::prio_zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect // render color = colorbase() + granularity() * (color % colors()); code %= elements(); - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_OPAQUE_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_OPAQUE_PRIORITY, uint8_t); } void gfx_element::prio_zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -1219,7 +1219,7 @@ void gfx_element::prio_zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); code %= elements(); - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_OPAQUE_PRIORITY, uint8_t); } @@ -1230,9 +1230,9 @@ void gfx_element::prio_zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect -------------------------------------------------*/ void gfx_element::prio_zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + uint32_t trans_pen) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -1247,7 +1247,7 @@ void gfx_element::prio_zoom_transpen(bitmap_ind16 &dest, const rectangle &clipre if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~(1 << trans_pen)) == 0) return; @@ -1261,13 +1261,13 @@ void gfx_element::prio_zoom_transpen(bitmap_ind16 &dest, const rectangle &clipre // render color = colorbase() + granularity() * (color % colors()); - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, uint8_t); } void gfx_element::prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + uint32_t trans_pen) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -1282,7 +1282,7 @@ void gfx_element::prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &clipre if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~(1 << trans_pen)) == 0) return; @@ -1296,7 +1296,7 @@ void gfx_element::prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &clipre // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, uint8_t); } @@ -1308,9 +1308,9 @@ void gfx_element::prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &clipre -------------------------------------------------*/ void gfx_element::prio_zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + uint32_t trans_pen) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -1325,13 +1325,13 @@ void gfx_element::prio_zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cl pmask |= 1 << 31; // render - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, uint8_t); } void gfx_element::prio_zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + uint32_t trans_pen) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -1346,7 +1346,7 @@ void gfx_element::prio_zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cl pmask |= 1 << 31; // render - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, uint8_t); } @@ -1358,9 +1358,9 @@ void gfx_element::prio_zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cl -------------------------------------------------*/ void gfx_element::prio_zoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - UINT32 trans_mask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + uint32_t trans_mask) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -1375,7 +1375,7 @@ void gfx_element::prio_zoom_transmask(bitmap_ind16 &dest, const rectangle &clipr if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~trans_mask) == 0) return; @@ -1389,13 +1389,13 @@ void gfx_element::prio_zoom_transmask(bitmap_ind16 &dest, const rectangle &clipr // render color = colorbase() + granularity() * (color % colors()); - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSMASK_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_TRANSMASK_PRIORITY, uint8_t); } void gfx_element::prio_zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - UINT32 trans_mask) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + uint32_t trans_mask) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -1410,7 +1410,7 @@ void gfx_element::prio_zoom_transmask(bitmap_rgb32 &dest, const rectangle &clipr if (has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); if ((usage & ~trans_mask) == 0) return; @@ -1424,7 +1424,7 @@ void gfx_element::prio_zoom_transmask(bitmap_rgb32 &dest, const rectangle &clipr // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, uint8_t); } @@ -1436,9 +1436,9 @@ void gfx_element::prio_zoom_transmask(bitmap_rgb32 &dest, const rectangle &clipr -------------------------------------------------*/ void gfx_element::prio_zoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - const UINT8 *pentable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + const uint8_t *pentable) { assert(pentable != nullptr); @@ -1453,13 +1453,13 @@ void gfx_element::prio_zoom_transtable(bitmap_ind16 &dest, const rectangle &clip color = colorbase() + granularity() * (color % colors()); const pen_t *shadowtable = m_palette->shadow_table(); code %= elements(); - DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint16_t, PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY, uint8_t); } void gfx_element::prio_zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - const UINT8 *pentable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + const uint8_t *pentable) { assert(pentable != nullptr); @@ -1474,7 +1474,7 @@ void gfx_element::prio_zoom_transtable(bitmap_rgb32 &dest, const rectangle &clip const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); const pen_t *shadowtable = m_palette->shadow_table(); code %= elements(); - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY, uint8_t); } @@ -1487,9 +1487,9 @@ void gfx_element::prio_zoom_transtable(bitmap_rgb32 &dest, const rectangle &clip -------------------------------------------------*/ void gfx_element::prio_zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - UINT32 trans_pen, UINT8 alpha_val) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + uint32_t trans_pen, uint8_t alpha_val) { // non-zoom case if (scalex == 0x10000 && scaley == 0x10000) @@ -1509,21 +1509,21 @@ void gfx_element::prio_zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, // render const pen_t *paldata = m_palette->pens() + colorbase() + granularity() * (color % colors()); - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY, UINT8); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY, uint8_t); } #define PIXEL_OP_REMAP_TRANSPEN_PRIORITY_ADDIIVE32(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != trans_pen) \ { \ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \ { \ - UINT32 srcdata2 = paldata[srcdata]; \ + uint32_t srcdata2 = paldata[srcdata]; \ \ - UINT32 add; \ + uint32_t add; \ add = (srcdata2 & 0x00ff0000) + (DEST & 0x00ff0000); \ if (add & 0x01000000) DEST = (DEST & 0xff00ffff) | (0x00ff0000); \ else DEST = (DEST & 0xff00ffff) | (add & 0x00ff0000); \ @@ -1540,8 +1540,8 @@ do while (0) void gfx_element::prio_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - bitmap_ind8 &priority, UINT32 pmask, UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + bitmap_ind8 &priority, uint32_t pmask, uint32_t trans_pen) { const pen_t *paldata; @@ -1556,7 +1556,7 @@ void gfx_element::prio_transpen_additive(bitmap_rgb32 &dest, const rectangle &cl /* use pen usage to optimize */ if (has_pen_usage()) { - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); /* fully transparent; do nothing */ if ((usage & ~(1 << trans_pen)) == 0) @@ -1567,14 +1567,14 @@ void gfx_element::prio_transpen_additive(bitmap_rgb32 &dest, const rectangle &cl pmask |= 1 << 31; /* render based on dest bitmap depth */ - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY_ADDIIVE32, UINT8); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN_PRIORITY_ADDIIVE32, uint8_t); } void gfx_element::prio_zoom_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, - UINT32 trans_pen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, + uint32_t trans_pen) { const pen_t *paldata; @@ -1597,7 +1597,7 @@ void gfx_element::prio_zoom_transpen_additive(bitmap_rgb32 &dest, const rectangl /* use pen usage to optimize */ if (has_pen_usage()) { - UINT32 usage = pen_usage(code); + uint32_t usage = pen_usage(code); /* fully transparent; do nothing */ if ((usage & ~(1 << trans_pen)) == 0) @@ -1607,7 +1607,7 @@ void gfx_element::prio_zoom_transpen_additive(bitmap_rgb32 &dest, const rectangl /* high bit of the mask is implicitly on */ pmask |= 1 << 31; - DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY_ADDIIVE32, UINT8); + DRAWGFXZOOM_CORE(uint32_t, PIXEL_OP_REMAP_TRANSPEN_PRIORITY_ADDIIVE32, uint8_t); } //#define MAKE_ARGB_RGB(a, rgb) rgb_t(a, rgb.r(), rgb.g(), rgb.b()) @@ -1617,7 +1617,7 @@ void gfx_element::prio_zoom_transpen_additive(bitmap_rgb32 &dest, const rectangl #define PIXEL_OP_REMAP_TRANS0_ALPHASTORE32(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != 0) \ (DEST) = MAKE_ARGB_RGB(alpha,paldata[srcdata]); \ } \ @@ -1626,7 +1626,7 @@ while (0) #define PIXEL_OP_REMAP_TRANS0_ALPHATABLESTORE32(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != 0) \ (DEST) = MAKE_ARGB_RGB(alphatable[srcdata], paldata[srcdata]); \ } \ @@ -1635,7 +1635,7 @@ while (0) #define PIXEL_OP_REMAP_TRANS0_ALPHATABLE32(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != 0) \ (DEST) = alpha_blend_r32((DEST), paldata[srcdata], alphatable[srcdata]); \ } \ @@ -1647,8 +1647,8 @@ while (0) in alpha field of ARGB32, negative alpha implies alphatable -------------------------------------------------*/ void gfx_element::alphastore(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - int fixedalpha, UINT8 *alphatable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + int fixedalpha, uint8_t *alphatable) { DECLARE_NO_PRIORITY; const pen_t *paldata; @@ -1673,12 +1673,12 @@ void gfx_element::alphastore(bitmap_rgb32 &dest, const rectangle &cliprect, if (fixedalpha >= 0) { - UINT8 alpha = fixedalpha; - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANS0_ALPHASTORE32, NO_PRIORITY); + uint8_t alpha = fixedalpha; + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANS0_ALPHASTORE32, NO_PRIORITY); } else { - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANS0_ALPHATABLESTORE32, NO_PRIORITY); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANS0_ALPHATABLESTORE32, NO_PRIORITY); } } @@ -1688,8 +1688,8 @@ void gfx_element::alphastore(bitmap_rgb32 &dest, const rectangle &cliprect, the per-pen alphatable[] array -------------------------------------------------*/ void gfx_element::alphatable(bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - int fixedalpha ,UINT8 *alphatable) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + int fixedalpha ,uint8_t *alphatable) { DECLARE_NO_PRIORITY; @@ -1714,7 +1714,7 @@ void gfx_element::alphatable(bitmap_rgb32 &dest, const rectangle &cliprect, if (has_pen_usage() && (pen_usage(code) & ~(1 << 0)) == 0) return; - DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANS0_ALPHATABLE32, NO_PRIORITY); + DRAWGFX_CORE(uint32_t, PIXEL_OP_REMAP_TRANS0_ALPHATABLE32, NO_PRIORITY); } @@ -1727,30 +1727,30 @@ void gfx_element::alphatable(bitmap_rgb32 &dest, const rectangle &cliprect, buffer to a single scanline of a bitmap -------------------------------------------------*/ -void draw_scanline8(bitmap_ind16 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT8 *srcptr, const pen_t *paldata) +void draw_scanline8(bitmap_ind16 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint8_t *srcptr, const pen_t *paldata) { DECLARE_NO_PRIORITY; // palette lookup case if (paldata != nullptr) - DRAWSCANLINE_CORE(UINT16, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint16_t, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); // raw copy case else - DRAWSCANLINE_CORE(UINT16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint16_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } -void draw_scanline8(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT8 *srcptr, const pen_t *paldata) +void draw_scanline8(bitmap_rgb32 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint8_t *srcptr, const pen_t *paldata) { DECLARE_NO_PRIORITY; // palette lookup case if (paldata != nullptr) - DRAWSCANLINE_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint32_t, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); // raw copy case else - DRAWSCANLINE_CORE(UINT32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint32_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } @@ -1759,30 +1759,30 @@ void draw_scanline8(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length buffer to a single scanline of a bitmap -------------------------------------------------*/ -void draw_scanline16(bitmap_ind16 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT16 *srcptr, const pen_t *paldata) +void draw_scanline16(bitmap_ind16 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint16_t *srcptr, const pen_t *paldata) { DECLARE_NO_PRIORITY; // palette lookup case if (paldata != nullptr) - DRAWSCANLINE_CORE(UINT16, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint16_t, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); // raw copy case else - DRAWSCANLINE_CORE(UINT16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint16_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } -void draw_scanline16(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT16 *srcptr, const pen_t *paldata) +void draw_scanline16(bitmap_rgb32 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint16_t *srcptr, const pen_t *paldata) { DECLARE_NO_PRIORITY; // palette lookup case if (paldata != nullptr) - DRAWSCANLINE_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint32_t, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); // raw copy case else - DRAWSCANLINE_CORE(UINT32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint32_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } @@ -1791,30 +1791,30 @@ void draw_scanline16(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 lengt buffer to a single scanline of a bitmap -------------------------------------------------*/ -void draw_scanline32(bitmap_ind16 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT32 *srcptr, const pen_t *paldata) +void draw_scanline32(bitmap_ind16 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint32_t *srcptr, const pen_t *paldata) { DECLARE_NO_PRIORITY; // palette lookup case if (paldata != nullptr) - DRAWSCANLINE_CORE(UINT16, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint16_t, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); // raw copy case else - DRAWSCANLINE_CORE(UINT16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint16_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } -void draw_scanline32(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT32 *srcptr, const pen_t *paldata) +void draw_scanline32(bitmap_rgb32 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint32_t *srcptr, const pen_t *paldata) { DECLARE_NO_PRIORITY; // palette lookup case if (paldata != nullptr) - DRAWSCANLINE_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint32_t, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); // raw copy case else - DRAWSCANLINE_CORE(UINT32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + DRAWSCANLINE_CORE(uint32_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } @@ -1828,14 +1828,14 @@ void draw_scanline32(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 lengt scanline of a bitmap to an 8bpp buffer -------------------------------------------------*/ -void extract_scanline8(const bitmap_ind16 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT8 *destptr) +void extract_scanline8(const bitmap_ind16 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint8_t *destptr) { - EXTRACTSCANLINE_CORE(UINT16); + EXTRACTSCANLINE_CORE(uint16_t); } -void extract_scanline8(const bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT8 *destptr) +void extract_scanline8(const bitmap_rgb32 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint8_t *destptr) { - EXTRACTSCANLINE_CORE(UINT32); + EXTRACTSCANLINE_CORE(uint32_t); } @@ -1844,14 +1844,14 @@ void extract_scanline8(const bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 scanline of a bitmap to a 16bpp buffer -------------------------------------------------*/ -void extract_scanline16(const bitmap_ind16 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT16 *destptr) +void extract_scanline16(const bitmap_ind16 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint16_t *destptr) { - EXTRACTSCANLINE_CORE(UINT16); + EXTRACTSCANLINE_CORE(uint16_t); } -void extract_scanline16(const bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT16 *destptr) +void extract_scanline16(const bitmap_rgb32 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint16_t *destptr) { - EXTRACTSCANLINE_CORE(UINT32); + EXTRACTSCANLINE_CORE(uint32_t); } @@ -1860,14 +1860,14 @@ void extract_scanline16(const bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT3 scanline of a bitmap to a 32bpp buffer -------------------------------------------------*/ -void extract_scanline32(const bitmap_ind16 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT32 *destptr) +void extract_scanline32(const bitmap_ind16 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint32_t *destptr) { - EXTRACTSCANLINE_CORE(UINT16); + EXTRACTSCANLINE_CORE(uint16_t); } -void extract_scanline32(const bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT32 *destptr) +void extract_scanline32(const bitmap_rgb32 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint32_t *destptr) { - EXTRACTSCANLINE_CORE(UINT32); + EXTRACTSCANLINE_CORE(uint32_t); } @@ -1881,16 +1881,16 @@ void extract_scanline32(const bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT3 copying all unclipped pixels -------------------------------------------------*/ -void copybitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect) +void copybitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, int32_t destx, int32_t desty, const rectangle &cliprect) { DECLARE_NO_PRIORITY; - COPYBITMAP_CORE(UINT16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + COPYBITMAP_CORE(uint16_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } -void copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect) +void copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, int32_t destx, int32_t desty, const rectangle &cliprect) { DECLARE_NO_PRIORITY; - COPYBITMAP_CORE(UINT32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + COPYBITMAP_CORE(uint32_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } @@ -1900,22 +1900,22 @@ void copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flip those that match transpen -------------------------------------------------*/ -void copybitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 trans_pen) +void copybitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, int32_t destx, int32_t desty, const rectangle &cliprect, uint32_t trans_pen) { DECLARE_NO_PRIORITY; if (trans_pen > 0xffff) copybitmap(dest, src, flipx, flipy, destx, desty, cliprect); else - COPYBITMAP_CORE(UINT16, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY); + COPYBITMAP_CORE(uint16_t, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY); } -void copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 trans_pen) +void copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, int32_t destx, int32_t desty, const rectangle &cliprect, uint32_t trans_pen) { DECLARE_NO_PRIORITY; if (trans_pen == 0xffffffff) copybitmap(dest, src, flipx, flipy, destx, desty, cliprect); else - COPYBITMAP_CORE(UINT32, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY); + COPYBITMAP_CORE(uint32_t, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY); } @@ -1930,14 +1930,14 @@ void copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, in applying scrolling to one or more rows/columns -------------------------------------------------*/ -void copyscrollbitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect) +void copyscrollbitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, uint32_t numrows, const int32_t *rowscroll, uint32_t numcols, const int32_t *colscroll, const rectangle &cliprect) { // just call through to the transparent case as the underlying copybitmap will // optimize for pen == 0xffffffff copyscrollbitmap_trans(dest, src, numrows, rowscroll, numcols, colscroll, cliprect, 0xffffffff); } -void copyscrollbitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect) +void copyscrollbitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, uint32_t numrows, const int32_t *rowscroll, uint32_t numcols, const int32_t *colscroll, const rectangle &cliprect) { // just call through to the transparent case as the underlying copybitmap will // optimize for pen == 0xffffffff @@ -1953,7 +1953,7 @@ void copyscrollbitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, UINT32 numrow -------------------------------------------------*/ template -static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _BitmapClass &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 trans_pen) +static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _BitmapClass &src, uint32_t numrows, const int32_t *rowscroll, uint32_t numcols, const int32_t *colscroll, const rectangle &cliprect, uint32_t trans_pen) { // no rowscroll and no colscroll means no scroll if (numrows == 0 && numcols == 0) @@ -1967,19 +1967,19 @@ static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _Bitm // fully scrolling X,Y playfield if (numrows <= 1 && numcols <= 1) { - INT32 xscroll = normalize_xscroll(src, (numrows == 0) ? 0 : rowscroll[0]); - INT32 yscroll = normalize_yscroll(src, (numcols == 0) ? 0 : colscroll[0]); + int32_t xscroll = normalize_xscroll(src, (numrows == 0) ? 0 : rowscroll[0]); + int32_t yscroll = normalize_yscroll(src, (numcols == 0) ? 0 : colscroll[0]); // iterate over all portions of the scroll that overlap the destination - for (INT32 sx = xscroll - src.width(); sx < dest.width(); sx += src.width()) - for (INT32 sy = yscroll - src.height(); sy < dest.height(); sy += src.height()) + for (int32_t sx = xscroll - src.width(); sx < dest.width(); sx += src.width()) + for (int32_t sy = yscroll - src.height(); sy < dest.height(); sy += src.height()) copybitmap_trans(dest, src, 0, 0, sx, sy, cliprect, trans_pen); } // scrolling columns plus horizontal scroll else if (numrows <= 1) { - INT32 xscroll = normalize_xscroll(src, (numrows == 0) ? 0 : rowscroll[0]); + int32_t xscroll = normalize_xscroll(src, (numrows == 0) ? 0 : rowscroll[0]); rectangle subclip = cliprect; // determine width of each column @@ -1990,7 +1990,7 @@ static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _Bitm int groupcols; for (int col = 0; col < numcols; col += groupcols) { - INT32 yscroll = colscroll[col]; + int32_t yscroll = colscroll[col]; // count consecutive columns scrolled by the same amount for (groupcols = 1; col + groupcols < numcols; groupcols++) @@ -1999,7 +1999,7 @@ static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _Bitm // iterate over reps of the columns in question yscroll = normalize_yscroll(src, yscroll); - for (INT32 sx = xscroll - src.width(); sx < dest.width(); sx += src.width()) + for (int32_t sx = xscroll - src.width(); sx < dest.width(); sx += src.width()) { // compute the cliprect for this group subclip.min_x = col * colwidth + sx; @@ -2007,7 +2007,7 @@ static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _Bitm subclip &= cliprect; // iterate over all portions of the scroll that overlap the destination - for (INT32 sy = yscroll - src.height(); sy < dest.height(); sy += src.height()) + for (int32_t sy = yscroll - src.height(); sy < dest.height(); sy += src.height()) copybitmap_trans(dest, src, 0, 0, sx, sy, subclip, trans_pen); } } @@ -2016,7 +2016,7 @@ static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _Bitm // scrolling rows plus vertical scroll else if (numcols <= 1) { - INT32 yscroll = normalize_yscroll(src, (numcols == 0) ? 0 : colscroll[0]); + int32_t yscroll = normalize_yscroll(src, (numcols == 0) ? 0 : colscroll[0]); rectangle subclip = cliprect; // determine width of each rows @@ -2027,7 +2027,7 @@ static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _Bitm int grouprows; for (int row = 0; row < numrows; row += grouprows) { - INT32 xscroll = rowscroll[row]; + int32_t xscroll = rowscroll[row]; // count consecutive rows scrolled by the same amount for (grouprows = 1; row + grouprows < numrows; grouprows++) @@ -2036,7 +2036,7 @@ static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _Bitm // iterate over reps of the rows in question xscroll = normalize_xscroll(src, xscroll); - for (INT32 sy = yscroll - src.height(); sy < dest.height(); sy += src.height()) + for (int32_t sy = yscroll - src.height(); sy < dest.height(); sy += src.height()) { // compute the cliprect for this group subclip.min_y = row * rowheight + sy; @@ -2044,17 +2044,17 @@ static inline void copyscrollbitmap_trans_common(_BitmapClass &dest, const _Bitm subclip &= cliprect; // iterate over all portions of the scroll that overlap the destination - for (INT32 sx = xscroll - src.width(); sx < dest.width(); sx += src.width()) + for (int32_t sx = xscroll - src.width(); sx < dest.width(); sx += src.width()) copybitmap_trans(dest, src, 0, 0, sx, sy, subclip, trans_pen); } } } } -void copyscrollbitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 trans_pen) +void copyscrollbitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, uint32_t numrows, const int32_t *rowscroll, uint32_t numcols, const int32_t *colscroll, const rectangle &cliprect, uint32_t trans_pen) { copyscrollbitmap_trans_common(dest, src, numrows, rowscroll, numcols, colscroll, cliprect, trans_pen); } -void copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 trans_pen) +void copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, uint32_t numrows, const int32_t *rowscroll, uint32_t numcols, const int32_t *colscroll, const rectangle &cliprect, uint32_t trans_pen) { copyscrollbitmap_trans_common(dest, src, numrows, rowscroll, numcols, colscroll, cliprect, trans_pen); } @@ -2069,16 +2069,16 @@ void copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, UINT32 pixels -------------------------------------------------*/ -void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound) +void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, int32_t startx, int32_t starty, int32_t incxx, int32_t incxy, int32_t incyx, int32_t incyy, int wraparound) { DECLARE_NO_PRIORITY; - COPYROZBITMAP_CORE(UINT16, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + COPYROZBITMAP_CORE(uint16_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } -void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound) +void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, int32_t startx, int32_t starty, int32_t incxx, int32_t incxy, int32_t incyx, int32_t incyy, int wraparound) { DECLARE_NO_PRIORITY; - COPYROZBITMAP_CORE(UINT32, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); + COPYROZBITMAP_CORE(uint32_t, PIXEL_OP_COPY_OPAQUE, NO_PRIORITY); } @@ -2089,16 +2089,16 @@ void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_r transpen -------------------------------------------------*/ -void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 trans_pen) +void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, int32_t startx, int32_t starty, int32_t incxx, int32_t incxy, int32_t incyx, int32_t incyy, int wraparound, uint32_t trans_pen) { DECLARE_NO_PRIORITY; - COPYROZBITMAP_CORE(UINT16, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY); + COPYROZBITMAP_CORE(uint16_t, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY); } -void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 trans_pen) +void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, int32_t startx, int32_t starty, int32_t incxx, int32_t incxy, int32_t incyx, int32_t incyy, int wraparound, uint32_t trans_pen) { DECLARE_NO_PRIORITY; - COPYROZBITMAP_CORE(UINT32, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY); + COPYROZBITMAP_CORE(uint32_t, PIXEL_OP_COPY_TRANSPEN, NO_PRIORITY); } GFXDECODE_START( empty ) diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h index 71b480d0b17..762025b48c8 100644 --- a/src/emu/drawgfx.h +++ b/src/emu/drawgfx.h @@ -32,7 +32,7 @@ For example, to draw a sprite that appears over tilemap1, but under opaque pixels of tilemap2, tilemap3, and tilemap4: - UINT32 pmask = GFX_PMASK_2 | GFX_PMASK_4 | GFX_PMASK_8; + uint32_t pmask = GFX_PMASK_2 | GFX_PMASK_4 | GFX_PMASK_8; gfx->prio_transpen(bitmap, cliprect, code, color, flipx, flipy, @@ -74,7 +74,7 @@ a sprite over the first four tilemaps but under the higher numbered ones: - UINT32 pmask = (~1) << 4; + uint32_t pmask = (~1) << 4; gfx->prio_transpen(bitmap, cliprect, code, color, flipx, flipy, @@ -151,48 +151,48 @@ public: #ifdef UNUSED_FUNCTION gfx_element(); #endif - gfx_element(palette_device &palette, const gfx_layout &gl, const UINT8 *srcdata, UINT32 xormask, UINT32 total_colors, UINT32 color_base); - gfx_element(palette_device &palette, UINT8 *base, UINT16 width, UINT16 height, UINT32 rowbytes, UINT32 total_colors, UINT32 color_base, UINT32 color_granularity); + gfx_element(palette_device &palette, const gfx_layout &gl, const uint8_t *srcdata, uint32_t xormask, uint32_t total_colors, uint32_t color_base); + gfx_element(palette_device &palette, uint8_t *base, uint16_t width, uint16_t height, uint32_t rowbytes, uint32_t total_colors, uint32_t color_base, uint32_t color_granularity); // getters palette_device &palette() const { return *m_palette; } - UINT16 width() const { return m_width; } - UINT16 height() const { return m_height; } - UINT32 elements() const { return m_total_elements; } - UINT32 colorbase() const { return m_color_base; } - UINT16 depth() const { return m_color_depth; } - UINT16 granularity() const { return m_color_granularity; } - UINT32 colors() const { return m_total_colors; } - UINT32 rowbytes() const { return m_line_modulo; } + uint16_t width() const { return m_width; } + uint16_t height() const { return m_height; } + uint32_t elements() const { return m_total_elements; } + uint32_t colorbase() const { return m_color_base; } + uint16_t depth() const { return m_color_depth; } + uint16_t granularity() const { return m_color_granularity; } + uint32_t colors() const { return m_total_colors; } + uint32_t rowbytes() const { return m_line_modulo; } bool has_pen_usage() const { return !m_pen_usage.empty(); } // used by tilemaps - UINT32 dirtyseq() const { return m_dirtyseq; } + uint32_t dirtyseq() const { return m_dirtyseq; } // setters - void set_layout(const gfx_layout &gl, const UINT8 *srcdata); - void set_raw_layout(const UINT8 *srcdata, UINT32 width, UINT32 height, UINT32 total, UINT32 linemod, UINT32 charmod); - void set_source(const UINT8 *source); - void set_source_and_total(const UINT8 *source, UINT32 total); - void set_xormask(UINT32 xormask) { m_layout_xormask = xormask; } + void set_layout(const gfx_layout &gl, const uint8_t *srcdata); + void set_raw_layout(const uint8_t *srcdata, uint32_t width, uint32_t height, uint32_t total, uint32_t linemod, uint32_t charmod); + void set_source(const uint8_t *source); + void set_source_and_total(const uint8_t *source, uint32_t total); + void set_xormask(uint32_t xormask) { m_layout_xormask = xormask; } void set_palette(palette_device &palette) { m_palette = &palette; } - void set_colors(UINT32 colors) { m_total_colors = colors; } - void set_colorbase(UINT16 colorbase) { m_color_base = colorbase; } - void set_granularity(UINT16 granularity) { m_color_granularity = granularity; } - void set_source_clip(UINT32 xoffs, UINT32 width, UINT32 yoffs, UINT32 height); + void set_colors(uint32_t colors) { m_total_colors = colors; } + void set_colorbase(uint16_t colorbase) { m_color_base = colorbase; } + void set_granularity(uint16_t granularity) { m_color_granularity = granularity; } + void set_source_clip(uint32_t xoffs, uint32_t width, uint32_t yoffs, uint32_t height); // operations - void mark_dirty(UINT32 code) { if (code < elements()) { m_dirty[code] = 1; m_dirtyseq++; } } + void mark_dirty(uint32_t code) { if (code < elements()) { m_dirty[code] = 1; m_dirtyseq++; } } void mark_all_dirty() { memset(&m_dirty[0], 1, elements()); } - const UINT8 *get_data(UINT32 code) + const uint8_t *get_data(uint32_t code) { assert(code < elements()); if (code < m_dirty.size() && m_dirty[code]) decode(code); return m_gfxdata + code * m_char_modulo + m_starty * m_line_modulo + m_startx; } - UINT32 pen_usage(UINT32 code) + uint32_t pen_usage(uint32_t code) { assert(code < m_pen_usage.size()); if (m_dirty[code]) decode(code); @@ -202,106 +202,106 @@ public: // ----- core graphics drawing ----- // specific drawgfx implementations for each transparency type - void opaque(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty); - void opaque(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty); - void transpen(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); - void transpen(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); - void transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); - void transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); - void transmask(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transmask); - void transmask(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transmask); - void transtable(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, const UINT8 *pentable); - void transtable(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, const UINT8 *pentable); - void alpha(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen, UINT8 alpha); + void opaque(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty); + void opaque(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty); + void transpen(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t transpen); + void transpen(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t transpen); + void transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t transpen); + void transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t transpen); + void transmask(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t transmask); + void transmask(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t transmask); + void transtable(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, const uint8_t *pentable); + void transtable(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, const uint8_t *pentable); + void alpha(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t transpen, uint8_t alpha); // ----- zoomed graphics drawing ----- // specific zoom implementations for each transparency type - void zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley); - void zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley); - void zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); - void zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); - void zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); - void zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); - void zoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transmask); - void zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transmask); - void zoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, const UINT8 *pentable); - void zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, const UINT8 *pentable); - void zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen, UINT8 alpha); + void zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley); + void zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley); + void zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, uint32_t transpen); + void zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, uint32_t transpen); + void zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, uint32_t transpen); + void zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, uint32_t transpen); + void zoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, uint32_t transmask); + void zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, uint32_t transmask); + void zoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, const uint8_t *pentable); + void zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, const uint8_t *pentable); + void zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, uint32_t transpen, uint8_t alpha); // ----- priority masked graphics drawing ----- // specific prio implementations for each transparency type - void prio_opaque(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask); - void prio_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask); - void prio_transpen(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); - void prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); - void prio_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); - void prio_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); - void prio_transmask(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); - void prio_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); - void prio_transtable(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable); - void prio_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable); - void prio_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen, UINT8 alpha); + void prio_opaque(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask); + void prio_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask); + void prio_transpen(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen); + void prio_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen); + void prio_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen); + void prio_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen); + void prio_transmask(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, uint32_t transmask); + void prio_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, uint32_t transmask); + void prio_transtable(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, const uint8_t *pentable); + void prio_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, const uint8_t *pentable); + void prio_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen, uint8_t alpha); // ----- priority masked zoomed graphics drawing ----- // specific prio_zoom implementations for each transparency type - void prio_zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask); - void prio_zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask); - void prio_zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); - void prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); - void prio_zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); - void prio_zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); - void prio_zoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); - void prio_zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); - void prio_zoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable); - void prio_zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable); - void prio_zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen, UINT8 alpha); + void prio_zoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask); + void prio_zoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask); + void prio_zoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen); + void prio_zoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen); + void prio_zoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen); + void prio_zoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen); + void prio_zoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, uint32_t transmask); + void prio_zoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, uint32_t transmask); + void prio_zoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, const uint8_t *pentable); + void prio_zoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, const uint8_t *pentable); + void prio_zoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask, uint32_t transpen, uint8_t alpha); // implementations moved here from specific drivers - void prio_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 trans_pen); - void prio_zoom_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect,UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask,UINT32 trans_pen); - void alphastore(bitmap_rgb32 &dest, const rectangle &cliprect,UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,int fixedalpha, UINT8 *alphatable); - void alphatable(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, int fixedalpha ,UINT8 *alphatable); + void prio_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, bitmap_ind8 &priority, uint32_t pmask, uint32_t trans_pen); + void prio_zoom_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect,uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty,uint32_t scalex, uint32_t scaley, bitmap_ind8 &priority, uint32_t pmask,uint32_t trans_pen); + void alphastore(bitmap_rgb32 &dest, const rectangle &cliprect,uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty,int fixedalpha, uint8_t *alphatable); + void alphatable(bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, int fixedalpha ,uint8_t *alphatable); private: // internal helpers - void decode(UINT32 code); + void decode(uint32_t code); // internal state palette_device *m_palette; // palette used for drawing - UINT16 m_width; // current pixel width of each element (changeable with source clipping) - UINT16 m_height; // current pixel height of each element (changeable with source clipping) - UINT16 m_startx; // current source clip X offset - UINT16 m_starty; // current source clip Y offset + uint16_t m_width; // current pixel width of each element (changeable with source clipping) + uint16_t m_height; // current pixel height of each element (changeable with source clipping) + uint16_t m_startx; // current source clip X offset + uint16_t m_starty; // current source clip Y offset - UINT16 m_origwidth; // starting pixel width of each element - UINT16 m_origheight; // staring pixel height of each element - UINT32 m_total_elements; // total number of decoded elements + uint16_t m_origwidth; // starting pixel width of each element + uint16_t m_origheight; // staring pixel height of each element + uint32_t m_total_elements; // total number of decoded elements - UINT32 m_color_base; // base color for rendering - UINT16 m_color_depth; // number of colors each pixel can represent - UINT16 m_color_granularity; // number of colors for each color code - UINT32 m_total_colors; // number of color codes + uint32_t m_color_base; // base color for rendering + uint16_t m_color_depth; // number of colors each pixel can represent + uint16_t m_color_granularity; // number of colors for each color code + uint32_t m_total_colors; // number of color codes - UINT32 m_line_modulo; // bytes between each row of data - UINT32 m_char_modulo; // bytes between each element - const UINT8 * m_srcdata; // pointer to the source data for decoding - UINT32 m_dirtyseq; // sequence number; incremented each time a tile is dirtied + uint32_t m_line_modulo; // bytes between each row of data + uint32_t m_char_modulo; // bytes between each element + const uint8_t * m_srcdata; // pointer to the source data for decoding + uint32_t m_dirtyseq; // sequence number; incremented each time a tile is dirtied - UINT8 * m_gfxdata; // pointer to decoded pixel data, 8bpp - std::vector m_gfxdata_allocated; // allocated decoded pixel data, 8bpp - std::vector m_dirty; // dirty array for detecting chars that need decoding - std::vector m_pen_usage; // bitmask of pens that are used (pens 0-31 only) + uint8_t * m_gfxdata; // pointer to decoded pixel data, 8bpp + std::vector m_gfxdata_allocated; // allocated decoded pixel data, 8bpp + std::vector m_dirty; // dirty array for detecting chars that need decoding + std::vector m_pen_usage; // bitmask of pens that are used (pens 0-31 only) bool m_layout_is_raw; // raw layout? - UINT8 m_layout_planes; // bit planes in the layout - UINT32 m_layout_xormask; // xor mask applied to each bit offset - UINT32 m_layout_charincrement; // per-character increment in source data - std::vector m_layout_planeoffset;// plane offsets - std::vector m_layout_xoffset; // X offsets - std::vector m_layout_yoffset; // Y offsets + uint8_t m_layout_planes; // bit planes in the layout + uint32_t m_layout_xormask; // xor mask applied to each bit offset + uint32_t m_layout_charincrement; // per-character increment in source data + std::vector m_layout_planeoffset;// plane offsets + std::vector m_layout_xoffset; // X offsets + std::vector m_layout_yoffset; // Y offsets }; @@ -312,44 +312,44 @@ private: // ----- scanline copying ----- // copy pixels from an 8bpp buffer to a single scanline of a bitmap -void draw_scanline8(bitmap_ind16 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT8 *srcptr, const pen_t *paldata); -void draw_scanline8(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT8 *srcptr, const pen_t *paldata); +void draw_scanline8(bitmap_ind16 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint8_t *srcptr, const pen_t *paldata); +void draw_scanline8(bitmap_rgb32 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint8_t *srcptr, const pen_t *paldata); // copy pixels from a 16bpp buffer to a single scanline of a bitmap -void draw_scanline16(bitmap_ind16 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT16 *srcptr, const pen_t *paldata); -void draw_scanline16(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT16 *srcptr, const pen_t *paldata); +void draw_scanline16(bitmap_ind16 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint16_t *srcptr, const pen_t *paldata); +void draw_scanline16(bitmap_rgb32 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint16_t *srcptr, const pen_t *paldata); // copy pixels from a 32bpp buffer to a single scanline of a bitmap -void draw_scanline32(bitmap_ind16 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT32 *srcptr, const pen_t *paldata); -void draw_scanline32(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT32 *srcptr, const pen_t *paldata); +void draw_scanline32(bitmap_ind16 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint32_t *srcptr, const pen_t *paldata); +void draw_scanline32(bitmap_rgb32 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint32_t *srcptr, const pen_t *paldata); // ----- scanline extraction ----- // copy pixels from a single scanline of a bitmap to an 8bpp buffer -void extract_scanline8(const bitmap_ind16 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT8 *destptr); -void extract_scanline8(const bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT8 *destptr); +void extract_scanline8(const bitmap_ind16 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint8_t *destptr); +void extract_scanline8(const bitmap_rgb32 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint8_t *destptr); // copy pixels from a single scanline of a bitmap to a 16bpp buffer -void extract_scanline16(const bitmap_ind16 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT16 *destptr); -void extract_scanline16(const bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT16 *destptr); +void extract_scanline16(const bitmap_ind16 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint16_t *destptr); +void extract_scanline16(const bitmap_rgb32 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint16_t *destptr); // copy pixels from a single scanline of a bitmap to a 32bpp buffer -void extract_scanline32(const bitmap_ind16 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT32 *destptr); -void extract_scanline32(const bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT32 *destptr); +void extract_scanline32(const bitmap_ind16 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint32_t *destptr); +void extract_scanline32(const bitmap_rgb32 &bitmap, int32_t srcx, int32_t srcy, int32_t length, uint32_t *destptr); // ----- bitmap copying ----- // copy from one bitmap to another, copying all unclipped pixels -void copybitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect); -void copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect); +void copybitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, int32_t destx, int32_t desty, const rectangle &cliprect); +void copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, int32_t destx, int32_t desty, const rectangle &cliprect); // copy from one bitmap to another, copying all unclipped pixels except those that match transpen -void copybitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 transpen); -void copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 transpen); +void copybitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, int flipx, int flipy, int32_t destx, int32_t desty, const rectangle &cliprect, uint32_t transpen); +void copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, int32_t destx, int32_t desty, const rectangle &cliprect, uint32_t transpen); /* Copy a bitmap onto another with scroll and wraparound. @@ -364,12 +364,12 @@ void copybitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, in */ // copy from one bitmap to another, copying all unclipped pixels, and applying scrolling to one or more rows/columns -void copyscrollbitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect); -void copyscrollbitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect); +void copyscrollbitmap(bitmap_ind16 &dest, const bitmap_ind16 &src, uint32_t numrows, const int32_t *rowscroll, uint32_t numcols, const int32_t *colscroll, const rectangle &cliprect); +void copyscrollbitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, uint32_t numrows, const int32_t *rowscroll, uint32_t numcols, const int32_t *colscroll, const rectangle &cliprect); // copy from one bitmap to another, copying all unclipped pixels except those that match transpen, and applying scrolling to one or more rows/columns -void copyscrollbitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 transpen); -void copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 transpen); +void copyscrollbitmap_trans(bitmap_ind16 &dest, const bitmap_ind16 &src, uint32_t numrows, const int32_t *rowscroll, uint32_t numcols, const int32_t *colscroll, const rectangle &cliprect, uint32_t transpen); +void copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, uint32_t numrows, const int32_t *rowscroll, uint32_t numcols, const int32_t *colscroll, const rectangle &cliprect, uint32_t transpen); /* Copy a bitmap applying rotation, zooming, and arbitrary distortion. @@ -401,12 +401,12 @@ void copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, UINT32 */ // copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels -void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound); -void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound); +void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, int32_t startx, int32_t starty, int32_t incxx, int32_t incxy, int32_t incyx, int32_t incyy, int wraparound); +void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, int32_t startx, int32_t starty, int32_t incxx, int32_t incxy, int32_t incyx, int32_t incyy, int wraparound); // copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels whose values do not match transpen -void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 transparent_color); -void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 transparent_color); +void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, int32_t startx, int32_t starty, int32_t incxx, int32_t incxy, int32_t incyx, int32_t incyy, int wraparound, uint32_t transparent_color); +void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, int32_t startx, int32_t starty, int32_t incxx, int32_t incxy, int32_t incyx, int32_t incyy, int wraparound, uint32_t transparent_color); @@ -419,7 +419,7 @@ void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bi // 5-5-5 RGB pixels //------------------------------------------------- -inline UINT32 alpha_blend_r16(UINT32 d, UINT32 s, UINT8 level) +inline uint32_t alpha_blend_r16(uint32_t d, uint32_t s, uint8_t level) { int alphad = 256 - level; return ((((s & 0x001f) * level + (d & 0x001f) * alphad) >> 8)) | @@ -433,7 +433,7 @@ inline UINT32 alpha_blend_r16(UINT32 d, UINT32 s, UINT8 level) // 8-8-8 RGB pixels //------------------------------------------------- -inline UINT32 alpha_blend_r32(UINT32 d, UINT32 s, UINT8 level) +inline uint32_t alpha_blend_r32(uint32_t d, uint32_t s, uint8_t level) { int alphad = 256 - level; return ((((s & 0x0000ff) * level + (d & 0x0000ff) * alphad) >> 8)) | @@ -454,7 +454,7 @@ class gfxdecode_device : public device_t, public device_gfx_interface { public: // construction/destruction - gfxdecode_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gfxdecode_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_start() override {}; diff --git a/src/emu/drawgfxm.h b/src/emu/drawgfxm.h index 7e4e803c6c9..16af0e821b5 100644 --- a/src/emu/drawgfxm.h +++ b/src/emu/drawgfxm.h @@ -18,8 +18,8 @@ The second set of macros represents the core gfx/bitmap walking and rendering code. These macros generally take the target pixel - type (UINT8, UINT16, UINT32), one of the PIXEL_OP* macros, - and a priority bitmap pixel type (UINT8, UINT16, UINT32, or the + type (uint8_t, uint16_t, uint32_t), one of the PIXEL_OP* macros, + and a priority bitmap pixel type (uint8_t, uint16_t, uint32_t, or the special type NO_PRIORITY). Although the code may look inefficient at first, the compiler is @@ -88,7 +88,7 @@ while (0) #define PIXEL_OP_COPY_TRANSPEN(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != trans_pen) \ (DEST) = SOURCE; \ } \ @@ -145,7 +145,7 @@ while (0) #define PIXEL_OP_REMAP_TRANSPEN(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != trans_pen) \ (DEST) = paldata[srcdata]; \ } \ @@ -153,7 +153,7 @@ while (0) #define PIXEL_OP_REMAP_TRANSPEN_PRIORITY(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != trans_pen) \ { \ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \ @@ -172,7 +172,7 @@ while (0) #define PIXEL_OP_REBASE_TRANSPEN(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != trans_pen) \ (DEST) = color + srcdata; \ } \ @@ -180,7 +180,7 @@ while (0) #define PIXEL_OP_REBASE_TRANSPEN_PRIORITY(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != trans_pen) \ { \ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \ @@ -199,7 +199,7 @@ while (0) #define PIXEL_OP_REMAP_TRANSMASK(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (((trans_mask >> srcdata) & 1) == 0) \ (DEST) = paldata[srcdata]; \ } \ @@ -207,7 +207,7 @@ while (0) #define PIXEL_OP_REMAP_TRANSMASK_PRIORITY(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (((trans_mask >> srcdata) & 1) == 0) \ { \ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \ @@ -226,7 +226,7 @@ while (0) #define PIXEL_OP_REBASE_TRANSMASK(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (((trans_mask >> srcdata) & 1) == 0) \ (DEST) = color + srcdata; \ } \ @@ -234,7 +234,7 @@ while (0) #define PIXEL_OP_REBASE_TRANSMASK_PRIORITY(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (((trans_mask >> srcdata) & 1) == 0) \ { \ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \ @@ -263,8 +263,8 @@ while (0) #define PIXEL_OP_REBASE_TRANSTABLE16(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ - UINT32 entry = pentable[srcdata]; \ + uint32_t srcdata = (SOURCE); \ + uint32_t entry = pentable[srcdata]; \ if (entry != DRAWMODE_NONE) \ { \ if (entry == DRAWMODE_SOURCE) \ @@ -277,8 +277,8 @@ while (0) #define PIXEL_OP_REMAP_TRANSTABLE32(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ - UINT32 entry = pentable[srcdata]; \ + uint32_t srcdata = (SOURCE); \ + uint32_t entry = pentable[srcdata]; \ if (entry != DRAWMODE_NONE) \ { \ if (entry == DRAWMODE_SOURCE) \ @@ -291,11 +291,11 @@ while (0) #define PIXEL_OP_REBASE_TRANSTABLE16_PRIORITY(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ - UINT32 entry = pentable[srcdata]; \ + uint32_t srcdata = (SOURCE); \ + uint32_t entry = pentable[srcdata]; \ if (entry != DRAWMODE_NONE) \ { \ - UINT8 pridata = (PRIORITY); \ + uint8_t pridata = (PRIORITY); \ if (entry == DRAWMODE_SOURCE) \ { \ if (((1 << (pridata & 0x1f)) & pmask) == 0) \ @@ -313,11 +313,11 @@ while (0) #define PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ - UINT32 entry = pentable[srcdata]; \ + uint32_t srcdata = (SOURCE); \ + uint32_t entry = pentable[srcdata]; \ if (entry != DRAWMODE_NONE) \ { \ - UINT8 pridata = (PRIORITY); \ + uint8_t pridata = (PRIORITY); \ if (entry == DRAWMODE_SOURCE) \ { \ if (((1 << (pridata & 0x1f)) & pmask) == 0) \ @@ -344,7 +344,7 @@ while (0) #define PIXEL_OP_REMAP_TRANSPEN_ALPHA32(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != trans_pen) \ (DEST) = alpha_blend_r32((DEST), paldata[srcdata], alpha_val); \ } \ @@ -352,7 +352,7 @@ while (0) #define PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY(DEST, PRIORITY, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != trans_pen) \ { \ if (((1 << ((PRIORITY) & 0x1f)) & pmask) == 0) \ @@ -373,12 +373,12 @@ while (0) bitmap_t &dest - the bitmap to render to const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') gfx_element *gfx - pointer to the gfx_element to render - UINT32 code - index of the entry within gfx_element - UINT32 color - index of the color within gfx_element + uint32_t code - index of the entry within gfx_element + uint32_t color - index of the color within gfx_element int flipx - non-zero means render right-to-left instead of left-to-right int flipy - non-zero means render bottom-to-top instead of top-to-bottom - INT32 destx - the top-left X coordinate to render to - INT32 desty - the top-left Y coordinate to render to + int32_t destx - the top-left X coordinate to render to + int32_t desty - the top-left Y coordinate to render to bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy) */ @@ -387,11 +387,11 @@ while (0) do { \ g_profiler.start(PROFILER_DRAWGFX); \ do { \ - const UINT8 *srcdata; \ - INT32 destendx, destendy; \ - INT32 srcx, srcy; \ - INT32 curx, cury; \ - INT32 dy; \ + const uint8_t *srcdata; \ + int32_t destendx, destendy; \ + int32_t srcx, srcy; \ + int32_t curx, cury; \ + int32_t dy; \ \ assert(dest.valid()); \ assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority.valid()); \ @@ -452,8 +452,8 @@ do { srcdata = get_data(code); \ \ /* compute how many blocks of 4 pixels we have */ \ - UINT32 numblocks = (destendx + 1 - destx) / 4; \ - UINT32 leftovers = (destendx + 1 - destx) - 4 * numblocks; \ + uint32_t numblocks = (destendx + 1 - destx) / 4; \ + uint32_t leftovers = (destendx + 1 - destx) - 4 * numblocks; \ \ /* adjust srcdata to point to the first source pixel of the row */ \ srcdata += srcy * rowbytes() + srcx; \ @@ -466,7 +466,7 @@ do { { \ PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \ PIXEL_TYPE *destptr = &dest.pixt(cury, destx); \ - const UINT8 *srcptr = srcdata; \ + const uint8_t *srcptr = srcdata; \ srcdata += dy; \ \ /* iterate over unrolled blocks of 4 */ \ @@ -501,7 +501,7 @@ do { { \ PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \ PIXEL_TYPE *destptr = &dest.pixt(cury, destx); \ - const UINT8 *srcptr = srcdata; \ + const uint8_t *srcptr = srcdata; \ srcdata += dy; \ \ /* iterate over unrolled blocks of 4 */ \ @@ -543,14 +543,14 @@ do { bitmap_t &dest - the bitmap to render to const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') gfx_element *gfx - pointer to the gfx_element to render - UINT32 code - index of the entry within gfx_element - UINT32 color - index of the color within gfx_element + uint32_t code - index of the entry within gfx_element + uint32_t color - index of the color within gfx_element int flipx - non-zero means render right-to-left instead of left-to-right int flipy - non-zero means render bottom-to-top instead of top-to-bottom - INT32 destx - the top-left X coordinate to render to - INT32 desty - the top-left Y coordinate to render to - UINT32 scalex - the 16.16 scale factor in the X dimension - UINT32 scaley - the 16.16 scale factor in the Y dimension + int32_t destx - the top-left X coordinate to render to + int32_t desty - the top-left Y coordinate to render to + uint32_t scalex - the 16.16 scale factor in the X dimension + uint32_t scaley - the 16.16 scale factor in the Y dimension bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy) */ @@ -559,12 +559,12 @@ do { do { \ g_profiler.start(PROFILER_DRAWGFX); \ do { \ - const UINT8 *srcdata; \ - UINT32 dstwidth, dstheight; \ - INT32 destendx, destendy; \ - INT32 srcx, srcy; \ - INT32 curx, cury; \ - INT32 dx, dy; \ + const uint8_t *srcdata; \ + uint32_t dstwidth, dstheight; \ + int32_t destendx, destendy; \ + int32_t srcx, srcy; \ + int32_t curx, cury; \ + int32_t dx, dy; \ \ assert(dest.valid()); \ assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority.valid()); \ @@ -639,16 +639,16 @@ do { srcdata = get_data(code); \ \ /* compute how many blocks of 4 pixels we have */ \ - UINT32 numblocks = (destendx + 1 - destx) / 4; \ - UINT32 leftovers = (destendx + 1 - destx) - 4 * numblocks; \ + uint32_t numblocks = (destendx + 1 - destx) / 4; \ + uint32_t leftovers = (destendx + 1 - destx) - 4 * numblocks; \ \ /* iterate over pixels in Y */ \ for (cury = desty; cury <= destendy; cury++) \ { \ PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \ PIXEL_TYPE *destptr = &dest.pixt(cury, destx); \ - const UINT8 *srcptr = srcdata + (srcy >> 16) * rowbytes(); \ - INT32 cursrcx = srcx; \ + const uint8_t *srcptr = srcdata + (srcy >> 16) * rowbytes(); \ + int32_t cursrcx = srcx; \ srcy += dy; \ \ /* iterate over unrolled blocks of 4 */ \ @@ -694,8 +694,8 @@ do { const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') int flipx - non-zero means render right-to-left instead of left-to-right int flipy - non-zero means render bottom-to-top instead of top-to-bottom - INT32 destx - the top-left X coordinate to copy to - INT32 desty - the top-left Y coordinate to copy to + int32_t destx - the top-left X coordinate to copy to + int32_t desty - the top-left Y coordinate to copy to bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy) */ @@ -704,11 +704,11 @@ do { g_profiler.start(PROFILER_COPYBITMAP); \ do { \ const PIXEL_TYPE *srcdata; \ - UINT32 numblocks, leftovers; \ - INT32 destendx, destendy; \ - INT32 srcx, srcy; \ - INT32 curx, cury; \ - INT32 dx, dy; \ + uint32_t numblocks, leftovers; \ + int32_t destendx, destendy; \ + int32_t srcx, srcy; \ + int32_t curx, cury; \ + int32_t dx, dy; \ \ assert(dest.valid()); \ assert(src.valid()); \ @@ -863,21 +863,21 @@ do { bitmap_t &dest - the bitmap to copy to bitmap_t &src - the bitmap to copy from (must be same bpp as dest) const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') - INT32 destx - the 16.16 source X position at destination pixel (0,0) - INT32 desty - the 16.16 source Y position at destination pixel (0,0) - INT32 incxx - the 16.16 amount to increment in source X for each destination X pixel - INT32 incyx - the 16.16 amount to increment in source Y for each destination X pixel - INT32 incxy - the 16.16 amount to increment in source X for each destination Y pixel - INT32 incyy - the 16.16 amount to increment in source Y for each destination Y pixel + int32_t destx - the 16.16 source X position at destination pixel (0,0) + int32_t desty - the 16.16 source Y position at destination pixel (0,0) + int32_t incxx - the 16.16 amount to increment in source X for each destination X pixel + int32_t incyx - the 16.16 amount to increment in source Y for each destination X pixel + int32_t incxy - the 16.16 amount to increment in source X for each destination Y pixel + int32_t incyy - the 16.16 amount to increment in source Y for each destination Y pixel int wraparound - non-zero means wrap when hitting the edges of the source bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy) */ #define COPYROZBITMAP_CORE(PIXEL_TYPE, PIXEL_OP, PRIORITY_TYPE) \ do { \ - UINT32 srcfixwidth, srcfixheight; \ - UINT32 numblocks, leftovers; \ - INT32 curx, cury; \ + uint32_t srcfixwidth, srcfixheight; \ + uint32_t numblocks, leftovers; \ + int32_t curx, cury; \ \ g_profiler.start(PROFILER_COPYBITMAP); \ \ @@ -916,32 +916,32 @@ do { PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.min_x); \ PIXEL_TYPE *destptr = &dest.pixt(cury, cliprect.min_x); \ const PIXEL_TYPE *srcptr; \ - INT32 srcx = startx; \ - INT32 srcy = starty; \ + int32_t srcx = startx; \ + int32_t srcy = starty; \ \ starty += incyy; \ \ /* check srcy for the whole row at once */ \ - if ((UINT32)srcy < srcfixheight) \ + if ((uint32_t)srcy < srcfixheight) \ { \ srcptr = &src.pixt(srcy >> 16); \ \ /* iterate over unrolled blocks of 4 */ \ for (curx = 0; curx < numblocks; curx++) \ { \ - if ((UINT32)srcx < srcfixwidth) \ + if ((uint32_t)srcx < srcfixwidth) \ PIXEL_OP(destptr[0], priptr[0], srcptr[srcx >> 16]); \ srcx += incxx; \ \ - if ((UINT32)srcx < srcfixwidth) \ + if ((uint32_t)srcx < srcfixwidth) \ PIXEL_OP(destptr[1], priptr[1], srcptr[srcx >> 16]); \ srcx += incxx; \ \ - if ((UINT32)srcx < srcfixwidth) \ + if ((uint32_t)srcx < srcfixwidth) \ PIXEL_OP(destptr[2], priptr[2], srcptr[srcx >> 16]); \ srcx += incxx; \ \ - if ((UINT32)srcx < srcfixwidth) \ + if ((uint32_t)srcx < srcfixwidth) \ PIXEL_OP(destptr[3], priptr[3], srcptr[srcx >> 16]); \ srcx += incxx; \ \ @@ -952,7 +952,7 @@ do { /* iterate over leftover pixels */ \ for (curx = 0; curx < leftovers; curx++) \ { \ - if ((UINT32)srcx < srcfixwidth) \ + if ((uint32_t)srcx < srcfixwidth) \ PIXEL_OP(destptr[0], priptr[0], srcptr[srcx >> 16]); \ srcx += incxx; \ destptr++; \ @@ -977,7 +977,7 @@ do { PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.min_x); \ PIXEL_TYPE *destptr = &dest.pixt(cury, cliprect.min_x); \ const PIXEL_TYPE *srcptr = &src.pixt(starty >> 16); \ - INT32 srcx = startx; \ + int32_t srcx = startx; \ \ starty = (starty + incyy) & srcfixheight; \ \ @@ -1024,8 +1024,8 @@ do { PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.min_x); \ PIXEL_TYPE *destptr = &dest.pixt(cury, cliprect.min_x); \ const PIXEL_TYPE *srcptr; \ - INT32 srcx = startx; \ - INT32 srcy = starty; \ + int32_t srcx = startx; \ + int32_t srcy = starty; \ \ startx += incyx; \ starty += incyy; \ @@ -1033,7 +1033,7 @@ do { /* iterate over unrolled blocks of 4 */ \ for (curx = 0; curx < numblocks; curx++) \ { \ - if ((UINT32)srcx < srcfixwidth && (UINT32)srcy < srcfixheight) \ + if ((uint32_t)srcx < srcfixwidth && (uint32_t)srcy < srcfixheight) \ { \ srcptr = &src.pixt(srcy >> 16, srcx >> 16); \ PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \ @@ -1041,7 +1041,7 @@ do { srcx += incxx; \ srcy += incxy; \ \ - if ((UINT32)srcx < srcfixwidth && (UINT32)srcy < srcfixheight) \ + if ((uint32_t)srcx < srcfixwidth && (uint32_t)srcy < srcfixheight) \ { \ srcptr = &src.pixt(srcy >> 16, srcx >> 16); \ PIXEL_OP(destptr[1], priptr[1], srcptr[0]); \ @@ -1049,7 +1049,7 @@ do { srcx += incxx; \ srcy += incxy; \ \ - if ((UINT32)srcx < srcfixwidth && (UINT32)srcy < srcfixheight) \ + if ((uint32_t)srcx < srcfixwidth && (uint32_t)srcy < srcfixheight) \ { \ srcptr = &src.pixt(srcy >> 16, srcx >> 16); \ PIXEL_OP(destptr[2], priptr[2], srcptr[0]); \ @@ -1057,7 +1057,7 @@ do { srcx += incxx; \ srcy += incxy; \ \ - if ((UINT32)srcx < srcfixwidth && (UINT32)srcy < srcfixheight) \ + if ((uint32_t)srcx < srcfixwidth && (uint32_t)srcy < srcfixheight) \ { \ srcptr = &src.pixt(srcy >> 16, srcx >> 16); \ PIXEL_OP(destptr[3], priptr[3], srcptr[0]); \ @@ -1072,7 +1072,7 @@ do { /* iterate over leftover pixels */ \ for (curx = 0; curx < leftovers; curx++) \ { \ - if ((UINT32)srcx < srcfixwidth && (UINT32)srcy < srcfixheight) \ + if ((uint32_t)srcx < srcfixwidth && (uint32_t)srcy < srcfixheight) \ { \ srcptr = &src.pixt(srcy >> 16, srcx >> 16); \ PIXEL_OP(destptr[0], priptr[0], srcptr[0]); \ @@ -1100,8 +1100,8 @@ do { PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.min_x); \ PIXEL_TYPE *destptr = &dest.pixt(cury, cliprect.min_x); \ const PIXEL_TYPE *srcptr; \ - INT32 srcx = startx; \ - INT32 srcy = starty; \ + int32_t srcx = startx; \ + int32_t srcy = starty; \ \ startx = (startx + incyx) & srcfixwidth; \ starty = (starty + incyy) & srcfixheight; \ @@ -1159,9 +1159,9 @@ do { Assumed input parameters or local variables: bitmap_t &bitmap - the bitmap to copy to - INT32 destx - the X coordinate to copy to - INT32 desty - the Y coordinate to copy to - INT32 length - the total number of pixels to copy + int32_t destx - the X coordinate to copy to + int32_t desty - the Y coordinate to copy to + int32_t length - the total number of pixels to copy const UINTx *srcptr - pointer to memory containing the source pixels bitmap_t &priority - the priority bitmap (even if PRIORITY_TYPE is NO_PRIORITY, at least needs a dummy) */ @@ -1215,9 +1215,9 @@ do { Assumed input parameters: bitmap_t &bitmap - the bitmap to extract from - INT32 srcx - the X coordinate to begin extraction - INT32 srcy - the Y coordinate to begin extraction - INT32 length - the total number of pixels to extract + int32_t srcx - the X coordinate to begin extraction + int32_t srcy - the Y coordinate to begin extraction + int32_t length - the total number of pixels to extract UINTx *destptr - pointer to memory to receive the extracted pixels */ diff --git a/src/emu/drivenum.cpp b/src/emu/drivenum.cpp index 5f67013c603..4f111d35f0f 100644 --- a/src/emu/drivenum.cpp +++ b/src/emu/drivenum.cpp @@ -92,7 +92,7 @@ int driver_list::penalty_compare(const char *source, const char *target) for ( ; *source && *target; target++) { // do a case insensitive match - bool match = (tolower((UINT8)*source) == tolower((UINT8)*target)); + bool match = (tolower((uint8_t)*source) == tolower((uint8_t)*target)); // if we matched, advance the source if (match) diff --git a/src/emu/driver.cpp b/src/emu/driver.cpp index ba48683eb91..b6365bc261e 100644 --- a/src/emu/driver.cpp +++ b/src/emu/driver.cpp @@ -281,7 +281,7 @@ const address_space_config *driver_device::memory_space_config(address_spacenum // irq_pulse_clear - clear a "pulsed" IRQ line //------------------------------------------------- -void driver_device::irq_pulse_clear(void *ptr, INT32 param) +void driver_device::irq_pulse_clear(void *ptr, int32_t param) { device_execute_interface *exec = reinterpret_cast(ptr); int irqline = param; @@ -390,7 +390,7 @@ void driver_device::updateflip() // flip_screen_set - set global flip //------------------------------------------------- -void driver_device::flip_screen_set(UINT32 on) +void driver_device::flip_screen_set(uint32_t on) { // normalize to all 1 if (on) @@ -410,7 +410,7 @@ void driver_device::flip_screen_set(UINT32 on) // do not call updateflip. //------------------------------------------------- -void driver_device::flip_screen_set_no_update(UINT32 on) +void driver_device::flip_screen_set_no_update(uint32_t on) { // flip_screen_y is not updated on purpose // this function is for drivers which @@ -426,7 +426,7 @@ void driver_device::flip_screen_set_no_update(UINT32 on) // flip_screen_x_set - set global horizontal flip //------------------------------------------------- -void driver_device::flip_screen_x_set(UINT32 on) +void driver_device::flip_screen_x_set(uint32_t on) { // normalize to all 1 if (on) @@ -445,7 +445,7 @@ void driver_device::flip_screen_x_set(UINT32 on) // flip_screen_y_set - set global vertical flip //------------------------------------------------- -void driver_device::flip_screen_y_set(UINT32 on) +void driver_device::flip_screen_y_set(uint32_t on) { // normalize to all 1 if (on) diff --git a/src/emu/driver.h b/src/emu/driver.h index 27cd8bb9518..2b63367ddb1 100644 --- a/src/emu/driver.h +++ b/src/emu/driver.h @@ -181,13 +181,13 @@ public: // generic video - void flip_screen_set(UINT32 on); - void flip_screen_set_no_update(UINT32 on); - void flip_screen_x_set(UINT32 on); - void flip_screen_y_set(UINT32 on); - UINT32 flip_screen() const { return m_flip_screen_x; } - UINT32 flip_screen_x() const { return m_flip_screen_x; } - UINT32 flip_screen_y() const { return m_flip_screen_y; } + void flip_screen_set(uint32_t on); + void flip_screen_set_no_update(uint32_t on); + void flip_screen_x_set(uint32_t on); + void flip_screen_y_set(uint32_t on); + uint32_t flip_screen() const { return m_flip_screen_x; } + uint32_t flip_screen_x() const { return m_flip_screen_x; } + uint32_t flip_screen_y() const { return m_flip_screen_y; } // generic input port helpers DECLARE_CUSTOM_INPUT_MEMBER( custom_port_read ); @@ -219,7 +219,7 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; private: // helpers - void irq_pulse_clear(void *ptr, INT32 param); + void irq_pulse_clear(void *ptr, int32_t param); void updateflip(); // configuration state @@ -230,14 +230,14 @@ private: driver_callback_delegate m_callbacks[CB_COUNT]; // start/reset callbacks // generic video - UINT8 m_flip_screen_x; - UINT8 m_flip_screen_y; + uint8_t m_flip_screen_x; + uint8_t m_flip_screen_y; }; // this template function creates a stub which constructs a device template -device_t *driver_device_creator(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +device_t *driver_device_creator(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) { assert(owner == nullptr); assert(clock == 0); diff --git a/src/emu/drivers/empty.cpp b/src/emu/drivers/empty.cpp index 86ba96bf2dc..ec325bb67e2 100644 --- a/src/emu/drivers/empty.cpp +++ b/src/emu/drivers/empty.cpp @@ -30,7 +30,7 @@ public: emulator_info::display_ui_chooser(machine()); } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black); return 0; diff --git a/src/emu/drivers/testcpu.cpp b/src/emu/drivers/testcpu.cpp index 51bfa457694..c52222f6e1a 100644 --- a/src/emu/drivers/testcpu.cpp +++ b/src/emu/drivers/testcpu.cpp @@ -40,7 +40,7 @@ public: // timer callback; used to wrest control of the system virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override { - static const UINT32 sample_instructions[] = + static const uint32_t sample_instructions[] = { 0x3d40f900, // li r10,0xf9000000 0x394af000, // addi r10,r10,-0x1000 @@ -108,7 +108,7 @@ public: void dump_state(bool disassemble) { char buffer[256]; - UINT8 instruction[32]; + uint8_t instruction[32]; buffer[0] = 0; int bytes = 0; if (disassemble) @@ -123,7 +123,7 @@ public: } // output the registers - printf("PC : %08X", UINT32(m_cpu->state_int(PPC_PC))); + printf("PC : %08X", uint32_t(m_cpu->state_int(PPC_PC))); if (disassemble && bytes > 0) { printf(" => "); @@ -134,12 +134,12 @@ public: printf("\n"); for (int regnum = 0; regnum < 32; regnum++) { - printf("R%-2d: %08X ", regnum, UINT32(m_cpu->state_int(PPC_R0 + regnum))); + printf("R%-2d: %08X ", regnum, uint32_t(m_cpu->state_int(PPC_R0 + regnum))); if (regnum % 4 == 3) printf("\n"); } printf("CR : %08X LR : %08X CTR: %08X XER: %08X\n", - UINT32(m_cpu->state_int(PPC_CR)), UINT32(m_cpu->state_int(PPC_LR)), - UINT32(m_cpu->state_int(PPC_CTR)), UINT32(m_cpu->state_int(PPC_XER))); + uint32_t(m_cpu->state_int(PPC_CR)), uint32_t(m_cpu->state_int(PPC_LR)), + uint32_t(m_cpu->state_int(PPC_CTR)), uint32_t(m_cpu->state_int(PPC_XER))); for (int regnum = 0; regnum < 32; regnum++) { printf("F%-2d: %10g ", regnum, u2d(m_cpu->state_int(PPC_F0 + regnum))); @@ -150,8 +150,8 @@ public: // report reads from anywhere READ64_MEMBER( general_r ) { - UINT64 fulloffs = offset; - UINT64 result = fulloffs + (fulloffs << 8) + (fulloffs << 16) + (fulloffs << 24) + (fulloffs << 32); + uint64_t fulloffs = offset; + uint64_t result = fulloffs + (fulloffs << 8) + (fulloffs << 16) + (fulloffs << 24) + (fulloffs << 32); printf("Read from %08X & %08X%08X = %08X%08X\n", offset * 8, (int)((mem_mask&0xffffffff00000000LL) >> 32) , (int)(mem_mask&0xffffffff), (int)((result&0xffffffff00000000LL) >> 32), (int)(result&0xffffffff)); return result; } @@ -165,7 +165,7 @@ public: private: // internal state required_device m_cpu; - required_shared_ptr m_ram; + required_shared_ptr m_ram; address_space *m_space; }; diff --git a/src/emu/emualloc.cpp b/src/emu/emualloc.cpp index 39f42378499..7d87dad0a28 100644 --- a/src/emu/emualloc.cpp +++ b/src/emu/emualloc.cpp @@ -23,7 +23,7 @@ // GLOBALS //************************************************************************** -UINT64 resource_pool::s_id = 0; +uint64_t resource_pool::s_id = 0; @@ -75,7 +75,7 @@ void resource_pool::add(resource_pool_item &item, size_t size, const char *type) // before, so if we don't find it, check 4 bytes ahead item.m_id = ++s_id; if (LOG_ALLOCS) - fprintf(stderr, "#%06d, add %s, %d bytes\n", (UINT32)item.m_id, type, UINT32(size)); + fprintf(stderr, "#%06d, add %s, %d bytes\n", (uint32_t)item.m_id, type, uint32_t(size)); // find the entry to insert after resource_pool_item *insert_after; @@ -143,7 +143,7 @@ void resource_pool::remove(void *ptr) // delete the object and break if (LOG_ALLOCS) - fprintf(stderr, "#%06d, delete %d bytes\n", (UINT32)deleteme->m_id, static_cast(deleteme->m_size)); + fprintf(stderr, "#%06d, delete %d bytes\n", (uint32_t)deleteme->m_id, static_cast(deleteme->m_size)); global_free(deleteme); break; } @@ -177,8 +177,8 @@ resource_pool_item *resource_pool::find(void *ptr) bool resource_pool::contains(void *_ptrstart, void *_ptrend) { - UINT8 *ptrstart = reinterpret_cast(_ptrstart); - UINT8 *ptrend = reinterpret_cast(_ptrend); + uint8_t *ptrstart = reinterpret_cast(_ptrstart); + uint8_t *ptrend = reinterpret_cast(_ptrend); // search for the item std::lock_guard lock(m_listlock); @@ -186,8 +186,8 @@ bool resource_pool::contains(void *_ptrstart, void *_ptrend) resource_pool_item *item = nullptr; for (item = m_ordered_head; item != nullptr; item = item->m_ordered_next) { - UINT8 *objstart = reinterpret_cast(item->m_ptr); - UINT8 *objend = objstart + item->m_size; + uint8_t *objstart = reinterpret_cast(item->m_ptr); + uint8_t *objend = objstart + item->m_size; if (ptrstart >= objstart && ptrend <= objend) return true; } diff --git a/src/emu/emualloc.h b/src/emu/emualloc.h index 37b5c63d860..44e39e199ad 100644 --- a/src/emu/emualloc.h +++ b/src/emu/emualloc.h @@ -49,7 +49,7 @@ public: m_ordered_prev(nullptr), m_ptr(ptr), m_size(size), - m_id(~(UINT64)0) { } + m_id(~(uint64_t)0) { } virtual ~resource_pool_item() { } resource_pool_item * m_next; @@ -57,7 +57,7 @@ public: resource_pool_item * m_ordered_prev; void * m_ptr; size_t m_size; - UINT64 m_id; + uint64_t m_id; }; @@ -129,7 +129,7 @@ private: std::vector m_hash; resource_pool_item * m_ordered_head; resource_pool_item * m_ordered_tail; - static UINT64 s_id; + static uint64_t s_id; }; diff --git a/src/emu/emucore.h b/src/emu/emucore.h index cf4d77acd27..b3c4bebfbba 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -59,10 +59,10 @@ typedef void genf(void); // pen_t is used to represent pixel values in bitmaps -typedef UINT32 pen_t; +typedef uint32_t pen_t; // stream_sample_t is used to represent a single sample in a sound stream -typedef INT32 stream_sample_t; +typedef int32_t stream_sample_t; // running_machine is core to pretty much everything class running_machine; @@ -78,14 +78,14 @@ union generic_ptr { generic_ptr(void *value) { v = value; } void * v; - INT8 * i8; - UINT8 * u8; - INT16 * i16; - UINT16 * u16; - INT32 * i32; - UINT32 * u32; - INT64 * i64; - UINT64 * u64; + int8_t * i8; + uint8_t * u8; + int16_t * i16; + uint16_t * u16; + int32_t * i32; + uint32_t * u32; + int64_t * i64; + uint64_t * u64; }; @@ -93,18 +93,18 @@ union generic_ptr union PAIR { #ifdef LSB_FIRST - struct { UINT8 l,h,h2,h3; } b; - struct { UINT16 l,h; } w; - struct { INT8 l,h,h2,h3; } sb; - struct { INT16 l,h; } sw; + struct { uint8_t l,h,h2,h3; } b; + struct { uint16_t l,h; } w; + struct { int8_t l,h,h2,h3; } sb; + struct { int16_t l,h; } sw; #else - struct { UINT8 h3,h2,h,l; } b; - struct { INT8 h3,h2,h,l; } sb; - struct { UINT16 h,l; } w; - struct { INT16 h,l; } sw; + struct { uint8_t h3,h2,h,l; } b; + struct { int8_t h3,h2,h,l; } sb; + struct { uint16_t h,l; } w; + struct { int16_t h,l; } sw; #endif - UINT32 d; - INT32 sd; + uint32_t d; + int32_t sd; }; @@ -112,14 +112,14 @@ union PAIR union PAIR16 { #ifdef LSB_FIRST - struct { UINT8 l,h; } b; - struct { INT8 l,h; } sb; + struct { uint8_t l,h; } b; + struct { int8_t l,h; } sb; #else - struct { UINT8 h,l; } b; - struct { INT8 h,l; } sb; + struct { uint8_t h,l; } b; + struct { int8_t h,l; } sb; #endif - UINT16 w; - INT16 sw; + uint16_t w; + int16_t sw; }; @@ -127,22 +127,22 @@ union PAIR16 union PAIR64 { #ifdef LSB_FIRST - struct { UINT8 l,h,h2,h3,h4,h5,h6,h7; } b; - struct { UINT16 l,h,h2,h3; } w; - struct { UINT32 l,h; } d; - struct { INT8 l,h,h2,h3,h4,h5,h6,h7; } sb; - struct { INT16 l,h,h2,h3; } sw; - struct { INT32 l,h; } sd; + struct { uint8_t l,h,h2,h3,h4,h5,h6,h7; } b; + struct { uint16_t l,h,h2,h3; } w; + struct { uint32_t l,h; } d; + struct { int8_t l,h,h2,h3,h4,h5,h6,h7; } sb; + struct { int16_t l,h,h2,h3; } sw; + struct { int32_t l,h; } sd; #else - struct { UINT8 h7,h6,h5,h4,h3,h2,h,l; } b; - struct { UINT16 h3,h2,h,l; } w; - struct { UINT32 h,l; } d; - struct { INT8 h7,h6,h5,h4,h3,h2,h,l; } sb; - struct { INT16 h3,h2,h,l; } sw; - struct { INT32 h,l; } sd; + struct { uint8_t h7,h6,h5,h4,h3,h2,h,l; } b; + struct { uint16_t h3,h2,h,l; } w; + struct { uint32_t h,l; } d; + struct { int8_t h7,h6,h5,h4,h3,h2,h,l; } sb; + struct { int16_t h3,h2,h,l; } sw; + struct { int32_t h,l; } sd; #endif - UINT64 q; - INT64 sq; + uint64_t q; + int64_t sq; }; @@ -380,7 +380,7 @@ enum_value(T value) noexcept // population count #if !defined(__NetBSD__) -inline int popcount(UINT32 val) +inline int popcount(uint32_t val) { int count; @@ -392,11 +392,11 @@ inline int popcount(UINT32 val) // convert a series of 32 bits into a float -inline float u2f(UINT32 v) +inline float u2f(uint32_t v) { union { float ff; - UINT32 vv; + uint32_t vv; } u; u.vv = v; return u.ff; @@ -404,11 +404,11 @@ inline float u2f(UINT32 v) // convert a float into a series of 32 bits -inline UINT32 f2u(float f) +inline uint32_t f2u(float f) { union { float ff; - UINT32 vv; + uint32_t vv; } u; u.ff = f; return u.vv; @@ -416,11 +416,11 @@ inline UINT32 f2u(float f) // convert a series of 64 bits into a double -inline double u2d(UINT64 v) +inline double u2d(uint64_t v) { union { double dd; - UINT64 vv; + uint64_t vv; } u; u.vv = v; return u.dd; @@ -428,11 +428,11 @@ inline double u2d(UINT64 v) // convert a double into a series of 64 bits -inline UINT64 d2u(double d) +inline uint64_t d2u(double d) { union { double dd; - UINT64 vv; + uint64_t vv; } u; u.dd = d; return u.vv; diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index fbbc20eb2a4..729386bfcb5 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -198,14 +198,14 @@ core_i64_hex_format - i64 format printf helper -------------------------------------------------*/ -static char *core_i64_hex_format(UINT64 value, UINT8 mindigits) +static char *core_i64_hex_format(uint64_t value, uint8_t mindigits) { static char buffer[16][64]; // TODO: this can overflow - e.g. when a lot of unmapped writes are logged static int index; char *bufbase = &buffer[index++ % 16][0]; char *bufptr = bufbase; - INT8 curdigit; + int8_t curdigit; for (curdigit = 15; curdigit >= 0; curdigit--) { @@ -263,7 +263,7 @@ class handler_entry protected: // construction/destruction - handler_entry(UINT8 width, endianness_t endianness, UINT8 **rambaseptr); + handler_entry(uint8_t width, endianness_t endianness, uint8_t **rambaseptr); virtual ~handler_entry(); public: @@ -282,7 +282,7 @@ public: offs_t byteoffset(offs_t byteaddress) const { return (byteaddress - m_bytestart) & m_bytemask; } // return a pointer to the backing RAM at the given offset - UINT8 *ramptr(offs_t offset = 0) const { return *m_rambaseptr + offset; } + uint8_t *ramptr(offs_t offset = 0) const { return *m_rambaseptr + offset; } // see if we are an exact match to the given parameters bool matches_exactly(offs_t bytestart, offs_t byteend, offs_t bytemask) const @@ -328,36 +328,36 @@ public: // apply a global mask void apply_mask(offs_t bytemask) { m_bytemask &= bytemask; } - void clear_conflicting_subunits(UINT64 handlermask); - bool overriden_by_mask(UINT64 handlermask); + void clear_conflicting_subunits(uint64_t handlermask); + bool overriden_by_mask(uint64_t handlermask); protected: // Subunit description information struct subunit_info { offs_t m_bytemask; // bytemask for this subunit - UINT32 m_mask; // mask (ff, ffff or ffffffff) - INT32 m_offset; // offset to add to the address - UINT32 m_multiplier; // multiplier to the pre-split address - UINT8 m_size; // size (8, 16 or 32) - UINT8 m_shift; // shift of the subunit + uint32_t m_mask; // mask (ff, ffff or ffffffff) + int32_t m_offset; // offset to add to the address + uint32_t m_multiplier; // multiplier to the pre-split address + uint8_t m_size; // size (8, 16 or 32) + uint8_t m_shift; // shift of the subunit }; // internal helpers - void configure_subunits(UINT64 handlermask, int handlerbits, int &start_slot, int &end_slot); + void configure_subunits(uint64_t handlermask, int handlerbits, int &start_slot, int &end_slot); virtual void remove_subunit(int entry) = 0; // internal state bool m_populated; // populated? - UINT8 m_datawidth; + uint8_t m_datawidth; endianness_t m_endianness; offs_t m_bytestart; // byte-adjusted start address for handler offs_t m_byteend; // byte-adjusted end address for handler offs_t m_bytemask; // byte-adjusted mask against the final address - UINT8 ** m_rambaseptr; // pointer to the bank base - UINT8 m_subunits; // for width stubs, the number of subunits + uint8_t ** m_rambaseptr; // pointer to the bank base + uint8_t m_subunits; // for width stubs, the number of subunits subunit_info m_subunit_infos[8]; // for width stubs, the associated subunit info - UINT64 m_invsubmask; // inverted mask of the populated subunits + uint64_t m_invsubmask; // inverted mask of the populated subunits }; @@ -377,7 +377,7 @@ public: }; // construction/destruction - handler_entry_read(UINT8 width, endianness_t endianness, UINT8 **rambaseptr) + handler_entry_read(uint8_t width, endianness_t endianness, uint8_t **rambaseptr) : handler_entry(width, endianness, rambaseptr), m_ioport(nullptr) { @@ -390,25 +390,25 @@ public: virtual const char *subunit_name(int entry) const override; // configure delegate callbacks - void set_delegate(read8_delegate delegate, UINT64 mask = 0); - void set_delegate(read16_delegate delegate, UINT64 mask = 0); - void set_delegate(read32_delegate delegate, UINT64 mask = 0); - void set_delegate(read64_delegate delegate, UINT64 mask = 0); + void set_delegate(read8_delegate delegate, uint64_t mask = 0); + void set_delegate(read16_delegate delegate, uint64_t mask = 0); + void set_delegate(read32_delegate delegate, uint64_t mask = 0); + void set_delegate(read64_delegate delegate, uint64_t mask = 0); // configure I/O port access void set_ioport(ioport_port &ioport); // read via the underlying delegates - UINT8 read8(address_space &space, offs_t offset, UINT8 mask) const { return m_read.r8(space, offset, mask); } - UINT16 read16(address_space &space, offs_t offset, UINT16 mask) const { return m_read.r16(space, offset, mask); } - UINT32 read32(address_space &space, offs_t offset, UINT32 mask) const { return m_read.r32(space, offset, mask); } - UINT64 read64(address_space &space, offs_t offset, UINT64 mask) const { return m_read.r64(space, offset, mask); } + uint8_t read8(address_space &space, offs_t offset, uint8_t mask) const { return m_read.r8(space, offset, mask); } + uint16_t read16(address_space &space, offs_t offset, uint16_t mask) const { return m_read.r16(space, offset, mask); } + uint32_t read32(address_space &space, offs_t offset, uint32_t mask) const { return m_read.r32(space, offset, mask); } + uint64_t read64(address_space &space, offs_t offset, uint64_t mask) const { return m_read.r64(space, offset, mask); } private: // stubs for converting between address sizes - UINT16 read_stub_16(address_space &space, offs_t offset, UINT16 mask); - UINT32 read_stub_32(address_space &space, offs_t offset, UINT32 mask); - UINT64 read_stub_64(address_space &space, offs_t offset, UINT64 mask); + uint16_t read_stub_16(address_space &space, offs_t offset, uint16_t mask); + uint32_t read_stub_32(address_space &space, offs_t offset, uint32_t mask); + uint64_t read_stub_64(address_space &space, offs_t offset, uint64_t mask); // stubs for reading I/O ports template @@ -440,7 +440,7 @@ public: }; // construction/destruction - handler_entry_write(UINT8 width, endianness_t endianness, UINT8 **rambaseptr) + handler_entry_write(uint8_t width, endianness_t endianness, uint8_t **rambaseptr) : handler_entry(width, endianness, rambaseptr), m_ioport(nullptr) { @@ -453,25 +453,25 @@ public: virtual const char *subunit_name(int entry) const override; // configure delegate callbacks - void set_delegate(write8_delegate delegate, UINT64 mask = 0); - void set_delegate(write16_delegate delegate, UINT64 mask = 0); - void set_delegate(write32_delegate delegate, UINT64 mask = 0); - void set_delegate(write64_delegate delegate, UINT64 mask = 0); + void set_delegate(write8_delegate delegate, uint64_t mask = 0); + void set_delegate(write16_delegate delegate, uint64_t mask = 0); + void set_delegate(write32_delegate delegate, uint64_t mask = 0); + void set_delegate(write64_delegate delegate, uint64_t mask = 0); // configure I/O port access void set_ioport(ioport_port &ioport); // write via the underlying delegates - void write8(address_space &space, offs_t offset, UINT8 data, UINT8 mask) const { m_write.w8(space, offset, data, mask); } - void write16(address_space &space, offs_t offset, UINT16 data, UINT16 mask) const { m_write.w16(space, offset, data, mask); } - void write32(address_space &space, offs_t offset, UINT32 data, UINT32 mask) const { m_write.w32(space, offset, data, mask); } - void write64(address_space &space, offs_t offset, UINT64 data, UINT64 mask) const { m_write.w64(space, offset, data, mask); } + void write8(address_space &space, offs_t offset, uint8_t data, uint8_t mask) const { m_write.w8(space, offset, data, mask); } + void write16(address_space &space, offs_t offset, uint16_t data, uint16_t mask) const { m_write.w16(space, offset, data, mask); } + void write32(address_space &space, offs_t offset, uint32_t data, uint32_t mask) const { m_write.w32(space, offset, data, mask); } + void write64(address_space &space, offs_t offset, uint64_t data, uint64_t mask) const { m_write.w64(space, offset, data, mask); } private: // stubs for converting between address sizes - void write_stub_16(address_space &space, offs_t offset, UINT16 data, UINT16 mask); - void write_stub_32(address_space &space, offs_t offset, UINT32 data, UINT32 mask); - void write_stub_64(address_space &space, offs_t offset, UINT64 data, UINT64 mask); + void write_stub_16(address_space &space, offs_t offset, uint16_t data, uint16_t mask); + void write_stub_32(address_space &space, offs_t offset, uint32_t data, uint32_t mask); + void write_stub_64(address_space &space, offs_t offset, uint64_t data, uint64_t mask); // stubs for writing I/O ports template @@ -505,7 +505,7 @@ public: void setoffset(address_space &space, offs_t offset) const { if (m_setoffset.has_object()) m_setoffset(space, offset); } // configure delegate callbacks - void set_delegate(setoffset_delegate delegate, UINT64 mask = 0) { m_setoffset = delegate; } + void set_delegate(setoffset_delegate delegate, uint64_t mask = 0) { m_setoffset = delegate; } private: setoffset_delegate m_setoffset; @@ -522,7 +522,7 @@ template class handler_entry_proxy { public: - handler_entry_proxy(std::list<_HandlerEntry *> _handlers, UINT64 _mask) : handlers(std::move(_handlers)), mask(_mask) {} + handler_entry_proxy(std::list<_HandlerEntry *> _handlers, uint64_t _mask) : handlers(std::move(_handlers)), mask(_mask) {} handler_entry_proxy(const handler_entry_proxy<_HandlerEntry> &hep) : handlers(hep.handlers), mask(hep.mask) {} // forward delegate callbacks configuration @@ -539,7 +539,7 @@ public: private: std::list<_HandlerEntry *> handlers; - UINT64 mask; + uint64_t mask; }; @@ -564,35 +564,35 @@ public: virtual ~address_table(); // getters - virtual handler_entry &handler(UINT32 index) const = 0; + virtual handler_entry &handler(uint32_t index) const = 0; bool watchpoints_enabled() const { return (m_live_lookup == s_watchpoint_table); } // address lookups - UINT32 lookup_live(offs_t byteaddress) const { return m_large ? lookup_live_large(byteaddress) : lookup_live_small(byteaddress); } - UINT32 lookup_live_small(offs_t byteaddress) const { return m_live_lookup[byteaddress]; } + uint32_t lookup_live(offs_t byteaddress) const { return m_large ? lookup_live_large(byteaddress) : lookup_live_small(byteaddress); } + uint32_t lookup_live_small(offs_t byteaddress) const { return m_live_lookup[byteaddress]; } - UINT32 lookup_live_large(offs_t byteaddress) const + uint32_t lookup_live_large(offs_t byteaddress) const { - UINT32 entry = m_live_lookup[level1_index_large(byteaddress)]; + uint32_t entry = m_live_lookup[level1_index_large(byteaddress)]; if (entry >= SUBTABLE_BASE) entry = m_live_lookup[level2_index_large(entry, byteaddress)]; return entry; } - UINT32 lookup_live_nowp(offs_t byteaddress) const { return m_large ? lookup_live_large_nowp(byteaddress) : lookup_live_small_nowp(byteaddress); } - UINT32 lookup_live_small_nowp(offs_t byteaddress) const { return m_table[byteaddress]; } + uint32_t lookup_live_nowp(offs_t byteaddress) const { return m_large ? lookup_live_large_nowp(byteaddress) : lookup_live_small_nowp(byteaddress); } + uint32_t lookup_live_small_nowp(offs_t byteaddress) const { return m_table[byteaddress]; } - UINT32 lookup_live_large_nowp(offs_t byteaddress) const + uint32_t lookup_live_large_nowp(offs_t byteaddress) const { - UINT32 entry = m_table[level1_index_large(byteaddress)]; + uint32_t entry = m_table[level1_index_large(byteaddress)]; if (entry >= SUBTABLE_BASE) entry = m_table[level2_index_large(entry, byteaddress)]; return entry; } - UINT32 lookup(offs_t byteaddress) const + uint32_t lookup(offs_t byteaddress) const { - UINT32 entry = m_live_lookup[level1_index(byteaddress)]; + uint32_t entry = m_live_lookup[level1_index(byteaddress)]; if (entry >= SUBTABLE_BASE) entry = m_live_lookup[level2_index(entry, byteaddress)]; return entry; @@ -602,37 +602,37 @@ public: void enable_watchpoints(bool enable = true) { m_live_lookup = enable ? s_watchpoint_table : &m_table[0]; } // table mapping helpers - void map_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, UINT16 staticentry); - void setup_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, UINT64 mask, std::list &entries); - UINT16 derive_range(offs_t byteaddress, offs_t &bytestart, offs_t &byteend) const; + void map_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, uint16_t staticentry); + void setup_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, uint64_t mask, std::list &entries); + uint16_t derive_range(offs_t byteaddress, offs_t &bytestart, offs_t &byteend) const; // misc helpers void mask_all_handlers(offs_t mask); - const char *handler_name(UINT16 entry) const; + const char *handler_name(uint16_t entry) const; protected: // determine table indexes based on the address - UINT32 level1_index_large(offs_t address) const { return address >> LEVEL2_BITS; } - UINT32 level2_index_large(UINT16 l1entry, offs_t address) const { return (1 << LEVEL1_BITS) + ((l1entry - SUBTABLE_BASE) << LEVEL2_BITS) + (address & ((1 << LEVEL2_BITS) - 1)); } - UINT32 level1_index(offs_t address) const { return m_large ? level1_index_large(address) : address; } - UINT32 level2_index(UINT16 l1entry, offs_t address) const { return m_large ? level2_index_large(l1entry, address) : 0; } + uint32_t level1_index_large(offs_t address) const { return address >> LEVEL2_BITS; } + uint32_t level2_index_large(uint16_t l1entry, offs_t address) const { return (1 << LEVEL1_BITS) + ((l1entry - SUBTABLE_BASE) << LEVEL2_BITS) + (address & ((1 << LEVEL2_BITS) - 1)); } + uint32_t level1_index(offs_t address) const { return m_large ? level1_index_large(address) : address; } + uint32_t level2_index(uint16_t l1entry, offs_t address) const { return m_large ? level2_index_large(l1entry, address) : 0; } // table population/depopulation - void populate_range_mirrored(offs_t bytestart, offs_t byteend, offs_t bytemirror, UINT16 handler); - void populate_range(offs_t bytestart, offs_t byteend, UINT16 handler); + void populate_range_mirrored(offs_t bytestart, offs_t byteend, offs_t bytemirror, uint16_t handler); + void populate_range(offs_t bytestart, offs_t byteend, uint16_t handler); // subtable management - UINT16 subtable_alloc(); - void subtable_realloc(UINT16 subentry); + uint16_t subtable_alloc(); + void subtable_realloc(uint16_t subentry); int subtable_merge(); - void subtable_release(UINT16 subentry); - UINT16 *subtable_open(offs_t l1index); + void subtable_release(uint16_t subentry); + uint16_t *subtable_open(offs_t l1index); void subtable_close(offs_t l1index); - UINT16 *subtable_ptr(UINT16 entry) { return &m_table[level2_index(entry, 0)]; } + uint16_t *subtable_ptr(uint16_t entry) { return &m_table[level2_index(entry, 0)]; } // internal state - std::vector m_table; // pointer to base of table - UINT16 * m_live_lookup; // current lookup + std::vector m_table; // pointer to base of table + uint16_t * m_live_lookup; // current lookup address_space & m_space; // pointer back to the space bool m_large; // large memory model? @@ -646,32 +646,32 @@ protected: m_usecount(0) { } bool m_checksum_valid; // is the checksum valid - UINT32 m_checksum; // checksum over all the bytes - UINT32 m_usecount; // number of times this has been used + uint32_t m_checksum; // checksum over all the bytes + uint32_t m_usecount; // number of times this has been used }; std::vector m_subtable; // info about each subtable - UINT16 m_subtable_alloc; // number of subtables allocated + uint16_t m_subtable_alloc; // number of subtables allocated // static global read-only watchpoint table - static UINT16 s_watchpoint_table[1 << LEVEL1_BITS]; + static uint16_t s_watchpoint_table[1 << LEVEL1_BITS]; private: int handler_refcount[SUBTABLE_BASE-STATIC_COUNT]; - UINT16 handler_next_free[SUBTABLE_BASE-STATIC_COUNT]; - UINT16 handler_free; - UINT16 get_free_handler(); + uint16_t handler_next_free[SUBTABLE_BASE-STATIC_COUNT]; + uint16_t handler_free; + uint16_t get_free_handler(); void verify_reference_counts(); - void setup_range_solid(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, std::list &entries); - void setup_range_masked(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT64 mask, std::list &entries); + void setup_range_solid(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, std::list &entries); + void setup_range_masked(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, uint64_t mask, std::list &entries); - void handler_ref(UINT16 entry, int count) + void handler_ref(uint16_t entry, int count) { assert(entry < SUBTABLE_BASE); if (entry >= STATIC_COUNT) handler_refcount[entry - STATIC_COUNT] += count; } - void handler_unref(UINT16 entry) + void handler_unref(uint16_t entry) { assert(entry < SUBTABLE_BASE); if (entry >= STATIC_COUNT) @@ -696,15 +696,15 @@ public: virtual ~address_table_read(); // getters - virtual handler_entry &handler(UINT32 index) const override; - handler_entry_read &handler_read(UINT32 index) const { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; } + virtual handler_entry &handler(uint32_t index) const override; + handler_entry_read &handler_read(uint32_t index) const { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; } // range getter - handler_entry_proxy handler_map_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, UINT64 mask = 0) { - std::list entries; + handler_entry_proxy handler_map_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, uint64_t mask = 0) { + std::list entries; setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries); std::list handlers; - for (std::list::const_iterator i = entries.begin(); i != entries.end(); ++i) + for (std::list::const_iterator i = entries.begin(); i != entries.end(); ++i) handlers.push_back(&handler_read(*i)); return handler_entry_proxy(handlers, mask); } @@ -740,7 +740,7 @@ private: { m_space.device().debug()->memory_read_hook(m_space, offset * sizeof(_UintType), mask); - UINT16 *oldtable = m_live_lookup; + uint16_t *oldtable = m_live_lookup; m_live_lookup = &m_table[0]; _UintType result; if (sizeof(_UintType) == 1) result = m_space.read_byte(offset); @@ -767,15 +767,15 @@ public: virtual ~address_table_write(); // getters - virtual handler_entry &handler(UINT32 index) const override; - handler_entry_write &handler_write(UINT32 index) const { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; } + virtual handler_entry &handler(uint32_t index) const override; + handler_entry_write &handler_write(uint32_t index) const { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; } // range getter - handler_entry_proxy handler_map_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, UINT64 mask = 0) { - std::list entries; + handler_entry_proxy handler_map_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, uint64_t mask = 0) { + std::list entries; setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries); std::list handlers; - for (std::list::const_iterator i = entries.begin(); i != entries.end(); ++i) + for (std::list::const_iterator i = entries.begin(); i != entries.end(); ++i) handlers.push_back(&handler_write(*i)); return handler_entry_proxy(handlers, mask); } @@ -808,7 +808,7 @@ private: { m_space.device().debug()->memory_write_hook(m_space, offset * sizeof(_UintType), data, mask); - UINT16 *oldtable = m_live_lookup; + uint16_t *oldtable = m_live_lookup; m_live_lookup = &m_table[0]; if (sizeof(_UintType) == 1) m_space.write_byte(offset, data); if (sizeof(_UintType) == 2) m_space.write_word(offset << 1, data, mask); @@ -843,15 +843,15 @@ public: { } - handler_entry &handler(UINT32 index) const override { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; } - handler_entry_setoffset &handler_setoffset(UINT32 index) const { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; } + handler_entry &handler(uint32_t index) const override { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; } + handler_entry_setoffset &handler_setoffset(uint32_t index) const { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; } // range getter - handler_entry_proxy handler_map_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, UINT64 mask = 0) { - std::list entries; + handler_entry_proxy handler_map_range(offs_t bytestart, offs_t byteend, offs_t bytemask, offs_t bytemirror, uint64_t mask = 0) { + std::list entries; setup_range(bytestart, byteend, bytemask, bytemirror, mask, entries); std::list handlers; - for (std::list::const_iterator i = entries.begin(); i != entries.end(); ++i) + for (std::list::const_iterator i = entries.begin(); i != entries.end(); ++i) handlers.push_back(&handler_setoffset(*i)); return handler_entry_proxy(handlers, mask); } @@ -881,14 +881,14 @@ class address_space_specific : public address_space typedef address_space_specific<_NativeType, _Endian, _Large> this_type; // constants describing the native size - static const UINT32 NATIVE_BYTES = sizeof(_NativeType); - static const UINT32 NATIVE_MASK = NATIVE_BYTES - 1; - static const UINT32 NATIVE_BITS = 8 * NATIVE_BYTES; + static const uint32_t NATIVE_BYTES = sizeof(_NativeType); + static const uint32_t NATIVE_MASK = NATIVE_BYTES - 1; + static const uint32_t NATIVE_BITS = 8 * NATIVE_BYTES; // helpers to simplify core code - UINT32 read_lookup(offs_t byteaddress) const { return _Large ? m_read.lookup_live_large(byteaddress) : m_read.lookup_live_small(byteaddress); } - UINT32 write_lookup(offs_t byteaddress) const { return _Large ? m_write.lookup_live_large(byteaddress) : m_write.lookup_live_small(byteaddress); } - UINT32 setoffset_lookup(offs_t byteaddress) const { return _Large ? m_setoffset.lookup_live_large(byteaddress) : m_setoffset.lookup_live_small(byteaddress); } + uint32_t read_lookup(offs_t byteaddress) const { return _Large ? m_read.lookup_live_large(byteaddress) : m_read.lookup_live_small(byteaddress); } + uint32_t write_lookup(offs_t byteaddress) const { return _Large ? m_write.lookup_live_large(byteaddress) : m_write.lookup_live_small(byteaddress); } + uint32_t setoffset_lookup(offs_t byteaddress) const { return _Large ? m_setoffset.lookup_live_large(byteaddress) : m_setoffset.lookup_live_small(byteaddress); } public: // construction/destruction @@ -903,7 +903,7 @@ public: // and returning the correct results // install some dummy RAM for the first 16 bytes with well-known values - UINT8 buffer[16]; + uint8_t buffer[16]; for (int index = 0; index < 16; index++) buffer[index ^ ((_Endian == ENDIANNESS_NATIVE) ? 0 : (data_width()/8 - 1))] = index * 0x11; install_ram_generic(0x00, 0x0f, 0x0f, 0, ROW_READWRITE, buffer); @@ -913,22 +913,22 @@ public: for (int address = 0; address < 8; address++) { // determine expected values - UINT64 expected64 = ((UINT64)((address + ((_Endian == ENDIANNESS_LITTLE) ? 7 : 0)) * 0x11) << 56) | - ((UINT64)((address + ((_Endian == ENDIANNESS_LITTLE) ? 6 : 1)) * 0x11) << 48) | - ((UINT64)((address + ((_Endian == ENDIANNESS_LITTLE) ? 5 : 2)) * 0x11) << 40) | - ((UINT64)((address + ((_Endian == ENDIANNESS_LITTLE) ? 4 : 3)) * 0x11) << 32) | - ((UINT64)((address + ((_Endian == ENDIANNESS_LITTLE) ? 3 : 4)) * 0x11) << 24) | - ((UINT64)((address + ((_Endian == ENDIANNESS_LITTLE) ? 2 : 5)) * 0x11) << 16) | - ((UINT64)((address + ((_Endian == ENDIANNESS_LITTLE) ? 1 : 6)) * 0x11) << 8) | - ((UINT64)((address + ((_Endian == ENDIANNESS_LITTLE) ? 0 : 7)) * 0x11) << 0); - UINT32 expected32 = (_Endian == ENDIANNESS_LITTLE) ? expected64 : (expected64 >> 32); - UINT16 expected16 = (_Endian == ENDIANNESS_LITTLE) ? expected32 : (expected32 >> 16); - UINT8 expected8 = (_Endian == ENDIANNESS_LITTLE) ? expected16 : (expected16 >> 8); - - UINT64 result64; - UINT32 result32; - UINT16 result16; - UINT8 result8; + uint64_t expected64 = ((uint64_t)((address + ((_Endian == ENDIANNESS_LITTLE) ? 7 : 0)) * 0x11) << 56) | + ((uint64_t)((address + ((_Endian == ENDIANNESS_LITTLE) ? 6 : 1)) * 0x11) << 48) | + ((uint64_t)((address + ((_Endian == ENDIANNESS_LITTLE) ? 5 : 2)) * 0x11) << 40) | + ((uint64_t)((address + ((_Endian == ENDIANNESS_LITTLE) ? 4 : 3)) * 0x11) << 32) | + ((uint64_t)((address + ((_Endian == ENDIANNESS_LITTLE) ? 3 : 4)) * 0x11) << 24) | + ((uint64_t)((address + ((_Endian == ENDIANNESS_LITTLE) ? 2 : 5)) * 0x11) << 16) | + ((uint64_t)((address + ((_Endian == ENDIANNESS_LITTLE) ? 1 : 6)) * 0x11) << 8) | + ((uint64_t)((address + ((_Endian == ENDIANNESS_LITTLE) ? 0 : 7)) * 0x11) << 0); + uint32_t expected32 = (_Endian == ENDIANNESS_LITTLE) ? expected64 : (expected64 >> 32); + uint16_t expected16 = (_Endian == ENDIANNESS_LITTLE) ? expected32 : (expected32 >> 16); + uint8_t expected8 = (_Endian == ENDIANNESS_LITTLE) ? expected16 : (expected16 >> 8); + + uint64_t result64; + uint32_t result32; + uint16_t result16; + uint8_t result8; // validate byte accesses printf("\nAddress %d\n", address); @@ -1047,20 +1047,20 @@ public: // generate accessor table virtual void accessors(data_accessors &accessors) const override { - accessors.read_byte = reinterpret_cast(&read_byte_static); - accessors.read_word = reinterpret_cast(&read_word_static); - accessors.read_word_masked = reinterpret_cast(&read_word_masked_static); - accessors.read_dword = reinterpret_cast(&read_dword_static); - accessors.read_dword_masked = reinterpret_cast(&read_dword_masked_static); - accessors.read_qword = reinterpret_cast(&read_qword_static); - accessors.read_qword_masked = reinterpret_cast(&read_qword_masked_static); - accessors.write_byte = reinterpret_cast(&write_byte_static); - accessors.write_word = reinterpret_cast(&write_word_static); - accessors.write_word_masked = reinterpret_cast(&write_word_masked_static); - accessors.write_dword = reinterpret_cast(&write_dword_static); - accessors.write_dword_masked = reinterpret_cast(&write_dword_masked_static); - accessors.write_qword = reinterpret_cast(&write_qword_static); - accessors.write_qword_masked = reinterpret_cast(&write_qword_masked_static); + accessors.read_byte = reinterpret_cast(&read_byte_static); + accessors.read_word = reinterpret_cast(&read_word_static); + accessors.read_word_masked = reinterpret_cast(&read_word_masked_static); + accessors.read_dword = reinterpret_cast(&read_dword_static); + accessors.read_dword_masked = reinterpret_cast(&read_dword_masked_static); + accessors.read_qword = reinterpret_cast(&read_qword_static); + accessors.read_qword_masked = reinterpret_cast(&read_qword_masked_static); + accessors.write_byte = reinterpret_cast(&write_byte_static); + accessors.write_word = reinterpret_cast(&write_word_static); + accessors.write_word_masked = reinterpret_cast(&write_word_masked_static); + accessors.write_dword = reinterpret_cast(&write_dword_static); + accessors.write_dword_masked = reinterpret_cast(&write_dword_masked_static); + accessors.write_qword = reinterpret_cast(&write_qword_static); + accessors.write_qword_masked = reinterpret_cast(&write_qword_masked_static); } // return a pointer to the read bank, or nullptr if none @@ -1068,7 +1068,7 @@ public: { // perform the lookup byteaddress &= m_bytemask; - UINT32 entry = read_lookup(byteaddress); + uint32_t entry = read_lookup(byteaddress); const handler_entry_read &handler = m_read.handler_read(entry); // 8-bit case: RAM/ROM @@ -1082,7 +1082,7 @@ public: { // perform the lookup byteaddress &= m_bytemask; - UINT32 entry = write_lookup(byteaddress); + uint32_t entry = write_lookup(byteaddress); const handler_entry_write &handler = m_write.handler_write(entry); // 8-bit case: RAM/ROM @@ -1100,7 +1100,7 @@ public: // look up the handler offs_t byteaddress = offset & m_bytemask; - UINT32 entry = read_lookup(byteaddress); + uint32_t entry = read_lookup(byteaddress); const handler_entry_read &handler = m_read.handler_read(entry); // either read directly from RAM, or call the delegate @@ -1125,7 +1125,7 @@ public: // look up the handler offs_t byteaddress = offset & m_bytemask; - UINT32 entry = read_lookup(byteaddress); + uint32_t entry = read_lookup(byteaddress); const handler_entry_read &handler = m_read.handler_read(entry); // either read directly from RAM, or call the delegate @@ -1148,7 +1148,7 @@ public: // look up the handler offs_t byteaddress = offset & m_bytemask; - UINT32 entry = write_lookup(byteaddress); + uint32_t entry = write_lookup(byteaddress); const handler_entry_write &handler = m_write.handler_write(entry); // either write directly to RAM, or call the delegate @@ -1173,7 +1173,7 @@ public: // look up the handler offs_t byteaddress = offset & m_bytemask; - UINT32 entry = write_lookup(byteaddress); + uint32_t entry = write_lookup(byteaddress); const handler_entry_write &handler = m_write.handler_write(entry); // either write directly to RAM, or call the delegate @@ -1191,8 +1191,8 @@ public: template _TargetType read_direct(offs_t address, _TargetType mask) { - const UINT32 TARGET_BYTES = sizeof(_TargetType); - const UINT32 TARGET_BITS = 8 * TARGET_BYTES; + const uint32_t TARGET_BYTES = sizeof(_TargetType); + const uint32_t TARGET_BITS = 8 * TARGET_BYTES; // equal to native size and aligned; simple pass-through to the native reader if (NATIVE_BYTES == TARGET_BYTES && (_Aligned || (address & NATIVE_MASK) == 0)) @@ -1201,7 +1201,7 @@ public: // if native size is larger, see if we can do a single masked read (guaranteed if we're aligned) if (NATIVE_BYTES > TARGET_BYTES) { - UINT32 offsbits = 8 * (address & (NATIVE_BYTES - (_Aligned ? TARGET_BYTES : 1))); + uint32_t offsbits = 8 * (address & (NATIVE_BYTES - (_Aligned ? TARGET_BYTES : 1))); if (_Aligned || (offsbits + TARGET_BITS <= NATIVE_BITS)) { if (_Endian != ENDIANNESS_LITTLE) offsbits = NATIVE_BITS - TARGET_BITS - offsbits; @@ -1210,7 +1210,7 @@ public: } // determine our alignment against the native boundaries, and mask the address - UINT32 offsbits = 8 * (address & (NATIVE_BYTES - 1)); + uint32_t offsbits = 8 * (address & (NATIVE_BYTES - 1)); address &= ~NATIVE_MASK; // if we're here, and native size is larger or equal to the target, we need exactly 2 reads @@ -1235,7 +1235,7 @@ public: else { // left-justify the mask to the target type - const UINT32 LEFT_JUSTIFY_TARGET_TO_NATIVE_SHIFT = ((NATIVE_BITS >= TARGET_BITS) ? (NATIVE_BITS - TARGET_BITS) : 0); + const uint32_t LEFT_JUSTIFY_TARGET_TO_NATIVE_SHIFT = ((NATIVE_BITS >= TARGET_BITS) ? (NATIVE_BITS - TARGET_BITS) : 0); _NativeType result = 0; _NativeType ljmask = (_NativeType)mask << LEFT_JUSTIFY_TARGET_TO_NATIVE_SHIFT; _NativeType curmask = ljmask >> offsbits; @@ -1258,7 +1258,7 @@ public: { // compute the maximum number of loops; we do it this way so that there are // a fixed number of loops for the compiler to unroll if it desires - const UINT32 MAX_SPLITS_MINUS_ONE = TARGET_BYTES / NATIVE_BYTES - 1; + const uint32_t MAX_SPLITS_MINUS_ONE = TARGET_BYTES / NATIVE_BYTES - 1; _TargetType result = 0; // little-endian case @@ -1270,7 +1270,7 @@ public: // read middle bits from subsequent addresses offsbits = NATIVE_BITS - offsbits; - for (UINT32 index = 0; index < MAX_SPLITS_MINUS_ONE; index++) + for (uint32_t index = 0; index < MAX_SPLITS_MINUS_ONE; index++) { address += NATIVE_BYTES; curmask = mask >> offsbits; @@ -1295,7 +1295,7 @@ public: if (curmask != 0) result = (_TargetType)read_native(address, curmask) << offsbits; // read middle bits from subsequent addresses - for (UINT32 index = 0; index < MAX_SPLITS_MINUS_ONE; index++) + for (uint32_t index = 0; index < MAX_SPLITS_MINUS_ONE; index++) { offsbits -= NATIVE_BITS; address += NATIVE_BYTES; @@ -1319,8 +1319,8 @@ public: template void write_direct(offs_t address, _TargetType data, _TargetType mask) { - const UINT32 TARGET_BYTES = sizeof(_TargetType); - const UINT32 TARGET_BITS = 8 * TARGET_BYTES; + const uint32_t TARGET_BYTES = sizeof(_TargetType); + const uint32_t TARGET_BITS = 8 * TARGET_BYTES; // equal to native size and aligned; simple pass-through to the native writer if (NATIVE_BYTES == TARGET_BYTES && (_Aligned || (address & NATIVE_MASK) == 0)) @@ -1329,7 +1329,7 @@ public: // if native size is larger, see if we can do a single masked write (guaranteed if we're aligned) if (NATIVE_BYTES > TARGET_BYTES) { - UINT32 offsbits = 8 * (address & (NATIVE_BYTES - (_Aligned ? TARGET_BYTES : 1))); + uint32_t offsbits = 8 * (address & (NATIVE_BYTES - (_Aligned ? TARGET_BYTES : 1))); if (_Aligned || (offsbits + TARGET_BITS <= NATIVE_BITS)) { if (_Endian != ENDIANNESS_LITTLE) offsbits = NATIVE_BITS - TARGET_BITS - offsbits; @@ -1338,7 +1338,7 @@ public: } // determine our alignment against the native boundaries, and mask the address - UINT32 offsbits = 8 * (address & (NATIVE_BYTES - 1)); + uint32_t offsbits = 8 * (address & (NATIVE_BYTES - 1)); address &= ~NATIVE_MASK; // if we're here, and native size is larger or equal to the target, we need exactly 2 writes @@ -1361,7 +1361,7 @@ public: else { // left-justify the mask and data to the target type - const UINT32 LEFT_JUSTIFY_TARGET_TO_NATIVE_SHIFT = ((NATIVE_BITS >= TARGET_BITS) ? (NATIVE_BITS - TARGET_BITS) : 0); + const uint32_t LEFT_JUSTIFY_TARGET_TO_NATIVE_SHIFT = ((NATIVE_BITS >= TARGET_BITS) ? (NATIVE_BITS - TARGET_BITS) : 0); _NativeType ljdata = (_NativeType)data << LEFT_JUSTIFY_TARGET_TO_NATIVE_SHIFT; _NativeType ljmask = (_NativeType)mask << LEFT_JUSTIFY_TARGET_TO_NATIVE_SHIFT; @@ -1381,7 +1381,7 @@ public: { // compute the maximum number of loops; we do it this way so that there are // a fixed number of loops for the compiler to unroll if it desires - const UINT32 MAX_SPLITS_MINUS_ONE = TARGET_BYTES / NATIVE_BYTES - 1; + const uint32_t MAX_SPLITS_MINUS_ONE = TARGET_BYTES / NATIVE_BYTES - 1; // little-endian case if (_Endian == ENDIANNESS_LITTLE) @@ -1392,7 +1392,7 @@ public: // write middle bits to subsequent addresses offsbits = NATIVE_BITS - offsbits; - for (UINT32 index = 0; index < MAX_SPLITS_MINUS_ONE; index++) + for (uint32_t index = 0; index < MAX_SPLITS_MINUS_ONE; index++) { address += NATIVE_BYTES; curmask = mask >> offsbits; @@ -1417,7 +1417,7 @@ public: if (curmask != 0) write_native(address, data >> offsbits, curmask); // write middle bits to subsequent addresses - for (UINT32 index = 0; index < MAX_SPLITS_MINUS_ONE; index++) + for (uint32_t index = 0; index < MAX_SPLITS_MINUS_ONE; index++) { offsbits -= NATIVE_BITS; address += NATIVE_BYTES; @@ -1442,7 +1442,7 @@ public: void set_address(offs_t address) override { offs_t byteaddress = address & m_bytemask; - UINT32 entry = setoffset_lookup(byteaddress); + uint32_t entry = setoffset_lookup(byteaddress); const handler_entry_setoffset &handler = m_setoffset.handler_setoffset(entry); offs_t offset = handler.byteoffset(byteaddress); @@ -1450,72 +1450,72 @@ public: } // virtual access to these functions - UINT8 read_byte(offs_t address) override { return (NATIVE_BITS == 8) ? read_native(address & ~NATIVE_MASK) : read_direct(address, 0xff); } - UINT16 read_word(offs_t address) override { return (NATIVE_BITS == 16) ? read_native(address & ~NATIVE_MASK) : read_direct(address, 0xffff); } - UINT16 read_word(offs_t address, UINT16 mask) override { return read_direct(address, mask); } - UINT16 read_word_unaligned(offs_t address) override { return read_direct(address, 0xffff); } - UINT16 read_word_unaligned(offs_t address, UINT16 mask) override { return read_direct(address, mask); } - UINT32 read_dword(offs_t address) override { return (NATIVE_BITS == 32) ? read_native(address & ~NATIVE_MASK) : read_direct(address, 0xffffffff); } - UINT32 read_dword(offs_t address, UINT32 mask) override { return read_direct(address, mask); } - UINT32 read_dword_unaligned(offs_t address) override { return read_direct(address, 0xffffffff); } - UINT32 read_dword_unaligned(offs_t address, UINT32 mask) override { return read_direct(address, mask); } - UINT64 read_qword(offs_t address) override { return (NATIVE_BITS == 64) ? read_native(address & ~NATIVE_MASK) : read_direct(address, U64(0xffffffffffffffff)); } - UINT64 read_qword(offs_t address, UINT64 mask) override { return read_direct(address, mask); } - UINT64 read_qword_unaligned(offs_t address) override { return read_direct(address, U64(0xffffffffffffffff)); } - UINT64 read_qword_unaligned(offs_t address, UINT64 mask) override { return read_direct(address, mask); } - - void write_byte(offs_t address, UINT8 data) override { if (NATIVE_BITS == 8) write_native(address & ~NATIVE_MASK, data); else write_direct(address, data, 0xff); } - void write_word(offs_t address, UINT16 data) override { if (NATIVE_BITS == 16) write_native(address & ~NATIVE_MASK, data); else write_direct(address, data, 0xffff); } - void write_word(offs_t address, UINT16 data, UINT16 mask) override { write_direct(address, data, mask); } - void write_word_unaligned(offs_t address, UINT16 data) override { write_direct(address, data, 0xffff); } - void write_word_unaligned(offs_t address, UINT16 data, UINT16 mask) override { write_direct(address, data, mask); } - void write_dword(offs_t address, UINT32 data) override { if (NATIVE_BITS == 32) write_native(address & ~NATIVE_MASK, data); else write_direct(address, data, 0xffffffff); } - void write_dword(offs_t address, UINT32 data, UINT32 mask) override { write_direct(address, data, mask); } - void write_dword_unaligned(offs_t address, UINT32 data) override { write_direct(address, data, 0xffffffff); } - void write_dword_unaligned(offs_t address, UINT32 data, UINT32 mask) override { write_direct(address, data, mask); } - void write_qword(offs_t address, UINT64 data) override { if (NATIVE_BITS == 64) write_native(address & ~NATIVE_MASK, data); else write_direct(address, data, U64(0xffffffffffffffff)); } - void write_qword(offs_t address, UINT64 data, UINT64 mask) override { write_direct(address, data, mask); } - void write_qword_unaligned(offs_t address, UINT64 data) override { write_direct(address, data, U64(0xffffffffffffffff)); } - void write_qword_unaligned(offs_t address, UINT64 data, UINT64 mask) override { write_direct(address, data, mask); } + uint8_t read_byte(offs_t address) override { return (NATIVE_BITS == 8) ? read_native(address & ~NATIVE_MASK) : read_direct(address, 0xff); } + uint16_t read_word(offs_t address) override { return (NATIVE_BITS == 16) ? read_native(address & ~NATIVE_MASK) : read_direct(address, 0xffff); } + uint16_t read_word(offs_t address, uint16_t mask) override { return read_direct(address, mask); } + uint16_t read_word_unaligned(offs_t address) override { return read_direct(address, 0xffff); } + uint16_t read_word_unaligned(offs_t address, uint16_t mask) override { return read_direct(address, mask); } + uint32_t read_dword(offs_t address) override { return (NATIVE_BITS == 32) ? read_native(address & ~NATIVE_MASK) : read_direct(address, 0xffffffff); } + uint32_t read_dword(offs_t address, uint32_t mask) override { return read_direct(address, mask); } + uint32_t read_dword_unaligned(offs_t address) override { return read_direct(address, 0xffffffff); } + uint32_t read_dword_unaligned(offs_t address, uint32_t mask) override { return read_direct(address, mask); } + uint64_t read_qword(offs_t address) override { return (NATIVE_BITS == 64) ? read_native(address & ~NATIVE_MASK) : read_direct(address, U64(0xffffffffffffffff)); } + uint64_t read_qword(offs_t address, uint64_t mask) override { return read_direct(address, mask); } + uint64_t read_qword_unaligned(offs_t address) override { return read_direct(address, U64(0xffffffffffffffff)); } + uint64_t read_qword_unaligned(offs_t address, uint64_t mask) override { return read_direct(address, mask); } + + void write_byte(offs_t address, uint8_t data) override { if (NATIVE_BITS == 8) write_native(address & ~NATIVE_MASK, data); else write_direct(address, data, 0xff); } + void write_word(offs_t address, uint16_t data) override { if (NATIVE_BITS == 16) write_native(address & ~NATIVE_MASK, data); else write_direct(address, data, 0xffff); } + void write_word(offs_t address, uint16_t data, uint16_t mask) override { write_direct(address, data, mask); } + void write_word_unaligned(offs_t address, uint16_t data) override { write_direct(address, data, 0xffff); } + void write_word_unaligned(offs_t address, uint16_t data, uint16_t mask) override { write_direct(address, data, mask); } + void write_dword(offs_t address, uint32_t data) override { if (NATIVE_BITS == 32) write_native(address & ~NATIVE_MASK, data); else write_direct(address, data, 0xffffffff); } + void write_dword(offs_t address, uint32_t data, uint32_t mask) override { write_direct(address, data, mask); } + void write_dword_unaligned(offs_t address, uint32_t data) override { write_direct(address, data, 0xffffffff); } + void write_dword_unaligned(offs_t address, uint32_t data, uint32_t mask) override { write_direct(address, data, mask); } + void write_qword(offs_t address, uint64_t data) override { if (NATIVE_BITS == 64) write_native(address & ~NATIVE_MASK, data); else write_direct(address, data, U64(0xffffffffffffffff)); } + void write_qword(offs_t address, uint64_t data, uint64_t mask) override { write_direct(address, data, mask); } + void write_qword_unaligned(offs_t address, uint64_t data) override { write_direct(address, data, U64(0xffffffffffffffff)); } + void write_qword_unaligned(offs_t address, uint64_t data, uint64_t mask) override { write_direct(address, data, mask); } // static access to these functions - static UINT8 read_byte_static(this_type &space, offs_t address) { return (NATIVE_BITS == 8) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct(address, 0xff); } - static UINT16 read_word_static(this_type &space, offs_t address) { return (NATIVE_BITS == 16) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct(address, 0xffff); } - static UINT16 read_word_masked_static(this_type &space, offs_t address, UINT16 mask) { return space.read_direct(address, mask); } - static UINT32 read_dword_static(this_type &space, offs_t address) { return (NATIVE_BITS == 32) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct(address, 0xffffffff); } - static UINT32 read_dword_masked_static(this_type &space, offs_t address, UINT32 mask) { return space.read_direct(address, mask); } - static UINT64 read_qword_static(this_type &space, offs_t address) { return (NATIVE_BITS == 64) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct(address, U64(0xffffffffffffffff)); } - static UINT64 read_qword_masked_static(this_type &space, offs_t address, UINT64 mask) { return space.read_direct(address, mask); } - static void write_byte_static(this_type &space, offs_t address, UINT8 data) { if (NATIVE_BITS == 8) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct(address, data, 0xff); } - static void write_word_static(this_type &space, offs_t address, UINT16 data) { if (NATIVE_BITS == 16) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct(address, data, 0xffff); } - static void write_word_masked_static(this_type &space, offs_t address, UINT16 data, UINT16 mask) { space.write_direct(address, data, mask); } - static void write_dword_static(this_type &space, offs_t address, UINT32 data) { if (NATIVE_BITS == 32) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct(address, data, 0xffffffff); } - static void write_dword_masked_static(this_type &space, offs_t address, UINT32 data, UINT32 mask) { space.write_direct(address, data, mask); } - static void write_qword_static(this_type &space, offs_t address, UINT64 data) { if (NATIVE_BITS == 64) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct(address, data, U64(0xffffffffffffffff)); } - static void write_qword_masked_static(this_type &space, offs_t address, UINT64 data, UINT64 mask) { space.write_direct(address, data, mask); } + static uint8_t read_byte_static(this_type &space, offs_t address) { return (NATIVE_BITS == 8) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct(address, 0xff); } + static uint16_t read_word_static(this_type &space, offs_t address) { return (NATIVE_BITS == 16) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct(address, 0xffff); } + static uint16_t read_word_masked_static(this_type &space, offs_t address, uint16_t mask) { return space.read_direct(address, mask); } + static uint32_t read_dword_static(this_type &space, offs_t address) { return (NATIVE_BITS == 32) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct(address, 0xffffffff); } + static uint32_t read_dword_masked_static(this_type &space, offs_t address, uint32_t mask) { return space.read_direct(address, mask); } + static uint64_t read_qword_static(this_type &space, offs_t address) { return (NATIVE_BITS == 64) ? space.read_native(address & ~NATIVE_MASK) : space.read_direct(address, U64(0xffffffffffffffff)); } + static uint64_t read_qword_masked_static(this_type &space, offs_t address, uint64_t mask) { return space.read_direct(address, mask); } + static void write_byte_static(this_type &space, offs_t address, uint8_t data) { if (NATIVE_BITS == 8) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct(address, data, 0xff); } + static void write_word_static(this_type &space, offs_t address, uint16_t data) { if (NATIVE_BITS == 16) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct(address, data, 0xffff); } + static void write_word_masked_static(this_type &space, offs_t address, uint16_t data, uint16_t mask) { space.write_direct(address, data, mask); } + static void write_dword_static(this_type &space, offs_t address, uint32_t data) { if (NATIVE_BITS == 32) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct(address, data, 0xffffffff); } + static void write_dword_masked_static(this_type &space, offs_t address, uint32_t data, uint32_t mask) { space.write_direct(address, data, mask); } + static void write_qword_static(this_type &space, offs_t address, uint64_t data) { if (NATIVE_BITS == 64) space.write_native(address & ~NATIVE_MASK, data); else space.write_direct(address, data, U64(0xffffffffffffffff)); } + static void write_qword_masked_static(this_type &space, offs_t address, uint64_t data, uint64_t mask) { space.write_direct(address, data, mask); } address_table_read m_read; // memory read lookup table address_table_write m_write; // memory write lookup table address_table_setoffset m_setoffset; // memory setoffset lookup table }; -typedef address_space_specific address_space_8le_small; -typedef address_space_specific address_space_8be_small; -typedef address_space_specific address_space_16le_small; -typedef address_space_specific address_space_16be_small; -typedef address_space_specific address_space_32le_small; -typedef address_space_specific address_space_32be_small; -typedef address_space_specific address_space_64le_small; -typedef address_space_specific address_space_64be_small; +typedef address_space_specific address_space_8le_small; +typedef address_space_specific address_space_8be_small; +typedef address_space_specific address_space_16le_small; +typedef address_space_specific address_space_16be_small; +typedef address_space_specific address_space_32le_small; +typedef address_space_specific address_space_32be_small; +typedef address_space_specific address_space_64le_small; +typedef address_space_specific address_space_64be_small; -typedef address_space_specific address_space_8le_large; -typedef address_space_specific address_space_8be_large; -typedef address_space_specific address_space_16le_large; -typedef address_space_specific address_space_16be_large; -typedef address_space_specific address_space_32le_large; -typedef address_space_specific address_space_32be_large; -typedef address_space_specific address_space_64le_large; -typedef address_space_specific address_space_64be_large; +typedef address_space_specific address_space_8le_large; +typedef address_space_specific address_space_8be_large; +typedef address_space_specific address_space_16le_large; +typedef address_space_specific address_space_16be_large; +typedef address_space_specific address_space_32le_large; +typedef address_space_specific address_space_32be_large; +typedef address_space_specific address_space_64le_large; +typedef address_space_specific address_space_64be_large; @@ -1524,7 +1524,7 @@ typedef address_space_specific address_space_64 //************************************************************************** // global watchpoint table -UINT16 address_table::s_watchpoint_table[1 << LEVEL1_BITS]; +uint16_t address_table::s_watchpoint_table[1 << LEVEL1_BITS]; @@ -1638,7 +1638,7 @@ void memory_manager::dump(FILE *file) // region_alloc - allocates memory for a region //------------------------------------------------- -memory_region *memory_manager::region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian) +memory_region *memory_manager::region_alloc(const char *name, uint32_t length, uint8_t width, endianness_t endian) { osd_printf_verbose("Region '%s' created\n", name); // make sure we don't have a region of the same name; also find the end of the list @@ -1668,7 +1668,7 @@ void memory_manager::region_free(const char *name) memory_region *memory_manager::region_containing(const void *memory, offs_t bytes) const { - const UINT8 *data = reinterpret_cast(memory); + const uint8_t *data = reinterpret_cast(memory); // look through the region list and return the first match for (auto ®ion : m_regionlist) @@ -1995,7 +1995,7 @@ void address_space::check_address(const char *function, offs_t addrstart, offs_t void address_space::prepare_map() { memory_region *devregion = (m_spacenum == AS_0) ? machine().root_device().memregion(m_device.tag()) : nullptr; - UINT32 devregionsize = (devregion != nullptr) ? devregion->bytes() : 0; + uint32_t devregionsize = (devregion != nullptr) ? devregion->bytes() : 0; // allocate the address map m_map = std::make_unique(m_device, m_spacenum); @@ -2294,7 +2294,7 @@ void address_space::locate_memory() // intersecting blocks and assign their pointers //------------------------------------------------- -address_map_entry *address_space::block_assign_intersecting(offs_t bytestart, offs_t byteend, UINT8 *base) +address_map_entry *address_space::block_assign_intersecting(offs_t bytestart, offs_t byteend, uint8_t *base) { address_map_entry *unassigned = nullptr; @@ -2378,7 +2378,7 @@ void address_space::dump_map(FILE *file, read_or_write readorwrite) offs_t bytestart, byteend; for (offs_t byteaddress = 0; byteaddress <= m_bytemask; byteaddress = byteend) { - UINT16 entry = table.derive_range(byteaddress, bytestart, byteend); + uint16_t entry = table.derive_range(byteaddress, bytestart, byteend); fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n", bytestart, byteend, entry, table.handler_name(entry), table.handler(entry).bytestart()); if (++byteend == 0) @@ -2421,7 +2421,7 @@ void address_space::unmap_generic(offs_t addrstart, offs_t addrend, offs_t addrm // of a live device into this address space //------------------------------------------------- -void address_space::install_device_delegate(offs_t addrstart, offs_t addrend, device_t &device, address_map_delegate &delegate, int bits, UINT64 unitmask) +void address_space::install_device_delegate(offs_t addrstart, offs_t addrend, device_t &device, address_map_delegate &delegate, int bits, uint64_t unitmask) { check_address("install_device_delegate", addrstart, addrend); address_map map(*this, addrstart, addrend, bits, unitmask, device, delegate); @@ -2620,7 +2620,7 @@ void address_space::install_ram_generic(offs_t addrstart, offs_t addrend, offs_t // delegate handlers for the space //------------------------------------------------- -void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read8_delegate handler, UINT64 unitmask) +void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read8_delegate handler, uint64_t unitmask) { VPRINTF(("address_space::install_read_handler(%s-%s mask=%s mirror=%s, %s, %s)\n", core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars), @@ -2634,7 +2634,7 @@ void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_ generate_memdump(machine()); } -void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write8_delegate handler, UINT64 unitmask) +void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write8_delegate handler, uint64_t unitmask) { VPRINTF(("address_space::install_write_handler(%s-%s mask=%s mirror=%s, %s, %s)\n", core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars), @@ -2648,7 +2648,7 @@ void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs generate_memdump(machine()); } -void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read8_delegate rhandler, write8_delegate whandler, UINT64 unitmask) +void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read8_delegate rhandler, write8_delegate whandler, uint64_t unitmask) { install_read_handler(addrstart, addrend, addrmask, addrmirror, addrselect, rhandler, unitmask); install_write_handler(addrstart, addrend, addrmask, addrmirror, addrselect, whandler, unitmask); @@ -2660,7 +2660,7 @@ void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, // delegate handlers for the space //------------------------------------------------- -void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read16_delegate handler, UINT64 unitmask) +void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read16_delegate handler, uint64_t unitmask) { offs_t nstart, nend, nmask, nmirror; check_optimize_all("install_read_handler", addrstart, addrend, addrmask, addrmirror, addrselect, nstart, nend, nmask, nmirror); @@ -2668,7 +2668,7 @@ void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_ generate_memdump(machine()); } -void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write16_delegate handler, UINT64 unitmask) +void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write16_delegate handler, uint64_t unitmask) { offs_t nstart, nend, nmask, nmirror; check_optimize_all("install_write_handler", addrstart, addrend, addrmask, addrmirror, addrselect, nstart, nend, nmask, nmirror); @@ -2676,7 +2676,7 @@ void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs generate_memdump(machine()); } -void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read16_delegate rhandler, write16_delegate whandler, UINT64 unitmask) +void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read16_delegate rhandler, write16_delegate whandler, uint64_t unitmask) { install_read_handler(addrstart, addrend, addrmask, addrmirror, addrselect, rhandler, unitmask); install_write_handler(addrstart, addrend, addrmask, addrmirror, addrselect, whandler, unitmask); @@ -2688,7 +2688,7 @@ void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, // delegate handlers for the space //------------------------------------------------- -void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read32_delegate handler, UINT64 unitmask) +void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read32_delegate handler, uint64_t unitmask) { offs_t nstart, nend, nmask, nmirror; check_optimize_all("install_read_handler", addrstart, addrend, addrmask, addrmirror, addrselect, nstart, nend, nmask, nmirror); @@ -2696,7 +2696,7 @@ void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_ generate_memdump(machine()); } -void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write32_delegate handler, UINT64 unitmask) +void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write32_delegate handler, uint64_t unitmask) { offs_t nstart, nend, nmask, nmirror; check_optimize_all("install_write_handler", addrstart, addrend, addrmask, addrmirror, addrselect, nstart, nend, nmask, nmirror); @@ -2704,7 +2704,7 @@ void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs generate_memdump(machine()); } -void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read32_delegate rhandler, write32_delegate whandler, UINT64 unitmask) +void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read32_delegate rhandler, write32_delegate whandler, uint64_t unitmask) { install_read_handler(addrstart, addrend, addrmask, addrmirror, addrselect, rhandler, unitmask); install_write_handler(addrstart, addrend, addrmask, addrmirror, addrselect, whandler, unitmask); @@ -2716,7 +2716,7 @@ void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, // delegate handlers for the space //------------------------------------------------- -void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read64_delegate handler, UINT64 unitmask) +void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read64_delegate handler, uint64_t unitmask) { offs_t nstart, nend, nmask, nmirror; check_optimize_all("install_read_handler", addrstart, addrend, addrmask, addrmirror, addrselect, nstart, nend, nmask, nmirror); @@ -2724,7 +2724,7 @@ void address_space::install_read_handler(offs_t addrstart, offs_t addrend, offs_ generate_memdump(machine()); } -void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write64_delegate handler, UINT64 unitmask) +void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write64_delegate handler, uint64_t unitmask) { offs_t nstart, nend, nmask, nmirror; check_optimize_all("install_write_handler", addrstart, addrend, addrmask, addrmirror, addrselect, nstart, nend, nmask, nmirror); @@ -2732,7 +2732,7 @@ void address_space::install_write_handler(offs_t addrstart, offs_t addrend, offs generate_memdump(machine()); } -void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read64_delegate rhandler, write64_delegate whandler, UINT64 unitmask) +void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read64_delegate rhandler, write64_delegate whandler, uint64_t unitmask) { install_read_handler(addrstart, addrend, addrmask, addrmirror, addrselect, rhandler, unitmask); install_write_handler(addrstart, addrend, addrmask, addrmirror, addrselect, whandler, unitmask); @@ -2743,7 +2743,7 @@ void address_space::install_readwrite_handler(offs_t addrstart, offs_t addrend, // install_setoffset_handler - install set_offset delegate handlers for the space //----------------------------------------------------------------------- -void address_space::install_setoffset_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, setoffset_delegate handler, UINT64 unitmask) +void address_space::install_setoffset_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, setoffset_delegate handler, uint64_t unitmask) { VPRINTF(("address_space::install_setoffset_handler(%s-%s mask=%s mirror=%s, %s, %s)\n", core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars), @@ -2782,8 +2782,8 @@ void *address_space::find_backing_memory(offs_t addrstart, offs_t addrend) offs_t maskend = byteend & entry.m_bytemask; if (entry.m_memory != nullptr && maskstart >= entry.m_bytestart && maskend <= entry.m_byteend) { - VPRINTF(("found in entry %08X-%08X [%p]\n", entry.m_addrstart, entry.m_addrend, (UINT8 *)entry.m_memory + (maskstart - entry.m_bytestart))); - return (UINT8 *)entry.m_memory + (maskstart - entry.m_bytestart); + VPRINTF(("found in entry %08X-%08X [%p]\n", entry.m_addrstart, entry.m_addrend, (uint8_t *)entry.m_memory + (maskstart - entry.m_bytestart))); + return (uint8_t *)entry.m_memory + (maskstart - entry.m_bytestart); } } @@ -2960,7 +2960,7 @@ address_table::~address_table() // map //------------------------------------------------- -void address_table::map_range(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT16 entry) +void address_table::map_range(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, uint16_t entry) { // convert addresses to bytes offs_t bytestart = addrstart; @@ -2988,12 +2988,12 @@ void address_table::map_range(offs_t addrstart, offs_t addrend, offs_t addrmask, // verify_reference_counts(); } -UINT16 address_table::get_free_handler() +uint16_t address_table::get_free_handler() { if (handler_free == STATIC_INVALID) throw emu_fatalerror("Out of handler entries in address table"); - UINT16 handler = handler_free; + uint16_t handler = handler_free; handler_free = handler_next_free[handler - STATIC_COUNT]; return handler; } @@ -3005,10 +3005,10 @@ UINT16 address_table::get_free_handler() // it //------------------------------------------------- -void address_table::setup_range(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT64 mask, std::list &entries) +void address_table::setup_range(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, uint64_t mask, std::list &entries) { // Careful, you can't shift by 64 or more - UINT64 testmask = (1ULL << (m_space.data_width()-1) << 1) - 1; + uint64_t testmask = (1ULL << (m_space.data_width()-1) << 1) - 1; if((mask & testmask) == 0 || (mask & testmask) == testmask) setup_range_solid(addrstart, addrend, addrmask, addrmirror, entries); @@ -3022,10 +3022,10 @@ void address_table::setup_range(offs_t addrstart, offs_t addrend, offs_t addrmas // it. Replace what's there. //------------------------------------------------- -void address_table::setup_range_solid(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, std::list &entries) +void address_table::setup_range_solid(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, std::list &entries) { // Grab a free entry - UINT16 entry = get_free_handler(); + uint16_t entry = get_free_handler(); // Add it in the "to be setup" list entries.push_back(entry); @@ -3047,7 +3047,7 @@ namespace { }; } -void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT64 mask, std::list &entries) +void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, uint64_t mask, std::list &entries) { // convert addresses to bytes offs_t bytestart = addrstart; @@ -3063,7 +3063,7 @@ void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t // Scan the memory to see what has to be done std::list range_override; - std::map > range_partial; + std::map > range_partial; offs_t base_mirror = 0; do @@ -3074,8 +3074,8 @@ void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t do { offs_t range_start, range_end; - UINT16 entry = derive_range(base_address, range_start, range_end); - UINT32 stop_address = range_end > end_address ? end_address : range_end; + uint16_t entry = derive_range(base_address, range_start, range_end); + uint32_t stop_address = range_end > end_address ? end_address : range_end; if (entry < STATIC_COUNT || handler(entry).overriden_by_mask(mask)) range_override.push_back(subrange(base_address, stop_address)); @@ -3095,7 +3095,7 @@ void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t if (!range_override.empty()) { // Grab a free entry - UINT16 entry = get_free_handler(); + uint16_t entry = get_free_handler(); // configure the entry to our parameters handler_entry &curentry = handler(entry); @@ -3115,7 +3115,7 @@ void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t // Ranges in range_partial must be duplicated then partially changed if (!range_partial.empty()) { - for (std::map >::const_iterator i = range_partial.begin(); i != range_partial.end(); ++i) + for (std::map >::const_iterator i = range_partial.begin(); i != range_partial.end(); ++i) { // Theorically, if the handler to change matches the // characteristics of ours, we can directly change it. In @@ -3131,7 +3131,7 @@ void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t offs_t previous_bytemask = base_entry->bytemask(); // Grab a new handler and copy it there - UINT16 entry = get_free_handler(); + uint16_t entry = get_free_handler(); handler_entry &curentry = handler(entry); curentry.copy(base_entry); @@ -3174,7 +3174,7 @@ void address_table::verify_reference_counts() for (int level1 = 0; level1 != 1 << LEVEL1_BITS; level1++) { - UINT16 l1_entry = m_table[level1]; + uint16_t l1_entry = m_table[level1]; if (l1_entry >= SUBTABLE_BASE) { assert(m_large); @@ -3182,10 +3182,10 @@ void address_table::verify_reference_counts() continue; subtable_seen[l1_entry - SUBTABLE_BASE] = true; - const UINT16 *subtable = subtable_ptr(l1_entry); + const uint16_t *subtable = subtable_ptr(l1_entry); for (int level2 = 0; level2 != 1 << LEVEL2_BITS; level2++) { - UINT16 l2_entry = subtable[level2]; + uint16_t l2_entry = subtable[level2]; assert(l2_entry < SUBTABLE_BASE); if (l2_entry >= STATIC_COUNT) actual_refcounts[l2_entry - STATIC_COUNT]++; @@ -3210,7 +3210,7 @@ void address_table::verify_reference_counts() // range of addresses //------------------------------------------------- -void address_table::populate_range(offs_t bytestart, offs_t byteend, UINT16 handlerindex) +void address_table::populate_range(offs_t bytestart, offs_t byteend, uint16_t handlerindex) { offs_t l2mask = (1 << level2_bits()) - 1; offs_t l1start = bytestart >> level2_bits(); @@ -3225,7 +3225,7 @@ void address_table::populate_range(offs_t bytestart, offs_t byteend, UINT16 hand // handle the starting edge if it's not on a block boundary if (l2start != 0) { - UINT16 *subtable = subtable_open(l1start); + uint16_t *subtable = subtable_open(l1start); // if the start and stop end within the same block, handle that if (l1start == l1stop) @@ -3255,7 +3255,7 @@ void address_table::populate_range(offs_t bytestart, offs_t byteend, UINT16 hand // handle the trailing edge if it's not on a block boundary if (l2stop != l2mask) { - UINT16 *subtable = subtable_open(l1stop); + uint16_t *subtable = subtable_open(l1stop); // fill from the beginning handler_ref(handlerindex, l2stop+1); @@ -3277,7 +3277,7 @@ void address_table::populate_range(offs_t bytestart, offs_t byteend, UINT16 hand handler_ref(handlerindex, l1stop - l1start + 1); for (offs_t l1index = l1start; l1index <= l1stop; l1index++) { - UINT16 subindex = m_table[l1index]; + uint16_t subindex = m_table[l1index]; // if we have a subtable here, release it if (subindex >= SUBTABLE_BASE) @@ -3295,7 +3295,7 @@ void address_table::populate_range(offs_t bytestart, offs_t byteend, UINT16 hand // mirrors //------------------------------------------------- -void address_table::populate_range_mirrored(offs_t bytestart, offs_t byteend, offs_t bytemirror, UINT16 handlerindex) +void address_table::populate_range_mirrored(offs_t bytestart, offs_t byteend, offs_t bytemirror, uint16_t handlerindex) { // determine the mirror bits offs_t lmirrorbits = 0; @@ -3311,7 +3311,7 @@ void address_table::populate_range_mirrored(offs_t bytestart, offs_t byteend, of hmirrorbit[hmirrorbits++] = 1 << bit; // loop over mirrors in the level 2 table - UINT16 prev_entry = STATIC_INVALID; + uint16_t prev_entry = STATIC_INVALID; int prev_index = 0; for (offs_t hmirrorcount = 0; hmirrorcount < (1 << hmirrorbits); hmirrorcount++) { @@ -3384,11 +3384,11 @@ void address_table::populate_range_mirrored(offs_t bytestart, offs_t byteend, of // range based on the lookup tables //------------------------------------------------- -UINT16 address_table::derive_range(offs_t byteaddress, offs_t &bytestart, offs_t &byteend) const +uint16_t address_table::derive_range(offs_t byteaddress, offs_t &bytestart, offs_t &byteend) const { // look up the initial address to get the entry we care about - UINT16 l1entry; - UINT16 entry = l1entry = m_table[level1_index(byteaddress)]; + uint16_t l1entry; + uint16_t entry = l1entry = m_table[level1_index(byteaddress)]; if (l1entry >= SUBTABLE_BASE) entry = m_table[level2_index(l1entry, byteaddress)]; @@ -3397,16 +3397,16 @@ UINT16 address_table::derive_range(offs_t byteaddress, offs_t &bytestart, offs_t handler(entry).mirrored_start_end(byteaddress, minscan, maxscan); // first scan backwards to find the start address - UINT16 curl1entry = l1entry; - UINT16 curentry = entry; + uint16_t curl1entry = l1entry; + uint16_t curentry = entry; bytestart = byteaddress; while (1) { // if we need to scan the subtable, do it if (curentry != curl1entry) { - UINT32 minindex = level2_index(curl1entry, 0); - UINT32 index; + uint32_t minindex = level2_index(curl1entry, 0); + uint32_t index; // scan backwards from the current address, until the previous entry doesn't match for (index = level2_index(curl1entry, bytestart); index > minindex; index--, bytestart -= 1) @@ -3443,8 +3443,8 @@ UINT16 address_table::derive_range(offs_t byteaddress, offs_t &bytestart, offs_t // if we need to scan the subtable, do it if (curentry != curl1entry) { - UINT32 maxindex = level2_index(curl1entry, ~0); - UINT32 index; + uint32_t maxindex = level2_index(curl1entry, ~0); + uint32_t index; // scan forwards from the current address, until the next entry doesn't match for (index = level2_index(curl1entry, byteend); index < maxindex; index++, byteend += 1) @@ -3499,20 +3499,20 @@ void address_table::mask_all_handlers(offs_t mask) // and set its usecount to 1 //------------------------------------------------- -UINT16 address_table::subtable_alloc() +uint16_t address_table::subtable_alloc() { // loop while (1) { // find a subtable with a usecount of 0 - for (UINT16 subindex = 0; subindex < SUBTABLE_COUNT; subindex++) + for (uint16_t subindex = 0; subindex < SUBTABLE_COUNT; subindex++) if (m_subtable[subindex].m_usecount == 0) { // if this is past our allocation budget, allocate some more if (subindex >= m_subtable_alloc) { m_subtable_alloc += SUBTABLE_ALLOC; - UINT32 newsize = (1 << LEVEL1_BITS) + (m_subtable_alloc << level2_bits()); + uint32_t newsize = (1 << LEVEL1_BITS) + (m_subtable_alloc << level2_bits()); bool was_live = (m_live_lookup == &m_table[0]); int oldsize = m_table.size(); @@ -3538,9 +3538,9 @@ UINT16 address_table::subtable_alloc() // a subtable //------------------------------------------------- -void address_table::subtable_realloc(UINT16 subentry) +void address_table::subtable_realloc(uint16_t subentry) { - UINT16 subindex = subentry - SUBTABLE_BASE; + uint16_t subindex = subentry - SUBTABLE_BASE; // sanity check if (m_subtable[subindex].m_usecount <= 0) @@ -3559,7 +3559,7 @@ void address_table::subtable_realloc(UINT16 subentry) int address_table::subtable_merge() { int merged = 0; - UINT16 subindex; + uint16_t subindex; VPRINTF(("Merging subtables....\n")); @@ -3567,8 +3567,8 @@ int address_table::subtable_merge() for (subindex = 0; subindex < SUBTABLE_COUNT; subindex++) if (!m_subtable[subindex].m_checksum_valid && m_subtable[subindex].m_usecount != 0) { - UINT32 *subtable = reinterpret_cast(subtable_ptr(subindex + SUBTABLE_BASE)); - UINT32 checksum = 0; + uint32_t *subtable = reinterpret_cast(subtable_ptr(subindex + SUBTABLE_BASE)); + uint32_t checksum = 0; // update the checksum for (int l2index = 0; l2index < (1 << level2_bits())/4; l2index++) @@ -3581,9 +3581,9 @@ int address_table::subtable_merge() for (subindex = 0; subindex < SUBTABLE_COUNT; subindex++) if (m_subtable[subindex].m_usecount != 0) { - UINT16 *subtable = subtable_ptr(subindex + SUBTABLE_BASE); - UINT32 checksum = m_subtable[subindex].m_checksum; - UINT16 sumindex; + uint16_t *subtable = subtable_ptr(subindex + SUBTABLE_BASE); + uint32_t checksum = m_subtable[subindex].m_checksum; + uint16_t sumindex; for (sumindex = subindex + 1; sumindex < SUBTABLE_COUNT; sumindex++) if (m_subtable[sumindex].m_usecount != 0 && @@ -3615,9 +3615,9 @@ int address_table::subtable_merge() // a subtable and free it if we're done //------------------------------------------------- -void address_table::subtable_release(UINT16 subentry) +void address_table::subtable_release(uint16_t subentry) { - UINT16 subindex = subentry - SUBTABLE_BASE; + uint16_t subindex = subentry - SUBTABLE_BASE; // sanity check if (m_subtable[subindex].m_usecount <= 0) fatalerror("Called subtable_release on a table with a usecount of 0\n"); @@ -3628,7 +3628,7 @@ void address_table::subtable_release(UINT16 subentry) if (m_subtable[subindex].m_usecount == 0) { m_subtable[subindex].m_checksum = 0; - UINT16 *subtable = subtable_ptr(subentry); + uint16_t *subtable = subtable_ptr(subentry); for (int i = 0; i < (1 << LEVEL2_BITS); i++) handler_unref(subtable[i]); } @@ -3640,21 +3640,21 @@ void address_table::subtable_release(UINT16 subentry) // modification //------------------------------------------------- -UINT16 *address_table::subtable_open(offs_t l1index) +uint16_t *address_table::subtable_open(offs_t l1index) { - UINT16 subentry = m_table[l1index]; + uint16_t subentry = m_table[l1index]; // if we don't have a subtable yet, allocate a new one if (subentry < SUBTABLE_BASE) { int size = 1 << level2_bits(); - UINT16 newentry = subtable_alloc(); + uint16_t newentry = subtable_alloc(); handler_ref(subentry, size-1); - UINT16 *subptr = subtable_ptr(newentry); + uint16_t *subptr = subtable_ptr(newentry); for (int i=0; i 1) { - UINT16 newentry = subtable_alloc(); + uint16_t newentry = subtable_alloc(); // allocate may cause some additional merging -- look up the subentry again // when we're done; it should still require a split @@ -3671,7 +3671,7 @@ UINT16 *address_table::subtable_open(offs_t l1index) assert(m_subtable[subentry - SUBTABLE_BASE].m_usecount > 1); int size = 1 << level2_bits(); - UINT16 *src = subtable_ptr(subentry); + uint16_t *src = subtable_ptr(subentry); for(int i=0; i != size; i++) handler_ref(src[i], 1); @@ -3705,7 +3705,7 @@ void address_table::subtable_close(offs_t l1index) // description of a handler //------------------------------------------------- -const char *address_table::handler_name(UINT16 entry) const +const char *address_table::handler_name(uint16_t entry) const { // banks have names if (entry >= STATIC_BANK1 && entry <= STATIC_BANKMAX) @@ -3737,7 +3737,7 @@ address_table_read::address_table_read(address_space &space, bool large) // allocate handlers for each entry, prepopulating the bankptrs for banks for (int entrynum = 0; entrynum < ARRAY_LENGTH(m_handlers); entrynum++) { - UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? space.manager().bank_pointer_addr(entrynum) : nullptr; + uint8_t **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? space.manager().bank_pointer_addr(entrynum) : nullptr; m_handlers[entrynum] = std::make_unique(space.data_width(), space.endianness(), bankptr); } @@ -3746,30 +3746,30 @@ address_table_read::address_table_read(address_space &space, bool large) { // 8-bit case case 8: - m_handlers[STATIC_UNMAP]->set_delegate(read8_delegate(FUNC(address_table_read::unmap_r), this)); - m_handlers[STATIC_NOP]->set_delegate(read8_delegate(FUNC(address_table_read::nop_r), this)); - m_handlers[STATIC_WATCHPOINT]->set_delegate(read8_delegate(FUNC(address_table_read::watchpoint_r), this)); + m_handlers[STATIC_UNMAP]->set_delegate(read8_delegate(FUNC(address_table_read::unmap_r), this)); + m_handlers[STATIC_NOP]->set_delegate(read8_delegate(FUNC(address_table_read::nop_r), this)); + m_handlers[STATIC_WATCHPOINT]->set_delegate(read8_delegate(FUNC(address_table_read::watchpoint_r), this)); break; // 16-bit case case 16: - m_handlers[STATIC_UNMAP]->set_delegate(read16_delegate(FUNC(address_table_read::unmap_r), this)); - m_handlers[STATIC_NOP]->set_delegate(read16_delegate(FUNC(address_table_read::nop_r), this)); - m_handlers[STATIC_WATCHPOINT]->set_delegate(read16_delegate(FUNC(address_table_read::watchpoint_r), this)); + m_handlers[STATIC_UNMAP]->set_delegate(read16_delegate(FUNC(address_table_read::unmap_r), this)); + m_handlers[STATIC_NOP]->set_delegate(read16_delegate(FUNC(address_table_read::nop_r), this)); + m_handlers[STATIC_WATCHPOINT]->set_delegate(read16_delegate(FUNC(address_table_read::watchpoint_r), this)); break; // 32-bit case case 32: - m_handlers[STATIC_UNMAP]->set_delegate(read32_delegate(FUNC(address_table_read::unmap_r), this)); - m_handlers[STATIC_NOP]->set_delegate(read32_delegate(FUNC(address_table_read::nop_r), this)); - m_handlers[STATIC_WATCHPOINT]->set_delegate(read32_delegate(FUNC(address_table_read::watchpoint_r), this)); + m_handlers[STATIC_UNMAP]->set_delegate(read32_delegate(FUNC(address_table_read::unmap_r), this)); + m_handlers[STATIC_NOP]->set_delegate(read32_delegate(FUNC(address_table_read::nop_r), this)); + m_handlers[STATIC_WATCHPOINT]->set_delegate(read32_delegate(FUNC(address_table_read::watchpoint_r), this)); break; // 64-bit case case 64: - m_handlers[STATIC_UNMAP]->set_delegate(read64_delegate(FUNC(address_table_read::unmap_r), this)); - m_handlers[STATIC_NOP]->set_delegate(read64_delegate(FUNC(address_table_read::nop_r), this)); - m_handlers[STATIC_WATCHPOINT]->set_delegate(read64_delegate(FUNC(address_table_read::watchpoint_r), this)); + m_handlers[STATIC_UNMAP]->set_delegate(read64_delegate(FUNC(address_table_read::unmap_r), this)); + m_handlers[STATIC_NOP]->set_delegate(read64_delegate(FUNC(address_table_read::nop_r), this)); + m_handlers[STATIC_WATCHPOINT]->set_delegate(read64_delegate(FUNC(address_table_read::watchpoint_r), this)); break; } @@ -3794,7 +3794,7 @@ address_table_read::~address_table_read() // this index //------------------------------------------------- -handler_entry &address_table_read::handler(UINT32 index) const +handler_entry &address_table_read::handler(uint32_t index) const { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; @@ -3811,7 +3811,7 @@ address_table_write::address_table_write(address_space &space, bool large) // allocate handlers for each entry, prepopulating the bankptrs for banks for (int entrynum = 0; entrynum < ARRAY_LENGTH(m_handlers); entrynum++) { - UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? space.manager().bank_pointer_addr(entrynum) : nullptr; + uint8_t **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? space.manager().bank_pointer_addr(entrynum) : nullptr; m_handlers[entrynum] = std::make_unique(space.data_width(), space.endianness(), bankptr); } @@ -3820,30 +3820,30 @@ address_table_write::address_table_write(address_space &space, bool large) { // 8-bit case case 8: - m_handlers[STATIC_UNMAP]->set_delegate(write8_delegate(FUNC(address_table_write::unmap_w), this)); - m_handlers[STATIC_NOP]->set_delegate(write8_delegate(FUNC(address_table_write::nop_w), this)); - m_handlers[STATIC_WATCHPOINT]->set_delegate(write8_delegate(FUNC(address_table_write::watchpoint_w), this)); + m_handlers[STATIC_UNMAP]->set_delegate(write8_delegate(FUNC(address_table_write::unmap_w), this)); + m_handlers[STATIC_NOP]->set_delegate(write8_delegate(FUNC(address_table_write::nop_w), this)); + m_handlers[STATIC_WATCHPOINT]->set_delegate(write8_delegate(FUNC(address_table_write::watchpoint_w), this)); break; // 16-bit case case 16: - m_handlers[STATIC_UNMAP]->set_delegate(write16_delegate(FUNC(address_table_write::unmap_w), this)); - m_handlers[STATIC_NOP]->set_delegate(write16_delegate(FUNC(address_table_write::nop_w), this)); - m_handlers[STATIC_WATCHPOINT]->set_delegate(write16_delegate(FUNC(address_table_write::watchpoint_w), this)); + m_handlers[STATIC_UNMAP]->set_delegate(write16_delegate(FUNC(address_table_write::unmap_w), this)); + m_handlers[STATIC_NOP]->set_delegate(write16_delegate(FUNC(address_table_write::nop_w), this)); + m_handlers[STATIC_WATCHPOINT]->set_delegate(write16_delegate(FUNC(address_table_write::watchpoint_w), this)); break; // 32-bit case case 32: - m_handlers[STATIC_UNMAP]->set_delegate(write32_delegate(FUNC(address_table_write::unmap_w), this)); - m_handlers[STATIC_NOP]->set_delegate(write32_delegate(FUNC(address_table_write::nop_w), this)); - m_handlers[STATIC_WATCHPOINT]->set_delegate(write32_delegate(FUNC(address_table_write::watchpoint_w), this)); + m_handlers[STATIC_UNMAP]->set_delegate(write32_delegate(FUNC(address_table_write::unmap_w), this)); + m_handlers[STATIC_NOP]->set_delegate(write32_delegate(FUNC(address_table_write::nop_w), this)); + m_handlers[STATIC_WATCHPOINT]->set_delegate(write32_delegate(FUNC(address_table_write::watchpoint_w), this)); break; // 64-bit case case 64: - m_handlers[STATIC_UNMAP]->set_delegate(write64_delegate(FUNC(address_table_write::unmap_w), this)); - m_handlers[STATIC_NOP]->set_delegate(write64_delegate(FUNC(address_table_write::nop_w), this)); - m_handlers[STATIC_WATCHPOINT]->set_delegate(write64_delegate(FUNC(address_table_write::watchpoint_w), this)); + m_handlers[STATIC_UNMAP]->set_delegate(write64_delegate(FUNC(address_table_write::unmap_w), this)); + m_handlers[STATIC_NOP]->set_delegate(write64_delegate(FUNC(address_table_write::nop_w), this)); + m_handlers[STATIC_WATCHPOINT]->set_delegate(write64_delegate(FUNC(address_table_write::watchpoint_w), this)); break; } @@ -3868,7 +3868,7 @@ address_table_write::~address_table_write() // this index //------------------------------------------------- -handler_entry &address_table_write::handler(UINT32 index) const +handler_entry &address_table_write::handler(uint32_t index) const { assert(index < ARRAY_LENGTH(m_handlers)); return *m_handlers[index]; @@ -3934,7 +3934,7 @@ bool direct_read_data::set_direct_region(offs_t &byteaddress) return false; } - UINT8 *base = *m_space.manager().bank_pointer_addr(m_entry); + uint8_t *base = *m_space.manager().bank_pointer_addr(m_entry); // compute the adjusted base offs_t maskedbits = overrideaddress & ~m_space.bytemask(); @@ -3951,7 +3951,7 @@ bool direct_read_data::set_direct_region(offs_t &byteaddress) // find_range - find a byte address in a range //------------------------------------------------- -direct_read_data::direct_range *direct_read_data::find_range(offs_t byteaddress, UINT16 &entry) +direct_read_data::direct_range *direct_read_data::find_range(offs_t byteaddress, uint16_t &entry) { // determine which entry byteaddress &= m_space.m_bytemask; @@ -4018,7 +4018,7 @@ void direct_read_data::explicit_configure(offs_t bytestart, offs_t byteend, offs m_bytestart = bytestart; m_byteend = byteend; m_bytemask = bytemask; - m_ptr = reinterpret_cast(ptr) - (bytestart & bytemask); + m_ptr = reinterpret_cast(ptr) - (bytestart & bytemask); } @@ -4036,7 +4036,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen m_space(space), m_bytestart(bytestart), m_byteend(byteend), - m_data(reinterpret_cast(memory)) + m_data(reinterpret_cast(memory)) { offs_t const length = byteend + 1 - bytestart; VPRINTF(("block_allocate('%s',%s,%08X,%08X,%p)\n", space.device().tag(), space.name(), bytestart, byteend, memory)); @@ -4054,7 +4054,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen { m_allocated.resize(length + 0xfff); memset(&m_allocated[0], 0, length + 0xfff); - m_data = reinterpret_cast((reinterpret_cast(&m_allocated[0]) + 0xfff) & ~0xfff); + m_data = reinterpret_cast((reinterpret_cast(&m_allocated[0]) + 0xfff) & ~0xfff); } } @@ -4065,7 +4065,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen { int bytes_per_element = space.data_width() / 8; std::string name = string_format("%08x-%08x", bytestart, byteend); - space.machine().save().save_memory(nullptr, "memory", space.device().tag(), space.spacenum(), name.c_str(), m_data, bytes_per_element, (UINT32)length / bytes_per_element); + space.machine().save().save_memory(nullptr, "memory", space.device().tag(), space.spacenum(), name.c_str(), m_data, bytes_per_element, (uint32_t)length / bytes_per_element); } } @@ -4176,7 +4176,7 @@ void memory_bank::set_base(void *base) throw emu_fatalerror("memory_bank::set_base called nullptr base"); // set the base and invalidate any referencing spaces - *m_baseptr = reinterpret_cast(base); + *m_baseptr = reinterpret_cast(base); invalidate_references(); } @@ -4233,7 +4233,7 @@ void memory_bank::configure_entry(int entrynum, void *base) expand_entries(entrynum); // set the entry - m_entry[entrynum].m_ptr = reinterpret_cast(base); + m_entry[entrynum].m_ptr = reinterpret_cast(base); // if the bank base is not configured, and we're the first entry, set us up if (*m_baseptr == nullptr && entrynum == 0) @@ -4249,7 +4249,7 @@ void memory_bank::configure_entries(int startentry, int numentries, void *base, { // fill in the requested bank entries (backwards to improve allocation) for (int entrynum = startentry + numentries - 1; entrynum >= startentry; entrynum--) - configure_entry(entrynum, reinterpret_cast(base) + (entrynum - startentry) * stride); + configure_entry(entrynum, reinterpret_cast(base) + (entrynum - startentry) * stride); } @@ -4261,7 +4261,7 @@ void memory_bank::configure_entries(int startentry, int numentries, void *base, // memory_region - constructor //------------------------------------------------- -memory_region::memory_region(running_machine &machine, const char *name, UINT32 length, UINT8 width, endianness_t endian) +memory_region::memory_region(running_machine &machine, const char *name, uint32_t length, uint8_t width, endianness_t endian) : m_machine(machine), m_name(name), m_buffer(length), @@ -4282,7 +4282,7 @@ memory_region::memory_region(running_machine &machine, const char *name, UINT32 // handler_entry - constructor //------------------------------------------------- -handler_entry::handler_entry(UINT8 width, endianness_t endianness, UINT8 **rambaseptr) +handler_entry::handler_entry(uint8_t width, endianness_t endianness, uint8_t **rambaseptr) : m_populated(false), m_datawidth(width), m_endianness(endianness), @@ -4337,7 +4337,7 @@ void handler_entry::copy(handler_entry *entry) //------------------------------------------------- void handler_entry::reconfigure_subunits(offs_t bytestart) { - INT32 delta = bytestart - m_bytestart; + int32_t delta = bytestart - m_bytestart; for (int i=0; i != m_subunits; i++) m_subunit_infos[i].m_offset += delta / (m_subunit_infos[i].m_size / 8); } @@ -4349,9 +4349,9 @@ void handler_entry::reconfigure_subunits(offs_t bytestart) // mask //------------------------------------------------- -void handler_entry::configure_subunits(UINT64 handlermask, int handlerbits, int &start_slot, int &end_slot) +void handler_entry::configure_subunits(uint64_t handlermask, int handlerbits, int &start_slot, int &end_slot) { - UINT64 unitmask = ((UINT64)1 << handlerbits) - 1; + uint64_t unitmask = ((uint64_t)1 << handlerbits) - 1; assert(handlermask != 0); // compute the maximum possible subunits @@ -4365,8 +4365,8 @@ void handler_entry::configure_subunits(UINT64 handlermask, int handlerbits, int int count = 0; for (int unitnum = 0; unitnum < maxunits; unitnum++) { - UINT32 shift = unitnum * handlerbits; - UINT32 scanmask = handlermask >> shift; + uint32_t shift = unitnum * handlerbits; + uint32_t scanmask = handlermask >> shift; assert((scanmask & unitmask) == 0 || (scanmask & unitmask) == unitmask); if ((scanmask & unitmask) != 0) count++; @@ -4377,7 +4377,7 @@ void handler_entry::configure_subunits(UINT64 handlermask, int handlerbits, int start_slot = m_subunits; for (int unitnum = 0; unitnum < maxunits; unitnum++) { - UINT32 shift = (unitnum^shift_xor_mask) * handlerbits; + uint32_t shift = (unitnum^shift_xor_mask) * handlerbits; if (((handlermask >> shift) & unitmask) != 0) { m_subunit_infos[m_subunits].m_bytemask = m_bytemask; @@ -4395,7 +4395,7 @@ void handler_entry::configure_subunits(UINT64 handlermask, int handlerbits, int // compute the inverse mask m_invsubmask = 0; for (int i = 0; i < m_subunits; i++) - m_invsubmask |= UINT64(m_subunit_infos[i].m_mask) << m_subunit_infos[i].m_shift; + m_invsubmask |= uint64_t(m_subunit_infos[i].m_mask) << m_subunit_infos[i].m_shift; m_invsubmask = ~m_invsubmask; } @@ -4405,7 +4405,7 @@ void handler_entry::configure_subunits(UINT64 handlermask, int handlerbits, int // conflicting with the provided mask //------------------------------------------------- -void handler_entry::clear_conflicting_subunits(UINT64 handlermask) +void handler_entry::clear_conflicting_subunits(uint64_t handlermask) { // A mask of 0 is in fact an alternative way of saying ~0 if (!handlermask) @@ -4426,7 +4426,7 @@ void handler_entry::clear_conflicting_subunits(UINT64 handlermask) // compute the inverse mask m_invsubmask = 0; for (int i = 0; i < m_subunits; i++) - m_invsubmask |= UINT64(m_subunit_infos[i].m_mask) << m_subunit_infos[i].m_shift; + m_invsubmask |= uint64_t(m_subunit_infos[i].m_mask) << m_subunit_infos[i].m_shift; m_invsubmask = ~m_invsubmask; } @@ -4437,7 +4437,7 @@ void handler_entry::clear_conflicting_subunits(UINT64 handlermask) // that's currently present //------------------------------------------------- -bool handler_entry::overriden_by_mask(UINT64 handlermask) +bool handler_entry::overriden_by_mask(uint64_t handlermask) { // A mask of 0 is in fact an alternative way of saying ~0 if (!handlermask) @@ -4570,7 +4570,7 @@ void handler_entry_read::remove_subunit(int entry) // configure a stub if necessary //------------------------------------------------- -void handler_entry_read::set_delegate(read8_delegate delegate, UINT64 mask) +void handler_entry_read::set_delegate(read8_delegate delegate, uint64_t mask) { // error if no object if (!delegate.has_object()) @@ -4607,7 +4607,7 @@ void handler_entry_read::set_delegate(read8_delegate delegate, UINT64 mask) // configure a stub if necessary //------------------------------------------------- -void handler_entry_read::set_delegate(read16_delegate delegate, UINT64 mask) +void handler_entry_read::set_delegate(read16_delegate delegate, uint64_t mask) { // error if no object if (!delegate.has_object()) @@ -4642,7 +4642,7 @@ void handler_entry_read::set_delegate(read16_delegate delegate, UINT64 mask) // configure a stub if necessary //------------------------------------------------- -void handler_entry_read::set_delegate(read32_delegate delegate, UINT64 mask) +void handler_entry_read::set_delegate(read32_delegate delegate, uint64_t mask) { // error if no object if (!delegate.has_object()) @@ -4674,7 +4674,7 @@ void handler_entry_read::set_delegate(read32_delegate delegate, UINT64 mask) // set_delegate - set a 64-bit delegate //------------------------------------------------- -void handler_entry_read::set_delegate(read64_delegate delegate, UINT64 mask) +void handler_entry_read::set_delegate(read64_delegate delegate, uint64_t mask) { // error if no object if (!delegate.has_object()) @@ -4695,13 +4695,13 @@ void handler_entry_read::set_ioport(ioport_port &ioport) { m_ioport = &ioport; if (m_datawidth == 8) - set_delegate(read8_delegate(&handler_entry_read::read_stub_ioport, ioport.tag(), this)); + set_delegate(read8_delegate(&handler_entry_read::read_stub_ioport, ioport.tag(), this)); else if (m_datawidth == 16) - set_delegate(read16_delegate(&handler_entry_read::read_stub_ioport, ioport.tag(), this)); + set_delegate(read16_delegate(&handler_entry_read::read_stub_ioport, ioport.tag(), this)); else if (m_datawidth == 32) - set_delegate(read32_delegate(&handler_entry_read::read_stub_ioport, ioport.tag(), this)); + set_delegate(read32_delegate(&handler_entry_read::read_stub_ioport, ioport.tag(), this)); else if (m_datawidth == 64) - set_delegate(read64_delegate(&handler_entry_read::read_stub_ioport, ioport.tag(), this)); + set_delegate(read64_delegate(&handler_entry_read::read_stub_ioport, ioport.tag(), this)); } @@ -4710,17 +4710,17 @@ void handler_entry_read::set_ioport(ioport_port &ioport) // 8-bit sources //------------------------------------------------- -UINT16 handler_entry_read::read_stub_16(address_space &space, offs_t offset, UINT16 mask) +uint16_t handler_entry_read::read_stub_16(address_space &space, offs_t offset, uint16_t mask) { - UINT16 result = space.unmap() & m_invsubmask; + uint16_t result = space.unmap() & m_invsubmask; for (int index = 0; index < m_subunits; index++) { const subunit_info &si = m_subunit_infos[index]; - UINT32 submask = (mask >> si.m_shift) & si.m_mask; + uint32_t submask = (mask >> si.m_shift) & si.m_mask; if (submask) { offs_t aoffset = offset * si.m_multiplier + si.m_offset; - UINT8 val; + uint8_t val; val = m_subread[index].r8(space, aoffset & si.m_bytemask, submask); result |= val << si.m_shift; } @@ -4734,17 +4734,17 @@ UINT16 handler_entry_read::read_stub_16(address_space &space, offs_t offset, UIN // 8-bit and 16-bit sources //------------------------------------------------- -UINT32 handler_entry_read::read_stub_32(address_space &space, offs_t offset, UINT32 mask) +uint32_t handler_entry_read::read_stub_32(address_space &space, offs_t offset, uint32_t mask) { - UINT32 result = space.unmap() & m_invsubmask; + uint32_t result = space.unmap() & m_invsubmask; for (int index = 0; index < m_subunits; index++) { const subunit_info &si = m_subunit_infos[index]; - UINT32 submask = (mask >> si.m_shift) & si.m_mask; + uint32_t submask = (mask >> si.m_shift) & si.m_mask; if (submask) { offs_t aoffset = offset * si.m_multiplier + si.m_offset; - UINT16 val = 0; + uint16_t val = 0; switch (si.m_size) { case 8: @@ -4766,17 +4766,17 @@ UINT32 handler_entry_read::read_stub_32(address_space &space, offs_t offset, UIN // 8-bit, 16-bit and 32-bit sources //------------------------------------------------- -UINT64 handler_entry_read::read_stub_64(address_space &space, offs_t offset, UINT64 mask) +uint64_t handler_entry_read::read_stub_64(address_space &space, offs_t offset, uint64_t mask) { - UINT64 result = space.unmap() & m_invsubmask; + uint64_t result = space.unmap() & m_invsubmask; for (int index = 0; index < m_subunits; index++) { const subunit_info &si = m_subunit_infos[index]; - UINT32 submask = (mask >> si.m_shift) & si.m_mask; + uint32_t submask = (mask >> si.m_shift) & si.m_mask; if (submask) { offs_t aoffset = offset * si.m_multiplier + si.m_offset; - UINT32 val = 0; + uint32_t val = 0; switch (si.m_size) { case 8: @@ -4789,7 +4789,7 @@ UINT64 handler_entry_read::read_stub_64(address_space &space, offs_t offset, UIN val = m_subread[index].r32(space, aoffset & si.m_bytemask, submask); break; } - result |= UINT64(val) << si.m_shift; + result |= uint64_t(val) << si.m_shift; } } return result; @@ -4884,7 +4884,7 @@ void handler_entry_write::remove_subunit(int entry) // configure a stub if necessary //------------------------------------------------- -void handler_entry_write::set_delegate(write8_delegate delegate, UINT64 mask) +void handler_entry_write::set_delegate(write8_delegate delegate, uint64_t mask) { assert(m_datawidth >= 8); @@ -4916,7 +4916,7 @@ void handler_entry_write::set_delegate(write8_delegate delegate, UINT64 mask) // configure a stub if necessary //------------------------------------------------- -void handler_entry_write::set_delegate(write16_delegate delegate, UINT64 mask) +void handler_entry_write::set_delegate(write16_delegate delegate, uint64_t mask) { assert(m_datawidth >= 16); @@ -4946,7 +4946,7 @@ void handler_entry_write::set_delegate(write16_delegate delegate, UINT64 mask) // configure a stub if necessary //------------------------------------------------- -void handler_entry_write::set_delegate(write32_delegate delegate, UINT64 mask) +void handler_entry_write::set_delegate(write32_delegate delegate, uint64_t mask) { assert(m_datawidth >= 32); @@ -4973,7 +4973,7 @@ void handler_entry_write::set_delegate(write32_delegate delegate, UINT64 mask) // set_delegate - set a 64-bit delegate //------------------------------------------------- -void handler_entry_write::set_delegate(write64_delegate delegate, UINT64 mask) +void handler_entry_write::set_delegate(write64_delegate delegate, uint64_t mask) { assert(m_datawidth >= 64); m_write.w64 = delegate; @@ -4989,13 +4989,13 @@ void handler_entry_write::set_ioport(ioport_port &ioport) { m_ioport = &ioport; if (m_datawidth == 8) - set_delegate(write8_delegate(&handler_entry_write::write_stub_ioport, ioport.tag(), this)); + set_delegate(write8_delegate(&handler_entry_write::write_stub_ioport, ioport.tag(), this)); else if (m_datawidth == 16) - set_delegate(write16_delegate(&handler_entry_write::write_stub_ioport, ioport.tag(), this)); + set_delegate(write16_delegate(&handler_entry_write::write_stub_ioport, ioport.tag(), this)); else if (m_datawidth == 32) - set_delegate(write32_delegate(&handler_entry_write::write_stub_ioport, ioport.tag(), this)); + set_delegate(write32_delegate(&handler_entry_write::write_stub_ioport, ioport.tag(), this)); else if (m_datawidth == 64) - set_delegate(write64_delegate(&handler_entry_write::write_stub_ioport, ioport.tag(), this)); + set_delegate(write64_delegate(&handler_entry_write::write_stub_ioport, ioport.tag(), this)); } @@ -5004,16 +5004,16 @@ void handler_entry_write::set_ioport(ioport_port &ioport) // 8-bit sources //------------------------------------------------- -void handler_entry_write::write_stub_16(address_space &space, offs_t offset, UINT16 data, UINT16 mask) +void handler_entry_write::write_stub_16(address_space &space, offs_t offset, uint16_t data, uint16_t mask) { for (int index = 0; index < m_subunits; index++) { const subunit_info &si = m_subunit_infos[index]; - UINT32 submask = (mask >> si.m_shift) & si.m_mask; + uint32_t submask = (mask >> si.m_shift) & si.m_mask; if (submask) { offs_t aoffset = offset * si.m_multiplier + si.m_offset; - UINT8 adata = data >> si.m_shift; + uint8_t adata = data >> si.m_shift; m_subwrite[index].w8(space, aoffset & si.m_bytemask, adata, submask); } } @@ -5025,16 +5025,16 @@ void handler_entry_write::write_stub_16(address_space &space, offs_t offset, UIN // 8-bit and 16-bit sources //------------------------------------------------- -void handler_entry_write::write_stub_32(address_space &space, offs_t offset, UINT32 data, UINT32 mask) +void handler_entry_write::write_stub_32(address_space &space, offs_t offset, uint32_t data, uint32_t mask) { for (int index = 0; index < m_subunits; index++) { const subunit_info &si = m_subunit_infos[index]; - UINT32 submask = (mask >> si.m_shift) & si.m_mask; + uint32_t submask = (mask >> si.m_shift) & si.m_mask; if (submask) { offs_t aoffset = offset * si.m_multiplier + si.m_offset; - UINT16 adata = data >> si.m_shift; + uint16_t adata = data >> si.m_shift; switch (si.m_size) { case 8: @@ -5054,16 +5054,16 @@ void handler_entry_write::write_stub_32(address_space &space, offs_t offset, UIN // 8-bit, 16-bit and 32-bit sources //------------------------------------------------- -void handler_entry_write::write_stub_64(address_space &space, offs_t offset, UINT64 data, UINT64 mask) +void handler_entry_write::write_stub_64(address_space &space, offs_t offset, uint64_t data, uint64_t mask) { for (int index = 0; index < m_subunits; index++) { const subunit_info &si = m_subunit_infos[index]; - UINT32 submask = (mask >> si.m_shift) & si.m_mask; + uint32_t submask = (mask >> si.m_shift) & si.m_mask; if (submask) { offs_t aoffset = offset * si.m_multiplier + si.m_offset; - UINT32 adata = data >> si.m_shift; + uint32_t adata = data >> si.m_shift; switch (si.m_size) { case 8: diff --git a/src/emu/emumem.h b/src/emu/emumem.h index 85242882d90..3bad3d4da23 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -77,7 +77,7 @@ class address_table_setoffset; // offsets and addresses are 32-bit (for now...) -typedef UINT32 offs_t; +typedef uint32_t offs_t; // address map constructors are functions that build up an address_map typedef void (*address_map_constructor)(address_map &map, device_t &devconfig); @@ -88,21 +88,21 @@ typedef delegate address_map_delegate; // struct with function pointers for accessors; use is generally discouraged unless necessary struct data_accessors { - UINT8 (*read_byte)(address_space &space, offs_t byteaddress); - UINT16 (*read_word)(address_space &space, offs_t byteaddress); - UINT16 (*read_word_masked)(address_space &space, offs_t byteaddress, UINT16 mask); - UINT32 (*read_dword)(address_space &space, offs_t byteaddress); - UINT32 (*read_dword_masked)(address_space &space, offs_t byteaddress, UINT32 mask); - UINT64 (*read_qword)(address_space &space, offs_t byteaddress); - UINT64 (*read_qword_masked)(address_space &space, offs_t byteaddress, UINT64 mask); - - void (*write_byte)(address_space &space, offs_t byteaddress, UINT8 data); - void (*write_word)(address_space &space, offs_t byteaddress, UINT16 data); - void (*write_word_masked)(address_space &space, offs_t byteaddress, UINT16 data, UINT16 mask); - void (*write_dword)(address_space &space, offs_t byteaddress, UINT32 data); - void (*write_dword_masked)(address_space &space, offs_t byteaddress, UINT32 data, UINT32 mask); - void (*write_qword)(address_space &space, offs_t byteaddress, UINT64 data); - void (*write_qword_masked)(address_space &space, offs_t byteaddress, UINT64 data, UINT64 mask); + uint8_t (*read_byte)(address_space &space, offs_t byteaddress); + uint16_t (*read_word)(address_space &space, offs_t byteaddress); + uint16_t (*read_word_masked)(address_space &space, offs_t byteaddress, uint16_t mask); + uint32_t (*read_dword)(address_space &space, offs_t byteaddress); + uint32_t (*read_dword_masked)(address_space &space, offs_t byteaddress, uint32_t mask); + uint64_t (*read_qword)(address_space &space, offs_t byteaddress); + uint64_t (*read_qword_masked)(address_space &space, offs_t byteaddress, uint64_t mask); + + void (*write_byte)(address_space &space, offs_t byteaddress, uint8_t data); + void (*write_word)(address_space &space, offs_t byteaddress, uint16_t data); + void (*write_word_masked)(address_space &space, offs_t byteaddress, uint16_t data, uint16_t mask); + void (*write_dword)(address_space &space, offs_t byteaddress, uint32_t data); + void (*write_dword_masked)(address_space &space, offs_t byteaddress, uint32_t data, uint32_t mask); + void (*write_qword)(address_space &space, offs_t byteaddress, uint64_t data); + void (*write_qword_masked)(address_space &space, offs_t byteaddress, uint64_t data, uint64_t mask); }; @@ -115,19 +115,19 @@ typedef delegate direct_update_delegate; // ======================> read_delegate // declare delegates for each width -typedef device_delegate read8_delegate; -typedef device_delegate read16_delegate; -typedef device_delegate read32_delegate; -typedef device_delegate read64_delegate; +typedef device_delegate read8_delegate; +typedef device_delegate read16_delegate; +typedef device_delegate read32_delegate; +typedef device_delegate read64_delegate; // ======================> write_delegate // declare delegates for each width -typedef device_delegate write8_delegate; -typedef device_delegate write16_delegate; -typedef device_delegate write32_delegate; -typedef device_delegate write64_delegate; +typedef device_delegate write8_delegate; +typedef device_delegate write16_delegate; +typedef device_delegate write32_delegate; +typedef device_delegate write64_delegate; // ======================> setoffset_delegate @@ -165,14 +165,14 @@ public: // getters address_space &space() const { return m_space; } - UINT8 *ptr() const { return m_ptr; } + uint8_t *ptr() const { return m_ptr; } // see if an address is within bounds, or attempt to update it if not bool address_is_valid(offs_t byteaddress) { return EXPECTED(byteaddress >= m_bytestart && byteaddress <= m_byteend) || set_direct_region(byteaddress); } // force a recomputation on the next read void force_update() { m_byteend = 0; m_bytestart = 1; } - void force_update(UINT16 if_match) { if (m_entry == if_match) force_update(); } + void force_update(uint16_t if_match) { if (m_entry == if_match) force_update(); } // custom update callbacks and configuration direct_update_delegate set_direct_update(direct_update_delegate function); @@ -180,24 +180,24 @@ public: // accessor methods void *read_ptr(offs_t byteaddress, offs_t directxor = 0); - UINT8 read_byte(offs_t byteaddress, offs_t directxor = 0); - UINT16 read_word(offs_t byteaddress, offs_t directxor = 0); - UINT32 read_dword(offs_t byteaddress, offs_t directxor = 0); - UINT64 read_qword(offs_t byteaddress, offs_t directxor = 0); + uint8_t read_byte(offs_t byteaddress, offs_t directxor = 0); + uint16_t read_word(offs_t byteaddress, offs_t directxor = 0); + uint32_t read_dword(offs_t byteaddress, offs_t directxor = 0); + uint64_t read_qword(offs_t byteaddress, offs_t directxor = 0); private: // internal helpers bool set_direct_region(offs_t &byteaddress); - direct_range *find_range(offs_t byteaddress, UINT16 &entry); + direct_range *find_range(offs_t byteaddress, uint16_t &entry); void remove_intersecting_ranges(offs_t bytestart, offs_t byteend); // internal state address_space & m_space; - UINT8 * m_ptr; // direct access data pointer + uint8_t * m_ptr; // direct access data pointer offs_t m_bytemask; // byte address mask offs_t m_bytestart; // minimum valid byte address offs_t m_byteend; // maximum valid byte address - UINT16 m_entry; // live entry + uint16_t m_entry; // live entry std::list m_rangelist[TOTAL_MEMORY_BANKS]; // list of ranges for each entry direct_update_delegate m_directupdate; // fast direct-access update callback }; @@ -211,10 +211,10 @@ class address_space_config public: // construction/destruction address_space_config(); - address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift = 0, address_map_constructor internal = nullptr, address_map_constructor defmap = nullptr); - address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, UINT8 logwidth, UINT8 pageshift, address_map_constructor internal = nullptr, address_map_constructor defmap = nullptr); - address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, address_map_delegate internal, address_map_delegate defmap = address_map_delegate()); - address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, UINT8 logwidth, UINT8 pageshift, address_map_delegate internal, address_map_delegate defmap = address_map_delegate()); + address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift = 0, address_map_constructor internal = nullptr, address_map_constructor defmap = nullptr); + address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, uint8_t logwidth, uint8_t pageshift, address_map_constructor internal = nullptr, address_map_constructor defmap = nullptr); + address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, address_map_delegate internal, address_map_delegate defmap = address_map_delegate()); + address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, uint8_t logwidth, uint8_t pageshift, address_map_delegate internal, address_map_delegate defmap = address_map_delegate()); // getters const char *name() const { return m_name; } @@ -231,11 +231,11 @@ public: // state const char * m_name; endianness_t m_endianness; - UINT8 m_databus_width; - UINT8 m_addrbus_width; - INT8 m_addrbus_shift; - UINT8 m_logaddr_width; - UINT8 m_page_shift; + uint8_t m_databus_width; + uint8_t m_addrbus_width; + int8_t m_addrbus_shift; + uint8_t m_logaddr_width; + uint8_t m_page_shift; bool m_is_octal; // to determine if messages/debugger will show octal or hex address_map_constructor m_internal_map; @@ -278,15 +278,15 @@ public: int data_width() const { return m_config.data_width(); } int addr_width() const { return m_config.addr_width(); } endianness_t endianness() const { return m_config.endianness(); } - UINT64 unmap() const { return m_unmap; } + uint64_t unmap() const { return m_unmap; } bool is_octal() const { return m_config.m_is_octal; } offs_t addrmask() const { return m_addrmask; } offs_t bytemask() const { return m_bytemask; } - UINT8 addrchars() const { return m_addrchars; } + uint8_t addrchars() const { return m_addrchars; } offs_t logaddrmask() const { return m_logaddrmask; } offs_t logbytemask() const { return m_logbytemask; } - UINT8 logaddrchars() const { return m_logaddrchars; } + uint8_t logaddrchars() const { return m_logaddrchars; } // debug helpers const char *get_handler_string(read_or_write readorwrite, offs_t byteaddress); @@ -306,34 +306,34 @@ public: virtual void *get_write_ptr(offs_t byteaddress) = 0; // read accessors - virtual UINT8 read_byte(offs_t byteaddress) = 0; - virtual UINT16 read_word(offs_t byteaddress) = 0; - virtual UINT16 read_word(offs_t byteaddress, UINT16 mask) = 0; - virtual UINT16 read_word_unaligned(offs_t byteaddress) = 0; - virtual UINT16 read_word_unaligned(offs_t byteaddress, UINT16 mask) = 0; - virtual UINT32 read_dword(offs_t byteaddress) = 0; - virtual UINT32 read_dword(offs_t byteaddress, UINT32 mask) = 0; - virtual UINT32 read_dword_unaligned(offs_t byteaddress) = 0; - virtual UINT32 read_dword_unaligned(offs_t byteaddress, UINT32 mask) = 0; - virtual UINT64 read_qword(offs_t byteaddress) = 0; - virtual UINT64 read_qword(offs_t byteaddress, UINT64 mask) = 0; - virtual UINT64 read_qword_unaligned(offs_t byteaddress) = 0; - virtual UINT64 read_qword_unaligned(offs_t byteaddress, UINT64 mask) = 0; + virtual uint8_t read_byte(offs_t byteaddress) = 0; + virtual uint16_t read_word(offs_t byteaddress) = 0; + virtual uint16_t read_word(offs_t byteaddress, uint16_t mask) = 0; + virtual uint16_t read_word_unaligned(offs_t byteaddress) = 0; + virtual uint16_t read_word_unaligned(offs_t byteaddress, uint16_t mask) = 0; + virtual uint32_t read_dword(offs_t byteaddress) = 0; + virtual uint32_t read_dword(offs_t byteaddress, uint32_t mask) = 0; + virtual uint32_t read_dword_unaligned(offs_t byteaddress) = 0; + virtual uint32_t read_dword_unaligned(offs_t byteaddress, uint32_t mask) = 0; + virtual uint64_t read_qword(offs_t byteaddress) = 0; + virtual uint64_t read_qword(offs_t byteaddress, uint64_t mask) = 0; + virtual uint64_t read_qword_unaligned(offs_t byteaddress) = 0; + virtual uint64_t read_qword_unaligned(offs_t byteaddress, uint64_t mask) = 0; // write accessors - virtual void write_byte(offs_t byteaddress, UINT8 data) = 0; - virtual void write_word(offs_t byteaddress, UINT16 data) = 0; - virtual void write_word(offs_t byteaddress, UINT16 data, UINT16 mask) = 0; - virtual void write_word_unaligned(offs_t byteaddress, UINT16 data) = 0; - virtual void write_word_unaligned(offs_t byteaddress, UINT16 data, UINT16 mask) = 0; - virtual void write_dword(offs_t byteaddress, UINT32 data) = 0; - virtual void write_dword(offs_t byteaddress, UINT32 data, UINT32 mask) = 0; - virtual void write_dword_unaligned(offs_t byteaddress, UINT32 data) = 0; - virtual void write_dword_unaligned(offs_t byteaddress, UINT32 data, UINT32 mask) = 0; - virtual void write_qword(offs_t byteaddress, UINT64 data) = 0; - virtual void write_qword(offs_t byteaddress, UINT64 data, UINT64 mask) = 0; - virtual void write_qword_unaligned(offs_t byteaddress, UINT64 data) = 0; - virtual void write_qword_unaligned(offs_t byteaddress, UINT64 data, UINT64 mask) = 0; + virtual void write_byte(offs_t byteaddress, uint8_t data) = 0; + virtual void write_word(offs_t byteaddress, uint16_t data) = 0; + virtual void write_word(offs_t byteaddress, uint16_t data, uint16_t mask) = 0; + virtual void write_word_unaligned(offs_t byteaddress, uint16_t data) = 0; + virtual void write_word_unaligned(offs_t byteaddress, uint16_t data, uint16_t mask) = 0; + virtual void write_dword(offs_t byteaddress, uint32_t data) = 0; + virtual void write_dword(offs_t byteaddress, uint32_t data, uint32_t mask) = 0; + virtual void write_dword_unaligned(offs_t byteaddress, uint32_t data) = 0; + virtual void write_dword_unaligned(offs_t byteaddress, uint32_t data, uint32_t mask) = 0; + virtual void write_qword(offs_t byteaddress, uint64_t data) = 0; + virtual void write_qword(offs_t byteaddress, uint64_t data, uint64_t mask) = 0; + virtual void write_qword_unaligned(offs_t byteaddress, uint64_t data) = 0; + virtual void write_qword_unaligned(offs_t byteaddress, uint64_t data, uint64_t mask) = 0; // Set address. This will invoke setoffset handlers for the respective entries. virtual void set_address(offs_t byteaddress) = 0; @@ -384,44 +384,44 @@ public: void install_ram(offs_t addrstart, offs_t addrend, offs_t addrmirror, void *baseptr = nullptr) { install_ram_generic(addrstart, addrend, addrmirror, ROW_READWRITE, baseptr); } // install device memory maps - template void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(address_map &map, device_t &device), int bits = 0, UINT64 unitmask = 0) { + template void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(address_map &map, device_t &device), int bits = 0, uint64_t unitmask = 0) { address_map_delegate delegate(map, "dynamic_device_install", &device); install_device_delegate(addrstart, addrend, device, delegate, bits, unitmask); } - void install_device_delegate(offs_t addrstart, offs_t addrend, device_t &device, address_map_delegate &map, int bits = 0, UINT64 unitmask = 0); + void install_device_delegate(offs_t addrstart, offs_t addrend, device_t &device, address_map_delegate &map, int bits = 0, uint64_t unitmask = 0); // install setoffset handler - void install_setoffset_handler(offs_t addrstart, offs_t addrend, setoffset_delegate sohandler, UINT64 unitmask = 0) { install_setoffset_handler(addrstart, addrend, 0, 0, 0, sohandler, unitmask); } - void install_setoffset_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, setoffset_delegate sohandler, UINT64 unitmask = 0); + void install_setoffset_handler(offs_t addrstart, offs_t addrend, setoffset_delegate sohandler, uint64_t unitmask = 0) { install_setoffset_handler(addrstart, addrend, 0, 0, 0, sohandler, unitmask); } + void install_setoffset_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, setoffset_delegate sohandler, uint64_t unitmask = 0); // install new-style delegate handlers (short form) - void install_read_handler(offs_t addrstart, offs_t addrend, read8_delegate rhandler, UINT64 unitmask = 0) { install_read_handler(addrstart, addrend, 0, 0, 0, rhandler, unitmask); } - void install_write_handler(offs_t addrstart, offs_t addrend, write8_delegate whandler, UINT64 unitmask = 0) { install_write_handler(addrstart, addrend, 0, 0, 0, whandler, unitmask); } - void install_readwrite_handler(offs_t addrstart, offs_t addrend, read8_delegate rhandler, write8_delegate whandler, UINT64 unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, 0, rhandler, whandler, unitmask); } - void install_read_handler(offs_t addrstart, offs_t addrend, read16_delegate rhandler, UINT64 unitmask = 0) { install_read_handler(addrstart, addrend, 0, 0, 0, rhandler, unitmask); } - void install_write_handler(offs_t addrstart, offs_t addrend, write16_delegate whandler, UINT64 unitmask = 0) { install_write_handler(addrstart, addrend, 0, 0, 0, whandler, unitmask); } - void install_readwrite_handler(offs_t addrstart, offs_t addrend, read16_delegate rhandler, write16_delegate whandler, UINT64 unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, 0, rhandler, whandler, unitmask); } - void install_read_handler(offs_t addrstart, offs_t addrend, read32_delegate rhandler, UINT64 unitmask = 0) { install_read_handler(addrstart, addrend, 0, 0, 0, rhandler, unitmask); } - void install_write_handler(offs_t addrstart, offs_t addrend, write32_delegate whandler, UINT64 unitmask = 0) { install_write_handler(addrstart, addrend, 0, 0, 0, whandler, unitmask); } - void install_readwrite_handler(offs_t addrstart, offs_t addrend, read32_delegate rhandler, write32_delegate whandler, UINT64 unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, 0, rhandler, whandler, unitmask); } - void install_read_handler(offs_t addrstart, offs_t addrend, read64_delegate rhandler, UINT64 unitmask = 0) { install_read_handler(addrstart, addrend, 0, 0, 0, rhandler, unitmask); } - void install_write_handler(offs_t addrstart, offs_t addrend, write64_delegate whandler, UINT64 unitmask = 0) { install_write_handler(addrstart, addrend, 0, 0, 0, whandler, unitmask); } - void install_readwrite_handler(offs_t addrstart, offs_t addrend, read64_delegate rhandler, write64_delegate whandler, UINT64 unitmask = 0) { install_readwrite_handler(addrstart, addrend, 0, 0, 0, rhandler, whandler, unitmask); } + void install_read_handler(offs_t addrstart, offs_t addrend, read8_delegate rhandler, uint64_t unitmask = 0) { install_read_handler(addrstart, addrend, 0, 0, 0, rhandler, unitmask); } + void install_write_handler(offs_t addrstart, offs_t addrend, write8_delegate whandler, uint64_t unitmask = 0) { install_write_handler(addrstart, addrend, 0, 0, 0, whandler, unitmask); } + void install_readwrite_handler(offs_t addrstart, offs_t addrend, read8_delegate rhandler, write8_delegate whandler, uint64_t unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, 0, rhandler, whandler, unitmask); } + void install_read_handler(offs_t addrstart, offs_t addrend, read16_delegate rhandler, uint64_t unitmask = 0) { install_read_handler(addrstart, addrend, 0, 0, 0, rhandler, unitmask); } + void install_write_handler(offs_t addrstart, offs_t addrend, write16_delegate whandler, uint64_t unitmask = 0) { install_write_handler(addrstart, addrend, 0, 0, 0, whandler, unitmask); } + void install_readwrite_handler(offs_t addrstart, offs_t addrend, read16_delegate rhandler, write16_delegate whandler, uint64_t unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, 0, rhandler, whandler, unitmask); } + void install_read_handler(offs_t addrstart, offs_t addrend, read32_delegate rhandler, uint64_t unitmask = 0) { install_read_handler(addrstart, addrend, 0, 0, 0, rhandler, unitmask); } + void install_write_handler(offs_t addrstart, offs_t addrend, write32_delegate whandler, uint64_t unitmask = 0) { install_write_handler(addrstart, addrend, 0, 0, 0, whandler, unitmask); } + void install_readwrite_handler(offs_t addrstart, offs_t addrend, read32_delegate rhandler, write32_delegate whandler, uint64_t unitmask = 0) { return install_readwrite_handler(addrstart, addrend, 0, 0, 0, rhandler, whandler, unitmask); } + void install_read_handler(offs_t addrstart, offs_t addrend, read64_delegate rhandler, uint64_t unitmask = 0) { install_read_handler(addrstart, addrend, 0, 0, 0, rhandler, unitmask); } + void install_write_handler(offs_t addrstart, offs_t addrend, write64_delegate whandler, uint64_t unitmask = 0) { install_write_handler(addrstart, addrend, 0, 0, 0, whandler, unitmask); } + void install_readwrite_handler(offs_t addrstart, offs_t addrend, read64_delegate rhandler, write64_delegate whandler, uint64_t unitmask = 0) { install_readwrite_handler(addrstart, addrend, 0, 0, 0, rhandler, whandler, unitmask); } // install new-style delegate handlers (with mirror/mask) - void install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read8_delegate rhandler, UINT64 unitmask = 0); - void install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write8_delegate whandler, UINT64 unitmask = 0); - void install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read8_delegate rhandler, write8_delegate whandler, UINT64 unitmask = 0); - void install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read16_delegate rhandler, UINT64 unitmask = 0); - void install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write16_delegate whandler, UINT64 unitmask = 0); - void install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read16_delegate rhandler, write16_delegate whandler, UINT64 unitmask = 0); - void install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read32_delegate rhandler, UINT64 unitmask = 0); - void install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write32_delegate whandler, UINT64 unitmask = 0); - void install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read32_delegate rhandler, write32_delegate whandler, UINT64 unitmask = 0); - void install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read64_delegate rhandler, UINT64 unitmask = 0); - void install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write64_delegate whandler, UINT64 unitmask = 0); - void install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read64_delegate rhandler, write64_delegate whandler, UINT64 unitmask = 0); + void install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read8_delegate rhandler, uint64_t unitmask = 0); + void install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write8_delegate whandler, uint64_t unitmask = 0); + void install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read8_delegate rhandler, write8_delegate whandler, uint64_t unitmask = 0); + void install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read16_delegate rhandler, uint64_t unitmask = 0); + void install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write16_delegate whandler, uint64_t unitmask = 0); + void install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read16_delegate rhandler, write16_delegate whandler, uint64_t unitmask = 0); + void install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read32_delegate rhandler, uint64_t unitmask = 0); + void install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write32_delegate whandler, uint64_t unitmask = 0); + void install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read32_delegate rhandler, write32_delegate whandler, uint64_t unitmask = 0); + void install_read_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read64_delegate rhandler, uint64_t unitmask = 0); + void install_write_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, write64_delegate whandler, uint64_t unitmask = 0); + void install_readwrite_handler(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, read64_delegate rhandler, write64_delegate whandler, uint64_t unitmask = 0); // setup void prepare_map(); @@ -446,7 +446,7 @@ private: bool needs_backing_store(const address_map_entry &entry); memory_bank &bank_find_or_allocate(const char *tag, offs_t addrstart, offs_t addrend, offs_t addrmirror, read_or_write readorwrite); memory_bank *bank_find_anonymous(offs_t bytestart, offs_t byteend) const; - address_map_entry *block_assign_intersecting(offs_t bytestart, offs_t byteend, UINT8 *base); + address_map_entry *block_assign_intersecting(offs_t bytestart, offs_t byteend, uint8_t *base); void check_optimize_all(const char *function, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, offs_t &nstart, offs_t &nend, offs_t &nmask, offs_t &nmirror); void check_optimize_mirror(const char *function, offs_t addrstart, offs_t addrend, offs_t addrmirror, offs_t &nstart, offs_t &nend, offs_t &nmask, offs_t &nmirror); void check_address(const char *function, offs_t addrstart, offs_t addrend); @@ -460,14 +460,14 @@ protected: offs_t m_bytemask; // byte-converted physical address mask offs_t m_logaddrmask; // logical address mask offs_t m_logbytemask; // byte-converted logical address mask - UINT64 m_unmap; // unmapped value + uint64_t m_unmap; // unmapped value address_spacenum m_spacenum; // address space index bool m_debugger_access; // treat accesses as coming from the debugger bool m_log_unmap; // log unmapped accesses in this space? std::unique_ptr m_direct; // fast direct-access read info const char * m_name; // friendly name of the address space - UINT8 m_addrchars; // number of characters to use for physical addresses - UINT8 m_logaddrchars; // number of characters to use for logical addresses + uint8_t m_addrchars; // number of characters to use for physical addresses + uint8_t m_logaddrchars; // number of characters to use for logical addresses private: memory_manager & m_manager; // reference to the owning manager @@ -518,7 +518,7 @@ public: running_machine &machine() const { return m_machine; } offs_t bytestart() const { return m_bytestart; } offs_t byteend() const { return m_byteend; } - UINT8 *data() const { return m_data; } + uint8_t *data() const { return m_data; } // is the given range contained by this memory block? bool contains(address_space &space, offs_t bytestart, offs_t byteend) const @@ -531,8 +531,8 @@ private: running_machine & m_machine; // need the machine to free our memory address_space & m_space; // which address space are we associated with? offs_t m_bytestart, m_byteend; // byte-normalized start/end for verifying a match - UINT8 * m_data; // pointer to the data for this block - std::vector m_allocated; // pointer to the actually allocated block + uint8_t * m_data; // pointer to the data for this block + std::vector m_allocated; // pointer to the actually allocated block }; @@ -568,7 +568,7 @@ class memory_bank // a bank_entry contains a pointer struct bank_entry { - UINT8 * m_ptr; + uint8_t * m_ptr; }; public: @@ -611,8 +611,8 @@ private: // internal state running_machine & m_machine; // need the machine to free our memory - UINT8 ** m_baseptr; // pointer to our base pointer in the global array - UINT16 m_index; // array index for this handler + uint8_t ** m_baseptr; // pointer to our base pointer in the global array + uint16_t m_index; // array index for this handler bool m_anonymous; // are we anonymous or explicit? offs_t m_bytestart; // byte-adjusted start offset offs_t m_byteend; // byte-adjusted end offset @@ -631,7 +631,7 @@ class memory_share { public: // construction/destruction - memory_share(UINT8 width, size_t bytes, endianness_t endianness, void *ptr = nullptr) + memory_share(uint8_t width, size_t bytes, endianness_t endianness, void *ptr = nullptr) : m_ptr(ptr), m_bytes(bytes), m_endianness(endianness), @@ -643,8 +643,8 @@ public: void *ptr() const { return m_ptr; } size_t bytes() const { return m_bytes; } endianness_t endianness() const { return m_endianness; } - UINT8 bitwidth() const { return m_bitwidth; } - UINT8 bytewidth() const { return m_bytewidth; } + uint8_t bitwidth() const { return m_bitwidth; } + uint8_t bytewidth() const { return m_bytewidth; } // setters void set_ptr(void *ptr) { m_ptr = ptr; } @@ -654,8 +654,8 @@ private: void * m_ptr; // pointer to the memory backing the region size_t m_bytes; // size of the shared region in bytes endianness_t m_endianness; // endianness of the memory - UINT8 m_bitwidth; // width of the shared region in bits - UINT8 m_bytewidth; // width in bytes, rounded up to a power of 2 + uint8_t m_bitwidth; // width of the shared region in bits + uint8_t m_bytewidth; // width in bytes, rounded up to a power of 2 }; @@ -670,34 +670,34 @@ class memory_region friend class memory_manager; public: // construction/destruction - memory_region(running_machine &machine, const char *name, UINT32 length, UINT8 width, endianness_t endian); + memory_region(running_machine &machine, const char *name, uint32_t length, uint8_t width, endianness_t endian); // getters running_machine &machine() const { return m_machine; } - UINT8 *base() { return (m_buffer.size() > 0) ? &m_buffer[0] : nullptr; } - UINT8 *end() { return base() + m_buffer.size(); } - UINT32 bytes() const { return m_buffer.size(); } + uint8_t *base() { return (m_buffer.size() > 0) ? &m_buffer[0] : nullptr; } + uint8_t *end() { return base() + m_buffer.size(); } + uint32_t bytes() const { return m_buffer.size(); } const char *name() const { return m_name.c_str(); } // flag expansion endianness_t endianness() const { return m_endianness; } - UINT8 bitwidth() const { return m_bitwidth; } - UINT8 bytewidth() const { return m_bytewidth; } + uint8_t bitwidth() const { return m_bitwidth; } + uint8_t bytewidth() const { return m_bytewidth; } // data access - UINT8 &u8(offs_t offset = 0) { return m_buffer[offset]; } - UINT16 &u16(offs_t offset = 0) { return reinterpret_cast(base())[offset]; } - UINT32 &u32(offs_t offset = 0) { return reinterpret_cast(base())[offset]; } - UINT64 &u64(offs_t offset = 0) { return reinterpret_cast(base())[offset]; } + uint8_t &u8(offs_t offset = 0) { return m_buffer[offset]; } + uint16_t &u16(offs_t offset = 0) { return reinterpret_cast(base())[offset]; } + uint32_t &u32(offs_t offset = 0) { return reinterpret_cast(base())[offset]; } + uint64_t &u64(offs_t offset = 0) { return reinterpret_cast(base())[offset]; } private: // internal data running_machine & m_machine; std::string m_name; - std::vector m_buffer; + std::vector m_buffer; endianness_t m_endianness; - UINT8 m_bitwidth; - UINT8 m_bytewidth; + uint8_t m_bitwidth; + uint8_t m_bytewidth; }; @@ -708,7 +708,7 @@ private: class memory_manager { friend class address_space; - friend memory_region::memory_region(running_machine &machine, const char *name, UINT32 length, UINT8 width, endianness_t endian); + friend memory_region::memory_region(running_machine &machine, const char *name, uint32_t length, uint8_t width, endianness_t endian); public: // construction/destruction memory_manager(running_machine &machine); @@ -724,10 +724,10 @@ public: void dump(FILE *file); // pointers to a bank pointer (internal usage only) - UINT8 **bank_pointer_addr(UINT8 index) { return &m_bank_ptr[index]; } + uint8_t **bank_pointer_addr(uint8_t index) { return &m_bank_ptr[index]; } // regions - memory_region *region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian); + memory_region *region_alloc(const char *name, uint32_t length, uint8_t width, endianness_t endian); void region_free(const char *name); memory_region *region_containing(const void *memory, offs_t bytes) const; @@ -739,13 +739,13 @@ private: running_machine & m_machine; // reference to the machine bool m_initialized; // have we completed initialization? - UINT8 * m_bank_ptr[TOTAL_MEMORY_BANKS]; // array of bank pointers + uint8_t * m_bank_ptr[TOTAL_MEMORY_BANKS]; // array of bank pointers std::vector> m_spacelist; // list of address spaces std::vector> m_blocklist; // head of the list of memory blocks std::unordered_map> m_banklist; // data gathered for each bank - UINT16 m_banknext; // next bank to allocate + uint16_t m_banknext; // next bank to allocate std::unordered_map> m_sharelist; // map for share lookups @@ -765,23 +765,23 @@ private: // space read/write handler function macros -#define READ8_MEMBER(name) UINT8 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask) -#define WRITE8_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask) -#define READ16_MEMBER(name) UINT16 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask) -#define WRITE16_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask) -#define READ32_MEMBER(name) UINT32 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask) -#define WRITE32_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask) -#define READ64_MEMBER(name) UINT64 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask) -#define WRITE64_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask) - -#define DECLARE_READ8_MEMBER(name) UINT8 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 mem_mask = 0xff) -#define DECLARE_WRITE8_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask = 0xff) -#define DECLARE_READ16_MEMBER(name) UINT16 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask = 0xffff) -#define DECLARE_WRITE16_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask = 0xffff) -#define DECLARE_READ32_MEMBER(name) UINT32 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask = 0xffffffff) -#define DECLARE_WRITE32_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask = 0xffffffff) -#define DECLARE_READ64_MEMBER(name) UINT64 name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask = U64(0xffffffffffffffff)) -#define DECLARE_WRITE64_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask = U64(0xffffffffffffffff)) +#define READ8_MEMBER(name) uint8_t name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t mem_mask) +#define WRITE8_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t data, ATTR_UNUSED uint8_t mem_mask) +#define READ16_MEMBER(name) uint16_t name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint16_t mem_mask) +#define WRITE16_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint16_t data, ATTR_UNUSED uint16_t mem_mask) +#define READ32_MEMBER(name) uint32_t name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint32_t mem_mask) +#define WRITE32_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint32_t data, ATTR_UNUSED uint32_t mem_mask) +#define READ64_MEMBER(name) uint64_t name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint64_t mem_mask) +#define WRITE64_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint64_t data, ATTR_UNUSED uint64_t mem_mask) + +#define DECLARE_READ8_MEMBER(name) uint8_t name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t mem_mask = 0xff) +#define DECLARE_WRITE8_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t data, ATTR_UNUSED uint8_t mem_mask = 0xff) +#define DECLARE_READ16_MEMBER(name) uint16_t name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint16_t mem_mask = 0xffff) +#define DECLARE_WRITE16_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint16_t data, ATTR_UNUSED uint16_t mem_mask = 0xffff) +#define DECLARE_READ32_MEMBER(name) uint32_t name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint32_t mem_mask = 0xffffffff) +#define DECLARE_WRITE32_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint32_t data, ATTR_UNUSED uint32_t mem_mask = 0xffffffff) +#define DECLARE_READ64_MEMBER(name) uint64_t name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint64_t mem_mask = U64(0xffffffffffffffff)) +#define DECLARE_WRITE64_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint64_t data, ATTR_UNUSED uint64_t mem_mask = U64(0xffffffffffffffff)) #define SETOFFSET_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset) #define DECLARE_SETOFFSET_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset) @@ -884,7 +884,7 @@ inline void *direct_read_data::read_ptr(offs_t byteaddress, offs_t directxor) // direct_read_data class //------------------------------------------------- -inline UINT8 direct_read_data::read_byte(offs_t byteaddress, offs_t directxor) +inline uint8_t direct_read_data::read_byte(offs_t byteaddress, offs_t directxor) { if (address_is_valid(byteaddress)) return m_ptr[(byteaddress ^ directxor) & m_bytemask]; @@ -897,10 +897,10 @@ inline UINT8 direct_read_data::read_byte(offs_t byteaddress, offs_t directxor) // direct_read_data class //------------------------------------------------- -inline UINT16 direct_read_data::read_word(offs_t byteaddress, offs_t directxor) +inline uint16_t direct_read_data::read_word(offs_t byteaddress, offs_t directxor) { if (address_is_valid(byteaddress)) - return *reinterpret_cast(&m_ptr[(byteaddress ^ directxor) & m_bytemask]); + return *reinterpret_cast(&m_ptr[(byteaddress ^ directxor) & m_bytemask]); return m_space.read_word(byteaddress); } @@ -910,10 +910,10 @@ inline UINT16 direct_read_data::read_word(offs_t byteaddress, offs_t directxor) // direct_read_data class //------------------------------------------------- -inline UINT32 direct_read_data::read_dword(offs_t byteaddress, offs_t directxor) +inline uint32_t direct_read_data::read_dword(offs_t byteaddress, offs_t directxor) { if (address_is_valid(byteaddress)) - return *reinterpret_cast(&m_ptr[(byteaddress ^ directxor) & m_bytemask]); + return *reinterpret_cast(&m_ptr[(byteaddress ^ directxor) & m_bytemask]); return m_space.read_dword(byteaddress); } @@ -923,10 +923,10 @@ inline UINT32 direct_read_data::read_dword(offs_t byteaddress, offs_t directxor) // direct_read_data class //------------------------------------------------- -inline UINT64 direct_read_data::read_qword(offs_t byteaddress, offs_t directxor) +inline uint64_t direct_read_data::read_qword(offs_t byteaddress, offs_t directxor) { if (address_is_valid(byteaddress)) - return *reinterpret_cast(&m_ptr[(byteaddress ^ directxor) & m_bytemask]); + return *reinterpret_cast(&m_ptr[(byteaddress ^ directxor) & m_bytemask]); return m_space.read_qword(byteaddress); } diff --git a/src/emu/emupal.cpp b/src/emu/emupal.cpp index 73f7360e8ff..b23d3561b9d 100644 --- a/src/emu/emupal.cpp +++ b/src/emu/emupal.cpp @@ -19,7 +19,7 @@ const device_type PALETTE = &device_creator; -palette_device::palette_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +palette_device::palette_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PALETTE, "palette", tag, owner, clock, "palette", __FILE__), m_entries(0), m_indirect_entries(0), @@ -122,7 +122,7 @@ void palette_device::set_indirect_color(int index, rgb_t rgb) m_indirect_colors[index] = rgb; // update the palette for any colortable entries that reference it - for (UINT32 pen = 0; pen < m_indirect_pens.size(); pen++) + for (uint32_t pen = 0; pen < m_indirect_pens.size(); pen++) if (m_indirect_pens[pen] == index) m_palette->entry_set_color(pen, rgb); } @@ -150,9 +150,9 @@ void palette_device::set_pen_indirect(pen_t pen, indirect_pen_t index) // transcolor //------------------------------------------------- -UINT32 palette_device::transpen_mask(gfx_element &gfx, UINT32 color, indirect_pen_t transcolor) +uint32_t palette_device::transpen_mask(gfx_element &gfx, uint32_t color, indirect_pen_t transcolor) { - UINT32 entry = gfx.colorbase() + (color % gfx.colors()) * gfx.granularity(); + uint32_t entry = gfx.colorbase() + (color % gfx.colors()) * gfx.granularity(); // make sure we are in range assert(entry < m_indirect_pens.size()); @@ -162,7 +162,7 @@ UINT32 palette_device::transpen_mask(gfx_element &gfx, UINT32 color, indirect_pe int count = std::min(size_t(gfx.depth()), m_indirect_pens.size() - entry); // set a bit anywhere the transcolor matches - UINT32 mask = 0; + uint32_t mask = 0; for (int bit = 0; bit < count; bit++) if (m_indirect_pens[entry++] == transcolor) mask |= 1 << bit; @@ -715,9 +715,9 @@ void palette_device::configure_rgb_shadows(int mode, float factor) int ifactor = int(factor * 256.0f); for (int rgb555 = 0; rgb555 < 32768; rgb555++) { - UINT8 r = rgb_t::clamp((pal5bit(rgb555 >> 10) * ifactor) >> 8); - UINT8 g = rgb_t::clamp((pal5bit(rgb555 >> 5) * ifactor) >> 8); - UINT8 b = rgb_t::clamp((pal5bit(rgb555 >> 0) * ifactor) >> 8); + uint8_t r = rgb_t::clamp((pal5bit(rgb555 >> 10) * ifactor) >> 8); + uint8_t g = rgb_t::clamp((pal5bit(rgb555 >> 5) * ifactor) >> 8); + uint8_t b = rgb_t::clamp((pal5bit(rgb555 >> 0) * ifactor) >> 8); // store either 16 or 32 bit rgb_t final = rgb_t(r, g, b); @@ -859,7 +859,7 @@ void palette_device::palette_init_3bit_bgr(palette_device &palette) void palette_device::palette_init_RRRRGGGGBBBB_proms(palette_device &palette) { - const UINT8 *color_prom = machine().root_device().memregion("proms")->base(); + const uint8_t *color_prom = machine().root_device().memregion("proms")->base(); int i; for (i = 0; i < palette.entries(); i++) @@ -932,35 +932,35 @@ void palette_device::palette_init_RRRRRGGGGGGBBBBB(palette_device &palette) palette.set_pen_color(i, rgbexpand<5,6,5>(i, 11, 5, 0)); } -rgb_t raw_to_rgb_converter::IRRRRRGGGGGBBBBB_decoder(UINT32 raw) +rgb_t raw_to_rgb_converter::IRRRRRGGGGGBBBBB_decoder(uint32_t raw) { - UINT8 i = (raw >> 15) & 1; - UINT8 r = pal6bit(((raw >> 9) & 0x3e) | i); - UINT8 g = pal6bit(((raw >> 4) & 0x3e) | i); - UINT8 b = pal6bit(((raw << 1) & 0x3e) | i); + uint8_t i = (raw >> 15) & 1; + uint8_t r = pal6bit(((raw >> 9) & 0x3e) | i); + uint8_t g = pal6bit(((raw >> 4) & 0x3e) | i); + uint8_t b = pal6bit(((raw << 1) & 0x3e) | i); return rgb_t(r, g, b); } -rgb_t raw_to_rgb_converter::RRRRGGGGBBBBRGBx_decoder(UINT32 raw) +rgb_t raw_to_rgb_converter::RRRRGGGGBBBBRGBx_decoder(uint32_t raw) { - UINT8 r = pal5bit(((raw >> 11) & 0x1e) | ((raw >> 3) & 0x01)); - UINT8 g = pal5bit(((raw >> 7) & 0x1e) | ((raw >> 2) & 0x01)); - UINT8 b = pal5bit(((raw >> 3) & 0x1e) | ((raw >> 1) & 0x01)); + uint8_t r = pal5bit(((raw >> 11) & 0x1e) | ((raw >> 3) & 0x01)); + uint8_t g = pal5bit(((raw >> 7) & 0x1e) | ((raw >> 2) & 0x01)); + uint8_t b = pal5bit(((raw >> 3) & 0x1e) | ((raw >> 1) & 0x01)); return rgb_t(r, g, b); } -rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit0_decoder(UINT32 raw) +rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit0_decoder(uint32_t raw) { - UINT8 r = pal5bit(((raw >> 7) & 0x1e) | ((raw >> 14) & 0x01)); - UINT8 g = pal5bit(((raw >> 3) & 0x1e) | ((raw >> 13) & 0x01)); - UINT8 b = pal5bit(((raw << 1) & 0x1e) | ((raw >> 12) & 0x01)); + uint8_t r = pal5bit(((raw >> 7) & 0x1e) | ((raw >> 14) & 0x01)); + uint8_t g = pal5bit(((raw >> 3) & 0x1e) | ((raw >> 13) & 0x01)); + uint8_t b = pal5bit(((raw << 1) & 0x1e) | ((raw >> 12) & 0x01)); return rgb_t(r, g, b); } -rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit4_decoder(UINT32 raw) +rgb_t raw_to_rgb_converter::xRGBRRRRGGGGBBBB_bit4_decoder(uint32_t raw) { - UINT8 r = pal5bit(((raw >> 8) & 0x0f) | ((raw >> 10) & 0x10)); - UINT8 g = pal5bit(((raw >> 4) & 0x0f) | ((raw >> 9) & 0x10)); - UINT8 b = pal5bit(((raw >> 0) & 0x0f) | ((raw >> 8) & 0x10)); + uint8_t r = pal5bit(((raw >> 8) & 0x0f) | ((raw >> 10) & 0x10)); + uint8_t g = pal5bit(((raw >> 4) & 0x0f) | ((raw >> 9) & 0x10)); + uint8_t b = pal5bit(((raw >> 0) & 0x0f) | ((raw >> 8) & 0x10)); return rgb_t(r, g, b); } diff --git a/src/emu/emupal.h b/src/emu/emupal.h index 5ca21e354b6..fca513d8424 100644 --- a/src/emu/emupal.h +++ b/src/emu/emupal.h @@ -112,8 +112,8 @@ #define PALETTE_INIT_MEMBER(_Class, _Name) void _Class::PALETTE_INIT_NAME(_Name)(palette_device &palette) #define PALETTE_DECODER_NAME(_Name) _Name##_decoder -#define DECLARE_PALETTE_DECODER(_Name) static rgb_t PALETTE_DECODER_NAME(_Name)(UINT32 raw) -#define PALETTE_DECODER_MEMBER(_Class, _Name) rgb_t _Class::PALETTE_DECODER_NAME(_Name)(UINT32 raw) +#define DECLARE_PALETTE_DECODER(_Name) static rgb_t PALETTE_DECODER_NAME(_Name)(uint32_t raw) +#define PALETTE_DECODER_MEMBER(_Class, _Name) rgb_t _Class::PALETTE_DECODER_NAME(_Name)(uint32_t raw) // standard 3-3-2 formats #define PALETTE_FORMAT_BBGGGRRR raw_to_rgb_converter(1, &raw_to_rgb_converter::standard_rgb_decoder<3,3,2, 0,3,6>) @@ -290,7 +290,7 @@ typedef device_delegate palette_init_delegate; -typedef UINT16 indirect_pen_t; +typedef uint16_t indirect_pen_t; // ======================> raw_to_rgb_converter @@ -298,7 +298,7 @@ typedef UINT16 indirect_pen_t; class raw_to_rgb_converter { // helper function - typedef rgb_t (*raw_to_rgb_func)(UINT32 raw); + typedef rgb_t (*raw_to_rgb_func)(uint32_t raw); public: // constructor @@ -310,43 +310,43 @@ public: int bytes_per_entry() const { return m_bytes_per_entry; } // helpers - rgb_t operator()(UINT32 raw) const { return (*m_func)(raw); } + rgb_t operator()(uint32_t raw) const { return (*m_func)(raw); } // generic raw-to-RGB conversion helpers template - static rgb_t standard_rgb_decoder(UINT32 raw) + static rgb_t standard_rgb_decoder(uint32_t raw) { - UINT8 r = palexpand<_RedBits>(raw >> _RedShift); - UINT8 g = palexpand<_GreenBits>(raw >> _GreenShift); - UINT8 b = palexpand<_BlueBits>(raw >> _BlueShift); + uint8_t r = palexpand<_RedBits>(raw >> _RedShift); + uint8_t g = palexpand<_GreenBits>(raw >> _GreenShift); + uint8_t b = palexpand<_BlueBits>(raw >> _BlueShift); return rgb_t(r, g, b); } // data-inverted generic raw-to-RGB conversion helpers template - static rgb_t inverted_rgb_decoder(UINT32 raw) + static rgb_t inverted_rgb_decoder(uint32_t raw) { - UINT8 r = palexpand<_RedBits>(~raw >> _RedShift); - UINT8 g = palexpand<_GreenBits>(~raw >> _GreenShift); - UINT8 b = palexpand<_BlueBits>(~raw >> _BlueShift); + uint8_t r = palexpand<_RedBits>(~raw >> _RedShift); + uint8_t g = palexpand<_GreenBits>(~raw >> _GreenShift); + uint8_t b = palexpand<_BlueBits>(~raw >> _BlueShift); return rgb_t(r, g, b); } template - static rgb_t standard_irgb_decoder(UINT32 raw) + static rgb_t standard_irgb_decoder(uint32_t raw) { - UINT8 i = palexpand<_IntBits>(raw >> _IntShift); - UINT8 r = (i * palexpand<_RedBits>(raw >> _RedShift)) >> 8; - UINT8 g = (i * palexpand<_GreenBits>(raw >> _GreenShift)) >> 8; - UINT8 b = (i * palexpand<_BlueBits>(raw >> _BlueShift)) >> 8; + uint8_t i = palexpand<_IntBits>(raw >> _IntShift); + uint8_t r = (i * palexpand<_RedBits>(raw >> _RedShift)) >> 8; + uint8_t g = (i * palexpand<_GreenBits>(raw >> _GreenShift)) >> 8; + uint8_t b = (i * palexpand<_BlueBits>(raw >> _BlueShift)) >> 8; return rgb_t(r, g, b); } // other standard decoders - static rgb_t IRRRRRGGGGGBBBBB_decoder(UINT32 raw); - static rgb_t RRRRGGGGBBBBRGBx_decoder(UINT32 raw); // bits 3/2/1 are LSb - static rgb_t xRGBRRRRGGGGBBBB_bit0_decoder(UINT32 raw); // bits 14/13/12 are LSb - static rgb_t xRGBRRRRGGGGBBBB_bit4_decoder(UINT32 raw); // bits 14/13/12 are MSb + static rgb_t IRRRRRGGGGGBBBBB_decoder(uint32_t raw); + static rgb_t RRRRGGGGBBBBRGBx_decoder(uint32_t raw); // bits 3/2/1 are LSb + static rgb_t xRGBRRRRGGGGBBBB_bit0_decoder(uint32_t raw); // bits 14/13/12 are LSb + static rgb_t xRGBRRRRGGGGBBBB_bit4_decoder(uint32_t raw); // bits 14/13/12 are MSb private: // internal data @@ -366,7 +366,7 @@ class palette_device : public device_t public: // construction/destruction - palette_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + palette_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration static void static_set_init(device_t &device, palette_init_delegate init); @@ -395,9 +395,9 @@ public: bool hilights_enabled() { return m_enable_hilights; } // raw entry reading - UINT32 read_entry(pen_t pen) const + uint32_t read_entry(pen_t pen) const { - UINT32 data = m_paletteram.read(pen); + uint32_t data = m_paletteram.read(pen); if (m_paletteram_ext.base() != nullptr) data |= m_paletteram_ext.read(pen) << (8 * m_paletteram.bytes_per_entry()); return data; @@ -405,10 +405,10 @@ public: // setters void set_pen_color(pen_t pen, rgb_t rgb) { m_palette->entry_set_color(pen, rgb); } - void set_pen_red_level(pen_t pen, UINT8 level) { m_palette->entry_set_red_level(pen, level); } - void set_pen_green_level(pen_t pen, UINT8 level) { m_palette->entry_set_green_level(pen, level); } - void set_pen_blue_level(pen_t pen, UINT8 level) { m_palette->entry_set_blue_level(pen, level); } - void set_pen_color(pen_t pen, UINT8 r, UINT8 g, UINT8 b) { m_palette->entry_set_color(pen, rgb_t(r, g, b)); } + void set_pen_red_level(pen_t pen, uint8_t level) { m_palette->entry_set_red_level(pen, level); } + void set_pen_green_level(pen_t pen, uint8_t level) { m_palette->entry_set_green_level(pen, level); } + void set_pen_blue_level(pen_t pen, uint8_t level) { m_palette->entry_set_blue_level(pen, level); } + void set_pen_color(pen_t pen, uint8_t r, uint8_t g, uint8_t b) { m_palette->entry_set_color(pen, rgb_t(r, g, b)); } void set_pen_colors(pen_t color_base, const rgb_t *colors, int color_count) { while (color_count--) set_pen_color(color_base++, *colors++); } void set_pen_colors(pen_t color_base, const std::vector &colors) { for(unsigned int i=0; i != colors.size(); i++) set_pen_color(color_base+i, colors[i]); } void set_pen_contrast(pen_t pen, double bright) { m_palette->entry_set_contrast(pen, bright); } @@ -418,7 +418,7 @@ public: rgb_t indirect_color(int index) const { return m_indirect_colors[index]; } void set_indirect_color(int index, rgb_t rgb); void set_pen_indirect(pen_t pen, indirect_pen_t index); - UINT32 transpen_mask(gfx_element &gfx, UINT32 color, indirect_pen_t transcolor); + uint32_t transpen_mask(gfx_element &gfx, uint32_t color, indirect_pen_t transcolor); // shadow config void set_shadow_factor(double factor) { assert(m_shadow_group != 0); m_palette->group_set_contrast(m_shadow_group, factor); } @@ -494,8 +494,8 @@ private: const pen_t * m_pens; // remapped palette pen numbers bitmap_format m_format; // format assumed for palette data pen_t * m_shadow_table; // table for looking up a shadowed pen - UINT32 m_shadow_group; // index of the shadow group, or 0 if none - UINT32 m_hilight_group; // index of the hilight group, or 0 if none + uint32_t m_shadow_group; // index of the shadow group, or 0 if none + uint32_t m_hilight_group; // index of the hilight group, or 0 if none pen_t m_white_pen; // precomputed white pen value pen_t m_black_pen; // precomputed black pen value @@ -506,9 +506,9 @@ private: struct shadow_table_data { pen_t * base; // pointer to the base of the table - INT16 dr; // delta red value - INT16 dg; // delta green value - INT16 db; // delta blue value + int16_t dr; // delta red value + int16_t dg; // delta green value + int16_t db; // delta blue value bool noclip; // clip? }; shadow_table_data m_shadow_tables[MAX_SHADOW_PRESETS]; // array of shadow table data diff --git a/src/emu/fileio.cpp b/src/emu/fileio.cpp index 4f4578856a1..45b0dc98d53 100644 --- a/src/emu/fileio.cpp +++ b/src/emu/fileio.cpp @@ -13,7 +13,7 @@ #include "fileio.h" -const UINT32 OPEN_FLAG_HAS_CRC = 0x10000; +const uint32_t OPEN_FLAG_HAS_CRC = 0x10000; @@ -164,7 +164,7 @@ const osd::directory::entry *file_enumerator::next() // emu_file - constructor //------------------------------------------------- -emu_file::emu_file(UINT32 openflags) +emu_file::emu_file(uint32_t openflags) : m_file() , m_iterator(std::string()) , m_mediapaths(std::string()) @@ -180,7 +180,7 @@ emu_file::emu_file(UINT32 openflags) throw emu_fatalerror("Attempted to open a file for write with OPEN_FLAG_HAS_CRC"); } -emu_file::emu_file(std::string &&searchpath, UINT32 openflags) +emu_file::emu_file(std::string &&searchpath, uint32_t openflags) : m_file() , m_iterator(searchpath) , m_mediapaths(std::move(searchpath)) @@ -257,7 +257,7 @@ util::hash_collection &emu_file::hashes(const char *types) } // read the data if we can - const UINT8 *filedata = (const UINT8 *)m_file->buffer(); + const uint8_t *filedata = (const uint8_t *)m_file->buffer(); if (filedata == nullptr) return m_hashes; @@ -301,7 +301,7 @@ osd_file::error emu_file::open(const std::string &name1, const std::string &name return open(name1 + name2 + name3 + name4); } -osd_file::error emu_file::open(const std::string &name, UINT32 crc) +osd_file::error emu_file::open(const std::string &name, uint32_t crc) { // remember the filename and CRC info m_filename = name; @@ -313,19 +313,19 @@ osd_file::error emu_file::open(const std::string &name, UINT32 crc) return open_next(); } -osd_file::error emu_file::open(const std::string &name1, const std::string &name2, UINT32 crc) +osd_file::error emu_file::open(const std::string &name1, const std::string &name2, uint32_t crc) { // concatenate the strings and do a standard open return open(name1 + name2, crc); } -osd_file::error emu_file::open(const std::string &name1, const std::string &name2, const std::string &name3, UINT32 crc) +osd_file::error emu_file::open(const std::string &name1, const std::string &name2, const std::string &name3, uint32_t crc) { // concatenate the strings and do a standard open return open(name1 + name2 + name3, crc); } -osd_file::error emu_file::open(const std::string &name1, const std::string &name2, const std::string &name3, const std::string &name4, UINT32 crc) +osd_file::error emu_file::open(const std::string &name1, const std::string &name2, const std::string &name3, const std::string &name4, uint32_t crc) { // concatenate the strings and do a standard open return open(name1 + name2 + name3 + name4, crc); @@ -369,7 +369,7 @@ osd_file::error emu_file::open_next() // just an array of data in RAM //------------------------------------------------- -osd_file::error emu_file::open_ram(const void *data, UINT32 length) +osd_file::error emu_file::open_ram(const void *data, uint32_t length) { // set a fake filename and CRC m_filename = "RAM"; @@ -433,7 +433,7 @@ bool emu_file::compressed_file_ready(void) // seek - seek within a file //------------------------------------------------- -int emu_file::seek(INT64 offset, int whence) +int emu_file::seek(int64_t offset, int whence) { // load the ZIP file now if we haven't yet if (compressed_file_ready()) @@ -451,7 +451,7 @@ int emu_file::seek(INT64 offset, int whence) // tell - return the current file position //------------------------------------------------- -UINT64 emu_file::tell() +uint64_t emu_file::tell() { // load the ZIP file now if we haven't yet if (compressed_file_ready()) @@ -487,7 +487,7 @@ bool emu_file::eof() // size - returns the size of a file //------------------------------------------------- -UINT64 emu_file::size() +uint64_t emu_file::size() { // use the ZIP length if present if (m_zipfile != nullptr) @@ -505,7 +505,7 @@ UINT64 emu_file::size() // read - read from a file //------------------------------------------------- -UINT32 emu_file::read(void *buffer, UINT32 length) +uint32_t emu_file::read(void *buffer, uint32_t length) { // load the ZIP file now if we haven't yet if (compressed_file_ready()) @@ -577,7 +577,7 @@ char *emu_file::gets(char *s, int n) // write - write to a file //------------------------------------------------- -UINT32 emu_file::write(const void *buffer, UINT32 length) +uint32_t emu_file::write(const void *buffer, uint32_t length) { // write the data if we can if (m_file) diff --git a/src/emu/fileio.h b/src/emu/fileio.h index 930ff749c36..a121cafb66e 100644 --- a/src/emu/fileio.h +++ b/src/emu/fileio.h @@ -88,8 +88,8 @@ class emu_file { public: // file open/creation - emu_file(UINT32 openflags); - emu_file(std::string &&searchpath, UINT32 openflags); + emu_file(uint32_t openflags); + emu_file(std::string &&searchpath, uint32_t openflags); virtual ~emu_file(); // getters @@ -97,14 +97,14 @@ public: bool is_open() const { return bool(m_file); } const char *filename() const { return m_filename.c_str(); } const char *fullpath() const { return m_fullpath.c_str(); } - UINT32 openflags() const { return m_openflags; } + uint32_t openflags() const { return m_openflags; } util::hash_collection &hashes(const char *types); bool restrict_to_mediapath() const { return m_restrict_to_mediapath; } bool part_of_mediapath(std::string path); // setters void remove_on_close() { m_remove_on_close = true; } - void set_openflags(UINT32 openflags) { assert(!m_file); m_openflags = openflags; } + void set_openflags(uint32_t openflags) { assert(!m_file); m_openflags = openflags; } void set_restrict_to_mediapath(bool rtmp = true) { m_restrict_to_mediapath = rtmp; } // open/close @@ -112,31 +112,31 @@ public: osd_file::error open(const std::string &name1, const std::string &name2); osd_file::error open(const std::string &name1, const std::string &name2, const std::string &name3); osd_file::error open(const std::string &name1, const std::string &name2, const std::string &name3, const std::string &name4); - osd_file::error open(const std::string &name, UINT32 crc); - osd_file::error open(const std::string &name1, const std::string &name2, UINT32 crc); - osd_file::error open(const std::string &name1, const std::string &name2, const std::string &name3, UINT32 crc); - osd_file::error open(const std::string &name1, const std::string &name2, const std::string &name3, const std::string &name4, UINT32 crc); + osd_file::error open(const std::string &name, uint32_t crc); + osd_file::error open(const std::string &name1, const std::string &name2, uint32_t crc); + osd_file::error open(const std::string &name1, const std::string &name2, const std::string &name3, uint32_t crc); + osd_file::error open(const std::string &name1, const std::string &name2, const std::string &name3, const std::string &name4, uint32_t crc); osd_file::error open_next(); - osd_file::error open_ram(const void *data, UINT32 length); + osd_file::error open_ram(const void *data, uint32_t length); void close(); // control osd_file::error compress(int compress); // position - int seek(INT64 offset, int whence); - UINT64 tell(); + int seek(int64_t offset, int whence); + uint64_t tell(); bool eof(); - UINT64 size(); + uint64_t size(); // reading - UINT32 read(void *buffer, UINT32 length); + uint32_t read(void *buffer, uint32_t length); int getc(); int ungetc(int c); char *gets(char *s, int n); // writing - UINT32 write(const void *buffer, UINT32 length); + uint32_t write(const void *buffer, uint32_t length); int puts(const char *s); int vprintf(util::format_argument_pack const &args); template int printf(Format &&fmt, Params &&...args) @@ -160,13 +160,13 @@ private: util::core_file::ptr m_file; // core file pointer path_iterator m_iterator; // iterator for paths path_iterator m_mediapaths; // media-path iterator - UINT32 m_crc; // file's CRC - UINT32 m_openflags; // flags we used for the open + uint32_t m_crc; // file's CRC + uint32_t m_openflags; // flags we used for the open util::hash_collection m_hashes; // collection of hashes std::unique_ptr m_zipfile; // ZIP file pointer - std::vector m_zipdata; // ZIP file data - UINT64 m_ziplength; // ZIP file length + std::vector m_zipdata; // ZIP file data + uint64_t m_ziplength; // ZIP file length bool m_remove_on_close; // flag: remove the file when closing bool m_restrict_to_mediapath; // flag: restrict to paths inside the media-path diff --git a/src/emu/gamedrv.h b/src/emu/gamedrv.h index 8a44276252c..547cd622116 100644 --- a/src/emu/gamedrv.h +++ b/src/emu/gamedrv.h @@ -22,41 +22,41 @@ const int MAX_DRIVER_NAME_CHARS = 8; // flags for game drivers -const UINT32 ORIENTATION_MASK = 0x00000007; -const UINT32 MACHINE_NOT_WORKING = 0x00000008; -const UINT32 MACHINE_UNEMULATED_PROTECTION = 0x00000010; // game's protection not fully emulated -const UINT32 MACHINE_WRONG_COLORS = 0x00000020; // colors are totally wrong -const UINT32 MACHINE_IMPERFECT_COLORS = 0x00000040; // colors are not 100% accurate, but close -const UINT32 MACHINE_IMPERFECT_GRAPHICS = 0x00000080; // graphics are wrong/incomplete -const UINT32 MACHINE_NO_COCKTAIL = 0x00000100; // screen flip support is missing -const UINT32 MACHINE_NO_SOUND = 0x00000200; // sound is missing -const UINT32 MACHINE_IMPERFECT_SOUND = 0x00000400; // sound is known to be wrong -const UINT32 MACHINE_SUPPORTS_SAVE = 0x00000800; // game supports save states -const UINT32 MACHINE_IS_BIOS_ROOT = 0x00001000; // this driver entry is a BIOS root -const UINT32 MACHINE_NO_STANDALONE = 0x00002000; // this driver cannot stand alone -const UINT32 MACHINE_REQUIRES_ARTWORK = 0x00004000; // the driver requires external artwork for key elements of the game -const UINT32 MACHINE_UNOFFICIAL = 0x00008000; // unofficial hardware change -const UINT32 MACHINE_NO_SOUND_HW = 0x00010000; // sound hardware not available -const UINT32 MACHINE_MECHANICAL = 0x00020000; // contains mechanical parts (pinball, redemption games,...) -const UINT32 MACHINE_TYPE_ARCADE = 0x00040000; // arcade machine (coin operated machines) -const UINT32 MACHINE_TYPE_CONSOLE = 0x00080000; // console system -const UINT32 MACHINE_TYPE_COMPUTER = 0x00100000; // any kind of computer including home computers, minis, calcs,... -const UINT32 MACHINE_TYPE_OTHER = 0x00200000; // any other emulated system that doesn't fit above (ex. clock, satelite receiver,...) -const UINT32 MACHINE_IMPERFECT_KEYBOARD = 0x00400000; // keyboard is known to be wrong -const UINT32 MACHINE_CLICKABLE_ARTWORK = 0x00800000; // marking that artwork is clickable and require mouse cursor -const UINT32 MACHINE_IS_INCOMPLETE = 0x01000000; // any official game/system with blantantly incomplete HW or SW should be marked with this -const UINT32 MACHINE_NODEVICE_MICROPHONE = 0x02000000; // any game/system that has unemulated recording voice device peripheral -const UINT32 MACHINE_NODEVICE_CAMERA = 0x04000000; // any game/system that has unemulated capturing image device peripheral -const UINT32 MACHINE_NODEVICE_PRINTER = 0x08000000; // any game/system that has unemulated grabbing of screen content device -const UINT32 MACHINE_NODEVICE_LAN = 0x10000000; // any game/system that has unemulated multi-linking capability -const UINT32 MACHINE_NODEVICE_WAN = 0x20000000; // any game/system that has unemulated networking capability +const uint32_t ORIENTATION_MASK = 0x00000007; +const uint32_t MACHINE_NOT_WORKING = 0x00000008; +const uint32_t MACHINE_UNEMULATED_PROTECTION = 0x00000010; // game's protection not fully emulated +const uint32_t MACHINE_WRONG_COLORS = 0x00000020; // colors are totally wrong +const uint32_t MACHINE_IMPERFECT_COLORS = 0x00000040; // colors are not 100% accurate, but close +const uint32_t MACHINE_IMPERFECT_GRAPHICS = 0x00000080; // graphics are wrong/incomplete +const uint32_t MACHINE_NO_COCKTAIL = 0x00000100; // screen flip support is missing +const uint32_t MACHINE_NO_SOUND = 0x00000200; // sound is missing +const uint32_t MACHINE_IMPERFECT_SOUND = 0x00000400; // sound is known to be wrong +const uint32_t MACHINE_SUPPORTS_SAVE = 0x00000800; // game supports save states +const uint32_t MACHINE_IS_BIOS_ROOT = 0x00001000; // this driver entry is a BIOS root +const uint32_t MACHINE_NO_STANDALONE = 0x00002000; // this driver cannot stand alone +const uint32_t MACHINE_REQUIRES_ARTWORK = 0x00004000; // the driver requires external artwork for key elements of the game +const uint32_t MACHINE_UNOFFICIAL = 0x00008000; // unofficial hardware change +const uint32_t MACHINE_NO_SOUND_HW = 0x00010000; // sound hardware not available +const uint32_t MACHINE_MECHANICAL = 0x00020000; // contains mechanical parts (pinball, redemption games,...) +const uint32_t MACHINE_TYPE_ARCADE = 0x00040000; // arcade machine (coin operated machines) +const uint32_t MACHINE_TYPE_CONSOLE = 0x00080000; // console system +const uint32_t MACHINE_TYPE_COMPUTER = 0x00100000; // any kind of computer including home computers, minis, calcs,... +const uint32_t MACHINE_TYPE_OTHER = 0x00200000; // any other emulated system that doesn't fit above (ex. clock, satelite receiver,...) +const uint32_t MACHINE_IMPERFECT_KEYBOARD = 0x00400000; // keyboard is known to be wrong +const uint32_t MACHINE_CLICKABLE_ARTWORK = 0x00800000; // marking that artwork is clickable and require mouse cursor +const uint32_t MACHINE_IS_INCOMPLETE = 0x01000000; // any official game/system with blantantly incomplete HW or SW should be marked with this +const uint32_t MACHINE_NODEVICE_MICROPHONE = 0x02000000; // any game/system that has unemulated recording voice device peripheral +const uint32_t MACHINE_NODEVICE_CAMERA = 0x04000000; // any game/system that has unemulated capturing image device peripheral +const uint32_t MACHINE_NODEVICE_PRINTER = 0x08000000; // any game/system that has unemulated grabbing of screen content device +const uint32_t MACHINE_NODEVICE_LAN = 0x10000000; // any game/system that has unemulated multi-linking capability +const uint32_t MACHINE_NODEVICE_WAN = 0x20000000; // any game/system that has unemulated networking capability // useful combinations of flags -const UINT32 MACHINE_IS_SKELETON = MACHINE_NO_SOUND | MACHINE_NOT_WORKING; // mask for skelly games -const UINT32 MACHINE_IS_SKELETON_MECHANICAL = MACHINE_IS_SKELETON | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK; // mask for skelly mechanical games -const UINT32 MACHINE_FATAL_FLAGS = MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_MECHANICAL; // red disclaimer -const UINT32 MACHINE_WARNING_FLAGS = MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_COLORS | MACHINE_REQUIRES_ARTWORK | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_KEYBOARD | MACHINE_NO_SOUND | MACHINE_NO_COCKTAIL | MACHINE_NODEVICE_MICROPHONE | MACHINE_NODEVICE_CAMERA | MACHINE_NODEVICE_PRINTER | MACHINE_NODEVICE_LAN | MACHINE_NODEVICE_WAN; // yellow disclaimer -const UINT32 MACHINE_BTANB_FLAGS = MACHINE_IS_INCOMPLETE | MACHINE_NO_SOUND_HW; // default disclaimer +const uint32_t MACHINE_IS_SKELETON = MACHINE_NO_SOUND | MACHINE_NOT_WORKING; // mask for skelly games +const uint32_t MACHINE_IS_SKELETON_MECHANICAL = MACHINE_IS_SKELETON | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK; // mask for skelly mechanical games +const uint32_t MACHINE_FATAL_FLAGS = MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_MECHANICAL; // red disclaimer +const uint32_t MACHINE_WARNING_FLAGS = MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_COLORS | MACHINE_REQUIRES_ARTWORK | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_KEYBOARD | MACHINE_NO_SOUND | MACHINE_NO_COCKTAIL | MACHINE_NODEVICE_MICROPHONE | MACHINE_NODEVICE_CAMERA | MACHINE_NODEVICE_PRINTER | MACHINE_NODEVICE_LAN | MACHINE_NODEVICE_WAN; // yellow disclaimer +const uint32_t MACHINE_BTANB_FLAGS = MACHINE_IS_INCOMPLETE | MACHINE_NO_SOUND_HW; // default disclaimer //************************************************************************** // TYPE DEFINITIONS @@ -79,7 +79,7 @@ struct game_driver void (*driver_init)(running_machine &machine); // DRIVER_INIT callback const tiny_rom_entry * rom; // pointer to list of ROMs for the game const char * compatible_with; - UINT32 flags; // orientation and other flags; see defines below + uint32_t flags; // orientation and other flags; see defines below const internal_layout * default_layout; // default internally defined layout }; diff --git a/src/emu/input.cpp b/src/emu/input.cpp index 1c1570b06e8..abcf8c0592e 100644 --- a/src/emu/input.cpp +++ b/src/emu/input.cpp @@ -27,7 +27,7 @@ //************************************************************************** // invalid memory value for axis polling -const INT32 INVALID_AXIS_VALUE = 0x7fffffff; +const int32_t INVALID_AXIS_VALUE = 0x7fffffff; // additional expanded input codes for sequences const input_code input_seq::end_code(DEVICE_CLASS_INTERNAL, 0, ITEM_CLASS_INVALID, ITEM_MODIFIER_NONE, ITEM_ID_SEQ_END); @@ -54,9 +54,9 @@ public: input_device_switch_item(input_device &device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate); // readers - virtual INT32 read_as_switch(input_item_modifier modifier) override; - virtual INT32 read_as_relative(input_item_modifier modifier) override; - virtual INT32 read_as_absolute(input_item_modifier modifier) override; + virtual int32_t read_as_switch(input_item_modifier modifier) override; + virtual int32_t read_as_relative(input_item_modifier modifier) override; + virtual int32_t read_as_absolute(input_item_modifier modifier) override; // steadykey helper bool steadykey_changed(); @@ -64,8 +64,8 @@ public: private: // internal state - INT32 m_steadykey; // the live steadykey state - INT32 m_oldkey; // old live state + int32_t m_steadykey; // the live steadykey state + int32_t m_oldkey; // old live state }; @@ -79,9 +79,9 @@ public: input_device_relative_item(input_device &device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate); // readers - virtual INT32 read_as_switch(input_item_modifier modifier) override; - virtual INT32 read_as_relative(input_item_modifier modifier) override; - virtual INT32 read_as_absolute(input_item_modifier modifier) override; + virtual int32_t read_as_switch(input_item_modifier modifier) override; + virtual int32_t read_as_relative(input_item_modifier modifier) override; + virtual int32_t read_as_absolute(input_item_modifier modifier) override; }; @@ -95,9 +95,9 @@ public: input_device_absolute_item(input_device &device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate); // readers - virtual INT32 read_as_switch(input_item_modifier modifier) override; - virtual INT32 read_as_relative(input_item_modifier modifier) override; - virtual INT32 read_as_absolute(input_item_modifier modifier) override; + virtual int32_t read_as_switch(input_item_modifier modifier) override; + virtual int32_t read_as_relative(input_item_modifier modifier) override; + virtual int32_t read_as_absolute(input_item_modifier modifier) override; }; @@ -106,7 +106,7 @@ public: // simple class to match codes to strings struct code_string_table { - UINT32 operator[](const char *string) const + uint32_t operator[](const char *string) const { for (const code_string_table *current = this; current->m_code != ~0; current++) if (strcmp(current->m_string, string) == 0) @@ -114,7 +114,7 @@ struct code_string_table return ~0; } - const char *operator[](UINT32 code) const + const char *operator[](uint32_t code) const { for (const code_string_table *current = this; current->m_code != ~0; current++) if (current->m_code == code) @@ -122,7 +122,7 @@ struct code_string_table return nullptr; } - UINT32 m_code; + uint32_t m_code; const char * m_string; }; @@ -467,7 +467,7 @@ bool joystick_map::parse(const char *mapstring) if (*mapstring == 0 || *mapstring == '.') { bool symmetric = (rownum >= 5 && *mapstring == 0); - const UINT8 *srcrow = &m_map[symmetric ? (8 - rownum) : (rownum - 1)][0]; + const uint8_t *srcrow = &m_map[symmetric ? (8 - rownum) : (rownum - 1)][0]; // if this is row 0, we don't have a source row -- invalid if (rownum == 0) @@ -476,7 +476,7 @@ bool joystick_map::parse(const char *mapstring) // copy from the srcrow, applying up/down symmetry if in the bottom half for (int colnum = 0; colnum < 9; colnum++) { - UINT8 val = srcrow[colnum]; + uint8_t val = srcrow[colnum]; if (symmetric) val = (val & (JOYSTICK_MAP_LEFT | JOYSTICK_MAP_RIGHT)) | ((val & JOYSTICK_MAP_UP) << 1) | ((val & JOYSTICK_MAP_DOWN) >> 1); m_map[rownum][colnum] = val; @@ -492,7 +492,7 @@ bool joystick_map::parse(const char *mapstring) if (colnum > 0 && (*mapstring == 0 || *mapstring == '.')) { bool symmetric = (colnum >= 5); - UINT8 val = m_map[rownum][symmetric ? (8 - colnum) : (colnum - 1)]; + uint8_t val = m_map[rownum][symmetric ? (8 - colnum) : (colnum - 1)]; if (symmetric) val = (val & (JOYSTICK_MAP_UP | JOYSTICK_MAP_DOWN)) | ((val & JOYSTICK_MAP_LEFT) << 1) | ((val & JOYSTICK_MAP_RIGHT) >> 1); m_map[rownum][colnum] = val; @@ -501,7 +501,7 @@ bool joystick_map::parse(const char *mapstring) // otherwise, convert the character to its value else { - static const UINT8 charmap[] = + static const uint8_t charmap[] = { JOYSTICK_MAP_UP | JOYSTICK_MAP_LEFT, JOYSTICK_MAP_UP, @@ -572,12 +572,12 @@ std::string joystick_map::to_string() const // map based on the given X/Y axis values //------------------------------------------------- -UINT8 joystick_map::update(INT32 xaxisval, INT32 yaxisval) +uint8_t joystick_map::update(int32_t xaxisval, int32_t yaxisval) { // now map the X and Y axes to a 9x9 grid using the raw values xaxisval = ((xaxisval - INPUT_ABSOLUTE_MIN) * 9) / (INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN + 1); yaxisval = ((yaxisval - INPUT_ABSOLUTE_MIN) * 9) / (INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN + 1); - UINT8 mapval = m_map[yaxisval][xaxisval]; + uint8_t mapval = m_map[yaxisval][xaxisval]; // handle stickiness if (mapval == JOYSTICK_MAP_STICKY) @@ -805,8 +805,8 @@ input_device::input_device(input_class &_class, int devindex, const char *name, m_devindex(devindex), m_maxitem(input_item_id(0)), m_internal(internal), - m_joystick_deadzone((INT32)(_class.manager().machine().options().joystick_deadzone() * INPUT_ABSOLUTE_MAX)), - m_joystick_saturation((INT32)(_class.manager().machine().options().joystick_saturation() * INPUT_ABSOLUTE_MAX)), + m_joystick_deadzone((int32_t)(_class.manager().machine().options().joystick_deadzone() * INPUT_ABSOLUTE_MAX)), + m_joystick_saturation((int32_t)(_class.manager().machine().options().joystick_saturation() * INPUT_ABSOLUTE_MAX)), m_steadykey_enabled(_class.manager().machine().options().steadykey()), m_lightgun_reload_button(_class.manager().machine().options().offscreen_reload()) { @@ -884,7 +884,7 @@ input_item_id input_device::add_item(const char *name, input_item_id itemid, ite // absolute value //------------------------------------------------- -INT32 input_device::apply_deadzone_and_saturation(INT32 result) const +int32_t input_device::apply_deadzone_and_saturation(int32_t result) const { // ignore for non-joysticks if (devclass() != DEVICE_CLASS_JOYSTICK) @@ -908,7 +908,7 @@ INT32 input_device::apply_deadzone_and_saturation(INT32 result) const // otherwise, scale else - result = (INT64)(result - m_joystick_deadzone) * (INT64)INPUT_ABSOLUTE_MAX / (INT64)(m_joystick_saturation - m_joystick_deadzone); + result = (int64_t)(result - m_joystick_deadzone) * (int64_t)INPUT_ABSOLUTE_MAX / (int64_t)(m_joystick_saturation - m_joystick_deadzone); // re-apply sign and return return negative ? -result : result; @@ -1119,10 +1119,10 @@ input_manager::input_manager(running_machine &machine) // input code //------------------------------------------------- -INT32 input_manager::code_value(input_code code) +int32_t input_manager::code_value(input_code code) { g_profiler.start(PROFILER_INPUT); - INT32 result = 0; + int32_t result = 0; // dummy loop to allow clean early exits do @@ -1383,14 +1383,14 @@ bool input_manager::code_check_axis(input_device_item &item, input_code code) // ignore min/max for lightguns // so the selection will not be affected by a gun going out of range - INT32 curval = code_value(code); + int32_t curval = code_value(code); if (code.device_class() == DEVICE_CLASS_LIGHTGUN && (code.item_id() == ITEM_ID_XAXIS || code.item_id() == ITEM_ID_YAXIS) && (curval == INPUT_ABSOLUTE_MAX || curval == INPUT_ABSOLUTE_MIN)) return false; // compute the diff against memory - INT32 diff = curval - item.memory(); + int32_t diff = curval - item.memory(); if (diff < 0) diff = -diff; @@ -1694,7 +1694,7 @@ input_code input_manager::code_from_token(const char *_token) // if we have another token, it is the item class if (curtok < numtokens) { - UINT32 temp = (*itemclass_token_table)[token[curtok].c_str()]; + uint32_t temp = (*itemclass_token_table)[token[curtok].c_str()]; if (temp != ~0) { curtok++; @@ -1768,14 +1768,14 @@ bool input_manager::seq_pressed(const input_seq &seq) // defined in an input sequence //------------------------------------------------- -INT32 input_manager::seq_axis_value(const input_seq &seq, input_item_class &itemclass) +int32_t input_manager::seq_axis_value(const input_seq &seq, input_item_class &itemclass) { // start with no valid classes input_item_class itemclasszero = ITEM_CLASS_INVALID; itemclass = ITEM_CLASS_INVALID; // iterate over all of the codes - INT32 result = 0; + int32_t result = 0; bool invert = false; bool enable = true; for (int codenum = 0; ; codenum++) @@ -1812,7 +1812,7 @@ INT32 input_manager::seq_axis_value(const input_seq &seq, input_item_class &item // non-switch codes are analog values else { - INT32 value = code_value(code); + int32_t value = code_value(code); // if we got a 0 value, don't do anything except remember the first type if (value == 0) @@ -2074,7 +2074,7 @@ void input_manager::seq_from_tokens(input_seq &seq, const char *string) while (1) { // trim any leading spaces - while (*str != 0 && isspace((UINT8)*str)) + while (*str != 0 && isspace((uint8_t)*str)) str++; // bail if we're done @@ -2083,8 +2083,8 @@ void input_manager::seq_from_tokens(input_seq &seq, const char *string) // find the end of the token and make it upper-case along the way char *strtemp; - for (strtemp = str; *strtemp != 0 && !isspace((UINT8)*strtemp); strtemp++) - *strtemp = toupper((UINT8)*strtemp); + for (strtemp = str; *strtemp != 0 && !isspace((uint8_t)*strtemp); strtemp++) + *strtemp = toupper((uint8_t)*strtemp); char origspace = *strtemp; *strtemp = 0; @@ -2265,7 +2265,7 @@ input_device_switch_item::input_device_switch_item(input_device &device, const c // modified as necessary //------------------------------------------------- -INT32 input_device_switch_item::read_as_switch(input_item_modifier modifier) +int32_t input_device_switch_item::read_as_switch(input_item_modifier modifier) { // if we're doing a lightgun reload hack, button 1 and 2 operate differently input_device_class devclass = m_device.devclass(); @@ -2298,7 +2298,7 @@ INT32 input_device_switch_item::read_as_switch(input_item_modifier modifier) // a relative axis value //------------------------------------------------- -INT32 input_device_switch_item::read_as_relative(input_item_modifier modifier) +int32_t input_device_switch_item::read_as_relative(input_item_modifier modifier) { // no translation to relative return 0; @@ -2310,7 +2310,7 @@ INT32 input_device_switch_item::read_as_relative(input_item_modifier modifier) // an absolute axis value //------------------------------------------------- -INT32 input_device_switch_item::read_as_absolute(input_item_modifier modifier) +int32_t input_device_switch_item::read_as_absolute(input_item_modifier modifier) { // no translation to absolute return 0; @@ -2325,7 +2325,7 @@ INT32 input_device_switch_item::read_as_absolute(input_item_modifier modifier) bool input_device_switch_item::steadykey_changed() { - INT32 old = m_oldkey; + int32_t old = m_oldkey; m_oldkey = update_value(); if (((m_current ^ old) & 1) == 0) return false; @@ -2357,7 +2357,7 @@ input_device_relative_item::input_device_relative_item(input_device &device, con // a switch result based on the modifier //------------------------------------------------- -INT32 input_device_relative_item::read_as_switch(input_item_modifier modifier) +int32_t input_device_relative_item::read_as_switch(input_item_modifier modifier) { // process according to modifiers if (modifier == ITEM_MODIFIER_POS || modifier == ITEM_MODIFIER_RIGHT || modifier == ITEM_MODIFIER_DOWN) @@ -2375,7 +2375,7 @@ INT32 input_device_relative_item::read_as_switch(input_item_modifier modifier) // as a relative axis value //------------------------------------------------- -INT32 input_device_relative_item::read_as_relative(input_item_modifier modifier) +int32_t input_device_relative_item::read_as_relative(input_item_modifier modifier) { // just return directly return update_value(); @@ -2387,7 +2387,7 @@ INT32 input_device_relative_item::read_as_relative(input_item_modifier modifier) // as an absolute axis value //------------------------------------------------- -INT32 input_device_relative_item::read_as_absolute(input_item_modifier modifier) +int32_t input_device_relative_item::read_as_absolute(input_item_modifier modifier) { // no translation to absolute return 0; @@ -2414,10 +2414,10 @@ input_device_absolute_item::input_device_absolute_item(input_device &device, con // a switch result based on the modifier //------------------------------------------------- -INT32 input_device_absolute_item::read_as_switch(input_item_modifier modifier) +int32_t input_device_absolute_item::read_as_switch(input_item_modifier modifier) { // start with the current value - INT32 result = m_device.apply_deadzone_and_saturation(update_value()); + int32_t result = m_device.apply_deadzone_and_saturation(update_value()); assert(result >= INPUT_ABSOLUTE_MIN && result <= INPUT_ABSOLUTE_MAX); // left/right/up/down: if this is a joystick, fetch the paired X/Y axis values and convert @@ -2455,7 +2455,7 @@ INT32 input_device_absolute_item::read_as_switch(input_item_modifier modifier) // as a relative axis value //------------------------------------------------- -INT32 input_device_absolute_item::read_as_relative(input_item_modifier modifier) +int32_t input_device_absolute_item::read_as_relative(input_item_modifier modifier) { // no translation to relative return 0; @@ -2468,10 +2468,10 @@ INT32 input_device_absolute_item::read_as_relative(input_item_modifier modifier) // tweaks //------------------------------------------------- -INT32 input_device_absolute_item::read_as_absolute(input_item_modifier modifier) +int32_t input_device_absolute_item::read_as_absolute(input_item_modifier modifier) { // start with the current value - INT32 result = m_device.apply_deadzone_and_saturation(update_value()); + int32_t result = m_device.apply_deadzone_and_saturation(update_value()); assert(result >= INPUT_ABSOLUTE_MIN && result <= INPUT_ABSOLUTE_MAX); // if we're doing a lightgun reload hack, override the value diff --git a/src/emu/input.h b/src/emu/input.h index 750b2fdc873..42392871470 100644 --- a/src/emu/input.h +++ b/src/emu/input.h @@ -23,11 +23,11 @@ //************************************************************************** // relative devices return ~512 units per onscreen pixel -const INT32 INPUT_RELATIVE_PER_PIXEL = 512; +const int32_t INPUT_RELATIVE_PER_PIXEL = 512; // absolute devices return values between -65536 and +65536 -const INT32 INPUT_ABSOLUTE_MIN = -65536; -const INT32 INPUT_ABSOLUTE_MAX = 65536; +const int32_t INPUT_ABSOLUTE_MIN = -65536; +const int32_t INPUT_ABSOLUTE_MAX = 65536; // maximum number of axis/buttons/hats with ITEM_IDs for use by osd layer const int INPUT_MAX_AXIS = 8; @@ -354,7 +354,7 @@ class input_manager; // callback for getting the value of an item on a device -typedef INT32 (*item_get_state_func)(void *device_internal, void *item_internal); +typedef int32_t (*item_get_state_func)(void *device_internal, void *item_internal); // controller alias table typedef typedef std::map devicemap_table_type; @@ -379,15 +379,15 @@ public: std::string to_string() const; // update the state of a live map - UINT8 update(INT32 xaxisval, INT32 yaxisval); + uint8_t update(int32_t xaxisval, int32_t yaxisval); // joystick mapping codes - static const UINT8 JOYSTICK_MAP_NEUTRAL = 0x00; - static const UINT8 JOYSTICK_MAP_LEFT = 0x01; - static const UINT8 JOYSTICK_MAP_RIGHT = 0x02; - static const UINT8 JOYSTICK_MAP_UP = 0x04; - static const UINT8 JOYSTICK_MAP_DOWN = 0x08; - static const UINT8 JOYSTICK_MAP_STICKY = 0x0f; + static const uint8_t JOYSTICK_MAP_NEUTRAL = 0x00; + static const uint8_t JOYSTICK_MAP_LEFT = 0x01; + static const uint8_t JOYSTICK_MAP_RIGHT = 0x02; + static const uint8_t JOYSTICK_MAP_UP = 0x04; + static const uint8_t JOYSTICK_MAP_DOWN = 0x08; + static const uint8_t JOYSTICK_MAP_STICKY = 0x0f; private: // internal helpers @@ -399,8 +399,8 @@ private: } // internal state - UINT8 m_map[9][9]; // 9x9 grid - UINT8 m_lastmap; // last value returned (for sticky tracking) + uint8_t m_map[9][9]; // 9x9 grid + uint8_t m_lastmap; // last value returned (for sticky tracking) std::string m_origstring; // originally parsed string }; @@ -446,7 +446,7 @@ public: private: // internal state - UINT32 m_internal; + uint32_t m_internal; }; @@ -516,17 +516,17 @@ public: input_item_id itemid() const { return m_itemid; } input_item_class itemclass() const { return m_itemclass; } const char *token() const { return m_token.c_str(); } - INT32 current() const { return m_current; } - INT32 memory() const { return m_memory; } + int32_t current() const { return m_current; } + int32_t memory() const { return m_memory; } // helpers - INT32 update_value(); - void set_memory(INT32 value) { m_memory = value; } + int32_t update_value(); + void set_memory(int32_t value) { m_memory = value; } // readers - virtual INT32 read_as_switch(input_item_modifier modifier) = 0; - virtual INT32 read_as_relative(input_item_modifier modifier) = 0; - virtual INT32 read_as_absolute(input_item_modifier modifier) = 0; + virtual int32_t read_as_switch(input_item_modifier modifier) = 0; + virtual int32_t read_as_relative(input_item_modifier modifier) = 0; + virtual int32_t read_as_absolute(input_item_modifier modifier) = 0; protected: // internal state @@ -539,8 +539,8 @@ protected: std::string m_token; // tokenized name for non-standard items // live state - INT32 m_current; // current raw value - INT32 m_memory; // "memory" value, to remember where we started during polling + int32_t m_current; // current raw value + int32_t m_memory; // "memory" value, to remember where we started during polling }; @@ -577,7 +577,7 @@ public: void set_joystick_map(const joystick_map &map) { m_joymap = map; } // helpers - INT32 apply_deadzone_and_saturation(INT32 value) const; + int32_t apply_deadzone_and_saturation(int32_t value) const; void apply_steadykey() const; bool match_device_id(const char * deviceid); @@ -593,8 +593,8 @@ private: // joystick information joystick_map m_joymap; // joystick map for this device - INT32 m_joystick_deadzone; // deadzone for joystick - INT32 m_joystick_saturation; // saturation position for joystick + int32_t m_joystick_deadzone; // deadzone for joystick + int32_t m_joystick_saturation; // saturation position for joystick bool m_steadykey_enabled; // steadykey enabled for keyboards bool m_lightgun_reload_button; // lightgun reload hack }; @@ -658,7 +658,7 @@ public: input_class &device_class(input_device_class devclass) { assert(devclass < ARRAY_LENGTH(m_class)); assert(m_class[devclass] != nullptr); return *m_class[devclass]; } // input code readers - INT32 code_value(input_code code); + int32_t code_value(input_code code); bool code_pressed(input_code code) { return code_value(code) != 0; } bool code_pressed_once(input_code code); @@ -678,7 +678,7 @@ public: // input sequence readers bool seq_pressed(const input_seq &seq); - INT32 seq_axis_value(const input_seq &seq, input_item_class &itemclass); + int32_t seq_axis_value(const input_seq &seq, input_item_class &itemclass); // input sequence polling void seq_poll_start(input_item_class itemclass, const input_seq *startseq = nullptr); @@ -1181,7 +1181,7 @@ extern const char joystick_map_4way_diagonal[]; // input_device_item helpers inline input_manager &input_device_item::manager() const { return m_device.manager(); } inline running_machine &input_device_item::machine() const { return m_device.machine(); } -inline INT32 input_device_item::update_value() { return m_current = (*m_getstate)(m_device.internal(), m_internal); } +inline int32_t input_device_item::update_value() { return m_current = (*m_getstate)(m_device.internal(), m_internal); } // input_device helpers inline input_manager &input_device::manager() const { return m_class.manager(); } diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index 2943457ebb9..dfd444cd1af 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -128,9 +128,9 @@ const int SPACE_COUNT = 3; // from a numerator and a denominator //------------------------------------------------- -inline INT64 compute_scale(INT32 num, INT32 den) +inline int64_t compute_scale(int32_t num, int32_t den) { - return (INT64(num) << 24) / den; + return (int64_t(num) << 24) / den; } @@ -139,9 +139,9 @@ inline INT64 compute_scale(INT32 num, INT32 den) // an 8.24 scale value //------------------------------------------------- -inline INT64 recip_scale(INT64 scale) +inline int64_t recip_scale(int64_t scale) { - return (INT64(1) << 48) / scale; + return (int64_t(1) << 48) / scale; } @@ -150,9 +150,9 @@ inline INT64 recip_scale(INT64 scale) // a 32-bit value //------------------------------------------------- -inline INT32 apply_scale(INT32 value, INT64 scale) +inline int32_t apply_scale(int32_t value, int64_t scale) { - return (INT64(value) * scale) >> 24; + return (int64_t(value) * scale) >> 24; } @@ -163,7 +163,7 @@ inline INT32 apply_scale(INT32 value, INT64 scale) const struct { - UINT32 id; + uint32_t id; const char *string; } input_port_default_strings[] = { @@ -572,7 +572,7 @@ ioport_setting::ioport_setting(ioport_field &field, ioport_value _value, const c // ioport_diplocation - constructor //------------------------------------------------- -ioport_diplocation::ioport_diplocation(const char *name, UINT8 swnum, bool invert) +ioport_diplocation::ioport_diplocation(const char *name, uint8_t swnum, bool invert) : m_next(nullptr), m_name(name), m_number(swnum), @@ -1150,7 +1150,7 @@ void ioport_field::frame_update(ioport_value &result) // additional logic to restrict digital joysticks if (curstate && !m_digital_value && m_live->joystick != nullptr && m_way != 16 && !machine().options().joystick_contradictory()) { - UINT8 mask = (m_way == 4) ? m_live->joystick->current4way() : m_live->joystick->current(); + uint8_t mask = (m_way == 4) ? m_live->joystick->current4way() : m_live->joystick->current(); if (!(mask & (1 << m_live->joydir))) curstate = false; } @@ -1862,7 +1862,7 @@ ioport_manager::~ioport_manager() // type/player //------------------------------------------------- -const char *ioport_manager::type_name(ioport_type type, UINT8 player) +const char *ioport_manager::type_name(ioport_type type, uint8_t player) { // if we have a machine, use the live state and quick lookup input_type_entry *entry = m_type_to_entry[type][player]; @@ -2073,7 +2073,7 @@ g_profiler.stop(); // values based on the time between frames //------------------------------------------------- -INT32 ioport_manager::frame_interpolate(INT32 oldval, INT32 newval) +int32_t ioport_manager::frame_interpolate(int32_t oldval, int32_t newval) { // if no last delta, just use new value if (m_last_delta_nsec == 0) @@ -2081,7 +2081,7 @@ INT32 ioport_manager::frame_interpolate(INT32 oldval, INT32 newval) // otherwise, interpolate attoseconds_t nsec_since_last = (machine().time() - m_last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND; - return oldval + (INT64(newval - oldval) * nsec_since_last / m_last_delta_nsec); + return oldval + (int64_t(newval - oldval) * nsec_since_last / m_last_delta_nsec); } @@ -2514,7 +2514,7 @@ _Type ioport_manager::playback_read(_Type &result) template<> bool ioport_manager::playback_read(bool &result) { - UINT8 temp; + uint8_t temp; playback_read(temp); return result = temp!=0; } @@ -2581,8 +2581,8 @@ void ioport_manager::playback_end(const char *message) // display speed stats if (m_playback_accumulated_speed > 0) m_playback_accumulated_speed /= m_playback_accumulated_frames; - osd_printf_info("Total playback frames: %d\n", UINT32(m_playback_accumulated_frames)); - osd_printf_info("Average recorded speed: %d%%\n", UINT32((m_playback_accumulated_speed * 200 + 1) >> 21)); + osd_printf_info("Total playback frames: %d\n", uint32_t(m_playback_accumulated_frames)); + osd_printf_info("Average recorded speed: %d%%\n", uint32_t((m_playback_accumulated_speed * 200 + 1) >> 21)); // close the program at the end of inp file playback if (machine().options().exit_after_playback()) { @@ -2613,7 +2613,7 @@ void ioport_manager::playback_frame(const attotime &curtime) playback_end("Out of sync"); // then the speed - UINT32 curspeed; + uint32_t curspeed; m_playback_accumulated_speed += playback_read(curspeed); m_playback_accumulated_frames++; } @@ -2667,7 +2667,7 @@ void ioport_manager::record_write(_Type value) template<> void ioport_manager::record_write(bool value) { - UINT8 byte = UINT8(value); + uint8_t byte = uint8_t(value); record_write(byte); } @@ -2686,7 +2686,7 @@ void ioport_manager::timecode_write(_Type value) /*template<> void ioport_manager::timecode_write(bool value) { - UINT8 byte = UINT8(value); + uint8_t byte = uint8_t(value); timecode_write(byte); }*/ template<> @@ -2815,7 +2815,7 @@ void ioport_manager::record_frame(const attotime &curtime) record_write(curtime.attoseconds()); // then the current speed - record_write(UINT32(machine().video().speed_percent() * double(1 << 20))); + record_write(uint32_t(machine().video().speed_percent() * double(1 << 20))); } if (m_timecode_file.is_open() && machine().video().get_timecode_write()) @@ -3385,12 +3385,12 @@ analog_field::analog_field(ioport_field &field) // the appropriate min/max for the analog control //------------------------------------------------- -inline INT32 analog_field::apply_min_max(INT32 value) const +inline int32_t analog_field::apply_min_max(int32_t value) const { // take the analog minimum and maximum values and apply the inverse of the // sensitivity so that we can clamp against them before applying sensitivity - INT32 adjmin = apply_inverse_sensitivity(m_minimum); - INT32 adjmax = apply_inverse_sensitivity(m_maximum); + int32_t adjmin = apply_inverse_sensitivity(m_minimum); + int32_t adjmax = apply_inverse_sensitivity(m_maximum); // for absolute devices, clamp to the bounds absolutely if (!m_wraps) @@ -3404,7 +3404,7 @@ inline INT32 analog_field::apply_min_max(INT32 value) const // for relative devices, wrap around when we go past the edge else { - INT32 range = adjmax - adjmin; + int32_t range = adjmax - adjmin; // rolls to other end when 1 position past end. value = (value - adjmin) % range; if (value < 0) @@ -3421,9 +3421,9 @@ inline INT32 analog_field::apply_min_max(INT32 value) const // adjustment for a current value //------------------------------------------------- -inline INT32 analog_field::apply_sensitivity(INT32 value) const +inline int32_t analog_field::apply_sensitivity(int32_t value) const { - return INT32((INT64(value) * m_sensitivity) / 100.0 + 0.5); + return int32_t((int64_t(value) * m_sensitivity) / 100.0 + 0.5); } @@ -3432,9 +3432,9 @@ inline INT32 analog_field::apply_sensitivity(INT32 value) const // sensitivity adjustment for a current value //------------------------------------------------- -inline INT32 analog_field::apply_inverse_sensitivity(INT32 value) const +inline int32_t analog_field::apply_inverse_sensitivity(int32_t value) const { - return INT32((INT64(value) * 100) / m_sensitivity); + return int32_t((int64_t(value) * 100) / m_sensitivity); } @@ -3443,7 +3443,7 @@ inline INT32 analog_field::apply_inverse_sensitivity(INT32 value) const // analog input //------------------------------------------------- -INT32 analog_field::apply_settings(INT32 value) const +int32_t analog_field::apply_settings(int32_t value) const { // apply the min/max and then the sensitivity value = apply_min_max(value); @@ -3480,7 +3480,7 @@ void analog_field::frame_update(running_machine &machine) // get the new raw analog value and its type input_item_class itemclass; - INT32 rawvalue = machine.input().seq_axis_value(m_field.seq(SEQ_TYPE_STANDARD), itemclass); + int32_t rawvalue = machine.input().seq_axis_value(m_field.seq(SEQ_TYPE_STANDARD), itemclass); // if we got an absolute input, it overrides everything else if (itemclass == ITEM_CLASS_ABSOLUTE) @@ -3528,14 +3528,14 @@ void analog_field::frame_update(running_machine &machine) // if we got it from a relative device, use that as the starting delta // also note that the last input was not a digital one - INT32 delta = 0; + int32_t delta = 0; if (itemclass == ITEM_CLASS_RELATIVE && rawvalue != 0) { delta = rawvalue; m_lastdigital = false; } - INT64 keyscale = (m_accum >= 0) ? m_keyscalepos : m_keyscaleneg; + int64_t keyscale = (m_accum >= 0) ? m_keyscalepos : m_keyscaleneg; // if the decrement code sequence is pressed, add the key delta to // the accumulated delta; also note that the last input was a digital one @@ -3578,7 +3578,7 @@ void analog_field::frame_update(running_machine &machine) // was pressed, apply autocentering if (m_autocenter) { - INT32 center = apply_inverse_sensitivity(m_center); + int32_t center = apply_inverse_sensitivity(m_center); if (m_lastdigital && !keypressed) { // autocenter from positive values @@ -3621,7 +3621,7 @@ void analog_field::read(ioport_value &result) return; // start with the raw value - INT32 value = m_accum; + int32_t value = m_accum; // interpolate if appropriate and if time has passed since the last update if (m_interpolate) @@ -3650,7 +3650,7 @@ void analog_field::read(ioport_value &result) float analog_field::crosshair_read() { - INT32 rawvalue = apply_settings(m_accum) & (m_field.mask() >> m_shift); + int32_t rawvalue = apply_settings(m_accum) & (m_field.mask() >> m_shift); return float(rawvalue - m_adjmin) / float(m_adjmax - m_adjmin); } diff --git a/src/emu/ioport.h b/src/emu/ioport.h index 122f242f6b3..cf5914afc8c 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -27,7 +27,7 @@ //************************************************************************** // input ports support up to 32 bits each -typedef UINT32 ioport_value; +typedef uint32_t ioport_value; // active high/low values for input ports const ioport_value IP_ACTIVE_HIGH = 0x00000000; @@ -811,7 +811,7 @@ public: input_type_entry *next() const { return m_next; } ioport_type type() const { return m_type; } ioport_group group() const { return m_group; } - UINT8 player() const { return m_player; } + uint8_t player() const { return m_player; } const char *token() const { return m_token; } const char *name() const { return m_name; } input_seq &defseq(input_seq_type seqtype = SEQ_TYPE_STANDARD) { return m_defseq[seqtype]; } @@ -826,7 +826,7 @@ private: input_type_entry * m_next; // next description in the list ioport_type m_type; // IPT_* for this entry ioport_group m_group; // which group the port belongs to - UINT8 m_player; // player number (0 is player 1) + uint8_t m_player; // player number (0 is player 1) const char * m_token; // token used to store settings const char * m_name; // user-friendly name input_seq m_defseq[SEQ_TYPE_TOTAL];// default input sequence @@ -854,10 +854,10 @@ public: }; // bit constants - static const UINT8 UP_BIT = 1 << JOYDIR_UP; - static const UINT8 DOWN_BIT = 1 << JOYDIR_DOWN; - static const UINT8 LEFT_BIT = 1 << JOYDIR_LEFT; - static const UINT8 RIGHT_BIT = 1 << JOYDIR_RIGHT; + static const uint8_t UP_BIT = 1 << JOYDIR_UP; + static const uint8_t DOWN_BIT = 1 << JOYDIR_DOWN; + static const uint8_t LEFT_BIT = 1 << JOYDIR_LEFT; + static const uint8_t RIGHT_BIT = 1 << JOYDIR_RIGHT; // construction/destruction digital_joystick(int player, int number); @@ -866,8 +866,8 @@ public: digital_joystick *next() const { return m_next; } int player() const { return m_player; } int number() const { return m_number; } - UINT8 current() const { return m_current; } - UINT8 current4way() const { return m_current4way; } + uint8_t current() const { return m_current; } + uint8_t current4way() const { return m_current4way; } // configuration direction_t add_axis(ioport_field &field); @@ -881,9 +881,9 @@ private: int m_player; // player number represented int m_number; // joystick number represented simple_list > m_field[JOYDIR_COUNT]; // potential input fields for each direction - UINT8 m_current; // current value - UINT8 m_current4way; // current 4-way value - UINT8 m_previous; // previous value + uint8_t m_current; // current value + uint8_t m_current4way; // current 4-way value + uint8_t m_previous; // previous value }; DECLARE_ENUM_OPERATORS(digital_joystick::direction_t) @@ -984,18 +984,18 @@ class ioport_diplocation public: // construction/destruction - ioport_diplocation(const char *name, UINT8 swnum, bool invert); + ioport_diplocation(const char *name, uint8_t swnum, bool invert); // getters ioport_diplocation *next() const { return m_next; } const char *name() const { return m_name.c_str(); } - UINT8 number() const { return m_number; } + uint8_t number() const { return m_number; } bool inverted() const { return m_invert; } private: ioport_diplocation * m_next; // pointer to the next bit std::string m_name; // name of the physical DIP switch - UINT8 m_number; // physical switch number + uint8_t m_number; // physical switch number bool m_invert; // is this an active-high DIP? }; @@ -1039,7 +1039,7 @@ public: ioport_value defvalue() const { return m_defvalue; } ioport_condition &condition() { return m_condition; } ioport_type type() const { return m_type; } - UINT8 player() const { return m_player; } + uint8_t player() const { return m_player; } bool digital_value() const { return m_digital_value; } void set_value(ioport_value value); @@ -1052,7 +1052,7 @@ public: bool analog_wraps() const { return ((m_flags & ANALOG_FLAG_WRAPS) != 0); } bool analog_invert() const { return ((m_flags & ANALOG_FLAG_INVERT) != 0); } - UINT8 impulse() const { return m_impulse; } + uint8_t impulse() const { return m_impulse; } const char *name() const; const char *specific_name() const { return m_name; } const input_seq &seq(input_seq_type seqtype = SEQ_TYPE_STANDARD) const; @@ -1063,16 +1063,16 @@ public: ioport_value minval() const { return m_min; } ioport_value maxval() const { return m_max; } - INT32 sensitivity() const { return m_sensitivity; } - INT32 delta() const { return m_delta; } - INT32 centerdelta() const { return m_centerdelta; } + int32_t sensitivity() const { return m_sensitivity; } + int32_t delta() const { return m_delta; } + int32_t centerdelta() const { return m_centerdelta; } crosshair_axis_t crosshair_axis() const { return m_crosshair_axis; } double crosshair_scale() const { return m_crosshair_scale; } double crosshair_offset() const { return m_crosshair_offset; } - UINT16 full_turn_count() const { return m_full_turn_count; } + uint16_t full_turn_count() const { return m_full_turn_count; } const ioport_value *remap_table() const { return m_remap_table; } - UINT8 way() const { return m_way; } + uint8_t way() const { return m_way; } char32_t keyboard_code(int which) const; std::string key_name(int which) const; ioport_field_live &live() const { assert(m_live != nullptr); return *m_live; } @@ -1080,7 +1080,7 @@ public: // setters void set_crosshair_scale(double scale) { m_crosshair_scale = scale; } void set_crosshair_offset(double offset) { m_crosshair_offset = offset; } - void set_player(UINT8 player) { m_player = player; } + void set_player(uint8_t player) { m_player = player; } // derived getters ioport_type_class type_class() const; @@ -1105,9 +1105,9 @@ public: ioport_value value; // for DIP switches bool autofire; // for autofire settings input_seq seq[SEQ_TYPE_TOTAL]; // sequences of all types - INT32 sensitivity; // for analog controls - INT32 delta; // for analog controls - INT32 centerdelta; // for analog controls + int32_t sensitivity; // for analog controls + int32_t delta; // for analog controls + int32_t centerdelta; // for analog controls bool reverse; // for analog controls bool toggle; // for non-analog controls }; @@ -1130,9 +1130,9 @@ private: ioport_value m_defvalue; // default value of these bits ioport_condition m_condition; // condition under which this field is relevant ioport_type m_type; // IPT_* type for this port - UINT8 m_player; // player number (0-based) - UINT32 m_flags; // combination of FIELD_FLAG_* and ANALOG_FLAG_* above - UINT8 m_impulse; // number of frames before reverting to defvalue + uint8_t m_player; // player number (0-based) + uint32_t m_flags; // combination of FIELD_FLAG_* and ANALOG_FLAG_* above + uint8_t m_impulse; // number of frames before reverting to defvalue const char * m_name; // user-friendly name to display input_seq m_seq[SEQ_TYPE_TOTAL];// sequences of all types ioport_field_read_delegate m_read; // read callback routine @@ -1146,19 +1146,19 @@ private: // data relevant to analog control types ioport_value m_min; // minimum value for absolute axes ioport_value m_max; // maximum value for absolute axes - INT32 m_sensitivity; // sensitivity (100=normal) - INT32 m_delta; // delta to apply each frame a digital inc/dec key is pressed - INT32 m_centerdelta; // delta to apply each frame no digital inputs are pressed + int32_t m_sensitivity; // sensitivity (100=normal) + int32_t m_delta; // delta to apply each frame a digital inc/dec key is pressed + int32_t m_centerdelta; // delta to apply each frame no digital inputs are pressed crosshair_axis_t m_crosshair_axis; // crosshair axis double m_crosshair_scale; // crosshair scale double m_crosshair_offset; // crosshair offset double m_crosshair_altaxis;// crosshair alternate axis value ioport_field_crossmap_delegate m_crosshair_mapper; // crosshair mapping function - UINT16 m_full_turn_count; // number of optical counts for 1 full turn of the original control + uint16_t m_full_turn_count; // number of optical counts for 1 full turn of the original control const ioport_value * m_remap_table; // pointer to an array that remaps the port value // data relevant to other specific types - UINT8 m_way; // digital joystick 2/4/8-way descriptions + uint8_t m_way; // digital joystick 2/4/8-way descriptions char32_t m_chars[4]; // unicode key data }; @@ -1176,7 +1176,7 @@ struct ioport_field_live digital_joystick * joystick; // pointer to digital joystick information input_seq seq[SEQ_TYPE_TOTAL];// currently configured input sequences ioport_value value; // current value of this port - UINT8 impulse; // counter for impulse controls + uint8_t impulse; // counter for impulse controls bool last; // were we pressed last time? bool toggle; // current toggle setting digital_joystick::direction_t joydir; // digital joystick direction index @@ -1269,10 +1269,10 @@ public: analog_field *next() const { return m_next; } ioport_manager &manager() const { return m_field.manager(); } ioport_field &field() const { return m_field; } - INT32 sensitivity() const { return m_sensitivity; } + int32_t sensitivity() const { return m_sensitivity; } bool reverse() const { return m_reverse; } - INT32 delta() const { return m_delta; } - INT32 centerdelta() const { return m_centerdelta; } + int32_t delta() const { return m_delta; } + int32_t centerdelta() const { return m_centerdelta; } // readers void read(ioport_value &value); @@ -1281,44 +1281,44 @@ public: private: // helpers - INT32 apply_min_max(INT32 value) const; - INT32 apply_settings(INT32 value) const; - INT32 apply_sensitivity(INT32 value) const; - INT32 apply_inverse_sensitivity(INT32 value) const; + int32_t apply_min_max(int32_t value) const; + int32_t apply_settings(int32_t value) const; + int32_t apply_sensitivity(int32_t value) const; + int32_t apply_inverse_sensitivity(int32_t value) const; // internal state analog_field * m_next; // link to the next analog state for this port ioport_field & m_field; // pointer to the input field referenced // adjusted values (right-justified and tweaked) - UINT8 m_shift; // shift to align final value in the port - INT32 m_adjdefvalue; // adjusted default value from the config - INT32 m_adjmin; // adjusted minimum value from the config - INT32 m_adjmax; // adjusted maximum value from the config + uint8_t m_shift; // shift to align final value in the port + int32_t m_adjdefvalue; // adjusted default value from the config + int32_t m_adjmin; // adjusted minimum value from the config + int32_t m_adjmax; // adjusted maximum value from the config // live values of configurable parameters - INT32 m_sensitivity; // current live sensitivity (100=normal) + int32_t m_sensitivity; // current live sensitivity (100=normal) bool m_reverse; // current live reverse flag - INT32 m_delta; // current live delta to apply each frame a digital inc/dec key is pressed - INT32 m_centerdelta; // current live delta to apply each frame no digital inputs are pressed + int32_t m_delta; // current live delta to apply each frame a digital inc/dec key is pressed + int32_t m_centerdelta; // current live delta to apply each frame no digital inputs are pressed // live analog value tracking - INT32 m_accum; // accumulated value (including relative adjustments) - INT32 m_previous; // previous adjusted value - INT32 m_previousanalog; // previous analog value + int32_t m_accum; // accumulated value (including relative adjustments) + int32_t m_previous; // previous adjusted value + int32_t m_previousanalog; // previous analog value // parameters for modifying live values - INT32 m_minimum; // minimum adjusted value - INT32 m_maximum; // maximum adjusted value - INT32 m_center; // center adjusted value for autocentering - INT32 m_reverse_val; // value where we subtract from to reverse directions + int32_t m_minimum; // minimum adjusted value + int32_t m_maximum; // maximum adjusted value + int32_t m_center; // center adjusted value for autocentering + int32_t m_reverse_val; // value where we subtract from to reverse directions // scaling factors - INT64 m_scalepos; // scale factor to apply to positive adjusted values - INT64 m_scaleneg; // scale factor to apply to negative adjusted values - INT64 m_keyscalepos; // scale factor to apply to the key delta field when pos - INT64 m_keyscaleneg; // scale factor to apply to the key delta field when neg - INT64 m_positionalscale; // scale factor to divide a joystick into positions + int64_t m_scalepos; // scale factor to apply to positive adjusted values + int64_t m_scaleneg; // scale factor to apply to negative adjusted values + int64_t m_keyscalepos; // scale factor to apply to the key delta field when pos + int64_t m_keyscaleneg; // scale factor to apply to the key delta field when neg + int64_t m_positionalscale; // scale factor to divide a joystick into positions // misc flags bool m_absolute; // is this an absolute or relative input? @@ -1353,7 +1353,7 @@ private: // internal state dynamic_field * m_next; // linked list of info for this port ioport_field & m_field; // reference to the input field - UINT8 m_shift; // shift to apply to the final result + uint8_t m_shift; // shift to apply to the final result ioport_value m_oldval; // last value }; @@ -1402,7 +1402,7 @@ public: // type helpers const simple_list &types() const { return m_typelist; } bool type_pressed(ioport_type type, int player = 0); - const char *type_name(ioport_type type, UINT8 player); + const char *type_name(ioport_type type, uint8_t player); ioport_group type_group(ioport_type type, int player); const input_seq &type_seq(ioport_type type, int player = 0, input_seq_type seqtype = SEQ_TYPE_STANDARD); void set_type_seq(ioport_type type, int player, input_seq_type seqtype, const input_seq &newseq); @@ -1413,7 +1413,7 @@ public: digital_joystick &digjoystick(int player, int joysticknum); int count_players() const; bool crosshair_position(int player, float &x, float &y); - INT32 frame_interpolate(INT32 oldval, INT32 newval); + int32_t frame_interpolate(int32_t oldval, int32_t newval); ioport_type token_to_input_type(const char *string, int &player) const; std::string input_type_to_token(ioport_type type, int player); @@ -1483,8 +1483,8 @@ private: // playback/record information emu_file m_record_file; // recording file (nullptr if not recording) emu_file m_playback_file; // playback file (nullptr if not recording) - UINT64 m_playback_accumulated_speed; // accumulated speed during playback - UINT32 m_playback_accumulated_frames; // accumulated frames during playback + uint64_t m_playback_accumulated_speed; // accumulated speed during playback + uint32_t m_playback_accumulated_frames; // accumulated frames during playback emu_file m_timecode_file; // timecode/frames playback file (nullptr if not recording) int m_timecode_count; attotime m_timecode_last_time; @@ -1521,17 +1521,17 @@ public: void field_set_player(int player) const { m_curfield->m_player = player - 1; } void field_set_cocktail() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_COCKTAIL; field_set_player(2); } void field_set_toggle() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_TOGGLE; } - void field_set_impulse(UINT8 impulse) const { m_curfield->m_impulse = impulse; } + void field_set_impulse(uint8_t impulse) const { m_curfield->m_impulse = impulse; } void field_set_analog_reverse() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_REVERSE; } void field_set_analog_reset() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_RESET; } void field_set_optional() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_OPTIONAL; } void field_set_min_max(ioport_value minval, ioport_value maxval) const { m_curfield->m_min = minval; m_curfield->m_max = maxval; } - void field_set_sensitivity(INT32 sensitivity) const { m_curfield->m_sensitivity = sensitivity; } - void field_set_delta(INT32 delta) const { m_curfield->m_centerdelta = m_curfield->m_delta = delta; } - void field_set_centerdelta(INT32 delta) const { m_curfield->m_centerdelta = delta; } + void field_set_sensitivity(int32_t sensitivity) const { m_curfield->m_sensitivity = sensitivity; } + void field_set_delta(int32_t delta) const { m_curfield->m_centerdelta = m_curfield->m_delta = delta; } + void field_set_centerdelta(int32_t delta) const { m_curfield->m_centerdelta = delta; } void field_set_crosshair(crosshair_axis_t axis, double altaxis, double scale, double offset) const { m_curfield->m_crosshair_axis = axis; m_curfield->m_crosshair_altaxis = altaxis; m_curfield->m_crosshair_scale = scale; m_curfield->m_crosshair_offset = offset; } void field_set_crossmapper(ioport_field_crossmap_delegate callback) const { m_curfield->m_crosshair_mapper = callback; } - void field_set_full_turn_count(UINT16 count) const { m_curfield->m_full_turn_count = count; } + void field_set_full_turn_count(uint16_t count) const { m_curfield->m_full_turn_count = count; } void field_set_analog_wraps() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_WRAPS; } void field_set_remap_table(const ioport_value *table) { m_curfield->m_remap_table = table; } void field_set_analog_invert() const { m_curfield->m_flags |= ioport_field::ANALOG_FLAG_INVERT; } diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index adce482a19c..94c331eac8d 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -817,7 +817,7 @@ void running_machine::set_rtc_datetime(const system_time &systime) // rand - standardized random numbers //------------------------------------------------- -UINT32 running_machine::rand() +uint32_t running_machine::rand() { m_rand_seed = 1664525 * m_rand_seed + 1013904223; @@ -863,7 +863,7 @@ void running_machine::handle_saveload() } else { - UINT32 const openflags = (m_saveload_schedule == SLS_LOAD) ? OPEN_FLAG_READ : (OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); + uint32_t const openflags = (m_saveload_schedule == SLS_LOAD) ? OPEN_FLAG_READ : (OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); // open the file emu_file file(m_saveload_searchpath, openflags); @@ -927,7 +927,7 @@ void running_machine::handle_saveload() // of the system //------------------------------------------------- -void running_machine::soft_reset(void *ptr, INT32 param) +void running_machine::soft_reset(void *ptr, int32_t param) { logerror("Soft reset\n"); diff --git a/src/emu/machine.h b/src/emu/machine.h index 38f64247991..5818e86bc87 100644 --- a/src/emu/machine.h +++ b/src/emu/machine.h @@ -114,18 +114,18 @@ public: { void set(struct tm &t); - UINT8 second; // seconds (0-59) - UINT8 minute; // minutes (0-59) - UINT8 hour; // hours (0-23) - UINT8 mday; // day of month (1-31) - UINT8 month; // month (0-11) - INT32 year; // year (1=1 AD) - UINT8 weekday; // day of week (0-6) - UINT16 day; // day of year (0-365) - UINT8 is_dst; // is this daylight savings? + uint8_t second; // seconds (0-59) + uint8_t minute; // minutes (0-59) + uint8_t hour; // hours (0-23) + uint8_t mday; // day of month (1-31) + uint8_t month; // month (0-11) + int32_t year; // year (1=1 AD) + uint8_t weekday; // day of week (0-6) + uint16_t day; // day of year (0-365) + uint8_t is_dst; // is this daylight savings? }; - INT64 time; // number of seconds elapsed since midnight, January 1 1970 UTC + int64_t time; // number of seconds elapsed since midnight, January 1 1970 UTC full_time local_time; // local time full_time utc_time; // UTC coordinated time }; @@ -234,7 +234,7 @@ public: template void popmessage(Format &&fmt, Params &&... args) const; template void logerror(Format &&fmt, Params &&... args) const; void strlog(const char *str) const; - UINT32 rand(); + uint32_t rand(); const char *describe_context(); std::string compose_saveload_filename(const char *base_filename, const char **searchpath = nullptr); @@ -247,7 +247,7 @@ private: public: // debugger-related information - UINT32 debug_flags; // the current debug flags + uint32_t debug_flags; // the current debug flags private: // internal helpers @@ -257,7 +257,7 @@ private: void set_saveload_filename(const char *filename); std::string get_statename(const char *statename_opt) const; void handle_saveload(); - void soft_reset(void *ptr = nullptr, INT32 param = 0); + void soft_reset(void *ptr = nullptr, int32_t param = 0); std::string nvram_filename(device_t &device) const; void nvram_load(); void nvram_save(); @@ -304,7 +304,7 @@ private: emu_timer * m_soft_reset_timer; // timer used to schedule a soft reset // misc state - UINT32 m_rand_seed; // current random number seed + uint32_t m_rand_seed; // current random number seed bool m_ui_active; // ui active or not (useful for games / systems with keyboard inputs) time_t m_base_time; // real time at initial emulation time std::string m_basename; // basename used for game-related paths diff --git a/src/emu/mconfig.cpp b/src/emu/mconfig.cpp index e201558f2c9..96ca495aa5a 100644 --- a/src/emu/mconfig.cpp +++ b/src/emu/mconfig.cpp @@ -103,7 +103,7 @@ screen_device *machine_config::first_screen() const // new device //------------------------------------------------- -device_t *machine_config::device_add(device_t *owner, const char *tag, device_type type, UINT32 clock) +device_t *machine_config::device_add(device_t *owner, const char *tag, device_type type, uint32_t clock) { const char *orig_tag = tag; @@ -149,7 +149,7 @@ device_t *machine_config::device_add(device_t *owner, const char *tag, device_ty // replace one device with a new device //------------------------------------------------- -device_t *machine_config::device_replace(device_t *owner, const char *tag, device_type type, UINT32 clock) +device_t *machine_config::device_replace(device_t *owner, const char *tag, device_type type, uint32_t clock) { // find the original device by relative tag (must exist) assert(owner != nullptr); diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index 9851a32abef..19f4e6faf91 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -38,8 +38,8 @@ struct internal_layout { size_t decompressed_size; size_t compressed_size; - UINT8 compression_type; - const UINT8* data; + uint8_t compression_type; + const uint8_t* data; }; @@ -73,8 +73,8 @@ public: const internal_layout * m_default_layout; // default layout for this machine // helpers during configuration; not for general use - device_t *device_add(device_t *owner, const char *tag, device_type type, UINT32 clock); - device_t *device_replace(device_t *owner, const char *tag, device_type type, UINT32 clock); + device_t *device_add(device_t *owner, const char *tag, device_type type, uint32_t clock); + device_t *device_replace(device_t *owner, const char *tag, device_type type, uint32_t clock); device_t *device_remove(device_t *owner, const char *tag); device_t *device_find(device_t *owner, const char *tag); diff --git a/src/emu/memarray.cpp b/src/emu/memarray.cpp index 98a5c7c33ef..c1e615776e2 100644 --- a/src/emu/memarray.cpp +++ b/src/emu/memarray.cpp @@ -35,7 +35,7 @@ memory_array::memory_array() // set - configure the parameters //------------------------------------------------- -void memory_array::set(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe) +void memory_array::set(void *base, uint32_t bytes, int membits, endianness_t endianness, int bpe) { // validate inputs assert(base != nullptr); @@ -89,7 +89,7 @@ void memory_array::set(void *base, UINT32 bytes, int membits, endianness_t endia // set - additional setter variants //------------------------------------------------- -void memory_array::set(const address_space &space, void *base, UINT32 bytes, int bpe) +void memory_array::set(const address_space &space, void *base, uint32_t bytes, int bpe) { set(base, bytes, space.data_width(), space.endianness(), bpe); } @@ -125,23 +125,23 @@ void memory_array::set_endianness(endianness_t endianness) // heleprs for 1 byte-per-entry //------------------------------------------------- -UINT32 memory_array::read8_from_8(int index) const { return reinterpret_cast(m_base)[index]; } -void memory_array::write8_to_8(int index, UINT32 data) { reinterpret_cast(m_base)[index] = data; } +uint32_t memory_array::read8_from_8(int index) const { return reinterpret_cast(m_base)[index]; } +void memory_array::write8_to_8(int index, uint32_t data) { reinterpret_cast(m_base)[index] = data; } -UINT32 memory_array::read8_from_16le(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } -void memory_array::write8_to_16le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_LE(index)] = data; } -UINT32 memory_array::read8_from_16be(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } -void memory_array::write8_to_16be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_BE(index)] = data; } +uint32_t memory_array::read8_from_16le(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } +void memory_array::write8_to_16le(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE_XOR_LE(index)] = data; } +uint32_t memory_array::read8_from_16be(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } +void memory_array::write8_to_16be(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE_XOR_BE(index)] = data; } -UINT32 memory_array::read8_from_32le(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_LE(index)]; } -void memory_array::write8_to_32le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE4_XOR_LE(index)] = data; } -UINT32 memory_array::read8_from_32be(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_BE(index)]; } -void memory_array::write8_to_32be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE4_XOR_BE(index)] = data; } +uint32_t memory_array::read8_from_32le(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_LE(index)]; } +void memory_array::write8_to_32le(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE4_XOR_LE(index)] = data; } +uint32_t memory_array::read8_from_32be(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_BE(index)]; } +void memory_array::write8_to_32be(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE4_XOR_BE(index)] = data; } -UINT32 memory_array::read8_from_64le(int index) const { return reinterpret_cast(m_base)[BYTE8_XOR_BE(index)]; } -void memory_array::write8_to_64le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE8_XOR_BE(index)] = data; } -UINT32 memory_array::read8_from_64be(int index) const { return reinterpret_cast(m_base)[BYTE8_XOR_BE(index)]; } -void memory_array::write8_to_64be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE8_XOR_BE(index)] = data; } +uint32_t memory_array::read8_from_64le(int index) const { return reinterpret_cast(m_base)[BYTE8_XOR_BE(index)]; } +void memory_array::write8_to_64le(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE8_XOR_BE(index)] = data; } +uint32_t memory_array::read8_from_64be(int index) const { return reinterpret_cast(m_base)[BYTE8_XOR_BE(index)]; } +void memory_array::write8_to_64be(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE8_XOR_BE(index)] = data; } //------------------------------------------------- @@ -149,23 +149,23 @@ void memory_array::write8_to_64be(int index, UINT32 data) { reinterpret_cast> 8); } -UINT32 memory_array::read16_from_8be(int index) const { return (read8_from_8(index*2) << 8) | read8_from_8(index*2+1); } -void memory_array::write16_to_8be(int index, UINT32 data) { write8_to_8(index*2, data >> 8); write8_to_8(index*2+1, data); } +uint32_t memory_array::read16_from_8le(int index) const { return read8_from_8(index*2) | (read8_from_8(index*2+1) << 8); } +void memory_array::write16_to_8le(int index, uint32_t data) { write8_to_8(index*2, data); write8_to_8(index*2+1, data >> 8); } +uint32_t memory_array::read16_from_8be(int index) const { return (read8_from_8(index*2) << 8) | read8_from_8(index*2+1); } +void memory_array::write16_to_8be(int index, uint32_t data) { write8_to_8(index*2, data >> 8); write8_to_8(index*2+1, data); } -UINT32 memory_array::read16_from_16(int index) const { return reinterpret_cast(m_base)[index]; } -void memory_array::write16_to_16(int index, UINT32 data) { reinterpret_cast(m_base)[index] = data; } +uint32_t memory_array::read16_from_16(int index) const { return reinterpret_cast(m_base)[index]; } +void memory_array::write16_to_16(int index, uint32_t data) { reinterpret_cast(m_base)[index] = data; } -UINT32 memory_array::read16_from_32le(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } -void memory_array::write16_to_32le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_LE(index)] = data; } -UINT32 memory_array::read16_from_32be(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } -void memory_array::write16_to_32be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_BE(index)] = data; } +uint32_t memory_array::read16_from_32le(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } +void memory_array::write16_to_32le(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE_XOR_LE(index)] = data; } +uint32_t memory_array::read16_from_32be(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } +void memory_array::write16_to_32be(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE_XOR_BE(index)] = data; } -UINT32 memory_array::read16_from_64le(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_LE(index)]; } -void memory_array::write16_to_64le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE4_XOR_LE(index)] = data; } -UINT32 memory_array::read16_from_64be(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_BE(index)]; } -void memory_array::write16_to_64be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE4_XOR_BE(index)] = data; } +uint32_t memory_array::read16_from_64le(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_LE(index)]; } +void memory_array::write16_to_64le(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE4_XOR_LE(index)] = data; } +uint32_t memory_array::read16_from_64be(int index) const { return reinterpret_cast(m_base)[BYTE4_XOR_BE(index)]; } +void memory_array::write16_to_64be(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE4_XOR_BE(index)] = data; } //------------------------------------------------- @@ -173,20 +173,20 @@ void memory_array::write16_to_64be(int index, UINT32 data) { reinterpret_cast> 16); } -UINT32 memory_array::read32_from_8be(int index) const { return (read16_from_8be(index*2) << 16) | read16_from_8be(index*2+1); } -void memory_array::write32_to_8be(int index, UINT32 data) { write16_to_8be(index*2, data >> 16); write16_to_8be(index*2+1, data); } +uint32_t memory_array::read32_from_8le(int index) const { return read16_from_8le(index*2) | (read16_from_8le(index*2+1) << 16); } +void memory_array::write32_to_8le(int index, uint32_t data) { write16_to_8le(index*2, data); write16_to_8le(index*2+1, data >> 16); } +uint32_t memory_array::read32_from_8be(int index) const { return (read16_from_8be(index*2) << 16) | read16_from_8be(index*2+1); } +void memory_array::write32_to_8be(int index, uint32_t data) { write16_to_8be(index*2, data >> 16); write16_to_8be(index*2+1, data); } -UINT32 memory_array::read32_from_16le(int index) const { return read16_from_16(index*2) | (read16_from_16(index*2+1) << 16); } -void memory_array::write32_to_16le(int index, UINT32 data) { write16_to_16(index*2, data); write16_to_16(index*2+1, data >> 16); } -UINT32 memory_array::read32_from_16be(int index) const { return (read16_from_16(index*2) << 16) | read16_from_16(index*2+1); } -void memory_array::write32_to_16be(int index, UINT32 data) { write16_to_16(index*2, data >> 16); write16_to_16(index*2+1, data); } +uint32_t memory_array::read32_from_16le(int index) const { return read16_from_16(index*2) | (read16_from_16(index*2+1) << 16); } +void memory_array::write32_to_16le(int index, uint32_t data) { write16_to_16(index*2, data); write16_to_16(index*2+1, data >> 16); } +uint32_t memory_array::read32_from_16be(int index) const { return (read16_from_16(index*2) << 16) | read16_from_16(index*2+1); } +void memory_array::write32_to_16be(int index, uint32_t data) { write16_to_16(index*2, data >> 16); write16_to_16(index*2+1, data); } -UINT32 memory_array::read32_from_32(int index) const { return reinterpret_cast(m_base)[index]; } -void memory_array::write32_to_32(int index, UINT32 data) { reinterpret_cast(m_base)[index] = data; } +uint32_t memory_array::read32_from_32(int index) const { return reinterpret_cast(m_base)[index]; } +void memory_array::write32_to_32(int index, uint32_t data) { reinterpret_cast(m_base)[index] = data; } -UINT32 memory_array::read32_from_64le(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } -void memory_array::write32_to_64le(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_LE(index)] = data; } -UINT32 memory_array::read32_from_64be(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } -void memory_array::write32_to_64be(int index, UINT32 data) { reinterpret_cast(m_base)[BYTE_XOR_BE(index)] = data; } +uint32_t memory_array::read32_from_64le(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_LE(index)]; } +void memory_array::write32_to_64le(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE_XOR_LE(index)] = data; } +uint32_t memory_array::read32_from_64be(int index) const { return reinterpret_cast(m_base)[BYTE_XOR_BE(index)]; } +void memory_array::write32_to_64be(int index, uint32_t data) { reinterpret_cast(m_base)[BYTE_XOR_BE(index)] = data; } diff --git a/src/emu/memarray.h b/src/emu/memarray.h index 24e60c0d45d..fc6556b5389 100644 --- a/src/emu/memarray.h +++ b/src/emu/memarray.h @@ -44,16 +44,16 @@ class memory_array public: // construction/destruction memory_array(); - memory_array(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe) { set(base, bytes, membits, endianness, bpe); } + memory_array(void *base, uint32_t bytes, int membits, endianness_t endianness, int bpe) { set(base, bytes, membits, endianness, bpe); } template memory_array(std::vector<_Type> &array, endianness_t endianness, int bpe) { set(array, endianness, bpe); } - memory_array(const address_space &space, void *base, UINT32 bytes, int bpe) { set(space, base, bytes, bpe); } + memory_array(const address_space &space, void *base, uint32_t bytes, int bpe) { set(space, base, bytes, bpe); } memory_array(const memory_share &share, int bpe) { set(share, bpe); } memory_array(const memory_array &array) { set(array); } // configuration - void set(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe); + void set(void *base, uint32_t bytes, int membits, endianness_t endianness, int bpe); template void set(std::vector<_Type> &array, endianness_t endianness, int bpe) { set(&array[0], array.size(), 8*sizeof(_Type), endianness, bpe); } - void set(const address_space &space, void *base, UINT32 bytes, int bpe); + void set(const address_space &space, void *base, uint32_t bytes, int bpe); void set(const memory_share &share, int bpe); void set(const memory_array &array); @@ -63,61 +63,61 @@ public: // getters void *base() const { return m_base; } - UINT32 bytes() const { return m_bytes; } + uint32_t bytes() const { return m_bytes; } int membits() const { return m_membits; } endianness_t endianness() const { return m_endianness; } int bytes_per_entry() const { return m_bytes_per_entry; } // entry-level readers and writers - UINT32 read(int index) const { return (this->*m_read_entry)(index); } - void write(int index, UINT32 data) { (this->*m_write_entry)(index, data); } + uint32_t read(int index) const { return (this->*m_read_entry)(index); } + void write(int index, uint32_t data) { (this->*m_write_entry)(index, data); } // byte/word/dword-level readers and writers - UINT8 read8(offs_t offset) const { return reinterpret_cast(m_base)[offset]; } - UINT16 read16(offs_t offset) const { return reinterpret_cast(m_base)[offset]; } - UINT32 read32(offs_t offset) const { return reinterpret_cast(m_base)[offset]; } - UINT64 read64(offs_t offset) const { return reinterpret_cast(m_base)[offset]; } - void write8(offs_t offset, UINT8 data) { reinterpret_cast(m_base)[offset] = data; } - void write16(offs_t offset, UINT16 data, UINT16 mem_mask = 0xffff) { COMBINE_DATA(&reinterpret_cast(m_base)[offset]); } - void write32(offs_t offset, UINT32 data, UINT32 mem_mask = 0xffffffff) { COMBINE_DATA(&reinterpret_cast(m_base)[offset]); } - void write64(offs_t offset, UINT64 data, UINT64 mem_mask = U64(0xffffffffffffffff)) { COMBINE_DATA(&reinterpret_cast(m_base)[offset]); } + uint8_t read8(offs_t offset) const { return reinterpret_cast(m_base)[offset]; } + uint16_t read16(offs_t offset) const { return reinterpret_cast(m_base)[offset]; } + uint32_t read32(offs_t offset) const { return reinterpret_cast(m_base)[offset]; } + uint64_t read64(offs_t offset) const { return reinterpret_cast(m_base)[offset]; } + void write8(offs_t offset, uint8_t data) { reinterpret_cast(m_base)[offset] = data; } + void write16(offs_t offset, uint16_t data, uint16_t mem_mask = 0xffff) { COMBINE_DATA(&reinterpret_cast(m_base)[offset]); } + void write32(offs_t offset, uint32_t data, uint32_t mem_mask = 0xffffffff) { COMBINE_DATA(&reinterpret_cast(m_base)[offset]); } + void write64(offs_t offset, uint64_t data, uint64_t mem_mask = U64(0xffffffffffffffff)) { COMBINE_DATA(&reinterpret_cast(m_base)[offset]); } private: // internal read/write helpers for 1 byte entries - UINT32 read8_from_8(int index) const; void write8_to_8(int index, UINT32 data); - UINT32 read8_from_16le(int index) const; void write8_to_16le(int index, UINT32 data); - UINT32 read8_from_16be(int index) const; void write8_to_16be(int index, UINT32 data); - UINT32 read8_from_32le(int index) const; void write8_to_32le(int index, UINT32 data); - UINT32 read8_from_32be(int index) const; void write8_to_32be(int index, UINT32 data); - UINT32 read8_from_64le(int index) const; void write8_to_64le(int index, UINT32 data); - UINT32 read8_from_64be(int index) const; void write8_to_64be(int index, UINT32 data); + uint32_t read8_from_8(int index) const; void write8_to_8(int index, uint32_t data); + uint32_t read8_from_16le(int index) const; void write8_to_16le(int index, uint32_t data); + uint32_t read8_from_16be(int index) const; void write8_to_16be(int index, uint32_t data); + uint32_t read8_from_32le(int index) const; void write8_to_32le(int index, uint32_t data); + uint32_t read8_from_32be(int index) const; void write8_to_32be(int index, uint32_t data); + uint32_t read8_from_64le(int index) const; void write8_to_64le(int index, uint32_t data); + uint32_t read8_from_64be(int index) const; void write8_to_64be(int index, uint32_t data); // internal read/write helpers for 2 byte entries - UINT32 read16_from_8le(int index) const; void write16_to_8le(int index, UINT32 data); - UINT32 read16_from_8be(int index) const; void write16_to_8be(int index, UINT32 data); - UINT32 read16_from_16(int index) const; void write16_to_16(int index, UINT32 data); - UINT32 read16_from_32le(int index) const; void write16_to_32le(int index, UINT32 data); - UINT32 read16_from_32be(int index) const; void write16_to_32be(int index, UINT32 data); - UINT32 read16_from_64le(int index) const; void write16_to_64le(int index, UINT32 data); - UINT32 read16_from_64be(int index) const; void write16_to_64be(int index, UINT32 data); + uint32_t read16_from_8le(int index) const; void write16_to_8le(int index, uint32_t data); + uint32_t read16_from_8be(int index) const; void write16_to_8be(int index, uint32_t data); + uint32_t read16_from_16(int index) const; void write16_to_16(int index, uint32_t data); + uint32_t read16_from_32le(int index) const; void write16_to_32le(int index, uint32_t data); + uint32_t read16_from_32be(int index) const; void write16_to_32be(int index, uint32_t data); + uint32_t read16_from_64le(int index) const; void write16_to_64le(int index, uint32_t data); + uint32_t read16_from_64be(int index) const; void write16_to_64be(int index, uint32_t data); // internal read/write helpers for 4 byte entries - UINT32 read32_from_8le(int index) const; void write32_to_8le(int index, UINT32 data); - UINT32 read32_from_8be(int index) const; void write32_to_8be(int index, UINT32 data); - UINT32 read32_from_16le(int index) const; void write32_to_16le(int index, UINT32 data); - UINT32 read32_from_16be(int index) const; void write32_to_16be(int index, UINT32 data); - UINT32 read32_from_32(int index) const; void write32_to_32(int index, UINT32 data); - UINT32 read32_from_64le(int index) const; void write32_to_64le(int index, UINT32 data); - UINT32 read32_from_64be(int index) const; void write32_to_64be(int index, UINT32 data); + uint32_t read32_from_8le(int index) const; void write32_to_8le(int index, uint32_t data); + uint32_t read32_from_8be(int index) const; void write32_to_8be(int index, uint32_t data); + uint32_t read32_from_16le(int index) const; void write32_to_16le(int index, uint32_t data); + uint32_t read32_from_16be(int index) const; void write32_to_16be(int index, uint32_t data); + uint32_t read32_from_32(int index) const; void write32_to_32(int index, uint32_t data); + uint32_t read32_from_64le(int index) const; void write32_to_64le(int index, uint32_t data); + uint32_t read32_from_64be(int index) const; void write32_to_64be(int index, uint32_t data); // internal state void * m_base; - UINT32 m_bytes; + uint32_t m_bytes; int m_membits; endianness_t m_endianness; int m_bytes_per_entry; - UINT32 (memory_array::*m_read_entry)(int) const; - void (memory_array::*m_write_entry)(int, UINT32); + uint32_t (memory_array::*m_read_entry)(int) const; + void (memory_array::*m_write_entry)(int, uint32_t); }; diff --git a/src/emu/natkeyboard.h b/src/emu/natkeyboard.h index 00fc18daf09..4cbdd04eab5 100644 --- a/src/emu/natkeyboard.h +++ b/src/emu/natkeyboard.h @@ -77,8 +77,8 @@ private: // internal state running_machine & m_machine; // reference to our machine bool m_in_use; // is natural keyboard in use? - UINT32 m_bufbegin; // index of starting character - UINT32 m_bufend; // index of ending character + uint32_t m_bufbegin; // index of starting character + uint32_t m_bufend; // index of ending character std::vector m_buffer; // actual buffer bool m_status_keydown; // current keydown status bool m_last_cr; // was the last char a CR? diff --git a/src/emu/network.cpp b/src/emu/network.cpp index 5124a374748..dc3d57e9c46 100644 --- a/src/emu/network.cpp +++ b/src/emu/network.cpp @@ -84,7 +84,7 @@ void network_manager::config_save(config_type cfg_type, xml_data_node *parentnod xml_set_attribute_int(node, "interface", network.get_interface()); const char *mac = network.get_mac(); char mac_addr[6 * 3]; - sprintf(mac_addr, "%02x:%02x:%02x:%02x:%02x:%02x", (UINT8)mac[0], (UINT8)mac[1], (UINT8)mac[2], (UINT8)mac[3], (UINT8)mac[4], (UINT8)mac[5]); + sprintf(mac_addr, "%02x:%02x:%02x:%02x:%02x:%02x", (uint8_t)mac[0], (uint8_t)mac[1], (uint8_t)mac[2], (uint8_t)mac[3], (uint8_t)mac[4], (uint8_t)mac[5]); xml_set_attribute(node, "mac", mac_addr); } } diff --git a/src/emu/output.cpp b/src/emu/output.cpp index 5d737d1271f..af30ac9a0b6 100644 --- a/src/emu/output.cpp +++ b/src/emu/output.cpp @@ -50,7 +50,7 @@ output_manager::output_item* output_manager::find_item(const char *string) create_new_item - create a new item -------------------------------------------------*/ -output_manager::output_item *output_manager::create_new_item(const char *outname, INT32 value) +output_manager::output_item *output_manager::create_new_item(const char *outname, int32_t value) { output_item item; @@ -83,10 +83,10 @@ void output_manager::resume() output_set_value - set the value of an output -------------------------------------------------*/ -void output_manager::set_value(const char *outname, INT32 value) +void output_manager::set_value(const char *outname, int32_t value) { output_item *item = find_item(outname); - INT32 oldval; + int32_t oldval; /* if no item of that name, create a new one and send the item's state */ if (item == nullptr) @@ -150,7 +150,7 @@ void output_manager::set_indexed_value(const char *basename, int index, int valu output -------------------------------------------------*/ -INT32 output_manager::get_value(const char *outname) +int32_t output_manager::get_value(const char *outname) { output_item *item = find_item(outname); @@ -166,7 +166,7 @@ INT32 output_manager::get_value(const char *outname) indexed output -------------------------------------------------*/ -INT32 output_manager::get_indexed_value(const char *basename, int index) +int32_t output_manager::get_indexed_value(const char *basename, int index) { char buffer[100]; char *dest = buffer; @@ -229,7 +229,7 @@ void output_manager::notify_all(output_module *module) a given name -------------------------------------------------*/ -UINT32 output_manager::name_to_id(const char *outname) +uint32_t output_manager::name_to_id(const char *outname) { output_item *item = find_item(outname); @@ -245,7 +245,7 @@ UINT32 output_manager::name_to_id(const char *outname) to a given unique ID -------------------------------------------------*/ -const char *output_manager::id_to_name(UINT32 id) +const char *output_manager::id_to_name(uint32_t id) { for (auto &item : m_itemtable) if (item.second.id == id) diff --git a/src/emu/output.h b/src/emu/output.h index 69c5bc5b402..c2400639c43 100644 --- a/src/emu/output.h +++ b/src/emu/output.h @@ -22,7 +22,7 @@ ***************************************************************************/ class output_module; -typedef void (*output_notifier_func)(const char *outname, INT32 value, void *param); +typedef void (*output_notifier_func)(const char *outname, int32_t value, void *param); // ======================> output_manager @@ -44,9 +44,9 @@ class output_manager { public: std::string name; // string name of the item - UINT32 hash; // hash for this item name - UINT32 id; // unique ID for this item - INT32 value; // current value + uint32_t hash; // hash for this item name + uint32_t id; // unique ID for this item + int32_t value; // current value std::vector notifylist; // list of notifier callbacks }; @@ -58,16 +58,16 @@ public: running_machine &machine() const { return m_machine; } // set the value for a given output - void set_value(const char *outname, INT32 value); + void set_value(const char *outname, int32_t value); // set an indexed value for an output (concatenates basename + index) void set_indexed_value(const char *basename, int index, int value); // return the current value for a given output - INT32 get_value(const char *outname); + int32_t get_value(const char *outname); // return the current value for a given indexed output - INT32 get_indexed_value(const char *outname, int index); + int32_t get_indexed_value(const char *outname, int index); // set a notifier on a particular output, or globally if nullptr void set_notifier(const char *outname, output_notifier_func callback, void *param); @@ -76,31 +76,31 @@ public: void notify_all(output_module *module); // map a name to a unique ID - UINT32 name_to_id(const char *outname); + uint32_t name_to_id(const char *outname); // map a unique ID back to a name - const char *id_to_name(UINT32 id); + const char *id_to_name(uint32_t id); // helpers void set_led_value(int index, int value) { set_indexed_value("led", index, value ? 1 : 0); } void set_lamp_value(int index, int value) { set_indexed_value("lamp", index, value); } void set_digit_value(int index, int value) { set_indexed_value("digit", index, value); } - INT32 get_led_value(int index) { return get_indexed_value("led", index); } - INT32 get_lamp_value(int index) { return get_indexed_value("lamp", index); } - INT32 get_digit_value(int index) { return get_indexed_value("digit", index); } + int32_t get_led_value(int index) { return get_indexed_value("led", index); } + int32_t get_lamp_value(int index) { return get_indexed_value("lamp", index); } + int32_t get_digit_value(int index) { return get_indexed_value("digit", index); } void pause(); void resume(); private: output_item *find_item(const char *string); - output_item *create_new_item(const char *outname, INT32 value); + output_item *create_new_item(const char *outname, int32_t value); // internal state running_machine & m_machine; // reference to our machine std::unordered_map m_itemtable; std::vector m_global_notifylist; - UINT32 m_uniqueid; + uint32_t m_uniqueid; }; #endif // __OUTPUT_H__ diff --git a/src/emu/profiler.cpp b/src/emu/profiler.cpp index 57b775556b2..e9cb8f29fda 100644 --- a/src/emu/profiler.cpp +++ b/src/emu/profiler.cpp @@ -173,18 +173,18 @@ void real_profiler_state::update_text(running_machine &machine) }; // compute the total time for all bits, not including profiler or idle - UINT64 computed = 0; + uint64_t computed = 0; profile_type curtype; for (curtype = PROFILER_DEVICE_FIRST; curtype < PROFILER_PROFILER; ++curtype) computed += m_data[curtype]; // save that result in normalize, and continue adding the rest - UINT64 normalize = computed; + uint64_t normalize = computed; for ( ; curtype < PROFILER_TOTAL; ++curtype) computed += m_data[curtype]; // this becomes the total; if we end up with 0 for anything, we were just started, so return empty - UINT64 total = computed; + uint64_t total = computed; m_text.clear(); if (total == 0 || normalize == 0) { diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 0fbe12ba665..66fb5e0541e 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -434,7 +434,7 @@ void render_texture::hq_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const // get_scaled - get a scaled bitmap (if we can) //------------------------------------------------- -void render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist, UINT32 flags) +void render_texture::get_scaled(uint32_t dwidth, uint32_t dheight, render_texinfo &texinfo, render_primitive_list &primlist, uint32_t flags) { // source width/height come from the source bounds int swidth = m_sbounds.width(); @@ -636,7 +636,7 @@ void render_container::set_user_settings(const user_settings &settings) // add_line - add a line item to this container //------------------------------------------------- -void render_container::add_line(float x0, float y0, float x1, float y1, float width, rgb_t argb, UINT32 flags) +void render_container::add_line(float x0, float y0, float x1, float y1, float width, rgb_t argb, uint32_t flags) { item &newitem = add_generic(CONTAINER_ITEM_LINE, x0, y0, x1, y1, argb); newitem.m_width = width; @@ -648,7 +648,7 @@ void render_container::add_line(float x0, float y0, float x1, float y1, float wi // add_quad - add a quad item to this container //------------------------------------------------- -void render_container::add_quad(float x0, float y0, float x1, float y1, rgb_t argb, render_texture *texture, UINT32 flags) +void render_container::add_quad(float x0, float y0, float x1, float y1, rgb_t argb, render_texture *texture, uint32_t flags) { item &newitem = add_generic(CONTAINER_ITEM_QUAD, x0, y0, x1, y1, argb); newitem.m_texture = texture; @@ -660,7 +660,7 @@ void render_container::add_quad(float x0, float y0, float x1, float y1, rgb_t ar // add_char - add a char item to this container //------------------------------------------------- -void render_container::add_char(float x0, float y0, float height, float aspect, rgb_t argb, render_font &font, UINT16 ch) +void render_container::add_char(float x0, float y0, float height, float aspect, rgb_t argb, render_font &font, uint16_t ch) { // compute the bounds of the character cell and get the texture render_bounds bounds; @@ -682,7 +682,7 @@ void render_container::add_char(float x0, float y0, float height, float aspect, // an 8-bit value //------------------------------------------------- -UINT8 render_container::apply_brightness_contrast_gamma(UINT8 value) +uint8_t render_container::apply_brightness_contrast_gamma(uint8_t value) { return ::apply_brightness_contrast_gamma(value, m_user.m_brightness, m_user.m_contrast, m_user.m_gamma); } @@ -741,8 +741,8 @@ void render_container::overlay_scale(bitmap_argb32 &dest, bitmap_argb32 &source, // simply replicate the source bitmap over the target for (int y = 0; y < dest.height(); y++) { - UINT32 *src = &source.pix32(y % source.height()); - UINT32 *dst = &dest.pix32(y); + uint32_t *src = &source.pix32(y % source.height()); + uint32_t *dst = &dest.pix32(y); int sx = 0; // loop over columns @@ -761,7 +761,7 @@ void render_container::overlay_scale(bitmap_argb32 &dest, bitmap_argb32 &source, // container //------------------------------------------------- -render_container::item &render_container::add_generic(UINT8 type, float x0, float y0, float x1, float y1, rgb_t argb) +render_container::item &render_container::add_generic(uint8_t type, float x0, float y0, float x1, float y1, rgb_t argb) { item *newitem = m_item_allocator.alloc(); @@ -800,7 +800,7 @@ void render_container::recompute_lookups() // recompute the 256 entry lookup table for (int i = 0; i < 0x100; i++) { - UINT8 adjustedval = apply_brightness_contrast_gamma(i); + uint8_t adjustedval = apply_brightness_contrast_gamma(i); m_bcglookup256[i + 0x000] = adjustedval << 0; m_bcglookup256[i + 0x100] = adjustedval << 8; m_bcglookup256[i + 0x200] = adjustedval << 16; @@ -843,8 +843,8 @@ void render_container::update_palette() return; // get the dirty list - UINT32 mindirty, maxdirty; - const UINT32 *dirty = m_palclient->dirty_list(mindirty, maxdirty); + uint32_t mindirty, maxdirty; + const uint32_t *dirty = m_palclient->dirty_list(mindirty, maxdirty); // iterate over dirty items and update them if (dirty != nullptr) @@ -855,16 +855,16 @@ void render_container::update_palette() if (has_brightness_contrast_gamma_changes()) { // loop over chunks of 32 entries, since we can quickly examine 32 at a time - for (UINT32 entry32 = mindirty / 32; entry32 <= maxdirty / 32; entry32++) + for (uint32_t entry32 = mindirty / 32; entry32 <= maxdirty / 32; entry32++) { - UINT32 dirtybits = dirty[entry32]; + uint32_t dirtybits = dirty[entry32]; if (dirtybits != 0) // this chunk of 32 has dirty entries; fix them up - for (UINT32 entry = 0; entry < 32; entry++) + for (uint32_t entry = 0; entry < 32; entry++) if (dirtybits & (1 << entry)) { - UINT32 finalentry = entry32 * 32 + entry; + uint32_t finalentry = entry32 * 32 + entry; rgb_t newval = adjusted_palette[finalentry]; m_bcglookup[finalentry] = (newval & 0xff000000) | m_bcglookup256[0x200 + newval.r()] | @@ -905,7 +905,7 @@ render_container::user_settings::user_settings() // render_target - constructor //------------------------------------------------- -render_target::render_target(render_manager &manager, const internal_layout *layoutfile, UINT32 flags) +render_target::render_target(render_manager &manager, const internal_layout *layoutfile, uint32_t flags) : m_next(nullptr), m_manager(manager), m_curview(nullptr), @@ -1013,7 +1013,7 @@ int render_target::index() const // of a target //------------------------------------------------- -void render_target::set_bounds(INT32 width, INT32 height, float pixel_aspect) +void render_target::set_bounds(int32_t width, int32_t height, float pixel_aspect) { m_width = width; m_height = height; @@ -1156,7 +1156,7 @@ const render_screen_list &render_target::view_screens(int viewindex) // layout and proposed new parameters //------------------------------------------------- -void render_target::compute_visible_area(INT32 target_width, INT32 target_height, float target_pixel_aspect, int target_orientation, INT32 &visible_width, INT32 &visible_height) +void render_target::compute_visible_area(int32_t target_width, int32_t target_height, float target_pixel_aspect, int target_orientation, int32_t &visible_width, int32_t &visible_height) { switch (m_scale_mode) { @@ -1203,7 +1203,7 @@ void render_target::compute_visible_area(INT32 target_width, INT32 target_height default: { // get source size and aspect - INT32 src_width, src_height; + int32_t src_width, src_height; compute_minimum_size(src_width, src_height); float src_aspect = m_curview->effective_aspect(m_layerconfig); @@ -1261,7 +1261,7 @@ void render_target::compute_visible_area(INT32 target_width, INT32 target_height // source pixel for all included screens //------------------------------------------------- -void render_target::compute_minimum_size(INT32 &minwidth, INT32 &minheight) +void render_target::compute_minimum_size(int32_t &minwidth, int32_t &minheight) { float maxxscale = 1.0f, maxyscale = 1.0f; int screens_considered = 0; @@ -1346,7 +1346,7 @@ render_primitive_list &render_target::get_primitives() list.release_all(); // compute the visible width/height - INT32 viswidth, visheight; + int32_t viswidth, visheight; compute_visible_area(m_width, m_height, m_pixel_aspect, m_orientation, viswidth, visheight); // create a root transform for the target @@ -1467,7 +1467,7 @@ render_primitive_list &render_target::get_primitives() // specified container, if possible //------------------------------------------------- -bool render_target::map_point_container(INT32 target_x, INT32 target_y, render_container &container, float &container_x, float &container_y) +bool render_target::map_point_container(int32_t target_x, int32_t target_y, render_container &container, float &container_x, float &container_y) { ioport_port *input_port; ioport_value input_mask; @@ -1481,7 +1481,7 @@ bool render_target::map_point_container(INT32 target_x, INT32 target_y, render_c // container, if possible //------------------------------------------------- -bool render_target::map_point_input(INT32 target_x, INT32 target_y, ioport_port *&input_port, ioport_value &input_mask, float &input_x, float &input_y) +bool render_target::map_point_input(int32_t target_x, int32_t target_y, ioport_port *&input_port, ioport_value &input_mask, float &input_x, float &input_y) { return map_point_internal(target_x, target_y, nullptr, input_x, input_y, input_port, input_mask);; } @@ -1653,7 +1653,7 @@ void render_target::load_layout_files(const internal_layout *layoutfile, bool si bool render_target::load_layout_file(const char *dirname, const internal_layout *layout_data) { // +1 to ensure data is terminated for XML parser - auto tempout = make_unique_clear(layout_data->decompressed_size+1); + auto tempout = make_unique_clear(layout_data->decompressed_size+1); z_stream stream; int zerr; @@ -2008,7 +2008,7 @@ void render_target::add_container_primitives(render_primitive_list &list, const // add the overlay if it exists if (container.overlay() != nullptr && m_layerconfig.screen_overlay_enabled()) { - INT32 width, height; + int32_t width, height; // allocate a primitive render_primitive *prim = list.alloc(render_primitive::QUAD); @@ -2060,8 +2060,8 @@ void render_target::add_element_primitives(render_primitive_list &list, const ob prim->flags = PRIMFLAG_TEXORIENT(xform.orientation) | PRIMFLAG_BLENDMODE(blendmode) | PRIMFLAG_TEXFORMAT(texture->format()); // compute the bounds - INT32 width = render_round_nearest(xform.xscale); - INT32 height = render_round_nearest(xform.yscale); + int32_t width = render_round_nearest(xform.xscale); + int32_t height = render_round_nearest(xform.yscale); set_render_bounds_wh(&prim->bounds, render_round_nearest(xform.xoffs), render_round_nearest(xform.yoffs), (float) width, (float) height); prim->full_bounds = prim->bounds; if (xform.orientation & ORIENTATION_SWAP_XY) @@ -2096,10 +2096,10 @@ void render_target::add_element_primitives(render_primitive_list &list, const ob // mapping points //------------------------------------------------- -bool render_target::map_point_internal(INT32 target_x, INT32 target_y, render_container *container, float &mapped_x, float &mapped_y, ioport_port *&mapped_input_port, ioport_value &mapped_input_mask) +bool render_target::map_point_internal(int32_t target_x, int32_t target_y, render_container *container, float &mapped_x, float &mapped_y, ioport_port *&mapped_input_port, ioport_value &mapped_input_mask) { // compute the visible width/height - INT32 viswidth, visheight; + int32_t viswidth, visheight; compute_visible_area(m_width, m_height, m_pixel_aspect, m_orientation, viswidth, visheight); // create a root transform for the target @@ -2356,19 +2356,19 @@ void render_target::init_clear_extents() bool render_target::remove_clear_extent(const render_bounds &bounds) { - INT32 *max = &m_clear_extents[MAX_CLEAR_EXTENTS]; - INT32 *last = &m_clear_extents[m_clear_extent_count]; - INT32 *ext = &m_clear_extents[0]; - INT32 boundsx0 = ceil(bounds.x0); - INT32 boundsx1 = floor(bounds.x1); - INT32 boundsy0 = ceil(bounds.y0); - INT32 boundsy1 = floor(bounds.y1); - INT32 y0, y1 = 0; + int32_t *max = &m_clear_extents[MAX_CLEAR_EXTENTS]; + int32_t *last = &m_clear_extents[m_clear_extent_count]; + int32_t *ext = &m_clear_extents[0]; + int32_t boundsx0 = ceil(bounds.x0); + int32_t boundsx1 = floor(bounds.x1); + int32_t boundsy0 = ceil(bounds.y0); + int32_t boundsy1 = floor(bounds.y1); + int32_t y0, y1 = 0; // loop over Y extents while (ext < last) { - INT32 *linelast; + int32_t *linelast; // first entry of each line should always be negative assert(ext[0] < 0.0f); @@ -2378,8 +2378,8 @@ bool render_target::remove_clear_extent(const render_bounds &bounds) // do we intersect this extent? if (boundsy0 < y1 && boundsy1 > y0) { - INT32 *xext; - INT32 x0, x1 = 0; + int32_t *xext; + int32_t x0, x1 = 0; // split the top if (y0 < boundsy0) @@ -2491,16 +2491,16 @@ abort: void render_target::add_clear_extents(render_primitive_list &list) { simple_list clearlist; - INT32 *last = &m_clear_extents[m_clear_extent_count]; - INT32 *ext = &m_clear_extents[0]; - INT32 y0, y1 = 0; + int32_t *last = &m_clear_extents[m_clear_extent_count]; + int32_t *ext = &m_clear_extents[0]; + int32_t y0, y1 = 0; // loop over all extents while (ext < last) { - INT32 *linelast = &ext[ext[1] + 2]; - INT32 *xext = &ext[2]; - INT32 x0, x1 = 0; + int32_t *linelast = &ext[ext[1] + 2]; + int32_t *xext = &ext[2]; + int32_t x0, x1 = 0; // first entry should always be negative assert(ext[0] < 0); @@ -2681,7 +2681,7 @@ float render_manager::max_update_rate() const // target_alloc - allocate a new target //------------------------------------------------- -render_target *render_manager::target_alloc(const internal_layout *layoutfile, UINT32 flags) +render_target *render_manager::target_alloc(const internal_layout *layoutfile, uint32_t flags) { return &m_targetlist.append(*global_alloc(render_target(*this, layoutfile, flags))); } diff --git a/src/emu/render.h b/src/emu/render.h index a3ce229e67f..5ad24046c41 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -77,9 +77,9 @@ enum // render creation flags -const UINT8 RENDER_CREATE_NO_ART = 0x01; // ignore any views that have art in them -const UINT8 RENDER_CREATE_SINGLE_FILE = 0x02; // only load views from the file specified -const UINT8 RENDER_CREATE_HIDDEN = 0x04; // don't make this target visible +const uint8_t RENDER_CREATE_NO_ART = 0x01; // ignore any views that have art in them +const uint8_t RENDER_CREATE_SINGLE_FILE = 0x02; // only load views from the file specified +const uint8_t RENDER_CREATE_HIDDEN = 0x04; // don't make this target visible // render scaling modes enum @@ -93,38 +93,38 @@ enum // flags for primitives const int PRIMFLAG_TEXORIENT_SHIFT = 0; -const UINT32 PRIMFLAG_TEXORIENT_MASK = 15 << PRIMFLAG_TEXORIENT_SHIFT; +const uint32_t PRIMFLAG_TEXORIENT_MASK = 15 << PRIMFLAG_TEXORIENT_SHIFT; const int PRIMFLAG_TEXFORMAT_SHIFT = 4; -const UINT32 PRIMFLAG_TEXFORMAT_MASK = 15 << PRIMFLAG_TEXFORMAT_SHIFT; +const uint32_t PRIMFLAG_TEXFORMAT_MASK = 15 << PRIMFLAG_TEXFORMAT_SHIFT; const int PRIMFLAG_BLENDMODE_SHIFT = 8; -const UINT32 PRIMFLAG_BLENDMODE_MASK = 15 << PRIMFLAG_BLENDMODE_SHIFT; +const uint32_t PRIMFLAG_BLENDMODE_MASK = 15 << PRIMFLAG_BLENDMODE_SHIFT; const int PRIMFLAG_ANTIALIAS_SHIFT = 12; -const UINT32 PRIMFLAG_ANTIALIAS_MASK = 1 << PRIMFLAG_ANTIALIAS_SHIFT; +const uint32_t PRIMFLAG_ANTIALIAS_MASK = 1 << PRIMFLAG_ANTIALIAS_SHIFT; const int PRIMFLAG_SCREENTEX_SHIFT = 13; -const UINT32 PRIMFLAG_SCREENTEX_MASK = 1 << PRIMFLAG_SCREENTEX_SHIFT; +const uint32_t PRIMFLAG_SCREENTEX_MASK = 1 << PRIMFLAG_SCREENTEX_SHIFT; const int PRIMFLAG_TEXWRAP_SHIFT = 14; -const UINT32 PRIMFLAG_TEXWRAP_MASK = 1 << PRIMFLAG_TEXWRAP_SHIFT; +const uint32_t PRIMFLAG_TEXWRAP_MASK = 1 << PRIMFLAG_TEXWRAP_SHIFT; const int PRIMFLAG_TEXSHADE_SHIFT = 15; -const UINT32 PRIMFLAG_TEXSHADE_MASK = 3 << PRIMFLAG_TEXSHADE_SHIFT; +const uint32_t PRIMFLAG_TEXSHADE_MASK = 3 << PRIMFLAG_TEXSHADE_SHIFT; const int PRIMFLAG_VECTOR_SHIFT = 17; -const UINT32 PRIMFLAG_VECTOR_MASK = 1 << PRIMFLAG_VECTOR_SHIFT; +const uint32_t PRIMFLAG_VECTOR_MASK = 1 << PRIMFLAG_VECTOR_SHIFT; const int PRIMFLAG_VECTORBUF_SHIFT = 18; -const UINT32 PRIMFLAG_VECTORBUF_MASK = 1 << PRIMFLAG_VECTORBUF_SHIFT; +const uint32_t PRIMFLAG_VECTORBUF_MASK = 1 << PRIMFLAG_VECTORBUF_SHIFT; const int PRIMFLAG_TYPE_SHIFT = 19; -const UINT32 PRIMFLAG_TYPE_MASK = 3 << PRIMFLAG_TYPE_SHIFT; -const UINT32 PRIMFLAG_TYPE_LINE = 0 << PRIMFLAG_TYPE_SHIFT; -const UINT32 PRIMFLAG_TYPE_QUAD = 1 << PRIMFLAG_TYPE_SHIFT; +const uint32_t PRIMFLAG_TYPE_MASK = 3 << PRIMFLAG_TYPE_SHIFT; +const uint32_t PRIMFLAG_TYPE_LINE = 0 << PRIMFLAG_TYPE_SHIFT; +const uint32_t PRIMFLAG_TYPE_QUAD = 1 << PRIMFLAG_TYPE_SHIFT; const int PRIMFLAG_PACKABLE_SHIFT = 21; -const UINT32 PRIMFLAG_PACKABLE = 1 << PRIMFLAG_PACKABLE_SHIFT; +const uint32_t PRIMFLAG_PACKABLE = 1 << PRIMFLAG_PACKABLE_SHIFT; //************************************************************************** // MACROS @@ -222,11 +222,11 @@ struct render_quad_texuv struct render_texinfo { void * base; // base of the data - UINT32 rowpixels; // pixels per row - UINT32 width; // width of the image - UINT32 height; // height of the image - UINT32 seqid; // sequence ID - UINT64 osddata; // aux data to pass to osd + uint32_t rowpixels; // pixels per row + uint32_t width; // width of the image + uint32_t height; // height of the image + uint32_t seqid; // sequence ID + uint64_t osddata; // aux data to pass to osd const rgb_t * palette; // palette for PALETTE16 textures, bcg lookup table for RGB32/YUY16 }; @@ -281,14 +281,14 @@ private: // render_layer_config - describes the state of layers class render_layer_config { - static const UINT8 ENABLE_BACKDROP = 0x01; // enable backdrop layers - static const UINT8 ENABLE_OVERLAY = 0x02; // enable overlay layers - static const UINT8 ENABLE_BEZEL = 0x04; // enable bezel layers - static const UINT8 ENABLE_CPANEL = 0x08; // enable cpanel layers - static const UINT8 ENABLE_MARQUEE = 0x10; // enable marquee layers - static const UINT8 ZOOM_TO_SCREEN = 0x20; // zoom to screen area by default - static const UINT8 ENABLE_SCREEN_OVERLAY = 0x40; // enable screen overlays - static const UINT8 DEFAULT = ENABLE_BACKDROP | ENABLE_OVERLAY | ENABLE_BEZEL | ENABLE_CPANEL | ENABLE_MARQUEE | ENABLE_SCREEN_OVERLAY; + static const uint8_t ENABLE_BACKDROP = 0x01; // enable backdrop layers + static const uint8_t ENABLE_OVERLAY = 0x02; // enable overlay layers + static const uint8_t ENABLE_BEZEL = 0x04; // enable bezel layers + static const uint8_t ENABLE_CPANEL = 0x08; // enable cpanel layers + static const uint8_t ENABLE_MARQUEE = 0x10; // enable marquee layers + static const uint8_t ZOOM_TO_SCREEN = 0x20; // zoom to screen area by default + static const uint8_t ENABLE_SCREEN_OVERLAY = 0x40; // enable screen overlays + static const uint8_t DEFAULT = ENABLE_BACKDROP | ENABLE_OVERLAY | ENABLE_BEZEL | ENABLE_CPANEL | ENABLE_MARQUEE | ENABLE_SCREEN_OVERLAY; public: render_layer_config() @@ -314,7 +314,7 @@ public: render_layer_config &set_zoom_to_screen(bool zoom) { if (zoom) m_state |= ZOOM_TO_SCREEN; else m_state &= ~ZOOM_TO_SCREEN; return *this; } private: - UINT8 m_state; + uint8_t m_state; }; @@ -344,7 +344,7 @@ public: // getters render_primitive *next() const { return m_next; } - bool packable(const INT32 pack_size) const { return (flags & PRIMFLAG_PACKABLE) && texture.base != nullptr && texture.width <= pack_size && texture.height <= pack_size; } + bool packable(const int32_t pack_size) const { return (flags & PRIMFLAG_PACKABLE) && texture.base != nullptr && texture.width <= pack_size && texture.height <= pack_size; } float get_quad_width() const { return fabsf(bounds.x1 - bounds.x0); } float get_quad_height() const { return fabsf(bounds.y1 - bounds.y0); } float get_full_quad_width() const { return fabsf(full_bounds.x1 - full_bounds.x0); } @@ -358,7 +358,7 @@ public: render_bounds bounds; // bounds or positions render_bounds full_bounds; // bounds or positions (unclipped) render_color color; // RGBA values - UINT32 flags; // flags + uint32_t flags; // flags float width; // width (for line primitives) render_texinfo texture; // texture info (for quad primitives) render_quad_texuv texcoords; // texture coordinates (for quad primitives) @@ -455,14 +455,14 @@ public: void set_bitmap(bitmap_t &bitmap, const rectangle &sbounds, texture_format format); // set any necessary aux data - void set_osd_data(UINT64 data) { m_osddata = data; } + void set_osd_data(uint64_t data) { m_osddata = data; } // generic high-quality bitmap scaler static void hq_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param); private: // internal helpers - void get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist, UINT32 flags = 0); + void get_scaled(uint32_t dwidth, uint32_t dheight, render_texinfo &texinfo, render_primitive_list &primlist, uint32_t flags = 0); const rgb_t *get_adjusted_palette(render_container &container); static const int MAX_TEXTURE_SCALES = 16; @@ -471,7 +471,7 @@ private: struct scaled_texture { bitmap_argb32 * bitmap; // final bitmap - UINT32 seqid; // sequence number + uint32_t seqid; // sequence number }; // internal state @@ -480,12 +480,12 @@ private: bitmap_t * m_bitmap; // pointer to the original bitmap rectangle m_sbounds; // source bounds within the bitmap texture_format m_format; // format of the texture data - UINT64 m_osddata; // aux data to pass to osd + uint64_t m_osddata; // aux data to pass to osd // scaling state (ARGB32 only) texture_scaler_func m_scaler; // scaling callback void * m_param; // scaling callback parameter - UINT32 m_curseq; // current sequence number + uint32_t m_curseq; // current sequence number scaled_texture m_scaled[MAX_TEXTURE_SCALES];// array of scaled variants of this texture }; @@ -543,15 +543,15 @@ public: void empty() { m_item_allocator.reclaim_all(m_itemlist); } // add items to the list - void add_line(float x0, float y0, float x1, float y1, float width, rgb_t argb, UINT32 flags); - void add_quad(float x0, float y0, float x1, float y1, rgb_t argb, render_texture *texture, UINT32 flags); - void add_char(float x0, float y0, float height, float aspect, rgb_t argb, render_font &font, UINT16 ch); - void add_point(float x0, float y0, float diameter, rgb_t argb, UINT32 flags) { add_line(x0, y0, x0, y0, diameter, argb, flags); } - void add_rect(float x0, float y0, float x1, float y1, rgb_t argb, UINT32 flags) { add_quad(x0, y0, x1, y1, argb, nullptr, flags); } + void add_line(float x0, float y0, float x1, float y1, float width, rgb_t argb, uint32_t flags); + void add_quad(float x0, float y0, float x1, float y1, rgb_t argb, render_texture *texture, uint32_t flags); + void add_char(float x0, float y0, float height, float aspect, rgb_t argb, render_font &font, uint16_t ch); + void add_point(float x0, float y0, float diameter, rgb_t argb, uint32_t flags) { add_line(x0, y0, x0, y0, diameter, argb, flags); } + void add_rect(float x0, float y0, float x1, float y1, rgb_t argb, uint32_t flags) { add_quad(x0, y0, x1, y1, argb, nullptr, flags); } // brightness/contrast/gamma helpers bool has_brightness_contrast_gamma_changes() const { return (m_user.m_brightness != 1.0f || m_user.m_contrast != 1.0f || m_user.m_gamma != 1.0f); } - UINT8 apply_brightness_contrast_gamma(UINT8 value); + uint8_t apply_brightness_contrast_gamma(uint8_t value); float apply_brightness_contrast_gamma_fp(float value); const rgb_t *bcg_lookup_table(int texformat, palette_t *palette = nullptr); @@ -567,22 +567,22 @@ private: // getters item *next() const { return m_next; } - UINT8 type() const { return m_type; } + uint8_t type() const { return m_type; } const render_bounds &bounds() const { return m_bounds; } const render_color &color() const { return m_color; } - UINT32 flags() const { return m_flags; } - UINT32 internal() const { return m_internal; } + uint32_t flags() const { return m_flags; } + uint32_t internal() const { return m_internal; } float width() const { return m_width; } render_texture *texture() const { return m_texture; } private: // internal state item * m_next; // pointer to the next element in the list - UINT8 m_type; // type of element + uint8_t m_type; // type of element render_bounds m_bounds; // bounds of the element render_color m_color; // RGBA factors - UINT32 m_flags; // option flags - UINT32 m_internal; // internal flags + uint32_t m_flags; // option flags + uint32_t m_internal; // internal flags float m_width; // width of the line (lines only) render_texture * m_texture; // pointer to the source texture (quads only) }; @@ -592,7 +592,7 @@ private: // internal helpers const simple_list &items() const { return m_itemlist; } - item &add_generic(UINT8 type, float x0, float y0, float x1, float y1, rgb_t argb); + item &add_generic(uint8_t type, float x0, float y0, float x1, float y1, rgb_t argb); void recompute_lookups(); void update_palette(); @@ -1083,15 +1083,15 @@ class render_target friend class render_manager; // construction/destruction - render_target(render_manager &manager, const internal_layout *layoutfile = nullptr, UINT32 flags = 0); + render_target(render_manager &manager, const internal_layout *layoutfile = nullptr, uint32_t flags = 0); ~render_target(); public: // getters render_target *next() const { return m_next; } render_manager &manager() const { return m_manager; } - UINT32 width() const { return m_width; } - UINT32 height() const { return m_height; } + uint32_t width() const { return m_width; } + uint32_t height() const { return m_height; } float pixel_aspect() const { return m_pixel_aspect; } int scale_mode() const { return m_scale_mode; } float max_update_rate() const { return m_max_refresh; } @@ -1104,7 +1104,7 @@ public: int index() const; // setters - void set_bounds(INT32 width, INT32 height, float pixel_aspect = 0); + void set_bounds(int32_t width, int32_t height, float pixel_aspect = 0); void set_max_update_rate(float updates_per_second) { m_max_refresh = updates_per_second; } void set_orientation(int orientation) { m_orientation = orientation; } void set_view(int viewindex); @@ -1139,15 +1139,15 @@ public: const render_screen_list &view_screens(int viewindex); // bounds computations - void compute_visible_area(INT32 target_width, INT32 target_height, float target_pixel_aspect, int target_orientation, INT32 &visible_width, INT32 &visible_height); - void compute_minimum_size(INT32 &minwidth, INT32 &minheight); + void compute_visible_area(int32_t target_width, int32_t target_height, float target_pixel_aspect, int target_orientation, int32_t &visible_width, int32_t &visible_height); + void compute_minimum_size(int32_t &minwidth, int32_t &minheight); // get a primitive list render_primitive_list &get_primitives(); // hit testing - bool map_point_container(INT32 target_x, INT32 target_y, render_container &container, float &container_x, float &container_y); - bool map_point_input(INT32 target_x, INT32 target_y, ioport_port *&input_port, ioport_value &input_mask, float &input_x, float &input_y); + bool map_point_container(int32_t target_x, int32_t target_y, render_container &container, float &container_x, float &container_y); + bool map_point_input(int32_t target_x, int32_t target_y, ioport_port *&input_port, ioport_value &input_mask, float &input_x, float &input_y); // reference tracking void invalidate_all(void *refptr); @@ -1168,7 +1168,7 @@ private: bool load_layout_file(const char *dirname, const internal_layout *layout_data); void add_container_primitives(render_primitive_list &list, const object_transform &root_xform, const object_transform &xform, render_container &container, int blendmode); void add_element_primitives(render_primitive_list &list, const object_transform &xform, layout_element &element, int state, int blendmode); - bool map_point_internal(INT32 target_x, INT32 target_y, render_container *container, float &mapped_x, float &mapped_y, ioport_port *&mapped_input_port, ioport_value &mapped_input_mask); + bool map_point_internal(int32_t target_x, int32_t target_y, render_container *container, float &mapped_x, float &mapped_y, ioport_port *&mapped_input_port, ioport_value &mapped_input_mask); // config callbacks void config_load(xml_data_node &targetnode); @@ -1193,11 +1193,11 @@ private: render_manager & m_manager; // reference to our owning manager layout_view * m_curview; // current view simple_list m_filelist; // list of layout files - UINT32 m_flags; // creation flags + uint32_t m_flags; // creation flags render_primitive_list m_primlist[NUM_PRIMLISTS]; // list of primitives int m_listindex; // index of next primlist to use - INT32 m_width; // width in pixels - INT32 m_height; // height in pixels + int32_t m_width; // width in pixels + int32_t m_height; // height in pixels render_bounds m_bounds; // bounds of the target bool m_keepaspect; // constrain aspect ratio bool m_int_overscan; // allow overscan on integer scaled targets @@ -1214,8 +1214,8 @@ private: int m_maxtexwidth; // maximum width of a texture int m_maxtexheight; // maximum height of a texture simple_list m_debug_containers; // list of debug containers - INT32 m_clear_extent_count; // number of clear extents - INT32 m_clear_extents[MAX_CLEAR_EXTENTS]; // array of clear extents + int32_t m_clear_extent_count; // number of clear extents + int32_t m_clear_extents[MAX_CLEAR_EXTENTS]; // array of clear extents bool m_transform_container; // determines whether the screen container is transformed by the core renderer, // otherwise the respective render API will handle the transformation (scale, offset) @@ -1243,7 +1243,7 @@ public: float max_update_rate() const; // targets - render_target *target_alloc(const internal_layout *layoutfile = nullptr, UINT32 flags = 0); + render_target *target_alloc(const internal_layout *layoutfile = nullptr, uint32_t flags = 0); void target_free(render_target *target); const simple_list &targets() const { return m_targetlist; } render_target *first_target() const { return m_targetlist.first(); } @@ -1288,7 +1288,7 @@ private: render_target * m_ui_target; // current UI target // texture lists - UINT32 m_live_textures; // number of live textures + uint32_t m_live_textures; // number of live textures fixed_allocator m_texture_allocator;// texture allocator // containers for the UI and for screens diff --git a/src/emu/rendersw.hxx b/src/emu/rendersw.hxx index bcd827aa446..911ac67a6f6 100644 --- a/src/emu/rendersw.hxx +++ b/src/emu/rendersw.hxx @@ -22,10 +22,10 @@ private: // internal structs struct quad_setup_data { - INT32 dudx, dvdx, dudy, dvdy; - INT32 startu, startv; - INT32 startx, starty; - INT32 endx, endy; + int32_t dudx, dvdx, dudy, dvdy; + int32_t startu, startv; + int32_t startx, starty; + int32_t endx, endy; }; // internal helpers @@ -35,21 +35,21 @@ private: static inline float round_nearest(float f) { return floor(f + 0.5f); } // destination pixels are written based on the values of the template parameters - static inline _PixelType dest_assemble_rgb(UINT32 r, UINT32 g, UINT32 b) { return (r << _DstShiftR) | (g << _DstShiftG) | (b << _DstShiftB); } - static inline _PixelType dest_rgb_to_pixel(UINT32 r, UINT32 g, UINT32 b) { return dest_assemble_rgb(r >> _SrcShiftR, g >> _SrcShiftG, b >> _SrcShiftB); } + static inline _PixelType dest_assemble_rgb(uint32_t r, uint32_t g, uint32_t b) { return (r << _DstShiftR) | (g << _DstShiftG) | (b << _DstShiftB); } + static inline _PixelType dest_rgb_to_pixel(uint32_t r, uint32_t g, uint32_t b) { return dest_assemble_rgb(r >> _SrcShiftR, g >> _SrcShiftG, b >> _SrcShiftB); } // source 32-bit pixels are in MAME standardized format - static inline UINT32 source32_r(UINT32 pixel) { return (pixel >> (16 + _SrcShiftR)) & (0xff >> _SrcShiftR); } - static inline UINT32 source32_g(UINT32 pixel) { return (pixel >> ( 8 + _SrcShiftG)) & (0xff >> _SrcShiftG); } - static inline UINT32 source32_b(UINT32 pixel) { return (pixel >> ( 0 + _SrcShiftB)) & (0xff >> _SrcShiftB); } + static inline uint32_t source32_r(uint32_t pixel) { return (pixel >> (16 + _SrcShiftR)) & (0xff >> _SrcShiftR); } + static inline uint32_t source32_g(uint32_t pixel) { return (pixel >> ( 8 + _SrcShiftG)) & (0xff >> _SrcShiftG); } + static inline uint32_t source32_b(uint32_t pixel) { return (pixel >> ( 0 + _SrcShiftB)) & (0xff >> _SrcShiftB); } // destination pixel masks are based on the template parameters as well - static inline UINT32 dest_r(_PixelType pixel) { return (pixel >> _DstShiftR) & (0xff >> _SrcShiftR); } - static inline UINT32 dest_g(_PixelType pixel) { return (pixel >> _DstShiftG) & (0xff >> _SrcShiftG); } - static inline UINT32 dest_b(_PixelType pixel) { return (pixel >> _DstShiftB) & (0xff >> _SrcShiftB); } + static inline uint32_t dest_r(_PixelType pixel) { return (pixel >> _DstShiftR) & (0xff >> _SrcShiftR); } + static inline uint32_t dest_g(_PixelType pixel) { return (pixel >> _DstShiftG) & (0xff >> _SrcShiftG); } + static inline uint32_t dest_b(_PixelType pixel) { return (pixel >> _DstShiftB) & (0xff >> _SrcShiftB); } // generic conversion with special optimization for destinations in the standard format - static inline _PixelType source32_to_dest(UINT32 pixel) + static inline _PixelType source32_to_dest(uint32_t pixel) { if (_SrcShiftR == 0 && _SrcShiftG == 0 && _SrcShiftB == 0 && _DstShiftR == 16 && _DstShiftG == 8 && _DstShiftB == 0) return pixel; @@ -67,12 +67,12 @@ private: // The document also contains the constants below as floats. //------------------------------------------------- - static inline UINT32 clamp16_shift8(UINT32 x) + static inline uint32_t clamp16_shift8(uint32_t x) { - return ((INT32(x) < 0) ? 0 : (x > 65535 ? 255: x >> 8)); + return ((int32_t(x) < 0) ? 0 : (x > 65535 ? 255: x >> 8)); } - static inline UINT32 ycc_to_rgb(UINT32 ycc) + static inline uint32_t ycc_to_rgb(uint32_t ycc) { // original equations: // @@ -109,14 +109,14 @@ private: // B = clip(( common + 516 * Cb - 13696) >> 8) // - UINT8 y = ycc; - UINT8 cb = ycc >> 8; - UINT8 cr = ycc >> 16; + uint8_t y = ycc; + uint8_t cb = ycc >> 8; + uint8_t cr = ycc >> 16; - UINT32 common = 298 * y - 56992; - UINT32 r = (common + 409 * cr); - UINT32 g = (common - 100 * cb - 208 * cr + 91776); - UINT32 b = (common + 516 * cb - 13696); + uint32_t common = 298 * y - 56992; + uint32_t r = (common + 409 * cr); + uint32_t g = (common - 100 * cb - 208 * cr + 91776); + uint32_t b = (common + 516 * cb - 13696); // Now clamp and shift back return rgb_t(clamp16_shift8(r), clamp16_shift8(g), clamp16_shift8(b)); @@ -128,32 +128,32 @@ private: // palettized 16bpp source //------------------------------------------------- - static inline UINT32 get_texel_palette16(const render_texinfo &texture, INT32 curu, INT32 curv) + static inline uint32_t get_texel_palette16(const render_texinfo &texture, int32_t curu, int32_t curv) { const rgb_t *palbase = texture.palette; if (_BilinearFilter) { - INT32 u0 = curu >> 16; - INT32 u1 = 1; + int32_t u0 = curu >> 16; + int32_t u1 = 1; if (u0 < 0) u0 = u1 = 0; else if (u0 + 1 >= texture.width) u0 = texture.width - 1, u1 = 0; - INT32 v0 = curv >> 16; - INT32 v1 = texture.rowpixels; + int32_t v0 = curv >> 16; + int32_t v1 = texture.rowpixels; if (v0 < 0) v0 = v1 = 0; else if (v0 + 1 >= texture.height) v0 = texture.height - 1, v1 = 0; - const UINT16 *texbase = reinterpret_cast(texture.base); + const uint16_t *texbase = reinterpret_cast(texture.base); texbase += v0 * texture.rowpixels + u0; - UINT32 pix00 = palbase[texbase[0]]; - UINT32 pix01 = palbase[texbase[u1]]; - UINT32 pix10 = palbase[texbase[v1]]; - UINT32 pix11 = palbase[texbase[u1 + v1]]; + uint32_t pix00 = palbase[texbase[0]]; + uint32_t pix01 = palbase[texbase[u1]]; + uint32_t pix10 = palbase[texbase[v1]]; + uint32_t pix11 = palbase[texbase[u1 + v1]]; return rgbaint_t::bilinear_filter(pix00, pix01, pix10, pix11, curu >> 8, curv >> 8); } else { - const UINT16 *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16); + const uint16_t *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16); return palbase[texbase[0]]; } } @@ -164,28 +164,28 @@ private: // palettized 16bpp source with alpha //------------------------------------------------- - static inline UINT32 get_texel_palette16a(const render_texinfo &texture, INT32 curu, INT32 curv) + static inline uint32_t get_texel_palette16a(const render_texinfo &texture, int32_t curu, int32_t curv) { const rgb_t *palbase = texture.palette; if (_BilinearFilter) { - INT32 u0 = curu >> 16; - INT32 u1 = 1; + int32_t u0 = curu >> 16; + int32_t u1 = 1; if (u0 < 0) u0 = u1 = 0; else if (u0 + 1 >= texture.width) u0 = texture.width - 1, u1 = 0; - INT32 v0 = curv >> 16; - INT32 v1 = texture.rowpixels; + int32_t v0 = curv >> 16; + int32_t v1 = texture.rowpixels; if (v0 < 0) v0 = v1 = 0; else if (v0 + 1 >= texture.height) v0 = texture.height - 1, v1 = 0; - const UINT16 *texbase = reinterpret_cast(texture.base); + const uint16_t *texbase = reinterpret_cast(texture.base); texbase += v0 * texture.rowpixels + u0; return rgbaint_t::bilinear_filter(palbase[texbase[0]], palbase[texbase[u1]], palbase[texbase[v1]], palbase[texbase[u1 + v1]], curu >> 8, curv >> 8); } else { - const UINT16 *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16); + const uint16_t *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16); return palbase[texbase[0]]; } } @@ -196,26 +196,26 @@ private: // YCbCr source (pixel is returned as Cr-Cb-Y) //------------------------------------------------- - static inline UINT32 get_texel_yuy16(const render_texinfo &texture, INT32 curu, INT32 curv) + static inline uint32_t get_texel_yuy16(const render_texinfo &texture, int32_t curu, int32_t curv) { if (_BilinearFilter) { - INT32 u0 = curu >> 16; - INT32 u1 = 1; + int32_t u0 = curu >> 16; + int32_t u1 = 1; if (u0 < 0) u0 = u1 = 0; else if (u0 + 1 >= texture.width) u0 = texture.width - 1, u1 = 0; - INT32 v0 = curv >> 16; - INT32 v1 = texture.rowpixels; + int32_t v0 = curv >> 16; + int32_t v1 = texture.rowpixels; if (v0 < 0) v0 = v1 = 0; else if (v0 + 1 >= texture.height) v0 = texture.height - 1, v1 = 0; - const UINT16 *texbase = reinterpret_cast(texture.base); + const uint16_t *texbase = reinterpret_cast(texture.base); texbase += v0 * texture.rowpixels + (u0 & ~1); - UINT32 pix00, pix01, pix10, pix11; + uint32_t pix00, pix01, pix10, pix11; if ((curu & 0x10000) == 0) { - UINT32 cbcr = ((texbase[0] & 0xff) << 8) | ((texbase[1] & 0xff) << 16); + uint32_t cbcr = ((texbase[0] & 0xff) << 8) | ((texbase[1] & 0xff) << 16); pix00 = (texbase[0] >> 8) | cbcr; pix01 = (texbase[u1] >> 8) | cbcr; cbcr = ((texbase[v1 + 0] & 0xff) << 8) | ((texbase[v1 + 1] & 0xff) << 16); @@ -224,7 +224,7 @@ private: } else { - UINT32 cbcr = ((texbase[0] & 0xff) << 8) | ((texbase[1] & 0xff) << 16); + uint32_t cbcr = ((texbase[0] & 0xff) << 8) | ((texbase[1] & 0xff) << 16); pix00 = (texbase[1] >> 8) | cbcr; if (u1 != 0) { @@ -247,7 +247,7 @@ private: } else { - const UINT16 *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 17) * 2; + const uint16_t *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 17) * 2; return (texbase[(curu >> 16) & 1] >> 8) | ((texbase[0] & 0xff) << 8) | ((texbase[1] & 0xff) << 16); } } @@ -258,27 +258,27 @@ private: // RGB source //------------------------------------------------- - static inline UINT32 get_texel_rgb32(const render_texinfo &texture, INT32 curu, INT32 curv) + static inline uint32_t get_texel_rgb32(const render_texinfo &texture, int32_t curu, int32_t curv) { if (_BilinearFilter) { - INT32 u0 = curu >> 16; - INT32 u1 = 1; + int32_t u0 = curu >> 16; + int32_t u1 = 1; if (u0 < 0) u0 = u1 = 0; else if (u0 + 1 >= texture.width) u0 = texture.width - 1, u1 = 0; - INT32 v0 = curv >> 16; - INT32 v1 = texture.rowpixels; + int32_t v0 = curv >> 16; + int32_t v1 = texture.rowpixels; if (v0 < 0) v0 = v1 = 0; else if (v0 + 1 >= texture.height) v0 = texture.height - 1, v1 = 0; - const UINT32 *texbase = reinterpret_cast(texture.base); + const uint32_t *texbase = reinterpret_cast(texture.base); texbase += v0 * texture.rowpixels + u0; return rgbaint_t::bilinear_filter(texbase[0], texbase[u1], texbase[v1], texbase[u1 + v1], curu >> 8, curv >> 8); } else { - const UINT32 *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16); + const uint32_t *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16); return texbase[0]; } } @@ -289,27 +289,27 @@ private: // ARGB source //------------------------------------------------- - static inline UINT32 get_texel_argb32(const render_texinfo &texture, INT32 curu, INT32 curv) + static inline uint32_t get_texel_argb32(const render_texinfo &texture, int32_t curu, int32_t curv) { if (_BilinearFilter) { - INT32 u0 = curu >> 16; - INT32 u1 = 1; + int32_t u0 = curu >> 16; + int32_t u1 = 1; if (u0 < 0) u0 = u1 = 0; else if (u0 + 1 >= texture.width) u0 = texture.width - 1, u1 = 0; - INT32 v0 = curv >> 16; - INT32 v1 = texture.rowpixels; + int32_t v0 = curv >> 16; + int32_t v1 = texture.rowpixels; if (v0 < 0) v0 = v1 = 0; else if (v0 + 1 >= texture.height) v0 = texture.height - 1, v1 = 0; - const UINT32 *texbase = reinterpret_cast(texture.base); + const uint32_t *texbase = reinterpret_cast(texture.base); texbase += v0 * texture.rowpixels + u0; return rgbaint_t::bilinear_filter(texbase[0], texbase[u1], texbase[v1], texbase[u1 + v1], curu >> 8, curv >> 8); } else { - const UINT32 *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16); + const uint32_t *texbase = reinterpret_cast(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16); return texbase[0]; } } @@ -319,13 +319,13 @@ private: // draw_aa_pixel - draw an antialiased pixel //------------------------------------------------- - static inline void draw_aa_pixel(_PixelType *dstdata, UINT32 pitch, int x, int y, UINT32 col) + static inline void draw_aa_pixel(_PixelType *dstdata, uint32_t pitch, int x, int y, uint32_t col) { _PixelType *dest = dstdata + y * pitch + x; - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 dr = source32_r(col) + dest_r(dpix); - UINT32 dg = source32_g(col) + dest_g(dpix); - UINT32 db = source32_b(col) + dest_b(dpix); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t dr = source32_r(col) + dest_r(dpix); + uint32_t dg = source32_g(col) + dest_g(dpix); + uint32_t db = source32_b(col) + dest_b(dpix); dr = (dr | -(dr >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); dg = (dg | -(dg >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); db = (db | -(db >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -337,10 +337,10 @@ private: // draw_line - draw a line or point //------------------------------------------------- - static void draw_line(const render_primitive &prim, _PixelType *dstdata, INT32 width, INT32 height, UINT32 pitch) + static void draw_line(const render_primitive &prim, _PixelType *dstdata, int32_t width, int32_t height, uint32_t pitch) { // internal tables - static UINT32 s_cosine_table[2049]; + static uint32_t s_cosine_table[2049]; // compute the start/end coordinates int x1 = int(prim.bounds.x0 * 65536.0f); @@ -349,7 +349,7 @@ private: int y2 = int(prim.bounds.y1 * 65536.0f); // handle color and intensity - UINT32 col = rgb_t(int(255.0f * prim.color.r * prim.color.a), int(255.0f * prim.color.g * prim.color.a), int(255.0f * prim.color.b * prim.color.a)); + uint32_t col = rgb_t(int(255.0f * prim.color.r * prim.color.a), int(255.0f * prim.color.g * prim.color.a), int(255.0f * prim.color.b * prim.color.a)); if (PRIMFLAG_GET_ANTIALIAS(prim.flags)) { @@ -386,7 +386,7 @@ private: draw_aa_pixel(dstdata, pitch, x1, dy, apply_intensity(0xff & (~y1 >> 8), col)); dy++; dx -= 0x10000 - (0xffff & y1); // take off amount plotted - UINT8 a1 = (dx >> 8) & 0xff; // calc remainder pixel + uint8_t a1 = (dx >> 8) & 0xff; // calc remainder pixel dx >>= 16; // adjust to pixel (solid) count while (dx--) // plot rest of pixels { @@ -422,7 +422,7 @@ private: draw_aa_pixel(dstdata, pitch, dx, y1, apply_intensity(0xff & (~x1 >> 8), col)); dx++; dy -= 0x10000 - (0xffff & x1); // take off amount plotted - UINT8 a1 = (dy >> 8) & 0xff; // remainder pixel + uint8_t a1 = (dy >> 8) & 0xff; // remainder pixel dy >>= 16; // adjust to pixel (solid) count while (dy--) // plot rest of pixels { @@ -498,17 +498,17 @@ private: // draw_rect - draw a solid rectangle //------------------------------------------------- - static void draw_rect(const render_primitive &prim, _PixelType *dstdata, INT32 width, INT32 height, UINT32 pitch) + static void draw_rect(const render_primitive &prim, _PixelType *dstdata, int32_t width, int32_t height, uint32_t pitch) { render_bounds fpos = prim.bounds; assert(fpos.x0 <= fpos.x1); assert(fpos.y0 <= fpos.y1); // clamp to integers - INT32 startx = round_nearest(fpos.x0); - INT32 starty = round_nearest(fpos.y0); - INT32 endx = round_nearest(fpos.x1); - INT32 endy = round_nearest(fpos.y1); + int32_t startx = round_nearest(fpos.x0); + int32_t starty = round_nearest(fpos.y0); + int32_t endx = round_nearest(fpos.x1); + int32_t endy = round_nearest(fpos.y1); // ensure we fit if (startx < 0) startx = 0; @@ -531,24 +531,24 @@ private: // fast case: no alpha if (PRIMFLAG_GET_BLENDMODE(prim.flags) == BLENDMODE_NONE || is_opaque(prim.color.a)) { - UINT32 r = UINT32(256.0f * prim.color.r); - UINT32 g = UINT32(256.0f * prim.color.g); - UINT32 b = UINT32(256.0f * prim.color.b); - UINT32 pix; + uint32_t r = uint32_t(256.0f * prim.color.r); + uint32_t g = uint32_t(256.0f * prim.color.g); + uint32_t b = uint32_t(256.0f * prim.color.b); + uint32_t pix; // clamp R,G,B to 0-256 range - if (r > 0xff) { if (INT32(r) < 0) r = 0; else r = 0xff; } - if (g > 0xff) { if (INT32(g) < 0) g = 0; else g = 0xff; } - if (b > 0xff) { if (INT32(b) < 0) b = 0; else b = 0xff; } + if (r > 0xff) { if (int32_t(r) < 0) r = 0; else r = 0xff; } + if (g > 0xff) { if (int32_t(g) < 0) g = 0; else g = 0xff; } + if (b > 0xff) { if (int32_t(b) < 0) b = 0; else b = 0xff; } pix = dest_rgb_to_pixel(r, g, b); // loop over rows - for (INT32 y = starty; y < endy; y++) + for (int32_t y = starty; y < endy; y++) { _PixelType *dest = dstdata + y * pitch + startx; // loop over cols - for (INT32 x = startx; x < endx; x++) + for (int32_t x = startx; x < endx; x++) *dest++ = pix; } } @@ -556,19 +556,19 @@ private: // alpha and/or coloring case else if (!is_transparent(prim.color.a)) { - UINT32 rmask = dest_rgb_to_pixel(0xff,0x00,0x00); - UINT32 gmask = dest_rgb_to_pixel(0x00,0xff,0x00); - UINT32 bmask = dest_rgb_to_pixel(0x00,0x00,0xff); - UINT32 r = UINT32(256.0f * prim.color.r * prim.color.a); - UINT32 g = UINT32(256.0f * prim.color.g * prim.color.a); - UINT32 b = UINT32(256.0f * prim.color.b * prim.color.a); - UINT32 inva = UINT32(256.0f * (1.0f - prim.color.a)); + uint32_t rmask = dest_rgb_to_pixel(0xff,0x00,0x00); + uint32_t gmask = dest_rgb_to_pixel(0x00,0xff,0x00); + uint32_t bmask = dest_rgb_to_pixel(0x00,0x00,0xff); + uint32_t r = uint32_t(256.0f * prim.color.r * prim.color.a); + uint32_t g = uint32_t(256.0f * prim.color.g * prim.color.a); + uint32_t b = uint32_t(256.0f * prim.color.b * prim.color.a); + uint32_t inva = uint32_t(256.0f * (1.0f - prim.color.a)); // clamp R,G,B and inverse A to 0-256 range - if (r > 0xff) { if (INT32(r) < 0) r = 0; else r = 0xff; } - if (g > 0xff) { if (INT32(g) < 0) g = 0; else g = 0xff; } - if (b > 0xff) { if (INT32(b) < 0) b = 0; else b = 0xff; } - if (inva > 0x100) { if (INT32(inva) < 0) inva = 0; else inva = 0x100; } + if (r > 0xff) { if (int32_t(r) < 0) r = 0; else r = 0xff; } + if (g > 0xff) { if (int32_t(g) < 0) g = 0; else g = 0xff; } + if (b > 0xff) { if (int32_t(b) < 0) b = 0; else b = 0xff; } + if (inva > 0x100) { if (int32_t(inva) < 0) inva = 0; else inva = 0x100; } // pre-shift the RGBA pieces r = dest_rgb_to_pixel(r, 0, 0) << 8; @@ -576,17 +576,17 @@ private: b = dest_rgb_to_pixel(0, 0, b) << 8; // loop over rows - for (INT32 y = starty; y < endy; y++) + for (int32_t y = starty; y < endy; y++) { _PixelType *dest = dstdata + y * pitch + startx; // loop over cols - for (INT32 x = startx; x < endx; x++) + for (int32_t x = startx; x < endx; x++) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 dr = (r + ((dpix & rmask) * inva)) & (rmask << 8); - UINT32 dg = (g + ((dpix & gmask) * inva)) & (gmask << 8); - UINT32 db = (b + ((dpix & bmask) * inva)) & (bmask << 8); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t dr = (r + ((dpix & rmask) * inva)) & (rmask << 8); + uint32_t dg = (g + ((dpix & gmask) * inva)) & (gmask << 8); + uint32_t db = (b + ((dpix & bmask) * inva)) & (bmask << 8); *dest++ = (dr | dg | db) >> 8; } } @@ -603,11 +603,11 @@ private: // rasterization of a 16bpp palettized texture //------------------------------------------------- - static void draw_quad_palette16_none(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_palette16_none(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // ensure all parameters are valid assert(prim.texture.palette != nullptr); @@ -616,16 +616,16 @@ private: if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_palette16(prim.texture, curu, curv); + uint32_t pix = get_texel_palette16(prim.texture, curu, curv); *dest++ = source32_to_dest(pix); curu += dudx; curv += dvdx; @@ -636,29 +636,29 @@ private: // coloring-only case else if (is_opaque(prim.color.a)) { - UINT32 sr = UINT32(256.0f * prim.color.r); - UINT32 sg = UINT32(256.0f * prim.color.g); - UINT32 sb = UINT32(256.0f * prim.color.b); + uint32_t sr = uint32_t(256.0f * prim.color.r); + uint32_t sg = uint32_t(256.0f * prim.color.g); + uint32_t sb = uint32_t(256.0f * prim.color.b); // clamp R,G,B to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_palette16(prim.texture, curu, curv); - UINT32 r = (source32_r(pix) * sr) >> 8; - UINT32 g = (source32_g(pix) * sg) >> 8; - UINT32 b = (source32_b(pix) * sb) >> 8; + uint32_t pix = get_texel_palette16(prim.texture, curu, curv); + uint32_t r = (source32_r(pix) * sr) >> 8; + uint32_t g = (source32_g(pix) * sg) >> 8; + uint32_t b = (source32_b(pix) * sb) >> 8; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -670,32 +670,32 @@ private: // alpha and/or coloring case else if (!is_transparent(prim.color.a)) { - UINT32 sr = UINT32(256.0f * prim.color.r * prim.color.a); - UINT32 sg = UINT32(256.0f * prim.color.g * prim.color.a); - UINT32 sb = UINT32(256.0f * prim.color.b * prim.color.a); - UINT32 invsa = UINT32(256.0f * (1.0f - prim.color.a)); + uint32_t sr = uint32_t(256.0f * prim.color.r * prim.color.a); + uint32_t sg = uint32_t(256.0f * prim.color.g * prim.color.a); + uint32_t sb = uint32_t(256.0f * prim.color.b * prim.color.a); + uint32_t invsa = uint32_t(256.0f * (1.0f - prim.color.a)); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } - if (invsa > 0x100) { if (INT32(invsa) < 0) invsa = 0; else invsa = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } + if (invsa > 0x100) { if (int32_t(invsa) < 0) invsa = 0; else invsa = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_palette16(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; - UINT32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; - UINT32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; + uint32_t pix = get_texel_palette16(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; + uint32_t g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; + uint32_t b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -711,11 +711,11 @@ private: // rasterization of a 16bpp palettized texture //------------------------------------------------- - static void draw_quad_palette16_add(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_palette16_add(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // ensure all parameters are valid assert(prim.texture.palette != nullptr); @@ -724,22 +724,22 @@ private: if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_palette16(prim.texture, curu, curv); + uint32_t pix = get_texel_palette16(prim.texture, curu, curv); if ((pix & 0xffffff) != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = source32_r(pix) + dest_r(dpix); - UINT32 g = source32_g(pix) + dest_g(dpix); - UINT32 b = source32_b(pix) + dest_b(dpix); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = source32_r(pix) + dest_r(dpix); + uint32_t g = source32_g(pix) + dest_g(dpix); + uint32_t b = source32_b(pix) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -755,32 +755,32 @@ private: // alpha and/or coloring case else { - UINT32 sr = UINT32(256.0f * prim.color.r * prim.color.a); - UINT32 sg = UINT32(256.0f * prim.color.g * prim.color.a); - UINT32 sb = UINT32(256.0f * prim.color.b * prim.color.a); + uint32_t sr = uint32_t(256.0f * prim.color.r * prim.color.a); + uint32_t sg = uint32_t(256.0f * prim.color.g * prim.color.a); + uint32_t sb = uint32_t(256.0f * prim.color.b * prim.color.a); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_palette16(prim.texture, curu, curv); + uint32_t pix = get_texel_palette16(prim.texture, curu, curv); if ((pix & 0xffffff) != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = ((source32_r(pix) * sr) >> 8) + dest_r(dpix); - UINT32 g = ((source32_g(pix) * sg) >> 8) + dest_g(dpix); - UINT32 b = ((source32_b(pix) * sb) >> 8) + dest_b(dpix); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = ((source32_r(pix) * sr) >> 8) + dest_r(dpix); + uint32_t g = ((source32_g(pix) * sg) >> 8) + dest_g(dpix); + uint32_t b = ((source32_b(pix) * sb) >> 8) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -804,11 +804,11 @@ private: // rasterization using standard alpha blending //------------------------------------------------- - static void draw_quad_palettea16_alpha(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_palettea16_alpha(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // ensure all parameters are valid assert(prim.texture.palette != nullptr); @@ -817,24 +817,24 @@ private: if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_palette16a(prim.texture, curu, curv); - UINT32 ta = pix >> 24; + uint32_t pix = get_texel_palette16a(prim.texture, curu, curv); + uint32_t ta = pix >> 24; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 invta = 0x100 - ta; - UINT32 r = (source32_r(pix) * ta + dest_r(dpix) * invta) >> 8; - UINT32 g = (source32_g(pix) * ta + dest_g(dpix) * invta) >> 8; - UINT32 b = (source32_b(pix) * ta + dest_b(dpix) * invta) >> 8; + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t invta = 0x100 - ta; + uint32_t r = (source32_r(pix) * ta + dest_r(dpix) * invta) >> 8; + uint32_t g = (source32_g(pix) * ta + dest_g(dpix) * invta) >> 8; + uint32_t b = (source32_b(pix) * ta + dest_b(dpix) * invta) >> 8; *dest = dest_assemble_rgb(r, g, b); } @@ -848,36 +848,36 @@ private: // alpha and/or coloring case else { - UINT32 sr = UINT32(256.0f * prim.color.r); - UINT32 sg = UINT32(256.0f * prim.color.g); - UINT32 sb = UINT32(256.0f * prim.color.b); - UINT32 sa = UINT32(256.0f * prim.color.a); + uint32_t sr = uint32_t(256.0f * prim.color.r); + uint32_t sg = uint32_t(256.0f * prim.color.g); + uint32_t sb = uint32_t(256.0f * prim.color.b); + uint32_t sa = uint32_t(256.0f * prim.color.a); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } - if (sa > 0x100) { if (INT32(sa) < 0) sa = 0; else sa = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } + if (sa > 0x100) { if (int32_t(sa) < 0) sa = 0; else sa = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_palette16a(prim.texture, curu, curv); - UINT32 ta = (pix >> 24) * sa; + uint32_t pix = get_texel_palette16a(prim.texture, curu, curv); + uint32_t ta = (pix >> 24) * sa; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 invsta = (0x10000 - ta) << 8; - UINT32 r = (source32_r(pix) * sr * ta + dest_r(dpix) * invsta) >> 24; - UINT32 g = (source32_g(pix) * sg * ta + dest_g(dpix) * invsta) >> 24; - UINT32 b = (source32_b(pix) * sb * ta + dest_b(dpix) * invsta) >> 24; + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t invsta = (0x10000 - ta) << 8; + uint32_t r = (source32_r(pix) * sr * ta + dest_r(dpix) * invsta) >> 24; + uint32_t g = (source32_g(pix) * sg * ta + dest_g(dpix) * invsta) >> 24; + uint32_t b = (source32_b(pix) * sb * ta + dest_b(dpix) * invsta) >> 24; *dest = dest_assemble_rgb(r, g, b); } @@ -900,26 +900,26 @@ private: // rasterization of a 16bpp YUY image //------------------------------------------------- - static void draw_quad_yuy16_none(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_yuy16_none(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // fast case: no coloring, no alpha if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + uint32_t pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); *dest++ = source32_to_dest(pix); curu += dudx; curv += dvdx; @@ -930,29 +930,29 @@ private: // coloring-only case else if (is_opaque(prim.color.a)) { - UINT32 sr = UINT32(256.0f * prim.color.r); - UINT32 sg = UINT32(256.0f * prim.color.g); - UINT32 sb = UINT32(256.0f * prim.color.b); + uint32_t sr = uint32_t(256.0f * prim.color.r); + uint32_t sg = uint32_t(256.0f * prim.color.g); + uint32_t sb = uint32_t(256.0f * prim.color.b); // clamp R,G,B to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); - UINT32 r = (source32_r(pix) * sr) >> 8; - UINT32 g = (source32_g(pix) * sg) >> 8; - UINT32 b = (source32_b(pix) * sb) >> 8; + uint32_t pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + uint32_t r = (source32_r(pix) * sr) >> 8; + uint32_t g = (source32_g(pix) * sg) >> 8; + uint32_t b = (source32_b(pix) * sb) >> 8; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -964,32 +964,32 @@ private: // alpha and/or coloring case else if (!is_transparent(prim.color.a)) { - UINT32 sr = UINT32(256.0f * prim.color.r * prim.color.a); - UINT32 sg = UINT32(256.0f * prim.color.g * prim.color.a); - UINT32 sb = UINT32(256.0f * prim.color.b * prim.color.a); - UINT32 invsa = UINT32(256.0f * (1.0f - prim.color.a)); + uint32_t sr = uint32_t(256.0f * prim.color.r * prim.color.a); + uint32_t sg = uint32_t(256.0f * prim.color.g * prim.color.a); + uint32_t sb = uint32_t(256.0f * prim.color.b * prim.color.a); + uint32_t invsa = uint32_t(256.0f * (1.0f - prim.color.a)); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } - if (invsa > 0x100) { if (INT32(invsa) < 0) invsa = 0; else invsa = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } + if (invsa > 0x100) { if (int32_t(invsa) < 0) invsa = 0; else invsa = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; - UINT32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; - UINT32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; + uint32_t pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; + uint32_t g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; + uint32_t b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1006,11 +1006,11 @@ private: // conversion //------------------------------------------------- - static void draw_quad_yuy16_add(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_yuy16_add(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // simply can't do this without reading from the dest if (_NoDestRead) @@ -1020,20 +1020,20 @@ private: if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = source32_r(pix) + dest_r(dpix); - UINT32 g = source32_g(pix) + dest_g(dpix); - UINT32 b = source32_b(pix) + dest_b(dpix); + uint32_t pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = source32_r(pix) + dest_r(dpix); + uint32_t g = source32_g(pix) + dest_g(dpix); + uint32_t b = source32_b(pix) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1047,32 +1047,32 @@ private: // alpha and/or coloring case else { - UINT32 sr = UINT32(256.0f * prim.color.r); - UINT32 sg = UINT32(256.0f * prim.color.g); - UINT32 sb = UINT32(256.0f * prim.color.b); - UINT32 sa = UINT32(256.0f * prim.color.a); + uint32_t sr = uint32_t(256.0f * prim.color.r); + uint32_t sg = uint32_t(256.0f * prim.color.g); + uint32_t sb = uint32_t(256.0f * prim.color.b); + uint32_t sa = uint32_t(256.0f * prim.color.a); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } - if (sa > 0x100) { if (INT32(sa) < 0) sa = 0; else sa = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } + if (sa > 0x100) { if (int32_t(sa) < 0) sa = 0; else sa = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = ((source32_r(pix) * sr * sa) >> 16) + dest_r(dpix); - UINT32 g = ((source32_g(pix) * sg * sa) >> 16) + dest_g(dpix); - UINT32 b = ((source32_b(pix) * sb * sa) >> 16) + dest_b(dpix); + uint32_t pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv)); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = ((source32_r(pix) * sr * sa) >> 16) + dest_r(dpix); + uint32_t g = ((source32_g(pix) * sg * sa) >> 16) + dest_g(dpix); + uint32_t b = ((source32_b(pix) * sb * sa) >> 16) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1094,30 +1094,30 @@ private: // a 32bpp RGB texture //------------------------------------------------- - static void draw_quad_rgb32(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_rgb32(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { const rgb_t *palbase = prim.texture.palette; - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // fast case: no coloring, no alpha if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_rgb32(prim.texture, curu, curv); + uint32_t pix = get_texel_rgb32(prim.texture, curu, curv); *dest++ = source32_to_dest(pix); curu += dudx; curv += dvdx; @@ -1128,12 +1128,12 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_rgb32(prim.texture, curu, curv); - UINT32 r = palbase[(pix >> 16) & 0xff] >> _SrcShiftR; - UINT32 g = palbase[(pix >> 8) & 0xff] >> _SrcShiftG; - UINT32 b = palbase[(pix >> 0) & 0xff] >> _SrcShiftB; + uint32_t pix = get_texel_rgb32(prim.texture, curu, curv); + uint32_t r = palbase[(pix >> 16) & 0xff] >> _SrcShiftR; + uint32_t g = palbase[(pix >> 8) & 0xff] >> _SrcShiftG; + uint32_t b = palbase[(pix >> 0) & 0xff] >> _SrcShiftB; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1146,32 +1146,32 @@ private: // coloring-only case else if (is_opaque(prim.color.a)) { - UINT32 sr = UINT32(256.0f * prim.color.r); - UINT32 sg = UINT32(256.0f * prim.color.g); - UINT32 sb = UINT32(256.0f * prim.color.b); + uint32_t sr = uint32_t(256.0f * prim.color.r); + uint32_t sg = uint32_t(256.0f * prim.color.g); + uint32_t sb = uint32_t(256.0f * prim.color.b); // clamp R,G,B to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_rgb32(prim.texture, curu, curv); - UINT32 r = (source32_r(pix) * sr) >> 8; - UINT32 g = (source32_g(pix) * sg) >> 8; - UINT32 b = (source32_b(pix) * sb) >> 8; + uint32_t pix = get_texel_rgb32(prim.texture, curu, curv); + uint32_t r = (source32_r(pix) * sr) >> 8; + uint32_t g = (source32_g(pix) * sg) >> 8; + uint32_t b = (source32_b(pix) * sb) >> 8; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1183,12 +1183,12 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_rgb32(prim.texture, curu, curv); - UINT32 r = (palbase[(pix >> 16) & 0xff] * sr) >> (8 + _SrcShiftR); - UINT32 g = (palbase[(pix >> 8) & 0xff] * sg) >> (8 + _SrcShiftG); - UINT32 b = (palbase[(pix >> 0) & 0xff] * sb) >> (8 + _SrcShiftB); + uint32_t pix = get_texel_rgb32(prim.texture, curu, curv); + uint32_t r = (palbase[(pix >> 16) & 0xff] * sr) >> (8 + _SrcShiftR); + uint32_t g = (palbase[(pix >> 8) & 0xff] * sg) >> (8 + _SrcShiftG); + uint32_t b = (palbase[(pix >> 0) & 0xff] * sb) >> (8 + _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1201,35 +1201,35 @@ private: // alpha and/or coloring case else if (!is_transparent(prim.color.a)) { - UINT32 sr = UINT32(256.0f * prim.color.r * prim.color.a); - UINT32 sg = UINT32(256.0f * prim.color.g * prim.color.a); - UINT32 sb = UINT32(256.0f * prim.color.b * prim.color.a); - UINT32 invsa = UINT32(256.0f * (1.0f - prim.color.a)); + uint32_t sr = uint32_t(256.0f * prim.color.r * prim.color.a); + uint32_t sg = uint32_t(256.0f * prim.color.g * prim.color.a); + uint32_t sb = uint32_t(256.0f * prim.color.b * prim.color.a); + uint32_t invsa = uint32_t(256.0f * (1.0f - prim.color.a)); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } - if (invsa > 0x100) { if (INT32(invsa) < 0) invsa = 0; else invsa = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } + if (invsa > 0x100) { if (int32_t(invsa) < 0) invsa = 0; else invsa = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_rgb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; - UINT32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; - UINT32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; + uint32_t pix = get_texel_rgb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8; + uint32_t g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8; + uint32_t b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1241,13 +1241,13 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_rgb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * sr + dest_r(dpix) * invsa) >> 8; - UINT32 g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * sg + dest_g(dpix) * invsa) >> 8; - UINT32 b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * sb + dest_b(dpix) * invsa) >> 8; + uint32_t pix = get_texel_rgb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * sr + dest_r(dpix) * invsa) >> 8; + uint32_t g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * sg + dest_g(dpix) * invsa) >> 8; + uint32_t b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * sb + dest_b(dpix) * invsa) >> 8; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1264,12 +1264,12 @@ private: // rasterization by using RGB add //------------------------------------------------- - static void draw_quad_rgb32_add(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_rgb32_add(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { const rgb_t *palbase = prim.texture.palette; - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // simply can't do this without reading from the dest if (_NoDestRead) @@ -1279,23 +1279,23 @@ private: if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = source32_r(pix) + dest_r(dpix); - UINT32 g = source32_g(pix) + dest_g(dpix); - UINT32 b = source32_b(pix) + dest_b(dpix); + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = source32_r(pix) + dest_r(dpix); + uint32_t g = source32_g(pix) + dest_g(dpix); + uint32_t b = source32_b(pix) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1309,13 +1309,13 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = (palbase[(pix >> 16) & 0xff] >> _SrcShiftR) + dest_r(dpix); - UINT32 g = (palbase[(pix >> 8) & 0xff] >> _SrcShiftG) + dest_g(dpix); - UINT32 b = (palbase[(pix >> 0) & 0xff] >> _SrcShiftB) + dest_b(dpix); + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = (palbase[(pix >> 16) & 0xff] >> _SrcShiftR) + dest_r(dpix); + uint32_t g = (palbase[(pix >> 8) & 0xff] >> _SrcShiftG) + dest_g(dpix); + uint32_t b = (palbase[(pix >> 0) & 0xff] >> _SrcShiftB) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1330,35 +1330,35 @@ private: // alpha and/or coloring case else { - UINT32 sr = UINT32(256.0f * prim.color.r); - UINT32 sg = UINT32(256.0f * prim.color.g); - UINT32 sb = UINT32(256.0f * prim.color.b); - UINT32 sa = UINT32(256.0f * prim.color.a); + uint32_t sr = uint32_t(256.0f * prim.color.r); + uint32_t sg = uint32_t(256.0f * prim.color.g); + uint32_t sb = uint32_t(256.0f * prim.color.b); + uint32_t sa = uint32_t(256.0f * prim.color.a); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } - if (sa > 0x100) { if (INT32(sa) < 0) sa = 0; else sa = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } + if (sa > 0x100) { if (int32_t(sa) < 0) sa = 0; else sa = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = ((source32_r(pix) * sr * sa) >> 16) + dest_r(dpix); - UINT32 g = ((source32_g(pix) * sg * sa) >> 16) + dest_g(dpix); - UINT32 b = ((source32_b(pix) * sb * sa) >> 16) + dest_b(dpix); + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = ((source32_r(pix) * sr * sa) >> 16) + dest_r(dpix); + uint32_t g = ((source32_g(pix) * sg * sa) >> 16) + dest_g(dpix); + uint32_t b = ((source32_b(pix) * sb * sa) >> 16) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1372,13 +1372,13 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = ((palbase[(pix >> 16) & 0xff] * sr * sa) >> (16 + _SrcShiftR)) + dest_r(dpix); - UINT32 g = ((palbase[(pix >> 8) & 0xff] * sr * sa) >> (16 + _SrcShiftR)) + dest_g(dpix); - UINT32 b = ((palbase[(pix >> 0) & 0xff] * sr * sa) >> (16 + _SrcShiftR)) + dest_b(dpix); + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = ((palbase[(pix >> 16) & 0xff] * sr * sa) >> (16 + _SrcShiftR)) + dest_r(dpix); + uint32_t g = ((palbase[(pix >> 8) & 0xff] * sr * sa) >> (16 + _SrcShiftR)) + dest_g(dpix); + uint32_t b = ((palbase[(pix >> 0) & 0xff] * sr * sa) >> (16 + _SrcShiftR)) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1402,38 +1402,38 @@ private: // rasterization using standard alpha blending //------------------------------------------------- - static void draw_quad_argb32_alpha(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_argb32_alpha(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { const rgb_t *palbase = prim.texture.palette; - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // fast case: no coloring, no alpha if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 ta = pix >> 24; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t ta = pix >> 24; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 invta = 0x100 - ta; - UINT32 r = (source32_r(pix) * ta + dest_r(dpix) * invta) >> 8; - UINT32 g = (source32_g(pix) * ta + dest_g(dpix) * invta) >> 8; - UINT32 b = (source32_b(pix) * ta + dest_b(dpix) * invta) >> 8; + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t invta = 0x100 - ta; + uint32_t r = (source32_r(pix) * ta + dest_r(dpix) * invta) >> 8; + uint32_t g = (source32_g(pix) * ta + dest_g(dpix) * invta) >> 8; + uint32_t b = (source32_b(pix) * ta + dest_b(dpix) * invta) >> 8; *dest = dest_assemble_rgb(r, g, b); } @@ -1447,17 +1447,17 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 ta = pix >> 24; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t ta = pix >> 24; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 invta = 0x100 - ta; - UINT32 r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * ta + dest_r(dpix) * invta) >> 8; - UINT32 g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * ta + dest_g(dpix) * invta) >> 8; - UINT32 b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * ta + dest_b(dpix) * invta) >> 8; + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t invta = 0x100 - ta; + uint32_t r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * ta + dest_r(dpix) * invta) >> 8; + uint32_t g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * ta + dest_g(dpix) * invta) >> 8; + uint32_t b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * ta + dest_b(dpix) * invta) >> 8; *dest = dest_assemble_rgb(r, g, b); } @@ -1472,39 +1472,39 @@ private: // alpha and/or coloring case else { - UINT32 sr = UINT32(256.0f * prim.color.r); - UINT32 sg = UINT32(256.0f * prim.color.g); - UINT32 sb = UINT32(256.0f * prim.color.b); - UINT32 sa = UINT32(256.0f * prim.color.a); + uint32_t sr = uint32_t(256.0f * prim.color.r); + uint32_t sg = uint32_t(256.0f * prim.color.g); + uint32_t sb = uint32_t(256.0f * prim.color.b); + uint32_t sa = uint32_t(256.0f * prim.color.a); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } - if (sa > 0x100) { if (INT32(sa) < 0) sa = 0; else sa = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } + if (sa > 0x100) { if (int32_t(sa) < 0) sa = 0; else sa = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 ta = (pix >> 24) * sa; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t ta = (pix >> 24) * sa; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 invsta = (0x10000 - ta) << 8; - UINT32 r = (source32_r(pix) * sr * ta + dest_r(dpix) * invsta) >> 24; - UINT32 g = (source32_g(pix) * sg * ta + dest_g(dpix) * invsta) >> 24; - UINT32 b = (source32_b(pix) * sb * ta + dest_b(dpix) * invsta) >> 24; + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t invsta = (0x10000 - ta) << 8; + uint32_t r = (source32_r(pix) * sr * ta + dest_r(dpix) * invsta) >> 24; + uint32_t g = (source32_g(pix) * sg * ta + dest_g(dpix) * invsta) >> 24; + uint32_t b = (source32_b(pix) * sb * ta + dest_b(dpix) * invsta) >> 24; *dest = dest_assemble_rgb(r, g, b); } @@ -1519,17 +1519,17 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 ta = (pix >> 24) * sa; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t ta = (pix >> 24) * sa; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 invsta = (0x10000 - ta) << 8; - UINT32 r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * sr * ta + dest_r(dpix) * invsta) >> 24; - UINT32 g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * sg * ta + dest_g(dpix) * invsta) >> 24; - UINT32 b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * sb * ta + dest_b(dpix) * invsta) >> 24; + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t invsta = (0x10000 - ta) << 8; + uint32_t r = ((palbase[(pix >> 16) & 0xff] >> _SrcShiftR) * sr * ta + dest_r(dpix) * invsta) >> 24; + uint32_t g = ((palbase[(pix >> 8) & 0xff] >> _SrcShiftG) * sg * ta + dest_g(dpix) * invsta) >> 24; + uint32_t b = ((palbase[(pix >> 0) & 0xff] >> _SrcShiftB) * sb * ta + dest_b(dpix) * invsta) >> 24; *dest = dest_assemble_rgb(r, g, b); } @@ -1548,12 +1548,12 @@ private: // rasterization using RGB multiply //------------------------------------------------- - static void draw_quad_argb32_multiply(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_argb32_multiply(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { const rgb_t *palbase = prim.texture.palette; - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // simply can't do this without reading from the dest if (_NoDestRead) @@ -1563,23 +1563,23 @@ private: if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = (source32_r(pix) * dest_r(dpix)) >> (8 - _SrcShiftR); - UINT32 g = (source32_g(pix) * dest_g(dpix)) >> (8 - _SrcShiftG); - UINT32 b = (source32_b(pix) * dest_b(dpix)) >> (8 - _SrcShiftB); + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = (source32_r(pix) * dest_r(dpix)) >> (8 - _SrcShiftR); + uint32_t g = (source32_g(pix) * dest_g(dpix)) >> (8 - _SrcShiftG); + uint32_t b = (source32_b(pix) * dest_b(dpix)) >> (8 - _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1589,13 +1589,13 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = (palbase[(pix >> 16) & 0xff] * dest_r(dpix)) >> 8; - UINT32 g = (palbase[(pix >> 8) & 0xff] * dest_g(dpix)) >> 8; - UINT32 b = (palbase[(pix >> 0) & 0xff] * dest_b(dpix)) >> 8; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = (palbase[(pix >> 16) & 0xff] * dest_r(dpix)) >> 8; + uint32_t g = (palbase[(pix >> 8) & 0xff] * dest_g(dpix)) >> 8; + uint32_t b = (palbase[(pix >> 0) & 0xff] * dest_b(dpix)) >> 8; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1608,33 +1608,33 @@ private: // alpha and/or coloring case else { - UINT32 sr = UINT32(256.0f * prim.color.r * prim.color.a); - UINT32 sg = UINT32(256.0f * prim.color.g * prim.color.a); - UINT32 sb = UINT32(256.0f * prim.color.b * prim.color.a); + uint32_t sr = uint32_t(256.0f * prim.color.r * prim.color.a); + uint32_t sg = uint32_t(256.0f * prim.color.g * prim.color.a); + uint32_t sb = uint32_t(256.0f * prim.color.b * prim.color.a); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = (source32_r(pix) * sr * dest_r(dpix)) >> (16 - _SrcShiftR); - UINT32 g = (source32_g(pix) * sg * dest_g(dpix)) >> (16 - _SrcShiftG); - UINT32 b = (source32_b(pix) * sb * dest_b(dpix)) >> (16 - _SrcShiftB); + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = (source32_r(pix) * sr * dest_r(dpix)) >> (16 - _SrcShiftR); + uint32_t g = (source32_g(pix) * sg * dest_g(dpix)) >> (16 - _SrcShiftG); + uint32_t b = (source32_b(pix) * sb * dest_b(dpix)) >> (16 - _SrcShiftB); *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1644,13 +1644,13 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = (palbase[(pix >> 16) & 0xff] * sr * dest_r(dpix)) >> 16; - UINT32 g = (palbase[(pix >> 8) & 0xff] * sg * dest_g(dpix)) >> 16; - UINT32 b = (palbase[(pix >> 0) & 0xff] * sb * dest_b(dpix)) >> 16; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = (palbase[(pix >> 16) & 0xff] * sr * dest_r(dpix)) >> 16; + uint32_t g = (palbase[(pix >> 8) & 0xff] * sg * dest_g(dpix)) >> 16; + uint32_t b = (palbase[(pix >> 0) & 0xff] * sb * dest_b(dpix)) >> 16; *dest++ = dest_assemble_rgb(r, g, b); curu += dudx; @@ -1667,12 +1667,12 @@ private: // rasterization by using RGB add //------------------------------------------------- - static void draw_quad_argb32_add(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup) + static void draw_quad_argb32_add(const render_primitive &prim, _PixelType *dstdata, uint32_t pitch, quad_setup_data &setup) { const rgb_t *palbase = prim.texture.palette; - INT32 dudx = setup.dudx; - INT32 dvdx = setup.dvdx; - INT32 endx = setup.endx; + int32_t dudx = setup.dudx; + int32_t dvdx = setup.dvdx; + int32_t endx = setup.endx; // simply can't do this without reading from the dest if (_NoDestRead) @@ -1682,26 +1682,26 @@ private: if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) { // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 ta = pix >> 24; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t ta = pix >> 24; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = ((source32_r(pix) * ta) >> 8) + dest_r(dpix); - UINT32 g = ((source32_g(pix) * ta) >> 8) + dest_g(dpix); - UINT32 b = ((source32_b(pix) * ta) >> 8) + dest_b(dpix); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = ((source32_r(pix) * ta) >> 8) + dest_r(dpix); + uint32_t g = ((source32_g(pix) * ta) >> 8) + dest_g(dpix); + uint32_t b = ((source32_b(pix) * ta) >> 8) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1717,16 +1717,16 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 ta = pix >> 24; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t ta = pix >> 24; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = ((palbase[(pix >> 16) & 0xff] * ta) >> (8 + _SrcShiftR)) + dest_r(dpix); - UINT32 g = ((palbase[(pix >> 8) & 0xff] * ta) >> (8 + _SrcShiftG)) + dest_g(dpix); - UINT32 b = ((palbase[(pix >> 0) & 0xff] * ta) >> (8 + _SrcShiftB)) + dest_b(dpix); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = ((palbase[(pix >> 16) & 0xff] * ta) >> (8 + _SrcShiftR)) + dest_r(dpix); + uint32_t g = ((palbase[(pix >> 8) & 0xff] * ta) >> (8 + _SrcShiftG)) + dest_g(dpix); + uint32_t b = ((palbase[(pix >> 0) & 0xff] * ta) >> (8 + _SrcShiftB)) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1743,38 +1743,38 @@ private: // alpha and/or coloring case else { - UINT32 sr = UINT32(256.0f * prim.color.r); - UINT32 sg = UINT32(256.0f * prim.color.g); - UINT32 sb = UINT32(256.0f * prim.color.b); - UINT32 sa = UINT32(256.0f * prim.color.a); + uint32_t sr = uint32_t(256.0f * prim.color.r); + uint32_t sg = uint32_t(256.0f * prim.color.g); + uint32_t sb = uint32_t(256.0f * prim.color.b); + uint32_t sa = uint32_t(256.0f * prim.color.a); // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; } - if (sa > 0x100) { if (INT32(sa) < 0) sa = 0; else sa = 0x100; } + if (sr > 0x100) { if (int32_t(sr) < 0) sr = 0; else sr = 0x100; } + if (sg > 0x100) { if (int32_t(sg) < 0) sg = 0; else sg = 0x100; } + if (sb > 0x100) { if (int32_t(sb) < 0) sb = 0; else sb = 0x100; } + if (sa > 0x100) { if (int32_t(sa) < 0) sa = 0; else sa = 0x100; } // loop over rows - for (INT32 y = setup.starty; y < setup.endy; y++) + for (int32_t y = setup.starty; y < setup.endy; y++) { _PixelType *dest = dstdata + y * pitch + setup.startx; - INT32 curu = setup.startu + (y - setup.starty) * setup.dudy; - INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy; + int32_t curu = setup.startu + (y - setup.starty) * setup.dudy; + int32_t curv = setup.startv + (y - setup.starty) * setup.dvdy; // no lookup case if (palbase == nullptr) { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 ta = (pix >> 24) * sa; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t ta = (pix >> 24) * sa; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = ((source32_r(pix) * sr * ta) >> 24) + dest_r(dpix); - UINT32 g = ((source32_g(pix) * sg * ta) >> 24) + dest_g(dpix); - UINT32 b = ((source32_b(pix) * sb * ta) >> 24) + dest_b(dpix); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = ((source32_r(pix) * sr * ta) >> 24) + dest_r(dpix); + uint32_t g = ((source32_g(pix) * sg * ta) >> 24) + dest_g(dpix); + uint32_t b = ((source32_b(pix) * sb * ta) >> 24) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1790,16 +1790,16 @@ private: else { // loop over cols - for (INT32 x = setup.startx; x < endx; x++) + for (int32_t x = setup.startx; x < endx; x++) { - UINT32 pix = get_texel_argb32(prim.texture, curu, curv); - UINT32 ta = (pix >> 24) * sa; + uint32_t pix = get_texel_argb32(prim.texture, curu, curv); + uint32_t ta = (pix >> 24) * sa; if (ta != 0) { - UINT32 dpix = _NoDestRead ? 0 : *dest; - UINT32 r = ((palbase[(pix >> 16) & 0xff] * sr * ta) >> (24 + _SrcShiftR)) + dest_r(dpix); - UINT32 g = ((palbase[(pix >> 8) & 0xff] * sr * ta) >> (24 + _SrcShiftR)) + dest_g(dpix); - UINT32 b = ((palbase[(pix >> 0) & 0xff] * sr * ta) >> (24 + _SrcShiftR)) + dest_b(dpix); + uint32_t dpix = _NoDestRead ? 0 : *dest; + uint32_t r = ((palbase[(pix >> 16) & 0xff] * sr * ta) >> (24 + _SrcShiftR)) + dest_r(dpix); + uint32_t g = ((palbase[(pix >> 8) & 0xff] * sr * ta) >> (24 + _SrcShiftR)) + dest_g(dpix); + uint32_t b = ((palbase[(pix >> 0) & 0xff] * sr * ta) >> (24 + _SrcShiftR)) + dest_b(dpix); r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR); g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG); b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB); @@ -1825,7 +1825,7 @@ private: // drawing routine //------------------------------------------------- - static void setup_and_draw_textured_quad(const render_primitive &prim, _PixelType *dstdata, INT32 width, INT32 height, UINT32 pitch) + static void setup_and_draw_textured_quad(const render_primitive &prim, _PixelType *dstdata, int32_t width, int32_t height, uint32_t pitch) { assert(prim.bounds.x0 <= prim.bounds.x1); assert(prim.bounds.y0 <= prim.bounds.y1); @@ -1936,7 +1936,7 @@ private: //------------------------------------------------- public: - static void draw_primitives(const render_primitive_list &primlist, void *dstdata, UINT32 width, UINT32 height, UINT32 pitch) + static void draw_primitives(const render_primitive_list &primlist, void *dstdata, uint32_t width, uint32_t height, uint32_t pitch) { // loop over the list and render each element for (const render_primitive *prim = primlist.first(); prim != nullptr; prim = prim->next()) diff --git a/src/emu/rendfont.cpp b/src/emu/rendfont.cpp index af4580cc9c1..aa43342958c 100644 --- a/src/emu/rendfont.cpp +++ b/src/emu/rendfont.cpp @@ -22,7 +22,7 @@ #include -const UINT64 render_font::CACHED_BDF_HASH_SIZE; +const uint64_t render_font::CACHED_BDF_HASH_SIZE; //************************************************************************** // INLINE FUNCTIONS @@ -234,11 +234,11 @@ void render_font::char_expand(char32_t chnum, glyph &gl) // extract the data const char *ptr = gl.rawdata; - UINT8 accum = 0, accumbit = 7; + uint8_t accum = 0, accumbit = 7; for (int y = 0; y < gl.bmheight; y++) { int desty = y + m_height_cmd + m_yoffs_cmd - gl.yoffs - gl.bmheight; - UINT32 *dest = (desty >= 0 && desty < m_height_cmd) ? &gl.bitmap.pix32(desty, 0) : nullptr; + uint32_t *dest = (desty >= 0 && desty < m_height_cmd) ? &gl.bitmap.pix32(desty, 0) : nullptr; { for (int x = 0; x < gl.bmwidth; x++) { @@ -283,11 +283,11 @@ void render_font::char_expand(char32_t chnum, glyph &gl) // extract the data const char *ptr = gl.rawdata; - UINT8 accum = 0, accumbit = 7; + uint8_t accum = 0, accumbit = 7; for (int y = 0; y < gl.bmheight; y++) { int desty = y + m_height + m_yoffs - gl.yoffs - gl.bmheight; - UINT32 *dest = (desty >= 0 && desty < m_height) ? &gl.bitmap.pix32(desty) : nullptr; + uint32_t *dest = (desty >= 0 && desty < m_height) ? &gl.bitmap.pix32(desty) : nullptr; // text format if (m_format == FF_TEXT) @@ -454,7 +454,7 @@ float render_font::utf8string_width(float height, float aspect, const char *utf8 // loop over the string and accumulate widths int count; - INT32 totwidth = 0; + int32_t totwidth = 0; for (std::size_t offset = 0U; offset < length; offset += unsigned(count)) { char32_t uchar; @@ -490,12 +490,12 @@ bool render_font::load_cached_bdf(const char *filename) m_rawdata.resize(m_rawsize + 1); // read the first chunk - UINT32 bytes = file.read(&m_rawdata[0], std::min(CACHED_BDF_HASH_SIZE, m_rawsize)); + uint32_t bytes = file.read(&m_rawdata[0], std::min(CACHED_BDF_HASH_SIZE, m_rawsize)); if (bytes != std::min(CACHED_BDF_HASH_SIZE, m_rawsize)) return false; // has the chunk - UINT32 hash = core_crc32(0, (const UINT8 *)&m_rawdata[0], bytes) ^ (UINT32)m_rawsize; + uint32_t hash = core_crc32(0, (const uint8_t *)&m_rawdata[0], bytes) ^ (uint32_t)m_rawsize; // create the cached filename, changing the 'F' to a 'C' on the extension std::string cachedname(filename); @@ -523,7 +523,7 @@ bool render_font::load_cached_bdf(const char *filename) // read in the rest of the font if (bytes < m_rawsize) { - UINT32 read = file.read(&m_rawdata[bytes], m_rawsize - bytes); + uint32_t read = file.read(&m_rawdata[bytes], m_rawsize - bytes); if (read != m_rawsize - bytes) { m_rawdata.clear(); @@ -664,26 +664,26 @@ bool render_font::load_bdf() // load_cached - load a font in cached format //------------------------------------------------- -bool render_font::load_cached(emu_file &file, UINT32 hash) +bool render_font::load_cached(emu_file &file, uint32_t hash) { // get the file size - UINT64 filesize = file.size(); + uint64_t filesize = file.size(); // first read the header - UINT8 header[CACHED_HEADER_SIZE]; - UINT32 bytes_read = file.read(header, CACHED_HEADER_SIZE); + uint8_t header[CACHED_HEADER_SIZE]; + uint32_t bytes_read = file.read(header, CACHED_HEADER_SIZE); if (bytes_read != CACHED_HEADER_SIZE) return false; // validate the header if (header[0] != 'f' || header[1] != 'o' || header[2] != 'n' || header[3] != 't') return false; - if (hash && (header[4] != (UINT8)(hash >> 24) || header[5] != (UINT8)(hash >> 16) || header[6] != (UINT8)(hash >> 8) || header[7] != (UINT8)hash)) + if (hash && (header[4] != (uint8_t)(hash >> 24) || header[5] != (uint8_t)(hash >> 16) || header[6] != (uint8_t)(hash >> 8) || header[7] != (uint8_t)hash)) return false; m_height = (header[8] << 8) | header[9]; m_scale = 1.0f / (float)m_height; - m_yoffs = (INT16)((header[10] << 8) | header[11]); - UINT32 numchars = (header[12] << 24) | (header[13] << 16) | (header[14] << 8) | header[15]; + m_yoffs = (int16_t)((header[10] << 8) | header[11]); + uint32_t numchars = (header[12] << 24) | (header[13] << 16) | (header[14] << 8) | header[15]; if (filesize - CACHED_HEADER_SIZE < numchars * CACHED_CHAR_SIZE) return false; @@ -697,10 +697,10 @@ bool render_font::load_cached(emu_file &file, UINT32 hash) } // extract the data from the data - UINT64 offset = numchars * CACHED_CHAR_SIZE; + uint64_t offset = numchars * CACHED_CHAR_SIZE; for (int chindex = 0; chindex < numchars; chindex++) { - const UINT8 *info = reinterpret_cast(&m_rawdata[chindex * CACHED_CHAR_SIZE]); + const uint8_t *info = reinterpret_cast(&m_rawdata[chindex * CACHED_CHAR_SIZE]); int chnum = (info[0] << 8) | info[1]; // if we don't have a subtable yet, make one @@ -710,8 +710,8 @@ bool render_font::load_cached(emu_file &file, UINT32 hash) // fill in the entry glyph &gl = m_glyphs[chnum / 256][chnum % 256]; gl.width = (info[2] << 8) | info[3]; - gl.xoffs = (INT16)((info[4] << 8) | info[5]); - gl.yoffs = (INT16)((info[6] << 8) | info[7]); + gl.xoffs = (int16_t)((info[4] << 8) | info[5]); + gl.yoffs = (int16_t)((info[6] << 8) | info[7]); gl.bmwidth = (info[8] << 8) | info[9]; gl.bmheight = (info[10] << 8) | info[11]; gl.rawdata = &m_rawdata[offset]; @@ -735,7 +735,7 @@ bool render_font::load_cached(emu_file &file, UINT32 hash) // save_cached - save a font in cached format //------------------------------------------------- -bool render_font::save_cached(const char *filename, UINT32 hash) +bool render_font::save_cached(const char *filename, uint32_t hash) { osd_printf_warning("Generating cached BDF font...\n"); @@ -760,13 +760,13 @@ bool render_font::save_cached(const char *filename, UINT32 hash) try { // allocate an array to hold the character data - std::vector chartable(numchars * CACHED_CHAR_SIZE, 0); + std::vector chartable(numchars * CACHED_CHAR_SIZE, 0); // allocate a temp buffer to compress into - std::vector tempbuffer(65536); + std::vector tempbuffer(65536); // write the header - UINT8 *dest = &tempbuffer[0]; + uint8_t *dest = &tempbuffer[0]; *dest++ = 'f'; *dest++ = 'o'; *dest++ = 'n'; @@ -784,7 +784,7 @@ bool render_font::save_cached(const char *filename, UINT32 hash) *dest++ = numchars >> 8; *dest++ = numchars & 0xff; assert(dest == &tempbuffer[CACHED_HEADER_SIZE]); - UINT32 bytes_written = file.write(&tempbuffer[0], CACHED_HEADER_SIZE); + uint32_t bytes_written = file.write(&tempbuffer[0], CACHED_HEADER_SIZE); if (bytes_written != dest - &tempbuffer[0]) throw emu_fatalerror("Error writing cached file"); @@ -805,14 +805,14 @@ bool render_font::save_cached(const char *filename, UINT32 hash) { // write the data to the tempbuffer dest = &tempbuffer[0]; - UINT8 accum = 0; - UINT8 accbit = 7; + uint8_t accum = 0; + uint8_t accbit = 7; // bit-encode the character data for (int y = 0; y < gl.bmheight; y++) { int desty = y + m_height + m_yoffs - gl.yoffs - gl.bmheight; - const UINT32 *src = (desty >= 0 && desty < m_height) ? &gl.bitmap.pix32(desty) : nullptr; + const uint32_t *src = (desty >= 0 && desty < m_height) ? &gl.bitmap.pix32(desty) : nullptr; for (int x = 0; x < gl.bmwidth; x++) { if (src != nullptr && rgb_t(src[x]).a() != 0) diff --git a/src/emu/rendfont.h b/src/emu/rendfont.h index 6e2f410dfec..7510efb8c0a 100644 --- a/src/emu/rendfont.h +++ b/src/emu/rendfont.h @@ -38,7 +38,7 @@ public: render_manager &manager() const { return m_manager; } // size queries - INT32 pixel_height() const { return m_height; } + int32_t pixel_height() const { return m_height; } float char_width(float height, float aspect, char32_t ch); float string_width(float height, float aspect, const char *string); float utf8string_width(float height, float aspect, const char *utf8string); @@ -59,9 +59,9 @@ private: rawdata(nullptr), texture(nullptr) { } - INT32 width; // width from this character to the next - INT32 xoffs, yoffs; // X and Y offset from baseline to top,left of bitmap - INT32 bmwidth, bmheight; // width and height of bitmap + int32_t width; // width from this character to the next + int32_t xoffs, yoffs; // X and Y offset from baseline to top,left of bitmap + int32_t bmwidth, bmheight; // width and height of bitmap const char * rawdata; // pointer to the raw data for this one render_texture * texture; // pointer to a texture for rendering and sizing bitmap_argb32 bitmap; // pointer to the bitmap containing the raw data @@ -84,9 +84,9 @@ private: void char_expand(char32_t chnum, glyph &ch); bool load_cached_bdf(const char *filename); bool load_bdf(); - bool load_cached(emu_file &file, UINT32 hash); - bool load_cached_cmd(emu_file &file, UINT32 hash); - bool save_cached(const char *filename, UINT32 hash); + bool load_cached(emu_file &file, uint32_t hash); + bool load_cached_cmd(emu_file &file, uint32_t hash); + bool save_cached(const char *filename, uint32_t hash); void render_font_command_glyph(); @@ -98,7 +98,7 @@ private: float m_scale; // 1 / height precomputed glyph *m_glyphs[17*256]; // array of glyph subtables std::vector m_rawdata; // pointer to the raw data for the font - UINT64 m_rawsize; // size of the raw font data + uint64_t m_rawsize; // size of the raw font data std::unique_ptr m_osdfont; // handle to the OSD font int m_height_cmd; // height of the font, from ascent to descent @@ -109,7 +109,7 @@ private: // constants static const int CACHED_CHAR_SIZE = 12; static const int CACHED_HEADER_SIZE = 16; - static const UINT64 CACHED_BDF_HASH_SIZE = 1024; + static const uint64_t CACHED_BDF_HASH_SIZE = 1024; }; void convert_command_glyph(std::string &s); diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index 74246d4a6a4..95d2f35f935 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -868,15 +868,15 @@ void layout_element::reel_component::draw(running_machine &machine, bitmap_argb3 int use_state = (state + m_stateoffset) % max_state_used; // compute premultiplied colors - UINT32 r = color().r * 255.0f; - UINT32 g = color().g * 255.0f; - UINT32 b = color().b * 255.0f; - UINT32 a = color().a * 255.0f; + uint32_t r = color().r * 255.0f; + uint32_t g = color().g * 255.0f; + uint32_t b = color().b * 255.0f; + uint32_t a = color().a * 255.0f; // get the width of the string render_font *font = machine.render().font_alloc("default"); float aspect = 1.0f; - INT32 width; + int32_t width; int curry = 0; int num_shown = m_numsymbolsvisible; @@ -915,7 +915,7 @@ void layout_element::reel_component::draw(running_machine &machine, bitmap_argb3 aspect *= 0.9f; } - INT32 curx; + int32_t curx; curx = bounds.min_x + (bounds.width() - width) / 2; if (m_file[fruit]) @@ -936,14 +936,14 @@ void layout_element::reel_component::draw(running_machine &machine, bitmap_argb3 if (effy >= bounds.min_y && effy <= bounds.max_y) { - UINT32 *src = &tempbitmap2.pix32(y); - UINT32 *d = &dest.pix32(effy); + uint32_t *src = &tempbitmap2.pix32(y); + uint32_t *d = &dest.pix32(effy); for (int x = 0; x < dest.width(); x++) { int effx = x; if (effx >= bounds.min_x && effx <= bounds.max_x) { - UINT32 spix = rgb_t(src[x]).a(); + uint32_t spix = rgb_t(src[x]).a(); if (spix != 0) { d[effx] = src[x]; @@ -983,21 +983,21 @@ void layout_element::reel_component::draw(running_machine &machine, bitmap_argb3 if (effy >= bounds.min_y && effy <= bounds.max_y) { - UINT32 *src = &tempbitmap.pix32(y); - UINT32 *d = &dest.pix32(effy); + uint32_t *src = &tempbitmap.pix32(y); + uint32_t *d = &dest.pix32(effy); for (int x = 0; x < chbounds.width(); x++) { int effx = curx + x + chbounds.min_x; if (effx >= bounds.min_x && effx <= bounds.max_x) { - UINT32 spix = rgb_t(src[x]).a(); + uint32_t spix = rgb_t(src[x]).a(); if (spix != 0) { rgb_t dpix = d[effx]; - UINT32 ta = (a * (spix + 1)) >> 8; - UINT32 tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; - UINT32 tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; - UINT32 tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; + uint32_t ta = (a * (spix + 1)) >> 8; + uint32_t tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; + uint32_t tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; + uint32_t tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; d[effx] = rgb_t(tr, tg, tb); } } @@ -1028,15 +1028,15 @@ void layout_element::reel_component::draw_beltreel(running_machine &machine, bit int use_state = (state + m_stateoffset) % max_state_used; // compute premultiplied colors - UINT32 r = color().r * 255.0f; - UINT32 g = color().g * 255.0f; - UINT32 b = color().b * 255.0f; - UINT32 a = color().a * 255.0f; + uint32_t r = color().r * 255.0f; + uint32_t g = color().g * 255.0f; + uint32_t b = color().b * 255.0f; + uint32_t a = color().a * 255.0f; // get the width of the string render_font *font = machine.render().font_alloc("default"); float aspect = 1.0f; - INT32 width; + int32_t width; int currx = 0; int num_shown = m_numsymbolsvisible; @@ -1073,7 +1073,7 @@ void layout_element::reel_component::draw_beltreel(running_machine &machine, bit aspect *= 0.9f; } - INT32 curx; + int32_t curx; curx = bounds.min_x; if (m_file[fruit]) @@ -1094,14 +1094,14 @@ void layout_element::reel_component::draw_beltreel(running_machine &machine, bit if (effy >= bounds.min_y && effy <= bounds.max_y) { - UINT32 *src = &tempbitmap2.pix32(y); - UINT32 *d = &dest.pix32(effy); + uint32_t *src = &tempbitmap2.pix32(y); + uint32_t *d = &dest.pix32(effy); for (int x = 0; x < ourwidth/num_shown; x++) { int effx = basex + x; if (effx >= bounds.min_x && effx <= bounds.max_x) { - UINT32 spix = rgb_t(src[x]).a(); + uint32_t spix = rgb_t(src[x]).a(); if (spix != 0) { d[effx] = src[x]; @@ -1143,21 +1143,21 @@ void layout_element::reel_component::draw_beltreel(running_machine &machine, bit if (effy >= bounds.min_y && effy <= bounds.max_y) { - UINT32 *src = &tempbitmap.pix32(y); - UINT32 *d = &dest.pix32(effy); + uint32_t *src = &tempbitmap.pix32(y); + uint32_t *d = &dest.pix32(effy); for (int x = 0; x < chbounds.width(); x++) { int effx = basex + curx + x; if (effx >= bounds.min_x && effx <= bounds.max_x) { - UINT32 spix = rgb_t(src[x]).a(); + uint32_t spix = rgb_t(src[x]).a(); if (spix != 0) { rgb_t dpix = d[effx]; - UINT32 ta = (a * (spix + 1)) >> 8; - UINT32 tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; - UINT32 tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; - UINT32 tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; + uint32_t ta = (a * (spix + 1)) >> 8; + uint32_t tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; + uint32_t tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; + uint32_t tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; d[effx] = rgb_t(tr, tg, tb); } } @@ -1826,19 +1826,19 @@ layout_element::rect_component::rect_component(running_machine &machine, xml_dat void layout_element::rect_component::draw(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state) { // compute premultiplied colors - UINT32 r = color().r * color().a * 255.0f; - UINT32 g = color().g * color().a * 255.0f; - UINT32 b = color().b * color().a * 255.0f; - UINT32 inva = (1.0f - color().a) * 255.0f; + uint32_t r = color().r * color().a * 255.0f; + uint32_t g = color().g * color().a * 255.0f; + uint32_t b = color().b * color().a * 255.0f; + uint32_t inva = (1.0f - color().a) * 255.0f; // iterate over X and Y - for (UINT32 y = bounds.min_y; y <= bounds.max_y; y++) + for (uint32_t y = bounds.min_y; y <= bounds.max_y; y++) { - for (UINT32 x = bounds.min_x; x <= bounds.max_x; x++) + for (uint32_t x = bounds.min_x; x <= bounds.max_x; x++) { - UINT32 finalr = r; - UINT32 finalg = g; - UINT32 finalb = b; + uint32_t finalr = r; + uint32_t finalg = g; + uint32_t finalb = b; // if we're translucent, add in the destination pixel contribution if (inva > 0) @@ -1873,10 +1873,10 @@ layout_element::disk_component::disk_component(running_machine &machine, xml_dat void layout_element::disk_component::draw(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state) { // compute premultiplied colors - UINT32 r = color().r * color().a * 255.0f; - UINT32 g = color().g * color().a * 255.0f; - UINT32 b = color().b * color().a * 255.0f; - UINT32 inva = (1.0f - color().a) * 255.0f; + uint32_t r = color().r * color().a * 255.0f; + uint32_t g = color().g * color().a * 255.0f; + uint32_t b = color().b * color().a * 255.0f; + uint32_t inva = (1.0f - color().a) * 255.0f; // find the center float xcenter = float(bounds.xcenter()); @@ -1886,21 +1886,21 @@ void layout_element::disk_component::draw(running_machine &machine, bitmap_argb3 float ooyradius2 = 1.0f / (yradius * yradius); // iterate over y - for (UINT32 y = bounds.min_y; y <= bounds.max_y; y++) + for (uint32_t y = bounds.min_y; y <= bounds.max_y; y++) { float ycoord = ycenter - ((float)y + 0.5f); float xval = xradius * sqrtf(1.0f - (ycoord * ycoord) * ooyradius2); // compute left/right coordinates - INT32 left = (INT32)(xcenter - xval + 0.5f); - INT32 right = (INT32)(xcenter + xval + 0.5f); + int32_t left = (int32_t)(xcenter - xval + 0.5f); + int32_t right = (int32_t)(xcenter + xval + 0.5f); // draw this scanline - for (UINT32 x = left; x < right; x++) + for (uint32_t x = left; x < right; x++) { - UINT32 finalr = r; - UINT32 finalg = g; - UINT32 finalb = b; + uint32_t finalr = r; + uint32_t finalg = g; + uint32_t finalb = b; // if we're translucent, add in the destination pixel contribution if (inva > 0) @@ -1925,14 +1925,14 @@ void layout_element::disk_component::draw(running_machine &machine, bitmap_argb3 void layout_element::component::draw_text(render_font &font, bitmap_argb32 &dest, const rectangle &bounds, const char *str, int align) { // compute premultiplied colors - UINT32 r = color().r * 255.0f; - UINT32 g = color().g * 255.0f; - UINT32 b = color().b * 255.0f; - UINT32 a = color().a * 255.0f; + uint32_t r = color().r * 255.0f; + uint32_t g = color().g * 255.0f; + uint32_t b = color().b * 255.0f; + uint32_t a = color().a * 255.0f; // get the width of the string float aspect = 1.0f; - INT32 width; + int32_t width; while (1) { @@ -1943,7 +1943,7 @@ void layout_element::component::draw_text(render_font &font, bitmap_argb32 &dest } // get alignment - INT32 curx; + int32_t curx; switch (align) { // left @@ -1989,21 +1989,21 @@ void layout_element::component::draw_text(render_font &font, bitmap_argb32 &dest int effy = bounds.min_y + y; if (effy >= bounds.min_y && effy <= bounds.max_y) { - UINT32 *src = &tempbitmap.pix32(y); - UINT32 *d = &dest.pix32(effy); + uint32_t *src = &tempbitmap.pix32(y); + uint32_t *d = &dest.pix32(effy); for (int x = 0; x < chbounds.width(); x++) { int effx = curx + x + chbounds.min_x; if (effx >= bounds.min_x && effx <= bounds.max_x) { - UINT32 spix = rgb_t(src[x]).a(); + uint32_t spix = rgb_t(src[x]).a(); if (spix != 0) { rgb_t dpix = d[effx]; - UINT32 ta = (a * (spix + 1)) >> 8; - UINT32 tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; - UINT32 tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; - UINT32 tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; + uint32_t ta = (a * (spix + 1)) >> 8; + uint32_t tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; + uint32_t tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; + uint32_t tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; d[effx] = rgb_t(tr, tg, tb); } } @@ -2029,8 +2029,8 @@ void layout_element::component::draw_segment_horizontal_caps(bitmap_argb32 &dest // loop over the width of the segment for (int y = 0; y < width / 2; y++) { - UINT32 *d0 = &dest.pix32(midy - y); - UINT32 *d1 = &dest.pix32(midy + y); + uint32_t *d0 = &dest.pix32(midy - y); + uint32_t *d1 = &dest.pix32(midy + y); int ty = (y < width / 8) ? width / 8 : y; // loop over the length of the segment @@ -2062,8 +2062,8 @@ void layout_element::component::draw_segment_vertical_caps(bitmap_argb32 &dest, // loop over the width of the segment for (int x = 0; x < width / 2; x++) { - UINT32 *d0 = &dest.pix32(0, midx - x); - UINT32 *d1 = &dest.pix32(0, midx + x); + uint32_t *d0 = &dest.pix32(0, midx - x); + uint32_t *d1 = &dest.pix32(0, midx + x); int tx = (x < width / 8) ? width / 8 : x; // loop over the length of the segment @@ -2099,7 +2099,7 @@ void layout_element::component::draw_segment_diagonal_1(bitmap_argb32 &dest, int for (int x = minx; x < maxx; x++) if (x >= 0 && x < dest.width()) { - UINT32 *d = &dest.pix32(0, x); + uint32_t *d = &dest.pix32(0, x); int step = (x - minx) * ratio; for (int y = maxy - width - step; y < maxy - step; y++) @@ -2124,7 +2124,7 @@ void layout_element::component::draw_segment_diagonal_2(bitmap_argb32 &dest, int for (int x = minx; x < maxx; x++) if (x >= 0 && x < dest.width()) { - UINT32 *d = &dest.pix32(0, x); + uint32_t *d = &dest.pix32(0, x); int step = (x - minx) * ratio; for (int y = miny + step; y < miny + step + width; y++) @@ -2145,19 +2145,19 @@ void layout_element::component::draw_segment_decimal(bitmap_argb32 &dest, int mi float ooradius2 = 1.0f / (float)(width * width); // iterate over y - for (UINT32 y = 0; y <= width; y++) + for (uint32_t y = 0; y <= width; y++) { - UINT32 *d0 = &dest.pix32(midy - y); - UINT32 *d1 = &dest.pix32(midy + y); + uint32_t *d0 = &dest.pix32(midy - y); + uint32_t *d1 = &dest.pix32(midy + y); float xval = width * sqrt(1.0f - (float)(y * y) * ooradius2); - INT32 left, right; + int32_t left, right; // compute left/right coordinates - left = midx - (INT32)(xval + 0.5f); - right = midx + (INT32)(xval + 0.5f); + left = midx - (int32_t)(xval + 0.5f); + right = midx + (int32_t)(xval + 0.5f); // draw this scanline - for (UINT32 x = left; x < right; x++) + for (uint32_t x = left; x < right; x++) d0[x] = d1[x] = color; } } @@ -2176,7 +2176,7 @@ void layout_element::component::draw_segment_comma(bitmap_argb32 &dest, int minx // draw line for (int x = minx; x < maxx; x++) { - UINT32 *d = &dest.pix32(0, x); + uint32_t *d = &dest.pix32(0, x); int step = (x - minx) * ratio; for (int y = maxy; y < maxy - width - step; y--) @@ -2193,7 +2193,7 @@ void layout_element::component::apply_skew(bitmap_argb32 &dest, int skewwidth) { for (int y = 0; y < dest.height(); y++) { - UINT32 *destrow = &dest.pix32(y); + uint32_t *destrow = &dest.pix32(y); int offs = skewwidth * (dest.height() - y) / dest.height(); for (int x = dest.width() - skewwidth - 1; x >= 0; x--) destrow[x + offs] = destrow[x]; diff --git a/src/emu/rendutil.cpp b/src/emu/rendutil.cpp index 1d59c92db0b..956f20ad5b7 100644 --- a/src/emu/rendutil.cpp +++ b/src/emu/rendutil.cpp @@ -19,8 +19,8 @@ ***************************************************************************/ /* utilities */ -static void resample_argb_bitmap_average(UINT32 *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const UINT32 *source, UINT32 srowpixels, UINT32 swidth, UINT32 sheight, const render_color &color, UINT32 dx, UINT32 dy); -static void resample_argb_bitmap_bilinear(UINT32 *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const UINT32 *source, UINT32 srowpixels, UINT32 swidth, UINT32 sheight, const render_color &color, UINT32 dx, UINT32 dy); +static void resample_argb_bitmap_average(uint32_t *dest, uint32_t drowpixels, uint32_t dwidth, uint32_t dheight, const uint32_t *source, uint32_t srowpixels, uint32_t swidth, uint32_t sheight, const render_color &color, uint32_t dx, uint32_t dy); +static void resample_argb_bitmap_bilinear(uint32_t *dest, uint32_t drowpixels, uint32_t dwidth, uint32_t dheight, const uint32_t *source, uint32_t srowpixels, uint32_t swidth, uint32_t sheight, const render_color &color, uint32_t dx, uint32_t dy); static bool copy_png_to_bitmap(bitmap_argb32 &bitmap, const png_info *png); static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info *png); @@ -41,15 +41,15 @@ void render_resample_argb_bitmap_hq(bitmap_argb32 &dest, bitmap_argb32 &source, return; /* adjust the source base */ - const UINT32 *sbase = &source.pix32(0); + const uint32_t *sbase = &source.pix32(0); /* determine the steppings */ - UINT32 swidth = source.width(); - UINT32 sheight = source.height(); - UINT32 dwidth = dest.width(); - UINT32 dheight = dest.height(); - UINT32 dx = (swidth << 12) / dwidth; - UINT32 dy = (sheight << 12) / dheight; + uint32_t swidth = source.width(); + uint32_t sheight = source.height(); + uint32_t dwidth = dest.width(); + uint32_t dheight = dest.height(); + uint32_t dx = (swidth << 12) / dwidth; + uint32_t dy = (sheight << 12) / dheight; /* if the source is higher res than the target, use full averaging */ if (dx > 0x1000 || dy > 0x1000 || force) @@ -65,11 +65,11 @@ void render_resample_argb_bitmap_hq(bitmap_argb32 &dest, bitmap_argb32 &source, all contributing pixels -------------------------------------------------*/ -static void resample_argb_bitmap_average(UINT32 *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const UINT32 *source, UINT32 srowpixels, UINT32 swidth, UINT32 sheight, const render_color &color, UINT32 dx, UINT32 dy) +static void resample_argb_bitmap_average(uint32_t *dest, uint32_t drowpixels, uint32_t dwidth, uint32_t dheight, const uint32_t *source, uint32_t srowpixels, uint32_t swidth, uint32_t sheight, const render_color &color, uint32_t dx, uint32_t dy) { - UINT64 sumscale = (UINT64)dx * (UINT64)dy; - UINT32 r, g, b, a; - UINT32 x, y; + uint64_t sumscale = (uint64_t)dx * (uint64_t)dy; + uint32_t r, g, b, a; + uint32_t x, y; /* precompute premultiplied R/G/B/A factors */ r = color.r * color.a * 256.0f; @@ -80,22 +80,22 @@ static void resample_argb_bitmap_average(UINT32 *dest, UINT32 drowpixels, UINT32 /* loop over the target vertically */ for (y = 0; y < dheight; y++) { - UINT32 starty = y * dy; + uint32_t starty = y * dy; /* loop over the target horizontally */ for (x = 0; x < dwidth; x++) { - UINT64 sumr = 0, sumg = 0, sumb = 0, suma = 0; - UINT32 startx = x * dx; - UINT32 xchunk, ychunk; - UINT32 curx, cury; + uint64_t sumr = 0, sumg = 0, sumb = 0, suma = 0; + uint32_t startx = x * dx; + uint32_t xchunk, ychunk; + uint32_t curx, cury; - UINT32 yremaining = dy; + uint32_t yremaining = dy; /* accumulate all source pixels that contribute to this pixel */ for (cury = starty; yremaining; cury += ychunk) { - UINT32 xremaining = dx; + uint32_t xremaining = dx; /* determine the Y contribution, clamping to the amount remaining */ ychunk = 0x1000 - (cury & 0xfff); @@ -106,7 +106,7 @@ static void resample_argb_bitmap_average(UINT32 *dest, UINT32 drowpixels, UINT32 /* loop over all source pixels in the X direction */ for (curx = startx; xremaining; curx += xchunk) { - UINT32 factor; + uint32_t factor; /* determine the X contribution, clamping to the amount remaining */ xchunk = 0x1000 - (curx & 0xfff); @@ -156,11 +156,11 @@ static void resample_argb_bitmap_average(UINT32 *dest, UINT32 drowpixels, UINT32 sampling via a bilinear filter -------------------------------------------------*/ -static void resample_argb_bitmap_bilinear(UINT32 *dest, UINT32 drowpixels, UINT32 dwidth, UINT32 dheight, const UINT32 *source, UINT32 srowpixels, UINT32 swidth, UINT32 sheight, const render_color &color, UINT32 dx, UINT32 dy) +static void resample_argb_bitmap_bilinear(uint32_t *dest, uint32_t drowpixels, uint32_t dwidth, uint32_t dheight, const uint32_t *source, uint32_t srowpixels, uint32_t swidth, uint32_t sheight, const render_color &color, uint32_t dx, uint32_t dy) { - UINT32 maxx = swidth << 12, maxy = sheight << 12; - UINT32 r, g, b, a; - UINT32 x, y; + uint32_t maxx = swidth << 12, maxy = sheight << 12; + uint32_t r, g, b, a; + uint32_t x, y; /* precompute premultiplied R/G/B/A factors */ r = color.r * color.a * 256.0f; @@ -171,17 +171,17 @@ static void resample_argb_bitmap_bilinear(UINT32 *dest, UINT32 drowpixels, UINT3 /* loop over the target vertically */ for (y = 0; y < dheight; y++) { - UINT32 starty = y * dy; + uint32_t starty = y * dy; /* loop over the target horizontally */ for (x = 0; x < dwidth; x++) { - UINT32 startx = x * dx; + uint32_t startx = x * dx; rgb_t pix0, pix1, pix2, pix3; - UINT32 sumr, sumg, sumb, suma; - UINT32 nextx, nexty; - UINT32 curx, cury; - UINT32 factor; + uint32_t sumr, sumg, sumb, suma; + uint32_t nextx, nexty; + uint32_t curx, cury; + uint32_t factor; /* adjust start to the center; note that this math will tend to produce */ /* negative results on the first pixel, which is why we clamp below */ @@ -194,13 +194,13 @@ static void resample_argb_bitmap_bilinear(UINT32 *dest, UINT32 drowpixels, UINT3 /* fetch the four relevant pixels */ pix0 = pix1 = pix2 = pix3 = 0; - if ((INT32)cury >= 0 && cury < maxy && (INT32)curx >= 0 && curx < maxx) + if ((int32_t)cury >= 0 && cury < maxy && (int32_t)curx >= 0 && curx < maxx) pix0 = source[(cury >> 12) * srowpixels + (curx >> 12)]; - if ((INT32)cury >= 0 && cury < maxy && (INT32)nextx >= 0 && nextx < maxx) + if ((int32_t)cury >= 0 && cury < maxy && (int32_t)nextx >= 0 && nextx < maxx) pix1 = source[(cury >> 12) * srowpixels + (nextx >> 12)]; - if ((INT32)nexty >= 0 && nexty < maxy && (INT32)curx >= 0 && curx < maxx) + if ((int32_t)nexty >= 0 && nexty < maxy && (int32_t)curx >= 0 && curx < maxx) pix2 = source[(nexty >> 12) * srowpixels + (curx >> 12)]; - if ((INT32)nexty >= 0 && nexty < maxy && (INT32)nextx >= 0 && nextx < maxx) + if ((int32_t)nexty >= 0 && nexty < maxy && (int32_t)nextx >= 0 && nextx < maxx) pix3 = source[(nexty >> 12) * srowpixels + (nextx >> 12)]; /* compute the x/y scaling factors */ @@ -267,8 +267,8 @@ bool render_clip_line(render_bounds *bounds, const render_bounds *clip) /* loop until we get a final result */ while (1) { - UINT8 code0 = 0, code1 = 0; - UINT8 thiscode; + uint8_t code0 = 0, code1 = 0; + uint8_t thiscode; float x, y; /* compute Cohen Sutherland bits for first coordinate */ @@ -569,7 +569,7 @@ void render_load_jpeg(bitmap_argb32 &bitmap, emu_file &file, const char *dirname jpeg_create_decompress(&cinfo); // allocates a buffer for the image - UINT32 jpg_size = file.size(); + uint32_t jpg_size = file.size(); std::unique_ptr jpg_buffer = std::make_unique(jpg_size); // read data from the file and set them in the buffer @@ -696,8 +696,8 @@ bool render_load_png(bitmap_argb32 &bitmap, emu_file &file, const char *dirname, static bool copy_png_to_bitmap(bitmap_argb32 &bitmap, const png_info *png) { - UINT8 accumalpha = 0xff; - UINT8 *src; + uint8_t accumalpha = 0xff; + uint8_t *src; int x, y; /* handle 8bpp palettized case */ @@ -709,7 +709,7 @@ static bool copy_png_to_bitmap(bitmap_argb32 &bitmap, const png_info *png) for (x = 0; x < png->width; x++, src++) { /* determine alpha and expand to 32bpp */ - UINT8 alpha = (*src < png->num_trans) ? png->trans[*src] : 0xff; + uint8_t alpha = (*src < png->num_trans) ? png->trans[*src] : 0xff; accumalpha &= alpha; bitmap.pix32(y, x) = rgb_t(alpha, png->palette[*src * 3], png->palette[*src * 3 + 1], png->palette[*src * 3 + 2]); } @@ -760,8 +760,8 @@ static bool copy_png_to_bitmap(bitmap_argb32 &bitmap, const png_info *png) static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info *png) { - UINT8 accumalpha = 0xff; - UINT8 *src; + uint8_t accumalpha = 0xff; + uint8_t *src; int x, y; /* handle 8bpp palettized case */ @@ -773,7 +773,7 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info *png) for (x = 0; x < png->width; x++, src++) { rgb_t pixel = bitmap.pix32(y, x); - UINT8 alpha = rgb_t(png->palette[*src * 3], png->palette[*src * 3 + 1], png->palette[*src * 3 + 2]).brightness(); + uint8_t alpha = rgb_t(png->palette[*src * 3], png->palette[*src * 3 + 1], png->palette[*src * 3 + 2]).brightness(); accumalpha &= alpha; bitmap.pix32(y, x) = rgb_t(alpha, pixel.r(), pixel.g(), pixel.b()); } @@ -802,7 +802,7 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info *png) for (x = 0; x < png->width; x++, src += 3) { rgb_t pixel = bitmap.pix32(y, x); - UINT8 alpha = rgb_t(src[0], src[1], src[2]).brightness(); + uint8_t alpha = rgb_t(src[0], src[1], src[2]).brightness(); accumalpha &= alpha; bitmap.pix32(y, x) = rgb_t(alpha, pixel.r(), pixel.g(), pixel.b()); } @@ -817,7 +817,7 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info *png) for (x = 0; x < png->width; x++, src += 4) { rgb_t pixel = bitmap.pix32(y, x); - UINT8 alpha = rgb_t(src[0], src[1], src[2]).brightness(); + uint8_t alpha = rgb_t(src[0], src[1], src[2]).brightness(); accumalpha &= alpha; bitmap.pix32(y, x) = rgb_t(alpha, pixel.r(), pixel.g(), pixel.b()); } diff --git a/src/emu/rendutil.h b/src/emu/rendutil.h index 9d3bb526c6d..dd4d8f1edf3 100644 --- a/src/emu/rendutil.h +++ b/src/emu/rendutil.h @@ -190,11 +190,11 @@ static inline float apply_brightness_contrast_gamma_fp(float srcval, float brigh a single RGB component -------------------------------------------------*/ -static inline UINT8 apply_brightness_contrast_gamma(UINT8 src, float brightness, float contrast, float gamma) +static inline uint8_t apply_brightness_contrast_gamma(uint8_t src, float brightness, float contrast, float gamma) { float srcval = (float)src * (1.0f / 255.0f); float result = apply_brightness_contrast_gamma_fp(srcval, brightness, contrast, gamma); - return (UINT8)(result * 255.0f); + return (uint8_t)(result * 255.0f); } diff --git a/src/emu/romentry.cpp b/src/emu/romentry.cpp index 1a8545d348b..11a80b20254 100644 --- a/src/emu/romentry.cpp +++ b/src/emu/romentry.cpp @@ -50,7 +50,7 @@ static std::string hashdata_from_tiny_rom_entry(const tiny_rom_entry &ent) // ctor (with move constructors) //------------------------------------------------- -rom_entry::rom_entry(std::string &&name, std::string &&hashdata, UINT32 offset, UINT32 length, UINT32 flags) +rom_entry::rom_entry(std::string &&name, std::string &&hashdata, uint32_t offset, uint32_t length, uint32_t flags) : m_name(std::move(name)) , m_hashdata(std::move(hashdata)) , m_offset(offset) diff --git a/src/emu/romentry.h b/src/emu/romentry.h index e163fad74d8..37ef23c6202 100644 --- a/src/emu/romentry.h +++ b/src/emu/romentry.h @@ -121,9 +121,9 @@ struct tiny_rom_entry { const char *name; const char *hashdata; - UINT32 offset; - UINT32 length; - UINT32 flags; + uint32_t offset; + uint32_t length; + uint32_t flags; }; @@ -133,7 +133,7 @@ class rom_entry { public: rom_entry(const tiny_rom_entry &ent); - rom_entry(std::string &&name, std::string &&hashdata, UINT32 offset, UINT32 length, UINT32 flags); + rom_entry(std::string &&name, std::string &&hashdata, uint32_t offset, uint32_t length, uint32_t flags); rom_entry(rom_entry const &) = default; rom_entry(rom_entry &&) = default; rom_entry &operator=(rom_entry const &) = default; @@ -142,17 +142,17 @@ public: // accessors const std::string &name() const { return m_name; } const std::string &hashdata() const { return m_hashdata; } - UINT32 offset() const { return m_offset; } - UINT32 length() const { return m_length; } - UINT32 flags() const { return m_flags; } - void set_flags(UINT32 flags) { m_flags = flags; } + uint32_t offset() const { return m_offset; } + uint32_t length() const { return m_length; } + uint32_t flags() const { return m_flags; } + void set_flags(uint32_t flags) { m_flags = flags; } private: std::string m_name; std::string m_hashdata; - UINT32 m_offset; - UINT32 m_length; - UINT32 m_flags; + uint32_t m_offset; + uint32_t m_length; + uint32_t m_flags; }; diff --git a/src/emu/romload.cpp b/src/emu/romload.cpp index b1f9703e690..53d3ffb673d 100644 --- a/src/emu/romload.cpp +++ b/src/emu/romload.cpp @@ -40,7 +40,7 @@ static osd_file::error common_process_file(emu_options &options, const char *loc return filerr; } -std::unique_ptr common_process_file(emu_options &options, const char *location, bool has_crc, UINT32 crc, const rom_entry *romp, osd_file::error &filerr) +std::unique_ptr common_process_file(emu_options &options, const char *location, bool has_crc, uint32_t crc, const rom_entry *romp, osd_file::error &filerr) { auto image_file = std::make_unique(options.media_path(), OPEN_FLAG_READ); @@ -184,14 +184,14 @@ std::string rom_parameter_value(const rom_entry *romp) file given the ROM description -------------------------------------------------*/ -UINT32 rom_file_size(const rom_entry *romp) +uint32_t rom_file_size(const rom_entry *romp) { - UINT32 maxlength = 0; + uint32_t maxlength = 0; /* loop until we run out of reloads */ do { - UINT32 curlength; + uint32_t curlength; /* loop until we run out of continues/ignores */ curlength = ROM_GETLENGTH(romp++); @@ -343,7 +343,7 @@ void rom_load_manager::count_roms() random data -------------------------------------------------*/ -void rom_load_manager::fill_random(UINT8 *base, UINT32 length) +void rom_load_manager::fill_random(uint8_t *base, uint32_t length) { while (length--) *base++ = machine().rand(); @@ -414,14 +414,14 @@ void rom_load_manager::dump_wrong_and_correct_checksums(const util::hash_collect and hash signatures of a file -------------------------------------------------*/ -void rom_load_manager::verify_length_and_hash(const char *name, UINT32 explength, const util::hash_collection &hashes) +void rom_load_manager::verify_length_and_hash(const char *name, uint32_t explength, const util::hash_collection &hashes) { /* we've already complained if there is no file */ if (m_file == nullptr) return; /* verify length */ - UINT32 actlength = m_file->size(); + uint32_t actlength = m_file->size(); if (explength != actlength) { m_errorstring.append(string_format("%s WRONG LENGTH (expected: %08x found: %08x)\n", name, explength, actlength)); @@ -462,7 +462,7 @@ void rom_load_manager::display_loading_rom_message(const char *name, bool from_l char buffer[200]; if (name != nullptr) - sprintf(buffer, "%s (%d%%)", from_list ? "Loading Software" : "Loading Machine", (UINT32)(100 * (UINT64)m_romsloadedsize / (UINT64)m_romstotalsize)); + sprintf(buffer, "%s (%d%%)", from_list ? "Loading Software" : "Loading Machine", (uint32_t)(100 * (uint64_t)m_romsloadedsize / (uint64_t)m_romstotalsize)); else sprintf(buffer, "Loading Complete"); @@ -506,7 +506,7 @@ void rom_load_manager::display_rom_load_results(bool from_list) void rom_load_manager::region_post_process(const char *rgntag, bool invert) { memory_region *region = machine().root_device().memregion(rgntag); - UINT8 *base; + uint8_t *base; int i, j; // do nothing if no region @@ -531,7 +531,7 @@ void rom_load_manager::region_post_process(const char *rgntag, bool invert) int datawidth = region->bytewidth(); for (i = 0, base = region->base(); i < region->bytes(); i += datawidth) { - UINT8 temp[8]; + uint8_t temp[8]; memcpy(temp, base, datawidth); for (j = datawidth - 1; j >= 0; j--) *base++ = temp[j]; @@ -548,14 +548,14 @@ void rom_load_manager::region_post_process(const char *rgntag, bool invert) int rom_load_manager::open_rom_file(const char *regiontag, const rom_entry *romp, std::string &tried_file_names, bool from_list) { osd_file::error filerr = osd_file::error::NOT_FOUND; - UINT32 romsize = rom_file_size(romp); + uint32_t romsize = rom_file_size(romp); tried_file_names = ""; /* update status display */ display_loading_rom_message(ROM_GETNAME(romp), from_list); /* extract CRC to use for searching */ - UINT32 crc = 0; + uint32_t crc = 0; bool has_crc = util::hash_collection(ROM_GETHASHDATA(romp)).crc(crc); /* attempt reading up the chain through the parents. It automatically also @@ -663,7 +663,7 @@ int rom_load_manager::open_rom_file(const char *regiontag, const rom_entry *romp random data for a nullptr file -------------------------------------------------*/ -int rom_load_manager::rom_fread(UINT8 *buffer, int length, const rom_entry *parent_region) +int rom_load_manager::rom_fread(uint8_t *buffer, int length, const rom_entry *parent_region) { /* files just pass through */ if (m_file != nullptr) @@ -691,8 +691,8 @@ int rom_load_manager::read_rom_data(const rom_entry *parent_region, const rom_en int skip = ROM_GETSKIPCOUNT(romp); int reversed = ROM_ISREVERSED(romp); int numgroups = (numbytes + groupsize - 1) / groupsize; - UINT8 *base = m_region->base() + ROM_GETOFFSET(romp); - UINT32 tempbufsize; + uint8_t *base = m_region->base() + ROM_GETOFFSET(romp); + uint32_t tempbufsize; int i; LOG(("Loading ROM data: offs=%X len=%X mask=%02X group=%d skip=%d reverse=%d\n", ROM_GETOFFSET(romp), numbytes, datamask, groupsize, skip, reversed)); @@ -715,7 +715,7 @@ int rom_load_manager::read_rom_data(const rom_entry *parent_region, const rom_en /* use a temporary buffer for complex loads */ tempbufsize = std::min(TEMPBUFFER_MAX_SIZE, numbytes); - std::vector tempbuf(tempbufsize); + std::vector tempbuf(tempbufsize); /* chunky reads for complex loads */ skip += groupsize; @@ -723,7 +723,7 @@ int rom_load_manager::read_rom_data(const rom_entry *parent_region, const rom_en { int evengroupcount = (tempbufsize / groupsize) * groupsize; int bytesleft = (numbytes > evengroupcount) ? evengroupcount : numbytes; - UINT8 *bufptr = &tempbuf[0]; + uint8_t *bufptr = &tempbuf[0]; /* read as much as we can */ LOG((" Reading %X bytes into buffer\n", bytesleft)); @@ -799,9 +799,9 @@ int rom_load_manager::read_rom_data(const rom_entry *parent_region, const rom_en void rom_load_manager::fill_rom_data(const rom_entry *romp) { - UINT32 numbytes = ROM_GETLENGTH(romp); + uint32_t numbytes = ROM_GETLENGTH(romp); int skip = ROM_GETSKIPCOUNT(romp); - UINT8 *base = m_region->base() + ROM_GETOFFSET(romp); + uint8_t *base = m_region->base() + ROM_GETOFFSET(romp); // make sure we fill within the region space if (ROM_GETOFFSET(romp) + numbytes > m_region->bytes()) @@ -812,7 +812,7 @@ void rom_load_manager::fill_rom_data(const rom_entry *romp) fatalerror("Error in RomModule definition: FILL has an invalid length\n"); // for fill bytes, the byte that gets filled is the first byte of the hashdata string - UINT8 fill_byte = (UINT8)strtol(ROM_GETHASHDATA(romp), nullptr, 0); + uint8_t fill_byte = (uint8_t)strtol(ROM_GETHASHDATA(romp), nullptr, 0); // fill the data (filling value is stored in place of the hashdata) if(skip != 0) @@ -831,10 +831,10 @@ void rom_load_manager::fill_rom_data(const rom_entry *romp) void rom_load_manager::copy_rom_data(const rom_entry *romp) { - UINT8 *base = m_region->base() + ROM_GETOFFSET(romp); + uint8_t *base = m_region->base() + ROM_GETOFFSET(romp); const char *srcrgntag = ROM_GETNAME(romp); - UINT32 numbytes = ROM_GETLENGTH(romp); - UINT32 srcoffs = (UINT32) strtol(ROM_GETHASHDATA(romp), nullptr, 0); /* srcoffset in place of hashdata */ + uint32_t numbytes = ROM_GETLENGTH(romp); + uint32_t srcoffs = (uint32_t) strtol(ROM_GETHASHDATA(romp), nullptr, 0); /* srcoffset in place of hashdata */ /* make sure we copy within the region space */ if (ROM_GETOFFSET(romp) + numbytes > m_region->bytes()) @@ -865,7 +865,7 @@ void rom_load_manager::copy_rom_data(const rom_entry *romp) void rom_load_manager::process_rom_entries(const char *regiontag, const rom_entry *parent_region, const rom_entry *romp, device_t *device, bool from_list) { - UINT32 lastflags = 0; + uint32_t lastflags = 0; /* loop until we hit the end of this region */ while (!ROMENTRY_ISREGIONEND(romp)) @@ -1223,7 +1223,7 @@ void rom_load_manager::process_disk_entries(const char *regiontag, const rom_ent flags for the given device -------------------------------------------------*/ -void rom_load_manager::normalize_flags_for_device(running_machine &machine, const char *rgntag, UINT8 &width, endianness_t &endian) +void rom_load_manager::normalize_flags_for_device(running_machine &machine, const char *rgntag, uint8_t &width, endianness_t &endian) { device_t *device = machine.device(rgntag); device_memory_interface *memory; @@ -1280,7 +1280,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list const software_info *swinfo = swlist.find(swname); if (swinfo != nullptr) { - UINT32 supported = swinfo->supported(); + uint32_t supported = swinfo->supported(); if (supported == SOFTWARE_SUPPORTED_PARTIAL) { m_errorstring.append(string_format("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist.list_name())); @@ -1311,7 +1311,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list /* loop until we hit the end */ for (region = start_region; region != nullptr; region = rom_next_region(region)) { - UINT32 regionlength = ROMREGION_GETLENGTH(region); + uint32_t regionlength = ROMREGION_GETLENGTH(region); regiontag = device.subtag(ROMREGION_GETTAG(region)); LOG(("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength)); @@ -1321,7 +1321,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list /* if this is a device region, override with the device width and endianness */ endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE; - UINT8 width = ROMREGION_GETWIDTH(region) / 8; + uint8_t width = ROMREGION_GETWIDTH(region) / 8; memory_region *memregion = machine().root_device().memregion(regiontag.c_str()); if (memregion != nullptr) { @@ -1389,7 +1389,7 @@ void rom_load_manager::process_region_list() for (device_t &device : deviter) for (const rom_entry *region = rom_first_region(device); region != nullptr; region = rom_next_region(region)) { - UINT32 regionlength = ROMREGION_GETLENGTH(region); + uint32_t regionlength = ROMREGION_GETLENGTH(region); regiontag = rom_region_name(device, region); LOG(("Processing region \"%s\" (length=%X)\n", regiontag.c_str(), regionlength)); @@ -1400,7 +1400,7 @@ void rom_load_manager::process_region_list() if (ROMREGION_ISROMDATA(region)) { /* if this is a device region, override with the device width and endianness */ - UINT8 width = ROMREGION_GETWIDTH(region) / 8; + uint8_t width = ROMREGION_GETWIDTH(region) / 8; endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE; if (machine().device(regiontag.c_str()) != nullptr) normalize_flags_for_device(machine(), regiontag.c_str(), width, endianness); diff --git a/src/emu/romload.h b/src/emu/romload.h index 37af7bd2323..2d11cf7bfe7 100644 --- a/src/emu/romload.h +++ b/src/emu/romload.h @@ -205,22 +205,22 @@ public: private: void determine_bios_rom(device_t &device, const char *specbios); void count_roms(); - void fill_random(UINT8 *base, UINT32 length); + void fill_random(uint8_t *base, uint32_t length); void handle_missing_file(const rom_entry *romp, std::string tried_file_names, chd_error chderr); void dump_wrong_and_correct_checksums(const util::hash_collection &hashes, const util::hash_collection &acthashes); - void verify_length_and_hash(const char *name, UINT32 explength, const util::hash_collection &hashes); + void verify_length_and_hash(const char *name, uint32_t explength, const util::hash_collection &hashes); void display_loading_rom_message(const char *name, bool from_list); void display_rom_load_results(bool from_list); void region_post_process(const char *rgntag, bool invert); int open_rom_file(const char *regiontag, const rom_entry *romp, std::string &tried_file_names, bool from_list); - int rom_fread(UINT8 *buffer, int length, const rom_entry *parent_region); + int rom_fread(uint8_t *buffer, int length, const rom_entry *parent_region); int read_rom_data(const rom_entry *parent_region, const rom_entry *romp); void fill_rom_data(const rom_entry *romp); void copy_rom_data(const rom_entry *romp); void process_rom_entries(const char *regiontag, const rom_entry *parent_region, const rom_entry *romp, device_t *device, bool from_list); chd_error open_disk_diff(emu_options &options, const rom_entry *romp, chd_file &source, chd_file &diff_chd); void process_disk_entries(const char *regiontag, const rom_entry *parent_region, const rom_entry *romp, const char *locationtag); - void normalize_flags_for_device(running_machine &machine, const char *rgntag, UINT8 &width, endianness_t &endian); + void normalize_flags_for_device(running_machine &machine, const char *rgntag, uint8_t &width, endianness_t &endian); void process_region_list(); @@ -233,8 +233,8 @@ private: int m_romsloaded; /* current ROMs loaded count */ int m_romstotal; /* total number of ROMs to read */ - UINT32 m_romsloadedsize; /* total size of ROMs loaded so far */ - UINT32 m_romstotalsize; /* total size of ROMs to read */ + uint32_t m_romsloadedsize; /* total size of ROMs loaded so far */ + uint32_t m_romstotalsize; /* total size of ROMs to read */ std::unique_ptr m_file; /* current file */ std::vector> m_chd_list; /* disks */ @@ -248,7 +248,7 @@ private: /* ----- Helpers ----- */ -std::unique_ptr common_process_file(emu_options &options, const char *location, bool has_crc, UINT32 crc, const rom_entry *romp, osd_file::error &filerr); +std::unique_ptr common_process_file(emu_options &options, const char *location, bool has_crc, uint32_t crc, const rom_entry *romp, osd_file::error &filerr); /* return pointer to the first ROM region within a source */ const rom_entry *rom_first_region(const device_t &device); @@ -263,7 +263,7 @@ const rom_entry *rom_first_file(const rom_entry *romp); const rom_entry *rom_next_file(const rom_entry *romp); /* return the expected size of a file given the ROM description */ -UINT32 rom_file_size(const rom_entry *romp); +uint32_t rom_file_size(const rom_entry *romp); /* return the appropriate name for a rom region */ std::string rom_region_name(const device_t &device, const rom_entry *romp); diff --git a/src/emu/save.cpp b/src/emu/save.cpp index 0dd66cd2e82..4a94c9baea1 100644 --- a/src/emu/save.cpp +++ b/src/emu/save.cpp @@ -86,7 +86,7 @@ void save_manager::allow_registration(bool allowed) // index //------------------------------------------------- -const char *save_manager::indexed_item(int index, void *&base, UINT32 &valsize, UINT32 &valcount) const +const char *save_manager::indexed_item(int index, void *&base, uint32_t &valsize, uint32_t &valcount) const { if (index >= m_entry_list.size() || index < 0) return nullptr; @@ -147,7 +147,7 @@ void save_manager::register_postload(save_prepost_delegate func) // memory //------------------------------------------------- -void save_manager::save_memory(device_t *device, const char *module, const char *tag, UINT32 index, const char *name, void *val, UINT32 valsize, UINT32 valcount) +void save_manager::save_memory(device_t *device, const char *module, const char *tag, uint32_t index, const char *name, void *val, uint32_t valsize, uint32_t valcount) { assert(valsize == 1 || valsize == 2 || valsize == 4 || valsize == 8); @@ -195,13 +195,13 @@ void save_manager::save_memory(device_t *device, const char *module, const char save_error save_manager::check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...)) { // if we want to validate the signature, compute it - UINT32 sig; + uint32_t sig; sig = machine.save().signature(); // seek to the beginning and read the header file.compress(FCOMPRESS_NONE); file.seek(0, SEEK_SET); - UINT8 header[HEADER_SIZE]; + uint8_t header[HEADER_SIZE]; if (file.read(header, sizeof(header)) != sizeof(header)) { if (errormsg != nullptr) @@ -238,13 +238,13 @@ save_error save_manager::read_file(emu_file &file) // read the header and turn on compression for the rest of the file file.compress(FCOMPRESS_NONE); file.seek(0, SEEK_SET); - UINT8 header[HEADER_SIZE]; + uint8_t header[HEADER_SIZE]; if (file.read(header, sizeof(header)) != sizeof(header)) return STATERR_READ_ERROR; file.compress(FCOMPRESS_MEDIUM); // verify the header and report an error if it doesn't match - UINT32 sig = signature(); + uint32_t sig = signature(); if (validate_header(header, machine().system().name, sig, nullptr, "Error: ") != STATERR_NONE) return STATERR_INVALID_HEADER; @@ -254,7 +254,7 @@ save_error save_manager::read_file(emu_file &file) // read all the data, flipping if necessary for (auto &entry : m_entry_list) { - UINT32 totalsize = entry->m_typesize * entry->m_typecount; + uint32_t totalsize = entry->m_typesize * entry->m_typecount; if (file.read(entry->m_data, totalsize) != totalsize) return STATERR_READ_ERROR; @@ -292,13 +292,13 @@ save_error save_manager::write_file(emu_file &file) return STATERR_ILLEGAL_REGISTRATIONS; // generate the header - UINT8 header[HEADER_SIZE]; + uint8_t header[HEADER_SIZE]; memcpy(&header[0], STATE_MAGIC_NUM, 8); header[8] = SAVE_VERSION; header[9] = NATIVE_ENDIAN_VALUE_LE_BE(0, SS_MSB_FIRST); strncpy((char *)&header[0x0a], machine().system().name, 0x1c - 0x0a); - UINT32 sig = signature(); - *(UINT32 *)&header[0x1c] = little_endianize_int32(sig); + uint32_t sig = signature(); + *(uint32_t *)&header[0x1c] = little_endianize_int32(sig); // write the header and turn on compression for the rest of the file file.compress(FCOMPRESS_NONE); @@ -313,7 +313,7 @@ save_error save_manager::write_file(emu_file &file) // then write all the data for (auto &entry : m_entry_list) { - UINT32 totalsize = entry->m_typesize * entry->m_typecount; + uint32_t totalsize = entry->m_typesize * entry->m_typecount; if (file.write(entry->m_data, totalsize) != totalsize) return STATERR_WRITE_ERROR; } @@ -326,20 +326,20 @@ save_error save_manager::write_file(emu_file &file) // is a CRC over the structure of the data //------------------------------------------------- -UINT32 save_manager::signature() const +uint32_t save_manager::signature() const { // iterate over entries - UINT32 crc = 0; + uint32_t crc = 0; for (auto &entry : m_entry_list) { // add the entry name to the CRC - crc = core_crc32(crc, (UINT8 *)entry->m_name.c_str(), entry->m_name.length()); + crc = core_crc32(crc, (uint8_t *)entry->m_name.c_str(), entry->m_name.length()); // add the type and size to the CRC - UINT32 temp[2]; + uint32_t temp[2]; temp[0] = little_endianize_int32(entry->m_typecount); temp[1] = little_endianize_int32(entry->m_typesize); - crc = core_crc32(crc, (UINT8 *)&temp[0], sizeof(temp)); + crc = core_crc32(crc, (uint8_t *)&temp[0], sizeof(temp)); } return crc; } @@ -362,7 +362,7 @@ void save_manager::dump_registry() const // header //------------------------------------------------- -save_error save_manager::validate_header(const UINT8 *header, const char *gamename, UINT32 signature, +save_error save_manager::validate_header(const uint8_t *header, const char *gamename, uint32_t signature, void (CLIB_DECL *errormsg)(const char *fmt, ...), const char *error_prefix) { // check magic number @@ -392,7 +392,7 @@ save_error save_manager::validate_header(const UINT8 *header, const char *gamena // check signature, if we were asked to if (signature != 0) { - UINT32 rawsig = *(UINT32 *)&header[0x1c]; + uint32_t rawsig = *(uint32_t *)&header[0x1c]; if (signature != little_endianize_int32(rawsig)) { if (errormsg != nullptr) @@ -418,7 +418,7 @@ save_manager::state_callback::state_callback(save_prepost_delegate callback) // state_entry - constructor //------------------------------------------------- -state_entry::state_entry(void *data, const char *name, device_t *device, const char *module, const char *tag, int index, UINT8 size, UINT32 count) +state_entry::state_entry(void *data, const char *name, device_t *device, const char *module, const char *tag, int index, uint8_t size, uint32_t count) : m_data(data), m_name(name), m_device(device), @@ -439,27 +439,27 @@ state_entry::state_entry(void *data, const char *name, device_t *device, const c void state_entry::flip_data() { - UINT16 *data16; - UINT32 *data32; - UINT64 *data64; + uint16_t *data16; + uint32_t *data32; + uint64_t *data64; int count; switch (m_typesize) { case 2: - data16 = (UINT16 *)m_data; + data16 = (uint16_t *)m_data; for (count = 0; count < m_typecount; count++) data16[count] = flipendian_int16(data16[count]); break; case 4: - data32 = (UINT32 *)m_data; + data32 = (uint32_t *)m_data; for (count = 0; count < m_typecount; count++) data32[count] = flipendian_int32(data32[count]); break; case 8: - data64 = (UINT64 *)m_data; + data64 = (uint64_t *)m_data; for (count = 0; count < m_typecount; count++) data64[count] = flipendian_int64(data64[count]); break; diff --git a/src/emu/save.h b/src/emu/save.h index 86c45c73e2f..dc527570acf 100644 --- a/src/emu/save.h +++ b/src/emu/save.h @@ -62,7 +62,7 @@ class state_entry { public: // construction/destruction - state_entry(void *data, const char *name, device_t *device, const char *module, const char *tag, int index, UINT8 size, UINT32 count); + state_entry(void *data, const char *name, device_t *device, const char *module, const char *tag, int index, uint8_t size, uint32_t count); // helpers void flip_data(); @@ -74,9 +74,9 @@ public: std::string m_module; // module name std::string m_tag; // tag name int m_index; // index - UINT8 m_typesize; // size of the raw data type - UINT32 m_typecount; // number of items - UINT32 m_offset; // offset within the final structure + uint8_t m_typesize; // size of the raw data type + uint32_t m_typecount; // number of items + uint32_t m_offset; // offset within the final structure }; class save_manager @@ -96,7 +96,7 @@ public: // registration control void allow_registration(bool allowed = true); - const char *indexed_item(int index, void *&base, UINT32 &valsize, UINT32 &valcount) const; + const char *indexed_item(int index, void *&base, uint32_t &valsize, uint32_t &valcount) const; // function registration void register_presave(save_prepost_delegate func); @@ -107,7 +107,7 @@ public: void dispatch_postload(); // generic memory registration - void save_memory(device_t *device, const char *module, const char *tag, UINT32 index, const char *name, void *val, UINT32 valsize, UINT32 valcount = 1); + void save_memory(device_t *device, const char *module, const char *tag, uint32_t index, const char *name, void *val, uint32_t valsize, uint32_t valcount = 1); // templatized wrapper for general objects template @@ -136,7 +136,7 @@ public: // templatized wrapper for pointers template - void save_pointer(device_t *device, const char *module, const char *tag, int index, _ItemType *value, const char *valname, UINT32 count) + void save_pointer(device_t *device, const char *module, const char *tag, int index, _ItemType *value, const char *valname, uint32_t count) { if (!type_checker<_ItemType>::is_atom) throw emu_fatalerror("Called save_item on a non-fundamental type!"); save_memory(device, module, tag, index, valname, value, sizeof(*value), count); @@ -146,7 +146,7 @@ public: template void save_item(_ItemType &value, const char *valname, int index = 0) { save_item(nullptr, "global", nullptr, index, value, valname); } template - void save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { save_pointer(nullptr, "global", nullptr, index, value, valname, count); } + void save_pointer(_ItemType *value, const char *valname, uint32_t count, int index = 0) { save_pointer(nullptr, "global", nullptr, index, value, valname, count); } // file processing static save_error check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...)); @@ -155,9 +155,9 @@ public: private: // internal helpers - UINT32 signature() const; + uint32_t signature() const; void dump_registry() const; - static save_error validate_header(const UINT8 *header, const char *gamename, UINT32 signature, void (CLIB_DECL *errormsg)(const char *fmt, ...), const char *error_prefix); + static save_error validate_header(const uint8_t *header, const char *gamename, uint32_t signature, void (CLIB_DECL *errormsg)(const char *fmt, ...), const char *error_prefix); // state callback item class state_callback @@ -183,14 +183,14 @@ private: // template specializations to enumerate the fundamental atomic types you are allowed to save ALLOW_SAVE_TYPE_AND_ARRAY(char) ALLOW_SAVE_TYPE (bool); // std::vector may be packed internally -ALLOW_SAVE_TYPE_AND_ARRAY(INT8) -ALLOW_SAVE_TYPE_AND_ARRAY(UINT8) -ALLOW_SAVE_TYPE_AND_ARRAY(INT16) -ALLOW_SAVE_TYPE_AND_ARRAY(UINT16) -ALLOW_SAVE_TYPE_AND_ARRAY(INT32) -ALLOW_SAVE_TYPE_AND_ARRAY(UINT32) -ALLOW_SAVE_TYPE_AND_ARRAY(INT64) -ALLOW_SAVE_TYPE_AND_ARRAY(UINT64) +ALLOW_SAVE_TYPE_AND_ARRAY(int8_t) +ALLOW_SAVE_TYPE_AND_ARRAY(uint8_t) +ALLOW_SAVE_TYPE_AND_ARRAY(int16_t) +ALLOW_SAVE_TYPE_AND_ARRAY(uint16_t) +ALLOW_SAVE_TYPE_AND_ARRAY(int32_t) +ALLOW_SAVE_TYPE_AND_ARRAY(uint32_t) +ALLOW_SAVE_TYPE_AND_ARRAY(int64_t) +ALLOW_SAVE_TYPE_AND_ARRAY(uint64_t) ALLOW_SAVE_TYPE_AND_ARRAY(PAIR) ALLOW_SAVE_TYPE_AND_ARRAY(PAIR64) ALLOW_SAVE_TYPE_AND_ARRAY(float) diff --git a/src/emu/schedule.cpp b/src/emu/schedule.cpp index b3eee925a3c..e02ba15e142 100644 --- a/src/emu/schedule.cpp +++ b/src/emu/schedule.cpp @@ -174,7 +174,7 @@ bool emu_timer::enable(bool enable) // firings //------------------------------------------------- -void emu_timer::adjust(attotime start_delay, INT32 param, const attotime &period) +void emu_timer::adjust(attotime start_delay, int32_t param, const attotime &period) { // if this is the callback timer, mark it modified device_scheduler &scheduler = machine().scheduler(); @@ -393,7 +393,7 @@ bool device_scheduler::can_save() const inline void device_scheduler::apply_suspend_changes() { - UINT32 suspendchanged = 0; + uint32_t suspendchanged = 0; for (device_execute_interface *exec = m_execute_list; exec != nullptr; exec = exec->m_nextexec) { suspendchanged |= exec->m_suspend ^ exec->m_nextsuspend; @@ -461,7 +461,7 @@ void device_scheduler::timeslice() if (delta >= exec->m_attoseconds_per_cycle) { // compute how many cycles we want to execute - int ran = exec->m_cycles_running = divu_64x32((UINT64)delta >> exec->m_divshift, exec->m_divisor); + int ran = exec->m_cycles_running = divu_64x32((uint64_t)delta >> exec->m_divshift, exec->m_divisor); LOG((" cpu '%s': %d (%d cycles)\n", exec->device().tag(), delta, exec->m_cycles_running)); // if we're not suspended, actually execute @@ -498,7 +498,7 @@ void device_scheduler::timeslice() attotime deltatime(0, exec->m_attoseconds_per_cycle * ran); assert(deltatime >= attotime::zero); exec->m_localtime += deltatime; - LOG((" %d ran, %d total, time = %s\n", ran, (INT32)exec->m_totalcycles, exec->m_localtime.as_string(PRECISION))); + LOG((" %d ran, %d total, time = %s\n", ran, (int32_t)exec->m_totalcycles, exec->m_localtime.as_string(PRECISION))); // if the new local CPU time is less than our target, move the target up, but not before the base if (exec->m_localtime < target) @@ -642,7 +642,7 @@ void device_scheduler::eat_all_cycles() // given amount of time //------------------------------------------------- -void device_scheduler::timed_trigger(void *ptr, INT32 param) +void device_scheduler::timed_trigger(void *ptr, int32_t param) { trigger(param); } diff --git a/src/emu/schedule.h b/src/emu/schedule.h index 1cda59cf75f..6eb050216fa 100644 --- a/src/emu/schedule.h +++ b/src/emu/schedule.h @@ -39,7 +39,7 @@ //************************************************************************** // timer callbacks look like this -typedef delegate timer_expired_delegate; +typedef delegate timer_expired_delegate; // ======================> emu_timer @@ -74,7 +74,7 @@ public: // control void reset(const attotime &duration = attotime::never) { adjust(duration, m_param, m_period); } - void adjust(attotime start_delay, INT32 param = 0, const attotime &periodicity = attotime::never); + void adjust(attotime start_delay, int32_t param = 0, const attotime &periodicity = attotime::never); // timing queries attotime elapsed() const; @@ -93,7 +93,7 @@ private: emu_timer * m_next; // next timer in order in the list emu_timer * m_prev; // previous timer in order in the list timer_expired_delegate m_callback; // callback function - INT32 m_param; // integer parameter + int32_t m_param; // integer parameter void * m_ptr; // pointer parameter bool m_enabled; // is the timer enabled? bool m_temporary; // is the timer temporary? @@ -149,7 +149,7 @@ public: private: // callbacks - void timed_trigger(void *ptr, INT32 param); + void timed_trigger(void *ptr, int32_t param); void presave(); void postload(); diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index f1a47766c87..bb172ad7a13 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -35,7 +35,7 @@ const device_type SCREEN = &device_creator; const attotime screen_device::DEFAULT_FRAME_PERIOD(attotime::from_hz(DEFAULT_FRAME_RATE)); -UINT32 screen_device::m_id_counter = 0; +uint32_t screen_device::m_id_counter = 0; class screen_device_svg_renderer { public: @@ -47,7 +47,7 @@ public: int render(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - static void output_notifier(const char *outname, INT32 value, void *param); + static void output_notifier(const char *outname, int32_t value, void *param); private: struct paired_entry { @@ -58,7 +58,7 @@ private: struct cached_bitmap { int x, y, sx, sy; - std::vector image; + std::vector image; std::vector pairs; }; @@ -75,16 +75,16 @@ private: int m_sx, m_sy; double m_scale; - std::vector m_background; + std::vector m_background; std::vector m_cache; - void output_change(const char *outname, INT32 value); - void render_state(std::vector &dest, const std::vector &state); + void output_change(const char *outname, int32_t value); + void render_state(std::vector &dest, const std::vector &state); void compute_initial_bboxes(std::vector &bboxes); bool compute_mask_intersection_bbox(int key1, int key2, bbox &bb) const; - void compute_diff_image(const std::vector &rend, const bbox &bb, cached_bitmap &dest) const; - void compute_dual_diff_image(const std::vector &rend, const bbox &bb, const cached_bitmap &src1, const cached_bitmap &src2, cached_bitmap &dest) const; + void compute_diff_image(const std::vector &rend, const bbox &bb, cached_bitmap &dest) const; + void compute_dual_diff_image(const std::vector &rend, const bbox &bb, const cached_bitmap &src1, const cached_bitmap &src2, cached_bitmap &dest) const; void rebuild_cache(); void blit(bitmap_rgb32 &bitmap, const cached_bitmap &src) const; }; @@ -153,7 +153,7 @@ int screen_device_svg_renderer::height() const return int(m_image->height + 0.5); } -void screen_device_svg_renderer::render_state(std::vector &dest, const std::vector &state) +void screen_device_svg_renderer::render_state(std::vector &dest, const std::vector &state) { for(int key = 0; key != m_key_count; key++) { if (state[key]) @@ -170,30 +170,30 @@ void screen_device_svg_renderer::render_state(std::vector &dest, const s // alpha to "blend" against a black background. Plus align the // channel order to what we do. - UINT8 *image = (UINT8 *)&dest[0]; + uint8_t *image = (uint8_t *)&dest[0]; for(unsigned int pixel=0; pixel != m_sy*m_sx; pixel++) { - UINT8 r = image[0]; - UINT8 g = image[1]; - UINT8 b = image[2]; - UINT8 a = image[3]; + uint8_t r = image[0]; + uint8_t g = image[1]; + uint8_t b = image[2]; + uint8_t a = image[3]; if(a != 0xff) { r = r*a/255; g = g*a/255; b = b*a/255; } - UINT32 color = 0xff000000 | (r << 16) | (g << 8) | (b << 0); - *(UINT32 *)image = color; + uint32_t color = 0xff000000 | (r << 16) | (g << 8) | (b << 0); + *(uint32_t *)image = color; image += 4; } } void screen_device_svg_renderer::blit(bitmap_rgb32 &bitmap, const cached_bitmap &src) const { - const UINT32 *s = &src.image[0]; + const uint32_t *s = &src.image[0]; for(int y=0; y(param)->output_change(outname, value); } -void screen_device_svg_renderer::output_change(const char *outname, INT32 value) +void screen_device_svg_renderer::output_change(const char *outname, int32_t value) { auto l = m_key_ids.find(outname); if (l == m_key_ids.end()) @@ -300,13 +300,13 @@ void screen_device_svg_renderer::compute_initial_bboxes(std::vector &bboxe } } -void screen_device_svg_renderer::compute_diff_image(const std::vector &rend, const bbox &bb, cached_bitmap &dest) const +void screen_device_svg_renderer::compute_diff_image(const std::vector &rend, const bbox &bb, cached_bitmap &dest) const { int x0, y0, x1, y1; x0 = y0 = x1 = y1 = -1; for(int y = bb.y0; y != bb.y1; y++) { - const UINT32 *src1 = &m_background[bb.x0 + y * m_sx]; - const UINT32 *src2 = &rend[bb.x0 + y * m_sx]; + const uint32_t *src1 = &m_background[bb.x0 + y * m_sx]; + const uint32_t *src2 = &rend[bb.x0 + y * m_sx]; for(int x = bb.x0; x != bb.x1; x++) { if(*src1 != *src2) { if(x0 == -1) { @@ -337,10 +337,10 @@ void screen_device_svg_renderer::compute_diff_image(const std::vector &r dest.sx = x1+1-x0; dest.sy = y1+1-y0; dest.image.resize(dest.sx * dest.sy); - UINT32 *dst = &dest.image[0]; + uint32_t *dst = &dest.image[0]; for(int y = 0; y != dest.sy; y++) { - const UINT32 *src1 = &m_background[dest.x + (y + dest.y) * m_sx]; - const UINT32 *src2 = &rend[dest.x + (y + dest.y) * m_sx]; + const uint32_t *src1 = &m_background[dest.x + (y + dest.y) * m_sx]; + const uint32_t *src2 = &rend[dest.x + (y + dest.y) * m_sx]; for(int x = 0; x != dest.sx; x++) { if(*src1 != *src2) *dst = *src2; @@ -372,8 +372,8 @@ bool screen_device_svg_renderer::compute_mask_intersection_bbox(int key1, int ke x0 = y0 = x1 = y1 = -1; for(int y = cy0; y < cy1; y++) { - const UINT32 *src1 = &c1.image[(cx0 - c1.x) + c1.sx * (y - c1.y)]; - const UINT32 *src2 = &c2.image[(cx0 - c2.x) + c2.sx * (y - c2.y)]; + const uint32_t *src1 = &c1.image[(cx0 - c1.x) + c1.sx * (y - c1.y)]; + const uint32_t *src2 = &c2.image[(cx0 - c2.x) + c2.sx * (y - c2.y)]; for(int x = cx0; x < cx1; x++) { if(*src1 && *src2 && *src1 != *src2) { if(x0 == -1) { @@ -403,7 +403,7 @@ bool screen_device_svg_renderer::compute_mask_intersection_bbox(int key1, int ke return true; } -void screen_device_svg_renderer::compute_dual_diff_image(const std::vector &rend, const bbox &bb, const cached_bitmap &src1, const cached_bitmap &src2, cached_bitmap &dest) const +void screen_device_svg_renderer::compute_dual_diff_image(const std::vector &rend, const bbox &bb, const cached_bitmap &src1, const cached_bitmap &src2, cached_bitmap &dest) const { dest.x = bb.x0; dest.y = bb.y0; @@ -411,10 +411,10 @@ void screen_device_svg_renderer::compute_dual_diff_image(const std::vector rend(m_sx*m_sy); + std::vector rend(m_sx*m_sy); // Render the background, e.g. with everything off std::vector state(m_key_count); @@ -544,7 +544,7 @@ void screen_device_svg_renderer::rebuild_cache() // screen_device - constructor //------------------------------------------------- -screen_device::screen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +screen_device::screen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SCREEN, "Video Screen", tag, owner, clock, "screen", __FILE__), m_type(SCREEN_TYPE_RASTER), m_oldstyle_vblank_supplied(false), @@ -619,7 +619,7 @@ void screen_device::static_set_svg_region(device_t &device, const char *region) // to set the raw screen parameters //------------------------------------------------- -void screen_device::static_set_raw(device_t &device, UINT32 pixclock, UINT16 htotal, UINT16 hbend, UINT16 hbstart, UINT16 vtotal, UINT16 vbend, UINT16 vbstart) +void screen_device::static_set_raw(device_t &device, uint32_t pixclock, uint16_t htotal, uint16_t hbend, uint16_t hbstart, uint16_t vtotal, uint16_t vbend, uint16_t vbstart) { screen_device &screen = downcast(device); screen.m_clock = pixclock; @@ -660,7 +660,7 @@ void screen_device::static_set_vblank_time(device_t &device, attoseconds_t time) // the width/height of the screen //------------------------------------------------- -void screen_device::static_set_size(device_t &device, UINT16 width, UINT16 height) +void screen_device::static_set_size(device_t &device, uint16_t width, uint16_t height) { screen_device &screen = downcast(device); screen.m_width = width; @@ -673,7 +673,7 @@ void screen_device::static_set_size(device_t &device, UINT16 width, UINT16 heigh // set the visible area of the screen //------------------------------------------------- -void screen_device::static_set_visarea(device_t &device, INT16 minx, INT16 maxx, INT16 miny, INT16 maxy) +void screen_device::static_set_visarea(device_t &device, int16_t minx, int16_t maxx, int16_t miny, int16_t maxy) { downcast(device).m_visarea.set(minx, maxx, miny, maxy); } @@ -743,7 +743,7 @@ void screen_device::static_set_palette(device_t &device, const char *tag) // video attributes //------------------------------------------------- -void screen_device::static_set_video_attributes(device_t &device, UINT32 flags) +void screen_device::static_set_video_attributes(device_t &device, uint32_t flags) { screen_device &screen = downcast(device); screen.m_video_attributes = flags; @@ -844,9 +844,9 @@ void screen_device::device_start() // allocate raw textures m_texture[0] = machine().render().texture_alloc(); - m_texture[0]->set_osd_data((UINT64)((m_unique_id << 1) | 0)); + m_texture[0]->set_osd_data((uint64_t)((m_unique_id << 1) | 0)); m_texture[1] = machine().render().texture_alloc(); - m_texture[1]->set_osd_data((UINT64)((m_unique_id << 1) | 1)); + m_texture[1]->set_osd_data((uint64_t)((m_unique_id << 1) | 1)); // configure the default cliparea render_container::user_settings settings; @@ -1091,8 +1091,8 @@ void screen_device::realloc_screen_bitmaps() return; // determine effective size to allocate - INT32 effwidth = std::max(m_width, m_visarea.max_x + 1); - INT32 effheight = std::max(m_height, m_visarea.max_y + 1); + int32_t effwidth = std::max(m_width, m_visarea.max_x + 1); + int32_t effheight = std::max(m_height, m_visarea.max_y + 1); // reize all registered screen bitmaps for (auto &item : m_auto_bitmap_list) @@ -1177,7 +1177,7 @@ bool screen_device::update_partial(int scanline) LOG_PARTIAL_UPDATES(("updating %d-%d\n", clip.min_y, clip.max_y)); g_profiler.start(PROFILER_VIDEO); - UINT32 flags; + uint32_t flags; if (m_type != SCREEN_TYPE_SVG) { screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; @@ -1242,7 +1242,7 @@ void screen_device::update_now() // if the line before us was incomplete, we must do it in two pieces if (m_partial_scan_hpos > 0) { - INT32 save_scan = m_partial_scan_hpos; + int32_t save_scan = m_partial_scan_hpos; update_partial(current_vpos - 2); m_partial_scan_hpos = save_scan; @@ -1301,7 +1301,7 @@ void screen_device::update_now() LOG_PARTIAL_UPDATES(("doing scanline partial draw: Y %d X %d-%d\n", clip.max_y, clip.min_x, clip.max_x)); - UINT32 flags; + uint32_t flags; screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; switch (curbitmap.format()) { @@ -1585,8 +1585,8 @@ void screen_device::update_burnin() int dstheight = m_burnin.height(); int xstep = (srcwidth << 16) / dstwidth; int ystep = (srcheight << 16) / dstheight; - int xstart = ((UINT32)rand() % 32767) * xstep / 32767; - int ystart = ((UINT32)rand() % 32767) * ystep / 32767; + int xstart = ((uint32_t)rand() % 32767) * xstep / 32767; + int ystart = ((uint32_t)rand() % 32767) * ystep / 32767; int srcx, srcy; int x, y; @@ -1599,8 +1599,8 @@ void screen_device::update_burnin() bitmap_ind16 &srcbitmap = curbitmap.as_ind16(); for (y = 0, srcy = ystart; y < dstheight; y++, srcy += ystep) { - UINT64 *dst = &m_burnin.pix64(y); - const UINT16 *src = &srcbitmap.pix16(srcy >> 16); + uint64_t *dst = &m_burnin.pix64(y); + const uint16_t *src = &srcbitmap.pix16(srcy >> 16); const rgb_t *palette = m_palette->palette()->entry_list_adjusted(); for (x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep) { @@ -1617,8 +1617,8 @@ void screen_device::update_burnin() bitmap_rgb32 &srcbitmap = curbitmap.as_rgb32(); for (y = 0, srcy = ystart; y < dstheight; y++, srcy += ystep) { - UINT64 *dst = &m_burnin.pix64(y); - const UINT32 *src = &srcbitmap.pix32(srcy >> 16); + uint64_t *dst = &m_burnin.pix64(y); + const uint32_t *src = &srcbitmap.pix32(srcy >> 16); for (x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep) { rgb_t pixel = src[srcx >> 16]; @@ -1657,11 +1657,11 @@ void screen_device::finalize_burnin() int ystep = (srcheight << 16) / dstheight; // find the maximum value - UINT64 minval = ~(UINT64)0; - UINT64 maxval = 0; + uint64_t minval = ~(uint64_t)0; + uint64_t maxval = 0; for (int y = 0; y < srcheight; y++) { - UINT64 *src = &m_burnin.pix64(y); + uint64_t *src = &m_burnin.pix64(y); for (int x = 0; x < srcwidth; x++) { minval = std::min(minval, src[x]); @@ -1675,11 +1675,11 @@ void screen_device::finalize_burnin() // now normalize and convert to RGB for (int y = 0, srcy = 0; y < dstheight; y++, srcy += ystep) { - UINT64 *src = &m_burnin.pix64(srcy >> 16); - UINT32 *dst = &finalmap.pix32(y); + uint64_t *src = &m_burnin.pix64(srcy >> 16); + uint32_t *dst = &finalmap.pix32(y); for (int x = 0, srcx = 0; x < dstwidth; x++, srcx += xstep) { - int brightness = (UINT64)(maxval - src[srcx >> 16]) * 255 / (maxval - minval); + int brightness = (uint64_t)(maxval - src[srcx >> 16]) * 255 / (maxval - minval); dst[x] = rgb_t(0xff, brightness, brightness, brightness); } } diff --git a/src/emu/screen.h b/src/emu/screen.h index bfdc8367e72..8e0b34d7a27 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -46,7 +46,7 @@ enum texture_format }; // screen_update callback flags -const UINT32 UPDATE_HAS_NOT_CHANGED = 0x0001; // the video has not changed +const uint32_t UPDATE_HAS_NOT_CHANGED = 0x0001; // the video has not changed /*! @defgroup flags for video_attributes @@ -124,11 +124,11 @@ public: bitmap_rgb32 &as_rgb32() { assert(m_format == BITMAP_FORMAT_RGB32); return m_rgb32; } // getters - INT32 width() const { return live().width(); } - INT32 height() const { return live().height(); } - INT32 rowpixels() const { return live().rowpixels(); } - INT32 rowbytes() const { return live().rowbytes(); } - UINT8 bpp() const { return live().bpp(); } + int32_t width() const { return live().width(); } + int32_t height() const { return live().height(); } + int32_t rowpixels() const { return live().rowpixels(); } + int32_t rowbytes() const { return live().rowbytes(); } + uint8_t bpp() const { return live().bpp(); } bitmap_format format() const { return m_format; } texture_format texformat() const { return m_texformat; } bool valid() const { return live().valid(); } @@ -165,8 +165,8 @@ private: typedef delegate vblank_state_delegate; -typedef device_delegate screen_update_ind16_delegate; -typedef device_delegate screen_update_rgb32_delegate; +typedef device_delegate screen_update_ind16_delegate; +typedef device_delegate screen_update_rgb32_delegate; typedef device_delegate screen_vblank_delegate; @@ -181,7 +181,7 @@ class screen_device : public device_t public: // construction/destruction - screen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + screen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~screen_device(); // configuration readers @@ -202,17 +202,17 @@ public: // inline configuration helpers static void static_set_type(device_t &device, screen_type_enum type); - static void static_set_raw(device_t &device, UINT32 pixclock, UINT16 htotal, UINT16 hbend, UINT16 hbstart, UINT16 vtotal, UINT16 vbend, UINT16 vbstart); + static void static_set_raw(device_t &device, uint32_t pixclock, uint16_t htotal, uint16_t hbend, uint16_t hbstart, uint16_t vtotal, uint16_t vbend, uint16_t vbstart); static void static_set_refresh(device_t &device, attoseconds_t rate); static void static_set_vblank_time(device_t &device, attoseconds_t time); - static void static_set_size(device_t &device, UINT16 width, UINT16 height); - static void static_set_visarea(device_t &device, INT16 minx, INT16 maxx, INT16 miny, INT16 maxy); + static void static_set_size(device_t &device, uint16_t width, uint16_t height); + static void static_set_visarea(device_t &device, int16_t minx, int16_t maxx, int16_t miny, int16_t maxy); static void static_set_default_position(device_t &device, double xscale, double xoffs, double yscale, double yoffs); static void static_set_screen_update(device_t &device, screen_update_ind16_delegate callback); static void static_set_screen_update(device_t &device, screen_update_rgb32_delegate callback); static void static_set_screen_vblank(device_t &device, screen_vblank_delegate callback); static void static_set_palette(device_t &device, const char *tag); - static void static_set_video_attributes(device_t &device, UINT32 flags); + static void static_set_video_attributes(device_t &device, uint32_t flags); static void static_set_color(device_t &device, rgb_t color); static void static_set_svg_region(device_t &device, const char *region); @@ -226,7 +226,7 @@ public: void configure(int width, int height, const rectangle &visarea, attoseconds_t frame_period); void reset_origin(int beamy = 0, int beamx = 0); void set_visible_area(int min_x, int max_x, int min_y, int max_y); - void set_brightness(UINT8 brightness) { m_brightness = brightness; } + void set_brightness(uint8_t brightness) { m_brightness = brightness; } // beam positioning and state int vpos() const; @@ -242,7 +242,7 @@ public: attotime time_until_update() const { return (m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); } attotime scan_period() const { return attotime(0, m_scantime); } attotime frame_period() const { return attotime(0, m_frame_period); } - UINT64 frame_number() const { return m_frame_number; } + uint64_t frame_number() const { return m_frame_number; } // updating int partial_updates() const { return m_partial_updates_this_frame; } @@ -299,7 +299,7 @@ private: screen_update_rgb32_delegate m_screen_update_rgb32; // screen update callback (32-bit RGB) screen_vblank_delegate m_screen_vblank; // screen vblank callback optional_device m_palette; // our palette - UINT32 m_video_attributes; // flags describing the video system + uint32_t m_video_attributes; // flags describing the video system const char * m_svg_region; // the region in which the svg data is in // internal state @@ -316,15 +316,15 @@ private: screen_bitmap m_bitmap[2]; // 2x bitmaps for rendering bitmap_ind8 m_priority; // priority bitmap bitmap_ind64 m_burnin; // burn-in bitmap - UINT8 m_curbitmap; // current bitmap index - UINT8 m_curtexture; // current texture index + uint8_t m_curbitmap; // current bitmap index + uint8_t m_curtexture; // current texture index bool m_changed; // has this bitmap changed? - INT32 m_last_partial_scan; // scanline of last partial update - INT32 m_partial_scan_hpos; // horizontal pixel last rendered on this partial scanline + int32_t m_last_partial_scan; // scanline of last partial update + int32_t m_partial_scan_hpos; // horizontal pixel last rendered on this partial scanline bitmap_argb32 m_screen_overlay_bitmap; // screen overlay bitmap - UINT32 m_unique_id; // unique id for this screen_device + uint32_t m_unique_id; // unique id for this screen_device rgb_t m_color; // render color - UINT8 m_brightness; // global brightness + uint8_t m_brightness; // global brightness // screen timing attoseconds_t m_frame_period; // attoseconds per frame @@ -337,8 +337,8 @@ private: emu_timer * m_vblank_end_timer; // timer to signal VBLANK end emu_timer * m_scanline0_timer; // scanline 0 timer emu_timer * m_scanline_timer; // scanline timer - UINT64 m_frame_number; // the current frame number - UINT32 m_partial_updates_this_frame;// partial update counter this frame + uint64_t m_frame_number; // the current frame number + uint32_t m_partial_updates_this_frame;// partial update counter this frame // VBLANK callbacks class callback_item @@ -362,7 +362,7 @@ private: std::vector> m_auto_bitmap_list; // list of registered bitmaps // static data - static UINT32 m_id_counter; // incremented for each constructed screen_device, + static uint32_t m_id_counter; // incremented for each constructed screen_device, // used as a unique identifier during runtime }; @@ -524,13 +524,13 @@ typedef device_type_iterator<&device_creator, screen_device> scre //------------------------------------------------- template -inline screen_update_ind16_delegate screen_update_delegate_smart(UINT32 (_FunctionClass::*callback)(screen_device &, bitmap_ind16 &, const rectangle &), const char *name, const char *devname) +inline screen_update_ind16_delegate screen_update_delegate_smart(uint32_t (_FunctionClass::*callback)(screen_device &, bitmap_ind16 &, const rectangle &), const char *name, const char *devname) { return screen_update_ind16_delegate(callback, name, devname, (_FunctionClass *)nullptr); } template -inline screen_update_rgb32_delegate screen_update_delegate_smart(UINT32 (_FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, const rectangle &), const char *name, const char *devname) +inline screen_update_rgb32_delegate screen_update_delegate_smart(uint32_t (_FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, const rectangle &), const char *name, const char *devname) { return screen_update_rgb32_delegate(callback, name, devname, (_FunctionClass *)nullptr); } diff --git a/src/emu/softlist.cpp b/src/emu/softlist.cpp index dc433a54507..bb03a9e2800 100644 --- a/src/emu/softlist.cpp +++ b/src/emu/softlist.cpp @@ -204,7 +204,7 @@ softlist_parser::softlist_parser(util::core_file &file, const std::string &filen char buffer[1024]; while (!m_done) { - UINT32 length = m_file.read(buffer, sizeof(buffer)); + uint32_t length = m_file.read(buffer, sizeof(buffer)); m_done = m_file.eof(); if (XML_Parse(m_parser, buffer, length, m_done) == XML_STATUS_ERROR) { @@ -341,7 +341,7 @@ bool softlist_parser::parse_name_and_value(const char **attributes, std::string // current part's list //------------------------------------------------- -void softlist_parser::add_rom_entry(std::string &&name, std::string &&hashdata, UINT32 offset, UINT32 length, UINT32 flags) +void softlist_parser::add_rom_entry(std::string &&name, std::string &&hashdata, uint32_t offset, uint32_t length, uint32_t flags) { // get the current part if (m_current_part == nullptr) @@ -597,7 +597,7 @@ void softlist_parser::parse_part_start(const char *tagname, const char **attribu // handle region attributes const std::string &width = attrvalues[2]; const std::string &endianness = attrvalues[3]; - UINT32 regionflags = ROMENTRYTYPE_REGION; + uint32_t regionflags = ROMENTRYTYPE_REGION; if (!width.empty()) { @@ -689,8 +689,8 @@ void softlist_parser::parse_data_start(const char *tagname, const char **attribu const std::string &loadflag = attrvalues[7]; if (!sizestr.empty() && !offsetstr.empty()) { - UINT32 length = strtol(sizestr.c_str(), nullptr, 0); - UINT32 offset = strtol(offsetstr.c_str(), nullptr, 0); + uint32_t length = strtol(sizestr.c_str(), nullptr, 0); + uint32_t offset = strtol(offsetstr.c_str(), nullptr, 0); if (loadflag == "reload") add_rom_entry("", "", offset, length, ROMENTRYTYPE_RELOAD | ROM_INHERITFLAGS); @@ -740,7 +740,7 @@ void softlist_parser::parse_data_start(const char *tagname, const char **attribu } else if (!sizestr.empty() && !loadflag.empty() && loadflag == "ignore") { - UINT32 length = strtol(sizestr.c_str(), nullptr, 0); + uint32_t length = strtol(sizestr.c_str(), nullptr, 0); add_rom_entry("", "", 0, length, ROMENTRYTYPE_IGNORE | ROM_INHERITFLAGS); } else diff --git a/src/emu/softlist.h b/src/emu/softlist.h index a303a819f26..84face381bd 100644 --- a/src/emu/softlist.h +++ b/src/emu/softlist.h @@ -120,7 +120,7 @@ public: const std::string &publisher() const { return m_publisher; } const std::list &other_info() const { return m_other_info; } const std::list &shared_info() const { return m_shared_info; } - UINT32 supported() const { return m_supported; } + uint32_t supported() const { return m_supported; } const std::list &parts() const { return m_partdata; } // additional operations @@ -129,7 +129,7 @@ public: private: // internal state - UINT32 m_supported; + uint32_t m_supported; std::string m_shortname; std::string m_longname; std::string m_parentname; @@ -174,7 +174,7 @@ private: // internal helpers template std::vector parse_attributes(const char **attributes, const T &attrlist); bool parse_name_and_value(const char **attributes, std::string &name, std::string &value); - void add_rom_entry(std::string &&name, std::string &&hashdata, UINT32 offset, UINT32 length, UINT32 flags); + void add_rom_entry(std::string &&name, std::string &&hashdata, uint32_t offset, uint32_t length, uint32_t flags); // expat callbacks static void start_handler(void *data, const char *tagname, const char **attributes); diff --git a/src/emu/softlist_dev.cpp b/src/emu/softlist_dev.cpp index 8532b611e5a..8b3fe027cb0 100644 --- a/src/emu/softlist_dev.cpp +++ b/src/emu/softlist_dev.cpp @@ -78,7 +78,7 @@ bool image_software_list_loader::load_software(device_image_interface &device, s // software_list_device - constructor //------------------------------------------------- -software_list_device::software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +software_list_device::software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SOFTWARE_LIST, "Software list", tag, owner, clock, "software_list", __FILE__), m_list_type(SOFTWARE_LIST_ORIGINAL_SYSTEM), m_filter(nullptr), @@ -505,7 +505,7 @@ void software_list_device::internal_validity_check(validity_checker &valid) // make sure the year is only digits, '?' or '+' for (char ch : swinfo.year()) - if (!isdigit(UINT8(ch)) && (ch != '?') && (ch != '+')) + if (!isdigit(uint8_t(ch)) && (ch != '?') && (ch != '+')) { osd_printf_error("%s: %s has an invalid year '%s'\n", filename(), shortname.c_str(), swinfo.year().c_str()); break; diff --git a/src/emu/softlist_dev.h b/src/emu/softlist_dev.h index 3703516cbdf..384f0b2a22e 100644 --- a/src/emu/softlist_dev.h +++ b/src/emu/softlist_dev.h @@ -132,7 +132,7 @@ class software_list_device : public device_t public: // construction/destruction - software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + software_list_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, const char *list, softlist_type list_type); diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp index 70415f7532f..b90e390b141 100644 --- a/src/emu/sound.cpp +++ b/src/emu/sound.cpp @@ -265,7 +265,7 @@ void sound_stream::update() { // determine the number of samples since the start of this second attotime time = m_device.machine().time(); - INT32 update_sampindex = INT32(time.attoseconds() / m_attoseconds_per_sample); + int32_t update_sampindex = int32_t(time.attoseconds() / m_attoseconds_per_sample); // if we're ahead of the last update, then adjust upwards attotime last_update = m_device.machine().sound().last_update(); @@ -294,7 +294,7 @@ void sound_stream::update() } -void sound_stream::sync_update(void *, INT32) +void sound_stream::sync_update(void *, int32_t) { update(); attotime time = m_device.machine().time(); @@ -384,7 +384,7 @@ void sound_stream::update_with_accounting(bool second_tick) // if we've ticked over another second, adjust all the counters that are relative to // the current second - INT32 output_bufindex = m_output_sampindex - m_output_base_sampindex; + int32_t output_bufindex = m_output_sampindex - m_output_base_sampindex; if (second_tick) { m_output_sampindex -= m_sample_rate; @@ -398,7 +398,7 @@ void sound_stream::update_with_accounting(bool second_tick) // we need to shuffle things down if (m_output_bufalloc - output_bufindex < 2 * m_max_samples_per_update) { - INT32 samples_to_lose = output_bufindex - m_max_samples_per_update; + int32_t samples_to_lose = output_bufindex - m_max_samples_per_update; if (samples_to_lose > 0) { // if we have samples to move, do so for each output @@ -427,7 +427,7 @@ void sound_stream::apply_sample_rate_changes() return; // update to the new rate and remember the old rate - UINT32 old_rate = m_sample_rate; + uint32_t old_rate = m_sample_rate; m_sample_rate = m_new_sample_rate; m_new_sample_rate = 0; @@ -435,8 +435,8 @@ void sound_stream::apply_sample_rate_changes() recompute_sample_rate_data(); // reset our sample indexes to the current time - m_output_sampindex = (INT64)m_output_sampindex * (INT64)m_sample_rate / old_rate; - m_output_update_sampindex = (INT64)m_output_update_sampindex * (INT64)m_sample_rate / old_rate; + m_output_sampindex = (int64_t)m_output_sampindex * (int64_t)m_sample_rate / old_rate; + m_output_update_sampindex = (int64_t)m_output_update_sampindex * (int64_t)m_sample_rate / old_rate; m_output_base_sampindex = m_output_sampindex - m_max_samples_per_update; // clear out the buffer @@ -527,7 +527,7 @@ void sound_stream::recompute_sample_rate_data() void sound_stream::allocate_resample_buffers() { // compute the target number of samples - INT32 bufsize = 2 * m_max_samples_per_update; + int32_t bufsize = 2 * m_max_samples_per_update; // if we don't have enough room, allocate more if (m_resample_bufalloc < bufsize) @@ -553,7 +553,7 @@ void sound_stream::allocate_resample_buffers() void sound_stream::allocate_output_buffers() { // if we don't have enough room, allocate more - INT32 bufsize = OUTPUT_BUFFER_UPDATES * m_max_samples_per_update; + int32_t bufsize = OUTPUT_BUFFER_UPDATES * m_max_samples_per_update; if (m_output_bufalloc < bufsize) { // this becomes the new allocation size @@ -647,7 +647,7 @@ void sound_stream::generate_samples(int samples) // resample buffer for a given input //------------------------------------------------- -stream_sample_t *sound_stream::generate_resampled_data(stream_input &input, UINT32 numsamples) +stream_sample_t *sound_stream::generate_resampled_data(stream_input &input, uint32_t numsamples) { // if we don't have an output to pull data from, generate silence stream_sample_t *dest = &input.m_resample[0]; @@ -660,14 +660,14 @@ stream_sample_t *sound_stream::generate_resampled_data(stream_input &input, UINT // grab data from the output stream_output &output = *input.m_source; sound_stream &input_stream = *output.m_stream; - INT64 gain = (input.m_gain * input.m_user_gain * output.m_gain) >> 16; + int64_t gain = (input.m_gain * input.m_user_gain * output.m_gain) >> 16; // determine the time at which the current sample begins, accounting for the // latency we calculated between the input and output streams attoseconds_t basetime = m_output_sampindex * m_attoseconds_per_sample - input.m_latency_attoseconds; // now convert that time into a sample in the input stream - INT32 basesample; + int32_t basesample; if (basetime >= 0) basesample = basetime / input_stream.m_attoseconds_per_sample; else @@ -679,11 +679,11 @@ stream_sample_t *sound_stream::generate_resampled_data(stream_input &input, UINT // determine the current fraction of a sample, expressed as a fraction of FRAC_ONE // (Note: this formula is valid as long as input_stream.m_attoseconds_per_sample signficantly exceeds FRAC_ONE > attoseconds = 4.2E-12 s) - UINT32 basefrac = (basetime - basesample * input_stream.m_attoseconds_per_sample) / ((input_stream.m_attoseconds_per_sample + FRAC_ONE - 1) >> FRAC_BITS); + uint32_t basefrac = (basetime - basesample * input_stream.m_attoseconds_per_sample) / ((input_stream.m_attoseconds_per_sample + FRAC_ONE - 1) >> FRAC_BITS); assert(basefrac < FRAC_ONE); // compute the stepping fraction - UINT32 step = (UINT64(input_stream.m_sample_rate) << FRAC_BITS) / m_sample_rate; + uint32_t step = (uint64_t(input_stream.m_sample_rate) << FRAC_BITS) / m_sample_rate; // if we have equal sample rates, we just need to copy if (step == FRAC_ONE) @@ -691,7 +691,7 @@ stream_sample_t *sound_stream::generate_resampled_data(stream_input &input, UINT while (numsamples--) { // compute the sample - INT64 sample = *source++; + int64_t sample = *source++; *dest++ = (sample * gain) >> 8; } } @@ -710,7 +710,7 @@ stream_sample_t *sound_stream::generate_resampled_data(stream_input &input, UINT } // if we're done, we're done - if (INT32(numsamples--) < 0) + if (int32_t(numsamples--) < 0) break; // compute starting and ending fractional positions @@ -718,7 +718,7 @@ stream_sample_t *sound_stream::generate_resampled_data(stream_input &input, UINT int endfrac = nextfrac >> (FRAC_BITS - 12); // blend between the two samples accordingly - INT64 sample = ((INT64) source[0] * (0x1000 - startfrac) + (INT64) source[1] * (endfrac - 0x1000)) / (endfrac - startfrac); + int64_t sample = ((int64_t) source[0] * (0x1000 - startfrac) + (int64_t) source[1] * (endfrac - 0x1000)) / (endfrac - startfrac); *dest++ = (sample * gain) >> 8; // advance @@ -734,19 +734,19 @@ stream_sample_t *sound_stream::generate_resampled_data(stream_input &input, UINT int smallstep = step >> (FRAC_BITS - 8); while (numsamples--) { - INT64 remainder = smallstep; + int64_t remainder = smallstep; int tpos = 0; // compute the sample - INT64 scale = (FRAC_ONE - basefrac) >> (FRAC_BITS - 8); - INT64 sample = (INT64) source[tpos++] * scale; + int64_t scale = (FRAC_ONE - basefrac) >> (FRAC_BITS - 8); + int64_t sample = (int64_t) source[tpos++] * scale; remainder -= scale; while (remainder > 0x100) { - sample += (INT64) source[tpos++] * (INT64) 0x100; + sample += (int64_t) source[tpos++] * (int64_t) 0x100; remainder -= 0x100; } - sample += (INT64) source[tpos] * remainder; + sample += (int64_t) source[tpos] * remainder; sample /= smallstep; *dest++ = (sample * gain) >> 8; @@ -941,7 +941,7 @@ bool sound_manager::indexed_mixer_input(int index, mixer_input &info) const // mute - mute sound output //------------------------------------------------- -void sound_manager::mute(bool mute, UINT8 reason) +void sound_manager::mute(bool mute, uint8_t reason) { if (mute) m_muted |= reason; @@ -1063,16 +1063,16 @@ void sound_manager::update(void *ptr, int param) speaker.mix(&m_leftmix[0], &m_rightmix[0], samples_this_update, (m_muted & MUTE_REASON_SYSTEM)!=0); // now downmix the final result - UINT32 finalmix_step = machine().video().speed_factor(); - UINT32 finalmix_offset = 0; - INT16 *finalmix = &m_finalmix[0]; + uint32_t finalmix_step = machine().video().speed_factor(); + uint32_t finalmix_offset = 0; + int16_t *finalmix = &m_finalmix[0]; int sample; for (sample = m_finalmix_leftover; sample < samples_this_update * 1000; sample += finalmix_step) { int sampindex = sample / 1000; // clamp the left side - INT32 samp = m_leftmix[sampindex]; + int32_t samp = m_leftmix[sampindex]; if (samp < -32768) samp = -32768; else if (samp > 32767) diff --git a/src/emu/sound.h b/src/emu/sound.h index c60ac53a628..7fe244b2694 100644 --- a/src/emu/sound.h +++ b/src/emu/sound.h @@ -68,7 +68,7 @@ class sound_stream sound_stream * m_stream; // owning stream std::vector m_buffer; // output buffer int m_dependents; // number of dependents - INT16 m_gain; // gain to apply to the output + int16_t m_gain; // gain to apply to the output }; // stream input class @@ -83,15 +83,15 @@ class sound_stream stream_output * m_source; // pointer to the sound_output for this source std::vector m_resample; // buffer for resampling to the stream's sample rate attoseconds_t m_latency_attoseconds; // latency between this stream and the input stream - INT16 m_gain; // gain to apply to this input - INT16 m_user_gain; // user-controlled gain to apply to this input + int16_t m_gain; // gain to apply to this input + int16_t m_user_gain; // user-controlled gain to apply to this input }; // constants static const int OUTPUT_BUFFER_UPDATES = 5; - static const UINT32 FRAC_BITS = 22; - static const UINT32 FRAC_ONE = 1 << FRAC_BITS; - static const UINT32 FRAC_MASK = FRAC_ONE - 1; + static const uint32_t FRAC_BITS = 22; + static const uint32_t FRAC_ONE = 1 << FRAC_BITS; + static const uint32_t FRAC_MASK = FRAC_ONE - 1; public: // construction/destruction @@ -134,21 +134,21 @@ private: void allocate_output_buffers(); void postload(); void generate_samples(int samples); - stream_sample_t *generate_resampled_data(stream_input &input, UINT32 numsamples); - void sync_update(void *, INT32); + stream_sample_t *generate_resampled_data(stream_input &input, uint32_t numsamples); + void sync_update(void *, int32_t); // linking information device_t & m_device; // owning device sound_stream * m_next; // next stream in the chain // general information - UINT32 m_sample_rate; // sample rate of this stream - UINT32 m_new_sample_rate; // newly-set sample rate for the stream + uint32_t m_sample_rate; // sample rate of this stream + uint32_t m_new_sample_rate; // newly-set sample rate for the stream bool m_synchronous; // synchronous stream that runs at the rate of its input // timing information attoseconds_t m_attoseconds_per_sample; // number of attoseconds per sample - INT32 m_max_samples_per_update; // maximum samples per update + int32_t m_max_samples_per_update; // maximum samples per update emu_timer * m_sync_timer; // update timer for synchronous streams // input information @@ -156,17 +156,17 @@ private: std::vector m_input_array; // array of inputs for passing to the callback // resample buffer information - UINT32 m_resample_bufalloc; // allocated size of each resample buffer + uint32_t m_resample_bufalloc; // allocated size of each resample buffer // output information std::vector m_output; // list of streams which directly depend upon us std::vector m_output_array; // array of outputs for passing to the callback // output buffer information - UINT32 m_output_bufalloc; // allocated size of each output buffer - INT32 m_output_sampindex; // current position within each output buffer - INT32 m_output_update_sampindex; // position at time of last global update - INT32 m_output_base_sampindex; // sample at base of buffer, relative to the current emulated second + uint32_t m_output_bufalloc; // allocated size of each output buffer + int32_t m_output_sampindex; // current position within each output buffer + int32_t m_output_update_sampindex; // position at time of last global update + int32_t m_output_base_sampindex; // sample at base of buffer, relative to the current emulated second // callback information stream_update_delegate m_callback; // callback function @@ -180,10 +180,10 @@ class sound_manager friend class sound_stream; // reasons for muting - static const UINT8 MUTE_REASON_PAUSE = 0x01; - static const UINT8 MUTE_REASON_UI = 0x02; - static const UINT8 MUTE_REASON_DEBUGGER = 0x04; - static const UINT8 MUTE_REASON_SYSTEM = 0x08; + static const uint8_t MUTE_REASON_PAUSE = 0x01; + static const uint8_t MUTE_REASON_UI = 0x02; + static const uint8_t MUTE_REASON_DEBUGGER = 0x04; + static const uint8_t MUTE_REASON_SYSTEM = 0x08; // stream updates static const attotime STREAMS_UPDATE_ATTOTIME; @@ -219,25 +219,25 @@ public: private: // internal helpers - void mute(bool mute, UINT8 reason); + void mute(bool mute, uint8_t reason); void reset(); void pause(); void resume(); void config_load(config_type cfg_type, xml_data_node *parentnode); void config_save(config_type cfg_type, xml_data_node *parentnode); - void update(void *ptr = nullptr, INT32 param = 0); + void update(void *ptr = nullptr, int32_t param = 0); // internal state running_machine & m_machine; // reference to our machine emu_timer * m_update_timer; // timer to drive periodic updates - UINT32 m_finalmix_leftover; - std::vector m_finalmix; - std::vector m_leftmix; - std::vector m_rightmix; + uint32_t m_finalmix_leftover; + std::vector m_finalmix; + std::vector m_leftmix; + std::vector m_rightmix; - UINT8 m_muted; + uint8_t m_muted; int m_attenuation; int m_nosound_mode; diff --git a/src/emu/speaker.cpp b/src/emu/speaker.cpp index 0583b9f84a7..23a29217922 100644 --- a/src/emu/speaker.cpp +++ b/src/emu/speaker.cpp @@ -39,7 +39,7 @@ const device_type SPEAKER = &device_creator; // speaker_device - constructor //------------------------------------------------- -speaker_device::speaker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +speaker_device::speaker_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SPEAKER, "Speaker", tag, owner, clock, "speaker", __FILE__), device_mixer_interface(mconfig, *this), m_x(0.0), @@ -87,7 +87,7 @@ void speaker_device::static_set_position(device_t &device, double x, double y, d // mix - mix in samples from the speaker's stream //------------------------------------------------- -void speaker_device::mix(INT32 *leftmix, INT32 *rightmix, int &samples_this_update, bool suppress) +void speaker_device::mix(int32_t *leftmix, int32_t *rightmix, int &samples_this_update, bool suppress) { // skip if no stream if (m_mixer_stream == nullptr) diff --git a/src/emu/speaker.h b/src/emu/speaker.h index dc814a26911..0260b5fe2ac 100644 --- a/src/emu/speaker.h +++ b/src/emu/speaker.h @@ -57,14 +57,14 @@ class speaker_device : public device_t, public: // construction/destruction - speaker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + speaker_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~speaker_device(); // inline configuration helpers static void static_set_position(device_t &device, double x, double y, double z); // internally for use by the sound system - void mix(INT32 *leftmix, INT32 *rightmix, int &samples_this_update, bool suppress); + void mix(int32_t *leftmix, int32_t *rightmix, int &samples_this_update, bool suppress); protected: // device-level overrides @@ -77,9 +77,9 @@ protected: // internal state #ifdef MAME_DEBUG - INT32 m_max_sample; // largest sample value we've seen - INT32 m_clipped_samples; // total number of clipped samples - INT32 m_total_samples; // total number of samples + int32_t m_max_sample; // largest sample value we've seen + int32_t m_clipped_samples; // total number of clipped samples + int32_t m_total_samples; // total number of samples #endif }; diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp index 066475bd12e..b910f30c177 100644 --- a/src/emu/tilemap.cpp +++ b/src/emu/tilemap.cpp @@ -21,14 +21,14 @@ // account tilemap flip states //------------------------------------------------- -inline INT32 tilemap_t::effective_rowscroll(int index, UINT32 screen_width) +inline int32_t tilemap_t::effective_rowscroll(int index, uint32_t screen_width) { // if we're flipping vertically, adjust the row number if (m_attributes & TILEMAP_FLIPY) index = m_scrollrows - 1 - index; // adjust final result based on the horizontal flip and dx values - INT32 value; + int32_t value; if (!(m_attributes & TILEMAP_FLIPX)) value = m_dx - m_rowscroll[index]; else @@ -49,14 +49,14 @@ inline INT32 tilemap_t::effective_rowscroll(int index, UINT32 screen_width) // account tilemap flip states //------------------------------------------------- -inline INT32 tilemap_t::effective_colscroll(int index, UINT32 screen_height) +inline int32_t tilemap_t::effective_colscroll(int index, uint32_t screen_height) { // if we're flipping horizontally, adjust the column number if (m_attributes & TILEMAP_FLIPX) index = m_scrollcols - 1 - index; // adjust final result based on the vertical flip and dx values - INT32 value; + int32_t value; if (!(m_attributes & TILEMAP_FLIPY)) value = m_dy - m_colscroll[index]; else @@ -79,7 +79,7 @@ inline INT32 tilemap_t::effective_colscroll(int index, UINT32 screen_height) inline bool tilemap_t::gfx_elements_changed() { - UINT32 usedmask = m_gfx_used; + uint32_t usedmask = m_gfx_used; bool isdirty = false; // iterate over all used gfx types and set the dirty flag if any of them have changed @@ -104,7 +104,7 @@ inline bool tilemap_t::gfx_elements_changed() // bitmap, setting priority only //------------------------------------------------- -inline void tilemap_t::scanline_draw_opaque_null(int count, UINT8 *pri, UINT32 pcode) +inline void tilemap_t::scanline_draw_opaque_null(int count, uint8_t *pri, uint32_t pcode) { // skip entirely if not changing priority if (pcode == 0xff00) @@ -121,7 +121,7 @@ inline void tilemap_t::scanline_draw_opaque_null(int count, UINT8 *pri, UINT32 p // bitmap using a mask, setting priority only //------------------------------------------------- -inline void tilemap_t::scanline_draw_masked_null(const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode) +inline void tilemap_t::scanline_draw_masked_null(const uint8_t *maskptr, int mask, int value, int count, uint8_t *pri, uint32_t pcode) { // skip entirely if not changing priority if (pcode == 0xff00) @@ -140,7 +140,7 @@ inline void tilemap_t::scanline_draw_masked_null(const UINT8 *maskptr, int mask, // indexed bitmap //------------------------------------------------- -inline void tilemap_t::scanline_draw_opaque_ind16(UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode) +inline void tilemap_t::scanline_draw_opaque_ind16(uint16_t *dest, const uint16_t *source, int count, uint8_t *pri, uint32_t pcode) { // special case for no palette offset int pal = pcode >> 16; @@ -182,7 +182,7 @@ inline void tilemap_t::scanline_draw_opaque_ind16(UINT16 *dest, const UINT16 *so // indexed bitmap using a mask //------------------------------------------------- -inline void tilemap_t::scanline_draw_masked_ind16(UINT16 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode) +inline void tilemap_t::scanline_draw_masked_ind16(uint16_t *dest, const uint16_t *source, const uint8_t *maskptr, int mask, int value, int count, uint8_t *pri, uint32_t pcode) { int pal = pcode >> 16; @@ -213,7 +213,7 @@ inline void tilemap_t::scanline_draw_masked_ind16(UINT16 *dest, const UINT16 *so // RGB bitmap //------------------------------------------------- -inline void tilemap_t::scanline_draw_opaque_rgb32(UINT32 *dest, const UINT16 *source, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode) +inline void tilemap_t::scanline_draw_opaque_rgb32(uint32_t *dest, const uint16_t *source, int count, const rgb_t *pens, uint8_t *pri, uint32_t pcode) { const rgb_t *clut = &pens[pcode >> 16]; @@ -241,7 +241,7 @@ inline void tilemap_t::scanline_draw_opaque_rgb32(UINT32 *dest, const UINT16 *so // RGB bitmap using a mask //------------------------------------------------- -inline void tilemap_t::scanline_draw_masked_rgb32(UINT32 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode) +inline void tilemap_t::scanline_draw_masked_rgb32(uint32_t *dest, const uint16_t *source, const uint8_t *maskptr, int mask, int value, int count, const rgb_t *pens, uint8_t *pri, uint32_t pcode) { const rgb_t *clut = &pens[pcode >> 16]; @@ -271,7 +271,7 @@ inline void tilemap_t::scanline_draw_masked_rgb32(UINT32 *dest, const UINT16 *so // 32bpp RGB bitmap with alpha blending //------------------------------------------------- -inline void tilemap_t::scanline_draw_opaque_rgb32_alpha(UINT32 *dest, const UINT16 *source, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) +inline void tilemap_t::scanline_draw_opaque_rgb32_alpha(uint32_t *dest, const uint16_t *source, int count, const rgb_t *pens, uint8_t *pri, uint32_t pcode, uint8_t alpha) { const rgb_t *clut = &pens[pcode >> 16]; @@ -300,7 +300,7 @@ inline void tilemap_t::scanline_draw_opaque_rgb32_alpha(UINT32 *dest, const UINT // blending //------------------------------------------------- -inline void tilemap_t::scanline_draw_masked_rgb32_alpha(UINT32 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) +inline void tilemap_t::scanline_draw_masked_rgb32_alpha(uint32_t *dest, const uint16_t *source, const uint8_t *maskptr, int mask, int value, int count, const rgb_t *pens, uint8_t *pri, uint32_t pcode, uint8_t alpha) { const rgb_t *clut = &pens[pcode >> 16]; @@ -343,7 +343,7 @@ tilemap_t::tilemap_t() // init - initialize the tilemap //------------------------------------------------- -tilemap_t &tilemap_t::init(tilemap_manager &manager, device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, UINT16 tilewidth, UINT16 tileheight, UINT32 cols, UINT32 rows) +tilemap_t &tilemap_t::init(tilemap_manager &manager, device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, uint16_t tilewidth, uint16_t tileheight, uint32_t cols, uint32_t rows) { // populate managers and devices m_manager = &manager; @@ -463,7 +463,7 @@ void tilemap_t::mark_tile_dirty(tilemap_memory_index memindex) // a layer //------------------------------------------------- -void tilemap_t::map_pens_to_layer(int group, pen_t pen, pen_t mask, UINT8 layermask) +void tilemap_t::map_pens_to_layer(int group, pen_t pen, pen_t mask, uint8_t layermask) { assert(group < TILEMAP_NUM_GROUPS); assert((layermask & TILEMAP_PIXEL_CATEGORY_MASK) == 0); @@ -478,7 +478,7 @@ void tilemap_t::map_pens_to_layer(int group, pen_t pen, pen_t mask, UINT8 layerm stop = std::min(stop, MAX_PEN_TO_FLAGS - 1); // iterate and set - UINT8 *array = m_pen_to_flags + group * MAX_PEN_TO_FLAGS; + uint8_t *array = m_pen_to_flags + group * MAX_PEN_TO_FLAGS; bool changed = false; for (pen_t cur = start; cur <= stop; cur++) if ((cur & mask) == pen && array[cur] != layermask) @@ -515,13 +515,13 @@ void tilemap_t::set_transparent_pen(pen_t pen) // background mask (mapping to layer 1) //------------------------------------------------- -void tilemap_t::set_transmask(int group, UINT32 fgmask, UINT32 bgmask) +void tilemap_t::set_transmask(int group, uint32_t fgmask, uint32_t bgmask) { // iterate over all 32 pens specified for (pen_t pen = 0; pen < 32; pen++) { - UINT8 fgbits = ((fgmask >> pen) & 1) ? TILEMAP_PIXEL_TRANSPARENT : TILEMAP_PIXEL_LAYER0; - UINT8 bgbits = ((bgmask >> pen) & 1) ? TILEMAP_PIXEL_TRANSPARENT : TILEMAP_PIXEL_LAYER1; + uint8_t fgbits = ((fgmask >> pen) & 1) ? TILEMAP_PIXEL_TRANSPARENT : TILEMAP_PIXEL_LAYER0; + uint8_t bgbits = ((bgmask >> pen) & 1) ? TILEMAP_PIXEL_TRANSPARENT : TILEMAP_PIXEL_LAYER1; map_pen_to_layer(group, pen, fgbits | bgbits); } } @@ -538,7 +538,7 @@ void tilemap_t::configure_groups(gfx_element &gfx, indirect_pen_t transcolor) assert(gfx.colors() <= TILEMAP_NUM_GROUPS); // iterate over all colors in the tilemap - for (UINT32 color = 0; color < gfx.colors(); color++) + for (uint32_t color = 0; color < gfx.colors(); color++) set_transmask(color, m_palette->transpen_mask(gfx, color, transcolor), 0); } @@ -556,22 +556,22 @@ void tilemap_t::configure_groups(gfx_element &gfx, indirect_pen_t transcolor) // order with optional flipping //------------------------------------------------- -tilemap_memory_index tilemap_t::scan_rows(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) +tilemap_memory_index tilemap_t::scan_rows(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows) { return row * num_cols + col; } -tilemap_memory_index tilemap_t::scan_rows_flip_x(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) +tilemap_memory_index tilemap_t::scan_rows_flip_x(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows) { return row * num_cols + (num_cols - 1 - col); } -tilemap_memory_index tilemap_t::scan_rows_flip_y(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) +tilemap_memory_index tilemap_t::scan_rows_flip_y(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows) { return (num_rows - 1 - row) * num_cols + col; } -tilemap_memory_index tilemap_t::scan_rows_flip_xy(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) +tilemap_memory_index tilemap_t::scan_rows_flip_xy(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows) { return (num_rows - 1 - row) * num_cols + (num_cols - 1 - col); } @@ -585,22 +585,22 @@ tilemap_memory_index tilemap_t::scan_rows_flip_xy(UINT32 col, UINT32 row, UINT32 // major order with optional flipping //------------------------------------------------- -tilemap_memory_index tilemap_t::scan_cols(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) +tilemap_memory_index tilemap_t::scan_cols(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows) { return col * num_rows + row; } -tilemap_memory_index tilemap_t::scan_cols_flip_x(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) +tilemap_memory_index tilemap_t::scan_cols_flip_x(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows) { return (num_cols - 1 - col) * num_rows + row; } -tilemap_memory_index tilemap_t::scan_cols_flip_y(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) +tilemap_memory_index tilemap_t::scan_cols_flip_y(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows) { return col * num_rows + (num_rows - 1 - row); } -tilemap_memory_index tilemap_t::scan_cols_flip_xy(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) +tilemap_memory_index tilemap_t::scan_cols_flip_xy(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows) { return (num_cols - 1 - col) * num_rows + (num_rows - 1 - row); } @@ -634,8 +634,8 @@ void tilemap_t::mappings_create() // compute the maximum memory index tilemap_memory_index max_memory_index = 0; - for (UINT32 row = 0; row < m_rows; row++) - for (UINT32 col = 0; col < m_cols; col++) + for (uint32_t row = 0; row < m_rows; row++) + for (uint32_t col = 0; col < m_cols; col++) { tilemap_memory_index memindex = memory_index(col, row); max_memory_index = std::max(max_memory_index, memindex); @@ -665,8 +665,8 @@ void tilemap_t::mappings_update() // now iterate over all logical indexes and populate the memory index for (logical_index logindex = 0; logindex < m_logical_to_memory.size(); logindex++) { - UINT32 logical_col = logindex % m_cols; - UINT32 logical_row = logindex / m_cols; + uint32_t logical_col = logindex % m_cols; + uint32_t logical_row = logindex / m_cols; tilemap_memory_index memindex = memory_index(logical_col, logical_row); // apply tilemap flip to get the final location to store @@ -674,7 +674,7 @@ void tilemap_t::mappings_update() logical_col = (m_cols - 1) - logical_col; if (m_attributes & TILEMAP_FLIPY) logical_row = (m_rows - 1) - logical_row; - UINT32 flipped_logindex = logical_row * m_cols + logical_col; + uint32_t flipped_logindex = logical_row * m_cols + logical_col; // fill in entries in both arrays m_memory_to_logical[memindex] = flipped_logindex; @@ -724,8 +724,8 @@ g_profiler.start(PROFILER_TILEMAP_DRAW); // iterate over rows and columns logical_index logindex = 0; - for (UINT32 row = 0; row < m_rows; row++) - for (UINT32 col = 0; col < m_cols; col++, logindex++) + for (uint32_t row = 0; row < m_rows; row++) + for (uint32_t col = 0; col < m_cols; col++, logindex++) if (m_tileflags[logindex] == TILE_FLAG_DIRTY) tile_update(logindex, col, row); @@ -740,7 +740,7 @@ g_profiler.stop(); // tile_update - update a single dirty tile //------------------------------------------------- -void tilemap_t::tile_update(logical_index logindex, UINT32 col, UINT32 row) +void tilemap_t::tile_update(logical_index logindex, uint32_t col, uint32_t row) { g_profiler.start(PROFILER_TILEMAP_UPDATE); @@ -749,11 +749,11 @@ g_profiler.start(PROFILER_TILEMAP_UPDATE); m_tile_get_info(*this, m_tileinfo, memindex); // apply the global tilemap flip to the returned flip flags - UINT32 flags = m_tileinfo.flags ^ (m_attributes & 0x03); + uint32_t flags = m_tileinfo.flags ^ (m_attributes & 0x03); // draw the tile, using either direct or transparent - UINT32 x0 = m_tilewidth * col; - UINT32 y0 = m_tileheight * row; + uint32_t x0 = m_tilewidth * col; + uint32_t y0 = m_tileheight * row; m_tileflags[logindex] = tile_draw(m_tileinfo.pen_data, x0, y0, m_tileinfo.palette_base, m_tileinfo.category, m_tileinfo.group, flags, m_tileinfo.pen_mask); @@ -779,7 +779,7 @@ g_profiler.stop(); // the palette_base //------------------------------------------------- -UINT8 tilemap_t::tile_draw(const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags, UINT8 pen_mask) +uint8_t tilemap_t::tile_draw(const uint8_t *pendata, uint32_t x0, uint32_t y0, uint32_t palette_base, uint8_t category, uint8_t group, uint8_t flags, uint8_t pen_mask) { // OR in the force layer flags category |= flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2); @@ -801,22 +801,22 @@ UINT8 tilemap_t::tile_draw(const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 pa } // iterate over rows - const UINT8 *penmap = m_pen_to_flags + group * MAX_PEN_TO_FLAGS; - UINT8 andmask = ~0, ormask = 0; - for (UINT16 ty = 0; ty < m_tileheight; ty++) + const uint8_t *penmap = m_pen_to_flags + group * MAX_PEN_TO_FLAGS; + uint8_t andmask = ~0, ormask = 0; + for (uint16_t ty = 0; ty < m_tileheight; ty++) { - UINT16 *pixptr = &m_pixmap.pix16(y0, x0); - UINT8 *flagsptr = &m_flagsmap.pix8(y0, x0); + uint16_t *pixptr = &m_pixmap.pix16(y0, x0); + uint8_t *flagsptr = &m_flagsmap.pix8(y0, x0); // pre-advance to the next row y0 += dy0; // 8bpp data int xoffs = 0; - for (UINT16 tx = 0; tx < m_tilewidth; tx++) + for (uint16_t tx = 0; tx < m_tilewidth; tx++) { - UINT8 pen = (*pendata++) & pen_mask; - UINT8 map = penmap[pen]; + uint8_t pen = (*pendata++) & pen_mask; + uint8_t map = penmap[pen]; pixptr[xoffs] = palette_base + pen; flagsptr[xoffs] = map | category; andmask &= map; @@ -834,7 +834,7 @@ UINT8 tilemap_t::tile_draw(const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 pa // flagsmap appropriately //------------------------------------------------- -UINT8 tilemap_t::tile_apply_bitmask(const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags) +uint8_t tilemap_t::tile_apply_bitmask(const uint8_t *maskdata, uint32_t x0, uint32_t y0, uint8_t category, uint8_t flags) { // if we're vertically flipped, point to the bottom row and work backwards int dy0 = 1; @@ -853,19 +853,19 @@ UINT8 tilemap_t::tile_apply_bitmask(const UINT8 *maskdata, UINT32 x0, UINT32 y0, } // iterate over rows - UINT8 andmask = ~0, ormask = 0; + uint8_t andmask = ~0, ormask = 0; int bitoffs = 0; - for (UINT16 ty = 0; ty < m_tileheight; ty++) + for (uint16_t ty = 0; ty < m_tileheight; ty++) { // pre-advance to the next row - UINT8 *flagsptr = &m_flagsmap.pix8(y0, x0); + uint8_t *flagsptr = &m_flagsmap.pix8(y0, x0); y0 += dy0; // anywhere the bitmask is 0 should be transparent int xoffs = 0; - for (UINT16 tx = 0; tx < m_tilewidth; tx++) + for (uint16_t tx = 0; tx < m_tilewidth; tx++) { - UINT8 map = flagsptr[xoffs]; + uint8_t map = flagsptr[xoffs]; if ((maskdata[bitoffs / 8] & (0x80 >> (bitoffs & 7))) == 0) map = flagsptr[xoffs] = TILEMAP_PIXEL_TRANSPARENT | category; @@ -891,7 +891,7 @@ UINT8 tilemap_t::tile_apply_bitmask(const UINT8 *maskdata, UINT32 x0, UINT32 y0, // and indexed drawing code //------------------------------------------------- -void tilemap_t::configure_blit_parameters(blit_parameters &blit, bitmap_ind8 &priority_bitmap, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask) +void tilemap_t::configure_blit_parameters(blit_parameters &blit, bitmap_ind8 &priority_bitmap, const rectangle &cliprect, uint32_t flags, uint8_t priority, uint8_t priority_mask) { // set the target bitmap blit.priority = &priority_bitmap; @@ -936,7 +936,7 @@ void tilemap_t::configure_blit_parameters(blit_parameters &blit, bitmap_ind8 &pr //------------------------------------------------- template -void tilemap_t::draw_common(screen_device &screen, _BitmapClass &dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask) +void tilemap_t::draw_common(screen_device &screen, _BitmapClass &dest, const rectangle &cliprect, uint32_t flags, uint8_t priority, uint8_t priority_mask) { // skip if disabled if (!m_enable) @@ -952,8 +952,8 @@ g_profiler.start(PROFILER_TILEMAP_DRAW); // flip the tilemap around the center of the visible area rectangle visarea = screen.visible_area(); - UINT32 width = visarea.min_x + visarea.max_x + 1; - UINT32 height = visarea.min_y + visarea.max_y + 1; + uint32_t width = visarea.min_x + visarea.max_x + 1; + uint32_t height = visarea.min_y + visarea.max_y + 1; // XY scrolling playfield if (m_scrollrows == 1 && m_scrollcols == 1) @@ -977,7 +977,7 @@ g_profiler.start(PROFILER_TILEMAP_DRAW); for (int ypos = scrolly - m_height; ypos <= original_cliprect.max_y; ypos += m_height) { int const firstrow = std::max((original_cliprect.min_y - ypos) / rowheight, 0); - int const lastrow = std::min((original_cliprect.max_y - ypos) / rowheight, INT32(m_scrollrows) - 1); + int const lastrow = std::min((original_cliprect.max_y - ypos) / rowheight, int32_t(m_scrollrows) - 1); // iterate over rows in the tilemap int nextrow; @@ -1043,10 +1043,10 @@ g_profiler.start(PROFILER_TILEMAP_DRAW); g_profiler.stop(); } -void tilemap_t::draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask) +void tilemap_t::draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, uint32_t flags, uint8_t priority, uint8_t priority_mask) { draw_common(screen, dest, cliprect, flags, priority, priority_mask); } -void tilemap_t::draw(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask) +void tilemap_t::draw(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t flags, uint8_t priority, uint8_t priority_mask) { draw_common(screen, dest, cliprect, flags, priority, priority_mask); } @@ -1059,11 +1059,11 @@ void tilemap_t::draw(screen_device &screen, bitmap_rgb32 &dest, const rectangle template void tilemap_t::draw_roz_common(screen_device &screen, _BitmapClass &dest, const rectangle &cliprect, - UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, - bool wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask) + uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, + bool wraparound, uint32_t flags, uint8_t priority, uint8_t priority_mask) { // notes: -// - startx and starty MUST be UINT32 for calculations to work correctly +// - startx and starty MUST be uint32_t for calculations to work correctly // - srcbim_width and height are assumed to be a power of 2 to speed up wraparound // skip if disabled @@ -1093,13 +1093,13 @@ g_profiler.stop(); } void tilemap_t::draw_roz(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, - UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, - bool wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask) + uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, + bool wraparound, uint32_t flags, uint8_t priority, uint8_t priority_mask) { draw_roz_common(screen, dest, cliprect, startx, starty, incxx, incxy, incyx, incyy, wraparound, flags, priority, priority_mask); } void tilemap_t::draw_roz(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, - UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, - bool wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask) + uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, + bool wraparound, uint32_t flags, uint8_t priority, uint8_t priority_mask) { draw_roz_common(screen, dest, cliprect, startx, starty, incxx, incxy, incyx, incyy, wraparound, flags, priority, priority_mask); } @@ -1125,7 +1125,7 @@ void tilemap_t::draw_instance(screen_device &screen, _BitmapClass &dest, const b // look up priority and destination base addresses for y1 bitmap_ind8 &priority_bitmap = *blit.priority; - UINT8 *priority_baseaddr = &priority_bitmap.pix8(y1, xpos); + uint8_t *priority_baseaddr = &priority_bitmap.pix8(y1, xpos); typename _BitmapClass::pixel_t *dest_baseaddr = nullptr; int dest_rowpixels = 0; if (dest.valid()) @@ -1141,8 +1141,8 @@ void tilemap_t::draw_instance(screen_device &screen, _BitmapClass &dest, const b y2 -= ypos; // get tilemap pixels - const UINT16 *source_baseaddr = &m_pixmap.pix16(y1); - const UINT8 *mask_baseaddr = &m_flagsmap.pix8(y1); + const uint16_t *source_baseaddr = &m_pixmap.pix16(y1); + const uint8_t *mask_baseaddr = &m_flagsmap.pix8(y1); // get start/stop columns, rounding outward int mincol = x1 / m_tilewidth; @@ -1201,9 +1201,9 @@ void tilemap_t::draw_instance(screen_device &screen, _BitmapClass &dest, const b const rgb_t *clut = m_palette->palette()->entry_list_adjusted(); if (prev_trans != WHOLLY_TRANSPARENT) { - const UINT16 *source0 = source_baseaddr + x_start; + const uint16_t *source0 = source_baseaddr + x_start; typename _BitmapClass::pixel_t *dest0 = dest_baseaddr + x_start; - UINT8 *pmap0 = priority_baseaddr + x_start; + uint8_t *pmap0 = priority_baseaddr + x_start; // if we were opaque, use the opaque renderer if (prev_trans == WHOLLY_OPAQUE) @@ -1213,11 +1213,11 @@ void tilemap_t::draw_instance(screen_device &screen, _BitmapClass &dest, const b if (dest_baseaddr == nullptr) scanline_draw_opaque_null(x_end - x_start, pmap0, blit.tilemap_priority_code); else if (sizeof(*dest0) == 2) - scanline_draw_opaque_ind16(reinterpret_cast(dest0), source0, x_end - x_start, pmap0, blit.tilemap_priority_code); + scanline_draw_opaque_ind16(reinterpret_cast(dest0), source0, x_end - x_start, pmap0, blit.tilemap_priority_code); else if (sizeof(*dest0) == 4 && blit.alpha >= 0xff) - scanline_draw_opaque_rgb32(reinterpret_cast(dest0), source0, x_end - x_start, clut, pmap0, blit.tilemap_priority_code); + scanline_draw_opaque_rgb32(reinterpret_cast(dest0), source0, x_end - x_start, clut, pmap0, blit.tilemap_priority_code); else if (sizeof(*dest0) == 4) - scanline_draw_opaque_rgb32_alpha(reinterpret_cast(dest0), source0, x_end - x_start, clut, pmap0, blit.tilemap_priority_code, blit.alpha); + scanline_draw_opaque_rgb32_alpha(reinterpret_cast(dest0), source0, x_end - x_start, clut, pmap0, blit.tilemap_priority_code, blit.alpha); dest0 += dest_rowpixels; source0 += m_pixmap.rowpixels(); @@ -1228,17 +1228,17 @@ void tilemap_t::draw_instance(screen_device &screen, _BitmapClass &dest, const b // otherwise use the masked renderer else { - const UINT8 *mask0 = mask_baseaddr + x_start; + const uint8_t *mask0 = mask_baseaddr + x_start; for (int cury = y; cury < nexty; cury++) { if (dest_baseaddr == nullptr) scanline_draw_masked_null(mask0, blit.mask, blit.value, x_end - x_start, pmap0, blit.tilemap_priority_code); else if (sizeof(*dest0) == 2) - scanline_draw_masked_ind16(reinterpret_cast(dest0), source0, mask0, blit.mask, blit.value, x_end - x_start, pmap0, blit.tilemap_priority_code); + scanline_draw_masked_ind16(reinterpret_cast(dest0), source0, mask0, blit.mask, blit.value, x_end - x_start, pmap0, blit.tilemap_priority_code); else if (sizeof(*dest0) == 4 && blit.alpha >= 0xff) - scanline_draw_masked_rgb32(reinterpret_cast(dest0), source0, mask0, blit.mask, blit.value, x_end - x_start, clut, pmap0, blit.tilemap_priority_code); + scanline_draw_masked_rgb32(reinterpret_cast(dest0), source0, mask0, blit.mask, blit.value, x_end - x_start, clut, pmap0, blit.tilemap_priority_code); else if (sizeof(*dest0) == 4) - scanline_draw_masked_rgb32_alpha(reinterpret_cast(dest0), source0, mask0, blit.mask, blit.value, x_end - x_start, clut, pmap0, blit.tilemap_priority_code, blit.alpha); + scanline_draw_masked_rgb32_alpha(reinterpret_cast(dest0), source0, mask0, blit.mask, blit.value, x_end - x_start, clut, pmap0, blit.tilemap_priority_code, blit.alpha); dest0 += dest_rowpixels; source0 += m_pixmap.rowpixels(); @@ -1289,7 +1289,7 @@ do { \ template void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, const blit_parameters &blit, - UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound) + uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, bool wraparound) { // pre-cache all the inner loop values const rgb_t *clut = m_palette->palette()->entry_list_adjusted() + (blit.tilemap_priority_code >> 16); @@ -1298,10 +1298,10 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c const int ymask = m_pixmap.height() - 1; const int widthshifted = m_pixmap.width() << 16; const int heightshifted = m_pixmap.height() << 16; - UINT32 priority = blit.tilemap_priority_code; - UINT8 mask = blit.mask; - UINT8 value = blit.value; - UINT8 alpha = blit.alpha; + uint32_t priority = blit.tilemap_priority_code; + uint8_t mask = blit.mask; + uint8_t value = blit.value; + uint8_t alpha = blit.alpha; // pre-advance based on the cliprect startx += blit.cliprect.min_x * incxx + blit.cliprect.min_y * incyx; @@ -1335,13 +1335,13 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c { // initialize X counters int x = sx; - UINT32 cx = startx; - UINT32 cy = starty >> 16; + uint32_t cx = startx; + uint32_t cy = starty >> 16; // get source and priority pointers - UINT8 *pri = &priority_bitmap.pix8(sy, sx); - const UINT16 *src = &m_pixmap.pix16(cy); - const UINT8 *maskptr = &m_flagsmap.pix8(cy); + uint8_t *pri = &priority_bitmap.pix8(sy, sx); + const uint16_t *src = &m_pixmap.pix16(cy); + const uint8_t *maskptr = &m_flagsmap.pix8(cy); typename _BitmapClass::pixel_t *dest = &destbitmap.pix(sy, sx); // loop over columns @@ -1376,12 +1376,12 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c { // initialize X counters int x = sx; - UINT32 cx = startx; - UINT32 cy = starty; + uint32_t cx = startx; + uint32_t cy = starty; // get dest and priority pointers typename _BitmapClass::pixel_t *dest = &destbitmap.pix(sy, sx); - UINT8 *pri = &priority_bitmap.pix8(sy, sx); + uint8_t *pri = &priority_bitmap.pix8(sy, sx); // loop over columns while (x <= ex) @@ -1416,12 +1416,12 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c { // initialize X counters int x = sx; - UINT32 cx = startx; - UINT32 cy = starty; + uint32_t cx = startx; + uint32_t cy = starty; // get dest and priority pointers typename _BitmapClass::pixel_t *dest = &destbitmap.pix(sy, sx); - UINT8 *pri = &priority_bitmap.pix8(sy, sx); + uint8_t *pri = &priority_bitmap.pix8(sy, sx); // loop over columns while (x <= ex) @@ -1456,7 +1456,7 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c // rowscroll and with fixed parameters //------------------------------------------------- -void tilemap_t::draw_debug(screen_device &screen, bitmap_rgb32 &dest, UINT32 scrollx, UINT32 scrolly) +void tilemap_t::draw_debug(screen_device &screen, bitmap_rgb32 &dest, uint32_t scrollx, uint32_t scrolly) { // set up for the blit, using hard-coded parameters (no priority, etc) blit_parameters blit; @@ -1481,7 +1481,7 @@ void tilemap_t::draw_debug(screen_device &screen, bitmap_rgb32 &dest, UINT32 scr // get_info_debug - extract info for one tile //------------------------------------------------- -void tilemap_t::get_info_debug(UINT32 col, UINT32 row, UINT8 &gfxnum, UINT32 &code, UINT32 &color) +void tilemap_t::get_info_debug(uint32_t col, uint32_t row, uint8_t &gfxnum, uint32_t &code, uint32_t &color) { // first map to the memory index tilemap_memory_index memindex = memory_index(col, row); @@ -1542,14 +1542,14 @@ tilemap_manager::~tilemap_manager() // tilemaps //------------------------------------------------- -tilemap_t &tilemap_manager::create(device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, UINT16 tilewidth, UINT16 tileheight, UINT32 cols, UINT32 rows, tilemap_t *allocated) +tilemap_t &tilemap_manager::create(device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, uint16_t tilewidth, uint16_t tileheight, uint32_t cols, uint32_t rows, tilemap_t *allocated) { if (allocated == nullptr) allocated = global_alloc(tilemap_t); return m_tilemap_list.append(allocated->init(*this, decoder, tile_get_info, mapper, tilewidth, tileheight, cols, rows)); } -tilemap_t &tilemap_manager::create(device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_standard_mapper mapper, UINT16 tilewidth, UINT16 tileheight, UINT32 cols, UINT32 rows, tilemap_t *allocated) +tilemap_t &tilemap_manager::create(device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_standard_mapper mapper, uint16_t tilewidth, uint16_t tileheight, uint32_t cols, uint32_t rows, tilemap_t *allocated) { if (allocated == nullptr) allocated = global_alloc(tilemap_t); @@ -1574,7 +1574,7 @@ tilemap_t &tilemap_manager::create(device_gfx_interface &decoder, tilemap_get_in // tilemaps //------------------------------------------------- -void tilemap_manager::set_flip_all(UINT32 attributes) +void tilemap_manager::set_flip_all(uint32_t attributes) { for (tilemap_t &tmap : m_tilemap_list) tmap.set_flip(attributes); @@ -1605,7 +1605,7 @@ const device_type TILEMAP = &device_creator; // tilemap_device - constructor //------------------------------------------------- -tilemap_device::tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tilemap_device::tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TILEMAP, "Tilemap", tag, owner, clock, "tilemap", __FILE__), m_gfxdecode(*this, finder_base::DUMMY_TAG), m_standard_mapper(TILEMAP_STANDARD_COUNT), @@ -1658,7 +1658,7 @@ void tilemap_device::static_set_info_callback(device_t &device, tilemap_get_info // layout //------------------------------------------------- -void tilemap_device::static_set_layout(device_t &device, tilemap_standard_mapper mapper, UINT32 columns, UINT32 rows) +void tilemap_device::static_set_layout(device_t &device, tilemap_standard_mapper mapper, uint32_t columns, uint32_t rows) { tilemap_device &target = downcast(device); target.m_standard_mapper = mapper; @@ -1666,7 +1666,7 @@ void tilemap_device::static_set_layout(device_t &device, tilemap_standard_mapper target.m_num_rows = rows; } -void tilemap_device::static_set_layout(device_t &device, tilemap_mapper_delegate mapper, UINT32 columns, UINT32 rows) +void tilemap_device::static_set_layout(device_t &device, tilemap_mapper_delegate mapper, uint32_t columns, uint32_t rows) { tilemap_device &target = downcast(device); target.m_standard_mapper = TILEMAP_STANDARD_COUNT; @@ -1680,7 +1680,7 @@ void tilemap_device::static_set_layout(device_t &device, tilemap_mapper_delegate // static_set_tile_size: Set the tile size //------------------------------------------------- -void tilemap_device::static_set_tile_size(device_t &device, UINT16 width, UINT16 height) +void tilemap_device::static_set_tile_size(device_t &device, uint16_t width, uint16_t height) { tilemap_device &target = downcast(device); target.m_tile_width = width; diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h index 8759ed2ea9e..99e4b7c83ee 100644 --- a/src/emu/tilemap.h +++ b/src/emu/tilemap.h @@ -163,17 +163,17 @@ behind or in front of sprites. tilemap_t *tmap; - UINT16 *my_tmap_memory; + uint16_t *my_tmap_memory; required_device gfxdecode; TILE_GET_INFO_MEMBER( my_state::my_get_info ) { - UINT16 tiledata = my_tmap_memory[tile_index]; - UINT8 code = tiledata & 0xff; - UINT8 color = (tiledata >> 8) & 0x1f; - UINT8 flipx = (tiledata >> 13) & 1; - UINT8 flipy = (tiledata >> 14) & 1; - UINT8 category = (tiledata >> 15) & 1; + uint16_t tiledata = my_tmap_memory[tile_index]; + uint8_t code = tiledata & 0xff; + uint8_t color = (tiledata >> 8) & 0x1f; + uint8_t flipx = (tiledata >> 13) & 1; + uint8_t flipy = (tiledata >> 14) & 1; + uint8_t category = (tiledata >> 15) & 1; // set the common info for the tile tileinfo.set( @@ -204,7 +204,7 @@ tmap.set_transparent_pen(0); } - UINT32 my_state::screen_update_mydriver( + uint32_t my_state::screen_update_mydriver( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -317,34 +317,34 @@ // these flags control tilemap_t::draw() behavior -const UINT32 TILEMAP_DRAW_CATEGORY_MASK = 0x0f; // specify the category to draw -const UINT32 TILEMAP_DRAW_LAYER0 = 0x10; // draw layer 0 -const UINT32 TILEMAP_DRAW_LAYER1 = 0x20; // draw layer 1 -const UINT32 TILEMAP_DRAW_LAYER2 = 0x40; // draw layer 2 -const UINT32 TILEMAP_DRAW_OPAQUE = 0x80; // draw everything, even transparent stuff -const UINT32 TILEMAP_DRAW_ALPHA_FLAG = 0x100; // draw with alpha blending (in the upper 8 bits) -const UINT32 TILEMAP_DRAW_ALL_CATEGORIES = 0x200; // draw all categories +const uint32_t TILEMAP_DRAW_CATEGORY_MASK = 0x0f; // specify the category to draw +const uint32_t TILEMAP_DRAW_LAYER0 = 0x10; // draw layer 0 +const uint32_t TILEMAP_DRAW_LAYER1 = 0x20; // draw layer 1 +const uint32_t TILEMAP_DRAW_LAYER2 = 0x40; // draw layer 2 +const uint32_t TILEMAP_DRAW_OPAQUE = 0x80; // draw everything, even transparent stuff +const uint32_t TILEMAP_DRAW_ALPHA_FLAG = 0x100; // draw with alpha blending (in the upper 8 bits) +const uint32_t TILEMAP_DRAW_ALL_CATEGORIES = 0x200; // draw all categories // per-pixel flags in the transparency_bitmap -const UINT8 TILEMAP_PIXEL_CATEGORY_MASK = 0x0f; // category is stored in the low 4 bits -const UINT8 TILEMAP_PIXEL_TRANSPARENT = 0x00; // transparent if in none of the layers below -const UINT8 TILEMAP_PIXEL_LAYER0 = 0x10; // pixel is opaque in layer 0 -const UINT8 TILEMAP_PIXEL_LAYER1 = 0x20; // pixel is opaque in layer 1 -const UINT8 TILEMAP_PIXEL_LAYER2 = 0x40; // pixel is opaque in layer 2 +const uint8_t TILEMAP_PIXEL_CATEGORY_MASK = 0x0f; // category is stored in the low 4 bits +const uint8_t TILEMAP_PIXEL_TRANSPARENT = 0x00; // transparent if in none of the layers below +const uint8_t TILEMAP_PIXEL_LAYER0 = 0x10; // pixel is opaque in layer 0 +const uint8_t TILEMAP_PIXEL_LAYER1 = 0x20; // pixel is opaque in layer 1 +const uint8_t TILEMAP_PIXEL_LAYER2 = 0x40; // pixel is opaque in layer 2 // per-tile flags, set by get_tile_info callback -const UINT8 TILE_FLIPX = 0x01; // draw this tile horizontally flipped -const UINT8 TILE_FLIPY = 0x02; // draw this tile vertically flipped -const UINT8 TILE_FORCE_LAYER0 = TILEMAP_PIXEL_LAYER0; // force all pixels to be layer 0 (no transparency) -const UINT8 TILE_FORCE_LAYER1 = TILEMAP_PIXEL_LAYER1; // force all pixels to be layer 1 (no transparency) -const UINT8 TILE_FORCE_LAYER2 = TILEMAP_PIXEL_LAYER2; // force all pixels to be layer 2 (no transparency) +const uint8_t TILE_FLIPX = 0x01; // draw this tile horizontally flipped +const uint8_t TILE_FLIPY = 0x02; // draw this tile vertically flipped +const uint8_t TILE_FORCE_LAYER0 = TILEMAP_PIXEL_LAYER0; // force all pixels to be layer 0 (no transparency) +const uint8_t TILE_FORCE_LAYER1 = TILEMAP_PIXEL_LAYER1; // force all pixels to be layer 1 (no transparency) +const uint8_t TILE_FORCE_LAYER2 = TILEMAP_PIXEL_LAYER2; // force all pixels to be layer 2 (no transparency) // tilemap global flags, used by tilemap_t::set_flip() -const UINT32 TILEMAP_FLIPX = TILE_FLIPX; // draw the tilemap horizontally flipped -const UINT32 TILEMAP_FLIPY = TILE_FLIPY; // draw the tilemap vertically flipped +const uint32_t TILEMAP_FLIPX = TILE_FLIPX; // draw the tilemap horizontally flipped +const uint32_t TILEMAP_FLIPY = TILE_FLIPY; // draw the tilemap vertically flipped // set this value for a scroll row/column to fully disable it -const UINT32 TILE_LINE_DISABLED = 0x80000000; +const uint32_t TILE_LINE_DISABLED = 0x80000000; // standard mappers enum tilemap_standard_mapper @@ -433,24 +433,24 @@ class tilemap_device; // global types -typedef UINT32 tilemap_memory_index; +typedef uint32_t tilemap_memory_index; // tile_data is filled in by the get_tile_info callback struct tile_data { device_gfx_interface *decoder; // set in tilemap_t::init() - const UINT8 * pen_data; // required - const UINT8 * mask_data; // required + const uint8_t * pen_data; // required + const uint8_t * mask_data; // required pen_t palette_base; // defaults to 0 - UINT8 category; // defaults to 0; range from 0..15 - UINT8 group; // defaults to 0; range from 0..TILEMAP_NUM_GROUPS - UINT8 flags; // defaults to 0; one or more of TILE_* flags above - UINT8 pen_mask; // defaults to 0xff; mask to apply to pen_data while rendering the tile - UINT8 gfxnum; // defaults to 0xff; specify index of gfx for auto-invalidation on dirty - UINT32 code; - - void set(UINT8 _gfxnum, UINT32 rawcode, UINT32 rawcolor, UINT8 _flags) + uint8_t category; // defaults to 0; range from 0..15 + uint8_t group; // defaults to 0; range from 0..TILEMAP_NUM_GROUPS + uint8_t flags; // defaults to 0; one or more of TILE_* flags above + uint8_t pen_mask; // defaults to 0xff; mask to apply to pen_data while rendering the tile + uint8_t gfxnum; // defaults to 0xff; specify index of gfx for auto-invalidation on dirty + uint32_t code; + + void set(uint8_t _gfxnum, uint32_t rawcode, uint32_t rawcolor, uint8_t _flags) { gfx_element *gfx = decoder->gfx(_gfxnum); code = rawcode % gfx->elements(); @@ -464,7 +464,7 @@ struct tile_data // modern delegates typedef device_delegate tilemap_get_info_delegate; -typedef device_delegate tilemap_mapper_delegate; +typedef device_delegate tilemap_mapper_delegate; // ======================> tilemap_t @@ -480,10 +480,10 @@ class tilemap_t friend resource_pool_object::~resource_pool_object(); // logical index - typedef UINT32 logical_index; + typedef uint32_t logical_index; // internal usage to mark tiles dirty - static const UINT8 TILE_FLAG_DIRTY = 0xff; + static const uint8_t TILE_FLAG_DIRTY = 0xff; // invalid logical index static const logical_index INVALID_LOGICAL_INDEX = (logical_index)~0; @@ -496,7 +496,7 @@ protected: tilemap_t(); virtual ~tilemap_t(); - tilemap_t &init(tilemap_manager &manager, device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, UINT16 tilewidth, UINT16 tileheight, UINT32 cols, UINT32 rows); + tilemap_t &init(tilemap_manager &manager, device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, uint16_t tilewidth, uint16_t tileheight, uint32_t cols, uint32_t rows); public: // getters @@ -509,75 +509,75 @@ public: void *user_data() const { return m_user_data; } memory_array &basemem() { return m_basemem; } memory_array &extmem() { return m_extmem; } - UINT32 rows() const { return m_rows; } - UINT32 cols() const { return m_cols; } - UINT16 tilewidth() const { return m_tilewidth; } - UINT16 tileheight() const { return m_tileheight; } - UINT32 width() const { return m_width; } - UINT32 height() const { return m_height; } + uint32_t rows() const { return m_rows; } + uint32_t cols() const { return m_cols; } + uint16_t tilewidth() const { return m_tilewidth; } + uint16_t tileheight() const { return m_tileheight; } + uint32_t width() const { return m_width; } + uint32_t height() const { return m_height; } bool enabled() const { return m_enable; } - UINT32 palette_offset() const { return m_palette_offset; } + uint32_t palette_offset() const { return m_palette_offset; } int scrolldx() const { return (m_attributes & TILEMAP_FLIPX) ? m_dx_flipped : m_dx; } int scrolldy() const { return (m_attributes & TILEMAP_FLIPY) ? m_dy_flipped : m_dy; } int scrollx(int which = 0) const { return (which < m_scrollrows) ? m_rowscroll[which] : 0; } int scrolly(int which = 0) const { return (which < m_scrollcols) ? m_colscroll[which] : 0; } bitmap_ind16 &pixmap() { pixmap_update(); return m_pixmap; } bitmap_ind8 &flagsmap() { pixmap_update(); return m_flagsmap; } - UINT8 *tile_flags() { pixmap_update(); return &m_tileflags[0]; } - tilemap_memory_index memory_index(UINT32 col, UINT32 row) { return m_mapper(col, row, m_cols, m_rows); } - void get_info_debug(UINT32 col, UINT32 row, UINT8 &gfxnum, UINT32 &code, UINT32 &color); + uint8_t *tile_flags() { pixmap_update(); return &m_tileflags[0]; } + tilemap_memory_index memory_index(uint32_t col, uint32_t row) { return m_mapper(col, row, m_cols, m_rows); } + void get_info_debug(uint32_t col, uint32_t row, uint8_t &gfxnum, uint32_t &code, uint32_t &color); // setters void enable(bool enable = true) { m_enable = enable; } void set_user_data(void *user_data) { m_user_data = user_data; } void set_palette(palette_device &palette) { m_palette = &palette; } - void set_palette_offset(UINT32 offset) { m_palette_offset = offset; } + void set_palette_offset(uint32_t offset) { m_palette_offset = offset; } void set_scrolldx(int dx, int dx_flipped) { m_dx = dx; m_dx_flipped = dx_flipped; } void set_scrolldy(int dy, int dy_flipped) { m_dy = dy; m_dy_flipped = dy_flipped; } void set_scrollx(int which, int value) { if (which < m_scrollrows) m_rowscroll[which] = value; } void set_scrolly(int which, int value) { if (which < m_scrollcols) m_colscroll[which] = value; } void set_scrollx(int value) { set_scrollx(0, value); } void set_scrolly(int value) { set_scrolly(0, value); } - void set_scroll_rows(UINT32 scroll_rows) { assert(scroll_rows <= m_height); m_scrollrows = scroll_rows; } - void set_scroll_cols(UINT32 scroll_cols) { assert(scroll_cols <= m_width); m_scrollcols = scroll_cols; } - void set_flip(UINT32 attributes) { if (m_attributes != attributes) { m_attributes = attributes; mappings_update(); } } + void set_scroll_rows(uint32_t scroll_rows) { assert(scroll_rows <= m_height); m_scrollrows = scroll_rows; } + void set_scroll_cols(uint32_t scroll_cols) { assert(scroll_cols <= m_width); m_scrollcols = scroll_cols; } + void set_flip(uint32_t attributes) { if (m_attributes != attributes) { m_attributes = attributes; mappings_update(); } } // dirtying void mark_tile_dirty(tilemap_memory_index memindex); void mark_all_dirty() { m_all_tiles_dirty = true; m_all_tiles_clean = false; } // pen mapping - void map_pens_to_layer(int group, pen_t pen, pen_t mask, UINT8 layermask); - void map_pen_to_layer(int group, pen_t pen, UINT8 layermask) { map_pens_to_layer(group, pen, ~0, layermask); } + void map_pens_to_layer(int group, pen_t pen, pen_t mask, uint8_t layermask); + void map_pen_to_layer(int group, pen_t pen, uint8_t layermask) { map_pens_to_layer(group, pen, ~0, layermask); } void set_transparent_pen(pen_t pen); - void set_transmask(int group, UINT32 fgmask, UINT32 bgmask); + void set_transmask(int group, uint32_t fgmask, uint32_t bgmask); void configure_groups(gfx_element &gfx, indirect_pen_t transcolor); // drawing - void draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, UINT32 flags, UINT8 priority = 0, UINT8 priority_mask = 0xff); - void draw(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 flags, UINT8 priority = 0, UINT8 priority_mask = 0xff); - void draw_roz(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound, UINT32 flags, UINT8 priority = 0, UINT8 priority_mask = 0xff); - void draw_roz(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound, UINT32 flags, UINT8 priority = 0, UINT8 priority_mask = 0xff); - void draw_debug(screen_device &screen, bitmap_rgb32 &dest, UINT32 scrollx, UINT32 scrolly); + void draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, uint32_t flags, uint8_t priority = 0, uint8_t priority_mask = 0xff); + void draw(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t flags, uint8_t priority = 0, uint8_t priority_mask = 0xff); + void draw_roz(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, bool wraparound, uint32_t flags, uint8_t priority = 0, uint8_t priority_mask = 0xff); + void draw_roz(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, bool wraparound, uint32_t flags, uint8_t priority = 0, uint8_t priority_mask = 0xff); + void draw_debug(screen_device &screen, bitmap_rgb32 &dest, uint32_t scrollx, uint32_t scrolly); // mappers // scan in row-major order with optional flipping - tilemap_memory_index scan_rows(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); - tilemap_memory_index scan_rows_flip_x(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); - tilemap_memory_index scan_rows_flip_y(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); - tilemap_memory_index scan_rows_flip_xy(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); + tilemap_memory_index scan_rows(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows); + tilemap_memory_index scan_rows_flip_x(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows); + tilemap_memory_index scan_rows_flip_y(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows); + tilemap_memory_index scan_rows_flip_xy(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows); // scan in column-major order with optional flipping - tilemap_memory_index scan_cols(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); - tilemap_memory_index scan_cols_flip_x(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); - tilemap_memory_index scan_cols_flip_y(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); - tilemap_memory_index scan_cols_flip_xy(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); + tilemap_memory_index scan_cols(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows); + tilemap_memory_index scan_cols_flip_x(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows); + tilemap_memory_index scan_cols_flip_y(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows); + tilemap_memory_index scan_cols_flip_xy(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows); // optional memory accessors - UINT32 basemem_read(int index) { return m_basemem.read(index); } - UINT32 extmem_read(int index) { return m_extmem.read(index); } - void basemem_write(int index, UINT32 data) { m_basemem.write(index, data); mark_tile_dirty(index); } - void extmem_write(int index, UINT32 data) { m_extmem.write(index, data); mark_tile_dirty(index); } + uint32_t basemem_read(int index) { return m_basemem.read(index); } + uint32_t extmem_read(int index) { return m_extmem.read(index); } + void basemem_write(int index, uint32_t data) { m_basemem.write(index, data); mark_tile_dirty(index); } + void extmem_write(int index, uint32_t data) { m_extmem.write(index, data); mark_tile_dirty(index); } private: // internal set of transparency states for rendering @@ -593,26 +593,26 @@ private: { bitmap_ind8 * priority; rectangle cliprect; - UINT32 tilemap_priority_code; - UINT8 mask; - UINT8 value; - UINT8 alpha; + uint32_t tilemap_priority_code; + uint8_t mask; + uint8_t value; + uint8_t alpha; }; // inline helpers - INT32 effective_rowscroll(int index, UINT32 screen_width); - INT32 effective_colscroll(int index, UINT32 screen_height); + int32_t effective_rowscroll(int index, uint32_t screen_width); + int32_t effective_colscroll(int index, uint32_t screen_height); bool gfx_elements_changed(); // inline scanline rasterizers - void scanline_draw_opaque_null(int count, UINT8 *pri, UINT32 pcode); - void scanline_draw_masked_null(const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); - void scanline_draw_opaque_ind16(UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode); - void scanline_draw_masked_ind16(UINT16 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode); - void scanline_draw_opaque_rgb32(UINT32 *dest, const UINT16 *source, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode); - void scanline_draw_masked_rgb32(UINT32 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode); - void scanline_draw_opaque_rgb32_alpha(UINT32 *dest, const UINT16 *source, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha); - void scanline_draw_masked_rgb32_alpha(UINT32 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha); + void scanline_draw_opaque_null(int count, uint8_t *pri, uint32_t pcode); + void scanline_draw_masked_null(const uint8_t *maskptr, int mask, int value, int count, uint8_t *pri, uint32_t pcode); + void scanline_draw_opaque_ind16(uint16_t *dest, const uint16_t *source, int count, uint8_t *pri, uint32_t pcode); + void scanline_draw_masked_ind16(uint16_t *dest, const uint16_t *source, const uint8_t *maskptr, int mask, int value, int count, uint8_t *pri, uint32_t pcode); + void scanline_draw_opaque_rgb32(uint32_t *dest, const uint16_t *source, int count, const rgb_t *pens, uint8_t *pri, uint32_t pcode); + void scanline_draw_masked_rgb32(uint32_t *dest, const uint16_t *source, const uint8_t *maskptr, int mask, int value, int count, const rgb_t *pens, uint8_t *pri, uint32_t pcode); + void scanline_draw_opaque_rgb32_alpha(uint32_t *dest, const uint16_t *source, int count, const rgb_t *pens, uint8_t *pri, uint32_t pcode, uint8_t alpha); + void scanline_draw_masked_rgb32_alpha(uint32_t *dest, const uint16_t *source, const uint8_t *maskptr, int mask, int value, int count, const rgb_t *pens, uint8_t *pri, uint32_t pcode, uint8_t alpha); // internal helpers void postload(); @@ -622,14 +622,14 @@ private: // internal drawing void pixmap_update(); - void tile_update(logical_index logindex, UINT32 col, UINT32 row); - UINT8 tile_draw(const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags, UINT8 pen_mask); - UINT8 tile_apply_bitmask(const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags); - void configure_blit_parameters(blit_parameters &blit, bitmap_ind8 &priority_bitmap, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask); - template void draw_common(screen_device &screen, _BitmapClass &dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask); - template void draw_roz_common(screen_device &screen, _BitmapClass &dest, const rectangle &cliprect, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask); + void tile_update(logical_index logindex, uint32_t col, uint32_t row); + uint8_t tile_draw(const uint8_t *pendata, uint32_t x0, uint32_t y0, uint32_t palette_base, uint8_t category, uint8_t group, uint8_t flags, uint8_t pen_mask); + uint8_t tile_apply_bitmask(const uint8_t *maskdata, uint32_t x0, uint32_t y0, uint8_t category, uint8_t flags); + void configure_blit_parameters(blit_parameters &blit, bitmap_ind8 &priority_bitmap, const rectangle &cliprect, uint32_t flags, uint8_t priority, uint8_t priority_mask); + template void draw_common(screen_device &screen, _BitmapClass &dest, const rectangle &cliprect, uint32_t flags, uint8_t priority, uint8_t priority_mask); + template void draw_roz_common(screen_device &screen, _BitmapClass &dest, const rectangle &cliprect, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, bool wraparound, uint32_t flags, uint8_t priority, uint8_t priority_mask); template void draw_instance(screen_device &screen, _BitmapClass &dest, const blit_parameters &blit, int xpos, int ypos); - template void draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, const blit_parameters &blit, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound); + template void draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, const blit_parameters &blit, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, bool wraparound); // managers and devices tilemap_manager * m_manager; // reference to the owning manager @@ -643,12 +643,12 @@ private: memory_array m_extmem; // info about extension memory // basic tilemap metrics - UINT32 m_rows; // number of tile rows - UINT32 m_cols; // number of tile columns - UINT16 m_tilewidth; // width of a single tile in pixels - UINT16 m_tileheight; // height of a single tile in pixels - UINT32 m_width; // width of the full tilemap in pixels - UINT32 m_height; // height of the full tilemap in pixels + uint32_t m_rows; // number of tile rows + uint32_t m_cols; // number of tile columns + uint16_t m_tilewidth; // width of a single tile in pixels + uint16_t m_tileheight; // height of a single tile in pixels + uint32_t m_width; // width of the full tilemap in pixels + uint32_t m_height; // height of the full tilemap in pixels // logical <-> memory mappings tilemap_mapper_delegate m_mapper; // callback to map a row/column to a memory index @@ -661,30 +661,30 @@ private: // global tilemap states bool m_enable; // true if we are enabled - UINT8 m_attributes; // global attributes (flipx/y) + uint8_t m_attributes; // global attributes (flipx/y) bool m_all_tiles_dirty; // true if all tiles are dirty bool m_all_tiles_clean; // true if all tiles are clean - UINT32 m_palette_offset; // palette offset - UINT32 m_gfx_used; // bitmask of gfx items used - UINT32 m_gfx_dirtyseq[MAX_GFX_ELEMENTS]; // dirtyseq values from last check + uint32_t m_palette_offset; // palette offset + uint32_t m_gfx_used; // bitmask of gfx items used + uint32_t m_gfx_dirtyseq[MAX_GFX_ELEMENTS]; // dirtyseq values from last check // scroll information - UINT32 m_scrollrows; // number of independently scrolled rows - UINT32 m_scrollcols; // number of independently scrolled columns - std::vector m_rowscroll; // array of rowscroll values - std::vector m_colscroll; // array of colscroll values - INT32 m_dx; // global horizontal scroll offset - INT32 m_dx_flipped; // global horizontal scroll offset when flipped - INT32 m_dy; // global vertical scroll offset - INT32 m_dy_flipped; // global vertical scroll offset when flipped + uint32_t m_scrollrows; // number of independently scrolled rows + uint32_t m_scrollcols; // number of independently scrolled columns + std::vector m_rowscroll; // array of rowscroll values + std::vector m_colscroll; // array of colscroll values + int32_t m_dx; // global horizontal scroll offset + int32_t m_dx_flipped; // global horizontal scroll offset when flipped + int32_t m_dy; // global vertical scroll offset + int32_t m_dy_flipped; // global vertical scroll offset when flipped // pixel data bitmap_ind16 m_pixmap; // cached pixel data // transparency mapping bitmap_ind8 m_flagsmap; // per-pixel flags - std::vector m_tileflags; // per-tile flags - UINT8 m_pen_to_flags[MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS]; // mapping of pens to flags + std::vector m_tileflags; // per-tile flags + uint8_t m_pen_to_flags[MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS]; // mapping of pens to flags }; @@ -704,8 +704,8 @@ public: running_machine &machine() const { return m_machine; } // tilemap creation - tilemap_t &create(device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, UINT16 tilewidth, UINT16 tileheight, UINT32 cols, UINT32 rows, tilemap_t *allocated = nullptr); - tilemap_t &create(device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_standard_mapper mapper, UINT16 tilewidth, UINT16 tileheight, UINT32 cols, UINT32 rows, tilemap_t *allocated = nullptr); + tilemap_t &create(device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_mapper_delegate mapper, uint16_t tilewidth, uint16_t tileheight, uint32_t cols, uint32_t rows, tilemap_t *allocated = nullptr); + tilemap_t &create(device_gfx_interface &decoder, tilemap_get_info_delegate tile_get_info, tilemap_standard_mapper mapper, uint16_t tilewidth, uint16_t tileheight, uint32_t cols, uint32_t rows, tilemap_t *allocated = nullptr); // tilemap list information tilemap_t *find(int index) { return m_tilemap_list.find(index); } @@ -713,7 +713,7 @@ public: // global operations on all tilemaps void mark_all_dirty(); - void set_flip_all(UINT32 attributes); + void set_flip_all(uint32_t attributes); private: // allocate an instance index @@ -736,15 +736,15 @@ class tilemap_device : public device_t, { public: // construction/destruction - tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); static void static_set_bytes_per_entry(device_t &device, int bpe); static void static_set_info_callback(device_t &device, tilemap_get_info_delegate tile_get_info); - static void static_set_layout(device_t &device, tilemap_standard_mapper mapper, UINT32 columns, UINT32 rows); - static void static_set_layout(device_t &device, tilemap_mapper_delegate mapper, UINT32 columns, UINT32 rows); - static void static_set_tile_size(device_t &device, UINT16 width, UINT16 height); + static void static_set_layout(device_t &device, tilemap_standard_mapper mapper, uint32_t columns, uint32_t rows); + static void static_set_layout(device_t &device, tilemap_mapper_delegate mapper, uint32_t columns, uint32_t rows); + static void static_set_tile_size(device_t &device, uint16_t width, uint16_t height); static void static_set_transparent_pen(device_t &device, pen_t pen); // write handlers @@ -771,10 +771,10 @@ private: tilemap_standard_mapper m_standard_mapper; tilemap_mapper_delegate m_mapper; int m_bytes_per_entry; - UINT16 m_tile_width; - UINT16 m_tile_height; - UINT32 m_num_columns; - UINT32 m_num_rows; + uint16_t m_tile_width; + uint16_t m_tile_height; + uint32_t m_num_columns; + uint32_t m_num_rows; bool m_transparent_pen_set; pen_t m_transparent_pen; }; @@ -793,7 +793,7 @@ private: #define TILE_GET_INFO_MEMBER(_name) void _name(tilemap_t &tilemap, tile_data &tileinfo, tilemap_memory_index tile_index) // function definition for a logical-to-memory mapper -#define TILEMAP_MAPPER_MEMBER(_name) tilemap_memory_index _name(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) +#define TILEMAP_MAPPER_MEMBER(_name) tilemap_memory_index _name(uint32_t col, uint32_t row, uint32_t num_cols, uint32_t num_rows) // useful macro inside of a TILE_GET_INFO callback to set tile information #define SET_TILE_INFO_MEMBER(GFX,CODE,COLOR,FLAGS) tileinfo.set(GFX, CODE, COLOR, FLAGS) diff --git a/src/emu/timer.cpp b/src/emu/timer.cpp index e8d1eb8f8dd..29583c25e0a 100644 --- a/src/emu/timer.cpp +++ b/src/emu/timer.cpp @@ -32,7 +32,7 @@ const device_type TIMER = &device_creator; // timer_device - constructor //------------------------------------------------- -timer_device::timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +timer_device::timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TIMER, "Timer", tag, owner, clock, "timer", __FILE__), m_type(TIMER_TYPE_GENERIC), m_callback(timer_device_expired_delegate()), diff --git a/src/emu/timer.h b/src/emu/timer.h index ca8074f5b04..c117c48084c 100644 --- a/src/emu/timer.h +++ b/src/emu/timer.h @@ -24,7 +24,7 @@ //************************************************************************** // macros for a timer callback functions -#define TIMER_DEVICE_CALLBACK_MEMBER(name) void name(timer_device &timer, void *ptr, INT32 param) +#define TIMER_DEVICE_CALLBACK_MEMBER(name) void name(timer_device &timer, void *ptr, int32_t param) //************************************************************************** // TIMER DEVICE CONFIGURATION MACROS @@ -73,7 +73,7 @@ class emu_timer; class timer_device; // a timer callbacks look like this -typedef device_delegate timer_device_expired_delegate; +typedef device_delegate timer_device_expired_delegate; // ======================> timer_device @@ -81,7 +81,7 @@ class timer_device : public device_t { public: // construction/destruction - timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration helpers static void static_configure_generic(device_t &device, timer_device_expired_delegate callback); @@ -104,7 +104,7 @@ public: // adjustments void reset() { adjust(attotime::never, 0, attotime::never); } - void adjust(const attotime &duration, INT32 param = 0, const attotime &period = attotime::never) const { assert(m_type == TIMER_TYPE_GENERIC); m_timer->adjust(duration, param, period); } + void adjust(const attotime &duration, int32_t param = 0, const attotime &period = attotime::never) const { assert(m_type == TIMER_TYPE_GENERIC); m_timer->adjust(duration, param, period); } // timing information attotime time_elapsed() const { return m_timer->elapsed(); } @@ -135,13 +135,13 @@ private: // periodic timers only attotime m_start_delay; // delay before the timer fires for the first time attotime m_period; // period of repeated timer firings - INT32 m_param; // the integer parameter passed to the timer callback + int32_t m_param; // the integer parameter passed to the timer callback // scanline timers only const char * m_screen_tag; // the tag of the screen this timer tracks screen_device * m_screen; // pointer to the screen device - UINT32 m_first_vpos; // the first vertical scanline position the timer fires on - UINT32 m_increment; // the number of scanlines between firings + uint32_t m_first_vpos; // the first vertical scanline position the timer fires on + uint32_t m_increment; // the number of scanlines between firings // internal state emu_timer * m_timer; // the backing timer diff --git a/src/emu/ui/cmdrender.h b/src/emu/ui/cmdrender.h index e065e9dcc6d..de9ca58747e 100644 --- a/src/emu/ui/cmdrender.h +++ b/src/emu/ui/cmdrender.h @@ -90,22 +90,22 @@ void render_font::render_font_command_glyph() load_cached_cmd(ramfile, 0); } -bool render_font::load_cached_cmd(emu_file &file, UINT32 hash) +bool render_font::load_cached_cmd(emu_file &file, uint32_t hash) { - UINT64 filesize = file.size(); - UINT8 header[CACHED_HEADER_SIZE]; - UINT32 bytes_read = file.read(header, CACHED_HEADER_SIZE); + uint64_t filesize = file.size(); + uint8_t header[CACHED_HEADER_SIZE]; + uint32_t bytes_read = file.read(header, CACHED_HEADER_SIZE); if (bytes_read != CACHED_HEADER_SIZE) return false; if (header[0] != 'f' || header[1] != 'o' || header[2] != 'n' || header[3] != 't') return false; - if (header[4] != (UINT8)(hash >> 24) || header[5] != (UINT8)(hash >> 16) || header[6] != (UINT8)(hash >> 8) || header[7] != (UINT8)hash) + if (header[4] != (uint8_t)(hash >> 24) || header[5] != (uint8_t)(hash >> 16) || header[6] != (uint8_t)(hash >> 8) || header[7] != (uint8_t)hash) return false; m_height_cmd = (header[8] << 8) | header[9]; - m_yoffs_cmd = (INT16)((header[10] << 8) | header[11]); - UINT32 numchars = (header[12] << 24) | (header[13] << 16) | (header[14] << 8) | header[15]; + m_yoffs_cmd = (int16_t)((header[10] << 8) | header[11]); + uint32_t numchars = (header[12] << 24) | (header[13] << 16) | (header[14] << 8) | header[15]; if (filesize - CACHED_HEADER_SIZE < numchars * CACHED_CHAR_SIZE) return false; @@ -117,10 +117,10 @@ bool render_font::load_cached_cmd(emu_file &file, UINT32 hash) return false; } - UINT64 offset = numchars * CACHED_CHAR_SIZE; + uint64_t offset = numchars * CACHED_CHAR_SIZE; for (int chindex = 0; chindex < numchars; chindex++) { - const UINT8 *info = reinterpret_cast(&m_rawdata_cmd[chindex * CACHED_CHAR_SIZE]); + const uint8_t *info = reinterpret_cast(&m_rawdata_cmd[chindex * CACHED_CHAR_SIZE]); int chnum = (info[0] << 8) | info[1]; if (!m_glyphs_cmd[chnum / 256]) @@ -132,8 +132,8 @@ bool render_font::load_cached_cmd(emu_file &file, UINT32 hash) gl.color = color_table[chnum - COMMAND_UNICODE]; gl.width = (info[2] << 8) | info[3]; - gl.xoffs = (INT16)((info[4] << 8) | info[5]); - gl.yoffs = (INT16)((info[6] << 8) | info[7]); + gl.xoffs = (int16_t)((info[4] << 8) | info[5]); + gl.yoffs = (int16_t)((info[6] << 8) | info[7]); gl.bmwidth = (info[8] << 8) | info[9]; gl.bmheight = (info[10] << 8) | info[11]; gl.rawdata = &m_rawdata_cmd[offset]; diff --git a/src/emu/uiinput.cpp b/src/emu/uiinput.cpp index 380dc5c16c9..a52df97679d 100644 --- a/src/emu/uiinput.cpp +++ b/src/emu/uiinput.cpp @@ -183,7 +183,7 @@ void ui_input_manager::reset() location of the mouse -------------------------------------------------*/ -render_target *ui_input_manager::find_mouse(INT32 *x, INT32 *y, bool *button) const +render_target *ui_input_manager::find_mouse(int32_t *x, int32_t *y, bool *button) const { if (x != nullptr) *x = m_current_mouse_x; @@ -284,7 +284,7 @@ g_profiler.stop(); move event to the specified render_target -------------------------------------------------*/ -void ui_input_manager::push_mouse_move_event(render_target* target, INT32 x, INT32 y) +void ui_input_manager::push_mouse_move_event(render_target* target, int32_t x, int32_t y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_MOVE; @@ -312,7 +312,7 @@ void ui_input_manager::push_mouse_leave_event(render_target* target) down event to the specified render_target -------------------------------------------------*/ -void ui_input_manager::push_mouse_down_event(render_target* target, INT32 x, INT32 y) +void ui_input_manager::push_mouse_down_event(render_target* target, int32_t x, int32_t y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_DOWN; @@ -327,7 +327,7 @@ void ui_input_manager::push_mouse_down_event(render_target* target, INT32 x, INT down event to the specified render_target -------------------------------------------------*/ -void ui_input_manager::push_mouse_up_event(render_target* target, INT32 x, INT32 y) +void ui_input_manager::push_mouse_up_event(render_target* target, int32_t x, int32_t y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_UP; @@ -342,7 +342,7 @@ push_mouse_down_event - pushes a mouse down event to the specified render_target -------------------------------------------------*/ -void ui_input_manager::push_mouse_rdown_event(render_target* target, INT32 x, INT32 y) +void ui_input_manager::push_mouse_rdown_event(render_target* target, int32_t x, int32_t y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_RDOWN; @@ -357,7 +357,7 @@ push_mouse_down_event - pushes a mouse down event to the specified render_target -------------------------------------------------*/ -void ui_input_manager::push_mouse_rup_event(render_target* target, INT32 x, INT32 y) +void ui_input_manager::push_mouse_rup_event(render_target* target, int32_t x, int32_t y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_RUP; @@ -372,7 +372,7 @@ void ui_input_manager::push_mouse_rup_event(render_target* target, INT32 x, INT3 a mouse double-click event to the specified render_target -------------------------------------------------*/ -void ui_input_manager::push_mouse_double_click_event(render_target* target, INT32 x, INT32 y) +void ui_input_manager::push_mouse_double_click_event(render_target* target, int32_t x, int32_t y) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_DOUBLE_CLICK; @@ -400,7 +400,7 @@ void ui_input_manager::push_char_event(render_target* target, char32_t ch) wheel event to the specified render_target -------------------------------------------------*/ -void ui_input_manager::push_mouse_wheel_event(render_target *target, INT32 x, INT32 y, short delta, int ucNumLines) +void ui_input_manager::push_mouse_wheel_event(render_target *target, int32_t x, int32_t y, short delta, int ucNumLines) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_MOUSE_WHEEL; diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h index 25d18966e08..669e195a0ba 100644 --- a/src/emu/uiinput.h +++ b/src/emu/uiinput.h @@ -43,8 +43,8 @@ struct ui_event { ui_event_type event_type; render_target * target; - INT32 mouse_x; - INT32 mouse_y; + int32_t mouse_x; + int32_t mouse_y; input_item_id key; char32_t ch; short zdelta; @@ -71,7 +71,7 @@ public: void reset(); /* retrieves the current location of the mouse */ - render_target *find_mouse(INT32 *x, INT32 *y, bool *button) const; + render_target *find_mouse(int32_t *x, int32_t *y, bool *button) const; ioport_field *find_mouse_field() const; /* return TRUE if a key down for the given user interface sequence is detected */ @@ -85,15 +85,15 @@ public: running_machine &machine() const { return m_machine; } - void push_mouse_move_event(render_target* target, INT32 x, INT32 y); + void push_mouse_move_event(render_target* target, int32_t x, int32_t y); void push_mouse_leave_event(render_target* target); - void push_mouse_down_event(render_target* target, INT32 x, INT32 y); - void push_mouse_up_event(render_target* target, INT32 x, INT32 y); - void push_mouse_rdown_event(render_target* target, INT32 x, INT32 y); - void push_mouse_rup_event(render_target* target, INT32 x, INT32 y); - void push_mouse_double_click_event(render_target* target, INT32 x, INT32 y); + void push_mouse_down_event(render_target* target, int32_t x, int32_t y); + void push_mouse_up_event(render_target* target, int32_t x, int32_t y); + void push_mouse_rdown_event(render_target* target, int32_t x, int32_t y); + void push_mouse_rup_event(render_target* target, int32_t x, int32_t y); + void push_mouse_double_click_event(render_target* target, int32_t x, int32_t y); void push_char_event(render_target* target, char32_t ch); - void push_mouse_wheel_event(render_target *target, INT32 x, INT32 y, short delta, int ucNumLines); + void push_mouse_wheel_event(render_target *target, int32_t x, int32_t y, short delta, int ucNumLines); void mark_all_as_pressed(); @@ -104,12 +104,12 @@ private: /* pressed states; retrieved with ui_input_pressed() */ osd_ticks_t m_next_repeat[IPT_COUNT]; - UINT8 m_seqpressed[IPT_COUNT]; + uint8_t m_seqpressed[IPT_COUNT]; /* mouse position/info */ render_target * m_current_mouse_target; - INT32 m_current_mouse_x; - INT32 m_current_mouse_y; + int32_t m_current_mouse_x; + int32_t m_current_mouse_y; bool m_current_mouse_down; ioport_field * m_current_mouse_field; diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index f98e5b8ed5f..740a9c6c6dd 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -30,7 +30,7 @@ // string from the I/O port system //------------------------------------------------- -inline const char *validity_checker::ioport_string_from_index(UINT32 index) +inline const char *validity_checker::ioport_string_from_index(uint32_t index) { return ioport_configurer::string_from_token((const char *)(uintptr_t)index); } @@ -59,10 +59,10 @@ inline int validity_checker::get_defstr_index(const char *string, bool suppress_ // random_s32 //------------------------------------------------- #undef rand -inline INT32 validity_checker::random_i32() { return INT32(random_u32()); } -inline UINT32 validity_checker::random_u32() { return rand() ^ (rand() << 15); } -inline INT64 validity_checker::random_i64() { return INT64(random_u64()); } -inline UINT64 validity_checker::random_u64() { return UINT64(random_u32()) ^ (UINT64(random_u32()) << 30); } +inline int32_t validity_checker::random_i32() { return int32_t(random_u32()); } +inline uint32_t validity_checker::random_u32() { return rand() ^ (rand() << 15); } +inline int64_t validity_checker::random_i64() { return int64_t(random_u64()); } +inline uint64_t validity_checker::random_u64() { return uint64_t(random_u32()) ^ (uint64_t(random_u32()) << 30); } @@ -82,7 +82,7 @@ void validity_checker::validate_tag(const char *tag) for (const char *p = tag; *p != 0; p++) { // only lower-case permitted - if (*p != tolower((UINT8)*p)) + if (*p != tolower((uint8_t)*p)) { osd_printf_error("Tag '%s' contains upper-case characters\n", tag); break; @@ -336,29 +336,29 @@ void validity_checker::validate_core() // basic system checks if (~0 != -1) osd_printf_error("Machine must be two's complement\n"); - UINT8 a = 0xff; - UINT8 b = a + 1; - if (b > a) osd_printf_error("UINT8 must be 8 bits\n"); + uint8_t a = 0xff; + uint8_t b = a + 1; + if (b > a) osd_printf_error("uint8_t must be 8 bits\n"); // check size of core integer types - if (sizeof(INT8) != 1) osd_printf_error("INT8 must be 8 bits\n"); - if (sizeof(UINT8) != 1) osd_printf_error("UINT8 must be 8 bits\n"); - if (sizeof(INT16) != 2) osd_printf_error("INT16 must be 16 bits\n"); - if (sizeof(UINT16) != 2) osd_printf_error("UINT16 must be 16 bits\n"); - if (sizeof(INT32) != 4) osd_printf_error("INT32 must be 32 bits\n"); - if (sizeof(UINT32) != 4) osd_printf_error("UINT32 must be 32 bits\n"); - if (sizeof(INT64) != 8) osd_printf_error("INT64 must be 64 bits\n"); - if (sizeof(UINT64) != 8) osd_printf_error("UINT64 must be 64 bits\n"); + if (sizeof(int8_t) != 1) osd_printf_error("int8_t must be 8 bits\n"); + if (sizeof(uint8_t) != 1) osd_printf_error("uint8_t must be 8 bits\n"); + if (sizeof(int16_t) != 2) osd_printf_error("int16_t must be 16 bits\n"); + if (sizeof(uint16_t) != 2) osd_printf_error("uint16_t must be 16 bits\n"); + if (sizeof(int32_t) != 4) osd_printf_error("int32_t must be 32 bits\n"); + if (sizeof(uint32_t) != 4) osd_printf_error("uint32_t must be 32 bits\n"); + if (sizeof(int64_t) != 8) osd_printf_error("int64_t must be 64 bits\n"); + if (sizeof(uint64_t) != 8) osd_printf_error("uint64_t must be 64 bits\n"); // check signed right shift - INT8 a8 = -3; - INT16 a16 = -3; - INT32 a32 = -3; - INT64 a64 = -3; - if (a8 >> 1 != -2) osd_printf_error("INT8 right shift must be arithmetic\n"); - if (a16 >> 1 != -2) osd_printf_error("INT16 right shift must be arithmetic\n"); - if (a32 >> 1 != -2) osd_printf_error("INT32 right shift must be arithmetic\n"); - if (a64 >> 1 != -2) osd_printf_error("INT64 right shift must be arithmetic\n"); + int8_t a8 = -3; + int16_t a16 = -3; + int32_t a32 = -3; + int64_t a64 = -3; + if (a8 >> 1 != -2) osd_printf_error("int8_t right shift must be arithmetic\n"); + if (a16 >> 1 != -2) osd_printf_error("int16_t right shift must be arithmetic\n"); + if (a32 >> 1 != -2) osd_printf_error("int32_t right shift must be arithmetic\n"); + if (a64 >> 1 != -2) osd_printf_error("int64_t right shift must be arithmetic\n"); // check pointer size #ifdef PTR64 @@ -369,8 +369,8 @@ void validity_checker::validate_core() // TODO: check if this is actually working // check endianness definition - UINT16 lsbtest = 0; - *(UINT8 *)&lsbtest = 0xff; + uint16_t lsbtest = 0; + *(uint8_t *)&lsbtest = 0xff; #ifdef LSB_FIRST if (lsbtest == 0xff00) osd_printf_error("LSB_FIRST specified, but running on a big-endian machine\n"); #else @@ -386,18 +386,18 @@ void validity_checker::validate_core() void validity_checker::validate_inlines() { - volatile UINT64 testu64a = random_u64(); - volatile INT64 testi64a = random_i64(); - volatile UINT32 testu32a = random_u32(); - volatile UINT32 testu32b = random_u32(); - volatile INT32 testi32a = random_i32(); - volatile INT32 testi32b = random_i32(); - INT32 resulti32, expectedi32; - UINT32 resultu32, expectedu32; - INT64 resulti64, expectedi64; - UINT64 resultu64, expectedu64; - INT32 remainder, expremainder; - UINT32 uremainder, expuremainder, bigu32 = 0xffffffff; + volatile uint64_t testu64a = random_u64(); + volatile int64_t testi64a = random_i64(); + volatile uint32_t testu32a = random_u32(); + volatile uint32_t testu32b = random_u32(); + volatile int32_t testi32a = random_i32(); + volatile int32_t testi32b = random_i32(); + int32_t resulti32, expectedi32; + uint32_t resultu32, expectedu32; + int64_t resulti64, expectedi64; + uint64_t resultu64, expectedu64; + int32_t remainder, expremainder; + uint32_t uremainder, expuremainder, bigu32 = 0xffffffff; // use only non-zero, positive numbers if (testu64a == 0) testu64a++; @@ -411,86 +411,86 @@ void validity_checker::validate_inlines() else if (testi32b < 0) testi32b = -testi32b; resulti64 = mul_32x32(testi32a, testi32b); - expectedi64 = (INT64)testi32a * (INT64)testi32b; + expectedi64 = (int64_t)testi32a * (int64_t)testi32b; if (resulti64 != expectedi64) - osd_printf_error("Error testing mul_32x32 (%08X x %08X) = %08X%08X (expected %08X%08X)\n", testi32a, testi32b, (UINT32)(resulti64 >> 32), (UINT32)resulti64, (UINT32)(expectedi64 >> 32), (UINT32)expectedi64); + osd_printf_error("Error testing mul_32x32 (%08X x %08X) = %08X%08X (expected %08X%08X)\n", testi32a, testi32b, (uint32_t)(resulti64 >> 32), (uint32_t)resulti64, (uint32_t)(expectedi64 >> 32), (uint32_t)expectedi64); resultu64 = mulu_32x32(testu32a, testu32b); - expectedu64 = (UINT64)testu32a * (UINT64)testu32b; + expectedu64 = (uint64_t)testu32a * (uint64_t)testu32b; if (resultu64 != expectedu64) - osd_printf_error("Error testing mulu_32x32 (%08X x %08X) = %08X%08X (expected %08X%08X)\n", testu32a, testu32b, (UINT32)(resultu64 >> 32), (UINT32)resultu64, (UINT32)(expectedu64 >> 32), (UINT32)expectedu64); + osd_printf_error("Error testing mulu_32x32 (%08X x %08X) = %08X%08X (expected %08X%08X)\n", testu32a, testu32b, (uint32_t)(resultu64 >> 32), (uint32_t)resultu64, (uint32_t)(expectedu64 >> 32), (uint32_t)expectedu64); resulti32 = mul_32x32_hi(testi32a, testi32b); - expectedi32 = ((INT64)testi32a * (INT64)testi32b) >> 32; + expectedi32 = ((int64_t)testi32a * (int64_t)testi32b) >> 32; if (resulti32 != expectedi32) osd_printf_error("Error testing mul_32x32_hi (%08X x %08X) = %08X (expected %08X)\n", testi32a, testi32b, resulti32, expectedi32); resultu32 = mulu_32x32_hi(testu32a, testu32b); - expectedu32 = ((INT64)testu32a * (INT64)testu32b) >> 32; + expectedu32 = ((int64_t)testu32a * (int64_t)testu32b) >> 32; if (resultu32 != expectedu32) osd_printf_error("Error testing mulu_32x32_hi (%08X x %08X) = %08X (expected %08X)\n", testu32a, testu32b, resultu32, expectedu32); resulti32 = mul_32x32_shift(testi32a, testi32b, 7); - expectedi32 = ((INT64)testi32a * (INT64)testi32b) >> 7; + expectedi32 = ((int64_t)testi32a * (int64_t)testi32b) >> 7; if (resulti32 != expectedi32) osd_printf_error("Error testing mul_32x32_shift (%08X x %08X) >> 7 = %08X (expected %08X)\n", testi32a, testi32b, resulti32, expectedi32); resultu32 = mulu_32x32_shift(testu32a, testu32b, 7); - expectedu32 = ((INT64)testu32a * (INT64)testu32b) >> 7; + expectedu32 = ((int64_t)testu32a * (int64_t)testu32b) >> 7; if (resultu32 != expectedu32) osd_printf_error("Error testing mulu_32x32_shift (%08X x %08X) >> 7 = %08X (expected %08X)\n", testu32a, testu32b, resultu32, expectedu32); - while ((INT64)testi32a * (INT64)0x7fffffff < testi64a) + while ((int64_t)testi32a * (int64_t)0x7fffffff < testi64a) testi64a /= 2; - while ((UINT64)testu32a * (UINT64)bigu32 < testu64a) + while ((uint64_t)testu32a * (uint64_t)bigu32 < testu64a) testu64a /= 2; resulti32 = div_64x32(testi64a, testi32a); - expectedi32 = testi64a / (INT64)testi32a; + expectedi32 = testi64a / (int64_t)testi32a; if (resulti32 != expectedi32) - osd_printf_error("Error testing div_64x32 (%08X%08X / %08X) = %08X (expected %08X)\n", (UINT32)(testi64a >> 32), (UINT32)testi64a, testi32a, resulti32, expectedi32); + osd_printf_error("Error testing div_64x32 (%08X%08X / %08X) = %08X (expected %08X)\n", (uint32_t)(testi64a >> 32), (uint32_t)testi64a, testi32a, resulti32, expectedi32); resultu32 = divu_64x32(testu64a, testu32a); - expectedu32 = testu64a / (UINT64)testu32a; + expectedu32 = testu64a / (uint64_t)testu32a; if (resultu32 != expectedu32) - osd_printf_error("Error testing divu_64x32 (%08X%08X / %08X) = %08X (expected %08X)\n", (UINT32)(testu64a >> 32), (UINT32)testu64a, testu32a, resultu32, expectedu32); + osd_printf_error("Error testing divu_64x32 (%08X%08X / %08X) = %08X (expected %08X)\n", (uint32_t)(testu64a >> 32), (uint32_t)testu64a, testu32a, resultu32, expectedu32); resulti32 = div_64x32_rem(testi64a, testi32a, &remainder); - expectedi32 = testi64a / (INT64)testi32a; - expremainder = testi64a % (INT64)testi32a; + expectedi32 = testi64a / (int64_t)testi32a; + expremainder = testi64a % (int64_t)testi32a; if (resulti32 != expectedi32 || remainder != expremainder) - osd_printf_error("Error testing div_64x32_rem (%08X%08X / %08X) = %08X,%08X (expected %08X,%08X)\n", (UINT32)(testi64a >> 32), (UINT32)testi64a, testi32a, resulti32, remainder, expectedi32, expremainder); + osd_printf_error("Error testing div_64x32_rem (%08X%08X / %08X) = %08X,%08X (expected %08X,%08X)\n", (uint32_t)(testi64a >> 32), (uint32_t)testi64a, testi32a, resulti32, remainder, expectedi32, expremainder); resultu32 = divu_64x32_rem(testu64a, testu32a, &uremainder); - expectedu32 = testu64a / (UINT64)testu32a; - expuremainder = testu64a % (UINT64)testu32a; + expectedu32 = testu64a / (uint64_t)testu32a; + expuremainder = testu64a % (uint64_t)testu32a; if (resultu32 != expectedu32 || uremainder != expuremainder) - osd_printf_error("Error testing divu_64x32_rem (%08X%08X / %08X) = %08X,%08X (expected %08X,%08X)\n", (UINT32)(testu64a >> 32), (UINT32)testu64a, testu32a, resultu32, uremainder, expectedu32, expuremainder); + osd_printf_error("Error testing divu_64x32_rem (%08X%08X / %08X) = %08X,%08X (expected %08X,%08X)\n", (uint32_t)(testu64a >> 32), (uint32_t)testu64a, testu32a, resultu32, uremainder, expectedu32, expuremainder); resulti32 = mod_64x32(testi64a, testi32a); - expectedi32 = testi64a % (INT64)testi32a; + expectedi32 = testi64a % (int64_t)testi32a; if (resulti32 != expectedi32) - osd_printf_error("Error testing mod_64x32 (%08X%08X / %08X) = %08X (expected %08X)\n", (UINT32)(testi64a >> 32), (UINT32)testi64a, testi32a, resulti32, expectedi32); + osd_printf_error("Error testing mod_64x32 (%08X%08X / %08X) = %08X (expected %08X)\n", (uint32_t)(testi64a >> 32), (uint32_t)testi64a, testi32a, resulti32, expectedi32); resultu32 = modu_64x32(testu64a, testu32a); - expectedu32 = testu64a % (UINT64)testu32a; + expectedu32 = testu64a % (uint64_t)testu32a; if (resultu32 != expectedu32) - osd_printf_error("Error testing modu_64x32 (%08X%08X / %08X) = %08X (expected %08X)\n", (UINT32)(testu64a >> 32), (UINT32)testu64a, testu32a, resultu32, expectedu32); + osd_printf_error("Error testing modu_64x32 (%08X%08X / %08X) = %08X (expected %08X)\n", (uint32_t)(testu64a >> 32), (uint32_t)testu64a, testu32a, resultu32, expectedu32); - while ((INT64)testi32a * (INT64)0x7fffffff < ((INT32)testi64a << 3)) + while ((int64_t)testi32a * (int64_t)0x7fffffff < ((int32_t)testi64a << 3)) testi64a /= 2; - while ((UINT64)testu32a * (UINT64)0xffffffff < ((UINT32)testu64a << 3)) + while ((uint64_t)testu32a * (uint64_t)0xffffffff < ((uint32_t)testu64a << 3)) testu64a /= 2; - resulti32 = div_32x32_shift((INT32)testi64a, testi32a, 3); - expectedi32 = ((INT64)(INT32)testi64a << 3) / (INT64)testi32a; + resulti32 = div_32x32_shift((int32_t)testi64a, testi32a, 3); + expectedi32 = ((int64_t)(int32_t)testi64a << 3) / (int64_t)testi32a; if (resulti32 != expectedi32) - osd_printf_error("Error testing div_32x32_shift (%08X << 3) / %08X = %08X (expected %08X)\n", (INT32)testi64a, testi32a, resulti32, expectedi32); + osd_printf_error("Error testing div_32x32_shift (%08X << 3) / %08X = %08X (expected %08X)\n", (int32_t)testi64a, testi32a, resulti32, expectedi32); - resultu32 = divu_32x32_shift((UINT32)testu64a, testu32a, 3); - expectedu32 = ((UINT64)(UINT32)testu64a << 3) / (UINT64)testu32a; + resultu32 = divu_32x32_shift((uint32_t)testu64a, testu32a, 3); + expectedu32 = ((uint64_t)(uint32_t)testu64a << 3) / (uint64_t)testu32a; if (resultu32 != expectedu32) - osd_printf_error("Error testing divu_32x32_shift (%08X << 3) / %08X = %08X (expected %08X)\n", (UINT32)testu64a, testu32a, resultu32, expectedu32); + osd_printf_error("Error testing divu_32x32_shift (%08X << 3) / %08X = %08X (expected %08X)\n", (uint32_t)testu64a, testu32a, resultu32, expectedu32); if (fabsf(recip_approx(100.0f) - 0.01f) > 0.0001f) osd_printf_error("Error testing recip_approx\n"); @@ -527,38 +527,38 @@ void validity_checker::validate_rgb() The following functions are not tested yet: rgbaint_t() - clamp_and_clear(const UINT32) - sign_extend(const UINT32, const UINT32) - min(const INT32) - max(const INT32) - blend(const rgbaint_t&, UINT8) + clamp_and_clear(const uint32_t) + sign_extend(const uint32_t, const uint32_t) + min(const int32_t) + max(const int32_t) + blend(const rgbaint_t&, uint8_t) scale_and_clamp(const rgbaint_t&) - scale_imm_and_clamp(const INT32) + scale_imm_and_clamp(const int32_t) scale2_add_and_clamp(const rgbaint_t&, const rgbaint_t&, const rgbaint_t&) scale_add_and_clamp(const rgbaint_t&, const rgbaint_t&); - scale_imm_add_and_clamp(const INT32, const rgbaint_t&); - static bilinear_filter(UINT32, UINT32, UINT32, UINT32, UINT8, UINT8) - bilinear_filter_rgbaint(UINT32, UINT32, UINT32, UINT32, UINT8, UINT8) + scale_imm_add_and_clamp(const int32_t, const rgbaint_t&); + static bilinear_filter(uint32_t, uint32_t, uint32_t, uint32_t, uint8_t, uint8_t) + bilinear_filter_rgbaint(uint32_t, uint32_t, uint32_t, uint32_t, uint8_t, uint8_t) */ auto random_i32_nolimit = [this] { - INT32 result; - do { result = random_i32(); } while ((result == std::numeric_limits::min()) || (result == std::numeric_limits::max())); + int32_t result; + do { result = random_i32(); } while ((result == std::numeric_limits::min()) || (result == std::numeric_limits::max())); return result; }; - volatile INT32 expected_a, expected_r, expected_g, expected_b; - volatile INT32 actual_a, actual_r, actual_g, actual_b; - volatile INT32 imm; + volatile int32_t expected_a, expected_r, expected_g, expected_b; + volatile int32_t actual_a, actual_r, actual_g, actual_b; + volatile int32_t imm; rgbaint_t rgb, other; rgb_t packed; auto check_expected = [&] (const char *desc) { - const volatile INT32 a = rgb.get_a32(); - const volatile INT32 r = rgb.get_r32(); - const volatile INT32 g = rgb.get_g32(); - const volatile INT32 b = rgb.get_b32(); + const volatile int32_t a = rgb.get_a32(); + const volatile int32_t r = rgb.get_r32(); + const volatile int32_t g = rgb.get_g32(); + const volatile int32_t b = rgb.get_b32(); if (a != expected_a) osd_printf_error("Error testing %s get_a32() = %d (expected %d)\n", desc, a, expected_a); if (r != expected_r) osd_printf_error("Error testing %s get_r32() = %d (expected %d)\n", desc, r, expected_r); if (g != expected_g) osd_printf_error("Error testing %s get_g32() = %d (expected %d)\n", desc, g, expected_g); @@ -830,14 +830,14 @@ void validity_checker::validate_rgb() check_expected("rgbaint_t::xor_imm_rgba"); // test 8-bit get - expected_a = INT32(UINT32(expected_a) & 0x00ff); - expected_r = INT32(UINT32(expected_r) & 0x00ff); - expected_g = INT32(UINT32(expected_g) & 0x00ff); - expected_b = INT32(UINT32(expected_b) & 0x00ff); - actual_a = INT32(UINT32(rgb.get_a())); - actual_r = INT32(UINT32(rgb.get_r())); - actual_g = INT32(UINT32(rgb.get_g())); - actual_b = INT32(UINT32(rgb.get_b())); + expected_a = int32_t(uint32_t(expected_a) & 0x00ff); + expected_r = int32_t(uint32_t(expected_r) & 0x00ff); + expected_g = int32_t(uint32_t(expected_g) & 0x00ff); + expected_b = int32_t(uint32_t(expected_b) & 0x00ff); + actual_a = int32_t(uint32_t(rgb.get_a())); + actual_r = int32_t(uint32_t(rgb.get_r())); + actual_g = int32_t(uint32_t(rgb.get_g())); + actual_b = int32_t(uint32_t(rgb.get_b())); if (actual_a != expected_a) osd_printf_error("Error testing rgbaint_t::get_a() = %d (expected %d)\n", actual_a, expected_a); if (actual_r != expected_r) osd_printf_error("Error testing rgbaint_t::get_r() = %d (expected %d)\n", actual_r, expected_r); if (actual_g != expected_g) osd_printf_error("Error testing rgbaint_t::get_g() = %d (expected %d)\n", actual_g, expected_g); @@ -845,88 +845,88 @@ void validity_checker::validate_rgb() // test set from packed RGBA imm = random_i32(); - expected_a = INT32((UINT32(imm) >> 24) & 0x00ff); - expected_r = INT32((UINT32(imm) >> 16) & 0x00ff); - expected_g = INT32((UINT32(imm) >> 8) & 0x00ff); - expected_b = INT32((UINT32(imm) >> 0) & 0x00ff); - rgb.set(UINT32(imm)); - check_expected("rgbaint_t::set(UINT32)"); + expected_a = int32_t((uint32_t(imm) >> 24) & 0x00ff); + expected_r = int32_t((uint32_t(imm) >> 16) & 0x00ff); + expected_g = int32_t((uint32_t(imm) >> 8) & 0x00ff); + expected_b = int32_t((uint32_t(imm) >> 0) & 0x00ff); + rgb.set(uint32_t(imm)); + check_expected("rgbaint_t::set(uint32_t)"); // while we have a value loaded that we know doesn't exceed 8-bit range, check the non-clamping convert-to-rgba packed = rgb.to_rgba(); - if (UINT32(imm) != UINT32(packed)) - osd_printf_error("Error testing rgbaint_t::to_rgba() = %08x (expected %08x)\n", UINT32(packed), UINT32(imm)); + if (uint32_t(imm) != uint32_t(packed)) + osd_printf_error("Error testing rgbaint_t::to_rgba() = %08x (expected %08x)\n", uint32_t(packed), uint32_t(imm)); // test construct from packed RGBA and assign imm = random_i32(); - expected_a = INT32((UINT32(imm) >> 24) & 0x00ff); - expected_r = INT32((UINT32(imm) >> 16) & 0x00ff); - expected_g = INT32((UINT32(imm) >> 8) & 0x00ff); - expected_b = INT32((UINT32(imm) >> 0) & 0x00ff); - rgb = rgbaint_t(UINT32(imm)); - check_expected("rgbaint_t(UINT32)"); + expected_a = int32_t((uint32_t(imm) >> 24) & 0x00ff); + expected_r = int32_t((uint32_t(imm) >> 16) & 0x00ff); + expected_g = int32_t((uint32_t(imm) >> 8) & 0x00ff); + expected_b = int32_t((uint32_t(imm) >> 0) & 0x00ff); + rgb = rgbaint_t(uint32_t(imm)); + check_expected("rgbaint_t(uint32_t)"); // while we have a value loaded that we know doesn't exceed 8-bit range, check the non-clamping convert-to-rgba packed = rgb.to_rgba(); - if (UINT32(imm) != UINT32(packed)) - osd_printf_error("Error testing rgbaint_t::to_rgba() = %08x (expected %08x)\n", UINT32(packed), UINT32(imm)); + if (uint32_t(imm) != uint32_t(packed)) + osd_printf_error("Error testing rgbaint_t::to_rgba() = %08x (expected %08x)\n", uint32_t(packed), uint32_t(imm)); // test set with rgb_t packed = random_u32(); - expected_a = INT32(UINT32(packed.a())); - expected_r = INT32(UINT32(packed.r())); - expected_g = INT32(UINT32(packed.g())); - expected_b = INT32(UINT32(packed.b())); + expected_a = int32_t(uint32_t(packed.a())); + expected_r = int32_t(uint32_t(packed.r())); + expected_g = int32_t(uint32_t(packed.g())); + expected_b = int32_t(uint32_t(packed.b())); rgb.set(packed); check_expected("rgbaint_t::set(rgba_t)"); // test construct with rgb_t packed = random_u32(); - expected_a = INT32(UINT32(packed.a())); - expected_r = INT32(UINT32(packed.r())); - expected_g = INT32(UINT32(packed.g())); - expected_b = INT32(UINT32(packed.b())); + expected_a = int32_t(uint32_t(packed.a())); + expected_r = int32_t(uint32_t(packed.r())); + expected_g = int32_t(uint32_t(packed.g())); + expected_b = int32_t(uint32_t(packed.b())); rgb = rgbaint_t(packed); check_expected("rgbaint_t::set(rgba_t)"); // test clamping convert-to-rgba with hand-crafted values to catch edge cases - rgb.set(std::numeric_limits::min(), -1, 0, 1); + rgb.set(std::numeric_limits::min(), -1, 0, 1); packed = rgb.to_rgba_clamp(); - if (UINT32(0x00000001) != UINT32(packed)) - osd_printf_error("Error testing rgbaint_t::to_rgba_clamp() = %08x (expected 0x00000001)\n", UINT32(packed)); - rgb.set(254, 255, 256, std::numeric_limits::max()); + if (uint32_t(0x00000001) != uint32_t(packed)) + osd_printf_error("Error testing rgbaint_t::to_rgba_clamp() = %08x (expected 0x00000001)\n", uint32_t(packed)); + rgb.set(254, 255, 256, std::numeric_limits::max()); packed = rgb.to_rgba_clamp(); - if (UINT32(0xfeffffff) != UINT32(packed)) - osd_printf_error("Error testing rgbaint_t::to_rgba_clamp() = %08x (expected 0xfeffffff)\n", UINT32(packed)); - rgb.set(std::numeric_limits::max(), std::numeric_limits::min(), 256, -1); + if (uint32_t(0xfeffffff) != uint32_t(packed)) + osd_printf_error("Error testing rgbaint_t::to_rgba_clamp() = %08x (expected 0xfeffffff)\n", uint32_t(packed)); + rgb.set(std::numeric_limits::max(), std::numeric_limits::min(), 256, -1); packed = rgb.to_rgba_clamp(); - if (UINT32(0xff00ff00) != UINT32(packed)) - osd_printf_error("Error testing rgbaint_t::to_rgba_clamp() = %08x (expected 0xff00ff00)\n", UINT32(packed)); + if (uint32_t(0xff00ff00) != uint32_t(packed)) + osd_printf_error("Error testing rgbaint_t::to_rgba_clamp() = %08x (expected 0xff00ff00)\n", uint32_t(packed)); rgb.set(0, 255, 1, 254); packed = rgb.to_rgba_clamp(); - if (UINT32(0x00ff01fe) != UINT32(packed)) - osd_printf_error("Error testing rgbaint_t::to_rgba_clamp() = %08x (expected 0x00ff01fe)\n", UINT32(packed)); + if (uint32_t(0x00ff01fe) != uint32_t(packed)) + osd_printf_error("Error testing rgbaint_t::to_rgba_clamp() = %08x (expected 0x00ff01fe)\n", uint32_t(packed)); // test in-place clamping with hand-crafted values to catch edge cases expected_a = 0; expected_r = 0; expected_g = 0; expected_b = 1; - rgb.set(std::numeric_limits::min(), -1, 0, 1); + rgb.set(std::numeric_limits::min(), -1, 0, 1); rgb.clamp_to_uint8(); check_expected("rgbaint_t::clamp_to_uint8"); expected_a = 254; expected_r = 255; expected_g = 255; expected_b = 255; - rgb.set(254, 255, 256, std::numeric_limits::max()); + rgb.set(254, 255, 256, std::numeric_limits::max()); rgb.clamp_to_uint8(); check_expected("rgbaint_t::clamp_to_uint8"); expected_a = 255; expected_r = 0; expected_g = 255; expected_b = 0; - rgb.set(std::numeric_limits::max(), std::numeric_limits::min(), 256, -1); + rgb.set(std::numeric_limits::max(), std::numeric_limits::min(), 256, -1); rgb.clamp_to_uint8(); check_expected("rgbaint_t::clamp_to_uint8"); expected_a = 0; @@ -956,37 +956,37 @@ void validity_checker::validate_rgb() check_expected("rgbaint_t::shl_imm"); // test logical shift right - expected_a = INT32(UINT32(actual_a = random_i32()) >> 8); - expected_r = INT32(UINT32(actual_r = random_i32()) >> 18); - expected_g = INT32(UINT32(actual_g = random_i32()) >> 26); - expected_b = INT32(UINT32(actual_b = random_i32()) >> 4); + expected_a = int32_t(uint32_t(actual_a = random_i32()) >> 8); + expected_r = int32_t(uint32_t(actual_r = random_i32()) >> 18); + expected_g = int32_t(uint32_t(actual_g = random_i32()) >> 26); + expected_b = int32_t(uint32_t(actual_b = random_i32()) >> 4); rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.shr(rgbaint_t(8, 18, 26, 4)); check_expected("rgbaint_t::shr"); // test logical shift right with opposite signs - expected_a = INT32(UINT32(actual_a = -actual_a) >> 21); - expected_r = INT32(UINT32(actual_r = -actual_r) >> 13); - expected_g = INT32(UINT32(actual_g = -actual_g) >> 11); - expected_b = INT32(UINT32(actual_b = -actual_b) >> 17); + expected_a = int32_t(uint32_t(actual_a = -actual_a) >> 21); + expected_r = int32_t(uint32_t(actual_r = -actual_r) >> 13); + expected_g = int32_t(uint32_t(actual_g = -actual_g) >> 11); + expected_b = int32_t(uint32_t(actual_b = -actual_b) >> 17); rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.shr(rgbaint_t(21, 13, 11, 17)); check_expected("rgbaint_t::shr"); // test logical shift right immediate - expected_a = INT32(UINT32(actual_a = random_i32()) >> 5); - expected_r = INT32(UINT32(actual_r = random_i32()) >> 5); - expected_g = INT32(UINT32(actual_g = random_i32()) >> 5); - expected_b = INT32(UINT32(actual_b = random_i32()) >> 5); + expected_a = int32_t(uint32_t(actual_a = random_i32()) >> 5); + expected_r = int32_t(uint32_t(actual_r = random_i32()) >> 5); + expected_g = int32_t(uint32_t(actual_g = random_i32()) >> 5); + expected_b = int32_t(uint32_t(actual_b = random_i32()) >> 5); rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.shr_imm(5); check_expected("rgbaint_t::shr_imm"); // test logical shift right immediate with opposite signs - expected_a = INT32(UINT32(actual_a = -actual_a) >> 15); - expected_r = INT32(UINT32(actual_r = -actual_r) >> 15); - expected_g = INT32(UINT32(actual_g = -actual_g) >> 15); - expected_b = INT32(UINT32(actual_b = -actual_b) >> 15); + expected_a = int32_t(uint32_t(actual_a = -actual_a) >> 15); + expected_r = int32_t(uint32_t(actual_r = -actual_r) >> 15); + expected_g = int32_t(uint32_t(actual_g = -actual_g) >> 15); + expected_b = int32_t(uint32_t(actual_b = -actual_b) >> 15); rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.shr_imm(15); check_expected("rgbaint_t::shr_imm"); @@ -1050,19 +1050,19 @@ void validity_checker::validate_rgb() actual_r = random_i32_nolimit(); actual_g = random_i32_nolimit(); actual_b = random_i32_nolimit(); - expected_a = ~INT32(0); + expected_a = ~int32_t(0); expected_r = 0; expected_g = 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpeq(rgbaint_t(actual_a, actual_r - 1, actual_g + 1, std::numeric_limits::min())); + rgb.cmpeq(rgbaint_t(actual_a, actual_r - 1, actual_g + 1, std::numeric_limits::min())); check_expected("rgbaint_t::cmpeq"); expected_a = 0; - expected_r = ~INT32(0); + expected_r = ~int32_t(0); expected_g = 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpeq(rgbaint_t(std::numeric_limits::max(), actual_r, actual_g - 1, actual_b + 1)); + rgb.cmpeq(rgbaint_t(std::numeric_limits::max(), actual_r, actual_g - 1, actual_b + 1)); check_expected("rgbaint_t::cmpeq"); // test immediate equality comparison @@ -1070,31 +1070,31 @@ void validity_checker::validate_rgb() actual_r = random_i32_nolimit(); actual_g = random_i32_nolimit(); actual_b = random_i32_nolimit(); - expected_a = ~INT32(0); - expected_r = (actual_r == actual_a) ? ~INT32(0) : 0; - expected_g = (actual_g == actual_a) ? ~INT32(0) : 0; - expected_b = (actual_b == actual_a) ? ~INT32(0) : 0; + expected_a = ~int32_t(0); + expected_r = (actual_r == actual_a) ? ~int32_t(0) : 0; + expected_g = (actual_g == actual_a) ? ~int32_t(0) : 0; + expected_b = (actual_b == actual_a) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpeq_imm(actual_a); check_expected("rgbaint_t::cmpeq_imm"); - expected_a = (actual_a == actual_r) ? ~INT32(0) : 0; - expected_r = ~INT32(0); - expected_g = (actual_g == actual_r) ? ~INT32(0) : 0; - expected_b = (actual_b == actual_r) ? ~INT32(0) : 0; + expected_a = (actual_a == actual_r) ? ~int32_t(0) : 0; + expected_r = ~int32_t(0); + expected_g = (actual_g == actual_r) ? ~int32_t(0) : 0; + expected_b = (actual_b == actual_r) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpeq_imm(actual_r); check_expected("rgbaint_t::cmpeq_imm"); - expected_a = (actual_a == actual_g) ? ~INT32(0) : 0; - expected_r = (actual_r == actual_g) ? ~INT32(0) : 0; - expected_g = ~INT32(0); - expected_b = (actual_b == actual_g) ? ~INT32(0) : 0; + expected_a = (actual_a == actual_g) ? ~int32_t(0) : 0; + expected_r = (actual_r == actual_g) ? ~int32_t(0) : 0; + expected_g = ~int32_t(0); + expected_b = (actual_b == actual_g) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpeq_imm(actual_g); check_expected("rgbaint_t::cmpeq_imm"); - expected_a = (actual_a == actual_b) ? ~INT32(0) : 0; - expected_r = (actual_r == actual_b) ? ~INT32(0) : 0; - expected_g = (actual_g == actual_b) ? ~INT32(0) : 0; - expected_b = ~INT32(0); + expected_a = (actual_a == actual_b) ? ~int32_t(0) : 0; + expected_r = (actual_r == actual_b) ? ~int32_t(0) : 0; + expected_g = (actual_g == actual_b) ? ~int32_t(0) : 0; + expected_b = ~int32_t(0); rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpeq_imm(actual_b); check_expected("rgbaint_t::cmpeq_imm"); @@ -1103,12 +1103,12 @@ void validity_checker::validate_rgb() expected_g = 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpeq_imm(std::numeric_limits::min()); + rgb.cmpeq_imm(std::numeric_limits::min()); check_expected("rgbaint_t::cmpeq_imm"); - expected_a = !actual_a ? ~INT32(0) : 0; - expected_r = !actual_r ? ~INT32(0) : 0; - expected_g = !actual_g ? ~INT32(0) : 0; - expected_b = !actual_b ? ~INT32(0) : 0; + expected_a = !actual_a ? ~int32_t(0) : 0; + expected_r = !actual_r ? ~int32_t(0) : 0; + expected_g = !actual_g ? ~int32_t(0) : 0; + expected_b = !actual_b ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpeq_imm(0); check_expected("rgbaint_t::cmpeq_imm"); @@ -1117,7 +1117,7 @@ void validity_checker::validate_rgb() expected_g = 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpeq_imm(std::numeric_limits::max()); + rgb.cmpeq_imm(std::numeric_limits::max()); check_expected("rgbaint_t::cmpeq_imm"); // test immediate RGB equality comparison @@ -1127,17 +1127,17 @@ void validity_checker::validate_rgb() actual_b = random_i32_nolimit(); expected_a = 0; expected_r = 0; - expected_g = ~INT32(0); + expected_g = ~int32_t(0); expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpeq_imm_rgba(std::numeric_limits::min(), std::numeric_limits::max(), actual_g, actual_b - 1); + rgb.cmpeq_imm_rgba(std::numeric_limits::min(), std::numeric_limits::max(), actual_g, actual_b - 1); check_expected("rgbaint_t::cmpeq_imm_rgba"); expected_a = 0; expected_r = 0; expected_g = 0; - expected_b = ~INT32(0); + expected_b = ~int32_t(0); rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpeq_imm_rgba(actual_a + 1, std::numeric_limits::min(), std::numeric_limits::max(), actual_b); + rgb.cmpeq_imm_rgba(actual_a + 1, std::numeric_limits::min(), std::numeric_limits::max(), actual_b); check_expected("rgbaint_t::cmpeq_imm_rgba"); // test RGB greater than comparison @@ -1146,18 +1146,18 @@ void validity_checker::validate_rgb() actual_g = random_i32_nolimit(); actual_b = random_i32_nolimit(); expected_a = 0; - expected_r = ~INT32(0); + expected_r = ~int32_t(0); expected_g = 0; - expected_b = ~INT32(0); + expected_b = ~int32_t(0); rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpgt(rgbaint_t(actual_a, actual_r - 1, actual_g + 1, std::numeric_limits::min())); + rgb.cmpgt(rgbaint_t(actual_a, actual_r - 1, actual_g + 1, std::numeric_limits::min())); check_expected("rgbaint_t::cmpgt"); expected_a = 0; expected_r = 0; - expected_g = ~INT32(0); + expected_g = ~int32_t(0); expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpgt(rgbaint_t(std::numeric_limits::max(), actual_r, actual_g - 1, actual_b + 1)); + rgb.cmpgt(rgbaint_t(std::numeric_limits::max(), actual_r, actual_g - 1, actual_b + 1)); check_expected("rgbaint_t::cmpgt"); // test immediate greater than comparison @@ -1166,44 +1166,44 @@ void validity_checker::validate_rgb() actual_g = random_i32_nolimit(); actual_b = random_i32_nolimit(); expected_a = 0; - expected_r = (actual_r > actual_a) ? ~INT32(0) : 0; - expected_g = (actual_g > actual_a) ? ~INT32(0) : 0; - expected_b = (actual_b > actual_a) ? ~INT32(0) : 0; + expected_r = (actual_r > actual_a) ? ~int32_t(0) : 0; + expected_g = (actual_g > actual_a) ? ~int32_t(0) : 0; + expected_b = (actual_b > actual_a) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpgt_imm(actual_a); check_expected("rgbaint_t::cmpgt_imm"); - expected_a = (actual_a > actual_r) ? ~INT32(0) : 0; + expected_a = (actual_a > actual_r) ? ~int32_t(0) : 0; expected_r = 0; - expected_g = (actual_g > actual_r) ? ~INT32(0) : 0; - expected_b = (actual_b > actual_r) ? ~INT32(0) : 0; + expected_g = (actual_g > actual_r) ? ~int32_t(0) : 0; + expected_b = (actual_b > actual_r) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpgt_imm(actual_r); check_expected("rgbaint_t::cmpgt_imm"); - expected_a = (actual_a > actual_g) ? ~INT32(0) : 0; - expected_r = (actual_r > actual_g) ? ~INT32(0) : 0; + expected_a = (actual_a > actual_g) ? ~int32_t(0) : 0; + expected_r = (actual_r > actual_g) ? ~int32_t(0) : 0; expected_g =0; - expected_b = (actual_b > actual_g) ? ~INT32(0) : 0; + expected_b = (actual_b > actual_g) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpgt_imm(actual_g); check_expected("rgbaint_t::cmpgt_imm"); - expected_a = (actual_a > actual_b) ? ~INT32(0) : 0; - expected_r = (actual_r > actual_b) ? ~INT32(0) : 0; - expected_g = (actual_g > actual_b) ? ~INT32(0) : 0; + expected_a = (actual_a > actual_b) ? ~int32_t(0) : 0; + expected_r = (actual_r > actual_b) ? ~int32_t(0) : 0; + expected_g = (actual_g > actual_b) ? ~int32_t(0) : 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpgt_imm(actual_b); check_expected("rgbaint_t::cmpgt_imm"); - expected_a = ~INT32(0); - expected_r = ~INT32(0); - expected_g = ~INT32(0); - expected_b = ~INT32(0); + expected_a = ~int32_t(0); + expected_r = ~int32_t(0); + expected_g = ~int32_t(0); + expected_b = ~int32_t(0); rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpgt_imm(std::numeric_limits::min()); + rgb.cmpgt_imm(std::numeric_limits::min()); check_expected("rgbaint_t::cmpgt_imm"); - expected_a = (actual_a > 0) ? ~INT32(0) : 0; - expected_r = (actual_r > 0) ? ~INT32(0) : 0; - expected_g = (actual_g > 0) ? ~INT32(0) : 0; - expected_b = (actual_b > 0) ? ~INT32(0) : 0; + expected_a = (actual_a > 0) ? ~int32_t(0) : 0; + expected_r = (actual_r > 0) ? ~int32_t(0) : 0; + expected_g = (actual_g > 0) ? ~int32_t(0) : 0; + expected_b = (actual_b > 0) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmpgt_imm(0); check_expected("rgbaint_t::cmpgt_imm"); @@ -1212,7 +1212,7 @@ void validity_checker::validate_rgb() expected_g = 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpgt_imm(std::numeric_limits::max()); + rgb.cmpgt_imm(std::numeric_limits::max()); check_expected("rgbaint_t::cmpgt_imm"); // test immediate RGB greater than comparison @@ -1220,19 +1220,19 @@ void validity_checker::validate_rgb() actual_r = random_i32_nolimit(); actual_g = random_i32_nolimit(); actual_b = random_i32_nolimit(); - expected_a = ~INT32(0); + expected_a = ~int32_t(0); expected_r = 0; expected_g = 0; - expected_b = ~INT32(0); + expected_b = ~int32_t(0); rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpgt_imm_rgba(std::numeric_limits::min(), std::numeric_limits::max(), actual_g, actual_b - 1); + rgb.cmpgt_imm_rgba(std::numeric_limits::min(), std::numeric_limits::max(), actual_g, actual_b - 1); check_expected("rgbaint_t::cmpgt_imm_rgba"); expected_a = 0; - expected_r = ~INT32(0); + expected_r = ~int32_t(0); expected_g = 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmpgt_imm_rgba(actual_a + 1, std::numeric_limits::min(), std::numeric_limits::max(), actual_b); + rgb.cmpgt_imm_rgba(actual_a + 1, std::numeric_limits::min(), std::numeric_limits::max(), actual_b); check_expected("rgbaint_t::cmpgt_imm_rgba"); // test RGB less than comparison @@ -1242,17 +1242,17 @@ void validity_checker::validate_rgb() actual_b = random_i32_nolimit(); expected_a = 0; expected_r = 0; - expected_g = ~INT32(0); + expected_g = ~int32_t(0); expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmplt(rgbaint_t(actual_a, actual_r - 1, actual_g + 1, std::numeric_limits::min())); + rgb.cmplt(rgbaint_t(actual_a, actual_r - 1, actual_g + 1, std::numeric_limits::min())); check_expected("rgbaint_t::cmplt"); - expected_a = ~INT32(0); + expected_a = ~int32_t(0); expected_r = 0; expected_g = 0; - expected_b = ~INT32(0); + expected_b = ~int32_t(0); rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmplt(rgbaint_t(std::numeric_limits::max(), actual_r, actual_g - 1, actual_b + 1)); + rgb.cmplt(rgbaint_t(std::numeric_limits::max(), actual_r, actual_g - 1, actual_b + 1)); check_expected("rgbaint_t::cmplt"); // test immediate less than comparison @@ -1261,29 +1261,29 @@ void validity_checker::validate_rgb() actual_g = random_i32_nolimit(); actual_b = random_i32_nolimit(); expected_a = 0; - expected_r = (actual_r < actual_a) ? ~INT32(0) : 0; - expected_g = (actual_g < actual_a) ? ~INT32(0) : 0; - expected_b = (actual_b < actual_a) ? ~INT32(0) : 0; + expected_r = (actual_r < actual_a) ? ~int32_t(0) : 0; + expected_g = (actual_g < actual_a) ? ~int32_t(0) : 0; + expected_b = (actual_b < actual_a) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmplt_imm(actual_a); check_expected("rgbaint_t::cmplt_imm"); - expected_a = (actual_a < actual_r) ? ~INT32(0) : 0; + expected_a = (actual_a < actual_r) ? ~int32_t(0) : 0; expected_r = 0; - expected_g = (actual_g < actual_r) ? ~INT32(0) : 0; - expected_b = (actual_b < actual_r) ? ~INT32(0) : 0; + expected_g = (actual_g < actual_r) ? ~int32_t(0) : 0; + expected_b = (actual_b < actual_r) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmplt_imm(actual_r); check_expected("rgbaint_t::cmplt_imm"); - expected_a = (actual_a < actual_g) ? ~INT32(0) : 0; - expected_r = (actual_r < actual_g) ? ~INT32(0) : 0; + expected_a = (actual_a < actual_g) ? ~int32_t(0) : 0; + expected_r = (actual_r < actual_g) ? ~int32_t(0) : 0; expected_g =0; - expected_b = (actual_b < actual_g) ? ~INT32(0) : 0; + expected_b = (actual_b < actual_g) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmplt_imm(actual_g); check_expected("rgbaint_t::cmplt_imm"); - expected_a = (actual_a < actual_b) ? ~INT32(0) : 0; - expected_r = (actual_r < actual_b) ? ~INT32(0) : 0; - expected_g = (actual_g < actual_b) ? ~INT32(0) : 0; + expected_a = (actual_a < actual_b) ? ~int32_t(0) : 0; + expected_r = (actual_r < actual_b) ? ~int32_t(0) : 0; + expected_g = (actual_g < actual_b) ? ~int32_t(0) : 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmplt_imm(actual_b); @@ -1293,21 +1293,21 @@ void validity_checker::validate_rgb() expected_g = 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmplt_imm(std::numeric_limits::min()); + rgb.cmplt_imm(std::numeric_limits::min()); check_expected("rgbaint_t::cmplt_imm"); - expected_a = (actual_a < 0) ? ~INT32(0) : 0; - expected_r = (actual_r < 0) ? ~INT32(0) : 0; - expected_g = (actual_g < 0) ? ~INT32(0) : 0; - expected_b = (actual_b < 0) ? ~INT32(0) : 0; + expected_a = (actual_a < 0) ? ~int32_t(0) : 0; + expected_r = (actual_r < 0) ? ~int32_t(0) : 0; + expected_g = (actual_g < 0) ? ~int32_t(0) : 0; + expected_b = (actual_b < 0) ? ~int32_t(0) : 0; rgb.set(actual_a, actual_r, actual_g, actual_b); rgb.cmplt_imm(0); check_expected("rgbaint_t::cmplt_imm"); - expected_a = ~INT32(0); - expected_r = ~INT32(0); - expected_g = ~INT32(0); - expected_b = ~INT32(0); + expected_a = ~int32_t(0); + expected_r = ~int32_t(0); + expected_g = ~int32_t(0); + expected_b = ~int32_t(0); rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmplt_imm(std::numeric_limits::max()); + rgb.cmplt_imm(std::numeric_limits::max()); check_expected("rgbaint_t::cmplt_imm"); // test immediate RGB less than comparison @@ -1316,18 +1316,18 @@ void validity_checker::validate_rgb() actual_g = random_i32_nolimit(); actual_b = random_i32_nolimit(); expected_a = 0; - expected_r = ~INT32(0); + expected_r = ~int32_t(0); expected_g = 0; expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmplt_imm_rgba(std::numeric_limits::min(), std::numeric_limits::max(), actual_g, actual_b - 1); + rgb.cmplt_imm_rgba(std::numeric_limits::min(), std::numeric_limits::max(), actual_g, actual_b - 1); check_expected("rgbaint_t::cmplt_imm_rgba"); - expected_a = ~INT32(0); + expected_a = ~int32_t(0); expected_r = 0; - expected_g = ~INT32(0); + expected_g = ~int32_t(0); expected_b = 0; rgb.set(actual_a, actual_r, actual_g, actual_b); - rgb.cmplt_imm_rgba(actual_a + 1, std::numeric_limits::min(), std::numeric_limits::max(), actual_b); + rgb.cmplt_imm_rgba(actual_a + 1, std::numeric_limits::min(), std::numeric_limits::max(), actual_b); check_expected("rgbaint_t::cmplt_imm_rgba"); } @@ -1388,7 +1388,7 @@ void validity_checker::validate_driver() // make sure the year is only digits, '?' or '+' for (const char *s = m_current_driver->year; *s != 0; s++) - if (!isdigit((UINT8)*s) && *s != '?' && *s != '+') + if (!isdigit((uint8_t)*s) && *s != '?' && *s != '+') { osd_printf_error("Driver has an invalid year '%s'\n", m_current_driver->year); break; @@ -1437,7 +1437,7 @@ void validity_checker::validate_roms() // scan the ROM entries for this device const char *last_region_name = "???"; const char *last_name = "???"; - UINT32 current_length = 0; + uint32_t current_length = 0; int items_since_region = 1; int last_bios = 0; int total_files = 0; @@ -1538,7 +1538,7 @@ void validity_checker::validate_analog_input_field(ioport_field &field) for (shift = 0; shift <= 31 && (~field.mask() & (1 << shift)) != 0; shift++) { } // convert the positional max value to be in the bitmask for testing - //INT32 analog_max = field.maxval(); + //int32_t analog_max = field.maxval(); //analog_max = (analog_max - 1) << shift; // positional port size must fit in bits used @@ -1550,9 +1550,9 @@ void validity_checker::validate_analog_input_field(ioport_field &field) else if (field.type() > IPT_ANALOG_ABSOLUTE_FIRST && field.type() < IPT_ANALOG_ABSOLUTE_LAST) { // adjust for signed values - INT32 default_value = field.defvalue(); - INT32 analog_min = field.minval(); - INT32 analog_max = field.maxval(); + int32_t default_value = field.defvalue(); + int32_t analog_min = field.minval(); + int32_t analog_max = field.maxval(); if (analog_min > analog_max) { analog_min = -analog_min; @@ -1606,7 +1606,7 @@ void validity_checker::validate_dip_settings(ioport_field &field) { const char *demo_sounds = ioport_string_from_index(INPUT_STRING_Demo_Sounds); const char *flipscreen = ioport_string_from_index(INPUT_STRING_Flip_Screen); - UINT8 coin_list[__input_string_coinage_end + 1 - __input_string_coinage_start] = { 0 }; + uint8_t coin_list[__input_string_coinage_end + 1 - __input_string_coinage_start] = { 0 }; bool coin_error = false; // iterate through the settings diff --git a/src/emu/validity.h b/src/emu/validity.h index 495e9d934a6..f74b25599ff 100644 --- a/src/emu/validity.h +++ b/src/emu/validity.h @@ -64,7 +64,7 @@ private: typedef std::unordered_map int_map; // internal helpers - const char *ioport_string_from_index(UINT32 index); + const char *ioport_string_from_index(uint32_t index); int get_defstr_index(const char *string, bool suppress_error = false); // core helpers @@ -90,10 +90,10 @@ private: void output_indented_errors(std::string &text, const char *header); // random number generation - INT32 random_i32(); - UINT32 random_u32(); - INT64 random_i64(); - UINT64 random_u64(); + int32_t random_i32(); + uint32_t random_u32(); + int64_t random_i64(); + uint64_t random_u64(); // internal driver list driver_enumerator m_drivlist; diff --git a/src/emu/video.cpp b/src/emu/video.cpp index 627b2f1f6da..d91467bdbd7 100644 --- a/src/emu/video.cpp +++ b/src/emu/video.cpp @@ -57,7 +57,7 @@ const bool video_manager::s_skiptable[FRAMESKIP_LEVELS][FRAMESKIP_LEVELS] = // VIDEO MANAGER //************************************************************************** -static void video_notifier_callback(const char *outname, INT32 value, void *param) +static void video_notifier_callback(const char *outname, int32_t value, void *param) { video_manager *vm = (video_manager *)param; @@ -553,7 +553,7 @@ void video_manager::end_recording(movie_format format) // recording //------------------------------------------------- -void video_manager::add_sound_to_recording(const INT16 *sound, int numsamples) +void video_manager::add_sound_to_recording(const int16_t *sound, int numsamples) { // only record if we have a file if (m_avi_file != nullptr) @@ -770,7 +770,7 @@ void video_manager::update_throttle(attotime emutime) restoring from a saved state */ - static const UINT8 popcount[256] = + static const uint8_t popcount[256] = { 0,1,1,2,1,2,2,3, 1,2,2,3,2,3,3,4, 1,2,2,3,2,3,3,4, 2,3,3,4,3,4,4,5, 1,2,2,3,2,3,3,4, 2,3,3,4,3,4,4,5, 2,3,3,4,3,4,4,5, 3,4,4,5,4,5,5,6, @@ -1017,8 +1017,8 @@ void video_manager::update_refresh_speed() // compute a target speed as an integral percentage // note that we lop 0.25Hz off of the minrefresh when doing the computation to allow for // the fact that most refresh rates are not accurate to 10 digits... - UINT32 target_speed = floor((minrefresh - 0.25) * 1000.0 / ATTOSECONDS_TO_HZ(min_frame_period)); - UINT32 original_speed = original_speed_setting(); + uint32_t target_speed = floor((minrefresh - 0.25) * 1000.0 / ATTOSECONDS_TO_HZ(min_frame_period)); + uint32_t original_speed = original_speed_setting(); target_speed = std::min(target_speed, original_speed); // if we changed, log that verbosely @@ -1102,8 +1102,8 @@ void video_manager::recompute_speed(const attotime &emutime) // given screen //------------------------------------------------- -typedef software_renderer snap_renderer_bilinear; -typedef software_renderer snap_renderer; +typedef software_renderer snap_renderer_bilinear; +typedef software_renderer snap_renderer; void video_manager::create_snapshot_bitmap(screen_device *screen) { @@ -1117,8 +1117,8 @@ void video_manager::create_snapshot_bitmap(screen_device *screen) } // get the minimum width/height and set it on the target - INT32 width = m_snap_width; - INT32 height = m_snap_height; + int32_t width = m_snap_width; + int32_t height = m_snap_height; if (width == 0 || height == 0) m_snap_target->compute_minimum_size(width, height); m_snap_target->set_bounds(width, height); @@ -1146,7 +1146,7 @@ void video_manager::create_snapshot_bitmap(screen_device *screen) osd_file::error video_manager::open_next(emu_file &file, const char *extension) { - UINT32 origflags = file.openflags(); + uint32_t origflags = file.openflags(); // handle defaults const char *snapname = machine().options().snap_name(); diff --git a/src/emu/video.h b/src/emu/video.h index 64536083764..3df073e9451 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -95,7 +95,7 @@ public: // movies void begin_recording(const char *name, movie_format format); void end_recording(movie_format format); - void add_sound_to_recording(const INT16 *sound, int numsamples); + void add_sound_to_recording(const int16_t *sound, int numsamples); void set_timecode_enabled(bool value) { m_timecode_enabled = value; } bool get_timecode_enabled() { return m_timecode_enabled; } @@ -143,7 +143,7 @@ private: osd_ticks_t m_throttle_last_ticks; // osd_ticks the last call to throttle attotime m_throttle_realtime; // real time the last call to throttle attotime m_throttle_emutime; // emulated time the last call to throttle - UINT32 m_throttle_history; // history of frames where we were fast enough + uint32_t m_throttle_history; // history of frames where we were fast enough // dynamic speed computation osd_ticks_t m_speed_last_realtime; // real time at the last speed calculation @@ -151,24 +151,24 @@ private: double m_speed_percent; // most recent speed percentage // overall speed computation - UINT32 m_overall_real_seconds; // accumulated real seconds at normal speed + uint32_t m_overall_real_seconds; // accumulated real seconds at normal speed osd_ticks_t m_overall_real_ticks; // accumulated real ticks at normal speed attotime m_overall_emutime; // accumulated emulated time at normal speed - UINT32 m_overall_valid_counter; // number of consecutive valid time periods + uint32_t m_overall_valid_counter; // number of consecutive valid time periods // configuration bool m_throttled; // flag: TRUE if we're currently throttled float m_throttle_rate; // target rate for throttling bool m_fastforward; // flag: TRUE if we're currently fast-forwarding - UINT32 m_seconds_to_run; // number of seconds to run before quitting + uint32_t m_seconds_to_run; // number of seconds to run before quitting bool m_auto_frameskip; // flag: TRUE if we're automatically frameskipping - UINT32 m_speed; // overall speed (*1000) + uint32_t m_speed; // overall speed (*1000) // frameskipping - UINT8 m_empty_skip_count; // number of empty frames we have skipped - UINT8 m_frameskip_level; // current frameskip level - UINT8 m_frameskip_counter; // counter that counts through the frameskip steps - INT8 m_frameskip_adjust; + uint8_t m_empty_skip_count; // number of empty frames we have skipped + uint8_t m_frameskip_level; // current frameskip level + uint8_t m_frameskip_counter; // counter that counts through the frameskip steps + int8_t m_frameskip_adjust; bool m_skipping_this_frame; // flag: TRUE if we are skipping the current frame osd_ticks_t m_average_oversleep; // average number of ticks the OSD oversleeps @@ -176,20 +176,20 @@ private: render_target * m_snap_target; // screen shapshot target bitmap_rgb32 m_snap_bitmap; // screen snapshot bitmap bool m_snap_native; // are we using native per-screen layouts? - INT32 m_snap_width; // width of snapshots (0 == auto) - INT32 m_snap_height; // height of snapshots (0 == auto) + int32_t m_snap_width; // width of snapshots (0 == auto) + int32_t m_snap_height; // height of snapshots (0 == auto) // movie recording - MNG std::unique_ptr m_mng_file; // handle to the open movie file attotime m_mng_frame_period; // period of a single movie frame attotime m_mng_next_frame_time; // time of next frame - UINT32 m_mng_frame; // current movie frame number + uint32_t m_mng_frame; // current movie frame number // movie recording - AVI avi_file::ptr m_avi_file; // handle to the open movie file attotime m_avi_frame_period; // period of a single movie frame attotime m_avi_next_frame_time; // time of next frame - UINT32 m_avi_frame; // current movie frame number + uint32_t m_avi_frame; // current movie frame number // movie recording - dummy bool m_dummy_recording; // indicates if snapshot should be created of every frame diff --git a/src/emu/video/resnet.cpp b/src/emu/video/resnet.cpp index 0ae03e2ed14..1b467d016c4 100644 --- a/src/emu/video/resnet.cpp +++ b/src/emu/video/resnet.cpp @@ -459,7 +459,7 @@ int compute_res_net(int inputs, int channel, const res_net_info &di) double vcc = di.vcc; double ttlHRes = 0; double rGnd = di.rgb[channel].rGnd; - UINT8 OpenCol = di.OpenCol; + uint8_t OpenCol = di.OpenCol; /* Global options */ @@ -692,15 +692,15 @@ int compute_res_net(int inputs, int channel, const res_net_info &di) return (int) (v * 255 / vcc + 0.4); } -void compute_res_net_all(std::vector &rgb, const UINT8 *prom, const res_net_decode_info &rdi, const res_net_info &di) +void compute_res_net_all(std::vector &rgb, const uint8_t *prom, const res_net_decode_info &rdi, const res_net_info &di) { - UINT8 r,g,b; + uint8_t r,g,b; int i,j,k; rgb.resize(rdi.end - rdi.start + 1); for (i=rdi.start; i<=rdi.end; i++) { - UINT8 t[3] = {0,0,0}; + uint8_t t[3] = {0,0,0}; int s; for (j=0;j &rgb, const UINT8 *prom, const res_net_decode_info &rdi, const res_net_info &di); +void compute_res_net_all(std::vector &rgb, const uint8_t *prom, const res_net_decode_info &rdi, const res_net_info &di); /* legacy interface */ diff --git a/src/emu/video/rgbgen.cpp b/src/emu/video/rgbgen.cpp index 4e7e6042569..ef55504d90c 100644 --- a/src/emu/video/rgbgen.cpp +++ b/src/emu/video/rgbgen.cpp @@ -22,10 +22,10 @@ scale factor -------------------------------------------------*/ -void rgbaint_t::blend(const rgbaint_t& color2, UINT8 color1scale) +void rgbaint_t::blend(const rgbaint_t& color2, uint8_t color1scale) { - INT32 scale1 = (INT32)color1scale; - INT32 scale2 = 256 - scale1; + int32_t scale1 = (int32_t)color1scale; + int32_t scale2 = 256 - scale1; m_a = (m_a * scale1 + color2.m_a * scale2) >> 8; m_r = (m_r * scale1 + color2.m_r * scale2) >> 8; @@ -44,7 +44,7 @@ void rgbaint_t::blend(const rgbaint_t& color2, UINT8 color1scale) per channel, and clamp to byte values -------------------------------------------------*/ -void rgbaint_t::scale_imm_and_clamp(INT32 scale) +void rgbaint_t::scale_imm_and_clamp(int32_t scale) { m_a = (m_a * scale) >> 8; m_r = (m_r * scale) >> 8; @@ -54,10 +54,10 @@ void rgbaint_t::scale_imm_and_clamp(INT32 scale) m_r |= (m_r & 0x00800000) ? 0xff000000 : 0; m_g |= (m_g & 0x00800000) ? 0xff000000 : 0; m_b |= (m_b & 0x00800000) ? 0xff000000 : 0; - if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } - if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } - if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } - if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } + if ((uint32_t)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } + if ((uint32_t)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } + if ((uint32_t)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } + if ((uint32_t)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } } void rgbaint_t::scale_and_clamp(const rgbaint_t& scale) @@ -70,14 +70,14 @@ void rgbaint_t::scale_and_clamp(const rgbaint_t& scale) m_r |= (m_r & 0x00800000) ? 0xff000000 : 0; m_g |= (m_g & 0x00800000) ? 0xff000000 : 0; m_b |= (m_b & 0x00800000) ? 0xff000000 : 0; - if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } - if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } - if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } - if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } + if ((uint32_t)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } + if ((uint32_t)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } + if ((uint32_t)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } + if ((uint32_t)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } } -void rgbaint_t::scale_imm_add_and_clamp(INT32 scale, const rgbaint_t& other) +void rgbaint_t::scale_imm_add_and_clamp(int32_t scale, const rgbaint_t& other) { m_a = (m_a * scale) >> 8; m_r = (m_r * scale) >> 8; @@ -91,10 +91,10 @@ void rgbaint_t::scale_imm_add_and_clamp(INT32 scale, const rgbaint_t& other) m_r += other.m_r; m_g += other.m_g; m_b += other.m_b; - if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } - if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } - if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } - if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } + if ((uint32_t)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } + if ((uint32_t)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } + if ((uint32_t)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } + if ((uint32_t)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } } void rgbaint_t::scale_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other) @@ -111,10 +111,10 @@ void rgbaint_t::scale_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& oth m_r += other.m_r; m_g += other.m_g; m_b += other.m_b; - if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } - if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } - if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } - if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } + if ((uint32_t)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } + if ((uint32_t)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } + if ((uint32_t)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } + if ((uint32_t)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } } void rgbaint_t::scale2_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other, const rgbaint_t& scale2) @@ -127,10 +127,10 @@ void rgbaint_t::scale2_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& ot m_r |= (m_r & 0x00800000) ? 0xff000000 : 0; m_g |= (m_g & 0x00800000) ? 0xff000000 : 0; m_b |= (m_b & 0x00800000) ? 0xff000000 : 0; - if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } - if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } - if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } - if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } + if ((uint32_t)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; } + if ((uint32_t)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; } + if ((uint32_t)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; } + if ((uint32_t)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; } } #endif // !defined(__ALTIVEC__) diff --git a/src/emu/video/rgbgen.h b/src/emu/video/rgbgen.h index 3b2279a3d01..66dac76aa53 100644 --- a/src/emu/video/rgbgen.h +++ b/src/emu/video/rgbgen.h @@ -20,16 +20,16 @@ class rgbaint_t { public: rgbaint_t(): m_a(0), m_r(0), m_g(0), m_b(0) { } - explicit rgbaint_t(UINT32 rgba) { set(rgba); } - rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); } + explicit rgbaint_t(uint32_t rgba) { set(rgba); } + rgbaint_t(int32_t a, int32_t r, int32_t g, int32_t b) { set(a, r, g, b); } explicit rgbaint_t(const rgb_t& rgba) { set(rgba); } rgbaint_t(const rgbaint_t& other) = default; rgbaint_t &operator=(const rgbaint_t& other) = default; void set(const rgbaint_t& other) { set(other.m_a, other.m_r, other.m_g, other.m_b); } - void set(UINT32 rgba) { set((rgba >> 24) & 0xff, (rgba >> 16) & 0xff, (rgba >> 8) & 0xff, rgba & 0xff); } - void set(INT32 a, INT32 r, INT32 g, INT32 b) + void set(uint32_t rgba) { set((rgba >> 24) & 0xff, (rgba >> 16) & 0xff, (rgba >> 8) & 0xff, rgba & 0xff); } + void set(int32_t a, int32_t r, int32_t g, int32_t b) { m_a = a; m_r = r; @@ -42,39 +42,39 @@ public: rgb_t to_rgba_clamp() const { - const UINT8 a = (m_a < 0) ? 0 : (m_a > 255) ? 255 : m_a; - const UINT8 r = (m_r < 0) ? 0 : (m_r > 255) ? 255 : m_r; - const UINT8 g = (m_g < 0) ? 0 : (m_g > 255) ? 255 : m_g; - const UINT8 b = (m_b < 0) ? 0 : (m_b > 255) ? 255 : m_b; + const uint8_t a = (m_a < 0) ? 0 : (m_a > 255) ? 255 : m_a; + const uint8_t r = (m_r < 0) ? 0 : (m_r > 255) ? 255 : m_r; + const uint8_t g = (m_g < 0) ? 0 : (m_g > 255) ? 255 : m_g; + const uint8_t b = (m_b < 0) ? 0 : (m_b > 255) ? 255 : m_b; return rgb_t(a, r, g, b); } - void set_a(const INT32 value) { m_a = value; } - void set_r(const INT32 value) { m_r = value; } - void set_g(const INT32 value) { m_g = value; } - void set_b(const INT32 value) { m_b = value; } + void set_a(const int32_t value) { m_a = value; } + void set_r(const int32_t value) { m_r = value; } + void set_g(const int32_t value) { m_g = value; } + void set_b(const int32_t value) { m_b = value; } - UINT8 get_a() const { return UINT8(UINT32(m_a)); } - UINT8 get_r() const { return UINT8(UINT32(m_r)); } - UINT8 get_g() const { return UINT8(UINT32(m_g)); } - UINT8 get_b() const { return UINT8(UINT32(m_b)); } + uint8_t get_a() const { return uint8_t(uint32_t(m_a)); } + uint8_t get_r() const { return uint8_t(uint32_t(m_r)); } + uint8_t get_g() const { return uint8_t(uint32_t(m_g)); } + uint8_t get_b() const { return uint8_t(uint32_t(m_b)); } - INT32 get_a32() const { return m_a; } - INT32 get_r32() const { return m_r; } - INT32 get_g32() const { return m_g; } - INT32 get_b32() const { return m_b; } + int32_t get_a32() const { return m_a; } + int32_t get_r32() const { return m_r; } + int32_t get_g32() const { return m_g; } + int32_t get_b32() const { return m_b; } inline void add(const rgbaint_t& color) { add_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b); } - inline void add_imm(const INT32 imm) + inline void add_imm(const int32_t imm) { add_imm_rgba(imm, imm, imm, imm); } - inline void add_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void add_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_a += a; m_r += r; @@ -87,12 +87,12 @@ public: sub_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b); } - inline void sub_imm(const INT32 imm) + inline void sub_imm(const int32_t imm) { sub_imm_rgba(imm, imm, imm, imm); } - inline void sub_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void sub_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_a -= a; m_r -= r; @@ -105,12 +105,12 @@ public: subr_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b); } - inline void subr_imm(const INT32 imm) + inline void subr_imm(const int32_t imm) { subr_imm_rgba(imm, imm, imm, imm); } - inline void subr_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void subr_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_a = a - m_a; m_r = r - m_r; @@ -123,12 +123,12 @@ public: mul_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b); } - inline void mul_imm(const INT32 imm) + inline void mul_imm(const int32_t imm) { mul_imm_rgba(imm, imm, imm, imm); } - inline void mul_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void mul_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_a *= a; m_r *= r; @@ -144,7 +144,7 @@ public: m_b <<= shift.m_b; } - inline void shl_imm(const UINT8 shift) + inline void shl_imm(const uint8_t shift) { if (shift == 0) return; @@ -157,21 +157,21 @@ public: inline void shr(const rgbaint_t& shift) { - m_a = INT32(UINT32(m_a) >> shift.m_a); - m_r = INT32(UINT32(m_r) >> shift.m_r); - m_g = INT32(UINT32(m_g) >> shift.m_g); - m_b = INT32(UINT32(m_b) >> shift.m_b); + m_a = int32_t(uint32_t(m_a) >> shift.m_a); + m_r = int32_t(uint32_t(m_r) >> shift.m_r); + m_g = int32_t(uint32_t(m_g) >> shift.m_g); + m_b = int32_t(uint32_t(m_b) >> shift.m_b); } - inline void shr_imm(const UINT8 shift) + inline void shr_imm(const uint8_t shift) { if (shift == 0) return; - m_a = INT32(UINT32(m_a) >> shift); - m_r = INT32(UINT32(m_r) >> shift); - m_g = INT32(UINT32(m_g) >> shift); - m_b = INT32(UINT32(m_b) >> shift); + m_a = int32_t(uint32_t(m_a) >> shift); + m_r = int32_t(uint32_t(m_r) >> shift); + m_g = int32_t(uint32_t(m_g) >> shift); + m_b = int32_t(uint32_t(m_b) >> shift); } inline void sra(const rgbaint_t& shift) @@ -193,10 +193,10 @@ public: m_b |= ~0 << (32 - shift.m_b); } - inline void sra_imm(const UINT8 shift) + inline void sra_imm(const uint8_t shift) { - const UINT32 high_bit = 1 << (31 - shift); - const UINT32 high_mask = ~0 << (32 - shift); + const uint32_t high_bit = 1 << (31 - shift); + const uint32_t high_mask = ~0 << (32 - shift); m_a >>= shift; if (m_a & high_bit) @@ -221,11 +221,11 @@ public: void andnot_reg(const rgbaint_t& color) { and_imm_rgba(~color.m_a, ~color.m_r, ~color.m_g, ~color.m_b); } - void or_imm(INT32 imm) { or_imm_rgba(imm, imm, imm, imm); } - void and_imm(INT32 imm) { and_imm_rgba(imm, imm, imm, imm); } - void xor_imm(INT32 imm) { xor_imm_rgba(imm, imm, imm, imm); } + void or_imm(int32_t imm) { or_imm_rgba(imm, imm, imm, imm); } + void and_imm(int32_t imm) { and_imm_rgba(imm, imm, imm, imm); } + void xor_imm(int32_t imm) { xor_imm_rgba(imm, imm, imm, imm); } - inline void or_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void or_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_a |= a; m_r |= r; @@ -233,7 +233,7 @@ public: m_b |= b; } - inline void and_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void and_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_a &= a; m_r &= r; @@ -241,7 +241,7 @@ public: m_b &= b; } - inline void xor_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void xor_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_a ^= a; m_r ^= r; @@ -249,7 +249,7 @@ public: m_b ^= b; } - inline void clamp_and_clear(const UINT32 sign) + inline void clamp_and_clear(const uint32_t sign) { if (m_a & sign) m_a = 0; if (m_r & sign) m_r = 0; @@ -267,7 +267,7 @@ public: m_b = (m_b < 0) ? 0 : (m_b > 255) ? 255 : m_b; } - inline void sign_extend(const UINT32 compare, const UINT32 sign) + inline void sign_extend(const uint32_t compare, const uint32_t sign) { if ((m_a & compare) == compare) m_a |= sign; @@ -282,7 +282,7 @@ public: m_b |= sign; } - inline void min(const INT32 value) + inline void min(const int32_t value) { m_a = (m_a > value) ? value : m_a; m_r = (m_r > value) ? value : m_r; @@ -290,7 +290,7 @@ public: m_b = (m_b > value) ? value : m_b; } - inline void max(const INT32 value) + inline void max(const int32_t value) { m_a = (m_a < value) ? value : m_a; m_r = (m_r < value) ? value : m_r; @@ -298,23 +298,23 @@ public: m_b = (m_b < value) ? value : m_b; } - void blend(const rgbaint_t& other, UINT8 factor); + void blend(const rgbaint_t& other, uint8_t factor); void scale_and_clamp(const rgbaint_t& scale); - void scale_imm_and_clamp(const INT32 scale); + void scale_imm_and_clamp(const int32_t scale); void scale2_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other, const rgbaint_t& scale2); void scale_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other); - void scale_imm_add_and_clamp(const INT32 scale, const rgbaint_t& other); + void scale_imm_add_and_clamp(const int32_t scale, const rgbaint_t& other); void cmpeq(const rgbaint_t& value) { cmpeq_imm_rgba(value.m_a, value.m_r, value.m_g, value.m_b); } void cmpgt(const rgbaint_t& value) { cmpgt_imm_rgba(value.m_a, value.m_r, value.m_g, value.m_b); } void cmplt(const rgbaint_t& value) { cmplt_imm_rgba(value.m_a, value.m_r, value.m_g, value.m_b); } - void cmpeq_imm(INT32 value) { cmpeq_imm_rgba(value, value, value, value); } - void cmpgt_imm(INT32 value) { cmpgt_imm_rgba(value, value, value, value); } - void cmplt_imm(INT32 value) { cmplt_imm_rgba(value, value, value, value); } + void cmpeq_imm(int32_t value) { cmpeq_imm_rgba(value, value, value, value); } + void cmpgt_imm(int32_t value) { cmpgt_imm_rgba(value, value, value, value); } + void cmplt_imm(int32_t value) { cmplt_imm_rgba(value, value, value, value); } - void cmpeq_imm_rgba(INT32 a, INT32 r, INT32 g, INT32 b) + void cmpeq_imm_rgba(int32_t a, int32_t r, int32_t g, int32_t b) { m_a = (m_a == a) ? 0xffffffff : 0; m_r = (m_r == r) ? 0xffffffff : 0; @@ -322,7 +322,7 @@ public: m_b = (m_b == b) ? 0xffffffff : 0; } - void cmpgt_imm_rgba(INT32 a, INT32 r, INT32 g, INT32 b) + void cmpgt_imm_rgba(int32_t a, int32_t r, int32_t g, int32_t b) { m_a = (m_a > a) ? 0xffffffff : 0; m_r = (m_r > r) ? 0xffffffff : 0; @@ -330,7 +330,7 @@ public: m_b = (m_b > b) ? 0xffffffff : 0; } - void cmplt_imm_rgba(INT32 a, INT32 r, INT32 g, INT32 b) + void cmplt_imm_rgba(int32_t a, int32_t r, int32_t g, int32_t b) { m_a = (m_a < a) ? 0xffffffff : 0; m_r = (m_r < r) ? 0xffffffff : 0; @@ -349,7 +349,7 @@ public: return *this; } - rgbaint_t& operator+=(const INT32 other) + rgbaint_t& operator+=(const int32_t other) { add_imm_rgba(other, other, other, other); return *this; @@ -367,30 +367,30 @@ public: return *this; } - rgbaint_t& operator*=(const INT32 other) + rgbaint_t& operator*=(const int32_t other) { mul_imm_rgba(other, other, other, other); return *this; } - rgbaint_t& operator>>=(const INT32 shift) + rgbaint_t& operator>>=(const int32_t shift) { sra_imm(shift); return *this; } - static UINT32 bilinear_filter(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v) + static uint32_t bilinear_filter(uint32_t rgb00, uint32_t rgb01, uint32_t rgb10, uint32_t rgb11, uint8_t u, uint8_t v) { - UINT32 rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8); - UINT32 rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8); + uint32_t rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8); + uint32_t rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8); rgb00 >>= 8; rgb01 >>= 8; rgb10 >>= 8; rgb11 >>= 8; - UINT32 ag0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8); - UINT32 ag1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8); + uint32_t ag0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8); + uint32_t ag1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8); rb0 = (rb0 & 0x00ff00ff) + ((((rb1 & 0x00ff00ff) - (rb0 & 0x00ff00ff)) * v) >> 8); ag0 = (ag0 & 0x00ff00ff) + ((((ag1 & 0x00ff00ff) - (ag0 & 0x00ff00ff)) * v) >> 8); @@ -398,31 +398,31 @@ public: return ((ag0 << 8) & 0xff00ff00) | (rb0 & 0x00ff00ff); } - void bilinear_filter_rgbaint(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v) + void bilinear_filter_rgbaint(uint32_t rgb00, uint32_t rgb01, uint32_t rgb10, uint32_t rgb11, uint8_t u, uint8_t v) { - UINT32 rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8); - UINT32 rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8); + uint32_t rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8); + uint32_t rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8); rgb00 >>= 8; rgb01 >>= 8; rgb10 >>= 8; rgb11 >>= 8; - UINT32 ag0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8); - UINT32 ag1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8); + uint32_t ag0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8); + uint32_t ag1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8); rb0 = (rb0 & 0x00ff00ff) + ((((rb1 & 0x00ff00ff) - (rb0 & 0x00ff00ff)) * v) >> 8); ag0 = (ag0 & 0x00ff00ff) + ((((ag1 & 0x00ff00ff) - (ag0 & 0x00ff00ff)) * v) >> 8); - UINT32 result = ((ag0 << 8) & 0xff00ff00) | (rb0 & 0x00ff00ff); + uint32_t result = ((ag0 << 8) & 0xff00ff00) | (rb0 & 0x00ff00ff); this->set(result); } protected: - INT32 m_a; - INT32 m_r; - INT32 m_g; - INT32 m_b; + int32_t m_a; + int32_t m_r; + int32_t m_g; + int32_t m_b; }; #endif // MAME_EMU_VIDEO_RGBGEN_H diff --git a/src/emu/video/rgbsse.cpp b/src/emu/video/rgbsse.cpp index a26abed5609..87c4f7b33e0 100644 --- a/src/emu/video/rgbsse.cpp +++ b/src/emu/video/rgbsse.cpp @@ -164,7 +164,7 @@ const struct rgbaint_t::_statics rgbaint_t::statics = HIGHER LEVEL OPERATIONS ***************************************************************************/ -void rgbaint_t::blend(const rgbaint_t& other, UINT8 factor) +void rgbaint_t::blend(const rgbaint_t& other, uint8_t factor) { const __m128i scale1 = _mm_set1_epi32(factor); const rgbaint_t scale2(_mm_sub_epi32(_mm_set1_epi32(0x100), scale1)); @@ -184,7 +184,7 @@ void rgbaint_t::scale_and_clamp(const rgbaint_t& scale) clamp_to_uint8(); } -void rgbaint_t::scale_imm_and_clamp(const INT32 scale) +void rgbaint_t::scale_imm_and_clamp(const int32_t scale) { mul_imm(scale); sra_imm(8); diff --git a/src/emu/video/rgbsse.h b/src/emu/video/rgbsse.h index a7ac2ad3fc3..521000f4488 100644 --- a/src/emu/video/rgbsse.h +++ b/src/emu/video/rgbsse.h @@ -29,8 +29,8 @@ class rgbaint_t { public: rgbaint_t() { } - explicit rgbaint_t(UINT32 rgba) { set(rgba); } - rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); } + explicit rgbaint_t(uint32_t rgba) { set(rgba); } + rgbaint_t(int32_t a, int32_t r, int32_t g, int32_t b) { set(a, r, g, b); } explicit rgbaint_t(const rgb_t& rgb) { set(rgb); } explicit rgbaint_t(__m128i rgba) { m_value = rgba; } @@ -38,8 +38,8 @@ public: rgbaint_t &operator=(const rgbaint_t& other) = default; void set(const rgbaint_t& other) { m_value = other.m_value; } - void set(UINT32 rgba) { m_value = _mm_and_si128(_mm_set1_epi32(0xff), _mm_set_epi32(rgba >> 24, rgba >> 16, rgba >> 8, rgba)); } - void set(INT32 a, INT32 r, INT32 g, INT32 b) { m_value = _mm_set_epi32(a, r, g, b); } + void set(uint32_t rgba) { m_value = _mm_and_si128(_mm_set1_epi32(0xff), _mm_set_epi32(rgba >> 24, rgba >> 16, rgba >> 8, rgba)); } + void set(int32_t a, int32_t r, int32_t g, int32_t b) { m_value = _mm_set_epi32(a, r, g, b); } void set(const rgb_t& rgb) { m_value = _mm_unpacklo_epi16(_mm_unpacklo_epi8(_mm_cvtsi32_si128(rgb), _mm_setzero_si128()), _mm_setzero_si128()); } inline rgb_t to_rgba() const @@ -53,32 +53,32 @@ public: } #ifdef __SSE4_1__ - void set_a(const INT32 value) { m_value = _mm_insert_epi32(m_value, value, 3); } - void set_r(const INT32 value) { m_value = _mm_insert_epi32(m_value, value, 2); } - void set_g(const INT32 value) { m_value = _mm_insert_epi32(m_value, value, 1); } - void set_b(const INT32 value) { m_value = _mm_insert_epi32(m_value, value, 0); } + void set_a(const int32_t value) { m_value = _mm_insert_epi32(m_value, value, 3); } + void set_r(const int32_t value) { m_value = _mm_insert_epi32(m_value, value, 2); } + void set_g(const int32_t value) { m_value = _mm_insert_epi32(m_value, value, 1); } + void set_b(const int32_t value) { m_value = _mm_insert_epi32(m_value, value, 0); } #else - void set_a(const INT32 value) { m_value = _mm_or_si128(_mm_and_si128(m_value, alpha_mask()), _mm_set_epi32(value, 0, 0, 0)); } - void set_r(const INT32 value) { m_value = _mm_or_si128(_mm_and_si128(m_value, red_mask()), _mm_set_epi32(0, value, 0, 0)); } - void set_g(const INT32 value) { m_value = _mm_or_si128(_mm_and_si128(m_value, green_mask()), _mm_set_epi32(0, 0, value, 0)); } - void set_b(const INT32 value) { m_value = _mm_or_si128(_mm_and_si128(m_value, blue_mask()), _mm_set_epi32(0, 0, 0, value)); } + void set_a(const int32_t value) { m_value = _mm_or_si128(_mm_and_si128(m_value, alpha_mask()), _mm_set_epi32(value, 0, 0, 0)); } + void set_r(const int32_t value) { m_value = _mm_or_si128(_mm_and_si128(m_value, red_mask()), _mm_set_epi32(0, value, 0, 0)); } + void set_g(const int32_t value) { m_value = _mm_or_si128(_mm_and_si128(m_value, green_mask()), _mm_set_epi32(0, 0, value, 0)); } + void set_b(const int32_t value) { m_value = _mm_or_si128(_mm_and_si128(m_value, blue_mask()), _mm_set_epi32(0, 0, 0, value)); } #endif - UINT8 get_a() const { return UINT8(unsigned(_mm_extract_epi16(m_value, 6))); } - UINT8 get_r() const { return UINT8(unsigned(_mm_extract_epi16(m_value, 4))); } - UINT8 get_g() const { return UINT8(unsigned(_mm_extract_epi16(m_value, 2))); } - UINT8 get_b() const { return UINT8(unsigned(_mm_extract_epi16(m_value, 0))); } + uint8_t get_a() const { return uint8_t(unsigned(_mm_extract_epi16(m_value, 6))); } + uint8_t get_r() const { return uint8_t(unsigned(_mm_extract_epi16(m_value, 4))); } + uint8_t get_g() const { return uint8_t(unsigned(_mm_extract_epi16(m_value, 2))); } + uint8_t get_b() const { return uint8_t(unsigned(_mm_extract_epi16(m_value, 0))); } #ifdef __SSE4_1__ - INT32 get_a32() const { return _mm_extract_epi32(m_value, 3); } - INT32 get_r32() const { return _mm_extract_epi32(m_value, 2); } - INT32 get_g32() const { return _mm_extract_epi32(m_value, 1); } - INT32 get_b32() const { return _mm_extract_epi32(m_value, 0); } + int32_t get_a32() const { return _mm_extract_epi32(m_value, 3); } + int32_t get_r32() const { return _mm_extract_epi32(m_value, 2); } + int32_t get_g32() const { return _mm_extract_epi32(m_value, 1); } + int32_t get_b32() const { return _mm_extract_epi32(m_value, 0); } #else - INT32 get_a32() const { return (_mm_extract_epi16(m_value, 7) << 16) | _mm_extract_epi16(m_value, 6); } - INT32 get_r32() const { return (_mm_extract_epi16(m_value, 5) << 16) | _mm_extract_epi16(m_value, 4); } - INT32 get_g32() const { return (_mm_extract_epi16(m_value, 3) << 16) | _mm_extract_epi16(m_value, 2); } - INT32 get_b32() const { return (_mm_extract_epi16(m_value, 1) << 16) | _mm_extract_epi16(m_value, 0); } + int32_t get_a32() const { return (_mm_extract_epi16(m_value, 7) << 16) | _mm_extract_epi16(m_value, 6); } + int32_t get_r32() const { return (_mm_extract_epi16(m_value, 5) << 16) | _mm_extract_epi16(m_value, 4); } + int32_t get_g32() const { return (_mm_extract_epi16(m_value, 3) << 16) | _mm_extract_epi16(m_value, 2); } + int32_t get_b32() const { return (_mm_extract_epi16(m_value, 1) << 16) | _mm_extract_epi16(m_value, 0); } #endif inline void add(const rgbaint_t& color2) @@ -86,12 +86,12 @@ public: m_value = _mm_add_epi32(m_value, color2.m_value); } - inline void add_imm(const INT32 imm) + inline void add_imm(const int32_t imm) { m_value = _mm_add_epi32(m_value, _mm_set1_epi32(imm)); } - inline void add_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void add_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_value = _mm_add_epi32(m_value, _mm_set_epi32(a, r, g, b)); } @@ -101,12 +101,12 @@ public: m_value = _mm_sub_epi32(m_value, color2.m_value); } - inline void sub_imm(const INT32 imm) + inline void sub_imm(const int32_t imm) { m_value = _mm_sub_epi32(m_value, _mm_set1_epi32(imm)); } - inline void sub_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void sub_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_value = _mm_sub_epi32(m_value, _mm_set_epi32(a, r, g, b)); } @@ -116,12 +116,12 @@ public: m_value = _mm_sub_epi32(color2.m_value, m_value); } - inline void subr_imm(const INT32 imm) + inline void subr_imm(const int32_t imm) { m_value = _mm_sub_epi32(_mm_set1_epi32(imm), m_value); } - inline void subr_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void subr_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { m_value = _mm_sub_epi32(_mm_set_epi32(a, r, g, b), m_value); } @@ -133,7 +133,7 @@ public: m_value = _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE(0, 0, 2, 0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE(0, 0, 2, 0))); } - inline void mul_imm(const INT32 imm) + inline void mul_imm(const int32_t imm) { __m128i immv = _mm_set1_epi32(imm); __m128i tmp1 = _mm_mul_epu32(m_value, immv); @@ -141,7 +141,7 @@ public: m_value = _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE(0, 0, 2, 0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE(0, 0, 2, 0))); } - inline void mul_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void mul_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { __m128i immv = _mm_set_epi32(a, r, g, b); __m128i tmp1 = _mm_mul_epu32(m_value, immv); @@ -166,7 +166,7 @@ public: set(areg.get_a32(), rreg.get_r32(), greg.get_g32(), breg.get_b32()); } - inline void shl_imm(const UINT8 shift) + inline void shl_imm(const uint8_t shift) { m_value = _mm_slli_epi32(m_value, shift); } @@ -188,7 +188,7 @@ public: set(areg.get_a32(), rreg.get_r32(), greg.get_g32(), breg.get_b32()); } - inline void shr_imm(const UINT8 shift) + inline void shr_imm(const uint8_t shift) { m_value = _mm_srli_epi32(m_value, shift); } @@ -210,7 +210,7 @@ public: set(areg.get_a32(), rreg.get_r32(), greg.get_g32(), breg.get_b32()); } - inline void sra_imm(const UINT8 shift) + inline void sra_imm(const uint8_t shift) { m_value = _mm_srai_epi32(m_value, shift); } @@ -221,15 +221,15 @@ public: void andnot_reg(const rgbaint_t& color2) { m_value = _mm_andnot_si128(color2.m_value, m_value); } - void or_imm(INT32 value) { m_value = _mm_or_si128(m_value, _mm_set1_epi32(value)); } - void and_imm(INT32 value) { m_value = _mm_and_si128(m_value, _mm_set1_epi32(value)); } - void xor_imm(INT32 value) { m_value = _mm_xor_si128(m_value, _mm_set1_epi32(value)); } + void or_imm(int32_t value) { m_value = _mm_or_si128(m_value, _mm_set1_epi32(value)); } + void and_imm(int32_t value) { m_value = _mm_and_si128(m_value, _mm_set1_epi32(value)); } + void xor_imm(int32_t value) { m_value = _mm_xor_si128(m_value, _mm_set1_epi32(value)); } - void or_imm_rgba(INT32 a, INT32 r, INT32 g, INT32 b) { m_value = _mm_or_si128(m_value, _mm_set_epi32(a, r, g, b)); } - void and_imm_rgba(INT32 a, INT32 r, INT32 g, INT32 b) { m_value = _mm_and_si128(m_value, _mm_set_epi32(a, r, g, b)); } - void xor_imm_rgba(INT32 a, INT32 r, INT32 g, INT32 b) { m_value = _mm_xor_si128(m_value, _mm_set_epi32(a, r, g, b)); } + void or_imm_rgba(int32_t a, int32_t r, int32_t g, int32_t b) { m_value = _mm_or_si128(m_value, _mm_set_epi32(a, r, g, b)); } + void and_imm_rgba(int32_t a, int32_t r, int32_t g, int32_t b) { m_value = _mm_and_si128(m_value, _mm_set_epi32(a, r, g, b)); } + void xor_imm_rgba(int32_t a, int32_t r, int32_t g, int32_t b) { m_value = _mm_xor_si128(m_value, _mm_set_epi32(a, r, g, b)); } - inline void clamp_and_clear(const UINT32 sign) + inline void clamp_and_clear(const uint32_t sign) { __m128i vsign = _mm_set1_epi32(sign); m_value = _mm_and_si128(m_value, _mm_cmpeq_epi32(_mm_and_si128(m_value, vsign), _mm_setzero_si128())); @@ -247,7 +247,7 @@ public: m_value = _mm_unpacklo_epi16(m_value, _mm_setzero_si128()); } - inline void sign_extend(const UINT32 compare, const UINT32 sign) + inline void sign_extend(const uint32_t compare, const uint32_t sign) { __m128i compare_vec = _mm_set1_epi32(compare); __m128i compare_mask = _mm_cmpeq_epi32(_mm_and_si128(m_value, compare_vec), compare_vec); @@ -255,7 +255,7 @@ public: m_value = _mm_or_si128(m_value, compared); } - inline void min(const INT32 value) + inline void min(const int32_t value) { __m128i val = _mm_set1_epi32(value); __m128i is_greater_than = _mm_cmpgt_epi32(m_value, val); @@ -267,7 +267,7 @@ public: m_value = _mm_or_si128(val_to_set, m_value); } - inline void max(const INT32 value) + inline void max(const int32_t value) { __m128i val = _mm_set1_epi32(value); __m128i is_less_than = _mm_cmplt_epi32(m_value, val); @@ -279,12 +279,12 @@ public: m_value = _mm_or_si128(val_to_set, m_value); } - void blend(const rgbaint_t& other, UINT8 factor); + void blend(const rgbaint_t& other, uint8_t factor); void scale_and_clamp(const rgbaint_t& scale); - void scale_imm_and_clamp(const INT32 scale); + void scale_imm_and_clamp(const int32_t scale); - inline void scale_imm_add_and_clamp(const INT32 scale, const rgbaint_t& other) + inline void scale_imm_add_and_clamp(const int32_t scale, const rgbaint_t& other) { mul_imm(scale); sra_imm(8); @@ -315,13 +315,13 @@ public: void cmpgt(const rgbaint_t& value) { m_value = _mm_cmpgt_epi32(m_value, value.m_value); } void cmplt(const rgbaint_t& value) { m_value = _mm_cmplt_epi32(m_value, value.m_value); } - void cmpeq_imm(INT32 value) { m_value = _mm_cmpeq_epi32(m_value, _mm_set1_epi32(value)); } - void cmpgt_imm(INT32 value) { m_value = _mm_cmpgt_epi32(m_value, _mm_set1_epi32(value)); } - void cmplt_imm(INT32 value) { m_value = _mm_cmplt_epi32(m_value, _mm_set1_epi32(value)); } + void cmpeq_imm(int32_t value) { m_value = _mm_cmpeq_epi32(m_value, _mm_set1_epi32(value)); } + void cmpgt_imm(int32_t value) { m_value = _mm_cmpgt_epi32(m_value, _mm_set1_epi32(value)); } + void cmplt_imm(int32_t value) { m_value = _mm_cmplt_epi32(m_value, _mm_set1_epi32(value)); } - void cmpeq_imm_rgba(INT32 a, INT32 r, INT32 g, INT32 b) { m_value = _mm_cmpeq_epi32(m_value, _mm_set_epi32(a, r, g, b)); } - void cmpgt_imm_rgba(INT32 a, INT32 r, INT32 g, INT32 b) { m_value = _mm_cmpgt_epi32(m_value, _mm_set_epi32(a, r, g, b)); } - void cmplt_imm_rgba(INT32 a, INT32 r, INT32 g, INT32 b) { m_value = _mm_cmplt_epi32(m_value, _mm_set_epi32(a, r, g, b)); } + void cmpeq_imm_rgba(int32_t a, int32_t r, int32_t g, int32_t b) { m_value = _mm_cmpeq_epi32(m_value, _mm_set_epi32(a, r, g, b)); } + void cmpgt_imm_rgba(int32_t a, int32_t r, int32_t g, int32_t b) { m_value = _mm_cmpgt_epi32(m_value, _mm_set_epi32(a, r, g, b)); } + void cmplt_imm_rgba(int32_t a, int32_t r, int32_t g, int32_t b) { m_value = _mm_cmplt_epi32(m_value, _mm_set_epi32(a, r, g, b)); } inline rgbaint_t& operator+=(const rgbaint_t& other) { @@ -329,7 +329,7 @@ public: return *this; } - inline rgbaint_t& operator+=(const INT32 other) + inline rgbaint_t& operator+=(const int32_t other) { m_value = _mm_add_epi32(m_value, _mm_set1_epi32(other)); return *this; @@ -347,14 +347,14 @@ public: return *this; } - inline rgbaint_t& operator*=(const INT32 other) + inline rgbaint_t& operator*=(const int32_t other) { const __m128i immv = _mm_set1_epi32(other); m_value = _mm_unpacklo_epi32(_mm_shuffle_epi32(_mm_mul_epu32(m_value, immv), _MM_SHUFFLE(0, 0, 2, 0)), _mm_shuffle_epi32(_mm_mul_epu32(_mm_srli_si128(m_value, 4), _mm_srli_si128(immv, 4)), _MM_SHUFFLE(0, 0, 2, 0))); return *this; } - inline rgbaint_t& operator>>=(const INT32 shift) + inline rgbaint_t& operator>>=(const int32_t shift) { m_value = _mm_srai_epi32(m_value, shift); return *this; @@ -370,7 +370,7 @@ public: #endif } - static UINT32 bilinear_filter(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v) + static uint32_t bilinear_filter(uint32_t rgb00, uint32_t rgb01, uint32_t rgb10, uint32_t rgb11, uint8_t u, uint8_t v) { __m128i color00 = _mm_cvtsi32_si128(rgb00); __m128i color01 = _mm_cvtsi32_si128(rgb01); @@ -394,7 +394,7 @@ public: return _mm_cvtsi128_si32(color01); } - void bilinear_filter_rgbaint(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v) + void bilinear_filter_rgbaint(uint32_t rgb00, uint32_t rgb01, uint32_t rgb10, uint32_t rgb11, uint8_t u, uint8_t v) { __m128i color00 = _mm_cvtsi32_si128(rgb00); __m128i color01 = _mm_cvtsi32_si128(rgb01); @@ -419,18 +419,18 @@ protected: struct _statics { __m128 dummy_for_alignment; - UINT16 alpha_mask[8]; - UINT16 red_mask[8]; - UINT16 green_mask[8]; - UINT16 blue_mask[8]; - INT16 scale_table[256][8]; + uint16_t alpha_mask[8]; + uint16_t red_mask[8]; + uint16_t green_mask[8]; + uint16_t blue_mask[8]; + int16_t scale_table[256][8]; }; static __m128i alpha_mask() { return *(__m128i *)&statics.alpha_mask[0]; } static __m128i red_mask() { return *(__m128i *)&statics.red_mask[0]; } static __m128i green_mask() { return *(__m128i *)&statics.green_mask[0]; } static __m128i blue_mask() { return *(__m128i *)&statics.blue_mask[0]; } - static __m128i scale_factor(UINT8 index) { return *(__m128i *)&statics.scale_table[index][0]; } + static __m128i scale_factor(uint8_t index) { return *(__m128i *)&statics.scale_table[index][0]; } __m128i m_value; diff --git a/src/emu/video/rgbvmx.cpp b/src/emu/video/rgbvmx.cpp index 9d9b24d7338..e7c035fa53c 100644 --- a/src/emu/video/rgbvmx.cpp +++ b/src/emu/video/rgbvmx.cpp @@ -164,7 +164,7 @@ const rgbaint_t::VECS16 rgbaint_t::scale_table[256] = { HIGHER LEVEL OPERATIONS ***************************************************************************/ -void rgbaint_t::blend(const rgbaint_t& other, UINT8 factor) +void rgbaint_t::blend(const rgbaint_t& other, uint8_t factor) { const VECU32 shift = vec_splat_u32(-16); const VECS32 scale1 = { factor, factor, factor, factor }; @@ -189,7 +189,7 @@ void rgbaint_t::scale_and_clamp(const rgbaint_t& scale) clamp_to_uint8(); } -void rgbaint_t::scale_imm_and_clamp(const INT32 scale) +void rgbaint_t::scale_imm_and_clamp(const int32_t scale) { mul_imm(scale); sra_imm(8); diff --git a/src/emu/video/rgbvmx.h b/src/emu/video/rgbvmx.h index d4cc5184d69..302e42af998 100644 --- a/src/emu/video/rgbvmx.h +++ b/src/emu/video/rgbvmx.h @@ -29,8 +29,8 @@ protected: public: rgbaint_t() { set(0, 0, 0, 0); } - explicit rgbaint_t(UINT32 rgba) { set(rgba); } - rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); } + explicit rgbaint_t(uint32_t rgba) { set(rgba); } + rgbaint_t(int32_t a, int32_t r, int32_t g, int32_t b) { set(a, r, g, b); } explicit rgbaint_t(const rgb_t& rgb) { set(rgb); } explicit rgbaint_t(VECS32 rgba) : m_value(rgba) { } @@ -39,7 +39,7 @@ public: void set(const rgbaint_t& other) { m_value = other.m_value; } - void set(UINT32 rgba) + void set(uint32_t rgba) { const VECU32 zero = { 0, 0, 0, 0 }; #ifdef __LITTLE_ENDIAN__ @@ -51,7 +51,7 @@ public: #endif } - void set(INT32 a, INT32 r, INT32 g, INT32 b) + void set(int32_t a, int32_t r, int32_t g, int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 result = { b, g, r, a }; @@ -77,7 +77,7 @@ public: { VECU32 temp = VECU32(vec_packs(m_value, m_value)); temp = VECU32(vec_packsu(VECS16(temp), VECS16(temp))); - UINT32 result; + uint32_t result; vec_ste(temp, 0, &result); return result; } @@ -86,38 +86,38 @@ public: { VECU32 temp = VECU32(vec_packs(m_value, m_value)); temp = VECU32(vec_packsu(VECS16(temp), VECS16(temp))); - UINT32 result; + uint32_t result; vec_ste(temp, 0, &result); return result; } - void set_a(const INT32 value) + void set_a(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = vec_perm(m_value, temp, alpha_perm); } - void set_r(const INT32 value) + void set_r(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = vec_perm(m_value, temp, red_perm); } - void set_g(const INT32 value) + void set_g(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = vec_perm(m_value, temp, green_perm); } - void set_b(const INT32 value) + void set_b(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = vec_perm(m_value, temp, blue_perm); } - UINT8 get_a() const + uint8_t get_a() const { - UINT8 result; + uint8_t result; #ifdef __LITTLE_ENDIAN__ vec_ste(vec_splat(VECU8(m_value), 12), 0, &result); #else @@ -126,9 +126,9 @@ public: return result; } - UINT8 get_r() const + uint8_t get_r() const { - UINT8 result; + uint8_t result; #ifdef __LITTLE_ENDIAN__ vec_ste(vec_splat(VECU8(m_value), 8), 0, &result); #else @@ -137,9 +137,9 @@ public: return result; } - UINT8 get_g() const + uint8_t get_g() const { - UINT8 result; + uint8_t result; #ifdef __LITTLE_ENDIAN__ vec_ste(vec_splat(VECU8(m_value), 4), 0, &result); #else @@ -148,9 +148,9 @@ public: return result; } - UINT8 get_b() const + uint8_t get_b() const { - UINT8 result; + uint8_t result; #ifdef __LITTLE_ENDIAN__ vec_ste(vec_splat(VECU8(m_value), 0), 0, &result); #else @@ -159,9 +159,9 @@ public: return result; } - INT32 get_a32() const + int32_t get_a32() const { - INT32 result; + int32_t result; #ifdef __LITTLE_ENDIAN__ vec_ste(vec_splat(m_value, 3), 0, &result); #else @@ -170,9 +170,9 @@ public: return result; } - INT32 get_r32() const + int32_t get_r32() const { - INT32 result; + int32_t result; #ifdef __LITTLE_ENDIAN__ vec_ste(vec_splat(m_value, 2), 0, &result); #else @@ -181,9 +181,9 @@ public: return result; } - INT32 get_g32() const + int32_t get_g32() const { - INT32 result; + int32_t result; #ifdef __LITTLE_ENDIAN__ vec_ste(vec_splat(m_value, 1), 0, &result); #else @@ -192,9 +192,9 @@ public: return result; } - INT32 get_b32() const + int32_t get_b32() const { - INT32 result; + int32_t result; #ifdef __LITTLE_ENDIAN__ vec_ste(vec_splat(m_value, 0), 0, &result); #else @@ -208,13 +208,13 @@ public: m_value = vec_add(m_value, color2.m_value); } - inline void add_imm(const INT32 imm) + inline void add_imm(const int32_t imm) { const VECS32 temp = { imm, imm, imm, imm }; m_value = vec_add(m_value, temp); } - inline void add_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void add_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 temp = { b, g, r, a }; @@ -229,13 +229,13 @@ public: m_value = vec_sub(m_value, color2.m_value); } - inline void sub_imm(const INT32 imm) + inline void sub_imm(const int32_t imm) { const VECS32 temp = { imm, imm, imm, imm }; m_value = vec_sub(m_value, temp); } - inline void sub_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void sub_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 temp = { b, g, r, a }; @@ -250,13 +250,13 @@ public: m_value = vec_sub(color2.m_value, m_value); } - inline void subr_imm(const INT32 imm) + inline void subr_imm(const int32_t imm) { const VECS32 temp = { imm, imm, imm, imm }; m_value = vec_sub(temp, m_value); } - inline void subr_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void subr_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 temp = { b, g, r, a }; @@ -277,9 +277,9 @@ public: #endif } - inline void mul_imm(const INT32 imm) + inline void mul_imm(const int32_t imm) { - const VECU32 value = { UINT32(imm), UINT32(imm), UINT32(imm), UINT32(imm) }; + const VECU32 value = { uint32_t(imm), uint32_t(imm), uint32_t(imm), uint32_t(imm) }; const VECU32 shift = vec_splat_u32(-16); const VECU32 temp = vec_msum(VECU16(m_value), VECU16(vec_rl(value, shift)), vec_splat_u32(0)); #ifdef __LITTLE_ENDIAN__ @@ -289,12 +289,12 @@ public: #endif } - inline void mul_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void mul_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ - const VECU32 value = { UINT32(b), UINT32(g), UINT32(r), UINT32(a) }; + const VECU32 value = { uint32_t(b), uint32_t(g), uint32_t(r), uint32_t(a) }; #else - const VECU32 value = { UINT32(a), UINT32(r), UINT32(g), UINT32(b) }; + const VECU32 value = { uint32_t(a), uint32_t(r), uint32_t(g), uint32_t(b) }; #endif const VECU32 shift = vec_splat_u32(-16); const VECU32 temp = vec_msum(VECU16(m_value), VECU16(vec_rl(value, shift)), vec_splat_u32(0)); @@ -311,7 +311,7 @@ public: m_value = vec_and(vec_sl(m_value, VECU32(shift.m_value)), vec_cmpgt(limit, VECU32(shift.m_value))); } - inline void shl_imm(const UINT8 shift) + inline void shl_imm(const uint8_t shift) { const VECU32 temp = { shift, shift, shift, shift }; m_value = vec_sl(m_value, temp); @@ -323,7 +323,7 @@ public: m_value = vec_and(vec_sr(m_value, VECU32(shift.m_value)), vec_cmpgt(limit, VECU32(shift.m_value))); } - inline void shr_imm(const UINT8 shift) + inline void shr_imm(const uint8_t shift) { const VECU32 temp = { shift, shift, shift, shift }; m_value = vec_sr(m_value, temp); @@ -335,7 +335,7 @@ public: m_value = vec_sra(m_value, vec_min(VECU32(shift.m_value), limit)); } - inline void sra_imm(const UINT8 shift) + inline void sra_imm(const uint8_t shift) { const VECU32 temp = { shift, shift, shift, shift }; m_value = vec_sra(m_value, temp); @@ -346,13 +346,13 @@ public: m_value = vec_or(m_value, color2.m_value); } - inline void or_imm(const INT32 value) + inline void or_imm(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = vec_or(m_value, temp); } - inline void or_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void or_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 temp = { b, g, r, a }; @@ -372,13 +372,13 @@ public: m_value = vec_andc(m_value, color.m_value); } - inline void and_imm(const INT32 value) + inline void and_imm(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = vec_and(m_value, temp); } - inline void and_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void and_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 temp = { b, g, r, a }; @@ -393,13 +393,13 @@ public: m_value = vec_xor(m_value, color2.m_value); } - inline void xor_imm(const INT32 value) + inline void xor_imm(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = vec_xor(m_value, temp); } - inline void xor_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void xor_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 temp = { b, g, r, a }; @@ -409,10 +409,10 @@ public: m_value = vec_xor(m_value, temp); } - inline void clamp_and_clear(const UINT32 sign) + inline void clamp_and_clear(const uint32_t sign) { const VECS32 vzero = { 0, 0, 0, 0 }; - VECS32 vsign = { INT32(sign), INT32(sign), INT32(sign), INT32(sign) }; + VECS32 vsign = { int32_t(sign), int32_t(sign), int32_t(sign), int32_t(sign) }; m_value = vec_and(m_value, vec_cmpeq(vec_and(m_value, vsign), vzero)); vsign = vec_nor(vec_sra(vsign, vec_splat_u32(1)), vzero); const VECS32 mask = VECS32(vec_cmpgt(m_value, vsign)); @@ -433,32 +433,32 @@ public: #endif } - inline void sign_extend(const UINT32 compare, const UINT32 sign) + inline void sign_extend(const uint32_t compare, const uint32_t sign) { - const VECS32 compare_vec = { INT32(compare), INT32(compare), INT32(compare), INT32(compare) }; + const VECS32 compare_vec = { int32_t(compare), int32_t(compare), int32_t(compare), int32_t(compare) }; const VECS32 compare_mask = VECS32(vec_cmpeq(vec_and(m_value, compare_vec), compare_vec)); - const VECS32 sign_vec = { INT32(sign), INT32(sign), INT32(sign), INT32(sign) }; + const VECS32 sign_vec = { int32_t(sign), int32_t(sign), int32_t(sign), int32_t(sign) }; m_value = vec_or(m_value, vec_and(sign_vec, compare_mask)); } - inline void min(const INT32 value) + inline void min(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = vec_min(m_value, temp); } - inline void max(const INT32 value) + inline void max(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = vec_max(m_value, temp); } - void blend(const rgbaint_t& other, UINT8 factor); + void blend(const rgbaint_t& other, uint8_t factor); void scale_and_clamp(const rgbaint_t& scale); - void scale_imm_and_clamp(const INT32 scale); + void scale_imm_and_clamp(const int32_t scale); - void scale_imm_add_and_clamp(const INT32 scale, const rgbaint_t& other) + void scale_imm_add_and_clamp(const int32_t scale, const rgbaint_t& other) { mul_imm(scale); sra_imm(8); @@ -490,13 +490,13 @@ public: m_value = VECS32(vec_cmpeq(m_value, value.m_value)); } - inline void cmpeq_imm(const INT32 value) + inline void cmpeq_imm(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = VECS32(vec_cmpeq(m_value, temp)); } - inline void cmpeq_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void cmpeq_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 temp = { b, g, r, a }; @@ -511,13 +511,13 @@ public: m_value = VECS32(vec_cmpgt(m_value, value.m_value)); } - inline void cmpgt_imm(const INT32 value) + inline void cmpgt_imm(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = VECS32(vec_cmpgt(m_value, temp)); } - inline void cmpgt_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void cmpgt_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 temp = { b, g, r, a }; @@ -532,13 +532,13 @@ public: m_value = VECS32(vec_cmplt(m_value, value.m_value)); } - inline void cmplt_imm(const INT32 value) + inline void cmplt_imm(const int32_t value) { const VECS32 temp = { value, value, value, value }; m_value = VECS32(vec_cmplt(m_value, temp)); } - inline void cmplt_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b) + inline void cmplt_imm_rgba(const int32_t a, const int32_t r, const int32_t g, const int32_t b) { #ifdef __LITTLE_ENDIAN__ const VECS32 temp = { b, g, r, a }; @@ -554,7 +554,7 @@ public: return *this; } - inline rgbaint_t& operator+=(const INT32 other) + inline rgbaint_t& operator+=(const int32_t other) { const VECS32 temp = { other, other, other, other }; m_value = vec_add(m_value, temp); @@ -579,7 +579,7 @@ public: return *this; } - inline rgbaint_t& operator*=(const INT32 other) + inline rgbaint_t& operator*=(const int32_t other) { const VECS32 value = { other, other, other, other }; const VECU32 shift = vec_splat_u32(-16); @@ -592,9 +592,9 @@ public: return *this; } - inline rgbaint_t& operator>>=(const INT32 shift) + inline rgbaint_t& operator>>=(const int32_t shift) { - const VECU32 temp = { UINT32(shift), UINT32(shift), UINT32(shift), UINT32(shift) }; + const VECU32 temp = { uint32_t(shift), uint32_t(shift), uint32_t(shift), uint32_t(shift) }; m_value = vec_sra(m_value, temp); return *this; } @@ -604,7 +604,7 @@ public: m_value = vec_perm(m_value, alpha.m_value, alpha_perm); } - static UINT32 bilinear_filter(const UINT32 &rgb00, const UINT32 &rgb01, const UINT32 &rgb10, const UINT32 &rgb11, UINT8 u, UINT8 v) + static uint32_t bilinear_filter(const uint32_t &rgb00, const uint32_t &rgb01, const uint32_t &rgb10, const uint32_t &rgb11, uint8_t u, uint8_t v) { const VECS32 zero = vec_splat_s32(0); @@ -642,12 +642,12 @@ public: color01 = VECS32(vec_packs(color01, color01)); color01 = VECS32(vec_packsu(VECS16(color01), VECS16(color01))); - UINT32 result; + uint32_t result; vec_ste(VECU32(color01), 0, &result); return result; } - void bilinear_filter_rgbaint(const UINT32 &rgb00, const UINT32 &rgb01, const UINT32 &rgb10, const UINT32 &rgb11, UINT8 u, UINT8 v) + void bilinear_filter_rgbaint(const uint32_t &rgb00, const uint32_t &rgb01, const uint32_t &rgb10, const uint32_t &rgb11, uint8_t u, uint8_t v) { const VECS32 zero = vec_splat_s32(0); diff --git a/src/frontend/mame/audit.cpp b/src/frontend/mame/audit.cpp index 6adb5539747..b47339cfe67 100644 --- a/src/frontend/mame/audit.cpp +++ b/src/frontend/mame/audit.cpp @@ -380,7 +380,7 @@ media_auditor::audit_record &media_auditor::audit_one_rom(const rom_entry *rom) audit_record &record = *m_record_list.emplace(m_record_list.end(), *rom, media_type::ROM); // see if we have a CRC and extract it if so - UINT32 crc = 0; + uint32_t crc = 0; bool const has_crc = record.expected_hashes().crc(crc); // find the file and checksum it, getting the file length along the way @@ -481,7 +481,7 @@ void media_auditor::compute_status(audit_record &record, const rom_entry *rom, b // shares a media entry with the same hashes //------------------------------------------------- -device_t *media_auditor::find_shared_device(device_t &device, const char *name, const util::hash_collection &romhashes, UINT64 romlength) +device_t *media_auditor::find_shared_device(device_t &device, const char *name, const util::hash_collection &romhashes, uint64_t romlength) { bool const dumped = !romhashes.flag(util::hash_collection::FLAG_NO_DUMP); diff --git a/src/frontend/mame/audit.h b/src/frontend/mame/audit.h index 9e0e131e2ca..be6dccf297c 100644 --- a/src/frontend/mame/audit.h +++ b/src/frontend/mame/audit.h @@ -105,8 +105,8 @@ public: audit_status status() const { return m_status; } audit_substatus substatus() const { return m_substatus; } const char *name() const { return m_name; } - UINT64 expected_length() const { return m_explength; } - UINT64 actual_length() const { return m_length; } + uint64_t expected_length() const { return m_explength; } + uint64_t actual_length() const { return m_length; } const util::hash_collection &expected_hashes() const { return m_exphashes; } const util::hash_collection &actual_hashes() const { return m_hashes; } device_t *shared_device() const { return m_shared_device; } @@ -118,13 +118,13 @@ public: m_substatus = substatus; } - void set_actual(const util::hash_collection &hashes, UINT64 length = 0) + void set_actual(const util::hash_collection &hashes, uint64_t length = 0) { m_hashes = hashes; m_length = length; } - void set_actual(util::hash_collection &&hashes, UINT64 length = 0) + void set_actual(util::hash_collection &&hashes, uint64_t length = 0) { m_hashes = std::move(hashes); m_length = length; @@ -141,8 +141,8 @@ public: audit_status m_status; // status of audit on this item audit_substatus m_substatus; // finer-detail status const char * m_name; // name of item - UINT64 m_explength; // expected length of item - UINT64 m_length; // actual length of item + uint64_t m_explength; // expected length of item + uint64_t m_length; // actual length of item util::hash_collection m_exphashes; // expected hash data util::hash_collection m_hashes; // actual hash information device_t * m_shared_device; // device that shares the rom @@ -168,7 +168,7 @@ private: audit_record &audit_one_rom(const rom_entry *rom); audit_record &audit_one_disk(const rom_entry *rom, const char *locationtag); void compute_status(audit_record &record, const rom_entry *rom, bool found); - device_t *find_shared_device(device_t &device, const char *name, const util::hash_collection &romhashes, UINT64 romlength); + device_t *find_shared_device(device_t &device, const char *name, const util::hash_collection &romhashes, uint64_t romlength); // internal state record_list m_record_list; diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp index 534340782ed..e0023aa24ba 100644 --- a/src/frontend/mame/cheat.cpp +++ b/src/frontend/mame/cheat.cpp @@ -110,16 +110,16 @@ inline std::string number_and_format::format() const { default: case XML_INT_FORMAT_DECIMAL: - return string_format("%d", UINT32(m_value)); + return string_format("%d", uint32_t(m_value)); case XML_INT_FORMAT_DECIMAL_POUND: - return string_format("#%d", UINT32(m_value)); + return string_format("#%d", uint32_t(m_value)); case XML_INT_FORMAT_HEX_DOLLAR: - return string_format("$%X", UINT32(m_value)); + return string_format("$%X", uint32_t(m_value)); case XML_INT_FORMAT_HEX_C: - return string_format("0x%X", UINT32(m_value)); + return string_format("0x%X", uint32_t(m_value)); } } @@ -153,7 +153,7 @@ cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols, throw emu_fatalerror("%s.xml(%d): item is value\n", filename, itemnode->line); // extract the parameters - UINT64 value = xml_get_attribute_int(itemnode, "value", 0); + uint64_t value = xml_get_attribute_int(itemnode, "value", 0); int format = xml_get_attribute_int_format(itemnode, "value"); // allocate and append a new item @@ -179,12 +179,12 @@ const char *cheat_parameter::text() // are we a value cheat? if (!has_itemlist()) { - m_curtext = string_format("%d (0x%X)", UINT32(m_value), UINT32(m_value)); + m_curtext = string_format("%d (0x%X)", uint32_t(m_value), uint32_t(m_value)); } else { // if not, we're an item cheat - m_curtext = string_format("??? (%d)", UINT32(m_value)); + m_curtext = string_format("??? (%d)", uint32_t(m_value)); for (auto &curitem : m_itemlist) if (curitem->value() == m_value) { @@ -234,7 +234,7 @@ void cheat_parameter::save(emu_file &cheatfile) const bool cheat_parameter::set_minimum_state() { - UINT64 origvalue = m_value; + uint64_t origvalue = m_value; // set based on whether we have an item list m_value = (!has_itemlist()) ? m_minval : m_itemlist.front()->value(); @@ -249,7 +249,7 @@ bool cheat_parameter::set_minimum_state() bool cheat_parameter::set_prev_state() { - UINT64 origvalue = m_value; + uint64_t origvalue = m_value; // are we a value cheat? if (!has_itemlist()) @@ -283,7 +283,7 @@ bool cheat_parameter::set_prev_state() bool cheat_parameter::set_next_state() { - UINT64 origvalue = m_value; + uint64_t origvalue = m_value; // are we a value cheat? if (!has_itemlist()) @@ -357,7 +357,7 @@ cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const // execute - execute ourself //------------------------------------------------- -void cheat_script::execute(cheat_manager &manager, UINT64 &argindex) +void cheat_script::execute(cheat_manager &manager, uint64_t &argindex) { // do nothing if disabled if (!manager.enabled()) @@ -470,14 +470,14 @@ cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &s // execute - execute a single script entry //------------------------------------------------- -void cheat_script::script_entry::execute(cheat_manager &manager, UINT64 &argindex) +void cheat_script::script_entry::execute(cheat_manager &manager, uint64_t &argindex) { // evaluate the condition if (!m_condition.is_empty()) { try { - UINT64 result = m_condition.execute(); + uint64_t result = m_condition.execute(); if (result == 0) return; } @@ -505,21 +505,21 @@ void cheat_script::script_entry::execute(cheat_manager &manager, UINT64 &arginde if (!m_format.empty()) { // iterate over arguments and evaluate them - UINT64 params[MAX_ARGUMENTS]; + uint64_t params[MAX_ARGUMENTS]; int curarg = 0; for (auto &arg : m_arglist) curarg += arg->values(argindex, ¶ms[curarg]); // generate the astring manager.get_output_string(m_line, m_justify) = string_format(m_format, - (UINT32)params[0], (UINT32)params[1], (UINT32)params[2], (UINT32)params[3], - (UINT32)params[4], (UINT32)params[5], (UINT32)params[6], (UINT32)params[7], - (UINT32)params[8], (UINT32)params[9], (UINT32)params[10], (UINT32)params[11], - (UINT32)params[12], (UINT32)params[13], (UINT32)params[14], (UINT32)params[15], - (UINT32)params[16], (UINT32)params[17], (UINT32)params[18], (UINT32)params[19], - (UINT32)params[20], (UINT32)params[21], (UINT32)params[22], (UINT32)params[23], - (UINT32)params[24], (UINT32)params[25], (UINT32)params[26], (UINT32)params[27], - (UINT32)params[28], (UINT32)params[29], (UINT32)params[30], (UINT32)params[31]); + (uint32_t)params[0], (uint32_t)params[1], (uint32_t)params[2], (uint32_t)params[3], + (uint32_t)params[4], (uint32_t)params[5], (uint32_t)params[6], (uint32_t)params[7], + (uint32_t)params[8], (uint32_t)params[9], (uint32_t)params[10], (uint32_t)params[11], + (uint32_t)params[12], (uint32_t)params[13], (uint32_t)params[14], (uint32_t)params[15], + (uint32_t)params[16], (uint32_t)params[17], (uint32_t)params[18], (uint32_t)params[19], + (uint32_t)params[20], (uint32_t)params[21], (uint32_t)params[22], (uint32_t)params[23], + (uint32_t)params[24], (uint32_t)params[25], (uint32_t)params[26], (uint32_t)params[27], + (uint32_t)params[28], (uint32_t)params[29], (uint32_t)params[30], (uint32_t)params[31]); } } @@ -638,7 +638,7 @@ cheat_script::script_entry::output_argument::output_argument(cheat_manager &mana // given output argument //------------------------------------------------- -int cheat_script::script_entry::output_argument::values(UINT64 &argindex, UINT64 *result) +int cheat_script::script_entry::output_argument::values(uint64_t &argindex, uint64_t *result) { for (argindex = 0; argindex < m_count; argindex++) { @@ -945,7 +945,7 @@ bool cheat_entry::select_next_state() // this cheat in a menu item //------------------------------------------------- -void cheat_entry::menu_text(std::string &description, std::string &state, UINT32 &flags) +void cheat_entry::menu_text(std::string &description, std::string &state, uint32_t &flags) { // description is standard description.assign(m_description); @@ -1166,7 +1166,7 @@ void cheat_manager::reload() // else we are loading outside the software list, try to load machine_basename/crc32.xml else { - UINT32 crc = image.crc(); + uint32_t crc = image.crc(); if (crc != 0) { load_cheats(string_format("%s%s%08X", machine().basename(), PATH_SEPARATOR, crc).c_str()); @@ -1318,11 +1318,11 @@ std::string cheat_manager::quote_expression(const parsed_expression &expression) // execute_frombcd - convert a value from BCD //------------------------------------------------- -UINT64 cheat_manager::execute_frombcd(symbol_table &table, void *ref, int params, const UINT64 *param) +uint64_t cheat_manager::execute_frombcd(symbol_table &table, void *ref, int params, const uint64_t *param) { - UINT64 value = param[0]; - UINT64 multiplier = 1; - UINT64 result = 0; + uint64_t value = param[0]; + uint64_t multiplier = 1; + uint64_t result = 0; while (value != 0) { @@ -1338,11 +1338,11 @@ UINT64 cheat_manager::execute_frombcd(symbol_table &table, void *ref, int params // execute_tobcd - convert a value to BCD //------------------------------------------------- -UINT64 cheat_manager::execute_tobcd(symbol_table &table, void *ref, int params, const UINT64 *param) +uint64_t cheat_manager::execute_tobcd(symbol_table &table, void *ref, int params, const uint64_t *param) { - UINT64 value = param[0]; - UINT64 result = 0; - UINT8 shift = 0; + uint64_t value = param[0]; + uint64_t result = 0; + uint8_t shift = 0; while (value != 0) { @@ -1363,7 +1363,7 @@ void cheat_manager::frame_update() // set up for accumulating output m_lastline = 0; m_numlines = floor(1.0f / mame_machine_manager::instance()->ui().get_line_height()); - m_numlines = std::min(m_numlines, m_output.size()); + m_numlines = std::min(m_numlines, m_output.size()); for (auto & elem : m_output) elem.clear(); diff --git a/src/frontend/mame/cheat.h b/src/frontend/mame/cheat.h index af68af56ef0..febe1f85cfd 100644 --- a/src/frontend/mame/cheat.h +++ b/src/frontend/mame/cheat.h @@ -49,22 +49,22 @@ class number_and_format { public: // construction/destruction - number_and_format(UINT64 value = 0, int format = 0) + number_and_format(uint64_t value = 0, int format = 0) : m_value(value) , m_format(format) { } // pass-through to look like a regular number - operator UINT64 &() { return m_value; } - operator const UINT64 &() const { return m_value; } + operator uint64_t &() { return m_value; } + operator const uint64_t &() const { return m_value; } // format the number according to its format std::string format() const; private: // internal state - UINT64 m_value; + uint64_t m_value; int m_format; }; @@ -98,7 +98,7 @@ private: { public: // construction/destruction - item(const char *text, UINT64 value, int valformat) + item(const char *text, uint64_t value, int valformat) : m_text(text), m_value(value, valformat) { } @@ -116,7 +116,7 @@ private: number_and_format m_minval; // minimum value number_and_format m_maxval; // maximum value number_and_format m_stepval; // step value - UINT64 m_value; // live value of the parameter + uint64_t m_value; // live value of the parameter std::string m_curtext; // holding for a value string std::vector> m_itemlist; // list of items }; @@ -135,7 +135,7 @@ public: script_state state() const { return m_state; } // actions - void execute(cheat_manager &manager, UINT64 &argindex); + void execute(cheat_manager &manager, uint64_t &argindex); void save(emu_file &cheatfile) const; private: @@ -147,7 +147,7 @@ private: script_entry(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &entrynode, bool isaction); // actions - void execute(cheat_manager &manager, UINT64 &argindex); + void execute(cheat_manager &manager, uint64_t &argindex); void save(emu_file &cheatfile) const; private: @@ -160,7 +160,7 @@ private: // getters int count() const { return m_count; } - int values(UINT64 &argindex, UINT64 *result); + int values(uint64_t &argindex, uint64_t *result); // actions void save(emu_file &cheatfile) const; @@ -168,7 +168,7 @@ private: private: // internal state parsed_expression m_expression; // expression for argument - UINT64 m_count; // number of repetitions + uint64_t m_count; // number of repetitions }; // internal helpers @@ -179,7 +179,7 @@ private: parsed_expression m_expression; // expression to execute std::string m_format; // string format to print std::vector> m_arglist; // list of arguments - INT8 m_line; // which line to print on + int8_t m_line; // which line to print on ui::text_layout::text_justify m_justify; // justification when printing // constants @@ -237,7 +237,7 @@ public: void save(emu_file &cheatfile) const; // UI helpers - void menu_text(std::string &description, std::string &state, UINT32 &flags); + void menu_text(std::string &description, std::string &state, uint32_t &flags); // per-frame update void frame_update() { if (m_state == SCRIPT_STATE_RUN) execute_run_script(); } @@ -258,8 +258,8 @@ private: std::unique_ptr m_run_script; // script to run each frame when on symbol_table m_symbols; // symbol table for this cheat script_state m_state; // current cheat state - UINT32 m_numtemp; // number of temporary variables - UINT64 m_argindex; // argument index variable + uint32_t m_numtemp; // number of temporary variables + uint64_t m_argindex; // argument index variable // constants static const int DEFAULT_TEMP_VARIABLES = 10; @@ -293,8 +293,8 @@ public: // global helpers static std::string quote_expression(const parsed_expression &expression); - static UINT64 execute_frombcd(symbol_table &table, void *ref, int params, const UINT64 *param); - static UINT64 execute_tobcd(symbol_table &table, void *ref, int params, const UINT64 *param); + static uint64_t execute_frombcd(symbol_table &table, void *ref, int params, const uint64_t *param); + static uint64_t execute_tobcd(symbol_table &table, void *ref, int params, const uint64_t *param); private: // internal helpers @@ -304,11 +304,11 @@ private: // internal state running_machine & m_machine; // reference to our machine std::vector> m_cheatlist; // cheat list - UINT64 m_framecount; // frame count + uint64_t m_framecount; // frame count std::vector m_output; // array of output strings std::vector m_justify; // justification for each string - UINT8 m_numlines; // number of lines available for output - INT8 m_lastline; // last line used for output + uint8_t m_numlines; // number of lines available for output + int8_t m_lastline; // last line used for output bool m_disabled; // true if the cheat engine is disabled symbol_table m_symtable; // global symbol table std::unique_ptr m_cpu; // debugger interface for cpus/memory diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index d7f9a7e76e6..96281849884 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -541,7 +541,7 @@ void cli_frontend::listcrc(const char *gamename) for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom)) { // if we have a CRC, display it - UINT32 crc; + uint32_t crc; if (util::hash_collection(ROM_GETHASHDATA(rom)).crc(crc)) osd_printf_info("%08x %-16s \t %-8s \t %s\n", crc, ROM_GETNAME(rom), device.shortname(), device.name()); } @@ -712,7 +712,7 @@ void cli_frontend::listdevices(const char *gamename) printf(" %*s%-*s %s", depth * 2, "", 30 - depth * 2, tag, device->name()); // add more information - UINT32 clock = device->clock(); + uint32_t clock = device->clock(); if (clock >= 1000000000) printf(" @ %d.%02d GHz\n", clock / 1000000000, (clock / 10000000) % 100); else if (clock >= 1000000) diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp index c35f9e8d743..fe5ffad3468 100644 --- a/src/frontend/mame/info.cpp +++ b/src/frontend/mame/info.cpp @@ -861,10 +861,10 @@ void info_xml_creator::output_input(const ioport_list &portlist) }; // directions - const UINT8 DIR_UP = 0x01; - const UINT8 DIR_DOWN = 0x02; - const UINT8 DIR_LEFT = 0x04; - const UINT8 DIR_RIGHT = 0x08; + const uint8_t DIR_UP = 0x01; + const uint8_t DIR_DOWN = 0x02; + const uint8_t DIR_LEFT = 0x04; + const uint8_t DIR_RIGHT = 0x08; // initialize the list of control types struct @@ -876,11 +876,11 @@ void info_xml_creator::output_input(const ioport_list &portlist) int maxbuttons; // max index of buttons (using IPT_BUTTONn) [probably to be removed soonish] int ways; // directions for joystick bool analog; // is analog input? - UINT8 helper[3]; // for dual joysticks [possibly to be removed soonish] - INT32 min; // analog minimum value - INT32 max; // analog maximum value - INT32 sensitivity; // default analog sensitivity - INT32 keydelta; // default analog keydelta + uint8_t helper[3]; // for dual joysticks [possibly to be removed soonish] + int32_t min; // analog minimum value + int32_t max; // analog maximum value + int32_t sensitivity; // default analog sensitivity + int32_t keydelta; // default analog keydelta bool reverse; // default analog reverse setting } control_info[CTRL_COUNT * CTRL_PCOUNT]; diff --git a/src/frontend/mame/language.cpp b/src/frontend/mame/language.cpp index 5c9686a646e..93d8e410c4a 100644 --- a/src/frontend/mame/language.cpp +++ b/src/frontend/mame/language.cpp @@ -22,14 +22,14 @@ const char *lang_translate(const char *word) return g_translation[word].c_str(); } -const UINT32 MO_MAGIC = 0x950412de; -const UINT32 MO_MAGIC_REVERSED = 0xde120495; +const uint32_t MO_MAGIC = 0x950412de; +const uint32_t MO_MAGIC_REVERSED = 0xde120495; -inline UINT32 endianchange(UINT32 value) { - UINT32 b0 = (value >> 0) & 0xff; - UINT32 b1 = (value >> 8) & 0xff; - UINT32 b2 = (value >> 16) & 0xff; - UINT32 b3 = (value >> 24) & 0xff; +inline uint32_t endianchange(uint32_t value) { + uint32_t b0 = (value >> 0) & 0xff; + uint32_t b1 = (value >> 8) & 0xff; + uint32_t b2 = (value >> 16) & 0xff; + uint32_t b3 = (value >> 24) & 0xff; return (b0 << 24) | (b1 << 16) | (b2 << 8) | b3; } @@ -44,8 +44,8 @@ void load_translation(emu_options &m_options) strreplace(name, ")", ""); if (file.open(name.c_str(), PATH_SEPARATOR "strings.mo") == osd_file::error::NONE) { - UINT64 size = file.size(); - UINT32 *buffer = global_alloc_array(UINT32, size / 4 + 1); + uint64_t size = file.size(); + uint32_t *buffer = global_alloc_array(uint32_t, size / 4 + 1); file.read(buffer, size); file.close(); @@ -62,9 +62,9 @@ void load_translation(emu_options &m_options) } } - UINT32 number_of_strings = buffer[2]; - UINT32 original_table_offset = buffer[3] >> 2; - UINT32 translation_table_offset = buffer[4] >> 2; + uint32_t number_of_strings = buffer[2]; + uint32_t original_table_offset = buffer[3] >> 2; + uint32_t translation_table_offset = buffer[4] >> 2; const char *data = reinterpret_cast(buffer); diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 22380727f59..1fdd40371ad 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -283,7 +283,7 @@ void lua_engine::resume(lua_State *L, int nparam, lua_State *root) } } -void lua_engine::resume(void *lua, INT32 param) +void lua_engine::resume(void *lua, int32_t param) { resume(static_cast(lua)); } @@ -380,7 +380,7 @@ int lua_engine::l_emu_time(lua_State *L) return 1; } -void lua_engine::emu_after_done(void *_h, INT32 param) +void lua_engine::emu_after_done(void *_h, int32_t param) { hook *h = static_cast(_h); h->call(this, h->precall(), 0); @@ -413,7 +413,7 @@ int lua_engine::l_emu_wait(lua_State *L) return luaThis->emu_wait(L); } -void lua_engine::output_notifier(const char *outname, INT32 value) +void lua_engine::output_notifier(const char *outname, int32_t value) { if (hook_output_cb.active()) { lua_State *L = hook_output_cb.precall(); @@ -423,7 +423,7 @@ void lua_engine::output_notifier(const char *outname, INT32 value) } } -void lua_engine::s_output_notifier(const char *outname, INT32 value, void *param) +void lua_engine::s_output_notifier(const char *outname, int32_t value, void *param) { static_cast(param)->output_notifier(outname, value); } @@ -828,16 +828,16 @@ int lua_engine::lua_item::l_item_read(lua_State *L) { case 1: default: - ret = ((UINT8 *)l_item_base)[offset]; + ret = ((uint8_t *)l_item_base)[offset]; break; case 2: - ret = ((UINT16 *)l_item_base)[offset]; + ret = ((uint16_t *)l_item_base)[offset]; break; case 4: - ret = ((UINT32 *)l_item_base)[offset]; + ret = ((uint32_t *)l_item_base)[offset]; break; case 8: - ret = ((UINT64 *)l_item_base)[offset]; + ret = ((uint64_t *)l_item_base)[offset]; break; } lua_pushunsigned(L, ret); @@ -849,23 +849,23 @@ int lua_engine::lua_item::l_item_write(lua_State *L) luaL_argcheck(L, lua_isnumber(L, 2), 2, "offset (integer) expected"); luaL_argcheck(L, lua_isnumber(L, 3), 3, "value (integer) expected"); int offset = lua_tounsigned(L, 2); - UINT64 value = lua_tounsigned(L, 3); + uint64_t value = lua_tounsigned(L, 3); if(!l_item_base || (offset > l_item_count)) return 1; switch(l_item_size) { case 1: default: - ((UINT8 *)l_item_base)[offset] = (UINT8)value; + ((uint8_t *)l_item_base)[offset] = (uint8_t)value; break; case 2: - ((UINT16 *)l_item_base)[offset] = (UINT16)value; + ((uint16_t *)l_item_base)[offset] = (uint16_t)value; break; case 4: - ((UINT32 *)l_item_base)[offset] = (UINT32)value; + ((uint32_t *)l_item_base)[offset] = (uint32_t)value; break; case 8: - ((UINT64 *)l_item_base)[offset] = (UINT64)value; + ((uint64_t *)l_item_base)[offset] = (uint64_t)value; break; } return 1; @@ -894,7 +894,7 @@ int lua_engine::lua_item::l_item_read_block(lua_State *L) // -> manager:machine().devices[":maincpu"].state["PC"].value //------------------------------------------------- -UINT64 lua_engine::l_state_get_value(const device_state_entry *d) +uint64_t lua_engine::l_state_get_value(const device_state_entry *d) { device_state_interface *state = d->parent_state(); if(state) { @@ -910,7 +910,7 @@ UINT64 lua_engine::l_state_get_value(const device_state_entry *d) // -> manager:machine().devices[":maincpu"].state["D0"].value = 0x0c00 //------------------------------------------------- -void lua_engine::l_state_set_value(device_state_entry *d, UINT64 val) +void lua_engine::l_state_set_value(device_state_entry *d, uint64_t val) { device_state_interface *state = d->parent_state(); if(state) { @@ -1147,7 +1147,7 @@ int lua_engine::lua_addr_space::l_direct_mem_read(lua_State *L) for(int i = 0; i < sizeof(T); i++) { int addr = sp.endianness() == ENDIANNESS_LITTLE ? address + sizeof(T) - 1 - i : address + i; - UINT8 *base = (UINT8 *)sp.get_read_ptr(sp.address_to_byte(addr & ~lowmask)); + uint8_t *base = (uint8_t *)sp.get_read_ptr(sp.address_to_byte(addr & ~lowmask)); if(!base) continue; mem_content <<= 8; @@ -1184,7 +1184,7 @@ int lua_engine::lua_addr_space::l_direct_mem_write(lua_State *L) for(int i = 0; i < sizeof(T); i++) { int addr = sp.endianness() == ENDIANNESS_BIG ? address + sizeof(T) - 1 - i : address + i; - UINT8 *base = (UINT8 *)sp.get_read_ptr(sp.address_to_byte(addr & ~lowmask)); + uint8_t *base = (uint8_t *)sp.get_read_ptr(sp.address_to_byte(addr & ~lowmask)); if(!base) continue; if(sp.endianness() == ENDIANNESS_BIG) @@ -1273,7 +1273,7 @@ int lua_engine::lua_memory_share::l_share_read(lua_State *L) offs_t address = lua_tounsigned(L, 2); T mem_content = 0; offs_t lowmask = share.bytewidth() - 1; - UINT8* ptr = (UINT8*)share.ptr(); + uint8_t* ptr = (uint8_t*)share.ptr(); for(int i = 0; i < sizeof(T); i++) { int addr = share.endianness() == ENDIANNESS_LITTLE ? address + sizeof(T) - 1 - i : address + i; @@ -1309,7 +1309,7 @@ int lua_engine::lua_memory_share::l_share_write(lua_State *L) offs_t address = lua_tounsigned(L, 2); T val = lua_tounsigned(L, 3); offs_t lowmask = share.bytewidth() - 1; - UINT8* ptr = (UINT8*)share.ptr(); + uint8_t* ptr = (uint8_t*)share.ptr(); for(int i = 0; i < sizeof(T); i++) { int addr = share.endianness() == ENDIANNESS_BIG ? address + sizeof(T) - 1 - i : address + i; @@ -1479,7 +1479,7 @@ int lua_engine::lua_screen::l_width(lua_State *L) int lua_engine::lua_screen::l_orientation(lua_State *L) { - UINT32 flags = (luaThis->machine().system().flags & ORIENTATION_MASK); + uint32_t flags = (luaThis->machine().system().flags & ORIENTATION_MASK); int rotation_angle = 0; switch (flags) @@ -1626,8 +1626,8 @@ int lua_engine::lua_screen::l_draw_box(lua_State *L) y1 = std::min(std::max(0.0f, (float) lua_tonumber(L, 3)), float(sc_height-1)) / float(sc_height); x2 = std::min(std::max(0.0f, (float) lua_tonumber(L, 4)), float(sc_width-1)) / float(sc_width); y2 = std::min(std::max(0.0f, (float) lua_tonumber(L, 5)), float(sc_height-1)) / float(sc_height); - UINT32 bgcolor = lua_tounsigned(L, 6); - UINT32 fgcolor = lua_tounsigned(L, 7); + uint32_t bgcolor = lua_tounsigned(L, 6); + uint32_t fgcolor = lua_tounsigned(L, 7); // draw the box render_container &rc = sc->container(); @@ -1663,7 +1663,7 @@ int lua_engine::lua_screen::l_draw_line(lua_State *L) y1 = std::min(std::max(0.0f, (float) lua_tonumber(L, 3)), float(sc_height-1)) / float(sc_height); x2 = std::min(std::max(0.0f, (float) lua_tonumber(L, 4)), float(sc_width-1)) / float(sc_width); y2 = std::min(std::max(0.0f, (float) lua_tonumber(L, 5)), float(sc_height-1)) / float(sc_height); - UINT32 color = lua_tounsigned(L, 6); + uint32_t color = lua_tounsigned(L, 6); // draw the line sc->container().add_line(x1, y1, x2, y2, UI_LINE_WIDTH, rgb_t(color), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); @@ -1738,7 +1738,7 @@ int lua_engine::lua_emu_file::l_emu_file_read(lua_State *L) int lua_engine::lua_ui_input::l_ui_input_find_mouse(lua_State *L) { ui_input_manager *ui_input = luabridge::Stack::get(L, 1); - INT32 x, y; + int32_t x, y; bool button; render_target *target = ui_input->find_mouse(&x, &y, &button); lua_pushnumber(L, x); @@ -2429,7 +2429,7 @@ void lua_engine::initialize() .addFunction ("set_value", &ioport_field::set_value) .addProperty ("device", &ioport_field::device) .addProperty ("name", &ioport_field::name) - .addProperty ("player", &ioport_field::player, &ioport_field::set_player) + .addProperty ("player", &ioport_field::player, &ioport_field::set_player) .addProperty ("mask", &ioport_field::mask) .addProperty ("defvalue", &ioport_field::defvalue) .addProperty ("sensitivity", &ioport_field::sensitivity) @@ -2491,54 +2491,54 @@ void lua_engine::initialize() .endClass() .beginClass ("lua_addr_space") .addConstructor () - .addCFunction ("read_i8", &lua_addr_space::l_mem_read) - .addCFunction ("read_u8", &lua_addr_space::l_mem_read) - .addCFunction ("read_i16", &lua_addr_space::l_mem_read) - .addCFunction ("read_u16", &lua_addr_space::l_mem_read) - .addCFunction ("read_i32", &lua_addr_space::l_mem_read) - .addCFunction ("read_u32", &lua_addr_space::l_mem_read) - .addCFunction ("read_i64", &lua_addr_space::l_mem_read) - .addCFunction ("read_u64", &lua_addr_space::l_mem_read) - .addCFunction ("write_i8", &lua_addr_space::l_mem_write) - .addCFunction ("write_u8", &lua_addr_space::l_mem_write) - .addCFunction ("write_i16", &lua_addr_space::l_mem_write) - .addCFunction ("write_u16", &lua_addr_space::l_mem_write) - .addCFunction ("write_i32", &lua_addr_space::l_mem_write) - .addCFunction ("write_u32", &lua_addr_space::l_mem_write) - .addCFunction ("write_i64", &lua_addr_space::l_mem_write) - .addCFunction ("write_u64", &lua_addr_space::l_mem_write) - .addCFunction ("read_log_i8", &lua_addr_space::l_log_mem_read) - .addCFunction ("read_log_u8", &lua_addr_space::l_log_mem_read) - .addCFunction ("read_log_i16", &lua_addr_space::l_log_mem_read) - .addCFunction ("read_log_u16", &lua_addr_space::l_log_mem_read) - .addCFunction ("read_log_i32", &lua_addr_space::l_log_mem_read) - .addCFunction ("read_log_u32", &lua_addr_space::l_log_mem_read) - .addCFunction ("read_log_i64", &lua_addr_space::l_log_mem_read) - .addCFunction ("read_log_u64", &lua_addr_space::l_log_mem_read) - .addCFunction ("write_log_i8", &lua_addr_space::l_log_mem_write) - .addCFunction ("write_log_u8", &lua_addr_space::l_log_mem_write) - .addCFunction ("write_log_i16", &lua_addr_space::l_log_mem_write) - .addCFunction ("write_log_u16", &lua_addr_space::l_log_mem_write) - .addCFunction ("write_log_i32", &lua_addr_space::l_log_mem_write) - .addCFunction ("write_log_u32", &lua_addr_space::l_log_mem_write) - .addCFunction ("write_log_i64", &lua_addr_space::l_log_mem_write) - .addCFunction ("write_log_u64", &lua_addr_space::l_log_mem_write) - .addCFunction ("read_direct_i8", &lua_addr_space::l_direct_mem_read) - .addCFunction ("read_direct_u8", &lua_addr_space::l_direct_mem_read) - .addCFunction ("read_direct_i16", &lua_addr_space::l_direct_mem_read) - .addCFunction ("read_direct_u16", &lua_addr_space::l_direct_mem_read) - .addCFunction ("read_direct_i32", &lua_addr_space::l_direct_mem_read) - .addCFunction ("read_direct_u32", &lua_addr_space::l_direct_mem_read) - .addCFunction ("read_direct_i64", &lua_addr_space::l_direct_mem_read) - .addCFunction ("read_direct_u64", &lua_addr_space::l_direct_mem_read) - .addCFunction ("write_direct_i8", &lua_addr_space::l_direct_mem_write) - .addCFunction ("write_direct_u8", &lua_addr_space::l_direct_mem_write) - .addCFunction ("write_direct_i16", &lua_addr_space::l_direct_mem_write) - .addCFunction ("write_direct_u16", &lua_addr_space::l_direct_mem_write) - .addCFunction ("write_direct_i32", &lua_addr_space::l_direct_mem_write) - .addCFunction ("write_direct_u32", &lua_addr_space::l_direct_mem_write) - .addCFunction ("write_direct_i64", &lua_addr_space::l_direct_mem_write) - .addCFunction ("write_direct_u64", &lua_addr_space::l_direct_mem_write) + .addCFunction ("read_i8", &lua_addr_space::l_mem_read) + .addCFunction ("read_u8", &lua_addr_space::l_mem_read) + .addCFunction ("read_i16", &lua_addr_space::l_mem_read) + .addCFunction ("read_u16", &lua_addr_space::l_mem_read) + .addCFunction ("read_i32", &lua_addr_space::l_mem_read) + .addCFunction ("read_u32", &lua_addr_space::l_mem_read) + .addCFunction ("read_i64", &lua_addr_space::l_mem_read) + .addCFunction ("read_u64", &lua_addr_space::l_mem_read) + .addCFunction ("write_i8", &lua_addr_space::l_mem_write) + .addCFunction ("write_u8", &lua_addr_space::l_mem_write) + .addCFunction ("write_i16", &lua_addr_space::l_mem_write) + .addCFunction ("write_u16", &lua_addr_space::l_mem_write) + .addCFunction ("write_i32", &lua_addr_space::l_mem_write) + .addCFunction ("write_u32", &lua_addr_space::l_mem_write) + .addCFunction ("write_i64", &lua_addr_space::l_mem_write) + .addCFunction ("write_u64", &lua_addr_space::l_mem_write) + .addCFunction ("read_log_i8", &lua_addr_space::l_log_mem_read) + .addCFunction ("read_log_u8", &lua_addr_space::l_log_mem_read) + .addCFunction ("read_log_i16", &lua_addr_space::l_log_mem_read) + .addCFunction ("read_log_u16", &lua_addr_space::l_log_mem_read) + .addCFunction ("read_log_i32", &lua_addr_space::l_log_mem_read) + .addCFunction ("read_log_u32", &lua_addr_space::l_log_mem_read) + .addCFunction ("read_log_i64", &lua_addr_space::l_log_mem_read) + .addCFunction ("read_log_u64", &lua_addr_space::l_log_mem_read) + .addCFunction ("write_log_i8", &lua_addr_space::l_log_mem_write) + .addCFunction ("write_log_u8", &lua_addr_space::l_log_mem_write) + .addCFunction ("write_log_i16", &lua_addr_space::l_log_mem_write) + .addCFunction ("write_log_u16", &lua_addr_space::l_log_mem_write) + .addCFunction ("write_log_i32", &lua_addr_space::l_log_mem_write) + .addCFunction ("write_log_u32", &lua_addr_space::l_log_mem_write) + .addCFunction ("write_log_i64", &lua_addr_space::l_log_mem_write) + .addCFunction ("write_log_u64", &lua_addr_space::l_log_mem_write) + .addCFunction ("read_direct_i8", &lua_addr_space::l_direct_mem_read) + .addCFunction ("read_direct_u8", &lua_addr_space::l_direct_mem_read) + .addCFunction ("read_direct_i16", &lua_addr_space::l_direct_mem_read) + .addCFunction ("read_direct_u16", &lua_addr_space::l_direct_mem_read) + .addCFunction ("read_direct_i32", &lua_addr_space::l_direct_mem_read) + .addCFunction ("read_direct_u32", &lua_addr_space::l_direct_mem_read) + .addCFunction ("read_direct_i64", &lua_addr_space::l_direct_mem_read) + .addCFunction ("read_direct_u64", &lua_addr_space::l_direct_mem_read) + .addCFunction ("write_direct_i8", &lua_addr_space::l_direct_mem_write) + .addCFunction ("write_direct_u8", &lua_addr_space::l_direct_mem_write) + .addCFunction ("write_direct_i16", &lua_addr_space::l_direct_mem_write) + .addCFunction ("write_direct_u16", &lua_addr_space::l_direct_mem_write) + .addCFunction ("write_direct_i32", &lua_addr_space::l_direct_mem_write) + .addCFunction ("write_direct_u32", &lua_addr_space::l_direct_mem_write) + .addCFunction ("write_direct_i64", &lua_addr_space::l_direct_mem_write) + .addCFunction ("write_direct_u64", &lua_addr_space::l_direct_mem_write) .addProperty ("name", &lua_addr_space::name) .addProperty ("map", &lua_engine::l_addr_space_map) .endClass() @@ -2613,7 +2613,7 @@ void lua_engine::initialize() .endClass() .beginClass ("dev_space") .addFunction ("name", &device_state_entry::symbol) - .addProperty ("value", &lua_engine::l_state_get_value, &lua_engine::l_state_set_value) + .addProperty ("value", &lua_engine::l_state_get_value, &lua_engine::l_state_set_value) .addFunction ("is_visible", &device_state_entry::visible) .addFunction ("is_divider", &device_state_entry::divider) .endClass() @@ -2623,43 +2623,43 @@ void lua_engine::initialize() .addProperty ("shares", &lua_engine::l_memory_get_shares) .endClass() .beginClass ("lua_region") - .addCFunction ("read_i8", &lua_memory_region::l_region_read) - .addCFunction ("read_u8", &lua_memory_region::l_region_read) - .addCFunction ("read_i16", &lua_memory_region::l_region_read) - .addCFunction ("read_u16", &lua_memory_region::l_region_read) - .addCFunction ("read_i32", &lua_memory_region::l_region_read) - .addCFunction ("read_u32", &lua_memory_region::l_region_read) - .addCFunction ("read_i64", &lua_memory_region::l_region_read) - .addCFunction ("read_u64", &lua_memory_region::l_region_read) - .addCFunction ("write_i8", &lua_memory_region::l_region_write) - .addCFunction ("write_u8", &lua_memory_region::l_region_write) - .addCFunction ("write_i16", &lua_memory_region::l_region_write) - .addCFunction ("write_u16", &lua_memory_region::l_region_write) - .addCFunction ("write_i32", &lua_memory_region::l_region_write) - .addCFunction ("write_u32", &lua_memory_region::l_region_write) - .addCFunction ("write_i64", &lua_memory_region::l_region_write) - .addCFunction ("write_u64", &lua_memory_region::l_region_write) + .addCFunction ("read_i8", &lua_memory_region::l_region_read) + .addCFunction ("read_u8", &lua_memory_region::l_region_read) + .addCFunction ("read_i16", &lua_memory_region::l_region_read) + .addCFunction ("read_u16", &lua_memory_region::l_region_read) + .addCFunction ("read_i32", &lua_memory_region::l_region_read) + .addCFunction ("read_u32", &lua_memory_region::l_region_read) + .addCFunction ("read_i64", &lua_memory_region::l_region_read) + .addCFunction ("read_u64", &lua_memory_region::l_region_read) + .addCFunction ("write_i8", &lua_memory_region::l_region_write) + .addCFunction ("write_u8", &lua_memory_region::l_region_write) + .addCFunction ("write_i16", &lua_memory_region::l_region_write) + .addCFunction ("write_u16", &lua_memory_region::l_region_write) + .addCFunction ("write_i32", &lua_memory_region::l_region_write) + .addCFunction ("write_u32", &lua_memory_region::l_region_write) + .addCFunction ("write_i64", &lua_memory_region::l_region_write) + .addCFunction ("write_u64", &lua_memory_region::l_region_write) .endClass() .deriveClass ("region") - .addProperty ("size", &memory_region::bytes) + .addProperty ("size", &memory_region::bytes) .endClass() .beginClass ("lua_share") - .addCFunction ("read_i8", &lua_memory_share::l_share_read) - .addCFunction ("read_u8", &lua_memory_share::l_share_read) - .addCFunction ("read_i16", &lua_memory_share::l_share_read) - .addCFunction ("read_u16", &lua_memory_share::l_share_read) - .addCFunction ("read_i32", &lua_memory_share::l_share_read) - .addCFunction ("read_u32", &lua_memory_share::l_share_read) - .addCFunction ("read_i64", &lua_memory_share::l_share_read) - .addCFunction ("read_u64", &lua_memory_share::l_share_read) - .addCFunction ("write_i8", &lua_memory_share::l_share_write) - .addCFunction ("write_u8", &lua_memory_share::l_share_write) - .addCFunction ("write_i16", &lua_memory_share::l_share_write) - .addCFunction ("write_u16", &lua_memory_share::l_share_write) - .addCFunction ("write_i32", &lua_memory_share::l_share_write) - .addCFunction ("write_u32", &lua_memory_share::l_share_write) - .addCFunction ("write_i64", &lua_memory_share::l_share_write) - .addCFunction ("write_u64", &lua_memory_share::l_share_write) + .addCFunction ("read_i8", &lua_memory_share::l_share_read) + .addCFunction ("read_u8", &lua_memory_share::l_share_read) + .addCFunction ("read_i16", &lua_memory_share::l_share_read) + .addCFunction ("read_u16", &lua_memory_share::l_share_read) + .addCFunction ("read_i32", &lua_memory_share::l_share_read) + .addCFunction ("read_u32", &lua_memory_share::l_share_read) + .addCFunction ("read_i64", &lua_memory_share::l_share_read) + .addCFunction ("read_u64", &lua_memory_share::l_share_read) + .addCFunction ("write_i8", &lua_memory_share::l_share_write) + .addCFunction ("write_u8", &lua_memory_share::l_share_write) + .addCFunction ("write_i16", &lua_memory_share::l_share_write) + .addCFunction ("write_u16", &lua_memory_share::l_share_write) + .addCFunction ("write_i32", &lua_memory_share::l_share_write) + .addCFunction ("write_u32", &lua_memory_share::l_share_write) + .addCFunction ("write_i64", &lua_memory_share::l_share_write) + .addCFunction ("write_u64", &lua_memory_share::l_share_write) .endClass() .deriveClass ("region") .addProperty ("size", &memory_share::bytes) @@ -2693,7 +2693,7 @@ void lua_engine::initialize() .addCFunction ("read", &lua_emu_file::l_emu_file_read) .endClass() .deriveClass ("file") - .addConstructor () + .addConstructor () .addFunction ("open", static_cast(&emu_file::open)) .addFunction ("open_next", &emu_file::open_next) .addFunction ("seek", &emu_file::seek) diff --git a/src/frontend/mame/luaengine.h b/src/frontend/mame/luaengine.h index c0f9acd491d..dcfb76cb571 100644 --- a/src/frontend/mame/luaengine.h +++ b/src/frontend/mame/luaengine.h @@ -104,10 +104,10 @@ private: void on_machine_resume(); void on_machine_frame(); - void output_notifier(const char *outname, INT32 value); - static void s_output_notifier(const char *outname, INT32 value, void *param); + void output_notifier(const char *outname, int32_t value); + static void s_output_notifier(const char *outname, int32_t value, void *param); - void emu_after_done(void *_h, INT32 param); + void emu_after_done(void *_h, int32_t param); int emu_after(lua_State *L); int emu_wait(lua_State *L); void emu_hook_output(lua_State *L); @@ -154,8 +154,8 @@ private: static luabridge::LuaRef l_ioports_port_get_fields(const ioport_port *i); static luabridge::LuaRef devtree_dfs(device_t *root, luabridge::LuaRef dev_table); static luabridge::LuaRef l_dev_get_states(const device_t *d); - static UINT64 l_state_get_value(const device_state_entry *d); - static void l_state_set_value(device_state_entry *d, UINT64 v); + static uint64_t l_state_get_value(const device_state_entry *d); + static void l_state_set_value(device_state_entry *d, uint64_t v); static luabridge::LuaRef l_dev_get_memspaces(const device_t *d); struct lua_machine { int l_popmessage(lua_State *L); @@ -240,7 +240,7 @@ private: int l_item_write(lua_State *L); }; - void resume(void *L, INT32 param); + void resume(void *L, int32_t param); void start(); static int luaopen_ioport(lua_State *L); void close(); diff --git a/src/frontend/mame/mameopts.h b/src/frontend/mame/mameopts.h index 962048826b2..0b47bfa3dad 100644 --- a/src/frontend/mame/mameopts.h +++ b/src/frontend/mame/mameopts.h @@ -50,7 +50,7 @@ class software_part; class mame_options { - static const UINT32 OPTION_FLAG_DEVICE = 0x80000000; + static const uint32_t OPTION_FLAG_DEVICE = 0x80000000; public: // parsing wrappers diff --git a/src/frontend/mame/media_ident.cpp b/src/frontend/mame/media_ident.cpp index 4642cc84fb5..5e975be8d4b 100644 --- a/src/frontend/mame/media_ident.cpp +++ b/src/frontend/mame/media_ident.cpp @@ -151,12 +151,12 @@ void media_identifier::identify_file(const char *name) else { // load the file and process if it opens and has a valid length - UINT32 length; + uint32_t length; void *data; const osd_file::error filerr = util::core_file::load(name, &data, length); if (filerr == osd_file::error::NONE && length > 0) { - identify_data(name, reinterpret_cast(data), length); + identify_data(name, reinterpret_cast(data), length); osd_free(data); } } @@ -169,10 +169,10 @@ void media_identifier::identify_file(const char *name) // fusemap into raw data first //------------------------------------------------- -void media_identifier::identify_data(const char *name, const UINT8 *data, int length) +void media_identifier::identify_data(const char *name, const uint8_t *data, int length) { // if this is a '.jed' file, process it into raw bits first - std::vector tempjed; + std::vector tempjed; jed_data jed; if (core_filename_ends_with(name, ".jed") && jed_parse(data, length, &jed) == JEDERR_NONE) { diff --git a/src/frontend/mame/media_ident.h b/src/frontend/mame/media_ident.h index 93ff8caad52..8a4ae3cedaa 100644 --- a/src/frontend/mame/media_ident.h +++ b/src/frontend/mame/media_ident.h @@ -27,7 +27,7 @@ public: void reset() { m_total = m_matches = m_nonroms = 0; } void identify(const char *name); void identify_file(const char *name); - void identify_data(const char *name, const UINT8 *data, int length); + void identify_data(const char *name, const uint8_t *data, int length); int find_by_hash(const util::hash_collection &hashes, int length); private: diff --git a/src/frontend/mame/ui/cheatopt.cpp b/src/frontend/mame/ui/cheatopt.cpp index b3838a296e7..d04b4e2e289 100644 --- a/src/frontend/mame/ui/cheatopt.cpp +++ b/src/frontend/mame/ui/cheatopt.cpp @@ -142,7 +142,7 @@ void menu_cheat::populate() if (!mame_machine_manager::instance()->cheat().entries().empty()) { for (auto &curcheat : mame_machine_manager::instance()->cheat().entries()) { - UINT32 flags; + uint32_t flags; curcheat->menu_text(text, subtext, flags); if (text == MENU_SEPARATOR_ITEM) item_append(menu_item_type::SEPARATOR, flags); diff --git a/src/frontend/mame/ui/custmenu.cpp b/src/frontend/mame/ui/custmenu.cpp index 71f65a4093f..6e0e6d6576f 100644 --- a/src/frontend/mame/ui/custmenu.cpp +++ b/src/frontend/mame/ui/custmenu.cpp @@ -155,7 +155,7 @@ void menu_custom_filter::handle() void menu_custom_filter::populate() { // add main filter - UINT32 arrow_flags = get_arrow_flags(FILTER_ALL, FILTER_UNAVAILABLE, custfltr::main); + uint32_t arrow_flags = get_arrow_flags(FILTER_ALL, FILTER_UNAVAILABLE, custfltr::main); item_append(_("Main filter"), main_filters::text[custfltr::main], arrow_flags, (void *)(uintptr_t)MAIN_FILTER); // add other filters @@ -164,7 +164,7 @@ void menu_custom_filter::populate() item_append(menu_item_type::SEPARATOR); // add filter items - arrow_flags = get_arrow_flags(FILTER_UNAVAILABLE + 1, FILTER_LAST - 1, custfltr::other[x]); + arrow_flags = get_arrow_flags(FILTER_UNAVAILABLE + 1, FILTER_LAST - 1, custfltr::other[x]); item_append(_("Other filter"), main_filters::text[custfltr::other[x]], arrow_flags, (void *)(uintptr_t)(OTHER_FILTER + x)); if (m_added) @@ -173,7 +173,7 @@ void menu_custom_filter::populate() // add manufacturer subitem if (custfltr::other[x] == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0) { - arrow_flags = get_arrow_flags(0, c_mnfct::ui.size() - 1, custfltr::mnfct[x]); + arrow_flags = get_arrow_flags(0, c_mnfct::ui.size() - 1, custfltr::mnfct[x]); std::string fbuff(_("^!Manufacturer")); convert_command_glyph(fbuff); item_append(fbuff, c_mnfct::ui[custfltr::mnfct[x]], arrow_flags, (void *)(uintptr_t)(MNFCT_FILTER + x)); @@ -182,7 +182,7 @@ void menu_custom_filter::populate() // add year subitem else if (custfltr::other[x] == FILTER_YEAR && c_year::ui.size() > 0) { - arrow_flags = get_arrow_flags(0, c_year::ui.size() - 1, custfltr::year[x]); + arrow_flags = get_arrow_flags(0, c_year::ui.size() - 1, custfltr::year[x]); std::string fbuff(_("^!Year")); convert_command_glyph(fbuff); item_append(fbuff, c_year::ui[custfltr::year[x]], arrow_flags, (void *)(uintptr_t)(YEAR_FILTER + x)); @@ -442,7 +442,7 @@ void menu_swcustom_filter::handle() void menu_swcustom_filter::populate() { // add main filter - UINT32 arrow_flags = get_arrow_flags(UI_SW_ALL, UI_SW_UNAVAILABLE, sw_custfltr::main); + uint32_t arrow_flags = get_arrow_flags(UI_SW_ALL, UI_SW_UNAVAILABLE, sw_custfltr::main); item_append(_("Main filter"), sw_filters::text[sw_custfltr::main], arrow_flags, (void *)(uintptr_t)MAIN_FILTER); // add other filters @@ -451,7 +451,7 @@ void menu_swcustom_filter::populate() item_append(menu_item_type::SEPARATOR); // add filter items - arrow_flags = get_arrow_flags(UI_SW_UNAVAILABLE + 1, UI_SW_LAST - 1, sw_custfltr::other[x]); + arrow_flags = get_arrow_flags(UI_SW_UNAVAILABLE + 1, UI_SW_LAST - 1, sw_custfltr::other[x]); item_append(_("Other filter"), sw_filters::text[sw_custfltr::other[x]], arrow_flags, (void *)(uintptr_t)(OTHER_FILTER + x)); if (m_added) @@ -460,7 +460,7 @@ void menu_swcustom_filter::populate() // add publisher subitem if (sw_custfltr::other[x] == UI_SW_PUBLISHERS && m_filter.publisher.ui.size() > 0) { - arrow_flags = get_arrow_flags(0, m_filter.publisher.ui.size() - 1, sw_custfltr::mnfct[x]); + arrow_flags = get_arrow_flags(0, m_filter.publisher.ui.size() - 1, sw_custfltr::mnfct[x]); std::string fbuff(_("^!Publisher")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.publisher.ui[sw_custfltr::mnfct[x]], arrow_flags, (void *)(uintptr_t)(MNFCT_FILTER + x)); @@ -469,7 +469,7 @@ void menu_swcustom_filter::populate() // add year subitem else if (sw_custfltr::other[x] == UI_SW_YEARS && m_filter.year.ui.size() > 0) { - arrow_flags = get_arrow_flags(0, m_filter.year.ui.size() - 1, sw_custfltr::year[x]); + arrow_flags = get_arrow_flags(0, m_filter.year.ui.size() - 1, sw_custfltr::year[x]); std::string fbuff(_("^!Year")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.year.ui[sw_custfltr::year[x]], arrow_flags, (void *)(uintptr_t)(YEAR_FILTER + x)); @@ -478,7 +478,7 @@ void menu_swcustom_filter::populate() // add year subitem else if (sw_custfltr::other[x] == UI_SW_LIST && m_filter.swlist.name.size() > 0) { - arrow_flags = get_arrow_flags(0, m_filter.swlist.name.size() - 1, sw_custfltr::list[x]); + arrow_flags = get_arrow_flags(0, m_filter.swlist.name.size() - 1, sw_custfltr::list[x]); std::string fbuff(_("^!Software List")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.swlist.description[sw_custfltr::list[x]], arrow_flags, (void *)(uintptr_t)(LIST_FILTER + x)); @@ -487,7 +487,7 @@ void menu_swcustom_filter::populate() // add device type subitem else if (sw_custfltr::other[x] == UI_SW_TYPE && m_filter.type.ui.size() > 0) { - arrow_flags = get_arrow_flags(0, m_filter.type.ui.size() - 1, sw_custfltr::type[x]); + arrow_flags = get_arrow_flags(0, m_filter.type.ui.size() - 1, sw_custfltr::type[x]); std::string fbuff(_("^!Device type")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.type.ui[sw_custfltr::type[x]], arrow_flags, (void *)(uintptr_t)(TYPE_FILTER + x)); @@ -496,7 +496,7 @@ void menu_swcustom_filter::populate() // add region subitem else if (sw_custfltr::other[x] == UI_SW_REGION && m_filter.region.ui.size() > 0) { - arrow_flags = get_arrow_flags(0, m_filter.region.ui.size() - 1, sw_custfltr::region[x]); + arrow_flags = get_arrow_flags(0, m_filter.region.ui.size() - 1, sw_custfltr::region[x]); std::string fbuff(_("^!Region")); convert_command_glyph(fbuff); item_append(fbuff, m_filter.region.ui[sw_custfltr::region[x]], arrow_flags, (void *)(uintptr_t)(REGION_FILTER + x)); diff --git a/src/frontend/mame/ui/custmenu.h b/src/frontend/mame/ui/custmenu.h index 5d3084f9121..8fef83c0cac 100644 --- a/src/frontend/mame/ui/custmenu.h +++ b/src/frontend/mame/ui/custmenu.h @@ -22,7 +22,7 @@ namespace ui { struct c_sw_region { std::vector ui; - UINT16 actual; + uint16_t actual; void set(std::string &str); std::string getname(std::string &str); }; @@ -31,7 +31,7 @@ struct c_sw_region struct c_sw_publisher { std::vector ui; - UINT16 actual; + uint16_t actual; void set(std::string &str); std::string getname(std::string &str); }; @@ -40,7 +40,7 @@ struct c_sw_publisher struct c_sw_type { std::vector ui; - UINT16 actual; + uint16_t actual; void set(std::string &str); }; @@ -49,14 +49,14 @@ struct c_sw_list { std::vector name; std::vector description; - UINT16 actual; + uint16_t actual; }; // Software years struct c_sw_year { std::vector ui; - UINT16 actual; + uint16_t actual; void set(std::string &str); }; diff --git a/src/frontend/mame/ui/custui.cpp b/src/frontend/mame/ui/custui.cpp index f71c9525019..81d16c22741 100644 --- a/src/frontend/mame/ui/custui.cpp +++ b/src/frontend/mame/ui/custui.cpp @@ -139,7 +139,7 @@ void menu_custom_ui::handle() void menu_custom_ui::populate() { - UINT32 arrow_flags; + uint32_t arrow_flags; item_append(_("Fonts"), "", 0, (void *)(uintptr_t)FONT_MENU); item_append(_("Colors"), "", 0, (void *)(uintptr_t)COLORS_MENU); @@ -149,7 +149,7 @@ void menu_custom_ui::populate() item_append(_("Language"), m_lang[m_currlang].c_str(), arrow_flags, (void *)(uintptr_t)LANGUAGE_MENU); } - arrow_flags = get_arrow_flags(0, HIDE_BOTH, ui_globals::panels_status); + arrow_flags = get_arrow_flags(0, HIDE_BOTH, ui_globals::panels_status); item_append(_("Show side panels"), _(HIDE_STATUS[ui_globals::panels_status]), arrow_flags, (void *)(uintptr_t)HIDE_MENU); item_append(menu_item_type::SEPARATOR); @@ -341,7 +341,7 @@ void menu_font_ui::handle() void menu_font_ui::populate() { // set filter arrow - UINT32 arrow_flags; + uint32_t arrow_flags; // add fonts option arrow_flags = get_arrow_flags(0, m_fonts.size() - 1, m_actual); @@ -466,7 +466,7 @@ menu_colors_ui::~menu_colors_ui() std::string error_string, dec_color; for (int index = 1; index < MUI_RESTORE; index++) { - dec_color = string_format("%x", (UINT32)m_color_table[index].color); + dec_color = string_format("%x", (uint32_t)m_color_table[index].color); ui().options().set_value(m_color_table[index].option, dec_color.c_str(), OPTION_PRIORITY_CMDLINE, error_string); } } @@ -681,7 +681,7 @@ void menu_colors_ui::restore_colors() { ui_options options; for (int index = 1; index < MUI_RESTORE; index++) - m_color_table[index].color = rgb_t((UINT32)strtoul(options.value(m_color_table[index].option), nullptr, 16)); + m_color_table[index].color = rgb_t((uint32_t)strtoul(options.value(m_color_table[index].option), nullptr, 16)); } //------------------------------------------------- @@ -827,13 +827,13 @@ void menu_rgb_ui::handle() void menu_rgb_ui::populate() { // set filter arrow - UINT32 arrow_flags = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; + uint32_t arrow_flags = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; std::string s_text = std::string(m_search).append("_"); item_append(_("ARGB Settings"), "", FLAG_DISABLE | FLAG_UI_HEADING, nullptr); if (m_lock_ref != RGB_ALPHA) { - arrow_flags = get_arrow_flags(0, 255, m_color->a()); + arrow_flags = get_arrow_flags(0, 255, m_color->a()); item_append(_("Alpha"), string_format("%3u", m_color->a()), arrow_flags, (void *)(uintptr_t)RGB_ALPHA); } else @@ -841,7 +841,7 @@ void menu_rgb_ui::populate() if (m_lock_ref != RGB_RED) { - arrow_flags = get_arrow_flags(0, 255, m_color->r()); + arrow_flags = get_arrow_flags(0, 255, m_color->r()); item_append(_("Red"), string_format("%3u", m_color->r()), arrow_flags, (void *)(uintptr_t)RGB_RED); } else @@ -849,7 +849,7 @@ void menu_rgb_ui::populate() if (m_lock_ref != RGB_GREEN) { - arrow_flags = get_arrow_flags(0, 255, m_color->g()); + arrow_flags = get_arrow_flags(0, 255, m_color->g()); item_append(_("Green"), string_format("%3u", m_color->g()), arrow_flags, (void *)(uintptr_t)RGB_GREEN); } else @@ -857,7 +857,7 @@ void menu_rgb_ui::populate() if (m_lock_ref != RGB_BLUE) { - arrow_flags = get_arrow_flags(0, 255, m_color->b()); + arrow_flags = get_arrow_flags(0, 255, m_color->b()); item_append(_("Blue"), string_format("%3u", m_color->b()), arrow_flags, (void *)(uintptr_t)RGB_BLUE); } else @@ -1024,7 +1024,7 @@ void menu_palette_sel::handle() { if (menu_event->iptkey == IPT_UI_SELECT) { - m_original = rgb_t((UINT32)strtoul(item[selected].subtext.c_str(), nullptr, 16)); + m_original = rgb_t((uint32_t)strtoul(item[selected].subtext.c_str(), nullptr, 16)); reset_parent(reset_options::SELECT_FIRST); stack_pop(); } @@ -1055,7 +1055,7 @@ void menu_palette_sel::custom_render(void *selectedref, float top, float bottom, // draw - draw palette menu //------------------------------------------------- -void menu_palette_sel::draw(UINT32 flags) +void menu_palette_sel::draw(uint32_t flags) { auto line_height = ui().get_line_height(); auto lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect(); @@ -1216,7 +1216,7 @@ void menu_palette_sel::draw(UINT32 flags) else { const char *subitem_text = pitem.subtext.c_str(); - rgb_t color = rgb_t((UINT32)strtoul(subitem_text, nullptr, 16)); + rgb_t color = rgb_t((uint32_t)strtoul(subitem_text, nullptr, 16)); // draw the left-side text ui().draw_text_full(container(), itemtext, effective_left, line_y, effective_width, diff --git a/src/frontend/mame/ui/custui.h b/src/frontend/mame/ui/custui.h index 864d980186b..ed4ebc12585 100644 --- a/src/frontend/mame/ui/custui.h +++ b/src/frontend/mame/ui/custui.h @@ -183,7 +183,7 @@ protected: private: // draw palette menu - virtual void draw(UINT32 flags) override; + virtual void draw(uint32_t flags) override; virtual void populate() override; virtual void handle() override; diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp index c2126d50d15..b4982064cdd 100644 --- a/src/frontend/mame/ui/datmenu.cpp +++ b/src/frontend/mame/ui/datmenu.cpp @@ -148,7 +148,7 @@ void menu_dats_view::populate() // draw - draw dats menu //------------------------------------------------- -void menu_dats_view::draw(UINT32 flags) +void menu_dats_view::draw(uint32_t flags) { auto line_height = ui().get_line_height(); auto ud_arrow_width = line_height * machine().render().ui_aspect(); diff --git a/src/frontend/mame/ui/datmenu.h b/src/frontend/mame/ui/datmenu.h index 9c76cc7141f..ed16d276d3d 100644 --- a/src/frontend/mame/ui/datmenu.h +++ b/src/frontend/mame/ui/datmenu.h @@ -39,7 +39,7 @@ protected: private: // draw dats menu - virtual void draw(UINT32 flags) override; + virtual void draw(uint32_t flags) override; virtual void populate() override; virtual void handle() override; diff --git a/src/frontend/mame/ui/defimg.ipp b/src/frontend/mame/ui/defimg.ipp index 0d348a1ebc9..396c2ec4fd6 100644 --- a/src/frontend/mame/ui/defimg.ipp +++ b/src/frontend/mame/ui/defimg.ipp @@ -8,7 +8,7 @@ namespace ui { namespace { // TODO: move this to an external image file and zlib compress it into a souce file as part of the build process -UINT32 const no_avail_bmp[] = { +uint32_t const no_avail_bmp[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x01231f20, 0x04231f20, 0x11231f20, 0x2e231f20, 0x62231f20, 0x8e231f20, 0xb4231f20, 0xd4231f20, 0xe5231f20, 0xf2231f20, 0xfd231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfd231f20, 0xf2231f20, 0xe5231f20, 0xd4231f20, 0xb4231f20, 0x8e231f20, 0x62231f20, 0x2e231f20, 0x11231f20, 0x04231f20, 0x01231f20, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00231f20, 0x00000000, 0x00000000, 0x06231f20, 0x1c231f20, 0x49231f20, 0x8c231f20, 0xc4231f20, 0xf0231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf0231f20, 0xc4231f20, 0x8c231f20, 0x49231f20, 0x1c231f20, 0x06231f20, 0x00000000, 0x00000000, 0x00231f20, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x04231f20, 0x32231f20, 0x7b231f20, 0xc2231f20, 0xf3231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf3231f20, 0xc2231f20, 0x7b231f20, 0x32231f20, 0x04231f20, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, diff --git a/src/frontend/mame/ui/devctrl.h b/src/frontend/mame/ui/devctrl.h index 332d020144e..e0b757cccca 100644 --- a/src/frontend/mame/ui/devctrl.h +++ b/src/frontend/mame/ui/devctrl.h @@ -40,7 +40,7 @@ protected: void previous(); void next(); std::string current_display_name(); - UINT32 current_display_flags(); + uint32_t current_display_flags(); private: // device iterator @@ -139,9 +139,9 @@ std::string menu_device_control::current_display_name() //------------------------------------------------- template -UINT32 menu_device_control::current_display_flags() +uint32_t menu_device_control::current_display_flags() { - UINT32 flags = 0; + uint32_t flags = 0; if (count() > 1) { if (current_index() > 0) diff --git a/src/frontend/mame/ui/icorender.h b/src/frontend/mame/ui/icorender.h index 677ebf001c7..864969b616d 100644 --- a/src/frontend/mame/ui/icorender.h +++ b/src/frontend/mame/ui/icorender.h @@ -19,45 +19,45 @@ // in an ICO file. typedef struct { - UINT8 bWidth; // Width of the image - UINT8 bHeight; // Height of the image (times 2) - UINT8 bColorCount; // Number of colors in image (0 if >=8bpp) - UINT8 bReserved; // Reserved - UINT16 wPlanes; // Color Planes - UINT16 wBitCount; // Bits per pixel - UINT32 dwBytesInRes; // how many bytes in this resource? - UINT32 dwImageOffset; // where in the file is this image + uint8_t bWidth; // Width of the image + uint8_t bHeight; // Height of the image (times 2) + uint8_t bColorCount; // Number of colors in image (0 if >=8bpp) + uint8_t bReserved; // Reserved + uint16_t wPlanes; // Color Planes + uint16_t wBitCount; // Bits per pixel + uint32_t dwBytesInRes; // how many bytes in this resource? + uint32_t dwImageOffset; // where in the file is this image } ICONDIRENTRY, *LPICONDIRENTRY; typedef struct { - UINT16 idReserved; // Reserved - UINT16 idType; // resource type (1 for icons) - UINT16 idCount; // how many images? + uint16_t idReserved; // Reserved + uint16_t idType; // resource type (1 for icons) + uint16_t idCount; // how many images? //ICONDIRENTRY idEntries[1]; // the entries for each image } ICONDIR, *LPICONDIR; // size - 40 bytes typedef struct { - UINT32 biSize; - UINT32 biWidth; - UINT32 biHeight; // Icon Height (added height of XOR-Bitmap and AND-Bitmap) - UINT16 biPlanes; - UINT16 biBitCount; - UINT32 biCompression; - INT32 biSizeImage; - UINT32 biXPelsPerMeter; - UINT32 biYPelsPerMeter; - UINT32 biClrUsed; - UINT32 biClrImportant; + uint32_t biSize; + uint32_t biWidth; + uint32_t biHeight; // Icon Height (added height of XOR-Bitmap and AND-Bitmap) + uint16_t biPlanes; + uint16_t biBitCount; + uint32_t biCompression; + int32_t biSizeImage; + uint32_t biXPelsPerMeter; + uint32_t biYPelsPerMeter; + uint32_t biClrUsed; + uint32_t biClrImportant; } s_BITMAPINFOHEADER, *s_PBITMAPINFOHEADER; // 46 bytes typedef struct{ s_BITMAPINFOHEADER icHeader; // DIB header - UINT32 icColors[1]; // Color table (short 4 bytes) //RGBQUAD - UINT8 icXOR[1]; // DIB bits for XOR mask - UINT8 icAND[1]; // DIB bits for AND mask + uint32_t icColors[1]; // Color table (short 4 bytes) //RGBQUAD + uint8_t icXOR[1]; // DIB bits for XOR mask + uint8_t icAND[1]; // DIB bits for AND mask } ICONIMAGE, *LPICONIMAGE; //------------------------------------------------- @@ -66,8 +66,8 @@ typedef struct{ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *dirname, const char *filename) { - INT32 width = 0; - INT32 height = 0; + int32_t width = 0; + int32_t height = 0; // deallocate previous bitmap bitmap.reset(); @@ -86,8 +86,8 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d return; // allocates a buffer for the image - UINT64 size = file.size(); - UINT8 *buffer = global_alloc_array(UINT8, size + 1); + uint64_t size = file.size(); + uint8_t *buffer = global_alloc_array(uint8_t, size + 1); // read data from the file and set them in the buffer file.read(buffer, size); @@ -102,7 +102,7 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d return; } - UINT8* cursor = buffer; + uint8_t* cursor = buffer; cursor += 6; ICONDIRENTRY* dirEntry = (ICONDIRENTRY*)(cursor); int maxSize = 0; @@ -153,7 +153,7 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d else if (realBitsCount == 8) // 256 colors { // 256 color table - UINT8 *colors = cursor; + uint8_t *colors = cursor; cursor += 256 * 4; for (int x = 0; x < width; ++x) for (int y = 0; y < height; ++y) @@ -166,13 +166,13 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d else if (realBitsCount == 4) // 16 colors { // 16 color table - UINT8 *colors = cursor; + uint8_t *colors = cursor; cursor += 16 * 4; for (int x = 0; x < width; ++x) for (int y = 0; y < height; ++y) { int shift2 = (x + (height - y - 1) * width); - UINT8 index = cursor[shift2 / 2]; + uint8_t index = cursor[shift2 / 2]; if (shift2 % 2 == 0) index = (index >> 4) & 0xF; else @@ -184,7 +184,7 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d else if (realBitsCount == 1) // 2 colors { // 2 color table - UINT8 *colors = cursor; + uint8_t *colors = cursor; cursor += 2 * 4; int boundary = width; // !!! 32 bit boundary (http://www.daubnet.com/en/file-format-ico) while (boundary % 32 != 0) boundary++; @@ -193,10 +193,10 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d for (int y = 0; y < height; ++y) { int shift2 = (x + (height - y - 1) * boundary); - UINT8 index = cursor[shift2 / 8]; + uint8_t index = cursor[shift2 / 8]; // select 1 bit only - UINT8 bit = 7 - (x % 8); + uint8_t bit = 7 - (x % 8); index = (index >> bit) & 0x01; index *= 4; bitmap.pix32(y, x) = rgb_t(255, colors[index + 2], colors[index + 1], colors[index]); @@ -216,11 +216,11 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d for (int y = 0; y < height; ++y) for (int x = 0; x < width; ++x) { - UINT8 bit = 7 - (x % 8); + uint8_t bit = 7 - (x % 8); int shift2 = (x + (height - y - 1) * boundary) / 8; - int mask = (0x01 & ((UINT8)cursor[shift2] >> bit)); + int mask = (0x01 & ((uint8_t)cursor[shift2] >> bit)); rgb_t colors = bitmap.pix32(y, x); - UINT8 alpha = colors.a(); + uint8_t alpha = colors.a(); alpha *= 1 - mask; colors.set_a(alpha); bitmap.pix32(y, x) = colors; diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp index 8d5d468332b..bee0430d063 100644 --- a/src/frontend/mame/ui/info.cpp +++ b/src/frontend/mame/ui/info.cpp @@ -62,7 +62,7 @@ machine_info::machine_info(running_machine &machine) std::string machine_info::warnings_string() { - constexpr UINT32 warning_flags = ( MACHINE_FATAL_FLAGS | MACHINE_WARNING_FLAGS | MACHINE_BTANB_FLAGS ); + constexpr uint32_t warning_flags = ( MACHINE_FATAL_FLAGS | MACHINE_WARNING_FLAGS | MACHINE_BTANB_FLAGS ); // if no warnings, nothing to return if (m_machine.rom_load().warnings() == 0 && m_machine.rom_load().knownbad() == 0 && !(m_machine.system().flags & warning_flags) && m_machine.rom_load().software_load_warnings_message().length() == 0) diff --git a/src/frontend/mame/ui/inifile.cpp b/src/frontend/mame/ui/inifile.cpp index b76adb689b6..6889bebf1d4 100644 --- a/src/frontend/mame/ui/inifile.cpp +++ b/src/frontend/mame/ui/inifile.cpp @@ -17,8 +17,8 @@ //------------------------------------------------- // GLOBAL VARIABLES //------------------------------------------------- -UINT16 inifile_manager::c_cat = 0; -UINT16 inifile_manager::c_file = 0; +uint16_t inifile_manager::c_cat = 0; +uint16_t inifile_manager::c_file = 0; //------------------------------------------------- // ctor diff --git a/src/frontend/mame/ui/inifile.h b/src/frontend/mame/ui/inifile.h index f0ed83adbd2..0ac927f3094 100644 --- a/src/frontend/mame/ui/inifile.h +++ b/src/frontend/mame/ui/inifile.h @@ -35,8 +35,8 @@ public: std::string get_category() { return ini_index[c_file].second[c_cat].first; } size_t total() { return ini_index.size(); } size_t cat_total() { return ini_index[c_file].second.size(); } - UINT16 &cur_file() { return c_file; } - UINT16 &cur_cat() { return c_cat; } + uint16_t &cur_file() { return c_file; } + uint16_t &cur_cat() { return c_cat; } // load games from category void load_ini_category(std::vector &temp_filter); @@ -53,7 +53,7 @@ private: using categoryindex = std::vector>; // files indices - static UINT16 c_file, c_cat; + static uint16_t c_file, c_cat; std::vector> ini_index; // init category index diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp index a45438f38ba..c4071f503be 100644 --- a/src/frontend/mame/ui/inputmap.cpp +++ b/src/frontend/mame/ui/inputmap.cpp @@ -174,7 +174,7 @@ void menu_input_specific::populate() if (field.enabled() && (type_class == INPUT_CLASS_CONTROLLER || type_class == INPUT_CLASS_MISC || type_class == INPUT_CLASS_KEYBOARD)) { input_seq_type seqtype; - UINT32 sortorder; + uint32_t sortorder; /* determine the sorting order */ if (type_class == INPUT_CLASS_CONTROLLER) @@ -405,7 +405,7 @@ void menu_input::populate_and_sort(input_item_data *itemlist) /* build the menu */ for (curitem = 0; curitem < numitems; curitem++) { - UINT32 flags = 0; + uint32_t flags = 0; /* generate the name of the item itself, based off the base name and the type */ item = itemarray[curitem]; @@ -533,7 +533,7 @@ void menu_settings::handle() switches menus -------------------------------------------------*/ -menu_settings::menu_settings(mame_ui_manager &mui, render_container &container, UINT32 _type) : menu(mui, container), diplist(nullptr), dipcount(0) +menu_settings::menu_settings(mame_ui_manager &mui, render_container &container, uint32_t _type) : menu(mui, container), diplist(nullptr), dipcount(0) { type = _type; } @@ -554,7 +554,7 @@ void menu_settings::populate() for (ioport_field &field : port.second->fields()) if (field.type() == type && field.enabled()) { - UINT32 flags = 0; + uint32_t flags = 0; /* set the left/right flags appropriately */ if (field.has_previous_setting()) @@ -580,7 +580,7 @@ void menu_settings::populate() if (type == IPT_DIPSWITCH && !field.diplocations().empty()) { ioport_field::user_settings settings; - UINT32 accummask = field.mask(); + uint32_t accummask = field.mask(); /* get current settings */ field.get_user_settings(settings); @@ -588,7 +588,7 @@ void menu_settings::populate() /* iterate over each bit in the field */ for (const ioport_diplocation &diploc : field.diplocations()) { - UINT32 mask = accummask & ~(accummask - 1); + uint32_t mask = accummask & ~(accummask - 1); dip_descriptor *dip; /* find the matching switch name */ @@ -651,7 +651,7 @@ void menu_settings_dip_switches::custom_render(void *selectedref, float top, flo // iterate over DIP switches for (dip_descriptor *dip = diplist; dip != nullptr; dip = dip->next) { - UINT32 selectedmask = 0; + uint32_t selectedmask = 0; // determine the mask of selected bits if ((uintptr_t)selectedref != 1) @@ -676,7 +676,7 @@ void menu_settings_dip_switches::custom_render(void *selectedref, float top, flo DIP switch -------------------------------------------------*/ -void menu_settings_dip_switches::custom_render_one(float x1, float y1, float x2, float y2, const dip_descriptor *dip, UINT32 selectedmask) +void menu_settings_dip_switches::custom_render_one(float x1, float y1, float x2, float y2, const dip_descriptor *dip, uint32_t selectedmask) { float switch_field_width = SINGLE_TOGGLE_SWITCH_FIELD_WIDTH * container().manager().ui_aspect(); float switch_width = SINGLE_TOGGLE_SWITCH_WIDTH * container().manager().ui_aspect(); @@ -857,7 +857,7 @@ void menu_analog::populate() if (type != ANALOG_ITEM_CENTERSPEED || use_autocenter) { analog_item_data *data; - UINT32 flags = 0; + uint32_t flags = 0; std::string text; std::string subtext; if (strcmp(field.device().tag(), prev_owner.c_str()) != 0) diff --git a/src/frontend/mame/ui/inputmap.h b/src/frontend/mame/ui/inputmap.h index 9acee915025..b6934a1d4d6 100644 --- a/src/frontend/mame/ui/inputmap.h +++ b/src/frontend/mame/ui/inputmap.h @@ -53,8 +53,8 @@ protected: const input_seq * defseq; /* pointer to the default sequence */ const char * name; /* pointer to the base name of the item */ const char * owner_name; /* pointer to the name of the owner of the item */ - UINT32 sortorder; /* sorting information */ - UINT8 type; /* type of port */ + uint32_t sortorder; /* sorting information */ + uint8_t type; /* type of port */ bool is_optional; /* true if this input is considered optional */ }; @@ -66,7 +66,7 @@ protected: input_item_data * pollingitem; private: - UINT16 last_sortorder; + uint16_t last_sortorder; bool record_next; input_seq starting_seq; @@ -103,7 +103,7 @@ private: class menu_settings : public menu { public: - menu_settings(mame_ui_manager &mui, render_container &container, UINT32 type); + menu_settings(mame_ui_manager &mui, render_container &container, uint32_t type); virtual ~menu_settings() override; protected: @@ -112,8 +112,8 @@ protected: { dip_descriptor * next; const char * name; - UINT32 mask; - UINT32 state; + uint32_t mask; + uint32_t state; }; dip_descriptor * diplist; @@ -135,7 +135,7 @@ protected: virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; private: - void custom_render_one(float x1, float y1, float x2, float y2, const dip_descriptor *dip, UINT32 selectedmask); + void custom_render_one(float x1, float y1, float x2, float y2, const dip_descriptor *dip, uint32_t selectedmask); }; class menu_settings_driver_config : public menu_settings diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index 32039886450..7f0f0df8d50 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -277,7 +277,7 @@ void menu::reset(reset_options options) // reset all the pools and the item.size() back to 0 for (pool *ppool = m_pool; ppool != nullptr; ppool = ppool->next) - ppool->top = (UINT8 *)(ppool + 1); + ppool->top = (uint8_t *)(ppool + 1); item.clear(); m_visible_items = 0; selected = 0; @@ -342,7 +342,7 @@ void menu::item_append(menu_item item) // end of the menu //------------------------------------------------- -void menu::item_append(menu_item_type type, UINT32 flags) +void menu::item_append(menu_item_type type, uint32_t flags) { if (type == menu_item_type::SEPARATOR) item_append(MENU_SEPARATOR_ITEM, "", flags, nullptr, menu_item_type::SEPARATOR); @@ -353,7 +353,7 @@ void menu::item_append(menu_item_type type, UINT32 flags) // end of the menu //------------------------------------------------- -void menu::item_append(const std::string &text, const std::string &subtext, UINT32 flags, void *ref, menu_item_type type) +void menu::item_append(const std::string &text, const std::string &subtext, uint32_t flags, void *ref, menu_item_type type) { item_append(std::string(text), std::string(subtext), flags, ref, type); } @@ -363,7 +363,7 @@ void menu::item_append(const std::string &text, const std::string &subtext, UINT // end of the menu //------------------------------------------------- -void menu::item_append(std::string &&text, std::string &&subtext, UINT32 flags, void *ref, menu_item_type type) +void menu::item_append(std::string &&text, std::string &&subtext, uint32_t flags, void *ref, menu_item_type type) { // only allow multiline as the first item if ((flags & FLAG_MULTILINE) != 0) @@ -404,7 +404,7 @@ void menu::item_append(std::string &&text, std::string &&subtext, UINT32 flags, // and returning any interesting events //------------------------------------------------- -const menu::event *menu::process(UINT32 flags, float x0, float y0) +const menu::event *menu::process(uint32_t flags, float x0, float y0) { // reset the event m_event.iptkey = IPT_INVALID; @@ -461,12 +461,12 @@ void *menu::m_pool_alloc(size_t size) } // allocate a new pool - pool *ppool = (pool *)global_alloc_array_clear(sizeof(*ppool) + UI_MENU_POOL_SIZE); + pool *ppool = (pool *)global_alloc_array_clear(sizeof(*ppool) + UI_MENU_POOL_SIZE); // wire it up ppool->next = m_pool; m_pool = ppool; - ppool->top = (UINT8 *)(ppool + 1); + ppool->top = (uint8_t *)(ppool + 1); ppool->end = ppool->top + UI_MENU_POOL_SIZE; return m_pool_alloc(size); } @@ -500,7 +500,7 @@ void menu::set_selection(void *selected_itemref) // draw - draw a menu //------------------------------------------------- -void menu::draw(UINT32 flags) +void menu::draw(uint32_t flags) { // first draw the FPS counter if (ui().show_fps_counter()) @@ -593,7 +593,7 @@ void menu::draw(UINT32 flags) mouse_button = false; if (!customonly && !noinput) { - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; render_target *mouse_target = machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); if (mouse_target != nullptr) if (mouse_target->map_point_container(mouse_target_x, mouse_target_y, container(), mouse_x, mouse_y)) @@ -853,7 +853,7 @@ void menu::draw_text_box() // input events for a menu //------------------------------------------------- -void menu::handle_events(UINT32 flags, event &ev) +void menu::handle_events(uint32_t flags, event &ev) { bool stop = false; ui_event local_menu_event; @@ -967,7 +967,7 @@ void menu::handle_events(UINT32 flags, event &ev) // keys for a menu //------------------------------------------------- -void menu::handle_keys(UINT32 flags, int &iptkey) +void menu::handle_keys(uint32_t flags, int &iptkey) { bool ignorepause = stack_has_special_main_menu(); int code; @@ -1149,7 +1149,7 @@ void menu::do_handle() // and calls the menu handler //------------------------------------------------- -UINT32 menu::ui_handler(render_container &container, mame_ui_manager &mui) +uint32_t menu::ui_handler(render_container &container, mame_ui_manager &mui) { global_state_ptr const state(get_global_state(mui.machine())); @@ -1189,7 +1189,7 @@ void menu::highlight(float x0, float y0, float x1, float y1, rgb_t bgcolor) // draw_arrow //------------------------------------------------- -void menu::draw_arrow(float x0, float y0, float x1, float y1, rgb_t fgcolor, UINT32 orientation) +void menu::draw_arrow(float x0, float y0, float x1, float y1, rgb_t fgcolor, uint32_t orientation) { container().add_quad(x0, y0, x1, y1, fgcolor, m_global_state->arrow_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXORIENT(orientation) | PRIMFLAG_PACKABLE); } diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h index cee07c6da88..554a70fddd2 100644 --- a/src/frontend/mame/ui/menu.h +++ b/src/frontend/mame/ui/menu.h @@ -56,10 +56,10 @@ public: std::vector item; // array of items // append a new item to the end of the menu - void item_append(const std::string &text, const std::string &subtext, UINT32 flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); - void item_append(std::string &&text, std::string &&subtext, UINT32 flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); + void item_append(const std::string &text, const std::string &subtext, uint32_t flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); + void item_append(std::string &&text, std::string &&subtext, uint32_t flags, void *ref, menu_item_type type = menu_item_type::UNKNOWN); void item_append(menu_item item); - void item_append(menu_item_type type, UINT32 flags = 0); + void item_append(menu_item_type type, uint32_t flags = 0); // Global initialization static void init(running_machine &machine, ui_options &mopt); @@ -88,7 +88,7 @@ public: static bool stack_has_special_main_menu(running_machine &machine) { return get_global_state(machine)->stack_has_special_main_menu(); } // master handler - static UINT32 ui_handler(render_container &container, mame_ui_manager &mui); + static uint32_t ui_handler(render_container &container, mame_ui_manager &mui); // Used by sliders void validate_selection(int scandir); @@ -96,14 +96,14 @@ public: void do_handle(); private: - virtual void draw(UINT32 flags); + virtual void draw(uint32_t flags); void draw_text_box(); public: // mouse handling bool mouse_hit, mouse_button; render_target *mouse_target; - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; float mouse_x, mouse_y; protected: @@ -171,7 +171,7 @@ protected: void add_cleanup_callback(cleanup_callback &&callback) { m_global_state->add_cleanup_callback(std::move(callback)); } // process a menu, drawing it and returning any interesting events - const event *process(UINT32 flags, float x0 = 0.0f, float y0 = 0.0f); + const event *process(uint32_t flags, float x0 = 0.0f, float y0 = 0.0f); void process_parent() { m_parent->process(PROCESS_NOINPUT); } // retrieves the ref of the currently selected menu item or nullptr @@ -194,7 +194,7 @@ protected: render_texture *hilight_main_texture() { return m_global_state->hilight_main_texture(); } // draw arrow - void draw_arrow(float x0, float y0, float x1, float y1, rgb_t fgcolor, UINT32 orientation); + void draw_arrow(float x0, float y0, float x1, float y1, rgb_t fgcolor, uint32_t orientation); // draw header and footer text void extra_text_render(float top, float bottom, float origx1, float origy1, float origx2, float origy2, const char *header, const char *footer); @@ -207,8 +207,8 @@ protected: virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2); // overridable event handling - virtual void handle_events(UINT32 flags, event &ev); - virtual void handle_keys(UINT32 flags, int &iptkey); + virtual void handle_events(uint32_t flags, event &ev); + virtual void handle_keys(uint32_t flags, int &iptkey); virtual bool custom_mouse_down() { return false; } // test if search is active @@ -221,7 +221,7 @@ protected: // get arrows status template - UINT32 get_arrow_flags(T min, T max, T actual) + uint32_t get_arrow_flags(T min, T max, T actual) { return ((actual > min) ? FLAG_LEFT_ARROW : 0) | ((actual < max) ? FLAG_RIGHT_ARROW : 0); } @@ -271,8 +271,8 @@ private: struct pool { pool *next; // chain to next one - UINT8 *top; // top of the pool - UINT8 *end; // end of the pool + uint8_t *top; // top of the pool + uint8_t *end; // end of the pool }; // request the specific handling of the game selection main menu diff --git a/src/frontend/mame/ui/menuitem.h b/src/frontend/mame/ui/menuitem.h index dbf294a89ae..b906b6e9a5a 100644 --- a/src/frontend/mame/ui/menuitem.h +++ b/src/frontend/mame/ui/menuitem.h @@ -39,7 +39,7 @@ public: std::string text; std::string subtext; - UINT32 flags; + uint32_t flags; void *ref; menu_item_type type; // item type (eventually will go away when itemref is proper ui_menu_item class rather than void*) }; diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp index e33502ea606..097586d5b92 100644 --- a/src/frontend/mame/ui/miscmenu.cpp +++ b/src/frontend/mame/ui/miscmenu.cpp @@ -380,8 +380,8 @@ void menu_crosshair::populate() crosshair_item_data *data; char temp_text[16]; int player; - UINT8 use_auto = false; - UINT32 flags = 0; + uint8_t use_auto = false; + uint32_t flags = 0; /* loop over player and add the manual items */ for (player = 0; player < MAX_PLAYERS; player++) @@ -775,7 +775,7 @@ void menu_machine_configure::populate() item_append(_("Bios"), "", FLAG_DISABLE | FLAG_UI_HEADING, nullptr); if (!m_bios.empty()) { - UINT32 arrows = get_arrow_flags(std::size_t(0), m_bios.size() - 1, m_curbios); + uint32_t arrows = get_arrow_flags(std::size_t(0), m_bios.size() - 1, m_curbios); item_append(_("Driver"), m_bios[m_curbios].first, arrows, (void *)(uintptr_t)BIOS); } else diff --git a/src/frontend/mame/ui/miscmenu.h b/src/frontend/mame/ui/miscmenu.h index 22d2555b204..11909f099f5 100644 --- a/src/frontend/mame/ui/miscmenu.h +++ b/src/frontend/mame/ui/miscmenu.h @@ -75,11 +75,11 @@ private: /* internal crosshair menu item data */ struct crosshair_item_data { - UINT8 type; - UINT8 player; - UINT8 min, max; - UINT8 cur; - UINT8 defvalue; + uint8_t type; + uint8_t player; + uint8_t min, max; + uint8_t cur; + uint8_t defvalue; char last_name[CROSSHAIR_PIC_NAME_LENGTH + 1]; char next_name[CROSSHAIR_PIC_NAME_LENGTH + 1]; }; diff --git a/src/frontend/mame/ui/optsmenu.cpp b/src/frontend/mame/ui/optsmenu.cpp index eab7a415ac5..cbe5a641400 100644 --- a/src/frontend/mame/ui/optsmenu.cpp +++ b/src/frontend/mame/ui/optsmenu.cpp @@ -228,7 +228,7 @@ void menu_game_options::populate() std::string fbuff; // add filter item - UINT32 arrow_flags = get_arrow_flags(FILTER_FIRST, FILTER_LAST, m_main); + uint32_t arrow_flags = get_arrow_flags(FILTER_FIRST, FILTER_LAST, m_main); item_append(_("Filter"), main_filters::text[m_main], arrow_flags, (void *)(uintptr_t)FILTER_MENU); // add category subitem @@ -236,12 +236,12 @@ void menu_game_options::populate() { inifile_manager &inif = mame_machine_manager::instance()->inifile(); - arrow_flags = get_arrow_flags(UINT16(0), UINT16(inif.total() - 1), inif.cur_file()); + arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(inif.total() - 1), inif.cur_file()); fbuff = _(" ^!File"); convert_command_glyph(fbuff); item_append(fbuff, inif.get_file(), arrow_flags, (void *)(uintptr_t)FILE_CATEGORY_FILTER); - arrow_flags = get_arrow_flags(UINT16(0), UINT16(inif.cat_total() - 1), inif.cur_cat()); + arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(inif.cat_total() - 1), inif.cur_cat()); fbuff = _(" ^!Category"); convert_command_glyph(fbuff); item_append(fbuff, inif.get_category(), arrow_flags, (void *)(uintptr_t)CATEGORY_FILTER); @@ -249,7 +249,7 @@ void menu_game_options::populate() // add manufacturer subitem else if (m_main == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0) { - arrow_flags = get_arrow_flags(UINT16(0), UINT16(c_mnfct::ui.size() - 1), c_mnfct::actual); + arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(c_mnfct::ui.size() - 1), c_mnfct::actual); fbuff = _("^!Manufacturer"); convert_command_glyph(fbuff); item_append(fbuff, c_mnfct::ui[c_mnfct::actual], arrow_flags, (void *)(uintptr_t)MANUFACT_CAT_FILTER); @@ -257,7 +257,7 @@ void menu_game_options::populate() // add year subitem else if (m_main == FILTER_YEAR && c_year::ui.size() > 0) { - arrow_flags = get_arrow_flags(UINT16(0), UINT16(c_year::ui.size() - 1), c_year::actual); + arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(c_year::ui.size() - 1), c_year::actual); fbuff.assign(_("^!Year")); convert_command_glyph(fbuff); item_append(fbuff, c_year::ui[c_year::actual], arrow_flags, (void *)(uintptr_t)YEAR_CAT_FILTER); diff --git a/src/frontend/mame/ui/optsmenu.h b/src/frontend/mame/ui/optsmenu.h index c131aa76639..96e951da6e4 100644 --- a/src/frontend/mame/ui/optsmenu.h +++ b/src/frontend/mame/ui/optsmenu.h @@ -49,7 +49,7 @@ private: virtual void populate() override; virtual void handle() override; - UINT16 m_main; + uint16_t m_main; }; } // namespace ui diff --git a/src/frontend/mame/ui/pluginopt.cpp b/src/frontend/mame/ui/pluginopt.cpp index e456562c4fc..b9167150b6f 100644 --- a/src/frontend/mame/ui/pluginopt.cpp +++ b/src/frontend/mame/ui/pluginopt.cpp @@ -96,7 +96,7 @@ void menu_plugin_opt::populate() uintptr_t i = 1; for(auto &item : menu_list) { - UINT32 flags = 0; + uint32_t flags = 0; if(item.flags == "off") flags = FLAG_DISABLE; else if(item.flags == "l") diff --git a/src/frontend/mame/ui/selector.cpp b/src/frontend/mame/ui/selector.cpp index 8f32c5530dc..d94c7085792 100644 --- a/src/frontend/mame/ui/selector.cpp +++ b/src/frontend/mame/ui/selector.cpp @@ -21,7 +21,7 @@ namespace ui { // ctor / dtor //------------------------------------------------- -menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector const &s_sel, UINT16 &s_actual, int category, int _hover) +menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector const &s_sel, uint16_t &s_actual, int category, int _hover) : menu(mui, container) , m_selector(s_actual) , m_category(category) @@ -33,7 +33,7 @@ menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, m_searchlist[0] = nullptr; } -menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector &&s_sel, UINT16 &s_actual, int category, int _hover) +menu_selector::menu_selector(mame_ui_manager &mui, render_container &container, std::vector &&s_sel, uint16_t &s_actual, int category, int _hover) : menu(mui, container) , m_selector(s_actual) , m_category(category) diff --git a/src/frontend/mame/ui/selector.h b/src/frontend/mame/ui/selector.h index 36d97755ee4..8b3d4cac8e8 100644 --- a/src/frontend/mame/ui/selector.h +++ b/src/frontend/mame/ui/selector.h @@ -31,8 +31,8 @@ public: SOFTWARE }; - menu_selector(mame_ui_manager &mui, render_container &container, std::vector const &_sel, UINT16 &_actual, int _category = 0, int _hover = 0); - menu_selector(mame_ui_manager &mui, render_container &container, std::vector &&_sel, UINT16 &_actual, int _category = 0, int _hover = 0); + menu_selector(mame_ui_manager &mui, render_container &container, std::vector const &_sel, uint16_t &_actual, int _category = 0, int _hover = 0); + menu_selector(mame_ui_manager &mui, render_container &container, std::vector &&_sel, uint16_t &_actual, int _category = 0, int _hover = 0); virtual ~menu_selector() override; protected: @@ -48,7 +48,7 @@ private: void find_matches(const char *str); std::string m_search; - UINT16 &m_selector; + uint16_t &m_selector; int m_category, m_hover; bool m_first_pass; std::vector m_str_items; diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index 9a7251d5290..f3b42810bef 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -498,7 +498,7 @@ void menu_select_game::populate() ui_globals::redraw_icon = true; ui_globals::switch_image = true; int old_item_selected = -1; - UINT32 flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; + uint32_t flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; if (!isfavorite()) { @@ -646,7 +646,7 @@ void menu_select_game::build_available_list() // build a name for it for (src = dir->name; *src != 0 && *src != '.' && dst < &drivername[ARRAY_LENGTH(drivername) - 1]; ++src) - *dst++ = tolower((UINT8) * src); + *dst++ = tolower((uint8_t) * src); *dst = 0; int drivnum = driver_list::find(drivername); @@ -700,7 +700,7 @@ void menu_select_game::build_available_list() if (hashes.flag(util::hash_collection::FLAG_NO_DUMP) || ROM_ISOPTIONAL(rom)) continue; - UINT64 lenght = ROM_GETLENGTH(rom); + uint64_t lenght = ROM_GETLENGTH(rom); auto found = false; auto parent_entries = rom_build_entries(drv->rom); for (auto parentrom = parent_entries.data(); !ROMENTRY_ISEND(parentrom) && found == false; ++parentrom) @@ -1209,7 +1209,7 @@ void menu_select_game::populate_search() } (index < VISIBLE_GAMES_IN_SEARCH) ? m_searchlist[index] = nullptr : m_searchlist[VISIBLE_GAMES_IN_SEARCH] = nullptr; - UINT32 flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; + uint32_t flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; for (int curitem = 0; m_searchlist[curitem]; ++curitem) { bool cloneof = strcmp(m_searchlist[curitem]->parent, "0"); diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index 20f80651307..34b39137504 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -92,9 +92,9 @@ menu_select_launch::cache::cache(running_machine &machine) // create a texture for snapshot m_snapx_texture = texture_ptr(render.texture_alloc(render_texture::hq_scale), texture_free); - std::memcpy(&m_no_avail_bitmap->pix32(0), no_avail_bmp, 256 * 256 * sizeof(UINT32)); + std::memcpy(&m_no_avail_bitmap->pix32(0), no_avail_bmp, 256 * 256 * sizeof(uint32_t)); - std::memcpy(&m_star_bitmap->pix32(0), favorite_star_bmp, 32 * 32 * sizeof(UINT32)); + std::memcpy(&m_star_bitmap->pix32(0), favorite_star_bmp, 32 * 32 * sizeof(uint32_t)); m_star_texture = texture_ptr(render.texture_alloc(), texture_free); m_star_texture->set_bitmap(*m_star_bitmap, m_star_bitmap->cliprect(), TEXFORMAT_ARGB32); @@ -110,7 +110,7 @@ menu_select_launch::cache::cache(running_machine &machine) m_toolbar_texture.emplace_back(texture_ptr(render.texture_alloc(), texture_free)); m_sw_toolbar_texture.emplace_back(texture_ptr(render.texture_alloc(), texture_free)); - std::memcpy(&m_toolbar_bitmap.back()->pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(UINT32)); + std::memcpy(&m_toolbar_bitmap.back()->pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t)); if (m_toolbar_bitmap.back()->valid()) m_toolbar_texture.back()->set_bitmap(*m_toolbar_bitmap.back(), m_toolbar_bitmap.back()->cliprect(), TEXFORMAT_ARGB32); else @@ -118,7 +118,7 @@ menu_select_launch::cache::cache(running_machine &machine) if ((i == 0U) || (i == 2U)) { - std::memcpy(&m_sw_toolbar_bitmap.back()->pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(UINT32)); + std::memcpy(&m_sw_toolbar_bitmap.back()->pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t)); if (m_sw_toolbar_bitmap.back()->valid()) m_sw_toolbar_texture.back()->set_bitmap(*m_sw_toolbar_bitmap.back(), m_sw_toolbar_bitmap.back()->cliprect(), TEXFORMAT_ARGB32); else @@ -519,7 +519,7 @@ void menu_select_launch::draw_common_arrow(float origx1, float origy1, float ori void menu_select_launch::draw_info_arrow(int ub, float origx1, float origx2, float oy1, float line_height, float text_size, float ud_arrow_width) { rgb_t fgcolor = UI_TEXT_COLOR; - UINT32 orientation = (!ub) ? ROT0 : ROT0 ^ ORIENTATION_FLIP_Y; + uint32_t orientation = (!ub) ? ROT0 : ROT0 ^ ORIENTATION_FLIP_Y; if (mouse_hit && origx1 <= mouse_x && origx2 > mouse_x && oy1 <= mouse_y && oy1 + (line_height * text_size) > mouse_y) { @@ -762,7 +762,7 @@ void menu_select_launch::get_title_search(std::string &snaptext, std::string &se // handle keys for main menu //------------------------------------------------- -void menu_select_launch::handle_keys(UINT32 flags, int &iptkey) +void menu_select_launch::handle_keys(uint32_t flags, int &iptkey) { bool const ignorepause = stack_has_special_main_menu(); @@ -978,7 +978,7 @@ void menu_select_launch::handle_keys(UINT32 flags, int &iptkey) // handle input events for main menu //------------------------------------------------- -void menu_select_launch::handle_events(UINT32 flags, event &ev) +void menu_select_launch::handle_events(uint32_t flags, event &ev) { auto stop = false; ui_event local_menu_event; @@ -986,7 +986,7 @@ void menu_select_launch::handle_events(UINT32 flags, event &ev) if (m_pressed) { bool pressed = mouse_pressed(); - INT32 m_target_x, m_target_y; + int32_t m_target_x, m_target_y; bool m_button; auto mouse_target = machine().ui_input().find_mouse(&m_target_x, &m_target_y, &m_button); if (mouse_target && m_button && (hover == HOVER_ARROW_DOWN || hover == HOVER_ARROW_UP)) @@ -1183,7 +1183,7 @@ void menu_select_launch::handle_events(UINT32 flags, event &ev) // draw main menu //------------------------------------------------- -void menu_select_launch::draw(UINT32 flags) +void menu_select_launch::draw(uint32_t flags) { bool noinput = (flags & PROCESS_NOINPUT); float line_height = ui().get_line_height(); diff --git a/src/frontend/mame/ui/selmenu.h b/src/frontend/mame/ui/selmenu.h index 9b1e4c41d62..7741cc8b2d5 100644 --- a/src/frontend/mame/ui/selmenu.h +++ b/src/frontend/mame/ui/selmenu.h @@ -153,13 +153,13 @@ private: void get_title_search(std::string &title, std::string &search); // handle keys - virtual void handle_keys(UINT32 flags, int &iptkey) override; + virtual void handle_keys(uint32_t flags, int &iptkey) override; // handle mouse - virtual void handle_events(UINT32 flags, event &ev) override; + virtual void handle_events(uint32_t flags, event &ev) override; // draw game list - virtual void draw(UINT32 flags) override; + virtual void draw(uint32_t flags) override; // draw right panel void draw_right_panel(float origx1, float origy1, float origx2, float origy2); diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index bafcbfda82f..421dc010467 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -419,7 +419,7 @@ void menu_select_software::handle() void menu_select_software::populate() { - UINT32 flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; + uint32_t flags_ui = FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW; m_has_empty_start = true; int old_software = -1; diff --git a/src/frontend/mame/ui/simpleselgame.cpp b/src/frontend/mame/ui/simpleselgame.cpp index f4c583eb55f..6c52d2d46bd 100644 --- a/src/frontend/mame/ui/simpleselgame.cpp +++ b/src/frontend/mame/ui/simpleselgame.cpp @@ -74,7 +74,7 @@ void simple_menu_select_game::build_driver_list() // build a name for it for (src = dir->name; *src != 0 && *src != '.' && dst < &drivername[ARRAY_LENGTH(drivername) - 1]; src++) - *dst++ = tolower((UINT8)*src); + *dst++ = tolower((uint8_t)*src); *dst = 0; int drivnum = m_drivlist->find(drivername); diff --git a/src/frontend/mame/ui/simpleselgame.h b/src/frontend/mame/ui/simpleselgame.h index 8570170d465..a368e61b40e 100644 --- a/src/frontend/mame/ui/simpleselgame.h +++ b/src/frontend/mame/ui/simpleselgame.h @@ -43,7 +43,7 @@ private: void inkey_special(const event *menu_event); // internal state - UINT8 m_error; + uint8_t m_error; bool m_rerandomize; std::string m_search; int m_matchlist[VISIBLE_GAMES_IN_LIST]; diff --git a/src/frontend/mame/ui/slider.h b/src/frontend/mame/ui/slider.h index 431fa8fcb94..8bca79c752f 100644 --- a/src/frontend/mame/ui/slider.h +++ b/src/frontend/mame/ui/slider.h @@ -21,17 +21,17 @@ #define SLIDER_NOCHANGE 0x12345678 -typedef std::function slider_update; +typedef std::function slider_update; struct slider_state { slider_state * next; /* pointer to next slider */ slider_update update; /* callback */ void * arg; /* argument */ - INT32 minval; /* minimum value */ - INT32 defval; /* default value */ - INT32 maxval; /* maximum value */ - INT32 incval; /* increment value */ + int32_t minval; /* minimum value */ + int32_t defval; /* default value */ + int32_t maxval; /* maximum value */ + int32_t incval; /* increment value */ int id; char description[1]; /* textual description */ }; diff --git a/src/frontend/mame/ui/sliderchangednotifier.h b/src/frontend/mame/ui/sliderchangednotifier.h index 40e6df4b4bf..60bcf9c79fe 100644 --- a/src/frontend/mame/ui/sliderchangednotifier.h +++ b/src/frontend/mame/ui/sliderchangednotifier.h @@ -14,7 +14,7 @@ #include #include -using INT32 = std::int32_t; +using int32_t = std::int32_t; class running_machine; @@ -23,7 +23,7 @@ class slider_changed_notifier public: virtual ~slider_changed_notifier() { } - virtual INT32 slider_changed(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) = 0; + virtual int32_t slider_changed(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) = 0; }; #endif // __SLIDER_CHANGED_NOTIFIER__ diff --git a/src/frontend/mame/ui/sliders.cpp b/src/frontend/mame/ui/sliders.cpp index a4e66b74802..f311243f1ae 100644 --- a/src/frontend/mame/ui/sliders.cpp +++ b/src/frontend/mame/ui/sliders.cpp @@ -42,8 +42,8 @@ void menu_sliders::handle() if (menu_event->itemref != nullptr && menu_event->type == menu_item_type::SLIDER) { const slider_state *slider = (const slider_state *)menu_event->itemref; - INT32 curvalue = slider->update(machine(), slider->arg, slider->id, nullptr, SLIDER_NOCHANGE); - INT32 increment = 0; + int32_t curvalue = slider->update(machine(), slider->arg, slider->id, nullptr, SLIDER_NOCHANGE); + int32_t increment = 0; bool alt_pressed = machine().input().code_pressed(KEYCODE_LALT) || machine().input().code_pressed(KEYCODE_RALT); bool ctrl_pressed = machine().input().code_pressed(KEYCODE_LCONTROL) || machine().input().code_pressed(KEYCODE_RCONTROL); bool shift_pressed = machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT); @@ -95,7 +95,7 @@ void menu_sliders::handle() // handle any changes if (increment != 0) { - INT32 newvalue = curvalue + increment; + int32_t newvalue = curvalue + increment; // clamp within bounds if (newvalue < slider->minval) @@ -146,8 +146,8 @@ void menu_sliders::populate() if (item.type == menu_item_type::SLIDER) { slider_state* slider = reinterpret_cast(item.ref); - INT32 curval = slider->update(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE); - UINT32 flags = 0; + int32_t curval = slider->update(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE); + uint32_t flags = 0; if (curval > slider->minval) flags |= FLAG_LEFT_ARROW; if (curval < slider->maxval) @@ -169,8 +169,8 @@ void menu_sliders::populate() if (item.type == menu_item_type::SLIDER) { slider_state* slider = reinterpret_cast(item.ref); - INT32 curval = slider->update(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE); - UINT32 flags = 0; + int32_t curval = slider->update(machine(), slider->arg, slider->id, &tempstring, SLIDER_NOCHANGE); + uint32_t flags = 0; if (curval > slider->minval) flags |= FLAG_LEFT_ARROW; if (curval < slider->maxval) @@ -201,7 +201,7 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo float percentage, default_percentage; std::string tempstring; float text_height; - INT32 curval; + int32_t curval; // determine the current value and text curval = curslider->update(machine(), curslider->arg, curslider->id, &tempstring, SLIDER_NOCHANGE); @@ -263,9 +263,9 @@ void menu_sliders::custom_render(void *selectedref, float top, float bottom, flo // standard menu handler //------------------------------------------------- -UINT32 menu_sliders::ui_handler(render_container &container, mame_ui_manager &mui) +uint32_t menu_sliders::ui_handler(render_container &container, mame_ui_manager &mui) { - UINT32 result; + uint32_t result; // if this is the first call, push the sliders menu if (topmost_menu(mui.machine()) == nullptr) diff --git a/src/frontend/mame/ui/sliders.h b/src/frontend/mame/ui/sliders.h index 6e3affb53b8..54b2af38f78 100644 --- a/src/frontend/mame/ui/sliders.h +++ b/src/frontend/mame/ui/sliders.h @@ -22,7 +22,7 @@ public: menu_sliders(mame_ui_manager &mui, render_container &container, bool menuless_mode = false); virtual ~menu_sliders() override; - static UINT32 ui_handler(render_container &container, mame_ui_manager &mui); + static uint32_t ui_handler(render_container &container, mame_ui_manager &mui); protected: virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override; diff --git a/src/frontend/mame/ui/sndmenu.cpp b/src/frontend/mame/ui/sndmenu.cpp index a5c8425f337..2496a18186b 100644 --- a/src/frontend/mame/ui/sndmenu.cpp +++ b/src/frontend/mame/ui/sndmenu.cpp @@ -126,7 +126,7 @@ void menu_sound_options::handle() void menu_sound_options::populate() { - UINT32 arrow_flags = get_arrow_flags(UINT16(0), UINT16(ARRAY_LENGTH(m_sound_rate) - 1), m_cur_rates); + uint32_t arrow_flags = get_arrow_flags(uint16_t(0), uint16_t(ARRAY_LENGTH(m_sound_rate) - 1), m_cur_rates); m_sample_rate = m_sound_rate[m_cur_rates]; // add options items diff --git a/src/frontend/mame/ui/sndmenu.h b/src/frontend/mame/ui/sndmenu.h index 19e110bbc7e..8cb78d47650 100644 --- a/src/frontend/mame/ui/sndmenu.h +++ b/src/frontend/mame/ui/sndmenu.h @@ -39,7 +39,7 @@ private: virtual void populate() override; virtual void handle() override; - UINT16 m_cur_rates; + uint16_t m_cur_rates; static const int m_sound_rate[]; int m_sample_rate; bool m_samples, m_sound; diff --git a/src/frontend/mame/ui/starimg.ipp b/src/frontend/mame/ui/starimg.ipp index 6918c3315ea..7f7f84e2c9a 100644 --- a/src/frontend/mame/ui/starimg.ipp +++ b/src/frontend/mame/ui/starimg.ipp @@ -8,7 +8,7 @@ namespace ui { namespace { // TODO: move this to an external image file and zlib compress it into a souce file as part of the build process -UINT32 const favorite_star_bmp[] = { +uint32_t const favorite_star_bmp[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02D07A00, 0x15D07A00, 0x0FD07A00, 0x00D07A00, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, diff --git a/src/frontend/mame/ui/submenu.cpp b/src/frontend/mame/ui/submenu.cpp index 9b4b85331a8..1467a0e2921 100644 --- a/src/frontend/mame/ui/submenu.cpp +++ b/src/frontend/mame/ui/submenu.cpp @@ -315,7 +315,7 @@ void submenu::handle() void submenu::populate() { - UINT32 arrow_flags; + uint32_t arrow_flags; // add options for (auto sm_option = m_options.begin(); sm_option < m_options.end(); ++sm_option) diff --git a/src/frontend/mame/ui/tapectrl.cpp b/src/frontend/mame/ui/tapectrl.cpp index 9160ec5c1d7..57432ecd14e 100644 --- a/src/frontend/mame/ui/tapectrl.cpp +++ b/src/frontend/mame/ui/tapectrl.cpp @@ -67,7 +67,7 @@ void menu_tape_control::populate() cassette_state state; double t0 = current_device()->get_position(); double t1 = current_device()->get_length(); - UINT32 tapeflags = 0; + uint32_t tapeflags = 0; // state if (t1 > 0) diff --git a/src/frontend/mame/ui/toolbar.ipp b/src/frontend/mame/ui/toolbar.ipp index 3b2473a49de..933bf9c2d40 100644 --- a/src/frontend/mame/ui/toolbar.ipp +++ b/src/frontend/mame/ui/toolbar.ipp @@ -8,7 +8,7 @@ namespace ui { namespace { // TODO: move this to an external image file and zlib compress it into a souce file as part of the build process -UINT32 const toolbar_bitmap_bmp[][1024] = { +uint32_t const toolbar_bitmap_bmp[][1024] = { { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 4499109f5c7..9d1adf2d1d8 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -130,7 +130,7 @@ slider_state *mame_ui_manager::slider_current; CORE IMPLEMENTATION ***************************************************************************/ -static const UINT32 mouse_bitmap[32*32] = +static const uint32_t mouse_bitmap[32*32] = { 0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff, 0x09a46f30,0x81ac7c43,0x24af8049,0x00ad7d45,0x00a8753a,0x00a46f30,0x009f6725,0x009b611c,0x00985b14,0x0095560d,0x00935308,0x00915004,0x00904e02,0x008f4e01,0x008f4d00,0x008f4d00,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff,0x00ffffff, @@ -204,7 +204,7 @@ void mame_ui_manager::init() // more initialization using namespace std::placeholders; set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_messagebox, this, _1)); - m_non_char_keys_down = std::make_unique((ARRAY_LENGTH(non_char_keys) + 7) / 8); + m_non_char_keys_down = std::make_unique((ARRAY_LENGTH(non_char_keys) + 7) / 8); m_mouse_show = machine().system().flags & MACHINE_CLICKABLE_ARTWORK ? true : false; // request a callback upon exiting @@ -212,8 +212,8 @@ void mame_ui_manager::init() // create mouse bitmap bitmap_argb32 *ui_mouse_bitmap = auto_alloc(machine(), bitmap_argb32(32, 32)); - UINT32 *dst = &ui_mouse_bitmap->pix32(0); - memcpy(dst,mouse_bitmap,32*32*sizeof(UINT32)); + uint32_t *dst = &ui_mouse_bitmap->pix32(0); + memcpy(dst,mouse_bitmap,32*32*sizeof(uint32_t)); m_mouse_arrow_texture = machine().render().texture_alloc(); m_mouse_arrow_texture->set_bitmap(*ui_mouse_bitmap, ui_mouse_bitmap->cliprect(), TEXFORMAT_ARGB32); } @@ -264,7 +264,7 @@ void mame_ui_manager::initialize(running_machine &machine) // pair for the current UI handler //------------------------------------------------- -void mame_ui_manager::set_handler(ui_callback_type callback_type, const std::function &&callback) +void mame_ui_manager::set_handler(ui_callback_type callback_type, const std::function &&callback) { m_handler_callback = std::move(callback); m_handler_callback_type = callback_type; @@ -424,7 +424,7 @@ void mame_ui_manager::update_and_render(render_container &container) // display the internal mouse cursor if (m_mouse_show || (is_menu_active() && machine().options().ui_mouse())) { - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; bool mouse_button; render_target *mouse_target = machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); @@ -468,9 +468,9 @@ render_font *mame_ui_manager::get_font() float mame_ui_manager::get_line_height() { - INT32 raw_font_pixel_height = get_font()->pixel_height(); + int32_t raw_font_pixel_height = get_font()->pixel_height(); render_target &ui_target = machine().render().ui_target(); - INT32 target_pixel_height = ui_target.height(); + int32_t target_pixel_height = ui_target.height(); float one_to_one_line_height; float scale_factor; @@ -498,7 +498,7 @@ float mame_ui_manager::get_line_height() // otherwise, just make sure we hit an even number of pixels else { - INT32 height = scale_factor * one_to_one_line_height * (float)target_pixel_height; + int32_t height = scale_factor * one_to_one_line_height * (float)target_pixel_height; scale_factor = (float)height / (one_to_one_line_height * (float)target_pixel_height); } @@ -770,7 +770,7 @@ bool mame_ui_manager::is_menu_active(void) // messagebox_text string but handles no input //------------------------------------------------- -UINT32 mame_ui_manager::handler_messagebox(render_container &container) +uint32_t mame_ui_manager::handler_messagebox(render_container &container) { draw_text_box(container, messagebox_text.c_str(), ui::text_layout::LEFT, 0.5f, 0.5f, messagebox_backcolor); return 0; @@ -783,9 +783,9 @@ UINT32 mame_ui_manager::handler_messagebox(render_container &container) // any keypress //------------------------------------------------- -UINT32 mame_ui_manager::handler_messagebox_anykey(render_container &container) +uint32_t mame_ui_manager::handler_messagebox_anykey(render_container &container) { - UINT32 state = 0; + uint32_t state = 0; // draw a standard message window draw_text_box(container, messagebox_text.c_str(), ui::text_layout::LEFT, 0.5f, 0.5f, messagebox_backcolor); @@ -816,8 +816,8 @@ void mame_ui_manager::process_natural_keyboard() int i, pressed; input_item_id itemid; input_code code; - UINT8 *key_down_ptr; - UINT8 key_down_mask; + uint8_t *key_down_ptr; + uint8_t key_down_mask; // loop while we have interesting events while (machine().ui_input().pop_event(&event)) @@ -986,7 +986,7 @@ void mame_ui_manager::start_save_state() machine().pause(); m_load_save_hold = true; using namespace std::placeholders; - set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_load_save, this, _1, UINT32(LOADSAVE_SAVE))); + set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_load_save, this, _1, uint32_t(LOADSAVE_SAVE))); } @@ -999,7 +999,7 @@ void mame_ui_manager::start_load_state() machine().pause(); m_load_save_hold = true; using namespace std::placeholders; - set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_load_save, this, _1, UINT32(LOADSAVE_LOAD))); + set_handler(ui_callback_type::GENERAL, std::bind(&mame_ui_manager::handler_load_save, this, _1, uint32_t(LOADSAVE_LOAD))); } @@ -1041,7 +1041,7 @@ void mame_ui_manager::image_handler_ingame() // of the standard keypresses //------------------------------------------------- -UINT32 mame_ui_manager::handler_ingame(render_container &container) +uint32_t mame_ui_manager::handler_ingame(render_container &container) { bool is_paused = machine().paused(); @@ -1269,7 +1269,7 @@ UINT32 mame_ui_manager::handler_ingame(render_container &container) // specifying a game to save or load //------------------------------------------------- -UINT32 mame_ui_manager::handler_load_save(render_container &container, UINT32 state) +uint32_t mame_ui_manager::handler_load_save(render_container &container, uint32_t state) { char filename[20]; char file = 0; @@ -1388,9 +1388,9 @@ void mame_ui_manager::request_quit() // confirming quit emulation //------------------------------------------------- -UINT32 mame_ui_manager::handler_confirm_quit(render_container &container) +uint32_t mame_ui_manager::handler_confirm_quit(render_container &container) { - UINT32 state = 0; + uint32_t state = 0; // get the text for 'UI Select' std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD)); @@ -1441,10 +1441,10 @@ std::vector& mame_ui_manager::get_slider_list(void) // slider_alloc - allocate a new slider entry //------------------------------------------------- -slider_state* mame_ui_manager::slider_alloc(running_machine &machine, int id, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, void *arg) +slider_state* mame_ui_manager::slider_alloc(running_machine &machine, int id, const char *title, int32_t minval, int32_t defval, int32_t maxval, int32_t incval, void *arg) { int size = sizeof(slider_state) + strlen(title); - slider_state *state = (slider_state *)auto_alloc_array_clear(machine, UINT8, size); + slider_state *state = (slider_state *)auto_alloc_array_clear(machine, uint8_t, size); state->minval = minval; state->defval = defval; @@ -1478,8 +1478,8 @@ std::vector mame_ui_manager::slider_init(running_machine &machine mixer_input info; for (int item = 0; machine.sound().indexed_mixer_input(item, info); item++) { - INT32 maxval = 2000; - INT32 defval = 1000; + int32_t maxval = 2000; + int32_t defval = 1000; std::string str = string_format(_("%1$s Volume"), info.stream->input_name(info.inputnum)); sliders.push_back(slider_alloc(machine, SLIDER_ID_MIXERVOL + item, str.c_str(), 0, defval, maxval, 20, (void *)(uintptr_t)item)); @@ -1627,7 +1627,7 @@ std::vector mame_ui_manager::slider_init(running_machine &machine // slider_changed - global slider-modified callback //---------------------------------------------------- -INT32 mame_ui_manager::slider_changed(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_changed(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (id == SLIDER_ID_VOLUME) return slider_volume(machine, arg, id, str, newval); @@ -1684,7 +1684,7 @@ INT32 mame_ui_manager::slider_changed(running_machine &machine, void *arg, int i // slider_volume - global volume slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_volume(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_volume(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) machine.sound().set_attenuation(newval); @@ -1699,14 +1699,14 @@ INT32 mame_ui_manager::slider_volume(running_machine &machine, void *arg, int id // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { mixer_input info; if (!machine.sound().indexed_mixer_input((uintptr_t)arg, info)) return 0; if (newval != SLIDER_NOCHANGE) { - INT32 curval = floor(info.stream->user_gain(info.inputnum) * 1000.0f + 0.5f); + int32_t curval = floor(info.stream->user_gain(info.inputnum) * 1000.0f + 0.5f); if (newval > curval && (newval - curval) <= 4) newval += 4; // round up on increment info.stream->set_user_gain(info.inputnum, (float)newval * 0.001f); } @@ -1721,7 +1721,7 @@ INT32 mame_ui_manager::slider_mixervol(running_machine &machine, void *arg, int // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_adjuster(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_adjuster(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { ioport_field *field = (ioport_field *)arg; ioport_field::user_settings settings; @@ -1743,7 +1743,7 @@ INT32 mame_ui_manager::slider_adjuster(running_machine &machine, void *arg, int // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overclock(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overclock(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { device_t *cpu = (device_t *)arg; if (newval != SLIDER_NOCHANGE) @@ -1758,7 +1758,7 @@ INT32 mame_ui_manager::slider_overclock(running_machine &machine, void *arg, int // slider_refresh - refresh rate slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_refresh(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_refresh(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast(arg); double defrefresh = ATTOSECONDS_TO_HZ(screen->refresh_attoseconds()); @@ -1783,7 +1783,7 @@ INT32 mame_ui_manager::slider_refresh(running_machine &machine, void *arg, int i // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_brightness(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_brightness(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast(arg); render_container::user_settings settings; @@ -1805,7 +1805,7 @@ INT32 mame_ui_manager::slider_brightness(running_machine &machine, void *arg, in // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_contrast(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_contrast(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast(arg); render_container::user_settings settings; @@ -1826,7 +1826,7 @@ INT32 mame_ui_manager::slider_contrast(running_machine &machine, void *arg, int // slider_gamma - screen gamma slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_gamma(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_gamma(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast(arg); render_container::user_settings settings; @@ -1848,7 +1848,7 @@ INT32 mame_ui_manager::slider_gamma(running_machine &machine, void *arg, int id, // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_xscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_xscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast(arg); render_container::user_settings settings; @@ -1870,7 +1870,7 @@ INT32 mame_ui_manager::slider_xscale(running_machine &machine, void *arg, int id // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_yscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_yscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast(arg); render_container::user_settings settings; @@ -1892,7 +1892,7 @@ INT32 mame_ui_manager::slider_yscale(running_machine &machine, void *arg, int id // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_xoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_xoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast(arg); render_container::user_settings settings; @@ -1914,7 +1914,7 @@ INT32 mame_ui_manager::slider_xoffset(running_machine &machine, void *arg, int i // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_yoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_yoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { screen_device *screen = reinterpret_cast(arg); render_container::user_settings settings; @@ -1936,7 +1936,7 @@ INT32 mame_ui_manager::slider_yoffset(running_machine &machine, void *arg, int i // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overxscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overxscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { laserdisc_device *laserdisc = (laserdisc_device *)arg; laserdisc_overlay_config settings; @@ -1958,7 +1958,7 @@ INT32 mame_ui_manager::slider_overxscale(running_machine &machine, void *arg, in // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overyscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overyscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { laserdisc_device *laserdisc = (laserdisc_device *)arg; laserdisc_overlay_config settings; @@ -1980,7 +1980,7 @@ INT32 mame_ui_manager::slider_overyscale(running_machine &machine, void *arg, in // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overxoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overxoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { laserdisc_device *laserdisc = (laserdisc_device *)arg; laserdisc_overlay_config settings; @@ -2002,7 +2002,7 @@ INT32 mame_ui_manager::slider_overxoffset(running_machine &machine, void *arg, i // slider callback //------------------------------------------------- -INT32 mame_ui_manager::slider_overyoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_overyoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { laserdisc_device *laserdisc = (laserdisc_device *)arg; laserdisc_overlay_config settings; @@ -2024,7 +2024,7 @@ INT32 mame_ui_manager::slider_overyoffset(running_machine &machine, void *arg, i // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_flicker(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_flicker(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) vector_options::s_flicker = (float)newval * 0.001f; @@ -2039,7 +2039,7 @@ INT32 mame_ui_manager::slider_flicker(running_machine &machine, void *arg, int i // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_beam_width_min(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_beam_width_min(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) vector_options::s_beam_width_min = std::min((float)newval * 0.01f, vector_options::s_beam_width_max); @@ -2054,7 +2054,7 @@ INT32 mame_ui_manager::slider_beam_width_min(running_machine &machine, void *arg // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_beam_width_max(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_beam_width_max(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) vector_options::s_beam_width_max = std::max((float)newval * 0.01f, vector_options::s_beam_width_min); @@ -2069,7 +2069,7 @@ INT32 mame_ui_manager::slider_beam_width_max(running_machine &machine, void *arg // callback //------------------------------------------------- -INT32 mame_ui_manager::slider_beam_intensity_weight(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_beam_intensity_weight(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) vector_options::s_beam_intensity_weight = (float)newval * 0.001f; @@ -2085,7 +2085,7 @@ INT32 mame_ui_manager::slider_beam_intensity_weight(running_machine &machine, vo //------------------------------------------------- #ifdef MAME_DEBUG -INT32 mame_ui_manager::slider_crossscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_crossscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { ioport_field *field = (ioport_field *)arg; @@ -2104,7 +2104,7 @@ INT32 mame_ui_manager::slider_crossscale(running_machine &machine, void *arg, in //------------------------------------------------- #ifdef MAME_DEBUG -INT32 mame_ui_manager::slider_crossoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) +int32_t mame_ui_manager::slider_crossoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) { ioport_field *field = (ioport_field *)arg; @@ -2158,7 +2158,7 @@ int mame_ui_manager::wrap_text(render_container &container, const char *origs, f // textured background and line color //------------------------------------------------- -void mame_ui_manager::draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture, UINT32 flags) +void mame_ui_manager::draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture, uint32_t flags) { container.add_quad(x0, y0, x1, y1, backcolor, texture, flags); container.add_line(x0, y0, x1, y0, UI_LINE_WIDTH, linecolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); @@ -2182,9 +2182,9 @@ rgb_t decode_ui_color(int id, running_machine *machine) const char *s_option = mame_machine_manager::instance()->ui().options().value(s_color_list[x]); int len = strlen(s_option); if (len != 8) - color[x] = rgb_t((UINT32)strtoul(o_default, nullptr, 16)); + color[x] = rgb_t((uint32_t)strtoul(o_default, nullptr, 16)); else - color[x] = rgb_t((UINT32)strtoul(s_option, nullptr, 16)); + color[x] = rgb_t((uint32_t)strtoul(s_option, nullptr, 16)); } } return color[id]; diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h index aa9852005ef..8364fa69ec2 100644 --- a/src/frontend/mame/ui/ui.h +++ b/src/frontend/mame/ui/ui.h @@ -68,7 +68,7 @@ class machine_info; #define UI_SLIDER_COLOR decode_ui_color(15) /* cancel return value for a UI handler */ -#define UI_HANDLER_CANCEL ((UINT32)~0) +#define UI_HANDLER_CANCEL ((uint32_t)~0) #define SLIDER_DEVICE_SPACING 0x0ff #define SLIDER_SCREEN_SPACING 0x0f @@ -129,7 +129,7 @@ enum ***************************************************************************/ class mame_ui_manager; -typedef UINT32 (*ui_callback)(mame_ui_manager &, render_container &, UINT32); +typedef uint32_t (*ui_callback)(mame_ui_manager &, render_container &, uint32_t); enum class ui_callback_type { @@ -170,7 +170,7 @@ public: void initialize(running_machine &machine); std::vector slider_init(running_machine &machine); - void set_handler(ui_callback_type callback_type, const std::function &&callback); + void set_handler(ui_callback_type callback_type, const std::function &&callback); void display_startup_screens(bool first_time); virtual void set_startup_text(const char *text, bool force) override; @@ -226,7 +226,7 @@ public: int wrap_text(render_container &container, const char *origs, float x, float y, float origwrapwidth, std::vector &xstart, std::vector &xend, float text_size = 1.0f); // draw an outlined box with given line color and filled with a texture - void draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture = nullptr, UINT32 flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); + void draw_textured_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture = nullptr, uint32_t flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); virtual void popup_time_string(int seconds, std::string message) override; virtual void menu_reset() override; @@ -234,15 +234,15 @@ public: private: // instance variables render_font * m_font; - std::function m_handler_callback; + std::function m_handler_callback; ui_callback_type m_handler_callback_type; - UINT32 m_handler_param; + uint32_t m_handler_param; bool m_single_step; bool m_showfps; osd_ticks_t m_showfps_end; bool m_show_profiler; osd_ticks_t m_popup_text_end; - std::unique_ptr m_non_char_keys_down; + std::unique_ptr m_non_char_keys_down; render_texture * m_mouse_arrow_texture; bool m_mouse_show; bool m_load_save_hold; @@ -259,43 +259,43 @@ private: static slider_state *slider_current; // UI handlers - UINT32 handler_messagebox(render_container &container); - UINT32 handler_messagebox_anykey(render_container &container); - UINT32 handler_ingame(render_container &container); - UINT32 handler_load_save(render_container &container, UINT32 state); - UINT32 handler_confirm_quit(render_container &container); + uint32_t handler_messagebox(render_container &container); + uint32_t handler_messagebox_anykey(render_container &container); + uint32_t handler_ingame(render_container &container); + uint32_t handler_load_save(render_container &container, uint32_t state); + uint32_t handler_confirm_quit(render_container &container); // private methods void exit(); - slider_state* slider_alloc(running_machine &machine, int id, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, void *arg); + slider_state* slider_alloc(running_machine &machine, int id, const char *title, int32_t minval, int32_t defval, int32_t maxval, int32_t incval, void *arg); // slider controls - virtual INT32 slider_changed(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) override; - - INT32 slider_volume(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_adjuster(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overclock(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_refresh(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_brightness(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_contrast(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_gamma(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_xscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_yscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_xoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_yoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overxscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overyscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overxoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_overyoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_flicker(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_beam_width_min(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_beam_width_max(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_beam_intensity_weight(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); + virtual int32_t slider_changed(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) override; + + int32_t slider_volume(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_adjuster(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overclock(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_refresh(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_brightness(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_contrast(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_gamma(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_xscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_yscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_xoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_yoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overxscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overyscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overxoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_overyoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_flicker(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_beam_width_min(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_beam_width_max(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_beam_intensity_weight(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); std::string slider_get_screen_desc(screen_device &screen); #ifdef MAME_DEBUG - INT32 slider_crossscale(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); - INT32 slider_crossoffset(running_machine &machine, void *arg, int id, std::string *str, INT32 newval); + int32_t slider_crossscale(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); + int32_t slider_crossoffset(running_machine &machine, void *arg, int id, std::string *str, int32_t newval); #endif }; diff --git a/src/frontend/mame/ui/utils.cpp b/src/frontend/mame/ui/utils.cpp index 0f80d20be6e..937d0a0cc3f 100644 --- a/src/frontend/mame/ui/utils.cpp +++ b/src/frontend/mame/ui/utils.cpp @@ -15,60 +15,60 @@ extern const char UI_VERSION_TAG[]; const char UI_VERSION_TAG[] = "# UI INFO "; // Years index -UINT16 c_year::actual = 0; +uint16_t c_year::actual = 0; std::vector c_year::ui; // Manufacturers index -UINT16 c_mnfct::actual = 0; +uint16_t c_mnfct::actual = 0; std::vector c_mnfct::ui; std::unordered_map c_mnfct::uimap; // Main filters -UINT16 main_filters::actual = 0; +uint16_t main_filters::actual = 0; const char *main_filters::text[] = { "All", "Available", "Unavailable", "Working", "Not Working", "Mechanical", "Not Mechanical", "Category", "Favorites", "BIOS", "Parents", "Clones", "Manufacturers", "Years", "Support Save", "Not Support Save", "CHD", "No CHD", "Vertical", "Horizontal", "Custom" }; size_t main_filters::length = ARRAY_LENGTH(main_filters::text); // Software filters -UINT16 sw_filters::actual = 0; +uint16_t sw_filters::actual = 0; const char *sw_filters::text[] = { "All", "Available", "Unavailable", "Parents", "Clones", "Years", "Publishers", "Supported", "Partial Supported", "Unsupported", "Region", "Device Type", "Software List", "Custom" }; size_t sw_filters::length = ARRAY_LENGTH(sw_filters::text); // Globals -UINT8 ui_globals::rpanel = 0; -UINT8 ui_globals::curimage_view = 0; -UINT8 ui_globals::curdats_view = 0; -UINT8 ui_globals::cur_sw_dats_total = 0; -UINT8 ui_globals::curdats_total = 0; -UINT8 ui_globals::cur_sw_dats_view = 0; +uint8_t ui_globals::rpanel = 0; +uint8_t ui_globals::curimage_view = 0; +uint8_t ui_globals::curdats_view = 0; +uint8_t ui_globals::cur_sw_dats_total = 0; +uint8_t ui_globals::curdats_total = 0; +uint8_t ui_globals::cur_sw_dats_view = 0; bool ui_globals::switch_image = false; bool ui_globals::default_image = true; bool ui_globals::reset = false; bool ui_globals::redraw_icon = false; int ui_globals::visible_main_lines = 0; int ui_globals::visible_sw_lines = 0; -UINT16 ui_globals::panels_status = 0; +uint16_t ui_globals::panels_status = 0; bool ui_globals::has_icons = false; // Custom filter -UINT16 custfltr::main = 0; -UINT16 custfltr::numother = 0; -UINT16 custfltr::other[MAX_CUST_FILTER]; -UINT16 custfltr::mnfct[MAX_CUST_FILTER]; -UINT16 custfltr::year[MAX_CUST_FILTER]; -UINT16 custfltr::screen[MAX_CUST_FILTER]; +uint16_t custfltr::main = 0; +uint16_t custfltr::numother = 0; +uint16_t custfltr::other[MAX_CUST_FILTER]; +uint16_t custfltr::mnfct[MAX_CUST_FILTER]; +uint16_t custfltr::year[MAX_CUST_FILTER]; +uint16_t custfltr::screen[MAX_CUST_FILTER]; // Custom filter -UINT16 sw_custfltr::main = 0; -UINT16 sw_custfltr::numother = 0; -UINT16 sw_custfltr::other[MAX_CUST_FILTER]; -UINT16 sw_custfltr::mnfct[MAX_CUST_FILTER]; -UINT16 sw_custfltr::year[MAX_CUST_FILTER]; -UINT16 sw_custfltr::region[MAX_CUST_FILTER]; -UINT16 sw_custfltr::type[MAX_CUST_FILTER]; -UINT16 sw_custfltr::list[MAX_CUST_FILTER]; +uint16_t sw_custfltr::main = 0; +uint16_t sw_custfltr::numother = 0; +uint16_t sw_custfltr::other[MAX_CUST_FILTER]; +uint16_t sw_custfltr::mnfct[MAX_CUST_FILTER]; +uint16_t sw_custfltr::year[MAX_CUST_FILTER]; +uint16_t sw_custfltr::region[MAX_CUST_FILTER]; +uint16_t sw_custfltr::type[MAX_CUST_FILTER]; +uint16_t sw_custfltr::list[MAX_CUST_FILTER]; char* chartrimcarriage(char str[]) { diff --git a/src/frontend/mame/ui/utils.h b/src/frontend/mame/ui/utils.h index 5e6c2f6acfd..29ce34abe87 100644 --- a/src/frontend/mame/ui/utils.h +++ b/src/frontend/mame/ui/utils.h @@ -19,7 +19,7 @@ #define MAX_CUST_FILTER 8 // GLOBAL ENUMERATORS -enum : UINT16 +enum : uint16_t { FILTER_FIRST = 0, FILTER_ALL = FILTER_FIRST, @@ -84,7 +84,7 @@ enum HIDE_BOTH }; -enum : UINT16 +enum : uint16_t { UI_SW_FIRST = 0, UI_SW_ALL = UI_SW_FIRST, @@ -130,7 +130,7 @@ struct ui_software_info { ui_software_info() {} ui_software_info(std::string sname, std::string lname, std::string pname, std::string y, std::string pub, - UINT8 s, std::string pa, const game_driver *d, std::string li, std::string i, std::string is, UINT8 em, + uint8_t s, std::string pa, const game_driver *d, std::string li, std::string i, std::string is, uint8_t em, std::string plong, std::string u, std::string de, bool av) { shortname = sname; longname = lname; parentname = pname; year = y; publisher = pub; @@ -142,13 +142,13 @@ struct ui_software_info std::string parentname; std::string year; std::string publisher; - UINT8 supported = 0; + uint8_t supported = 0; std::string part; const game_driver *driver = nullptr; std::string listname; std::string interface; std::string instance; - UINT8 startempty = 0; + uint8_t startempty = 0; std::string parentlongname; std::string usage; std::string devicetype; @@ -174,7 +174,7 @@ struct c_mnfct static std::string getname(const char *str); static std::vector ui; static std::unordered_map uimap; - static UINT16 actual; + static uint16_t actual; }; // Years @@ -182,23 +182,23 @@ struct c_year { static void set(const char *str); static std::vector ui; - static UINT16 actual; + static uint16_t actual; }; // GLOBAL CLASS struct ui_globals { - static UINT8 curimage_view, curdats_view, curdats_total, cur_sw_dats_view, cur_sw_dats_total, rpanel; + static uint8_t curimage_view, curdats_view, curdats_total, cur_sw_dats_view, cur_sw_dats_total, rpanel; static bool switch_image, redraw_icon, default_image, reset; static int visible_main_lines, visible_sw_lines; - static UINT16 panels_status; + static uint16_t panels_status; static bool has_icons; }; #define main_struct(name) \ struct name##_filters \ { \ - static UINT16 actual; \ + static uint16_t actual; \ static const char *text[]; \ static size_t length; \ }; @@ -209,25 +209,25 @@ main_struct(sw); // Custom filter struct custfltr { - static UINT16 main; - static UINT16 numother; - static UINT16 other[MAX_CUST_FILTER]; - static UINT16 mnfct[MAX_CUST_FILTER]; - static UINT16 screen[MAX_CUST_FILTER]; - static UINT16 year[MAX_CUST_FILTER]; + static uint16_t main; + static uint16_t numother; + static uint16_t other[MAX_CUST_FILTER]; + static uint16_t mnfct[MAX_CUST_FILTER]; + static uint16_t screen[MAX_CUST_FILTER]; + static uint16_t year[MAX_CUST_FILTER]; }; // Software custom filter struct sw_custfltr { - static UINT16 main; - static UINT16 numother; - static UINT16 other[MAX_CUST_FILTER]; - static UINT16 mnfct[MAX_CUST_FILTER]; - static UINT16 year[MAX_CUST_FILTER]; - static UINT16 region[MAX_CUST_FILTER]; - static UINT16 type[MAX_CUST_FILTER]; - static UINT16 list[MAX_CUST_FILTER]; + static uint16_t main; + static uint16_t numother; + static uint16_t other[MAX_CUST_FILTER]; + static uint16_t mnfct[MAX_CUST_FILTER]; + static uint16_t year[MAX_CUST_FILTER]; + static uint16_t region[MAX_CUST_FILTER]; + static uint16_t type[MAX_CUST_FILTER]; + static uint16_t list[MAX_CUST_FILTER]; }; // GLOBAL FUNCTIONS diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp index c7ffa27fbc6..d841757ad40 100644 --- a/src/frontend/mame/ui/viewgfx.cpp +++ b/src/frontend/mame/ui/viewgfx.cpp @@ -29,7 +29,7 @@ enum ui_gfx_modes UI_GFX_TILEMAP }; -const UINT8 MAX_GFX_DECODERS = 8; +const uint8_t MAX_GFX_DECODERS = 8; @@ -41,9 +41,9 @@ const UINT8 MAX_GFX_DECODERS = 8; struct ui_gfx_info { device_gfx_interface *interface; // pointer to device's gfx interface - UINT8 setcount; // how many gfx sets device has - UINT8 rotate[MAX_GFX_ELEMENTS]; // current rotation (orientation) value - UINT8 columns[MAX_GFX_ELEMENTS]; // number of items per row + uint8_t setcount; // how many gfx sets device has + uint8_t rotate[MAX_GFX_ELEMENTS]; // current rotation (orientation) value + uint8_t columns[MAX_GFX_ELEMENTS]; // number of items per row int offset[MAX_GFX_ELEMENTS]; // current offset of top,left item int color[MAX_GFX_ELEMENTS]; // current color selected }; @@ -51,7 +51,7 @@ struct ui_gfx_info struct ui_gfx_state { bool started; // have we called ui_gfx_count_devices() yet? - UINT8 mode; // which mode are we in? + uint8_t mode; // which mode are we in? // intermediate bitmaps bool bitmap_dirty; // is the bitmap dirty? @@ -64,17 +64,17 @@ struct ui_gfx_state palette_device *device; // pointer to current device int devcount; // how many palette devices exist int devindex; // which palette device is visible - UINT8 which; // which subset (pens or indirect colors)? - UINT8 columns; // number of items per row + uint8_t which; // which subset (pens or indirect colors)? + uint8_t columns; // number of items per row int offset; // current offset of top left item } palette; // graphics-specific data struct { - UINT8 devcount; // how many gfx devices exist - UINT8 devindex; // which device is visible - UINT8 set; // which set is visible + uint8_t devcount; // how many gfx devices exist + uint8_t devindex; // which device is visible + uint8_t set; // which set is visible } gfxset; // information about each gfx device @@ -87,7 +87,7 @@ struct ui_gfx_state int xoffs; // current X offset int yoffs; // current Y offset int zoom; // zoom factor - UINT8 rotate; // current rotation (orientation) value + uint8_t rotate; // current rotation (orientation) value } tilemap; }; @@ -137,7 +137,7 @@ static void tilemap_handler(mame_ui_manager &mui, render_container &container, u void ui_gfx_init(running_machine &machine) { ui_gfx_state *state = &ui_gfx; - UINT8 rotate = machine.system().flags & ORIENTATION_MASK; + uint8_t rotate = machine.system().flags & ORIENTATION_MASK; // make sure we clean up after ourselves machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ui_gfx_exit), &machine)); @@ -149,8 +149,8 @@ void ui_gfx_init(running_machine &machine) state->palette.columns = 16; // set up the graphics state - for (UINT8 i = 0; i < MAX_GFX_DECODERS; i++) - for (UINT8 j = 0; j < MAX_GFX_ELEMENTS; j++) + for (uint8_t i = 0; i < MAX_GFX_DECODERS; i++) + for (uint8_t j = 0; j < MAX_GFX_ELEMENTS; j++) { state->gfxdev[i].rotate[j] = rotate; state->gfxdev[i].columns[j] = 16; @@ -180,7 +180,7 @@ static void ui_gfx_count_devices(running_machine &machine, ui_gfx_state &state) for (device_gfx_interface &interface : gfx_interface_iterator(machine.root_device())) { // count the gfx sets in each device, skipping devices with none - UINT8 count = 0; + uint8_t count = 0; while (count < MAX_GFX_ELEMENTS && interface.gfx(count) != nullptr) count++; @@ -240,7 +240,7 @@ bool ui_gfx_is_relevant(running_machine &machine) // ui_gfx_ui_handler - primary UI handler //------------------------------------------------- -UINT32 ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate) +uint32_t ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate) { ui_gfx_state &state = ui_gfx; @@ -386,7 +386,7 @@ static void palette_handler(mame_ui_manager &mui, render_container &container, u title_buf << (state.palette.which ? _(" COLORS") : _(" PENS")); // if the mouse pointer is over one of our cells, add some info about the corresponding palette entry - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; float mouse_x, mouse_y; bool mouse_button; render_target *mouse_target = mui.machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); @@ -673,7 +673,7 @@ static void gfxset_handler(mame_ui_manager &mui, render_container &container, ui // if the mouse pointer is over a pixel in a tile, add some info about the tile and pixel bool found_pixel = false; - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; float mouse_x, mouse_y; bool mouse_button; render_target *mouse_target = mui.machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); @@ -693,7 +693,7 @@ static void gfxset_handler(mame_ui_manager &mui, render_container &container, ui ypixel = (cellypix - 2) - ypixel; if (info.rotate[set] & ORIENTATION_SWAP_XY) std::swap(xpixel, ypixel); - UINT8 pixdata = gfx.get_data(code)[xpixel + ypixel * gfx.rowbytes()]; + uint8_t pixdata = gfx.get_data(code)[xpixel + ypixel * gfx.rowbytes()]; util::stream_format(title_buf, " #%X:%X @ %d,%d = %X", code, info.color[set], xpixel, ypixel, gfx.colorbase() + info.color[set] * gfx.granularity() + pixdata); @@ -959,14 +959,14 @@ static void gfxset_draw_item(running_machine &machine, gfx_element &gfx, int ind // loop over rows in the cell for (y = 0; y < height; y++) { - UINT32 *dest = &bitmap.pix32(dsty + y, dstx); - const UINT8 *src = gfx.get_data(index); + uint32_t *dest = &bitmap.pix32(dsty + y, dstx); + const uint8_t *src = gfx.get_data(index); // loop over columns in the cell for (x = 0; x < width; x++) { int effx = x, effy = y; - const UINT8 *s; + const uint8_t *s; // compute effective x,y values after rotation if (!(rotate & ORIENTATION_SWAP_XY)) @@ -1019,8 +1019,8 @@ static void tilemap_handler(mame_ui_manager &mui, render_container &container, u // get the size of the tilemap itself tilemap_t *tilemap = mui.machine().tilemap().find(state.tilemap.which); - UINT32 mapwidth = tilemap->width(); - UINT32 mapheight = tilemap->height(); + uint32_t mapwidth = tilemap->width(); + uint32_t mapheight = tilemap->height(); if (state.tilemap.rotate & ORIENTATION_SWAP_XY) std::swap(mapwidth, mapheight); @@ -1077,7 +1077,7 @@ static void tilemap_handler(mame_ui_manager &mui, render_container &container, u util::stream_format(title_buf, "TILEMAP %d/%d", state.tilemap.which, mui.machine().tilemap().count() - 1); // if the mouse pointer is over a tile, add some info about its coordinates and color - INT32 mouse_target_x, mouse_target_y; + int32_t mouse_target_x, mouse_target_y; float mouse_x, mouse_y; bool mouse_button; render_target *mouse_target = mui.machine().ui_input().find_mouse(&mouse_target_x, &mouse_target_y, &mouse_button); @@ -1093,10 +1093,10 @@ static void tilemap_handler(mame_ui_manager &mui, render_container &container, u ypixel = (mapboxheight - 1) - ypixel; if (state.tilemap.rotate & ORIENTATION_SWAP_XY) std::swap(xpixel, ypixel); - UINT32 col = ((xpixel / pixelscale + state.tilemap.xoffs) / tilemap->tilewidth()) % tilemap->cols(); - UINT32 row = ((ypixel / pixelscale + state.tilemap.yoffs) / tilemap->tileheight()) % tilemap->rows(); - UINT8 gfxnum; - UINT32 code, color; + uint32_t col = ((xpixel / pixelscale + state.tilemap.xoffs) / tilemap->tilewidth()) % tilemap->cols(); + uint32_t row = ((ypixel / pixelscale + state.tilemap.yoffs) / tilemap->tileheight()) % tilemap->rows(); + uint8_t gfxnum; + uint32_t code, color; tilemap->get_info_debug(col, row, gfxnum, code, color); util::stream_format(title_buf, " @ %d,%d = GFX%d #%X:%X", col * tilemap->tilewidth(), row * tilemap->tileheight(), @@ -1155,8 +1155,8 @@ static void tilemap_handle_keys(running_machine &machine, ui_gfx_state &state, i // cache some info in locals tilemap_t *tilemap = machine.tilemap().find(state.tilemap.which); - UINT32 mapwidth = tilemap->width(); - UINT32 mapheight = tilemap->height(); + uint32_t mapwidth = tilemap->width(); + uint32_t mapheight = tilemap->height(); // handle zoom (minus,plus) if (machine.ui_input().pressed(IPT_UI_ZOOM_OUT) && state.tilemap.zoom > 0) diff --git a/src/frontend/mame/ui/viewgfx.h b/src/frontend/mame/ui/viewgfx.h index c7fec1d9260..5043ded0a27 100644 --- a/src/frontend/mame/ui/viewgfx.h +++ b/src/frontend/mame/ui/viewgfx.h @@ -26,7 +26,7 @@ void ui_gfx_init(running_machine &machine); bool ui_gfx_is_relevant(running_machine &machine); // master handler -UINT32 ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate); +uint32_t ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate); #endif /* __UI_VIEWGFX_H__ */ diff --git a/src/frontend/mame/ui/widgets.cpp b/src/frontend/mame/ui/widgets.cpp index da0b6c12538..cc2c276abfc 100644 --- a/src/frontend/mame/ui/widgets.cpp +++ b/src/frontend/mame/ui/widgets.cpp @@ -77,7 +77,7 @@ void widgets_manager::render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source for (y = 0; y < height; y++) { int linewidth = (y * (halfwidth - 1) + (height / 2)) * 255 * 2 / height; - UINT32 *target = &dest.pix32(y, halfwidth); + uint32_t *target = &dest.pix32(y, halfwidth); // don't antialias if height < 12 if (dest.height() < 12) diff --git a/src/ldplayer/ldplayer.cpp b/src/ldplayer/ldplayer.cpp index 6506a4abb39..eae0ea64891 100644 --- a/src/ldplayer/ldplayer.cpp +++ b/src/ldplayer/ldplayer.cpp @@ -132,7 +132,7 @@ protected: virtual void execute_command(int command) override; // internal helpers - inline void add_command(UINT8 command); + inline void add_command(uint8_t command); // timer IDs enum @@ -145,9 +145,9 @@ protected: // internal state emu_timer *m_bit_timer; - UINT32 m_command_buffer_in; - UINT32 m_command_buffer_out; - UINT8 m_command_buffer[10]; + uint32_t m_command_buffer_in; + uint32_t m_command_buffer_out; + uint8_t m_command_buffer[10]; }; @@ -351,7 +351,7 @@ void ldplayer_state::machine_reset() * *************************************/ -void pr8210_state::add_command(UINT8 command) +void pr8210_state::add_command(uint8_t command) { m_command_buffer[m_command_buffer_in++ % ARRAY_LENGTH(m_command_buffer)] = (command & 0x1f) | 0x20; m_command_buffer[m_command_buffer_in++ % ARRAY_LENGTH(m_command_buffer)] = 0x00 | 0x20; @@ -365,8 +365,8 @@ void pr8210_state::device_timer(emu_timer &timer, device_timer_id id, int param, case TIMER_ID_BIT: { attotime duration = attotime::from_msec(30); - UINT8 bitsleft = param >> 16; - UINT8 data = param; + uint8_t bitsleft = param >> 16; + uint8_t data = param; // if we have bits, process if (bitsleft != 0) @@ -418,7 +418,7 @@ void pr8210_state::machine_reset() void pr8210_state::execute_command(int command) { - static const UINT8 digits[10] = { 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d, 0x03, 0x13 }; + static const uint8_t digits[10] = { 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d, 0x03, 0x13 }; switch (command) { @@ -534,7 +534,7 @@ void pr8210_state::execute_command(int command) void ldv1000_state::execute_command(int command) { - static const UINT8 digits[10] = { 0x3f, 0x0f, 0x8f, 0x4f, 0x2f, 0xaf, 0x6f, 0x1f, 0x9f, 0x5f }; + static const uint8_t digits[10] = { 0x3f, 0x0f, 0x8f, 0x4f, 0x2f, 0xaf, 0x6f, 0x1f, 0x9f, 0x5f }; switch (command) { case CMD_SCAN_REVERSE: diff --git a/src/lib/formats/a26_cas.cpp b/src/lib/formats/a26_cas.cpp index 2e76eea73a0..5030c2bfe0f 100644 --- a/src/lib/formats/a26_cas.cpp +++ b/src/lib/formats/a26_cas.cpp @@ -17,16 +17,16 @@ Atari 2600 SuperCharger support #define BIT_ONE_LENGTH 15 #define ZEROS_ONES 2755 -static const UINT16 one_wave[BIT_ONE_LENGTH] = { +static const uint16_t one_wave[BIT_ONE_LENGTH] = { 0x2AE5, 0x4E60, 0x644E, 0x68E4, 0x5B56, 0x3DFE, 0x15ED, 0xEA13, 0xC202, 0xA4AA, 0x971C, 0x9BB2, 0xB1A0, 0xD51B, 0x0000 }; -static const UINT16 zero_wave[BIT_ZERO_LENGTH] = { +static const uint16_t zero_wave[BIT_ZERO_LENGTH] = { 0x3DFE, 0x644E, 0x644E, 0x3DFE, 0x0000, 0xC202, 0x9BB2, 0x9BB2, 0xC202, 0x0000 }; -static int a26_cas_output_wave( INT16 **buffer, INT16 wave_data, int length ) { +static int a26_cas_output_wave( int16_t **buffer, int16_t wave_data, int length ) { int i; if ( buffer ) { @@ -38,10 +38,10 @@ static int a26_cas_output_wave( INT16 **buffer, INT16 wave_data, int length ) { return length; } -static int a26_cas_output_bit( INT16 **buffer, int bit ) { +static int a26_cas_output_bit( int16_t **buffer, int bit ) { int size = 0; int bit_size = bit ? BIT_ONE_LENGTH : BIT_ZERO_LENGTH; - const INT16 *p = bit ? (const INT16 *)one_wave : (const INT16 *)zero_wave; + const int16_t *p = bit ? (const int16_t *)one_wave : (const int16_t *)zero_wave; int i; for ( i = 0; i < bit_size; i++ ) { @@ -51,7 +51,7 @@ static int a26_cas_output_bit( INT16 **buffer, int bit ) { return size; } -static int a26_cas_output_byte( INT16 **buffer, UINT8 byte ) { +static int a26_cas_output_byte( int16_t **buffer, uint8_t byte ) { int size = 0; int i; @@ -61,14 +61,14 @@ static int a26_cas_output_byte( INT16 **buffer, UINT8 byte ) { return size; } -static int a26_cas_clearing_tone( INT16 **buffer ) { +static int a26_cas_clearing_tone( int16_t **buffer ) { int size = 0; size += a26_cas_output_wave( buffer, 0, 44100 ); return size; } -static int a26_cas_zeros_ones( INT16 **buffer ) { +static int a26_cas_zeros_ones( int16_t **buffer ) { int size = 0; int i; @@ -81,7 +81,7 @@ static int a26_cas_zeros_ones( INT16 **buffer ) { return size; } -static int a26_cas_output_contents( INT16 **buffer, const UINT8 *bytes ) { +static int a26_cas_output_contents( int16_t **buffer, const uint8_t *bytes ) { int size = 0; int i, pages, j; @@ -104,7 +104,7 @@ static int a26_cas_output_contents( INT16 **buffer, const UINT8 *bytes ) { return size; } -static int a26_cas_do_work( INT16 **buffer, const UINT8 *bytes ) { +static int a26_cas_do_work( int16_t **buffer, const uint8_t *bytes ) { int size = 0; /* Output clearing tone */ @@ -122,13 +122,13 @@ static int a26_cas_do_work( INT16 **buffer, const UINT8 *bytes ) { return size; } -static int a26_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) { - INT16 *p = buffer; +static int a26_cas_fill_wave( int16_t *buffer, int length, uint8_t *bytes ) { + int16_t *p = buffer; - return a26_cas_do_work( &p, (const UINT8 *)bytes ); + return a26_cas_do_work( &p, (const uint8_t *)bytes ); } -static int a26_cas_to_wav_size( const UINT8 *casdata, int caslen ) { +static int a26_cas_to_wav_size( const uint8_t *casdata, int caslen ) { return a26_cas_do_work( nullptr, casdata ); } @@ -143,7 +143,7 @@ static const struct CassetteLegacyWaveFiller a26_legacy_fill_wave = { }; static cassette_image::error a26_cassette_identify( cassette_image *cassette, struct CassetteOptions *opts ) { - UINT64 size; + uint64_t size; size = cassette_image_size( cassette ); if ( size == A26_CAS_SIZE ) { diff --git a/src/lib/formats/ace_tap.cpp b/src/lib/formats/ace_tap.cpp index 6d0e4ad2c6e..56b4bd877c8 100644 --- a/src/lib/formats/ace_tap.cpp +++ b/src/lib/formats/ace_tap.cpp @@ -26,7 +26,7 @@ static int cas_size; /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -static inline int ace_tap_cycle(INT16 *buffer, int sample_pos, int high, int low) +static inline int ace_tap_cycle(int16_t *buffer, int sample_pos, int high, int low) { int i = 0; @@ -48,7 +48,7 @@ static inline int ace_tap_cycle(INT16 *buffer, int sample_pos, int high, int low } -static inline int ace_tap_silence(INT16 *buffer, int sample_pos, int samples) +static inline int ace_tap_silence(int16_t *buffer, int sample_pos, int samples) { int i = 0; @@ -64,7 +64,7 @@ static inline int ace_tap_silence(INT16 *buffer, int sample_pos, int samples) } -static inline int ace_tap_byte(INT16 *buffer, int sample_pos, UINT8 data) +static inline int ace_tap_byte(int16_t *buffer, int sample_pos, uint8_t data) { int i, samples; @@ -82,7 +82,7 @@ static inline int ace_tap_byte(INT16 *buffer, int sample_pos, UINT8 data) } -static int ace_handle_tap(INT16 *buffer, const UINT8 *casdata) +static int ace_handle_tap(int16_t *buffer, const uint8_t *casdata) { int data_pos, sample_count; @@ -97,7 +97,7 @@ static int ace_handle_tap(INT16 *buffer, const UINT8 *casdata) while( data_pos < cas_size ) { - UINT16 block_size; + uint16_t block_size; int i; /* Handle a block of tape data */ @@ -138,7 +138,7 @@ static int ace_handle_tap(INT16 *buffer, const UINT8 *casdata) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int ace_tap_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int ace_tap_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return ace_handle_tap( buffer, bytes ); } @@ -147,7 +147,7 @@ static int ace_tap_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) /******************************************************************* Calculate the number of samples needed for this tape image ********************************************************************/ -static int ace_tap_to_wav_size(const UINT8 *casdata, int caslen) +static int ace_tap_to_wav_size(const uint8_t *casdata, int caslen) { cas_size = caslen; diff --git a/src/lib/formats/ace_tap.h b/src/lib/formats/ace_tap.h index 27a1e93129d..0113fdf6484 100644 --- a/src/lib/formats/ace_tap.h +++ b/src/lib/formats/ace_tap.h @@ -16,14 +16,14 @@ #if 0 struct ace_tape_t { - UINT8 hdr_type; - UINT8 hdr_name[10]; - UINT16 hdr_len; - UINT16 hdr_addr; - UINT8 hdr_vars[8]; - UINT8 hdr_3c4c; - UINT8 hdr_3c4d; - UINT16 dat_len; + uint8_t hdr_type; + uint8_t hdr_name[10]; + uint16_t hdr_len; + uint16_t hdr_addr; + uint8_t hdr_vars[8]; + uint8_t hdr_3c4c; + uint8_t hdr_3c4d; + uint16_t dat_len; }; #endif diff --git a/src/lib/formats/acorn_dsk.cpp b/src/lib/formats/acorn_dsk.cpp index e8e0289ead1..b880b28018f 100644 --- a/src/lib/formats/acorn_dsk.cpp +++ b/src/lib/formats/acorn_dsk.cpp @@ -29,23 +29,23 @@ const char *acorn_ssd_format::extensions() const return "ssd,bbc,img"; } -int acorn_ssd_format::find_size(io_generic *io, UINT32 form_factor) +int acorn_ssd_format::find_size(io_generic *io, uint32_t form_factor) { - UINT8 cat[8]; - UINT32 sectors0, sectors2; + uint8_t cat[8]; + uint32_t sectors0, sectors2; // read sector count from side 0 catalogue io_generic_read(io, cat, 0x100, 8); sectors0 = ((cat[6] & 3) << 8) + cat[7]; LOG_FORMATS("ssd: sector count 0: %d %s\n", sectors0, sectors0 % 10 != 0 ? "invalid" : ""); - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for(int i=0; formats[i].form_factor; i++) { const format &f = formats[i]; if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor) continue; - if ((size <= (UINT64)compute_track_size(f) * f.track_count * f.head_count) && (sectors0 <= f.track_count * f.sector_count)) { + if ((size <= (uint64_t)compute_track_size(f) * f.track_count * f.head_count) && (sectors0 <= f.track_count * f.sector_count)) { if (f.head_count == 2) { // read sector count from side 2 catalogue @@ -66,7 +66,7 @@ int acorn_ssd_format::find_size(io_generic *io, UINT32 form_factor) return -1; } -int acorn_ssd_format::identify(io_generic *io, UINT32 form_factor) +int acorn_ssd_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -124,23 +124,23 @@ const char *acorn_dsd_format::extensions() const return "dsd"; } -int acorn_dsd_format::find_size(io_generic *io, UINT32 form_factor) +int acorn_dsd_format::find_size(io_generic *io, uint32_t form_factor) { - UINT8 cat[8]; - UINT32 sectors0, sectors2; + uint8_t cat[8]; + uint32_t sectors0, sectors2; // read sector count from side 0 catalogue io_generic_read(io, cat, 0x100, 8); sectors0 = ((cat[6] & 3) << 8) + cat[7]; LOG_FORMATS("dsd: sector count 0: %d %s\n", sectors0, sectors0 % 10 != 0 ? "invalid" : ""); - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for (int i = 0; formats[i].form_factor; i++) { const format &f = formats[i]; if (form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor) continue; - if ((size <= (UINT64)compute_track_size(f) * f.track_count * f.head_count) && (sectors0 <= f.track_count * f.sector_count)) { + if ((size <= (uint64_t)compute_track_size(f) * f.track_count * f.head_count) && (sectors0 <= f.track_count * f.sector_count)) { // read sector count from side 2 catalogue io_generic_read(io, cat, 0xb00, 8); // interleaved sectors2 = ((cat[6] & 3) << 8) + cat[7]; @@ -154,7 +154,7 @@ int acorn_dsd_format::find_size(io_generic *io, UINT32 form_factor) return -1; } -int acorn_dsd_format::identify(io_generic *io, UINT32 form_factor) +int acorn_dsd_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -204,23 +204,23 @@ const char *opus_ddos_format::extensions() const return "dds"; } -int opus_ddos_format::find_size(io_generic *io, UINT32 form_factor) +int opus_ddos_format::find_size(io_generic *io, uint32_t form_factor) { - UINT8 cat[8]; - UINT32 sectors0, sectors2; + uint8_t cat[8]; + uint32_t sectors0, sectors2; // read sector count from side 0 catalogue io_generic_read(io, cat, 0x1000, 8); sectors0 = (cat[1] << 8) + cat[2]; LOG_FORMATS("ddos: sector count 0: %d %s\n", sectors0, sectors0 % 18 != 0 ? "invalid" : ""); - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for (int i = 0; formats[i].form_factor; i++) { const format &f = formats[i]; if (form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor) continue; - if ((size <= (UINT64)compute_track_size(f) * f.track_count * f.head_count) && (sectors0 <= f.track_count * f.sector_count)) { + if ((size <= (uint64_t)compute_track_size(f) * f.track_count * f.head_count) && (sectors0 <= f.track_count * f.sector_count)) { if (f.head_count == 2) { // read sector count from side 2 catalogue @@ -241,7 +241,7 @@ int opus_ddos_format::find_size(io_generic *io, UINT32 form_factor) return -1; } -int opus_ddos_format::identify(io_generic *io, UINT32 form_factor) +int opus_ddos_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -299,11 +299,11 @@ const char *acorn_adfs_old_format::extensions() const return "adf,ads,adm,adl"; } -int acorn_adfs_old_format::find_size(io_generic *io, UINT32 form_factor) +int acorn_adfs_old_format::find_size(io_generic *io, uint32_t form_factor) { - UINT8 map[3]; - UINT32 sectors; - UINT8 oldmap[4]; + uint8_t map[3]; + uint32_t sectors; + uint8_t oldmap[4]; // read sector count from free space map io_generic_read(io, map, 0xfc, 3); @@ -314,14 +314,14 @@ int acorn_adfs_old_format::find_size(io_generic *io, UINT32 form_factor) io_generic_read(io, oldmap, 0x201, 4); LOG_FORMATS("adfs_o: map identifier %s %s\n", oldmap, memcmp(oldmap, "Hugo", 4) != 0 ? "invalid" : ""); - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for(int i=0; formats[i].form_factor; i++) { const format &f = formats[i]; if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor) continue; // valid images will have map identifier 'Hugo' and sector counts adfs-s = 0x280; adfs-m = 0x500; adfs-l = 0xa00; though many adfs-s images are incorrect - if ((size <= (UINT64)compute_track_size(f) * f.track_count * f.head_count) && memcmp(oldmap, "Hugo", 4) == 0 && (sectors == 0x280 || sectors == 0x500 || sectors == 0xa00 || size == 819200)) { + if ((size <= (uint64_t)compute_track_size(f) * f.track_count * f.head_count) && memcmp(oldmap, "Hugo", 4) == 0 && (sectors == 0x280 || sectors == 0x500 || sectors == 0xa00 || size == 819200)) { return i; } } @@ -329,7 +329,7 @@ int acorn_adfs_old_format::find_size(io_generic *io, UINT32 form_factor) return -1; } -int acorn_adfs_old_format::identify(io_generic *io, UINT32 form_factor) +int acorn_adfs_old_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -395,10 +395,10 @@ const char *acorn_adfs_new_format::extensions() const return "adf"; } -int acorn_adfs_new_format::find_size(io_generic *io, UINT32 form_factor) +int acorn_adfs_new_format::find_size(io_generic *io, uint32_t form_factor) { - UINT8 dform[4]; - UINT8 eform[4]; + uint8_t dform[4]; + uint8_t eform[4]; // read map identifiers for D and E formats io_generic_read(io, dform, 0x401, 4); @@ -406,14 +406,14 @@ int acorn_adfs_new_format::find_size(io_generic *io, UINT32 form_factor) io_generic_read(io, eform, 0x801, 4); LOG_FORMATS("adfs_n: map identifier (E format) %s %s\n", eform, memcmp(eform, "Nick", 4) != 0 ? "invalid" : ""); - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for (int i = 0; formats[i].form_factor; i++) { const format &f = formats[i]; if (form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor) continue; // valid images will have map identifier Nick - if ((size == (UINT64)compute_track_size(f) * f.track_count * f.head_count) && (memcmp(dform, "Nick", 4) == 0 || memcmp(eform, "Nick", 4) == 0)) { + if ((size == (uint64_t)compute_track_size(f) * f.track_count * f.head_count) && (memcmp(dform, "Nick", 4) == 0 || memcmp(eform, "Nick", 4) == 0)) { return i; } } @@ -421,7 +421,7 @@ int acorn_adfs_new_format::find_size(io_generic *io, UINT32 form_factor) return -1; } -int acorn_adfs_new_format::identify(io_generic *io, UINT32 form_factor) +int acorn_adfs_new_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -471,18 +471,18 @@ const char *acorn_dos_format::extensions() const return "img,adl"; } -int acorn_dos_format::find_size(io_generic *io, UINT32 form_factor) +int acorn_dos_format::find_size(io_generic *io, uint32_t form_factor) { - UINT8 cat[3]; - UINT32 sectors; + uint8_t cat[3]; + uint32_t sectors; - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for(int i=0; formats[i].form_factor; i++) { const format &f = formats[i]; if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor) continue; - if (size == (UINT64)compute_track_size(f) * f.track_count * f.head_count) { + if (size == (uint64_t)compute_track_size(f) * f.track_count * f.head_count) { switch (size) { case 640 * 1024: // 640K Acorn (Bootable) DOS Format @@ -513,7 +513,7 @@ int acorn_dos_format::find_size(io_generic *io, UINT32 form_factor) return -1; } -int acorn_dos_format::identify(io_generic *io, UINT32 form_factor) +int acorn_dos_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -567,9 +567,9 @@ const char *acorn_cpm_format::extensions() const return "img,ssd,dsd"; } -int acorn_cpm_format::identify(io_generic *io, UINT32 form_factor) +int acorn_cpm_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 h[8]; + uint8_t h[8]; io_generic_read(io, h, 0, 8); @@ -627,7 +627,7 @@ const char *torch_cpn_format::extensions() const return "dsd"; } -int torch_cpn_format::identify(io_generic *io, UINT32 form_factor) +int torch_cpn_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); diff --git a/src/lib/formats/acorn_dsk.h b/src/lib/formats/acorn_dsk.h index 8982169a31b..76d4462b01d 100644 --- a/src/lib/formats/acorn_dsk.h +++ b/src/lib/formats/acorn_dsk.h @@ -20,8 +20,8 @@ class acorn_ssd_format : public wd177x_format public: acorn_ssd_format(); - virtual int find_size(io_generic *io, UINT32 form_factor) override; - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int find_size(io_generic *io, uint32_t form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual int get_image_offset(const format &f, int head, int track) override; virtual const char *name() const override; virtual const char *description() const override; @@ -36,8 +36,8 @@ class acorn_dsd_format : public wd177x_format public: acorn_dsd_format(); - virtual int find_size(io_generic *io, UINT32 form_factor) override; - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int find_size(io_generic *io, uint32_t form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual int get_image_offset(const format &f, int head, int track) override; virtual const char *name() const override; virtual const char *description() const override; @@ -52,8 +52,8 @@ class opus_ddos_format : public wd177x_format public: opus_ddos_format(); - virtual int find_size(io_generic *io, UINT32 form_factor) override; - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int find_size(io_generic *io, uint32_t form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual int get_image_offset(const format &f, int head, int track) override; virtual const char *name() const override; virtual const char *description() const override; @@ -68,8 +68,8 @@ class acorn_adfs_old_format : public wd177x_format public: acorn_adfs_old_format(); - virtual int find_size(io_generic *io, UINT32 form_factor) override; - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int find_size(io_generic *io, uint32_t form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual int get_image_offset(const format &f, int head, int track) override; virtual const char *name() const override; virtual const char *description() const override; @@ -84,8 +84,8 @@ class acorn_adfs_new_format : public wd177x_format public: acorn_adfs_new_format(); - virtual int find_size(io_generic *io, UINT32 form_factor) override; - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int find_size(io_generic *io, uint32_t form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual int get_image_offset(const format &f, int head, int track) override; virtual const char *name() const override; virtual const char *description() const override; @@ -100,8 +100,8 @@ class acorn_dos_format : public wd177x_format public: acorn_dos_format(); - virtual int find_size(io_generic *io, UINT32 form_factor) override; - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int find_size(io_generic *io, uint32_t form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual int get_image_offset(const format &f, int head, int track) override; virtual const char *name() const override; virtual const char *description() const override; @@ -116,7 +116,7 @@ class acorn_cpm_format : public wd177x_format public: acorn_cpm_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual int get_image_offset(const format &f, int head, int track) override; virtual const char *name() const override; virtual const char *description() const override; @@ -131,7 +131,7 @@ class torch_cpn_format : public wd177x_format public: torch_cpn_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual int get_image_offset(const format &f, int head, int track) override; virtual const char *name() const override; virtual const char *description() const override; diff --git a/src/lib/formats/adam_cas.cpp b/src/lib/formats/adam_cas.cpp index 30deb27a1a9..3de9413cb90 100644 --- a/src/lib/formats/adam_cas.cpp +++ b/src/lib/formats/adam_cas.cpp @@ -83,10 +83,10 @@ cassette_image::error coladam_put_byte(cassette_image *cass, int channel, double return err; } -cassette_image::error coladam_put_block(cassette_image *cass, int channel, double *time_index, int *prev_sign, int block_index, UINT8 *buffer, int layout_type) +cassette_image::error coladam_put_block(cassette_image *cass, int channel, double *time_index, int *prev_sign, int block_index, uint8_t *buffer, int layout_type) { int i, checksum_16=0; - UINT8 header[] = { 0x16, 0x48, 0x45, 0x00, static_cast(block_index), 0xff, static_cast(0xff - block_index), 0x00, 0x80, 0xf4 }; + uint8_t header[] = { 0x16, 0x48, 0x45, 0x00, static_cast(block_index), 0xff, static_cast(0xff - block_index), 0x00, 0x80, 0xf4 }; cassette_image::error err; if (layout_type == TYPE_GW) { @@ -130,7 +130,7 @@ static cassette_image::error coladam_ddp_load( cassette_image *cass ) { double time = 0.; int i, block, prev_sign=-1; - UINT8 buffer[0x400]; + uint8_t buffer[0x400]; cassette_image::error err = cassette_image::error::SUCCESS; // It would appear that data packs that originally had the type GW data layout and headers work fine when converted to type diff --git a/src/lib/formats/afs_dsk.cpp b/src/lib/formats/afs_dsk.cpp index 5e1ff5aa66c..dc952b60181 100644 --- a/src/lib/formats/afs_dsk.cpp +++ b/src/lib/formats/afs_dsk.cpp @@ -30,7 +30,7 @@ const char *afs_format::extensions() const return "adl,img"; } -int afs_format::identify(io_generic *io, UINT32 form_factor) +int afs_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); diff --git a/src/lib/formats/afs_dsk.h b/src/lib/formats/afs_dsk.h index e8e7190f7cd..e9afc3e699f 100644 --- a/src/lib/formats/afs_dsk.h +++ b/src/lib/formats/afs_dsk.h @@ -21,7 +21,7 @@ class afs_format : public wd177x_format public: afs_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual int get_image_offset(const format &f, int head, int track) override; virtual const char *name() const override; virtual const char *description() const override; diff --git a/src/lib/formats/ami_dsk.cpp b/src/lib/formats/ami_dsk.cpp index a222208d46d..8a757e6a4c9 100644 --- a/src/lib/formats/ami_dsk.cpp +++ b/src/lib/formats/ami_dsk.cpp @@ -36,9 +36,9 @@ bool adf_format::supports_save() const return true; } -int adf_format::identify(io_generic *io, UINT32 form_factor) +int adf_format::identify(io_generic *io, uint32_t form_factor) { - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); if ((size == 901120) || (size == 912384) || (size == 1802240)) { return 50; @@ -46,10 +46,10 @@ int adf_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool adf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool adf_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { desc_s sectors[22]; - UINT8 sectdata[512*22]; + uint8_t sectdata[512*22]; bool is_hd = false; int tracks = 80; @@ -59,7 +59,7 @@ bool adf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) sectors[i].sector_id = i; } - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); if(size == 901120) { is_hd = false; @@ -97,7 +97,7 @@ bool adf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) return true; } -UINT32 adf_format::g32(const UINT8 *trackbuf, int track_size, int pos) +uint32_t adf_format::g32(const uint8_t *trackbuf, int track_size, int pos) { if(pos >= 0 && track_size-pos >= 40) { int pp = pos >> 3; @@ -109,7 +109,7 @@ UINT32 adf_format::g32(const UINT8 *trackbuf, int track_size, int pos) (trackbuf[pp+3] << dp) | (trackbuf[pp+4] >> (8-dp)); } else { - UINT32 res = 0; + uint32_t res = 0; for(int i=0; i<32; i++) { int pp = (pos+i) % track_size; if(trackbuf[pp>>3] & (0x80 >> (pp & 7))) @@ -119,9 +119,9 @@ UINT32 adf_format::g32(const UINT8 *trackbuf, int track_size, int pos) } } -UINT32 adf_format::checksum(const UINT8 *trackbuf, int track_size, int pos, int long_count) +uint32_t adf_format::checksum(const uint8_t *trackbuf, int track_size, int pos, int long_count) { - UINT32 check = 0; + uint32_t check = 0; for(int i=0; iget_variant() == floppy_image::DSHD; @@ -145,14 +145,14 @@ bool adf_format::save(io_generic *io, floppy_image *image) if(g32(trackbuf, track_size, i) == 0x44894489 && (g32(trackbuf, track_size, i+384) & 0x55555555) == checksum(trackbuf, track_size, i+32, 10) && (g32(trackbuf, track_size, i+448) & 0x55555555) == checksum(trackbuf, track_size, i+480, 256)) { - UINT32 head = ((g32(trackbuf, track_size, i+32) & 0x55555555) << 1) | (g32(trackbuf, track_size, i+64) & 0x55555555); + uint32_t head = ((g32(trackbuf, track_size, i+32) & 0x55555555) << 1) | (g32(trackbuf, track_size, i+64) & 0x55555555); int sect = (head >> 8) & 0xff; if(sect > (hd ? 22 : 11)) continue; - UINT8 *dest = sectdata + 512*sect; + uint8_t *dest = sectdata + 512*sect; for(int j=0; j<128; j++) { - UINT32 val = ((g32(trackbuf, track_size, i+480+32*j) & 0x55555555) << 1) | (g32(trackbuf, track_size, i+4576+32*j) & 0x55555555); + uint32_t val = ((g32(trackbuf, track_size, i+480+32*j) & 0x55555555) << 1) | (g32(trackbuf, track_size, i+4576+32*j) & 0x55555555); *dest++ = val >> 24; *dest++ = val >> 16; *dest++ = val >> 8; diff --git a/src/lib/formats/ami_dsk.h b/src/lib/formats/ami_dsk.h index f10ac007d71..3fcddff023e 100644 --- a/src/lib/formats/ami_dsk.h +++ b/src/lib/formats/ami_dsk.h @@ -18,8 +18,8 @@ class adf_format : public floppy_image_format_t public: adf_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; @@ -28,8 +28,8 @@ public: virtual bool supports_save() const override; private: - static UINT32 g32(const UINT8 *trackbuf, int track_size, int pos); - static UINT32 checksum(const UINT8 *trackbuf, int track_size, int pos, int long_count); + static uint32_t g32(const uint8_t *trackbuf, int track_size, int pos); + static uint32_t checksum(const uint8_t *trackbuf, int track_size, int pos, int long_count); }; extern const floppy_format_type FLOPPY_ADF_FORMAT; diff --git a/src/lib/formats/ap2_dsk.cpp b/src/lib/formats/ap2_dsk.cpp index 774d4785735..6cba1db6757 100644 --- a/src/lib/formats/ap2_dsk.cpp +++ b/src/lib/formats/ap2_dsk.cpp @@ -22,25 +22,25 @@ /* used in for all Apple II images */ -static UINT32 apple2_get_track_size(floppy_image_legacy *floppy, int head, int track); -static int disk_decode_nib(UINT8 *data, const UINT8 *nibble, int *volume, int *track, int *sector); -static void disk_encode_nib(UINT8 *nibble, const UINT8 *data, int volume, int track, int sector); +static uint32_t apple2_get_track_size(floppy_image_legacy *floppy, int head, int track); +static int disk_decode_nib(uint8_t *data, const uint8_t *nibble, int *volume, int *track, int *sector); +static void disk_encode_nib(uint8_t *nibble, const uint8_t *data, int volume, int track, int sector); /* used in DOS/ProDOS order images */ static int apple2_do_translate_sector(floppy_image_legacy *floppy, int sector); static int apple2_po_translate_sector(floppy_image_legacy *floppy, int sector); -static floperr_t apple2_dsk_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen); -static floperr_t apple2_dsk_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen); +static floperr_t apple2_dsk_read_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, void *buffer, size_t buflen); +static floperr_t apple2_dsk_write_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, const void *buffer, size_t buflen); /* used in nibble order images */ -static floperr_t apple2_nib_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen); -static floperr_t apple2_nib_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen); +static floperr_t apple2_nib_read_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, void *buffer, size_t buflen); +static floperr_t apple2_nib_write_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, const void *buffer, size_t buflen); static floperr_t apple2_nib_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen); static floperr_t apple2_nib_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam); -static floperr_t apple2_nib_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length); +static floperr_t apple2_nib_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length); -static const UINT8 translate6[0x40] = +static const uint8_t translate6[0x40] = { 0x96, 0x97, 0x9a, 0x9b, 0x9d, 0x9e, 0x9f, 0xa6, 0xa7, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb2, 0xb3, @@ -58,11 +58,11 @@ static const UINT8 translate6[0x40] = * Utility code * ----------------------------------------------------------------------- */ -static const UINT8 *get_untranslate6_map(void) +static const uint8_t *get_untranslate6_map(void) { - static UINT8 map[256]; + static uint8_t map[256]; static int map_inited = 0; - UINT8 i; + uint8_t i; if (!map_inited) { @@ -133,8 +133,8 @@ static floperr_t apple2_general_construct(floppy_image_legacy *floppy, int flopp static FLOPPY_IDENTIFY(apple2_dsk_identify) { - UINT64 size; - UINT64 expected_size; + uint64_t size; + uint64_t expected_size; size = floppy_image_size(floppy); expected_size = APPLE2_TRACK_COUNT * APPLE2_SECTOR_COUNT * APPLE2_SECTOR_SIZE; @@ -154,7 +154,7 @@ static FLOPPY_IDENTIFY(apple2_dsk_identify) static int apple2_do_translate_sector(floppy_image_legacy *floppy, int sector) { - static const UINT8 skewing[] = + static const uint8_t skewing[] = { /* DOS order (*.do) */ 0x00, 0x07, 0x0E, 0x06, 0x0D, 0x05, 0x0C, 0x04, @@ -167,7 +167,7 @@ static int apple2_do_translate_sector(floppy_image_legacy *floppy, int sector) static int apple2_po_translate_sector(floppy_image_legacy *floppy, int sector) { - static const UINT8 skewing[] = + static const uint8_t skewing[] = { /* ProDOS order (*.po) */ 0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B, @@ -192,11 +192,11 @@ static FLOPPY_CONSTRUCT(apple2_po_construct) -static floperr_t apple2_dsk_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen) +static floperr_t apple2_dsk_read_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, void *buffer, size_t buflen) { - UINT8 sector_buffer[APPLE2_SECTOR_SIZE]; + uint8_t sector_buffer[APPLE2_SECTOR_SIZE]; int sector; - UINT8 *nibble; + uint8_t *nibble; if (buflen < APPLE2_NIBBLE_SIZE*APPLE2_SECTOR_COUNT) return FLOPPY_ERROR_INTERNAL; @@ -207,7 +207,7 @@ static floperr_t apple2_dsk_read_track(floppy_image_legacy *floppy, int head, in for (sector = 0; sector < APPLE2_SECTOR_COUNT; sector++) { - nibble = (UINT8 *)buffer; + nibble = (uint8_t *)buffer; nibble += sector * APPLE2_SMALL_NIBBLE_SIZE; floppy_read_sector(floppy, head, track, sector, 0, sector_buffer, sizeof(sector_buffer)); @@ -218,18 +218,18 @@ static floperr_t apple2_dsk_read_track(floppy_image_legacy *floppy, int head, in -static floperr_t apple2_dsk_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen) +static floperr_t apple2_dsk_write_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, const void *buffer, size_t buflen) { int sector; - UINT8 sector_buffer[APPLE2_SECTOR_SIZE]; - const UINT8 *nibble; + uint8_t sector_buffer[APPLE2_SECTOR_SIZE]; + const uint8_t *nibble; if (offset != 0) return FLOPPY_ERROR_UNSUPPORTED; for (sector = 0; sector < APPLE2_SECTOR_COUNT; sector++) { - nibble = (UINT8 *)buffer; + nibble = (uint8_t *)buffer; nibble += sector * APPLE2_SMALL_NIBBLE_SIZE; disk_decode_nib(sector_buffer, nibble, nullptr, nullptr, nullptr); @@ -247,7 +247,7 @@ static floperr_t apple2_dsk_write_track(floppy_image_legacy *floppy, int head, i static FLOPPY_IDENTIFY(apple2_nib_identify) { - UINT64 size; + uint64_t size; size = floppy_image_size(floppy); *vote = ((size == APPLE2_TRACK_COUNT * APPLE2_SECTOR_COUNT * APPLE2_NIBBLE_SIZE) || (size == (APPLE2_TRACK_COUNT + 1) * APPLE2_SECTOR_COUNT * APPLE2_NIBBLE_SIZE)) ? 100 : 0; return FLOPPY_ERROR_SUCCESS; @@ -262,7 +262,7 @@ static FLOPPY_CONSTRUCT(apple2_nib_construct) -static floperr_t apple2_nib_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen) +static floperr_t apple2_nib_read_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, void *buffer, size_t buflen) { if ((head != 0) || (track < 0) || (track > APPLE2_TRACK_COUNT)) return FLOPPY_ERROR_SEEKERROR; @@ -274,7 +274,7 @@ static floperr_t apple2_nib_read_track(floppy_image_legacy *floppy, int head, in -static floperr_t apple2_nib_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen) +static floperr_t apple2_nib_write_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, const void *buffer, size_t buflen) { if ((head != 0) || (track < 0) || (track > APPLE2_TRACK_COUNT)) return FLOPPY_ERROR_SEEKERROR; @@ -290,7 +290,7 @@ static floperr_t apple2_nib_write_track(floppy_image_legacy *floppy, int head, i * Track conversion * ----------------------------------------------------------------------- */ -static int decode_nibbyte(UINT8 *nibint, const UINT8 *nibdata) +static int decode_nibbyte(uint8_t *nibint, const uint8_t *nibdata) { if ((nibdata[0] & 0xAA) != 0xAA) return 1; @@ -304,16 +304,16 @@ static int decode_nibbyte(UINT8 *nibint, const UINT8 *nibdata) -static int disk_decode_nib(UINT8 *data, const UINT8 *nibble, int *volume, int *track, int *sector) +static int disk_decode_nib(uint8_t *data, const uint8_t *nibble, int *volume, int *track, int *sector) { - UINT8 read_volume; - UINT8 read_track; - UINT8 read_sector; - UINT8 read_checksum; + uint8_t read_volume; + uint8_t read_track; + uint8_t read_sector; + uint8_t read_checksum; int i; - UINT8 b, xorvalue, newvalue; + uint8_t b, xorvalue, newvalue; - const UINT8 *untranslate6 = get_untranslate6_map(); + const uint8_t *untranslate6 = get_untranslate6_map(); /* pick apart the volume/track/sector info and checksum */ if (decode_nibbyte(&read_volume, &nibble[10])) @@ -367,8 +367,8 @@ static int disk_decode_nib(UINT8 *data, const UINT8 *nibble, int *volume, int *t static floperr_t apple2_nib_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) { floperr_t err; - const UINT8 *nibble; - UINT8 *track_data; + const uint8_t *nibble; + uint8_t *track_data; void *track_data_v; if ((sector < 0) || (sector >= APPLE2_SECTOR_COUNT)) @@ -379,11 +379,11 @@ static floperr_t apple2_nib_read_sector(floppy_image_legacy *floppy, int head, i err = floppy_load_track(floppy, head, track, FALSE, &track_data_v, nullptr); if (err) return err; - track_data = (UINT8 *) track_data_v; + track_data = (uint8_t *) track_data_v; nibble = track_data + (sector * APPLE2_NIBBLE_SIZE); - if (disk_decode_nib((UINT8 *)buffer, nibble, nullptr, nullptr, nullptr)) + if (disk_decode_nib((uint8_t *)buffer, nibble, nullptr, nullptr, nullptr)) return FLOPPY_ERROR_INVALIDIMAGE; return FLOPPY_ERROR_SUCCESS; @@ -391,7 +391,7 @@ static floperr_t apple2_nib_read_sector(floppy_image_legacy *floppy, int head, i -static void disk_encode_nib(UINT8 *nibble, const UINT8 *data, int volume, int track, int sector) +static void disk_encode_nib(uint8_t *nibble, const uint8_t *data, int volume, int track, int sector) { int checksum, oldvalue, xorvalue, i; @@ -457,7 +457,7 @@ static void disk_encode_nib(UINT8 *nibble, const UINT8 *data, int volume, int tr static floperr_t apple2_nib_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam) { floperr_t err; - UINT8 *track_data; + uint8_t *track_data; void *track_data_v; if ((sector < 0) || (sector >= APPLE2_SECTOR_COUNT)) @@ -468,15 +468,15 @@ static floperr_t apple2_nib_write_sector(floppy_image_legacy *floppy, int head, err = floppy_load_track(floppy, head, track, TRUE, &track_data_v, nullptr); if (err) return err; - track_data = (UINT8 *) track_data_v; + track_data = (uint8_t *) track_data_v; - disk_encode_nib(track_data + sector * APPLE2_NIBBLE_SIZE, (const UINT8 *)buffer, 254, track, sector); + disk_encode_nib(track_data + sector * APPLE2_NIBBLE_SIZE, (const uint8_t *)buffer, 254, track, sector); return FLOPPY_ERROR_SUCCESS; } -static floperr_t apple2_nib_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t apple2_nib_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { *sector_length = APPLE2_SECTOR_SIZE; return FLOPPY_ERROR_SUCCESS; @@ -484,7 +484,7 @@ static floperr_t apple2_nib_get_sector_length(floppy_image_legacy *floppy, int h -static UINT32 apple2_get_track_size(floppy_image_legacy *floppy, int head, int track) +static uint32_t apple2_get_track_size(floppy_image_legacy *floppy, int head, int track) { return APPLE2_NIBBLE_SIZE * APPLE2_SECTOR_COUNT; } @@ -522,13 +522,13 @@ LEGACY_FLOPPY_OPTIONS_END ****************************************************************************/ -static const UINT8 dos_skewing[] = +static const uint8_t dos_skewing[] = { 0x00, 0x07, 0x0E, 0x06, 0x0D, 0x05, 0x0C, 0x04, 0x0B, 0x03, 0x0A, 0x02, 0x09, 0x01, 0x08, 0x0F }; -static const UINT8 prodos_skewing[] = +static const uint8_t prodos_skewing[] = { 0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B, 0x04, 0x0C, 0x05, 0x0D, 0x06, 0x0E, 0x07, 0x0F @@ -559,10 +559,10 @@ bool a2_16sect_format::supports_save() const return true; } -int a2_16sect_format::identify(io_generic *io, UINT32 form_factor) +int a2_16sect_format::identify(io_generic *io, uint32_t form_factor) { - UINT64 size = io_generic_size(io); - UINT32 expected_size = 35 * 16 * 256; + uint64_t size = io_generic_size(io); + uint32_t expected_size = 35 * 16 * 256; // check standard size plus some oddball sizes in our softlist if ((size == expected_size) || (size == 143403) || (size == 143363) || (size == 143358)) @@ -603,14 +603,14 @@ const floppy_image_format_t::desc_e a2_16sect_format::mac_gcr[] = { { END }, }; -bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool a2_16sect_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { m_prodos_order = false; int fpos = 0; for(int track=0; track < 35; track++) { - std::vector track_data; - UINT8 sector_data[256*16]; + std::vector track_data; + uint8_t sector_data[256*16]; static const unsigned char pascal_block1[4] = { 0x08, 0xa5, 0x0f, 0x29 }; static const unsigned char pascal2_block1[4] = { 0xff, 0xa2, 0x00, 0x8e }; static const unsigned char dos33_block1[4] = { 0xa2, 0x02, 0x8e, 0x52 }; @@ -682,7 +682,7 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im sector = dos_skewing[i]; } - const UINT8 *sdata = sector_data + 256 * sector; + const uint8_t *sdata = sector_data + 256 * sector; for(int j=0; j<20; j++) raw_w(track_data, 10, 0x3fc); raw_w(track_data, 8, 0xff); @@ -700,9 +700,9 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im raw_w(track_data, 24, 0xd5aaad); raw_w(track_data, 1, 0); - UINT8 pval = 0x00; + uint8_t pval = 0x00; for(int i=0; i<342; i++) { - UINT8 nval; + uint8_t nval; if(i >= 0x56) nval = sdata[i - 0x56] >> 2; else { @@ -730,9 +730,9 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im return true; } -UINT8 a2_16sect_format::gb(const UINT8 *buf, int ts, int &pos, int &wrap) +uint8_t a2_16sect_format::gb(const uint8_t *buf, int ts, int &pos, int &wrap) { - UINT8 v = 0; + uint8_t v = 0; int w1 = wrap; while(wrap != w1+2 && !(v & 0x80)) { v = v << 1 | ((buf[pos >> 3] >> (7-(pos & 7))) & 1); @@ -745,7 +745,7 @@ UINT8 a2_16sect_format::gb(const UINT8 *buf, int ts, int &pos, int &wrap) return v; } -void a2_16sect_format::update_chk(const UINT8 *data, int size, UINT32 &chk) +void a2_16sect_format::update_chk(const uint8_t *data, int size, uint32_t &chk) { } @@ -786,10 +786,10 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image) int pos_data = 0; for(int track=0; track < 35; track++) { - UINT8 sectdata[(256)*16]; + uint8_t sectdata[(256)*16]; memset(sectdata, 0, sizeof(sectdata)); int nsect = 16; - UINT8 buf[10000]; // normal is 51090 cells, e.g. 6387 bytes, add 50% and round up for denser than normal disks + uint8_t buf[10000]; // normal is 51090 cells, e.g. 6387 bytes, add 50% and round up for denser than normal disks int ts; #ifdef VERBOSE_SAVE fprintf(stderr,"DEBUG: a2_16sect_format::save() about to generate bitstream from track %d...", track); @@ -803,7 +803,7 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image) int hb = 0; int dosver = 0; // apple dos version; 0 = >=3.3, 1 = <3.3 for(;;) { - UINT8 v = gb(buf, ts, pos, wrap); + uint8_t v = gb(buf, ts, pos, wrap); if(v == 0xff) { hb = 1; } @@ -821,16 +821,16 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image) hb = 0; if(hb == 4) { - UINT8 h[11]; + uint8_t h[11]; for(auto & elem : h) elem = gb(buf, ts, pos, wrap); - //UINT8 v2 = gcr6bw_tb[h[2]]; - UINT8 vl = gcr4_decode(h[0],h[1]); - UINT8 tr = gcr4_decode(h[2],h[3]); - UINT8 se = gcr4_decode(h[4],h[5]); - UINT8 chk = gcr4_decode(h[6],h[7]); + //uint8_t v2 = gcr6bw_tb[h[2]]; + uint8_t vl = gcr4_decode(h[0],h[1]); + uint8_t tr = gcr4_decode(h[2],h[3]); + uint8_t se = gcr4_decode(h[4],h[5]); + uint8_t chk = gcr4_decode(h[6],h[7]); #ifdef VERBOSE_SAVE - UINT32 post = (h[8]<<16)|(h[9]<<8)|h[10]; + uint32_t post = (h[8]<<16)|(h[9]<<8)|h[10]; printf("Address Mark:\tVolume %d, Track %d, Sector %2d, Checksum %02X: %s, Postamble %03X: %s\n", vl, tr, se, chk, (chk ^ vl ^ tr ^ se)==0?"OK":"BAD", post, (post&0xFFFF00)==0xDEAA00?"OK":"BAD"); #endif // sanity check @@ -860,10 +860,10 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image) } if((hb == 4)&&(dosver == 0)) { visualgrid[se][track] |= DATAFOUND; - UINT8 *dest; - UINT8 data[0x157]; - UINT32 dpost = 0; - UINT8 c = 0; + uint8_t *dest; + uint8_t data[0x157]; + uint32_t dpost = 0; + uint8_t c = 0; if (m_prodos_order) { @@ -889,7 +889,7 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image) dpost |= gb(buf, ts, pos, wrap); } // next combine in the upper 2 bits of each byte - UINT8 bit_swap[4] = { 0, 2, 1, 3 }; + uint8_t bit_swap[4] = { 0, 2, 1, 3 }; for(int i=0; i<0x56; i++) data[i+0x056] = data[i+0x056]<<2 | bit_swap[data[i]&3]; for(int i=0; i<0x56; i++) @@ -913,7 +913,7 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image) (((data[0x156] != c) && (dpost&0xFFFF00)!=0xDEAA00) && (((visualgrid[se][track]&DATAGOOD)==0)&&(visualgrid[se][track]&DATAPOST)==0)) ) { for(int i=0x56; i<0x156; i++) { - UINT8 dv = data[i]; + uint8_t dv = data[i]; *dest++ = dv; } } @@ -921,7 +921,7 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image) #else if ((visualgrid[se][track]&DATAGOOD)==0) { for(int i=0x56; i<0x156; i++) { - UINT8 dv = data[i]; + uint8_t dv = data[i]; *dest++ = dv; } } @@ -948,7 +948,7 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image) } for(int i=0; i0) printf("t%d,", track); - UINT8 *data = sectdata + (256)*i; + uint8_t *data = sectdata + (256)*i; io_generic_write(io, data, pos_data, 256); pos_data += 256; } @@ -1029,10 +1029,10 @@ bool a2_rwts18_format::supports_save() const return true; } -int a2_rwts18_format::identify(io_generic *io, UINT32 form_factor) +int a2_rwts18_format::identify(io_generic *io, uint32_t form_factor) { - UINT64 size = io_generic_size(io); - UINT32 expected_size = 35 * 16 * 256; + uint64_t size = io_generic_size(io); + uint32_t expected_size = 35 * 16 * 256; return size == expected_size; } @@ -1067,10 +1067,10 @@ const floppy_image_format_t::desc_e a2_rwts18_format::mac_gcr[] = { }; -bool a2_rwts18_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool a2_rwts18_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { /* TODO: rewrite me properly - UINT8 sector_data[(256)*16]; + uint8_t sector_data[(256)*16]; memset(sector_data, 0, sizeof(sector_data)); desc_s sectors[16]; @@ -1082,7 +1082,7 @@ bool a2_rwts18_format::load(io_generic *io, UINT32 form_factor, floppy_image *im for(int track=0; track < 35; track++) { for(int head=0; head < head_count; head++) { for(int si=0; si<16; si++) { - UINT8 *data = sector_data + (256)*si; + uint8_t *data = sector_data + (256)*si; sectors[si].data = data; sectors[si].size = 256; sectors[si].sector_id = si; @@ -1097,9 +1097,9 @@ bool a2_rwts18_format::load(io_generic *io, UINT32 form_factor, floppy_image *im return false; // I hope that throws an error... } -UINT8 a2_rwts18_format::gb(const UINT8 *buf, int ts, int &pos, int &wrap) +uint8_t a2_rwts18_format::gb(const uint8_t *buf, int ts, int &pos, int &wrap) { - UINT8 v = 0; + uint8_t v = 0; int w1 = wrap; while(wrap != w1+2 && !(v & 0x80)) { v = v << 1 | ((buf[pos >> 3] >> (7-(pos & 7))) & 1); @@ -1112,7 +1112,7 @@ UINT8 a2_rwts18_format::gb(const UINT8 *buf, int ts, int &pos, int &wrap) return v; } -void a2_rwts18_format::update_chk(const UINT8 *data, int size, UINT32 &chk) +void a2_rwts18_format::update_chk(const uint8_t *data, int size, uint32_t &chk) { } @@ -1152,10 +1152,10 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) int pos_data = 0; // for track 0 ONLY: - UINT8 sectdata[(768)*6]; + uint8_t sectdata[(768)*6]; memset(sectdata, 0, sizeof(sectdata)); int nsect = 18; - UINT8 buf[130000]; // originally 13000, multiread dfi disks need larger + uint8_t buf[130000]; // originally 13000, multiread dfi disks need larger int ts; //fprintf(stderr,"DEBUG: a2_rwts18_format::save() about to generate bitstream from physical track %d (logical %d)...", track, track/2); //~332 samples per cell, times 3+8+3 (14) for address mark, 24 for sync, 3+343+3 (349) for data mark, 24 for sync is around 743, near 776 expected @@ -1166,7 +1166,7 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) int hb = 0; int dosver = 0; // apple dos version; 0 = >=3.3, 1 = <3.3 for(;;) { - UINT8 v = gb(buf, ts, pos, wrap); + uint8_t v = gb(buf, ts, pos, wrap); if(v == 0xff) hb = 1; else if(hb == 1 && v == 0xd5) @@ -1181,15 +1181,15 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) hb = 0; if(hb == 4) { - UINT8 h[11]; + uint8_t h[11]; for(auto & elem : h) elem = gb(buf, ts, pos, wrap); - //UINT8 v2 = gcr6bw_tb[h[2]]; - UINT8 vl = gcr4_decode(h[0],h[1]); - UINT8 tr = gcr4_decode(h[2],h[3]); - UINT8 se = gcr4_decode(h[4],h[5]); - UINT8 chk = gcr4_decode(h[6],h[7]); - UINT32 post = (h[8]<<16)|(h[9]<<8)|h[10]; + //uint8_t v2 = gcr6bw_tb[h[2]]; + uint8_t vl = gcr4_decode(h[0],h[1]); + uint8_t tr = gcr4_decode(h[2],h[3]); + uint8_t se = gcr4_decode(h[4],h[5]); + uint8_t chk = gcr4_decode(h[6],h[7]); + uint32_t post = (h[8]<<16)|(h[9]<<8)|h[10]; printf("Address Mark:\tVolume %d, Track %d, Sector %2d, Checksum %02X: %s, Postamble %03X: %s\n", vl, tr, se, chk, (chk ^ vl ^ tr ^ se)==0?"OK":"BAD", post, (post&0xFFFF00)==0xDEAA00?"OK":"BAD"); // sanity check if (tr == 0 && se < nsect) { @@ -1233,10 +1233,10 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) 0x04, 0x0C, 0x05, 0x0D, 0x06, 0x0E, 0x07, 0x0F #endif }; - UINT8 *dest = sectdata+(256)*sector_translate[se]; - UINT8 data[0x157]; - UINT32 dpost = 0; - UINT8 c = 0; + uint8_t *dest = sectdata+(256)*sector_translate[se]; + uint8_t data[0x157]; + uint32_t dpost = 0; + uint8_t c = 0; // first read in sector and decode to 6bit form for(int i=0; i<0x156; i++) { data[i] = gcr6bw_tb[gb(buf, ts, pos, wrap)] ^ c; @@ -1252,7 +1252,7 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) dpost |= gb(buf, ts, pos, wrap); } // next combine in the upper 2 bits of each byte - UINT8 bit_swap[4] = { 0, 2, 1, 3 }; + uint8_t bit_swap[4] = { 0, 2, 1, 3 }; for(int i=0; i<0x56; i++) data[i+0x056] = data[i+0x056]<<2 | bit_swap[data[i]&3]; for(int i=0; i<0x56; i++) @@ -1276,7 +1276,7 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) (((data[0x156] != c) && (dpost&0xFFFF00)!=0xDEAA00) && (((visualgrid[se][0]&DATAGOOD)==0)&&(visualgrid[se][0]&DATAPOST)==0)) ) { for(int i=0x56; i<0x156; i++) { - UINT8 dv = data[i]; + uint8_t dv = data[i]; *dest++ = dv; } } @@ -1284,7 +1284,7 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) #else if ((visualgrid[se][0]&DATAGOOD)==0) { for(int i=0x56; i<0x156; i++) { - UINT8 dv = data[i]; + uint8_t dv = data[i]; *dest++ = dv; } } @@ -1309,17 +1309,17 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) } for(int i=0; i0) printf("t%d,", track); - UINT8 *data = sectdata + (256)*i; + uint8_t *data = sectdata + (256)*i; io_generic_write(io, data, pos_data, 256); pos_data += 256; } // for the rest of the tracks for(int track=2; track < 70; track+=2) { - UINT8 sectdata[(768)*6]; + uint8_t sectdata[(768)*6]; memset(sectdata, 0, sizeof(sectdata)); int nsect = 18; - UINT8 buf[130000]; // originally 13000, multiread dfi disks need larger + uint8_t buf[130000]; // originally 13000, multiread dfi disks need larger int ts; //fprintf(stderr,"DEBUG: a2_rwts18_format::save() about to generate bitstream from physical track %d (logical %d)...", track, track/2); //~332 samples per cell, times 3+8+3 (14) for address mark, 24 for sync, 3+343+3 (349) for data mark, 24 for sync is around 743, near 776 expected @@ -1330,7 +1330,7 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) int wrap = 0; int hb = 0; for(;;) { - UINT8 v = gb(buf, ts, pos, wrap); + uint8_t v = gb(buf, ts, pos, wrap); if((v == 0xff) || (v == 0x9a)) // note 0x9a varies per title! this is an LFSR? generated value intended to throw off copiers, and only appears after the track splice (before sector 5) hb = 1; else if(hb == 1 && v == 0xd5) @@ -1343,15 +1343,15 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) if(hb == 3) { printf("AM at offset: %d, relative: %d\n", pos, pos-oldpos); oldpos=pos; - UINT8 h[7]; + uint8_t h[7]; // grab exactly 7 bytes: should be Track, Sector, Checksum, AA, FF and FF and the Br0derbund Title ID for(auto & elem : h) elem = gb(buf, ts, pos, wrap); - UINT8 tr = gcr6bw_tb[h[0]]; - UINT8 se = gcr6bw_tb[h[1]]; - UINT8 chk = gcr6bw_tb[h[2]]; - UINT32 post = (h[3]<<16)|(h[4]<<8)|h[5]; - UINT8 bbundid = h[6]; + uint8_t tr = gcr6bw_tb[h[0]]; + uint8_t se = gcr6bw_tb[h[1]]; + uint8_t chk = gcr6bw_tb[h[2]]; + uint32_t post = (h[3]<<16)|(h[4]<<8)|h[5]; + uint8_t bbundid = h[6]; printf("RWTS18 AM:\t Track %d, Sector %2d, Checksum %02X: %s, Postamble %03X: %s, BBUNDID %02x\n", tr, se, chk, (chk ^ tr ^ se)==0?"OK":"BAD", post, post==0xAAFFFF?"OK":"BAD", bbundid); // sanity check if (tr == track/2 && se < nsect) { @@ -1366,10 +1366,10 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) //int owrap = wrap; // RWTS18 doesn't have a true data mark, its part of the address header visualgrid[se][track/2] |= DATAFOUND; - UINT8 *dest = sectdata+(256)*se; - UINT8 data[0x401]; - UINT32 dpost = 0; - UINT8 c = 0; + uint8_t *dest = sectdata+(256)*se; + uint8_t data[0x401]; + uint32_t dpost = 0; + uint8_t c = 0; //dest = sectdata+(768)*se; // now read in the sector and decode to 6bit form for(int i=0; i<0x400; i++) { @@ -1429,21 +1429,21 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) data[(4*i)+1] |= (data[4*i]&0x30)<<2; //printf("%c", (data[4*i]&0x3F)+0x40); //if (((i&0xf)+1)==0x10) printf("\n"); - UINT8 dv = data[(4*i)+1]; + uint8_t dv = data[(4*i)+1]; *dest++ = dv; } // second sector: dest = sectdata+(256)*(se+6); for(int i=0; i<0x100; i++) { data[(4*i)+2] |= (data[4*i]&0x0c)<<4; - UINT8 dv = data[(4*i)+2]; + uint8_t dv = data[(4*i)+2]; *dest++ = dv; } // third sector: dest = sectdata+(256)*(se+12); for(int i=0; i<0x100; i++) { data[(4*i)+3] |= (data[4*i]&0x03)<<6; - UINT8 dv = data[(4*i)+3]; + uint8_t dv = data[(4*i)+3]; *dest++ = dv; } } @@ -1459,21 +1459,21 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) data[(4*i)+1] |= (data[4*i]&0x30)<<2; //printf("%c", (data[4*i]&0x3F)+0x40); //if (((i&0xf)+1)==0x10) printf("\n"); - UINT8 dv = data[(4*i)+1]; + uint8_t dv = data[(4*i)+1]; *dest++ = dv; } // second sector: dest = sectdata+(256)*(se+6); for(int i=0; i<0x100; i++) { data[(4*i)+2] |= (data[4*i]&0x0c)<<4; - UINT8 dv = data[(4*i)+2]; + uint8_t dv = data[(4*i)+2]; *dest++ = dv; } // third sector: dest = sectdata+(256)*(se+12); for(int i=0; i<0x100; i++) { data[(4*i)+3] |= (data[4*i]&0x03)<<6; - UINT8 dv = data[(4*i)+3]; + uint8_t dv = data[(4*i)+3]; *dest++ = dv; } } @@ -1492,7 +1492,7 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image) } for(int i=0; i0) printf("t%d,", track); - UINT8 *data = sectdata + (256)*i; + uint8_t *data = sectdata + (256)*i; io_generic_write(io, data, pos_data, 256); pos_data += 256; } @@ -1545,23 +1545,23 @@ bool a2_edd_format::supports_save() const return true; } -int a2_edd_format::identify(io_generic *io, UINT32 form_factor) +int a2_edd_format::identify(io_generic *io, uint32_t form_factor) { return ((io_generic_size(io) == 2244608) || (io_generic_size(io) == 2310144)) ? 50 : 0; } -UINT8 a2_edd_format::pick(const UINT8 *data, int pos) +uint8_t a2_edd_format::pick(const uint8_t *data, int pos) { return ((data[pos>>3] << 8) | data[(pos>>3)+1]) >> (8-(pos & 7)); } -bool a2_edd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool a2_edd_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT8 *img; - UINT8 nibble[16384], stream[16384]; + uint8_t *img; + uint8_t nibble[16384], stream[16384]; int npos[16384]; - img = (UINT8 *) malloc(2244608); + img = (uint8_t *) malloc(2244608); if (!img) { @@ -1571,11 +1571,11 @@ bool a2_edd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image io_generic_read(io, img, 0, 2244608); for(int i=0; i<137; i++) { - const UINT8 *trk = img + 16384*i; + const uint8_t *trk = img + 16384*i; int pos = 0; int wpos = 0; while(pos < 16383*8) { - UINT8 acc = pick(trk, pos); + uint8_t acc = pick(trk, pos); pos += 8; while(!(acc & 0x80) && pos < 16384*8) { acc <<= 1; @@ -1633,7 +1633,7 @@ bool a2_edd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image stream[splice >> 3] ^= 0x80 >> (splice & 7); generate_track_from_bitstream(i >> 2, 0, stream, len, image, i & 3); - image->set_write_splice_position(i >> 2, 0, UINT32(U64(200000000)*splice/len), i & 3); + image->set_write_splice_position(i >> 2, 0, uint32_t(U64(200000000)*splice/len), i & 3); } free(img); return true; diff --git a/src/lib/formats/ap2_dsk.h b/src/lib/formats/ap2_dsk.h index 19e55e05ff0..3d140ac86e9 100644 --- a/src/lib/formats/ap2_dsk.h +++ b/src/lib/formats/ap2_dsk.h @@ -39,8 +39,8 @@ class a2_16sect_format : public floppy_image_format_t public: a2_16sect_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; @@ -51,8 +51,8 @@ public: private: static const desc_e mac_gcr[]; - UINT8 gb(const UINT8 *buf, int ts, int &pos, int &wrap); - void update_chk(const UINT8 *data, int size, UINT32 &chk); + uint8_t gb(const uint8_t *buf, int ts, int &pos, int &wrap); + void update_chk(const uint8_t *data, int size, uint32_t &chk); bool m_prodos_order; }; @@ -64,8 +64,8 @@ class a2_rwts18_format : public floppy_image_format_t public: a2_rwts18_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; @@ -76,8 +76,8 @@ public: private: static const desc_e mac_gcr[]; - UINT8 gb(const UINT8 *buf, int ts, int &pos, int &wrap); - void update_chk(const UINT8 *data, int size, UINT32 &chk); + uint8_t gb(const uint8_t *buf, int ts, int &pos, int &wrap); + void update_chk(const uint8_t *data, int size, uint32_t &chk); }; extern const floppy_format_type FLOPPY_RWTS18_FORMAT; @@ -88,8 +88,8 @@ class a2_edd_format : public floppy_image_format_t public: a2_edd_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool supports_save() const override; virtual const char *name() const override; @@ -97,7 +97,7 @@ public: virtual const char *extensions() const override; private: - static UINT8 pick(const UINT8 *data, int pos); + static uint8_t pick(const uint8_t *data, int pos); }; extern const floppy_format_type FLOPPY_EDD_FORMAT; diff --git a/src/lib/formats/ap_dsk35.cpp b/src/lib/formats/ap_dsk35.cpp index baa60254b4b..38a36a956ec 100644 --- a/src/lib/formats/ap_dsk35.cpp +++ b/src/lib/formats/ap_dsk35.cpp @@ -106,21 +106,21 @@ struct apple35_tag { - UINT32 data_offset; - UINT32 data_size; - UINT8 format_byte; - UINT8 sides; + uint32_t data_offset; + uint32_t data_size; + uint8_t format_byte; + uint8_t sides; unsigned int is_1440k : 1; /* stuff used in DiskCopy images */ - UINT32 tag_offset; - UINT32 tag_size; + uint32_t tag_offset; + uint32_t tag_size; }; /* normal number of sector for each track */ -static const UINT8 apple35_tracklen_800kb[80] = +static const uint8_t apple35_tracklen_800kb[80] = { 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, @@ -130,7 +130,7 @@ static const UINT8 apple35_tracklen_800kb[80] = }; /* blocks of data used to nibblize tracks */ -static const UINT8 diskbytes[] = +static const uint8_t diskbytes[] = { 0x96, 0x97, 0x9A, 0x9B, 0x9D, 0x9E, 0x9F, 0xA6, /* 0x00 */ 0xA7, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB2, 0xB3, @@ -143,7 +143,7 @@ static const UINT8 diskbytes[] = }; /* reverse lookup of diskbytes */ -static const INT16 rev_diskbytes[] = +static const int16_t rev_diskbytes[] = { -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00 */ -1, -1, -1, -1, -1, -1, -1, -1, @@ -179,7 +179,7 @@ static const INT16 rev_diskbytes[] = -1, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F }; -static const UINT8 blk1[] = +static const uint8_t blk1[] = { /*0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -200,11 +200,11 @@ static const UINT8 blk1[] = 0xFF, 0x3F, 0xCF, 0xF3, 0xFC, 0xFF, 0xD5, 0xAA, 0x96 }; -static const UINT8 blk2[] = +static const uint8_t blk2[] = { 0xDE, 0xAA, 0xFF, 0xFF, 0x3F, 0xCF, 0xF3, 0xFC, 0xFF, 0xD5, 0xAA, 0xAD }; -static const UINT8 blk3[] = +static const uint8_t blk3[] = { 0xDE, 0xAA, 0xFF }; @@ -243,13 +243,13 @@ int apple35_sectors_per_track(floppy_image_legacy *image, int track) tag data IS important, since it allows data recovery when the catalog is trashed */ -static void sony_nibblize35(const UINT8 *in, UINT8 *nib_ptr, UINT8 *csum) +static void sony_nibblize35(const uint8_t *in, uint8_t *nib_ptr, uint8_t *csum) { int i, j; - UINT32 c1, c2, c3, c4; - UINT8 val; - UINT8 w1, w2, w3, w4; - UINT8 b1[175], b2[175], b3[175]; + uint32_t c1, c2, c3, c4; + uint8_t val; + uint8_t w1, w2, w3, w4; + uint8_t b1[175], b2[175], b3[175]; /* Copy from the user's buffer to our buffer, while computing * the three-byte data checksum @@ -327,13 +327,13 @@ static void sony_nibblize35(const UINT8 *in, UINT8 *nib_ptr, UINT8 *csum) /* does the reverse process of sony_nibblize35 */ -static void sony_denibblize35(UINT8 *out, const UINT8 *nib_ptr, UINT8 *checksum) +static void sony_denibblize35(uint8_t *out, const uint8_t *nib_ptr, uint8_t *checksum) { int i, j; - UINT32 c1,c2,c3,c4; - UINT8 val; - UINT8 w1,w2,w3=0,w4; - UINT8 b1[175],b2[175],b3[175]; + uint32_t c1,c2,c3,c4; + uint8_t val; + uint8_t w1,w2,w3=0,w4; + uint8_t b1[175],b2[175],b3[175]; j = 0; for (i=0; i<=174; i++) @@ -405,7 +405,7 @@ static void sony_denibblize35(UINT8 *out, const UINT8 *nib_ptr, UINT8 *checksum) -void sony_filltrack(UINT8 *buffer, size_t buffer_len, size_t *pos, UINT8 data) +void sony_filltrack(uint8_t *buffer, size_t buffer_len, size_t *pos, uint8_t data) { buffer[*pos / 8] &= 0xFF << (8 - (*pos % 8)); buffer[*pos / 8] |= data >> (*pos % 8); @@ -419,9 +419,9 @@ void sony_filltrack(UINT8 *buffer, size_t buffer_len, size_t *pos, UINT8 data) -UINT8 sony_fetchtrack(const UINT8 *buffer, size_t buffer_len, size_t *pos) +uint8_t sony_fetchtrack(const uint8_t *buffer, size_t buffer_len, size_t *pos) { - UINT8 data; + uint8_t data; data = buffer[*pos / 8] << (*pos % 8); *pos += 8; @@ -446,10 +446,10 @@ UINT8 sony_fetchtrack(const UINT8 *buffer, size_t buffer_len, size_t *pos) -static UINT32 apple35_get_offset(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *tag_offset) +static uint32_t apple35_get_offset(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *tag_offset) { int i; - UINT32 sector_index = 0; + uint32_t sector_index = 0; struct apple35_tag *tag; tag = get_apple35_tag(floppy); @@ -487,7 +487,7 @@ static UINT32 apple35_get_offset(floppy_image_legacy *floppy, int head, int trac static floperr_t apple35_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) { - UINT32 data_offset; + uint32_t data_offset; data_offset = apple35_get_offset(floppy, head, track, sector, nullptr); if (data_offset == ~0) { @@ -501,7 +501,7 @@ static floperr_t apple35_read_sector(floppy_image_legacy *floppy, int head, int static floperr_t apple35_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam) { - UINT32 data_offset; + uint32_t data_offset; data_offset = apple35_get_offset(floppy, head, track, sector, nullptr); if (data_offset == ~0) @@ -515,12 +515,12 @@ static floperr_t apple35_write_sector(floppy_image_legacy *floppy, int head, int static floperr_t apple35_read_sector_td(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) { floperr_t err; - UINT32 tag_offset = 0; + uint32_t tag_offset = 0; assert(buflen == 524); /* first read the sector */ - err = apple35_read_sector(floppy, head, track, sector, ((UINT8 *) buffer) + 12, 512); + err = apple35_read_sector(floppy, head, track, sector, ((uint8_t *) buffer) + 12, 512); if (err) { return err; @@ -542,12 +542,12 @@ static floperr_t apple35_read_sector_td(floppy_image_legacy *floppy, int head, i static floperr_t apple35_write_sector_td(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam) { floperr_t err; - UINT32 tag_offset = 0; + uint32_t tag_offset = 0; assert(buflen == 524); /* first write the sector */ - err = apple35_write_sector(floppy, head, track, sector, ((const UINT8 *) buffer) + 12, 512, 0); + err = apple35_write_sector(floppy, head, track, sector, ((const uint8_t *) buffer) + 12, 512, 0); if (err) return err; @@ -561,7 +561,7 @@ static floperr_t apple35_write_sector_td(floppy_image_legacy *floppy, int head, -static floperr_t apple35_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t apple35_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { *sector_length = 512; return FLOPPY_ERROR_SUCCESS; @@ -583,7 +583,7 @@ static int apple35_get_tracks_per_disk(floppy_image_legacy *floppy) -static UINT32 apple35_get_track_size(floppy_image_legacy *floppy, int head, int track) +static uint32_t apple35_get_track_size(floppy_image_legacy *floppy, int head, int track) { if ((track < 0) || (track >= 80)) return 0; @@ -592,9 +592,9 @@ static UINT32 apple35_get_track_size(floppy_image_legacy *floppy, int head, int -static UINT8 calculate_side(int head, int track) +static uint8_t calculate_side(int head, int track) { - UINT8 side; + uint8_t side; side = head ? 0x20 : 0x00; if (track & 0x40) side |= 0x01; @@ -603,16 +603,16 @@ static UINT8 calculate_side(int head, int track) -static floperr_t apple35_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen) +static floperr_t apple35_read_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, void *buffer, size_t buflen) { floperr_t err; size_t pos = 0; int sector_count, sector, i; - UINT8 sum, side; + uint8_t sum, side; struct apple35_tag *tag; - UINT8 sector_data[524]; - UINT8 nibble_data[699]; - UINT8 checksum[4]; + uint8_t sector_data[524]; + uint8_t nibble_data[699]; + uint8_t checksum[4]; tag = get_apple35_tag(floppy); @@ -637,29 +637,29 @@ static floperr_t apple35_read_track(floppy_image_legacy *floppy, int head, int t sony_nibblize35(sector_data, nibble_data, checksum); for (i = 0; i < ARRAY_LENGTH(blk1); i++) - sony_filltrack((UINT8*)buffer, buflen, &pos, blk1[i]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, blk1[i]); sum = (track ^ sector ^ side ^ tag->format_byte) & 0x3F; - sony_filltrack((UINT8*)buffer, buflen, &pos, diskbytes[track & 0x3f]); - sony_filltrack((UINT8*)buffer, buflen, &pos, diskbytes[sector]); - sony_filltrack((UINT8*)buffer, buflen, &pos, diskbytes[side]); - sony_filltrack((UINT8*)buffer, buflen, &pos, diskbytes[tag->format_byte]); - sony_filltrack((UINT8*)buffer, buflen, &pos, diskbytes[sum]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, diskbytes[track & 0x3f]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, diskbytes[sector]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, diskbytes[side]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, diskbytes[tag->format_byte]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, diskbytes[sum]); for (i = 0; i < ARRAY_LENGTH(blk2); i++) - sony_filltrack((UINT8*)buffer, buflen, &pos, blk2[i]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, blk2[i]); - sony_filltrack((UINT8*)buffer, buflen, &pos, diskbytes[sector]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, diskbytes[sector]); for (i = 0; i < ARRAY_LENGTH(nibble_data); i++) - sony_filltrack((UINT8*)buffer, buflen, &pos, diskbytes[nibble_data[i]]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, diskbytes[nibble_data[i]]); for (i = 3; i >= 0; i--) - sony_filltrack((UINT8*)buffer, buflen, &pos, diskbytes[checksum[i]]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, diskbytes[checksum[i]]); for (i = 0; i < ARRAY_LENGTH(blk3); i++) - sony_filltrack((UINT8*)buffer, buflen, &pos, blk3[i]); + sony_filltrack((uint8_t*)buffer, buflen, &pos, blk3[i]); } return FLOPPY_ERROR_SUCCESS; @@ -667,17 +667,17 @@ static floperr_t apple35_read_track(floppy_image_legacy *floppy, int head, int t -static floperr_t apple35_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen) +static floperr_t apple35_write_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, const void *buffer, size_t buflen) { floperr_t err; size_t pos = 0; int sector_count, sector, i, j; struct apple35_tag *tag; - UINT8 sum, format_byte, val, side; - UINT32 found_sectors = 0; - UINT8 sector_data[524]; - UINT8 nibble_data[699]; - UINT8 checksum[4]; + uint8_t sum, format_byte, val, side; + uint32_t found_sectors = 0; + uint8_t sector_data[524]; + uint8_t nibble_data[699]; + uint8_t checksum[4]; tag = get_apple35_tag(floppy); @@ -692,32 +692,32 @@ static floperr_t apple35_write_track(floppy_image_legacy *floppy, int head, int /* do 2 rotations, in case the bit slip stuff prevent us to read the first sector */ for (j = 0; j < (buflen * 2); j++) { - if (sony_fetchtrack((UINT8*)buffer, buflen, &pos) != 0xD5) + if (sony_fetchtrack((uint8_t*)buffer, buflen, &pos) != 0xD5) continue; j++; - if (sony_fetchtrack((UINT8*)buffer, buflen, &pos) != 0xAA) + if (sony_fetchtrack((uint8_t*)buffer, buflen, &pos) != 0xAA) continue; j++; - if (sony_fetchtrack((UINT8*)buffer, buflen, &pos) != 0x96) + if (sony_fetchtrack((uint8_t*)buffer, buflen, &pos) != 0x96) continue; j++; - if (rev_diskbytes[sony_fetchtrack((UINT8*)buffer, buflen, &pos)] != (track & 0x3F)) + if (rev_diskbytes[sony_fetchtrack((uint8_t*)buffer, buflen, &pos)] != (track & 0x3F)) continue; j++; - sector = rev_diskbytes[sony_fetchtrack((UINT8*)buffer, buflen, &pos)]; + sector = rev_diskbytes[sony_fetchtrack((uint8_t*)buffer, buflen, &pos)]; if ((sector < 0) || (sector >= sector_count)) continue; j++; - if (rev_diskbytes[sony_fetchtrack((UINT8*)buffer, buflen, &pos)] != side) + if (rev_diskbytes[sony_fetchtrack((uint8_t*)buffer, buflen, &pos)] != side) continue; j++; - format_byte = rev_diskbytes[sony_fetchtrack((UINT8*)buffer, buflen, &pos)]; + format_byte = rev_diskbytes[sony_fetchtrack((uint8_t*)buffer, buflen, &pos)]; if (format_byte != tag->format_byte) { /* this is an error, but not THAT critical, I guess */ @@ -725,52 +725,52 @@ static floperr_t apple35_write_track(floppy_image_legacy *floppy, int head, int j++; sum = track ^ sector ^ side ^ format_byte; - if (rev_diskbytes[sony_fetchtrack((UINT8*)buffer, buflen, &pos)] != sum) + if (rev_diskbytes[sony_fetchtrack((uint8_t*)buffer, buflen, &pos)] != sum) continue; j++; - if (sony_fetchtrack((UINT8*)buffer, buflen, &pos) != 0xDE) + if (sony_fetchtrack((uint8_t*)buffer, buflen, &pos) != 0xDE) continue; j++; - if (sony_fetchtrack((UINT8*)buffer, buflen, &pos) != 0xAA) + if (sony_fetchtrack((uint8_t*)buffer, buflen, &pos) != 0xAA) continue; j++; - while((val = sony_fetchtrack((UINT8*)buffer, buflen, &pos)) == 0xFF) + while((val = sony_fetchtrack((uint8_t*)buffer, buflen, &pos)) == 0xFF) j++; if (val != 0xD5) continue; /* lost bit slip mark! */ j++; - if (sony_fetchtrack((UINT8*)buffer, buflen, &pos) != 0xAA) + if (sony_fetchtrack((uint8_t*)buffer, buflen, &pos) != 0xAA) continue; j++; - if (sony_fetchtrack((UINT8*)buffer, buflen, &pos) != 0xAD) + if (sony_fetchtrack((uint8_t*)buffer, buflen, &pos) != 0xAD) continue; j++; /* should this be regarded as a critical error ??? */ - if (rev_diskbytes[sony_fetchtrack((UINT8*)buffer, buflen, &pos)] != sector) + if (rev_diskbytes[sony_fetchtrack((uint8_t*)buffer, buflen, &pos)] != sector) continue; j++; for (i = 0; i < ARRAY_LENGTH(nibble_data); i++) { - nibble_data[i] = rev_diskbytes[sony_fetchtrack((UINT8*)buffer, buflen, &pos)]; + nibble_data[i] = rev_diskbytes[sony_fetchtrack((uint8_t*)buffer, buflen, &pos)]; j++; } for (i = 3; i >= 0; i--) { /* should be checking checksum */ - sony_fetchtrack((UINT8*)buffer, buflen, &pos); + sony_fetchtrack((uint8_t*)buffer, buflen, &pos); } - sony_fetchtrack((UINT8*)buffer, buflen, &pos); /* should get 0xDE */ - sony_fetchtrack((UINT8*)buffer, buflen, &pos); /* should get 0xAA */ - sony_fetchtrack((UINT8*)buffer, buflen, &pos); /* should get 0xFF */ + sony_fetchtrack((uint8_t*)buffer, buflen, &pos); /* should get 0xDE */ + sony_fetchtrack((uint8_t*)buffer, buflen, &pos); /* should get 0xAA */ + sony_fetchtrack((uint8_t*)buffer, buflen, &pos); /* should get 0xFF */ /* did we already write this sector? */ if ((found_sectors & (1 << sector)) == 0) @@ -790,8 +790,8 @@ static floperr_t apple35_write_track(floppy_image_legacy *floppy, int head, int -static floperr_t apple35_construct(floppy_image_legacy *floppy, UINT32 data_offset, UINT32 data_size, - UINT32 tag_offset, UINT32 tag_size, INT16 format_byte, UINT8 sides, int is_1440k) +static floperr_t apple35_construct(floppy_image_legacy *floppy, uint32_t data_offset, uint32_t data_size, + uint32_t tag_offset, uint32_t tag_size, int16_t format_byte, uint8_t sides, int is_1440k) { struct apple35_tag *tag; struct FloppyCallbacks *format; @@ -820,7 +820,7 @@ static floperr_t apple35_construct(floppy_image_legacy *floppy, UINT32 data_offs tag->data_size = data_size; tag->tag_offset = tag_offset; tag->tag_size = tag_size; - tag->format_byte = (UINT8) format_byte; + tag->format_byte = (uint8_t) format_byte; tag->sides = sides; tag->is_1440k = is_1440k ? 1 : 0; @@ -843,7 +843,7 @@ static floperr_t apple35_construct(floppy_image_legacy *floppy, UINT32 data_offs static FLOPPY_IDENTIFY(apple35_raw_identify) { - UINT64 size; + uint64_t size; size = floppy_image_size(floppy); *vote = ((size == 80*1*10*512) || (size == 80*2*10*512) || (size == (80*2*18*512)+84) || (size == 80*2*18*512)) ? 100 : 0; @@ -855,8 +855,8 @@ static FLOPPY_IDENTIFY(apple35_raw_identify) static FLOPPY_CONSTRUCT(apple35_raw_construct) { - UINT64 size; - UINT8 sides; + uint64_t size; + uint8_t sides; int is_1440k; if (params) @@ -884,7 +884,7 @@ static FLOPPY_CONSTRUCT(apple35_raw_construct) return FLOPPY_ERROR_INVALIDIMAGE; } - return apple35_construct(floppy, 0, (UINT32) size, 0, 0, -1, sides, is_1440k); + return apple35_construct(floppy, 0, (uint32_t) size, 0, 0, -1, sides, is_1440k); } @@ -893,25 +893,25 @@ static FLOPPY_CONSTRUCT(apple35_raw_construct) struct header_diskcopy { - UINT8 disk_name[64]; /* name of the disk */ - UINT32 data_size; /* total size of data for all sectors (512*number_of_sectors) */ - UINT32 tag_size; /* total size of tag data for all sectors (12*number_of_sectors for GCR 3.5" floppies, 20*number_of_sectors for HD20, 0 otherwise) */ - UINT32 data_checksum; /* CRC32 checksum of all sector data */ - UINT32 tag_checksum; /* CRC32 checksum of all tag data */ - UINT8 disk_format; /* 0 = 400K, 1 = 800K, 2 = 720K, 3 = 1440K (other values reserved) */ - UINT8 format_byte; /* should be $00 Apple II, $01 Lisa, $02 Mac MFS ??? */ + uint8_t disk_name[64]; /* name of the disk */ + uint32_t data_size; /* total size of data for all sectors (512*number_of_sectors) */ + uint32_t tag_size; /* total size of tag data for all sectors (12*number_of_sectors for GCR 3.5" floppies, 20*number_of_sectors for HD20, 0 otherwise) */ + uint32_t data_checksum; /* CRC32 checksum of all sector data */ + uint32_t tag_checksum; /* CRC32 checksum of all tag data */ + uint8_t disk_format; /* 0 = 400K, 1 = 800K, 2 = 720K, 3 = 1440K (other values reserved) */ + uint8_t format_byte; /* should be $00 Apple II, $01 Lisa, $02 Mac MFS ??? */ /* $12 = 400K, $22 = >400K Macintosh (DiskCopy uses this value for all Apple II disks not 800K in size, and even for some of those), $24 = 800K Apple II disk */ - UINT16 magic; /* always $0100 (otherwise, the file may be in a different format. */ + uint16_t magic; /* always $0100 (otherwise, the file may be in a different format. */ }; -static floperr_t apple35_diskcopy_headerdecode(floppy_image_legacy *floppy, UINT32 *data_offset, - UINT32 *data_size, UINT32 *tag_offset, UINT32 *tag_size, UINT8 *format_byte, UINT8 *sides) +static floperr_t apple35_diskcopy_headerdecode(floppy_image_legacy *floppy, uint32_t *data_offset, + uint32_t *data_size, uint32_t *tag_offset, uint32_t *tag_size, uint8_t *format_byte, uint8_t *sides) { - UINT64 size; + uint64_t size; struct header_diskcopy header; if (data_offset) @@ -986,10 +986,10 @@ static FLOPPY_IDENTIFY(apple35_diskcopy_identify) static FLOPPY_CONSTRUCT(apple35_diskcopy_construct) { floperr_t err; - UINT8 format_byte, sides; - UINT32 data_offset, data_size; - UINT32 tag_offset, tag_size; - INT16 format_byte_param = -1; + uint8_t format_byte, sides; + uint32_t data_offset, data_size; + uint32_t tag_offset, tag_size; + int16_t format_byte_param = -1; struct header_diskcopy header; if (params) @@ -1030,18 +1030,18 @@ struct header_2img { char magic[4]; /* '2IMG' */ char creator[4]; /* signature; 'MESS' for MESS */ - UINT16 header_length; - UINT16 version; - UINT32 image_format; - UINT32 flags; - UINT32 block_count; - UINT32 data_offset; - UINT32 data_length; - UINT32 comment_offset; - UINT32 comment_length; - UINT32 creator_offset; - UINT32 creator_length; - UINT32 padding[4]; + uint16_t header_length; + uint16_t version; + uint32_t image_format; + uint32_t flags; + uint32_t block_count; + uint32_t data_offset; + uint32_t data_length; + uint32_t comment_offset; + uint32_t comment_length; + uint32_t creator_offset; + uint32_t creator_length; + uint32_t padding[4]; }; #define IMAGE_FORMAT_DO 0 @@ -1051,11 +1051,11 @@ struct header_2img -static floperr_t apple35_2img_decode(floppy_image_legacy *floppy, UINT32 *image_format, - UINT32 *data_offset, UINT32 *data_length) +static floperr_t apple35_2img_decode(floppy_image_legacy *floppy, uint32_t *image_format, + uint32_t *data_offset, uint32_t *data_length) { struct header_2img header; - UINT64 size; + uint64_t size; if (image_format) *image_format = 0; @@ -1097,11 +1097,11 @@ static floperr_t apple35_2img_decode(floppy_image_legacy *floppy, UINT32 *image_ header.data_length = 0x0c8000; } - if ((((UINT64) header.data_offset) + header.data_length) > size) + if ((((uint64_t) header.data_offset) + header.data_length) > size) return FLOPPY_ERROR_INVALIDIMAGE; - if ((((UINT64) header.comment_offset) + header.comment_length) > size) + if ((((uint64_t) header.comment_offset) + header.comment_length) > size) return FLOPPY_ERROR_INVALIDIMAGE; - if ((((UINT64) header.creator_offset) + header.creator_length) > size) + if ((((uint64_t) header.creator_offset) + header.creator_length) > size) return FLOPPY_ERROR_INVALIDIMAGE; if ((header.image_format != IMAGE_FORMAT_DO) && (header.image_format != IMAGE_FORMAT_PO) && @@ -1130,10 +1130,10 @@ static FLOPPY_IDENTIFY(apple35_2img_identify) static FLOPPY_CONSTRUCT(apple35_2img_construct) { floperr_t err; - UINT32 image_format; - UINT32 data_offset; - UINT32 data_size; - UINT8 sides = 2; + uint32_t image_format; + uint32_t data_offset; + uint32_t data_size; + uint8_t sides = 2; struct header_2img header; if (params) @@ -1232,16 +1232,16 @@ bool dc42_format::supports_save() const return true; } -int dc42_format::identify(io_generic *io, UINT32 form_factor) +int dc42_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 h[0x54]; - UINT64 size = io_generic_size(io); + uint8_t h[0x54]; + uint64_t size = io_generic_size(io); if(size < 0x54) return 0; io_generic_read(io, h, 0, 0x54); - UINT32 dsize = (h[0x40] << 24) | (h[0x41] << 16) | (h[0x42] << 8) | h[0x43]; - UINT32 tsize = (h[0x44] << 24) | (h[0x45] << 16) | (h[0x46] << 8) | h[0x47]; + uint32_t dsize = (h[0x40] << 24) | (h[0x41] << 16) | (h[0x42] << 8) | h[0x43]; + uint32_t tsize = (h[0x44] << 24) | (h[0x45] << 16) | (h[0x46] << 8) | h[0x47]; return size == 0x54+tsize+dsize && h[0] < 64 && h[0x52] == 1 && h[0x53] == 0 ? 100 : 0; } @@ -1276,22 +1276,22 @@ const floppy_image_format_t::desc_e dc42_format::mac_gcr[] = { }; -bool dc42_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool dc42_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT8 h[0x54]; + uint8_t h[0x54]; io_generic_read(io, h, 0, 0x54); int dsize = (h[0x40] << 24) | (h[0x41] << 16) | (h[0x42] << 8) | h[0x43]; int tsize = (h[0x44] << 24) | (h[0x45] << 16) | (h[0x46] << 8) | h[0x47]; - UINT8 encoding = h[0x50]; - UINT8 format = h[0x51]; + uint8_t encoding = h[0x50]; + uint8_t format = h[0x51]; if((encoding != 0x00 || format != 0x02) && (encoding != 0x01 || format != 0x22)) { osd_printf_error("dc42: Unsupported encoding/format combination %02x/%02x\n", encoding, format); return false; } - UINT8 sector_data[(512+12)*12]; + uint8_t sector_data[(512+12)*12]; memset(sector_data, 0, sizeof(sector_data)); desc_s sectors[12]; @@ -1306,7 +1306,7 @@ bool dc42_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) int ns = 12 - (track/16); int si = 0; for(int i=0; i> 3] >> (7-(pos & 7))) & 1); @@ -1342,7 +1342,7 @@ UINT8 dc42_format::gb(const UINT8 *buf, int ts, int &pos, int &wrap) return v; } -void dc42_format::update_chk(const UINT8 *data, int size, UINT32 &chk) +void dc42_format::update_chk(const uint8_t *data, int size, uint32_t &chk) { for(int i=0; i> 24; h[0x41] = dsize >> 16; h[0x42] = dsize >> 8; @@ -1378,25 +1378,25 @@ bool dc42_format::save(io_generic *io, floppy_image *image) h[0x52] = 0x01; h[0x53] = 0x00; - UINT32 dchk = 0; - UINT32 tchk = 0; + uint32_t dchk = 0; + uint32_t tchk = 0; int pos_data = 0x54; int pos_tag = 0x54+dsize; for(int track=0; track < 80; track++) { for(int head=0; head < g_heads; head++) { - UINT8 sectdata[(512+12)*12]; + uint8_t sectdata[(512+12)*12]; memset(sectdata, 0, sizeof(sectdata)); int nsect = 12-(track/16); - UINT8 buf[13000]; + uint8_t buf[13000]; int ts; generate_bitstream_from_track(track, head, 200000000/(6208*nsect), buf, ts, image); int pos = 0; int wrap = 0; int hb = 0; for(;;) { - UINT8 v = gb(buf, ts, pos, wrap); + uint8_t v = gb(buf, ts, pos, wrap); if(v == 0xff) hb = 1; else if(hb == 1 && v == 0xd5) @@ -1409,18 +1409,18 @@ bool dc42_format::save(io_generic *io, floppy_image *image) hb = 0; if(hb == 4) { - UINT8 h[7]; + uint8_t h[7]; for(auto & elem : h) elem = gb(buf, ts, pos, wrap); - UINT8 v2 = gcr6bw_tb[h[2]]; - UINT8 v3 = gcr6bw_tb[h[3]]; - UINT8 tr = gcr6bw_tb[h[0]] | (v2 & 1 ? 0x40 : 0x00); - UINT8 se = gcr6bw_tb[h[1]]; - UINT8 si = v2 & 0x20 ? 1 : 0; - // UINT8 ds = v3 & 0x20 ? 1 : 0; - // UINT8 fmt = v3 & 0x1f; - UINT8 c1 = (tr^se^v2^v3) & 0x3f; - UINT8 chk = gcr6bw_tb[h[4]]; + uint8_t v2 = gcr6bw_tb[h[2]]; + uint8_t v3 = gcr6bw_tb[h[3]]; + uint8_t tr = gcr6bw_tb[h[0]] | (v2 & 1 ? 0x40 : 0x00); + uint8_t se = gcr6bw_tb[h[1]]; + uint8_t si = v2 & 0x20 ? 1 : 0; + // uint8_t ds = v3 & 0x20 ? 1 : 0; + // uint8_t fmt = v3 & 0x1f; + uint8_t c1 = (tr^se^v2^v3) & 0x3f; + uint8_t chk = gcr6bw_tb[h[4]]; if(chk == c1 && tr == track && si == head && se < nsect) { int opos = pos; int owrap = wrap; @@ -1439,15 +1439,15 @@ bool dc42_format::save(io_generic *io, floppy_image *image) hb = 0; } if(hb == 4) { - UINT8 *dest = sectdata+(512+12)*se; + uint8_t *dest = sectdata+(512+12)*se; gb(buf, ts, pos, wrap); // Ignore the sector byte - UINT8 ca = 0, cb = 0, cc = 0; + uint8_t ca = 0, cb = 0, cc = 0; for(int i=0; i<522/3+1; i++) { - UINT8 e0 = gb(buf, ts, pos, wrap); - UINT8 e1 = gb(buf, ts, pos, wrap); - UINT8 e2 = gb(buf, ts, pos, wrap); - UINT8 e3 = i == 522/3 ? 0x96 : gb(buf, ts, pos, wrap); - UINT8 va, vb, vc; + uint8_t e0 = gb(buf, ts, pos, wrap); + uint8_t e1 = gb(buf, ts, pos, wrap); + uint8_t e2 = gb(buf, ts, pos, wrap); + uint8_t e3 = i == 522/3 ? 0x96 : gb(buf, ts, pos, wrap); + uint8_t va, vb, vc; gcr6_decode(e0, e1, e2, e3, va, vb, vc); cc = (cc << 1) | (cc >> 7); va = va ^ cc; @@ -1474,7 +1474,7 @@ bool dc42_format::save(io_generic *io, floppy_image *image) break; } for(int i=0; i; -int apollo_format::identify(io_generic *io, UINT32 form_factor) +int apollo_format::identify(io_generic *io, uint32_t form_factor) { - UINT64 size = io_generic_size(io); - UINT32 expected_size = 77*2*8*1024; + uint64_t size = io_generic_size(io); + uint32_t expected_size = 77*2*8*1024; return ((size == expected_size) || (size == 0)) ? 1 : 0; } diff --git a/src/lib/formats/apollo_dsk.h b/src/lib/formats/apollo_dsk.h index 51f9eb4aebc..47de0373d23 100644 --- a/src/lib/formats/apollo_dsk.h +++ b/src/lib/formats/apollo_dsk.h @@ -17,7 +17,7 @@ class apollo_format : public upd765_format { public: apollo_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; virtual const char *name() const override; virtual const char *description() const override; virtual const char *extensions() const override; diff --git a/src/lib/formats/apridisk.cpp b/src/lib/formats/apridisk.cpp index a004d54ccd0..a42aa9fa4d4 100644 --- a/src/lib/formats/apridisk.cpp +++ b/src/lib/formats/apridisk.cpp @@ -31,9 +31,9 @@ const char *apridisk_format::extensions() const return "dsk"; } -int apridisk_format::identify(io_generic *io, UINT32 form_factor) +int apridisk_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 header[APR_HEADER_SIZE]; + uint8_t header[APR_HEADER_SIZE]; io_generic_read(io, header, 0, APR_HEADER_SIZE); const char magic[] = "ACT Apricot disk image\x1a\x04"; @@ -44,35 +44,35 @@ int apridisk_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool apridisk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool apridisk_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { desc_pc_sector sectors[80][2][18]; - UINT8 sector_data[MAX_SECTORS * SECTOR_SIZE]; - UINT8 *data_ptr = sector_data; + uint8_t sector_data[MAX_SECTORS * SECTOR_SIZE]; + uint8_t *data_ptr = sector_data; int track_count = 0, head_count = 0, sector_count = 0; - UINT64 file_size = io_generic_size(io); - UINT64 file_offset = APR_HEADER_SIZE; + uint64_t file_size = io_generic_size(io); + uint64_t file_offset = APR_HEADER_SIZE; while (file_offset < file_size) { // read sector header - UINT8 sector_header[16]; + uint8_t sector_header[16]; io_generic_read(io, sector_header, file_offset, 16); - UINT32 type = pick_integer_le(§or_header, 0, 4); - UINT16 compression = pick_integer_le(§or_header, 4, 2); - UINT16 header_size = pick_integer_le(§or_header, 6, 2); - UINT32 data_size = pick_integer_le(§or_header, 8, 4); + uint32_t type = pick_integer_le(§or_header, 0, 4); + uint16_t compression = pick_integer_le(§or_header, 4, 2); + uint16_t header_size = pick_integer_le(§or_header, 6, 2); + uint32_t data_size = pick_integer_le(§or_header, 8, 4); file_offset += header_size; switch (type) { case APR_SECTOR: - UINT8 head = pick_integer_le(§or_header, 12, 1); - UINT8 sector = pick_integer_le(§or_header, 13, 1); - UINT8 track = (UINT8) pick_integer_le(§or_header, 14, 2); + uint8_t head = pick_integer_le(§or_header, 12, 1); + uint8_t sector = pick_integer_le(§or_header, 13, 1); + uint8_t track = (uint8_t) pick_integer_le(§or_header, 14, 2); track_count = std::max(track_count, int(unsigned(track))); head_count = std::max(head_count, int(unsigned(head))); @@ -92,9 +92,9 @@ bool apridisk_format::load(io_generic *io, UINT32 form_factor, floppy_image *ima { case APR_COMPRESSED: { - UINT8 comp[3]; + uint8_t comp[3]; io_generic_read(io, comp, file_offset, 3); - UINT16 length = pick_integer_le(comp, 0, 2); + uint16_t length = pick_integer_le(comp, 0, 2); if (length != SECTOR_SIZE) fatalerror("apridisk_format: Invalid compression length %04x\n", length); diff --git a/src/lib/formats/apridisk.h b/src/lib/formats/apridisk.h index 4faf756fd5a..81db4b41105 100644 --- a/src/lib/formats/apridisk.h +++ b/src/lib/formats/apridisk.h @@ -24,8 +24,8 @@ public: virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual bool supports_save() const override; diff --git a/src/lib/formats/atom_tap.cpp b/src/lib/formats/atom_tap.cpp index f3ab980a8fa..3c606901b90 100644 --- a/src/lib/formats/atom_tap.cpp +++ b/src/lib/formats/atom_tap.cpp @@ -69,9 +69,9 @@ static const struct CassetteModulation atom_tap_modulation = cassette_image_read_uint8 - read tape data -------------------------------------------------*/ -static UINT8 cassette_image_read_uint8(cassette_image *cassette, UINT64 offset) +static uint8_t cassette_image_read_uint8(cassette_image *cassette, uint64_t offset) { - UINT8 data; + uint8_t data; cassette_image_read(cassette, &data, offset, 1); return data; } @@ -101,14 +101,14 @@ static cassette_image::error atom_tap_identify(cassette_image *cassette, struct static cassette_image::error atom_tap_load(cassette_image *cassette) { cassette_image::error err; - UINT64 image_size = cassette_image_size(cassette); - UINT64 image_pos = 0; + uint64_t image_size = cassette_image_size(cassette); + uint64_t image_pos = 0; double time_index = 0.0; double time_displacement; while (image_pos < image_size) { - UINT8 data = cassette_image_read_uint8(cassette, image_pos); + uint8_t data = cassette_image_read_uint8(cassette, image_pos); /* start bit */ MODULATE(0); diff --git a/src/lib/formats/basicdsk.cpp b/src/lib/formats/basicdsk.cpp index 35207c0c86b..b24ca47346d 100644 --- a/src/lib/formats/basicdsk.cpp +++ b/src/lib/formats/basicdsk.cpp @@ -18,8 +18,8 @@ static floperr_t basicdsk_read_sector(floppy_image_legacy *floppy, int head, int static floperr_t basicdsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam); static floperr_t basicdsk_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen); static floperr_t basicdsk_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam); -static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length); -static floperr_t basicdsk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags); +static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length); +static floperr_t basicdsk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags); static int basicdsk_get_heads_per_disk(floppy_image_legacy *floppy); static int basicdsk_get_tracks_per_disk(floppy_image_legacy *floppy); static floperr_t basicdsk_format_track(floppy_image_legacy *floppy, int head, int track, util::option_resolution *params); @@ -77,10 +77,10 @@ floperr_t basicdsk_construct(floppy_image_legacy *floppy, const struct basicdsk_ -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) +static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset) { const struct basicdsk_geometry *geom; - UINT64 offs; + uint64_t offs; geom = get_geometry(floppy); @@ -131,7 +131,7 @@ static int internal_basicdsk_translate_sector_interleave(floppy_image_legacy *fl static floperr_t internal_basicdsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) { - UINT64 offset; + uint64_t offset; floperr_t err; err = get_offset(floppy, head, track, sector, sector_is_index, &offset); @@ -145,7 +145,7 @@ static floperr_t internal_basicdsk_read_sector(floppy_image_legacy *floppy, int static floperr_t internal_basicdsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam) { - UINT64 offset; + uint64_t offset; floperr_t err; err = get_offset(floppy, head, track, sector, sector_is_index, &offset); @@ -183,10 +183,10 @@ static floperr_t basicdsk_write_indexed_sector(floppy_image_legacy *floppy, int static floperr_t basicdsk_format_track(floppy_image_legacy *floppy, int head, int track, util::option_resolution *params) { floperr_t err = FLOPPY_ERROR_SUCCESS; - UINT8 local_buffer[512]; + uint8_t local_buffer[512]; void *alloc_buffer = nullptr; void *buffer; - UINT32 sector_length; + uint32_t sector_length; int sector; const struct basicdsk_geometry *geometry; @@ -241,7 +241,7 @@ static int basicdsk_get_tracks_per_disk(floppy_image_legacy *floppy) -static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { floperr_t err; @@ -256,7 +256,7 @@ static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int hea -static floperr_t basicdsk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +static floperr_t basicdsk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { const struct basicdsk_geometry *geom = get_geometry(floppy); @@ -338,7 +338,7 @@ FLOPPY_CONSTRUCT(basicdsk_construct_default) FLOPPY_IDENTIFY(basicdsk_identify_default) { - UINT64 expected_size; + uint64_t expected_size; struct basicdsk_geometry geometry; basicdsk_default_geometry(format, &geometry); diff --git a/src/lib/formats/basicdsk.h b/src/lib/formats/basicdsk.h index 77f234da949..eae442993e3 100644 --- a/src/lib/formats/basicdsk.h +++ b/src/lib/formats/basicdsk.h @@ -21,12 +21,12 @@ struct basicdsk_geometry int first_sector_id; int interleave; int sector_map[256]; - UINT32 sector_length; - UINT64 offset; + uint32_t sector_length; + uint64_t offset; int (*translate_sector)(floppy_image_legacy *floppy, int sector); - UINT64 (*translate_offset)(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector); - UINT64 (*get_ddam)(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector); + uint64_t (*translate_offset)(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector); + uint64_t (*get_ddam)(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector); }; floperr_t basicdsk_construct(floppy_image_legacy *floppy, const struct basicdsk_geometry *geometry); diff --git a/src/lib/formats/c3040_dsk.cpp b/src/lib/formats/c3040_dsk.cpp index 9fb6669ab20..78786979953 100644 --- a/src/lib/formats/c3040_dsk.cpp +++ b/src/lib/formats/c3040_dsk.cpp @@ -56,7 +56,7 @@ const int c3040_format::c3040_gap2[] = 12, 12, 12, 12, 12 // 31-35 }; -floppy_image_format_t::desc_e* c3040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) +floppy_image_format_t::desc_e* c3040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) { static floppy_image_format_t::desc_e desc[] = { /* 00 */ { SECTOR_LOOP_START, 0, -1 }, diff --git a/src/lib/formats/c3040_dsk.h b/src/lib/formats/c3040_dsk.h index 659b2748571..4a549abad13 100644 --- a/src/lib/formats/c3040_dsk.h +++ b/src/lib/formats/c3040_dsk.h @@ -23,7 +23,7 @@ public: protected: virtual int get_sectors_per_track(const format &f, int track) override { return c3040_sectors_per_track[track]; } - virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) override; + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) override; virtual int get_gap2(const format &f, int head, int track) override { return c3040_gap2[track]; } virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) override; diff --git a/src/lib/formats/c4040_dsk.cpp b/src/lib/formats/c4040_dsk.cpp index 9e6dff7f627..e6314f69261 100644 --- a/src/lib/formats/c4040_dsk.cpp +++ b/src/lib/formats/c4040_dsk.cpp @@ -46,7 +46,7 @@ const int c4040_format::c4040_gap2[] = 12, 12, 12, 12, 12 // 31-35 }; -floppy_image_format_t::desc_e* c4040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) +floppy_image_format_t::desc_e* c4040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) { static floppy_image_format_t::desc_e desc[] = { /* 00 */ { SECTOR_LOOP_START, 0, -1 }, diff --git a/src/lib/formats/c4040_dsk.h b/src/lib/formats/c4040_dsk.h index 591fcd42925..08d62ca3e23 100644 --- a/src/lib/formats/c4040_dsk.h +++ b/src/lib/formats/c4040_dsk.h @@ -22,7 +22,7 @@ public: virtual const char *extensions() const override; protected: - virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) override; + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) override; virtual int get_gap2(const format &f, int head, int track) override { return c4040_gap2[track]; } virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) override; diff --git a/src/lib/formats/camplynx_cas.cpp b/src/lib/formats/camplynx_cas.cpp index 330df5601a1..d6181d845ff 100644 --- a/src/lib/formats/camplynx_cas.cpp +++ b/src/lib/formats/camplynx_cas.cpp @@ -37,7 +37,7 @@ Each byte is 8 bits (MSB first) with no start or stop bits. // image size static int camplynx_image_size; -static int camplynx_put_samples(INT16 *buffer, int sample_pos, int count, int level) +static int camplynx_put_samples(int16_t *buffer, int sample_pos, int count, int level) { if (buffer) { @@ -48,7 +48,7 @@ static int camplynx_put_samples(INT16 *buffer, int sample_pos, int count, int le return count; } -static int camplynx_output_bit(INT16 *buffer, int sample_pos, bool bit) +static int camplynx_output_bit(int16_t *buffer, int sample_pos, bool bit) { int samples = 0; @@ -66,10 +66,10 @@ static int camplynx_output_bit(INT16 *buffer, int sample_pos, bool bit) return samples; } -static int camplynx_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) +static int camplynx_output_byte(int16_t *buffer, int sample_pos, uint8_t byte) { int samples = 0; - UINT8 i; + uint8_t i; /* data */ for (i = 0; i<8; i++) @@ -78,11 +78,11 @@ static int camplynx_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) return samples; } -static int camplynx_handle_cassette(INT16 *buffer, const UINT8 *bytes) +static int camplynx_handle_cassette(int16_t *buffer, const uint8_t *bytes) { - UINT32 sample_count = 0; - UINT32 byte_count = 0; - UINT32 i; + uint32_t sample_count = 0; + uint32_t byte_count = 0; + uint32_t i; /* header zeroes */ for (i=0; i<555; i++) @@ -137,7 +137,7 @@ static int camplynx_handle_cassette(INT16 *buffer, const UINT8 *bytes) Generate samples for the tape image ********************************************************************/ -static int camplynx_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int camplynx_cassette_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { return camplynx_handle_cassette(buffer, bytes); } @@ -146,7 +146,7 @@ static int camplynx_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) Calculate the number of samples needed for this tape image ********************************************************************/ -static int camplynx_cassette_calculate_size_in_samples(const UINT8 *bytes, int length) +static int camplynx_cassette_calculate_size_in_samples(const uint8_t *bytes, int length) { camplynx_image_size = length; diff --git a/src/lib/formats/cassimg.cpp b/src/lib/formats/cassimg.cpp index 39e3176e121..87636b81349 100644 --- a/src/lib/formats/cassimg.cpp +++ b/src/lib/formats/cassimg.cpp @@ -33,7 +33,7 @@ CASSETTE_FORMATLIST_END helper code *********************************************************************/ -static double map_double(double d, UINT64 low, UINT64 high, UINT64 value) +static double map_double(double d, uint64_t low, uint64_t high, uint64_t value) { return d * (value - low) / (high - low); } @@ -51,24 +51,24 @@ static size_t waveform_bytes_per_sample(int waveform_flags) extrapolation and interpolation *********************************************************************/ -static INT32 extrapolate8(INT8 value) +static int32_t extrapolate8(int8_t value) { - return ((INT32) value) << 24; + return ((int32_t) value) << 24; } -static INT32 extrapolate16(INT16 value) +static int32_t extrapolate16(int16_t value) { - return ((INT32) value) << 16; + return ((int32_t) value) << 16; } -static INT8 interpolate8(INT32 value) +static int8_t interpolate8(int32_t value) { - return (INT8) (value >> 24); + return (int8_t) (value >> 24); } -static INT16 interpolate16(INT32 value) +static int16_t interpolate16(int32_t value) { - return (INT16) (value >> 16); + return (int16_t) (value >> 16); } @@ -309,21 +309,21 @@ void cassette_change(cassette_image *cassette, void *file, const struct io_procs calls for accessing the raw cassette image *********************************************************************/ -void cassette_image_read(cassette_image *cassette, void *buffer, UINT64 offset, size_t length) +void cassette_image_read(cassette_image *cassette, void *buffer, uint64_t offset, size_t length) { io_generic_read(&cassette->io, buffer, offset, length); } -void cassette_image_write(cassette_image *cassette, const void *buffer, UINT64 offset, size_t length) +void cassette_image_write(cassette_image *cassette, const void *buffer, uint64_t offset, size_t length) { io_generic_write(&cassette->io, buffer, offset, length); } -UINT64 cassette_image_size(cassette_image *cassette) +uint64_t cassette_image_size(cassette_image *cassette) { return io_generic_size(&cassette->io); } @@ -379,7 +379,7 @@ static cassette_image::error compute_manipulation_ranges(cassette_image *cassett -static cassette_image::error lookup_sample(cassette_image *cassette, int channel, size_t sample, INT32 **ptr) +static cassette_image::error lookup_sample(cassette_image *cassette, int channel, size_t sample, int32_t **ptr) { *ptr = nullptr; size_t sample_blocknum = (sample / SAMPLES_PER_BLOCK) * cassette->channels + channel; @@ -422,12 +422,12 @@ cassette_image::error cassette_get_samples(cassette_image *cassette, int channel struct manipulation_ranges ranges; size_t sample_index; size_t cassette_sample_index; - UINT8 *dest_ptr; - const INT32 *source_ptr; + uint8_t *dest_ptr; + const int32_t *source_ptr; double d; - INT16 word; - INT32 dword; - INT64 sum; + int16_t word; + int32_t dword; + int64_t sum; assert(cassette); @@ -444,7 +444,7 @@ cassette_image::error cassette_get_samples(cassette_image *cassette, int channel /* find the sample that we are putting */ d = map_double(ranges.sample_last + 1 - ranges.sample_first, 0, sample_count, sample_index) + ranges.sample_first; cassette_sample_index = (size_t) d; - err = lookup_sample(cassette, channel, cassette_sample_index, (INT32 **) &source_ptr); + err = lookup_sample(cassette, channel, cassette_sample_index, (int32_t **) &source_ptr); if (err != cassette_image::error::SUCCESS) return err; @@ -455,24 +455,24 @@ cassette_image::error cassette_get_samples(cassette_image *cassette, int channel sum /= (ranges.channel_last + 1 - ranges.channel_first); /* and write out the result */ - dest_ptr = (UINT8*)samples; + dest_ptr = (uint8_t*)samples; dest_ptr += waveform_bytes_per_sample(waveform_flags) * sample_index * cassette->channels; switch(waveform_bytes_per_sample(waveform_flags)) { case 1: - *((INT8 *) dest_ptr) = interpolate8(sum); + *((int8_t *) dest_ptr) = interpolate8(sum); break; case 2: word = interpolate16(sum); if (waveform_flags & CASSETTE_WAVEFORM_ENDIAN_FLIP) word = flipendian_int16(word); - *((INT16 *) dest_ptr) = word; + *((int16_t *) dest_ptr) = word; break; case 4: dword = sum; if (waveform_flags & CASSETTE_WAVEFORM_ENDIAN_FLIP) dword = flipendian_int32(dword); - *((INT32 *) dest_ptr) = dword; + *((int32_t *) dest_ptr) = dword; break; } } @@ -488,11 +488,11 @@ cassette_image::error cassette_put_samples(cassette_image *cassette, int channel cassette_image::error err; struct manipulation_ranges ranges; size_t sample_index; - INT32 *dest_ptr; - INT32 dest_value; - INT16 word; - INT32 dword; - const UINT8 *source_ptr; + int32_t *dest_ptr; + int32_t dest_value; + int16_t word; + int32_t dword; + const uint8_t *source_ptr; double d; if (!cassette) @@ -520,25 +520,25 @@ cassette_image::error cassette_put_samples(cassette_image *cassette, int channel { /* figure out the source pointer */ d = map_double(sample_count, ranges.sample_first, ranges.sample_last + 1, sample_index); - source_ptr = (const UINT8*)samples; + source_ptr = (const uint8_t*)samples; source_ptr += ((size_t) d) * sample_bytes; /* compute the value that we are writing */ switch(waveform_bytes_per_sample(waveform_flags)) { case 1: if (waveform_flags & CASSETTE_WAVEFORM_UNSIGNED) - dest_value = extrapolate8((INT8)(*source_ptr - 128)); + dest_value = extrapolate8((int8_t)(*source_ptr - 128)); else - dest_value = extrapolate8(*((INT8 *) source_ptr)); + dest_value = extrapolate8(*((int8_t *) source_ptr)); break; case 2: - word = *((INT16 *) source_ptr); + word = *((int16_t *) source_ptr); if (waveform_flags & CASSETTE_WAVEFORM_ENDIAN_FLIP) word = flipendian_int16(word); dest_value = extrapolate16(word); break; case 4: - dword = *((INT32 *) source_ptr); + dword = *((int32_t *) source_ptr); if (waveform_flags & CASSETTE_WAVEFORM_ENDIAN_FLIP) dword = flipendian_int32(dword); dest_value = dword; @@ -562,7 +562,7 @@ cassette_image::error cassette_put_samples(cassette_image *cassette, int channel cassette_image::error cassette_get_sample(cassette_image *cassette, int channel, - double time_index, double sample_period, INT32 *sample) + double time_index, double sample_period, int32_t *sample) { return cassette_get_samples(cassette, channel, time_index, sample_period, 1, 0, sample, CASSETTE_WAVEFORM_32BIT); @@ -571,7 +571,7 @@ cassette_image::error cassette_get_sample(cassette_image *cassette, int channel, cassette_image::error cassette_put_sample(cassette_image *cassette, int channel, - double time_index, double sample_period, INT32 sample) + double time_index, double sample_period, int32_t sample) { return cassette_put_samples(cassette, channel, time_index, sample_period, 1, 0, &sample, CASSETTE_WAVEFORM_32BIT); @@ -584,7 +584,7 @@ cassette_image::error cassette_put_sample(cassette_image *cassette, int channel, *********************************************************************/ cassette_image::error cassette_read_samples(cassette_image *cassette, int channels, double time_index, - double sample_period, size_t sample_count, UINT64 offset, int waveform_flags) + double sample_period, size_t sample_count, uint64_t offset, int waveform_flags) { cassette_image::error err; size_t chunk_sample_count; @@ -594,7 +594,7 @@ cassette_image::error cassette_read_samples(cassette_image *cassette, int channe double chunk_time_index; double chunk_sample_period; int channel; - UINT8 buffer[8192]; + uint8_t buffer[8192]; bytes_per_sample = waveform_bytes_per_sample(waveform_flags); sample_bytes = bytes_per_sample * channels; @@ -624,7 +624,7 @@ cassette_image::error cassette_read_samples(cassette_image *cassette, int channe cassette_image::error cassette_write_samples(cassette_image *cassette, int channels, double time_index, - double sample_period, size_t sample_count, UINT64 offset, int waveform_flags) + double sample_period, size_t sample_count, uint64_t offset, int waveform_flags) { cassette_image::error err; size_t chunk_sample_count; @@ -634,7 +634,7 @@ cassette_image::error cassette_write_samples(cassette_image *cassette, int chann double chunk_time_index; double chunk_sample_period; int channel; - UINT8 buffer[8192]; + uint8_t buffer[8192]; bytes_per_sample = waveform_bytes_per_sample(waveform_flags); sample_bytes = bytes_per_sample * channels; @@ -667,10 +667,10 @@ cassette_image::error cassette_write_samples(cassette_image *cassette, int chann waveform accesses to/from the raw image *********************************************************************/ -static const INT8 *choose_wave(const struct CassetteModulation *modulation, size_t *wave_bytes_length) +static const int8_t *choose_wave(const struct CassetteModulation *modulation, size_t *wave_bytes_length) { - static const INT8 square_wave[] = { -128, 127 }; - static const INT8 sine_wave[] = { 0, 48, 89, 117, 127, 117, 89, 48, 0, -48, -89, -117, -127, -117, -89, -48 }; + static const int8_t square_wave[] = { -128, 127 }; + static const int8_t sine_wave[] = { 0, 48, 89, 117, 127, 117, 89, 48, 0, -48, -89, -117, -127, -117, -89, -48 }; if (modulation->flags & CASSETTE_MODULATION_SINEWAVE) { @@ -693,7 +693,7 @@ cassette_image::error cassette_modulation_identify(cassette_image *cassette, con choose_wave(modulation, &wave_bytes_length); opts->bits_per_sample = 8; opts->channels = 1; - opts->sample_frequency = (UINT32) (std::max(modulation->zero_frequency_high, modulation->one_frequency_high) * wave_bytes_length * 2); + opts->sample_frequency = (uint32_t) (std::max(modulation->zero_frequency_high, modulation->one_frequency_high) * wave_bytes_length * 2); return cassette_image::error::SUCCESS; } @@ -704,13 +704,13 @@ cassette_image::error cassette_put_modulated_data(cassette_image *cassette, int double *time_displacement) { cassette_image::error err; - const UINT8 *data_bytes = (const UINT8 *)data; - const INT8 *wave_bytes; + const uint8_t *data_bytes = (const uint8_t *)data; + const int8_t *wave_bytes; size_t wave_bytes_length; double total_displacement = 0.0; double pulse_period; double pulse_frequency; - UINT8 b; + uint8_t b; int i; wave_bytes = choose_wave(modulation, &wave_bytes_length); @@ -740,7 +740,7 @@ done: cassette_image::error cassette_put_modulated_filler(cassette_image *cassette, int channel, double time_index, - UINT8 filler, size_t filler_length, const struct CassetteModulation *modulation, + uint8_t filler, size_t filler_length, const struct CassetteModulation *modulation, double *time_displacement) { cassette_image::error err; @@ -764,13 +764,13 @@ cassette_image::error cassette_put_modulated_filler(cassette_image *cassette, in cassette_image::error cassette_read_modulated_data(cassette_image *cassette, int channel, double time_index, - UINT64 offset, UINT64 length, const struct CassetteModulation *modulation, + uint64_t offset, uint64_t length, const struct CassetteModulation *modulation, double *time_displacement) { cassette_image::error err; - UINT8 buffer_stack[1024]; - UINT8 *buffer; - UINT8 *alloc_buffer = nullptr; + uint8_t buffer_stack[1024]; + uint8_t *buffer; + uint8_t *alloc_buffer = nullptr; double delta; double total_displacement = 0.0; size_t this_length; @@ -783,8 +783,8 @@ cassette_image::error cassette_read_modulated_data(cassette_image *cassette, int } else { - buffer_length = std::min(length, 100000); - alloc_buffer = (UINT8*)malloc(buffer_length); + buffer_length = std::min(length, 100000); + alloc_buffer = (uint8_t*)malloc(buffer_length); if (!alloc_buffer) { err = cassette_image::error::OUT_OF_MEMORY; @@ -795,7 +795,7 @@ cassette_image::error cassette_read_modulated_data(cassette_image *cassette, int while(length > 0) { - this_length = (std::min)(length, buffer_length); + this_length = (std::min)(length, buffer_length); cassette_image_read(cassette, buffer, offset, this_length); err = cassette_put_modulated_data(cassette, channel, time_index, buffer, this_length, modulation, &delta); @@ -819,11 +819,11 @@ done: cassette_image::error cassette_put_modulated_data_bit(cassette_image *cassette, int channel, double time_index, - UINT8 data, const struct CassetteModulation *modulation, + uint8_t data, const struct CassetteModulation *modulation, double *time_displacement) { cassette_image::error err; - const INT8 *wave_bytes; + const int8_t *wave_bytes; size_t wave_bytes_length; double total_displacement = 0.0; double pulse_period; @@ -870,12 +870,12 @@ cassette_image::error cassette_legacy_construct(cassette_image *cassette, cassette_image::error err; int length; int sample_count; - std::vector bytes; - std::vector chunk; - std::vector samples; + std::vector bytes; + std::vector chunk; + std::vector samples; int pos = 0; - UINT64 offset = 0; - UINT64 size; + uint64_t offset = 0; + uint64_t size; struct CassetteLegacyWaveFiller args; /* sanity check the args */ diff --git a/src/lib/formats/cassimg.h b/src/lib/formats/cassimg.h index 0bf8865e6ff..2f9ff01f1cb 100644 --- a/src/lib/formats/cassimg.h +++ b/src/lib/formats/cassimg.h @@ -66,20 +66,20 @@ ***************************************************************************/ -typedef std::vector sample_block; +typedef std::vector sample_block; struct CassetteOptions { int channels; int bits_per_sample; - UINT32 sample_frequency; + uint32_t sample_frequency; }; struct CassetteInfo { int channels; int bits_per_sample; - UINT32 sample_frequency; + uint32_t sample_frequency; size_t sample_count; }; @@ -100,7 +100,7 @@ struct cassette_image int channels; int flags; - UINT32 sample_frequency; + uint32_t sample_frequency; std::vector blocks; size_t sample_count; @@ -129,11 +129,11 @@ struct CassetteModulation /* code to adapt existing legacy fill_wave functions */ struct CassetteLegacyWaveFiller { - int (*fill_wave)(INT16 *, int, UINT8 *); + int (*fill_wave)(int16_t *, int, uint8_t *); int chunk_size; int chunk_samples; - int (*chunk_sample_calc)(const UINT8 *bytes, int length); - UINT32 sample_frequency; + int (*chunk_sample_calc)(const uint8_t *bytes, int length); + uint32_t sample_frequency; int header_samples; int trailer_samples; }; @@ -175,9 +175,9 @@ void cassette_change(cassette_image *cassette, void *file, const struct io_procs void cassette_get_info(cassette_image *cassette, struct CassetteInfo *info); /* calls for accessing the raw cassette image */ -void cassette_image_read(cassette_image *cassette, void *buffer, UINT64 offset, size_t length); -void cassette_image_write(cassette_image *cassette, const void *buffer, UINT64 offset, size_t length); -UINT64 cassette_image_size(cassette_image *cassette); +void cassette_image_read(cassette_image *cassette, void *buffer, uint64_t offset, size_t length); +void cassette_image_write(cassette_image *cassette, const void *buffer, uint64_t offset, size_t length); +uint64_t cassette_image_size(cassette_image *cassette); /* waveform accesses */ cassette_image::error cassette_get_samples(cassette_image *cassette, int channel, @@ -187,15 +187,15 @@ cassette_image::error cassette_put_samples(cassette_image *cassette, int channel double time_index, double sample_period, size_t sample_count, size_t sample_bytes, const void *samples, int waveform_flags); cassette_image::error cassette_get_sample(cassette_image *cassette, int channel, - double time_index, double sample_period, INT32 *sample); + double time_index, double sample_period, int32_t *sample); cassette_image::error cassette_put_sample(cassette_image *cassette, int channel, - double time_index, double sample_period, INT32 sample); + double time_index, double sample_period, int32_t sample); /* waveform accesses to/from the raw image */ cassette_image::error cassette_read_samples(cassette_image *cassette, int channels, double time_index, - double sample_period, size_t sample_count, UINT64 offset, int waveform_flags); + double sample_period, size_t sample_count, uint64_t offset, int waveform_flags); cassette_image::error cassette_write_samples(cassette_image *cassette, int channels, double time_index, - double sample_period, size_t sample_count, UINT64 offset, int waveform_flags); + double sample_period, size_t sample_count, uint64_t offset, int waveform_flags); /* modulation support */ cassette_image::error cassette_modulation_identify(cassette_image *cassette, const struct CassetteModulation *modulation, @@ -204,21 +204,21 @@ cassette_image::error cassette_put_modulated_data(cassette_image *cassette, int const void *data, size_t data_length, const struct CassetteModulation *modulation, double *time_displacement); cassette_image::error cassette_put_modulated_filler(cassette_image *cassette, int channel, double time_index, - UINT8 filler, size_t filler_length, const struct CassetteModulation *modulation, + uint8_t filler, size_t filler_length, const struct CassetteModulation *modulation, double *time_displacement); cassette_image::error cassette_read_modulated_data(cassette_image *cassette, int channel, double time_index, - UINT64 offset, UINT64 length, const struct CassetteModulation *modulation, + uint64_t offset, uint64_t length, const struct CassetteModulation *modulation, double *time_displacement); cassette_image::error cassette_put_modulated_data_bit(cassette_image *cassette, int channel, double time_index, - UINT8 data, const struct CassetteModulation *modulation, + uint8_t data, const struct CassetteModulation *modulation, double *time_displacement); /* debug calls */ void cassette_dump(cassette_image *image, const char *filename); /* legacy code support */ -#define CODE_HEADER ((UINT8*)-1) -#define CODE_TRAILER ((UINT8*)-2) +#define CODE_HEADER ((uint8_t*)-1) +#define CODE_TRAILER ((uint8_t*)-2) cassette_image::error cassette_legacy_identify(cassette_image *cassette, struct CassetteOptions *opts, const struct CassetteLegacyWaveFiller *legacy_args); cassette_image::error cassette_legacy_construct(cassette_image *cassette, diff --git a/src/lib/formats/cbm_crt.cpp b/src/lib/formats/cbm_crt.cpp index 43e440e725c..0da119c006f 100644 --- a/src/lib/formats/cbm_crt.cpp +++ b/src/lib/formats/cbm_crt.cpp @@ -130,7 +130,7 @@ std::string cbm_crt_get_card(util::core_file &file) if (memcmp(header.signature, CRT_SIGNATURE, 16) == 0) { - UINT16 hardware = pick_integer_be(header.hardware, 0, 2); + uint16_t hardware = pick_integer_be(header.hardware, 0, 2); return std::string(CRT_C64_SLOT_NAMES[hardware]); } @@ -152,7 +152,7 @@ bool cbm_crt_read_header(util::core_file &file, size_t *roml_size, size_t *romh_ if (memcmp(header.signature, CRT_SIGNATURE, 16) != 0) return false; - UINT16 hardware = pick_integer_be(header.hardware, 0, 2); + uint16_t hardware = pick_integer_be(header.hardware, 0, 2); *exrom = header.exrom; *game = header.game; @@ -171,9 +171,9 @@ bool cbm_crt_read_header(util::core_file &file, size_t *roml_size, size_t *romh_ cbm_crt_chip chip; file.read(&chip, CRT_CHIP_LENGTH); - UINT16 address = pick_integer_be(chip.start_address, 0, 2); - UINT16 size = pick_integer_be(chip.image_size, 0, 2); - UINT16 type = pick_integer_be(chip.chip_type, 0, 2); + uint16_t address = pick_integer_be(chip.start_address, 0, 2); + uint16_t size = pick_integer_be(chip.image_size, 0, 2); + uint16_t type = pick_integer_be(chip.chip_type, 0, 2); if (LOG) { @@ -201,10 +201,10 @@ bool cbm_crt_read_header(util::core_file &file, size_t *roml_size, size_t *romh_ // cbm_crt_read_data - read cartridge data //------------------------------------------------- -bool cbm_crt_read_data(util::core_file &file, UINT8 *roml, UINT8 *romh) +bool cbm_crt_read_data(util::core_file &file, uint8_t *roml, uint8_t *romh) { - UINT32 roml_offset = 0; - UINT32 romh_offset = 0; + uint32_t roml_offset = 0; + uint32_t romh_offset = 0; file.seek(CRT_HEADER_LENGTH, SEEK_SET); @@ -213,8 +213,8 @@ bool cbm_crt_read_data(util::core_file &file, UINT8 *roml, UINT8 *romh) cbm_crt_chip chip; file.read(&chip, CRT_CHIP_LENGTH); - UINT16 address = pick_integer_be(chip.start_address, 0, 2); - UINT16 size = pick_integer_be(chip.image_size, 0, 2); + uint16_t address = pick_integer_be(chip.start_address, 0, 2); + uint16_t size = pick_integer_be(chip.image_size, 0, 2); switch (address) { diff --git a/src/lib/formats/cbm_crt.h b/src/lib/formats/cbm_crt.h index 96d04cea2f6..2a5e5331a8a 100644 --- a/src/lib/formats/cbm_crt.h +++ b/src/lib/formats/cbm_crt.h @@ -108,25 +108,25 @@ enum struct cbm_crt_header { - UINT8 signature[16]; - UINT8 header_length[4]; - UINT8 version[2]; - UINT8 hardware[2]; - UINT8 exrom; - UINT8 game; - UINT8 reserved[6]; - UINT8 name[32]; + uint8_t signature[16]; + uint8_t header_length[4]; + uint8_t version[2]; + uint8_t hardware[2]; + uint8_t exrom; + uint8_t game; + uint8_t reserved[6]; + uint8_t name[32]; }; struct cbm_crt_chip { - UINT8 signature[4]; - UINT8 packet_length[4]; - UINT8 chip_type[2]; - UINT8 bank[2]; - UINT8 start_address[2]; - UINT8 image_size[2]; + uint8_t signature[4]; + uint8_t packet_length[4]; + uint8_t chip_type[2]; + uint8_t bank[2]; + uint8_t start_address[2]; + uint8_t image_size[2]; }; @@ -137,7 +137,7 @@ struct cbm_crt_chip std::string cbm_crt_get_card(util::core_file &file); bool cbm_crt_read_header(util::core_file &file, size_t *roml_size, size_t *romh_size, int *exrom, int *game); -bool cbm_crt_read_data(util::core_file &file, UINT8 *roml, UINT8 *romh); +bool cbm_crt_read_data(util::core_file &file, uint8_t *roml, uint8_t *romh); #endif diff --git a/src/lib/formats/cbm_tap.cpp b/src/lib/formats/cbm_tap.cpp index a7b28a8f8af..0b0950eebcc 100644 --- a/src/lib/formats/cbm_tap.cpp +++ b/src/lib/formats/cbm_tap.cpp @@ -130,7 +130,7 @@ below could be not working. FP ] #define CBM_HEADER_SIZE 20 -static INT16 wave_data = 0; +static int16_t wave_data = 0; static int len; @@ -155,7 +155,7 @@ static void toggle_wave_data(void ) wave_data = (wave_data == WAVE_HIGH) ? WAVE_LOW : WAVE_HIGH; } -static void cbm_output_wave( INT16 **buffer, int length ) +static void cbm_output_wave( int16_t **buffer, int length ) { if (buffer == nullptr) return; @@ -168,7 +168,7 @@ static void cbm_output_wave( INT16 **buffer, int length ) } -static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data ) +static int cbm_tap_do_work( int16_t **buffer, int length, const uint8_t *data ) { int i, j = 0; int size = 0; @@ -179,7 +179,7 @@ static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data ) int tap_frequency = 0; int byte_samples = 0; - UINT8 over_pulse_bytes[3] = {0 , 0, 0 }; + uint8_t over_pulse_bytes[3] = {0 , 0, 0 }; int over_pulse_length = 0; /* These waveamp_* values are currently stored but not used. Further investigations are needed to find real pulse amplitude @@ -228,7 +228,7 @@ static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data ) for (i = CBM_HEADER_SIZE; i < length; i++) { - UINT8 byte = data[i]; + uint8_t byte = data[i]; /* .TAP v0 */ /* Here is simple: @@ -319,7 +319,7 @@ static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data ) } -static int cbm_tap_to_wav_size( const UINT8 *tapdata, int taplen ) +static int cbm_tap_to_wav_size( const uint8_t *tapdata, int taplen ) { int size = cbm_tap_do_work(nullptr, taplen, tapdata); len = taplen; @@ -327,11 +327,11 @@ static int cbm_tap_to_wav_size( const UINT8 *tapdata, int taplen ) return size; } -static int cbm_tap_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) +static int cbm_tap_fill_wave( int16_t *buffer, int length, uint8_t *bytes ) { - INT16 *p = buffer; + int16_t *p = buffer; - return cbm_tap_do_work(&p, len, (const UINT8 *)bytes); + return cbm_tap_do_work(&p, len, (const uint8_t *)bytes); } diff --git a/src/lib/formats/ccvf_dsk.cpp b/src/lib/formats/ccvf_dsk.cpp index abce7fb55da..12acbeea37a 100644 --- a/src/lib/formats/ccvf_dsk.cpp +++ b/src/lib/formats/ccvf_dsk.cpp @@ -44,7 +44,7 @@ const ccvf_format::format ccvf_format::file_formats[] = { {} }; -int ccvf_format::identify(io_generic *io, UINT32 form_factor) +int ccvf_format::identify(io_generic *io, uint32_t form_factor) { char h[36]; @@ -85,20 +85,20 @@ floppy_image_format_t::desc_e* ccvf_format::get_desc_8n1(const format &f, int &c return desc; } -bool ccvf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool ccvf_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { const format &f = formats[0]; - UINT64 size = io_generic_size(io); - std::vector img(size); + uint64_t size = io_generic_size(io); + std::vector img(size); io_generic_read(io, &img[0], 0, size); std::string ccvf = std::string((const char *)&img[0], size); - std::vector bytes(78720); + std::vector bytes(78720); int start = 0, end = 0; std::string line; - UINT32 byteoffs = 0; + uint32_t byteoffs = 0; char hex[3] = {0}; do { @@ -115,11 +115,11 @@ bool ccvf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) start = end + 1; } while (start > 0 && end != -1); - UINT64 pos = 0; + uint64_t pos = 0; int total_size = 200000000/f.cell_size; for(int track=0; track < f.track_count; track++) { - std::vector buffer; + std::vector buffer; int offset = 0; for (int i=0; i<1920 && postracks; } -static UINT64 cqm_get_track_offset(floppy_image_legacy *floppy, int head, int track) +static uint64_t cqm_get_track_offset(floppy_image_legacy *floppy, int head, int track) { return get_tag(floppy)->track_offsets[(track<<1) + head]; } -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) +static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset) { - UINT64 pos = 0; - UINT8 data; - INT16 len; + uint64_t pos = 0; + uint8_t data; + int16_t len; int s; if ((head < 0) || (head >= get_tag(floppy)->heads) || (track < 0) || (track >= get_tag(floppy)->tracks) @@ -103,7 +103,7 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in static floperr_t internal_cqm_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) { - UINT64 offset; + uint64_t offset; floperr_t err; // take sector offset @@ -125,7 +125,7 @@ static floperr_t cqm_read_indexed_sector(floppy_image_legacy *floppy, int head, return internal_cqm_read_sector(floppy, head, track, sector, TRUE, buffer, buflen); } -static floperr_t cqm_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t cqm_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { floperr_t err; err = get_offset(floppy, head, track, sector, FALSE, nullptr); @@ -138,7 +138,7 @@ static floperr_t cqm_get_sector_length(floppy_image_legacy *floppy, int head, in return FLOPPY_ERROR_SUCCESS; } -static floperr_t cqm_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +static floperr_t cqm_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { if (sector_index >= get_tag(floppy)->sector_per_track) return FLOPPY_ERROR_SEEKERROR; @@ -163,9 +163,9 @@ FLOPPY_CONSTRUCT( cqm_dsk_construct ) { struct FloppyCallbacks *callbacks; struct cqmdsk_tag *tag; - UINT8 header[CQM_HEADER_SIZE]; - UINT64 pos = 0; - INT16 len; + uint8_t header[CQM_HEADER_SIZE]; + uint64_t pos = 0; + int16_t len; int head; int track; int s; @@ -194,7 +194,7 @@ FLOPPY_CONSTRUCT( cqm_dsk_construct ) pos = CQM_HEADER_SIZE + (header[0x70] << 8) + header[0x6f]; track = 0; head = 0; - tag->buf = (UINT8*)malloc(tag->sector_size*tag->sector_per_track); + tag->buf = (uint8_t*)malloc(tag->sector_size*tag->sector_per_track); do { tag->track_offsets[(track<<1) + head] = pos; s = 0; @@ -261,9 +261,9 @@ const char *cqm_format::extensions() const return "cqm,cqi,dsk"; } -int cqm_format::identify(io_generic *io, UINT32 form_factor) +int cqm_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 h[3]; + uint8_t h[3]; io_generic_read(io, h, 0, 3); if (h[0] == 'C' && h[1] == 'Q' && h[2] == 0x14) @@ -272,11 +272,11 @@ int cqm_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool cqm_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool cqm_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { const int max_size = 4*1024*1024; // 4MB ought to be large enough for any floppy - std::vector imagebuf(max_size); - UINT8 header[CQM_HEADER_SIZE]; + std::vector imagebuf(max_size); + uint8_t header[CQM_HEADER_SIZE]; io_generic_read(io, header, 0, CQM_HEADER_SIZE); int sector_size = (header[0x04] << 8) | header[0x03]; @@ -318,13 +318,13 @@ bool cqm_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) int base_cell_count = rate*60/rpm; int cqm_size = io_generic_size(io); - std::vector cqmbuf(cqm_size); + std::vector cqmbuf(cqm_size); io_generic_read(io, &cqmbuf[0], 0, cqm_size); // decode the RLE data for (int s = 0, pos = CQM_HEADER_SIZE + comment_size; pos < cqm_size; ) { - INT16 len = (cqmbuf[pos + 1] << 8) | cqmbuf[pos]; + int16_t len = (cqmbuf[pos + 1] << 8) | cqmbuf[pos]; pos += 2; if(len < 0) { diff --git a/src/lib/formats/cqm_dsk.h b/src/lib/formats/cqm_dsk.h index 48bc8d5521c..7ae12ccff2b 100644 --- a/src/lib/formats/cqm_dsk.h +++ b/src/lib/formats/cqm_dsk.h @@ -18,8 +18,8 @@ class cqm_format : public floppy_image_format_t public: cqm_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; diff --git a/src/lib/formats/csw_cas.cpp b/src/lib/formats/csw_cas.cpp index 0790dd16dee..a8feccf5300 100644 --- a/src/lib/formats/csw_cas.cpp +++ b/src/lib/formats/csw_cas.cpp @@ -32,32 +32,32 @@ Offset Value Type Description #define CSW_WAV_FREQUENCY 44100 -static const UINT8 CSW_HEADER[] = { "Compressed Square Wave" }; +static const uint8_t CSW_HEADER[] = { "Compressed Square Wave" }; -static UINT32 get_leuint32(const void *ptr) +static uint32_t get_leuint32(const void *ptr) { - UINT32 value; + uint32_t value; memcpy(&value, ptr, sizeof(value)); return little_endianize_int32(value); } static int mycaslen; -static int csw_cas_to_wav_size( const UINT8 *casdata, int caslen ) +static int csw_cas_to_wav_size( const uint8_t *casdata, int caslen ) { - UINT32 SampleRate; - UINT32 NumberOfPulses; - UINT8 MajorRevision; - UINT8 MinorRevision; - UINT8 CompressionType; - UINT8 Flags; - UINT8 HeaderExtensionLength; - std::vector gz_ptr; + uint32_t SampleRate; + uint32_t NumberOfPulses; + uint8_t MajorRevision; + uint8_t MinorRevision; + uint8_t CompressionType; + uint8_t Flags; + uint8_t HeaderExtensionLength; + std::vector gz_ptr; int total_size; z_stream d_stream; int err; - UINT8 *in_ptr; + uint8_t *in_ptr; int bsize=0; if ( memcmp( casdata, CSW_HEADER, sizeof(CSW_HEADER)-1 ) ) @@ -98,7 +98,7 @@ static int csw_cas_to_wav_size( const UINT8 *casdata, int caslen ) mycaslen=caslen; //from here on down for now I am assuming it is compressed csw file. - in_ptr = (UINT8*) casdata+0x34+HeaderExtensionLength; + in_ptr = (uint8_t*) casdata+0x34+HeaderExtensionLength; gz_ptr.resize( 8 ); @@ -163,20 +163,20 @@ cleanup: return -1; } -static int csw_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) +static int csw_cas_fill_wave( int16_t *buffer, int length, uint8_t *bytes ) { - UINT32 SampleRate; - UINT32 NumberOfPulses; - UINT8 CompressionType; - UINT8 Flags; - UINT8 HeaderExtensionLength; - INT8 Bit; - - std::vector gz_ptr; + uint32_t SampleRate; + uint32_t NumberOfPulses; + uint8_t CompressionType; + uint8_t Flags; + uint8_t HeaderExtensionLength; + int8_t Bit; + + std::vector gz_ptr; int total_size; z_stream d_stream; int err; - UINT8 *in_ptr; + uint8_t *in_ptr; int bsize=0; int i; @@ -206,7 +206,7 @@ static int csw_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) //from here on down for now I am assuming it is compressed csw file. - in_ptr = (UINT8*) bytes+0x34+HeaderExtensionLength; + in_ptr = (uint8_t*) bytes+0x34+HeaderExtensionLength; gz_ptr.resize( 8 ); @@ -288,7 +288,7 @@ static const struct CassetteLegacyWaveFiller csw_legacy_fill_wave = { static cassette_image::error csw_cassette_identify( cassette_image *cassette, struct CassetteOptions *opts ) { - UINT8 header[22]; + uint8_t header[22]; cassette_image_read(cassette, header, 0, sizeof(header)); if (memcmp(&header[0], CSW_HEADER, sizeof(CSW_HEADER) - 1)) { diff --git a/src/lib/formats/d64_dsk.cpp b/src/lib/formats/d64_dsk.cpp index 2cece44c43a..f26a3e676fb 100644 --- a/src/lib/formats/d64_dsk.cpp +++ b/src/lib/formats/d64_dsk.cpp @@ -51,7 +51,7 @@ const d64_format::format d64_format::file_formats[] = { {} }; -const UINT32 d64_format::cell_size[] = +const uint32_t d64_format::cell_size[] = { 4000, // 16MHz/16/4 3750, // 16MHz/15/4 @@ -79,20 +79,20 @@ const int d64_format::speed_zone[] = 0, 0 // 41-42 }; -int d64_format::find_size(io_generic *io, UINT32 form_factor) const +int d64_format::find_size(io_generic *io, uint32_t form_factor) const { - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for(int i=0; formats[i].sector_count; i++) { const format &f = formats[i]; - if(size == (UINT32) f.sector_count*f.sector_base_size*f.head_count) + if(size == (uint32_t) f.sector_count*f.sector_base_size*f.head_count) return i; - if(size == (UINT32) (f.sector_count*f.sector_base_size*f.head_count) + f.sector_count) + if(size == (uint32_t) (f.sector_count*f.sector_base_size*f.head_count) + f.sector_count) return i; } return -1; } -int d64_format::identify(io_generic *io, UINT32 form_factor) +int d64_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -114,9 +114,9 @@ int d64_format::get_disk_id_offset(const format &f) return 0x165a2; } -void d64_format::get_disk_id(const format &f, io_generic *io, UINT8 &id1, UINT8 &id2) +void d64_format::get_disk_id(const format &f, io_generic *io, uint8_t &id1, uint8_t &id2) { - UINT8 id[2]; + uint8_t id[2]; io_generic_read(io, id, get_disk_id_offset(f), 2); id1 = id[0]; id2 = id[1]; @@ -141,7 +141,7 @@ int d64_format::compute_track_size(const format &f, int track) return this->get_sectors_per_track(f, track) * f.sector_base_size; } -UINT32 d64_format::get_cell_size(const format &f, int track) +uint32_t d64_format::get_cell_size(const format &f, int track) { return cell_size[speed_zone[track]]; } @@ -151,7 +151,7 @@ int d64_format::get_sectors_per_track(const format &f, int track) return sectors_per_track[track]; } -floppy_image_format_t::desc_e* d64_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) +floppy_image_format_t::desc_e* d64_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) { static floppy_image_format_t::desc_e desc[] = { /* 00 */ { SECTOR_LOOP_START, 0, -1 }, @@ -186,7 +186,7 @@ floppy_image_format_t::desc_e* d64_format::get_sector_desc(const format &f, int return desc; } -void d64_format::build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, UINT32 error_offs, desc_s *sectors, int sector_count) const +void d64_format::build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, uint32_t error_offs, desc_s *sectors, int sector_count) const { for (int i = 0; i < sector_count; i++) { sectors[i].data = sectdata + sect_offs; @@ -206,7 +206,7 @@ void d64_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_ desc[22].p1 >>= remaining_size & 0x01; } -bool d64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool d64_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { int type = find_size(io, form_factor); if(type == -1) @@ -214,10 +214,10 @@ bool d64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) const format &f = formats[type]; - UINT64 size = io_generic_size(io); - std::vector img; + uint64_t size = io_generic_size(io); + std::vector img; - if(size == (UINT32)f.sector_count*f.sector_base_size) { + if(size == (uint32_t)f.sector_count*f.sector_base_size) { img.resize(size + f.sector_count); memset(&img[0], ERROR_00, size + f.sector_count); } @@ -229,7 +229,7 @@ bool d64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) int track_offset = 0, error_offset = f.sector_count*f.sector_base_size; - UINT8 id1 = 0, id2 = 0; + uint8_t id1 = 0, id2 = 0; get_disk_id(f, io, id1, id2); for (int head = 0; head < f.head_count; head++) { @@ -272,7 +272,7 @@ bool d64_format::save(io_generic *io, floppy_image *image) for(int track=0; track < f.track_count; track++) { int sector_count = this->get_sectors_per_track(f, track); int track_size = compute_track_size(f, track); - UINT8 sectdata[40*256] = { 0 }; + uint8_t sectdata[40*256] = { 0 }; desc_s sectors[40]; int offset = get_image_offset(f, head, track); @@ -287,8 +287,8 @@ bool d64_format::save(io_generic *io, floppy_image *image) void d64_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count) { - UINT8 bitstream[500000/8]; - UINT8 sectdata[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectdata[50000]; desc_xs sectors[256]; int physical_track = this->get_physical_track(f, head, track); int cell_size = this->get_cell_size(f, track); @@ -305,7 +305,7 @@ void d64_format::extract_sectors(floppy_image *image, const format &f, desc_s *s memset((void *)ds.data, 0, ds.size); else if(xs.size < ds.size) { memcpy((void *)ds.data, xs.data, xs.size); - memset((UINT8 *)ds.data + xs.size, 0, xs.size - ds.size); + memset((uint8_t *)ds.data + xs.size, 0, xs.size - ds.size); } else memcpy((void *)ds.data, xs.data, ds.size); } diff --git a/src/lib/formats/d64_dsk.h b/src/lib/formats/d64_dsk.h index c5bef4b3313..28726332fa3 100644 --- a/src/lib/formats/d64_dsk.h +++ b/src/lib/formats/d64_dsk.h @@ -16,15 +16,15 @@ class d64_format : public floppy_image_format_t { public: struct format { - UINT32 form_factor; // See floppy_image for possible values - UINT32 variant; // See floppy_image for possible values - - UINT16 sector_count; - UINT8 track_count; - UINT8 head_count; - UINT16 sector_base_size; - UINT8 gap_1; - UINT8 gap_2; + uint32_t form_factor; // See floppy_image for possible values + uint32_t variant; // See floppy_image for possible values + + uint16_t sector_count; + uint8_t track_count; + uint8_t head_count; + uint16_t sector_base_size; + uint8_t gap_1; + uint8_t gap_2; }; d64_format(); @@ -34,8 +34,8 @@ public: virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual bool supports_save() const override { return true; } @@ -58,23 +58,23 @@ protected: const format *formats; - int find_size(io_generic *io, UINT32 form_factor) const; + int find_size(io_generic *io, uint32_t form_factor) const; virtual int get_physical_track(const format &f, int head, int track); - virtual UINT32 get_cell_size(const format &f, int track); + virtual uint32_t get_cell_size(const format &f, int track); virtual int get_sectors_per_track(const format &f, int track); virtual int get_disk_id_offset(const format &f); - void get_disk_id(const format &f, io_generic *io, UINT8 &id1, UINT8 &id2); + void get_disk_id(const format &f, io_generic *io, uint8_t &id1, uint8_t &id2); virtual int get_image_offset(const format &f, int head, int track); int compute_track_size(const format &f, int track); virtual int get_gap2(const format &f, int head, int track) { return f.gap_2; } - virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2); - void build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, UINT32 error_offs, desc_s *sectors, int sector_count) const; + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2); + void build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, uint32_t error_offs, desc_s *sectors, int sector_count) const; virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size); void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count); static const format file_formats[]; - static const UINT32 cell_size[]; + static const uint32_t cell_size[]; static const int sectors_per_track[]; static const int speed_zone[]; }; diff --git a/src/lib/formats/d80_dsk.cpp b/src/lib/formats/d80_dsk.cpp index 12ea14ad80f..e08ef22f6b9 100644 --- a/src/lib/formats/d80_dsk.cpp +++ b/src/lib/formats/d80_dsk.cpp @@ -42,7 +42,7 @@ const d80_format::format d80_format::file_formats[] = { {} }; -const UINT32 d80_format::d80_cell_size[] = +const uint32_t d80_format::d80_cell_size[] = { 2667, // 12MHz/2/16 2500, // 12MHz/2/15 @@ -75,7 +75,7 @@ int d80_format::get_physical_track(const format &f, int head, int track) return track; } -UINT32 d80_format::get_cell_size(const format &f, int track) +uint32_t d80_format::get_cell_size(const format &f, int track) { return d80_cell_size[d80_speed_zone[track]]; } @@ -91,7 +91,7 @@ int d80_format::get_disk_id_offset(const format &f) return 0x44e18; } -floppy_image_format_t::desc_e* d80_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) +floppy_image_format_t::desc_e* d80_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) { static floppy_image_format_t::desc_e desc[] = { /* 00 */ { SECTOR_LOOP_START, 0, -1 }, diff --git a/src/lib/formats/d80_dsk.h b/src/lib/formats/d80_dsk.h index d823b85a9bc..4f6482efffe 100644 --- a/src/lib/formats/d80_dsk.h +++ b/src/lib/formats/d80_dsk.h @@ -26,15 +26,15 @@ protected: const format *formats; virtual int get_physical_track(const format &f, int head, int track) override; - virtual UINT32 get_cell_size(const format &f, int track) override; + virtual uint32_t get_cell_size(const format &f, int track) override; virtual int get_sectors_per_track(const format &f, int track) override; virtual int get_disk_id_offset(const format &f) override; - virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) override; + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) override; virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) override; static const format file_formats[]; - static const UINT32 d80_cell_size[]; + static const uint32_t d80_cell_size[]; static const int d80_speed_zone[]; static const int d80_sectors_per_track[]; }; diff --git a/src/lib/formats/d88_dsk.cpp b/src/lib/formats/d88_dsk.cpp index 21c73fec5c0..cc95dcedb69 100644 --- a/src/lib/formats/d88_dsk.cpp +++ b/src/lib/formats/d88_dsk.cpp @@ -38,11 +38,11 @@ struct d88_tag { - UINT32 image_size; - UINT32 trackoffset[164]; - UINT8 write_protect; - UINT8 disk_type; - UINT8 heads; + uint32_t image_size; + uint32_t trackoffset[164]; + uint8_t write_protect; + uint8_t disk_type; + uint8_t heads; }; static struct d88_tag *get_d88_tag(floppy_image_legacy *floppy) @@ -53,8 +53,8 @@ static struct d88_tag *get_d88_tag(floppy_image_legacy *floppy) static int d88_get_sector_id(floppy_image_legacy *floppy, int head, int track, int sector_index) { struct d88_tag* tag = get_d88_tag(floppy); - UINT32 offset; - UINT8 sector_hdr[16]; + uint32_t offset; + uint8_t sector_hdr[16]; int x; offset = tag->trackoffset[(track*tag->heads)+head]; @@ -91,8 +91,8 @@ static int d88_get_heads_per_disk(floppy_image_legacy *floppy) static int d88_get_sectors_per_track(floppy_image_legacy *floppy, int head, int track) { struct d88_tag* tag = get_d88_tag(floppy); - UINT32 offset; - UINT8 sector_hdr[16]; + uint32_t offset; + uint8_t sector_hdr[16]; offset = tag->trackoffset[(track*tag->heads)+head]; @@ -101,12 +101,12 @@ static int d88_get_sectors_per_track(floppy_image_legacy *floppy, int head, int return sector_hdr[4]; } -static floperr_t d88_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t d88_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { struct d88_tag* tag = get_d88_tag(floppy); - UINT32 offset; - UINT8 sector_hdr[16]; - UINT32 len; + uint32_t offset; + uint8_t sector_hdr[16]; + uint32_t len; int count,secs; offset = tag->trackoffset[(track*tag->heads)+head]; @@ -131,20 +131,20 @@ static floperr_t d88_get_sector_length(floppy_image_legacy *floppy, int head, in return FLOPPY_ERROR_SEEKERROR; } -static floperr_t d88_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen) +static floperr_t d88_read_track(floppy_image_legacy *floppy, int head, int track, uint64_t offset, void *buffer, size_t buflen) { // floperr_t err; return FLOPPY_ERROR_UNSUPPORTED; } -static UINT32 d88_get_sector_offset(floppy_image_legacy* floppy, int head, int track, int sector) +static uint32_t d88_get_sector_offset(floppy_image_legacy* floppy, int head, int track, int sector) { struct d88_tag* tag = get_d88_tag(floppy); - UINT32 offset = 0; - UINT8 sector_hdr[16]; - UINT32 len; - UINT32 secs; + uint32_t offset = 0; + uint8_t sector_hdr[16]; + uint32_t len; + uint32_t secs; int count; // get offset of the beginning of the track @@ -169,11 +169,11 @@ static UINT32 d88_get_sector_offset(floppy_image_legacy* floppy, int head, int t return 0; } -static floperr_t d88_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +static floperr_t d88_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { struct d88_tag* tag = get_d88_tag(floppy); - UINT32 offset; - UINT8 sector_hdr[16]; + uint32_t offset; + uint8_t sector_hdr[16]; int x; offset = tag->trackoffset[(track*tag->heads)+head]; @@ -216,8 +216,8 @@ static floperr_t d88_get_indexed_sector_info(floppy_image_legacy *floppy, int he static floperr_t d88_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen) { - UINT64 offset; - UINT32 sector_length; + uint64_t offset; + uint32_t sector_length; offset = d88_get_sector_offset(floppy,head,track,sector); @@ -245,8 +245,8 @@ static floperr_t d88_read_indexed_sector(floppy_image_legacy *floppy, int head, static floperr_t d88_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam) { - UINT64 offset; - UINT32 sector_length; + uint64_t offset; + uint32_t sector_length; offset = d88_get_sector_offset(floppy,head,track,sector); @@ -272,9 +272,9 @@ static floperr_t d88_write_indexed_sector(floppy_image_legacy *floppy, int head, return d88_write_sector(floppy,head,track,sec,buffer,buflen,ddam); } -static void d88_get_header(floppy_image_legacy* floppy,UINT32* size, UINT8* prot, UINT8* type, UINT32* offsets) +static void d88_get_header(floppy_image_legacy* floppy,uint32_t* size, uint8_t* prot, uint8_t* type, uint32_t* offsets) { - UINT8 header[D88_HEADER_LEN]; + uint8_t header[D88_HEADER_LEN]; int x,s; floppy_image_read(floppy,header,0,D88_HEADER_LEN); @@ -282,8 +282,8 @@ static void d88_get_header(floppy_image_legacy* floppy,UINT32* size, UINT8* prot #ifdef SPOT_DUPLICATES // there exist many .d88 files with same data and different headers and // this allows to spot duplicates, making easier to debug softlists. - UINT32 temp_size = floppy_image_size(floppy); - UINT8 tmp_copy[temp_size - D88_HEADER_LEN]; + uint32_t temp_size = floppy_image_size(floppy); + uint8_t tmp_copy[temp_size - D88_HEADER_LEN]; floppy_image_read(floppy,tmp_copy,D88_HEADER_LEN,temp_size - D88_HEADER_LEN); printf("CRC16: %d\n", ccitt_crc16(0xffff, tmp_copy, temp_size - D88_HEADER_LEN)); #endif @@ -317,7 +317,7 @@ static void d88_get_header(floppy_image_legacy* floppy,UINT32* size, UINT8* prot FLOPPY_IDENTIFY(d88_dsk_identify) { - UINT32 size; + uint32_t size; d88_get_header(floppy,&size,nullptr,nullptr,nullptr); @@ -336,9 +336,9 @@ FLOPPY_CONSTRUCT(d88_dsk_construct) { struct FloppyCallbacks *callbacks; struct d88_tag *tag; - UINT32 size; - UINT8 prot,type = 0; - UINT32 offs[164]; + uint32_t size; + uint8_t prot,type = 0; + uint32_t offs[164]; int x; if(params) @@ -414,22 +414,22 @@ const char *d88_format::extensions() const return "d77,d88,1dd"; } -int d88_format::identify(io_generic *io, UINT32 form_factor) +int d88_format::identify(io_generic *io, uint32_t form_factor) { - UINT64 size = io_generic_size(io); - UINT8 h[32]; + uint64_t size = io_generic_size(io); + uint8_t h[32]; io_generic_read(io, h, 0, 32); - if((little_endianize_int32(*(UINT32 *)(h+0x1c)) == size) && + if((little_endianize_int32(*(uint32_t *)(h+0x1c)) == size) && (h[0x1b] == 0x00 || h[0x1b] == 0x10 || h[0x1b] == 0x20 || h[0x1b] == 0x30 || h[0x1b] == 0x40)) return 100; return 0; } -bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool d88_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT8 h[32]; + uint8_t h[32]; io_generic_read(io, h, 0, 32); @@ -476,7 +476,7 @@ bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) if(!head_count) return false; - UINT32 track_pos[164]; + uint32_t track_pos[164]; io_generic_read(io, track_pos, 32, 164*4); for(int track=0; track < track_count; track++) @@ -486,17 +486,17 @@ bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) continue; desc_pc_sector sects[256]; - UINT8 sect_data[65536]; + uint8_t sect_data[65536]; int sdatapos = 0; int sector_count = 1; for(int i=0; i data; + uint64_t size = io_generic_size(io); + uint64_t pos = 4; + std::vector data; int onerev_time = 0; // time for one revolution, used to guess clock and rpm for DFE2 files unsigned long clock_rate = 100000000; // sample clock rate in megahertz int rpm=360; // drive rpm while(pos < size) { - UINT8 h[10]; + uint8_t h[10]; io_generic_read(io, h, pos, 10); - UINT16 track = (h[0] << 8) | h[1]; - UINT16 head = (h[2] << 8) | h[3]; + uint16_t track = (h[0] << 8) | h[1]; + uint16_t head = (h[2] << 8) | h[3]; // Ignore sector - UINT32 tsize = (h[6] << 24) | (h[7] << 16) | (h[8] << 8) | h[9]; + uint32_t tsize = (h[6] << 24) | (h[7] << 16) | (h[8] << 8) | h[9]; // if the position-so-far-in-file plus 10 (for the header) plus track size // is larger than the size of the file, free buffers and bail out @@ -98,7 +98,7 @@ bool dfi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) //int index_polarity = 1; // current polarity of index, starts high int total_time = 0; // total sampled time per track for(int i=0; i &buf = image->get_buffer(track, head); + std::vector &buf = image->get_buffer(track, head); buf.resize(tsize); int cur_time = 0; @@ -162,11 +162,11 @@ bool dfi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) #endif index_count = 0; //index_polarity = 0; - UINT32 mg = floppy_image::MG_A; + uint32_t mg = floppy_image::MG_A; int tpos = 0; buf[tpos++] = mg; for(int i=0; i MIN_THRESH) && (trans_time <= MAX_THRESH))) { mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - buf[tpos++] = mg | UINT32((200000000ULL*cur_time)/index_time); + buf[tpos++] = mg | uint32_t((200000000ULL*cur_time)/index_time); prev_time = cur_time; } // the long case: we probably missed a transition, stuff an extra guessed one in there to see if it helps @@ -196,14 +196,14 @@ bool dfi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; if (((track%2)==0)&&(head==0)) fprintf(stderr,"missed transition, total time for transition is %d\n",trans_time); #ifndef FAKETRANS_ONE - buf[tpos++] = mg | UINT32((200000000ULL*(cur_time-(trans_time/2)))/index_time); // generate imaginary transition at half period + buf[tpos++] = mg | uint32_t((200000000ULL*(cur_time-(trans_time/2)))/index_time); // generate imaginary transition at half period #else - buf[tpos++] = mg | UINT32((200000000ULL*(cur_time-((trans_time*2)/3)))/index_time); + buf[tpos++] = mg | uint32_t((200000000ULL*(cur_time-((trans_time*2)/3)))/index_time); mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - buf[tpos++] = mg | UINT32((200000000ULL*(cur_time-(trans_time/3)))/index_time); + buf[tpos++] = mg | uint32_t((200000000ULL*(cur_time-(trans_time/3)))/index_time); #endif mg = mg == floppy_image::MG_A ? floppy_image::MG_B : floppy_image::MG_A; - buf[tpos++] = mg | UINT32(200000000ULL*cur_time/index_time); // generate transition now + buf[tpos++] = mg | uint32_t(200000000ULL*cur_time/index_time); // generate transition now prev_time = cur_time; } } diff --git a/src/lib/formats/dfi_dsk.h b/src/lib/formats/dfi_dsk.h index b25278275f3..030776a9b4f 100644 --- a/src/lib/formats/dfi_dsk.h +++ b/src/lib/formats/dfi_dsk.h @@ -10,8 +10,8 @@ class dfi_format : public floppy_image_format_t public: dfi_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; // virtual bool save(io_generic *io, floppy_image *image); virtual const char *name() const override; diff --git a/src/lib/formats/dim_dsk.cpp b/src/lib/formats/dim_dsk.cpp index 42668b39faf..67c04adc2bf 100644 --- a/src/lib/formats/dim_dsk.cpp +++ b/src/lib/formats/dim_dsk.cpp @@ -16,9 +16,9 @@ FLOPPY_IDENTIFY(dim_dsk_identify) { - UINT8 dim_header[16]; + uint8_t dim_header[16]; - floppy_image_read(floppy, (UINT8*)dim_header,0xab,16); + floppy_image_read(floppy, (uint8_t*)dim_header,0xab,16); if(strncmp((const char*)dim_header,"DIFC HEADER",11) == 0) *vote = 100; @@ -36,9 +36,9 @@ FLOPPY_CONSTRUCT(dim_dsk_construct) int sectors = 8; // per track int sectorlen = 1024; int firstsector = 0x01; - UINT8 format_tmp; + uint8_t format_tmp; int x; - UINT16 temp; + uint16_t temp; if(params) { @@ -132,9 +132,9 @@ const char *dim_format::extensions() const return "dim"; } -int dim_format::identify(io_generic *io, UINT32 form_factor) +int dim_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 h[16]; + uint8_t h[16]; io_generic_read(io, h, 0xab, 16); @@ -144,11 +144,11 @@ int dim_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool dim_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool dim_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { int offset = 0x100; - UINT8 h; - UINT8 track_total = 77; + uint8_t h; + uint8_t track_total = 77; int cell_count = form_factor == floppy_image::FF_35 ? 200000 : 166666; io_generic_read(io, &h, 0, 1); @@ -192,7 +192,7 @@ bool dim_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) for(int track=0; track < track_total; track++) for(int head=0; head < 2; head++) { desc_pc_sector sects[30]; - UINT8 sect_data[10000]; + uint8_t sect_data[10000]; int sdatapos = 0; for(int i=0; i track_data(track_size); - std::vector raw_track_data; + std::vector track_data(track_size); + std::vector raw_track_data; int iam_location = -1; int idam_location[64]; int dam_location[64]; @@ -137,8 +137,8 @@ bool dmk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) } // Find IDAM locations - UINT16 track_header_offset = 0; - UINT16 track_offset = ( ( track_data[track_header_offset + 1] << 8 ) | track_data[track_header_offset] ) & 0x3fff; + uint16_t track_header_offset = 0; + uint16_t track_offset = ( ( track_data[track_header_offset + 1] << 8 ) | track_data[track_header_offset] ) & 0x3fff; track_header_offset += 2; while ( track_offset != 0 && track_offset >= 0x83 && track_offset < track_size && track_header_offset < 0x80 ) diff --git a/src/lib/formats/dmk_dsk.h b/src/lib/formats/dmk_dsk.h index 5a2f2f6cb7c..6b15000baab 100644 --- a/src/lib/formats/dmk_dsk.h +++ b/src/lib/formats/dmk_dsk.h @@ -20,8 +20,8 @@ class dmk_format : public floppy_image_format_t public: dmk_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; diff --git a/src/lib/formats/dsk_dsk.cpp b/src/lib/formats/dsk_dsk.cpp index 528f30c24be..a4b498f47b2 100644 --- a/src/lib/formats/dsk_dsk.cpp +++ b/src/lib/formats/dsk_dsk.cpp @@ -23,7 +23,7 @@ struct dskdsk_tag int heads; int tracks; int sector_size; - UINT64 track_offsets[84*2]; /* offset within data for each track */ + uint64_t track_offsets[84*2]; /* offset within data for each track */ }; @@ -39,7 +39,7 @@ static struct dskdsk_tag *get_tag(floppy_image_legacy *floppy) FLOPPY_IDENTIFY( dsk_dsk_identify ) { - UINT8 header[8]; + uint8_t header[8]; floppy_image_read(floppy, header, 0, 8); if ( memcmp( header, MV_CPC, 8 ) ==0) { @@ -63,17 +63,17 @@ static int dsk_get_tracks_per_disk(floppy_image_legacy *floppy) return get_tag(floppy)->tracks; } -static UINT64 dsk_get_track_offset(floppy_image_legacy *floppy, int head, int track) +static uint64_t dsk_get_track_offset(floppy_image_legacy *floppy, int head, int track) { return get_tag(floppy)->track_offsets[(track<<1) + head]; } -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) +static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset) { - UINT64 offs; - UINT64 track_offset; - UINT8 track_info[0x100]; - UINT8 sectors_per_track; + uint64_t offs; + uint64_t track_offset; + uint8_t track_info[0x100]; + uint8_t sectors_per_track; int i; /* translate the sector to a raw sector */ @@ -113,7 +113,7 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in static floperr_t internal_dsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) { - UINT64 offset; + uint64_t offset; floperr_t err; err = get_offset(floppy, head, track, sector, sector_is_index, &offset); if (err) @@ -126,7 +126,7 @@ static floperr_t internal_dsk_read_sector(floppy_image_legacy *floppy, int head, static floperr_t internal_dsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam) { - UINT64 offset; + uint64_t offset; floperr_t err; err = get_offset(floppy, head, track, sector, sector_is_index, &offset); @@ -159,7 +159,7 @@ static floperr_t dsk_write_indexed_sector(floppy_image_legacy *floppy, int head, return internal_dsk_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam); } -static floperr_t dsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t dsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { floperr_t err; err = get_offset(floppy, head, track, sector, FALSE, nullptr); @@ -172,11 +172,11 @@ static floperr_t dsk_get_sector_length(floppy_image_legacy *floppy, int head, in return FLOPPY_ERROR_SUCCESS; } -static floperr_t dsk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +static floperr_t dsk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { floperr_t retVal; - UINT64 offset; - UINT8 sector_info[0x100]; + uint64_t offset; + uint8_t sector_info[0x100]; int pos; retVal = get_offset(floppy, head, track, sector_index, FALSE, nullptr); @@ -202,8 +202,8 @@ FLOPPY_CONSTRUCT( dsk_dsk_construct ) { struct FloppyCallbacks *callbacks; struct dskdsk_tag *tag; - UINT8 header[0x100]; - UINT64 tmp = 0; + uint8_t header[0x100]; + uint64_t tmp = 0; int i; int skip,cnt; @@ -216,8 +216,8 @@ FLOPPY_CONSTRUCT( dsk_dsk_construct ) floppy_image_read(floppy, header, 0, 0x100); #ifdef SPOT_DUPLICATES // this allow to spot .dsk files with same data and different headers, making easier to debug softlists. - UINT32 temp_size = floppy_image_size(floppy); - UINT8 tmp_copy[temp_size - 0x100]; + uint32_t temp_size = floppy_image_size(floppy); + uint8_t tmp_copy[temp_size - 0x100]; floppy_image_read(floppy,tmp_copy,0x100,temp_size - 0x100); printf("CRC16: %d\n", ccitt_crc16(0xffff, tmp_copy, temp_size - 0x100)); #endif @@ -295,9 +295,9 @@ bool dsk_format::supports_save() const return false; } -int dsk_format::identify(io_generic *io, UINT32 form_factor) +int dsk_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 header[16]; + uint8_t header[16]; io_generic_read(io, &header, 0, sizeof(header)); if ( memcmp( header, DSK_FORMAT_HEADER, 8 ) ==0) { @@ -314,38 +314,38 @@ int dsk_format::identify(io_generic *io, UINT32 form_factor) struct track_header { - UINT8 headertag[13]; - UINT16 unused1; - UINT8 unused1b; - UINT8 track_number; - UINT8 side_number; - UINT8 datarate; - UINT8 rec_mode; - UINT8 sector_size_code; - UINT8 number_of_sector; - UINT8 gap3_length; - UINT8 filler_byte; + uint8_t headertag[13]; + uint16_t unused1; + uint8_t unused1b; + uint8_t track_number; + uint8_t side_number; + uint8_t datarate; + uint8_t rec_mode; + uint8_t sector_size_code; + uint8_t number_of_sector; + uint8_t gap3_length; + uint8_t filler_byte; }; struct sector_header { - UINT8 track; - UINT8 side; - UINT8 sector_id; - UINT8 sector_size_code; - UINT8 fdc_status_reg1; - UINT8 fdc_status_reg2; - UINT16 data_length; + uint8_t track; + uint8_t side; + uint8_t sector_id; + uint8_t sector_size_code; + uint8_t fdc_status_reg1; + uint8_t fdc_status_reg2; + uint16_t data_length; }; #pragma pack() -bool dsk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool dsk_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT8 header[0x100]; + uint8_t header[0x100]; bool extendformat = false; - UINT64 image_size = io_generic_size(io); + uint64_t image_size = io_generic_size(io); io_generic_read(io, &header, 0, sizeof(header)); if ( memcmp( header, EXT_FORMAT_HEADER, 16 ) ==0) { @@ -358,7 +358,7 @@ bool dsk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) skip = 2; } int tracks = header[0x30]; - UINT64 track_offsets[84*2]; + uint64_t track_offsets[84*2]; int cnt =0; if (!extendformat) { int tmp = 0x100; @@ -395,7 +395,7 @@ bool dsk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) track_header tr; io_generic_read(io, &tr,track_offsets[(track<<1)+side],sizeof(tr)); desc_pc_sector sects[256]; - UINT8 sect_data[65536]; + uint8_t sect_data[65536]; int sdatapos = 0; int pos = track_offsets[(track<<1)+side] + 0x100; for(int j=0;jtracks; track++) { - UINT8 type = header.track[track].type; + uint8_t type = header.track[track].type; int size = header.track[track].size * 256; if (LOG) LOG_FORMATS("FDI track %d type %02x size %d offset %d\n", track, type, size, offset); diff --git a/src/lib/formats/flex_dsk.cpp b/src/lib/formats/flex_dsk.cpp index ced4bf2f8a5..fb7dfb1499b 100644 --- a/src/lib/formats/flex_dsk.cpp +++ b/src/lib/formats/flex_dsk.cpp @@ -33,7 +33,7 @@ bool flex_format::supports_save() const return true; } -int flex_format::identify(io_generic *io, UINT32 form_factor) +int flex_format::identify(io_generic *io, uint32_t form_factor) { io_generic_read(io, &info, 256 * 2, sizeof(struct sysinfo_sector)); @@ -45,7 +45,7 @@ int flex_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool flex_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool flex_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { int spt = info.last_sec; int bps = 256; @@ -76,7 +76,7 @@ bool flex_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) for(int head=0;head < head_num;head++) { desc_pc_sector sects[80]; - UINT8 sect_data[20000]; + uint8_t sect_data[20000]; int sdatapos = 0; for(int i=0; iio.file = fp; floppy->io.procs = procs; floppy->io.filler = 0xFF; - floppy->flags = (UINT8) flags; + floppy->flags = (uint8_t) flags; return floppy; } @@ -337,14 +337,14 @@ void *floppy_create_tag(floppy_image_legacy *floppy, size_t tagsize) -UINT8 floppy_get_filler(floppy_image_legacy *floppy) +uint8_t floppy_get_filler(floppy_image_legacy *floppy) { return floppy->io.filler; } -void floppy_set_filler(floppy_image_legacy *floppy, UINT8 filler) +void floppy_set_filler(floppy_image_legacy *floppy, uint8_t filler) { floppy->io.filler = filler; } @@ -355,28 +355,28 @@ void floppy_set_filler(floppy_image_legacy *floppy, UINT8 filler) calls for accessing the raw disk image *********************************************************************/ -void floppy_image_read(floppy_image_legacy *floppy, void *buffer, UINT64 offset, size_t length) +void floppy_image_read(floppy_image_legacy *floppy, void *buffer, uint64_t offset, size_t length) { io_generic_read(&floppy->io, buffer, offset, length); } -void floppy_image_write(floppy_image_legacy *floppy, const void *buffer, UINT64 offset, size_t length) +void floppy_image_write(floppy_image_legacy *floppy, const void *buffer, uint64_t offset, size_t length) { io_generic_write(&floppy->io, buffer, offset, length); } -void floppy_image_write_filler(floppy_image_legacy *floppy, UINT8 filler, UINT64 offset, size_t length) +void floppy_image_write_filler(floppy_image_legacy *floppy, uint8_t filler, uint64_t offset, size_t length) { io_generic_write_filler(&floppy->io, filler, offset, length); } -UINT64 floppy_image_size(floppy_image_legacy *floppy) +uint64_t floppy_image_size(floppy_image_legacy *floppy) { return io_generic_size(&floppy->io); } @@ -393,9 +393,9 @@ static floperr_t floppy_readwrite_sector(floppy_image_legacy *floppy, int head, floperr_t err; const struct FloppyCallbacks *fmt; size_t this_buffer_len; - std::vector alloc_buf; - UINT32 sector_length; - UINT8 *buffer_ptr = (UINT8 *)buffer; + std::vector alloc_buf; + uint32_t sector_length; + uint8_t *buffer_ptr = (uint8_t *)buffer; floperr_t (*read_sector)(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen); floperr_t (*write_sector)(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam); @@ -532,7 +532,7 @@ floperr_t floppy_write_indexed_sector(floppy_image_legacy *floppy, int head, int } -static floperr_t floppy_get_track_data_offset(floppy_image_legacy *floppy, int head, int track, UINT64 *offset) +static floperr_t floppy_get_track_data_offset(floppy_image_legacy *floppy, int head, int track, uint64_t *offset) { floperr_t err; const struct FloppyCallbacks *callbacks; @@ -550,7 +550,7 @@ static floperr_t floppy_get_track_data_offset(floppy_image_legacy *floppy, int h -static floperr_t floppy_read_track_offset(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buffer_len) +static floperr_t floppy_read_track_offset(floppy_image_legacy *floppy, int head, int track, uint64_t offset, void *buffer, size_t buffer_len) { floperr_t err; const struct FloppyCallbacks *format; @@ -583,7 +583,7 @@ floperr_t floppy_read_track(floppy_image_legacy *floppy, int head, int track, vo floperr_t floppy_read_track_data(floppy_image_legacy *floppy, int head, int track, void *buffer, size_t buffer_len) { floperr_t err; - UINT64 offset; + uint64_t offset; err = floppy_get_track_data_offset(floppy, head, track, &offset); if (err) @@ -594,7 +594,7 @@ floperr_t floppy_read_track_data(floppy_image_legacy *floppy, int head, int trac -static floperr_t floppy_write_track_offset(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buffer_len) +static floperr_t floppy_write_track_offset(floppy_image_legacy *floppy, int head, int track, uint64_t offset, const void *buffer, size_t buffer_len) { floperr_t err; @@ -629,7 +629,7 @@ floperr_t floppy_write_track(floppy_image_legacy *floppy, int head, int track, c floperr_t floppy_write_track_data(floppy_image_legacy *floppy, int head, int track, const void *buffer, size_t buffer_len) { floperr_t err; - UINT64 offset; + uint64_t offset; err = floppy_get_track_data_offset(floppy, head, track, &offset); if (err) @@ -690,7 +690,7 @@ int floppy_get_heads_per_disk(floppy_image_legacy *floppy) -UINT32 floppy_get_track_size(floppy_image_legacy *floppy, int head, int track) +uint32_t floppy_get_track_size(floppy_image_legacy *floppy, int head, int track) { const struct FloppyCallbacks *fmt; @@ -703,7 +703,7 @@ UINT32 floppy_get_track_size(floppy_image_legacy *floppy, int head, int track) -floperr_t floppy_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +floperr_t floppy_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { const struct FloppyCallbacks *fmt; @@ -716,7 +716,7 @@ floperr_t floppy_get_sector_length(floppy_image_legacy *floppy, int head, int tr -floperr_t floppy_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +floperr_t floppy_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { const struct FloppyCallbacks *fmt; @@ -758,7 +758,7 @@ int floppy_is_read_only(floppy_image_legacy *floppy) -UINT8 floppy_random_byte(floppy_image_legacy *floppy) +uint8_t floppy_random_byte(floppy_image_legacy *floppy) { /* can't use mame_rand(); this might not be in the core */ #ifdef rand @@ -777,7 +777,7 @@ floperr_t floppy_load_track(floppy_image_legacy *floppy, int head, int track, in { floperr_t err; void *new_loaded_track_data; - UINT32 track_size; + uint32_t track_size; /* have we already loaded this track? */ if (((floppy->loaded_track_status & TRACK_LOADED) == 0) || (head != floppy->loaded_track_head) || (track != floppy->loaded_track_index)) @@ -892,7 +892,7 @@ LEGACY_FLOPPY_OPTIONS_END ****************************************************************************/ -floppy_image::floppy_image(int _tracks, int _heads, UINT32 _form_factor) +floppy_image::floppy_image(int _tracks, int _heads, uint32_t _form_factor) { tracks = _tracks; heads = _heads; @@ -952,7 +952,7 @@ int floppy_image::get_resolution() const return 0; } -const char *floppy_image::get_variant_name(UINT32 form_factor, UINT32 variant) +const char *floppy_image::get_variant_name(uint32_t form_factor, uint32_t variant) { switch(variant) { case SSSD: return "Single side, single density"; @@ -1105,42 +1105,42 @@ int floppy_image_format_t::crc_cells_size(int type) const } } -bool floppy_image_format_t::bit_r(const std::vector &buffer, int offset) +bool floppy_image_format_t::bit_r(const std::vector &buffer, int offset) { return (buffer[offset] & floppy_image::MG_MASK) == MG_1; } -UINT32 floppy_image_format_t::bitn_r(const std::vector &buffer, int offset, int count) +uint32_t floppy_image_format_t::bitn_r(const std::vector &buffer, int offset, int count) { - UINT32 r = 0; + uint32_t r = 0; for(int i=0; i &buffer, bool val, UINT32 size, int offset) +void floppy_image_format_t::bit_w(std::vector &buffer, bool val, uint32_t size, int offset) { buffer[offset] = (val ? MG_1 : MG_0) | size; } -void floppy_image_format_t::bit_w(std::vector &buffer, bool val, UINT32 size) +void floppy_image_format_t::bit_w(std::vector &buffer, bool val, uint32_t size) { buffer.push_back((val ? MG_1 : MG_0) | size); } -void floppy_image_format_t::raw_w(std::vector &buffer, int n, UINT32 val, UINT32 size) +void floppy_image_format_t::raw_w(std::vector &buffer, int n, uint32_t val, uint32_t size) { for(int i=n-1; i>=0; i--) bit_w(buffer, (val >> i) & 1, size); } -void floppy_image_format_t::raw_w(std::vector &buffer, int n, UINT32 val, UINT32 size, int offset) +void floppy_image_format_t::raw_w(std::vector &buffer, int n, uint32_t val, uint32_t size, int offset) { for(int i=n-1; i>=0; i--) bit_w(buffer, (val >> i) & 1, size, offset++); } -void floppy_image_format_t::mfm_w(std::vector &buffer, int n, UINT32 val, UINT32 size) +void floppy_image_format_t::mfm_w(std::vector &buffer, int n, uint32_t val, uint32_t size) { int prec = buffer.empty() ? 0 : bit_r(buffer, buffer.size()-1); for(int i=n-1; i>=0; i--) { @@ -1151,7 +1151,7 @@ void floppy_image_format_t::mfm_w(std::vector &buffer, int n, UINT32 val } } -void floppy_image_format_t::mfm_w(std::vector &buffer, int n, UINT32 val, UINT32 size, int offset) +void floppy_image_format_t::mfm_w(std::vector &buffer, int n, uint32_t val, uint32_t size, int offset) { int prec = offset ? bit_r(buffer, offset-1) : 0; for(int i=n-1; i>=0; i--) { @@ -1162,7 +1162,7 @@ void floppy_image_format_t::mfm_w(std::vector &buffer, int n, UINT32 val } } -void floppy_image_format_t::fm_w(std::vector &buffer, int n, UINT32 val, UINT32 size) +void floppy_image_format_t::fm_w(std::vector &buffer, int n, uint32_t val, uint32_t size) { for(int i=n-1; i>=0; i--) { int bit = (val >> i) & 1; @@ -1171,7 +1171,7 @@ void floppy_image_format_t::fm_w(std::vector &buffer, int n, UINT32 val, } } -void floppy_image_format_t::fm_w(std::vector &buffer, int n, UINT32 val, UINT32 size, int offset) +void floppy_image_format_t::fm_w(std::vector &buffer, int n, uint32_t val, uint32_t size, int offset) { for(int i=n-1; i>=0; i--) { int bit = (val >> i) & 1; @@ -1180,7 +1180,7 @@ void floppy_image_format_t::fm_w(std::vector &buffer, int n, UINT32 val, } } -void floppy_image_format_t::mfm_half_w(std::vector &buffer, int start_bit, UINT32 val, UINT32 size) +void floppy_image_format_t::mfm_half_w(std::vector &buffer, int start_bit, uint32_t val, uint32_t size) { int prec = buffer.empty() ? 0 : bit_r(buffer, buffer.size()-1); for(int i=start_bit; i>=0; i-=2) { @@ -1191,23 +1191,23 @@ void floppy_image_format_t::mfm_half_w(std::vector &buffer, int start_bi } } -void floppy_image_format_t::gcr5_w(std::vector &buffer, UINT8 val, UINT32 size) +void floppy_image_format_t::gcr5_w(std::vector &buffer, uint8_t val, uint32_t size) { - UINT32 e0 = gcr5fw_tb[val >> 4]; - UINT32 e1 = gcr5fw_tb[val & 0x0f]; + uint32_t e0 = gcr5fw_tb[val >> 4]; + uint32_t e1 = gcr5fw_tb[val & 0x0f]; raw_w(buffer, 5, e0, size); raw_w(buffer, 5, e1, size); } -void floppy_image_format_t::gcr5_w(std::vector &buffer, UINT8 val, UINT32 size, int offset) +void floppy_image_format_t::gcr5_w(std::vector &buffer, uint8_t val, uint32_t size, int offset) { - UINT32 e0 = gcr5fw_tb[val >> 4]; - UINT32 e1 = gcr5fw_tb[val & 0x0f]; + uint32_t e0 = gcr5fw_tb[val >> 4]; + uint32_t e1 = gcr5fw_tb[val & 0x0f]; raw_w(buffer, 5, e0, size, offset); raw_w(buffer, 5, e1, size, offset+5); } -void floppy_image_format_t::_8n1_w(std::vector &buffer, int n, UINT32 val, UINT32 size) +void floppy_image_format_t::_8n1_w(std::vector &buffer, int n, uint32_t val, uint32_t size) { bit_w(buffer, 0, size); for(int i=n-1; i>=0; i--) { @@ -1217,9 +1217,9 @@ void floppy_image_format_t::_8n1_w(std::vector &buffer, int n, UINT32 va bit_w(buffer, 1, size); } -void floppy_image_format_t::fixup_crc_amiga(std::vector &buffer, const gen_crc_info *crc) +void floppy_image_format_t::fixup_crc_amiga(std::vector &buffer, const gen_crc_info *crc) { - UINT16 res = 0; + uint16_t res = 0; int size = crc->end - crc->start; for(int i=1; istart + i)) @@ -1228,9 +1228,9 @@ void floppy_image_format_t::fixup_crc_amiga(std::vector &buffer, const g mfm_w(buffer, 16, res, 1000, crc->write+32); } -void floppy_image_format_t::fixup_crc_cbm(std::vector &buffer, const gen_crc_info *crc) +void floppy_image_format_t::fixup_crc_cbm(std::vector &buffer, const gen_crc_info *crc) { - UINT8 v = 0; + uint8_t v = 0; for(int o = crc->start; o < crc->end; o+=10) { v = v ^ (gcr5bw_tb[bitn_r(buffer, o, 5)] << 4); v = v ^ gcr5bw_tb[bitn_r(buffer, o+5, 5)]; @@ -1238,9 +1238,9 @@ void floppy_image_format_t::fixup_crc_cbm(std::vector &buffer, const gen gcr5_w(buffer, v, 1000, crc->write); } -UINT16 floppy_image_format_t::calc_crc_ccitt(const std::vector &buffer, int start, int end) +uint16_t floppy_image_format_t::calc_crc_ccitt(const std::vector &buffer, int start, int end) { - UINT32 res = 0xffff; + uint32_t res = 0xffff; int size = end - start; for(int i=1; i &buffer, return res; } -void floppy_image_format_t::fixup_crc_ccitt(std::vector &buffer, const gen_crc_info *crc) +void floppy_image_format_t::fixup_crc_ccitt(std::vector &buffer, const gen_crc_info *crc) { mfm_w(buffer, 16, calc_crc_ccitt(buffer, crc->start, crc->end), 1000, crc->write); } -void floppy_image_format_t::fixup_crc_ccitt_fm(std::vector &buffer, const gen_crc_info *crc) +void floppy_image_format_t::fixup_crc_ccitt_fm(std::vector &buffer, const gen_crc_info *crc) { fm_w(buffer, 16, calc_crc_ccitt(buffer, crc->start, crc->end), 1000, crc->write); } -void floppy_image_format_t::fixup_crc_machead(std::vector &buffer, const gen_crc_info *crc) +void floppy_image_format_t::fixup_crc_machead(std::vector &buffer, const gen_crc_info *crc) { - UINT8 v = 0; + uint8_t v = 0; for(int o = crc->start; o < crc->end; o+=8) v = v ^ gcr6bw_tb[bitn_r(buffer, o, 8)]; raw_w(buffer, 8, gcr6fw_tb[v], 1000, crc->write); } -void floppy_image_format_t::fixup_crc_fcs(std::vector &buffer, const gen_crc_info *crc) +void floppy_image_format_t::fixup_crc_fcs(std::vector &buffer, const gen_crc_info *crc) { // TODO } -void floppy_image_format_t::fixup_crc_victor_header(std::vector &buffer, const gen_crc_info *crc) +void floppy_image_format_t::fixup_crc_victor_header(std::vector &buffer, const gen_crc_info *crc) { - UINT8 v = 0; + uint8_t v = 0; for(int o = crc->start; o < crc->end; o+=10) v += ((gcr5bw_tb[bitn_r(buffer, o, 5)] << 4) | gcr5bw_tb[bitn_r(buffer, o+5, 5)]); gcr5_w(buffer, v, 1000, crc->write); } -void floppy_image_format_t::fixup_crc_victor_data(std::vector &buffer, const gen_crc_info *crc) +void floppy_image_format_t::fixup_crc_victor_data(std::vector &buffer, const gen_crc_info *crc) { - UINT16 v = 0; + uint16_t v = 0; for(int o = crc->start; o < crc->end; o+=10) v += ((gcr5bw_tb[bitn_r(buffer, o, 5)] << 4) | gcr5bw_tb[bitn_r(buffer, o+5, 5)]); gcr5_w(buffer, v & 0xff, 1000, crc->write); gcr5_w(buffer, v >> 8, 1000, crc->write+10); } -void floppy_image_format_t::fixup_crcs(std::vector &buffer, gen_crc_info *crcs) +void floppy_image_format_t::fixup_crcs(std::vector &buffer, gen_crc_info *crcs) { for(int i=0; i != MAX_CRC_COUNT; i++) if(crcs[i].write != -1) { @@ -1314,9 +1314,9 @@ void floppy_image_format_t::fixup_crcs(std::vector &buffer, gen_crc_info } } -UINT32 floppy_image_format_t::gcr6_encode(UINT8 va, UINT8 vb, UINT8 vc) +uint32_t floppy_image_format_t::gcr6_encode(uint8_t va, uint8_t vb, uint8_t vc) { - UINT32 r; + uint32_t r; r = gcr6fw_tb[((va >> 2) & 0x30) | ((vb >> 4) & 0x0c) | ((vc >> 6) & 0x03)] << 24; r |= gcr6fw_tb[va & 0x3f] << 16; r |= gcr6fw_tb[vb & 0x3f] << 8; @@ -1324,7 +1324,7 @@ UINT32 floppy_image_format_t::gcr6_encode(UINT8 va, UINT8 vb, UINT8 vc) return r; } -void floppy_image_format_t::gcr6_decode(UINT8 e0, UINT8 e1, UINT8 e2, UINT8 e3, UINT8 &va, UINT8 &vb, UINT8 &vc) +void floppy_image_format_t::gcr6_decode(uint8_t e0, uint8_t e1, uint8_t e2, uint8_t e3, uint8_t &va, uint8_t &vb, uint8_t &vc) { e0 = gcr6bw_tb[e0]; e1 = gcr6bw_tb[e1]; @@ -1336,12 +1336,12 @@ void floppy_image_format_t::gcr6_decode(UINT8 e0, UINT8 e1, UINT8 e2, UINT8 e3, vc = ((e0 << 6) & 0xc0) | e3; } -UINT16 floppy_image_format_t::gcr4_encode(UINT8 va) +uint16_t floppy_image_format_t::gcr4_encode(uint8_t va) { return (va << 7) | va | 0xaaaa; } -UINT8 floppy_image_format_t::gcr4_decode(UINT8 e0, UINT8 e1) +uint8_t floppy_image_format_t::gcr4_decode(uint8_t e0, uint8_t e1) { return ((e0 << 1) & 0xaa) | (e1 & 0x55); } @@ -1371,7 +1371,7 @@ int floppy_image_format_t::calc_sector_index(int num, int interleave, int skew, void floppy_image_format_t::generate_track(const desc_e *desc, int track, int head, const desc_s *sect, int sect_count, int track_size, floppy_image *image) { - std::vector buffer; + std::vector buffer; gen_crc_info crcs[MAX_CRC_COUNT]; collect_crcs(desc, crcs); @@ -1617,14 +1617,14 @@ void floppy_image_format_t::generate_track(const desc_e *desc, int track, int he case SECTOR_DATA_MAC: { const desc_s *csect = sect + (desc[index].p1 >= 0 ? desc[index].p1 : sector_idx); - const UINT8 *data = csect->data; + const uint8_t *data = csect->data; int size = csect->size; - UINT8 ca = 0, cb = 0, cc = 0; + uint8_t ca = 0, cb = 0, cc = 0; for(int i=0; i < size; i+=3) { int dt = size-i; - UINT8 va = data[i]; - UINT8 vb = dt > 1 ? data[i+1] : 0; - UINT8 vc = dt > 2 ? data[i+2] : 0; + uint8_t va = data[i]; + uint8_t vb = dt > 1 ? data[i+1] : 0; + uint8_t vc = dt > 2 ? data[i+2] : 0; cc = (cc << 1) | (cc >> 7); int suma = ca + va + (cc & 1); @@ -1665,7 +1665,7 @@ void floppy_image_format_t::generate_track(const desc_e *desc, int track, int he generate_track_from_levels(track, head, buffer, 0, image); } -void floppy_image_format_t::normalize_times(std::vector &buffer) +void floppy_image_format_t::normalize_times(std::vector &buffer) { unsigned int total_sum = 0; for(unsigned int i=0; i != buffer.size(); i++) @@ -1673,20 +1673,20 @@ void floppy_image_format_t::normalize_times(std::vector &buffer) unsigned int current_sum = 0; for(unsigned int i=0; i != buffer.size(); i++) { - UINT32 time = buffer[i] & floppy_image::TIME_MASK; + uint32_t time = buffer[i] & floppy_image::TIME_MASK; buffer[i] = (buffer[i] & floppy_image::MG_MASK) | (200000000ULL * current_sum / total_sum); current_sum += time; } } -void floppy_image_format_t::generate_track_from_bitstream(int track, int head, const UINT8 *trackbuf, int track_size, floppy_image *image, int subtrack) +void floppy_image_format_t::generate_track_from_bitstream(int track, int head, const uint8_t *trackbuf, int track_size, floppy_image *image, int subtrack) { // Maximal number of cells which happens when the buffer is all 1 - std::vector &dest = image->get_buffer(track, head, subtrack); + std::vector &dest = image->get_buffer(track, head, subtrack); dest.clear(); - UINT32 cbit = floppy_image::MG_A; - UINT32 count = 0; + uint32_t cbit = floppy_image::MG_A; + uint32_t count = 0; for(int i=0; i != track_size; i++) if(trackbuf[i >> 3] & (0x80 >> (i & 7))) { dest.push_back(cbit | (count+1)); @@ -1702,11 +1702,11 @@ void floppy_image_format_t::generate_track_from_bitstream(int track, int head, c image->set_write_splice_position(track, head, 0, subtrack); } -void floppy_image_format_t::generate_track_from_levels(int track, int head, std::vector &trackbuf, int splice_pos, floppy_image *image) +void floppy_image_format_t::generate_track_from_levels(int track, int head, std::vector &trackbuf, int splice_pos, floppy_image *image) { // Retrieve the angular splice pos before messing with the data splice_pos = splice_pos % trackbuf.size(); - UINT32 splice_angular_pos = trackbuf[splice_pos] & floppy_image::TIME_MASK; + uint32_t splice_angular_pos = trackbuf[splice_pos] & floppy_image::TIME_MASK; // Check if we need to invert a cell to get an even number of // transitions on the whole track @@ -1755,14 +1755,14 @@ void floppy_image_format_t::generate_track_from_levels(int track, int head, std: } // Maximal number of cells which happens when the buffer is all MG_1/MG_N alternated, which would be 3/2 - std::vector &dest = image->get_buffer(track, head); + std::vector &dest = image->get_buffer(track, head); dest.clear(); - UINT32 cbit = floppy_image::MG_A; - UINT32 count = 0; + uint32_t cbit = floppy_image::MG_A; + uint32_t count = 0; for(auto & elem : trackbuf) { - UINT32 bit = elem & floppy_image::MG_MASK; - UINT32 time = elem & floppy_image::TIME_MASK; + uint32_t bit = elem & floppy_image::MG_MASK; + uint32_t time = elem & floppy_image::TIME_MASK; if(bit == MG_0) { count += time; continue; @@ -1786,13 +1786,13 @@ void floppy_image_format_t::generate_track_from_levels(int track, int head, std: image->set_write_splice_position(track, head, splice_angular_pos); } -const UINT8 floppy_image_format_t::gcr5fw_tb[0x10] = +const uint8_t floppy_image_format_t::gcr5fw_tb[0x10] = { 0x0a, 0x0b, 0x12, 0x13, 0x0e, 0x0f, 0x16, 0x17, 0x09, 0x19, 0x1a, 0x1b, 0x0d, 0x1d, 0x1e, 0x15 }; -const UINT8 floppy_image_format_t::gcr5bw_tb[0x20] = +const uint8_t floppy_image_format_t::gcr5bw_tb[0x20] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x0c, 0x04, 0x05, @@ -1800,7 +1800,7 @@ const UINT8 floppy_image_format_t::gcr5bw_tb[0x20] = 0x00, 0x09, 0x0a, 0x0b, 0x00, 0x0d, 0x0e, 0x00 }; -const UINT8 floppy_image_format_t::gcr6fw_tb[0x40] = +const uint8_t floppy_image_format_t::gcr6fw_tb[0x40] = { 0x96, 0x97, 0x9a, 0x9b, 0x9d, 0x9e, 0x9f, 0xa6, 0xa7, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb2, 0xb3, @@ -1812,7 +1812,7 @@ const UINT8 floppy_image_format_t::gcr6fw_tb[0x40] = 0xf7, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, }; -const UINT8 floppy_image_format_t::gcr6bw_tb[0x100] = +const uint8_t floppy_image_format_t::gcr6bw_tb[0x100] = { // 0 1 2 3 4 5 6 7 8 9 a b c d e f 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2192,9 +2192,9 @@ const floppy_image_format_t::desc_e floppy_image_format_t::amiga_22[] = { { END } }; -void floppy_image_format_t::generate_bitstream_from_track(int track, int head, int cell_size, UINT8 *trackbuf, int &track_size, floppy_image *image, int subtrack) +void floppy_image_format_t::generate_bitstream_from_track(int track, int head, int cell_size, uint8_t *trackbuf, int &track_size, floppy_image *image, int subtrack) { - std::vector &tbuf = image->get_buffer(track, head, subtrack); + std::vector &tbuf = image->get_buffer(track, head, subtrack); if(tbuf.size() <= 1) { // Unformatted track track_size = 200000000/cell_size; @@ -2203,7 +2203,7 @@ void floppy_image_format_t::generate_bitstream_from_track(int track, int head, i } // Start at the write splice - UINT32 splice = image->get_write_splice_position(track, head, subtrack); + uint32_t splice = image->get_write_splice_position(track, head, subtrack); int cur_pos = splice; int cur_entry = 0; while(cur_entry < int(tbuf.size())-1 && (tbuf[cur_entry+1] & floppy_image::TIME_MASK) < cur_pos) @@ -2219,7 +2219,7 @@ void floppy_image_format_t::generate_bitstream_from_track(int track, int head, i int phase_adjust = 0; int freq_hist = 0; - UINT32 scanned = 0; + uint32_t scanned = 0; while(scanned < 200000000) { // Note that all magnetic cell type changes are considered // edges. No randomness added for neutral/damaged cells @@ -2294,12 +2294,12 @@ void floppy_image_format_t::generate_bitstream_from_track(int track, int head, i track_size = cur_bit; } -int floppy_image_format_t::sbit_r(const UINT8 *bitstream, int pos) +int floppy_image_format_t::sbit_r(const uint8_t *bitstream, int pos) { return (bitstream[pos >> 3] & (0x80 >> (pos & 7))) != 0; } -int floppy_image_format_t::sbit_rp(const UINT8 *bitstream, int &pos, int track_size) +int floppy_image_format_t::sbit_rp(const uint8_t *bitstream, int &pos, int track_size) { int res = sbit_r(bitstream, pos); pos ++; @@ -2308,9 +2308,9 @@ int floppy_image_format_t::sbit_rp(const UINT8 *bitstream, int &pos, int track_s return res; } -UINT8 floppy_image_format_t::sbyte_mfm_r(const UINT8 *bitstream, int &pos, int track_size) +uint8_t floppy_image_format_t::sbyte_mfm_r(const uint8_t *bitstream, int &pos, int track_size) { - UINT8 res = 0; + uint8_t res = 0; for(int i=0; i<8; i++) { sbit_rp(bitstream, pos, track_size); if(sbit_rp(bitstream, pos, track_size)) @@ -2319,9 +2319,9 @@ UINT8 floppy_image_format_t::sbyte_mfm_r(const UINT8 *bitstream, int &pos, int t return res; } -UINT8 floppy_image_format_t::sbyte_gcr5_r(const UINT8 *bitstream, int &pos, int track_size) +uint8_t floppy_image_format_t::sbyte_gcr5_r(const uint8_t *bitstream, int &pos, int track_size) { - UINT16 gcr = 0; + uint16_t gcr = 0; for(int i=0; i<10; i++) { if(sbit_rp(bitstream, pos, track_size)) gcr |= 0x200 >> i; @@ -2330,7 +2330,7 @@ UINT8 floppy_image_format_t::sbyte_gcr5_r(const UINT8 *bitstream, int &pos, int return (gcr5bw_tb[gcr >> 5] << 4) | gcr5bw_tb[gcr & 0x1f]; } -void floppy_image_format_t::extract_sectors_from_bitstream_mfm_pc(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size) +void floppy_image_format_t::extract_sectors_from_bitstream_mfm_pc(const uint8_t *bitstream, int track_size, desc_xs *sectors, uint8_t *sectdata, int sectdata_size) { memset(sectors, 0, 256*sizeof(desc_xs)); @@ -2347,7 +2347,7 @@ void floppy_image_format_t::extract_sectors_from_bitstream_mfm_pc(const UINT8 *b int idblk_count = 0, dblk_count = 0; // Precharge the shift register to detect over-the-index stuff - UINT16 shift_reg = 0; + uint16_t shift_reg = 0; for(int i=0; i<16; i++) if(sbit_r(bitstream, track_size-16+i)) shift_reg |= 0x8000 >> i; @@ -2357,7 +2357,7 @@ void floppy_image_format_t::extract_sectors_from_bitstream_mfm_pc(const UINT8 *b for(int i=0; i= 8) continue; @@ -2436,8 +2436,8 @@ void floppy_image_format_t::get_geometry_mfm_pc(floppy_image *image, int cell_si return; } - UINT8 bitstream[500000/8]; - UINT8 sectdata[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectdata[50000]; desc_xs sectors[256]; int track_size; @@ -2455,17 +2455,17 @@ void floppy_image_format_t::get_geometry_mfm_pc(floppy_image *image, int cell_si } -void floppy_image_format_t::get_track_data_mfm_pc(int track, int head, floppy_image *image, int cell_size, int sector_size, int sector_count, UINT8 *sectdata) +void floppy_image_format_t::get_track_data_mfm_pc(int track, int head, floppy_image *image, int cell_size, int sector_size, int sector_count, uint8_t *sectdata) { - UINT8 bitstream[500000/8]; - UINT8 sectbuf[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectbuf[50000]; desc_xs sectors[256]; int track_size; generate_bitstream_from_track(track, head, cell_size, bitstream, track_size, image); extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sectbuf, sizeof(sectbuf)); for(int sector=1; sector <= sector_count; sector++) { - UINT8 *sd = sectdata + (sector-1)*sector_size; + uint8_t *sd = sectdata + (sector-1)*sector_size; if(sectors[sector].data && sectors[sector].track == track && sectors[sector].head == head) { int asize = sectors[sector].size; if(asize > sector_size) @@ -2479,7 +2479,7 @@ void floppy_image_format_t::get_track_data_mfm_pc(int track, int head, floppy_im } -void floppy_image_format_t::extract_sectors_from_bitstream_fm_pc(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size) +void floppy_image_format_t::extract_sectors_from_bitstream_fm_pc(const uint8_t *bitstream, int track_size, desc_xs *sectors, uint8_t *sectdata, int sectdata_size) { memset(sectors, 0, 256*sizeof(desc_xs)); @@ -2496,7 +2496,7 @@ void floppy_image_format_t::extract_sectors_from_bitstream_fm_pc(const UINT8 *bi int idblk_count = 0, dblk_count = 0; // Precharge the shift register to detect over-the-index stuff - UINT16 shift_reg = 0; + uint16_t shift_reg = 0; for(int i=0; i<16; i++) if(sbit_r(bitstream, track_size-16+i)) shift_reg |= 0x8000 >> i; @@ -2526,10 +2526,10 @@ void floppy_image_format_t::extract_sectors_from_bitstream_fm_pc(const UINT8 *bi int sectdata_pos = 0; for(int i=0; i= 8) continue; int ssize = 128 << size; @@ -2571,8 +2571,8 @@ void floppy_image_format_t::get_geometry_fm_pc(floppy_image *image, int cell_siz return; } - UINT8 bitstream[500000/8]; - UINT8 sectdata[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectdata[50000]; desc_xs sectors[256]; int track_size; @@ -2590,17 +2590,17 @@ void floppy_image_format_t::get_geometry_fm_pc(floppy_image *image, int cell_siz } -void floppy_image_format_t::get_track_data_fm_pc(int track, int head, floppy_image *image, int cell_size, int sector_size, int sector_count, UINT8 *sectdata) +void floppy_image_format_t::get_track_data_fm_pc(int track, int head, floppy_image *image, int cell_size, int sector_size, int sector_count, uint8_t *sectdata) { - UINT8 bitstream[500000/8]; - UINT8 sectbuf[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectbuf[50000]; desc_xs sectors[256]; int track_size; generate_bitstream_from_track(track, head, cell_size, bitstream, track_size, image); extract_sectors_from_bitstream_fm_pc(bitstream, track_size, sectors, sectbuf, sizeof(sectbuf)); for(int sector=1; sector <= sector_count; sector++) { - UINT8 *sd = sectdata + (sector-1)*sector_size; + uint8_t *sd = sectdata + (sector-1)*sector_size; if(sectors[sector].data && sectors[sector].track == track && sectors[sector].head == head) { int asize = sectors[sector].size; if(asize > sector_size) @@ -2613,7 +2613,7 @@ void floppy_image_format_t::get_track_data_fm_pc(int track, int head, floppy_ima } } -int floppy_image_format_t::calc_default_pc_gap3_size(UINT32 form_factor, int sector_size) +int floppy_image_format_t::calc_default_pc_gap3_size(uint32_t form_factor, int sector_size) { return form_factor == floppy_image::FF_8 ? 25 : @@ -2634,7 +2634,7 @@ void floppy_image_format_t::build_wd_track_mfm(int track, int head, floppy_image void floppy_image_format_t::build_pc_track_fm(int track, int head, floppy_image *image, int cell_count, int sector_count, const desc_pc_sector *sects, int gap_3, int gap_4a, int gap_1, int gap_2) { - std::vector track_data; + std::vector track_data; // gap 4a , IAM and gap 1 if(gap_4a != -1) { @@ -2658,7 +2658,7 @@ void floppy_image_format_t::build_pc_track_fm(int track, int head, floppy_image // Build the track for(int i=0; i track_data; + std::vector track_data; // gap 4a , IAM and gap 1 if(gap_4a != -1) { @@ -2725,7 +2725,7 @@ void floppy_image_format_t::build_pc_track_mfm(int track, int head, floppy_image // Build the track for(int i=0; i> i; @@ -2791,7 +2791,7 @@ void floppy_image_format_t::extract_sectors_from_bitstream_gcr5(const UINT8 *bit shift_reg = ((shift_reg << 1) | bit) & 0x3ff; if (sync && !bit) { - UINT8 id = sbyte_gcr5_r(bitstream, i, track_size); + uint8_t id = sbyte_gcr5_r(bitstream, i, track_size); switch (id) { case 0x08: @@ -2813,12 +2813,12 @@ void floppy_image_format_t::extract_sectors_from_bitstream_gcr5(const UINT8 *bit int sectdata_pos = 0; for(int i=0; i> i; @@ -2870,7 +2870,7 @@ void floppy_image_format_t::extract_sectors_from_bitstream_victor_gcr5(const UIN shift_reg = ((shift_reg << 1) | bit) & 0x3ff; if (sync && !bit) { - UINT8 id = sbyte_gcr5_r(bitstream, i, track_size); + uint8_t id = sbyte_gcr5_r(bitstream, i, track_size); switch (id) { case 0x07: @@ -2892,9 +2892,9 @@ void floppy_image_format_t::extract_sectors_from_bitstream_victor_gcr5(const UIN int sectdata_pos = 0; for(int i=0; i &trackbuf, int splice_pos, floppy_image *image); + void generate_track_from_levels(int track, int head, std::vector &trackbuf, int splice_pos, floppy_image *image); //! Normalize the times in a cell buffer to sum up to 200000000 - void normalize_times(std::vector &buffer); + void normalize_times(std::vector &buffer); // Some conversion tables for gcr - static const UINT8 gcr5fw_tb[0x10], gcr5bw_tb[0x20]; - static const UINT8 gcr6fw_tb[0x40], gcr6bw_tb[0x100]; + static const uint8_t gcr5fw_tb[0x10], gcr5bw_tb[0x20]; + static const uint8_t gcr6fw_tb[0x40], gcr6bw_tb[0x100]; // Some useful descriptions shared by multiple formats @@ -484,25 +484,25 @@ protected: @endverbatim */ - void generate_bitstream_from_track(int track, int head, int cell_size, UINT8 *trackbuf, int &track_size, floppy_image *image, int subtrack = 0); + void generate_bitstream_from_track(int track, int head, int cell_size, uint8_t *trackbuf, int &track_size, floppy_image *image, int subtrack = 0); //! Defines a standard sector for extracting. struct desc_xs { int track, //!< Track for this sector head, //!< Head for this sector size; //!< Size of this sector - const UINT8 *data; //!< Data within this sector + const uint8_t *data; //!< Data within this sector }; struct desc_pc_sector { - UINT8 track, head, sector, size; + uint8_t track, head, sector, size; int actual_size; - UINT8 *data; + uint8_t *data; bool deleted; bool bad_crc; }; - int calc_default_pc_gap3_size(UINT32 form_factor, int sector_size); + int calc_default_pc_gap3_size(uint32_t form_factor, int sector_size); void build_wd_track_fm(int track, int head, floppy_image *image, int cell_count, int sector_count, const desc_pc_sector *sects, int gap_3, int gap_1, int gap_2); void build_wd_track_mfm(int track, int head, floppy_image *image, int cell_count, int sector_count, const desc_pc_sector *sects, int gap_3, int gap_1, int gap_2=22); void build_pc_track_fm(int track, int head, floppy_image *image, int cell_count, int sector_count, const desc_pc_sector *sects, int gap_3, int gap_4a=40, int gap_1=26, int gap_2=11); @@ -519,13 +519,13 @@ protected: //! systems. //! PC-type sectors with MFM encoding, sector size can go from 128 bytes to 16K. - void extract_sectors_from_bitstream_mfm_pc(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size); + void extract_sectors_from_bitstream_mfm_pc(const uint8_t *bitstream, int track_size, desc_xs *sectors, uint8_t *sectdata, int sectdata_size); //! PC-type sectors with FM encoding - void extract_sectors_from_bitstream_fm_pc(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size); + void extract_sectors_from_bitstream_fm_pc(const uint8_t *bitstream, int track_size, desc_xs *sectors, uint8_t *sectdata, int sectdata_size); //! Commodore type sectors with GCR5 encoding - void extract_sectors_from_bitstream_gcr5(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size, int head, int tracks); + void extract_sectors_from_bitstream_gcr5(const uint8_t *bitstream, int track_size, desc_xs *sectors, uint8_t *sectdata, int sectdata_size, int head, int tracks); //! Victor 9000 type sectors with GCR5 encoding - void extract_sectors_from_bitstream_victor_gcr5(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size); + void extract_sectors_from_bitstream_victor_gcr5(const uint8_t *bitstream, int track_size, desc_xs *sectors, uint8_t *sectdata, int sectdata_size); //! @brief Get a geometry (including sectors) from an image. @@ -538,48 +538,48 @@ protected: //! Regenerate the data for a full track. //! PC-type sectors with MFM encoding and fixed-size. - void get_track_data_mfm_pc(int track, int head, floppy_image *image, int cell_size, int sector_size, int sector_count, UINT8 *sectdata); + void get_track_data_mfm_pc(int track, int head, floppy_image *image, int cell_size, int sector_size, int sector_count, uint8_t *sectdata); //! Regenerate the data for a full track. //! PC-type sectors with FM encoding and fixed-size. - void get_track_data_fm_pc(int track, int head, floppy_image *image, int cell_size, int sector_size, int sector_count, UINT8 *sectdata); + void get_track_data_fm_pc(int track, int head, floppy_image *image, int cell_size, int sector_size, int sector_count, uint8_t *sectdata); //! Look up a bit in a level-type stream. - bool bit_r(const std::vector &buffer, int offset); + bool bit_r(const std::vector &buffer, int offset); //! Look up multiple bits - UINT32 bitn_r(const std::vector &buffer, int offset, int count); + uint32_t bitn_r(const std::vector &buffer, int offset, int count); //! Write a bit with a given size. - void bit_w(std::vector &buffer, bool val, UINT32 size = 1000); - void bit_w(std::vector &buffer, bool val, UINT32 size, int offset); + void bit_w(std::vector &buffer, bool val, uint32_t size = 1000); + void bit_w(std::vector &buffer, bool val, uint32_t size, int offset); //! Calculate a CCITT-type CRC. - UINT16 calc_crc_ccitt(const std::vector &buffer, int start, int end); + uint16_t calc_crc_ccitt(const std::vector &buffer, int start, int end); //! Write a series of (raw) bits - void raw_w(std::vector &buffer, int n, UINT32 val, UINT32 size = 1000); - void raw_w(std::vector &buffer, int n, UINT32 val, UINT32 size, int offset); + void raw_w(std::vector &buffer, int n, uint32_t val, uint32_t size = 1000); + void raw_w(std::vector &buffer, int n, uint32_t val, uint32_t size, int offset); //! FM-encode and write a series of bits - void fm_w(std::vector &buffer, int n, UINT32 val, UINT32 size = 1000); - void fm_w(std::vector &buffer, int n, UINT32 val, UINT32 size, int offset); + void fm_w(std::vector &buffer, int n, uint32_t val, uint32_t size = 1000); + void fm_w(std::vector &buffer, int n, uint32_t val, uint32_t size, int offset); //! MFM-encode and write a series of bits - void mfm_w(std::vector &buffer, int n, UINT32 val, UINT32 size = 1000); - void mfm_w(std::vector &buffer, int n, UINT32 val, UINT32 size, int offset); + void mfm_w(std::vector &buffer, int n, uint32_t val, uint32_t size = 1000); + void mfm_w(std::vector &buffer, int n, uint32_t val, uint32_t size, int offset); //! MFM-encode every two bits and write - void mfm_half_w(std::vector &buffer, int start_bit, UINT32 val, UINT32 size = 1000); + void mfm_half_w(std::vector &buffer, int start_bit, uint32_t val, uint32_t size = 1000); //! GCR5-encode and write a series of bits - void gcr5_w(std::vector &buffer, UINT8 val, UINT32 size = 1000); - void gcr5_w(std::vector &buffer, UINT8 val, UINT32 size, int offset); + void gcr5_w(std::vector &buffer, uint8_t val, uint32_t size = 1000); + void gcr5_w(std::vector &buffer, uint8_t val, uint32_t size, int offset); //! 8N1-encode and write a series of bits - void _8n1_w(std::vector &buffer, int n, UINT32 val, UINT32 size = 1000); + void _8n1_w(std::vector &buffer, int n, uint32_t val, uint32_t size = 1000); //! GCR4 encode (Apple II sector header) - UINT16 gcr4_encode(UINT8 va); + uint16_t gcr4_encode(uint8_t va); //! GCR4 decode - UINT8 gcr4_decode(UINT8 e0, UINT8 e1); + uint8_t gcr4_decode(uint8_t e0, uint8_t e1); //! GCR6 encode (Apple II 16-sector and Mac-style GCR) - UINT32 gcr6_encode(UINT8 va, UINT8 vb, UINT8 vc); + uint32_t gcr6_encode(uint8_t va, uint8_t vb, uint8_t vc); //! GCR6 decode - void gcr6_decode(UINT8 e0, UINT8 e1, UINT8 e2, UINT8 e3, UINT8 &va, UINT8 &vb, UINT8 &vc); + void gcr6_decode(uint8_t e0, uint8_t e1, uint8_t e2, uint8_t e3, uint8_t &va, uint8_t &vb, uint8_t &vc); - UINT8 sbyte_mfm_r(const UINT8 *bitstream, int &pos, int track_size); - UINT8 sbyte_gcr5_r(const UINT8 *bitstream, int &pos, int track_size); + uint8_t sbyte_mfm_r(const uint8_t *bitstream, int &pos, int track_size); + uint8_t sbyte_gcr5_r(const uint8_t *bitstream, int &pos, int track_size); private: enum { CRC_NONE, CRC_AMIGA, CRC_CBM, CRC_CCITT, CRC_CCITT_FM, CRC_MACHEAD, CRC_FCS, CRC_VICTOR_HDR, CRC_VICTOR_DATA }; @@ -598,19 +598,19 @@ private: bool type_data_mfm(int type, int p1, const gen_crc_info *crcs) const; int crc_cells_size(int type) const; - void fixup_crc_amiga(std::vector &buffer, const gen_crc_info *crc); - void fixup_crc_cbm(std::vector &buffer, const gen_crc_info *crc); - void fixup_crc_ccitt(std::vector &buffer, const gen_crc_info *crc); - void fixup_crc_ccitt_fm(std::vector &buffer, const gen_crc_info *crc); - void fixup_crc_machead(std::vector &buffer, const gen_crc_info *crc); - void fixup_crc_fcs(std::vector &buffer, const gen_crc_info *crc); - void fixup_crc_victor_header(std::vector &buffer, const gen_crc_info *crc); - void fixup_crc_victor_data(std::vector &buffer, const gen_crc_info *crc); - void fixup_crcs(std::vector &buffer, gen_crc_info *crcs); + void fixup_crc_amiga(std::vector &buffer, const gen_crc_info *crc); + void fixup_crc_cbm(std::vector &buffer, const gen_crc_info *crc); + void fixup_crc_ccitt(std::vector &buffer, const gen_crc_info *crc); + void fixup_crc_ccitt_fm(std::vector &buffer, const gen_crc_info *crc); + void fixup_crc_machead(std::vector &buffer, const gen_crc_info *crc); + void fixup_crc_fcs(std::vector &buffer, const gen_crc_info *crc); + void fixup_crc_victor_header(std::vector &buffer, const gen_crc_info *crc); + void fixup_crc_victor_data(std::vector &buffer, const gen_crc_info *crc); + void fixup_crcs(std::vector &buffer, gen_crc_info *crcs); void collect_crcs(const desc_e *desc, gen_crc_info *crcs) const; - int sbit_r(const UINT8 *bitstream, int pos); - int sbit_rp(const UINT8 *bitstream, int &pos, int track_size); + int sbit_r(const uint8_t *bitstream, int pos); + int sbit_rp(const uint8_t *bitstream, int &pos, int track_size); int calc_sector_index(int num, int interleave, int skew, int total_sectors, int track_head); }; @@ -717,15 +717,15 @@ public: @param _heads number of heads. @param _form_factor form factor of drive (from enum) */ - floppy_image(int tracks, int heads, UINT32 form_factor); + floppy_image(int tracks, int heads, uint32_t form_factor); virtual ~floppy_image(); //! @return the form factor. - UINT32 get_form_factor() const { return form_factor; } + uint32_t get_form_factor() const { return form_factor; } //! @return the variant. - UINT32 get_variant() const { return variant; } + uint32_t get_variant() const { return variant; } //! @param v the variant. - void set_variant(UINT32 v) { variant = v; } + void set_variant(uint32_t v) { variant = v; } /*! @param track @@ -733,7 +733,7 @@ public: @param head head number @return a pointer to the data buffer for this track and head */ - std::vector &get_buffer(int track, int head, int subtrack = 0) { return track_array[track*4+subtrack][head].cell_data; } + std::vector &get_buffer(int track, int head, int subtrack = 0) { return track_array[track*4+subtrack][head].cell_data; } //! Sets the write splice position. //! The "track splice" information indicates where to start writing @@ -747,9 +747,9 @@ public: @param head @param pos the position */ - void set_write_splice_position(int track, int head, UINT32 pos, int subtrack = 0) { track_array[track*4+subtrack][head].write_splice = pos; } + void set_write_splice_position(int track, int head, uint32_t pos, int subtrack = 0) { track_array[track*4+subtrack][head].write_splice = pos; } //! @return the current write splice position. - UINT32 get_write_splice_position(int track, int head, int subtrack = 0) const { return track_array[track*4+subtrack][head].write_splice; } + uint32_t get_write_splice_position(int track, int head, int subtrack = 0) const { return track_array[track*4+subtrack][head].write_splice; } //! @return the maximal geometry supported by this format. void get_maximal_geometry(int &tracks, int &heads) const; @@ -763,16 +763,16 @@ public: //! @param form_factor //! @param variant //! @param returns a string containing the variant name. - static const char *get_variant_name(UINT32 form_factor, UINT32 variant); + static const char *get_variant_name(uint32_t form_factor, uint32_t variant); private: int tracks, heads; - UINT32 form_factor, variant; + uint32_t form_factor, variant; struct track_info { - std::vector cell_data; - UINT32 write_splice; + std::vector cell_data; + uint32_t write_splice; track_info() { write_splice = 0; } }; diff --git a/src/lib/formats/fm7_cas.cpp b/src/lib/formats/fm7_cas.cpp index 5d4aad61092..32cd08e3b27 100644 --- a/src/lib/formats/fm7_cas.cpp +++ b/src/lib/formats/fm7_cas.cpp @@ -13,9 +13,9 @@ static int cas_size; -static int fm7_fill_wave(INT16* buffer, UINT8 high, UINT8 low, int sample_pos) +static int fm7_fill_wave(int16_t* buffer, uint8_t high, uint8_t low, int sample_pos) { - UINT16 data = (high << 8) + low; + uint16_t data = (high << 8) + low; int sample_count = 0; int x = 0; int count = (data & 0x7fff); @@ -41,7 +41,7 @@ static int fm7_fill_wave(INT16* buffer, UINT8 high, UINT8 low, int sample_pos) return sample_count; } -static int fm7_handle_t77(INT16* buffer, const UINT8* casdata) +static int fm7_handle_t77(int16_t* buffer, const uint8_t* casdata) { int sample_count = 0; int data_pos = 16; @@ -61,7 +61,7 @@ static int fm7_handle_t77(INT16* buffer, const UINT8* casdata) /******************************************************************* Calculate the number of samples needed for this tape image ********************************************************************/ -static int fm7_cas_to_wav_size (const UINT8 *casdata, int caslen) +static int fm7_cas_to_wav_size (const uint8_t *casdata, int caslen) { cas_size = caslen; @@ -71,7 +71,7 @@ static int fm7_cas_to_wav_size (const UINT8 *casdata, int caslen) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int fm7_cas_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int fm7_cas_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return fm7_handle_t77(buffer,bytes); } diff --git a/src/lib/formats/fmsx_cas.cpp b/src/lib/formats/fmsx_cas.cpp index ca2ab078fd4..6da8fc47f81 100644 --- a/src/lib/formats/fmsx_cas.cpp +++ b/src/lib/formats/fmsx_cas.cpp @@ -8,7 +8,7 @@ #define CAS_PERIOD (16) #define CAS_HEADER_PERIODS (4000) #define CAS_EMPTY_PERIODS (1000) -static const UINT8 CasHeader[8] = { 0x1F,0xA6,0xDE,0xBA,0xCC,0x13,0x7D,0x74 }; +static const uint8_t CasHeader[8] = { 0x1F,0xA6,0xDE,0xBA,0xCC,0x13,0x7D,0x74 }; static int cas_size; @@ -16,7 +16,7 @@ static int cas_size; /******************************************************************* Calculate the number of samples needed for this tape image ********************************************************************/ -static int fmsx_cas_to_wav_size (const UINT8 *casdata, int caslen) +static int fmsx_cas_to_wav_size (const uint8_t *casdata, int caslen) { int pos, size; @@ -48,7 +48,7 @@ static int fmsx_cas_to_wav_size (const UINT8 *casdata, int caslen) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int fmsx_cas_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int fmsx_cas_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { int cas_pos, bit, state = 1, samples_pos, size, n, i, p; diff --git a/src/lib/formats/fsd_dsk.cpp b/src/lib/formats/fsd_dsk.cpp index cbf474da116..9cd4bff1f61 100644 --- a/src/lib/formats/fsd_dsk.cpp +++ b/src/lib/formats/fsd_dsk.cpp @@ -84,9 +84,9 @@ bool fsd_format::supports_save() const return false; } -int fsd_format::identify(io_generic *io, UINT32 form_factor) +int fsd_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 h[3]; + uint8_t h[3]; io_generic_read(io, h, 0, 3); if (memcmp(h, "FSD", 3) == 0) { @@ -96,18 +96,18 @@ int fsd_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool fsd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool fsd_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { const char* result[255]; result[0x00] = "OK"; result[0x0e] = "Data CRC Error"; result[0x20] = "Deleted Data"; - UINT64 size = io_generic_size(io); - std::vector img(size); + uint64_t size = io_generic_size(io); + std::vector img(size); io_generic_read(io, &img[0], 0, size); - UINT64 pos; + uint64_t pos; std::string title; for(pos=8; pos < size && img[pos] != '\0'; pos++) title.append(1, img[pos]); @@ -122,21 +122,21 @@ bool fsd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) LOG_FORMATS("FSD Release: %d\n", ((img[7] & 0xc0) / 64) * 256 + img[6]); desc_pc_sector sects[256]; - UINT8 total_tracks = img[pos++]; - UINT8 tnum, hnum, snum, ssize, error; + uint8_t total_tracks = img[pos++]; + uint8_t tnum, hnum, snum, ssize, error; hnum = 0; LOG_FORMATS("FSD Tracks: %02d\n", total_tracks+1); LOG_FORMATS("Tr.# No.S Sec.# Tr.ID Head# SecID IDsiz REsiz Error\n"); for(int curr_track=0; curr_track <= total_tracks; curr_track++) { - UINT8 track = img[pos++]; - UINT8 spt = img[pos++]; + uint8_t track = img[pos++]; + uint8_t spt = img[pos++]; if (spt > 0) // formatted { LOG_FORMATS("%02X %02X\n", track, spt); - UINT8 readable = img[pos++]; + uint8_t readable = img[pos++]; for (int i = 0; i < spt; i++) { tnum = img[pos++]; // logical track diff --git a/src/lib/formats/fsd_dsk.h b/src/lib/formats/fsd_dsk.h index fdfb6fb3d27..8a472016cc6 100644 --- a/src/lib/formats/fsd_dsk.h +++ b/src/lib/formats/fsd_dsk.h @@ -34,8 +34,8 @@ public: virtual const char *extensions() const override; virtual bool supports_save() const override; - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; }; extern const floppy_format_type FLOPPY_FSD_FORMAT; diff --git a/src/lib/formats/g64_dsk.cpp b/src/lib/formats/g64_dsk.cpp index 302bfc0e842..d0fc182835d 100644 --- a/src/lib/formats/g64_dsk.cpp +++ b/src/lib/formats/g64_dsk.cpp @@ -19,7 +19,7 @@ g64_format::g64_format() { } -const UINT32 g64_format::c1541_cell_size[] = +const uint32_t g64_format::c1541_cell_size[] = { 4000, // 16MHz/16/4 3750, // 16MHz/15/4 @@ -27,7 +27,7 @@ const UINT32 g64_format::c1541_cell_size[] = 3250 // 16MHz/13/4 }; -int g64_format::identify(io_generic *io, UINT32 form_factor) +int g64_format::identify(io_generic *io, uint32_t form_factor) { char h[8]; @@ -38,10 +38,10 @@ int g64_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool g64_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT64 size = io_generic_size(io); - std::vector img(size); + uint64_t size = io_generic_size(io); + std::vector img(size); io_generic_read(io, &img[0], 0, size); if (img[POS_VERSION]) { @@ -58,9 +58,9 @@ bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) if (track == TRACK_COUNT) head = 1; - UINT32 tpos = POS_TRACK_OFFSET + (track * 4); - UINT32 spos = tpos + (track_count * 4); - UINT32 dpos = pick_integer_le(&img[0], tpos, 4); + uint32_t tpos = POS_TRACK_OFFSET + (track * 4); + uint32_t spos = tpos + (track_count * 4); + uint32_t dpos = pick_integer_le(&img[0], tpos, 4); if (!dpos) continue; @@ -68,12 +68,12 @@ bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) if (dpos > size) throw emu_fatalerror("g64_format: Track %u offset %06x out of bounds", track, dpos); - UINT32 speed_zone = pick_integer_le(&img[0], spos, 4); + uint32_t speed_zone = pick_integer_le(&img[0], spos, 4); if (speed_zone > 3) throw emu_fatalerror("g64_format: Unsupported variable speed zones on track %d", track); - UINT16 track_bytes = pick_integer_le(&img[0], dpos, 2); + uint16_t track_bytes = pick_integer_le(&img[0], dpos, 2); int track_size = track_bytes * 8; LOG_FORMATS("head %u track %u offs %u size %u cell %ld\n", head, cylinder, dpos, track_bytes, 200000000L/track_size); @@ -89,7 +89,7 @@ bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) return true; } -int g64_format::generate_bitstream(int track, int head, int speed_zone, UINT8 *trackbuf, int &track_size, floppy_image *image) +int g64_format::generate_bitstream(int track, int head, int speed_zone, uint8_t *trackbuf, int &track_size, floppy_image *image) { int cell_size = c1541_cell_size[speed_zone]; @@ -108,19 +108,19 @@ bool g64_format::save(io_generic *io, floppy_image *image) tracks = TRACK_COUNT * heads; // write header - UINT8 header[] = { 'G', 'C', 'R', '-', '1', '5', '4', '1', 0x00, static_cast(tracks), TRACK_LENGTH & 0xff, TRACK_LENGTH >> 8 }; + uint8_t header[] = { 'G', 'C', 'R', '-', '1', '5', '4', '1', 0x00, static_cast(tracks), TRACK_LENGTH & 0xff, TRACK_LENGTH >> 8 }; io_generic_write(io, header, POS_SIGNATURE, sizeof(header)); // write tracks for (int head = 0; head < heads; head++) { int tracks_written = 0; - std::vector trackbuf(TRACK_LENGTH-2); + std::vector trackbuf(TRACK_LENGTH-2); for (int track = 0; track < TRACK_COUNT; track++) { - UINT32 tpos = POS_TRACK_OFFSET + (track * 4); - UINT32 spos = tpos + (tracks * 4); - UINT32 dpos = POS_TRACK_OFFSET + (tracks * 4 * 2) + (tracks_written * TRACK_LENGTH); + uint32_t tpos = POS_TRACK_OFFSET + (track * 4); + uint32_t spos = tpos + (tracks * 4); + uint32_t dpos = POS_TRACK_OFFSET + (tracks * 4 * 2) + (tracks_written * TRACK_LENGTH); io_generic_write_filler(io, 0x00, tpos, 4); io_generic_write_filler(io, 0x00, spos, 4); @@ -140,9 +140,9 @@ bool g64_format::save(io_generic *io, floppy_image *image) LOG_FORMATS("head %u track %u size %u cell %u\n", head, track, track_size, c1541_cell_size[speed_zone]); - UINT8 track_offset[4]; - UINT8 speed_offset[4]; - UINT8 track_length[2]; + uint8_t track_offset[4]; + uint8_t speed_offset[4]; + uint8_t track_length[2]; place_integer_le(track_offset, 0, 4, dpos); place_integer_le(speed_offset, 0, 4, speed_zone); diff --git a/src/lib/formats/g64_dsk.h b/src/lib/formats/g64_dsk.h index ddc12636b7e..e0966f8690e 100644 --- a/src/lib/formats/g64_dsk.h +++ b/src/lib/formats/g64_dsk.h @@ -18,8 +18,8 @@ class g64_format : public floppy_image_format_t { public: g64_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; @@ -43,9 +43,9 @@ protected: TRACK_COUNT = 84 }; - static const UINT32 c1541_cell_size[]; + static const uint32_t c1541_cell_size[]; - int generate_bitstream(int track, int head, int speed_zone, UINT8 *trackbuf, int &track_size, floppy_image *image); + int generate_bitstream(int track, int head, int speed_zone, uint8_t *trackbuf, int &track_size, floppy_image *image); }; extern const floppy_format_type FLOPPY_G64_FORMAT; diff --git a/src/lib/formats/gtp_cas.cpp b/src/lib/formats/gtp_cas.cpp index 577d878b67a..fd3a16932b3 100644 --- a/src/lib/formats/gtp_cas.cpp +++ b/src/lib/formats/gtp_cas.cpp @@ -20,8 +20,8 @@ #define GTP_BLOCK_TURBO 0x01 #define GTP_BLOCK_NAME 0x10 -static INT16 wave_data; -static INT16 len; +static int16_t wave_data; +static int16_t len; #define PULSE_WIDTH 30 #define PERIOD_BASE 150 @@ -32,7 +32,7 @@ static INT16 len; #define INTERBLOCK_PAUSE 100000 -static void gtp_output_wave( INT16 **buffer, int length ) { +static void gtp_output_wave( int16_t **buffer, int length ) { if ( buffer == nullptr ) { return; } @@ -45,7 +45,7 @@ static void gtp_output_wave( INT16 **buffer, int length ) { -static int gtp_mod_1( INT16 **buffer ) +static int gtp_mod_1( int16_t **buffer ) { wave_data = WAVE_LOW; gtp_output_wave(buffer,PULSE_WIDTH); @@ -63,7 +63,7 @@ static int gtp_mod_1( INT16 **buffer ) return PERIOD_1 * 2; } -static int gtp_mod_0( INT16 **buffer ) +static int gtp_mod_0( int16_t **buffer ) { wave_data = WAVE_LOW; gtp_output_wave(buffer,PULSE_WIDTH); @@ -75,9 +75,9 @@ static int gtp_mod_0( INT16 **buffer ) return PERIOD_0; } -static int gtp_byte( INT16 **buffer, UINT8 val ) +static int gtp_byte( int16_t **buffer, uint8_t val ) { - UINT8 b; + uint8_t b; int j,size = 0; for (j=0;j<8;j++) { b = (val >> j) & 1; @@ -90,7 +90,7 @@ static int gtp_byte( INT16 **buffer, UINT8 val ) return size; } -static int gtp_sync( INT16 **buffer ) +static int gtp_sync( int16_t **buffer ) { int i; int size = 0; @@ -107,7 +107,7 @@ static int gtp_sync( INT16 **buffer ) return size; } -static int gtp_cas_to_wav_size( const UINT8 *casdata, int caslen ) { +static int gtp_cas_to_wav_size( const uint8_t *casdata, int caslen ) { int size,n; size = 0; n = 0; @@ -128,7 +128,7 @@ static int gtp_cas_to_wav_size( const UINT8 *casdata, int caslen ) { return size; } -static int gtp_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) { +static int gtp_cas_fill_wave( int16_t *buffer, int length, uint8_t *bytes ) { int i,size,n; size = 0; n = 0; diff --git a/src/lib/formats/hect_tap.cpp b/src/lib/formats/hect_tap.cpp index d24c5625c78..4f823fb24e5 100644 --- a/src/lib/formats/hect_tap.cpp +++ b/src/lib/formats/hect_tap.cpp @@ -40,7 +40,7 @@ enum /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -static inline int hector_tap_cycle(INT16 *buffer, int sample_pos, int high, int low) +static inline int hector_tap_cycle(int16_t *buffer, int sample_pos, int high, int low) { int i = 0; @@ -62,7 +62,7 @@ static inline int hector_tap_cycle(INT16 *buffer, int sample_pos, int high, int } -static inline int hector_tap_byte(INT16 *buffer, int sample_pos, UINT8 data) +static inline int hector_tap_byte(int16_t *buffer, int sample_pos, uint8_t data) { /* Writing an entire byte */ int i, samples; @@ -81,7 +81,7 @@ static inline int hector_tap_byte(INT16 *buffer, int sample_pos, UINT8 data) } -static inline int hector_tap_synchro(INT16 *buffer, int sample_pos, int nb_synchro) +static inline int hector_tap_synchro(int16_t *buffer, int sample_pos, int nb_synchro) { /* Writing an entire byte */ int i, samples; @@ -94,7 +94,7 @@ static inline int hector_tap_synchro(INT16 *buffer, int sample_pos, int nb_synch } -static int hector_handle_tap(INT16 *buffer, const UINT8 *casdata) +static int hector_handle_tap(int16_t *buffer, const uint8_t *casdata) { int data_pos, sample_count/*, block_count*/; int previous_block=0; @@ -110,7 +110,7 @@ static int hector_handle_tap(INT16 *buffer, const UINT8 *casdata) /* on the entire file*/ while( data_pos < cas_size ) { - UINT16 block_size; + uint16_t block_size; if (previous_block == 0xFE) /* Starting a block with 150 cycle of synchro to let time to Hector to do the job ! */ @@ -152,7 +152,7 @@ static int hector_handle_tap(INT16 *buffer, const UINT8 *casdata) *******************************************************************/ -static int hector_handle_forth_tap(INT16 *buffer, const UINT8 *casdata) +static int hector_handle_forth_tap(int16_t *buffer, const uint8_t *casdata) { int data_pos, sample_count/*, block_count*/; /*int previous_block=0;*/ @@ -169,7 +169,7 @@ static int hector_handle_forth_tap(INT16 *buffer, const UINT8 *casdata) /* on the entire file*/ while( data_pos < cas_size ) { - UINT16 block_size; + uint16_t block_size; /* Starting a block with 768 cycle of synchro*/ sample_count += hector_tap_synchro( buffer, sample_count, 768 ); @@ -204,7 +204,7 @@ static int hector_handle_forth_tap(INT16 *buffer, const UINT8 *casdata) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int hector_tap_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int hector_tap_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return hector_handle_tap( buffer, bytes ); } @@ -213,7 +213,7 @@ static int hector_tap_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) /******************************************************************* Calculate the number of samples needed for this tape image FORTH ********************************************************************/ -static int hector_tap_forth_to_wav_size(const UINT8 *casdata, int caslen) +static int hector_tap_forth_to_wav_size(const uint8_t *casdata, int caslen) { cas_size = caslen ; @@ -223,7 +223,7 @@ static int hector_tap_forth_to_wav_size(const UINT8 *casdata, int caslen) /******************************************************************* Generate samples for the tape image FORTH ********************************************************************/ -static int hector_tap_forth_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int hector_tap_forth_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return hector_handle_forth_tap( buffer, bytes ); //forth removed here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } @@ -232,7 +232,7 @@ static int hector_tap_forth_fill_wave(INT16 *buffer, int sample_count, UINT8 *by /******************************************************************* Calculate the number of samples needed for this tape image classical ********************************************************************/ -static int hector_tap_to_wav_size(const UINT8 *casdata, int caslen) +static int hector_tap_to_wav_size(const uint8_t *casdata, int caslen) { cas_size = caslen ; diff --git a/src/lib/formats/hxchfe_dsk.cpp b/src/lib/formats/hxchfe_dsk.cpp index 1e532e140b2..f85b1d31678 100644 --- a/src/lib/formats/hxchfe_dsk.cpp +++ b/src/lib/formats/hxchfe_dsk.cpp @@ -12,28 +12,28 @@ typedef struct picfileformatheader_ { - UINT8 HEADERSIGNATURE[8]; // 0: "HXCPICFE" - UINT8 formatrevision; // 8: Revision 0 - UINT8 number_of_track; // 9: Number of track in the file - UINT8 number_of_side; // 10: Number of valid side (Not used by the emulator) - UINT8 track_encoding; // 11: Track Encoding mode + uint8_t HEADERSIGNATURE[8]; // 0: "HXCPICFE" + uint8_t formatrevision; // 8: Revision 0 + uint8_t number_of_track; // 9: Number of track in the file + uint8_t number_of_side; // 10: Number of valid side (Not used by the emulator) + uint8_t track_encoding; // 11: Track Encoding mode // (Used for the write support - Please see the list above) - UINT16 bitRate; // 12: Bitrate in Kbit/s. Ex : 250=250000bits/s + uint16_t bitRate; // 12: Bitrate in Kbit/s. Ex : 250=250000bits/s // Max value : 500 - UINT16 floppyRPM; // 14: Rotation per minute (Not used by the emulator) - UINT8 floppyinterfacemode; // 16: Floppy interface mode. (Please see the list above.) - UINT8 dnu; // 17: Free - UINT16 track_list_offset; // 18: Offset of the track list LUT in block of 512 bytes + uint16_t floppyRPM; // 14: Rotation per minute (Not used by the emulator) + uint8_t floppyinterfacemode; // 16: Floppy interface mode. (Please see the list above.) + uint8_t dnu; // 17: Free + uint16_t track_list_offset; // 18: Offset of the track list LUT in block of 512 bytes // (Ex: 1=0x200) - UINT8 write_allowed; // 20: The Floppy image is write protected ? - UINT8 single_step; // 21: 0xFF : Single Step – 0x00 Double Step mode - UINT8 track0s0_altencoding; // 22: 0x00 : Use an alternate track_encoding for track 0 Side 0 - UINT8 track0s0_encoding; // 23: alternate track_encoding for track 0 Side 0 - UINT8 track0s1_altencoding; // 24: 0x00 : Use an alternate track_encoding for track 0 Side 1 - UINT8 track0s1_encoding; // 25: alternate track_encoding for track 0 Side 1 + uint8_t write_allowed; // 20: The Floppy image is write protected ? + uint8_t single_step; // 21: 0xFF : Single Step – 0x00 Double Step mode + uint8_t track0s0_altencoding; // 22: 0x00 : Use an alternate track_encoding for track 0 Side 0 + uint8_t track0s0_encoding; // 23: alternate track_encoding for track 0 Side 0 + uint8_t track0s1_altencoding; // 24: 0x00 : Use an alternate track_encoding for track 0 Side 1 + uint8_t track0s1_encoding; // 25: alternate track_encoding for track 0 Side 1 } picfileformatheader; - Byte order for UINT16 is little endian. + Byte order for uint16_t is little endian. floppyintefacemode values are defined in the header file as floppymode_t, track_encodings are defined as encoding_t @@ -46,8 +46,8 @@ typedef struct pictrack_ { - UINT16 offset; // Offset of the track data in blocks of 512 bytes (Ex: 2=0x400) - UINT16 track_len; // Length of the track data in byte. + uint16_t offset; // Offset of the track data in blocks of 512 bytes (Ex: 2=0x400) + uint16_t track_len; // Length of the track data in byte. } pictrack; This table has a size of number_of_track*4 bytes. @@ -142,9 +142,9 @@ bool hfe_format::supports_save() const return true; } -int hfe_format::identify(io_generic *io, UINT32 form_factor) +int hfe_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 header[8]; + uint8_t header[8]; io_generic_read(io, &header, 0, sizeof(header)); if ( memcmp( header, HFE_FORMAT_HEADER, 8 ) ==0) { @@ -153,10 +153,10 @@ int hfe_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool hfe_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool hfe_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT8 header[HEADER_LENGTH]; - UINT8 track_table[TRACK_TABLE_LENGTH]; + uint8_t header[HEADER_LENGTH]; + uint8_t track_table[TRACK_TABLE_LENGTH]; int drivecyl, driveheads; image->get_maximal_geometry(drivecyl, driveheads); @@ -233,7 +233,7 @@ bool hfe_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) } // Load the tracks - std::vector cylinder_buffer; + std::vector cylinder_buffer; for(int cyl=0; cyl < m_cylinders; cyl++) { // actual data read @@ -288,7 +288,7 @@ bool hfe_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) return success; } -void hfe_format::generate_track_from_hfe_bitstream(int cyl, int head, int samplelength, const UINT8 *trackbuf, int track_end, floppy_image *image) +void hfe_format::generate_track_from_hfe_bitstream(int cyl, int head, int samplelength, const uint8_t *trackbuf, int track_end, floppy_image *image) { // HFE has a minor issue: The track images do not sum up to 200 ms. // Tracks are samples at 250 kbit/s for both FM and MFM, which yields @@ -315,11 +315,11 @@ void hfe_format::generate_track_from_hfe_bitstream(int cyl, int head, int sample // Cell: | AAAABBBB | = MG_1 = | BBBBAAAA | // | AAAAAAAA | = MG_0 = | BBBBBBBB | - std::vector &dest = image->get_buffer(cyl, head, 0); + std::vector &dest = image->get_buffer(cyl, head, 0); dest.clear(); // Start with MG_A - UINT32 cbit = floppy_image::MG_A; + uint32_t cbit = floppy_image::MG_A; int offset = 0x100; @@ -329,7 +329,7 @@ void hfe_format::generate_track_from_hfe_bitstream(int cyl, int head, int sample track_end -= 0x0100; } - UINT8 current = 0; + uint8_t current = 0; int time = 0; dest.push_back(cbit | time); @@ -402,11 +402,11 @@ void hfe_format::generate_track_from_hfe_bitstream(int cyl, int head, int sample bool hfe_format::save(io_generic *io, floppy_image *image) { - std::vector cylbuf; + std::vector cylbuf; cylbuf.resize(0x6200); - UINT8 header[HEADER_LENGTH]; - UINT8 track_table[TRACK_TABLE_LENGTH]; + uint8_t header[HEADER_LENGTH]; + uint8_t track_table[TRACK_TABLE_LENGTH]; int track_end = 0x61c0; int samplelength = 2000; @@ -498,7 +498,7 @@ bool hfe_format::save(io_generic *io, floppy_image *image) return true; } -void hfe_format::generate_hfe_bitstream_from_track(int cyl, int head, int& samplelength, encoding_t& encoding, UINT8 *cylinder_buffer, int track_end, floppy_image *image) +void hfe_format::generate_hfe_bitstream_from_track(int cyl, int head, int& samplelength, encoding_t& encoding, uint8_t *cylinder_buffer, int track_end, floppy_image *image) { // We are using an own implementation here because the result of the // parent class method would require some post-processing that we @@ -508,7 +508,7 @@ void hfe_format::generate_hfe_bitstream_from_track(int cyl, int head, int& sampl // as the original code // No subtracks definded - std::vector &tbuf = image->get_buffer(cyl, head, 0); + std::vector &tbuf = image->get_buffer(cyl, head, 0); if (tbuf.size() <= 1) { // Unformatted track @@ -563,7 +563,7 @@ void hfe_format::generate_hfe_bitstream_from_track(int cyl, int head, int& sampl } // Start at the write splice - UINT32 splice = image->get_write_splice_position(cyl, head, 0); + uint32_t splice = image->get_write_splice_position(cyl, head, 0); int cur_pos = splice; int cur_entry = 0; @@ -579,7 +579,7 @@ void hfe_format::generate_hfe_bitstream_from_track(int cyl, int head, int& sampl int max_period = int(samplelength*1.25); int phase_adjust = 0; int freq_hist = 0; - UINT32 next = 0; + uint32_t next = 0; int offset = 0x100; @@ -590,8 +590,8 @@ void hfe_format::generate_hfe_bitstream_from_track(int cyl, int head, int& sampl track_end -= 0x0100; } - UINT8 bit = 0x01; - UINT8 current = 0; + uint8_t bit = 0x01; + uint8_t current = 0; while (next < 200000000) { int edge = tbuf[cur_entry] & floppy_image::TIME_MASK; diff --git a/src/lib/formats/hxchfe_dsk.h b/src/lib/formats/hxchfe_dsk.h index 4f322f659c3..af4652ca9bf 100644 --- a/src/lib/formats/hxchfe_dsk.h +++ b/src/lib/formats/hxchfe_dsk.h @@ -48,8 +48,8 @@ class hfe_format : public floppy_image_format_t public: hfe_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; @@ -61,8 +61,8 @@ public: void set_encoding(encoding_t enc) { m_selected_encoding = enc; } private: - void generate_track_from_hfe_bitstream(int track, int head, int samplelength, const UINT8 *trackbuf, int track_end, floppy_image *image); - void generate_hfe_bitstream_from_track(int track, int head, int& samplelength, encoding_t& encoding, UINT8 *trackbuf, int track_end, floppy_image *image); + void generate_track_from_hfe_bitstream(int track, int head, int samplelength, const uint8_t *trackbuf, int track_end, floppy_image *image); + void generate_hfe_bitstream_from_track(int track, int head, int& samplelength, encoding_t& encoding, uint8_t *trackbuf, int track_end, floppy_image *image); // Header fields from the HFE format int m_cylinders; // Number of track in the file diff --git a/src/lib/formats/hxcmfm_dsk.cpp b/src/lib/formats/hxcmfm_dsk.cpp index 07a05d3e2f6..274c8a7695f 100644 --- a/src/lib/formats/hxcmfm_dsk.cpp +++ b/src/lib/formats/hxcmfm_dsk.cpp @@ -11,24 +11,24 @@ struct MFMIMG { - UINT8 headername[7]; + uint8_t headername[7]; - UINT16 number_of_track; - UINT8 number_of_side; + uint16_t number_of_track; + uint8_t number_of_side; - UINT16 floppyRPM; - UINT16 floppyBitRate; - UINT8 floppyiftype; + uint16_t floppyRPM; + uint16_t floppyBitRate; + uint8_t floppyiftype; - UINT32 mfmtracklistoffset; + uint32_t mfmtracklistoffset; }; struct MFMTRACKIMG { - UINT16 track_number; - UINT8 side_number; - UINT32 mfmtracksize; - UINT32 mfmtrackoffset; + uint16_t track_number; + uint8_t side_number; + uint32_t mfmtracksize; + uint32_t mfmtrackoffset; }; #pragma pack() @@ -57,9 +57,9 @@ bool mfm_format::supports_save() const return true; } -int mfm_format::identify(io_generic *io, UINT32 form_factor) +int mfm_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 header[7]; + uint8_t header[7]; io_generic_read(io, &header, 0, sizeof(header)); if ( memcmp( header, MFM_FORMAT_HEADER, 6 ) ==0) { @@ -68,7 +68,7 @@ int mfm_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool mfm_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool mfm_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { MFMIMG header; MFMTRACKIMG trackdesc; @@ -76,7 +76,7 @@ bool mfm_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) // read header io_generic_read(io, &header, 0, sizeof(header)); int counter = 0; - std::vector trackbuf; + std::vector trackbuf; for(int track=0; track < header.number_of_track; track++) { for(int side=0; side < header.number_of_side; side++) { // read location of @@ -117,7 +117,7 @@ bool mfm_format::save(io_generic *io, floppy_image *image) int tpos = sizeof(MFMIMG); int dpos = tpos + track_count*head_count*sizeof(MFMTRACKIMG); - UINT8 trackbuf[150000/8]; + uint8_t trackbuf[150000/8]; for(int track=0; track < track_count; track++) { for(int side=0; side < head_count; side++) { diff --git a/src/lib/formats/hxcmfm_dsk.h b/src/lib/formats/hxcmfm_dsk.h index 63238ab2006..eb2f8ae245b 100644 --- a/src/lib/formats/hxcmfm_dsk.h +++ b/src/lib/formats/hxcmfm_dsk.h @@ -18,8 +18,8 @@ class mfm_format : public floppy_image_format_t public: mfm_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; diff --git a/src/lib/formats/imageutl.h b/src/lib/formats/imageutl.h index 7da4a184112..5e478cfb1e7 100644 --- a/src/lib/formats/imageutl.h +++ b/src/lib/formats/imageutl.h @@ -25,43 +25,43 @@ unsigned short ccitt_crc16_one( unsigned short crc, const unsigned char data ); * Alignment-friendly integer placement * ----------------------------------------------------------------------- */ -static inline void place_integer_be(void *ptr, size_t offset, size_t size, UINT64 value) +static inline void place_integer_be(void *ptr, size_t offset, size_t size, uint64_t value) { - UINT8 *byte_ptr = ((UINT8 *) ptr) + offset; - UINT16 val16; - UINT32 val32; + uint8_t *byte_ptr = ((uint8_t *) ptr) + offset; + uint16_t val16; + uint32_t val32; switch(size) { case 2: - val16 = big_endianize_int16((UINT16) value); + val16 = big_endianize_int16((uint16_t) value); memcpy(byte_ptr, &val16, sizeof(val16)); break; case 4: - val32 = big_endianize_int32((UINT32) value); + val32 = big_endianize_int32((uint32_t) value); memcpy(byte_ptr, &val32, sizeof(val32)); break; default: - if (size >= 1) byte_ptr[0] = (UINT8) (value >> ((size - 1) * 8)); - if (size >= 2) byte_ptr[1] = (UINT8) (value >> ((size - 2) * 8)); - if (size >= 3) byte_ptr[2] = (UINT8) (value >> ((size - 3) * 8)); - if (size >= 4) byte_ptr[3] = (UINT8) (value >> ((size - 4) * 8)); - if (size >= 5) byte_ptr[4] = (UINT8) (value >> ((size - 5) * 8)); - if (size >= 6) byte_ptr[5] = (UINT8) (value >> ((size - 6) * 8)); - if (size >= 7) byte_ptr[6] = (UINT8) (value >> ((size - 7) * 8)); - if (size >= 8) byte_ptr[7] = (UINT8) (value >> ((size - 8) * 8)); + if (size >= 1) byte_ptr[0] = (uint8_t) (value >> ((size - 1) * 8)); + if (size >= 2) byte_ptr[1] = (uint8_t) (value >> ((size - 2) * 8)); + if (size >= 3) byte_ptr[2] = (uint8_t) (value >> ((size - 3) * 8)); + if (size >= 4) byte_ptr[3] = (uint8_t) (value >> ((size - 4) * 8)); + if (size >= 5) byte_ptr[4] = (uint8_t) (value >> ((size - 5) * 8)); + if (size >= 6) byte_ptr[5] = (uint8_t) (value >> ((size - 6) * 8)); + if (size >= 7) byte_ptr[6] = (uint8_t) (value >> ((size - 7) * 8)); + if (size >= 8) byte_ptr[7] = (uint8_t) (value >> ((size - 8) * 8)); break; } } -static inline UINT64 pick_integer_be(const void *ptr, size_t offset, size_t size) +static inline uint64_t pick_integer_be(const void *ptr, size_t offset, size_t size) { - UINT64 result = 0; - const UINT8 *byte_ptr = ((const UINT8 *) ptr) + offset; - UINT16 val16; - UINT32 val32; + uint64_t result = 0; + const uint8_t *byte_ptr = ((const uint8_t *) ptr) + offset; + uint16_t val16; + uint32_t val32; switch(size) { @@ -80,56 +80,56 @@ static inline UINT64 pick_integer_be(const void *ptr, size_t offset, size_t size break; default: - if (size >= 1) result |= ((UINT64) byte_ptr[0]) << ((size - 1) * 8); - if (size >= 2) result |= ((UINT64) byte_ptr[1]) << ((size - 2) * 8); - if (size >= 3) result |= ((UINT64) byte_ptr[2]) << ((size - 3) * 8); - if (size >= 4) result |= ((UINT64) byte_ptr[3]) << ((size - 4) * 8); - if (size >= 5) result |= ((UINT64) byte_ptr[4]) << ((size - 5) * 8); - if (size >= 6) result |= ((UINT64) byte_ptr[5]) << ((size - 6) * 8); - if (size >= 7) result |= ((UINT64) byte_ptr[6]) << ((size - 7) * 8); - if (size >= 8) result |= ((UINT64) byte_ptr[7]) << ((size - 8) * 8); + if (size >= 1) result |= ((uint64_t) byte_ptr[0]) << ((size - 1) * 8); + if (size >= 2) result |= ((uint64_t) byte_ptr[1]) << ((size - 2) * 8); + if (size >= 3) result |= ((uint64_t) byte_ptr[2]) << ((size - 3) * 8); + if (size >= 4) result |= ((uint64_t) byte_ptr[3]) << ((size - 4) * 8); + if (size >= 5) result |= ((uint64_t) byte_ptr[4]) << ((size - 5) * 8); + if (size >= 6) result |= ((uint64_t) byte_ptr[5]) << ((size - 6) * 8); + if (size >= 7) result |= ((uint64_t) byte_ptr[6]) << ((size - 7) * 8); + if (size >= 8) result |= ((uint64_t) byte_ptr[7]) << ((size - 8) * 8); break; } return result; } -static inline void place_integer_le(void *ptr, size_t offset, size_t size, UINT64 value) +static inline void place_integer_le(void *ptr, size_t offset, size_t size, uint64_t value) { - UINT8 *byte_ptr = ((UINT8 *) ptr) + offset; - UINT16 val16; - UINT32 val32; + uint8_t *byte_ptr = ((uint8_t *) ptr) + offset; + uint16_t val16; + uint32_t val32; switch(size) { case 2: - val16 = little_endianize_int16((UINT16) value); + val16 = little_endianize_int16((uint16_t) value); memcpy(byte_ptr, &val16, sizeof(val16)); break; case 4: - val32 = little_endianize_int32((UINT32) value); + val32 = little_endianize_int32((uint32_t) value); memcpy(byte_ptr, &val32, sizeof(val32)); break; default: - if (size >= 1) byte_ptr[0] = (UINT8) (value >> (0 * 8)); - if (size >= 2) byte_ptr[1] = (UINT8) (value >> (1 * 8)); - if (size >= 3) byte_ptr[2] = (UINT8) (value >> (2 * 8)); - if (size >= 4) byte_ptr[3] = (UINT8) (value >> (3 * 8)); - if (size >= 5) byte_ptr[4] = (UINT8) (value >> (4 * 8)); - if (size >= 6) byte_ptr[5] = (UINT8) (value >> (5 * 8)); - if (size >= 7) byte_ptr[6] = (UINT8) (value >> (6 * 8)); - if (size >= 8) byte_ptr[7] = (UINT8) (value >> (7 * 8)); + if (size >= 1) byte_ptr[0] = (uint8_t) (value >> (0 * 8)); + if (size >= 2) byte_ptr[1] = (uint8_t) (value >> (1 * 8)); + if (size >= 3) byte_ptr[2] = (uint8_t) (value >> (2 * 8)); + if (size >= 4) byte_ptr[3] = (uint8_t) (value >> (3 * 8)); + if (size >= 5) byte_ptr[4] = (uint8_t) (value >> (4 * 8)); + if (size >= 6) byte_ptr[5] = (uint8_t) (value >> (5 * 8)); + if (size >= 7) byte_ptr[6] = (uint8_t) (value >> (6 * 8)); + if (size >= 8) byte_ptr[7] = (uint8_t) (value >> (7 * 8)); break; } } -static inline UINT64 pick_integer_le(const void *ptr, size_t offset, size_t size) +static inline uint64_t pick_integer_le(const void *ptr, size_t offset, size_t size) { - UINT64 result = 0; - const UINT8 *byte_ptr = ((const UINT8 *) ptr) + offset; - UINT16 val16; - UINT32 val32; + uint64_t result = 0; + const uint8_t *byte_ptr = ((const uint8_t *) ptr) + offset; + uint16_t val16; + uint32_t val32; switch(size) { @@ -148,14 +148,14 @@ static inline UINT64 pick_integer_le(const void *ptr, size_t offset, size_t size break; default: - if (size >= 1) result |= ((UINT64) byte_ptr[0]) << (0 * 8); - if (size >= 2) result |= ((UINT64) byte_ptr[1]) << (1 * 8); - if (size >= 3) result |= ((UINT64) byte_ptr[2]) << (2 * 8); - if (size >= 4) result |= ((UINT64) byte_ptr[3]) << (3 * 8); - if (size >= 5) result |= ((UINT64) byte_ptr[4]) << (4 * 8); - if (size >= 6) result |= ((UINT64) byte_ptr[5]) << (5 * 8); - if (size >= 7) result |= ((UINT64) byte_ptr[6]) << (6 * 8); - if (size >= 8) result |= ((UINT64) byte_ptr[7]) << (7 * 8); + if (size >= 1) result |= ((uint64_t) byte_ptr[0]) << (0 * 8); + if (size >= 2) result |= ((uint64_t) byte_ptr[1]) << (1 * 8); + if (size >= 3) result |= ((uint64_t) byte_ptr[2]) << (2 * 8); + if (size >= 4) result |= ((uint64_t) byte_ptr[3]) << (3 * 8); + if (size >= 5) result |= ((uint64_t) byte_ptr[4]) << (4 * 8); + if (size >= 6) result |= ((uint64_t) byte_ptr[5]) << (5 * 8); + if (size >= 7) result |= ((uint64_t) byte_ptr[6]) << (6 * 8); + if (size >= 8) result |= ((uint64_t) byte_ptr[7]) << (7 * 8); break; } return result; diff --git a/src/lib/formats/imd_dsk.cpp b/src/lib/formats/imd_dsk.cpp index 13f155b638a..8f3626aedbb 100644 --- a/src/lib/formats/imd_dsk.cpp +++ b/src/lib/formats/imd_dsk.cpp @@ -17,7 +17,7 @@ struct imddsk_tag int heads; int tracks; int sector_size; - UINT64 track_offsets[84*2]; /* offset within data for each track */ + uint64_t track_offsets[84*2]; /* offset within data for each track */ }; @@ -32,7 +32,7 @@ static struct imddsk_tag *get_tag(floppy_image_legacy *floppy) FLOPPY_IDENTIFY( imd_dsk_identify ) { - UINT8 header[3]; + uint8_t header[3]; floppy_image_read(floppy, header, 0, 3); if (header[0]=='I' && header[1]=='M' && header[2]=='D') { @@ -53,16 +53,16 @@ static int imd_get_tracks_per_disk(floppy_image_legacy *floppy) return get_tag(floppy)->tracks; } -static UINT64 imd_get_track_offset(floppy_image_legacy *floppy, int head, int track) +static uint64_t imd_get_track_offset(floppy_image_legacy *floppy, int head, int track) { return get_tag(floppy)->track_offsets[(track<<1) + head]; } -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) +static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset) { - UINT64 offs = 0; - UINT8 header[5]; - UINT8 sector_num; + uint64_t offs = 0; + uint8_t header[5]; + uint8_t sector_num; int i; @@ -98,9 +98,9 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in static floperr_t internal_imd_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) { - UINT64 offset; + uint64_t offset; floperr_t err; - UINT8 header[1]; + uint8_t header[1]; // take sector offset err = get_offset(floppy, head, track, sector, sector_is_index, &offset); @@ -137,25 +137,25 @@ static floperr_t imd_read_indexed_sector(floppy_image_legacy *floppy, int head, return internal_imd_read_sector(floppy, head, track, sector, TRUE, buffer, buflen); } -static floperr_t imd_expand_file(floppy_image_legacy *floppy , UINT64 offset , size_t amount) +static floperr_t imd_expand_file(floppy_image_legacy *floppy , uint64_t offset , size_t amount) { if (amount == 0) { return FLOPPY_ERROR_SUCCESS; } - UINT64 file_size = floppy_image_size(floppy); + uint64_t file_size = floppy_image_size(floppy); if (offset > file_size) { return FLOPPY_ERROR_INTERNAL; } - UINT64 size_after_off = file_size - offset; + uint64_t size_after_off = file_size - offset; if (size_after_off == 0) { return FLOPPY_ERROR_SUCCESS; } - auto buffer = global_alloc_array(UINT8 , size_after_off); + auto buffer = global_alloc_array(uint8_t , size_after_off); // Read the part of file after offset floppy_image_read(floppy , buffer , offset , size_after_off); @@ -172,7 +172,7 @@ static floperr_t imd_expand_file(floppy_image_legacy *floppy , UINT64 offset , s struct imddsk_tag *tag = get_tag(floppy); for (int track = 0; track < tag->tracks; track++) { for (int head = 0; head < tag->heads; head++) { - UINT64 *track_off = &(tag->track_offsets[ (track << 1) + head ]); + uint64_t *track_off = &(tag->track_offsets[ (track << 1) + head ]); if (*track_off >= offset) { *track_off += amount; } @@ -184,9 +184,9 @@ static floperr_t imd_expand_file(floppy_image_legacy *floppy , UINT64 offset , s static floperr_t imd_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, const void *buffer, size_t buflen, int ddam) { - UINT64 offset; + uint64_t offset; floperr_t err; - UINT8 header[1]; + uint8_t header[1]; // take sector offset err = get_offset(floppy, head, track, sector_index, TRUE, &offset); @@ -222,7 +222,7 @@ static floperr_t imd_write_indexed_sector(floppy_image_legacy *floppy, int head, return FLOPPY_ERROR_SUCCESS; } -static floperr_t imd_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t imd_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { floperr_t err; err = get_offset(floppy, head, track, sector, FALSE, nullptr); @@ -235,14 +235,14 @@ static floperr_t imd_get_sector_length(floppy_image_legacy *floppy, int head, in return FLOPPY_ERROR_SUCCESS; } -static floperr_t imd_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +static floperr_t imd_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { - UINT64 offset; - UINT8 header[5]; - UINT8 hd; - UINT8 tr; - UINT32 sector_size; - UINT8 sector_num; + uint64_t offset; + uint8_t header[5]; + uint8_t hd; + uint8_t tr; + uint32_t sector_size; + uint8_t sector_num; offset = imd_get_track_offset(floppy,head,track); floppy_image_read(floppy, header, offset, 5); @@ -279,7 +279,7 @@ static floperr_t imd_get_indexed_sector_info(floppy_image_legacy *floppy, int he *sector_length = sector_size; } if (flags) { - UINT8 skip; + uint8_t skip; if (head & 0x40) { if (head & 0x80) { skip = 3; @@ -302,8 +302,8 @@ FLOPPY_CONSTRUCT( imd_dsk_construct ) { struct FloppyCallbacks *callbacks; struct imddsk_tag *tag; - UINT8 header[0x100]; - UINT64 pos = 0; + uint8_t header[0x100]; + uint64_t pos = 0; int sector_size = 0; int sector_num; int i; @@ -409,7 +409,7 @@ void imd_format::fixnum(char *start, char *end) const }; } -int imd_format::identify(io_generic *io, UINT32 form_factor) +int imd_format::identify(io_generic *io, uint32_t form_factor) { char h[4]; @@ -420,13 +420,13 @@ int imd_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool imd_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT64 size = io_generic_size(io); - std::vector img(size); + uint64_t size = io_generic_size(io); + std::vector img(size); io_generic_read(io, &img[0], 0, size); - UINT64 pos; + uint64_t pos; for(pos=0; pos < size && img[pos] != 0x1a; pos++) {}; pos++; @@ -434,16 +434,16 @@ bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) return false; while(pos < size) { - UINT8 mode = img[pos++]; - UINT8 track = img[pos++]; - UINT8 head = img[pos++]; - UINT8 sector_count = img[pos++]; - UINT8 ssize = img[pos++]; + uint8_t mode = img[pos++]; + uint8_t track = img[pos++]; + uint8_t head = img[pos++]; + uint8_t sector_count = img[pos++]; + uint8_t ssize = img[pos++]; if(ssize == 0xff) throw emu_fatalerror("imd_format: Unsupported variable sector size on track %d head %d", track, head); - UINT32 actual_size = ssize < 7 ? 128 << ssize : 8192; + uint32_t actual_size = ssize < 7 ? 128 << ssize : 8192; static const int rates[3] = { 500000, 300000, 250000 }; bool fm = mode < 3; @@ -451,12 +451,12 @@ bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) int rpm = form_factor == floppy_image::FF_8 || (form_factor == floppy_image::FF_525 && rate >= 300000) ? 360 : 300; int cell_count = (fm ? 1 : 2)*rate*60/rpm; - const UINT8 *snum = &img[pos]; + const uint8_t *snum = &img[pos]; pos += sector_count; - const UINT8 *tnum = head & 0x80 ? &img[pos] : nullptr; + const uint8_t *tnum = head & 0x80 ? &img[pos] : nullptr; if(tnum) pos += sector_count; - const UINT8 *hnum = head & 0x40 ? &img[pos] : nullptr; + const uint8_t *hnum = head & 0x40 ? &img[pos] : nullptr; if(hnum) pos += sector_count; @@ -467,7 +467,7 @@ bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) desc_pc_sector sects[256]; for(int i=0; iseek(offset, whence); } @@ -86,15 +86,15 @@ static size_t corefile_writeproc(void *file, const void *buffer, size_t length) return ((util::core_file*)file)->write(buffer, length); } -static UINT64 corefile_filesizeproc(void *file) +static uint64_t corefile_filesizeproc(void *file) { const auto l = ((util::core_file*)file)->tell(); if (((util::core_file*)file)->seek(0, SEEK_END)) return (size_t) -1; const auto sz = ((util::core_file*)file)->tell(); if (((util::core_file*)file)->seek(l, SEEK_SET)) - return UINT64(-1); - return UINT64(sz); + return uint64_t(-1); + return uint64_t(sz); } const struct io_procs corefile_ioprocs = @@ -121,7 +121,7 @@ const struct io_procs corefile_ioprocs_noclose = calls for accessing generic IO *********************************************************************/ -static void io_generic_seek(struct io_generic *genio, UINT64 offset) +static void io_generic_seek(struct io_generic *genio, uint64_t offset) { genio->procs->seekproc(genio->file, offset, SEEK_SET); } @@ -136,9 +136,9 @@ void io_generic_close(struct io_generic *genio) -void io_generic_read(struct io_generic *genio, void *buffer, UINT64 offset, size_t length) +void io_generic_read(struct io_generic *genio, void *buffer, uint64_t offset, size_t length) { - UINT64 size; + uint64_t size; size_t bytes_read; size = io_generic_size(genio); @@ -151,17 +151,17 @@ void io_generic_read(struct io_generic *genio, void *buffer, UINT64 offset, size io_generic_seek(genio, offset); bytes_read = genio->procs->readproc(genio->file, buffer, length); } - memset(((UINT8 *) buffer) + bytes_read, genio->filler, length - bytes_read); + memset(((uint8_t *) buffer) + bytes_read, genio->filler, length - bytes_read); } -void io_generic_write(struct io_generic *genio, const void *buffer, UINT64 offset, size_t length) +void io_generic_write(struct io_generic *genio, const void *buffer, uint64_t offset, size_t length) { - UINT64 filler_size = 0; + uint64_t filler_size = 0; char filler_buffer[1024]; size_t bytes_to_write; - UINT64 size; + uint64_t size; size = io_generic_size(genio); @@ -191,9 +191,9 @@ void io_generic_write(struct io_generic *genio, const void *buffer, UINT64 offse -void io_generic_write_filler(struct io_generic *genio, UINT8 filler, UINT64 offset, size_t length) +void io_generic_write_filler(struct io_generic *genio, uint8_t filler, uint64_t offset, size_t length) { - UINT8 buffer[512]; + uint8_t buffer[512]; size_t this_length; memset(buffer, filler, std::min(length, sizeof(buffer))); @@ -209,7 +209,7 @@ void io_generic_write_filler(struct io_generic *genio, UINT8 filler, UINT64 offs -UINT64 io_generic_size(struct io_generic *genio) +uint64_t io_generic_size(struct io_generic *genio) { return genio->procs->filesizeproc(genio->file); } diff --git a/src/lib/formats/ioprocs.h b/src/lib/formats/ioprocs.h index 08acbe45295..ac032d5e1f3 100644 --- a/src/lib/formats/ioprocs.h +++ b/src/lib/formats/ioprocs.h @@ -24,10 +24,10 @@ struct io_procs { void (*closeproc)(void *file); - int (*seekproc)(void *file, INT64 offset, int whence); + int (*seekproc)(void *file, int64_t offset, int whence); size_t (*readproc)(void *file, void *buffer, size_t length); size_t (*writeproc)(void *file, const void *buffer, size_t length); - UINT64 (*filesizeproc)(void *file); + uint64_t (*filesizeproc)(void *file); }; @@ -36,7 +36,7 @@ struct io_generic { const struct io_procs *procs; void *file; - UINT8 filler; + uint8_t filler; }; @@ -62,10 +62,10 @@ extern const struct io_procs corefile_ioprocs_noclose; void io_generic_close(struct io_generic *genio); -void io_generic_read(struct io_generic *genio, void *buffer, UINT64 offset, size_t length); -void io_generic_write(struct io_generic *genio, const void *buffer, UINT64 offset, size_t length); -void io_generic_write_filler(struct io_generic *genio, UINT8 filler, UINT64 offset, size_t length); -UINT64 io_generic_size(struct io_generic *genio); +void io_generic_read(struct io_generic *genio, void *buffer, uint64_t offset, size_t length); +void io_generic_write(struct io_generic *genio, const void *buffer, uint64_t offset, size_t length); +void io_generic_write_filler(struct io_generic *genio, uint8_t filler, uint64_t offset, size_t length); +uint64_t io_generic_size(struct io_generic *genio); diff --git a/src/lib/formats/ipf_dsk.cpp b/src/lib/formats/ipf_dsk.cpp index 40ad1229ab8..da50e850ea8 100644 --- a/src/lib/formats/ipf_dsk.cpp +++ b/src/lib/formats/ipf_dsk.cpp @@ -30,10 +30,10 @@ bool ipf_format::supports_save() const return false; } -int ipf_format::identify(io_generic *io, UINT32 form_factor) +int ipf_format::identify(io_generic *io, uint32_t form_factor) { - static const UINT8 refh[12] = { 0x43, 0x41, 0x50, 0x53, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0xd5, 0x73, 0xba }; - UINT8 h[12]; + static const uint8_t refh[12] = { 0x43, 0x41, 0x50, 0x53, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0xd5, 0x73, 0xba }; + uint8_t h[12]; io_generic_read(io, h, 0, 12); if(!memcmp(h, refh, 12)) @@ -42,34 +42,34 @@ int ipf_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool ipf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool ipf_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT64 size = io_generic_size(io); - std::vector data(size); + uint64_t size = io_generic_size(io); + std::vector data(size); io_generic_read(io, &data[0], 0, size); bool res = parse(data, image); return res; } -UINT32 ipf_format::r32(const UINT8 *p) +uint32_t ipf_format::r32(const uint8_t *p) { return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; } -UINT32 ipf_format::rb(const UINT8 *&p, int count) +uint32_t ipf_format::rb(const uint8_t *&p, int count) { - UINT32 v = 0; + uint32_t v = 0; for(int i=0; i &data, floppy_image *image) +bool ipf_format::parse(std::vector &data, floppy_image *image) { image->set_variant(floppy_image::DSDD); // Not handling anything else yet tcount = 84*2+1; // Usual max @@ -93,7 +93,7 @@ bool ipf_format::parse(std::vector &data, floppy_image *image) return res; } -bool ipf_format::parse_info(const UINT8 *info) +bool ipf_format::parse_info(const uint8_t *info) { type = r32(info+12); if(type != 1) @@ -116,7 +116,7 @@ bool ipf_format::parse_info(const UINT8 *info) return true; } -ipf_format::track_info *ipf_format::get_index(UINT32 idx) +ipf_format::track_info *ipf_format::get_index(uint32_t idx) { if(idx > 1000) return nullptr; @@ -131,7 +131,7 @@ ipf_format::track_info *ipf_format::get_index(UINT32 idx) return tinfos+idx; } -bool ipf_format::parse_imge(const UINT8 *imge) +bool ipf_format::parse_imge(const uint8_t *imge) { track_info *t = get_index(r32(imge+64)); if(!t) @@ -165,7 +165,7 @@ bool ipf_format::parse_imge(const UINT8 *imge) return true; } -bool ipf_format::parse_data(const UINT8 *data, UINT32 &pos, UINT32 max_extra_size) +bool ipf_format::parse_data(const uint8_t *data, uint32_t &pos, uint32_t max_extra_size) { track_info *t = get_index(r32(data+24)); if(!t) @@ -182,7 +182,7 @@ bool ipf_format::parse_data(const UINT8 *data, UINT32 &pos, UINT32 max_extra_siz return true; } -bool ipf_format::scan_one_tag(std::vector &data, UINT32 &pos, UINT8 *&tag, UINT32 &tsize) +bool ipf_format::scan_one_tag(std::vector &data, uint32_t &pos, uint8_t *&tag, uint32_t &tsize) { if(data.size()-pos < 12) return false; @@ -190,7 +190,7 @@ bool ipf_format::scan_one_tag(std::vector &data, UINT32 &pos, UINT8 *&tag tsize = r32(tag+4); if(data.size()-pos < tsize) return false; - UINT32 crc = r32(tag+8); + uint32_t crc = r32(tag+8); tag[8] = tag[9] = tag[10] = tag[11] = 0; if(crc32r(tag, tsize) != crc) return false; @@ -198,13 +198,13 @@ bool ipf_format::scan_one_tag(std::vector &data, UINT32 &pos, UINT8 *&tag return true; } -bool ipf_format::scan_all_tags(std::vector &data) +bool ipf_format::scan_all_tags(std::vector &data) { - UINT32 pos = 0; - UINT32 size = data.size(); + uint32_t pos = 0; + uint32_t size = data.size(); while(pos != size) { - UINT8 *tag; - UINT32 tsize; + uint8_t *tag; + uint32_t tsize; if(!scan_one_tag(data, pos, tag, tsize)) return false; @@ -245,7 +245,7 @@ bool ipf_format::scan_all_tags(std::vector &data) bool ipf_format::generate_tracks(floppy_image *image) { - for(UINT32 i = 0; i != tcount; i++) { + for(uint32_t i = 0; i != tcount; i++) { track_info *t = tinfos + i; if(t->info_set && t->data) { if(!generate_track(t, image)) @@ -257,14 +257,14 @@ bool ipf_format::generate_tracks(floppy_image *image) return true; } -void ipf_format::rotate(std::vector &track, UINT32 offset, UINT32 size) +void ipf_format::rotate(std::vector &track, uint32_t offset, uint32_t size) { - UINT32 done = 0; - for(UINT32 bpos=0; done < size; bpos++) { - UINT32 pos = bpos; - UINT32 hold = track[pos]; + uint32_t done = 0; + for(uint32_t bpos=0; done < size; bpos++) { + uint32_t pos = bpos; + uint32_t hold = track[pos]; for(;;) { - UINT32 npos = pos+offset; + uint32_t npos = pos+offset; if(npos >= size) npos -= size; if(npos == bpos) @@ -278,11 +278,11 @@ void ipf_format::rotate(std::vector &track, UINT32 offset, UINT32 size) } } -void ipf_format::mark_track_splice(std::vector &track, UINT32 offset, UINT32 size) +void ipf_format::mark_track_splice(std::vector &track, uint32_t offset, uint32_t size) { for(int i=0; i<3; i++) { - UINT32 pos = (offset + i) % size; - UINT32 v = track[pos]; + uint32_t pos = (offset + i) % size; + uint32_t v = track[pos]; if((v & floppy_image::MG_MASK) == MG_0) v = (v & floppy_image::TIME_MASK) | MG_1; else if((v & floppy_image::MG_MASK) == MG_1) @@ -291,13 +291,13 @@ void ipf_format::mark_track_splice(std::vector &track, UINT32 offset, UI } } -void ipf_format::timing_set(std::vector &track, UINT32 start, UINT32 end, UINT32 time) +void ipf_format::timing_set(std::vector &track, uint32_t start, uint32_t end, uint32_t time) { - for(UINT32 i=start; i != end; i++) + for(uint32_t i=start; i != end; i++) track[i] = (track[i] & floppy_image::MG_MASK) | time; } -bool ipf_format::generate_timings(track_info *t, std::vector &track, const std::vector &data_pos, const std::vector &gap_pos) +bool ipf_format::generate_timings(track_info *t, std::vector &track, const std::vector &data_pos, const std::vector &gap_pos) { timing_set(track, 0, t->size_cells, 2000); @@ -362,8 +362,8 @@ bool ipf_format::generate_timings(track_info *t, std::vector &track, con break; case 9: { - UINT32 mask = r32(t->data + 32*t->block_count + 12); - for(UINT32 i=1; iblock_count; i++) + uint32_t mask = r32(t->data + 32*t->block_count + 12); + for(uint32_t i=1; iblock_count; i++) timing_set(track, data_pos[i], gap_pos[i], mask & (1 << (i-1)) ? 1900 : 2100); break; } @@ -391,14 +391,14 @@ bool ipf_format::generate_track(track_info *t, floppy_image *image) if(t->index_cells >= t->size_cells) return false; - std::vector track(t->size_cells); - std::vector data_pos(t->block_count+1); - std::vector gap_pos(t->block_count); - std::vector splice_pos(t->block_count); + std::vector track(t->size_cells); + std::vector data_pos(t->block_count+1); + std::vector gap_pos(t->block_count); + std::vector splice_pos(t->block_count); bool context = false; - UINT32 pos = 0; - for(UINT32 i = 0; i != t->block_count; i++) { + uint32_t pos = 0; + for(uint32_t i = 0; i != t->block_count; i++) { if(!generate_block(t, i, i == t->block_count-1 ? t->size_cells - t->index_cells : 0xffffffff, track, pos, data_pos[i], gap_pos[i], splice_pos[i], context)) { return false; } @@ -423,19 +423,19 @@ bool ipf_format::generate_track(track_info *t, floppy_image *image) return true; } -void ipf_format::track_write_raw(std::vector::iterator &tpos, const UINT8 *data, UINT32 cells, bool &context) +void ipf_format::track_write_raw(std::vector::iterator &tpos, const uint8_t *data, uint32_t cells, bool &context) { - for(UINT32 i=0; i != cells; i++) + for(uint32_t i=0; i != cells; i++) *tpos++ = data[i>>3] & (0x80 >> (i & 7)) ? MG_1 : MG_0; if(cells) context = tpos[-1] == MG_1; } -void ipf_format::track_write_mfm(std::vector::iterator &tpos, const UINT8 *data, UINT32 start_offset, UINT32 patlen, UINT32 cells, bool &context) +void ipf_format::track_write_mfm(std::vector::iterator &tpos, const uint8_t *data, uint32_t start_offset, uint32_t patlen, uint32_t cells, bool &context) { patlen *= 2; - for(UINT32 i=0; i != cells; i++) { - UINT32 pos = (i + start_offset) % patlen; + for(uint32_t i=0; i != cells; i++) { + uint32_t pos = (i + start_offset) % patlen; bool bit = data[pos>>4] & (0x80 >> ((pos >> 1) & 7)); if(pos & 1) { *tpos++ = bit ? MG_1 : MG_0; @@ -445,22 +445,22 @@ void ipf_format::track_write_mfm(std::vector::iterator &tpos, const UINT } } -void ipf_format::track_write_weak(std::vector::iterator &tpos, UINT32 cells) +void ipf_format::track_write_weak(std::vector::iterator &tpos, uint32_t cells) { - for(UINT32 i=0; i != cells; i++) + for(uint32_t i=0; i != cells; i++) *tpos++ = floppy_image::MG_N; } -bool ipf_format::generate_block_data(const UINT8 *data, const UINT8 *dlimit, std::vector::iterator tpos, std::vector::iterator tlimit, bool &context) +bool ipf_format::generate_block_data(const uint8_t *data, const uint8_t *dlimit, std::vector::iterator tpos, std::vector::iterator tlimit, bool &context) { for(;;) { if(data >= dlimit) return false; - UINT8 val = *data++; + uint8_t val = *data++; if((val >> 5) > dlimit-data) return false; - UINT32 param = rb(data, val >> 5); - UINT32 tleft = tlimit - tpos; + uint32_t param = rb(data, val >> 5); + uint32_t tleft = tlimit - tpos; switch(val & 0x1f) { case 0: // End of description return !tleft; @@ -493,11 +493,11 @@ bool ipf_format::generate_block_data(const UINT8 *data, const UINT8 *dlimit, std } } -bool ipf_format::generate_block_gap_0(UINT32 gap_cells, UINT8 pattern, UINT32 &spos, UINT32 ipos, std::vector::iterator &tpos, bool &context) +bool ipf_format::generate_block_gap_0(uint32_t gap_cells, uint8_t pattern, uint32_t &spos, uint32_t ipos, std::vector::iterator &tpos, bool &context) { spos = ipos >= 16 && ipos+16 <= gap_cells ? ipos : gap_cells >> 1; track_write_mfm(tpos, &pattern, 0, 8, spos, context); - UINT32 delta = 0; + uint32_t delta = 0; if(gap_cells & 1) { *tpos++ = MG_0; delta++; @@ -506,16 +506,16 @@ bool ipf_format::generate_block_gap_0(UINT32 gap_cells, UINT8 pattern, UINT32 &s return true; } -bool ipf_format::gap_description_to_reserved_size(const UINT8 *&data, const UINT8 *dlimit, UINT32 &res_size) +bool ipf_format::gap_description_to_reserved_size(const uint8_t *&data, const uint8_t *dlimit, uint32_t &res_size) { res_size = 0; for(;;) { if(data >= dlimit) return false; - UINT8 val = *data++; + uint8_t val = *data++; if((val >> 5) > dlimit-data) return false; - UINT32 param = rb(data, val >> 5); + uint32_t param = rb(data, val >> 5); switch(val & 0x1f) { case 0: return true; @@ -531,23 +531,23 @@ bool ipf_format::gap_description_to_reserved_size(const UINT8 *&data, const UINT } } -bool ipf_format::generate_gap_from_description(const UINT8 *&data, const UINT8 *dlimit, std::vector::iterator tpos, UINT32 size, bool pre, bool &context) +bool ipf_format::generate_gap_from_description(const uint8_t *&data, const uint8_t *dlimit, std::vector::iterator tpos, uint32_t size, bool pre, bool &context) { - const UINT8 *data1 = data; - UINT32 res_size; + const uint8_t *data1 = data; + uint32_t res_size; if(!gap_description_to_reserved_size(data1, dlimit, res_size)) return false; if(res_size > size) return false; - UINT8 pattern[16]; + uint8_t pattern[16]; memset(pattern, 0, sizeof(pattern)); - UINT32 pattern_size = 0; + uint32_t pattern_size = 0; - UINT32 pos = 0, block_size = 0; + uint32_t pos = 0, block_size = 0; for(;;) { - UINT8 val = *data++; - UINT32 param = rb(data, val >> 5); + uint8_t val = *data++; + uint32_t param = rb(data, val >> 5); switch(val & 0x1f) { case 0: return size == pos; @@ -601,7 +601,7 @@ bool ipf_format::generate_gap_from_description(const UINT8 *&data, const UINT8 * } -bool ipf_format::generate_block_gap_1(UINT32 gap_cells, UINT32 &spos, UINT32 ipos, const UINT8 *data, const UINT8 *dlimit, std::vector::iterator &tpos, bool &context) +bool ipf_format::generate_block_gap_1(uint32_t gap_cells, uint32_t &spos, uint32_t ipos, const uint8_t *data, const uint8_t *dlimit, std::vector::iterator &tpos, bool &context) { if(ipos >= 16 && ipos < gap_cells-16) spos = ipos; @@ -610,7 +610,7 @@ bool ipf_format::generate_block_gap_1(UINT32 gap_cells, UINT32 &spos, UINT32 ipo return generate_gap_from_description(data, dlimit, tpos, gap_cells, true, context); } -bool ipf_format::generate_block_gap_2(UINT32 gap_cells, UINT32 &spos, UINT32 ipos, const UINT8 *data, const UINT8 *dlimit, std::vector::iterator &tpos, bool &context) +bool ipf_format::generate_block_gap_2(uint32_t gap_cells, uint32_t &spos, uint32_t ipos, const uint8_t *data, const uint8_t *dlimit, std::vector::iterator &tpos, bool &context) { if(ipos >= 16 && ipos < gap_cells-16) spos = ipos; @@ -619,13 +619,13 @@ bool ipf_format::generate_block_gap_2(UINT32 gap_cells, UINT32 &spos, UINT32 ipo return generate_gap_from_description(data, dlimit, tpos, gap_cells, false, context); } -bool ipf_format::generate_block_gap_3(UINT32 gap_cells, UINT32 &spos, UINT32 ipos, const UINT8 *data, const UINT8 *dlimit, std::vector::iterator &tpos, bool &context) +bool ipf_format::generate_block_gap_3(uint32_t gap_cells, uint32_t &spos, uint32_t ipos, const uint8_t *data, const uint8_t *dlimit, std::vector::iterator &tpos, bool &context) { if(ipos >= 16 && ipos < gap_cells-16) spos = ipos; else { - UINT32 presize, postsize; - const UINT8 *data1 = data; + uint32_t presize, postsize; + const uint8_t *data1 = data; if(!gap_description_to_reserved_size(data1, dlimit, presize)) return false; if(!gap_description_to_reserved_size(data1, dlimit, postsize)) @@ -637,7 +637,7 @@ bool ipf_format::generate_block_gap_3(UINT32 gap_cells, UINT32 &spos, UINT32 ipo } if(!generate_gap_from_description(data, dlimit, tpos, spos, true, context)) return false; - UINT32 delta = 0; + uint32_t delta = 0; if(gap_cells & 1) { tpos[spos] = MG_0; delta++; @@ -646,7 +646,7 @@ bool ipf_format::generate_block_gap_3(UINT32 gap_cells, UINT32 &spos, UINT32 ipo return generate_gap_from_description(data, dlimit, tpos+spos+delta, gap_cells - spos - delta, false, context); } -bool ipf_format::generate_block_gap(UINT32 gap_type, UINT32 gap_cells, UINT8 pattern, UINT32 &spos, UINT32 ipos, const UINT8 *data, const UINT8 *dlimit, std::vector::iterator tpos, bool &context) +bool ipf_format::generate_block_gap(uint32_t gap_type, uint32_t gap_cells, uint8_t pattern, uint32_t &spos, uint32_t ipos, const uint8_t *data, const uint8_t *dlimit, std::vector::iterator tpos, bool &context) { switch(gap_type) { case 0: @@ -662,13 +662,13 @@ bool ipf_format::generate_block_gap(UINT32 gap_type, UINT32 gap_cells, UINT8 pat } } -bool ipf_format::generate_block(track_info *t, UINT32 idx, UINT32 ipos, std::vector &track, UINT32 &pos, UINT32 &dpos, UINT32 &gpos, UINT32 &spos, bool &context) +bool ipf_format::generate_block(track_info *t, uint32_t idx, uint32_t ipos, std::vector &track, uint32_t &pos, uint32_t &dpos, uint32_t &gpos, uint32_t &spos, bool &context) { - const UINT8 *data = t->data; - const UINT8 *data_end = t->data + t->data_size; - const UINT8 *thead = data + 32*idx; - UINT32 data_cells = r32(thead); - UINT32 gap_cells = r32(thead+4); + const uint8_t *data = t->data; + const uint8_t *data_end = t->data + t->data_size; + const uint8_t *thead = data + 32*idx; + uint32_t data_cells = r32(thead); + uint32_t gap_cells = r32(thead+4); if(gap_cells < 8) gap_cells = 0; @@ -694,13 +694,13 @@ bool ipf_format::generate_block(track_info *t, UINT32 idx, UINT32 ipos, std::vec return true; } -UINT32 ipf_format::block_compute_real_size(track_info *t) +uint32_t ipf_format::block_compute_real_size(track_info *t) { - UINT32 size = 0; - const UINT8 *thead = t->data; + uint32_t size = 0; + const uint8_t *thead = t->data; for(unsigned int i=0; i != t->block_count; i++) { - UINT32 data_cells = r32(thead); - UINT32 gap_cells = r32(thead+4); + uint32_t data_cells = r32(thead); + uint32_t gap_cells = r32(thead+4); if(gap_cells < 8) gap_cells = 0; diff --git a/src/lib/formats/ipf_dsk.h b/src/lib/formats/ipf_dsk.h index 0df0e4c3285..d4f5fcb6ac5 100644 --- a/src/lib/formats/ipf_dsk.h +++ b/src/lib/formats/ipf_dsk.h @@ -10,8 +10,8 @@ class ipf_format : public floppy_image_format_t public: ipf_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual const char *name() const override; virtual const char *description() const override; @@ -20,68 +20,68 @@ public: private: struct track_info { - UINT32 cylinder, head, type; - UINT32 sigtype, process, reserved[3]; - UINT32 size_bytes, size_cells; - UINT32 index_bytes, index_cells; - UINT32 datasize_cells, gapsize_cells; - UINT32 block_count, weak_bits; + uint32_t cylinder, head, type; + uint32_t sigtype, process, reserved[3]; + uint32_t size_bytes, size_cells; + uint32_t index_bytes, index_cells; + uint32_t datasize_cells, gapsize_cells; + uint32_t block_count, weak_bits; - UINT32 data_size_bits; + uint32_t data_size_bits; bool info_set; - const UINT8 *data; - UINT32 data_size; + const uint8_t *data; + uint32_t data_size; }; track_info *tinfos; - UINT32 tcount; + uint32_t tcount; - UINT32 type, release, revision; - UINT32 encoder_type, encoder_revision, origin; - UINT32 min_cylinder, max_cylinder, min_head, max_head; - UINT32 credit_day, credit_time; - UINT32 platform[4], extra[5]; + uint32_t type, release, revision; + uint32_t encoder_type, encoder_revision, origin; + uint32_t min_cylinder, max_cylinder, min_head, max_head; + uint32_t credit_day, credit_time; + uint32_t platform[4], extra[5]; - UINT32 crc32r(const UINT8 *data, UINT32 size); + uint32_t crc32r(const uint8_t *data, uint32_t size); - bool parse_info(const UINT8 *info); - bool parse_imge(const UINT8 *imge); - bool parse_data(const UINT8 *data, UINT32 &pos, UINT32 max_extra_size); + bool parse_info(const uint8_t *info); + bool parse_imge(const uint8_t *imge); + bool parse_data(const uint8_t *data, uint32_t &pos, uint32_t max_extra_size); - bool scan_one_tag(std::vector &data, UINT32 &pos, UINT8 *&tag, UINT32 &tsize); - bool scan_all_tags(std::vector &data); - static UINT32 r32(const UINT8 *p); - static UINT32 rb(const UINT8 *&p, int count); + bool scan_one_tag(std::vector &data, uint32_t &pos, uint8_t *&tag, uint32_t &tsize); + bool scan_all_tags(std::vector &data); + static uint32_t r32(const uint8_t *p); + static uint32_t rb(const uint8_t *&p, int count); - track_info *get_index(UINT32 idx); + track_info *get_index(uint32_t idx); - void track_write_raw(std::vector::iterator &tpos, const UINT8 *data, UINT32 cells, bool &context); - void track_write_mfm(std::vector::iterator &tpos, const UINT8 *data, UINT32 start_offset, UINT32 patlen, UINT32 cells, bool &context); - void track_write_weak(std::vector::iterator &tpos, UINT32 cells); - bool generate_block_data(const UINT8 *data, const UINT8 *dlimit, std::vector::iterator tpos, std::vector::iterator tlimit, bool &context); + void track_write_raw(std::vector::iterator &tpos, const uint8_t *data, uint32_t cells, bool &context); + void track_write_mfm(std::vector::iterator &tpos, const uint8_t *data, uint32_t start_offset, uint32_t patlen, uint32_t cells, bool &context); + void track_write_weak(std::vector::iterator &tpos, uint32_t cells); + bool generate_block_data(const uint8_t *data, const uint8_t *dlimit, std::vector::iterator tpos, std::vector::iterator tlimit, bool &context); - bool gap_description_to_reserved_size(const UINT8 *&data, const UINT8 *dlimit, UINT32 &res_size); - bool generate_gap_from_description(const UINT8 *&data, const UINT8 *dlimit, std::vector::iterator tpos, UINT32 size, bool pre, bool &context); - bool generate_block_gap_0(UINT32 gap_cells, UINT8 pattern, UINT32 &spos, UINT32 ipos, std::vector::iterator &tpos, bool &context); - bool generate_block_gap_1(UINT32 gap_cells, UINT32 &spos, UINT32 ipos, const UINT8 *data, const UINT8 *dlimit, std::vector::iterator &tpos, bool &context); - bool generate_block_gap_2(UINT32 gap_cells, UINT32 &spos, UINT32 ipos, const UINT8 *data, const UINT8 *dlimit, std::vector::iterator &tpos, bool &context); - bool generate_block_gap_3(UINT32 gap_cells, UINT32 &spos, UINT32 ipos, const UINT8 *data, const UINT8 *dlimit, std::vector::iterator &tpos, bool &context); - bool generate_block_gap(UINT32 gap_type, UINT32 gap_cells, UINT8 pattern, UINT32 &spos, UINT32 ipos, const UINT8 *data, const UINT8 *dlimit, std::vector::iterator tpos, bool &context); + bool gap_description_to_reserved_size(const uint8_t *&data, const uint8_t *dlimit, uint32_t &res_size); + bool generate_gap_from_description(const uint8_t *&data, const uint8_t *dlimit, std::vector::iterator tpos, uint32_t size, bool pre, bool &context); + bool generate_block_gap_0(uint32_t gap_cells, uint8_t pattern, uint32_t &spos, uint32_t ipos, std::vector::iterator &tpos, bool &context); + bool generate_block_gap_1(uint32_t gap_cells, uint32_t &spos, uint32_t ipos, const uint8_t *data, const uint8_t *dlimit, std::vector::iterator &tpos, bool &context); + bool generate_block_gap_2(uint32_t gap_cells, uint32_t &spos, uint32_t ipos, const uint8_t *data, const uint8_t *dlimit, std::vector::iterator &tpos, bool &context); + bool generate_block_gap_3(uint32_t gap_cells, uint32_t &spos, uint32_t ipos, const uint8_t *data, const uint8_t *dlimit, std::vector::iterator &tpos, bool &context); + bool generate_block_gap(uint32_t gap_type, uint32_t gap_cells, uint8_t pattern, uint32_t &spos, uint32_t ipos, const uint8_t *data, const uint8_t *dlimit, std::vector::iterator tpos, bool &context); - bool generate_block(track_info *t, UINT32 idx, UINT32 ipos, std::vector &track, UINT32 &pos, UINT32 &dpos, UINT32 &gpos, UINT32 &spos, bool &context); - UINT32 block_compute_real_size(track_info *t); + bool generate_block(track_info *t, uint32_t idx, uint32_t ipos, std::vector &track, uint32_t &pos, uint32_t &dpos, uint32_t &gpos, uint32_t &spos, bool &context); + uint32_t block_compute_real_size(track_info *t); - void timing_set(std::vector &track, UINT32 start, UINT32 end, UINT32 time); - bool generate_timings(track_info *t, std::vector &track, const std::vector &data_pos, const std::vector &gap_pos); + void timing_set(std::vector &track, uint32_t start, uint32_t end, uint32_t time); + bool generate_timings(track_info *t, std::vector &track, const std::vector &data_pos, const std::vector &gap_pos); - void rotate(std::vector &track, UINT32 offset, UINT32 size); - void mark_track_splice(std::vector &track, UINT32 offset, UINT32 size); + void rotate(std::vector &track, uint32_t offset, uint32_t size); + void mark_track_splice(std::vector &track, uint32_t offset, uint32_t size); bool generate_track(track_info *t, floppy_image *image); bool generate_tracks(floppy_image *image); - bool parse(std::vector &data, floppy_image *image); + bool parse(std::vector &data, floppy_image *image); }; extern const floppy_format_type FLOPPY_IPF_FORMAT; diff --git a/src/lib/formats/jvc_dsk.cpp b/src/lib/formats/jvc_dsk.cpp index ce364d9efe2..30417eb3315 100644 --- a/src/lib/formats/jvc_dsk.cpp +++ b/src/lib/formats/jvc_dsk.cpp @@ -39,9 +39,9 @@ bool jvc_format::parse_header(io_generic *io, int &header_size, int &tracks, int { // The JVC format has a header whose size is the size of the image modulo 256. Currently, we only // handle up to five header bytes - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); header_size = size % 256; - UINT8 header[5]; + uint8_t header[5]; // if we know that this is a header of a bad size, we can fail // immediately; otherwise read the header @@ -75,13 +75,13 @@ bool jvc_format::parse_header(io_generic *io, int &header_size, int &tracks, int return tracks * heads * sectors * sector_size == (size - header_size); } -int jvc_format::identify(io_generic *io, UINT32 form_factor) +int jvc_format::identify(io_generic *io, uint32_t form_factor) { int header_size, tracks, heads, sectors, sector_size, sector_base_id; return parse_header(io, header_size, tracks, heads, sectors, sector_size, sector_base_id) ? 50 : 0; } -bool jvc_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool jvc_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { int header_size, track_count, head_count, sector_count, sector_size, sector_base_id; @@ -99,7 +99,7 @@ bool jvc_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) for (int head = 0; head < head_count ; head++) { desc_pc_sector sectors[256]; - UINT8 sector_data[10000]; + uint8_t sector_data[10000]; int sector_offset = 0; for (int i = 0; i < sector_count; i++) @@ -128,10 +128,10 @@ bool jvc_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) bool jvc_format::save(io_generic *io, floppy_image *image) { - UINT8 bitstream[500000/8]; - UINT8 sector_data[50000]; + uint8_t bitstream[500000/8]; + uint8_t sector_data[50000]; desc_xs sectors[256]; - UINT64 file_offset = 0; + uint64_t file_offset = 0; int track_count, head_count; image->get_actual_geometry(track_count, head_count); @@ -139,7 +139,7 @@ bool jvc_format::save(io_generic *io, floppy_image *image) // we'll write a header if the disk is two-sided if (head_count == 2) { - UINT8 header[2]; + uint8_t header[2]; header[0] = 18; header[1] = 2; io_generic_write(io, header, file_offset, sizeof(header)); diff --git a/src/lib/formats/jvc_dsk.h b/src/lib/formats/jvc_dsk.h index 244c84a8592..bb74fbf8ac4 100644 --- a/src/lib/formats/jvc_dsk.h +++ b/src/lib/formats/jvc_dsk.h @@ -24,11 +24,11 @@ public: struct jvc_header { - UINT8 sectors_per_track; - UINT8 side_count; - UINT8 sector_size; - UINT8 first_sector_id; - UINT8 sector_attribute_flag; + uint8_t sectors_per_track; + uint8_t side_count; + uint8_t sector_size; + uint8_t first_sector_id; + uint8_t sector_attribute_flag; int header_size; }; @@ -36,8 +36,8 @@ public: virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual bool supports_save() const override; diff --git a/src/lib/formats/kc_cas.cpp b/src/lib/formats/kc_cas.cpp index 2e9638d19c9..713def9ac83 100644 --- a/src/lib/formats/kc_cas.cpp +++ b/src/lib/formats/kc_cas.cpp @@ -43,7 +43,7 @@ static int kc_image_size; /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -static inline int kc_cas_cycle(INT16 *buffer, int sample_pos, int len) +static inline int kc_cas_cycle(int16_t *buffer, int sample_pos, int len) { int num_samples = KC_WAV_FREQUENCY / (len * 2); @@ -63,7 +63,7 @@ static inline int kc_cas_cycle(INT16 *buffer, int sample_pos, int len) /******************************************************************* Generate n samples of silence ********************************************************************/ -static inline int kc_cas_silence(INT16 *buffer, int sample_pos, int len) +static inline int kc_cas_silence(int16_t *buffer, int sample_pos, int len) { int i = 0; @@ -78,7 +78,7 @@ static inline int kc_cas_silence(INT16 *buffer, int sample_pos, int len) /******************************************************************* Generate samples for 1 byte ********************************************************************/ -static inline int kc_cas_byte(INT16 *buffer, int sample_pos, UINT8 data) +static inline int kc_cas_byte(int16_t *buffer, int sample_pos, uint8_t data) { int samples = 0; @@ -103,7 +103,7 @@ static inline int kc_cas_byte(INT16 *buffer, int sample_pos, UINT8 data) return samples; } -static int kc_handle_cass(INT16 *buffer, const UINT8 *casdata, int type) +static int kc_handle_cass(int16_t *buffer, const uint8_t *casdata, int type) { int data_pos = (type == KC_IMAGE_KCC || type == KC_IMAGE_KCM) ? 0 : 16; int sample_count = 0; @@ -119,7 +119,7 @@ static int kc_handle_cass(INT16 *buffer, const UINT8 *casdata, int type) // on the entire file while( data_pos < kc_image_size ) { - UINT8 checksum = 0; + uint8_t checksum = 0; // 200 cycles of BIT_1 every block for (int i=0; i<200; i++) @@ -142,7 +142,7 @@ static int kc_handle_cass(INT16 *buffer, const UINT8 *casdata, int type) // write the 128 bytes of the block for (int i=0; i<128; i++) { - UINT8 data = 0; + uint8_t data = 0; if (data_pos < kc_image_size) data = casdata[data_pos++]; @@ -184,13 +184,13 @@ static int kc_handle_cass(INT16 *buffer, const UINT8 *casdata, int type) } -static int kc_handle_kcc(INT16 *buffer, const UINT8 *casdata) +static int kc_handle_kcc(int16_t *buffer, const uint8_t *casdata) { return kc_handle_cass(buffer, casdata, KC_IMAGE_KCC); } -static int kc_handle_tap(INT16 *buffer, const UINT8 *casdata) +static int kc_handle_tap(int16_t *buffer, const uint8_t *casdata) { if (!strncmp((const char *)(casdata + 1), "KC-TAPE by AF", 13)) { @@ -210,9 +210,9 @@ static int kc_handle_tap(INT16 *buffer, const UINT8 *casdata) } } -static int kc_handle_sss(INT16 *buffer, const UINT8 *casdata) +static int kc_handle_sss(int16_t *buffer, const uint8_t *casdata) { - std::vector sss(kc_image_size + 11); + std::vector sss(kc_image_size + 11); // tries to generate the missing head memset(&sss[0], 0xd3, 3); @@ -232,7 +232,7 @@ static int kc_handle_sss(INT16 *buffer, const UINT8 *casdata) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int kc_kcc_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int kc_kcc_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return kc_handle_kcc(buffer, bytes); } @@ -241,7 +241,7 @@ static int kc_kcc_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) /******************************************************************* Calculate the number of samples needed for this tape image classical ********************************************************************/ -static int kc_kcc_to_wav_size(const UINT8 *casdata, int caslen) +static int kc_kcc_to_wav_size(const uint8_t *casdata, int caslen) { kc_image_size = caslen ; @@ -284,7 +284,7 @@ static const struct CassetteFormat kc_kcc_format = /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int kc_tap_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int kc_tap_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return kc_handle_tap(buffer, bytes); } @@ -293,7 +293,7 @@ static int kc_tap_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) /******************************************************************* Calculate the number of samples needed for this tape image classical ********************************************************************/ -static int kc_tap_to_wav_size(const UINT8 *casdata, int caslen) +static int kc_tap_to_wav_size(const uint8_t *casdata, int caslen) { kc_image_size = caslen ; @@ -336,7 +336,7 @@ static const struct CassetteFormat kc_tap_format = /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int kc_sss_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int kc_sss_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return kc_handle_sss(buffer, bytes); } @@ -345,7 +345,7 @@ static int kc_sss_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) /******************************************************************* Calculate the number of samples needed for this tape image classical ********************************************************************/ -static int kc_sss_to_wav_size(const UINT8 *casdata, int caslen) +static int kc_sss_to_wav_size(const uint8_t *casdata, int caslen) { kc_image_size = caslen ; diff --git a/src/lib/formats/kim1_cas.cpp b/src/lib/formats/kim1_cas.cpp index 6cef030874a..1bfccc7f8a0 100644 --- a/src/lib/formats/kim1_cas.cpp +++ b/src/lib/formats/kim1_cas.cpp @@ -11,7 +11,7 @@ static int cas_size; -static inline int kim1_output_signal( INT16 *buffer, int sample_pos, int high ) +static inline int kim1_output_signal( int16_t *buffer, int sample_pos, int high ) { int sample_count, i, j; @@ -62,7 +62,7 @@ static inline int kim1_output_signal( INT16 *buffer, int sample_pos, int high ) } -static inline int kim1_output_byte( INT16 *buffer, int sample_pos, UINT8 byte ) +static inline int kim1_output_byte( int16_t *buffer, int sample_pos, uint8_t byte ) { int i; int sample_count = 0; @@ -78,11 +78,11 @@ static inline int kim1_output_byte( INT16 *buffer, int sample_pos, UINT8 byte ) } -static int kim1_handle_kim(INT16 *buffer, const UINT8 *casdata) +static int kim1_handle_kim(int16_t *buffer, const uint8_t *casdata) { - static const UINT8 encoding[16] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 }; + static const uint8_t encoding[16] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 }; int i, data_pos, sample_count; - UINT16 size, address, file_id, checksum; + uint16_t size, address, file_id, checksum; if ( cas_size < 9 ) return -1; if ( memcmp( casdata, "KIM1", 4 ) ) return -1; @@ -115,7 +115,7 @@ static int kim1_handle_kim(INT16 *buffer, const UINT8 *casdata) /* Output the data */ while( data_pos < cas_size && data_pos < ( size + 9 ) ) { - UINT8 data = casdata[data_pos]; + uint8_t data = casdata[data_pos]; sample_count += kim1_output_byte( buffer, sample_count, encoding[ data >> 4 ] ); sample_count += kim1_output_byte( buffer, sample_count, encoding[ data & 0x0f ] ); @@ -143,7 +143,7 @@ static int kim1_handle_kim(INT16 *buffer, const UINT8 *casdata) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int kim1_kim_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int kim1_kim_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return kim1_handle_kim( buffer, bytes ); } @@ -152,7 +152,7 @@ static int kim1_kim_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) /******************************************************************* Calculate the number of samples needed for this tape image ********************************************************************/ -static int kim1_kim_to_wav_size(const UINT8 *casdata, int caslen) +static int kim1_kim_to_wav_size(const uint8_t *casdata, int caslen) { cas_size = caslen; diff --git a/src/lib/formats/lviv_lvt.cpp b/src/lib/formats/lviv_lvt.cpp index e53a68be471..09e91eac9fd 100644 --- a/src/lib/formats/lviv_lvt.cpp +++ b/src/lib/formats/lviv_lvt.cpp @@ -17,7 +17,7 @@ #define LVIV_LVT_HEADER_PILOT_LENGTH 5190 #define LVIV_LVT_BLOCK_PILOT_LENGTH 1298 -static INT16 *lviv_emit_level(INT16 *p, int count, int level) +static int16_t *lviv_emit_level(int16_t *p, int count, int level) { int i; @@ -28,7 +28,7 @@ static INT16 *lviv_emit_level(INT16 *p, int count, int level) return p; } -static INT16* lviv_output_bit(INT16 *p, UINT8 b) +static int16_t* lviv_output_bit(int16_t *p, uint8_t b) { if (b) { @@ -45,7 +45,7 @@ static INT16* lviv_output_bit(INT16 *p, UINT8 b) return p; } -static INT16* lviv_output_byte(INT16 *p, UINT8 byte) +static int16_t* lviv_output_byte(int16_t *p, uint8_t byte) { int i; @@ -61,7 +61,7 @@ static INT16* lviv_output_byte(INT16 *p, UINT8 byte) /*************************************************************************************/ -static int lviv_cassette_calculate_size_in_samples(const UINT8 *bytes, int length) +static int lviv_cassette_calculate_size_in_samples(const uint8_t *bytes, int length) { int size; @@ -76,10 +76,10 @@ static int lviv_cassette_calculate_size_in_samples(const UINT8 *bytes, int lengt /*************************************************************************************/ -static int lviv_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int lviv_cassette_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { int i; - INT16 * p = buffer; + int16_t * p = buffer; int data_size; diff --git a/src/lib/formats/m20_dsk.cpp b/src/lib/formats/m20_dsk.cpp index 5fec77cf1d5..a831547e6e7 100644 --- a/src/lib/formats/m20_dsk.cpp +++ b/src/lib/formats/m20_dsk.cpp @@ -40,20 +40,20 @@ bool m20_format::supports_save() const return false; } -int m20_format::identify(io_generic *io, UINT32 form_factor) +int m20_format::identify(io_generic *io, uint32_t form_factor) { if(io_generic_size(io) == 286720) return 50; return 0; } -bool m20_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool m20_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { for(int track = 0; track < 35; track++) for(int head = 0; head < 2; head ++) { bool mfm = track || head; desc_pc_sector sects[16]; - UINT8 sectdata[16*256]; + uint8_t sectdata[16*256]; io_generic_read(io, sectdata, 16*256*(track*2+head), 16*256); for(int i=0; i<16; i++) { int j = i/2 + (i & 1 ? 0 : 8); diff --git a/src/lib/formats/m20_dsk.h b/src/lib/formats/m20_dsk.h index 0ed3deda5ef..231728d6164 100644 --- a/src/lib/formats/m20_dsk.h +++ b/src/lib/formats/m20_dsk.h @@ -17,8 +17,8 @@ class m20_format : public floppy_image_format_t { public: m20_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; diff --git a/src/lib/formats/mbee_cas.cpp b/src/lib/formats/mbee_cas.cpp index 738bd4e4b31..24024f66f5d 100644 --- a/src/lib/formats/mbee_cas.cpp +++ b/src/lib/formats/mbee_cas.cpp @@ -69,7 +69,7 @@ TAP - has an ID header of TAP_DGOS_BEE or MBEE, null terminated. static int mbee_image_size; static bool mbee_speed; -static int mbee_put_samples(INT16 *buffer, int sample_pos, int count, int level) +static int mbee_put_samples(int16_t *buffer, int sample_pos, int count, int level) { if (buffer) { @@ -80,7 +80,7 @@ static int mbee_put_samples(INT16 *buffer, int sample_pos, int count, int level) return count; } -static int mbee_output_bit(INT16 *buffer, int sample_pos, bool bit) +static int mbee_output_bit(int16_t *buffer, int sample_pos, bool bit) { int samples = 0; if (mbee_speed) @@ -135,10 +135,10 @@ static int mbee_output_bit(INT16 *buffer, int sample_pos, bool bit) return samples; } -static int mbee_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) +static int mbee_output_byte(int16_t *buffer, int sample_pos, uint8_t byte) { int samples = 0; - UINT8 i; + uint8_t i; /* start */ samples += mbee_output_bit (buffer, sample_pos + samples, 0); @@ -154,14 +154,14 @@ static int mbee_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) return samples; } -static int mbee_handle_tap(INT16 *buffer, const UINT8 *bytes) +static int mbee_handle_tap(int16_t *buffer, const uint8_t *bytes) { - UINT32 sample_count = 0; - UINT32 byte_count = 0; - UINT32 i = 0; + uint32_t sample_count = 0; + uint32_t byte_count = 0; + uint32_t i = 0; bool temp_speed = 0; - UINT8 temp_blocks = 0; - UINT16 temp_size = 0; + uint8_t temp_blocks = 0; + uint16_t temp_size = 0; // TAP file starts with a null-terminate ID string. We just skip this. while (bytes[byte_count]) @@ -211,7 +211,7 @@ static int mbee_handle_tap(INT16 *buffer, const UINT8 *bytes) Generate samples for the tape image ********************************************************************/ -static int mbee_tap_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int mbee_tap_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { return mbee_handle_tap(buffer, bytes); } @@ -220,7 +220,7 @@ static int mbee_tap_fill_wave(INT16 *buffer, int length, UINT8 *bytes) Calculate the number of samples needed for this tape image ********************************************************************/ -static int mbee_tap_calculate_size_in_samples(const UINT8 *bytes, int length) +static int mbee_tap_calculate_size_in_samples(const uint8_t *bytes, int length) { mbee_image_size = length; diff --git a/src/lib/formats/mfi_dsk.cpp b/src/lib/formats/mfi_dsk.cpp index ea3eed8a29f..b6a8a18460a 100644 --- a/src/lib/formats/mfi_dsk.cpp +++ b/src/lib/formats/mfi_dsk.cpp @@ -94,7 +94,7 @@ bool mfi_format::supports_save() const return true; } -int mfi_format::identify(io_generic *io, UINT32 form_factor) +int mfi_format::identify(io_generic *io, uint32_t form_factor) { header h; @@ -108,7 +108,7 @@ int mfi_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool mfi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool mfi_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { header h; entry entries[84*2*4]; @@ -119,7 +119,7 @@ bool mfi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) image->set_variant(h.variant); - std::vector compressed; + std::vector compressed; entry *ent = entries; for(unsigned int cyl=0; cyl <= (h.cyl_count - 1) << 2; cyl += 4 >> resolution) @@ -138,16 +138,16 @@ bool mfi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) io_generic_read(io, &compressed[0], ent->offset, ent->compressed_size); unsigned int cell_count = ent->uncompressed_size/4; - std::vector &trackbuf = image->get_buffer(cyl >> 2, head, cyl & 3);; + std::vector &trackbuf = image->get_buffer(cyl >> 2, head, cyl & 3);; trackbuf.resize(cell_count); uLongf size = ent->uncompressed_size; if(uncompress((Bytef *)&trackbuf[0], &size, &compressed[0], ent->compressed_size) != Z_OK) return false; - UINT32 cur_time = 0; + uint32_t cur_time = 0; for(unsigned int i=0; i != cell_count; i++) { - UINT32 next_cur_time = cur_time + (trackbuf[i] & TIME_MASK); + uint32_t next_cur_time = cur_time + (trackbuf[i] & TIME_MASK); trackbuf[i] = (trackbuf[i] & MG_MASK) | cur_time; cur_time = next_cur_time; } @@ -187,12 +187,12 @@ bool mfi_format::save(io_generic *io, floppy_image *image) int pos = sizeof(header) + (tracks << resolution)*heads*sizeof(entry); int epos = 0; - auto precomp = global_alloc_array(UINT32, max_track_size); - auto postcomp = global_alloc_array(UINT8, max_track_size*4 + 1000); + auto precomp = global_alloc_array(uint32_t, max_track_size); + auto postcomp = global_alloc_array(uint8_t, max_track_size*4 + 1000); for(int track=0; track <= (tracks-1) << 2; track += 4 >> resolution) for(int head=0; head &buffer = image->get_buffer(track >> 2, head, track & 3); + std::vector &buffer = image->get_buffer(track >> 2, head, track & 3); int tsize = buffer.size(); if(!tsize) { epos++; diff --git a/src/lib/formats/mfi_dsk.h b/src/lib/formats/mfi_dsk.h index dfac913d4c1..e18920bd04d 100644 --- a/src/lib/formats/mfi_dsk.h +++ b/src/lib/formats/mfi_dsk.h @@ -10,8 +10,8 @@ class mfi_format : public floppy_image_format_t public: mfi_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; diff --git a/src/lib/formats/mfm_hd.cpp b/src/lib/formats/mfm_hd.cpp index 617ebf2b992..032be8622cb 100644 --- a/src/lib/formats/mfm_hd.cpp +++ b/src/lib/formats/mfm_hd.cpp @@ -139,7 +139,7 @@ void mfmhd_image_format_t::set_layout_params(mfmhd_layout_params param) /* Encode some value with data-type clock bits. */ -void mfmhd_image_format_t::mfm_encode(UINT16* trackimage, int& position, UINT8 byte, int count) +void mfmhd_image_format_t::mfm_encode(uint16_t* trackimage, int& position, uint8_t byte, int count) { mfm_encode_mask(trackimage, position, byte, count, 0x00); } @@ -147,7 +147,7 @@ void mfmhd_image_format_t::mfm_encode(UINT16* trackimage, int& position, UINT8 b /* Encode an A1 value with mark-type clock bits. */ -void mfmhd_image_format_t::mfm_encode_a1(UINT16* trackimage, int& position) +void mfmhd_image_format_t::mfm_encode_a1(uint16_t* trackimage, int& position) { m_current_crc = 0xffff; mfm_encode_mask(trackimage, position, 0xa1, 1, 0x04); @@ -157,11 +157,11 @@ void mfmhd_image_format_t::mfm_encode_a1(UINT16* trackimage, int& position) Encode a byte value with a given clock bit mask. Used by both mfm_encode and mfm_encode_a1 methods. */ -void mfmhd_image_format_t::mfm_encode_mask(UINT16* trackimage, int& position, UINT8 byte, int count, int mask) +void mfmhd_image_format_t::mfm_encode_mask(uint16_t* trackimage, int& position, uint8_t byte, int count, int mask) { - UINT16 encclock = 0; - UINT16 encdata = 0; - UINT8 thisbyte = byte; + uint16_t encclock = 0; + uint16_t encdata = 0; + uint8_t thisbyte = byte; bool mark = (mask != 0x00); m_current_crc = ccitt_crc16_one(m_current_crc, byte); @@ -226,7 +226,7 @@ void mfmhd_image_format_t::mfm_encode_mask(UINT16* trackimage, int& position, UI Clock bits and data bits are assumed to be interleaved (cdcdcdcdcdcdcdcd); the 8 data bits are returned. */ -UINT8 mfmhd_image_format_t::mfm_decode(UINT16 raw) +uint8_t mfmhd_image_format_t::mfm_decode(uint16_t raw) { unsigned int value = 0; @@ -243,7 +243,7 @@ UINT8 mfmhd_image_format_t::mfm_decode(UINT16 raw) /* For debugging. Outputs the byte array in a xxd-like way. */ -void mfmhd_image_format_t::showtrack(UINT16* enctrack, int length) +void mfmhd_image_format_t::showtrack(uint16_t* enctrack, int length) { for (int i=0; i < length; i+=16) { @@ -268,7 +268,7 @@ const mfmhd_format_type MFMHD_GEN_FORMAT = &mfmhd_image_format_creator length ) @@ -145,12 +145,12 @@ static int fill_wave(INT16 *buffer, int length, UINT8 *code) for (i = 0; i < 256; i++) count += fill_wave_0(buffer, count); - file_length = (int)(end - beg) / sizeof(INT16); + file_length = (int)(end - beg) / sizeof(int16_t); /* is there insufficient space for the FILEC ? */ if( count + file_length > length ) return -1; LOG(1,"mz700_fill_wave",("FILEC %d samples\n", file_length)); - memcpy(buffer + count, beg, file_length * sizeof(INT16)); + memcpy(buffer + count, beg, file_length * sizeof(int16_t)); count += file_length; /* is there insufficient space for the CHKF ? */ @@ -177,7 +177,7 @@ static int fill_wave(INT16 *buffer, int length, UINT8 *code) if( header == 1 && bytecount == 128 ) { int i, hdr_length; - INT16 *end = buffer; + int16_t *end = buffer; /* is there insufficient space for the CHKH ? */ if( count + 2 * BYTE_SAMPLES > length ) @@ -199,12 +199,12 @@ static int fill_wave(INT16 *buffer, int length, UINT8 *code) for (i = 0; i < 256; i++) count += fill_wave_0(buffer, count); - hdr_length = (int)(end - beg) / sizeof(INT16); + hdr_length = (int)(end - beg) / sizeof(int16_t); /* is there insufficient space for the HDRC ? */ if( count + hdr_length > length ) return -1; LOG(1,"mz700_fill_wave",("HDRC %d samples\n", hdr_length)); - memcpy(buffer + count, beg, hdr_length * sizeof(INT16)); + memcpy(buffer + count, beg, hdr_length * sizeof(int16_t)); count += hdr_length; /* is there insufficient space for CHKH ? */ diff --git a/src/lib/formats/naslite_dsk.cpp b/src/lib/formats/naslite_dsk.cpp index 342407a7c95..cea109c2dc2 100644 --- a/src/lib/formats/naslite_dsk.cpp +++ b/src/lib/formats/naslite_dsk.cpp @@ -39,7 +39,7 @@ const naslite_format::format naslite_format::formats[] = { {} }; -void naslite_format::build_sector_description(const format &f, UINT8 *sectdata, desc_s *sectors, int track, int head) const +void naslite_format::build_sector_description(const format &f, uint8_t *sectdata, desc_s *sectors, int track, int head) const { for(int i=0; i stream; + std::vector stream; int sector_size = 128; for(int i=0; i<6250; i++) { if(t[i] == 0xc2 && t[i+1] == 0xc2 && t[i+2] == 0xc2) { diff --git a/src/lib/formats/oric_dsk.h b/src/lib/formats/oric_dsk.h index 3eeb719eed0..23125546931 100644 --- a/src/lib/formats/oric_dsk.h +++ b/src/lib/formats/oric_dsk.h @@ -17,8 +17,8 @@ class oric_dsk_format : public floppy_image_format_t { public: oric_dsk_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; diff --git a/src/lib/formats/oric_tap.cpp b/src/lib/formats/oric_tap.cpp index 5c24d40f47e..c9f84dc7c2a 100644 --- a/src/lib/formats/oric_tap.cpp +++ b/src/lib/formats/oric_tap.cpp @@ -51,7 +51,7 @@ static oric_t oric; /* 8 periods at 2400Hz */ /* hi,lo, hi,lo, hi,lo, hi,lo */ -static INT16 *oric_emit_level(INT16 *p, int count, INT16 wave_state) +static int16_t *oric_emit_level(int16_t *p, int count, int16_t wave_state) { int i; @@ -63,7 +63,7 @@ static INT16 *oric_emit_level(INT16 *p, int count, INT16 wave_state) } /* 4 periods at 1200Hz */ -static INT16* oric_output_bit(INT16 *p, UINT8 b) +static int16_t* oric_output_bit(int16_t *p, uint8_t b) { p = oric_emit_level(p, 1, WAVEENTRY_HIGH); p = oric_emit_level(p, b ? 1 : 2, WAVEENTRY_LOW); @@ -71,7 +71,7 @@ static INT16* oric_output_bit(INT16 *p, UINT8 b) return p; } -static int oric_get_bit_size_in_samples(UINT8 b) +static int oric_get_bit_size_in_samples(uint8_t b) { int count; @@ -119,12 +119,12 @@ static int oric_get_bit_size_in_samples(UINT8 b) 1 * ? -> ??? */ -static int oric_calculate_byte_size_in_samples(UINT8 byte) +static int oric_calculate_byte_size_in_samples(uint8_t byte) { int count; int i; - UINT8 parity; - UINT8 data; + uint8_t parity; + uint8_t data; count = 0; @@ -139,7 +139,7 @@ static int oric_calculate_byte_size_in_samples(UINT8 byte) data = byte; for (i=0; i<8; i++) { - UINT8 data_bit; + uint8_t data_bit; data_bit = data & 0x01; @@ -162,11 +162,11 @@ static int oric_calculate_byte_size_in_samples(UINT8 byte) } -static INT16 *oric_output_byte(INT16 *p, UINT8 byte) +static int16_t *oric_output_byte(int16_t *p, uint8_t byte) { int i; - UINT8 parity; - UINT8 data; + uint8_t parity; + uint8_t data; /* start bit */ p = oric_output_bit(p, 0); @@ -178,7 +178,7 @@ static INT16 *oric_output_byte(INT16 *p, UINT8 byte) data = byte; for (i=0; i<8; i++) { - UINT8 data_bit; + uint8_t data_bit; data_bit = data & 0x01; @@ -200,7 +200,7 @@ static INT16 *oric_output_byte(INT16 *p, UINT8 byte) return p; } -static INT16 *oric_fill_pause(INT16 *p, int sample_count) +static int16_t *oric_fill_pause(int16_t *p, int sample_count) { int i; @@ -218,14 +218,14 @@ static int oric_seconds_to_samples(float seconds) } /* length is length of .tap file! */ -static int oric_cassette_calculate_size_in_samples(const UINT8 *bytes, int length) +static int oric_cassette_calculate_size_in_samples(const uint8_t *bytes, int length) { unsigned char header[9]; int count; - const UINT8 *data_ptr; + const uint8_t *data_ptr; int i; - UINT8 data; + uint8_t data; oric.tap_size = length; @@ -302,7 +302,7 @@ static int oric_cassette_calculate_size_in_samples(const UINT8 *bytes, int lengt /* got end of filename? */ if (data==0) { - UINT16 end, start; + uint16_t end, start; LOG_FORMATS("got end of filename\n"); /* 100 1 bits to separate header from data */ @@ -343,13 +343,13 @@ static int oric_cassette_calculate_size_in_samples(const UINT8 *bytes, int lengt } /* length is length of sample buffer to fill! */ -static int oric_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int oric_cassette_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { unsigned char header[9]; - UINT8 *data_ptr; - INT16 *p; + uint8_t *data_ptr; + int16_t *p; int i; - UINT8 data; + uint8_t data; p = buffer; @@ -438,7 +438,7 @@ static int oric_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) /* got end of filename? */ if (data==0) { - UINT16 end, start; + uint16_t end, start; LOG_FORMATS("got end of filename\n"); /* oric includes a small delay, but I don't see diff --git a/src/lib/formats/p6001_cas.cpp b/src/lib/formats/p6001_cas.cpp index bcaf97d94ba..37e1ffcfa2c 100644 --- a/src/lib/formats/p6001_cas.cpp +++ b/src/lib/formats/p6001_cas.cpp @@ -13,7 +13,7 @@ static int cas_size; -static int pc6001_fill_wave(INT16* buffer, UINT8 data, int sample_pos) +static int pc6001_fill_wave(int16_t* buffer, uint8_t data, int sample_pos) { int x; int sample_count = 0; @@ -29,7 +29,7 @@ static int pc6001_fill_wave(INT16* buffer, UINT8 data, int sample_pos) return sample_count; } -static int pc6001_handle_cas(INT16* buffer, const UINT8* casdata) +static int pc6001_handle_cas(int16_t* buffer, const uint8_t* casdata) { int sample_count = 0; int data_pos = 0; @@ -46,7 +46,7 @@ static int pc6001_handle_cas(INT16* buffer, const UINT8* casdata) /******************************************************************* Calculate the number of samples needed for this tape image ********************************************************************/ -static int pc6001_cas_to_wav_size (const UINT8 *casdata, int caslen) +static int pc6001_cas_to_wav_size (const uint8_t *casdata, int caslen) { cas_size = caslen*8; @@ -56,7 +56,7 @@ static int pc6001_cas_to_wav_size (const UINT8 *casdata, int caslen) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int pc6001_cas_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int pc6001_cas_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return pc6001_handle_cas(buffer,bytes); } diff --git a/src/lib/formats/pasti_dsk.cpp b/src/lib/formats/pasti_dsk.cpp index 9ddce45138a..3bf5fa7a243 100644 --- a/src/lib/formats/pasti_dsk.cpp +++ b/src/lib/formats/pasti_dsk.cpp @@ -37,9 +37,9 @@ bool pasti_format::supports_save() const return false; } -int pasti_format::identify(io_generic *io, UINT32 form_factor) +int pasti_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 h[16]; + uint8_t h[16]; io_generic_read(io, h, 0, 16); if(!memcmp(h, "RSY\0\3\0", 6) && @@ -49,7 +49,7 @@ int pasti_format::identify(io_generic *io, UINT32 form_factor) return 0; } -static void hexdump(const UINT8 *d, int s) +static void hexdump(const uint8_t *d, int s) { for(int i=0; i raw_track; + std::vector raw_track; int tracks = fh[10]; int heads = 1+(tracks >= 160); @@ -76,7 +76,7 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) for(int track=0; track < tracks; track++) { for(int head=0; head < heads; head++) { - UINT8 th[16]; + uint8_t th[16]; io_generic_read(io, th, pos, 16); int entry_len = th[0] | (th[1] << 8) | (th[2] << 16) | (th[3] << 24); int fuzz_len = th[4] | (th[5] << 8) | (th[6] << 16) | (th[7] << 24); @@ -90,9 +90,9 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) io_generic_read(io, &raw_track[0], pos+16, entry_len-16); - UINT8 *fuzz = fuzz_len ? &raw_track[16*sect] : nullptr; - UINT8 *bdata = fuzz ? fuzz+fuzz_len : &raw_track[16*sect]; - UINT8 *tdata = bdata; + uint8_t *fuzz = fuzz_len ? &raw_track[16*sect] : nullptr; + uint8_t *bdata = fuzz ? fuzz+fuzz_len : &raw_track[16*sect]; + uint8_t *tdata = bdata; int syncpos = -1; if(flags & 0x0080) { @@ -126,7 +126,7 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) } for(int s=0; s &track, const wd_obs &obs, int tstart, int tend, UINT32 cell_size) +void pasti_format::wd_generate_unsynced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, uint32_t cell_size) { for(int i=tstart; i != tend;) { unsigned char v = obs.track_data[i]; @@ -196,7 +196,7 @@ void pasti_format::wd_generate_unsynced_gap(std::vector &track, const wd } } -void pasti_format::wd_generate_synced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, UINT32 cell_size) +void pasti_format::wd_generate_synced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, uint32_t cell_size) { for(int i = tstart; i != tend; i++) { unsigned char v = obs.track_data[i]; @@ -214,7 +214,7 @@ void pasti_format::wd_generate_synced_gap(std::vector &track, const wd_o } } -void pasti_format::wd_generate_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, bool synced, UINT32 cell_size_start, UINT32 cell_size_end) +void pasti_format::wd_generate_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, bool synced, uint32_t cell_size_start, uint32_t cell_size_end) { unsigned int spos = track.size(); if(!synced) { @@ -231,10 +231,10 @@ void pasti_format::wd_generate_gap(std::vector &track, const wd_obs &obs wd_generate_synced_gap(track, obs, tstart, tend, cell_size_start); if(cell_size_end != cell_size_start) { - INT32 total_size = 0; + int32_t total_size = 0; for(unsigned int i=spos; i != track.size(); i++) total_size += track[i] & floppy_image::TIME_MASK; - INT64 cur_size = 0; + int64_t cur_size = 0; for(unsigned int i=spos; i != track.size(); i++) { cur_size += track[i] & floppy_image::TIME_MASK; track[i] = (track[i] & floppy_image::MG_MASK) | @@ -243,7 +243,7 @@ void pasti_format::wd_generate_gap(std::vector &track, const wd_obs &obs } } -void pasti_format::wd_generate_sector_header(std::vector &track, const wd_obs &obs, int sector, int tstart, UINT32 cell_size) +void pasti_format::wd_generate_sector_header(std::vector &track, const wd_obs &obs, int sector, int tstart, uint32_t cell_size) { raw_w(track, 16, 0x4489, cell_size); raw_w(track, 16, 0x4489, cell_size); @@ -253,7 +253,7 @@ void pasti_format::wd_generate_sector_header(std::vector &track, const w mfm_w(track, 8, obs.sectors[sector].id[i], cell_size); } -void pasti_format::wd_generate_sector_data(std::vector &track, const wd_obs &obs, int sector, int tstart, UINT32 cell_size) +void pasti_format::wd_generate_sector_data(std::vector &track, const wd_obs &obs, int sector, int tstart, uint32_t cell_size) { const wd_sect &s = obs.sectors[sector]; raw_w(track, 16, 0x4489, cell_size); @@ -262,7 +262,7 @@ void pasti_format::wd_generate_sector_data(std::vector &track, const wd_ mfm_w(track, 8, obs.track_data[tstart+3], cell_size); for(int i=0; i<128 << (s.id[3] & 3); i++) mfm_w(track, 8, s.data[i], cell_size); - UINT16 crc = calc_crc_ccitt(track, track.size() - (2048 << (s.id[3] & 3)) - 16*4, track.size()); + uint16_t crc = calc_crc_ccitt(track, track.size() - (2048 << (s.id[3] & 3)) - 16*4, track.size()); mfm_w(track, 8, crc >> 8, cell_size); mfm_w(track, 8, crc, cell_size); } @@ -271,7 +271,7 @@ void pasti_format::wd_generate_track_from_sectors_and_track(int track, int head, { if(0) printf("Track %d head %d sectors %d\n", track, head, obs.sector_count); - std::vector trackbuf; + std::vector trackbuf; wd_sect_info sect_infos[256]; @@ -306,7 +306,7 @@ void pasti_format::wd_generate_track_from_sectors_and_track(int track, int head, return; } - UINT32 cell_size = UINT32(obs.sectors[0].time_ratio * 1000+0.5); + uint32_t cell_size = uint32_t(obs.sectors[0].time_ratio * 1000+0.5); wd_generate_gap(trackbuf, obs, 0, sect_infos[0].hstart, false, cell_size, cell_size); for(int i=0; i != obs.sector_count; i++) { @@ -318,7 +318,7 @@ void pasti_format::wd_generate_track_from_sectors_and_track(int track, int head, } } - UINT32 ncell_size = UINT32(obs.sectors[i+1 != obs.sector_count ? i+1 : 0].time_ratio * 1000+0.5); + uint32_t ncell_size = uint32_t(obs.sectors[i+1 != obs.sector_count ? i+1 : 0].time_ratio * 1000+0.5); wd_generate_sector_header(trackbuf, obs, i, s->hstart, cell_size); @@ -361,7 +361,7 @@ void pasti_format::wd_generate_track_from_sectors_only(int track, int head, flop } } - std::vector tdata; + std::vector tdata; for(int i=0; i != obs.sector_count; i++) { const wd_sect &s = obs.sectors[i]; if(i+1 != obs.sector_count && obs.sectors[i+1].position < s.position+10+44+4+(128 << (s.id[3] & 3))) { @@ -407,7 +407,7 @@ void pasti_format::wd_generate_track_from_sectors_only(int track, int head, flop mfm_w(tdata, 8, 0xfb); for(int j=0; j<128 << (s.id[3] & 3); j++) mfm_w(tdata, 8, s.data[j]); - UINT16 crc = calc_crc_ccitt(tdata, tdata.size() - (2048 << (s.id[3] & 3)) - 16*4, tdata.size()); + uint16_t crc = calc_crc_ccitt(tdata, tdata.size() - (2048 << (s.id[3] & 3)) - 16*4, tdata.size()); mfm_w(tdata, 8, crc >> 8); mfm_w(tdata, 8, crc); } @@ -419,9 +419,9 @@ void pasti_format::wd_generate_track_from_sectors_only(int track, int head, flop generate_track_from_levels(track, head, tdata, 0, image); } -UINT16 pasti_format::byte_to_mfm(UINT8 data, bool context) +uint16_t pasti_format::byte_to_mfm(uint8_t data, bool context) { - static const UINT8 expand[32] = { + static const uint8_t expand[32] = { 0xaa, 0xa9, 0xa4, 0xa5, 0x92, 0x91, 0x94, 0x95, 0x4a, 0x49, 0x44, 0x45, 0x52, 0x51, 0x54, 0x55, 0x2a, 0x29, 0x24, 0x25, 0x12, 0x11, 0x14, 0x15, 0x4a, 0x49, 0x44, 0x45, 0x52, 0x51, 0x54, 0x55, }; @@ -429,15 +429,15 @@ UINT16 pasti_format::byte_to_mfm(UINT8 data, bool context) return (expand[(data >> 4) | (context ? 16 : 0)] << 8) | expand[data & 0x1f]; } -void pasti_format::match_mfm_data(wd_obs &obs, int tpos, const UINT8 *data, int size, UINT8 context, int &bcount, int &tend, bool &synced) +void pasti_format::match_mfm_data(wd_obs &obs, int tpos, const uint8_t *data, int size, uint8_t context, int &bcount, int &tend, bool &synced) { - UINT16 shift = byte_to_mfm(context, true); + uint16_t shift = byte_to_mfm(context, true); int bc = 0; int bc_phase = 0; int bi = 0; - UINT8 dbyte = 0; + uint8_t dbyte = 0; bool ds_phase = false; - UINT16 inshift = byte_to_mfm(data[bi++], shift & 1); + uint16_t inshift = byte_to_mfm(data[bi++], shift & 1); synced = false; for(;;) { int bit = (inshift >> (15-bc)) & 1; @@ -474,7 +474,7 @@ void pasti_format::match_mfm_data(wd_obs &obs, int tpos, const UINT8 *data, int } } -void pasti_format::match_raw_data(wd_obs &obs, int tpos, const UINT8 *data, int size, UINT8 context, int &bcount, int &tend) +void pasti_format::match_raw_data(wd_obs &obs, int tpos, const uint8_t *data, int size, uint8_t context, int &bcount, int &tend) { tend = tpos; for(bcount=0; bcount != size; bcount++) { @@ -486,9 +486,9 @@ void pasti_format::match_raw_data(wd_obs &obs, int tpos, const UINT8 *data, int } } -UINT16 pasti_format::calc_crc(const UINT8 *data, int size, UINT16 crc1) +uint16_t pasti_format::calc_crc(const uint8_t *data, int size, uint16_t crc1) { - UINT32 crc = crc1; + uint32_t crc = crc1; for(int i=0; i> 8) && tdata[(tend+1) % tsize] == (crc & 0xff)) { tend = (tend+2) % tsize; bcount += 2; diff --git a/src/lib/formats/pasti_dsk.h b/src/lib/formats/pasti_dsk.h index fe724fb1fb5..f1fc1a75aaa 100644 --- a/src/lib/formats/pasti_dsk.h +++ b/src/lib/formats/pasti_dsk.h @@ -10,8 +10,8 @@ class pasti_format : public floppy_image_format_t public: pasti_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual const char *name() const override; virtual const char *description() const override; @@ -22,15 +22,15 @@ public: protected: struct wd_sect { - const UINT8 *data; - const UINT8 *fuzzy_mask; - UINT8 id[6]; + const uint8_t *data; + const uint8_t *fuzzy_mask; + uint8_t id[6]; int position; double time_ratio; }; struct wd_obs { - const UINT8 *track_data; + const uint8_t *track_data; wd_sect sectors[256]; int track_size, sector_count; }; @@ -45,16 +45,16 @@ private: }; void map_sectors_in_track(wd_obs &obs, wd_sect_info *sect_infos); - void match_mfm_data(wd_obs &obs, int tpos, const UINT8 *data, int size, UINT8 context, int &bcount, int &ccount, bool &synced); - void match_raw_data(wd_obs &obs, int tpos, const UINT8 *data, int size, UINT8 context, int &bcount, int &ccount); - UINT16 byte_to_mfm(UINT8 data, bool context); - UINT16 calc_crc(const UINT8 *data, int size, UINT16 crc); + void match_mfm_data(wd_obs &obs, int tpos, const uint8_t *data, int size, uint8_t context, int &bcount, int &ccount, bool &synced); + void match_raw_data(wd_obs &obs, int tpos, const uint8_t *data, int size, uint8_t context, int &bcount, int &ccount); + uint16_t byte_to_mfm(uint8_t data, bool context); + uint16_t calc_crc(const uint8_t *data, int size, uint16_t crc); - void wd_generate_unsynced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, UINT32 cell_size); - void wd_generate_synced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, UINT32 cell_size); - void wd_generate_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, bool synced, UINT32 cell_size_start, UINT32 cell_size_end); - void wd_generate_sector_header(std::vector &track, const wd_obs &obs, int sector, int tstart, UINT32 cell_size); - void wd_generate_sector_data(std::vector &track, const wd_obs &obs, int sector, int tstart, UINT32 cell_size); + void wd_generate_unsynced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, uint32_t cell_size); + void wd_generate_synced_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, uint32_t cell_size); + void wd_generate_gap(std::vector &track, const wd_obs &obs, int tstart, int tend, bool synced, uint32_t cell_size_start, uint32_t cell_size_end); + void wd_generate_sector_header(std::vector &track, const wd_obs &obs, int sector, int tstart, uint32_t cell_size); + void wd_generate_sector_data(std::vector &track, const wd_obs &obs, int sector, int tstart, uint32_t cell_size); void wd_generate_track_from_sectors_and_track(int track, int head, floppy_image *image, wd_obs &obs); void wd_generate_track_from_sectors_only(int track, int head, floppy_image *image, wd_obs &obs); }; diff --git a/src/lib/formats/pc98fdi_dsk.cpp b/src/lib/formats/pc98fdi_dsk.cpp index c4c21d937f6..5b37b1ede37 100644 --- a/src/lib/formats/pc98fdi_dsk.cpp +++ b/src/lib/formats/pc98fdi_dsk.cpp @@ -30,35 +30,35 @@ const char *pc98fdi_format::extensions() const return "fdi"; } -int pc98fdi_format::identify(io_generic *io, UINT32 form_factor) +int pc98fdi_format::identify(io_generic *io, uint32_t form_factor) { - UINT64 size = io_generic_size(io); - UINT8 h[32]; + uint64_t size = io_generic_size(io); + uint8_t h[32]; io_generic_read(io, h, 0, 32); - UINT32 hsize = little_endianize_int32(*(UINT32 *) (h + 0x8)); - UINT32 psize = little_endianize_int32(*(UINT32 *) (h + 0xc)); - UINT32 ssize = little_endianize_int32(*(UINT32 *) (h + 0x10)); - UINT32 scnt = little_endianize_int32(*(UINT32 *) (h + 0x14)); - UINT32 sides = little_endianize_int32(*(UINT32 *) (h + 0x18)); - UINT32 ntrk = little_endianize_int32(*(UINT32 *) (h + 0x1c)); + uint32_t hsize = little_endianize_int32(*(uint32_t *) (h + 0x8)); + uint32_t psize = little_endianize_int32(*(uint32_t *) (h + 0xc)); + uint32_t ssize = little_endianize_int32(*(uint32_t *) (h + 0x10)); + uint32_t scnt = little_endianize_int32(*(uint32_t *) (h + 0x14)); + uint32_t sides = little_endianize_int32(*(uint32_t *) (h + 0x18)); + uint32_t ntrk = little_endianize_int32(*(uint32_t *) (h + 0x1c)); if(size == hsize + psize && psize == ssize*scnt*sides*ntrk) return 100; return 0; } -bool pc98fdi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool pc98fdi_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT8 h[32]; + uint8_t h[32]; io_generic_read(io, h, 0, 32); - UINT32 hsize = little_endianize_int32(*(UINT32 *)(h+0x8)); - UINT32 sector_size = little_endianize_int32(*(UINT32 *)(h+0x10)); - UINT32 sector_count = little_endianize_int32(*(UINT32 *)(h+0x14)); - UINT32 head_count = little_endianize_int32(*(UINT32 *)(h+0x18)); - UINT32 track_count = little_endianize_int32(*(UINT32 *)(h+0x1c)); + uint32_t hsize = little_endianize_int32(*(uint32_t *)(h+0x8)); + uint32_t sector_size = little_endianize_int32(*(uint32_t *)(h+0x10)); + uint32_t sector_count = little_endianize_int32(*(uint32_t *)(h+0x14)); + uint32_t head_count = little_endianize_int32(*(uint32_t *)(h+0x18)); + uint32_t track_count = little_endianize_int32(*(uint32_t *)(h+0x1c)); int cell_count = form_factor == floppy_image::FF_35 ? 200000 : 166666; @@ -66,7 +66,7 @@ bool pc98fdi_format::load(io_generic *io, UINT32 form_factor, floppy_image *imag for(ssize=0; (128 << ssize) < sector_size; ssize++) {}; desc_pc_sector sects[256]; - UINT8 sect_data[65536]; + uint8_t sect_data[65536]; for(int track=0; track < track_count; track++) for(int head=0; head < head_count; head++) { diff --git a/src/lib/formats/pc98fdi_dsk.h b/src/lib/formats/pc98fdi_dsk.h index 05fd1ccc361..46503c81d9c 100644 --- a/src/lib/formats/pc98fdi_dsk.h +++ b/src/lib/formats/pc98fdi_dsk.h @@ -19,8 +19,8 @@ class pc98fdi_format : public floppy_image_format_t public: pc98fdi_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual const char *name() const override; virtual const char *description() const override; diff --git a/src/lib/formats/pc_dsk.cpp b/src/lib/formats/pc_dsk.cpp index a2e597294f0..73ef727cdaf 100644 --- a/src/lib/formats/pc_dsk.cpp +++ b/src/lib/formats/pc_dsk.cpp @@ -16,7 +16,7 @@ struct pc_disk_sizes { - UINT32 image_size; + uint32_t image_size; int sectors; int heads; }; @@ -43,7 +43,7 @@ static const struct pc_disk_sizes disk_sizes[] = static floperr_t pc_dsk_compute_geometry(floppy_image_legacy *floppy, struct basicdsk_geometry *geometry) { int i; - UINT64 size; + uint64_t size; memset(geometry, 0, sizeof(*geometry)); size = floppy_image_size(floppy); @@ -67,12 +67,12 @@ static floperr_t pc_dsk_compute_geometry(floppy_image_legacy *floppy, struct bas * get info from boot sector. * not correct on all disks */ - UINT8 scl, spt, heads; + uint8_t scl, spt, heads; floppy_image_read(floppy, &scl, 0x0c, 1); floppy_image_read(floppy, &spt, 0x18, 1); floppy_image_read(floppy, &heads, 0x1A, 1); - if (size == ((UINT64) scl) * spt * heads * 0x200) + if (size == ((uint64_t) scl) * spt * heads * 0x200) { geometry->sectors = spt; geometry->heads = heads; diff --git a/src/lib/formats/phc25_cas.cpp b/src/lib/formats/phc25_cas.cpp index 16a38120441..2cc9ea013e6 100644 --- a/src/lib/formats/phc25_cas.cpp +++ b/src/lib/formats/phc25_cas.cpp @@ -42,7 +42,7 @@ enough to make it work. // image size static int phc25_image_size; -static int phc25_put_samples(INT16 *buffer, int sample_pos, int count, int level) +static int phc25_put_samples(int16_t *buffer, int sample_pos, int count, int level) { if (buffer) { @@ -53,7 +53,7 @@ static int phc25_put_samples(INT16 *buffer, int sample_pos, int count, int level return count; } -static int phc25_output_bit(INT16 *buffer, int sample_pos, bool bit) +static int phc25_output_bit(int16_t *buffer, int sample_pos, bool bit) { int samples = 0; @@ -73,10 +73,10 @@ static int phc25_output_bit(INT16 *buffer, int sample_pos, bool bit) return samples; } -static int phc25_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) +static int phc25_output_byte(int16_t *buffer, int sample_pos, uint8_t byte) { int samples = 0; - UINT8 i; + uint8_t i; /* start */ samples += phc25_output_bit (buffer, sample_pos + samples, 0); @@ -92,11 +92,11 @@ static int phc25_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) return samples; } -static int phc25_handle_cassette(INT16 *buffer, const UINT8 *bytes) +static int phc25_handle_cassette(int16_t *buffer, const uint8_t *bytes) { - UINT32 sample_count = 0; - UINT32 byte_count = 0; - UINT32 i; + uint32_t sample_count = 0; + uint32_t byte_count = 0; + uint32_t i; // silence // sample_count += phc25_put_samples(buffer, 6640, 2, WAVEENTRY_HIGH); @@ -131,7 +131,7 @@ static int phc25_handle_cassette(INT16 *buffer, const UINT8 *bytes) Generate samples for the tape image ********************************************************************/ -static int phc25_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int phc25_cassette_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { return phc25_handle_cassette(buffer, bytes); } @@ -140,7 +140,7 @@ static int phc25_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) Calculate the number of samples needed for this tape image ********************************************************************/ -static int phc25_cassette_calculate_size_in_samples(const UINT8 *bytes, int length) +static int phc25_cassette_calculate_size_in_samples(const uint8_t *bytes, int length) { phc25_image_size = length; diff --git a/src/lib/formats/pmd_cas.cpp b/src/lib/formats/pmd_cas.cpp index 516f8cf867b..79e8820b4bb 100644 --- a/src/lib/formats/pmd_cas.cpp +++ b/src/lib/formats/pmd_cas.cpp @@ -28,7 +28,7 @@ // image size static int pmd85_image_size; -static int pmd85_emit_level(INT16 *buffer, int sample_pos, int count, int level) +static int pmd85_emit_level(int16_t *buffer, int sample_pos, int count, int level) { if (buffer) { @@ -39,7 +39,7 @@ static int pmd85_emit_level(INT16 *buffer, int sample_pos, int count, int level) return count; } -static int pmd85_output_bit(INT16 *buffer, int sample_pos, UINT8 bit) +static int pmd85_output_bit(int16_t *buffer, int sample_pos, uint8_t bit) { int samples = 0; @@ -57,7 +57,7 @@ static int pmd85_output_bit(INT16 *buffer, int sample_pos, UINT8 bit) return samples; } -static int pmd85_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) +static int pmd85_output_byte(int16_t *buffer, int sample_pos, uint8_t byte) { int samples = 0; @@ -75,7 +75,7 @@ static int pmd85_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) return samples; } -static bool pmd85_is_header_block(const UINT8 *bytes) +static bool pmd85_is_header_block(const uint8_t *bytes) { for (int i=0; i<0x10; i++) { @@ -86,12 +86,12 @@ static bool pmd85_is_header_block(const UINT8 *bytes) return true; } -static void pmd85_printf_image_info(const UINT8 *bytes, int sample_count) +static void pmd85_printf_image_info(const uint8_t *bytes, int sample_count) { #if 0 char track_name[9]; - UINT32 sec = (UINT32)(sample_count/PMD85_WAV_FREQUENCY); - UINT16 addr = (bytes[0x33]<<8) | bytes[0x32]; + uint32_t sec = (uint32_t)(sample_count/PMD85_WAV_FREQUENCY); + uint16_t addr = (bytes[0x33]<<8) | bytes[0x32]; strncpy(track_name, (char*)&bytes[0x36], 8); track_name[8] = '\0'; @@ -99,7 +99,7 @@ static void pmd85_printf_image_info(const UINT8 *bytes, int sample_count) #endif } -static int pmd85_handle_cassette(INT16 *buffer, const UINT8 *bytes) +static int pmd85_handle_cassette(int16_t *buffer, const uint8_t *bytes) { int sample_count = 0; @@ -137,7 +137,7 @@ static int pmd85_handle_cassette(INT16 *buffer, const UINT8 *bytes) int data_pos = 0; while (data_pos < pmd85_image_size) { - UINT16 block_size = (bytes[data_pos + 1]<<8) | bytes[data_pos]; + uint16_t block_size = (bytes[data_pos + 1]<<8) | bytes[data_pos]; int pause_len = PMD85_PAUSE_BITS; data_pos += 2; @@ -168,7 +168,7 @@ static int pmd85_handle_cassette(INT16 *buffer, const UINT8 *bytes) Generate samples for the tape image ********************************************************************/ -static int pmd85_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int pmd85_cassette_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { return pmd85_handle_cassette(buffer, bytes); } @@ -177,7 +177,7 @@ static int pmd85_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) Calculate the number of samples needed for this tape image ********************************************************************/ -static int pmd85_cassette_calculate_size_in_samples(const UINT8 *bytes, int length) +static int pmd85_cassette_calculate_size_in_samples(const uint8_t *bytes, int length) { pmd85_image_size = length; diff --git a/src/lib/formats/primoptp.cpp b/src/lib/formats/primoptp.cpp index b3c1875ffb1..5c6779b6613 100644 --- a/src/lib/formats/primoptp.cpp +++ b/src/lib/formats/primoptp.cpp @@ -26,9 +26,9 @@ #define PRIMO_FILE_PILOT_LENGTH ((4*PRIMO_BIT_1_LENGTH + 4*PRIMO_BIT_0_LENGTH)*512) #define PRIMO_BLOCK_PILOT_LENGTH ((8*PRIMO_BIT_1_LENGTH)*96 + (5*PRIMO_BIT_1_LENGTH + 3*PRIMO_BIT_0_LENGTH)*3) -static UINT32 primo_tape_image_length; +static uint32_t primo_tape_image_length; -static INT16 *primo_emit_level(INT16 *p, int count, int level) +static int16_t *primo_emit_level(int16_t *p, int count, int level) { int i; @@ -37,7 +37,7 @@ static INT16 *primo_emit_level(INT16 *p, int count, int level) return p; } -static INT16* primo_output_bit(INT16 *p, UINT8 bit) +static int16_t* primo_output_bit(int16_t *p, uint8_t bit) { if (bit) { @@ -52,7 +52,7 @@ static INT16* primo_output_bit(INT16 *p, UINT8 bit) return p; } -static INT16* primo_output_byte(INT16 *p, UINT8 byte) +static int16_t* primo_output_byte(int16_t *p, uint8_t byte) { int i; @@ -62,11 +62,11 @@ static INT16* primo_output_byte(INT16 *p, UINT8 byte) return p; } -static UINT32 primo_cassette_calculate_number_of_1(const UINT8 *bytes, UINT16 length) +static uint32_t primo_cassette_calculate_number_of_1(const uint8_t *bytes, uint16_t length) { int i,j; - UINT32 number_of_1 = 0; + uint32_t number_of_1 = 0; for (i=0; i=0; i--) @@ -59,29 +59,29 @@ static INT16* rk_output_byte(INT16 *p, UINT8 byte,int bitsize) } -static int rk20_cas_to_wav_size( const UINT8 *casdata, int caslen ) { +static int rk20_cas_to_wav_size( const uint8_t *casdata, int caslen ) { data_size = caslen; return (RK_HEADER_LEN * 8 * 2 + 8*2 + caslen * 8 * 2) * RK_SIZE_20; } -static int rk22_cas_to_wav_size( const UINT8 *casdata, int caslen ) { +static int rk22_cas_to_wav_size( const uint8_t *casdata, int caslen ) { data_size = caslen; return (RK_HEADER_LEN * 8 * 2 + 8*2 + caslen * 8 * 2) * RK_SIZE_22; } -static int rk60_cas_to_wav_size( const UINT8 *casdata, int caslen ) { +static int rk60_cas_to_wav_size( const uint8_t *casdata, int caslen ) { data_size = caslen; return (RK_HEADER_LEN * 8 * 2 + 8*2 + caslen * 8 * 2) * RK_SIZE_60; } -static int gam_cas_to_wav_size( const UINT8 *casdata, int caslen ) { +static int gam_cas_to_wav_size( const uint8_t *casdata, int caslen ) { data_size = caslen; return (RK_HEADER_LEN * 8 * 2 + caslen * 8 * 2) * RK_SIZE_20; } -static int rk20_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) { +static int rk20_cas_fill_wave( int16_t *buffer, int length, uint8_t *bytes ) { int i; - INT16 * p = buffer; + int16_t * p = buffer; for (i=0; i= sol20_image_size) sol20_byte_num = 0; else @@ -340,7 +340,7 @@ static int sol20_handle_cassette(INT16 *buffer, const UINT8 *bytes) Generate samples for the tape image ********************************************************************/ -static int sol20_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int sol20_cassette_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { return sol20_handle_cassette(buffer, bytes); } @@ -349,7 +349,7 @@ static int sol20_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) Calculate the number of samples needed for this tape image ********************************************************************/ -static int sol20_cassette_calculate_size_in_samples(const UINT8 *bytes, int length) +static int sol20_cassette_calculate_size_in_samples(const uint8_t *bytes, int length) { sol20_image_size = length; diff --git a/src/lib/formats/sorc_cas.cpp b/src/lib/formats/sorc_cas.cpp index da31aaa6e49..10fb26197f1 100644 --- a/src/lib/formats/sorc_cas.cpp +++ b/src/lib/formats/sorc_cas.cpp @@ -38,7 +38,7 @@ header and leader bytes. static int sorcerer_image_size; static bool level; -static int sorcerer_put_samples(INT16 *buffer, int sample_pos, int count) +static int sorcerer_put_samples(int16_t *buffer, int sample_pos, int count) { if (buffer) { @@ -51,7 +51,7 @@ static int sorcerer_put_samples(INT16 *buffer, int sample_pos, int count) return count; } -static int sorcerer_output_bit(INT16 *buffer, int sample_pos, bool bit) +static int sorcerer_output_bit(int16_t *buffer, int sample_pos, bool bit) { int samples = 0; @@ -68,10 +68,10 @@ static int sorcerer_output_bit(INT16 *buffer, int sample_pos, bool bit) return samples; } -static int sorcerer_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) +static int sorcerer_output_byte(int16_t *buffer, int sample_pos, uint8_t byte) { int samples = 0; - UINT8 i; + uint8_t i; /* start */ samples += sorcerer_output_bit (buffer, sample_pos + samples, 0); @@ -87,10 +87,10 @@ static int sorcerer_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) return samples; } -static int sorcerer_handle_cassette(INT16 *buffer, const UINT8 *bytes) +static int sorcerer_handle_cassette(int16_t *buffer, const uint8_t *bytes) { - UINT32 sample_count = 0; - UINT32 i; + uint32_t sample_count = 0; + uint32_t i; /* idle */ for (i=0; i<2000; i++) @@ -108,7 +108,7 @@ static int sorcerer_handle_cassette(INT16 *buffer, const UINT8 *bytes) Generate samples for the tape image ********************************************************************/ -static int sorcerer_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int sorcerer_cassette_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { return sorcerer_handle_cassette(buffer, bytes); } @@ -117,7 +117,7 @@ static int sorcerer_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) Calculate the number of samples needed for this tape image ********************************************************************/ -static int sorcerer_cassette_calculate_size_in_samples(const UINT8 *bytes, int length) +static int sorcerer_cassette_calculate_size_in_samples(const uint8_t *bytes, int length) { sorcerer_image_size = length; diff --git a/src/lib/formats/sorc_dsk.cpp b/src/lib/formats/sorc_dsk.cpp index 27dc4270f05..ef99fd7ec11 100644 --- a/src/lib/formats/sorc_dsk.cpp +++ b/src/lib/formats/sorc_dsk.cpp @@ -30,14 +30,14 @@ static int sorc_get_tracks_per_disk(floppy_image_legacy *floppy) return 77; } -static UINT64 sorc_translate_offset(floppy_image_legacy *floppy, int track, int head, int sector) +static uint64_t sorc_translate_offset(floppy_image_legacy *floppy, int track, int head, int sector) { return 270*(16*track+sector); } -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) +static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset) { - UINT64 offs; + uint64_t offs; /* translate the sector to a raw sector */ if (!sector_is_index) { @@ -57,7 +57,7 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in static floperr_t internal_sorc_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) { - UINT64 offset; + uint64_t offset; floperr_t err; err = get_offset(floppy, head, track, sector, sector_is_index, &offset); if (err) @@ -71,7 +71,7 @@ static floperr_t internal_sorc_read_sector(floppy_image_legacy *floppy, int head static floperr_t internal_sorc_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam) { - UINT64 offset; + uint64_t offset; floperr_t err; err = get_offset(floppy, head, track, sector, sector_is_index, &offset); @@ -104,7 +104,7 @@ static floperr_t sorc_write_indexed_sector(floppy_image_legacy *floppy, int head return internal_sorc_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam); } -static floperr_t sorc_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t sorc_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { floperr_t err; err = get_offset(floppy, head, track, sector, FALSE, nullptr); @@ -119,7 +119,7 @@ static floperr_t sorc_get_sector_length(floppy_image_legacy *floppy, int head, i -static floperr_t sorc_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +static floperr_t sorc_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { sector_index += 1; if (cylinder) diff --git a/src/lib/formats/sord_cas.cpp b/src/lib/formats/sord_cas.cpp index f535216e18e..bc11c388915 100644 --- a/src/lib/formats/sord_cas.cpp +++ b/src/lib/formats/sord_cas.cpp @@ -16,7 +16,7 @@ #define SORDM5_WAVESAMPLES_TRAILER 1 #define SORDM5_WAVESAMPLES_BLOCK 1 -static const UINT8 SORDM5_CAS_HEADER[6] = { 'S', 'O', 'R', 'D', 'M', '5'}; +static const uint8_t SORDM5_CAS_HEADER[6] = { 'S', 'O', 'R', 'D', 'M', '5'}; static const struct CassetteModulation sordm5_cas_modulation = { @@ -25,9 +25,9 @@ static const struct CassetteModulation sordm5_cas_modulation = 3150.0 - 600, 3150.0, 3150.0 + 600 }; -static UINT8 cassette_image_read_uint8( cassette_image *cassette, UINT64 offset) +static uint8_t cassette_image_read_uint8( cassette_image *cassette, uint64_t offset) { - UINT8 data; + uint8_t data; cassette_image_read( cassette, &data, offset, 1); return data; } @@ -40,13 +40,13 @@ static cassette_image::error sordm5_tap_identify( cassette_image *cassette, stru static cassette_image::error sordm5_tap_load( cassette_image *cassette) { cassette_image::error err; - UINT64 image_size; + uint64_t image_size; double time_index = 0.0; double time_displacement; - UINT8 header[16]; - UINT64 image_pos; - UINT8 block_type, byte, bit; - UINT32 block_size, i, j; + uint8_t header[16]; + uint64_t image_pos; + uint8_t block_type, byte, bit; + uint32_t block_size, i, j; size_t filler_length; // init image_size = cassette_image_size(cassette); diff --git a/src/lib/formats/spc1000_cas.cpp b/src/lib/formats/spc1000_cas.cpp index 6d3a2af52fb..d13021b0047 100644 --- a/src/lib/formats/spc1000_cas.cpp +++ b/src/lib/formats/spc1000_cas.cpp @@ -33,7 +33,7 @@ IPL: This seems a quickload format containing RAM dump, not a real tape // image size static int spc1000_image_size; -static int spc1000_put_samples(INT16 *buffer, int sample_pos, int count, int level) +static int spc1000_put_samples(int16_t *buffer, int sample_pos, int count, int level) { if (buffer) { @@ -44,7 +44,7 @@ static int spc1000_put_samples(INT16 *buffer, int sample_pos, int count, int lev return count; } -static int spc1000_output_bit(INT16 *buffer, int sample_pos, bool bit) +static int spc1000_output_bit(int16_t *buffer, int sample_pos, bool bit) { int samples = 0; @@ -62,23 +62,23 @@ static int spc1000_output_bit(INT16 *buffer, int sample_pos, bool bit) return samples; } -static int spc1000_handle_tap(INT16 *buffer, const UINT8 *bytes) +static int spc1000_handle_tap(int16_t *buffer, const uint8_t *bytes) { - UINT32 sample_count = 0; + uint32_t sample_count = 0; /* data */ - for (UINT32 i = 0; i < spc1000_image_size; i++) + for (uint32_t i = 0; i < spc1000_image_size; i++) sample_count += spc1000_output_bit(buffer, sample_count, bytes[i] & 1); return sample_count; } -static int spc1000_handle_cas(INT16 *buffer, const UINT8 *bytes) +static int spc1000_handle_cas(int16_t *buffer, const uint8_t *bytes) { - UINT32 sample_count = 0; + uint32_t sample_count = 0; /* data (skipping first 16 bytes, which is CAS header) */ - for (UINT32 i = 0x10; i < spc1000_image_size; i++) + for (uint32_t i = 0x10; i < spc1000_image_size; i++) for (int j = 0; j < 8; j++) sample_count += spc1000_output_bit(buffer, sample_count, (bytes[i] >> (7 - j)) & 1); @@ -90,12 +90,12 @@ static int spc1000_handle_cas(INT16 *buffer, const UINT8 *bytes) Generate samples for the tape image ********************************************************************/ -static int spc1000_tap_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int spc1000_tap_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { return spc1000_handle_tap(buffer, bytes); } -static int spc1000_cas_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int spc1000_cas_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { return spc1000_handle_cas(buffer, bytes); } @@ -104,14 +104,14 @@ static int spc1000_cas_fill_wave(INT16 *buffer, int length, UINT8 *bytes) Calculate the number of samples needed for this tape image ********************************************************************/ -static int spc1000_tap_calculate_size_in_samples(const UINT8 *bytes, int length) +static int spc1000_tap_calculate_size_in_samples(const uint8_t *bytes, int length) { spc1000_image_size = length; return spc1000_handle_tap(nullptr, bytes); } -static int spc1000_cas_calculate_size_in_samples(const UINT8 *bytes, int length) +static int spc1000_cas_calculate_size_in_samples(const uint8_t *bytes, int length) { spc1000_image_size = length; diff --git a/src/lib/formats/st_dsk.cpp b/src/lib/formats/st_dsk.cpp index a30165993ea..9808dc56ff9 100644 --- a/src/lib/formats/st_dsk.cpp +++ b/src/lib/formats/st_dsk.cpp @@ -36,20 +36,20 @@ bool st_format::supports_save() const return true; } -void st_format::find_size(io_generic *io, UINT8 &track_count, UINT8 &head_count, UINT8 §or_count) +void st_format::find_size(io_generic *io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count) { - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for(track_count=80; track_count <= 82; track_count++) for(head_count=1; head_count <= 2; head_count++) for(sector_count=9; sector_count <= 11; sector_count++) - if(size == (UINT32)512*track_count*head_count*sector_count) + if(size == (uint32_t)512*track_count*head_count*sector_count) return; track_count = head_count = sector_count = 0; } -int st_format::identify(io_generic *io, UINT32 form_factor) +int st_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 track_count, head_count, sector_count; + uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); if(track_count) @@ -57,12 +57,12 @@ int st_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool st_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool st_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT8 track_count, head_count, sector_count; + uint8_t track_count, head_count, sector_count; find_size(io, track_count, head_count, sector_count); - UINT8 sectdata[11*512]; + uint8_t sectdata[11*512]; desc_s sectors[11]; for(int i=0; i> 8; th[1] = csize; io_generic_write(io, th, pos, 2); io_generic_write(io, compdata, pos+2, csize); pos += 2+csize; } else { - UINT8 th[2]; + uint8_t th[2]; th[0] = track_size >> 8; th[1] = track_size; io_generic_write(io, th, pos, 2); diff --git a/src/lib/formats/st_dsk.h b/src/lib/formats/st_dsk.h index 242d7e9cf5b..9245e861eae 100644 --- a/src/lib/formats/st_dsk.h +++ b/src/lib/formats/st_dsk.h @@ -18,8 +18,8 @@ class st_format : public floppy_image_format_t public: st_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; @@ -28,7 +28,7 @@ public: virtual bool supports_save() const override; private: - void find_size(io_generic *io, UINT8 &track_count, UINT8 &head_count, UINT8 §or_count); + void find_size(io_generic *io, uint8_t &track_count, uint8_t &head_count, uint8_t §or_count); }; class msa_format : public floppy_image_format_t @@ -36,8 +36,8 @@ class msa_format : public floppy_image_format_t public: msa_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; @@ -46,9 +46,9 @@ public: virtual bool supports_save() const override; private: - bool uncompress(UINT8 *buffer, int csize, int usize); - bool compress(const UINT8 *src, int usize, UINT8 *dest, int &csize); - void read_header(io_generic *io, UINT16 &sign, UINT16 §, UINT16 &head, UINT16 &strack, UINT16 &etrack); + bool uncompress(uint8_t *buffer, int csize, int usize); + bool compress(const uint8_t *src, int usize, uint8_t *dest, int &csize); + void read_header(io_generic *io, uint16_t &sign, uint16_t §, uint16_t &head, uint16_t &strack, uint16_t &etrack); }; extern const floppy_format_type FLOPPY_ST_FORMAT; diff --git a/src/lib/formats/svi_cas.cpp b/src/lib/formats/svi_cas.cpp index 4030fedc051..c681c36d9dd 100644 --- a/src/lib/formats/svi_cas.cpp +++ b/src/lib/formats/svi_cas.cpp @@ -10,7 +10,7 @@ #define CAS_EMPTY_SAMPLES (24220) #define CAS_INIT_SAMPLES (200) -static const UINT8 CasHeader[17] = +static const uint8_t CasHeader[17] = { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x7f @@ -24,7 +24,7 @@ static int cas_size; /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int svi_cas_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int svi_cas_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { int cas_pos, samples_pos, n, i; @@ -112,7 +112,7 @@ static int svi_cas_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) /******************************************************************* Calculate the number of samples needed for this tape image ********************************************************************/ -static int svi_cas_to_wav_size(const UINT8 *casdata, int caslen) +static int svi_cas_to_wav_size(const uint8_t *casdata, int caslen) { int cas_pos, samples_pos, size, i; diff --git a/src/lib/formats/svi_dsk.cpp b/src/lib/formats/svi_dsk.cpp index aaa6a45e709..aae08ba329d 100644 --- a/src/lib/formats/svi_dsk.cpp +++ b/src/lib/formats/svi_dsk.cpp @@ -29,9 +29,9 @@ const char *svi_format::extensions() const return "dsk"; } -int svi_format::identify(io_generic *io, UINT32 form_factor) +int svi_format::identify(io_generic *io, uint32_t form_factor) { - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); if (size == 172032 || size == 346112) return 50; @@ -39,9 +39,9 @@ int svi_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool svi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool svi_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); int head_count; switch (size) @@ -61,7 +61,7 @@ bool svi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) int sector_size = (track == 0 && head == 0) ? 128 : 256; desc_pc_sector sectors[20]; - UINT8 sector_data[5000]; + uint8_t sector_data[5000]; int sector_offset = 0; for (int i = 0; i < sector_count; i++) @@ -93,11 +93,11 @@ bool svi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) bool svi_format::save(io_generic *io, floppy_image *image) { - UINT8 bitstream[500000/8]; - UINT8 sector_data[50000]; + uint8_t bitstream[500000/8]; + uint8_t sector_data[50000]; desc_xs sectors[256]; int track_size; - UINT64 file_offset = 0; + uint64_t file_offset = 0; int track_count, head_count; image->get_actual_geometry(track_count, head_count); diff --git a/src/lib/formats/svi_dsk.h b/src/lib/formats/svi_dsk.h index 9ae933572df..f7ffbfeaf5c 100644 --- a/src/lib/formats/svi_dsk.h +++ b/src/lib/formats/svi_dsk.h @@ -24,8 +24,8 @@ public: virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual bool supports_save() const override; }; diff --git a/src/lib/formats/td0_dsk.cpp b/src/lib/formats/td0_dsk.cpp index 51fa59488a6..375cf3cdb42 100644 --- a/src/lib/formats/td0_dsk.cpp +++ b/src/lib/formats/td0_dsk.cpp @@ -44,51 +44,51 @@ struct td0dsk_tag int heads; int tracks; int sector_size; - UINT64 track_offsets[84*2]; /* offset within data for each track */ - UINT8 *data; + uint64_t track_offsets[84*2]; /* offset within data for each track */ + uint8_t *data; }; struct tdlzhuf { - UINT16 r, + uint16_t r, bufcnt,bufndx,bufpos, // string buffer // the following to allow block reads from input in next_word() ibufcnt,ibufndx; // input buffer counters - UINT8 inbuf[BUFSZ]; // input buffer + uint8_t inbuf[BUFSZ]; // input buffer }; struct td0dsk_t { io_generic *floppy_file; - UINT64 floppy_file_offset; + uint64_t floppy_file_offset; struct tdlzhuf tdctl; - UINT8 text_buf[N + F - 1]; - UINT16 freq[T + 1]; /* cumulative freq table */ + uint8_t text_buf[N + F - 1]; + uint16_t freq[T + 1]; /* cumulative freq table */ /* * pointing parent nodes. * area [T..(T + N_CHAR - 1)] are pointers for leaves */ - INT16 prnt[T + N_CHAR]; + int16_t prnt[T + N_CHAR]; /* pointing children nodes (son[], son[] + 1)*/ - INT16 son[T]; + int16_t son[T]; - UINT16 getbuf; - UINT8 getlen; + uint16_t getbuf; + uint8_t getlen; - int data_read(UINT8 *buf, UINT16 size); + int data_read(uint8_t *buf, uint16_t size); int next_word(); int GetBit(); int GetByte(); void StartHuff(); void reconst(); void update(int c); - INT16 DecodeChar(); - INT16 DecodePosition(); + int16_t DecodeChar(); + int16_t DecodePosition(); void init_Decode(); - int Decode(UINT8 *buf, int len); + int Decode(uint8_t *buf, int len); }; //static td0dsk_t td0dsk; @@ -103,10 +103,10 @@ struct floppy_image_legacy /* loaded track stuff */ int loaded_track_head; int loaded_track_index; - UINT32 loaded_track_size; + uint32_t loaded_track_size; void *loaded_track_data; - UINT8 loaded_track_status; - UINT8 flags; + uint8_t loaded_track_status; + uint8_t flags; /* tagging system */ object_pool *tags; @@ -125,7 +125,7 @@ static struct td0dsk_tag *get_tag(floppy_image_legacy *floppy) FLOPPY_IDENTIFY( td0_dsk_identify ) { - UINT8 header[2]; + uint8_t header[2]; floppy_image_read(floppy, header, 0, 2); if (header[0]=='T' && header[1]=='D') { @@ -148,16 +148,16 @@ static int td0_get_tracks_per_disk(floppy_image_legacy *floppy) return get_tag(floppy)->tracks; } -static UINT64 td0_get_track_offset(floppy_image_legacy *floppy, int head, int track) +static uint64_t td0_get_track_offset(floppy_image_legacy *floppy, int head, int track) { return get_tag(floppy)->track_offsets[(track<<1) + head]; } -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) +static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset) { - UINT64 offs; - UINT8 *header; - UINT8 sectors_per_track; + uint64_t offs; + uint8_t *header; + uint8_t sectors_per_track; int i; if ((head < 0) || (head >= get_tag(floppy)->heads) || (track < 0) || (track >= get_tag(floppy)->tracks) @@ -202,16 +202,16 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in static floperr_t internal_td0_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) { - UINT64 offset; + uint64_t offset; floperr_t err; - UINT8 *header; + uint8_t *header; int size,realsize,i; int buff_pos; int data_pos; - UINT8 *data; - UINT8 *buf; + uint8_t *data; + uint8_t *buf; - buf = (UINT8*)buffer; + buf = (uint8_t*)buffer; // take sector offset err = get_offset(floppy, head, track, sector, sector_is_index, &offset); if (err) @@ -295,7 +295,7 @@ static floperr_t td0_read_indexed_sector(floppy_image_legacy *floppy, int head, return internal_td0_read_sector(floppy, head, track, sector, TRUE, buffer, buflen); } -static floperr_t td0_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t td0_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { floperr_t err; err = get_offset(floppy, head, track, sector, FALSE, nullptr); @@ -308,11 +308,11 @@ static floperr_t td0_get_sector_length(floppy_image_legacy *floppy, int head, in return FLOPPY_ERROR_SUCCESS; } -static floperr_t td0_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +static floperr_t td0_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { floperr_t retVal; - UINT64 offset = 0; - UINT8 *sector_info; + uint64_t offset = 0; + uint8_t *sector_info; retVal = get_offset(floppy, head, track, sector_index, FALSE, &offset); sector_info = get_tag(floppy)->data + offset; @@ -334,9 +334,9 @@ static floperr_t td0_get_indexed_sector_info(floppy_image_legacy *floppy, int he return retVal; } -int td0dsk_t::data_read(UINT8 *buf, UINT16 size) +int td0dsk_t::data_read(uint8_t *buf, uint16_t size) { - UINT64 image_size = io_generic_size(floppy_file); + uint64_t image_size = io_generic_size(floppy_file); if (size > image_size - floppy_file_offset) { size = image_size - floppy_file_offset; } @@ -352,7 +352,7 @@ int td0dsk_t::data_read(UINT8 *buf, UINT16 size) */ /* decoder table */ -static const UINT8 d_code[256] = { +static const uint8_t d_code[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -387,7 +387,7 @@ static const UINT8 d_code[256] = { 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, }; -static const UINT8 d_len[256] = { +static const uint8_t d_len[256] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, @@ -441,7 +441,7 @@ int td0dsk_t::next_word() int td0dsk_t::GetBit() /* get one bit */ { - INT16 i; + int16_t i; if(next_word() < 0) return(-1); i = getbuf; @@ -455,7 +455,7 @@ int td0dsk_t::GetBit() /* get one bit */ int td0dsk_t::GetByte() /* get a byte */ { - UINT16 i; + uint16_t i; if(next_word() != 0) return(-1); i = getbuf; @@ -494,8 +494,8 @@ void td0dsk_t::StartHuff() void td0dsk_t::reconst() { - INT16 i, j, k; - UINT16 f, l; + int16_t i, j, k; + uint16_t f, l; /* halven cumulative freq for leaf nodes */ j = 0; @@ -572,10 +572,10 @@ void td0dsk_t::update(int c) } -INT16 td0dsk_t::DecodeChar() +int16_t td0dsk_t::DecodeChar() { int ret; - UINT16 c; + uint16_t c; c = son[R]; @@ -595,16 +595,16 @@ INT16 td0dsk_t::DecodeChar() return c; } -INT16 td0dsk_t::DecodePosition() +int16_t td0dsk_t::DecodePosition() { - INT16 bit; - UINT16 i, j, c; + int16_t bit; + uint16_t i, j, c; /* decode upper 6 bits from given table */ if((bit=GetByte()) < 0) return(-1); - i = (UINT16) bit; - c = (UINT16)d_code[i] << 6; + i = (uint16_t) bit; + c = (uint16_t)d_code[i] << 6; j = d_len[i]; /* input lower 6 bits directly */ @@ -637,9 +637,9 @@ void td0dsk_t::init_Decode() } -int td0dsk_t::Decode(UINT8 *buf, int len) /* Decoding/Uncompressing */ +int td0dsk_t::Decode(uint8_t *buf, int len) /* Decoding/Uncompressing */ { - INT16 c,pos; + int16_t c,pos; int count; // was an unsigned long, seems unnecessary for (count = 0; count < len; ) { if(tdctl.bufcnt == 0) { @@ -682,7 +682,7 @@ FLOPPY_CONSTRUCT( td0_dsk_construct ) td0dsk_t state; struct FloppyCallbacks *callbacks; struct td0dsk_tag *tag; - UINT8 *header; + uint8_t *header; int number_of_sectors; int position; int i; @@ -698,7 +698,7 @@ FLOPPY_CONSTRUCT( td0_dsk_construct ) if (!tag) return FLOPPY_ERROR_OUTOFMEMORY; - tag->data = (UINT8*)malloc(floppy_image_size(floppy)); + tag->data = (uint8_t*)malloc(floppy_image_size(floppy)); if (tag->data==nullptr) { return FLOPPY_ERROR_OUTOFMEMORY; } @@ -706,7 +706,7 @@ FLOPPY_CONSTRUCT( td0_dsk_construct ) header = tag->data; if (header[0]=='t') { - UINT8 obuf[BUFSZ]; + uint8_t obuf[BUFSZ]; int rd; int off = 12; int size = 0; @@ -719,7 +719,7 @@ FLOPPY_CONSTRUCT( td0_dsk_construct ) } while(rd == BUFSZ); memcpy(obuf,tag->data,12); free(tag->data); - tag->data = (UINT8*)malloc(size+12); + tag->data = (uint8_t*)malloc(size+12); if (tag->data==nullptr) { return FLOPPY_ERROR_OUTOFMEMORY; } @@ -819,9 +819,9 @@ const char *td0_format::extensions() const return "td0"; } -int td0_format::identify(io_generic *io, UINT32 form_factor) +int td0_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 h[7]; + uint8_t h[7]; io_generic_read(io, h, 0, 7); if(((h[0] == 'T') && (h[1] == 'D')) || ((h[0] == 't') && (h[1] == 'd'))) @@ -831,15 +831,15 @@ int td0_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool td0_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool td0_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { int track_count = 0; int head_count = 0; int track_spt; int offset = 0; const int max_size = 4*1024*1024; // 4MB ought to be large enough for any floppy - std::vector imagebuf(max_size); - UINT8 header[12]; + std::vector imagebuf(max_size); + uint8_t header[12]; io_generic_read(io, header, 0, 12); head_count = header[9]; @@ -917,7 +917,7 @@ bool td0_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) while(track_spt != 255) { desc_pc_sector sects[256]; - UINT8 sect_data[65536]; + uint8_t sect_data[65536]; int sdatapos = 0; int track = imagebuf[offset + 1]; int head = imagebuf[offset + 2] & 1; @@ -925,8 +925,8 @@ bool td0_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) offset += 4; for(int i = 0; i < track_spt; i++) { - UINT8 *hs = &imagebuf[offset]; - UINT16 size; + uint8_t *hs = &imagebuf[offset]; + uint16_t size; offset += 6; sects[i].track = hs[0]; @@ -967,8 +967,8 @@ bool td0_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) k = 0; while(k < size) { - UINT16 len = imagebuf[offset]; - UINT16 rep = imagebuf[offset + 1]; + uint16_t len = imagebuf[offset]; + uint16_t rep = imagebuf[offset + 1]; offset += 2; if(!len) { diff --git a/src/lib/formats/td0_dsk.h b/src/lib/formats/td0_dsk.h index eae873e30e0..2207b993c21 100644 --- a/src/lib/formats/td0_dsk.h +++ b/src/lib/formats/td0_dsk.h @@ -11,8 +11,8 @@ class td0_format : public floppy_image_format_t public: td0_format(); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual const char *name() const override; diff --git a/src/lib/formats/thom_cas.cpp b/src/lib/formats/thom_cas.cpp index c6ab5a2d004..45f89ac2a29 100644 --- a/src/lib/formats/thom_cas.cpp +++ b/src/lib/formats/thom_cas.cpp @@ -46,8 +46,8 @@ #define TO7_PERIOD_CASS_0 ( 1. / TO7_FREQ_CASS_0 ) #define TO7_PERIOD_CASS_1 ( 1. / TO7_FREQ_CASS_1 ) -static UINT32 to7_k7_bitsize; -static UINT8* to7_k7_bits; +static uint32_t to7_k7_bitsize; +static uint8_t* to7_k7_bits; #define MO5_BIT_LENGTH 0.000833 #define MO5_HBIT_LENGTH (MO5_BIT_LENGTH / 2.) @@ -106,12 +106,12 @@ static cassette_image::error to7_k7_identify ( cassette_image *cass, struct Cass static cassette_image::error to7_k7_load( cassette_image *cass ) { #if ! K7_SPEED_HACK - static const INT8 square_wave[] = { -128, 127 }; + static const int8_t square_wave[] = { -128, 127 }; double time = 0.; #endif size_t size = cassette_image_size( cass ), pos = 0; int i, sz, sz2, bitmax = 1024, invalid = 0; - UINT8 in, typ, block[264]; + uint8_t in, typ, block[264]; LOG (( "to7_k7_load: start conversion, size=%li\n", (long)size )); PRINT (( "to7_k7_load: open cassette, length: %li bytes\n", (long) size )); @@ -123,7 +123,7 @@ static cassette_image::error to7_k7_load( cassette_image *cass ) } to7_k7_bitsize = 0; - to7_k7_bits = (UINT8*)malloc(bitmax ); + to7_k7_bits = (uint8_t*)malloc(bitmax ); /* store one period */ #if K7_SPEED_HACK @@ -158,7 +158,7 @@ static cassette_image::error to7_k7_load( cassette_image *cass ) } \ if ( to7_k7_bitsize + 1 >= bitmax ) \ { \ - UINT8* a = (UINT8*)malloc(bitmax * 2); \ + uint8_t* a = (uint8_t*)malloc(bitmax * 2); \ memcpy ( a, to7_k7_bits, bitmax ); \ bitmax *= 2; \ to7_k7_bits = a; \ @@ -170,7 +170,7 @@ static cassette_image::error to7_k7_load( cassette_image *cass ) #define K7_PUT_BYTE( BYTE ) \ do \ { \ - UINT8 x; \ + uint8_t x; \ K7_PUT_BIT( 0 ); \ for ( x = 0; x < 8; x++ ) \ K7_PUT_BIT( ( (BYTE) >> x ) & 1 ); \ @@ -290,8 +290,8 @@ static cassette_image::error to7_k7_load( cassette_image *cass ) if ( typ == 0 ) { char name[] = "01234567.ABC"; - UINT8 t = block[15]; - UINT8 u = block[16]; + uint8_t t = block[15]; + uint8_t u = block[16]; int p = (to7_k7_bitsize - sz2 - 4 - sz) * TO7_BIT_LENGTH; memcpy( name, block+4, 8 ); memcpy( name+9, block+12, 3 ); @@ -331,7 +331,7 @@ static cassette_image::error to7_k7_load( cassette_image *cass ) } if ( invalid < 10 && sz > 4 && in == 0x01 && pos + 4 <= size ) { - UINT8 in1,in2; + uint8_t in1,in2; cassette_image_read( cass, &in1, pos+1, 1 ); cassette_image_read( cass, &in2, pos+2, 1 ); if ( (in1 == 0x3c) && ((in2 == 0x00) || (in2 == 0x01) ) ) @@ -466,7 +466,7 @@ static cassette_image::error mo5_k5_load( cassette_image *cass ) { size_t size = cassette_image_size( cass ), pos = 0; int i, sz, sz2, hbit = 0; - UINT8 in, in2, in3, typ, block[264], sum; + uint8_t in, in2, in3, typ, block[264], sum; int invalid = 0, hbitsize = 0, dcmoto = 0; LOG (( "mo5_k5_load: start conversion, size=%li\n", (long)size )); @@ -502,7 +502,7 @@ static cassette_image::error mo5_k5_load( cassette_image *cass ) #define K5_PUT_BYTE( BYTE ) \ do \ { \ - UINT8 b = BYTE; \ + uint8_t b = BYTE; \ int x; \ for ( x = 0; x < 8; x++ ) \ K5_PUT_BIT( (b >> (7 - x)) & 1 ); \ @@ -596,7 +596,7 @@ static cassette_image::error mo5_k5_load( cassette_image *cass ) } cassette_image_read( cass, block, pos, 4 ); typ = block[2]; - sz2 = (UINT8) (block[3]-1); + sz2 = (uint8_t) (block[3]-1); if ( block[0] != 0x3c || block[1] != 0x5a || ( typ != 0x00 && typ != 0x01 && typ != 0xff ) || pos+sz2 > size ) { pos -= sz; @@ -635,8 +635,8 @@ static cassette_image::error mo5_k5_load( cassette_image *cass ) if ( typ == 0 ) { char name[] = "01234567.ABC"; - UINT8 t = block[15]; - UINT8 u = block[16]; + uint8_t t = block[15]; + uint8_t u = block[16]; int p = (hbitsize - sz2 - 4 - sz) * MO5_HBIT_LENGTH; memcpy( name, block+4, 8 ); memcpy( name+9, block+12, 3 ); diff --git a/src/lib/formats/thom_dsk.cpp b/src/lib/formats/thom_dsk.cpp index df4d66c84e3..6249d785705 100644 --- a/src/lib/formats/thom_dsk.cpp +++ b/src/lib/formats/thom_dsk.cpp @@ -23,7 +23,7 @@ static const char sap_header[] = "(c) Alexandre PUKALL Avril 1998"; -static const UINT16 sap_crc[] = +static const uint16_t sap_crc[] = { 0x0000, 0x1081, 0x2102, 0x3183, 0x4204, 0x5285, 0x6306, 0x7387, 0x8408, 0x9489, 0xa50a, 0xb58b, 0xc60c, 0xd68d, 0xe70e, 0xf78f, @@ -36,10 +36,10 @@ struct sap_dsk_tag int sector_pos[80][16]; /* remember sector position in file */ }; -static UINT16 thom_sap_crc( UINT8* data, int size ) +static uint16_t thom_sap_crc( uint8_t* data, int size ) { int i; - UINT16 crc = 0xffff, crc2; + uint16_t crc = 0xffff, crc2; for ( i = 0; i < size; i++ ) { crc2 = ( crc >> 4 ) ^ sap_crc[ ( crc ^ data[i] ) & 15 ]; @@ -79,9 +79,9 @@ static int sap_get_tracks_per_disk(floppy_image_legacy *floppy) } -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) +static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset) { - UINT64 offs; + uint64_t offs; struct sap_dsk_tag *tag = get_tag(floppy); /* translate the sector to a raw sector */ if (!sector_is_index) @@ -106,16 +106,16 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in static floperr_t internal_sap_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) { - UINT64 offset; + uint64_t offset; floperr_t err; int i; - UINT8 *buf; + uint8_t *buf; err = get_offset(floppy, head, track, sector, sector_is_index, &offset); if (err) return err; floppy_image_read(floppy, buffer, offset+4, buflen); - buf = (UINT8*)buffer; + buf = (uint8_t*)buffer; for (i=0;i> 8; @@ -172,7 +172,7 @@ static floperr_t sap_write_indexed_sector(floppy_image_legacy *floppy, int head, return internal_sap_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam); } -static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { floperr_t err; err = get_offset(floppy, head, track, sector, FALSE, nullptr); @@ -187,11 +187,11 @@ static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, in -static floperr_t sap_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +static floperr_t sap_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { floperr_t err; - UINT8 header[4]; - UINT64 offset = 0; + uint8_t header[4]; + uint64_t offset = 0; sector_index += 1; err = get_offset(floppy, head, track, sector_index, FALSE, &offset); @@ -214,7 +214,7 @@ static floperr_t sap_post_format(floppy_image_legacy *floppy, util::option_resol { int track,sector; int pos; - UINT8 buf[256], header[4]; + uint8_t buf[256], header[4]; struct sap_dsk_tag *tag; tag = (struct sap_dsk_tag *) floppy_create_tag(floppy, sizeof(struct sap_dsk_tag)); @@ -255,7 +255,7 @@ static FLOPPY_CONSTRUCT(sap_dsk_construct) struct FloppyCallbacks *callbacks; struct sap_dsk_tag *tag; int j; - UINT8 fmt; + uint8_t fmt; tag = (struct sap_dsk_tag *) floppy_create_tag(floppy, sizeof(struct sap_dsk_tag)); if (!tag) return FLOPPY_ERROR_OUTOFMEMORY; @@ -271,9 +271,9 @@ static FLOPPY_CONSTRUCT(sap_dsk_construct) tag->sector_pos[i][j] = 0; /* count tracks & fill sector offset table */ - for ( UINT64 i = 0x42; i+4 < floppy_image_size(floppy); i += tag->sector_size + 6 ) // CRC 2 bytes + 4 bytes sector header + for ( uint64_t i = 0x42; i+4 < floppy_image_size(floppy); i += tag->sector_size + 6 ) // CRC 2 bytes + 4 bytes sector header { - UINT8 sector, track; + uint8_t sector, track; floppy_image_read(floppy, &track, i+2, 1); floppy_image_read(floppy, §or, i+3, 1); if ( track >= 80 || sector < 1 || sector > 16 ) continue; diff --git a/src/lib/formats/ti99_dsk.cpp b/src/lib/formats/ti99_dsk.cpp index 0d03cf4fce0..ce8def17289 100644 --- a/src/lib/formats/ti99_dsk.cpp +++ b/src/lib/formats/ti99_dsk.cpp @@ -58,7 +58,7 @@ As said above, let's not spend too much effort allowing format deviations. If the image does not exactly adhere to the format, give up. */ -bool ti99_floppy_format::check_for_address_marks(UINT8* trackdata, int encoding) +bool ti99_floppy_format::check_for_address_marks(uint8_t* trackdata, int encoding) { int i=0; @@ -94,7 +94,7 @@ int ti99_floppy_format::get_encoding(int cell_size) /* Load the image from disk and convert it into a sequence of flux levels. */ -bool ti99_floppy_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool ti99_floppy_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { int cell_size = 0; int sector_count = 0; @@ -105,7 +105,7 @@ bool ti99_floppy_format::load(io_generic *io, UINT32 form_factor, floppy_image * if (cell_size == 0) return false; // Be ready to hold a track of up to 36 sectors (with gaps and marks) - UINT8 trackdata[13000]; + uint8_t trackdata[13000]; int maxtrack, maxheads; image->get_maximal_geometry(maxtrack, maxheads); @@ -188,8 +188,8 @@ bool ti99_floppy_format::save(io_generic *io, floppy_image *image) { int act_track_size = 0; - UINT8 bitstream[500000/8]; - UINT8 trackdata[9216]; // max size + uint8_t bitstream[500000/8]; + uint8_t trackdata[9216]; // max size int cellsizes[] = { 2000, 4000, 1000, 2000 }; @@ -299,10 +299,10 @@ bool ti99_floppy_format::save(io_generic *io, floppy_image *image) return true; } -void ti99_floppy_format::generate_track_fm(int track, int head, int cell_size, UINT8* trackdata, floppy_image *image) +void ti99_floppy_format::generate_track_fm(int track, int head, int cell_size, uint8_t* trackdata, floppy_image *image) { int track_size_cells = 200000000/cell_size; - std::vector buffer; + std::vector buffer; // The TDF has a long track lead-out that makes the track length sum up // to 3253; this is too long for the number of cells in the real track. @@ -399,10 +399,10 @@ void ti99_floppy_format::generate_track_fm(int track, int head, int cell_size, U generate_track_from_levels(track, head, buffer, 0, image); } -void ti99_floppy_format::generate_track_mfm(int track, int head, int cell_size, UINT8* trackdata, floppy_image *image) +void ti99_floppy_format::generate_track_mfm(int track, int head, int cell_size, uint8_t* trackdata, floppy_image *image) { int track_size_cells = 200000000/cell_size; - std::vector buffer; + std::vector buffer; // See above // We limit the track size to cell_number / 16, which means 6250 for MFM @@ -510,15 +510,15 @@ enum Decodes the bitstream into a TDF track image. Returns the number of detected marks. */ -int ti99_floppy_format::decode_bitstream(const UINT8 *bitstream, UINT8 *trackdata, int* sector, int cell_count, int encoding, UINT8 gapbytes, int track_size) +int ti99_floppy_format::decode_bitstream(const uint8_t *bitstream, uint8_t *trackdata, int* sector, int cell_count, int encoding, uint8_t gapbytes, int track_size) { int databytes = 0; int a1count = 0; int lastpos = 0; int headerbytes = 0; int curpos = 0; - UINT8 curbyte = 0; - UINT16 shift_reg = 0; + uint8_t curbyte = 0; + uint16_t shift_reg = 0; int tpos = 0; int pos = 0; int state; @@ -695,7 +695,7 @@ int ti99_floppy_format::decode_bitstream(const UINT8 *bitstream, UINT8 *trackdat return marks; } -UINT8 ti99_floppy_format::get_data_from_encoding(UINT16 raw) +uint8_t ti99_floppy_format::get_data_from_encoding(uint16_t raw) { return (raw & 0x4000 ? 0x80 : 0x00) | (raw & 0x1000 ? 0x40 : 0x00) | @@ -750,9 +750,9 @@ const char *ti99_sdf_format::extensions() const return "dsk"; } -int ti99_sdf_format::identify(io_generic *io, UINT32 form_factor) +int ti99_sdf_format::identify(io_generic *io, uint32_t form_factor) { - UINT64 file_size = io_generic_size(io); + uint64_t file_size = io_generic_size(io); int vote = 0; // Adding support for another sector image format which adds 768 bytes @@ -810,7 +810,7 @@ int ti99_sdf_format::identify(io_generic *io, UINT32 form_factor) void ti99_sdf_format::determine_sizes(io_generic *io, int& cell_size, int& sector_count, int& heads, int& tracks) { - UINT64 file_size = io_generic_size(io); + uint64_t file_size = io_generic_size(io); ti99vib vib; cell_size = 0; @@ -910,7 +910,7 @@ int ti99_sdf_format::get_track_size(int cell_size, int sector_count) acttrack is the actual track when double stepping is used and changes every two physical tracks. */ -void ti99_sdf_format::load_track(io_generic *io, UINT8 *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) +void ti99_sdf_format::load_track(io_generic *io, uint8_t *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) { bool fm = (cellsize==4000); int tracksize = sectorcount * SECTOR_SIZE; @@ -999,7 +999,7 @@ void ti99_sdf_format::load_track(io_generic *io, UINT8 *trackdata, int head, int /* For debugging. Outputs the byte array in a xxd-like way. */ -void ti99_floppy_format::showtrack(UINT8* trackdata, int length) +void ti99_floppy_format::showtrack(uint8_t* trackdata, int length) { for (int i=0; i < length; i+=16) { @@ -1023,7 +1023,7 @@ void ti99_floppy_format::showtrack(UINT8* trackdata, int length) Write the data to the disk. We have a list of sector positions, so we just need to go through that list and save each sector in the track data. */ -void ti99_sdf_format::write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) +void ti99_sdf_format::write_track(io_generic *io, uint8_t *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) { int logicaltrack = head * maxtrack; logicaltrack += ((head&1)==0)? track : (maxtrack - 1 - track); @@ -1091,11 +1091,11 @@ const char *ti99_tdf_format::extensions() const /* Determine whether the image file can be interpreted as a track dump */ -int ti99_tdf_format::identify(io_generic *io, UINT32 form_factor) +int ti99_tdf_format::identify(io_generic *io, uint32_t form_factor) { - UINT64 file_size = io_generic_size(io); + uint64_t file_size = io_generic_size(io); int vote = 0; - UINT8 trackdata[2000]; + uint8_t trackdata[2000]; // Do we have a plausible image size? From the size alone we only give a 50 percent vote. if ((file_size == 260240) || (file_size == 549760) || (file_size == 1099520)) @@ -1124,7 +1124,7 @@ int ti99_tdf_format::identify(io_generic *io, UINT32 form_factor) */ void ti99_tdf_format::determine_sizes(io_generic *io, int& cell_size, int& sector_count, int& heads, int& tracks) { - UINT64 file_size = io_generic_size(io); + uint64_t file_size = io_generic_size(io); heads = 2; // TDF only supports two-sided recordings if (file_size % get_track_size(2000, 0)==0) cell_size = 2000; @@ -1138,7 +1138,7 @@ void ti99_tdf_format::determine_sizes(io_generic *io, int& cell_size, int& secto For TDF this just amounts to loading the track from the image file. acttrack is not used here, since the file contains the track data. */ -void ti99_tdf_format::load_track(io_generic *io, UINT8 *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) +void ti99_tdf_format::load_track(io_generic *io, uint8_t *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) { int offset = ((trackcount * head) + track) * get_track_size(cellsize, 0); io_generic_read(io, trackdata, offset, get_track_size(cellsize, 0)); @@ -1147,7 +1147,7 @@ void ti99_tdf_format::load_track(io_generic *io, UINT8 *trackdata, int head, int /* Also here, we just need to write the complete track on the image file. */ -void ti99_tdf_format::write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) +void ti99_tdf_format::write_track(io_generic *io, uint8_t *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) { int offset = ((maxtrack * head) + track) * numbytes; io_generic_write(io, trackdata, offset, numbytes); diff --git a/src/lib/formats/ti99_dsk.h b/src/lib/formats/ti99_dsk.h index a34e73d8bd8..d596f4bb17c 100644 --- a/src/lib/formats/ti99_dsk.h +++ b/src/lib/formats/ti99_dsk.h @@ -20,29 +20,29 @@ class ti99_floppy_format : public floppy_image_format_t { public: bool supports_save() const override { return true; } - bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; bool save(io_generic *io, floppy_image *image) override; protected: - int decode_bitstream(const UINT8 *bitstream, UINT8 *trackdata, int *sector, int cell_count, int encoding, UINT8 gapbytes, int track_size); - UINT8 get_data_from_encoding(UINT16 raw); + int decode_bitstream(const uint8_t *bitstream, uint8_t *trackdata, int *sector, int cell_count, int encoding, uint8_t gapbytes, int track_size); + uint8_t get_data_from_encoding(uint16_t raw); virtual int min_heads() =0; virtual void determine_sizes(io_generic *io, int& cell_size, int& sector_count, int& heads, int& tracks) =0; virtual int get_track_size(int cell_size, int sector_count) =0; - virtual void load_track(io_generic *io, UINT8 *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) =0; - virtual void write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) =0; + virtual void load_track(io_generic *io, uint8_t *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) =0; + virtual void write_track(io_generic *io, uint8_t *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) =0; int get_encoding(int cell_size); - void generate_track_fm(int track, int head, int cell_size, UINT8* trackdata, floppy_image *image); - void generate_track_mfm(int track, int head, int cell_size, UINT8* trackdata, floppy_image *image); + void generate_track_fm(int track, int head, int cell_size, uint8_t* trackdata, floppy_image *image); + void generate_track_mfm(int track, int head, int cell_size, uint8_t* trackdata, floppy_image *image); - bool check_for_address_marks(UINT8* trackdata, int encoding); + bool check_for_address_marks(uint8_t* trackdata, int encoding); // Debugging - void showtrack(UINT8* trackdata, int length); + void showtrack(uint8_t* trackdata, int length); }; /* @@ -51,7 +51,7 @@ protected: class ti99_sdf_format : public ti99_floppy_format { public: - int identify(io_generic *io, UINT32 form_factor) override; + int identify(io_generic *io, uint32_t form_factor) override; const char *name() const override; const char *description() const override; const char *extensions() const override; @@ -59,8 +59,8 @@ public: private: void determine_sizes(io_generic *io, int& cell_size, int& sector_count, int& heads, int& tracks) override; int get_track_size(int cell_size, int sector_count) override; - void write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) override; - void load_track(io_generic *io, UINT8 *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) override; + void write_track(io_generic *io, uint8_t *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) override; + void load_track(io_generic *io, uint8_t *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) override; // This format supports single-sided images int min_heads() override { return 1; } @@ -68,16 +68,16 @@ private: struct ti99vib { char name[10]; // volume name (10 characters, pad with spaces) - UINT8 totsecsMSB; // disk length in sectors (big-endian) (usually 360, 720 or 1440) - UINT8 totsecsLSB; - UINT8 secspertrack; // sectors per track (usually 9 (FM) or 18 (MFM)) - UINT8 id[3]; // String "DSK" - UINT8 protection; // 'P' if disk is protected, ' ' otherwise. - UINT8 tracksperside; // tracks per side (usually 40) - UINT8 sides; // sides (1 or 2) - UINT8 density; // 0,1 (FM) or 2,3,4 (MFM) - UINT8 res[36]; // Empty for traditional disks, or up to 3 directory pointers - UINT8 abm[200]; // allocation bitmap: a 1 for each sector in use (sector 0 is LSBit of byte 0, + uint8_t totsecsMSB; // disk length in sectors (big-endian) (usually 360, 720 or 1440) + uint8_t totsecsLSB; + uint8_t secspertrack; // sectors per track (usually 9 (FM) or 18 (MFM)) + uint8_t id[3]; // String "DSK" + uint8_t protection; // 'P' if disk is protected, ' ' otherwise. + uint8_t tracksperside; // tracks per side (usually 40) + uint8_t sides; // sides (1 or 2) + uint8_t density; // 0,1 (FM) or 2,3,4 (MFM) + uint8_t res[36]; // Empty for traditional disks, or up to 3 directory pointers + uint8_t abm[200]; // allocation bitmap: a 1 for each sector in use (sector 0 is LSBit of byte 0, // sector 7 is MSBit of byte 0, sector 8 is LSBit of byte 1, etc.) }; }; @@ -90,15 +90,15 @@ extern const floppy_format_type FLOPPY_TI99_SDF_FORMAT; class ti99_tdf_format : public ti99_floppy_format { public: - int identify(io_generic *io, UINT32 form_factor) override; + int identify(io_generic *io, uint32_t form_factor) override; const char *name() const override; const char *description() const override; const char *extensions() const override; private: void determine_sizes(io_generic *io, int& cell_size, int& sector_count, int& heads, int& tracks) override; - void load_track(io_generic *io, UINT8 *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) override; - void write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) override; + void load_track(io_generic *io, uint8_t *trackdata, int head, int track, int acttrack, int sectorcount, int trackcount, int cellsize) override; + void write_track(io_generic *io, uint8_t *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) override; int get_track_size(int cell_size, int sector_count) override; // This format only supports double-sided images diff --git a/src/lib/formats/trs_cas.cpp b/src/lib/formats/trs_cas.cpp index 9f00989bc02..a6701ed1263 100644 --- a/src/lib/formats/trs_cas.cpp +++ b/src/lib/formats/trs_cas.cpp @@ -21,7 +21,7 @@ static int cas_size; /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -static inline int trs80l2_cas_cycle(INT16 *buffer, int sample_pos, int silence, int high, int low) +static inline int trs80l2_cas_cycle(int16_t *buffer, int sample_pos, int silence, int high, int low) { int i = 0; @@ -48,7 +48,7 @@ static inline int trs80l2_cas_cycle(INT16 *buffer, int sample_pos, int silence, } -static int trs80l2_handle_cas(INT16 *buffer, const UINT8 *casdata) +static int trs80l2_handle_cas(int16_t *buffer, const uint8_t *casdata) { int data_pos, sample_count; @@ -57,7 +57,7 @@ static int trs80l2_handle_cas(INT16 *buffer, const UINT8 *casdata) while( data_pos < cas_size ) { - UINT8 data = casdata[data_pos]; + uint8_t data = casdata[data_pos]; int i; for ( i = 0; i < 8; i++ ) @@ -83,7 +83,7 @@ static int trs80l2_handle_cas(INT16 *buffer, const UINT8 *casdata) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int trs80l2_cas_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int trs80l2_cas_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return trs80l2_handle_cas( buffer, bytes ); } @@ -92,7 +92,7 @@ static int trs80l2_cas_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) /******************************************************************* Calculate the number of samples needed for this tape image ********************************************************************/ -static int trs80l2_cas_to_wav_size(const UINT8 *casdata, int caslen) +static int trs80l2_cas_to_wav_size(const uint8_t *casdata, int caslen) { cas_size = caslen; diff --git a/src/lib/formats/tvc_cas.cpp b/src/lib/formats/tvc_cas.cpp index c7c60829945..9177491278c 100644 --- a/src/lib/formats/tvc_cas.cpp +++ b/src/lib/formats/tvc_cas.cpp @@ -28,7 +28,7 @@ static void tvc64_emit_level(cassette_image *cass, double &time, int freq, int l time += period; } -static cassette_image::error tvc64_output_byte(cassette_image *cass, double &time, UINT8 byte) +static cassette_image::error tvc64_output_byte(cassette_image *cass, double &time, uint8_t byte) { for (int i=0; i<8; i++) { @@ -58,15 +58,15 @@ static int tvc64_output_predata(cassette_image *cass, double &time, int number) return (int)cassette_image::error::SUCCESS; } -static UINT16 tvc64_calc_crc(const UINT8 *bytes, int size) +static uint16_t tvc64_calc_crc(const uint8_t *bytes, int size) { - UINT16 crc = 0; + uint16_t crc = 0; for (int i=0; i>8) & 0xff); @@ -84,13 +84,13 @@ static UINT16 tvc64_calc_crc(const UINT8 *bytes, int size) static cassette_image::error tvc64_cassette_load(cassette_image *cassette) { - UINT8 tmp_buff[512]; + uint8_t tmp_buff[512]; int buff_idx = 0; double time = 0.0; - UINT8 header[TVC64_HEADER_BYTES]; + uint8_t header[TVC64_HEADER_BYTES]; cassette_image_read(cassette, header, 0, TVC64_HEADER_BYTES); - UINT16 cas_size = (header[0x83]<<8) | header[0x82]; + uint16_t cas_size = (header[0x83]<<8) | header[0x82]; // tape header tmp_buff[buff_idx++] = 0x00; @@ -117,7 +117,7 @@ static cassette_image::error tvc64_cassette_load(cassette_image *cassette) tmp_buff[buff_idx++] = 0x00; // no last sector // updates the header CRC - UINT16 crc = tvc64_calc_crc(tmp_buff, buff_idx); + uint16_t crc = tvc64_calc_crc(tmp_buff, buff_idx); tmp_buff[buff_idx++] = crc & 0xff; tmp_buff[buff_idx++] = (crc>>8) & 0xff; @@ -155,9 +155,9 @@ static cassette_image::error tvc64_cassette_load(cassette_image *cassette) tmp_buff[buff_idx++] = 0x00; // data sector tmp_buff[buff_idx++] = 0x11; // not puffered tmp_buff[buff_idx++] = 0x00; // not write protected - tmp_buff[buff_idx++] = (UINT8)((cas_size / 256) + ((cas_size % 256) > 0 ? 1 : 0)); // number of sectors + tmp_buff[buff_idx++] = (uint8_t)((cas_size / 256) + ((cas_size % 256) > 0 ? 1 : 0)); // number of sectors - UINT8 sect_num = 1; + uint8_t sect_num = 1; int sector_num = cas_size / 256; for (int i=0; i<=sector_num; i++) { @@ -202,7 +202,7 @@ static cassette_image::error tvc64_cassette_load(cassette_image *cassette) static cassette_image::error tvc64_cassette_identify(cassette_image *cassette, struct CassetteOptions *opts) { - UINT8 byte; + uint8_t byte; cassette_image_read(cassette, &byte, 0, 1); if (byte == 0x11) diff --git a/src/lib/formats/tzx_cas.cpp b/src/lib/formats/tzx_cas.cpp index bf8142f9b95..748f0227c65 100644 --- a/src/lib/formats/tzx_cas.cpp +++ b/src/lib/formats/tzx_cas.cpp @@ -56,7 +56,7 @@ We are currently using the numbers from the TZX specification... #define INITIAL_MAX_BLOCK_COUNT 256 #define BLOCK_COUNT_INCREMENTS 256 -static const UINT8 TZX_HEADER[8] = { 'Z','X','T','a','p','e','!',0x1a }; +static const uint8_t TZX_HEADER[8] = { 'Z','X','T','a','p','e','!',0x1a }; /* Global variables @@ -64,9 +64,9 @@ static const UINT8 TZX_HEADER[8] = { 'Z','X','T','a','p','e','!',0x1a }; Initialized by tzx_cas_get_wave_size, used (and cleaned up) by tzx_cas_fill_wave */ -static INT16 wave_data = 0; +static int16_t wave_data = 0; static int block_count = 0; -static UINT8** blocks = nullptr; +static uint8_t** blocks = nullptr; static float t_scale = 1; /* for scaling T-states to the 4MHz CPC */ static void toggle_wave_data(void) @@ -81,32 +81,32 @@ static void toggle_wave_data(void) } } -static void tzx_cas_get_blocks( const UINT8 *casdata, int caslen ) +static void tzx_cas_get_blocks( const uint8_t *casdata, int caslen ) { int pos = sizeof(TZX_HEADER) + 2; int max_block_count = INITIAL_MAX_BLOCK_COUNT; int loopcount = 0, loopoffset = 0; - blocks = (UINT8**)malloc(max_block_count * sizeof(UINT8*)); + blocks = (uint8_t**)malloc(max_block_count * sizeof(uint8_t*)); memset(blocks,0,max_block_count); block_count = 0; while (pos < caslen) { - UINT32 datasize; - UINT8 blocktype = casdata[pos]; + uint32_t datasize; + uint8_t blocktype = casdata[pos]; if (block_count == max_block_count) { void *old_blocks = blocks; int old_max_block_count = max_block_count; max_block_count = max_block_count + BLOCK_COUNT_INCREMENTS; - blocks = (UINT8**)malloc(max_block_count * sizeof(UINT8*)); // SHOULD NOT BE USING auto_alloc_array() + blocks = (uint8_t**)malloc(max_block_count * sizeof(uint8_t*)); // SHOULD NOT BE USING auto_alloc_array() memset(blocks, 0, max_block_count); - memcpy(blocks, old_blocks, old_max_block_count * sizeof(UINT8*)); + memcpy(blocks, old_blocks, old_max_block_count * sizeof(uint8_t*)); free(old_blocks); } - blocks[block_count] = (UINT8*)&casdata[pos]; + blocks[block_count] = (uint8_t*)&casdata[pos]; pos += 1; @@ -217,7 +217,7 @@ static inline int tcycles_to_samplecount( int tcycles ) return (int) ((0.5 + (((double)TZX_WAV_FREQUENCY / 3500000) * (double)tcycles)) * (double) t_scale); } -static void tzx_output_wave( INT16 **buffer, int length ) +static void tzx_output_wave( int16_t **buffer, int length ) { if (buffer == nullptr) { @@ -231,7 +231,7 @@ static void tzx_output_wave( INT16 **buffer, int length ) } } -static int tzx_cas_handle_block( INT16 **buffer, const UINT8 *bytes, int pause, int data_size, int pilot, int pilot_length, int sync1, int sync2, int bit0, int bit1, int bits_in_last_byte ) +static int tzx_cas_handle_block( int16_t **buffer, const uint8_t *bytes, int pause, int data_size, int pilot, int pilot_length, int sync1, int sync2, int bit0, int bit1, int bits_in_last_byte ) { int pilot_samples = tcycles_to_samplecount(pilot); int sync1_samples = tcycles_to_samplecount(sync1); @@ -268,7 +268,7 @@ static int tzx_cas_handle_block( INT16 **buffer, const UINT8 *bytes, int pause, /* data */ for (data_index = 0; data_index < data_size; data_index++) { - UINT8 byte = bytes[data_index]; + uint8_t byte = bytes[data_index]; int bits_to_go = (data_index == (data_size - 1)) ? bits_in_last_byte : 8; for ( ; bits_to_go > 0; byte <<= 1, bits_to_go--) @@ -297,7 +297,7 @@ static int tzx_cas_handle_block( INT16 **buffer, const UINT8 *bytes, int pause, return size; } -static int tzx_handle_direct(INT16 **buffer, const UINT8 *bytes, int pause, int data_size, int tstates, int bits_in_last_byte) +static int tzx_handle_direct(int16_t **buffer, const uint8_t *bytes, int pause, int data_size, int tstates, int bits_in_last_byte) { int size = 0; int samples = tcycles_to_samplecount(tstates); @@ -305,7 +305,7 @@ static int tzx_handle_direct(INT16 **buffer, const UINT8 *bytes, int pause, int /* data */ for (int data_index = 0; data_index < data_size; data_index++) { - UINT8 byte = bytes[data_index]; + uint8_t byte = bytes[data_index]; int bits_to_go = (data_index == (data_size - 1)) ? bits_in_last_byte : 8; for ( ; bits_to_go > 0; byte <<= 1, bits_to_go--) @@ -335,12 +335,12 @@ static int tzx_handle_direct(INT16 **buffer, const UINT8 *bytes, int pause, int } -static inline int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol, int maxp) +static inline int tzx_handle_symbol(int16_t **buffer, const uint8_t *symtable, uint8_t symbol, int maxp) { int size = 0; - const UINT8 *cursymb = symtable + (2 * maxp + 1)*symbol; + const uint8_t *cursymb = symtable + (2 * maxp + 1)*symbol; - UINT8 starttype = cursymb[0]; + uint8_t starttype = cursymb[0]; // printf("start polarity %01x (max number of symbols is %d)\n", starttype, maxp); @@ -370,7 +370,7 @@ static inline int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 for (int i = 0; i < maxp; i++) { - UINT16 pulse_length = cursymb[1 + (i*2)] | (cursymb[2 + (i*2)] << 8); + uint16_t pulse_length = cursymb[1 + (i*2)] | (cursymb[2 + (i*2)] << 8); // printf("pulse_length %04x\n", pulse_length); // shorter lists can be terminated with a pulse_length of 0 @@ -395,12 +395,12 @@ static inline int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 return size; } -static inline int stream_get_bit(const UINT8 *bytes, UINT8 &stream_bit, UINT32 &stream_byte) +static inline int stream_get_bit(const uint8_t *bytes, uint8_t &stream_bit, uint32_t &stream_byte) { // get bit here - UINT8 retbit = 0; + uint8_t retbit = 0; - UINT8 byte = bytes[stream_byte]; + uint8_t byte = bytes[stream_byte]; byte = byte << stream_bit; if (byte & 0x80) retbit = 1; @@ -417,7 +417,7 @@ static inline int stream_get_bit(const UINT8 *bytes, UINT8 &stream_bit, UINT32 & return retbit; } -static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause, int data_size, UINT32 totp, int npp, int asp, UINT32 totd, int npd, int asd ) +static int tzx_handle_generalized(int16_t **buffer, const uint8_t *bytes, int pause, int data_size, uint32_t totp, int npp, int asp, uint32_t totd, int npd, int asd ) { int size = 0; @@ -425,14 +425,14 @@ static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause, { // printf("pilot block table %04x\n", totp); - const UINT8 *symtable = bytes; - const UINT8 *table2 = symtable + (2 * npp + 1)*asp; + const uint8_t *symtable = bytes; + const uint8_t *table2 = symtable + (2 * npp + 1)*asp; // the Pilot and sync data stream has an RLE encoding for (int i = 0; i < totp; i+=3) { - UINT8 symbol = table2[i + 0]; - UINT16 repetitions = table2[i + 1] + (table2[i + 2] << 8); + uint8_t symbol = table2[i + 0]; + uint16_t repetitions = table2[i + 1] + (table2[i + 2] << 8); //printf("symbol %02x repititions %04x\n", symbol, repetitions); // does 1 mean repeat once, or that it only occurs once? for (int j = 0; j < repetitions; j++) @@ -456,18 +456,18 @@ static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause, { printf("data block table %04x (has %0d symbols, max symbol length is %d)\n", totd, asd, npd); - const UINT8 *symtable = bytes; - const UINT8 *table2 = bytes + (2 * npd + 1)*asd; + const uint8_t *symtable = bytes; + const uint8_t *table2 = bytes + (2 * npd + 1)*asd; int NB = ceil(compute_log2(asd)); // number of bits needed to represent each symbol printf("NB is %d\n", NB); - UINT8 stream_bit = 0; - UINT32 stream_byte = 0; + uint8_t stream_bit = 0; + uint32_t stream_byte = 0; for (int i = 0; i < totd; i++) { - UINT8 symbol = 0; + uint8_t symbol = 0; for (int j = 0; j < NB; j++) { @@ -503,7 +503,7 @@ static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause, -static void ascii_block_common_log( const char *block_type_string, UINT8 block_type ) +static void ascii_block_common_log( const char *block_type_string, uint8_t block_type ) { LOG_FORMATS("%s (type %02x) encountered.\n", block_type_string, block_type); LOG_FORMATS("This block contains info on the .tzx file you are loading.\n"); @@ -533,7 +533,7 @@ static const char *const hw_info[] = /* Will go through blocks and calculate number of samples needed. If buffer is not nullptr the sample data will also be written. */ -static int tzx_cas_do_work( INT16 **buffer ) +static int tzx_cas_do_work( int16_t **buffer ) { int current_block = 0; int size = 0; @@ -545,13 +545,13 @@ static int tzx_cas_do_work( INT16 **buffer ) while (current_block < block_count) { int pause_time; - UINT32 data_size; + uint32_t data_size; int text_size, total_size, i; int pilot, pilot_length, sync1, sync2; int bit0, bit1, bits_in_last_byte; - UINT8 *cur_block = blocks[current_block]; - UINT8 block_type = cur_block[0]; - UINT16 tstates = 0; + uint8_t *cur_block = blocks[current_block]; + uint8_t block_type = cur_block[0]; + uint16_t tstates = 0; /* Uncomment this to include into error.log a list of the types each block */ LOG_FORMATS("tzx_cas_fill_wave: block %d, block_type %02x\n", current_block, block_type); @@ -749,12 +749,12 @@ static int tzx_cas_do_work( INT16 **buffer ) data_size = cur_block[1] + (cur_block[2] << 8) + (cur_block[3] << 16) + (cur_block[4] << 24); pause_time= cur_block[5] + (cur_block[6] << 8); - UINT32 totp = cur_block[7] + (cur_block[8] << 8) + (cur_block[9] << 16) + (cur_block[10] << 24); + uint32_t totp = cur_block[7] + (cur_block[8] << 8) + (cur_block[9] << 16) + (cur_block[10] << 24); int npp = cur_block[11]; int asp = cur_block[12]; if (asp == 0) asp = 256; - UINT32 totd = cur_block[13] + (cur_block[14] << 8) + (cur_block[15] << 16) + (cur_block[16] << 24); + uint32_t totd = cur_block[13] + (cur_block[14] << 8) + (cur_block[15] << 16) + (cur_block[16] << 24); int npd = cur_block[17]; int asd = cur_block[18]; if (asd == 0) asd = 256; @@ -770,7 +770,7 @@ static int tzx_cas_do_work( INT16 **buffer ) return size; } -static int tzx_cas_to_wav_size( const UINT8 *casdata, int caslen ) +static int tzx_cas_to_wav_size( const uint8_t *casdata, int caslen ) { int size = 0; @@ -813,28 +813,28 @@ cleanup: return -1; } -static int tzx_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) +static int tzx_cas_fill_wave( int16_t *buffer, int length, uint8_t *bytes ) { - INT16 *p = buffer; + int16_t *p = buffer; int size = 0; t_scale = 1.0; size = tzx_cas_do_work(&p); return size; } -static int cdt_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) +static int cdt_cas_fill_wave( int16_t *buffer, int length, uint8_t *bytes ) { - INT16 *p = buffer; + int16_t *p = buffer; int size = 0; t_scale = (40 / 35); /* scale to 4MHz */ size = tzx_cas_do_work(&p); return size; } -static int tap_cas_to_wav_size( const UINT8 *casdata, int caslen ) +static int tap_cas_to_wav_size( const uint8_t *casdata, int caslen ) { int size = 0; - const UINT8 *p = casdata; + const uint8_t *p = casdata; while (p < casdata + caslen) { @@ -850,9 +850,9 @@ static int tap_cas_to_wav_size( const UINT8 *casdata, int caslen ) return size; } -static int tap_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) +static int tap_cas_fill_wave( int16_t *buffer, int length, uint8_t *bytes ) { - INT16 *p = buffer; + int16_t *p = buffer; int size = 0; while (size < length) diff --git a/src/lib/formats/uef_cas.cpp b/src/lib/formats/uef_cas.cpp index 39a03349bc2..d3b95022f9e 100644 --- a/src/lib/formats/uef_cas.cpp +++ b/src/lib/formats/uef_cas.cpp @@ -31,8 +31,8 @@ Not nice, but it works... #define WAVE_HIGH 32767 #define WAVE_NULL 0 -static const UINT8 UEF_HEADER[10] = { 0x55, 0x45, 0x46, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x21, 0x00 }; -static const UINT8 GZ_HEADER[2] = { 0x1f, 0x8b }; +static const uint8_t UEF_HEADER[10] = { 0x55, 0x45, 0x46, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x21, 0x00 }; +static const uint8_t GZ_HEADER[2] = { 0x1f, 0x8b }; /* bytes are stored as @@ -49,8 +49,8 @@ static const UINT8 GZ_HEADER[2] = { 0x1f, 0x8b }; #define COMMENT 0x10 /* bit 4 set: file comment present */ #define RESERVED 0xE0 /* bits 5..7: reserved */ -static const UINT8* skip_gz_header( const UINT8 *p ) { - UINT8 method, flags; +static const uint8_t* skip_gz_header( const uint8_t *p ) { + uint8_t method, flags; /* skip initial 1f 8b header */ p += 2; /* get method and flags */ @@ -82,9 +82,9 @@ static const UINT8* skip_gz_header( const UINT8 *p ) { return p; } -static UINT8 *gz_ptr = nullptr; +static uint8_t *gz_ptr = nullptr; -static float get_uef_float( const UINT8 *Float) +static float get_uef_float( const uint8_t *Float) { int Mantissa; float Result; @@ -112,19 +112,19 @@ static float get_uef_float( const UINT8 *Float) return Result; } -static int uef_cas_to_wav_size( const UINT8 *casdata, int caslen ) { +static int uef_cas_to_wav_size( const uint8_t *casdata, int caslen ) { int pos, size; if ( casdata[0] == 0x1f && casdata[1] == 0x8b ) { int err; z_stream d_stream; int inflate_size = ( casdata[ caslen - 1 ] << 24 ) | ( casdata[ caslen - 2 ] << 16 ) | ( casdata[ caslen - 3 ] << 8 ) | casdata[ caslen - 4 ]; - const UINT8 *in_ptr = skip_gz_header( casdata ); + const uint8_t *in_ptr = skip_gz_header( casdata ); if ( in_ptr == nullptr ) { goto cleanup; } - gz_ptr = (UINT8 *)malloc( inflate_size ); + gz_ptr = (uint8_t *)malloc( inflate_size ); d_stream.zalloc = nullptr; d_stream.zfree = nullptr; @@ -222,7 +222,7 @@ cleanup: return -1; } -static INT16* uef_cas_fill_bit( INT16 *buffer, int bit ) { +static int16_t* uef_cas_fill_bit( int16_t *buffer, int bit ) { if ( bit ) { *buffer = WAVE_LOW; buffer++; *buffer = WAVE_HIGH; buffer++; @@ -237,9 +237,9 @@ static INT16* uef_cas_fill_bit( INT16 *buffer, int bit ) { return buffer; } -static int uef_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) { +static int uef_cas_fill_wave( int16_t *buffer, int length, uint8_t *bytes ) { int pos; - INT16 *p = buffer; + int16_t *p = buffer; if ( bytes[0] == 0x1f && bytes[1] == 0x8b ) { if ( gz_ptr == nullptr ) { @@ -255,12 +255,12 @@ static int uef_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) { int chunk_length = ( bytes[pos+5] << 24 ) | ( bytes[pos+4] << 16 ) | ( bytes[pos+3] << 8 ) | bytes[pos+2]; int baud_length, i, j; - UINT8 *c; + uint8_t *c; pos += 6; switch( chunk_type ) { case 0x0100: /* implicit start/stop bit data block */ for( j = 0; j < chunk_length; j++ ) { - UINT8 byte = bytes[pos+j]; + uint8_t byte = bytes[pos+j]; p = uef_cas_fill_bit( p, 0 ); for( i = 0; i < 8; i++ ) { p = uef_cas_fill_bit( p, byte & 1 ); @@ -278,7 +278,7 @@ static int uef_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) { j = ( chunk_length * 10 ) - bytes[pos]; c = bytes + pos; while( j ) { - UINT8 byte = *c; + uint8_t byte = *c; for( i = 0; i < 8 && i < j; i++ ) { p = uef_cas_fill_bit( p, byte & 1 ); byte = byte >> 1; @@ -324,7 +324,7 @@ static const struct CassetteLegacyWaveFiller uef_legacy_fill_wave = { }; static cassette_image::error uef_cassette_identify( cassette_image *cassette, struct CassetteOptions *opts ) { - UINT8 header[10]; + uint8_t header[10]; cassette_image_read(cassette, header, 0, sizeof(header)); if (memcmp(&header[0], GZ_HEADER, sizeof(GZ_HEADER)) && memcmp(&header[0], UEF_HEADER, sizeof(UEF_HEADER))) { diff --git a/src/lib/formats/upd765_dsk.cpp b/src/lib/formats/upd765_dsk.cpp index 97d0daa7d6a..ae11f7080dc 100644 --- a/src/lib/formats/upd765_dsk.cpp +++ b/src/lib/formats/upd765_dsk.cpp @@ -16,21 +16,21 @@ upd765_format::upd765_format(const format *_formats) formats = _formats; } -int upd765_format::find_size(io_generic *io, UINT32 form_factor) const +int upd765_format::find_size(io_generic *io, uint32_t form_factor) const { - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for(int i=0; formats[i].form_factor; i++) { const format &f = formats[i]; if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor) continue; - if(size == (UINT64) compute_track_size(f) * f.track_count * f.head_count) + if(size == (uint64_t) compute_track_size(f) * f.track_count * f.head_count) return i; } return -1; } -int upd765_format::identify(io_generic *io, UINT32 form_factor) +int upd765_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -52,7 +52,7 @@ int upd765_format::compute_track_size(const format &f) const return track_size; } -void upd765_format::build_sector_description(const format &f, UINT8 *sectdata, desc_s *sectors, int track, int head) const +void upd765_format::build_sector_description(const format &f, uint8_t *sectdata, desc_s *sectors, int track, int head) const { if(f.sector_base_id == -1) { for(int i=0; i &candidates) { - UINT8 bitstream[500000/8]; - UINT8 sectdata[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectdata[50000]; desc_xs sectors[256]; int track_size; @@ -406,8 +406,8 @@ void upd765_format::check_compatibility(floppy_image *image, std::vector &c void upd765_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head) { - UINT8 bitstream[500000/8]; - UINT8 sectdata[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectdata[50000]; desc_xs sectors[256]; int track_size; @@ -431,7 +431,7 @@ void upd765_format::extract_sectors(floppy_image *image, const format &f, desc_s memset((void *)ds.data, 0, ds.size); else if(xs.size < ds.size) { memcpy((void *)ds.data, xs.data, xs.size); - memset((UINT8 *)ds.data + xs.size, 0, xs.size - ds.size); + memset((uint8_t *)ds.data + xs.size, 0, xs.size - ds.size); } else memcpy((void *)ds.data, xs.data, ds.size); } diff --git a/src/lib/formats/upd765_dsk.h b/src/lib/formats/upd765_dsk.h index a108931d89b..5bd675de9e8 100644 --- a/src/lib/formats/upd765_dsk.h +++ b/src/lib/formats/upd765_dsk.h @@ -17,9 +17,9 @@ class upd765_format : public floppy_image_format_t { public: struct format { - UINT32 form_factor; // See floppy_image for possible values - UINT32 variant; // See floppy_image for possible values - UINT32 encoding; // See floppy_image for possible values + uint32_t form_factor; // See floppy_image for possible values + uint32_t variant; // See floppy_image for possible values + uint32_t encoding; // See floppy_image for possible values int cell_size; // See floppy_image_format_t for details int sector_count; @@ -38,17 +38,17 @@ public: // End the array with {} upd765_format(const format *formats); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual bool supports_save() const override; protected: floppy_image_format_t::desc_e* get_desc_fm(const format &f, int ¤t_size, int &end_gap_index); floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index); - int find_size(io_generic *io, UINT32 form_factor) const; + int find_size(io_generic *io, uint32_t form_factor) const; int compute_track_size(const format &f) const; - virtual void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors, int track, int head) const; + virtual void build_sector_description(const format &d, uint8_t *sectdata, desc_s *sectors, int track, int head) const; void check_compatibility(floppy_image *image, std::vector &candidates); void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head); diff --git a/src/lib/formats/vdk_dsk.cpp b/src/lib/formats/vdk_dsk.cpp index 896815c26ad..308f544e2d3 100644 --- a/src/lib/formats/vdk_dsk.cpp +++ b/src/lib/formats/vdk_dsk.cpp @@ -32,9 +32,9 @@ const char *vdk_format::extensions() const return "vdk"; } -int vdk_format::identify(io_generic *io, UINT32 form_factor) +int vdk_format::identify(io_generic *io, uint32_t form_factor) { - UINT8 id[2]; + uint8_t id[2]; io_generic_read(io, id, 0, 2); if (id[0] == 'd' && id[1] == 'k') @@ -43,9 +43,9 @@ int vdk_format::identify(io_generic *io, UINT32 form_factor) return 0; } -bool vdk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool vdk_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { - UINT8 header[0x100]; + uint8_t header[0x100]; io_generic_read(io, header, 0, 0x100); int header_size = header[3] * 0x100 + header[2]; @@ -59,7 +59,7 @@ bool vdk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) for (int head = 0; head < head_count ; head++) { desc_pc_sector sectors[SECTOR_COUNT]; - UINT8 sector_data[SECTOR_COUNT * SECTOR_SIZE]; + uint8_t sector_data[SECTOR_COUNT * SECTOR_SIZE]; int sector_offset = 0; for (int i = 0; i < SECTOR_COUNT; i++) @@ -88,16 +88,16 @@ bool vdk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) bool vdk_format::save(io_generic *io, floppy_image *image) { - UINT8 bitstream[500000/8]; - UINT8 sector_data[50000]; + uint8_t bitstream[500000/8]; + uint8_t sector_data[50000]; desc_xs sectors[256]; - UINT64 file_offset = 0; + uint64_t file_offset = 0; int track_count, head_count; image->get_actual_geometry(track_count, head_count); // write header - UINT8 header[12]; + uint8_t header[12]; header[0] = 'd'; header[1] = 'k'; diff --git a/src/lib/formats/vdk_dsk.h b/src/lib/formats/vdk_dsk.h index b685cb32f8b..270c1ff9071 100644 --- a/src/lib/formats/vdk_dsk.h +++ b/src/lib/formats/vdk_dsk.h @@ -26,8 +26,8 @@ public: virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual bool supports_save() const override; diff --git a/src/lib/formats/vg5k_cas.cpp b/src/lib/formats/vg5k_cas.cpp index 2c298f79304..898507e7139 100644 --- a/src/lib/formats/vg5k_cas.cpp +++ b/src/lib/formats/vg5k_cas.cpp @@ -20,7 +20,7 @@ static int k7_size; /******************************************************************* Generate one high-low cycle of sample data ********************************************************************/ -static inline int vg5k_cas_cycle(INT16 *buffer, int sample_pos, int len) +static inline int vg5k_cas_cycle(int16_t *buffer, int sample_pos, int len) { int i = 0; @@ -45,7 +45,7 @@ static inline int vg5k_cas_cycle(INT16 *buffer, int sample_pos, int len) /******************************************************************* Generate n samples of silence ********************************************************************/ -static inline int vg5k_cas_silence(INT16 *buffer, int sample_pos, int len) +static inline int vg5k_cas_silence(int16_t *buffer, int sample_pos, int len) { int i = 0; @@ -60,7 +60,7 @@ static inline int vg5k_cas_silence(INT16 *buffer, int sample_pos, int len) /******************************************************************* Generate the end-byte samples ********************************************************************/ -static inline int vg5k_cas_eob(INT16 *buffer, int sample_pos) +static inline int vg5k_cas_eob(int16_t *buffer, int sample_pos) { int i, samples = 0; @@ -73,7 +73,7 @@ static inline int vg5k_cas_eob(INT16 *buffer, int sample_pos) } -static inline int vg5k_cas_byte(INT16 *buffer, int sample_pos, UINT8 data) +static inline int vg5k_cas_byte(int16_t *buffer, int sample_pos, uint8_t data) { /* Writing an entire byte */ int i, samples; @@ -100,7 +100,7 @@ static inline int vg5k_cas_byte(INT16 *buffer, int sample_pos, UINT8 data) /******************************************************************* Generate n sample of synchro ********************************************************************/ -static inline int vg5k_k7_synchro(INT16 *buffer, int sample_pos, int len) +static inline int vg5k_k7_synchro(int16_t *buffer, int sample_pos, int len) { int i, samples = 0; @@ -113,7 +113,7 @@ static inline int vg5k_k7_synchro(INT16 *buffer, int sample_pos, int len) } -static int vg5k_handle_tap(INT16 *buffer, const UINT8 *casdata) +static int vg5k_handle_tap(int16_t *buffer, const uint8_t *casdata) { int data_pos, sample_count; @@ -127,7 +127,7 @@ static int vg5k_handle_tap(INT16 *buffer, const UINT8 *casdata) /* on the entire file*/ while( data_pos < k7_size ) { - UINT16 block_size = 0; + uint16_t block_size = 0; /* Identify type of block */ if (casdata[data_pos] == 0xd3) @@ -183,7 +183,7 @@ static int vg5k_handle_tap(INT16 *buffer, const UINT8 *casdata) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int vg5k_k7_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int vg5k_k7_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return vg5k_handle_tap(buffer, bytes); } @@ -192,7 +192,7 @@ static int vg5k_k7_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) /******************************************************************* Calculate the number of samples needed for this tape image classical ********************************************************************/ -static int vg5k_k7_to_wav_size(const UINT8 *casdata, int caslen) +static int vg5k_k7_to_wav_size(const uint8_t *casdata, int caslen) { k7_size = caslen ; diff --git a/src/lib/formats/victor9k_dsk.cpp b/src/lib/formats/victor9k_dsk.cpp index 5f0936a8048..1fbba7502be 100644 --- a/src/lib/formats/victor9k_dsk.cpp +++ b/src/lib/formats/victor9k_dsk.cpp @@ -119,18 +119,18 @@ const char *victor9k_format::extensions() const return "img"; } -int victor9k_format::find_size(io_generic *io, UINT32 form_factor) +int victor9k_format::find_size(io_generic *io, uint32_t form_factor) { - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for(int i=0; formats[i].sector_count; i++) { const format &f = formats[i]; - if(size == (UINT32) f.sector_count*f.sector_base_size*f.head_count) + if(size == (uint32_t) f.sector_count*f.sector_base_size*f.head_count) return i; } return -1; } -int victor9k_format::identify(io_generic *io, UINT32 form_factor) +int victor9k_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -140,7 +140,7 @@ int victor9k_format::identify(io_generic *io, UINT32 form_factor) return 0; } -void victor9k_format::log_boot_sector(UINT8 *data) +void victor9k_format::log_boot_sector(uint8_t *data) { // System disc ID osd_printf_verbose("System disc: %s\n", ((data[0] == 0xff) && (data[1] == 0x00)) ? "yes" : "no"); @@ -237,7 +237,7 @@ floppy_image_format_t::desc_e* victor9k_format::get_sector_desc(const format &f, return desc; } -void victor9k_format::build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, desc_s *sectors, int sector_count) const +void victor9k_format::build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, desc_s *sectors, int sector_count) const { for (int i = 0; i < sector_count; i++) { sectors[i].data = sectdata + sect_offs; @@ -248,7 +248,7 @@ void victor9k_format::build_sector_description(const format &f, UINT8 *sectdata, } } -bool victor9k_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) +bool victor9k_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) { int type = find_size(io, form_factor); if(type == -1) @@ -256,8 +256,8 @@ bool victor9k_format::load(io_generic *io, UINT32 form_factor, floppy_image *ima const format &f = formats[type]; - UINT64 size = io_generic_size(io); - std::vector img; + uint64_t size = io_generic_size(io); + std::vector img; img.resize(size); io_generic_read(io, &img[0], 0, size); @@ -332,7 +332,7 @@ const victor9k_format::format victor9k_format::formats[] = { {} }; -const UINT32 victor9k_format::cell_size[9] = +const uint32_t victor9k_format::cell_size[9] = { 1789, 1896, 2009, 2130, 2272, 2428, 2613, 2847, 2961 }; @@ -398,7 +398,7 @@ bool victor9k_format::save(io_generic *io, floppy_image *image) for(int track=0; track < f.track_count; track++) { int sector_count = sectors_per_track[head][track]; int track_size = compute_track_size(f, head, track); - UINT8 sectdata[40*512]; + uint8_t sectdata[40*512]; desc_s sectors[40]; int offset = get_image_offset(f, head, track); @@ -413,8 +413,8 @@ bool victor9k_format::save(io_generic *io, floppy_image *image) void victor9k_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count) { - UINT8 bitstream[500000/8]; - UINT8 sectdata[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectdata[50000]; desc_xs sectors[256]; int track_size; @@ -429,7 +429,7 @@ void victor9k_format::extract_sectors(floppy_image *image, const format &f, desc memset((void *)ds.data, 0, ds.size); else if(xs.size < ds.size) { memcpy((void *)ds.data, xs.data, xs.size); - memset((UINT8 *)ds.data + xs.size, 0, xs.size - ds.size); + memset((uint8_t *)ds.data + xs.size, 0, xs.size - ds.size); } else memcpy((void *)ds.data, xs.data, ds.size); } diff --git a/src/lib/formats/victor9k_dsk.h b/src/lib/formats/victor9k_dsk.h index c463803b781..0c3f89c9f59 100644 --- a/src/lib/formats/victor9k_dsk.h +++ b/src/lib/formats/victor9k_dsk.h @@ -18,13 +18,13 @@ class victor9k_format : public floppy_image_format_t { public: struct format { - UINT32 form_factor; // See floppy_image for possible values - UINT32 variant; // See floppy_image for possible values + uint32_t form_factor; // See floppy_image for possible values + uint32_t variant; // See floppy_image for possible values - UINT16 sector_count; - UINT8 track_count; - UINT8 head_count; - UINT16 sector_base_size; + uint16_t sector_count; + uint8_t track_count; + uint8_t head_count; + uint16_t sector_base_size; }; victor9k_format(); @@ -33,8 +33,8 @@ public: virtual const char *description() const override; virtual const char *extensions() const override; - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual bool supports_save() const override { return true; } @@ -43,15 +43,15 @@ public: protected: static const format formats[]; - static const UINT32 cell_size[9]; + static const uint32_t cell_size[9]; static const int sectors_per_track[2][80]; static const int speed_zone[2][80]; static const int rpm[9]; - int find_size(io_generic *io, UINT32 form_factor); - void log_boot_sector(UINT8 *data); + int find_size(io_generic *io, uint32_t form_factor); + void log_boot_sector(uint8_t *data); floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count); - void build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, desc_s *sectors, int sector_count) const; + void build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, desc_s *sectors, int sector_count) const; int get_image_offset(const format &f, int head, int track); int compute_track_size(const format &f, int head, int track); void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count); diff --git a/src/lib/formats/vt_cas.cpp b/src/lib/formats/vt_cas.cpp index d3284d4d301..9dbc68f8074 100644 --- a/src/lib/formats/vt_cas.cpp +++ b/src/lib/formats/vt_cas.cpp @@ -10,7 +10,7 @@ #define SILENCE 8000 -static int generic_fill_wave(INT16 *buffer, int length, UINT8 *code, int bitsamples, int bytesamples, int lo, INT16 *(*fill_wave_byte)(INT16 *buffer, int byte)) +static int generic_fill_wave(int16_t *buffer, int length, uint8_t *code, int bitsamples, int bytesamples, int lo, int16_t *(*fill_wave_byte)(int16_t *buffer, int byte)) { static int nullbyte; @@ -66,7 +66,7 @@ static int generic_fill_wave(INT16 *buffer, int length, UINT8 *code, int bitsamp #define V1_BITSAMPLES 6 #define V1_BYTESAMPLES 8*V1_BITSAMPLES -static INT16 *vtech1_fill_wave_byte(INT16 *buffer, int byte) +static int16_t *vtech1_fill_wave_byte(int16_t *buffer, int byte) { int i; @@ -92,7 +92,7 @@ static INT16 *vtech1_fill_wave_byte(INT16 *buffer, int byte) return buffer; } -static int vtech1_cassette_fill_wave(INT16 *buffer, int length, UINT8 *code) +static int vtech1_cassette_fill_wave(int16_t *buffer, int length, uint8_t *code) { return generic_fill_wave(buffer, length, code, V1_BITSAMPLES, V1_BYTESAMPLES, V1_LO, vtech1_fill_wave_byte); } @@ -140,7 +140,7 @@ CASSETTE_FORMATLIST_END #define VT2_BITSAMPLES 18 #define VT2_BYTESAMPLES 8*VT2_BITSAMPLES -static const INT16 vtech2_bit0[VT2_BITSAMPLES] = +static const int16_t vtech2_bit0[VT2_BITSAMPLES] = { /* short cycle, long cycles */ VT2_HI,VT2_HI,VT2_HI,VT2_LO,VT2_LO,VT2_LO, @@ -148,7 +148,7 @@ static const INT16 vtech2_bit0[VT2_BITSAMPLES] = VT2_LO,VT2_LO,VT2_LO,VT2_LO,VT2_LO,VT2_LO }; -static const INT16 vtech2_bit1[VT2_BITSAMPLES] = +static const int16_t vtech2_bit1[VT2_BITSAMPLES] = { /* three short cycle */ VT2_HI,VT2_HI,VT2_HI,VT2_LO,VT2_LO,VT2_LO, @@ -157,7 +157,7 @@ static const INT16 vtech2_bit1[VT2_BITSAMPLES] = }; -static INT16 *vtech2_fill_wave_bit(INT16 *buffer, int bit) +static int16_t *vtech2_fill_wave_bit(int16_t *buffer, int bit) { int i; if( bit ) @@ -174,7 +174,7 @@ static INT16 *vtech2_fill_wave_bit(INT16 *buffer, int bit) } -static INT16 *vtech2_fill_wave_byte(INT16 *buffer, int byte) +static int16_t *vtech2_fill_wave_byte(int16_t *buffer, int byte) { buffer = vtech2_fill_wave_bit(buffer, (byte >> 7) & 1); buffer = vtech2_fill_wave_bit(buffer, (byte >> 6) & 1); @@ -187,7 +187,7 @@ static INT16 *vtech2_fill_wave_byte(INT16 *buffer, int byte) return buffer; } -static int vtech2_cassette_fill_wave(INT16 *buffer, int length, UINT8 *code) +static int vtech2_cassette_fill_wave(int16_t *buffer, int length, uint8_t *code) { return generic_fill_wave(buffer, length, code, VT2_BITSAMPLES, VT2_BYTESAMPLES, VT2_LO, vtech2_fill_wave_byte); } diff --git a/src/lib/formats/wavfile.cpp b/src/lib/formats/wavfile.cpp index 70fb992c97a..29f33c4102b 100644 --- a/src/lib/formats/wavfile.cpp +++ b/src/lib/formats/wavfile.cpp @@ -23,25 +23,25 @@ static const char data_tag_id[4] = { 'd', 'a', 't', 'a' }; -static UINT32 get_leuint32(const void *ptr) +static uint32_t get_leuint32(const void *ptr) { - UINT32 value; + uint32_t value; memcpy(&value, ptr, sizeof(value)); return little_endianize_int32(value); } -static UINT16 get_leuint16(const void *ptr) +static uint16_t get_leuint16(const void *ptr) { - UINT16 value; + uint16_t value; memcpy(&value, ptr, sizeof(value)); return little_endianize_int16(value); } -static void put_leuint32(void *ptr, UINT32 value) +static void put_leuint32(void *ptr, uint32_t value) { value = little_endianize_int32(value); memcpy(ptr, &value, sizeof(value)); @@ -49,7 +49,7 @@ static void put_leuint32(void *ptr, UINT32 value) -static void put_leuint16(void *ptr, UINT16 value) +static void put_leuint16(void *ptr, uint16_t value) { value = little_endianize_int16(value); memcpy(ptr, &value, sizeof(value)); @@ -60,19 +60,19 @@ static void put_leuint16(void *ptr, UINT16 value) static cassette_image::error wavfile_process(cassette_image *cassette, struct CassetteOptions *opts, int read_waveform) { - UINT8 file_header[12]; - UINT8 tag_header[8]; - UINT8 format_tag[16]; - UINT32 stated_size; - UINT64 file_size; - UINT32 tag_size; - UINT32 tag_samples; - UINT64 offset; + uint8_t file_header[12]; + uint8_t tag_header[8]; + uint8_t format_tag[16]; + uint32_t stated_size; + uint64_t file_size; + uint32_t tag_size; + uint32_t tag_samples; + uint64_t offset; int format_specified = FALSE; - UINT16 format_type = 0; - UINT32 bytes_per_second = 0; -// UINT16 block_align = 0; + uint16_t format_type = 0; + uint32_t bytes_per_second = 0; +// uint16_t block_align = 0; int waveform_flags = 0; /* read header */ @@ -89,7 +89,7 @@ static cassette_image::error wavfile_process(cassette_image *cassette, struct Ca stated_size = get_leuint32(&file_header[4]) + 8; file_size = cassette_image_size(cassette); if (stated_size > file_size) - stated_size = (UINT32) file_size; + stated_size = (uint32_t) file_size; while(offset < stated_size) { @@ -177,24 +177,24 @@ static cassette_image::error wavfile_load(cassette_image *cassette) static cassette_image::error wavfile_save(cassette_image *cassette, const struct CassetteInfo *info) { cassette_image::error err; - UINT8 consolidated_header[12 + 8 + 16 + 8]; - UINT8 *header = &consolidated_header[0]; - UINT8 *format_tag_header = &consolidated_header[12]; - UINT8 *format_tag_data = &consolidated_header[12 + 8]; - UINT8 *data_tag_header = &consolidated_header[12 + 8 + 16]; - UINT32 file_size; - UINT32 bytes_per_second; - UINT16 bits_per_sample; - UINT32 data_size; + uint8_t consolidated_header[12 + 8 + 16 + 8]; + uint8_t *header = &consolidated_header[0]; + uint8_t *format_tag_header = &consolidated_header[12]; + uint8_t *format_tag_data = &consolidated_header[12 + 8]; + uint8_t *data_tag_header = &consolidated_header[12 + 8 + 16]; + uint32_t file_size; + uint32_t bytes_per_second; + uint16_t bits_per_sample; + uint32_t data_size; size_t bytes_per_sample = 2; int waveform_flags = CASSETTE_WAVEFORM_16BITLE; - UINT16 block_align; + uint16_t block_align; - bits_per_sample = (UINT16) (bytes_per_sample * 8); + bits_per_sample = (uint16_t) (bytes_per_sample * 8); bytes_per_second = info->sample_frequency * bytes_per_sample * info->channels; - data_size = (UINT32) (info->sample_count * bytes_per_sample * info->channels); + data_size = (uint32_t) (info->sample_count * bytes_per_sample * info->channels); file_size = data_size + sizeof(consolidated_header) - 8; - block_align = (UINT16) (bytes_per_sample * info->channels); + block_align = (uint16_t) (bytes_per_sample * info->channels); /* set up header */ memcpy(&header[0], magic1, 4); @@ -257,8 +257,8 @@ void wavfile_testload(const char *fname) FILE *f; long offset; int freq, samples, i; - INT32 cassamp; - INT16 wavsamp; + int32_t cassamp; + int16_t wavsamp; f = fopen(fname, "rb"); if (!f) @@ -280,7 +280,7 @@ void wavfile_testload(const char *fname) fseek(f, offset + i * 2, SEEK_SET); fread(&wavsamp, 1, 2, f); - assert(cassamp == (((UINT32) wavsamp) << 16)); + assert(cassamp == (((uint32_t) wavsamp) << 16)); } cassette_close(cassette); diff --git a/src/lib/formats/wd177x_dsk.cpp b/src/lib/formats/wd177x_dsk.cpp index 527fb69a234..52e8db2f1f2 100644 --- a/src/lib/formats/wd177x_dsk.cpp +++ b/src/lib/formats/wd177x_dsk.cpp @@ -19,21 +19,21 @@ wd177x_format::wd177x_format(const format *_formats) /* Default implementation for find_size. May be overwritten by subclasses. */ -int wd177x_format::find_size(io_generic *io, UINT32 form_factor) +int wd177x_format::find_size(io_generic *io, uint32_t form_factor) { - UINT64 size = io_generic_size(io); + uint64_t size = io_generic_size(io); for(int i=0; formats[i].form_factor; i++) { const format &f = formats[i]; if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor) continue; - if(size == (UINT64)compute_track_size(f) * f.track_count * f.head_count) + if(size == (uint64_t)compute_track_size(f) * f.track_count * f.head_count) return i; } return -1; } -int wd177x_format::identify(io_generic *io, UINT32 form_factor) +int wd177x_format::identify(io_generic *io, uint32_t form_factor) { int type = find_size(io, form_factor); @@ -55,7 +55,7 @@ int wd177x_format::compute_track_size(const format &f) const return track_size; } -void wd177x_format::build_sector_description(const format &f, UINT8 *sectdata, desc_s *sectors) const +void wd177x_format::build_sector_description(const format &f, uint8_t *sectdata, desc_s *sectors) const { if(f.sector_base_id == -1) { for(int i=0; i &candidates) { - UINT8 bitstream[500000/8]; - UINT8 sectdata[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectdata[50000]; desc_xs sectors[256]; int track_size; @@ -417,8 +417,8 @@ void wd177x_format::check_compatibility(floppy_image *image, std::vector &c void wd177x_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head) { - UINT8 bitstream[500000/8]; - UINT8 sectdata[50000]; + uint8_t bitstream[500000/8]; + uint8_t sectdata[50000]; desc_xs sectors[256]; int track_size; @@ -442,7 +442,7 @@ void wd177x_format::extract_sectors(floppy_image *image, const format &f, desc_s memset((void *)ds.data, 0, ds.size); else if(xs.size < ds.size) { memcpy((void *)ds.data, xs.data, xs.size); - memset((UINT8 *)ds.data + xs.size, 0, xs.size - ds.size); + memset((uint8_t *)ds.data + xs.size, 0, xs.size - ds.size); } else memcpy((void *)ds.data, xs.data, ds.size); } diff --git a/src/lib/formats/wd177x_dsk.h b/src/lib/formats/wd177x_dsk.h index 6c93000b02c..0061212d14b 100644 --- a/src/lib/formats/wd177x_dsk.h +++ b/src/lib/formats/wd177x_dsk.h @@ -17,9 +17,9 @@ class wd177x_format : public floppy_image_format_t { public: struct format { - UINT32 form_factor; // See floppy_image for possible values - UINT32 variant; // See floppy_image for possible values - UINT32 encoding; // See floppy_image for possible values + uint32_t form_factor; // See floppy_image for possible values + uint32_t variant; // See floppy_image for possible values + uint32_t encoding; // See floppy_image for possible values int cell_size; // See floppy_image_format_t for details int sector_count; @@ -37,8 +37,8 @@ public: // End the array with {} wd177x_format(const format *formats); - virtual int identify(io_generic *io, UINT32 form_factor) override; - virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override; + virtual int identify(io_generic *io, uint32_t form_factor) override; + virtual bool load(io_generic *io, uint32_t form_factor, floppy_image *image) override; virtual bool save(io_generic *io, floppy_image *image) override; virtual bool supports_save() const override; @@ -49,13 +49,13 @@ protected: virtual floppy_image_format_t::desc_e* get_desc_fm(const format &f, int ¤t_size, int &end_gap_index); virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index); - virtual int find_size(io_generic *io, UINT32 form_factor); + virtual int find_size(io_generic *io, uint32_t form_factor); virtual int get_image_offset(const format &f, int head, int track); virtual int get_track_dam_fm(const format &f, int head, int track); virtual int get_track_dam_mfm(const format &f, int head, int track); int compute_track_size(const format &f) const; - void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors) const; + void build_sector_description(const format &d, uint8_t *sectdata, desc_s *sectors) const; void check_compatibility(floppy_image *image, std::vector &candidates); void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head); }; diff --git a/src/lib/formats/x07_cas.cpp b/src/lib/formats/x07_cas.cpp index 93c34705105..b49d7c8d643 100644 --- a/src/lib/formats/x07_cas.cpp +++ b/src/lib/formats/x07_cas.cpp @@ -21,7 +21,7 @@ // image size static int x07_image_size; -static int x07_put_samples(INT16 *buffer, int sample_pos, int count, int level) +static int x07_put_samples(int16_t *buffer, int sample_pos, int count, int level) { if (buffer) { @@ -32,7 +32,7 @@ static int x07_put_samples(INT16 *buffer, int sample_pos, int count, int level) return count; } -static int x07_output_bit(INT16 *buffer, int sample_pos, UINT8 bit) +static int x07_output_bit(int16_t *buffer, int sample_pos, uint8_t bit) { int samples = 0; @@ -52,7 +52,7 @@ static int x07_output_bit(INT16 *buffer, int sample_pos, UINT8 bit) return samples; } -static int x07_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) +static int x07_output_byte(int16_t *buffer, int sample_pos, uint8_t byte) { int samples = 0; @@ -71,7 +71,7 @@ static int x07_output_byte(INT16 *buffer, int sample_pos, UINT8 byte) return samples; } -static int x07_handle_cassette(INT16 *buffer, const UINT8 *bytes) +static int x07_handle_cassette(int16_t *buffer, const uint8_t *bytes) { int sample_count = 0; int img_start = 0; @@ -124,7 +124,7 @@ static int x07_handle_cassette(INT16 *buffer, const UINT8 *bytes) Generate samples for the tape image ********************************************************************/ -static int x07_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) +static int x07_cassette_fill_wave(int16_t *buffer, int length, uint8_t *bytes) { return x07_handle_cassette(buffer, bytes); } @@ -133,7 +133,7 @@ static int x07_cassette_fill_wave(INT16 *buffer, int length, UINT8 *bytes) Calculate the number of samples needed for this tape image ********************************************************************/ -static int x07_cassette_calculate_size_in_samples(const UINT8 *bytes, int length) +static int x07_cassette_calculate_size_in_samples(const uint8_t *bytes, int length) { x07_image_size = length; diff --git a/src/lib/formats/x1_tap.cpp b/src/lib/formats/x1_tap.cpp index 33ecefd683f..b4fe65b8e8c 100644 --- a/src/lib/formats/x1_tap.cpp +++ b/src/lib/formats/x1_tap.cpp @@ -32,7 +32,7 @@ static int cas_size; static int samplerate; static int new_format; -static int x1_fill_wave(INT16* buffer, UINT8 data, int sample_pos) +static int x1_fill_wave(int16_t* buffer, uint8_t data, int sample_pos) { int x; int sample_count = 0; @@ -48,7 +48,7 @@ static int x1_fill_wave(INT16* buffer, UINT8 data, int sample_pos) return sample_count; } -static int x1_handle_tap(INT16* buffer, const UINT8* casdata) +static int x1_handle_tap(int16_t* buffer, const uint8_t* casdata) { int sample_count = 0; int data_pos = new_format ? 0x28 : 0x04; @@ -71,9 +71,9 @@ static int x1_handle_tap(INT16* buffer, const UINT8* casdata) /******************************************************************* Calculate the number of samples needed for this tape image ********************************************************************/ -static int x1_cas_to_wav_size (const UINT8 *casdata, int caslen) +static int x1_cas_to_wav_size (const uint8_t *casdata, int caslen) { - UINT32 ret; + uint32_t ret; if (!memcmp(casdata, "TAPE", 4)) // new TAP format { @@ -98,7 +98,7 @@ static int x1_cas_to_wav_size (const UINT8 *casdata, int caslen) /******************************************************************* Generate samples for the tape image ********************************************************************/ -static int x1_cas_fill_wave(INT16 *buffer, int sample_count, UINT8 *bytes) +static int x1_cas_fill_wave(int16_t *buffer, int sample_count, uint8_t *bytes) { return x1_handle_tap(buffer,bytes); } diff --git a/src/lib/formats/zx81_p.cpp b/src/lib/formats/zx81_p.cpp index 7a5f82fd8f1..7f359ccaca3 100644 --- a/src/lib/formats/zx81_p.cpp +++ b/src/lib/formats/zx81_p.cpp @@ -55,13 +55,13 @@ medium transfer rate is approx. 307 bps (38 bytes/sec) for files that contain #define ZX81_DATA_LENGTH_OFFSET 0x0b #define ZX80_DATA_LENGTH_OFFSET 0x04 -static UINT8 zx_file_name[128]; -static UINT16 real_data_length = 0; -static UINT8 zx_file_name_length = 0; +static uint8_t zx_file_name[128]; +static uint16_t real_data_length = 0; +static uint8_t zx_file_name_length = 0; /* common functions */ -static INT16 *zx81_emit_level(INT16 *p, int count, int level) +static int16_t *zx81_emit_level(int16_t *p, int count, int level) { int i; @@ -70,7 +70,7 @@ static INT16 *zx81_emit_level(INT16 *p, int count, int level) return p; } -static INT16* zx81_emit_pulse(INT16 *p) +static int16_t* zx81_emit_pulse(int16_t *p) { p = zx81_emit_level (p, ZX81_PULSE_LENGTH/8, WAVEENTRY_LOW); p = zx81_emit_level (p, ZX81_PULSE_LENGTH/8, WAVEENTRY_LOW); @@ -84,14 +84,14 @@ static INT16* zx81_emit_pulse(INT16 *p) return p; } -static INT16* zx81_emit_pause(INT16 *p) +static int16_t* zx81_emit_pause(int16_t *p) { p = zx81_emit_level (p, ZX81_PAUSE_LENGTH, WAVEENTRY_ZERO); return p; } -static INT16* zx81_output_bit(INT16 *p, UINT8 bit) +static int16_t* zx81_output_bit(int16_t *p, uint8_t bit) { int i; @@ -107,7 +107,7 @@ static INT16* zx81_output_bit(INT16 *p, UINT8 bit) return p; } -static INT16* zx81_output_byte(INT16 *p, UINT8 byte) +static int16_t* zx81_output_byte(int16_t *p, uint8_t byte) { int i; @@ -117,9 +117,9 @@ static INT16* zx81_output_byte(INT16 *p, UINT8 byte) return p; } -static UINT16 zx81_cassette_calculate_number_of_1(const UINT8 *bytes, UINT16 length) +static uint16_t zx81_cassette_calculate_number_of_1(const uint8_t *bytes, uint16_t length) { - UINT16 number_of_1 = 0; + uint16_t number_of_1 = 0; int i,j; for (i=0; i= 0x100) m_rlecount = code_to_rlecount(data) - 1; @@ -143,7 +143,7 @@ inline void avhuff_encoder::deltarle_encoder::encode_one(bitstream_out &bitbuf, //------------------------------------------------- // decode_one - decode data //------------------------------------------------- -inline UINT32 avhuff_decoder::deltarle_decoder::decode_one(bitstream_in &bitbuf) +inline uint32_t avhuff_decoder::deltarle_decoder::decode_one(bitstream_in &bitbuf) { // return RLE data if we still have some if (m_rlecount != 0) @@ -156,7 +156,7 @@ inline UINT32 avhuff_decoder::deltarle_decoder::decode_one(bitstream_in &bitbuf) int data = m_decoder.decode_one(bitbuf); if (data < 0x100) { - m_prevdata += UINT8(data); + m_prevdata += uint8_t(data); return m_prevdata; } else @@ -189,7 +189,7 @@ m_flac_encoder.set_strip_metadata(true); } /** - * @fn avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT32 &complength) + * @fn avhuff_error avhuff_encoder::encode_data(const uint8_t *source, uint8_t *dest, uint32_t &complength) * * @brief ------------------------------------------------- * encode_data - encode a block of data into a compressed data stream @@ -202,18 +202,18 @@ m_flac_encoder.set_strip_metadata(true); * @return An avhuff_error. */ -avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT32 &complength) +avhuff_error avhuff_encoder::encode_data(const uint8_t *source, uint8_t *dest, uint32_t &complength) { // validate the header if (source[0] != 'c' || source[1] != 'h' || source[2] != 'a' || source[3] != 'v') return AVHERR_INVALID_DATA; // extract info from the header - UINT32 metasize = source[4]; - UINT32 channels = source[5]; - UINT32 samples = (source[6] << 8) + source[7]; - UINT32 width = (source[8] << 8) + source[9]; - UINT32 height = (source[10] << 8) + source[11]; + uint32_t metasize = source[4]; + uint32_t channels = source[5]; + uint32_t samples = (source[6] << 8) + source[7]; + uint32_t width = (source[8] << 8) + source[9]; + uint32_t height = (source[10] << 8) + source[11]; source += 12; // write the basics to the new header @@ -227,7 +227,7 @@ avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT3 dest[7] = height; // starting offsets - UINT32 dstoffs = 10 + 2 * channels; + uint32_t dstoffs = 10 + 2 * channels; // copy the metadata first if (metasize > 0) @@ -247,7 +247,7 @@ avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT3 return err; // advance the pointers past the data - UINT16 treesize = (dest[8] << 8) + dest[9]; + uint16_t treesize = (dest[8] << 8) + dest[9]; if (treesize != 0xffff) dstoffs += treesize; for (int chnum = 0; chnum < channels; chnum++) @@ -263,7 +263,7 @@ avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT3 if (width > 0 && height > 0) { // encode the video - UINT32 vidlength = 0; + uint32_t vidlength = 0; avhuff_error err = encode_video(source, width, height, dest + dstoffs, vidlength); if (err != AVHERR_NONE) return err; @@ -278,7 +278,7 @@ avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT3 } /** - * @fn UINT32 avhuff_encoder::raw_data_size(const UINT8 *data) + * @fn uint32_t avhuff_encoder::raw_data_size(const uint8_t *data) * * @brief ------------------------------------------------- * raw_data_size - return the raw data size of a raw stream based on the header @@ -286,10 +286,10 @@ avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT3 * * @param data The data. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 avhuff_encoder::raw_data_size(const UINT8 *data) +uint32_t avhuff_encoder::raw_data_size(const uint8_t *data) { // make sure we have a correct header int size = 0; @@ -308,7 +308,7 @@ UINT32 avhuff_encoder::raw_data_size(const UINT8 *data) } /** - * @fn avhuff_error avhuff_encoder::assemble_data(std::vector &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize) + * @fn avhuff_error avhuff_encoder::assemble_data(std::vector &buffer, bitmap_yuy16 &bitmap, uint8_t channels, uint32_t numsamples, int16_t **samples, uint8_t *metadata, uint32_t metadatasize) * * @brief ------------------------------------------------- * assemble_data - assemble a datastream from raw bits @@ -325,7 +325,7 @@ UINT32 avhuff_encoder::raw_data_size(const UINT8 *data) * @return An avhuff_error. */ -avhuff_error avhuff_encoder::assemble_data(std::vector &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize) +avhuff_error avhuff_encoder::assemble_data(std::vector &buffer, bitmap_yuy16 &bitmap, uint8_t channels, uint32_t numsamples, int16_t **samples, uint8_t *metadata, uint32_t metadatasize) { // sanity check the inputs if (metadatasize > 255) @@ -337,7 +337,7 @@ avhuff_error avhuff_encoder::assemble_data(std::vector &buffer, bitmap_yu // fill in the header buffer.resize(12 + metadatasize + numsamples * channels * 2 + bitmap.width() * bitmap.height() * 2); - UINT8 *dest = &buffer[0]; + uint8_t *dest = &buffer[0]; *dest++ = 'c'; *dest++ = 'h'; *dest++ = 'a'; @@ -357,18 +357,18 @@ avhuff_error avhuff_encoder::assemble_data(std::vector &buffer, bitmap_yu dest += metadatasize; // copy the audio streams - for (UINT8 curchan = 0; curchan < channels; curchan++) - for (UINT32 cursamp = 0; cursamp < numsamples; cursamp++) + for (uint8_t curchan = 0; curchan < channels; curchan++) + for (uint32_t cursamp = 0; cursamp < numsamples; cursamp++) { *dest++ = samples[curchan][cursamp] >> 8; *dest++ = samples[curchan][cursamp] & 0xff; } // copy the video data - for (INT32 y = 0; y < bitmap.height(); y++) + for (int32_t y = 0; y < bitmap.height(); y++) { - UINT16 *src = &bitmap.pix(y); - for (INT32 x = 0; x < bitmap.width(); x++) + uint16_t *src = &bitmap.pix(y); + for (int32_t x = 0; x < bitmap.width(); x++) { *dest++ = src[x] >> 8; *dest++ = src[x] & 0xff; @@ -378,7 +378,7 @@ avhuff_error avhuff_encoder::assemble_data(std::vector &buffer, bitmap_yu } /** - * @fn avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int samples, UINT8 *dest, UINT8 *sizes) + * @fn avhuff_error avhuff_encoder::encode_audio(const uint8_t *source, int channels, int samples, uint8_t *dest, uint8_t *sizes) * * @brief ------------------------------------------------- * encode_audio - encode raw audio data to the destination @@ -393,13 +393,13 @@ avhuff_error avhuff_encoder::assemble_data(std::vector &buffer, bitmap_yu * @return An avhuff_error. */ -avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int samples, UINT8 *dest, UINT8 *sizes) +avhuff_error avhuff_encoder::encode_audio(const uint8_t *source, int channels, int samples, uint8_t *dest, uint8_t *sizes) { #if AVHUFF_USE_FLAC // input data is big-endian; determine our platform endianness - UINT16 be_test = 0; - *(UINT8 *)&be_test = 1; + uint16_t be_test = 0; + *(uint8_t *)&be_test = 1; bool swap_endian = (be_test == 1); // set huffman tree size to 0xffff to indicate FLAC @@ -412,11 +412,11 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int { // encode the data m_flac_encoder.reset(dest, samples * 2); - if (!m_flac_encoder.encode_interleaved(reinterpret_cast(source) + chnum * samples, samples, swap_endian)) + if (!m_flac_encoder.encode_interleaved(reinterpret_cast(source) + chnum * samples, samples, swap_endian)) return AVHERR_COMPRESSION_ERROR; // set the size for this channel - UINT32 cursize = m_flac_encoder.finish(); + uint32_t cursize = m_flac_encoder.finish(); sizes[chnum * 2 + 2] = cursize >> 8; sizes[chnum * 2 + 3] = cursize; dest += cursize; @@ -426,7 +426,7 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int // expand the delta buffer if needed m_audiobuffer.resize(channels * samples * 2); - UINT8 *deltabuf = m_audiobuffer; + uint8_t *deltabuf = m_audiobuffer; // iterate over channels to compute deltas m_audiohi_encoder.histo_reset(); @@ -434,13 +434,13 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int for (int chnum = 0; chnum < channels; chnum++) { // extract audio data into hi and lo deltas stored in big-endian order - INT16 prevsample = 0; + int16_t prevsample = 0; for (int sampnum = 0; sampnum < samples; sampnum++) { - INT16 newsample = (source[0] << 8) | source[1]; + int16_t newsample = (source[0] << 8) | source[1]; source += 2; - INT16 delta = newsample - prevsample; + int16_t delta = newsample - prevsample; prevsample = newsample; m_audiohi_encoder.histo_one(*deltabuf++ = delta >> 8); m_audiolo_encoder.histo_one(*deltabuf++ = delta); @@ -466,17 +466,17 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int return AVHERR_COMPRESSION_ERROR; // note the size of the two trees - UINT32 huffsize = bitbuf.flush(); + uint32_t huffsize = bitbuf.flush(); sizes[0] = huffsize >> 8; sizes[1] = huffsize; // iterate over channels - UINT32 totalsize = huffsize; + uint32_t totalsize = huffsize; int chnum; for (chnum = 0; chnum < channels; chnum++) { // encode the data - const UINT8 *input = m_audiobuffer + chnum * samples * 2; + const uint8_t *input = m_audiobuffer + chnum * samples * 2; for (int sampnum = 0; sampnum < samples; sampnum++) { m_audiohi_encoder.encode_one(bitbuf, *input++); @@ -484,7 +484,7 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int } // store the size of this stream - UINT32 cursize = bitbuf.flush() - totalsize; + uint32_t cursize = bitbuf.flush() - totalsize; totalsize += cursize; if (totalsize >= channels * samples * 2) break; @@ -496,7 +496,7 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int if (chnum < channels) { memcpy(dest, m_audiobuffer, channels * samples * 2); - UINT32 size = samples * 2; + uint32_t size = samples * 2; sizes[0] = sizes[1] = 0; for (chnum = 0; chnum < channels; chnum++) { @@ -511,7 +511,7 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int } /** - * @fn avhuff_error avhuff_encoder::encode_video(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength) + * @fn avhuff_error avhuff_encoder::encode_video(const uint8_t *source, int width, int height, uint8_t *dest, uint32_t &complength) * * @brief ------------------------------------------------- * encode_video - encode raw video data to the destination @@ -526,14 +526,14 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int * @return An avhuff_error. */ -avhuff_error avhuff_encoder::encode_video(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength) +avhuff_error avhuff_encoder::encode_video(const uint8_t *source, int width, int height, uint8_t *dest, uint32_t &complength) { // only lossless supported at this time return encode_video_lossless(source, width, height, dest, complength); } /** - * @fn avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength) + * @fn avhuff_error avhuff_encoder::encode_video_lossless(const uint8_t *source, int width, int height, uint8_t *dest, uint32_t &complength) * * @brief ------------------------------------------------- * encode_video_lossless - do a lossless video encoding using deltas and huffman @@ -549,16 +549,16 @@ avhuff_error avhuff_encoder::encode_video(const UINT8 *source, int width, int he * @return An avhuff_error. */ -avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength) +avhuff_error avhuff_encoder::encode_video_lossless(const uint8_t *source, int width, int height, uint8_t *dest, uint32_t &complength) { // set up the output; first byte is 0x80 to indicate lossless encoding bitstream_out bitbuf(dest, width * height * 2); bitbuf.write(0x80, 8); // compute the histograms for the data - UINT16 *yrle = m_ycontext.rle_and_histo_bitmap(source + 0, width, 2, height); - UINT16 *cbrle = m_cbcontext.rle_and_histo_bitmap(source + 1, width / 2, 4, height); - UINT16 *crrle = m_crcontext.rle_and_histo_bitmap(source + 3, width / 2, 4, height); + uint16_t *yrle = m_ycontext.rle_and_histo_bitmap(source + 0, width, 2, height); + uint16_t *cbrle = m_cbcontext.rle_and_histo_bitmap(source + 1, width / 2, 4, height); + uint16_t *crrle = m_crcontext.rle_and_histo_bitmap(source + 3, width / 2, 4, height); // export the trees to the data stream huffman_error hufferr = m_ycontext.export_tree_rle(bitbuf); @@ -575,12 +575,12 @@ avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int widt bitbuf.flush(); // encode the data using the trees - for (UINT32 sy = 0; sy < height; sy++) + for (uint32_t sy = 0; sy < height; sy++) { m_ycontext.flush_rle(); m_cbcontext.flush_rle(); m_crcontext.flush_rle(); - for (UINT32 sx = 0; sx < width / 2; sx++) + for (uint32_t sx = 0; sx < width / 2; sx++) { m_ycontext.encode_one(bitbuf, yrle); m_cbcontext.encode_one(bitbuf, cbrle); @@ -601,7 +601,7 @@ avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int widt //************************************************************************** /** - * @fn UINT16 *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const UINT8 *source, UINT32 items_per_row, UINT32 item_advance, UINT32 row_count) + * @fn uint16_t *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const uint8_t *source, uint32_t items_per_row, uint32_t item_advance, uint32_t row_count) * * @brief ------------------------------------------------- * rle_and_histo_bitmap - RLE compress and histogram a bitmap's worth of data @@ -612,25 +612,25 @@ avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int widt * @param item_advance The item advance. * @param row_count Number of rows. * - * @return null if it fails, else an UINT16*. + * @return null if it fails, else an uint16_t*. */ -UINT16 *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const UINT8 *source, UINT32 items_per_row, UINT32 item_advance, UINT32 row_count) +uint16_t *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const uint8_t *source, uint32_t items_per_row, uint32_t item_advance, uint32_t row_count) { // resize our RLE buffer m_rlebuffer.resize(items_per_row * row_count); - UINT16 *dest = &m_rlebuffer[0]; + uint16_t *dest = &m_rlebuffer[0]; // iterate over rows m_encoder.histo_reset(); - UINT8 prevdata = 0; - for (UINT32 row = 0; row < row_count; row++) + uint8_t prevdata = 0; + for (uint32_t row = 0; row < row_count; row++) { - const UINT8 *end = source + items_per_row * item_advance; + const uint8_t *end = source + items_per_row * item_advance; for ( ; source < end; source += item_advance) { // fetch current data - UINT8 curdelta = *source - prevdata; + uint8_t curdelta = *source - prevdata; prevdata = *source; // 0 deltas scan forward for a count @@ -639,7 +639,7 @@ UINT16 *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const UINT8 *sour int zerocount = 1; // count the number of consecutive values - const UINT8 *scandata; + const uint8_t *scandata; for (scandata = source + item_advance; scandata < end; scandata += item_advance) if (*scandata == prevdata) zerocount++; @@ -712,7 +712,7 @@ void avhuff_decoder::configure(const avhuff_decompress_config &config) } /** - * @fn avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, UINT8 *dest) + * @fn avhuff_error avhuff_decoder::decode_data(const uint8_t *source, uint32_t complength, uint8_t *dest) * * @brief ------------------------------------------------- * decode_data - decode both audio and video from a raw data stream @@ -725,22 +725,22 @@ void avhuff_decoder::configure(const avhuff_decompress_config &config) * @return An avhuff_error. */ -avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, UINT8 *dest) +avhuff_error avhuff_decoder::decode_data(const uint8_t *source, uint32_t complength, uint8_t *dest) { // extract info from the header if (complength < 8) return AVHERR_INVALID_DATA; - UINT32 metasize = source[0]; - UINT32 channels = source[1]; - UINT32 samples = (source[2] << 8) + source[3]; - UINT32 width = (source[4] << 8) + source[5]; - UINT32 height = (source[6] << 8) + source[7]; + uint32_t metasize = source[0]; + uint32_t channels = source[1]; + uint32_t samples = (source[2] << 8) + source[3]; + uint32_t width = (source[4] << 8) + source[5]; + uint32_t height = (source[6] << 8) + source[7]; // validate that the sizes make sense if (complength < 10 + 2 * channels) return AVHERR_INVALID_DATA; - UINT32 totalsize = 10 + 2 * channels; - UINT32 treesize = (source[8] << 8) | source[9]; + uint32_t totalsize = 10 + 2 * channels; + uint32_t treesize = (source[8] << 8) | source[9]; if (treesize != 0xffff) totalsize += treesize; for (int chnum = 0; chnum < channels; chnum++) @@ -749,11 +749,11 @@ avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, return AVHERR_INVALID_DATA; // starting offsets - UINT32 srcoffs = 10 + 2 * channels; + uint32_t srcoffs = 10 + 2 * channels; // if we are decoding raw, set up the output parameters - UINT8 *metastart, *videostart, *audiostart[16]; - UINT32 audioxor, videoxor, videostride; + uint8_t *metastart, *videostart, *audiostart[16]; + uint32_t audioxor, videoxor, videostride; if (dest != nullptr) { // create a header @@ -792,13 +792,13 @@ avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, // determine the start of each piece of data metastart = m_config.metadata; for (int chnum = 0; chnum < channels; chnum++) - audiostart[chnum] = (UINT8 *)m_config.audio[chnum]; - videostart = (m_config.video.valid()) ? reinterpret_cast(&m_config.video.pix(0)) : nullptr; + audiostart[chnum] = (uint8_t *)m_config.audio[chnum]; + videostart = (m_config.video.valid()) ? reinterpret_cast(&m_config.video.pix(0)) : nullptr; videostride = (m_config.video.valid()) ? m_config.video.rowpixels() * 2 : 0; // data is assumed to be native-endian - UINT16 betest = 0; - *(UINT8 *)&betest = 1; + uint16_t betest = 0; + *(uint8_t *)&betest = 1; audioxor = videoxor = (betest == 1) ? 1 : 0; // verify against sizes @@ -853,7 +853,7 @@ avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, } /** - * @fn avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 *source, UINT8 **dest, UINT32 dxor, const UINT8 *sizes) + * @fn avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const uint8_t *source, uint8_t **dest, uint32_t dxor, const uint8_t *sizes) * * @brief ------------------------------------------------- * decode_audio - decode audio from a compressed data stream @@ -872,10 +872,10 @@ avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, * @return An avhuff_error. */ -avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 *source, UINT8 **dest, UINT32 dxor, const UINT8 *sizes) +avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const uint8_t *source, uint8_t **dest, uint32_t dxor, const uint8_t *sizes) { // extract the huffman trees - UINT16 treesize = (sizes[0] << 8) | sizes[1]; + uint16_t treesize = (sizes[0] << 8) | sizes[1]; #if AVHUFF_USE_FLAC @@ -883,8 +883,8 @@ avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 if (treesize == 0xffff) { // output data is big-endian; determine our platform endianness - UINT16 be_test = 0; - *(UINT8 *)&be_test = 1; + uint16_t be_test = 0; + *(uint8_t *)&be_test = 1; bool swap_endian = (be_test == 1); if (dxor != 0) swap_endian = !swap_endian; @@ -893,16 +893,16 @@ avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 for (int chnum = 0; chnum < channels; chnum++) { // extract the size of this channel - UINT16 size = (sizes[chnum * 2 + 2] << 8) | sizes[chnum * 2 + 3]; + uint16_t size = (sizes[chnum * 2 + 2] << 8) | sizes[chnum * 2 + 3]; // only process if the data is requested - UINT8 *curdest = dest[chnum]; + uint8_t *curdest = dest[chnum]; if (curdest != nullptr) { // reset and decode if (!m_flac_decoder.reset(48000, 1, samples, source, size)) throw CHDERR_DECOMPRESSION_ERROR; - if (!m_flac_decoder.decode_interleaved(reinterpret_cast(curdest), samples, swap_endian)) + if (!m_flac_decoder.decode_interleaved(reinterpret_cast(curdest), samples, swap_endian)) throw CHDERR_DECOMPRESSION_ERROR; // finish up @@ -937,24 +937,24 @@ avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 for (int chnum = 0; chnum < channels; chnum++) { // extract the size of this channel - UINT16 size = (sizes[chnum * 2 + 2] << 8) | sizes[chnum * 2 + 3]; + uint16_t size = (sizes[chnum * 2 + 2] << 8) | sizes[chnum * 2 + 3]; // only process if the data is requested - UINT8 *curdest = dest[chnum]; + uint8_t *curdest = dest[chnum]; if (curdest != nullptr) { - INT16 prevsample = 0; + int16_t prevsample = 0; // if no huffman length, just copy the data if (treesize == 0) { - const UINT8 *cursource = source; + const uint8_t *cursource = source; for (int sampnum = 0; sampnum < samples; sampnum++) { - INT16 delta = (cursource[0] << 8) | cursource[1]; + int16_t delta = (cursource[0] << 8) | cursource[1]; cursource += 2; - INT16 newsample = prevsample + delta; + int16_t newsample = prevsample + delta; prevsample = newsample; curdest[0 ^ dxor] = newsample >> 8; @@ -969,10 +969,10 @@ avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 bitstream_in bitbuf(source, size); for (int sampnum = 0; sampnum < samples; sampnum++) { - INT16 delta = m_audiohi_decoder.decode_one(bitbuf) << 8; + int16_t delta = m_audiohi_decoder.decode_one(bitbuf) << 8; delta |= m_audiolo_decoder.decode_one(bitbuf); - INT16 newsample = prevsample + delta; + int16_t newsample = prevsample + delta; prevsample = newsample; curdest[0 ^ dxor] = newsample >> 8; @@ -991,7 +991,7 @@ avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 } /** - * @fn avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor) + * @fn avhuff_error avhuff_decoder::decode_video(int width, int height, const uint8_t *source, uint32_t complength, uint8_t *dest, uint32_t dstride, uint32_t dxor) * * @brief ------------------------------------------------- * decode_video - decode video from a compressed data stream @@ -1008,7 +1008,7 @@ avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 * @return An avhuff_error. */ -avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor) +avhuff_error avhuff_decoder::decode_video(int width, int height, const uint8_t *source, uint32_t complength, uint8_t *dest, uint32_t dstride, uint32_t dxor) { // if the high bit of the first byte is set, we decode losslessly if (source[0] & 0x80) @@ -1018,7 +1018,7 @@ avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *so } /** - * @fn avhuff_error avhuff_decoder::decode_video_lossless(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor) + * @fn avhuff_error avhuff_decoder::decode_video_lossless(int width, int height, const uint8_t *source, uint32_t complength, uint8_t *dest, uint32_t dstride, uint32_t dxor) * * @brief ------------------------------------------------- * decode_video_lossless - do a lossless video decoding using deltas and huffman @@ -1036,7 +1036,7 @@ avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *so * @return An avhuff_error. */ -avhuff_error avhuff_decoder::decode_video_lossless(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor) +avhuff_error avhuff_decoder::decode_video_lossless(int width, int height, const uint8_t *source, uint32_t complength, uint8_t *dest, uint32_t dstride, uint32_t dxor) { // skip the first byte bitstream_in bitbuf(source, complength); @@ -1060,10 +1060,10 @@ avhuff_error avhuff_decoder::decode_video_lossless(int width, int height, const m_ycontext.reset(); m_cbcontext.reset(); m_crcontext.reset(); - for (UINT32 dy = 0; dy < height; dy++) + for (uint32_t dy = 0; dy < height; dy++) { - UINT8 *row = dest + dy * dstride; - for (UINT32 dx = 0; dx < width / 2; dx++) + uint8_t *row = dest + dy * dstride; + for (uint32_t dx = 0; dx < width / 2; dx++) { row[0 ^ dxor] = m_ycontext.decode_one(bitbuf); row[1 ^ dxor] = m_cbcontext.decode_one(bitbuf); diff --git a/src/lib/util/avhuff.h b/src/lib/util/avhuff.h index ca1bd4cec49..9d00ed423e6 100644 --- a/src/lib/util/avhuff.h +++ b/src/lib/util/avhuff.h @@ -66,12 +66,12 @@ public: } bitmap_yuy16 video; // pointer to video bitmap - UINT32 maxsamples; // maximum number of samples per channel - UINT32 * actsamples; // actual number of samples per channel - INT16 * audio[16]; // pointer to individual audio channels - UINT32 maxmetalength; // maximum length of metadata - UINT32 * actmetalength; // actual length of metadata - UINT8 * metadata; // pointer to metadata buffer + uint32_t maxsamples; // maximum number of samples per channel + uint32_t * actsamples; // actual number of samples per channel + int16_t * audio[16]; // pointer to individual audio channels + uint32_t maxmetalength; // maximum length of metadata + uint32_t * actmetalength; // actual length of metadata + uint8_t * metadata; // pointer to metadata buffer }; @@ -85,12 +85,12 @@ public: avhuff_encoder(); // encode/decode - avhuff_error encode_data(const UINT8 *source, UINT8 *dest, UINT32 &complength); + avhuff_error encode_data(const uint8_t *source, uint8_t *dest, uint32_t &complength); // static helpers - static UINT32 raw_data_size(const UINT8 *data); - static UINT32 raw_data_size(UINT32 width, UINT32 height, UINT8 channels, UINT32 numsamples, UINT32 metadatasize = 0) { return 12 + channels * numsamples * 2 + width * height * 2; } - static avhuff_error assemble_data(std::vector &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata = nullptr, UINT32 metadatasize = 0); + static uint32_t raw_data_size(const uint8_t *data); + static uint32_t raw_data_size(uint32_t width, uint32_t height, uint8_t channels, uint32_t numsamples, uint32_t metadatasize = 0) { return 12 + channels * numsamples * 2 + width * height * 2; } + static avhuff_error assemble_data(std::vector &buffer, bitmap_yuy16 &bitmap, uint8_t channels, uint32_t numsamples, int16_t **samples, uint8_t *metadata = nullptr, uint32_t metadatasize = 0); private: // delta-RLE Huffman encoder @@ -102,24 +102,24 @@ private: : m_rlecount(0) { } // histogramming - UINT16 *rle_and_histo_bitmap(const UINT8 *source, UINT32 items_per_row, UINT32 item_advance, UINT32 row_count); + uint16_t *rle_and_histo_bitmap(const uint8_t *source, uint32_t items_per_row, uint32_t item_advance, uint32_t row_count); // encoding void flush_rle() { m_rlecount = 0; } - void encode_one(bitstream_out &bitbuf, UINT16 *&rleptr); + void encode_one(bitstream_out &bitbuf, uint16_t *&rleptr); huffman_error export_tree_rle(bitstream_out &bitbuf) { return m_encoder.export_tree_rle(bitbuf); } private: // internal state int m_rlecount; huffman_encoder<256 + 16> m_encoder; - std::vector m_rlebuffer; + std::vector m_rlebuffer; }; // internal helpers - avhuff_error encode_audio(const UINT8 *source, int channels, int samples, UINT8 *dest, UINT8 *sizes); - avhuff_error encode_video(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength); - avhuff_error encode_video_lossless(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength); + avhuff_error encode_audio(const uint8_t *source, int channels, int samples, uint8_t *dest, uint8_t *sizes); + avhuff_error encode_video(const uint8_t *source, int width, int height, uint8_t *dest, uint32_t &complength); + avhuff_error encode_video_lossless(const uint8_t *source, int width, int height, uint8_t *dest, uint32_t &complength); // video encoding contexts deltarle_encoder m_ycontext; @@ -127,7 +127,7 @@ private: deltarle_encoder m_crcontext; // audio encoding contexts - std::vector m_audiobuffer; + std::vector m_audiobuffer; #if AVHUFF_USE_FLAC flac_encoder m_flac_encoder; #else @@ -150,7 +150,7 @@ public: void configure(const avhuff_decompress_config &config); // encode/decode - avhuff_error decode_data(const UINT8 *source, UINT32 complength, UINT8 *dest); + avhuff_error decode_data(const uint8_t *source, uint32_t complength, uint8_t *dest); private: // delta-RLE Huffman decoder @@ -166,21 +166,21 @@ private: // decoding void flush_rle() { m_rlecount = 0; } - UINT32 decode_one(bitstream_in &bitbuf); + uint32_t decode_one(bitstream_in &bitbuf); huffman_error import_tree_rle(bitstream_in &bitbuf) { return m_decoder.import_tree_rle(bitbuf); } private: // internal state int m_rlecount; - UINT8 m_prevdata; + uint8_t m_prevdata; huffman_decoder<256 + 16> m_decoder; }; // internal helpers - avhuff_error decode_audio(int channels, int samples, const UINT8 *source, UINT8 **dest, UINT32 dxor, const UINT8 *sizes); - avhuff_error decode_video(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor); - avhuff_error decode_video_lossless(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor); + avhuff_error decode_audio(int channels, int samples, const uint8_t *source, uint8_t **dest, uint32_t dxor, const uint8_t *sizes); + avhuff_error decode_video(int width, int height, const uint8_t *source, uint32_t complength, uint8_t *dest, uint32_t dstride, uint32_t dxor); + avhuff_error decode_video_lossless(int width, int height, const uint8_t *source, uint32_t complength, uint8_t *dest, uint32_t dstride, uint32_t dxor); // internal state avhuff_decompress_config m_config; diff --git a/src/lib/util/bitmap.cpp b/src/lib/util/bitmap.cpp index 2436e474136..b70d7ce1c8b 100644 --- a/src/lib/util/bitmap.cpp +++ b/src/lib/util/bitmap.cpp @@ -21,9 +21,9 @@ //************************************************************************** /** @brief alignment values; 128 bytes is the largest cache line on typical architectures today. */ -const UINT32 BITMAP_OVERALL_ALIGN = 128; +const uint32_t BITMAP_OVERALL_ALIGN = 128; /** @brief The bitmap rowbytes align. */ -const UINT32 BITMAP_ROWBYTES_ALIGN = 128; +const uint32_t BITMAP_ROWBYTES_ALIGN = 128; @@ -36,7 +36,7 @@ const UINT32 BITMAP_ROWBYTES_ALIGN = 128; // rowpixels value //------------------------------------------------- -inline INT32 bitmap_t::compute_rowpixels(int width, int xslop) +inline int32_t bitmap_t::compute_rowpixels(int width, int xslop) { int rowpixels_align = BITMAP_ROWBYTES_ALIGN / (m_bpp / 8); return ((width + 2 * xslop + (rowpixels_align - 1)) / rowpixels_align) * rowpixels_align; @@ -51,7 +51,7 @@ inline INT32 bitmap_t::compute_rowpixels(int width, int xslop) inline void bitmap_t::compute_base(int xslop, int yslop) { m_base = m_alloc + (m_rowpixels * yslop + xslop) * (m_bpp / 8); - UINT64 aligned_base = ((reinterpret_cast(m_base) + (BITMAP_OVERALL_ALIGN - 1)) / BITMAP_OVERALL_ALIGN) * BITMAP_OVERALL_ALIGN; + uint64_t aligned_base = ((reinterpret_cast(m_base) + (BITMAP_OVERALL_ALIGN - 1)) / BITMAP_OVERALL_ALIGN) * BITMAP_OVERALL_ALIGN; m_base = reinterpret_cast(aligned_base); } @@ -191,7 +191,7 @@ void bitmap_t::allocate(int width, int height, int xslop, int yslop) // allocate memory for the bitmap itself m_allocbytes = m_rowpixels * (m_height + 2 * yslop) * m_bpp / 8; m_allocbytes += BITMAP_OVERALL_ALIGN - 1; - m_alloc = new UINT8[m_allocbytes]; + m_alloc = new uint8_t[m_allocbytes]; // clear to 0 by default memset(m_alloc, 0, m_allocbytes); @@ -225,7 +225,7 @@ void bitmap_t::resize(int width, int height, int xslop, int yslop) // determine how much memory we need for the new bitmap int new_rowpixels = compute_rowpixels(width, xslop); - UINT32 new_allocbytes = new_rowpixels * (height + 2 * yslop) * m_bpp / 8; + uint32_t new_allocbytes = new_rowpixels * (height + 2 * yslop) * m_bpp / 8; new_allocbytes += BITMAP_OVERALL_ALIGN - 1; // if we need more memory, just realloc @@ -354,7 +354,7 @@ void bitmap_t::set_palette(palette_t *palette) } /** - * @fn void bitmap_t::fill(UINT32 color, const rectangle &cliprect) + * @fn void bitmap_t::fill(uint32_t color, const rectangle &cliprect) * * @brief ------------------------------------------------- * fill -- fill a bitmap with a solid color @@ -364,7 +364,7 @@ void bitmap_t::set_palette(palette_t *palette) * @param cliprect The cliprect. */ -void bitmap_t::fill(UINT32 color, const rectangle &cliprect) +void bitmap_t::fill(uint32_t color, const rectangle &cliprect) { // if we have a cliprect, intersect with that rectangle fill = cliprect; @@ -377,29 +377,29 @@ void bitmap_t::fill(UINT32 color, const rectangle &cliprect) { case 8: // 8bpp always uses memset - for (INT32 y = fill.min_y; y <= fill.max_y; y++) - memset(raw_pixptr(y, fill.min_x), (UINT8)color, fill.width()); + for (int32_t y = fill.min_y; y <= fill.max_y; y++) + memset(raw_pixptr(y, fill.min_x), (uint8_t)color, fill.width()); break; case 16: // 16bpp can use memset if the bytes are equal - if ((UINT8)(color >> 8) == (UINT8)color) + if ((uint8_t)(color >> 8) == (uint8_t)color) { - for (INT32 y = fill.min_y; y <= fill.max_y; y++) - memset(raw_pixptr(y, fill.min_x), (UINT8)color, fill.width() * 2); + for (int32_t y = fill.min_y; y <= fill.max_y; y++) + memset(raw_pixptr(y, fill.min_x), (uint8_t)color, fill.width() * 2); } else { // Fill the first line the hard way - UINT16 *destrow = &pixt(fill.min_y); - for (INT32 x = fill.min_x; x <= fill.max_x; x++) - destrow[x] = (UINT16)color; + uint16_t *destrow = &pixt(fill.min_y); + for (int32_t x = fill.min_x; x <= fill.max_x; x++) + destrow[x] = (uint16_t)color; // For the other lines, just copy the first one - void *destrow0 = &pixt(fill.min_y, fill.min_x); - for (INT32 y = fill.min_y + 1; y <= fill.max_y; y++) + void *destrow0 = &pixt(fill.min_y, fill.min_x); + for (int32_t y = fill.min_y + 1; y <= fill.max_y; y++) { - destrow = &pixt(y, fill.min_x); + destrow = &pixt(y, fill.min_x); memcpy(destrow, destrow0, fill.width() * 2); } } @@ -407,23 +407,23 @@ void bitmap_t::fill(UINT32 color, const rectangle &cliprect) case 32: // 32bpp can use memset if the bytes are equal - if ((UINT8)(color >> 8) == (UINT8)color && (UINT16)(color >> 16) == (UINT16)color) + if ((uint8_t)(color >> 8) == (uint8_t)color && (uint16_t)(color >> 16) == (uint16_t)color) { - for (INT32 y = fill.min_y; y <= fill.max_y; y++) - memset(&pixt(y, fill.min_x), (UINT8)color, fill.width() * 4); + for (int32_t y = fill.min_y; y <= fill.max_y; y++) + memset(&pixt(y, fill.min_x), (uint8_t)color, fill.width() * 4); } else { // Fill the first line the hard way - UINT32 *destrow = &pixt(fill.min_y); - for (INT32 x = fill.min_x; x <= fill.max_x; x++) - destrow[x] = (UINT32)color; + uint32_t *destrow = &pixt(fill.min_y); + for (int32_t x = fill.min_x; x <= fill.max_x; x++) + destrow[x] = (uint32_t)color; // For the other lines, just copy the first one - UINT32 *destrow0 = &pixt(fill.min_y, fill.min_x); - for (INT32 y = fill.min_y + 1; y <= fill.max_y; y++) + uint32_t *destrow0 = &pixt(fill.min_y, fill.min_x); + for (int32_t y = fill.min_y + 1; y <= fill.max_y; y++) { - destrow = &pixt(y, fill.min_x); + destrow = &pixt(y, fill.min_x); memcpy(destrow, destrow0, fill.width() * 4); } } @@ -431,23 +431,23 @@ void bitmap_t::fill(UINT32 color, const rectangle &cliprect) case 64: // 64bpp can use memset if the bytes are equal - if ((UINT8)(color >> 8) == (UINT8)color && (UINT16)(color >> 16) == (UINT16)color) + if ((uint8_t)(color >> 8) == (uint8_t)color && (uint16_t)(color >> 16) == (uint16_t)color) { - for (INT32 y = fill.min_y; y <= fill.max_y; y++) - memset(&pixt(y, fill.min_x), (UINT8)color, fill.width() * 8); + for (int32_t y = fill.min_y; y <= fill.max_y; y++) + memset(&pixt(y, fill.min_x), (uint8_t)color, fill.width() * 8); } else { // Fill the first line the hard way - UINT64 *destrow = &pixt(fill.min_y); - for (INT32 x = fill.min_x; x <= fill.max_x; x++) - destrow[x] = (UINT64)color; + uint64_t *destrow = &pixt(fill.min_y); + for (int32_t x = fill.min_x; x <= fill.max_x; x++) + destrow[x] = (uint64_t)color; // For the other lines, just copy the first one - UINT64 *destrow0 = &pixt(fill.min_y, fill.min_x); - for (INT32 y = fill.min_y + 1; y <= fill.max_y; y++) + uint64_t *destrow0 = &pixt(fill.min_y, fill.min_x); + for (int32_t y = fill.min_y + 1; y <= fill.max_y; y++) { - destrow = &pixt(y, fill.min_x); + destrow = &pixt(y, fill.min_x); memcpy(destrow, destrow0, fill.width() * 8); } } diff --git a/src/lib/util/bitmap.h b/src/lib/util/bitmap.h index 23d05af90df..7d367bcb5cb 100644 --- a/src/lib/util/bitmap.h +++ b/src/lib/util/bitmap.h @@ -45,14 +45,14 @@ public: // construction/destruction rectangle() : min_x(0), max_x(0), min_y(0), max_y(0) { } - rectangle(INT32 minx, INT32 maxx, INT32 miny, INT32 maxy) + rectangle(int32_t minx, int32_t maxx, int32_t miny, int32_t maxy) : min_x(minx), max_x(maxx), min_y(miny), max_y(maxy) { } // getters - INT32 left() const { return min_x; } - INT32 right() const { return max_x; } - INT32 top() const { return min_y; } - INT32 bottom() const { return max_y; } + int32_t left() const { return min_x; } + int32_t right() const { return max_x; } + int32_t top() const { return min_y; } + int32_t bottom() const { return max_y; } // compute intersection with another rect rectangle &operator&=(const rectangle &src) @@ -84,32 +84,32 @@ public: // other helpers bool empty() const { return (min_x > max_x || min_y > max_y); } - bool contains(INT32 x, INT32 y) const { return (x >= min_x && x <= max_x && y >= min_y && y <= max_y); } + bool contains(int32_t x, int32_t y) const { return (x >= min_x && x <= max_x && y >= min_y && y <= max_y); } bool contains(const rectangle &rect) const { return (min_x <= rect.min_x && max_x >= rect.max_x && min_y <= rect.min_y && max_y >= rect.max_y); } - INT32 width() const { return max_x + 1 - min_x; } - INT32 height() const { return max_y + 1 - min_y; } - INT32 xcenter() const { return (min_x + max_x + 1) / 2; } - INT32 ycenter() const { return (min_y + max_y + 1) / 2; } + int32_t width() const { return max_x + 1 - min_x; } + int32_t height() const { return max_y + 1 - min_y; } + int32_t xcenter() const { return (min_x + max_x + 1) / 2; } + int32_t ycenter() const { return (min_y + max_y + 1) / 2; } // setters - void set(INT32 minx, INT32 maxx, INT32 miny, INT32 maxy) { min_x = minx; max_x = maxx; min_y = miny; max_y = maxy; } - void setx(INT32 minx, INT32 maxx) { min_x = minx; max_x = maxx; } - void sety(INT32 miny, INT32 maxy) { min_y = miny; max_y = maxy; } - void set_width(INT32 width) { max_x = min_x + width - 1; } - void set_height(INT32 height) { max_y = min_y + height - 1; } - void set_origin(INT32 x, INT32 y) { max_x += x - min_x; max_y += y - min_y; min_x = x; min_y = y; } - void set_size(INT32 width, INT32 height) { set_width(width); set_height(height); } + void set(int32_t minx, int32_t maxx, int32_t miny, int32_t maxy) { min_x = minx; max_x = maxx; min_y = miny; max_y = maxy; } + void setx(int32_t minx, int32_t maxx) { min_x = minx; max_x = maxx; } + void sety(int32_t miny, int32_t maxy) { min_y = miny; max_y = maxy; } + void set_width(int32_t width) { max_x = min_x + width - 1; } + void set_height(int32_t height) { max_y = min_y + height - 1; } + void set_origin(int32_t x, int32_t y) { max_x += x - min_x; max_y += y - min_y; min_x = x; min_y = y; } + void set_size(int32_t width, int32_t height) { set_width(width); set_height(height); } // offset helpers - void offset(INT32 xdelta, INT32 ydelta) { min_x += xdelta; max_x += xdelta; min_y += ydelta; max_y += ydelta; } - void offsetx(INT32 delta) { min_x += delta; max_x += delta; } - void offsety(INT32 delta) { min_y += delta; max_y += delta; } + void offset(int32_t xdelta, int32_t ydelta) { min_x += xdelta; max_x += xdelta; min_y += ydelta; max_y += ydelta; } + void offsetx(int32_t delta) { min_x += delta; max_x += delta; } + void offsety(int32_t delta) { min_y += delta; max_y += delta; } // internal state - INT32 min_x; // minimum X, or left coordinate - INT32 max_x; // maximum X, or right coordinate (inclusive) - INT32 min_y; // minimum Y, or top coordinate - INT32 max_y; // maximum Y, or bottom coordinate (inclusive) + int32_t min_x; // minimum X, or left coordinate + int32_t max_x; // maximum X, or right coordinate (inclusive) + int32_t min_y; // minimum Y, or top coordinate + int32_t max_y; // maximum Y, or bottom coordinate (inclusive) }; @@ -135,11 +135,11 @@ public: void reset(); // getters - INT32 width() const { return m_width; } - INT32 height() const { return m_height; } - INT32 rowpixels() const { return m_rowpixels; } - INT32 rowbytes() const { return m_rowpixels * m_bpp / 8; } - UINT8 bpp() const { return m_bpp; } + int32_t width() const { return m_width; } + int32_t height() const { return m_height; } + int32_t rowpixels() const { return m_rowpixels; } + int32_t rowbytes() const { return m_rowpixels * m_bpp / 8; } + uint8_t bpp() const { return m_bpp; } bitmap_format format() const { return m_format; } bool valid() const { return (m_base != nullptr); } palette_t *palette() const { return m_palette; } @@ -151,9 +151,9 @@ public: // operations void set_palette(palette_t *palette); - void fill(UINT32 color) { fill(color, m_cliprect); } - void fill(UINT32 color, const rectangle &cliprect); - void plot_box(int x, int y, int width, int height, UINT32 color) + void fill(uint32_t color) { fill(color, m_cliprect); } + void fill(uint32_t color, const rectangle &cliprect); + void plot_box(int x, int y, int width, int height, uint32_t color) { rectangle clip(x, x + width - 1, y, y + height - 1); fill(color, clip); @@ -161,8 +161,8 @@ public: // pixel access template - _PixelType &pixt(INT32 y, INT32 x = 0) const { return *(reinterpret_cast<_PixelType *>(m_base) + y * m_rowpixels + x); } - void *raw_pixptr(INT32 y, INT32 x = 0) const { return reinterpret_cast(m_base) + (y * m_rowpixels + x) * m_bpp / 8; } + _PixelType &pixt(int32_t y, int32_t x = 0) const { return *(reinterpret_cast<_PixelType *>(m_base) + y * m_rowpixels + x); } + void *raw_pixptr(int32_t y, int32_t x = 0) const { return reinterpret_cast(m_base) + (y * m_rowpixels + x) * m_bpp / 8; } protected: // for use by subclasses only to ensure type correctness @@ -171,18 +171,18 @@ protected: private: // internal helpers - INT32 compute_rowpixels(int width, int xslop); + int32_t compute_rowpixels(int width, int xslop); void compute_base(int xslop, int yslop); // internal state - UINT8 * m_alloc; // pointer to allocated pixel memory - UINT32 m_allocbytes; // size of our allocation + uint8_t * m_alloc; // pointer to allocated pixel memory + uint32_t m_allocbytes; // size of our allocation void * m_base; // pointer to pixel (0,0) (adjusted for padding) - INT32 m_rowpixels; // pixels per row (including padding) - INT32 m_width; // width of the bitmap - INT32 m_height; // height of the bitmap + int32_t m_rowpixels; // pixels per row (including padding) + int32_t m_width; // width of the bitmap + int32_t m_height; // height of the bitmap bitmap_format m_format; // format of the bitmap - UINT8 m_bpp; // bits per pixel + uint8_t m_bpp; // bits per pixel palette_t * m_palette; // optional palette rectangle m_cliprect; // a clipping rectangle covering the full bitmap }; @@ -200,17 +200,17 @@ private: protected: // construction/destruction -- subclasses only bitmap8_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 8, width, height, xslop, yslop) { } - bitmap8_t(bitmap_format format, UINT8 *base, int width, int height, int rowpixels) : bitmap_t(format, 8, base, width, height, rowpixels) { assert(valid_format(format)); } + bitmap8_t(bitmap_format format, uint8_t *base, int width, int height, int rowpixels) : bitmap_t(format, 8, base, width, height, rowpixels) { assert(valid_format(format)); } bitmap8_t(bitmap_format format, bitmap8_t &source, const rectangle &subrect) : bitmap_t(format, 8, source, subrect) { } public: // getters - UINT8 bpp() const { return 8; } + uint8_t bpp() const { return 8; } // pixel accessors - typedef UINT8 pixel_t; - pixel_t &pix(INT32 y, INT32 x = 0) const { return pixt(y, x); } - pixel_t &pix8(INT32 y, INT32 x = 0) const { return pixt(y, x); } + typedef uint8_t pixel_t; + pixel_t &pix(int32_t y, int32_t x = 0) const { return pixt(y, x); } + pixel_t &pix8(int32_t y, int32_t x = 0) const { return pixt(y, x); } }; // 16bpp bitmaps @@ -223,17 +223,17 @@ private: protected: // construction/destruction -- subclasses only bitmap16_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 16, width, height, xslop, yslop) { assert(valid_format(format)); } - bitmap16_t(bitmap_format format, UINT16 *base, int width, int height, int rowpixels) : bitmap_t(format, 16, base, width, height, rowpixels) { assert(valid_format(format)); } + bitmap16_t(bitmap_format format, uint16_t *base, int width, int height, int rowpixels) : bitmap_t(format, 16, base, width, height, rowpixels) { assert(valid_format(format)); } bitmap16_t(bitmap_format format, bitmap16_t &source, const rectangle &subrect) : bitmap_t(format, 16, source, subrect) { } public: // getters - UINT8 bpp() const { return 16; } + uint8_t bpp() const { return 16; } // pixel accessors - typedef UINT16 pixel_t; - pixel_t &pix(INT32 y, INT32 x = 0) const { return pixt(y, x); } - pixel_t &pix16(INT32 y, INT32 x = 0) const { return pixt(y, x); } + typedef uint16_t pixel_t; + pixel_t &pix(int32_t y, int32_t x = 0) const { return pixt(y, x); } + pixel_t &pix16(int32_t y, int32_t x = 0) const { return pixt(y, x); } }; // 32bpp bitmaps @@ -246,17 +246,17 @@ private: protected: // construction/destruction -- subclasses only bitmap32_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 32, width, height, xslop, yslop) { assert(valid_format(format)); } - bitmap32_t(bitmap_format format, UINT32 *base, int width, int height, int rowpixels) : bitmap_t(format, 32, base, width, height, rowpixels) { assert(valid_format(format)); } + bitmap32_t(bitmap_format format, uint32_t *base, int width, int height, int rowpixels) : bitmap_t(format, 32, base, width, height, rowpixels) { assert(valid_format(format)); } bitmap32_t(bitmap_format format, bitmap32_t &source, const rectangle &subrect) : bitmap_t(format, 32, source, subrect) { } public: // getters - UINT8 bpp() const { return 32; } + uint8_t bpp() const { return 32; } // pixel accessors - typedef UINT32 pixel_t; - pixel_t &pix(INT32 y, INT32 x = 0) const { return pixt(y, x); } - pixel_t &pix32(INT32 y, INT32 x = 0) const { return pixt(y, x); } + typedef uint32_t pixel_t; + pixel_t &pix(int32_t y, int32_t x = 0) const { return pixt(y, x); } + pixel_t &pix32(int32_t y, int32_t x = 0) const { return pixt(y, x); } }; // 64bpp bitmaps @@ -269,17 +269,17 @@ private: protected: // construction/destruction -- subclasses only bitmap64_t(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, 64, width, height, xslop, yslop) { assert(valid_format(format)); } - bitmap64_t(bitmap_format format, UINT64 *base, int width, int height, int rowpixels) : bitmap_t(format, 64, base, width, height, rowpixels) { assert(valid_format(format)); } + bitmap64_t(bitmap_format format, uint64_t *base, int width, int height, int rowpixels) : bitmap_t(format, 64, base, width, height, rowpixels) { assert(valid_format(format)); } bitmap64_t(bitmap_format format, bitmap64_t &source, const rectangle &subrect) : bitmap_t(format, 64, source, subrect) { } public: // getters - UINT8 bpp() const { return 64; } + uint8_t bpp() const { return 64; } // pixel accessors - typedef UINT64 pixel_t; - pixel_t &pix(INT32 y, INT32 x = 0) const { return pixt(y, x); } - pixel_t &pix64(INT32 y, INT32 x = 0) const { return pixt(y, x); } + typedef uint64_t pixel_t; + pixel_t &pix(int32_t y, int32_t x = 0) const { return pixt(y, x); } + pixel_t &pix64(int32_t y, int32_t x = 0) const { return pixt(y, x); } }; @@ -293,9 +293,9 @@ class bitmap_ind8 : public bitmap8_t public: // construction/destruction bitmap_ind8(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap8_t(k_bitmap_format, width, height, xslop, yslop) { } - bitmap_ind8(UINT8 *base, int width, int height, int rowpixels) : bitmap8_t(k_bitmap_format, base, width, height, rowpixels) { } + bitmap_ind8(uint8_t *base, int width, int height, int rowpixels) : bitmap8_t(k_bitmap_format, base, width, height, rowpixels) { } bitmap_ind8(bitmap_ind8 &source, const rectangle &subrect) : bitmap8_t(k_bitmap_format, source, subrect) { } - void wrap(UINT8 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } + void wrap(uint8_t *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } void wrap(const bitmap_ind8 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast(source), subrect); } // getters @@ -310,9 +310,9 @@ class bitmap_ind16 : public bitmap16_t public: // construction/destruction bitmap_ind16(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap16_t(k_bitmap_format, width, height, xslop, yslop) { } - bitmap_ind16(UINT16 *base, int width, int height, int rowpixels) : bitmap16_t(k_bitmap_format, base, width, height, rowpixels) { } + bitmap_ind16(uint16_t *base, int width, int height, int rowpixels) : bitmap16_t(k_bitmap_format, base, width, height, rowpixels) { } bitmap_ind16(bitmap_ind16 &source, const rectangle &subrect) : bitmap16_t(k_bitmap_format, source, subrect) { } - void wrap(UINT16 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } + void wrap(uint16_t *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } void wrap(const bitmap_ind8 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast(source), subrect); } // getters @@ -327,9 +327,9 @@ class bitmap_ind32 : public bitmap32_t public: // construction/destruction bitmap_ind32(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap32_t(k_bitmap_format, width, height, xslop, yslop) { } - bitmap_ind32(UINT32 *base, int width, int height, int rowpixels) : bitmap32_t(k_bitmap_format, base, width, height, rowpixels) { } + bitmap_ind32(uint32_t *base, int width, int height, int rowpixels) : bitmap32_t(k_bitmap_format, base, width, height, rowpixels) { } bitmap_ind32(bitmap_ind32 &source, const rectangle &subrect) : bitmap32_t(k_bitmap_format, source, subrect) { } - void wrap(UINT32 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } + void wrap(uint32_t *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } void wrap(const bitmap_ind8 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast(source), subrect); } // getters @@ -344,9 +344,9 @@ class bitmap_ind64 : public bitmap64_t public: // construction/destruction bitmap_ind64(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap64_t(k_bitmap_format, width, height, xslop, yslop) { } - bitmap_ind64(UINT64 *base, int width, int height, int rowpixels) : bitmap64_t(k_bitmap_format, base, width, height, rowpixels) { } + bitmap_ind64(uint64_t *base, int width, int height, int rowpixels) : bitmap64_t(k_bitmap_format, base, width, height, rowpixels) { } bitmap_ind64(bitmap_ind64 &source, const rectangle &subrect) : bitmap64_t(k_bitmap_format, source, subrect) { } - void wrap(UINT64 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } + void wrap(uint64_t *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } void wrap(const bitmap_ind8 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast(source), subrect); } // getters @@ -364,9 +364,9 @@ class bitmap_yuy16 : public bitmap16_t public: // construction/destruction bitmap_yuy16(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap16_t(k_bitmap_format, width, height, xslop, yslop) { } - bitmap_yuy16(UINT16 *base, int width, int height, int rowpixels) : bitmap16_t(k_bitmap_format, base, width, height, rowpixels) { } + bitmap_yuy16(uint16_t *base, int width, int height, int rowpixels) : bitmap16_t(k_bitmap_format, base, width, height, rowpixels) { } bitmap_yuy16(bitmap_yuy16 &source, const rectangle &subrect) : bitmap16_t(k_bitmap_format, source, subrect) { } - void wrap(UINT16 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } + void wrap(uint16_t *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } void wrap(const bitmap_yuy16 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast(source), subrect); } // getters @@ -381,9 +381,9 @@ class bitmap_rgb32 : public bitmap32_t public: // construction/destruction bitmap_rgb32(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap32_t(k_bitmap_format, width, height, xslop, yslop) { } - bitmap_rgb32(UINT32 *base, int width, int height, int rowpixels) : bitmap32_t(k_bitmap_format, base, width, height, rowpixels) { } + bitmap_rgb32(uint32_t *base, int width, int height, int rowpixels) : bitmap32_t(k_bitmap_format, base, width, height, rowpixels) { } bitmap_rgb32(bitmap_rgb32 &source, const rectangle &subrect) : bitmap32_t(k_bitmap_format, source, subrect) { } - void wrap(UINT32 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } + void wrap(uint32_t *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } void wrap(const bitmap_rgb32 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast(source), subrect); } // getters @@ -398,9 +398,9 @@ class bitmap_argb32 : public bitmap32_t public: // construction/destruction bitmap_argb32(int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap32_t(k_bitmap_format, width, height, xslop, yslop) { } - bitmap_argb32(UINT32 *base, int width, int height, int rowpixels) : bitmap32_t(k_bitmap_format, base, width, height, rowpixels) { } + bitmap_argb32(uint32_t *base, int width, int height, int rowpixels) : bitmap32_t(k_bitmap_format, base, width, height, rowpixels) { } bitmap_argb32(bitmap_argb32 &source, const rectangle &subrect) : bitmap32_t(k_bitmap_format, source, subrect) { } - void wrap(UINT32 *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } + void wrap(uint32_t *base, int width, int height, int rowpixels) { bitmap_t::wrap(base, width, height, rowpixels); } void wrap(const bitmap_argb32 &source, const rectangle &subrect) { bitmap_t::wrap(static_cast(source), subrect); } // getters diff --git a/src/lib/util/bitstream.h b/src/lib/util/bitstream.h index 2f36271d296..0056c4ce38e 100644 --- a/src/lib/util/bitstream.h +++ b/src/lib/util/bitstream.h @@ -25,25 +25,25 @@ class bitstream_in { public: // construction/destruction - bitstream_in(const void *src, UINT32 srclength); + bitstream_in(const void *src, uint32_t srclength); // getters bool overflow() const { return ((m_doffset - m_bits / 8) > m_dlength); } - UINT32 read_offset() const; + uint32_t read_offset() const; // operations - UINT32 read(int numbits); - UINT32 peek(int numbits); + uint32_t read(int numbits); + uint32_t peek(int numbits); void remove(int numbits); - UINT32 flush(); + uint32_t flush(); private: // internal state - UINT32 m_buffer; // current bit accumulator + uint32_t m_buffer; // current bit accumulator int m_bits; // number of bits in the accumulator - const UINT8 * m_read; // read pointer - UINT32 m_doffset; // byte offset within the data - UINT32 m_dlength; // length of the data + const uint8_t * m_read; // read pointer + uint32_t m_doffset; // byte offset within the data + uint32_t m_dlength; // length of the data }; @@ -52,22 +52,22 @@ class bitstream_out { public: // construction/destruction - bitstream_out(void *dest, UINT32 destlength); + bitstream_out(void *dest, uint32_t destlength); // getters bool overflow() const { return (m_doffset > m_dlength); } // operations - void write(UINT32 newbits, int numbits); - UINT32 flush(); + void write(uint32_t newbits, int numbits); + uint32_t flush(); private: // internal state - UINT32 m_buffer; // current bit accumulator + uint32_t m_buffer; // current bit accumulator int m_bits; // number of bits in the accumulator - UINT8 * m_write; // write pointer - UINT32 m_doffset; // byte offset within the data - UINT32 m_dlength; // length of the data + uint8_t * m_write; // write pointer + uint32_t m_doffset; // byte offset within the data + uint32_t m_dlength; // length of the data }; @@ -80,10 +80,10 @@ private: // bitstream_in - constructor //------------------------------------------------- -inline bitstream_in::bitstream_in(const void *src, UINT32 srclength) +inline bitstream_in::bitstream_in(const void *src, uint32_t srclength) : m_buffer(0), m_bits(0), - m_read(reinterpret_cast(src)), + m_read(reinterpret_cast(src)), m_doffset(0), m_dlength(srclength) { @@ -95,7 +95,7 @@ inline bitstream_in::bitstream_in(const void *src, UINT32 srclength) // but don't advance the input pointer //------------------------------------------------- -inline UINT32 bitstream_in::peek(int numbits) +inline uint32_t bitstream_in::peek(int numbits) { if (numbits == 0) return 0; @@ -133,9 +133,9 @@ inline void bitstream_in::remove(int numbits) // read - fetch the requested number of bits //------------------------------------------------- -inline UINT32 bitstream_in::read(int numbits) +inline uint32_t bitstream_in::read(int numbits) { - UINT32 result = peek(numbits); + uint32_t result = peek(numbits); remove(numbits); return result; } @@ -145,9 +145,9 @@ inline UINT32 bitstream_in::read(int numbits) // read_offset - return the current read offset //------------------------------------------------- -inline UINT32 bitstream_in::read_offset() const +inline uint32_t bitstream_in::read_offset() const { - UINT32 result = m_doffset; + uint32_t result = m_doffset; int bits = m_bits; while (bits >= 8) { @@ -162,7 +162,7 @@ inline UINT32 bitstream_in::read_offset() const // flush - flush to the nearest byte //------------------------------------------------- -inline UINT32 bitstream_in::flush() +inline uint32_t bitstream_in::flush() { while (m_bits >= 8) { @@ -178,10 +178,10 @@ inline UINT32 bitstream_in::flush() // bitstream_out - constructor //------------------------------------------------- -inline bitstream_out::bitstream_out(void *dest, UINT32 destlength) +inline bitstream_out::bitstream_out(void *dest, uint32_t destlength) : m_buffer(0), m_bits(0), - m_write(reinterpret_cast(dest)), + m_write(reinterpret_cast(dest)), m_doffset(0), m_dlength(destlength) { @@ -194,7 +194,7 @@ inline bitstream_out::bitstream_out(void *dest, UINT32 destlength) // data stream //------------------------------------------------- -inline void bitstream_out::write(UINT32 newbits, int numbits) +inline void bitstream_out::write(uint32_t newbits, int numbits) { // flush the buffer if we're going to overflow it if (m_bits + numbits > 32) @@ -224,7 +224,7 @@ inline void bitstream_out::write(UINT32 newbits, int numbits) // final output size in bytes //------------------------------------------------- -inline UINT32 bitstream_out::flush() +inline uint32_t bitstream_out::flush() { while (m_bits > 0) { diff --git a/src/lib/util/cdrom.cpp b/src/lib/util/cdrom.cpp index 7b5dae18a4e..3da270b55e3 100644 --- a/src/lib/util/cdrom.cpp +++ b/src/lib/util/cdrom.cpp @@ -130,7 +130,7 @@ struct cdrom_file -------------------------------------------------*/ /** - * @fn static inline UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum) + * @fn static inline uint32_t physical_to_chd_lba(cdrom_file *file, uint32_t physlba, uint32_t &tracknum) * * @brief Physical to chd lba. * @@ -138,12 +138,12 @@ struct cdrom_file * @param physlba The physlba. * @param [in,out] tracknum The tracknum. * - * @return An UINT32. + * @return An uint32_t. */ -static inline UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum) +static inline uint32_t physical_to_chd_lba(cdrom_file *file, uint32_t physlba, uint32_t &tracknum) { - UINT32 chdlba; + uint32_t chdlba; int track; /* loop until our current LBA is less than the start LBA of the next track */ @@ -164,7 +164,7 @@ static inline UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT3 -------------------------------------------------*/ /** - * @fn static inline UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum) + * @fn static inline uint32_t logical_to_chd_lba(cdrom_file *file, uint32_t loglba, uint32_t &tracknum) * * @brief Logical to chd lba. * @@ -172,12 +172,12 @@ static inline UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT3 * @param loglba The loglba. * @param [in,out] tracknum The tracknum. * - * @return An UINT32. + * @return An uint32_t. */ -static inline UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum) +static inline uint32_t logical_to_chd_lba(cdrom_file *file, uint32_t loglba, uint32_t &tracknum) { - UINT32 chdlba, physlba; + uint32_t chdlba, physlba; int track; /* loop until our current LBA is less than the start LBA of the next track */ @@ -221,7 +221,7 @@ cdrom_file *cdrom_open(const char *inputfile) { int i; cdrom_file *file; - UINT32 physofs, logofs; + uint32_t physofs, logofs; /* allocate memory for the CD-ROM file */ file = new (std::nothrow) cdrom_file(); @@ -317,7 +317,7 @@ cdrom_file *cdrom_open(chd_file *chd) { int i; cdrom_file *file; - UINT32 physofs, chdofs, logofs; + uint32_t physofs, chdofs, logofs; chd_error err; /* punt if no CHD */ @@ -432,7 +432,7 @@ void cdrom_close(cdrom_file *file) ***************************************************************************/ /** - * @fn chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UINT32 chdsector, UINT32 tracknum, UINT32 startoffs, UINT32 length) + * @fn chd_error read_partial_sector(cdrom_file *file, void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length) * * @brief Reads partial sector. * @@ -447,7 +447,7 @@ void cdrom_close(cdrom_file *file) * @return The partial sector. */ -chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UINT32 chdsector, UINT32 tracknum, UINT32 startoffs, UINT32 length, bool phys=false) +chd_error read_partial_sector(cdrom_file *file, void *dest, uint32_t lbasector, uint32_t chdsector, uint32_t tracknum, uint32_t startoffs, uint32_t length, bool phys=false) { chd_error result = CHDERR_NONE; bool needswap = false; @@ -466,7 +466,7 @@ chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UI // if a CHD, just read if (file->chd != nullptr) { - result = file->chd->read_bytes(UINT64(chdsector) * UINT64(CD_FRAME_SIZE) + startoffs, dest, length); + result = file->chd->read_bytes(uint64_t(chdsector) * uint64_t(CD_FRAME_SIZE) + startoffs, dest, length); /* swap CDDA in the case of LE GDROMs */ if ((file->cdtoc.flags & CD_FLAG_GDROMLE) && (file->cdtoc.tracks[tracknum].trktype == CD_TRACK_AUDIO)) needswap = true; @@ -476,7 +476,7 @@ chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UI // else read from the appropriate file util::core_file &srcfile = *file->fhandle[tracknum]; - UINT64 sourcefileoffset = file->track_info.track[tracknum].offset; + uint64_t sourcefileoffset = file->track_info.track[tracknum].offset; int bytespersector = file->cdtoc.tracks[tracknum].datasize + file->cdtoc.tracks[tracknum].subsize; sourcefileoffset += chdsector * bytespersector + startoffs; @@ -491,7 +491,7 @@ chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UI if (needswap) { - UINT8 *buffer = (UINT8 *)dest - startoffs; + uint8_t *buffer = (uint8_t *)dest - startoffs; for (int swapindex = startoffs; swapindex < 2352; swapindex += 2 ) { int swaptemp = buffer[ swapindex ]; @@ -509,7 +509,7 @@ chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UI -------------------------------------------------*/ /** - * @fn UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 datatype, bool phys) + * @fn uint32_t cdrom_read_data(cdrom_file *file, uint32_t lbasector, void *buffer, uint32_t datatype, bool phys) * * @brief Cdrom read data. * @@ -519,17 +519,17 @@ chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UI * @param datatype The datatype. * @param phys true to physical. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 datatype, bool phys) +uint32_t cdrom_read_data(cdrom_file *file, uint32_t lbasector, void *buffer, uint32_t datatype, bool phys) { if (file == nullptr) return 0; // compute CHD sector and tracknumber - UINT32 tracknum = 0; - UINT32 chdsector; + uint32_t tracknum = 0; + uint32_t chdsector; if (phys) { @@ -541,7 +541,7 @@ UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 } /* copy out the requested sector */ - UINT32 tracktype = file->cdtoc.tracks[tracknum].trktype; + uint32_t tracktype = file->cdtoc.tracks[tracknum].trktype; if ((datatype == tracktype) || (datatype == CD_TRACK_RAW_DONTCARE)) { @@ -558,10 +558,10 @@ UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 /* return 2352 byte mode 1 raw sector from 2048 bytes of mode 1 data */ if ((datatype == CD_TRACK_MODE1_RAW) && (tracktype == CD_TRACK_MODE1)) { - UINT8 *bufptr = (UINT8 *)buffer; - UINT32 msf = lba_to_msf(lbasector); + uint8_t *bufptr = (uint8_t *)buffer; + uint32_t msf = lba_to_msf(lbasector); - static const UINT8 syncbytes[12] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00}; + static const uint8_t syncbytes[12] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00}; memcpy(bufptr, syncbytes, 12); bufptr[12] = msf>>16; bufptr[13] = msf>>8; @@ -595,7 +595,7 @@ UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 -------------------------------------------------*/ /** - * @fn UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool phys) + * @fn uint32_t cdrom_read_subcode(cdrom_file *file, uint32_t lbasector, void *buffer, bool phys) * * @brief Cdrom read subcode. * @@ -604,17 +604,17 @@ UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 * @param [in,out] buffer If non-null, the buffer. * @param phys true to physical. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool phys) +uint32_t cdrom_read_subcode(cdrom_file *file, uint32_t lbasector, void *buffer, bool phys) { if (file == nullptr) return ~0; // compute CHD sector and tracknumber - UINT32 tracknum = 0; - UINT32 chdsector; + uint32_t tracknum = 0; + uint32_t chdsector; if (phys) { @@ -645,19 +645,19 @@ UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool -------------------------------------------------*/ /** - * @fn UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame) + * @fn uint32_t cdrom_get_track(cdrom_file *file, uint32_t frame) * * @brief Cdrom get track. * * @param [in,out] file If non-null, the file. * @param frame The frame. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame) +uint32_t cdrom_get_track(cdrom_file *file, uint32_t frame) { - UINT32 track = 0; + uint32_t track = 0; if (file == nullptr) return ~0; @@ -675,17 +675,17 @@ UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame) -------------------------------------------------*/ /** - * @fn UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track) + * @fn uint32_t cdrom_get_track_start(cdrom_file *file, uint32_t track) * * @brief Cdrom get track start. * * @param [in,out] file If non-null, the file. * @param track The track. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track) +uint32_t cdrom_get_track_start(cdrom_file *file, uint32_t track) { if (file == nullptr) return ~0; @@ -703,17 +703,17 @@ UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track) -------------------------------------------------*/ /** - * @fn UINT32 cdrom_get_track_start_phys(cdrom_file *file, UINT32 track) + * @fn uint32_t cdrom_get_track_start_phys(cdrom_file *file, uint32_t track) * * @brief Cdrom get track start physical. * * @param [in,out] file If non-null, the file. * @param track The track. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 cdrom_get_track_start_phys(cdrom_file *file, UINT32 track) +uint32_t cdrom_get_track_start_phys(cdrom_file *file, uint32_t track) { if (file == nullptr) return ~0; @@ -843,7 +843,7 @@ const cdrom_toc *cdrom_get_toc(cdrom_file *file) -------------------------------------------------*/ /** - * @fn static void cdrom_get_info_from_type_string(const char *typestring, UINT32 *trktype, UINT32 *datasize) + * @fn static void cdrom_get_info_from_type_string(const char *typestring, uint32_t *trktype, uint32_t *datasize) * * @brief Cdrom get information from type string. * @@ -852,7 +852,7 @@ const cdrom_toc *cdrom_get_toc(cdrom_file *file) * @param [in,out] datasize If non-null, the datasize. */ -static void cdrom_get_info_from_type_string(const char *typestring, UINT32 *trktype, UINT32 *datasize) +static void cdrom_get_info_from_type_string(const char *typestring, uint32_t *trktype, uint32_t *datasize) { if (!strcmp(typestring, "MODE1")) { @@ -1035,7 +1035,7 @@ void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_t -------------------------------------------------*/ /** - * @fn const char *cdrom_get_type_string(UINT32 trktype) + * @fn const char *cdrom_get_type_string(uint32_t trktype) * * @brief Cdrom get type string. * @@ -1044,7 +1044,7 @@ void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_t * @return null if it fails, else a char*. */ -const char *cdrom_get_type_string(UINT32 trktype) +const char *cdrom_get_type_string(uint32_t trktype) { switch (trktype) { @@ -1067,7 +1067,7 @@ const char *cdrom_get_type_string(UINT32 trktype) -------------------------------------------------*/ /** - * @fn const char *cdrom_get_subtype_string(UINT32 subtype) + * @fn const char *cdrom_get_subtype_string(uint32_t subtype) * * @brief Cdrom get subtype string. * @@ -1076,7 +1076,7 @@ const char *cdrom_get_type_string(UINT32 trktype) * @return null if it fails, else a char*. */ -const char *cdrom_get_subtype_string(UINT32 subtype) +const char *cdrom_get_subtype_string(uint32_t subtype) { switch (subtype) { @@ -1225,13 +1225,13 @@ chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc) printf("toc->numtrks = %u?!\n", toc->numtrks); /* look for old-style metadata */ - std::vector oldmetadata; + std::vector oldmetadata; err = chd->read_metadata(CDROM_OLD_METADATA_TAG, 0, oldmetadata); if (err != CHDERR_NONE) return err; /* reconstruct the TOC from it */ - UINT32 *mrp = reinterpret_cast(&oldmetadata[0]); + uint32_t *mrp = reinterpret_cast(&oldmetadata[0]); toc->numtrks = *mrp++; for (i = 0; i < CD_MAX_TRACKS; i++) @@ -1334,7 +1334,7 @@ chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc) * -------------------------------------------------. */ -static const UINT8 ecclow[256] = +static const uint8_t ecclow[256] = { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, @@ -1355,7 +1355,7 @@ static const UINT8 ecclow[256] = }; /** @brief The ecchigh[ 256]. */ -static const UINT8 ecchigh[256] = +static const uint8_t ecchigh[256] = { 0x00, 0xf4, 0xf5, 0x01, 0xf7, 0x03, 0x02, 0xf6, 0xf3, 0x07, 0x06, 0xf2, 0x04, 0xf0, 0xf1, 0x05, 0xfb, 0x0f, 0x0e, 0xfa, 0x0c, 0xf8, 0xf9, 0x0d, 0x08, 0xfc, 0xfd, 0x09, 0xff, 0x0b, 0x0a, 0xfe, @@ -1382,7 +1382,7 @@ static const UINT8 ecchigh[256] = * -------------------------------------------------. */ -static const UINT16 poffsets[ECC_P_NUM_BYTES][ECC_P_COMP] = +static const uint16_t poffsets[ECC_P_NUM_BYTES][ECC_P_COMP] = { { 0x000,0x056,0x0ac,0x102,0x158,0x1ae,0x204,0x25a,0x2b0,0x306,0x35c,0x3b2,0x408,0x45e,0x4b4,0x50a,0x560,0x5b6,0x60c,0x662,0x6b8,0x70e,0x764,0x7ba }, { 0x001,0x057,0x0ad,0x103,0x159,0x1af,0x205,0x25b,0x2b1,0x307,0x35d,0x3b3,0x409,0x45f,0x4b5,0x50b,0x561,0x5b7,0x60d,0x663,0x6b9,0x70f,0x765,0x7bb }, @@ -1479,7 +1479,7 @@ static const UINT16 poffsets[ECC_P_NUM_BYTES][ECC_P_COMP] = * -------------------------------------------------. */ -static const UINT16 qoffsets[ECC_Q_NUM_BYTES][ECC_Q_COMP] = +static const uint16_t qoffsets[ECC_Q_NUM_BYTES][ECC_Q_COMP] = { { 0x000,0x058,0x0b0,0x108,0x160,0x1b8,0x210,0x268,0x2c0,0x318,0x370,0x3c8,0x420,0x478,0x4d0,0x528,0x580,0x5d8,0x630,0x688,0x6e0,0x738,0x790,0x7e8,0x840,0x898,0x034,0x08c,0x0e4,0x13c,0x194,0x1ec,0x244,0x29c,0x2f4,0x34c,0x3a4,0x3fc,0x454,0x4ac,0x504,0x55c,0x5b4 }, { 0x001,0x059,0x0b1,0x109,0x161,0x1b9,0x211,0x269,0x2c1,0x319,0x371,0x3c9,0x421,0x479,0x4d1,0x529,0x581,0x5d9,0x631,0x689,0x6e1,0x739,0x791,0x7e9,0x841,0x899,0x035,0x08d,0x0e5,0x13d,0x195,0x1ed,0x245,0x29d,0x2f5,0x34d,0x3a5,0x3fd,0x455,0x4ad,0x505,0x55d,0x5b5 }, @@ -1542,14 +1542,14 @@ static const UINT16 qoffsets[ECC_Q_NUM_BYTES][ECC_Q_COMP] = // particular to a mode //------------------------------------------------- -inline UINT8 ecc_source_byte(const UINT8 *sector, UINT32 offset) +inline uint8_t ecc_source_byte(const uint8_t *sector, uint32_t offset) { // in mode 2 always treat these as 0 bytes return (sector[MODE_OFFSET] == 2 && offset < 4) ? 0x00 : sector[SYNC_OFFSET + SYNC_NUM_BYTES + offset]; } /** - * @fn void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8 &val1, UINT8 &val2) + * @fn void ecc_compute_bytes(const uint8_t *sector, const uint16_t *row, int rowlen, uint8_t &val1, uint8_t &val2) * * @brief ------------------------------------------------- * ecc_compute_bytes - calculate an ECC value (P or Q) @@ -1562,7 +1562,7 @@ inline UINT8 ecc_source_byte(const UINT8 *sector, UINT32 offset) * @param [in,out] val2 The second value. */ -void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8 &val1, UINT8 &val2) +void ecc_compute_bytes(const uint8_t *sector, const uint16_t *row, int rowlen, uint8_t &val1, uint8_t &val2) { val1 = val2 = 0; for (int component = 0; component < rowlen; component++) @@ -1576,7 +1576,7 @@ void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8 } /** - * @fn bool ecc_verify(const UINT8 *sector) + * @fn bool ecc_verify(const uint8_t *sector) * * @brief ------------------------------------------------- * ecc_verify - verify the P and Q ECC codes in a sector @@ -1587,12 +1587,12 @@ void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8 * @return true if it succeeds, false if it fails. */ -bool ecc_verify(const UINT8 *sector) +bool ecc_verify(const uint8_t *sector) { // first verify P bytes for (int byte = 0; byte < ECC_P_NUM_BYTES; byte++) { - UINT8 val1, val2; + uint8_t val1, val2; ecc_compute_bytes(sector, poffsets[byte], ECC_P_COMP, val1, val2); if (sector[ECC_P_OFFSET + byte] != val1 || sector[ECC_P_OFFSET + ECC_P_NUM_BYTES + byte] != val2) return false; @@ -1601,7 +1601,7 @@ bool ecc_verify(const UINT8 *sector) // then verify Q bytes for (int byte = 0; byte < ECC_Q_NUM_BYTES; byte++) { - UINT8 val1, val2; + uint8_t val1, val2; ecc_compute_bytes(sector, qoffsets[byte], ECC_Q_COMP, val1, val2); if (sector[ECC_Q_OFFSET + byte] != val1 || sector[ECC_Q_OFFSET + ECC_Q_NUM_BYTES + byte] != val2) return false; @@ -1610,7 +1610,7 @@ bool ecc_verify(const UINT8 *sector) } /** - * @fn void ecc_generate(UINT8 *sector) + * @fn void ecc_generate(uint8_t *sector) * * @brief ------------------------------------------------- * ecc_generate - generate the P and Q ECC codes for a sector, overwriting any @@ -1620,7 +1620,7 @@ bool ecc_verify(const UINT8 *sector) * @param [in,out] sector If non-null, the sector. */ -void ecc_generate(UINT8 *sector) +void ecc_generate(uint8_t *sector) { // first verify P bytes for (int byte = 0; byte < ECC_P_NUM_BYTES; byte++) @@ -1632,7 +1632,7 @@ void ecc_generate(UINT8 *sector) } /** - * @fn void ecc_clear(UINT8 *sector) + * @fn void ecc_clear(uint8_t *sector) * * @brief ------------------------------------------------- * ecc_clear - erase the ECC P and Q cods to 0 within a sector @@ -1641,7 +1641,7 @@ void ecc_generate(UINT8 *sector) * @param [in,out] sector If non-null, the sector. */ -void ecc_clear(UINT8 *sector) +void ecc_clear(uint8_t *sector) { memset(§or[ECC_P_OFFSET], 0, 2 * ECC_P_NUM_BYTES); memset(§or[ECC_Q_OFFSET], 0, 2 * ECC_Q_NUM_BYTES); diff --git a/src/lib/util/cdrom.h b/src/lib/util/cdrom.h index c495a405513..21665c1326f 100644 --- a/src/lib/util/cdrom.h +++ b/src/lib/util/cdrom.h @@ -23,7 +23,7 @@ ***************************************************************************/ // tracks are padded to a multiple of this many frames -const UINT32 CD_TRACK_PADDING = 4; +const uint32_t CD_TRACK_PADDING = 4; #define CD_MAX_TRACKS (99) /* AFAIK the theoretical limit */ #define CD_MAX_SECTOR_DATA (2352) @@ -67,33 +67,33 @@ struct cdrom_file; struct cdrom_track_info { /* fields used by CHDMAN and in MAME */ - UINT32 trktype; /* track type */ - UINT32 subtype; /* subcode data type */ - UINT32 datasize; /* size of data in each sector of this track */ - UINT32 subsize; /* size of subchannel data in each sector of this track */ - UINT32 frames; /* number of frames in this track */ - UINT32 extraframes; /* number of "spillage" frames in this track */ - UINT32 pregap; /* number of pregap frames */ - UINT32 postgap; /* number of postgap frames */ - UINT32 pgtype; /* type of sectors in pregap */ - UINT32 pgsub; /* type of subchannel data in pregap */ - UINT32 pgdatasize; /* size of data in each sector of the pregap */ - UINT32 pgsubsize; /* size of subchannel data in each sector of the pregap */ + uint32_t trktype; /* track type */ + uint32_t subtype; /* subcode data type */ + uint32_t datasize; /* size of data in each sector of this track */ + uint32_t subsize; /* size of subchannel data in each sector of this track */ + uint32_t frames; /* number of frames in this track */ + uint32_t extraframes; /* number of "spillage" frames in this track */ + uint32_t pregap; /* number of pregap frames */ + uint32_t postgap; /* number of postgap frames */ + uint32_t pgtype; /* type of sectors in pregap */ + uint32_t pgsub; /* type of subchannel data in pregap */ + uint32_t pgdatasize; /* size of data in each sector of the pregap */ + uint32_t pgsubsize; /* size of subchannel data in each sector of the pregap */ /* fields used in CHDMAN only */ - UINT32 padframes; /* number of frames of padding to add to the end of the track; needed for GDI */ + uint32_t padframes; /* number of frames of padding to add to the end of the track; needed for GDI */ /* fields used in MAME/MESS only */ - UINT32 logframeofs; /* logical frame of actual track data - offset by pregap size if pregap not physically present */ - UINT32 physframeofs; /* physical frame of actual track data in CHD data */ - UINT32 chdframeofs; /* frame number this track starts at on the CHD */ + uint32_t logframeofs; /* logical frame of actual track data - offset by pregap size if pregap not physically present */ + uint32_t physframeofs; /* physical frame of actual track data in CHD data */ + uint32_t chdframeofs; /* frame number this track starts at on the CHD */ }; struct cdrom_toc { - UINT32 numtrks; /* number of tracks */ - UINT32 flags; /* see FLAG_ above */ + uint32_t numtrks; /* number of tracks */ + uint32_t flags; /* see FLAG_ above */ cdrom_track_info tracks[CD_MAX_TRACKS]; }; @@ -110,13 +110,13 @@ void cdrom_close(cdrom_file *file); cdrom_file *cdrom_open(const char *inputfile); /* core read access */ -UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 datatype, bool phys=false); -UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool phys=false); +uint32_t cdrom_read_data(cdrom_file *file, uint32_t lbasector, void *buffer, uint32_t datatype, bool phys=false); +uint32_t cdrom_read_subcode(cdrom_file *file, uint32_t lbasector, void *buffer, bool phys=false); /* handy utilities */ -UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame); -UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track); -UINT32 cdrom_get_track_start_phys(cdrom_file *file, UINT32 track); +uint32_t cdrom_get_track(cdrom_file *file, uint32_t frame); +uint32_t cdrom_get_track_start(cdrom_file *file, uint32_t track); +uint32_t cdrom_get_track_start_phys(cdrom_file *file, uint32_t track); /* TOC utilities */ int cdrom_get_last_track(cdrom_file *file); @@ -129,15 +129,15 @@ void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_track_info *info); void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_track_info *info); void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_track_info *info); -const char *cdrom_get_type_string(UINT32 trktype); -const char *cdrom_get_subtype_string(UINT32 subtype); +const char *cdrom_get_type_string(uint32_t trktype); +const char *cdrom_get_subtype_string(uint32_t subtype); chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc); chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc); // ECC utilities -bool ecc_verify(const UINT8 *sector); -void ecc_generate(UINT8 *sector); -void ecc_clear(UINT8 *sector); +bool ecc_verify(const uint8_t *sector); +void ecc_generate(uint8_t *sector); +void ecc_clear(uint8_t *sector); @@ -145,14 +145,14 @@ void ecc_clear(UINT8 *sector); INLINE FUNCTIONS ***************************************************************************/ -static inline UINT32 msf_to_lba(UINT32 msf) +static inline uint32_t msf_to_lba(uint32_t msf) { return ( ((msf&0x00ff0000)>>16) * 60 * 75) + (((msf&0x0000ff00)>>8) * 75) + ((msf&0x000000ff)>>0); } -static inline UINT32 lba_to_msf(UINT32 lba) +static inline uint32_t lba_to_msf(uint32_t lba) { - UINT8 m, s, f; + uint8_t m, s, f; m = lba / (60 * 75); lba -= m * (60 * 75); @@ -167,9 +167,9 @@ static inline UINT32 lba_to_msf(UINT32 lba) // segacd needs it like this.. investigate // Angelo also says PCE tracks often start playing at the // wrong address.. related? -static inline UINT32 lba_to_msf_alt(int lba) +static inline uint32_t lba_to_msf_alt(int lba) { - UINT32 ret = 0; + uint32_t ret = 0; ret |= ((lba / (60 * 75))&0xff)<<16; ret |= (((lba / 75) % 60)&0xff)<<8; diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp index 8bce55cb947..19836a8ee2a 100644 --- a/src/lib/util/chd.cpp +++ b/src/lib/util/chd.cpp @@ -35,10 +35,10 @@ const char *CDROM_TRACK_METADATA2_FORMAT = "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:% const char *GDROM_TRACK_METADATA_FORMAT = "TRACK:%d TYPE:%s SUBTYPE:%s FRAMES:%d PAD:%d PREGAP:%d PGTYPE:%s PGSUB:%s POSTGAP:%d"; const char *AV_METADATA_FORMAT = "FPS:%d.%06d WIDTH:%d HEIGHT:%d INTERLACED:%d CHANNELS:%d SAMPLERATE:%d"; -static const UINT32 METADATA_HEADER_SIZE = 16; // metadata header size +static const uint32_t METADATA_HEADER_SIZE = 16; // metadata header size -static const UINT8 V34_MAP_ENTRY_FLAG_TYPE_MASK = 0x0f; // what type of hunk -static const UINT8 V34_MAP_ENTRY_FLAG_NO_CRC = 0x10; // no CRC is present +static const uint8_t V34_MAP_ENTRY_FLAG_TYPE_MASK = 0x0f; // what type of hunk +static const uint8_t V34_MAP_ENTRY_FLAG_NO_CRC = 0x10; // no CRC is present @@ -101,12 +101,12 @@ enum // description of where a metadata entry lives within the file struct chd_file::metadata_entry { - UINT64 offset; // offset within the file of the header - UINT64 next; // offset within the file of the next header - UINT64 prev; // offset within the file of the previous header - UINT32 length; // length of the metadata - UINT32 metatag; // metadata tag - UINT8 flags; // flag bits + uint64_t offset; // offset within the file of the header + uint64_t next; // offset within the file of the next header + uint64_t prev; // offset within the file of the previous header + uint32_t length; // length of the metadata + uint32_t metatag; // metadata tag + uint8_t flags; // flag bits }; @@ -114,7 +114,7 @@ struct chd_file::metadata_entry struct chd_file::metadata_hash { - UINT8 tag[4]; // tag of the metadata in big-endian + uint8_t tag[4]; // tag of the metadata in big-endian util::sha1_t sha1; // hash data }; @@ -129,9 +129,9 @@ struct chd_file::metadata_hash // a byte buffer //------------------------------------------------- -inline UINT64 chd_file::be_read(const UINT8 *base, int numbytes) +inline uint64_t chd_file::be_read(const uint8_t *base, int numbytes) { - UINT64 result = 0; + uint64_t result = 0; while (numbytes--) result = (result << 8) | *base++; return result; @@ -143,7 +143,7 @@ inline UINT64 chd_file::be_read(const UINT8 *base, int numbytes) // buffer //------------------------------------------------- -inline void chd_file::be_write(UINT8 *base, UINT64 value, int numbytes) +inline void chd_file::be_write(uint8_t *base, uint64_t value, int numbytes) { base += numbytes; while (numbytes--) @@ -159,7 +159,7 @@ inline void chd_file::be_write(UINT8 *base, UINT64 value, int numbytes) // stream in bigendian order //------------------------------------------------- -inline util::sha1_t chd_file::be_read_sha1(const UINT8 *base) +inline util::sha1_t chd_file::be_read_sha1(const uint8_t *base) { util::sha1_t result; memcpy(&result.m_raw[0], base, sizeof(result.m_raw)); @@ -172,7 +172,7 @@ inline util::sha1_t chd_file::be_read_sha1(const UINT8 *base) // stream in bigendian order //------------------------------------------------- -inline void chd_file::be_write_sha1(UINT8 *base, util::sha1_t value) +inline void chd_file::be_write_sha1(uint8_t *base, util::sha1_t value) { memcpy(base, &value.m_raw[0], sizeof(value.m_raw)); } @@ -183,7 +183,7 @@ inline void chd_file::be_write_sha1(UINT8 *base, util::sha1_t value) // offset; on failure throw an error //------------------------------------------------- -inline void chd_file::file_read(UINT64 offset, void *dest, UINT32 length) +inline void chd_file::file_read(uint64_t offset, void *dest, uint32_t length) { // no file = failure if (m_file == nullptr) @@ -191,7 +191,7 @@ inline void chd_file::file_read(UINT64 offset, void *dest, UINT32 length) // seek and read m_file->seek(offset, SEEK_SET); - UINT32 count = m_file->read(dest, length); + uint32_t count = m_file->read(dest, length); if (count != length) throw CHDERR_READ_ERROR; } @@ -202,7 +202,7 @@ inline void chd_file::file_read(UINT64 offset, void *dest, UINT32 length) // offset; on failure throw an error //------------------------------------------------- -inline void chd_file::file_write(UINT64 offset, const void *source, UINT32 length) +inline void chd_file::file_write(uint64_t offset, const void *source, uint32_t length) { // no file = failure if (m_file == nullptr) @@ -210,7 +210,7 @@ inline void chd_file::file_write(UINT64 offset, const void *source, UINT32 lengt // seek and write m_file->seek(offset, SEEK_SET); - UINT32 count = m_file->write(source, length); + uint32_t count = m_file->write(source, length); if (count != length) throw CHDERR_WRITE_ERROR; } @@ -222,7 +222,7 @@ inline void chd_file::file_write(UINT64 offset, const void *source, UINT32 lengt // alignment; on failure throw an error //------------------------------------------------- -inline UINT64 chd_file::file_append(const void *source, UINT32 length, UINT32 alignment) +inline uint64_t chd_file::file_append(const void *source, uint32_t length, uint32_t alignment) { // no file = failure if (m_file == nullptr) @@ -232,18 +232,18 @@ inline UINT64 chd_file::file_append(const void *source, UINT32 length, UINT32 al m_file->seek(0, SEEK_END); if (alignment != 0) { - UINT64 offset = m_file->tell(); - UINT32 delta = offset % alignment; + uint64_t offset = m_file->tell(); + uint32_t delta = offset % alignment; if (delta != 0) { // pad with 0's from a local buffer - UINT8 buffer[1024]; + uint8_t buffer[1024]; memset(buffer, 0, sizeof(buffer)); delta = alignment - delta; while (delta != 0) { - UINT32 bytes_to_write = (std::min)(sizeof(buffer), delta); - UINT32 count = m_file->write(buffer, bytes_to_write); + uint32_t bytes_to_write = (std::min)(sizeof(buffer), delta); + uint32_t count = m_file->write(buffer, bytes_to_write); if (count != bytes_to_write) throw CHDERR_WRITE_ERROR; delta -= bytes_to_write; @@ -252,8 +252,8 @@ inline UINT64 chd_file::file_append(const void *source, UINT32 length, UINT32 al } // write the real data - UINT64 offset = m_file->tell(); - UINT32 count = m_file->write(source, length); + uint64_t offset = m_file->tell(); + uint32_t count = m_file->write(source, length); if (count != length) throw CHDERR_READ_ERROR; return offset; @@ -265,9 +265,9 @@ inline UINT64 chd_file::file_append(const void *source, UINT32 length, UINT32 al // necessary to represent all numbers 0..value //------------------------------------------------- -inline UINT8 chd_file::bits_for_value(UINT64 value) +inline uint8_t chd_file::bits_for_value(uint64_t value) { - UINT8 result = 0; + uint8_t result = 0; while (value != 0) value >>= 1, result++; return result; @@ -325,7 +325,7 @@ util::sha1_t chd_file::sha1() try { // read the big-endian version - UINT8 rawbuf[sizeof(util::sha1_t)]; + uint8_t rawbuf[sizeof(util::sha1_t)]; file_read(m_sha1_offset, rawbuf, sizeof(rawbuf)); return be_read_sha1(rawbuf); } @@ -358,7 +358,7 @@ util::sha1_t chd_file::raw_sha1() throw CHDERR_UNSUPPORTED_VERSION; // read the big-endian version - UINT8 rawbuf[sizeof(util::sha1_t)]; + uint8_t rawbuf[sizeof(util::sha1_t)]; file_read(m_rawsha1_offset, rawbuf, sizeof(rawbuf)); return be_read_sha1(rawbuf); } @@ -391,7 +391,7 @@ util::sha1_t chd_file::parent_sha1() throw CHDERR_UNSUPPORTED_VERSION; // read the big-endian version - UINT8 rawbuf[sizeof(util::sha1_t)]; + uint8_t rawbuf[sizeof(util::sha1_t)]; file_read(m_parentsha1_offset, rawbuf, sizeof(rawbuf)); return be_read_sha1(rawbuf); } @@ -403,7 +403,7 @@ util::sha1_t chd_file::parent_sha1() } /** - * @fn chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 &compbytes) + * @fn chd_error chd_file::hunk_info(uint32_t hunknum, chd_codec_type &compressor, uint32_t &compbytes) * * @brief ------------------------------------------------- * hunk_info - return information about this hunk @@ -416,14 +416,14 @@ util::sha1_t chd_file::parent_sha1() * @return A chd_error. */ -chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 &compbytes) +chd_error chd_file::hunk_info(uint32_t hunknum, chd_codec_type &compressor, uint32_t &compbytes) { // error if invalid if (hunknum >= m_hunkcount) return CHDERR_HUNK_OUT_OF_RANGE; // get the map pointer - UINT8 *rawmap; + uint8_t *rawmap; switch (m_version) { // v3/v4 map entries @@ -526,11 +526,11 @@ chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 void chd_file::set_raw_sha1(util::sha1_t rawdata) { // create a big-endian version - UINT8 rawbuf[sizeof(util::sha1_t)]; + uint8_t rawbuf[sizeof(util::sha1_t)]; be_write_sha1(rawbuf, rawdata); // write to the header - UINT64 offset = (m_rawsha1_offset != 0) ? m_rawsha1_offset : m_sha1_offset; + uint64_t offset = (m_rawsha1_offset != 0) ? m_rawsha1_offset : m_sha1_offset; assert(offset != 0); file_write(offset, rawbuf, sizeof(rawbuf)); @@ -558,7 +558,7 @@ void chd_file::set_parent_sha1(util::sha1_t parent) throw CHDERR_INVALID_FILE; // create a big-endian version - UINT8 rawbuf[sizeof(util::sha1_t)]; + uint8_t rawbuf[sizeof(util::sha1_t)]; be_write_sha1(rawbuf, parent); // write to the header @@ -567,7 +567,7 @@ void chd_file::set_parent_sha1(util::sha1_t parent) } /** - * @fn chd_error chd_file::create(util::core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]) + * @fn chd_error chd_file::create(util::core_file &file, uint64_t logicalbytes, uint32_t hunkbytes, uint32_t unitbytes, chd_codec_type compression[4]) * * @brief ------------------------------------------------- * create - create a new file with no parent using an existing opened file handle @@ -582,7 +582,7 @@ void chd_file::set_parent_sha1(util::sha1_t parent) * @return A chd_error. */ -chd_error chd_file::create(util::core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]) +chd_error chd_file::create(util::core_file &file, uint64_t logicalbytes, uint32_t hunkbytes, uint32_t unitbytes, chd_codec_type compression[4]) { // make sure we don't already have a file open if (m_file != nullptr) @@ -602,7 +602,7 @@ chd_error chd_file::create(util::core_file &file, UINT64 logicalbytes, UINT32 hu } /** - * @fn chd_error chd_file::create(util::core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent) + * @fn chd_error chd_file::create(util::core_file &file, uint64_t logicalbytes, uint32_t hunkbytes, chd_codec_type compression[4], chd_file &parent) * * @brief ------------------------------------------------- * create - create a new file with a parent using an existing opened file handle @@ -617,7 +617,7 @@ chd_error chd_file::create(util::core_file &file, UINT64 logicalbytes, UINT32 hu * @return A chd_error. */ -chd_error chd_file::create(util::core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent) +chd_error chd_file::create(util::core_file &file, uint64_t logicalbytes, uint32_t hunkbytes, chd_codec_type compression[4], chd_file &parent) { // make sure we don't already have a file open if (m_file != nullptr) @@ -637,7 +637,7 @@ chd_error chd_file::create(util::core_file &file, UINT64 logicalbytes, UINT32 hu } /** - * @fn chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]) + * @fn chd_error chd_file::create(const char *filename, uint64_t logicalbytes, uint32_t hunkbytes, uint32_t unitbytes, chd_codec_type compression[4]) * * @brief ------------------------------------------------- * create - create a new file with no parent using a filename @@ -652,7 +652,7 @@ chd_error chd_file::create(util::core_file &file, UINT64 logicalbytes, UINT32 hu * @return A chd_error. */ -chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]) +chd_error chd_file::create(const char *filename, uint64_t logicalbytes, uint32_t hunkbytes, uint32_t unitbytes, chd_codec_type compression[4]) { // make sure we don't already have a file open if (m_file != nullptr) @@ -682,7 +682,7 @@ chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hun } /** - * @fn chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent) + * @fn chd_error chd_file::create(const char *filename, uint64_t logicalbytes, uint32_t hunkbytes, chd_codec_type compression[4], chd_file &parent) * * @brief ------------------------------------------------- * create - create a new file with a parent using a filename @@ -697,7 +697,7 @@ chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hun * @return A chd_error. */ -chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent) +chd_error chd_file::create(const char *filename, uint64_t logicalbytes, uint32_t hunkbytes, chd_codec_type compression[4], chd_file &parent) { // make sure we don't already have a file open if (m_file != nullptr) @@ -747,7 +747,7 @@ chd_error chd_file::open(const char *filename, bool writeable, chd_file *parent) return CHDERR_ALREADY_OPEN; // open the file - const UINT32 openflags = writeable ? (OPEN_FLAG_READ | OPEN_FLAG_WRITE) : OPEN_FLAG_READ; + const uint32_t openflags = writeable ? (OPEN_FLAG_READ | OPEN_FLAG_WRITE) : OPEN_FLAG_READ; util::core_file::ptr file; const osd_file::error filerr = util::core_file::open(filename, openflags, file); if (filerr != osd_file::error::NONE) @@ -847,7 +847,7 @@ void chd_file::close() } /** - * @fn chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) + * @fn chd_error chd_file::read_hunk(uint32_t hunknum, void *buffer) * * @brief ------------------------------------------------- * read - read a single hunk from the CHD file @@ -869,7 +869,7 @@ void chd_file::close() * @return The hunk. */ -chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) +chd_error chd_file::read_hunk(uint32_t hunknum, void *buffer) { // wrap this for clean reporting try @@ -883,11 +883,11 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) throw CHDERR_HUNK_OUT_OF_RANGE; // get a pointer to the map entry - UINT64 blockoffs; - UINT32 blocklen; - UINT32 blockcrc; - UINT8 *rawmap; - UINT8 *dest = reinterpret_cast(buffer); + uint64_t blockoffs; + uint32_t blocklen; + uint32_t blockcrc; + uint8_t *rawmap; + uint8_t *dest = reinterpret_cast(buffer); switch (m_version) { // v3/v4 map entries @@ -914,7 +914,7 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) case V34_MAP_ENTRY_TYPE_MINI: be_write(dest, blockoffs, 8); - for (UINT32 bytes = 8; bytes < m_hunkbytes; bytes++) + for (uint32_t bytes = 8; bytes < m_hunkbytes; bytes++) dest[bytes] = dest[bytes - 8]; if (!(rawmap[15] & V34_MAP_ENTRY_FLAG_NO_CRC) && util::crc32_creator::simple(dest, m_hunkbytes) != blockcrc) throw CHDERR_DECOMPRESSION_ERROR; @@ -937,7 +937,7 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) // uncompressed case if (!compressed()) { - blockoffs = UINT64(be_read(rawmap, 4)) * UINT64(m_hunkbytes); + blockoffs = uint64_t(be_read(rawmap, 4)) * uint64_t(m_hunkbytes); if (blockoffs != 0) file_read(blockoffs, dest, m_hunkbytes); else if (m_parent_missing) @@ -979,7 +979,7 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) case COMPRESSION_PARENT: if (m_parent_missing) throw CHDERR_REQUIRES_PARENT; - return m_parent->read_bytes(UINT64(blockoffs) * UINT64(m_parent->unit_bytes()), dest, m_hunkbytes); + return m_parent->read_bytes(uint64_t(blockoffs) * uint64_t(m_parent->unit_bytes()), dest, m_hunkbytes); } break; } @@ -996,7 +996,7 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) } /** - * @fn chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer) + * @fn chd_error chd_file::write_hunk(uint32_t hunknum, const void *buffer) * * @brief ------------------------------------------------- * write - write a single hunk to the CHD file @@ -1014,7 +1014,7 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer) * @return A chd_error. */ -chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer) +chd_error chd_file::write_hunk(uint32_t hunknum, const void *buffer) { // wrap this for clean reporting try @@ -1036,16 +1036,16 @@ chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer) throw CHDERR_FILE_NOT_WRITEABLE; // see if we have allocated the space on disk for this hunk - UINT8 *rawmap = &m_rawmap[hunknum * 4]; - UINT32 rawentry = be_read(rawmap, 4); + uint8_t *rawmap = &m_rawmap[hunknum * 4]; + uint32_t rawentry = be_read(rawmap, 4); // if not, allocate one now if (rawentry == 0) { // first make sure we need to allocate it bool all_zeros = true; - const UINT32 *scan = reinterpret_cast(buffer); - for (UINT32 index = 0; index < m_hunkbytes / 4; index++) + const uint32_t *scan = reinterpret_cast(buffer); + for (uint32_t index = 0; index < m_hunkbytes / 4; index++) if (scan[index] != 0) { all_zeros = false; @@ -1070,7 +1070,7 @@ chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer) // otherwise, just overwrite else - file_write(UINT64(rawentry) * UINT64(m_hunkbytes), buffer, m_hunkbytes); + file_write(uint64_t(rawentry) * uint64_t(m_hunkbytes), buffer, m_hunkbytes); return CHDERR_NONE; } @@ -1082,7 +1082,7 @@ chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer) } /** - * @fn chd_error chd_file::read_units(UINT64 unitnum, void *buffer, UINT32 count) + * @fn chd_error chd_file::read_units(uint64_t unitnum, void *buffer, uint32_t count) * * @brief ------------------------------------------------- * read_units - read the given number of units from the CHD @@ -1095,13 +1095,13 @@ chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer) * @return The units. */ -chd_error chd_file::read_units(UINT64 unitnum, void *buffer, UINT32 count) +chd_error chd_file::read_units(uint64_t unitnum, void *buffer, uint32_t count) { - return read_bytes(unitnum * UINT64(m_unitbytes), buffer, count * m_unitbytes); + return read_bytes(unitnum * uint64_t(m_unitbytes), buffer, count * m_unitbytes); } /** - * @fn chd_error chd_file::write_units(UINT64 unitnum, const void *buffer, UINT32 count) + * @fn chd_error chd_file::write_units(uint64_t unitnum, const void *buffer, uint32_t count) * * @brief ------------------------------------------------- * write_units - write the given number of units to the CHD @@ -1114,13 +1114,13 @@ chd_error chd_file::read_units(UINT64 unitnum, void *buffer, UINT32 count) * @return A chd_error. */ -chd_error chd_file::write_units(UINT64 unitnum, const void *buffer, UINT32 count) +chd_error chd_file::write_units(uint64_t unitnum, const void *buffer, uint32_t count) { - return write_bytes(unitnum * UINT64(m_unitbytes), buffer, count * m_unitbytes); + return write_bytes(unitnum * uint64_t(m_unitbytes), buffer, count * m_unitbytes); } /** - * @fn chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes) + * @fn chd_error chd_file::read_bytes(uint64_t offset, void *buffer, uint32_t bytes) * * @brief ------------------------------------------------- * read_bytes - read from the CHD at a byte level, using the cache to handle partial @@ -1134,17 +1134,17 @@ chd_error chd_file::write_units(UINT64 unitnum, const void *buffer, UINT32 count * @return The bytes. */ -chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes) +chd_error chd_file::read_bytes(uint64_t offset, void *buffer, uint32_t bytes) { // iterate over hunks - UINT32 first_hunk = offset / m_hunkbytes; - UINT32 last_hunk = (offset + bytes - 1) / m_hunkbytes; - UINT8 *dest = reinterpret_cast(buffer); - for (UINT32 curhunk = first_hunk; curhunk <= last_hunk; curhunk++) + uint32_t first_hunk = offset / m_hunkbytes; + uint32_t last_hunk = (offset + bytes - 1) / m_hunkbytes; + uint8_t *dest = reinterpret_cast(buffer); + for (uint32_t curhunk = first_hunk; curhunk <= last_hunk; curhunk++) { // determine start/end boundaries - UINT32 startoffs = (curhunk == first_hunk) ? (offset % m_hunkbytes) : 0; - UINT32 endoffs = (curhunk == last_hunk) ? ((offset + bytes - 1) % m_hunkbytes) : (m_hunkbytes - 1); + uint32_t startoffs = (curhunk == first_hunk) ? (offset % m_hunkbytes) : 0; + uint32_t endoffs = (curhunk == last_hunk) ? ((offset + bytes - 1) % m_hunkbytes) : (m_hunkbytes - 1); // if it's a full block, just read directly from disk unless it's the cached hunk chd_error err = CHDERR_NONE; @@ -1173,7 +1173,7 @@ chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes) } /** - * @fn chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes) + * @fn chd_error chd_file::write_bytes(uint64_t offset, const void *buffer, uint32_t bytes) * * @brief ------------------------------------------------- * write_bytes - write to the CHD at a byte level, using the cache to handle partial @@ -1187,17 +1187,17 @@ chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes) * @return A chd_error. */ -chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes) +chd_error chd_file::write_bytes(uint64_t offset, const void *buffer, uint32_t bytes) { // iterate over hunks - UINT32 first_hunk = offset / m_hunkbytes; - UINT32 last_hunk = (offset + bytes - 1) / m_hunkbytes; - const UINT8 *source = reinterpret_cast(buffer); - for (UINT32 curhunk = first_hunk; curhunk <= last_hunk; curhunk++) + uint32_t first_hunk = offset / m_hunkbytes; + uint32_t last_hunk = (offset + bytes - 1) / m_hunkbytes; + const uint8_t *source = reinterpret_cast(buffer); + for (uint32_t curhunk = first_hunk; curhunk <= last_hunk; curhunk++) { // determine start/end boundaries - UINT32 startoffs = (curhunk == first_hunk) ? (offset % m_hunkbytes) : 0; - UINT32 endoffs = (curhunk == last_hunk) ? ((offset + bytes - 1) % m_hunkbytes) : (m_hunkbytes - 1); + uint32_t startoffs = (curhunk == first_hunk) ? (offset % m_hunkbytes) : 0; + uint32_t endoffs = (curhunk == last_hunk) ? ((offset + bytes - 1) % m_hunkbytes) : (m_hunkbytes - 1); // if it's a full block, just write directly to disk unless it's the cached hunk chd_error err = CHDERR_NONE; @@ -1227,7 +1227,7 @@ chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes) } /** - * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::string &output) + * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, std::string &output) * * @brief ------------------------------------------------- * read_metadata - read the indexed metadata of the given type @@ -1243,7 +1243,7 @@ chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes) * @return The metadata. */ -chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::string &output) +chd_error chd_file::read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, std::string &output) { // wrap this for clean reporting try @@ -1271,7 +1271,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex } /** - * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector &output) + * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, std::vector &output) * * @brief Reads a metadata. * @@ -1285,7 +1285,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex * @return The metadata. */ -chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector &output) +chd_error chd_file::read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, std::vector &output) { // wrap this for clean reporting try @@ -1309,7 +1309,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex } /** - * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen) + * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, void *output, uint32_t outputlen, uint32_t &resultlen) * * @brief Reads a metadata. * @@ -1325,7 +1325,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex * @return The metadata. */ -chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen) +chd_error chd_file::read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, void *output, uint32_t outputlen, uint32_t &resultlen) { // wrap this for clean reporting try @@ -1349,7 +1349,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex } /** - * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector &output, chd_metadata_tag &resulttag, UINT8 &resultflags) + * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, std::vector &output, chd_metadata_tag &resulttag, uint8_t &resultflags) * * @brief Reads a metadata. * @@ -1365,7 +1365,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex * @return The metadata. */ -chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector &output, chd_metadata_tag &resulttag, UINT8 &resultflags) +chd_error chd_file::read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, std::vector &output, chd_metadata_tag &resulttag, uint8_t &resultflags) { // wrap this for clean reporting try @@ -1391,7 +1391,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex } /** - * @fn chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags) + * @fn chd_error chd_file::write_metadata(chd_metadata_tag metatag, uint32_t metaindex, const void *inputbuf, uint32_t inputlen, uint8_t flags) * * @brief ------------------------------------------------- * write_metadata - write the indexed metadata of the given type @@ -1406,7 +1406,7 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex * @return A chd_error. */ -chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags) +chd_error chd_file::write_metadata(chd_metadata_tag metatag, uint32_t metaindex, const void *inputbuf, uint32_t inputlen, uint8_t flags) { // wrap this for clean reporting try @@ -1428,7 +1428,7 @@ chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, c // if the lengths don't match, we need to update the length in our header if (inputlen != metaentry.length) { - UINT8 length[3]; + uint8_t length[3]; be_write(length, inputlen, 3); file_write(metaentry.offset + 5, length, sizeof(length)); } @@ -1446,14 +1446,14 @@ chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, c if (!finished) { // now build us a new entry - UINT8 raw_meta_header[METADATA_HEADER_SIZE]; + uint8_t raw_meta_header[METADATA_HEADER_SIZE]; be_write(&raw_meta_header[0], metatag, 4); raw_meta_header[4] = flags; be_write(&raw_meta_header[5], (inputlen & 0x00ffffff) | (flags << 24), 3); be_write(&raw_meta_header[8], 0, 8); // append the new header, then the data - UINT64 offset = file_append(raw_meta_header, sizeof(raw_meta_header)); + uint64_t offset = file_append(raw_meta_header, sizeof(raw_meta_header)); file_append(inputbuf, inputlen); // set the previous entry to point to us @@ -1473,7 +1473,7 @@ chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, c } /** - * @fn chd_error chd_file::delete_metadata(chd_metadata_tag metatag, UINT32 metaindex) + * @fn chd_error chd_file::delete_metadata(chd_metadata_tag metatag, uint32_t metaindex) * * @brief ------------------------------------------------- * delete_metadata - remove the given metadata from the list @@ -1488,7 +1488,7 @@ chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, c * @return A chd_error. */ -chd_error chd_file::delete_metadata(chd_metadata_tag metatag, UINT32 metaindex) +chd_error chd_file::delete_metadata(chd_metadata_tag metatag, uint32_t metaindex) { // wrap this for clean reporting try @@ -1530,7 +1530,7 @@ chd_error chd_file::clone_all_metadata(chd_file &source) try { // iterate over metadata entries in the source - std::vector filedata; + std::vector filedata; metadata_entry metaentry; metaentry.metatag = 0; metaentry.length = 0; @@ -1543,7 +1543,7 @@ chd_error chd_file::clone_all_metadata(chd_file &source) source.file_read(metaentry.offset + METADATA_HEADER_SIZE, &filedata[0], metaentry.length); // write it to the destination - chd_error err = write_metadata(metaentry.metatag, (UINT32)-1, &filedata[0], metaentry.length, metaentry.flags); + chd_error err = write_metadata(metaentry.metatag, (uint32_t)-1, &filedata[0], metaentry.length, metaentry.flags); if (err != CHDERR_NONE) throw err; } @@ -1577,7 +1577,7 @@ util::sha1_t chd_file::compute_overall_sha1(util::sha1_t rawsha1) return rawsha1; // iterate over metadata - std::vector filedata; + std::vector filedata; std::vector hasharray; metadata_entry metaentry; for (bool has_data = metadata_find(CHDMETATAG_WILDCARD, 0, metaentry); has_data; has_data = metadata_find(CHDMETATAG_WILDCARD, 0, metaentry, true)) @@ -1704,17 +1704,17 @@ const char *chd_file::error_string(chd_error err) //************************************************************************** /** - * @fn UINT32 chd_file::guess_unitbytes() + * @fn uint32_t chd_file::guess_unitbytes() * * @brief ------------------------------------------------- * guess_unitbytes - for older CHD formats, take a guess at the bytes/unit based on * metadata * -------------------------------------------------. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 chd_file::guess_unitbytes() +uint32_t chd_file::guess_unitbytes() { // look for hard disk metadata; if found, then the unit size == sector size std::string metadata; @@ -1735,7 +1735,7 @@ UINT32 chd_file::guess_unitbytes() } /** - * @fn void chd_file::parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1) + * @fn void chd_file::parse_v3_header(uint8_t *rawheader, sha1_t &parentsha1) * * @brief ------------------------------------------------- * parse_v3_header - parse the header from a v3 file and configure core parameters @@ -1750,7 +1750,7 @@ UINT32 chd_file::guess_unitbytes() * @param [in,out] parentsha1 The first parentsha. */ -void chd_file::parse_v3_header(UINT8 *rawheader, util::sha1_t &parentsha1) +void chd_file::parse_v3_header(uint8_t *rawheader, util::sha1_t &parentsha1) { // verify header length if (be_read(&rawheader[8], 4) != V3_HEADER_SIZE) @@ -1764,7 +1764,7 @@ void chd_file::parse_v3_header(UINT8 *rawheader, util::sha1_t &parentsha1) m_hunkcount = be_read(&rawheader[24], 4); // extract parent SHA-1 - UINT32 flags = be_read(&rawheader[16], 4); + uint32_t flags = be_read(&rawheader[16], 4); m_allow_writes = (flags & 2) == 0; // determine compression @@ -1798,7 +1798,7 @@ void chd_file::parse_v3_header(UINT8 *rawheader, util::sha1_t &parentsha1) } /** - * @fn void chd_file::parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1) + * @fn void chd_file::parse_v4_header(uint8_t *rawheader, sha1_t &parentsha1) * * @brief ------------------------------------------------- * parse_v4_header - parse the header from a v4 file and configure core parameters @@ -1813,7 +1813,7 @@ void chd_file::parse_v3_header(UINT8 *rawheader, util::sha1_t &parentsha1) * @param [in,out] parentsha1 The first parentsha. */ -void chd_file::parse_v4_header(UINT8 *rawheader, util::sha1_t &parentsha1) +void chd_file::parse_v4_header(uint8_t *rawheader, util::sha1_t &parentsha1) { // verify header length if (be_read(&rawheader[8], 4) != V4_HEADER_SIZE) @@ -1827,7 +1827,7 @@ void chd_file::parse_v4_header(UINT8 *rawheader, util::sha1_t &parentsha1) m_hunkcount = be_read(&rawheader[24], 4); // extract parent SHA-1 - UINT32 flags = be_read(&rawheader[16], 4); + uint32_t flags = be_read(&rawheader[16], 4); m_allow_writes = (flags & 2) == 0; // determine compression @@ -1861,7 +1861,7 @@ void chd_file::parse_v4_header(UINT8 *rawheader, util::sha1_t &parentsha1) } /** - * @fn void chd_file::parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1) + * @fn void chd_file::parse_v5_header(uint8_t *rawheader, sha1_t &parentsha1) * * @brief ------------------------------------------------- * parse_v5_header - read the header from a v5 file and configure core parameters @@ -1873,7 +1873,7 @@ void chd_file::parse_v4_header(UINT8 *rawheader, util::sha1_t &parentsha1) * @param [in,out] parentsha1 The first parentsha. */ -void chd_file::parse_v5_header(UINT8 *rawheader, util::sha1_t &parentsha1) +void chd_file::parse_v5_header(uint8_t *rawheader, util::sha1_t &parentsha1) { // verify header length if (be_read(&rawheader[8], 4) != V5_HEADER_SIZE) @@ -1931,29 +1931,29 @@ chd_error chd_file::compress_v5_map() util::crc16_t mapcrc = util::crc16_creator::simple(&m_rawmap[0], m_hunkcount * 12); // create a buffer to hold the RLE data - std::vector compression_rle(m_hunkcount); - UINT8 *dest = &compression_rle[0]; + std::vector compression_rle(m_hunkcount); + uint8_t *dest = &compression_rle[0]; // use a huffman encoder for 16 different codes, maximum length is 8 bits huffman_encoder<16, 8> encoder; encoder.histo_reset(); // RLE-compress the compression type since we expect runs of the same - UINT32 max_self = 0; - UINT32 last_self = 0; - UINT64 max_parent = 0; - UINT64 last_parent = 0; - UINT32 max_complen = 0; - UINT8 lastcomp = 0; + uint32_t max_self = 0; + uint32_t last_self = 0; + uint64_t max_parent = 0; + uint64_t last_parent = 0; + uint32_t max_complen = 0; + uint8_t lastcomp = 0; int count = 0; for (int hunknum = 0; hunknum < m_hunkcount; hunknum++) { - UINT8 curcomp = m_rawmap[hunknum * 12 + 0]; + uint8_t curcomp = m_rawmap[hunknum * 12 + 0]; // promote self block references to more compact forms if (curcomp == COMPRESSION_SELF) { - UINT32 refhunk = be_read(&m_rawmap[hunknum * 12 + 4], 6); + uint32_t refhunk = be_read(&m_rawmap[hunknum * 12 + 4], 6); if (refhunk == last_self) curcomp = COMPRESSION_SELF_0; else if (refhunk == last_self + 1) @@ -1966,21 +1966,21 @@ chd_error chd_file::compress_v5_map() // promote parent block references to more compact forms else if (curcomp == COMPRESSION_PARENT) { - UINT32 refunit = be_read(&m_rawmap[hunknum * 12 + 4], 6); - if (refunit == (UINT64(hunknum) * UINT64(m_hunkbytes)) / m_unitbytes) + uint32_t refunit = be_read(&m_rawmap[hunknum * 12 + 4], 6); + if (refunit == (uint64_t(hunknum) * uint64_t(m_hunkbytes)) / m_unitbytes) curcomp = COMPRESSION_PARENT_SELF; else if (refunit == last_parent) curcomp = COMPRESSION_PARENT_0; else if (refunit == last_parent + m_hunkbytes / m_unitbytes) curcomp = COMPRESSION_PARENT_1; else - max_parent = std::max(max_parent, UINT64(refunit)); + max_parent = std::max(max_parent, uint64_t(refunit)); last_parent = refunit; } // track maximum compressed length else //if (curcomp >= COMPRESSION_TYPE_0 && curcomp <= COMPRESSION_TYPE_3) - max_complen = std::max(max_complen, UINT32(be_read(&m_rawmap[hunknum * 12 + 1], 3))); + max_complen = std::max(max_complen, uint32_t(be_read(&m_rawmap[hunknum * 12 + 1], 3))); // track repeats if (curcomp == lastcomp) @@ -2014,7 +2014,7 @@ chd_error chd_file::compress_v5_map() } // compute a tree and export it to the buffer - std::vector compressed(m_hunkcount * 6); + std::vector compressed(m_hunkcount * 6); bitstream_out bitbuf(&compressed[16], compressed.size() - 16); huffman_error err = encoder.compute_tree_from_histo(); if (err != HUFFERR_NONE) @@ -2024,31 +2024,31 @@ chd_error chd_file::compress_v5_map() throw CHDERR_COMPRESSION_ERROR; // encode the data - for (UINT8 *src = &compression_rle[0]; src < dest; src++) + for (uint8_t *src = &compression_rle[0]; src < dest; src++) encoder.encode_one(bitbuf, *src); // determine the number of bits we need to hold the a length // and a hunk index - UINT8 lengthbits = bits_for_value(max_complen); - UINT8 selfbits = bits_for_value(max_self); - UINT8 parentbits = bits_for_value(max_parent); + uint8_t lengthbits = bits_for_value(max_complen); + uint8_t selfbits = bits_for_value(max_self); + uint8_t parentbits = bits_for_value(max_parent); // for each compression type, output the relevant data lastcomp = 0; count = 0; - UINT8 *src = &compression_rle[0]; - UINT64 firstoffs = 0; + uint8_t *src = &compression_rle[0]; + uint64_t firstoffs = 0; for (int hunknum = 0; hunknum < m_hunkcount; hunknum++) { - UINT8 *rawmap = &m_rawmap[hunknum * 12]; - UINT32 length = be_read(&rawmap[1], 3); - UINT64 offset = be_read(&rawmap[4], 6); - UINT16 crc = be_read(&rawmap[10], 2); + uint8_t *rawmap = &m_rawmap[hunknum * 12]; + uint32_t length = be_read(&rawmap[1], 3); + uint64_t offset = be_read(&rawmap[4], 6); + uint16_t crc = be_read(&rawmap[10], 2); // if no count remaining, fetch the next entry if (count == 0) { - UINT8 val = *src++; + uint8_t val = *src++; if (val == COMPRESSION_RLE_SMALL) count = 2 + *src++; else if (val == COMPRESSION_RLE_LARGE) @@ -2080,12 +2080,12 @@ chd_error chd_file::compress_v5_map() break; case COMPRESSION_SELF: - assert(offset < (UINT64(1) << selfbits)); + assert(offset < (uint64_t(1) << selfbits)); bitbuf.write(offset, selfbits); break; case COMPRESSION_PARENT: - assert(offset < (UINT64(1) << parentbits)); + assert(offset < (uint64_t(1) << parentbits)); bitbuf.write(offset, parentbits); break; @@ -2099,7 +2099,7 @@ chd_error chd_file::compress_v5_map() } // write the map header - UINT32 complen = bitbuf.flush(); + uint32_t complen = bitbuf.flush(); assert(!bitbuf.overflow()); be_write(&compressed[0], complen, 4); be_write(&compressed[4], firstoffs, 6); @@ -2113,7 +2113,7 @@ chd_error chd_file::compress_v5_map() m_mapoffset = file_append(&compressed[0], complen + 16); // then write the map offset - UINT8 rawbuf[sizeof(UINT64)]; + uint8_t rawbuf[sizeof(uint64_t)]; be_write(rawbuf, m_mapoffset, 8); file_write(m_mapoffset_offset, rawbuf, sizeof(rawbuf)); return CHDERR_NONE; @@ -2145,17 +2145,17 @@ void chd_file::decompress_v5_map() } // read the reader - UINT8 rawbuf[16]; + uint8_t rawbuf[16]; file_read(m_mapoffset, rawbuf, sizeof(rawbuf)); - UINT32 mapbytes = be_read(&rawbuf[0], 4); - UINT64 firstoffs = be_read(&rawbuf[4], 6); - UINT16 mapcrc = be_read(&rawbuf[10], 2); - UINT8 lengthbits = rawbuf[12]; - UINT8 selfbits = rawbuf[13]; - UINT8 parentbits = rawbuf[14]; + uint32_t mapbytes = be_read(&rawbuf[0], 4); + uint64_t firstoffs = be_read(&rawbuf[4], 6); + uint16_t mapcrc = be_read(&rawbuf[10], 2); + uint8_t lengthbits = rawbuf[12]; + uint8_t selfbits = rawbuf[13]; + uint8_t parentbits = rawbuf[14]; // now read the map - std::vector compressed(mapbytes); + std::vector compressed(mapbytes); file_read(m_mapoffset + 16, &compressed[0], mapbytes); bitstream_in bitbuf(&compressed[0], compressed.size()); @@ -2164,16 +2164,16 @@ void chd_file::decompress_v5_map() huffman_error err = decoder.import_tree_rle(bitbuf); if (err != HUFFERR_NONE) throw CHDERR_DECOMPRESSION_ERROR; - UINT8 lastcomp = 0; + uint8_t lastcomp = 0; int repcount = 0; for (int hunknum = 0; hunknum < m_hunkcount; hunknum++) { - UINT8 *rawmap = &m_rawmap[hunknum * 12]; + uint8_t *rawmap = &m_rawmap[hunknum * 12]; if (repcount > 0) rawmap[0] = lastcomp, repcount--; else { - UINT8 val = decoder.decode_one(bitbuf); + uint8_t val = decoder.decode_one(bitbuf); if (val == COMPRESSION_RLE_SMALL) rawmap[0] = lastcomp, repcount = 2 + decoder.decode_one(bitbuf); else if (val == COMPRESSION_RLE_LARGE) @@ -2184,15 +2184,15 @@ void chd_file::decompress_v5_map() } // then iterate through the hunks and extract the needed data - UINT64 curoffset = firstoffs; - UINT32 last_self = 0; - UINT64 last_parent = 0; + uint64_t curoffset = firstoffs; + uint32_t last_self = 0; + uint64_t last_parent = 0; for (int hunknum = 0; hunknum < m_hunkcount; hunknum++) { - UINT8 *rawmap = &m_rawmap[hunknum * 12]; - UINT64 offset = curoffset; - UINT32 length = 0; - UINT16 crc = 0; + uint8_t *rawmap = &m_rawmap[hunknum * 12]; + uint64_t offset = curoffset; + uint32_t length = 0; + uint16_t crc = 0; switch (rawmap[0]) { // base types @@ -2228,7 +2228,7 @@ void chd_file::decompress_v5_map() case COMPRESSION_PARENT_SELF: rawmap[0] = COMPRESSION_PARENT; - last_parent = offset = (UINT64(hunknum) * UINT64(m_hunkbytes)) / m_unitbytes; + last_parent = offset = (uint64_t(hunknum) * uint64_t(m_hunkbytes)) / m_unitbytes; break; case COMPRESSION_PARENT_1: @@ -2297,7 +2297,7 @@ chd_error chd_file::create_common() } // create our V5 header - UINT8 rawheader[V5_HEADER_SIZE]; + uint8_t rawheader[V5_HEADER_SIZE]; memcpy(&rawheader[0], "MComprHD", 8); be_write(&rawheader[8], V5_HEADER_SIZE, 4); be_write(&rawheader[12], m_version, 4); @@ -2328,12 +2328,12 @@ chd_error chd_file::create_common() // write out the map (if not compressed) if (!compressed()) { - UINT32 mapsize = m_mapentrybytes * m_hunkcount; - UINT8 buffer[4096] = { 0 }; - UINT64 offset = m_mapoffset; + uint32_t mapsize = m_mapentrybytes * m_hunkcount; + uint8_t buffer[4096] = { 0 }; + uint64_t offset = m_mapoffset; while (mapsize != 0) { - UINT32 bytes_to_write = (std::min)(mapsize, sizeof(buffer)); + uint32_t bytes_to_write = (std::min)(mapsize, sizeof(buffer)); file_write(offset, buffer, bytes_to_write); offset += bytes_to_write; mapsize -= bytes_to_write; @@ -2390,7 +2390,7 @@ chd_error chd_file::open_common(bool writeable) m_allow_reads = true; // read the raw header - UINT8 rawheader[MAX_HEADER_SIZE]; + uint8_t rawheader[MAX_HEADER_SIZE]; file_read(0, rawheader, sizeof(rawheader)); // verify the signature @@ -2473,7 +2473,7 @@ void chd_file::create_open_common() } /** - * @fn void chd_file::verify_proper_compression_append(UINT32 hunknum) + * @fn void chd_file::verify_proper_compression_append(uint32_t hunknum) * * @brief ------------------------------------------------- * verify_proper_compression_append - verify that the given hunk is a proper candidate @@ -2491,7 +2491,7 @@ void chd_file::create_open_common() * @param hunknum The hunknum. */ -void chd_file::verify_proper_compression_append(UINT32 hunknum) +void chd_file::verify_proper_compression_append(uint32_t hunknum) { // punt if no file if (m_file == nullptr) @@ -2510,7 +2510,7 @@ void chd_file::verify_proper_compression_append(UINT32 hunknum) throw CHDERR_FILE_NOT_WRITEABLE; // only permitted to write new blocks - UINT8 *rawmap = &m_rawmap[hunknum * 12]; + uint8_t *rawmap = &m_rawmap[hunknum * 12]; if (rawmap[0] != 0xff) throw CHDERR_COMPRESSION_ERROR; @@ -2521,7 +2521,7 @@ void chd_file::verify_proper_compression_append(UINT32 hunknum) } /** - * @fn void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, crc16_t crc16) + * @fn void chd_file::hunk_write_compressed(uint32_t hunknum, int8_t compression, const uint8_t *compressed, uint32_t complength, crc16_t crc16) * * @brief ------------------------------------------------- * hunk_write_compressed - write a hunk to a compressed CHD, discovering the best @@ -2535,16 +2535,16 @@ void chd_file::verify_proper_compression_append(UINT32 hunknum) * @param crc16 The CRC 16. */ -void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, util::crc16_t crc16) +void chd_file::hunk_write_compressed(uint32_t hunknum, int8_t compression, const uint8_t *compressed, uint32_t complength, util::crc16_t crc16) { // verify that we are appending properly to a compressed file verify_proper_compression_append(hunknum); // write the final result - UINT64 offset = file_append(compressed, complength); + uint64_t offset = file_append(compressed, complength); // update the map entry - UINT8 *rawmap = &m_rawmap[hunknum * 12]; + uint8_t *rawmap = &m_rawmap[hunknum * 12]; rawmap[0] = (compression == -1) ? COMPRESSION_NONE : compression; be_write(&rawmap[1], complength, 3); be_write(&rawmap[4], offset, 6); @@ -2552,7 +2552,7 @@ void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UIN } /** - * @fn void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk) + * @fn void chd_file::hunk_copy_from_self(uint32_t hunknum, uint32_t otherhunk) * * @brief ------------------------------------------------- * hunk_copy_from_self - mark a hunk as being a copy of another hunk in the same CHD @@ -2565,7 +2565,7 @@ void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UIN * @param otherhunk The otherhunk. */ -void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk) +void chd_file::hunk_copy_from_self(uint32_t hunknum, uint32_t otherhunk) { // verify that we are appending properly to a compressed file verify_proper_compression_append(hunknum); @@ -2575,7 +2575,7 @@ void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk) throw CHDERR_INVALID_PARAMETER; // update the map entry - UINT8 *rawmap = &m_rawmap[hunknum * 12]; + uint8_t *rawmap = &m_rawmap[hunknum * 12]; rawmap[0] = COMPRESSION_SELF; be_write(&rawmap[1], 0, 3); be_write(&rawmap[4], otherhunk, 6); @@ -2583,7 +2583,7 @@ void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk) } /** - * @fn void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit) + * @fn void chd_file::hunk_copy_from_parent(uint32_t hunknum, uint64_t parentunit) * * @brief ------------------------------------------------- * hunk_copy_from_parent - mark a hunk as being a copy of a hunk from a parent CHD @@ -2593,13 +2593,13 @@ void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk) * @param parentunit The parentunit. */ -void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit) +void chd_file::hunk_copy_from_parent(uint32_t hunknum, uint64_t parentunit) { // verify that we are appending properly to a compressed file verify_proper_compression_append(hunknum); // update the map entry - UINT8 *rawmap = &m_rawmap[hunknum * 12]; + uint8_t *rawmap = &m_rawmap[hunknum * 12]; rawmap[0] = COMPRESSION_PARENT; be_write(&rawmap[1], 0, 3); be_write(&rawmap[4], parentunit, 6); @@ -2607,7 +2607,7 @@ void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit) } /** - * @fn bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata_entry &metaentry, bool resume) + * @fn bool chd_file::metadata_find(chd_metadata_tag metatag, int32_t metaindex, metadata_entry &metaentry, bool resume) * * @brief ------------------------------------------------- * metadata_find - find a metadata entry @@ -2621,7 +2621,7 @@ void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit) * @return true if it succeeds, false if it fails. */ -bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata_entry &metaentry, bool resume) +bool chd_file::metadata_find(chd_metadata_tag metatag, int32_t metaindex, metadata_entry &metaentry, bool resume) { // start at the beginning unless we're resuming a previous search if (!resume) @@ -2639,7 +2639,7 @@ bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata while (metaentry.offset != 0) { // read the raw header - UINT8 raw_meta_header[METADATA_HEADER_SIZE]; + uint8_t raw_meta_header[METADATA_HEADER_SIZE]; file_read(metaentry.offset, raw_meta_header, sizeof(raw_meta_header)); // extract the data @@ -2663,7 +2663,7 @@ bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata } /** - * @fn void chd_file::metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset) + * @fn void chd_file::metadata_set_previous_next(uint64_t prevoffset, uint64_t nextoffset) * * @brief ------------------------------------------------- * metadata_set_previous_next - set the 'next' offset of a piece of metadata @@ -2673,9 +2673,9 @@ bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata * @param nextoffset The nextoffset. */ -void chd_file::metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset) +void chd_file::metadata_set_previous_next(uint64_t prevoffset, uint64_t nextoffset) { - UINT64 offset = 0; + uint64_t offset = 0; // if we were the first entry, make the next entry the first if (prevoffset == 0) @@ -2689,7 +2689,7 @@ void chd_file::metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset) offset = prevoffset + 8; // create a big-endian version - UINT8 rawbuf[sizeof(UINT64)]; + uint8_t rawbuf[sizeof(uint64_t)]; be_write(rawbuf, nextoffset, 8); // write to the header and update our local copy @@ -2714,7 +2714,7 @@ void chd_file::metadata_update_hash() util::sha1_t fullsha1 = compute_overall_sha1(raw_sha1()); // create a big-endian version - UINT8 rawbuf[sizeof(util::sha1_t)]; + uint8_t rawbuf[sizeof(util::sha1_t)]; be_write_sha1(&rawbuf[0], fullsha1); // write to the header @@ -2863,9 +2863,9 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio while (m_read_queue_offset < m_logicalbytes && osd_work_queue_items(m_read_queue) < 2) { // see if we have enough free work items to read the next half of a buffer - UINT32 startitem = m_read_queue_offset / hunk_bytes(); - UINT32 enditem = startitem + WORK_BUFFER_HUNKS / 2; - UINT32 curitem; + uint32_t startitem = m_read_queue_offset / hunk_bytes(); + uint32_t enditem = startitem + WORK_BUFFER_HUNKS / 2; + uint32_t curitem; for (curitem = startitem; curitem < enditem; curitem++) if (m_work_item[curitem % WORK_BUFFER_HUNKS].m_status != WS_READY) break; @@ -2899,11 +2899,11 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio // for parent walking, just add to the hashmap if (m_walking_parent) { - UINT32 uph = hunk_bytes() / unit_bytes(); - UINT32 units = uph; + uint32_t uph = hunk_bytes() / unit_bytes(); + uint32_t units = uph; if (item.m_hunknum == hunk_count() - 1 || !compressed()) units = 1; - for (UINT32 unit = 0; unit < units; unit++) + for (uint32_t unit = 0; unit < units; unit++) if (m_parent_map.find(item.m_hash[unit].m_crc16, item.m_hash[unit].m_sha1) == hashmap::NOT_FOUND) m_parent_map.add(item.m_hunknum * uph + unit, item.m_hash[unit].m_crc16, item.m_hash[unit].m_sha1); } @@ -2917,7 +2917,7 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio // writes of all-0 data don't actually take space, so see if we count this chd_codec_type codec = CHD_CODEC_NONE; - UINT32 complen; + uint32_t complen; hunk_info(item.m_hunknum, codec, complen); if (codec == CHD_CODEC_NONE) m_total_out += m_hunkbytes; @@ -2927,7 +2927,7 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio else do { // first see if the hunk is in the parent or self maps - UINT64 selfhunk = m_current_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); + uint64_t selfhunk = m_current_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); if (selfhunk != hashmap::NOT_FOUND) { hunk_copy_from_self(item.m_hunknum, selfhunk); @@ -2937,7 +2937,7 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio // if not, see if it's in the parent map if (m_parent != nullptr) { - UINT64 parentunit = m_parent_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); + uint64_t parentunit = m_parent_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); if (parentunit != hashmap::NOT_FOUND) { hunk_copy_from_parent(item.m_hunknum, parentunit); @@ -3028,10 +3028,10 @@ void *chd_file_compressor::async_walk_parent_static(void *param, int threadid) void chd_file_compressor::async_walk_parent(work_item &item) { // compute CRC-16 and SHA-1 hashes for each unit, unless we're the last one or we're uncompressed - UINT32 units = hunk_bytes() / unit_bytes(); + uint32_t units = hunk_bytes() / unit_bytes(); if (item.m_hunknum == m_hunkcount - 1 || !compressed()) units = 1; - for (UINT32 unit = 0; unit < units; unit++) + for (uint32_t unit = 0; unit < units; unit++) { item.m_hash[unit].m_crc16 = util::crc16_creator::simple(item.m_data + unit * unit_bytes(), hunk_bytes()); item.m_hash[unit].m_sha1 = util::sha1_creator::simple(item.m_data + unit * unit_bytes(), hunk_bytes()); @@ -3121,8 +3121,8 @@ void chd_file_compressor::async_read() return; // determine parameters for the read - UINT32 work_buffer_bytes = WORK_BUFFER_HUNKS * hunk_bytes(); - UINT32 numbytes = work_buffer_bytes / 2; + uint32_t work_buffer_bytes = WORK_BUFFER_HUNKS * hunk_bytes(); + uint32_t numbytes = work_buffer_bytes / 2; if (m_read_done_offset + numbytes > logical_bytes()) numbytes = logical_bytes() - m_read_done_offset; @@ -3130,15 +3130,15 @@ void chd_file_compressor::async_read() try { // do the read - UINT8 *dest = &m_work_buffer[0] + (m_read_done_offset % work_buffer_bytes); + uint8_t *dest = &m_work_buffer[0] + (m_read_done_offset % work_buffer_bytes); assert(dest == &m_work_buffer[0] || dest == &m_work_buffer[work_buffer_bytes/2]); - UINT64 end_offset = m_read_done_offset + numbytes; + uint64_t end_offset = m_read_done_offset + numbytes; // if walking the parent, read in hunks from the parent CHD if (m_walking_parent) { - UINT8 *curdest = dest; - for (UINT64 curoffs = m_read_done_offset; curoffs < end_offset + 1; curoffs += hunk_bytes()) + uint8_t *curdest = dest; + for (uint64_t curoffs = m_read_done_offset; curoffs < end_offset + 1; curoffs += hunk_bytes()) { m_parent->read_hunk(curoffs / hunk_bytes(), curdest); curdest += hunk_bytes(); @@ -3150,9 +3150,9 @@ void chd_file_compressor::async_read() read_data(dest, m_read_done_offset, numbytes); // spawn off work for each hunk - for (UINT64 curoffs = m_read_done_offset; curoffs < end_offset; curoffs += hunk_bytes()) + for (uint64_t curoffs = m_read_done_offset; curoffs < end_offset; curoffs += hunk_bytes()) { - UINT32 hunknum = curoffs / hunk_bytes(); + uint32_t hunknum = curoffs / hunk_bytes(); work_item &item = m_work_item[hunknum % WORK_BUFFER_HUNKS]; assert(item.m_status == WS_READING); item.m_status = WS_QUEUED; @@ -3242,7 +3242,7 @@ void chd_file_compressor::hashmap::reset() } /** - * @fn UINT64 chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1) + * @fn uint64_t chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1) * * @brief ------------------------------------------------- * find - find an item in the CRC map @@ -3251,10 +3251,10 @@ void chd_file_compressor::hashmap::reset() * @param crc16 The CRC 16. * @param sha1 The first sha. * - * @return An UINT64. + * @return An uint64_t. */ -UINT64 chd_file_compressor::hashmap::find(util::crc16_t crc16, util::sha1_t sha1) +uint64_t chd_file_compressor::hashmap::find(util::crc16_t crc16, util::sha1_t sha1) { // look up the entry in the map for (entry_t *entry = m_map[crc16]; entry != nullptr; entry = entry->m_next) @@ -3264,7 +3264,7 @@ UINT64 chd_file_compressor::hashmap::find(util::crc16_t crc16, util::sha1_t sha1 } /** - * @fn void chd_file_compressor::hashmap::add(UINT64 itemnum, crc16_t crc16, sha1_t sha1) + * @fn void chd_file_compressor::hashmap::add(uint64_t itemnum, crc16_t crc16, sha1_t sha1) * * @brief ------------------------------------------------- * add - add an item to the CRC map @@ -3275,7 +3275,7 @@ UINT64 chd_file_compressor::hashmap::find(util::crc16_t crc16, util::sha1_t sha1 * @param sha1 The first sha. */ -void chd_file_compressor::hashmap::add(UINT64 itemnum, util::crc16_t crc16, util::sha1_t sha1) +void chd_file_compressor::hashmap::add(uint64_t itemnum, util::crc16_t crc16, util::sha1_t sha1) { // add to the appropriate map if (m_block_list->m_nextalloc == ARRAY_LENGTH(m_block_list->m_array)) diff --git a/src/lib/util/chd.h b/src/lib/util/chd.h index 51c6fed0b54..a85ae1b9c10 100644 --- a/src/lib/util/chd.h +++ b/src/lib/util/chd.h @@ -33,17 +33,17 @@ V1 header: [ 0] char tag[8]; // 'MComprHD' - [ 8] UINT32 length; // length of header (including tag and length fields) - [ 12] UINT32 version; // drive format version - [ 16] UINT32 flags; // flags (see below) - [ 20] UINT32 compression; // compression type - [ 24] UINT32 hunksize; // 512-byte sectors per hunk - [ 28] UINT32 totalhunks; // total # of hunks represented - [ 32] UINT32 cylinders; // number of cylinders on hard disk - [ 36] UINT32 heads; // number of heads on hard disk - [ 40] UINT32 sectors; // number of sectors on hard disk - [ 44] UINT8 md5[16]; // MD5 checksum of raw data - [ 60] UINT8 parentmd5[16]; // MD5 checksum of parent file + [ 8] uint32_t length; // length of header (including tag and length fields) + [ 12] uint32_t version; // drive format version + [ 16] uint32_t flags; // flags (see below) + [ 20] uint32_t compression; // compression type + [ 24] uint32_t hunksize; // 512-byte sectors per hunk + [ 28] uint32_t totalhunks; // total # of hunks represented + [ 32] uint32_t cylinders; // number of cylinders on hard disk + [ 36] uint32_t heads; // number of heads on hard disk + [ 40] uint32_t sectors; // number of sectors on hard disk + [ 44] uint8_t md5[16]; // MD5 checksum of raw data + [ 60] uint8_t parentmd5[16]; // MD5 checksum of parent file [ 76] (V1 header length) Flags: @@ -56,26 +56,26 @@ V1 map format: - [ 0] UINT64 offset : 44; // starting offset within the file - [ 0] UINT64 length : 20; // length of data; if == hunksize, data is uncompressed + [ 0] uint64_t offset : 44; // starting offset within the file + [ 0] uint64_t length : 20; // length of data; if == hunksize, data is uncompressed ========================================================================= V2 header: [ 0] char tag[8]; // 'MComprHD' - [ 8] UINT32 length; // length of header (including tag and length fields) - [ 12] UINT32 version; // drive format version - [ 16] UINT32 flags; // flags (see below) - [ 20] UINT32 compression; // compression type - [ 24] UINT32 hunksize; // seclen-byte sectors per hunk - [ 28] UINT32 totalhunks; // total # of hunks represented - [ 32] UINT32 cylinders; // number of cylinders on hard disk - [ 36] UINT32 heads; // number of heads on hard disk - [ 40] UINT32 sectors; // number of sectors on hard disk - [ 44] UINT8 md5[16]; // MD5 checksum of raw data - [ 60] UINT8 parentmd5[16]; // MD5 checksum of parent file - [ 76] UINT32 seclen; // number of bytes per sector + [ 8] uint32_t length; // length of header (including tag and length fields) + [ 12] uint32_t version; // drive format version + [ 16] uint32_t flags; // flags (see below) + [ 20] uint32_t compression; // compression type + [ 24] uint32_t hunksize; // seclen-byte sectors per hunk + [ 28] uint32_t totalhunks; // total # of hunks represented + [ 32] uint32_t cylinders; // number of cylinders on hard disk + [ 36] uint32_t heads; // number of heads on hard disk + [ 40] uint32_t sectors; // number of sectors on hard disk + [ 44] uint8_t md5[16]; // MD5 checksum of raw data + [ 60] uint8_t parentmd5[16]; // MD5 checksum of parent file + [ 76] uint32_t seclen; // number of bytes per sector [ 80] (V2 header length) Flags and map format are same as V1 @@ -85,18 +85,18 @@ V3 header: [ 0] char tag[8]; // 'MComprHD' - [ 8] UINT32 length; // length of header (including tag and length fields) - [ 12] UINT32 version; // drive format version - [ 16] UINT32 flags; // flags (see below) - [ 20] UINT32 compression; // compression type - [ 24] UINT32 totalhunks; // total # of hunks represented - [ 28] UINT64 logicalbytes; // logical size of the data (in bytes) - [ 36] UINT64 metaoffset; // offset to the first blob of metadata - [ 44] UINT8 md5[16]; // MD5 checksum of raw data - [ 60] UINT8 parentmd5[16]; // MD5 checksum of parent file - [ 76] UINT32 hunkbytes; // number of bytes per hunk - [ 80] UINT8 sha1[20]; // SHA1 checksum of raw data - [100] UINT8 parentsha1[20];// SHA1 checksum of parent file + [ 8] uint32_t length; // length of header (including tag and length fields) + [ 12] uint32_t version; // drive format version + [ 16] uint32_t flags; // flags (see below) + [ 20] uint32_t compression; // compression type + [ 24] uint32_t totalhunks; // total # of hunks represented + [ 28] uint64_t logicalbytes; // logical size of the data (in bytes) + [ 36] uint64_t metaoffset; // offset to the first blob of metadata + [ 44] uint8_t md5[16]; // MD5 checksum of raw data + [ 60] uint8_t parentmd5[16]; // MD5 checksum of parent file + [ 76] uint32_t hunkbytes; // number of bytes per hunk + [ 80] uint8_t sha1[20]; // SHA1 checksum of raw data + [100] uint8_t parentsha1[20];// SHA1 checksum of parent file [120] (V3 header length) Flags are the same as V1 @@ -108,28 +108,28 @@ V3 map format: - [ 0] UINT64 offset; // starting offset within the file - [ 8] UINT32 crc32; // 32-bit CRC of the uncompressed data - [ 12] UINT16 length_lo; // lower 16 bits of length - [ 14] UINT8 length_hi; // upper 8 bits of length - [ 15] UINT8 flags; // flags, indicating compression info + [ 0] uint64_t offset; // starting offset within the file + [ 8] uint32_t crc32; // 32-bit CRC of the uncompressed data + [ 12] uint16_t length_lo; // lower 16 bits of length + [ 14] uint8_t length_hi; // upper 8 bits of length + [ 15] uint8_t flags; // flags, indicating compression info ========================================================================= V4 header: [ 0] char tag[8]; // 'MComprHD' - [ 8] UINT32 length; // length of header (including tag and length fields) - [ 12] UINT32 version; // drive format version - [ 16] UINT32 flags; // flags (see below) - [ 20] UINT32 compression; // compression type - [ 24] UINT32 totalhunks; // total # of hunks represented - [ 28] UINT64 logicalbytes; // logical size of the data (in bytes) - [ 36] UINT64 metaoffset; // offset to the first blob of metadata - [ 44] UINT32 hunkbytes; // number of bytes per hunk - [ 48] UINT8 sha1[20]; // combined raw+meta SHA1 - [ 68] UINT8 parentsha1[20];// combined raw+meta SHA1 of parent - [ 88] UINT8 rawsha1[20]; // raw data SHA1 + [ 8] uint32_t length; // length of header (including tag and length fields) + [ 12] uint32_t version; // drive format version + [ 16] uint32_t flags; // flags (see below) + [ 20] uint32_t compression; // compression type + [ 24] uint32_t totalhunks; // total # of hunks represented + [ 28] uint64_t logicalbytes; // logical size of the data (in bytes) + [ 36] uint64_t metaoffset; // offset to the first blob of metadata + [ 44] uint32_t hunkbytes; // number of bytes per hunk + [ 48] uint8_t sha1[20]; // combined raw+meta SHA1 + [ 68] uint8_t parentsha1[20];// combined raw+meta SHA1 of parent + [ 88] uint8_t rawsha1[20]; // raw data SHA1 [108] (V4 header length) Flags are the same as V1 @@ -147,17 +147,17 @@ V5 header: [ 0] char tag[8]; // 'MComprHD' - [ 8] UINT32 length; // length of header (including tag and length fields) - [ 12] UINT32 version; // drive format version - [ 16] UINT32 compressors[4];// which custom compressors are used? - [ 32] UINT64 logicalbytes; // logical size of the data (in bytes) - [ 40] UINT64 mapoffset; // offset to the map - [ 48] UINT64 metaoffset; // offset to the first blob of metadata - [ 56] UINT32 hunkbytes; // number of bytes per hunk (512k maximum) - [ 60] UINT32 unitbytes; // number of bytes per unit within each hunk - [ 64] UINT8 rawsha1[20]; // raw data SHA1 - [ 84] UINT8 sha1[20]; // combined raw+meta SHA1 - [104] UINT8 parentsha1[20];// combined raw+meta SHA1 of parent + [ 8] uint32_t length; // length of header (including tag and length fields) + [ 12] uint32_t version; // drive format version + [ 16] uint32_t compressors[4];// which custom compressors are used? + [ 32] uint64_t logicalbytes; // logical size of the data (in bytes) + [ 40] uint64_t mapoffset; // offset to the map + [ 48] uint64_t metaoffset; // offset to the first blob of metadata + [ 56] uint32_t hunkbytes; // number of bytes per hunk (512k maximum) + [ 60] uint32_t unitbytes; // number of bytes per unit within each hunk + [ 64] uint8_t rawsha1[20]; // raw data SHA1 + [ 84] uint8_t sha1[20]; // combined raw+meta SHA1 + [104] uint8_t parentsha1[20];// combined raw+meta SHA1 of parent [124] (V5 header length) If parentsha1 != 0, we have a parent (no need for flags) @@ -165,25 +165,25 @@ V5 uncompressed map format: - [ 0] UINT32 offset; // starting offset / hunk size + [ 0] uint32_t offset; // starting offset / hunk size V5 compressed map format header: - [ 0] UINT32 length; // length of compressed map + [ 0] uint32_t length; // length of compressed map [ 4] UINT48 datastart; // offset of first block - [ 10] UINT16 crc; // crc-16 of the map - [ 12] UINT8 lengthbits; // bits used to encode complength - [ 13] UINT8 hunkbits; // bits used to encode self-refs - [ 14] UINT8 parentunitbits; // bits used to encode parent unit refs - [ 15] UINT8 reserved; // future use + [ 10] uint16_t crc; // crc-16 of the map + [ 12] uint8_t lengthbits; // bits used to encode complength + [ 13] uint8_t hunkbits; // bits used to encode self-refs + [ 14] uint8_t parentunitbits; // bits used to encode parent unit refs + [ 15] uint8_t reserved; // future use [ 16] (compressed header length) Each compressed map entry, once expanded, looks like: - [ 0] UINT8 compression; // compression type + [ 0] uint8_t compression; // compression type [ 1] UINT24 complength; // compressed length [ 4] UINT48 offset; // offset - [ 10] UINT16 crc; // crc-16 of the data + [ 10] uint16_t crc; // crc-16 of the data ***************************************************************************/ @@ -198,14 +198,14 @@ const chd_codec_type CHD_CODEC_PARENT = 2; // copy of a parent's hunk const chd_codec_type CHD_CODEC_MINI = 3; // legacy "mini" 8-byte repeat // core types -typedef UINT32 chd_metadata_tag; +typedef uint32_t chd_metadata_tag; // metadata parameters const chd_metadata_tag CHDMETATAG_WILDCARD = 0; -const UINT32 CHDMETAINDEX_APPEND = ~0; +const uint32_t CHDMETAINDEX_APPEND = ~0; // metadata flags -const UINT8 CHD_MDFLAGS_CHECKSUM = 0x01; // indicates data is checksummed +const uint8_t CHD_MDFLAGS_CHECKSUM = 0x01; // indicates data is checksummed // standard hard disk metadata const chd_metadata_tag HARD_DISK_METADATA_TAG = CHD_MAKE_TAG('G','D','D','D'); @@ -292,11 +292,11 @@ class chd_file friend class chd_verifier; // constants - static const UINT32 HEADER_VERSION = 5; - static const UINT32 V3_HEADER_SIZE = 120; - static const UINT32 V4_HEADER_SIZE = 108; - static const UINT32 V5_HEADER_SIZE = 124; - static const UINT32 MAX_HEADER_SIZE = V5_HEADER_SIZE; + static const uint32_t HEADER_VERSION = 5; + static const uint32_t V3_HEADER_SIZE = 120; + static const uint32_t V4_HEADER_SIZE = 108; + static const uint32_t V5_HEADER_SIZE = 124; + static const uint32_t MAX_HEADER_SIZE = V5_HEADER_SIZE; public: // construction/destruction @@ -308,29 +308,29 @@ public: // getters bool opened() const { return (m_file != nullptr); } - UINT32 version() const { return m_version; } - UINT64 logical_bytes() const { return m_logicalbytes; } - UINT32 hunk_bytes() const { return m_hunkbytes; } - UINT32 hunk_count() const { return m_hunkcount; } - UINT32 unit_bytes() const { return m_unitbytes; } - UINT64 unit_count() const { return m_unitcount; } + uint32_t version() const { return m_version; } + uint64_t logical_bytes() const { return m_logicalbytes; } + uint32_t hunk_bytes() const { return m_hunkbytes; } + uint32_t hunk_count() const { return m_hunkcount; } + uint32_t unit_bytes() const { return m_unitbytes; } + uint64_t unit_count() const { return m_unitcount; } bool compressed() const { return (m_compression[0] != CHD_CODEC_NONE); } chd_codec_type compression(int index) const { return m_compression[index]; } chd_file *parent() const { return m_parent; } util::sha1_t sha1(); util::sha1_t raw_sha1(); util::sha1_t parent_sha1(); - chd_error hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 &compbytes); + chd_error hunk_info(uint32_t hunknum, chd_codec_type &compressor, uint32_t &compbytes); // setters void set_raw_sha1(util::sha1_t rawdata); void set_parent_sha1(util::sha1_t parent); // file create - chd_error create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]); - chd_error create(util::core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4]); - chd_error create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent); - chd_error create(util::core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent); + chd_error create(const char *filename, uint64_t logicalbytes, uint32_t hunkbytes, uint32_t unitbytes, chd_codec_type compression[4]); + chd_error create(util::core_file &file, uint64_t logicalbytes, uint32_t hunkbytes, uint32_t unitbytes, chd_codec_type compression[4]); + chd_error create(const char *filename, uint64_t logicalbytes, uint32_t hunkbytes, chd_codec_type compression[4], chd_file &parent); + chd_error create(util::core_file &file, uint64_t logicalbytes, uint32_t hunkbytes, chd_codec_type compression[4], chd_file &parent); // file open chd_error open(const char *filename, bool writeable = false, chd_file *parent = nullptr); @@ -340,22 +340,22 @@ public: void close(); // read/write - chd_error read_hunk(UINT32 hunknum, void *buffer); - chd_error write_hunk(UINT32 hunknum, const void *buffer); - chd_error read_units(UINT64 unitnum, void *buffer, UINT32 count = 1); - chd_error write_units(UINT64 unitnum, const void *buffer, UINT32 count = 1); - chd_error read_bytes(UINT64 offset, void *buffer, UINT32 bytes); - chd_error write_bytes(UINT64 offset, const void *buffer, UINT32 bytes); + chd_error read_hunk(uint32_t hunknum, void *buffer); + chd_error write_hunk(uint32_t hunknum, const void *buffer); + chd_error read_units(uint64_t unitnum, void *buffer, uint32_t count = 1); + chd_error write_units(uint64_t unitnum, const void *buffer, uint32_t count = 1); + chd_error read_bytes(uint64_t offset, void *buffer, uint32_t bytes); + chd_error write_bytes(uint64_t offset, const void *buffer, uint32_t bytes); // metadata management - chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::string &output); - chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector &output); - chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen); - chd_error read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::vector &output, chd_metadata_tag &resulttag, UINT8 &resultflags); - chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags = CHD_MDFLAGS_CHECKSUM); - chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const std::string &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input.c_str(), input.length() + 1, flags); } - chd_error write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const std::vector &input, UINT8 flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, &input[0], input.size(), flags); } - chd_error delete_metadata(chd_metadata_tag metatag, UINT32 metaindex); + chd_error read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, std::string &output); + chd_error read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, std::vector &output); + chd_error read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, void *output, uint32_t outputlen, uint32_t &resultlen); + chd_error read_metadata(chd_metadata_tag searchtag, uint32_t searchindex, std::vector &output, chd_metadata_tag &resulttag, uint8_t &resultflags); + chd_error write_metadata(chd_metadata_tag metatag, uint32_t metaindex, const void *inputbuf, uint32_t inputlen, uint8_t flags = CHD_MDFLAGS_CHECKSUM); + chd_error write_metadata(chd_metadata_tag metatag, uint32_t metaindex, const std::string &input, uint8_t flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, input.c_str(), input.length() + 1, flags); } + chd_error write_metadata(chd_metadata_tag metatag, uint32_t metaindex, const std::vector &input, uint8_t flags = CHD_MDFLAGS_CHECKSUM) { return write_metadata(metatag, metaindex, &input[0], input.size(), flags); } + chd_error delete_metadata(chd_metadata_tag metatag, uint32_t metaindex); chd_error clone_all_metadata(chd_file &source); // hashing helper @@ -372,31 +372,31 @@ private: struct metadata_hash; // inline helpers - UINT64 be_read(const UINT8 *base, int numbytes); - void be_write(UINT8 *base, UINT64 value, int numbytes); - util::sha1_t be_read_sha1(const UINT8 *base); - void be_write_sha1(UINT8 *base, util::sha1_t value); - void file_read(UINT64 offset, void *dest, UINT32 length); - void file_write(UINT64 offset, const void *source, UINT32 length); - UINT64 file_append(const void *source, UINT32 length, UINT32 alignment = 0); - UINT8 bits_for_value(UINT64 value); + uint64_t be_read(const uint8_t *base, int numbytes); + void be_write(uint8_t *base, uint64_t value, int numbytes); + util::sha1_t be_read_sha1(const uint8_t *base); + void be_write_sha1(uint8_t *base, util::sha1_t value); + void file_read(uint64_t offset, void *dest, uint32_t length); + void file_write(uint64_t offset, const void *source, uint32_t length); + uint64_t file_append(const void *source, uint32_t length, uint32_t alignment = 0); + uint8_t bits_for_value(uint64_t value); // internal helpers - UINT32 guess_unitbytes(); - void parse_v3_header(UINT8 *rawheader, util::sha1_t &parentsha1); - void parse_v4_header(UINT8 *rawheader, util::sha1_t &parentsha1); - void parse_v5_header(UINT8 *rawheader, util::sha1_t &parentsha1); + uint32_t guess_unitbytes(); + void parse_v3_header(uint8_t *rawheader, util::sha1_t &parentsha1); + void parse_v4_header(uint8_t *rawheader, util::sha1_t &parentsha1); + void parse_v5_header(uint8_t *rawheader, util::sha1_t &parentsha1); chd_error compress_v5_map(); void decompress_v5_map(); chd_error create_common(); chd_error open_common(bool writeable); void create_open_common(); - void verify_proper_compression_append(UINT32 hunknum); - void hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, util::crc16_t crc16); - void hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk); - void hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit); - bool metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata_entry &metaentry, bool resume = false); - void metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset); + void verify_proper_compression_append(uint32_t hunknum); + void hunk_write_compressed(uint32_t hunknum, int8_t compression, const uint8_t *compressed, uint32_t complength, util::crc16_t crc16); + void hunk_copy_from_self(uint32_t hunknum, uint32_t otherhunk); + void hunk_copy_from_parent(uint32_t hunknum, uint64_t parentunit); + bool metadata_find(chd_metadata_tag metatag, int32_t metaindex, metadata_entry &metaentry, bool resume = false); + void metadata_set_previous_next(uint64_t prevoffset, uint64_t nextoffset); void metadata_update_hash(); static int CLIB_DECL metadata_hash_compare(const void *elem1, const void *elem2); @@ -407,36 +407,36 @@ private: bool m_allow_writes; // permit writes to this CHD? // core parameters from the header - UINT32 m_version; // version of the header - UINT64 m_logicalbytes; // logical size of the raw CHD data in bytes - UINT64 m_mapoffset; // offset of map - UINT64 m_metaoffset; // offset to first metadata bit - UINT32 m_hunkbytes; // size of each raw hunk in bytes - UINT32 m_hunkcount; // number of hunks represented - UINT32 m_unitbytes; // size of each unit in bytes - UINT64 m_unitcount; // number of units represented + uint32_t m_version; // version of the header + uint64_t m_logicalbytes; // logical size of the raw CHD data in bytes + uint64_t m_mapoffset; // offset of map + uint64_t m_metaoffset; // offset to first metadata bit + uint32_t m_hunkbytes; // size of each raw hunk in bytes + uint32_t m_hunkcount; // number of hunks represented + uint32_t m_unitbytes; // size of each unit in bytes + uint64_t m_unitcount; // number of units represented chd_codec_type m_compression[4]; // array of compression types used chd_file * m_parent; // pointer to parent file, or nullptr if none bool m_parent_missing; // are we missing our parent? // key offsets within the header - UINT64 m_mapoffset_offset; // offset of map offset field - UINT64 m_metaoffset_offset;// offset of metaoffset field - UINT64 m_sha1_offset; // offset of SHA1 field - UINT64 m_rawsha1_offset; // offset of raw SHA1 field - UINT64 m_parentsha1_offset;// offset of paren SHA1 field + uint64_t m_mapoffset_offset; // offset of map offset field + uint64_t m_metaoffset_offset;// offset of metaoffset field + uint64_t m_sha1_offset; // offset of SHA1 field + uint64_t m_rawsha1_offset; // offset of raw SHA1 field + uint64_t m_parentsha1_offset;// offset of paren SHA1 field // map information - UINT32 m_mapentrybytes; // length of each entry in a map - std::vector m_rawmap; // raw map data + uint32_t m_mapentrybytes; // length of each entry in a map + std::vector m_rawmap; // raw map data // compression management chd_decompressor * m_decompressor[4]; // array of decompression codecs - std::vector m_compressed; // temporary buffer for compressed data + std::vector m_compressed; // temporary buffer for compressed data // caching - std::vector m_cache; // single-hunk cache for partial reads/writes - UINT32 m_cachehunk; // which hunk is in the cache? + std::vector m_cache; // single-hunk cache for partial reads/writes + uint32_t m_cachehunk; // which hunk is in the cache? }; @@ -456,7 +456,7 @@ public: protected: // required override: read more data - virtual UINT32 read_data(void *dest, UINT64 offset, UINT32 length) = 0; + virtual uint32_t read_data(void *dest, uint64_t offset, uint32_t length) = 0; private: // hash map for looking up values @@ -469,17 +469,17 @@ private: // operations void reset(); - UINT64 find(util::crc16_t crc16, util::sha1_t sha1); - void add(UINT64 itemnum, util::crc16_t crc16, util::sha1_t sha1); + uint64_t find(util::crc16_t crc16, util::sha1_t sha1); + void add(uint64_t itemnum, util::crc16_t crc16, util::sha1_t sha1); // constants - static const UINT64 NOT_FOUND = ~UINT64(0); + static const uint64_t NOT_FOUND = ~uint64_t(0); private: // internal entry struct entry_t { entry_t * m_next; // next entry in list - UINT64 m_itemnum; // item number + uint64_t m_itemnum; // item number util::sha1_t m_sha1; // SHA-1 of the block }; @@ -490,7 +490,7 @@ private: : m_next(prev), m_nextalloc(0) { } entry_block * m_next; // next block in list - UINT32 m_nextalloc; // next to be allocated + uint32_t m_nextalloc; // next to be allocated entry_t m_array[16384]; // array of entries }; @@ -534,12 +534,12 @@ private: chd_file_compressor *m_compressor; // pointer back to the compressor // TODO: had to change this to be able to use atomic_* functions on this //volatile work_status m_status; // current status of this item - std::atomic m_status; // current status of this item - UINT32 m_hunknum; // number of the hunk we're working on - UINT8 * m_data; // pointer to the data we are working on - UINT8 * m_compressed; // pointer to the compressed data - UINT32 m_complen; // compressed data length - INT8 m_compression; // type of compression used + std::atomic m_status; // current status of this item + uint32_t m_hunknum; // number of the hunk we're working on + uint8_t * m_data; // pointer to the data we are working on + uint8_t * m_compressed; // pointer to the compressed data + uint32_t m_complen; // compressed data length + int8_t m_compression; // type of compression used chd_compressor_group *m_codecs; // codec instance std::vector m_hash; // array of hashes }; @@ -554,8 +554,8 @@ private: // current compression status bool m_walking_parent; // are we building the parent map? - UINT64 m_total_in; // total bytes in - UINT64 m_total_out; // total bytes out + uint64_t m_total_in; // total bytes in + uint64_t m_total_out; // total bytes out util::sha1_creator m_compsha1; // running SHA-1 on raw data // hash lookup maps @@ -564,20 +564,20 @@ private: // read I/O thread osd_work_queue * m_read_queue; // work queue for reading - UINT64 m_read_queue_offset;// next offset to enqueue - UINT64 m_read_done_offset; // next offset that will complete + uint64_t m_read_queue_offset;// next offset to enqueue + uint64_t m_read_done_offset; // next offset that will complete bool m_read_error; // error during reading? // work item thread static const int WORK_BUFFER_HUNKS = 256; osd_work_queue * m_work_queue; // queue for doing work on other threads - std::vector m_work_buffer; // buffer containing hunk data to work on - std::vector m_compressed_buffer;// buffer containing compressed data + std::vector m_work_buffer; // buffer containing hunk data to work on + std::vector m_compressed_buffer;// buffer containing compressed data work_item m_work_item[WORK_BUFFER_HUNKS]; // status of each hunk chd_compressor_group * m_codecs[WORK_MAX_THREADS]; // codecs to use // output state - UINT32 m_write_hunk; // next hunk to write + uint32_t m_write_hunk; // next hunk to write }; diff --git a/src/lib/util/chdcd.cpp b/src/lib/util/chdcd.cpp index 76da08b6b9e..f6176cd4cd9 100644 --- a/src/lib/util/chdcd.cpp +++ b/src/lib/util/chdcd.cpp @@ -76,7 +76,7 @@ static std::string get_file_path(std::string &path) -------------------------------------------------*/ /** - * @fn static UINT64 get_file_size(const char *filename) + * @fn static uint64_t get_file_size(const char *filename) * * @brief Gets file size. * @@ -85,7 +85,7 @@ static std::string get_file_path(std::string &path) * @return The file size. */ -static UINT64 get_file_size(const char *filename) +static uint64_t get_file_size(const char *filename) { osd_file::ptr file; std::uint64_t filesize = 0; @@ -120,7 +120,7 @@ static int tokenize( const char *linebuffer, int i, int linebuffersize, char *to int singlequote = 0; int doublequote = 0; - while ((i < linebuffersize) && isspace((UINT8)linebuffer[i])) + while ((i < linebuffersize) && isspace((uint8_t)linebuffer[i])) { i++; } @@ -135,7 +135,7 @@ static int tokenize( const char *linebuffer, int i, int linebuffersize, char *to { singlequote = !singlequote; } - else if (!singlequote && !doublequote && isspace((UINT8)linebuffer[i])) + else if (!singlequote && !doublequote && isspace((uint8_t)linebuffer[i])) { break; } @@ -196,24 +196,24 @@ static int msf_to_frames( char *token ) -------------------------------------------------*/ /** - * @fn static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs) + * @fn static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs) * * @brief Parse WAV sample. * * @param filename Filename of the file. * @param [in,out] dataoffs If non-null, the dataoffs. * - * @return An UINT32. + * @return An uint32_t. */ -static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs) +static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs) { unsigned long offset = 0; - UINT32 length, rate, filesize; - UINT16 bits, temp16; + uint32_t length, rate, filesize; + uint16_t bits, temp16; char buf[32]; osd_file::ptr file; - UINT64 fsize = 0; + uint64_t fsize = 0; std::uint32_t actual; osd_file::error filerr = osd_file::open(filename, OPEN_FLAG_READ, file, fsize); @@ -361,7 +361,7 @@ static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs) } /** - * @fn UINT16 read_uint16(FILE *infile) + * @fn uint16_t read_uint16(FILE *infile) * * @brief Reads uint 16. * @@ -370,9 +370,9 @@ static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs) * @return The uint 16. */ -UINT16 read_uint16(FILE *infile) +uint16_t read_uint16(FILE *infile) { - UINT16 res = 0; + uint16_t res = 0; unsigned char buffer[2]; fread(buffer, 2, 1, infile); @@ -383,7 +383,7 @@ UINT16 read_uint16(FILE *infile) } /** - * @fn UINT32 read_uint32(FILE *infile) + * @fn uint32_t read_uint32(FILE *infile) * * @brief Reads uint 32. * @@ -392,9 +392,9 @@ UINT16 read_uint16(FILE *infile) * @return The uint 32. */ -UINT32 read_uint32(FILE *infile) +uint32_t read_uint32(FILE *infile) { - UINT32 res = 0; + uint32_t res = 0; unsigned char buffer[4]; fread(buffer, 4, 1, infile); @@ -405,7 +405,7 @@ UINT32 read_uint32(FILE *infile) } /** - * @fn UINT64 read_uint64(FILE *infile) + * @fn uint64_t read_uint64(FILE *infile) * * @brief Reads uint 64. * @@ -414,10 +414,10 @@ UINT32 read_uint32(FILE *infile) * @return The uint 64. */ -UINT64 read_uint64(FILE *infile) +uint64_t read_uint64(FILE *infile) { - UINT64 res0 = U64(0), res1 = U64(0); - UINT64 res; + uint64_t res0 = U64(0), res1 = U64(0); + uint64_t res; unsigned char buffer[8]; fread(buffer, 8, 1, infile); @@ -450,7 +450,7 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_ { FILE *infile; unsigned char buffer[12]; - UINT32 chain_offs, chunk_size; + uint32_t chain_offs, chunk_size; int done = 0; std::string path = std::string(tocfname); @@ -491,8 +491,8 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_ while (!done) { - UINT32 offset; - UINT8 start, end; + uint32_t offset; + uint8_t start, end; int track; fseek(infile, chain_offs, SEEK_SET); @@ -518,8 +518,8 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_ offset = 0; for (track = start; track <= end; track++) { - UINT32 size, mode; - UINT64 index0, index1, track_end; + uint32_t size, mode; + uint64_t index0, index1, track_end; fseek(infile, 12, SEEK_CUR); // skip ISRC code size = read_uint16(infile); @@ -529,9 +529,9 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_ index1 = read_uint64(infile); track_end = read_uint64(infile); -// printf("Track %d: sector size %d mode %x index0 %llx index1 %llx track_end %llx (pregap %d sectors, length %d sectors)\n", track, size, mode, index0, index1, track_end, (UINT32)(index1-index0)/size, (UINT32)(track_end-index1)/size); +// printf("Track %d: sector size %d mode %x index0 %llx index1 %llx track_end %llx (pregap %d sectors, length %d sectors)\n", track, size, mode, index0, index1, track_end, (uint32_t)(index1-index0)/size, (uint32_t)(track_end-index1)/size); outinfo.track[track-1].fname.assign(tocfname); - outinfo.track[track-1].offset = offset + (UINT32)(index1-index0); + outinfo.track[track-1].offset = offset + (uint32_t)(index1-index0); outinfo.track[track-1].idx0offs = 0; outinfo.track[track-1].idx1offs = 0; @@ -588,8 +588,8 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_ outtoc.tracks[track-1].subtype = CD_SUB_NONE; outtoc.tracks[track-1].subsize = 0; - outtoc.tracks[track-1].pregap = (UINT32)(index1-index0)/size; - outtoc.tracks[track-1].frames = (UINT32)(track_end-index1)/size; + outtoc.tracks[track-1].pregap = (uint32_t)(index1-index0)/size; + outtoc.tracks[track-1].frames = (uint32_t)(track_end-index1)/size; outtoc.tracks[track-1].postgap = 0; outtoc.tracks[track-1].pgtype = 0; outtoc.tracks[track-1].pgsub = CD_SUB_NONE; @@ -597,7 +597,7 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_ outtoc.tracks[track-1].pgsubsize = 0; outtoc.tracks[track-1].padframes = 0; - offset += (UINT32)track_end-index1; + offset += (uint32_t)track_end-index1; } } @@ -649,7 +649,7 @@ chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i memset(&outtoc, 0, sizeof(outtoc)); outinfo.reset(); - UINT64 size = get_file_size(tocfname); + uint64_t size = get_file_size(tocfname); fclose(infile); @@ -846,7 +846,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i int i, trknum; static char token[512]; std::string lastfname; - UINT32 wavlen, wavoffs; + uint32_t wavlen, wavoffs; std::string path = std::string(tocfname); infile = fopen(tocfname, "rt"); @@ -1039,7 +1039,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i /* now go over the files again and set the lengths */ for (trknum = 0; trknum < outtoc.numtrks; trknum++) { - UINT64 tlen = 0; + uint64_t tlen = 0; // this is true for cue/bin and cue/iso, and we need it for cue/wav since .WAV is little-endian if (outtoc.tracks[trknum].trktype == CD_TRACK_AUDIO) @@ -1226,7 +1226,7 @@ chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i /* it's a decimal offset, use it */ f = strtoul(&token[1], nullptr, 10); } - else if (isdigit((UINT8)token[0])) + else if (isdigit((uint8_t)token[0])) { /* convert the time to an offset */ f = msf_to_frames( token ); @@ -1242,14 +1242,14 @@ chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i TOKENIZE - if (isdigit((UINT8)token[0])) + if (isdigit((uint8_t)token[0])) { // this could be the length or an offset from the previous field. f = msf_to_frames( token ); TOKENIZE - if (isdigit((UINT8)token[0])) + if (isdigit((uint8_t)token[0])) { // it was an offset. f *= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize); diff --git a/src/lib/util/chdcd.h b/src/lib/util/chdcd.h index 6adcf29ce7b..3f31bad7e00 100644 --- a/src/lib/util/chdcd.h +++ b/src/lib/util/chdcd.h @@ -19,10 +19,10 @@ struct chdcd_track_input_entry void reset() { fname.clear(); offset = idx0offs = idx1offs = 0; swap = false; } std::string fname; // filename for each track - UINT32 offset; // offset in the data file for each track + uint32_t offset; // offset in the data file for each track bool swap; // data needs to be byte swapped - UINT32 idx0offs; - UINT32 idx1offs; + uint32_t idx0offs; + uint32_t idx1offs; }; struct chdcd_track_input_info diff --git a/src/lib/util/chdcodec.cpp b/src/lib/util/chdcodec.cpp index e2758f08a9e..71763163a87 100644 --- a/src/lib/util/chdcodec.cpp +++ b/src/lib/util/chdcodec.cpp @@ -25,7 +25,7 @@ // GLOBAL VARIABLES //************************************************************************** -static const UINT8 s_cd_sync_header[12] = { 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00 }; +static const uint8_t s_cd_sync_header[12] = { 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00 }; @@ -52,7 +52,7 @@ private: static void fast_free(voidpf opaque, voidpf address); static const int MAX_ZLIB_ALLOCS = 64; - UINT32 * m_allocptr[MAX_ZLIB_ALLOCS]; + uint32_t * m_allocptr[MAX_ZLIB_ALLOCS]; }; @@ -63,11 +63,11 @@ class chd_zlib_compressor : public chd_compressor { public: // construction/destruction - chd_zlib_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_zlib_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy); ~chd_zlib_compressor(); // core functionality - virtual UINT32 compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) override; + virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) override; private: // internal state @@ -83,11 +83,11 @@ class chd_zlib_decompressor : public chd_decompressor { public: // construction/destruction - chd_zlib_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_zlib_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy); ~chd_zlib_decompressor(); // core functionality - virtual void decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) override; + virtual void decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) override; private: // internal state @@ -112,7 +112,7 @@ private: static void fast_free(void *p, void *address); static const int MAX_LZMA_ALLOCS = 64; - UINT32 * m_allocptr[MAX_LZMA_ALLOCS]; + uint32_t * m_allocptr[MAX_LZMA_ALLOCS]; }; @@ -123,14 +123,14 @@ class chd_lzma_compressor : public chd_compressor { public: // construction/destruction - chd_lzma_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_lzma_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy); ~chd_lzma_compressor(); // core functionality - virtual UINT32 compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) override; + virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) override; // helpers - static void configure_properties(CLzmaEncProps &props, UINT32 hunkbytes); + static void configure_properties(CLzmaEncProps &props, uint32_t hunkbytes); private: // internal state @@ -146,11 +146,11 @@ class chd_lzma_decompressor : public chd_decompressor { public: // construction/destruction - chd_lzma_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_lzma_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy); ~chd_lzma_decompressor(); // core functionality - virtual void decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) override; + virtual void decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) override; private: // internal state @@ -166,10 +166,10 @@ class chd_huffman_compressor : public chd_compressor { public: // construction/destruction - chd_huffman_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_huffman_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy); // core functionality - virtual UINT32 compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) override; + virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) override; private: // internal state @@ -184,10 +184,10 @@ class chd_huffman_decompressor : public chd_decompressor { public: // construction/destruction - chd_huffman_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_huffman_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy); // core functionality - virtual void decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) override; + virtual void decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) override; private: // internal state @@ -202,13 +202,13 @@ class chd_flac_compressor : public chd_compressor { public: // construction/destruction - chd_flac_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_flac_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy); // core functionality - virtual UINT32 compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) override; + virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) override; // static helpers - static UINT32 blocksize(UINT32 bytes); + static uint32_t blocksize(uint32_t bytes); private: // internal state @@ -224,10 +224,10 @@ class chd_flac_decompressor : public chd_decompressor { public: // construction/destruction - chd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_flac_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy); // core functionality - virtual void decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) override; + virtual void decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) override; private: // internal state @@ -243,14 +243,14 @@ class chd_cd_flac_compressor : public chd_compressor { public: // construction/destruction - chd_cd_flac_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_cd_flac_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy); ~chd_cd_flac_compressor(); // core functionality - virtual UINT32 compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) override; + virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) override; // static helpers - static UINT32 blocksize(UINT32 bytes); + static uint32_t blocksize(uint32_t bytes); private: // internal state @@ -258,7 +258,7 @@ private: flac_encoder m_encoder; z_stream m_deflater; chd_zlib_allocator m_allocator; - std::vector m_buffer; + std::vector m_buffer; }; @@ -269,11 +269,11 @@ class chd_cd_flac_decompressor : public chd_decompressor { public: // construction/destruction - chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_cd_flac_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy); ~chd_cd_flac_decompressor(); // core functionality - virtual void decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) override; + virtual void decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) override; private: // internal state @@ -281,7 +281,7 @@ private: flac_decoder m_decoder; z_stream m_inflater; chd_zlib_allocator m_allocator; - std::vector m_buffer; + std::vector m_buffer; }; @@ -292,7 +292,7 @@ class chd_cd_compressor : public chd_compressor { public: // construction/destruction - chd_cd_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) + chd_cd_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_compressor(chd, hunkbytes, lossy), m_base_compressor(chd, (hunkbytes / CD_FRAME_SIZE) * CD_MAX_SECTOR_DATA, lossy), m_subcode_compressor(chd, (hunkbytes / CD_FRAME_SIZE) * CD_MAX_SUBCODE_DATA, lossy), @@ -304,25 +304,25 @@ public: } // core functionality - virtual UINT32 compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) override + virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) override { // determine header bytes - UINT32 frames = srclen / CD_FRAME_SIZE; - UINT32 complen_bytes = (srclen < 65536) ? 2 : 3; - UINT32 ecc_bytes = (frames + 7) / 8; - UINT32 header_bytes = ecc_bytes + complen_bytes; + uint32_t frames = srclen / CD_FRAME_SIZE; + uint32_t complen_bytes = (srclen < 65536) ? 2 : 3; + uint32_t ecc_bytes = (frames + 7) / 8; + uint32_t header_bytes = ecc_bytes + complen_bytes; // clear out destination header memset(dest, 0, header_bytes); // copy audio data followed by subcode data - for (UINT32 framenum = 0; framenum < frames; framenum++) + for (uint32_t framenum = 0; framenum < frames; framenum++) { memcpy(&m_buffer[framenum * CD_MAX_SECTOR_DATA], &src[framenum * CD_FRAME_SIZE], CD_MAX_SECTOR_DATA); memcpy(&m_buffer[frames * CD_MAX_SECTOR_DATA + framenum * CD_MAX_SUBCODE_DATA], &src[framenum * CD_FRAME_SIZE + CD_MAX_SECTOR_DATA], CD_MAX_SUBCODE_DATA); // clear out ECC data if we can - UINT8 *sector = &m_buffer[framenum * CD_MAX_SECTOR_DATA]; + uint8_t *sector = &m_buffer[framenum * CD_MAX_SECTOR_DATA]; if (memcmp(sector, s_cd_sync_header, sizeof(s_cd_sync_header)) == 0 && ecc_verify(sector)) { dest[framenum / 8] |= 1 << (framenum % 8); @@ -332,7 +332,7 @@ public: } // encode the base portion - UINT32 complen = m_base_compressor.compress(&m_buffer[0], frames * CD_MAX_SECTOR_DATA, &dest[header_bytes]); + uint32_t complen = m_base_compressor.compress(&m_buffer[0], frames * CD_MAX_SECTOR_DATA, &dest[header_bytes]); if (complen >= srclen) throw CHDERR_COMPRESSION_ERROR; @@ -350,7 +350,7 @@ private: // internal state _BaseCompressor m_base_compressor; _SubcodeCompressor m_subcode_compressor; - std::vector m_buffer; + std::vector m_buffer; }; @@ -361,7 +361,7 @@ class chd_cd_decompressor : public chd_decompressor { public: // construction/destruction - chd_cd_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) + chd_cd_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy), m_base_decompressor(chd, (hunkbytes / CD_FRAME_SIZE) * CD_MAX_SECTOR_DATA, lossy), m_subcode_decompressor(chd, (hunkbytes / CD_FRAME_SIZE) * CD_MAX_SUBCODE_DATA, lossy), @@ -373,16 +373,16 @@ public: } // core functionality - virtual void decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) override + virtual void decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) override { // determine header bytes - UINT32 frames = destlen / CD_FRAME_SIZE; - UINT32 complen_bytes = (destlen < 65536) ? 2 : 3; - UINT32 ecc_bytes = (frames + 7) / 8; - UINT32 header_bytes = ecc_bytes + complen_bytes; + uint32_t frames = destlen / CD_FRAME_SIZE; + uint32_t complen_bytes = (destlen < 65536) ? 2 : 3; + uint32_t ecc_bytes = (frames + 7) / 8; + uint32_t header_bytes = ecc_bytes + complen_bytes; // extract compressed length of base - UINT32 complen_base = (src[ecc_bytes + 0] << 8) | src[ecc_bytes + 1]; + uint32_t complen_base = (src[ecc_bytes + 0] << 8) | src[ecc_bytes + 1]; if (complen_bytes > 2) complen_base = (complen_base << 8) | src[ecc_bytes + 2]; @@ -391,13 +391,13 @@ public: m_subcode_decompressor.decompress(&src[header_bytes + complen_base], complen - complen_base - header_bytes, &m_buffer[frames * CD_MAX_SECTOR_DATA], frames * CD_MAX_SUBCODE_DATA); // reassemble the data - for (UINT32 framenum = 0; framenum < frames; framenum++) + for (uint32_t framenum = 0; framenum < frames; framenum++) { memcpy(&dest[framenum * CD_FRAME_SIZE], &m_buffer[framenum * CD_MAX_SECTOR_DATA], CD_MAX_SECTOR_DATA); memcpy(&dest[framenum * CD_FRAME_SIZE + CD_MAX_SECTOR_DATA], &m_buffer[frames * CD_MAX_SECTOR_DATA + framenum * CD_MAX_SUBCODE_DATA], CD_MAX_SUBCODE_DATA); // reconstitute the ECC data and sync header - UINT8 *sector = &dest[framenum * CD_FRAME_SIZE]; + uint8_t *sector = &dest[framenum * CD_FRAME_SIZE]; if ((src[framenum / 8] & (1 << (framenum % 8))) != 0) { memcpy(sector, s_cd_sync_header, sizeof(s_cd_sync_header)); @@ -410,7 +410,7 @@ private: // internal state _BaseDecompressor m_base_decompressor; _SubcodeDecompressor m_subcode_decompressor; - std::vector m_buffer; + std::vector m_buffer; }; @@ -421,10 +421,10 @@ class chd_avhuff_compressor : public chd_compressor { public: // construction/destruction - chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_avhuff_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy); // core functionality - virtual UINT32 compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) override; + virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) override; private: // internal helpers @@ -443,10 +443,10 @@ class chd_avhuff_decompressor : public chd_decompressor { public: // construction/destruction - chd_avhuff_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy); + chd_avhuff_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy); // core functionality - virtual void decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) override; + virtual void decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) override; virtual void configure(int param, void *config) override; private: @@ -488,7 +488,7 @@ const chd_codec_list::codec_entry chd_codec_list::s_codec_list[] = // chd_codec - constructor //------------------------------------------------- -chd_codec::chd_codec(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_codec::chd_codec(chd_file &chd, uint32_t hunkbytes, bool lossy) : m_chd(chd), m_hunkbytes(hunkbytes), m_lossy(lossy) @@ -525,7 +525,7 @@ void chd_codec::configure(int param, void *config) // chd_compressor - constructor //------------------------------------------------- -chd_compressor::chd_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_compressor::chd_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_codec(chd, hunkbytes, lossy) { } @@ -540,7 +540,7 @@ chd_compressor::chd_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) // chd_decompressor - constructor //------------------------------------------------- -chd_decompressor::chd_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_decompressor::chd_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_codec(chd, hunkbytes, lossy) { } @@ -614,7 +614,7 @@ const chd_codec_list::codec_entry *chd_codec_list::find_in_list(chd_codec_type t // chd_compressor_group - constructor //------------------------------------------------- -chd_compressor_group::chd_compressor_group(chd_file &chd, UINT32 compressor_list[4]) +chd_compressor_group::chd_compressor_group(chd_file &chd, uint32_t compressor_list[4]) : m_hunkbytes(chd.hunk_bytes()), m_compress_test(m_hunkbytes) #if CHDCODEC_VERIFY_COMPRESSION @@ -658,11 +658,11 @@ chd_compressor_group::~chd_compressor_group() // compression for this hunk //------------------------------------------------- -INT8 chd_compressor_group::find_best_compressor(const UINT8 *src, UINT8 *compressed, UINT32 &complen) +int8_t chd_compressor_group::find_best_compressor(const uint8_t *src, uint8_t *compressed, uint32_t &complen) { // determine best compression technique complen = m_hunkbytes; - INT8 compression = -1; + int8_t compression = -1; for (int codecnum = 0; codecnum < ARRAY_LENGTH(m_compressor); codecnum++) if (m_compressor[codecnum] != nullptr) { @@ -670,7 +670,7 @@ INT8 chd_compressor_group::find_best_compressor(const UINT8 *src, UINT8 *compres try { // if this is the best one, copy the data into the permanent buffer - UINT32 compbytes = m_compressor[codecnum]->compress(src, m_hunkbytes, &m_compress_test[0]); + uint32_t compbytes = m_compressor[codecnum]->compress(src, m_hunkbytes, &m_compress_test[0]); #if CHDCODEC_VERIFY_COMPRESSION try { @@ -768,7 +768,7 @@ voidpf chd_zlib_allocator::fast_alloc(voidpf opaque, uInt items, uInt size) // reuse a hunk if we can for (int scan = 0; scan < MAX_ZLIB_ALLOCS; scan++) { - UINT32 *ptr = codec->m_allocptr[scan]; + uint32_t *ptr = codec->m_allocptr[scan]; if (ptr != nullptr && size == *ptr) { // set the low bit of the size so we don't match next time @@ -778,7 +778,7 @@ voidpf chd_zlib_allocator::fast_alloc(voidpf opaque, uInt items, uInt size) } // alloc a new one and put it into the list - UINT32 *ptr = reinterpret_cast(new UINT8[size + sizeof(UINT32)]); + uint32_t *ptr = reinterpret_cast(new uint8_t[size + sizeof(uint32_t)]); for (int scan = 0; scan < MAX_ZLIB_ALLOCS; scan++) if (codec->m_allocptr[scan] == nullptr) { @@ -802,7 +802,7 @@ void chd_zlib_allocator::fast_free(voidpf opaque, voidpf address) chd_zlib_allocator *codec = reinterpret_cast(opaque); // find the hunk - UINT32 *ptr = reinterpret_cast(address) - 1; + uint32_t *ptr = reinterpret_cast(address) - 1; for (int scan = 0; scan < MAX_ZLIB_ALLOCS; scan++) if (ptr == codec->m_allocptr[scan]) { @@ -822,7 +822,7 @@ void chd_zlib_allocator::fast_free(voidpf opaque, voidpf address) // chd_zlib_compressor - constructor //------------------------------------------------- -chd_zlib_compressor::chd_zlib_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_zlib_compressor::chd_zlib_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_compressor(chd, hunkbytes, lossy) { // initialize the deflater @@ -853,7 +853,7 @@ chd_zlib_compressor::~chd_zlib_compressor() // compress - compress data using the ZLIB codec //------------------------------------------------- -UINT32 chd_zlib_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) +uint32_t chd_zlib_compressor::compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) { // reset the decompressor m_deflater.next_in = const_cast(src); @@ -887,7 +887,7 @@ UINT32 chd_zlib_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *des // chd_zlib_decompressor - constructor //------------------------------------------------- -chd_zlib_decompressor::chd_zlib_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_zlib_decompressor::chd_zlib_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy) { // init the inflater @@ -919,7 +919,7 @@ chd_zlib_decompressor::~chd_zlib_decompressor() // codec //------------------------------------------------- -void chd_zlib_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) +void chd_zlib_decompressor::decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) { // reset the decompressor m_inflater.next_in = const_cast(src); @@ -988,7 +988,7 @@ void *chd_lzma_allocator::fast_alloc(void *p, size_t size) // reuse a hunk if we can for (int scan = 0; scan < MAX_LZMA_ALLOCS; scan++) { - UINT32 *ptr = codec->m_allocptr[scan]; + uint32_t *ptr = codec->m_allocptr[scan]; if (ptr != nullptr && size == *ptr) { // set the low bit of the size so we don't match next time @@ -998,7 +998,7 @@ void *chd_lzma_allocator::fast_alloc(void *p, size_t size) } // alloc a new one and put it into the list - UINT32 *ptr = reinterpret_cast(new UINT8[size + sizeof(UINT32)]); + uint32_t *ptr = reinterpret_cast(new uint8_t[size + sizeof(uint32_t)]); for (int scan = 0; scan < MAX_LZMA_ALLOCS; scan++) if (codec->m_allocptr[scan] == nullptr) { @@ -1025,7 +1025,7 @@ void chd_lzma_allocator::fast_free(void *p, void *address) chd_lzma_allocator *codec = reinterpret_cast(p); // find the hunk - UINT32 *ptr = reinterpret_cast(address) - 1; + uint32_t *ptr = reinterpret_cast(address) - 1; for (int scan = 0; scan < MAX_LZMA_ALLOCS; scan++) if (ptr == codec->m_allocptr[scan]) { @@ -1045,7 +1045,7 @@ void chd_lzma_allocator::fast_free(void *p, void *address) // chd_lzma_compressor - constructor //------------------------------------------------- -chd_lzma_compressor::chd_lzma_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_lzma_compressor::chd_lzma_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_compressor(chd, hunkbytes, lossy) { // initialize the properties @@ -1066,7 +1066,7 @@ chd_lzma_compressor::~chd_lzma_compressor() // compress - compress data using the LZMA codec //------------------------------------------------- -UINT32 chd_lzma_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) +uint32_t chd_lzma_compressor::compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) { // allocate the encoder CLzmaEncHandle encoder = LzmaEnc_Create(&m_allocator); @@ -1104,7 +1104,7 @@ UINT32 chd_lzma_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *des // codec //------------------------------------------------- -void chd_lzma_compressor::configure_properties(CLzmaEncProps &props, UINT32 hunkbytes) +void chd_lzma_compressor::configure_properties(CLzmaEncProps &props, uint32_t hunkbytes) { LzmaEncProps_Init(&props); props.level = 9; @@ -1122,7 +1122,7 @@ void chd_lzma_compressor::configure_properties(CLzmaEncProps &props, UINT32 hunk // chd_lzma_decompressor - constructor //------------------------------------------------- -chd_lzma_decompressor::chd_lzma_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_lzma_decompressor::chd_lzma_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy) { // construct the decoder @@ -1177,7 +1177,7 @@ chd_lzma_decompressor::~chd_lzma_decompressor() // codec //------------------------------------------------- -void chd_lzma_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) +void chd_lzma_decompressor::decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) { // initialize LzmaDec_Init(&m_decoder); @@ -1201,7 +1201,7 @@ void chd_lzma_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 * // chd_huffman_compressor - constructor //------------------------------------------------- -chd_huffman_compressor::chd_huffman_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_huffman_compressor::chd_huffman_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_compressor(chd, hunkbytes, lossy) { } @@ -1212,9 +1212,9 @@ chd_huffman_compressor::chd_huffman_compressor(chd_file &chd, UINT32 hunkbytes, // codec //------------------------------------------------- -UINT32 chd_huffman_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) +uint32_t chd_huffman_compressor::compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) { - UINT32 complen; + uint32_t complen; if (m_encoder.encode(src, srclen, dest, srclen, complen) != HUFFERR_NONE) throw CHDERR_COMPRESSION_ERROR; return complen; @@ -1230,7 +1230,7 @@ UINT32 chd_huffman_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 * // chd_huffman_decompressor - constructor //------------------------------------------------- -chd_huffman_decompressor::chd_huffman_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_huffman_decompressor::chd_huffman_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy) { } @@ -1241,7 +1241,7 @@ chd_huffman_decompressor::chd_huffman_decompressor(chd_file &chd, UINT32 hunkbyt // codec //------------------------------------------------- -void chd_huffman_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) +void chd_huffman_decompressor::decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) { if (m_decoder.decode(src, complen, dest, destlen) != HUFFERR_NONE) throw CHDERR_COMPRESSION_ERROR; @@ -1257,12 +1257,12 @@ void chd_huffman_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT // chd_flac_compressor - constructor //------------------------------------------------- -chd_flac_compressor::chd_flac_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_flac_compressor::chd_flac_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_compressor(chd, hunkbytes, lossy) { // determine whether we want native or swapped samples - UINT16 native_endian = 0; - *reinterpret_cast(&native_endian) = 1; + uint16_t native_endian = 0; + *reinterpret_cast(&native_endian) = 1; m_big_endian = (native_endian == 0x100); // configure the encoder @@ -1277,22 +1277,22 @@ chd_flac_compressor::chd_flac_compressor(chd_file &chd, UINT32 hunkbytes, bool l // compress - compress data using the FLAC codec //------------------------------------------------- -UINT32 chd_flac_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) +uint32_t chd_flac_compressor::compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) { // reset and encode big-endian m_encoder.reset(dest + 1, hunkbytes() - 1); - if (!m_encoder.encode_interleaved(reinterpret_cast(src), srclen / 4, !m_big_endian)) + if (!m_encoder.encode_interleaved(reinterpret_cast(src), srclen / 4, !m_big_endian)) throw CHDERR_COMPRESSION_ERROR; - UINT32 complen_be = m_encoder.finish(); + uint32_t complen_be = m_encoder.finish(); // reset and encode little-endian m_encoder.reset(dest + 1, hunkbytes() - 1); - if (!m_encoder.encode_interleaved(reinterpret_cast(src), srclen / 4, m_big_endian)) + if (!m_encoder.encode_interleaved(reinterpret_cast(src), srclen / 4, m_big_endian)) throw CHDERR_COMPRESSION_ERROR; - UINT32 complen_le = m_encoder.finish(); + uint32_t complen_le = m_encoder.finish(); // pick the best one and add a byte - UINT32 complen = std::min(complen_le, complen_be); + uint32_t complen = std::min(complen_le, complen_be); if (complen + 1 >= hunkbytes()) throw CHDERR_COMPRESSION_ERROR; @@ -1302,7 +1302,7 @@ UINT32 chd_flac_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *des { dest[0] = 'B'; m_encoder.reset(dest + 1, hunkbytes() - 1); - if (!m_encoder.encode_interleaved(reinterpret_cast(src), srclen / 4, !m_big_endian)) + if (!m_encoder.encode_interleaved(reinterpret_cast(src), srclen / 4, !m_big_endian)) throw CHDERR_COMPRESSION_ERROR; m_encoder.finish(); } @@ -1314,11 +1314,11 @@ UINT32 chd_flac_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *des // blocksize - return the optimal block size //------------------------------------------------- -UINT32 chd_flac_compressor::blocksize(UINT32 bytes) +uint32_t chd_flac_compressor::blocksize(uint32_t bytes) { // determine FLAC block size, which must be 16-65535 // clamp to 2k since that's supposed to be the sweet spot - UINT32 hunkbytes = bytes / 4; + uint32_t hunkbytes = bytes / 4; while (hunkbytes > 2048) hunkbytes /= 2; return hunkbytes; @@ -1334,12 +1334,12 @@ UINT32 chd_flac_compressor::blocksize(UINT32 bytes) // chd_flac_decompressor - constructor //------------------------------------------------- -chd_flac_decompressor::chd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_flac_decompressor::chd_flac_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy) { // determine whether we want native or swapped samples - UINT16 native_endian = 0; - *reinterpret_cast(&native_endian) = 1; + uint16_t native_endian = 0; + *reinterpret_cast(&native_endian) = 1; m_big_endian = (native_endian == 0x100); } @@ -1349,7 +1349,7 @@ chd_flac_decompressor::chd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bo // codec //------------------------------------------------- -void chd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) +void chd_flac_decompressor::decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) { // determine the endianness bool swap_endian; @@ -1363,7 +1363,7 @@ void chd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 * // reset and decode if (!m_decoder.reset(44100, 2, chd_flac_compressor::blocksize(destlen), src + 1, complen - 1)) throw CHDERR_DECOMPRESSION_ERROR; - if (!m_decoder.decode_interleaved(reinterpret_cast(dest), destlen / 4, swap_endian)) + if (!m_decoder.decode_interleaved(reinterpret_cast(dest), destlen / 4, swap_endian)) throw CHDERR_DECOMPRESSION_ERROR; // finish up @@ -1380,7 +1380,7 @@ void chd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 * // chd_cd_flac_compressor - constructor //------------------------------------------------- -chd_cd_flac_compressor::chd_cd_flac_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_cd_flac_compressor::chd_cd_flac_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_compressor(chd, hunkbytes, lossy), m_buffer(hunkbytes) { @@ -1389,8 +1389,8 @@ chd_cd_flac_compressor::chd_cd_flac_compressor(chd_file &chd, UINT32 hunkbytes, throw CHDERR_CODEC_ERROR; // determine whether we want native or swapped samples - UINT16 native_endian = 0; - *reinterpret_cast(&native_endian) = 1; + uint16_t native_endian = 0; + *reinterpret_cast(&native_endian) = 1; m_swap_endian = (native_endian == 1); // configure the encoder @@ -1428,11 +1428,11 @@ chd_cd_flac_compressor::~chd_cd_flac_compressor() // and use zlib on the subcode data //------------------------------------------------- -UINT32 chd_cd_flac_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) +uint32_t chd_cd_flac_compressor::compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) { // copy audio data followed by subcode data - UINT32 frames = hunkbytes() / CD_FRAME_SIZE; - for (UINT32 framenum = 0; framenum < frames; framenum++) + uint32_t frames = hunkbytes() / CD_FRAME_SIZE; + for (uint32_t framenum = 0; framenum < frames; framenum++) { memcpy(&m_buffer[framenum * CD_MAX_SECTOR_DATA], &src[framenum * CD_FRAME_SIZE], CD_MAX_SECTOR_DATA); memcpy(&m_buffer[frames * CD_MAX_SECTOR_DATA + framenum * CD_MAX_SUBCODE_DATA], &src[framenum * CD_FRAME_SIZE + CD_MAX_SECTOR_DATA], CD_MAX_SUBCODE_DATA); @@ -1440,12 +1440,12 @@ UINT32 chd_cd_flac_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 * // reset and encode the audio portion m_encoder.reset(dest, hunkbytes()); - UINT8 *buffer = &m_buffer[0]; - if (!m_encoder.encode_interleaved(reinterpret_cast(buffer), frames * CD_MAX_SECTOR_DATA/4, m_swap_endian)) + uint8_t *buffer = &m_buffer[0]; + if (!m_encoder.encode_interleaved(reinterpret_cast(buffer), frames * CD_MAX_SECTOR_DATA/4, m_swap_endian)) throw CHDERR_COMPRESSION_ERROR; // finish up - UINT32 complen = m_encoder.finish(); + uint32_t complen = m_encoder.finish(); // deflate the subcode data m_deflater.next_in = const_cast(&m_buffer[frames * CD_MAX_SECTOR_DATA]); @@ -1469,7 +1469,7 @@ UINT32 chd_cd_flac_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 * } /** - * @fn UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes) + * @fn uint32_t chd_cd_flac_compressor::blocksize(uint32_t bytes) * * @brief ------------------------------------------------- * blocksize - return the optimal block size @@ -1477,13 +1477,13 @@ UINT32 chd_cd_flac_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 * * * @param bytes The bytes. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes) +uint32_t chd_cd_flac_compressor::blocksize(uint32_t bytes) { // for CDs it seems that CD_MAX_SECTOR_DATA is the right target - UINT32 blocksize = bytes / 4; + uint32_t blocksize = bytes / 4; while (blocksize > CD_MAX_SECTOR_DATA) blocksize /= 2; return blocksize; @@ -1496,7 +1496,7 @@ UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes) //************************************************************************** /** - * @fn chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) + * @fn chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) * * @brief ------------------------------------------------- * chd_cd_flac_decompressor - constructor @@ -1509,7 +1509,7 @@ UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes) * @param lossy true to lossy. */ -chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy), m_buffer(hunkbytes) { @@ -1518,8 +1518,8 @@ chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbyt throw CHDERR_CODEC_ERROR; // determine whether we want native or swapped samples - UINT16 native_endian = 0; - *reinterpret_cast(&native_endian) = 1; + uint16_t native_endian = 0; + *reinterpret_cast(&native_endian) = 1; m_swap_endian = (native_endian == 1); // init the inflater @@ -1549,7 +1549,7 @@ chd_cd_flac_decompressor::~chd_cd_flac_decompressor() } /** - * @fn void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) + * @fn void chd_cd_flac_decompressor::decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) * * @brief ------------------------------------------------- * decompress - decompress data using the FLAC codec @@ -1564,18 +1564,18 @@ chd_cd_flac_decompressor::~chd_cd_flac_decompressor() * @param destlen The destlen. */ -void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) +void chd_cd_flac_decompressor::decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) { // reset and decode - UINT32 frames = destlen / CD_FRAME_SIZE; + uint32_t frames = destlen / CD_FRAME_SIZE; if (!m_decoder.reset(44100, 2, chd_cd_flac_compressor::blocksize(frames * CD_MAX_SECTOR_DATA), src, complen)) throw CHDERR_DECOMPRESSION_ERROR; - UINT8 *buffer = &m_buffer[0]; - if (!m_decoder.decode_interleaved(reinterpret_cast(buffer), frames * CD_MAX_SECTOR_DATA/4, m_swap_endian)) + uint8_t *buffer = &m_buffer[0]; + if (!m_decoder.decode_interleaved(reinterpret_cast(buffer), frames * CD_MAX_SECTOR_DATA/4, m_swap_endian)) throw CHDERR_DECOMPRESSION_ERROR; // inflate the subcode data - UINT32 offset = m_decoder.finish(); + uint32_t offset = m_decoder.finish(); m_inflater.next_in = const_cast(src + offset); m_inflater.avail_in = complen - offset; m_inflater.total_in = 0; @@ -1594,7 +1594,7 @@ void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT throw CHDERR_DECOMPRESSION_ERROR; // reassemble the data - for (UINT32 framenum = 0; framenum < frames; framenum++) + for (uint32_t framenum = 0; framenum < frames; framenum++) { memcpy(&dest[framenum * CD_FRAME_SIZE], &m_buffer[framenum * CD_MAX_SECTOR_DATA], CD_MAX_SECTOR_DATA); memcpy(&dest[framenum * CD_FRAME_SIZE + CD_MAX_SECTOR_DATA], &m_buffer[frames * CD_MAX_SECTOR_DATA + framenum * CD_MAX_SUBCODE_DATA], CD_MAX_SUBCODE_DATA); @@ -1608,7 +1608,7 @@ void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT //************************************************************************** /** - * @fn chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) + * @fn chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) * * @brief ------------------------------------------------- * chd_avhuff_compressor - constructor @@ -1619,7 +1619,7 @@ void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT * @param lossy true to lossy. */ -chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_compressor(chd, hunkbytes, lossy), m_postinit(false) { @@ -1635,7 +1635,7 @@ chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bo } /** - * @fn UINT32 chd_avhuff_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) + * @fn uint32_t chd_avhuff_compressor::compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) * * @brief ------------------------------------------------- * compress - compress data using the A/V codec @@ -1650,10 +1650,10 @@ chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bo * @param srclen The srclen. * @param [in,out] dest If non-null, destination for the. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 chd_avhuff_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) +uint32_t chd_avhuff_compressor::compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) { // if we haven't yet set up the avhuff code, do it now if (!m_postinit) @@ -1669,7 +1669,7 @@ UINT32 chd_avhuff_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *d } // encode the audio and video - UINT32 complen; + uint32_t complen; avhuff_error averr = m_encoder.encode_data(src, dest, complen); if (averr != AVHERR_NONE || complen > srclen) throw CHDERR_COMPRESSION_ERROR; @@ -1703,9 +1703,9 @@ void chd_avhuff_compressor::postinit() throw CHDERR_INVALID_METADATA; // compute the bytes per frame - UINT32 fps_times_1million = fps * 1000000 + fpsfrac; - UINT32 max_samples_per_frame = (UINT64(rate) * 1000000 + fps_times_1million - 1) / fps_times_1million; - UINT32 bytes_per_frame = 12 + channels * max_samples_per_frame * 2 + width * height * 2; + uint32_t fps_times_1million = fps * 1000000 + fpsfrac; + uint32_t max_samples_per_frame = (uint64_t(rate) * 1000000 + fps_times_1million - 1) / fps_times_1million; + uint32_t bytes_per_frame = 12 + channels * max_samples_per_frame * 2 + width * height * 2; if (bytes_per_frame > hunkbytes()) throw CHDERR_INVALID_METADATA; @@ -1720,7 +1720,7 @@ void chd_avhuff_compressor::postinit() //************************************************************************** /** - * @fn chd_avhuff_decompressor::chd_avhuff_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) + * @fn chd_avhuff_decompressor::chd_avhuff_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) * * @brief ------------------------------------------------- * chd_avhuff_decompressor - constructor @@ -1731,13 +1731,13 @@ void chd_avhuff_compressor::postinit() * @param lossy true to lossy. */ -chd_avhuff_decompressor::chd_avhuff_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) +chd_avhuff_decompressor::chd_avhuff_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) : chd_decompressor(chd, hunkbytes, lossy) { } /** - * @fn void chd_avhuff_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) + * @fn void chd_avhuff_decompressor::decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) * * @brief ------------------------------------------------- * decompress - decompress data using the A/V codec @@ -1752,7 +1752,7 @@ chd_avhuff_decompressor::chd_avhuff_decompressor(chd_file &chd, UINT32 hunkbytes * @param destlen The destlen. */ -void chd_avhuff_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) +void chd_avhuff_decompressor::decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) { // decode the audio and video avhuff_error averr = m_decoder.decode_data(src, complen, dest); diff --git a/src/lib/util/chdcodec.h b/src/lib/util/chdcodec.h index 0b56cbdeb9c..899b5363592 100644 --- a/src/lib/util/chdcodec.h +++ b/src/lib/util/chdcodec.h @@ -36,7 +36,7 @@ class chd_file; // base types -typedef UINT32 chd_codec_type; +typedef uint32_t chd_codec_type; // ======================> chd_codec @@ -46,7 +46,7 @@ class chd_codec { protected: // can't create these directly - chd_codec(chd_file &file, UINT32 hunkbytes, bool lossy); + chd_codec(chd_file &file, uint32_t hunkbytes, bool lossy); public: // allow public deletion @@ -54,7 +54,7 @@ public: // accessors chd_file &chd() const { return m_chd; } - UINT32 hunkbytes() const { return m_hunkbytes; } + uint32_t hunkbytes() const { return m_hunkbytes; } bool lossy() const { return m_lossy; } // implementation @@ -63,7 +63,7 @@ public: private: // internal state chd_file & m_chd; - UINT32 m_hunkbytes; + uint32_t m_hunkbytes; bool m_lossy; }; @@ -75,11 +75,11 @@ class chd_compressor : public chd_codec { protected: // can't create these directly - chd_compressor(chd_file &file, UINT32 hunkbytes, bool lossy); + chd_compressor(chd_file &file, uint32_t hunkbytes, bool lossy); public: // implementation - virtual UINT32 compress(const UINT8 *src, UINT32 srclen, UINT8 *dest) = 0; + virtual uint32_t compress(const uint8_t *src, uint32_t srclen, uint8_t *dest) = 0; }; @@ -90,11 +90,11 @@ class chd_decompressor : public chd_codec { protected: // can't create these directly - chd_decompressor(chd_file &file, UINT32 hunkbytes, bool lossy); + chd_decompressor(chd_file &file, uint32_t hunkbytes, bool lossy); public: // implementation - virtual void decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen) = 0; + virtual void decompress(const uint8_t *src, uint32_t complen, uint8_t *dest, uint32_t destlen) = 0; }; @@ -119,18 +119,18 @@ private: chd_codec_type m_type; bool m_lossy; const char * m_name; - chd_compressor * (*m_construct_compressor)(chd_file &, UINT32, bool); - chd_decompressor * (*m_construct_decompressor)(chd_file &, UINT32, bool); + chd_compressor * (*m_construct_compressor)(chd_file &, uint32_t, bool); + chd_decompressor * (*m_construct_decompressor)(chd_file &, uint32_t, bool); }; // internal helper functions static const codec_entry *find_in_list(chd_codec_type type); template - static chd_compressor *construct_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy) { return new _CompressorClass(chd, hunkbytes, lossy); } + static chd_compressor *construct_compressor(chd_file &chd, uint32_t hunkbytes, bool lossy) { return new _CompressorClass(chd, hunkbytes, lossy); } template - static chd_decompressor *construct_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy) { return new _DecompressorClass(chd, hunkbytes, lossy); } + static chd_decompressor *construct_decompressor(chd_file &chd, uint32_t hunkbytes, bool lossy) { return new _DecompressorClass(chd, hunkbytes, lossy); } // the static list static const codec_entry s_codec_list[]; @@ -148,16 +148,16 @@ public: ~chd_compressor_group(); // find the best compressor - INT8 find_best_compressor(const UINT8 *src, UINT8 *compressed, UINT32 &complen); + int8_t find_best_compressor(const uint8_t *src, uint8_t *compressed, uint32_t &complen); private: // internal state - UINT32 m_hunkbytes; // number of bytes in a hunk + uint32_t m_hunkbytes; // number of bytes in a hunk chd_compressor * m_compressor[4]; // array of active codecs - std::vector m_compress_test; // test buffer for compression + std::vector m_compress_test; // test buffer for compression #if CHDCODEC_VERIFY_COMPRESSION chd_decompressor * m_decompressor[4]; // array of active codecs - std::vector m_decompressed; // verification buffer + std::vector m_decompressed; // verification buffer #endif }; diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp index 699ef91027b..76b788174ab 100644 --- a/src/lib/util/corefile.cpp +++ b/src/lib/util/corefile.cpp @@ -1221,7 +1221,7 @@ osd_file::error core_file::load(std::string const &filename, void **data, std::u return osd_file::error::NONE; } -osd_file::error core_file::load(std::string const &filename, std::vector &data) +osd_file::error core_file::load(std::string const &filename, std::vector &data) { ptr file; @@ -1320,7 +1320,7 @@ bool core_filename_ends_with(const std::string &filename, const std::string &ext // work backwards checking for a match while (matches && extlen > 0 && namelen > 0) { - if (tolower((UINT8)filename[--namelen]) != tolower((UINT8)extension[--extlen])) + if (tolower((uint8_t)filename[--namelen]) != tolower((uint8_t)extension[--extlen])) matches = false; } diff --git a/src/lib/util/corefile.h b/src/lib/util/corefile.h index 70b966c394c..2c4a5da8217 100644 --- a/src/lib/util/corefile.h +++ b/src/lib/util/corefile.h @@ -101,7 +101,7 @@ public: // open a file with the specified filename, read it into memory, and return a pointer static osd_file::error load(std::string const &filename, void **data, std::uint32_t &length); - static osd_file::error load(std::string const &filename, std::vector &data); + static osd_file::error load(std::string const &filename, std::vector &data); // ----- file write ----- diff --git a/src/lib/util/corestr.cpp b/src/lib/util/corestr.cpp index 7daad5cc0cb..ed9c8e77b0a 100644 --- a/src/lib/util/corestr.cpp +++ b/src/lib/util/corestr.cpp @@ -22,8 +22,8 @@ int core_stricmp(const char *s1, const char *s2) { for (;;) { - int c1 = tolower((UINT8)*s1++); - int c2 = tolower((UINT8)*s2++); + int c1 = tolower((uint8_t)*s1++); + int c2 = tolower((uint8_t)*s2++); if (c1 == 0 || c1 != c2) return c1 - c2; } @@ -39,8 +39,8 @@ int core_strnicmp(const char *s1, const char *s2, size_t n) size_t i; for (i = 0; i < n; i++) { - int c1 = tolower((UINT8)*s1++); - int c2 = tolower((UINT8)*s2++); + int c1 = tolower((uint8_t)*s1++); + int c2 = tolower((uint8_t)*s2++); if (c1 == 0 || c1 != c2) return c1 - c2; } @@ -166,7 +166,7 @@ std::string strtrimspace(std::string& str) int start = 0; for (auto & elem : str) { - if (!isspace(UINT8(elem))) break; + if (!isspace(uint8_t(elem))) break; start++; } int end = str.length(); @@ -174,7 +174,7 @@ std::string strtrimspace(std::string& str) { for (size_t i = str.length() - 1; i > 0; i--) { - if (!isspace(UINT8(str[i]))) break; + if (!isspace(uint8_t(str[i]))) break; end--; } } diff --git a/src/lib/util/coreutil.cpp b/src/lib/util/coreutil.cpp index 90bcab9ab1a..8ff9585d476 100644 --- a/src/lib/util/coreutil.cpp +++ b/src/lib/util/coreutil.cpp @@ -27,9 +27,9 @@ int bcd_adjust(int value) } -UINT32 dec_2_bcd(UINT32 a) +uint32_t dec_2_bcd(uint32_t a) { - UINT32 result = 0; + uint32_t result = 0; int shift = 0; while (a != 0) @@ -42,10 +42,10 @@ UINT32 dec_2_bcd(UINT32 a) } -UINT32 bcd_2_dec(UINT32 a) +uint32_t bcd_2_dec(uint32_t a) { - UINT32 result = 0; - UINT32 scale = 1; + uint32_t result = 0; + uint32_t scale = 1; while (a != 0) { @@ -106,19 +106,19 @@ int gregorian_days_in_month(int month, int year) void rand_memory(void *memory, size_t length) { - static UINT32 seed = 0; - UINT8 *bytes = (UINT8 *) memory; + static uint32_t seed = 0; + uint8_t *bytes = (uint8_t *) memory; size_t i; for (i = 0; i < length; i++) { seed = seed * 214013 + 2531011; - bytes[i] = (UINT8) (seed >> 16); + bytes[i] = (uint8_t) (seed >> 16); } } -UINT32 core_crc32(UINT32 crc, const UINT8 *buf, UINT32 len) +uint32_t core_crc32(uint32_t crc, const uint8_t *buf, uint32_t len) { return crc32(crc, buf, len); } diff --git a/src/lib/util/coreutil.h b/src/lib/util/coreutil.h index 839e72686ea..167f696970e 100644 --- a/src/lib/util/coreutil.h +++ b/src/lib/util/coreutil.h @@ -21,8 +21,8 @@ ***************************************************************************/ int bcd_adjust(int value); -UINT32 dec_2_bcd(UINT32 a); -UINT32 bcd_2_dec(UINT32 a); +uint32_t dec_2_bcd(uint32_t a); +uint32_t bcd_2_dec(uint32_t a); /*************************************************************************** @@ -39,6 +39,6 @@ int gregorian_days_in_month(int month, int year); void rand_memory(void *memory, size_t length); -UINT32 core_crc32(UINT32 crc, const UINT8 *buf, UINT32 len); +uint32_t core_crc32(uint32_t crc, const uint8_t *buf, uint32_t len); #endif /* __COREUTIL_H__ */ diff --git a/src/lib/util/flac.cpp b/src/lib/util/flac.cpp index 46d349c3452..cd84dfbca13 100644 --- a/src/lib/util/flac.cpp +++ b/src/lib/util/flac.cpp @@ -28,7 +28,7 @@ flac_encoder::flac_encoder() } -flac_encoder::flac_encoder(void *buffer, UINT32 buflength) +flac_encoder::flac_encoder(void *buffer, uint32_t buflength) { init_common(); reset(buffer, buflength); @@ -86,7 +86,7 @@ bool flac_encoder::reset() // reset - reset state with new memory parameters //------------------------------------------------- -bool flac_encoder::reset(void *buffer, UINT32 buflength) +bool flac_encoder::reset(void *buffer, uint32_t buflength) { // configure the output m_compressed_start = reinterpret_cast(buffer); @@ -115,24 +115,24 @@ bool flac_encoder::reset(util::core_file &file) // interleaved samples //------------------------------------------------- -bool flac_encoder::encode_interleaved(const INT16 *samples, UINT32 samples_per_channel, bool swap_endian) +bool flac_encoder::encode_interleaved(const int16_t *samples, uint32_t samples_per_channel, bool swap_endian) { int shift = swap_endian ? 8 : 0; // loop over source samples int num_channels = FLAC__stream_encoder_get_channels(m_encoder); - UINT32 srcindex = 0; + uint32_t srcindex = 0; while (samples_per_channel != 0) { // process in batches of 2k samples FLAC__int32 converted_buffer[2048]; FLAC__int32 *dest = converted_buffer; - UINT32 cur_samples = (std::min)(ARRAY_LENGTH(converted_buffer) / num_channels, samples_per_channel); + uint32_t cur_samples = (std::min)(ARRAY_LENGTH(converted_buffer) / num_channels, samples_per_channel); // convert a buffers' worth - for (UINT32 sampnum = 0; sampnum < cur_samples; sampnum++) + for (uint32_t sampnum = 0; sampnum < cur_samples; sampnum++) for (int channel = 0; channel < num_channels; channel++, srcindex++) - *dest++ = INT16((UINT16(samples[srcindex]) << shift) | (UINT16(samples[srcindex]) >> shift)); + *dest++ = int16_t((uint16_t(samples[srcindex]) << shift) | (uint16_t(samples[srcindex]) >> shift)); // process this batch if (!FLAC__stream_encoder_process_interleaved(m_encoder, converted_buffer, cur_samples)) @@ -148,24 +148,24 @@ bool flac_encoder::encode_interleaved(const INT16 *samples, UINT32 samples_per_c // sample streams //------------------------------------------------- -bool flac_encoder::encode(INT16 *const *samples, UINT32 samples_per_channel, bool swap_endian) +bool flac_encoder::encode(int16_t *const *samples, uint32_t samples_per_channel, bool swap_endian) { int shift = swap_endian ? 8 : 0; // loop over source samples int num_channels = FLAC__stream_encoder_get_channels(m_encoder); - UINT32 srcindex = 0; + uint32_t srcindex = 0; while (samples_per_channel != 0) { // process in batches of 2k samples FLAC__int32 converted_buffer[2048]; FLAC__int32 *dest = converted_buffer; - UINT32 cur_samples = (std::min)(ARRAY_LENGTH(converted_buffer) / num_channels, samples_per_channel); + uint32_t cur_samples = (std::min)(ARRAY_LENGTH(converted_buffer) / num_channels, samples_per_channel); // convert a buffers' worth - for (UINT32 sampnum = 0; sampnum < cur_samples; sampnum++, srcindex++) + for (uint32_t sampnum = 0; sampnum < cur_samples; sampnum++, srcindex++) for (int channel = 0; channel < num_channels; channel++) - *dest++ = INT16((UINT16(samples[channel][srcindex]) << shift) | (UINT16(samples[channel][srcindex]) >> shift)); + *dest++ = int16_t((uint16_t(samples[channel][srcindex]) << shift) | (uint16_t(samples[channel][srcindex]) >> shift)); // process this batch if (!FLAC__stream_encoder_process_interleaved(m_encoder, converted_buffer, cur_samples)) @@ -181,7 +181,7 @@ bool flac_encoder::encode(INT16 *const *samples, UINT32 samples_per_channel, boo // stream //------------------------------------------------- -UINT32 flac_encoder::finish() +uint32_t flac_encoder::finish() { // process the data and return the amount written FLAC__stream_encoder_finish(m_encoder); @@ -297,7 +297,7 @@ flac_decoder::flac_decoder() // flac_decoder - constructor //------------------------------------------------- -flac_decoder::flac_decoder(const void *buffer, UINT32 length, const void *buffer2, UINT32 length2) +flac_decoder::flac_decoder(const void *buffer, uint32_t length, const void *buffer2, uint32_t length2) : m_decoder(FLAC__stream_decoder_new()), m_file(nullptr), m_compressed_offset(0), @@ -363,7 +363,7 @@ bool flac_decoder::reset() // reset - reset state with new memory parameters //------------------------------------------------- -bool flac_decoder::reset(const void *buffer, UINT32 length, const void *buffer2, UINT32 length2) +bool flac_decoder::reset(const void *buffer, uint32_t length, const void *buffer2, uint32_t length2) { m_file = nullptr; m_compressed_start = reinterpret_cast(buffer); @@ -379,10 +379,10 @@ bool flac_decoder::reset(const void *buffer, UINT32 length, const void *buffer2, // and a custom-generated header //------------------------------------------------- -bool flac_decoder::reset(UINT32 sample_rate, UINT8 num_channels, UINT32 block_size, const void *buffer, UINT32 length) +bool flac_decoder::reset(uint32_t sample_rate, uint8_t num_channels, uint32_t block_size, const void *buffer, uint32_t length) { // modify the template header with our parameters - static const UINT8 s_header_template[0x2a] = + static const uint8_t s_header_template[0x2a] = { 0x66, 0x4C, 0x61, 0x43, // +00: 'fLaC' stream header 0x80, // +04: metadata block type 0 (STREAMINFO), @@ -436,7 +436,7 @@ bool flac_decoder::reset(util::core_file &file) // sound stream //------------------------------------------------- -bool flac_decoder::decode_interleaved(INT16 *samples, UINT32 num_samples, bool swap_endian) +bool flac_decoder::decode_interleaved(int16_t *samples, uint32_t num_samples, bool swap_endian) { // configure the uncompressed buffer memset(m_uncompressed_start, 0, sizeof(m_uncompressed_start)); @@ -458,7 +458,7 @@ bool flac_decoder::decode_interleaved(INT16 *samples, UINT32 num_samples, bool s // data streams //------------------------------------------------- -bool flac_decoder::decode(INT16 **samples, UINT32 num_samples, bool swap_endian) +bool flac_decoder::decode(int16_t **samples, uint32_t num_samples, bool swap_endian) { // make sure we don't have too many channels int chans = channels(); @@ -485,7 +485,7 @@ bool flac_decoder::decode(INT16 **samples, UINT32 num_samples, bool swap_endian) // finish - finish up the decode //------------------------------------------------- -UINT32 flac_decoder::finish() +uint32_t flac_decoder::finish() { // get the final decoding position and move forward FLAC__uint64 position = 0; @@ -513,7 +513,7 @@ FLAC__StreamDecoderReadStatus flac_decoder::read_callback_static(const FLAC__Str FLAC__StreamDecoderReadStatus flac_decoder::read_callback(FLAC__byte buffer[], size_t *bytes) { - UINT32 expected = *bytes; + uint32_t expected = *bytes; // if a file, just read if (m_file != nullptr) @@ -523,10 +523,10 @@ FLAC__StreamDecoderReadStatus flac_decoder::read_callback(FLAC__byte buffer[], s else { // copy from primary buffer first - UINT32 outputpos = 0; + uint32_t outputpos = 0; if (outputpos < *bytes && m_compressed_offset < m_compressed_length) { - UINT32 bytes_to_copy = (std::min)(*bytes - outputpos, m_compressed_length - m_compressed_offset); + uint32_t bytes_to_copy = (std::min)(*bytes - outputpos, m_compressed_length - m_compressed_offset); memcpy(&buffer[outputpos], m_compressed_start + m_compressed_offset, bytes_to_copy); outputpos += bytes_to_copy; m_compressed_offset += bytes_to_copy; @@ -535,7 +535,7 @@ FLAC__StreamDecoderReadStatus flac_decoder::read_callback(FLAC__byte buffer[], s // once we're out of that, copy from the secondary buffer if (outputpos < *bytes && m_compressed_offset < m_compressed_length + m_compressed2_length) { - UINT32 bytes_to_copy = (std::min)(*bytes - outputpos, m_compressed2_length - (m_compressed_offset - m_compressed_length)); + uint32_t bytes_to_copy = (std::min)(*bytes - outputpos, m_compressed2_length - (m_compressed_offset - m_compressed_length)); memcpy(&buffer[outputpos], m_compressed2_start + m_compressed_offset - m_compressed_length, bytes_to_copy); outputpos += bytes_to_copy; m_compressed_offset += bytes_to_copy; @@ -597,10 +597,10 @@ FLAC__StreamDecoderWriteStatus flac_decoder::write_callback(const ::FLAC__Frame int blocksize = frame->header.blocksize; if (m_uncompressed_start[1] == nullptr) { - INT16 *dest = m_uncompressed_start[0] + m_uncompressed_offset * frame->header.channels; + int16_t *dest = m_uncompressed_start[0] + m_uncompressed_offset * frame->header.channels; for (int sampnum = 0; sampnum < blocksize && m_uncompressed_offset < m_uncompressed_length; sampnum++, m_uncompressed_offset++) for (int chan = 0; chan < frame->header.channels; chan++) - *dest++ = INT16((UINT16(buffer[chan][sampnum]) << shift) | (UINT16(buffer[chan][sampnum]) >> shift)); + *dest++ = int16_t((uint16_t(buffer[chan][sampnum]) << shift) | (uint16_t(buffer[chan][sampnum]) >> shift)); } // non-interleaved case @@ -609,7 +609,7 @@ FLAC__StreamDecoderWriteStatus flac_decoder::write_callback(const ::FLAC__Frame for (int sampnum = 0; sampnum < blocksize && m_uncompressed_offset < m_uncompressed_length; sampnum++, m_uncompressed_offset++) for (int chan = 0; chan < frame->header.channels; chan++) if (m_uncompressed_start[chan] != nullptr) - m_uncompressed_start[chan][m_uncompressed_offset] = INT16((UINT16(buffer[chan][sampnum]) << shift) | (UINT16(buffer[chan][sampnum]) >> shift)); + m_uncompressed_start[chan][m_uncompressed_offset] = int16_t((uint16_t(buffer[chan][sampnum]) << shift) | (uint16_t(buffer[chan][sampnum]) >> shift)); } return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } diff --git a/src/lib/util/flac.h b/src/lib/util/flac.h index 2bb41964a43..f5951945b07 100644 --- a/src/lib/util/flac.h +++ b/src/lib/util/flac.h @@ -30,14 +30,14 @@ class flac_encoder public: // construction/destruction flac_encoder(); - flac_encoder(void *buffer, UINT32 buflength); + flac_encoder(void *buffer, uint32_t buflength); flac_encoder(util::core_file &file); ~flac_encoder(); // configuration - void set_sample_rate(UINT32 sample_rate) { m_sample_rate = sample_rate; } - void set_num_channels(UINT8 num_channels) { m_channels = num_channels; } - void set_block_size(UINT32 block_size) { m_block_size = block_size; } + void set_sample_rate(uint32_t sample_rate) { m_sample_rate = sample_rate; } + void set_num_channels(uint8_t num_channels) { m_channels = num_channels; } + void set_block_size(uint32_t block_size) { m_block_size = block_size; } void set_strip_metadata(bool strip) { m_strip_metadata = strip; } // getters (valid after reset) @@ -46,15 +46,15 @@ public: // reset bool reset(); - bool reset(void *buffer, UINT32 buflength); + bool reset(void *buffer, uint32_t buflength); bool reset(util::core_file &file); // encode a buffer - bool encode_interleaved(const INT16 *samples, UINT32 samples_per_channel, bool swap_endian = false); - bool encode(INT16 *const *samples, UINT32 samples_per_channel, bool swap_endian = false); + bool encode_interleaved(const int16_t *samples, uint32_t samples_per_channel, bool swap_endian = false); + bool encode(int16_t *const *samples, uint32_t samples_per_channel, bool swap_endian = false); // finish up - UINT32 finish(); + uint32_t finish(); private: // internal helpers @@ -65,18 +65,18 @@ private: // internal state FLAC__StreamEncoder * m_encoder; // actual encoder util::core_file * m_file; // output file - UINT32 m_compressed_offset; // current offset with the compressed stream + uint32_t m_compressed_offset; // current offset with the compressed stream FLAC__byte * m_compressed_start; // start of compressed data - UINT32 m_compressed_length; // length of the compressed stream + uint32_t m_compressed_length; // length of the compressed stream // parameters - UINT32 m_sample_rate; // sample rate - UINT8 m_channels; // number of channels - UINT32 m_block_size; // block size + uint32_t m_sample_rate; // sample rate + uint8_t m_channels; // number of channels + uint32_t m_block_size; // block size // header stripping bool m_strip_metadata; // strip the metadata? - UINT32 m_ignore_bytes; // how many bytes to ignore when writing + uint32_t m_ignore_bytes; // how many bytes to ignore when writing bool m_found_audio; // have we hit the audio yet? }; @@ -88,30 +88,30 @@ class flac_decoder public: // construction/destruction flac_decoder(); - flac_decoder(const void *buffer, UINT32 length, const void *buffer2 = nullptr, UINT32 length2 = 0); + flac_decoder(const void *buffer, uint32_t length, const void *buffer2 = nullptr, uint32_t length2 = 0); flac_decoder(util::core_file &file); ~flac_decoder(); // getters (valid after reset) - UINT32 sample_rate() const { return m_sample_rate; } - UINT8 channels() const { return m_channels; } - UINT8 bits_per_sample() const { return m_bits_per_sample; } - UINT32 total_samples() const { return FLAC__stream_decoder_get_total_samples(m_decoder); } + uint32_t sample_rate() const { return m_sample_rate; } + uint8_t channels() const { return m_channels; } + uint8_t bits_per_sample() const { return m_bits_per_sample; } + uint32_t total_samples() const { return FLAC__stream_decoder_get_total_samples(m_decoder); } FLAC__StreamDecoderState state() const { return FLAC__stream_decoder_get_state(m_decoder); } const char *state_string() const { return FLAC__stream_decoder_get_resolved_state_string(m_decoder); } // reset bool reset(); - bool reset(const void *buffer, UINT32 length, const void *buffer2 = nullptr, UINT32 length2 = 0); - bool reset(UINT32 sample_rate, UINT8 num_channels, UINT32 block_size, const void *buffer, UINT32 length); + bool reset(const void *buffer, uint32_t length, const void *buffer2 = nullptr, uint32_t length2 = 0); + bool reset(uint32_t sample_rate, uint8_t num_channels, uint32_t block_size, const void *buffer, uint32_t length); bool reset(util::core_file &file); // decode to a buffer; num_samples must be a multiple of the block size - bool decode_interleaved(INT16 *samples, UINT32 num_samples, bool swap_endian = false); - bool decode(INT16 **samples, UINT32 num_samples, bool swap_endian = false); + bool decode_interleaved(int16_t *samples, uint32_t num_samples, bool swap_endian = false); + bool decode(int16_t **samples, uint32_t num_samples, bool swap_endian = false); // finish up - UINT32 finish(); + uint32_t finish(); private: // internal helpers @@ -126,19 +126,19 @@ private: // output state FLAC__StreamDecoder * m_decoder; // actual encoder util::core_file * m_file; // output file - UINT32 m_sample_rate; // decoded sample rate - UINT8 m_channels; // decoded number of channels - UINT8 m_bits_per_sample; // decoded bits per sample - UINT32 m_compressed_offset; // current offset in compressed data + uint32_t m_sample_rate; // decoded sample rate + uint8_t m_channels; // decoded number of channels + uint8_t m_bits_per_sample; // decoded bits per sample + uint32_t m_compressed_offset; // current offset in compressed data const FLAC__byte * m_compressed_start; // start of compressed data - UINT32 m_compressed_length; // length of compressed data + uint32_t m_compressed_length; // length of compressed data const FLAC__byte * m_compressed2_start; // start of compressed data - UINT32 m_compressed2_length; // length of compressed data - INT16 * m_uncompressed_start[8];// pointer to start of uncompressed data (up to 8 streams) - UINT32 m_uncompressed_offset; // current position in uncompressed data - UINT32 m_uncompressed_length; // length of uncompressed data + uint32_t m_compressed2_length; // length of compressed data + int16_t * m_uncompressed_start[8];// pointer to start of uncompressed data (up to 8 streams) + uint32_t m_uncompressed_offset; // current position in uncompressed data + uint32_t m_uncompressed_length; // length of uncompressed data bool m_uncompressed_swap; // swap uncompressed sample data - UINT8 m_custom_header[0x2a]; // custom header + uint8_t m_custom_header[0x2a]; // custom header }; diff --git a/src/lib/util/harddisk.cpp b/src/lib/util/harddisk.cpp index 6bb121f36b2..31c6a36ed28 100644 --- a/src/lib/util/harddisk.cpp +++ b/src/lib/util/harddisk.cpp @@ -119,7 +119,7 @@ hard_disk_info *hard_disk_get_info(hard_disk_file *file) -------------------------------------------------*/ /** - * @fn UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer) + * @fn uint32_t hard_disk_read(hard_disk_file *file, uint32_t lbasector, void *buffer) * * @brief Hard disk read. * @@ -127,10 +127,10 @@ hard_disk_info *hard_disk_get_info(hard_disk_file *file) * @param lbasector The lbasector. * @param [in,out] buffer If non-null, the buffer. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer) +uint32_t hard_disk_read(hard_disk_file *file, uint32_t lbasector, void *buffer) { chd_error err = file->chd->read_units(lbasector, buffer); return (err == CHDERR_NONE); @@ -143,7 +143,7 @@ UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer) -------------------------------------------------*/ /** - * @fn UINT32 hard_disk_write(hard_disk_file *file, UINT32 lbasector, const void *buffer) + * @fn uint32_t hard_disk_write(hard_disk_file *file, uint32_t lbasector, const void *buffer) * * @brief Hard disk write. * @@ -151,10 +151,10 @@ UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer) * @param lbasector The lbasector. * @param buffer The buffer. * - * @return An UINT32. + * @return An uint32_t. */ -UINT32 hard_disk_write(hard_disk_file *file, UINT32 lbasector, const void *buffer) +uint32_t hard_disk_write(hard_disk_file *file, uint32_t lbasector, const void *buffer) { chd_error err = file->chd->write_units(lbasector, buffer); return (err == CHDERR_NONE); diff --git a/src/lib/util/harddisk.h b/src/lib/util/harddisk.h index 5b32c905d94..727f9a3fd07 100644 --- a/src/lib/util/harddisk.h +++ b/src/lib/util/harddisk.h @@ -25,10 +25,10 @@ struct hard_disk_file; struct hard_disk_info { - UINT32 cylinders; - UINT32 heads; - UINT32 sectors; - UINT32 sectorbytes; + uint32_t cylinders; + uint32_t heads; + uint32_t sectors; + uint32_t sectorbytes; }; @@ -43,7 +43,7 @@ void hard_disk_close(hard_disk_file *file); chd_file *hard_disk_get_chd(hard_disk_file *file); hard_disk_info *hard_disk_get_info(hard_disk_file *file); -UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer); -UINT32 hard_disk_write(hard_disk_file *file, UINT32 lbasector, const void *buffer); +uint32_t hard_disk_read(hard_disk_file *file, uint32_t lbasector, void *buffer); +uint32_t hard_disk_write(hard_disk_file *file, uint32_t lbasector, const void *buffer); #endif /* __HARDDISK_H__ */ diff --git a/src/lib/util/hash.cpp b/src/lib/util/hash.cpp index 9ba632240dc..4593ad181a4 100644 --- a/src/lib/util/hash.cpp +++ b/src/lib/util/hash.cpp @@ -362,7 +362,7 @@ void hash_collection::begin(const char *types) // buffer - add the given buffer to the hash //------------------------------------------------- -void hash_collection::buffer(const UINT8 *data, UINT32 length) +void hash_collection::buffer(const uint8_t *data, uint32_t length) { assert(m_creator != nullptr); diff --git a/src/lib/util/hash.h b/src/lib/util/hash.h index ec628a949f2..23c8702958e 100644 --- a/src/lib/util/hash.h +++ b/src/lib/util/hash.h @@ -75,8 +75,8 @@ public: bool remove(char type); // CRC-specific helpers - bool crc(UINT32 &result) const { result = m_crc32; return m_has_crc32; } - void add_crc(UINT32 crc) { m_crc32 = crc; m_has_crc32 = true; } + bool crc(uint32_t &result) const { result = m_crc32; return m_has_crc32; } + void add_crc(uint32_t crc) { m_crc32 = crc; m_has_crc32 = true; } // SHA1-specific helpers bool sha1(sha1_t &result) const { result = m_sha1; return m_has_sha1; } @@ -90,9 +90,9 @@ public: // creation void begin(const char *types = nullptr); - void buffer(const UINT8 *data, UINT32 length); + void buffer(const uint8_t *data, uint32_t length); void end(); - void compute(const UINT8 *data, UINT32 length, const char *types = nullptr) { begin(types); buffer(data, length); end(); } + void compute(const uint8_t *data, uint32_t length, const char *types = nullptr) { begin(types); buffer(data, length); end(); } private: // internal helpers diff --git a/src/lib/util/hashing.cpp b/src/lib/util/hashing.cpp index dd6b9847f15..448cdc5d6ec 100644 --- a/src/lib/util/hashing.cpp +++ b/src/lib/util/hashing.cpp @@ -184,7 +184,7 @@ std::string crc32_t::as_string() const // the currently-accumulated value //------------------------------------------------- -void crc32_creator::append(const void *data, UINT32 length) +void crc32_creator::append(const void *data, uint32_t length) { m_accum.m_raw = crc32(m_accum, reinterpret_cast(data), length); } @@ -236,7 +236,7 @@ std::string crc16_t::as_string() const } /** - * @fn void crc16_creator::append(const void *data, UINT32 length) + * @fn void crc16_creator::append(const void *data, uint32_t length) * * @brief ------------------------------------------------- * append - hash a block of data, appending to the currently-accumulated value @@ -246,9 +246,9 @@ std::string crc16_t::as_string() const * @param length The length. */ -void crc16_creator::append(const void *data, UINT32 length) +void crc16_creator::append(const void *data, uint32_t length) { - static const UINT16 s_table[256] = + static const uint16_t s_table[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, @@ -284,10 +284,10 @@ void crc16_creator::append(const void *data, UINT32 length) 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; - const UINT8 *src = reinterpret_cast(data); + const uint8_t *src = reinterpret_cast(data); // fetch the current value into a local and rip through the source data - UINT16 crc = m_accum.m_raw; + uint16_t crc = m_accum.m_raw; while (length-- != 0) crc = (crc << 8) ^ s_table[(crc >> 8) ^ *src++]; m_accum.m_raw = crc; diff --git a/src/lib/util/hashing.h b/src/lib/util/hashing.h index 8b58d3afc8b..906bad047b4 100644 --- a/src/lib/util/hashing.h +++ b/src/lib/util/hashing.h @@ -33,10 +33,10 @@ struct sha1_t { bool operator==(const sha1_t &rhs) const { return memcmp(m_raw, rhs.m_raw, sizeof(m_raw)) == 0; } bool operator!=(const sha1_t &rhs) const { return memcmp(m_raw, rhs.m_raw, sizeof(m_raw)) != 0; } - operator UINT8 *() { return m_raw; } + operator uint8_t *() { return m_raw; } bool from_string(const char *string, int length = -1); std::string as_string() const; - UINT8 m_raw[20]; + uint8_t m_raw[20]; static const sha1_t null; }; @@ -51,7 +51,7 @@ public: void reset() { sha1_init(&m_context); } // append data - void append(const void *data, UINT32 length) { sha1_update(&m_context, length, reinterpret_cast(data)); } + void append(const void *data, uint32_t length) { sha1_update(&m_context, length, reinterpret_cast(data)); } // finalize and compute the final digest sha1_t finish() @@ -63,7 +63,7 @@ public: } // static wrapper to just get the digest from a block - static sha1_t simple(const void *data, UINT32 length) + static sha1_t simple(const void *data, uint32_t length) { sha1_creator creator; creator.append(data, length); @@ -84,10 +84,10 @@ struct md5_t { bool operator==(const md5_t &rhs) const { return memcmp(m_raw, rhs.m_raw, sizeof(m_raw)) == 0; } bool operator!=(const md5_t &rhs) const { return memcmp(m_raw, rhs.m_raw, sizeof(m_raw)) != 0; } - operator UINT8 *() { return m_raw; } + operator uint8_t *() { return m_raw; } bool from_string(const char *string, int length = -1); std::string as_string() const; - UINT8 m_raw[16]; + uint8_t m_raw[16]; static const md5_t null; }; @@ -102,7 +102,7 @@ public: void reset() { MD5Init(&m_context); } // append data - void append(const void *data, UINT32 length) { MD5Update(&m_context, reinterpret_cast(data), length); } + void append(const void *data, uint32_t length) { MD5Update(&m_context, reinterpret_cast(data), length); } // finalize and compute the final digest md5_t finish() @@ -113,7 +113,7 @@ public: } // static wrapper to just get the digest from a block - static md5_t simple(const void *data, UINT32 length) + static md5_t simple(const void *data, uint32_t length) { md5_creator creator; creator.append(data, length); @@ -134,11 +134,11 @@ struct crc32_t { bool operator==(const crc32_t &rhs) const { return m_raw == rhs.m_raw; } bool operator!=(const crc32_t &rhs) const { return m_raw != rhs.m_raw; } - crc32_t &operator=(const UINT32 crc) { m_raw = crc; return *this; } - operator UINT32() const { return m_raw; } + crc32_t &operator=(const uint32_t crc) { m_raw = crc; return *this; } + operator uint32_t() const { return m_raw; } bool from_string(const char *string, int length = -1); std::string as_string() const; - UINT32 m_raw; + uint32_t m_raw; static const crc32_t null; }; @@ -153,13 +153,13 @@ public: void reset() { m_accum.m_raw = 0; } // append data - void append(const void *data, UINT32 length); + void append(const void *data, uint32_t length); // finalize and compute the final digest crc32_t finish() { return m_accum; } // static wrapper to just get the digest from a block - static crc32_t simple(const void *data, UINT32 length) + static crc32_t simple(const void *data, uint32_t length) { crc32_creator creator; creator.append(data, length); @@ -180,11 +180,11 @@ struct crc16_t { bool operator==(const crc16_t &rhs) const { return m_raw == rhs.m_raw; } bool operator!=(const crc16_t &rhs) const { return m_raw != rhs.m_raw; } - crc16_t &operator=(const UINT16 crc) { m_raw = crc; return *this; } - operator UINT16() const { return m_raw; } + crc16_t &operator=(const uint16_t crc) { m_raw = crc; return *this; } + operator uint16_t() const { return m_raw; } bool from_string(const char *string, int length = -1); std::string as_string() const; - UINT16 m_raw; + uint16_t m_raw; static const crc16_t null; }; @@ -199,13 +199,13 @@ public: void reset() { m_accum.m_raw = 0xffff; } // append data - void append(const void *data, UINT32 length); + void append(const void *data, uint32_t length); // finalize and compute the final digest crc16_t finish() { return m_accum; } // static wrapper to just get the digest from a block - static crc16_t simple(const void *data, UINT32 length) + static crc16_t simple(const void *data, uint32_t length) { crc16_creator creator; creator.append(data, length); diff --git a/src/lib/util/huffman.cpp b/src/lib/util/huffman.cpp index c38d78853fb..d3a73315ea9 100644 --- a/src/lib/util/huffman.cpp +++ b/src/lib/util/huffman.cpp @@ -121,7 +121,7 @@ // decoding context //------------------------------------------------- -huffman_context_base::huffman_context_base(int numcodes, int maxbits, lookup_value *lookup, UINT32 *histo, node_t *nodes) +huffman_context_base::huffman_context_base(int numcodes, int maxbits, lookup_value *lookup, uint32_t *histo, node_t *nodes) : m_numcodes(numcodes), m_maxbits(maxbits), m_prevdata(0), @@ -268,8 +268,8 @@ huffman_error huffman_context_base::import_tree_huffman(bitstream_in &bitbuf) smallhuff.build_lookup_table(); // determine the maximum length of an RLE count - UINT32 temp = m_numcodes - 9; - UINT8 rlefullbits = 0; + uint32_t temp = m_numcodes - 9; + uint8_t rlefullbits = 0; while (temp != 0) temp >>= 1, rlefullbits++; @@ -316,10 +316,10 @@ huffman_error huffman_context_base::import_tree_huffman(bitstream_in &bitbuf) huffman_error huffman_context_base::export_tree_huffman(bitstream_out &bitbuf) { // first RLE compress the lengths of all the nodes - std::vector rle_data(m_numcodes); - UINT8 *dest = &rle_data[0]; - std::vector rle_lengths(m_numcodes/3); - UINT16 *lengths = &rle_lengths[0]; + std::vector rle_data(m_numcodes); + uint8_t *dest = &rle_data[0]; + std::vector rle_lengths(m_numcodes/3); + uint16_t *lengths = &rle_lengths[0]; int last = ~0; int repcount = 0; @@ -387,17 +387,17 @@ huffman_error huffman_context_base::export_tree_huffman(bitstream_out &bitbuf) bitbuf.write(7, 3); // determine the maximum length of an RLE count - UINT32 temp = m_numcodes - 9; - UINT8 rlefullbits = 0; + uint32_t temp = m_numcodes - 9; + uint8_t rlefullbits = 0; while (temp != 0) temp >>= 1, rlefullbits++; // now encode the RLE data lengths = &rle_lengths[0]; - for (UINT8 *src = &rle_data[0]; src < dest; src++) + for (uint8_t *src = &rle_data[0]; src < dest; src++) { // encode the data - UINT8 data = *src; + uint8_t data = *src; smallhuff.encode_one(bitbuf, data); // if this is an RLE token, encode the length following @@ -424,17 +424,17 @@ huffman_error huffman_context_base::export_tree_huffman(bitstream_out &bitbuf) huffman_error huffman_context_base::compute_tree_from_histo() { // compute the number of data items in the histogram - UINT32 sdatacount = 0; + uint32_t sdatacount = 0; for (int i = 0; i < m_numcodes; i++) sdatacount += m_datahisto[i]; // binary search to achieve the optimum encoding - UINT32 lowerweight = 0; - UINT32 upperweight = sdatacount * 2; + uint32_t lowerweight = 0; + uint32_t upperweight = sdatacount * 2; while (1) { // build a tree using the current weight - UINT32 curweight = (upperweight + lowerweight) / 2; + uint32_t curweight = (upperweight + lowerweight) / 2; int curmaxbits = build_tree(sdatacount, curweight); // apply binary search here @@ -520,7 +520,7 @@ int CLIB_DECL huffman_context_base::tree_node_compare(const void *item1, const v // data distribution //------------------------------------------------- -int huffman_context_base::build_tree(UINT32 totaldata, UINT32 totalweight) +int huffman_context_base::build_tree(uint32_t totaldata, uint32_t totalweight) { // make a list of all non-zero nodes std::vector list(m_numcodes * 2); @@ -534,7 +534,7 @@ int huffman_context_base::build_tree(UINT32 totaldata, UINT32 totalweight) m_huffnode[curcode].m_bits = curcode; // scale the weight by the current effective length, ensuring we don't go to 0 - m_huffnode[curcode].m_weight = UINT64(m_datahisto[curcode]) * UINT64(totalweight) / UINT64(totaldata); + m_huffnode[curcode].m_weight = uint64_t(m_datahisto[curcode]) * uint64_t(totalweight) / uint64_t(totaldata); if (m_huffnode[curcode].m_weight == 0) m_huffnode[curcode].m_weight = 1; } @@ -613,7 +613,7 @@ int huffman_context_base::build_tree(UINT32 totaldata, UINT32 totalweight) huffman_error huffman_context_base::assign_canonical_codes() { // build up a histogram of bit lengths - UINT32 bithisto[33] = { 0 }; + uint32_t bithisto[33] = { 0 }; for (int curcode = 0; curcode < m_numcodes; curcode++) { node_t &node = m_huffnode[curcode]; @@ -624,10 +624,10 @@ huffman_error huffman_context_base::assign_canonical_codes() } // for each code length, determine the starting code number - UINT32 curstart = 0; + uint32_t curstart = 0; for (int codelen = 32; codelen > 0; codelen--) { - UINT32 nextstart = (curstart + bithisto[codelen]) >> 1; + uint32_t nextstart = (curstart + bithisto[codelen]) >> 1; if (codelen != 1 && nextstart * 2 != (curstart + bithisto[codelen])) return HUFFERR_INTERNAL_INCONSISTENCY; bithisto[codelen] = curstart; @@ -691,11 +691,11 @@ huffman_8bit_encoder::huffman_8bit_encoder() // encode - encode a full buffer //------------------------------------------------- -huffman_error huffman_8bit_encoder::encode(const UINT8 *source, UINT32 slength, UINT8 *dest, UINT32 dlength, UINT32 &complength) +huffman_error huffman_8bit_encoder::encode(const uint8_t *source, uint32_t slength, uint8_t *dest, uint32_t dlength, uint32_t &complength) { // first compute the histogram histo_reset(); - for (UINT32 cur = 0; cur < slength; cur++) + for (uint32_t cur = 0; cur < slength; cur++) histo_one(source[cur]); // then compute the tree @@ -710,7 +710,7 @@ huffman_error huffman_8bit_encoder::encode(const UINT8 *source, UINT32 slength, return err; // then encode the data - for (UINT32 cur = 0; cur < slength; cur++) + for (uint32_t cur = 0; cur < slength; cur++) encode_one(bitbuf, source[cur]); complength = bitbuf.flush(); return bitbuf.overflow() ? HUFFERR_OUTPUT_BUFFER_TOO_SMALL : HUFFERR_NONE; @@ -731,7 +731,7 @@ huffman_8bit_decoder::huffman_8bit_decoder() } /** - * @fn huffman_error huffman_8bit_decoder::decode(const UINT8 *source, UINT32 slength, UINT8 *dest, UINT32 dlength) + * @fn huffman_error huffman_8bit_decoder::decode(const uint8_t *source, uint32_t slength, uint8_t *dest, uint32_t dlength) * * @brief ------------------------------------------------- * decode - decode a full buffer @@ -745,7 +745,7 @@ huffman_8bit_decoder::huffman_8bit_decoder() * @return A huffman_error. */ -huffman_error huffman_8bit_decoder::decode(const UINT8 *source, UINT32 slength, UINT8 *dest, UINT32 dlength) +huffman_error huffman_8bit_decoder::decode(const uint8_t *source, uint32_t slength, uint8_t *dest, uint32_t dlength) { // first import the tree bitstream_in bitbuf(source, slength); @@ -754,7 +754,7 @@ huffman_error huffman_8bit_decoder::decode(const UINT8 *source, UINT32 slength, return err; // then decode the data - for (UINT32 cur = 0; cur < dlength; cur++) + for (uint32_t cur = 0; cur < dlength; cur++) dest[cur] = decode_one(bitbuf); bitbuf.flush(); return bitbuf.overflow() ? HUFFERR_INPUT_BUFFER_TOO_SMALL : HUFFERR_NONE; diff --git a/src/lib/util/huffman.h b/src/lib/util/huffman.h index a2bed42bbf9..2814eb127dd 100644 --- a/src/lib/util/huffman.h +++ b/src/lib/util/huffman.h @@ -44,20 +44,20 @@ enum huffman_error class huffman_context_base { protected: - typedef UINT16 lookup_value; + typedef uint16_t lookup_value; // a node in the huffman tree struct node_t { node_t * m_parent; // pointer to parent node - UINT32 m_count; // number of hits on this node - UINT32 m_weight; // assigned weight of this node - UINT32 m_bits; // bits used to encode the node - UINT8 m_numbits; // number of bits needed for this node + uint32_t m_count; // number of hits on this node + uint32_t m_weight; // assigned weight of this node + uint32_t m_bits; // bits used to encode the node + uint8_t m_numbits; // number of bits needed for this node }; // construction/destruction - huffman_context_base(int numcodes, int maxbits, lookup_value *lookup, UINT32 *histo, node_t *nodes); + huffman_context_base(int numcodes, int maxbits, lookup_value *lookup, uint32_t *histo, node_t *nodes); // tree creation huffman_error compute_tree_from_histo(); @@ -73,18 +73,18 @@ protected: // internal helpers void write_rle_tree_bits(bitstream_out &bitbuf, int value, int repcount, int numbits); static int CLIB_DECL tree_node_compare(const void *item1, const void *item2); - int build_tree(UINT32 totaldata, UINT32 totalweight); + int build_tree(uint32_t totaldata, uint32_t totalweight); huffman_error assign_canonical_codes(); void build_lookup_table(); protected: // internal state - UINT32 m_numcodes; // number of total codes being processed - UINT8 m_maxbits; // maximum bits per code - UINT8 m_prevdata; // value of the previous data (for delta-RLE encoding) + uint32_t m_numcodes; // number of total codes being processed + uint8_t m_maxbits; // maximum bits per code + uint8_t m_prevdata; // value of the previous data (for delta-RLE encoding) int m_rleremaining; // number of RLE bytes remaining (for delta-RLE encoding) lookup_value * m_lookup; // pointer to the lookup table - UINT32 * m_datahisto; // histogram of data values + uint32_t * m_datahisto; // histogram of data values node_t * m_huffnode; // array of nodes }; @@ -102,8 +102,8 @@ public: // single item operations void histo_reset() { memset(m_datahisto_array, 0, sizeof(m_datahisto_array)); } - void histo_one(UINT32 data); - void encode_one(bitstream_out &bitbuf, UINT32 data); + void histo_one(uint32_t data); + void encode_one(bitstream_out &bitbuf, uint32_t data); // expose tree computation and export using huffman_context_base::compute_tree_from_histo; @@ -112,7 +112,7 @@ public: private: // array versions of the info we need - UINT32 m_datahisto_array[_NumCodes]; + uint32_t m_datahisto_array[_NumCodes]; node_t m_huffnode_array[_NumCodes * 2]; }; @@ -129,7 +129,7 @@ public: : huffman_context_base(_NumCodes, _MaxBits, m_lookup_array, nullptr, m_huffnode_array) { } // single item operations - UINT32 decode_one(bitstream_in &bitbuf); + uint32_t decode_one(bitstream_in &bitbuf); // expose tree import using huffman_context_base::import_tree_rle; @@ -152,7 +152,7 @@ public: huffman_8bit_encoder(); // operations - huffman_error encode(const UINT8 *source, UINT32 slength, UINT8 *dest, UINT32 destlength, UINT32 &complength); + huffman_error encode(const uint8_t *source, uint32_t slength, uint8_t *dest, uint32_t destlength, uint32_t &complength); }; @@ -166,7 +166,7 @@ public: huffman_8bit_decoder(); // operations - huffman_error decode(const UINT8 *source, UINT32 slength, UINT8 *dest, UINT32 destlength); + huffman_error decode(const uint8_t *source, uint32_t slength, uint8_t *dest, uint32_t destlength); }; @@ -180,7 +180,7 @@ public: //------------------------------------------------- template -inline void huffman_encoder<_NumCodes, _MaxBits>::histo_one(UINT32 data) +inline void huffman_encoder<_NumCodes, _MaxBits>::histo_one(uint32_t data) { m_datahisto[data]++; } @@ -192,7 +192,7 @@ inline void huffman_encoder<_NumCodes, _MaxBits>::histo_one(UINT32 data) //------------------------------------------------- template -inline void huffman_encoder<_NumCodes, _MaxBits>::encode_one(bitstream_out &bitbuf, UINT32 data) +inline void huffman_encoder<_NumCodes, _MaxBits>::encode_one(bitstream_out &bitbuf, uint32_t data) { // write the data node_t &node = m_huffnode[data]; @@ -206,10 +206,10 @@ inline void huffman_encoder<_NumCodes, _MaxBits>::encode_one(bitstream_out &bitb //------------------------------------------------- template -inline UINT32 huffman_decoder<_NumCodes, _MaxBits>::decode_one(bitstream_in &bitbuf) +inline uint32_t huffman_decoder<_NumCodes, _MaxBits>::decode_one(bitstream_in &bitbuf) { // peek ahead to get maxbits worth of data - UINT32 bits = bitbuf.peek(m_maxbits); + uint32_t bits = bitbuf.peek(m_maxbits); // look it up, then remove the actual number of bits for this code lookup_value lookup = m_lookup[bits]; diff --git a/src/lib/util/jedparse.cpp b/src/lib/util/jedparse.cpp index 9bed1164303..c2c9a139a6a 100644 --- a/src/lib/util/jedparse.cpp +++ b/src/lib/util/jedparse.cpp @@ -38,8 +38,8 @@ struct jed_parse_info { - UINT16 checksum; /* checksum value */ - UINT32 explicit_numfuses; /* explicitly specified number of fuses */ + uint16_t checksum; /* checksum value */ + uint32_t explicit_numfuses; /* explicitly specified number of fuses */ }; @@ -86,10 +86,10 @@ static int isdelim(char c) character stream -------------------------------------------------*/ -static UINT32 suck_number(const UINT8 **psrc) +static uint32_t suck_number(const uint8_t **psrc) { - const UINT8 *src = *psrc; - UINT32 value = 0; + const uint8_t *src = *psrc; + uint32_t value = 0; /* skip delimiters */ while (isdelim(*src)) @@ -117,7 +117,7 @@ static UINT32 suck_number(const UINT8 **psrc) process_field - process a single JEDEC field -------------------------------------------------*/ -static void process_field(jed_data *data, const UINT8 *cursrc, const UINT8 *srcend, jed_parse_info *pinfo) +static void process_field(jed_data *data, const uint8_t *cursrc, const uint8_t *srcend, jed_parse_info *pinfo) { /* switch off of the field type */ switch (*cursrc) @@ -147,7 +147,7 @@ static void process_field(jed_data *data, const UINT8 *cursrc, const UINT8 *srce /* fuse states */ case 'L': { - UINT32 curfuse; + uint32_t curfuse; /* read the fuse number */ cursrc++; @@ -189,11 +189,11 @@ static void process_field(jed_data *data, const UINT8 *cursrc, const UINT8 *srce int jed_parse(const void *data, size_t length, jed_data *result) { - const UINT8 *cursrc = (const UINT8 *)data; - const UINT8 *srcend = cursrc + length; - const UINT8 *scan; + const uint8_t *cursrc = (const uint8_t *)data; + const uint8_t *srcend = cursrc + length; + const uint8_t *scan; jed_parse_info pinfo; - UINT16 checksum; + uint16_t checksum; int i; /* initialize the output and the intermediate info struct */ @@ -218,7 +218,7 @@ int jed_parse(const void *data, size_t length, jed_data *result) checksum += *scan; if (scan + 4 < srcend && ishex(scan[1]) && ishex(scan[2]) && ishex(scan[3]) && ishex(scan[4])) { - UINT16 dessum = (hexval(scan[1]) << 12) | (hexval(scan[2]) << 8) | (hexval(scan[3]) << 4) | hexval(scan[4] << 0); + uint16_t dessum = (hexval(scan[1]) << 12) | (hexval(scan[2]) << 8) | (hexval(scan[3]) << 4) | hexval(scan[4] << 0); if (dessum != 0 && dessum != checksum) return JEDERR_BAD_XMIT_SUM; } @@ -283,13 +283,13 @@ int jed_parse(const void *data, size_t length, jed_data *result) size_t jed_output(const jed_data *data, void *result, size_t length) { - UINT8 *curdst = (UINT8 *)result; - UINT8 *dstend = curdst + length; + uint8_t *curdst = (uint8_t *)result; + uint8_t *dstend = curdst + length; int i, zeros, ones; char tempbuf[256]; - UINT16 checksum; - UINT8 defbyte; - UINT8 *temp; + uint16_t checksum; + uint8_t defbyte; + uint8_t *temp; /* always start the DST with a standard header and an STX */ tempbuf[0] = 0x02; @@ -355,7 +355,7 @@ size_t jed_output(const jed_data *data, void *result, size_t length) /* now compute the transmission checksum */ checksum = 0; - for (temp = (UINT8 *)result; temp < curdst && temp < dstend; temp++) + for (temp = (uint8_t *)result; temp < curdst && temp < dstend; temp++) checksum += *temp & 0x7f; checksum += 0x03; @@ -367,7 +367,7 @@ size_t jed_output(const jed_data *data, void *result, size_t length) curdst += strlen(tempbuf); /* return the final size */ - return curdst - (UINT8 *)result; + return curdst - (uint8_t *)result; } @@ -379,7 +379,7 @@ size_t jed_output(const jed_data *data, void *result, size_t length) int jedbin_parse(const void *data, size_t length, jed_data *result) { - const UINT8 *cursrc = (const UINT8 *)data; + const uint8_t *cursrc = (const uint8_t *)data; /* initialize the output */ memset(result, 0, sizeof(*result)); @@ -424,7 +424,7 @@ int jedbin_parse(const void *data, size_t length, jed_data *result) size_t jedbin_output(const jed_data *data, void *result, size_t length) { - UINT8 *curdst = (UINT8 *)result; + uint8_t *curdst = (uint8_t *)result; /* ensure we have enough room */ if (length >= 4 + (data->numfuses + 7) / 8) diff --git a/src/lib/util/jedparse.h b/src/lib/util/jedparse.h index 0f23462b995..e2eca46b236 100644 --- a/src/lib/util/jedparse.h +++ b/src/lib/util/jedparse.h @@ -35,8 +35,8 @@ struct jed_data { - UINT32 numfuses; /* number of defined fuses */ - UINT8 fusemap[JED_MAX_FUSES / 8];/* array of bit-packed data */ + uint32_t numfuses; /* number of defined fuses */ + uint8_t fusemap[JED_MAX_FUSES / 8];/* array of bit-packed data */ }; @@ -63,7 +63,7 @@ size_t jedbin_output(const jed_data *data, void *result, size_t length); INLINE FUNCTIONS ***************************************************************************/ -static inline int jed_get_fuse(const jed_data *data, UINT32 fusenum) +static inline int jed_get_fuse(const jed_data *data, uint32_t fusenum) { if (fusenum < JED_MAX_FUSES) return (data->fusemap[fusenum / 8] >> (fusenum % 8)) & 1; @@ -72,7 +72,7 @@ static inline int jed_get_fuse(const jed_data *data, UINT32 fusenum) } -static inline void jed_set_fuse(jed_data *data, UINT32 fusenum, UINT8 value) +static inline void jed_set_fuse(jed_data *data, uint32_t fusenum, uint8_t value) { if (fusenum < JED_MAX_FUSES) { diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp index f799ad06c97..7e40ab736de 100644 --- a/src/lib/util/options.cpp +++ b/src/lib/util/options.cpp @@ -53,7 +53,7 @@ const char *const core_options::s_option_unadorned[MAX_UNADORNED_OPTIONS] = // entry - constructor //------------------------------------------------- -core_options::entry::entry(const char *name, const char *description, UINT32 flags, const char *defvalue) +core_options::entry::entry(const char *name, const char *description, uint32_t flags, const char *defvalue) : m_next(nullptr), m_flags(flags), m_seqid(0), @@ -139,7 +139,7 @@ void core_options::entry::set_description(const char *description) } -void core_options::entry::set_flag(UINT32 mask, UINT32 flag) +void core_options::entry::set_flag(uint32_t mask, uint32_t flag) { m_flags = ( m_flags & mask ) | flag; } @@ -254,7 +254,7 @@ bool core_options::operator!=(const core_options &rhs) // options set //------------------------------------------------- -void core_options::add_entry(const char *name, const char *description, UINT32 flags, const char *defvalue, bool override_existing) +void core_options::add_entry(const char *name, const char *description, uint32_t flags, const char *defvalue, bool override_existing) { // allocate a new entry auto newentry = global_alloc(entry(name, description, flags, defvalue)); @@ -410,7 +410,7 @@ bool core_options::parse_ini_file(util::core_file &inifile, int priority, int ig // find the extent of the name char *optionname; for (optionname = buffer; *optionname != 0; optionname++) - if (!isspace((UINT8)*optionname)) + if (!isspace((uint8_t)*optionname)) break; // skip comments @@ -420,7 +420,7 @@ bool core_options::parse_ini_file(util::core_file &inifile, int priority, int ig // scan forward to find the first space char *temp; for (temp = optionname; *temp != 0; temp++) - if (isspace((UINT8)*temp)) + if (isspace((uint8_t)*temp)) break; // if we hit the end early, print a warning and continue @@ -601,7 +601,7 @@ int core_options::priority(const char *name) const // seqid - return the seqid for a given option //------------------------------------------------- -UINT32 core_options::seqid(const char *name) const +uint32_t core_options::seqid(const char *name) const { auto curentry = m_entrymap.find(name); return (curentry != m_entrymap.end()) ? curentry->second->seqid() : 0; @@ -655,7 +655,7 @@ bool core_options::set_value(const char *name, float value, int priority, std::s } -void core_options::set_flag(const char *name, UINT32 mask, UINT32 flag) +void core_options::set_flag(const char *name, uint32_t mask, uint32_t flag) { // find the entry first auto curentry = m_entrymap.find(name); diff --git a/src/lib/util/options.h b/src/lib/util/options.h index d25a29ef1db..c99b99d3f5b 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -21,7 +21,7 @@ //************************************************************************** // option types -const UINT32 OPTION_TYPE_MASK = 0x0007; // up to 8 different types +const uint32_t OPTION_TYPE_MASK = 0x0007; // up to 8 different types enum { OPTION_INVALID, // invalid @@ -40,7 +40,7 @@ const int OPTION_PRIORITY_NORMAL = 100; // normal priority const int OPTION_PRIORITY_HIGH = 150; // high priority const int OPTION_PRIORITY_MAXIMUM = 255; // maximum priority -const UINT32 OPTION_FLAG_INTERNAL = 0x40000000; +const uint32_t OPTION_FLAG_INTERNAL = 0x40000000; //************************************************************************** @@ -52,7 +52,7 @@ struct options_entry { const char * name; // name on the command line const char * defvalue; // default value of this argument - UINT32 flags; // flags to describe the option + uint32_t flags; // flags to describe the option const char * description; // description for -showusage }; @@ -70,7 +70,7 @@ public: friend class simple_list; // construction/destruction - entry(const char *name, const char *description, UINT32 flags = 0, const char *defvalue = nullptr); + entry(const char *name, const char *description, uint32_t flags = 0, const char *defvalue = nullptr); public: // getters @@ -81,9 +81,9 @@ public: const char *default_value() const { return m_defdata.c_str(); } const char *minimum() const { return m_minimum.c_str(); } const char *maximum() const { return m_maximum.c_str(); } - UINT32 seqid() const { return m_seqid; } + uint32_t seqid() const { return m_seqid; } int type() const { return (m_flags & OPTION_TYPE_MASK); } - UINT32 flags() const { return m_flags; } + uint32_t flags() const { return m_flags; } bool is_header() const { return type() == OPTION_HEADER; } bool is_command() const { return type() == OPTION_COMMAND; } bool is_internal() const { return (m_flags & OPTION_FLAG_INTERNAL)!=0; } @@ -95,15 +95,15 @@ public: void set_value(const char *newvalue, int priority); void set_default_value(const char *defvalue); void set_description(const char *description); - void set_flag(UINT32 mask, UINT32 flag); + void set_flag(uint32_t mask, uint32_t flag); void mark_changed() { m_changed = true; } void revert(int priority_hi, int priority_lo); private: // internal state entry * m_next; // link to the next data - UINT32 m_flags; // flags from the entry - UINT32 m_seqid; // sequence ID; bumped on each change + uint32_t m_flags; // flags from the entry + uint32_t m_seqid; // sequence ID; bumped on each change bool m_error_reported; // have we reported an error on this option yet? int m_priority; // priority of the data set const char * m_description; // description for this item @@ -139,7 +139,7 @@ public: auto_iterator end() const { return m_entrylist.end(); } // configuration - void add_entry(const char *name, const char *description, UINT32 flags = 0, const char *defvalue = nullptr, bool override_existing = false); + void add_entry(const char *name, const char *description, uint32_t flags = 0, const char *defvalue = nullptr, bool override_existing = false); void add_entry(const options_entry &data, bool override_existing = false) { add_entry(data.name, data.description, data.flags, data.defvalue, override_existing); } void add_entries(const options_entry *entrylist, bool override_existing = false); void set_default_value(const char *name, const char *defvalue); @@ -164,7 +164,7 @@ public: bool bool_value(const char *name) const { return (atoi(value(name)) != 0); } int int_value(const char *name) const { return atoi(value(name)); } float float_value(const char *name) const { return atof(value(name)); } - UINT32 seqid(const char *name) const; + uint32_t seqid(const char *name) const; bool exists(const char *name) const; bool is_changed(const char *name) const; @@ -172,7 +172,7 @@ public: bool set_value(const char *name, const char *value, int priority, std::string &error_string); bool set_value(const char *name, int value, int priority, std::string &error_string); bool set_value(const char *name, float value, int priority, std::string &error_string); - void set_flag(const char *name, UINT32 mask, UINT32 flags); + void set_flag(const char *name, uint32_t mask, uint32_t flags); void mark_changed(const char *name); // misc diff --git a/src/lib/util/palette.cpp b/src/lib/util/palette.cpp index 196031d3694..c6a9e07d9d6 100644 --- a/src/lib/util/palette.cpp +++ b/src/lib/util/palette.cpp @@ -38,7 +38,7 @@ const rgb_t rgb_t::amber(247, 170, 0); // entry for brightness //------------------------------------------------- -inline rgb_t palette_t::adjust_palette_entry(rgb_t entry, float brightness, float contrast, const UINT8 *gamma_map) +inline rgb_t palette_t::adjust_palette_entry(rgb_t entry, float brightness, float contrast, const uint8_t *gamma_map) { int r = rgb_t::clamp(float(gamma_map[entry.r()]) * contrast + brightness); int g = rgb_t::clamp(float(gamma_map[entry.g()]) * contrast + brightness); @@ -69,7 +69,7 @@ palette_client::dirty_state::dirty_state() // min/max values //------------------------------------------------- -const UINT32 *palette_client::dirty_state::dirty_list(UINT32 &mindirty, UINT32 &maxdirty) +const uint32_t *palette_client::dirty_state::dirty_list(uint32_t &mindirty, uint32_t &maxdirty) { // fill in the mindirty/maxdirty mindirty = m_mindirty; @@ -85,10 +85,10 @@ const UINT32 *palette_client::dirty_state::dirty_list(UINT32 &mindirty, UINT32 & // dirty //------------------------------------------------- -void palette_client::dirty_state::resize(UINT32 colors) +void palette_client::dirty_state::resize(uint32_t colors) { // resize to the correct number of dwords and mark all entries dirty - UINT32 dirty_dwords = (colors + 31) / 32; + uint32_t dirty_dwords = (colors + 31) / 32; m_dirty.resize(dirty_dwords); memset(&m_dirty[0], 0xff, dirty_dwords*4); @@ -105,7 +105,7 @@ void palette_client::dirty_state::resize(UINT32 colors) // mark_dirty - mark a single entry dirty //------------------------------------------------- -void palette_client::dirty_state::mark_dirty(UINT32 index) +void palette_client::dirty_state::mark_dirty(uint32_t index) { m_dirty[index / 32] |= 1 << (index % 32); m_mindirty = std::min(m_mindirty, index); @@ -121,7 +121,7 @@ void palette_client::dirty_state::mark_dirty(UINT32 index) void palette_client::dirty_state::reset() { // erase relevant entries in the new live one - memset(&m_dirty[m_mindirty / 32], 0, ((m_maxdirty / 32) + 1 - (m_mindirty / 32)) * sizeof(UINT32)); + memset(&m_dirty[m_mindirty / 32], 0, ((m_maxdirty / 32) + 1 - (m_mindirty / 32)) * sizeof(uint32_t)); m_mindirty = m_dirty.size() * 32 - 1; m_maxdirty = 0; } @@ -146,7 +146,7 @@ palette_client::palette_client(palette_t &palette) palette.ref(); // resize the dirty lists - UINT32 total_colors = palette.num_colors() * palette.num_groups(); + uint32_t total_colors = palette.num_colors() * palette.num_groups(); m_dirty[0].resize(total_colors); m_dirty[1].resize(total_colors); @@ -180,10 +180,10 @@ palette_client::~palette_client() // list for a client //------------------------------------------------- -const UINT32 *palette_client::dirty_list(UINT32 &mindirty, UINT32 &maxdirty) +const uint32_t *palette_client::dirty_list(uint32_t &mindirty, uint32_t &maxdirty) { // if nothing to report, report nothing and don't swap - const UINT32 *result = m_live->dirty_list(mindirty, maxdirty); + const uint32_t *result = m_live->dirty_list(mindirty, maxdirty); if (result == nullptr) return nullptr; @@ -207,7 +207,7 @@ const UINT32 *palette_client::dirty_list(UINT32 &mindirty, UINT32 &maxdirty) // alloc - static allocator //------------------------------------------------- -palette_t *palette_t::alloc(UINT32 numcolors, UINT32 numgroups) +palette_t *palette_t::alloc(uint32_t numcolors, uint32_t numgroups) { return new palette_t(numcolors, numgroups); } @@ -217,7 +217,7 @@ palette_t *palette_t::alloc(UINT32 numcolors, UINT32 numgroups) // palette_t - constructor //------------------------------------------------- -palette_t::palette_t(UINT32 numcolors, UINT32 numgroups) +palette_t::palette_t(uint32_t numcolors, uint32_t numgroups) : m_refcount(1), m_numcolors(numcolors), m_numgroups(numgroups), @@ -233,25 +233,25 @@ palette_t::palette_t(UINT32 numcolors, UINT32 numgroups) m_client_list(nullptr) { // initialize gamma map - for (UINT32 index = 0; index < 256; index++) + for (uint32_t index = 0; index < 256; index++) m_gamma_map[index] = index; // initialize the per-entry data - for (UINT32 index = 0; index < numcolors; index++) + for (uint32_t index = 0; index < numcolors; index++) { m_entry_color[index] = rgb_t::black; m_entry_contrast[index] = 1.0f; } // initialize the per-group data - for (UINT32 index = 0; index < numgroups; index++) + for (uint32_t index = 0; index < numgroups; index++) { m_group_bright[index] = 0.0f; m_group_contrast[index] = 1.0f; } // initialize the expanded data - for (UINT32 index = 0; index < numcolors * numgroups; index++) + for (uint32_t index = 0; index < numcolors * numgroups; index++) { m_adjusted_color[index] = rgb_t::black; m_adjusted_rgb15[index] = rgb_t::black.as_rgb15(); @@ -359,7 +359,7 @@ void palette_t::set_gamma(float gamma) // given palette index //------------------------------------------------- -void palette_t::entry_set_color(UINT32 index, rgb_t rgb) +void palette_t::entry_set_color(uint32_t index, rgb_t rgb) { // if out of range, or unchanged, ignore if (index >= m_numcolors || m_entry_color[index] == rgb) @@ -379,7 +379,7 @@ void palette_t::entry_set_color(UINT32 index, rgb_t rgb) // given palette index //------------------------------------------------- -void palette_t::entry_set_red_level(UINT32 index, UINT8 level) +void palette_t::entry_set_red_level(uint32_t index, uint8_t level) { // if out of range, or unchanged, ignore if (index >= m_numcolors || m_entry_color[index].r() == level) @@ -399,7 +399,7 @@ void palette_t::entry_set_red_level(UINT32 index, UINT8 level) // given palette index //------------------------------------------------- -void palette_t::entry_set_green_level(UINT32 index, UINT8 level) +void palette_t::entry_set_green_level(uint32_t index, uint8_t level) { // if out of range, or unchanged, ignore if (index >= m_numcolors || m_entry_color[index].g() == level) @@ -419,7 +419,7 @@ void palette_t::entry_set_green_level(UINT32 index, UINT8 level) // given palette index //------------------------------------------------- -void palette_t::entry_set_blue_level(UINT32 index, UINT8 level) +void palette_t::entry_set_blue_level(uint32_t index, uint8_t level) { // if out of range, or unchanged, ignore if (index >= m_numcolors || m_entry_color[index].b() == level) @@ -439,7 +439,7 @@ void palette_t::entry_set_blue_level(UINT32 index, UINT8 level) // adjustment for a single palette index //------------------------------------------------- -void palette_t::entry_set_contrast(UINT32 index, float contrast) +void palette_t::entry_set_contrast(uint32_t index, float contrast) { // if out of range, or unchanged, ignore if (index >= m_numcolors || m_entry_contrast[index] == contrast) @@ -459,7 +459,7 @@ void palette_t::entry_set_contrast(UINT32 index, float contrast) // brightness for a palette group //------------------------------------------------- -void palette_t::group_set_brightness(UINT32 group, float brightness) +void palette_t::group_set_brightness(uint32_t group, float brightness) { // convert incoming value to normalized result brightness = (brightness - 1.0f) * 256.0f; @@ -482,7 +482,7 @@ void palette_t::group_set_brightness(UINT32 group, float brightness) // contrast for a palette group //------------------------------------------------- -void palette_t::group_set_contrast(UINT32 group, float contrast) +void palette_t::group_set_contrast(uint32_t group, float contrast) { // if out of range, or unchanged, ignore if (group >= m_numgroups || m_group_contrast[group] == contrast) @@ -502,43 +502,43 @@ void palette_t::group_set_contrast(UINT32 group, float contrast) // entries //------------------------------------------------- -void palette_t::normalize_range(UINT32 start, UINT32 end, int lum_min, int lum_max) +void palette_t::normalize_range(uint32_t start, uint32_t end, int lum_min, int lum_max) { // clamp within range start = std::max(start, 0U); end = std::min(end, m_numcolors - 1); // find the minimum and maximum brightness of all the colors in the range - INT32 ymin = 1000 * 255, ymax = 0; - for (UINT32 index = start; index <= end; index++) + int32_t ymin = 1000 * 255, ymax = 0; + for (uint32_t index = start; index <= end; index++) { rgb_t rgb = m_entry_color[index]; - UINT32 y = 299 * rgb.r() + 587 * rgb.g() + 114 * rgb.b(); - ymin = (std::min)(ymin, y); - ymax = (std::max)(ymax, y); + uint32_t y = 299 * rgb.r() + 587 * rgb.g() + 114 * rgb.b(); + ymin = (std::min)(ymin, y); + ymax = (std::max)(ymax, y); } // determine target minimum/maximum - INT32 tmin = (lum_min < 0) ? ((ymin + 500) / 1000) : lum_min; - INT32 tmax = (lum_max < 0) ? ((ymax + 500) / 1000) : lum_max; + int32_t tmin = (lum_min < 0) ? ((ymin + 500) / 1000) : lum_min; + int32_t tmax = (lum_max < 0) ? ((ymax + 500) / 1000) : lum_max; // now normalize the palette - for (UINT32 index = start; index <= end; index++) + for (uint32_t index = start; index <= end; index++) { rgb_t rgb = m_entry_color[index]; - INT32 y = 299 * rgb.r() + 587 * rgb.g() + 114 * rgb.b(); - INT32 u = ((INT32)rgb.b()-y /1000)*492 / 1000; - INT32 v = ((INT32)rgb.r()-y / 1000)*877 / 1000; - INT32 target = tmin + ((y - ymin) * (tmax - tmin + 1)) / (ymax - ymin); - UINT8 r = rgb_t::clamp(target + 1140 * v / 1000); - UINT8 g = rgb_t::clamp(target - 395 * u / 1000 - 581 * v / 1000); - UINT8 b = rgb_t::clamp(target + 2032 * u / 1000); + int32_t y = 299 * rgb.r() + 587 * rgb.g() + 114 * rgb.b(); + int32_t u = ((int32_t)rgb.b()-y /1000)*492 / 1000; + int32_t v = ((int32_t)rgb.r()-y / 1000)*877 / 1000; + int32_t target = tmin + ((y - ymin) * (tmax - tmin + 1)) / (ymax - ymin); + uint8_t r = rgb_t::clamp(target + 1140 * v / 1000); + uint8_t g = rgb_t::clamp(target - 395 * u / 1000 - 581 * v / 1000); + uint8_t b = rgb_t::clamp(target + 2032 * u / 1000); entry_set_color(index, rgb_t(r, g, b)); } } /** - * @fn void palette_t::update_adjusted_color(UINT32 group, UINT32 index) + * @fn void palette_t::update_adjusted_color(uint32_t group, uint32_t index) * * @brief ------------------------------------------------- * update_adjusted_color - update a color index by group and index pair @@ -548,7 +548,7 @@ void palette_t::normalize_range(UINT32 start, UINT32 end, int lum_min, int lum_m * @param index Zero-based index of the. */ -void palette_t::update_adjusted_color(UINT32 group, UINT32 index) +void palette_t::update_adjusted_color(uint32_t group, uint32_t index) { // compute the adjusted value rgb_t adjusted = adjust_palette_entry(m_entry_color[index], @@ -557,7 +557,7 @@ void palette_t::update_adjusted_color(UINT32 group, UINT32 index) m_gamma_map); // if not different, ignore - UINT32 finalindex = group * m_numcolors + index; + uint32_t finalindex = group * m_numcolors + index; if (m_adjusted_color[finalindex] == adjusted) return; diff --git a/src/lib/util/palette.h b/src/lib/util/palette.h index a7054a93501..bfc591d7b2a 100644 --- a/src/lib/util/palette.h +++ b/src/lib/util/palette.h @@ -25,7 +25,7 @@ class palette_t; // an rgb15_t is a single combined 15-bit R,G,B value -typedef UINT16 rgb15_t; +typedef uint16_t rgb15_t; // ======================> rgb_t @@ -36,33 +36,33 @@ class rgb_t public: // construction/destruction rgb_t(): m_data(0) { } - rgb_t(UINT32 data) { m_data = data; } - rgb_t(UINT8 r, UINT8 g, UINT8 b) { m_data = (255 << 24) | (r << 16) | (g << 8) | b; } - rgb_t(UINT8 a, UINT8 r, UINT8 g, UINT8 b) { m_data = (a << 24) | (r << 16) | (g << 8) | b; } + rgb_t(uint32_t data) { m_data = data; } + rgb_t(uint8_t r, uint8_t g, uint8_t b) { m_data = (255 << 24) | (r << 16) | (g << 8) | b; } + rgb_t(uint8_t a, uint8_t r, uint8_t g, uint8_t b) { m_data = (a << 24) | (r << 16) | (g << 8) | b; } // getters - UINT8 a() const { return m_data >> 24; } - UINT8 r() const { return m_data >> 16; } - UINT8 g() const { return m_data >> 8; } - UINT8 b() const { return m_data >> 0; } + uint8_t a() const { return m_data >> 24; } + uint8_t r() const { return m_data >> 16; } + uint8_t g() const { return m_data >> 8; } + uint8_t b() const { return m_data >> 0; } rgb15_t as_rgb15() const { return ((r() >> 3) << 10) | ((g() >> 3) << 5) | ((b() >> 3) << 0); } - UINT8 brightness() const { return (r() * 222 + g() * 707 + b() * 71) / 1000; } - UINT32 const *ptr() const { return &m_data; } + uint8_t brightness() const { return (r() * 222 + g() * 707 + b() * 71) / 1000; } + uint32_t const *ptr() const { return &m_data; } // setters - rgb_t &set_a(UINT8 a) { m_data &= ~0xff000000; m_data |= a << 24; return *this; } - rgb_t &set_r(UINT8 r) { m_data &= ~0x00ff0000; m_data |= r << 16; return *this; } - rgb_t &set_g(UINT8 g) { m_data &= ~0x0000ff00; m_data |= g << 8; return *this; } - rgb_t &set_b(UINT8 b) { m_data &= ~0x000000ff; m_data |= b << 0; return *this; } + rgb_t &set_a(uint8_t a) { m_data &= ~0xff000000; m_data |= a << 24; return *this; } + rgb_t &set_r(uint8_t r) { m_data &= ~0x00ff0000; m_data |= r << 16; return *this; } + rgb_t &set_g(uint8_t g) { m_data &= ~0x0000ff00; m_data |= g << 8; return *this; } + rgb_t &set_b(uint8_t b) { m_data &= ~0x000000ff; m_data |= b << 0; return *this; } // implicit conversion operators - operator UINT32() const { return m_data; } + operator uint32_t() const { return m_data; } // operations - rgb_t &scale8(UINT8 scale) { m_data = rgb_t(clamphi((a() * scale) >> 8), clamphi((r() * scale) >> 8), clamphi((g() * scale) >> 8), clamphi((b() * scale) >> 8)); return *this; } + rgb_t &scale8(uint8_t scale) { m_data = rgb_t(clamphi((a() * scale) >> 8), clamphi((r() * scale) >> 8), clamphi((g() * scale) >> 8), clamphi((b() * scale) >> 8)); return *this; } // assignment operators - rgb_t &operator=(UINT32 rhs) { m_data = rhs; return *this; } + rgb_t &operator=(uint32_t rhs) { m_data = rhs; return *this; } rgb_t &operator+=(const rgb_t &rhs) { m_data = rgb_t(clamphi(a() + rhs.a()), clamphi(r() + rhs.r()), clamphi(g() + rhs.g()), clamphi(b() + rhs.b())); return *this; } rgb_t &operator-=(const rgb_t &rhs) { m_data = rgb_t(clamplo(a() - rhs.a()), clamplo(r() - rhs.r()), clamplo(g() - rhs.g()), clamplo(b() - rhs.b())); return *this; } @@ -71,9 +71,9 @@ public: rgb_t operator-(const rgb_t &rhs) const { rgb_t result = *this; result -= rhs; return result; } // static helpers - static UINT8 clamp(INT32 value) { return (value < 0) ? 0 : (value > 255) ? 255 : value; } - static UINT8 clamphi(INT32 value) { return (value > 255) ? 255 : value; } - static UINT8 clamplo(INT32 value) { return (value < 0) ? 0 : value; } + static uint8_t clamp(int32_t value) { return (value < 0) ? 0 : (value > 255) ? 255 : value; } + static uint8_t clamphi(int32_t value) { return (value > 255) ? 255 : value; } + static uint8_t clamplo(int32_t value) { return (value < 0) ? 0 : value; } // constants static const rgb_t black; @@ -83,7 +83,7 @@ public: static const rgb_t transparent; private: - UINT32 m_data; + uint32_t m_data; }; @@ -100,10 +100,10 @@ public: // getters palette_client *next() const { return m_next; } palette_t &palette() const { return m_palette; } - const UINT32 *dirty_list(UINT32 &mindirty, UINT32 &maxdirty); + const uint32_t *dirty_list(uint32_t &mindirty, uint32_t &maxdirty); // dirty marking - void mark_dirty(UINT32 index) { m_live->mark_dirty(index); } + void mark_dirty(uint32_t index) { m_live->mark_dirty(index); } private: // internal object to track dirty states @@ -114,16 +114,16 @@ private: dirty_state(); // operations - const UINT32 *dirty_list(UINT32 &mindirty, UINT32 &maxdirty); - void resize(UINT32 colors); - void mark_dirty(UINT32 index); + const uint32_t *dirty_list(uint32_t &mindirty, uint32_t &maxdirty); + void resize(uint32_t colors); + void mark_dirty(uint32_t index); void reset(); private: // internal state - std::vector m_dirty; // bitmap of dirty entries - UINT32 m_mindirty; // minimum dirty entry - UINT32 m_maxdirty; // minimum dirty entry + std::vector m_dirty; // bitmap of dirty entries + uint32_t m_mindirty; // minimum dirty entry + uint32_t m_maxdirty; // minimum dirty entry }; // internal state @@ -144,7 +144,7 @@ class palette_t public: // static constructor: used to ensure same new/delete is used - static palette_t *alloc(UINT32 numcolors, UINT32 numgroups = 1); + static palette_t *alloc(uint32_t numcolors, uint32_t numgroups = 1); // reference counting void ref() { m_refcount++; } @@ -154,8 +154,8 @@ public: int num_colors() const { return m_numcolors; } int num_groups() const { return m_numgroups; } int max_index() const { return m_numcolors * m_numgroups + 2; } - UINT32 black_entry() const { return m_numcolors * m_numgroups + 0; } - UINT32 white_entry() const { return m_numcolors * m_numgroups + 1; } + uint32_t black_entry() const { return m_numcolors * m_numgroups + 0; } + uint32_t white_entry() const { return m_numcolors * m_numgroups + 1; } // overall adjustments void set_brightness(float brightness); @@ -163,16 +163,16 @@ public: void set_gamma(float gamma); // entry getters - rgb_t entry_color(UINT32 index) const { return (index < m_numcolors) ? m_entry_color[index] : rgb_t::black; } - rgb_t entry_adjusted_color(UINT32 index) const { return (index < m_numcolors * m_numgroups) ? m_adjusted_color[index] : rgb_t::black; } - float entry_contrast(UINT32 index) const { return (index < m_numcolors) ? m_entry_contrast[index] : 1.0f; } + rgb_t entry_color(uint32_t index) const { return (index < m_numcolors) ? m_entry_color[index] : rgb_t::black; } + rgb_t entry_adjusted_color(uint32_t index) const { return (index < m_numcolors * m_numgroups) ? m_adjusted_color[index] : rgb_t::black; } + float entry_contrast(uint32_t index) const { return (index < m_numcolors) ? m_entry_contrast[index] : 1.0f; } // entry setters - void entry_set_color(UINT32 index, rgb_t rgb); - void entry_set_red_level(UINT32 index, UINT8 level); - void entry_set_green_level(UINT32 index, UINT8 level); - void entry_set_blue_level(UINT32 index, UINT8 level); - void entry_set_contrast(UINT32 index, float contrast); + void entry_set_color(uint32_t index, rgb_t rgb); + void entry_set_red_level(uint32_t index, uint8_t level); + void entry_set_green_level(uint32_t index, uint8_t level); + void entry_set_blue_level(uint32_t index, uint8_t level); + void entry_set_contrast(uint32_t index, float contrast); // entry list getters const rgb_t *entry_list_raw() const { return &m_entry_color[0]; } @@ -180,30 +180,30 @@ public: const rgb_t *entry_list_adjusted_rgb15() const { return &m_adjusted_rgb15[0]; } // group adjustments - void group_set_brightness(UINT32 group, float brightness); - void group_set_contrast(UINT32 group, float contrast); + void group_set_brightness(uint32_t group, float brightness); + void group_set_contrast(uint32_t group, float contrast); // utilities - void normalize_range(UINT32 start, UINT32 end, int lum_min = 0, int lum_max = 255); + void normalize_range(uint32_t start, uint32_t end, int lum_min = 0, int lum_max = 255); private: // construction/destruction - palette_t(UINT32 numcolors, UINT32 numgroups = 1); + palette_t(uint32_t numcolors, uint32_t numgroups = 1); ~palette_t(); // internal helpers - rgb_t adjust_palette_entry(rgb_t entry, float brightness, float contrast, const UINT8 *gamma_map); - void update_adjusted_color(UINT32 group, UINT32 index); + rgb_t adjust_palette_entry(rgb_t entry, float brightness, float contrast, const uint8_t *gamma_map); + void update_adjusted_color(uint32_t group, uint32_t index); // internal state - UINT32 m_refcount; // reference count on the palette - UINT32 m_numcolors; // number of colors in the palette - UINT32 m_numgroups; // number of groups in the palette + uint32_t m_refcount; // reference count on the palette + uint32_t m_numcolors; // number of colors in the palette + uint32_t m_numgroups; // number of groups in the palette float m_brightness; // overall brightness value float m_contrast; // overall contrast value float m_gamma; // overall gamma value - UINT8 m_gamma_map[256]; // gamma map + uint8_t m_gamma_map[256]; // gamma map std::vector m_entry_color; // array of raw colors std::vector m_entry_contrast; // contrast value for each entry @@ -227,7 +227,7 @@ private: //------------------------------------------------- template -inline UINT8 palexpand(UINT8 bits) +inline uint8_t palexpand(uint8_t bits) { if (_NumBits == 1) { return (bits & 1) ? 0xff : 0x00; } if (_NumBits == 2) { bits &= 3; return (bits << 6) | (bits << 4) | (bits << 2) | bits; } @@ -244,13 +244,13 @@ inline UINT8 palexpand(UINT8 bits) // palxbit - convert an x-bit value to 8 bits //------------------------------------------------- -inline UINT8 pal1bit(UINT8 bits) { return palexpand<1>(bits); } -inline UINT8 pal2bit(UINT8 bits) { return palexpand<2>(bits); } -inline UINT8 pal3bit(UINT8 bits) { return palexpand<3>(bits); } -inline UINT8 pal4bit(UINT8 bits) { return palexpand<4>(bits); } -inline UINT8 pal5bit(UINT8 bits) { return palexpand<5>(bits); } -inline UINT8 pal6bit(UINT8 bits) { return palexpand<6>(bits); } -inline UINT8 pal7bit(UINT8 bits) { return palexpand<7>(bits); } +inline uint8_t pal1bit(uint8_t bits) { return palexpand<1>(bits); } +inline uint8_t pal2bit(uint8_t bits) { return palexpand<2>(bits); } +inline uint8_t pal3bit(uint8_t bits) { return palexpand<3>(bits); } +inline uint8_t pal4bit(uint8_t bits) { return palexpand<4>(bits); } +inline uint8_t pal5bit(uint8_t bits) { return palexpand<5>(bits); } +inline uint8_t pal6bit(uint8_t bits) { return palexpand<6>(bits); } +inline uint8_t pal7bit(uint8_t bits) { return palexpand<7>(bits); } //------------------------------------------------- @@ -259,7 +259,7 @@ inline UINT8 pal7bit(UINT8 bits) { return palexpand<7>(bits); } //------------------------------------------------- template -inline rgb_t rgbexpand(UINT32 data, UINT8 rshift, UINT8 gshift, UINT8 bshift) +inline rgb_t rgbexpand(uint32_t data, uint8_t rshift, uint8_t gshift, uint8_t bshift) { return rgb_t(palexpand<_RBits>(data >> rshift), palexpand<_GBits>(data >> gshift), palexpand<_BBits>(data >> bshift)); } @@ -267,14 +267,14 @@ inline rgb_t rgbexpand(UINT32 data, UINT8 rshift, UINT8 gshift, UINT8 bshift) //------------------------------------------------- // palxxx - create an x-x-x color by extracting -// bits from a UINT32 +// bits from a uint32_t //------------------------------------------------- -inline rgb_t pal332(UINT32 data, UINT8 rshift, UINT8 gshift, UINT8 bshift) { return rgbexpand<3,3,2>(data, rshift, gshift, bshift); } -inline rgb_t pal444(UINT32 data, UINT8 rshift, UINT8 gshift, UINT8 bshift) { return rgbexpand<4,4,4>(data, rshift, gshift, bshift); } -inline rgb_t pal555(UINT32 data, UINT8 rshift, UINT8 gshift, UINT8 bshift) { return rgbexpand<5,5,5>(data, rshift, gshift, bshift); } -inline rgb_t pal565(UINT32 data, UINT8 rshift, UINT8 gshift, UINT8 bshift) { return rgbexpand<5,6,5>(data, rshift, gshift, bshift); } -inline rgb_t pal888(UINT32 data, UINT8 rshift, UINT8 gshift, UINT8 bshift) { return rgbexpand<8,8,8>(data, rshift, gshift, bshift); } +inline rgb_t pal332(uint32_t data, uint8_t rshift, uint8_t gshift, uint8_t bshift) { return rgbexpand<3,3,2>(data, rshift, gshift, bshift); } +inline rgb_t pal444(uint32_t data, uint8_t rshift, uint8_t gshift, uint8_t bshift) { return rgbexpand<4,4,4>(data, rshift, gshift, bshift); } +inline rgb_t pal555(uint32_t data, uint8_t rshift, uint8_t gshift, uint8_t bshift) { return rgbexpand<5,5,5>(data, rshift, gshift, bshift); } +inline rgb_t pal565(uint32_t data, uint8_t rshift, uint8_t gshift, uint8_t bshift) { return rgbexpand<5,6,5>(data, rshift, gshift, bshift); } +inline rgb_t pal888(uint32_t data, uint8_t rshift, uint8_t gshift, uint8_t bshift) { return rgbexpand<8,8,8>(data, rshift, gshift, bshift); } #endif // __PALETTE_H__ diff --git a/src/lib/util/plaparse.cpp b/src/lib/util/plaparse.cpp index 74bc8edcc69..d1e7c679f97 100644 --- a/src/lib/util/plaparse.cpp +++ b/src/lib/util/plaparse.cpp @@ -33,11 +33,11 @@ struct parse_info { - UINT32 inputs; /* number of input columns */ - UINT32 outputs; /* number of output columns */ - UINT32 terms; /* number of terms */ - UINT32 xorval[JED_MAX_FUSES/64]; /* output polarity */ - UINT32 xorptr; + uint32_t inputs; /* number of input columns */ + uint32_t outputs; /* number of output columns */ + uint32_t terms; /* number of terms */ + uint32_t xorval[JED_MAX_FUSES/64]; /* output polarity */ + uint32_t xorptr; }; @@ -61,9 +61,9 @@ static bool iscrlf(char c) character stream -------------------------------------------------*/ -static UINT32 suck_number(const UINT8 **src, const UINT8 *srcend) +static uint32_t suck_number(const uint8_t **src, const uint8_t *srcend) { - UINT32 value = 0; + uint32_t value = 0; // find first digit while (*src < srcend && !iscrlf(**src) && !isdigit(**src)) @@ -89,10 +89,10 @@ static UINT32 suck_number(const UINT8 **src, const UINT8 *srcend) process_terms - process input/output matrix -------------------------------------------------*/ -static bool process_terms(jed_data *data, const UINT8 **src, const UINT8 *srcend, parse_info *pinfo) +static bool process_terms(jed_data *data, const uint8_t **src, const uint8_t *srcend, parse_info *pinfo) { - UINT32 curinput = 0; - UINT32 curoutput = 0; + uint32_t curinput = 0; + uint32_t curoutput = 0; bool outputs = false; // symbols for 0, 1, dont_care, no_meaning @@ -195,7 +195,7 @@ static bool process_terms(jed_data *data, const UINT8 **src, const UINT8 *srcend process_field - process a single field -------------------------------------------------*/ -static bool process_field(jed_data *data, const UINT8 **src, const UINT8 *srcend, parse_info *pinfo) +static bool process_field(jed_data *data, const uint8_t **src, const uint8_t *srcend, parse_info *pinfo) { // valid keywords static const char *const keywords[] = { "i", "o", "p", "phase", "e", "\0" }; @@ -213,7 +213,7 @@ static bool process_field(jed_data *data, const UINT8 **src, const UINT8 *srcend // find keyword char dest[0x10]; memset(dest, 0, ARRAY_LENGTH(dest)); - const UINT8 *seek = *src; + const uint8_t *seek = *src; int destptr = 0; while (seek < srcend && isalpha(*seek) && destptr < ARRAY_LENGTH(dest) - 1) @@ -223,7 +223,7 @@ static bool process_field(jed_data *data, const UINT8 **src, const UINT8 *srcend destptr++; } - UINT8 find = 0; + uint8_t find = 0; while (strlen(keywords[find]) && strcmp(dest, keywords[find])) find++; @@ -308,8 +308,8 @@ static bool process_field(jed_data *data, const UINT8 **src, const UINT8 *srcend int pla_parse(const void *data, size_t length, jed_data *result) { - const UINT8 *src = (const UINT8 *)data; - const UINT8 *srcend = src + length; + const uint8_t *src = (const uint8_t *)data; + const uint8_t *srcend = src + length; parse_info pinfo; memset(&pinfo, 0, sizeof(pinfo)); diff --git a/src/lib/util/png.cpp b/src/lib/util/png.cpp index 11c0bb4db7b..d1189d5ffc2 100644 --- a/src/lib/util/png.cpp +++ b/src/lib/util/png.cpp @@ -26,7 +26,7 @@ struct image_data_chunk { image_data_chunk * next; int length; - UINT8 * data; + uint8_t * data; }; @@ -35,8 +35,8 @@ struct png_private png_info * pnginfo; image_data_chunk * idata; image_data_chunk ** idata_next; - UINT8 bpp; - UINT32 rowbytes; + uint8_t bpp; + uint32_t rowbytes; }; @@ -53,41 +53,41 @@ static const int samples[] = { 1, 0, 3, 1, 2, 0, 4 }; INLINE FUNCTIONS ***************************************************************************/ -static inline UINT8 fetch_8bit(UINT8 *v) +static inline uint8_t fetch_8bit(uint8_t *v) { return *v; } #ifdef UNUSED_FUNCTION -static inline UINT16 fetch_16bit(UINT8 *v) +static inline uint16_t fetch_16bit(uint8_t *v) { - return big_endianize_int16(*(UINT16 *)v); + return big_endianize_int16(*(uint16_t *)v); } #endif -static inline UINT32 fetch_32bit(UINT8 *v) +static inline uint32_t fetch_32bit(uint8_t *v) { - return big_endianize_int32(*(UINT32 *)v); + return big_endianize_int32(*(uint32_t *)v); } -static inline void put_8bit(UINT8 *v, UINT8 data) +static inline void put_8bit(uint8_t *v, uint8_t data) { *v = data; } #ifdef UNUSED_FUNCTION -static inline void put_16bit(UINT8 *v, UINT16 data) +static inline void put_16bit(uint8_t *v, uint16_t data) { - *(UINT16 *)v = big_endianize_int16(data); + *(uint16_t *)v = big_endianize_int16(data); } #endif -static inline void put_32bit(UINT8 *v, UINT32 data) +static inline void put_32bit(uint8_t *v, uint32_t data) { - *(UINT32 *)v = big_endianize_int32(data); + *(uint32_t *)v = big_endianize_int32(data); } @@ -150,7 +150,7 @@ void png_free(png_info *pnginfo) static png_error verify_header(util::core_file &fp) { - UINT8 signature[8]; + uint8_t signature[8]; /* read 8 bytes */ if (fp.read(signature, 8) != 8) @@ -168,10 +168,10 @@ static png_error verify_header(util::core_file &fp) read_chunk - read the next PNG chunk -------------------------------------------------*/ -static png_error read_chunk(util::core_file &fp, UINT8 **data, UINT32 *type, UINT32 *length) +static png_error read_chunk(util::core_file &fp, uint8_t **data, uint32_t *type, uint32_t *length) { - UINT32 crc, chunk_crc; - UINT8 tempbuff[4]; + uint32_t crc, chunk_crc; + uint8_t tempbuff[4]; /* fetch the length of this chunk */ if (fp.read(tempbuff, 4) != 4) @@ -195,7 +195,7 @@ static png_error read_chunk(util::core_file &fp, UINT8 **data, UINT32 *type, UIN if (*length != 0) { /* allocate memory for this chunk */ - *data = (UINT8 *)malloc(*length); + *data = (uint8_t *)malloc(*length); if (*data == nullptr) return PNGERR_OUT_OF_MEMORY; @@ -235,7 +235,7 @@ static png_error read_chunk(util::core_file &fp, UINT8 **data, UINT32 *type, UIN process_chunk - process a PNG chunk -------------------------------------------------*/ -static png_error process_chunk(png_private *png, UINT8 *data, UINT32 type, UINT32 length, int *keepmem) +static png_error process_chunk(png_private *png, uint8_t *data, uint32_t type, uint32_t length, int *keepmem) { /* default to not keeping memory */ *keepmem = FALSE; @@ -336,7 +336,7 @@ static png_error process_chunk(png_private *png, UINT8 *data, UINT32 type, UINT3 unfilter_row - unfilter a single row of pixels -------------------------------------------------*/ -static png_error unfilter_row(int type, UINT8 *src, UINT8 *dst, UINT8 *dstprev, int bpp, int rowbytes) +static png_error unfilter_row(int type, uint8_t *src, uint8_t *dst, uint8_t *dstprev, int bpp, int rowbytes) { int x; @@ -387,13 +387,13 @@ static png_error unfilter_row(int type, UINT8 *src, UINT8 *dst, UINT8 *dstprev, case PNG_PF_Paeth: for (x = 0; x < rowbytes; x++) { - INT32 pa = (x < bpp) ? 0 : dst[-bpp]; - INT32 pc = (x < bpp || dstprev == nullptr) ? 0 : dstprev[-bpp]; - INT32 pb = (dstprev == nullptr) ? 0 : *dstprev++; - INT32 prediction = pa + pb - pc; - INT32 da = abs(prediction - pa); - INT32 db = abs(prediction - pb); - INT32 dc = abs(prediction - pc); + int32_t pa = (x < bpp) ? 0 : dst[-bpp]; + int32_t pc = (x < bpp || dstprev == nullptr) ? 0 : dstprev[-bpp]; + int32_t pb = (dstprev == nullptr) ? 0 : *dstprev++; + int32_t prediction = pa + pb - pc; + int32_t da = abs(prediction - pa); + int32_t db = abs(prediction - pb); + int32_t dc = abs(prediction - pc); if (da <= db && da <= dc) *dst++ = *src++ + pa; else if (db <= dc) @@ -421,7 +421,7 @@ static png_error process_image(png_private *png) int rowbytes, bpp, imagesize; png_error error = PNGERR_NONE; image_data_chunk *idat; - UINT8 *src, *dst; + uint8_t *src, *dst; z_stream stream; int zerr, y; @@ -431,7 +431,7 @@ static png_error process_image(png_private *png) imagesize = png->pnginfo->height * (rowbytes + 1); /* allocate memory for the filtered image */ - png->pnginfo->image = (UINT8 *)malloc(imagesize); + png->pnginfo->image = (uint8_t *)malloc(imagesize); if (png->pnginfo->image == nullptr) return PNGERR_OUT_OF_MEMORY; @@ -504,7 +504,7 @@ handle_error: png_error png_read_file(util::core_file &fp, png_info *pnginfo) { - UINT8 *chunk_data = nullptr; + uint8_t *chunk_data = nullptr; png_private png; png_error error; @@ -522,7 +522,7 @@ png_error png_read_file(util::core_file &fp, png_info *pnginfo) /* loop until we hit an IEND chunk */ for ( ; ; ) { - UINT32 chunk_type, chunk_length; + uint32_t chunk_type, chunk_length; int keepmem; /* read a chunk */ @@ -583,7 +583,7 @@ png_error png_read_bitmap(util::core_file &fp, bitmap_argb32 &bitmap) { png_error result; png_info png; - UINT8 *src; + uint8_t *src; int x, y; /* read the PNG data */ @@ -614,7 +614,7 @@ png_error png_read_bitmap(util::core_file &fp, bitmap_argb32 &bitmap) for (x = 0; x < png.width; x++, src++) { /* determine alpha and expand to 32bpp */ - UINT8 alpha = (*src < png.num_trans) ? png.trans[*src] : 0xff; + uint8_t alpha = (*src < png.num_trans) ? png.trans[*src] : 0xff; bitmap.pix32(y, x) = (alpha << 24) | (png.palette[*src * 3] << 16) | (png.palette[*src * 3 + 1] << 8) | png.palette[*src * 3 + 2]; } } @@ -657,14 +657,14 @@ png_error png_read_bitmap(util::core_file &fp, bitmap_argb32 &bitmap) png_error png_expand_buffer_8bit(png_info *pnginfo) { int i,j, k; - UINT8 *inp, *outp, *outbuf; + uint8_t *inp, *outp, *outbuf; /* nothing to do if we're at 8 or greater already */ if (pnginfo->bit_depth >= 8) return PNGERR_NONE; /* allocate a new buffer at 8-bit */ - outbuf = (UINT8 *)malloc(pnginfo->width * pnginfo->height); + outbuf = (uint8_t *)malloc(pnginfo->width * pnginfo->height); if (outbuf == nullptr) return PNGERR_OUT_OF_MEMORY; @@ -747,10 +747,10 @@ png_error png_add_text(png_info *pnginfo, const char *keyword, const char *text) the given file -------------------------------------------------*/ -static png_error write_chunk(util::core_file &fp, const UINT8 *data, UINT32 type, UINT32 length) +static png_error write_chunk(util::core_file &fp, const uint8_t *data, uint32_t type, uint32_t length) { - UINT8 tempbuff[8]; - UINT32 crc; + uint8_t tempbuff[8]; + uint32_t crc; /* stuff the length/type into the buffer */ put_32bit(tempbuff + 0, length); @@ -783,13 +783,13 @@ static png_error write_chunk(util::core_file &fp, const UINT8 *data, UINT32 type chunk to the given file by deflating it -------------------------------------------------*/ -static png_error write_deflated_chunk(util::core_file &fp, UINT8 *data, UINT32 type, UINT32 length) +static png_error write_deflated_chunk(util::core_file &fp, uint8_t *data, uint32_t type, uint32_t length) { - UINT64 lengthpos = fp.tell(); - UINT8 tempbuff[8192]; - UINT32 zlength = 0; + uint64_t lengthpos = fp.tell(); + uint8_t tempbuff[8192]; + uint32_t zlength = 0; z_stream stream; - UINT32 crc; + uint32_t crc; int zerr; /* stuff the length/type into the buffer */ @@ -883,7 +883,7 @@ static png_error convert_bitmap_to_image_palette(png_info *pnginfo, const bitmap rowbytes = pnginfo->width; /* allocate memory for the palette */ - pnginfo->palette = (UINT8 *)malloc(3 * 256); + pnginfo->palette = (uint8_t *)malloc(3 * 256); if (pnginfo->palette == nullptr) return PNGERR_OUT_OF_MEMORY; @@ -898,7 +898,7 @@ static png_error convert_bitmap_to_image_palette(png_info *pnginfo, const bitmap } /* allocate memory for the image */ - pnginfo->image = (UINT8 *)malloc(pnginfo->height * (rowbytes + 1)); + pnginfo->image = (uint8_t *)malloc(pnginfo->height * (rowbytes + 1)); if (pnginfo->image == nullptr) { free(pnginfo->palette); @@ -908,8 +908,8 @@ static png_error convert_bitmap_to_image_palette(png_info *pnginfo, const bitmap /* copy in the pixels, specifying a nullptr filter */ for (y = 0; y < pnginfo->height; y++) { - UINT16 *src = reinterpret_cast(bitmap.raw_pixptr(y)); - UINT8 *dst = pnginfo->image + y * (rowbytes + 1); + uint16_t *src = reinterpret_cast(bitmap.raw_pixptr(y)); + uint8_t *dst = pnginfo->image + y * (rowbytes + 1); /* store the filter byte, then copy the data */ *dst++ = 0; @@ -940,14 +940,14 @@ static png_error convert_bitmap_to_image_rgb(png_info *pnginfo, const bitmap_t & rowbytes = pnginfo->width * (alpha ? 4 : 3); /* allocate memory for the image */ - pnginfo->image = (UINT8 *)malloc(pnginfo->height * (rowbytes + 1)); + pnginfo->image = (uint8_t *)malloc(pnginfo->height * (rowbytes + 1)); if (pnginfo->image == nullptr) return PNGERR_OUT_OF_MEMORY; /* copy in the pixels, specifying a nullptr filter */ for (y = 0; y < pnginfo->height; y++) { - UINT8 *dst = pnginfo->image + y * (rowbytes + 1); + uint8_t *dst = pnginfo->image + y * (rowbytes + 1); /* store the filter byte, then copy the data */ *dst++ = 0; @@ -955,7 +955,7 @@ static png_error convert_bitmap_to_image_rgb(png_info *pnginfo, const bitmap_t & /* 16bpp palettized format */ if (bitmap.format() == BITMAP_FORMAT_IND16) { - UINT16 *src16 = reinterpret_cast(bitmap.raw_pixptr(y)); + uint16_t *src16 = reinterpret_cast(bitmap.raw_pixptr(y)); for (x = 0; x < pnginfo->width; x++) { rgb_t color = palette[*src16++]; @@ -968,7 +968,7 @@ static png_error convert_bitmap_to_image_rgb(png_info *pnginfo, const bitmap_t & /* 32-bit RGB direct */ else if (bitmap.format() == BITMAP_FORMAT_RGB32) { - UINT32 *src32 = reinterpret_cast(bitmap.raw_pixptr(y)); + uint32_t *src32 = reinterpret_cast(bitmap.raw_pixptr(y)); for (x = 0; x < pnginfo->width; x++) { rgb_t raw = *src32++; @@ -981,7 +981,7 @@ static png_error convert_bitmap_to_image_rgb(png_info *pnginfo, const bitmap_t & /* 32-bit ARGB direct */ else if (bitmap.format() == BITMAP_FORMAT_ARGB32) { - UINT32 *src32 = reinterpret_cast(bitmap.raw_pixptr(y)); + uint32_t *src32 = reinterpret_cast(bitmap.raw_pixptr(y)); for (x = 0; x < pnginfo->width; x++) { rgb_t raw = *src32++; @@ -1008,7 +1008,7 @@ static png_error convert_bitmap_to_image_rgb(png_info *pnginfo, const bitmap_t & static png_error write_png_stream(util::core_file &fp, png_info *pnginfo, const bitmap_t &bitmap, int palette_length, const rgb_t *palette) { - UINT8 tempbuff[16]; + uint8_t tempbuff[16]; png_text *text; png_error error; @@ -1048,7 +1048,7 @@ static png_error write_png_stream(util::core_file &fp, png_info *pnginfo, const /* write TEXT chunks */ for (text = pnginfo->textlist; text != nullptr; text = text->next) { - error = write_chunk(fp, (UINT8 *)text->keyword, PNG_CN_tEXt, (UINT32)strlen(text->keyword) + 1 + (UINT32)strlen(text->text)); + error = write_chunk(fp, (uint8_t *)text->keyword, PNG_CN_tEXt, (uint32_t)strlen(text->keyword) + 1 + (uint32_t)strlen(text->text)); if (error != PNGERR_NONE) goto handle_error; } @@ -1110,7 +1110,7 @@ png_error png_write_bitmap(util::core_file &fp, png_info *info, bitmap_t &bitmap png_error mng_capture_start(util::core_file &fp, bitmap_t &bitmap, double rate) { - UINT8 mhdr[28]; + uint8_t mhdr[28]; png_error error; if (fp.write(MNG_Signature, 8) != 8) diff --git a/src/lib/util/png.h b/src/lib/util/png.h index 00522f12f5c..ed74fc6fc8f 100644 --- a/src/lib/util/png.h +++ b/src/lib/util/png.h @@ -89,24 +89,24 @@ struct png_text struct png_info { - UINT8 * image; - UINT32 width, height; - UINT32 xres, yres; + uint8_t * image; + uint32_t width, height; + uint32_t xres, yres; rectangle screen; double xscale, yscale; double source_gamma; - UINT32 resolution_unit; - UINT8 bit_depth; - UINT8 color_type; - UINT8 compression_method; - UINT8 filter_method; - UINT8 interlace_method; - - UINT8 * palette; - UINT32 num_palette; - - UINT8 * trans; - UINT32 num_trans; + uint32_t resolution_unit; + uint8_t bit_depth; + uint8_t color_type; + uint8_t compression_method; + uint8_t filter_method; + uint8_t interlace_method; + + uint8_t * palette; + uint32_t num_palette; + + uint8_t * trans; + uint32_t num_trans; png_text * textlist; }; diff --git a/src/lib/util/pool.cpp b/src/lib/util/pool.cpp index f1f42bb58bf..1acb8d0d6e6 100644 --- a/src/lib/util/pool.cpp +++ b/src/lib/util/pool.cpp @@ -32,7 +32,7 @@ struct objtype_entry { objtype_entry * next; - UINT32 type; + uint32_t type; const char * friendly; void (*destructor)(void *, size_t); }; diff --git a/src/lib/util/pool.h b/src/lib/util/pool.h index 341d57a6626..a43dacd87b2 100644 --- a/src/lib/util/pool.h +++ b/src/lib/util/pool.h @@ -37,7 +37,7 @@ ***************************************************************************/ /* pool types are UINT32s */ -typedef UINT32 object_type; +typedef uint32_t object_type; /* opaque type representing a pool of objects */ struct object_pool; diff --git a/src/lib/util/sha1.cpp b/src/lib/util/sha1.cpp index 700c691622e..f1f00a60310 100644 --- a/src/lib/util/sha1.cpp +++ b/src/lib/util/sha1.cpp @@ -31,15 +31,15 @@ #include #include -static unsigned int READ_UINT32(const UINT8* data) +static unsigned int READ_UINT32(const uint8_t* data) { - return ((UINT32)data[0] << 24) | - ((UINT32)data[1] << 16) | - ((UINT32)data[2] << 8) | - ((UINT32)data[3]); + return ((uint32_t)data[0] << 24) | + ((uint32_t)data[1] << 16) | + ((uint32_t)data[2] << 8) | + ((uint32_t)data[3]); } -static void WRITE_UINT32(unsigned char* data, UINT32 val) +static void WRITE_UINT32(unsigned char* data, uint32_t val) { data[0] = (val >> 24) & 0xFF; data[1] = (val >> 16) & 0xFF; @@ -154,7 +154,7 @@ sha1_init(struct sha1_ctx *ctx) Note that this function destroys the data area */ /** - * @fn static void sha1_transform(UINT32 *state, UINT32 *data) + * @fn static void sha1_transform(uint32_t *state, uint32_t *data) * * @brief Sha 1 transform. * @@ -163,9 +163,9 @@ sha1_init(struct sha1_ctx *ctx) */ static void -sha1_transform(UINT32 *state, UINT32 *data) +sha1_transform(uint32_t *state, uint32_t *data) { - UINT32 A, B, C, D, E; /* Local vars */ + uint32_t A, B, C, D, E; /* Local vars */ /* Set up first buffer and local data buffer */ A = state[0]; @@ -268,7 +268,7 @@ sha1_transform(UINT32 *state, UINT32 *data) } /** - * @fn static void sha1_block(struct sha1_ctx *ctx, const UINT8 *block) + * @fn static void sha1_block(struct sha1_ctx *ctx, const uint8_t *block) * * @brief Sha 1 block. * @@ -277,9 +277,9 @@ sha1_transform(UINT32 *state, UINT32 *data) */ static void -sha1_block(struct sha1_ctx *ctx, const UINT8 *block) +sha1_block(struct sha1_ctx *ctx, const uint8_t *block) { - UINT32 data[SHA1_DATA_LENGTH]; + uint32_t data[SHA1_DATA_LENGTH]; int i; /* Update block count */ @@ -294,7 +294,7 @@ sha1_block(struct sha1_ctx *ctx, const UINT8 *block) } /** - * @fn void sha1_update(struct sha1_ctx *ctx, unsigned length, const UINT8 *buffer) + * @fn void sha1_update(struct sha1_ctx *ctx, unsigned length, const uint8_t *buffer) * * @brief Sha 1 update. * @@ -305,7 +305,7 @@ sha1_block(struct sha1_ctx *ctx, const UINT8 *block) void sha1_update(struct sha1_ctx *ctx, - unsigned length, const UINT8 *buffer) + unsigned length, const uint8_t *buffer) { if (ctx->index) { /* Try to fill partial block */ @@ -350,7 +350,7 @@ sha1_update(struct sha1_ctx *ctx, void sha1_final(struct sha1_ctx *ctx) { - UINT32 data[SHA1_DATA_LENGTH]; + uint32_t data[SHA1_DATA_LENGTH]; int i; int words; @@ -391,7 +391,7 @@ sha1_final(struct sha1_ctx *ctx) } /** - * @fn void sha1_digest(const struct sha1_ctx *ctx, unsigned length, UINT8 *digest) + * @fn void sha1_digest(const struct sha1_ctx *ctx, unsigned length, uint8_t *digest) * * @brief Sha 1 digest. * @@ -403,7 +403,7 @@ sha1_final(struct sha1_ctx *ctx) void sha1_digest(const struct sha1_ctx *ctx, unsigned length, - UINT8 *digest) + uint8_t *digest) { unsigned i; unsigned words; @@ -419,7 +419,7 @@ sha1_digest(const struct sha1_ctx *ctx, if (leftover) { - UINT32 word; + uint32_t word; unsigned j = leftover; assert(i < _SHA1_DIGEST_LENGTH); diff --git a/src/lib/util/sha1.h b/src/lib/util/sha1.h index ba5866c5819..177caf9f6dc 100644 --- a/src/lib/util/sha1.h +++ b/src/lib/util/sha1.h @@ -38,9 +38,9 @@ struct sha1_ctx { - UINT32 digest[_SHA1_DIGEST_LENGTH]; /* Message digest */ - UINT32 count_low, count_high; /* 64-bit block count */ - UINT8 block[SHA1_DATA_SIZE]; /* SHA1 data buffer */ + uint32_t digest[_SHA1_DIGEST_LENGTH]; /* Message digest */ + uint32_t count_low, count_high; /* 64-bit block count */ + uint8_t block[SHA1_DATA_SIZE]; /* SHA1 data buffer */ unsigned int index; /* index into buffer */ }; @@ -50,7 +50,7 @@ sha1_init(struct sha1_ctx *ctx); void sha1_update(struct sha1_ctx *ctx, unsigned length, - const UINT8 *data); + const uint8_t *data); void sha1_final(struct sha1_ctx *ctx); @@ -58,6 +58,6 @@ sha1_final(struct sha1_ctx *ctx); void sha1_digest(const struct sha1_ctx *ctx, unsigned length, - UINT8 *digest); + uint8_t *digest); #endif /* NETTLE_SHA1_H_INCLUDED */ diff --git a/src/lib/util/vbiparse.cpp b/src/lib/util/vbiparse.cpp index 854b5fbd384..42249ab6794 100644 --- a/src/lib/util/vbiparse.cpp +++ b/src/lib/util/vbiparse.cpp @@ -40,10 +40,10 @@ code from a line of video data -------------------------------------------------*/ -int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sourceshift, int expectedbits, UINT32 *result) +int vbi_parse_manchester_code(const uint16_t *source, int sourcewidth, int sourceshift, int expectedbits, uint32_t *result) { - UINT8 srcabs[MAX_SOURCE_WIDTH]; - UINT8 min, max, mid, srcabsval; + uint8_t srcabs[MAX_SOURCE_WIDTH]; + uint8_t min, max, mid, srcabsval; double clock, bestclock; int x, firstedge; int besterr; @@ -57,7 +57,7 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources max = 0x00; for (x = 0; x < sourcewidth; x++) { - UINT8 rawsrc = source[x] >> sourceshift; + uint8_t rawsrc = source[x] >> sourceshift; min = std::min(min, rawsrc); max = std::max(max, rawsrc); } @@ -75,7 +75,7 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources srcabsval = (source[0] > mid); for (x = 0; x < sourcewidth; x++) { - UINT8 rawsrc = source[x] >> sourceshift; + uint8_t rawsrc = source[x] >> sourceshift; if (rawsrc >= max) srcabsval = 1; else if (rawsrc <= min) @@ -147,13 +147,13 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources /* compute left and right average values */ leftavg = 0; for (tx = leftstart; tx <= leftend; tx++) - leftavg += (UINT8)(source[tx] >> sourceshift) - mid; + leftavg += (uint8_t)(source[tx] >> sourceshift) - mid; leftabs = (leftavg >= 0); leftavg = (leftavg < 0) ? -leftavg : leftavg; rightavg = 0; for (tx = rightstart; tx <= rightend; tx++) - rightavg += (UINT8)(source[tx] >> sourceshift) - mid; + rightavg += (uint8_t)(source[tx] >> sourceshift) - mid; rightabs = (rightavg >= 0); rightavg = (rightavg < 0) ? -rightavg : rightavg; @@ -174,7 +174,7 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources flag" from a line of video data -------------------------------------------------*/ -int vbi_parse_white_flag(const UINT16 *source, int sourcewidth, int sourceshift) +int vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshift) { int histo[256] = { 0 }; int minval = 0xff; @@ -187,7 +187,7 @@ int vbi_parse_white_flag(const UINT16 *source, int sourcewidth, int sourceshift) /* compute a histogram of values */ for (x = 0; x < sourcewidth; x++) { - UINT8 yval = source[x] >> sourceshift; + uint8_t yval = source[x] >> sourceshift; histo[yval]++; } @@ -261,7 +261,7 @@ int vbi_parse_white_flag(const UINT16 *source, int sourcewidth, int sourceshift) thresh = minval + 3 * (maxval - minval) / 4; for (x = 0; x < sourcewidth; x++) { - UINT8 yval = source[x] >> sourceshift; + uint8_t yval = source[x] >> sourceshift; above += (yval >= thresh); } /* if at least 80% of the pixels are above the threshold, we'll call it white */ @@ -277,7 +277,7 @@ int vbi_parse_white_flag(const UINT16 *source, int sourcewidth, int sourceshift) -------------------------------------------------*/ /** - * @fn void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi) + * @fn void vbi_parse_all(const uint16_t *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi) * * @brief Vbi parse all. * @@ -288,10 +288,10 @@ int vbi_parse_white_flag(const UINT16 *source, int sourcewidth, int sourceshift) * @param [in,out] vbi If non-null, the vbi. */ -void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi) +void vbi_parse_all(const uint16_t *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi) { - UINT32 bits[2][24]; - UINT8 bitnum; + uint32_t bits[2][24]; + uint8_t bitnum; /* first reset it all */ memset(vbi, 0, sizeof(*vbi)); @@ -351,7 +351,7 @@ void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, i -------------------------------------------------*/ /** - * @fn void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi) + * @fn void vbi_metadata_pack(uint8_t *dest, uint32_t framenum, const vbi_metadata *vbi) * * @brief Vbi metadata pack. * @@ -360,7 +360,7 @@ void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, i * @param vbi The vbi. */ -void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi) +void vbi_metadata_pack(uint8_t *dest, uint32_t framenum, const vbi_metadata *vbi) { dest[0] = framenum >> 16; dest[1] = framenum >> 8; @@ -387,7 +387,7 @@ void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi) -------------------------------------------------*/ /** - * @fn void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source) + * @fn void vbi_metadata_unpack(vbi_metadata *vbi, uint32_t *framenum, const uint8_t *source) * * @brief Vbi metadata unpack. * @@ -396,7 +396,7 @@ void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi) * @param source Source for the. */ -void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source) +void vbi_metadata_unpack(vbi_metadata *vbi, uint32_t *framenum, const uint8_t *source) { if (framenum != nullptr) *framenum = (source[0] << 16) | (source[1] << 8) | source[2]; diff --git a/src/lib/util/vbiparse.h b/src/lib/util/vbiparse.h index 687f984622c..ed67a3fee9f 100644 --- a/src/lib/util/vbiparse.h +++ b/src/lib/util/vbiparse.h @@ -61,11 +61,11 @@ struct vbi_metadata { - UINT8 white; /* white flag: on or off */ - UINT32 line16; /* line 16 code */ - UINT32 line17; /* line 17 code */ - UINT32 line18; /* line 18 code */ - UINT32 line1718; /* most plausible value from lines 17/18 */ + uint8_t white; /* white flag: on or off */ + uint32_t line16; /* line 16 code */ + uint32_t line17; /* line 17 code */ + uint32_t line18; /* line 18 code */ + uint32_t line1718; /* most plausible value from lines 17/18 */ }; @@ -75,19 +75,19 @@ struct vbi_metadata ***************************************************************************/ /* parse a Manchester code from a line of video data */ -int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sourceshift, int expectedbits, UINT32 *result); +int vbi_parse_manchester_code(const uint16_t *source, int sourcewidth, int sourceshift, int expectedbits, uint32_t *result); /* compute the "white flag" from a line of video data */ -int vbi_parse_white_flag(const UINT16 *source, int sourcewidth, int sourceshift); +int vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshift); /* parse everything from a video frame */ -void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi); +void vbi_parse_all(const uint16_t *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi); /* pack the VBI data down into a smaller form for storage */ -void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi); +void vbi_metadata_pack(uint8_t *dest, uint32_t framenum, const vbi_metadata *vbi); /* unpack the VBI data from a smaller form into the full structure */ -void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source); +void vbi_metadata_unpack(vbi_metadata *vbi, uint32_t *framenum, const uint8_t *source); #endif /* __VBIPARSE_H__ */ diff --git a/src/lib/util/wavwrite.cpp b/src/lib/util/wavwrite.cpp index d052287216d..0667e9dcaff 100644 --- a/src/lib/util/wavwrite.cpp +++ b/src/lib/util/wavwrite.cpp @@ -8,16 +8,16 @@ struct wav_file { FILE *file; - UINT32 total_offs; - UINT32 data_offs; + uint32_t total_offs; + uint32_t data_offs; }; wav_file *wav_open(const char *filename, int sample_rate, int channels) { wav_file *wav; - UINT32 bps, temp32; - UINT16 align, temp16; + uint32_t bps, temp32; + uint16_t align, temp16; /* allocate memory for the wav struct */ wav = global_alloc_nothrow(wav_file); @@ -90,8 +90,8 @@ wav_file *wav_open(const char *filename, int sample_rate, int channels) void wav_close(wav_file *wav) { - UINT32 total; - UINT32 temp32; + uint32_t total; + uint32_t temp32; if (!wav) return; @@ -114,7 +114,7 @@ void wav_close(wav_file *wav) } -void wav_add_data_16(wav_file *wav, INT16 *data, int samples) +void wav_add_data_16(wav_file *wav, int16_t *data, int samples) { if (!wav) return; @@ -124,9 +124,9 @@ void wav_add_data_16(wav_file *wav, INT16 *data, int samples) } -void wav_add_data_32(wav_file *wav, INT32 *data, int samples, int shift) +void wav_add_data_32(wav_file *wav, int32_t *data, int samples, int shift) { - std::vector temp; + std::vector temp; int i; if (!wav || !samples) return; @@ -147,9 +147,9 @@ void wav_add_data_32(wav_file *wav, INT32 *data, int samples, int shift) } -void wav_add_data_16lr(wav_file *wav, INT16 *left, INT16 *right, int samples) +void wav_add_data_16lr(wav_file *wav, int16_t *left, int16_t *right, int samples) { - std::vector temp; + std::vector temp; int i; if (!wav || !samples) return; @@ -167,9 +167,9 @@ void wav_add_data_16lr(wav_file *wav, INT16 *left, INT16 *right, int samples) } -void wav_add_data_32lr(wav_file *wav, INT32 *left, INT32 *right, int samples, int shift) +void wav_add_data_32lr(wav_file *wav, int32_t *left, int32_t *right, int samples, int shift) { - std::vector temp; + std::vector temp; int i; if (!wav || !samples) return; diff --git a/src/lib/util/wavwrite.h b/src/lib/util/wavwrite.h index 376856fb16f..da94a9d3782 100644 --- a/src/lib/util/wavwrite.h +++ b/src/lib/util/wavwrite.h @@ -10,9 +10,9 @@ struct wav_file; wav_file *wav_open(const char *filename, int sample_rate, int channels); void wav_close(wav_file*wavptr); -void wav_add_data_16(wav_file *wavptr, INT16 *data, int samples); -void wav_add_data_32(wav_file *wavptr, INT32 *data, int samples, int shift); -void wav_add_data_16lr(wav_file *wavptr, INT16 *left, INT16 *right, int samples); -void wav_add_data_32lr(wav_file *wavptr, INT32 *left, INT32 *right, int samples, int shift); +void wav_add_data_16(wav_file *wavptr, int16_t *data, int samples); +void wav_add_data_32(wav_file *wavptr, int32_t *data, int samples, int shift); +void wav_add_data_16lr(wav_file *wavptr, int16_t *left, int16_t *right, int samples); +void wav_add_data_32lr(wav_file *wavptr, int32_t *left, int32_t *right, int samples, int shift); #endif /* __WAVWRITE_H__ */ diff --git a/src/lib/util/xmlfile.cpp b/src/lib/util/xmlfile.cpp index b1ed844dc71..98689283c4e 100644 --- a/src/lib/util/xmlfile.cpp +++ b/src/lib/util/xmlfile.cpp @@ -32,7 +32,7 @@ struct xml_parse_info XML_Parser parser; xml_data_node * rootnode; xml_data_node * curnode; - UINT32 flags; + uint32_t flags; }; @@ -103,7 +103,7 @@ static const char *copystring_lower(const char *input) if (newstr != nullptr) { for (i = 0; input[i] != 0; i++) - newstr[i] = tolower((UINT8)input[i]); + newstr[i] = tolower((uint8_t)input[i]); newstr[i] = 0; } @@ -635,7 +635,7 @@ const char *xml_normalize_string(const char *string) static void *expat_malloc(size_t size) { - UINT32 *result = (UINT32 *)malloc(size + 4 * sizeof(UINT32)); + uint32_t *result = (uint32_t *)malloc(size + 4 * sizeof(uint32_t)); *result = size; return &result[4]; } @@ -651,7 +651,7 @@ static void *expat_malloc(size_t size) static void expat_free(void *ptr) { if (ptr != nullptr) - free(&((UINT32 *)ptr)[-4]); + free(&((uint32_t *)ptr)[-4]); } /** @@ -672,7 +672,7 @@ static void *expat_realloc(void *ptr, size_t size) return nullptr; if (ptr != nullptr) { - UINT32 oldsize = ((UINT32 *)ptr)[-4]; + uint32_t oldsize = ((uint32_t *)ptr)[-4]; memcpy(newptr, ptr, oldsize); expat_free(ptr); } @@ -856,11 +856,11 @@ static void expat_element_end(void *data, const XML_Char *name) char *end = start + strlen(start); /* first strip leading spaces */ - while (*start && isspace((UINT8)*start)) + while (*start && isspace((uint8_t)*start)) start++; /* then strip trailing spaces */ - while (end > start && isspace((UINT8)end[-1])) + while (end > start && isspace((uint8_t)end[-1])) end--; /* if nothing left, just free it */ diff --git a/src/lib/util/xmlfile.h b/src/lib/util/xmlfile.h index e116366643f..eac3cdff4c2 100644 --- a/src/lib/util/xmlfile.h +++ b/src/lib/util/xmlfile.h @@ -81,7 +81,7 @@ struct xml_parse_options { xml_parse_error * error; void (*init_parser)(struct XML_ParserStruct *parser); - UINT32 flags; + uint32_t flags; }; diff --git a/src/lib/util/zippath.cpp b/src/lib/util/zippath.cpp index 1eb2eba9274..2ee9082a817 100644 --- a/src/lib/util/zippath.cpp +++ b/src/lib/util/zippath.cpp @@ -363,7 +363,7 @@ done: // ------------------------------------------------- /** - * @fn osd_file::error zippath_fopen(const std::string &filename, UINT32 openflags, util::core_file::ptr &file, std::string &revised_path) + * @fn osd_file::error zippath_fopen(const std::string &filename, uint32_t openflags, util::core_file::ptr &file, std::string &revised_path) * * @brief Zippath fopen. * @@ -375,7 +375,7 @@ done: * @return A osd_file::error. */ -osd_file::error zippath_fopen(const std::string &filename, UINT32 openflags, util::core_file::ptr &file, std::string &revised_path) +osd_file::error zippath_fopen(const std::string &filename, uint32_t openflags, util::core_file::ptr &file, std::string &revised_path) { osd_file::error filerr = osd_file::error::NOT_FOUND; archive_file::error ziperr; diff --git a/src/lib/util/zippath.h b/src/lib/util/zippath.h index 9c5b361b076..89656e6cf10 100644 --- a/src/lib/util/zippath.h +++ b/src/lib/util/zippath.h @@ -49,7 +49,7 @@ std::string zippath_combine(const std::string &path1, const std::string &path2); // ----- file operations ----- // opens a zip path file -osd_file::error zippath_fopen(const std::string &filename, UINT32 openflags, util::core_file::ptr &file, std::string &revised_path); +osd_file::error zippath_fopen(const std::string &filename, uint32_t openflags, util::core_file::ptr &file, std::string &revised_path); // ----- directory operations ----- */ diff --git a/src/mame/audio/8080bw.cpp b/src/mame/audio/8080bw.cpp index 41fd7160765..6b13793cd97 100644 --- a/src/mame/audio/8080bw.cpp +++ b/src/mame/audio/8080bw.cpp @@ -32,7 +32,7 @@ MACHINE_START_MEMBER(_8080bw_state,extra_8080bw_sh) WRITE8_MEMBER(_8080bw_state::invadpt2_sh_port_1_w) { - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; m_sn->enable_w(!(data & 0x01)); /* SAUCER SOUND */ @@ -57,7 +57,7 @@ WRITE8_MEMBER(_8080bw_state::invadpt2_sh_port_2_w) D2 = 82K D3 = 100K */ - UINT8 rising_bits = data & ~m_port_2_last_extra; + uint8_t rising_bits = data & ~m_port_2_last_extra; if (rising_bits & 0x01) m_samples->start(4, 3); /* FLEET */ if (rising_bits & 0x02) m_samples->start(4, 4); /* FLEET */ @@ -80,7 +80,7 @@ WRITE8_MEMBER(_8080bw_state::invadpt2_sh_port_2_w) WRITE8_MEMBER(_8080bw_state::spacerng_sh_port_2_w) { - UINT8 rising_bits = data & ~m_port_2_last_extra; + uint8_t rising_bits = data & ~m_port_2_last_extra; if (rising_bits & 0x01) m_samples->start(4, 3); /* FLEET */ if (rising_bits & 0x02) m_samples->start(4, 4); /* FLEET */ @@ -101,7 +101,7 @@ WRITE8_MEMBER(_8080bw_state::spacerng_sh_port_2_w) WRITE8_MEMBER(_8080bw_state::spcewars_sh_port_w) { - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; m_sn->enable_w(!(data & 0x01)); /* Saucer Sound */ @@ -139,7 +139,7 @@ const char *const lrescue_sample_names[] = WRITE8_MEMBER(_8080bw_state::lrescue_sh_port_1_w) { - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; if (rising_bits & 0x01) m_samples->start(0, 3); /* Thrust */ if (rising_bits & 0x02) m_samples->start(1, 2); /* Shot Sound */ @@ -156,7 +156,7 @@ WRITE8_MEMBER(_8080bw_state::lrescue_sh_port_1_w) WRITE8_MEMBER(_8080bw_state::lrescue_sh_port_2_w) { - UINT8 rising_bits = data & ~m_port_2_last_extra; + uint8_t rising_bits = data & ~m_port_2_last_extra; if (rising_bits & 0x01) m_samples->start(1, 8); /* Footstep high tone */ if (rising_bits & 0x02) m_samples->start(1, 7); /* Footstep low tone */ @@ -246,7 +246,7 @@ WRITE8_MEMBER( _8080bw_state::ballbomb_01_w ) WRITE8_MEMBER(_8080bw_state::ballbomb_sh_port_1_w) { - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; if (rising_bits & 0x01) m_samples->start(1, 2); /* Hit a balloon */ if (rising_bits & 0x02) m_samples->start(2, 0); /* Shot Sound */ @@ -263,7 +263,7 @@ WRITE8_MEMBER(_8080bw_state::ballbomb_sh_port_1_w) WRITE8_MEMBER(_8080bw_state::ballbomb_sh_port_2_w) { - UINT8 rising_bits = data & ~m_port_2_last_extra; + uint8_t rising_bits = data & ~m_port_2_last_extra; if (data & 0x01) m_samples->start(0, 7); /* Indicates plane will drop bombs */ if (data & 0x04) m_samples->start(0, 4); /* Plane is dropping new balloons at start of level */ @@ -322,7 +322,7 @@ DISCRETE_SOUND_END WRITE8_MEMBER(_8080bw_state::indianbt_sh_port_1_w) { /* bit 4 occurs every 5.25 seconds during gameplay */ - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; if (rising_bits & 0x01) m_samples->start(1, 7); /* Death */ if (rising_bits & 0x02) m_samples->start(0, 1); /* Shot Sound */ @@ -336,7 +336,7 @@ WRITE8_MEMBER(_8080bw_state::indianbt_sh_port_1_w) WRITE8_MEMBER(_8080bw_state::indianbt_sh_port_2_w) { - UINT8 rising_bits = data & ~m_port_2_last_extra; + uint8_t rising_bits = data & ~m_port_2_last_extra; if (rising_bits & 0x01) m_samples->start(4, 0); /* Bird dropped an egg, Lasso used */ if (rising_bits & 0x02) m_samples->start(4, 2); /* Egg hatches, egg shot */ @@ -355,7 +355,7 @@ WRITE8_MEMBER(_8080bw_state::indianbt_sh_port_3_w) WRITE8_MEMBER(_8080bw_state::indianbtbr_sh_port_1_w) { - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; if (rising_bits & 0x01) m_samples->start(4, 7); /* Lasso */ if (rising_bits & 0x04) m_samples->start(0, 1); /* Shot Sound */ @@ -368,7 +368,7 @@ WRITE8_MEMBER(_8080bw_state::indianbtbr_sh_port_1_w) WRITE8_MEMBER(_8080bw_state::indianbtbr_sh_port_2_w) { - UINT8 rising_bits = data & ~m_port_2_last_extra; + uint8_t rising_bits = data & ~m_port_2_last_extra; if (rising_bits & 0x08) m_samples->start(2, 3); /* Move */ if (rising_bits & 0x10) m_samples->start(3, 7); /* Death */ @@ -1029,7 +1029,7 @@ WRITE8_MEMBER(_8080bw_state::invrvnge_sh_port_2_w) WRITE8_MEMBER(_8080bw_state::rollingc_sh_port_w) { - UINT8 rising_bits = data & ~m_port_3_last_extra; + uint8_t rising_bits = data & ~m_port_3_last_extra; if (rising_bits & 0x02) m_samples->start(4, 0); /* Steering */ if (rising_bits & 0x04) m_samples->start(0, 1); /* Collision */ @@ -1065,8 +1065,8 @@ WRITE8_MEMBER( _8080bw_state::lupin3_00_w ) WRITE8_MEMBER(_8080bw_state::lupin3_sh_port_1_w) { - UINT8 rising_bits = data & ~m_port_1_last_extra; - static UINT8 lupin3_step = 2; + uint8_t rising_bits = data & ~m_port_1_last_extra; + static uint8_t lupin3_step = 2; if (rising_bits & 0x01) { @@ -1089,7 +1089,7 @@ WRITE8_MEMBER(_8080bw_state::lupin3_sh_port_1_w) WRITE8_MEMBER(_8080bw_state::lupin3_sh_port_2_w) { - UINT8 rising_bits = data & ~m_port_2_last_extra; + uint8_t rising_bits = data & ~m_port_2_last_extra; if (rising_bits & 0x01) m_samples->start(0, 6); /* Lands on top of building, wife kicks man */ //if (rising_bits & 0x02) m_samples->start(3, 7); /* deposit money, start intermission, end game */ @@ -1117,7 +1117,7 @@ WRITE8_MEMBER(_8080bw_state::schasercv_sh_port_1_w) bit 3 = 1st speedup Death is a stream of ff's with some fe's thrown in */ - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; if (rising_bits & 0x02) m_samples->start(1, 6); /* Ran over a dot */ if (rising_bits & 0x10) m_samples->start(0, 1); /* Death */ @@ -1143,7 +1143,7 @@ WRITE8_MEMBER(_8080bw_state::schasercv_sh_port_2_w) WRITE8_MEMBER(_8080bw_state::yosakdon_sh_port_1_w) { - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; if (rising_bits & 0x01) m_samples->start(0, 3); /* Game Over */ if (rising_bits & 0x02) m_samples->start(2, 0); /* Bird dead */ @@ -1158,7 +1158,7 @@ WRITE8_MEMBER(_8080bw_state::yosakdon_sh_port_1_w) WRITE8_MEMBER(_8080bw_state::yosakdon_sh_port_2_w) { - UINT8 rising_bits = data & ~m_port_2_last_extra; + uint8_t rising_bits = data & ~m_port_2_last_extra; if (rising_bits & 0x01) m_samples->start(1, 6); /* Ready? , Game Over */ if (rising_bits & 0x04) m_samples->start(3, 7); /* Big bird dead */ @@ -1182,7 +1182,7 @@ WRITE8_MEMBER(_8080bw_state::yosakdon_sh_port_2_w) WRITE8_MEMBER(_8080bw_state::shuttlei_sh_port_1_w) { /* bit 3 is high while you are alive and playing */ - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; if (rising_bits & 0x01) m_samples->start(4, 4); /* Fleet move */ if (rising_bits & 0x02) m_samples->start(5, 8); /* Extra Tank */ @@ -1227,7 +1227,7 @@ WRITE8_MEMBER( _8080bw_state::darthvdr_00_w ) WRITE8_MEMBER( _8080bw_state::darthvdr_08_w ) { - UINT8 rising_bits = data & ~m_port_1_last_extra; + uint8_t rising_bits = data & ~m_port_1_last_extra; machine().sound().system_enable(data & 0x01); diff --git a/src/mame/audio/alesis.cpp b/src/mame/audio/alesis.cpp index fdd2c00fc05..77ff4ebe744 100644 --- a/src/mame/audio/alesis.cpp +++ b/src/mame/audio/alesis.cpp @@ -36,7 +36,7 @@ MACHINE_CONFIG_END // alesis_dm3ag_device - constructor //------------------------------------------------- -alesis_dm3ag_device::alesis_dm3ag_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +alesis_dm3ag_device::alesis_dm3ag_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ALESIS_DM3AG, "Alesis DM3AG", tag, owner, clock, "alesis_dm3ag", __FILE__), m_dac(*this, "dac"), m_samples(*this, DEVICE_SELF) @@ -83,7 +83,7 @@ void alesis_dm3ag_device::device_timer(emu_timer &timer, device_timer_id id, int { if (m_output_active) { - INT16 sample = m_samples[m_cur_sample++]; + int16_t sample = m_samples[m_cur_sample++]; int count = 0; while (sample == -128) diff --git a/src/mame/audio/arcadia.cpp b/src/mame/audio/arcadia.cpp index 306932a0b44..ccb04e0f4c7 100644 --- a/src/mame/audio/arcadia.cpp +++ b/src/mame/audio/arcadia.cpp @@ -47,7 +47,7 @@ const device_type ARCADIA_SOUND = &device_creator; // arcadia_sound_device - constructor //------------------------------------------------- -arcadia_sound_device::arcadia_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +arcadia_sound_device::arcadia_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ARCADIA_SOUND, "Arcadia Audio Custom", tag, owner, clock, "arcadia_sound", __FILE__), device_sound_interface(mconfig, *this) { diff --git a/src/mame/audio/arcadia.h b/src/mame/audio/arcadia.h index 14a4f298294..0b95e0c44b5 100644 --- a/src/mame/audio/arcadia.h +++ b/src/mame/audio/arcadia.h @@ -21,7 +21,7 @@ class arcadia_sound_device : public device_t, { public: // construction/destruction - arcadia_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + arcadia_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER(write); protected: @@ -31,7 +31,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; sound_stream *m_channel; - UINT8 m_reg[3]; + uint8_t m_reg[3]; int m_size, m_pos,m_tval,m_nval; unsigned m_mode, m_omode; unsigned m_volume; diff --git a/src/mame/audio/astrof.cpp b/src/mame/audio/astrof.cpp index 98c1b62cc9a..e5fee67ee6c 100644 --- a/src/mame/audio/astrof.cpp +++ b/src/mame/audio/astrof.cpp @@ -34,7 +34,7 @@ WRITE8_MEMBER(astrof_state::astrof_audio_1_w) { - UINT8 rising_bits = data & ~m_port_1_last; + uint8_t rising_bits = data & ~m_port_1_last; if (m_astrof_death_playing) m_astrof_death_playing = m_samples->playing(CHANNEL_EXPLOSION); @@ -79,7 +79,7 @@ WRITE8_MEMBER(astrof_state::astrof_audio_1_w) WRITE8_MEMBER(astrof_state::astrof_audio_2_w) { - UINT8 rising_bits = data & ~m_port_2_last; + uint8_t rising_bits = data & ~m_port_2_last; /* D0-D2 - explosion select (triggered by D2 of the other port */ if (m_astrof_start_explosion) diff --git a/src/mame/audio/atarijsa.cpp b/src/mame/audio/atarijsa.cpp index 0ad49a64295..16dbf50fe8c 100644 --- a/src/mame/audio/atarijsa.cpp +++ b/src/mame/audio/atarijsa.cpp @@ -285,7 +285,7 @@ INPUT_PORTS_END // atari_jsa_base_device - constructor //------------------------------------------------- -atari_jsa_base_device::atari_jsa_base_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int channels) +atari_jsa_base_device::atari_jsa_base_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int channels) : device_t(mconfig, devtype, name, tag, owner, clock, shortname, __FILE__), device_mixer_interface(mconfig, *this, channels), m_soundcomm(*this, "soundcomm"), @@ -412,7 +412,7 @@ WRITE_LINE_MEMBER( atari_jsa_base_device::main_int_write_line ) // atari_jsa_oki_base_device: Constructor //------------------------------------------------- -atari_jsa_oki_base_device::atari_jsa_oki_base_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int channels) +atari_jsa_oki_base_device::atari_jsa_oki_base_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int channels) : atari_jsa_base_device(mconfig, devtype, name, tag, owner, clock, shortname, channels), m_oki1(*this, "oki1"), m_oki2(*this, "oki2"), @@ -628,7 +628,7 @@ void atari_jsa_oki_base_device::update_all_volumes() // atari_jsa_i_device: Constructor //------------------------------------------------- -atari_jsa_i_device::atari_jsa_i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_jsa_i_device::atari_jsa_i_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atari_jsa_base_device(mconfig, ATARI_JSA_I, "Atari JSA I Sound Board", tag, owner, clock, "atjsa1", 2), m_pokey(*this, "pokey"), m_tms5220(*this, "tms"), @@ -657,7 +657,7 @@ READ8_MEMBER( atari_jsa_i_device::rdio_r ) // 0x01 = coin 1 // - UINT8 result = m_jsai->read(); + uint8_t result = m_jsai->read(); if (!m_test_read_cb()) result ^= 0x80; if (m_tms5220 != nullptr && m_tms5220->readyq_r() == 0) @@ -843,7 +843,7 @@ void atari_jsa_i_device::update_all_volumes() // atari_jsa_ii_device: Constructor //------------------------------------------------- -atari_jsa_ii_device::atari_jsa_ii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_jsa_ii_device::atari_jsa_ii_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atari_jsa_oki_base_device(mconfig, ATARI_JSA_II, "Atari JSA II Sound Board", tag, owner, clock, "atjsa2", 1) , m_jsaii(*this, "JSAII") { @@ -868,7 +868,7 @@ READ8_MEMBER( atari_jsa_ii_device::rdio_r ) // 0x01 = coin 1 // - UINT8 result = m_jsaii->read(); + uint8_t result = m_jsaii->read(); if (!m_test_read_cb()) result ^= 0x80; @@ -907,13 +907,13 @@ ioport_constructor atari_jsa_ii_device::device_input_ports() const // atari_jsa_iii_device: Constructor //------------------------------------------------- -atari_jsa_iii_device::atari_jsa_iii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_jsa_iii_device::atari_jsa_iii_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atari_jsa_oki_base_device(mconfig, ATARI_JSA_III, "Atari JSA III Sound Board", tag, owner, clock, "atjsa3", 1) , m_jsaiii(*this, "JSAIII") { } -atari_jsa_iii_device::atari_jsa_iii_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int channels) +atari_jsa_iii_device::atari_jsa_iii_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int channels) : atari_jsa_oki_base_device(mconfig, devtype, name, tag, owner, clock, shortname, channels) , m_jsaiii(*this, "JSAIII") { @@ -938,7 +938,7 @@ READ8_MEMBER( atari_jsa_iii_device::rdio_r ) // 0x01 = coin R (active high) // - UINT8 result = m_jsaiii->read(); + uint8_t result = m_jsaiii->read(); if (!m_test_read_cb()) result ^= 0x90; return result; @@ -976,7 +976,7 @@ ioport_constructor atari_jsa_iii_device::device_input_ports() const // atari_jsa_iiis_device: Constructor //------------------------------------------------- -atari_jsa_iiis_device::atari_jsa_iiis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +atari_jsa_iiis_device::atari_jsa_iiis_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : atari_jsa_iii_device(mconfig, ATARI_JSA_IIIS, "Atari JSA IIIs Sound Board", tag, owner, clock, "atjsa3s", 2) { } diff --git a/src/mame/audio/atarijsa.h b/src/mame/audio/atarijsa.h index 553723f59ac..de3ff0dc144 100644 --- a/src/mame/audio/atarijsa.h +++ b/src/mame/audio/atarijsa.h @@ -80,7 +80,7 @@ class atari_jsa_base_device : public device_t, { protected: // construction/destruction - atari_jsa_base_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int channels); + atari_jsa_base_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int channels); public: // static configuration @@ -129,8 +129,8 @@ protected: // internal state double m_ym2151_volume; - UINT8 m_ym2151_ct1; - UINT8 m_ym2151_ct2; + uint8_t m_ym2151_ct1; + uint8_t m_ym2151_ct2; }; @@ -140,7 +140,7 @@ class atari_jsa_oki_base_device : public atari_jsa_base_device { protected: // derived construction/destruction - atari_jsa_oki_base_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int channels); + atari_jsa_oki_base_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int channels); public: // read/write handlers @@ -184,7 +184,7 @@ class atari_jsa_i_device : public atari_jsa_base_device { public: // construction/destruction - atari_jsa_i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_jsa_i_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write handlers DECLARE_READ8_MEMBER( rdio_r ); @@ -221,7 +221,7 @@ class atari_jsa_ii_device : public atari_jsa_oki_base_device { public: // construction/destruction - atari_jsa_ii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_jsa_ii_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write handlers DECLARE_READ8_MEMBER( rdio_r ); @@ -241,11 +241,11 @@ class atari_jsa_iii_device : public atari_jsa_oki_base_device { public: // construction/destruction - atari_jsa_iii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_jsa_iii_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // derived construction/destruction - atari_jsa_iii_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int channels); + atari_jsa_iii_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, int channels); public: // read/write handlers @@ -266,7 +266,7 @@ class atari_jsa_iiis_device : public atari_jsa_iii_device { public: // construction/destruction - atari_jsa_iiis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_jsa_iiis_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device level overrides diff --git a/src/mame/audio/beezer.cpp b/src/mame/audio/beezer.cpp index fa2d49f0c56..a2a19a242f1 100644 --- a/src/mame/audio/beezer.cpp +++ b/src/mame/audio/beezer.cpp @@ -69,7 +69,7 @@ const device_type BEEZER = &device_creator; -beezer_sound_device::beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +beezer_sound_device::beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BEEZER, "beezer SFX", tag, owner, clock, "beezer_sound", __FILE__), device_sound_interface(mconfig, *this), //m_ptm_irq_state(0), @@ -249,7 +249,7 @@ static inline void sh6840_apply_clock(struct sh6840_timer_channel_beez *t, int c int beezer_sound_device::sh6840_update_noise(int clocks) { - UINT32 newxor; + uint32_t newxor; int noise_clocks = 0; int i; @@ -412,8 +412,8 @@ void beezer_sound_device::sound_stream_update(sound_stream &stream, stream_sampl struct sh6840_timer_channel_beez *t; int clocks_this_sample; int clocks; - INT16 sample1, sample2, sample3, sample0; - INT16 sample = 0; + int16_t sample1, sample2, sample3, sample0; + int16_t sample = 0; sample1 = sample2 = sample3 = sample0 = 0; /* determine how many 6840 clocks this sample */ @@ -425,7 +425,7 @@ void beezer_sound_device::sound_stream_update(sound_stream &stream, stream_sampl if ((sh6840_timer[0].cr & 0x01) == 0) // if we're not in reset... { // int noise_clocks_this_sample = 0; - UINT32 chan1_clocks; + uint32_t chan1_clocks; /* generate noise if configured to do so */ if (noisy != 0) diff --git a/src/mame/audio/cage.cpp b/src/mame/audio/cage.cpp index 5a9818652b6..7d5c2d2deac 100644 --- a/src/mame/audio/cage.cpp +++ b/src/mame/audio/cage.cpp @@ -112,7 +112,7 @@ const device_type ATARI_CAGE = &device_creator; // atari_cage_device - constructor //------------------------------------------------- -atari_cage_device::atari_cage_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +atari_cage_device::atari_cage_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATARI_CAGE, "Atari CAGE", tag, owner, clock, "atari_cage", __FILE__), m_cageram(*this, "cageram"), m_soundlatch(*this, "soundlatch"), @@ -120,7 +120,7 @@ atari_cage_device::atari_cage_device(const machine_config &mconfig, const char * { } -atari_cage_device::atari_cage_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) : +atari_cage_device::atari_cage_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_cageram(*this, "cageram"), m_soundlatch(*this, "soundlatch"), @@ -191,7 +191,7 @@ void atari_cage_device::reset_w(int state) TIMER_DEVICE_CALLBACK_MEMBER( atari_cage_device::dma_timer_callback ) { - UINT32 *tms32031_io_regs = m_tms32031_io_regs; + uint32_t *tms32031_io_regs = m_tms32031_io_regs; /* if we weren't enabled, don't do anything, just shut ourself off */ if (!m_dma_enabled) @@ -216,7 +216,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( atari_cage_device::dma_timer_callback ) void atari_cage_device::update_dma_state(address_space &space) { - UINT32 *tms32031_io_regs = m_tms32031_io_regs; + uint32_t *tms32031_io_regs = m_tms32031_io_regs; /* determine the new enabled state */ int enabled = ((tms32031_io_regs[DMA_GLOBAL_CTL] & 3) == 3) && (tms32031_io_regs[DMA_TRANSFER_COUNT] != 0); @@ -224,8 +224,8 @@ void atari_cage_device::update_dma_state(address_space &space) /* see if we turned on */ if (enabled && !m_dma_enabled) { - INT16 sound_data[STACK_SOUND_BUFSIZE]; - UINT32 addr, inc; + int16_t sound_data[STACK_SOUND_BUFSIZE]; + uint32_t addr, inc; int i; /* make sure our assumptions are correct */ @@ -287,7 +287,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( atari_cage_device::cage_timer_callback ) void atari_cage_device::update_timer(int which) { - UINT32 *tms32031_io_regs = m_tms32031_io_regs; + uint32_t *tms32031_io_regs = m_tms32031_io_regs; /* determine the new enabled state */ int base = 0x10 * which; @@ -325,9 +325,9 @@ void atari_cage_device::update_timer(int which) void atari_cage_device::update_serial() { - UINT32 *tms32031_io_regs = m_tms32031_io_regs; + uint32_t *tms32031_io_regs = m_tms32031_io_regs; attotime serial_clock_period, bit_clock_period; - UINT32 freq; + uint32_t freq; /* we start out at half the H1 frequency (or 2x the H1 period) */ serial_clock_period = m_cpu_h1_clock_period * 2; @@ -361,8 +361,8 @@ void atari_cage_device::update_serial() READ32_MEMBER( atari_cage_device::tms32031_io_r ) { - UINT32 *tms32031_io_regs = m_tms32031_io_regs; - UINT16 result = tms32031_io_regs[offset]; + uint32_t *tms32031_io_regs = m_tms32031_io_regs; + uint16_t result = tms32031_io_regs[offset]; switch (offset) { @@ -379,7 +379,7 @@ READ32_MEMBER( atari_cage_device::tms32031_io_r ) WRITE32_MEMBER( atari_cage_device::tms32031_io_w ) { - UINT32 *tms32031_io_regs = m_tms32031_io_regs; + uint32_t *tms32031_io_regs = m_tms32031_io_regs; COMBINE_DATA(&tms32031_io_regs[offset]); @@ -499,7 +499,7 @@ READ32_MEMBER( atari_cage_device::cage_io_status_r ) } -UINT16 atari_cage_device::main_r() +uint16_t atari_cage_device::main_r() { driver_device *drvstate = machine().driver_data(); if (LOG_COMM) @@ -519,7 +519,7 @@ TIMER_CALLBACK_MEMBER( atari_cage_device::cage_deferred_w ) } -void atari_cage_device::main_w(UINT16 data) +void atari_cage_device::main_w(uint16_t data) { if (LOG_COMM) logerror("%s:Command to CAGE = %04X\n", machine().describe_context(), data); @@ -527,9 +527,9 @@ void atari_cage_device::main_w(UINT16 data) } -UINT16 atari_cage_device::control_r() +uint16_t atari_cage_device::control_r() { - UINT16 result = 0; + uint16_t result = 0; if (m_cpu_to_cage_ready) result |= 2; @@ -540,9 +540,9 @@ UINT16 atari_cage_device::control_r() } -void atari_cage_device::control_w(UINT16 data) +void atari_cage_device::control_w(uint16_t data) { - UINT32 *tms32031_io_regs = m_tms32031_io_regs; + uint32_t *tms32031_io_regs = m_tms32031_io_regs; m_control = data; @@ -691,7 +691,7 @@ const device_type ATARI_CAGE_SEATTLE = &device_creator(device).m_speedup = speedup; } template static devcb_base &set_irqhandler_callback(device_t &device, _Object object) { return downcast(device).m_irqhandler.set_callback(object); } @@ -36,11 +36,11 @@ public: void reset_w(int state); - UINT16 main_r(); - void main_w(UINT16 data); + uint16_t main_r(); + void main_w(uint16_t data); - UINT16 control_r(); - void control_w(UINT16 data); + uint16_t control_r(); + void control_w(uint16_t data); TIMER_DEVICE_CALLBACK_MEMBER( dma_timer_callback ); void update_dma_state(address_space &space); @@ -62,31 +62,31 @@ protected: virtual void device_start() override; private: - required_shared_ptr m_cageram; + required_shared_ptr m_cageram; cpu_device *m_cpu; required_device m_soundlatch; attotime m_cpu_h1_clock_period; - UINT8 m_cpu_to_cage_ready; - UINT8 m_cage_to_cpu_ready; + uint8_t m_cpu_to_cage_ready; + uint8_t m_cage_to_cpu_ready; devcb_write8 m_irqhandler; attotime m_serial_period_per_word; - UINT8 m_dma_enabled; - UINT8 m_dma_timer_enabled; + uint8_t m_dma_enabled; + uint8_t m_dma_timer_enabled; timer_device *m_dma_timer; - UINT8 m_timer_enabled[2]; + uint8_t m_timer_enabled[2]; timer_device *m_timer[2]; - UINT32 m_tms32031_io_regs[0x100]; - UINT16 m_from_main; - UINT16 m_control; + uint32_t m_tms32031_io_regs[0x100]; + uint16_t m_from_main; + uint16_t m_control; - UINT32 *m_speedup_ram; + uint32_t *m_speedup_ram; dmadac_sound_device *m_dmadac[4]; offs_t m_speedup; @@ -100,7 +100,7 @@ class atari_cage_seattle_device : public atari_cage_device { public: // construction/destruction - atari_cage_seattle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_cage_seattle_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; diff --git a/src/mame/audio/cchasm.cpp b/src/mame/audio/cchasm.cpp index ad41d560061..48dd6b8abe2 100644 --- a/src/mame/audio/cchasm.cpp +++ b/src/mame/audio/cchasm.cpp @@ -33,7 +33,7 @@ INPUT_CHANGED_MEMBER(cchasm_state::set_coin_flag ) READ8_MEMBER(cchasm_state::coin_sound_r) { - UINT8 coin = (ioport("IN3")->read() >> 4) & 0x7; + uint8_t coin = (ioport("IN3")->read() >> 4) & 0x7; return m_sound_flags | (m_coin_flag << 3) | coin; } diff --git a/src/mame/audio/cclimber.cpp b/src/mame/audio/cclimber.cpp index bd20ab77b17..3532cf708de 100644 --- a/src/mame/audio/cclimber.cpp +++ b/src/mame/audio/cclimber.cpp @@ -14,7 +14,7 @@ SAMPLES_START_CB_MEMBER( cclimber_audio_device::sh_start ) { if (m_samples_region) { - m_sample_buf = std::make_unique(2 * m_samples_region.bytes()); + m_sample_buf = std::make_unique(2 * m_samples_region.bytes()); save_pointer(NAME(m_sample_buf.get()), 2 * m_samples_region.bytes()); } } @@ -45,7 +45,7 @@ const device_type CCLIMBER_AUDIO = &device_creator; // cclimber_audio_device: Constructor //------------------------------------------------- -cclimber_audio_device::cclimber_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cclimber_audio_device::cclimber_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CCLIMBER_AUDIO, "Crazy Climber Sound Board", tag, owner, clock, "cclimber_audio", __FILE__), m_sample_buf(nullptr), m_sample_num(0), diff --git a/src/mame/audio/cclimber.h b/src/mame/audio/cclimber.h index 65f1255e3d1..3fffe35f824 100644 --- a/src/mame/audio/cclimber.h +++ b/src/mame/audio/cclimber.h @@ -35,7 +35,7 @@ class cclimber_audio_device : public device_t { public: // construction/destruction - cclimber_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cclimber_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( sample_trigger_w ); DECLARE_WRITE8_MEMBER( sample_rate_w ); @@ -52,12 +52,12 @@ protected: void play_sample(int start,int freq,int volume); private: - std::unique_ptr m_sample_buf; /* buffer to decode samples at run time */ + std::unique_ptr m_sample_buf; /* buffer to decode samples at run time */ int m_sample_num; int m_sample_freq; int m_sample_volume; optional_device m_samples; - optional_region_ptr m_samples_region; + optional_region_ptr m_samples_region; }; diff --git a/src/mame/audio/channelf.cpp b/src/mame/audio/channelf.cpp index 2cf03d70aa0..21d416c14f2 100644 --- a/src/mame/audio/channelf.cpp +++ b/src/mame/audio/channelf.cpp @@ -8,7 +8,7 @@ const device_type CHANNELF_SOUND = &device_creator; -channelf_sound_device::channelf_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +channelf_sound_device::channelf_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CHANNELF_SOUND, "Channel F Sound", tag, owner, clock, "channelf_sound", __FILE__), device_sound_interface(mconfig, *this), m_channel(nullptr), @@ -82,7 +82,7 @@ void channelf_sound_device::device_start() void channelf_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - UINT32 mask = 0, target = 0; + uint32_t mask = 0, target = 0; stream_sample_t *buffer = outputs[0]; stream_sample_t *sample = buffer; diff --git a/src/mame/audio/channelf.h b/src/mame/audio/channelf.h index 17ad5add8df..07349ca4b15 100644 --- a/src/mame/audio/channelf.h +++ b/src/mame/audio/channelf.h @@ -13,7 +13,7 @@ class channelf_sound_device : public device_t, public device_sound_interface { public: - channelf_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + channelf_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void sound_w(int mode); protected: @@ -30,7 +30,7 @@ private: int m_incr; float m_decay_mult; int m_envelope; - UINT32 m_sample_counter; + uint32_t m_sample_counter; int m_forced_ontime; // added for improved sound int m_min_ontime; // added for improved sound diff --git a/src/mame/audio/cinemat.cpp b/src/mame/audio/cinemat.cpp index 99260c00a61..af318008c80 100644 --- a/src/mame/audio/cinemat.cpp +++ b/src/mame/audio/cinemat.cpp @@ -53,7 +53,7 @@ WRITE8_MEMBER(cinemat_state::cinemat_sound_control_w) { - UINT8 oldval = m_sound_control; + uint8_t oldval = m_sound_control; /* form an 8-bit value with the new bit */ m_sound_control = (m_sound_control & ~(1 << offset)) | ((data & 1) << offset); @@ -129,7 +129,7 @@ static const char *const spacewar_sample_names[] = nullptr }; -void cinemat_state::spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::spacewar_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* Explosion - rising edge */ if (SOUNDVAL_RISING_EDGE(0x01)) @@ -201,7 +201,7 @@ static const char *const barrier_sample_names[] = nullptr }; -void cinemat_state::barrier_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::barrier_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* Player die - rising edge */ if (SOUNDVAL_RISING_EDGE(0x01)) @@ -247,7 +247,7 @@ static const char *const speedfrk_sample_names[] = nullptr }; -void cinemat_state::speedfrk_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::speedfrk_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */ if (SOUNDVAL_FALLING_EDGE(0x08)) @@ -305,7 +305,7 @@ static const char *const starhawk_sample_names[] = nullptr }; -void cinemat_state::starhawk_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::starhawk_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* explosion - falling edge */ if (SOUNDVAL_FALLING_EDGE(0x01)) @@ -374,7 +374,7 @@ static const char *const sundance_sample_names[] = nullptr }; -void cinemat_state::sundance_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::sundance_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* bong - falling edge */ if (SOUNDVAL_FALLING_EDGE(0x01)) @@ -437,7 +437,7 @@ static const char *const tailg_sample_names[] = nullptr }; -void cinemat_state::tailg_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::tailg_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */ if (SOUNDVAL_FALLING_EDGE(0x10)) @@ -518,7 +518,7 @@ static const char *const warrior_sample_names[] = nullptr }; -void cinemat_state::warrior_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::warrior_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* normal level - 0=on, 1=off */ if (SOUNDVAL_FALLING_EDGE(0x01)) @@ -582,7 +582,7 @@ static const char *const armora_sample_names[] = nullptr }; -void cinemat_state::armora_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::armora_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x10)) @@ -676,7 +676,7 @@ static const char *const ripoff_sample_names[] = nullptr }; -void cinemat_state::ripoff_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::ripoff_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x02)) @@ -756,9 +756,9 @@ static const char *const starcas_sample_names[] = nullptr }; -void cinemat_state::starcas_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::starcas_sound_w(uint8_t sound_val, uint8_t bits_changed) { - UINT32 target_pitch; + uint32_t target_pitch; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x10)) @@ -863,7 +863,7 @@ static const char *const solarq_sample_names[] = nullptr }; -void cinemat_state::solarq_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::solarq_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x10)) @@ -995,7 +995,7 @@ static const char *const boxingb_sample_names[] = nullptr }; -void cinemat_state::boxingb_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::boxingb_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x10)) @@ -1119,9 +1119,9 @@ static const char *const wotw_sample_names[] = nullptr }; -void cinemat_state::wotw_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::wotw_sound_w(uint8_t sound_val, uint8_t bits_changed) { - UINT32 target_pitch; + uint32_t target_pitch; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x10)) @@ -1219,7 +1219,7 @@ TIMER_CALLBACK_MEMBER( cinemat_state::synced_sound_w ) } -void cinemat_state::demon_sound_w(UINT8 sound_val, UINT8 bits_changed) +void cinemat_state::demon_sound_w(uint8_t sound_val, uint8_t bits_changed) { /* all inputs are inverted */ sound_val = ~sound_val; @@ -1349,7 +1349,7 @@ MACHINE_CONFIG_END WRITE8_MEMBER(cinemat_state::qb3_sound_w) { - UINT16 rega = m_maincpu->state_int(CCPU_A); + uint16_t rega = m_maincpu->state_int(CCPU_A); demon_sound_w(0x00 | (~rega & 0x0f), 0x10); } diff --git a/src/mame/audio/copsnrob.cpp b/src/mame/audio/copsnrob.cpp index bcc85241807..cccd856a864 100644 --- a/src/mame/audio/copsnrob.cpp +++ b/src/mame/audio/copsnrob.cpp @@ -270,8 +270,8 @@ DISCRETE_CLASS_STEP_RESET(copsnrob_custom_noise, 2, int m_flip_flop; int m_noise1_had_xtime; int m_noise2_had_xtime; - UINT8 m_high_byte; - UINT8 m_low_byte; + uint8_t m_high_byte; + uint8_t m_low_byte; double m_t_used; double m_t1; ); @@ -283,9 +283,9 @@ DISCRETE_STEP(copsnrob_custom_noise) double t_used = m_t_used; double t1 = m_t1; double x_time = 0; - UINT8 low_byte = m_low_byte; - UINT8 high_byte = m_high_byte; - UINT8 xnor_out; /* IC F2, pin 2 */ + uint8_t low_byte = m_low_byte; + uint8_t high_byte = m_high_byte; + uint8_t xnor_out; /* IC F2, pin 2 */ int last_noise1_bit = (low_byte >> 4) & 0x01; int last_noise2_bit = (low_byte >> 5) & 0x01; @@ -689,8 +689,8 @@ DISCRETE_SOUND_END WRITE8_MEMBER(copsnrob_state::copsnrob_misc_w) { - UINT8 latched_data = m_ic_h3_data; - UINT8 special_data = data & 0x01; + uint8_t latched_data = m_ic_h3_data; + uint8_t special_data = data & 0x01; /* ignore if no change */ if (((latched_data >> offset) & 0x01) == special_data) diff --git a/src/mame/audio/cps3.cpp b/src/mame/audio/cps3.cpp index 7038ec5adf8..a3fe0e4833b 100644 --- a/src/mame/audio/cps3.cpp +++ b/src/mame/audio/cps3.cpp @@ -22,7 +22,7 @@ const device_type CPS3 = &device_creator; // cps3_sound_device - constructor //------------------------------------------------- -cps3_sound_device::cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cps3_sound_device::cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CPS3, "CPS3 Audio Custom", tag, owner, clock, "cps3_custom", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), @@ -77,17 +77,17 @@ void cps3_sound_device::sound_stream_update(sound_stream &stream, stream_sample_ */ cps3_voice *vptr = &m_voice[i]; - UINT32 start = (vptr->regs[1] >> 16 & 0x0000ffff) | (vptr->regs[1] << 16 & 0xffff0000); - UINT32 end = (vptr->regs[5] >> 16 & 0x0000ffff) | (vptr->regs[5] << 16 & 0xffff0000); - UINT32 loop = (vptr->regs[3] & 0x0000ffff) | (vptr->regs[4] << 16 & 0xffff0000); + uint32_t start = (vptr->regs[1] >> 16 & 0x0000ffff) | (vptr->regs[1] << 16 & 0xffff0000); + uint32_t end = (vptr->regs[5] >> 16 & 0x0000ffff) | (vptr->regs[5] << 16 & 0xffff0000); + uint32_t loop = (vptr->regs[3] & 0x0000ffff) | (vptr->regs[4] << 16 & 0xffff0000); bool loop_enable = (vptr->regs[2] & 1) ? true : false; - UINT32 step = vptr->regs[3] >> 16 & 0xffff; + uint32_t step = vptr->regs[3] >> 16 & 0xffff; - INT16 vol_l = (vptr->regs[7] & 0xffff); - INT16 vol_r = (vptr->regs[7] >> 16 & 0xffff); + int16_t vol_l = (vptr->regs[7] & 0xffff); + int16_t vol_r = (vptr->regs[7] >> 16 & 0xffff); - UINT32 pos = vptr->pos; - UINT32 frac = vptr->frac; + uint32_t pos = vptr->pos; + uint32_t frac = vptr->frac; /* TODO */ start -= 0x400000; @@ -97,7 +97,7 @@ void cps3_sound_device::sound_stream_update(sound_stream &stream, stream_sample_ /* Go through the buffer and add voice contributions */ for (int j = 0; j < samples; j++) { - INT32 sample; + int32_t sample; pos += (frac >> 12); frac &= 0xfff; @@ -142,7 +142,7 @@ WRITE32_MEMBER( cps3_sound_device::cps3_sound_w ) { assert((mem_mask & 0xffff0000) == 0xffff0000); // doesn't happen - UINT16 key = data >> 16; + uint16_t key = data >> 16; for (int i = 0; i < 16; i++) { diff --git a/src/mame/audio/cps3.h b/src/mame/audio/cps3.h index 03c5e4f1642..41c7b6c041f 100644 --- a/src/mame/audio/cps3.h +++ b/src/mame/audio/cps3.h @@ -16,12 +16,12 @@ struct cps3_voice pos(0), frac(0) { - memset(regs, 0, sizeof(UINT32)*8); + memset(regs, 0, sizeof(uint32_t)*8); } - UINT32 regs[8]; - UINT32 pos; - UINT32 frac; + uint32_t regs[8]; + uint32_t pos; + uint32_t frac; }; // ======================> cps3_sound_device @@ -30,10 +30,10 @@ class cps3_sound_device : public device_t, public device_sound_interface { public: - cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~cps3_sound_device() { } - void set_base(INT8* base) { m_base = base; } + void set_base(int8_t* base) { m_base = base; } DECLARE_WRITE32_MEMBER( cps3_sound_w ); DECLARE_READ32_MEMBER( cps3_sound_r ); @@ -48,8 +48,8 @@ protected: private: sound_stream *m_stream; cps3_voice m_voice[16]; - UINT16 m_key; - INT8* m_base; + uint16_t m_key; + int8_t* m_base; }; extern const device_type CPS3; diff --git a/src/mame/audio/dai_snd.cpp b/src/mame/audio/dai_snd.cpp index ae0bf3c79c3..da20912577d 100644 --- a/src/mame/audio/dai_snd.cpp +++ b/src/mame/audio/dai_snd.cpp @@ -21,7 +21,7 @@ const device_type DAI_SOUND = &device_creator; // dai_sound_device - constructor //------------------------------------------------- -dai_sound_device::dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dai_sound_device::dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DAI_SOUND, "DAI Audio Custom", tag, owner, clock, "dai_sound", __FILE__), device_sound_interface(mconfig, *this) { @@ -52,7 +52,7 @@ void dai_sound_device::device_reset() // channels 0/1/2 volume table //------------------------------------------------- -const UINT16 dai_sound_device::s_osc_volume_table[] = { +const uint16_t dai_sound_device::s_osc_volume_table[] = { 0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, @@ -63,7 +63,7 @@ const UINT16 dai_sound_device::s_osc_volume_table[] = { // noise volume table //------------------------------------------------- -const UINT16 dai_sound_device::s_noise_volume_table[] = { +const uint16_t dai_sound_device::s_noise_volume_table[] = { 0, 0, 0, 0, 0, 0, 0, 0, 500, 1000, 1500, 2000, @@ -124,13 +124,13 @@ void dai_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t stream_sample_t *sample_left = outputs[0]; stream_sample_t *sample_right = outputs[1]; - INT16 channel_0_signal = m_dai_input[0] ? s_osc_volume_table[m_osc_volume[0]] : -s_osc_volume_table[m_osc_volume[0]]; - INT16 channel_1_signal = m_dai_input[1] ? s_osc_volume_table[m_osc_volume[1]] : -s_osc_volume_table[m_osc_volume[1]]; - INT16 channel_2_signal = m_dai_input[2] ? s_osc_volume_table[m_osc_volume[2]] : -s_osc_volume_table[m_osc_volume[2]]; + int16_t channel_0_signal = m_dai_input[0] ? s_osc_volume_table[m_osc_volume[0]] : -s_osc_volume_table[m_osc_volume[0]]; + int16_t channel_1_signal = m_dai_input[1] ? s_osc_volume_table[m_osc_volume[1]] : -s_osc_volume_table[m_osc_volume[1]]; + int16_t channel_2_signal = m_dai_input[2] ? s_osc_volume_table[m_osc_volume[2]] : -s_osc_volume_table[m_osc_volume[2]]; while (samples--) { - INT16 noise = machine().rand()&0x01 ? s_noise_volume_table[m_noise_volume] : -s_noise_volume_table[m_noise_volume]; + int16_t noise = machine().rand()&0x01 ? s_noise_volume_table[m_noise_volume] : -s_noise_volume_table[m_noise_volume]; /* channel 0 + channel 1 + noise */ *sample_left++ = channel_0_signal + channel_1_signal + noise; diff --git a/src/mame/audio/dai_snd.h b/src/mame/audio/dai_snd.h index 484002161ff..fb844476662 100644 --- a/src/mame/audio/dai_snd.h +++ b/src/mame/audio/dai_snd.h @@ -18,7 +18,7 @@ class dai_sound_device : public device_t, { public: // construction/destruction - dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER(set_input_ch0); DECLARE_WRITE_LINE_MEMBER(set_input_ch1); @@ -34,11 +34,11 @@ protected: private: sound_stream * m_mixer_channel; int m_dai_input[3]; - UINT8 m_osc_volume[3]; - UINT8 m_noise_volume; + uint8_t m_osc_volume[3]; + uint8_t m_noise_volume; - static const UINT16 s_osc_volume_table[]; - static const UINT16 s_noise_volume_table[]; + static const uint16_t s_osc_volume_table[]; + static const uint16_t s_noise_volume_table[]; }; extern const device_type DAI_SOUND; diff --git a/src/mame/audio/dave.cpp b/src/mame/audio/dave.cpp index 138b8d9ac40..69a7f2aec6f 100644 --- a/src/mame/audio/dave.cpp +++ b/src/mame/audio/dave.cpp @@ -52,7 +52,7 @@ ADDRESS_MAP_END // dave_device - constructor //------------------------------------------------- -dave_device::dave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +dave_device::dave_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DAVE, "DAVE", tag, owner, clock, "dave", __FILE__), device_memory_interface(mconfig, *this), device_sound_interface(mconfig, *this), @@ -311,7 +311,7 @@ WRITE_LINE_MEMBER( dave_device::int2_w ) READ8_MEMBER( dave_device::program_r ) { - UINT8 segment = m_segment[offset >> 14]; + uint8_t segment = m_segment[offset >> 14]; offset = (segment << 14) | (offset & 0x3fff); return this->space(AS_PROGRAM).read_byte(offset); @@ -324,7 +324,7 @@ READ8_MEMBER( dave_device::program_r ) WRITE8_MEMBER( dave_device::program_w ) { - UINT8 segment = m_segment[offset >> 14]; + uint8_t segment = m_segment[offset >> 14]; offset = (segment << 14) | (offset & 0x3fff); this->space(AS_PROGRAM).write_byte(offset, data); @@ -337,7 +337,7 @@ WRITE8_MEMBER( dave_device::program_w ) READ8_MEMBER( dave_device::io_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0xff) { diff --git a/src/mame/audio/dave.h b/src/mame/audio/dave.h index de534c51bda..95bcf38fe92 100644 --- a/src/mame/audio/dave.h +++ b/src/mame/audio/dave.h @@ -56,7 +56,7 @@ class dave_device : public device_t, public device_sound_interface { public: - dave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dave_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); } template static devcb_base &set_lh_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_lh.set_callback(object); } @@ -115,16 +115,16 @@ private: devcb_write8 m_write_lh; devcb_write8 m_write_rh; - UINT8 m_segment[4]; + uint8_t m_segment[4]; - UINT8 m_irq_status; - UINT8 m_irq_enable; + uint8_t m_irq_status; + uint8_t m_irq_enable; emu_timer *m_timer_1hz; emu_timer *m_timer_50hz; /* SOUND SYNTHESIS */ - UINT8 m_regs[32]; + uint8_t m_regs[32]; int m_period[4]; int m_count[4]; int m_level[4]; diff --git a/src/mame/audio/dcs.cpp b/src/mame/audio/dcs.cpp index 009722f77bb..3ff2a6a821a 100644 --- a/src/mame/audio/dcs.cpp +++ b/src/mame/audio/dcs.cpp @@ -605,10 +605,10 @@ void dcs_audio_device::dcs_boot() { /* determine the base */ // max_banks = m_bootrom_words / 0x1000; - UINT16* base = m_bootrom + ((m_sounddata_bank * 0x1000) % m_bootrom_words); + uint16_t* base = m_bootrom + ((m_sounddata_bank * 0x1000) % m_bootrom_words); /* convert from 16-bit data to 8-bit data and boot */ - UINT8 buffer[0x1000]; + uint8_t buffer[0x1000]; for (int i = 0; i < 0x1000; i++) { buffer[i] = base[i]; @@ -622,7 +622,7 @@ void dcs_audio_device::dcs_boot() case 2: { /* determine the base */ - UINT16* base; + uint16_t* base; if (m_bootrom == m_sounddata) { /* EPROM case: page is selected from the page register */ @@ -635,7 +635,7 @@ void dcs_audio_device::dcs_boot() } /* convert from 16-bit data to 8-bit data and boot */ - UINT8 buffer[0x1000]; + uint8_t buffer[0x1000]; for (int i = 0; i < 0x1000; i++) { buffer[i] = base[i]; @@ -800,7 +800,7 @@ void dcs_audio_device::dcs_register_state() // dcs_audio_device - constructor //------------------------------------------------- -dcs_audio_device::dcs_audio_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, int rev) : +dcs_audio_device::dcs_audio_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, int rev) : device_t(mconfig, type, name, tag, owner, clock, shortname, source), m_cpu(nullptr), m_program(nullptr), @@ -867,12 +867,12 @@ void dcs_audio_device::device_start() memory_share *internal_ram = memshare("dcsint"); if (internal_ram != nullptr) { - m_internal_program_ram = (UINT32 *)internal_ram->ptr(); + m_internal_program_ram = (uint32_t *)internal_ram->ptr(); } memory_share *external_ram = memshare("dcsext"); if (external_ram != nullptr) { - m_external_program_ram = (UINT32 *)external_ram->ptr(); + m_external_program_ram = (uint32_t *)external_ram->ptr(); } /* find the DCS CPU and the sound ROMs */ @@ -886,7 +886,7 @@ void dcs_audio_device::device_start() m_dmadac[0] = subdevice("dac"); /* configure boot and sound ROMs */ - m_bootrom = (UINT16 *)machine().root_device().memregion("dcs")->base(); + m_bootrom = (uint16_t *)machine().root_device().memregion("dcs")->base(); m_bootrom_words = machine().root_device().memregion("dcs")->bytes() / 2; m_sounddata = m_bootrom; m_sounddata_words = m_bootrom_words; @@ -921,12 +921,12 @@ void dcs2_audio_device::device_start() memory_share *internal_ram = memshare("dcsint"); if (internal_ram != nullptr) { - m_internal_program_ram = (UINT32 *)internal_ram->ptr(); + m_internal_program_ram = (uint32_t *)internal_ram->ptr(); } memory_share *external_ram = memshare("dcsext"); if (external_ram != nullptr) { - m_external_program_ram = (UINT32 *)external_ram->ptr(); + m_external_program_ram = (uint32_t *)external_ram->ptr(); } /* find the DCS CPU and the sound ROMs */ @@ -958,18 +958,18 @@ void dcs2_audio_device::device_start() memory_region *bootrom_region = machine().root_device().memregion("dcs"); if (bootrom_region != nullptr) { - m_bootrom = (UINT16 *)bootrom_region->base(); + m_bootrom = (uint16_t *)bootrom_region->base(); m_bootrom_words = bootrom_region->bytes() / 2; } /* supports both RAM and ROM variants */ if (m_dram_in_mb != 0) { - UINT32 ramSize = m_dram_in_mb << (20 - 1); + uint32_t ramSize = m_dram_in_mb << (20 - 1); // Add one extra bank for internal ram in ADSP 2181 if (m_rev == 4) ramSize += soundbank_words; - m_sounddata = auto_alloc_array(machine(), UINT16, ramSize); + m_sounddata = auto_alloc_array(machine(), uint16_t, ramSize); save_pointer(NAME(m_sounddata), ramSize); m_sounddata_words = (m_dram_in_mb << 20) / 2; } @@ -986,7 +986,7 @@ void dcs2_audio_device::device_start() /* allocate memory for the SRAM */ - m_sram = auto_alloc_array(machine(), UINT16, 0x8000*4/2); + m_sram = auto_alloc_array(machine(), uint16_t, 0x8000*4/2); /* create the timers */ m_internal_timer = subdevice("dcs_int_timer"); @@ -1037,7 +1037,7 @@ READ16_MEMBER( dcs_audio_device::dcs_dataram_r ) WRITE16_MEMBER( dcs_audio_device::dcs_dataram_w ) { assert(m_external_program_ram != nullptr); - UINT16 val = m_external_program_ram[offset] >> 8; + uint16_t val = m_external_program_ram[offset] >> 8; COMBINE_DATA(&val); m_external_program_ram[offset] = (val << 8) | (m_external_program_ram[offset] & 0x0000ff); } @@ -1179,7 +1179,7 @@ void dcs_audio_device::sdrc_reset() READ16_MEMBER( dcs_audio_device::sdrc_r ) { sdrc_state &sdrc = m_sdrc; - UINT16 result = sdrc.reg[offset]; + uint16_t result = sdrc.reg[offset]; /* offset 3 is for security */ if (offset == 3) @@ -1228,7 +1228,7 @@ READ16_MEMBER( dcs_audio_device::sdrc_r ) WRITE16_MEMBER( dcs_audio_device::sdrc_w ) { sdrc_state &sdrc = m_sdrc; - UINT16 diff = sdrc.reg[offset] ^ data; + uint16_t diff = sdrc.reg[offset] ^ data; switch (offset) { @@ -1309,7 +1309,7 @@ void dcs_audio_device::dsio_reset() READ16_MEMBER( dcs_audio_device::dsio_r ) { dsio_state &dsio = m_dsio; - UINT16 result = dsio.reg[offset]; + uint16_t result = dsio.reg[offset]; if (offset == 1) { @@ -1363,7 +1363,7 @@ void dcs_audio_device::denver_reset() READ16_MEMBER( dcs_audio_device::denver_r ) { - UINT16 result = m_dsio.reg[offset]; + uint16_t result = m_dsio.reg[offset]; if (offset == 3) { @@ -1441,7 +1441,7 @@ WRITE32_MEMBER( dcs_audio_device::dsio_idma_addr_w ) WRITE32_MEMBER( dcs_audio_device::dsio_idma_data_w ) { dsio_state &dsio = m_dsio; - UINT32 pc = space.device().safe_pc(); + uint32_t pc = space.device().safe_pc(); if (ACCESSING_BITS_0_15) { if (LOG_DCS_TRANSFERS) @@ -1464,7 +1464,7 @@ WRITE32_MEMBER( dcs_audio_device::dsio_idma_data_w ) READ32_MEMBER( dcs_audio_device::dsio_idma_data_r ) { - UINT32 result; + uint32_t result; result = downcast(m_cpu)->idma_data_r(); if (LOG_DCS_TRANSFERS) logerror("%08X:IDMA_data_r(%04X) = %04X\n", space.device().safe_pc(), downcast(m_cpu)->idma_addr_r(), result); @@ -1576,7 +1576,7 @@ READ16_MEMBER( dcs_audio_device::fifo_input_r ) INPUT LATCH (data from host to DCS) ****************************************************************************/ -void dcs_audio_device::dcs_delayed_data_w(UINT16 data) +void dcs_audio_device::dcs_delayed_data_w(uint16_t data) { if (LOG_DCS_IO) logerror("%s:dcs_data_w(%04X)\n", machine().describe_context(), data); @@ -1603,7 +1603,7 @@ TIMER_CALLBACK_MEMBER( dcs_audio_device::dcs_delayed_data_w_callback ) } -void dcs_audio_device::data_w(UINT16 data) +void dcs_audio_device::data_w(uint16_t data) { /* preprocess the write */ if (preprocess_write(data)) @@ -1694,7 +1694,7 @@ void dcs_audio_device::ack_w() } -UINT16 dcs_audio_device::data_r() +uint16_t dcs_audio_device::data_r() { /* data is actually only 8 bit (read from d8-d15, which is d0-d7 from the data access instructions POV) on early dcs, but goes 16 on later (seattle) */ if (m_last_output_full && !m_output_full_cb.isnull()) @@ -1752,9 +1752,9 @@ int dcs_audio_device::data2_r() void dcs_audio_device::update_timer_count() { - UINT64 periods_since_start; - UINT64 elapsed_cycles; - UINT64 elapsed_clocks; + uint64_t periods_since_start; + uint64_t elapsed_cycles; + uint64_t elapsed_clocks; /* if not enabled, skip */ if (!m_timer_enable) @@ -1781,12 +1781,12 @@ void dcs_audio_device::update_timer_count() TIMER_DEVICE_CALLBACK_MEMBER( dcs_audio_device::internal_timer_callback ) { - INT64 target_cycles; + int64_t target_cycles; /* compute the absolute cycle when the next one should fire */ /* we do this to avoid drifting */ m_timers_fired++; - target_cycles = m_timer_start_cycles + m_timer_scale * (m_timer_start_count + 1 + m_timers_fired * (UINT64)(m_timer_period + 1)); + target_cycles = m_timer_start_cycles + m_timer_scale * (m_timer_start_count + 1 + m_timers_fired * (uint64_t)(m_timer_period + 1)); target_cycles -= m_cpu->total_cycles(); /* set the next timer, but only if it's for a reasonable number */ @@ -1874,7 +1874,7 @@ WRITE_LINE_MEMBER(dcs_audio_device::timer_enable_callback) READ16_MEMBER( dcs_audio_device::adsp_control_r ) { - UINT16 result = 0xffff; + uint16_t result = 0xffff; switch (offset) { @@ -1987,7 +1987,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( dcs_audio_device::dcs_irq ) { int count = m_size / (2*(m_incs ? m_incs : 1)); // sf2049se was having overflow issues with fixed size of 0x400 buffer (m_size==0xb40, count=0x5a0). - INT16 buffer[0x800]; + int16_t buffer[0x800]; int i; for (i = 0; i < count; i++) @@ -2063,7 +2063,7 @@ WRITE32_MEMBER(dcs_audio_device::sound_tx_callback) { /* get the autobuffer registers */ int mreg, lreg; - UINT16 source; + uint16_t source; m_ireg = (m_control_regs[S1_AUTOBUF_REG] >> 9) & 7; mreg = (m_control_regs[S1_AUTOBUF_REG] >> 7) & 3; @@ -2189,7 +2189,7 @@ TIMER_CALLBACK_MEMBER( dcs_audio_device::s1_ack_callback1 ) } -int dcs_audio_device::preprocess_stage_1(UINT16 data) +int dcs_audio_device::preprocess_stage_1(uint16_t data) { hle_transfer_state &transfer = m_transfer; @@ -2327,7 +2327,7 @@ TIMER_CALLBACK_MEMBER( dcs_audio_device::s2_ack_callback ) } -int dcs_audio_device::preprocess_stage_2(UINT16 data) +int dcs_audio_device::preprocess_stage_2(uint16_t data) { hle_transfer_state &transfer = m_transfer; @@ -2429,7 +2429,7 @@ int dcs_audio_device::preprocess_stage_2(UINT16 data) } -int dcs_audio_device::preprocess_write(UINT16 data) +int dcs_audio_device::preprocess_write(uint16_t data) { hle_transfer_state &transfer = m_transfer; int result; @@ -2461,7 +2461,7 @@ const device_type DCS_AUDIO_2K = &device_creator; // dcs_audio_2k_device - constructor //------------------------------------------------- -dcs_audio_2k_device::dcs_audio_2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dcs_audio_2k_device::dcs_audio_2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dcs_audio_device(mconfig, DCS_AUDIO_2K, "DCS Audio 2K", tag, owner, clock, "dcs_audio_2k", __FILE__) { } @@ -2477,7 +2477,7 @@ const device_type DCS_AUDIO_2K_UART = &device_creator; // dcs_audio_2k_uart_device - constructor //------------------------------------------------- -dcs_audio_2k_uart_device::dcs_audio_2k_uart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dcs_audio_2k_uart_device::dcs_audio_2k_uart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dcs_audio_device(mconfig, DCS_AUDIO_2K_UART, "DCS Audio 2K UART", tag, owner, clock, "dcs_audio_2k_uart", __FILE__) { } @@ -2493,7 +2493,7 @@ const device_type DCS_AUDIO_8K = &device_creator; // dcs_audio_8k_device - constructor //------------------------------------------------- -dcs_audio_8k_device::dcs_audio_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dcs_audio_8k_device::dcs_audio_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dcs_audio_device(mconfig, DCS_AUDIO_8K, "DCS Audio 8K", tag, owner, clock, "dcs_audio_8k", __FILE__) { } @@ -2509,7 +2509,7 @@ const device_type DCS_AUDIO_WPC = &device_creator; // dcs_audio_wpc_device - constructor //------------------------------------------------- -dcs_audio_wpc_device::dcs_audio_wpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dcs_audio_wpc_device::dcs_audio_wpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dcs_audio_device(mconfig, DCS_AUDIO_WPC, "DCS Audio WPC", tag, owner, clock, "dcs_audio_wpc", __FILE__, 15) { } @@ -2525,7 +2525,7 @@ machine_config_constructor dcs_audio_wpc_device::device_mconfig_additions() cons // dcs2_audio_device - constructor //------------------------------------------------- -dcs2_audio_device::dcs2_audio_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) : +dcs2_audio_device::dcs2_audio_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) : dcs_audio_device(mconfig, type, name, tag, owner, clock, shortname, source) { } @@ -2537,7 +2537,7 @@ const device_type DCS2_AUDIO_2115 = &device_creator; // dcs2_audio_2115_device - constructor //------------------------------------------------- -dcs2_audio_2115_device::dcs2_audio_2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dcs2_audio_2115_device::dcs2_audio_2115_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dcs2_audio_device(mconfig, DCS2_AUDIO_2115, "DCS2 Audio 2115", tag, owner, clock, "dcs2_audio_2115", __FILE__) { } @@ -2553,7 +2553,7 @@ const device_type DCS2_AUDIO_2104 = &device_creator; // dcs2_audio_2104_device - constructor //------------------------------------------------- -dcs2_audio_2104_device::dcs2_audio_2104_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dcs2_audio_2104_device::dcs2_audio_2104_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dcs2_audio_device(mconfig, DCS2_AUDIO_2104, "DCS2 Audio 2104", tag, owner, clock, "dcs2_audio_2104", __FILE__) { } @@ -2570,7 +2570,7 @@ const device_type DCS2_AUDIO_DSIO = &device_creator; // dcs2_audio_dsio_device - constructor //------------------------------------------------- -dcs2_audio_dsio_device::dcs2_audio_dsio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dcs2_audio_dsio_device::dcs2_audio_dsio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dcs2_audio_device(mconfig, DCS2_AUDIO_DSIO, "DCS2 Audio DSIO", tag, owner, clock, "dcs2_audio_dsio", __FILE__) { } @@ -2586,7 +2586,7 @@ const device_type DCS2_AUDIO_DENVER = &device_creator; // dcs2_audio_denver_device - constructor //------------------------------------------------- -dcs2_audio_denver_device::dcs2_audio_denver_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dcs2_audio_denver_device::dcs2_audio_denver_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dcs2_audio_device(mconfig, DCS2_AUDIO_DENVER, "DCS2 Audio Denver", tag, owner, clock, "dcs2_audio_denver", __FILE__) { } diff --git a/src/mame/audio/dcs.h b/src/mame/audio/dcs.h index 5b84b994126..11645eca2a2 100644 --- a/src/mame/audio/dcs.h +++ b/src/mame/audio/dcs.h @@ -23,7 +23,7 @@ class dcs_audio_device : public device_t { public: // construction/destruction - dcs_audio_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, int rev = 1); + dcs_audio_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, int rev = 1); // for dcs2 (int dram_in_mb, offs_t polling_offset) static void static_set_dram_in_mb(device_t &device, int dram_in_mb) { downcast(device).m_dram_in_mb = dram_in_mb; } @@ -34,12 +34,12 @@ public: void set_fifo_callbacks(read16_delegate fifo_data_r, read16_delegate fifo_status_r, write_line_delegate fifo_reset_w); void set_io_callbacks(write_line_delegate output_full_cb, write_line_delegate input_empty_cb); - UINT16 data_r(); + uint16_t data_r(); void ack_w(); int data2_r(); int control_r(); - void data_w(UINT16 data); + void data_w(uint16_t data); void reset_w(int state); void fifo_notify(int count, int max); @@ -71,7 +71,7 @@ public: DECLARE_WRITE16_MEMBER( denver_w ); DECLARE_READ16_MEMBER( latch_status_r ); DECLARE_READ16_MEMBER( fifo_input_r ); - void dcs_delayed_data_w(UINT16 data); + void dcs_delayed_data_w(uint16_t data); TIMER_CALLBACK_MEMBER( dcs_delayed_data_w_callback ); DECLARE_WRITE16_MEMBER( input_latch_ack_w ); DECLARE_READ16_MEMBER( input_latch_r ); @@ -99,10 +99,10 @@ public: TIMER_DEVICE_CALLBACK_MEMBER( transfer_watchdog_callback ); TIMER_CALLBACK_MEMBER( s1_ack_callback2 ); TIMER_CALLBACK_MEMBER( s1_ack_callback1 ); - int preprocess_stage_1(UINT16 data); + int preprocess_stage_1(uint16_t data); TIMER_CALLBACK_MEMBER( s2_ack_callback ); - int preprocess_stage_2(UINT16 data); - int preprocess_write(UINT16 data); + int preprocess_stage_2(uint16_t data); + int preprocess_write(uint16_t data); protected: // device-level overrides @@ -112,76 +112,76 @@ protected: protected: struct sdrc_state { - UINT16 reg[4]; - UINT8 seed; + uint16_t reg[4]; + uint8_t seed; }; struct dsio_state { - UINT16 reg[4]; - UINT8 start_on_next_write; - UINT16 channelbits; + uint16_t reg[4]; + uint8_t start_on_next_write; + uint16_t channelbits; }; struct hle_transfer_state { - UINT8 hle_enabled; - INT32 dcs_state; - INT32 state; - INT32 start; - INT32 stop; - INT32 type; - INT32 temp; - INT32 writes_left; - UINT16 sum; - INT32 fifo_entries; + uint8_t hle_enabled; + int32_t dcs_state; + int32_t state; + int32_t start; + int32_t stop; + int32_t type; + int32_t temp; + int32_t writes_left; + uint16_t sum; + int32_t fifo_entries; timer_device *watchdog; }; adsp21xx_device *m_cpu; address_space *m_program; address_space *m_data; - UINT8 m_rev; + uint8_t m_rev; offs_t m_polling_offset; - UINT32 m_polling_count; + uint32_t m_polling_count; /* sound output */ - UINT8 m_channels; - UINT16 m_size; - UINT16 m_incs; + uint8_t m_channels; + uint16_t m_size; + uint16_t m_incs; dmadac_sound_device *m_dmadac[6]; timer_device *m_reg_timer; timer_device *m_sport_timer; timer_device *m_internal_timer; - INT32 m_ireg; - UINT16 m_ireg_base; - UINT16 m_control_regs[32]; + int32_t m_ireg; + uint16_t m_ireg_base; + uint16_t m_control_regs[32]; /* memory access/booting */ - UINT16 * m_bootrom; - UINT32 m_bootrom_words; - UINT16 * m_sounddata; - UINT32 m_sounddata_words; - UINT32 m_sounddata_banks; - UINT16 m_sounddata_bank; + uint16_t * m_bootrom; + uint32_t m_bootrom_words; + uint16_t * m_sounddata; + uint32_t m_sounddata_words; + uint32_t m_sounddata_banks; + uint16_t m_sounddata_bank; optional_memory_bank m_data_bank; memory_bank * m_rom_page; memory_bank * m_dram_page; /* I/O with the host */ - UINT8 m_auto_ack; - UINT16 m_latch_control; - UINT16 m_input_data; - UINT16 m_output_data; - UINT16 m_pre_output_data; - UINT16 m_output_control; - UINT64 m_output_control_cycles; - UINT8 m_last_output_full; - UINT8 m_last_input_empty; - UINT16 m_progflags; + uint8_t m_auto_ack; + uint16_t m_latch_control; + uint16_t m_input_data; + uint16_t m_output_data; + uint16_t m_pre_output_data; + uint16_t m_output_control; + uint64_t m_output_control_cycles; + uint8_t m_last_output_full; + uint8_t m_last_input_empty; + uint16_t m_progflags; write_line_delegate m_output_full_cb; write_line_delegate m_input_empty_cb; @@ -191,18 +191,18 @@ protected: write_line_delegate m_fifo_reset_w; /* timers */ - UINT8 m_timer_enable; - UINT8 m_timer_ignore; - UINT64 m_timer_start_cycles; - UINT32 m_timer_start_count; - UINT32 m_timer_scale; - UINT32 m_timer_period; - UINT32 m_timers_fired; - - UINT16 *m_sram; - UINT16 *m_polling_base; - UINT32 *m_internal_program_ram; - UINT32 *m_external_program_ram; + uint8_t m_timer_enable; + uint8_t m_timer_ignore; + uint64_t m_timer_start_cycles; + uint32_t m_timer_start_count; + uint32_t m_timer_scale; + uint32_t m_timer_period; + uint32_t m_timers_fired; + + uint16_t *m_sram; + uint16_t *m_polling_base; + uint32_t *m_internal_program_ram; + uint32_t *m_external_program_ram; int m_dmovlay_val; @@ -212,7 +212,7 @@ protected: int m_dram_in_mb; - optional_shared_ptr m_iram; + optional_shared_ptr m_iram; }; @@ -222,7 +222,7 @@ class dcs_audio_2k_device : public dcs_audio_device { public: // construction/destruction - dcs_audio_2k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dcs_audio_2k_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; @@ -238,7 +238,7 @@ class dcs_audio_2k_uart_device : public dcs_audio_device { public: // construction/destruction - dcs_audio_2k_uart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dcs_audio_2k_uart_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; @@ -254,7 +254,7 @@ class dcs_audio_8k_device : public dcs_audio_device { public: // construction/destruction - dcs_audio_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dcs_audio_8k_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; @@ -270,7 +270,7 @@ class dcs_audio_wpc_device : public dcs_audio_device { public: // construction/destruction - dcs_audio_wpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dcs_audio_wpc_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; @@ -286,7 +286,7 @@ class dcs2_audio_device : public dcs_audio_device { public: // construction/destruction - dcs2_audio_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); + dcs2_audio_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: // device-level overrides @@ -299,7 +299,7 @@ class dcs2_audio_2115_device : public dcs2_audio_device { public: // construction/destruction - dcs2_audio_2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dcs2_audio_2115_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; @@ -315,7 +315,7 @@ class dcs2_audio_2104_device : public dcs2_audio_device { public: // construction/destruction - dcs2_audio_2104_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dcs2_audio_2104_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; @@ -331,7 +331,7 @@ class dcs2_audio_dsio_device : public dcs2_audio_device { public: // construction/destruction - dcs2_audio_dsio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dcs2_audio_dsio_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; @@ -347,7 +347,7 @@ class dcs2_audio_denver_device : public dcs2_audio_device { public: // construction/destruction - dcs2_audio_denver_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dcs2_audio_denver_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; diff --git a/src/mame/audio/decobsmt.cpp b/src/mame/audio/decobsmt.cpp index c0b3aae1be8..7cbee2d9ef4 100644 --- a/src/mame/audio/decobsmt.cpp +++ b/src/mame/audio/decobsmt.cpp @@ -73,7 +73,7 @@ machine_config_constructor decobsmt_device::device_mconfig_additions() const // decobsmt_device - constructor //------------------------------------------------- -decobsmt_device::decobsmt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +decobsmt_device::decobsmt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DECOBSMT, "Data East/Sega/Stern BSMT2000 Sound Board", tag, owner, clock, "decobsmt", __FILE__), m_ourcpu(*this, M6809_TAG), m_bsmt(*this, BSMT_TAG) @@ -101,7 +101,7 @@ void decobsmt_device::device_reset() WRITE8_MEMBER(decobsmt_device::bsmt_reset_w) { - UINT8 diff = data ^ m_bsmt_reset; + uint8_t diff = data ^ m_bsmt_reset; m_bsmt_reset = data; if ((diff & 0x80) && !(data & 0x80)) m_bsmt->reset(); diff --git a/src/mame/audio/decobsmt.h b/src/mame/audio/decobsmt.h index 715607f47b9..a259d793123 100644 --- a/src/mame/audio/decobsmt.h +++ b/src/mame/audio/decobsmt.h @@ -22,7 +22,7 @@ class decobsmt_device : public device_t { public: // construction/destruction - decobsmt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + decobsmt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER(bsmt_reset_w); DECLARE_READ8_MEMBER(bsmt_status_r); @@ -45,9 +45,9 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; private: - UINT8 m_bsmt_latch; - UINT8 m_bsmt_reset; - UINT8 m_bsmt_comms; + uint8_t m_bsmt_latch; + uint8_t m_bsmt_reset; + uint8_t m_bsmt_comms; }; diff --git a/src/mame/audio/dkong.cpp b/src/mame/audio/dkong.cpp index 8ca9f121dda..869c15d24ce 100644 --- a/src/mame/audio/dkong.cpp +++ b/src/mame/audio/dkong.cpp @@ -1239,7 +1239,7 @@ READ8_MEMBER(dkong_state::dkong_voice_status_r) READ8_MEMBER(dkong_state::dkong_tune_r) { latch8_device *m_ls175_3d = machine().device("ls175.3d"); - UINT8 page = m_dev_vp2->read(space, 0) & 0x47; + uint8_t page = m_dev_vp2->read(space, 0) & 0x47; if ( page & 0x40 ) { diff --git a/src/mame/audio/dsbz80.cpp b/src/mame/audio/dsbz80.cpp index dfc97fd6028..786fd2fe0dd 100644 --- a/src/mame/audio/dsbz80.cpp +++ b/src/mame/audio/dsbz80.cpp @@ -61,7 +61,7 @@ machine_config_constructor dsbz80_device::device_mconfig_additions() const // dsbz80_device - constructor //------------------------------------------------- -dsbz80_device::dsbz80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +dsbz80_device::dsbz80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, DSBZ80, "Sega Z80-based Digital Sound Board", tag, owner, clock, "dsbz80", __FILE__), device_sound_interface(mconfig, *this), m_ourcpu(*this, Z80_TAG) @@ -74,7 +74,7 @@ dsbz80_device::dsbz80_device(const machine_config &mconfig, const char *tag, dev void dsbz80_device::device_start() { - UINT8 *rom_base = machine().root_device().memregion("mpeg")->base(); + uint8_t *rom_base = machine().root_device().memregion("mpeg")->base(); decoder = new mpeg_audio(rom_base, mpeg_audio::L2, false, 0); machine().sound().stream_alloc(*this, 0, 2, 32000); } diff --git a/src/mame/audio/dsbz80.h b/src/mame/audio/dsbz80.h index fb642566245..3d4aae3a2b3 100644 --- a/src/mame/audio/dsbz80.h +++ b/src/mame/audio/dsbz80.h @@ -22,7 +22,7 @@ class dsbz80_device : public device_t, public device_sound_interface { public: // construction/destruction - dsbz80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + dsbz80_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; @@ -49,9 +49,9 @@ protected: private: mpeg_audio *decoder; - INT16 audio_buf[1152*2]; - UINT8 m_dsb_latch; - UINT32 mp_start, mp_end, mp_vol, mp_pan, mp_state, lp_start, lp_end, start, end; + int16_t audio_buf[1152*2]; + uint8_t m_dsb_latch; + uint32_t mp_start, mp_end, mp_vol, mp_pan, mp_state, lp_start, lp_end, start, end; int mp_pos, audio_pos, audio_avail; int status; }; diff --git a/src/mame/audio/exidy.cpp b/src/mame/audio/exidy.cpp index c8bbaaf25ba..a8299ce729c 100644 --- a/src/mame/audio/exidy.cpp +++ b/src/mame/audio/exidy.cpp @@ -112,7 +112,7 @@ static inline void sh6840_apply_clock(struct sh6840_timer_channel *t, int clocks inline int exidy_sound_device::sh6840_update_noise(int clocks) { - UINT32 newxor; + uint32_t newxor; int noise_clocks = 0; int i; @@ -205,13 +205,13 @@ void exidy_sound_device::common_sh_start() const device_type EXIDY = &device_creator; -exidy_sound_device::exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +exidy_sound_device::exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EXIDY, "Exidy SFX", tag, owner, clock, "exidy_sfx", __FILE__), device_sound_interface(mconfig, *this) { } -exidy_sound_device::exidy_sound_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) +exidy_sound_device::exidy_sound_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_sound_interface(mconfig, *this), m_riot_irq_state(0), @@ -282,7 +282,7 @@ void exidy_sound_device::sound_stream_update(sound_stream &stream, stream_sample struct sh8253_timer_channel *c; int clocks_this_sample; int clocks; - INT16 sample = 0; + int16_t sample = 0; /* determine how many 6840 clocks this sample */ m_sh6840_clock_count += m_sh6840_clocks_per_sample; @@ -293,7 +293,7 @@ void exidy_sound_device::sound_stream_update(sound_stream &stream, stream_sample if ((sh6840_timer[0].cr & 0x01) == 0) { int noise_clocks_this_sample = 0; - UINT32 chan0_clocks; + uint32_t chan0_clocks; /* generate E-clocked noise if configured to do so */ if (noisy && !(m_sfxctrl & 0x01)) @@ -446,7 +446,7 @@ WRITE8_MEMBER( exidy_sound_device::r6532_portb_w ) READ8_MEMBER( exidy_sound_device::r6532_portb_r ) { - UINT8 newdata = m_riot->portb_in_get(); + uint8_t newdata = m_riot->portb_in_get(); if (m_tms != nullptr) { newdata &= ~0x0c; @@ -669,7 +669,7 @@ WRITE8_MEMBER( venture_sound_device::filter_w ) const device_type EXIDY_VENTURE = &device_creator; -venture_sound_device::venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +venture_sound_device::venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : exidy_sound_device(mconfig, EXIDY_VENTURE, "Exidy SFX+PSG", tag, owner, clock, "venture_sound", __FILE__) { } @@ -808,8 +808,8 @@ READ8_MEMBER( venture_sound_device::mtrap_voiceio_r ) { if (!(offset & 0x80)) { - UINT8 porta = m_riot->porta_out_get(); - UINT8 data = (porta & 0x06) >> 1; + uint8_t porta = m_riot->porta_out_get(); + uint8_t data = (porta & 0x06) >> 1; data |= (porta & 0x01) << 2; data |= (porta & 0x08); return data; @@ -860,7 +860,7 @@ MACHINE_CONFIG_END READ8_MEMBER( victory_sound_device::response_r ) { - UINT8 ret = m_pia1->b_output(); + uint8_t ret = m_pia1->b_output(); if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", m_maincpu->pcbase(), ret); @@ -873,7 +873,7 @@ READ8_MEMBER( victory_sound_device::response_r ) READ8_MEMBER( victory_sound_device::status_r ) { - UINT8 ret = (m_pia1_ca1 << 7) | (m_pia1_cb1 << 6); + uint8_t ret = (m_pia1_ca1 << 7) | (m_pia1_cb1 << 6); if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", m_maincpu->pcbase(), ret); @@ -924,7 +924,7 @@ WRITE_LINE_MEMBER( victory_sound_device::main_ack_w ) const device_type EXIDY_VICTORY = &device_creator; -victory_sound_device::victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +victory_sound_device::victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : exidy_sound_device(mconfig, EXIDY_VICTORY, "Exidy SFX+PSG+Speech", tag, owner, clock, "victory_sound", __FILE__), m_victory_sound_response_ack_clk(0) { diff --git a/src/mame/audio/exidy.h b/src/mame/audio/exidy.h index 6f2eef49b56..56cd6f2fb3c 100644 --- a/src/mame/audio/exidy.h +++ b/src/mame/audio/exidy.h @@ -8,37 +8,37 @@ /* 6840 variables */ struct sh6840_timer_channel { - UINT8 cr; - UINT8 state; - UINT8 leftovers; - UINT16 timer; - UINT32 clocks; + uint8_t cr; + uint8_t state; + uint8_t leftovers; + uint16_t timer; + uint32_t clocks; union { #ifdef LSB_FIRST - struct { UINT8 l, h; } b; + struct { uint8_t l, h; } b; #else - struct { UINT8 h, l; } b; + struct { uint8_t h, l; } b; #endif - UINT16 w; + uint16_t w; } counter; }; struct sh8253_timer_channel { - UINT8 clstate; - UINT8 enable; - UINT16 count; - UINT32 step; - UINT32 fraction; + uint8_t clstate; + uint8_t enable; + uint16_t count; + uint32_t step; + uint32_t fraction; }; class exidy_sound_device : public device_t, public device_sound_interface { public: - exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - exidy_sound_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); + exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + exidy_sound_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); ~exidy_sound_device() {} DECLARE_READ8_MEMBER( sh6840_r ); @@ -77,7 +77,7 @@ protected: riot6532_device *m_riot; /* IRQ variable */ - UINT8 m_riot_irq_state; + uint8_t m_riot_irq_state; /* 8253 variables */ int m_has_sh8253; @@ -96,18 +96,18 @@ protected: private: // internal state struct sh6840_timer_channel m_sh6840_timer[3]; - INT16 m_sh6840_volume[3]; - UINT8 m_sh6840_MSB_latch; - UINT8 m_sh6840_LSB_latch; - UINT8 m_sh6840_LFSR_oldxor; - UINT32 m_sh6840_LFSR_0; - UINT32 m_sh6840_LFSR_1; - UINT32 m_sh6840_LFSR_2; - UINT32 m_sh6840_LFSR_3; - UINT32 m_sh6840_clocks_per_sample; - UINT32 m_sh6840_clock_count; - - UINT8 m_sfxctrl; + int16_t m_sh6840_volume[3]; + uint8_t m_sh6840_MSB_latch; + uint8_t m_sh6840_LSB_latch; + uint8_t m_sh6840_LFSR_oldxor; + uint32_t m_sh6840_LFSR_0; + uint32_t m_sh6840_LFSR_1; + uint32_t m_sh6840_LFSR_2; + uint32_t m_sh6840_LFSR_3; + uint32_t m_sh6840_clocks_per_sample; + uint32_t m_sh6840_clock_count; + + uint8_t m_sfxctrl; inline int sh6840_update_noise(int clocks); }; @@ -117,7 +117,7 @@ extern const device_type EXIDY; class venture_sound_device : public exidy_sound_device { public: - venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( mtrap_voiceio_w ); DECLARE_READ8_MEMBER( mtrap_voiceio_r ); @@ -139,7 +139,7 @@ extern const device_type EXIDY_VENTURE; class victory_sound_device : public exidy_sound_device { public: - victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( response_r ); DECLARE_READ8_MEMBER( status_r ); @@ -158,7 +158,7 @@ protected: private: // internal state - UINT8 m_victory_sound_response_ack_clk; /* 7474 @ F4 */ + uint8_t m_victory_sound_response_ack_clk; /* 7474 @ F4 */ TIMER_CALLBACK_MEMBER( delayed_command_w ); diff --git a/src/mame/audio/exidy440.cpp b/src/mame/audio/exidy440.cpp index 78c122a9caf..04e9eadaeb5 100644 --- a/src/mame/audio/exidy440.cpp +++ b/src/mame/audio/exidy440.cpp @@ -48,7 +48,7 @@ static const int channel_bits[4] = const device_type EXIDY440 = &device_creator; -exidy440_sound_device::exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +exidy440_sound_device::exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, EXIDY440, "Exidy 440 CVSD", tag, owner, clock, "exidy440_sound", __FILE__), device_sound_interface(mconfig, *this), m_sound_command(0), @@ -121,15 +121,15 @@ void exidy440_sound_device::device_start() /* allocate the sample cache */ length = machine().root_device().memregion("cvsd")->bytes() * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry); - m_sound_cache = (sound_cache_entry *)auto_alloc_array_clear(machine(), UINT8, length); + m_sound_cache = (sound_cache_entry *)auto_alloc_array_clear(machine(), uint8_t, length); /* determine the hard end of the cache and reset */ - m_sound_cache_max = (sound_cache_entry *)((UINT8 *)m_sound_cache + length); + m_sound_cache_max = (sound_cache_entry *)((uint8_t *)m_sound_cache + length); reset_sound_cache(); /* allocate the mixer buffer */ - m_mixer_buffer_left = make_unique_clear(clock()); - m_mixer_buffer_right = make_unique_clear(clock()); + m_mixer_buffer_left = make_unique_clear(clock()); + m_mixer_buffer_right = make_unique_clear(clock()); if (SOUND_LOG) m_debuglog = fopen("sound.log", "w"); @@ -151,10 +151,10 @@ void exidy440_sound_device::device_stop() * *************************************/ -void exidy440_sound_device::add_and_scale_samples(int ch, INT32 *dest, int samples, int volume) +void exidy440_sound_device::add_and_scale_samples(int ch, int32_t *dest, int samples, int volume) { sound_channel_data *channel = &m_sound_channel[ch]; - INT16 *srcdata; + int16_t *srcdata; int i; /* channels 2 and 3 are half-rate samples */ @@ -172,7 +172,7 @@ void exidy440_sound_device::add_and_scale_samples(int ch, INT32 *dest, int sampl /* copy 1 for 2 to the destination */ for (i = 0; i < samples; i += 2) { - INT16 sample = *srcdata++ * volume / 256; + int16_t sample = *srcdata++ * volume / 256; *dest++ += sample; *dest++ += sample; } @@ -197,14 +197,14 @@ void exidy440_sound_device::add_and_scale_samples(int ch, INT32 *dest, int sampl void exidy440_sound_device::mix_to_16(int length, stream_sample_t *dest_left, stream_sample_t *dest_right) { - INT32 *mixer_left = m_mixer_buffer_left.get(); - INT32 *mixer_right = m_mixer_buffer_right.get(); + int32_t *mixer_left = m_mixer_buffer_left.get(); + int32_t *mixer_right = m_mixer_buffer_right.get(); int i, clippers = 0; for (i = 0; i < length; i++) { - INT32 sample_left = *mixer_left++; - INT32 sample_right = *mixer_right++; + int32_t sample_left = *mixer_left++; + int32_t sample_right = *mixer_right++; if (sample_left < -32768) { sample_left = -32768; clippers++; } else if (sample_left > 32767) { sample_left = 32767; clippers++; } @@ -232,7 +232,7 @@ READ8_MEMBER( exidy440_sound_device::sound_command_r ) } -void exidy440_sound_device::exidy440_sound_command(UINT8 param) +void exidy440_sound_device::exidy440_sound_command(uint8_t param) { m_sound_command = param; m_sound_command_ack = 0; @@ -240,7 +240,7 @@ void exidy440_sound_device::exidy440_sound_command(UINT8 param) } -UINT8 exidy440_sound_device::exidy440_sound_command_ack() +uint8_t exidy440_sound_device::exidy440_sound_command_ack() { return m_sound_command_ack; } @@ -522,12 +522,12 @@ void exidy440_sound_device::reset_sound_cache() } -INT16 *exidy440_sound_device::add_to_sound_cache(UINT8 *input, int address, int length, int bits, int frequency) +int16_t *exidy440_sound_device::add_to_sound_cache(uint8_t *input, int address, int length, int bits, int frequency) { sound_cache_entry *current = m_sound_cache_end; /* compute where the end will be once we add this entry */ - m_sound_cache_end = (sound_cache_entry *)((UINT8 *)current + sizeof(sound_cache_entry) + length * 16); + m_sound_cache_end = (sound_cache_entry *)((uint8_t *)current + sizeof(sound_cache_entry) + length * 16); /* if this will overflow the cache, reset and re-add */ if (m_sound_cache_end > m_sound_cache_max) @@ -549,7 +549,7 @@ INT16 *exidy440_sound_device::add_to_sound_cache(UINT8 *input, int address, int } -INT16 *exidy440_sound_device::find_or_add_to_sound_cache(int address, int length, int bits, int frequency) +int16_t *exidy440_sound_device::find_or_add_to_sound_cache(int address, int length, int bits, int frequency) { sound_cache_entry *current; @@ -573,7 +573,7 @@ void exidy440_sound_device::play_cvsd(int ch) sound_channel_data *channel = &m_sound_channel[ch]; int address = m_m6844_channel[ch].address; int length = m_m6844_channel[ch].counter; - INT16 *base; + int16_t *base; /* add the bank number to the address */ if (m_sound_banks[ch] & 1) @@ -634,11 +634,11 @@ void exidy440_sound_device::stop_cvsd(int ch) * *************************************/ -void exidy440_sound_device::fir_filter(INT32 *input, INT16 *output, int count) +void exidy440_sound_device::fir_filter(int32_t *input, int16_t *output, int count) { while (count--) { - INT32 result = (input[-1] - input[-8] - input[-48] + input[-55]) << 2; + int32_t result = (input[-1] - input[-8] - input[-48] + input[-55]) << 2; result += (input[0] + input[-18] + input[-38] + input[-56]) << 3; result += (-input[-2] - input[-4] + input[-5] + input[-51] - input[-52] - input[-54]) << 4; result += (-input[-3] - input[-11] - input[-45] - input[-53]) << 5; @@ -669,9 +669,9 @@ void exidy440_sound_device::fir_filter(INT32 *input, INT16 *output, int count) * *************************************/ -void exidy440_sound_device::decode_and_filter_cvsd(UINT8 *input, int bytes, int maskbits, int frequency, INT16 *output) +void exidy440_sound_device::decode_and_filter_cvsd(uint8_t *input, int bytes, int maskbits, int frequency, int16_t *output) { - INT32 buffer[SAMPLE_BUFFER_LENGTH + FIR_HISTORY_LENGTH]; + int32_t buffer[SAMPLE_BUFFER_LENGTH + FIR_HISTORY_LENGTH]; int total_samples = bytes * 8; int mask = (1 << maskbits) - 1; double filter, integrator, leak; @@ -688,7 +688,7 @@ void exidy440_sound_device::decode_and_filter_cvsd(UINT8 *input, int bytes, int gain = SAMPLE_GAIN; /* clear the history words for a start */ - memset(&buffer[0], 0, FIR_HISTORY_LENGTH * sizeof(INT32)); + memset(&buffer[0], 0, FIR_HISTORY_LENGTH * sizeof(int32_t)); /* initialize the CVSD decoder */ steps = 0xaa; @@ -698,7 +698,7 @@ void exidy440_sound_device::decode_and_filter_cvsd(UINT8 *input, int bytes, int /* loop over chunks */ for (chunk_start = 0; chunk_start < total_samples; chunk_start += SAMPLE_BUFFER_LENGTH) { - INT32 *bufptr = &buffer[FIR_HISTORY_LENGTH]; + int32_t *bufptr = &buffer[FIR_HISTORY_LENGTH]; int chunk_bytes; int ind; @@ -771,13 +771,13 @@ void exidy440_sound_device::decode_and_filter_cvsd(UINT8 *input, int bytes, int fir_filter(&buffer[FIR_HISTORY_LENGTH], &output[chunk_start], chunk_bytes * 8); /* copy the last few input samples down to the start for a new history */ - memcpy(&buffer[0], &buffer[SAMPLE_BUFFER_LENGTH], FIR_HISTORY_LENGTH * sizeof(INT32)); + memcpy(&buffer[0], &buffer[SAMPLE_BUFFER_LENGTH], FIR_HISTORY_LENGTH * sizeof(int32_t)); } /* make sure the volume goes smoothly to 0 over the last 512 samples */ if (FADE_TO_ZERO) { - INT16 *data; + int16_t *data; chunk_start = (total_samples > 512) ? total_samples - 512 : 0; data = output + chunk_start; @@ -804,8 +804,8 @@ void exidy440_sound_device::sound_stream_update(sound_stream &stream, stream_sam int ch; /* reset the mixer buffers */ - memset(m_mixer_buffer_left.get(), 0, samples * sizeof(INT32)); - memset(m_mixer_buffer_right.get(), 0, samples * sizeof(INT32)); + memset(m_mixer_buffer_left.get(), 0, samples * sizeof(int32_t)); + memset(m_mixer_buffer_right.get(), 0, samples * sizeof(int32_t)); /* loop over channels */ for (ch = 0; ch < 4; ch++) diff --git a/src/mame/audio/exidy440.h b/src/mame/audio/exidy440.h index 0dafc17adf6..be325c5c177 100644 --- a/src/mame/audio/exidy440.h +++ b/src/mame/audio/exidy440.h @@ -6,7 +6,7 @@ struct m6844_channel_data int active; int address; int counter; - UINT8 control; + uint8_t control; int start_address; int start_counter; }; @@ -15,7 +15,7 @@ struct m6844_channel_data /* channel_data structure holds info about each active sound channel */ struct sound_channel_data { - INT16 *base; + int16_t *base; int offset; int remaining; }; @@ -29,14 +29,14 @@ struct sound_cache_entry int length; int bits; int frequency; - INT16 data[1]; + int16_t data[1]; }; class exidy440_sound_device : public device_t, public device_sound_interface { public: - exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~exidy440_sound_device() {} DECLARE_READ8_MEMBER( sound_command_r ); @@ -47,8 +47,8 @@ public: DECLARE_WRITE8_MEMBER( m6844_w ); DECLARE_WRITE8_MEMBER( sound_banks_w ); - void exidy440_sound_command(UINT8 param); - UINT8 exidy440_sound_command_ack(); + void exidy440_sound_command(uint8_t param); + uint8_t exidy440_sound_command_ack(); protected: // device-level overrides @@ -61,23 +61,23 @@ protected: private: // internal state - UINT8 m_sound_command; - UINT8 m_sound_command_ack; - - UINT8 m_sound_banks[4]; - //UINT8 m_m6844_data[0x20]; - UINT8 m_sound_volume[0x10]; - std::unique_ptr m_mixer_buffer_left; - std::unique_ptr m_mixer_buffer_right; + uint8_t m_sound_command; + uint8_t m_sound_command_ack; + + uint8_t m_sound_banks[4]; + //uint8_t m_m6844_data[0x20]; + uint8_t m_sound_volume[0x10]; + std::unique_ptr m_mixer_buffer_left; + std::unique_ptr m_mixer_buffer_right; sound_cache_entry *m_sound_cache; sound_cache_entry *m_sound_cache_end; sound_cache_entry *m_sound_cache_max; /* 6844 description */ m6844_channel_data m_m6844_channel[4]; - UINT8 m_m6844_priority; - UINT8 m_m6844_interrupt; - UINT8 m_m6844_chain; + uint8_t m_m6844_priority; + uint8_t m_m6844_interrupt; + uint8_t m_m6844_chain; /* sound interface parameters */ sound_stream *m_stream; @@ -95,13 +95,13 @@ private: void stop_cvsd(int ch); void reset_sound_cache(); - INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits, int frequency); - INT16 *find_or_add_to_sound_cache(int address, int length, int bits, int frequency); + int16_t *add_to_sound_cache(uint8_t *input, int address, int length, int bits, int frequency); + int16_t *find_or_add_to_sound_cache(int address, int length, int bits, int frequency); - void decode_and_filter_cvsd(UINT8 *data, int bytes, int maskbits, int frequency, INT16 *dest); - void fir_filter(INT32 *input, INT16 *output, int count); + void decode_and_filter_cvsd(uint8_t *data, int bytes, int maskbits, int frequency, int16_t *dest); + void fir_filter(int32_t *input, int16_t *output, int count); - void add_and_scale_samples(int ch, INT32 *dest, int samples, int volume); + void add_and_scale_samples(int ch, int32_t *dest, int samples, int volume); void mix_to_16(int length, stream_sample_t *dest_left, stream_sample_t *dest_right); }; diff --git a/src/mame/audio/galaxian.cpp b/src/mame/audio/galaxian.cpp index ca4505c00e9..7425c98e712 100644 --- a/src/mame/audio/galaxian.cpp +++ b/src/mame/audio/galaxian.cpp @@ -389,7 +389,7 @@ DISCRETE_SOUND_END const device_type GALAXIAN = &device_creator; -galaxian_sound_device::galaxian_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +galaxian_sound_device::galaxian_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GALAXIAN, "Galaxian Audio Custom", tag, owner, clock, "galaxian_sound", __FILE__), device_sound_interface(mconfig, *this), m_lfo_val(0) @@ -433,7 +433,7 @@ WRITE8_MEMBER( galaxian_sound_device::pitch_w ) WRITE8_MEMBER( galaxian_sound_device::lfo_freq_w ) { - UINT8 lfo_val_new = (m_lfo_val & ~(1<; const int gamate_sound_device::DAConverter[]={ 0, 3, 7, 13, 23, 41, 75, 137, 249, 453, 825, 1499, 2726, 4956, 9011, 16383 }; // (*.55) on the real below index 8 bareless measureable -const UINT8 Mask[]={ 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0x1f, 0x3f, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xf }; +const uint8_t Mask[]={ 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0x1f, 0x3f, 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0xf }; const int EnvelopeVolumes[]={ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }; //************************************************************************** // LIVE DEVICE @@ -26,7 +26,7 @@ const int EnvelopeVolumes[]={ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // gamate_sound_device - constructor //------------------------------------------------- -gamate_sound_device::gamate_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gamate_sound_device::gamate_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GAMATE_SND, "Gamate Audio Custom", tag, owner, clock, "gamate_sound", __FILE__) , device_sound_interface(mconfig, *this) , m_mixer_channel(nullptr) @@ -174,7 +174,7 @@ void gamate_sound_device::sound_stream_update(sound_stream &stream, stream_sampl WRITE8_MEMBER( gamate_sound_device::device_w ) { - UINT16 size; + uint16_t size; m_mixer_channel->update(); reg[offset] = data; @@ -245,7 +245,7 @@ WRITE8_MEMBER( gamate_sound_device::device_w ) READ8_MEMBER( gamate_sound_device::device_r ) { - UINT8 data=0; + uint8_t data=0; if ((offset&0xf); -geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GEEBEE, "Gee Bee Audio Custom", tag, owner, clock, "geebee_sound", __FILE__), device_sound_interface(mconfig, *this), m_decay(nullptr), @@ -36,10 +36,10 @@ geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const ch void geebee_sound_device::device_start() { - m_decay = std::make_unique(32768); + m_decay = std::make_unique(32768); for (int i = 0; i < 0x8000; i++) - m_decay[0x7fff - i] = (INT16) (0x7fff/exp(1.0*i/4096)); + m_decay[0x7fff - i] = (int16_t) (0x7fff/exp(1.0*i/4096)); /* 1V = HSYNC = 18.432MHz / 3 / 2 / 384 = 8000Hz */ m_channel = machine().sound().stream_alloc(*this, 0, 1, 18432000 / 3 / 2 / 384); diff --git a/src/mame/audio/geebee.h b/src/mame/audio/geebee.h index 643d8982028..94d5fa01561 100644 --- a/src/mame/audio/geebee.h +++ b/src/mame/audio/geebee.h @@ -5,7 +5,7 @@ class geebee_sound_device : public device_t, public device_sound_interface { public: - geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); enum { @@ -25,7 +25,7 @@ protected: private: // internal state - std::unique_ptr m_decay; + std::unique_ptr m_decay; sound_stream *m_channel; int m_sound_latch; int m_sound_signal; diff --git a/src/mame/audio/gomoku.cpp b/src/mame/audio/gomoku.cpp index 9743ea2884e..23ea836c212 100644 --- a/src/mame/audio/gomoku.cpp +++ b/src/mame/audio/gomoku.cpp @@ -27,7 +27,7 @@ const device_type GOMOKU = &device_creator; // gomoku_sound_device - constructor //------------------------------------------------- -gomoku_sound_device::gomoku_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gomoku_sound_device::gomoku_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GOMOKU, "Gomoku Narabe Renju Audio Custom", tag, owner, clock, "gomoku_sound", __FILE__), device_sound_interface(mconfig, *this), m_last_channel(nullptr), @@ -41,8 +41,8 @@ gomoku_sound_device::gomoku_sound_device(const machine_config &mconfig, const ch m_mixer_buffer_2(nullptr) { memset(m_channel_list, 0, sizeof(gomoku_sound_channel)*GOMOKU_MAX_VOICES); - memset(m_soundregs1, 0, sizeof(UINT8)*0x20); - memset(m_soundregs2, 0, sizeof(UINT8)*0x20); + memset(m_soundregs1, 0, sizeof(uint8_t)*0x20); + memset(m_soundregs2, 0, sizeof(uint8_t)*0x20); } @@ -180,7 +180,7 @@ void gomoku_sound_device::make_mixer_table(int voices, int gain) int i; /* allocate memory */ - m_mixer_table = std::make_unique(256 * voices); + m_mixer_table = std::make_unique(256 * voices); /* find the middle of the table */ m_mixer_lookup = m_mixer_table.get() + (128 * voices); diff --git a/src/mame/audio/gorf.cpp b/src/mame/audio/gorf.cpp index d5df98eb720..21f7272925c 100644 --- a/src/mame/audio/gorf.cpp +++ b/src/mame/audio/gorf.cpp @@ -113,7 +113,7 @@ const char *const gorf_sample_names[] = READ8_MEMBER( astrocde_state::gorf_speech_r ) { - UINT8 data = offset >> 8; + uint8_t data = offset >> 8; #if USE_FAKE_VOTRAX int Phoneme, Intonation; int i = 0; diff --git a/src/mame/audio/gottlieb.cpp b/src/mame/audio/gottlieb.cpp index 17db18103dd..5a7924a491b 100644 --- a/src/mame/audio/gottlieb.cpp +++ b/src/mame/audio/gottlieb.cpp @@ -37,7 +37,7 @@ extern const device_type GOTTLIEB_SOUND_REV2 = &device_creatorset_input_line(INPUT_LINE_NMI, PULSE_LINE); } -void gottlieb_sound_r1_device::fake_votrax_data_w(UINT8 data) +void gottlieb_sound_r1_device::fake_votrax_data_w(uint8_t data) { static const char *const PhonemeTable[0x40] = { @@ -257,7 +257,7 @@ MACHINE_CONFIG_END // gottlieb_sound_r0_device - constructors //------------------------------------------------- -gottlieb_sound_r0_device::gottlieb_sound_r0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gottlieb_sound_r0_device::gottlieb_sound_r0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GOTTLIEB_SOUND_REV1, "Gottlieb Sound rev. 0", tag, owner, clock, "gotsndr0", __FILE__) , device_mixer_interface(mconfig, *this) , m_audiocpu(*this, "audiocpu") @@ -284,8 +284,8 @@ READ8_MEMBER( gottlieb_sound_r0_device::r6530b_r ) WRITE8_MEMBER( gottlieb_sound_r0_device::write ) { // write the command data to the low 4 bits - UINT8 pb0_3 = data ^ 15; - UINT8 pb4_7 = ioport("SB0")->read() & 0x90; + uint8_t pb0_3 = data ^ 15; + uint8_t pb4_7 = ioport("SB0")->read() & 0x90; m_sndcmd = pb0_3 | pb4_7; m_r6530->write(space, offset, m_sndcmd); } @@ -382,7 +382,7 @@ void gottlieb_sound_r0_device::device_start() // gottlieb_sound_r1_device - constructors //------------------------------------------------- -gottlieb_sound_r1_device::gottlieb_sound_r1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gottlieb_sound_r1_device::gottlieb_sound_r1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GOTTLIEB_SOUND_REV1, "Gottlieb Sound rev. 1", tag, owner, clock, "gotsndr1", __FILE__), device_mixer_interface(mconfig, *this), m_audiocpu(*this, "audiocpu"), @@ -399,7 +399,7 @@ gottlieb_sound_r1_device::gottlieb_sound_r1_device(const machine_config &mconfig { } -gottlieb_sound_r1_device::gottlieb_sound_r1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, bool populate_votrax) +gottlieb_sound_r1_device::gottlieb_sound_r1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool populate_votrax) : device_t(mconfig, GOTTLIEB_SOUND_REV1, "Gottlieb Sound rev. 1", tag, owner, clock, "gotsndr1", __FILE__), device_mixer_interface(mconfig, *this), m_audiocpu(*this, "audiocpu"), @@ -424,8 +424,8 @@ gottlieb_sound_r1_device::gottlieb_sound_r1_device(const machine_config &mconfig WRITE8_MEMBER( gottlieb_sound_r1_device::write ) { // write the command data to the low 6 bits, and the trigger to the upper bit - UINT8 pa7 = (data & 0x0f) != 0xf; - UINT8 pa0_5 = ~data & 0x3f; + uint8_t pa7 = (data & 0x0f) != 0xf; + uint8_t pa0_5 = ~data & 0x3f; m_riot->porta_in_set(pa0_5 | (pa7 << 7), 0xbf); #if USE_FAKE_VOTRAX @@ -626,7 +626,7 @@ void gottlieb_sound_r1_device::device_start() // constructor //------------------------------------------------- -gottlieb_sound_r1_with_votrax_device::gottlieb_sound_r1_with_votrax_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gottlieb_sound_r1_with_votrax_device::gottlieb_sound_r1_with_votrax_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : gottlieb_sound_r1_device(mconfig, tag, owner, clock, true) { } @@ -663,7 +663,7 @@ ioport_constructor gottlieb_sound_r1_with_votrax_device::device_input_ports() co // gottlieb_sound_r2_device - constructor //------------------------------------------------- -gottlieb_sound_r2_device::gottlieb_sound_r2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gottlieb_sound_r2_device::gottlieb_sound_r2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GOTTLIEB_SOUND_REV2, "Gottlieb Sound rev. 2", tag, owner, clock, "gotsndr2", __FILE__), device_mixer_interface(mconfig, *this), m_audiocpu(*this, "audiocpu"), @@ -809,7 +809,7 @@ CUSTOM_INPUT_MEMBER( gottlieb_sound_r2_device::speech_drq_custom_r ) WRITE8_MEMBER( gottlieb_sound_r2_device::speech_control_w ) { - UINT8 previous = m_speech_control; + uint8_t previous = m_speech_control; m_speech_control = data; // bit 0 enables/disables the NMI line diff --git a/src/mame/audio/gottlieb.h b/src/mame/audio/gottlieb.h index cb5f678586b..77753f57e8d 100644 --- a/src/mame/audio/gottlieb.h +++ b/src/mame/audio/gottlieb.h @@ -50,7 +50,7 @@ class gottlieb_sound_r0_device : public device_t, public device_mixer_interface { public: // construction/destruction - gottlieb_sound_r0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gottlieb_sound_r0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write DECLARE_WRITE8_MEMBER( write ); @@ -70,7 +70,7 @@ private: required_device m_audiocpu; required_device m_r6530; - UINT8 m_sndcmd; + uint8_t m_sndcmd; }; // ======================> gottlieb_sound_r1_device @@ -80,8 +80,8 @@ class gottlieb_sound_r1_device : public device_t, public device_mixer_interface { public: // construction/destruction - gottlieb_sound_r1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - gottlieb_sound_r1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, bool populate_votrax); + gottlieb_sound_r1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + gottlieb_sound_r1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool populate_votrax); // read/write DECLARE_WRITE8_MEMBER( write ); @@ -107,19 +107,19 @@ private: // internal state //bool m_populate_votrax; - UINT8 m_last_speech_clock; + uint8_t m_last_speech_clock; #if USE_FAKE_VOTRAX protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - void fake_votrax_data_w(UINT8 data); - void trigger_sample(UINT8 data); + void fake_votrax_data_w(uint8_t data); + void trigger_sample(uint8_t data); optional_device m_samples; - UINT8 m_score_sample; - UINT8 m_random_offset; - UINT8 m_votrax_queue[100]; - UINT8 m_votrax_queuepos; + uint8_t m_score_sample; + uint8_t m_random_offset; + uint8_t m_votrax_queue[100]; + uint8_t m_votrax_queuepos; #endif }; @@ -128,7 +128,7 @@ class gottlieb_sound_r1_with_votrax_device : public gottlieb_sound_r1_device { public: // construction/destruction - gottlieb_sound_r1_with_votrax_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gottlieb_sound_r1_with_votrax_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides @@ -144,7 +144,7 @@ class gottlieb_sound_r2_device : public device_t, public device_mixer_interface { public: // construction/destruction - gottlieb_sound_r2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gottlieb_sound_r2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers static void static_enable_cobram3_mods(device_t &device); @@ -192,15 +192,15 @@ private: // internal state bool m_cobram3_mod; emu_timer * m_nmi_timer; - UINT8 m_nmi_rate; - UINT8 m_nmi_state; - UINT8 m_audiocpu_latch; - UINT8 m_speechcpu_latch; - UINT8 m_speech_control; - UINT8 m_last_command; - UINT8 m_psg_latch; - UINT8 m_psg_data_latch; - UINT8 m_sp0250_latch; + uint8_t m_nmi_rate; + uint8_t m_nmi_state; + uint8_t m_audiocpu_latch; + uint8_t m_speechcpu_latch; + uint8_t m_speech_control; + uint8_t m_last_command; + uint8_t m_psg_latch; + uint8_t m_psg_data_latch; + uint8_t m_sp0250_latch; }; diff --git a/src/mame/audio/gridlee.cpp b/src/mame/audio/gridlee.cpp index b7575c2c34f..742d3d57ec3 100644 --- a/src/mame/audio/gridlee.cpp +++ b/src/mame/audio/gridlee.cpp @@ -22,7 +22,7 @@ const device_type GRIDLEE = &device_creator; // gridlee_sound_device - constructor //------------------------------------------------- -gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, GRIDLEE, "Gridlee Audio Custom", tag, owner, clock, "gridlee_sound", __FILE__), device_sound_interface(mconfig, *this), m_tone_step(0), @@ -32,7 +32,7 @@ gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const m_samples(nullptr), m_freq_to_step(0.0) { - memset(m_sound_data, 0, sizeof(UINT8)*24); + memset(m_sound_data, 0, sizeof(uint8_t)*24); } @@ -72,7 +72,7 @@ void gridlee_sound_device::sound_stream_update(sound_stream &stream, stream_samp WRITE8_MEMBER( gridlee_sound_device::gridlee_sound_w ) { - UINT8 *sound_data = m_sound_data; + uint8_t *sound_data = m_sound_data; samples_device *samples = m_samples; m_stream->update(); diff --git a/src/mame/audio/harddriv.cpp b/src/mame/audio/harddriv.cpp index 7c38118370a..5391dcee945 100644 --- a/src/mame/audio/harddriv.cpp +++ b/src/mame/audio/harddriv.cpp @@ -27,7 +27,7 @@ const device_type HARDDRIV_SOUND_BOARD_DEVICE = &device_creator; -harddriv_sound_board_device::harddriv_sound_board_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +harddriv_sound_board_device::harddriv_sound_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HARDDRIV_SOUND_BOARD_DEVICE, "Hard Drivin' Sound Board", tag, owner, clock, "harddriv_sound", __FILE__), m_soundcpu(*this, "soundcpu"), m_dac(*this, "dac"), @@ -300,8 +300,8 @@ WRITE16_MEMBER(harddriv_sound_board_device::hdsnd68k_320com_w) READ_LINE_MEMBER(harddriv_sound_board_device::hdsnddsp_get_bio) { - UINT64 cycles_since_last_bio = m_sounddsp->total_cycles() - m_last_bio_cycles; - INT32 cycles_until_bio = CYCLES_PER_BIO - cycles_since_last_bio; + uint64_t cycles_since_last_bio = m_sounddsp->total_cycles() - m_last_bio_cycles; + int32_t cycles_until_bio = CYCLES_PER_BIO - cycles_since_last_bio; /* if we're not at the next BIO yet, advance us there */ if (cycles_until_bio > 0) diff --git a/src/mame/audio/hng64.cpp b/src/mame/audio/hng64.cpp index d6395327b29..2c826b91329 100644 --- a/src/mame/audio/hng64.cpp +++ b/src/mame/audio/hng64.cpp @@ -65,8 +65,8 @@ WRITE32_MEMBER(hng64_state::hng64_soundram_w) { //logerror("hng64_soundram_w %08x: %08x %08x\n", offset, data, mem_mask); - UINT32 mem_mask32 = mem_mask; - UINT32 data32 = data; + uint32_t mem_mask32 = mem_mask; + uint32_t data32 = data; /* swap data around.. keep the v53 happy */ data = data32 >> 16; @@ -92,7 +92,7 @@ WRITE32_MEMBER(hng64_state::hng64_soundram_w) fp=fopen(filename, "w+b"); if (fp) { - fwrite((UINT8*)m_soundram.get(), 0x80000*4, 1, fp); + fwrite((uint8_t*)m_soundram.get(), 0x80000*4, 1, fp); fclose(fp); } } @@ -102,8 +102,8 @@ WRITE32_MEMBER(hng64_state::hng64_soundram_w) READ32_MEMBER(hng64_state::hng64_soundram_r) { - UINT16 datalo = m_soundram[offset * 2 + 0]; - UINT16 datahi = m_soundram[offset * 2 + 1]; + uint16_t datalo = m_soundram[offset * 2 + 0]; + uint16_t datahi = m_soundram[offset * 2 + 1]; return flipendian_int16(datahi) | (flipendian_int16(datalo) << 16); } @@ -145,7 +145,7 @@ WRITE32_MEMBER( hng64_state::hng64_soundcpu_enable_w ) void hng64_state::reset_sound() { - UINT8 *RAM = (UINT8*)m_soundram.get(); + uint8_t *RAM = (uint8_t*)m_soundram.get(); membank("bank0")->set_base(&RAM[0x1f0000]); membank("bank1")->set_base(&RAM[0x1f0000]); membank("bank2")->set_base(&RAM[0x1f0000]); @@ -222,7 +222,7 @@ WRITE16_MEMBER(hng64_state::hng64_sound_bank_w) // the 2 early games don't do this.. maybe all banks actuallly default to that region tho? // the sound code on those games seems buggier anyway. - UINT8 *RAM = (UINT8*)m_soundram.get(); + uint8_t *RAM = (uint8_t*)m_soundram.get(); int bank = data & 0x1f; diff --git a/src/mame/audio/hyprolyb.cpp b/src/mame/audio/hyprolyb.cpp index 3e9b29d356c..5cbde2908fc 100644 --- a/src/mame/audio/hyprolyb.cpp +++ b/src/mame/audio/hyprolyb.cpp @@ -6,7 +6,7 @@ const device_type HYPROLYB_ADPCM = &device_creator; -hyprolyb_adpcm_device::hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hyprolyb_adpcm_device::hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HYPROLYB_ADPCM, "Hyper Olympics Audio", tag, owner, clock, "hyprolyb_adpcm", __FILE__), device_sound_interface(mconfig, *this), m_soundlatch2(*this, ":soundlatch2"), @@ -60,7 +60,7 @@ WRITE8_MEMBER( hyprolyb_adpcm_device::msm_data_w ) READ8_MEMBER( hyprolyb_adpcm_device::msm_vck_r ) { - UINT8 old = m_vck_ready; + uint8_t old = m_vck_ready; m_vck_ready = 0x00; return old; } diff --git a/src/mame/audio/hyprolyb.h b/src/mame/audio/hyprolyb.h index abbbd77c689..67ab8c27f74 100644 --- a/src/mame/audio/hyprolyb.h +++ b/src/mame/audio/hyprolyb.h @@ -8,7 +8,7 @@ class hyprolyb_adpcm_device : public device_t, public device_sound_interface { public: - hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~hyprolyb_adpcm_device() {} DECLARE_WRITE8_MEMBER( write ); @@ -34,9 +34,9 @@ protected: required_device m_soundlatch2; msm5205_device *m_msm; address_space *m_space; - UINT8 m_adpcm_ready; // only bootlegs - UINT8 m_adpcm_busy; - UINT8 m_vck_ready; + uint8_t m_adpcm_ready; // only bootlegs + uint8_t m_adpcm_busy; + uint8_t m_vck_ready; }; MACHINE_CONFIG_EXTERN( hyprolyb_adpcm ); diff --git a/src/mame/audio/irem.cpp b/src/mame/audio/irem.cpp index d06d9d35ad5..43d47059fd0 100644 --- a/src/mame/audio/irem.cpp +++ b/src/mame/audio/irem.cpp @@ -16,7 +16,7 @@ const device_type IREM_M62_AUDIO = &device_creator; const device_type IREM_M52_SOUNDC_AUDIO = &device_creator; const device_type IREM_M52_LARGE_AUDIO = &device_creator; -irem_audio_device::irem_audio_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) +irem_audio_device::irem_audio_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_port1(0), m_port2(0), @@ -26,17 +26,17 @@ irem_audio_device::irem_audio_device(const machine_config &mconfig, device_type { } -m62_audio_device::m62_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m62_audio_device::m62_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : irem_audio_device(mconfig, IREM_M62_AUDIO, "Irem M62 Audio", tag, owner, clock, "irem_m62_audio", __FILE__) { } -m52_soundc_audio_device::m52_soundc_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m52_soundc_audio_device::m52_soundc_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : irem_audio_device(mconfig, IREM_M52_SOUNDC_AUDIO, "Irem M52 SoundC Audio", tag, owner, clock, "irem_m52_soundc_audio", __FILE__) { } -m52_large_audio_device::m52_large_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m52_large_audio_device::m52_large_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : irem_audio_device(mconfig, IREM_M52_LARGE_AUDIO, "Irem M52 Large Audio", tag, owner, clock, "irem_m52_large_audio", __FILE__) { } diff --git a/src/mame/audio/irem.h b/src/mame/audio/irem.h index 7e378e88b14..751ca58b96d 100644 --- a/src/mame/audio/irem.h +++ b/src/mame/audio/irem.h @@ -9,7 +9,7 @@ class irem_audio_device : public device_t { public: - irem_audio_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); + irem_audio_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); ~irem_audio_device() {} DECLARE_WRITE8_MEMBER( cmd_w ); @@ -34,8 +34,8 @@ protected: private: // internal state - UINT8 m_port1; - UINT8 m_port2; + uint8_t m_port1; + uint8_t m_port2; required_device m_soundlatch; /* FIXME: using required / optional device would be better */ @@ -55,21 +55,21 @@ private: class m62_audio_device : public irem_audio_device { public: - m62_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m62_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; class m52_soundc_audio_device : public irem_audio_device { public: - m52_soundc_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m52_soundc_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; class m52_large_audio_device : public irem_audio_device { public: - m52_large_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m52_large_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; diff --git a/src/mame/audio/jaguar.cpp b/src/mame/audio/jaguar.cpp index 441e25fd236..dd82952658d 100644 --- a/src/mame/audio/jaguar.cpp +++ b/src/mame/audio/jaguar.cpp @@ -270,7 +270,7 @@ WRITE32_MEMBER( jaguar_state::dsp_flags_w ) /* see if we're going back to the spin loop */ if (!(data & 0x04000) && m_dsp->state_int(JAGUAR_R22) != 0) { - UINT32 r30 = m_dsp->state_int(JAGUAR_R30) & 0xffffff; + uint32_t r30 = m_dsp->state_int(JAGUAR_R30) & 0xffffff; if (r30 >= 0xf1b124 && r30 <= 0xf1b126) dsp_suspend(); } diff --git a/src/mame/audio/leland.cpp b/src/mame/audio/leland.cpp index 260e775df58..cb0a8a9766f 100644 --- a/src/mame/audio/leland.cpp +++ b/src/mame/audio/leland.cpp @@ -351,7 +351,7 @@ void leland_80186_sound_device::device_reset() const device_type LELAND_80186 = &device_creator; -leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LELAND_80186, "80186 DAC (Leland)", tag, owner, clock, "leland_80186_sound", __FILE__), m_dac1(*this, "dac1"), m_dac2(*this, "dac2"), @@ -378,7 +378,7 @@ leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconf m_type = TYPE_LELAND; } -leland_80186_sound_device::leland_80186_sound_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) +leland_80186_sound_device::leland_80186_sound_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_dac1(*this, "dac1"), m_dac2(*this, "dac2"), @@ -406,7 +406,7 @@ leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconf const device_type REDLINE_80186 = &device_creator; -redline_80186_sound_device::redline_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +redline_80186_sound_device::redline_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : leland_80186_sound_device(mconfig, REDLINE_80186, "80186 DAC (Redline Racer)", tag, owner, clock, "redline_80186_sound", __FILE__) { m_type = TYPE_REDLINE; @@ -414,7 +414,7 @@ redline_80186_sound_device::redline_80186_sound_device(const machine_config &mco const device_type ATAXX_80186 = &device_creator; -ataxx_80186_sound_device::ataxx_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ataxx_80186_sound_device::ataxx_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : leland_80186_sound_device(mconfig, REDLINE_80186, "80186 DAC (Ataxx)", tag, owner, clock, "ataxx_80186_sound", __FILE__) { m_type = TYPE_ATAXX; @@ -422,7 +422,7 @@ ataxx_80186_sound_device::ataxx_80186_sound_device(const machine_config &mconfig const device_type WSF_80186 = &device_creator; -wsf_80186_sound_device::wsf_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +wsf_80186_sound_device::wsf_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : leland_80186_sound_device(mconfig, REDLINE_80186, "80186 DAC (WSF)", tag, owner, clock, "wsf_80186_sound", __FILE__) { m_type = TYPE_WSF; @@ -438,7 +438,7 @@ WRITE16_MEMBER(leland_80186_sound_device::peripheral_ctrl) case 4: { - UINT32 temp = (m_peripheral & 0xffc0) << 4; + uint32_t temp = (m_peripheral & 0xffc0) << 4; if (data & 0x0040) { m_audiocpu->device_t::memory().space(AS_PROGRAM).install_readwrite_handler(temp, temp + 0x2ff, read16_delegate(FUNC(leland_80186_sound_device::peripheral_r), this), write16_delegate(FUNC(leland_80186_sound_device::peripheral_w), this)); diff --git a/src/mame/audio/lynx.cpp b/src/mame/audio/lynx.cpp index 2d58677f373..fea3312516e 100644 --- a/src/mame/audio/lynx.cpp +++ b/src/mame/audio/lynx.cpp @@ -96,21 +96,21 @@ const device_type LYNX2_SND = &device_creator; // lynx_sound_device - constructor //------------------------------------------------- -lynx_sound_device::lynx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lynx_sound_device::lynx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, LYNX_SND, "Mikey", tag, owner, clock, "lynx_sound", __FILE__), device_sound_interface(mconfig, *this) { m_timer_delegate = lynx_sound_timer_delegate(); } -lynx_sound_device::lynx_sound_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) +lynx_sound_device::lynx_sound_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_sound_interface(mconfig, *this) { } -lynx2_sound_device::lynx2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +lynx2_sound_device::lynx2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : lynx_sound_device(mconfig, LYNX2_SND, "Mikey (Lynx II)", tag, owner, clock, "lynx2_sound", __FILE__) { } @@ -250,7 +250,7 @@ void lynx_sound_device::count_down(int nr) void lynx_sound_device::shift(int chan_nr) { - INT16 out_temp; + int16_t out_temp; LYNX_AUDIO *channel; assert(chan_nr < 4); @@ -259,7 +259,7 @@ void lynx_sound_device::shift(int chan_nr) //channel->shifter = ((channel->shifter<<1)&0xffe) | (m_shift_xor[ channel->shifter & channel->mask ]&1); // alternative method (functionally the same as above) - UINT8 xor_out = 0; + uint8_t xor_out = 0; for (int bit = 0; bit < 12; bit++) { if ((channel->mask >> bit) & 1) @@ -278,7 +278,7 @@ void lynx_sound_device::shift(int chan_nr) // clipping if (out_temp > 127) out_temp = 127; if (out_temp < -128) out_temp = -128; - channel->reg.output = (INT16)out_temp; + channel->reg.output = (int16_t)out_temp; } switch (chan_nr) @@ -350,7 +350,7 @@ void lynx_sound_device::execute(int chan_nr) READ8_MEMBER(lynx_sound_device::read) { - UINT8 value = 0; + uint8_t value = 0; LYNX_AUDIO *channel = &m_audio[(offset >> 3) & 3]; m_mixer_channel->update(); diff --git a/src/mame/audio/lynx.h b/src/mame/audio/lynx.h index 470db9cf8ca..534a3447954 100644 --- a/src/mame/audio/lynx.h +++ b/src/mame/audio/lynx.h @@ -6,18 +6,18 @@ struct LYNX_AUDIO { struct { - INT8 volume; - UINT8 feedback; - INT8 output; - UINT8 shifter; - UINT8 bakup; - UINT8 control1; - UINT8 counter; - UINT8 control2; + int8_t volume; + uint8_t feedback; + int8_t output; + uint8_t shifter; + uint8_t bakup; + uint8_t control1; + uint8_t counter; + uint8_t control2; } reg; - UINT8 attenuation; - UINT16 mask; // 12-bit - UINT16 shifter; // 12-bit + uint8_t attenuation; + uint16_t mask; // 12-bit + uint16_t shifter; // 12-bit float ticks; int count; }; @@ -29,8 +29,8 @@ class lynx_sound_device : public device_t, public device_sound_interface { public: - lynx_sound_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); - lynx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lynx_sound_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); + lynx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); @@ -59,8 +59,8 @@ protected: float m_usec_per_sample; std::unique_ptr m_shift_mask; std::unique_ptr m_shift_xor; - UINT8 m_attenuation_enable; - UINT8 m_master_enable; + uint8_t m_attenuation_enable; + uint8_t m_master_enable; LYNX_AUDIO m_audio[4]; }; @@ -68,7 +68,7 @@ protected: class lynx2_sound_device : public lynx_sound_device { public: - lynx2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + lynx2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides diff --git a/src/mame/audio/m72.cpp b/src/mame/audio/m72.cpp index 883fed63576..743f7c78d6b 100644 --- a/src/mame/audio/m72.cpp +++ b/src/mame/audio/m72.cpp @@ -48,7 +48,7 @@ Shisensho II 1993 Rev 3.34 M81 Yes const device_type M72 = &device_creator; -m72_audio_device::m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +m72_audio_device::m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, M72, "Irem M72 Audio Custom", tag, owner, clock, "m72_audio", __FILE__) , device_sound_interface(mconfig, *this) , m_irqvector(0) diff --git a/src/mame/audio/m72.h b/src/mame/audio/m72.h index 9e6c241206c..4bce5234ac3 100644 --- a/src/mame/audio/m72.h +++ b/src/mame/audio/m72.h @@ -14,7 +14,7 @@ class m72_audio_device : public device_t, public device_sound_interface { public: - m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~m72_audio_device() {} enum @@ -50,10 +50,10 @@ protected: private: // internal state - UINT8 m_irqvector; - UINT32 m_sample_addr; - optional_region_ptr m_samples; - UINT32 m_samples_size; + uint8_t m_irqvector; + uint32_t m_sample_addr; + optional_region_ptr m_samples; + uint32_t m_samples_size; address_space *m_space; optional_device m_dac; required_device m_soundlatch; diff --git a/src/mame/audio/mario.cpp b/src/mame/audio/mario.cpp index 6e4d5722ec9..3e7e0d367a9 100644 --- a/src/mame/audio/mario.cpp +++ b/src/mame/audio/mario.cpp @@ -662,7 +662,7 @@ void mario_state::sound_start() if (!audiocpu) return; #if USE_8039 - UINT8 *SND = memregion("audiocpu")->base(); + uint8_t *SND = memregion("audiocpu")->base(); SND[0x1001] = 0x01; #endif @@ -729,9 +729,9 @@ READ8_MEMBER(mario_state::mario_sh_t1_r) READ8_MEMBER(mario_state::mario_sh_tune_r) { - UINT8 *SND = memregion("audiocpu")->base(); - UINT16 mask = memregion("audiocpu")->bytes()-1; - UINT8 p2 = I8035_P2_R(space); + uint8_t *SND = memregion("audiocpu")->base(); + uint16_t mask = memregion("audiocpu")->bytes()-1; + uint8_t p2 = I8035_P2_R(space); if ((p2 >> 7) & 1) return m_soundlatch->read(space, offset); diff --git a/src/mame/audio/meadows.cpp b/src/mame/audio/meadows.cpp index d4a72a027ad..be547a23978 100644 --- a/src/mame/audio/meadows.cpp +++ b/src/mame/audio/meadows.cpp @@ -24,7 +24,7 @@ #define ENABLE_DAC 0x04 #define ENABLE_CTR1 0x08 -static const INT16 waveform[2] = { -120*256, 120*256 }; +static const int16_t waveform[2] = { -120*256, 120*256 }; /************************************/ /* Sound handler start */ diff --git a/src/mame/audio/micro3d.cpp b/src/mame/audio/micro3d.cpp index aeed7f03bdf..f462678f5d6 100644 --- a/src/mame/audio/micro3d.cpp +++ b/src/mame/audio/micro3d.cpp @@ -129,7 +129,7 @@ static void recompute_filter(lp_filter *iir, double k, double q, double fc) iir->coef[0] = k; } -void micro3d_sound_device::noise_sh_w(UINT8 data) +void micro3d_sound_device::noise_sh_w(uint8_t data) { micro3d_state *state = machine().driver_data(); @@ -167,7 +167,7 @@ void micro3d_sound_device::noise_sh_w(UINT8 data) const device_type MICRO3D = &device_creator; -micro3d_sound_device::micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +micro3d_sound_device::micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MICRO3D, "Microprose Audio Custom", tag, owner, clock, "micro3d_sound", __FILE__), device_sound_interface(mconfig, *this), m_gain(0), @@ -177,7 +177,7 @@ micro3d_sound_device::micro3d_sound_device(const machine_config &mconfig, const m_stream(nullptr) { - memset(m_dac, 0, sizeof(UINT8)*4); + memset(m_dac, 0, sizeof(uint8_t)*4); } //------------------------------------------------- diff --git a/src/mame/audio/midway.cpp b/src/mame/audio/midway.cpp index 5a9fbe6f802..f6f72684252 100644 --- a/src/mame/audio/midway.cpp +++ b/src/mame/audio/midway.cpp @@ -48,7 +48,7 @@ extern const device_type MIDWAY_SQUAWK_N_TALK = &device_creatorbase(); + uint8_t *prom = memregion("proms")->base(); for (int volval = 0; volval < 16; volval++) { // loop over all the clocks until we run out; look up in the PROM @@ -491,7 +491,7 @@ void midway_ssio_device::device_timer(emu_timer &timer, device_timer_id id, int // midway_chip_squeak_deluxe_device - constructor //------------------------------------------------- -midway_chip_squeak_deluxe_device::midway_chip_squeak_deluxe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +midway_chip_squeak_deluxe_device::midway_chip_squeak_deluxe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDWAY_CHIP_SQUEAK_DELUXE, "Midway Chip Squeak Deluxe Sound Board", tag, owner, clock, "midcsd", __FILE__), device_mixer_interface(mconfig, *this), m_cpu(*this, "cpu"), @@ -554,7 +554,7 @@ WRITE8_MEMBER(midway_chip_squeak_deluxe_device::portb_w) m_dacval = (m_dacval & ~3) | (data >> 6); m_dac->write(m_dacval); - UINT8 z_mask = m_pia->port_b_z_mask(); + uint8_t z_mask = m_pia->port_b_z_mask(); if (~z_mask & 0x10) m_status = (m_status & ~1) | ((data >> 4) & 1); if (~z_mask & 0x20) m_status = (m_status & ~2) | ((data >> 4) & 2); } @@ -690,7 +690,7 @@ void midway_chip_squeak_deluxe_device::device_timer(emu_timer &timer, device_tim // midway_sounds_good_device - constructor //------------------------------------------------- -midway_sounds_good_device::midway_sounds_good_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +midway_sounds_good_device::midway_sounds_good_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDWAY_SOUNDS_GOOD, "Midway Sounds Good Sound Board", tag, owner, clock, "midsg", __FILE__), device_mixer_interface(mconfig, *this), m_cpu(*this, "cpu"), @@ -751,7 +751,7 @@ WRITE8_MEMBER(midway_sounds_good_device::porta_w) WRITE8_MEMBER(midway_sounds_good_device::portb_w) { - UINT8 z_mask = m_pia->port_b_z_mask(); + uint8_t z_mask = m_pia->port_b_z_mask(); m_dacval = (m_dacval & ~3) | (data >> 6); m_dac->write(m_dacval); @@ -861,7 +861,7 @@ void midway_sounds_good_device::device_timer(emu_timer &timer, device_timer_id i // midway_turbo_chip_squeak_device - constructor //------------------------------------------------- -midway_turbo_chip_squeak_device::midway_turbo_chip_squeak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +midway_turbo_chip_squeak_device::midway_turbo_chip_squeak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDWAY_TURBO_CHIP_SQUEAK, "Midway Turbo Chip Squeak Sound Board", tag, owner, clock, "midtcs", __FILE__), device_mixer_interface(mconfig, *this), m_cpu(*this, "cpu"), @@ -1025,7 +1025,7 @@ void midway_turbo_chip_squeak_device::device_timer(emu_timer &timer, device_time // midway_squawk_n_talk_device - constructor //------------------------------------------------- -midway_squawk_n_talk_device::midway_squawk_n_talk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +midway_squawk_n_talk_device::midway_squawk_n_talk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MIDWAY_SQUAWK_N_TALK, "Midway Squawk 'n' Talk Sound Board", tag, owner, clock, "midsnt", __FILE__), device_mixer_interface(mconfig, *this), m_cpu(*this, "cpu"), diff --git a/src/mame/audio/midway.h b/src/mame/audio/midway.h index b6956b99b82..e248a75bb4b 100644 --- a/src/mame/audio/midway.h +++ b/src/mame/audio/midway.h @@ -46,7 +46,7 @@ class midway_ssio_device : public device_t, { public: // construction/destruction - midway_ssio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midway_ssio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write DECLARE_READ8_MEMBER(read); @@ -56,8 +56,8 @@ public: DECLARE_WRITE8_MEMBER(ioport_write); // configuration - void set_custom_input(int which, UINT8 mask, read8_delegate handler); - void set_custom_output(int which, UINT8 mask, write8_delegate handler); + void set_custom_input(int which, uint8_t mask, read8_delegate handler); + void set_custom_output(int which, uint8_t mask, write8_delegate handler); // internal communications INTERRUPT_GEN_MEMBER(clock_14024); @@ -92,18 +92,18 @@ private: optional_ioport_array<5> m_ports; // internal state - UINT8 m_data[4]; - UINT8 m_status; - UINT8 m_14024_count; - UINT8 m_mute; - UINT8 m_overall[2]; - UINT8 m_duty_cycle[2][3]; - UINT8 m_ayvolume_lookup[16]; + uint8_t m_data[4]; + uint8_t m_status; + uint8_t m_14024_count; + uint8_t m_mute; + uint8_t m_overall[2]; + uint8_t m_duty_cycle[2][3]; + uint8_t m_ayvolume_lookup[16]; // I/O port overrides - UINT8 m_custom_input_mask[5]; + uint8_t m_custom_input_mask[5]; read8_delegate m_custom_input[5]; - UINT8 m_custom_output_mask[2]; + uint8_t m_custom_output_mask[2]; write8_delegate m_custom_output[2]; }; @@ -115,7 +115,7 @@ class midway_chip_squeak_deluxe_device : public device_t, { public: // construction/destruction - midway_chip_squeak_deluxe_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midway_chip_squeak_deluxe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write DECLARE_READ8_MEMBER(read); @@ -143,8 +143,8 @@ private: required_device m_dac; // internal state - UINT8 m_status; - UINT16 m_dacval; + uint8_t m_status; + uint16_t m_dacval; }; @@ -155,7 +155,7 @@ class midway_sounds_good_device : public device_t, { public: // construction/destruction - midway_sounds_good_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midway_sounds_good_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write DECLARE_READ8_MEMBER(read); @@ -181,8 +181,8 @@ private: required_device m_dac; // internal state - UINT8 m_status; - UINT16 m_dacval; + uint8_t m_status; + uint16_t m_dacval; }; @@ -193,7 +193,7 @@ class midway_turbo_chip_squeak_device : public device_t, { public: // construction/destruction - midway_turbo_chip_squeak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midway_turbo_chip_squeak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write DECLARE_READ8_MEMBER(read); @@ -219,8 +219,8 @@ private: required_device m_dac; // internal state - UINT8 m_status; - UINT16 m_dacval; + uint8_t m_status; + uint16_t m_dacval; }; @@ -231,7 +231,7 @@ class midway_squawk_n_talk_device : public device_t, { public: // construction/destruction - midway_squawk_n_talk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + midway_squawk_n_talk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write DECLARE_WRITE8_MEMBER(write); @@ -259,8 +259,8 @@ private: optional_device m_tms5200; // internal state - UINT8 m_tms_command; - UINT8 m_tms_strobes; + uint8_t m_tms_command; + uint8_t m_tms_strobes; }; diff --git a/src/mame/audio/mw8080bw.cpp b/src/mame/audio/mw8080bw.cpp index 05dc3ebb27e..db0807bb522 100644 --- a/src/mame/audio/mw8080bw.cpp +++ b/src/mame/audio/mw8080bw.cpp @@ -156,7 +156,7 @@ MACHINE_CONFIG_END WRITE8_MEMBER(mw8080bw_state::seawolf_audio_w) { - UINT8 rising_bits = data & ~m_port_1_last; + uint8_t rising_bits = data & ~m_port_1_last; /* if (data & 0x01) enable SHIP HIT sound */ if (rising_bits & 0x01) m_samples->start(0, 0); @@ -560,7 +560,7 @@ MACHINE_CONFIG_FRAGMENT( maze_audio ) MACHINE_CONFIG_END -void mw8080bw_state::maze_write_discrete(UINT8 maze_tone_timing_state) +void mw8080bw_state::maze_write_discrete(uint8_t maze_tone_timing_state) { /* controls need to be active low */ int controls = ~ioport("IN0")->read() & 0xff; @@ -1569,7 +1569,7 @@ WRITE8_MEMBER(mw8080bw_state::gmissile_audio_1_w) reversed (D5=R, D7=L), but the software confirms that ours is right */ - UINT8 rising_bits = data & ~m_port_1_last; + uint8_t rising_bits = data & ~m_port_1_last; /* D0 and D1 are not connected */ @@ -1658,7 +1658,7 @@ MACHINE_CONFIG_END WRITE8_MEMBER(mw8080bw_state::m4_audio_1_w) { - UINT8 rising_bits = data & ~m_port_1_last; + uint8_t rising_bits = data & ~m_port_1_last; /* D0 and D1 are not connected */ @@ -1684,7 +1684,7 @@ WRITE8_MEMBER(mw8080bw_state::m4_audio_1_w) WRITE8_MEMBER(mw8080bw_state::m4_audio_2_w) { - UINT8 rising_bits = data & ~m_port_2_last; + uint8_t rising_bits = data & ~m_port_2_last; /* if (data & 0x01) enable LEFT PLAYER EXPLOSION sound via 510K res (goes to left speaker) */ if (rising_bits & 0x01) m_samples1->start(1, 1); @@ -1922,7 +1922,7 @@ WRITE8_MEMBER(mw8080bw_state::clowns_audio_1_w) WRITE8_MEMBER(mw8080bw_state::clowns_audio_2_w) { - UINT8 rising_bits = data & ~m_port_2_last; + uint8_t rising_bits = data & ~m_port_2_last; m_discrete->write(space, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01); @@ -3280,7 +3280,7 @@ MACHINE_CONFIG_END WRITE8_MEMBER(mw8080bw_state::phantom2_audio_1_w) { - UINT8 rising_bits = data & ~m_port_1_last; + uint8_t rising_bits = data & ~m_port_1_last; /* if (data & 0x01) enable PLAYER SHOT sound */ if (rising_bits & 0x01) m_samples->start(0, 0); @@ -3302,7 +3302,7 @@ WRITE8_MEMBER(mw8080bw_state::phantom2_audio_1_w) WRITE8_MEMBER(mw8080bw_state::phantom2_audio_2_w) { - UINT8 rising_bits = data & ~m_port_2_last; + uint8_t rising_bits = data & ~m_port_2_last; /* D0-D2 are not connected */ diff --git a/src/mame/audio/n8080.cpp b/src/mame/audio/n8080.cpp index b4b094c6c2c..9877faaa9ef 100644 --- a/src/mame/audio/n8080.cpp +++ b/src/mame/audio/n8080.cpp @@ -105,7 +105,7 @@ TIMER_CALLBACK_MEMBER( n8080_state::stop_mono_flop_callback ) void n8080_state::spacefev_sound_pins_changed() { - UINT16 changes = ~m_curr_sound_pins & m_prev_sound_pins; + uint16_t changes = ~m_curr_sound_pins & m_prev_sound_pins; if (changes & (1 << 0x3)) { @@ -136,7 +136,7 @@ void n8080_state::spacefev_sound_pins_changed() void n8080_state::sheriff_sound_pins_changed() { - UINT16 changes = ~m_curr_sound_pins & m_prev_sound_pins; + uint16_t changes = ~m_curr_sound_pins & m_prev_sound_pins; if (changes & (1 << 0x6)) { @@ -159,7 +159,7 @@ void n8080_state::sheriff_sound_pins_changed() void n8080_state::helifire_sound_pins_changed() { - UINT16 changes = ~m_curr_sound_pins & m_prev_sound_pins; + uint16_t changes = ~m_curr_sound_pins & m_prev_sound_pins; /* ((m_curr_sound_pins >> 0xa) & 1) not emulated */ /* ((m_curr_sound_pins >> 0xb) & 1) not emulated */ @@ -269,7 +269,7 @@ WRITE8_MEMBER(n8080_state::n8080_sound_2_w) READ8_MEMBER(n8080_state::n8080_8035_p1_r) { - UINT8 val = 0; + uint8_t val = 0; if ((m_curr_sound_pins >> 0xb) & 1) val |= 0x01; if ((m_curr_sound_pins >> 0xa) & 1) val |= 0x02; @@ -306,7 +306,7 @@ READ8_MEMBER(n8080_state::helifire_8035_t1_r) READ8_MEMBER(n8080_state::helifire_8035_external_ram_r) { - UINT8 val = 0; + uint8_t val = 0; if ((m_curr_sound_pins >> 0x7) & 1) val |= 0x01; if ((m_curr_sound_pins >> 0x8) & 1) val |= 0x02; diff --git a/src/mame/audio/namco52.cpp b/src/mame/audio/namco52.cpp index 8ebddab75dc..872e9a9d741 100644 --- a/src/mame/audio/namco52.cpp +++ b/src/mame/audio/namco52.cpp @@ -159,7 +159,7 @@ ROM_END const device_type NAMCO_52XX = &device_creator; -namco_52xx_device::namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_52xx_device::namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_52XX, "Namco 52xx", tag, owner, clock, "namco52", __FILE__), m_cpu(*this, "mcu"), m_discrete(*this, finder_base::DUMMY_TAG), diff --git a/src/mame/audio/namco52.h b/src/mame/audio/namco52.h index b9cd4d240cc..5ec24260315 100644 --- a/src/mame/audio/namco52.h +++ b/src/mame/audio/namco52.h @@ -28,7 +28,7 @@ class namco_52xx_device : public device_t { public: - namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_discrete(device_t &device, const char *tag) { downcast(device).m_discrete.set_tag(tag); } static void set_basenote(device_t &device, int node) { downcast(device).m_basenode = node; } @@ -66,8 +66,8 @@ private: devcb_read8 m_romread; devcb_read8 m_si; - UINT8 m_latched_cmd; - UINT32 m_address; + uint8_t m_latched_cmd; + uint32_t m_address; }; extern const device_type NAMCO_52XX; diff --git a/src/mame/audio/namco54.cpp b/src/mame/audio/namco54.cpp index e0772c2f2fe..c4176c83e28 100644 --- a/src/mame/audio/namco54.cpp +++ b/src/mame/audio/namco54.cpp @@ -69,7 +69,7 @@ READ8_MEMBER( namco_54xx_device::R0_r ) WRITE8_MEMBER( namco_54xx_device::O_w ) { - UINT8 out = (data & 0x0f); + uint8_t out = (data & 0x0f); if (data & 0x10) m_discrete->write(space, NAMCO_54XX_1_DATA(m_basenode), out); else @@ -78,7 +78,7 @@ WRITE8_MEMBER( namco_54xx_device::O_w ) WRITE8_MEMBER( namco_54xx_device::R1_w ) { - UINT8 out = (data & 0x0f); + uint8_t out = (data & 0x0f); m_discrete->write(space, NAMCO_54XX_2_DATA(m_basenode), out); } @@ -130,7 +130,7 @@ ROM_END const device_type NAMCO_54XX = &device_creator; -namco_54xx_device::namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +namco_54xx_device::namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NAMCO_54XX, "Namco 54xx", tag, owner, clock, "namco54", __FILE__), m_cpu(*this, "mcu"), m_discrete(*this, finder_base::DUMMY_TAG), diff --git a/src/mame/audio/namco54.h b/src/mame/audio/namco54.h index d72547452d9..bdfe8b7e519 100644 --- a/src/mame/audio/namco54.h +++ b/src/mame/audio/namco54.h @@ -20,7 +20,7 @@ class namco_54xx_device : public device_t { public: - namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_discrete(device_t &device, const char *tag) { downcast(device).m_discrete.set_tag(tag); } static void set_basenote(device_t &device, int node) { downcast(device).m_basenode = node; } @@ -45,7 +45,7 @@ private: required_device m_discrete; int m_basenode; - UINT8 m_latched_cmd; + uint8_t m_latched_cmd; }; extern const device_type NAMCO_54XX; diff --git a/src/mame/audio/phoenix.cpp b/src/mame/audio/phoenix.cpp index 3bcd72661ea..28ec0574f69 100644 --- a/src/mame/audio/phoenix.cpp +++ b/src/mame/audio/phoenix.cpp @@ -50,7 +50,7 @@ const device_type PHOENIX = &device_creator; -phoenix_sound_device::phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +phoenix_sound_device::phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PHOENIX, "Phoenix Audio Custom", tag, owner, clock, "phoenix_sound", __FILE__), device_sound_interface(mconfig, *this) { @@ -73,7 +73,7 @@ void phoenix_sound_device::device_config_complete() void phoenix_sound_device::device_start() { int i, j; - UINT32 shiftreg; + uint32_t shiftreg; m_sound_latch_a = 0; memset(&m_c24_state, 0, sizeof(m_c24_state)); @@ -83,12 +83,12 @@ void phoenix_sound_device::device_start() m_discrete = machine().device("discrete"); m_tms = machine().device("tms"); - m_poly18 = std::make_unique(1ul << (18-5)); + m_poly18 = std::make_unique(1ul << (18-5)); shiftreg = 0; for( i = 0; i < (1ul << (18-5)); i++ ) { - UINT32 bits = 0; + uint32_t bits = 0; for( j = 0; j < 32; j++ ) { bits = (bits >> 1) | (shiftreg << 31); diff --git a/src/mame/audio/pleiads.cpp b/src/mame/audio/pleiads.cpp index b838998c971..a425d8bf7ee 100644 --- a/src/mame/audio/pleiads.cpp +++ b/src/mame/audio/pleiads.cpp @@ -20,13 +20,13 @@ const device_type PLEIADS = &device_creator; -pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PLEIADS, "Pleiads Audio Custom", tag, owner, clock, "pleiads_sound", __FILE__), device_sound_interface(mconfig, *this) { } -pleiads_sound_device::pleiads_sound_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) +pleiads_sound_device::pleiads_sound_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_sound_interface(mconfig, *this), m_channel(nullptr), @@ -119,7 +119,7 @@ void pleiads_sound_device::device_start() const device_type NAUGHTYB = &device_creator; -naughtyb_sound_device::naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +naughtyb_sound_device::naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pleiads_sound_device(mconfig, NAUGHTYB, "Naughty Boy Audio Custom", tag, owner, clock, "naughtyb_sound", __FILE__) { } @@ -197,7 +197,7 @@ void naughtyb_sound_device::device_start() const device_type POPFLAME = &device_creator; -popflame_sound_device::popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +popflame_sound_device::popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pleiads_sound_device(mconfig, POPFLAME, "Pop Flamer Audio Custom", tag, owner, clock, "popflame_sound", __FILE__) { } @@ -649,16 +649,16 @@ WRITE8_MEMBER( pleiads_sound_device::control_c_w ) void pleiads_sound_device::common_start() { int i, j; - UINT32 shiftreg; + uint32_t shiftreg; m_tms = machine().device("tms"); m_pc4.level = PC4_MIN; - m_poly18 = make_unique_clear(1ul << (18-5)); + m_poly18 = make_unique_clear(1ul << (18-5)); shiftreg = 0; for( i = 0; i < (1ul << (18-5)); i++ ) { - UINT32 bits = 0; + uint32_t bits = 0; for( j = 0; j < 32; j++ ) { bits = (bits >> 1) | (shiftreg << 31); diff --git a/src/mame/audio/pleiads.h b/src/mame/audio/pleiads.h index e47b1b8e659..4fa293d33c8 100644 --- a/src/mame/audio/pleiads.h +++ b/src/mame/audio/pleiads.h @@ -44,8 +44,8 @@ class pleiads_sound_device : public device_t, public device_sound_interface { public: - pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - pleiads_sound_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); + pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + pleiads_sound_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); ~pleiads_sound_device() {} DECLARE_WRITE8_MEMBER( control_a_w ); @@ -79,7 +79,7 @@ protected: int m_sound_latch_b; int m_sound_latch_c; /* part of the videoreg_w latch */ - std::unique_ptr m_poly18; + std::unique_ptr m_poly18; int m_polybit; pl_t_state m_tone1; @@ -106,7 +106,7 @@ extern const device_type PLEIADS; class naughtyb_sound_device : public pleiads_sound_device { public: - naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_config_complete() override; @@ -123,7 +123,7 @@ extern const device_type NAUGHTYB; class popflame_sound_device : public pleiads_sound_device { public: - popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_config_complete() override; diff --git a/src/mame/audio/polepos.cpp b/src/mame/audio/polepos.cpp index ffedee5c283..c1f05b30443 100644 --- a/src/mame/audio/polepos.cpp +++ b/src/mame/audio/polepos.cpp @@ -224,7 +224,7 @@ const device_type POLEPOS = &device_creator; // polepos_sound_device - constructor //------------------------------------------------- -polepos_sound_device::polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +polepos_sound_device::polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, POLEPOS, "Pole Position Audio Custom", tag, owner, clock, "polepos_sound", __FILE__), device_sound_interface(mconfig, *this), m_current_position(0), @@ -275,8 +275,8 @@ void polepos_sound_device::device_reset() void polepos_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - UINT32 step, clock, slot; - UINT8 *base; + uint32_t step, clock, slot; + uint8_t *base; double volume, i_total; stream_sample_t *buffer = outputs[0]; int loop; diff --git a/src/mame/audio/redbaron.cpp b/src/mame/audio/redbaron.cpp index b8f71f1d5f2..9470b6495cd 100644 --- a/src/mame/audio/redbaron.cpp +++ b/src/mame/audio/redbaron.cpp @@ -35,7 +35,7 @@ const device_type REDBARON = &device_creator; // redbaron_sound_device - constructor //------------------------------------------------- -redbaron_sound_device::redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +redbaron_sound_device::redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, REDBARON, "Red Baron Audio Custom", tag, owner, clock, "redbaron_custom", __FILE__), device_sound_interface(mconfig, *this), m_vol_lookup(nullptr), @@ -53,7 +53,7 @@ redbaron_sound_device::redbaron_sound_device(const machine_config &mconfig, cons m_squeal_on_counter(0), m_squeal_out(0) { - memset(m_vol_crash, 0, sizeof(INT16)*16); + memset(m_vol_crash, 0, sizeof(int16_t)*16); } @@ -65,9 +65,9 @@ void redbaron_sound_device::device_start() { int i; - m_vol_lookup = std::make_unique(32768); + m_vol_lookup = std::make_unique(32768); for( i = 0; i < 0x8000; i++ ) - m_vol_lookup[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096)); + m_vol_lookup[0x7fff-i] = (int16_t) (0x7fff/exp(1.0*i/4096)); for( i = 0; i < 16; i++ ) { diff --git a/src/mame/audio/redbaron.h b/src/mame/audio/redbaron.h index b7d11ae2ab7..03ac07b535b 100644 --- a/src/mame/audio/redbaron.h +++ b/src/mame/audio/redbaron.h @@ -10,7 +10,7 @@ class redbaron_sound_device : public device_t, public device_sound_interface { public: - redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( sounds_w ); @@ -22,9 +22,9 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; private: - std::unique_ptr m_vol_lookup; + std::unique_ptr m_vol_lookup; - INT16 m_vol_crash[16]; + int16_t m_vol_crash[16]; sound_stream *m_channel; int m_latch; diff --git a/src/mame/audio/s11c_bg.cpp b/src/mame/audio/s11c_bg.cpp index a700e188aa2..2b9f36c2b63 100644 --- a/src/mame/audio/s11c_bg.cpp +++ b/src/mame/audio/s11c_bg.cpp @@ -14,7 +14,7 @@ const device_type S11C_BG = &device_creator; -s11c_bg_device::s11c_bg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +s11c_bg_device::s11c_bg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig,S11C_BG,"Williams System 11C Background Music",tag,owner,clock, "s11c_bg", __FILE__), device_mixer_interface(mconfig, *this), m_cpu(*this,"bgcpu"), @@ -51,12 +51,12 @@ WRITE_LINE_MEMBER( s11c_bg_device::pia40_ca2_w) m_ym2151->reset(); } -void s11c_bg_device::ctrl_w(UINT8 data) +void s11c_bg_device::ctrl_w(uint8_t data) { m_pia40->cb1_w(data); } -void s11c_bg_device::data_w(UINT8 data) +void s11c_bg_device::data_w(uint8_t data) { m_pia40->portb_w(data); } @@ -97,7 +97,7 @@ void s11c_bg_device::device_start() void s11c_bg_device::device_reset() { - UINT8* ROM; + uint8_t* ROM; m_rom = memregion(m_regiontag); ROM = m_rom->base(); @@ -135,6 +135,6 @@ WRITE8_MEMBER( s11c_bg_device::bg_speech_digit_w ) WRITE8_MEMBER( s11c_bg_device::bgbank_w ) { - UINT8 bank = ((data & 0x04) >> 2) | ((data & 0x03) << 1); + uint8_t bank = ((data & 0x04) >> 2) | ((data & 0x03) << 1); m_cpubank->set_entry(bank); } diff --git a/src/mame/audio/s11c_bg.h b/src/mame/audio/s11c_bg.h index 211a88c23e5..3b0dd5aae32 100644 --- a/src/mame/audio/s11c_bg.h +++ b/src/mame/audio/s11c_bg.h @@ -25,7 +25,7 @@ class s11c_bg_device : public device_t, { public: // construction/destruction - s11c_bg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + s11c_bg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_cpu; required_device m_ym2151; @@ -41,8 +41,8 @@ public: DECLARE_WRITE8_MEMBER(bg_speech_digit_w); DECLARE_WRITE8_MEMBER(bgbank_w); DECLARE_WRITE_LINE_MEMBER(ym2151_irq_w); - void ctrl_w(UINT8 data); - void data_w(UINT8 data); + void ctrl_w(uint8_t data); + void data_w(uint8_t data); static void static_set_romregion(device_t &device, const char *tag); diff --git a/src/mame/audio/segag80r.cpp b/src/mame/audio/segag80r.cpp index 05680d2adb8..f048cb36a53 100644 --- a/src/mame/audio/segag80r.cpp +++ b/src/mame/audio/segag80r.cpp @@ -31,7 +31,7 @@ const device_type SEGA005 = &device_creator; -sega005_sound_device::sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega005_sound_device::sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA005, "Sega 005 Audio Custom", tag, owner, clock, "sega005_sound", __FILE__), device_sound_interface(mconfig, *this), m_sega005_sound_timer(nullptr), @@ -75,7 +75,7 @@ void sega005_sound_device::device_start() void sega005_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { segag80r_state *state = machine().driver_data(); - const UINT8 *sound_prom = state->memregion("proms")->base(); + const uint8_t *sound_prom = state->memregion("proms")->base(); int i; /* no implementation yet */ @@ -264,7 +264,7 @@ WRITE8_MEMBER(segag80r_state::astrob_sound_w) }; float freq_factor; - UINT8 diff = data ^ m_sound_state[offset]; + uint8_t diff = data ^ m_sound_state[offset]; m_sound_state[offset] = data; switch (offset) @@ -453,7 +453,7 @@ MACHINE_CONFIG_END WRITE8_MEMBER(segag80r_state::sega005_sound_a_w) { - UINT8 diff = data ^ m_sound_state[0]; + uint8_t diff = data ^ m_sound_state[0]; m_sound_state[0] = data; /* LARGE EXPL: channel 0 */ @@ -483,8 +483,8 @@ WRITE8_MEMBER(segag80r_state::sega005_sound_a_w) inline void segag80r_state::sega005_update_sound_data() { - UINT8 newval = memregion("005")->base()[m_sound_addr]; - UINT8 diff = newval ^ m_sound_data; + uint8_t newval = memregion("005")->base()[m_sound_addr]; + uint8_t diff = newval ^ m_sound_data; //osd_printf_debug(" [%03X] = %02X\n", m_sound_addr, newval); @@ -515,7 +515,7 @@ WRITE8_MEMBER(segag80r_state::sega005_sound_b_w) D4: 1 = hold/reset address counter to 0 D3-D0: upper 4 bits of ROM address */ - UINT8 diff = data ^ m_sound_state[1]; + uint8_t diff = data ^ m_sound_state[1]; m_sound_state[1] = data; //osd_printf_debug("sound[%d] = %02X\n", 1, data); @@ -608,7 +608,7 @@ MACHINE_CONFIG_END WRITE8_MEMBER(segag80r_state::spaceod_sound_w) { - UINT8 diff = data ^ m_sound_state[offset]; + uint8_t diff = data ^ m_sound_state[offset]; m_sound_state[offset] = data; switch (offset) @@ -764,7 +764,7 @@ WRITE8_MEMBER(segag80r_state::monsterb_sound_a_w) WRITE8_MEMBER(segag80r_state::monsterb_sound_b_w) { - UINT8 diff = data ^ m_sound_state[1]; + uint8_t diff = data ^ m_sound_state[1]; m_sound_state[1] = data; /* SHOT: channel 0 */ diff --git a/src/mame/audio/segam1audio.cpp b/src/mame/audio/segam1audio.cpp index 6f4f9fdd385..925db00dd24 100644 --- a/src/mame/audio/segam1audio.cpp +++ b/src/mame/audio/segam1audio.cpp @@ -82,7 +82,7 @@ machine_config_constructor segam1audio_device::device_mconfig_additions() const // segam1audio_device - constructor //------------------------------------------------- -segam1audio_device::segam1audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +segam1audio_device::segam1audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGAM1AUDIO, "Sega Model 1 Sound Board", tag, owner, clock, "segam1audio", __FILE__), m_audiocpu(*this, M68000_TAG), m_multipcm_1(*this, MULTIPCM_1_TAG), @@ -114,7 +114,7 @@ void segam1audio_device::device_reset() READ16_MEMBER(segam1audio_device::m1_snd_68k_latch_r) { - UINT16 retval; + uint16_t retval; retval = m_to_68k[m_fifo_rptr]; @@ -168,7 +168,7 @@ void segam1audio_device::check_fifo_irq() } } -void segam1audio_device::write_fifo(UINT8 data) +void segam1audio_device::write_fifo(uint8_t data) { m_to_68k[m_fifo_wptr] = data; m_fifo_wptr++; diff --git a/src/mame/audio/segam1audio.h b/src/mame/audio/segam1audio.h index 9cba756c5e2..a3d17e4e447 100644 --- a/src/mame/audio/segam1audio.h +++ b/src/mame/audio/segam1audio.h @@ -26,7 +26,7 @@ class segam1audio_device : public device_t { public: // construction/destruction - segam1audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segam1audio_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; @@ -45,7 +45,7 @@ public: DECLARE_READ16_MEMBER(ready_r); void check_fifo_irq(); - void write_fifo(UINT8 data); + void write_fifo(uint8_t data); protected: // device-level overrides diff --git a/src/mame/audio/segasnd.cpp b/src/mame/audio/segasnd.cpp index 2fca18abd9b..a5ecb0ecea6 100644 --- a/src/mame/audio/segasnd.cpp +++ b/src/mame/audio/segasnd.cpp @@ -66,7 +66,7 @@ static inline double step_cr_filter(g80_filter_state *state, double input) const device_type SEGASPEECH = &device_creator; -speech_sound_device::speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +speech_sound_device::speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGASPEECH, "Sega Speech Sound Board", tag, owner, clock, "sega_speech_sound", __FILE__), device_sound_interface(mconfig, *this), m_drq(0), @@ -155,7 +155,7 @@ WRITE_LINE_MEMBER(speech_sound_device::drq_w) TIMER_CALLBACK_MEMBER( speech_sound_device::delayed_speech_w ) { int data = param; - UINT8 old = m_latch; + uint8_t old = m_latch; /* all 8 bits are latched */ m_latch = data; @@ -239,7 +239,7 @@ MACHINE_CONFIG_END const device_type SEGAUSB = &device_creator; -usb_sound_device::usb_sound_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) +usb_sound_device::usb_sound_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_sound_interface(mconfig, *this), m_ourcpu(*this, "ourcpu"), @@ -258,7 +258,7 @@ usb_sound_device::usb_sound_device(const machine_config &mconfig, device_type ty { } -usb_sound_device::usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +usb_sound_device::usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGAUSB, "Sega Universal Sound Board", tag, owner, clock, "segausb", __FILE__), device_sound_interface(mconfig, *this), m_ourcpu(*this, "ourcpu"), @@ -468,7 +468,7 @@ WRITE8_MEMBER( usb_sound_device::p1_w ) WRITE8_MEMBER( usb_sound_device::p2_w ) { - UINT8 old = m_last_p2_value; + uint8_t old = m_last_p2_value; m_last_p2_value = data; /* low 2 bits control the bank of work RAM we are addressing */ @@ -505,7 +505,7 @@ READ8_MEMBER( usb_sound_device::t1_r ) static inline void clock_channel(timer8253_channel *ch) { - UINT8 lastgate = ch->lastgate; + uint8_t lastgate = ch->lastgate; /* update the gate */ ch->lastgate = ch->gate; @@ -550,7 +550,7 @@ static inline void clock_channel(timer8253_channel *ch) * *************************************/ -void usb_sound_device::timer_w(int which, UINT8 offset, UINT8 data) +void usb_sound_device::timer_w(int which, uint8_t offset, uint8_t data) { timer8253 *g = &m_timer_group[which]; timer8253_channel *ch; @@ -619,7 +619,7 @@ void usb_sound_device::timer_w(int which, UINT8 offset, UINT8 data) } -void usb_sound_device::env_w(int which, UINT8 offset, UINT8 data) +void usb_sound_device::env_w(int which, uint8_t offset, uint8_t data) { timer8253 *g = &m_timer_group[which]; @@ -881,7 +881,7 @@ machine_config_constructor usb_sound_device::device_mconfig_additions() const const device_type SEGAUSBROM = &device_creator; -usb_rom_sound_device::usb_rom_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +usb_rom_sound_device::usb_rom_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : usb_sound_device(mconfig, SEGAUSBROM, "Sega Universal Sound Board with ROM", tag, owner, clock, "segausbrom", __FILE__) { } diff --git a/src/mame/audio/segasnd.h b/src/mame/audio/segasnd.h index be4386d2ac7..e4cfd9a6445 100644 --- a/src/mame/audio/segasnd.h +++ b/src/mame/audio/segasnd.h @@ -12,7 +12,7 @@ class speech_sound_device : public device_t, public device_sound_interface { public: - speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~speech_sound_device() {} DECLARE_WRITE8_MEMBER( data_w ); @@ -36,11 +36,11 @@ protected: private: // internal state - UINT8 m_drq; - UINT8 m_latch; - UINT8 m_t0; - UINT8 m_p2; - UINT8 *m_speech; + uint8_t m_drq; + uint8_t m_latch; + uint8_t m_t0; + uint8_t m_p2; + uint8_t *m_speech; TIMER_CALLBACK_MEMBER( delayed_speech_w ); }; @@ -78,17 +78,17 @@ struct timer8253_channel count(0), remain(0) {} - UINT8 holding; /* holding until counts written? */ - UINT8 latchmode; /* latching mode */ - UINT8 latchtoggle; /* latching state */ - UINT8 clockmode; /* clocking mode */ - UINT8 bcdmode; /* BCD mode? */ - UINT8 output; /* current output value */ - UINT8 lastgate; /* previous gate value */ - UINT8 gate; /* current gate value */ - UINT8 subcount; /* subcount (2MHz clocks per input clock) */ - UINT16 count; /* initial count */ - UINT16 remain; /* current down counter value */ + uint8_t holding; /* holding until counts written? */ + uint8_t latchmode; /* latching mode */ + uint8_t latchtoggle; /* latching state */ + uint8_t clockmode; /* clocking mode */ + uint8_t bcdmode; /* BCD mode? */ + uint8_t output; /* current output value */ + uint8_t lastgate; /* previous gate value */ + uint8_t gate; /* current gate value */ + uint8_t subcount; /* subcount (2MHz clocks per input clock) */ + uint16_t count; /* initial count */ + uint16_t remain; /* current down counter value */ }; @@ -107,7 +107,7 @@ struct timer8253 g80_filter_state chan_filter[2]; /* filter states for the first two channels */ g80_filter_state gate1; /* first RC filter state */ g80_filter_state gate2; /* second RC filter state */ - UINT8 config; /* configuration for this timer */ + uint8_t config; /* configuration for this timer */ }; @@ -115,8 +115,8 @@ class usb_sound_device : public device_t, public device_sound_interface { public: - usb_sound_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); - usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + usb_sound_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); + usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~usb_sound_device() {} required_device m_ourcpu; /* CPU index of the 8035 */ @@ -148,27 +148,27 @@ private: // internal state sound_stream *m_stream; /* output stream */ device_t *m_maincpu; - UINT8 m_in_latch; /* input latch */ - UINT8 m_out_latch; /* output latch */ - UINT8 m_last_p2_value; /* current P2 output value */ - optional_shared_ptr m_program_ram; /* pointer to program RAM */ - required_shared_ptr m_work_ram; /* pointer to work RAM */ - UINT8 m_work_ram_bank; /* currently selected work RAM bank */ - UINT8 m_t1_clock; /* T1 clock value */ - UINT8 m_t1_clock_mask; /* T1 clock mask (configured via jumpers) */ + uint8_t m_in_latch; /* input latch */ + uint8_t m_out_latch; /* output latch */ + uint8_t m_last_p2_value; /* current P2 output value */ + optional_shared_ptr m_program_ram; /* pointer to program RAM */ + required_shared_ptr m_work_ram; /* pointer to work RAM */ + uint8_t m_work_ram_bank; /* currently selected work RAM bank */ + uint8_t m_t1_clock; /* T1 clock value */ + uint8_t m_t1_clock_mask; /* T1 clock mask (configured via jumpers) */ timer8253 m_timer_group[3]; /* 3 groups of timers */ - UINT8 m_timer_mode[3]; /* mode control for each group */ - UINT32 m_noise_shift; - UINT8 m_noise_state; - UINT8 m_noise_subcount; + uint8_t m_timer_mode[3]; /* mode control for each group */ + uint32_t m_noise_shift; + uint8_t m_noise_state; + uint8_t m_noise_subcount; double m_gate_rc1_exp[2]; double m_gate_rc2_exp[2]; g80_filter_state m_final_filter; g80_filter_state m_noise_filters[5]; TIMER_CALLBACK_MEMBER( delayed_usb_data_w ); - void timer_w(int which, UINT8 offset, UINT8 data); - void env_w(int which, UINT8 offset, UINT8 data); + void timer_w(int which, uint8_t offset, uint8_t data); + void env_w(int which, uint8_t offset, uint8_t data); }; extern const device_type SEGAUSB; @@ -176,7 +176,7 @@ extern const device_type SEGAUSB; class usb_rom_sound_device : public usb_sound_device { public: - usb_rom_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + usb_rom_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~usb_rom_sound_device() {} protected: diff --git a/src/mame/audio/seibu.cpp b/src/mame/audio/seibu.cpp index 917729fe3c2..971db1ea8a7 100644 --- a/src/mame/audio/seibu.cpp +++ b/src/mame/audio/seibu.cpp @@ -76,7 +76,7 @@ const device_type SEIBU_SOUND = &device_creator; -seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEIBU_SOUND, "Seibu Sound System", tag, owner, clock, "seibu_sound", __FILE__), m_sound_rom(*this, ":audiocpu"), m_main2sub_pending(0), @@ -145,7 +145,7 @@ void seibu_sound_device::device_reset() update_irq_lines(VECTOR_INIT); } -static UINT8 decrypt_data(int a,int src) +static uint8_t decrypt_data(int a,int src) { if ( BIT(a,9) & BIT(a,8)) src ^= 0x80; if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40; @@ -159,7 +159,7 @@ static UINT8 decrypt_data(int a,int src) return src; } -static UINT8 decrypt_opcode(int a,int src) +static uint8_t decrypt_opcode(int a,int src) { if ( BIT(a,9) & BIT(a,8)) src ^= 0x80; if ( BIT(a,11) & BIT(a,4) & BIT(a,1)) src ^= 0x40; @@ -178,13 +178,13 @@ static UINT8 decrypt_opcode(int a,int src) return src; } -UINT8 *seibu_sound_device::get_custom_decrypt() +uint8_t *seibu_sound_device::get_custom_decrypt() { if (m_decrypted_opcodes) return m_decrypted_opcodes.get(); int size = memregion(":audiocpu")->bytes(); - m_decrypted_opcodes = make_unique_clear(size); + m_decrypted_opcodes = make_unique_clear(size); membank(":seibu_bank0d")->set_base(m_decrypted_opcodes.get()); if (size > 0x10000) { membank(":seibu_bank1d")->configure_entries(0, (size - 0x10000) / 0x8000, m_decrypted_opcodes.get() + 0x10000, 0x8000); @@ -195,11 +195,11 @@ UINT8 *seibu_sound_device::get_custom_decrypt() return m_decrypted_opcodes.get(); } -void seibu_sound_device::apply_decrypt(UINT8 *rom, UINT8 *opcodes, int length) +void seibu_sound_device::apply_decrypt(uint8_t *rom, uint8_t *opcodes, int length) { for (int i = 0;i < length;i++) { - UINT8 src = rom[i]; + uint8_t src = rom[i]; rom[i] = decrypt_data(i,src); opcodes[i] = decrypt_opcode(i,src); @@ -505,7 +505,7 @@ ADDRESS_MAP_END const device_type SEIBU_ADPCM = &device_creator; -seibu_adpcm_device::seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +seibu_adpcm_device::seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEIBU_ADPCM, "Seibu ADPCM (MSM5205)", tag, owner, clock, "seibu_adpcm", __FILE__), device_sound_interface(mconfig, *this), m_stream(nullptr), diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h index ff492e6c48c..66139a40ca1 100644 --- a/src/mame/audio/seibu.h +++ b/src/mame/audio/seibu.h @@ -43,7 +43,7 @@ ADDRESS_MAP_EXTERN(seibu3_adpcm_sound_map, 8); class seibu_sound_device : public device_t { public: - seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~seibu_sound_device() {} DECLARE_READ16_MEMBER( main_word_r ); @@ -60,9 +60,9 @@ public: DECLARE_WRITE8_MEMBER( main_data_w ); DECLARE_WRITE8_MEMBER( pending_w ); - static void apply_decrypt(UINT8 *rom, UINT8 *opcodes, int length); + static void apply_decrypt(uint8_t *rom, uint8_t *opcodes, int length); void set_encryption(int mode); - UINT8 *get_custom_decrypt(); + uint8_t *get_custom_decrypt(); void update_irq_lines(int param); protected: @@ -72,17 +72,17 @@ protected: private: int m_encryption_mode; - std::unique_ptr m_decrypted_opcodes; + std::unique_ptr m_decrypted_opcodes; // internal state device_t *m_sound_cpu; - required_region_ptr m_sound_rom; - UINT8 m_main2sub[2]; - UINT8 m_sub2main[2]; + required_region_ptr m_sound_rom; + uint8_t m_main2sub[2]; + uint8_t m_sub2main[2]; int m_main2sub_pending; int m_sub2main_pending; - UINT8 m_rst10_irq; - UINT8 m_rst18_irq; + uint8_t m_rst10_irq; + uint8_t m_rst18_irq; enum { @@ -103,7 +103,7 @@ class seibu_adpcm_device : public device_t, public device_sound_interface { public: - seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~seibu_adpcm_device() {} void decrypt(); @@ -121,11 +121,11 @@ protected: // internal state oki_adpcm_state m_adpcm; sound_stream *m_stream; - UINT32 m_current; - UINT32 m_end; - UINT8 m_nibble; - UINT8 m_playing; - required_region_ptr m_base; + uint32_t m_current; + uint32_t m_end; + uint8_t m_nibble; + uint8_t m_playing; + required_region_ptr m_base; }; extern const device_type SEIBU_ADPCM; diff --git a/src/mame/audio/snes_snd.cpp b/src/mame/audio/snes_snd.cpp index 127fec049ce..b47edce55c9 100644 --- a/src/mame/audio/snes_snd.cpp +++ b/src/mame/audio/snes_snd.cpp @@ -155,7 +155,7 @@ static const int ENVCNT[0x20] const device_type SNES = &device_creator; -snes_sound_device::snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +snes_sound_device::snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNES, "SNES Custom DSP (SPC700)", tag, owner, clock, "snes_sound", __FILE__), device_sound_interface(mconfig, *this) { @@ -179,7 +179,7 @@ void snes_sound_device::device_start() { m_channel = machine().sound().stream_alloc(*this, 0, 2, 32000); - m_ram = make_unique_clear(SNES_SPCRAM_SIZE); + m_ram = make_unique_clear(SNES_SPCRAM_SIZE); /* put IPL image at the top of RAM */ memcpy(m_ipl_region, machine().root_device().memregion("sound_ipl")->base(), 64); @@ -338,7 +338,7 @@ void snes_sound_device::dsp_update( short *sound_ptr ) m_keys |= m; m_keyed_on |= m; vl = m_dsp_regs[(v << 4) + 4]; - vp->samp_id = *( UINT32 * )&sd[vl]; + vp->samp_id = *( uint32_t * )&sd[vl]; vp->mem_ptr = LEtoME16(sd[vl].vptr); #ifdef DBG_KEY @@ -391,7 +391,7 @@ void snes_sound_device::dsp_update( short *sound_ptr ) continue; } - vp->pitch = LEtoME16(*((UINT16 *)&m_dsp_regs[V + 2])) & 0x3fff; + vp->pitch = LEtoME16(*((uint16_t *)&m_dsp_regs[V + 2])) & 0x3fff; #ifndef NO_PMOD /* Pitch mod uses OUTX from last voice for this one. Luckily we haven't @@ -454,7 +454,7 @@ void snes_sound_device::dsp_update( short *sound_ptr ) } vp->header_cnt = 8; - vl = (UINT8)m_ram[vp->mem_ptr++]; + vl = (uint8_t)m_ram[vp->mem_ptr++]; vp->range = vl >> 4; vp->end = vl & 3; vp->filter = (vl & 12) >> 2; @@ -501,7 +501,7 @@ void snes_sound_device::dsp_update( short *sound_ptr ) } #ifdef DBG_BRR - logerror("V%d: shifted delta=%04X\n", v, (UINT16)outx); + logerror("V%d: shifted delta=%04X\n", v, (uint16_t)outx); #endif switch (vp->filter) @@ -533,7 +533,7 @@ void snes_sound_device::dsp_update( short *sound_ptr ) } #ifdef DBG_BRR - logerror("V%d: filter + delta=%04X\n", v, (UINT16)outx); + logerror("V%d: filter + delta=%04X\n", v, (uint16_t)outx); #endif vp->smp2 = (signed short)vp->smp1; @@ -626,8 +626,8 @@ void snes_sound_device::dsp_update( short *sound_ptr ) #endif echo_base = ((m_dsp_regs[0x6d] << 8) + m_echo_ptr) & 0xffff; - m_fir_lbuf[m_fir_ptr] = (signed short)LEtoME16(*(UINT16 *)&m_ram[echo_base]); - m_fir_rbuf[m_fir_ptr] = (signed short)LEtoME16(*(UINT16 *)&m_ram[echo_base + sizeof(short)]); + m_fir_lbuf[m_fir_ptr] = (signed short)LEtoME16(*(uint16_t *)&m_ram[echo_base]); + m_fir_rbuf[m_fir_ptr] = (signed short)LEtoME16(*(uint16_t *)&m_ram[echo_base + sizeof(short)]); /* Now, evaluate the FIR filter, and add the results into the final output. */ vl = m_fir_lbuf[m_fir_ptr] * (signed char)m_dsp_regs[0x7f]; @@ -688,11 +688,11 @@ void snes_sound_device::dsp_update( short *sound_ptr ) echor = -32768; #ifdef DBG_ECHO - logerror("Echo: Writing %04X,%04X at location %04X\n", (UINT16)echol, (UINT16)echor, echo_base); + logerror("Echo: Writing %04X,%04X at location %04X\n", (uint16_t)echol, (uint16_t)echor, echo_base); #endif - *(UINT16 *)&m_ram[echo_base] = MEtoLE16((UINT16)echol); - *(UINT16 *)&m_ram[echo_base + sizeof(short)] = MEtoLE16((UINT16)echor); + *(uint16_t *)&m_ram[echo_base] = MEtoLE16((uint16_t)echol); + *(uint16_t *)&m_ram[echo_base + sizeof(short)] = MEtoLE16((uint16_t)echor); } m_echo_ptr += 2 * sizeof(short); @@ -1086,7 +1086,7 @@ READ8_MEMBER( snes_sound_device::spc_io_r ) case 0xe: /* Counter 1 */ case 0xf: /* Counter 2 */ { - UINT8 value = m_ram[0xf0 + offset] & 0x0f; + uint8_t value = m_ram[0xf0 + offset] & 0x0f; m_ram[0xf0 + offset] = 0; return value; } diff --git a/src/mame/audio/snes_snd.h b/src/mame/audio/snes_snd.h index 6d4e97b14a1..a2e7c5417d8 100644 --- a/src/mame/audio/snes_snd.h +++ b/src/mame/audio/snes_snd.h @@ -29,7 +29,7 @@ ALLOW_SAVE_TYPE(env_state_t32); struct voice_state_type /* Voice state type */ { - UINT16 mem_ptr; /* Sample data memory pointer */ + uint16_t mem_ptr; /* Sample data memory pointer */ int end; /* End or loop after block */ int envcnt; /* Counts to envelope update */ env_state_t32 envstate; /* Current envelope state */ @@ -41,17 +41,17 @@ struct voice_state_type /* Voice state type */ int on_cnt; /* Is it time to turn on yet? */ int pitch; /* Sample pitch (4096->32000Hz) */ int range; /* Last header's range */ - UINT32 samp_id; /* Sample ID# */ + uint32_t samp_id; /* Sample ID# */ int sampptr; /* Where in sampbuf we are */ - INT32 smp1; /* Last sample (for BRR filter) */ - INT32 smp2; /* Second-to-last sample decoded*/ + int32_t smp1; /* Last sample (for BRR filter) */ + int32_t smp2; /* Second-to-last sample decoded*/ short sampbuf[4]; /* Buffer for Gaussian interp */ }; struct src_dir_type /* Source directory entry */ { - UINT16 vptr; /* Ptr to start of sample data */ - UINT16 lptr; /* Loop pointer in sample data */ + uint16_t vptr; /* Ptr to start of sample data */ + uint16_t lptr; /* Loop pointer in sample data */ }; @@ -63,7 +63,7 @@ class snes_sound_device : public device_t, public device_sound_interface { public: - snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~snes_sound_device() {} void set_volume(int volume); @@ -75,7 +75,7 @@ public: DECLARE_WRITE8_MEMBER( spc_ram_w ); DECLARE_WRITE8_MEMBER( spc_port_in ); -// UINT8 *spc_get_ram() { return m_ram; } +// uint8_t *spc_get_ram() { return m_ram; } protected: // device-level overrides @@ -97,10 +97,10 @@ private: void state_register(); // internal state - std::unique_ptr m_ram; + std::unique_ptr m_ram; sound_stream *m_channel; - UINT8 m_dsp_regs[256]; /* DSP registers */ - UINT8 m_ipl_region[64]; /* SPC top 64 bytes */ + uint8_t m_dsp_regs[256]; /* DSP registers */ + uint8_t m_ipl_region[64]; /* SPC top 64 bytes */ int m_keyed_on; int m_keys; /* 8-bits for 8 voices */ @@ -120,12 +120,12 @@ private: /* timers */ emu_timer *m_timer[3]; - UINT8 m_enabled[3]; - UINT16 m_counter[3]; + uint8_t m_enabled[3]; + uint16_t m_counter[3]; /* IO ports */ - UINT8 m_port_in[4]; /* SPC input ports */ - UINT8 m_port_out[4]; /* SPC output ports */ + uint8_t m_port_in[4]; /* SPC input ports */ + uint8_t m_port_out[4]; /* SPC output ports */ }; extern const device_type SNES; diff --git a/src/mame/audio/snk6502.cpp b/src/mame/audio/snk6502.cpp index 61a5bc8e959..526292ab920 100644 --- a/src/mame/audio/snk6502.cpp +++ b/src/mame/audio/snk6502.cpp @@ -130,7 +130,7 @@ DISCRETE_SOUND_END const device_type SNK6502 = &device_creator; -snk6502_sound_device::snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +snk6502_sound_device::snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SNK6502, "SNK6502 Audio Custom", tag, owner, clock, "snk6502_sound", __FILE__), device_sound_interface(mconfig, *this), //m_tone_channels[CHANNELS], @@ -189,7 +189,7 @@ inline void snk6502_sound_device::validate_tone_channel(int channel) { if (!m_tone_channels[channel].mute) { - UINT8 romdata = m_ROM[m_tone_channels[channel].base + m_tone_channels[channel].offset]; + uint8_t romdata = m_ROM[m_tone_channels[channel].base + m_tone_channels[channel].offset]; if (romdata != 0xff) m_tone_channels[channel].sample_step = m_tone_channels[channel].sample_rate / (256 - romdata); @@ -743,7 +743,7 @@ WRITE8_MEMBER( snk6502_sound_device::fantasy_sound_w ) #define HD68880_SYBS 0x0f -void snk6502_sound_device::speech_w(UINT8 data, const UINT16 *table, int start) +void snk6502_sound_device::speech_w(uint8_t data, const uint16_t *table, int start) { /* bit description @@ -886,7 +886,7 @@ void snk6502_sound_device::speech_w(UINT8 data, const UINT16 *table, int start) WRITE8_MEMBER( snk6502_sound_device::vanguard_speech_w ) { - static const UINT16 vanguard_table[16] = + static const uint16_t vanguard_table[16] = { 0x04000, 0x04325, @@ -911,7 +911,7 @@ WRITE8_MEMBER( snk6502_sound_device::vanguard_speech_w ) WRITE8_MEMBER( snk6502_sound_device::fantasy_speech_w ) { - static const UINT16 fantasy_table[16] = + static const uint16_t fantasy_table[16] = { 0x04000, 0x04297, @@ -949,12 +949,12 @@ void snk6502_sound_device::sound_stream_update(sound_stream &stream, stream_samp while (samples-- > 0) { - INT32 data = 0; + int32_t data = 0; for (i = 0; i < CHANNELS; i++) { TONE *voice = &m_tone_channels[i]; - INT16 *form = voice->form; + int16_t *form = voice->form; if (!voice->mute && voice->sample_step) { @@ -963,8 +963,8 @@ void snk6502_sound_device::sound_stream_update(sound_stream &stream, stream_samp int cur = form[(cur_pos >> FRAC_BITS) & 15]; /* interpolate */ - data += ((INT32)prev * (FRAC_ONE - (cur_pos & FRAC_MASK)) - + (INT32)cur * (cur_pos & FRAC_MASK)) >> FRAC_BITS; + data += ((int32_t)prev * (FRAC_ONE - (cur_pos & FRAC_MASK)) + + (int32_t)cur * (cur_pos & FRAC_MASK)) >> FRAC_BITS; voice->sample_cur = cur_pos; } diff --git a/src/mame/audio/socrates.cpp b/src/mame/audio/socrates.cpp index c35896e5c25..e6046756243 100644 --- a/src/mame/audio/socrates.cpp +++ b/src/mame/audio/socrates.cpp @@ -23,7 +23,7 @@ const device_type SOCRATES_SOUND = &device_creator; // socrates_snd_device - constructor //------------------------------------------------- -socrates_snd_device::socrates_snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +socrates_snd_device::socrates_snd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SOCRATES_SOUND, "Socrates Sound", tag, owner, clock, "socrates_snd", __FILE__), device_sound_interface(mconfig, *this) { @@ -61,7 +61,7 @@ void socrates_snd_device::sound_stream_update(sound_stream &stream, stream_sampl } -const UINT8 socrates_snd_device::s_volumeLUT[16] = +const uint8_t socrates_snd_device::s_volumeLUT[16] = { 0, 61, 100, 132, 158, 183, 201, 218, 233, 242, 253, 255, 250, 240, 224, 211 diff --git a/src/mame/audio/socrates.h b/src/mame/audio/socrates.h index 14498844809..c42a3d44671 100644 --- a/src/mame/audio/socrates.h +++ b/src/mame/audio/socrates.h @@ -9,7 +9,7 @@ class socrates_snd_device : public device_t, public device_sound_interface { public: - socrates_snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + socrates_snd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void reg0_w(int data); void reg1_w(int data); @@ -25,17 +25,17 @@ protected: virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; private: void snd_clock(); - static const UINT8 s_volumeLUT[]; + static const uint8_t s_volumeLUT[]; // internal state sound_stream * m_stream; - UINT8 m_freq[2]; // channel 1,2 frequencies - UINT8 m_vol[2]; // channel 1,2 volume - UINT8 m_enable[2]; // channel 1,2 enable - UINT8 m_channel3; // channel 3 weird register - UINT8 m_state[3]; // output states for channels 1,2,3 - UINT8 m_accum[3]; // accumulators for channels 1,2,3 - UINT16 m_DAC_output; // output + uint8_t m_freq[2]; // channel 1,2 frequencies + uint8_t m_vol[2]; // channel 1,2 volume + uint8_t m_enable[2]; // channel 1,2 enable + uint8_t m_channel3; // channel 3 weird register + uint8_t m_state[3]; // output states for channels 1,2,3 + uint8_t m_accum[3]; // accumulators for channels 1,2,3 + uint16_t m_DAC_output; // output }; extern const device_type SOCRATES_SOUND; diff --git a/src/mame/audio/special.cpp b/src/mame/audio/special.cpp index 6b827a2d2c8..f81e203bd9a 100644 --- a/src/mame/audio/special.cpp +++ b/src/mame/audio/special.cpp @@ -24,7 +24,7 @@ const device_type SPECIMX_SND = &device_creator; // specimx_sound_device - constructor //------------------------------------------------- -specimx_sound_device::specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +specimx_sound_device::specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SPECIMX_SND, "Specialist MX Audio Custom", tag, owner, clock, "specimx_sound", __FILE__), device_sound_interface(mconfig, *this), m_mixer_channel(nullptr) @@ -50,9 +50,9 @@ void specimx_sound_device::device_start() void specimx_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - INT16 channel_0_signal; - INT16 channel_1_signal; - INT16 channel_2_signal; + int16_t channel_0_signal; + int16_t channel_1_signal; + int16_t channel_2_signal; stream_sample_t *sample_left = outputs[0]; diff --git a/src/mame/audio/special.h b/src/mame/audio/special.h index 6ecc3ee3f3f..78e05bc319d 100644 --- a/src/mame/audio/special.h +++ b/src/mame/audio/special.h @@ -15,7 +15,7 @@ class specimx_sound_device : public device_t, public device_sound_interface { public: - specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~specimx_sound_device() { } DECLARE_WRITE_LINE_MEMBER(set_input_ch0); diff --git a/src/mame/audio/starwars.cpp b/src/mame/audio/starwars.cpp index 1fda61f4e31..9a8b67e5e70 100644 --- a/src/mame/audio/starwars.cpp +++ b/src/mame/audio/starwars.cpp @@ -34,7 +34,7 @@ READ8_MEMBER(starwars_state::r6532_porta_r) /* d1 (out) TMS5220 Not Read */ /* d0 (out) TMS5220 Not Write */ /* Note: bit 4 is always set to avoid sound self test */ - UINT8 olddata = m_riot->porta_in_get(); + uint8_t olddata = m_riot->porta_in_get(); tms5220_device *tms5220 = machine().device("tms"); return (olddata & 0xc0) | 0x10 | (tms5220->readyq_r() << 2); diff --git a/src/mame/audio/suna8.cpp b/src/mame/audio/suna8.cpp index 43f70119b9a..bc7a5e49614 100644 --- a/src/mame/audio/suna8.cpp +++ b/src/mame/audio/suna8.cpp @@ -16,13 +16,13 @@ SAMPLES_START_CB_MEMBER(suna8_state::sh_start) { int i, len = memregion("samples")->bytes() * 2; // 2 samples per byte - UINT8 *ROM = memregion("samples")->base(); + uint8_t *ROM = memregion("samples")->base(); - m_samplebuf = std::make_unique(len); + m_samplebuf = std::make_unique(len); // Convert 4 bit to 16 bit samples for(i = 0; i < len; i++) - m_samplebuf[i] = (INT8)(((ROM[i/2] << ((i & 1)?0:4)) & 0xf0) ^ 0x80) * 0x100; + m_samplebuf[i] = (int8_t)(((ROM[i/2] << ((i & 1)?0:4)) & 0xf0) ^ 0x80) * 0x100; m_numsamples = len / SAMPLEN; } diff --git a/src/mame/audio/svis_snd.cpp b/src/mame/audio/svis_snd.cpp index cc2bec2b821..92c3bf119c7 100644 --- a/src/mame/audio/svis_snd.cpp +++ b/src/mame/audio/svis_snd.cpp @@ -22,7 +22,7 @@ const device_type SVISION_SND = &device_creator; // svision_sound_device - constructor //------------------------------------------------- -svision_sound_device::svision_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +svision_sound_device::svision_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SVISION_SND, "Super Vision Audio Custom", tag, owner, clock, "svision_sound", __FILE__), device_sound_interface(mconfig, *this), m_mixer_channel(nullptr) @@ -85,7 +85,7 @@ void svision_sound_device::sound_stream_update(sound_stream &stream, stream_samp break; } { - INT16 s = on ? channel->volume << 8 : 0; + int16_t s = on ? channel->volume << 8 : 0; if (j == 0) *right += s; else @@ -99,7 +99,7 @@ void svision_sound_device::sound_stream_update(sound_stream &stream, stream_samp } if (m_noise.on && (m_noise.play || m_noise.count)) { - INT16 s = (m_noise.value ? 1 << 8: 0) * m_noise.volume; + int16_t s = (m_noise.value ? 1 << 8: 0) * m_noise.volume; int b1, b2; if (m_noise.left) *left += s; @@ -128,9 +128,9 @@ void svision_sound_device::sound_stream_update(sound_stream &stream, stream_samp } if (m_dma.on) { - UINT8 sample; - INT16 s; - UINT16 addr = m_dma.start + (unsigned) m_dma.pos / 2; + uint8_t sample; + int16_t s; + uint16_t addr = m_dma.start + (unsigned) m_dma.pos / 2; if (addr >= 0x8000 && addr < 0xc000) { sample = machine().root_device().memregion("user1")->base()[(addr & 0x3fff) | m_dma.ca14to16]; @@ -236,7 +236,7 @@ void svision_sound_device::sound_decrement() void svision_sound_device::soundport_w(int which, int offset, int data) { SVISION_CHANNEL *channel = &m_channel[which]; - UINT16 size; + uint16_t size; m_mixer_channel->update(); channel->reg[offset] = data; diff --git a/src/mame/audio/svis_snd.h b/src/mame/audio/svis_snd.h index d6ca0228688..46b18a29968 100644 --- a/src/mame/audio/svis_snd.h +++ b/src/mame/audio/svis_snd.h @@ -35,10 +35,10 @@ struct SVISION_NOISE pos(0.0), value(0) { - memset(reg, 0, sizeof(UINT8)*3); + memset(reg, 0, sizeof(uint8_t)*3); } - UINT8 reg[3]; + uint8_t reg[3]; int on, right, left, play; SVISION_NOISE_Type type; int state; @@ -61,10 +61,10 @@ struct SVISION_DMA step(0.0), finished(0) { - memset(reg, 0, sizeof(UINT8)*5); + memset(reg, 0, sizeof(uint8_t)*5); } - UINT8 reg[5]; + uint8_t reg[5]; int on, right, left; int ca14to16; int start,size; @@ -82,10 +82,10 @@ struct SVISION_CHANNEL size(0), count(0) { - memset(reg, 0, sizeof(UINT8)*4); + memset(reg, 0, sizeof(uint8_t)*4); } - UINT8 reg[4]; + uint8_t reg[4]; int on; int waveform, volume; int pos; @@ -105,7 +105,7 @@ class svision_sound_device : public device_t, public device_sound_interface { public: - svision_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + svision_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~svision_sound_device() { } // static configuration diff --git a/src/mame/audio/t5182.cpp b/src/mame/audio/t5182.cpp index b3d6ba53cbc..c22b0419ce9 100644 --- a/src/mame/audio/t5182.cpp +++ b/src/mame/audio/t5182.cpp @@ -153,7 +153,7 @@ rom. const device_type T5182 = &device_creator; -t5182_device::t5182_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +t5182_device::t5182_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, T5182, "T5182 MCU", tag, owner, clock, "t5182", __FILE__), m_ourcpu(*this, "t5182_z80"), m_sharedram(*this, "sharedram"), diff --git a/src/mame/audio/t5182.h b/src/mame/audio/t5182.h index fba3a22b55a..4783f626236 100644 --- a/src/mame/audio/t5182.h +++ b/src/mame/audio/t5182.h @@ -7,7 +7,7 @@ class t5182_device : public device_t { public: - t5182_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + t5182_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~t5182_device() {} enum @@ -49,7 +49,7 @@ protected: private: // internal state required_device m_ourcpu; - required_shared_ptr m_sharedram; + required_shared_ptr m_sharedram; int m_irqstate; int m_semaphore_main; int m_semaphore_snd; diff --git a/src/mame/audio/taito_en.cpp b/src/mame/audio/taito_en.cpp index 60f4497cd7c..a793b0eeef2 100644 --- a/src/mame/audio/taito_en.cpp +++ b/src/mame/audio/taito_en.cpp @@ -18,7 +18,7 @@ const device_type TAITO_EN = &device_creator; -taito_en_device::taito_en_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +taito_en_device::taito_en_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TAITO_EN, "Taito Ensoniq Sound System", tag, owner, clock, "taito_en", __FILE__), m_audiocpu(*this, "audiocpu"), m_ensoniq(*this, "ensoniq"), @@ -56,8 +56,8 @@ void taito_en_device::device_start() void taito_en_device::device_reset() { /* Sound cpu program loads to 0xc00000 so we use a bank */ - UINT16 *ROM = (UINT16 *)memregion("audiocpu")->base(); - UINT16 *sound_ram = (UINT16 *)memshare("share1")->ptr(); + uint16_t *ROM = (uint16_t *)memregion("audiocpu")->base(); + uint16_t *sound_ram = (uint16_t *)memshare("share1")->ptr(); membank("bank1")->set_base(&ROM[0x80000]); membank("bank2")->set_base(&ROM[0x90000]); membank("bank3")->set_base(&ROM[0xa0000]); @@ -105,7 +105,7 @@ WRITE8_MEMBER( taito_en_device::en_68000_share_w ) WRITE16_MEMBER( taito_en_device::en_es5505_bank_w ) { - UINT32 max_banks_this_game = (memregion(":ensoniq.0")->bytes()/0x200000)-1; + uint32_t max_banks_this_game = (memregion(":ensoniq.0")->bytes()/0x200000)-1; /* mask out unused bits */ data &= max_banks_this_game; @@ -146,7 +146,7 @@ READ16_MEMBER( taito_en_device::es5510_dsp_r ) WRITE16_MEMBER( taito_en_device::es5510_dsp_w ) { - UINT8 *snd_mem = (UINT8 *)memregion(":ensoniq.0")->base(); + uint8_t *snd_mem = (uint8_t *)memregion(":ensoniq.0")->base(); // if (offset>4 && offset!=0x80 && offset!=0xa0 && offset!=0xc0 && offset!=0xe0) // logerror("%06x: DSP write offset %04x %04x\n",space.device().safe_pc(),offset,data); diff --git a/src/mame/audio/taito_en.h b/src/mame/audio/taito_en.h index 0d4fee8a30f..5733748d19f 100644 --- a/src/mame/audio/taito_en.h +++ b/src/mame/audio/taito_en.h @@ -15,7 +15,7 @@ class taito_en_device : public device_t { public: - taito_en_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + taito_en_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~taito_en_device() {} DECLARE_READ8_MEMBER( en_68000_share_r ); @@ -43,17 +43,17 @@ private: required_device m_ensoniq; required_device m_duart68681; required_device m_mb87078; - required_shared_ptr m_snd_shared_ram; + required_shared_ptr m_snd_shared_ram; //todo: hook up cpu/es5510 - UINT16 m_es5510_dsp_ram[0x200]; - UINT32 m_es5510_gpr[0xc0]; - UINT32 m_es5510_dram[1<<24]; - UINT32 m_es5510_dol_latch; - UINT32 m_es5510_dil_latch; - UINT32 m_es5510_dadr_latch; - UINT32 m_es5510_gpr_latch; - UINT8 m_es5510_ram_sel; + uint16_t m_es5510_dsp_ram[0x200]; + uint32_t m_es5510_gpr[0xc0]; + uint32_t m_es5510_dram[1<<24]; + uint32_t m_es5510_dol_latch; + uint32_t m_es5510_dil_latch; + uint32_t m_es5510_dadr_latch; + uint32_t m_es5510_gpr_latch; + uint8_t m_es5510_ram_sel; }; extern const device_type TAITO_EN; diff --git a/src/mame/audio/taito_zm.cpp b/src/mame/audio/taito_zm.cpp index a23967134c3..4f4d8f4f0c3 100644 --- a/src/mame/audio/taito_zm.cpp +++ b/src/mame/audio/taito_zm.cpp @@ -37,7 +37,7 @@ const device_type TAITO_ZOOM = &device_creator; // taito_zoom_device - constructor //------------------------------------------------- -taito_zoom_device::taito_zoom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +taito_zoom_device::taito_zoom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TAITO_ZOOM, "Taito Zoom Sound System", tag, owner, clock, "taito_zoom", __FILE__), m_soundcpu(*this, ":mn10200"), m_zsg2(*this, ":zsg2"), @@ -52,7 +52,7 @@ taito_zoom_device::taito_zoom_device(const machine_config &mconfig, const char * void taito_zoom_device::device_start() { - m_snd_shared_ram = make_unique_clear(0x100); + m_snd_shared_ram = make_unique_clear(0x100); // register for savestates save_item(NAME(m_reg_address)); diff --git a/src/mame/audio/taito_zm.h b/src/mame/audio/taito_zm.h index 610cdc807a8..353cb898f54 100644 --- a/src/mame/audio/taito_zm.h +++ b/src/mame/audio/taito_zm.h @@ -16,7 +16,7 @@ class taito_zoom_device : public device_t { public: - taito_zoom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + taito_zoom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~taito_zoom_device() {} DECLARE_WRITE16_MEMBER(sound_irq_w); @@ -40,9 +40,9 @@ private: required_device m_zsg2; // internal state - UINT16 m_reg_address; - UINT8 m_tms_ctrl; - std::unique_ptr m_snd_shared_ram; + uint16_t m_reg_address; + uint8_t m_tms_ctrl; + std::unique_ptr m_snd_shared_ram; }; extern const device_type TAITO_ZOOM; diff --git a/src/mame/audio/taitosnd.cpp b/src/mame/audio/taitosnd.cpp index f2ff9aa9358..6a2d9795ee1 100644 --- a/src/mame/audio/taitosnd.cpp +++ b/src/mame/audio/taitosnd.cpp @@ -40,7 +40,7 @@ const device_type TC0140SYT = &device_creator; // tc0140syt_device - constructor //------------------------------------------------- -tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0140SYT, "Taito TC0140SYT", tag, owner, clock, "tc0140syt", __FILE__) , m_mainmode(0) , m_submode(0) @@ -49,8 +49,8 @@ tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *ta , m_mastercpu(*this, finder_base::DUMMY_TAG) , m_slavecpu(*this, finder_base::DUMMY_TAG) { - memset(m_slavedata, 0, sizeof(UINT8)*4); - memset(m_masterdata, 0, sizeof(UINT8)*4); + memset(m_slavedata, 0, sizeof(uint8_t)*4); + memset(m_masterdata, 0, sizeof(uint8_t)*4); } @@ -80,7 +80,7 @@ void tc0140syt_device::device_reset() m_status = 0; m_nmi_enabled = 0; - for (UINT32 i = 0; i < 4; i++) + for (uint32_t i = 0; i < 4; i++) { m_slavedata[i] = 0; m_masterdata[i] = 0; @@ -94,8 +94,8 @@ void tc0140syt_device::device_reset() void tc0140syt_device::update_nmi() { - UINT32 nmi_pending = m_status & (TC0140SYT_PORT23_FULL | TC0140SYT_PORT01_FULL); - UINT32 state = (nmi_pending && m_nmi_enabled) ? ASSERT_LINE : CLEAR_LINE; + uint32_t nmi_pending = m_status & (TC0140SYT_PORT23_FULL | TC0140SYT_PORT01_FULL); + uint32_t state = (nmi_pending && m_nmi_enabled) ? ASSERT_LINE : CLEAR_LINE; m_slavecpu->set_input_line(INPUT_LINE_NMI, state); } @@ -156,7 +156,7 @@ WRITE8_MEMBER( tc0140syt_device::master_comm_w ) READ8_MEMBER( tc0140syt_device::master_comm_r ) { machine().scheduler().synchronize(); // let slavecpu catch up (after we return and the main cpu finishes what it's doing) - UINT8 res = 0; + uint8_t res = 0; switch (m_mainmode) { @@ -250,7 +250,7 @@ WRITE8_MEMBER( tc0140syt_device::slave_comm_w ) READ8_MEMBER( tc0140syt_device::slave_comm_r ) { - UINT8 res = 0; + uint8_t res = 0; switch (m_submode) { diff --git a/src/mame/audio/taitosnd.h b/src/mame/audio/taitosnd.h index b74f13d0307..e6f20e1bec1 100644 --- a/src/mame/audio/taitosnd.h +++ b/src/mame/audio/taitosnd.h @@ -24,7 +24,7 @@ class tc0140syt_device : public device_t { public: - tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tc0140syt_device() { } static void set_master_tag(device_t &device, const char *tag) { downcast(device).m_mastercpu.set_tag(tag); } @@ -48,12 +48,12 @@ protected: private: void update_nmi(); - UINT8 m_slavedata[4]; /* Data on master->slave port (4 nibbles) */ - UINT8 m_masterdata[4]; /* Data on slave->master port (4 nibbles) */ - UINT8 m_mainmode; /* Access mode on master cpu side */ - UINT8 m_submode; /* Access mode on slave cpu side */ - UINT8 m_status; /* Status data */ - UINT8 m_nmi_enabled; /* 1 if slave cpu has nmi's enabled */ + uint8_t m_slavedata[4]; /* Data on master->slave port (4 nibbles) */ + uint8_t m_masterdata[4]; /* Data on slave->master port (4 nibbles) */ + uint8_t m_mainmode; /* Access mode on master cpu side */ + uint8_t m_submode; /* Access mode on slave cpu side */ + uint8_t m_status; /* Status data */ + uint8_t m_nmi_enabled; /* 1 if slave cpu has nmi's enabled */ required_device m_mastercpu; /* this is the maincpu */ required_device m_slavecpu; /* this is the audiocpu */ diff --git a/src/mame/audio/targ.cpp b/src/mame/audio/targ.cpp index 8c3fed212f0..2b3437053f9 100644 --- a/src/mame/audio/targ.cpp +++ b/src/mame/audio/targ.cpp @@ -22,7 +22,7 @@ #define SPECTAR_MAXFREQ 525000 #define TARG_MAXFREQ 125000 -static const INT16 sine_wave[32] = +static const int16_t sine_wave[32] = { 0x0f0f, 0x0f0f, 0x0f0f, 0x0606, 0x0606, 0x0909, 0x0909, 0x0606, 0x0606, 0x0909, 0x0606, 0x0d0d, 0x0f0f, 0x0f0f, 0x0d0d, 0x0000, -0x191a, -0x2122, -0x1e1f, -0x191a, -0x1314, -0x191a, -0x1819, -0x1819, -0x1819, -0x1314, -0x1314, -0x1314, -0x1819, -0x1e1f, -0x1e1f, -0x1819 @@ -34,7 +34,7 @@ static const INT16 sine_wave[32] = #define FALLING_EDGE(bit) (!(data & bit) && (m_port_1_last & bit)) -void exidy_state::adjust_sample(UINT8 freq) +void exidy_state::adjust_sample(uint8_t freq) { m_tone_freq = freq; @@ -107,7 +107,7 @@ WRITE8_MEMBER( exidy_state::targ_audio_2_w ) { if ((data & 0x01) && !(m_port_2_last & 0x01)) { - UINT8 *prom = memregion("targ")->base(); + uint8_t *prom = memregion("targ")->base(); m_tone_pointer = (m_tone_pointer + 1) & 0x0f; diff --git a/src/mame/audio/tiamc1.cpp b/src/mame/audio/tiamc1.cpp index 9c896429fcd..70d8f7b6c95 100644 --- a/src/mame/audio/tiamc1.cpp +++ b/src/mame/audio/tiamc1.cpp @@ -57,7 +57,7 @@ const device_type TIAMC1 = &device_creator; // tiamc1_sound_device - constructor //------------------------------------------------- -tiamc1_sound_device::tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tiamc1_sound_device::tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TIAMC1, "TIA-MC1 Audio Custom", tag, owner, clock, "tiamc1_sound", __FILE__), device_sound_interface(mconfig, *this), m_channel(nullptr), @@ -194,7 +194,7 @@ void tiamc1_sound_device::timer8253_tick(struct timer8253struct *t, int chn) -void tiamc1_sound_device::timer8253_wr(struct timer8253struct *t, int reg, UINT8 val) +void tiamc1_sound_device::timer8253_wr(struct timer8253struct *t, int reg, uint8_t val) { int chn; @@ -307,7 +307,7 @@ void tiamc1_sound_device::timer8253_wr(struct timer8253struct *t, int reg, UINT8 } } -void tiamc1_sound_device::timer8253_set_gate(struct timer8253struct *t, int chn, UINT8 gate) +void tiamc1_sound_device::timer8253_set_gate(struct timer8253struct *t, int chn, uint8_t gate) { t->channel[chn].gate = gate; } diff --git a/src/mame/audio/timeplt.cpp b/src/mame/audio/timeplt.cpp index fed195048f6..0fab5956c3c 100644 --- a/src/mame/audio/timeplt.cpp +++ b/src/mame/audio/timeplt.cpp @@ -22,7 +22,7 @@ const device_type TIMEPLT_AUDIO = &device_creator; -timeplt_audio_device::timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +timeplt_audio_device::timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TIMEPLT_AUDIO, "Time Pilot Audio", tag, owner, clock, "timeplt_audio", __FILE__), device_sound_interface(mconfig, *this), m_last_irq_state(0) diff --git a/src/mame/audio/timeplt.h b/src/mame/audio/timeplt.h index ec58d71bbf3..c72c3f8755a 100644 --- a/src/mame/audio/timeplt.h +++ b/src/mame/audio/timeplt.h @@ -8,7 +8,7 @@ class timeplt_audio_device : public device_t, public device_sound_interface { public: - timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~timeplt_audio_device() {} DECLARE_WRITE8_MEMBER( sh_irqtrigger_w ); @@ -25,7 +25,7 @@ protected: private: // internal state - UINT8 m_last_irq_state; + uint8_t m_last_irq_state; cpu_device *m_soundcpu; device_t *m_filter_0_0; diff --git a/src/mame/audio/trackfld.cpp b/src/mame/audio/trackfld.cpp index 6f78f861712..69011f75a83 100644 --- a/src/mame/audio/trackfld.cpp +++ b/src/mame/audio/trackfld.cpp @@ -13,7 +13,7 @@ const device_type TRACKFLD_AUDIO = &device_creator; -trackfld_audio_device::trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +trackfld_audio_device::trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TRACKFLD_AUDIO, "Track And Field Audio", tag, owner, clock, "trackfld_audio", __FILE__), device_sound_interface(mconfig, *this), m_last_addr(0), @@ -68,7 +68,7 @@ void trackfld_audio_device::device_reset() READ8_MEMBER( trackfld_audio_device::trackfld_sh_timer_r ) { - UINT32 clock = space.machine().device("audiocpu")->total_cycles() / TIMER_RATE; + uint32_t clock = space.machine().device("audiocpu")->total_cycles() / TIMER_RATE; return clock & 0xF; } @@ -99,7 +99,7 @@ WRITE8_MEMBER( trackfld_audio_device::trackfld_sound_w ) READ8_MEMBER( trackfld_audio_device::hyperspt_sh_timer_r ) { - UINT32 clock = m_audiocpu->total_cycles() / TIMER_RATE; + uint32_t clock = m_audiocpu->total_cycles() / TIMER_RATE; if (m_vlm != nullptr) return (clock & 0x3) | (m_vlm->bsy() ? 0x04 : 0); diff --git a/src/mame/audio/trackfld.h b/src/mame/audio/trackfld.h index e1cf446f6a8..54f0238117e 100644 --- a/src/mame/audio/trackfld.h +++ b/src/mame/audio/trackfld.h @@ -7,7 +7,7 @@ class trackfld_audio_device : public device_t, public device_sound_interface { public: - trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~trackfld_audio_device() {} DECLARE_WRITE8_MEMBER(konami_sh_irqtrigger_w ); diff --git a/src/mame/audio/turbo.cpp b/src/mame/audio/turbo.cpp index 4cbb79b78a8..47ad4406219 100644 --- a/src/mame/audio/turbo.cpp +++ b/src/mame/audio/turbo.cpp @@ -76,7 +76,7 @@ WRITE8_MEMBER(turbo_state::turbo_sound_a_w) #if (!DISCRETE_TEST) #endif #if (!DISCRETE_TEST) - UINT8 diff = data ^ m_sound_state[0]; + uint8_t diff = data ^ m_sound_state[0]; #endif m_sound_state[0] = data; @@ -124,7 +124,7 @@ WRITE8_MEMBER(turbo_state::turbo_sound_a_w) WRITE8_MEMBER(turbo_state::turbo_sound_b_w) { - UINT8 diff = data ^ m_sound_state[1]; + uint8_t diff = data ^ m_sound_state[1]; m_sound_state[1] = data; /* ACC0-ACC5 */ @@ -294,7 +294,7 @@ WRITE8_MEMBER(turbo_state::subroc3d_sound_a_w) } -inline void turbo_state::subroc3d_update_volume(int leftchan, UINT8 dis, UINT8 dir) +inline void turbo_state::subroc3d_update_volume(int leftchan, uint8_t dis, uint8_t dir) { float volume = (float)(15 - dis) / 16.0f; float lvol, rvol; @@ -316,7 +316,7 @@ inline void turbo_state::subroc3d_update_volume(int leftchan, UINT8 dis, UINT8 d WRITE8_MEMBER(turbo_state::subroc3d_sound_b_w) { - UINT8 diff = data ^ m_sound_state[1]; + uint8_t diff = data ^ m_sound_state[1]; m_sound_state[1] = data; /* bit 0 latches direction/volume for missile */ @@ -370,7 +370,7 @@ WRITE8_MEMBER(turbo_state::subroc3d_sound_b_w) WRITE8_MEMBER(turbo_state::subroc3d_sound_c_w) { - UINT8 diff = data ^ m_sound_state[2]; + uint8_t diff = data ^ m_sound_state[2]; m_sound_state[2] = data; /* /FIRE TRIG */ @@ -486,7 +486,7 @@ void turbo_state::buckrog_update_samples() WRITE8_MEMBER(turbo_state::buckrog_sound_a_w) { - UINT8 diff = data ^ m_sound_state[0]; + uint8_t diff = data ^ m_sound_state[0]; m_sound_state[0] = data; /* clock HIT DIS from bits 0-2 */ @@ -510,7 +510,7 @@ WRITE8_MEMBER(turbo_state::buckrog_sound_a_w) WRITE8_MEMBER(turbo_state::buckrog_sound_b_w) { - UINT8 diff = data ^ m_sound_state[1]; + uint8_t diff = data ^ m_sound_state[1]; m_sound_state[1] = data; /* /ALARM3: channel 0 */ diff --git a/src/mame/audio/turrett.cpp b/src/mame/audio/turrett.cpp index bb1fee907b4..22f2558a9aa 100644 --- a/src/mame/audio/turrett.cpp +++ b/src/mame/audio/turrett.cpp @@ -15,7 +15,7 @@ // turrett_device - constructor //------------------------------------------------- -turrett_device::turrett_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +turrett_device::turrett_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TURRETT, "Turret Tower Sound", tag, owner, clock, "ttsnd", __FILE__), device_sound_interface(mconfig, *this), device_memory_interface(mconfig, *this), @@ -91,21 +91,21 @@ void turrett_device::sound_stream_update(sound_stream &stream, stream_sample_t * if (m_channels[ch].m_playing) { - UINT32 &addr = m_channels[ch].m_address; - INT32 lvol = (m_channels[ch].m_volume >> 16) & 0xff; - INT32 rvol = m_channels[ch].m_volume & 0xff; + uint32_t &addr = m_channels[ch].m_address; + int32_t lvol = (m_channels[ch].m_volume >> 16) & 0xff; + int32_t rvol = m_channels[ch].m_volume & 0xff; lvol = m_volume_table[lvol]; rvol = m_volume_table[rvol]; // Channels 30 and 31 expect interleaved stereo samples - UINT32 incr = (ch >= 30) ? 2 : 1; + uint32_t incr = (ch >= 30) ? 2 : 1; for (int s = 0; s < samples; ++s) { - INT16 sample = m_direct->read_word(addr << 1); + int16_t sample = m_direct->read_word(addr << 1); - if ((UINT16)sample == 0x8000) + if ((uint16_t)sample == 0x8000) { m_channels[ch].m_playing = false; break; diff --git a/src/mame/audio/tvc.cpp b/src/mame/audio/tvc.cpp index 4e8d71d6de5..5212c176c76 100644 --- a/src/mame/audio/tvc.cpp +++ b/src/mame/audio/tvc.cpp @@ -16,7 +16,7 @@ const device_type TVC_SOUND = &device_creator; // tvc_sound_device - constructor //------------------------------------------------- -tvc_sound_device::tvc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +tvc_sound_device::tvc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TVC_SOUND, "TVC 64 Audio Custom", tag, owner, clock, "tvc_sound", __FILE__), device_sound_interface(mconfig, *this), m_write_sndint(*this) @@ -106,7 +106,7 @@ WRITE8_MEMBER(tvc_sound_device::write) case 0: { - UINT16 pitch = (m_ports[0] | (m_ports[1]<<8)) & 0x0fff; + uint16_t pitch = (m_ports[0] | (m_ports[1]<<8)) & 0x0fff; m_freq = (pitch == 0x0fff) ? 0 : (int)(195312.5 / (4096 - pitch)); if ((m_ports[1] & 0x20) && m_freq != 0) diff --git a/src/mame/audio/tvc.h b/src/mame/audio/tvc.h index 1103a9c116c..00fb29e899e 100644 --- a/src/mame/audio/tvc.h +++ b/src/mame/audio/tvc.h @@ -25,7 +25,7 @@ class tvc_sound_device : public device_t, { public: // construction/destruction - tvc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tvc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template static devcb_base &set_sndint_wr_callback(device_t &device, _Object object) { return downcast(device).m_write_sndint.set_callback(object); } @@ -48,7 +48,7 @@ private: int m_volume; int m_incr; int m_signal; - UINT8 m_ports[3]; + uint8_t m_ports[3]; emu_timer * m_sndint_timer; devcb_write_line m_write_sndint; }; diff --git a/src/mame/audio/tx1.cpp b/src/mame/audio/tx1.cpp index 93de637e22d..86c8de9acf5 100644 --- a/src/mame/audio/tx1.cpp +++ b/src/mame/audio/tx1.cpp @@ -53,13 +53,13 @@ static const double tx1_engine_gains[16] = const device_type TX1 = &device_creator; -tx1_sound_device::tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tx1_sound_device::tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TX1, "TX-1 Audio Custom", tag, owner, clock, "tx1_sound", __FILE__), device_sound_interface(mconfig, *this) { } -tx1_sound_device::tx1_sound_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) +tx1_sound_device::tx1_sound_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_sound_interface(mconfig, *this), m_stream(nullptr), @@ -251,7 +251,7 @@ static inline void update_engine(int eng[4]) void tx1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - UINT32 step_0, step_1, step_2; + uint32_t step_0, step_1, step_2; double /*gain_0, gain_1,*/ gain_2, gain_3; stream_sample_t *fl = &outputs[0][0]; @@ -346,7 +346,7 @@ static const double bb_engine_gains[16] = const device_type BUGGYBOY = &device_creator; -buggyboy_sound_device::buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +buggyboy_sound_device::buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : tx1_sound_device(mconfig, BUGGYBOY, "Buggy Boy Audio Custom", tag, owner, clock, "buggyboy_sound", __FILE__) { } @@ -499,7 +499,7 @@ void buggyboy_sound_device::sound_stream_update(sound_stream &stream, stream_sam { /* This is admittedly a bit of a hack job... */ - UINT32 step_0, step_1; + uint32_t step_0, step_1; int n1_en, n2_en; double gain0, gain1_l, gain1_r; diff --git a/src/mame/audio/vboy.cpp b/src/mame/audio/vboy.cpp index f8c21cee315..7bf9f28d4e8 100644 --- a/src/mame/audio/vboy.cpp +++ b/src/mame/audio/vboy.cpp @@ -34,7 +34,7 @@ const device_type VBOYSND = &device_creator; #define S5SWP 0x51c #define SST0P 0x580 -static const UINT16 outTbl[64][32] = { +static const uint16_t outTbl[64][32] = { { 0x0000, 0xffe0, 0xffc0, 0xffa0, 0xff80, 0xff60, 0xff40, 0xff20, 0xff00, 0xfee0, 0xfec0, 0xfea0, 0xfe80, 0xfe60, 0xfe40, 0xfe20, 0xfe00, 0xfde0, 0xfdc0, 0xfda0, 0xfd80, 0xfd60, 0xfd40, 0xfd20, 0xfd00, 0xfce0, 0xfcc0, 0xfca0, 0xfc80, 0xfc60, 0xfc40, 0xfc20}, { 0x0000, 0xffe1, 0xffc2, 0xffa3, 0xff84, 0xff65, 0xff46, 0xff27, 0xff08, 0xfee9, 0xfeca, 0xfeab, 0xfe8c, 0xfe6d, 0xfe4e, 0xfe2f, @@ -165,7 +165,7 @@ static const UINT16 outTbl[64][32] = { 0x01f0, 0x020f, 0x022e, 0x024d, 0x026c, 0x028b, 0x02aa, 0x02c9, 0x02e8, 0x0307, 0x0326, 0x0345, 0x0364, 0x0383, 0x03a2, 0x03c1} }; -static const INT8 outLvlTbl[16][16] = { +static const int8_t outLvlTbl[16][16] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2}, { 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4}, @@ -184,8 +184,8 @@ static const INT8 outLvlTbl[16][16] = { { 0, 2, 4, 6, 8, 10, 12, 14, 16, 17, 19, 21, 23, 25, 27, 29} }; -static inline UINT8 mgetb(register UINT8 *ptr) { return *ptr; } -static inline void mputb(UINT8 *ptr, INT8 data) { *ptr = data; } +static inline uint8_t mgetb(register uint8_t *ptr) { return *ptr; } +static inline void mputb(uint8_t *ptr, int8_t data) { *ptr = data; } //************************************************************************** // LIVE DEVICE @@ -195,7 +195,7 @@ static inline void mputb(UINT8 *ptr, INT8 data) { *ptr = data; } // vboysnd_device - constructor //------------------------------------------------- -vboysnd_device::vboysnd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vboysnd_device::vboysnd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VBOYSND, "Virtual Boy audio", tag, owner, clock, "vboysnd", __FILE__), device_sound_interface(mconfig, *this) { @@ -282,8 +282,8 @@ void vboysnd_device::sound_stream_update(sound_stream &stream, stream_sample_t * size = (float)snd_channel[channel].sample_len / 32.0f; for (j=0; j<32;) { - INT8 byte = mgetb(m_aram + waveAddr + (j++ << 2)) & 0x3f; -// INT8 nbyte = mgetb(m_aram + waveAddr + (j << 2)) & 0x3f; + int8_t byte = mgetb(m_aram + waveAddr + (j++ << 2)) & 0x3f; +// int8_t nbyte = mgetb(m_aram + waveAddr + (j << 2)) & 0x3f; int end = (int)(((float)j)*size); float val, add; @@ -293,25 +293,25 @@ void vboysnd_device::sound_stream_update(sound_stream &stream, stream_sample_t * for (; kplaying) @@ -319,12 +319,12 @@ void vboysnd_device::sound_stream_update(sound_stream &stream, stream_sample_t * outLeft = outLvlTbl[channel->volLeft][channel->envelope]; outRight = outLvlTbl[channel->volRight][channel->envelope]; -// env1 = ((UINT8)mgetb(m_aram+SxEV1b+i*0x40)); +// env1 = ((uint8_t)mgetb(m_aram+SxEV1b+i*0x40)); if (channel->env1 & 0x01) { channel->env_time++; -// env0 = ((UINT8)mgetb(m_aram+SxEV0b+i*0x40)); +// env0 = ((uint8_t)mgetb(m_aram+SxEV0b+i*0x40)); if (channel->env_time >= channel->env_steptime /*waveEnv2LenTbl[env0 & 0x7]*/) { // it's time for a step @@ -352,7 +352,7 @@ void vboysnd_device::sound_stream_update(sound_stream &stream, stream_sample_t * } } - outTblPtr = (INT16 *) outTbl[channel->sample[channel->offset]]; + outTblPtr = (int16_t *) outTbl[channel->sample[channel->offset]]; if (outLeft) note_left += outTblPtr[outLeft ]; if (outRight) note_right += outTblPtr[outRight]; channel->offset++; @@ -377,8 +377,8 @@ void vboysnd_device::sound_stream_update(sound_stream &stream, stream_sample_t * if (note_right < -32767) note_right = -32767; if (note_right > 32767) note_right = 32767; - *(outL++) = ((INT16)note_left); - *(outR++) = ((INT16)note_right); + *(outL++) = ((int16_t)note_left); + *(outR++) = ((int16_t)note_right); } } @@ -403,7 +403,7 @@ WRITE8_MEMBER( vboysnd_device::write ) int volReg, intervalReg; int channel, ouroffs; - mputb((UINT8 *)m_aram+offset, data); + mputb((uint8_t *)m_aram+offset, data); if (offset < 0x400) return; @@ -430,15 +430,15 @@ WRITE8_MEMBER( vboysnd_device::write ) volReg = mgetb(m_aram + SxLRVb + i); // 6-4-4 - L/R output level setting if (snd_channel[channel].playing) { - snd_channel[channel].volLeft = ((UINT8)volReg) >> 4; - snd_channel[channel].volRight = ((UINT8)volReg) & 0xf; + snd_channel[channel].volLeft = ((uint8_t)volReg) >> 4; + snd_channel[channel].volRight = ((uint8_t)volReg) & 0xf; break; } } case SxINT: if (channel < 5) { - UINT8 env0, env1; + uint8_t env0, env1; // find out if the sound is playing intervalReg = mgetb(m_aram + SxINTb + i); // 6-4-6 - Sound Interval volReg = mgetb(m_aram + SxLRVb + i); // 6-4-4 - L/R output level setting @@ -459,14 +459,14 @@ WRITE8_MEMBER( vboysnd_device::write ) env0 = mgetb(m_aram+SxEV0b+i); env1 = mgetb(m_aram+SxEV1b+i); snd_channel[channel].env0 = env0; snd_channel[channel].env1 = env1; - snd_channel[channel].volLeft = ((UINT8)volReg) >> 4; - snd_channel[channel].volRight = ((UINT8)volReg) & 0xf; + snd_channel[channel].volLeft = ((uint8_t)volReg) >> 4; + snd_channel[channel].volRight = ((uint8_t)volReg) & 0xf; snd_channel[channel].env_steptime = (env1 & 0x1) ? waveEnv2LenTbl[env0 & 0x7] : 0; snd_channel[channel].sample_len = waveFreq2LenTbl[freq]; snd_channel[channel].offset = 0; snd_channel[channel].time = (intervalReg & 0x20) ? waveTimer2LenTbl[intervalReg & 0x1f] : 0; - snd_channel[channel].envelope = ((UINT8)mgetb(m_aram+SxEV0b+i)) >> 4; + snd_channel[channel].envelope = ((uint8_t)mgetb(m_aram+SxEV0b+i)) >> 4; snd_channel[channel].env_time = 0; } else @@ -487,7 +487,7 @@ WRITE8_MEMBER( vboysnd_device::write ) case SxEV0: if (channel < 5) if (snd_channel[channel].playing) - snd_channel[channel].envelope = ((UINT8)mgetb(m_aram+SxEV0b+i)) >> 4; + snd_channel[channel].envelope = ((uint8_t)mgetb(m_aram+SxEV0b+i)) >> 4; break; } } diff --git a/src/mame/audio/vboy.h b/src/mame/audio/vboy.h index f3d85d60c6f..fce19d5b5b4 100644 --- a/src/mame/audio/vboy.h +++ b/src/mame/audio/vboy.h @@ -34,32 +34,32 @@ //************************************************************************** struct s_snd_channel { - INT8 playing; // the sound is playing + int8_t playing; // the sound is playing // state when sound was enabled - UINT32 env_steptime; // Envelope step time - UINT8 env0; // Envelope data - UINT8 env1; // Envelope data - UINT8 volLeft; // Left output volume - UINT8 volRight; // Right output volume - UINT8 sample[580]; // sample to play + uint32_t env_steptime; // Envelope step time + uint8_t env0; // Envelope data + uint8_t env1; // Envelope data + uint8_t volLeft; // Left output volume + uint8_t volRight; // Right output volume + uint8_t sample[580]; // sample to play int sample_len; // length of sample // values that change, as the sample is played int offset; // current offset in sample int time; // the duration that this sample is to be played - UINT8 envelope; // Current envelope level (604) + uint8_t envelope; // Current envelope level (604) int env_time; // The duration between envelope decay/grow (608) }; struct s_regchan { - INT32 sINT; - INT32 sLRV; - INT32 sFQL; - INT32 sFQH; - INT32 sEV0; - INT32 sEV1; - INT32 sRAM; + int32_t sINT; + int32_t sLRV; + int32_t sFQL; + int32_t sFQH; + int32_t sEV0; + int32_t sEV1; + int32_t sRAM; }; struct s_sreg { @@ -73,7 +73,7 @@ class vboysnd_device : public device_t, public device_sound_interface { public: // construction/destruction - vboysnd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vboysnd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); @@ -90,13 +90,13 @@ protected: s_snd_channel snd_channel[5]; - UINT16 waveFreq2LenTbl[2048]; - UINT16 waveTimer2LenTbl[32]; - UINT16 waveEnv2LenTbl[8]; + uint16_t waveFreq2LenTbl[2048]; + uint16_t waveTimer2LenTbl[32]; + uint16_t waveEnv2LenTbl[8]; emu_timer *m_timer; - UINT8 m_aram[0x600]; + uint8_t m_aram[0x600]; }; // device type definition diff --git a/src/mame/audio/vc4000.cpp b/src/mame/audio/vc4000.cpp index cbc09c1a909..08f9a9a0e94 100644 --- a/src/mame/audio/vc4000.cpp +++ b/src/mame/audio/vc4000.cpp @@ -12,7 +12,7 @@ const device_type VC4000_SND = &device_creator; -vc4000_sound_device::vc4000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vc4000_sound_device::vc4000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VC4000_SND, "Intertion Electronic VC 4000 Audio Custom", tag, owner, clock, "vc4000_sound", __FILE__), device_sound_interface(mconfig, *this), m_channel(nullptr), @@ -20,7 +20,7 @@ vc4000_sound_device::vc4000_sound_device(const machine_config &mconfig, const ch m_pos(0), m_level(0) { - memset(m_reg, 0, sizeof(UINT8)*1); + memset(m_reg, 0, sizeof(uint8_t)*1); } diff --git a/src/mame/audio/vc4000.h b/src/mame/audio/vc4000.h index 67c284f878e..7bcb82825c7 100644 --- a/src/mame/audio/vc4000.h +++ b/src/mame/audio/vc4000.h @@ -21,7 +21,7 @@ class vc4000_sound_device : public device_t, public device_sound_interface { public: - vc4000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vc4000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~vc4000_sound_device() { } protected: @@ -36,7 +36,7 @@ public: private: sound_stream *m_channel; - UINT8 m_reg[1]; + uint8_t m_reg[1]; int m_size; int m_pos; unsigned m_level; diff --git a/src/mame/audio/warpwarp.cpp b/src/mame/audio/warpwarp.cpp index d0c17d54d77..bf9cd9d2d8d 100644 --- a/src/mame/audio/warpwarp.cpp +++ b/src/mame/audio/warpwarp.cpp @@ -18,7 +18,7 @@ const device_type WARPWARP = &device_creator; -warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WARPWARP, "Warp Warp Audio Custom", tag, owner, clock, "warpwarp_sound", __FILE__), device_sound_interface(mconfig, *this), m_decay(nullptr), @@ -48,10 +48,10 @@ warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, cons void warpwarp_sound_device::device_start() { - m_decay = std::make_unique(32768); + m_decay = std::make_unique(32768); for (int i = 0; i < 0x8000; i++) - m_decay[0x7fff - i] = (INT16) (0x7fff/exp(1.0*i/4096)); + m_decay[0x7fff - i] = (int16_t) (0x7fff/exp(1.0*i/4096)); m_channel = machine().sound().stream_alloc(*this, 0, 1, CLOCK_16H); diff --git a/src/mame/audio/warpwarp.h b/src/mame/audio/warpwarp.h index 2dc173ed992..a4e96df0dde 100644 --- a/src/mame/audio/warpwarp.h +++ b/src/mame/audio/warpwarp.h @@ -5,7 +5,7 @@ class warpwarp_sound_device : public device_t, public device_sound_interface { public: - warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); enum { @@ -29,7 +29,7 @@ protected: private: // internal state - std::unique_ptr m_decay; + std::unique_ptr m_decay; sound_stream *m_channel; int m_sound_latch; int m_music1_latch; diff --git a/src/mame/audio/williams.cpp b/src/mame/audio/williams.cpp index f5a5aca24a2..9dc2206340c 100644 --- a/src/mame/audio/williams.cpp +++ b/src/mame/audio/williams.cpp @@ -70,7 +70,7 @@ extern const device_type WILLIAMS_ADPCM_SOUND = &device_creatorbase(); + uint8_t *rom = memregion("cpu")->base(); for (int bank = 0; bank < 16; bank++) { // @@ -304,7 +304,7 @@ void williams_cvsd_sound_device::device_timer(emu_timer &timer, device_timer_id // williams_narc_sound_device - constructor //------------------------------------------------- -williams_narc_sound_device::williams_narc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +williams_narc_sound_device::williams_narc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WILLIAMS_NARC_SOUND, "Williams NARC Sound Board", tag, owner, clock, "wmsnarc", __FILE__), device_mixer_interface(mconfig, *this), m_cpu0(*this, "cpu0"), @@ -586,7 +586,7 @@ machine_config_constructor williams_narc_sound_device::device_mconfig_additions( void williams_narc_sound_device::device_start() { // configure master CPU banks - UINT8 *rom = memregion("cpu0")->base(); + uint8_t *rom = memregion("cpu0")->base(); for (int bank = 0; bank < 16; bank++) { // @@ -677,7 +677,7 @@ void williams_narc_sound_device::device_timer(emu_timer &timer, device_timer_id // williams_adpcm_sound_device - constructor //------------------------------------------------- -williams_adpcm_sound_device::williams_adpcm_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +williams_adpcm_sound_device::williams_adpcm_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WILLIAMS_ADPCM_SOUND, "Williams ADPCM Sound Board", tag, owner, clock, "wmsadpcm", __FILE__), device_mixer_interface(mconfig, *this), m_cpu(*this, "cpu"), @@ -856,7 +856,7 @@ machine_config_constructor williams_adpcm_sound_device::device_mconfig_additions void williams_adpcm_sound_device::device_start() { // configure banks - UINT8 *rom = memregion("cpu")->base(); + uint8_t *rom = memregion("cpu")->base(); membank("rombank")->configure_entries(0, 8, &rom[0x10000], 0x8000); membank("romupper")->set_base(&rom[0x10000 + 0x4000 + 7 * 0x8000]); diff --git a/src/mame/audio/williams.h b/src/mame/audio/williams.h index aa0e8019b0a..7cde77968a9 100644 --- a/src/mame/audio/williams.h +++ b/src/mame/audio/williams.h @@ -38,7 +38,7 @@ class williams_cvsd_sound_device : public device_t, { public: // construction/destruction - williams_cvsd_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + williams_cvsd_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write DECLARE_WRITE16_MEMBER(write); @@ -67,7 +67,7 @@ private: required_device m_hc55516; // internal state - UINT8 m_talkback; + uint8_t m_talkback; }; @@ -78,7 +78,7 @@ class williams_narc_sound_device : public device_t, { public: // construction/destruction - williams_narc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + williams_narc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write DECLARE_READ16_MEMBER(read); @@ -121,11 +121,11 @@ private: required_device m_hc55516; // internal state - UINT8 m_latch; - UINT8 m_latch2; - UINT8 m_talkback; - UINT8 m_audio_sync; - UINT8 m_sound_int_state; + uint8_t m_latch; + uint8_t m_latch2; + uint8_t m_talkback; + uint8_t m_audio_sync; + uint8_t m_sound_int_state; }; @@ -136,7 +136,7 @@ class williams_adpcm_sound_device : public device_t, { public: // construction/destruction - williams_adpcm_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + williams_adpcm_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // read/write DECLARE_WRITE16_MEMBER(write); @@ -169,7 +169,7 @@ private: required_device m_cpu; // internal state - UINT8 m_latch; - UINT8 m_talkback; - UINT8 m_sound_int_state; + uint8_t m_latch; + uint8_t m_talkback; + uint8_t m_sound_int_state; }; diff --git a/src/mame/audio/wiping.cpp b/src/mame/audio/wiping.cpp index 38925e08c37..14ad7398c91 100644 --- a/src/mame/audio/wiping.cpp +++ b/src/mame/audio/wiping.cpp @@ -16,7 +16,7 @@ static const int defgain = 48; const device_type WIPING = &device_creator; -wiping_sound_device::wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +wiping_sound_device::wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WIPING, "Wiping Audio Custom", tag, owner, clock, "wiping_sound", __FILE__), device_sound_interface(mconfig, *this), m_last_channel(nullptr), @@ -31,7 +31,7 @@ wiping_sound_device::wiping_sound_device(const machine_config &mconfig, const ch m_mixer_buffer_2(nullptr) { memset(m_channel_list, 0, sizeof(wp_sound_channel)*MAX_VOICES); - memset(m_soundregs, 0, sizeof(UINT8)*0x4000); + memset(m_soundregs, 0, sizeof(uint8_t)*0x4000); } @@ -91,7 +91,7 @@ void wiping_sound_device::make_mixer_table(int voices, int gain) int i; /* allocate memory */ - m_mixer_table = make_unique_clear(256 * voices); + m_mixer_table = make_unique_clear(256 * voices); /* find the middle of the table */ m_mixer_lookup = m_mixer_table.get() + (128 * voices); @@ -185,7 +185,7 @@ void wiping_sound_device::sound_stream_update(sound_stream &stream, stream_sampl /* only update if we have non-zero volume and frequency */ if (v && f) { - const UINT8 *w = voice->wave; + const uint8_t *w = voice->wave; int c = voice->counter; mix = m_mixer_buffer.get(); diff --git a/src/mame/audio/wiping.h b/src/mame/audio/wiping.h index f891ae8f5d8..5c9df701148 100644 --- a/src/mame/audio/wiping.h +++ b/src/mame/audio/wiping.h @@ -9,7 +9,7 @@ struct wp_sound_channel int frequency; int counter; int volume; - const UINT8 *wave; + const uint8_t *wave; int oneshot; int oneshotplaying; }; @@ -18,7 +18,7 @@ class wiping_sound_device : public device_t, public device_sound_interface { public: - wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~wiping_sound_device() {} DECLARE_WRITE8_MEMBER( sound_w ); @@ -38,19 +38,19 @@ private: wp_sound_channel *m_last_channel; /* global sound parameters */ - const UINT8 *m_sound_prom; - const UINT8 *m_sound_rom; + const uint8_t *m_sound_prom; + const uint8_t *m_sound_rom; int m_num_voices; int m_sound_enable; sound_stream *m_stream; /* mixer tables and internal buffers */ - std::unique_ptr m_mixer_table; - INT16 *m_mixer_lookup; + std::unique_ptr m_mixer_table; + int16_t *m_mixer_lookup; std::unique_ptr m_mixer_buffer; std::unique_ptr m_mixer_buffer_2; - UINT8 m_soundregs[0x4000]; + uint8_t m_soundregs[0x4000]; void make_mixer_table(int voices, int gain); }; diff --git a/src/mame/audio/wow.cpp b/src/mame/audio/wow.cpp index 423e8630bb2..e09cd7b57de 100644 --- a/src/mame/audio/wow.cpp +++ b/src/mame/audio/wow.cpp @@ -103,7 +103,7 @@ const char *const wow_sample_names[] = READ8_MEMBER( astrocde_state::wow_speech_r ) { - UINT8 data = offset >> 8; + uint8_t data = offset >> 8; #if USE_FAKE_VOTRAX int Phoneme/*, Intonation*/; int i = 0; diff --git a/src/mame/audio/wpcsnd.cpp b/src/mame/audio/wpcsnd.cpp index bdd5613b707..f903e93199a 100644 --- a/src/mame/audio/wpcsnd.cpp +++ b/src/mame/audio/wpcsnd.cpp @@ -15,7 +15,7 @@ const device_type WPCSND = &device_creator; -wpcsnd_device::wpcsnd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +wpcsnd_device::wpcsnd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig,WPCSND,"Williams WPC Sound",tag,owner,clock, "wpcsnd", __FILE__), device_mixer_interface(mconfig, *this), m_cpu(*this, "bgcpu"), @@ -42,23 +42,23 @@ static ADDRESS_MAP_START( wpcsnd_map, AS_PROGRAM, 8, wpcsnd_device ) AM_RANGE(0xc000, 0xffff) AM_ROMBANK("fixed") ADDRESS_MAP_END -void wpcsnd_device::ctrl_w(UINT8 data) +void wpcsnd_device::ctrl_w(uint8_t data) { m_cpu->set_input_line(INPUT_LINE_RESET,PULSE_LINE); } -void wpcsnd_device::data_w(UINT8 data) +void wpcsnd_device::data_w(uint8_t data) { m_latch = data; m_cpu->set_input_line(M6809_IRQ_LINE,ASSERT_LINE); } -UINT8 wpcsnd_device::ctrl_r() +uint8_t wpcsnd_device::ctrl_r() { return (m_reply_available) ? 0x01 : 0x00; } -UINT8 wpcsnd_device::data_r() +uint8_t wpcsnd_device::data_r() { m_reply_available = false; m_reply_cb(m_cpu->space(AS_PROGRAM),0); @@ -95,7 +95,7 @@ void wpcsnd_device::device_start() void wpcsnd_device::device_reset() { - UINT8* ROM = m_rom->base(); + uint8_t* ROM = m_rom->base(); m_cpubank->configure_entries(0, 0x80, &ROM[0], 0x8000); m_cpubank->set_entry(0); m_fixedbank->configure_entries(0, 1, &ROM[0x17c000], 0x4000); @@ -132,7 +132,7 @@ WRITE8_MEMBER( wpcsnd_device::bg_speech_digit_w ) WRITE8_MEMBER( wpcsnd_device::rombank_w ) { - UINT8 bank = data & 0x0f; + uint8_t bank = data & 0x0f; switch((~data) & 0xe0) { diff --git a/src/mame/audio/wpcsnd.h b/src/mame/audio/wpcsnd.h index badaaef58e7..2fd33d03d1f 100644 --- a/src/mame/audio/wpcsnd.h +++ b/src/mame/audio/wpcsnd.h @@ -27,7 +27,7 @@ class wpcsnd_device : public device_t, { public: // construction/destruction - wpcsnd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wpcsnd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_cpu; required_device m_ym2151; @@ -44,10 +44,10 @@ public: DECLARE_WRITE8_MEMBER(latch_w); DECLARE_WRITE8_MEMBER(volume_w); - void ctrl_w(UINT8 data); - void data_w(UINT8 data); - UINT8 ctrl_r(); - UINT8 data_r(); + void ctrl_w(uint8_t data); + void data_w(uint8_t data); + uint8_t ctrl_r(); + uint8_t data_r(); static void static_set_romregion(device_t &device, const char *tag); @@ -61,8 +61,8 @@ protected: virtual machine_config_constructor device_mconfig_additions() const override; private: - UINT8 m_latch; - UINT8 m_reply; + uint8_t m_latch; + uint8_t m_reply; bool m_reply_available; // callback diff --git a/src/mame/audio/wswan.cpp b/src/mame/audio/wswan.cpp index 1eb25d0d55d..377b4a5e19d 100644 --- a/src/mame/audio/wswan.cpp +++ b/src/mame/audio/wswan.cpp @@ -28,7 +28,7 @@ const device_type WSWAN_SND = &device_creator; // wswan_sound_device - constructor //------------------------------------------------- -wswan_sound_device::wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +wswan_sound_device::wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, WSWAN_SND, "WonderSwan Audio Custom", tag, owner, clock, "wswan_sound", __FILE__), device_sound_interface(mconfig, *this), m_channel(nullptr), @@ -214,7 +214,7 @@ void wswan_sound_device::sound_stream_update(sound_stream &stream, stream_sample if (m_noise_enable) { - UINT16 new_bit = 0; + uint16_t new_bit = 0; if (m_noise_type == 0) { @@ -254,7 +254,7 @@ void wswan_sound_device::sound_stream_update(sound_stream &stream, stream_sample } -void wswan_sound_device::wswan_ch_set_freq( CHAN *ch, UINT16 freq ) +void wswan_sound_device::wswan_ch_set_freq( CHAN *ch, uint16_t freq ) { freq &= 0x7ff; // docs say freq is 11bits and a few games (Morita Shougi, World Stadium + others) write 0x800 causing a divide by 0 crash ch->freq = freq; @@ -321,7 +321,7 @@ WRITE8_MEMBER( wswan_sound_device::port_w ) break; case 0x8C: /* Sweep step */ - m_sweep_step = (INT8)data; + m_sweep_step = (int8_t)data; break; case 0x8D: /* Sweep time */ diff --git a/src/mame/audio/wswan.h b/src/mame/audio/wswan.h index 90e9c5746f9..c47443ed525 100644 --- a/src/mame/audio/wswan.h +++ b/src/mame/audio/wswan.h @@ -28,13 +28,13 @@ struct CHAN on(0), signal(0) { } - UINT16 freq; /* frequency */ - UINT32 period; /* period */ - UINT32 pos; /* position */ - UINT8 vol_left; /* volume left */ - UINT8 vol_right; /* volume right */ - UINT8 on; /* on/off */ - INT8 signal; /* signal */ + uint16_t freq; /* frequency */ + uint32_t period; /* period */ + uint32_t pos; /* position */ + uint8_t vol_left; /* volume left */ + uint8_t vol_right; /* volume right */ + uint8_t on; /* on/off */ + int8_t signal; /* signal */ }; @@ -44,7 +44,7 @@ class wswan_sound_device : public device_t, public device_sound_interface { public: - wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~wswan_sound_device() { } protected: @@ -59,7 +59,7 @@ public: DECLARE_WRITE8_MEMBER( port_w ); private: - void wswan_ch_set_freq( CHAN *ch, UINT16 freq ); + void wswan_ch_set_freq( CHAN *ch, uint16_t freq ); private: sound_stream *m_channel; @@ -67,23 +67,23 @@ private: CHAN m_audio2; /* Audio channel 2 */ CHAN m_audio3; /* Audio channel 3 */ CHAN m_audio4; /* Audio channel 4 */ - INT8 m_sweep_step; /* Sweep step */ - UINT32 m_sweep_time; /* Sweep time */ - UINT32 m_sweep_count; /* Sweep counter */ - UINT8 m_noise_type; /* Noise generator type */ - UINT8 m_noise_reset; /* Noise reset */ - UINT8 m_noise_enable; /* Noise enable */ - UINT16 m_sample_address; /* Sample address */ - UINT8 m_audio2_voice; /* Audio 2 voice */ - UINT8 m_audio3_sweep; /* Audio 3 sweep */ - UINT8 m_audio4_noise; /* Audio 4 noise */ - UINT8 m_mono; /* mono */ - UINT8 m_voice_data; /* voice data */ - UINT8 m_output_volume; /* output volume */ - UINT8 m_external_stereo; /* external stereo */ - UINT8 m_external_speaker; /* external speaker */ - UINT16 m_noise_shift; /* Noise counter shift register */ - UINT8 m_master_volume; /* Master volume */ + int8_t m_sweep_step; /* Sweep step */ + uint32_t m_sweep_time; /* Sweep time */ + uint32_t m_sweep_count; /* Sweep counter */ + uint8_t m_noise_type; /* Noise generator type */ + uint8_t m_noise_reset; /* Noise reset */ + uint8_t m_noise_enable; /* Noise enable */ + uint16_t m_sample_address; /* Sample address */ + uint8_t m_audio2_voice; /* Audio 2 voice */ + uint8_t m_audio3_sweep; /* Audio 3 sweep */ + uint8_t m_audio4_noise; /* Audio 4 noise */ + uint8_t m_mono; /* mono */ + uint8_t m_voice_data; /* voice data */ + uint8_t m_output_volume; /* output volume */ + uint8_t m_external_stereo; /* external stereo */ + uint8_t m_external_speaker; /* external speaker */ + uint16_t m_noise_shift; /* Noise counter shift register */ + uint8_t m_master_volume; /* Master volume */ }; extern const device_type WSWAN_SND; diff --git a/src/mame/audio/zaccaria.cpp b/src/mame/audio/zaccaria.cpp index afb065e6968..04c06958195 100644 --- a/src/mame/audio/zaccaria.cpp +++ b/src/mame/audio/zaccaria.cpp @@ -242,7 +242,7 @@ zac1b111xx_melody_base::zac1b111xx_melody_base( char const *name, char const *tag, device_t *owner, - UINT32 clock, + uint32_t clock, char const *shortname, char const *source) : device_t(mconfig, devtype, name, tag, owner, clock, shortname, source) @@ -257,8 +257,8 @@ zac1b111xx_melody_base::zac1b111xx_melody_base( READ8_MEMBER(zac1b111xx_melody_base::melodypia_porta_r) { - UINT8 const control = m_melodypia->b_output(); - UINT8 data = 0xff; + uint8_t const control = m_melodypia->b_output(); + uint8_t data = 0xff; if (0x01 == (control & 0x03)) data &= m_melodypsg1->data_r(space, 0); @@ -271,7 +271,7 @@ READ8_MEMBER(zac1b111xx_melody_base::melodypia_porta_r) WRITE8_MEMBER(zac1b111xx_melody_base::melodypia_porta_w) { - UINT8 const control = m_melodypia->b_output(); + uint8_t const control = m_melodypia->b_output(); if (control & 0x02) m_melodypsg1->data_address_w(space, (control >> 0) & 0x01, data); @@ -310,7 +310,7 @@ void zac1b111xx_melody_base::device_reset() // 1B11107-SPECIFIC IMPLEMENTATION //************************************************************************** -zac1b11107_audio_device::zac1b11107_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock) +zac1b11107_audio_device::zac1b11107_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock) : zac1b111xx_melody_base(mconfig, ZACCARIA_1B11107, "Zaccaria 1B11107 Sound Board", tag, owner, clock, "zac1b11107", __FILE__) { } @@ -364,7 +364,7 @@ machine_config_constructor zac1b11107_audio_device::device_mconfig_additions() c // 1B11142-SPECIFIC IMPLEMENTATION //************************************************************************** -zac1b11142_audio_device::zac1b11142_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock) +zac1b11142_audio_device::zac1b11142_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock) : zac1b111xx_melody_base(mconfig, ZACCARIA_1B11142, "Zaccaria 1B11142 Sound Board", tag, owner, clock, "zac1b11142", __FILE__) , m_acs_cb(*this) , m_audiocpu(*this, "audiocpu") diff --git a/src/mame/audio/zaccaria.h b/src/mame/audio/zaccaria.h index 5cab5da41c8..b4557ab96b3 100644 --- a/src/mame/audio/zaccaria.h +++ b/src/mame/audio/zaccaria.h @@ -43,7 +43,7 @@ public: char const *name, char const *tag, device_t *owner, - UINT32 clock, + uint32_t clock, char const *shortname, char const *source); @@ -61,14 +61,14 @@ protected: required_device m_melodypsg1; required_device m_melodypsg2; - UINT8 m_melody_command; + uint8_t m_melody_command; }; class zac1b11107_audio_device : public zac1b111xx_melody_base { public: - zac1b11107_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); + zac1b11107_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); // host interface DECLARE_WRITE8_MEMBER(sound_w); @@ -89,7 +89,7 @@ public: template static devcb_base &static_set_acs_cb(device_t &device, _Object object) { return downcast(device).m_acs_cb.set_callback(object); } - zac1b11142_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); + zac1b11142_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); // host interface DECLARE_WRITE8_MEMBER(hs_w); @@ -123,7 +123,7 @@ protected: required_ioport m_inputs; - UINT8 m_host_command; + uint8_t m_host_command; }; #endif // __AUDIO_ZACCARIA_H__ diff --git a/src/mame/audio/zaxxon.cpp b/src/mame/audio/zaxxon.cpp index 9fc5387f639..0c0d194c877 100644 --- a/src/mame/audio/zaxxon.cpp +++ b/src/mame/audio/zaxxon.cpp @@ -109,7 +109,7 @@ MACHINE_CONFIG_END WRITE8_MEMBER(zaxxon_state::zaxxon_sound_a_w) { - UINT8 diff = data ^ m_sound_state[0]; + uint8_t diff = data ^ m_sound_state[0]; m_sound_state[0] = data; /* PLAYER SHIP A/B: volume */ @@ -143,7 +143,7 @@ WRITE8_MEMBER(zaxxon_state::zaxxon_sound_a_w) WRITE8_MEMBER(zaxxon_state::zaxxon_sound_b_w) { - UINT8 diff = data ^ m_sound_state[1]; + uint8_t diff = data ^ m_sound_state[1]; m_sound_state[1] = data; /* S-EXP: channel 4 */ @@ -159,7 +159,7 @@ WRITE8_MEMBER(zaxxon_state::zaxxon_sound_b_w) WRITE8_MEMBER(zaxxon_state::zaxxon_sound_c_w) { - UINT8 diff = data ^ m_sound_state[2]; + uint8_t diff = data ^ m_sound_state[2]; m_sound_state[2] = data; /* SHOT: channel 7 */ @@ -209,7 +209,7 @@ MACHINE_CONFIG_END WRITE8_MEMBER(zaxxon_state::congo_sound_b_w) { - UINT8 diff = data ^ m_sound_state[1]; + uint8_t diff = data ^ m_sound_state[1]; m_sound_state[1] = data; /* bit 7 = mute */ @@ -221,7 +221,7 @@ WRITE8_MEMBER(zaxxon_state::congo_sound_b_w) WRITE8_MEMBER(zaxxon_state::congo_sound_c_w) { - UINT8 diff = data ^ m_sound_state[2]; + uint8_t diff = data ^ m_sound_state[2]; m_sound_state[2] = data; /* BASS DRUM: channel 1 */ diff --git a/src/mame/drivers/1942.cpp b/src/mame/drivers/1942.cpp index d2b324dfcf5..0d991fd1e1f 100644 --- a/src/mame/drivers/1942.cpp +++ b/src/mame/drivers/1942.cpp @@ -948,7 +948,7 @@ ROM_END DRIVER_INIT_MEMBER(_1942_state,1942) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000); } diff --git a/src/mame/drivers/1943.cpp b/src/mame/drivers/1943.cpp index a7da1cf6d26..a9528c41d2c 100644 --- a/src/mame/drivers/1943.cpp +++ b/src/mame/drivers/1943.cpp @@ -874,7 +874,7 @@ ROM_END DRIVER_INIT_MEMBER(_1943_state,1943) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); } diff --git a/src/mame/drivers/1945kiii.cpp b/src/mame/drivers/1945kiii.cpp index c770592f055..df8eb1b4eef 100644 --- a/src/mame/drivers/1945kiii.cpp +++ b/src/mame/drivers/1945kiii.cpp @@ -69,9 +69,9 @@ public: optional_device m_oki2; required_device m_oki1; /* memory pointers */ - required_shared_ptr m_spriteram_1; - required_shared_ptr m_spriteram_2; - required_shared_ptr m_bgram; + required_shared_ptr m_spriteram_1; + required_shared_ptr m_spriteram_2; + required_shared_ptr m_bgram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -85,7 +85,7 @@ public: virtual void machine_start() override; virtual void video_start() override; void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_k3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_k3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -112,9 +112,9 @@ void k3_state::video_start() void k3_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); - UINT16 *source = m_spriteram_1; - UINT16 *source2 = m_spriteram_2; - UINT16 *finish = source + 0x1000 / 2; + uint16_t *source = m_spriteram_1; + uint16_t *source2 = m_spriteram_2; + uint16_t *finish = source + 0x1000 / 2; while (source < finish) { @@ -134,7 +134,7 @@ void k3_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) } } -UINT32 k3_state::screen_update_k3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t k3_state::screen_update_k3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); diff --git a/src/mame/drivers/24cdjuke.cpp b/src/mame/drivers/24cdjuke.cpp index 7a9e17d325e..eb0a0de1e11 100644 --- a/src/mame/drivers/24cdjuke.cpp +++ b/src/mame/drivers/24cdjuke.cpp @@ -75,7 +75,7 @@ public: required_ioport m_io_row1; required_ioport m_io_row2; required_ioport m_io_row3; - required_region_ptr m_charset; + required_region_ptr m_charset; virtual void machine_start() override; virtual void machine_reset() override; @@ -87,13 +87,13 @@ public: DECLARE_READ8_MEMBER(unknown_r) { return machine().rand(); } private: - UINT8 m_kb_col; + uint8_t m_kb_col; }; READ8_MEMBER(midcoin24cdjuke_state::kb_row_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!(m_kb_col & 0x10)) data &= m_io_row0->read(); @@ -114,7 +114,7 @@ WRITE8_MEMBER(midcoin24cdjuke_state::kb_col_w) WRITE8_MEMBER(midcoin24cdjuke_state::digit_w) { - UINT16 char_data = m_charset[((data & 0x60) << 1) | (data & 0x1f)]; + uint16_t char_data = m_charset[((data & 0x60) << 1) | (data & 0x1f)]; char_data = BITSWAP16(char_data, 13,11,9,15,14,10,12,8,7,6,5,4,3,2,1,0); diff --git a/src/mame/drivers/2mindril.cpp b/src/mame/drivers/2mindril.cpp index d1f27dd46ab..43ed200fb4b 100644 --- a/src/mame/drivers/2mindril.cpp +++ b/src/mame/drivers/2mindril.cpp @@ -48,12 +48,12 @@ public: m_iodata(*this, "iodata") { } /* memory pointers */ - required_shared_ptr m_iodata; + required_shared_ptr m_iodata; /* input-related */ - UINT16 m_defender_sensor; - UINT16 m_shutter_sensor; - UINT16 m_irq_reg; + uint16_t m_defender_sensor; + uint16_t m_shutter_sensor; + uint16_t m_irq_reg; /* devices */ DECLARE_READ16_MEMBER(drill_io_r); @@ -497,9 +497,9 @@ ROM_END void _2mindril_state::tile_decode() { - UINT8 lsb,msb; - UINT32 offset,i; - UINT8 *gfx = memregion("gfx2")->base(); + uint8_t lsb,msb; + uint32_t offset,i; + uint8_t *gfx = memregion("gfx2")->base(); int size=memregion("gfx2")->bytes(); int data; diff --git a/src/mame/drivers/30test.cpp b/src/mame/drivers/30test.cpp index d9291a08dd3..bb82cbba362 100644 --- a/src/mame/drivers/30test.cpp +++ b/src/mame/drivers/30test.cpp @@ -58,8 +58,8 @@ public: m_maincpu(*this, "maincpu"), m_oki(*this, "oki") { } - UINT8 m_mux_data; - UINT8 m_oki_bank; + uint8_t m_mux_data; + uint8_t m_oki_bank; DECLARE_WRITE8_MEMBER(namco_30test_led_w); DECLARE_WRITE8_MEMBER(namco_30test_led_rank_w); DECLARE_WRITE8_MEMBER(namco_30test_lamps_w); @@ -75,7 +75,7 @@ public: }; -static const UINT8 led_map[16] = +static const uint8_t led_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x77,0x7c,0x39,0x5e,0x79,0x00 }; WRITE8_MEMBER(namco_30test_state::namco_30test_led_w) @@ -99,7 +99,7 @@ WRITE8_MEMBER(namco_30test_state::namco_30test_lamps_w) READ8_MEMBER(namco_30test_state::namco_30test_mux_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; switch(m_mux_data) { diff --git a/src/mame/drivers/39in1.cpp b/src/mame/drivers/39in1.cpp index caee40704cd..e85eca6370f 100644 --- a/src/mame/drivers/39in1.cpp +++ b/src/mame/drivers/39in1.cpp @@ -39,11 +39,11 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - UINT32 m_seed; - UINT32 m_magic; - UINT32 m_state; + uint32_t m_seed; + uint32_t m_magic; + uint32_t m_state; - required_shared_ptr m_ram; + required_shared_ptr m_ram; PXA255_DMA_Regs m_dma_regs; PXA255_I2S_Regs m_i2s_regs; @@ -54,13 +54,13 @@ public: dmadac_sound_device *m_dmadac[2]; required_device m_eeprom; - UINT32 m_pxa255_lcd_palette[0x100]; - UINT8 m_pxa255_lcd_framebuffer[0x100000]; + uint32_t m_pxa255_lcd_palette[0x100]; + uint8_t m_pxa255_lcd_framebuffer[0x100000]; //FILE* audio_dump; - UINT32 m_words[0x800]; - INT16 m_samples[0x1000]; + uint32_t m_words[0x800]; + int16_t m_samples[0x1000]; DECLARE_READ32_MEMBER(pxa255_i2s_r); DECLARE_WRITE32_MEMBER(pxa255_i2s_w); DECLARE_READ32_MEMBER(pxa255_dma_r); @@ -79,7 +79,7 @@ public: DECLARE_DRIVER_INIT(39in1); DECLARE_MACHINE_START(60in1); virtual void machine_start() override; - UINT32 screen_update_39in1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_39in1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pxa255_vblank_start); TIMER_CALLBACK_MEMBER(pxa255_dma_dma_end); TIMER_CALLBACK_MEMBER(pxa255_ostimer_match); @@ -88,8 +88,8 @@ public: void pxa255_dma_load_descriptor_and_start(int channel); void pxa255_ostimer_irq_check(); void pxa255_update_interrupts(); - void pxa255_set_irq_line(UINT32 line, int state); - void pxa255_lcd_load_dma_descriptor(address_space & space, UINT32 address, int channel); + void pxa255_set_irq_line(uint32_t line, int state); + void pxa255_lcd_load_dma_descriptor(address_space & space, uint32_t address, int channel); void pxa255_lcd_irq_check(); void pxa255_lcd_dma_kickoff(int channel); void pxa255_lcd_check_load_next_branch(int channel); @@ -302,13 +302,13 @@ void _39in1_state::pxa255_dma_load_descriptor_and_start(int channel) TIMER_CALLBACK_MEMBER(_39in1_state::pxa255_dma_dma_end) { PXA255_DMA_Regs *dma_regs = &m_dma_regs; - UINT32 sadr = dma_regs->dsadr[param]; - UINT32 tadr = dma_regs->dtadr[param]; - UINT32 count = dma_regs->dcmd[param] & 0x00001fff; - UINT32 index = 0; - UINT8 temp8; - UINT16 temp16; - UINT32 temp32; + uint32_t sadr = dma_regs->dsadr[param]; + uint32_t tadr = dma_regs->dtadr[param]; + uint32_t count = dma_regs->dcmd[param] & 0x00001fff; + uint32_t index = 0; + uint8_t temp8; + uint16_t temp16; + uint32_t temp32; address_space &space = m_maincpu->space(AS_PROGRAM); switch(param) @@ -317,8 +317,8 @@ TIMER_CALLBACK_MEMBER(_39in1_state::pxa255_dma_dma_end) for(index = 0; index < count; index += 4) { m_words[index >> 2] = space.read_dword(sadr); - m_samples[(index >> 1) + 0] = (INT16)(m_words[index >> 2] >> 16); - m_samples[(index >> 1) + 1] = (INT16)(m_words[index >> 2] & 0xffff); + m_samples[(index >> 1) + 0] = (int16_t)(m_words[index >> 2] >> 16); + m_samples[(index >> 1) + 1] = (int16_t)(m_words[index >> 2] & 0xffff); sadr += 4; } dmadac_transfer(&m_dmadac[0], 2, 2, 2, count/4, m_samples); @@ -718,7 +718,7 @@ void _39in1_state::pxa255_update_interrupts() m_maincpu->set_input_line(ARM7_IRQ_LINE, intc_regs->icip ? ASSERT_LINE : CLEAR_LINE); } -void _39in1_state::pxa255_set_irq_line(UINT32 line, int irq_state) +void _39in1_state::pxa255_set_irq_line(uint32_t line, int irq_state) { PXA255_INTC_Regs *intc_regs = &m_intc_regs; @@ -1046,7 +1046,7 @@ WRITE32_MEMBER(_39in1_state::pxa255_gpio_w) */ -void _39in1_state::pxa255_lcd_load_dma_descriptor(address_space & space, UINT32 address, int channel) +void _39in1_state::pxa255_lcd_load_dma_descriptor(address_space & space, uint32_t address, int channel) { PXA255_LCD_Regs *lcd_regs = &m_lcd_regs; @@ -1101,7 +1101,7 @@ void _39in1_state::pxa255_lcd_dma_kickoff(int channel) int index = 0; for(index = 0; index < length; index += 2) { - UINT16 color = space.read_word((lcd_regs->dma[channel].fsadr &~ 1) + index); + uint16_t color = space.read_word((lcd_regs->dma[channel].fsadr &~ 1) + index); m_pxa255_lcd_palette[index >> 1] = (((((color >> 11) & 0x1f) << 3) | (color >> 13)) << 16) | (((((color >> 5) & 0x3f) << 2) | ((color >> 9) & 0x3)) << 8) | (((color & 0x1f) << 3) | ((color >> 2) & 0x7)); m_palette->set_pen_color(index >> 1, (((color >> 11) & 0x1f) << 3) | (color >> 13), (((color >> 5) & 0x3f) << 2) | ((color >> 9) & 0x3), ((color & 0x1f) << 3) | ((color >> 2) & 0x7)); } @@ -1386,8 +1386,8 @@ READ32_MEMBER(_39in1_state::cpld_r) } else if (m_state == 2) // 29c0: 53 ac 0c 2b a2 07 e6 be 31 { - UINT32 seed = m_seed; - UINT32 magic = m_magic; + uint32_t seed = m_seed; + uint32_t magic = m_magic; magic = ( (((~(seed >> 16)) ^ (magic >> 1)) & 0x01) | (((~((seed >> 19) << 1)) ^ ((magic >> 5) << 1)) & 0x02) | @@ -1498,14 +1498,14 @@ static INPUT_PORTS_START( 39in1 ) PORT_SERVICE_NO_TOGGLE( 0x80000000, IP_ACTIVE_LOW ) INPUT_PORTS_END -UINT32 _39in1_state::screen_update_39in1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _39in1_state::screen_update_39in1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x = 0; int y = 0; for(y = 0; y <= (m_lcd_regs.lccr2 & PXA255_LCCR2_LPP); y++) { - UINT32 *d = &bitmap.pix32(y); + uint32_t *d = &bitmap.pix32(y); for(x = 0; x <= (m_lcd_regs.lccr1 & PXA255_LCCR1_PPL); x++) { d[x] = m_pxa255_lcd_palette[m_pxa255_lcd_framebuffer[y*((m_lcd_regs.lccr1 & PXA255_LCCR1_PPL) + 1) + x]]; @@ -1543,7 +1543,7 @@ void _39in1_state::pxa255_start() void _39in1_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; for (i = 0; i < 0x80000; i += 2) @@ -1556,7 +1556,7 @@ void _39in1_state::machine_start() MACHINE_START_MEMBER(_39in1_state,60in1) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; for (i = 0; i < 0x80000; i += 2) diff --git a/src/mame/drivers/3x3puzzl.cpp b/src/mame/drivers/3x3puzzl.cpp index bcec09cc938..2417d15debb 100644 --- a/src/mame/drivers/3x3puzzl.cpp +++ b/src/mame/drivers/3x3puzzl.cpp @@ -61,13 +61,13 @@ public: { } /* memory pointers */ - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; - required_shared_ptr m_videoram3; + required_shared_ptr m_videoram1; + required_shared_ptr m_videoram2; + required_shared_ptr m_videoram3; - UINT16 m_videoram1_buffer[0x800/2]; - UINT16 m_videoram2_buffer[0x1000/2]; - UINT16 m_videoram3_buffer[0x1000/2]; + uint16_t m_videoram1_buffer[0x800/2]; + uint16_t m_videoram2_buffer[0x1000/2]; + uint16_t m_videoram3_buffer[0x1000/2]; // devices required_device m_maincpu; @@ -76,7 +76,7 @@ public: required_device m_screen; // screen updates - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); /* video-related */ tilemap_t *m_tilemap1; @@ -88,7 +88,7 @@ public: TILE_GET_INFO_MEMBER(get_tile3_info); int m_oki_bank; - UINT16 m_gfx_control; + uint16_t m_gfx_control; DECLARE_WRITE16_MEMBER(gfx_ctrl_w); DECLARE_WRITE16_MEMBER(tilemap1_scrollx_w); @@ -104,7 +104,7 @@ protected: TILE_GET_INFO_MEMBER(_3x3puzzle_state::get_tile1_info) { - UINT16 code = m_videoram1_buffer[tile_index]; + uint16_t code = m_videoram1_buffer[tile_index]; SET_TILE_INFO_MEMBER(0, code, 0, @@ -113,7 +113,7 @@ TILE_GET_INFO_MEMBER(_3x3puzzle_state::get_tile1_info) TILE_GET_INFO_MEMBER(_3x3puzzle_state::get_tile2_info) { - UINT16 code = m_videoram2_buffer[tile_index]; + uint16_t code = m_videoram2_buffer[tile_index]; SET_TILE_INFO_MEMBER(1, code, 1, @@ -122,7 +122,7 @@ TILE_GET_INFO_MEMBER(_3x3puzzle_state::get_tile2_info) TILE_GET_INFO_MEMBER(_3x3puzzle_state::get_tile3_info) { - UINT16 code = m_videoram3_buffer[tile_index]; + uint16_t code = m_videoram3_buffer[tile_index]; SET_TILE_INFO_MEMBER(2, code, 2, @@ -178,7 +178,7 @@ void _3x3puzzle_state::video_start() m_tilemap3->set_transparent_pen(0); } -UINT32 _3x3puzzle_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t _3x3puzzle_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { m_tilemap1->draw(screen, bitmap, cliprect, 0, 1); m_tilemap2->draw(screen, bitmap, cliprect, 0, 2); diff --git a/src/mame/drivers/4004clk.cpp b/src/mame/drivers/4004clk.cpp index 3408f0eb25e..d383d35df13 100644 --- a/src/mame/drivers/4004clk.cpp +++ b/src/mame/drivers/4004clk.cpp @@ -28,11 +28,11 @@ public: DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( nixie_w ); DECLARE_WRITE8_MEMBER( neon_w ); - UINT16 m_nixie[16]; - UINT8 m_timer; + uint16_t m_nixie[16]; + uint8_t m_timer; virtual void machine_start() override; TIMER_DEVICE_CALLBACK_MEMBER(timer_callback); - UINT8 nixie_to_num(UINT16 val); + uint8_t nixie_to_num(uint16_t val); inline void output_set_nixie_value(int index, int value); inline void output_set_neon_value(int index, int value); }; @@ -42,7 +42,7 @@ READ8_MEMBER(nixieclock_state::data_r) return m_input->read() & 0x0f; } -UINT8 nixieclock_state::nixie_to_num(UINT16 val) +uint8_t nixieclock_state::nixie_to_num(uint16_t val) { if (BIT(val,0)) return 0; if (BIT(val,1)) return 1; diff --git a/src/mame/drivers/40love.cpp b/src/mame/drivers/40love.cpp index a8ef7726dde..226d68cbead 100644 --- a/src/mame/drivers/40love.cpp +++ b/src/mame/drivers/40love.cpp @@ -333,7 +333,7 @@ READ8_MEMBER(fortyl_state::pix2_r) fake MCU (undoukai and field day) ****************************************************************************/ -static const UINT8 mcu_data0[0x80] = +static const uint8_t mcu_data0[0x80] = { 0x0a,0x08,0x0f,0x07,0x06,0x05,0x04,0x00, 0x0a,0x0b,0x15,0x02,0x03,0x15,0x0a,0x08, @@ -354,7 +354,7 @@ static const UINT8 mcu_data0[0x80] = 0x23,0xc5,0xc9,0xee,0x37,0x28,0xc0,0xc5 }; -static const UINT8 mcu_data1[0x80] = +static const uint8_t mcu_data1[0x80] = { 0x00,0x78,0xef,0x66,0xdc,0x50,0xc2,0x33, 0xa1,0x0c,0x74,0xd9,0x3a,0x96,0xef,0x42, @@ -374,7 +374,7 @@ static const UINT8 mcu_data1[0x80] = 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }; -static const UINT8 mcu_data2[0x80] = +static const uint8_t mcu_data2[0x80] = { 0x00,0x04,0x08,0x00,0x11,0x16,0x1a,0x1f, 0x23,0x28,0x2c,0x30,0x35,0x39,0x3d,0x42, @@ -572,7 +572,7 @@ READ8_MEMBER(fortyl_state::undoukai_mcu_status_r) DRIVER_INIT_MEMBER(fortyl_state,undoukai) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000); m_pix_color[0] = 0x000; @@ -583,14 +583,14 @@ DRIVER_INIT_MEMBER(fortyl_state,undoukai) DRIVER_INIT_MEMBER(fortyl_state,40love) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000); #if 0 /* character ROM hack to show a white line on the opponent side */ - UINT8 *ROM = memregion("gfx2")->base(); + uint8_t *ROM = memregion("gfx2")->base(); int adr = 0x10 * 0x022b; ROM[adr + 0x000a] = 0x00; ROM[adr + 0x000b] = 0x00; diff --git a/src/mame/drivers/4dpi.cpp b/src/mame/drivers/4dpi.cpp index cce5bcd8515..1ed49924c8e 100644 --- a/src/mame/drivers/4dpi.cpp +++ b/src/mame/drivers/4dpi.cpp @@ -21,9 +21,9 @@ struct ip6_regs_t { - UINT16 unknown_half_0; - UINT8 unknown_byte_0; - UINT8 unknown_byte_1; + uint16_t unknown_half_0; + uint8_t unknown_byte_0; + uint8_t unknown_byte_1; }; class sgi_ip6_state : public driver_device @@ -44,7 +44,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_sgi_ip6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sgi_ip6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sgi_ip6_vbl); inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); required_device m_maincpu; @@ -78,7 +78,7 @@ void sgi_ip6_state::video_start() { } -UINT32 sgi_ip6_state::screen_update_sgi_ip6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sgi_ip6_state::screen_update_sgi_ip6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } @@ -90,7 +90,7 @@ UINT32 sgi_ip6_state::screen_update_sgi_ip6(screen_device &screen, bitmap_rgb32 READ32_MEMBER(sgi_ip6_state::ip6_unk1_r) { - UINT32 ret = 0; + uint32_t ret = 0; switch(offset) { case 0x0000/4: @@ -134,7 +134,7 @@ WRITE32_MEMBER(sgi_ip6_state::ip6_unk1_w) READ32_MEMBER(sgi_ip6_state::ip6_unk2_r) { - UINT32 ret = 0; + uint32_t ret = 0; switch(offset) { case 0x0000/4: @@ -178,7 +178,7 @@ WRITE32_MEMBER(sgi_ip6_state::ip6_unk2_w) READ32_MEMBER(sgi_ip6_state::ip6_unk3_r) { - UINT32 ret = 0; + uint32_t ret = 0; if(ACCESSING_BITS_16_23) { verboselog(0, "ip6_unk3_r: Unknown Byte 1: %02x & %02x\n", m_ip6_regs.unknown_byte_1, (mem_mask >> 16) & 0x000000ff); diff --git a/src/mame/drivers/4enlinea.cpp b/src/mame/drivers/4enlinea.cpp index d5ebe1b1455..084ca4ba964 100644 --- a/src/mame/drivers/4enlinea.cpp +++ b/src/mame/drivers/4enlinea.cpp @@ -224,9 +224,9 @@ public: INTERRUPT_GEN_MEMBER(_4enlinea_irq); INTERRUPT_GEN_MEMBER(_4enlinea_audio_irq); - UINT8 m_irq_count; - UINT8 m_serial_flags; - UINT8 m_serial_data[2]; + uint8_t m_irq_count; + uint8_t m_serial_flags; + uint8_t m_serial_data[2]; virtual void machine_start() override; virtual void machine_reset() override; @@ -244,7 +244,7 @@ class isa8_cga_4enlinea_device : public isa8_cga_device { public: // construction/destruction - isa8_cga_4enlinea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_cga_4enlinea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER( _4enlinea_io_read ); DECLARE_WRITE8_MEMBER( _4enlinea_mode_control_w ); @@ -259,7 +259,7 @@ const tiny_rom_entry *isa8_cga_4enlinea_device::device_rom_region() const const device_type ISA8_CGA_4ENLINEA = &device_creator; -isa8_cga_4enlinea_device::isa8_cga_4enlinea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_cga_4enlinea_device::isa8_cga_4enlinea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_cga_device( mconfig, ISA8_CGA_4ENLINEA, "ISA8_CGA_4ENLINEA", tag, owner, clock, "4enlinea_cga", __FILE__) { } @@ -267,7 +267,7 @@ isa8_cga_4enlinea_device::isa8_cga_4enlinea_device(const machine_config &mconfig READ8_MEMBER( isa8_cga_4enlinea_device::_4enlinea_io_read ) { - UINT8 data; + uint8_t data; switch (offset) { diff --git a/src/mame/drivers/4enraya.cpp b/src/mame/drivers/4enraya.cpp index c75536306f1..f259e2872aa 100644 --- a/src/mame/drivers/4enraya.cpp +++ b/src/mame/drivers/4enraya.cpp @@ -161,8 +161,8 @@ WRITE8_MEMBER(_4enraya_state::sound_control_w) READ8_MEMBER(_4enraya_state::fenraya_custom_map_r) { - UINT8 prom_routing = (m_prom[offset >> 12] & 0xf) ^ 0xf; - UINT8 res = 0; + uint8_t prom_routing = (m_prom[offset >> 12] & 0xf) ^ 0xf; + uint8_t res = 0; if (prom_routing & 1) // ROM5 { @@ -189,7 +189,7 @@ READ8_MEMBER(_4enraya_state::fenraya_custom_map_r) WRITE8_MEMBER(_4enraya_state::fenraya_custom_map_w) { - UINT8 prom_routing = (m_prom[offset >> 12] & 0xf) ^ 0xf; + uint8_t prom_routing = (m_prom[offset >> 12] & 0xf) ^ 0xf; if (prom_routing & 1) // ROM5 { @@ -516,7 +516,7 @@ ROM_END DRIVER_INIT_MEMBER(_4enraya_state, unkpacg) { // descramble rom - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (int i = 0x8000; i < 0xa000; i++) rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,0,1); } diff --git a/src/mame/drivers/5clown.cpp b/src/mame/drivers/5clown.cpp index ce8820f8c75..c4440d0e9f1 100644 --- a/src/mame/drivers/5clown.cpp +++ b/src/mame/drivers/5clown.cpp @@ -474,13 +474,13 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; - UINT8 m_main_latch_d800; - UINT8 m_snd_latch_0800; - UINT8 m_snd_latch_0a02; - UINT8 m_ay8910_addr; + uint8_t m_main_latch_d800; + uint8_t m_snd_latch_0800; + uint8_t m_snd_latch_0a02; + uint8_t m_ay8910_addr; tilemap_t *m_bg_tilemap; int m_mux_data; @@ -503,7 +503,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(_5clown); - UINT32 screen_update_fclown(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fclown(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; void _5clown_state::machine_start() @@ -562,7 +562,7 @@ void _5clown_state::video_start() } -UINT32 _5clown_state::screen_update_fclown(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t _5clown_state::screen_update_fclown(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -570,7 +570,7 @@ UINT32 _5clown_state::screen_update_fclown(screen_device &screen, bitmap_ind16 & PALETTE_INIT_MEMBER(_5clown_state, _5clown) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); /* 7654 3210 ---- ---x RED component. @@ -1171,7 +1171,7 @@ DRIVER_INIT_MEMBER(_5clown_state,fclown) /* Decrypting main program */ int x; - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); for (x = 0x0000; x < 0x10000; x++) { @@ -1181,8 +1181,8 @@ DRIVER_INIT_MEMBER(_5clown_state,fclown) /* Decrypting GFX by segments */ - UINT8 *gfx1_src = memregion( "gfx1" )->base(); - UINT8 *gfx2_src = memregion( "gfx2" )->base(); + uint8_t *gfx1_src = memregion( "gfx1" )->base(); + uint8_t *gfx2_src = memregion( "gfx2" )->base(); for (x = 0x2000; x < 0x3000; x++) { @@ -1202,7 +1202,7 @@ DRIVER_INIT_MEMBER(_5clown_state,fclown) /* Decrypting sound samples */ - UINT8 *samples_src = memregion( "oki6295" )->base(); + uint8_t *samples_src = memregion( "oki6295" )->base(); for (x = 0x0000; x < 0x10000; x++) { diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp index 2883da6c1a3..ec3e3b00613 100644 --- a/src/mame/drivers/8080bw.cpp +++ b/src/mame/drivers/8080bw.cpp @@ -802,7 +802,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(_8080bw_state, spacecom) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // bad byte: should be push a at RST 10h ROM[0x10] = 0xf5; @@ -818,7 +818,7 @@ DRIVER_INIT_MEMBER(_8080bw_state, spacecom) READ8_MEMBER(_8080bw_state::invrvnge_02_r) { - UINT8 data = ioport("IN2")->read(); + uint8_t data = ioport("IN2")->read(); if (m_flip_screen) return data; return (data & 0x8f) | (ioport("IN1")->read() & 0x70); } @@ -1333,8 +1333,8 @@ INPUT_PORTS_END MACHINE_START_MEMBER(_8080bw_state,rollingc) { - m_scattered_colorram = std::make_unique(0x400); - m_scattered_colorram2 = std::make_unique(0x400); + m_scattered_colorram = std::make_unique(0x400); + m_scattered_colorram2 = std::make_unique(0x400); save_pointer(&m_scattered_colorram[0], "m_scattered_colorram", 0x400); save_pointer(&m_scattered_colorram2[0], "m_scattered_colorram2", 0x400); @@ -1468,7 +1468,7 @@ INPUT_PORTS_END MACHINE_START_MEMBER(_8080bw_state,schaser) { - m_scattered_colorram = std::make_unique(0x800); + m_scattered_colorram = std::make_unique(0x800); save_pointer(&m_scattered_colorram[0], "m_scattered_colorram", 0x800); MACHINE_START_CALL_MEMBER(schaser_sh); MACHINE_START_CALL_MEMBER(extra_8080bw_vh); @@ -1539,9 +1539,9 @@ MACHINE_CONFIG_END READ8_MEMBER(_8080bw_state::schasercv_02_r) { - UINT8 data = ioport("IN2")->read(); + uint8_t data = ioport("IN2")->read(); if (m_flip_screen) return data; - UINT8 in1 = ioport("IN1")->read(); + uint8_t in1 = ioport("IN1")->read(); return (data & 0x89) | (in1 & 0x70) | (BIT(in1, 3) << 1) | (BIT(in1, 7) << 2); } @@ -1596,7 +1596,7 @@ INPUT_PORTS_END MACHINE_START_MEMBER(_8080bw_state,schasercv) { - m_scattered_colorram = std::make_unique(0x800); + m_scattered_colorram = std::make_unique(0x800); save_pointer(&m_scattered_colorram[0], "m_scattered_colorram", 0x800); MACHINE_START_CALL_MEMBER(extra_8080bw_sh); @@ -1689,7 +1689,7 @@ INPUT_PORTS_END MACHINE_START_MEMBER(_8080bw_state,sflush) { - m_scattered_colorram = std::make_unique(0x800); + m_scattered_colorram = std::make_unique(0x800); save_pointer(&m_scattered_colorram[0], "m_scattered_colorram", 0x800); MACHINE_START_CALL_MEMBER(mw8080bw); @@ -1876,7 +1876,7 @@ INTERRUPT_GEN_MEMBER(_8080bw_state::polaris_interrupt) MACHINE_START_MEMBER(_8080bw_state,polaris) { - m_scattered_colorram = std::make_unique(0x800); + m_scattered_colorram = std::make_unique(0x800); save_pointer(&m_scattered_colorram[0], "m_scattered_colorram", 0x800); save_item(NAME(m_polaris_cloud_speed)); save_item(NAME(m_polaris_cloud_pos)); @@ -1886,7 +1886,7 @@ MACHINE_START_MEMBER(_8080bw_state,polaris) READ8_MEMBER(_8080bw_state::polaris_port00_r) { - UINT8 data = ioport("IN0")->read(); + uint8_t data = ioport("IN0")->read(); if (m_flip_screen) return data; return (data & 7) | (ioport("IN1")->read() & 0xf8); } @@ -2309,7 +2309,7 @@ READ8_MEMBER(_8080bw_state::indianbt_r) READ8_MEMBER(_8080bw_state::indianbtbr_01_r) { - UINT8 data = ioport("IN1")->read(); + uint8_t data = ioport("IN1")->read(); if (!m_flip_screen) return data; return (data & 0x8f) | (ioport("IN2")->read() & 0x70); } @@ -2578,7 +2578,7 @@ INPUT_PORTS_END READ8_MEMBER(_8080bw_state::shuttlei_ff_r) { - UINT8 data = ioport("INPUTS")->read(); + uint8_t data = ioport("INPUTS")->read(); if (!m_flip_screen) return data; return (data & 0x3b) | ioport("P2")->read(); } @@ -2673,7 +2673,7 @@ MACHINE_RESET_MEMBER(_8080bw_state,darthvdr) READ8_MEMBER(_8080bw_state::darthvdr_01_r) { - UINT8 data = ioport("P2")->read(); + uint8_t data = ioport("P2")->read(); if (m_flip_screen) return data; return (data & 0xe1) | (ioport("P1")->read() & 0x0e); } @@ -2831,13 +2831,13 @@ MACHINE_CONFIG_END /* decrypt function for vortex */ DRIVER_INIT_MEMBER(_8080bw_state,vortex) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int length = memregion("maincpu")->bytes(); - std::vector buf1(length); - UINT32 x; + std::vector buf1(length); + uint32_t x; for (x = 0; x < length; x++) { - UINT32 addr = x; + uint32_t addr = x; /* A15 A14 A13 A0 A3 A9 0 0 0 I I I @@ -3036,8 +3036,8 @@ INPUT_CHANGED_MEMBER(_8080bw_state::claybust_gun_trigger) ana a rz */ - UINT8 const gunx = m_gunx.read_safe(0x00); - UINT8 const guny = m_guny.read_safe(0x20); + uint8_t const gunx = m_gunx.read_safe(0x00); + uint8_t const guny = m_guny.read_safe(0x20); m_claybust_gun_pos = ((gunx >> 3) | (guny << 5)) + 2; m_claybust_gun_on->adjust(attotime::from_msec(250)); // timing is a guess } @@ -3245,9 +3245,9 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(_8080bw_state,attackfc) { - UINT8 *rom = memregion("maincpu")->base(); - UINT32 len = memregion("maincpu")->bytes(); - std::vector buffer(len); + uint8_t *rom = memregion("maincpu")->base(); + uint32_t len = memregion("maincpu")->bytes(); + std::vector buffer(len); // swap a8/a9 for (int i = 0; i < len; i++) @@ -3380,9 +3380,9 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(_8080bw_state,invmulti) { - UINT8 *src = memregion("user1")->base(); + uint8_t *src = memregion("user1")->base(); int len = memregion("user1")->bytes(); - UINT8 *dest = memregion("maincpu")->base(); + uint8_t *dest = memregion("maincpu")->base(); // decrypt rom for (int i = 0; i < len; i++) diff --git a/src/mame/drivers/88games.cpp b/src/mame/drivers/88games.cpp index 14431d778c0..5ec57a8a11e 100644 --- a/src/mame/drivers/88games.cpp +++ b/src/mame/drivers/88games.cpp @@ -278,7 +278,7 @@ WRITE8_MEMBER( _88games_state::banking_callback ) void _88games_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base() + 0x10000; + uint8_t *ROM = memregion("maincpu")->base() + 0x10000; m_bank0000->configure_entries(0, 8, &ROM[0x0000], 0x2000); m_bank1000->configure_entries(0, 8, &ROM[0x1000], 0x2000); diff --git a/src/mame/drivers/a2600.cpp b/src/mame/drivers/a2600.cpp index fc0f9bc5cdf..b99f56ec0d3 100644 --- a/src/mame/drivers/a2600.cpp +++ b/src/mame/drivers/a2600.cpp @@ -58,8 +58,8 @@ public: m_riot(*this,"riot") { } - required_shared_ptr m_riot_ram; - UINT16 m_current_screen_height; + required_shared_ptr m_riot_ram; + uint16_t m_current_screen_height; DECLARE_MACHINE_START(a2600); DECLARE_WRITE8_MEMBER(switch_A_w); @@ -101,7 +101,7 @@ protected: #define MASTER_CLOCK_PAL 3546894 #define CATEGORY_SELECT 16 -static const UINT16 supported_screen_heights[4] = { 262, 312, 328, 342 }; +static const uint16_t supported_screen_heights[4] = { 262, 312, 328, 342 }; static ADDRESS_MAP_START(a2600_mem, AS_PROGRAM, 8, a2600_state ) // 6507 has 13-bit address space, 0x0000 - 0x1fff @@ -122,7 +122,7 @@ READ8_MEMBER(a2600_state::cart_over_all_r) m_cart->write_bank(space, offset, 0); int masked_offset = offset &~ 0x0d00; - UINT8 ret = 0x00; + uint8_t ret = 0x00; if (masked_offset < 0x80) { @@ -206,7 +206,7 @@ WRITE8_MEMBER(a2600_state::switch_A_w) READ8_MEMBER(a2600_state::switch_A_r) { - UINT8 val = 0; + uint8_t val = 0; /* Left controller port PINs 1-4 ( 4321 ) */ val |= ( m_joy1->joy_r() & 0x0F ) << 4; @@ -267,8 +267,8 @@ READ16_MEMBER(a2600_state::a2600_read_input_port) */ READ8_MEMBER(a2600_state::a2600_get_databus_contents) { - UINT16 last_address, prev_address; - UINT8 last_byte, prev_byte; + uint16_t last_address, prev_address; + uint8_t last_byte, prev_byte; address_space& prog_space = m_maincpu->space(AS_PROGRAM); last_address = m_maincpu->pc() + 1; @@ -452,7 +452,7 @@ unsigned a2600_state::long detect_2600controllers() unsigned int left,right; int i,j,foundkeypad = 0; - UINT8 *cart; + uint8_t *cart; static const unsigned char signatures[][5] = { { 0x55, 0xa5, 0x3c, 0x29, 0}, // star raiders { 0xf9, 0xff, 0xa5, 0x80, 1}, // sentinel diff --git a/src/mame/drivers/a310.cpp b/src/mame/drivers/a310.cpp index dcc55ab7b9c..c29c9092644 100644 --- a/src/mame/drivers/a310.cpp +++ b/src/mame/drivers/a310.cpp @@ -87,7 +87,7 @@ public: , m_ram(*this, RAM_TAG) { } - required_shared_ptr m_physram; + required_shared_ptr m_physram; DECLARE_READ32_MEMBER(a310_psy_wram_r); DECLARE_WRITE32_MEMBER(a310_psy_wram_w); @@ -140,7 +140,7 @@ WRITE32_MEMBER(a310_state::a310_psy_wram_w) DRIVER_INIT_MEMBER(a310_state,a310) { - UINT32 ram_size = m_ram->size(); + uint32_t ram_size = m_ram->size(); m_maincpu->space(AS_PROGRAM).install_readwrite_handler( 0x02000000, 0x02000000+(ram_size-1), read32_delegate(FUNC(a310_state::a310_psy_wram_r), this), write32_delegate(FUNC(a310_state::a310_psy_wram_w), this)); @@ -169,8 +169,8 @@ ADDRESS_MAP_END INPUT_CHANGED_MEMBER(a310_state::key_stroke) { - UINT8 row_val = (UINT8)(uintptr_t)(param) >> 4; - UINT8 col_val = (UINT8)(uintptr_t)(param) & 0xf; + uint8_t row_val = (uint8_t)(uintptr_t)(param) >> 4; + uint8_t col_val = (uint8_t)(uintptr_t)(param) & 0xf; if(newval && !oldval) m_kart->send_keycode_down(row_val,col_val); diff --git a/src/mame/drivers/a5105.cpp b/src/mame/drivers/a5105.cpp index f0ac55e9b03..148eae300a2 100644 --- a/src/mame/drivers/a5105.cpp +++ b/src/mame/drivers/a5105.cpp @@ -73,14 +73,14 @@ public: DECLARE_WRITE8_MEMBER( a5105_upd765_w ); DECLARE_WRITE8_MEMBER(pcg_addr_w); DECLARE_WRITE8_MEMBER(pcg_val_w); - required_shared_ptr m_video_ram; - UINT8 *m_ram_base; - UINT8 *m_rom_base; - UINT8 *m_char_ram; - UINT16 m_pcg_addr; - UINT16 m_pcg_internal_addr; - UINT8 m_key_mux; - UINT8 m_memsel[4]; + required_shared_ptr m_video_ram; + uint8_t *m_ram_base; + uint8_t *m_rom_base; + uint8_t *m_char_ram; + uint16_t m_pcg_addr; + uint16_t m_pcg_internal_addr; + uint8_t m_key_mux; + uint8_t m_memsel[4]; virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(a5105); @@ -98,7 +98,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( a5105_state::hgdc_display_pixels ) const rgb_t *palette = m_palette->palette()->entry_list_raw(); int xi,gfx; - UINT8 pen; + uint8_t pen; gfx = m_video_ram[(address & 0x1ffff) >> 1]; @@ -116,7 +116,7 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( a5105_state::hgdc_draw_text ) int x; int xi,yi; int tile,color; - UINT8 tile_data; + uint8_t tile_data; for( x = 0; x < pitch; x++ ) { @@ -231,7 +231,7 @@ WRITE8_MEMBER( a5105_state::a5105_ab_w ) READ8_MEMBER( a5105_state::a5105_memsel_r ) { - UINT8 res; + uint8_t res; res = (m_memsel[0] & 3) << 0; res|= (m_memsel[1] & 3) << 2; @@ -485,8 +485,8 @@ void a5105_state::machine_reset() address_space &space = m_maincpu->space(AS_PROGRAM); a5105_ab_w(space, 0, 9); // turn motor off - m_ram_base = (UINT8*)m_ram->pointer(); - m_rom_base = (UINT8*)memregion("maincpu")->base(); + m_ram_base = (uint8_t*)m_ram->pointer(); + m_rom_base = (uint8_t*)memregion("maincpu")->base(); membank("bank1")->set_base(m_rom_base); membank("bank2")->set_base(m_rom_base + 0x4000); diff --git a/src/mame/drivers/a51xx.cpp b/src/mame/drivers/a51xx.cpp index 5d51870eaad..39c613d64dc 100644 --- a/src/mame/drivers/a51xx.cpp +++ b/src/mame/drivers/a51xx.cpp @@ -26,8 +26,8 @@ public: virtual void video_start() override; DECLARE_MACHINE_RESET(a5130); DECLARE_VIDEO_START(a5130); - UINT32 screen_update_a5120(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_a5130(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_a5120(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_a5130(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -68,7 +68,7 @@ void a51xx_state::video_start() { } -UINT32 a51xx_state::screen_update_a5120(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t a51xx_state::screen_update_a5120(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } @@ -87,7 +87,7 @@ VIDEO_START_MEMBER(a51xx_state,a5130) { } -UINT32 a51xx_state::screen_update_a5130(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t a51xx_state::screen_update_a5130(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/a6809.cpp b/src/mame/drivers/a6809.cpp index 9f213faa8d3..6e0da15aac4 100644 --- a/src/mame/drivers/a6809.cpp +++ b/src/mame/drivers/a6809.cpp @@ -79,14 +79,14 @@ public: DECLARE_MACHINE_RESET(a6809); TIMER_DEVICE_CALLBACK_MEMBER(a6809_c); TIMER_DEVICE_CALLBACK_MEMBER(a6809_p); - required_shared_ptr m_p_videoram; - UINT16 m_start_address; - UINT16 m_cursor_address; + required_shared_ptr m_p_videoram; + uint16_t m_start_address; + uint16_t m_cursor_address; private: - UINT8 m_cass_data[4]; + uint8_t m_cass_data[4]; bool m_cass_state; bool m_cassold; - UINT8 m_video_index; + uint8_t m_video_index; required_device m_via; required_device m_cass; required_device m_maincpu; @@ -145,8 +145,8 @@ WRITE8_MEMBER( a6809_state::a6809_address_w ) WRITE8_MEMBER( a6809_state::a6809_register_w ) { - UINT16 temp = m_start_address; - UINT16 temq = m_cursor_address; + uint16_t temp = m_start_address; + uint16_t temq = m_cursor_address; m_crtc->register_w( space, 0, data ); @@ -191,7 +191,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(a6809_state::a6809_p) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -203,7 +203,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(a6809_state::a6809_p) WRITE8_MEMBER( a6809_state::kbd_put ) { - UINT8 d = data & 0x7f; + uint8_t d = data & 0x7f; if (d == 8) d = 0x7f; // allow backspace to work m_via->write_pb0((d>>0)&1); diff --git a/src/mame/drivers/a7150.cpp b/src/mame/drivers/a7150.cpp index f6e4d8398fc..825413856a8 100644 --- a/src/mame/drivers/a7150.cpp +++ b/src/mame/drivers/a7150.cpp @@ -23,7 +23,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_a7150(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_a7150(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -47,7 +47,7 @@ void a7150_state::video_start() { } -UINT32 a7150_state::screen_update_a7150(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t a7150_state::screen_update_a7150(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/a7800.cpp b/src/mame/drivers/a7800.cpp index 0ebaaeee0a3..f8e9b4247ae 100644 --- a/src/mame/drivers/a7800.cpp +++ b/src/mame/drivers/a7800.cpp @@ -158,7 +158,7 @@ protected: required_ioport m_io_console_buttons; required_device m_cart; required_device m_screen; - required_region_ptr m_bios; + required_region_ptr m_bios; }; @@ -1307,7 +1307,7 @@ void a7800_state::machine_start() save_item(NAME(m_maria_flag)); // set up RAM mirrors - UINT8 *ram = reinterpret_cast(memshare("6116_2")->ptr()); + uint8_t *ram = reinterpret_cast(memshare("6116_2")->ptr()); membank("zpmirror")->set_base(ram + 0x0040); membank("spmirror")->set_base(ram + 0x0140); diff --git a/src/mame/drivers/abc1600.cpp b/src/mame/drivers/abc1600.cpp index 4a2f71fc2bc..0fb1e911ae1 100644 --- a/src/mame/drivers/abc1600.cpp +++ b/src/mame/drivers/abc1600.cpp @@ -102,10 +102,10 @@ enum READ8_MEMBER( abc1600_state::bus_r ) { - UINT8 data = 0; + uint8_t data = 0; // card select pulse - UINT8 cs = (m_cs7 << 7) | ((offset >> 5) & 0x3f); + uint8_t cs = (m_cs7 << 7) | ((offset >> 5) & 0x3f); m_bus0i->cs_w(cs); m_bus0x->cs_w(cs); @@ -244,7 +244,7 @@ READ8_MEMBER( abc1600_state::bus_r ) WRITE8_MEMBER( abc1600_state::bus_w ) { - UINT8 cs = (m_cs7 << 7) | ((offset >> 5) & 0x3f); + uint8_t cs = (m_cs7 << 7) | ((offset >> 5) & 0x3f); m_bus0i->cs_w(cs); m_bus0x->cs_w(cs); @@ -632,7 +632,7 @@ READ8_MEMBER( abc1600_state::cio_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_bus2->irq_r(); data |= m_bus1->irq_r() << 1; @@ -663,7 +663,7 @@ READ8_MEMBER( abc1600_state::cio_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= !m_sysscc << 5; data |= !m_sysfs << 6; @@ -711,7 +711,7 @@ READ8_MEMBER( abc1600_state::cio_pc_r ) */ - UINT8 data = 0x0d; + uint8_t data = 0x0d; // data in data |= (m_rtc->dio_r() || m_nvram->do_r()) << 1; diff --git a/src/mame/drivers/abc80.cpp b/src/mame/drivers/abc80.cpp index 31d0836c357..75ddb6bc5c6 100644 --- a/src/mame/drivers/abc80.cpp +++ b/src/mame/drivers/abc80.cpp @@ -96,8 +96,8 @@ Notes: READ8_MEMBER( abc80_state::read ) { - UINT8 data = 0xff; - UINT8 mmu = m_mmu_rom->base()[0x40 | (offset >> 10)]; + uint8_t data = 0xff; + uint8_t mmu = m_mmu_rom->base()[0x40 | (offset >> 10)]; if (!(mmu & MMU_XM)) { @@ -126,7 +126,7 @@ READ8_MEMBER( abc80_state::read ) WRITE8_MEMBER( abc80_state::write ) { - UINT8 mmu = m_mmu_rom->base()[0x40 | (offset >> 10)]; + uint8_t mmu = m_mmu_rom->base()[0x40 | (offset >> 10)]; if (!(mmu & MMU_XM)) { @@ -262,7 +262,7 @@ READ8_MEMBER( abc80_state::pio_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; //data |= m_kb->data_r(); data |= m_key_data; @@ -288,7 +288,7 @@ READ8_MEMBER( abc80_state::pio_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // receive data data |= m_rs232->rxd_r(); @@ -386,7 +386,7 @@ WRITE8_MEMBER( abc80_state::kbd_w ) m_key_data = data; m_key_strobe = 1; - UINT8 pio_data = 0x80 | data; + uint8_t pio_data = 0x80 | data; m_pio->port_a_write(pio_data); timer_set(attotime::from_msec(50), TIMER_ID_FAKE_KEYBOARD_CLEAR); @@ -490,7 +490,7 @@ QUICKLOAD_LOAD_MEMBER( abc80_state, bac ) offs_t address = space.read_byte(BOFA + 1) << 8 | space.read_byte(BOFA); if (LOG) logerror("BOFA %04x\n",address); - std::vector data; + std::vector data; data.resize(quickload_size); image.fread(&data[0], quickload_size); for (int i = 1; i < quickload_size; i++) diff --git a/src/mame/drivers/abc80x.cpp b/src/mame/drivers/abc80x.cpp index 17b09bd9441..207bba0a2c3 100644 --- a/src/mame/drivers/abc80x.cpp +++ b/src/mame/drivers/abc80x.cpp @@ -251,7 +251,7 @@ void abc802_state::bankswitch() void abc806_state::bankswitch() { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT32 videoram_mask = m_ram->size() - (32 * 1024) - 1; + uint32_t videoram_mask = m_ram->size() - (32 * 1024) - 1; int bank; char bank_name[10]; @@ -259,15 +259,15 @@ void abc806_state::bankswitch() { // 32K block mapping - UINT32 videoram_start = (m_hrs & 0xf0) << 11; + uint32_t videoram_start = (m_hrs & 0xf0) << 11; for (bank = 1; bank <= 8; bank++) { // 0x0000-0x7FFF is video RAM - UINT16 start_addr = 0x1000 * (bank - 1); - UINT16 end_addr = start_addr + 0xfff; - UINT32 videoram_offset = (videoram_start + start_addr) & videoram_mask; + uint16_t start_addr = 0x1000 * (bank - 1); + uint16_t end_addr = start_addr + 0xfff; + uint32_t videoram_offset = (videoram_start + start_addr) & videoram_mask; sprintf(bank_name,"bank%d",bank); //logerror("%04x-%04x: Video RAM %04x (32K)\n", start_addr, end_addr, videoram_offset); @@ -280,8 +280,8 @@ void abc806_state::bankswitch() { // 0x8000-0xFFFF is main RAM - UINT16 start_addr = 0x1000 * (bank - 1); - UINT16 end_addr = start_addr + 0xfff; + uint16_t start_addr = 0x1000 * (bank - 1); + uint16_t end_addr = start_addr + 0xfff; sprintf(bank_name,"bank%d",bank); //logerror("%04x-%04x: Work RAM (32K)\n", start_addr, end_addr); @@ -295,10 +295,10 @@ void abc806_state::bankswitch() for (bank = 1; bank <= 16; bank++) { - UINT16 start_addr = 0x1000 * (bank - 1); - UINT16 end_addr = start_addr + 0xfff; - UINT8 map = m_map[bank - 1]; - UINT32 videoram_offset = ((map & 0x7f) << 12) & videoram_mask; + uint16_t start_addr = 0x1000 * (bank - 1); + uint16_t end_addr = start_addr + 0xfff; + uint8_t map = m_map[bank - 1]; + uint32_t videoram_offset = ((map & 0x7f) << 12) & videoram_mask; sprintf(bank_name,"bank%d",bank); if (BIT(map, 7) && m_eme) { @@ -350,15 +350,15 @@ void abc806_state::bankswitch() { // 30K block mapping - UINT32 videoram_start = (m_hrs & 0xf0) << 11; + uint32_t videoram_start = (m_hrs & 0xf0) << 11; for (bank = 1; bank <= 8; bank++) { // 0x0000-0x77FF is video RAM - UINT16 start_addr = 0x1000 * (bank - 1); - UINT16 end_addr = start_addr + 0xfff; - UINT32 videoram_offset = (videoram_start + start_addr) & videoram_mask; + uint16_t start_addr = 0x1000 * (bank - 1); + uint16_t end_addr = start_addr + 0xfff; + uint32_t videoram_offset = (videoram_start + start_addr) & videoram_mask; sprintf(bank_name,"bank%d",bank); //logerror("%04x-%04x: Video RAM %04x (30K)\n", start_addr, end_addr, videoram_offset); @@ -902,7 +902,7 @@ void abc802_state::machine_start() void abc802_state::machine_reset() { - UINT8 config = m_config->read(); + uint8_t config = m_config->read(); m_sb = m_io_sb->read(); // memory banking @@ -936,8 +936,8 @@ void abc806_state::machine_start() m_ctc_timer->adjust(attotime::from_hz(ABC800_X01/2/2/2), 0, attotime::from_hz(ABC800_X01/2/2/2)); // setup memory banking - UINT8 *mem = m_rom->base(); - UINT32 videoram_size = m_ram->size() - (32 * 1024); + uint8_t *mem = m_rom->base(); + uint32_t videoram_size = m_ram->size() - (32 * 1024); int bank; char bank_name[10]; diff --git a/src/mame/drivers/ace.cpp b/src/mame/drivers/ace.cpp index ace8a5a1b07..711ed70fe55 100644 --- a/src/mame/drivers/ace.cpp +++ b/src/mame/drivers/ace.cpp @@ -63,9 +63,9 @@ public: required_device m_maincpu; /* video-related */ - required_shared_ptr m_scoreram; - required_shared_ptr m_ram2; - required_shared_ptr m_characterram; + required_shared_ptr m_scoreram; + required_shared_ptr m_ram2; + required_shared_ptr m_characterram; required_device m_gfxdecode; required_device m_palette; @@ -79,7 +79,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void ace_postload(); }; @@ -97,7 +97,7 @@ void aceal_state::video_start() m_gfxdecode->gfx(4)->set_source(m_scoreram); } -UINT32 aceal_state::screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aceal_state::screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); diff --git a/src/mame/drivers/acefruit.cpp b/src/mame/drivers/acefruit.cpp index a9b01d35d77..1230e9e4c36 100644 --- a/src/mame/drivers/acefruit.cpp +++ b/src/mame/drivers/acefruit.cpp @@ -32,9 +32,9 @@ public: m_palette(*this, "palette") { } required_device m_maincpu; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; @@ -50,7 +50,7 @@ public: DECLARE_DRIVER_INIT(sidewndr); virtual void video_start() override; DECLARE_PALETTE_INIT(acefruit); - UINT32 screen_update_acefruit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_acefruit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(acefruit_vblank); void acefruit_update_irq(int vpos); @@ -116,7 +116,7 @@ INTERRUPT_GEN_MEMBER(acefruit_state::acefruit_vblank) m_refresh_timer->adjust( attotime::zero ); } -UINT32 acefruit_state::screen_update_acefruit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t acefruit_state::screen_update_acefruit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int startrow = cliprect.min_y / 8; int endrow = cliprect.max_y / 8; @@ -150,11 +150,11 @@ UINT32 acefruit_state::screen_update_acefruit(screen_device &screen, bitmap_ind1 for( x = 0; x < 16; x++ ) { int sprite = ( m_spriteram[ ( spriteindex / 64 ) % 6 ] & 0xf ) ^ 0xf; - const UINT8 *gfxdata = gfx->get_data(sprite); + const uint8_t *gfxdata = gfx->get_data(sprite); for( y = 0; y < 8; y++ ) { - UINT16 *dst = &bitmap.pix16(y + ( row * 8 ), x + ( col * 16 ) ); + uint16_t *dst = &bitmap.pix16(y + ( row * 8 ), x + ( col * 16 ) ); *( dst ) = *( gfxdata + ( ( spriterow + y ) * gfx->rowbytes() ) + ( ( spriteindex % 64 ) >> 1 ) ); } @@ -170,7 +170,7 @@ UINT32 acefruit_state::screen_update_acefruit(screen_device &screen, bitmap_ind1 { for( y = 0; y < 8; y++ ) { - UINT16 *dst = &bitmap.pix16(y + ( row * 8 ), x + ( col * 16 ) ); + uint16_t *dst = &bitmap.pix16(y + ( row * 8 ), x + ( col * 16 ) ); *( dst ) = 0; } } @@ -635,7 +635,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(acefruit_state,sidewndr) { - UINT8 *ROM = memregion( "maincpu" )->base(); + uint8_t *ROM = memregion( "maincpu" )->base(); /* replace "ret nc" ( 0xd0 ) with "di" */ ROM[ 0 ] = 0xf3; /* this is either a bad dump or the cpu core should set the carry flag on reset */ diff --git a/src/mame/drivers/acesp.cpp b/src/mame/drivers/acesp.cpp index 1a83aa85aa4..80567301201 100644 --- a/src/mame/drivers/acesp.cpp +++ b/src/mame/drivers/acesp.cpp @@ -3848,11 +3848,11 @@ ROM_START( sp_cpal ) SP_CPAL_SOUND ROM_END -static void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor) +static void descramble_crystal( uint8_t* region, int start, int end, uint8_t extra_xor) { for (int i=start;i m_ac_bgvram; - required_shared_ptr m_ac_txvram; - required_shared_ptr m_spriteram; - required_shared_ptr m_ac_devram; + required_shared_ptr m_ac_bgvram; + required_shared_ptr m_ac_txvram; + required_shared_ptr m_spriteram; + required_shared_ptr m_ac_devram; tilemap_t *m_tx_tilemap; tilemap_t *m_bg_tilemap; - std::unique_ptr m_ac_vregs; - UINT16 m_led0; - UINT16 m_led1; - UINT16 m_ufo_sw1; - UINT16 m_ufo_sw2; + std::unique_ptr m_ac_vregs; + uint16_t m_led0; + uint16_t m_led1; + uint16_t m_ufo_sw1; + uint16_t m_ufo_sw2; DECLARE_WRITE16_MEMBER(ac_bgvram_w); DECLARE_WRITE16_MEMBER(ac_txvram_w); DECLARE_WRITE16_MEMBER(ac_bgscroll_w); @@ -99,10 +99,10 @@ public: TILE_GET_INFO_MEMBER(ac_get_bg_tile_info); TILE_GET_INFO_MEMBER(ac_get_tx_tile_info); virtual void video_start() override; - UINT32 screen_update_acommand(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_acommand(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(acommand_scanline); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int pri_mask); - void draw_led(bitmap_ind16 &bitmap, int x, int y,UINT8 value); + void draw_led(bitmap_ind16 &bitmap, int x, int y,uint8_t value); required_device m_maincpu; required_device m_oki1; required_device m_oki2; @@ -138,7 +138,7 @@ TILE_GET_INFO_MEMBER(acommand_state::ac_get_tx_tile_info) void acommand_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int pri_mask) { - UINT16 *spriteram16 = m_spriteram; + uint16_t *spriteram16 = m_spriteram; int offs; for (offs = 0;offs < m_spriteram.bytes()/2;offs += 8) @@ -199,7 +199,7 @@ void acommand_state::video_start() m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(acommand_state::ac_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,512,32); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(acommand_state::ac_get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(acommand_state::bg_scan),this),16,16,256,16); - m_ac_vregs = std::make_unique(0x80/2); + m_ac_vregs = std::make_unique(0x80/2); m_tx_tilemap->set_transparent_pen(15); } @@ -225,9 +225,9 @@ g & 40 7f */ /* 0 1 2 3 4 5 6 7 8 9 a b c d e f*/ -static const UINT8 led_fill[0x10] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x00,0x00,0x00,0x00,0x00}; +static const uint8_t led_fill[0x10] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x00,0x00,0x00,0x00,0x00,0x00}; -void acommand_state::draw_led(bitmap_ind16 &bitmap, int x, int y,UINT8 value) +void acommand_state::draw_led(bitmap_ind16 &bitmap, int x, int y,uint8_t value) { bitmap.plot_box(x, y, 6, 10, 0x00000000); @@ -262,7 +262,7 @@ void acommand_state::draw_led(bitmap_ind16 &bitmap, int x, int y,UINT8 value) } -UINT32 acommand_state::screen_update_acommand(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t acommand_state::screen_update_acommand(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); draw_sprites(bitmap,cliprect,0,0); diff --git a/src/mame/drivers/acrnsys1.cpp b/src/mame/drivers/acrnsys1.cpp index 41efa342a61..480719fb6b8 100644 --- a/src/mame/drivers/acrnsys1.cpp +++ b/src/mame/drivers/acrnsys1.cpp @@ -75,8 +75,8 @@ private: required_device m_maincpu; required_device m_ttl74145; required_device m_cass; - UINT8 m_digit; - UINT8 m_cass_data[4]; + uint8_t m_digit; + uint8_t m_cass_data[4]; bool m_cass_state; bool m_cassold; }; @@ -89,7 +89,7 @@ private: // bit 7 is cassin READ8_MEMBER( acrnsys1_state::ins8154_b1_port_a_r ) { - UINT8 data = 0x7f, i, key_line = m_ttl74145->read(); + uint8_t data = 0x7f, i, key_line = m_ttl74145->read(); for (i = 0; i < 8; i++) { @@ -133,7 +133,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_state::acrnsys1_p) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -149,7 +149,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(acrnsys1_state::acrnsys1_p) WRITE8_MEMBER( acrnsys1_state::acrnsys1_led_segment_w ) { - UINT8 key_line = m_ttl74145->read(); + uint8_t key_line = m_ttl74145->read(); output().set_digit_value(key_line, data); } diff --git a/src/mame/drivers/actfancr.cpp b/src/mame/drivers/actfancr.cpp index 3f24105bcff..6d898b20901 100644 --- a/src/mame/drivers/actfancr.cpp +++ b/src/mame/drivers/actfancr.cpp @@ -63,7 +63,7 @@ WRITE8_MEMBER(actfancr_state::actfancr_sound_w) WRITE8_MEMBER(actfancr_state::actfancr_buffer_spriteram_w) { - UINT8 *src = reinterpret_cast(memshare("spriteram")->ptr()); + uint8_t *src = reinterpret_cast(memshare("spriteram")->ptr()); // copy to a 16-bit region for our sprite draw code too for (int i=0;i<0x800/2;i++) { diff --git a/src/mame/drivers/adam.cpp b/src/mame/drivers/adam.cpp index 4369295343b..cd0d992ae56 100644 --- a/src/mame/drivers/adam.cpp +++ b/src/mame/drivers/adam.cpp @@ -348,7 +348,7 @@ READ8_MEMBER( adam_state::mreq_r ) { int bmreq = 0, biorq = 1, eos_enable = 1, boot_rom_cs = 1, aux_decode_1 = 1, aux_rom_cs = 1, cas1 = 1, cas2 = 1, cs1 = 1, cs2 = 1, cs3 = 1, cs4 = 1; - UINT8 data = 0; + uint8_t data = 0; if (offset < 0x8000) { @@ -527,7 +527,7 @@ READ8_MEMBER( adam_state::iorq_r ) { int bmreq = 1, biorq = 0, aux_rom_cs = 1, cas1 = 1, cas2 = 1; - UINT8 data = 0; + uint8_t data = 0; switch ((offset >> 5) & 0x07) { @@ -749,7 +749,7 @@ READ8_MEMBER( adam_state::m6801_p2_r ) */ - UINT8 data = M6801_MODE_7; + uint8_t data = M6801_MODE_7; // NET RXD data |= m_adamnet->rxd_r() << 3; diff --git a/src/mame/drivers/adp.cpp b/src/mame/drivers/adp.cpp index 6eef80ebad3..ed6b53b51ff 100644 --- a/src/mame/drivers/adp.cpp +++ b/src/mame/drivers/adp.cpp @@ -184,7 +184,7 @@ public: required_ioport m_in0; /* misc */ - UINT8 m_mux_data; + uint8_t m_mux_data; /* devices */ DECLARE_READ16_MEMBER(input_r); @@ -207,7 +207,7 @@ void adp_state::skattva_nvram_init(nvram_device &nvram, void *base, size_t size) 00F70A: 4EB9 0001 D7F4 jsr $1d7f4.l ; initializes the HD63484 00F710: 11FC 0010 E8AD move.b #$10, $e8ad.w */ - UINT16 *ram = (UINT16 *)base; + uint16_t *ram = (uint16_t *)base; ram[0x2450 >> 1] = 0x2400; ram[0x2452 >> 1] = 0x0018; ram[0x0000 >> 1] = 0x3141; @@ -273,7 +273,7 @@ PALETTE_INIT_MEMBER(adp_state,fstation) READ16_MEMBER(adp_state::input_r) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; data &= ~(BIT(m_in0->read(), m_mux_data) ? 0x0000 : 0x0004); diff --git a/src/mame/drivers/aeroboto.cpp b/src/mame/drivers/aeroboto.cpp index 6dd3b35dbdc..c06625387cf 100644 --- a/src/mame/drivers/aeroboto.cpp +++ b/src/mame/drivers/aeroboto.cpp @@ -35,7 +35,7 @@ READ8_MEMBER(aeroboto_state::aeroboto_201_r) { /* if you keep a button pressed during boot, the game will expect this */ /* serie of values to be returned from 3004, and display "PASS 201" if it is */ - static const UINT8 res[4] = { 0xff, 0x9f, 0x1b, 0x03 }; + static const uint8_t res[4] = { 0xff, 0x9f, 0x1b, 0x03 }; logerror("PC %04x: read 3004\n", space.device().safe_pc()); return res[(m_count++) & 3]; diff --git a/src/mame/drivers/aerofgt.cpp b/src/mame/drivers/aerofgt.cpp index aecc17db3a5..bc3e201f97e 100644 --- a/src/mame/drivers/aerofgt.cpp +++ b/src/mame/drivers/aerofgt.cpp @@ -1320,7 +1320,7 @@ MACHINE_START_MEMBER(aerofgt_state,common) MACHINE_START_MEMBER(aerofgt_state,aerofgt) { - UINT8 *rom = memregion("audiocpu")->base(); + uint8_t *rom = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 4, &rom[0x10000], 0x8000); diff --git a/src/mame/drivers/aim65.cpp b/src/mame/drivers/aim65.cpp index 00018157e05..47186011a9e 100644 --- a/src/mame/drivers/aim65.cpp +++ b/src/mame/drivers/aim65.cpp @@ -147,7 +147,7 @@ INPUT_PORTS_END image_init_result aim65_state::load_cart(device_image_interface &image, generic_slot_device *slot, const char *slot_tag) { - UINT32 size = slot->common_get_size(slot_tag); + uint32_t size = slot->common_get_size(slot_tag); if (size > 0x1000) { diff --git a/src/mame/drivers/airraid.cpp b/src/mame/drivers/airraid.cpp index 41d6f33494f..8adb5abd932 100644 --- a/src/mame/drivers/airraid.cpp +++ b/src/mame/drivers/airraid.cpp @@ -169,9 +169,9 @@ public: required_device m_maincpu; optional_device m_seibu_sound; - optional_shared_ptr m_mainram; + optional_shared_ptr m_mainram; required_device m_palette; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; required_device m_airraid_video; @@ -556,7 +556,7 @@ DRIVER_INIT_MEMBER(airraid_state, cshooter) DRIVER_INIT_MEMBER(airraid_state,cshootere) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (int A = 0x0000;A < 0x8000;A++) { diff --git a/src/mame/drivers/albazc.cpp b/src/mame/drivers/albazc.cpp index febf07ebf82..c69d8d9f75f 100644 --- a/src/mame/drivers/albazc.cpp +++ b/src/mame/drivers/albazc.cpp @@ -29,17 +29,17 @@ public: m_palette(*this, "palette") { } /* video-related */ - required_shared_ptr m_spriteram1; - required_shared_ptr m_spriteram2; - required_shared_ptr m_spriteram3; - UINT8 m_flip_bit; + required_shared_ptr m_spriteram1; + required_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram3; + uint8_t m_flip_bit; DECLARE_WRITE8_MEMBER(hanaroku_out_0_w); DECLARE_WRITE8_MEMBER(hanaroku_out_1_w); DECLARE_WRITE8_MEMBER(hanaroku_out_2_w); DECLARE_WRITE8_MEMBER(albazc_vregs_w); virtual void video_start() override; DECLARE_PALETTE_INIT(albazc); - UINT32 screen_update_hanaroku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hanaroku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; @@ -52,7 +52,7 @@ public: PALETTE_INIT_MEMBER(albazc_state, albazc) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; int r, g, b; @@ -96,7 +96,7 @@ void albazc_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) } } -UINT32 albazc_state::screen_update_hanaroku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t albazc_state::screen_update_hanaroku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0x1f0, cliprect); // ??? draw_sprites(bitmap, cliprect); @@ -150,7 +150,7 @@ WRITE8_MEMBER(albazc_state::albazc_vregs_w) { #ifdef UNUSED_FUNCTION { - static UINT8 x[5]; + static uint8_t x[5]; x[offset] = data; popmessage("%02x %02x %02x %02x %02x",x[0],x[1],x[2],x[3],x[4]); } diff --git a/src/mame/drivers/albazg.cpp b/src/mame/drivers/albazg.cpp index f0014116c37..f5d2978b4be 100644 --- a/src/mame/drivers/albazg.cpp +++ b/src/mame/drivers/albazg.cpp @@ -56,17 +56,17 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_cus_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_cus_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_bg_tilemap; /* misc */ - UINT8 m_mux_data; + uint8_t m_mux_data; int m_bank; - UINT8 m_prot_lock; + uint8_t m_prot_lock; DECLARE_WRITE8_MEMBER(yumefuda_vram_w); DECLARE_WRITE8_MEMBER(yumefuda_cram_w); DECLARE_READ8_MEMBER(custom_ram_r); @@ -79,7 +79,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_yumefuda(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_yumefuda(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -101,7 +101,7 @@ void albazg_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(albazg_state::y_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 albazg_state::screen_update_yumefuda(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t albazg_state::screen_update_yumefuda(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -328,7 +328,7 @@ INPUT_PORTS_END void albazg_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x2000); diff --git a/src/mame/drivers/aleck64.cpp b/src/mame/drivers/aleck64.cpp index b67a5c10cc0..86a0b712832 100644 --- a/src/mame/drivers/aleck64.cpp +++ b/src/mame/drivers/aleck64.cpp @@ -193,14 +193,14 @@ public: DECLARE_READ16_MEMBER(e90_prot_r); DECLARE_WRITE16_MEMBER(e90_prot_w); - UINT32 screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: - optional_shared_ptr m_e90_vram; - optional_shared_ptr m_e90_pal; + optional_shared_ptr m_e90_vram; + optional_shared_ptr m_e90_pal; private: - UINT32 m_dip_read_offset; + uint32_t m_dip_read_offset; }; @@ -236,7 +236,7 @@ READ32_MEMBER(aleck64_state::aleck_dips_r) return (ioport("IN1")->read()); case 2: { - UINT32 const val = ioport("INMJ")->read(); + uint32_t const val = ioport("INMJ")->read(); switch( m_dip_read_offset >> 8 & 0xff ) { @@ -879,7 +879,7 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state ) MCFG_N64_PERIPHS_ADD("rcp"); MACHINE_CONFIG_END -UINT32 aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); screen_update_n64(screen,bitmap,cliprect); @@ -890,10 +890,10 @@ UINT32 aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bit int r,g,b; int pal_offs; int pal_shift; - //UINT16 tile = m_e90_vram[offs] >> 16; - UINT16 pal = m_e90_vram[offs] & 0xff; // guess: 0x1000 entries / word / 4bpp = 0x7f, divided by two below (TODO: why?) - INT16 x = m_e90_vram[offs+1] >> 16; - INT16 y = m_e90_vram[offs+1] & 0xffff; + //uint16_t tile = m_e90_vram[offs] >> 16; + uint16_t pal = m_e90_vram[offs] & 0xff; // guess: 0x1000 entries / word / 4bpp = 0x7f, divided by two below (TODO: why?) + int16_t x = m_e90_vram[offs+1] >> 16; + int16_t y = m_e90_vram[offs+1] & 0xffff; pal>>=1; x>>=1; pal_offs = (pal*0x20); @@ -932,7 +932,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(aleck64_state,aleck64) { - UINT8 *rom = memregion("user2")->base(); + uint8_t *rom = memregion("user2")->base(); rom[0x67c] = 0; rom[0x67d] = 0; diff --git a/src/mame/drivers/alesis.cpp b/src/mame/drivers/alesis.cpp index 8dffc53a803..d8c117ce0b9 100644 --- a/src/mame/drivers/alesis.cpp +++ b/src/mame/drivers/alesis.cpp @@ -24,7 +24,7 @@ WRITE8_MEMBER( alesis_state::kb_matrix_w ) READ8_MEMBER( alesis_state::kb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!(m_kb_matrix & 0x01)) data &= m_col1->read(); @@ -57,7 +57,7 @@ WRITE8_MEMBER( alesis_state::led_w ) READ8_MEMBER( alesis_state::p3_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; data &= ~(m_cassette->input() > 0.01 ? 0x00 : 0x08); @@ -102,7 +102,7 @@ READ8_MEMBER( alesis_state::mmt8_p3_r ) { // ---- -x-- Tape in // ---- x--- Start/Stop input - UINT8 data = 0xff; + uint8_t data = 0xff; data &= ~(m_cassette->input() > 0.01 ? 0x00 : 0x04); @@ -467,8 +467,8 @@ ROM_END DRIVER_INIT_MEMBER(alesis_state,hr16) { int i; - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 *orig = memregion("user1")->base(); + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *orig = memregion("user1")->base(); for (i = 0; i < 0x8000; i++) { ROM[BITSWAP16(i,15,14,13,12,11,10,9,8,0,1,2,3,4,5,6,7)] = orig[i]; diff --git a/src/mame/drivers/alg.cpp b/src/mame/drivers/alg.cpp index 7f39462df83..d901d944472 100644 --- a/src/mame/drivers/alg.cpp +++ b/src/mame/drivers/alg.cpp @@ -59,7 +59,7 @@ public: protected: // amiga_state overrides - virtual void potgo_w(UINT16 data) override; + virtual void potgo_w(uint16_t data) override; int get_lightgun_pos(int player, int *x, int *y); private: @@ -70,7 +70,7 @@ private: optional_ioport m_gun2y; optional_ioport m_triggers; - UINT16 m_input_select; + uint16_t m_input_select; }; @@ -126,7 +126,7 @@ VIDEO_START_MEMBER(alg_state,alg) * *************************************/ -void alg_state::potgo_w(UINT16 data) +void alg_state::potgo_w(uint16_t data) { /* bit 15 controls whether pin 9 is input/output */ /* bit 14 controls the value, which selects which player's controls to read */ @@ -696,15 +696,15 @@ DRIVER_INIT_MEMBER(alg_state,palr1) { DRIVER_INIT_CALL(ntsc); - UINT32 length = memregion("user2")->bytes(); - UINT8 *rom = memregion("user2")->base(); - std::vector original(length); - UINT32 srcaddr; + uint32_t length = memregion("user2")->bytes(); + uint8_t *rom = memregion("user2")->base(); + std::vector original(length); + uint32_t srcaddr; memcpy(&original[0], rom, length); for (srcaddr = 0; srcaddr < length; srcaddr++) { - UINT32 dstaddr = srcaddr; + uint32_t dstaddr = srcaddr; if (srcaddr & 0x2000) dstaddr ^= 0x1000; if (srcaddr & 0x8000) dstaddr ^= 0x4000; rom[dstaddr] = original[srcaddr]; @@ -715,15 +715,15 @@ DRIVER_INIT_MEMBER(alg_state,palr3) { DRIVER_INIT_CALL(ntsc); - UINT32 length = memregion("user2")->bytes(); - UINT8 *rom = memregion("user2")->base(); - std::vector original(length); - UINT32 srcaddr; + uint32_t length = memregion("user2")->bytes(); + uint8_t *rom = memregion("user2")->base(); + std::vector original(length); + uint32_t srcaddr; memcpy(&original[0], rom, length); for (srcaddr = 0; srcaddr < length; srcaddr++) { - UINT32 dstaddr = srcaddr; + uint32_t dstaddr = srcaddr; if (srcaddr & 0x2000) dstaddr ^= 0x1000; rom[dstaddr] = original[srcaddr]; } @@ -733,15 +733,15 @@ DRIVER_INIT_MEMBER(alg_state,palr6) { DRIVER_INIT_CALL(ntsc); - UINT32 length = memregion("user2")->bytes(); - UINT8 *rom = memregion("user2")->base(); - std::vector original(length); - UINT32 srcaddr; + uint32_t length = memregion("user2")->bytes(); + uint8_t *rom = memregion("user2")->base(); + std::vector original(length); + uint32_t srcaddr; memcpy(&original[0], rom, length); for (srcaddr = 0; srcaddr < length; srcaddr++) { - UINT32 dstaddr = srcaddr; + uint32_t dstaddr = srcaddr; if (~srcaddr & 0x2000) dstaddr ^= 0x1000; if ( srcaddr & 0x8000) dstaddr ^= 0x4000; dstaddr ^= 0x20000; @@ -754,8 +754,8 @@ DRIVER_INIT_MEMBER(alg_state,aplatoon) DRIVER_INIT_CALL(ntsc); /* NOT DONE TODO FIGURE OUT THE RIGHT ORDER!!!! */ - UINT8 *rom = memregion("user2")->base(); - std::unique_ptr decrypted = std::make_unique(0x40000); + uint8_t *rom = memregion("user2")->base(); + std::unique_ptr decrypted = std::make_unique(0x40000); int i; static const int shuffle[] = diff --git a/src/mame/drivers/alien.cpp b/src/mame/drivers/alien.cpp index 46daf7e6499..e3104b47231 100644 --- a/src/mame/drivers/alien.cpp +++ b/src/mame/drivers/alien.cpp @@ -31,7 +31,7 @@ public: DECLARE_READ64_MEMBER(test_r); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: @@ -47,7 +47,7 @@ void alien_state::video_start() { } -UINT32 alien_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t alien_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/alinvade.cpp b/src/mame/drivers/alinvade.cpp index 25f378ed388..9743e3d69b1 100644 --- a/src/mame/drivers/alinvade.cpp +++ b/src/mame/drivers/alinvade.cpp @@ -39,15 +39,15 @@ public: DECLARE_WRITE8_MEMBER(sound_w); DECLARE_WRITE8_MEMBER(sounden_w); INTERRUPT_GEN_MEMBER(vblank_irq); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: - UINT8 m_irqmask; - UINT8 m_irqff; + uint8_t m_irqmask; + uint8_t m_irqff; virtual void machine_start() override; virtual void machine_reset() override; required_device m_maincpu; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_discrete; }; @@ -166,7 +166,7 @@ void alinvade_state::machine_reset() m_irqmask = 1; } -UINT32 alinvade_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t alinvade_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -174,9 +174,9 @@ UINT32 alinvade_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap { int i; - UINT8 x = (offs << 3)&0x7f; + uint8_t x = (offs << 3)&0x7f; int y = (offs >> 4)&0x7f; - UINT8 data = m_videoram[offs]; + uint8_t data = m_videoram[offs]; for (i = 0; i < 8; i++) { diff --git a/src/mame/drivers/allied.cpp b/src/mame/drivers/allied.cpp index 3f14663bc43..1c17b4661ae 100644 --- a/src/mame/drivers/allied.cpp +++ b/src/mame/drivers/allied.cpp @@ -84,16 +84,16 @@ public: DECLARE_WRITE_LINE_MEMBER(ic8_cb2_w); TIMER_DEVICE_CALLBACK_MEMBER(timer_a); private: - UINT32 m_player_score[6]; - UINT8 m_display; - UINT8 m_bit_counter; + uint32_t m_player_score[6]; + uint8_t m_display; + uint8_t m_bit_counter; bool m_disp_data; - UINT8 m_ic5a; - UINT8 m_ic6a0; - UINT8 m_ic6a1; - UINT8 m_ic6a2; - UINT8 m_ic6b4; - UINT8 m_ic6b7; + uint8_t m_ic5a; + uint8_t m_ic6a0; + uint8_t m_ic6a1; + uint8_t m_ic6a2; + uint8_t m_ic6b4; + uint8_t m_ic6b7; virtual void machine_reset() override; required_device m_maincpu; required_device m_ic1; @@ -402,8 +402,8 @@ READ8_MEMBER( allied_state::ic4_a_r ) WRITE8_MEMBER( allied_state::ic4_b_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7446A - UINT8 segment, i; + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7446A + uint8_t segment, i; for (i = 0; i < 4; i++) { if (!BIT(data, i+4)) @@ -586,7 +586,7 @@ WRITE_LINE_MEMBER( allied_state::ic8_cb2_w ) TIMER_DEVICE_CALLBACK_MEMBER( allied_state::timer_a ) { - UINT8 data = ioport("X6A")->read(); + uint8_t data = ioport("X6A")->read(); m_ic8->ca1_w(BIT(data, 4)); m_ic8->cb1_w(BIT(data, 5)); diff --git a/src/mame/drivers/alpha68k.cpp b/src/mame/drivers/alpha68k.cpp index d3b882f8394..18ab41042a8 100644 --- a/src/mame/drivers/alpha68k.cpp +++ b/src/mame/drivers/alpha68k.cpp @@ -271,8 +271,8 @@ READ16_MEMBER(alpha68k_state::control_4_r) READ16_MEMBER(alpha68k_state::jongbou_inputs_r) { - UINT8 inp1 = ioport("IN3")->read(); - UINT8 inp2 = ioport("IN4")->read(); + uint8_t inp1 = ioport("IN3")->read(); + uint8_t inp2 = ioport("IN4")->read(); inp1 = ((inp1 & 0x01) << 3) + ((inp1 & 0x02) << 1) + ((inp1 & 0x04) >> 1) + ((inp1 & 0x08) >> 3); inp2 = ((inp2 & 0x01) << 3) + ((inp2 & 0x02) << 1) + ((inp2 & 0x04) >> 1) + ((inp2 & 0x08) >> 3); return ioport("IN0")->read() | inp1 | inp2 << 4; @@ -328,8 +328,8 @@ READ16_MEMBER(alpha68k_state::kyros_alpha_trigger_r) - Kyros : 0x22 - Super Stingray : 0x21,0x22,0x23,0x24,0x34,0x37,0x3a,0x3d,0x40,0x43,0x46,0x49 */ - static const UINT8 coinage1[8][2]={{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}}; - static const UINT8 coinage2[8][2]={{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}}; + static const uint8_t coinage1[8][2]={{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}}; + static const uint8_t coinage2[8][2]={{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}}; int source = m_shared_ram[offset]; switch (offset) @@ -409,8 +409,8 @@ READ16_MEMBER(alpha68k_state::alpha_II_trigger_r) - Sky Soldiers : 0x21,0x22,0x23,0x24,0x34,0x37,0x3a,0x3d,0x40,0x43,0x46,0x49 - Gold Medalist : 0x21,0x23,0x24,0x5b */ - static const UINT8 coinage1[8][2] = {{1,1}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {2,3}, {3,2}}; - static const UINT8 coinage2[8][2] = {{1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}}; + static const uint8_t coinage1[8][2] = {{1,1}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {2,3}, {3,2}}; + static const uint8_t coinage2[8][2] = {{1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}}; int source = m_shared_ram[offset]; switch (offset) @@ -503,8 +503,8 @@ READ16_MEMBER(alpha68k_state::alpha_V_trigger_r) - Gang Wars : 0x21,0x23,0x24,0x54 - Super Champion Baseball : 0x21,0x23,0x24 */ - static const UINT8 coinage1[8][2] = {{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}}; - static const UINT8 coinage2[8][2] = {{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}}; + static const uint8_t coinage1[8][2] = {{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}}; + static const uint8_t coinage2[8][2] = {{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}}; int source = m_shared_ram[offset]; switch (offset) @@ -1851,7 +1851,7 @@ MACHINE_RESET_MEMBER(alpha68k_state,common) MACHINE_START_MEMBER(alpha68k_state,alpha68k_V) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank7")->configure_entries(0, 32, &ROM[0x10000], 0x4000); @@ -1882,7 +1882,7 @@ MACHINE_RESET_MEMBER(alpha68k_state,alpha68k_II) MACHINE_START_MEMBER(alpha68k_state,alpha68k_II) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank7")->configure_entries(0, 28, &ROM[0x10000], 0x4000); @@ -3449,7 +3449,7 @@ DRIVER_INIT_MEMBER(alpha68k_state,gangwars) DRIVER_INIT_MEMBER(alpha68k_state,sbasebal) { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); /* Patch protection check, it does a divide by zero because the MCU is trying to calculate the ball speed when a strike is scored, notice that current emulation diff --git a/src/mame/drivers/alphasma.cpp b/src/mame/drivers/alphasma.cpp index 7d239676a02..8e2e440bcb9 100644 --- a/src/mame/drivers/alphasma.cpp +++ b/src/mame/drivers/alphasma.cpp @@ -47,7 +47,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(alphasmart); - virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_INPUT_CHANGED_MEMBER(kb_irq); DECLARE_READ8_MEMBER(kb_r); @@ -60,9 +60,9 @@ public: void update_lcdc(address_space &space, bool lcdc0, bool lcdc1); protected: - UINT8 m_matrix[2]; - UINT8 m_port_a; - UINT8 m_port_d; + uint8_t m_matrix[2]; + uint8_t m_port_a; + uint8_t m_port_d; std::unique_ptr m_tmp_bitmap; }; @@ -75,14 +75,14 @@ public: { } - required_shared_ptr m_intram; + required_shared_ptr m_intram; DECLARE_READ8_MEMBER(io_r); DECLARE_WRITE8_MEMBER(io_w); virtual DECLARE_WRITE8_MEMBER(port_a_w) override; private: - UINT8 m_lcd_ctrl; + uint8_t m_lcd_ctrl; }; INPUT_CHANGED_MEMBER(alphasmart_state::kb_irq) @@ -92,8 +92,8 @@ INPUT_CHANGED_MEMBER(alphasmart_state::kb_irq) READ8_MEMBER(alphasmart_state::kb_r) { - UINT16 matrix = (m_matrix[1]<<8) | m_matrix[0]; - UINT8 data = 0xff; + uint16_t matrix = (m_matrix[1]<<8) | m_matrix[0]; + uint8_t data = 0xff; for(int i=0; i<16; i++) if (!(matrix & (1<read(space, BIT(m_matrix[1], 1)); @@ -133,7 +133,7 @@ void alphasmart_state::update_lcdc(address_space &space, bool lcdc0, bool lcdc1) } else { - UINT8 lcdc_data = (m_port_d<<2) & 0xf0; + uint8_t lcdc_data = (m_port_d<<2) & 0xf0; if (lcdc0) m_lcdc0->write(space, BIT(m_matrix[1], 1), lcdc_data); @@ -145,7 +145,7 @@ void alphasmart_state::update_lcdc(address_space &space, bool lcdc0, bool lcdc1) WRITE8_MEMBER(alphasmart_state::port_a_w) { - UINT8 changed = (m_port_a ^ data) & data; + uint8_t changed = (m_port_a ^ data) & data; update_lcdc(space, changed & 0x80, changed & 0x20); m_rambank->set_entry(((data>>3) & 0x01) | ((data>>4) & 0x02)); m_port_a = data; @@ -193,7 +193,7 @@ WRITE8_MEMBER(asma2k_state::io_w) kb_matrixh_w(space, offset, data); else if (offset == 0x4000) { - UINT8 changed = (m_lcd_ctrl ^ data) & data; + uint8_t changed = (m_lcd_ctrl ^ data) & data; update_lcdc(space, changed & 0x01, changed & 0x02); m_lcd_ctrl = data; } @@ -390,7 +390,7 @@ PALETTE_INIT_MEMBER(alphasmart_state, alphasmart) palette.set_pen_color(1, rgb_t(92, 83, 88)); } -UINT32 alphasmart_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t alphasmart_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_lcdc0->screen_update(screen, *m_tmp_bitmap, cliprect); copybitmap(bitmap, *m_tmp_bitmap, 0, 0, 0, 0, cliprect); @@ -401,7 +401,7 @@ UINT32 alphasmart_state::screen_update(screen_device &screen, bitmap_ind16 &bitm void alphasmart_state::machine_start() { - UINT8* ram = m_ram->pointer(); + uint8_t* ram = m_ram->pointer(); m_rambank->configure_entries(0, 4, ram, 0x8000); m_nvram->set_base(ram, 0x8000*4); diff --git a/src/mame/drivers/alphatro.cpp b/src/mame/drivers/alphatro.cpp index d1624498c99..d98d25e5870 100644 --- a/src/mame/drivers/alphatro.cpp +++ b/src/mame/drivers/alphatro.cpp @@ -79,13 +79,13 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_c); TIMER_DEVICE_CALLBACK_MEMBER(timer_p); MC6845_UPDATE_ROW(crtc_update_row); - required_shared_ptr m_p_videoram; - UINT8 *m_p_chargen; - UINT8 m_flashcnt; + required_shared_ptr m_p_videoram; + uint8_t *m_p_chargen; + uint8_t m_flashcnt; private: - UINT8 m_timer_bit; - UINT8 m_cass_data[4]; + uint8_t m_timer_bit; + uint8_t m_cass_data[4]; bool m_cass_state; bool m_cassold; emu_timer* m_sys_timer; @@ -98,7 +98,7 @@ private: required_device m_usart; required_device m_cass; required_device m_beep; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; public: required_device m_palette; }; @@ -162,9 +162,9 @@ MC6845_UPDATE_ROW( alphatro_state::crtc_update_row ) bool palette = BIT(ioport("CONFIG")->read(), 5); if (y==0) m_flashcnt++; bool inv; - UINT8 chr,gfx,attr,bg,fg; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx,attr,bg,fg; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { @@ -191,7 +191,7 @@ MC6845_UPDATE_ROW( alphatro_state::crtc_update_row ) if (inv) { - UINT8 t = bg; + uint8_t t = bg; bg = fg; fg = t; } @@ -381,7 +381,7 @@ void alphatro_state::machine_start() void alphatro_state::machine_reset() { // do what the IPL does - UINT8* ROM = memregion("roms")->base(); + uint8_t* ROM = memregion("roms")->base(); m_maincpu->set_pc(0xe000); // If BASIC is missing then it boots into the Monitor memcpy(m_p_ram, ROM, 0x6000); // Copy BASIC to RAM @@ -434,7 +434,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(alphatro_state::timer_p) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { diff --git a/src/mame/drivers/altair.cpp b/src/mame/drivers/altair.cpp index 94c43ac759f..710f0bcd366 100644 --- a/src/mame/drivers/altair.cpp +++ b/src/mame/drivers/altair.cpp @@ -50,7 +50,7 @@ protected: private: required_device m_maincpu; required_device m_mc6850; - required_shared_ptr m_ram; + required_shared_ptr m_ram; }; diff --git a/src/mame/drivers/altos486.cpp b/src/mame/drivers/altos486.cpp index 60589ecde69..c2e132aec05 100644 --- a/src/mame/drivers/altos486.cpp +++ b/src/mame/drivers/altos486.cpp @@ -25,7 +25,7 @@ public: { } required_device m_maincpu; - required_shared_ptr m_ram; + required_shared_ptr m_ram; required_memory_region m_rom; DECLARE_READ8_MEMBER(read_rmx_ack); @@ -37,8 +37,8 @@ public: DECLARE_FLOPPY_FORMATS(floppy_formats); bool m_sys_mode; - UINT8 m_prot[256]; - UINT16 m_viol[16]; + uint8_t m_prot[256]; + uint16_t m_viol[16]; }; READ8_MEMBER(altos486_state::read_rmx_ack) @@ -71,7 +71,7 @@ READ16_MEMBER(altos486_state::mmu_io_r) WRITE16_MEMBER(altos486_state::mmu_ram_w) { - //UINT16 entry = m_prot[offset >> 11]; + //uint16_t entry = m_prot[offset >> 11]; //if(!m_sys_mode) } diff --git a/src/mame/drivers/altos5.cpp b/src/mame/drivers/altos5.cpp index 4fa1f75f2d0..5930715bfcf 100644 --- a/src/mame/drivers/altos5.cpp +++ b/src/mame/drivers/altos5.cpp @@ -53,14 +53,14 @@ public: DECLARE_WRITE_LINE_MEMBER(clock_w); private: - UINT8 m_port08; - UINT8 m_port09; - UINT8 *m_p_prom; + uint8_t m_port08; + uint8_t m_port09; + uint8_t *m_p_prom; bool m_ipl; offs_t m_curr_bank; floppy_image_device *m_floppy; - UINT8 convert(offs_t offset, bool state); - void setup_banks(UINT8 source); + uint8_t convert(offs_t offset, bool state); + void setup_banks(uint8_t source); virtual void machine_reset() override; required_device m_maincpu; required_device m_pio0; @@ -111,9 +111,9 @@ ADDRESS_MAP_END static INPUT_PORTS_START( altos5 ) INPUT_PORTS_END -UINT8 altos5_state::convert(offs_t offset, bool state) +uint8_t altos5_state::convert(offs_t offset, bool state) { - UINT8 data = m_p_prom[offset]; + uint8_t data = m_p_prom[offset]; // if IPL and /A12, point at rom if (!state && m_ipl && !BIT(offset, 0)) @@ -128,7 +128,7 @@ UINT8 altos5_state::convert(offs_t offset, bool state) return data & 0x3f; } -void altos5_state::setup_banks(UINT8 source) +void altos5_state::setup_banks(uint8_t source) { offs_t offs,temp; // WPRT | template | dma bank / cpu bank @@ -267,9 +267,9 @@ d7: IRQ from FDC */ READ8_MEMBER( altos5_state::port08_r ) { - UINT8 data = m_port08 | 0x87; + uint8_t data = m_port08 | 0x87; if (m_floppy) - data |= ((UINT8)m_floppy->twosid_r() << 3); // get number of sides + data |= ((uint8_t)m_floppy->twosid_r() << 3); // get number of sides return data; } @@ -324,7 +324,7 @@ SLOT_INTERFACE_END WRITE_LINE_MEMBER( altos5_state::fdc_intrq_w ) { - UINT8 data = m_port08 | ((UINT8)(state) << 7); + uint8_t data = m_port08 | ((uint8_t)(state) << 7); m_pio0->port_a_write(data); } @@ -332,7 +332,7 @@ DRIVER_INIT_MEMBER( altos5_state, altos5 ) { m_p_prom = memregion("proms")->base(); - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("bankr0")->configure_entries(0, 50, &RAM[0], 0x1000); membank("bankr1")->configure_entries(0, 50, &RAM[0], 0x1000); diff --git a/src/mame/drivers/amaticmg.cpp b/src/mame/drivers/amaticmg.cpp index 4fb5c60b078..be832f8c9cf 100644 --- a/src/mame/drivers/amaticmg.cpp +++ b/src/mame/drivers/amaticmg.cpp @@ -437,14 +437,14 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_attr; - required_shared_ptr m_vram; + required_shared_ptr m_attr; + required_shared_ptr m_vram; DECLARE_WRITE8_MEMBER(rombank_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); DECLARE_WRITE8_MEMBER(unk80_w); - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(out_a_w); DECLARE_WRITE8_MEMBER(out_c_w); DECLARE_DRIVER_INIT(ama8000_3_o); @@ -456,10 +456,10 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(amaticmg); DECLARE_PALETTE_INIT(amaticmg2); - UINT32 screen_update_amaticmg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_amaticmg2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_amaticmg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_amaticmg2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(amaticmg2_irq); - void encf(UINT8 ciphertext, int address, UINT8 &plaintext, int &newaddress); + void encf(uint8_t ciphertext, int address, uint8_t &plaintext, int &newaddress); void decrypt(int key1, int key2); required_device m_maincpu; required_device m_gfxdecode; @@ -475,7 +475,7 @@ void amaticmg_state::video_start() { } -UINT32 amaticmg_state::screen_update_amaticmg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t amaticmg_state::screen_update_amaticmg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int y,x; @@ -485,8 +485,8 @@ UINT32 amaticmg_state::screen_update_amaticmg(screen_device &screen, bitmap_ind1 { for (x=0;x<96;x++) { - UINT16 tile = m_vram[count]; - UINT8 color; + uint16_t tile = m_vram[count]; + uint8_t color; tile += ((m_attr[count]&0x0f)<<8); /* TODO: this looks so out of place ... */ @@ -500,7 +500,7 @@ UINT32 amaticmg_state::screen_update_amaticmg(screen_device &screen, bitmap_ind1 return 0; } -UINT32 amaticmg_state::screen_update_amaticmg2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t amaticmg_state::screen_update_amaticmg2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int y,x; @@ -510,8 +510,8 @@ UINT32 amaticmg_state::screen_update_amaticmg2(screen_device &screen, bitmap_ind { for (x=0;x<96;x++) { - UINT16 tile = m_vram[count]; - UINT8 color; + uint16_t tile = m_vram[count]; + uint8_t color; tile += ((m_attr[count]&0xff)<<8); color = 0; @@ -526,7 +526,7 @@ UINT32 amaticmg_state::screen_update_amaticmg2(screen_device &screen, bitmap_ind PALETTE_INIT_MEMBER(amaticmg_state, amaticmg) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit0, bit1, bit2 , r, g, b; int i; @@ -553,7 +553,7 @@ PALETTE_INIT_MEMBER(amaticmg_state, amaticmg) PALETTE_INIT_MEMBER(amaticmg_state,amaticmg2) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int r, g, b; int i; @@ -801,7 +801,7 @@ GFXDECODE_END void amaticmg_state::machine_start() { - UINT8 *rombank = memregion("maincpu")->base(); + uint8_t *rombank = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0x10, &rombank[0x8000], 0x4000); } @@ -1048,12 +1048,12 @@ ROM_END * Driver Initialization * ************************************/ -void amaticmg_state::encf(UINT8 ciphertext, int address, UINT8 &plaintext, int &newaddress) +void amaticmg_state::encf(uint8_t ciphertext, int address, uint8_t &plaintext, int &newaddress) { int aux = address & 0xfff; aux = aux ^ (aux>>6); aux = ((aux<<6) | (aux>>6)) & 0xfff; - UINT8 aux2 = BITSWAP8(aux, 9,10,4,1,6,0,7,3); + uint8_t aux2 = BITSWAP8(aux, 9,10,4,1,6,0,7,3); aux2 ^= aux2>>4; aux2 = (aux2<<4) | (aux2>>4); ciphertext ^= ciphertext<<4; @@ -1064,11 +1064,11 @@ void amaticmg_state::encf(UINT8 ciphertext, int address, UINT8 &plaintext, int & void amaticmg_state::decrypt(int key1, int key2) { - UINT8 plaintext; + uint8_t plaintext; int newaddress; - UINT8 *src = memregion("mainprg")->base(); - UINT8 *dest = memregion("maincpu")->base(); + uint8_t *src = memregion("mainprg")->base(); + uint8_t *dest = memregion("maincpu")->base(); int len = memregion("mainprg")->bytes(); for (int i = 0; i < len; i++) diff --git a/src/mame/drivers/amazonlf.cpp b/src/mame/drivers/amazonlf.cpp index 5a5b170fb08..c5273db0d7d 100644 --- a/src/mame/drivers/amazonlf.cpp +++ b/src/mame/drivers/amazonlf.cpp @@ -26,7 +26,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_amazonlf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_amazonlf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_amazonlf(screen_device &screen, bool state); }; @@ -42,7 +42,7 @@ void amazonlf_state::machine_reset() { } -UINT32 amazonlf_state::screen_update_amazonlf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t amazonlf_state::screen_update_amazonlf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/amico2k.cpp b/src/mame/drivers/amico2k.cpp index 0bb1952d8a3..10c4f59a0ec 100644 --- a/src/mame/drivers/amico2k.cpp +++ b/src/mame/drivers/amico2k.cpp @@ -51,7 +51,7 @@ public: DECLARE_WRITE8_MEMBER( ppi_pb_w ); int m_ls145_p; - UINT8 m_segment; + uint8_t m_segment; // timers emu_timer *m_led_refresh_timer; diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index 308071d5dc4..e60f4298d8d 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -50,7 +50,7 @@ protected: private: required_device m_bootrom; required_memory_bank m_wom; - std::vector m_wom_ram; + std::vector m_wom_ram; }; class a2000_state : public amiga_state @@ -237,7 +237,7 @@ public: DECLARE_DRIVER_INIT( pal ); DECLARE_DRIVER_INIT( ntsc ); - static const UINT8 GAYLE_ID = 0xd0; + static const uint8_t GAYLE_ID = 0xd0; protected: virtual bool int2_pending() override; @@ -259,7 +259,7 @@ public: DECLARE_DRIVER_INIT( pal ); DECLARE_DRIVER_INIT( ntsc ); - static const UINT8 GAYLE_ID = 0xd1; + static const uint8_t GAYLE_ID = 0xd1; protected: virtual bool int2_pending() override; @@ -315,8 +315,8 @@ public: DECLARE_WRITE8_MEMBER( akiko_cia_0_port_a_write ); - void handle_joystick_cia(UINT8 pra, UINT8 dra); - UINT16 handle_joystick_potgor(UINT16 potgor); + void handle_joystick_cia(uint8_t pra, uint8_t dra); + uint16_t handle_joystick_potgor(uint16_t potgor); DECLARE_CUSTOM_INPUT_MEMBER( cd32_input ); DECLARE_CUSTOM_INPUT_MEMBER( cd32_sel_mirror_input ); @@ -328,11 +328,11 @@ public: int m_oldstate[2]; int m_cd32_shifter[2]; - UINT16 m_potgo_value; + uint16_t m_potgo_value; protected: // amiga_state overrides - virtual void potgo_w(UINT16 data) override; + virtual void potgo_w(uint16_t data) override; private: required_device m_cdda; @@ -664,7 +664,7 @@ bool cdtv_state::int6_pending() READ32_MEMBER( a3000_state::scsi_r ) { - UINT32 data = 0xffffffff; + uint32_t data = 0xffffffff; logerror("scsi_r(%06x): %08x & %08x\n", offset, data, mem_mask); return data; } @@ -676,7 +676,7 @@ WRITE32_MEMBER( a3000_state::scsi_w ) READ32_MEMBER( a3000_state::motherboard_r ) { - UINT32 data = 0xffffffff; + uint32_t data = 0xffffffff; logerror("motherboard_r(%06x): %08x & %08x\n", offset, data, mem_mask); return data; } @@ -729,7 +729,7 @@ WRITE_LINE_MEMBER( a1200_state::gayle_int2_w ) READ32_MEMBER( a4000_state::scsi_r ) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; logerror("scsi_r(%06x): %08x & %08x\n", offset, data, mem_mask); return data; } @@ -741,7 +741,7 @@ WRITE32_MEMBER( a4000_state::scsi_w ) READ16_MEMBER( a4000_state::ide_r ) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; // ide interrupt register if (offset == 0x1010) @@ -786,7 +786,7 @@ WRITE_LINE_MEMBER( a4000_state::ide_interrupt_w ) READ32_MEMBER( a4000_state::motherboard_r ) { - UINT32 data = 0; + uint32_t data = 0; if (offset == 0) { @@ -824,7 +824,7 @@ WRITE32_MEMBER( a4000_state::motherboard_w ) logerror("motherboard_w(%06x): %08x & %08x\n", offset, data, mem_mask); } -void cd32_state::potgo_w(UINT16 data) +void cd32_state::potgo_w(uint16_t data) { int i; @@ -833,30 +833,30 @@ void cd32_state::potgo_w(UINT16 data) for (i = 0; i < 8; i += 2) { - UINT16 dir = 0x0200 << i; + uint16_t dir = 0x0200 << i; if (data & dir) { - UINT16 d = 0x0100 << i; + uint16_t d = 0x0100 << i; m_potgo_value &= ~d; m_potgo_value |= data & d; } } for (i = 0; i < 2; i++) { - UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */ - UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */ + uint16_t p5dir = 0x0200 << (i * 4); /* output enable P5 */ + uint16_t p5dat = 0x0100 << (i * 4); /* data P5 */ if ((m_potgo_value & p5dir) && (m_potgo_value & p5dat)) m_cd32_shifter[i] = 8; } } -void cd32_state::handle_joystick_cia(UINT8 pra, UINT8 dra) +void cd32_state::handle_joystick_cia(uint8_t pra, uint8_t dra) { for (int i = 0; i < 2; i++) { - UINT8 but = 0x40 << i; - UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */ - UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */ + uint8_t but = 0x40 << i; + uint16_t p5dir = 0x0200 << (i * 4); /* output enable P5 */ + uint16_t p5dat = 0x0100 << (i * 4); /* data P5 */ if (!(m_potgo_value & p5dir) || !(m_potgo_value & p5dat)) { @@ -874,14 +874,14 @@ void cd32_state::handle_joystick_cia(UINT8 pra, UINT8 dra) } } -UINT16 cd32_state::handle_joystick_potgor(UINT16 potgor) +uint16_t cd32_state::handle_joystick_potgor(uint16_t potgor) { for (int i = 0; i < 2; i++) { - UINT16 p9dir = 0x0800 << (i * 4); /* output enable P9 */ - UINT16 p9dat = 0x0400 << (i * 4); /* data P9 */ - UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */ - UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */ + uint16_t p9dir = 0x0800 << (i * 4); /* output enable P9 */ + uint16_t p9dat = 0x0400 << (i * 4); /* data P9 */ + uint16_t p5dir = 0x0200 << (i * 4); /* output enable P5 */ + uint16_t p5dat = 0x0100 << (i * 4); /* data P5 */ /* p5 is floating in input-mode */ potgor &= ~p5dat; @@ -907,7 +907,7 @@ CUSTOM_INPUT_MEMBER( cd32_state::cd32_input ) CUSTOM_INPUT_MEMBER( cd32_state::cd32_sel_mirror_input ) { - UINT8 bits = m_player_ports[(int)(uintptr_t)param]->read(); + uint8_t bits = m_player_ports[(int)(uintptr_t)param]->read(); return (bits & 0x20)>>5; } diff --git a/src/mame/drivers/ampoker2.cpp b/src/mame/drivers/ampoker2.cpp index bc56ff7429d..54c31aec2d2 100644 --- a/src/mame/drivers/ampoker2.cpp +++ b/src/mame/drivers/ampoker2.cpp @@ -1373,12 +1373,12 @@ ROM_END DRIVER_INIT_MEMBER(ampoker2_state, rabbitpk) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); int start = 0; int i; - UINT8 dec_base[32] = + uint8_t dec_base[32] = { 0x00, 0x43, 0x45, 0x06, 0xc3, 0x80, 0x86, 0xc5, 0x84, 0xc7, 0xc1, 0x82, 0x47, 0x04, 0x02, 0x41, @@ -1425,7 +1425,7 @@ DRIVER_INIT_MEMBER(ampoker2_state, piccolop) */ - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // NOP'ing the mortal jump... rom[0x154b] = 0x00; diff --git a/src/mame/drivers/ampro.cpp b/src/mame/drivers/ampro.cpp index 858bfff9115..1873fff2807 100644 --- a/src/mame/drivers/ampro.cpp +++ b/src/mame/drivers/ampro.cpp @@ -149,7 +149,7 @@ MACHINE_RESET_MEMBER( ampro_state, ampro ) DRIVER_INIT_MEMBER( ampro_state, ampro ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x10000]); diff --git a/src/mame/drivers/amspdwy.cpp b/src/mame/drivers/amspdwy.cpp index 5609c40ad8a..750cee42f04 100644 --- a/src/mame/drivers/amspdwy.cpp +++ b/src/mame/drivers/amspdwy.cpp @@ -35,10 +35,10 @@ Sound: YM2151 Or last value when wheel delta = 0 */ -UINT8 amspdwy_state::amspdwy_wheel_r( int index ) +uint8_t amspdwy_state::amspdwy_wheel_r( int index ) { static const char *const portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" }; - UINT8 wheel = ioport(portnames[2 + index])->read(); + uint8_t wheel = ioport(portnames[2 + index])->read(); if (wheel != m_wheel_old[index]) { wheel = (wheel & 0x7fff) - (wheel & 0x8000); diff --git a/src/mame/drivers/amstr_pc.cpp b/src/mame/drivers/amstr_pc.cpp index 613b1717bb9..b0fc7a62038 100644 --- a/src/mame/drivers/amstr_pc.cpp +++ b/src/mame/drivers/amstr_pc.cpp @@ -72,14 +72,14 @@ public: DECLARE_READ8_MEMBER( pc1640_port278_r ); struct { - UINT8 x,y; //byte clipping needed + uint8_t x,y; //byte clipping needed } m_mouse; // 64 system status register? - UINT8 m_port60; - UINT8 m_port61; - UINT8 m_port62; - UINT8 m_port65; + uint8_t m_port60; + uint8_t m_port61; + uint8_t m_port62; + uint8_t m_port65; int m_dipstate; }; @@ -290,7 +290,7 @@ READ8_MEMBER( amstrad_pc_state::pc1640_port60_r ) READ8_MEMBER( amstrad_pc_state::pc200_port378_r ) { - UINT8 data = m_lpt1->read(space, offset); + uint8_t data = m_lpt1->read(space, offset); if (offset == 1) data = (data & ~7) | (ioport("DSW0")->read() & 7); @@ -302,7 +302,7 @@ READ8_MEMBER( amstrad_pc_state::pc200_port378_r ) READ8_MEMBER( amstrad_pc_state::pc200_port278_r ) { - UINT8 data = m_lpt2->read(space, offset); + uint8_t data = m_lpt2->read(space, offset); if (offset == 1) data = (data & ~7) | (ioport("DSW0")->read() & 7); @@ -315,7 +315,7 @@ READ8_MEMBER( amstrad_pc_state::pc200_port278_r ) READ8_MEMBER( amstrad_pc_state::pc1640_port378_r ) { - UINT8 data = m_lpt1->read(space, offset); + uint8_t data = m_lpt1->read(space, offset); if (offset == 1) data=(data & ~7) | (ioport("DSW0")->read() & 7); diff --git a/src/mame/drivers/amusco.cpp b/src/mame/drivers/amusco.cpp index 0eb226243de..081b80008f8 100644 --- a/src/mame/drivers/amusco.cpp +++ b/src/mame/drivers/amusco.cpp @@ -102,7 +102,7 @@ public: m_screen(*this, "screen") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; @@ -129,9 +129,9 @@ public: required_device m_rtc; required_device m_crtc; required_device m_screen; - UINT8 m_mc6845_address; - UINT16 m_video_update_address; - UINT8 m_rtc_data; + uint8_t m_mc6845_address; + uint16_t m_video_update_address; + uint8_t m_rtc_data; }; diff --git a/src/mame/drivers/amust.cpp b/src/mame/drivers/amust.cpp index 292f5b03df6..715a3fbc4c3 100644 --- a/src/mame/drivers/amust.cpp +++ b/src/mame/drivers/amust.cpp @@ -127,15 +127,15 @@ public: DECLARE_WRITE8_MEMBER(kbd_put); INTERRUPT_GEN_MEMBER(irq_vs); MC6845_UPDATE_ROW(crtc_update_row); - UINT8 *m_p_videoram; - const UINT8 *m_p_chargen; + uint8_t *m_p_videoram; + const uint8_t *m_p_chargen; required_device m_palette; private: - UINT8 m_port04; - UINT8 m_port06; - UINT8 m_port08; - UINT8 m_port0a; - UINT8 m_term_data; + uint8_t m_port04; + uint8_t m_port06; + uint8_t m_port08; + uint8_t m_port0a; + uint8_t m_term_data; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; required_device m_maincpu; required_device m_beep; @@ -213,7 +213,7 @@ INPUT_PORTS_END READ8_MEMBER( amust_state::port00_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -307,7 +307,7 @@ WRITE8_MEMBER( amust_state::port0a_w ) WRITE8_MEMBER( amust_state::port0d_w ) { - UINT16 video_address = m_port08 | ((m_port0a & 7) << 8); + uint16_t video_address = m_port08 | ((m_port0a & 7) << 8); m_p_videoram[video_address] = data; } @@ -337,9 +337,9 @@ GFXDECODE_END MC6845_UPDATE_ROW( amust_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx,inv; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx,inv; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { @@ -381,7 +381,7 @@ MACHINE_RESET_MEMBER( amust_state, amust ) DRIVER_INIT_MEMBER( amust_state, amust ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0xf800]); membank("bankr0")->configure_entry(0, &main[0x10800]); diff --git a/src/mame/drivers/angelkds.cpp b/src/mame/drivers/angelkds.cpp index cff59cbc908..a3c9500c2e5 100644 --- a/src/mame/drivers/angelkds.cpp +++ b/src/mame/drivers/angelkds.cpp @@ -674,7 +674,7 @@ ROM_END DRIVER_INIT_MEMBER(angelkds_state,angelkds) { - UINT8 *RAM = memregion("user1")->base(); + uint8_t *RAM = memregion("user1")->base(); membank("bank1")->configure_entries(0, 16, &RAM[0x0000], 0x4000); } diff --git a/src/mame/drivers/anzterm.cpp b/src/mame/drivers/anzterm.cpp index bb948672784..eb9a00a7a60 100644 --- a/src/mame/drivers/anzterm.cpp +++ b/src/mame/drivers/anzterm.cpp @@ -362,7 +362,7 @@ public: { } - 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) { return 0; } diff --git a/src/mame/drivers/apc.cpp b/src/mame/drivers/apc.cpp index b19e032034c..a103be3142e 100644 --- a/src/mame/drivers/apc.cpp +++ b/src/mame/drivers/apc.cpp @@ -96,16 +96,16 @@ public: required_device m_fdc; required_device m_dmac; required_device m_pit; - UINT8 *m_char_rom; - UINT8 *m_aux_pcg; + uint8_t *m_char_rom; + uint8_t *m_aux_pcg; - required_shared_ptr m_video_ram_1; - required_shared_ptr m_video_ram_2; + required_shared_ptr m_video_ram_1; + required_shared_ptr m_video_ram_2; required_device m_palette; // screen updates - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(apc_port_28_r); @@ -124,10 +124,10 @@ public: // DECLARE_WRITE8_MEMBER(aux_pcg_w); struct { - UINT8 status; //status - UINT8 data; //key data - UINT8 sig; //switch signal port - UINT8 sh; //shift switches + uint8_t status; //status + uint8_t data; //key data + uint8_t sig; //switch signal port + uint8_t sh; //shift switches }m_keyb; DECLARE_INPUT_CHANGED_MEMBER(key_stroke); @@ -146,7 +146,7 @@ public: DECLARE_DRIVER_INIT(apc); int m_dack; - UINT8 m_dma_offset[4]; + uint8_t m_dma_offset[4]; UPD7220_DISPLAY_PIXELS_MEMBER( hgdc_display_pixels ); UPD7220_DRAW_TEXT_LINE_MEMBER( hgdc_draw_text ); @@ -166,7 +166,7 @@ void apc_state::video_start() m_aux_pcg = memregion("aux_pcg")->base(); } -UINT32 apc_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t apc_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -188,8 +188,8 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( apc_state::hgdc_draw_text ) const rgb_t *palette = m_palette->palette()->entry_list_raw(); int xi,yi,yi_trans; int x; - UINT8 char_size; -// UINT8 interlace_on; + uint8_t char_size; +// uint8_t interlace_on; // if(m_video_ff[DISPLAY_REG] == 0) //screen is off // return; @@ -199,12 +199,12 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( apc_state::hgdc_draw_text ) for(x=0;xread(space, (offset & 6) >> 1); @@ -317,7 +317,7 @@ WRITE8_MEMBER(apc_state::apc_port_28_w) READ8_MEMBER(apc_state::apc_gdc_r) { - UINT8 res; + uint8_t res; if(offset & 1) res = m_hgdc2->read(space, (offset & 2) >> 1); // upd7220 bitmap port @@ -337,7 +337,7 @@ WRITE8_MEMBER(apc_state::apc_gdc_w) READ8_MEMBER(apc_state::apc_kbd_r) { - UINT8 res = 0; + uint8_t res = 0; switch(offset & 3) { @@ -500,7 +500,7 @@ INPUT_CHANGED_MEMBER(apc_state::key_stroke) { if(newval && !oldval) { - m_keyb.data = (UINT8)(uintptr_t)(param) & 0xff; + m_keyb.data = (uint8_t)(uintptr_t)(param) & 0xff; //m_keyb.status &= ~1; machine().device("pic8259_master")->ir4_w(1); } diff --git a/src/mame/drivers/apexc.cpp b/src/mame/drivers/apexc.cpp index 1a7960380f9..599b5747a8c 100644 --- a/src/mame/drivers/apexc.cpp +++ b/src/mame/drivers/apexc.cpp @@ -22,13 +22,13 @@ public: m_palette(*this, "palette"), m_screen(*this, "screen") { } - UINT32 m_panel_data_reg; /* value of a data register on the control panel which can + uint32_t m_panel_data_reg; /* value of a data register on the control panel which can be edited - the existence of this register is a personnal guess */ std::unique_ptr m_bitmap; - UINT32 m_old_edit_keys; + uint32_t m_old_edit_keys; int m_old_control_keys; int m_letters; @@ -37,7 +37,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(apexc); - UINT32 screen_update_apexc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_apexc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(apexc_interrupt); DECLARE_READ8_MEMBER(tape_read); DECLARE_WRITE8_MEMBER(tape_write); @@ -74,7 +74,7 @@ class apexc_cylinder_image_device : public device_t, public device_image_interfa { public: // construction/destruction - apexc_cylinder_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apexc_cylinder_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_CYLINDER; } @@ -98,7 +98,7 @@ private: const device_type APEXC_CYLINDER = &device_creator; -apexc_cylinder_image_device::apexc_cylinder_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apexc_cylinder_image_device::apexc_cylinder_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APEXC_CYLINDER, "APEXC Cylinder", tag, owner, clock, "apexc_cylinder_image", __FILE__), device_image_interface(mconfig, *this) { @@ -115,7 +115,7 @@ image_init_result apexc_cylinder_image_device::call_load() fread( machine().root_device().memregion("maincpu")->base(), 0x1000); #ifdef LSB_FIRST { /* fix endianness */ - UINT32 *RAM = (UINT32 *)(machine().root_device().memregion("maincpu")->base()); + uint32_t *RAM = (uint32_t *)(machine().root_device().memregion("maincpu")->base()); for (int i=0; i < 0x0400; i++) RAM[i] = big_endianize_int32(RAM[i]); @@ -136,7 +136,7 @@ void apexc_cylinder_image_device::call_unload() fseek(0, SEEK_SET); #ifdef LSB_FIRST { /* fix endianness */ - UINT32 *RAM = (UINT32 *)(machine().root_device().memregion("maincpu")->base()); + uint32_t *RAM = (uint32_t *)(machine().root_device().memregion("maincpu")->base()); for (int i=0; i < /*0x2000*/0x0400; i++) RAM[i] = big_endianize_int32(RAM[i]); @@ -201,7 +201,7 @@ class apexc_tape_puncher_image_device : public device_t, public device_image_int { public: // construction/destruction - apexc_tape_puncher_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apexc_tape_puncher_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_PUNCHTAPE; } @@ -220,7 +220,7 @@ protected: const device_type APEXC_TAPE_PUNCHER = &device_creator; -apexc_tape_puncher_image_device::apexc_tape_puncher_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apexc_tape_puncher_image_device::apexc_tape_puncher_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APEXC_TAPE_PUNCHER, "APEXC Tape Puncher", tag, owner, clock, "apexc_tape_puncher_image", __FILE__), device_image_interface(mconfig, *this) { @@ -233,7 +233,7 @@ class apexc_tape_reader_image_device : public device_t, public device_image_int { public: // construction/destruction - apexc_tape_reader_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apexc_tape_reader_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_PUNCHTAPE; } @@ -252,7 +252,7 @@ protected: const device_type APEXC_TAPE_READER = &device_creator; -apexc_tape_reader_image_device::apexc_tape_reader_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +apexc_tape_reader_image_device::apexc_tape_reader_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, APEXC_TAPE_READER, "APEXC Tape Reader", tag, owner, clock, "apexc_tape_reader_image", __FILE__), device_image_interface(mconfig, *this) { @@ -268,7 +268,7 @@ apexc_tape_reader_image_device::apexc_tape_reader_image_device(const machine_con READ8_MEMBER(apexc_state::tape_read) { device_t *device = machine().device("tape_reader"); - UINT8 reply; + uint8_t reply; device_image_interface *image = dynamic_cast(device); if (image->exists() && (image->fread(& reply, 1) == 1)) @@ -280,7 +280,7 @@ READ8_MEMBER(apexc_state::tape_read) WRITE8_MEMBER(apexc_state::tape_write) { device_t *device = machine().device("tape_puncher"); - UINT8 data5 = (data & 0x1f); + uint8_t data5 = (data & 0x1f); device_image_interface *image = dynamic_cast(device); if (image->exists()) @@ -402,7 +402,7 @@ INPUT_PORTS_END INTERRUPT_GEN_MEMBER(apexc_state::apexc_interrupt) { address_space& space = m_maincpu->space(AS_PROGRAM); - UINT32 edit_keys; + uint32_t edit_keys; int control_keys; int control_transitions; @@ -596,7 +596,7 @@ void apexc_state::apexc_draw_string(bitmap_ind16 &bitmap, const char *buf, int x } -UINT32 apexc_state::screen_update_apexc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t apexc_state::screen_update_apexc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i; char the_char; @@ -635,7 +635,7 @@ void apexc_state::apexc_teletyper_init() void apexc_state::apexc_teletyper_linefeed() { - UINT8 buf[teletyper_window_width]; + uint8_t buf[teletyper_window_width]; int y; for (y=teletyper_window_offset_y; y m_floppy1; required_ioport_array<4> m_joy; optional_ioport_array<8> m_key; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; }; @@ -156,17 +156,17 @@ READ8_MEMBER( apf_state::videoram_r ) if (BIT(m_pad_data, 6) && m_has_cart_ram) offset -= 0x120; - UINT16 part1 = offset & 0x1f; - UINT16 part2 = (offset & 0x1e0) >> 5; - UINT16 part3 = (offset & 0x1e00) >> 4; + uint16_t part1 = offset & 0x1f; + uint16_t part2 = (offset & 0x1e0) >> 5; + uint16_t part3 = (offset & 0x1e00) >> 4; if (m_ca2) m_latch = m_p_videoram[part3 | part1]; // get chr m_crtc->css_w(BIT(m_latch, 6)); - UINT16 latch = (m_latch & 0x1f) << 4; + uint16_t latch = (m_latch & 0x1f) << 4; return m_p_videoram[latch | part2 | 0x200]; // get gfx } else { - UINT8 data = m_p_videoram[(offset & 0x1ff) | 0x200]; + uint8_t data = m_p_videoram[(offset & 0x1ff) | 0x200]; if (m_ca2) m_crtc->css_w(BIT(data, 6)); m_crtc->inv_w(BIT(data, 6)); m_crtc->as_w(BIT(data, 7)); @@ -176,7 +176,7 @@ READ8_MEMBER( apf_state::videoram_r ) READ8_MEMBER( apf_state::pia0_porta_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 3; i >= 0; i--) if (!BIT(m_pad_data, i)) @@ -207,7 +207,7 @@ READ8_MEMBER( apf_state::pia1_porta_r ) READ8_MEMBER( apf_state::pia1_portb_r ) { - UINT8 data = m_portb; + uint8_t data = m_portb; if (m_cass->input() > 0.0038) data |= 0x80; @@ -277,7 +277,7 @@ void apf_state::machine_reset() WRITE8_MEMBER( apf_state::apf_dischw_w) { /* bit 3 is index of drive to select */ - UINT8 drive = BIT(data, 3); + uint8_t drive = BIT(data, 3); floppy_image_device *floppy = nullptr; if (drive) diff --git a/src/mame/drivers/apogee.cpp b/src/mame/drivers/apogee.cpp index fec2d5608fe..dce85b753b8 100644 --- a/src/mame/drivers/apogee.cpp +++ b/src/mame/drivers/apogee.cpp @@ -27,9 +27,9 @@ public: : radio86_state(mconfig, type, tag), m_speaker(*this, "speaker") { } - UINT8 m_out0; - UINT8 m_out1; - UINT8 m_out2; + uint8_t m_out0; + uint8_t m_out1; + uint8_t m_out2; DECLARE_WRITE_LINE_MEMBER(pit8253_out0_changed); DECLARE_WRITE_LINE_MEMBER(pit8253_out1_changed); DECLARE_WRITE_LINE_MEMBER(pit8253_out2_changed); @@ -144,7 +144,7 @@ static INPUT_PORTS_START( apogee ) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Rus/Lat") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT) INPUT_PORTS_END -static const INT16 speaker_levels[] = {-32767, -10922, 10922, 32767}; +static const int16_t speaker_levels[] = {-32767, -10922, 10922, 32767}; WRITE_LINE_MEMBER(apogee_state::pit8253_out0_changed) { @@ -168,8 +168,8 @@ I8275_DRAW_CHARACTER_MEMBER(apogee_state::display_pixels) { int i; const rgb_t *palette = m_palette->palette()->entry_list_raw(); - const UINT8 *charmap = m_charmap + (gpa & 1) * 0x400; - UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; + const uint8_t *charmap = m_charmap + (gpa & 1) * 0x400; + uint8_t pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; if(linecount == 8) pixels = 0; if (vsp) { diff --git a/src/mame/drivers/apollo.cpp b/src/mame/drivers/apollo.cpp index 1ea7243a613..cf9440d09e7 100644 --- a/src/mame/drivers/apollo.cpp +++ b/src/mame/drivers/apollo.cpp @@ -97,27 +97,27 @@ #define DEFAULT_NODE_ID 0x12345 -static UINT8 cache_control_register = 0x00; -static UINT8 cache_status_register = 0xff; -static UINT8 task_alias_register = 0x00; +static uint8_t cache_control_register = 0x00; +static uint8_t cache_status_register = 0xff; +static uint8_t task_alias_register = 0x00; static offs_t parity_error_offset = 0; -static UINT16 parity_error_byte_mask = 0; +static uint16_t parity_error_byte_mask = 0; static int parity_error_handler_is_installed = 0; static int parity_error_handler_install_counter = 0; -static UINT16 latch_page_on_parity_error_register = 0x0000; -static UINT16 master_req_register = 0x0000; +static uint16_t latch_page_on_parity_error_register = 0x0000; +static uint16_t master_req_register = 0x0000; -static UINT32 ram_base_address; -static UINT32 ram_end_address; +static uint32_t ram_base_address; +static uint32_t ram_end_address; static int node_type; // FIXME: value of ram_config_byte must match with default/selected RAM size -static UINT8 ram_config_byte; +static uint8_t ram_config_byte; -static UINT32 log_line_counter = 0; +static uint32_t log_line_counter = 0; /*************************************************************************** cpu_context - return a string describing which CPU is currently executing and their PC @@ -201,7 +201,7 @@ int apollo_is_dsp3x00(void) { apollo_get_ram_config_byte - get the ram configuration byte ***************************************************************************/ -UINT8 apollo_get_ram_config_byte(void) { +uint8_t apollo_get_ram_config_byte(void) { return ram_config_byte; } @@ -211,13 +211,13 @@ UINT8 apollo_get_ram_config_byte(void) { ***************************************************************************/ READ32_MEMBER(apollo_state::apollo_instruction_hook) { - static UINT16 idle_counter = 0; + static uint16_t idle_counter = 0; // m_maincpu->ir still has previous instruction - UINT16 last_ir = m_maincpu->ir; + uint16_t last_ir = m_maincpu->ir; // get next instruction (or 0 if unavailable) - UINT16 next_ir = (m_maincpu->pref_addr == REG_PC(m_maincpu)) ? m_maincpu->pref_data : 0; + uint16_t next_ir = (m_maincpu->pref_addr == REG_PC(m_maincpu)) ? m_maincpu->pref_data : 0; // check for NULLPROC: // 027C F8FF AND.W #F8FF,SR @@ -301,7 +301,7 @@ WRITE8_MEMBER(apollo_state::cache_control_register_w){ } READ8_MEMBER(apollo_state::cache_status_register_r){ - UINT8 data = cache_status_register; + uint8_t data = cache_status_register; if (apollo_is_dn5500()) { #define DN5500_CSR_NOT_HSI_PRESENT 8 @@ -313,8 +313,8 @@ READ8_MEMBER(apollo_state::cache_status_register_r){ return data; } -void apollo_set_cache_status_register(device_t *device,UINT8 mask, UINT8 data) { - UINT16 new_value = (cache_status_register & ~mask) | (data & mask); +void apollo_set_cache_status_register(device_t *device,uint8_t mask, uint8_t data) { + uint16_t new_value = (cache_status_register & ~mask) | (data & mask); if (new_value != cache_status_register) { cache_status_register = new_value; DLOG2(("setting Cache Status Register with data=%02x and mask=%02x to %02x", @@ -333,7 +333,7 @@ WRITE8_MEMBER(apollo_state::task_alias_register_w){ } READ8_MEMBER(apollo_state::task_alias_register_r){ - UINT8 data = 0xff; + uint8_t data = 0xff; SLOG(("reading Task Alias Register at offset %02x = %02x", offset, data)); return data; } @@ -348,7 +348,7 @@ WRITE16_MEMBER(apollo_state::latch_page_on_parity_error_register_w){ } READ16_MEMBER(apollo_state::latch_page_on_parity_error_register_r){ - UINT16 data = latch_page_on_parity_error_register; + uint16_t data = latch_page_on_parity_error_register; SLOG2(("reading Latch Page on Error Parity Register at offset %02x = %04x", offset*2, data)); return data; } @@ -363,7 +363,7 @@ WRITE8_MEMBER(apollo_state::master_req_register_w){ } READ8_MEMBER(apollo_state::master_req_register_r){ - UINT8 data = 0xff; + uint8_t data = 0xff; SLOG1(("reading Master REQ Register at offset %02x = %02x", offset, data)); return data; } @@ -393,7 +393,7 @@ WRITE16_MEMBER(apollo_state::selective_clear_locations_w){ } READ16_MEMBER(apollo_state::selective_clear_locations_r){ - UINT16 data = 0xffff; + uint16_t data = 0xffff; SLOG1(("reading Selective Clear Locations at offset %02x = %02x", offset*2, data)); return data; } @@ -403,7 +403,7 @@ READ16_MEMBER(apollo_state::selective_clear_locations_r){ ***************************************************************************/ READ32_MEMBER(apollo_state::ram_with_parity_r){ - UINT32 data = m_messram_ptr[parity_error_offset+offset]; + uint32_t data = m_messram_ptr[parity_error_offset+offset]; SLOG2(("memory dword read with parity error at %08x = %08x & %08x parity_byte=%04x", ram_base_address + parity_error_offset*4 + offset*4,data, mem_mask, parity_error_byte_mask)); @@ -526,10 +526,10 @@ WRITE32_MEMBER(apollo_state::apollo_rom_w) READ16_MEMBER(apollo_state::apollo_atbus_io_r) { - UINT32 isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7); + uint32_t isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7); // Motorola CPU is MSB first, ISA Bus is LSB first - UINT16 data = m_isa->io16_swap_r(space, isa_addr, mem_mask); + uint16_t data = m_isa->io16_swap_r(space, isa_addr, mem_mask); SLOG2(("apollo_atbus_io_r at %08x -> %04x = %04x & %04x", ATBUS_IO_BASE + offset*2, isa_addr*2, data, mem_mask)); @@ -538,7 +538,7 @@ READ16_MEMBER(apollo_state::apollo_atbus_io_r) WRITE16_MEMBER(apollo_state::apollo_atbus_io_w) { - UINT32 isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7); + uint32_t isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7); SLOG2(("apollo_atbus_io_w at %08x -> %04x = %04x & %04x", ATBUS_IO_BASE + offset*2, isa_addr*2, data, mem_mask)); @@ -552,7 +552,7 @@ WRITE16_MEMBER(apollo_state::apollo_atbus_io_w) READ16_MEMBER(apollo_state::apollo_atbus_memory_r) { - UINT16 data; + uint16_t data; // Motorola CPU is MSB first, ISA Bus is LSB first data = m_isa->prog16_swap_r(space, offset, mem_mask); @@ -576,22 +576,22 @@ WRITE16_MEMBER(apollo_state::apollo_atbus_memory_w) READ16_MEMBER(apollo_state::apollo_atbus_unmap_io_r) { // ISA bus has 0xff for unmapped addresses - UINT16 data = 0xffff; - UINT32 isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7); + uint16_t data = 0xffff; + uint32_t isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7); SLOG1(("apollo_atbus_unmap_io_r at %08x -> %04x = %04x & %04x", ATBUS_IO_BASE + offset*2, isa_addr*2, data, mem_mask)); return data; } WRITE16_MEMBER(apollo_state::apollo_atbus_unmap_io_w) { - UINT32 isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7); + uint32_t isa_addr = (offset & 3) + ((offset & ~0x1ff) >> 7); SLOG1(("apollo_atbus_unmap_io_w at %08x -> %04x = %04x & %04x", ATBUS_IO_BASE + offset*2, isa_addr*2, data, mem_mask)); } READ8_MEMBER(apollo_state::apollo_atbus_unmap_r) { // ISA bus has 0xff for unmapped addresses - UINT8 data = 0xff; + uint8_t data = 0xff; SLOG2(("apollo_atbus_unmap_r at %08x = %02x & %02x", ATBUS_MEMORY_BASE + offset, data, mem_mask)); return data; } @@ -611,7 +611,7 @@ WRITE8_MEMBER(apollo_state::dn5500_memory_present_register_w){ } READ8_MEMBER(apollo_state::dn5500_memory_present_register_r){ - UINT8 data = DN5500_MEM_PRESENT_BYTE; + uint8_t data = DN5500_MEM_PRESENT_BYTE; SLOG(("reading DN5500 Memory Present Register at offset %02x = %02x", offset, data)); return data; } @@ -625,7 +625,7 @@ WRITE8_MEMBER(apollo_state::dn5500_11500_w){ } READ8_MEMBER(apollo_state::dn5500_11500_r){ - UINT8 data = 0xff; + uint8_t data = 0xff; SLOG1(("reading DN5500 11500 at offset %02x = %02x", offset, data)); return data; } @@ -640,7 +640,7 @@ WRITE8_MEMBER(apollo_state::dn5500_io_protection_map_w){ } READ8_MEMBER(apollo_state::dn5500_io_protection_map_r){ - UINT8 data = 0xff; + uint8_t data = 0xff; SLOG1(("reading DN5500 I/O Protection Map at offset %02x = %02x", offset, data)); return data; } @@ -652,7 +652,7 @@ READ8_MEMBER(apollo_state::dn5500_io_protection_map_r){ READ32_MEMBER(apollo_state::apollo_f8_r){ offs_t address = 0xf8000000 + offset * 4; - UINT32 data = 0xffffffff; + uint32_t data = 0xffffffff; SLOG2(("unexpected memory dword read from %08x = %08x & %08x", address, data, mem_mask)); return data; diff --git a/src/mame/drivers/apple1.cpp b/src/mame/drivers/apple1.cpp index da0ce7ac41d..99d7f4b58b0 100644 --- a/src/mame/drivers/apple1.cpp +++ b/src/mame/drivers/apple1.cpp @@ -106,14 +106,14 @@ public: required_device m_maincpu; required_device m_pia; required_device m_ram; - required_shared_ptr m_basicram; + required_shared_ptr m_basicram; required_ioport m_kb0, m_kb1, m_kb2, m_kb3, m_kbspecial; virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(apple2); - 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); DECLARE_READ8_MEMBER(ram_r); DECLARE_WRITE8_MEMBER(ram_w); @@ -126,25 +126,25 @@ public: TIMER_CALLBACK_MEMBER(keyboard_strobe_cb); private: - UINT8 *m_ram_ptr, *m_char_ptr; + uint8_t *m_ram_ptr, *m_char_ptr; int m_ram_size, m_char_size; - UINT8 m_vram[40*24]; + uint8_t m_vram[40*24]; int m_cursx, m_cursy; bool m_reset_down; bool m_clear_down; - UINT8 m_transchar; - UINT16 m_lastports[4]; + uint8_t m_transchar; + uint16_t m_lastports[4]; - void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen); + void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen); void poll_keyboard(); emu_timer *m_ready_start_timer, *m_ready_end_timer, *m_kbd_strobe_timer; }; -static const UINT8 apple1_keymap[] = +static const uint8_t apple1_keymap[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '=', '[', ']', ';', '\'', // KEY0 ',', '.', '/', '\\', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', // KEY1 @@ -166,9 +166,9 @@ static const UINT8 apple1_keymap[] = // header is "LOAD:abcdDATA:" where abcd is the starting address SNAPSHOT_LOAD_MEMBER( apple1_state, apple1 ) { - UINT64 snapsize; - UINT8 *data; - UINT16 start, end; + uint64_t snapsize; + uint8_t *data; + uint16_t start, end; static const char hd1[6] = "LOAD:"; static const char hd2[6] = "DATA:"; @@ -187,7 +187,7 @@ SNAPSHOT_LOAD_MEMBER( apple1_state, apple1 ) return image_init_result::FAIL; } - data = (UINT8 *)image.ptr(); + data = (uint8_t *)image.ptr(); if (!data) { logerror("Internal error loading snapshot\n"); @@ -230,8 +230,8 @@ SNAPSHOT_LOAD_MEMBER( apple1_state, apple1 ) void apple1_state::poll_keyboard() { - UINT8 special = m_kbspecial->read(); - UINT16 ports[4]; + uint8_t special = m_kbspecial->read(); + uint16_t ports[4]; int rawkey = 0; bool bKeypress = false; @@ -270,7 +270,7 @@ void apple1_state::poll_keyboard() for (int port = 0; port < 4; port++) { - UINT16 ptread = ports[port] ^ m_lastports[port]; + uint16_t ptread = ports[port] ^ m_lastports[port]; for (int bit = 0; bit < 16; bit++) { @@ -313,12 +313,12 @@ void apple1_state::poll_keyboard() } } -void apple1_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, - const UINT8 *textgfx_data, UINT32 textgfx_datalen) +void apple1_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, + const uint8_t *textgfx_data, uint32_t textgfx_datalen) { int x, y, i; - const UINT8 *chardata; - UINT16 color; + const uint8_t *chardata; + uint16_t color; int fg = 1, bg = 0; int charcode = (code & 0x1f) | (((code ^ 0x40) & 0x40) >> 1); @@ -339,11 +339,11 @@ void apple1_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, } } -UINT32 apple1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t apple1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int vramad; int cursor_blink = 0; - UINT8 curs_save = 0; + uint8_t curs_save = 0; poll_keyboard(); diff --git a/src/mame/drivers/apple2.cpp b/src/mame/drivers/apple2.cpp index 8100e0f7b9e..17a77f3ba3a 100644 --- a/src/mame/drivers/apple2.cpp +++ b/src/mame/drivers/apple2.cpp @@ -137,8 +137,8 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(apple2); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_jp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(ram_r); DECLARE_WRITE8_MEMBER(ram_w); @@ -169,8 +169,8 @@ private: double m_joystick_x2_time; double m_joystick_y2_time; - UINT16 m_lastchar, m_strobe; - UINT8 m_transchar; + uint16_t m_lastchar, m_strobe; + uint8_t m_transchar; bool m_anykeydown; int m_inh_slot; @@ -179,7 +179,7 @@ private: bool m_page2; bool m_an0, m_an1, m_an2, m_an3; - UINT8 *m_ram_ptr; + uint8_t *m_ram_ptr; int m_ram_size; int m_inh_bank; @@ -189,7 +189,7 @@ private: device_a2bus_card_interface *m_slotdevice[8]; void do_io(address_space &space, int offset); - UINT8 read_floatingbus(); + uint8_t read_floatingbus(); }; /*************************************************************************** @@ -366,7 +366,7 @@ PALETTE_INIT_MEMBER(napple2_state, apple2) m_video->palette_init_apple2(palette); } -UINT32 napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // always update the flash timer here so it's smooth regardless of mode switches m_video->m_flash = ((machine().time() * 4).seconds() & 1) ? true : false; @@ -427,7 +427,7 @@ UINT32 napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, return 0; } -UINT32 napple2_state::screen_update_jp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t napple2_state::screen_update_jp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // always update the flash timer here so it's smooth regardless of mode switches m_video->m_flash = ((machine().time() * 4).seconds() & 1) ? true : false; @@ -576,7 +576,7 @@ READ8_MEMBER(napple2_state::c000_r) case 0x10: // reads any key down, clears strobe { - UINT8 rv = m_transchar | (m_anykeydown ? 0x80 : 0x00); + uint8_t rv = m_transchar | (m_anykeydown ? 0x80 : 0x00); m_strobe = 0; return rv; } @@ -765,7 +765,7 @@ WRITE8_MEMBER(napple2_state::inh_w) } // floating bus code from old machine/apple2: needs to be reworked based on real beam position to enable e.g. Bob Bishop's screen splitter -UINT8 napple2_state::read_floatingbus() +uint8_t napple2_state::read_floatingbus() { enum { @@ -955,7 +955,7 @@ READ_LINE_MEMBER(napple2_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 */ diff --git a/src/mame/drivers/apple2e.cpp b/src/mame/drivers/apple2e.cpp index 91f93ab2848..d1fd1dc9e56 100644 --- a/src/mame/drivers/apple2e.cpp +++ b/src/mame/drivers/apple2e.cpp @@ -271,7 +271,7 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(apple2); - 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); DECLARE_READ8_MEMBER(ram0000_r); DECLARE_WRITE8_MEMBER(ram0000_w); @@ -342,8 +342,8 @@ private: double m_joystick_x2_time; double m_joystick_y2_time; - UINT16 m_lastchar, m_strobe; - UINT8 m_transchar; + uint16_t m_lastchar, m_strobe; + uint8_t m_transchar; bool m_anykeydown; int m_repeatdelay; @@ -371,12 +371,12 @@ private: bool m_mockingboard4c; bool m_isiic, m_isiicplus; - UINT8 m_iicplus_ce00[0x200]; + uint8_t m_iicplus_ce00[0x200]; - UINT8 *m_ram_ptr, *m_rom_ptr; + uint8_t *m_ram_ptr, *m_rom_ptr; int m_ram_size; - UINT8 *m_aux_ptr, *m_aux_bank_ptr; + uint8_t *m_aux_ptr, *m_aux_bank_ptr; int m_inh_bank; @@ -387,19 +387,19 @@ private: int m_irqmask; - UINT8 m_exp_bankhior; + uint8_t m_exp_bankhior; int m_exp_addrmask; - UINT8 m_exp_regs[0x10]; - UINT8 *m_exp_ram; + uint8_t m_exp_regs[0x10]; + uint8_t *m_exp_ram; int m_exp_wptr, m_exp_liveptr; void do_io(address_space &space, int offset, bool is_iic); - UINT8 read_floatingbus(); + uint8_t read_floatingbus(); void update_slotrom_banks(); void lc_update(int offset); - UINT8 read_slot_rom(address_space &space, int slotbias, int offset); - void write_slot_rom(address_space &space, int slotbias, int offset, UINT8 data); - UINT8 read_int_rom(address_space &space, int slotbias, int offset); + uint8_t read_slot_rom(address_space &space, int slotbias, int offset); + void write_slot_rom(address_space &space, int slotbias, int offset, uint8_t data); + uint8_t read_int_rom(address_space &space, int slotbias, int offset); void auxbank_update(); void raise_irq(int irq); void lower_irq(int irq); @@ -482,7 +482,7 @@ WRITE_LINE_MEMBER(apple2e_state::a2bus_inh_w) READ8_MEMBER(apple2e_state::memexp_r) { - UINT8 retval = m_exp_regs[offset]; + uint8_t retval = m_exp_regs[offset]; if (!m_exp_ram) { @@ -819,7 +819,7 @@ PALETTE_INIT_MEMBER(apple2e_state, apple2) m_video->palette_init_apple2(palette); } -UINT32 apple2e_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t apple2e_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bool old_page2 = m_video->m_page2; @@ -1267,7 +1267,7 @@ READ8_MEMBER(apple2e_state::c000_r) case 0x10: // read any key down, reset keyboard strobe { - UINT8 rv = m_transchar | (m_anykeydown ? 0x80 : 0x00); + uint8_t rv = m_transchar | (m_anykeydown ? 0x80 : 0x00); m_strobe = 0; return rv; } @@ -1516,7 +1516,7 @@ READ8_MEMBER(apple2e_state::c000_iic_r) case 0x10: // read any key down, reset keyboard strobe { - UINT8 rv = m_transchar | (m_anykeydown ? 0x80 : 0x00); + uint8_t rv = m_transchar | (m_anykeydown ? 0x80 : 0x00); m_strobe = 0; return rv; } @@ -1872,7 +1872,7 @@ WRITE8_MEMBER(apple2e_state::c080_w) } } -UINT8 apple2e_state::read_slot_rom(address_space &space, int slotbias, int offset) +uint8_t apple2e_state::read_slot_rom(address_space &space, int slotbias, int offset) { int slotnum = ((offset>>8) & 0xf) + slotbias; @@ -1890,7 +1890,7 @@ UINT8 apple2e_state::read_slot_rom(address_space &space, int slotbias, int offse return read_floatingbus(); } -void apple2e_state::write_slot_rom(address_space &space, int slotbias, int offset, UINT8 data) +void apple2e_state::write_slot_rom(address_space &space, int slotbias, int offset, uint8_t data) { int slotnum = ((offset>>8) & 0xf) + slotbias; @@ -1906,7 +1906,7 @@ void apple2e_state::write_slot_rom(address_space &space, int slotbias, int offse } } -UINT8 apple2e_state::read_int_rom(address_space &space, int slotbias, int offset) +uint8_t apple2e_state::read_int_rom(address_space &space, int slotbias, int offset) { if ((m_cnxx_slot == CNXX_UNCLAIMED) && (!space.debugger_access())) { @@ -2148,7 +2148,7 @@ WRITE8_MEMBER(apple2e_state::lc_w) } // floating bus code from old machine/apple2: needs to be reworked based on real beam position to enable e.g. Bob Bishop's screen splitter -UINT8 apple2e_state::read_floatingbus() +uint8_t apple2e_state::read_floatingbus() { enum { @@ -2489,8 +2489,8 @@ WRITE_LINE_MEMBER(apple2e_state::ay3600_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/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp index 11c62e0b299..38bffaf20cb 100644 --- a/src/mame/drivers/apple2gs.cpp +++ b/src/mame/drivers/apple2gs.cpp @@ -208,7 +208,7 @@ READ8_MEMBER(apple2gs_state::adbmicro_p1_in) READ8_MEMBER(apple2gs_state::adbmicro_p2_in) { - UINT8 rv = 0; + uint8_t rv = 0; rv |= 0x40; // no reset rv |= (m_adb_line) ? 0x00 : 0x80; diff --git a/src/mame/drivers/applix.cpp b/src/mame/drivers/applix.cpp index aca9a670e8d..f0a23ef55f1 100644 --- a/src/mame/drivers/applix.cpp +++ b/src/mame/drivers/applix.cpp @@ -130,32 +130,32 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(cass_timer); DECLARE_DRIVER_INIT(applix); MC6845_UPDATE_ROW(crtc_update_row); - UINT8 m_video_latch; - UINT8 m_pa; + uint8_t m_video_latch; + uint8_t m_pa; virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(applix); - UINT8 m_palette_latch[4]; - required_shared_ptr m_base; + uint8_t m_palette_latch[4]; + required_shared_ptr m_base; private: - UINT8 m_pb; - UINT8 m_analog_latch; - UINT8 m_dac_latch; - UINT8 m_port08; - UINT8 m_data_to_fdc; - UINT8 m_data_from_fdc; + uint8_t m_pb; + uint8_t m_analog_latch; + uint8_t m_dac_latch; + uint8_t m_port08; + uint8_t m_data_to_fdc; + uint8_t m_data_from_fdc; bool m_data; bool m_data_or_cmd; bool m_buffer_empty; bool m_fdc_cmd; - UINT8 m_clock_count; + uint8_t m_clock_count; bool m_cp; - UINT8 m_p1; - UINT8 m_p1_data; - UINT8 m_p2; - UINT8 m_p3; - UINT16 m_last_write_addr; - UINT8 m_cass_data[4]; + uint8_t m_p1; + uint8_t m_p1_data; + uint8_t m_p2; + uint8_t m_p3; + uint16_t m_last_write_addr; + uint8_t m_cass_data[4]; required_device m_maincpu; required_device m_crtc; required_device m_via; @@ -191,7 +191,7 @@ private: required_ioport m_io_k3a0; required_ioport m_io_k3b0; required_ioport m_io_k0b; - required_shared_ptr m_expansion; + required_shared_ptr m_expansion; public: required_device m_palette; }; @@ -319,7 +319,7 @@ d3 = test switch */ READ8_MEMBER( applix_state::port00_r ) { - return (UINT8)m_data_or_cmd | ((UINT8)m_data << 1) | ((UINT8)m_buffer_empty << 2) | m_io_fdc->read(); + return (uint8_t)m_data_or_cmd | ((uint8_t)m_data << 1) | ((uint8_t)m_buffer_empty << 2) | m_io_fdc->read(); } /* @@ -402,12 +402,12 @@ WRITE8_MEMBER( applix_state::port60_w ) READ16_MEMBER( applix_state::fdc_stat_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { - case 0: data = (UINT8)m_buffer_empty^1; break; - case 1: data = (UINT8)m_data^1; break; - default: data = (UINT8)m_fdc_cmd; // case 2 + case 0: data = (uint8_t)m_buffer_empty^1; break; + case 1: data = (uint8_t)m_data^1; break; + default: data = (uint8_t)m_fdc_cmd; // case 2 } return data << 7; } @@ -717,7 +717,7 @@ INPUT_PORTS_END void applix_state::machine_reset() { - UINT8* ROM = memregion("maincpu")->base(); + uint8_t* ROM = memregion("maincpu")->base(); memcpy(m_expansion, ROM, 8); membank("bank1")->set_entry(0); m_p3 = 0xff; @@ -736,7 +736,7 @@ SLOT_INTERFACE_END PALETTE_INIT_MEMBER(applix_state, applix) { // shades need to be verified - the names on the right are from the manual - const UINT8 colors[16*3] = { + const uint8_t colors[16*3] = { 0x00, 0x00, 0x00, // 0 Black 0x40, 0x40, 0x40, // 1 Dark Grey 0x00, 0x00, 0x80, // 2 Dark Blue @@ -754,7 +754,7 @@ PALETTE_INIT_MEMBER(applix_state, applix) 0xbf, 0xbf, 0xbf, // 14 Light Grey 0xff, 0xff, 0xff }; // 15 White - UINT8 r, b, g, i, color_count = 0; + uint8_t r, b, g, i, color_count = 0; for (i = 0; i < 48; color_count++) { @@ -774,9 +774,9 @@ MC6845_UPDATE_ROW( applix_state::crtc_update_row ) // Need to display a border colour. // There is a monochrome mode, but no info found as yet. const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 i; - UINT16 chr,x; - UINT32 mem, vidbase = (m_video_latch & 15) << 14, *p = &bitmap.pix32(y); + uint8_t i; + uint16_t chr,x; + uint32_t mem, vidbase = (m_video_latch & 15) << 14, *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { @@ -814,7 +814,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(applix_state::cass_timer) { /* cassette - turn 2500/5000Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -928,7 +928,7 @@ ROM_END DRIVER_INIT_MEMBER(applix_state, applix) { - UINT8 *RAM = memregion("subcpu")->base(); + uint8_t *RAM = memregion("subcpu")->base(); membank("bank1")->configure_entries(0, 2, &RAM[0x8000], 0x8000); } @@ -1084,7 +1084,7 @@ WRITE8_MEMBER( applix_state::p2_write ) READ8_MEMBER( applix_state::p3_read ) { - UINT8 data = m_p3; + uint8_t data = m_p3; data &= ~0x14; diff --git a/src/mame/drivers/appoooh.cpp b/src/mame/drivers/appoooh.cpp index 8ffff3e27fe..a2aab70cc97 100644 --- a/src/mame/drivers/appoooh.cpp +++ b/src/mame/drivers/appoooh.cpp @@ -176,7 +176,7 @@ WRITE_LINE_MEMBER(appoooh_state::adpcm_int) { if (m_adpcm_data == 0xffffffff) { - UINT8 *RAM = memregion("adpcm")->base(); + uint8_t *RAM = memregion("adpcm")->base(); m_adpcm_data = RAM[m_adpcm_address++]; m_msm->data_w(m_adpcm_data >> 4); diff --git a/src/mame/drivers/apricot.cpp b/src/mame/drivers/apricot.cpp index 892efe2da11..3c6e2ef0266 100644 --- a/src/mame/drivers/apricot.cpp +++ b/src/mame/drivers/apricot.cpp @@ -86,7 +86,7 @@ public: DECLARE_WRITE_LINE_MEMBER(data_selector_rts_w) { m_data_selector_rts = state; }; MC6845_UPDATE_ROW(crtc_update_row); - UINT32 screen_update_apricot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_apricot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: virtual void machine_start() override; @@ -106,7 +106,7 @@ private: required_device m_floppy0; required_device m_floppy1; required_device m_palette; - required_shared_ptr m_screen_buffer; + required_shared_ptr m_screen_buffer; int m_data_selector_dtr; int m_data_selector_rts; @@ -155,7 +155,7 @@ WRITE_LINE_MEMBER( apricot_state::write_centronics_perror ) READ8_MEMBER( apricot_state::i8255_portc_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= m_centronics_perror << 0; // schematic page 294 says pc1 is centronics pin 34, which is n/c. @@ -279,7 +279,7 @@ SLOT_INTERFACE_END // VIDEO EMULATION //************************************************************************** -UINT32 apricot_state::screen_update_apricot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t apricot_state::screen_update_apricot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (!m_display_on) m_crtc->screen_update(screen, bitmap, cliprect); @@ -295,9 +295,9 @@ MC6845_UPDATE_ROW( apricot_state::crtc_update_row ) for (int i = 0; i < x_count; i++) { - UINT16 code = m_screen_buffer[(ma + i) & 0x7ff]; - UINT16 offset = ((code & 0x7ff) << 5) | (ra << 1); - UINT16 data = m_cpu->space(AS_PROGRAM).read_word(offset); + uint16_t code = m_screen_buffer[(ma + i) & 0x7ff]; + uint16_t offset = ((code & 0x7ff) << 5) | (ra << 1); + uint16_t data = m_cpu->space(AS_PROGRAM).read_word(offset); if (m_video_mode) { diff --git a/src/mame/drivers/apricotf.cpp b/src/mame/drivers/apricotf.cpp index ee0b210b6c2..f6acd741289 100644 --- a/src/mame/drivers/apricotf.cpp +++ b/src/mame/drivers/apricotf.cpp @@ -88,11 +88,11 @@ public: required_device m_centronics; required_device m_cent_data_out; required_device m_irqs; - required_shared_ptr m_p_scrollram; - required_shared_ptr m_p_paletteram; + required_shared_ptr m_p_scrollram; + required_shared_ptr m_p_paletteram; required_device m_palette; - 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); DECLARE_READ16_MEMBER( palette_r ); DECLARE_WRITE16_MEMBER( palette_w ); @@ -109,7 +109,7 @@ public: // VIDEO //************************************************************************** -UINT32 f1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t f1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &program = m_maincpu->space(AS_PROGRAM); int lines = m_200_256 ? 200 : 256; @@ -120,7 +120,7 @@ UINT32 f1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, cons for (int sx = 0; sx < 80; sx++) { - UINT16 data = program.read_word(addr); + uint16_t data = program.read_word(addr); if (m_40_80) { @@ -160,7 +160,7 @@ READ16_MEMBER( f1_state::palette_r ) WRITE16_MEMBER( f1_state::palette_w ) { - UINT8 i,r,g,b; + uint8_t i,r,g,b; COMBINE_DATA(&m_p_paletteram[offset]); if(ACCESSING_BITS_0_7 && offset) //TODO: offset 0 looks bogus diff --git a/src/mame/drivers/apricotp.cpp b/src/mame/drivers/apricotp.cpp index 06d50995a02..9a7170f8d6d 100644 --- a/src/mame/drivers/apricotp.cpp +++ b/src/mame/drivers/apricotp.cpp @@ -122,7 +122,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); MC6845_UPDATE_ROW(update_row); DECLARE_READ16_MEMBER( mem_r ); @@ -137,11 +137,11 @@ public: void lat_ls259_w(offs_t offset, int state); - optional_shared_ptr m_work_ram; + optional_shared_ptr m_work_ram; // video state - optional_shared_ptr m_video_ram; - UINT8 m_video; + optional_shared_ptr m_video_ram; + uint8_t m_video; int m_centronics_busy; int m_centronics_select; @@ -169,7 +169,7 @@ MC6845_UPDATE_ROW( fp_state::update_row ) { } -UINT32 fp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t fp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { offs_t addr = (!BIT(m_video, 4) << 15) | (BIT(m_video, 1) << 14); @@ -177,7 +177,7 @@ UINT32 fp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, cons { for (int sx = 0; sx < 40; sx++) { - UINT16 data = m_video_ram[addr++]; + uint16_t data = m_video_ram[addr++]; for (int x = 0; x < 16; x++) { @@ -228,7 +228,7 @@ READ8_MEMBER( fp_state::prtr_snd_r ) */ - UINT8 data = 0; + uint8_t data = 0; // centronics data |= m_centronics_busy; @@ -334,7 +334,7 @@ WRITE8_MEMBER( fp_state::lat_w ) READ16_MEMBER( fp_state::mem_r ) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; if (offset >= 0xd0000/2 && offset < 0xf0000/2) { diff --git a/src/mame/drivers/aquarium.cpp b/src/mame/drivers/aquarium.cpp index 88de9d913fa..bcee0345930 100644 --- a/src/mame/drivers/aquarium.cpp +++ b/src/mame/drivers/aquarium.cpp @@ -78,9 +78,9 @@ WRITE8_MEMBER(aquarium_state::aquarium_z80_bank_w) membank("bank1")->set_entry(data & 0x7); } -UINT8 aquarium_state::aquarium_snd_bitswap( UINT8 scrambled_data ) +uint8_t aquarium_state::aquarium_snd_bitswap( uint8_t scrambled_data ) { - UINT8 data = 0; + uint8_t data = 0; data |= ((scrambled_data & 0x01) << 7); data |= ((scrambled_data & 0x02) << 5); @@ -244,13 +244,13 @@ static const gfx_layout tilelayout = DRIVER_INIT_MEMBER(aquarium_state,aquarium) { - UINT8 *Z80 = memregion("audiocpu")->base(); + uint8_t *Z80 = memregion("audiocpu")->base(); /* The BG tiles are 5bpp, this rearranges the data from the roms containing the 1bpp data so we can decode it correctly */ - UINT8 *DAT2 = memregion("gfx1")->base() + 0x080000; - UINT8 *DAT = memregion("user1")->base(); + uint8_t *DAT2 = memregion("gfx1")->base() + 0x080000; + uint8_t *DAT = memregion("user1")->base(); int len = 0x0200000; for (len = 0; len < 0x020000; len++) diff --git a/src/mame/drivers/aquarius.cpp b/src/mame/drivers/aquarius.cpp index 6d491ffe290..2ee6a42c36a 100644 --- a/src/mame/drivers/aquarius.cpp +++ b/src/mame/drivers/aquarius.cpp @@ -134,7 +134,7 @@ WRITE8_MEMBER(aquarius_state::printer_w) */ READ8_MEMBER(aquarius_state::keyboard_r) { - UINT8 result = 0xff; + uint8_t result = 0xff; if (!BIT(offset, 8)) result &= m_y0->read(); if (!BIT(offset, 9)) result &= m_y1->read(); @@ -174,7 +174,7 @@ WRITE8_MEMBER(aquarius_state::scrambler_w) READ8_MEMBER(aquarius_state::cartridge_r) { - UINT8 data = 0; + uint8_t data = 0; if (m_cart->exists()) data = m_cart->read_rom(space, offset); diff --git a/src/mame/drivers/arabian.cpp b/src/mame/drivers/arabian.cpp index a2155053875..df243930db2 100644 --- a/src/mame/drivers/arabian.cpp +++ b/src/mame/drivers/arabian.cpp @@ -100,7 +100,7 @@ WRITE8_MEMBER(arabian_state::ay8910_portb_w) READ8_MEMBER(arabian_state::mcu_port_r_r) { - UINT8 val = m_mcu_port_r[offset]; + uint8_t val = m_mcu_port_r[offset]; /* RAM mode is enabled */ if (offset == 0) @@ -113,7 +113,7 @@ WRITE8_MEMBER(arabian_state::mcu_port_r_w) { if (offset == 0) { - UINT32 ram_addr = ((m_mcu_port_p & 7) << 8) | m_mcu_port_o; + uint32_t ram_addr = ((m_mcu_port_p & 7) << 8) | m_mcu_port_o; if (~data & 2) m_custom_cpu_ram[ram_addr] = 0xf0 | m_mcu_port_r[3]; @@ -126,17 +126,17 @@ WRITE8_MEMBER(arabian_state::mcu_port_r_w) READ8_MEMBER(arabian_state::mcu_portk_r) { - UINT8 val = 0xf; + uint8_t val = 0xf; if (~m_mcu_port_r[0] & 1) { - UINT32 ram_addr = ((m_mcu_port_p & 7) << 8) | m_mcu_port_o; + uint32_t ram_addr = ((m_mcu_port_p & 7) << 8) | m_mcu_port_o; val = m_custom_cpu_ram[ram_addr]; } else { static const char *const comnames[] = { "COM0", "COM1", "COM2", "COM3", "COM4", "COM5" }; - UINT8 sel = ((m_mcu_port_r[2] << 4) | m_mcu_port_r[1]) & 0x3f; + uint8_t sel = ((m_mcu_port_r[2] << 4) | m_mcu_port_r[1]) & 0x3f; int i; for (i = 0; i < 6; ++i) @@ -154,7 +154,7 @@ READ8_MEMBER(arabian_state::mcu_portk_r) WRITE8_MEMBER(arabian_state::mcu_port_o_w) { - UINT8 out = data & 0x0f; + uint8_t out = data & 0x0f; if (data & 0x10) m_mcu_port_o = (m_mcu_port_o & 0x0f) | (out << 4); diff --git a/src/mame/drivers/arachnid.cpp b/src/mame/drivers/arachnid.cpp index 0ba0551b596..0d6ad55a0a6 100644 --- a/src/mame/drivers/arachnid.cpp +++ b/src/mame/drivers/arachnid.cpp @@ -107,7 +107,7 @@ public: DECLARE_WRITE_LINE_MEMBER(ptm_o1_callback); - UINT8 read_keyboard(int pa); + uint8_t read_keyboard(int pa); }; /*************************************************************************** @@ -253,10 +253,10 @@ WRITE_LINE_MEMBER(arachnid_state::ptm_o1_callback) m_speaker->level_w(state); } -UINT8 arachnid_state::read_keyboard(int pa) +uint8_t arachnid_state::read_keyboard(int pa) { int i; - UINT8 value; + uint8_t value; static const char *const keynames[3][8] = { { "PA0-0", "PA0-1", "PA0-2", "PA0-3", "PA0-4", "PA0-5", "PA0-6", "PA0-7" }, @@ -292,7 +292,7 @@ READ8_MEMBER( arachnid_state::pia_u4_pa_r ) // PA6 - A // PA7 - B - UINT8 data = 0xff; + uint8_t data = 0xff; data &= read_keyboard(1); return data; @@ -310,7 +310,7 @@ READ8_MEMBER( arachnid_state::pia_u4_pb_r ) // PB6 - P // PB7 - O - UINT8 data = 0xff; + uint8_t data = 0xff; data &= read_keyboard(2); return data; @@ -320,7 +320,7 @@ READ_LINE_MEMBER( arachnid_state::pia_u4_pca_r ) { // CA1 - SW1 Coin In (Coin Door) - UINT8 data = 1; + uint8_t data = 1; data &= ioport("SW1")->read(); return data; @@ -330,7 +330,7 @@ READ_LINE_MEMBER( arachnid_state::pia_u4_pcb_r ) { // CB1 - SW2 Test Mode (Coin Door) - UINT8 data = 1; + uint8_t data = 1; data &= ioport("SW2")->read(); return data; @@ -344,7 +344,7 @@ READ8_MEMBER( arachnid_state::pia_u17_pa_r ) // PA3 - Test // PA4 thru PA7 - DIP SW1 - UINT8 data = 0xff; + uint8_t data = 0xff; data &= read_keyboard(0); return data; @@ -354,7 +354,7 @@ READ_LINE_MEMBER( arachnid_state::pia_u17_pca_r ) { // CA1 - 1000 HZ Input - UINT8 data = 1; + uint8_t data = 1; return data; } diff --git a/src/mame/drivers/arcadia.cpp b/src/mame/drivers/arcadia.cpp index a68f6d8105c..c1386db9654 100644 --- a/src/mame/drivers/arcadia.cpp +++ b/src/mame/drivers/arcadia.cpp @@ -676,16 +676,16 @@ ROM_END DRIVER_INIT_MEMBER(arcadia_state,arcadia) { int i; - UINT8 *gfx=memregion("gfx1")->base(); + uint8_t *gfx=memregion("gfx1")->base(); for (i=0; i<256; i++) gfx[i]=i; #if 0 // this is here to allow developement of some simple testroutines // for a real console { - UINT8 *rom=memregion("maincpu")->base(); + uint8_t *rom=memregion("maincpu")->base(); /* this is a simple routine to display all rom characters on the display for a snapshot */ - static const UINT8 prog[]={ // address 0 of course + static const uint8_t prog[]={ // address 0 of course 0x20, // eorz, 0 0x1b, 0x01, // bctr,a $0004 0x17, // retc a diff --git a/src/mame/drivers/argo.cpp b/src/mame/drivers/argo.cpp index ccf0841218a..299ddc795ec 100644 --- a/src/mame/drivers/argo.cpp +++ b/src/mame/drivers/argo.cpp @@ -44,16 +44,16 @@ public: DECLARE_WRITE8_MEMBER(argo_videoram_w); DECLARE_READ8_MEMBER(argo_io_r); DECLARE_WRITE8_MEMBER(argo_io_w); - required_shared_ptr m_p_videoram; - const UINT8 *m_p_chargen; - UINT8 m_framecnt; - UINT8 m_cursor_pos[3]; - UINT8 m_p_cursor_pos; + required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + uint8_t m_framecnt; + uint8_t m_cursor_pos[3]; + uint8_t m_p_cursor_pos; bool m_ram_ctrl; - UINT8 m_scroll_ctrl; + uint8_t m_scroll_ctrl; virtual void machine_reset() override; virtual void video_start() override; - 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); DECLARE_DRIVER_INIT(argo); protected: @@ -63,7 +63,7 @@ protected: // write to videoram if following 'out b9,61' otherwise write to the unknown 'extra' ram WRITE8_MEMBER(argo_state::argo_videoram_w) { - UINT8 *RAM; + uint8_t *RAM; if (m_ram_ctrl) RAM = memregion("videoram")->base(); else @@ -74,7 +74,7 @@ WRITE8_MEMBER(argo_state::argo_videoram_w) READ8_MEMBER(argo_state::argo_io_r) { - UINT8 low_io = offset; + uint8_t low_io = offset; switch (low_io) { @@ -94,7 +94,7 @@ READ8_MEMBER(argo_state::argo_io_r) WRITE8_MEMBER(argo_state::argo_io_w) { - UINT8 low_io = offset; + uint8_t low_io = offset; switch (low_io) { @@ -110,7 +110,7 @@ WRITE8_MEMBER(argo_state::argo_io_w) case 0xE8: // hardware scroll - we should use ports E0,E1,E2,E3 if ((m_scroll_ctrl == 2) & (data == 0xe3)) { - UINT8 *RAM = memregion("videoram")->base(); + uint8_t *RAM = memregion("videoram")->base(); m_scroll_ctrl = 0; memcpy(RAM, RAM+80, 24*80); } @@ -278,7 +278,7 @@ void argo_state::machine_reset() DRIVER_INIT_MEMBER(argo_state,argo) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xf800); } @@ -287,11 +287,11 @@ void argo_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 argo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t argo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; - UINT8 *p_vram = m_p_videoram; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; + uint8_t *p_vram = m_p_videoram; m_framecnt++; @@ -299,7 +299,7 @@ UINT32 argo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, co { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = 1; x < 81; x++) // align x to the cursor position numbers { diff --git a/src/mame/drivers/aristmk4.cpp b/src/mame/drivers/aristmk4.cpp index 203680b20cd..0ccc8880f28 100644 --- a/src/mame/drivers/aristmk4.cpp +++ b/src/mame/drivers/aristmk4.cpp @@ -338,8 +338,8 @@ #include "gldnpkr.lh" // Video poker #include "fvrpitch.lh" // 5 line without gamble -UINT8 crtc_cursor_index = 0; -UINT8 crtc_reg = 0; +uint8_t crtc_cursor_index = 0; +uint8_t crtc_reg = 0; class aristmk4_state : public driver_device { @@ -361,21 +361,21 @@ public: required_device m_ay2; required_device m_samples; - required_shared_ptr m_mkiv_vram; + required_shared_ptr m_mkiv_vram; required_device m_gfxdecode; required_device m_palette; int m_rtc_address_strobe; int m_rtc_data_strobe; - UINT8 *m_shapeRomPtr; - UINT8 m_shapeRom[0xc000]; - std::unique_ptr m_nvram; - UINT8 m_psg_data; + uint8_t *m_shapeRomPtr; + uint8_t m_shapeRom[0xc000]; + std::unique_ptr m_nvram; + uint8_t m_psg_data; int m_ay8910_1; int m_ay8910_2; int m_u3_p0_w; - UINT8 m_cgdrsw; - UINT8 m_ripple; + uint8_t m_cgdrsw; + uint8_t m_ripple; int m_hopper_motor; int m_inscrd; int m_insnote; @@ -416,7 +416,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(aristmk4); DECLARE_PALETTE_INIT(lions); - UINT32 screen_update_aristmk4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aristmk4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(note_input_reset); TIMER_CALLBACK_MEMBER(coin_input_reset); TIMER_CALLBACK_MEMBER(hopper_reset); @@ -425,7 +425,7 @@ public: }; /* Partial Cashcade protocol */ -static const UINT8 cashcade_p[] ={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0}; +static const uint8_t cashcade_p[] ={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0}; void aristmk4_state::video_start() { @@ -469,7 +469,7 @@ void aristmk4_state::uBackgroundColour() } } -UINT32 aristmk4_state::screen_update_aristmk4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aristmk4_state::screen_update_aristmk4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int x,y; @@ -676,7 +676,7 @@ WRITE_LINE_MEMBER(aristmk4_state::mkiv_pia_cb2) //output b WRITE8_MEMBER(aristmk4_state::mkiv_pia_outb) { - UINT8 emet[5]; + uint8_t emet[5]; int i = 0; //pia_data = data; emet[0] = data & 0x01; /* emet1 - bit 1 - PB0 */ @@ -1633,7 +1633,7 @@ READ8_MEMBER(aristmk4_state::pc1_r) /* same as Casino Winner HW */ PALETTE_INIT_MEMBER(aristmk4_state, aristmk4) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0;i < palette.entries();i++) @@ -1659,9 +1659,9 @@ PALETTE_INIT_MEMBER(aristmk4_state, aristmk4) DRIVER_INIT_MEMBER(aristmk4_state,aristmk4) { - m_shapeRomPtr = (UINT8 *)memregion("tile_gfx")->base(); + m_shapeRomPtr = (uint8_t *)memregion("tile_gfx")->base(); memcpy(m_shapeRom,m_shapeRomPtr,sizeof(m_shapeRom)); // back up - m_nvram = std::make_unique(0x1000); + m_nvram = std::make_unique(0x1000); } void aristmk4_state::machine_start() diff --git a/src/mame/drivers/aristmk5.cpp b/src/mame/drivers/aristmk5.cpp index ef8adc53f24..603f3e9f4a6 100644 --- a/src/mame/drivers/aristmk5.cpp +++ b/src/mame/drivers/aristmk5.cpp @@ -183,8 +183,8 @@ public: emu_timer *m_mk5_2KHz_timer; emu_timer *m_mk5_VSYNC_timer; - UINT8 m_ext_latch; - UINT8 m_flyback; + uint8_t m_ext_latch; + uint8_t m_flyback; DECLARE_WRITE32_MEMBER(Ns5w48); DECLARE_READ32_MEMBER(Ns5x58); DECLARE_READ32_MEMBER(mk5_ioc_r); @@ -301,7 +301,7 @@ READ32_MEMBER(aristmk5_state::Ns5x58) /* same as plain AA but with the I2C unconnected */ READ32_MEMBER(aristmk5_state::mk5_ioc_r) { - UINT32 ioc_addr; + uint32_t ioc_addr; ioc_addr = offset*4; ioc_addr >>= 16; @@ -324,7 +324,7 @@ READ32_MEMBER(aristmk5_state::mk5_ioc_r) WRITE32_MEMBER(aristmk5_state::mk5_ioc_w) { - UINT32 ioc_addr; + uint32_t ioc_addr; ioc_addr = offset*4; ioc_addr >>= 16; @@ -472,8 +472,8 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER(aristmk5_state,aristmk5) { - UINT8 *SRAM = memregion("sram")->base(); - UINT8 *SRAM_NZ = memregion("sram")->base(); + uint8_t *SRAM = memregion("sram")->base(); + uint8_t *SRAM_NZ = memregion("sram")->base(); archimedes_driver_init(); @@ -500,10 +500,10 @@ void aristmk5_state::machine_reset() /* load the roms according to what the operator wants */ { - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 *PRG;// = memregion("prg_code")->base(); + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *PRG;// = memregion("prg_code")->base(); int i; - UINT8 op_mode; + uint8_t op_mode; static const char *const rom_region[] = { "set_chip_4.04", "set_chip_4.4", "clear_chip", "game_prg" }; op_mode = ioport("ROM_LOAD")->read(); diff --git a/src/mame/drivers/aristmk6.cpp b/src/mame/drivers/aristmk6.cpp index d8094f26c6a..243d6c0b9bf 100644 --- a/src/mame/drivers/aristmk6.cpp +++ b/src/mame/drivers/aristmk6.cpp @@ -39,13 +39,13 @@ public: m_eeprom0(*this, "eeprom0"), m_palette(*this, "palette") { } - UINT32 m_test_x,m_test_y,m_start_offs; - UINT8 m_type; + uint32_t m_test_x,m_test_y,m_start_offs; + uint8_t m_type; DECLARE_READ8_MEMBER(test_r); DECLARE_WRITE64_MEMBER(eeprom_w); DECLARE_READ64_MEMBER(hwver_r); virtual void video_start() override; - UINT32 screen_update_aristmk6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aristmk6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_uart0; required_device m_uart1; @@ -58,10 +58,10 @@ void aristmk6_state::video_start() { } -UINT32 aristmk6_state::screen_update_aristmk6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t aristmk6_state::screen_update_aristmk6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; - const UINT8 *blit_ram = memregion("maincpu")->base(); + const uint8_t *blit_ram = memregion("maincpu")->base(); if(machine().input().code_pressed(KEYCODE_Z)) m_test_x++; @@ -102,7 +102,7 @@ UINT32 aristmk6_state::screen_update_aristmk6(screen_device &screen, bitmap_rgb3 { if(m_type) { - UINT16 vram; + uint16_t vram; int r,g,b; vram = blit_ram[count+0] | blit_ram[count+1]<<8; @@ -122,7 +122,7 @@ UINT32 aristmk6_state::screen_update_aristmk6(screen_device &screen, bitmap_rgb3 } else { - UINT8 color; + uint8_t color; color = blit_ram[count]; diff --git a/src/mame/drivers/arkanoid.cpp b/src/mame/drivers/arkanoid.cpp index de4b3bf0375..ad20ea5a7d1 100644 --- a/src/mame/drivers/arkanoid.cpp +++ b/src/mame/drivers/arkanoid.cpp @@ -2047,8 +2047,8 @@ DRIVER_INIT_MEMBER(arkanoid_state,block2) { // the graphics on this bootleg have the data scrambled int tile; - UINT8* srcgfx = memregion("gfx1")->base(); - std::vector buffer(0x18000); + uint8_t* srcgfx = memregion("gfx1")->base(); + std::vector buffer(0x18000); for (tile = 0; tile < 0x3000; tile++) { @@ -2103,7 +2103,7 @@ DRIVER_INIT_MEMBER(arkanoid_state,paddle2) DRIVER_INIT_MEMBER(arkanoid_state,tetrsark) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int x; for (x = 0; x < 0x8000; x++) @@ -2117,7 +2117,7 @@ DRIVER_INIT_MEMBER(arkanoid_state,tetrsark) DRIVER_INIT_MEMBER(arkanoid_state,hexa) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); #if 0 @@ -2147,7 +2147,7 @@ DRIVER_INIT_MEMBER(arkanoid_state,hexaa) DRIVER_INIT_MEMBER(arkanoid_state,brixian) { - UINT8 *RAM = memregion("protdata")->base(); + uint8_t *RAM = memregion("protdata")->base(); for (int i=0x000;i<0x200;i++) m_protram[i+0x600] = RAM[i]; diff --git a/src/mame/drivers/armedf.cpp b/src/mame/drivers/armedf.cpp index 52eda2e7e2f..3eb8fa870b4 100644 --- a/src/mame/drivers/armedf.cpp +++ b/src/mame/drivers/armedf.cpp @@ -2138,7 +2138,7 @@ DRIVER_INIT_MEMBER(armedf_state,armedf) DRIVER_INIT_MEMBER(armedf_state,kozure) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); /* patch "time over" bug, see notes on top. */ ROM[0x1016c/2] = 0x4e71; @@ -2155,7 +2155,7 @@ DRIVER_INIT_MEMBER(armedf_state,legion) #if LEGION_HACK /* This is a hack to allow you to use the extra features of 3 of the "Unused" Dip Switches (see notes above). */ - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); RAM[0x0001d6 / 2] = 0x0001; /* To avoid checksum error */ RAM[0x000488 / 2] = 0x4e71; @@ -2171,7 +2171,7 @@ DRIVER_INIT_MEMBER(armedf_state,legionjb) #if LEGION_HACK /* This is a hack to allow you to use the extra features of 3 of the "Unused" Dip Switches (see notes above). */ - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); RAM[0x0001d6/2] = 0x0001; /* No need to patch the checksum routine (see notes) ! */ #endif diff --git a/src/mame/drivers/arsystems.cpp b/src/mame/drivers/arsystems.cpp index d54a3f723f6..b9c3aeb92ce 100644 --- a/src/mame/drivers/arsystems.cpp +++ b/src/mame/drivers/arsystems.cpp @@ -95,7 +95,7 @@ protected: optional_memory_region m_bios_region; - UINT8 m_coin_counter[2]; + uint8_t m_coin_counter[2]; }; @@ -887,7 +887,7 @@ ROM_END void arcadia_amiga_state::generic_decode(const char *tag, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0) { - UINT16 *rom = (UINT16 *)memregion(tag)->base(); + uint16_t *rom = (uint16_t *)memregion(tag)->base(); int i; /* only the low byte of ROMs are encrypted in these games */ @@ -896,7 +896,7 @@ void arcadia_amiga_state::generic_decode(const char *tag, int bit7, int bit6, in #if 0 { - UINT8 *ROM = memregion(tag)->base(); + uint8_t *ROM = memregion(tag)->base(); // int size = memregion(tag)->bytes(); FILE *fp; @@ -930,7 +930,7 @@ DRIVER_INIT_MEMBER( arcadia_amiga_state, arcadia ) if (m_bios_region != nullptr) { /* OnePlay bios is encrypted, TenPlay is not */ - UINT16 *rom = (UINT16 *)m_bios_region->base(); + uint16_t *rom = (uint16_t *)m_bios_region->base(); if (rom[0] != 0x4afc) { diff --git a/src/mame/drivers/artmagic.cpp b/src/mame/drivers/artmagic.cpp index 21445451441..5a601d0ff8d 100644 --- a/src/mame/drivers/artmagic.cpp +++ b/src/mame/drivers/artmagic.cpp @@ -130,7 +130,7 @@ void artmagic_state::device_timer(emu_timer &timer, device_timer_id id, int para READ16_MEMBER(artmagic_state::ultennis_hack_r) { /* IRQ5 points to: jsr (a5); rte */ - UINT32 pc = space.device().safe_pc(); + uint32_t pc = space.device().safe_pc(); if (pc == 0x18c2 || pc == 0x18e4) { m_hack_irq = 1; @@ -161,15 +161,15 @@ void artmagic_state::ultennis_protection() case 0x01: /* 01 aaaa bbbb cccc dddd (xxxx) */ if (m_prot_input_index == 9) { - UINT16 a = m_prot_input[1] | (m_prot_input[2] << 8); - UINT16 b = m_prot_input[3] | (m_prot_input[4] << 8); - UINT16 c = m_prot_input[5] | (m_prot_input[6] << 8); - UINT16 d = m_prot_input[7] | (m_prot_input[8] << 8); - UINT16 x = a - b; - if ((INT16)x >= 0) + uint16_t a = m_prot_input[1] | (m_prot_input[2] << 8); + uint16_t b = m_prot_input[3] | (m_prot_input[4] << 8); + uint16_t c = m_prot_input[5] | (m_prot_input[6] << 8); + uint16_t d = m_prot_input[7] | (m_prot_input[8] << 8); + uint16_t x = a - b; + if ((int16_t)x >= 0) x = (x * c) >> 16; else - x = -(((UINT16)-x * c) >> 16); + x = -(((uint16_t)-x * c) >> 16); x += d; m_prot_output[0] = x; m_prot_output[1] = x >> 8; @@ -195,10 +195,10 @@ void artmagic_state::ultennis_protection() */ if (m_prot_input_index == 7) { - UINT16 a = (INT16)(m_prot_input[1] | (m_prot_input[2] << 8)); - UINT16 b = (INT16)(m_prot_input[3] | (m_prot_input[4] << 8)); - /*UINT16 c = (INT16)(m_prot_input[5] | (m_prot_input[6] << 8));*/ - UINT32 x = a * a * (b/2); + uint16_t a = (int16_t)(m_prot_input[1] | (m_prot_input[2] << 8)); + uint16_t b = (int16_t)(m_prot_input[3] | (m_prot_input[4] << 8)); + /*uint16_t c = (int16_t)(m_prot_input[5] | (m_prot_input[6] << 8));*/ + uint32_t x = a * a * (b/2); m_prot_output[0] = x; m_prot_output[1] = x >> 8; m_prot_output[2] = x >> 16; @@ -212,7 +212,7 @@ void artmagic_state::ultennis_protection() case 0x03: /* 03 (xxxx) */ if (m_prot_input_index == 1) { - UINT16 x = m_prot_save; + uint16_t x = m_prot_save; m_prot_output[0] = x; m_prot_output[1] = x >> 8; m_prot_output_index = 0; @@ -224,7 +224,7 @@ void artmagic_state::ultennis_protection() case 0x04: /* 04 aaaa */ if (m_prot_input_index == 3) { - UINT16 a = m_prot_input[1] | (m_prot_input[2] << 8); + uint16_t a = m_prot_input[1] | (m_prot_input[2] << 8); m_prot_save = a; m_prot_input_index = m_prot_output_index = 0; } @@ -251,15 +251,15 @@ void artmagic_state::cheesech_protection() case 0x01: /* 01 aaaa bbbb (xxxx) */ if (m_prot_input_index == 5) { - UINT16 a = m_prot_input[1] | (m_prot_input[2] << 8); - UINT16 b = m_prot_input[3] | (m_prot_input[4] << 8); - UINT16 c = 0x4000; /* seems to be hard-coded */ - UINT16 d = 0x00a0; /* seems to be hard-coded */ - UINT16 x = a - b; - if ((INT16)x >= 0) + uint16_t a = m_prot_input[1] | (m_prot_input[2] << 8); + uint16_t b = m_prot_input[3] | (m_prot_input[4] << 8); + uint16_t c = 0x4000; /* seems to be hard-coded */ + uint16_t d = 0x00a0; /* seems to be hard-coded */ + uint16_t x = a - b; + if ((int16_t)x >= 0) x = (x * c) >> 16; else - x = -(((UINT16)-x * c) >> 16); + x = -(((uint16_t)-x * c) >> 16); x += d; m_prot_output[0] = x; m_prot_output[1] = x >> 8; @@ -272,7 +272,7 @@ void artmagic_state::cheesech_protection() case 0x03: /* 03 (xxxx) */ if (m_prot_input_index == 1) { - UINT16 x = m_prot_save; + uint16_t x = m_prot_save; m_prot_output[0] = x; m_prot_output[1] = x >> 8; m_prot_output_index = 0; @@ -284,7 +284,7 @@ void artmagic_state::cheesech_protection() case 0x04: /* 04 aaaa */ if (m_prot_input_index == 3) { - UINT16 a = m_prot_input[1] | (m_prot_input[2] << 8); + uint16_t a = m_prot_input[1] | (m_prot_input[2] << 8); m_prot_save = a; m_prot_input_index = m_prot_output_index = 0; } @@ -306,15 +306,15 @@ void artmagic_state::stonebal_protection() case 0x01: /* 01 aaaa bbbb cccc dddd (xxxx) */ if (m_prot_input_index == 9) { - UINT16 a = m_prot_input[1] | (m_prot_input[2] << 8); - UINT16 b = m_prot_input[3] | (m_prot_input[4] << 8); - UINT16 c = m_prot_input[5] | (m_prot_input[6] << 8); - UINT16 d = m_prot_input[7] | (m_prot_input[8] << 8); - UINT16 x = a - b; - if ((INT16)x >= 0) + uint16_t a = m_prot_input[1] | (m_prot_input[2] << 8); + uint16_t b = m_prot_input[3] | (m_prot_input[4] << 8); + uint16_t c = m_prot_input[5] | (m_prot_input[6] << 8); + uint16_t d = m_prot_input[7] | (m_prot_input[8] << 8); + uint16_t x = a - b; + if ((int16_t)x >= 0) x = (x * d) >> 16; else - x = -(((UINT16)-x * d) >> 16); + x = -(((uint16_t)-x * d) >> 16); x += c; m_prot_output[0] = x; m_prot_output[1] = x >> 8; @@ -327,8 +327,8 @@ void artmagic_state::stonebal_protection() case 0x02: /* 02 aaaa (xx) */ if (m_prot_input_index == 3) { - /*UINT16 a = m_prot_input[1] | (m_prot_input[2] << 8);*/ - UINT8 x = 0xa5; + /*uint16_t a = m_prot_input[1] | (m_prot_input[2] << 8);*/ + uint8_t x = 0xa5; m_prot_output[0] = x; m_prot_output_index = 0; } @@ -339,7 +339,7 @@ void artmagic_state::stonebal_protection() case 0x03: /* 03 (xxxx) */ if (m_prot_input_index == 1) { - UINT16 x = m_prot_save; + uint16_t x = m_prot_save; m_prot_output[0] = x; m_prot_output[1] = x >> 8; m_prot_output_index = 0; @@ -351,7 +351,7 @@ void artmagic_state::stonebal_protection() case 0x04: /* 04 aaaa */ if (m_prot_input_index == 3) { - UINT16 a = m_prot_input[1] | (m_prot_input[2] << 8); + uint16_t a = m_prot_input[1] | (m_prot_input[2] << 8); m_prot_save = a; m_prot_input_index = m_prot_output_index = 0; } diff --git a/src/mame/drivers/ashnojoe.cpp b/src/mame/drivers/ashnojoe.cpp index 8116bfb4439..74328538f48 100644 --- a/src/mame/drivers/ashnojoe.cpp +++ b/src/mame/drivers/ashnojoe.cpp @@ -432,7 +432,7 @@ ROM_END DRIVER_INIT_MEMBER(ashnojoe_state,ashnojoe) { - UINT8 *ROM = memregion("adpcm")->base(); + uint8_t *ROM = memregion("adpcm")->base(); membank("bank4")->configure_entries(0, 16, &ROM[0x00000], 0x8000); membank("bank4")->set_entry(0); diff --git a/src/mame/drivers/asst128.cpp b/src/mame/drivers/asst128.cpp index 11712e55973..fb4e47c8f08 100644 --- a/src/mame/drivers/asst128.cpp +++ b/src/mame/drivers/asst128.cpp @@ -10,7 +10,7 @@ class asst128_mb_device : public ibm5150_mb_device { public: // construction/destruction - asst128_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + asst128_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ibm5150_mb_device(mconfig, tag, owner, clock) { } DECLARE_ADDRESS_MAP(map, 8); diff --git a/src/mame/drivers/asterix.cpp b/src/mame/drivers/asterix.cpp index 4fffb272831..fc07c8778aa 100644 --- a/src/mame/drivers/asterix.cpp +++ b/src/mame/drivers/asterix.cpp @@ -93,13 +93,13 @@ WRITE16_MEMBER(asterix_state::protection_w) if (offset == 1) { - UINT32 cmd = (m_prot[0] << 16) | m_prot[1]; + uint32_t cmd = (m_prot[0] << 16) | m_prot[1]; switch (cmd >> 24) { case 0x64: { - UINT32 param1 = (read_word(cmd & 0xffffff) << 16) | read_word((cmd & 0xffffff) + 2); - UINT32 param2 = (read_word((cmd & 0xffffff) + 4) << 16) | read_word((cmd & 0xffffff) + 6); + uint32_t param1 = (read_word(cmd & 0xffffff) << 16) | read_word((cmd & 0xffffff) + 2); + uint32_t param2 = (read_word((cmd & 0xffffff) + 4) << 16) | read_word((cmd & 0xffffff) + 6); switch (param1 >> 24) { @@ -131,14 +131,14 @@ WRITE16_MEMBER(asterix_state::protection_w) if (offset == 1) { - UINT32 cmd = (m_prot[0] << 16) | m_prot[1]; + uint32_t cmd = (m_prot[0] << 16) | m_prot[1]; switch (cmd >> 24) { case 0x64: { - UINT32 param1 = (space.read_word(cmd & 0xffffff) << 16) + uint32_t param1 = (space.read_word(cmd & 0xffffff) << 16) | space.read_word((cmd & 0xffffff) + 2); - UINT32 param2 = (space.read_word((cmd & 0xffffff) + 4) << 16) + uint32_t param2 = (space.read_word((cmd & 0xffffff) + 4) << 16) | space.read_word((cmd & 0xffffff) + 6); switch (param1 >> 24) @@ -432,8 +432,8 @@ ROM_END DRIVER_INIT_MEMBER(asterix_state,asterix) { #if 0 - *(UINT16 *)(memregion("maincpu")->base() + 0x07f34) = 0x602a; - *(UINT16 *)(memregion("maincpu")->base() + 0x00008) = 0x0400; + *(uint16_t *)(memregion("maincpu")->base() + 0x07f34) = 0x602a; + *(uint16_t *)(memregion("maincpu")->base() + 0x00008) = 0x0400; #endif } diff --git a/src/mame/drivers/astinvad.cpp b/src/mame/drivers/astinvad.cpp index f98cccb3500..79ecbf97b80 100644 --- a/src/mame/drivers/astinvad.cpp +++ b/src/mame/drivers/astinvad.cpp @@ -66,15 +66,15 @@ public: optional_device m_ppi8255_0; optional_device m_ppi8255_1; required_device m_palette; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; - std::unique_ptr m_colorram; + std::unique_ptr m_colorram; emu_timer *m_int_timer; - UINT8 m_sound_state[2]; - UINT8 m_screen_flip; - UINT8 m_screen_red; - UINT8 m_flip_yoffs; - UINT8 m_color_latch; + uint8_t m_sound_state[2]; + uint8_t m_screen_flip; + uint8_t m_screen_red; + uint8_t m_flip_yoffs; + uint8_t m_color_latch; required_device m_samples; required_device m_screen; @@ -98,11 +98,11 @@ public: DECLARE_MACHINE_START(spaceint); DECLARE_MACHINE_RESET(spaceint); DECLARE_VIDEO_START(spaceint); - UINT32 screen_update_astinvad(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spaceint(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_astinvad(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spaceint(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(kamikaze_int_off); TIMER_CALLBACK_MEMBER(kamizake_int_gen); - void plot_byte( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color ); + void plot_byte( bitmap_rgb32 &bitmap, uint8_t y, uint8_t x, uint8_t data, uint8_t color ); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -117,7 +117,7 @@ protected: VIDEO_START_MEMBER(astinvad_state,spaceint) { - m_colorram = std::make_unique(m_videoram.bytes()); + m_colorram = std::make_unique(m_videoram.bytes()); save_item(NAME(m_color_latch)); save_pointer(NAME(m_colorram.get()), m_videoram.bytes()); @@ -144,9 +144,9 @@ WRITE8_MEMBER(astinvad_state::spaceint_videoram_w) * *************************************/ -void astinvad_state::plot_byte( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color ) +void astinvad_state::plot_byte( bitmap_rgb32 &bitmap, uint8_t y, uint8_t x, uint8_t data, uint8_t color ) { - UINT8 flip_xor = m_screen_flip & 7; + uint8_t flip_xor = m_screen_flip & 7; bitmap.pix32(y, x + (0 ^ flip_xor)) = (data & 0x01) ? m_palette->pen_color(color) : rgb_t::black; bitmap.pix32(y, x + (1 ^ flip_xor)) = (data & 0x02) ? m_palette->pen_color(color) : rgb_t::black; @@ -159,18 +159,18 @@ void astinvad_state::plot_byte( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 da } -UINT32 astinvad_state::screen_update_astinvad(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t astinvad_state::screen_update_astinvad(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - const UINT8 *color_prom = memregion("proms")->base(); - UINT8 yoffs = m_flip_yoffs & m_screen_flip; + const uint8_t *color_prom = memregion("proms")->base(); + uint8_t yoffs = m_flip_yoffs & m_screen_flip; int x, y; /* render the visible pixels */ for (y = cliprect.min_y; y <= cliprect.max_y; y++) for (x = cliprect.min_x & ~7; x <= cliprect.max_x; x += 8) { - UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (m_screen_flip ? 0 : 4); - UINT8 data = m_videoram[(((y ^ m_screen_flip) + yoffs) << 5) | ((x ^ m_screen_flip) >> 3)]; + uint8_t color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (m_screen_flip ? 0 : 4); + uint8_t data = m_videoram[(((y ^ m_screen_flip) + yoffs) << 5) | ((x ^ m_screen_flip) >> 3)]; plot_byte(bitmap, y, x, data, m_screen_red ? 1 : color & 0x07); } @@ -178,11 +178,11 @@ UINT32 astinvad_state::screen_update_astinvad(screen_device &screen, bitmap_rgb3 } -UINT32 astinvad_state::screen_update_spaceint(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t astinvad_state::screen_update_spaceint(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); offs_t offs,n; - UINT8 x,y,data,color; + uint8_t x,y,data,color; for (offs = 0; offs < m_videoram.bytes(); offs++) { @@ -302,7 +302,7 @@ INPUT_CHANGED_MEMBER(astinvad_state::spaceint_coin_inserted) READ8_MEMBER(astinvad_state::kamikaze_ppi_r) { - UINT8 result = 0xff; + uint8_t result = 0xff; /* the address lines are used for /CS; yes, they can overlap! */ if (!(offset & 4)) diff --git a/src/mame/drivers/astrafr.cpp b/src/mame/drivers/astrafr.cpp index 34a6523d8a7..81ea2d3eb23 100644 --- a/src/mame/drivers/astrafr.cpp +++ b/src/mame/drivers/astrafr.cpp @@ -31,13 +31,13 @@ public: fgpa_after_rom_write_addr = 0xffff; } - UINT32* m_cpuregion; + uint32_t* m_cpuregion; int m_cpuregion_size; - std::unique_ptr m_mainram; + std::unique_ptr m_mainram; - UINT32* m_slavecpuregion; + uint32_t* m_slavecpuregion; int m_slavecpuregion_size; - std::unique_ptr m_slaveram; + std::unique_ptr m_slaveram; @@ -49,9 +49,9 @@ public: // ports move above from game to game.. - UINT16 fgpa_rom_write_addr; - UINT16 fgpa_first_read_addr; - UINT16 fgpa_after_rom_write_addr; + uint16_t fgpa_rom_write_addr; + uint16_t fgpa_first_read_addr; + uint16_t fgpa_after_rom_write_addr; DECLARE_READ8_MEMBER( astra_fgpa_r ) { @@ -268,15 +268,15 @@ INPUT_PORTS_END MACHINE_START_MEMBER(astrafr_state,astra_common) { - m_cpuregion = (UINT32*)memregion( "maincpu" )->base(); + m_cpuregion = (uint32_t*)memregion( "maincpu" )->base(); m_cpuregion_size = memregion( "maincpu" )->bytes()/4; - m_mainram = make_unique_clear(0x10000); + m_mainram = make_unique_clear(0x10000); if (memregion("slavecpu")) { - m_slavecpuregion = (UINT32*)memregion( "slavecpu" )->base(); + m_slavecpuregion = (uint32_t*)memregion( "slavecpu" )->base(); m_slavecpuregion_size = memregion( "slavecpu" )->bytes()/4; - m_slaveram = make_unique_clear(0x10000); + m_slaveram = make_unique_clear(0x10000); } @@ -2093,9 +2093,9 @@ ROM_END -static void astra_addresslines( UINT16* src, size_t srcsize, int small ) +static void astra_addresslines( uint16_t* src, size_t srcsize, int small ) { - std::vector dst(srcsize/2); + std::vector dst(srcsize/2); int blocksize; @@ -2117,26 +2117,26 @@ static void astra_addresslines( UINT16* src, size_t srcsize, int small ) DRIVER_INIT_MEMBER(astrafr_state,astradec) { - astra_addresslines( (UINT16*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 0 ); + astra_addresslines( (uint16_t*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 0 ); } DRIVER_INIT_MEMBER(astrafr_state,astradec_dual) { - astra_addresslines( (UINT16*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 0 ); - astra_addresslines( (UINT16*)memregion( "slavecpu" )->base(), memregion( "slavecpu" )->bytes(), 0 ); + astra_addresslines( (uint16_t*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 0 ); + astra_addresslines( (uint16_t*)memregion( "slavecpu" )->base(), memregion( "slavecpu" )->bytes(), 0 ); } DRIVER_INIT_MEMBER(astrafr_state,astradec_sml) { - astra_addresslines( (UINT16*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 1 ); + astra_addresslines( (uint16_t*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 1 ); } DRIVER_INIT_MEMBER(astrafr_state,astradec_sml_dual) { - astra_addresslines( (UINT16*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 1 ); - astra_addresslines( (UINT16*)memregion( "slavecpu" )->base(), memregion( "slavecpu" )->bytes(), 1 ); + astra_addresslines( (uint16_t*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 1 ); + astra_addresslines( (uint16_t*)memregion( "slavecpu" )->base(), memregion( "slavecpu" )->bytes(), 1 ); } // Single games? diff --git a/src/mame/drivers/astrcorp.cpp b/src/mame/drivers/astrcorp.cpp index a630472f739..3f59c92a7cc 100644 --- a/src/mame/drivers/astrcorp.cpp +++ b/src/mame/drivers/astrcorp.cpp @@ -64,12 +64,12 @@ public: required_device m_palette; // memory pointers - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; // video-related bitmap_ind16 m_bitmap; - UINT16 m_screen_enable; - UINT16 m_draw_sprites; + uint16_t m_screen_enable; + uint16_t m_draw_sprites; DECLARE_WRITE16_MEMBER(astrocorp_draw_sprites_w); DECLARE_WRITE16_MEMBER(astrocorp_eeprom_w); DECLARE_WRITE16_MEMBER(showhand_outputs_w); @@ -82,7 +82,7 @@ public: DECLARE_DRIVER_INIT(showhanc); DECLARE_DRIVER_INIT(showhand); DECLARE_VIDEO_START(astrocorp); - UINT32 screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(skilldrp_scanline); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -124,8 +124,8 @@ VIDEO_START_MEMBER(astrocorp_state,astrocorp) void astrocorp_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 *source = m_spriteram; - UINT16 *finish = m_spriteram + m_spriteram.bytes() / 2; + uint16_t *source = m_spriteram; + uint16_t *finish = m_spriteram + m_spriteram.bytes() / 2; for ( ; source < finish; source += 8 / 2 ) { @@ -169,7 +169,7 @@ void astrocorp_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clipre } } -UINT32 astrocorp_state::screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t astrocorp_state::screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_screen_enable & 1) copybitmap(bitmap, m_bitmap, 0,0,0,0, cliprect); @@ -186,8 +186,8 @@ UINT32 astrocorp_state::screen_update_astrocorp(screen_device &screen, bitmap_in WRITE16_MEMBER(astrocorp_state::astrocorp_draw_sprites_w) { - UINT16 old = m_draw_sprites; - UINT16 now = COMBINE_DATA(&m_draw_sprites); + uint16_t old = m_draw_sprites; + uint16_t now = COMBINE_DATA(&m_draw_sprites); if (!old && now) draw_sprites(m_bitmap, m_screen->visible_area()); @@ -470,7 +470,7 @@ GFXDECODE_END Machine Drivers ***************************************************************************/ -static const UINT16 showhand_default_eeprom[15] = {0x0001,0x0007,0x000a,0x0003,0x0000,0x0009,0x0003,0x0000,0x0002,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000}; +static const uint16_t showhand_default_eeprom[15] = {0x0001,0x0007,0x000a,0x0003,0x0000,0x0009,0x0003,0x0000,0x0002,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000}; /* @@ -1176,7 +1176,7 @@ ROM_END DRIVER_INIT_MEMBER(astrocorp_state,showhand) { #if 0 - UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t*)memregion("maincpu")->base(); rom[0x0a1a/2] = 0x6000; // hopper jam @@ -1192,7 +1192,7 @@ DRIVER_INIT_MEMBER(astrocorp_state,showhand) DRIVER_INIT_MEMBER(astrocorp_state,showhanc) { #if 0 - UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t*)memregion("maincpu")->base(); rom[0x14d4/2] = 0x4e71; // enable full test mode rom[0x14d6/2] = 0x4e71; // "" @@ -1205,8 +1205,8 @@ DRIVER_INIT_MEMBER(astrocorp_state,showhanc) DRIVER_INIT_MEMBER(astrocorp_state,astoneag) { #if 0 - UINT16 *rom = (UINT16*)memregion("maincpu")->base(); - UINT16 x; + uint16_t *rom = (uint16_t*)memregion("maincpu")->base(); + uint16_t x; int i; for (i = 0x25100/2; i < 0x25200/2; i++) diff --git a/src/mame/drivers/astrocde.cpp b/src/mame/drivers/astrocde.cpp index a100df2e52e..3744c2f389e 100644 --- a/src/mame/drivers/astrocde.cpp +++ b/src/mame/drivers/astrocde.cpp @@ -185,7 +185,7 @@ WRITE8_MEMBER(astrocde_state::seawolf2_lamps_w) WRITE8_MEMBER(astrocde_state::seawolf2_sound_1_w)// Port 40 { - UINT8 rising_bits = data & ~m_port_1_last; + uint8_t rising_bits = data & ~m_port_1_last; m_port_1_last = data; if (rising_bits & 0x01) m_samples->start(1, 1); /* Left Torpedo */ @@ -199,7 +199,7 @@ WRITE8_MEMBER(astrocde_state::seawolf2_sound_1_w)// Port 40 WRITE8_MEMBER(astrocde_state::seawolf2_sound_2_w)// Port 41 { - UINT8 rising_bits = data & ~m_port_2_last; + uint8_t rising_bits = data & ~m_port_2_last; m_port_2_last = data; m_samples->set_volume(0, (data & 0x80) ? 1.0 : 0.0); @@ -276,7 +276,7 @@ READ8_MEMBER(astrocde_state::spacezap_io_r) READ8_MEMBER(astrocde_state::wow_io_r) { - UINT8 data = (offset >> 8) & 1; + uint8_t data = (offset >> 8) & 1; switch ((offset >> 9) & 7) { @@ -301,7 +301,7 @@ READ8_MEMBER(astrocde_state::wow_io_r) READ8_MEMBER(astrocde_state::gorf_io_1_r) { - UINT8 data = (offset >> 8) & 1; + uint8_t data = (offset >> 8) & 1; switch ((offset >> 9) & 7) { @@ -327,7 +327,7 @@ READ8_MEMBER(astrocde_state::gorf_io_1_r) READ8_MEMBER(astrocde_state::gorf_io_2_r) { - UINT8 data = (offset >> 8) & 1; + uint8_t data = (offset >> 8) & 1; switch ((offset >> 9) & 7) { @@ -353,7 +353,7 @@ READ8_MEMBER(astrocde_state::gorf_io_2_r) READ8_MEMBER(astrocde_state::robby_io_r) { - UINT8 data = (offset >> 8) & 1; + uint8_t data = (offset >> 8) & 1; switch ((offset >> 9) & 7) { diff --git a/src/mame/drivers/astrof.cpp b/src/mame/drivers/astrof.cpp index b009cee438d..28ec598488f 100644 --- a/src/mame/drivers/astrof.cpp +++ b/src/mame/drivers/astrof.cpp @@ -125,7 +125,7 @@ CUSTOM_INPUT_MEMBER(astrof_state::astrof_p1_controls_r) CUSTOM_INPUT_MEMBER(astrof_state::astrof_p2_controls_r) { - UINT32 ret; + uint32_t ret; /* on an upright cabinet, a single set of controls is connected to both sets of pins on the edge @@ -141,7 +141,7 @@ CUSTOM_INPUT_MEMBER(astrof_state::astrof_p2_controls_r) CUSTOM_INPUT_MEMBER(astrof_state::tomahawk_controls_r) { - UINT32 ret; + uint32_t ret; /* on a cocktail cabinet, two sets of controls are multiplexed on a single set of inputs @@ -170,25 +170,25 @@ CUSTOM_INPUT_MEMBER(astrof_state::tomahawk_controls_r) void astrof_state::video_start() { /* allocate the color RAM -- half the size of the video RAM as A0 is not connected */ - m_colorram = std::make_unique(m_videoram.bytes() / 2); + m_colorram = std::make_unique(m_videoram.bytes() / 2); save_pointer(NAME(m_colorram.get()), m_videoram.bytes() / 2); } -rgb_t astrof_state::make_pen( UINT8 data ) +rgb_t astrof_state::make_pen( uint8_t data ) { - UINT8 r1_bit = m_red_on ? 0x01 : (data >> 0) & 0x01; - UINT8 r2_bit = m_red_on ? 0x01 : (data >> 1) & 0x01; - UINT8 g1_bit = (data >> 2) & 0x01; - UINT8 g2_bit = (data >> 3) & 0x01; - UINT8 b1_bit = (data >> 4) & 0x01; - UINT8 b2_bit = (data >> 5) & 0x01; + uint8_t r1_bit = m_red_on ? 0x01 : (data >> 0) & 0x01; + uint8_t r2_bit = m_red_on ? 0x01 : (data >> 1) & 0x01; + uint8_t g1_bit = (data >> 2) & 0x01; + uint8_t g2_bit = (data >> 3) & 0x01; + uint8_t b1_bit = (data >> 4) & 0x01; + uint8_t b2_bit = (data >> 5) & 0x01; /* this is probably not quite right, but I don't have the knowledge to figure out the actual weights - ZV */ - UINT8 r = (0xc0 * r1_bit) + (0x3f * r2_bit); - UINT8 g = (0xc0 * g1_bit) + (0x3f * g2_bit); - UINT8 b = (0xc0 * b1_bit) + (0x3f * b2_bit); + uint8_t r = (0xc0 * r1_bit) + (0x3f * r2_bit); + uint8_t g = (0xc0 * g1_bit) + (0x3f * g2_bit); + uint8_t b = (0xc0 * b1_bit) + (0x3f * b2_bit); return rgb_t(r, g, b); } @@ -197,9 +197,9 @@ rgb_t astrof_state::make_pen( UINT8 data ) void astrof_state::astrof_get_pens( pen_t *pens ) { offs_t i; - UINT8 bank = (m_astrof_palette_bank ? 0x10 : 0x00); - UINT8 config = m_fake_port.read_safe(0x00); - UINT8 *prom = memregion("proms")->base(); + uint8_t bank = (m_astrof_palette_bank ? 0x10 : 0x00); + uint8_t config = m_fake_port.read_safe(0x00); + uint8_t *prom = memregion("proms")->base(); /* a common wire hack to the pcb causes the prom halves to be inverted */ /* this results in e.g. astrof background being black */ @@ -224,7 +224,7 @@ void astrof_state::astrof_get_pens( pen_t *pens ) for (i = 0; i < ASTROF_NUM_PENS; i++) { - UINT8 data = prom[bank | i]; + uint8_t data = prom[bank | i]; pens[i] = make_pen(data); } } @@ -233,13 +233,13 @@ void astrof_state::astrof_get_pens( pen_t *pens ) void astrof_state::tomahawk_get_pens( pen_t *pens ) { offs_t i; - UINT8 *prom = memregion("proms")->base(); - UINT8 config = m_fake_port.read_safe(0x00); + uint8_t *prom = memregion("proms")->base(); + uint8_t config = m_fake_port.read_safe(0x00); for (i = 0; i < TOMAHAWK_NUM_PENS; i++) { - UINT8 data; - UINT8 pen; + uint8_t data; + uint8_t pen; /* a common wire hack to the pcb causes the prom halves to be inverted */ /* this results in e.g. astrof background being black */ @@ -298,7 +298,7 @@ WRITE8_MEMBER(astrof_state::video_control_1_w) } -void astrof_state::astrof_set_video_control_2( UINT8 data ) +void astrof_state::astrof_set_video_control_2( uint8_t data ) { /* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */ /* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */ @@ -319,7 +319,7 @@ WRITE8_MEMBER(astrof_state::astrof_video_control_2_w) } -void astrof_state::spfghmk2_set_video_control_2( UINT8 data ) +void astrof_state::spfghmk2_set_video_control_2( uint8_t data ) { /* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */ /* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */ @@ -337,7 +337,7 @@ WRITE8_MEMBER(astrof_state::spfghmk2_video_control_2_w) } -void astrof_state::tomahawk_set_video_control_2( UINT8 data ) +void astrof_state::tomahawk_set_video_control_2( uint8_t data ) { /* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */ /* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */ @@ -360,16 +360,16 @@ void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &c for (offs = 0; offs < m_videoram.bytes(); offs++) { - UINT8 data; + uint8_t data; int i; - UINT8 color = m_colorram[offs >> 1]; + uint8_t color = m_colorram[offs >> 1]; pen_t back_pen = pens[(color & (num_pens-1)) | 0x00]; pen_t fore_pen = pens[(color & (num_pens-1)) | 0x01]; - UINT8 y = offs; - UINT8 x = offs >> 8 << 3; + uint8_t y = offs; + uint8_t x = offs >> 8 << 3; if (!m_flipscreen) y = ~y; @@ -398,7 +398,7 @@ void astrof_state::video_update_common( bitmap_rgb32 &bitmap, const rectangle &c } -UINT32 astrof_state::screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t astrof_state::screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { pen_t pens[ASTROF_NUM_PENS]; @@ -410,7 +410,7 @@ UINT32 astrof_state::screen_update_astrof(screen_device &screen, bitmap_rgb32 &b } -UINT32 astrof_state::screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t astrof_state::screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { pen_t pens[TOMAHAWK_NUM_PENS]; @@ -1293,8 +1293,8 @@ ROM_END DRIVER_INIT_MEMBER(astrof_state,abattle) { /* use the protection PROM to decrypt the ROMs */ - UINT8 *rom = memregion("maincpu")->base(); - UINT8 *prom = memregion("user1")->base(); + uint8_t *rom = memregion("maincpu")->base(); + uint8_t *prom = memregion("user1")->base(); int i; for(i = 0xd000; i < 0x10000; i++) @@ -1308,7 +1308,7 @@ DRIVER_INIT_MEMBER(astrof_state,abattle) DRIVER_INIT_MEMBER(astrof_state,afire) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; for(i = 0xd000; i < 0x10000; i++) @@ -1322,7 +1322,7 @@ DRIVER_INIT_MEMBER(astrof_state,afire) DRIVER_INIT_MEMBER(astrof_state,sstarbtl) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; for(i = 0xd000; i < 0x10000; i++) diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp index f651d909f2e..aa6d3028863 100644 --- a/src/mame/drivers/at.cpp +++ b/src/mame/drivers/at.cpp @@ -48,7 +48,7 @@ public: DECLARE_MACHINE_START(vrom_fix); void init_at_common(int xmsbase); - UINT16 m_ps1_reg[2]; + uint16_t m_ps1_reg[2]; }; class megapc_state : public driver_device @@ -136,7 +136,7 @@ WRITE16_MEMBER( at_state::ps1_unk_w ) READ8_MEMBER( at_state::ps1_portb_r ) { - UINT8 data = m_mb->portb_r(space, offset); + uint8_t data = m_mb->portb_r(space, offset); /* 0x10 is the dram refresh line bit, 15.085us. */ data = (data & ~0x10) | ((machine().time().as_ticks(66291) & 1) ? 0x10 : 0); @@ -174,21 +174,21 @@ ADDRESS_MAP_END DRIVER_INIT_MEMBER(megapc_state, megapc) { - UINT8* ROM = memregion("bios")->base(); + uint8_t* ROM = memregion("bios")->base(); ROM[0x19145] = 0x45; // hack to fix keyboard. To be removed when the keyboard controller from the MegaPC is dumped ROM[0x1fea0] = 0x20; // to correct checksum } DRIVER_INIT_MEMBER(megapc_state, megapcpl) { - UINT8* ROM = memregion("bios")->base(); + uint8_t* ROM = memregion("bios")->base(); ROM[0x187b1] = 0x55; // hack to fix keyboard. To be removed when the keyboard controller from the MegaPC is dumped ROM[0x1fea0] = 0x20; // to correct checksum } DRIVER_INIT_MEMBER(at_state, megapcpla) { - UINT8* ROM = memregion("bios")->base(); + uint8_t* ROM = memregion("bios")->base(); init_at_common(0xa0000); diff --git a/src/mame/drivers/atari400.cpp b/src/mame/drivers/atari400.cpp index cf0f2f30691..1f61e7917d2 100644 --- a/src/mame/drivers/atari400.cpp +++ b/src/mame/drivers/atari400.cpp @@ -311,9 +311,9 @@ protected: int m_cart_disabled, m_cart_helper; int m_last_offs; - UINT8 m_mmu, m_ext_bank; + uint8_t m_mmu, m_ext_bank; - void setup_ram(int bank,UINT32 size); + void setup_ram(int bank,uint32_t size); void setup_cart(a800_cart_slot_device *slot); }; @@ -1002,7 +1002,7 @@ dependent upon display type. * **************************************************************/ -static const UINT8 atari_palette[256*3] = +static const uint8_t atari_palette[256*3] = { /* Grey */ 0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33, @@ -1701,21 +1701,21 @@ LIGHT-ORANGE * **************************************************************/ -void a400_state::setup_ram(int bank, UINT32 size) +void a400_state::setup_ram(int bank, uint32_t size) { offs_t ram_top; switch (bank) { case 0: // 0x0000-0x7fff - ram_top = std::min(size, UINT32(0x8000)) - 1; + ram_top = std::min(size, uint32_t(0x8000)) - 1; m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, ram_top, "0000"); if (m_0000 == nullptr) m_0000.findit(false); m_0000->set_base(m_ram->pointer()); break; case 1: // 0x8000-0x9fff - ram_top = std::min(size, UINT32(0xa000)) - 1; + ram_top = std::min(size, uint32_t(0xa000)) - 1; if (ram_top > 0x8000) { m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x8000, ram_top, "8000"); @@ -1725,7 +1725,7 @@ void a400_state::setup_ram(int bank, UINT32 size) } break; case 2: // 0xa000-0xbfff - ram_top = std::min(size, UINT32(0xc000)) - 1; + ram_top = std::min(size, uint32_t(0xc000)) - 1; if (ram_top > 0xa000) { m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0xa000, ram_top, "a000"); diff --git a/src/mame/drivers/atari_s1.cpp b/src/mame/drivers/atari_s1.cpp index 1d39882ea7a..5621fe88c64 100644 --- a/src/mame/drivers/atari_s1.cpp +++ b/src/mame/drivers/atari_s1.cpp @@ -86,19 +86,19 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_s); private: bool m_audiores; - UINT8 m_timer_s[3]; - UINT8 m_vol; - UINT8 m_1080; - UINT8 m_1084; - UINT8 m_1088; - UINT8 m_108c; - UINT8 m_bit6; - UINT8 m_out_offs; - UINT8 m_t_c; - UINT8 *m_p_prom; + uint8_t m_timer_s[3]; + uint8_t m_vol; + uint8_t m_1080; + uint8_t m_1084; + uint8_t m_1088; + uint8_t m_108c; + uint8_t m_bit6; + uint8_t m_out_offs; + uint8_t m_t_c; + uint8_t *m_p_prom; virtual void machine_reset() override; required_device m_maincpu; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; required_device m_dac; required_ioport_array<10> m_switch; }; @@ -360,7 +360,7 @@ READ8_MEMBER( atari_s1_state::switch_r ) TIMER_DEVICE_CALLBACK_MEMBER( atari_s1_state::nmi ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 m_bit6++; if (m_t_c > 0x40) m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); diff --git a/src/mame/drivers/atari_s2.cpp b/src/mame/drivers/atari_s2.cpp index 2727c0522be..0307a3f376d 100644 --- a/src/mame/drivers/atari_s2.cpp +++ b/src/mame/drivers/atari_s2.cpp @@ -50,13 +50,13 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_s); private: bool m_timer_sb; - UINT8 m_timer_s[5]; - UINT8 m_sound0; - UINT8 m_sound1; - UINT8 m_vol; - UINT8 m_t_c; - UINT8 m_segment[7]; - UINT8 *m_p_prom; + uint8_t m_timer_s[5]; + uint8_t m_sound0; + uint8_t m_sound1; + uint8_t m_vol; + uint8_t m_t_c; + uint8_t m_segment[7]; + uint8_t *m_p_prom; virtual void machine_reset() override; required_device m_maincpu; required_device m_dac; @@ -345,13 +345,13 @@ WRITE8_MEMBER( atari_s2_state::sol0_w ) WRITE8_MEMBER( atari_s2_state::display_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 if (offset<7) m_segment[offset] = patterns[data&15]; else { data &= 7; - for (UINT8 i = 0; i < 7; i++) + for (uint8_t i = 0; i < 7; i++) output().set_digit_value(i * 10 + data, m_segment[i]); } } diff --git a/src/mame/drivers/atarig1.cpp b/src/mame/drivers/atarig1.cpp index 9a8d509e712..4a9bd7b1bd1 100644 --- a/src/mame/drivers/atarig1.cpp +++ b/src/mame/drivers/atarig1.cpp @@ -171,10 +171,10 @@ void atarig1_state::pitfightb_cheap_slapstic_init() { /* install a read handler */ m_maincpu->space(AS_PROGRAM).install_read_handler(0x038000, 0x03ffff, read16_delegate(FUNC(atarig1_state::pitfightb_cheap_slapstic_r),this)); - m_bslapstic_base = (UINT16 *)(memregion("maincpu")->base() + 0x38000); + m_bslapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0x38000); /* allocate memory for a copy of bank 0 */ - m_bslapstic_bank0 = std::make_unique(0x2000); + m_bslapstic_bank0 = std::make_unique(0x2000); memcpy(m_bslapstic_bank0.get(), m_bslapstic_base, 0x2000); /* not primed by default */ diff --git a/src/mame/drivers/atarig42.cpp b/src/mame/drivers/atarig42.cpp index 343a6204043..1f02a5905c2 100644 --- a/src/mame/drivers/atarig42.cpp +++ b/src/mame/drivers/atarig42.cpp @@ -264,7 +264,7 @@ WRITE16_MEMBER(atarig42_state::roadriot_sloop_data_w) void atarig42_state::guardians_sloop_tweak(int offset) { - UINT32 *last_accesses = m_last_accesses; + uint32_t *last_accesses = m_last_accesses; if (offset >= 0x7f7c0/2) { @@ -828,7 +828,7 @@ DRIVER_INIT_MEMBER(atarig42_state,roadriot) address_space &main = m_maincpu->space(AS_PROGRAM); main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::roadriot_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::roadriot_sloop_data_w),this)); - m_sloop_base = (UINT16 *)memregion("maincpu")->base(); + m_sloop_base = (uint16_t *)memregion("maincpu")->base(); /* Road Riot color MUX @@ -859,11 +859,11 @@ DRIVER_INIT_MEMBER(atarig42_state,guardian) /* it looks like they jsr to $80000 as some kind of protection */ /* put an RTS there so we don't die */ - *(UINT16 *)&memregion("maincpu")->base()[0x80000] = 0x4E75; + *(uint16_t *)&memregion("maincpu")->base()[0x80000] = 0x4E75; address_space &main = m_maincpu->space(AS_PROGRAM); main.install_readwrite_handler(0x000000, 0x07ffff, read16_delegate(FUNC(atarig42_state::guardians_sloop_data_r),this), write16_delegate(FUNC(atarig42_state::guardians_sloop_data_w),this)); - m_sloop_base = (UINT16 *)memregion("maincpu")->base(); + m_sloop_base = (uint16_t *)memregion("maincpu")->base(); /* Guardians color MUX diff --git a/src/mame/drivers/atarigt.cpp b/src/mame/drivers/atarigt.cpp index 152ba46027e..e21ff4c0dab 100644 --- a/src/mame/drivers/atarigt.cpp +++ b/src/mame/drivers/atarigt.cpp @@ -239,7 +239,7 @@ WRITE32_MEMBER(atarigt_state::led_w) READ32_MEMBER(atarigt_state::sound_data_r) { - UINT32 result = 0; + uint32_t result = 0; if (ACCESSING_BITS_0_15) result |= m_cage->control_r(); @@ -276,7 +276,7 @@ void atarigt_state::tmek_update_mode(offs_t offset) } -void atarigt_state::tmek_protection_w(address_space &space, offs_t offset, UINT16 data) +void atarigt_state::tmek_protection_w(address_space &space, offs_t offset, uint16_t data) { /* T-Mek init: @@ -299,7 +299,7 @@ void atarigt_state::tmek_protection_w(address_space &space, offs_t offset, UINT1 } } -void atarigt_state::tmek_protection_r(address_space &space, offs_t offset, UINT16 *data) +void atarigt_state::tmek_protection_r(address_space &space, offs_t offset, uint16_t *data) { if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", space.device().safe_pcbase(), offset); @@ -363,11 +363,11 @@ void atarigt_state::primrage_update_mode(offs_t offset) -void atarigt_state::primrage_protection_w(address_space &space, offs_t offset, UINT16 data) +void atarigt_state::primrage_protection_w(address_space &space, offs_t offset, uint16_t data) { if (LOG_PROTECTION) { - UINT32 pc = space.device().safe_pcbase(); + uint32_t pc = space.device().safe_pcbase(); switch (pc) { /* protection code from 20f90 - 21000 */ @@ -433,15 +433,15 @@ void atarigt_state::primrage_protection_w(address_space &space, offs_t offset, U -void atarigt_state::primrage_protection_r(address_space &space, offs_t offset, UINT16 *data) +void atarigt_state::primrage_protection_r(address_space &space, offs_t offset, uint16_t *data) { /* track accesses */ primrage_update_mode(offset); if (LOG_PROTECTION) { - UINT32 pc = space.device().safe_pcbase(); - UINT32 p1, p2, a6; + uint32_t pc = space.device().safe_pcbase(); + uint32_t p1, p2, a6; switch (pc) { /* protection code from 20f90 - 21000 */ @@ -550,8 +550,8 @@ if (LOG_PROTECTION) READ32_MEMBER(atarigt_state::colorram_protection_r) { offs_t address = 0xd80000 + offset * 4; - UINT32 result32 = 0; - UINT16 result; + uint32_t result32 = 0; + uint16_t result; if (ACCESSING_BITS_16_31) { @@ -1291,14 +1291,14 @@ WRITE32_MEMBER(atarigt_state::tmek_pf_w) /* protected version */ if (pc == 0x2EB3C || pc == 0x2EB48) { - logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", space.device().safe_pc(), 0xd72000 + offset*4, data, mem_mask, (UINT32)space.device().state().state_int(M68K_A4) - 2); + logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", space.device().safe_pc(), 0xd72000 + offset*4, data, mem_mask, (uint32_t)space.device().state().state_int(M68K_A4) - 2); /* skip these writes to make more stuff visible */ return; } /* unprotected version */ if (pc == 0x25834 || pc == 0x25860) - logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", space.device().safe_pc(), 0xd72000 + offset*4, data, mem_mask, (UINT32)space.device().state().state_int(M68K_A3) - 2); + logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", space.device().safe_pc(), 0xd72000 + offset*4, data, mem_mask, (uint32_t)space.device().state().state_int(M68K_A3) - 2); m_playfield_tilemap->write(space, offset, data, mem_mask); } diff --git a/src/mame/drivers/atarigx2.cpp b/src/mame/drivers/atarigx2.cpp index e35dc22e5cb..60d2f15e5f5 100644 --- a/src/mame/drivers/atarigx2.cpp +++ b/src/mame/drivers/atarigx2.cpp @@ -192,9 +192,9 @@ int parameters3[16][2] = { // every output bit is a linear function on the input bits except by // a quadratic term always involving bit #0 of the input -UINT32 ftest4(UINT32 num) +uint32_t ftest4(uint32_t num) { - UINT32 accum = 0; + uint32_t accum = 0; for (int i=0; i<16; ++i) { @@ -213,7 +213,7 @@ UINT32 ftest4(UINT32 num) READ32_MEMBER(atarigx2_state::atarigx2_protection_r) { - static const UINT32 lookup_table[][2] = + static const uint32_t lookup_table[][2] = { // sprite flipping { 0x0000e54f, 0<<11 }, @@ -1142,13 +1142,13 @@ READ32_MEMBER(atarigx2_state::atarigx2_protection_r) { 0xffffffff, 0xffff } }; - UINT32 result = m_protection_ram[offset]; + uint32_t result = m_protection_ram[offset]; if (offset == 0x300) result |= 0x80000000; if (offset == 0x3f0) { - UINT32 tag = (m_last_write_offset << 17) | m_last_write; + uint32_t tag = (m_last_write_offset << 17) | m_last_write; int i = 0; while (lookup_table[i][0] != 0xffffffff) diff --git a/src/mame/drivers/atarist.cpp b/src/mame/drivers/atarist.cpp index 0c8ea16536b..59a88fb92e5 100644 --- a/src/mame/drivers/atarist.cpp +++ b/src/mame/drivers/atarist.cpp @@ -98,7 +98,7 @@ void st_state::flush_dma_fifo() if (m_fdc_dmabytes) { address_space &program = m_maincpu->space(AS_PROGRAM); for (int i = 0; i < 8; i++) { - UINT16 data = m_fdc_fifo[m_fdc_fifo_sel][i]; + uint16_t data = m_fdc_fifo[m_fdc_fifo_sel][i]; if (LOG) logerror("Flushing DMA FIFO %u data %04x to address %06x\n", m_fdc_fifo_sel, data, m_dma_base); @@ -129,7 +129,7 @@ void st_state::fill_dma_fifo() if (m_fdc_dmabytes) { address_space &program = m_maincpu->space(AS_PROGRAM); for (int i = 0; i < 8; i++) { - UINT16 data = program.read_word(m_dma_base); + uint16_t data = program.read_word(m_dma_base); if (LOG) logerror("Filling DMA FIFO %u with data %04x from memory address %06x\n", m_fdc_fifo_sel, data, m_dma_base); @@ -158,7 +158,7 @@ void st_state::fdc_dma_transfer() { if (m_fdc_mode & DMA_MODE_READ_WRITE) { - UINT16 data = m_fdc_fifo[m_fdc_fifo_sel][m_fdc_fifo_index]; + uint16_t data = m_fdc_fifo[m_fdc_fifo_sel][m_fdc_fifo_index]; if (m_fdc_fifo_msb) { @@ -196,7 +196,7 @@ void st_state::fdc_dma_transfer() else { // read from controller to FIFO - UINT8 data = m_fdc->data_r(); + uint8_t data = m_fdc->data_r(); m_fdc_fifo_empty[m_fdc_fifo_sel] = 0; @@ -232,7 +232,7 @@ void st_state::fdc_dma_transfer() READ16_MEMBER( st_state::fdc_data_r ) { - UINT8 data = 0; + uint8_t data = 0; if (m_fdc_mode & DMA_MODE_SECTOR_COUNT) { @@ -306,7 +306,7 @@ WRITE16_MEMBER( st_state::fdc_data_w ) READ16_MEMBER( st_state::dma_status_r ) { - UINT16 data = 0; + uint16_t data = 0; // DMA error data |= m_dma_error; @@ -350,7 +350,7 @@ WRITE16_MEMBER( st_state::dma_mode_w ) READ8_MEMBER( st_state::dma_counter_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -457,8 +457,8 @@ void st_state::mouse_tick() */ - UINT8 x = m_mousex->read(); - UINT8 y = m_mousey->read(); + uint8_t x = m_mousex->read(); + uint8_t y = m_mousey->read(); if (m_ikbd_mouse_pc == 0) { @@ -525,7 +525,7 @@ READ8_MEMBER( st_state::ikbd_port1_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // keyboard data if (!BIT(m_ikbd_keylatch, 1)) data &= m_p31->read(); @@ -566,7 +566,7 @@ READ8_MEMBER( st_state::ikbd_port2_r ) */ - UINT8 data = m_joy1.read_safe(0x06) & 0x06; + uint8_t data = m_joy1.read_safe(0x06) & 0x06; // serial receive data |= m_ikbd_tx << 3; @@ -653,7 +653,7 @@ READ8_MEMBER( st_state::ikbd_port4_r ) if (m_ikbd_joy) return 0xff; - UINT8 data = m_joy0.read_safe(0xff); + uint8_t data = m_joy0.read_safe(0xff); if ((m_config->read() & 0x01) == 0) { @@ -758,7 +758,7 @@ void ste_state::dmasound_tick() { if (m_dmasnd_samples == 0) { - UINT8 *RAM = m_ram->pointer(); + uint8_t *RAM = m_ram->pointer(); for (auto & elem : m_dmasnd_fifo) { @@ -834,7 +834,7 @@ READ8_MEMBER( ste_state::sound_dma_control_r ) READ8_MEMBER( ste_state::sound_dma_base_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -861,7 +861,7 @@ READ8_MEMBER( ste_state::sound_dma_base_r ) READ8_MEMBER( ste_state::sound_dma_counter_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -888,7 +888,7 @@ READ8_MEMBER( ste_state::sound_dma_counter_r ) READ8_MEMBER( ste_state::sound_dma_end_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { diff --git a/src/mame/drivers/atarisy1.cpp b/src/mame/drivers/atarisy1.cpp index e9b875c1b6d..d8f4e21e716 100644 --- a/src/mame/drivers/atarisy1.cpp +++ b/src/mame/drivers/atarisy1.cpp @@ -310,17 +310,17 @@ READ16_MEMBER(atarisy1_state::trakball_r) /* when reading the even ports, do a real analog port update */ if (which == 0) { - UINT8 posx,posy; + uint8_t posx,posy; if (player == 0) { - posx = (INT8)ioport("IN0")->read(); - posy = (INT8)ioport("IN1")->read(); + posx = (int8_t)ioport("IN0")->read(); + posy = (int8_t)ioport("IN1")->read(); } else { - posx = (INT8)ioport("IN2")->read(); - posy = (INT8)ioport("IN3")->read(); + posx = (int8_t)ioport("IN2")->read(); + posy = (int8_t)ioport("IN3")->read(); } m_cur[player][0] = posx + posy; diff --git a/src/mame/drivers/atarisy2.cpp b/src/mame/drivers/atarisy2.cpp index 10641c5e4c8..d703efd9153 100644 --- a/src/mame/drivers/atarisy2.cpp +++ b/src/mame/drivers/atarisy2.cpp @@ -421,9 +421,9 @@ READ8_MEMBER(atarisy2_state::leta_r) case 2: /* Fake Spinner */ { - INT32 diff; - UINT32 temp; - UINT32 rotate_count = ioport("FAKE_SPINNER")->read() & 0xffff; + int32_t diff; + uint32_t temp; + uint32_t rotate_count = ioport("FAKE_SPINNER")->read() & 0xffff; /* rotate_count behaves the same as the real LEAT1 Rotate encoder * we use it to generate the LETA0 Center encoder count */ @@ -3157,7 +3157,7 @@ ROM_END DRIVER_INIT_MEMBER(atarisy2_state,paperboy) { int i; - UINT8 *cpu1 = memregion("maincpu")->base(); + uint8_t *cpu1 = memregion("maincpu")->base(); m_slapstic->slapstic_init(); @@ -3186,7 +3186,7 @@ DRIVER_INIT_MEMBER(atarisy2_state,720) DRIVER_INIT_MEMBER(atarisy2_state,ssprint) { int i; - UINT8 *cpu1 = memregion("maincpu")->base(); + uint8_t *cpu1 = memregion("maincpu")->base(); m_slapstic->slapstic_init(); @@ -3201,7 +3201,7 @@ DRIVER_INIT_MEMBER(atarisy2_state,ssprint) DRIVER_INIT_MEMBER(atarisy2_state,csprint) { int i; - UINT8 *cpu1 = memregion("maincpu")->base(); + uint8_t *cpu1 = memregion("maincpu")->base(); m_slapstic->slapstic_init(); diff --git a/src/mame/drivers/atarisy4.cpp b/src/mame/drivers/atarisy4.cpp index 923c091b070..924b1c0161b 100644 --- a/src/mame/drivers/atarisy4.cpp +++ b/src/mame/drivers/atarisy4.cpp @@ -24,8 +24,8 @@ struct atarisy4_polydata { - UINT16 color; - UINT16 *screen_ram; + uint16_t color; + uint16_t *screen_ram; }; class atarisy4_state; @@ -36,8 +36,8 @@ public: atarisy4_renderer(atarisy4_state &state, screen_device &screen); ~atarisy4_renderer() {} - void draw_scanline(INT32 scanline, const extent_t &extent, const atarisy4_polydata &extradata, int threadid); - void draw_polygon(UINT16 color); + void draw_scanline(int32_t scanline, const extent_t &extent, const atarisy4_polydata &extradata, int threadid); + void draw_polygon(uint16_t color); atarisy4_state &m_state; }; @@ -63,20 +63,20 @@ public: required_device m_palette; required_device m_screen; - required_shared_ptr m_m68k_ram; - required_shared_ptr m_screen_ram; + required_shared_ptr m_m68k_ram; + required_shared_ptr m_screen_ram; required_memory_bank m_dsp0_bank1; optional_memory_bank m_dsp1_bank1; std::unique_ptr m_renderer; - UINT8 m_r_color_table[256]; - UINT8 m_g_color_table[256]; - UINT8 m_b_color_table[256]; - UINT16 m_dsp_bank[2]; - UINT8 m_csr[2]; - std::unique_ptr m_shared_ram[2]; + uint8_t m_r_color_table[256]; + uint8_t m_g_color_table[256]; + uint8_t m_b_color_table[256]; + uint16_t m_dsp_bank[2]; + uint8_t m_csr[2]; + std::unique_ptr m_shared_ram[2]; DECLARE_WRITE16_MEMBER(gpu_w); DECLARE_READ16_MEMBER(gpu_r); @@ -99,13 +99,13 @@ public: virtual void video_start() override; virtual void video_reset() override; DECLARE_MACHINE_RESET(airrace); - UINT32 screen_update_atarisy4(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_atarisy4(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_int); void image_mem_to_screen( bool clip); void execute_gpu_command(); - inline UINT8 hex_to_ascii(UINT8 in); - void load_ldafile(address_space &space, const UINT8 *file); - void load_hexfile(address_space &space, const UINT8 *file); + inline uint8_t hex_to_ascii(uint8_t in); + void load_ldafile(address_space &space, const uint8_t *file); + void load_hexfile(address_space &space, const uint8_t *file); }; @@ -119,51 +119,51 @@ public: struct gpu_ { /* Memory-mapped registers */ - UINT16 gr[8]; /* Command parameters */ - - UINT16 bcrw; /* Screen buffer W control */ - UINT16 bcrx; /* Screen buffer X control */ - UINT16 bcry; /* Screen buffer Y control */ - UINT16 bcrz; /* Screen buffer Z control */ - UINT16 psrw; - UINT16 psrx; - UINT16 psry; - UINT16 psrz; - - UINT16 dpr; - UINT16 ctr; - UINT16 lfr; - UINT16 ifr; - UINT16 ecr; /* Execute command register */ - UINT16 far; - UINT16 mcr; /* Interrupt control */ - UINT16 qlr; - UINT16 qar; - - UINT16 dhr; /* Scanline counter */ - UINT16 dlr; + uint16_t gr[8]; /* Command parameters */ + + uint16_t bcrw; /* Screen buffer W control */ + uint16_t bcrx; /* Screen buffer X control */ + uint16_t bcry; /* Screen buffer Y control */ + uint16_t bcrz; /* Screen buffer Z control */ + uint16_t psrw; + uint16_t psrx; + uint16_t psry; + uint16_t psrz; + + uint16_t dpr; + uint16_t ctr; + uint16_t lfr; + uint16_t ifr; + uint16_t ecr; /* Execute command register */ + uint16_t far; + uint16_t mcr; /* Interrupt control */ + uint16_t qlr; + uint16_t qar; + + uint16_t dhr; /* Scanline counter */ + uint16_t dlr; /* Others */ - UINT16 idr; - UINT16 icd; + uint16_t idr; + uint16_t icd; - UINT8 transpose; - UINT8 vblank_wait; + uint8_t transpose; + uint8_t vblank_wait; /* Polygon points */ struct { - INT16 x; - INT16 y; + int16_t x; + int16_t y; } points[16]; - UINT16 pt_idx; + uint16_t pt_idx; bool poly_open; - UINT16 clip_min_x; - UINT16 clip_max_x; - UINT16 clip_min_y; - UINT16 clip_max_y; + uint16_t clip_min_x; + uint16_t clip_max_x; + uint16_t clip_min_y; + uint16_t clip_max_y; } gpu; @@ -189,10 +189,10 @@ void atarisy4_state::video_reset() gpu.vblank_wait = 0; } -UINT32 atarisy4_state::screen_update_atarisy4(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t atarisy4_state::screen_update_atarisy4(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int y; - UINT32 offset = 0; + uint32_t offset = 0; if (gpu.bcrw & 0x80) { @@ -203,17 +203,17 @@ UINT32 atarisy4_state::screen_update_atarisy4(screen_device &screen, bitmap_rgb3 offset = 0x10 << 5; } - //UINT32 offset = gpu.dpr << 5; + //uint32_t offset = gpu.dpr << 5; for (y = cliprect.min_y; y <= cliprect.max_y; ++y) { - UINT16 *src = &m_screen_ram[(offset + (4096 * y)) / 2]; - UINT32 *dest = &bitmap.pix32(y, cliprect.min_x); + uint16_t *src = &m_screen_ram[(offset + (4096 * y)) / 2]; + uint32_t *dest = &bitmap.pix32(y, cliprect.min_x); int x; for (x = cliprect.min_x; x < cliprect.max_x; x += 2) { - UINT16 data = *src++; + uint16_t data = *src++; *dest++ = m_palette->pen(data & 0xff); *dest++ = m_palette->pen(data >> 8); @@ -222,10 +222,10 @@ UINT32 atarisy4_state::screen_update_atarisy4(screen_device &screen, bitmap_rgb3 return 0; } -static inline UINT32 xy_to_screen_addr(UINT32 x, UINT32 y) +static inline uint32_t xy_to_screen_addr(uint32_t x, uint32_t y) { -// UINT32 offset = ((gpu.mcr >> 4) & 3) << 9; - UINT32 offset = 0; +// uint32_t offset = ((gpu.mcr >> 4) & 3) << 9; + uint32_t offset = 0; if (~gpu.bcrw & 0x80) { @@ -241,8 +241,8 @@ static inline UINT32 xy_to_screen_addr(UINT32 x, UINT32 y) void atarisy4_state::image_mem_to_screen(bool clip) { - INT16 y = gpu.gr[1] - 0x200; - UINT16 h = gpu.gr[3]; + int16_t y = gpu.gr[1] - 0x200; + uint16_t h = gpu.gr[3]; if (h & 0x8000) h = -h; @@ -250,8 +250,8 @@ void atarisy4_state::image_mem_to_screen(bool clip) /* Not 100% sure of this */ while (h--) { - UINT16 w = gpu.gr[2]; - INT16 x = gpu.gr[0] - 0x400; + uint16_t w = gpu.gr[2]; + int16_t x = gpu.gr[0] - 0x400; if (w & 0x8000) w = -w; @@ -262,7 +262,7 @@ void atarisy4_state::image_mem_to_screen(bool clip) { if (x >= 0 && x <= 511) { - UINT16 pix = m_screen_ram[xy_to_screen_addr(x,y) >> 1]; + uint16_t pix = m_screen_ram[xy_to_screen_addr(x,y) >> 1]; if (x & 1) pix = (pix & (0x00ff)) | gpu.idr << 8; @@ -278,15 +278,15 @@ void atarisy4_state::image_mem_to_screen(bool clip) } } -void atarisy4_renderer::draw_scanline(INT32 scanline, const extent_t &extent, const atarisy4_polydata &extradata, int threadid) +void atarisy4_renderer::draw_scanline(int32_t scanline, const extent_t &extent, const atarisy4_polydata &extradata, int threadid) { - UINT16 color = extradata.color; + uint16_t color = extradata.color; int x; for (x = extent.startx; x < extent.stopx; ++x) { - UINT32 addr = xy_to_screen_addr(x, scanline); - UINT16 pix = extradata.screen_ram[addr >> 1]; + uint32_t addr = xy_to_screen_addr(x, scanline); + uint16_t pix = extradata.screen_ram[addr >> 1]; if (x & 1) pix = (pix & (0x00ff)) | color << 8; @@ -297,7 +297,7 @@ void atarisy4_renderer::draw_scanline(INT32 scanline, const extent_t &extent, co } } -void atarisy4_renderer::draw_polygon(UINT16 color) +void atarisy4_renderer::draw_polygon(uint16_t color) { rectangle clip; vertex_t v1, v2, v3; @@ -408,7 +408,7 @@ void atarisy4_state::execute_gpu_command() for (i = 0; i < gpu.gr[3]; ++i) { - UINT16 val = m_screen_ram[offset >> 1]; + uint16_t val = m_screen_ram[offset >> 1]; val >>= (~offset & 1) << 3; if (gpu.gr[4] & 0x10) @@ -460,8 +460,8 @@ void atarisy4_state::execute_gpu_command() } case 0x2b: { - UINT16 x = gpu.points[gpu.pt_idx].x + gpu.gr[0]; - UINT16 y = gpu.points[gpu.pt_idx].y + gpu.gr[1]; + uint16_t x = gpu.points[gpu.pt_idx].x + gpu.gr[0]; + uint16_t y = gpu.points[gpu.pt_idx].y + gpu.gr[1]; ++gpu.pt_idx; gpu.points[gpu.pt_idx].x = x; gpu.points[gpu.pt_idx].y = y; @@ -527,7 +527,7 @@ WRITE16_MEMBER(atarisy4_state::gpu_w) READ16_MEMBER(atarisy4_state::gpu_r) { - UINT16 res = 0; + uint16_t res = 0; switch (offset) { @@ -825,7 +825,7 @@ ROM_END * *************************************/ -UINT8 atarisy4_state::hex_to_ascii(UINT8 in) +uint8_t atarisy4_state::hex_to_ascii(uint8_t in) { if (in < 0x3a) return in - 0x30; @@ -835,17 +835,17 @@ UINT8 atarisy4_state::hex_to_ascii(UINT8 in) return in; } -void atarisy4_state::load_ldafile(address_space &space, const UINT8 *file) +void atarisy4_state::load_ldafile(address_space &space, const uint8_t *file) { #define READ_CHAR() file[i++] int i = 0; while (true) { - UINT8 c; - UINT8 sum = 1; - UINT16 len; - UINT16 addr; + uint8_t c; + uint8_t sum = 1; + uint16_t len; + uint16_t addr; if (READ_CHAR() != 0x01) fatalerror("Bad .LDA file\n"); @@ -876,7 +876,7 @@ void atarisy4_state::load_ldafile(address_space &space, const UINT8 *file) addr <<= 1; do { - UINT8 data = READ_CHAR(); + uint8_t data = READ_CHAR(); sum += data; space.write_byte(addr++, data); } while (--len); @@ -889,22 +889,22 @@ void atarisy4_state::load_ldafile(address_space &space, const UINT8 *file) } /* Load memory space with data from a Tektronix-Extended HEX file */ -void atarisy4_state::load_hexfile(address_space &space, const UINT8 *file) +void atarisy4_state::load_hexfile(address_space &space, const uint8_t *file) { #define READ_HEX_CHAR() hex_to_ascii(file[i++]) - UINT32 i = 0; - UINT32 line = 1; + uint32_t i = 0; + uint32_t line = 1; bool end = false; while (true) { - UINT8 len; - UINT8 record; - UINT8 checksum; - UINT8 sum = 0; - UINT8 addr_len; - UINT32 addr = 0; + uint8_t len; + uint8_t record; + uint8_t checksum; + uint8_t sum = 0; + uint8_t addr_len; + uint32_t addr = 0; /* Ignore blank lines */ while (file[i] == '\n') i++; @@ -953,7 +953,7 @@ void atarisy4_state::load_hexfile(address_space &space, const UINT8 *file) /* Form the address */ while (addr_len) { - UINT8 digit; + uint8_t digit; addr <<= 4; digit = READ_HEX_CHAR(); @@ -965,7 +965,7 @@ void atarisy4_state::load_hexfile(address_space &space, const UINT8 *file) /* Now read the data */ while (len) { - UINT8 data; + uint8_t data; data = READ_HEX_CHAR() << 4; data |= READ_HEX_CHAR(); @@ -997,7 +997,7 @@ DRIVER_INIT_MEMBER(atarisy4_state,laststar) address_space &main = m_maincpu->space(AS_PROGRAM); /* Allocate 16kB of shared RAM */ - m_shared_ram[0] = make_unique_clear(0x2000); + m_shared_ram[0] = make_unique_clear(0x2000); /* Populate the 68000 address space with data from the HEX files */ load_hexfile(main, memregion("code")->base()); @@ -1012,8 +1012,8 @@ DRIVER_INIT_MEMBER(atarisy4_state,laststar) DRIVER_INIT_MEMBER(atarisy4_state,airrace) { /* Allocate two sets of 32kB shared RAM */ - m_shared_ram[0] = make_unique_clear(0x4000); - m_shared_ram[1] = make_unique_clear(0x4000); + m_shared_ram[0] = make_unique_clear(0x4000); + m_shared_ram[1] = make_unique_clear(0x4000); /* Populate RAM with data from the HEX files */ load_hexfile(m_maincpu->space(AS_PROGRAM), memregion("code")->base()); diff --git a/src/mame/drivers/atetris.cpp b/src/mame/drivers/atetris.cpp index 639d7c5c6dd..47c639be6a6 100644 --- a/src/mame/drivers/atetris.cpp +++ b/src/mame/drivers/atetris.cpp @@ -547,7 +547,7 @@ ROM_END DRIVER_INIT_MEMBER(atetris_state,atetris) { - UINT8 *rgn = memregion("maincpu")->base(); + uint8_t *rgn = memregion("maincpu")->base(); m_slapstic_device->slapstic_init(); m_slapstic_source = &rgn[0x10000]; diff --git a/src/mame/drivers/atlantis.cpp b/src/mame/drivers/atlantis.cpp index 0af3a4d1a5d..fc3c8118bbd 100644 --- a/src/mame/drivers/atlantis.cpp +++ b/src/mame/drivers/atlantis.cpp @@ -95,7 +95,7 @@ public: DECLARE_DRIVER_INIT(mwskins); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_mwskins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mwskins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_screen; optional_device m_palette; @@ -105,19 +105,19 @@ public: required_device m_uart0; required_device m_uart1; required_device m_rtc; - UINT8 m_rtc_data[0x8000]; + uint8_t m_rtc_data[0x8000]; - UINT32 m_last_offset; + uint32_t m_last_offset; READ8_MEMBER(cmos_r); WRITE8_MEMBER(cmos_w); DECLARE_WRITE32_MEMBER(cmos_protect_w); DECLARE_READ32_MEMBER(cmos_protect_r); - UINT32 m_cmos_write_enabled; - UINT32 m_serial_count; + uint32_t m_cmos_write_enabled; + uint32_t m_serial_count; DECLARE_READ32_MEMBER(status_leds_r); DECLARE_WRITE32_MEMBER(status_leds_w); - UINT8 m_status_leds; + uint8_t m_status_leds; DECLARE_WRITE32_MEMBER(asic_fifo_w); DECLARE_WRITE32_MEMBER(dcs3_fifo_full_w); @@ -133,8 +133,8 @@ public: DECLARE_READ32_MEMBER(board_ctrl_r); DECLARE_WRITE32_MEMBER(board_ctrl_w); - UINT32 m_irq_state; - UINT8 board_ctrl[CTRL_SIZE]; + uint32_t m_irq_state; + uint8_t board_ctrl[CTRL_SIZE]; void update_asic_irq(); DECLARE_WRITE_LINE_MEMBER(vblank_irq); @@ -148,7 +148,7 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(port_mod_r); DECLARE_READ32_MEMBER(port_ctrl_r); DECLARE_WRITE32_MEMBER(port_ctrl_w); - UINT32 m_port_ctrl_reg[0x8]; + uint32_t m_port_ctrl_reg[0x8]; }; READ32_MEMBER(atlantis_state::green_r) @@ -168,7 +168,7 @@ WRITE32_MEMBER(atlantis_state::green_w) READ8_MEMBER (atlantis_state::blue_r) { - //UINT8 data = m_red_data[offset]; + //uint8_t data = m_red_data[offset]; logerror("%06X: blue_r %08x = %02x\n", machine().device("maincpu")->safe_pc(), offset, 0); //return data; return 0; @@ -181,8 +181,8 @@ WRITE8_MEMBER(atlantis_state::blue_w) READ32_MEMBER(atlantis_state::board_ctrl_r) { - UINT32 newOffset = offset >> 17; - UINT32 data = board_ctrl[newOffset]; + uint32_t newOffset = offset >> 17; + uint32_t data = board_ctrl[newOffset]; switch (newOffset) { case CTRL_STATUS: if (1 && m_screen->vblank()) @@ -202,8 +202,8 @@ READ32_MEMBER(atlantis_state::board_ctrl_r) WRITE32_MEMBER(atlantis_state::board_ctrl_w) { - UINT32 newOffset = offset >> 17; - UINT32 changeData = board_ctrl[newOffset] ^ data; + uint32_t newOffset = offset >> 17; + uint32_t changeData = board_ctrl[newOffset] ^ data; COMBINE_DATA(&board_ctrl[newOffset]); switch (newOffset) { case CTRL_POWER0: @@ -226,8 +226,8 @@ WRITE32_MEMBER(atlantis_state::board_ctrl_w) // 0x1 VBlank clear? if (changeData & 0x1) { if ((data & 0x0001) == 0) { - //UINT32 status_bit = (1 << VBLANK_IRQ_SHIFT); - UINT32 status_bit = (1 << 7); + //uint32_t status_bit = (1 << VBLANK_IRQ_SHIFT); + uint32_t status_bit = (1 << 7); board_ctrl[CTRL_CAUSE] &= ~status_bit; board_ctrl[CTRL_STATUS] &= ~status_bit; update_asic_irq(); @@ -255,7 +255,7 @@ WRITE32_MEMBER(atlantis_state::board_ctrl_w) READ8_MEMBER(atlantis_state::cmos_r) { - UINT8 result = m_rtc_data[offset]; + uint8_t result = m_rtc_data[offset]; switch (offset) { case 0x7FF9: @@ -418,7 +418,7 @@ READ32_MEMBER(atlantis_state::user_io_input) *************************************/ WRITE_LINE_MEMBER(atlantis_state::uart0_irq_callback) { - UINT32 status_bit = (1 << UART0_SHIFT); + uint32_t status_bit = (1 << UART0_SHIFT); if (state && !(board_ctrl[CTRL_STATUS] & status_bit)) { board_ctrl[CTRL_STATUS] |= status_bit; update_asic_irq(); @@ -436,7 +436,7 @@ WRITE_LINE_MEMBER(atlantis_state::uart0_irq_callback) *************************************/ WRITE_LINE_MEMBER(atlantis_state::uart1_irq_callback) { - UINT32 status_bit = (1 << UART1_SHIFT); + uint32_t status_bit = (1 << UART1_SHIFT); if (state && !(board_ctrl[CTRL_STATUS] & status_bit)) { board_ctrl[CTRL_STATUS] |= status_bit; update_asic_irq(); @@ -519,9 +519,9 @@ void atlantis_state::update_asic_irq() { // Uknown if CTRL_POWER1 is actually a separate power register. Skip it for now. for (int irqIndex = 1; irqIndex <= 4; irqIndex++) { - UINT32 irqBits = (board_ctrl[CTRL_GLOBAL_EN] & board_ctrl[CTRL_POWER1 + irqIndex] & board_ctrl[CTRL_STATUS]); - UINT32 causeBits = (board_ctrl[CTRL_GLOBAL_EN] & board_ctrl[CTRL_POWER1 + irqIndex] & board_ctrl[CTRL_CAUSE]); - UINT32 currState = m_irq_state & (1 << irqIndex); + uint32_t irqBits = (board_ctrl[CTRL_GLOBAL_EN] & board_ctrl[CTRL_POWER1 + irqIndex] & board_ctrl[CTRL_STATUS]); + uint32_t causeBits = (board_ctrl[CTRL_GLOBAL_EN] & board_ctrl[CTRL_POWER1 + irqIndex] & board_ctrl[CTRL_CAUSE]); + uint32_t currState = m_irq_state & (1 << irqIndex); board_ctrl[CTRL_CAUSE] |= irqBits; if (irqBits && !currState) { m_maincpu->set_input_line(MIPS3_IRQ0 + irqIndex, ASSERT_LINE); @@ -542,8 +542,8 @@ void atlantis_state::update_asic_irq() *************************************/ READ32_MEMBER(atlantis_state::port_ctrl_r) { - UINT32 newOffset = offset >> 17; - UINT32 result = m_port_ctrl_reg[newOffset]; + uint32_t newOffset = offset >> 17; + uint32_t result = m_port_ctrl_reg[newOffset]; if (LOG_PORT) logerror("%s: port_ctrl_r newOffset = %02X data = %08X\n", machine().describe_context(), newOffset, result); return result; @@ -551,13 +551,13 @@ READ32_MEMBER(atlantis_state::port_ctrl_r) WRITE32_MEMBER(atlantis_state::port_ctrl_w) { - UINT32 newOffset = offset >> 17; + uint32_t newOffset = offset >> 17; COMBINE_DATA(&m_port_ctrl_reg[newOffset]); switch (newOffset) { case 1: { - UINT32 bits = ioport("KEYPAD")->read(); + uint32_t bits = ioport("KEYPAD")->read(); m_port_ctrl_reg[2] = 0; if (!(data & 0x8)) m_port_ctrl_reg[2] = bits & 7; // Row 0 @@ -586,7 +586,7 @@ WRITE32_MEMBER(atlantis_state::port_ctrl_w) CUSTOM_INPUT_MEMBER(atlantis_state::port_mod_r) { - UINT32 bits = ioport((const char *)param)->read(); + uint32_t bits = ioport((const char *)param)->read(); //bits &= m_port_ctrl_reg[1]; //bits >>= m_port_ctrl_reg[1]; logerror("%s: port_mod_r read data %s = %08X m_port_ctrl_reg[1] = %08X\n", machine().describe_context(), (const char *)param, bits, m_port_ctrl_reg[1]); @@ -596,7 +596,7 @@ CUSTOM_INPUT_MEMBER(atlantis_state::port_mod_r) /************************************* * Video refresh *************************************/ -UINT32 atlantis_state::screen_update_mwskins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t atlantis_state::screen_update_mwskins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/atm.cpp b/src/mame/drivers/atm.cpp index 130e801e17a..5ac43d436cf 100644 --- a/src/mame/drivers/atm.cpp +++ b/src/mame/drivers/atm.cpp @@ -48,14 +48,14 @@ protected: required_device m_beta; private: - UINT8 *m_p_ram; + uint8_t *m_p_ram; void atm_update_memory(); }; DIRECT_UPDATE_MEMBER(atm_state::atm_direct) { - UINT16 pc = m_maincpu->state_int(STATE_GENPCBASE); + uint16_t pc = m_maincpu->state_int(STATE_GENPCBASE); if (m_beta->started() && m_beta->is_active()) { @@ -92,7 +92,7 @@ DIRECT_UPDATE_MEMBER(atm_state::atm_direct) void atm_state::atm_update_memory() { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); m_screen_location = messram + ((m_port_7ffd_data & 8) ? (7<<14) : (5<<14)); @@ -136,7 +136,7 @@ ADDRESS_MAP_END MACHINE_RESET_MEMBER(atm_state,atm) { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); address_space &space = m_maincpu->space(AS_PROGRAM); m_p_ram = memregion("maincpu")->base(); diff --git a/src/mame/drivers/atom.cpp b/src/mame/drivers/atom.cpp index 58ab2e96033..cb412dc9cd8 100644 --- a/src/mame/drivers/atom.cpp +++ b/src/mame/drivers/atom.cpp @@ -147,14 +147,14 @@ QUICKLOAD_LOAD_MEMBER( atom_state, atom_atm ) */ - UINT8 header[0x16] = { 0 }; + uint8_t header[0x16] = { 0 }; void *ptr; image.fread(header, 0x16); - UINT16 start_address = pick_integer_le(header, 0x10, 2); - UINT16 run_address = pick_integer_le(header, 0x12, 2); - UINT16 size = pick_integer_le(header, 0x14, 2); + uint16_t start_address = pick_integer_le(header, 0x10, 2); + uint16_t run_address = pick_integer_le(header, 0x12, 2); + uint16_t size = pick_integer_le(header, 0x14, 2); if (LOG) { @@ -492,7 +492,7 @@ READ8_MEMBER( atom_state::ppi_pb_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_keylatch) { @@ -530,7 +530,7 @@ READ8_MEMBER( atom_state::ppi_pc_r ) */ - UINT8 data = 0; + uint8_t data = 0; /* 2400 Hz input */ data |= m_hz2400 << 4; @@ -651,7 +651,7 @@ void atom_state::machine_start() generator. I don't know if this is hardware, or random data because the ram chips are not cleared at start-up. So at this time, these numbers are poked into the memory to simulate it. When I have more details I will fix it */ - UINT8 *m_baseram = (UINT8 *)m_maincpu->space(AS_PROGRAM).get_write_ptr(0x0000); + uint8_t *m_baseram = (uint8_t *)m_maincpu->space(AS_PROGRAM).get_write_ptr(0x0000); m_baseram[0x08] = machine().rand() & 0x0ff; m_baseram[0x09] = machine().rand() & 0x0ff; @@ -677,7 +677,7 @@ void atomeb_state::machine_start() image_init_result atom_state::load_cart(device_image_interface &image, generic_slot_device *slot) { - UINT32 size = slot->common_get_size("rom"); + uint32_t size = slot->common_get_size("rom"); if (size > 0x1000) { diff --git a/src/mame/drivers/atronic.cpp b/src/mame/drivers/atronic.cpp index f366fab1187..a213c0a95a9 100644 --- a/src/mame/drivers/atronic.cpp +++ b/src/mame/drivers/atronic.cpp @@ -26,7 +26,7 @@ public: m_maincpu(*this, "maincpu") { } - 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: @@ -34,7 +34,7 @@ protected: required_device m_maincpu; }; -UINT32 atronic_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t atronic_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } diff --git a/src/mame/drivers/attache.cpp b/src/mame/drivers/attache.cpp index 0c154fb4971..0f43caf48ff 100644 --- a/src/mame/drivers/attache.cpp +++ b/src/mame/drivers/attache.cpp @@ -130,7 +130,7 @@ public: }; // overrides - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void vblank_int(screen_device &screen, bool state); virtual void driver_start() override; virtual void machine_start() override; @@ -156,10 +156,10 @@ public: DECLARE_WRITE_LINE_MEMBER(hreq_w); DECLARE_WRITE_LINE_MEMBER(eop_w); DECLARE_WRITE_LINE_MEMBER(fdc_dack_w); - void operation_strobe(address_space& space,UINT8 data); + void operation_strobe(address_space& space,uint8_t data); void keyboard_clock_w(bool state); - UINT8 keyboard_data_r(); - UINT16 get_key(); + uint8_t keyboard_data_r(); + uint16_t get_key(); private: required_device m_maincpu; required_memory_region m_rom; @@ -190,25 +190,25 @@ private: bool m_rom_active; bool m_gfx_enabled; - UINT8 m_pio_porta; - UINT8 m_pio_portb; - UINT8 m_pio_select; - UINT8 m_pio_latch; - UINT8 m_crtc_reg_select; - UINT8 m_current_cmd; - UINT8 m_char_ram[128*32]; - UINT8 m_attr_ram[128*32]; - UINT8 m_gfx_ram[128*32*5]; - UINT8 m_char_line; - UINT8 m_attr_line; - UINT8 m_gfx_line; - UINT8 m_cmos_ram[64]; - UINT8 m_cmos_select; - UINT16 m_kb_current_key; + uint8_t m_pio_porta; + uint8_t m_pio_portb; + uint8_t m_pio_select; + uint8_t m_pio_latch; + uint8_t m_crtc_reg_select; + uint8_t m_current_cmd; + uint8_t m_char_ram[128*32]; + uint8_t m_attr_ram[128*32]; + uint8_t m_gfx_ram[128*32*5]; + uint8_t m_char_line; + uint8_t m_attr_line; + uint8_t m_gfx_line; + uint8_t m_cmos_ram[64]; + uint8_t m_cmos_select; + uint16_t m_kb_current_key; bool m_kb_clock; bool m_kb_empty; - UINT8 m_kb_bitpos; - UINT8 m_memmap; + uint8_t m_kb_bitpos; + uint8_t m_memmap; }; // Attributes (based on schematics): @@ -220,10 +220,10 @@ private: // bit 5 = underline // bit 6 = superscript // bit 7 = subscript (superscript and subscript combined produces strikethrough) -UINT32 attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 x,y,bit,scan,data; - UINT8 dbl_mode = 0; // detemines which half of character to display when using double size attribute, + uint8_t x,y,bit,scan,data; + uint8_t dbl_mode = 0; // detemines which half of character to display when using double size attribute, // as it can start on either odd or even character cells. // Graphics output (if enabled) @@ -268,7 +268,7 @@ UINT32 attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, for(x=0;x<(bitmap.width()-1)/8;x++) // columns { assert(((y*128)+x) >= 0 && ((y*128)+x) < ARRAY_LENGTH(m_char_ram)); - UINT8 ch = m_char_ram[(y*128)+x]; + uint8_t ch = m_char_ram[(y*128)+x]; pen_t fg = m_palette->pen(m_attr_ram[(y*128)+x] & 0x08 ? 2 : 1); // brightness if(m_attr_ram[(y*128)+x] & 0x10) // double-size dbl_mode++; @@ -303,7 +303,7 @@ UINT32 attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, data = ~data; if(m_attr_ram[(y*128)+x] & 0x10) // double-size { - UINT8 newdata = 0; + uint8_t newdata = 0; if(dbl_mode & 1) { newdata = (data & 0x80) | ((data & 0x80) >> 1) @@ -323,8 +323,8 @@ UINT32 attache_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, for(bit=0;bit<8;bit++) // 8 pixels per character { - UINT16 xpos = x*8+bit; - UINT16 ypos = y*10+scan; + uint16_t xpos = x*8+bit; + uint16_t ypos = y*10+scan; if(BIT(data,7-bit)) bitmap.pix32(ypos,xpos) = fg; @@ -353,10 +353,10 @@ WRITE8_MEMBER(attache_state::rom_w) m_ram->pointer()[m_membank1->entry()*0x2000 + offset] = data; } -UINT16 attache_state::get_key() +uint16_t attache_state::get_key() { - UINT8 row,bits,data; - UINT8 res = 0; + uint8_t row,bits,data; + uint8_t res = 0; // scan input ports for(row=0;row<8;row++) @@ -384,9 +384,9 @@ UINT16 attache_state::get_key() return res; } -UINT8 attache_state::keyboard_data_r() +uint8_t attache_state::keyboard_data_r() { - UINT16 key; + uint16_t key; if(m_kb_bitpos == 1) // start bit, if data is available { key = get_key(); @@ -424,8 +424,8 @@ void attache_state::keyboard_clock_w(bool state) // TODO: Figure out exactly how the HLD, RD, WR and CS lines on the RTC are hooked up READ8_MEMBER(attache_state::pio_portA_r) { - UINT8 ret = 0xff; - UINT8 porta = m_pio_porta; + uint8_t ret = 0xff; + uint8_t porta = m_pio_porta; switch(m_pio_select) { @@ -473,12 +473,12 @@ READ8_MEMBER(attache_state::pio_portA_r) READ8_MEMBER(attache_state::pio_portB_r) { - UINT8 ret = m_pio_portb & 0xbf; + uint8_t ret = m_pio_portb & 0xbf; ret |= keyboard_data_r(); return ret; } -void attache_state::operation_strobe(address_space& space, UINT8 data) +void attache_state::operation_strobe(address_space& space, uint8_t data) { //logerror("PIO: Port A write operation %i, data %02x\n",m_pio_select,data); switch(m_pio_select) @@ -572,8 +572,8 @@ WRITE8_MEMBER(attache_state::pio_portB_w) // Display uses A8-A15 placed on the bus by the OUT instruction as an extra parameter READ8_MEMBER(attache_state::display_data_r) { - UINT8 ret = 0xff; - UINT8 param = (offset & 0xff00) >> 8; + uint8_t ret = 0xff; + uint8_t param = (offset & 0xff00) >> 8; switch(m_current_cmd) { @@ -610,7 +610,7 @@ READ8_MEMBER(attache_state::display_data_r) WRITE8_MEMBER(attache_state::display_data_w) { - UINT8 param = (offset & 0xff00) >> 8; + uint8_t param = (offset & 0xff00) >> 8; switch(m_current_cmd) { case DISP_GFX_0: @@ -644,7 +644,7 @@ WRITE8_MEMBER(attache_state::display_data_w) WRITE8_MEMBER(attache_state::display_command_w) { - UINT8 cmd = (data & 0xe0) >> 5; + uint8_t cmd = (data & 0xe0) >> 5; m_current_cmd = cmd; @@ -682,8 +682,8 @@ WRITE8_MEMBER(attache_state::memmap_w) // TODO: figure this out properly // Tech manual says that RAM is split into 8kB chunks. // Would seem that bit 4 is always 0 and bit 3 is always 1? - UINT8 bank = (data & 0xe0) >> 5; - UINT8 loc = data & 0x07; + uint8_t bank = (data & 0xe0) >> 5; + uint8_t loc = data & 0x07; memory_bank* banknum[8] = { m_membank1, m_membank2, m_membank3, m_membank4, m_membank5, m_membank6, m_membank7, m_membank8 }; m_memmap = data; @@ -704,7 +704,7 @@ WRITE8_MEMBER(attache_state::dma_mask_w) READ8_MEMBER(attache_state::fdc_dma_r) { - UINT8 ret = m_fdc->dma_r(); + uint8_t ret = m_fdc->dma_r(); return ret; } @@ -862,7 +862,7 @@ SLOT_INTERFACE_END void attache_state::driver_start() { - UINT8 *RAM = m_ram->pointer(); + uint8_t *RAM = m_ram->pointer(); m_membank1->configure_entries(0, 8, &RAM[0x0000], 0x2000); m_membank2->configure_entries(0, 8, &RAM[0x0000], 0x2000); diff --git a/src/mame/drivers/atvtrack.cpp b/src/mame/drivers/atvtrack.cpp index 34d0b0ccbe8..d0c9026e02f 100644 --- a/src/mame/drivers/atvtrack.cpp +++ b/src/mame/drivers/atvtrack.cpp @@ -116,13 +116,13 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_atvtrack(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - inline UINT32 decode64_32(offs_t offset64, UINT64 data, UINT64 mem_mask, offs_t &offset32); - void logbinary(UINT32 data,int high,int low); + uint32_t screen_update_atvtrack(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + inline uint32_t decode64_32(offs_t offset64, uint64_t data, uint64_t mem_mask, offs_t &offset32); + void logbinary(uint32_t data,int high,int low); memory_region *m_nandregion; int m_nandcommand[4], m_nandoffset[4], m_nandaddressstep, m_nandaddress[4]; - UINT32 m_area1_data[4]; + uint32_t m_area1_data[4]; required_device m_maincpu; required_device m_subcpu; @@ -141,9 +141,9 @@ public: virtual void machine_reset() override; }; -void atvtrack_state::logbinary(UINT32 data,int high=31,int low=0) +void atvtrack_state::logbinary(uint32_t data,int high=31,int low=0) { - UINT32 s; + uint32_t s; int z; s=1 << high; @@ -156,15 +156,15 @@ void atvtrack_state::logbinary(UINT32 data,int high=31,int low=0) } } -inline UINT32 atvtrack_state::decode64_32(offs_t offset64, UINT64 data, UINT64 mem_mask, offs_t &offset32) +inline uint32_t atvtrack_state::decode64_32(offs_t offset64, uint64_t data, uint64_t mem_mask, offs_t &offset32) { if (ACCESSING_BITS_0_31) { offset32 = offset64 << 1; - return (UINT32)data; + return (uint32_t)data; } if (ACCESSING_BITS_32_63) { offset32 = (offset64 << 1)+1; - return (UINT32)(data >> 32); + return (uint32_t)(data >> 32); } logerror("Wrong word size in external access\n"); //machine().debug_break(); @@ -173,7 +173,7 @@ inline UINT32 atvtrack_state::decode64_32(offs_t offset64, UINT64 data, UINT64 m READ64_MEMBER(atvtrack_state::control_r) { - UINT32 addr; + uint32_t addr; addr = 0; decode64_32(offset, 0, mem_mask, addr); @@ -186,7 +186,7 @@ READ64_MEMBER(atvtrack_state::control_r) WRITE64_MEMBER(atvtrack_state::control_w) { - UINT32 addr, dat; //, old; + uint32_t addr, dat; //, old; addr = 0; dat = decode64_32(offset, data, mem_mask, addr); @@ -205,7 +205,7 @@ WRITE64_MEMBER(atvtrack_state::control_w) READ64_MEMBER(atvtrack_state::area2_r) { - UINT32 addr, dat; + uint32_t addr, dat; int c; addr = 0; @@ -229,7 +229,7 @@ READ64_MEMBER(atvtrack_state::area2_r) WRITE64_MEMBER(atvtrack_state::area2_w) { -// UINT32 addr, dat; +// uint32_t addr, dat; // addr = 0; // dat = decode64_32(offset, data, mem_mask, addr); @@ -241,7 +241,7 @@ WRITE64_MEMBER(atvtrack_state::area2_w) READ64_MEMBER(atvtrack_state::area3_r) { -// UINT32 addr, dat; +// uint32_t addr, dat; // addr = 0; // dat = decode64_32(offset, 0, mem_mask, addr); @@ -254,7 +254,7 @@ READ64_MEMBER(atvtrack_state::area3_r) WRITE64_MEMBER(atvtrack_state::area3_w) { - UINT32 addr; //, dat; + uint32_t addr; //, dat; int c; addr = 0; @@ -288,7 +288,7 @@ WRITE64_MEMBER(atvtrack_state::area3_w) READ64_MEMBER(atvtrack_state::area4_r) { -// UINT32 addr, dat; +// uint32_t addr, dat; // addr = 0; // dat = decode64_32(offset, 0, mem_mask, addr); @@ -301,7 +301,7 @@ READ64_MEMBER(atvtrack_state::area4_r) WRITE64_MEMBER(atvtrack_state::area4_w) { - UINT32 addr; //, dat; + uint32_t addr; //, dat; int c; addr = 0; @@ -342,7 +342,7 @@ READ64_MEMBER(atvtrack_state::ioport_r) WRITE64_MEMBER(atvtrack_state::ioport_w) { #ifdef SPECIALMODE - UINT64 d; + uint64_t d; static int cnt=0; sh4_device_dma dm; #endif @@ -353,7 +353,7 @@ WRITE64_MEMBER(atvtrack_state::ioport_w) m_slaverun = true; } logerror("SH4 16bit i/o port write "); - logbinary((UINT32)data,15,0); + logbinary((uint32_t)data,15,0); logerror("\n"); } #ifdef SPECIALMODE @@ -379,19 +379,19 @@ void atvtrack_state::video_start() { } -UINT32 atvtrack_state::screen_update_atvtrack(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t atvtrack_state::screen_update_atvtrack(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } void atvtrack_state::machine_start() { - UINT8 *src, *dst; + uint8_t *src, *dst; m_nandaddressstep = 0; m_nandregion = memregion("maincpu"); address_space &as = m_maincpu->space(AS_PROGRAM); - dst = (UINT8 *)(as.get_write_ptr(0x0c7f0000)); + dst = (uint8_t *)(as.get_write_ptr(0x0c7f0000)); src = m_nandregion->base()+0x10; // copy 0x10000 bytes from region "maincpu" offset 0x10 to 0x0c7f0000 memcpy(dst, src, 0x10000); diff --git a/src/mame/drivers/aussiebyte.cpp b/src/mame/drivers/aussiebyte.cpp index efbca5f0931..97f1da87f31 100644 --- a/src/mame/drivers/aussiebyte.cpp +++ b/src/mame/drivers/aussiebyte.cpp @@ -265,28 +265,28 @@ WRITE_LINE_MEMBER( aussiebyte_state::busreq_w ) ************************************************************/ WRITE_LINE_MEMBER( aussiebyte_state::sio1_rdya_w ) { - m_port17_rdy = (m_port17_rdy & 0xfd) | (UINT8)(state << 1); + m_port17_rdy = (m_port17_rdy & 0xfd) | (uint8_t)(state << 1); if (m_port17 == 1) m_dma->rdy_w(state); } WRITE_LINE_MEMBER( aussiebyte_state::sio1_rdyb_w ) { - m_port17_rdy = (m_port17_rdy & 0xfb) | (UINT8)(state << 2); + m_port17_rdy = (m_port17_rdy & 0xfb) | (uint8_t)(state << 2); if (m_port17 == 2) m_dma->rdy_w(state); } WRITE_LINE_MEMBER( aussiebyte_state::sio2_rdya_w ) { - m_port17_rdy = (m_port17_rdy & 0xef) | (UINT8)(state << 4); + m_port17_rdy = (m_port17_rdy & 0xef) | (uint8_t)(state << 4); if (m_port17 == 4) m_dma->rdy_w(state); } WRITE_LINE_MEMBER( aussiebyte_state::sio2_rdyb_w ) { - m_port17_rdy = (m_port17_rdy & 0xdf) | (UINT8)(state << 5); + m_port17_rdy = (m_port17_rdy & 0xdf) | (uint8_t)(state << 5); if (m_port17 == 5) m_dma->rdy_w(state); } @@ -397,16 +397,16 @@ WRITE_LINE_MEMBER( aussiebyte_state::votrax_w ) WRITE_LINE_MEMBER( aussiebyte_state::fdc_intrq_w ) { - UINT8 data = (m_port19 & 0xbf) | (state ? 0x40 : 0); + uint8_t data = (m_port19 & 0xbf) | (state ? 0x40 : 0); m_port19 = data; } WRITE_LINE_MEMBER( aussiebyte_state::fdc_drq_w ) { - UINT8 data = (m_port19 & 0x7f) | (state ? 0x80 : 0); + uint8_t data = (m_port19 & 0x7f) | (state ? 0x80 : 0); m_port19 = data; state ^= 1; // inverter on pin38 of fdc - m_port17_rdy = (m_port17_rdy & 0xfe) | (UINT8)state; + m_port17_rdy = (m_port17_rdy & 0xfe) | (uint8_t)state; if (m_port17 == 0) m_dma->rdy_w(state); } @@ -539,8 +539,8 @@ DRIVER_INIT_MEMBER( aussiebyte_state, aussiebyte ) { // Main ram is divided into 16k blocks (0-15). The boot rom is block number 16. // For convenience, bank 0 is permanently assigned to C000-FFFF - UINT8 *main = memregion("roms")->base(); - UINT8 *ram = memregion("mram")->base(); + uint8_t *main = memregion("roms")->base(); + uint8_t *ram = memregion("mram")->base(); membank("bankr0")->configure_entries(0, 16, &ram[0x0000], 0x4000); membank("bankw0")->configure_entries(0, 16, &ram[0x0000], 0x4000); diff --git a/src/mame/drivers/avalnche.cpp b/src/mame/drivers/avalnche.cpp index 8badaf71d69..0c051f25638 100644 --- a/src/mame/drivers/avalnche.cpp +++ b/src/mame/drivers/avalnche.cpp @@ -47,7 +47,7 @@ * *************************************/ -UINT32 avalnche_state::screen_update_avalnche(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t avalnche_state::screen_update_avalnche(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -55,9 +55,9 @@ UINT32 avalnche_state::screen_update_avalnche(screen_device &screen, bitmap_rgb3 { int i; - UINT8 x = offs << 3; + uint8_t x = offs << 3; int y = offs >> 5; - UINT8 data = m_videoram[offs]; + uint8_t data = m_videoram[offs]; for (i = 0; i < 8; i++) { diff --git a/src/mame/drivers/avigo.cpp b/src/mame/drivers/avigo.cpp index 7d3c3c0677d..99adc8b5122 100644 --- a/src/mame/drivers/avigo.cpp +++ b/src/mame/drivers/avigo.cpp @@ -181,7 +181,7 @@ ADDRESS_MAP_END READ8_MEMBER(avigo_state::key_data_read_r) { - UINT8 data = 0x0f; + uint8_t data = 0x0f; if (!(m_key_line & 0x01)) { @@ -370,7 +370,7 @@ WRITE8_MEMBER(avigo_state::ad_control_status_w) READ8_MEMBER(avigo_state::ad_data_r) { - UINT8 data = 0; + uint8_t data = 0; /* original */ @@ -689,7 +689,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(avigo_state::avigo_1hz_timer) QUICKLOAD_LOAD_MEMBER( avigo_state,avigo) { const char *systemname = machine().system().name; - UINT32 first_app_page = (0x50000>>14); + uint32_t first_app_page = (0x50000>>14); int app_page; // german and spanish language are 4 pages bigger than other @@ -717,7 +717,7 @@ QUICKLOAD_LOAD_MEMBER( avigo_state,avigo) // if there is the required free space installs the application if ((app_page + (image.length()>>14)) < 0x40) { - logerror("Application loaded at 0x%05x-0x%05x\n", app_page<<14, (app_page<<14) + (UINT32)image.length()); + logerror("Application loaded at 0x%05x-0x%05x\n", app_page<<14, (app_page<<14) + (uint32_t)image.length()); // copy app file into flash memory image.fread(m_flash1->base() + (app_page<<14), image.length()); diff --git a/src/mame/drivers/avt.cpp b/src/mame/drivers/avt.cpp index 6b620734e3e..59e34ebaa5a 100644 --- a/src/mame/drivers/avt.cpp +++ b/src/mame/drivers/avt.cpp @@ -432,8 +432,8 @@ public: required_device m_maincpu; required_device m_crtc; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; required_device m_gfxdecode; required_device m_palette; @@ -444,12 +444,12 @@ public: DECLARE_WRITE8_MEMBER(avt_colorram_w); tilemap_t *m_bg_tilemap; - UINT8 m_crtc_vreg[0x100],m_crtc_index; + uint8_t m_crtc_vreg[0x100],m_crtc_index; TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(avt); - UINT32 screen_update_avt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_avt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(avt_vblank_irq); }; @@ -511,7 +511,7 @@ void avt_state::video_start() } -UINT32 avt_state::screen_update_avt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t avt_state::screen_update_avt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int count; @@ -523,8 +523,8 @@ UINT32 avt_state::screen_update_avt(screen_device &screen, bitmap_ind16 &bitmap, { for(x=0;x> 4; + uint16_t tile = m_videoram[count] | ((m_colorram[count] & 1) << 8); + uint8_t color = (m_colorram[count] & 0xf0) >> 4; gfx->opaque(bitmap,cliprect,tile,color,0,0,x*8,(y*8)); @@ -538,7 +538,7 @@ UINT32 avt_state::screen_update_avt(screen_device &screen, bitmap_ind16 &bitmap, PALETTE_INIT_MEMBER(avt_state, avt) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); /* prom bits 7654 3210 ---- ---x Intensity?. diff --git a/src/mame/drivers/ax20.cpp b/src/mame/drivers/ax20.cpp index 8d5ca0fae06..7d81ff8479c 100644 --- a/src/mame/drivers/ax20.cpp +++ b/src/mame/drivers/ax20.cpp @@ -32,13 +32,13 @@ public: m_fdc(*this, "fdc") { } required_device m_maincpu; - required_shared_ptr m_p_vram; + required_shared_ptr m_p_vram; required_device m_gfxdecode; required_device m_palette; required_device m_fdc; virtual void machine_start() override; - 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); DECLARE_READ8_MEMBER(unk_r); DECLARE_WRITE8_MEMBER(tc_w); @@ -60,13 +60,13 @@ WRITE8_MEMBER(ax20_state::ctl_w) m_fdc->subdevice("0")->get_device()->mon_w(!(data & 1)); } -UINT32 ax20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ax20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for ( int y = 0; y < 24; y++ ) { for ( int x = 0; x < 80; x++ ) { - UINT16 tile = m_p_vram[24 + y * 128 + x ] & 0x7f; + uint16_t tile = m_p_vram[24 + y * 128 + x ] & 0x7f; m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, tile, 0, 0, 0, x*8, y*12); } diff --git a/src/mame/drivers/b16.cpp b/src/mame/drivers/b16.cpp index 289aea6f228..a7190a97d69 100644 --- a/src/mame/drivers/b16.cpp +++ b/src/mame/drivers/b16.cpp @@ -31,9 +31,9 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 *m_char_rom; - required_shared_ptr m_vram; - UINT8 m_crtc_vreg[0x100],m_crtc_index; + uint8_t *m_char_rom; + required_shared_ptr m_vram; + uint8_t m_crtc_vreg[0x100],m_crtc_index; DECLARE_READ16_MEMBER(vblank_r); DECLARE_WRITE8_MEMBER(b16_pcg_w); @@ -45,7 +45,7 @@ public: DECLARE_WRITE8_MEMBER(memory_write_byte); virtual void video_start() override; - 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); mc6845_device *m_mc6845; required_device m_dma8237; @@ -81,11 +81,11 @@ void b16_state::video_start() } -UINT32 b16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t b16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int xi,yi; - UINT8 *gfx_rom = memregion("pcg")->base(); + uint8_t *gfx_rom = memregion("pcg")->base(); for(y=0;y m_spriteram_1; - std::unique_ptr m_spriteram_2; - required_shared_ptr m_mainram; - required_shared_ptr m_left_priority; - required_shared_ptr m_right_priority; + std::unique_ptr m_spriteram_1; + std::unique_ptr m_spriteram_2; + required_shared_ptr m_mainram; + required_shared_ptr m_left_priority; + required_shared_ptr m_right_priority; optional_device m_sprgen; optional_device m_sprgen2; @@ -68,10 +68,10 @@ public: required_device m_eeprom; /* memory */ - UINT16 m_pf1_rowscroll[0x0800/2]; - UINT16 m_pf2_rowscroll[0x0800/2]; - UINT16 m_pf3_rowscroll[0x0800/2]; - UINT16 m_pf4_rowscroll[0x0800/2]; + uint16_t m_pf1_rowscroll[0x0800/2]; + uint16_t m_pf2_rowscroll[0x0800/2]; + uint16_t m_pf3_rowscroll[0x0800/2]; + uint16_t m_pf4_rowscroll[0x0800/2]; DECLARE_READ32_MEMBER(backfire_control2_r); DECLARE_WRITE32_MEMBER(backfire_nonbuffered_palette_w); DECLARE_READ32_MEMBER(backfire_pf1_rowscroll_r); @@ -92,8 +92,8 @@ public: DECLARE_DRIVER_INIT(backfire); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_backfire_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_backfire_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_backfire_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_backfire_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt); void descramble_sound(); DECO16IC_BANK_CB_MEMBER(bank_callback); @@ -104,16 +104,16 @@ public: required_ioport m_io_in2; required_ioport m_io_in3; required_device m_palette; - required_shared_ptr m_generic_paletteram_32; + required_shared_ptr m_generic_paletteram_32; }; -//UINT32 *backfire_180010, *backfire_188010; +//uint32_t *backfire_180010, *backfire_188010; /* I'm using the functions in deco16ic.c ... same chips, why duplicate code? */ void backfire_state::video_start() { - m_spriteram_1 = std::make_unique(0x2000/2); - m_spriteram_2 = std::make_unique(0x2000/2); + m_spriteram_1 = std::make_unique(0x2000/2); + m_spriteram_2 = std::make_unique(0x2000/2); /* and register the allocated ram so that save states still work */ save_item(NAME(m_pf1_rowscroll)); @@ -133,7 +133,7 @@ void backfire_state::video_start() -UINT32 backfire_state::screen_update_backfire_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t backfire_state::screen_update_backfire_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { //FIXME: flip_screen_x should not be written! flip_screen_set_no_update(1); @@ -164,7 +164,7 @@ UINT32 backfire_state::screen_update_backfire_left(screen_device &screen, bitmap return 0; } -UINT32 backfire_state::screen_update_backfire_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t backfire_state::screen_update_backfire_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { //FIXME: flip_screen_x should not be written! flip_screen_set_no_update(1); @@ -676,14 +676,14 @@ ROM_END void backfire_state::descramble_sound() { - UINT8 *rom = memregion("ymz")->base(); + uint8_t *rom = memregion("ymz")->base(); int length = 0x200000; // only the first rom is swapped on backfire! - std::vector buf1(length); - UINT32 x; + std::vector buf1(length); + uint32_t x; for (x = 0; x < length; x++) { - UINT32 addr; + uint32_t addr; addr = BITSWAP24 (x,23,22,21,0, 20, 19,18,17,16, diff --git a/src/mame/drivers/bagman.cpp b/src/mame/drivers/bagman.cpp index 8090f0cbc42..b71fbcfaa86 100644 --- a/src/mame/drivers/bagman.cpp +++ b/src/mame/drivers/bagman.cpp @@ -414,7 +414,7 @@ GFXDECODE_END I don't know if the following is correct, there can possibly be multiple solutions for the same problem. */ READ8_MEMBER(bagman_state::dial_input_p1_r) { - UINT8 dial_val; + uint8_t dial_val; dial_val = ioport("DIAL_P1")->read(); @@ -434,7 +434,7 @@ READ8_MEMBER(bagman_state::dial_input_p1_r) READ8_MEMBER(bagman_state::dial_input_p2_r) { - UINT8 dial_val; + uint8_t dial_val; dial_val = ioport("DIAL_P2")->read(); diff --git a/src/mame/drivers/balsente.cpp b/src/mame/drivers/balsente.cpp index c9204564cd4..5ab6872f6bf 100644 --- a/src/mame/drivers/balsente.cpp +++ b/src/mame/drivers/balsente.cpp @@ -2197,26 +2197,26 @@ ROM_END #define EXPAND_NONE 0x3f #define SWAP_HALVES 0x80 -void balsente_state::expand_roms(UINT8 cd_rom_mask) +void balsente_state::expand_roms(uint8_t cd_rom_mask) { /* load AB bank data from 0x10000-0x20000 */ /* load CD bank data from 0x20000-0x2e000 */ /* load EF from 0x2e000-0x30000 */ /* ROM region must be 0x40000 total */ - std::vector temp(0x20000); + std::vector temp(0x20000); { - UINT8 *rom = memregion("maincpu")->base(); - UINT32 len = memregion("maincpu")->bytes(); - UINT32 base; + uint8_t *rom = memregion("maincpu")->base(); + uint32_t len = memregion("maincpu")->bytes(); + uint32_t base; for (base = 0x10000; base < len; base += 0x30000) { - UINT8 *ab_base = &temp[0x00000]; - UINT8 *cd_base = &temp[0x10000]; - UINT8 *cd_common = &temp[0x1c000]; - UINT8 *ef_common = &temp[0x1e000]; - UINT32 dest; + uint8_t *ab_base = &temp[0x00000]; + uint8_t *cd_base = &temp[0x10000]; + uint8_t *cd_common = &temp[0x1c000]; + uint8_t *ef_common = &temp[0x1e000]; + uint32_t dest; for (dest = 0x00000; dest < 0x20000; dest += 0x02000) { @@ -2261,7 +2261,7 @@ void balsente_state::expand_roms(UINT8 cd_rom_mask) } } -inline void balsente_state::config_shooter_adc(UINT8 shooter, UINT8 adc_shift) +inline void balsente_state::config_shooter_adc(uint8_t shooter, uint8_t adc_shift) { m_shooter = shooter; m_adc_shift = adc_shift; @@ -2288,7 +2288,7 @@ DRIVER_INIT_MEMBER(balsente_state,stocker) { expand_roms(EXPAND_ALL); config_ DRIVER_INIT_MEMBER(balsente_state,triviag1) { expand_roms(EXPAND_ALL); config_shooter_adc(FALSE, 0 /* noanalog */); } DRIVER_INIT_MEMBER(balsente_state,triviag2) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); memcpy(&rom[0x20000], &rom[0x28000], 0x4000); memcpy(&rom[0x24000], &rom[0x28000], 0x4000); expand_roms(EXPAND_NONE); config_shooter_adc(FALSE, 0 /* noanalog */); diff --git a/src/mame/drivers/banctec.cpp b/src/mame/drivers/banctec.cpp index f8934aa7b3e..cdd55f5aa34 100644 --- a/src/mame/drivers/banctec.cpp +++ b/src/mame/drivers/banctec.cpp @@ -36,7 +36,7 @@ void banctec_state::machine_reset() TILE_GET_INFO_MEMBER(banctec_state::get_bg_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int code = videoram[tile_index]; int color = 1; @@ -48,7 +48,7 @@ void banctec_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(banctec_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 40, 25); } -UINT32 banctec_state::screen_update_banctec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t banctec_state::screen_update_banctec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/drivers/baraduke.cpp b/src/mame/drivers/baraduke.cpp index dbbe8eee691..04d17275f26 100644 --- a/src/mame/drivers/baraduke.cpp +++ b/src/mame/drivers/baraduke.cpp @@ -523,7 +523,7 @@ ROM_END DRIVER_INIT_MEMBER(baraduke_state,baraduke) { - UINT8 *rom; + uint8_t *rom; int i; /* unpack the third tile ROM */ diff --git a/src/mame/drivers/barata.cpp b/src/mame/drivers/barata.cpp index e4d6a2c2e1a..e70eeeb5ccb 100644 --- a/src/mame/drivers/barata.cpp +++ b/src/mame/drivers/barata.cpp @@ -116,9 +116,9 @@ static INPUT_PORTS_START( barata ) INPUT_PORTS_END /* BCD to Seven Segment Decoder */ -static UINT8 dec_7seg(int data) +static uint8_t dec_7seg(int data) { - UINT8 segment; + uint8_t segment; switch (data) { case 0: segment = 0x3f; break; diff --git a/src/mame/drivers/basic52.cpp b/src/mame/drivers/basic52.cpp index 9f80e5fb6fd..a972bb9f1d0 100644 --- a/src/mame/drivers/basic52.cpp +++ b/src/mame/drivers/basic52.cpp @@ -50,7 +50,7 @@ public: DECLARE_WRITE8_MEMBER(kbd_put); DECLARE_READ8_MEMBER(unk_r); - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; DECLARE_READ8_MEMBER(from_term); }; diff --git a/src/mame/drivers/battlera.cpp b/src/mame/drivers/battlera.cpp index 6ddeb6ec793..072f1db8325 100644 --- a/src/mame/drivers/battlera.cpp +++ b/src/mame/drivers/battlera.cpp @@ -260,7 +260,7 @@ INPUT_PORTS_END /******************************************************************************/ -UINT32 battlera_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t battlera_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/drivers/battlex.cpp b/src/mame/drivers/battlex.cpp index 44d56ef56a1..1ca17c12f34 100644 --- a/src/mame/drivers/battlex.cpp +++ b/src/mame/drivers/battlex.cpp @@ -58,7 +58,7 @@ INTERRUPT_GEN_MEMBER(battlex_state::battlex_interrupt) CUSTOM_INPUT_MEMBER(battlex_state::battlex_in0_b4_r) { - UINT32 ret = m_in0_b4; + uint32_t ret = m_in0_b4; if (m_in0_b4) { m_maincpu->set_input_line(0, CLEAR_LINE); @@ -299,9 +299,9 @@ ROM_END DRIVER_INIT_MEMBER(battlex_state,battlex) { - UINT8 *colormask = memregion("user1")->base(); - UINT8 *gfxdata = memregion("user2")->base(); - UINT8 *dest = memregion("gfx1")->base(); + uint8_t *colormask = memregion("user1")->base(); + uint8_t *gfxdata = memregion("user2")->base(); + uint8_t *dest = memregion("gfx1")->base(); int tile, line, bit; diff --git a/src/mame/drivers/battlnts.cpp b/src/mame/drivers/battlnts.cpp index acfac32642b..5b76d2b7aa5 100644 --- a/src/mame/drivers/battlnts.cpp +++ b/src/mame/drivers/battlnts.cpp @@ -214,7 +214,7 @@ GFXDECODE_END void battlnts_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); m_rombank->configure_entries(0, 4, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/bbcbc.cpp b/src/mame/drivers/bbcbc.cpp index 4e8922d6e6d..aaa2adff968 100644 --- a/src/mame/drivers/bbcbc.cpp +++ b/src/mame/drivers/bbcbc.cpp @@ -52,7 +52,7 @@ public: required_device m_cart; required_ioport_array<3> m_buttons; - UINT8 m_input_select; + uint8_t m_input_select; virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/drivers/bbusters.cpp b/src/mame/drivers/bbusters.cpp index a856853fc5f..c9cdc938d14 100644 --- a/src/mame/drivers/bbusters.cpp +++ b/src/mame/drivers/bbusters.cpp @@ -269,7 +269,7 @@ READ16_MEMBER(bbusters_state::control_3_r) { static const char *const port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" }; - UINT16 retdata = ioport(port[m_gun_select])->read(); + uint16_t retdata = ioport(port[m_gun_select])->read(); retdata >>=1; // by lowering the precision of the gun reading hardware the game seems to work better diff --git a/src/mame/drivers/bcs3.cpp b/src/mame/drivers/bcs3.cpp index 1ec29d103f5..44e10bc1a1a 100644 --- a/src/mame/drivers/bcs3.cpp +++ b/src/mame/drivers/bcs3.cpp @@ -77,27 +77,27 @@ public: DECLARE_DRIVER_INIT(bcs3b); DECLARE_DRIVER_INIT(bcs3c); DECLARE_DRIVER_INIT(bcs3d); - UINT32 screen_update_bcs3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bcs3a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bcs3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bcs3a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: bool m_cass_bit; - UINT8 s_curs; - UINT8 s_init; - UINT8 s_rows; - UINT8 s_cols; + uint8_t s_curs; + uint8_t s_init; + uint8_t s_rows; + uint8_t s_cols; required_device m_maincpu; required_device m_ctc; required_memory_region m_p_chargen; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_device m_cass; required_ioport_array<10> m_io_keyboard; }; READ8_MEMBER( bcs3_state::keyboard_r ) { - UINT8 i, data = 0; + uint8_t i, data = 0; if (offset == 0) data = (m_cass->input() > +0.01) ? 0x80 : 0; @@ -114,7 +114,7 @@ READ8_MEMBER( bcs3_state::keyboard_r ) // 00-7F = NUL, 0xE0 = end of line. READ8_MEMBER( bcs3_state::video_r ) { - UINT8 data = m_p_videoram[offset]; + uint8_t data = m_p_videoram[offset]; return BIT(data, 7) ? data : 0; } @@ -215,16 +215,16 @@ static INPUT_PORTS_START( bcs3 ) INPUT_PORTS_END // Official version -UINT32 bcs3_state::screen_update_bcs3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bcs3_state::screen_update_bcs3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx,rat; - UINT16 sy=0,ma=0x50,x; + uint8_t y,ra,chr,gfx,rat; + uint16_t sy=0,ma=0x50,x; for (y = 0; y < 12; y++) { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); rat = (ra + 1) & 7; for (x = ma; x < ma + 28; x++) @@ -257,11 +257,11 @@ UINT32 bcs3_state::screen_update_bcs3(screen_device &screen, bitmap_ind16 &bitma /* Hacks: When it starts, it has 4 lines of data. Pressing enter causes it to allocate 100 lines. I'm assuming that it only shows a portion of this, with the cursor always in sight. */ -UINT32 bcs3_state::screen_update_bcs3a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bcs3_state::screen_update_bcs3a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx,rat; - UINT16 sy = 0, ma = s_init, x; - UINT16 cursor = (m_p_videoram[s_curs] | (m_p_videoram[s_curs+1] << 8)) - 0x3c00 - ma; // get cursor relative position + uint8_t y,ra,chr,gfx,rat; + uint16_t sy = 0, ma = s_init, x; + uint16_t cursor = (m_p_videoram[s_curs] | (m_p_videoram[s_curs+1] << 8)) - 0x3c00 - ma; // get cursor relative position rat = cursor / (s_cols+1); if (rat > (s_rows-1)) ma += (rat-(s_rows-1)) * (s_cols+1); @@ -269,7 +269,7 @@ UINT32 bcs3_state::screen_update_bcs3a(screen_device &screen, bitmap_ind16 &bitm { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); rat = (ra + 1) & 7; for (x = ma; x < ma + s_cols; x++) diff --git a/src/mame/drivers/beaminv.cpp b/src/mame/drivers/beaminv.cpp index 4c78e8da6da..168f90d9dcd 100644 --- a/src/mame/drivers/beaminv.cpp +++ b/src/mame/drivers/beaminv.cpp @@ -68,13 +68,13 @@ public: m_screen(*this, "screen") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* misc */ emu_timer *m_interrupt_timer; /* input-related */ - UINT8 m_controller_select; + uint8_t m_controller_select; /* devices */ required_device m_maincpu; @@ -84,7 +84,7 @@ public: DECLARE_READ8_MEMBER(controller_r); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_beaminv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_beaminv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(interrupt_callback); void create_interrupt_timer(); void start_interrupt_timer(); @@ -173,7 +173,7 @@ void beaminv_state::machine_reset() * *************************************/ -UINT32 beaminv_state::screen_update_beaminv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t beaminv_state::screen_update_beaminv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -181,9 +181,9 @@ UINT32 beaminv_state::screen_update_beaminv(screen_device &screen, bitmap_rgb32 { int i; - UINT8 y = offs; - UINT8 x = offs >> 8 << 3; - UINT8 data = m_videoram[offs]; + uint8_t y = offs; + uint8_t x = offs >> 8 << 3; + uint8_t data = m_videoram[offs]; for (i = 0; i < 8; i++) { diff --git a/src/mame/drivers/beathead.cpp b/src/mame/drivers/beathead.cpp index dff737a925c..adb7b8f55d5 100644 --- a/src/mame/drivers/beathead.cpp +++ b/src/mame/drivers/beathead.cpp @@ -437,7 +437,7 @@ ROM_END READ32_MEMBER( beathead_state::speedup_r ) { - UINT32 result = *m_speedup_data; + uint32_t result = *m_speedup_data; if ((space.device().safe_pcbase() & 0xfffff) == 0x006f0 && result == space.device().state().state_int(ASAP_R3)) space.device().execute().spin_until_interrupt(); return result; @@ -450,8 +450,8 @@ READ32_MEMBER( beathead_state::movie_speedup_r ) if ((space.device().safe_pcbase() & 0xfffff) == 0x00a88 && (space.device().state().state_int(ASAP_R28) & 0xfffff) == 0x397c0 && m_movie_speedup_data[4] == space.device().state().state_int(ASAP_R1)) { - UINT32 temp = (INT16)result + m_movie_speedup_data[4] * 262; - if (temp - (UINT32)space.device().state().state_int(ASAP_R15) < (UINT32)space.device().state().state_int(ASAP_R23)) + uint32_t temp = (int16_t)result + m_movie_speedup_data[4] * 262; + if (temp - (uint32_t)space.device().state().state_int(ASAP_R15) < (uint32_t)space.device().state().state_int(ASAP_R23)) space.device().execute().spin_until_interrupt(); } return result; diff --git a/src/mame/drivers/bebox.cpp b/src/mame/drivers/bebox.cpp index 87440306b37..905e8b01273 100644 --- a/src/mame/drivers/bebox.cpp +++ b/src/mame/drivers/bebox.cpp @@ -94,7 +94,7 @@ ADDRESS_MAP_END LSI53C810_FETCH_CB(bebox_state::scsi_fetch) { - UINT32 result = m_ppc1->space(AS_PROGRAM).read_dword(dsp & 0x7FFFFFFF); + uint32_t result = m_ppc1->space(AS_PROGRAM).read_dword(dsp & 0x7FFFFFFF); return BYTE_REVERSE32(result); } diff --git a/src/mame/drivers/beehive.cpp b/src/mame/drivers/beehive.cpp index f78fe9b9d7c..26215237621 100644 --- a/src/mame/drivers/beehive.cpp +++ b/src/mame/drivers/beehive.cpp @@ -35,12 +35,12 @@ public: required_device m_maincpu; DECLARE_READ8_MEMBER(beehive_60_r); DECLARE_WRITE8_MEMBER(beehive_62_w); - const UINT8 *m_p_chargen; - required_shared_ptr m_p_videoram; - UINT8 m_keyline; + const uint8_t *m_p_chargen; + required_shared_ptr m_p_videoram; + uint8_t m_keyline; virtual void machine_reset() override; virtual void video_start() override; - 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); }; READ8_MEMBER(beehive_state::beehive_60_r) @@ -236,13 +236,13 @@ void beehive_state::video_start() /* This system appears to have inline attribute bytes of unknown meaning. Currently they are ignored. */ -UINT32 beehive_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t beehive_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 cursor_pos = (m_p_videoram[0xcaf] | (m_p_videoram[0xcb0] << 8)) & 0xfff; - UINT16 p_linelist; - UINT8 line_length; - UINT8 y,ra,chr,gfx,inv; - UINT16 sy=0,ma,x; + uint16_t cursor_pos = (m_p_videoram[0xcaf] | (m_p_videoram[0xcb0] << 8)) & 0xfff; + uint16_t p_linelist; + uint8_t line_length; + uint8_t y,ra,chr,gfx,inv; + uint16_t sy=0,ma,x; for (y = 0; y < 25; y++) { @@ -252,8 +252,8 @@ UINT32 beehive_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); - UINT8 chars = 0; + uint16_t *p = &bitmap.pix16(sy++); + uint8_t chars = 0; for (x = ma; x < ma + line_length; x++) { diff --git a/src/mame/drivers/berzerk.cpp b/src/mame/drivers/berzerk.cpp index 14d87d7d4ff..e8b277064d3 100644 --- a/src/mame/drivers/berzerk.cpp +++ b/src/mame/drivers/berzerk.cpp @@ -41,16 +41,16 @@ public: required_device m_custom; required_device m_screen; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; - UINT8 m_magicram_control; - UINT8 m_last_shift_data; - UINT8 m_intercept; + uint8_t m_magicram_control; + uint8_t m_last_shift_data; + uint8_t m_intercept; emu_timer *m_irq_timer; emu_timer *m_nmi_timer; - UINT8 m_irq_enabled; - UINT8 m_nmi_enabled; + uint8_t m_irq_enabled; + uint8_t m_nmi_enabled; int m_p1_counter_74ls161; int m_p1_direction; int m_p2_counter_74ls161; @@ -79,12 +79,12 @@ public: virtual void sound_reset() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(irq_callback); TIMER_CALLBACK_MEMBER(nmi_callback); - void vpos_to_vsync_chain_counter(int vpos, UINT8 *counter, UINT8 *v256); - int vsync_chain_counter_to_vpos(UINT8 counter, UINT8 v256); + void vpos_to_vsync_chain_counter(int vpos, uint8_t *counter, uint8_t *v256); + int vsync_chain_counter_to_vpos(uint8_t counter, uint8_t v256); void create_irq_timer(); void start_irq_timer(); void create_nmi_timer(); @@ -108,11 +108,11 @@ public: #define IRQS_PER_FRAME (2) #define NMIS_PER_FRAME (8) -static const UINT8 irq_trigger_counts[IRQS_PER_FRAME] = { 0x80, 0xda }; -static const UINT8 irq_trigger_v256s [IRQS_PER_FRAME] = { 0x00, 0x01 }; +static const uint8_t irq_trigger_counts[IRQS_PER_FRAME] = { 0x80, 0xda }; +static const uint8_t irq_trigger_v256s [IRQS_PER_FRAME] = { 0x00, 0x01 }; -static const UINT8 nmi_trigger_counts[NMIS_PER_FRAME] = { 0x30, 0x50, 0x70, 0x90, 0xb0, 0xd0, 0xf0, 0xf0 }; -static const UINT8 nmi_trigger_v256s [NMIS_PER_FRAME] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }; +static const uint8_t nmi_trigger_counts[NMIS_PER_FRAME] = { 0x30, 0x50, 0x70, 0x90, 0xb0, 0xd0, 0xf0, 0xf0 }; +static const uint8_t nmi_trigger_v256s [NMIS_PER_FRAME] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }; /************************************* @@ -157,7 +157,7 @@ WRITE8_MEMBER(berzerk_state::led_off_w) * *************************************/ -void berzerk_state::vpos_to_vsync_chain_counter(int vpos, UINT8 *counter, UINT8 *v256) +void berzerk_state::vpos_to_vsync_chain_counter(int vpos, uint8_t *counter, uint8_t *v256) { /* convert from a vertical position to the actual values on the vertical sync counters */ *v256 = ((vpos < VBEND) || (vpos >= VBSTART)); @@ -176,7 +176,7 @@ void berzerk_state::vpos_to_vsync_chain_counter(int vpos, UINT8 *counter, UINT8 } -int berzerk_state::vsync_chain_counter_to_vpos(UINT8 counter, UINT8 v256) +int berzerk_state::vsync_chain_counter_to_vpos(uint8_t counter, uint8_t v256) { /* convert from the vertical sync counters to an actual vertical position */ int vpos; @@ -213,8 +213,8 @@ WRITE8_MEMBER(berzerk_state::irq_enable_w) TIMER_CALLBACK_MEMBER(berzerk_state::irq_callback) { int irq_number = param; - UINT8 next_counter; - UINT8 next_v256; + uint8_t next_counter; + uint8_t next_v256; int next_vpos; int next_irq_number; @@ -290,8 +290,8 @@ READ8_MEMBER(berzerk_state::nmi_disable_r) TIMER_CALLBACK_MEMBER(berzerk_state::nmi_callback) { int nmi_number = param; - UINT8 next_counter; - UINT8 next_v256; + uint8_t next_counter; + uint8_t next_v256; int next_vpos; int next_nmi_number; @@ -378,15 +378,15 @@ void berzerk_state::video_start() WRITE8_MEMBER(berzerk_state::magicram_w) { - UINT8 alu_output; + uint8_t alu_output; - UINT8 current_video_data = m_videoram[offset]; + uint8_t current_video_data = m_videoram[offset]; /* shift data towards LSB. MSB bits are filled by data from last_shift_data. The shifter consists of 5 74153 devices @ 7A, 8A, 9A, 10A and 11A, followed by 4 more 153's at 11B, 10B, 9B and 8B, which optionally reverse the order of the resulting bits */ - UINT8 shift_flop_output = (((UINT16)m_last_shift_data << 8) | data) >> (m_magicram_control & 0x07); + uint8_t shift_flop_output = (((uint16_t)m_last_shift_data << 8) | data) >> (m_magicram_control & 0x07); if (m_magicram_control & 0x08) shift_flop_output = BITSWAP8(shift_flop_output, 0, 1, 2, 3, 4, 5, 6, 7); @@ -425,8 +425,8 @@ WRITE8_MEMBER(berzerk_state::magicram_control_w) READ8_MEMBER(berzerk_state::intercept_v256_r) { - UINT8 counter; - UINT8 v256; + uint8_t counter; + uint8_t v256; vpos_to_vsync_chain_counter(m_screen->vpos(), &counter, &v256); @@ -454,21 +454,21 @@ void berzerk_state::get_pens(rgb_t *pens) for (int color = 0; color < 0x10; color++) { - UINT8 r_bit = (color >> 0) & 0x01; - UINT8 g_bit = (color >> 1) & 0x01; - UINT8 b_bit = (color >> 2) & 0x01; - UINT8 i_bit = (color >> 3) & 0x01; + uint8_t r_bit = (color >> 0) & 0x01; + uint8_t g_bit = (color >> 1) & 0x01; + uint8_t b_bit = (color >> 2) & 0x01; + uint8_t i_bit = (color >> 3) & 0x01; - UINT8 r = combine_2_weights(color_weights, r_bit & i_bit, r_bit); - UINT8 g = combine_2_weights(color_weights, g_bit & i_bit, g_bit); - UINT8 b = combine_2_weights(color_weights, b_bit & i_bit, b_bit); + uint8_t r = combine_2_weights(color_weights, r_bit & i_bit, r_bit); + uint8_t g = combine_2_weights(color_weights, g_bit & i_bit, g_bit); + uint8_t b = combine_2_weights(color_weights, b_bit & i_bit, b_bit); pens[color] = rgb_t(r, g, b); } } -UINT32 berzerk_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t berzerk_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { rgb_t pens[0x10]; get_pens(pens); @@ -477,11 +477,11 @@ UINT32 berzerk_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, { int i; - UINT8 data = m_videoram[offs]; - UINT8 color = m_colorram[((offs >> 2) & 0x07e0) | (offs & 0x001f)]; + uint8_t data = m_videoram[offs]; + uint8_t color = m_colorram[((offs >> 2) & 0x07e0) | (offs & 0x001f)]; - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; for (i = 0; i < 4; i++) { @@ -929,8 +929,8 @@ READ8_MEMBER(berzerk_state::moonwarp_p1_r) // the dial input to go open bus. This is used in moon war 2 to switch between player 1 // and player 2 dials, which share a single port. moonwarp uses separate ports for the dials. signed char dialread = ioport("P1_DIAL")->read(); - UINT8 ret; - UINT8 buttons = (ioport("P1")->read()&0xe0); + uint8_t ret; + uint8_t buttons = (ioport("P1")->read()&0xe0); if (dialread < 0) m_p1_direction = 0; else if (dialread > 0) m_p1_direction = 0x10; m_p1_counter_74ls161 += abs(dialread); @@ -944,8 +944,8 @@ READ8_MEMBER(berzerk_state::moonwarp_p2_r) { // same as above, but for player 2 in cocktail mode signed char dialread = ioport("P2_DIAL")->read(); - UINT8 ret; - UINT8 buttons = (ioport("P2")->read()&0xe0); + uint8_t ret; + uint8_t buttons = (ioport("P2")->read()&0xe0); if (dialread < 0) m_p2_direction = 0; else if (dialread > 0) m_p2_direction = 0x10; m_p2_counter_74ls161 += abs(dialread); diff --git a/src/mame/drivers/besta.cpp b/src/mame/drivers/besta.cpp index 042c723027a..7b3d4af5c5f 100644 --- a/src/mame/drivers/besta.cpp +++ b/src/mame/drivers/besta.cpp @@ -43,8 +43,8 @@ public: DECLARE_READ8_MEMBER( mpcc_reg_r ); DECLARE_WRITE8_MEMBER( mpcc_reg_w ); DECLARE_WRITE8_MEMBER( kbd_put ); - UINT8 m_term_data; - UINT8 m_mpcc_regs[32]; + uint8_t m_term_data; + uint8_t m_mpcc_regs[32]; required_device m_maincpu; required_device m_pit1; @@ -52,12 +52,12 @@ public: virtual void machine_reset() override; required_device m_terminal; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; }; READ8_MEMBER( besta_state::mpcc_reg_r ) { - UINT8 ret; + uint8_t ret; if (!(offset == 0 && !m_mpcc_regs[0])) { DBG_LOG(1,"mpcc_reg_r",("(%d) = %02X at %s\n", offset, @@ -122,9 +122,9 @@ INPUT_PORTS_END void besta_state::machine_reset() { - UINT8* user1 = memregion("user1")->base(); + uint8_t* user1 = memregion("user1")->base(); - memcpy((UINT8*)m_p_ram.target(),user1,0x10000); // not really what happens but... + memcpy((uint8_t*)m_p_ram.target(),user1,0x10000); // not really what happens but... memset(m_mpcc_regs, 0, sizeof(m_mpcc_regs)); // should initialize to defined values m_mpcc_regs[8] = 0x80; // always ready to transmit diff --git a/src/mame/drivers/bestleag.cpp b/src/mame/drivers/bestleag.cpp index 7642defe137..bca0b7cfa54 100644 --- a/src/mame/drivers/bestleag.cpp +++ b/src/mame/drivers/bestleag.cpp @@ -45,11 +45,11 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_bgram; - required_shared_ptr m_fgram; - required_shared_ptr m_txram; - required_shared_ptr m_vregs; - required_shared_ptr m_spriteram; + required_shared_ptr m_bgram; + required_shared_ptr m_fgram; + required_shared_ptr m_txram; + required_shared_ptr m_vregs; + required_shared_ptr m_spriteram; tilemap_t *m_tx_tilemap; tilemap_t *m_bg_tilemap; @@ -67,8 +67,8 @@ public: virtual void video_start() override; - UINT32 screen_update_bestleag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bestleaw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bestleag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bestleaw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -134,7 +134,7 @@ Note: sprite chip is different than the other Big Striker sets and they */ void bestleag_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 *spriteram16 = m_spriteram; + uint16_t *spriteram16 = m_spriteram; /* @@ -187,7 +187,7 @@ void bestleag_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } } -UINT32 bestleag_state::screen_update_bestleag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bestleag_state::screen_update_bestleag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0,(m_vregs[0x00/2] & 0xfff) + (m_vregs[0x08/2] & 0x7) - 3); m_bg_tilemap->set_scrolly(0,m_vregs[0x02/2]); @@ -203,7 +203,7 @@ UINT32 bestleag_state::screen_update_bestleag(screen_device &screen, bitmap_ind1 return 0; } -UINT32 bestleag_state::screen_update_bestleaw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bestleag_state::screen_update_bestleaw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0,m_vregs[0x08/2]); m_bg_tilemap->set_scrolly(0,m_vregs[0x0a/2]); diff --git a/src/mame/drivers/beta.cpp b/src/mame/drivers/beta.cpp index b8a84700dc4..556d671c441 100644 --- a/src/mame/drivers/beta.cpp +++ b/src/mame/drivers/beta.cpp @@ -83,14 +83,14 @@ public: /* EPROM state */ int m_eprom_oe; int m_eprom_ce; - UINT16 m_eprom_addr; - UINT8 m_eprom_data; - UINT8 m_old_data; - std::vector m_eprom_rom; + uint16_t m_eprom_addr; + uint8_t m_eprom_data; + uint8_t m_old_data; + std::vector m_eprom_rom; /* display state */ - UINT8 m_ls145_p; - UINT8 m_segment; + uint8_t m_ls145_p; + uint8_t m_segment; emu_timer *m_led_refresh_timer; TIMER_CALLBACK_MEMBER(led_refresh); @@ -176,7 +176,7 @@ READ8_MEMBER( beta_state::riot_pa_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_ls145_p) { @@ -284,7 +284,7 @@ WRITE8_MEMBER( beta_state::riot_pb_w ) DEVICE_IMAGE_LOAD_MEMBER( beta_state, beta_eprom ) { - UINT32 size = m_eprom->common_get_size("rom"); + uint32_t size = m_eprom->common_get_size("rom"); if (size != 0x800) { diff --git a/src/mame/drivers/bfcobra.cpp b/src/mame/drivers/bfcobra.cpp index 81ac7473a95..2533e233674 100644 --- a/src/mame/drivers/bfcobra.cpp +++ b/src/mame/drivers/bfcobra.cpp @@ -103,13 +103,13 @@ union ADDR_REG { #ifdef LSB_FIRST - struct { UINT16 loword, hiword ; } as16bit; - struct { UINT8 addr0, addr1, addr2; } as8bit; + struct { uint16_t loword, hiword ; } as16bit; + struct { uint8_t addr0, addr1, addr2; } as8bit; #else - struct { UINT16 hiword, loword ; } as16bit; - struct { UINT8 addr2, addr1, addr0; } as8bit; + struct { uint16_t hiword, loword ; } as16bit; + struct { uint8_t addr2, addr1, addr0; } as8bit; #endif - UINT32 addr; + uint32_t addr; }; /* Blitter register flag bits */ @@ -152,26 +152,26 @@ struct bf_blitter_t { ADDR_REG program; - UINT8 control; - UINT8 status; + uint8_t control; + uint8_t status; - UINT8 command; + uint8_t command; ADDR_REG source; ADDR_REG dest; - UINT8 modectl; - UINT8 compfunc; - UINT8 outercnt; + uint8_t modectl; + uint8_t compfunc; + uint8_t outercnt; - UINT8 innercnt; - UINT8 step; - UINT8 pattern; + uint8_t innercnt; + uint8_t step; + uint8_t pattern; }; #define LOOPTYPE ( ( blitter.command&0x60 ) >> 5 ) struct fdc_t { - UINT8 MSR; + uint8_t MSR; int side; int track; @@ -189,8 +189,8 @@ struct fdc_t int cmd_cnt; int res_len; int res_cnt; - UINT8 cmd[10]; - UINT8 results[8]; + uint8_t cmd[10]; + uint8_t results[8]; }; @@ -231,30 +231,30 @@ public: { } - UINT8 m_bank_data[4]; - std::unique_ptr m_work_ram; - std::unique_ptr m_video_ram; - UINT8 m_h_scroll; - UINT8 m_v_scroll; - UINT8 m_flip_8; - UINT8 m_flip_22; - UINT8 m_videomode; - UINT8 m_data_r; - UINT8 m_data_t; + uint8_t m_bank_data[4]; + std::unique_ptr m_work_ram; + std::unique_ptr m_video_ram; + uint8_t m_h_scroll; + uint8_t m_v_scroll; + uint8_t m_flip_8; + uint8_t m_flip_22; + uint8_t m_videomode; + uint8_t m_data_r; + uint8_t m_data_t; int m_irq_state; int m_acia_irq; int m_vblank_irq; int m_blitter_irq; - UINT8 m_z80_int; - UINT8 m_z80_inten; - UINT32 m_meter_latch; - UINT32 m_mux_input; - UINT32 m_mux_outputlatch; - UINT8 m_col4bit[16]; - UINT8 m_col3bit[16]; - UINT8 m_col8bit[256]; - UINT8 m_col7bit[256]; - UINT8 m_col6bit[256]; + uint8_t m_z80_int; + uint8_t m_z80_inten; + uint32_t m_meter_latch; + uint32_t m_mux_input; + uint32_t m_mux_outputlatch; + uint8_t m_col4bit[16]; + uint8_t m_col3bit[16]; + uint8_t m_col8bit[256]; + uint8_t m_col7bit[256]; + uint8_t m_col6bit[256]; struct bf_blitter_t m_blitter; struct fdc_t m_fdc; DECLARE_READ8_MEMBER(chipset_r); @@ -277,16 +277,16 @@ public: DECLARE_DRIVER_INIT(bfcobra); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_bfcobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bfcobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(timer_irq); INTERRUPT_GEN_MEMBER(vblank_gen); void RunBlit(address_space &space); void update_irqs(); void reset_fdc(); - void exec_w_phase(UINT8 data); + void exec_w_phase(uint8_t data); void init_ram(); - void command_phase(struct fdc_t &fdc, UINT8 data); - inline UINT8* blitter_get_addr(UINT32 addr); + void command_phase(struct fdc_t &fdc, uint8_t data); + inline uint8_t* blitter_get_addr(uint32_t addr); inline void z80_bank(int num, int data); required_device m_maincpu; required_device m_audiocpu; @@ -299,7 +299,7 @@ public: }; -static const UINT8 col4bit_default[16]= +static const uint8_t col4bit_default[16]= { BLUE_0 | GREEN_0 | RED_0, BLUE_1, @@ -319,7 +319,7 @@ static const UINT8 col4bit_default[16]= RED_7 | GREEN_7 | BLUE_3 }; -static const UINT8 col3bit_default[16]= +static const uint8_t col3bit_default[16]= { 0, BLUE_3, @@ -339,7 +339,7 @@ static const UINT8 col3bit_default[16]= RED_7 | GREEN_7 | BLUE_3 }; -static const UINT8 col76index[] = {0, 2, 4, 7}; +static const uint8_t col76index[] = {0, 2, 4, 7}; void bfcobra_state::video_start() @@ -350,7 +350,7 @@ void bfcobra_state::video_start() memcpy(m_col3bit, col3bit_default, sizeof(m_col3bit)); for (i = 0; i < 256; ++i) { - UINT8 col; + uint8_t col; m_col8bit[i] = i; col = i & 0x7f; @@ -363,14 +363,14 @@ void bfcobra_state::video_start() } } -UINT32 bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x, y; - UINT8 *src; - UINT32 *dest; - UINT32 offset; - UINT8 *hirescol; - UINT8 *lorescol; + uint8_t *src; + uint32_t *dest; + uint32_t offset; + uint8_t *hirescol; + uint8_t *lorescol; /* Select screen has to be programmed into two registers */ /* No idea what happens if the registers are different */ @@ -397,14 +397,14 @@ UINT32 bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb32 for (y = cliprect.min_y; y <= cliprect.max_y; ++y) { - UINT16 y_offset = (y + m_v_scroll) * 256; + uint16_t y_offset = (y + m_v_scroll) * 256; src = &m_video_ram[offset + y_offset]; dest = &bitmap.pix32(y); for (x = cliprect.min_x; x <= cliprect.max_x / 2; ++x) { - UINT8 x_offset = x + m_h_scroll; - UINT8 pen = *(src + x_offset); + uint8_t x_offset = x + m_h_scroll; + uint8_t pen = *(src + x_offset); if ( ( m_videomode & 0x81 ) == 1 || (m_videomode & 0x80 && pen & 0x80) ) { @@ -422,27 +422,27 @@ UINT32 bfcobra_state::screen_update_bfcobra(screen_device &screen, bitmap_rgb32 return 0; } -UINT8* bfcobra_state::blitter_get_addr(UINT32 addr) +uint8_t* bfcobra_state::blitter_get_addr(uint32_t addr) { if (addr < 0x10000) { /* Is this region fixed? */ - return (UINT8*)(memregion("user1")->base() + addr); + return (uint8_t*)(memregion("user1")->base() + addr); } else if(addr < 0x20000) { addr &= 0xffff; addr += (m_bank_data[0] & 1) ? 0x10000 : 0; - return (UINT8*)(memregion("user1")->base() + addr + ((m_bank_data[0] >> 1) * 0x20000)); + return (uint8_t*)(memregion("user1")->base() + addr + ((m_bank_data[0] >> 1) * 0x20000)); } else if (addr >= 0x20000 && addr < 0x40000) { - return (UINT8*)&m_video_ram[addr - 0x20000]; + return (uint8_t*)&m_video_ram[addr - 0x20000]; } else { - return (UINT8*)&m_work_ram[addr - 0x40000]; + return (uint8_t*)&m_work_ram[addr - 0x40000]; } } @@ -462,8 +462,8 @@ void bfcobra_state::RunBlit(address_space &space) do { - UINT8 srcdata = 0; - UINT8 dstdata = 0; + uint8_t srcdata = 0; + uint8_t dstdata = 0; /* Read the blitter command */ BLITPRG_READ(source.as8bit.addr0); @@ -518,7 +518,7 @@ void bfcobra_state::RunBlit(address_space &space) /* Begin outer loop */ for (;;) { - UINT8 innercnt = blitter.innercnt; + uint8_t innercnt = blitter.innercnt; dstdata = blitter.pattern; if (blitter.command & CMD_LINEDRAW) @@ -571,10 +571,10 @@ void bfcobra_state::RunBlit(address_space &space) } else do { - UINT8 inhibit = 0; + uint8_t inhibit = 0; /* TODO: Set this correctly */ - UINT8 result = blitter.pattern; + uint8_t result = blitter.pattern; if (LOOPTYPE == 3 && innercnt == blitter.innercnt) { @@ -672,15 +672,15 @@ void bfcobra_state::RunBlit(address_space &space) The existing destination pixel is used as a lookup into the table and the colours is replaced. */ - UINT8 dest = *blitter_get_addr( blitter.dest.addr); - UINT8 newcol = *(blitter_get_addr( (blitter.source.addr + dest) & 0xfffff)); + uint8_t dest = *blitter_get_addr( blitter.dest.addr); + uint8_t newcol = *(blitter_get_addr( (blitter.source.addr + dest) & 0xfffff)); *blitter_get_addr( blitter.dest.addr) = newcol; cycles_used += 3; } else { - UINT8 final_result = 0; + uint8_t final_result = 0; if (blitter.compfunc & CMPFUNC_LOG3) final_result |= result & dstdata; @@ -799,7 +799,7 @@ void bfcobra_state::update_irqs() READ8_MEMBER(bfcobra_state::chipset_r) { - UINT8 val = 0xff; + uint8_t val = 0xff; switch(offset) { @@ -945,7 +945,7 @@ void bfcobra_state::z80_bank(int num, int data) if (data < 0x08) { - UINT32 offset = ((m_bank_data[0] >> 1) * 0x20000) + ((0x4000 * data) ^ ((m_bank_data[0] & 1) ? 0 : 0x10000)); + uint32_t offset = ((m_bank_data[0] >> 1) * 0x20000) + ((0x4000 * data) ^ ((m_bank_data[0] & 1) ? 0 : 0x10000)); membank(bank_names[num - 1])->set_base(memregion("user1")->base() + offset); } @@ -1020,7 +1020,7 @@ void bfcobra_state::reset_fdc() READ8_MEMBER(bfcobra_state::fdctrl_r) { - UINT8 val = 0; + uint8_t val = 0; val = m_fdc.MSR; @@ -1034,7 +1034,7 @@ READ8_MEMBER(bfcobra_state::fddata_r) #define SPT 10 #define BPT 1024*10 - UINT8 val = 0; + uint8_t val = 0; if (fdc.phase == EXECUTION_R) { @@ -1122,7 +1122,7 @@ WRITE8_MEMBER(bfcobra_state::fdctrl_w) } } -void bfcobra_state::command_phase(struct fdc_t &fdc, UINT8 data) +void bfcobra_state::command_phase(struct fdc_t &fdc, uint8_t data) { if (fdc.cmd_cnt == 0) { @@ -1204,18 +1204,18 @@ void bfcobra_state::command_phase(struct fdc_t &fdc, UINT8 data) } #ifdef UNUSED_FUNCTION -UINT8 bfcobra_state::exec_r_phase(void) +uint8_t bfcobra_state::exec_r_phase(void) { return 0; } #endif -void bfcobra_state::exec_w_phase(UINT8 data) +void bfcobra_state::exec_w_phase(uint8_t data) { } #ifdef UNUSED_FUNCTION -UINT8 bfcobra_state::results_phase(void) +uint8_t bfcobra_state::results_phase(void) { return 0; } @@ -1519,10 +1519,10 @@ INPUT_PORTS_END void bfcobra_state::init_ram() { /* 768kB work RAM */ - m_work_ram = make_unique_clear(0xC0000); + m_work_ram = make_unique_clear(0xC0000); /* 128kB video RAM */ - m_video_ram = make_unique_clear(0x20000); + m_video_ram = make_unique_clear(0x20000); } @@ -1563,22 +1563,22 @@ DRIVER_INIT_MEMBER(bfcobra_state,bfcobra) 6809 ROM address and data lines are scrambled. This is the same scrambling as Scorpion 2. */ - static const UINT8 datalookup[] = { 1, 3, 5, 6, 4, 2, 0, 7 }; - static const UINT8 addrlookup[] = { 11, 12, 0, 2, 3, 5, 7, 9, 8, 6, 1, 4, 10, 13, 14 }; + static const uint8_t datalookup[] = { 1, 3, 5, 6, 4, 2, 0, 7 }; + static const uint8_t addrlookup[] = { 11, 12, 0, 2, 3, 5, 7, 9, 8, 6, 1, 4, 10, 13, 14 }; - UINT32 i; - UINT8 *rom; + uint32_t i; + uint8_t *rom; - std::vector tmp(0x8000); + std::vector tmp(0x8000); rom = memregion("audiocpu")->base() + 0x8000; memcpy(&tmp[0], rom, 0x8000); for (i = 0; i < 0x8000; i++) { - UINT16 addr = 0; - UINT8 x; - UINT8 data = 0; - UINT8 val = tmp[i]; + uint16_t addr = 0; + uint8_t x; + uint8_t data = 0; + uint8_t val = tmp[i]; for (x = 0; x < 8; x ++) data |= ((val >> x) & 1) << datalookup[x]; diff --git a/src/mame/drivers/bfm_ad5.cpp b/src/mame/drivers/bfm_ad5.cpp index ec3073b7540..0f04d132e40 100644 --- a/src/mame/drivers/bfm_ad5.cpp +++ b/src/mame/drivers/bfm_ad5.cpp @@ -19,7 +19,7 @@ DRIVER_INIT_MEMBER(adder5_state,ad5) { // sc5 roms always start with SC5 - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); // printf("%02x %02x %02x %02x\n", src[0], src[1], src[2], src[3]); if (((src[0] == 0x20) && (src[2] == 0x43)) || ((src[1] == 0x35) && (src[3] == 0x53))) { diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp index 0b181edbb9e..50e78799359 100644 --- a/src/mame/drivers/bfm_sc1.cpp +++ b/src/mame/drivers/bfm_sc1.cpp @@ -156,8 +156,8 @@ public: int m_mux2_datalo; int m_mux2_datahi; int m_mux2_input; - UINT8 m_sc1_Inputs[64]; - UINT8 m_codec_data[256]; + uint8_t m_sc1_Inputs[64]; + uint8_t m_codec_data[256]; int m_defaultbank; DECLARE_WRITE8_MEMBER(bankswitch_w); @@ -407,7 +407,7 @@ WRITE8_MEMBER(bfm_sc1_state::vfd_w) // conversion table BFM strobe data to internal lamp numbers -static const UINT8 BFM_strcnv[] = +static const uint8_t BFM_strcnv[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97, @@ -660,7 +660,7 @@ void bfm_sc1_state::machine_reset() // init rom bank //////////////////////////////////////////////////////////////////// { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &rom[0x0000], 0x02000); membank("bank1")->set_entry(m_defaultbank); @@ -1163,7 +1163,7 @@ int bfm_sc1_state::sc1_find_project_string( ) { // search for the project string to find the title (usually just at ff00) char title_string[7][32] = { "PROJECT NUMBER", "PROJECT PR", "PROJECT ", "CASH ON THE NILE 2", "PR6121", "CHINA TOWN\x0d\x0a", "PROJECTNUMBER" }; - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); int size = memregion( "maincpu" )->bytes(); for (auto & elem : title_string) @@ -1176,8 +1176,8 @@ int bfm_sc1_state::sc1_find_project_string( ) int found = 1; for (j=0;j m_meters; // scorpion2_vid doesn't use this (scorpion2_vidm does) int m_sc2gui_update_mmtr; //not used? - UINT8 *m_nvram; - UINT8 m_key[8]; - UINT8 m_e2ram[1024]; + uint8_t *m_nvram; + uint8_t m_key[8]; + uint8_t m_e2ram[1024]; int m_mmtr_latch; int m_irq_status; int m_optic_pattern; @@ -270,8 +270,8 @@ public: int m_hopper_running; int m_hopper_coin_sense; int m_timercnt; - UINT8 m_sc2_Inputs[64]; - UINT8 m_input_override[64]; + uint8_t m_sc2_Inputs[64]; + uint8_t m_input_override[64]; int m_e2reg; int m_e2state; int m_e2cnt; @@ -281,8 +281,8 @@ public: int m_e2data_pin; int m_e2dummywrite; int m_e2data_to_read; - UINT8 m_codec_data[256]; - UINT8 m_lamps_old[0x20]; + uint8_t m_codec_data[256]; + uint8_t m_lamps_old[0x20]; void e2ram_init(nvram_device &nvram, void *data, size_t size); DECLARE_WRITE_LINE_MEMBER(bfmdm01_busy); DECLARE_WRITE8_MEMBER(bankswitch_w); @@ -439,7 +439,7 @@ void bfm_sc2_state::on_scorpion2_reset() // init rom bank //////////////////////////////////////////////////////// { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); m_rombank1->configure_entries(0, 4, &rom[0x00000], 0x02000); @@ -511,7 +511,7 @@ int bfm_sc2_state::Scorpion2_GetSwitchState(int strobe, int data) void bfm_sc2_state::e2ram_init(nvram_device &nvram, void *data, size_t size) { - static const UINT8 init_e2ram[] = { 1, 4, 10, 20, 0, 1, 1, 4, 10, 20 }; + static const uint8_t init_e2ram[] = { 1, 4, 10, 20, 0, 1, 1, 4, 10, 20 }; memset(data,0x00,size); memcpy(data,init_e2ram,sizeof(init_e2ram)); } @@ -2253,7 +2253,7 @@ int bfm_sc2_state::sc2_find_project_string( ) { // search for the project string to find the title (usually just at ff00) char title_string[4][32] = { "PROJECT NUMBER", "PROJECT PR", "PROJECT ", "CASH ON THE NILE 2" }; - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); int size = memregion( "maincpu" )->bytes(); for (auto & elem : title_string) @@ -2266,8 +2266,8 @@ int bfm_sc2_state::sc2_find_project_string( ) int found = 1; for (j=0;jbase(); memcpy(m_key, pal, 8); } diff --git a/src/mame/drivers/bfm_sc4.cpp b/src/mame/drivers/bfm_sc4.cpp index a7b65a0688f..be004c2f562 100644 --- a/src/mame/drivers/bfm_sc4.cpp +++ b/src/mame/drivers/bfm_sc4.cpp @@ -257,9 +257,9 @@ -UINT8 sc4_state::read_input_matrix(int row) +uint8_t sc4_state::read_input_matrix(int row) { - UINT8 value; + uint8_t value; if (row<4) value = (m_io_ports[row].read_safe(0x00) & 0x1f) + ((m_io_ports[row+8].read_safe(0x00) & 0x07) << 5); @@ -278,16 +278,16 @@ READ16_MEMBER(sc4_state::sc4_cs1_r) // allow some sets to boot, should probably return this data on Mbus once we figure out what it is if ((pc == m_chk41addr) && (offset == m_chk41addr>>1)) { - UINT32 r_A0 = space.device().state().state_int(M68K_A0); - UINT32 r_A1 = space.device().state().state_int(M68K_A1); - UINT32 r_D1 = space.device().state().state_int(M68K_D1); + uint32_t r_A0 = space.device().state().state_int(M68K_A0); + uint32_t r_A1 = space.device().state().state_int(M68K_A1); + uint32_t r_D1 = space.device().state().state_int(M68K_D1); if (r_D1 == 0x7) { bool valid = true; for (int i=0;i<8;i++) { - UINT8 code = space.read_byte(r_A0+i); + uint8_t code = space.read_byte(r_A0+i); if (code != 0xff) // assume our mbus code just returns 0xff for now.. valid = false; } @@ -300,7 +300,7 @@ READ16_MEMBER(sc4_state::sc4_cs1_r) printf("Ident code? "); for (int i=0;i<8;i++) { - UINT8 code = space.read_byte(r_A1+i); + uint8_t code = space.read_byte(r_A1+i); printf("%02x",code); space.write_byte(r_A0+i, code); } @@ -324,7 +324,7 @@ READ16_MEMBER(sc4_state::sc4_mem_r) int cs = m_maincpu->get_cs(offset * 2); int base = 0, end = 0, base2 = 0, end2 = 0; // if (!(debugger_access())) printf("cs is %d\n", cs); - UINT16 retvalue; + uint16_t retvalue; switch ( cs ) @@ -353,7 +353,7 @@ READ16_MEMBER(sc4_state::sc4_mem_r) if (addr < 0x0080) { - UINT16 retvalue = 0x0000; + uint16_t retvalue = 0x0000; if (ACCESSING_BITS_8_15) { logerror("mem_mask&0xff00 unhandled\n"); @@ -471,9 +471,9 @@ WRITE8_MEMBER(bfm_sc45_state::mux_output2_w) { m_segment_34_cache[offset] = data; - UINT16 short_data; - UINT8 byte_data_first_segment; - UINT8 byte_data_second_segment; + uint16_t short_data; + uint8_t byte_data_first_segment; + uint8_t byte_data_second_segment; for (int digit = 0; digit < 32; digit += 2) { short_data = (m_segment_34_cache[digit + 1] << 8) | m_segment_34_cache[digit]; @@ -491,7 +491,7 @@ WRITE8_MEMBER(bfm_sc45_state::mux_output2_w) } else { - UINT8 bf7segdata = BITSWAP8(data,0,7,6,5,4,3,2,1); + uint8_t bf7segdata = BITSWAP8(data,0,7,6,5,4,3,2,1); output().set_digit_value(offset, bf7segdata); } } @@ -728,7 +728,7 @@ void bfm_sc45_state::bfm_sc45_write_serial_vfd(bool cs, bool clock, bool data) } -void sc4_state::bfm_sc4_68307_porta_w(address_space &space, bool dedicated, UINT8 data, UINT8 line_mask) +void sc4_state::bfm_sc4_68307_porta_w(address_space &space, bool dedicated, uint8_t data, uint8_t line_mask) { m_reel12_latch = data; @@ -767,7 +767,7 @@ WRITE8_MEMBER( sc4_state::bfm_sc4_reel4_w ) } } -void sc4_state::bfm_sc4_68307_portb_w(address_space &space, bool dedicated, UINT16 data, UINT16 line_mask) +void sc4_state::bfm_sc4_68307_portb_w(address_space &space, bool dedicated, uint16_t data, uint16_t line_mask) { // if (dedicated == false) { @@ -782,14 +782,14 @@ void sc4_state::bfm_sc4_68307_portb_w(address_space &space, bool dedicated, UINT } } -UINT8 sc4_state::bfm_sc4_68307_porta_r(address_space &space, bool dedicated, UINT8 line_mask) +uint8_t sc4_state::bfm_sc4_68307_porta_r(address_space &space, bool dedicated, uint8_t line_mask) { int pc = space.device().safe_pc(); logerror("%08x bfm_sc4_68307_porta_r\n", pc); return 0xbb;// machine().rand(); } -UINT16 sc4_state::bfm_sc4_68307_portb_r(address_space &space, bool dedicated, UINT16 line_mask) +uint16_t sc4_state::bfm_sc4_68307_portb_r(address_space &space, bool dedicated, uint16_t line_mask) { if (dedicated==false) { @@ -1247,8 +1247,8 @@ MACHINE_CONFIG_END MACHINE_START_MEMBER(sc4_adder4_state,adder4) { - m_adder4cpuregion = (UINT32*)memregion( "adder4" )->base(); - m_adder4ram = make_unique_clear(0x10000); + m_adder4cpuregion = (uint32_t*)memregion( "adder4" )->base(); + m_adder4ram = make_unique_clear(0x10000); MACHINE_START_CALL_MEMBER(sc4); } @@ -1713,7 +1713,7 @@ INPUT_PORTS_END #define MACHINE_FLAGS MACHINE_NOT_WORKING|MACHINE_CLICKABLE_ARTWORK #define MACHINE_FLAGS_NOSOUND MACHINE_FLAGS|MACHINE_NO_SOUND -bool compare_mbus(UINT16* rom) +bool compare_mbus(uint16_t* rom) { for (int i=0;i<11;i++) { @@ -1733,7 +1733,7 @@ bool compare_mbus(UINT16* rom) return true; } -void sc4_state::find_mbus(UINT16* rom) +void sc4_state::find_mbus(uint16_t* rom) { for (int i=0;i<(0x100000-0x40)/2;i++) { @@ -1760,7 +1760,7 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER(sc4_state,sc4) { - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); // SC4 identification sequence 0x80 0x00 0xf0 0x7d if (((src[0] == 0x80) && (src[2] == 0xf0)) || ((src[1] == 0x00) && (src[3] == 0x7d))) { @@ -1797,7 +1797,7 @@ DRIVER_INIT_MEMBER(sc4_state,sc4) DRIVER_INIT_MEMBER(sc4_state,sc4mbus) { DRIVER_INIT_CALL(sc4); - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); find_mbus(rom); } diff --git a/src/mame/drivers/bfm_sc5sw.hxx b/src/mame/drivers/bfm_sc5sw.hxx index 408613a88b6..02a09a715a5 100644 --- a/src/mame/drivers/bfm_sc5sw.hxx +++ b/src/mame/drivers/bfm_sc5sw.hxx @@ -13117,7 +13117,7 @@ extern int find_project_string(running_machine &machine, int addrxor, int mode); DRIVER_INIT_MEMBER(bfm_sc5_state,sc5) { // sc5 roms always start with SC5 - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); // printf("%02x %02x %02x %02x\n", src[0], src[1], src[2], src[3]); if (((src[0] == 0x20) && (src[2] == 0x43)) || ((src[1] == 0x35) && (src[3] == 0x53))) { diff --git a/src/mame/drivers/bfm_swp.cpp b/src/mame/drivers/bfm_swp.cpp index 6c7c91e0730..e6240a9ecea 100644 --- a/src/mame/drivers/bfm_swp.cpp +++ b/src/mame/drivers/bfm_swp.cpp @@ -113,14 +113,14 @@ public: m_maincpu(*this, "maincpu") { } - UINT32* m_cpuregion; - std::unique_ptr m_mainram; + uint32_t* m_cpuregion; + std::unique_ptr m_mainram; DECLARE_READ32_MEMBER(bfm_swp_mem_r); DECLARE_WRITE32_MEMBER(bfm_swp_mem_w); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } @@ -190,8 +190,8 @@ INPUT_PORTS_END void bfm_swp_state::machine_start() { - m_cpuregion = (UINT32*)memregion( "maincpu" )->base(); - m_mainram = make_unique_clear(0x10000); + m_cpuregion = (uint32_t*)memregion( "maincpu" )->base(); + m_mainram = make_unique_clear(0x10000); } diff --git a/src/mame/drivers/bfmsys83.cpp b/src/mame/drivers/bfmsys83.cpp index 1fbed4b72c5..2a297628db9 100644 --- a/src/mame/drivers/bfmsys83.cpp +++ b/src/mame/drivers/bfmsys83.cpp @@ -15,7 +15,7 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - UINT8 m_codec_data[256]; + uint8_t m_codec_data[256]; required_device m_maincpu; }; diff --git a/src/mame/drivers/bfmsys85.cpp b/src/mame/drivers/bfmsys85.cpp index 63fac8f922f..352d55121ea 100644 --- a/src/mame/drivers/bfmsys85.cpp +++ b/src/mame/drivers/bfmsys85.cpp @@ -100,9 +100,9 @@ public: int m_mux_output_strobe; int m_mux_input_strobe; int m_mux_input; - UINT8 m_Inputs[64]; - UINT8 m_codec_data[256]; - UINT8 m_sys85_data_line_t; + uint8_t m_Inputs[64]; + uint8_t m_codec_data[256]; + uint8_t m_sys85_data_line_t; DECLARE_WRITE8_MEMBER(watchdog_w); DECLARE_READ8_MEMBER(irqlatch_r); DECLARE_WRITE8_MEMBER(reel12_w); @@ -672,7 +672,7 @@ int bfmsys85_state::b85_find_project_string( ) { // search for the project string to find the title (usually just at ff00) char title_string[7][32] = { "PROJECT NUMBER", "PROJECT PR", "PROJECT ", "CASH ON THE NILE 2", "PR6121", "CHINA TOWN\x0d\x0a", "PROJECTNUMBER" }; - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); int size = memregion( "maincpu" )->bytes(); for (auto & elem : title_string) @@ -685,8 +685,8 @@ int bfmsys85_state::b85_find_project_string( ) int found = 1; for (j=0;j m_v9938; - UINT8 m_mux_data; + uint8_t m_mux_data; DECLARE_READ8_MEMBER(mux_r); DECLARE_WRITE8_MEMBER(mux_w); required_device m_maincpu; @@ -105,7 +105,7 @@ WRITE8_MEMBER(big10_state::mux_w) READ8_MEMBER(big10_state::mux_r) { - UINT8 result = 0xff; + uint8_t result = 0xff; for (int b = 0; b < 6; b++) if (BIT(m_mux_data, b)) result &= m_in[b]->read(); diff --git a/src/mame/drivers/bigbord2.cpp b/src/mame/drivers/bigbord2.cpp index 31399b8e252..047a5dff665 100644 --- a/src/mame/drivers/bigbord2.cpp +++ b/src/mame/drivers/bigbord2.cpp @@ -126,13 +126,13 @@ public: required_device m_palette; private: - UINT8 crt8002(UINT8 ac_ra, UINT8 ac_chr, UINT8 ac_attr, UINT16 ac_cnt, bool ac_curs); - UINT8 *m_p_chargen; /* character ROM */ - UINT8 *m_p_videoram; /* Video RAM */ - UINT8 *m_p_attribram; /* Attribute RAM */ - UINT8 m_term_data; - UINT8 m_term_status; - UINT16 m_cnt; + uint8_t crt8002(uint8_t ac_ra, uint8_t ac_chr, uint8_t ac_attr, uint16_t ac_cnt, bool ac_curs); + uint8_t *m_p_chargen; /* character ROM */ + uint8_t *m_p_videoram; /* Video RAM */ + uint8_t *m_p_attribram; /* Attribute RAM */ + uint8_t m_term_data; + uint8_t m_term_status; + uint16_t m_cnt; bool m_c8[8]; bool m_cc[8]; floppy_image_device *m_floppy; @@ -173,7 +173,7 @@ WRITE8_MEMBER( bigbord2_state::portc0_w ) READ8_MEMBER( bigbord2_state::portc4_r ) { - UINT8 ret = m_term_status | 3 | (m_c8[6]<<2) | m_dsw->read(); + uint8_t ret = m_term_status | 3 | (m_c8[6]<<2) | m_dsw->read(); m_term_status = 0; return ret; } @@ -182,7 +182,7 @@ READ8_MEMBER( bigbord2_state::portc4_r ) READ8_MEMBER( bigbord2_state::portd0_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -458,7 +458,7 @@ void bigbord2_state::machine_start() void bigbord2_state::machine_reset() { - UINT8 i; + uint8_t i; for (i = 0; i < 8; i++) { m_c8[i] = 0; @@ -475,7 +475,7 @@ DRIVER_INIT_MEMBER(bigbord2_state,bigbord2) { m_mem = &m_maincpu->space(AS_PROGRAM); m_io = &m_maincpu->space(AS_IO); - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); m_bankr->configure_entries(0, 2, &RAM[0x0000], 0x10000); m_bankv->configure_entries(0, 2, &RAM[0x6000], 0x10000); m_banka->configure_entries(0, 2, &RAM[0x7000], 0x10000); @@ -502,9 +502,9 @@ static GFXDECODE_START( crt8002 ) GFXDECODE_ENTRY( "chargen", 0x0000, crt8002_charlayout, 0, 1 ) GFXDECODE_END -UINT8 bigbord2_state::crt8002(UINT8 ac_ra, UINT8 ac_chr, UINT8 ac_attr, UINT16 ac_cnt, bool ac_curs) +uint8_t bigbord2_state::crt8002(uint8_t ac_ra, uint8_t ac_chr, uint8_t ac_attr, uint16_t ac_cnt, bool ac_curs) { - UINT8 gfx = 0; + uint8_t gfx = 0; switch (ac_attr & 3) { case 0: // lores gfx @@ -558,9 +558,9 @@ UINT8 bigbord2_state::crt8002(UINT8 ac_ra, UINT8 ac_chr, UINT8 ac_attr, UINT16 a MC6845_UPDATE_ROW( bigbord2_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx,attr; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx,attr; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); ra &= 15; m_cnt++; diff --git a/src/mame/drivers/bigevglf.cpp b/src/mame/drivers/bigevglf.cpp index 57f3b50c088..e93c9ac3ca4 100644 --- a/src/mame/drivers/bigevglf.cpp +++ b/src/mame/drivers/bigevglf.cpp @@ -93,7 +93,7 @@ READ8_MEMBER(bigevglf_state::beg_fromsound_r) READ8_MEMBER(bigevglf_state::beg_soundstate_r) { - UINT8 ret = m_sound_state; + uint8_t ret = m_sound_state; /* set a timer to force synchronization after the read */ machine().scheduler().synchronize(); m_sound_state &= ~2; /* read from port 21 clears bit 1 in status */ @@ -602,7 +602,7 @@ ROM_END DRIVER_INIT_MEMBER(bigevglf_state,bigevglf) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0xff, &ROM[0x10000], 0x800); } diff --git a/src/mame/drivers/binbug.cpp b/src/mame/drivers/binbug.cpp index 85062aeea0d..7db5c0e76c6 100644 --- a/src/mame/drivers/binbug.cpp +++ b/src/mame/drivers/binbug.cpp @@ -74,14 +74,14 @@ public: DECLARE_WRITE8_MEMBER(binbug_ctrl_w); DECLARE_READ8_MEMBER(binbug_serial_r); DECLARE_WRITE_LINE_MEMBER(binbug_serial_w); - const UINT8 *m_p_chargen; - UINT8 m_framecnt; + const uint8_t *m_p_chargen; + uint8_t m_framecnt; virtual void video_start() override; - 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); optional_device m_rs232; required_device m_cass; - required_shared_ptr m_p_videoram; - required_shared_ptr m_p_attribram; + required_shared_ptr m_p_videoram; + required_shared_ptr m_p_attribram; required_device m_maincpu; DECLARE_QUICKLOAD_LOAD_MEMBER( binbug ); }; @@ -123,11 +123,11 @@ void binbug_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 binbug_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t binbug_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // attributes bit 0 = flash, bit 1 = lores. Also bit 7 of the character = reverse-video (text only). - UINT8 y,ra,chr,gfx,attr,inv,gfxbit; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx,attr,inv,gfxbit; + uint16_t sy=0,ma=0,x; bool flash; m_framecnt++; @@ -135,7 +135,7 @@ UINT32 binbug_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, { for (ra = 0; ra < 16; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 64; x++) { @@ -224,7 +224,7 @@ QUICKLOAD_LOAD_MEMBER( binbug_state, binbug ) int quick_addr = 0x440; int exec_addr; int quick_length; - std::vector quick_data; + std::vector quick_data; int read_; image_init_result result = image_init_result::FAIL; @@ -423,9 +423,9 @@ public: DECLARE_WRITE8_MEMBER(kbd_put); TIMER_DEVICE_CALLBACK_MEMBER(time_tick); TIMER_DEVICE_CALLBACK_MEMBER(uart_tick); - UINT8 m_pio_b; - UINT8 m_term_data; - UINT8 m_protection[0x100]; + uint8_t m_pio_b; + uint8_t m_term_data; + uint8_t m_protection[0x100]; virtual void machine_reset() override; required_device m_maincpu; required_device m_ctc; @@ -480,7 +480,7 @@ WRITE8_MEMBER( dg680_state::kbd_put ) READ8_MEMBER( dg680_state::porta_r ) { - UINT8 data = m_term_data; + uint8_t data = m_term_data; m_term_data = 0; return data; } @@ -499,13 +499,13 @@ WRITE8_MEMBER( dg680_state::portb_w ) READ8_MEMBER( dg680_state::port08_r ) { - UINT8 breg = m_maincpu->state_int(Z80_B); + uint8_t breg = m_maincpu->state_int(Z80_B); return m_protection[breg]; } WRITE8_MEMBER( dg680_state::port08_w ) { - UINT8 breg = m_maincpu->state_int(Z80_B); + uint8_t breg = m_maincpu->state_int(Z80_B); m_protection[breg] = data; } diff --git a/src/mame/drivers/bingoc.cpp b/src/mame/drivers/bingoc.cpp index 2ec0fe3e47c..7735444b6c3 100644 --- a/src/mame/drivers/bingoc.cpp +++ b/src/mame/drivers/bingoc.cpp @@ -47,12 +47,12 @@ public: m_upd7759(*this, "upd"), m_soundlatch(*this, "soundlatch") { } - UINT8 m_x; + uint8_t m_x; DECLARE_READ16_MEMBER(unknown_r); DECLARE_WRITE16_MEMBER(main_sound_latch_w); DECLARE_WRITE8_MEMBER(sound_play_w); virtual void video_start() override; - UINT32 screen_update_bingoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bingoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_soundcpu; required_device m_upd7759; @@ -66,7 +66,7 @@ void bingoc_state::video_start() { } -UINT32 bingoc_state::screen_update_bingoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bingoc_state::screen_update_bingoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } @@ -111,7 +111,7 @@ WRITE8_MEMBER(bingoc_state::sound_play_w) ---- --x- sound rom banking ---- ---x start-stop sample */ - UINT8 *upd = memregion("upd")->base(); + uint8_t *upd = memregion("upd")->base(); memcpy(&upd[0x00000], &upd[0x20000 + (((data & 2)>>1) * 0x20000)], 0x20000); m_upd7759->start_w(data & 1); // printf("%02x\n",data); diff --git a/src/mame/drivers/bingoman.cpp b/src/mame/drivers/bingoman.cpp index f9551bcfd67..3817029ef34 100644 --- a/src/mame/drivers/bingoman.cpp +++ b/src/mame/drivers/bingoman.cpp @@ -255,7 +255,7 @@ public: required_device m_maincpu; // screen updates - 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); DECLARE_PALETTE_INIT(bingoman); protected: // driver_device overrides @@ -269,7 +269,7 @@ void bingoman_state::video_start() { } -UINT32 bingoman_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t bingoman_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } diff --git a/src/mame/drivers/bingor.cpp b/src/mame/drivers/bingor.cpp index a02e65854cb..277452dd760 100644 --- a/src/mame/drivers/bingor.cpp +++ b/src/mame/drivers/bingor.cpp @@ -454,9 +454,9 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - required_shared_ptr m_blit_ram; + required_shared_ptr m_blit_ram; virtual void video_start() override; - UINT32 screen_update_bingor(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bingor(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(unk_irq); required_device m_maincpu; @@ -468,7 +468,7 @@ void bingor_state::video_start() { } -UINT32 bingor_state::screen_update_bingor(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t bingor_state::screen_update_bingor(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; @@ -480,7 +480,7 @@ UINT32 bingor_state::screen_update_bingor(screen_device &screen, bitmap_rgb32 &b { for(x=0;x<286;x+=4) { - UINT32 color; + uint32_t color; color = (m_blit_ram[count] & 0xf000)>>12; diff --git a/src/mame/drivers/bishi.cpp b/src/mame/drivers/bishi.cpp index a9de3729ea9..77feb8f19be 100644 --- a/src/mame/drivers/bishi.cpp +++ b/src/mame/drivers/bishi.cpp @@ -129,7 +129,7 @@ READ16_MEMBER(bishi_state::bishi_mirror_r) READ16_MEMBER(bishi_state::bishi_K056832_rom_r) { - UINT16 ouroffs; + uint16_t ouroffs; ouroffs = (offset >> 1) * 8; if (offset & 1) diff --git a/src/mame/drivers/bitgraph.cpp b/src/mame/drivers/bitgraph.cpp index a3806bf7718..eb992b25fa9 100644 --- a/src/mame/drivers/bitgraph.cpp +++ b/src/mame/drivers/bitgraph.cpp @@ -131,7 +131,7 @@ public: DECLARE_WRITE8_MEMBER( misccr_write ); DECLARE_WRITE_LINE_MEMBER( system_clock_write ); - 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); DECLARE_READ8_MEMBER( ppu_read ); DECLARE_WRITE8_MEMBER( ppu_write ); @@ -155,11 +155,11 @@ private: optional_device m_centronics; required_device m_screen; - UINT8 *m_videoram; - UINT8 m_misccr; - UINT8 m_pia_a; - UINT8 m_pia_b; - UINT8 m_ppu[4]; + uint8_t *m_videoram; + uint8_t m_misccr; + uint8_t m_pia_a; + uint8_t m_pia_b; + uint8_t m_ppu[4]; }; static ADDRESS_MAP_START(bitgrapha_mem, AS_PROGRAM, 16, bitgraph_state) @@ -224,7 +224,7 @@ WRITE_LINE_MEMBER(bitgraph_state::pia_cb2_w) READ8_MEMBER(bitgraph_state::pia_pa_r) { - UINT8 data = BIT(m_pia_b, 3) ? m_earom->data() : m_pia_a; + uint8_t data = BIT(m_pia_b, 3) ? m_earom->data() : m_pia_a; DBG_LOG(2,"PIA", ("A == %02X (%s)\n", data, BIT(m_pia_b, 3) ? "earom" : "pia")); return data; } @@ -346,14 +346,14 @@ WRITE8_MEMBER(bitgraph_state::adlc_w) if (m_adlc) return m_adlc->write(space, 3-offset, data); } -UINT32 bitgraph_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bitgraph_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 gfx=0; + uint8_t gfx=0; int x,y; for (y = 0; y < 768; y++) { - UINT16 *p = &bitmap.pix16(y); + uint16_t *p = &bitmap.pix16(y); for (x = 0; x < 1024/8; x+=2) { @@ -385,7 +385,7 @@ UINT32 bitgraph_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap READ8_MEMBER(bitgraph_state::ppu_read) { - UINT8 data = m_ppu[offset]; + uint8_t data = m_ppu[offset]; DBG_LOG(1,"PPU", ("%d == %02X\n", offset, data)); return data; } @@ -444,7 +444,7 @@ WRITE8_MEMBER(bitgraph_state::ppu_i8243_w) void bitgraph_state::machine_start() { - m_videoram = (UINT8 *)m_maincpu->space(AS_PROGRAM).get_write_ptr(0x3e0000); + m_videoram = (uint8_t *)m_maincpu->space(AS_PROGRAM).get_write_ptr(0x3e0000); } void bitgraph_state::machine_reset() diff --git a/src/mame/drivers/bking.cpp b/src/mame/drivers/bking.cpp index b7034cff81b..44b0adfa450 100644 --- a/src/mame/drivers/bking.cpp +++ b/src/mame/drivers/bking.cpp @@ -63,7 +63,7 @@ WRITE8_MEMBER(bking_state::bking3_addr_h_w) READ8_MEMBER(bking_state::bking3_extrarom_r) { - UINT8 *rom = memregion("user2")->base(); + uint8_t *rom = memregion("user2")->base(); return rom[m_addr_h * 256 + m_addr_l]; } diff --git a/src/mame/drivers/blackt96.cpp b/src/mame/drivers/blackt96.cpp index 4f5801ecb3a..3ba3ac8fd6b 100644 --- a/src/mame/drivers/blackt96.cpp +++ b/src/mame/drivers/blackt96.cpp @@ -79,7 +79,7 @@ public: m_sprites(*this, "sprites") { } - required_shared_ptr m_tilemapram; + required_shared_ptr m_tilemapram; DECLARE_WRITE16_MEMBER(blackt96_c0000_w); DECLARE_WRITE16_MEMBER(blackt96_80000_w); DECLARE_READ_LINE_MEMBER(PIC16C5X_T0_clk_r); @@ -96,10 +96,10 @@ public: return machine().rand(); } - UINT8 m_txt_bank; + uint8_t m_txt_bank; virtual void video_start() override; - UINT32 screen_update_blackt96(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blackt96(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -112,7 +112,7 @@ void blackt96_state::video_start() } -UINT32 blackt96_state::screen_update_blackt96(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t blackt96_state::screen_update_blackt96(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -127,7 +127,7 @@ UINT32 blackt96_state::screen_update_blackt96(screen_device &screen, bitmap_ind1 { for (y=0;y<32;y++) { - UINT16 tile = (m_tilemapram[count*2]&0xff); + uint16_t tile = (m_tilemapram[count*2]&0xff); tile += m_txt_bank * 0x100; gfx->transpen(bitmap,cliprect,tile,0,0,0,x*8,y*8,0); count++; diff --git a/src/mame/drivers/blitz.cpp b/src/mame/drivers/blitz.cpp index 6ef54c131f6..51ee39fd0fc 100644 --- a/src/mame/drivers/blitz.cpp +++ b/src/mame/drivers/blitz.cpp @@ -275,8 +275,8 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; int m_mux_data; DECLARE_WRITE8_MEMBER(megadpkr_videoram_w); @@ -288,7 +288,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(blitz); - UINT32 screen_update_megadpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_megadpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -334,7 +334,7 @@ void blitz_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(blitz_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 blitz_state::screen_update_megadpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t blitz_state::screen_update_megadpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -343,7 +343,7 @@ UINT32 blitz_state::screen_update_megadpkr(screen_device &screen, bitmap_ind16 & PALETTE_INIT_MEMBER(blitz_state, blitz) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); /* This hardware has a feature called BLUE KILLER. Using the original intensity line, the PCB has a bridge diff --git a/src/mame/drivers/blitz68k.cpp b/src/mame/drivers/blitz68k.cpp index 5eb8b53fc29..21dbd7203e4 100644 --- a/src/mame/drivers/blitz68k.cpp +++ b/src/mame/drivers/blitz68k.cpp @@ -71,19 +71,19 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - optional_shared_ptr m_nvram; - std::unique_ptr m_blit_buffer; - optional_shared_ptr m_frame_buffer; - optional_shared_ptr m_blit_romaddr; - optional_shared_ptr m_blit_attr1_ram; - optional_shared_ptr m_blit_dst_ram_loword; - optional_shared_ptr m_blit_attr2_ram; - optional_shared_ptr m_blit_dst_ram_hiword; - optional_shared_ptr m_blit_vregs; - optional_shared_ptr m_blit_transpen; - optional_shared_ptr m_leds0; - optional_shared_ptr m_leds1; - optional_shared_ptr m_leds2; + optional_shared_ptr m_nvram; + std::unique_ptr m_blit_buffer; + optional_shared_ptr m_frame_buffer; + optional_shared_ptr m_blit_romaddr; + optional_shared_ptr m_blit_attr1_ram; + optional_shared_ptr m_blit_dst_ram_loword; + optional_shared_ptr m_blit_attr2_ram; + optional_shared_ptr m_blit_dst_ram_hiword; + optional_shared_ptr m_blit_vregs; + optional_shared_ptr m_blit_transpen; + optional_shared_ptr m_leds0; + optional_shared_ptr m_leds1; + optional_shared_ptr m_leds2; DECLARE_WRITE16_MEMBER(blit_copy_w); DECLARE_READ8_MEMBER(blit_status_r); DECLARE_WRITE8_MEMBER(blit_x_w); @@ -174,8 +174,8 @@ public: DECLARE_DRIVER_INIT(dualgame); DECLARE_VIDEO_START(blitz68k); DECLARE_VIDEO_START(blitz68k_addr_factor1); - UINT32 screen_update_blitz68k(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_blitz68k_noblit(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blitz68k(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blitz68k_noblit(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(steaser_mcu_sim); MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); required_device m_maincpu; @@ -190,20 +190,20 @@ public: struct blit_t { - UINT8 x, y; - UINT8 w, h; - UINT8 addr[3]; - UINT8 pen[4]; - UINT8 flag[8]; - UINT8 flipx, flipy; - UINT8 solid; - UINT8 trans; + uint8_t x, y; + uint8_t w, h; + uint8_t addr[3]; + uint8_t pen[4]; + uint8_t flag[8]; + uint8_t flipx, flipy; + uint8_t solid; + uint8_t trans; int addr_factor; } blit; VIDEO_START_MEMBER(blitz68k_state,blitz68k) { - m_blit_buffer = std::make_unique(512*256); + m_blit_buffer = std::make_unique(512*256); blit.addr_factor = 2; } @@ -213,11 +213,11 @@ VIDEO_START_MEMBER(blitz68k_state,blitz68k_addr_factor1) blit.addr_factor = 1; } -UINT32 blitz68k_state::screen_update_blitz68k(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t blitz68k_state::screen_update_blitz68k(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; - UINT8 *src = m_blit_buffer.get(); + uint8_t *src = m_blit_buffer.get(); for(y = 0; y < 256; y++) { @@ -233,17 +233,17 @@ UINT32 blitz68k_state::screen_update_blitz68k(screen_device &screen, bitmap_rgb3 // Blitter-less board (SPI-68K) -UINT32 blitz68k_state::screen_update_blitz68k_noblit(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t blitz68k_state::screen_update_blitz68k_noblit(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; - UINT16 *src = m_frame_buffer; + uint16_t *src = m_frame_buffer; for(y = 0; y < 256; y++) { for(x = 0; x < 512; ) { - UINT16 pen = *src++; + uint16_t pen = *src++; bitmap.pix32(y, x++) = m_palette->pen((pen >> 8) & 0xf); bitmap.pix32(y, x++) = m_palette->pen((pen >> 12) & 0xf); bitmap.pix32(y, x++) = m_palette->pen((pen >> 0) & 0xf); @@ -274,11 +274,11 @@ UINT32 blitz68k_state::screen_update_blitz68k_noblit(screen_device &screen, bitm WRITE16_MEMBER(blitz68k_state::blit_copy_w) { - UINT8 *blit_rom = memregion("blitter")->base(); - UINT32 blit_dst_xpos; - UINT32 blit_dst_ypos; + uint8_t *blit_rom = memregion("blitter")->base(); + uint32_t blit_dst_xpos; + uint32_t blit_dst_ypos; int x,y,x_size,y_size; - UINT32 src; + uint32_t src; logerror("blit copy %04x %04x %04x %04x %04x\n", m_blit_romaddr[0], m_blit_attr1_ram[0], m_blit_dst_ram_loword[0], m_blit_attr2_ram[0], m_blit_dst_ram_hiword[0] ); logerror("blit vregs %04x %04x %04x %04x\n",m_blit_vregs[0/2],m_blit_vregs[2/2],m_blit_vregs[4/2],m_blit_vregs[6/2]); @@ -310,7 +310,7 @@ WRITE16_MEMBER(blitz68k_state::blit_copy_w) m_blit_buffer[drawy*512+drawx] = ((m_blit_vregs[0] & 0xf00)>>8); else { - UINT8 pen_helper; + uint8_t pen_helper; pen_helper = blit_rom[src] & 0xff; if(m_blit_transpen[0xa/2] & 0x100) //pen is opaque register @@ -462,12 +462,12 @@ WRITE8_MEMBER(blitz68k_state::blit_flags_w) WRITE8_MEMBER(blitz68k_state::blit_draw_w) { - UINT8 *blit_rom = memregion("blitter")->base(); + uint8_t *blit_rom = memregion("blitter")->base(); int blit_romsize = memregion("blitter")->bytes(); - UINT32 blit_dst_xpos; - UINT32 blit_dst_ypos; + uint32_t blit_dst_xpos; + uint32_t blit_dst_ypos; int x, y, x_size, y_size; - UINT32 src; + uint32_t src; logerror("%s: blit x=%02x y=%02x w=%02x h=%02x addr=%02x%02x%02x pens=%02x %02x %02x %02x flag=%02x %02x %02x %02x - %02x %02x %02x %02x\n", machine().describe_context(), blit.x, blit.y, blit.w, blit.h, @@ -486,7 +486,7 @@ WRITE8_MEMBER(blitz68k_state::blit_draw_w) src = (blit.addr[2] << 16) | (blit.addr[1] << 8) | blit.addr[0]; - UINT8 pen = 0; + uint8_t pen = 0; if (blit.solid) { pen = src & 0xff; @@ -664,13 +664,13 @@ ADDRESS_MAP_END // MCU simulation (to be done) READ8_MEMBER(blitz68k_state::bankrob_mcu1_r) { - UINT8 ret = 0; // machine().rand() gives "interesting" results + uint8_t ret = 0; // machine().rand() gives "interesting" results logerror("%s: mcu1 reads %02x\n", machine().describe_context(), ret); return ret; } READ8_MEMBER(blitz68k_state::bankrob_mcu2_r) { - UINT8 ret = 0; // machine().rand() gives "interesting" results + uint8_t ret = 0; // machine().rand() gives "interesting" results logerror("%s: mcu2 reads %02x\n", machine().describe_context(), ret); return ret; } @@ -750,13 +750,13 @@ ADDRESS_MAP_END // MCU simulation (to be done) READ8_MEMBER(blitz68k_state::bankroba_mcu1_r) { - UINT8 ret = machine().rand(); // machine().rand() gives "interesting" results + uint8_t ret = machine().rand(); // machine().rand() gives "interesting" results logerror("%s: mcu1 reads %02x\n", machine().describe_context(), ret); return ret; } READ8_MEMBER(blitz68k_state::bankroba_mcu2_r) { - UINT8 ret = machine().rand(); // machine().rand() gives "interesting" results + uint8_t ret = machine().rand(); // machine().rand() gives "interesting" results logerror("%s: mcu2 reads %02x\n", machine().describe_context(), ret); return ret; } @@ -912,7 +912,7 @@ WRITE16_MEMBER(blitz68k_state::crtc_lpen_w) // MCU simulation (to be done) READ16_MEMBER(blitz68k_state::cjffruit_mcu_r) { - UINT8 ret = 0x00; // machine().rand() gives "interesting" results + uint8_t ret = 0x00; // machine().rand() gives "interesting" results logerror("%s: mcu reads %02x\n", machine().describe_context(), ret); return ret << 8; } @@ -966,7 +966,7 @@ ADDRESS_MAP_END // MCU simulation (to be done) READ16_MEMBER(blitz68k_state::deucesw2_mcu_r) { - UINT8 ret = 0x00; // machine().rand() gives "interesting" results + uint8_t ret = 0x00; // machine().rand() gives "interesting" results logerror("%s: mcu reads %02x\n", machine().describe_context(), ret); return ret << 8; } @@ -1065,13 +1065,13 @@ ADDRESS_MAP_END // MCU simulation (to be done) READ8_MEMBER(blitz68k_state::dualgame_mcu1_r) { - UINT8 ret = 0; // machine().rand() gives "interesting" results + uint8_t ret = 0; // machine().rand() gives "interesting" results logerror("%s: mcu1 reads %02x\n", machine().describe_context(), ret); return ret; } READ8_MEMBER(blitz68k_state::dualgame_mcu2_r) { - UINT8 ret = 0; // machine().rand() gives "interesting" results + uint8_t ret = 0; // machine().rand() gives "interesting" results logerror("%s: mcu2 reads %02x\n", machine().describe_context(), ret); return ret; } @@ -1156,7 +1156,7 @@ ADDRESS_MAP_END // MCU simulation (to be done) READ16_MEMBER(blitz68k_state::hermit_mcu_r) { - UINT8 ret = 0x00; // machine().rand() gives "interesting" results + uint8_t ret = 0x00; // machine().rand() gives "interesting" results logerror("%s: mcu reads %02x\n", machine().describe_context(), ret); return ret << 8; } @@ -1241,13 +1241,13 @@ ADDRESS_MAP_END // MCU simulation (to be done) READ8_MEMBER(blitz68k_state::maxidbl_mcu1_r) { - UINT8 ret = 0; // machine().rand() gives "interesting" results + uint8_t ret = 0; // machine().rand() gives "interesting" results logerror("%s: mcu1 reads %02x\n", machine().describe_context(), ret); return ret; } READ8_MEMBER(blitz68k_state::maxidbl_mcu2_r) { - UINT8 ret = 0; // machine().rand() gives "interesting" results + uint8_t ret = 0; // machine().rand() gives "interesting" results logerror("%s: mcu2 reads %02x\n", machine().describe_context(), ret); return ret; } @@ -2737,7 +2737,7 @@ ROM_END DRIVER_INIT_MEMBER(blitz68k_state,bankrob) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0xb5e0/2] = 0x6028; @@ -2752,7 +2752,7 @@ DRIVER_INIT_MEMBER(blitz68k_state,bankrob) DRIVER_INIT_MEMBER(blitz68k_state,bankroba) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0x11e4e/2] = 0x6028; @@ -2767,7 +2767,7 @@ DRIVER_INIT_MEMBER(blitz68k_state,bankroba) DRIVER_INIT_MEMBER(blitz68k_state,cj3play) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0x7064/2] = 0x6028; @@ -2783,7 +2783,7 @@ DRIVER_INIT_MEMBER(blitz68k_state,cj3play) DRIVER_INIT_MEMBER(blitz68k_state,cjffruit) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0xf564/2] = 0x6028; @@ -2794,7 +2794,7 @@ DRIVER_INIT_MEMBER(blitz68k_state,cjffruit) DRIVER_INIT_MEMBER(blitz68k_state,deucesw2) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0x8fe4/2] = 0x6020; @@ -2805,7 +2805,7 @@ DRIVER_INIT_MEMBER(blitz68k_state,deucesw2) DRIVER_INIT_MEMBER(blitz68k_state,dualgame) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0xa518/2] = 0x6024; @@ -2816,7 +2816,7 @@ DRIVER_INIT_MEMBER(blitz68k_state,dualgame) DRIVER_INIT_MEMBER(blitz68k_state,hermit) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0xdeba/2] = 0x602e; @@ -2833,7 +2833,7 @@ DRIVER_INIT_MEMBER(blitz68k_state,hermit) DRIVER_INIT_MEMBER(blitz68k_state,maxidbl) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0xb384/2] = 0x6036; @@ -2844,7 +2844,7 @@ DRIVER_INIT_MEMBER(blitz68k_state,maxidbl) DRIVER_INIT_MEMBER(blitz68k_state,megadblj) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0xe21c/2] = 0x6040; @@ -2855,7 +2855,7 @@ DRIVER_INIT_MEMBER(blitz68k_state,megadblj) DRIVER_INIT_MEMBER(blitz68k_state,megadble) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); // WRONG C8 #1 ROM[0xcfc2/2] = 0x4e71; diff --git a/src/mame/drivers/blktiger.cpp b/src/mame/drivers/blktiger.cpp index 7cd5d86a6eb..0b18489b55a 100644 --- a/src/mame/drivers/blktiger.cpp +++ b/src/mame/drivers/blktiger.cpp @@ -597,9 +597,9 @@ ROM_END DRIVER_INIT_MEMBER(blktiger_state,blktigerb3) { - UINT8 *src = memregion("audiocpu")->base(); + uint8_t *src = memregion("audiocpu")->base(); int len = 0x8000; - std::vector buffer(len); + std::vector buffer(len); for (int i = 0; i < len; i++) { diff --git a/src/mame/drivers/blmbycar.cpp b/src/mame/drivers/blmbycar.cpp index a23016b3b04..646e610c8f9 100644 --- a/src/mame/drivers/blmbycar.cpp +++ b/src/mame/drivers/blmbycar.cpp @@ -490,13 +490,13 @@ ROM_END DRIVER_INIT_MEMBER(blmbycar_state,blmbycar) { - UINT16 *RAM = (UINT16 *) memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *) memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes() / 2; int i; for (i = 0; i < size; i++) { - UINT16 x = RAM[i]; + uint16_t x = RAM[i]; x = (x & ~0x0606) | ((x & 0x0202) << 1) | ((x & 0x0404) >> 1); RAM[i] = x; } diff --git a/src/mame/drivers/blockade.cpp b/src/mame/drivers/blockade.cpp index cba736f6139..0770cfbf0a0 100644 --- a/src/mame/drivers/blockade.cpp +++ b/src/mame/drivers/blockade.cpp @@ -80,7 +80,7 @@ INTERRUPT_GEN_MEMBER(blockade_state::blockade_interrupt) READ8_MEMBER(blockade_state::blockade_input_port_0_r) { /* coin latch is bit 7 */ - UINT8 temp = (ioport("IN0")->read() & 0x7f); + uint8_t temp = (ioport("IN0")->read() & 0x7f); return (m_coin_latch << 7) | temp; } diff --git a/src/mame/drivers/blockhl.cpp b/src/mame/drivers/blockhl.cpp index afee149859d..f1a77468574 100644 --- a/src/mame/drivers/blockhl.cpp +++ b/src/mame/drivers/blockhl.cpp @@ -47,7 +47,7 @@ public: K052109_CB_MEMBER(tile_callback); K051960_CB_MEMBER(sprite_callback); - UINT32 screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(k052109_051960_r); DECLARE_WRITE8_MEMBER(k052109_051960_w); @@ -122,7 +122,7 @@ K051960_CB_MEMBER( blockhl_state::sprite_callback ) *color = sprite_colorbase + (*color & 0x0f); } -UINT32 blockhl_state::screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t blockhl_state::screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); diff --git a/src/mame/drivers/bmcbowl.cpp b/src/mame/drivers/bmcbowl.cpp index 91f1cb102b7..ee4c551d5ff 100644 --- a/src/mame/drivers/bmcbowl.cpp +++ b/src/mame/drivers/bmcbowl.cpp @@ -125,9 +125,9 @@ public: m_palette(*this, "palette") { } required_device m_maincpu; - optional_shared_ptr m_stats_ram; - required_shared_ptr m_vid1; - required_shared_ptr m_vid2; + optional_shared_ptr m_stats_ram; + required_shared_ptr m_vid1; + required_shared_ptr m_vid2; required_device m_palette; int m_bmc_input; DECLARE_READ16_MEMBER(bmc_random_read); @@ -142,8 +142,8 @@ public: DECLARE_DRIVER_INIT(bmcbowl); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_bmcbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void init_stats(const UINT8 *table, int table_len, int address); + uint32_t screen_update_bmcbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void init_stats(const uint8_t *table, int table_len, int address); }; @@ -153,7 +153,7 @@ void bmcbowl_state::video_start() { } -UINT32 bmcbowl_state::screen_update_bmcbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bmcbowl_state::screen_update_bmcbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* 280x230,4 bitmap layers, 8bpp, @@ -254,7 +254,7 @@ WRITE_LINE_MEMBER(bmcbowl_state::via_ca2_out) // 'working' NVRAM #ifdef NVRAM_HACK -static const UINT8 bmc_nv1[]= +static const uint8_t bmc_nv1[]= { 0x00,0x00,0x55,0x55,0x00,0x00,0x55,0x55,0x00,0x00,0x55,0x55,0x00,0x00,0x55,0x55,0x13,0x88,0x46,0xDD,0x0F,0xA0, 0x5A,0xF5,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x6E,0x55, @@ -275,20 +275,20 @@ static const UINT8 bmc_nv1[]= 0x00,0x00,0xDC,0x00,0xFF,0xFF,0xFF,0xFF }; -static const UINT8 bmc_nv2[]= +static const uint8_t bmc_nv2[]= { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0x00,0x09,0x00,0x00,0x2B,0xF1, 0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF }; -static const UINT8 bmc_nv3[]= +static const uint8_t bmc_nv3[]= { 0xFA,0xFF,0x01,0x02,0x04,0x0A,0x1E,0xC8,0x02,0x01,0xFF,0xFF,0xFF,0xFF,0xFF }; -void bmcbowl_state::init_stats(const UINT8 *table, int table_len, int address) +void bmcbowl_state::init_stats(const uint8_t *table, int table_len, int address) { for (int i = 0; i < table_len; i++) m_stats_ram[address+2*i]=table[i]; diff --git a/src/mame/drivers/bmcpokr.cpp b/src/mame/drivers/bmcpokr.cpp index 9720106e955..eb60d4c4875 100644 --- a/src/mame/drivers/bmcpokr.cpp +++ b/src/mame/drivers/bmcpokr.cpp @@ -45,25 +45,25 @@ public: // Devices required_device m_maincpu; required_device m_hopper; - required_shared_ptr m_videoram_1; - required_shared_ptr m_videoram_2; - required_shared_ptr m_scrollram_1; - required_shared_ptr m_scrollram_2; - required_shared_ptr m_scrollram_3; - required_shared_ptr m_pixram; - required_shared_ptr m_priority; - required_shared_ptr m_layerctrl; + required_shared_ptr m_videoram_1; + required_shared_ptr m_videoram_2; + required_shared_ptr m_scrollram_1; + required_shared_ptr m_scrollram_2; + required_shared_ptr m_scrollram_3; + required_shared_ptr m_pixram; + required_shared_ptr m_priority; + required_shared_ptr m_layerctrl; required_device m_gfxdecode; required_device m_palette; // Protection - UINT16 m_prot_val; + uint16_t m_prot_val; DECLARE_READ16_MEMBER(prot_r); DECLARE_WRITE16_MEMBER(prot_w); DECLARE_READ16_MEMBER(unk_r); // I/O - UINT16 m_mux; + uint16_t m_mux; DECLARE_WRITE16_MEMBER(mux_w); DECLARE_READ16_MEMBER(dsw_r); DECLARE_CUSTOM_INPUT_MEMBER(hopper_r); @@ -71,7 +71,7 @@ public: DECLARE_READ16_MEMBER(mjmaglmp_key_r); // Interrrupts - UINT16 m_irq_enable; + uint16_t m_irq_enable; DECLARE_WRITE16_MEMBER(irq_enable_w); DECLARE_WRITE16_MEMBER(irq_ack_w); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); @@ -86,13 +86,13 @@ public: std::unique_ptr m_pixbitmap; void pixbitmap_redraw(); - UINT16 m_pixpal; + uint16_t m_pixpal; DECLARE_WRITE16_MEMBER(pixram_w); DECLARE_WRITE16_MEMBER(pixpal_w); virtual void video_start() override; void draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer); - UINT32 screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void save_state() { @@ -124,13 +124,13 @@ WRITE16_MEMBER(bmcpokr_state::videoram_2_w) TILE_GET_INFO_MEMBER(bmcpokr_state::get_t1_tile_info) { - UINT16 data = m_videoram_1[tile_index]; + uint16_t data = m_videoram_1[tile_index]; SET_TILE_INFO_MEMBER(0, data, 0, (data & 0x8000) ? TILE_FLIPX : 0); } TILE_GET_INFO_MEMBER(bmcpokr_state::get_t2_tile_info) { - UINT16 data = m_videoram_2[tile_index]; + uint16_t data = m_videoram_2[tile_index]; SET_TILE_INFO_MEMBER(0, data, 0, (data & 0x8000) ? TILE_FLIPX : 0); } @@ -162,9 +162,9 @@ WRITE16_MEMBER(bmcpokr_state::pixram_w) int x = (offset & 0xff) << 2; int y = (offset >> 8); - UINT16 pixpal = (m_pixpal & 0xf) * 0x10; + uint16_t pixpal = (m_pixpal & 0xf) * 0x10; - UINT16 pen; + uint16_t pen; if (ACCESSING_BITS_8_15) { pen = (data >> 12) & 0xf; m_pixbitmap->pix16(y, x + 0) = pen ? pixpal + pen : 0; @@ -179,14 +179,14 @@ WRITE16_MEMBER(bmcpokr_state::pixram_w) void bmcpokr_state::pixbitmap_redraw() { - UINT16 pixpal = (m_pixpal & 0xf) * 0x10; + uint16_t pixpal = (m_pixpal & 0xf) * 0x10; int offset = 0; for (int y = 0; y < 512; y++) { for (int x = 0; x < 1024; x += 4) { - UINT16 data = m_pixram[offset++]; - UINT16 pen; + uint16_t data = m_pixram[offset++]; + uint16_t pen; pen = (data >> 12) & 0xf; m_pixbitmap->pix16(y, x + 0) = pen ? pixpal + pen : 0; pen = (data >> 8) & 0xf; m_pixbitmap->pix16(y, x + 1) = pen ? pixpal + pen : 0; pen = (data >> 4) & 0xf; m_pixbitmap->pix16(y, x + 2) = pen ? pixpal + pen : 0; @@ -197,7 +197,7 @@ void bmcpokr_state::pixbitmap_redraw() WRITE16_MEMBER(bmcpokr_state::pixpal_w) { - UINT16 old = m_pixpal; + uint16_t old = m_pixpal; if (old != COMBINE_DATA(&m_pixpal)) pixbitmap_redraw(); } @@ -207,8 +207,8 @@ WRITE16_MEMBER(bmcpokr_state::pixpal_w) void bmcpokr_state::draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer) { tilemap_t *tmap; - UINT16 *scroll; - UINT16 ctrl; + uint16_t *scroll; + uint16_t ctrl; switch (layer) { @@ -255,7 +255,7 @@ void bmcpokr_state::draw_layer(screen_device &screen, bitmap_ind16 &bitmap, cons } } -UINT32 bmcpokr_state::screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bmcpokr_state::screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; @@ -432,7 +432,7 @@ READ16_MEMBER(bmcpokr_state::mjmaglmp_dsw_r) READ16_MEMBER(bmcpokr_state::mjmaglmp_key_r) { - UINT16 key = 0x3f; + uint16_t key = 0x3f; switch ((m_mux >> 4) & 7) { case 0: key = ioport("KEY1")->read(); break; diff --git a/src/mame/drivers/bmjr.cpp b/src/mame/drivers/bmjr.cpp index cf198f4e7a5..5699fdcb80c 100644 --- a/src/mame/drivers/bmjr.cpp +++ b/src/mame/drivers/bmjr.cpp @@ -45,15 +45,15 @@ public: DECLARE_READ8_MEMBER(tape_start_r); DECLARE_WRITE8_MEMBER(xor_display_w); bool m_tape_switch; - required_shared_ptr m_p_wram; - UINT8 *m_p_chargen; - UINT8 m_xor_display; - UINT8 m_key_mux; + required_shared_ptr m_p_wram; + uint8_t *m_p_chargen; + uint8_t m_xor_display; + uint8_t m_key_mux; DECLARE_DRIVER_INIT(bmjr); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_bmjr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bmjr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -63,17 +63,17 @@ void bmjr_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 bmjr_state::screen_update_bmjr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bmjr_state::screen_update_bmjr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx,fg=4; - UINT16 sy=0,ma=0x100,x; - UINT8 inv = (m_xor_display) ? 0xff : 0; + uint8_t y,ra,chr,gfx,fg=4; + uint16_t sy=0,ma=0x100,x; + uint8_t inv = (m_xor_display) ? 0xff : 0; for(y = 0; y < 24; y++ ) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 32; x++) { diff --git a/src/mame/drivers/bml3.cpp b/src/mame/drivers/bml3.cpp index 26cba28ea3c..319b81f45bb 100644 --- a/src/mame/drivers/bml3.cpp +++ b/src/mame/drivers/bml3.cpp @@ -114,10 +114,10 @@ public: MC6845_UPDATE_ROW(crtc_update_row); - UINT8 *m_p_videoram; - UINT8 *m_p_chargen; - UINT8 m_hres_reg; - UINT8 m_crtc_vreg[0x100]; + uint8_t *m_p_videoram; + uint8_t *m_p_chargen; + uint8_t m_hres_reg; + uint8_t m_crtc_vreg[0x100]; // INTERRUPT_GEN_MEMBER(bml3_irq); INTERRUPT_GEN_MEMBER(bml3_timer_firq); TIMER_DEVICE_CALLBACK_MEMBER(bml3_c); @@ -127,27 +127,27 @@ public: DECLARE_WRITE8_MEMBER(bml3_ym2203_w); private: - UINT8 m_psg_latch; - UINT8 m_attr_latch; - UINT8 m_vres_reg; + uint8_t m_psg_latch; + uint8_t m_attr_latch; + uint8_t m_vres_reg; bool m_keyb_interrupt_disabled; bool m_keyb_nmi_disabled; // not used yet bool m_keyb_counter_operation_disabled; - UINT8 m_keyb_empty_scan; - UINT8 m_keyb_scancode; + uint8_t m_keyb_empty_scan; + uint8_t m_keyb_scancode; bool m_keyb_capslock_led_on; bool m_keyb_hiragana_led_on; bool m_keyb_katakana_led_on; bool m_cassbit; bool m_cassold; - UINT8 m_cass_data[4]; + uint8_t m_cass_data[4]; virtual void machine_reset() override; virtual void machine_start() override; - void m6845_change_clock(UINT8 setting); - UINT8 m_crtc_index; - std::unique_ptr m_extram; - UINT8 m_firq_mask; - UINT8 m_firq_status; + void m6845_change_clock(uint8_t setting); + uint8_t m_crtc_index; + std::unique_ptr m_extram; + uint8_t m_firq_mask; + uint8_t m_firq_status; required_device m_maincpu; required_device m_bml3bus; required_device m_crtc; @@ -202,7 +202,7 @@ WRITE8_MEMBER( bml3_state::bml3_6845_w ) READ8_MEMBER( bml3_state::bml3_keyboard_r ) { - UINT8 ret = m_keyb_scancode; + uint8_t ret = m_keyb_scancode; m_keyb_scancode &= 0x7f; return ret; } @@ -217,7 +217,7 @@ WRITE8_MEMBER( bml3_state::bml3_keyboard_w ) m_keyb_nmi_disabled = !BIT(data, 7); } -void bml3_state::m6845_change_clock(UINT8 setting) +void bml3_state::m6845_change_clock(uint8_t setting) { int m6845_clock = CPU_CLOCK; // CRTC and MPU are synchronous by default @@ -289,14 +289,14 @@ WRITE8_MEMBER( bml3_state::bml3_psg_latch_w) READ8_MEMBER(bml3_state::bml3_ym2203_r) { - UINT8 dev_offs = ((m_psg_latch & 3) != 3); + uint8_t dev_offs = ((m_psg_latch & 3) != 3); return m_ym2203->read(space, dev_offs); } WRITE8_MEMBER(bml3_state::bml3_ym2203_w) { - UINT8 dev_offs = ((m_psg_latch & 3) != 3); + uint8_t dev_offs = ((m_psg_latch & 3) != 3); m_ym2203->write(space, dev_offs, data); } @@ -366,7 +366,7 @@ WRITE8_MEMBER( bml3_state::bml3_firq_mask_w) READ8_MEMBER( bml3_state::bml3_firq_status_r ) { - UINT8 res = m_firq_status << 7; + uint8_t res = m_firq_status << 7; m_firq_status = 0; m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE); return res; @@ -601,9 +601,9 @@ MC6845_UPDATE_ROW( bml3_state::crtc_update_row ) // 3: reverse/inverse video // 4: graphic (not character) - UINT8 x=0,hf=0,xi=0,interlace=0,bgcolor=0,rawbits=0,dots[2],color=0,pen=0; + uint8_t x=0,hf=0,xi=0,interlace=0,bgcolor=0,rawbits=0,dots[2],color=0,pen=0; bool reverse=0,graphic=0,lowres=0; - UINT16 mem=0; + uint16_t mem=0; interlace = (m_crtc_vreg[8] & 3) ? 1 : 0; lowres = BIT(m_hres_reg, 6); @@ -733,7 +733,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( bml3_state::bml3_p ) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -762,7 +762,7 @@ INTERRUPT_GEN_MEMBER(bml3_state::bml3_timer_firq) void bml3_state::machine_start() { - m_extram = std::make_unique(0x10000); + m_extram = std::make_unique(0x10000); m_p_chargen = memregion("chargen")->base(); m_p_videoram = memregion("vram")->base(); m_psg_latch = 0; diff --git a/src/mame/drivers/bnstars.cpp b/src/mame/drivers/bnstars.cpp index ed01ca3fd5a..293a1d147c6 100644 --- a/src/mame/drivers/bnstars.cpp +++ b/src/mame/drivers/bnstars.cpp @@ -120,23 +120,23 @@ public: tilemap_t *m_ms32_tx_tilemap[2]; tilemap_t *m_ms32_bg_tilemap[2]; tilemap_t *m_ms32_roz_tilemap[2]; - required_shared_ptr m_ms32_tx0_ram; - required_shared_ptr m_ms32_tx1_ram; - required_shared_ptr m_ms32_bg0_ram; - required_shared_ptr m_ms32_bg1_ram; - required_shared_ptr m_ms32_roz0_ram; - required_shared_ptr m_ms32_roz1_ram; - required_shared_ptr_array m_ms32_roz_ctrl; - required_shared_ptr m_ms32_spram; - required_shared_ptr m_ms32_tx0_scroll; - required_shared_ptr m_ms32_bg0_scroll; - required_shared_ptr m_ms32_tx1_scroll; - required_shared_ptr m_ms32_bg1_scroll; + required_shared_ptr m_ms32_tx0_ram; + required_shared_ptr m_ms32_tx1_ram; + required_shared_ptr m_ms32_bg0_ram; + required_shared_ptr m_ms32_bg1_ram; + required_shared_ptr m_ms32_roz0_ram; + required_shared_ptr m_ms32_roz1_ram; + required_shared_ptr_array m_ms32_roz_ctrl; + required_shared_ptr m_ms32_spram; + required_shared_ptr m_ms32_tx0_scroll; + required_shared_ptr m_ms32_bg0_scroll; + required_shared_ptr m_ms32_tx1_scroll; + required_shared_ptr m_ms32_bg1_scroll; required_ioport_array<4> m_p1_keys; required_ioport_array<4> m_p2_keys; - UINT32 m_bnstars1_mahjong_select; + uint32_t m_bnstars1_mahjong_select; DECLARE_WRITE32_MEMBER(ms32_tx0_ram_w); DECLARE_WRITE32_MEMBER(ms32_tx1_ram_w); DECLARE_WRITE32_MEMBER(ms32_bg0_ram_w); @@ -154,10 +154,10 @@ public: TILE_GET_INFO_MEMBER(get_ms32_roz1_tile_info); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_bnstars_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bnstars_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bnstars_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bnstars_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int chip); - void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 *sprram_top, size_t sprram_size); + void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t *sprram_top, size_t sprram_size); }; @@ -250,7 +250,7 @@ void bnstars_state::draw_roz(screen_device &screen, bitmap_ind16 &bitmap, const while (y <= maxy) { - UINT32 *lineaddr = ms32_lineram + 8 * (y & 0xff); + uint32_t *lineaddr = ms32_lineram + 8 * (y & 0xff); int start2x = (lineaddr[0x00/4] & 0xffff) | ((lineaddr[0x04/4] & 3) << 16); int start2y = (lineaddr[0x08/4] & 0xffff) | ((lineaddr[0x0c/4] & 3) << 16); @@ -349,7 +349,7 @@ WRITE32_MEMBER(bnstars_state::ms32_roz1_ram_w) /* SPRITES based on tetrisp2 for now, readd priority bits later */ -void bnstars_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 *sprram_top, size_t sprram_size) +void bnstars_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t *sprram_top, size_t sprram_size) { /*************************************************************************** @@ -393,8 +393,8 @@ void bnstars_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co int code, attr, color, size, pri, pri_mask; gfx_element *gfx = m_gfxdecode->gfx(0); - UINT32 *source = sprram_top; - const UINT32 *finish = sprram_top + (sprram_size - 0x10) / 4; + uint32_t *source = sprram_top; + const uint32_t *finish = sprram_top + (sprram_size - 0x10) / 4; if (m_reverse_sprite_order == 1) @@ -499,7 +499,7 @@ void bnstars_state::video_start() -UINT32 bnstars_state::screen_update_bnstars_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bnstars_state::screen_update_bnstars_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); @@ -522,7 +522,7 @@ UINT32 bnstars_state::screen_update_bnstars_left(screen_device &screen, bitmap_i return 0; } -UINT32 bnstars_state::screen_update_bnstars_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bnstars_state::screen_update_bnstars_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen.priority().fill(0, cliprect); diff --git a/src/mame/drivers/bntyhunt.cpp b/src/mame/drivers/bntyhunt.cpp index 3d66dcb77c5..1bddbd854eb 100644 --- a/src/mame/drivers/bntyhunt.cpp +++ b/src/mame/drivers/bntyhunt.cpp @@ -19,7 +19,7 @@ public: m_maincpu(*this, "maincpu") { } - 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: @@ -35,7 +35,7 @@ void bntyhunt_state::video_start() { } -UINT32 bntyhunt_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bntyhunt_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/bob85.cpp b/src/mame/drivers/bob85.cpp index d0c1eb88965..0b519fb1cba 100644 --- a/src/mame/drivers/bob85.cpp +++ b/src/mame/drivers/bob85.cpp @@ -44,8 +44,8 @@ public: DECLARE_WRITE8_MEMBER(bob85_7seg_w); DECLARE_WRITE_LINE_MEMBER(sod_w); DECLARE_READ_LINE_MEMBER(sid_r); - UINT8 m_prev_key; - UINT8 m_count_key; + uint8_t m_prev_key; + uint8_t m_count_key; virtual void machine_reset() override; protected: @@ -58,10 +58,10 @@ protected: READ8_MEMBER(bob85_state::bob85_keyboard_r) { - UINT8 retVal = 0; - UINT8 line0 = m_line0->read(); - UINT8 line1 = m_line1->read(); - UINT8 line2 = m_line2->read(); + uint8_t retVal = 0; + uint8_t line0 = m_line0->read(); + uint8_t line1 = m_line1->read(); + uint8_t line2 = m_line2->read(); if (line0) { diff --git a/src/mame/drivers/boogwing.cpp b/src/mame/drivers/boogwing.cpp index 6b5eb02f7f1..9c7d3843621 100644 --- a/src/mame/drivers/boogwing.cpp +++ b/src/mame/drivers/boogwing.cpp @@ -94,8 +94,8 @@ READ16_MEMBER( boogwing_state::boogwing_protection_region_0_104_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco104->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco104->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -103,7 +103,7 @@ WRITE16_MEMBER( boogwing_state::boogwing_protection_region_0_104_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco104->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -632,14 +632,14 @@ ROM_END DRIVER_INIT_MEMBER(boogwing_state,boogwing) { - const UINT8* src = memregion("gfx6")->base(); - UINT8* dst = memregion("tiles2")->base() + 0x200000; + const uint8_t* src = memregion("gfx6")->base(); + uint8_t* dst = memregion("tiles2")->base() + 0x200000; deco56_decrypt_gfx(machine(), "tiles1"); deco56_decrypt_gfx(machine(), "tiles2"); deco56_decrypt_gfx(machine(), "tiles3"); deco56_remap_gfx(machine(), "gfx6"); - deco102_decrypt_cpu((UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x100000, 0x42ba, 0x00, 0x18); + deco102_decrypt_cpu((uint16_t *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x100000, 0x42ba, 0x00, 0x18); memcpy(dst, src, 0x100000); } diff --git a/src/mame/drivers/bottom9.cpp b/src/mame/drivers/bottom9.cpp index e82ae67dca4..f0a45d49d1e 100644 --- a/src/mame/drivers/bottom9.cpp +++ b/src/mame/drivers/bottom9.cpp @@ -277,7 +277,7 @@ WRITE8_MEMBER(bottom9_state::volume_callback1) void bottom9_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x2000); diff --git a/src/mame/drivers/bowltry.cpp b/src/mame/drivers/bowltry.cpp index 73e4b83a055..742463a4f2d 100644 --- a/src/mame/drivers/bowltry.cpp +++ b/src/mame/drivers/bowltry.cpp @@ -41,14 +41,14 @@ public: m_maincpu(*this, "maincpu") { } - UINT32 screen_update_bowltry(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bowltry(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); int m_test_x; int m_test_y; int m_start_offs; #if HACK_ENABLED DECLARE_READ16_MEMBER(hack_r); DECLARE_WRITE16_MEMBER(hack_w); - UINT16 m_hack[2]; + uint16_t m_hack[2]; #endif protected: @@ -86,7 +86,7 @@ ADDRESS_MAP_END static INPUT_PORTS_START( bowltry ) INPUT_PORTS_END -UINT32 bowltry_state::screen_update_bowltry(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t bowltry_state::screen_update_bowltry(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/boxer.cpp b/src/mame/drivers/boxer.cpp index 2dde29fe8e3..ec8cb050a4c 100644 --- a/src/mame/drivers/boxer.cpp +++ b/src/mame/drivers/boxer.cpp @@ -41,12 +41,12 @@ public: m_palette(*this, "palette"){ } /* memory pointers */ - required_shared_ptr m_tile_ram; - required_shared_ptr m_sprite_ram; + required_shared_ptr m_tile_ram; + required_shared_ptr m_sprite_ram; /* misc */ - UINT8 m_pot_state; - UINT8 m_pot_latch; + uint8_t m_pot_state; + uint8_t m_pot_latch; /* devices */ required_device m_maincpu; @@ -65,7 +65,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(boxer); - UINT32 screen_update_boxer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_boxer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(pot_interrupt); TIMER_CALLBACK_MEMBER(periodic_callback); void draw_boxer( bitmap_ind16 &bitmap, const rectangle &cliprect ); @@ -114,7 +114,7 @@ TIMER_CALLBACK_MEMBER(boxer_state::periodic_callback) if (scanline == 0) { - UINT8 mask[256]; + uint8_t mask[256]; int i; @@ -164,7 +164,7 @@ void boxer_state::draw_boxer( bitmap_ind16 &bitmap, const rectangle &cliprect ) for (n = 0; n < 2; n++) { - const UINT8* p = memregion(n == 0 ? "user1" : "user2")->base(); + const uint8_t* p = memregion(n == 0 ? "user1" : "user2")->base(); int i, j; @@ -178,7 +178,7 @@ void boxer_state::draw_boxer( bitmap_ind16 &bitmap, const rectangle &cliprect ) { for (j = 0; j < 4; j++) { - UINT8 code; + uint8_t code; code = p[32 * l + 4 * i + j]; @@ -205,7 +205,7 @@ void boxer_state::draw_boxer( bitmap_ind16 &bitmap, const rectangle &cliprect ) } -UINT32 boxer_state::screen_update_boxer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t boxer_state::screen_update_boxer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, j; @@ -215,7 +215,7 @@ UINT32 boxer_state::screen_update_boxer(screen_device &screen, bitmap_ind16 &bit { for (j = 0; j < 32; j++) { - UINT8 code = m_tile_ram[32 * i + j]; + uint8_t code = m_tile_ram[32 * i + j]; m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, @@ -240,7 +240,7 @@ UINT32 boxer_state::screen_update_boxer(screen_device &screen, bitmap_ind16 &bit READ8_MEMBER(boxer_state::boxer_input_r) { - UINT8 val = ioport("IN0")->read(); + uint8_t val = ioport("IN0")->read(); if (ioport("IN3")->read() < m_screen->vpos()) val |= 0x02; @@ -251,7 +251,7 @@ READ8_MEMBER(boxer_state::boxer_input_r) READ8_MEMBER(boxer_state::boxer_misc_r) { - UINT8 val = 0; + uint8_t val = 0; switch (offset & 3) { diff --git a/src/mame/drivers/br8641.cpp b/src/mame/drivers/br8641.cpp index 6dcde233d1e..81ef7be0161 100644 --- a/src/mame/drivers/br8641.cpp +++ b/src/mame/drivers/br8641.cpp @@ -48,8 +48,8 @@ public: DECLARE_WRITE8_MEMBER(port09_w); private: - UINT8 m_port08; - UINT8 m_port09; + uint8_t m_port08; + uint8_t m_port09; required_device m_maincpu; required_device m_pio1; required_device m_pio2; @@ -121,7 +121,7 @@ INPUT_PORTS_END READ8_MEMBER( brandt8641_state::port08_r ) { - UINT8 i, data = 7; + uint8_t i, data = 7; for (i = 0; i < 8; i++) if (BIT(m_port09, i)) diff --git a/src/mame/drivers/brkthru.cpp b/src/mame/drivers/brkthru.cpp index 277cbbe080b..11fb1213db2 100644 --- a/src/mame/drivers/brkthru.cpp +++ b/src/mame/drivers/brkthru.cpp @@ -641,7 +641,7 @@ ROM_END DRIVER_INIT_MEMBER(brkthru_state,brkthru) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000); } diff --git a/src/mame/drivers/btime.cpp b/src/mame/drivers/btime.cpp index 5eff7e45d65..8ef4113c171 100644 --- a/src/mame/drivers/btime.cpp +++ b/src/mame/drivers/btime.cpp @@ -1975,7 +1975,7 @@ ROM_END READ8_MEMBER(btime_state::wtennis_reset_hack_r) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); /* Otherwise the game goes into test mode and there is no way out that I can see. I'm not sure how it can work, it probably somehow has to do @@ -1993,7 +1993,7 @@ DRIVER_INIT_MEMBER(btime_state,btime) DRIVER_INIT_MEMBER(btime_state,zoar) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* At location 0xD50A is what looks like an undocumented opcode. I tried implementing it given what opcode 0x23 should do, but it still didn't @@ -2006,7 +2006,7 @@ DRIVER_INIT_MEMBER(btime_state,zoar) DRIVER_INIT_MEMBER(btime_state,tisland) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* At location 0xa2b6 there's a strange RLA followed by a BPL that reads from an unmapped area that causes the game to fail in several circumstances.On the Cassette diff --git a/src/mame/drivers/bublbobl.cpp b/src/mame/drivers/bublbobl.cpp index 55641655f95..22581d739ab 100644 --- a/src/mame/drivers/bublbobl.cpp +++ b/src/mame/drivers/bublbobl.cpp @@ -1831,7 +1831,7 @@ ROM_END void bublbobl_state::configure_banks( ) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); } @@ -1863,7 +1863,7 @@ DRIVER_INIT_MEMBER(bublbobl_state,dland) { // rearrange gfx to original format int i; - UINT8* src = memregion("gfx1")->base(); + uint8_t* src = memregion("gfx1")->base(); for (i = 0; i < 0x40000; i++) src[i] = BITSWAP8(src[i],7,6,5,4,0,1,2,3); diff --git a/src/mame/drivers/buggychl.cpp b/src/mame/drivers/buggychl.cpp index ebd6a873176..1ee00ce3b4e 100644 --- a/src/mame/drivers/buggychl.cpp +++ b/src/mame/drivers/buggychl.cpp @@ -330,7 +330,7 @@ WRITE8_MEMBER(buggychl_state::port_b_1_w) void buggychl_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x2000); diff --git a/src/mame/drivers/bullet.cpp b/src/mame/drivers/bullet.cpp index 186f19043b5..8613727569c 100644 --- a/src/mame/drivers/bullet.cpp +++ b/src/mame/drivers/bullet.cpp @@ -103,7 +103,7 @@ enum READ8_MEMBER( bullet_state::mreq_r ) { - UINT8 data = 0; + uint8_t data = 0; if (!m_brom && !BIT(offset, 5)) { @@ -329,7 +329,7 @@ READ8_MEMBER( bullet_state::info_r ) */ - UINT8 data = 0; + uint8_t data = 0; // DIP switches data |= m_sw1->read() & 0x0f; @@ -360,7 +360,7 @@ WRITE8_MEMBER( bullet_state::segst_w ) READ8_MEMBER( bulletf_state::mreq_r ) { - UINT8 data = 0; + uint8_t data = 0; if (!m_rome && !BIT(offset, 5)) { @@ -531,7 +531,7 @@ WRITE8_MEMBER( bulletf_state::mbank_w ) READ8_MEMBER( bulletf_state::scsi_r ) { - UINT8 data = m_scsi_data_in->read(); + uint8_t data = m_scsi_data_in->read(); m_scsibus->write_ack(1); @@ -577,7 +577,7 @@ READ8_MEMBER( bulletf_state::hwsts_r ) */ - UINT8 data = 0; + uint8_t data = 0; // centronics busy data |= m_centronics_busy; @@ -788,7 +788,7 @@ void bullet_state::update_dma_rdy() READ8_MEMBER( bullet_state::dma_mreq_r ) { - UINT8 data = m_ram->pointer()[(m_buf << 16) | offset]; + uint8_t data = m_ram->pointer()[(m_buf << 16) | offset]; if (BIT(m_exdma, 4)) { @@ -889,7 +889,7 @@ READ8_MEMBER( bullet_state::pio_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // centronics data |= m_centronics_busy; @@ -1050,7 +1050,7 @@ void bullet_state::machine_reset() m_exdsk_sw = false; m_hdcon_sw = false; - UINT8 sw1 = m_sw1->read(); + uint8_t sw1 = m_sw1->read(); int mini = BIT(sw1, 6); m_fdc->set_unscaled_clock(mini ? XTAL_16MHz/16 : XTAL_16MHz/8); m_fdc->dden_w(BIT(sw1, 7)); diff --git a/src/mame/drivers/busicom.cpp b/src/mame/drivers/busicom.cpp index adcb77be331..5303328c792 100644 --- a/src/mame/drivers/busicom.cpp +++ b/src/mame/drivers/busicom.cpp @@ -13,7 +13,7 @@ #include "includes/busicom.h" -UINT8 busicom_state::get_bit_selected(UINT32 val,int num) +uint8_t busicom_state::get_bit_selected(uint32_t val,int num) { int i; for(i=0;iread() & 1 ? 8 : 0; return retVal; @@ -86,9 +86,9 @@ WRITE8_MEMBER(busicom_state::printer_w) WRITE8_MEMBER(busicom_state::status_w) { #if 0 - UINT8 mem_lamp = BIT(data,0); - UINT8 over_lamp = BIT(data,1); - UINT8 minus_lamp = BIT(data,2); + uint8_t mem_lamp = BIT(data,0); + uint8_t over_lamp = BIT(data,1); + uint8_t minus_lamp = BIT(data,2); #endif //logerror("status %c %c %c\n",mem_lamp ? 'M':'x',over_lamp ? 'O':'x',minus_lamp ? '-':'x'); } diff --git a/src/mame/drivers/buster.cpp b/src/mame/drivers/buster.cpp index f08a32eeb0a..75823f90d39 100644 --- a/src/mame/drivers/buster.cpp +++ b/src/mame/drivers/buster.cpp @@ -24,9 +24,9 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_vram; + required_shared_ptr m_vram; virtual void video_start() override; - UINT32 screen_update_buster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_buster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -37,7 +37,7 @@ void buster_state::video_start() { } -UINT32 buster_state::screen_update_buster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t buster_state::screen_update_buster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int count = 0x0000; diff --git a/src/mame/drivers/bw12.cpp b/src/mame/drivers/bw12.cpp index 7a0328ad0a9..c61ce09e17a 100644 --- a/src/mame/drivers/bw12.cpp +++ b/src/mame/drivers/bw12.cpp @@ -336,9 +336,9 @@ MC6845_UPDATE_ROW( bw12_state::crtc_update_row ) for (column = 0; column < x_count; column++) { - UINT8 code = m_video_ram[((ma + column) & BW12_VIDEORAM_MASK)]; - UINT16 addr = code << 4 | (ra & 0x0f); - UINT8 data = m_char_rom->base()[addr & BW12_CHARROM_MASK]; + uint8_t code = m_video_ram[((ma + column) & BW12_VIDEORAM_MASK)]; + uint16_t addr = code << 4 | (ra & 0x0f); + uint8_t data = m_char_rom->base()[addr & BW12_CHARROM_MASK]; if (column == cursor_x) { @@ -392,7 +392,7 @@ READ8_MEMBER( bw12_state::pia_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_centronics_busy; data |= (m_centronics_fault << 1); @@ -453,7 +453,7 @@ WRITE_LINE_MEMBER( bw12_state::ay3600_data_ready_w ) if (state) { - UINT16 data = m_kbc->b_r(); + uint16_t data = m_kbc->b_r(); m_key_data[0] = BIT(data, 6); m_key_data[1] = BIT(data, 3); diff --git a/src/mame/drivers/bw2.cpp b/src/mame/drivers/bw2.cpp index 5b65b3c57eb..1ebd72f6bc4 100644 --- a/src/mame/drivers/bw2.cpp +++ b/src/mame/drivers/bw2.cpp @@ -61,7 +61,7 @@ READ8_MEMBER( bw2_state::read ) { int rom = 1, vram = 1, ram1 = 1, ram2 = 1, ram3 = 1, ram4 = 1, ram5 = 1, ram6 = 1; - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_bank) { @@ -441,7 +441,7 @@ READ8_MEMBER( bw2_state::ppi_pb_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_kb < 10) { @@ -476,7 +476,7 @@ READ8_MEMBER( bw2_state::ppi_pc_r ) */ - UINT8 data = 0; + uint8_t data = 0; // centronics busy data |= m_centronics_busy << 4; diff --git a/src/mame/drivers/bwing.cpp b/src/mame/drivers/bwing.cpp index 8c047cd50f1..a46def8ecea 100644 --- a/src/mame/drivers/bwing.cpp +++ b/src/mame/drivers/bwing.cpp @@ -550,7 +550,7 @@ ROM_END DRIVER_INIT_MEMBER(bwing_state,bwing) { - UINT8 *rom = memregion("audiocpu")->base(); + uint8_t *rom = memregion("audiocpu")->base(); int j = memregion("audiocpu")->bytes(); // swap nibbles diff --git a/src/mame/drivers/by17.cpp b/src/mame/drivers/by17.cpp index 128ea6eb3fb..9f11f203674 100644 --- a/src/mame/drivers/by17.cpp +++ b/src/mame/drivers/by17.cpp @@ -78,22 +78,22 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(u11_timer); TIMER_DEVICE_CALLBACK_MEMBER(timer_d_pulse); private: - UINT8 m_u10a; - UINT8 m_u10b; - UINT8 m_u11a; - UINT8 m_u11b; + uint8_t m_u10a; + uint8_t m_u10b; + uint8_t m_u11a; + uint8_t m_u11b; bool m_u10_ca2; bool m_u10_cb1; bool m_u10_cb2; bool m_u11_ca1; bool m_u11_cb2; - UINT8 m_digit; - UINT8 m_segment[6]; - UINT8 m_lamp_decode; - UINT8 m_solenoid_features[20][4]; - UINT8 m_io_hold_x[5]; // Used to hold switches closed (drop targets, balls in outholes/saucers etc). Solenoid activity release them. + uint8_t m_digit; + uint8_t m_segment[6]; + uint8_t m_lamp_decode; + uint8_t m_solenoid_features[20][4]; + uint8_t m_io_hold_x[5]; // Used to hold switches closed (drop targets, balls in outholes/saucers etc). Solenoid activity release them. required_device m_maincpu; - required_shared_ptr m_nvram; + required_shared_ptr m_nvram; required_device m_pia_u10; required_device m_pia_u11; required_ioport m_io_test; @@ -621,7 +621,7 @@ WRITE8_MEMBER( by17_state::u10_a_w ) READ8_MEMBER( by17_state::u10_b_r ) { - UINT8 data = 0; + uint8_t data = 0; if (BIT(m_u10a, 0)) data |= m_io_x0->read(); @@ -690,7 +690,7 @@ WRITE8_MEMBER( by17_state::u11_a_w ) if ((m_u10_ca2==0) && m_digit) { - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 - BCD to 7 Segment Display Decoder + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 - BCD to 7 Segment Display Decoder output().set_digit_value(10+m_digit, patterns[m_segment[1]]); output().set_digit_value(20+m_digit, patterns[m_segment[2]]); @@ -843,7 +843,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( by17_state::timer_d_pulse ) DRIVER_INIT_MEMBER( by17_state, by17 ) { - static const UINT8 solenoid_features_default[20][4] = + static const uint8_t solenoid_features_default[20][4] = { // This table serves two functions and is configured on a per game basis: // Assign a particular sound sample corresponding to a solenoid function, and @@ -883,7 +883,7 @@ DRIVER_INIT_MEMBER( by17_state, by17 ) DRIVER_INIT_MEMBER( by17_state, matahari ) { - static const UINT8 solenoid_features_matahari[20][4] = + static const uint8_t solenoid_features_matahari[20][4] = { // { Sound Channel, Sound Sample, Switch Strobe, Switch Return Mask } /*00*/ { 0x02, 0x05, 0x03, 0x7f }, // Saucer @@ -919,7 +919,7 @@ DRIVER_INIT_MEMBER( by17_state, matahari ) DRIVER_INIT_MEMBER( by17_state, pwerplay ) { - static const UINT8 solenoid_features_pwerplay[20][4] = + static const uint8_t solenoid_features_pwerplay[20][4] = { // { Sound Channel, Sound Sample, Switch Strobe, Switch Return Mask } /*00*/ { 0x00, 0x10, 0x00, 0x00 }, // Post Down diff --git a/src/mame/drivers/by35.cpp b/src/mame/drivers/by35.cpp index 6728f12eae1..3a9c5cff53f 100644 --- a/src/mame/drivers/by35.cpp +++ b/src/mame/drivers/by35.cpp @@ -133,10 +133,10 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_s); TIMER_DEVICE_CALLBACK_MEMBER(timer_as2888); private: - UINT8 m_u10a; - UINT8 m_u10b; - UINT8 m_u11a; - UINT8 m_u11b; + uint8_t m_u10a; + uint8_t m_u10b; + uint8_t m_u11a; + uint8_t m_u11b; bool m_u10_ca2; bool m_u10_cb1; bool m_u10_cb2; @@ -144,17 +144,17 @@ private: bool m_u11_cb2; bool m_timer_as2888; bool m_7d; - UINT8 m_digit; - UINT8 m_segment[6]; - UINT8 m_lamp_decode; - UINT8 m_solenoid_features[20][4]; - UINT8 m_io_hold_x[6]; - UINT8 m_snd_sel; - UINT8 m_snd_tone_gen; - UINT8 m_snd_div; - UINT8 *m_snd_prom; + uint8_t m_digit; + uint8_t m_segment[6]; + uint8_t m_lamp_decode; + uint8_t m_solenoid_features[20][4]; + uint8_t m_io_hold_x[6]; + uint8_t m_snd_sel; + uint8_t m_snd_tone_gen; + uint8_t m_snd_div; + uint8_t *m_snd_prom; required_device m_maincpu; - required_shared_ptr m_nvram; + required_shared_ptr m_nvram; required_device m_pia_u10; required_device m_pia_u11; required_ioport m_io_test; @@ -625,7 +625,7 @@ WRITE8_MEMBER( by35_state::u10_a_w ) READ8_MEMBER( by35_state::u10_b_r ) { - UINT8 data = 0; + uint8_t data = 0; if (BIT(m_u10a, 0)) data |= m_io_x0->read(); @@ -696,7 +696,7 @@ WRITE8_MEMBER( by35_state::u11_a_w ) if ((m_u10_ca2==0) && m_digit) { - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 - BCD to 7 Segment Display Decoder + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 - BCD to 7 Segment Display Decoder output().set_digit_value(10+m_digit, patterns[m_segment[1]]); output().set_digit_value(20+m_digit, patterns[m_segment[2]]); @@ -896,7 +896,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( by35_state::timer_as2888 ) DRIVER_INIT_MEMBER( by35_state, by35_6 ) { - static const UINT8 solenoid_features_default[20][4] = + static const uint8_t solenoid_features_default[20][4] = { // This table serves two functions and is configured on a per game basis: // Assign a particular sound sample corresponding to a solenoid function, and @@ -939,7 +939,7 @@ DRIVER_INIT_MEMBER( by35_state, by35_6 ) DRIVER_INIT_MEMBER( by35_state, playboy ) { - static const UINT8 solenoid_features_playboy[20][4] = + static const uint8_t solenoid_features_playboy[20][4] = { // { Sound Channel, Sound Sample, Switch Strobe, Switch Return Mask } /*00*/ { 0xff, 0xff, 0x00, 0x00 }, diff --git a/src/mame/drivers/by6803.cpp b/src/mame/drivers/by6803.cpp index 2d11daa4ba6..b5f8b220eaa 100644 --- a/src/mame/drivers/by6803.cpp +++ b/src/mame/drivers/by6803.cpp @@ -63,15 +63,15 @@ public: DECLARE_INPUT_CHANGED_MEMBER(self_test); TIMER_DEVICE_CALLBACK_MEMBER(pia0_timer); private: - UINT8 m_pia0_a; - UINT8 m_pia0_b; - UINT8 m_pia1_a; - UINT8 m_pia1_b; + uint8_t m_pia0_a; + uint8_t m_pia0_b; + uint8_t m_pia1_a; + uint8_t m_pia1_b; bool m_pia0_cb2; bool m_pia0_timer; - UINT8 m_port1, m_port2; - //UINT8 m_digit; - UINT8 m_segment; + uint8_t m_port1, m_port2; + //uint8_t m_digit; + uint8_t m_segment; virtual void machine_reset() override; required_device m_maincpu; required_device m_pia0; @@ -245,7 +245,7 @@ WRITE8_MEMBER( by6803_state::pia0_a_w ) // switch returns READ8_MEMBER( by6803_state::pia0_b_r ) { - UINT8 data = 0; + uint8_t data = 0; if (BIT(m_pia0_a, 0)) data |= m_io_x0->read(); diff --git a/src/mame/drivers/byvid.cpp b/src/mame/drivers/byvid.cpp index 33461908dac..16cecda02b1 100644 --- a/src/mame/drivers/byvid.cpp +++ b/src/mame/drivers/byvid.cpp @@ -103,17 +103,17 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(u10_timer); TIMER_DEVICE_CALLBACK_MEMBER(u11_timer); DECLARE_WRITE8_MEMBER(granny_crtc_w); - UINT32 screen_update_granny(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_granny(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: - UINT8 m_mpu_to_vid; - UINT8 m_vid_to_mpu; - UINT8 m_u7_a; - UINT8 m_u7_b; - UINT8 m_u10_a; - UINT8 m_u10_b; + uint8_t m_mpu_to_vid; + uint8_t m_vid_to_mpu; + uint8_t m_u7_a; + uint8_t m_u7_b; + uint8_t m_u10_a; + uint8_t m_u10_b; bool m_u10_cb2; - UINT8 m_u11_a; - UINT8 m_u11_b; + uint8_t m_u11_a; + uint8_t m_u11_b; bool m_u10_timer; bool m_u11_timer; virtual void machine_reset() override; @@ -644,7 +644,7 @@ READ8_MEMBER( by133_state::u10_b_r ) if (BIT(m_u11_a, 1) == 0) return m_vid_to_mpu; - UINT8 data = 0; + uint8_t data = 0; if (BIT(m_u10_a, 0)) data |= m_io_x0->read(); @@ -731,7 +731,7 @@ void by133_state::machine_reset() m_beep->set_state(0); } -UINT32 by133_state::screen_update_granny(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t by133_state::screen_update_granny(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { //bitmap.fill(0xff000000, cliprect); copybitmap(bitmap, m_crtc->get_bitmap(), 0, 0, 0, 0, cliprect); diff --git a/src/mame/drivers/c10.cpp b/src/mame/drivers/c10.cpp index 1a5bb2ee87c..3d094b5d806 100644 --- a/src/mame/drivers/c10.cpp +++ b/src/mame/drivers/c10.cpp @@ -30,11 +30,11 @@ public: m_p_videoram(*this, "p_videoram"){ } required_device m_maincpu; - const UINT8 *m_p_chargen; - required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + required_shared_ptr m_p_videoram; virtual void machine_reset() override; virtual void video_start() override; - 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); DECLARE_DRIVER_INIT(c10); protected: @@ -86,11 +86,11 @@ void c10_state::video_start() /* This system appears to have inline attribute bytes of unknown meaning. Currently they are ignored. The word at FAB5 looks like it might be cursor location. */ -UINT32 c10_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t c10_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - //static UINT8 framecnt=0; - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x,xx; + //static uint8_t framecnt=0; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x,xx; //framecnt++; @@ -98,7 +98,7 @@ UINT32 c10_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); xx = ma; for (x = ma; x < ma + 80; x++) @@ -172,7 +172,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(c10_state,c10) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0x8000); } diff --git a/src/mame/drivers/c128.cpp b/src/mame/drivers/c128.cpp index 88d65a9afa2..2b2791337b0 100644 --- a/src/mame/drivers/c128.cpp +++ b/src/mame/drivers/c128.cpp @@ -120,7 +120,7 @@ public: required_device m_from; required_memory_region m_rom; required_memory_region m_charom; - optional_shared_ptr m_color_ram; + optional_shared_ptr m_color_ram; required_ioport_array<8> m_row; required_ioport_array<3> m_k; required_ioport m_lock; @@ -132,8 +132,8 @@ public: inline void check_interrupts(); int read_pla(offs_t offset, offs_t ca, offs_t vma, int ba, int rw, int aec, int z80io, int ms3, int ms2, int ms1, int ms0); - UINT8 read_memory(address_space &space, offs_t offset, offs_t vma, int ba, int aec, int z80io); - void write_memory(address_space &space, offs_t offset, offs_t vma, UINT8 data, int ba, int aec, int z80io); + uint8_t read_memory(address_space &space, offs_t offset, offs_t vma, int ba, int aec, int z80io); + void write_memory(address_space &space, offs_t offset, offs_t vma, uint8_t data, int ba, int aec, int z80io); inline void update_iec(); DECLARE_READ8_MEMBER( z80_r ); @@ -231,7 +231,7 @@ public: int m_iec_srq; // keyboard state - UINT8 m_vic_k; + uint8_t m_vic_k; int m_caps_lock; int m_user_pa2; @@ -326,7 +326,7 @@ int c128_state::read_pla(offs_t offset, offs_t ca, offs_t vma, int ba, int rw, i m_game = m_exp->game_r(ca, sphi2, ba, rw, m_hiram); m_exrom = m_exp->exrom_r(ca, sphi2, ba, rw, m_hiram); - UINT32 input = sphi2 << 26 | m_va14 << 25 | m_charen << 24 | + uint32_t input = sphi2 << 26 | m_va14 << 25 | m_charen << 24 | m_hiram << 23 | m_loram << 22 | ba << 21 | VMA5 << 20 | VMA4 << 19 | ms0 << 18 | ms1 << 17 | ms2 << 16 | m_exrom << 15 | m_game << 14 | rw << 13 | aec << 12 | A10 << 11 | A11 << 10 | A12 << 9 | A13 << 8 | A14 << 7 | A15 << 6 | z80io << 5 | m_z80en << 4 | ms3 << 3 | vicfix << 2 | dmaack << 1 | _128_256; @@ -339,13 +339,13 @@ int c128_state::read_pla(offs_t offset, offs_t ca, offs_t vma, int ba, int rw, i // read_memory - //------------------------------------------------- -UINT8 c128_state::read_memory(address_space &space, offs_t offset, offs_t vma, int ba, int aec, int z80io) +uint8_t c128_state::read_memory(address_space &space, offs_t offset, offs_t vma, int ba, int aec, int z80io) { int rw = 1, ms0 = 1, ms1 = 1, ms2 = 1, ms3 = 1, cas0 = 1, cas1 = 1; int io1 = 1, io2 = 1; int sphi2 = m_vic->phi0_r(); - UINT8 data = 0xff; + uint8_t data = 0xff; offs_t ta = m_mmu->ta_r(offset, aec, &ms0, &ms1, &ms2, &ms3, &cas0, &cas1); offs_t ma = 0; @@ -466,7 +466,7 @@ UINT8 c128_state::read_memory(address_space &space, offs_t offset, offs_t vma, i // write_memory - //------------------------------------------------- -void c128_state::write_memory(address_space &space, offs_t offset, offs_t vma, UINT8 data, int ba, int aec, int z80io) +void c128_state::write_memory(address_space &space, offs_t offset, offs_t vma, uint8_t data, int ba, int aec, int z80io) { int rw = 0, ms0 = 1, ms1 = 1, ms2 = 1, ms3 = 1, cas0 = 1, cas1 = 1; int io1 = 1, io2 = 1; @@ -1116,7 +1116,7 @@ WRITE8_MEMBER( c128_state::vic_k_w ) READ8_MEMBER( c128_state::sid_potx_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_cia1->pa_r() >> 6) { @@ -1143,7 +1143,7 @@ READ8_MEMBER( c128_state::sid_potx_r ) READ8_MEMBER( c128_state::sid_poty_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_cia1->pa_r() >> 6) { @@ -1197,17 +1197,17 @@ READ8_MEMBER( c128_state::cia1_pa_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick - UINT8 joy_b = m_joy2->joy_r(); + uint8_t joy_b = m_joy2->joy_r(); data &= (0xf0 | (joy_b & 0x0f)); data &= ~(!BIT(joy_b, 5) << 4); // keyboard - UINT8 cia1_pb = m_cia1->pb_r(); - UINT32 row[8] = { m_row[0]->read(), m_row[1]->read() & m_lock->read(), m_row[2]->read(), m_row[3]->read(), + uint8_t cia1_pb = m_cia1->pb_r(); + uint32_t row[8] = { m_row[0]->read(), m_row[1]->read() & m_lock->read(), m_row[2]->read(), m_row[3]->read(), m_row[4]->read(), m_row[5]->read(), m_row[6]->read(), m_row[7]->read() }; for (int i = 0; i < 8; i++) @@ -1265,16 +1265,16 @@ READ8_MEMBER( c128_state::cia1_pb_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick - UINT8 joy_a = m_joy1->joy_r(); + uint8_t joy_a = m_joy1->joy_r(); data &= (0xf0 | (joy_a & 0x0f)); data &= ~(!BIT(joy_a, 5) << 4); // keyboard - UINT8 cia1_pa = m_cia1->pa_r(); + uint8_t cia1_pa = m_cia1->pa_r(); if (!BIT(cia1_pa, 7)) data &= m_row[7]->read(); if (!BIT(cia1_pa, 6)) data &= m_row[6]->read(); @@ -1359,7 +1359,7 @@ READ8_MEMBER( c128_state::cia2_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // user port data |= m_user_pa2 << 2; @@ -1440,7 +1440,7 @@ READ8_MEMBER( c128_state::cpu_r) */ - UINT8 data = 0x07; + uint8_t data = 0x07; // cassette sense data |= m_cassette->sense_r() << 4; @@ -1608,7 +1608,7 @@ void c128_state::machine_start() m_color_ram.allocate(0x800); // initialize memory - UINT8 data = 0xff; + uint8_t data = 0xff; for (offs_t offset = 0; offset < m_ram->size(); offset++) { diff --git a/src/mame/drivers/c64.cpp b/src/mame/drivers/c64.cpp index 07c3d97565b..d9f7dd31d7e 100644 --- a/src/mame/drivers/c64.cpp +++ b/src/mame/drivers/c64.cpp @@ -78,9 +78,9 @@ public: { } // ROM - UINT8 *m_basic; - UINT8 *m_kernal; - UINT8 *m_charom; + uint8_t *m_basic; + uint8_t *m_kernal; + uint8_t *m_charom; required_device m_maincpu; required_device m_pla; @@ -95,7 +95,7 @@ public: required_device m_user; required_device m_ram; optional_device m_cassette; - optional_shared_ptr m_color_ram; + optional_shared_ptr m_color_ram; optional_ioport_array<8> m_row; optional_ioport m_lock; @@ -104,8 +104,8 @@ public: void check_interrupts(); int read_pla(offs_t offset, offs_t va, int rw, int aec, int ba); - UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int aec, int ba); - void write_memory(address_space &space, offs_t offset, UINT8 data, int aec, int ba); + uint8_t read_memory(address_space &space, offs_t offset, offs_t va, int aec, int ba); + void write_memory(address_space &space, offs_t offset, uint8_t data, int aec, int ba); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -278,7 +278,7 @@ int c64_state::read_pla(offs_t offset, offs_t va, int rw, int aec, int ba) int exrom = m_exp->exrom_r(offset, sphi2, ba, rw, m_hiram); int cas = 0; - UINT32 input = VA12 << 15 | VA13 << 14 | game << 13 | exrom << 12 | rw << 11 | aec << 10 | ba << 9 | A12 << 8 | + uint32_t input = VA12 << 15 | VA13 << 14 | game << 13 | exrom << 12 | rw << 11 | aec << 10 | ba << 9 | A12 << 8 | A13 << 7 | A14 << 6 | A15 << 5 | m_va14 << 4 | m_charen << 3 | m_hiram << 2 | m_loram << 1 | cas; return m_pla->read(input); @@ -289,7 +289,7 @@ int c64_state::read_pla(offs_t offset, offs_t va, int rw, int aec, int ba) // read_memory - //------------------------------------------------- -UINT8 c64_state::read_memory(address_space &space, offs_t offset, offs_t va, int aec, int ba) +uint8_t c64_state::read_memory(address_space &space, offs_t offset, offs_t va, int aec, int ba) { int rw = 1; int io1 = 1, io2 = 1; @@ -297,7 +297,7 @@ UINT8 c64_state::read_memory(address_space &space, offs_t offset, offs_t va, int int plaout = read_pla(offset, va, rw, !aec, ba); - UINT8 data = 0xff; + uint8_t data = 0xff; if (!aec) { @@ -380,7 +380,7 @@ UINT8 c64_state::read_memory(address_space &space, offs_t offset, offs_t va, int // write_memory - //------------------------------------------------- -void c64_state::write_memory(address_space &space, offs_t offset, UINT8 data, int aec, int ba) +void c64_state::write_memory(address_space &space, offs_t offset, uint8_t data, int aec, int ba) { int rw = 0; offs_t va = 0; @@ -497,7 +497,7 @@ READ8_MEMBER( c64_state::vic_videoram_r ) READ8_MEMBER( c64_state::vic_colorram_r ) { - UINT8 data; + uint8_t data; if (m_vic->aec_r()) { @@ -704,7 +704,7 @@ WRITE_LINE_MEMBER( c64_state::vic_irq_w ) READ8_MEMBER( c64_state::sid_potx_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_cia1->pa_r() >> 6) { @@ -731,7 +731,7 @@ READ8_MEMBER( c64_state::sid_potx_r ) READ8_MEMBER( c64_state::sid_poty_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_cia1->pa_r() >> 6) { @@ -785,17 +785,17 @@ READ8_MEMBER( c64_state::cia1_pa_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick - UINT8 joy_b = m_joy2->joy_r(); + uint8_t joy_b = m_joy2->joy_r(); data &= (0xf0 | (joy_b & 0x0f)); data &= ~(!BIT(joy_b, 5) << 4); // keyboard - UINT8 cia1_pb = m_cia1->pb_r(); - UINT32 row[8] = { m_row[0]->read(), m_row[1]->read() & m_lock->read(), m_row[2]->read(), m_row[3]->read(), + uint8_t cia1_pb = m_cia1->pb_r(); + uint32_t row[8] = { m_row[0]->read(), m_row[1]->read() & m_lock->read(), m_row[2]->read(), m_row[3]->read(), m_row[4]->read(), m_row[5]->read(), m_row[6]->read(), m_row[7]->read() }; for (int i = 0; i < 8; i++) @@ -853,16 +853,16 @@ READ8_MEMBER( c64_state::cia1_pb_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick - UINT8 joy_a = m_joy1->joy_r(); + uint8_t joy_a = m_joy1->joy_r(); data &= (0xf0 | (joy_a & 0x0f)); data &= ~(!BIT(joy_a, 5) << 4); // keyboard - UINT8 cia1_pa = m_cia1->pa_r(); + uint8_t cia1_pa = m_cia1->pa_r(); if (!BIT(cia1_pa, 7)) data &= m_row[7]->read(); if (!BIT(cia1_pa, 6)) data &= m_row[6]->read(); @@ -915,10 +915,10 @@ READ8_MEMBER( c64gs_state::cia1_pa_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick - UINT8 joy_b = m_joy2->joy_r(); + uint8_t joy_b = m_joy2->joy_r(); data &= (0xf0 | (joy_b & 0x0f)); data &= ~(!BIT(joy_b, 5) << 4); @@ -943,10 +943,10 @@ READ8_MEMBER( c64gs_state::cia1_pb_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick - UINT8 joy_a = m_joy1->joy_r(); + uint8_t joy_a = m_joy1->joy_r(); data &= (0xf0 | (joy_a & 0x0f)); data &= ~(!BIT(joy_a, 5) << 4); @@ -983,7 +983,7 @@ READ8_MEMBER( c64_state::cia2_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // user port data |= m_user_pa2 << 2; @@ -1061,7 +1061,7 @@ READ8_MEMBER( c64_state::cpu_r ) */ - UINT8 data = 0x07; + uint8_t data = 0x07; data |= m_cassette->sense_r() << 4; @@ -1258,7 +1258,7 @@ void c64_state::machine_start() m_color_ram.allocate(0x400); // initialize memory - UINT8 data = 0xff; + uint8_t data = 0xff; for (offs_t offset = 0; offset < m_ram->size(); offset++) { diff --git a/src/mame/drivers/c64dtv.cpp b/src/mame/drivers/c64dtv.cpp index 4b707dfa585..9a8c2f6d1ed 100644 --- a/src/mame/drivers/c64dtv.cpp +++ b/src/mame/drivers/c64dtv.cpp @@ -14,7 +14,7 @@ public: c64dtv_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) { } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black); return 0; diff --git a/src/mame/drivers/c65.cpp b/src/mame/drivers/c65.cpp index 1f007bd15f0..0c2362ce6a5 100644 --- a/src/mame/drivers/c65.cpp +++ b/src/mame/drivers/c65.cpp @@ -50,17 +50,17 @@ public: required_device m_cia1; required_device m_screen; required_device m_palette; - required_shared_ptr m_workram; - required_shared_ptr m_palred; - required_shared_ptr m_palgreen; - required_shared_ptr m_palblue; - required_shared_ptr m_dmalist; - required_shared_ptr m_cram; + required_shared_ptr m_workram; + required_shared_ptr m_palred; + required_shared_ptr m_palgreen; + required_shared_ptr m_palblue; + required_shared_ptr m_dmalist; + required_shared_ptr m_cram; required_device m_gfxdecode; - UINT8 *m_iplrom; - UINT8 m_keyb_input[10]; - UINT8 m_keyb_mux; + uint8_t *m_iplrom; + uint8_t m_keyb_input[10]; + uint8_t m_keyb_mux; DECLARE_READ8_MEMBER(vic4567_dummy_r); DECLARE_WRITE8_MEMBER(vic4567_dummy_w); @@ -79,7 +79,7 @@ public: DECLARE_READ8_MEMBER(dummy_r); // screen updates - 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); DECLARE_PALETTE_INIT(c65); DECLARE_DRIVER_INIT(c65); DECLARE_DRIVER_INIT(c65pal); @@ -92,16 +92,16 @@ protected: virtual void video_start() override; private: - UINT8 m_VIC2_IRQPend, m_VIC2_IRQMask; + uint8_t m_VIC2_IRQPend, m_VIC2_IRQMask; /* 0x20: border color (TODO: different thread?) */ - UINT8 m_VIC2_EXTColor; + uint8_t m_VIC2_EXTColor; /* 0x30: banking + PAL + EXT SYNC */ - UINT8 m_VIC3_ControlA; + uint8_t m_VIC3_ControlA; /* 0x31: video modes */ - UINT8 m_VIC3_ControlB; - void PalEntryFlush(UINT8 offset); - void DMAgicExecute(address_space &space,UINT32 address); - void IRQCheck(UINT8 irq_cause); + uint8_t m_VIC3_ControlB; + void PalEntryFlush(uint8_t offset); + void DMAgicExecute(address_space &space,uint32_t address); + void IRQCheck(uint8_t irq_cause); int inner_x_char(int xoffs); int inner_y_char(int yoffs); }; @@ -121,7 +121,7 @@ int c65_state::inner_y_char(int yoffs) return yoffs>>3; } -UINT32 c65_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t c65_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { int y,x; int border_color = m_VIC2_EXTColor & 0xf; @@ -136,8 +136,8 @@ UINT32 c65_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, co int yi = inner_y_char(y); int xm = 7 - (x & 7); int ym = (y & 7); - UINT8 tile = m_workram[xi+yi*80+0x800]; - UINT8 attr = m_cram[xi+yi*80]; + uint8_t tile = m_workram[xi+yi*80+0x800]; + uint8_t attr = m_cram[xi+yi*80]; if(attr & 0xf0) attr = machine().rand() & 0xf; @@ -156,7 +156,7 @@ UINT32 c65_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, co READ8_MEMBER(c65_state::vic4567_dummy_r) { - UINT8 res; + uint8_t res; res=0xff; switch(offset) @@ -226,7 +226,7 @@ WRITE8_MEMBER(c65_state::vic4567_dummy_w) } -void c65_state::PalEntryFlush(UINT8 offset) +void c65_state::PalEntryFlush(uint8_t offset) { m_palette->set_pen_color(offset, pal4bit(m_palred[offset]), pal4bit(m_palgreen[offset]), pal4bit(m_palblue[offset])); } @@ -249,11 +249,11 @@ WRITE8_MEMBER(c65_state::PalBlue_w) PalEntryFlush(offset); } -void c65_state::DMAgicExecute(address_space &space,UINT32 address) +void c65_state::DMAgicExecute(address_space &space,uint32_t address) { - UINT8 cmd;// = space.read_byte(address++); - UINT16 length; //= space.read_byte(address++); - UINT32 src, dst; + uint8_t cmd;// = space.read_byte(address++); + uint16_t length; //= space.read_byte(address++); + uint32_t src, dst; static const char *const dma_cmd_string[] = { "COPY", // 0 @@ -279,9 +279,9 @@ void c65_state::DMAgicExecute(address_space &space,UINT32 address) { if(length != 1) printf("DMAgic %s %02x -> %08x %04x (CHAIN=%s)\n",dma_cmd_string[cmd & 3],src,dst,length,cmd & 4 ? "yes" : "no"); - UINT32 SourceIndex; - UINT32 DestIndex; - UINT16 SizeIndex; + uint32_t SourceIndex; + uint32_t DestIndex; + uint16_t SizeIndex; SourceIndex = src & 0xfffff; DestIndex = dst & 0xfffff; SizeIndex = length; @@ -297,9 +297,9 @@ void c65_state::DMAgicExecute(address_space &space,UINT32 address) { /* TODO: upper bits of source */ printf("DMAgic %s %02x -> %08x %04x (CHAIN=%s)\n",dma_cmd_string[cmd & 3],src & 0xff,dst,length,cmd & 4 ? "yes" : "no"); - UINT8 FillValue; - UINT32 DestIndex; - UINT16 SizeIndex; + uint8_t FillValue; + uint32_t DestIndex; + uint16_t SizeIndex; FillValue = src & 0xff; DestIndex = dst & 0xfffff; SizeIndex = length; @@ -377,7 +377,7 @@ READ8_MEMBER(c65_state::cia0_porta_r) READ8_MEMBER(c65_state::cia0_portb_r) { static const char *const c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" }; - UINT8 res; + uint8_t res; res = 0xff; for(int i=0;i<8;i++) @@ -550,7 +550,7 @@ static GFXDECODE_START( c65 ) GFXDECODE_ENTRY( "maincpu", 0xd000, charlayout, 0, 16 ) // another identical copy is at 0x9000 GFXDECODE_END -void c65_state::IRQCheck(UINT8 irq_cause) +void c65_state::IRQCheck(uint8_t irq_cause) { m_VIC2_IRQPend |= (irq_cause != 0) ? 0x80 : 0x00; m_VIC2_IRQPend |= irq_cause; diff --git a/src/mame/drivers/c80.cpp b/src/mame/drivers/c80.cpp index fa0f3244ce0..e9a89b2f6e8 100644 --- a/src/mame/drivers/c80.cpp +++ b/src/mame/drivers/c80.cpp @@ -137,7 +137,7 @@ READ8_MEMBER( c80_state::pio1_pa_r ) */ - UINT8 data = !m_pio1_brdy << 4 | 0x07; + uint8_t data = !m_pio1_brdy << 4 | 0x07; int i; diff --git a/src/mame/drivers/c900.cpp b/src/mame/drivers/c900.cpp index aa6f50ec20c..cce2db85f8e 100644 --- a/src/mame/drivers/c900.cpp +++ b/src/mame/drivers/c900.cpp @@ -41,7 +41,7 @@ public: DECLARE_READ16_MEMBER(stat_r); DECLARE_WRITE8_MEMBER(kbd_put); private: - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; required_device m_terminal; }; @@ -73,7 +73,7 @@ READ16_MEMBER( c900_state::port1e_r ) READ16_MEMBER( c900_state::key_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/cabal.cpp b/src/mame/drivers/cabal.cpp index 71b93b4915e..9b05f35a714 100644 --- a/src/mame/drivers/cabal.cpp +++ b/src/mame/drivers/cabal.cpp @@ -882,7 +882,7 @@ DRIVER_INIT_MEMBER(cabal_state,cabal) DRIVER_INIT_MEMBER(cabal_state,cabalbl2) { - UINT8 *decrypt = m_seibu_sound->get_custom_decrypt(); + uint8_t *decrypt = m_seibu_sound->get_custom_decrypt(); memcpy(decrypt, memregion("audiocpu")->base()+0x2000, 0x2000); memcpy(decrypt+0x8000, memregion("audiocpu")->base()+0x8000, 0x8000); m_adpcm1->decrypt(); diff --git a/src/mame/drivers/cabaret.cpp b/src/mame/drivers/cabaret.cpp index 6eab5b89c4d..65af500cac9 100644 --- a/src/mame/drivers/cabaret.cpp +++ b/src/mame/drivers/cabaret.cpp @@ -41,14 +41,14 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_fg_tile_ram; - required_shared_ptr m_fg_color_ram; - required_shared_ptr m_bg_scroll; - required_shared_ptr m_bg_tile_ram; + required_shared_ptr m_fg_tile_ram; + required_shared_ptr m_fg_color_ram; + required_shared_ptr m_bg_scroll; + required_shared_ptr m_bg_tile_ram; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; int m_nmi_enable; - UINT8 m_out[3]; + uint8_t m_out[3]; DECLARE_WRITE8_MEMBER(bg_scroll_w); DECLARE_WRITE8_MEMBER(bg_tile_w); DECLARE_WRITE8_MEMBER(fg_tile_w); @@ -60,7 +60,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(cabaret_interrupt); required_device m_maincpu; required_device m_gfxdecode; @@ -122,7 +122,7 @@ void cabaret_state::video_start() } -UINT32 cabaret_state::screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cabaret_state::screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -369,7 +369,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(cabaret_state,cabaret) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; /* decrypt the program ROM */ diff --git a/src/mame/drivers/calchase.cpp b/src/mame/drivers/calchase.cpp index de72447a43d..0f014a7c846 100644 --- a/src/mame/drivers/calchase.cpp +++ b/src/mame/drivers/calchase.cpp @@ -148,12 +148,12 @@ public: { } - std::unique_ptr m_bios_ram; - std::unique_ptr m_bios_ext_ram; - UINT8 m_mtxc_config_reg[256]; - UINT8 m_piix4_config_reg[4][256]; + std::unique_ptr m_bios_ram; + std::unique_ptr m_bios_ext_ram; + uint8_t m_mtxc_config_reg[256]; + uint8_t m_piix4_config_reg[4][256]; - UINT32 m_idle_skip_ram; + uint32_t m_idle_skip_ram; DECLARE_WRITE32_MEMBER(bios_ext_ram_w); DECLARE_WRITE32_MEMBER(bios_ram_w); DECLARE_READ16_MEMBER(calchase_iocard1_r); @@ -173,7 +173,7 @@ public: // Intel 82439TX System Controller (MTXC) // TODO: change with a VIA82C585VPX (North Bridge - APOLLO Chipset) -static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) { calchase_state *state = busdevice->machine().driver_data(); // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); @@ -181,7 +181,7 @@ static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, return state->m_mtxc_config_reg[reg]; } -static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { calchase_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); @@ -221,9 +221,9 @@ void calchase_state::intel82439tx_init() m_mtxc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if(reg == 0) return 0x05851106; // VT82C585VPX, VIA @@ -247,7 +247,7 @@ static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -270,23 +270,23 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) //TODO: change with VIA82C586B (South Bridge - APOLLO Chipset) -static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { calchase_state *state = busdevice->machine().driver_data(); // osd_printf_debug("PIIX4: read %d, %02X\n", function, reg); return state->m_piix4_config_reg[function][reg]; } -static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { calchase_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); state->m_piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if(reg == 0) return 0x30401106; // VT82C586B, VIA @@ -310,7 +310,7 @@ static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -626,8 +626,8 @@ INPUT_PORTS_END void calchase_state::machine_start() { - m_bios_ram = std::make_unique(0x10000/4); - m_bios_ext_ram = std::make_unique(0x10000/4); + m_bios_ram = std::make_unique(0x10000/4); + m_bios_ext_ram = std::make_unique(0x10000/4); } void calchase_state::machine_reset() @@ -712,7 +712,7 @@ WRITE32_MEMBER(calchase_state::calchase_idle_skip_w) DRIVER_INIT_MEMBER(calchase_state,calchase) { - m_bios_ram = std::make_unique(0x20000/4); + m_bios_ram = std::make_unique(0x20000/4); intel82439tx_init(); @@ -721,7 +721,7 @@ DRIVER_INIT_MEMBER(calchase_state,calchase) DRIVER_INIT_MEMBER(calchase_state, hostinv) { - m_bios_ram = std::make_unique(0x20000/4); + m_bios_ram = std::make_unique(0x20000/4); intel82439tx_init(); } diff --git a/src/mame/drivers/calomega.cpp b/src/mame/drivers/calomega.cpp index a247dc12de0..ee0636433df 100644 --- a/src/mame/drivers/calomega.cpp +++ b/src/mame/drivers/calomega.cpp @@ -661,7 +661,7 @@ WRITE_LINE_MEMBER(calomega_state::update_aciabaud_scale) { - UINT8 dsw2 = m_sw2->read(); + uint8_t dsw2 = m_sw2->read(); m_aciabaud->set_clock_scale((double)dsw2 / 128); } @@ -3665,7 +3665,7 @@ DRIVER_INIT_MEMBER(calomega_state,comg080) Start = $2042; NMI = $26f8; Also a fake vector at $3ff8-$3ff9. The code checks these values to continue. */ - UINT8 *PRGROM = memregion( "maincpu" )->base(); + uint8_t *PRGROM = memregion( "maincpu" )->base(); PRGROM[0x3ff8] = 0x8e; /* checked by code */ PRGROM[0x3ff9] = 0x97; /* checked by code */ diff --git a/src/mame/drivers/calorie.cpp b/src/mame/drivers/calorie.cpp index d6c67818c75..46acb198bab 100644 --- a/src/mame/drivers/calorie.cpp +++ b/src/mame/drivers/calorie.cpp @@ -100,13 +100,13 @@ public: m_decrypted_opcodes(*this, "decrypted_opcodes") { } /* memory pointers */ - required_shared_ptr m_fg_ram; - required_shared_ptr m_sprites; + required_shared_ptr m_fg_ram; + required_shared_ptr m_sprites; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_bg_bank; + uint8_t m_bg_bank; DECLARE_WRITE8_MEMBER(fg_ram_w); DECLARE_WRITE8_MEMBER(bg_bank_w); DECLARE_WRITE8_MEMBER(calorie_flipscreen_w); @@ -118,12 +118,12 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_calorie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_calorie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; required_device m_soundlatch; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; }; @@ -135,7 +135,7 @@ public: TILE_GET_INFO_MEMBER(calorie_state::get_bg_tile_info) { - UINT8 *src = memregion("user1")->base(); + uint8_t *src = memregion("user1")->base(); int bg_base = (m_bg_bank & 0x0f) * 0x200; int code = src[bg_base + tile_index] | (((src[bg_base + tile_index + 0x100]) & 0x10) << 4); int color = src[bg_base + tile_index + 0x100] & 0x0f; @@ -161,7 +161,7 @@ void calorie_state::video_start() m_fg_tilemap->set_transparent_pen(0); } -UINT32 calorie_state::screen_update_calorie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t calorie_state::screen_update_calorie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x; @@ -240,7 +240,7 @@ WRITE8_MEMBER(calorie_state::calorie_flipscreen_w) READ8_MEMBER(calorie_state::calorie_soundlatch_r) { - UINT8 latch = m_soundlatch->read(space, 0); + uint8_t latch = m_soundlatch->read(space, 0); m_soundlatch->clear_w(space, 0, 0); return latch; } diff --git a/src/mame/drivers/camplynx.cpp b/src/mame/drivers/camplynx.cpp index c8f17e6514d..2f9207f1e0f 100644 --- a/src/mame/drivers/camplynx.cpp +++ b/src/mame/drivers/camplynx.cpp @@ -162,11 +162,11 @@ public: MC6845_UPDATE_ROW(lynx128k_update_row); required_device m_palette; private: - UINT8 m_port58; - UINT8 m_port80; - UINT8 m_bankdata; - UINT8 m_wbyte; - UINT8 *m_p_ram; + uint8_t m_port58; + uint8_t m_port80; + uint8_t m_bankdata; + uint8_t m_wbyte; + uint8_t *m_p_ram; bool m_is_128k; required_device m_maincpu; required_device m_cass; @@ -196,7 +196,7 @@ d7 = read from bank 4 */ // do writes m_wbyte = (data & 0x0f) | ((m_port80 & 0x0c) << 3); // do reads - UINT8 rbyte = (data & 0x70) | (m_port80 & 0x0c); + uint8_t rbyte = (data & 0x70) | (m_port80 & 0x0c); switch (rbyte) { case 0x00: @@ -315,7 +315,7 @@ d0 = read from bank 4 */ // do writes m_wbyte = BITSWAP8(data, 0, 0, 0, 0, 4, 5, 6, 7) & 0x0f; // rearrange to 1,2,3,4 // do reads - UINT8 rbyte = BITSWAP8(data, 0, 0, 0, 0, 0, 1, 2, 3) & 0x0f; // rearrange to 0,1,2,4 + uint8_t rbyte = BITSWAP8(data, 0, 0, 0, 0, 0, 1, 2, 3) & 0x0f; // rearrange to 0,1,2,4 if (BIT(rbyte, 1)) rbyte &= 0x07; // remove 4 if 1 selected (AND gate in IC82) //printf("%s:%X:%X:%X\n", machine().describe_context(), data, rbyte, m_wbyte); @@ -606,7 +606,7 @@ WRITE8_MEMBER( camplynx_state::bank6_w ) READ8_MEMBER( camplynx_state::port80_r ) { - UINT8 data = ioport("LINE0")->read(); + uint8_t data = ioport("LINE0")->read(); // when reading tape, bit 0 becomes cass-in signal if (BIT(m_port80, 1)) { @@ -661,7 +661,7 @@ d1 = serial data in d0 = serial h/s in */ READ8_MEMBER( camplynx_state::port82_r ) { - UINT8 data = 0xfb; // guess + uint8_t data = 0xfb; // guess data |= (m_cass->input() > +0.02) ? 4 : 0; return data; } @@ -686,9 +686,9 @@ MACHINE_RESET_MEMBER(camplynx_state, lynx128k) MC6845_UPDATE_ROW( camplynx_state::lynx48k_update_row ) { - UINT8 r,g,b,x; - UINT32 green_bank, *p = &bitmap.pix32(y); - UINT16 mem = ((ma << 2) + (ra << 5)) & 0x1fff; + uint8_t r,g,b,x; + uint32_t green_bank, *p = &bitmap.pix32(y); + uint16_t mem = ((ma << 2) + (ra << 5)) & 0x1fff; // determine green bank if (BIT(m_port80, 4)) @@ -715,9 +715,9 @@ MC6845_UPDATE_ROW( camplynx_state::lynx48k_update_row ) MC6845_UPDATE_ROW( camplynx_state::lynx128k_update_row ) { - UINT8 r,g,b,x; - UINT32 green_bank, *p = &bitmap.pix32(y); - UINT16 mem = ((ma << 2) + (ra << 6)) & 0x3fff; + uint8_t r,g,b,x; + uint32_t green_bank, *p = &bitmap.pix32(y); + uint16_t mem = ((ma << 2) + (ra << 6)) & 0x3fff; // determine green bank if (BIT(m_port80, 4)) green_bank = 0x2c000+mem; // alt green diff --git a/src/mame/drivers/canyon.cpp b/src/mame/drivers/canyon.cpp index cfd770af0e1..537a736fb57 100644 --- a/src/mame/drivers/canyon.cpp +++ b/src/mame/drivers/canyon.cpp @@ -67,7 +67,7 @@ PALETTE_INIT_MEMBER(canyon_state, canyon) READ8_MEMBER(canyon_state::canyon_switches_r) { - UINT8 val = 0; + uint8_t val = 0; if ((ioport("IN2")->read() >> (offset & 7)) & 1) val |= 0x80; diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp index eed4313b5c3..11108c48118 100644 --- a/src/mame/drivers/capbowl.cpp +++ b/src/mame/drivers/capbowl.cpp @@ -462,7 +462,7 @@ ROM_END DRIVER_INIT_MEMBER(capbowl_state,capbowl) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* configure ROM banks in 0x0000-0x3fff */ membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/cardline.cpp b/src/mame/drivers/cardline.cpp index 740fb7e28f4..ccd295ea90e 100644 --- a/src/mame/drivers/cardline.cpp +++ b/src/mame/drivers/cardline.cpp @@ -43,11 +43,11 @@ public: m_screen(*this, "screen") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; - UINT8 m_video; - UINT8 m_hsync_q; + uint8_t m_video; + uint8_t m_hsync_q; DECLARE_WRITE8_MEMBER(vram_w); DECLARE_WRITE8_MEMBER(attr_w); @@ -92,8 +92,8 @@ MC6845_BEGIN_UPDATE( cardline_state::crtc_begin_update ) MC6845_UPDATE_ROW( cardline_state::crtc_update_row ) { - UINT8 *gfx; - UINT16 x = 0; + uint8_t *gfx; + uint16_t x = 0; int gfx_ofs; const rgb_t *palette = m_palette->palette()->entry_list_raw(); @@ -112,7 +112,7 @@ MC6845_UPDATE_ROW( cardline_state::crtc_update_row ) gfx = memregion("gfx1")->base(); - for (UINT8 cx = 0; cx < x_count; cx++) + for (uint8_t cx = 0; cx < x_count; cx++) { int bg_tile = (m_videoram[ma + gfx_ofs] | (m_colorram[ma + gfx_ofs]<<8)) & 0x3fff; int bg_pal_ofs = ((m_colorram[ma + gfx_ofs] & 0x80) ? 256 : 0); @@ -285,7 +285,7 @@ GFXDECODE_END PALETTE_INIT_MEMBER(cardline_state, cardline) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i,r,g,b,data; int bit0,bit1,bit2; for (i = 0;i < palette.entries();i++) diff --git a/src/mame/drivers/carjmbre.cpp b/src/mame/drivers/carjmbre.cpp index 4d6dc5bead7..bc067f86cf6 100644 --- a/src/mame/drivers/carjmbre.cpp +++ b/src/mame/drivers/carjmbre.cpp @@ -60,13 +60,13 @@ public: // devices/pointers required_device m_maincpu; required_device m_audiocpu; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_palette; bool m_nmi_enabled; - UINT8 m_bgcolor; + uint8_t m_bgcolor; tilemap_t *m_tilemap; DECLARE_WRITE8_MEMBER(bgcolor_w); @@ -76,7 +76,7 @@ public: INTERRUPT_GEN_MEMBER(vblank_nmi); DECLARE_PALETTE_INIT(carjmbre); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); TILE_GET_INFO_MEMBER(get_tile_info); @@ -126,7 +126,7 @@ static const res_net_info carjmbre_net_info = PALETTE_INIT_MEMBER(carjmbre_state, carjmbre) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); std::vector rgb; compute_res_net_all(rgb, color_prom, carjmbre_decode_info, carjmbre_net_info); @@ -163,7 +163,7 @@ void carjmbre_state::video_start() } -UINT32 carjmbre_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t carjmbre_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_bgcolor, cliprect); m_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/drivers/carpolo.cpp b/src/mame/drivers/carpolo.cpp index 4fe413dafff..b111489223e 100644 --- a/src/mame/drivers/carpolo.cpp +++ b/src/mame/drivers/carpolo.cpp @@ -344,7 +344,7 @@ ROM_END DRIVER_INIT_MEMBER(carpolo_state,carpolo) { size_t i, len; - UINT8 *ROM; + uint8_t *ROM; /* invert gfx PROM since the bits are active LO */ diff --git a/src/mame/drivers/carrera.cpp b/src/mame/drivers/carrera.cpp index d567ecc67da..004de507e99 100644 --- a/src/mame/drivers/carrera.cpp +++ b/src/mame/drivers/carrera.cpp @@ -64,10 +64,10 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_tileram; + required_shared_ptr m_tileram; DECLARE_READ8_MEMBER(unknown_r); DECLARE_PALETTE_INIT(carrera); - UINT32 screen_update_carrera(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_carrera(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -256,7 +256,7 @@ static GFXDECODE_START( carrera ) GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 1 ) GFXDECODE_END -UINT32 carrera_state::screen_update_carrera(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t carrera_state::screen_update_carrera(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int count = 0; @@ -281,7 +281,7 @@ READ8_MEMBER(carrera_state::unknown_r) PALETTE_INIT_MEMBER(carrera_state, carrera) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int br_bit0, br_bit1, bit0, bit1, r, g, b; int i; diff --git a/src/mame/drivers/casloopy.cpp b/src/mame/drivers/casloopy.cpp index f39366536eb..6165d1bb437 100644 --- a/src/mame/drivers/casloopy.cpp +++ b/src/mame/drivers/casloopy.cpp @@ -168,23 +168,23 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_bios_rom; - required_shared_ptr m_vregs; + required_shared_ptr m_bios_rom; + required_shared_ptr m_vregs; required_device m_maincpu; required_device m_cart; required_device m_gfxdecode; required_device m_palette; - std::unique_ptr m_paletteram; - std::unique_ptr m_vram; - std::unique_ptr m_bitmap_vram; - UINT16 sh7021_regs[0x100]; + std::unique_ptr m_paletteram; + std::unique_ptr m_vram; + std::unique_ptr m_bitmap_vram; + uint16_t sh7021_regs[0x100]; int m_gfx_index; DECLARE_DRIVER_INIT(casloopy); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_casloopy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_casloopy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER(vregs_r); DECLARE_WRITE16_MEMBER(vregs_w); DECLARE_READ16_MEMBER(pal_r); @@ -225,9 +225,9 @@ static const gfx_layout casloopy_8bpp_layout = void casloopy_state::video_start() { /* TODO: proper sizes */ - m_paletteram = make_unique_clear(0x1000); - m_vram = make_unique_clear(0x10000); - m_bitmap_vram = make_unique_clear(0x20000); + m_paletteram = make_unique_clear(0x1000); + m_vram = make_unique_clear(0x10000); + m_bitmap_vram = make_unique_clear(0x20000); for (m_gfx_index = 0; m_gfx_index < MAX_GFX_ELEMENTS; m_gfx_index++) if (m_gfxdecode->gfx(m_gfx_index) == nullptr) @@ -240,7 +240,7 @@ void casloopy_state::video_start() m_gfxdecode->set_gfx(m_gfx_index+1, std::make_unique(*m_palette, casloopy_8bpp_layout, m_vram.get(), 0, 1, 0)); } -UINT32 casloopy_state::screen_update_casloopy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t casloopy_state::screen_update_casloopy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(m_gfx_index); int x,y; @@ -271,7 +271,7 @@ UINT32 casloopy_state::screen_update_casloopy(screen_device &screen, bitmap_ind1 { for (x=0;x<32;x++) { - UINT16 tile = (m_vram[count+1])|(m_vram[count]<<8); + uint16_t tile = (m_vram[count+1])|(m_vram[count]<<8); tile &= 0x7ff; //??? @@ -287,7 +287,7 @@ UINT32 casloopy_state::screen_update_casloopy(screen_device &screen, bitmap_ind1 { for(x=0;x<256;x++) { - UINT8 pix; + uint8_t pix; pix = m_bitmap_vram[count]; if(pix) @@ -366,7 +366,7 @@ WRITE16_MEMBER(casloopy_state::sh7021_w) if(offset == 0x4e/2) { - UINT32 src,dst,size,type; + uint32_t src,dst,size,type; src = (sh7021_regs[0x40/2]<<16)|(sh7021_regs[0x42/2]&0xffff); dst = (sh7021_regs[0x44/2]<<16)|(sh7021_regs[0x46/2]&0xffff); @@ -380,7 +380,7 @@ WRITE16_MEMBER(casloopy_state::sh7021_w) if(offset == 0x7e/2) { - UINT32 src,dst,size,type; + uint32_t src,dst,size,type; src = (sh7021_regs[0x70/2]<<16)|(sh7021_regs[0x72/2]&0xffff); dst = (sh7021_regs[0x74/2]<<16)|(sh7021_regs[0x76/2]&0xffff); @@ -476,9 +476,9 @@ static const gfx_layout casloopy_8bpp_layoutROM = DEVICE_IMAGE_LOAD_MEMBER( casloopy_state, loopy_cart ) { - UINT32 size = m_cart->common_get_size("rom"); - UINT8 *SRC, *DST; - std::vector temp; + uint32_t size = m_cart->common_get_size("rom"); + uint8_t *SRC, *DST; + std::vector temp; temp.resize(size); m_cart->rom_alloc(size, GENERIC_ROM32_WIDTH, ENDIANNESS_LITTLE); @@ -490,8 +490,8 @@ DEVICE_IMAGE_LOAD_MEMBER( casloopy_state, loopy_cart ) // fix endianness for (int i = 0; i < size; i += 4) { - UINT8 tempa = SRC[i + 0]; - UINT8 tempb = SRC[i + 1]; + uint8_t tempa = SRC[i + 0]; + uint8_t tempb = SRC[i + 1]; DST[i + 0] = SRC[i + 2]; DST[i + 1] = SRC[i + 3]; DST[i + 2] = tempa; diff --git a/src/mame/drivers/caswin.cpp b/src/mame/drivers/caswin.cpp index 114eef48a00..ca62aec9c86 100644 --- a/src/mame/drivers/caswin.cpp +++ b/src/mame/drivers/caswin.cpp @@ -83,8 +83,8 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_sc0_vram; - required_shared_ptr m_sc0_attr; + required_shared_ptr m_sc0_vram; + required_shared_ptr m_sc0_attr; tilemap_t *m_sc0_tilemap; DECLARE_WRITE8_MEMBER(sc0_vram_w); DECLARE_WRITE8_MEMBER(sc0_attr_w); @@ -96,7 +96,7 @@ public: TILE_GET_INFO_MEMBER(get_sc0_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(caswin); - UINT32 screen_update_vvillage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vvillage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -119,7 +119,7 @@ void caswin_state::video_start() m_sc0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(caswin_state::get_sc0_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32); } -UINT32 caswin_state::screen_update_vvillage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t caswin_state::screen_update_vvillage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0); return 0; @@ -294,7 +294,7 @@ GFXDECODE_END PALETTE_INIT_MEMBER(caswin_state, caswin) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit0, bit1, bit2 , r, g, b; int i; diff --git a/src/mame/drivers/cat.cpp b/src/mame/drivers/cat.cpp index f85db656ba5..f9996240863 100644 --- a/src/mame/drivers/cat.cpp +++ b/src/mame/drivers/cat.cpp @@ -266,8 +266,8 @@ public: required_device m_ctx; required_device m_ctx_data_out; required_device m_speaker; - required_shared_ptr m_svram; - required_shared_ptr m_p_cat_videoram; + required_shared_ptr m_svram; + required_shared_ptr m_p_cat_videoram; required_ioport m_y0; required_ioport m_y1; required_ioport m_y2; @@ -285,7 +285,7 @@ public: DECLARE_VIDEO_START(cat); DECLARE_DRIVER_INIT(cat); - UINT32 screen_update_cat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(cat_duart_irq_handler); DECLARE_WRITE_LINE_MEMBER(cat_duart_txa); @@ -324,14 +324,14 @@ public: The watchdog counter and the 6ms counter are both incremented every time the KTOBF pulses. */ - UINT16 m_6ms_counter; - UINT8 m_wdt_counter; - UINT8 m_duart_ktobf_ff; + uint16_t m_6ms_counter; + uint8_t m_wdt_counter; + uint8_t m_duart_ktobf_ff; /* the /ACK line from the centronics printer port goes through a similar flipflop to the ktobf line as well, so duart IP4 inverts on /ACK rising edge */ - UINT8 m_duart_prn_ack_prev_state; - UINT8 m_duart_prn_ack_ff; + uint8_t m_duart_prn_ack_prev_state; + uint8_t m_duart_prn_ack_ff; /* Gate array 2 is in charge of serializing the video for display to the screen; Gate array 1 is in charge of vblank/hblank timing, and in charge of refreshing dram and indicating to GA2, using the /LDPS signal, what times the address it is @@ -340,11 +340,11 @@ public: GA2 then takes: ((output_bit XNOR video_invert) AND video enable), and serially bangs the result to the analog display circuitry. */ - UINT8 m_video_enable; - UINT8 m_video_invert; - UINT16 m_pr_cont; - UINT8 m_keyboard_line; - UINT8 m_floppy_control; + uint8_t m_video_enable; + uint8_t m_video_invert; + uint16_t m_pr_cont; + uint8_t m_keyboard_line; + uint8_t m_floppy_control; //TIMER_CALLBACK_MEMBER(keyboard_callback); TIMER_CALLBACK_MEMBER(counter_6ms_callback); @@ -358,7 +358,7 @@ protected: /* DRIVER_INIT_MEMBER( cat_state,cat ) { - UINT8 *svrom = memregion("svrom")->base(); + uint8_t *svrom = memregion("svrom")->base(); int i; // fill svrom with the correct 2e80 pattern except where svrom1 sits // first half @@ -525,7 +525,7 @@ READ16_MEMBER( cat_state::cat_floppy_status_r ) // 0x80000a-0x80000b READ16_MEMBER( cat_state::cat_keyboard_r ) { - UINT16 retVal = 0; + uint16_t retVal = 0; // Read country code if ((m_pr_cont&0xFF00) == 0x0900) retVal = m_dipsw->read(); @@ -932,9 +932,9 @@ VIDEO_START_MEMBER(cat_state,cat) { } -UINT32 cat_state::screen_update_cat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cat_state::screen_update_cat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 code; + uint16_t code; int y, x, b; int addr = 0; diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp index fd58d35cb61..e4f35f9f86f 100644 --- a/src/mame/drivers/cave.cpp +++ b/src/mame/drivers/cave.cpp @@ -257,7 +257,7 @@ READ16_MEMBER(cave_state::soundlatch_ack_r) { if (m_soundbuf_len > 0) { - UINT8 data = m_soundbuf_data[0]; + uint8_t data = m_soundbuf_data[0]; memmove(m_soundbuf_data, m_soundbuf_data + 1, (32 - 1) * sizeof(m_soundbuf_data[0])); m_soundbuf_len--; return data; @@ -790,12 +790,12 @@ WRITE16_MEMBER(cave_state::ppsatan_io_mux_w) COMBINE_DATA(&m_ppsatan_io_mux); } -UINT16 cave_state::ppsatan_touch_r(int player) +uint16_t cave_state::ppsatan_touch_r(int player) { - UINT8 ret_x = 0, ret_y = 0; + uint8_t ret_x = 0, ret_y = 0; - UINT16 x = ioport(player ? "TOUCH2_X" : "TOUCH1_X")->read(); - UINT16 y = ioport(player ? "TOUCH2_Y" : "TOUCH1_Y")->read(); + uint16_t x = ioport(player ? "TOUCH2_X" : "TOUCH1_X")->read(); + uint16_t y = ioport(player ? "TOUCH2_Y" : "TOUCH1_Y")->read(); if (x & 0x8000) // touching { @@ -913,9 +913,9 @@ READ16_MEMBER(cave_state::pwrinst2_eeprom_r) return ~8 + ((m_eeprom->do_read() & 1) ? 8 : 0); } -inline void cave_state::vctrl_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int GFX) +inline void cave_state::vctrl_w(address_space &space, offs_t offset, uint16_t data, uint16_t mem_mask, int GFX) { - UINT16 *VCTRL = m_vctrl[GFX]; + uint16_t *VCTRL = m_vctrl[GFX]; if (offset == 4 / 2) { switch (data & 0x000f) @@ -2770,14 +2770,14 @@ MACHINE_CONFIG_END /* 4 bits -> 8 bits. Even and odd pixels are swapped */ void cave_state::unpack_sprites(const char *region) { - const UINT32 len = memregion(region)->bytes(); - UINT8 *rgn = memregion(region)->base(); - UINT8 *src = rgn + len / 2 - 1; - UINT8 *dst = rgn + len - 1; + const uint32_t len = memregion(region)->bytes(); + uint8_t *rgn = memregion(region)->base(); + uint8_t *src = rgn + len / 2 - 1; + uint8_t *dst = rgn + len - 1; while(dst > src) { - UINT8 data = *src--; + uint8_t data = *src--; /* swap even and odd pixels */ *dst-- = data >> 4; *dst-- = data & 0xF; } @@ -2787,17 +2787,17 @@ void cave_state::unpack_sprites(const char *region) /* 4 bits -> 8 bits. Even and odd pixels and even and odd words, are swapped */ void cave_state::ddonpach_unpack_sprites(const char *region) { - const UINT32 len = memregion(region)->bytes(); - UINT8 *rgn = memregion(region)->base(); - UINT8 *src = rgn + len / 2 - 1; - UINT8 *dst = rgn + len - 1; + const uint32_t len = memregion(region)->bytes(); + uint8_t *rgn = memregion(region)->base(); + uint8_t *src = rgn + len / 2 - 1; + uint8_t *dst = rgn + len - 1; while(dst > src) { - UINT8 data1 = *src--; - UINT8 data2 = *src--; - UINT8 data3 = *src--; - UINT8 data4 = *src--; + uint8_t data1 = *src--; + uint8_t data2 = *src--; + uint8_t data3 = *src--; + uint8_t data4 = *src--; /* swap even and odd pixels, and even and odd words */ *dst-- = data2 & 0xF; *dst-- = data2 >> 4; @@ -2811,13 +2811,13 @@ void cave_state::ddonpach_unpack_sprites(const char *region) /* 2 pages of 4 bits -> 8 bits */ void cave_state::esprade_unpack_sprites(const char *region) { - UINT8 *src = memregion(region)->base(); - UINT8 *dst = src + memregion(region)->bytes(); + uint8_t *src = memregion(region)->base(); + uint8_t *dst = src + memregion(region)->bytes(); while(src < dst) { - UINT8 data1 = src[0]; - UINT8 data2 = src[1]; + uint8_t data1 = src[0]; + uint8_t data2 = src[1]; src[0] = ((data1 & 0x0f)<<4) + (data2 & 0x0f); src[1] = (data1 & 0xf0) + ((data2 & 0xf0)>>4); @@ -4736,14 +4736,14 @@ ROM_END Expand the 2 bit part into a 4 bit layout, so we can decode it */ void cave_state::sailormn_unpack_tiles( const char *region ) { - const UINT32 len = memregion(region)->bytes(); - UINT8 *rgn = memregion(region)->base(); - UINT8 *src = rgn + (len/4)*3 - 1; - UINT8 *dst = rgn + (len/4)*4 - 2; + const uint32_t len = memregion(region)->bytes(); + uint8_t *rgn = memregion(region)->base(); + uint8_t *src = rgn + (len/4)*3 - 1; + uint8_t *dst = rgn + (len/4)*4 - 2; while(src <= dst) { - UINT8 data = src[0]; + uint8_t data = src[0]; dst[0] = ((data & 0x03) << 4) + ((data & 0x0c) >> 2); dst[1] = ((data & 0x30) >> 0) + ((data & 0xc0) >> 6); @@ -4765,7 +4765,7 @@ void cave_state::init_cave() DRIVER_INIT_MEMBER(cave_state,agallet) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); init_cave(); membank("z80bank")->configure_entries(0, 0x20, &ROM[0x00000], 0x4000); @@ -4827,7 +4827,7 @@ DRIVER_INIT_MEMBER(cave_state,esprade) #if 0 //ROM PATCH { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); rom[0x118A/2] = 0x4e71; //palette fix 118A: 5548 SUBQ.W #2,A0 --> NOP } #endif @@ -4854,7 +4854,7 @@ DRIVER_INIT_MEMBER(cave_state,guwange) DRIVER_INIT_MEMBER(cave_state,hotdogst) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); init_cave(); @@ -4871,8 +4871,8 @@ DRIVER_INIT_MEMBER(cave_state,hotdogst) DRIVER_INIT_MEMBER(cave_state,mazinger) { - UINT8 *ROM = memregion("audiocpu")->base(); - UINT8 *src = memregion("sprites0")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); + uint8_t *src = memregion("sprites0")->base(); int len = memregion("sprites0")->bytes(); init_cave(); @@ -4884,7 +4884,7 @@ DRIVER_INIT_MEMBER(cave_state,mazinger) membank("okibank2")->configure_entries(0, 4, &ROM[0x00000], 0x20000); /* decrypt sprites */ - std::vector buffer(len); + std::vector buffer(len); { int i; for (i = 0; i < len; i++) @@ -4900,7 +4900,7 @@ DRIVER_INIT_MEMBER(cave_state,mazinger) DRIVER_INIT_MEMBER(cave_state,metmqstr) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); init_cave(); @@ -4937,8 +4937,8 @@ DRIVER_INIT_MEMBER(cave_state,ppsatan) DRIVER_INIT_MEMBER(cave_state,pwrinst2j) { - UINT8 *ROM = memregion("audiocpu")->base(); - UINT8 *src = memregion("sprites0")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); + uint8_t *src = memregion("sprites0")->base(); int len = memregion("sprites0")->bytes(); int i, j; @@ -4946,7 +4946,7 @@ DRIVER_INIT_MEMBER(cave_state,pwrinst2j) membank("z80bank")->configure_entries(0, 8, &ROM[0x00000], 0x4000); - std::vector buffer(len); + std::vector buffer(len); { for(i = 0; i < len/2; i++) { @@ -4973,7 +4973,7 @@ DRIVER_INIT_MEMBER(cave_state,pwrinst2) #if 1 //ROM PATCH { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); rom[0xd46c / 2] = 0xd482; // kurara dash fix 0xd400 -> 0xd482 } #endif @@ -4982,8 +4982,8 @@ DRIVER_INIT_MEMBER(cave_state,pwrinst2) DRIVER_INIT_MEMBER(cave_state,sailormn) { - UINT8 *ROM = memregion("audiocpu")->base(); - UINT8 *src = memregion("sprites0")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); + uint8_t *src = memregion("sprites0")->base(); int len = memregion("sprites0")->bytes(); init_cave(); @@ -4999,7 +4999,7 @@ DRIVER_INIT_MEMBER(cave_state,sailormn) membank("oki2bank2")->configure_entries(0, 0x10, &ROM[0x00000], 0x20000); /* decrypt sprites */ - std::vector buffer(len); + std::vector buffer(len); { int i; for (i = 0; i < len; i++) diff --git a/src/mame/drivers/cavepc.cpp b/src/mame/drivers/cavepc.cpp index 7bd1c83b794..4854ec018d9 100644 --- a/src/mame/drivers/cavepc.cpp +++ b/src/mame/drivers/cavepc.cpp @@ -69,14 +69,14 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cavepc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cavepc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; void cavepc_state::video_start() { } -UINT32 cavepc_state::screen_update_cavepc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cavepc_state::screen_update_cavepc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/cb2001.cpp b/src/mame/drivers/cb2001.cpp index 209c6c018d3..84e1e615b0c 100644 --- a/src/mame/drivers/cb2001.cpp +++ b/src/mame/drivers/cb2001.cpp @@ -59,8 +59,8 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_vram_fg; - required_shared_ptr m_vram_bg; + required_shared_ptr m_vram_fg; + required_shared_ptr m_vram_bg; int m_videobank; int m_videomode; tilemap_t *m_reel1_tilemap; @@ -76,7 +76,7 @@ public: TILE_GET_INFO_MEMBER(get_cb2001_reel3_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(cb2001); - UINT32 screen_update_cb2001(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cb2001(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); required_device m_maincpu; required_device m_gfxdecode; @@ -86,7 +86,7 @@ public: #define xxxx 0x90 /* Unknown */ -static const UINT8 cb2001_decryption_table[256] = { +static const uint8_t cb2001_decryption_table[256] = { 0xe8,xxxx,xxxx,xxxx,0x80,0xe4,0x12,0x2f, 0x3c,xxxx,xxxx,0x23,xxxx,xxxx,xxxx,0x5f, /* 00 */ // ssss ---- **** pppp pppp ssss pppp pppp 0x86,xxxx,xxxx,0x27,0x1c,xxxx,xxxx,xxxx, 0x32,0x40,0xa0,0xd3,0x3a,0x14,0x89,0x1f, /* 10 */ @@ -341,7 +341,7 @@ e3 -> c6 */ -UINT32 cb2001_state::screen_update_cb2001(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cb2001_state::screen_update_cb2001(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int count,x,y; bitmap.fill(m_palette->black_pen(), cliprect); @@ -377,7 +377,7 @@ UINT32 cb2001_state::screen_update_cb2001(screen_device &screen, bitmap_rgb32 &b for (i= 0;i < 64;i++) { - UINT16 scroll; + uint16_t scroll; scroll = m_vram_bg[0xa00/2 + i/2]; if (i&1) @@ -783,9 +783,9 @@ PALETTE_INIT_MEMBER(cb2001_state, cb2001) { int r,g,b; - UINT8*proms = memregion("proms")->base(); + uint8_t*proms = memregion("proms")->base(); int length = memregion("proms")->bytes(); - UINT16 dat; + uint16_t dat; dat = (proms[0x000+i] << 8) | proms[0x200+i]; diff --git a/src/mame/drivers/cball.cpp b/src/mame/drivers/cball.cpp index 84ab921483c..f6b817c2216 100644 --- a/src/mame/drivers/cball.cpp +++ b/src/mame/drivers/cball.cpp @@ -33,7 +33,7 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; /* video-related */ tilemap_t* m_bg_tilemap; @@ -52,7 +52,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(cball); - 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: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -61,7 +61,7 @@ protected: TILE_GET_INFO_MEMBER(cball_state::get_tile_info) { - UINT8 code = m_video_ram[tile_index]; + uint8_t code = m_video_ram[tile_index]; SET_TILE_INFO_MEMBER(0, code, code >> 7, 0); } @@ -80,7 +80,7 @@ void cball_state::video_start() } -UINT32 cball_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cball_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* draw playfield */ m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/drivers/cbasebal.cpp b/src/mame/drivers/cbasebal.cpp index 1b88bc30464..fa46ad67413 100644 --- a/src/mame/drivers/cbasebal.cpp +++ b/src/mame/drivers/cbasebal.cpp @@ -335,9 +335,9 @@ ROM_END DRIVER_INIT_MEMBER(cbasebal_state,cbasebal) { - UINT8 *src = memregion("maincpu")->base(); + uint8_t *src = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); - m_decoded = std::make_unique(size); + m_decoded = std::make_unique(size); pang_decode(src, m_decoded.get(), size); membank("bank1")->configure_entries(0, 32, src + 0x10000, 0x4000); membank("bank0d")->set_base(m_decoded.get()); diff --git a/src/mame/drivers/cbm2.cpp b/src/mame/drivers/cbm2.cpp index 9ebabd01c39..416891f59e6 100644 --- a/src/mame/drivers/cbm2.cpp +++ b/src/mame/drivers/cbm2.cpp @@ -129,9 +129,9 @@ public: required_memory_region m_basic; required_memory_region m_kernal; required_memory_region m_charom; - optional_shared_ptr m_buffer_ram; - optional_shared_ptr m_extbuf_ram; - optional_shared_ptr m_video_ram; + optional_shared_ptr m_buffer_ram; + optional_shared_ptr m_extbuf_ram; + optional_shared_ptr m_video_ram; required_ioport_array<8> m_pa; required_ioport_array<8> m_pb; required_ioport m_lock; @@ -153,7 +153,7 @@ public: int *diskromcs, int *csbank1, int *csbank2, int *csbank3, int *basiccs, int *knbcs, int *kernalcs, int *crtccs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs); - UINT8 read_keyboard(); + uint8_t read_keyboard(); void set_busy2(int state); DECLARE_READ8_MEMBER( read ); @@ -210,12 +210,12 @@ public: int m_user_irq; // keyboard state; - UINT8 m_tpi2_pa; - UINT8 m_tpi2_pb; - UINT8 m_cia_pa; + uint8_t m_tpi2_pa; + uint8_t m_tpi2_pb; + uint8_t m_cia_pa; - UINT8 m_ext_cia_pb; - UINT8 m_ext_tpi_pb; + uint8_t m_ext_cia_pb; + uint8_t m_ext_tpi_pb; // timers emu_timer *m_todclk_timer; @@ -252,7 +252,7 @@ public: required_device m_pla2; required_device m_vic; - optional_shared_ptr m_color_ram; + optional_shared_ptr m_color_ram; DECLARE_MACHINE_START( p500 ); DECLARE_MACHINE_START( p500_ntsc ); @@ -271,8 +271,8 @@ public: int *csbank1, int *csbank2, int *csbank3, int *basiclocs, int *basichics, int *kernalcs, int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs, int *aec, int *vsysaden); - UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int ba, int ae); - void write_memory(address_space &space, offs_t offset, UINT8 data, int ba, int ae); + uint8_t read_memory(address_space &space, offs_t offset, offs_t va, int ba, int ae); + void write_memory(address_space &space, offs_t offset, uint8_t data, int ba, int ae); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -319,7 +319,7 @@ public: #define A0 BIT(offset, 0) #define VA12 BIT(va, 12) -static void cbmb_quick_sethiaddress(address_space &space, UINT16 hiaddress) +static void cbmb_quick_sethiaddress(address_space &space, uint16_t hiaddress) { space.write_byte(0xf0046, hiaddress & 0xff); space.write_byte(0xf0047, hiaddress >> 8); @@ -346,8 +346,8 @@ QUICKLOAD_LOAD_MEMBER( p500_state, p500 ) void cbm2_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4) { - UINT32 input = P0 << 15 | P1 << 14 | P2 << 13 | P3 << 12 | m_busy2 << 11 | eras << 10 | ecas << 9 | refen << 8 | cas << 7 | ras << 6; - UINT32 data = m_pla1->read(input); + uint32_t input = P0 << 15 | P1 << 14 | P2 << 13 | P3 << 12 | m_busy2 << 11 | eras << 10 | ecas << 9 | refen << 8 | cas << 7 | ras << 6; + uint32_t data = m_pla1->read(input); *casseg1 = BIT(data, 0); *rasseg1 = BIT(data, 1); @@ -367,8 +367,8 @@ void cbm2_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, void cbm2hp_state::read_pla(offs_t offset, int ras, int cas, int refen, int eras, int ecas, int *casseg1, int *casseg2, int *casseg3, int *casseg4, int *rasseg1, int *rasseg2, int *rasseg3, int *rasseg4) { - UINT32 input = ras << 13 | cas << 12 | refen << 11 | eras << 10 | ecas << 9 | m_busy2 << 8 | P3 << 3 | P2 << 2 | P1 << 1 | P0; - UINT32 data = m_pla1->read(input); + uint32_t input = ras << 13 | cas << 12 | refen << 11 | eras << 10 | ecas << 9 | m_busy2 << 8 | P3 << 3 | P2 << 2 | P1 << 1 | P0; + uint32_t data = m_pla1->read(input); *casseg1 = BIT(data, 0); *casseg2 = BIT(data, 1); @@ -459,7 +459,7 @@ READ8_MEMBER( cbm2_state::read ) &diskromcs, &csbank1, &csbank2, &csbank3, &basiccs, &knbcs, &kernalcs, &crtccs, &cs1, &sidcs, &extprtcs, &ciacs, &aciacs, &tript1cs, &tript2cs); - UINT8 data = 0xff; + uint8_t data = 0xff; if (!dramen) { @@ -648,7 +648,7 @@ READ8_MEMBER( cbm2_state::ext_read ) int casseg1 = 1, casseg2 = 1, casseg3 = 1, casseg4 = 1, rasseg1 = 1, rasseg2 = 1, rasseg3 = 1, rasseg4 = 1; this->read_pla(offset, ras, cas, refen, eras, ecas, &casseg1, &casseg2, &casseg3, &casseg4, &rasseg1, &rasseg2, &rasseg3, &rasseg4); - UINT8 data = 0xff; + uint8_t data = 0xff; if (!casseg1) { @@ -670,7 +670,7 @@ READ8_MEMBER( cbm2_state::ext_read ) return data; #endif - UINT8 data = 0; + uint8_t data = 0; if (offset < 0x40000) data = m_ram->pointer()[offset]; return data; } @@ -720,10 +720,10 @@ void p500_state::read_pla1(offs_t offset, int busy2, int clrnibcsb, int procvid, int sphi2 = m_vic->phi0_r(); int bras = 1; - UINT32 input = P0 << 15 | P2 << 14 | bras << 13 | P1 << 12 | P3 << 11 | busy2 << 10 | m_statvid << 9 | sphi2 << 8 | + uint32_t input = P0 << 15 | P2 << 14 | bras << 13 | P1 << 12 | P3 << 11 | busy2 << 10 | m_statvid << 9 | sphi2 << 8 | clrnibcsb << 7 | m_dramon << 6 | procvid << 5 | refen << 4 | m_vicdotsel << 3 | ba << 2 | aec << 1 | srw; - UINT32 data = m_pla1->read(input); + uint32_t data = m_pla1->read(input); *datxen = BIT(data, 0); *dramxen = BIT(data, 1); @@ -746,10 +746,10 @@ void p500_state::read_pla2(offs_t offset, offs_t va, int ba, int vicen, int ae, int sphi2 = m_vic->phi0_r(); int bcas = 1; - UINT32 input = VA12 << 15 | ba << 14 | A13 << 13 | A15 << 12 | A14 << 11 | A11 << 10 | A10 << 9 | A12 << 8 | + uint32_t input = VA12 << 15 | ba << 14 | A13 << 13 | A15 << 12 | A14 << 11 | A11 << 10 | A10 << 9 | A12 << 8 | sphi2 << 7 | vicen << 6 | m_statvid << 5 | m_vicdotsel << 4 | ae << 3 | segf << 2 | bcas << 1 | bank0; - UINT32 data = m_pla2->read(input); + uint32_t data = m_pla2->read(input); *clrnibcsb = BIT(data, 0); *extbufcs = BIT(data, 1); @@ -836,7 +836,7 @@ void p500_state::bankswitch(offs_t offset, offs_t va, int srw, int ba, int ae, i // read_memory - //------------------------------------------------- -UINT8 p500_state::read_memory(address_space &space, offs_t offset, offs_t va, int ba, int ae) +uint8_t p500_state::read_memory(address_space &space, offs_t offset, offs_t va, int ba, int ae) { int srw = 1, busy2 = 1, refen = 0; @@ -852,7 +852,7 @@ UINT8 p500_state::read_memory(address_space &space, offs_t offset, offs_t va, in &csbank1, &csbank2, &csbank3, &basiclocs, &basichics, &kernalcs, &cs1, &sidcs, &extprtcs, &ciacs, &aciacs, &tript1cs, &tript2cs, &aec, &vsysaden); - UINT8 data = 0xff; + uint8_t data = 0xff; if (clrniben) { @@ -937,7 +937,7 @@ UINT8 p500_state::read_memory(address_space &space, offs_t offset, offs_t va, in // write_memory - //------------------------------------------------- -void p500_state::write_memory(address_space &space, offs_t offset, UINT8 data, int ba, int ae) +void p500_state::write_memory(address_space &space, offs_t offset, uint8_t data, int ba, int ae) { int srw = 0, busy2 = 1, refen = 0; offs_t va = 0xffff; @@ -1064,8 +1064,8 @@ READ8_MEMBER( p500_state::vic_videoram_r ) &csbank1, &csbank2, &csbank3, &basiclocs, &basichics, &kernalcs, &cs1, &sidcs, &extprtcs, &ciacs, &aciacs, &tript1cs, &tript2cs, &aec, &vsysaden); - UINT8 data = 0xff; -// UINT8 clrnib = 0xf; + uint8_t data = 0xff; +// uint8_t clrnib = 0xf; if (vsysaden) { @@ -1111,7 +1111,7 @@ READ8_MEMBER( p500_state::vic_colorram_r ) &csbank1, &csbank2, &csbank3, &basiclocs, &basichics, &kernalcs, &cs1, &sidcs, &extprtcs, &ciacs, &aciacs, &tript1cs, &tript2cs, &aec, &vsysaden); - UINT8 data = 0x0f; + uint8_t data = 0x0f; if (!clrnibcs) { @@ -1400,9 +1400,9 @@ MC6845_UPDATE_ROW( cbm2_state::crtc_update_row ) for (int column = 0; column < x_count; column++) { - UINT8 code = m_video_ram[(ma + column) & 0x7ff]; + uint8_t code = m_video_ram[(ma + column) & 0x7ff]; offs_t char_rom_addr = (ma & 0x1000) | (m_graphics << 11) | ((code & 0x7f) << 4) | (ra & 0x0f); - UINT8 data = m_charom->base()[char_rom_addr & 0xfff]; + uint8_t data = m_charom->base()[char_rom_addr & 0xfff]; for (int bit = 0; bit < 9; bit++) { @@ -1435,7 +1435,7 @@ WRITE_LINE_MEMBER( p500_state::vic_irq_w ) READ8_MEMBER( cbm2_state::sid_potx_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_cia_pa >> 6) { @@ -1462,7 +1462,7 @@ READ8_MEMBER( cbm2_state::sid_potx_r ) READ8_MEMBER( cbm2_state::sid_poty_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_cia_pa >> 6) { @@ -1523,7 +1523,7 @@ READ8_MEMBER( cbm2_state::tpi1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // IEEE-488 data |= m_ieee2->ren_r() << 2; @@ -1584,7 +1584,7 @@ READ8_MEMBER( cbm2_state::tpi1_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // IEEE-488 data |= m_ieee2->ifc_r(); @@ -1653,9 +1653,9 @@ WRITE_LINE_MEMBER( p500_state::tpi1_cb_w ) // tpi6525_interface tpi2_intf //------------------------------------------------- -UINT8 cbm2_state::read_keyboard() +uint8_t cbm2_state::read_keyboard() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(m_tpi2_pa, 0)) data &= m_pa[0]->read(); if (!BIT(m_tpi2_pa, 1)) data &= m_pa[1]->read(); @@ -1788,7 +1788,7 @@ READ8_MEMBER( cbm2_state::cia_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // IEEE-488 data |= m_ieee1->read(space, 0); @@ -1847,7 +1847,7 @@ READ8_MEMBER( cbm2_state::cia_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // joystick data |= m_joy1->joy_r() & 0x0f; @@ -1899,7 +1899,7 @@ READ8_MEMBER( cbm2_state::ext_tpi_pb_r ) */ - UINT8 data = 0xc0; + uint8_t data = 0xc0; // _BUSY1 data |= !m_busen1; @@ -1992,7 +1992,7 @@ READ8_MEMBER( cbm2_state::ext_cia_pb_r ) */ - UINT8 data = 0xc0; + uint8_t data = 0xc0; // _BUSY1 data |= !m_busen1; diff --git a/src/mame/drivers/cbuster.cpp b/src/mame/drivers/cbuster.cpp index 439daba0df7..3cf150aac11 100644 --- a/src/mame/drivers/cbuster.cpp +++ b/src/mame/drivers/cbuster.cpp @@ -575,8 +575,8 @@ ROM_END DRIVER_INIT_MEMBER(cbuster_state,twocrude) { - UINT8 *RAM = memregion("maincpu")->base(); - UINT8 *PTR; + uint8_t *RAM = memregion("maincpu")->base(); + uint8_t *PTR; int i, j; /* Main cpu decrypt */ diff --git a/src/mame/drivers/cc40.cpp b/src/mame/drivers/cc40.cpp index 3385d032ef9..d17b7ffca90 100644 --- a/src/mame/drivers/cc40.cpp +++ b/src/mame/drivers/cc40.cpp @@ -108,21 +108,21 @@ public: memory_region *m_cart_rom; - UINT8 m_bus_control; - UINT8 m_power; - UINT8 m_banks; - UINT8 m_clock_control; - UINT8 m_clock_divider; - UINT8 m_key_select; - - std::unique_ptr m_sysram[2]; - UINT16 m_sysram_size[2]; - UINT16 m_sysram_end[2]; - UINT16 m_sysram_mask[2]; + uint8_t m_bus_control; + uint8_t m_power; + uint8_t m_banks; + uint8_t m_clock_control; + uint8_t m_clock_divider; + uint8_t m_key_select; + + std::unique_ptr m_sysram[2]; + uint16_t m_sysram_size[2]; + uint16_t m_sysram_end[2]; + uint16_t m_sysram_mask[2]; void postload(); - void init_sysram(int chip, UINT16 size); - void update_lcd_indicator(UINT8 y, UINT8 x, int state); + void init_sysram(int chip, uint16_t size); + void update_lcd_indicator(uint8_t y, uint8_t x, int state); void update_clock_divider(); DECLARE_READ8_MEMBER(sysram_r); @@ -156,7 +156,7 @@ public: DEVICE_IMAGE_LOAD_MEMBER(cc40_state, cc40_cartridge) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); // max size is 4*32KB if (size > 0x20000) @@ -186,7 +186,7 @@ PALETTE_INIT_MEMBER(cc40_state, cc40) palette.set_pen_color(2, rgb_t(131, 136, 139)); // lcd pixel off } -void cc40_state::update_lcd_indicator(UINT8 y, UINT8 x, int state) +void cc40_state::update_lcd_indicator(uint8_t y, uint8_t x, int state) { // reference _________________... // output# |10 11 12 13 14 0 1 2 3 4 @@ -336,7 +336,7 @@ WRITE8_MEMBER(cc40_state::clock_control_w) READ8_MEMBER(cc40_state::keyboard_r) { - UINT8 ret = 0; + uint8_t ret = 0; // read selected keyboard rows for (int i = 0; i < 8; i++) @@ -510,12 +510,12 @@ void cc40_state::machine_reset() bankswitch_w(space, 0, 0); } -void cc40_state::init_sysram(int chip, UINT16 size) +void cc40_state::init_sysram(int chip, uint16_t size) { if (m_sysram[chip] == nullptr) { // init to largest possible - m_sysram[chip] = std::make_unique(0x2000); + m_sysram[chip] = std::make_unique(0x2000); save_pointer(NAME(m_sysram[chip].get()), 0x2000, chip); save_item(NAME(m_sysram_size[chip]), chip); diff --git a/src/mame/drivers/cchance.cpp b/src/mame/drivers/cchance.cpp index 184ef938fb4..dddb53baa04 100644 --- a/src/mame/drivers/cchance.cpp +++ b/src/mame/drivers/cchance.cpp @@ -45,8 +45,8 @@ public: cchance_state(const machine_config &mconfig, device_type type, const char *tag) : tnzs_state(mconfig, type, tag) { } - UINT8 m_hop_io; - UINT8 m_bell_io; + uint8_t m_hop_io; + uint8_t m_bell_io; DECLARE_WRITE8_MEMBER(output_0_w); DECLARE_READ8_MEMBER(input_1_r); DECLARE_WRITE8_MEMBER(output_1_w); diff --git a/src/mame/drivers/cclimber.cpp b/src/mame/drivers/cclimber.cpp index fa265a400f7..79d17c18954 100644 --- a/src/mame/drivers/cclimber.cpp +++ b/src/mame/drivers/cclimber.cpp @@ -2584,7 +2584,7 @@ DRIVER_INIT_MEMBER(cclimber_state,yamato) DRIVER_INIT_MEMBER(cclimber_state,toprollr) { - m_opcodes = std::make_unique(0x6000*3); + m_opcodes = std::make_unique(0x6000*3); segacrpt_z80_device* cpu = (segacrpt_z80_device*)machine().device(":maincpu"); @@ -2610,7 +2610,7 @@ DRIVER_INIT_MEMBER(cclimber_state,toprollr) DRIVER_INIT_MEMBER(cclimber_state,dking) { - UINT8 *rom = memregion( "maincpu" )->base(); + uint8_t *rom = memregion( "maincpu" )->base(); int i; int j; @@ -2624,7 +2624,7 @@ DRIVER_INIT_MEMBER(cclimber_state,dking) DRIVER_INIT_MEMBER(cclimber_state,rpatrol) { - UINT8 *rom = memregion( "maincpu" )->base(); + uint8_t *rom = memregion( "maincpu" )->base(); /* Bits are inverted */ for (int i = 0x0000; i < 0x5000; i++) diff --git a/src/mame/drivers/ccs2810.cpp b/src/mame/drivers/ccs2810.cpp index fe6f2f09974..f9dc670b051 100644 --- a/src/mame/drivers/ccs2810.cpp +++ b/src/mame/drivers/ccs2810.cpp @@ -94,12 +94,12 @@ public: DECLARE_WRITE8_MEMBER(port40_w); DECLARE_WRITE8_MEMBER(kbd_put); private: - UINT8 m_term_data; - UINT8 m_26_count; + uint8_t m_term_data; + uint8_t m_26_count; bool m_ss; bool m_dden; bool m_dsize; - UINT8 m_ds; + uint8_t m_ds; floppy_image_device *m_floppy; required_device m_maincpu; required_device m_terminal; @@ -146,7 +146,7 @@ INPUT_PORTS_END //************************************* READ8_MEMBER( ccs_state::port20_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -203,8 +203,8 @@ d7 : drq READ8_MEMBER( ccs_state::port34_r ) { - //return (UINT8)m_drq | (m_ds << 1) | ((UINT8)fdc->hld_r() << 5) | 0x40 | ((UINT8)m_intrq << 7); - return (UINT8)m_fdc->drq_r() | (m_ds << 1) | 0x20 | 0x40 | ((UINT8)m_fdc->intrq_r() << 7); // hld_r doesn't do anything + //return (uint8_t)m_drq | (m_ds << 1) | ((uint8_t)fdc->hld_r() << 5) | 0x40 | ((uint8_t)m_intrq << 7); + return (uint8_t)m_fdc->drq_r() | (m_ds << 1) | 0x20 | 0x40 | ((uint8_t)m_fdc->intrq_r() << 7); // hld_r doesn't do anything } /* Status 2 @@ -229,8 +229,8 @@ READ8_MEMBER( ccs_state::port04_r ) idx = m_floppy->idx_r()^1; dside = m_floppy->twosid_r(); } - return (UINT8)trk00 | 0 | ((UINT8)wprt << 2) | ((UINT8)m_ss << 3) | - idx << 4 | ((UINT8)m_dden << 5) | ((UINT8)dside << 6) | ((UINT8)m_fdc->drq_r() << 7); + return (uint8_t)trk00 | 0 | ((uint8_t)wprt << 2) | ((uint8_t)m_ss << 3) | + idx << 4 | ((uint8_t)m_dden << 5) | ((uint8_t)dside << 6) | ((uint8_t)m_fdc->drq_r() << 7); } /* Control 1 @@ -297,7 +297,7 @@ MACHINE_RESET_MEMBER( ccs_state, ccs ) DRIVER_INIT_MEMBER( ccs_state, ccs2810 ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x10000]); @@ -306,7 +306,7 @@ DRIVER_INIT_MEMBER( ccs_state, ccs2810 ) DRIVER_INIT_MEMBER( ccs_state, ccs2422 ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x10000]); diff --git a/src/mame/drivers/ccs300.cpp b/src/mame/drivers/ccs300.cpp index a0842350bd2..7dc4c42788a 100644 --- a/src/mame/drivers/ccs300.cpp +++ b/src/mame/drivers/ccs300.cpp @@ -43,7 +43,7 @@ public: DECLARE_WRITE8_MEMBER(port40_w); DECLARE_WRITE8_MEMBER(kbd_put); private: - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; required_device m_terminal; }; @@ -73,7 +73,7 @@ INPUT_PORTS_END //************************************* READ8_MEMBER( ccs300_state::port10_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -111,7 +111,7 @@ MACHINE_RESET_MEMBER( ccs300_state, ccs300 ) DRIVER_INIT_MEMBER( ccs300_state, ccs300 ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x10000]); diff --git a/src/mame/drivers/cd2650.cpp b/src/mame/drivers/cd2650.cpp index a9da4aaa250..eac2095ee6c 100644 --- a/src/mame/drivers/cd2650.cpp +++ b/src/mame/drivers/cd2650.cpp @@ -56,12 +56,12 @@ public: DECLARE_READ8_MEMBER(cass_r); DECLARE_WRITE_LINE_MEMBER(cass_w); DECLARE_QUICKLOAD_LOAD_MEMBER(cd2650); - const UINT8 *m_p_chargen; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; virtual void video_start() override; required_device m_maincpu; @@ -88,7 +88,7 @@ READ8_MEMBER( cd2650_state::cass_r ) READ8_MEMBER( cd2650_state::keyin_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = ret | 0x80; return ret; } @@ -122,22 +122,22 @@ void cd2650_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 cd2650_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cd2650_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* The video is unusual in that the characters in each line are spaced at 16 bytes in memory, thus line 1 starts at 1000, line 2 at 1001, etc. There are 16 lines of 80 characters. Further, the letters have bit 6 set low, thus the range is 01 to 1A. When the bottom of the screen is reached, it does not scroll, it just wraps around. */ - UINT16 offset = 0; - UINT8 y,ra,chr,gfx; - UINT16 sy=0,x,mem; + uint16_t offset = 0; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,x,mem; for (y = 0; y < 16; y++) { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = 0; x < 80; x++) { @@ -212,7 +212,7 @@ QUICKLOAD_LOAD_MEMBER( cd2650_state, cd2650 ) } else { - std::vector quick_data(quick_length); + std::vector quick_data(quick_length); int read_ = image.fread( &quick_data[0], quick_length); if (read_ != quick_length) { diff --git a/src/mame/drivers/cdc721.cpp b/src/mame/drivers/cdc721.cpp index 497ba6d5a68..3a50cd3e83e 100644 --- a/src/mame/drivers/cdc721.cpp +++ b/src/mame/drivers/cdc721.cpp @@ -25,9 +25,9 @@ public: public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(cdc721); - const UINT8 *m_p_chargen; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; private: required_device m_maincpu; @@ -78,16 +78,16 @@ PALETTE_INIT_MEMBER( cdc721_state, cdc721 ) palette.set_pen_color(2, 0, 128, 0 ); /* Dimmed */ } -UINT32 cdc721_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cdc721_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for (y = 0; y < 24; y++) { for (ra = 3; ra < 13; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = 0; x < 160; x+=2) { diff --git a/src/mame/drivers/cdi.cpp b/src/mame/drivers/cdi.cpp index 0ed78ba75e0..0b2e23a1031 100644 --- a/src/mame/drivers/cdi.cpp +++ b/src/mame/drivers/cdi.cpp @@ -177,7 +177,7 @@ INPUT_CHANGED_MEMBER(cdi_state::mcu_input) if(send) { - UINT8 data = (UINT8)((uintptr_t)param & 0x000000ff); + uint8_t data = (uint8_t)((uintptr_t)param & 0x000000ff); m_scc->quizard_rx(data); } } @@ -293,8 +293,8 @@ INTERRUPT_GEN_MEMBER( cdi_state::mcu_frame ) MACHINE_RESET_MEMBER( cdi_state, cdimono1 ) { - UINT16 *src = (UINT16*)memregion("maincpu")->base(); - UINT16 *dst = m_planea; + uint16_t *src = (uint16_t*)memregion("maincpu")->base(); + uint16_t *dst = m_planea; memcpy(dst, src, 0x8); memset(m_servo_io_regs, 0, 0x20); memset(m_slave_io_regs, 0, 0x20); @@ -307,8 +307,8 @@ MACHINE_RESET_MEMBER( cdi_state, cdimono1 ) MACHINE_RESET_MEMBER( cdi_state, cdimono2 ) { - UINT16 *src = (UINT16*)memregion("maincpu")->base(); - UINT16 *dst = m_planea; + uint16_t *src = (uint16_t*)memregion("maincpu")->base(); + uint16_t *dst = m_planea; memcpy(dst, src, 0x8); m_maincpu->reset(); @@ -422,7 +422,7 @@ READ8_MEMBER( cdi_state::servo_io_r ) return 0; } - UINT8 ret = m_servo_io_regs[offset]; + uint8_t ret = m_servo_io_regs[offset]; switch(offset) { @@ -493,28 +493,28 @@ READ8_MEMBER( cdi_state::servo_io_r ) break; case m68hc05eg_io_reg_t::COUNT_HI: { - const UINT16 count = (m_servo->total_cycles() / 4) & 0x0000ffff; + const uint16_t count = (m_servo->total_cycles() / 4) & 0x0000ffff; ret = count >> 8; verboselog(*this, 1, "SERVO Count Hi read (%02x)\n", ret); break; } case m68hc05eg_io_reg_t::COUNT_LO: { - const UINT16 count = (m_servo->total_cycles() / 4) & 0x0000ffff; + const uint16_t count = (m_servo->total_cycles() / 4) & 0x0000ffff; ret = count & 0x00ff; verboselog(*this, 1, "SERVO Count Lo read (%02x)\n", ret); break; } case m68hc05eg_io_reg_t::ACOUNT_HI: { - const UINT16 count = (m_servo->total_cycles() / 4) & 0x0000ffff; + const uint16_t count = (m_servo->total_cycles() / 4) & 0x0000ffff; ret = count >> 8; verboselog(*this, 1, "SERVO Alternate Count Hi read (%02x)\n", ret); break; } case m68hc05eg_io_reg_t::ACOUNT_LO: { - const UINT16 count = (m_servo->total_cycles() / 4) & 0x0000ffff; + const uint16_t count = (m_servo->total_cycles() / 4) & 0x0000ffff; ret = count & 0x00ff; verboselog(*this, 1, "SERVO Alternate Count Lo read (%02x)\n", ret); break; @@ -622,7 +622,7 @@ READ8_MEMBER( cdi_state::slave_io_r ) return 0; } - UINT8 ret = m_slave_io_regs[offset]; + uint8_t ret = m_slave_io_regs[offset]; switch(offset) { @@ -691,28 +691,28 @@ READ8_MEMBER( cdi_state::slave_io_r ) break; case m68hc05eg_io_reg_t::COUNT_HI: { - const UINT16 count = (m_slave->total_cycles() / 4) & 0x0000ffff; + const uint16_t count = (m_slave->total_cycles() / 4) & 0x0000ffff; ret = count >> 8; verboselog(*this, 1, "SLAVE Count Hi read (%02x)\n", ret); break; } case m68hc05eg_io_reg_t::COUNT_LO: { - const UINT16 count = (m_slave->total_cycles() / 4) & 0x0000ffff; + const uint16_t count = (m_slave->total_cycles() / 4) & 0x0000ffff; ret = count & 0x00ff; verboselog(*this, 1, "SLAVE Count Lo read (%02x)\n", ret); break; } case m68hc05eg_io_reg_t::ACOUNT_HI: { - const UINT16 count = (m_slave->total_cycles() / 4) & 0x0000ffff; + const uint16_t count = (m_slave->total_cycles() / 4) & 0x0000ffff; ret = count >> 8; verboselog(*this, 1, "SLAVE Alternate Count Hi read (%02x)\n", ret); break; } case m68hc05eg_io_reg_t::ACOUNT_LO: { - const UINT16 count = (m_slave->total_cycles() / 4) & 0x0000ffff; + const uint16_t count = (m_slave->total_cycles() / 4) & 0x0000ffff; ret = count & 0x00ff; verboselog(*this, 1, "SLAVE Alternate Count Lo read (%02x)\n", ret); break; diff --git a/src/mame/drivers/cedar_magnet.cpp b/src/mame/drivers/cedar_magnet.cpp index fe4617278ab..94f780e7be0 100644 --- a/src/mame/drivers/cedar_magnet.cpp +++ b/src/mame/drivers/cedar_magnet.cpp @@ -242,7 +242,7 @@ WRITE8_MEMBER(cedar_magnet_state::port18_w) READ8_MEMBER(cedar_magnet_state::port19_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; // printf("%s: port19_r\n", device().machine().describe_context()); // 9496 in a,($19) @@ -299,7 +299,7 @@ WRITE8_MEMBER(cedar_magnet_state::palette_b_w) set_palette(offset); } -UINT32 cedar_magnet_state::screen_update_cedar_magnet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cedar_magnet_state::screen_update_cedar_magnet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -341,7 +341,7 @@ READ8_MEMBER(cedar_magnet_state::other_cpu_r) int unk2 = (m_ic49_pio_pb_val & 0x03) >> 0; int cpus_accessed = 0; - UINT8 ret = 0x00; + uint8_t ret = 0x00; int offset2 = offset + windowbank * 0x4000; @@ -451,7 +451,7 @@ void cedar_magnet_state::handle_sub_board_cpu_lines(cedar_magnet_board_device* d READ8_MEMBER( cedar_magnet_state::ic48_pio_pa_r ) // 0x20 { - UINT8 ret = m_ic48_pio_pa_val & ~0x08; + uint8_t ret = m_ic48_pio_pa_val & ~0x08; ret |= ioport("COIN1")->read()<<3; if (!m_cedplane0->is_running()) ret &= ~0x01; @@ -493,7 +493,7 @@ WRITE8_MEMBER( cedar_magnet_state::ic48_pio_pa_w ) // 0x20 READ8_MEMBER( cedar_magnet_state::ic48_pio_pb_r ) // 0x22 { - UINT8 ret = m_ic48_pio_pb_val & ~0x80; + uint8_t ret = m_ic48_pio_pb_val & ~0x80; ret |= ioport("COIN2")->read()<<7; @@ -539,7 +539,7 @@ WRITE8_MEMBER(cedar_magnet_state::ic48_pio_pb_w) // 0x22 READ8_MEMBER( cedar_magnet_state::ic49_pio_pb_r ) // 0x42 { - UINT8 ret = m_ic49_pio_pb_val; + uint8_t ret = m_ic49_pio_pb_val; if (!m_cedsound->is_running()) ret &= ~0x10; @@ -751,7 +751,7 @@ ROM_END */ -void protection_hack(UINT8* ram, int address1, int address2) +void protection_hack(uint8_t* ram, int address1, int address2) { if ((ram[address1] == 0x3e) && (ram[address1+1] == 0xff)) ram[address1] = 0xc9; if ((ram[address2] == 0x3e) && (ram[address2+1] == 0xff)) ram[address2] = 0xc9; diff --git a/src/mame/drivers/cedar_magnet.h b/src/mame/drivers/cedar_magnet.h index feaa610889c..cef9b79711c 100644 --- a/src/mame/drivers/cedar_magnet.h +++ b/src/mame/drivers/cedar_magnet.h @@ -54,10 +54,10 @@ public: required_device m_sub_ram_bankdev; required_device m_sub_pal_bankdev; - required_shared_ptr m_ram0; - required_shared_ptr m_pal_r; - required_shared_ptr m_pal_g; - required_shared_ptr m_pal_b; + required_shared_ptr m_ram0; + required_shared_ptr m_pal_r; + required_shared_ptr m_pal_g; + required_shared_ptr m_pal_b; required_device m_ic48_pio; required_device m_ic49_pio; @@ -89,17 +89,17 @@ public: // other ports DECLARE_WRITE8_MEMBER(soundlatch_w); - UINT8 portff_data; + uint8_t portff_data; DECLARE_READ8_MEMBER(other_cpu_r); DECLARE_WRITE8_MEMBER(other_cpu_w); - UINT8 m_paladdr; + uint8_t m_paladdr; int m_palbank; - UINT8 m_ic48_pio_pa_val; - UINT8 m_ic48_pio_pb_val; - UINT8 m_ic49_pio_pb_val; + uint8_t m_ic48_pio_pa_val; + uint8_t m_ic48_pio_pb_val; + uint8_t m_ic49_pio_pb_val; void set_palette(int offset); DECLARE_WRITE8_MEMBER(palette_r_w); @@ -113,7 +113,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cedar_magnet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cedar_magnet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_palette; required_device m_maincpu; diff --git a/src/mame/drivers/cedar_magnet_board.cpp b/src/mame/drivers/cedar_magnet_board.cpp index 3b95fcc384c..0a7c8bd7b6f 100644 --- a/src/mame/drivers/cedar_magnet_board.cpp +++ b/src/mame/drivers/cedar_magnet_board.cpp @@ -8,7 +8,7 @@ //const device_type CEDAR_MAGNET_BASE = &device_creator; -cedar_magnet_board_device::cedar_magnet_board_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) +cedar_magnet_board_device::cedar_magnet_board_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_ram(*this, "ram") { @@ -23,14 +23,14 @@ void cedar_magnet_board_device::device_start() { } -void cedar_magnet_board_device::write_cpu_bus(int offset, UINT8 data) +void cedar_magnet_board_device::write_cpu_bus(int offset, uint8_t data) { device_t* cpu = m_cpu; address_space& ap = cpu->memory().space(AS_PROGRAM); ap.write_byte(offset, data); } -UINT8 cedar_magnet_board_device::read_cpu_bus(int offset) +uint8_t cedar_magnet_board_device::read_cpu_bus(int offset) { device_t* cpu = m_cpu; address_space& ap = cpu->memory().space(AS_PROGRAM); diff --git a/src/mame/drivers/cedar_magnet_board.h b/src/mame/drivers/cedar_magnet_board.h index 2d04f8a156c..73472612ca4 100644 --- a/src/mame/drivers/cedar_magnet_board.h +++ b/src/mame/drivers/cedar_magnet_board.h @@ -18,13 +18,13 @@ class cedar_magnet_board_device : public device_t { public: // construction/destruction - cedar_magnet_board_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); + cedar_magnet_board_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); - UINT8* m_ram; + uint8_t* m_ram; z80_device* m_cpu; - virtual UINT8 read_cpu_bus(int offset); - virtual void write_cpu_bus(int offset, UINT8 data); + virtual uint8_t read_cpu_bus(int offset); + virtual void write_cpu_bus(int offset, uint8_t data); TIMER_CALLBACK_MEMBER(halt_assert_callback); TIMER_CALLBACK_MEMBER(halt_clear_callback); diff --git a/src/mame/drivers/cedar_magnet_flop.cpp b/src/mame/drivers/cedar_magnet_flop.cpp index 7d4bdd8d42c..39ca65b6d37 100644 --- a/src/mame/drivers/cedar_magnet_flop.cpp +++ b/src/mame/drivers/cedar_magnet_flop.cpp @@ -10,7 +10,7 @@ extern const device_type CEDAR_MAGNET_FLOP = &device_creator; -cedar_magnet_flop_device::cedar_magnet_flop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cedar_magnet_flop_device::cedar_magnet_flop_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CEDAR_MAGNET_FLOP, "Cedar Floppy Simulation", tag, owner, clock, "cedmag_flop", __FILE__) { } @@ -41,25 +41,25 @@ void cedar_magnet_flop_device::device_reset() READ8_MEMBER(cedar_magnet_flop_device::port60_r) { - UINT8 ret = m_flopstat; + uint8_t ret = m_flopstat; return ret; } READ8_MEMBER(cedar_magnet_flop_device::port61_r) { - UINT8 ret = m_curtrack; + uint8_t ret = m_curtrack; return ret; } READ8_MEMBER(cedar_magnet_flop_device::port63_r) { - UINT8 ret = rand(); + uint8_t ret = rand(); // printf("%s: port63_r (DATA) (%02x)\n", device().machine().describe_context(), ret); if ((m_flopcmd&0xf0) == 0x90) // reading data { - UINT8 *flop = memregion("disk")->base(); + uint8_t *flop = memregion("disk")->base(); int side = (m_flopcmd & 0x02)>>1; int read_offset_base = (m_flopsec * 0x400) + (m_curtrack * 0x3000) + (side * 0x1800); @@ -172,7 +172,7 @@ WRITE8_MEMBER(cedar_magnet_flop_device::port63_w) if ((m_flopcmd & 0xf0) == 0xb0) // writing data { - UINT8 *flop = memregion("disk")->base(); + uint8_t *flop = memregion("disk")->base(); int side = (m_flopcmd & 0x02)>>1; int read_offset_base = (m_flopsec * 0x400) + (m_curtrack * 0x3000) + (side * 0x1800); diff --git a/src/mame/drivers/cedar_magnet_flop.h b/src/mame/drivers/cedar_magnet_flop.h index 7ff44b40947..c73f8f6e031 100644 --- a/src/mame/drivers/cedar_magnet_flop.h +++ b/src/mame/drivers/cedar_magnet_flop.h @@ -17,15 +17,15 @@ class cedar_magnet_flop_device : public device_t { public: // construction/destruction - cedar_magnet_flop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cedar_magnet_flop_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT8 m_flopdat; - UINT8 m_flopcmd; - UINT8 m_flopsec; - UINT8 m_flopstat; - UINT8 m_floptrk; + uint8_t m_flopdat; + uint8_t m_flopcmd; + uint8_t m_flopsec; + uint8_t m_flopstat; + uint8_t m_floptrk; - UINT8 m_curtrack; + uint8_t m_curtrack; int m_secoffs; DECLARE_READ8_MEMBER(port60_r); diff --git a/src/mame/drivers/cedar_magnet_plane.cpp b/src/mame/drivers/cedar_magnet_plane.cpp index ffa92d03643..5f969bdd4b3 100644 --- a/src/mame/drivers/cedar_magnet_plane.cpp +++ b/src/mame/drivers/cedar_magnet_plane.cpp @@ -9,7 +9,7 @@ extern const device_type CEDAR_MAGNET_PLANE = &device_creator; -cedar_magnet_plane_device::cedar_magnet_plane_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cedar_magnet_plane_device::cedar_magnet_plane_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cedar_magnet_board_device(mconfig, CEDAR_MAGNET_PLANE, "Cedar Plane", tag, owner, clock, "cedmag_plane", __FILE__) { } @@ -134,11 +134,11 @@ machine_config_constructor cedar_magnet_plane_device::device_mconfig_additions() void cedar_magnet_plane_device::device_start() { m_cpu = subdevice("planecpu"); - m_ram = (UINT8*)memshare("ram")->ptr(); + m_ram = (uint8_t*)memshare("ram")->ptr(); save_item(NAME(m_framebuffer)); } -UINT32 cedar_magnet_plane_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palbase) +uint32_t cedar_magnet_plane_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palbase) { int count = 0; @@ -147,11 +147,11 @@ UINT32 cedar_magnet_plane_device::draw(screen_device &screen, bitmap_ind16 &bitm for (int y = 0;y < 256;y++) { - UINT16 *dst = &bitmap.pix16((y-m_scrolly)&0xff); + uint16_t *dst = &bitmap.pix16((y-m_scrolly)&0xff); for (int x = 0; x < 256;x++) { - UINT8 pix = m_framebuffer[count]; + uint8_t pix = m_framebuffer[count]; count++; if (pix) dst[(x-m_scrollx)&0xff] = pix + palbase*0x100; diff --git a/src/mame/drivers/cedar_magnet_plane.h b/src/mame/drivers/cedar_magnet_plane.h index fe5c481aa7d..6809da2b38a 100644 --- a/src/mame/drivers/cedar_magnet_plane.h +++ b/src/mame/drivers/cedar_magnet_plane.h @@ -18,7 +18,7 @@ class cedar_magnet_plane_device : public cedar_magnet_board_device { public: // construction/destruction - cedar_magnet_plane_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cedar_magnet_plane_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(pio0_pa_r); DECLARE_WRITE8_MEMBER(pio0_pa_w); @@ -35,19 +35,19 @@ public: DECLARE_WRITE8_MEMBER(plane_portce_w); DECLARE_WRITE8_MEMBER(plane_portcf_w); - UINT8 m_framebuffer[0x10000]; + uint8_t m_framebuffer[0x10000]; int m_curline; int m_lineoffset; - UINT8 m_pio0_pa_data; - UINT8 m_pio0_pb_data; - UINT8 m_scrollx; - UINT8 m_scrolly; + uint8_t m_pio0_pa_data; + uint8_t m_pio0_pb_data; + uint8_t m_scrollx; + uint8_t m_scrolly; int m_direction; - UINT8 m_cd_data; - UINT8 m_cf_data; - UINT32 draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palbase); + uint8_t m_cd_data; + uint8_t m_cf_data; + uint32_t draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palbase); protected: virtual machine_config_constructor device_mconfig_additions() const override; virtual void device_start() override; diff --git a/src/mame/drivers/cedar_magnet_sound.cpp b/src/mame/drivers/cedar_magnet_sound.cpp index a155762f13c..dac7928c81b 100644 --- a/src/mame/drivers/cedar_magnet_sound.cpp +++ b/src/mame/drivers/cedar_magnet_sound.cpp @@ -12,7 +12,7 @@ extern const device_type CEDAR_MAGNET_SOUND = &device_creator; -cedar_magnet_sound_device::cedar_magnet_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cedar_magnet_sound_device::cedar_magnet_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cedar_magnet_board_device(mconfig, CEDAR_MAGNET_SOUND, "Cedar Sound", tag, owner, clock, "cedmag_sound", __FILE__), m_ctc0(*this, "ctc0"), m_ctc1(*this, "ctc1") @@ -22,12 +22,12 @@ cedar_magnet_sound_device::cedar_magnet_sound_device(const machine_config &mconf READ8_MEMBER(cedar_magnet_sound_device::top_port14_r) { -// UINT8 ret = m_command; +// uint8_t ret = m_command; // m_command = 0; return rand(); } -void cedar_magnet_sound_device::write_command(UINT8 data) +void cedar_magnet_sound_device::write_command(uint8_t data) { m_command = data; m_cpu->set_input_line(0, HOLD_LINE); @@ -158,7 +158,7 @@ machine_config_constructor cedar_magnet_sound_device::device_mconfig_additions() void cedar_magnet_sound_device::device_start() { m_cpu = subdevice("topcpu"); - m_ram = (UINT8*)memshare("ram")->ptr(); + m_ram = (uint8_t*)memshare("ram")->ptr(); } void cedar_magnet_sound_device::device_reset() diff --git a/src/mame/drivers/cedar_magnet_sound.h b/src/mame/drivers/cedar_magnet_sound.h index 909482ab059..6e43637ccea 100644 --- a/src/mame/drivers/cedar_magnet_sound.h +++ b/src/mame/drivers/cedar_magnet_sound.h @@ -23,15 +23,15 @@ class cedar_magnet_sound_device : public cedar_magnet_board_device { public: // construction/destruction - cedar_magnet_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cedar_magnet_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); required_device m_ctc0; required_device m_ctc1; DECLARE_READ8_MEMBER(top_port14_r); - void write_command(UINT8 data); - UINT8 m_command; + void write_command(uint8_t data); + uint8_t m_command; DECLARE_WRITE_LINE_MEMBER(ctc1_z0_w); DECLARE_WRITE_LINE_MEMBER(ctc1_z1_w); diff --git a/src/mame/drivers/cedar_magnet_sprite.cpp b/src/mame/drivers/cedar_magnet_sprite.cpp index e79b83faf84..9c94c30d0b5 100644 --- a/src/mame/drivers/cedar_magnet_sprite.cpp +++ b/src/mame/drivers/cedar_magnet_sprite.cpp @@ -13,7 +13,7 @@ extern const device_type CEDAR_MAGNET_SPRITE = &device_creator; -cedar_magnet_sprite_device::cedar_magnet_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cedar_magnet_sprite_device::cedar_magnet_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cedar_magnet_board_device(mconfig, CEDAR_MAGNET_SPRITE, "Cedar Sprite", tag, owner, clock, "cedmag_sprite", __FILE__), m_sprite_ram_bankdev(*this, "sp_sub_ram"), m_pio0(*this, "z80pio0"), @@ -113,7 +113,7 @@ void cedar_magnet_sprite_device::do_blit() int xpos = (m_loweraddr + x); int ypos = (m_upperaddr + y); - UINT8 data = m_ram[source + ((m_uppersprite & 0x3) * 0x10000)]; + uint8_t data = m_ram[source + ((m_uppersprite & 0x3) * 0x10000)]; if (!(pio0_pb_data & 0x02)) data = rand(); @@ -294,7 +294,7 @@ machine_config_constructor cedar_magnet_sprite_device::device_mconfig_additions( void cedar_magnet_sprite_device::device_start() { m_cpu = subdevice("spritecpu"); - m_ram = (UINT8*)memshare("ram")->ptr(); + m_ram = (uint8_t*)memshare("ram")->ptr(); } @@ -307,13 +307,13 @@ void cedar_magnet_sprite_device::device_reset() m_spritesize = 0xff; } -UINT32 cedar_magnet_sprite_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palbase) +uint32_t cedar_magnet_sprite_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palbase) { // printf("-----------------------------------------------------------------------------------------------------------\n"); // printf("--------------------------------------------- FRAME -------------------------------------------------------\n"); // printf("-----------------------------------------------------------------------------------------------------------\n"); - UINT8* mem = m_framebuffer; + uint8_t* mem = m_framebuffer; int count = 0; // if (!(m_m_spritesize & 0x40)) @@ -321,11 +321,11 @@ UINT32 cedar_magnet_sprite_device::draw(screen_device &screen, bitmap_ind16 &bit for (int y = 0;y < 256;y++) { - UINT16 *dst = &bitmap.pix16((y)&0xff); + uint16_t *dst = &bitmap.pix16((y)&0xff); for (int x = 0; x < 256;x++) { - UINT8 pix = mem[count]; + uint8_t pix = mem[count]; count++; if (pix) dst[(x)&0xff] = pix + palbase*0x100; diff --git a/src/mame/drivers/cedar_magnet_sprite.h b/src/mame/drivers/cedar_magnet_sprite.h index 52eeb88c042..3aa2b98df2d 100644 --- a/src/mame/drivers/cedar_magnet_sprite.h +++ b/src/mame/drivers/cedar_magnet_sprite.h @@ -22,10 +22,10 @@ class cedar_magnet_sprite_device : public cedar_magnet_board_device { public: // construction/destruction - cedar_magnet_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cedar_magnet_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - UINT8 m_framebuffer[0x10000]; - UINT8 pio2_pb_data; + uint8_t m_framebuffer[0x10000]; + uint8_t pio2_pb_data; required_device m_sprite_ram_bankdev; @@ -52,18 +52,18 @@ public: DECLARE_READ8_MEMBER(exzisus_hack_r); - UINT8 m_upperaddr; - UINT8 m_loweraddr; + uint8_t m_upperaddr; + uint8_t m_loweraddr; void do_blit(); - UINT8 m_spritesize; - UINT8 pio0_pb_data; - UINT8 m_spritecodelow; - UINT8 m_spritecodehigh; + uint8_t m_spritesize; + uint8_t pio0_pb_data; + uint8_t m_spritecodelow; + uint8_t m_spritecodehigh; int m_high_write; - UINT8 m_uppersprite; + uint8_t m_uppersprite; INTERRUPT_GEN_MEMBER(irq); @@ -71,7 +71,7 @@ public: required_device m_pio1; required_device m_pio2; - UINT32 draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palbase); + uint32_t draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palbase); protected: virtual machine_config_constructor device_mconfig_additions() const override; virtual void device_start() override; diff --git a/src/mame/drivers/centiped.cpp b/src/mame/drivers/centiped.cpp index f34a7c182ae..034f9abdeac 100644 --- a/src/mame/drivers/centiped.cpp +++ b/src/mame/drivers/centiped.cpp @@ -502,7 +502,7 @@ WRITE8_MEMBER(centiped_state::irq_ack_w) inline int centiped_state::read_trackball(int idx, int switch_port) { - UINT8 newpos; + uint8_t newpos; static const char *const portnames[] = { "IN0", "IN1", "IN2" }; static const char *const tracknames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" }; @@ -546,7 +546,7 @@ READ8_MEMBER(centiped_state::milliped_IN1_r) READ8_MEMBER(centiped_state::milliped_IN2_r) { - UINT8 data = ioport("IN2")->read(); + uint8_t data = ioport("IN2")->read(); /* MSH - 15 Feb, 2007 * The P2 X Joystick inputs are not properly handled in @@ -558,7 +558,7 @@ READ8_MEMBER(centiped_state::milliped_IN2_r) if (m_control_select != 0) { /* Bottom 4 bits is our joystick inputs */ - UINT8 joy2data = ioport("IN3")->read() & 0x0f; + uint8_t joy2data = ioport("IN3")->read() & 0x0f; data = data & 0xf0; /* Keep the top 4 bits */ data |= (joy2data & 0x0a) >> 1; /* flip left and up */ data |= (joy2data & 0x05) << 1; /* flip right and down */ @@ -2168,8 +2168,8 @@ DRIVER_INIT_MEMBER(centiped_state,bullsdrt) DRIVER_INIT_MEMBER(centiped_state,multiped) { - UINT8 *src = memregion("user1")->base(); - UINT8 *dest = memregion("maincpu")->base(); + uint8_t *src = memregion("user1")->base(); + uint8_t *dest = memregion("maincpu")->base(); // descramble rom and put in maincpu region for (int i = 0; i < 0x10000; i++) diff --git a/src/mame/drivers/cesclass.cpp b/src/mame/drivers/cesclass.cpp index 73622bdbc43..7897f551c1c 100644 --- a/src/mame/drivers/cesclass.cpp +++ b/src/mame/drivers/cesclass.cpp @@ -44,7 +44,7 @@ public: DECLARE_WRITE16_MEMBER(outputs_w); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_PALETTE_INIT(cesclassic); protected: @@ -52,7 +52,7 @@ protected: required_device m_maincpu; required_device m_oki; - required_shared_ptr m_vram; + required_shared_ptr m_vram; required_device m_palette; // driver_device overrides virtual void video_start() override; @@ -64,7 +64,7 @@ void cesclassic_state::video_start() { } -UINT32 cesclassic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cesclassic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,xi; @@ -77,7 +77,7 @@ UINT32 cesclassic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm { for(xi=0;xi<16;xi++) { - UINT8 color; + uint8_t color; color = (((m_vram[x+y*16+0x400])>>(15-xi)) & 1); color |= (((m_vram[x+y*16])>>(15-xi)) & 1)<<1; diff --git a/src/mame/drivers/cfx9850.cpp b/src/mame/drivers/cfx9850.cpp index 0694dd5dc14..a3a74af5640 100644 --- a/src/mame/drivers/cfx9850.cpp +++ b/src/mame/drivers/cfx9850.cpp @@ -48,11 +48,11 @@ public: DECLARE_WRITE8_MEMBER(cfx9850_koh_w); DECLARE_READ8_MEMBER(cfx9850_ki_r); DECLARE_READ8_MEMBER(cfx9850_battery_level_r); - required_shared_ptr m_video_ram; - required_shared_ptr m_display_ram; - UINT16 m_ko; /* KO lines KO1 - KO14 */ + required_shared_ptr m_video_ram; + required_shared_ptr m_display_ram; + uint16_t m_ko; /* KO lines KO1 - KO14 */ DECLARE_PALETTE_INIT(cfx9850); - UINT32 screen_update_cfx9850(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cfx9850(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: required_ioport m_ko1; @@ -96,7 +96,7 @@ WRITE8_MEMBER( cfx9850_state::cfx9850_koh_w ) READ8_MEMBER( cfx9850_state::cfx9850_ki_r ) { - UINT8 data = 0; + uint8_t data = 0; if ( m_ko & ( 1 << 0 ) ) data |= m_ko1->read(); if ( m_ko & ( 1 << 1 ) ) data |= m_ko2->read(); @@ -229,9 +229,9 @@ PALETTE_INIT_MEMBER(cfx9850_state, cfx9850) } -UINT32 cfx9850_state::screen_update_cfx9850(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cfx9850_state::screen_update_cfx9850(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 offset = 0; + uint16_t offset = 0; for ( int i = 0; i < 16; i++ ) { @@ -239,8 +239,8 @@ UINT32 cfx9850_state::screen_update_cfx9850(screen_device &screen, bitmap_ind16 for ( int j = 0; j < 64; j++ ) { - UINT8 data1 = m_display_ram[ offset ]; - UINT8 data2 = m_display_ram[ offset + 0x400 ]; + uint8_t data1 = m_display_ram[ offset ]; + uint8_t data2 = m_display_ram[ offset + 0x400 ]; for ( int b = 0; b < 8; b++ ) { diff --git a/src/mame/drivers/cgenie.cpp b/src/mame/drivers/cgenie.cpp index 6756cf3c3dc..3423ce62cdb 100644 --- a/src/mame/drivers/cgenie.cpp +++ b/src/mame/drivers/cgenie.cpp @@ -80,8 +80,8 @@ private: required_device m_rs232; required_device m_exp; required_memory_region m_char_rom; - required_shared_ptr m_color_ram; - required_shared_ptr m_font_ram; + required_shared_ptr m_color_ram; + required_shared_ptr m_font_ram; required_ioport_array<8> m_keyboard; static const rgb_t m_palette_bg[]; @@ -91,7 +91,7 @@ private: const rgb_t *m_palette; rgb_t m_background_color; - UINT8 m_control; + uint8_t m_control; int m_rs232_rx; int m_rs232_dcd; @@ -219,7 +219,7 @@ INPUT_PORTS_END READ8_MEMBER( cgenie_state::keyboard_r ) { - UINT8 data = 0; + uint8_t data = 0; for (int i = 0; i < 8; i++) if (BIT(offset, i)) @@ -260,7 +260,7 @@ WRITE8_MEMBER( cgenie_state::control_w ) READ8_MEMBER( cgenie_state::control_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= m_cassette->input() > 0 ? 1 : 0; data |= m_rs232_rx << 1; @@ -332,8 +332,8 @@ MC6845_UPDATE_ROW( cgenie_state::crtc_update_row ) for (int column = 0; column < x_count; column++) { - UINT8 code = m_ram->pointer()[ma + column]; - UINT8 color = m_color_ram[(ma & 0xbff) + column]; + uint8_t code = m_ram->pointer()[ma + column]; + uint8_t color = m_color_ram[(ma & 0xbff) + column]; // gfx mode? if (BIT(m_control, 5)) @@ -347,7 +347,7 @@ MC6845_UPDATE_ROW( cgenie_state::crtc_update_row ) } else { - UINT8 gfx = 0; + uint8_t gfx = 0; // cursor visible? if (cursor_x == column) diff --git a/src/mame/drivers/chaknpop.cpp b/src/mame/drivers/chaknpop.cpp index f416ccc5fcd..45d5540c1e9 100644 --- a/src/mame/drivers/chaknpop.cpp +++ b/src/mame/drivers/chaknpop.cpp @@ -326,7 +326,7 @@ GFXDECODE_END void chaknpop_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/cham24.cpp b/src/mame/drivers/cham24.cpp index 0fc42e73776..5adcefbd222 100644 --- a/src/mame/drivers/cham24.cpp +++ b/src/mame/drivers/cham24.cpp @@ -72,12 +72,12 @@ public: required_device m_maincpu; required_device m_ppu; - std::unique_ptr m_nt_ram; - UINT8* m_nt_page[4]; - UINT32 m_in_0; - UINT32 m_in_1; - UINT32 m_in_0_shift; - UINT32 m_in_1_shift; + std::unique_ptr m_nt_ram; + uint8_t* m_nt_page[4]; + uint32_t m_in_0; + uint32_t m_in_1; + uint32_t m_in_0_shift; + uint32_t m_in_1_shift; DECLARE_WRITE8_MEMBER(nt_w); DECLARE_READ8_MEMBER(nt_r); DECLARE_WRITE8_MEMBER(sprite_dma_w); @@ -90,7 +90,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(cham24); - UINT32 screen_update_cham24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cham24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void cham24_set_mirroring( int mirroring ); void ppu_irq(int *ppu_regs); }; @@ -180,14 +180,14 @@ READ8_MEMBER(cham24_state::cham24_IN1_r) WRITE8_MEMBER(cham24_state::cham24_mapper_w) { - UINT32 gfx_bank = offset & 0x3f; - UINT32 prg_16k_bank_page = (offset >> 6) & 0x01; - UINT32 prg_bank = (offset >> 7) & 0x1f; - UINT32 prg_bank_page_size = (offset >> 12) & 0x01; - UINT32 gfx_mirroring = (offset >> 13) & 0x01; + uint32_t gfx_bank = offset & 0x3f; + uint32_t prg_16k_bank_page = (offset >> 6) & 0x01; + uint32_t prg_bank = (offset >> 7) & 0x1f; + uint32_t prg_bank_page_size = (offset >> 12) & 0x01; + uint32_t gfx_mirroring = (offset >> 13) & 0x01; - UINT8* dst = memregion("maincpu")->base(); - UINT8* src = memregion("user1")->base(); + uint8_t* dst = memregion("maincpu")->base(); + uint8_t* src = memregion("user1")->base(); // switch PPU VROM bank membank("bank1")->set_base(memregion("gfx1")->base() + (0x2000 * gfx_bank)); @@ -267,7 +267,7 @@ void cham24_state::video_start() { } -UINT32 cham24_state::screen_update_cham24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cham24_state::screen_update_cham24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* render the ppu */ m_ppu->render(bitmap, 0, 0, 0, 0); @@ -278,8 +278,8 @@ UINT32 cham24_state::screen_update_cham24(screen_device &screen, bitmap_ind16 &b void cham24_state::machine_start() { /* switch PRG rom */ - UINT8* dst = memregion("maincpu")->base(); - UINT8* src = memregion("user1")->base(); + uint8_t* dst = memregion("maincpu")->base(); + uint8_t* src = memregion("user1")->base(); memcpy(&dst[0x8000], &src[0x0f8000], 0x4000); memcpy(&dst[0xc000], &src[0x0f8000], 0x4000); @@ -289,7 +289,7 @@ void cham24_state::machine_start() membank("bank1")->set_base(memregion("gfx1")->base()); /* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */ - m_nt_ram = std::make_unique(0x1000); + m_nt_ram = std::make_unique(0x1000); m_nt_page[0] = m_nt_ram.get(); m_nt_page[1] = m_nt_ram.get() + 0x400; m_nt_page[2] = m_nt_ram.get() + 0x800; diff --git a/src/mame/drivers/champbas.cpp b/src/mame/drivers/champbas.cpp index c7cbfad74a4..42b6d2f383c 100644 --- a/src/mame/drivers/champbas.cpp +++ b/src/mame/drivers/champbas.cpp @@ -135,7 +135,7 @@ WRITE8_MEMBER(champbas_state::mcu_start_w) /* champbja another protection */ READ8_MEMBER(champbas_state::champbja_protection_r) { - UINT8 data = 0; + uint8_t data = 0; /* (68BA) & 0x99 == 0x00 (6867) & 0x99 == 0x99 @@ -1193,13 +1193,13 @@ ROM_END DRIVER_INIT_MEMBER(champbas_state,champbas) { // chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding - UINT8 *rom1 = memregion("gfx1")->base(); - UINT8 *rom2 = memregion("gfx2")->base(); + uint8_t *rom1 = memregion("gfx1")->base(); + uint8_t *rom2 = memregion("gfx2")->base(); int len = memregion("gfx1")->bytes(); for (int i = 0; i < len/2; i++) { - UINT8 t = rom1[i + len/2]; + uint8_t t = rom1[i + len/2]; rom1[i + len/2] = rom2[i]; rom2[i] = t; } @@ -1209,13 +1209,13 @@ DRIVER_INIT_MEMBER(champbas_state,champbas) DRIVER_INIT_MEMBER(champbas_state,exctsccr) { // chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding - UINT8 *rom1 = memregion("gfx1")->base(); - UINT8 *rom2 = memregion("gfx2")->base(); + uint8_t *rom1 = memregion("gfx1")->base(); + uint8_t *rom2 = memregion("gfx2")->base(); // planes 0,1 for (int i = 0; i < 0x1000; i++) { - UINT8 t = rom1[i + 0x1000]; + uint8_t t = rom1[i + 0x1000]; rom1[i + 0x1000] = rom2[i]; rom2[i] = t; } diff --git a/src/mame/drivers/champbwl.cpp b/src/mame/drivers/champbwl.cpp index 8be942af8e2..d72f6e15a49 100644 --- a/src/mame/drivers/champbwl.cpp +++ b/src/mame/drivers/champbwl.cpp @@ -175,7 +175,7 @@ public: required_device m_seta001; required_device m_palette; required_device m_x1; - UINT8 m_last_trackball_val[2]; + uint8_t m_last_trackball_val[2]; DECLARE_READ8_MEMBER(trackball_r); DECLARE_WRITE8_MEMBER(champbwl_misc_w); DECLARE_WRITE8_MEMBER(doraemon_outputs_w); @@ -183,15 +183,15 @@ public: DECLARE_MACHINE_RESET(champbwl); DECLARE_MACHINE_START(doraemon); DECLARE_PALETTE_INIT(champbwl); - UINT32 screen_update_champbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_doraemon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_champbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_doraemon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_champbwl(screen_device &screen, bool state); void screen_eof_doraemon(screen_device &screen, bool state); }; PALETTE_INIT_MEMBER(champbwl_state,champbwl) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i, col; for (i = 0; i < palette.entries(); i++) @@ -204,9 +204,9 @@ PALETTE_INIT_MEMBER(champbwl_state,champbwl) READ8_MEMBER(champbwl_state::trackball_r) { - UINT8 ret; - UINT8 port4 = ioport("FAKEX")->read(); - UINT8 port5 = ioport("FAKEY")->read(); + uint8_t ret; + uint8_t port4 = ioport("FAKEX")->read(); + uint8_t port5 = ioport("FAKEY")->read(); ret = (((port4 - m_last_trackball_val[0]) & 0x0f)<<4) | ((port5 - m_last_trackball_val[1]) & 0x0f); @@ -454,7 +454,7 @@ GFXDECODE_END MACHINE_START_MEMBER(champbwl_state,champbwl) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000); @@ -470,7 +470,7 @@ MACHINE_RESET_MEMBER(champbwl_state,champbwl) } -UINT32 champbwl_state::screen_update_champbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t champbwl_state::screen_update_champbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0x1f0, cliprect); @@ -530,7 +530,7 @@ MACHINE_CONFIG_END -UINT32 champbwl_state::screen_update_doraemon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t champbwl_state::screen_update_doraemon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0x1f0, cliprect); @@ -550,7 +550,7 @@ void champbwl_state::screen_eof_doraemon(screen_device &screen, bool state) MACHINE_START_MEMBER(champbwl_state,doraemon) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000); } diff --git a/src/mame/drivers/chanbara.cpp b/src/mame/drivers/chanbara.cpp index 416cb8a8fd6..f4ff955da8f 100644 --- a/src/mame/drivers/chanbara.cpp +++ b/src/mame/drivers/chanbara.cpp @@ -70,17 +70,17 @@ public: m_palette(*this, "palette"){ } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram2; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram2; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_bg2_tilemap; - UINT8 m_scroll; - UINT8 m_scrollhi; + uint8_t m_scroll; + uint8_t m_scrollhi; /* devices */ required_device m_maincpu; @@ -100,14 +100,14 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(chanbara); - UINT32 screen_update_chanbara(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_chanbara(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; PALETTE_INIT_MEMBER(chanbara_state, chanbara) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i, red, green, blue; for (i = 0; i < palette.entries(); i++) @@ -213,7 +213,7 @@ void chanbara_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre } } -UINT32 chanbara_state::screen_update_chanbara(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t chanbara_state::screen_update_chanbara(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg2_tilemap->set_scrolly(0, m_scroll | (m_scrollhi << 8)); m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -455,9 +455,9 @@ ROM_END DRIVER_INIT_MEMBER(chanbara_state,chanbara) { - UINT8 *src = memregion("gfx4")->base(); - UINT8 *dst = memregion("gfx3")->base() + 0x4000; - UINT8 *bg = memregion("user1")->base(); + uint8_t *src = memregion("gfx4")->base(); + uint8_t *dst = memregion("gfx3")->base() + 0x4000; + uint8_t *bg = memregion("user1")->base(); int i; for (i = 0; i < 0x1000; i++) diff --git a/src/mame/drivers/chance32.cpp b/src/mame/drivers/chance32.cpp index 3096f5c2719..3b52a804378 100644 --- a/src/mame/drivers/chance32.cpp +++ b/src/mame/drivers/chance32.cpp @@ -55,16 +55,16 @@ public: tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - required_shared_ptr m_fgram; - required_shared_ptr m_bgram; + required_shared_ptr m_fgram; + required_shared_ptr m_bgram; - UINT8 mux_data; + uint8_t mux_data; TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_chance32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_chance32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -103,7 +103,7 @@ void chance32_state::video_start() } -UINT32 chance32_state::screen_update_chance32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t chance32_state::screen_update_chance32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -119,7 +119,7 @@ WRITE8_MEMBER(chance32_state::mux_w) READ8_MEMBER(chance32_state::mux_r) { - UINT8 res,i; + uint8_t res,i; const char *const muxnames[4] = { "IN0", "IN1", "IN2", "IN3" }; res = 0; diff --git a/src/mame/drivers/changela.cpp b/src/mame/drivers/changela.cpp index 6e8ab31b15e..ffba7b8f5cf 100644 --- a/src/mame/drivers/changela.cpp +++ b/src/mame/drivers/changela.cpp @@ -132,7 +132,7 @@ READ8_MEMBER(changela_state::changela_31_r) /* If the new value is less than the old value, and it did not wrap around, or if the new value is greater than the old value, and it did wrap around, then we are moving LEFT. */ - UINT8 curr_value = ioport("WHEEL")->read(); + uint8_t curr_value = ioport("WHEEL")->read(); if ((curr_value < m_prev_value_31 && (m_prev_value_31 - curr_value) < 0x80) || (curr_value > m_prev_value_31 && (curr_value - m_prev_value_31) > 0x80)) diff --git a/src/mame/drivers/channelf.cpp b/src/mame/drivers/channelf.cpp index e38e938b2ff..073bf9ba04f 100644 --- a/src/mame/drivers/channelf.cpp +++ b/src/mame/drivers/channelf.cpp @@ -45,7 +45,7 @@ * ...so it stays here for now. */ -UINT8 channelf_state::port_read_with_latch(UINT8 ext, UINT8 latch_state) +uint8_t channelf_state::port_read_with_latch(uint8_t ext, uint8_t latch_state) { return (~ext | latch_state); } @@ -57,7 +57,7 @@ READ8_MEMBER( channelf_state::port_0_r ) READ8_MEMBER( channelf_state::port_1_r ) { - UINT8 ext_value; + uint8_t ext_value; if ((m_latch[0] & 0x40) == 0) ext_value = ioport("RIGHT_C")->read(); @@ -69,7 +69,7 @@ READ8_MEMBER( channelf_state::port_1_r ) READ8_MEMBER( channelf_state::port_4_r ) { - UINT8 ext_value; + uint8_t ext_value; if ((m_latch[0] & 0x40) == 0) ext_value = ioport("LEFT_C")->read(); diff --git a/src/mame/drivers/chaos.cpp b/src/mame/drivers/chaos.cpp index ed2c073efb6..56d21282bcf 100644 --- a/src/mame/drivers/chaos.cpp +++ b/src/mame/drivers/chaos.cpp @@ -52,10 +52,10 @@ public: DECLARE_READ8_MEMBER(port91_r); DECLARE_WRITE8_MEMBER(kbd_put); private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; required_device m_terminal; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; required_device m_maincpu; }; @@ -108,7 +108,7 @@ WRITE8_MEMBER( chaos_state::port1f_w ) READ8_MEMBER( chaos_state::port90_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -120,7 +120,7 @@ READ8_MEMBER( chaos_state::port90_r ) READ8_MEMBER( chaos_state::port91_r ) { - UINT8 ret = 0x80 | ioport("CONFIG")->read(); + uint8_t ret = 0x80 | ioport("CONFIG")->read(); ret |= (m_term_data) ? 8 : 0; return ret; } @@ -133,7 +133,7 @@ WRITE8_MEMBER( chaos_state::kbd_put ) void chaos_state::machine_reset() { // copy the roms into ram - UINT8* ROM = memregion("roms")->base(); + uint8_t* ROM = memregion("roms")->base(); memcpy(m_p_ram, ROM, 0x3000); memcpy(m_p_ram+0x7000, ROM+0x3000, 0x1000); } diff --git a/src/mame/drivers/chessmst.cpp b/src/mame/drivers/chessmst.cpp index 0da9d76a24f..1b4687e0596 100644 --- a/src/mame/drivers/chessmst.cpp +++ b/src/mame/drivers/chessmst.cpp @@ -41,12 +41,12 @@ public: optional_device m_beeper; required_ioport m_extra; - UINT16 m_matrix; - UINT16 m_led_sel; - UINT8 m_sensor[64]; - UINT8 m_digit_matrix; + uint16_t m_matrix; + uint16_t m_led_sel; + uint8_t m_sensor[64]; + uint8_t m_digit_matrix; int m_digit_dot; - UINT16 m_digit; + uint16_t m_digit; virtual void machine_reset() override; @@ -117,7 +117,7 @@ INPUT_CHANGED_MEMBER(chessmst_state::view_monitor_button) INPUT_CHANGED_MEMBER(chessmst_state::chessmst_sensor) { - UINT8 pos = (UINT8)(uintptr_t)param; + uint8_t pos = (uint8_t)(uintptr_t)param; if (newval) { @@ -314,7 +314,7 @@ WRITE8_MEMBER( chessmst_state::pio1_port_b_dm_w ) READ8_MEMBER( chessmst_state::pio2_port_a_r ) { - UINT8 data = 0x00; + uint8_t data = 0x00; // The pieces position on the chessboard is identified by 64 Hall // sensors, which are in a 8x8 matrix with the corresponding LEDs. diff --git a/src/mame/drivers/chesstrv.cpp b/src/mame/drivers/chesstrv.cpp index e34954a6af0..ee13ff0cff0 100644 --- a/src/mame/drivers/chesstrv.cpp +++ b/src/mame/drivers/chesstrv.cpp @@ -34,9 +34,9 @@ public: DECLARE_WRITE8_MEMBER( diplomat_display_w ); DECLARE_READ8_MEMBER( diplomat_keypad_r ); - UINT8 m_ram_addr; - UINT8 *m_ram; - UINT8 m_matrix; + uint8_t m_ram_addr; + uint8_t *m_ram; + uint8_t m_matrix; //TIMER_DEVICE_CALLBACK_MEMBER(borisdpl_timer_interrupt); required_device m_maincpu; }; @@ -63,7 +63,7 @@ WRITE8_MEMBER( chesstrv_state::ram_w ) WRITE8_MEMBER( chesstrv_state::display_w ) { - UINT8 seg_data = BITSWAP8(data,0,1,2,3,4,5,6,7); + uint8_t seg_data = BITSWAP8(data,0,1,2,3,4,5,6,7); if(!(m_matrix & 0x01)) output().set_digit_value( 3, seg_data ); @@ -82,7 +82,7 @@ WRITE8_MEMBER( chesstrv_state::matrix_w ) READ8_MEMBER( chesstrv_state::keypad_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= ioport("LINE1")->read(); data |= ioport("LINE2")->read(); @@ -103,7 +103,7 @@ WRITE8_MEMBER( chesstrv_state::diplomat_display_w ) READ8_MEMBER( chesstrv_state::diplomat_keypad_r ) { - UINT8 data = m_matrix & 0x07; + uint8_t data = m_matrix & 0x07; switch (m_matrix & 7) { diff --git a/src/mame/drivers/chexx.cpp b/src/mame/drivers/chexx.cpp index f32da626237..665a234ee12 100644 --- a/src/mame/drivers/chexx.cpp +++ b/src/mame/drivers/chexx.cpp @@ -43,11 +43,11 @@ public: optional_device m_aysnd; // only faceoffh // vars - UINT8 m_port_a, m_port_b; - UINT8 m_bank; - UINT32 m_shift; - UINT8 m_lamp; - UINT8 m_ay_cmd, m_ay_data; + uint8_t m_port_a, m_port_b; + uint8_t m_bank; + uint32_t m_shift; + uint8_t m_lamp; + uint8_t m_ay_cmd, m_ay_data; // callbacks TIMER_DEVICE_CALLBACK_MEMBER(update); @@ -70,7 +70,7 @@ public: DECLARE_WRITE8_MEMBER(lamp_w); // digitalker - void digitalker_set_bank(UINT8 bank); + void digitalker_set_bank(uint8_t bank); // driver_device overrides virtual void machine_start() override; @@ -82,13 +82,13 @@ public: READ8_MEMBER(chexx_state::via_a_in) { - UINT8 ret = 0; + uint8_t ret = 0; logerror("%s: VIA read A: %02X\n", machine().describe_context(), ret); return ret; } READ8_MEMBER(chexx_state::via_b_in) { - UINT8 ret = 0; + uint8_t ret = 0; logerror("%s: VIA read B: %02X\n", machine().describe_context(), ret); return ret; } @@ -131,7 +131,7 @@ WRITE_LINE_MEMBER(chexx_state::via_cb2_out) m_shift = ((m_shift << 1) & 0xffffff) | state; // 7segs (score) - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 output().set_digit_value(0, patterns[(m_shift >> (16+4)) & 0xf]); output().set_digit_value(1, patterns[(m_shift >> (16+0)) & 0xf]); @@ -154,8 +154,8 @@ WRITE_LINE_MEMBER(chexx_state::via_irq_out) READ8_MEMBER(chexx_state::input_r) { - UINT8 ret = ioport("DSW")->read(); // bits 0-3 - UINT8 inp = ioport("INPUT")->read(); // bit 7 (multiplexed) + uint8_t ret = ioport("DSW")->read(); // bits 0-3 + uint8_t inp = ioport("INPUT")->read(); // bit 7 (multiplexed) for (int i = 0; i < 8; ++i) if ( ((~m_port_a) & (1 << i)) && ((~inp) & (1 << i)) ) @@ -250,12 +250,12 @@ void chexx_state::machine_start() { } -void chexx_state::digitalker_set_bank(UINT8 bank) +void chexx_state::digitalker_set_bank(uint8_t bank) { if (m_bank != bank) { - UINT8 *src = memregion("samples")->base(); - UINT8 *dst = memregion("digitalker")->base(); + uint8_t *src = memregion("samples")->base(); + uint8_t *dst = memregion("digitalker")->base(); memcpy(dst, src + bank * 0x4000, 0x4000); @@ -272,7 +272,7 @@ void chexx_state::machine_reset() TIMER_DEVICE_CALLBACK_MEMBER(chexx_state::update) { // NMI on coin-in - UINT8 coin = (~ioport("COIN")->read()) & 0x03; + uint8_t coin = (~ioport("COIN")->read()) & 0x03; m_maincpu->set_input_line(INPUT_LINE_NMI, coin ? ASSERT_LINE : CLEAR_LINE); // VIA CA1 connected to Digitalker INTR line @@ -280,7 +280,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(chexx_state::update) #if 0 // Play the digitalker samples (it's not hooked up correctly yet) - static UINT8 sample = 0, bank = 0; + static uint8_t sample = 0, bank = 0; if (machine().input().code_pressed_once(KEYCODE_Q)) --bank; diff --git a/src/mame/drivers/chihiro.cpp b/src/mame/drivers/chihiro.cpp index a1934dd93e4..cb025df0d24 100644 --- a/src/mame/drivers/chihiro.cpp +++ b/src/mame/drivers/chihiro.cpp @@ -404,15 +404,15 @@ public: //friend class mie_device; // construction/destruction - jvs_master(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + jvs_master(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); int get_sense_line(); - void send_packet(int destination, int length, UINT8 *data); - int received_packet(UINT8 *buffer); + void send_packet(int destination, int length, uint8_t *data); + int received_packet(uint8_t *buffer); }; const device_type JVS_MASTER = &device_creator; -jvs_master::jvs_master(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +jvs_master::jvs_master(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : jvs_host(mconfig, JVS_MASTER, "JVS MASTER", tag, owner, clock, "jvs_master", __FILE__) { } @@ -426,10 +426,10 @@ int jvs_master::get_sense_line() return 25; } -void jvs_master::send_packet(int destination, int length, UINT8 *data) +void jvs_master::send_packet(int destination, int length, uint8_t *data) { - push((UINT8)destination); - push((UINT8)length); + push((uint8_t)destination); + push((uint8_t)length); length--; while (length > 0) { @@ -440,10 +440,10 @@ void jvs_master::send_packet(int destination, int length, UINT8 *data) commit_raw(); } -int jvs_master::received_packet(UINT8 *buffer) +int jvs_master::received_packet(uint8_t *buffer) { - UINT32 length; - const UINT8 *data; + uint32_t length; + const uint8_t *data; get_raw_reply(data, length); if (length > 0) @@ -458,11 +458,11 @@ extern const device_type OHCI_HLEAN2131QC; class ohci_hlean2131qc_device : public device_t, public ohci_function_device { public: - ohci_hlean2131qc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ohci_hlean2131qc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager) override; int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) override; - int handle_bulk_pid(int endpoint, int pid, UINT8 *buffer, int size) override; - void set_region_base(UINT8 *data); + int handle_bulk_pid(int endpoint, int pid, uint8_t *buffer, int size) override; + void set_region_base(uint8_t *data); protected: virtual void device_start() override; @@ -480,16 +480,16 @@ private: static const USBStandardEndpointDescriptor enddesc83; static const USBStandardEndpointDescriptor enddesc84; static const USBStandardEndpointDescriptor enddesc85; - static const UINT8 strdesc0[]; - static const UINT8 strdesc1[]; - static const UINT8 strdesc2[]; + static const uint8_t strdesc0[]; + static const uint8_t strdesc1[]; + static const uint8_t strdesc2[]; int maximum_send; - UINT8 *region; + uint8_t *region; struct { - UINT8 buffer_in[32768]; + uint8_t buffer_in[32768]; int buffer_in_expected; - UINT8 buffer_out[32768]; + uint8_t buffer_out[32768]; int buffer_out_used; int buffer_out_packets; jvs_master *master; @@ -503,11 +503,11 @@ extern const device_type OHCI_HLEAN2131SC; class ohci_hlean2131sc_device : public device_t, public ohci_function_device { public: - ohci_hlean2131sc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ohci_hlean2131sc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager) override; int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) override; - int handle_bulk_pid(int endpoint, int pid, UINT8 *buffer, int size) override; - void set_region_base(UINT8 *data); + int handle_bulk_pid(int endpoint, int pid, uint8_t *buffer, int size) override; + void set_region_base(uint8_t *data); protected: virtual void device_start() override; @@ -521,10 +521,10 @@ private: static const USBStandardEndpointDescriptor enddesc81; static const USBStandardEndpointDescriptor enddesc82; static const USBStandardEndpointDescriptor enddesc83; - static const UINT8 strdesc0[]; - static const UINT8 strdesc1[]; - static const UINT8 strdesc2[]; - UINT8 *region; + static const uint8_t strdesc0[]; + static const uint8_t strdesc1[]; + static const uint8_t strdesc2[]; + uint8_t *region; }; const device_type OHCI_HLEAN2131SC = &device_creator; @@ -543,10 +543,10 @@ public: DECLARE_WRITE32_MEMBER(mediaboard_w); virtual void machine_start() override; - void baseboard_ide_event(int type, UINT8 *read, UINT8 *write); - UINT8 *baseboard_ide_dimmboard(UINT32 lba); - void dword_write_le(UINT8 *addr, UINT32 d); - void word_write_le(UINT8 *addr, UINT16 d); + void baseboard_ide_event(int type, uint8_t *read, uint8_t *write); + uint8_t *baseboard_ide_dimmboard(uint32_t lba); + void dword_write_le(uint8_t *addr, uint32_t d); + void word_write_le(uint8_t *addr, uint16_t d); virtual void hack_eeprom() override; virtual void hack_usb() override; @@ -556,11 +556,11 @@ public: } chihiro_devs; int usbhack_index; int usbhack_counter; - UINT8 *dimm_board_memory; - UINT32 dimm_board_memory_size; + uint8_t *dimm_board_memory; + uint32_t dimm_board_memory_size; private: - void jamtable_disasm(address_space &space, UINT32 address, UINT32 size); + void jamtable_disasm(address_space &space, uint32_t address, uint32_t size); void jamtable_disasm_command(int ref, int params, const char **param); void threadlist_command(int ref, int params, const char **param); void chihiro_help_command(int ref, int params, const char **param); @@ -583,7 +583,7 @@ St. Instr. Comment */ /* jamtable disassembler */ -void chihiro_state::jamtable_disasm(address_space &space, UINT32 address, UINT32 size) // 0xff000080 == fff00080 +void chihiro_state::jamtable_disasm(address_space &space, uint32_t address, uint32_t size) // 0xff000080 == fff00080 { debugger_cpu &cpu = machine().debugger().cpu(); debugger_console &con = machine().debugger().console(); @@ -597,11 +597,11 @@ void chihiro_state::jamtable_disasm(address_space &space, UINT32 address, UINT32 { offs_t base = addr; - UINT32 opcode = cpu.read_byte(space, address, true); + uint32_t opcode = cpu.read_byte(space, address, true); addr++; - UINT32 op1 = cpu.read_dword(space, address, true); + uint32_t op1 = cpu.read_dword(space, address, true); addr += 4; - UINT32 op2 = cpu.read_dword(space, address, true); + uint32_t op2 = cpu.read_dword(space, address, true); addr += 4; char sop1[16]; @@ -683,7 +683,7 @@ void chihiro_state::jamtable_disasm(address_space &space, UINT32 address, UINT32 void chihiro_state::jamtable_disasm_command(int ref, int params, const char **param) { address_space &space = m_maincpu->space(); - UINT64 addr, size; + uint64_t addr, size; if (params < 2) return; @@ -691,12 +691,12 @@ void chihiro_state::jamtable_disasm_command(int ref, int params, const char **pa return; if (!machine().debugger().commands().validate_number_parameter(param[1], &size)) return; - jamtable_disasm(space, (UINT32)addr, (UINT32)size); + jamtable_disasm(space, (uint32_t)addr, (uint32_t)size); } void chihiro_state::threadlist_command(int ref, int params, const char **param) { - const UINT32 thlists = 0x8003aae0; // magic address + const uint32_t thlists = 0x8003aae0; // magic address address_space &space = m_maincpu->space(); debugger_cpu &cpu = machine().debugger().cpu(); debugger_console &con = machine().debugger().console(); @@ -705,15 +705,15 @@ void chihiro_state::threadlist_command(int ref, int params, const char **param) con.printf("-------------------------------\n"); for (int pri=0;pri < 16;pri++) { - UINT32 curr = thlists + pri * 8; - UINT32 next = cpu.read_dword(space, curr, true); + uint32_t curr = thlists + pri * 8; + uint32_t next = cpu.read_dword(space, curr, true); while (next != curr) { - UINT32 kthrd = next - 0x5c; - UINT32 topstack = cpu.read_dword(space, kthrd + 0x1c, true); - UINT32 tlsdata = cpu.read_dword(space, kthrd + 0x28, true); - UINT32 function; + uint32_t kthrd = next - 0x5c; + uint32_t topstack = cpu.read_dword(space, kthrd + 0x1c, true); + uint32_t tlsdata = cpu.read_dword(space, kthrd + 0x28, true); + uint32_t function; if (tlsdata == 0) function = cpu.read_dword(space, topstack - 0x210 - 8, true); else @@ -760,8 +760,8 @@ static const struct { const char *game_name; const bool disable_usb; struct { - UINT32 address; - UINT8 write_byte; + uint32_t address; + uint8_t write_byte; } modify[16]; } hacks[HACK_ITEMS] = { { "chihiro", false, { { 0x6a79f/*3f79f*/, 0x01 }, { 0x6a7a0/*3f7a0*/, 0x00 }, { 0x6b575/*40575*/, 0x00 }, { 0x6b576/*40576*/, 0x00 }, { 0x6b5af/*405af*/, 0x75 }, { 0x6b78a/*4078a*/, 0x75 }, { 0x6b7ca/*407ca*/, 0x00 }, { 0x6b7b8/*407b8*/, 0x00 }, { 0x8f5b2, 0x75 }, { 0x79a9e/*2ea9e*/, 0x74 }, { 0x79b80/*2eb80*/, 0xeb }, { 0x79b97/*2eb97*/, 0x74 }, { 0, 0 } } }, { "outr2", true, { { 0x12e4cf, 0x01 }, { 0x12e4d0, 0x00 }, { 0x4793e, 0x01 }, { 0x4793f, 0x00 }, { 0x47aa3, 0x01 }, { 0x47aa4, 0x00 }, { 0x14f2b6, 0x84 }, { 0x14f2d1, 0x75 }, { 0x8732f, 0x7d }, { 0x87384, 0x7d }, { 0x87388, 0xeb }, { 0, 0 } } }, @@ -808,11 +808,11 @@ const USBStandardEndpointDescriptor ohci_hlean2131qc_device::enddesc82 = { 0x07, const USBStandardEndpointDescriptor ohci_hlean2131qc_device::enddesc83 = { 0x07,0x05,0x83,0x02,0x0040,0x00 }; const USBStandardEndpointDescriptor ohci_hlean2131qc_device::enddesc84 = { 0x07,0x05,0x84,0x02,0x0040,0x00 }; const USBStandardEndpointDescriptor ohci_hlean2131qc_device::enddesc85 = { 0x07,0x05,0x85,0x02,0x0040,0x00 }; -const UINT8 ohci_hlean2131qc_device::strdesc0[] = { 0x04,0x03,0x00,0x00 }; -const UINT8 ohci_hlean2131qc_device::strdesc1[] = { 0x0A,0x03,0x53,0x00,0x45,0x00,0x47,0x00,0x41,0x00 }; -const UINT8 ohci_hlean2131qc_device::strdesc2[] = { 0x0E,0x03,0x42,0x00,0x41,0x00,0x53,0x00,0x45,0x00,0x42,0x03,0xFF,0x0B }; +const uint8_t ohci_hlean2131qc_device::strdesc0[] = { 0x04,0x03,0x00,0x00 }; +const uint8_t ohci_hlean2131qc_device::strdesc1[] = { 0x0A,0x03,0x53,0x00,0x45,0x00,0x47,0x00,0x41,0x00 }; +const uint8_t ohci_hlean2131qc_device::strdesc2[] = { 0x0E,0x03,0x42,0x00,0x41,0x00,0x53,0x00,0x45,0x00,0x42,0x03,0xFF,0x0B }; -ohci_hlean2131qc_device::ohci_hlean2131qc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ohci_hlean2131qc_device::ohci_hlean2131qc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OHCI_HLEAN2131QC, "OHCI Hlean2131qc", tag, owner, clock, "ohci_hlean2131qc", __FILE__), ohci_function_device() { @@ -847,7 +847,7 @@ void ohci_hlean2131qc_device::initialize(running_machine &machine, ohci_usb_cont jvs.master = machine.device("jvs_master"); } -void ohci_hlean2131qc_device::set_region_base(UINT8 *data) +void ohci_hlean2131qc_device::set_region_base(uint8_t *data) { region = data; } @@ -974,7 +974,7 @@ int ohci_hlean2131qc_device::handle_nonstandard_request(int endpoint, USBSetupPa { jvs.buffer_out_packets = 0; jvs.buffer_out[0] = 0; - jvs.buffer_out[1] = (UINT8)jvs.buffer_out_packets; + jvs.buffer_out[1] = (uint8_t)jvs.buffer_out_packets; jvs.buffer_out_used = 2; } jvs.buffer_in_expected = setup->wIndex; @@ -1009,7 +1009,7 @@ int ohci_hlean2131qc_device::handle_nonstandard_request(int endpoint, USBSetupPa return 0; } -int ohci_hlean2131qc_device::handle_bulk_pid(int endpoint, int pid, UINT8 *buffer, int size) +int ohci_hlean2131qc_device::handle_bulk_pid(int endpoint, int pid, uint8_t *buffer, int size) { #ifdef VERBOSE_MSG printf("Bulk request to an2131qc: %x %d %x\n\r", endpoint, pid, size); @@ -1087,7 +1087,7 @@ int ohci_hlean2131qc_device::handle_bulk_pid(int endpoint, int pid, UINT8 *buffe jvs.buffer_out[jvs.buffer_out_used + 5 + recv] = chk & 255; jvs.buffer_out_packets++; // jvs node address - jvs.buffer_out[jvs.buffer_out_used] = (UINT8)dest; + jvs.buffer_out[jvs.buffer_out_used] = (uint8_t)dest; // dummy jvs.buffer_out[jvs.buffer_out_used + 1] = 0; // length following @@ -1097,7 +1097,7 @@ int ohci_hlean2131qc_device::handle_bulk_pid(int endpoint, int pid, UINT8 *buffe // body jvs.buffer_out[jvs.buffer_out_used + 4] = 0xe0; jvs.buffer_out_used = jvs.buffer_out_used + recv + 5 - 1; - jvs.buffer_out[1] = (UINT8)jvs.buffer_out_packets; + jvs.buffer_out[1] = (uint8_t)jvs.buffer_out_packets; } p = p + len; } @@ -1121,18 +1121,18 @@ const USBStandardEndpointDescriptor ohci_hlean2131sc_device::enddesc03 = { 0x07, const USBStandardEndpointDescriptor ohci_hlean2131sc_device::enddesc81 = { 0x07,0x05,0x81,0x02,0x0040,0x00 }; const USBStandardEndpointDescriptor ohci_hlean2131sc_device::enddesc82 = { 0x07,0x05,0x82,0x02,0x0040,0x00 }; const USBStandardEndpointDescriptor ohci_hlean2131sc_device::enddesc83 = { 0x07,0x05,0x83,0x02,0x0040,0x00 }; -const UINT8 ohci_hlean2131sc_device::strdesc0[] = { 0x04,0x03,0x00,0x00 }; -const UINT8 ohci_hlean2131sc_device::strdesc1[] = { 0x0A,0x03,0x53,0x00,0x45,0x00,0x47,0x00,0x41,0x00 }; -const UINT8 ohci_hlean2131sc_device::strdesc2[] = { 0x0E,0x03,0x42,0x00,0x41,0x00,0x53,0x00,0x45,0x00,0x42,0x00,0x44,0x00 }; +const uint8_t ohci_hlean2131sc_device::strdesc0[] = { 0x04,0x03,0x00,0x00 }; +const uint8_t ohci_hlean2131sc_device::strdesc1[] = { 0x0A,0x03,0x53,0x00,0x45,0x00,0x47,0x00,0x41,0x00 }; +const uint8_t ohci_hlean2131sc_device::strdesc2[] = { 0x0E,0x03,0x42,0x00,0x41,0x00,0x53,0x00,0x45,0x00,0x42,0x00,0x44,0x00 }; -ohci_hlean2131sc_device::ohci_hlean2131sc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +ohci_hlean2131sc_device::ohci_hlean2131sc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, OHCI_HLEAN2131SC, "OHCI Hlean2131sc", tag, owner, clock, "ohci_hlean2131sc", __FILE__), ohci_function_device() { region = nullptr; } -void ohci_hlean2131sc_device::set_region_base(UINT8 *data) +void ohci_hlean2131sc_device::set_region_base(uint8_t *data) { region = data; } @@ -1274,7 +1274,7 @@ int ohci_hlean2131sc_device::handle_nonstandard_request(int endpoint, USBSetupPa return 0; } -int ohci_hlean2131sc_device::handle_bulk_pid(int endpoint, int pid, UINT8 *buffer, int size) +int ohci_hlean2131sc_device::handle_bulk_pid(int endpoint, int pid, uint8_t *buffer, int size) { //#ifdef VERBOSE_MSG printf("Bulk request to an2131sc: %x %d %x\n\r", endpoint, pid, size); @@ -1300,16 +1300,16 @@ class ide_baseboard_device : public ata_mass_storage_device { public: // construction/destruction - ide_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ide_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual int read_sector(UINT32 lba, void *buffer) override; - virtual int write_sector(UINT32 lba, const void *buffer) override; + virtual int read_sector(uint32_t lba, void *buffer) override; + virtual int write_sector(uint32_t lba, const void *buffer) override; protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - UINT8 read_buffer[0x20]; - UINT8 write_buffer[0x20]; + uint8_t read_buffer[0x20]; + uint8_t write_buffer[0x20]; chihiro_state *chihirosystem; static const int size_factor = 2; }; @@ -1325,7 +1325,7 @@ const device_type IDE_BASEBOARD = &device_creator; // ide_baseboard_device - constructor //------------------------------------------------- -ide_baseboard_device::ide_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ide_baseboard_device::ide_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ata_mass_storage_device(mconfig, IDE_BASEBOARD, "IDE Baseboard", tag, owner, clock, "ide_baseboard", __FILE__) { } @@ -1361,10 +1361,10 @@ void ide_baseboard_device::device_reset() ata_mass_storage_device::device_reset(); } -int ide_baseboard_device::read_sector(UINT32 lba, void *buffer) +int ide_baseboard_device::read_sector(uint32_t lba, void *buffer) { int off; - UINT8 *data; + uint8_t *data; /* It assumes there are 4 "partitions", the size of the first one depends on bits 3-0 of io port 40f4: @@ -1411,7 +1411,7 @@ int ide_baseboard_device::read_sector(UINT32 lba, void *buffer) return 1; } -int ide_baseboard_device::write_sector(UINT32 lba, const void *buffer) +int ide_baseboard_device::write_sector(uint32_t lba, const void *buffer) { logerror("baseboard: write sector lba %08x\n", lba); if (lba >= ((0x40000 << size_factor) - 0x8000)) { @@ -1431,7 +1431,7 @@ int ide_baseboard_device::write_sector(UINT32 lba, const void *buffer) * Chihiro Type 1 baseboard */ -void chihiro_state::dword_write_le(UINT8 *addr, UINT32 d) +void chihiro_state::dword_write_le(uint8_t *addr, uint32_t d) { addr[0] = d & 255; addr[1] = (d >> 8) & 255; @@ -1439,13 +1439,13 @@ void chihiro_state::dword_write_le(UINT8 *addr, UINT32 d) addr[3] = (d >> 24) & 255; } -void chihiro_state::word_write_le(UINT8 *addr, UINT16 d) +void chihiro_state::word_write_le(uint8_t *addr, uint16_t d) { addr[0] = d & 255; addr[1] = (d >> 8) & 255; } -void chihiro_state::baseboard_ide_event(int type, UINT8 *read_buffer, UINT8 *write_buffer) +void chihiro_state::baseboard_ide_event(int type, uint8_t *read_buffer, uint8_t *write_buffer) { int c; @@ -1495,7 +1495,7 @@ void chihiro_state::baseboard_ide_event(int type, UINT8 *read_buffer, UINT8 *wri xbox_base_devs.pic8259_2->ir2_w(1); } -UINT8 *chihiro_state::baseboard_ide_dimmboard(UINT32 lba) +uint8_t *chihiro_state::baseboard_ide_dimmboard(uint32_t lba) { // return pointer to memory containing decrypted gdrom data (contains an image of a fatx partition) if (chihiro_devs.dimmboard != nullptr) @@ -1505,7 +1505,7 @@ UINT8 *chihiro_state::baseboard_ide_dimmboard(UINT32 lba) READ32_MEMBER(chihiro_state::mediaboard_r) { - UINT32 r; + uint32_t r; logerror("I/O port read %04x mask %08X\n", offset * 4 + 0x4000, mem_mask); r = 0; diff --git a/src/mame/drivers/chinagat.cpp b/src/mame/drivers/chinagat.cpp index 6bc3b8d7eb2..e8cc1b1cf2b 100644 --- a/src/mame/drivers/chinagat.cpp +++ b/src/mame/drivers/chinagat.cpp @@ -241,7 +241,7 @@ WRITE8_MEMBER(chinagat_state::saiyugoub1_adpcm_rom_addr_w ) WRITE8_MEMBER(chinagat_state::saiyugoub1_adpcm_control_w ) { /* i8748 Port 2 write */ - UINT8 *saiyugoub1_adpcm_rom = memregion("adpcm")->base(); + uint8_t *saiyugoub1_adpcm_rom = memregion("adpcm")->base(); if (data & 0x80) /* Reset m5205 and disable ADPCM ROM outputs */ { @@ -899,8 +899,8 @@ ROM_END DRIVER_INIT_MEMBER(chinagat_state,chinagat) { - UINT8 *MAIN = memregion("maincpu")->base(); - UINT8 *SUB = memregion("sub")->base(); + uint8_t *MAIN = memregion("maincpu")->base(); + uint8_t *SUB = memregion("sub")->base(); m_technos_video_hw = 1; m_sprite_irq = M6809_IRQ_LINE; diff --git a/src/mame/drivers/chinsan.cpp b/src/mame/drivers/chinsan.cpp index 49d8e3e4adf..f6551dbef10 100644 --- a/src/mame/drivers/chinsan.cpp +++ b/src/mame/drivers/chinsan.cpp @@ -61,14 +61,14 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_video; + required_shared_ptr m_video; /* misc */ - UINT8 m_port_select; - UINT32 m_adpcm_pos; - UINT8 m_adpcm_idle; - UINT8 m_adpcm_data; - UINT8 m_trigger; + uint8_t m_port_select; + uint32_t m_adpcm_pos; + uint8_t m_adpcm_idle; + uint8_t m_adpcm_data; + uint8_t m_trigger; DECLARE_WRITE8_MEMBER(ctrl_w); DECLARE_WRITE8_MEMBER(chinsan_port00_w); DECLARE_READ8_MEMBER(chinsan_input_port_0_r); @@ -81,13 +81,13 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(chinsan); - UINT32 screen_update_chinsan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_chinsan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(chin_adpcm_int); required_device m_maincpu; required_device m_adpcm; required_device m_gfxdecode; required_device m_palette; - std::unique_ptr m_decrypted_opcodes; + std::unique_ptr m_decrypted_opcodes; }; @@ -99,7 +99,7 @@ public: PALETTE_INIT_MEMBER(chinsan_state, chinsan) { - UINT8 *src = memregion( "color_proms" )->base(); + uint8_t *src = memregion( "color_proms" )->base(); int i; for (i = 0; i < 0x100; i++) @@ -110,7 +110,7 @@ void chinsan_state::video_start() { } -UINT32 chinsan_state::screen_update_chinsan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t chinsan_state::screen_update_chinsan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y, x, count; count = 0; @@ -548,7 +548,7 @@ WRITE_LINE_MEMBER(chinsan_state::chin_adpcm_int) } else { - UINT8 *ROM = memregion("adpcm")->base(); + uint8_t *ROM = memregion("adpcm")->base(); m_adpcm_data = ((m_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0) >> 4)); m_adpcm->data_w(m_adpcm_data & 0xf); @@ -677,7 +677,7 @@ ROM_END DRIVER_INIT_MEMBER(chinsan_state,chinsan) { - m_decrypted_opcodes = std::make_unique(0x18000); + m_decrypted_opcodes = std::make_unique(0x18000); mc8123_decode(memregion("maincpu")->base(), m_decrypted_opcodes.get(), memregion("user1")->base(), 0x18000); } diff --git a/src/mame/drivers/chsuper.cpp b/src/mame/drivers/chsuper.cpp index bd2d7345ae9..5f201d16a29 100644 --- a/src/mame/drivers/chsuper.cpp +++ b/src/mame/drivers/chsuper.cpp @@ -42,14 +42,14 @@ public: DECLARE_WRITE8_MEMBER(chsuper_outportb_w); int m_tilexor; - UINT8 m_blacklamp; - UINT8 m_redlamp; - std::unique_ptr m_vram; + uint8_t m_blacklamp; + uint8_t m_redlamp; + std::unique_ptr m_vram; required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; - 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: // driver_device overrides @@ -71,10 +71,10 @@ public: void chsuper_state::video_start() { - m_vram = make_unique_clear(1 << 14); + m_vram = make_unique_clear(1 << 14); } -UINT32 chsuper_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t chsuper_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { gfx_element *gfx = m_gfxdecode->gfx(0); int count = 0x0000; @@ -466,13 +466,13 @@ ROM_END DRIVER_INIT_MEMBER(chsuper_state,chsuper2) { - std::unique_ptr buffer; - UINT8 *rom = memregion("gfx1")->base(); + std::unique_ptr buffer; + uint8_t *rom = memregion("gfx1")->base(); int i; m_tilexor = 0x7f00; - buffer = std::make_unique(0x100000); + buffer = std::make_unique(0x100000); for (i=0;i<0x100000;i++) { @@ -488,13 +488,13 @@ DRIVER_INIT_MEMBER(chsuper_state,chsuper2) DRIVER_INIT_MEMBER(chsuper_state,chsuper3) { - std::unique_ptr buffer; - UINT8 *rom = memregion("gfx1")->base(); + std::unique_ptr buffer; + uint8_t *rom = memregion("gfx1")->base(); int i; m_tilexor = 0x0e00; - buffer = std::make_unique(0x100000); + buffer = std::make_unique(0x100000); for (i=0;i<0x100000;i++) { @@ -510,13 +510,13 @@ DRIVER_INIT_MEMBER(chsuper_state,chsuper3) DRIVER_INIT_MEMBER(chsuper_state,chmpnum) { - std::unique_ptr buffer; - UINT8 *rom = memregion("gfx1")->base(); + std::unique_ptr buffer; + uint8_t *rom = memregion("gfx1")->base(); int i; m_tilexor = 0x1800; - buffer = std::make_unique(0x100000); + buffer = std::make_unique(0x100000); for (i=0;i<0x100000;i++) { diff --git a/src/mame/drivers/cinemat.cpp b/src/mame/drivers/cinemat.cpp index 2127fca0fa4..d6012b4b3df 100644 --- a/src/mame/drivers/cinemat.cpp +++ b/src/mame/drivers/cinemat.cpp @@ -88,7 +88,7 @@ READ8_MEMBER(cinemat_state::inputs_r) READ8_MEMBER(cinemat_state::switches_r) { - static const UINT8 switch_shuffle[8] = { 2,5,4,3,0,1,6,7 }; + static const uint8_t switch_shuffle[8] = { 2,5,4,3,0,1,6,7 }; return (ioport("SWITCHES")->read() >> switch_shuffle[offset]) & 1; } @@ -150,7 +150,7 @@ READ8_MEMBER(cinemat_state::joystick_read) return 0; else { - int const xval = INT16(m_maincpu->state_int(CCPU_X) << 4) >> 4; + int const xval = int16_t(m_maincpu->state_int(CCPU_X) << 4) >> 4; return ((m_mux_select ? m_analog_x : m_analog_y).read_safe(0) - xval) < 0x800; } } @@ -165,11 +165,11 @@ READ8_MEMBER(cinemat_state::joystick_read) READ8_MEMBER(cinemat_state::speedfrk_wheel_r) { - static const UINT8 speedfrk_steer[] = {0xe, 0x6, 0x2, 0x0, 0x3, 0x7, 0xf}; + static const uint8_t speedfrk_steer[] = {0xe, 0x6, 0x2, 0x0, 0x3, 0x7, 0xf}; int delta_wheel; /* the shift register is cleared once per 'frame' */ - delta_wheel = INT8(ioport("WHEEL")->read()) / 8; + delta_wheel = int8_t(ioport("WHEEL")->read()) / 8; if (delta_wheel > 3) delta_wheel = 3; else if (delta_wheel < -3) @@ -205,7 +205,7 @@ READ8_MEMBER(cinemat_state::speedfrk_gear_r) static const struct { const char *portname; - UINT16 bitmask; + uint16_t bitmask; } sundance_port_map[16] = { { "PAD1", 0x155 }, /* bit 0 is set if P1 1,3,5,7,9 is pressed */ diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp index 8e6ed65744e..372cbd2bce3 100644 --- a/src/mame/drivers/cischeat.cpp +++ b/src/mame/drivers/cischeat.cpp @@ -366,7 +366,7 @@ READ16_MEMBER(cischeat_state::wildplt_xy_r) // buttons & sensors are muxed. bit 0 routes to coin chute (single according to test mode) READ16_MEMBER(cischeat_state::wildplt_mux_r) { - UINT16 split_in = 0xffff; + uint16_t split_in = 0xffff; switch(m_wildplt_output & 0xc) { // case 0: return ioport("IN1")->read(); @@ -618,7 +618,7 @@ READ16_MEMBER(cischeat_state::armchmp2_buttons_r) { int arm_x = ioport("IN1")->read(); - UINT16 ret = ioport("IN0")->read(); + uint16_t ret = ioport("IN0")->read(); if (arm_x < 0x40) ret &= ~1; else if (arm_x > 0xc0) ret &= ~2; @@ -728,9 +728,9 @@ WRITE16_MEMBER(cischeat_state::captflag_motor_command_left_w) captflag_motor_move(LEFT, data); } -void cischeat_state::captflag_motor_move(int side, UINT16 data) +void cischeat_state::captflag_motor_move(int side, uint16_t data) { - UINT16 & pos = m_captflag_motor_pos[side]; + uint16_t & pos = m_captflag_motor_pos[side]; timer_device &dev((side == RIGHT) ? *m_captflag_motor_right : *m_captflag_motor_left); @@ -785,7 +785,7 @@ void cischeat_state::captflag_motor_move(int side, UINT16 data) CUSTOM_INPUT_MEMBER(cischeat_state::captflag_motor_pos_r) { - const UINT8 pos[4] = {1,0,2,3}; // -> 2,3,1,0 offsets -> 0123 + const uint8_t pos[4] = {1,0,2,3}; // -> 2,3,1,0 offsets -> 0123 return ~pos[m_captflag_motor_pos[(uintptr_t)param]]; } @@ -1797,7 +1797,7 @@ static const gfx_layout tiles_16x16_quad = 16*16*4 }; -static const UINT32 road_layout_xoffset[64] = +static const uint32_t road_layout_xoffset[64] = { STEP16(16*4*0,4),STEP16(16*4*1,4), STEP16(16*4*2,4),STEP16(16*4*3,4) @@ -2244,12 +2244,12 @@ MACHINE_CONFIG_END */ void cischeat_state::cischeat_untangle_sprites(const char *region) { - UINT8 *src = memregion(region)->base(); - const UINT8 *end = src + memregion(region)->bytes(); + uint8_t *src = memregion(region)->base(); + const uint8_t *end = src + memregion(region)->bytes(); while (src < end) { - UINT8 sprite[16*8]; + uint8_t sprite[16*8]; int i; for (i = 0; i < 16 ; i++) diff --git a/src/mame/drivers/citycon.cpp b/src/mame/drivers/citycon.cpp index 8deef5b4e23..807898d301c 100644 --- a/src/mame/drivers/citycon.cpp +++ b/src/mame/drivers/citycon.cpp @@ -319,7 +319,7 @@ ROM_END DRIVER_INIT_MEMBER(citycon_state,citycon) { - UINT8 *rom = memregion("gfx1")->base(); + uint8_t *rom = memregion("gfx1")->base(); int i; /* diff --git a/src/mame/drivers/clayshoo.cpp b/src/mame/drivers/clayshoo.cpp index 230506cd161..7b8f3124536 100644 --- a/src/mame/drivers/clayshoo.cpp +++ b/src/mame/drivers/clayshoo.cpp @@ -31,21 +31,21 @@ public: m_maincpu(*this, "maincpu") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* misc */ emu_timer *m_analog_timer_1, *m_analog_timer_2; - UINT8 m_input_port_select; - UINT8 m_analog_port_val; + uint8_t m_input_port_select; + uint8_t m_analog_port_val; DECLARE_WRITE8_MEMBER(analog_reset_w); DECLARE_READ8_MEMBER(analog_r); DECLARE_WRITE8_MEMBER(input_port_select_w); DECLARE_READ8_MEMBER(input_port_r); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_clayshoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_clayshoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(reset_analog_bit); - UINT8 difficulty_input_port_r( int bit ); + uint8_t difficulty_input_port_r( int bit ); void create_analog_timers( ); required_device m_maincpu; }; @@ -63,12 +63,12 @@ WRITE8_MEMBER(clayshoo_state::input_port_select_w) } -UINT8 clayshoo_state::difficulty_input_port_r( int bit ) +uint8_t clayshoo_state::difficulty_input_port_r( int bit ) { - UINT8 ret = 0; + uint8_t ret = 0; /* read fake port and remap the buttons to 2 bits */ - UINT8 raw = ioport("FAKE")->read(); + uint8_t raw = ioport("FAKE")->read(); if (raw & (1 << (bit + 1))) ret = 0x03; /* expert */ @@ -83,7 +83,7 @@ UINT8 clayshoo_state::difficulty_input_port_r( int bit ) READ8_MEMBER(clayshoo_state::input_port_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch (m_input_port_select) { @@ -171,16 +171,16 @@ void clayshoo_state::machine_start() * *************************************/ -UINT32 clayshoo_state::screen_update_clayshoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t clayshoo_state::screen_update_clayshoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; for (offs = 0; offs < m_videoram.bytes(); offs++) { int i; - UINT8 x = offs << 3; - UINT8 y = ~(offs >> 5); - UINT8 data = m_videoram[offs]; + uint8_t x = offs << 3; + uint8_t y = ~(offs >> 5); + uint8_t data = m_videoram[offs]; for (i = 0; i < 8; i++) { diff --git a/src/mame/drivers/clcd.cpp b/src/mame/drivers/clcd.cpp index fb8c18775b8..391bb56dc8d 100644 --- a/src/mame/drivers/clcd.cpp +++ b/src/mame/drivers/clcd.cpp @@ -106,7 +106,7 @@ public: palette.set_pen_color(1, rgb_t(2,4,2)); } - 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) { if (m_lcd_mode & LCD_MODE_GRAPH) { @@ -116,7 +116,7 @@ public: for (int x = 0; x < 60; x++) { - UINT8 bit = m_ram->pointer()[offset++]; + uint8_t bit = m_ram->pointer()[offset++]; bitmap.pix16(y, (x * 8) + 0) = (bit >> 7) & 1; bitmap.pix16(y, (x * 8) + 1) = (bit >> 6) & 1; @@ -131,7 +131,7 @@ public: } else { - UINT8 *font = m_lcd_char_rom->base(); + uint8_t *font = m_lcd_char_rom->base(); if (m_lcd_mode & LCD_MODE_ALT) { font += 1024; @@ -145,8 +145,8 @@ public: for (int x = 0; x < 480; x++) { - UINT8 ch = m_ram->pointer()[offset + (x / chrw)]; - UINT8 bit = font[((ch & 0x7f) * chrw) + (x % chrw)]; + uint8_t ch = m_ram->pointer()[offset + (x / chrw)]; + uint8_t bit = font[((ch & 0x7f) * chrw) + (x % chrw)]; if (ch & 0x80) { bit = ~bit; @@ -577,15 +577,15 @@ private: int m_irq_acia; int m_mmu_mode; int m_mmu_saved_mode; - UINT8 m_mmu_offset1; - UINT8 m_mmu_offset2; - UINT8 m_mmu_offset3; - UINT8 m_mmu_offset4; - UINT8 m_mmu_offset5; + uint8_t m_mmu_offset1; + uint8_t m_mmu_offset2; + uint8_t m_mmu_offset3; + uint8_t m_mmu_offset4; + uint8_t m_mmu_offset5; int m_key_clk; int m_key_poll; int m_key_column; - UINT16 m_key_shift; + uint16_t m_key_shift; int m_key_force_format; required_ioport m_col0; required_ioport m_col1; diff --git a/src/mame/drivers/cliffhgr.cpp b/src/mame/drivers/cliffhgr.cpp index 1f49f2b173d..71a88c07515 100644 --- a/src/mame/drivers/cliffhgr.cpp +++ b/src/mame/drivers/cliffhgr.cpp @@ -102,7 +102,7 @@ public: required_device m_laserdisc; int m_port_bank; - UINT32 m_phillips_code; + uint32_t m_phillips_code; emu_timer *m_irq_timer; DECLARE_WRITE8_MEMBER(cliff_test_led_w); diff --git a/src/mame/drivers/clshroad.cpp b/src/mame/drivers/clshroad.cpp index 64a22eb97d3..e711ff39dc6 100644 --- a/src/mame/drivers/clshroad.cpp +++ b/src/mame/drivers/clshroad.cpp @@ -474,7 +474,7 @@ without this the death sequence never ends so the game is unplayable after you die once, it would be nice to avoid the hack however */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x05C6] = 0xc3; ROM[0x05C7] = 0x8d; diff --git a/src/mame/drivers/cm1800.cpp b/src/mame/drivers/cm1800.cpp index 7659e8ec41d..c2e9d97ef8e 100644 --- a/src/mame/drivers/cm1800.cpp +++ b/src/mame/drivers/cm1800.cpp @@ -52,7 +52,7 @@ public: DECLARE_READ8_MEMBER( term_status_r ); DECLARE_READ8_MEMBER( term_r ); DECLARE_WRITE8_MEMBER( kbd_put ); - UINT8 m_term_data; + uint8_t m_term_data; required_device m_terminal; virtual void machine_reset() override; @@ -66,7 +66,7 @@ READ8_MEMBER( cm1800_state::term_status_r ) READ8_MEMBER( cm1800_state::term_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/cmi.cpp b/src/mame/drivers/cmi.cpp index 24b9b232e20..9cfbea08cea 100644 --- a/src/mame/drivers/cmi.cpp +++ b/src/mame/drivers/cmi.cpp @@ -211,8 +211,8 @@ static const int ch_int_levels[8] = class cmi01a_device : public device_t, public device_sound_interface { public: - cmi01a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - cmi01a_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); + cmi01a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + cmi01a_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 set_channel_number(device_t &device, int channel) { dynamic_cast(device).m_channel = channel; } @@ -264,18 +264,18 @@ private: void update_interrupts(); emu_timer * m_zx_timer; - UINT8 m_zx_flag; - UINT8 m_zx_ff; + uint8_t m_zx_flag; + uint8_t m_zx_ff; int m_channel; - std::unique_ptr m_wave_ram; - UINT16 m_segment_cnt; - UINT8 m_new_addr; // Flag - UINT8 m_env_dir_ctrl; - UINT8 m_vol_latch; - UINT8 m_flt_latch; - UINT8 m_rp; - UINT8 m_ws; + std::unique_ptr m_wave_ram; + uint16_t m_segment_cnt; + uint8_t m_new_addr; // Flag + uint8_t m_env_dir_ctrl; + uint8_t m_vol_latch; + uint8_t m_flt_latch; + uint8_t m_rp; + uint8_t m_ws; int m_dir; double m_freq; @@ -293,7 +293,7 @@ private: const device_type CMI01A_CHANNEL_CARD = &device_creator; -cmi01a_device::cmi01a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cmi01a_device::cmi01a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, CMI01A_CHANNEL_CARD, "Fairlight CMI-01A Channel Card", tag, owner, clock, "cmi_01a", __FILE__) , device_sound_interface(mconfig, *this) , m_pia_0(*this, "cmi01a_pia_0") @@ -341,7 +341,7 @@ void cmi01a_device::sound_stream_update(sound_stream &stream, stream_sample_t ** { int length = samples; int seg_addr = m_segment_cnt & 0x7f; - UINT8 *wave_ptr = &m_wave_ram[m_segment_cnt & 0x3fff]; + uint8_t *wave_ptr = &m_wave_ram[m_segment_cnt & 0x3fff]; stream_sample_t *buf = outputs[0]; while (length--) @@ -360,7 +360,7 @@ void cmi01a_device::sound_stream_update(sound_stream &stream, stream_sample_t ** void cmi01a_device::device_start() { - m_wave_ram = std::make_unique(0x4000); + m_wave_ram = std::make_unique(0x4000); m_zx_timer = timer_alloc(TIMER_ZX); m_zx_timer->adjust(attotime::never); @@ -498,7 +498,7 @@ public: DECLARE_WRITE_LINE_MEMBER( pia_q219_irqa ); DECLARE_WRITE_LINE_MEMBER( pia_q219_irqb ); DECLARE_WRITE_LINE_MEMBER( ptm_q219_irq ); - UINT32 screen_update_cmi2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cmi2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // Memory mapping DECLARE_READ8_MEMBER( rom_r ); @@ -619,7 +619,7 @@ protected: required_ioport_array<3> m_key_mux_ports[4]; - required_shared_ptr m_cmi07_ram; + required_shared_ptr m_cmi07_ram; address_space *m_cpu1space; address_space *m_cpu2space; @@ -631,11 +631,11 @@ private: emu_timer *m_cmi10_scnd_timer; emu_timer *m_jam_timeout_timer; - UINT8 m_video_data; + uint8_t m_video_data; // Memory - bool map_is_active(int cpunum, int map, UINT8 *map_info); - void update_address_space(int cpunum, UINT8 mapinfo); + bool map_is_active(int cpunum, int map, uint8_t *map_info); + void update_address_space(int cpunum, uint8_t mapinfo); void install_video_ram(int cpunum); void install_peripherals(int cpunum); @@ -646,53 +646,53 @@ private: // Floppy void dma_fdc_rom(); - void write_fdc_ctrl(UINT8 data); + void write_fdc_ctrl(uint8_t data); void fdc_dma_transfer(); // Q133 CPU Card - UINT8 *m_q133_rom; - UINT8 m_q133_acia_irq; + uint8_t *m_q133_rom; + uint8_t m_q133_acia_irq; - UINT8 m_hp_int; - std::unique_ptr m_shared_ram; - std::unique_ptr m_scratch_ram[2]; + uint8_t m_hp_int; + std::unique_ptr m_shared_ram; + std::unique_ptr m_scratch_ram[2]; /* Memory management */ - UINT8 m_map_sel[16]; - std::unique_ptr m_map_ram[2]; - std::unique_ptr m_q256_ram[2]; - UINT8 m_map_ram_latch; + uint8_t m_map_sel[16]; + std::unique_ptr m_map_ram[2]; + std::unique_ptr m_q256_ram[2]; + uint8_t m_map_ram_latch; int m_cpu_active_space[2]; // TODO: Make one register int m_cpu_map_switch[2]; - UINT8 m_irq_address[2][2]; + uint8_t m_irq_address[2][2]; int m_m6809_bs_hack_cnt; int m_m6809_bs_hack_cpu; /* Q219 lightpen/graphics card */ - std::unique_ptr m_video_ram; - UINT16 m_x_pos; - UINT8 m_y_pos; - UINT16 m_lp_x; - UINT8 m_lp_y; - UINT8 m_q219_b_touch; + std::unique_ptr m_video_ram; + uint16_t m_x_pos; + uint8_t m_y_pos; + uint16_t m_lp_x; + uint8_t m_lp_y; + uint8_t m_q219_b_touch; /* QFC9 floppy disk controller card */ - UINT8 * m_qfc9_region_ptr; + uint8_t * m_qfc9_region_ptr; int m_fdc_drq; - UINT8 m_fdc_addr; - UINT8 m_fdc_ctrl; - UINT8 m_fdc_status; + uint8_t m_fdc_addr; + uint8_t m_fdc_ctrl; + uint8_t m_fdc_status; PAIR m_fdc_dma_addr; PAIR m_fdc_dma_cnt; /* CMI-07 */ - UINT8 m_cmi07_ctrl; + uint8_t m_cmi07_ctrl; /* CMI-10 */ - UINT8 m_scnd; + uint8_t m_scnd; /* Musical keyboard */ - UINT8 m_msm5832_addr; + uint8_t m_msm5832_addr; int m_mkbd_kbd_acia_irq; int m_mkbd_cmi_acia_irq; @@ -710,20 +710,20 @@ private: * *************************************/ -UINT32 cmi_state::screen_update_cmi2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cmi_state::screen_update_cmi2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const pen_t *pen = m_palette->pens(); - UINT8 y_scroll = m_q219_pia->a_output(); - UINT8 invert = (!BIT(m_q219_pia->b_output(), 3)) & 1; + uint8_t y_scroll = m_q219_pia->a_output(); + uint8_t invert = (!BIT(m_q219_pia->b_output(), 3)) & 1; for (int y = cliprect.min_y; y <= cliprect.max_y; ++y) { - UINT8 *src = &m_video_ram[(512/8) * ((y + y_scroll) & 0xff)]; - UINT32 *dest = &bitmap.pix32(y, cliprect.min_x); + uint8_t *src = &m_video_ram[(512/8) * ((y + y_scroll) & 0xff)]; + uint32_t *dest = &bitmap.pix32(y, cliprect.min_x); for (int x = cliprect.min_x; x <= cliprect.max_x; x += 8) { - UINT8 data = *src++; + uint8_t data = *src++; /* Store 8 pixels */ for (int i = 0; i < 8; ++i) @@ -783,7 +783,7 @@ void cmi_state::hblank() void cmi_state::update_video_pos(int y, int x, int byte_size) { - UINT8 *video_addr = &m_video_ram[m_y_pos * (512 / 8) + (m_x_pos / 8)]; + uint8_t *video_addr = &m_video_ram[m_y_pos * (512 / 8) + (m_x_pos / 8)]; if (byte_size) { @@ -892,8 +892,8 @@ READ8_MEMBER( cmi_state::vram_r ) READ8_MEMBER( cmi_state::rom_r ) { - UINT16 base = (&space == m_cpu2space ? 0x1000 : 0x2000); - return *(((UINT8 *)m_q133_region->base()) + base + offset); + uint16_t base = (&space == m_cpu2space ? 0x1000 : 0x2000); + return *(((uint8_t *)m_q133_region->base()) + base + offset); } WRITE8_MEMBER( cmi_state::map_ram_w ) @@ -906,7 +906,7 @@ WRITE8_MEMBER( cmi_state::map_ram_w ) { for (int i = 0; i < NUM_Q256_CARDS; ++i) { - UINT8 map_info; + uint8_t map_info; int map = (offset >> 6); int page_enable = ((m_map_ram_latch & 0x80) && (i == (m_map_ram_latch & 7))) ? 0x80 : 0; @@ -930,7 +930,7 @@ READ8_MEMBER( cmi_state::vector_r ) READ8_MEMBER( cmi_state::map_r ) { int cpunum = (&space.device() == m_maincpu1) ? 0 : 1; - UINT8 data = (m_cpu_active_space[1] << 2) | (m_cpu_active_space[0] << 1) | cpunum; + uint8_t data = (m_cpu_active_space[1] << 2) | (m_cpu_active_space[0] << 1) | cpunum; return data; } @@ -969,7 +969,7 @@ void cmi_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo case TIMER_MAP_SWITCH: { m_cpu_active_space[param] = m_cpu_map_switch[param]; - UINT8 map_info = (m_cpu_map_switch[param] == MAPPING_A) ? + uint8_t map_info = (m_cpu_map_switch[param] == MAPPING_A) ? m_map_sel[param ? MAPSEL_P2_A : MAPSEL_P1_A] : m_map_sel[param ? MAPSEL_P2_B : MAPSEL_P1_B]; update_address_space(param, map_info); @@ -1345,7 +1345,7 @@ static INPUT_PORTS_START( cmi2x ) PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F6") INPUT_PORTS_END -bool cmi_state::map_is_active(int cpunum, int map, UINT8 *map_info) +bool cmi_state::map_is_active(int cpunum, int map, uint8_t *map_info) { if (m_cpu_active_space[cpunum] == MAPPING_A) { @@ -1365,7 +1365,7 @@ bool cmi_state::map_is_active(int cpunum, int map, UINT8 *map_info) return 0; } -void cmi_state::update_address_space(int cpunum, UINT8 mapinfo) +void cmi_state::update_address_space(int cpunum, uint8_t mapinfo) { int map = mapinfo & 0x1f; bool vram_en = !BIT(mapinfo, 5); @@ -1380,7 +1380,7 @@ void cmi_state::update_address_space(int cpunum, UINT8 mapinfo) for (int page = 0; page < PAGE_COUNT; ++page) { int address = page * PAGE_SIZE; - UINT8 page_info = 0; + uint8_t page_info = 0; /* Scan through the cards */ for (i = 0; i < NUM_Q256_CARDS; ++i) @@ -1438,7 +1438,7 @@ WRITE8_MEMBER( cmi_state::cmi07_w ) m_cmi07cpu->set_input_line(INPUT_LINE_HALT, BIT(data, 3) ? CLEAR_LINE : ASSERT_LINE); /* We need to update the address spaces */ - UINT8 map_info = (m_cpu_active_space[0] == MAPPING_A) ? m_map_sel[MAPSEL_P1_A] : m_map_sel[MAPSEL_P1_B]; + uint8_t map_info = (m_cpu_active_space[0] == MAPPING_A) ? m_map_sel[MAPSEL_P1_A] : m_map_sel[MAPSEL_P1_B]; update_address_space(0, map_info); map_info = (m_cpu_active_space[1] == MAPPING_A) ? m_map_sel[MAPSEL_P2_A] : m_map_sel[MAPSEL_P2_B]; @@ -1503,11 +1503,11 @@ READ8_MEMBER( cmi_state::ank_col_r ) void cmi_state::dma_fdc_rom() { /* DMA channel 1 is used*/ - UINT8 map_info = m_map_sel[MAPSEL_P2_A_DMA1]; + uint8_t map_info = m_map_sel[MAPSEL_P2_A_DMA1]; int map = map_info & 0x1f; int addr = m_fdc_dma_addr.w.l & ~PAGE_MASK; int page = addr / PAGE_SIZE; - UINT8 p_info = 0; + uint8_t p_info = 0; /* Active low */ m_fdc_status &= ~FDC_STATUS_DRIVER_LOAD; @@ -1537,7 +1537,7 @@ void cmi_state::dma_fdc_rom() m_fdc_dma_cnt.w.l = 0; } -void cmi_state::write_fdc_ctrl(UINT8 data) +void cmi_state::write_fdc_ctrl(uint8_t data) { int drive = data & 1; int side = BIT(data, 5) ? 1 : 0; @@ -1602,7 +1602,7 @@ READ8_MEMBER( cmi_state::fdc_r ) void cmi_state::fdc_dma_transfer() { /* DMA channel 1 is used*/ - UINT8 map_info = m_map_sel[MAPSEL_P2_A_DMA1]; + uint8_t map_info = m_map_sel[MAPSEL_P2_A_DMA1]; int map = map_info & 0x1f; int cpu_page = (m_fdc_dma_addr.w.l & ~PAGE_MASK) / PAGE_SIZE; @@ -1623,7 +1623,7 @@ void cmi_state::fdc_dma_transfer() if (!BIT(m_fdc_ctrl, 4)) { /* Read a byte at a time */ - UINT8 data = m_wd1791->data_r() ^ 0xff; + uint8_t data = m_wd1791->data_r() ^ 0xff; if (m_fdc_dma_cnt.w.l == 0xffff) return; @@ -1649,7 +1649,7 @@ void cmi_state::fdc_dma_transfer() return; /* Write a byte at a time */ - UINT8 data = 0; + uint8_t data = 0; /* TODO: This should be stuck in a deferred write */ if (phys_page & 0x80) @@ -2006,7 +2006,7 @@ READ8_MEMBER( cmi01a_device::read ) if (space.debugger_access()) return 0; - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -2472,8 +2472,8 @@ READ_LINE_MEMBER( cmi_state::cmi10_u20_cb1_r ) WRITE_LINE_MEMBER( cmi_state::cmi10_u20_cb2_w ) { - UINT8 data = m_cmi10_pia_u20->a_output() & 0x7f; - UINT8 b_port = m_cmi10_pia_u20->b_output(); + uint8_t data = m_cmi10_pia_u20->a_output() & 0x7f; + uint8_t b_port = m_cmi10_pia_u20->b_output(); int addr = (BIT(b_port, 0) << 1) | BIT(b_port, 1); address_space &space = m_maincpu1->space(AS_PROGRAM); // Just needed to call data_w @@ -2526,13 +2526,13 @@ READ8_MEMBER( cmi_state::cmi10_u21_a_r ) int sel = m_cmi10_pia_u20->a_output(); int key = sel & 7; int mux = (sel >> 3) & 3; - UINT8 data = 0x38; // slave keyboard not used + uint8_t data = 0x38; // slave keyboard not used for (int module = 0; module < 3; ++module) { // char keyname[16]; - UINT8 keyval; + uint8_t keyval; int state = 1; if (mux == 0 && key == 3) @@ -2567,11 +2567,11 @@ READ8_MEMBER( cmi_state::cmi10_u21_a_r ) int sel = m_cmi10_pia_u20->a_output(); int key = sel & 7; int mux = (sel >> 3) & 3; - UINT8 data = 0xf8; // slave keyboard not used + uint8_t data = 0xf8; // slave keyboard not used for (int module = 0; module < 3; ++module) { - UINT8 keyval = m_key_mux_ports[mux][module]->read(); + uint8_t keyval = m_key_mux_ports[mux][module]->read(); data |= BIT(keyval, key) << module; } @@ -2641,7 +2641,7 @@ void cmi_state::machine_reset() m_cpu1space = &m_maincpu1->space(AS_PROGRAM); m_cpu2space = &m_maincpu2->space(AS_PROGRAM); - m_qfc9_region_ptr = (UINT8 *)m_qfc9_region->base(); + m_qfc9_region_ptr = (uint8_t *)m_qfc9_region->base(); /* Set 8214 interrupt lines */ m_i8214_0->etlg_w(1); @@ -2690,7 +2690,7 @@ void cmi_state::machine_reset() void cmi_state::machine_start() { - m_q133_rom = (UINT8 *)m_q133_region->base(); + m_q133_rom = (uint8_t *)m_q133_region->base(); // allocate timers for the built-in two channel timer m_map_switch_timer = timer_alloc(TIMER_MAP_SWITCH); @@ -2704,22 +2704,22 @@ void cmi_state::machine_start() m_jam_timeout_timer->adjust(attotime::never); /* Allocate 1kB memory mapping RAM */ - m_map_ram[0] = std::make_unique(0x400); - m_map_ram[1] = std::make_unique(0x400); + m_map_ram[0] = std::make_unique(0x400); + m_map_ram[1] = std::make_unique(0x400); /* Allocate 256kB for each Q256 RAM card */ - m_q256_ram[0] = std::make_unique(0x40000); - m_q256_ram[1] = std::make_unique(0x40000); + m_q256_ram[0] = std::make_unique(0x40000); + m_q256_ram[1] = std::make_unique(0x40000); /* Allocate 16kB video RAM */ - m_video_ram = std::make_unique(0x4000); + m_video_ram = std::make_unique(0x4000); /* Allocate 512B shared RAM */ - m_shared_ram = std::make_unique(0x200); + m_shared_ram = std::make_unique(0x200); /* Allocate 256B scratch RAM per CPU */ - m_scratch_ram[0] = std::make_unique(0x100); - m_scratch_ram[1] = std::make_unique(0x100); + m_scratch_ram[0] = std::make_unique(0x100); + m_scratch_ram[1] = std::make_unique(0x100); } INTERRUPT_GEN_MEMBER( cmi_state::cmi_iix_vblank ) diff --git a/src/mame/drivers/cmmb.cpp b/src/mame/drivers/cmmb.cpp index f8cfbec09c8..0a2ccacbcce 100644 --- a/src/mame/drivers/cmmb.cpp +++ b/src/mame/drivers/cmmb.cpp @@ -66,11 +66,11 @@ public: required_device m_maincpu; required_device m_flash; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_gfxdecode; required_device m_palette; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_READ8_MEMBER(cmmb_charram_r); DECLARE_WRITE8_MEMBER(cmmb_charram_w); @@ -82,7 +82,7 @@ public: //DECLARE_READ8_MEMBER(kludge_r); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cmmb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cmmb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); }; @@ -91,9 +91,9 @@ void cmmb_state::video_start() { } -UINT32 cmmb_state::screen_update_cmmb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cmmb_state::screen_update_cmmb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; gfx_element *gfx = m_gfxdecode->gfx(0); int count = 0x00000; @@ -116,14 +116,14 @@ UINT32 cmmb_state::screen_update_cmmb(screen_device &screen, bitmap_ind16 &bitma READ8_MEMBER(cmmb_state::cmmb_charram_r) { - UINT8 *GFX = memregion("gfx")->base(); + uint8_t *GFX = memregion("gfx")->base(); return GFX[offset]; } WRITE8_MEMBER(cmmb_state::cmmb_charram_w) { - UINT8 *GFX = memregion("gfx")->base(); + uint8_t *GFX = memregion("gfx")->base(); GFX[offset] = data; @@ -162,8 +162,8 @@ WRITE8_MEMBER(cmmb_state::cmmb_output_w) case 0x03: { - UINT8 *ROM = memregion("maincpu")->base(); - UINT32 bankaddress; + uint8_t *ROM = memregion("maincpu")->base(); + uint32_t bankaddress; bankaddress = 0x10000 + (0x4000 * (data & 0x0f)); membank("bank1")->set_base(&ROM[bankaddress]); diff --git a/src/mame/drivers/cninja.cpp b/src/mame/drivers/cninja.cpp index 3b668c62fd0..4449f489f2b 100644 --- a/src/mame/drivers/cninja.cpp +++ b/src/mame/drivers/cninja.cpp @@ -145,8 +145,8 @@ READ16_MEMBER( cninja_state::cninja_protection_region_0_104_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco104->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco104->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -154,7 +154,7 @@ WRITE16_MEMBER( cninja_state::cninja_protection_region_0_104_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco104->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -227,8 +227,8 @@ READ16_MEMBER( cninja_state::sshangha_protection_region_8_146_r ) { int real_address = 0x1a0000 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -236,18 +236,18 @@ WRITE16_MEMBER( cninja_state::sshangha_protection_region_8_146_w ) { int real_address = 0x1a0000 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } READ16_MEMBER( cninja_state::sshangha_protection_region_6_146_r ) { -// UINT16 realdat = deco16_60_prot_r(space,offset&0x3ff,mem_mask); +// uint16_t realdat = deco16_60_prot_r(space,offset&0x3ff,mem_mask); int real_address = 0x198000 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); // if ((realdat & mem_mask) != (data & mem_mask)) @@ -263,7 +263,7 @@ WRITE16_MEMBER( cninja_state::sshangha_protection_region_6_146_w ) int real_address = 0x198000 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -333,8 +333,8 @@ READ16_MEMBER( cninja_state::mutantf_protection_region_0_146_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -342,7 +342,7 @@ WRITE16_MEMBER( cninja_state::mutantf_protection_region_0_146_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -2310,8 +2310,8 @@ DRIVER_INIT_MEMBER(cninja_state,cninjabl2) DRIVER_INIT_MEMBER(cninja_state,mutantf) { - const UINT8 *src = memregion("gfx2")->base(); - UINT8 *dst = memregion("gfx1")->base(); + const uint8_t *src = memregion("gfx2")->base(); + uint8_t *dst = memregion("gfx1")->base(); /* The 16x16 graphic has some 8x8 chars in it - decode them in GFX1 */ memcpy(dst + 0x50000, dst + 0x10000, 0x10000); diff --git a/src/mame/drivers/cntsteer.cpp b/src/mame/drivers/cntsteer.cpp index 7bcc7bc15ae..ee5bbfd6a83 100644 --- a/src/mame/drivers/cntsteer.cpp +++ b/src/mame/drivers/cntsteer.cpp @@ -55,10 +55,10 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram2; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram2; /* video-related */ tilemap_t *m_bg_tilemap; @@ -111,8 +111,8 @@ public: DECLARE_MACHINE_RESET(zerotrgt); DECLARE_VIDEO_START(zerotrgt); DECLARE_PALETTE_INIT(zerotrgt); - UINT32 screen_update_cntsteer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_zerotrgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cntsteer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_zerotrgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(subcpu_vblank_irq); INTERRUPT_GEN_MEMBER(sound_interrupt); void zerotrgt_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); @@ -123,7 +123,7 @@ public: PALETTE_INIT_MEMBER(cntsteer_state,zerotrgt) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < palette.entries(); i++) { @@ -304,7 +304,7 @@ void cntsteer_state::cntsteer_draw_sprites( bitmap_ind16 &bitmap, const rectangl } } -UINT32 cntsteer_state::screen_update_zerotrgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cntsteer_state::screen_update_zerotrgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_disable_roz) bitmap.fill(m_palette->pen(8 * m_bg_color_bank), cliprect); @@ -353,7 +353,7 @@ UINT32 cntsteer_state::screen_update_zerotrgt(screen_device &screen, bitmap_ind1 return 0; } -UINT32 cntsteer_state::screen_update_cntsteer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cntsteer_state::screen_update_cntsteer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_disable_roz) bitmap.fill(m_palette->pen(8 * m_bg_color_bank), cliprect); @@ -414,7 +414,7 @@ UINT32 cntsteer_state::screen_update_cntsteer(screen_device &screen, bitmap_ind1 */ WRITE8_MEMBER(cntsteer_state::zerotrgt_vregs_w) { -// static UINT8 test[5]; +// static uint8_t test[5]; // test[offset] = data; // popmessage("%02x %02x %02x %02x %02x",test[0],test[1],test[2],test[3],test[4]); @@ -439,7 +439,7 @@ WRITE8_MEMBER(cntsteer_state::zerotrgt_vregs_w) WRITE8_MEMBER(cntsteer_state::cntsteer_vregs_w) { -// static UINT8 test[5]; +// static uint8_t test[5]; // test[offset] = data; // popmessage("%02x %02x %02x %02x %02x",test[0],test[1],test[2],test[3],test[4]); @@ -537,7 +537,7 @@ WRITE8_MEMBER(cntsteer_state::cntsteer_main_irq_w) /* Convert weird input handling with MAME standards.*/ READ8_MEMBER(cntsteer_state::cntsteer_adx_r) { - UINT8 res = 0, adx_val; + uint8_t res = 0, adx_val; adx_val = ioport("AN_STEERING")->read(); if (adx_val >= 0x70 && adx_val <= 0x90) @@ -632,7 +632,7 @@ INTERRUPT_GEN_MEMBER(cntsteer_state::subcpu_vblank_irq) // That's my best guess so far about how Slave is supposed to stop execution on Master CPU, the lack of any realistic write // between these operations brings us to this. // Game currently returns error on MIX CPU RAM because halt-ing BACK CPU doesn't happen when it should of course ... -// UINT8 dp_r = (UINT8)device.state().state_int(M6809_DP); +// uint8_t dp_r = (uint8_t)device.state().state_int(M6809_DP); // m_maincpu->set_input_line(INPUT_LINE_HALT, dp_r ? ASSERT_LINE : CLEAR_LINE); m_subcpu->set_input_line(M6809_IRQ_LINE, ASSERT_LINE); } @@ -1180,8 +1180,8 @@ ROM_END void cntsteer_state::zerotrgt_rearrange_gfx( int romsize, int romarea ) { - UINT8 *src = memregion("gfx4")->base(); - UINT8 *dst = memregion("gfx3")->base(); + uint8_t *src = memregion("gfx4")->base(); + uint8_t *dst = memregion("gfx3")->base(); int rm; int cnt1; @@ -1200,7 +1200,7 @@ void cntsteer_state::zerotrgt_rearrange_gfx( int romsize, int romarea ) #if 0 DRIVER_INIT_MEMBER(cntsteer_state,cntsteer) { - UINT8 *RAM = memregion("subcpu")->base(); + uint8_t *RAM = memregion("subcpu")->base(); RAM[0xc2cf] = 0x43; /* Patch out Cpu 1 ram test - it never ends..?! */ RAM[0xc2d0] = 0x43; diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp index 8b440c98659..dd11cf974b3 100644 --- a/src/mame/drivers/cobra.cpp +++ b/src/mame/drivers/cobra.cpp @@ -347,10 +347,10 @@ struct cobra_polydata { - UINT32 alpha_test; - UINT32 zmode; - UINT32 tex_format; - UINT32 tex_address; + uint32_t alpha_test; + uint32_t zmode; + uint32_t tex_format; + uint32_t tex_address; }; class cobra_renderer : public poly_manager @@ -359,7 +359,7 @@ public: cobra_renderer(screen_device &screen) : poly_manager(screen) { - m_texture_ram = std::make_unique(0x100000); + m_texture_ram = std::make_unique(0x100000); m_framebuffer = std::make_unique( 1024, 1024); m_backbuffer = std::make_unique( 1024, 1024); @@ -367,10 +367,10 @@ public: m_zbuffer = std::make_unique(1024, 1024); m_stencil = std::make_unique(1024, 1024); - m_gfx_regmask = std::make_unique(0x100); + m_gfx_regmask = std::make_unique(0x100); for (int i=0; i < 0x100; i++) { - UINT32 mask = 0; + uint32_t mask = 0; if (i & 0x01) mask |= 0x0000000f; if (i & 0x02) mask |= 0x000000f0; if (i & 0x04) mask |= 0x00000f00; @@ -384,22 +384,22 @@ public: } } - void render_texture_scan(INT32 scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid); - void render_color_scan(INT32 scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid); - void draw_point(const rectangle &visarea, vertex_t &v, UINT32 color); + void render_texture_scan(int32_t scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid); + void render_color_scan(int32_t scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid); + void draw_point(const rectangle &visarea, vertex_t &v, uint32_t color); void draw_line(const rectangle &visarea, vertex_t &v1, vertex_t &v2); void gfx_init(); void gfx_exit(); void gfx_reset(); void gfx_fifo_exec(); - UINT32 gfx_read_gram(UINT32 address); - void gfx_write_gram(UINT32 address, UINT32 mask, UINT32 data); - UINT64 gfx_read_reg(); - void gfx_write_reg(UINT64 data); + uint32_t gfx_read_gram(uint32_t address); + void gfx_write_gram(uint32_t address, uint32_t mask, uint32_t data); + uint64_t gfx_read_reg(); + void gfx_write_reg(uint64_t data); void display(bitmap_rgb32 *bitmap, const rectangle &cliprect); - inline rgb_t texture_fetch(UINT32 *texture, int u, int v, int width, int format); + inline rgb_t texture_fetch(uint32_t *texture, int u, int v, int width, int format); private: std::unique_ptr m_framebuffer; std::unique_ptr m_backbuffer; @@ -407,15 +407,15 @@ private: std::unique_ptr m_zbuffer; std::unique_ptr m_stencil; - std::unique_ptr m_texture_ram; + std::unique_ptr m_texture_ram; - std::unique_ptr m_gfx_gram; - std::unique_ptr m_gfx_regmask; + std::unique_ptr m_gfx_gram; + std::unique_ptr m_gfx_regmask; - UINT32 m_gfx_register_select; - std::unique_ptr m_gfx_register; + uint32_t m_gfx_register_select; + std::unique_ptr m_gfx_register; - UINT32 m_texram_ptr; + uint32_t m_texram_ptr; enum { @@ -452,7 +452,7 @@ public: cobra_fifo(running_machine &machine, int capacity, const char *name, bool verbose, event_delegate event_callback) { - m_data = std::make_unique(capacity); + m_data = std::make_unique(capacity); m_name = name; m_size = capacity; @@ -465,8 +465,8 @@ public: m_event_callback = event_callback; } - void push(const device_t *cpu, UINT64 data); - bool pop(const device_t *cpu, UINT64 *result); + void push(const device_t *cpu, uint64_t data); + bool pop(const device_t *cpu, uint64_t *result); bool pop(const device_t *cpu, float *result); int current_num(); int space_left(); @@ -482,7 +482,7 @@ private: int m_num; bool m_verbose; const char *m_name; - std::unique_ptr m_data; + std::unique_ptr m_data; event_delegate m_event_callback; }; @@ -492,15 +492,15 @@ private: class cobra_jvs : public jvs_device { public: - cobra_jvs(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + cobra_jvs(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE_LINE_MEMBER(coin_1_w); DECLARE_WRITE_LINE_MEMBER(coin_2_w); protected: - virtual bool switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switch) override; - virtual bool coin_counters(UINT8 *&buf, UINT8 count) override; - virtual void function_list(UINT8 *&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 void function_list(uint8_t *&buf) override; private: int m_coin_counter[2]; @@ -510,7 +510,7 @@ private: const device_type COBRA_JVS = &device_creator; -cobra_jvs::cobra_jvs(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cobra_jvs::cobra_jvs(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : jvs_device(mconfig, COBRA_JVS, "JVS (COBRA)", tag, owner, clock, "cobra_jvs", __FILE__), m_test_port(*this, ":TEST"), m_player_ports(*this, {":P1", ":P2"}) @@ -531,7 +531,7 @@ WRITE_LINE_MEMBER(cobra_jvs::coin_2_w) m_coin_counter[1]++; } -void cobra_jvs::function_list(UINT8 *&buf) +void cobra_jvs::function_list(uint8_t *&buf) { // SW input - 2 players, 13 bits *buf++ = 0x01; *buf++ = 2; *buf++ = 13; *buf++ = 0; @@ -546,7 +546,7 @@ void cobra_jvs::function_list(UINT8 *&buf) *buf++ = 0x12; *buf++ = 6; *buf++ = 0; *buf++ = 0; } -bool cobra_jvs::switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switch) +bool cobra_jvs::switches(uint8_t *&buf, uint8_t count_players, uint8_t bytes_per_switch) { #if LOG_JVS printf("jvs switch read: num players %d, bytes %d\n", count_players, bytes_per_switch); @@ -559,16 +559,16 @@ bool cobra_jvs::switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_switc for (int i=0; i < count_players; i++) { - UINT32 pval = m_player_ports[i].read_safe(0); + uint32_t pval = m_player_ports[i].read_safe(0); for (int j=0; j < bytes_per_switch; j++) { - *buf++ = (UINT8)(pval >> ((1-j) * 8)); + *buf++ = (uint8_t)(pval >> ((1-j) * 8)); } } return true; } -bool cobra_jvs::coin_counters(UINT8 *&buf, UINT8 count) +bool cobra_jvs::coin_counters(uint8_t *&buf, uint8_t count) { #if LOG_JVS printf("jvs coin counter read: count %d\n", count); @@ -591,23 +591,23 @@ bool cobra_jvs::coin_counters(UINT8 *&buf, UINT8 count) class cobra_jvs_host : public jvs_host { public: - cobra_jvs_host(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - void write(UINT8, const UINT8 *&rec_data, UINT32 &rec_size); + cobra_jvs_host(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void write(uint8_t, const uint8_t *&rec_data, uint32_t &rec_size); private: - UINT8 m_send[512]; + uint8_t m_send[512]; int m_send_ptr; }; const device_type COBRA_JVS_HOST = &device_creator; -cobra_jvs_host::cobra_jvs_host(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +cobra_jvs_host::cobra_jvs_host(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : jvs_host(mconfig, COBRA_JVS_HOST, "JVS-HOST (COBRA)", tag, owner, clock, "cobra_jvs_host", __FILE__) { m_send_ptr = 0; } -void cobra_jvs_host::write(UINT8 data, const UINT8 *&rec_data, UINT32 &rec_size) +void cobra_jvs_host::write(uint8_t data, const uint8_t *&rec_data, uint32_t &rec_size) { m_send[m_send_ptr++] = data; push(data); @@ -616,7 +616,7 @@ void cobra_jvs_host::write(UINT8 data, const UINT8 *&rec_data, UINT32 &rec_size) { if (m_send_ptr > 2) { - UINT8 length = m_send[2]; + uint8_t length = m_send[2]; if (length == 0xff) length = 4; else @@ -669,16 +669,16 @@ public: required_device m_maincpu; required_device m_subcpu; required_device m_gfxcpu; - required_shared_ptr m_gfx_pagetable; + required_shared_ptr m_gfx_pagetable; required_device m_k001604; required_device m_ata; required_device m_screen; required_device m_palette; - required_shared_ptr m_generic_paletteram_32; - required_shared_ptr m_main_ram; - required_shared_ptr m_sub_ram; - required_shared_ptr m_gfx_ram0; - required_shared_ptr m_gfx_ram1; + required_shared_ptr m_generic_paletteram_32; + required_shared_ptr m_main_ram; + required_shared_ptr m_sub_ram; + required_shared_ptr m_gfx_ram0; + required_shared_ptr m_gfx_ram1; DECLARE_READ64_MEMBER(main_comram_r); DECLARE_WRITE64_MEMBER(main_comram_w); @@ -739,17 +739,17 @@ public: MAIN_INT_S2M = 0x02 }; - UINT8 m_m2s_int_enable; - UINT8 m_s2m_int_enable; - UINT8 m_vblank_enable; + uint8_t m_m2s_int_enable; + uint8_t m_s2m_int_enable; + uint8_t m_vblank_enable; - UINT8 m_m2s_int_mode; - UINT8 m_s2m_int_mode; + uint8_t m_m2s_int_mode; + uint8_t m_s2m_int_mode; - UINT8 m_main_int_active; + uint8_t m_main_int_active; - std::unique_ptr m_comram[2]; + std::unique_ptr m_comram[2]; int m_comram_page; int m_main_debug_state; @@ -759,18 +759,18 @@ public: int m_gfx_debug_state; int m_gfx_debug_state_wc; - UINT32 m_sub_psac_reg; + uint32_t m_sub_psac_reg; int m_sub_psac_count; - UINT32 m_sub_interrupt; + uint32_t m_sub_interrupt; - UINT8 m_gfx_unk_flag; - UINT32 m_gfx_re_command_word1; - UINT32 m_gfx_re_command_word2; + uint8_t m_gfx_unk_flag; + uint32_t m_gfx_re_command_word1; + uint32_t m_gfx_re_command_word2; int m_gfx_re_word_count; int m_gfx_re_status; - UINT32 m_gfx_unk_status; + uint32_t m_gfx_unk_status; - UINT64 m_gfx_fifo_mem[256]; + uint64_t m_gfx_fifo_mem[256]; int m_gfx_fifo_cache_addr; int m_gfx_fifo_loopback; int m_gfx_unknown_v1; @@ -778,9 +778,9 @@ public: bool m_has_psac; - std::unique_ptr m_sound_dma_buffer_l; - std::unique_ptr m_sound_dma_buffer_r; - UINT32 m_sound_dma_ptr; + std::unique_ptr m_sound_dma_buffer_l; + std::unique_ptr m_sound_dma_buffer_r; + uint32_t m_sound_dma_ptr; dmadac_sound_device *m_dmadac[2]; @@ -790,15 +790,15 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(cobra_vblank); void cobra_video_exit(); int decode_debug_state_value(int v); }; -void cobra_renderer::render_color_scan(INT32 scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid) +void cobra_renderer::render_color_scan(int32_t scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid) { - UINT32 *fb = &m_backbuffer->pix32(scanline); + uint32_t *fb = &m_backbuffer->pix32(scanline); float *zb = (float*)&m_zbuffer->pix32(scanline); float z = extent.param[POLY_Z].start; @@ -813,15 +813,15 @@ void cobra_renderer::render_color_scan(INT32 scanline, const extent_t &extent, c float ga = extent.param[POLY_A].start; float dga = extent.param[POLY_A].dpdx; - UINT32 zmode = extradata.zmode; + uint32_t zmode = extradata.zmode; for (int x = extent.startx; x < extent.stopx; x++) { if (z <= zb[x] || zmode == 7) { - UINT32 r = (int)(gr); - UINT32 g = (int)(gg); - UINT32 b = (int)(gb); + uint32_t r = (int)(gr); + uint32_t g = (int)(gg); + uint32_t b = (int)(gb); if (r > 255) r = 255; if (g > 255) g = 255; @@ -842,9 +842,9 @@ void cobra_renderer::render_color_scan(INT32 scanline, const extent_t &extent, c } } -rgb_t cobra_renderer::texture_fetch(UINT32 *texture, int u, int v, int width, int format) +rgb_t cobra_renderer::texture_fetch(uint32_t *texture, int u, int v, int width, int format) { - UINT32 texel = texture[((v * width) + u) / 2]; + uint32_t texel = texture[((v * width) + u) / 2]; if (u & 1) { @@ -877,7 +877,7 @@ rgb_t cobra_renderer::texture_fetch(UINT32 *texture, int u, int v, int width, in return color; } -void cobra_renderer::render_texture_scan(INT32 scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid) +void cobra_renderer::render_texture_scan(int32_t scanline, const extent_t &extent, const cobra_polydata &extradata, int threadid) { float u = extent.param[POLY_U].start; float v = extent.param[POLY_V].start; @@ -899,16 +899,16 @@ void cobra_renderer::render_texture_scan(INT32 scanline, const extent_t &extent, float ga = extent.param[POLY_A].start; float dga = extent.param[POLY_A].dpdx; - UINT32 *fb = &m_backbuffer->pix32(scanline); + uint32_t *fb = &m_backbuffer->pix32(scanline); float *zb = (float*)&m_zbuffer->pix32(scanline); - UINT32 texture_width = 1 << ((extradata.tex_format >> 28) & 0xf); - UINT32 texture_height = 1 << ((extradata.tex_format >> 24) & 0xf); - UINT32 tex_address = extradata.tex_address; + uint32_t texture_width = 1 << ((extradata.tex_format >> 28) & 0xf); + uint32_t texture_height = 1 << ((extradata.tex_format >> 24) & 0xf); + uint32_t tex_address = extradata.tex_address; - UINT32 alpha_test = extradata.alpha_test; - UINT32 zmode = extradata.zmode; - UINT32 tex_format = (extradata.tex_format >> 2) & 0x7; + uint32_t alpha_test = extradata.alpha_test; + uint32_t zmode = extradata.zmode; + uint32_t tex_format = (extradata.tex_format >> 2) & 0x7; for (int x = extent.startx; x < extent.stopx; x++) { @@ -953,9 +953,9 @@ void cobra_renderer::render_texture_scan(INT32 scanline, const extent_t &extent, if (a != 0 || !alpha_test) { - UINT32 gour = (int)(gr); - UINT32 goug = (int)(gg); - UINT32 goub = (int)(gb); + uint32_t gour = (int)(gr); + uint32_t goug = (int)(gg); + uint32_t goub = (int)(gb); int r = (texel.r() * gour) >> 8; int g = (texel.g() * goug) >> 8; @@ -996,7 +996,7 @@ void cobra_renderer::render_texture_scan(INT32 scanline, const extent_t &extent, } } -void cobra_renderer::draw_point(const rectangle &visarea, vertex_t &v, UINT32 color) +void cobra_renderer::draw_point(const rectangle &visarea, vertex_t &v, uint32_t color) { int x = v.x; int y = v.y; @@ -1004,7 +1004,7 @@ void cobra_renderer::draw_point(const rectangle &visarea, vertex_t &v, UINT32 co if (x >= visarea.min_x && x <= visarea.max_x && y >= visarea.min_y && y <= visarea.max_y) { - UINT32 *fb = &m_backbuffer->pix32(y); + uint32_t *fb = &m_backbuffer->pix32(y); fb[x] = color; } } @@ -1017,7 +1017,7 @@ void cobra_renderer::draw_line(const rectangle &visarea, vertex_t &v1, vertex_t int x1 = v1.x; int y1 = v1.y; - UINT32 color = 0xffffffff; // TODO: where does the color come from? + uint32_t color = 0xffffffff; // TODO: where does the color come from? if (v1.x < visarea.min_x || v1.x > visarea.max_x || v1.y < visarea.min_y || v1.y > visarea.max_y || @@ -1032,7 +1032,7 @@ void cobra_renderer::draw_line(const rectangle &visarea, vertex_t &v1, vertex_t { int y = y1 + (dy * (float)(x - x1) / (float)(dx)); - UINT32 *fb = &m_backbuffer->pix32(y); + uint32_t *fb = &m_backbuffer->pix32(y); fb[x] = color; x++; @@ -1045,7 +1045,7 @@ void cobra_renderer::draw_line(const rectangle &visarea, vertex_t &v1, vertex_t { int x = x1 + (dx * (float)(y - y1) / (float)(dy)); - UINT32 *fb = &m_backbuffer->pix32(y); + uint32_t *fb = &m_backbuffer->pix32(y); fb[x] = color; y++; @@ -1066,7 +1066,7 @@ void cobra_state::video_start() m_renderer->gfx_init(); } -UINT32 cobra_state::screen_update_cobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cobra_state::screen_update_cobra(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_has_psac) { @@ -1108,7 +1108,7 @@ int cobra_state::decode_debug_state_value(int v) } -void cobra_fifo::push(const device_t *cpu, UINT64 data) +void cobra_fifo::push(const device_t *cpu, uint64_t data) { if (m_verbose) { @@ -1124,7 +1124,7 @@ void cobra_fifo::push(const device_t *cpu, UINT64 data) sprintf(accessor_location, "(non-cpu)"); } - printf("%s: push %08X%08X (%d) at %s\n", m_name, (UINT32)(data >> 32), (UINT32)(data), m_num, accessor_location); + printf("%s: push %08X%08X (%d) at %s\n", m_name, (uint32_t)(data >> 32), (uint32_t)(data), m_num, accessor_location); } if (m_num == m_size) @@ -1152,9 +1152,9 @@ void cobra_fifo::push(const device_t *cpu, UINT64 data) printf(" "); for (i=0; i < 4; i++) { - UINT64 val = 0; + uint64_t val = 0; pop(cpu, &val); - printf("%08X ", (UINT32)(val)); + printf("%08X ", (uint32_t)(val)); } printf("\n"); } @@ -1181,9 +1181,9 @@ void cobra_fifo::push(const device_t *cpu, UINT64 data) m_event_callback(EVENT_HALF_FULL); } -bool cobra_fifo::pop(const device_t *cpu, UINT64 *result) +bool cobra_fifo::pop(const device_t *cpu, uint64_t *result) { - UINT64 r; + uint64_t r; if (m_num == 0) { @@ -1222,7 +1222,7 @@ bool cobra_fifo::pop(const device_t *cpu, UINT64 *result) sprintf(accessor_location, "(non-cpu)"); } - printf("%s: pop %08X%08X (%d) at %s\n", m_name, (UINT32)(r >> 32), (UINT32)(r), m_num-1, accessor_location); + printf("%s: pop %08X%08X (%d) at %s\n", m_name, (uint32_t)(r >> 32), (uint32_t)(r), m_num-1, accessor_location); } m_rpos++; @@ -1246,9 +1246,9 @@ bool cobra_fifo::pop(const device_t *cpu, UINT64 *result) bool cobra_fifo::pop(const device_t *cpu, float *result) { - UINT64 value = 0; + uint64_t value = 0; bool status = pop(cpu, &value); - *result = u2f((UINT32)(value)); + *result = u2f((uint32_t)(value)); return status; } @@ -1375,8 +1375,8 @@ void cobra_state::gfxfifo_out_event_callback(cobra_fifo::EventType event) // 0x02: S2M FIFO // 0x04: Vblank? -static UINT32 mpc106_regs[256/4]; -static UINT32 mpc106_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t mpc106_regs[256/4]; +static uint32_t mpc106_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { //printf("MPC106: PCI read %d, %02X, %08X\n", function, reg, mem_mask); @@ -1387,7 +1387,7 @@ static UINT32 mpc106_pci_r(device_t *busdevice, device_t *device, int function, return mpc106_regs[reg/4]; } -static void mpc106_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void mpc106_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { //printf("MPC106: PCI write %d, %02X, %08X, %08X\n", function, reg, data, mem_mask); COMBINE_DATA(mpc106_regs + (reg/4)); @@ -1409,7 +1409,7 @@ WRITE64_MEMBER(cobra_state::main_mpc106_w) READ64_MEMBER(cobra_state::main_fifo_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_56_63) { @@ -1438,7 +1438,7 @@ READ64_MEMBER(cobra_state::main_fifo_r) value |= m_comram_page ? 0x80 : 0x00; - r |= (UINT64)(value) << 56; + r |= (uint64_t)(value) << 56; } if (ACCESSING_BITS_48_55) { @@ -1450,10 +1450,10 @@ READ64_MEMBER(cobra_state::main_fifo_r) // Register 0xffff0002: // Sub-to-Main FIFO read data - UINT64 value; + uint64_t value; m_s2mfifo->pop(&space.device(), &value); - r |= (UINT64)(value & 0xff) << 40; + r |= (uint64_t)(value & 0xff) << 40; } if (ACCESSING_BITS_32_39) { @@ -1471,7 +1471,7 @@ READ64_MEMBER(cobra_state::main_fifo_r) value |= (m_main_int_active & MAIN_INT_M2S) ? 0x00 : 0x08; value |= (m_gfx_unk_flag & 0x80) ? 0x00 : 0x04; - r |= (UINT64)(value) << 32; + r |= (uint64_t)(value) << 32; } return r; @@ -1484,7 +1484,7 @@ WRITE64_MEMBER(cobra_state::main_fifo_w) // Register 0xffff0002: // Main-to-Sub FIFO write data - m_m2sfifo->push(&space.device(), (UINT8)(data >> 40)); + m_m2sfifo->push(&space.device(), (uint8_t)(data >> 40)); if (!m_m2s_int_mode) m_main_int_active &= ~MAIN_INT_M2S; @@ -1541,7 +1541,7 @@ WRITE64_MEMBER(cobra_state::main_fifo_w) //---------------- // x ? - m_vblank_enable = (UINT8)(data >> 24); + m_vblank_enable = (uint8_t)(data >> 24); if ((m_vblank_enable & 0x80) == 0) { @@ -1558,7 +1558,7 @@ WRITE64_MEMBER(cobra_state::main_fifo_w) //---------------- // x ? - m_s2m_int_enable = (UINT8)(data >> 16); + m_s2m_int_enable = (uint8_t)(data >> 16); if ((m_s2m_int_enable & 0x80) == 0) { @@ -1573,7 +1573,7 @@ WRITE64_MEMBER(cobra_state::main_fifo_w) // Register 0xffff0007: // ??? - printf("main_fifo_w: 0xffff0006: %02X\n", (UINT8)(data >> 8)); + printf("main_fifo_w: 0xffff0006: %02X\n", (uint8_t)(data >> 8)); } if (ACCESSING_BITS_0_7) { @@ -1584,7 +1584,7 @@ WRITE64_MEMBER(cobra_state::main_fifo_w) //---------------- // x ? - m_m2s_int_enable = (UINT8)(data); + m_m2s_int_enable = (uint8_t)(data); if ((m_m2s_int_enable & 0x80) == 0) { @@ -1624,9 +1624,9 @@ WRITE64_MEMBER(cobra_state::main_fifo_w) // install HD patches for bujutsu if (strcmp(space.machine().system().name, "bujutsu") == 0) { - UINT32 *main_ram = (UINT32*)(UINT64*)m_main_ram; - UINT32 *sub_ram = (UINT32*)m_sub_ram; - UINT32 *gfx_ram = (UINT32*)(UINT64*)m_gfx_ram0; + uint32_t *main_ram = (uint32_t*)(uint64_t*)m_main_ram; + uint32_t *sub_ram = (uint32_t*)m_sub_ram; + uint32_t *gfx_ram = (uint32_t*)(uint64_t*)m_gfx_ram0; main_ram[(0x0005ac^4) / 4] = 0x60000000; // skip IRQ fail main_ram[(0x001ec4^4) / 4] = 0x60000000; // waiting for IRQ? @@ -1649,16 +1649,16 @@ WRITE64_MEMBER(cobra_state::main_fifo_w) READ64_MEMBER(cobra_state::main_comram_r) { - UINT64 r = 0; + uint64_t r = 0; int page = m_comram_page; if (ACCESSING_BITS_32_63) { - r |= (UINT64)(m_comram[page][(offset << 1) + 0]) << 32; + r |= (uint64_t)(m_comram[page][(offset << 1) + 0]) << 32; } if (ACCESSING_BITS_0_31) { - r |= (UINT64)(m_comram[page][(offset << 1) + 1]); + r |= (uint64_t)(m_comram[page][(offset << 1) + 1]); } return r; @@ -1668,12 +1668,12 @@ WRITE64_MEMBER(cobra_state::main_comram_w) { int page = m_comram_page; - UINT32 w1 = m_comram[page][(offset << 1) + 0]; - UINT32 w2 = m_comram[page][(offset << 1) + 1]; - UINT32 d1 = (UINT32)(data >> 32); - UINT32 d2 = (UINT32)(data); - UINT32 m1 = (UINT32)(mem_mask >> 32); - UINT32 m2 = (UINT32)(mem_mask); + uint32_t w1 = m_comram[page][(offset << 1) + 0]; + uint32_t w2 = m_comram[page][(offset << 1) + 1]; + uint32_t d1 = (uint32_t)(data >> 32); + uint32_t d2 = (uint32_t)(data); + uint32_t m1 = (uint32_t)(mem_mask >> 32); + uint32_t m2 = (uint32_t)(mem_mask); m_comram[page][(offset << 1) + 0] = (w1 & ~m1) | (d1 & m1); m_comram[page][(offset << 1) + 1] = (w2 & ~m2) | (d2 & m2); @@ -1717,7 +1717,7 @@ ADDRESS_MAP_END READ32_MEMBER(cobra_state::sub_unk1_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_16_23) { @@ -1746,14 +1746,14 @@ WRITE32_MEMBER(cobra_state::sub_unk1_w) READ32_MEMBER(cobra_state::sub_mainbd_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { // Register 0x7E380000 // M2S FIFO read - UINT64 value = 0; + uint64_t value = 0; m_m2sfifo->pop(&space.device(), &value); r |= (value & 0xff) << 24; @@ -1774,7 +1774,7 @@ READ32_MEMBER(cobra_state::sub_mainbd_r) // x M2S FIFO half-full flag // x Comram page - UINT32 value = 0x00; + uint32_t value = 0x00; value |= m_s2mfifo->is_full() ? 0x00 : 0x01; value |= m_s2mfifo->is_empty() ? 0x00 : 0x02; value |= m_s2mfifo->is_half_full() ? 0x00 : 0x04; @@ -1798,7 +1798,7 @@ WRITE32_MEMBER(cobra_state::sub_mainbd_w) // Register 0x7E380000 // Sub-to-Main FIFO data - m_s2mfifo->push(&space.device(), (UINT8)(data >> 24)); + m_s2mfifo->push(&space.device(), (uint8_t)(data >> 24)); m_main_int_active |= MAIN_INT_S2M; @@ -1877,7 +1877,7 @@ WRITE32_MEMBER(cobra_state::sub_debug_w) READ32_MEMBER(cobra_state::sub_config_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_8_15) { @@ -1899,7 +1899,7 @@ READ16_MEMBER(cobra_state::sub_ata0_r) { mem_mask = ( mem_mask << 8 ) | ( mem_mask >> 8 ); - UINT32 data = m_ata->read_cs0(space, offset, mem_mask); + uint32_t data = m_ata->read_cs0(space, offset, mem_mask); data = ( data << 8 ) | ( data >> 8 ); return data; @@ -1917,7 +1917,7 @@ READ16_MEMBER(cobra_state::sub_ata1_r) { mem_mask = ( mem_mask << 8 ) | ( mem_mask >> 8 ); - UINT32 data = m_ata->read_cs1(space, offset, mem_mask); + uint32_t data = m_ata->read_cs1(space, offset, mem_mask); return ( data << 8 ) | ( data >> 8 ); } @@ -1981,8 +1981,8 @@ WRITE32_MEMBER(cobra_state::sub_sound_dma_w) fputc((data >> 0) & 0xff, out); */ - INT16 ldata = (INT16)(data >> 16); - INT16 rdata = (INT16)(data); + int16_t ldata = (int16_t)(data >> 16); + int16_t rdata = (int16_t)(data); m_sound_dma_buffer_l[m_sound_dma_ptr] = ldata; m_sound_dma_buffer_r[m_sound_dma_ptr] = rdata; @@ -2005,8 +2005,8 @@ WRITE8_MEMBER(cobra_state::sub_jvs_w) printf("sub_jvs_w: %02X\n", data); #endif - const UINT8 *rec_data; - UINT32 rec_size; + const uint8_t *rec_data; + uint32_t rec_size; jvs->write(data, rec_data, rec_size); @@ -2098,9 +2098,9 @@ void cobra_renderer::gfx_init() { const rectangle& visarea = screen().visible_area(); - m_gfx_gram = std::make_unique(0x40000); + m_gfx_gram = std::make_unique(0x40000); - m_gfx_register = std::make_unique(0x3000); + m_gfx_register = std::make_unique(0x3000); m_gfx_register_select = 0; float zvalue = 10000000.0f; @@ -2114,10 +2114,10 @@ void cobra_renderer::gfx_exit() file = fopen("texture_ram.bin","wb"); for (int i=0; i < 0x100000; i++) { - fputc((UINT8)(m_texture_ram[i] >> 24), file); - fputc((UINT8)(m_texture_ram[i] >> 16), file); - fputc((UINT8)(m_texture_ram[i] >> 8), file); - fputc((UINT8)(m_texture_ram[i] >> 0), file); + fputc((uint8_t)(m_texture_ram[i] >> 24), file); + fputc((uint8_t)(m_texture_ram[i] >> 16), file); + fputc((uint8_t)(m_texture_ram[i] >> 8), file); + fputc((uint8_t)(m_texture_ram[i] >> 0), file); } fclose(file); */ @@ -2130,7 +2130,7 @@ void cobra_renderer::gfx_reset() cobra->m_gfx_re_status = RE_STATUS_IDLE; } -UINT32 cobra_renderer::gfx_read_gram(UINT32 address) +uint32_t cobra_renderer::gfx_read_gram(uint32_t address) { if (!DWORD_ALIGNED(address)) { @@ -2147,8 +2147,8 @@ UINT32 cobra_renderer::gfx_read_gram(UINT32 address) (address >= 0xc8c00 && address < 0xc9000) || (address >= 0xccc00 && address < 0xcd000)) { - UINT32 a = (((address >> 2) & 0xff) * 2) + ((address & 0x4000) ? 1 : 0); - UINT32 page = ((m_gfx_gram[0xc3028/4] >> 9) * 0x800) + + uint32_t a = (((address >> 2) & 0xff) * 2) + ((address & 0x4000) ? 1 : 0); + uint32_t page = ((m_gfx_gram[0xc3028/4] >> 9) * 0x800) + ((address & 0x8000) ? 0x400 : 0) + ((m_gfx_gram[0xc3028/4] & 0x100) ? 0x200 : 0); @@ -2161,7 +2161,7 @@ UINT32 cobra_renderer::gfx_read_gram(UINT32 address) return m_gfx_gram[address/4]; } -void cobra_renderer::gfx_write_gram(UINT32 address, UINT32 mask, UINT32 data) +void cobra_renderer::gfx_write_gram(uint32_t address, uint32_t mask, uint32_t data) { switch ((address >> 16) & 0xf) { @@ -2169,7 +2169,7 @@ void cobra_renderer::gfx_write_gram(UINT32 address, UINT32 mask, UINT32 data) { if (address == 0x40fff) { - printf("gfx: reg 40fff = %d, %d\n", (UINT16)(data >> 16), (UINT16)(data)); + printf("gfx: reg 40fff = %d, %d\n", (uint16_t)(data >> 16), (uint16_t)(data)); } break; } @@ -2200,12 +2200,12 @@ void cobra_renderer::gfx_write_gram(UINT32 address, UINT32 mask, UINT32 data) m_gfx_gram[address/4] |= data & mask; } -UINT64 cobra_renderer::gfx_read_reg() +uint64_t cobra_renderer::gfx_read_reg() { return m_gfx_register[m_gfx_register_select]; } -void cobra_renderer::gfx_write_reg(UINT64 data) +void cobra_renderer::gfx_write_reg(uint64_t data) { switch (m_gfx_register_select) { @@ -2240,15 +2240,15 @@ void cobra_renderer::gfx_fifo_exec() while (fifo_in->current_num() >= 2) { - UINT64 in1, in2 = 0; - UINT32 w1, w2; + uint64_t in1, in2 = 0; + uint32_t w1, w2; if (cobra->m_gfx_re_status == RE_STATUS_IDLE) { fifo_in->pop(nullptr, &in1); fifo_in->pop(nullptr, &in2); - w1 = (UINT32)(in1); - w2 = (UINT32)(in2); + w1 = (uint32_t)(in1); + w2 = (uint32_t)(in2); cobra->m_gfx_re_command_word1 = w1; cobra->m_gfx_re_command_word2 = w2; @@ -2268,8 +2268,8 @@ void cobra_renderer::gfx_fifo_exec() { case 0x00: { - UINT64 param[6]; - UINT32 w[6]; + uint64_t param[6]; + uint32_t w[6]; if (fifo_in->current_num() < 6) { @@ -2286,8 +2286,8 @@ void cobra_renderer::gfx_fifo_exec() fifo_in->pop(nullptr, ¶m[4]); fifo_in->pop(nullptr, ¶m[5]); - w[0] = (UINT32)param[0]; w[1] = (UINT32)param[1]; w[2] = (UINT32)param[2]; - w[3] = (UINT32)param[3]; w[4] = (UINT32)param[4]; w[5] = (UINT32)param[5]; + w[0] = (uint32_t)param[0]; w[1] = (uint32_t)param[1]; w[2] = (uint32_t)param[2]; + w[3] = (uint32_t)param[3]; w[4] = (uint32_t)param[4]; w[5] = (uint32_t)param[5]; // mbuslib_pumpkin(): 0x00600000 0x10500010 // 0x00600000 0x10500018 @@ -2305,7 +2305,7 @@ void cobra_renderer::gfx_fifo_exec() // 64-bit registers, top 32-bits in word 2, low 32-bit in word 3 // printf("GFX: register write %08X: %08X %08X\n", m_gfx_register_select, w[2], w[3]); - gfx_write_reg(((UINT64)(w[2]) << 32) | w[3]); + gfx_write_reg(((uint64_t)(w[2]) << 32) | w[3]); } else if (w2 == 0x10521000) { @@ -2323,7 +2323,7 @@ void cobra_renderer::gfx_fifo_exec() case 0x0f: case 0xf0: { - UINT64 in3 = 0, in4 = 0, ignore; + uint64_t in3 = 0, in4 = 0, ignore; // check_mergebus_self(): 0x0F600000 0x10520C00 @@ -2434,7 +2434,7 @@ void cobra_renderer::gfx_fifo_exec() float r, g, b, a; w = 1.0f; - UINT64 in[4]; + uint64_t in[4]; if (w2 & 0x40000000) // line flags { fifo_in->pop(nullptr, &in[0]); @@ -2480,16 +2480,16 @@ void cobra_renderer::gfx_fifo_exec() #if LOG_DRAW_COMMANDS if (w2 & 0x40000000) { - printf(" ?: %08X\n", (UINT32)in[0]); + printf(" ?: %08X\n", (uint32_t)in[0]); } if (w2 & 0x20000000) { - printf(" ?: %08X\n", (UINT32)in[1]); + printf(" ?: %08X\n", (uint32_t)in[1]); } printf(" x: %f\n", x); printf(" y: %f\n", y); - printf(" ?: %08X\n", (UINT32)in[2]); + printf(" ?: %08X\n", (uint32_t)in[2]); printf(" z: %f\n", z); if (w2 & 0x00200000) @@ -2506,7 +2506,7 @@ void cobra_renderer::gfx_fifo_exec() if (w2 & 0x00000001) { - printf(" ?: %08X\n", (UINT32)in[3]); + printf(" ?: %08X\n", (uint32_t)in[3]); } printf("\n"); @@ -2608,7 +2608,7 @@ void cobra_renderer::gfx_fifo_exec() for (i=0; i < num; i+=4) { - UINT32 *buffer; + uint32_t *buffer; switch (m_gfx_gram[0x80104/4]) { case 0x800000: buffer = &m_framebuffer->pix32(y); break; @@ -2623,19 +2623,19 @@ void cobra_renderer::gfx_fifo_exec() } } - UINT64 param[4]; + uint64_t param[4]; param[0] = param[1] = param[2] = param[3] = 0; fifo_in->pop(nullptr, ¶m[0]); fifo_in->pop(nullptr, ¶m[1]); fifo_in->pop(nullptr, ¶m[2]); fifo_in->pop(nullptr, ¶m[3]); - buffer[x+0] = (UINT32)(param[0]); - buffer[x+1] = (UINT32)(param[1]); - buffer[x+2] = (UINT32)(param[2]); - buffer[x+3] = (UINT32)(param[3]); + buffer[x+0] = (uint32_t)(param[0]); + buffer[x+1] = (uint32_t)(param[1]); + buffer[x+2] = (uint32_t)(param[2]); + buffer[x+3] = (uint32_t)(param[3]); - //printf("gfx: fb write %d, %d: %08X %08X %08X %08X\n", x, y, (UINT32)(param[0]), (UINT32)(param[1]), (UINT32)(param[2]), (UINT32)(param[3])); + //printf("gfx: fb write %d, %d: %08X %08X %08X %08X\n", x, y, (uint32_t)(param[0]), (uint32_t)(param[1]), (uint32_t)(param[2]), (uint32_t)(param[3])); y++; } @@ -2648,7 +2648,7 @@ void cobra_renderer::gfx_fifo_exec() { // Read a specified pixel position from a pixelbuffer -// printf("GFX: FB read X: %d, Y: %d, %08X\n", (UINT16)(m_gfx_gram[0x118/4] >> 16), (UINT16)(m_gfx_gram[0x118/4]), m_gfx_gram[0x114/4]); +// printf("GFX: FB read X: %d, Y: %d, %08X\n", (uint16_t)(m_gfx_gram[0x118/4] >> 16), (uint16_t)(m_gfx_gram[0x118/4]), m_gfx_gram[0x114/4]); int x = (m_gfx_gram[0x118/4] >> 16) & 0xffff; int y = m_gfx_gram[0x118/4] & 0xffff; @@ -2664,7 +2664,7 @@ void cobra_renderer::gfx_fifo_exec() for (int i=0; i < line_count; i++) { - UINT32 *buffer; + uint32_t *buffer; switch (m_gfx_gram[0x80104/4]) { case 0x800000: buffer = &m_framebuffer->pix32(y+i); break; @@ -2747,7 +2747,7 @@ void cobra_renderer::gfx_fifo_exec() // 0xa40000FF 0x00000001 int reg = (w1 >> 8) & 0xfffff; - UINT32 mask = m_gfx_regmask[w1 & 0xff]; + uint32_t mask = m_gfx_regmask[w1 & 0xff]; gfx_write_gram(reg, mask, w2); @@ -2782,7 +2782,7 @@ void cobra_renderer::gfx_fifo_exec() // writes to n ram location starting from x? for (i = 0; i < num; i++) { - UINT64 value = 0; + uint64_t value = 0; fifo_in->pop(nullptr, &value); gfx_write_gram(reg + (i*4), 0xffffffff, value); @@ -2803,7 +2803,7 @@ void cobra_renderer::gfx_fifo_exec() int reg = (w1 >> 8) & 0xfffff; - UINT32 ret = gfx_read_gram(reg); + uint32_t ret = gfx_read_gram(reg); fifo_out->push(nullptr, ret); // printf("GFX: reg read %08X\n", reg); @@ -2829,7 +2829,7 @@ void cobra_renderer::gfx_fifo_exec() // reads back n ram locations starting from x? for (i=0; i < num; i++) { - UINT32 value = gfx_read_gram(reg + (i*4)); + uint32_t value = gfx_read_gram(reg + (i*4)); fifo_out->push(nullptr, value); } @@ -2858,11 +2858,11 @@ void cobra_renderer::gfx_fifo_exec() for (int i=0; i < num_left; i++) { - UINT64 param = 0; + uint64_t param = 0; fifo_in->pop(nullptr, ¶m); cobra->m_gfx_re_word_count++; - m_texture_ram[m_texram_ptr] = (UINT32)(param); + m_texture_ram[m_texram_ptr] = (uint32_t)(param); m_texram_ptr++; } @@ -2886,12 +2886,12 @@ void cobra_renderer::gfx_fifo_exec() while (fifo_in->current_num() > 0) { - UINT64 param; + uint64_t param; fifo_in->pop(nullptr, ¶m); if (c == 0) printf(" "); - printf("%08X ", (UINT32)(param)); + printf("%08X ", (uint32_t)(param)); c++; @@ -2914,29 +2914,29 @@ void cobra_renderer::gfx_fifo_exec() READ64_MEMBER(cobra_state::gfx_fifo_r) { - UINT64 r = 0; + uint64_t r = 0; m_renderer->gfx_fifo_exec(); if (ACCESSING_BITS_32_63) { - UINT64 data = 0; + uint64_t data = 0; m_gfxfifo_out->pop(&space.device(), &data); data &= 0xffffffff; - r |= (UINT64)(data) << 32; + r |= (uint64_t)(data) << 32; } if (ACCESSING_BITS_0_31) { - UINT64 data = 0; + uint64_t data = 0; m_gfxfifo_out->pop(&space.device(), &data); data &= 0xffffffff; - r |= (UINT64)(data); + r |= (uint64_t)(data); } -// printf("GFX FIFO read %08X%08X\n", (UINT32)(r >> 32), (UINT32)(r)); +// printf("GFX FIFO read %08X%08X\n", (uint32_t)(r >> 32), (uint32_t)(r)); return r; } @@ -2961,11 +2961,11 @@ WRITE64_MEMBER(cobra_state::gfx_fifo2_w) READ64_MEMBER(cobra_state::gfx_unk1_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_56_63) { - UINT64 v = 0; + uint64_t v = 0; // mbuslib_init fails if bits 3-7 (0x78) are not set v |= 0x78; @@ -2982,7 +2982,7 @@ READ64_MEMBER(cobra_state::gfx_unk1_r) { // mbuslib_init fails if this is not 0x7f - r |= (UINT64) 0x7f << 40; + r |= (uint64_t) 0x7f << 40; } if (ACCESSING_BITS_24_31) // this register returns FIFO number during check_fifo (see below) { @@ -2994,7 +2994,7 @@ READ64_MEMBER(cobra_state::gfx_unk1_r) WRITE64_MEMBER(cobra_state::gfx_unk1_w) { -// printf("gfx_unk1_w: %08X %08X, %08X%08X\n", (UINT32)(data >> 32), (UINT32)(data), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); +// printf("gfx_unk1_w: %08X %08X, %08X%08X\n", (uint32_t)(data >> 32), (uint32_t)(data), (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); if (ACCESSING_BITS_56_63) { @@ -3006,7 +3006,7 @@ WRITE64_MEMBER(cobra_state::gfx_unk1_w) if (ACCESSING_BITS_24_31) { - UINT64 in1, in2; + uint64_t in1, in2; int value = (data >> 24) & 0xff; // used in check_fifo(). fifo loopback or something? @@ -3014,7 +3014,7 @@ WRITE64_MEMBER(cobra_state::gfx_unk1_w) { m_gfxfifo_in->pop(&space.device(), &in1); m_gfxfifo_in->pop(&space.device(), &in2); - m_gfx_unknown_v1 = (UINT32)(in1 >> 32); // FIFO number is read back from this same register + m_gfx_unknown_v1 = (uint32_t)(in1 >> 32); // FIFO number is read back from this same register m_gfxfifo_out->push(&space.device(), in1 & 0xffffffff); m_gfxfifo_out->push(&space.device(), in2 & 0xffffffff); @@ -3040,7 +3040,7 @@ WRITE64_MEMBER(cobra_state::gfx_buf_w) // teximage_load() / mbuslib_prc_read(): 0x00A00001 0x10520800 -// printf("prc_read %08X%08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), space.device().safe_pc()); +// printf("prc_read %08X%08X at %08X\n", (uint32_t)(data >> 32), (uint32_t)(data), space.device().safe_pc()); m_renderer->gfx_fifo_exec(); @@ -3050,10 +3050,10 @@ WRITE64_MEMBER(cobra_state::gfx_buf_w) // reads back the register selected by gfx register select - UINT64 regdata = m_renderer->gfx_read_reg(); + uint64_t regdata = m_renderer->gfx_read_reg(); - m_gfxfifo_out->push(&space.device(), (UINT32)(regdata >> 32)); - m_gfxfifo_out->push(&space.device(), (UINT32)(regdata)); + m_gfxfifo_out->push(&space.device(), (uint32_t)(regdata >> 32)); + m_gfxfifo_out->push(&space.device(), (uint32_t)(regdata)); } else if (data == U64(0x00a0000110520800)) { @@ -3077,22 +3077,22 @@ WRITE64_MEMBER(cobra_state::gfx_buf_w) WRITE32_MEMBER(cobra_state::gfx_cpu_dc_store) { - UINT32 addr = offset >> 24; + uint32_t addr = offset >> 24; if (addr == 0x10 || addr == 0x18 || addr == 0x1e) { - UINT64 i = (UINT64)(m_gfx_fifo_cache_addr) << 32; + uint64_t i = (uint64_t)(m_gfx_fifo_cache_addr) << 32; cobra_fifo *fifo_in = m_gfxfifo_in; - UINT32 a = (offset / 8) & 0xff; + uint32_t a = (offset / 8) & 0xff; - fifo_in->push(&space.device(), (UINT32)(m_gfx_fifo_mem[a+0] >> 32) | i); - fifo_in->push(&space.device(), (UINT32)(m_gfx_fifo_mem[a+0] >> 0) | i); - fifo_in->push(&space.device(), (UINT32)(m_gfx_fifo_mem[a+1] >> 32) | i); - fifo_in->push(&space.device(), (UINT32)(m_gfx_fifo_mem[a+1] >> 0) | i); - fifo_in->push(&space.device(), (UINT32)(m_gfx_fifo_mem[a+2] >> 32) | i); - fifo_in->push(&space.device(), (UINT32)(m_gfx_fifo_mem[a+2] >> 0) | i); - fifo_in->push(&space.device(), (UINT32)(m_gfx_fifo_mem[a+3] >> 32) | i); - fifo_in->push(&space.device(), (UINT32)(m_gfx_fifo_mem[a+3] >> 0) | i); + fifo_in->push(&space.device(), (uint32_t)(m_gfx_fifo_mem[a+0] >> 32) | i); + fifo_in->push(&space.device(), (uint32_t)(m_gfx_fifo_mem[a+0] >> 0) | i); + fifo_in->push(&space.device(), (uint32_t)(m_gfx_fifo_mem[a+1] >> 32) | i); + fifo_in->push(&space.device(), (uint32_t)(m_gfx_fifo_mem[a+1] >> 0) | i); + fifo_in->push(&space.device(), (uint32_t)(m_gfx_fifo_mem[a+2] >> 32) | i); + fifo_in->push(&space.device(), (uint32_t)(m_gfx_fifo_mem[a+2] >> 0) | i); + fifo_in->push(&space.device(), (uint32_t)(m_gfx_fifo_mem[a+3] >> 32) | i); + fifo_in->push(&space.device(), (uint32_t)(m_gfx_fifo_mem[a+3] >> 0) | i); m_renderer->gfx_fifo_exec(); } @@ -3106,7 +3106,7 @@ WRITE64_MEMBER(cobra_state::gfx_debug_state_w) { if (ACCESSING_BITS_40_47) { - m_gfx_unk_flag = (UINT8)(data >> 40); + m_gfx_unk_flag = (uint8_t)(data >> 40); } if (ACCESSING_BITS_56_63) @@ -3241,7 +3241,7 @@ void cobra_state::machine_reset() m_sub_interrupt = 0xff; ide_hdd_device *hdd = m_ata->subdevice("0")->subdevice("hdd"); - UINT16 *identify_device = hdd->identify_device_buffer(); + uint16_t *identify_device = hdd->identify_device_buffer(); // Cobra expects these settings or the BIOS fails identify_device[51] = 0x0200; /* 51: PIO data transfer cycle timing mode */ @@ -3366,13 +3366,13 @@ DRIVER_INIT_MEMBER(cobra_state, cobra) m_subcpu->ppc4xx_spu_set_tx_handler(write8_delegate(FUNC(cobra_state::sub_jvs_w), this)); - m_comram[0] = std::make_unique(0x40000/4); - m_comram[1] = std::make_unique(0x40000/4); + m_comram[0] = std::make_unique(0x40000/4); + m_comram[1] = std::make_unique(0x40000/4); m_comram_page = 0; - m_sound_dma_buffer_l = std::make_unique(DMA_SOUND_BUFFER_SIZE); - m_sound_dma_buffer_r = std::make_unique(DMA_SOUND_BUFFER_SIZE); + m_sound_dma_buffer_l = std::make_unique(DMA_SOUND_BUFFER_SIZE); + m_sound_dma_buffer_r = std::make_unique(DMA_SOUND_BUFFER_SIZE); // setup fake pagetable until we figure out what really maps there... //m_gfx_pagetable[0x80 / 8] = U64(0x800001001e0001a8); @@ -3385,7 +3385,7 @@ DRIVER_INIT_MEMBER(cobra_state,bujutsu) // rom hacks for sub board... { - UINT32 *rom = (UINT32*)memregion("user2")->base(); + uint32_t *rom = (uint32_t*)memregion("user2")->base(); rom[0x62094 / 4] = 0x60000000; // skip hardcheck()... } @@ -3394,19 +3394,19 @@ DRIVER_INIT_MEMBER(cobra_state,bujutsu) // rom hacks for gfx board... { int i; - UINT32 sum = 0; + uint32_t sum = 0; - UINT32 *rom = (UINT32*)memregion("user3")->base(); + uint32_t *rom = (uint32_t*)memregion("user3")->base(); rom[(0x022d4^4) / 4] = 0x60000000; // skip init_raster() for now ... // calculate the checksum of the patched rom... for (i=0; i < 0x20000/4; i++) { - sum += (UINT8)((rom[i] >> 24) & 0xff); - sum += (UINT8)((rom[i] >> 16) & 0xff); - sum += (UINT8)((rom[i] >> 8) & 0xff); - sum += (UINT8)((rom[i] >> 0) & 0xff); + sum += (uint8_t)((rom[i] >> 24) & 0xff); + sum += (uint8_t)((rom[i] >> 16) & 0xff); + sum += (uint8_t)((rom[i] >> 8) & 0xff); + sum += (uint8_t)((rom[i] >> 0) & 0xff); } rom[(0x0001fff0^4) / 4] = sum; @@ -3417,7 +3417,7 @@ DRIVER_INIT_MEMBER(cobra_state,bujutsu) // fill in M48T58 data for now... { - UINT8 *rom = (UINT8*)memregion("m48t58")->base(); + uint8_t *rom = (uint8_t*)memregion("m48t58")->base(); rom[0x00] = 0x47; // G rom[0x01] = 0x4e; // N // N = 2-player, Q = 1-player? rom[0x02] = 0x36; // 6 @@ -3435,15 +3435,15 @@ DRIVER_INIT_MEMBER(cobra_state,bujutsu) rom[0x0d] = 0x00; // calculate checksum - UINT16 sum = 0; + uint16_t sum = 0; for (int i=0; i < 14; i+=2) { - sum += ((UINT16)(rom[i]) << 8) | (rom[i+1]); + sum += ((uint16_t)(rom[i]) << 8) | (rom[i+1]); } sum ^= 0xffff; - rom[0x0e] = (UINT8)(sum >> 8); - rom[0x0f] = (UINT8)(sum); + rom[0x0e] = (uint8_t)(sum >> 8); + rom[0x0f] = (uint8_t)(sum); } // hd patches @@ -3467,20 +3467,20 @@ DRIVER_INIT_MEMBER(cobra_state,racjamdx) // rom hacks for sub board... { - UINT32 *rom = (UINT32*)memregion("user2")->base(); + uint32_t *rom = (uint32_t*)memregion("user2")->base(); rom[0x62094 / 4] = 0x60000000; // skip hardcheck()... rom[0x62ddc / 4] = 0x60000000; // skip lanc_hardcheck() // calculate the checksum of the patched rom... - UINT32 sum = 0; + uint32_t sum = 0; for (int i=0; i < 0x20000/4; i++) { - sum += (UINT8)((rom[(0x60000/4)+i] >> 24) & 0xff); - sum += (UINT8)((rom[(0x60000/4)+i] >> 16) & 0xff); - sum += (UINT8)((rom[(0x60000/4)+i] >> 8) & 0xff); - sum += (UINT8)((rom[(0x60000/4)+i] >> 0) & 0xff); + sum += (uint8_t)((rom[(0x60000/4)+i] >> 24) & 0xff); + sum += (uint8_t)((rom[(0x60000/4)+i] >> 16) & 0xff); + sum += (uint8_t)((rom[(0x60000/4)+i] >> 8) & 0xff); + sum += (uint8_t)((rom[(0x60000/4)+i] >> 0) & 0xff); } rom[(0x0007fff0^4) / 4] = ~sum; @@ -3491,9 +3491,9 @@ DRIVER_INIT_MEMBER(cobra_state,racjamdx) // rom hacks for gfx board... { int i; - UINT32 sum = 0; + uint32_t sum = 0; - UINT32 *rom = (UINT32*)memregion("user3")->base(); + uint32_t *rom = (uint32_t*)memregion("user3")->base(); rom[(0x02448^4) / 4] = 0x60000000; // skip init_raster() for now ... @@ -3502,10 +3502,10 @@ DRIVER_INIT_MEMBER(cobra_state,racjamdx) // calculate the checksum of the patched rom... for (i=0; i < 0x20000/4; i++) { - sum += (UINT8)((rom[i] >> 24) & 0xff); - sum += (UINT8)((rom[i] >> 16) & 0xff); - sum += (UINT8)((rom[i] >> 8) & 0xff); - sum += (UINT8)((rom[i] >> 0) & 0xff); + sum += (uint8_t)((rom[i] >> 24) & 0xff); + sum += (uint8_t)((rom[i] >> 16) & 0xff); + sum += (uint8_t)((rom[i] >> 8) & 0xff); + sum += (uint8_t)((rom[i] >> 0) & 0xff); } rom[(0x0001fff0^4) / 4] = sum; @@ -3515,7 +3515,7 @@ DRIVER_INIT_MEMBER(cobra_state,racjamdx) // fill in M48T58 data for now... { - UINT8 *rom = (UINT8*)memregion("m48t58")->base(); + uint8_t *rom = (uint8_t*)memregion("m48t58")->base(); rom[0x00] = 0x47; // G rom[0x01] = 0x59; // Y rom[0x02] = 0x36; // 6 @@ -3526,15 +3526,15 @@ DRIVER_INIT_MEMBER(cobra_state,racjamdx) rom[0x07] = 0x00; // calculate checksum - UINT16 sum = 0; + uint16_t sum = 0; for (int i=0; i < 14; i+=2) { - sum += ((UINT16)(rom[i]) << 8) | (rom[i+1]); + sum += ((uint16_t)(rom[i]) << 8) | (rom[i+1]); } sum ^= 0xffff; - rom[0x0e] = (UINT8)(sum >> 8); - rom[0x0f] = (UINT8)(sum); + rom[0x0e] = (uint8_t)(sum >> 8); + rom[0x0f] = (uint8_t)(sum); } // hd patches diff --git a/src/mame/drivers/cocoloco.cpp b/src/mame/drivers/cocoloco.cpp index d940c39a7a3..2dc58a884a5 100644 --- a/src/mame/drivers/cocoloco.cpp +++ b/src/mame/drivers/cocoloco.cpp @@ -211,8 +211,8 @@ public: required_device m_maincpu; required_device m_palette; - std::unique_ptr m_videoram; - UINT8 m_videobank; + std::unique_ptr m_videoram; + uint8_t m_videobank; DECLARE_READ8_MEMBER(vram_r); DECLARE_WRITE8_MEMBER(vram_w); @@ -227,7 +227,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(cocoloco); - 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); }; /*********************************** @@ -308,13 +308,13 @@ PALETTE_INIT_MEMBER(cocoloco_state, cocoloco) void cocoloco_state::video_start() { - m_videoram = std::make_unique(0x2000 * 8); + m_videoram = std::make_unique(0x2000 * 8); save_pointer(NAME(m_videoram.get()), 0x2000 * 8); save_item(NAME(m_videobank)); } -UINT32 cocoloco_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cocoloco_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, count, xi; @@ -614,7 +614,7 @@ DRIVER_INIT_MEMBER(cocoloco_state, cocob) { // Just for testing... - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); rom[0xe18b] = rom[0xe18b] ^ 0x80; // with jsr $e337, the character doesn't turn and eat straight (maze included) diff --git a/src/mame/drivers/codata.cpp b/src/mame/drivers/codata.cpp index 9499ab38560..c0cfac1652c 100644 --- a/src/mame/drivers/codata.cpp +++ b/src/mame/drivers/codata.cpp @@ -32,9 +32,9 @@ public: DECLARE_READ16_MEMBER(status_r); DECLARE_WRITE8_MEMBER(kbd_put); private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; - required_shared_ptr m_p_base; + required_shared_ptr m_p_base; required_device m_terminal; required_device m_maincpu; }; @@ -60,7 +60,7 @@ INPUT_PORTS_END READ16_MEMBER( codata_state::keyin_r ) { - UINT16 ret = m_term_data; + uint16_t ret = m_term_data; m_term_data = 0; return ret << 8; } @@ -77,7 +77,7 @@ WRITE8_MEMBER( codata_state::kbd_put ) void codata_state::machine_reset() { - UINT8* RAM = memregion("user1")->base(); + uint8_t* RAM = memregion("user1")->base(); memcpy(m_p_base, RAM, 16); m_term_data = 0; m_maincpu->reset(); diff --git a/src/mame/drivers/coinmstr.cpp b/src/mame/drivers/coinmstr.cpp index e699adeb329..cd36a3a26a7 100644 --- a/src/mame/drivers/coinmstr.cpp +++ b/src/mame/drivers/coinmstr.cpp @@ -152,12 +152,12 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; - required_shared_ptr m_attr_ram1; - required_shared_ptr m_attr_ram2; - required_shared_ptr m_attr_ram3; + required_shared_ptr m_videoram; + required_shared_ptr m_attr_ram1; + required_shared_ptr m_attr_ram2; + required_shared_ptr m_attr_ram3; tilemap_t *m_bg_tilemap; - UINT8 m_question_adr[4]; + uint8_t m_question_adr[4]; DECLARE_WRITE8_MEMBER(quizmstr_bg_w); DECLARE_WRITE8_MEMBER(quizmstr_attr1_w); DECLARE_WRITE8_MEMBER(quizmstr_attr2_w); @@ -168,7 +168,7 @@ public: DECLARE_DRIVER_INIT(coinmstr); TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; - UINT32 screen_update_coinmstr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_coinmstr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -177,7 +177,7 @@ public: WRITE8_MEMBER(coinmstr_state::quizmstr_bg_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; videoram[offset] = data; if(offset >= 0x0240) @@ -185,7 +185,7 @@ WRITE8_MEMBER(coinmstr_state::quizmstr_bg_w) } -static void coinmstr_set_pal(palette_device &palette, UINT32 paldat, int col) +static void coinmstr_set_pal(palette_device &palette, uint32_t paldat, int col) { col = col *4; @@ -225,7 +225,7 @@ WRITE8_MEMBER(coinmstr_state::quizmstr_attr1_w) if(offset >= 0x0240) { // the later games also use attr3 for something.. - UINT32 paldata = (m_attr_ram1[offset] & 0x7f) | ((m_attr_ram2[offset] & 0x7f) << 7); + uint32_t paldata = (m_attr_ram1[offset] & 0x7f) | ((m_attr_ram2[offset] & 0x7f) << 7); m_bg_tilemap->mark_tile_dirty(offset - 0x0240); coinmstr_set_pal(*m_palette, paldata, offset - 0x240); @@ -240,7 +240,7 @@ WRITE8_MEMBER(coinmstr_state::quizmstr_attr2_w) if(offset >= 0x0240) { // the later games also use attr3 for something.. - UINT32 paldata = (m_attr_ram1[offset] & 0x7f) | ((m_attr_ram2[offset] & 0x7f) << 7); + uint32_t paldata = (m_attr_ram1[offset] & 0x7f) | ((m_attr_ram2[offset] & 0x7f) << 7); m_bg_tilemap->mark_tile_dirty(offset - 0x0240); coinmstr_set_pal(*m_palette, paldata, offset - 0x240); @@ -261,7 +261,7 @@ WRITE8_MEMBER(coinmstr_state::quizmstr_attr3_w) READ8_MEMBER(coinmstr_state::question_r) { int address; - UINT8 *questions = memregion("user1")->base(); + uint8_t *questions = memregion("user1")->base(); switch(m_question_adr[2]) { @@ -1207,7 +1207,7 @@ GFXDECODE_END TILE_GET_INFO_MEMBER(coinmstr_state::get_bg_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int tile = videoram[tile_index + 0x0240]; int color = tile_index; @@ -1224,7 +1224,7 @@ void coinmstr_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(coinmstr_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 46, 32); } -UINT32 coinmstr_state::screen_update_coinmstr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t coinmstr_state::screen_update_coinmstr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -1528,9 +1528,9 @@ ROM_END DRIVER_INIT_MEMBER(coinmstr_state,coinmstr) { - UINT8 *rom = memregion("user1")->base(); + uint8_t *rom = memregion("user1")->base(); int length = memregion("user1")->bytes(); - std::vector buf(length); + std::vector buf(length); int i; memcpy(&buf[0],rom,length); diff --git a/src/mame/drivers/coinmvga.cpp b/src/mame/drivers/coinmvga.cpp index 9b0993bca4b..1cc9bb37299 100644 --- a/src/mame/drivers/coinmvga.cpp +++ b/src/mame/drivers/coinmvga.cpp @@ -240,11 +240,11 @@ public: m_palette(*this, "palette"), m_palette2(*this, "palette2") { } - required_shared_ptr m_vram; + required_shared_ptr m_vram; DECLARE_DRIVER_INIT(colorama); DECLARE_DRIVER_INIT(cmrltv75); virtual void video_start() override; - UINT32 screen_update_coinmvga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_coinmvga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); required_device m_maincpu; required_device m_gfxdecode; @@ -264,7 +264,7 @@ void coinmvga_state::video_start() } -UINT32 coinmvga_state::screen_update_coinmvga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t coinmvga_state::screen_update_coinmvga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int count = 0x04000/2; diff --git a/src/mame/drivers/coleco.cpp b/src/mame/drivers/coleco.cpp index 84807970c66..f8037d1b7a4 100644 --- a/src/mame/drivers/coleco.cpp +++ b/src/mame/drivers/coleco.cpp @@ -229,9 +229,9 @@ READ8_MEMBER( coleco_state::cart_r ) return m_cart->bd_r(space, offset & 0x7fff, 0, 0, 0, 0, 0); } -UINT8 coleco_state::coleco_scan_paddles(UINT8 *joy_status0, UINT8 *joy_status1) +uint8_t coleco_state::coleco_scan_paddles(uint8_t *joy_status0, uint8_t *joy_status1) { - UINT8 ctrl_sel = m_ctrlsel.read_safe(0); + uint8_t ctrl_sel = m_ctrlsel.read_safe(0); /* which controller shall we read? */ if ((ctrl_sel & 0x07) == 0x02) // Super Action Controller P1 @@ -258,18 +258,18 @@ UINT8 coleco_state::coleco_scan_paddles(UINT8 *joy_status0, UINT8 *joy_status1) } -UINT8 coleco_state::coleco_paddle_read(int port, int joy_mode, UINT8 joy_status) +uint8_t coleco_state::coleco_paddle_read(int port, int joy_mode, uint8_t joy_status) { - UINT8 ctrl_sel = m_ctrlsel.read_safe(0); - UINT8 ctrl_extra = ctrl_sel & 0x80; + uint8_t ctrl_sel = m_ctrlsel.read_safe(0); + uint8_t ctrl_extra = ctrl_sel & 0x80; ctrl_sel = ctrl_sel >> (port*4) & 7; /* Keypad and fire 1 (SAC Yellow Button) */ if (joy_mode == 0) { /* No key pressed by default */ - UINT8 data = 0x0f; - UINT16 ipt = 0xffff; + uint8_t data = 0x0f; + uint16_t ipt = 0xffff; if (ctrl_sel == 0) // ColecoVision Controller ipt = port ? m_std_keypad2->read() : m_std_keypad1->read(); @@ -300,7 +300,7 @@ UINT8 coleco_state::coleco_paddle_read(int port, int joy_mode, UINT8 joy_status) /* Joystick and fire 2 (SAC Red Button) */ else { - UINT8 data = 0x7f; + uint8_t data = 0x7f; if (ctrl_sel == 0) // ColecoVision Controller data = port ? m_std_joy2->read() : m_std_joy1->read(); @@ -352,7 +352,7 @@ void coleco_state::machine_reset() m_last_nmi_state = 0; } -//static image_verify_result coleco_cart_verify(const UINT8 *cartdata, size_t size) +//static image_verify_result coleco_cart_verify(const uint8_t *cartdata, size_t size) //{ // int retval = image_verify_result::FAIL; // diff --git a/src/mame/drivers/combatsc.cpp b/src/mame/drivers/combatsc.cpp index 980ca960a1c..c7cd69d79e8 100644 --- a/src/mame/drivers/combatsc.cpp +++ b/src/mame/drivers/combatsc.cpp @@ -271,7 +271,7 @@ READ8_MEMBER(combatsc_state::trackball_r) for (i = 0; i < 4; i++) { - UINT8 curr; + uint8_t curr; curr = m_track_ports[i].read_safe(0xff); @@ -645,7 +645,7 @@ GFXDECODE_END MACHINE_START_MEMBER(combatsc_state,combatsc) { - UINT8 *MEM = memregion("maincpu")->base() + 0x38000; + uint8_t *MEM = memregion("maincpu")->base() + 0x38000; m_io_ram = MEM + 0x0000; m_page[0] = MEM + 0x4000; diff --git a/src/mame/drivers/comebaby.cpp b/src/mame/drivers/comebaby.cpp index 77d1beb119e..10f3f11d820 100644 --- a/src/mame/drivers/comebaby.cpp +++ b/src/mame/drivers/comebaby.cpp @@ -192,7 +192,7 @@ public: m_maincpu(*this, "maincpu") { } - 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: @@ -208,7 +208,7 @@ void comebaby_state::video_start() { } -UINT32 comebaby_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t comebaby_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/commando.cpp b/src/mame/drivers/commando.cpp index 07fe2d68448..d7f29bc85d4 100644 --- a/src/mame/drivers/commando.cpp +++ b/src/mame/drivers/commando.cpp @@ -664,25 +664,25 @@ ROM_END DRIVER_INIT_MEMBER(commando_state,commando) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // the first opcode is *not* encrypted m_decrypted_opcodes[0] = rom[0]; for (int A = 1; A < 0xc000; A++) { - UINT8 src = rom[A]; + uint8_t src = rom[A]; m_decrypted_opcodes[A] = (src & 0x11) | ((src & 0xe0) >> 4) | ((src & 0x0e) << 4); } } DRIVER_INIT_MEMBER(commando_state,spaceinv) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // the first opcode *is* encrypted for (int A = 0; A < 0xc000; A++) { - UINT8 src = rom[A]; + uint8_t src = rom[A]; m_decrypted_opcodes[A] = (src & 0x11) | ((src & 0xe0) >> 4) | ((src & 0x0e) << 4); } } diff --git a/src/mame/drivers/compgolf.cpp b/src/mame/drivers/compgolf.cpp index a5f2ecb035a..54e364c9ebc 100644 --- a/src/mame/drivers/compgolf.cpp +++ b/src/mame/drivers/compgolf.cpp @@ -317,8 +317,8 @@ ROM_END void compgolf_state::compgolf_expand_bg() { - UINT8 *GFXDST = memregion("gfx2")->base(); - UINT8 *GFXSRC = memregion("gfx4")->base(); + uint8_t *GFXDST = memregion("gfx2")->base(); + uint8_t *GFXSRC = memregion("gfx4")->base(); int x; diff --git a/src/mame/drivers/compis.cpp b/src/mame/drivers/compis.cpp index 5a537afec46..da4699fa33b 100644 --- a/src/mame/drivers/compis.cpp +++ b/src/mame/drivers/compis.cpp @@ -631,7 +631,7 @@ READ8_MEMBER( compis_state::ppi_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; /* DIP switch - Test mode */ data = m_s8->read(); diff --git a/src/mame/drivers/compucolor.cpp b/src/mame/drivers/compucolor.cpp index 149f4bd332e..812b18edf13 100644 --- a/src/mame/drivers/compucolor.cpp +++ b/src/mame/drivers/compucolor.cpp @@ -58,14 +58,14 @@ public: required_device m_floppy0; required_device m_floppy1; required_memory_region m_char_rom; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; required_ioport_array<16> m_y; required_ioport m_y128; virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( xi_r ); DECLARE_WRITE8_MEMBER( xo_w ); @@ -73,7 +73,7 @@ public: IRQ_CALLBACK_MEMBER( int_ack ); - UINT8 m_xo; + uint8_t m_xo; }; static ADDRESS_MAP_START( compucolor2_mem, AS_PROGRAM, 8, compucolor2_state ) @@ -258,7 +258,7 @@ static INPUT_PORTS_START( compucolor2 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) INPUT_PORTS_END -UINT32 compucolor2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t compucolor2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (int y = 0; y < 32*8; y++) { @@ -266,13 +266,13 @@ UINT32 compucolor2_state::screen_update(screen_device &screen, bitmap_rgb32 &bit for (int sx = 0; sx < 64; sx++) { - UINT8 code = m_video_ram[offset++]; - UINT8 attr = m_video_ram[offset++]; + uint8_t code = m_video_ram[offset++]; + uint8_t attr = m_video_ram[offset++]; offs_t char_offs = ((code & 0x7f) << 3) | (y & 0x07); if (BIT(code, 7)) char_offs = ((code & 0x7f) << 3) | ((y >> 1) & 0x07); - UINT8 data = m_char_rom->base()[char_offs]; + uint8_t data = m_char_rom->base()[char_offs]; rgb_t fg = m_palette->pen_color(attr & 0x07); rgb_t bg = m_palette->pen_color((attr >> 3) & 0x07); @@ -291,7 +291,7 @@ UINT32 compucolor2_state::screen_update(screen_device &screen, bitmap_rgb32 &bit READ8_MEMBER( compucolor2_state::xi_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch ((m_xo >> 4) & 0x03) { diff --git a/src/mame/drivers/comquest.cpp b/src/mame/drivers/comquest.cpp index fc018fab425..34982b777cb 100644 --- a/src/mame/drivers/comquest.cpp +++ b/src/mame/drivers/comquest.cpp @@ -48,7 +48,7 @@ icq3250a-d #ifdef UNUSED_FUNCTION READ8_MEMBER(comquest_state::comquest_read) { - UINT8 data=0; + uint8_t data=0; logerror("comquest read %.4x %.2x\n",offset,data); return data; } @@ -204,7 +204,7 @@ GFXDECODE_END void comquest_state::machine_reset() { -// UINT8 *mem=memregion("user1")->base(); +// uint8_t *mem=memregion("user1")->base(); // membank(1)->set_base(mem+0x00000); } diff --git a/src/mame/drivers/comx35.cpp b/src/mame/drivers/comx35.cpp index 7a6c2cb4a54..150ffcd7960 100644 --- a/src/mame/drivers/comx35.cpp +++ b/src/mame/drivers/comx35.cpp @@ -38,9 +38,9 @@ enum image_fread_memory - read image to memory -------------------------------------------------*/ -void comx35_state::image_fread_memory(device_image_interface &image, UINT16 addr, UINT32 count) +void comx35_state::image_fread_memory(device_image_interface &image, uint16_t addr, uint32_t count) { - UINT8 *ram = m_ram->pointer() + (addr - 0x4000); + uint8_t *ram = m_ram->pointer() + (addr - 0x4000); image.fread(ram, count); } @@ -53,7 +53,7 @@ QUICKLOAD_LOAD_MEMBER( comx35_state, comx35_comx ) { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 header[16] = {0}; + uint8_t header[16] = {0}; int size = image.length(); if (size > m_ram->size()) @@ -85,7 +85,7 @@ QUICKLOAD_LOAD_MEMBER( comx35_state, comx35_comx ) */ { - UINT16 start_address, end_address, run_address; + uint16_t start_address, end_address, run_address; image.fread(header, 6); @@ -171,7 +171,7 @@ QUICKLOAD_LOAD_MEMBER( comx35_state, comx35_comx ) */ { - UINT16 start_array, end_array, start_string, array_length; + uint16_t start_array, end_array, start_string, array_length; image.fread(header, 2); @@ -207,7 +207,7 @@ READ8_MEMBER( comx35_state::mem_r ) { int extrom = 1; - UINT8 data = m_exp->mrd_r(space, offset, &extrom); + uint8_t data = m_exp->mrd_r(space, offset, &extrom); if (offset < 0x4000) { @@ -255,7 +255,7 @@ WRITE8_MEMBER( comx35_state::mem_w ) READ8_MEMBER( comx35_state::io_r ) { - UINT8 data = m_exp->io_r(space, offset); + uint8_t data = m_exp->io_r(space, offset); if (offset == 3) { @@ -552,7 +552,7 @@ void comx35_state::device_timer(emu_timer &timer, device_timer_id id, int param, void comx35_state::machine_start() { // clear the RAM since DOS card will go crazy if RAM is not all zeroes - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); memset(ram, 0, m_ram->size()); // register for state saving diff --git a/src/mame/drivers/contra.cpp b/src/mame/drivers/contra.cpp index b6ef8a34417..38a659b8ed1 100644 --- a/src/mame/drivers/contra.cpp +++ b/src/mame/drivers/contra.cpp @@ -188,7 +188,7 @@ GFXDECODE_END void contra_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000); } diff --git a/src/mame/drivers/coolpool.cpp b/src/mame/drivers/coolpool.cpp index a1ed7a94ad4..e88bb24f46e 100644 --- a/src/mame/drivers/coolpool.cpp +++ b/src/mame/drivers/coolpool.cpp @@ -43,7 +43,7 @@ -static const UINT16 nvram_unlock_seq[] = +static const uint16_t nvram_unlock_seq[] = { 0x3fb, 0x3fb, 0x3f8, 0x3fc, 0x3fa, 0x3fe, 0x3f9, 0x3fd, 0x3fb, 0x3ff }; @@ -57,8 +57,8 @@ static const UINT16 nvram_unlock_seq[] = TMS340X0_SCANLINE_RGB32_CB_MEMBER(coolpool_state::amerdart_scanline) { - UINT16 *vram = &m_vram_base[(params->rowaddr << 8) & 0xff00]; - UINT32 *dest = &bitmap.pix32(scanline); + uint16_t *vram = &m_vram_base[(params->rowaddr << 8) & 0xff00]; + uint32_t *dest = &bitmap.pix32(scanline); rgb_t pens[16]; int coladdr = params->coladdr; int x; @@ -67,13 +67,13 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(coolpool_state::amerdart_scanline) if (scanline < 256) for (x = 0; x < 16; x++) { - UINT16 pal = m_vram_base[x]; + uint16_t pal = m_vram_base[x]; pens[x] = rgb_t(pal4bit(pal >> 4), pal4bit(pal >> 8), pal4bit(pal >> 12)); } for (x = params->heblnk; x < params->hsblnk; x += 4) { - UINT16 pixels = vram[coladdr++ & 0xff]; + uint16_t pixels = vram[coladdr++ & 0xff]; dest[x + 0] = pens[(pixels >> 0) & 15]; dest[x + 1] = pens[(pixels >> 4) & 15]; dest[x + 2] = pens[(pixels >> 8) & 15]; @@ -84,15 +84,15 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(coolpool_state::amerdart_scanline) TMS340X0_SCANLINE_RGB32_CB_MEMBER(coolpool_state::coolpool_scanline) { - UINT16 *vram = &m_vram_base[(params->rowaddr << 8) & 0x1ff00]; - UINT32 *dest = &bitmap.pix32(scanline); + uint16_t *vram = &m_vram_base[(params->rowaddr << 8) & 0x1ff00]; + uint32_t *dest = &bitmap.pix32(scanline); const rgb_t *pens = m_tlc34076->get_pens(); int coladdr = params->coladdr; int x; for (x = params->heblnk; x < params->hsblnk; x += 2) { - UINT16 pixels = vram[coladdr++ & 0xff]; + uint16_t pixels = vram[coladdr++ & 0xff]; dest[x + 0] = pens[pixels & 0xff]; dest[x + 1] = pens[pixels >> 8]; } @@ -291,8 +291,8 @@ static int amerdart_trackball_dec(int data) int coolpool_state::amerdart_trackball_direction(int num, int data) { - UINT16 result_x = (data & 0x0c) >> 2; - UINT16 result_y = (data & 0x03) >> 0; + uint16_t result_x = (data & 0x0c) >> 2; + uint16_t result_y = (data & 0x03) >> 0; if ((m_dx[num] == 0) && (m_dy[num] < 0)) { /* Up */ @@ -388,10 +388,10 @@ READ16_MEMBER(coolpool_state::amerdart_trackball_r) m_newx[2] = ioport("XAXIS2")->read(); /* Trackball 2 Left - Right */ m_newy[2] = ioport("YAXIS2")->read(); /* Trackball 2 Up - Down */ - m_dx[1] = (INT8)(m_newx[1] - m_oldx[1]); - m_dy[1] = (INT8)(m_newy[1] - m_oldy[1]); - m_dx[2] = (INT8)(m_newx[2] - m_oldx[2]); - m_dy[2] = (INT8)(m_newy[2] - m_oldy[2]); + m_dx[1] = (int8_t)(m_newx[1] - m_oldx[1]); + m_dy[1] = (int8_t)(m_newy[1] - m_oldy[1]); + m_dx[2] = (int8_t)(m_newx[2] - m_oldx[2]); + m_dy[2] = (int8_t)(m_newy[2] - m_oldy[2]); /* Determine Trackball 1 direction state */ m_result = (m_result & 0xf0ff) | (amerdart_trackball_direction(1, ((m_result >> 8) & 0xf)) << 8); @@ -505,7 +505,7 @@ READ16_MEMBER(coolpool_state::dsp_hold_line_r) READ16_MEMBER(coolpool_state::dsp_rom_r) { - UINT8 *rom = memregion("user2")->base(); + uint8_t *rom = memregion("user2")->base(); return rom[m_iop_romaddr & (memregion("user2")->bytes() - 1)]; } @@ -538,8 +538,8 @@ READ16_MEMBER(coolpool_state::coolpool_input_r) m_result = (ioport("IN1")->read() & 0x00ff) | (m_lastresult & 0xff00); m_newx[1] = ioport("XAXIS")->read(); m_newy[1] = ioport("YAXIS")->read(); - m_dx[1] = (INT8)(m_newx[1] - m_oldx[1]); - m_dy[1] = (INT8)(m_newy[1] - m_oldy[1]); + m_dx[1] = (int8_t)(m_newx[1] - m_oldx[1]); + m_dy[1] = (int8_t)(m_newy[1] - m_oldy[1]); if (m_dx[1] < 0) { @@ -1129,10 +1129,10 @@ DRIVER_INIT_MEMBER(coolpool_state,coolpool) DRIVER_INIT_MEMBER(coolpool_state,9ballsht) { int a, len; - UINT16 *rom; + uint16_t *rom; /* decrypt the main program ROMs */ - rom = (UINT16 *)memregion("user1")->base(); + rom = (uint16_t *)memregion("user1")->base(); len = memregion("user1")->bytes(); for (a = 0;a < len/2;a++) { @@ -1156,12 +1156,12 @@ DRIVER_INIT_MEMBER(coolpool_state,9ballsht) } /* decrypt the sub data ROMs */ - rom = (UINT16 *)memregion("user2")->base(); + rom = (uint16_t *)memregion("user2")->base(); len = memregion("user2")->bytes(); for (a = 1;a < len/2;a+=4) { /* just swap bits 1 and 2 of the address */ - UINT16 tmp = rom[a]; + uint16_t tmp = rom[a]; rom[a] = rom[a+1]; rom[a+1] = tmp; } diff --git a/src/mame/drivers/coolridr.cpp b/src/mame/drivers/coolridr.cpp index 7220725eba6..5e841a16011 100644 --- a/src/mame/drivers/coolridr.cpp +++ b/src/mame/drivers/coolridr.cpp @@ -332,37 +332,37 @@ public: } // Blitter state - UINT16 m_textBytesToWrite; - INT16 m_blitterSerialCount; - UINT8 m_blitterMode; - UINT8 m_blittype; - UINT16 m_blitterAddr; - UINT16 m_textOffset; - UINT32 m_blitterClearMode; - INT16 m_blitterClearCount; + uint16_t m_textBytesToWrite; + int16_t m_blitterSerialCount; + uint8_t m_blitterMode; + uint8_t m_blittype; + uint16_t m_blitterAddr; + uint16_t m_textOffset; + uint32_t m_blitterClearMode; + int16_t m_blitterClearCount; pen_t m_tilepals[0x10000]; pen_t m_fadedpals[0x8000]; // store the blit params here - UINT32 m_spriteblit[12]; - UINT32 m_vregs_address; + uint32_t m_spriteblit[12]; + uint32_t m_vregs_address; - UINT32 m_clipvals[2][3]; - UINT8 m_clipblitterMode[2]; // hack + uint32_t m_clipvals[2][3]; + uint8_t m_clipblitterMode[2]; // hack required_device m_maincpu; required_device m_subcpu; required_device m_soundcpu; //required_device m_dmac; - required_shared_ptr m_framebuffer_vram; - required_shared_ptr m_txt_vram; - required_shared_ptr m_sysh1_txt_blit; - required_shared_ptr m_sysh1_workram_h; - required_shared_ptr m_sound_dma; - required_shared_ptr m_soundram; - required_shared_ptr m_soundram2; - required_shared_ptr m_rom; + required_shared_ptr m_framebuffer_vram; + required_shared_ptr m_txt_vram; + required_shared_ptr m_sysh1_txt_blit; + required_shared_ptr m_sysh1_workram_h; + required_shared_ptr m_sound_dma; + required_shared_ptr m_soundram; + required_shared_ptr m_soundram2; + required_shared_ptr m_rom; required_ioport m_io_an0; required_ioport m_io_an1; required_ioport m_io_an2; @@ -386,15 +386,15 @@ public: bitmap_ind16 m_screen1_bitmap; bitmap_ind16 m_screen2_bitmap; - UINT8 an_mux_data; - UINT8 sound_data, sound_fifo; + uint8_t an_mux_data; + uint8_t sound_data, sound_fifo; - UINT8* m_compressedgfx; - std::unique_ptr m_expanded_10bit_gfx; - std::unique_ptr m_rearranged_16bit_gfx; + uint8_t* m_compressedgfx; + std::unique_ptr m_expanded_10bit_gfx; + std::unique_ptr m_rearranged_16bit_gfx; - UINT32 get_20bit_data(UINT32 romoffset, int _20bitwordnum); - UINT16 get_10bit_data(UINT32 romoffset, int _10bitwordnum); + uint32_t get_20bit_data(uint32_t romoffset, int _20bitwordnum); + uint16_t get_10bit_data(uint32_t romoffset, int _10bitwordnum); DECLARE_READ32_MEMBER(sysh1_sound_dma_r); DECLARE_WRITE32_MEMBER(sysh1_sound_dma_w); @@ -424,38 +424,38 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 m_colbase; + uint32_t m_colbase; void coolriders_drawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty); + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty); void coolriders_drawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 transpen); + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t transpen); void draw_bg_coolridr(bitmap_ind16 &bitmap, const rectangle &cliprect, int which); - UINT32 screen_update_coolridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which); - UINT32 screen_update_coolridr1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_coolridr2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_coolridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which); + uint32_t screen_update_coolridr1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_coolridr2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void blit_current_sprite(address_space &space); TIMER_DEVICE_CALLBACK_MEMBER(system_h1_main); TIMER_DEVICE_CALLBACK_MEMBER(system_h1_sub); DECLARE_WRITE8_MEMBER(scsp_irq); - void sysh1_dma_transfer( address_space &space, UINT16 dma_index ); + void sysh1_dma_transfer( address_space &space, uint16_t dma_index ); int debug_randompal; - std::unique_ptr m_h1_vram; - std::unique_ptr m_h1_pcg; - std::unique_ptr m_h1_pal; + std::unique_ptr m_h1_vram; + std::unique_ptr m_h1_pcg; + std::unique_ptr m_h1_pal; int m_gfx_index; int m_color_bank; struct { - UINT32 setting; - UINT8 gradient; + uint32_t setting; + uint8_t gradient; }m_rgb_ctrl[2]; - UINT32 m_pen_fill[2]; + uint32_t m_pen_fill[2]; osd_work_queue * m_work_queue[2]; // work queue, one per screen static void *draw_object_threaded(void *param, int threadid); @@ -463,15 +463,15 @@ public: struct cool_render_object { - UINT8* indirect_tiles; - UINT32* indirect_zoom; - UINT32 spriteblit[12]; + uint8_t* indirect_tiles; + uint32_t* indirect_zoom; + uint32_t spriteblit[12]; bitmap_ind16* drawbitmap; //bitmap_ind16* zbitmap; - UINT16 zpri; - UINT8 blittype; + uint16_t zpri; + uint8_t blittype; coolridr_state* state; - UINT32 clipvals[3]; + uint32_t clipvals[3]; int screen; int colbase; }; @@ -494,21 +494,21 @@ public: struct objectcache { // these needs to be all the elements actually going to affect the decode of an individual tile for any given object - UINT32 lastromoffset; - UINT16 lastused_flipx; - UINT16 lastused_flipy; - UINT32 lastblit_rotate; - UINT32 lastb1mode; - UINT32 lastb1colorNumber; - UINT32 lastb2colorNumber; - UINT32 lastb2altpenmask; - UINT16 lastused_hCellCount; - UINT16 lastused_vCellCount; + uint32_t lastromoffset; + uint16_t lastused_flipx; + uint16_t lastused_flipy; + uint32_t lastblit_rotate; + uint32_t lastb1mode; + uint32_t lastb1colorNumber; + uint32_t lastb2colorNumber; + uint32_t lastb2altpenmask; + uint16_t lastused_hCellCount; + uint16_t lastused_vCellCount; int repeatcount; struct dectile { - UINT16 tempshape_multi[16*16]; + uint16_t tempshape_multi[16*16]; bool tempshape_multi_decoded; bool is_blank; }; @@ -523,7 +523,7 @@ public: objectcache objcache[DECODECACHE_NUMOBJECTCACHES]; // fallback decode buffer for certain cases (indirect sprites, sprites too big for our buffer..) - UINT16 tempshape[16*16]; + uint16_t tempshape[16*16]; }; objcachemanager decode[2]; @@ -583,11 +583,11 @@ void coolridr_state::video_start() #define COOLRIDERS_DRAWGFX_CORE(PIXEL_TYPE, COOL_PIXEL_OP) \ do { \ do { \ - const UINT8 *srcdata; \ - INT32 destendx, destendy; \ - INT32 srcx, srcy; \ - INT32 curx, cury; \ - INT32 dy; \ + const uint8_t *srcdata; \ + int32_t destendx, destendy; \ + int32_t srcx, srcy; \ + int32_t curx, cury; \ + int32_t dy; \ \ assert(dest.valid()); \ assert(gfx != nullptr); \ @@ -648,8 +648,8 @@ do { srcdata = gfx->get_data(code); \ \ /* compute how many blocks of 4 pixels we have */ \ - UINT32 numblocks = (destendx + 1 - destx) / 4; \ - UINT32 leftovers = (destendx + 1 - destx) - 4 * numblocks; \ + uint32_t numblocks = (destendx + 1 - destx) / 4; \ + uint32_t leftovers = (destendx + 1 - destx) - 4 * numblocks; \ \ /* adjust srcdata to point to the first source pixel of the row */ \ srcdata += srcy * gfx->rowbytes() + srcx; \ @@ -661,7 +661,7 @@ do { for (cury = desty; cury <= destendy; cury++) \ { \ PIXEL_TYPE *destptr = &dest.pixt(cury, destx); \ - const UINT8 *srcptr = srcdata; \ + const uint8_t *srcptr = srcdata; \ srcdata += dy; \ \ /* iterate over unrolled blocks of 4 */ \ @@ -693,7 +693,7 @@ do { for (cury = desty; cury <= destendy; cury++) \ { \ PIXEL_TYPE *destptr = &dest.pixt(cury, destx); \ - const UINT8 *srcptr = srcdata; \ + const uint8_t *srcptr = srcdata; \ srcdata += dy; \ \ /* iterate over unrolled blocks of 4 */ \ @@ -731,7 +731,7 @@ while (0) #define COOLRIDERS_PIXEL_OP_REMAP_TRANSPEN(DEST, SOURCE) \ do \ { \ - UINT32 srcdata = (SOURCE); \ + uint32_t srcdata = (SOURCE); \ if (srcdata != transpen) \ (DEST) = paldata[srcdata]; \ } \ @@ -740,16 +740,16 @@ while (0) void coolridr_state::coolriders_drawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty) { const pen_t *paldata = &m_tilepals[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; code %= gfx->elements(); - COOLRIDERS_DRAWGFX_CORE(UINT16, COOLRIDERS_PIXEL_OP_REMAP_OPAQUE); + COOLRIDERS_DRAWGFX_CORE(uint16_t, COOLRIDERS_PIXEL_OP_REMAP_OPAQUE); } void coolridr_state::coolriders_drawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 transpen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t transpen) { // special case invalid pens to opaque if (transpen > 0xff) @@ -760,7 +760,7 @@ void coolridr_state::coolriders_drawgfx_transpen(bitmap_ind16 &dest, const recta if (gfx->has_pen_usage()) { // fully transparent; do nothing - UINT32 usage = gfx->pen_usage(code); + uint32_t usage = gfx->pen_usage(code); if ((usage & ~(1 << transpen)) == 0) return; @@ -771,7 +771,7 @@ void coolridr_state::coolriders_drawgfx_transpen(bitmap_ind16 &dest, const recta // render const pen_t *paldata = &m_tilepals[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())] ; - COOLRIDERS_DRAWGFX_CORE(UINT16, COOLRIDERS_PIXEL_OP_REMAP_TRANSPEN); + COOLRIDERS_DRAWGFX_CORE(uint16_t, COOLRIDERS_PIXEL_OP_REMAP_TRANSPEN); } void coolridr_state::draw_bg_coolridr(bitmap_ind16 &bitmap, const rectangle &cliprect, int which) @@ -796,11 +796,11 @@ void coolridr_state::draw_bg_coolridr(bitmap_ind16 &bitmap, const rectangle &cli } else { - UINT32 base_offset; + uint32_t base_offset; int tile,vram_data,color; int scrollx; int scrolly; - UINT8 transpen_setting; + uint8_t transpen_setting; gfx_element *gfx = m_gfxdecode->gfx(m_gfx_index); #define VREG(_offs) \ space.read_dword(m_vregs_address+_offs+which*0x40) @@ -819,10 +819,10 @@ void coolridr_state::draw_bg_coolridr(bitmap_ind16 &bitmap, const rectangle &cli bitmap.fill(VREG(0x3c),cliprect); - UINT16 basey = scrolly>>4; + uint16_t basey = scrolly>>4; for (int y=0;y<25;y++) { - UINT16 basex = scrollx>>4; + uint16_t basex = scrollx>>4; for (int x=0;x<32;x++) { vram_data = (m_h1_vram[((basex&0x7f)+((basey&0x3f)*0x80)+base_offset)&0x07ffff] & 0xffff); @@ -841,7 +841,7 @@ void coolridr_state::draw_bg_coolridr(bitmap_ind16 &bitmap, const rectangle &cli } -UINT32 coolridr_state::screen_update_coolridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which) +uint32_t coolridr_state::screen_update_coolridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which) { if(m_rgb_ctrl[which].gradient) { @@ -899,8 +899,8 @@ UINT32 coolridr_state::screen_update_coolridr(screen_device &screen, bitmap_ind1 { for (int y=0;y<384;y++) { - UINT16* linesrc = &m_screen1_bitmap.pix16(y); - UINT16* linedest = &bitmap.pix16(y); + uint16_t* linesrc = &m_screen1_bitmap.pix16(y); + uint16_t* linedest = &bitmap.pix16(y); for (int x=0;x<496;x++) { @@ -912,8 +912,8 @@ UINT32 coolridr_state::screen_update_coolridr(screen_device &screen, bitmap_ind1 { for (int y=0;y<384;y++) { - UINT16* linesrc = &m_screen2_bitmap.pix16(y); - UINT16* linedest = &bitmap.pix16(y); + uint16_t* linesrc = &m_screen2_bitmap.pix16(y); + uint16_t* linedest = &bitmap.pix16(y); for (int x=0;x<496;x++) { @@ -925,7 +925,7 @@ UINT32 coolridr_state::screen_update_coolridr(screen_device &screen, bitmap_ind1 return 0; } -UINT32 coolridr_state::screen_update_coolridr1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t coolridr_state::screen_update_coolridr1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { #if 0 if (machine().input().code_pressed_once(KEYCODE_W)) @@ -943,7 +943,7 @@ UINT32 coolridr_state::screen_update_coolridr1(screen_device &screen, bitmap_ind return screen_update_coolridr(screen,bitmap,cliprect,0); } -UINT32 coolridr_state::screen_update_coolridr2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t coolridr_state::screen_update_coolridr2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update_coolridr(screen,bitmap,cliprect,1); } @@ -967,13 +967,13 @@ UINT32 coolridr_state::screen_update_coolridr2(screen_device &screen, bitmap_ind while (data_written<256) \ { \ \ - const UINT16 compdata = expanded_10bit_gfx[ (b3romoffset) + spriteNumber + i]; \ + const uint16_t compdata = expanded_10bit_gfx[ (b3romoffset) + spriteNumber + i]; \ \ if (((compdata & 0x300) == 0x000) || ((compdata & 0x300) == 0x100)) /* 3bpp */ \ { \ /* mm ccrr rrr0 */ \ int encodelength = (compdata & 0x03e)>>1; \ - const UINT16 rledata = rearranged_16bit_gfx[color_offs + ((compdata & 0x1c0) >> 6)]; \ + const uint16_t rledata = rearranged_16bit_gfx[color_offs + ((compdata & 0x1c0) >> 6)]; \ /* guess, blank tiles have the following form */ \ /* 00120 (00000024,0) | 010 03f */ \ if (compdata&1) encodelength = 255; \ @@ -990,7 +990,7 @@ UINT32 coolridr_state::screen_update_coolridr2(screen_device &screen, bitmap_ind { \ /* mm cccc ccrr */ \ int encodelength = (compdata & 0x003); \ - const UINT16 rledata = rearranged_16bit_gfx[color_offs + ((compdata & 0x0fc) >> 2) + 8]; \ + const uint16_t rledata = rearranged_16bit_gfx[color_offs + ((compdata & 0x0fc) >> 2) + 8]; \ while (data_written<256 && encodelength >=0) \ { \ tempshape[data_written^writeaddrxor] = rledata; /* + 0x8 crt test, most of red, green, start of blue */ \ @@ -1002,7 +1002,7 @@ UINT32 coolridr_state::screen_update_coolridr2(screen_device &screen, bitmap_ind else /* 8bpp */ \ { \ /* mm cccc cccc */ \ - UINT16 rawdat = (compdata & 0x0ff); \ + uint16_t rawdat = (compdata & 0x0ff); \ if (b1mode && (rawdat > (b2altpenmask + 0x48))) /* does this have to be turned on by b1mode? road ends up with some bad pixels otherwise but maybe the calc is wrong... does it affect the other colour depths too? */ \ tempshape[data_written^writeaddrxor] = rearranged_16bit_gfx[color_offs2 + (rawdat )+0x48]; /* bike wheels + brake light */ \ else \ @@ -1020,7 +1020,7 @@ UINT32 coolridr_state::screen_update_coolridr2(screen_device &screen, bitmap_ind object->state->decode[screen].objcache[use_object].tiles[v*used_hCellCount + h].is_blank = true; \ else \ object->state->decode[screen].objcache[use_object].tiles[v*used_hCellCount + h].is_blank = false; \ - /* if (object->screen==0) printf("marking offset %04x as decoded (sprite number %08x ptr %08x)\n", v*used_hCellCount + h, spriteNumber, ((UINT64)(void*)tempshape)&0xffffffff);*/ \ + /* if (object->screen==0) printf("marking offset %04x as decoded (sprite number %08x ptr %08x)\n", v*used_hCellCount + h, spriteNumber, ((uint64_t)(void*)tempshape)&0xffffffff);*/ \ } \ } \ } @@ -1103,7 +1103,7 @@ UINT32 coolridr_state::screen_update_coolridr2(screen_device &screen, bitmap_ind } \ } \ } \ - UINT32 spriteNumber = (expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) +0 ] << 10) | (expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) + 1 ]); + uint32_t spriteNumber = (expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) +0 ] << 10) | (expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) + 1 ]); #define DO_XCLIP_REAL \ if (drawx>clipmaxX) { break; } \ @@ -1115,8 +1115,8 @@ UINT32 coolridr_state::screen_update_coolridr2(screen_device &screen, bitmap_ind #define GET_CURRENT_LINESCROLLZOOM \ - UINT32 dword = object->indirect_zoom[v*16+realy]; \ - UINT16 hZoomHere = hZoom + (dword>>16); \ + uint32_t dword = object->indirect_zoom[v*16+realy]; \ + uint16_t hZoomHere = hZoom + (dword>>16); \ if (!hZoomHere) { drawy++; continue; } \ /* bit 0x8000 does get set too, but only on some lines, might have another meaning? */ \ int linescroll = dword&0x7fff; \ @@ -1162,7 +1162,7 @@ UINT32 coolridr_state::screen_update_coolridr2(screen_device &screen, bitmap_ind if (pixelOffsetX>clipmaxX) { drawy++; continue; } \ if (pixelOffsetX>=clipminX && pixelOffsetX+blockwide>10)&0x1f) * blit4blendlevelinv; \ int src_g = ((source>>5)&0x1f) * blit4blendlevelinv; \ int src_b = ((source>>0)&0x1f) * blit4blendlevelinv; \ @@ -1281,9 +1281,9 @@ TODO: fix anything that isn't text. //object->expanded_10bit_gfx #define GET_PIX_ROTATED \ - UINT16 pix = tempshape[realx*16+realy]; + uint16_t pix = tempshape[realx*16+realy]; #define GET_PIX_NORMAL \ - UINT16 pix = tempshape[realy*16+realx]; + uint16_t pix = tempshape[realy*16+realx]; void *coolridr_state::draw_object_threaded(void *param, int threadid) { @@ -1292,14 +1292,14 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) /************* object->spriteblit[3] *************/ - UINT32 blit3_unused = object->spriteblit[3] & 0xffe00000; - UINT32 b3romoffset = (object->spriteblit[3] & 0x001fffff)*16; + uint32_t blit3_unused = object->spriteblit[3] & 0xffe00000; + uint32_t b3romoffset = (object->spriteblit[3] & 0x001fffff)*16; if (blit3_unused) printf("unknown bits in blit word %d - %08x\n", 3, blit3_unused); /************* object->spriteblit[5] *************/ - UINT32 blit5_unused = object->spriteblit[5]&0xfffefffe; + uint32_t blit5_unused = object->spriteblit[5]&0xfffefffe; // this might enable the text indirection thing? int indirect_tile_enable = (object->spriteblit[5] & 0x00010000)>>16; int indirect_zoom_enable = (object->spriteblit[5] & 0x00000001); @@ -1312,21 +1312,21 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) - UINT16* rearranged_16bit_gfx = object->state->m_rearranged_16bit_gfx.get(); - UINT16* expanded_10bit_gfx = object->state->m_expanded_10bit_gfx.get(); + uint16_t* rearranged_16bit_gfx = object->state->m_rearranged_16bit_gfx.get(); + uint16_t* expanded_10bit_gfx = object->state->m_expanded_10bit_gfx.get(); - INT16 clipminX = CLIPMINX_FULL; - INT16 clipmaxX = CLIPMAXX_FULL; - INT16 clipminY = CLIPMINY_FULL; - INT16 clipmaxY = CLIPMAXY_FULL; + int16_t clipminX = CLIPMINX_FULL; + int16_t clipmaxX = CLIPMAXX_FULL; + int16_t clipminY = CLIPMINY_FULL; + int16_t clipmaxY = CLIPMAXY_FULL; /************* object->spriteblit[1] *************/ // 000u0ccc - c = colour? u = 0/1 - UINT32 blit1_unused = object->spriteblit[1] & 0xfffef800; - UINT32 b1mode = (object->spriteblit[1] & 0x00010000)>>16; - UINT32 b1colorNumber = (object->spriteblit[1] & 0x000007ff); // Probably more bits + uint32_t blit1_unused = object->spriteblit[1] & 0xfffef800; + uint32_t b1mode = (object->spriteblit[1] & 0x00010000)>>16; + uint32_t b1colorNumber = (object->spriteblit[1] & 0x000007ff); // Probably more bits if (blit1_unused!=0) printf("blit1 unknown bits set %08x\n", object->spriteblit[1]); @@ -1339,9 +1339,9 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) /************* object->spriteblit[3] *************/ // seems to be more complex than just transparency - UINT32 blit2_unused = object->spriteblit[2]&0xff80f800; - UINT32 b2altpenmask = (object->spriteblit[2] & 0x007f0000)>>16; - UINT32 b2colorNumber = (object->spriteblit[2] & 0x000007ff); + uint32_t blit2_unused = object->spriteblit[2]&0xff80f800; + uint32_t b2altpenmask = (object->spriteblit[2] & 0x007f0000)>>16; + uint32_t b2colorNumber = (object->spriteblit[2] & 0x000007ff); if (b2colorNumber != b1colorNumber) { @@ -1370,17 +1370,17 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) /************* object->spriteblit[4] *************/ - UINT32 blit4_unused = object->spriteblit[4] & 0xf8fefeee; - UINT16 blit4blendlevel = (object->spriteblit[4] & 0x07000000)>>24; - UINT16 blit4blendlevelinv = blit4blendlevel^0x7; + uint32_t blit4_unused = object->spriteblit[4] & 0xf8fefeee; + uint16_t blit4blendlevel = (object->spriteblit[4] & 0x07000000)>>24; + uint16_t blit4blendlevelinv = blit4blendlevel^0x7; blit4blendlevel+=1; // make our maths easier later (not sure about accuracy) //object->zpri = 7-blit4; // unknown bits in blit word 4 - 00000010 - australia (and various other times) - UINT32 blit_flipx = object->spriteblit[4] & 0x00000001; - UINT32 blit_flipy = (object->spriteblit[4] & 0x00000100)>>8; - UINT32 blit_rotate = (object->spriteblit[4] & 0x00010000)>>16; - //UINT32 b4_unk = object->spriteblit[4] & 0x00000010; + uint32_t blit_flipx = object->spriteblit[4] & 0x00000001; + uint32_t blit_flipy = (object->spriteblit[4] & 0x00000100)>>8; + uint32_t blit_rotate = (object->spriteblit[4] & 0x00010000)>>16; + //uint32_t b4_unk = object->spriteblit[4] & 0x00000010; if (blit4_unused) printf("unknown bits in blit word %d - %08x\n", 4, blit4_unused); @@ -1413,14 +1413,14 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) /************* object->spriteblit[6] *************/ - UINT16 vCellCount = (object->spriteblit[6] & 0x03ff0000) >> 16; - UINT16 hCellCount = (object->spriteblit[6] & 0x000003ff); + uint16_t vCellCount = (object->spriteblit[6] & 0x03ff0000) >> 16; + uint16_t hCellCount = (object->spriteblit[6] & 0x000003ff); /************* object->spriteblit[7] *************/ - UINT16 vOrigin = (object->spriteblit[7] & 0x00030000) >> 16; - UINT16 hOrigin = (object->spriteblit[7] & 0x00000003); - UINT16 OriginUnused = (object->spriteblit[7] & 0xfffcfffc); + uint16_t vOrigin = (object->spriteblit[7] & 0x00030000) >> 16; + uint16_t hOrigin = (object->spriteblit[7] & 0x00000003); + uint16_t OriginUnused = (object->spriteblit[7] & 0xfffcfffc); if (blit5_unused) printf("unknown bits in blit word %d - %08x\n", 7, OriginUnused); @@ -1428,8 +1428,8 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) /************* object->spriteblit[8] *************/ - UINT16 vZoom = (object->spriteblit[8] & 0xffff0000) >> 16; - UINT16 hZoom = (object->spriteblit[8] & 0x0000ffff); + uint16_t vZoom = (object->spriteblit[8] & 0xffff0000) >> 16; + uint16_t hZoom = (object->spriteblit[8] & 0x0000ffff); // if we have no vertical zoom value there's no point in going any further // because there are no known vertical indirect modes @@ -1458,11 +1458,11 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) /************* object->spriteblit[10] *************/ // pointer to per-line zoom and scroll data for sprites - //UINT32 blit10 = 0; // we've cached the data here already + //uint32_t blit10 = 0; // we've cached the data here already /************* object->spriteblit[11] *************/ - //UINT32 textlookup = 0; // we've cached the data here already + //uint32_t textlookup = 0; // we've cached the data here already /* sample data from attract mode 'filmstrip' @@ -1753,10 +1753,10 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) if (object->clipvals[2] & 0x0000007) // clearly this isn't the enable flag, probably just enabled until next frame / it gets disabled { // these go negative when things scroll off the left in attract mode - INT16 minx = ((object->clipvals[1]&0xffff0000)>>16) - (((object->clipvals[2]&0x0000ffff)>>0)); - INT16 maxx = ((object->clipvals[1]&0x0000ffff)>>0) - (((object->clipvals[2]&0x0000ffff)>>0)); - INT16 miny = ((object->clipvals[0]&0xffff0000)>>16); // maybe subtract the top 16 bits of clipvals[2], but not used? - INT16 maxy = ((object->clipvals[0]&0x0000ffff)>>0); + int16_t minx = ((object->clipvals[1]&0xffff0000)>>16) - (((object->clipvals[2]&0x0000ffff)>>0)); + int16_t maxx = ((object->clipvals[1]&0x0000ffff)>>0) - (((object->clipvals[2]&0x0000ffff)>>0)); + int16_t miny = ((object->clipvals[0]&0xffff0000)>>16); // maybe subtract the top 16 bits of clipvals[2], but not used? + int16_t maxy = ((object->clipvals[0]&0x0000ffff)>>0); clipminX = minx -1; @@ -1780,10 +1780,10 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) } /* DRAW */ - UINT16 used_hCellCount = hCellCount; - UINT16 used_vCellCount = vCellCount; - UINT16 used_flipx = blit_flipx; - UINT16 used_flipy = blit_flipy; + uint16_t used_hCellCount = hCellCount; + uint16_t used_vCellCount = vCellCount; + uint16_t used_flipx = blit_flipx; + uint16_t used_flipy = blit_flipy; if (blit_rotate) { @@ -1805,7 +1805,7 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) int size = used_hCellCount * used_vCellCount; - UINT16* tempshape; + uint16_t* tempshape; int screen = object->screen; int use_object = 0; @@ -1942,8 +1942,8 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) } } - UINT32 lastSpriteNumber = 0xffffffff; - UINT16 blankcount = 0; + uint32_t lastSpriteNumber = 0xffffffff; + uint16_t blankcount = 0; int color_offs = (object->colbase + (b1colorNumber & 0x7ff))*0x40 * 5; /* yes, * 5 */ \ int color_offs2 = (object->colbase + (b2colorNumber & 0x7ff))*0x40 * 5; for (int h = 0; h < used_hCellCount; h++) @@ -1957,8 +1957,8 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) /* if (object->screen==0) { - if (current_decoded) printf("setting temp shape to %04x tile is marked as decoded %08x \n", v*used_hCellCount + h, ((UINT64)(void*)tempshape)&0xffffffff); - else printf("setting temp shape to %04x tile is marked as NOT decoded %08x \n", v*used_hCellCount + h, ((UINT64)(void*)tempshape)&0xffffffff); + if (current_decoded) printf("setting temp shape to %04x tile is marked as decoded %08x \n", v*used_hCellCount + h, ((uint64_t)(void*)tempshape)&0xffffffff); + else printf("setting temp shape to %04x tile is marked as NOT decoded %08x \n", v*used_hCellCount + h, ((uint64_t)(void*)tempshape)&0xffffffff); } */ } @@ -1971,11 +1971,11 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) - UINT32 incy = 0x8000000 / vZoom; + uint32_t incy = 0x8000000 / vZoom; // DEBUG: Draw 16x16 block - UINT16* line; - //UINT16* zline; + uint16_t* line; + //uint16_t* zline; if (indirect_zoom_enable) @@ -2064,7 +2064,7 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid) const int pixelOffsetnextX = ((hPosition) + ((h+1)* 16 * hZoom)) / 0x40; int blockwide = pixelOffsetnextX-pixelOffsetX; - UINT32 incx = 0x8000000 / (object->spriteblit[8] & 0x0000ffff); + uint32_t incx = 0x8000000 / (object->spriteblit[8] & 0x0000ffff); if (pixelOffsetX+blockwide < clipminX) continue; @@ -2174,7 +2174,7 @@ void coolridr_state::blit_current_sprite(address_space &space) // // the sprites with 1 set appear to have 0x00000000 in everything after the 4th write (blit4 and above) // so likely have some other meaning and are NOT regular sprite data - UINT32 blit0 = m_spriteblit[0]; + uint32_t blit0 = m_spriteblit[0]; if (blit0==0) { @@ -2247,11 +2247,11 @@ void coolridr_state::blit_current_sprite(address_space &space) if (test_indirect_tile_enable) { - UINT32 test_textlookup = m_spriteblit[11]; - UINT16 test_hCellCount = (m_spriteblit[6] & 0x00003ff); - UINT16 test_vCellCount = (m_spriteblit[6] & 0x03ff0000) >> 16; + uint32_t test_textlookup = m_spriteblit[11]; + uint16_t test_hCellCount = (m_spriteblit[6] & 0x00003ff); + uint16_t test_vCellCount = (m_spriteblit[6] & 0x03ff0000) >> 16; int bytes = test_vCellCount*test_hCellCount; - testobject->indirect_tiles = (UINT8*)malloc(bytes); + testobject->indirect_tiles = (uint8_t*)malloc(bytes); for (int i=0;iindirect_tiles[i] = space.read_byte(test_textlookup + i); @@ -2265,10 +2265,10 @@ void coolridr_state::blit_current_sprite(address_space &space) int test_indirect_zoom_enable = (m_spriteblit[5] & 0x00000001); if (test_indirect_zoom_enable) { - UINT32 test_blit10 = m_spriteblit[10]; - UINT16 test_vCellCount = (m_spriteblit[6] & 0x03ff0000) >> 16; + uint32_t test_blit10 = m_spriteblit[10]; + uint16_t test_vCellCount = (m_spriteblit[6] & 0x03ff0000) >> 16; int bytes = test_vCellCount * 4 * 16; - testobject->indirect_zoom = (UINT32*)malloc(bytes); + testobject->indirect_zoom = (uint32_t*)malloc(bytes); for (int i=0;iindirect_zoom[i] = space.read_dword(test_blit10 + i*4); @@ -2416,7 +2416,7 @@ WRITE32_MEMBER(coolridr_state::sysh1_blit_mode_w) else if (m_blitterMode == 0x10) { // Could be a full clear of VRAM? - for(UINT32 vramAddr = 0x3f40000; vramAddr < 0x3f4ffff; vramAddr+=4) + for(uint32_t vramAddr = 0x3f40000; vramAddr < 0x3f4ffff; vramAddr+=4) space.write_dword(vramAddr, 0x00000000); m_blitterSerialCount = 0; @@ -2716,11 +2716,11 @@ WRITE32_MEMBER(coolridr_state::sysh1_unk_blit_w) -void coolridr_state::sysh1_dma_transfer( address_space &space, UINT16 dma_index ) +void coolridr_state::sysh1_dma_transfer( address_space &space, uint16_t dma_index ) { - UINT32 src = 0,dst = 0,size = 0; - UINT8 end_dma_mark; - UINT8 cmd; + uint32_t src = 0,dst = 0,size = 0; + uint8_t end_dma_mark; + uint8_t cmd; end_dma_mark = 0; @@ -2890,7 +2890,7 @@ WRITE16_MEMBER( coolridr_state::h1_soundram2_w) READ8_MEMBER( coolridr_state::analog_mux_r ) { - UINT8 adc_data = 0; + uint8_t adc_data = 0; switch(an_mux_data) { case 0x0: adc_data = m_io_an0->read(); break; @@ -2965,9 +2965,9 @@ WRITE32_MEMBER(coolridr_state::sysh1_sound_dma_w) { if(data & 1 && (!(m_sound_dma[2] & 1))) // 0 -> 1 transition enables DMA { - UINT32 src = m_sound_dma[0]; - UINT32 dst = m_sound_dma[1]; - UINT32 size = (m_sound_dma[2]>>16)*0x40; + uint32_t src = m_sound_dma[0]; + uint32_t dst = m_sound_dma[1]; + uint32_t size = (m_sound_dma[2]>>16)*0x40; //printf("%08x %08x %08x %02x\n",src,dst,size,sound_fifo); @@ -2984,9 +2984,9 @@ WRITE32_MEMBER(coolridr_state::sysh1_sound_dma_w) { if(data & 1 && (!(m_sound_dma[6] & 1))) // 0 -> 1 transition enables DMA { - UINT32 src = m_sound_dma[4]; - UINT32 dst = m_sound_dma[5]; - UINT32 size = (m_sound_dma[6]>>16)*0x40; + uint32_t src = m_sound_dma[4]; + uint32_t dst = m_sound_dma[5]; + uint32_t size = (m_sound_dma[6]>>16)*0x40; //printf("%08x %08x %08x %02x\n",src,dst,size,sound_fifo); @@ -3561,9 +3561,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(coolridr_state::system_h1_sub) #define READ_COMPRESSED_ROM(chip) \ m_compressedgfx[(chip)*0x400000 + romoffset] << 8 | m_compressedgfx[(chip)*0x0400000 + romoffset +1]; // this helps you feth the 20bit words from an address in the compressed data -UINT32 coolridr_state::get_20bit_data(UINT32 romoffset, int _20bitwordnum) +uint32_t coolridr_state::get_20bit_data(uint32_t romoffset, int _20bitwordnum) { - UINT16 testvalue, testvalue2; + uint16_t testvalue, testvalue2; int temp = _20bitwordnum & 3; int inc = 0; @@ -3598,9 +3598,9 @@ UINT32 coolridr_state::get_20bit_data(UINT32 romoffset, int _20bitwordnum) } -UINT16 coolridr_state::get_10bit_data(UINT32 romoffset, int _10bitwordnum) +uint16_t coolridr_state::get_10bit_data(uint32_t romoffset, int _10bitwordnum) { - UINT32 data = get_20bit_data(romoffset, _10bitwordnum>>1); + uint32_t data = get_20bit_data(romoffset, _10bitwordnum>>1); if (_10bitwordnum&1) return data & 0x3ff; else return (data>>10) & 0x3ff; } @@ -3611,7 +3611,7 @@ void coolridr_state::machine_start() size_t size = memregion( "compressedgfx" )->bytes(); // we're expanding 10bit packed data to 16bits(10 used) - m_expanded_10bit_gfx = std::make_unique(((size/10)*16)/2); + m_expanded_10bit_gfx = std::make_unique(((size/10)*16)/2); for (int i=0;i<(0x800000*8)/2;i++) { @@ -3620,9 +3620,9 @@ void coolridr_state::machine_start() // do a rearranged version too with just the 16-bit words in a different order, palettes seem to // be referenced this way?! - m_rearranged_16bit_gfx = std::make_unique(size/2); + m_rearranged_16bit_gfx = std::make_unique(size/2); - UINT16* compressed = (UINT16*)memregion( "compressedgfx" )->base(); + uint16_t* compressed = (uint16_t*)memregion( "compressedgfx" )->base(); int count = 0; for (int i=0;i(VRAM_SIZE); - m_h1_pcg = make_unique_clear(VRAM_SIZE); - m_h1_pal = make_unique_clear(VRAM_SIZE); + m_h1_vram = make_unique_clear(VRAM_SIZE); + m_h1_pcg = make_unique_clear(VRAM_SIZE); + m_h1_pal = make_unique_clear(VRAM_SIZE); m_cool_render_object_list1 = auto_alloc_array_clear(machine(), struct cool_render_object*, 1000000); m_listcount1 = 0; diff --git a/src/mame/drivers/cop01.cpp b/src/mame/drivers/cop01.cpp index 9485816f51a..2c31bb55ed8 100644 --- a/src/mame/drivers/cop01.cpp +++ b/src/mame/drivers/cop01.cpp @@ -647,7 +647,7 @@ DRIVER_INIT_MEMBER(cop01_state,mightguy) #if MIGHTGUY_HACK /* This is a hack to fix the game code to get a fully working "Starting Area" fake Dip Switch */ - UINT8 *RAM = (UINT8 *)memregion("maincpu")->base(); + uint8_t *RAM = (uint8_t *)memregion("maincpu")->base(); RAM[0x00e4] = 0x07; // rlca RAM[0x00e5] = 0x07; // rlca RAM[0x00e6] = 0x07; // rlca diff --git a/src/mame/drivers/cops.cpp b/src/mame/drivers/cops.cpp index 98196e8048c..36320353ead 100644 --- a/src/mame/drivers/cops.cpp +++ b/src/mame/drivers/cops.cpp @@ -66,7 +66,7 @@ public: required_device m_ld; // screen updates - 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: // driver_device overrides @@ -86,7 +86,7 @@ public: DECLARE_WRITE_LINE_MEMBER(ld_w); DECLARE_WRITE_LINE_MEMBER(via1_irq); DECLARE_WRITE_LINE_MEMBER(via2_irq); - void dacia_receive(UINT8 data); + void dacia_receive(uint8_t data); void update_dacia_irq(); DECLARE_WRITE8_MEMBER(dacia_w); DECLARE_READ8_MEMBER(dacia_r); @@ -98,68 +98,68 @@ public: DECLARE_DRIVER_INIT(cops); int m_irq; - UINT8 m_lcd_addr_l, m_lcd_addr_h; - UINT8 m_lcd_data_l, m_lcd_data_h; + uint8_t m_lcd_addr_l, m_lcd_addr_h; + uint8_t m_lcd_data_l, m_lcd_data_h; - UINT8 m_dacia_irq1_reg; - UINT8 m_dacia_rts1; - UINT8 m_dacia_dtr1; + uint8_t m_dacia_irq1_reg; + uint8_t m_dacia_rts1; + uint8_t m_dacia_dtr1; - UINT8 m_parity_1; - UINT8 m_parity_mode_1; - UINT8 m_bpc_1; + uint8_t m_parity_1; + uint8_t m_parity_mode_1; + uint8_t m_bpc_1; int m_dacia_ic_div_1; - UINT8 m_dacia_echo1; - UINT8 m_dacia_stp_1; - UINT8 m_dacia_reg1; - UINT8 m_dacia_fe1; - UINT8 m_dacia_cmp1; - UINT8 m_dacia_cmpval1; - - UINT8 m_dacia_irq2_reg; - UINT8 m_dacia_rts2; - UINT8 m_dacia_dtr2; - - UINT8 m_parity_2; - UINT8 m_parity_mode_2; - UINT8 m_bpc_2; + uint8_t m_dacia_echo1; + uint8_t m_dacia_stp_1; + uint8_t m_dacia_reg1; + uint8_t m_dacia_fe1; + uint8_t m_dacia_cmp1; + uint8_t m_dacia_cmpval1; + + uint8_t m_dacia_irq2_reg; + uint8_t m_dacia_rts2; + uint8_t m_dacia_dtr2; + + uint8_t m_parity_2; + uint8_t m_parity_mode_2; + uint8_t m_bpc_2; int m_dacia_ic_div_2; - UINT8 m_dacia_echo2; - UINT8 m_dacia_stp_2; - UINT8 m_dacia_reg2; - UINT8 m_dacia_fe2; - UINT8 m_dacia_cmp2; - UINT8 m_dacia_cmpval2; + uint8_t m_dacia_echo2; + uint8_t m_dacia_stp_2; + uint8_t m_dacia_reg2; + uint8_t m_dacia_fe2; + uint8_t m_dacia_cmp2; + uint8_t m_dacia_cmpval2; - UINT8 m_dacia_cts; - UINT8 m_dacia_dcd; - UINT8 m_dacia_trans; - UINT8 m_dacia_trans2; + uint8_t m_dacia_cts; + uint8_t m_dacia_dcd; + uint8_t m_dacia_trans; + uint8_t m_dacia_trans2; - UINT8 m_dacia_receiver_data; - UINT8 m_dacia_receiver_full; + uint8_t m_dacia_receiver_data; + uint8_t m_dacia_receiver_full; - UINT8 m_dacia_receiver_data2; - UINT8 m_dacia_receiver_full2; + uint8_t m_dacia_receiver_data2; + uint8_t m_dacia_receiver_full2; - UINT8 m_cdrom_ctrl; - UINT8 m_cdrom_data; + uint8_t m_cdrom_ctrl; + uint8_t m_cdrom_data; - UINT8 m_sn_data; - UINT8 m_sn_cb1; + uint8_t m_sn_data; + uint8_t m_sn_cb1; // LDP-1450 emu_timer *m_ld_timer; TIMER_CALLBACK_MEMBER(ld_timer_callback); - UINT8 m_ld_command_to_send[8]; - UINT8 m_ld_command_current_byte; - UINT8 ldcount=0; - UINT8 lddata; - UINT8 generate_isr(); - UINT8 generate_isr2(); -// void laserdisc_w(UINT8 data); - void laserdisc_response_w(UINT8 data); + uint8_t m_ld_command_to_send[8]; + uint8_t m_ld_command_current_byte; + uint8_t ldcount=0; + uint8_t lddata; + uint8_t generate_isr(); + uint8_t generate_isr2(); +// void laserdisc_w(uint8_t data); + void laserdisc_response_w(uint8_t data); }; const int timer_divide_select[16] = @@ -186,7 +186,7 @@ void cops_state::video_start() { } -UINT32 cops_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t cops_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } @@ -201,7 +201,7 @@ WRITE8_MEMBER(cops_state::cdrom_data_w) { const char *regs[4] = { "CMD", "PARAM", "WRITE", "CTRL" }; m_cdrom_data = BITSWAP8(data,0,1,2,3,4,5,6,7); - UINT8 reg = ((m_cdrom_ctrl & 4) >> 1) | ((m_cdrom_ctrl & 8) >> 3); + uint8_t reg = ((m_cdrom_ctrl & 4) >> 1) | ((m_cdrom_ctrl & 8) >> 3); if (LOG_CDROM) logerror("%s:cdrom_data_w(reg = %s, data = %02x)\n", machine().describe_context(), regs[reg & 0x03], m_cdrom_data); } @@ -214,7 +214,7 @@ WRITE8_MEMBER(cops_state::cdrom_ctrl_w) READ8_MEMBER(cops_state::cdrom_data_r) { const char *regs[4] = { "STATUS", "RESULT", "READ", "FIFOST" }; - UINT8 reg = ((m_cdrom_ctrl & 4) >> 1) | ((m_cdrom_ctrl & 8) >> 3); + uint8_t reg = ((m_cdrom_ctrl & 4) >> 1) | ((m_cdrom_ctrl & 8) >> 3); if (LOG_CDROM) logerror("%s:cdrom_data_r(reg = %s)\n", machine().describe_context(), regs[reg & 0x03]); return machine().rand()&0xff; } @@ -260,7 +260,7 @@ WRITE_LINE_MEMBER(cops_state::ld_w) printf("LDBIT %d",state); } -/*void cops_state::laserdisc_w(UINT8 data) +/*void cops_state::laserdisc_w(uint8_t data) { switch( m_ld_input_state ) { @@ -295,19 +295,19 @@ WRITE_LINE_MEMBER(cops_state::ld_w) void cops_state::update_dacia_irq() { - UINT8 isr = generate_isr(); + uint8_t isr = generate_isr(); //remove bits isr &= ~m_dacia_irq1_reg; m_maincpu->set_input_line(INPUT_LINE_NMI, isr? ASSERT_LINE:CLEAR_LINE); - UINT8 isr2 = generate_isr2(); + uint8_t isr2 = generate_isr2(); //remove bits isr2 &= ~m_dacia_irq2_reg; m_maincpu->set_input_line(INPUT_LINE_NMI, isr2? ASSERT_LINE:CLEAR_LINE); } -void cops_state::dacia_receive(UINT8 data) +void cops_state::dacia_receive(uint8_t data) { if (m_dacia_cmp1) { @@ -331,9 +331,9 @@ void cops_state::dacia_receive(UINT8 data) } } -UINT8 cops_state::generate_isr() +uint8_t cops_state::generate_isr() { - UINT8 isr =0; + uint8_t isr =0; isr |= m_dacia_receiver_full; isr |= (m_dacia_cmp1 << 1); @@ -346,9 +346,9 @@ UINT8 cops_state::generate_isr() return isr; } -UINT8 cops_state::generate_isr2() +uint8_t cops_state::generate_isr2() { - UINT8 isr2 =0; + uint8_t isr2 =0; isr2 |= m_dacia_receiver_full2; isr2 |= (m_dacia_cmp2 << 1); @@ -367,7 +367,7 @@ READ8_MEMBER(cops_state::dacia_r) { case 0: /* ISR1: Interrupt Status Register */ { - UINT8 isr = generate_isr(); + uint8_t isr = generate_isr(); m_dacia_trans =0; m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); return isr; @@ -375,7 +375,7 @@ READ8_MEMBER(cops_state::dacia_r) case 1: /* CSR1: Control Status Register */ { - UINT8 csr =0; + uint8_t csr =0; csr |= m_dacia_rts1; csr |= (m_dacia_dtr1 << 1); csr |= (m_dacia_cts <<4); @@ -395,7 +395,7 @@ READ8_MEMBER(cops_state::dacia_r) } case 4: /* ISR2: Interrupt Status Register */ { - UINT8 isr2 = generate_isr2(); + uint8_t isr2 = generate_isr2(); m_dacia_trans2 =0; m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); return isr2; @@ -403,7 +403,7 @@ READ8_MEMBER(cops_state::dacia_r) case 5: /* CSR2: Control Status Register */ { - UINT8 csr2 =0; + uint8_t csr2 =0; csr2 |= m_dacia_rts2; csr2 |= (m_dacia_dtr2 << 1); csr2 |= (m_dacia_cts <<4); @@ -621,7 +621,7 @@ WRITE8_MEMBER(cops_state::io1_w) { int i; char output_name[16]; - UINT16 display_data; + uint16_t display_data; switch( offset & 0x0f ) { @@ -632,9 +632,9 @@ WRITE8_MEMBER(cops_state::io1_w) m_lcd_addr_h = data; { // update display - const UINT16 addrs_table[] = { 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0002, 0x0001, 0x0080, + const uint16_t addrs_table[] = { 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0002, 0x0001, 0x0080, 0x1000, 0x0800, 0x0400, 0x2000, 0x4000, 0x0200, 0x0100, 0x8000 }; - UINT16 addr = m_lcd_addr_l | (m_lcd_addr_h << 8); + uint16_t addr = m_lcd_addr_l | (m_lcd_addr_h << 8); for (i = 0; i < 16; i++ ) { if (addr == addrs_table[i]) @@ -907,7 +907,7 @@ DRIVER_INIT_MEMBER(cops_state,cops) { //The hardware is designed and programmed to use multiple system ROM banks, but for some reason it's hardwired to bank 2. //For documentation's sake, here's the init - UINT8 *rom = memregion("system")->base(); + uint8_t *rom = memregion("system")->base(); membank("sysbank1")->configure_entries(0, 4, &rom[0x0000], 0x2000); membank("sysbank1")->set_entry(2); } diff --git a/src/mame/drivers/corona.cpp b/src/mame/drivers/corona.cpp index 1fa42e97bfd..ca0818f2ee4 100644 --- a/src/mame/drivers/corona.cpp +++ b/src/mame/drivers/corona.cpp @@ -328,13 +328,13 @@ public: m_screen(*this, "screen"), m_soundlatch(*this, "soundlatch") { } - UINT8 m_blitter_x_reg; - UINT8 m_blitter_y_reg; - UINT8 m_blitter_aux_reg; - UINT8 m_blitter_unk_reg; - std::unique_ptr m_videobuf; - UINT8 m_lamp; - UINT8 m_lamp_old; + uint8_t m_blitter_x_reg; + uint8_t m_blitter_y_reg; + uint8_t m_blitter_aux_reg; + uint8_t m_blitter_unk_reg; + std::unique_ptr m_videobuf; + uint8_t m_lamp; + uint8_t m_lamp_old; int m_input_selector; DECLARE_WRITE8_MEMBER(blitter_y_w); DECLARE_WRITE8_MEMBER(blitter_unk_w); @@ -351,8 +351,8 @@ public: void blitter_execute(int x, int y, int color, int width, int flag); virtual void video_start() override; DECLARE_PALETTE_INIT(corona); - UINT32 screen_update_winner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_luckyrlt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_winner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_luckyrlt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_soundcpu; required_device m_screen; @@ -366,7 +366,7 @@ public: PALETTE_INIT_MEMBER(corona_state, corona) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit6, bit7, bit0, bit1, r, g, b; int i; @@ -465,10 +465,10 @@ WRITE8_MEMBER(corona_state::blitter_trig_wdht_w) void corona_state::video_start() { - m_videobuf = make_unique_clear(VIDEOBUF_SIZE); + m_videobuf = make_unique_clear(VIDEOBUF_SIZE); } -UINT32 corona_state::screen_update_winner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t corona_state::screen_update_winner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; @@ -479,7 +479,7 @@ UINT32 corona_state::screen_update_winner(screen_device &screen, bitmap_ind16 &b return 0; } -UINT32 corona_state::screen_update_luckyrlt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t corona_state::screen_update_luckyrlt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; diff --git a/src/mame/drivers/cortex.cpp b/src/mame/drivers/cortex.cpp index 66563995066..fd96bc7feee 100644 --- a/src/mame/drivers/cortex.cpp +++ b/src/mame/drivers/cortex.cpp @@ -38,7 +38,7 @@ public: virtual void machine_reset() override; required_device m_maincpu; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; }; static ADDRESS_MAP_START( cortex_mem, AS_PROGRAM, 8, cortex_state ) @@ -69,7 +69,7 @@ INPUT_PORTS_END void cortex_state::machine_reset() { - UINT8* ROM = memregion("maincpu")->base(); + uint8_t* ROM = memregion("maincpu")->base(); memcpy(m_p_ram, ROM, 0x6000); m_maincpu->ready_line(ASSERT_LINE); } diff --git a/src/mame/drivers/cosmic.cpp b/src/mame/drivers/cosmic.cpp index bc2e4564818..4625ac6b3ea 100644 --- a/src/mame/drivers/cosmic.cpp +++ b/src/mame/drivers/cosmic.cpp @@ -1546,14 +1546,14 @@ DRIVER_INIT_MEMBER(cosmic_state,cosmicg) { /* Program ROMs have data pins connected different from normal */ offs_t offs, len; - UINT8 *rom; + uint8_t *rom; len = memregion("maincpu")->bytes(); rom = memregion("maincpu")->base(); for (offs = 0; offs < len; offs++) { - UINT8 scrambled = rom[offs]; + uint8_t scrambled = rom[offs]; - UINT8 normal = (scrambled >> 3 & 0x11) + uint8_t normal = (scrambled >> 3 & 0x11) | (scrambled >> 1 & 0x22) | (scrambled << 1 & 0x44) | (scrambled << 3 & 0x88); diff --git a/src/mame/drivers/cosmicos.cpp b/src/mame/drivers/cosmicos.cpp index 6c97e09e722..e6a23ee5c9e 100644 --- a/src/mame/drivers/cosmicos.cpp +++ b/src/mame/drivers/cosmicos.cpp @@ -50,7 +50,7 @@ READ8_MEMBER( cosmicos_state::read ) { if (m_boot) offset |= 0xc0c0; - UINT8 data = 0; + uint8_t data = 0; if (offset < 0xc000) { @@ -84,7 +84,7 @@ WRITE8_MEMBER( cosmicos_state::write ) READ8_MEMBER( cosmicos_state::video_off_r ) { - UINT8 data = 0; + uint8_t data = 0; if (!m_q) { @@ -96,7 +96,7 @@ READ8_MEMBER( cosmicos_state::video_off_r ) READ8_MEMBER( cosmicos_state::video_on_r ) { - UINT8 data = 0; + uint8_t data = 0; if (!m_q) { @@ -116,14 +116,14 @@ WRITE8_MEMBER( cosmicos_state::audio_latch_w ) READ8_MEMBER( cosmicos_state::hex_keyboard_r ) { - UINT8 data = 0; + uint8_t data = 0; int i; for (i = 0; i < 4; i++) { if (BIT(m_keylatch, i)) { - UINT8 keydata = m_key_row[i]->read(); + uint8_t keydata = m_key_row[i]->read(); if (BIT(keydata, 0)) data |= 0x01; if (BIT(keydata, 1)) data |= 0x02; @@ -193,7 +193,7 @@ ADDRESS_MAP_END INPUT_CHANGED_MEMBER( cosmicos_state::data ) { - UINT8 data = m_io_data->read(); + uint8_t data = m_io_data->read(); int i; for (i = 0; i < 8; i++) @@ -385,14 +385,14 @@ READ_LINE_MEMBER( cosmicos_state::clear_r ) READ_LINE_MEMBER( cosmicos_state::ef1_r ) { - UINT8 special = m_special->read(); + uint8_t special = m_special->read(); return BIT(special, 0); } READ_LINE_MEMBER( cosmicos_state::ef2_r ) { - UINT8 special = m_special->read(); + uint8_t special = m_special->read(); int casin = (m_cassette)->input() < 0.0; output().set_led_value(LED_CASSETTE, casin); @@ -402,7 +402,7 @@ READ_LINE_MEMBER( cosmicos_state::ef2_r ) READ_LINE_MEMBER( cosmicos_state::ef3_r ) { - UINT8 special = m_special->read(); + uint8_t special = m_special->read(); return BIT(special, 2) | BIT(special, 3); } @@ -483,7 +483,7 @@ void cosmicos_state::machine_reset() QUICKLOAD_LOAD_MEMBER( cosmicos_state, cosmicos ) { - UINT8 *ptr = m_rom->base(); + uint8_t *ptr = m_rom->base(); int size = image.length(); /* load image to RAM */ diff --git a/src/mame/drivers/cp1.cpp b/src/mame/drivers/cp1.cpp index 77034027b8d..c9a9205b492 100644 --- a/src/mame/drivers/cp1.cpp +++ b/src/mame/drivers/cp1.cpp @@ -58,16 +58,16 @@ public: DECLARE_WRITE8_MEMBER(i8155_portc_w); private: - UINT8 m_7seg; - UINT8 m_port2; - UINT8 m_matrix; + uint8_t m_7seg; + uint8_t m_port2; + uint8_t m_matrix; }; READ8_MEMBER(cp1_state::port1_r) { logerror("Read from expansion port 1\n"); - UINT8 data = 0; + uint8_t data = 0; if (m_io_config->read() & 0x01) data |= (m_cassette->input() > 0.03) ? 0x80 : 0x00; @@ -91,7 +91,7 @@ READ8_MEMBER(cp1_state::port2_r) // ---x ---- I8155 CE // ---- xxxx keyboard input - UINT8 data = 0; + uint8_t data = 0; for(int i=0; i<5; i++) if (!(m_matrix & (1<space().get_read_ptr(0); + uint8_t *dest = (uint8_t*)m_i8155->space().get_read_ptr(0); char line[0x10]; int addr = 0; while (image.fgets(line, 10) && addr < 0x100) diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp index 05ecc1c88f0..872a42ffd6d 100644 --- a/src/mame/drivers/cps1.cpp +++ b/src/mame/drivers/cps1.cpp @@ -379,7 +379,7 @@ READ16_MEMBER(cps_state::qsound_rom_r) { if (memregion("user1") != nullptr) { - UINT8 *rom = memregion("user1")->base(); + uint8_t *rom = memregion("user1")->base(); return rom[offset] | 0xff00; } else @@ -12032,8 +12032,8 @@ DRIVER_INIT_MEMBER( cps_state, sf2ceblp ) DRIVER_INIT_MEMBER( cps_state, sf2m8 ) { // unscramble gfx - UINT8 *grom = memregion("gfx")->base(); - UINT8 *urom = memregion("user2")->base(); + uint8_t *grom = memregion("gfx")->base(); + uint8_t *urom = memregion("user2")->base(); int i = 0x480000, j = 0; for (j = 0x20000; j < 0x80000; j+=2) @@ -12051,10 +12051,10 @@ DRIVER_INIT_MEMBER( cps_state, sf2m8 ) DRIVER_INIT_CALL(cps1); } -void cps_state::kabuki_setup(void (*decode)(UINT8 *src, UINT8 *dst)) +void cps_state::kabuki_setup(void (*decode)(uint8_t *src, uint8_t *dst)) { - m_decrypt_kabuki = std::make_unique(0x8000); - UINT8 *rom = memregion("audiocpu")->base(); + m_decrypt_kabuki = std::make_unique(0x8000); + uint8_t *rom = memregion("audiocpu")->base(); decode(rom, m_decrypt_kabuki.get()); membank("decrypted")->set_base(m_decrypt_kabuki.get()); } @@ -12094,7 +12094,7 @@ DRIVER_INIT_MEMBER(cps_state,pang3b) DRIVER_INIT_MEMBER(cps_state,pang3) { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); int A, src, dst; for (A = 0x80000; A < 0x100000; A += 2) @@ -12118,7 +12118,7 @@ DRIVER_INIT_MEMBER(cps_state,pang3) READ16_MEMBER(cps_state::ganbare_ram_r) { - UINT16 result = 0xffff; + uint16_t result = 0xffff; if (ACCESSING_BITS_0_7) result = (result & ~0x00ff) | m_m48t35->read(space, offset, 0xff); diff --git a/src/mame/drivers/cps2.cpp b/src/mame/drivers/cps2.cpp index 25f53779d88..c722378fdbd 100644 --- a/src/mame/drivers/cps2.cpp +++ b/src/mame/drivers/cps2.cpp @@ -807,7 +807,7 @@ TIMER_CALLBACK_MEMBER(cps_state::cps2_update_digital_volume) READ16_MEMBER(cps_state::cps2_qsound_volume_r) { - static const UINT16 cps2_vol_states[40] = + static const uint16_t cps2_vol_states[40] = { 0xf010, 0xf008, 0xf004, 0xf002, 0xf001, 0xe810, 0xe808, 0xe804, 0xe802, 0xe801, 0xe410, 0xe408, 0xe404, 0xe402, 0xe401, 0xe210, 0xe208, 0xe204, 0xe202, 0xe201, @@ -815,7 +815,7 @@ READ16_MEMBER(cps_state::cps2_qsound_volume_r) 0xe050, 0xe048, 0xe044, 0xe042, 0xe041, 0xe030, 0xe028, 0xe024, 0xe022, 0xe021 }; - UINT16 result; + uint16_t result; result = cps2_vol_states[m_cps2digitalvolumelevel]; @@ -860,7 +860,7 @@ READ16_MEMBER(cps_state::joy_or_paddle_ecofghtr_r) { if (m_readpaddle == 0 || (m_io_in1->read() & 0x10) == 0x10) // ignore bit if spinner not enabled { - UINT16 ret = m_io_in0->read(); + uint16_t ret = m_io_in0->read(); if ((m_io_in1->read() & 0x10) == 0x00) { @@ -877,7 +877,7 @@ READ16_MEMBER(cps_state::joy_or_paddle_ecofghtr_r) int dial0 = (ioport("DIAL0")->read()); int dial1 = (ioport("DIAL1")->read()); - UINT16 ret = (dial0 & 0xff) | ((dial1 & 0xff) << 8); + uint16_t ret = (dial0 & 0xff) | ((dial1 & 0xff) << 8); // 1st dial if ((dial0 & 0x800) == (m_ecofghtr_dial_last0 & 0x800)) @@ -9771,8 +9771,8 @@ void cps_state::gigaman2_gfx_reorder() { int i; int length = memregion( "gfx" )->bytes(); - UINT16 *rom = (UINT16 *)memregion("gfx")->base(); - std::vector buf( length ); + uint16_t *rom = (uint16_t *)memregion("gfx")->base(); + std::vector buf( length ); memcpy (&buf[0], rom, length); @@ -9789,7 +9789,7 @@ DRIVER_INIT_MEMBER(cps_state,gigaman2) DRIVER_INIT_CALL(cps2nc); - m_gigaman2_dummyqsound_ram = std::make_unique(0x20000 / 2); + m_gigaman2_dummyqsound_ram = std::make_unique(0x20000 / 2); save_pointer(NAME(m_gigaman2_dummyqsound_ram.get()), 0x20000 / 2); space.install_readwrite_handler(0x618000, 0x619fff, read16_delegate(FUNC(cps_state::gigaman2_dummyqsound_r),this), write16_delegate(FUNC(cps_state::gigaman2_dummyqsound_w), this)); // no qsound.. diff --git a/src/mame/drivers/cps3.cpp b/src/mame/drivers/cps3.cpp index 885d2b06946..d313d5959f0 100644 --- a/src/mame/drivers/cps3.cpp +++ b/src/mame/drivers/cps3.cpp @@ -489,11 +489,11 @@ hardware modification to the security cart..... inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, int transparency,int transparent_color, - int scalex, int scaley,bitmap_ind8 *pri_buffer,UINT32 pri_mask) + int scalex, int scaley,bitmap_ind8 *pri_buffer,uint32_t pri_mask) { rectangle myclip; -// UINT8 al; +// uint8_t al; // al = (pdrawgfx_shadow_lowpri) ? 0 : 0x80; @@ -523,9 +523,9 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle if( gfx ) { // const pen_t *pal = &gfx->colortable[gfx->granularity() * (color % gfx->colors())]; - UINT32 palbase = (gfx->granularity() * color) & 0x1ffff; + uint32_t palbase = (gfx->granularity() * color) & 0x1ffff; const pen_t *pal = &m_mame_colours[palbase]; - 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; @@ -595,8 +595,8 @@ inline void cps3_state::cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle { for( y=sy; y>16) * gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; for( x=sx; x>16) * gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; for( x=sx; x>16) * gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; for( x=sx; x>16) * gfx->rowbytes(); - UINT32 *dest = &dest_bmp.pix32(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint32_t *dest = &dest_bmp.pix32(y); int x, x_index = x_index_base; for( x=sx; x>(16-n); return ((value<base(); + uint32_t *coderegion = (uint32_t*)memregion("bios")->base(); for (i=0;i<0x80000;i+=4) { - UINT32 dword = coderegion[i/4]; - UINT32 xormask = cps3_mask(i, m_key1, m_key2); + uint32_t dword = coderegion[i/4]; + uint32_t xormask = cps3_mask(i, m_key1, m_key2); coderegion[i/4] = dword ^ xormask; } #if 0 @@ -776,12 +776,12 @@ void cps3_state::init_common(void) for (int chipnum = 0; chipnum < 8; chipnum++) m_simm[simmnum][chipnum] = machine().device(string_format("simm%d.%d", simmnum + 1, chipnum).c_str()); - m_eeprom = std::make_unique(0x400/4); + m_eeprom = std::make_unique(0x400/4); machine().device("eeprom")->set_base(m_eeprom.get(), 0x400); } -void cps3_state::init_crypt(UINT32 key1, UINT32 key2, int altEncryption) +void cps3_state::init_crypt(uint32_t key1, uint32_t key2, int altEncryption) { m_key1 = key1; m_key2 = key2; @@ -794,7 +794,7 @@ void cps3_state::init_crypt(UINT32 key1, UINT32 key2, int altEncryption) } else { - m_user4 = auto_alloc_array(machine(), UINT8, USER4REGION_LENGTH); + m_user4 = auto_alloc_array(machine(), uint8_t, USER4REGION_LENGTH); } if (m_user5_region) @@ -803,10 +803,10 @@ void cps3_state::init_crypt(UINT32 key1, UINT32 key2, int altEncryption) } else { - m_user5 = auto_alloc_array(machine(), UINT8, USER5REGION_LENGTH); + m_user5 = auto_alloc_array(machine(), uint8_t, USER5REGION_LENGTH); } - m_cps3sound->set_base((INT8*)m_user5); + m_cps3sound->set_base((int8_t*)m_user5); // set strict verify m_maincpu->sh2drc_set_options(SH2DRC_STRICT_VERIFY); @@ -826,7 +826,7 @@ DRIVER_INIT_MEMBER(cps3_state,sfiii2) { init_crypt(0x00000000, 0x00000000, 1) DRIVER_INIT_MEMBER(cps3_state,jojo) { init_crypt(0x02203ee3, 0x01301972, 0); } DRIVER_INIT_MEMBER(cps3_state,sfiii3) { init_crypt(0xa55432b4, 0x0c129981, 0); } DRIVER_INIT_MEMBER(cps3_state,jojoba) { init_crypt(0x23323ee3, 0x03021972, 0); } -DRIVER_INIT_MEMBER(cps3_state,cps3boot) { init_crypt((UINT32)-1,(UINT32)-1,2); } +DRIVER_INIT_MEMBER(cps3_state,cps3boot) { init_crypt((uint32_t)-1,(uint32_t)-1,2); } @@ -860,10 +860,10 @@ static const gfx_layout cps3_tiles8x8_layout = }; -void cps3_state::cps3_set_mame_colours(int colournum, UINT16 data, UINT32 fadeval) +void cps3_state::cps3_set_mame_colours(int colournum, uint16_t data, uint32_t fadeval) { int r,g,b; - UINT16* dst = (UINT16*)m_colourram.target(); + uint16_t* dst = (uint16_t*)m_colourram.target(); r = (data >> 0) & 0x1f; @@ -901,26 +901,26 @@ void cps3_state::cps3_set_mame_colours(int colournum, UINT16 data, UINT32 fadeva void cps3_state::video_start() { - m_ss_ram = std::make_unique(0x10000/4); + m_ss_ram = std::make_unique(0x10000/4); memset(m_ss_ram.get(), 0x00, 0x10000); save_pointer(NAME(m_ss_ram.get()), 0x10000/4); - m_char_ram = std::make_unique(0x800000/4); + m_char_ram = std::make_unique(0x800000/4); memset(m_char_ram.get(), 0x00, 0x800000); save_pointer(NAME(m_char_ram.get()), 0x800000 /4); /* create the char set (gfx will then be updated dynamically from RAM) */ - m_gfxdecode->set_gfx(0, std::make_unique(*m_palette, cps3_tiles8x8_layout, (UINT8 *)m_ss_ram.get(), 0, m_palette->entries() / 16, 0)); + m_gfxdecode->set_gfx(0, std::make_unique(*m_palette, cps3_tiles8x8_layout, (uint8_t *)m_ss_ram.get(), 0, m_palette->entries() / 16, 0)); //decode_ssram(); /* create the char set (gfx will then be updated dynamically from RAM) */ - m_gfxdecode->set_gfx(1, std::make_unique(*m_palette, cps3_tiles16x16_layout, (UINT8 *)m_char_ram.get(), 0, m_palette->entries() / 64, 0)); + m_gfxdecode->set_gfx(1, std::make_unique(*m_palette, cps3_tiles16x16_layout, (uint8_t *)m_char_ram.get(), 0, m_palette->entries() / 64, 0)); m_gfxdecode->gfx(1)->set_granularity(64); //decode_charram(); - m_mame_colours = std::make_unique(0x80000/4); + m_mame_colours = std::make_unique(0x80000/4); memset(m_mame_colours.get(), 0x00, 0x80000); m_screenwidth = 384; @@ -939,8 +939,8 @@ void cps3_state::video_start() void cps3_state::cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { - UINT32* tmapregs[4] = { m_tilemap20_regs_base, m_tilemap30_regs_base, m_tilemap40_regs_base, m_tilemap50_regs_base }; - UINT32* regs; + uint32_t* tmapregs[4] = { m_tilemap20_regs_base, m_tilemap30_regs_base, m_tilemap40_regs_base, m_tilemap50_regs_base }; + uint32_t* regs; int line; int scrolly; if (tmnum>3) @@ -958,8 +958,8 @@ void cps3_state::cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_rg if (!(regs[1]&0x00008000)) return; { - UINT32 mapbase = (regs[2]&0x007f0000)>>16; - UINT32 linebase= (regs[2]&0x7f000000)>>24; + uint32_t mapbase = (regs[2]&0x007f0000)>>16; + uint32_t linebase= (regs[2]&0x7f000000)>>24; int linescroll_enable = (regs[1]&0x00004000); int scrollx; @@ -994,7 +994,7 @@ void cps3_state::cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_rg for (x=0;x<(cliprect.max_x/16)+2;x++) { - UINT32 dat; + uint32_t dat; int tileno; int colour; int bpp; @@ -1015,7 +1015,7 @@ void cps3_state::cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_rg } } -UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int y,x, count; attoseconds_t period = screen.frame_period().attoseconds(); @@ -1023,8 +1023,8 @@ UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitma int bg_drawn[4] = { 0, 0, 0, 0 }; - UINT32 fullscreenzoomx, fullscreenzoomy; - UINT32 fszx, fszy; + uint32_t fullscreenzoomx, fullscreenzoomy; + uint32_t fszx, fszy; // decode_ssram(); // decode_charram(); @@ -1079,7 +1079,7 @@ UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitma int j; int gscroll = (m_spriteram[i+0]&0x70000000)>>28; int length = (m_spriteram[i+0]&0x01ff0000)>>16; // how many entries in the sprite table - UINT32 start = (m_spriteram[i+0]&0x00007ff0)>>4; + uint32_t start = (m_spriteram[i+0]&0x00007ff0)>>4; int whichbpp = (m_spriteram[i+2]&0x40000000)>>30; // not 100% sure if this is right, jojo title / characters int whichpal = (m_spriteram[i+2]&0x20000000)>>29; @@ -1098,16 +1098,16 @@ UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitma for (j=0;j<(length)*4;j+=4) { - UINT32 value1 = (m_spriteram[start+j+0]); - UINT32 value2 = (m_spriteram[start+j+1]); - UINT32 value3 = (m_spriteram[start+j+2]); + uint32_t value1 = (m_spriteram[start+j+0]); + uint32_t value2 = (m_spriteram[start+j+1]); + uint32_t value3 = (m_spriteram[start+j+2]); - //UINT8* srcdata = (UINT8*)m_char_ram; - //UINT32 sourceoffset = (value1 >>14)&0x7fffff; + //uint8_t* srcdata = (uint8_t*)m_char_ram; + //uint32_t sourceoffset = (value1 >>14)&0x7fffff; int count; - UINT32 tileno = (value1&0xfffe0000)>>17; + uint32_t tileno = (value1&0xfffe0000)>>17; int xpos2 = (value2 & 0x03ff0000)>>16; int ypos2 = (value2 & 0x000003ff)>>0; @@ -1126,7 +1126,7 @@ UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitma static const int tilestable[4] = { 8,1,2,4 }; int ysize2 = ((value3 & 0x0000000c)>>2); int xsize2 = ((value3 & 0x00000003)>>0); - UINT32 xinc,yinc; + uint32_t xinc,yinc; if (ysize2==0) { @@ -1141,8 +1141,8 @@ UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitma //int endline; //int height = (value3 & 0x7f000000)>>24; int uu; -// UINT32* tmapregs[4] = { m_tilemap20_regs_base, m_tilemap30_regs_base, m_tilemap40_regs_base, m_tilemap50_regs_base }; -// UINT32* regs; +// uint32_t* tmapregs[4] = { m_tilemap20_regs_base, m_tilemap30_regs_base, m_tilemap40_regs_base, m_tilemap50_regs_base }; +// uint32_t* regs; // regs = tmapregs[tilemapnum]; //endline = value2; //startline = endline - height; @@ -1271,10 +1271,10 @@ UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitma /* copy render bitmap with zoom */ { - UINT32 renderx,rendery; - UINT32 srcx, srcy; - UINT32* srcbitmap; - UINT32* dstbitmap; + uint32_t renderx,rendery; + uint32_t srcx, srcy; + uint32_t* srcbitmap; + uint32_t* dstbitmap; srcy=0; @@ -1312,8 +1312,8 @@ UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitma { for (x=0;x<64;x++) { - UINT32 data = m_ss_ram[count]; // +0x800 = 2nd bank, used on sfiii2 intro.. - UINT32 tile = (data >> 16) & 0x1ff; + uint32_t data = m_ss_ram[count]; // +0x800 = 2nd bank, used on sfiii2 intro.. + uint32_t tile = (data >> 16) & 0x1ff; int pal = (data&0x003f) >> 1; int flipx = (data & 0x0080) >> 7; int flipy = (data & 0x0040) >> 6; @@ -1387,14 +1387,14 @@ WRITE32_MEMBER(cps3_state::cram_bank_w) READ32_MEMBER(cps3_state::cram_data_r) { - UINT32 fulloffset = (((m_cram_bank&0x7)*0x100000)/4) + offset; + uint32_t fulloffset = (((m_cram_bank&0x7)*0x100000)/4) + offset; return little_endianize_int32(m_char_ram[fulloffset]); } WRITE32_MEMBER(cps3_state::cram_data_w) { - UINT32 fulloffset = (((m_cram_bank&0x7)*0x100000)/4) + offset; + uint32_t fulloffset = (((m_cram_bank&0x7)*0x100000)/4) + offset; mem_mask = little_endianize_int32(mem_mask); data = little_endianize_int32(data); COMBINE_DATA(&m_char_ram[fulloffset]); @@ -1405,7 +1405,7 @@ WRITE32_MEMBER(cps3_state::cram_data_w) READ32_MEMBER(cps3_state::cps3_gfxflash_r) { - UINT32 result = 0; + uint32_t result = 0; if (m_cram_gfxflash_bank&1) offset += 0x200000/4; fujitsu_29f016a_device *chip0 = m_simm[2 + m_cram_gfxflash_bank/8][(m_cram_gfxflash_bank % 8) & ~1]; @@ -1481,9 +1481,9 @@ WRITE32_MEMBER(cps3_state::cps3_gfxflash_w) /* make a copy in the linear memory region we actually use for drawing etc. having it stored in interleaved flash roms isnt' very useful */ { - UINT32* romdata = (UINT32*)m_user5; + uint32_t* romdata = (uint32_t*)m_user5; int real_offset = 0; - UINT32 newdata; + uint32_t newdata; real_offset = ((m_cram_gfxflash_bank&0x3e) * 0x200000) + offset*4; @@ -1499,9 +1499,9 @@ WRITE32_MEMBER(cps3_state::cps3_gfxflash_w) -UINT32 cps3_state::cps3_flashmain_r(address_space &space, int which, UINT32 offset, UINT32 mem_mask) +uint32_t cps3_state::cps3_flashmain_r(address_space &space, int which, uint32_t offset, uint32_t mem_mask) { - UINT32 result = 0; + uint32_t result = 0; if (m_simm[which][0] == nullptr || m_simm[which][1] == nullptr || m_simm[which][2] == nullptr || m_simm[which][3] == nullptr) return 0xffffffff; @@ -1536,7 +1536,7 @@ UINT32 cps3_state::cps3_flashmain_r(address_space &space, int which, UINT32 offs READ32_MEMBER(cps3_state::cps3_flash1_r) { - UINT32 retvalue = cps3_flashmain_r(space, 0, offset,mem_mask); + uint32_t retvalue = cps3_flashmain_r(space, 0, offset,mem_mask); if (m_altEncryption) return retvalue; @@ -1546,7 +1546,7 @@ READ32_MEMBER(cps3_state::cps3_flash1_r) READ32_MEMBER(cps3_state::cps3_flash2_r) { - UINT32 retvalue = cps3_flashmain_r(space, 1, offset,mem_mask); + uint32_t retvalue = cps3_flashmain_r(space, 1, offset,mem_mask); if (m_altEncryption) return retvalue; @@ -1554,7 +1554,7 @@ READ32_MEMBER(cps3_state::cps3_flash2_r) return retvalue; } -void cps3_state::cps3_flashmain_w(int which, UINT32 offset, UINT32 data, UINT32 mem_mask) +void cps3_state::cps3_flashmain_w(int which, uint32_t offset, uint32_t data, uint32_t mem_mask) { int command; @@ -1588,10 +1588,10 @@ void cps3_state::cps3_flashmain_w(int which, UINT32 offset, UINT32 data, UINT32 /* copy data into regions to execute from */ { - UINT32* romdata = (UINT32*)m_user4; - UINT32* romdata2 = (UINT32*)m_decrypted_gamerom; + uint32_t* romdata = (uint32_t*)m_user4; + uint32_t* romdata2 = (uint32_t*)m_decrypted_gamerom; int real_offset = 0; - UINT32 newdata; + uint32_t newdata; real_offset = offset * 4; @@ -1812,12 +1812,12 @@ WRITE32_MEMBER(cps3_state::cps3_palettedma_w) if (data & 0x0002) { int i; - UINT16* src = (UINT16*)m_user5; + uint16_t* src = (uint16_t*)m_user5; // if(DEBUG_PRINTF) printf("CPS3 pal dma start %08x (real: %08x) dest %08x fade %08x other2 %08x (length %04x)\n", m_paldma_source, m_paldma_realsource, m_paldma_dest, m_paldma_fade, m_paldma_other2, m_paldma_length); for (i=0;i>1)+i))]; + uint16_t coldata = src[BYTE_XOR_BE(((m_paldma_realsource>>1)+i))]; //if (m_paldma_fade!=0) printf("%08x\n",m_paldma_fade); @@ -1835,14 +1835,14 @@ WRITE32_MEMBER(cps3_state::cps3_palettedma_w) } -//static UINT8* current_table; +//static uint8_t* current_table; -UINT32 cps3_state::process_byte( UINT8 real_byte, UINT32 destination, int max_length ) +uint32_t cps3_state::process_byte( uint8_t real_byte, uint32_t destination, int max_length ) { - UINT8* dest = (UINT8*)m_char_ram.get(); + uint8_t* dest = (uint8_t*)m_char_ram.get(); //printf("process byte for destination %08x\n", destination); @@ -1884,9 +1884,9 @@ UINT32 cps3_state::process_byte( UINT8 real_byte, UINT32 destination, int max_le } } -void cps3_state::cps3_do_char_dma( UINT32 real_source, UINT32 real_destination, UINT32 real_length ) +void cps3_state::cps3_do_char_dma( uint32_t real_source, uint32_t real_destination, uint32_t real_length ) { - UINT8* sourcedata = (UINT8*)m_user5; + uint8_t* sourcedata = (uint8_t*)m_user5; int length_remaining; m_last_normal_byte = 0; @@ -1894,15 +1894,15 @@ void cps3_state::cps3_do_char_dma( UINT32 real_source, UINT32 real_destination, length_remaining = real_length; while (length_remaining) { - UINT8 current_byte; + uint8_t current_byte; current_byte = sourcedata[DMA_XOR(real_source)]; real_source++; if (current_byte & 0x80) { - UINT8 real_byte; - UINT32 length_processed; + uint8_t real_byte; + uint32_t length_processed; current_byte &= 0x7f; real_byte = sourcedata[DMA_XOR((m_current_table_address+current_byte*2+0))]; @@ -1923,7 +1923,7 @@ void cps3_state::cps3_do_char_dma( UINT32 real_source, UINT32 real_destination, } else { - UINT32 length_processed; + uint32_t length_processed; length_processed = process_byte(current_byte, real_destination, length_remaining ); length_remaining-=length_processed; // subtract the number of bytes the operation has taken real_destination+=length_processed; // add it onto the destination @@ -1935,9 +1935,9 @@ void cps3_state::cps3_do_char_dma( UINT32 real_source, UINT32 real_destination, } } -UINT32 cps3_state::ProcessByte8(UINT8 b,UINT32 dst_offset) +uint32_t cps3_state::ProcessByte8(uint8_t b,uint32_t dst_offset) { - UINT8* destRAM = (UINT8*)m_char_ram.get(); + uint8_t* destRAM = (uint8_t*)m_char_ram.get(); int l=0; if(m_lastb==m_lastb2) //rle @@ -1967,11 +1967,11 @@ UINT32 cps3_state::ProcessByte8(UINT8 b,UINT32 dst_offset) } } -void cps3_state::cps3_do_alt_char_dma( UINT32 src, UINT32 real_dest, UINT32 real_length ) +void cps3_state::cps3_do_alt_char_dma( uint32_t src, uint32_t real_dest, uint32_t real_length ) { - UINT8* px = (UINT8*)m_user5; - UINT32 start = real_dest; - UINT32 ds = real_dest; + uint8_t* px = (uint8_t*)m_user5; + uint32_t start = real_dest; + uint32_t ds = real_dest; m_lastb=0xfffe; m_lastb2=0xffff; @@ -1979,16 +1979,16 @@ void cps3_state::cps3_do_alt_char_dma( UINT32 src, UINT32 real_dest, UINT32 real while(1) { int i; - UINT8 ctrl=px[DMA_XOR(src)]; + uint8_t ctrl=px[DMA_XOR(src)]; ++src; for(i=0;i<8;++i) { - UINT8 p=px[DMA_XOR(src)]; + uint8_t p=px[DMA_XOR(src)]; if(ctrl&0x80) { - UINT8 real_byte; + uint8_t real_byte; p&=0x7f; real_byte = px[DMA_XOR((m_current_table_address+p*2+0))]; ds+=ProcessByte8(real_byte,ds); @@ -2008,7 +2008,7 @@ void cps3_state::cps3_do_alt_char_dma( UINT32 src, UINT32 real_dest, UINT32 real } } -void cps3_state::cps3_process_character_dma(UINT32 address) +void cps3_state::cps3_process_character_dma(uint32_t address) { int i; @@ -2016,12 +2016,12 @@ void cps3_state::cps3_process_character_dma(UINT32 address) for (i = 0; i < 0x1000; i += 3) { - UINT32 dat1 = little_endianize_int32(m_char_ram[i + 0 + (address)]); - UINT32 dat2 = little_endianize_int32(m_char_ram[i + 1 + (address)]); - UINT32 dat3 = little_endianize_int32(m_char_ram[i + 2 + (address)]); - UINT32 real_source = (dat3 << 1) - 0x400000; - UINT32 real_destination = dat2 << 3; - UINT32 real_length = (((dat1 & 0x001fffff) + 1) << 3); + uint32_t dat1 = little_endianize_int32(m_char_ram[i + 0 + (address)]); + uint32_t dat2 = little_endianize_int32(m_char_ram[i + 1 + (address)]); + uint32_t dat3 = little_endianize_int32(m_char_ram[i + 2 + (address)]); + uint32_t real_source = (dat3 << 1) - 0x400000; + uint32_t real_destination = dat2 << 3; + uint32_t real_length = (((dat1 & 0x001fffff) + 1) << 3); /* 0x01000000 is the end of list marker, 0x13131313 is our default fill */ if ((dat1 == 0x01000000) || (dat1 == 0x13131313)) break; @@ -2085,7 +2085,7 @@ WRITE32_MEMBER(cps3_state::cps3_characterdma_w) { if ((data>>16) & 0x0040) { - UINT32 list_address; + uint32_t list_address; list_address = (m_chardma_source | ((m_chardma_other&0x003f0000))); //printf("chardma_w activated %08x %08x (address = cram %08x)\n", m_chardma_source, m_chardma_other, list_address*4 ); @@ -2123,7 +2123,7 @@ WRITE32_MEMBER(cps3_state::cps3_unk_vidregs_w) READ32_MEMBER(cps3_state::cps3_colourram_r) { - UINT16* src = (UINT16*)m_colourram.target(); + uint16_t* src = (uint16_t*)m_colourram.target(); return src[offset*2+1] | (src[offset*2+0]<<16); } @@ -2313,13 +2313,13 @@ void cps3_state::machine_reset() // make a copy in the regions we execute code / draw gfx from void cps3_state::copy_from_nvram() { - UINT32* romdata = (UINT32*)m_user4; - UINT32* romdata2 = (UINT32*)m_decrypted_gamerom; + uint32_t* romdata = (uint32_t*)m_user4; + uint32_t* romdata2 = (uint32_t*)m_decrypted_gamerom; int i; /* copy + decrypt program roms which have been loaded from flashroms/nvram */ for (i=0;i<0x800000;i+=4) { - UINT32 data; + uint32_t data; data = ((m_simm[0][0]->read_raw(i/4)<<24) | (m_simm[0][1]->read_raw(i/4)<<16) | (m_simm[0][2]->read_raw(i/4)<<8) | (m_simm[0][3]->read_raw(i/4)<<0)); @@ -2335,7 +2335,7 @@ void cps3_state::copy_from_nvram() if (m_simm[1][0] != nullptr) for (i=0;i<0x800000;i+=4) { - UINT32 data; + uint32_t data; data = ((m_simm[1][0]->read_raw(i/4)<<24) | (m_simm[1][1]->read_raw(i/4)<<16) | (m_simm[1][2]->read_raw(i/4)<<8) | (m_simm[1][3]->read_raw(i/4)<<0)); @@ -2346,11 +2346,11 @@ void cps3_state::copy_from_nvram() /* copy gfx from loaded flashroms to user reigon 5, where it's used */ { - UINT32 thebase, len = USER5REGION_LENGTH; + uint32_t thebase, len = USER5REGION_LENGTH; int flashnum = 0; int countoffset = 0; - romdata = (UINT32*)m_user5; + romdata = (uint32_t*)m_user5; for (thebase = 0;thebase < len/2; thebase+=0x200000) { // printf("flashnums %d. %d\n",flashnum, flashnum+1); @@ -2363,7 +2363,7 @@ void cps3_state::copy_from_nvram() { for (i=0;i<0x200000;i+=2) { - UINT32 dat = (flash0->read_raw(i+0)<<8) | + uint32_t dat = (flash0->read_raw(i+0)<<8) | (flash0->read_raw(i+1)<<24) | (flash1->read_raw(i+0)<<0) | (flash1->read_raw(i+1)<<16); @@ -3737,7 +3737,7 @@ ROM_END OCEANIA 7 ASIA NCD 8 - UINT32 *rom = (UINT32*)machine.root_device().memregion ( "bios" )->base(); + uint32_t *rom = (uint32_t*)machine.root_device().memregion ( "bios" )->base(); rom[0x1fed8/4]^=0x00000001; // clear region to 0 (invalid) rom[0x1fed8/4]^=0x00000008; // region 8 - ASIA NO CD - doesn't actually skip the CD // test on startup, only during game, must be another flag @@ -3762,7 +3762,7 @@ ROM_END // bios rom also lists korea, but game rom does not. - UINT32 *rom = (UINT32*)machine.root_device().memregion ( "bios" )->base(); + uint32_t *rom = (uint32_t*)machine.root_device().memregion ( "bios" )->base(); rom[0x1fec8/4]^=0x00000001; // region (clear region) rom[0x1fec8/4]^=0x00000008; // region rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test @@ -3784,7 +3784,7 @@ ROM_END OCEANIA 7 ASIA 8 - UINT32 *rom = (UINT32*)machine.root_device().memregion ( "bios" )->base(); + uint32_t *rom = (uint32_t*)machine.root_device().memregion ( "bios" )->base(); rom[0x1fec8/4]^=0x00000001; // region (clear region) rom[0x1fec8/4]^=0x00000008; // region rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test @@ -3808,7 +3808,7 @@ ROM_END DEVELOPMENT VERSION add 0x70 mask! - UINT32 *rom = (UINT32*)machine.root_device().memregion ( "bios" )->base(); + uint32_t *rom = (uint32_t*)machine.root_device().memregion ( "bios" )->base(); rom[0x1fec8/4]^=0x00000001; // region hack (clear jpn) rom[0x1fec8/4]^=0x00000004; // region @@ -3829,7 +3829,7 @@ ROM_END BRAZIL 6 OCEANIA 7 - UINT32 *rom = (UINT32*)machine.root_device().memregion ( "bios" )->base(); + uint32_t *rom = (uint32_t*)machine.root_device().memregion ( "bios" )->base(); rom[0x1fec8/4]^=0x00000004; // region (clear region) rom[0x1fec8/4]^=0x00000001; // region rom[0x1fecc/4]^=0x01000000; // nocd @@ -3851,7 +3851,7 @@ ROM_END DEVELOPMENT VERSION add 0x70 mask! - UINT32 *rom = (UINT32*)machine.root_device().memregion ( "bios" )->base(); + uint32_t *rom = (uint32_t*)machine.root_device().memregion ( "bios" )->base(); rom[0x1fec8/4]^=0x00000001; // region (clear jpn) rom[0x1fec8/4]^=0x00000002; // region rom[0x1fec8/4]^=0x00000070; // DEV mode diff --git a/src/mame/drivers/craft.cpp b/src/mame/drivers/craft.cpp index cc2ad5f5d49..1c85d5a90ea 100644 --- a/src/mame/drivers/craft.cpp +++ b/src/mame/drivers/craft.cpp @@ -46,15 +46,15 @@ public: virtual void machine_start() override; - UINT32 m_last_cycles; - UINT64 m_frame_start_cycle; + uint32_t m_last_cycles; + uint64_t m_frame_start_cycle; - UINT8 m_port_b; - UINT8 m_port_c; - UINT8 m_port_d; + uint8_t m_port_b; + uint8_t m_port_c; + uint8_t m_port_d; - UINT8 m_latched_color; - UINT8 m_pixels[PIXELS_PER_FRAME]; + uint8_t m_latched_color; + uint8_t m_pixels[PIXELS_PER_FRAME]; required_device m_maincpu; @@ -62,7 +62,7 @@ public: DECLARE_WRITE8_MEMBER(port_w); DECLARE_DRIVER_INIT(craft); virtual void machine_reset() override; - UINT32 screen_update_craft(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_craft(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4); required_device m_dac; }; @@ -111,9 +111,9 @@ WRITE8_MEMBER(craft_state::port_w) case AVR8_IO_PORTB: // Port B { - UINT8 old_port_b = m_port_b; - UINT8 pins = data; - UINT8 changed = pins ^ old_port_b; + uint8_t old_port_b = m_port_b; + uint8_t pins = data; + uint8_t changed = pins ^ old_port_b; if(pins & changed & 0x02) { m_frame_start_cycle = m_maincpu->get_elapsed_cycles(); @@ -137,7 +137,7 @@ WRITE8_MEMBER(craft_state::port_w) case AVR8_IO_PORTD: // Port D { m_port_d = data; - UINT8 audio_sample = (data & 0x02) | ((data & 0xf4) >> 2); + uint8_t audio_sample = (data & 0x02) | ((data & 0xf4) >> 2); m_dac->write(audio_sample); break; } @@ -146,20 +146,20 @@ WRITE8_MEMBER(craft_state::port_w) void craft_state::video_update() { - UINT64 cycles = m_maincpu->get_elapsed_cycles(); - UINT32 frame_cycles = (UINT32)(cycles - m_frame_start_cycle); + uint64_t cycles = m_maincpu->get_elapsed_cycles(); + uint32_t frame_cycles = (uint32_t)(cycles - m_frame_start_cycle); if (m_last_cycles < frame_cycles) { - for (UINT32 pixidx = m_last_cycles; pixidx < frame_cycles && pixidx < PIXELS_PER_FRAME; pixidx++) + for (uint32_t pixidx = m_last_cycles; pixidx < frame_cycles && pixidx < PIXELS_PER_FRAME; pixidx++) { m_pixels[pixidx] = m_latched_color; } } else { - UINT32 end_clear = sizeof(m_pixels) - m_last_cycles; - UINT32 start_clear = frame_cycles; + uint32_t end_clear = sizeof(m_pixels) - m_last_cycles; + uint32_t start_clear = frame_cycles; end_clear = (end_clear > PIXELS_PER_FRAME) ? (PIXELS_PER_FRAME - m_last_cycles) : end_clear; start_clear = (start_clear > PIXELS_PER_FRAME) ? PIXELS_PER_FRAME : start_clear; if (m_last_cycles < PIXELS_PER_FRAME) @@ -204,17 +204,17 @@ INPUT_PORTS_END * Video hardware * \****************************************************/ -UINT32 craft_state::screen_update_craft(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t craft_state::screen_update_craft(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for(int y = 0; y < LINES_PER_FRAME; y++) { - UINT32 *line = &bitmap.pix32(y); + uint32_t *line = &bitmap.pix32(y); for(int x = 0; x < LINE_CYCLES; x++) { - UINT8 pixel = m_pixels[y * LINE_CYCLES + x]; - UINT8 r = 0x55 * ((pixel & 0x30) >> 4); - UINT8 g = 0x55 * ((pixel & 0x0c) >> 2); - UINT8 b = 0x55 * (pixel & 0x03); + uint8_t pixel = m_pixels[y * LINE_CYCLES + x]; + uint8_t r = 0x55 * ((pixel & 0x30) >> 4); + uint8_t g = 0x55 * ((pixel & 0x0c) >> 2); + uint8_t b = 0x55 * (pixel & 0x03); line[x] = 0xff000000 | (r << 16) | (g << 8) | b; } } diff --git a/src/mame/drivers/crbaloon.cpp b/src/mame/drivers/crbaloon.cpp index f304755f7a0..abe74cae4a1 100644 --- a/src/mame/drivers/crbaloon.cpp +++ b/src/mame/drivers/crbaloon.cpp @@ -68,7 +68,7 @@ WRITE8_MEMBER(crbaloon_state::pc3092_w) CUSTOM_INPUT_MEMBER(crbaloon_state::pc3092_r) { - UINT32 ret; + uint32_t ret; /* enable coin & start input? Wild guess!!! */ if (m_pc3092_data[1] & 0x02) @@ -114,10 +114,10 @@ void crbaloon_state::pc3259_update(void) READ8_MEMBER(crbaloon_state::pc3259_r) { - UINT8 ret = 0; - UINT8 reg = offset >> 2; + uint8_t ret = 0; + uint8_t reg = offset >> 2; - UINT16 collision_address = crbaloon_get_collision_address(); + uint16_t collision_address = crbaloon_get_collision_address(); int collided = (collision_address != 0xffff); switch (reg) diff --git a/src/mame/drivers/crgolf.cpp b/src/mame/drivers/crgolf.cpp index 52545910579..47492e66061 100644 --- a/src/mame/drivers/crgolf.cpp +++ b/src/mame/drivers/crgolf.cpp @@ -112,7 +112,7 @@ void crgolf_state::machine_start() { if (membank("bank1")) { - UINT32 size = memregion("maindata")->bytes(); + uint32_t size = memregion("maindata")->bytes(); /* configure the banking */ membank("bank1")->configure_entries(0, size/0x2000, memregion("maindata")->base(), 0x2000); @@ -242,7 +242,7 @@ WRITE_LINE_MEMBER(crgolf_state::vck_callback) /* only play back if we have data remaining */ if (m_sample_count != 0xff) { - UINT8 data = memregion("adpcm")->base()[m_sample_offset >> 1]; + uint8_t data = memregion("adpcm")->base()[m_sample_offset >> 1]; /* write the next nibble and advance */ m_msm->data_w((data >> (4 * (~m_sample_offset & 1))) & 0x0f); diff --git a/src/mame/drivers/crimfght.cpp b/src/mame/drivers/crimfght.cpp index 4b5397d6393..6458cce8a71 100644 --- a/src/mame/drivers/crimfght.cpp +++ b/src/mame/drivers/crimfght.cpp @@ -285,7 +285,7 @@ WRITE8_MEMBER( crimfght_state::banking_callback ) CUSTOM_INPUT_MEMBER( crimfght_state::system_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= 1 << 4; // VCC data |= m_woco << 5; diff --git a/src/mame/drivers/crospang.cpp b/src/mame/drivers/crospang.cpp index e75a6ff015b..eb9a7f9d1bd 100644 --- a/src/mame/drivers/crospang.cpp +++ b/src/mame/drivers/crospang.cpp @@ -604,7 +604,7 @@ ROM_END void crospang_state::tumblepb_gfx1_rearrange() { - UINT8 *rom = memregion("gfx1")->base(); + uint8_t *rom = memregion("gfx1")->base(); int len = memregion("gfx1")->bytes(); int i; diff --git a/src/mame/drivers/crshrace.cpp b/src/mame/drivers/crshrace.cpp index 7462d65a774..f56cc5643f2 100644 --- a/src/mame/drivers/crshrace.cpp +++ b/src/mame/drivers/crshrace.cpp @@ -541,10 +541,10 @@ ROM_END #ifdef UNUSED_FUNCTION -void crshrace_state::crshrace_patch_code( UINT16 offset ) +void crshrace_state::crshrace_patch_code( uint16_t offset ) { /* A hack which shows 3 player mode in code which is disabled */ - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); RAM[(offset + 0)/2] = 0x4e71; RAM[(offset + 2)/2] = 0x4e71; RAM[(offset + 4)/2] = 0x4e71; diff --git a/src/mame/drivers/crvision.cpp b/src/mame/drivers/crvision.cpp index a9246a76f70..d6b634c5ab8 100644 --- a/src/mame/drivers/crvision.cpp +++ b/src/mame/drivers/crvision.cpp @@ -496,9 +496,9 @@ WRITE8_MEMBER( crvision_state::pia_pa_w ) m_cassette->output( BIT(data, 7) ? +1.0 : -1.0); } -UINT8 crvision_state::read_keyboard(int pa) +uint8_t crvision_state::read_keyboard(int pa) { - UINT8 value = 0; + uint8_t value = 0; for (int i = 0; i < 8; i++) { @@ -535,7 +535,7 @@ READ8_MEMBER( crvision_state::pia_pa_r ) PA7 Cassette data in/out */ - UINT8 data = 0x7f; + uint8_t data = 0x7f; if ((m_cassette)->input() > -0.1469) data |= 0x80; @@ -557,7 +557,7 @@ READ8_MEMBER( crvision_state::pia_pb_r ) PB7 Keyboard input */ - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 4; i++) if (m_keylatch >> i & 1) @@ -581,7 +581,7 @@ READ8_MEMBER( laser2001_state::pia_pa_r ) PA7 Keyboard column 7 */ - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 8; i++) if (~m_keylatch >> i & 1) @@ -608,7 +608,7 @@ WRITE8_MEMBER( laser2001_state::pia_pa_w ) READ8_MEMBER( laser2001_state::pia_pb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 4; i++) if (~m_joylatch >> i & 1) diff --git a/src/mame/drivers/crystal.cpp b/src/mame/drivers/crystal.cpp index 7664c0422ea..b4367e206f7 100644 --- a/src/mame/drivers/crystal.cpp +++ b/src/mame/drivers/crystal.cpp @@ -210,13 +210,13 @@ public: { } /* memory pointers */ - required_shared_ptr m_sysregs; - required_shared_ptr m_workram; - required_shared_ptr m_vidregs; - required_shared_ptr m_textureram; - required_shared_ptr m_frameram; - optional_shared_ptr m_reset_patch; // not needed for trivrus -// UINT32 * m_nvram; // currently this uses generic nvram handling + required_shared_ptr m_sysregs; + required_shared_ptr m_workram; + required_shared_ptr m_vidregs; + required_shared_ptr m_textureram; + required_shared_ptr m_frameram; + optional_shared_ptr m_reset_patch; // not needed for trivrus +// uint32_t * m_nvram; // currently this uses generic nvram handling /* devices */ required_device m_maincpu; @@ -225,18 +225,18 @@ public: required_device m_screen; #ifdef IDLE_LOOP_SPEEDUP - UINT8 m_FlipCntRead; + uint8_t m_FlipCntRead; #endif - UINT32 m_Bank; - UINT8 m_FlipCount; - UINT8 m_IntHigh; - UINT32 m_Timerctrl[4]; + uint32_t m_Bank; + uint8_t m_FlipCount; + uint8_t m_IntHigh; + uint32_t m_Timerctrl[4]; emu_timer *m_Timer[4]; - UINT32 m_FlashCmd; - UINT32 m_PIO; - UINT32 m_DMActrl[2]; - UINT8 m_OldPort4; + uint32_t m_FlashCmd; + uint32_t m_PIO; + uint32_t m_DMActrl[2]; + uint8_t m_OldPort4; DECLARE_READ32_MEMBER(FlipCount_r); DECLARE_WRITE32_MEMBER(FlipCount_w); @@ -268,31 +268,31 @@ public: DECLARE_READ32_MEMBER(trivrus_input_r); DECLARE_WRITE32_MEMBER(trivrus_input_w); - UINT8 m_trivrus_input; + uint8_t m_trivrus_input; DECLARE_READ32_MEMBER(crzyddz2_4_r); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_crystal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_crystal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_crystal(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(crystal_interrupt); TIMER_CALLBACK_MEMBER(Timercb); IRQ_CALLBACK_MEMBER(icallback); void crystal_banksw_postload(); void IntReq( int num ); - inline void Timer_w( address_space &space, int which, UINT32 data, UINT32 mem_mask ); - inline void DMA_w( address_space &space, int which, UINT32 data, UINT32 mem_mask ); + inline void Timer_w( address_space &space, int which, uint32_t data, uint32_t mem_mask ); + inline void DMA_w( address_space &space, int which, uint32_t data, uint32_t mem_mask ); void PatchReset( ); - UINT16 GetVidReg( address_space &space, UINT16 reg ); - void SetVidReg( address_space &space, UINT16 reg, UINT16 val ); + uint16_t GetVidReg( address_space &space, uint16_t reg ); + void SetVidReg( address_space &space, uint16_t reg, uint16_t val ); }; void crystal_state::IntReq( int num ) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT32 IntEn = space.read_dword(0x01800c08); - UINT32 IntPend = space.read_dword(0x01800c0c); + uint32_t IntEn = space.read_dword(0x01800c08); + uint32_t IntPend = space.read_dword(0x01800c0c); if (IntEn & (1 << num)) { IntPend |= (1 << num); @@ -308,12 +308,12 @@ void crystal_state::IntReq( int num ) READ32_MEMBER(crystal_state::FlipCount_r) { #ifdef IDLE_LOOP_SPEEDUP - UINT32 IntPend = space.read_dword(0x01800c0c); + uint32_t IntPend = space.read_dword(0x01800c0c); m_FlipCntRead++; if (m_FlipCntRead >= 16 && !IntPend && m_FlipCount != 0) m_maincpu->suspend(SUSPEND_REASON_SPIN, 1); #endif - return ((UINT32) m_FlipCount) << 16; + return ((uint32_t) m_FlipCount) << 16; } WRITE32_MEMBER(crystal_state::FlipCount_w) @@ -336,7 +336,7 @@ READ32_MEMBER(crystal_state::Input_r) return ioport("P3_P4")->read(); else if( offset == 2) { - UINT8 Port4 = ioport("SYSTEM")->read(); + uint8_t Port4 = ioport("SYSTEM")->read(); if (!(Port4 & 0x10) && ((m_OldPort4 ^ Port4) & 0x10)) //coin buttons trigger IRQs IntReq(12); if (!(Port4 & 0x20) && ((m_OldPort4 ^ Port4) & 0x20)) @@ -349,7 +349,7 @@ READ32_MEMBER(crystal_state::Input_r) WRITE32_MEMBER(crystal_state::IntAck_w) { - UINT32 IntPend = space.read_dword(0x01800c0c); + uint32_t IntPend = space.read_dword(0x01800c0c); if (ACCESSING_BITS_0_7) { @@ -365,7 +365,7 @@ WRITE32_MEMBER(crystal_state::IntAck_w) IRQ_CALLBACK_MEMBER(crystal_state::icallback) { address_space &space = device.memory().space(AS_PROGRAM); - UINT32 IntPend = space.read_dword(0x01800c0c); + uint32_t IntPend = space.read_dword(0x01800c0c); int i; for (i = 0; i < 32; ++i) @@ -398,7 +398,7 @@ TIMER_CALLBACK_MEMBER(crystal_state::Timercb) IntReq(num[which]); } -void crystal_state::Timer_w( address_space &space, int which, UINT32 data, UINT32 mem_mask ) +void crystal_state::Timer_w( address_space &space, int which, uint32_t data, uint32_t mem_mask ) { if (((data ^ m_Timerctrl[which]) & 1) && (data & 1)) //Timer activate { @@ -460,7 +460,7 @@ READ32_MEMBER(crystal_state::FlashCmd_r) { if (m_Bank <= 2) { - UINT32 *ptr = (UINT32*)(memregion("user1")->base() + m_Bank * 0x1000000); + uint32_t *ptr = (uint32_t*)(memregion("user1")->base() + m_Bank * 0x1000000); return ptr[0]; } else @@ -488,9 +488,9 @@ READ32_MEMBER(crystal_state::PIO_r) WRITE32_MEMBER(crystal_state::PIO_w) { - UINT32 RST = data & 0x01000000; - UINT32 CLK = data & 0x02000000; - UINT32 DAT = data & 0x10000000; + uint32_t RST = data & 0x01000000; + uint32_t CLK = data & 0x02000000; + uint32_t DAT = data & 0x10000000; m_ds1302->ce_w(RST ? 1 : 0); m_ds1302->io_w(DAT ? 1 : 0); @@ -504,21 +504,21 @@ WRITE32_MEMBER(crystal_state::PIO_w) COMBINE_DATA(&m_PIO); } -void crystal_state::DMA_w( address_space &space, int which, UINT32 data, UINT32 mem_mask ) +void crystal_state::DMA_w( address_space &space, int which, uint32_t data, uint32_t mem_mask ) { if (((data ^ m_DMActrl[which]) & (1 << 10)) && (data & (1 << 10))) //DMAOn { - UINT32 CTR = data; - UINT32 SRC = space.read_dword(0x01800804 + which * 0x10); - UINT32 DST = space.read_dword(0x01800808 + which * 0x10); - UINT32 CNT = space.read_dword(0x0180080C + which * 0x10); + uint32_t CTR = data; + uint32_t SRC = space.read_dword(0x01800804 + which * 0x10); + uint32_t DST = space.read_dword(0x01800808 + which * 0x10); + uint32_t CNT = space.read_dword(0x0180080C + which * 0x10); int i; if (CTR & 0x2) //32 bits { for (i = 0; i < CNT; ++i) { - UINT32 v = space.read_dword(SRC + i * 4); + uint32_t v = space.read_dword(SRC + i * 4); space.write_dword(DST + i * 4, v); } } @@ -526,7 +526,7 @@ void crystal_state::DMA_w( address_space &space, int which, UINT32 data, UINT32 { for (i = 0; i < CNT; ++i) { - UINT16 v = space.read_word(SRC + i * 2); + uint16_t v = space.read_word(SRC + i * 2); space.write_word(DST + i * 2, v); } } @@ -534,7 +534,7 @@ void crystal_state::DMA_w( address_space &space, int which, UINT32 data, UINT32 { for (i = 0; i < CNT; ++i) { - UINT8 v = space.read_byte(SRC + i); + uint8_t v = space.read_byte(SRC + i); space.write_byte(DST + i, v); } } @@ -736,7 +736,7 @@ loop: #if 1 - static const UINT32 Patch[] = + static const uint32_t Patch[] = { 0x40c0ea01, 0xe906400a, @@ -748,7 +748,7 @@ loop: memcpy(m_reset_patch, Patch, sizeof(Patch)); #else - static const UINT8 Patch[] = + static const uint8_t Patch[] = { 0x01,0xEA,0xC0,0x40,0x0A,0x40,0x06,0xE9, 0x20,0x2A,0xC0,0x40,0x0A,0x40,0x06,0xE9, @@ -822,18 +822,18 @@ void crystal_state::machine_reset() PatchReset(); } -UINT16 crystal_state::GetVidReg( address_space &space, UINT16 reg ) +uint16_t crystal_state::GetVidReg( address_space &space, uint16_t reg ) { return space.read_word(0x03000000 + reg); } -void crystal_state::SetVidReg( address_space &space, UINT16 reg, UINT16 val ) +void crystal_state::SetVidReg( address_space &space, uint16_t reg, uint16_t val ) { space.write_word(0x03000000 + reg, val); } -UINT32 crystal_state::screen_update_crystal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t crystal_state::screen_update_crystal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int xres = 320; int yres = 240; @@ -856,29 +856,29 @@ UINT32 crystal_state::screen_update_crystal(screen_device &screen, bitmap_ind16 address_space &space = m_maincpu->space(AS_PROGRAM); int DoFlip; - UINT32 B0 = 0x0; - UINT32 B1 = (GetVidReg(space, 0x90) & 0x8000) ? 0x400000 : 0x100000; - UINT16 *Front, *Back; - UINT16 *Visible, *DrawDest; - UINT16 *srcline; + uint32_t B0 = 0x0; + uint32_t B1 = (GetVidReg(space, 0x90) & 0x8000) ? 0x400000 : 0x100000; + uint16_t *Front, *Back; + uint16_t *Visible, *DrawDest; + uint16_t *srcline; int y; - UINT16 head, tail; - UINT32 width = screen.width(); + uint16_t head, tail; + uint32_t width = screen.width(); if (GetVidReg(space, 0x8e) & 1) { - Front = (UINT16*) (m_frameram + B1 / 4); - Back = (UINT16*) (m_frameram + B0 / 4); + Front = (uint16_t*) (m_frameram + B1 / 4); + Back = (uint16_t*) (m_frameram + B0 / 4); } else { - Front = (UINT16*) (m_frameram + B0 / 4); - Back = (UINT16*) (m_frameram + B1 / 4); + Front = (uint16_t*) (m_frameram + B0 / 4); + Back = (uint16_t*) (m_frameram + B1 / 4); } - Visible = (UINT16*) Front; + Visible = (uint16_t*) Front; // ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros! - DrawDest = reinterpret_cast(m_frameram.target()); + DrawDest = reinterpret_cast(m_frameram.target()); if (GetVidReg(space, 0x8c) & 0x80) @@ -888,7 +888,7 @@ UINT32 crystal_state::screen_update_crystal(screen_device &screen, bitmap_ind16 // DrawDest = Visible; - srcline = (UINT16 *) DrawDest; + srcline = (uint16_t *) DrawDest; DoFlip = 0; head = GetVidReg(space, 0x82); @@ -896,7 +896,7 @@ UINT32 crystal_state::screen_update_crystal(screen_device &screen, bitmap_ind16 while ((head & 0x7ff) != (tail & 0x7ff)) { // ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros! - DoFlip = m_vr0->vrender0_ProcessPacket(0x03800000 + head * 64, DrawDest, reinterpret_cast(m_textureram.target())); + DoFlip = m_vr0->vrender0_ProcessPacket(0x03800000 + head * 64, DrawDest, reinterpret_cast(m_textureram.target())); head++; head &= 0x7ff; if (DoFlip) @@ -906,7 +906,7 @@ UINT32 crystal_state::screen_update_crystal(screen_device &screen, bitmap_ind16 if (DoFlip) SetVidReg(space, 0x8e, GetVidReg(space, 0x8e) ^ 1); - srcline = (UINT16 *) Visible; + srcline = (uint16_t *) Visible; for (y = 0; y < screen.height(); y++) memcpy(&bitmap.pix16(y), &srcline[y * 1024], width * 2); @@ -919,14 +919,14 @@ void crystal_state::screen_eof_crystal(screen_device &screen, bool state) if (state) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT16 head, tail; + uint16_t head, tail; int DoFlip = 0; head = GetVidReg(space, 0x82); tail = GetVidReg(space, 0x80); while ((head & 0x7ff) != (tail & 0x7ff)) { - UINT16 Packet0 = space.read_word(0x03800000 + head * 64); + uint16_t Packet0 = space.read_word(0x03800000 + head * 64); if (Packet0 & 0x81) DoFlip = 1; head++; @@ -1402,7 +1402,7 @@ ROM_END DRIVER_INIT_MEMBER(crystal_state,crysking) { - UINT16 *Rom = (UINT16*) memregion("user1")->base(); + uint16_t *Rom = (uint16_t*) memregion("user1")->base(); //patch the data feed by the protection @@ -1421,7 +1421,7 @@ DRIVER_INIT_MEMBER(crystal_state,crysking) DRIVER_INIT_MEMBER(crystal_state,evosocc) { - UINT16 *Rom = (UINT16*) memregion("user1")->base(); + uint16_t *Rom = (uint16_t*) memregion("user1")->base(); Rom += 0x1000000 * 2 / 2; Rom[WORD_XOR_LE(0x97388E/2)] = 0x90FC; //PUSH R2..R7 @@ -1449,7 +1449,7 @@ also it seems that bit 0x40000000 is the PIC reset. DRIVER_INIT_MEMBER(crystal_state,topbladv) { // patches based on analysis of PIC dump - UINT16 *Rom = (UINT16*) memregion("user1")->base(); + uint16_t *Rom = (uint16_t*) memregion("user1")->base(); /* PIC Protection data: - RAM ADDR - --PATCH-- @@ -1476,7 +1476,7 @@ DRIVER_INIT_MEMBER(crystal_state,topbladv) DRIVER_INIT_MEMBER(crystal_state,officeye) { // patches based on analysis of PIC dump - UINT16 *Rom = (UINT16*) memregion("user1")->base(); + uint16_t *Rom = (uint16_t*) memregion("user1")->base(); /* PIC Protection data: @@ -1502,7 +1502,7 @@ DRIVER_INIT_MEMBER(crystal_state,officeye) DRIVER_INIT_MEMBER(crystal_state, donghaer) { - UINT16 *Rom = (UINT16*)memregion("user1")->base(); + uint16_t *Rom = (uint16_t*)memregion("user1")->base(); Rom[WORD_XOR_LE(0x037A2 / 2)] = 0x9004; // PUSH %R2 Rom[WORD_XOR_LE(0x037A4 / 2)] = 0x8202; // LD (%SP,0x8),%R2 diff --git a/src/mame/drivers/csplayh5.cpp b/src/mame/drivers/csplayh5.cpp index bd49b56a9ef..6c88bad56e4 100644 --- a/src/mame/drivers/csplayh5.cpp +++ b/src/mame/drivers/csplayh5.cpp @@ -60,7 +60,7 @@ public: required_memory_region m_region_audiocpu; required_memory_bank m_bank1; - UINT16 m_mux_data; + uint16_t m_mux_data; DECLARE_READ16_MEMBER(csplayh5_mux_r); DECLARE_WRITE16_MEMBER(csplayh5_mux_w); @@ -486,8 +486,8 @@ static MACHINE_CONFIG_START( csplayh5, csplayh5_state ) void csplayh5_state::general_init(int patchaddress, int patchvalue) { - UINT16 *MAINROM = (UINT16 *)m_region_maincpu->base(); - UINT8 *SNDROM = m_region_audiocpu->base(); + uint16_t *MAINROM = (uint16_t *)m_region_maincpu->base(); + uint8_t *SNDROM = m_region_audiocpu->base(); // initialize sound rom bank soundbank_w(0); diff --git a/src/mame/drivers/cswat.cpp b/src/mame/drivers/cswat.cpp index 340e35f407b..0b8fa738fe9 100644 --- a/src/mame/drivers/cswat.cpp +++ b/src/mame/drivers/cswat.cpp @@ -40,10 +40,10 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_ioport m_dips_inp; - UINT8 m_nmi_enabled; + uint8_t m_nmi_enabled; tilemap_t *m_tilemap; DECLARE_WRITE8_MEMBER(videoram_w); @@ -55,7 +55,7 @@ public: TILEMAP_MAPPER_MEMBER(tilemap_scan_rows); TILE_GET_INFO_MEMBER(get_tile_info); - UINT32 screen_update_cswat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cswat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void video_start() override; virtual void machine_reset() override; @@ -95,7 +95,7 @@ void cswat_state::video_start() m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(cswat_state::get_tile_info),this), tilemap_mapper_delegate(FUNC(cswat_state::tilemap_scan_rows),this), 8, 8, 36, 28); } -UINT32 cswat_state::screen_update_cswat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cswat_state::screen_update_cswat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -123,7 +123,7 @@ WRITE8_MEMBER(cswat_state::irq_ack_w) READ8_MEMBER(cswat_state::dipswitch_r) { - UINT16 dips = m_dips_inp->read(); + uint16_t dips = m_dips_inp->read(); return offset ? dips >> 8 : dips & 0xff; } diff --git a/src/mame/drivers/cubeqst.cpp b/src/mame/drivers/cubeqst.cpp index 4f72111642b..73abd3dcaf3 100644 --- a/src/mame/drivers/cubeqst.cpp +++ b/src/mame/drivers/cubeqst.cpp @@ -49,17 +49,17 @@ public: }), m_generic_paletteram_16(*this, "paletteram") { } - std::unique_ptr m_depth_buffer; + std::unique_ptr m_depth_buffer; int m_video_field; - UINT8 m_io_latch; - UINT8 m_reset_latch; + uint8_t m_io_latch; + uint8_t m_reset_latch; required_device m_laserdisc; required_device m_rotatecpu; required_device m_linecpu; required_device m_soundcpu; required_device m_screen; required_device_array m_dacs; - required_shared_ptr m_generic_paletteram_16; + required_shared_ptr m_generic_paletteram_16; std::unique_ptr m_colormap; DECLARE_WRITE16_MEMBER(palette_w); DECLARE_READ16_MEMBER(line_r); @@ -79,7 +79,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cubeqst(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cubeqst(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank); TIMER_CALLBACK_MEMBER(delayed_bank_swap); void swap_linecpu_banks(); @@ -107,7 +107,7 @@ public: void cubeqst_state::video_start() { m_video_field = 0; - m_depth_buffer = std::make_unique(512); + m_depth_buffer = std::make_unique(512); } WRITE16_MEMBER(cubeqst_state::palette_w) @@ -119,7 +119,7 @@ WRITE16_MEMBER(cubeqst_state::palette_w) } /* TODO: This is a simplified version of what actually happens */ -UINT32 cubeqst_state::screen_update_cubeqst(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cubeqst_state::screen_update_cubeqst(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int y; @@ -136,9 +136,9 @@ UINT32 cubeqst_state::screen_update_cubeqst(screen_device &screen, bitmap_rgb32 { int i; int num_entries = m_linecpu->cubeqcpu_get_ptr_ram_val(y); - UINT32 *stk_ram = m_linecpu->cubeqcpu_get_stack_ram(); - UINT32 *dest = &bitmap.pix32(y); - UINT32 pen; + uint32_t *stk_ram = m_linecpu->cubeqcpu_get_stack_ram(); + uint32_t *dest = &bitmap.pix32(y); + uint32_t pen; /* Zap the depth buffer */ memset(m_depth_buffer.get(), 0xff, 512); @@ -338,7 +338,7 @@ WRITE16_MEMBER(cubeqst_state::io_w) READ16_MEMBER(cubeqst_state::io_r) { - UINT16 port_data = ioport("IO")->read(); + uint16_t port_data = ioport("IO")->read(); /* Certain bits depend on Q7 of the IO latch: @@ -458,7 +458,7 @@ void cubeqst_state::machine_start() m_colormap = std::make_unique(65536); for (i = 0; i < 65536; ++i) { - UINT8 a, r, g, b, y; + uint8_t a, r, g, b, y; a = (i >> 3) & 1; b = (i >> 0) & 7; diff --git a/src/mame/drivers/cubo.cpp b/src/mame/drivers/cubo.cpp index 5532adb9171..d16ecd6a5e5 100644 --- a/src/mame/drivers/cubo.cpp +++ b/src/mame/drivers/cubo.cpp @@ -331,8 +331,8 @@ public: m_cdda(*this, "cdda") { } - void handle_joystick_cia(UINT8 pra, UINT8 dra); - UINT16 handle_joystick_potgor(UINT16 potgor); + void handle_joystick_cia(uint8_t pra, uint8_t dra); + uint16_t handle_joystick_potgor(uint16_t potgor); DECLARE_CUSTOM_INPUT_MEMBER(cubo_input); DECLARE_CUSTOM_INPUT_MEMBER(cd32_sel_mirror_input); @@ -353,11 +353,11 @@ public: int m_oldstate[2]; int m_cd32_shifter[2]; - UINT16 m_potgo_value; + uint16_t m_potgo_value; protected: virtual void rs232_tx(int state) override; - virtual void potgo_w(UINT16 data) override; + virtual void potgo_w(uint16_t data) override; private: required_device m_microtouch; @@ -365,7 +365,7 @@ private: typedef void (cubo_state::*input_hack_func)(); input_hack_func m_input_hack; - void chip_ram_w8_hack(offs_t byteoffs, UINT8 data); + void chip_ram_w8_hack(offs_t byteoffs, uint8_t data); void cndypuzl_input_hack(); void haremchl_input_hack(); void lsrquiz_input_hack(); @@ -436,7 +436,7 @@ void cubo_state::rs232_tx(int state) m_microtouch->rx_w(state); } -void cubo_state::potgo_w(UINT16 data) +void cubo_state::potgo_w(uint16_t data) { int i; @@ -448,30 +448,30 @@ void cubo_state::potgo_w(UINT16 data) for (i = 0; i < 8; i += 2) { - UINT16 dir = 0x0200 << i; + uint16_t dir = 0x0200 << i; if (data & dir) { - UINT16 d = 0x0100 << i; + uint16_t d = 0x0100 << i; m_potgo_value &= ~d; m_potgo_value |= data & d; } } for (i = 0; i < 2; i++) { - UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */ - UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */ + uint16_t p5dir = 0x0200 << (i * 4); /* output enable P5 */ + uint16_t p5dat = 0x0100 << (i * 4); /* data P5 */ if ((m_potgo_value & p5dir) && (m_potgo_value & p5dat)) m_cd32_shifter[i] = 8; } } -void cubo_state::handle_joystick_cia(UINT8 pra, UINT8 dra) +void cubo_state::handle_joystick_cia(uint8_t pra, uint8_t dra) { for (int i = 0; i < 2; i++) { - UINT8 but = 0x40 << i; - UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */ - UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */ + uint8_t but = 0x40 << i; + uint16_t p5dir = 0x0200 << (i * 4); /* output enable P5 */ + uint16_t p5dat = 0x0100 << (i * 4); /* data P5 */ if (!(m_potgo_value & p5dir) || !(m_potgo_value & p5dat)) { @@ -489,14 +489,14 @@ void cubo_state::handle_joystick_cia(UINT8 pra, UINT8 dra) } } -UINT16 cubo_state::handle_joystick_potgor(UINT16 potgor) +uint16_t cubo_state::handle_joystick_potgor(uint16_t potgor) { for (int i = 0; i < 2; i++) { - UINT16 p9dir = 0x0800 << (i * 4); /* output enable P9 */ - UINT16 p9dat = 0x0400 << (i * 4); /* data P9 */ - UINT16 p5dir = 0x0200 << (i * 4); /* output enable P5 */ - UINT16 p5dat = 0x0100 << (i * 4); /* data P5 */ + uint16_t p9dir = 0x0800 << (i * 4); /* output enable P9 */ + uint16_t p9dat = 0x0400 << (i * 4); /* data P9 */ + uint16_t p5dir = 0x0200 << (i * 4); /* output enable P5 */ + uint16_t p5dat = 0x0100 << (i * 4); /* data P5 */ /* p5 is floating in input-mode */ potgor &= ~p5dat; @@ -522,7 +522,7 @@ CUSTOM_INPUT_MEMBER( cubo_state::cubo_input ) CUSTOM_INPUT_MEMBER( cubo_state::cd32_sel_mirror_input ) { - UINT8 bits = m_player_ports[(int)(uintptr_t)param]->read(); + uint8_t bits = m_player_ports[(int)(uintptr_t)param]->read(); return (bits & 0x20)>>5; } @@ -1166,14 +1166,14 @@ ROM_END * *************************************/ -void cubo_state::chip_ram_w8_hack(offs_t byteoffs, UINT8 data) +void cubo_state::chip_ram_w8_hack(offs_t byteoffs, uint8_t data) { - UINT16 word = chip_ram_r(byteoffs); + uint16_t word = chip_ram_r(byteoffs); if (byteoffs & 1) word = (word & 0xff00) | data; else - word = (word & 0x00ff) | (((UINT16)data) << 8); + word = (word & 0x00ff) | (((uint16_t)data) << 8); chip_ram_w(byteoffs, word); } @@ -1182,7 +1182,7 @@ void cubo_state::cndypuzl_input_hack() { if (m_maincpu->pc < m_chip_ram.bytes()) { - UINT32 r_A5 = m_maincpu->state_int(M68K_A5); + uint32_t r_A5 = m_maincpu->state_int(M68K_A5); chip_ram_w(r_A5 - 0x7ebe, 0x0000); } } @@ -1197,8 +1197,8 @@ void cubo_state::haremchl_input_hack() { if (m_maincpu->pc < m_chip_ram.bytes()) { - UINT32 r_A5 = m_maincpu->state_int(M68K_A5); - UINT32 r_A2 = (chip_ram_r(r_A5 - 0x7f00 + 0) << 16) | (chip_ram_r(r_A5 - 0x7f00 + 2)); + uint32_t r_A5 = m_maincpu->state_int(M68K_A5); + uint32_t r_A2 = (chip_ram_r(r_A5 - 0x7f00 + 0) << 16) | (chip_ram_r(r_A5 - 0x7f00 + 2)); chip_ram_w8_hack(r_A2 + 0x1f, 0x00); } } @@ -1213,8 +1213,8 @@ void cubo_state::lsrquiz_input_hack() { if (m_maincpu->pc < m_chip_ram.bytes()) { - UINT32 r_A5 = m_maincpu->state_int(M68K_A5); - UINT32 r_A2 = (chip_ram_r(r_A5 - 0x7fe0 + 0) << 16) | (chip_ram_r(r_A5 - 0x7fe0 + 2)); + uint32_t r_A5 = m_maincpu->state_int(M68K_A5); + uint32_t r_A2 = (chip_ram_r(r_A5 - 0x7fe0 + 0) << 16) | (chip_ram_r(r_A5 - 0x7fe0 + 2)); chip_ram_w8_hack(r_A2 + 0x13, 0x00); } } @@ -1230,8 +1230,8 @@ void cubo_state::lsrquiz2_input_hack() { if (m_maincpu->pc < m_chip_ram.bytes()) { - UINT32 r_A5 = m_maincpu->state_int(M68K_A5); - UINT32 r_A2 = (chip_ram_r(r_A5 - 0x7fdc + 0) << 16) | (chip_ram_r(r_A5 - 0x7fdc + 2)); + uint32_t r_A5 = m_maincpu->state_int(M68K_A5); + uint32_t r_A2 = (chip_ram_r(r_A5 - 0x7fdc + 0) << 16) | (chip_ram_r(r_A5 - 0x7fdc + 2)); chip_ram_w8_hack(r_A2 + 0x17, 0x00); } } @@ -1246,8 +1246,8 @@ void cubo_state::lasstixx_input_hack() { if (m_maincpu->pc < m_chip_ram.bytes()) { - UINT32 r_A5 = m_maincpu->state_int(M68K_A5); - UINT32 r_A2 = (chip_ram_r(r_A5 - 0x7fa2 + 0) << 16) | (chip_ram_r(r_A5 - 0x7fa2 + 2)); + uint32_t r_A5 = m_maincpu->state_int(M68K_A5); + uint32_t r_A2 = (chip_ram_r(r_A5 - 0x7fa2 + 0) << 16) | (chip_ram_r(r_A5 - 0x7fa2 + 2)); chip_ram_w8_hack(r_A2 + 0x24, 0x00); } } @@ -1262,7 +1262,7 @@ void cubo_state::mgnumber_input_hack() { if (m_maincpu->pc < m_chip_ram.bytes()) { - UINT32 r_A5 = m_maincpu->state_int(M68K_A5); + uint32_t r_A5 = m_maincpu->state_int(M68K_A5); chip_ram_w(r_A5 - 0x7ed8, 0x0000); } } @@ -1277,7 +1277,7 @@ void cubo_state::mgprem11_input_hack() { if (m_maincpu->pc < m_chip_ram.bytes()) { - UINT32 r_A5 = m_maincpu->state_int(M68K_A5); + uint32_t r_A5 = m_maincpu->state_int(M68K_A5); chip_ram_w8_hack(r_A5 - 0x7eca, 0x00); } } diff --git a/src/mame/drivers/cultures.cpp b/src/mame/drivers/cultures.cpp index 439ffd0642c..98582e6d02f 100644 --- a/src/mame/drivers/cultures.cpp +++ b/src/mame/drivers/cultures.cpp @@ -46,16 +46,16 @@ public: required_memory_bank m_okibank; /* memory pointers */ - required_region_ptr m_bg1_rom; - required_region_ptr m_bg2_rom; + required_region_ptr m_bg1_rom; + required_region_ptr m_bg2_rom; - required_shared_ptr m_bg0_videoram; - required_shared_ptr m_bg0_regs_x; - required_shared_ptr m_bg0_regs_y; - required_shared_ptr m_bg1_regs_x; - required_shared_ptr m_bg1_regs_y; - required_shared_ptr m_bg2_regs_x; - required_shared_ptr m_bg2_regs_y; + required_shared_ptr m_bg0_videoram; + required_shared_ptr m_bg0_regs_x; + required_shared_ptr m_bg0_regs_y; + required_shared_ptr m_bg1_regs_x; + required_shared_ptr m_bg1_regs_y; + required_shared_ptr m_bg2_regs_x; + required_shared_ptr m_bg2_regs_y; /* video-related */ tilemap_t *m_bg0_tilemap; @@ -74,7 +74,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cultures(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cultures(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(cultures_interrupt); }; @@ -116,7 +116,7 @@ void cultures_state::video_start() m_bg2_tilemap->set_scrolldy(255, -16); } -UINT32 cultures_state::screen_update_cultures(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cultures_state::screen_update_cultures(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int attr; diff --git a/src/mame/drivers/cupidon.cpp b/src/mame/drivers/cupidon.cpp index cf85470c75c..c1af7777bb2 100644 --- a/src/mame/drivers/cupidon.cpp +++ b/src/mame/drivers/cupidon.cpp @@ -29,9 +29,9 @@ public: // devices required_device m_maincpu; - required_shared_ptr m_gfxram; + required_shared_ptr m_gfxram; - UINT32 screen_update_cupidon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cupidon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_DRIVER_INIT(cupidon); DECLARE_DRIVER_INIT(funnyfm); @@ -46,7 +46,7 @@ protected: }; -UINT32 cupidon_state::screen_update_cupidon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cupidon_state::screen_update_cupidon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int count = 0; @@ -56,11 +56,11 @@ UINT32 cupidon_state::screen_update_cupidon(screen_device &screen, bitmap_ind16 { for (int y=0;y<16;y++) { - UINT16* destline = &bitmap.pix16(ytile*16 + y); + uint16_t* destline = &bitmap.pix16(ytile*16 + y); for (int x=0;x<8;x++) { - UINT32 gfx = m_gfxram[count]; + uint32_t gfx = m_gfxram[count]; destline[(xtile*16)+(x*2)+0] = (gfx >> 16)&0xffff; destline[(xtile*16)+(x*2)+1] = (gfx >> 0)&0xffff; diff --git a/src/mame/drivers/cv1k.cpp b/src/mame/drivers/cv1k.cpp index a334e87bfc7..9bcd3ab9145 100644 --- a/src/mame/drivers/cv1k.cpp +++ b/src/mame/drivers/cv1k.cpp @@ -204,8 +204,8 @@ public: required_device m_serflash; required_device m_eeprom; - required_shared_ptr m_ram; - required_shared_ptr m_rombase; + required_shared_ptr m_ram; + required_shared_ptr m_rombase; DECLARE_READ8_MEMBER(flash_io_r); DECLARE_WRITE8_MEMBER(flash_io_w); @@ -213,7 +213,7 @@ public: DECLARE_WRITE8_MEMBER(serial_rtc_eeprom_w); DECLARE_READ64_MEMBER(flash_port_e_r); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void machine_reset() override; @@ -230,15 +230,15 @@ public: required_ioport m_blitrate; required_ioport m_eepromout; - UINT32 m_idleramoffs; - UINT32 m_idlepc; - void install_speedups(UINT32 idleramoff, UINT32 idlepc, bool is_typed); + uint32_t m_idleramoffs; + uint32_t m_idlepc; + void install_speedups(uint32_t idleramoff, uint32_t idlepc, bool is_typed); }; /**************************************************************************/ -UINT32 cv1k_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cv1k_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_blitter->set_delay_scale(m_blitrate->read()); @@ -421,7 +421,7 @@ INPUT_PORTS_END void cv1k_state::machine_reset() { - m_blitter->set_rambase (reinterpret_cast(m_ram.target())); + m_blitter->set_rambase (reinterpret_cast(m_ram.target())); m_blitter->set_cpu_device (m_maincpu); m_blitter->set_is_unsafe(machine().root_device().ioport(":BLITCFG")->read()); m_blitter->install_handlers( 0x18000000, 0x18000057 ); @@ -835,7 +835,7 @@ READ64_MEMBER( cv1k_state::speedup_r ) return m_ram[m_idleramoffs/8]; } -void cv1k_state::install_speedups(UINT32 idleramoff, UINT32 idlepc, bool is_typed) +void cv1k_state::install_speedups(uint32_t idleramoff, uint32_t idlepc, bool is_typed) { m_idleramoffs = idleramoff; m_idlepc = idlepc; diff --git a/src/mame/drivers/cvicny.cpp b/src/mame/drivers/cvicny.cpp index 8939702099d..a88c22bcc51 100644 --- a/src/mame/drivers/cvicny.cpp +++ b/src/mame/drivers/cvicny.cpp @@ -49,8 +49,8 @@ public: DECLARE_READ8_MEMBER(key_r); DECLARE_WRITE8_MEMBER(digit_w); DECLARE_WRITE8_MEMBER(segment_w ); - UINT8 m_digit; - UINT8 m_digit_last; + uint8_t m_digit; + uint8_t m_digit_last; }; WRITE8_MEMBER( cvicny_state::segment_w ) // output segments on the selected digit @@ -68,7 +68,7 @@ WRITE8_MEMBER( cvicny_state::digit_w ) // set keyboard scanning row; set digit t READ8_MEMBER( cvicny_state::key_r ) { - UINT8 data; + uint8_t data; char kbdrow[6]; sprintf(kbdrow,"X%d",m_digit); data = ioport(kbdrow)->read(); diff --git a/src/mame/drivers/cvs.cpp b/src/mame/drivers/cvs.cpp index 5ff7e05dbe0..d7f45887870 100644 --- a/src/mame/drivers/cvs.cpp +++ b/src/mame/drivers/cvs.cpp @@ -247,7 +247,7 @@ WRITE_LINE_MEMBER(cvs_state::cvs_slave_cpu_interrupt) READ8_MEMBER(cvs_state::cvs_input_r) { - UINT8 ret = 0; + uint8_t ret = 0; /* the upper 4 bits of the address is used to select the character banking attributes */ m_character_banking_mode = (offset >> 4) & 0x03; @@ -316,7 +316,7 @@ void cvs_state::start_393hz_timer() WRITE8_MEMBER(cvs_state::cvs_4_bit_dac_data_w) { - UINT8 dac_value; + uint8_t dac_value; static int old_data[4] = {0,0,0,0}; if (data != old_data[offset]) @@ -385,7 +385,7 @@ READ8_MEMBER(cvs_state::cvs_speech_command_r) WRITE8_MEMBER(cvs_state::cvs_tms5110_ctl_w) { - UINT8 ctl; + uint8_t ctl; /* * offset 0: CS ? */ @@ -403,7 +403,7 @@ WRITE8_MEMBER(cvs_state::cvs_tms5110_ctl_w) WRITE8_MEMBER(cvs_state::cvs_tms5110_pdc_w) { - UINT8 out = ((~data) >> 7) & 1; + uint8_t out = ((~data) >> 7) & 1; LOG(("CVS: Speech PDC = %02x %02x\n", offset, out)); m_tms5110->pdc_w(out); } @@ -412,7 +412,7 @@ WRITE8_MEMBER(cvs_state::cvs_tms5110_pdc_w) READ_LINE_MEMBER(cvs_state::speech_rom_read_bit) { int bit; - UINT8 *ROM = memregion("speechdata")->base(); + uint8_t *ROM = memregion("speechdata")->base(); /* before reading the bit, clamp the address to the region length */ m_speech_rom_bit_address &= ((memregion("speechdata")->bytes() * 8) - 1); @@ -1536,7 +1536,7 @@ ROM_END DRIVER_INIT_MEMBER(cvs_state,huncholy) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* patch out protection */ ROM[0x0082] = 0xc0; @@ -1556,7 +1556,7 @@ DRIVER_INIT_MEMBER(cvs_state,huncholy) DRIVER_INIT_MEMBER(cvs_state,hunchbaka) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); offs_t offs; @@ -1568,7 +1568,7 @@ DRIVER_INIT_MEMBER(cvs_state,hunchbaka) DRIVER_INIT_MEMBER(cvs_state,superbik) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* patch out protection */ ROM[0x0079] = 0xc0; @@ -1596,7 +1596,7 @@ DRIVER_INIT_MEMBER(cvs_state,superbik) DRIVER_INIT_MEMBER(cvs_state,hero) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* patch out protection */ ROM[0x0087] = 0xc0; @@ -1618,7 +1618,7 @@ DRIVER_INIT_MEMBER(cvs_state,hero) DRIVER_INIT_MEMBER(cvs_state,raiders) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); offs_t offs; diff --git a/src/mame/drivers/cxhumax.cpp b/src/mame/drivers/cxhumax.cpp index 18cb23c4f3e..77c055bbd91 100644 --- a/src/mame/drivers/cxhumax.cpp +++ b/src/mame/drivers/cxhumax.cpp @@ -32,9 +32,9 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, c READ32_MEMBER ( cxhumax_state::cx_gxa_r ) { - UINT32 res = m_gxa_cmd_regs[offset]; + uint32_t res = m_gxa_cmd_regs[offset]; verboselog(*this, 9, "(GXA) %08X -> %08X\n", 0xE0600000 + (offset << 2), res); -/* UINT8 gxa_command_number = (offset >> 9) & 0x7F; +/* uint8_t gxa_command_number = (offset >> 9) & 0x7F; verboselog(*this, 9, " Command: %08X\n", gxa_command_number); switch (gxa_command_number) { case GXA_CMD_RW_REGISTER: @@ -57,7 +57,7 @@ READ32_MEMBER ( cxhumax_state::cx_gxa_r ) WRITE32_MEMBER( cxhumax_state::cx_gxa_w ) { verboselog(*this, 9, "(GXA) %08X <- %08X\n", 0xE0600000 + (offset << 2), data); - UINT8 gxa_command_number = (offset >> 9) & 0x7F; + uint8_t gxa_command_number = (offset >> 9) & 0x7F; verboselog(*this, 9, " Command: %08X\n", gxa_command_number); /* Clear non persistent data */ @@ -124,7 +124,7 @@ WRITE32_MEMBER ( cxhumax_state::flash_w ) READ32_MEMBER ( cxhumax_state::flash_r ) { - UINT32 res = 0; + uint32_t res = 0; offset *= 2; if(ACCESSING_BITS_0_15) res |= m_flash->read(offset); @@ -149,7 +149,7 @@ WRITE32_MEMBER ( cxhumax_state::cx_remap_w ) READ32_MEMBER( cxhumax_state::cx_scratch_r ) { - UINT32 data = m_scratch_reg; + uint32_t data = m_scratch_reg; verboselog(*this, 9, "(SCRATCH) %08X -> %08X\n", 0xE0400024 + (offset << 2), data); if((m_maincpu->pc()==0xF0003BB8) || (m_maincpu->pc()==0x01003724) || (m_maincpu->pc()==0x00005d8c)) { // HDCI-2000 @@ -179,7 +179,7 @@ WRITE32_MEMBER( cxhumax_state::cx_scratch_w ) READ32_MEMBER( cxhumax_state::cx_hsx_r ) { - UINT32 data = 0; // dummy + uint32_t data = 0; // dummy verboselog(*this, 9, "(HSX) %08X -> %08X\n", 0xE0000000 + (offset << 2), data); return data; } @@ -191,7 +191,7 @@ WRITE32_MEMBER( cxhumax_state::cx_hsx_w ) READ32_MEMBER( cxhumax_state::cx_romdescr_r ) { - UINT32 data = m_romdescr_reg; + uint32_t data = m_romdescr_reg; verboselog(*this, 9, "(ROMDESC0) %08X -> %08X\n", 0xE0010000 + (offset << 2), data); return data; } @@ -204,7 +204,7 @@ WRITE32_MEMBER( cxhumax_state::cx_romdescr_w ) READ32_MEMBER( cxhumax_state::cx_isaromdescr_r ) { - UINT32 data = m_isaromdescr_regs[offset]; + uint32_t data = m_isaromdescr_regs[offset]; verboselog(*this, 9, "(ISAROMDESC%d) %08X -> %08X\n", offset+1, 0xE0010004 + (offset << 2), data); return data; } @@ -217,7 +217,7 @@ WRITE32_MEMBER( cxhumax_state::cx_isaromdescr_w ) READ32_MEMBER( cxhumax_state::cx_isadescr_r ) { - UINT32 data = m_isaromdescr_regs[offset]; + uint32_t data = m_isaromdescr_regs[offset]; verboselog(*this, 9, "(ISA_DESC%d) %08X -> %08X\n", offset+4, 0xE0010010 + (offset << 2), data); return data; } @@ -230,7 +230,7 @@ WRITE32_MEMBER( cxhumax_state::cx_isadescr_w ) READ32_MEMBER( cxhumax_state::cx_rommap_r ) { - UINT32 data = 0; + uint32_t data = 0; verboselog(*this, 9, "(ROM%d_MAP) %08X -> %08X\n", offset, 0xE0010020 + (offset << 2), data); return data; } @@ -242,7 +242,7 @@ WRITE32_MEMBER( cxhumax_state::cx_rommap_w ) READ32_MEMBER( cxhumax_state::cx_rommode_r ) { - UINT32 data = m_rommode_reg; + uint32_t data = m_rommode_reg; verboselog(*this, 9, "(ROMMODE) %08X -> %08X\n", 0xE0010034 + (offset << 2), data); return data; } @@ -255,7 +255,7 @@ WRITE32_MEMBER( cxhumax_state::cx_rommode_w ) READ32_MEMBER( cxhumax_state::cx_xoemask_r ) { - UINT32 data = m_xoemask_reg; + uint32_t data = m_xoemask_reg; verboselog(*this, 9, "(XOEMASK) %08X -> %08X\n", 0xE0010034 + (offset << 2), data); return data; } @@ -268,7 +268,7 @@ WRITE32_MEMBER( cxhumax_state::cx_xoemask_w ) READ32_MEMBER( cxhumax_state::cx_pci_r ) { - UINT32 data = 0; + uint32_t data = 0; switch (offset) { case PCI_CFG_ADDR_REG: data = m_pci_regs[offset]; break; @@ -292,7 +292,7 @@ WRITE32_MEMBER( cxhumax_state::cx_pci_w ) READ32_MEMBER( cxhumax_state::cx_extdesc_r ) { - UINT32 data = m_extdesc_regs[offset]; + uint32_t data = m_extdesc_regs[offset]; verboselog(*this, 9, "(EXTDESC) %08X -> %08X\n", 0xE0010080 + (offset << 2), data); return data; } @@ -332,8 +332,8 @@ TIMER_CALLBACK_MEMBER(cxhumax_state::timer_tick) READ32_MEMBER( cxhumax_state::cx_timers_r ) { - UINT32 data = 0; - UINT8 index = offset>>2; + uint32_t data = 0; + uint8_t index = offset>>2; if(index==16) { data = m_timer_regs.timer_irq; //m_timer_regs.timer_irq=0; @@ -357,7 +357,7 @@ READ32_MEMBER( cxhumax_state::cx_timers_r ) WRITE32_MEMBER( cxhumax_state::cx_timers_w ) { - UINT8 index = offset>>2; + uint8_t index = offset>>2; if(index==16) { verboselog(*this, 9, "(TIMERIRQ) %08X <- %08X\n", 0xE0430000 + (offset << 2), data); COMBINE_DATA(&m_timer_regs.timer_irq); @@ -389,7 +389,7 @@ WRITE32_MEMBER( cxhumax_state::cx_timers_w ) READ32_MEMBER( cxhumax_state::cx_uart2_r ) { - UINT32 data; + uint32_t data; switch (offset) { case UART_STAT_REG: /* Transmitter Idle */ @@ -430,7 +430,7 @@ WRITE32_MEMBER( cxhumax_state::cx_uart2_w ) READ32_MEMBER( cxhumax_state::cx_pll_r ) { - UINT32 data = m_pll_regs[offset]; + uint32_t data = m_pll_regs[offset]; verboselog(*this, 9, "(PLL) %08X -> %08X\n", 0xE0440000 + (offset << 2), data); return data; } @@ -443,7 +443,7 @@ WRITE32_MEMBER( cxhumax_state::cx_pll_w ) READ32_MEMBER( cxhumax_state::cx_pllprescale_r ) { - UINT32 data = m_pllprescale_reg; + uint32_t data = m_pllprescale_reg; verboselog(*this, 9, "(PLLPRESCALE) %08X -> %08X\n", 0xE0440094 + (offset << 2), data); return data; } @@ -456,7 +456,7 @@ WRITE32_MEMBER( cxhumax_state::cx_pllprescale_w ) READ32_MEMBER( cxhumax_state::cx_clkdiv_r ) { - UINT32 data = m_clkdiv_regs[offset]; + uint32_t data = m_clkdiv_regs[offset]; verboselog(*this, 9, "(CLKDIV) %08X -> %08X\n", 0xE0440020 + (offset << 2), data); return data; } @@ -469,7 +469,7 @@ WRITE32_MEMBER( cxhumax_state::cx_clkdiv_w ) READ32_MEMBER( cxhumax_state::cx_chipcontrol_r ) { - UINT32 data = m_chipcontrol_regs[offset]; + uint32_t data = m_chipcontrol_regs[offset]; verboselog(*this, 9, "(CHIPCONTROL) %08X -> %08X\n", 0xE0440100 + (offset << 2), data); return data; } @@ -482,7 +482,7 @@ WRITE32_MEMBER( cxhumax_state::cx_chipcontrol_w ) READ32_MEMBER( cxhumax_state::cx_intctrl_r ) { - UINT32 data = m_intctrl_regs[offset]; + uint32_t data = m_intctrl_regs[offset]; verboselog(*this, 9, "(INTCTRL) %08X -> %08X\n", 0xE0450000 + (offset << 2), data); return data; } @@ -557,7 +557,7 @@ WRITE32_MEMBER( cxhumax_state::cx_intctrl_w ) READ32_MEMBER( cxhumax_state::cx_ss_r ) { - UINT32 data = 0; + uint32_t data = 0; switch(offset) { case SS_FIFC_REG: data = m_ss_regs[offset] & 0xFFF0; @@ -577,7 +577,7 @@ WRITE32_MEMBER( cxhumax_state::cx_ss_w ) case SS_CNTL_REG: if (data&1) { // "Send" pending data - UINT8 tfd = (m_ss_regs[SS_STAT_REG]>>4) & 0xF; + uint8_t tfd = (m_ss_regs[SS_STAT_REG]>>4) & 0xF; if ((tfd>1) && (m_ss_tx_fifo[0] == 0) && (m_ss_tx_fifo[1] != 0xFF)) { // ASCII printf("%s\n", &m_ss_tx_fifo[1]); @@ -597,7 +597,7 @@ WRITE32_MEMBER( cxhumax_state::cx_ss_w ) case SS_FIFO_REG: { // Push data into TX FIFO (if it's not full) and adjust transmit FIFO depth - UINT8 tfd = (m_ss_regs[SS_STAT_REG]>>4) & 0xF; + uint8_t tfd = (m_ss_regs[SS_STAT_REG]>>4) & 0xF; if (tfd<8) { m_ss_tx_fifo[tfd++] = data; m_ss_regs[SS_STAT_REG] = (m_ss_regs[SS_STAT_REG] & 0xFF0F) | (tfd<<4); @@ -615,7 +615,7 @@ WRITE32_MEMBER( cxhumax_state::cx_ss_w ) READ32_MEMBER( cxhumax_state::cx_i2c0_r ) { - UINT32 data = m_i2c0_regs[offset]; + uint32_t data = m_i2c0_regs[offset]; verboselog(*this, 9, "(I2C0) %08X -> %08X\n", 0xE04E0000 + (offset << 2), data); return data; } @@ -626,9 +626,9 @@ WRITE32_MEMBER( cxhumax_state::cx_i2c0_w ) COMBINE_DATA(&m_i2c0_regs[offset]); } -UINT8 cxhumax_state::i2cmem_read_byte(int last) +uint8_t cxhumax_state::i2cmem_read_byte(int last) { - UINT8 data = 0; + uint8_t data = 0; int i; m_i2cmem->write_sda(1); for (i = 0; i < 8; i++) @@ -643,7 +643,7 @@ UINT8 cxhumax_state::i2cmem_read_byte(int last) return data; } -void cxhumax_state::i2cmem_write_byte(UINT8 data) +void cxhumax_state::i2cmem_write_byte(uint8_t data) { int i; for (i = 0; i < 8; i++) @@ -676,7 +676,7 @@ void cxhumax_state::i2cmem_stop() READ32_MEMBER( cxhumax_state::cx_i2c1_r ) { - UINT32 data=0; + uint32_t data=0; switch(offset) { case I2C_STAT_REG: data |= m_i2cmem->read_sda()<<3; @@ -749,7 +749,7 @@ WRITE32_MEMBER( cxhumax_state::cx_i2c1_w ) READ32_MEMBER( cxhumax_state::cx_i2c2_r ) { - UINT32 data = m_i2c2_regs[offset]; + uint32_t data = m_i2c2_regs[offset]; verboselog(*this, 9, "(I2C2) %08X -> %08X\n", 0xE04E2000 + (offset << 2), data); return data; } @@ -762,7 +762,7 @@ WRITE32_MEMBER( cxhumax_state::cx_i2c2_w ) READ32_MEMBER( cxhumax_state::cx_mc_cfg_r ) { - UINT32 data = m_mccfg_regs[offset]; + uint32_t data = m_mccfg_regs[offset]; verboselog(*this, 9, "(MC_CFG) %08X -> %08X\n", 0xE0500300 + (offset << 2), data); return data; } @@ -775,7 +775,7 @@ WRITE32_MEMBER( cxhumax_state::cx_mc_cfg_w ) READ32_MEMBER( cxhumax_state::cx_drm0_r ) { - UINT32 data = m_drm0_regs[offset]; + uint32_t data = m_drm0_regs[offset]; verboselog(*this, 9, "(DRM0) %08X -> %08X\n", 0xE0560000 + (offset << 2), data); switch(offset) { case 0x14/4: // DRM_STATUS_REG @@ -793,7 +793,7 @@ WRITE32_MEMBER( cxhumax_state::cx_drm0_w ) READ32_MEMBER( cxhumax_state::cx_drm1_r ) { - UINT32 data = m_drm1_regs[offset]; + uint32_t data = m_drm1_regs[offset]; verboselog(*this, 9, "(DRM1) %08X -> %08X\n", 0xE0570000 + (offset << 2), data); return data; } @@ -806,7 +806,7 @@ WRITE32_MEMBER( cxhumax_state::cx_drm1_w ) READ32_MEMBER( cxhumax_state::cx_hdmi_r ) { - UINT32 data = m_hdmi_regs[offset]; + uint32_t data = m_hdmi_regs[offset]; verboselog(*this, 9, "(HDMI) %08X -> %08X\n", 0xE05D0800 + (offset << 2), data); return data; } @@ -835,12 +835,12 @@ void cxhumax_state::video_start() The document also contains the constants below as floats. --------------------------------------------------------------------------*/ -static inline UINT8 clamp16_shift8(UINT32 x) +static inline uint8_t clamp16_shift8(uint32_t x) { - return (((INT32) x < 0) ? 0 : (x > 65535 ? 255: x >> 8)); + return (((int32_t) x < 0) ? 0 : (x > 65535 ? 255: x >> 8)); } -static inline UINT32 ycc_to_rgb(UINT32 ycc) +static inline uint32_t ycc_to_rgb(uint32_t ycc) { /* original equations: @@ -877,10 +877,10 @@ static inline UINT32 ycc_to_rgb(UINT32 ycc) B = clip(( common + 516 * Cb - 13696) >> 8) */ - UINT8 y = ycc; - UINT8 cb = ycc >> 8; - UINT8 cr = ycc >> 16; - UINT32 r, g, b, common; + uint8_t y = ycc; + uint8_t cb = ycc >> 8; + uint8_t cr = ycc >> 16; + uint32_t r, g, b, common; common = 298 * y - 56992; r = (common + 409 * cr); @@ -891,41 +891,41 @@ static inline UINT32 ycc_to_rgb(UINT32 ycc) return rgb_t(clamp16_shift8(r), clamp16_shift8(g), clamp16_shift8(b)); } -UINT32 cxhumax_state::screen_update_cxhumax(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t cxhumax_state::screen_update_cxhumax(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int i, j; - UINT32 osd_pointer = m_drm1_regs[DRM_OSD_PTR_REG]; + uint32_t osd_pointer = m_drm1_regs[DRM_OSD_PTR_REG]; if(osd_pointer) { - UINT32 *ram = m_ram; - UINT32 *osd_header = &ram[osd_pointer/4]; - UINT8 *vbuf = (UINT8*)(&ram[osd_header[3]/4]); - UINT32 *palette = &ram[osd_header[7]/4]; + uint32_t *ram = m_ram; + uint32_t *osd_header = &ram[osd_pointer/4]; + uint8_t *vbuf = (uint8_t*)(&ram[osd_header[3]/4]); + uint32_t *palette = &ram[osd_header[7]/4]; - UINT32 x_disp_start_and_width = osd_header[1]; - UINT32 xdisp_width = (x_disp_start_and_width >> 16) & 0x1fff; - UINT32 xdisp_start = x_disp_start_and_width & 0xfff; + uint32_t x_disp_start_and_width = osd_header[1]; + uint32_t xdisp_width = (x_disp_start_and_width >> 16) & 0x1fff; + uint32_t xdisp_start = x_disp_start_and_width & 0xfff; - UINT32 image_height_and_width = osd_header[2]; - UINT32 yimg_height = (image_height_and_width >> 16) & 0x7ff; - UINT32 ximg_width = image_height_and_width & 0x7ff; + uint32_t image_height_and_width = osd_header[2]; + uint32_t yimg_height = (image_height_and_width >> 16) & 0x7ff; + uint32_t ximg_width = image_height_and_width & 0x7ff; - UINT32 y_position_and_region_alpha = osd_header[5]; - UINT32 ydisp_last = (y_position_and_region_alpha >> 12) & 0x7ff; - UINT32 ydisp_start = y_position_and_region_alpha & 0x7ff; + uint32_t y_position_and_region_alpha = osd_header[5]; + uint32_t ydisp_last = (y_position_and_region_alpha >> 12) & 0x7ff; + uint32_t ydisp_start = y_position_and_region_alpha & 0x7ff; - /* UINT32 first_x = m_drm0_regs[DRM_ACTIVE_X_REG] & 0xffff; - UINT32 last_x = (m_drm0_regs[DRM_ACTIVE_X_REG] >> 16) & 0xffff; + /* uint32_t first_x = m_drm0_regs[DRM_ACTIVE_X_REG] & 0xffff; + uint32_t last_x = (m_drm0_regs[DRM_ACTIVE_X_REG] >> 16) & 0xffff; - UINT32 first_y = m_drm0_regs[DRM_ACTIVE_Y_REG] & 0xfff; - UINT32 last_y = (m_drm0_regs[DRM_ACTIVE_Y_REG] >> 16) & 0xfff;*/ + uint32_t first_y = m_drm0_regs[DRM_ACTIVE_Y_REG] & 0xfff; + uint32_t last_y = (m_drm0_regs[DRM_ACTIVE_Y_REG] >> 16) & 0xfff;*/ for (j=ydisp_start; j <= ydisp_last; j++) { - UINT32 *bmp = &bitmap.pix32(j); + uint32_t *bmp = &bitmap.pix32(j); for (i=xdisp_start; i <= (xdisp_start + xdisp_width); i++) { @@ -993,7 +993,7 @@ void cxhumax_state::machine_reset() m_i2c0_regs[0x08/4] = 0x08; // SDA high m_i2c2_regs[0x08/4] = 0x08; // SDA high - UINT8* FLASH = memregion("flash")->base(); + uint8_t* FLASH = memregion("flash")->base(); memcpy(m_ram,FLASH,0x400000); m_chipcontrol_regs[PIN_CONFIG_0_REG] = diff --git a/src/mame/drivers/cybertnk.cpp b/src/mame/drivers/cybertnk.cpp index 2f409ff1665..aaa7d82eddc 100644 --- a/src/mame/drivers/cybertnk.cpp +++ b/src/mame/drivers/cybertnk.cpp @@ -202,14 +202,14 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_spr_ram; - required_shared_ptr m_tilemap0_vram; - required_shared_ptr m_tilemap1_vram; - required_shared_ptr m_tilemap2_vram; - required_shared_ptr m_tilemap0scroll; - required_shared_ptr m_tilemap1scroll; - required_shared_ptr m_tilemap2scroll; - required_shared_ptr m_roadram; + required_shared_ptr m_spr_ram; + required_shared_ptr m_tilemap0_vram; + required_shared_ptr m_tilemap1_vram; + required_shared_ptr m_tilemap2_vram; + required_shared_ptr m_tilemap0scroll; + required_shared_ptr m_tilemap1scroll; + required_shared_ptr m_tilemap2scroll; + required_shared_ptr m_roadram; tilemap_t *m_tilemap0_tilemap; tilemap_t *m_tilemap1_tilemap; @@ -219,7 +219,7 @@ public: DECLARE_WRITE16_MEMBER(tilemap1_vram_w); DECLARE_WRITE16_MEMBER(tilemap2_vram_w); - UINT8 m_mux_data; + uint8_t m_mux_data; DECLARE_WRITE8_MEMBER(cybertnk_sound_cmd_w); DECLARE_WRITE8_MEMBER(cybertnk_mux_w); DECLARE_READ8_MEMBER(cybertnk_io_rdy_r); @@ -233,9 +233,9 @@ public: virtual void video_start() override; void draw_road(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int screen_shift, int pri); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int screen_shift); - UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int screen_shift); - UINT32 screen_update_cybertnk_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cybertnk_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int screen_shift); + uint32_t screen_update_cybertnk_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cybertnk_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; /* tile format @@ -306,9 +306,9 @@ void cybertnk_state::draw_road(screen_device &screen, bitmap_ind16 &bitmap, cons for (int i = 0; i < 0x1000/4; i+=4) { - UINT16 param1 = m_roadram[i+2]; - UINT16 param2 = m_roadram[i+1]; - UINT16 param3 = m_roadram[i+0]; + uint16_t param1 = m_roadram[i+2]; + uint16_t param2 = m_roadram[i+1]; + uint16_t param3 = m_roadram[i+0]; int col = (param2 & 0x3f); @@ -325,14 +325,14 @@ void cybertnk_state::draw_road(screen_device &screen, bitmap_ind16 &bitmap, cons // check if these are similar / the same as weclemans void cybertnk_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int screen_shift) { - const UINT32 *sprrom = (UINT32*)memregion("spr_gfx")->base(); + const uint32_t *sprrom = (uint32_t*)memregion("spr_gfx")->base(); const pen_t *paldata = m_palette->pens(); int miny = cliprect.min_y; int maxy = cliprect.max_y; int minx = cliprect.min_x; int maxx = cliprect.max_x; - UINT16* dest; + uint16_t* dest; /* @@ -368,7 +368,7 @@ void cybertnk_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, c if (y&0x100) y-=0x200; - UINT32 spr_offs = (((m_spr_ram[offs+0x0] & 7) << 16) | (m_spr_ram[offs+0x1])); + uint32_t spr_offs = (((m_spr_ram[offs+0x0] & 7) << 16) | (m_spr_ram[offs+0x1])); int xsize = ((m_spr_ram[offs+0x6] & 0x000f)+1) << 3; int ysize = (m_spr_ram[offs+0x4] & 0x00ff)+1; int fx = (m_spr_ram[offs+0x5] & 0x8000) >> 15; @@ -410,11 +410,11 @@ void cybertnk_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, c for(int xi=start;xi != end;xi+=inc) { // start x loop - UINT32 color; + uint32_t color; color = sprrom[spr_offs+xi/8]; - UINT16 dot; + uint16_t dot; int x_dec; //helpers int shift_pen = 0; @@ -475,7 +475,7 @@ void cybertnk_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, c } -UINT32 cybertnk_state::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int screen_shift) +uint32_t cybertnk_state::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int screen_shift) { m_tilemap0_tilemap->set_scrolldx(screen_shift, screen_shift); m_tilemap1_tilemap->set_scrolldx(screen_shift, screen_shift); @@ -507,8 +507,8 @@ UINT32 cybertnk_state::update_screen(screen_device &screen, bitmap_ind16 &bitmap return 0; } -UINT32 cybertnk_state::screen_update_cybertnk_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 0); } -UINT32 cybertnk_state::screen_update_cybertnk_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, -256); } +uint32_t cybertnk_state::screen_update_cybertnk_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 0); } +uint32_t cybertnk_state::screen_update_cybertnk_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, -256); } WRITE16_MEMBER(cybertnk_state::tilemap0_vram_w) @@ -797,7 +797,7 @@ static const gfx_layout tile_8x8x4 = 8*8 }; -static const UINT32 xoffsets[] = { STEP1024(0,4) }; +static const uint32_t xoffsets[] = { STEP1024(0,4) }; static const gfx_layout roadlayout = { 1024,1, @@ -973,7 +973,7 @@ ROM_END DRIVER_INIT_MEMBER(cybertnk_state,cybertnk) { - UINT32 *spr = (UINT32*)memregion("spr_gfx")->base(); + uint32_t *spr = (uint32_t*)memregion("spr_gfx")->base(); for (int x = 0; x< 0x200000/4;x++) { diff --git a/src/mame/drivers/cyclemb.cpp b/src/mame/drivers/cyclemb.cpp index fed5bf963b2..9365e2b0b72 100644 --- a/src/mame/drivers/cyclemb.cpp +++ b/src/mame/drivers/cyclemb.cpp @@ -101,22 +101,22 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_vram; - required_shared_ptr m_cram; - required_shared_ptr m_obj1_ram; - required_shared_ptr m_obj2_ram; - required_shared_ptr m_obj3_ram; + required_shared_ptr m_vram; + required_shared_ptr m_cram; + required_shared_ptr m_obj1_ram; + required_shared_ptr m_obj2_ram; + required_shared_ptr m_obj3_ram; struct { - UINT8 rxd; - UINT8 txd; - UINT8 rst; - UINT8 state; - UINT8 packet_type; + uint8_t rxd; + uint8_t txd; + uint8_t rst; + uint8_t state; + uint8_t packet_type; } m_mcu[2]; - UINT16 m_dsw_pc_hack; + uint16_t m_dsw_pc_hack; DECLARE_WRITE8_MEMBER(cyclemb_bankswitch_w); // DECLARE_READ8_MEMBER(mcu_status_r); @@ -131,8 +131,8 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(cyclemb); - UINT32 screen_update_cyclemb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_skydest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cyclemb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_skydest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void cyclemb_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void cyclemb_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -144,7 +144,7 @@ public: PALETTE_INIT_MEMBER(cyclemb_state, cyclemb) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i,r,g,b,val; int bit0,bit1,bit2; @@ -221,9 +221,9 @@ void cyclemb_state::cyclemb_draw_tilemap(screen_device &screen, bitmap_ind16 &bi */ void cyclemb_state::cyclemb_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 col,fx,fy,region; - UINT16 spr_offs,i; - INT16 x,y; + uint8_t col,fx,fy,region; + uint16_t spr_offs,i; + int16_t x,y; /* 0x3b-0x3c-0x3d tire (0x13 0x00 / 0x17 0x00 ) @@ -321,9 +321,9 @@ void cyclemb_state::skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bi void cyclemb_state::skydest_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 col,fx,fy,region; - UINT16 spr_offs,i; - INT16 x,y; + uint8_t col,fx,fy,region; + uint16_t spr_offs,i; + int16_t x,y; // popmessage("%d %d",m_obj2_ram[0x0d], 0xf1 - m_obj2_ram[0x0c+1] + 68); @@ -361,14 +361,14 @@ void cyclemb_state::skydest_draw_sprites(screen_device &screen, bitmap_ind16 &bi } } -UINT32 cyclemb_state::screen_update_cyclemb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cyclemb_state::screen_update_cyclemb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { cyclemb_draw_tilemap(screen,bitmap,cliprect); cyclemb_draw_sprites(screen,bitmap,cliprect); return 0; } -UINT32 cyclemb_state::screen_update_skydest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cyclemb_state::screen_update_skydest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); @@ -430,7 +430,7 @@ READ8_MEMBER( cyclemb_state::skydest_i8741_0_r ) } else { - UINT8 i,pt; + uint8_t i,pt; //printf("%04x\n",m_maincpu->pc()); diff --git a/src/mame/drivers/czk80.cpp b/src/mame/drivers/czk80.cpp index ba528e1b833..af850bfa7d1 100644 --- a/src/mame/drivers/czk80.cpp +++ b/src/mame/drivers/czk80.cpp @@ -74,7 +74,7 @@ public: DECLARE_WRITE_LINE_MEMBER(ctc_z1_w); DECLARE_WRITE_LINE_MEMBER(ctc_z2_w); private: - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; required_device m_terminal; required_device m_fdc; @@ -88,7 +88,7 @@ WRITE8_MEMBER( czk80_state::port40_w ) READ8_MEMBER( czk80_state::port80_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -168,7 +168,7 @@ MACHINE_RESET_MEMBER( czk80_state, czk80 ) DRIVER_INIT_MEMBER( czk80_state, czk80 ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x10000]); diff --git a/src/mame/drivers/d6800.cpp b/src/mame/drivers/d6800.cpp index 3302f68dbc8..800d7c4a4c5 100644 --- a/src/mame/drivers/d6800.cpp +++ b/src/mame/drivers/d6800.cpp @@ -72,7 +72,7 @@ public: DECLARE_READ8_MEMBER( d6800_keyboard_r ); DECLARE_WRITE8_MEMBER( d6800_keyboard_w ); DECLARE_WRITE_LINE_MEMBER( d6800_screen_w ); - UINT32 screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(d6800_c); TIMER_DEVICE_CALLBACK_MEMBER(d6800_p); DECLARE_QUICKLOAD_LOAD_MEMBER( d6800 ); @@ -81,7 +81,7 @@ protected: required_device m_cass; required_device m_pia; required_device m_beeper; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_ioport m_io_x0; required_ioport m_io_x1; required_ioport m_io_x2; @@ -92,11 +92,11 @@ protected: required_ioport m_io_y3; required_ioport m_io_shift; private: - UINT8 m_rtc; + uint8_t m_rtc; bool m_cb2; bool m_cassold; - UINT8 m_cass_data[4]; - UINT8 m_portb; + uint8_t m_cass_data[4]; + uint8_t m_portb; virtual void machine_start() override; virtual void machine_reset() override; }; @@ -181,13 +181,13 @@ INPUT_PORTS_END /* Video */ -UINT32 d6800_state::screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t d6800_state::screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 x,y,gfx=0; + uint8_t x,y,gfx=0; for (y = 0; y < 32; y++) { - UINT16 *p = &bitmap.pix16(y); + uint16_t *p = &bitmap.pix16(y); for (x = 0; x < 8; x++) { @@ -233,7 +233,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(d6800_state::d6800_p) if (m_rtc > 159) m_rtc = 0; - UINT8 data = m_io_x0->read() & m_io_x1->read() & m_io_x2->read() & m_io_x3->read(); + uint8_t data = m_io_x0->read() & m_io_x1->read() & m_io_x2->read() & m_io_x3->read(); int ca1 = (data == 255) ? 0 : 1; int ca2 = m_io_shift->read(); int cb1 = (m_rtc) ? 1 : 0; @@ -244,7 +244,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(d6800_state::d6800_p) /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -294,7 +294,7 @@ READ8_MEMBER( d6800_state::d6800_keyboard_r ) lines around and reads it another way. This isolates the key that was pressed. */ - UINT8 data = m_io_x0->read() & m_io_x1->read() & m_io_x2->read() & m_io_x3->read() + uint8_t data = m_io_x0->read() & m_io_x1->read() & m_io_x2->read() & m_io_x3->read() & m_io_y0->read() & m_io_y1->read() & m_io_y2->read() & m_io_y3->read(); return data; @@ -344,7 +344,7 @@ QUICKLOAD_LOAD_MEMBER( d6800_state, d6800 ) int quick_addr = 0x200; int exec_addr = 0xc000; int quick_length; - std::vector quick_data; + std::vector quick_data; int read_; image_init_result result = image_init_result::FAIL; diff --git a/src/mame/drivers/d6809.cpp b/src/mame/drivers/d6809.cpp index 9e17ac72fdf..1453f89bcef 100644 --- a/src/mame/drivers/d6809.cpp +++ b/src/mame/drivers/d6809.cpp @@ -103,13 +103,13 @@ public: DECLARE_WRITE8_MEMBER( kbd_put ); DECLARE_READ8_MEMBER( term_r ); DECLARE_WRITE8_MEMBER( term_w ); - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; }; READ8_MEMBER( d6809_state::term_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/d9final.cpp b/src/mame/drivers/d9final.cpp index 9c4c3011d9f..201d9ddb267 100644 --- a/src/mame/drivers/d9final.cpp +++ b/src/mame/drivers/d9final.cpp @@ -40,9 +40,9 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_lo_vram; - required_shared_ptr m_hi_vram; - required_shared_ptr m_cram; + required_shared_ptr m_lo_vram; + required_shared_ptr m_hi_vram; + required_shared_ptr m_cram; tilemap_t *m_sc0_tilemap; @@ -57,7 +57,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); }; @@ -78,7 +78,7 @@ void d9final_state::video_start() m_sc0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(d9final_state::get_sc0_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32); } -UINT32 d9final_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t d9final_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0); return 0; diff --git a/src/mame/drivers/dacholer.cpp b/src/mame/drivers/dacholer.cpp index 7f0fbba2064..9dbf09247d1 100644 --- a/src/mame/drivers/dacholer.cpp +++ b/src/mame/drivers/dacholer.cpp @@ -63,23 +63,23 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_bgvideoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; int m_bg_bank; - UINT8 m_scroll_x; - UINT8 m_scroll_y; + uint8_t m_scroll_x; + uint8_t m_scroll_y; /* sound-related */ int m_msm_data; int m_msm_toggle; - UINT8 m_snd_interrupt_enable; - UINT8 m_music_interrupt_enable; - UINT8 m_snd_ack; + uint8_t m_snd_interrupt_enable; + uint8_t m_music_interrupt_enable; + uint8_t m_snd_ack; DECLARE_WRITE8_MEMBER(bg_scroll_x_w); DECLARE_WRITE8_MEMBER(bg_scroll_y_w); @@ -100,7 +100,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(dacholer); - UINT32 screen_update_dacholer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dacholer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sound_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); DECLARE_WRITE_LINE_MEMBER(adpcm_int); @@ -165,7 +165,7 @@ void dacholer_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre } } -UINT32 dacholer_state::screen_update_dacholer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dacholer_state::screen_update_dacholer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (flip_screen()) { @@ -607,7 +607,7 @@ void dacholer_state::machine_reset() /* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */ PALETTE_INIT_MEMBER(dacholer_state, dacholer) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); static const int resistances_rg[3] = { 1000, 470, 220 }; static const int resistances_b [2] = { 470, 220 }; double weights_rg[3], weights_b[2]; diff --git a/src/mame/drivers/dai3wksi.cpp b/src/mame/drivers/dai3wksi.cpp index 879163b3fb9..a068d5722c9 100644 --- a/src/mame/drivers/dai3wksi.cpp +++ b/src/mame/drivers/dai3wksi.cpp @@ -73,15 +73,15 @@ public: required_device m_palette; /* video */ - required_shared_ptr m_dai3wksi_videoram; + required_shared_ptr m_dai3wksi_videoram; int m_dai3wksi_flipscreen; int m_dai3wksi_redscreen; int m_dai3wksi_redterop; - UINT32 screen_update_dai3wksi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dai3wksi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); /* sound */ - UINT8 m_port_last1; - UINT8 m_port_last2; + uint8_t m_port_last1; + uint8_t m_port_last2; int m_enabled_sound; int m_sound3_counter; DECLARE_WRITE8_MEMBER(dai3wksi_audio_1_w); @@ -102,7 +102,7 @@ public: * *************************************/ -static const UINT8 vr_prom1[64*8*2]={ +static const uint8_t vr_prom1[64*8*2]={ 6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 3,3,3,3,3,3,3,3, 5,5,5,5,5,5,5,5, 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,4,4,4,4,4, 6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 3,3,3,3,3,3,3,3, 5,5,5,5,5,5,5,5, 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,4,4,4,4,4, 6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 3,3,3,3,3,3,3,3, 5,5,5,5,5,5,5,5, 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,4,4,4,4,4, @@ -122,7 +122,7 @@ static const UINT8 vr_prom1[64*8*2]={ 3, 3,3,2,2,6,6,6,6, 6,6,6,6,6,6,6,6, 3,3,3,3,3,3,3,3, 5,5,5,5,5,5,5,5, 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,4,4,4,4,4, }; -static const UINT8 vr_prom2[64*8*2]={ +static const uint8_t vr_prom2[64*8*2]={ 6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 3,3,3,3,3,3,3,3, 7,7,7,7,7,7,7,7, 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,4,4,4,4,4, 6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 3,3,3,3,3,3,3,3, 7,7,7,7,7,7,7,7, 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,4,4,4,4,4, 6, 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, 3,3,3,3,3,3,3,3, 7,7,7,7,7,7,7,7, 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,4,4,4,4,4, @@ -142,14 +142,14 @@ static const UINT8 vr_prom2[64*8*2]={ 3, 3,3,2,2,6,6,6,6, 6,6,6,6,6,6,6,6, 3,3,3,3,3,3,3,3, 7,7,7,7,7,7,7,7, 3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2, 6,6,6,6,6,6,6,6, 4,4,4,4,4,4,4, }; -UINT32 dai3wksi_state::screen_update_dai3wksi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t dai3wksi_state::screen_update_dai3wksi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (offs_t offs = 0; offs < m_dai3wksi_videoram.bytes(); offs++) { - UINT8 x = offs << 2; - UINT8 y = offs >> 6; - UINT8 data = m_dai3wksi_videoram[offs]; - UINT8 color; + uint8_t x = offs << 2; + uint8_t y = offs >> 6; + uint8_t data = m_dai3wksi_videoram[offs]; + uint8_t color; int value = (x >> 2) + ((y >> 5) << 6) + 64 * 8 * (m_dai3wksi_redterop ? 1 : 0); if (m_dai3wksi_redscreen) @@ -207,7 +207,7 @@ UINT32 dai3wksi_state::screen_update_dai3wksi(screen_device &screen, bitmap_rgb3 #if (USE_SAMPLES) WRITE8_MEMBER(dai3wksi_state::dai3wksi_audio_1_w) { - UINT8 rising_bits = data & ~m_port_last1; + uint8_t rising_bits = data & ~m_port_last1; m_enabled_sound = data & 0x80; @@ -226,7 +226,7 @@ WRITE8_MEMBER(dai3wksi_state::dai3wksi_audio_1_w) WRITE8_MEMBER(dai3wksi_state::dai3wksi_audio_2_w) { - UINT8 rising_bits = data & ~m_port_last2; + uint8_t rising_bits = data & ~m_port_last2; m_dai3wksi_flipscreen = data & 0x10; m_dai3wksi_redscreen = ~data & 0x20; diff --git a/src/mame/drivers/dambustr.cpp b/src/mame/drivers/dambustr.cpp index 28a83d5231a..73b83e92ffd 100644 --- a/src/mame/drivers/dambustr.cpp +++ b/src/mame/drivers/dambustr.cpp @@ -213,9 +213,9 @@ DRIVER_INIT_MEMBER(dambustr_state,dambustr) { int i, j, tmp; int tmpram[16]; - UINT8 *rom = memregion("maincpu")->base(); - UINT8 *usr = memregion("user1")->base(); - UINT8 *gfx = memregion("gfx1")->base(); + uint8_t *rom = memregion("maincpu")->base(); + uint8_t *usr = memregion("user1")->base(); + uint8_t *gfx = memregion("gfx1")->base(); // Bit swap addresses for(i=0; i<4096*4; i++) { diff --git a/src/mame/drivers/darkmist.cpp b/src/mame/drivers/darkmist.cpp index 9d71fa75ee8..20d6cc2dcbf 100644 --- a/src/mame/drivers/darkmist.cpp +++ b/src/mame/drivers/darkmist.cpp @@ -323,9 +323,9 @@ ROM_END -void darkmist_state::decrypt_fgbgtiles(UINT8* rom, int size) +void darkmist_state::decrypt_fgbgtiles(uint8_t* rom, int size) { - std::vector buf(0x40000); + std::vector buf(0x40000); /* data lines */ for (int i = 0;i < size/2;i++) { @@ -350,8 +350,8 @@ void darkmist_state::decrypt_fgbgtiles(UINT8* rom, int size) void darkmist_state::decrypt_gfx() { - std::vector buf(0x40000); - UINT8 *rom; + std::vector buf(0x40000); + uint8_t *rom; int size; int i; @@ -406,7 +406,7 @@ void darkmist_state::decrypt_gfx() void darkmist_state::decrypt_snd() { - UINT8 *ROM = memregion("t5182_z80")->base(); + uint8_t *ROM = memregion("t5182_z80")->base(); for (int i = 0x0000; i < 0x8000; i++) ROM[i] = BITSWAP8(ROM[i], 7, 1, 2, 3, 4, 5, 6, 0); @@ -415,8 +415,8 @@ void darkmist_state::decrypt_snd() DRIVER_INIT_MEMBER(darkmist_state,darkmist) { int i, len; - UINT8 *ROM = memregion("maincpu")->base(); - std::vector buffer(0x10000); + uint8_t *ROM = memregion("maincpu")->base(); + std::vector buffer(0x10000); decrypt_gfx(); @@ -424,7 +424,7 @@ DRIVER_INIT_MEMBER(darkmist_state,darkmist) for(i=0;i<0x8000;i++) { - UINT8 p, d; + uint8_t p, d; p = d = ROM[i]; if(((i & 0x20) == 0x00) && ((i & 0x8) != 0)) diff --git a/src/mame/drivers/darkseal.cpp b/src/mame/drivers/darkseal.cpp index a212f36c041..ddf00ff9679 100644 --- a/src/mame/drivers/darkseal.cpp +++ b/src/mame/drivers/darkseal.cpp @@ -460,7 +460,7 @@ ROM_END DRIVER_INIT_MEMBER(darkseal_state,darkseal) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); int i; for (i=0x00000; i<0x80000; i++) diff --git a/src/mame/drivers/dassault.cpp b/src/mame/drivers/dassault.cpp index 1e76ca2249f..0758844c80c 100644 --- a/src/mame/drivers/dassault.cpp +++ b/src/mame/drivers/dassault.cpp @@ -1048,9 +1048,9 @@ ROM_END DRIVER_INIT_MEMBER(dassault_state,dassault) { - const UINT8 *src = memregion("gfx1")->base(); - UINT8 *dst = memregion("gfx2")->base(); - std::vector tmp(0x80000); + const uint8_t *src = memregion("gfx1")->base(); + uint8_t *dst = memregion("gfx2")->base(); + std::vector tmp(0x80000); /* Playfield 4 also has access to the char graphics, make things easier by just copying the chars to both banks (if I just used a different gfx @@ -1063,9 +1063,9 @@ DRIVER_INIT_MEMBER(dassault_state,dassault) DRIVER_INIT_MEMBER(dassault_state,thndzone) { - const UINT8 *src = memregion("gfx1")->base(); - UINT8 *dst = memregion("gfx2")->base(); - std::vector tmp(0x80000); + const uint8_t *src = memregion("gfx1")->base(); + uint8_t *dst = memregion("gfx2")->base(); + std::vector tmp(0x80000); /* Playfield 4 also has access to the char graphics, make things easier by just copying the chars to both banks (if I just used a different gfx diff --git a/src/mame/drivers/dblcrown.cpp b/src/mame/drivers/dblcrown.cpp index a251a42dcaa..257103cd97a 100644 --- a/src/mame/drivers/dblcrown.cpp +++ b/src/mame/drivers/dblcrown.cpp @@ -71,15 +71,15 @@ public: required_device m_palette; // screen updates - 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); - UINT8 m_bank; - UINT8 m_irq_src; - std::unique_ptr m_pal_ram; - std::unique_ptr m_vram; - UINT8 m_vram_bank[2]; - UINT8 m_mux_data; - UINT8 m_lamps_data; + uint8_t m_bank; + uint8_t m_irq_src; + std::unique_ptr m_pal_ram; + std::unique_ptr m_vram; + uint8_t m_vram_bank[2]; + uint8_t m_mux_data; + uint8_t m_lamps_data; DECLARE_READ8_MEMBER(bank_r); DECLARE_WRITE8_MEMBER(bank_w); @@ -113,13 +113,13 @@ protected: void dblcrown_state::video_start() { - m_pal_ram = std::make_unique(0x200 * 2); - m_vram = std::make_unique(0x1000 * 0x10); + m_pal_ram = std::make_unique(0x200 * 2); + m_vram = std::make_unique(0x1000 * 0x10); save_pointer(NAME(m_vram.get()), 0x1000 * 0x10); } -UINT32 dblcrown_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t dblcrown_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { gfx_element *gfx = m_gfxdecode->gfx(0); gfx_element *gfx_2 = m_gfxdecode->gfx(1); @@ -132,8 +132,8 @@ UINT32 dblcrown_state::screen_update( screen_device &screen, bitmap_ind16 &bitma { for (x = 0; x < 32; x++) { - UINT16 tile = ((m_vram[count]) | (m_vram[count+1] << 8)) & 0xfff; - UINT8 col = (m_vram[count+1] >> 4); + uint16_t tile = ((m_vram[count]) | (m_vram[count+1] << 8)) & 0xfff; + uint8_t col = (m_vram[count+1] >> 4); gfx_2->opaque(bitmap, cliprect, tile, col, 0, 0, x * 16, y * 16); @@ -147,8 +147,8 @@ UINT32 dblcrown_state::screen_update( screen_device &screen, bitmap_ind16 &bitma { for (x = 0; x < 64; x++) { - UINT16 tile = ((m_vram[count]) | (m_vram[count + 1] << 8)) & 0xfff; - UINT8 col = (m_vram[count + 1] >> 4); // ok? + uint16_t tile = ((m_vram[count]) | (m_vram[count + 1] << 8)) & 0xfff; + uint8_t col = (m_vram[count + 1] >> 4); // ok? gfx->transpen(bitmap, cliprect, tile, col, 0, 0, x * 8, y * 8, 0); @@ -210,7 +210,7 @@ WRITE8_MEMBER( dblcrown_state::palette_w) READ8_MEMBER( dblcrown_state::vram_r) { - UINT32 hi_offs; + uint32_t hi_offs; hi_offs = m_vram_bank[(offset & 0x1000) >> 12] << 12; return m_vram[(offset & 0xfff) | hi_offs]; @@ -218,14 +218,14 @@ READ8_MEMBER( dblcrown_state::vram_r) WRITE8_MEMBER( dblcrown_state::vram_w) { - UINT32 hi_offs; + uint32_t hi_offs; hi_offs = m_vram_bank[(offset & 0x1000) >> 12] << 12; m_vram[(offset & 0xfff) | hi_offs] = data; #ifdef DEBUG_VRAM { - UINT8 *VRAM = memregion("vram")->base(); + uint8_t *VRAM = memregion("vram")->base(); VRAM[(offset & 0xfff) | hi_offs] = data; m_gfxdecode->gfx(0)->mark_dirty(((offset & 0xfff) | hi_offs) / 32); @@ -260,7 +260,7 @@ READ8_MEMBER( dblcrown_state::in_mux_r ) { const char *const muxnames[] = { "IN0", "IN1", "IN2", "IN3" }; int i; - UINT8 res; + uint8_t res; res = 0; @@ -277,7 +277,7 @@ READ8_MEMBER( dblcrown_state::in_mux_type_r ) { const char *const muxnames[] = { "IN0", "IN1", "IN2", "IN3" }; int i; - UINT8 res; + uint8_t res; res = 0xff; @@ -555,7 +555,7 @@ GFXDECODE_END void dblcrown_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("rom_bank")->configure_entries(0, 0x20, &ROM[0], 0x2000); } diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp index 8b842da4a03..ce68c5e7336 100644 --- a/src/mame/drivers/dblewing.cpp +++ b/src/mame/drivers/dblewing.cpp @@ -96,13 +96,13 @@ public: { } /* memory pointers */ - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; - required_shared_ptr m_spriteram; - required_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_decrypted_opcodes; /* misc */ - UINT8 m_sound_irq; + uint8_t m_sound_irq; /* devices */ required_device m_maincpu; @@ -117,21 +117,21 @@ public: DECLARE_DRIVER_INIT(dblewing); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECO16IC_BANK_CB_MEMBER(bank_callback); DECOSPR_PRIORITY_CB_MEMBER(pri_callback); - void dblewing_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ); + void dblewing_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ); READ16_MEMBER( wf_protection_region_0_104_r ); WRITE16_MEMBER( wf_protection_region_0_104_w ); }; -UINT32 dblewing_state::screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dblewing_state::screen_update_dblewing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &space = generic_space(); - UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); @@ -149,8 +149,8 @@ READ16_MEMBER( dblewing_state::wf_protection_region_0_104_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco104->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco104->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -158,7 +158,7 @@ WRITE16_MEMBER( dblewing_state::wf_protection_region_0_104_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco104->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -358,7 +358,7 @@ void dblewing_state::machine_reset() m_sound_irq = 0; } -void dblewing_state::dblewing_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ) +void dblewing_state::dblewing_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ) { m_soundlatch->write(space, 0, data & 0xff); m_sound_irq |= 0x02; @@ -459,7 +459,7 @@ ROM_END DRIVER_INIT_MEMBER(dblewing_state,dblewing) { deco56_decrypt_gfx(machine(), "gfx1"); - deco102_decrypt_cpu((UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0x399d, 0x25, 0x3d); + deco102_decrypt_cpu((uint16_t *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0x399d, 0x25, 0x3d); } diff --git a/src/mame/drivers/dbz.cpp b/src/mame/drivers/dbz.cpp index 29f84dccbc6..18c8bf5bc77 100644 --- a/src/mame/drivers/dbz.cpp +++ b/src/mame/drivers/dbz.cpp @@ -493,9 +493,9 @@ ROM_END DRIVER_INIT_MEMBER(dbz_state,dbz) { - UINT16 *ROM; + uint16_t *ROM; - ROM = (UINT16 *)memregion("maincpu")->base(); + ROM = (uint16_t *)memregion("maincpu")->base(); // to avoid crash during loop at 0x00076e after D4 > 0x80 (reading tiles region out of bounds) ROM[0x76c/2] = 0x007f; /* 0x00ff */ @@ -526,9 +526,9 @@ DRIVER_INIT_MEMBER(dbz_state,dbz) DRIVER_INIT_MEMBER(dbz_state,dbza) { - UINT16 *ROM; + uint16_t *ROM; - ROM = (UINT16 *)memregion("maincpu")->base(); + ROM = (uint16_t *)memregion("maincpu")->base(); // nop out dbz1's mask rom test // tile ROM test @@ -549,9 +549,9 @@ DRIVER_INIT_MEMBER(dbz_state,dbza) DRIVER_INIT_MEMBER(dbz_state,dbz2) { - UINT16 *ROM; + uint16_t *ROM; - ROM = (UINT16 *)memregion("maincpu")->base(); + ROM = (uint16_t *)memregion("maincpu")->base(); // to avoid crash during loop at 0x000a4a after D4 > 0x80 (reading tiles region out of bounds) ROM[0xa48/2] = 0x007f; /* 0x00ff */ diff --git a/src/mame/drivers/dccons.cpp b/src/mame/drivers/dccons.cpp index ecc65bb70f2..2c8978833d8 100644 --- a/src/mame/drivers/dccons.cpp +++ b/src/mame/drivers/dccons.cpp @@ -313,7 +313,7 @@ DRIVER_INIT_MEMBER(dc_cons_state,dcjp) READ64_MEMBER(dc_cons_state::dc_pdtra_r ) { - UINT64 out = PCTRA<<32; + uint64_t out = PCTRA<<32; out |= PDTRA & ~0x0303; @@ -349,12 +349,12 @@ WRITE64_MEMBER(dc_cons_state::dc_pdtra_w ) READ64_MEMBER(dc_cons_state::dc_arm_r ) { - return *((UINT64 *)dc_sound_ram.target()+offset); + return *((uint64_t *)dc_sound_ram.target()+offset); } WRITE64_MEMBER(dc_cons_state::dc_arm_w ) { - COMBINE_DATA((UINT64 *)dc_sound_ram.target() + offset); + COMBINE_DATA((uint64_t *)dc_sound_ram.target() + offset); } #if 0 diff --git a/src/mame/drivers/dcheese.cpp b/src/mame/drivers/dcheese.cpp index f970b280065..2aad3a511de 100644 --- a/src/mame/drivers/dcheese.cpp +++ b/src/mame/drivers/dcheese.cpp @@ -160,7 +160,7 @@ READ8_MEMBER(dcheese_state::sound_status_r) WRITE8_MEMBER(dcheese_state::sound_control_w) { - UINT8 diff = data ^ m_sound_control; + uint8_t diff = data ^ m_sound_control; m_sound_control = data; /* bit 0x20 = LED */ diff --git a/src/mame/drivers/dcon.cpp b/src/mame/drivers/dcon.cpp index 371fb37f033..f0187883fd5 100644 --- a/src/mame/drivers/dcon.cpp +++ b/src/mame/drivers/dcon.cpp @@ -395,7 +395,7 @@ ROM_END /***************************************************************************/ DRIVER_INIT_MEMBER(dcon_state,sdgndmps) { - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); RAM[0x1356/2] = 0x4e71; /* beq -> nop */ RAM[0x1358/2] = 0x4e71; diff --git a/src/mame/drivers/dct11em.cpp b/src/mame/drivers/dct11em.cpp index a97bb28978b..3241d2ca7be 100644 --- a/src/mame/drivers/dct11em.cpp +++ b/src/mame/drivers/dct11em.cpp @@ -19,7 +19,7 @@ public: m_maincpu(*this, "maincpu") { } virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_dct11em(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dct11em(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -43,7 +43,7 @@ void dct11em_state::video_start() { } -UINT32 dct11em_state::screen_update_dct11em(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dct11em_state::screen_update_dct11em(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/ddayjlc.cpp b/src/mame/drivers/ddayjlc.cpp index e221d23e27b..916f7d981ea 100644 --- a/src/mame/drivers/ddayjlc.cpp +++ b/src/mame/drivers/ddayjlc.cpp @@ -75,22 +75,22 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_mainram; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_bgram; + required_shared_ptr m_mainram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_bgram; /* video-related */ tilemap_t *m_bg_tilemap; - INT32 m_char_bank; - INT32 m_bgadr; + int32_t m_char_bank; + int32_t m_bgadr; /* misc */ - INT32 m_sound_nmi_enable; - INT32 m_main_nmi_enable; - INT32 m_e00x_l[4]; - INT32 m_e00x_d[4][2]; - UINT8 m_prot_addr; + int32_t m_sound_nmi_enable; + int32_t m_main_nmi_enable; + int32_t m_e00x_l[4]; + int32_t m_e00x_d[4][2]; + uint8_t m_prot_addr; /* devices */ required_device m_maincpu; @@ -118,7 +118,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(ddayjlc); - UINT32 screen_update_ddayjlc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ddayjlc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ddayjlc_interrupt); INTERRUPT_GEN_MEMBER(ddayjlc_snd_interrupt); }; @@ -159,7 +159,7 @@ public: */ -static const UINT8 prot_data[0x10] = +static const uint8_t prot_data[0x10] = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x02, 0x00, @@ -242,10 +242,10 @@ WRITE8_MEMBER(ddayjlc_state::i8257_LMSR_w) { if (!data) { - INT32 src = m_e00x_d[0][1] * 256 + m_e00x_d[0][0]; - INT32 dst = m_e00x_d[2][1] * 256 + m_e00x_d[2][0]; - INT32 size = (m_e00x_d[1][1] * 256 + m_e00x_d[1][0]) & 0x3ff; - INT32 i; + int32_t src = m_e00x_d[0][1] * 256 + m_e00x_d[0][0]; + int32_t dst = m_e00x_d[2][1] * 256 + m_e00x_d[2][0]; + int32_t size = (m_e00x_d[1][1] * 256 + m_e00x_d[1][0]) & 0x3ff; + int32_t i; size++; //?? @@ -399,20 +399,20 @@ void ddayjlc_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(ddayjlc_state::get_tile_info_bg),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 ddayjlc_state::screen_update_ddayjlc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ddayjlc_state::screen_update_ddayjlc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT32 i; + uint32_t i; m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); for (i = 0; i < 0x400; i += 4) { - UINT8 flags = m_spriteram[i + 2]; - UINT8 y = 256 - m_spriteram[i + 0] - 8; - UINT16 code = m_spriteram[i + 1]; - UINT8 x = m_spriteram[i + 3] - 16; - UINT8 xflip = flags & 0x80; - UINT8 yflip = (code & 0x80); - UINT8 color = flags & 0xf; + uint8_t flags = m_spriteram[i + 2]; + uint8_t y = 256 - m_spriteram[i + 0] - 8; + uint16_t code = m_spriteram[i + 1]; + uint8_t x = m_spriteram[i + 3] - 16; + uint8_t xflip = flags & 0x80; + uint8_t yflip = (code & 0x80); + uint8_t color = flags & 0xf; code = (code & 0x7f) | ((flags & 0x30) << 3); @@ -420,7 +420,7 @@ UINT32 ddayjlc_state::screen_update_ddayjlc(screen_device &screen, bitmap_ind16 } { - UINT32 x, y, c; + uint32_t x, y, c; /* FIXME: where is/are the color offset(s)? I doubt it's hard-coded ... */ for (y = 0; y < 32; y++) for (x = 0; x < 32; x++) @@ -483,7 +483,7 @@ void ddayjlc_state::machine_reset() PALETTE_INIT_MEMBER(ddayjlc_state, ddayjlc) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i,r,g,b,val; int bit0,bit1,bit2; @@ -667,9 +667,9 @@ DRIVER_INIT_MEMBER(ddayjlc_state,ddayjlc) dst[newadr+31+n] = src[oldaddr+7+0x2008+n]; { - UINT32 oldaddr, newadr, length,j; - UINT8 *src, *dst; - std::vector temp(0x10000); + uint32_t oldaddr, newadr, length,j; + uint8_t *src, *dst; + std::vector temp(0x10000); src = &temp[0]; dst = memregion("gfx1")->base(); length = memregion("gfx1")->bytes(); diff --git a/src/mame/drivers/ddealer.cpp b/src/mame/drivers/ddealer.cpp index 7a608d111a1..dec791a4376 100644 --- a/src/mame/drivers/ddealer.cpp +++ b/src/mame/drivers/ddealer.cpp @@ -135,14 +135,14 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_vregs; - required_shared_ptr m_left_fg_vram_top; - required_shared_ptr m_right_fg_vram_top; - required_shared_ptr m_left_fg_vram_bottom; - required_shared_ptr m_right_fg_vram_bottom; - required_shared_ptr m_back_vram; - required_shared_ptr m_work_ram; - required_shared_ptr m_mcu_shared_ram; + required_shared_ptr m_vregs; + required_shared_ptr m_left_fg_vram_top; + required_shared_ptr m_right_fg_vram_top; + required_shared_ptr m_left_fg_vram_bottom; + required_shared_ptr m_right_fg_vram_bottom; + required_shared_ptr m_back_vram; + required_shared_ptr m_work_ram; + required_shared_ptr m_mcu_shared_ram; /* video-related */ tilemap_t *m_back_tilemap; @@ -150,8 +150,8 @@ public: int m_flipscreen; /* misc */ - UINT8 m_input_pressed; - UINT16 m_coin_input; + uint8_t m_input_pressed; + uint16_t m_coin_input; DECLARE_WRITE16_MEMBER(ddealer_flipscreen_w); DECLARE_WRITE16_MEMBER(back_vram_w); DECLARE_WRITE16_MEMBER(ddealer_vregs_w); @@ -162,13 +162,13 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_ddealer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ddealer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ddealer_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(ddealer_mcu_sim); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; - void ddealer_draw_video_layer( UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_ind16 &bitmap, const rectangle &cliprect, int flipy); + void ddealer_draw_video_layer( uint16_t* vreg_base, uint16_t* top, uint16_t* bottom, bitmap_ind16 &bitmap, const rectangle &cliprect, int flipy); }; @@ -193,13 +193,13 @@ void ddealer_state::video_start() m_back_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(ddealer_state::get_back_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 64, 32); } -void ddealer_state::ddealer_draw_video_layer( UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_ind16 &bitmap, const rectangle &cliprect, int flipy) +void ddealer_state::ddealer_draw_video_layer( uint16_t* vreg_base, uint16_t* top, uint16_t* bottom, bitmap_ind16 &bitmap, const rectangle &cliprect, int flipy) { gfx_element *gfx = m_gfxdecode->gfx(1); - INT16 sx, sy; + int16_t sx, sy; int x,y, count; - UINT16* src; + uint16_t* src; sx = ((vreg_base[0x4 / 2] & 0xff)); sx |= ((vreg_base[0x2 / 2] & 0xff) << 8); @@ -221,8 +221,8 @@ void ddealer_state::ddealer_draw_video_layer( UINT16* vreg_base, UINT16* top, UI { for (y = 0; y < 16; y++) { - UINT16 tile = (src[count] & 0x0fff); - UINT16 colr = (src[count] & 0xf000) >> 12; + uint16_t tile = (src[count] & 0x0fff); + uint16_t colr = (src[count] & 0xf000) >> 12; count++; gfx->transpen(bitmap,cliprect, tile, colr, 0, flipy, (x * 16) - sx, (y * 16) - sy, 15); } @@ -234,8 +234,8 @@ void ddealer_state::ddealer_draw_video_layer( UINT16* vreg_base, UINT16* top, UI { for (y = 0; y < 16; y++) { - UINT16 tile = (src[count] & 0x0fff); - UINT16 colr = (src[count] & 0xf000) >> 12; + uint16_t tile = (src[count] & 0x0fff); + uint16_t colr = (src[count] & 0xf000) >> 12; count++; gfx->transpen(bitmap,cliprect, tile, colr, 0, flipy, (x * 16) - sx, (y * 16) - sy, 15); } @@ -253,8 +253,8 @@ void ddealer_state::ddealer_draw_video_layer( UINT16* vreg_base, UINT16* top, UI { for (y = 16; y > 0; y--) { - UINT16 tile = (src[count] & 0x0fff); - UINT16 colr = (src[count] & 0xf000) >> 12; + uint16_t tile = (src[count] & 0x0fff); + uint16_t colr = (src[count] & 0xf000) >> 12; count++; gfx->transpen(bitmap,cliprect, tile, colr, flipy, flipy, (x * 16) + sx, (y * 16) + sy, 15); } @@ -266,8 +266,8 @@ void ddealer_state::ddealer_draw_video_layer( UINT16* vreg_base, UINT16* top, UI { for (y = 16; y > 0; y--) { - UINT16 tile = (src[count] & 0x0fff); - UINT16 colr = (src[count] & 0xf000) >> 12; + uint16_t tile = (src[count] & 0x0fff); + uint16_t colr = (src[count] & 0xf000) >> 12; count++; gfx->transpen(bitmap,cliprect, tile, colr, flipy, flipy, (x * 16) + sx, (y * 16) + sy, 15); } @@ -276,7 +276,7 @@ void ddealer_state::ddealer_draw_video_layer( UINT16* vreg_base, UINT16* top, UI } -UINT32 ddealer_state::screen_update_ddealer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ddealer_state::screen_update_ddealer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_back_tilemap->set_scrollx(0, m_flipscreen ? -192 : -64); m_back_tilemap->set_flip(m_flipscreen ? TILEMAP_FLIPY | TILEMAP_FLIPX : 0); diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp index d4b1134439a..7090c5351f9 100644 --- a/src/mame/drivers/ddenlovr.cpp +++ b/src/mame/drivers/ddenlovr.cpp @@ -165,13 +165,13 @@ public: m_soundlatch(*this, "soundlatch") { } - optional_shared_ptr m_dsw_sel16; - optional_shared_ptr m_protection1; - optional_shared_ptr m_protection2; + optional_shared_ptr m_dsw_sel16; + optional_shared_ptr m_protection1; + optional_shared_ptr m_protection2; optional_device m_soundlatch; - std::unique_ptr m_ddenlovr_pixmap[8]; + std::unique_ptr m_ddenlovr_pixmap[8]; /* blitter (TODO: merge with the dynax.h, where possible) */ int m_extra_layers; @@ -210,20 +210,20 @@ public: int m_ddenlovr_blit_regs[2]; /* ddenlovr misc (TODO: merge with dynax.h, where possible) */ - UINT8 m_palram[0x200]; + uint8_t m_palram[0x200]; int m_okibank; - UINT8 m_rongrong_blitter_busy_select; - UINT8 m_prot_val; - UINT16 m_prot_16; - UINT16 m_quiz365_protection[2]; - - UINT16 m_mmpanic_leds; /* A led for each of the 9 buttons */ - UINT8 m_funkyfig_lockout; - UINT8 m_romdata[2]; + uint8_t m_rongrong_blitter_busy_select; + uint8_t m_prot_val; + uint16_t m_prot_16; + uint16_t m_quiz365_protection[2]; + + uint16_t m_mmpanic_leds; /* A led for each of the 9 buttons */ + uint8_t m_funkyfig_lockout; + uint8_t m_romdata[2]; int m_palette_index; - UINT8 m_hginga_rombank; - UINT8 m_mjflove_irq_cause; - UINT8 m_daimyojn_palette_sel; + uint8_t m_hginga_rombank; + uint8_t m_mjflove_irq_cause; + uint8_t m_daimyojn_palette_sel; DECLARE_MACHINE_START(ddenlovr); DECLARE_MACHINE_RESET(ddenlovr); @@ -240,8 +240,8 @@ public: DECLARE_MACHINE_START(funkyfig); DECLARE_MACHINE_START(mjmyster); DECLARE_MACHINE_START(hparadis); - UINT32 screen_update_ddenlovr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_htengoku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ddenlovr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_htengoku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(quizchq_irq); INTERRUPT_GEN_MEMBER(mmpanic_irq); @@ -439,8 +439,8 @@ public: DECLARE_READ8_MEMBER( seljan2_dsw_r ); DECLARE_WRITE8_MEMBER( daimyojn_okibank_w ); - void ddenlovr_flipscreen_w( UINT8 data ); - void ddenlovr_blit_flip_w( UINT8 data ); + void ddenlovr_flipscreen_w( uint8_t data ); + void ddenlovr_blit_flip_w( uint8_t data ); void do_plot( int x, int y, int pen ); inline void log_draw_error( int src, int cmd ); int blit_draw( int src, int sx ); @@ -450,12 +450,12 @@ public: void blit_horiz_line(); void blit_vert_line(); inline void log_blit(int data ); - void blitter_w( address_space &space, int blitter, offs_t offset, UINT8 data, int irq_vector ); - void blitter_w_funkyfig(int blitter, offs_t offset, UINT8 data, int irq_vector ); + void blitter_w( address_space &space, int blitter, offs_t offset, uint8_t data, int irq_vector ); + void blitter_w_funkyfig(int blitter, offs_t offset, uint8_t data, int irq_vector ); void copylayer(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer ); void mmpanic_update_leds(); void mjchuuka_get_romdata(); - UINT8 hgokou_player_r( int player ); + uint8_t hgokou_player_r( int player ); }; VIDEO_START_MEMBER(ddenlovr_state,ddenlovr) @@ -464,7 +464,7 @@ VIDEO_START_MEMBER(ddenlovr_state,ddenlovr) for (i = 0; i < 8; i++) { - m_ddenlovr_pixmap[i] = std::make_unique(512 * 512); + m_ddenlovr_pixmap[i] = std::make_unique(512 * 512); m_ddenlovr_scroll[i * 2 + 0] = m_ddenlovr_scroll[i * 2 + 1] = 0; } @@ -577,12 +577,12 @@ VIDEO_START_MEMBER(ddenlovr_state,mjflove) m_ddenlovr_blit_commands = mjflove_commands; } -void ddenlovr_state::ddenlovr_flipscreen_w( UINT8 data ) +void ddenlovr_state::ddenlovr_flipscreen_w( uint8_t data ) { logerror("flipscreen = %02x (%s)\n", data, (data & 1) ? "off" : "on"); } -void ddenlovr_state::ddenlovr_blit_flip_w( UINT8 data ) +void ddenlovr_state::ddenlovr_blit_flip_w( uint8_t data ) { if ((data ^ m_ddenlovr_blit_flip) & 0xec) { @@ -689,7 +689,7 @@ void ddenlovr_state::do_plot( int x, int y, int pen ) } -static inline int fetch_bit( UINT8 *src_data, int src_len, int *bit_addr ) +static inline int fetch_bit( uint8_t *src_data, int src_len, int *bit_addr ) { const int baddrmask = 0x7ffffff; @@ -708,7 +708,7 @@ static inline int fetch_bit( UINT8 *src_data, int src_len, int *bit_addr ) return (src_data[baddr / 8] >> (7 - (baddr & 7))) & 1; } -static inline int fetch_word( UINT8 *src_data, int src_len, int *bit_addr, int word_len ) +static inline int fetch_word( uint8_t *src_data, int src_len, int *bit_addr, int word_len ) { int res = 0; @@ -742,7 +742,7 @@ inline void ddenlovr_state::log_draw_error( int src, int cmd ) int ddenlovr_state::blit_draw( int src, int sx ) { - UINT8 *src_data = memregion("blitter")->base(); + uint8_t *src_data = memregion("blitter")->base(); int src_len = memregion("blitter")->bytes(); int bit_addr = (src & 0xffffff) * m_ddenlovr_blit_rom_bits; /* convert to bit address */ int pen_size, arg_size, cmd; @@ -993,7 +993,7 @@ inline void ddenlovr_state::log_blit( int data ) #endif } -void ddenlovr_state::blitter_w( address_space &space, int blitter, offs_t offset, UINT8 data, int irq_vector ) +void ddenlovr_state::blitter_w( address_space &space, int blitter, offs_t offset, uint8_t data, int irq_vector ) { int hi_bits; @@ -1155,7 +1155,7 @@ g_profiler.stop(); // differences wrt blitter_data_w: slightly different blitter commands -void ddenlovr_state::blitter_w_funkyfig( int blitter, offs_t offset, UINT8 data, int irq_vector ) +void ddenlovr_state::blitter_w_funkyfig( int blitter, offs_t offset, uint8_t data, int irq_vector ) { int hi_bits; @@ -1537,7 +1537,7 @@ WRITE16_MEMBER(ddenlovr_state::ddenlovr_blitter_irq_ack_w) READ8_MEMBER(ddenlovr_state::rongrong_gfxrom_r) { - UINT8 *rom = memregion("blitter")->base(); + uint8_t *rom = memregion("blitter")->base(); size_t size = memregion("blitter")->bytes(); int address = m_ddenlovr_blit_address; @@ -1591,7 +1591,7 @@ void ddenlovr_state::copylayer(bitmap_ind16 &bitmap, const rectangle &cliprect, } } -UINT32 ddenlovr_state::screen_update_ddenlovr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ddenlovr_state::screen_update_ddenlovr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { static const int order[24][4] = { @@ -1608,7 +1608,7 @@ UINT32 ddenlovr_state::screen_update_ddenlovr(screen_device &screen, bitmap_ind1 #if 0 static int base = 0x0; - const UINT8 *gfx = memregion("blitter")->base(); + const uint8_t *gfx = memregion("blitter")->base(); int next; memset(m_ddenlovr_pixmap[0], 0, 512 * 512); memset(m_ddenlovr_pixmap[1], 0, 512 * 512); @@ -2004,7 +2004,7 @@ ADDRESS_MAP_END READ16_MEMBER(ddenlovr_state::ddenlovj_dsw_r) { - UINT16 dsw = 0; + uint16_t dsw = 0; if ((~*m_dsw_sel16) & 0x01) dsw |= ioport("DSW1")->read(); if ((~*m_dsw_sel16) & 0x02) dsw |= ioport("DSW2")->read(); if ((~*m_dsw_sel16) & 0x04) dsw |= ioport("DSW3")->read(); @@ -2698,7 +2698,7 @@ WRITE8_MEMBER(ddenlovr_state::hanakanz_dsw_w) READ8_MEMBER(ddenlovr_state::hanakanz_keyb_r) { - UINT8 val = 0xff; + uint8_t val = 0xff; if (!BIT(m_keyb, 0)) val = ioport(offset ? "KEY5" : "KEY0")->read(); else if (!BIT(m_keyb, 1)) val = ioport(offset ? "KEY6" : "KEY1")->read(); @@ -2727,7 +2727,7 @@ READ8_MEMBER(ddenlovr_state::hanakanz_busy_r) READ8_MEMBER(ddenlovr_state::hanakanz_gfxrom_r) { - UINT8 *rom = memregion("blitter")->base(); + uint8_t *rom = memregion("blitter")->base(); size_t size = memregion("blitter")->bytes(); int address = (m_ddenlovr_blit_address & 0xffffff) * 2; @@ -2927,7 +2927,7 @@ ADDRESS_MAP_END READ8_MEMBER(ddenlovr_state::mjchuuka_keyb_r) { - UINT8 val = 0xff; + uint8_t val = 0xff; if (!BIT(m_keyb, 0)) val = ioport(offset ? "KEY5" : "KEY0")->read(); else if (!BIT(m_keyb, 1)) val = ioport(offset ? "KEY6" : "KEY1")->read(); @@ -2951,7 +2951,7 @@ WRITE8_MEMBER(ddenlovr_state::mjchuuka_blitter_w) void ddenlovr_state::mjchuuka_get_romdata() { - UINT8 *rom = memregion("blitter")->base(); + uint8_t *rom = memregion("blitter")->base(); size_t size = memregion("blitter")->bytes(); int address = (m_ddenlovr_blit_address & 0xffffff) * 2; @@ -2979,7 +2979,7 @@ READ8_MEMBER(ddenlovr_state::mjchuuka_gfxrom_1_r) WRITE8_MEMBER(ddenlovr_state::mjchuuka_palette_w) { - UINT16 rgb = (offset & 0xff00) | data; + uint16_t rgb = (offset & 0xff00) | data; if (rgb & 0x8000) { @@ -3153,7 +3153,7 @@ READ8_MEMBER(ddenlovr_state::mjmyster_coins_r) READ8_MEMBER(ddenlovr_state::mjmyster_keyb_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; if (BIT(m_keyb, 0)) ret = ioport("KEY0")->read(); else if (BIT(m_keyb, 1)) ret = ioport("KEY1")->read(); @@ -3242,7 +3242,7 @@ WRITE8_MEMBER(ddenlovr_state::hginga_rombank_w) // similar to rongrong READ8_MEMBER(ddenlovr_state::hginga_protection_r) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); if (m_hginga_rombank & 0x10) return hanakanz_rand_r(space, 0); @@ -3402,9 +3402,9 @@ ADDRESS_MAP_END Hanafuda Hana Gokou ***************************************************************************/ -UINT8 ddenlovr_state::hgokou_player_r(int player ) +uint8_t ddenlovr_state::hgokou_player_r(int player ) { - UINT8 hopper_bit = ((m_hopper && !(m_screen->frame_number() % 10)) ? 0 : (1 << 6)); + uint8_t hopper_bit = ((m_hopper && !(m_screen->frame_number() % 10)) ? 0 : (1 << 6)); if (!BIT(m_input_sel, 0)) return ioport(player ? "KEY5" : "KEY0")->read() | hopper_bit; if (!BIT(m_input_sel, 1)) return ioport(player ? "KEY6" : "KEY1")->read() | hopper_bit; @@ -3463,7 +3463,7 @@ WRITE8_MEMBER(ddenlovr_state::hgokou_input_w) // similar to rongrong READ8_MEMBER(ddenlovr_state::hgokou_protection_r) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); if (m_hginga_rombank == 0) return hanakanz_rand_r(space, 0); @@ -3514,7 +3514,7 @@ ADDRESS_MAP_END READ8_MEMBER(ddenlovr_state::hgokbang_input_r) { - UINT8 ret; + uint8_t ret; switch (m_dsw_sel) { case 0x2d: @@ -3726,7 +3726,7 @@ READ16_MEMBER(ddenlovr_state::akamaru_protection2_r) READ16_MEMBER(ddenlovr_state::akamaru_dsw_r) { - UINT16 dsw = 0; + uint16_t dsw = 0; if (m_dsw_sel16[1] == 0xff) dsw |= ioport("DSW1")->read(); if (m_dsw_sel16[0] == 0xff) dsw |= ioport("DSW2")->read(); @@ -3812,7 +3812,7 @@ READ8_MEMBER(ddenlovr_state::mjflove_protection_r) READ8_MEMBER(ddenlovr_state::mjflove_keyb_r) { - UINT8 val = 0xff; + uint8_t val = 0xff; if (!BIT(m_keyb, 0)) val = ioport(offset ? "KEY5" : "KEY0")->read(); else if (!BIT(m_keyb, 1)) val = ioport(offset ? "KEY6" : "KEY1")->read(); @@ -3989,7 +3989,7 @@ ADDRESS_MAP_END READ8_MEMBER(ddenlovr_state::sryudens_keyb_r) { - UINT8 val = 0x3f; + uint8_t val = 0x3f; if (!BIT(m_keyb, 0)) val = ioport(offset ? "KEY5" : "KEY0")->read(); else if (!BIT(m_keyb, 1)) val = ioport(offset ? "KEY6" : "KEY1")->read(); @@ -4216,7 +4216,7 @@ VIDEO_START_MEMBER(ddenlovr_state,htengoku) VIDEO_START_CALL_MEMBER(hnoridur); } -UINT32 ddenlovr_state::screen_update_htengoku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ddenlovr_state::screen_update_htengoku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layer, x, y; @@ -4229,7 +4229,7 @@ UINT32 ddenlovr_state::screen_update_htengoku(screen_device &screen, bitmap_ind1 for (y = 0; y < 256; y++) for (x = 0; x < 512; x++) - m_ddenlovr_pixmap[3 - layer][y * 512 + x] = (UINT8)(bitmap.pix16(y, x)); + m_ddenlovr_pixmap[3 - layer][y * 512 + x] = (uint8_t)(bitmap.pix16(y, x)); } return screen_update_ddenlovr(screen, bitmap, cliprect); @@ -4237,7 +4237,7 @@ UINT32 ddenlovr_state::screen_update_htengoku(screen_device &screen, bitmap_ind1 MACHINE_START_MEMBER(ddenlovr_state,htengoku) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000); @@ -4431,9 +4431,9 @@ MACHINE_CONFIG_END READ8_MEMBER(ddenlovr_state::daimyojn_keyb1_r) { - UINT8 val = 0x3f; + uint8_t val = 0x3f; - UINT8 hopper_bit = ((m_hopper && !(m_screen->frame_number() % 10)) ? 0 : (1 << 6)); + uint8_t hopper_bit = ((m_hopper && !(m_screen->frame_number() % 10)) ? 0 : (1 << 6)); if (!BIT(m_keyb, 0)) val = ioport("KEY0")->read() | hopper_bit; else if (!BIT(m_keyb, 1)) val = ioport("KEY1")->read() | hopper_bit; @@ -4447,7 +4447,7 @@ READ8_MEMBER(ddenlovr_state::daimyojn_keyb1_r) READ8_MEMBER(ddenlovr_state::daimyojn_keyb2_r) { - UINT8 val = 0x3f; + uint8_t val = 0x3f; if (!BIT(m_keyb, 0)) val = ioport("KEY5")->read(); else if (!BIT(m_keyb, 1)) val = ioport("KEY6")->read(); @@ -9642,7 +9642,7 @@ MACHINE_RESET_MEMBER(ddenlovr_state,ddenlovr) MACHINE_START_MEMBER(ddenlovr_state,rongrong) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0x20, &ROM[0x010000], 0x8000); membank("bank2")->configure_entries(0, 8, &ROM[0x110000], 0x1000); @@ -9651,7 +9651,7 @@ MACHINE_START_MEMBER(ddenlovr_state,rongrong) MACHINE_START_MEMBER(ddenlovr_state,mmpanic) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000); MACHINE_START_CALL_MEMBER(ddenlovr); @@ -9659,7 +9659,7 @@ MACHINE_START_MEMBER(ddenlovr_state,mmpanic) MACHINE_START_MEMBER(ddenlovr_state,funkyfig) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000); membank("bank2")->configure_entries(0, 8, &ROM[0x90000], 0x1000); @@ -9668,7 +9668,7 @@ MACHINE_START_MEMBER(ddenlovr_state,funkyfig) MACHINE_START_MEMBER(ddenlovr_state,hanakanz) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000); membank("bank2")->configure_entries(0, 0x10, &ROM[0x90000], 0x1000); @@ -9677,7 +9677,7 @@ MACHINE_START_MEMBER(ddenlovr_state,hanakanz) MACHINE_START_MEMBER(ddenlovr_state,mjmyster) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000); membank("bank2")->configure_entries(0, 8, &ROM[0x90000], 0x1000); @@ -9686,7 +9686,7 @@ MACHINE_START_MEMBER(ddenlovr_state,mjmyster) MACHINE_START_MEMBER(ddenlovr_state,hparadis) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000); membank("bank2")->configure_entries(0, 8, &ROM[0x50000], 0x1000); @@ -9695,7 +9695,7 @@ MACHINE_START_MEMBER(ddenlovr_state,hparadis) MACHINE_START_MEMBER(ddenlovr_state,mjflove) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000); membank("bank2")->configure_entries(0, 8, &ROM[0x90000], 0x1000); @@ -9704,7 +9704,7 @@ MACHINE_START_MEMBER(ddenlovr_state,mjflove) MACHINE_START_MEMBER(ddenlovr_state,sryudens) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000); membank("bank2")->configure_entries(0, 0x10, &ROM[0x90000], 0x1000); @@ -10614,7 +10614,7 @@ MACHINE_CONFIG_END MACHINE_START_MEMBER(ddenlovr_state,seljan2) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0x00, 0x10, &ROM[0x10000], 0x8000); // banks 10-1f -> palette RAM diff --git a/src/mame/drivers/ddragon.cpp b/src/mame/drivers/ddragon.cpp index f5e995bd031..1e10f36d7cd 100644 --- a/src/mame/drivers/ddragon.cpp +++ b/src/mame/drivers/ddragon.cpp @@ -263,7 +263,7 @@ WRITE8_MEMBER(ddragon_state::darktowr_bankswitch_w) * *************************************/ -void ddragon_state::ddragon_interrupt_ack(address_space &space, offs_t offset, UINT8 data) +void ddragon_state::ddragon_interrupt_ack(address_space &space, offs_t offset, uint8_t data) { switch (offset) { @@ -463,7 +463,7 @@ void ddragon_state::dd_adpcm_int( msm5205_device *device, int chip ) } else { - UINT8 *ROM = memregion("adpcm")->base() + 0x10000 * chip; + uint8_t *ROM = memregion("adpcm")->base() + 0x10000 * chip; m_adpcm_data[chip] = ROM[m_adpcm_pos[chip]++]; device->data_w(m_adpcm_data[chip] >> 4); @@ -2110,7 +2110,7 @@ DRIVER_INIT_MEMBER(ddragon_state,darktowr) DRIVER_INIT_MEMBER(ddragon_state,toffy) { int i, length; - UINT8 *rom; + uint8_t *rom; m_sound_irq = M6809_IRQ_LINE; m_ym_irq = M6809_FIRQ_LINE; @@ -2150,7 +2150,7 @@ DRIVER_INIT_MEMBER(ddragon_state,toffy) DRIVER_INIT_MEMBER(ddragon_state,ddragon6809) { int i; - UINT8 *dst,*src; + uint8_t *dst,*src; src = memregion("chars")->base(); dst = memregion("gfx1")->base(); diff --git a/src/mame/drivers/de_2.cpp b/src/mame/drivers/de_2.cpp index b946381d37d..7e2daaa3025 100644 --- a/src/mame/drivers/de_2.cpp +++ b/src/mame/drivers/de_2.cpp @@ -95,21 +95,21 @@ public: required_device m_audiocpu; required_device m_msm5205; required_memory_bank m_sample_bank; - UINT8 m_sample_data; + uint8_t m_sample_data; bool m_more_data; bool m_nmi_enable; private: - UINT32 m_segment1; - UINT32 m_segment2; - UINT8 m_strobe; - UINT8 m_kbdrow; - UINT8 m_diag; + uint32_t m_segment1; + uint32_t m_segment2; + uint8_t m_strobe; + uint8_t m_kbdrow; + uint8_t m_diag; bool m_ca1; - UINT8 m_sound_data; + uint8_t m_sound_data; - UINT8 m_sample_bank_num; - UINT8 m_msm_prescaler; + uint8_t m_sample_bank_num; + uint8_t m_msm_prescaler; }; /*static ADDRESS_MAP_START( de_2_map, AS_PROGRAM, 8, de_2_state ) @@ -218,7 +218,7 @@ MACHINE_RESET_MEMBER(de_2_state, de_2) DRIVER_INIT_MEMBER(de_2_state, de_2) { - UINT8 *ROM = memregion("sound1")->base(); + uint8_t *ROM = memregion("sound1")->base(); m_sample_bank->configure_entries(0, 16, &ROM[0x0000], 0x4000); m_sample_bank->set_entry(0); } @@ -269,7 +269,7 @@ WRITE8_MEMBER( de_2_state::lamp0_w ) // 6821 PIA at 0x2800 WRITE8_MEMBER( de_2_state::dig0_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 data &= 0x7f; m_strobe = data & 15; m_diag = (data & 0x70) >> 4; @@ -313,7 +313,7 @@ WRITE8_MEMBER( de_2_state::alpha3_dig1_w ) READ8_MEMBER( de_2_state::pia28_w7_r ) { - UINT8 ret = 0x80; + uint8_t ret = 0x80; ret |= m_strobe; ret |= m_diag << 4; @@ -410,7 +410,7 @@ READ8_MEMBER( de_2_state::sound_latch_r ) WRITE8_MEMBER( de_2_state::sample_bank_w ) { - static const UINT8 prescale[4] = { MSM5205_S96_4B, MSM5205_S48_4B, MSM5205_S64_4B, 0 }; + static const uint8_t prescale[4] = { MSM5205_S96_4B, MSM5205_S48_4B, MSM5205_S64_4B, 0 }; m_sample_bank_num = (data & 0x07); m_sample_bank->set_entry(m_sample_bank_num); @@ -422,7 +422,7 @@ WRITE8_MEMBER( de_2_state::sample_bank_w ) READ8_MEMBER(de_2_state::display_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; switch(offset) { diff --git a/src/mame/drivers/de_3.cpp b/src/mame/drivers/de_3.cpp index cb4fdd07b85..8d180770039 100644 --- a/src/mame/drivers/de_3.cpp +++ b/src/mame/drivers/de_3.cpp @@ -82,13 +82,13 @@ protected: // driver_device overrides virtual void machine_reset() override; private: -// UINT32 m_segment1; -// UINT32 m_segment2; - UINT8 m_strobe; - UINT8 m_kbdrow; - UINT8 m_diag; +// uint32_t m_segment1; +// uint32_t m_segment2; + uint8_t m_strobe; + uint8_t m_kbdrow; + uint8_t m_diag; bool m_ca1; - UINT8 m_sound_data; + uint8_t m_sound_data; public: DECLARE_DRIVER_INIT(de_3); @@ -195,7 +195,7 @@ WRITE8_MEMBER( de_3_state::lamp0_w ) // 6821 PIA at 0x2800 WRITE8_MEMBER( de_3_state::dig0_w ) { -// static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 +// static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 // data &= 0x7f; // m_strobe = data & 15; // m_diag = (data & 0x70) >> 4; @@ -220,7 +220,7 @@ WRITE8_MEMBER( de_3_state::dig1_w ) READ8_MEMBER( de_3_state::pia28_w7_r ) { - UINT8 ret = 0x80; + uint8_t ret = 0x80; ret |= m_strobe; ret |= m_diag << 4; @@ -332,7 +332,7 @@ READ8_MEMBER( de_3_state::dmd_status_r ) READ8_MEMBER(de_3_state::display_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; switch(offset) { diff --git a/src/mame/drivers/de_3b.cpp b/src/mame/drivers/de_3b.cpp index d0221890e5a..fa896e1500a 100644 --- a/src/mame/drivers/de_3b.cpp +++ b/src/mame/drivers/de_3b.cpp @@ -48,12 +48,12 @@ protected: public: DECLARE_DRIVER_INIT(de_3b); - UINT8 m_strobe; - UINT8 m_kbdrow; - UINT8 m_diag; + uint8_t m_strobe; + uint8_t m_kbdrow; + uint8_t m_diag; bool m_ca1; bool m_irq_active; - UINT8 m_sound_data; + uint8_t m_sound_data; }; @@ -181,7 +181,7 @@ WRITE8_MEMBER( de_3b_state::pia2c_pb_w ) } READ8_MEMBER(de_3b_state::display_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; switch(offset) { diff --git a/src/mame/drivers/dec8.cpp b/src/mame/drivers/dec8.cpp index 360621fb4e0..1861de0686a 100644 --- a/src/mame/drivers/dec8.cpp +++ b/src/mame/drivers/dec8.cpp @@ -59,7 +59,7 @@ To do: WRITE8_MEMBER(dec8_state::dec8_mxc06_karn_buffer_spriteram_w) { - UINT8* spriteram = m_spriteram->live(); + uint8_t* spriteram = m_spriteram->live(); // copy to a 16-bit region for the sprite chip for (int i=0;i<0x800/2;i++) { @@ -3546,35 +3546,35 @@ DRIVER_INIT_MEMBER(dec8_state,dec8) /* Below, I set up the correct number of banks depending on the "maincpu" region size */ DRIVER_INIT_MEMBER(dec8_state,lastmisn) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000); DRIVER_INIT_CALL(dec8); } DRIVER_INIT_MEMBER(dec8_state,shackled) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x4000); DRIVER_INIT_CALL(dec8); } DRIVER_INIT_MEMBER(dec8_state,gondo) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x4000); DRIVER_INIT_CALL(dec8); } DRIVER_INIT_MEMBER(dec8_state,garyoret) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x4000); DRIVER_INIT_CALL(dec8); } DRIVER_INIT_MEMBER(dec8_state,ghostb) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x4000); DRIVER_INIT_CALL(dec8); @@ -3582,7 +3582,7 @@ DRIVER_INIT_MEMBER(dec8_state,ghostb) DRIVER_INIT_MEMBER(dec8_state,meikyuh) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x4000); DRIVER_INIT_CALL(dec8); @@ -3590,8 +3590,8 @@ DRIVER_INIT_MEMBER(dec8_state,meikyuh) DRIVER_INIT_MEMBER(dec8_state,csilver) { - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 *RAM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 14, &ROM[0x10000], 0x4000); membank("bank3")->configure_entries(0, 2, &RAM[0x10000], 0x4000); @@ -3600,21 +3600,21 @@ DRIVER_INIT_MEMBER(dec8_state,csilver) DRIVER_INIT_MEMBER(dec8_state,oscar) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000); DRIVER_INIT_CALL(dec8); } DRIVER_INIT_MEMBER(dec8_state,srdarwin) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000); DRIVER_INIT_CALL(dec8); } DRIVER_INIT_MEMBER(dec8_state,cobracom) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); DRIVER_INIT_CALL(dec8); } diff --git a/src/mame/drivers/deco156.cpp b/src/mame/drivers/deco156.cpp index be319f612bb..f273a4ad6a2 100644 --- a/src/mame/drivers/deco156.cpp +++ b/src/mame/drivers/deco156.cpp @@ -44,12 +44,12 @@ public: optional_device m_oki2; optional_device m_sprgen; required_device m_palette; - required_shared_ptr m_generic_paletteram_32; + required_shared_ptr m_generic_paletteram_32; /* memory */ - UINT16 m_pf1_rowscroll[0x800/2]; - UINT16 m_pf2_rowscroll[0x800/2]; - std::unique_ptr m_spriteram; + uint16_t m_pf1_rowscroll[0x800/2]; + uint16_t m_pf2_rowscroll[0x800/2]; + std::unique_ptr m_spriteram; DECLARE_WRITE32_MEMBER(hvysmsh_eeprom_w); DECLARE_WRITE32_MEMBER(wcvol95_nonbuffered_palette_w); DECLARE_WRITE32_MEMBER(deco156_nonbuffered_palette_w); @@ -63,7 +63,7 @@ public: DECLARE_DRIVER_INIT(hvysmsh); DECLARE_DRIVER_INIT(wcvol95); virtual void video_start() override; - UINT32 screen_update_wcvol95(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wcvol95(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt); void descramble_sound( const char *tag ); DECO16IC_BANK_CB_MEMBER(bank_callback); @@ -73,7 +73,7 @@ public: void deco156_state::video_start() { - m_spriteram = std::make_unique(0x2000/2); + m_spriteram = std::make_unique(0x2000/2); /* and register the allocated ram so that save states still work */ save_item(NAME(m_pf1_rowscroll)); @@ -82,7 +82,7 @@ void deco156_state::video_start() } -UINT32 deco156_state::screen_update_wcvol95(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t deco156_state::screen_update_wcvol95(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { //FIXME: flip_screen_x should not be written! flip_screen_set_no_update(1); @@ -656,14 +656,14 @@ ROM_END void deco156_state::descramble_sound( const char *tag ) { - UINT8 *rom = memregion(tag)->base(); + uint8_t *rom = memregion(tag)->base(); int length = memregion(tag)->bytes(); - std::vector buf1(length); - UINT32 x; + std::vector buf1(length); + uint32_t x; for (x = 0; x < length; x++) { - UINT32 addr; + uint32_t addr; addr = BITSWAP24 (x,23,22,21,0, 20, 19,18,17,16, diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp index a84589e5848..47845ed8c35 100644 --- a/src/mame/drivers/deco32.cpp +++ b/src/mame/drivers/deco32.cpp @@ -447,7 +447,7 @@ WRITE32_MEMBER(deco32_state::sound_w) m_audiocpu->set_input_line(0, HOLD_LINE); } -void deco32_state::deco32_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ) +void deco32_state::deco32_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ) { m_soundlatch->write(space, 0, data & 0xff); m_audiocpu->set_input_line(0, HOLD_LINE); @@ -684,12 +684,12 @@ WRITE32_MEMBER(deco32_state::tattass_control_w) /**********************************************************************************/ -UINT16 deco32_state::port_b_nslasher(int unused) +uint16_t deco32_state::port_b_nslasher(int unused) { return (m_eeprom->do_read()); } -void deco32_state::nslasher_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ) +void deco32_state::nslasher_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ) { /* bit 1 of nslasher_sound_irq specifies IRQ command writes */ m_soundlatch->write(space,0,(data)&0xff); @@ -697,12 +697,12 @@ void deco32_state::nslasher_sound_cb( address_space &space, UINT16 data, UINT16 m_audiocpu->set_input_line(0, (m_nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE); } -UINT16 deco32_state::port_b_tattass(int unused) +uint16_t deco32_state::port_b_tattass(int unused) { return m_tattass_eprom_bit; } -void deco32_state::tattass_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ) +void deco32_state::tattass_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ) { /* 'Swap bits 0 and 3 to correct for design error from BSMT schematic' */ int soundcommand = (data)&0xff; @@ -806,7 +806,7 @@ ADDRESS_MAP_END READ32_MEMBER( deco32_state::fghthist_protection_region_0_146_r ) { - UINT32 retdata = 0x0000ffff; + uint32_t retdata = 0x0000ffff; if (ACCESSING_BITS_16_31) { @@ -814,8 +814,8 @@ READ32_MEMBER( deco32_state::fghthist_protection_region_0_146_r ) int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8,7,6,5,4,3,2,1, 0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); @@ -833,7 +833,7 @@ WRITE32_MEMBER( deco32_state::fghthist_protection_region_0_146_w ) int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8,7,6,5,4,3,2,1, 0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } } @@ -908,8 +908,8 @@ READ16_MEMBER( deco32_state::dg_protection_region_0_146_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -917,7 +917,7 @@ WRITE16_MEMBER( deco32_state::dg_protection_region_0_146_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -1088,8 +1088,8 @@ READ16_MEMBER( deco32_state::nslasher_protection_region_0_104_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco104->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco104->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -1097,7 +1097,7 @@ WRITE16_MEMBER( deco32_state::nslasher_protection_region_0_104_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco104->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -1886,17 +1886,17 @@ static MACHINE_CONFIG_START( captaven, deco32_state ) MACHINE_CONFIG_END -UINT16 deco32_state::port_a_fghthist(int unused) +uint16_t deco32_state::port_a_fghthist(int unused) { return machine().root_device().ioport(":IN0")->read(); } -UINT16 deco32_state::port_b_fghthist(int unused) +uint16_t deco32_state::port_b_fghthist(int unused) { return machine().device(":eeprom")->do_read(); } -UINT16 deco32_state::port_c_fghthist(int unused) +uint16_t deco32_state::port_c_fghthist(int unused) { return machine().root_device().ioport(":IN1")->read(); } @@ -3954,12 +3954,12 @@ DRIVER_INIT_MEMBER(deco32_state,captaven) save_item(NAME(m_irq_source)); } -extern void process_dvi_data(device_t *device,UINT8* dvi_data, int offset, int regionsize); +extern void process_dvi_data(device_t *device,uint8_t* dvi_data, int offset, int regionsize); void dragngun_state::dragngun_init_common() { - const UINT8 *SRC_RAM = memregion("gfx1")->base(); - UINT8 *DST_RAM = memregion("gfx2")->base(); + const uint8_t *SRC_RAM = memregion("gfx1")->base(); + uint8_t *DST_RAM = memregion("gfx2")->base(); deco74_decrypt_gfx(machine(), "gfx1"); deco74_decrypt_gfx(machine(), "gfx2"); @@ -3970,7 +3970,7 @@ void dragngun_state::dragngun_init_common() #if 0 { - UINT8 *ROM = memregion("dvi")->base(); + uint8_t *ROM = memregion("dvi")->base(); FILE *fp; char filename[256]; @@ -4000,7 +4000,7 @@ DRIVER_INIT_MEMBER(dragngun_state,dragngun) { dragngun_init_common(); - UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); ROM[0x1b32c/4]=0xe1a00000; // bl $ee000: NOP test switch lock } @@ -4008,7 +4008,7 @@ DRIVER_INIT_MEMBER(dragngun_state,dragngunj) { dragngun_init_common(); - UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); ROM[0x1a1b4/4]=0xe1a00000; // bl $ee000: NOP test switch lock } @@ -4020,8 +4020,8 @@ DRIVER_INIT_MEMBER(deco32_state,fghthist) DRIVER_INIT_MEMBER(dragngun_state,lockload) { - UINT8 *RAM = memregion("maincpu")->base(); -// UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); +// uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); deco74_decrypt_gfx(machine(), "gfx1"); deco74_decrypt_gfx(machine(), "gfx2"); @@ -4041,8 +4041,8 @@ DRIVER_INIT_MEMBER(dragngun_state,lockload) DRIVER_INIT_MEMBER(deco32_state,tattass) { - UINT8 *RAM = memregion("gfx1")->base(); - std::vector tmp(0x80000); + uint8_t *RAM = memregion("gfx1")->base(); + std::vector tmp(0x80000); /* Reorder bitplanes to make decoding easier */ memcpy(&tmp[0],RAM+0x80000,0x80000); @@ -4068,8 +4068,8 @@ DRIVER_INIT_MEMBER(deco32_state,tattass) DRIVER_INIT_MEMBER(deco32_state,nslasher) { - UINT8 *RAM = memregion("gfx1")->base(); - std::vector tmp(0x80000); + uint8_t *RAM = memregion("gfx1")->base(); + std::vector tmp(0x80000); /* Reorder bitplanes to make decoding easier */ memcpy(&tmp[0],RAM+0x80000,0x80000); diff --git a/src/mame/drivers/deco_ld.cpp b/src/mame/drivers/deco_ld.cpp index 4ae33ed2bda..85c297161c6 100644 --- a/src/mame/drivers/deco_ld.cpp +++ b/src/mame/drivers/deco_ld.cpp @@ -146,12 +146,12 @@ public: required_device m_palette; required_device m_soundlatch; required_device m_soundlatch2; - required_shared_ptr m_vram0; - required_shared_ptr m_attr0; - required_shared_ptr m_vram1; - required_shared_ptr m_attr1; + required_shared_ptr m_vram0; + required_shared_ptr m_attr0; + required_shared_ptr m_vram1; + required_shared_ptr m_attr1; - UINT8 m_laserdisc_data; + uint8_t m_laserdisc_data; int m_nmimask; DECLARE_READ8_MEMBER(acia_status_hack_r); DECLARE_READ8_MEMBER(sound_status_r); @@ -159,12 +159,12 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(begas_vblank_r); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); virtual void machine_start() override; - UINT32 screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sound_interrupt); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram, UINT16 tile_bank ); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ); }; -void deco_ld_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram, UINT16 tile_bank ) +void deco_ld_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ) { gfx_element *gfx = m_gfxdecode->gfx(1); int i,spr_offs,x,y,col,fx,fy; @@ -209,7 +209,7 @@ void deco_ld_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect } } -UINT32 deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int y,x; diff --git a/src/mame/drivers/deco_mlc.cpp b/src/mame/drivers/deco_mlc.cpp index bcb9c107fec..5f90e12b1da 100644 --- a/src/mame/drivers/deco_mlc.cpp +++ b/src/mame/drivers/deco_mlc.cpp @@ -172,7 +172,7 @@ READ32_MEMBER(deco_mlc_state::mlc_scanline_r) WRITE32_MEMBER(deco_mlc_state::avengrs_eprom_w) { if (ACCESSING_BITS_8_15) { - UINT8 ebyte=(data>>8)&0xff; + uint8_t ebyte=(data>>8)&0xff; // if (ebyte&0x80) { m_eeprom->clk_write((ebyte & 0x2) ? ASSERT_LINE : CLEAR_LINE); m_eeprom->di_write(ebyte & 0x1); @@ -239,7 +239,7 @@ READ32_MEMBER(deco_mlc_state::mlc_vram_r) READ32_MEMBER( deco_mlc_state::mlc_spriteram_r ) { - UINT32 retdata = 0; + uint32_t retdata = 0; if (ACCESSING_BITS_16_31) { @@ -272,8 +272,8 @@ READ16_MEMBER( deco_mlc_state::sh96_protection_region_0_146_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -281,7 +281,7 @@ WRITE16_MEMBER( deco_mlc_state::sh96_protection_region_0_146_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -846,15 +846,15 @@ ROM_END void deco_mlc_state::descramble_sound( ) { /* the same as simpl156 / heavy smash? */ - UINT8 *rom = memregion("ymz")->base(); + uint8_t *rom = memregion("ymz")->base(); int length = memregion("ymz")->bytes(); - std::vector buf1(length); + std::vector buf1(length); - UINT32 x; + uint32_t x; for (x=0;x m_maincpu; required_device m_dsp; @@ -335,8 +335,8 @@ public: TIMER_CALLBACK_MEMBER(outfifo_read_cb); void dectalk_outfifo_check (); void dectalk_clear_all_fifos( ); - void dectalk_semaphore_w ( UINT16 data ); - UINT16 dectalk_outfifo_r ( ); + void dectalk_semaphore_w ( uint16_t data ); + uint16_t dectalk_outfifo_r ( ); DECLARE_WRITE_LINE_MEMBER(dectalk_reset); protected: @@ -354,7 +354,7 @@ WRITE_LINE_MEMBER(dectalk_state::dectalk_duart_irq_handler) READ8_MEMBER(dectalk_state::dectalk_duart_input) { - UINT8 data = 0; + uint8_t data = 0; data |= m_duart_inport&0xF; data |= (ioport("duart_in")->read()&0xF0); if ((m_hack_self_test == 1) && (ioport("hacks")->read()&0x01)) data |= 0x10; // hack to prevent hang if selftest disable bit is kept low past the first read; i suppose the proper use of this bit was an incremental switch, or perhaps its expecting an interrupt later from serial in or tone in? added a dipswitch to disable the hack for testing @@ -406,7 +406,7 @@ void dectalk_state::dectalk_clear_all_fifos( ) } // helper for dsp infifo_semaphore flag to make dealing with interrupts easier -void dectalk_state::dectalk_semaphore_w ( UINT16 data ) +void dectalk_state::dectalk_semaphore_w ( uint16_t data ) { m_infifo_semaphore = data&1; if ((m_infifo_semaphore == 1) && (m_m68k_spcflags_latch&0x40)) @@ -421,9 +421,9 @@ void dectalk_state::dectalk_semaphore_w ( UINT16 data ) } // read the output fifo and set the interrupt line active on the dsp -UINT16 dectalk_state::dectalk_outfifo_r ( ) +uint16_t dectalk_state::dectalk_outfifo_r ( ) { - UINT16 data = 0xFFFF; + uint16_t data = 0xFFFF; #ifdef USE_LOOSE_TIMING_OUTPUT // if outfifo count is less than two, boost the interleave to prevent running the fifo out if (m_outfifo_count < 2) @@ -530,7 +530,7 @@ WRITE16_MEMBER(dectalk_state::m68k_infifo_w)// 68k write to the speech input fif READ16_MEMBER(dectalk_state::m68k_spcflags_r)// 68k read from the speech flags { - UINT8 data = 0; + uint8_t data = 0; data |= m_m68k_spcflags_latch; // bits 0 and 6 data |= m_spc_error_latch<<5; // bit 5 data |= m_infifo_semaphore<<7; // bit 7 @@ -601,7 +601,7 @@ WRITE16_MEMBER(dectalk_state::m68k_spcflags_w)// 68k write to the speech flags ( READ16_MEMBER(dectalk_state::m68k_tlcflags_r)// dtmf flags read { - UINT16 data = 0; + uint16_t data = 0; data |= m_m68k_tlcflags_latch; // bits 6, 8, 14; data |= m_tlc_tonedetect<<7; // bit 7 is tone detect data |= m_tlc_ringdetect<<14; // bit 15 is ring detect @@ -676,7 +676,7 @@ WRITE16_MEMBER(dectalk_state::m68k_tlcflags_w)// dtmf flags write READ16_MEMBER(dectalk_state::m68k_tlc_dtmf_r)// dtmf chip read { #ifdef TLC_LOG - UINT16 data = 0xFFFF; + uint16_t data = 0xFFFF; data = m_tlc_dtmf&0xF; logerror("m68k: TLC dtmf detector read, returning data = %02X", data); #endif @@ -699,7 +699,7 @@ WRITE16_MEMBER(dectalk_state::spc_latch_outfifo_error_stats)// latch 74ls74 @ E6 READ16_MEMBER(dectalk_state::spc_infifo_data_r) { - UINT16 data = 0xFFFF; + uint16_t data = 0xFFFF; data = m_infifo[m_infifo_tail_ptr]; #ifdef SPC_LOG_DSP logerror("dsp: SPC infifo read with data = %04X, fifo head: %02X; fifo tail was: %02X\n",data, m_infifo_head_ptr, m_infifo_tail_ptr); @@ -838,7 +838,7 @@ void dectalk_state::device_timer(emu_timer &timer, device_timer_id id, int param TIMER_CALLBACK_MEMBER(dectalk_state::outfifo_read_cb) { - UINT16 data; + uint16_t data; data = dectalk_outfifo_r(); #ifdef VERBOSE if (data!= 0x8000) logerror("sample output: %04X\n", data); diff --git a/src/mame/drivers/decwritr.cpp b/src/mame/drivers/decwritr.cpp index f82a6a6e647..04091b850e8 100644 --- a/src/mame/drivers/decwritr.cpp +++ b/src/mame/drivers/decwritr.cpp @@ -38,7 +38,7 @@ public: required_device m_speaker; required_device m_uart; //required_device m_terminal; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black); return 0; @@ -53,9 +53,9 @@ private: virtual void machine_start() override; //virtual void machine_reset(); ioport_port* m_col_array[16]; - UINT8 m_led_array; - UINT8 m_led_7seg_counter; - UINT8 m_led_7seg[4]; + uint8_t m_led_array; + uint8_t m_led_7seg_counter; + uint8_t m_led_7seg[4]; }; READ8_MEMBER( decwriter_state::la120_KBD_r ) @@ -71,7 +71,7 @@ READ8_MEMBER( decwriter_state::la120_KBD_r ) * d7 d6 d5 d4 d3 d2 d1 d0 * \--\--\--\--\--\--\--\-- read from rows */ - UINT8 code = 0; + uint8_t code = 0; if (offset&0x8) code |= m_col_array[offset&0x7]->read(); if (offset&0x10) code |= m_col_array[(offset&0x7)+8]->read(); #ifdef KBD_VERBOSE @@ -160,7 +160,7 @@ WRITE8_MEMBER( decwriter_state::la120_NVR_w ) */ READ8_MEMBER( decwriter_state::la120_DC305_r ) { - UINT8 data = 0x00; + uint8_t data = 0x00; logerror("DC305 Read from offset %01x, returning %02X\n", offset, data); return data; } diff --git a/src/mame/drivers/deshoros.cpp b/src/mame/drivers/deshoros.cpp index a3fce6cb892..23bd00f1de7 100644 --- a/src/mame/drivers/deshoros.cpp +++ b/src/mame/drivers/deshoros.cpp @@ -65,7 +65,7 @@ protected: virtual void machine_reset() override; virtual void video_start() override; public: - UINT32 screen_update_destiny(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_destiny(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -73,13 +73,13 @@ public: void destiny_state::video_start() { - UINT8 i; + uint8_t i; for(i=0;i<20;i++) m_led_array[i] = 0x20; m_led_array[20] = 0; } -UINT32 destiny_state::screen_update_destiny(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t destiny_state::screen_update_destiny(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { popmessage("%s",m_led_array); return 0; diff --git a/src/mame/drivers/destroyr.cpp b/src/mame/drivers/destroyr.cpp index 5ddbff17f68..74333d3c3c7 100644 --- a/src/mame/drivers/destroyr.cpp +++ b/src/mame/drivers/destroyr.cpp @@ -47,9 +47,9 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_alpha_num_ram; - required_shared_ptr m_major_obj_ram; - required_shared_ptr m_minor_obj_ram; + required_shared_ptr m_alpha_num_ram; + required_shared_ptr m_major_obj_ram; + required_shared_ptr m_minor_obj_ram; /* video-related */ int m_cursor; @@ -75,7 +75,7 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(destroyr); - 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); TIMER_CALLBACK_MEMBER(dial_callback); TIMER_CALLBACK_MEMBER(frame_callback); @@ -85,7 +85,7 @@ protected: }; -UINT32 destroyr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t destroyr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, j; @@ -286,7 +286,7 @@ READ8_MEMBER(destroyr_state::input_r) else { - UINT8 ret = ioport("IN0")->read(); + uint8_t ret = ioport("IN0")->read(); if (m_potsense[0] && m_potmask[0]) ret |= 4; @@ -400,7 +400,7 @@ static const gfx_layout destroyr_minor_object_layout = 0x200 /* increment */ }; -static const UINT32 destroyr_major_object_layout_xoffset[64] = +static const uint32_t destroyr_major_object_layout_xoffset[64] = { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E, @@ -428,7 +428,7 @@ static const gfx_layout destroyr_major_object_layout = nullptr }; -static const UINT32 destroyr_waves_layout_xoffset[64] = +static const uint32_t destroyr_waves_layout_xoffset[64] = { 0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B, 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B, diff --git a/src/mame/drivers/dfruit.cpp b/src/mame/drivers/dfruit.cpp index deef35c197e..db33b51decd 100644 --- a/src/mame/drivers/dfruit.cpp +++ b/src/mame/drivers/dfruit.cpp @@ -36,13 +36,13 @@ public: required_device m_vdp; virtual void video_start() override; - 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); void screen_eof(screen_device &screen, bool state); - UINT8 m_ram_bank[4]; - UINT8 m_rom_bank; - UINT8 m_irq_vector[3]; - UINT8 m_irq_enable; + uint8_t m_ram_bank[4]; + uint8_t m_rom_bank; + uint8_t m_irq_vector[3]; + uint8_t m_irq_enable; DECLARE_READ8_MEMBER(dfruit_rom_r); @@ -64,8 +64,8 @@ public: DECLARE_READ8_MEMBER(dfruit_irq_enable_r); DECLARE_WRITE8_MEMBER(dfruit_irq_enable_w); - UINT8 ram_bank_r(UINT16 offset, UINT8 bank_num); - void ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num); + uint8_t ram_bank_r(uint16_t offset, uint8_t bank_num); + void ram_bank_w(uint16_t offset, uint8_t data, uint8_t bank_num); TIMER_DEVICE_CALLBACK_MEMBER(dfruit_irq_scanline); }; @@ -73,7 +73,7 @@ void dfruit_state::video_start() { } -UINT32 dfruit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dfruit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); @@ -92,7 +92,7 @@ void dfruit_state::screen_eof(screen_device &screen, bool state) READ8_MEMBER(dfruit_state::dfruit_rom_r) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); return ROM[offset + m_rom_bank * 0x2000]; } @@ -137,13 +137,13 @@ WRITE8_MEMBER(dfruit_state::dfruit_ram_bank_w) m_ram_bank[offset] = data; } -UINT8 dfruit_state::ram_bank_r(UINT16 offset, UINT8 bank_num) +uint8_t dfruit_state::ram_bank_r(uint16_t offset, uint8_t bank_num) { address_space &vdp_space = machine().device("tc0091lvc")->space(); return vdp_space.read_byte(offset + (m_ram_bank[bank_num]) * 0x1000);; } -void dfruit_state::ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num) +void dfruit_state::ram_bank_w(uint16_t offset, uint8_t data, uint8_t bank_num) { address_space &vdp_space = machine().device("tc0091lvc")->space(); vdp_space.write_byte(offset + (m_ram_bank[bank_num]) * 0x1000,data);; diff --git a/src/mame/drivers/dgpix.cpp b/src/mame/drivers/dgpix.cpp index d3a3f8d270e..d6d3c1e6c90 100644 --- a/src/mame/drivers/dgpix.cpp +++ b/src/mame/drivers/dgpix.cpp @@ -167,12 +167,12 @@ public: required_device m_maincpu; required_ioport m_vblank; - std::unique_ptr m_vram; + std::unique_ptr m_vram; int m_vbuffer; int m_flash_roms; int m_old_vbuf; - UINT32 m_flash_cmd; - INT32 m_first_offset; + uint32_t m_flash_cmd; + int32_t m_first_offset; DECLARE_READ32_MEMBER(flash_r); DECLARE_WRITE32_MEMBER(flash_w); @@ -193,13 +193,13 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_dgpix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dgpix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; READ32_MEMBER(dgpix_state::flash_r) { - UINT32 *ROM = (UINT32 *)memregion("flash")->base(); + uint32_t *ROM = (uint32_t *)memregion("flash")->base(); if(offset >= (0x2000000 - m_flash_roms * 0x400000) / 4) { @@ -236,7 +236,7 @@ WRITE32_MEMBER(dgpix_state::flash_w) if(data == 0xd0d00000) { // point to game settings - UINT8 *rom = (UINT8 *)memregion("flash")->base() + offset*4; + uint8_t *rom = (uint8_t *)memregion("flash")->base() + offset*4; // erase one block memset(rom, 0xff, 0x10000); @@ -254,7 +254,7 @@ WRITE32_MEMBER(dgpix_state::flash_w) } else { - UINT16 *rom = (UINT16 *)memregion("flash")->base(); + uint16_t *rom = (uint16_t *)memregion("flash")->base(); // write game settings @@ -277,7 +277,7 @@ WRITE32_MEMBER(dgpix_state::flash_w) WRITE32_MEMBER(dgpix_state::vram_w) { - UINT32 *dest = &m_vram[offset+(0x40000/4)*m_vbuffer]; + uint32_t *dest = &m_vram[offset+(0x40000/4)*m_vbuffer]; if (mem_mask == 0xffffffff) { @@ -376,20 +376,20 @@ INPUT_PORTS_END void dgpix_state::video_start() { - m_vram = std::make_unique(0x40000*2/4); + m_vram = std::make_unique(0x40000*2/4); save_pointer(NAME(m_vram.get()), 0x40000*2/4); } -UINT32 dgpix_state::screen_update_dgpix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dgpix_state::screen_update_dgpix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y; for (y = 0; y < 240; y++) { int x; - UINT32 *src = &m_vram[(m_vbuffer ? 0 : 0x10000) | (y << 8)]; - UINT16 *dest = &bitmap.pix16(y); + uint32_t *src = &m_vram[(m_vbuffer ? 0 : 0x10000) | (y << 8)]; + uint16_t *dest = &bitmap.pix16(y); for (x = 0; x < 320; x += 2) { @@ -604,7 +604,7 @@ ROM_END DRIVER_INIT_MEMBER(dgpix_state,elfin) { - UINT8 *rom = (UINT8 *)memregion("flash")->base() + 0x1c00000; + uint8_t *rom = (uint8_t *)memregion("flash")->base() + 0x1c00000; rom[BYTE4_XOR_BE(0x3a9e94)] = 3; rom[BYTE4_XOR_BE(0x3a9e95)] = 0; @@ -618,7 +618,7 @@ DRIVER_INIT_MEMBER(dgpix_state,elfin) DRIVER_INIT_MEMBER(dgpix_state,jumpjump) { - UINT8 *rom = (UINT8 *)memregion("flash")->base() + 0x1c00000; + uint8_t *rom = (uint8_t *)memregion("flash")->base() + 0x1c00000; rom[BYTE4_XOR_BE(0x3a829a)] = 3; rom[BYTE4_XOR_BE(0x3a829b)] = 0; @@ -632,7 +632,7 @@ DRIVER_INIT_MEMBER(dgpix_state,jumpjump) DRIVER_INIT_MEMBER(dgpix_state,xfiles) { - UINT8 *rom = (UINT8 *)memregion("flash")->base() + 0x1c00000; + uint8_t *rom = (uint8_t *)memregion("flash")->base() + 0x1c00000; rom[BYTE4_XOR_BE(0x3a9a2a)] = 3; rom[BYTE4_XOR_BE(0x3a9a2b)] = 0; @@ -646,7 +646,7 @@ DRIVER_INIT_MEMBER(dgpix_state,xfiles) DRIVER_INIT_MEMBER(dgpix_state,xfilesk) { - UINT8 *rom = (UINT8 *)memregion("flash")->base() + 0x1c00000; + uint8_t *rom = (uint8_t *)memregion("flash")->base() + 0x1c00000; rom[BYTE4_XOR_BE(0x3aa92e)] = 3; rom[BYTE4_XOR_BE(0x3aa92f)] = 0; @@ -663,7 +663,7 @@ DRIVER_INIT_MEMBER(dgpix_state,xfilesk) DRIVER_INIT_MEMBER(dgpix_state,kdynastg) { - UINT8 *rom = (UINT8 *)memregion("flash")->base() + 0x1c00000; + uint8_t *rom = (uint8_t *)memregion("flash")->base() + 0x1c00000; rom[BYTE4_XOR_BE(0x3aaa10)] = 3; // 129f0 - nopped call rom[BYTE4_XOR_BE(0x3aaa11)] = 0; diff --git a/src/mame/drivers/didact.cpp b/src/mame/drivers/didact.cpp index 611bf32e3af..e4de8ce0437 100644 --- a/src/mame/drivers/didact.cpp +++ b/src/mame/drivers/didact.cpp @@ -96,13 +96,13 @@ class didact_state : public driver_device required_ioport m_io_line2; required_ioport m_io_line3; required_ioport m_io_line4; - UINT8 m_line0; - UINT8 m_line1; - UINT8 m_line2; - UINT8 m_line3; - UINT8 m_reset; - UINT8 m_shift; - UINT8 m_led; + uint8_t m_line0; + uint8_t m_line1; + uint8_t m_line2; + uint8_t m_line3; + uint8_t m_reset; + uint8_t m_shift; + uint8_t m_led; optional_device m_rs232; TIMER_DEVICE_CALLBACK_MEMBER(scan_artwork); }; @@ -158,7 +158,7 @@ class md6802_state : public didact_state { } required_device m_maincpu; required_device m_tb16_74145; - UINT8 m_segments; + uint8_t m_segments; DECLARE_READ8_MEMBER( pia2_kbA_r ); DECLARE_WRITE8_MEMBER( pia2_kbA_w ); DECLARE_READ8_MEMBER( pia2_kbB_r ); @@ -175,8 +175,8 @@ protected: /* Keyboard */ READ8_MEMBER( md6802_state::pia2_kbA_r ) { - UINT8 ls145; - UINT8 pa = 0xff; + uint8_t ls145; + uint8_t pa = 0xff; // Read out the selected column ls145 = m_tb16_74145->read() & 0x0f; @@ -208,7 +208,7 @@ READ8_MEMBER( md6802_state::pia2_kbA_r ) /* Pull the cathodes low enabling the correct digit and lit the segments held by port B */ WRITE8_MEMBER( md6802_state::pia2_kbA_w ) { - UINT8 digit_nbr; + uint8_t digit_nbr; // LOG(("--->%s(%02x)\n", FUNCNAME, data)); @@ -354,7 +354,7 @@ READ8_MEMBER( mp68a_state::pia2_kbA_r ) WRITE8_MEMBER( mp68a_state::pia2_kbA_w ) { - UINT8 digit_nbr; + uint8_t digit_nbr; /* Display memory is at $702 to $708 in AAAADD format (A=address digit, D=Data digit) but we are using data read from the port. */ @@ -377,7 +377,7 @@ WRITE8_MEMBER( mp68a_state::pia2_kbA_w ) READ8_MEMBER( mp68a_state::pia2_kbB_r ) { - UINT8 a012, line, pb; + uint8_t a012, line, pb; LOG(("--->%s %02x %02x %02x %02x %02x => ", FUNCNAME, m_line0, m_line1, m_line2, m_line3, m_shift)); @@ -522,11 +522,11 @@ public: { } required_device m_maincpu; required_device m_kbd_74145; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_cassette; - UINT8 *m_char_ptr; - UINT8 *m_vram; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint8_t *m_char_ptr; + uint8_t *m_vram; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void machine_reset() override { m_maincpu->reset(); LOG(("--->%s()\n", FUNCNAME)); }; virtual void machine_start() override; DECLARE_READ8_MEMBER( pia_r ); @@ -548,8 +548,8 @@ protected: required_ioport m_io_line7; required_ioport m_io_line8; required_ioport m_io_line9; - UINT8 m_pia1_B; - UINT8 m_50hz; + uint8_t m_pia1_B; + uint8_t m_50hz; }; TIMER_DEVICE_CALLBACK_MEMBER(e100_state::rtc_w) @@ -561,7 +561,7 @@ void e100_state::machine_start() { LOG(("%s()\n", FUNCNAME)); m_char_ptr = memregion("chargen")->base(); - m_vram = (UINT8 *)m_videoram.target(); + m_vram = (uint8_t *)m_videoram.target(); /* register for state saving */ save_pointer (NAME (m_char_ptr), sizeof(m_char_ptr)); @@ -570,12 +570,12 @@ void e100_state::machine_start() save_item(NAME(m_pia1_B)); } -UINT32 e100_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t e100_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; int vramad; - UINT8 *chardata; - UINT8 charcode; + uint8_t *chardata; + uint8_t charcode; LOGSCREEN(("%s()\n", FUNCNAME)); vramad = 0; @@ -633,14 +633,14 @@ WRITE8_MEMBER( e100_state::pia_w ) /* PIA read - the Esselte 100 allows the PIA:s to be accessed simultaneously */ READ8_MEMBER( e100_state::pia_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset & 0x18) { case 0x18: // read PIA1 and PIA2 at the same time, should really only happen for writes... { - UINT8 data1 = m_pia1->read(space, offset); - UINT8 data2 = m_pia2->read(space, offset); + uint8_t data1 = m_pia1->read(space, offset); + uint8_t data2 = m_pia2->read(space, offset); logerror("%s: Dual device read may have caused unpredictable results on real hardware\n", FUNCNAME); data = data1 & data2; // We assume that the stable behaviour is that data lines with a low level by either device succeeds LOGCS(("%s %s[%02x] %02x & %02x -> %02x Dual device read!!\n", PIA1_TAG "/" PIA2_TAG, FUNCNAME, offset, data1, data2, data)); @@ -668,7 +668,7 @@ WRITE8_MEMBER( e100_state::pia1_kbA_w ) READ8_MEMBER( e100_state::pia1_kbA_r ) { int ls145; - UINT8 pa = 0x00; + uint8_t pa = 0x00; // Read out the selected column ls145 = m_kbd_74145->read() & 0x3ff; @@ -725,7 +725,7 @@ READ8_MEMBER( e100_state::pia1_kbA_r ) #define CASS_IN 0x80 WRITE8_MEMBER( e100_state::pia1_kbB_w ) { - UINT8 col; + uint8_t col; // Keyboard // if (VERBOSE && data != m_pia1_B) LOGSCAN(("%s(%02x)\n", FUNCNAME, data)); diff --git a/src/mame/drivers/dietgo.cpp b/src/mame/drivers/dietgo.cpp index b5a3f154b11..7c2cf0b489e 100644 --- a/src/mame/drivers/dietgo.cpp +++ b/src/mame/drivers/dietgo.cpp @@ -35,8 +35,8 @@ READ16_MEMBER( dietgo_state::dietgo_protection_region_0_104_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco104->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco104->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -44,7 +44,7 @@ WRITE16_MEMBER( dietgo_state::dietgo_protection_region_0_104_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco104->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -372,7 +372,7 @@ ROM_END DRIVER_INIT_MEMBER(dietgo_state,dietgo) { deco56_decrypt_gfx(machine(), "gfx1"); - deco102_decrypt_cpu((UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0xe9ba, 0x01, 0x19); + deco102_decrypt_cpu((uint16_t *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0xe9ba, 0x01, 0x19); } GAME( 1992, dietgo, 0, dietgo, dietgo, dietgo_state, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.09.26)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/digel804.cpp b/src/mame/drivers/digel804.cpp index 05ab0883ca3..b92ade882fc 100644 --- a/src/mame/drivers/digel804.cpp +++ b/src/mame/drivers/digel804.cpp @@ -116,20 +116,20 @@ public: DECLARE_WRITE_LINE_MEMBER( da_w ); DECLARE_INPUT_CHANGED_MEMBER(mode_change); // current speaker state for port 45 - UINT8 m_speaker_state; + uint8_t m_speaker_state; // ram stuff for banking - UINT8 m_ram_bank; + uint8_t m_ram_bank; // states - UINT8 m_acia_intq; - UINT8 m_overload_state; - UINT8 m_key_intq; - UINT8 m_remote_mode; - UINT8 m_key_mode; - UINT8 m_sim_mode; - UINT8 m_powerfail_state; - UINT8 m_chipinsert_state; - UINT8 m_keyen_state; - UINT8 m_op41; + uint8_t m_acia_intq; + uint8_t m_overload_state; + uint8_t m_key_intq; + uint8_t m_remote_mode; + uint8_t m_key_mode; + uint8_t m_sim_mode; + uint8_t m_powerfail_state; + uint8_t m_chipinsert_state; + uint8_t m_keyen_state; + uint8_t m_op41; }; @@ -308,7 +308,7 @@ READ8_MEMBER( digel804_state::ip46 ) // keypad read * this value auto-latches on a key press and remains through multiple reads * this is done by a 74C923 integrated circuit */ - UINT8 kbd = m_kb->read(); + uint8_t kbd = m_kb->read(); #ifdef PORT46_R_VERBOSE logerror("Digel804: returning %02X for port 46 keypad read\n", kbd); #endif diff --git a/src/mame/drivers/dim68k.cpp b/src/mame/drivers/dim68k.cpp index 614bfd0e2a1..27c0b7b1ac1 100644 --- a/src/mame/drivers/dim68k.cpp +++ b/src/mame/drivers/dim68k.cpp @@ -67,16 +67,16 @@ public: DECLARE_WRITE16_MEMBER( dim68k_video_reset_w ); DECLARE_WRITE8_MEMBER(kbd_put); MC6845_UPDATE_ROW(crtc_update_row); - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; bool m_speaker_bit; - UINT8 m_video_control; - UINT8 m_term_data; + uint8_t m_video_control; + uint8_t m_term_data; virtual void machine_reset() override; virtual void video_start() override; required_device m_maincpu; required_device m_crtc; required_device m_speaker; - required_shared_ptr m_ram; + required_shared_ptr m_ram; required_device m_palette; }; @@ -212,9 +212,9 @@ INPUT_PORTS_END void dim68k_state::machine_reset() { - UINT8* ROM = memregion("bootrom")->base(); + uint8_t* ROM = memregion("bootrom")->base(); - memcpy((UINT8*)m_ram.target(), ROM, 0x2000); + memcpy((uint8_t*)m_ram.target(), ROM, 0x2000); m_maincpu->reset(); } @@ -228,11 +228,11 @@ void dim68k_state::video_start() MC6845_UPDATE_ROW( dim68k_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx,x,xx,inv; - UINT16 chr16=0x2020; // set to spaces if screen is off - UINT32 *p = &bitmap.pix32(y); - UINT8 screen_on = ~m_video_control & 4; - UINT8 dot8 = ~m_video_control & 40; + uint8_t chr,gfx,x,xx,inv; + uint16_t chr16=0x2020; // set to spaces if screen is off + uint32_t *p = &bitmap.pix32(y); + uint8_t screen_on = ~m_video_control & 4; + uint8_t dot8 = ~m_video_control & 40; // need to divide everything in half to cater for 16-bit reads x_count /= 2; diff --git a/src/mame/drivers/discoboy.cpp b/src/mame/drivers/discoboy.cpp index f76665044c8..bdb78873e74 100644 --- a/src/mame/drivers/discoboy.cpp +++ b/src/mame/drivers/discoboy.cpp @@ -62,11 +62,11 @@ public: m_soundlatch(*this, "soundlatch") { } /* video-related */ - UINT8 m_ram_bank; - UINT8 m_gfxbank; - UINT8 m_port_00; + uint8_t m_ram_bank; + uint8_t m_gfxbank; + uint8_t m_port_00; int m_adpcm; - UINT8 m_toggle; + uint8_t m_toggle; /* devices */ required_device m_maincpu; @@ -77,11 +77,11 @@ public: required_device m_soundlatch; /* memory */ - UINT8 m_ram_1[0x800]; - UINT8 m_ram_2[0x800]; - UINT8 m_ram_3[0x1000]; - UINT8 m_ram_4[0x1000]; - UINT8 m_ram_att[0x800]; + uint8_t m_ram_1[0x800]; + uint8_t m_ram_2[0x800]; + uint8_t m_ram_3[0x1000]; + uint8_t m_ram_4[0x1000]; + uint8_t m_ram_att[0x800]; DECLARE_WRITE8_MEMBER(rambank_select_w); DECLARE_WRITE8_MEMBER(discoboy_port_00_w); DECLARE_WRITE8_MEMBER(discoboy_port_01_w); @@ -100,7 +100,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_discoboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_discoboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); DECLARE_WRITE_LINE_MEMBER(yunsung8_adpcm_int); }; @@ -158,15 +158,15 @@ void discoboy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre } -UINT32 discoboy_state::screen_update_discoboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t discoboy_state::screen_update_discoboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 x, y; + uint16_t x, y; int i; int count = 0; for (i = 0; i < 0x800; i += 2) { - UINT16 pal; + uint16_t pal; int r, g, b; pal = m_ram_1[i] | (m_ram_1[i + 1] << 8); @@ -179,7 +179,7 @@ UINT32 discoboy_state::screen_update_discoboy(screen_device &screen, bitmap_ind1 for (i = 0; i < 0x800; i += 2) { - UINT16 pal; + uint16_t pal; int r,g,b; pal = m_ram_2[i] | (m_ram_2[i + 1] << 8); @@ -196,7 +196,7 @@ UINT32 discoboy_state::screen_update_discoboy(screen_device &screen, bitmap_ind1 { for (x = 0; x < 64; x++) { - UINT16 tileno = m_ram_3[count] | (m_ram_3[count + 1] << 8); + uint16_t tileno = m_ram_3[count] | (m_ram_3[count + 1] << 8); if (tileno > 0x2000) { @@ -217,9 +217,9 @@ UINT32 discoboy_state::screen_update_discoboy(screen_device &screen, bitmap_ind1 } #ifdef UNUSED_FUNCTION -void discoboy_state::discoboy_setrombank( UINT8 data ) +void discoboy_state::discoboy_setrombank( uint8_t data ) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); data &= 0x2f; space.membank("bank1")->set_base(&ROM[0x6000 + (data * 0x1000)] ); } @@ -586,8 +586,8 @@ ROM_END DRIVER_INIT_MEMBER(discoboy_state,discoboy) { - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 *AUDIO = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *AUDIO = memregion("audiocpu")->base(); memset(m_ram_1, 0, sizeof(m_ram_1)); memset(m_ram_2, 0, sizeof(m_ram_2)); diff --git a/src/mame/drivers/divebomb.cpp b/src/mame/drivers/divebomb.cpp index e87e3c6d08d..77d189daa20 100644 --- a/src/mame/drivers/divebomb.cpp +++ b/src/mame/drivers/divebomb.cpp @@ -162,7 +162,7 @@ WRITE8_MEMBER(divebomb_state::fgcpu_roz_comm_w) READ8_MEMBER(divebomb_state::fgcpu_comm_flags_r) { - UINT8 result = 0; + uint8_t result = 0; if (has_fromroz) result |= 1; @@ -249,7 +249,7 @@ ADDRESS_MAP_END WRITE8_MEMBER(divebomb_state::rozcpu_bank_w) { - UINT32 bank = BITSWAP8(data, 4, 5, 6, 7, 3, 2, 1, 0) >> 4; + uint32_t bank = BITSWAP8(data, 4, 5, 6, 7, 3, 2, 1, 0) >> 4; m_bank1->set_entry(bank); if (data & 0x0f) diff --git a/src/mame/drivers/diverboy.cpp b/src/mame/drivers/diverboy.cpp index e8ef0a5885b..7f726d3f827 100644 --- a/src/mame/drivers/diverboy.cpp +++ b/src/mame/drivers/diverboy.cpp @@ -71,7 +71,7 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; /* devices */ required_device m_maincpu; @@ -86,7 +86,7 @@ public: DECLARE_WRITE8_MEMBER(okibank_w); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_diverboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_diverboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; @@ -97,12 +97,12 @@ void diverboy_state::video_start() void diverboy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) { - UINT16 *source = m_spriteram; - UINT16 *finish = source + (m_spriteram.bytes() / 2); + uint16_t *source = m_spriteram; + uint16_t *finish = source + (m_spriteram.bytes() / 2); while (source < finish) { - INT16 xpos, ypos, number, colr, bank, flash; + int16_t xpos, ypos, number, colr, bank, flash; ypos = source[4]; xpos = source[0]; @@ -130,7 +130,7 @@ void diverboy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipr } } -UINT32 diverboy_state::screen_update_diverboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t diverboy_state::screen_update_diverboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // bitmap.fill(m_palette->black_pen(), cliprect); draw_sprites(bitmap, cliprect); diff --git a/src/mame/drivers/djboy.cpp b/src/mame/drivers/djboy.cpp index cec8d17afe6..c3f1fe73019 100644 --- a/src/mame/drivers/djboy.cpp +++ b/src/mame/drivers/djboy.cpp @@ -355,9 +355,9 @@ WRITE8_MEMBER(djboy_state::beast_p2_w) READ8_MEMBER(djboy_state::beast_p3_r) { - UINT8 dsw = 0; - UINT8 dsw1 = ~ioport("DSW1")->read(); - UINT8 dsw2 = ~ioport("DSW2")->read(); + uint8_t dsw = 0; + uint8_t dsw1 = ~ioport("DSW1")->read(); + uint8_t dsw2 = ~ioport("DSW2")->read(); switch ((m_beast_p0 >> 5) & 3) { @@ -505,9 +505,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(djboy_state::djboy_scanline) void djboy_state::machine_start() { - UINT8 *MAIN = memregion("maincpu")->base(); - UINT8 *CPU1 = memregion("cpu1")->base(); - UINT8 *CPU2 = memregion("cpu2")->base(); + uint8_t *MAIN = memregion("maincpu")->base(); + uint8_t *CPU1 = memregion("cpu1")->base(); + uint8_t *CPU2 = memregion("cpu2")->base(); membank("bank1")->configure_entries(0, 4, &MAIN[0x00000], 0x2000); membank("bank1")->configure_entries(4, 28, &MAIN[0x10000], 0x2000); diff --git a/src/mame/drivers/djmain.cpp b/src/mame/drivers/djmain.cpp index 892de322f3c..cff47d0f6d6 100644 --- a/src/mame/drivers/djmain.cpp +++ b/src/mame/drivers/djmain.cpp @@ -102,7 +102,7 @@ WRITE32_MEMBER(djmain_state::sndram_bank_w) READ32_MEMBER(djmain_state::sndram_r) { - UINT32 data = 0; + uint32_t data = 0; if (ACCESSING_BITS_24_31) data |= m_sndram[offset * 4] << 24; @@ -154,7 +154,7 @@ WRITE32_MEMBER(djmain_state::obj_ctrl_w) READ32_MEMBER(djmain_state::obj_rom_r) { - UINT8 *mem8 = memregion("gfx1")->base(); + uint8_t *mem8 = memregion("gfx1")->base(); int bank = m_obj_regs[0x28/4] >> 16; offset += bank * 0x200; @@ -190,7 +190,7 @@ WRITE32_MEMBER(djmain_state::v_ctrl_w) READ32_MEMBER(djmain_state::v_rom_r) { - UINT8 *mem8 = memregion("gfx2")->base(); + uint8_t *mem8 = memregion("gfx2")->base(); int bank = m_k056832->word_r(space, 0x34/2, 0xffff); offset *= 2; @@ -223,11 +223,11 @@ READ8_MEMBER(djmain_state::inp2_r) READ32_MEMBER(djmain_state::turntable_r) { - UINT32 result = 0; + uint32_t result = 0; if (ACCESSING_BITS_8_15) { - UINT8 pos; + uint8_t pos; int delta; pos = m_turntable[m_turntable_select].read_safe(0); @@ -1989,7 +1989,7 @@ DRIVER_INIT_MEMBER(djmain_state,beatmania) m_ata_user_password = nullptr; } -static const UINT8 beatmania_master_password[2 + 32] = +static const uint8_t beatmania_master_password[2 + 32] = { 0x01, 0x00, 0x4d, 0x47, 0x43, 0x28, 0x4b, 0x29, 0x4e, 0x4f, @@ -2000,7 +2000,7 @@ static const UINT8 beatmania_master_password[2 + 32] = DRIVER_INIT_MEMBER(djmain_state,hmcompmx) { - static const UINT8 hmcompmx_user_password[2 + 32] = + static const uint8_t hmcompmx_user_password[2 + 32] = { 0x00, 0x00, 0x44, 0x42, 0x56, 0x4b, 0x3a, 0x34, 0x38, 0x2a, @@ -2017,7 +2017,7 @@ DRIVER_INIT_MEMBER(djmain_state,hmcompmx) DRIVER_INIT_MEMBER(djmain_state,bm4thmix) { - static const UINT8 bm4thmix_user_password[2 + 32] = + static const uint8_t bm4thmix_user_password[2 + 32] = { 0x00, 0x00, 0x44, 0x42, 0x29, 0x4b, 0x2f, 0x2c, 0x4c, 0x32, @@ -2033,7 +2033,7 @@ DRIVER_INIT_MEMBER(djmain_state,bm4thmix) DRIVER_INIT_MEMBER(djmain_state,bm5thmix) { - static const UINT8 bm5thmix_user_password[2 + 32] = + static const uint8_t bm5thmix_user_password[2 + 32] = { 0x00, 0x00, 0x44, 0x42, 0x56, 0x4b, 0x37, 0x35, 0x4a, 0x23, @@ -2050,7 +2050,7 @@ DRIVER_INIT_MEMBER(djmain_state,bm5thmix) DRIVER_INIT_MEMBER(djmain_state,bmclubmx) { - static const UINT8 bmclubmx_user_password[2 + 32] = + static const uint8_t bmclubmx_user_password[2 + 32] = { 0x00, 0x00, 0x44, 0x20, 0x30, 0x57, 0x3c, 0x3f, 0x38, 0x32, @@ -2068,7 +2068,7 @@ DRIVER_INIT_MEMBER(djmain_state,bmclubmx) DRIVER_INIT_MEMBER(djmain_state,bmcompm2) { - static const UINT8 bmcompm2_user_password[2 + 32] = + static const uint8_t bmcompm2_user_password[2 + 32] = { 0x00, 0x00, 0x3a, 0x20, 0x31, 0x3e, 0x46, 0x2c, 0x35, 0x46, @@ -2085,7 +2085,7 @@ DRIVER_INIT_MEMBER(djmain_state,bmcompm2) DRIVER_INIT_MEMBER(djmain_state,hmcompm2) { - static const UINT8 hmcompm2_user_password[2 + 32] = + static const uint8_t hmcompm2_user_password[2 + 32] = { 0x00, 0x00, 0x3b, 0x39, 0x24, 0x3e, 0x4e, 0x59, 0x5c, 0x32, @@ -2102,7 +2102,7 @@ DRIVER_INIT_MEMBER(djmain_state,hmcompm2) DRIVER_INIT_MEMBER(djmain_state,bmdct) { - static const UINT8 bmdct_user_password[2 + 32] = + static const uint8_t bmdct_user_password[2 + 32] = { 0x00, 0x00, 0x52, 0x47, 0x30, 0x3f, 0x2f, 0x39, 0x54, 0x5e, @@ -2119,7 +2119,7 @@ DRIVER_INIT_MEMBER(djmain_state,bmdct) DRIVER_INIT_MEMBER(djmain_state,bmcorerm) { - static const UINT8 bmcorerm_user_password[2 + 32] = + static const uint8_t bmcorerm_user_password[2 + 32] = { 0x00, 0x00, 0x44, 0x42, 0x56, 0x4b, 0x3f, 0x4d, 0x4a, 0x27, @@ -2136,7 +2136,7 @@ DRIVER_INIT_MEMBER(djmain_state,bmcorerm) DRIVER_INIT_MEMBER(djmain_state,bm6thmix) { - static const UINT8 bm6thmix_user_password[2 + 32] = + static const uint8_t bm6thmix_user_password[2 + 32] = { 0x00, 0x00, 0x44, 0x42, 0x56, 0x4b, 0x3d, 0x4d, 0x4a, 0x23, @@ -2153,7 +2153,7 @@ DRIVER_INIT_MEMBER(djmain_state,bm6thmix) DRIVER_INIT_MEMBER(djmain_state,bm7thmix) { - static const UINT8 bm7thmix_user_password[2 + 32] = + static const uint8_t bm7thmix_user_password[2 + 32] = { 0x00, 0x00, 0x44, 0x42, 0x56, 0x4b, 0x3f, 0x4e, 0x4a, 0x25, @@ -2170,7 +2170,7 @@ DRIVER_INIT_MEMBER(djmain_state,bm7thmix) DRIVER_INIT_MEMBER(djmain_state,bmfinal) { - static const UINT8 bmfinal_user_password[2 + 32] = + static const uint8_t bmfinal_user_password[2 + 32] = { 0x00, 0x00, 0x44, 0x42, 0x56, 0x4b, 0x3f, 0x4f, 0x4a, 0x23, diff --git a/src/mame/drivers/dkong.cpp b/src/mame/drivers/dkong.cpp index 9d942940615..a871124363e 100644 --- a/src/mame/drivers/dkong.cpp +++ b/src/mame/drivers/dkong.cpp @@ -470,7 +470,7 @@ MACHINE_START_MEMBER(dkong_state,dkong2b) MACHINE_START_MEMBER(dkong_state,s2650) { - UINT8 *p = memregion("user1")->base(); + uint8_t *p = memregion("user1")->base(); const char *game_name = machine().system().name; int i; @@ -527,7 +527,7 @@ MACHINE_RESET_MEMBER(dkong_state,dkong) MACHINE_RESET_MEMBER(dkong_state,strtheat) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); MACHINE_RESET_CALL_MEMBER(dkong); @@ -539,7 +539,7 @@ MACHINE_RESET_MEMBER(dkong_state,strtheat) MACHINE_RESET_MEMBER(dkong_state,drakton) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); MACHINE_RESET_CALL_MEMBER(dkong); @@ -615,8 +615,8 @@ WRITE8_MEMBER(dkong_state::p8257_drq_w) READ8_MEMBER(dkong_state::dkong_in2_r) { /* mcu status (sound feedback) is inverted bit4 from port B (8039) */ - UINT8 mcustatus = m_dev_vp2->bit4_q_r(space, 0); - UINT8 r; + uint8_t mcustatus = m_dev_vp2->bit4_q_r(space, 0); + uint8_t r; r = (ioport("IN2")->read() & 0xBF) | (mcustatus << 6); machine().bookkeeping().coin_counter_w(offset, r >> 7); @@ -629,7 +629,7 @@ READ8_MEMBER(dkong_state::dkongjr_in2_r) { /* dkongjr does not have the mcu line connected */ - UINT8 r; + uint8_t r; r = (ioport("IN2")->read() & 0xBF) | 0x40; machine().bookkeeping().coin_counter_w(offset, r >> 7); @@ -1659,12 +1659,12 @@ WRITE8_MEMBER(dkong_state::braze_eeprom_w) m_eeprom->clk_write(data & 0x02 ? ASSERT_LINE : CLEAR_LINE); } -void dkong_state::braze_decrypt_rom(UINT8 *dest) +void dkong_state::braze_decrypt_rom(uint8_t *dest) { - UINT8 oldbyte,newbyte; - UINT8 *ROM; - UINT32 mem; - UINT32 newmem; + uint8_t oldbyte,newbyte; + uint8_t *ROM; + uint32_t mem; + uint32_t newmem; ROM = memregion("braze")->base(); @@ -3197,10 +3197,10 @@ ROM_END * *************************************/ -void dkong_state::drakton_decrypt_rom(UINT8 mod, int offs, int *bs) +void dkong_state::drakton_decrypt_rom(uint8_t mod, int offs, int *bs) { - UINT8 oldbyte,newbyte; - UINT8 *ROM; + uint8_t oldbyte,newbyte; + uint8_t *ROM; int mem; ROM = memregion("maincpu")->base(); @@ -3229,7 +3229,7 @@ void dkong_state::drakton_decrypt_rom(UINT8 mod, int offs, int *bs) DRIVER_INIT_MEMBER(dkong_state,herodk) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* swap data lines D3 and D4 */ for (A = 0;A < 0x8000;A++) @@ -3296,7 +3296,7 @@ DRIVER_INIT_MEMBER(dkong_state,dkongx) { address_space &space = m_maincpu->space(AS_PROGRAM); - m_decrypted = std::make_unique(0x10000); + m_decrypted = std::make_unique(0x10000); m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x5fff, "bank1" ); m_maincpu->space(AS_PROGRAM).install_read_bank(0x8000, 0xffff, "bank2" ); @@ -3316,7 +3316,7 @@ DRIVER_INIT_MEMBER(dkong_state,dkongx) DRIVER_INIT_MEMBER(dkong_state,dkingjr) { - UINT8 *prom = memregion("proms")->base(); + uint8_t *prom = memregion("proms")->base(); for( int i=0; i<0x200; ++i) { prom[i]^=0xff; // invert color data diff --git a/src/mame/drivers/dlair.cpp b/src/mame/drivers/dlair.cpp index 7b6328cc855..802a2af1c3c 100644 --- a/src/mame/drivers/dlair.cpp +++ b/src/mame/drivers/dlair.cpp @@ -71,22 +71,22 @@ public: optional_device m_ldv1000; optional_device m_pr7820; optional_device m_22vp932; - optional_shared_ptr m_videoram; + optional_shared_ptr m_videoram; - void laserdisc_data_w(UINT8 data) + void laserdisc_data_w(uint8_t data) { if (m_ldv1000 != nullptr) m_ldv1000->data_w(data); if (m_pr7820 != nullptr) m_pr7820->data_w(data); if (m_22vp932 != nullptr) m_22vp932->data_w(data); } - void laserdisc_enter_w(UINT8 data) + void laserdisc_enter_w(uint8_t data) { if (m_pr7820 != nullptr) m_pr7820->enter_w(data); if (m_22vp932 != nullptr) m_22vp932->enter_w(data); } - UINT8 laserdisc_data_r() + uint8_t laserdisc_data_r() { if (m_ldv1000 != nullptr) return m_ldv1000->status_r(); if (m_pr7820 != nullptr) return m_pr7820->data_r(); @@ -94,26 +94,26 @@ public: return 0; } - UINT8 laserdisc_data_available_r() + uint8_t laserdisc_data_available_r() { return CLEAR_LINE; } - UINT8 laserdisc_status_r() + uint8_t laserdisc_status_r() { if (m_ldv1000 != nullptr) return m_ldv1000->status_strobe_r(); return CLEAR_LINE; } - UINT8 laserdisc_ready_r() + uint8_t laserdisc_ready_r() { if (m_ldv1000 != nullptr) return m_ldv1000->command_strobe_r(); if (m_pr7820 != nullptr) return m_pr7820->ready_r(); return CLEAR_LINE; } - UINT8 m_last_misc; - UINT8 m_laserdisc_data; + uint8_t m_last_misc; + uint8_t m_laserdisc_data; DECLARE_WRITE8_MEMBER(misc_w); DECLARE_WRITE8_MEMBER(dleuro_misc_w); DECLARE_WRITE8_MEMBER(led_den1_w); @@ -127,7 +127,7 @@ public: DECLARE_MACHINE_START(dlair); DECLARE_MACHINE_RESET(dlair); DECLARE_PALETTE_INIT(dleuro); - UINT32 screen_update_dleuro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dleuro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(write_speaker); }; @@ -153,7 +153,7 @@ public: -static const UINT8 led_map[16] = +static const uint8_t led_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x77,0x7c,0x39,0x5e,0x79,0x00 }; @@ -204,16 +204,16 @@ PALETTE_INIT_MEMBER(dlair_state,dleuro) * *************************************/ -UINT32 dlair_state::screen_update_dleuro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dlair_state::screen_update_dleuro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int x, y; /* redraw the overlay */ for (y = 0; y < 32; y++) for (x = 0; x < 32; x++) { - UINT8 *base = &videoram[y * 64 + x * 2 + 1]; + uint8_t *base = &videoram[y * 64 + x * 2 + 1]; // TODO: opaque? m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, base[0], base[1], 0, 0, 10 * x, 16 * y); } @@ -264,7 +264,7 @@ WRITE8_MEMBER(dlair_state::misc_w) D6 = ENTER D7 = INT/EXT */ - UINT8 diff = data ^ m_last_misc; + uint8_t diff = data ^ m_last_misc; m_last_misc = data; machine().bookkeeping().coin_counter_w(0, (~data >> 4) & 1); @@ -290,7 +290,7 @@ WRITE8_MEMBER(dlair_state::dleuro_misc_w) D6 = ENTER D7 = INT/EXT */ - UINT8 diff = data ^ m_last_misc; + uint8_t diff = data ^ m_last_misc; m_last_misc = data; machine().bookkeeping().coin_counter_w(1, (~data >> 3) & 1); @@ -338,7 +338,7 @@ CUSTOM_INPUT_MEMBER(dlair_state::laserdisc_command_r) READ8_MEMBER(dlair_state::laserdisc_r) { - UINT8 result = laserdisc_data_r(); + uint8_t result = laserdisc_data_r(); osd_printf_debug("laserdisc_r = %02X\n", result); return result; } diff --git a/src/mame/drivers/dlair2.cpp b/src/mame/drivers/dlair2.cpp index 0b246616fe0..d95ab6eec01 100644 --- a/src/mame/drivers/dlair2.cpp +++ b/src/mame/drivers/dlair2.cpp @@ -46,7 +46,7 @@ public: required_device m_maincpu; // screen updates - 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); INTERRUPT_GEN_MEMBER(dlair2_timer_irq); DECLARE_PALETTE_INIT(dlair2); @@ -63,7 +63,7 @@ void dlair2_state::video_start() { } -UINT32 dlair2_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t dlair2_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } diff --git a/src/mame/drivers/dm7000.cpp b/src/mame/drivers/dm7000.cpp index 24a6fe48f2c..fa7ea856385 100644 --- a/src/mame/drivers/dm7000.cpp +++ b/src/mame/drivers/dm7000.cpp @@ -58,7 +58,7 @@ static inline void ATTR_PRINTF(3,4) verboselog( device_t &device, int n_level, c READ8_MEMBER( dm7000_state::dm7000_iic0_r ) { - UINT8 data = 0; // dummy + uint8_t data = 0; // dummy verboselog(*this, 9, "(IIC0) %08X -> %08X\n", 0x40030000 + offset, data); return data; } @@ -70,7 +70,7 @@ WRITE8_MEMBER( dm7000_state::dm7000_iic0_w ) READ8_MEMBER( dm7000_state::dm7000_iic1_r ) { - UINT8 data = 0; // dummy + uint8_t data = 0; // dummy verboselog(*this, 9, "(IIC1) %08X -> %08X\n", 0x400b0000 + offset, data); return data; } @@ -82,7 +82,7 @@ WRITE8_MEMBER( dm7000_state::dm7000_iic1_w ) READ8_MEMBER( dm7000_state::dm7000_scc0_r ) { - UINT8 data = 0; + uint8_t data = 0; switch(offset) { case UART_THR: data = m_term_data; @@ -119,7 +119,7 @@ WRITE8_MEMBER( dm7000_state::dm7000_scc0_w ) READ8_MEMBER( dm7000_state::dm7000_gpio0_r ) { - UINT8 data = 0; // dummy + uint8_t data = 0; // dummy verboselog(*this, 9, "(GPIO0) %08X -> %08X\n", 0x40060000 + offset, data); return data; } @@ -131,7 +131,7 @@ WRITE8_MEMBER( dm7000_state::dm7000_gpio0_w ) READ8_MEMBER( dm7000_state::dm7000_scp0_r ) { - UINT8 data = 0; // dummy + uint8_t data = 0; // dummy switch(offset) { case SCP_STATUS: data = SCP_STATUS_RXRDY; @@ -153,7 +153,7 @@ WRITE8_MEMBER( dm7000_state::dm7000_scp0_w ) READ16_MEMBER( dm7000_state::dm7000_enet_r ) { - UINT16 data; + uint16_t data; switch (offset) { case 0x01: data = 0x1801; @@ -267,7 +267,7 @@ void dm7000_state::video_start() { } -UINT32 dm7000_state::screen_update_dm7000(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t dm7000_state::screen_update_dm7000(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/dmax8000.cpp b/src/mame/drivers/dmax8000.cpp index 797200876db..40b40fc65d4 100644 --- a/src/mame/drivers/dmax8000.cpp +++ b/src/mame/drivers/dmax8000.cpp @@ -140,7 +140,7 @@ MACHINE_RESET_MEMBER( dmax8000_state, dmax8000 ) DRIVER_INIT_MEMBER( dmax8000_state, dmax8000 ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x10000]); diff --git a/src/mame/drivers/dmndrby.cpp b/src/mame/drivers/dmndrby.cpp index 233ee5bf0f1..77d521a461a 100644 --- a/src/mame/drivers/dmndrby.cpp +++ b/src/mame/drivers/dmndrby.cpp @@ -74,13 +74,13 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_scroll_ram; - required_shared_ptr m_sprite_ram; - required_shared_ptr m_dderby_vidchars; - required_shared_ptr m_dderby_vidattribs; - UINT8 *m_racetrack_tilemap_rom; + required_shared_ptr m_scroll_ram; + required_shared_ptr m_sprite_ram; + required_shared_ptr m_dderby_vidchars; + required_shared_ptr m_dderby_vidattribs; + uint8_t *m_racetrack_tilemap_rom; tilemap_t *m_racetrack_tilemap; - UINT8 m_io_port[8]; + uint8_t m_io_port[8]; int m_bg; DECLARE_WRITE8_MEMBER(dderby_sound_w); DECLARE_READ8_MEMBER(input_r); @@ -88,7 +88,7 @@ public: TILE_GET_INFO_MEMBER(get_dmndrby_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(dmndrby); - UINT32 screen_update_dderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(dderby_irq); INTERRUPT_GEN_MEMBER(dderby_timer_irq); required_device m_maincpu; @@ -362,7 +362,7 @@ void dmndrby_state::video_start() } -UINT32 dmndrby_state::screen_update_dderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dmndrby_state::screen_update_dderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count; int off,scrolly; @@ -461,7 +461,7 @@ wouldnt like to say its the most effective way though... // copied from elsewhere. surely incorrect PALETTE_INIT_MEMBER(dmndrby_state, dmndrby) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); static const int resistances_rg[3] = { 1000, 470, 220 }; static const int resistances_b [2] = { 470, 220 }; double rweights[3], gweights[3], bweights[2]; @@ -505,7 +505,7 @@ PALETTE_INIT_MEMBER(dmndrby_state, dmndrby) /* normal tiles use colors 0-15 */ for (i = 0x000; i < 0x300; i++) { - UINT8 ctabentry = color_prom[i]; + uint8_t ctabentry = color_prom[i]; palette.set_pen_indirect(i, ctabentry); } } diff --git a/src/mame/drivers/dms5000.cpp b/src/mame/drivers/dms5000.cpp index 49ed1049d85..ca4cbc7f732 100644 --- a/src/mame/drivers/dms5000.cpp +++ b/src/mame/drivers/dms5000.cpp @@ -21,7 +21,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_dms5000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dms5000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -49,7 +49,7 @@ void dms5000_state::video_start() { } -UINT32 dms5000_state::screen_update_dms5000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dms5000_state::screen_update_dms5000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/dms86.cpp b/src/mame/drivers/dms86.cpp index 5ce16471276..8a8bb7d0997 100644 --- a/src/mame/drivers/dms86.cpp +++ b/src/mame/drivers/dms86.cpp @@ -47,8 +47,8 @@ public: DECLARE_READ16_MEMBER( dms86_86_r ); DECLARE_READ16_MEMBER( dms86_9a_r ); DECLARE_WRITE8_MEMBER( kbd_put ); - UINT8 *m_ram; - UINT8 m_term_data; + uint8_t *m_ram; + uint8_t m_term_data; virtual void machine_reset() override; }; @@ -61,7 +61,7 @@ READ16_MEMBER( dms86_state::dms86_82_r ) READ16_MEMBER( dms86_state::dms86_84_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/dmv.cpp b/src/mame/drivers/dmv.cpp index b3dd19bc09a..1a1a2d49da0 100644 --- a/src/mame/drivers/dmv.cpp +++ b/src/mame/drivers/dmv.cpp @@ -74,7 +74,7 @@ public: required_device m_floppy1; required_device m_keyboard; required_device m_speaker; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; required_device m_palette; required_memory_region m_ram; required_memory_region m_bootrom; @@ -141,16 +141,16 @@ public: DECLARE_FLOPPY_FORMATS( floppy_formats ); - UINT8 program_read(address_space &space, int cas, offs_t offset); - void program_write(address_space &space, int cas, offs_t offset, UINT8 data); + uint8_t program_read(address_space &space, int cas, offs_t offset); + void program_write(address_space &space, int cas, offs_t offset, uint8_t data); - void ifsel_r(address_space &space, int ifsel, offs_t offset, UINT8 &data); - void ifsel_w(address_space &space, int ifsel, offs_t offset, UINT8 data); - DECLARE_READ8_MEMBER(ifsel0_r) { UINT8 data = 0xff; ifsel_r(space, 0, offset, data); return data; } - DECLARE_READ8_MEMBER(ifsel1_r) { UINT8 data = 0xff; ifsel_r(space, 1, offset, data); return data; } - DECLARE_READ8_MEMBER(ifsel2_r) { UINT8 data = 0xff; ifsel_r(space, 2, offset, data); return data; } - DECLARE_READ8_MEMBER(ifsel3_r) { UINT8 data = 0xff; ifsel_r(space, 3, offset, data); return data; } - DECLARE_READ8_MEMBER(ifsel4_r) { UINT8 data = 0xff; ifsel_r(space, 4, offset, data); return data; } + void ifsel_r(address_space &space, int ifsel, offs_t offset, uint8_t &data); + void ifsel_w(address_space &space, int ifsel, offs_t offset, uint8_t data); + DECLARE_READ8_MEMBER(ifsel0_r) { uint8_t data = 0xff; ifsel_r(space, 0, offset, data); return data; } + DECLARE_READ8_MEMBER(ifsel1_r) { uint8_t data = 0xff; ifsel_r(space, 1, offset, data); return data; } + DECLARE_READ8_MEMBER(ifsel2_r) { uint8_t data = 0xff; ifsel_r(space, 2, offset, data); return data; } + DECLARE_READ8_MEMBER(ifsel3_r) { uint8_t data = 0xff; ifsel_r(space, 3, offset, data); return data; } + DECLARE_READ8_MEMBER(ifsel4_r) { uint8_t data = 0xff; ifsel_r(space, 4, offset, data); return data; } DECLARE_WRITE8_MEMBER(ifsel0_w) { ifsel_w(space, 0, offset, data); } DECLARE_WRITE8_MEMBER(ifsel1_w) { ifsel_w(space, 1, offset, data); } DECLARE_WRITE8_MEMBER(ifsel2_w) { ifsel_w(space, 2, offset, data); } @@ -255,7 +255,7 @@ READ8_MEMBER(dmv_state::sys_status_r) ---- --x- 16-bit CPU available (active low) ---- ---x FDD motor (active low) */ - UINT8 data = 0x00; + uint8_t data = 0x00; if (m_floppy_motor) data |= 0x01; @@ -287,9 +287,9 @@ UPD7220_DISPLAY_PIXELS_MEMBER( dmv_state::hgdc_display_pixels ) if (m_color_mode) { // 96KB videoram (32KB green + 32KB red + 32KB blue) - UINT16 green = m_video_ram[(0x00000 + (address & 0x7fff)) >> 1]; - UINT16 red = m_video_ram[(0x08000 + (address & 0x7fff)) >> 1]; - UINT16 blue = m_video_ram[(0x10000 + (address & 0x7fff)) >> 1]; + uint16_t green = m_video_ram[(0x00000 + (address & 0x7fff)) >> 1]; + uint16_t red = m_video_ram[(0x08000 + (address & 0x7fff)) >> 1]; + uint16_t blue = m_video_ram[(0x10000 + (address & 0x7fff)) >> 1]; for(int xi=0; xi<16; xi++) { @@ -306,7 +306,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( dmv_state::hgdc_display_pixels ) const rgb_t *palette = m_palette->palette()->entry_list_raw(); // 32KB videoram - UINT16 gfx = m_video_ram[(address & 0xffff) >> 1]; + uint16_t gfx = m_video_ram[(address & 0xffff) >> 1]; for(int xi=0;xi<16;xi++) { @@ -320,8 +320,8 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( dmv_state::hgdc_draw_text ) { for( int x = 0; x < pitch; x++ ) { - UINT8 tile = m_video_ram[(((addr+x)*2) & 0x1ffff) >> 1] & 0xff; - UINT8 attr = m_video_ram[(((addr+x)*2) & 0x1ffff) >> 1] >> 8; + uint8_t tile = m_video_ram[(((addr+x)*2) & 0x1ffff) >> 1] & 0xff; + uint8_t attr = m_video_ram[(((addr+x)*2) & 0x1ffff) >> 1] >> 8; rgb_t bg, fg; if (m_color_mode) @@ -338,7 +338,7 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( dmv_state::hgdc_draw_text ) for( int yi = 0; yi < lr; yi++) { - UINT8 tile_data = m_chargen->base()[(tile*16+yi) & 0x7ff]; + uint8_t tile_data = m_chargen->base()[(tile*16+yi) & 0x7ff]; if(cursor_on && cursor_addr == addr+x) //TODO tile_data^=0xff; @@ -368,14 +368,14 @@ static SLOT_INTERFACE_START( dmv_floppies ) SLOT_INTERFACE_END -void dmv_state::ifsel_r(address_space &space, int ifsel, offs_t offset, UINT8 &data) +void dmv_state::ifsel_r(address_space &space, int ifsel, offs_t offset, uint8_t &data) { dmvcart_slot_device *slots[] = { m_slot2, m_slot2a, m_slot3, m_slot4, m_slot5, m_slot6, m_slot7, m_slot7a }; for(auto & slot : slots) slot->io_read(space, ifsel, offset, data); } -void dmv_state::ifsel_w(address_space &space, int ifsel, offs_t offset, UINT8 data) +void dmv_state::ifsel_w(address_space &space, int ifsel, offs_t offset, uint8_t data) { dmvcart_slot_device *slots[] = { m_slot2, m_slot2a, m_slot3, m_slot4, m_slot5, m_slot6, m_slot7, m_slot7a }; for(auto & slot : slots) @@ -461,7 +461,7 @@ void dmv_state::update_irqs(int slot, int state) } } -void dmv_state::program_write(address_space &space, int cas, offs_t offset, UINT8 data) +void dmv_state::program_write(address_space &space, int cas, offs_t offset, uint8_t data) { bool tramd = false; dmvcart_slot_device *slots[] = { m_slot2, m_slot2a, m_slot3, m_slot4, m_slot5, m_slot6, m_slot7, m_slot7a }; @@ -477,9 +477,9 @@ void dmv_state::program_write(address_space &space, int cas, offs_t offset, UINT } } -UINT8 dmv_state::program_read(address_space &space, int cas, offs_t offset) +uint8_t dmv_state::program_read(address_space &space, int cas, offs_t offset) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_ramoutdis && offset < 0x2000) { data = m_bootrom->base()[offset]; diff --git a/src/mame/drivers/dolphunk.cpp b/src/mame/drivers/dolphunk.cpp index c670612a507..eaa053ce26c 100644 --- a/src/mame/drivers/dolphunk.cpp +++ b/src/mame/drivers/dolphunk.cpp @@ -105,8 +105,8 @@ public: DECLARE_WRITE8_MEMBER(port06_w); TIMER_DEVICE_CALLBACK_MEMBER(dauphin_c); private: - UINT8 m_cass_data; - UINT8 m_last_key; + uint8_t m_cass_data; + uint8_t m_last_key; bool m_cass_state; bool m_cassold; bool m_speaker_state; @@ -138,7 +138,7 @@ WRITE8_MEMBER( dauphin_state::port06_w ) READ8_MEMBER( dauphin_state::port07_r ) { - UINT8 keyin, i, data = 0x40; + uint8_t keyin, i, data = 0x40; keyin = ioport("X0")->read(); if (keyin != 0xff) diff --git a/src/mame/drivers/dominob.cpp b/src/mame/drivers/dominob.cpp index 1e64e010e4e..cbfa5ad4b68 100644 --- a/src/mame/drivers/dominob.cpp +++ b/src/mame/drivers/dominob.cpp @@ -79,17 +79,17 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_bgram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_bgram; /* input-related */ - //UINT8 m_paddle_select; - //UINT8 m_paddle_value; + //uint8_t m_paddle_select; + //uint8_t m_paddle_value; DECLARE_WRITE8_MEMBER(dominob_d008_w); DECLARE_READ8_MEMBER(dominob_unk_port02_r); virtual void video_start() override; - UINT32 screen_update_dominob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dominob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; @@ -130,7 +130,7 @@ void dominob_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprec } -UINT32 dominob_state::screen_update_dominob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dominob_state::screen_update_dominob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int index = 0; diff --git a/src/mame/drivers/dorachan.cpp b/src/mame/drivers/dorachan.cpp index daf69583d1a..5415e196cf4 100644 --- a/src/mame/drivers/dorachan.cpp +++ b/src/mame/drivers/dorachan.cpp @@ -31,16 +31,16 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_videoram; - required_region_ptr m_colors; + required_shared_ptr m_videoram; + required_region_ptr m_colors; // internal state - UINT8 m_flip_screen; + uint8_t m_flip_screen; DECLARE_WRITE8_MEMBER(control_w); DECLARE_READ8_MEMBER(protection_r); DECLARE_READ8_MEMBER(v128_r); - UINT32 screen_update_dorachan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dorachan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void machine_start() override; virtual void machine_reset() override; @@ -54,19 +54,19 @@ public: * *************************************/ -UINT32 dorachan_state::screen_update_dorachan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t dorachan_state::screen_update_dorachan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (offs_t offs = 0; offs < m_videoram.bytes(); offs++) { - UINT8 fore_color; + uint8_t fore_color; - UINT8 x = offs >> 8 << 3; - UINT8 y = offs & 0xff; + uint8_t x = offs >> 8 << 3; + uint8_t y = offs & 0xff; /* the need for +1 is extremely unusual, but definitely correct */ offs_t color_address = ((((offs << 2) & 0x03e0) | (offs >> 8)) + 1) & 0x03ff; - UINT8 data = m_videoram[offs]; + uint8_t data = m_videoram[offs]; if (m_flip_screen) fore_color = (m_colors[color_address] >> 3) & 0x07; @@ -75,7 +75,7 @@ UINT32 dorachan_state::screen_update_dorachan(screen_device &screen, bitmap_rgb3 for (int i = 0; i < 8; i++) { - UINT8 color = (data & 0x01) ? fore_color : 0; + uint8_t color = (data & 0x01) ? fore_color : 0; bitmap.pix32(y, x) = m_palette->pen_color(color); data = data >> 1; @@ -96,7 +96,7 @@ UINT32 dorachan_state::screen_update_dorachan(screen_device &screen, bitmap_rgb3 READ8_MEMBER(dorachan_state::protection_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch (m_maincpu->pcbase()) { diff --git a/src/mame/drivers/dotrikun.cpp b/src/mame/drivers/dotrikun.cpp index 2eb5bc38c55..a06ebd7ffcc 100644 --- a/src/mame/drivers/dotrikun.cpp +++ b/src/mame/drivers/dotrikun.cpp @@ -46,16 +46,16 @@ public: required_device m_maincpu; required_device m_screen; - required_shared_ptr m_vram; + required_shared_ptr m_vram; required_device m_interrupt_timer; required_device m_scanline_off_timer; - UINT8 m_vram_latch; - UINT8 m_color; + uint8_t m_vram_latch; + uint8_t m_color; DECLARE_WRITE8_MEMBER(vram_w); DECLARE_WRITE8_MEMBER(color_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); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); TIMER_DEVICE_CALLBACK_MEMBER(scanline_off); TIMER_DEVICE_CALLBACK_MEMBER(scanline_on); @@ -111,7 +111,7 @@ WRITE8_MEMBER(dotrikun_state::color_w) } -UINT32 dotrikun_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dotrikun_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { diff --git a/src/mame/drivers/dps1.cpp b/src/mame/drivers/dps1.cpp index fbc4ce53ae2..cd0f3e04f7f 100644 --- a/src/mame/drivers/dps1.cpp +++ b/src/mame/drivers/dps1.cpp @@ -47,8 +47,8 @@ public: private: bool m_dma_dir; - UINT16 m_dma_adr; - UINT8 m_term_data; + uint16_t m_dma_adr; + uint8_t m_term_data; required_device m_maincpu; required_device m_fdc; required_device m_floppy0; @@ -79,7 +79,7 @@ ADDRESS_MAP_END // uart in READ8_MEMBER( dps1_state::port00_r ) { - UINT8 data = 0x4e; + uint8_t data = 0x4e; switch(offset) { case 0: @@ -191,7 +191,7 @@ MACHINE_RESET_MEMBER( dps1_state, dps1 ) DRIVER_INIT_MEMBER( dps1_state, dps1 ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x0400]); diff --git a/src/mame/drivers/dragrace.cpp b/src/mame/drivers/dragrace.cpp index 5a8a1ecb968..a540f882473 100644 --- a/src/mame/drivers/dragrace.cpp +++ b/src/mame/drivers/dragrace.cpp @@ -97,7 +97,7 @@ void dragrace_state::dragrace_update_misc_flags( address_space &space ) WRITE8_MEMBER(dragrace_state::dragrace_misc_w) { /* Set/clear individual bit */ - UINT32 mask = 1 << offset; + uint32_t mask = 1 << offset; if (data & 0x01) m_misc_flags |= mask; else @@ -109,7 +109,7 @@ WRITE8_MEMBER(dragrace_state::dragrace_misc_w) WRITE8_MEMBER(dragrace_state::dragrace_misc_clear_w) { /* Clear 8 bits */ - UINT32 mask = 0xff << (((offset >> 3) & 0x03) * 8); + uint32_t mask = 0xff << (((offset >> 3) & 0x03) * 8); m_misc_flags &= (~mask); logerror("Clear %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0920 + offset, mask, m_misc_flags, data & 0x01); dragrace_update_misc_flags(space); @@ -120,8 +120,8 @@ READ8_MEMBER(dragrace_state::dragrace_input_r) int val = ioport("IN2")->read(); static const char *const portnames[] = { "IN0", "IN1" }; - UINT8 maskA = 1 << (offset % 8); - UINT8 maskB = 1 << (offset / 8); + uint8_t maskA = 1 << (offset % 8); + uint8_t maskB = 1 << (offset / 8); for (int i = 0; i < 2; i++) { diff --git a/src/mame/drivers/dreambal.cpp b/src/mame/drivers/dreambal.cpp index 60e9653a1d5..59b95ffca12 100644 --- a/src/mame/drivers/dreambal.cpp +++ b/src/mame/drivers/dreambal.cpp @@ -51,7 +51,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_dreambal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dreambal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECO16IC_BANK_CB_MEMBER(bank_callback); DECLARE_READ16_MEMBER( dreambal_protection_region_0_104_r ); @@ -74,10 +74,10 @@ public: }; -UINT32 dreambal_state::screen_update_dreambal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dreambal_state::screen_update_dreambal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &space = generic_space(); - UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); m_deco_tilegen1->pf_update(nullptr, nullptr); @@ -95,8 +95,8 @@ READ16_MEMBER( dreambal_state::dreambal_protection_region_0_104_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco104->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco104->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -104,7 +104,7 @@ WRITE16_MEMBER( dreambal_state::dreambal_protection_region_0_104_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco104->write_data( space, deco146_addr, data, mem_mask, cs ); } diff --git a/src/mame/drivers/dreamwld.cpp b/src/mame/drivers/dreamwld.cpp index 55632cea6d8..1d3d7580b4b 100644 --- a/src/mame/drivers/dreamwld.cpp +++ b/src/mame/drivers/dreamwld.cpp @@ -116,13 +116,13 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_bg2_videoram; - required_shared_ptr m_vregs; - required_shared_ptr m_workram; + required_shared_ptr m_spriteram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_bg2_videoram; + required_shared_ptr m_vregs; + required_shared_ptr m_workram; - std::unique_ptr m_lineram16; + std::unique_ptr m_lineram16; DECLARE_READ16_MEMBER(lineram16_r) { return m_lineram16[offset]; } DECLARE_WRITE16_MEMBER(lineram16_w) { COMBINE_DATA(&m_lineram16[offset]); } @@ -133,8 +133,8 @@ public: int m_tilebank[2]; int m_tilebankold[2]; - std::unique_ptr m_spritebuf1; - std::unique_ptr m_spritebuf2; + std::unique_ptr m_spritebuf1; + std::unique_ptr m_spritebuf2; /* misc */ int m_protindex; @@ -148,7 +148,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_dreamwld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dreamwld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_dreamwld(screen_device &screen, bool state); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; @@ -161,9 +161,9 @@ public: void dreamwld_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) { gfx_element *gfx = m_gfxdecode->gfx(0); - UINT32 *source = m_spritebuf1.get(); - UINT32 *finish = m_spritebuf1.get() + 0x1000 / 4; - UINT16 *redirect = (UINT16 *)memregion("spritelut")->base(); + uint32_t *source = m_spritebuf1.get(); + uint32_t *finish = m_spritebuf1.get() + 0x1000 / 4; + uint16_t *redirect = (uint16_t *)memregion("spritelut")->base(); int xoffset = 4; while (source < finish) @@ -252,7 +252,7 @@ WRITE32_MEMBER(dreamwld_state::dreamwld_bg2_videoram_w) TILE_GET_INFO_MEMBER(dreamwld_state::get_dreamwld_bg2_tile_info) { - UINT16 tileno, colour; + uint16_t tileno, colour; tileno = (tile_index & 1) ? (m_bg2_videoram[tile_index >> 1] & 0xffff) : ((m_bg2_videoram[tile_index >> 1] >> 16) & 0xffff); colour = tileno >> 13; tileno &= 0x1fff; @@ -271,10 +271,10 @@ void dreamwld_state::video_start() m_bg2_tilemap->set_scroll_rows(64*16); // line scrolling m_bg2_tilemap->set_scroll_cols(1); - m_spritebuf1 = std::make_unique(0x2000 / 4); - m_spritebuf2 = std::make_unique(0x2000 / 4); + m_spritebuf1 = std::make_unique(0x2000 / 4); + m_spritebuf2 = std::make_unique(0x2000 / 4); - m_lineram16 = make_unique_clear(0x400 / 2); + m_lineram16 = make_unique_clear(0x400 / 2); save_pointer(NAME(m_lineram16.get()), 0x400/2); } @@ -290,7 +290,7 @@ void dreamwld_state::screen_eof_dreamwld(screen_device &screen, bool state) } -UINT32 dreamwld_state::screen_update_dreamwld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dreamwld_state::screen_update_dreamwld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // int tm0size, tm1size; @@ -305,8 +305,8 @@ UINT32 dreamwld_state::screen_update_dreamwld(screen_device &screen, bitmap_ind1 int layer0_scrollx = m_vregs[(0x004 / 4)] + 0; int layer1_scrollx = m_vregs[(0x00c / 4)] + 2; - UINT32 layer0_ctrl = m_vregs[0x010 / 4]; - UINT32 layer1_ctrl = m_vregs[0x014 / 4]; + uint32_t layer0_ctrl = m_vregs[0x010 / 4]; + uint32_t layer1_ctrl = m_vregs[0x014 / 4]; m_tilebank[0] = (layer0_ctrl >> 6) & 1; m_tilebank[1] = (layer1_ctrl >> 6) & 1; @@ -352,7 +352,7 @@ UINT32 dreamwld_state::screen_update_dreamwld(screen_device &screen, bitmap_ind1 { int x0 = 0, x1 = 0; - UINT16* linebase; + uint16_t* linebase; @@ -410,9 +410,9 @@ READ32_MEMBER(dreamwld_state::dreamwld_protdata_r) { //static int count = 0; - UINT8 *protdata = memregion("user1")->base(); + uint8_t *protdata = memregion("user1")->base(); size_t protsize = memregion("user1")->bytes(); - UINT8 dat = protdata[(m_protindex++) % protsize]; + uint8_t dat = protdata[(m_protindex++) % protsize]; //printf("protection read %04x %02x\n", count, dat); //count++; diff --git a/src/mame/drivers/drgnmst.cpp b/src/mame/drivers/drgnmst.cpp index 184b7534630..a2b6288b1aa 100644 --- a/src/mame/drivers/drgnmst.cpp +++ b/src/mame/drivers/drgnmst.cpp @@ -455,7 +455,7 @@ ROM_START( drgnmst ) ROM_END -UINT8 drgnmst_state::drgnmst_asciitohex( UINT8 data ) +uint8_t drgnmst_state::drgnmst_asciitohex( uint8_t data ) { /* Convert ASCII data to HEX */ @@ -469,13 +469,13 @@ UINT8 drgnmst_state::drgnmst_asciitohex( UINT8 data ) DRIVER_INIT_MEMBER(drgnmst_state,drgnmst) { - UINT8 *drgnmst_PICROM_HEX = memregion("user1")->base(); - UINT16 *drgnmst_PICROM = (UINT16 *)memregion("audiocpu")->base(); - UINT8 *drgnmst_PCM = memregion("oki1")->base(); - INT32 offs, data; - UINT16 src_pos = 0; - UINT16 dst_pos = 0; - UINT8 data_hi, data_lo; + uint8_t *drgnmst_PICROM_HEX = memregion("user1")->base(); + uint16_t *drgnmst_PICROM = (uint16_t *)memregion("audiocpu")->base(); + uint8_t *drgnmst_PCM = memregion("oki1")->base(); + int32_t offs, data; + uint16_t src_pos = 0; + uint16_t dst_pos = 0; + uint8_t data_hi, data_lo; /* Configure the OKI-0 PCM data into a MAME friendly bank format */ /* $00000-1ffff is the same through all banks */ diff --git a/src/mame/drivers/drmicro.cpp b/src/mame/drivers/drmicro.cpp index 7181682c3ec..63a018254a0 100644 --- a/src/mame/drivers/drmicro.cpp +++ b/src/mame/drivers/drmicro.cpp @@ -43,7 +43,7 @@ WRITE8_MEMBER(drmicro_state::nmi_enable_w) WRITE_LINE_MEMBER(drmicro_state::pcm_w) { - UINT8 *PCM = memregion("adpcm")->base(); + uint8_t *PCM = memregion("adpcm")->base(); int data = PCM[m_pcm_adr / 2]; diff --git a/src/mame/drivers/drtomy.cpp b/src/mame/drivers/drtomy.cpp index ace112b8f08..62fb80d5498 100644 --- a/src/mame/drivers/drtomy.cpp +++ b/src/mame/drivers/drtomy.cpp @@ -27,9 +27,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram_fg; - required_shared_ptr m_videoram_bg; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram_fg; + required_shared_ptr m_videoram_bg; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_tilemap_bg; @@ -45,7 +45,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_drtomy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_drtomy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_oki; @@ -139,7 +139,7 @@ void drtomy_state::video_start() m_tilemap_fg->set_transparent_pen(0); } -UINT32 drtomy_state::screen_update_drtomy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t drtomy_state::screen_update_drtomy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap_bg->draw(screen, bitmap, cliprect, 0, 0); m_tilemap_fg->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/drivers/drw80pkr.cpp b/src/mame/drivers/drw80pkr.cpp index 5c1f992edf7..5e785c75a24 100644 --- a/src/mame/drivers/drw80pkr.cpp +++ b/src/mame/drivers/drw80pkr.cpp @@ -42,18 +42,18 @@ public: m_gfxdecode(*this, "gfxdecode") { } tilemap_t *m_bg_tilemap; - UINT8 m_t0; - UINT8 m_t1; - UINT8 m_p0; - UINT8 m_p1; - UINT8 m_p2; - UINT8 m_prog; - UINT8 m_bus; - UINT8 m_attract_mode; - UINT8 m_active_bank; - UINT8 m_pkr_io_ram[0x100]; - UINT16 m_video_ram[0x0400]; - UINT8 m_color_ram[0x0400]; + uint8_t m_t0; + uint8_t m_t1; + uint8_t m_p0; + uint8_t m_p1; + uint8_t m_p2; + uint8_t m_prog; + uint8_t m_bus; + uint8_t m_attract_mode; + uint8_t m_active_bank; + uint8_t m_pkr_io_ram[0x100]; + uint16_t m_video_ram[0x0400]; + uint8_t m_color_ram[0x0400]; DECLARE_WRITE8_MEMBER(t0_w); DECLARE_WRITE8_MEMBER(t1_w); DECLARE_WRITE8_MEMBER(p0_w); @@ -74,7 +74,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(drw80pkr); - UINT32 screen_update_drw80pkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_drw80pkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -138,7 +138,7 @@ WRITE8_MEMBER(drw80pkr_state::bus_w) WRITE8_MEMBER(drw80pkr_state::drw80pkr_io_w) { - UINT16 n_offs; + uint16_t n_offs; if (m_p2 == 0x3f || m_p2 == 0x7f) { @@ -246,8 +246,8 @@ READ8_MEMBER(drw80pkr_state::bus_r) READ8_MEMBER(drw80pkr_state::drw80pkr_io_r) { - UINT8 ret; - UINT16 kbdin; + uint8_t ret; + uint16_t kbdin; ret = 0x00; @@ -345,7 +345,7 @@ void drw80pkr_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(drw80pkr_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 24, 27); } -UINT32 drw80pkr_state::screen_update_drw80pkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t drw80pkr_state::screen_update_drw80pkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -354,7 +354,7 @@ UINT32 drw80pkr_state::screen_update_drw80pkr(screen_device &screen, bitmap_ind1 PALETTE_INIT_MEMBER(drw80pkr_state, drw80pkr) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int j; for (j = 0; j < palette.entries(); j++) diff --git a/src/mame/drivers/dsb46.cpp b/src/mame/drivers/dsb46.cpp index a63e15867f7..b6729926993 100644 --- a/src/mame/drivers/dsb46.cpp +++ b/src/mame/drivers/dsb46.cpp @@ -41,7 +41,7 @@ public: DECLARE_DRIVER_INIT(dsb46); DECLARE_MACHINE_RESET(dsb46); private: - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; required_device m_terminal; }; @@ -73,7 +73,7 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER(dsb46_state, dsb46) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("read")->configure_entry(0, &RAM[0x10000]); membank("read")->configure_entry(1, &RAM[0x00000]); membank("write")->configure_entry(0, &RAM[0x00000]); @@ -99,7 +99,7 @@ READ8_MEMBER( dsb46_state::port01_r ) READ8_MEMBER( dsb46_state::port00_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/dual68.cpp b/src/mame/drivers/dual68.cpp index 122f00090bf..ea94a995f08 100644 --- a/src/mame/drivers/dual68.cpp +++ b/src/mame/drivers/dual68.cpp @@ -30,8 +30,8 @@ public: required_device m_terminal; DECLARE_WRITE8_MEMBER( kbd_put ); DECLARE_WRITE16_MEMBER( dual68_terminal_w ); - //UINT8 m_term_data; - required_shared_ptr m_p_ram; + //uint8_t m_term_data; + required_shared_ptr m_p_ram; virtual void machine_reset() override; }; @@ -67,9 +67,9 @@ INPUT_PORTS_END void dual68_state::machine_reset() { - UINT8* user1 = memregion("user1")->base(); + uint8_t* user1 = memregion("user1")->base(); - memcpy((UINT8*)m_p_ram.target(),user1,0x2000); + memcpy((uint8_t*)m_p_ram.target(),user1,0x2000); m_maincpu->reset(); } diff --git a/src/mame/drivers/dunhuang.cpp b/src/mame/drivers/dunhuang.cpp index 03814efd2a8..8fb863008e8 100644 --- a/src/mame/drivers/dunhuang.cpp +++ b/src/mame/drivers/dunhuang.cpp @@ -76,30 +76,30 @@ public: tilemap_t *m_tmap2; int m_written; int m_written2; - UINT8 m_pos_x; - UINT8 m_pos_y; - UINT8 m_clear_y; - UINT8 m_block_x; - UINT8 m_block_y; - UINT8 m_block_w; - UINT8 m_block_h; - UINT8 m_block_addr_hi; - UINT8 m_block_addr_lo; - UINT8 m_block_dest; - UINT8 m_block_c; - UINT8 m_layers; + uint8_t m_pos_x; + uint8_t m_pos_y; + uint8_t m_clear_y; + uint8_t m_block_x; + uint8_t m_block_y; + uint8_t m_block_w; + uint8_t m_block_h; + uint8_t m_block_addr_hi; + uint8_t m_block_addr_lo; + uint8_t m_block_dest; + uint8_t m_block_c; + uint8_t m_layers; int m_paloffs; /* input-related */ - UINT8 m_input; - UINT8 m_hopper; + uint8_t m_input; + uint8_t m_hopper; /* memory */ - UINT16 m_videoram[0x40 * 0x20]; - UINT16 m_videoram2[0x40 * 0x8]; - UINT8 m_colorram[0x40 * 0x20]; - UINT8 m_colorram2[0x40 * 0x8]; - UINT8 m_paldata[3 * 256]; + uint16_t m_videoram[0x40 * 0x20]; + uint16_t m_videoram2[0x40 * 0x8]; + uint8_t m_colorram[0x40 * 0x20]; + uint8_t m_colorram2[0x40 * 0x8]; + uint8_t m_paldata[3 * 256]; DECLARE_WRITE8_MEMBER(dunhuang_pos_x_w); DECLARE_WRITE8_MEMBER(dunhuang_pos_y_w); DECLARE_WRITE8_MEMBER(dunhuang_tile_w); @@ -128,7 +128,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_dunhuang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dunhuang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_screen; @@ -143,14 +143,14 @@ public: TILE_GET_INFO_MEMBER(dunhuang_state::get_tile_info) { - UINT16 code = m_videoram[tile_index]; - UINT8 color = m_colorram[tile_index] & 0x0f; + uint16_t code = m_videoram[tile_index]; + uint8_t color = m_colorram[tile_index] & 0x0f; SET_TILE_INFO_MEMBER(0, code, color, 0); } TILE_GET_INFO_MEMBER(dunhuang_state::get_tile_info2) { - UINT16 code = m_videoram2[tile_index]; - UINT8 color = m_colorram2[tile_index] & 0x0f; + uint16_t code = m_videoram2[tile_index]; + uint8_t color = m_colorram2[tile_index] & 0x0f; SET_TILE_INFO_MEMBER(1, code, color, 0); } @@ -169,7 +169,7 @@ void dunhuang_state::video_start() save_item(NAME(m_paldata)); } -UINT32 dunhuang_state::screen_update_dunhuang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dunhuang_state::screen_update_dunhuang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; @@ -353,7 +353,7 @@ WRITE8_MEMBER(dunhuang_state::dunhuang_block_addr_hi_w) WRITE8_MEMBER(dunhuang_state::dunhuang_block_h_w) { int i,j, addr; - UINT8 *tile_addr; + uint8_t *tile_addr; // logerror("%06x: block dst %x, src %x, xy %x %x, wh %x %x, clr %x\n", space.device().safe_pc(), m_block_dest, (m_block_addr_hi << 8) + m_block_addr_lo, m_block_x,m_block_y,m_block_w+1,m_block_h+1,m_block_c); @@ -765,7 +765,7 @@ GFXDECODE_END void dunhuang_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x8000); diff --git a/src/mame/drivers/dvk_kcgd.cpp b/src/mame/drivers/dvk_kcgd.cpp index c13774fd3ce..c5e544cb166 100644 --- a/src/mame/drivers/dvk_kcgd.cpp +++ b/src/mame/drivers/dvk_kcgd.cpp @@ -66,7 +66,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback); DECLARE_PALETTE_INIT(kcgd); @@ -96,17 +96,17 @@ public: emu_timer *m_500hz_timer; private: - void draw_scanline(UINT16 *p, UINT16 offset); + void draw_scanline(uint16_t *p, uint16_t offset); rectangle m_tmpclip; bitmap_ind16 m_tmpbmp; struct { - UINT16 status; // 167770 - UINT8 control; // 167772 + uint16_t status; // 167770 + uint8_t control; // 167772 int palette_index, vram_addr; - UINT8 palette[16]; + uint8_t palette[16]; } m_video; - std::unique_ptr m_videoram; + std::unique_ptr m_videoram; protected: required_device m_maincpu; @@ -157,7 +157,7 @@ void kcgd_state::video_start() // screen_device *screen = machine().device("screen"); // 64 kwords, word size is 17 bits - m_videoram = std::make_unique(65536); + m_videoram = std::make_unique(65536); m_tmpclip = rectangle(0, KCGD_DISP_HORZ-1, 0, KCGD_DISP_VERT-1); m_tmpbmp.allocate(KCGD_DISP_HORZ, KCGD_DISP_VERT); @@ -206,7 +206,7 @@ READ16_MEMBER(kcgd_state::vram_data_r) { DBG_LOG(2,"VRAM R2", ("%06o\n", m_video.vram_addr)); m_video.status = (m_video.status & 0xff7f) | (BIT(m_videoram[m_video.vram_addr], 16) << 7); - return (UINT16) (m_videoram[m_video.vram_addr] & 0xffff); + return (uint16_t) (m_videoram[m_video.vram_addr] & 0xffff); } WRITE16_MEMBER(kcgd_state::vram_mmap_w) @@ -218,7 +218,7 @@ WRITE16_MEMBER(kcgd_state::vram_mmap_w) READ16_MEMBER(kcgd_state::vram_mmap_r) { DBG_LOG(3,"VRAM R1", ("%06o\n", offset)); - return (UINT16) (m_videoram[offset] & 0xffff); + return (uint16_t) (m_videoram[offset] & 0xffff); } WRITE16_MEMBER(kcgd_state::status_w) @@ -230,7 +230,7 @@ WRITE16_MEMBER(kcgd_state::status_w) READ16_MEMBER(kcgd_state::status_r) { - UINT16 data = m_video.status ^ (BIT(m_video.control, 6) << 7); + uint16_t data = m_video.status ^ (BIT(m_video.control, 6) << 7); DBG_LOG(1,"Status R", ("data %04X index %d\n", data, m_video.palette_index)); return data; } @@ -270,13 +270,13 @@ READ8_MEMBER(kcgd_state::palette_data_r) host writes it separately (via bit 7 in 167772). */ -void kcgd_state::draw_scanline(UINT16 *p, UINT16 offset) +void kcgd_state::draw_scanline(uint16_t *p, uint16_t offset) { int i; for ( i = 0; i < 100; i++ ) { - UINT32 data = m_videoram[ offset++ ]; + uint32_t data = m_videoram[ offset++ ]; if (BIT(data, 16)) { *p = ( data >> 12) & 0x0F; p++; *p = ( data >> 12) & 0x0F; p++; @@ -301,7 +301,7 @@ void kcgd_state::draw_scanline(UINT16 *p, UINT16 offset) TIMER_DEVICE_CALLBACK_MEMBER(kcgd_state::scanline_callback) { - UINT16 y = m_screen->vpos(), offset; + uint16_t y = m_screen->vpos(), offset; if (y < KCGD_VERT_START) return; y -= KCGD_VERT_START; @@ -316,7 +316,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(kcgd_state::scanline_callback) draw_scanline(&m_tmpbmp.pix16(y), m_videoram[offset + (KCGD_DISP_VERT-1) - y]); } -UINT32 kcgd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t kcgd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_tmpbmp, 0, 0, KCGD_HORZ_START, KCGD_VERT_START, cliprect); return 0; diff --git a/src/mame/drivers/dvk_ksm.cpp b/src/mame/drivers/dvk_ksm.cpp index a382ff5b747..a8a3cda8170 100644 --- a/src/mame/drivers/dvk_ksm.cpp +++ b/src/mame/drivers/dvk_ksm.cpp @@ -112,7 +112,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); TIMER_DEVICE_CALLBACK_MEMBER( scanline_callback ); DECLARE_WRITE_LINE_MEMBER(write_keyboard_clock); @@ -122,18 +122,18 @@ public: DECLARE_WRITE8_MEMBER(ksm_ppi_portc_w); private: - UINT32 draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline); + uint32_t draw_scanline(uint16_t *p, uint16_t offset, uint8_t scanline); rectangle m_tmpclip; bitmap_ind16 m_tmpbmp; - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; struct { - UINT8 line; - UINT16 ptr; + uint8_t line; + uint16_t ptr; } m_video; protected: - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_device m_maincpu; required_device m_pic8259; required_device m_i8251line; @@ -254,10 +254,10 @@ WRITE_LINE_MEMBER(ksm_state::write_line_clock) displayed on 3 extra scan lines. */ -UINT32 ksm_state::draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline) +uint32_t ksm_state::draw_scanline(uint16_t *p, uint16_t offset, uint8_t scanline) { - UINT8 gfx, fg, bg, ra, blink; - UINT16 x, chr; + uint8_t gfx, fg, bg, ra, blink; + uint16_t x, chr; bg = 0; fg = 1; ra = scanline % 8; blink = (m_screen->frame_number() % 10) > 4; @@ -289,8 +289,8 @@ UINT32 ksm_state::draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline) TIMER_DEVICE_CALLBACK_MEMBER(ksm_state::scanline_callback) { - UINT16 y = m_screen->vpos(); - UINT16 offset; + uint16_t y = m_screen->vpos(); + uint16_t offset; DBG_LOG(2,"scanline_cb", ("addr %02x frame %d x %.4d y %.3d row %.2d\n", @@ -309,7 +309,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ksm_state::scanline_callback) draw_scanline(&m_tmpbmp.pix16(y), offset, y%11); } -UINT32 ksm_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ksm_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_tmpbmp, 0, 0, KSM_HORZ_START, KSM_VERT_START, cliprect); return 0; diff --git a/src/mame/drivers/dwarfd.cpp b/src/mame/drivers/dwarfd.cpp index 614fb93cb7a..3c648817290 100644 --- a/src/mame/drivers/dwarfd.cpp +++ b/src/mame/drivers/dwarfd.cpp @@ -319,12 +319,12 @@ public: bool m_back_color; /* memory */ - UINT8 m_dw_ram[0x1000]; + uint8_t m_dw_ram[0x1000]; required_device m_maincpu; required_device m_palette; required_device m_crtc; - required_region_ptr m_charmap; + required_region_ptr m_charmap; required_ioport m_dsw2; DECLARE_READ8_MEMBER(dwarfd_ram_r); @@ -580,7 +580,7 @@ I8275_DRAW_CHARACTER_MEMBER(dwarfd_state::pesp_display_pixels) int i; int bank = ((gpa & 2) ? 0 : 2) + (gpa & 1); const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT16 pixels = m_charmap[(linecount & 7) + ((charcode + (bank * 128)) << 3)]; + uint16_t pixels = m_charmap[(linecount & 7) + ((charcode + (bank * 128)) << 3)]; if(!x) m_back_color = false; @@ -589,8 +589,8 @@ I8275_DRAW_CHARACTER_MEMBER(dwarfd_state::pesp_display_pixels) for(i=0;i<8;i+=2) { - UINT8 pixel = (pixels >> (i * 2)) & 0xf; - UINT8 value = (pixel >> 1) | (rvv << 4) | (vsp << 3); + uint8_t pixel = (pixels >> (i * 2)) & 0xf; + uint8_t value = (pixel >> 1) | (rvv << 4) | (vsp << 3); bitmap.pix32(y, x + i) = palette[value]; bitmap.pix32(y, x + i + 1) = palette[(pixel & 1) ? 0 : value]; if(m_back_color) @@ -604,7 +604,7 @@ I8275_DRAW_CHARACTER_MEMBER(dwarfd_state::display_pixels) int i; int bank = ((gpa & 2) ? 0 : 4) + (gpa & 1) + ((m_dsw2->read() & 4) >> 1); const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT16 pixels = m_charmap[(linecount & 7) + ((charcode + (bank * 128)) << 3)]; + uint16_t pixels = m_charmap[(linecount & 7) + ((charcode + (bank * 128)) << 3)]; if(!x) m_back_color = false; @@ -613,8 +613,8 @@ I8275_DRAW_CHARACTER_MEMBER(dwarfd_state::display_pixels) for(i=0;i<8;i+=2) { - UINT8 pixel = (pixels >> (i * 2)) & 0xf; - UINT8 value = (pixel >> 1) | (rvv << 4) | (vsp << 3); + uint8_t pixel = (pixels >> (i * 2)) & 0xf; + uint8_t value = (pixel >> 1) | (rvv << 4) | (vsp << 3); bitmap.pix32(y, x + i) = palette[value]; bitmap.pix32(y, x + i + 1) = palette[(pixel & 1) ? 0 : value]; if(m_back_color) @@ -628,7 +628,7 @@ I8275_DRAW_CHARACTER_MEMBER(dwarfd_state::qc_display_pixels) int i; int bank = gpa; const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT16 pixels = m_charmap[(linecount & 7) + ((charcode + (bank * 128)) << 3)]; + uint16_t pixels = m_charmap[(linecount & 7) + ((charcode + (bank * 128)) << 3)]; if(!x) m_back_color = false; @@ -637,8 +637,8 @@ I8275_DRAW_CHARACTER_MEMBER(dwarfd_state::qc_display_pixels) for(i=0;i<8;i+=2) { - UINT8 pixel = (pixels >> (i * 2)) & 0xf; - UINT8 value = (pixel >> 1) | (rvv << 4) | (vsp << 3); + uint8_t pixel = (pixels >> (i * 2)) & 0xf; + uint8_t value = (pixel >> 1) | (rvv << 4) | (vsp << 3); bitmap.pix32(y, x + i) = palette[value]; bitmap.pix32(y, x + i + 1) = palette[(pixel & 1) ? 0 : value]; if(m_back_color) @@ -760,9 +760,9 @@ GFXDECODE_END PALETTE_INIT_MEMBER(dwarfd_state, dwarfd) { - UINT8 rgb[3]; + uint8_t rgb[3]; int i,j; - UINT8 *prom = memregion("proms")->base(); + uint8_t *prom = memregion("proms")->base(); for (i = 0; i < 32; i++) { @@ -1054,7 +1054,7 @@ ROM_END DRIVER_INIT_MEMBER(dwarfd_state,dwarfd) { /* expand gfx roms */ - UINT8 *dst = memregion("gfx2")->base(); + uint8_t *dst = memregion("gfx2")->base(); for (int i = 0; i < 0x4000/2; i++) { diff --git a/src/mame/drivers/dynadice.cpp b/src/mame/drivers/dynadice.cpp index b35d8baeb67..67b9f87f6aa 100644 --- a/src/mame/drivers/dynadice.cpp +++ b/src/mame/drivers/dynadice.cpp @@ -51,8 +51,8 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_videoram; -// UINT8 * m_nvram; // currently this uses generic nvram handling + required_shared_ptr m_videoram; +// uint8_t * m_nvram; // currently this uses generic nvram handling /* video-related */ tilemap_t *m_bg_tilemap; @@ -68,7 +68,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_dynadice(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dynadice(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -217,7 +217,7 @@ void dynadice_state::video_start() m_bg_tilemap->set_scrollx(0, -16); } -UINT32 dynadice_state::screen_update_dynadice(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dynadice_state::screen_update_dynadice(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { rectangle myclip = cliprect; myclip.max_x = 15; @@ -292,10 +292,10 @@ ROM_END DRIVER_INIT_MEMBER(dynadice_state,dynadice) { int i, j; - UINT8 *usr1 = memregion("user1")->base(); - UINT8 *cpu2 = memregion("audiocpu")->base(); - UINT8 *gfx1 = memregion("gfx1")->base(); - UINT8 *gfx2 = memregion("gfx2")->base(); + uint8_t *usr1 = memregion("user1")->base(); + uint8_t *cpu2 = memregion("audiocpu")->base(); + uint8_t *gfx1 = memregion("gfx1")->base(); + uint8_t *gfx2 = memregion("gfx2")->base(); cpu2[0x0b] = 0x23; /* bug in game code Dec HL -> Inc HL*/ diff --git a/src/mame/drivers/dynax.cpp b/src/mame/drivers/dynax.cpp index 134c6c2e605..ea8d6ace24c 100644 --- a/src/mame/drivers/dynax.cpp +++ b/src/mame/drivers/dynax.cpp @@ -608,7 +608,7 @@ WRITE8_MEMBER(dynax_state::hjingi_hopper_w) m_hopper = data & 0x01; } -UINT8 dynax_state::hjingi_hopper_bit() +uint8_t dynax_state::hjingi_hopper_bit() { return (m_hopper && !(m_screen->frame_number() % 10)) ? 0 : (1 << 6); } @@ -1448,7 +1448,7 @@ WRITE8_MEMBER(dynax_state::gekisha_hopper_w) // popmessage("%02x %02x", gekisha_val[0], gekisha_val[1]); } -void dynax_state::gekisha_set_rombank( UINT8 data ) +void dynax_state::gekisha_set_rombank( uint8_t data ) { m_rombank = data; m_romptr = memregion("maincpu")->base() + 0x8000 + m_rombank * 0x8000; @@ -4355,7 +4355,7 @@ MACHINE_RESET_MEMBER(dynax_state,dynax) MACHINE_START_MEMBER(dynax_state,hanamai) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0x10, &ROM[0x8000], 0x8000); MACHINE_START_CALL_MEMBER(dynax); @@ -4363,7 +4363,7 @@ MACHINE_START_MEMBER(dynax_state,hanamai) MACHINE_START_MEMBER(dynax_state,hnoridur) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int bank_n = (memregion("maincpu")->bytes() - 0x10000) / 0x8000; m_hnoridur_ptr = &ROM[0x10000 + 0x18 * 0x8000]; @@ -4734,8 +4734,8 @@ MACHINE_CONFIG_END MACHINE_START_MEMBER(dynax_state,jantouki) { - UINT8 *MAIN = memregion("maincpu")->base(); - UINT8 *SOUND = memregion("soundcpu")->base(); + uint8_t *MAIN = memregion("maincpu")->base(); + uint8_t *SOUND = memregion("soundcpu")->base(); membank("bank1")->configure_entries(0, 0x10, &MAIN[0x8000], 0x8000); membank("bank2")->configure_entries(0, 12, &SOUND[0x8000], 0x8000); @@ -5472,7 +5472,7 @@ ROM_END DRIVER_INIT_MEMBER(dynax_state,blktouch) { // fearsome encryption ;-) - UINT8 *src = (UINT8 *)memregion("maincpu")->base(); + uint8_t *src = (uint8_t *)memregion("maincpu")->base(); int i; for (i = 0; i < 0x90000; i++) @@ -5481,7 +5481,7 @@ DRIVER_INIT_MEMBER(dynax_state,blktouch) } - src = (UINT8 *)memregion("gfx1")->base(); + src = (uint8_t *)memregion("gfx1")->base(); for (i = 0; i < 0xc0000; i++) { @@ -5494,10 +5494,10 @@ DRIVER_INIT_MEMBER(dynax_state,blktouch) DRIVER_INIT_MEMBER(dynax_state, maya_common) { /* Address lines scrambling on 1 z80 rom */ - UINT8 *rom = memregion("maincpu")->base() + 0x28000, *end = rom + 0x10000; + uint8_t *rom = memregion("maincpu")->base() + 0x28000, *end = rom + 0x10000; for ( ; rom < end; rom += 8) { - UINT8 temp[8]; + uint8_t temp[8]; temp[0] = rom[0]; temp[1] = rom[1]; temp[2] = rom[2]; temp[3] = rom[3]; temp[4] = rom[4]; temp[5] = rom[5]; temp[6] = rom[6]; temp[7] = rom[7]; @@ -5511,12 +5511,12 @@ DRIVER_INIT_MEMBER(dynax_state,maya) { DRIVER_INIT_CALL(maya_common); - UINT8 *gfx = (UINT8 *)memregion("gfx1")->base(); + uint8_t *gfx = (uint8_t *)memregion("gfx1")->base(); int i; /* Address lines scrambling on the blitter data roms */ { - std::vector rom(0xc0000); + std::vector rom(0xc0000); memcpy(&rom[0], gfx, 0xc0000); for (i = 0; i < 0xc0000; i++) gfx[i] = rom[BITSWAP24(i, 23, 22, 21, 20, 19, 18, 14, 15, 16, 17, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; @@ -5528,12 +5528,12 @@ DRIVER_INIT_MEMBER(dynax_state,mayac) { DRIVER_INIT_CALL(maya_common); - UINT8 *gfx = (UINT8 *)memregion("gfx1")->base(); + uint8_t *gfx = (uint8_t *)memregion("gfx1")->base(); int i; /* Address lines scrambling on the blitter data roms */ { - std::vector rom(0xc0000); + std::vector rom(0xc0000); memcpy(&rom[0], gfx, 0xc0000); for (i = 0; i < 0xc0000; i++) gfx[i] = rom[BITSWAP24(i, 23, 22, 21, 20, 19, 18, 17, 14, 16, 15, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; @@ -6450,9 +6450,9 @@ ROM_END DRIVER_INIT_MEMBER(dynax_state,mjelct3) { int i; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); - std::vector rom1(size); + std::vector rom1(size); memcpy(&rom1[0], rom, size); for (i = 0; i < size; i++) @@ -6462,9 +6462,9 @@ DRIVER_INIT_MEMBER(dynax_state,mjelct3) DRIVER_INIT_MEMBER(dynax_state,mjelct3a) { int i, j; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); - std::vector rom1(size); + std::vector rom1(size); memcpy(&rom1[0], rom, size); for (i = 0; i < size; i++) diff --git a/src/mame/drivers/eacc.cpp b/src/mame/drivers/eacc.cpp index 3aef6f02258..877cfec73d6 100644 --- a/src/mame/drivers/eacc.cpp +++ b/src/mame/drivers/eacc.cpp @@ -76,12 +76,12 @@ public: bool m_nmi; required_device m_maincpu; required_device m_pia; - required_shared_ptr m_p_nvram; + required_shared_ptr m_p_nvram; virtual void machine_reset() override; TIMER_DEVICE_CALLBACK_MEMBER(eacc_cb1); TIMER_DEVICE_CALLBACK_MEMBER(eacc_nmi); private: - UINT8 m_digit; + uint8_t m_digit; }; @@ -174,7 +174,7 @@ WRITE_LINE_MEMBER( eacc_state::eacc_cb2_w ) READ8_MEMBER( eacc_state::eacc_keyboard_r ) { - UINT8 data = m_digit; + uint8_t data = m_digit; if (BIT(m_digit, 3)) data |= ioport("X0")->read(); @@ -201,7 +201,7 @@ WRITE8_MEMBER( eacc_state::eacc_segment_w ) if (!m_nmi) { - UINT8 i; + uint8_t i; if (BIT(m_digit, 7)) { char lednum[6]; diff --git a/src/mame/drivers/ec184x.cpp b/src/mame/drivers/ec184x.cpp index 26a5b577101..c72b309928b 100644 --- a/src/mame/drivers/ec184x.cpp +++ b/src/mame/drivers/ec184x.cpp @@ -47,7 +47,7 @@ public: DECLARE_DRIVER_INIT(ec1841); struct { - UINT8 enable[4]; + uint8_t enable[4]; int boards; } m_memory; @@ -76,7 +76,7 @@ public: READ8_MEMBER(ec184x_state::memboard_r) { - UINT8 data; + uint8_t data; data = offset % 4; if (data >= m_memory.boards) @@ -92,7 +92,7 @@ WRITE8_MEMBER(ec184x_state::memboard_w) { address_space &program = m_maincpu->space(AS_PROGRAM); ram_device *m_ram = machine().device(RAM_TAG); - UINT8 current; + uint8_t current; current = m_memory.enable[offset]; diff --git a/src/mame/drivers/ec65.cpp b/src/mame/drivers/ec65.cpp index f54762a053f..2a1597a8072 100644 --- a/src/mame/drivers/ec65.cpp +++ b/src/mame/drivers/ec65.cpp @@ -41,10 +41,10 @@ public: DECLARE_WRITE8_MEMBER(kbd_put); MC6845_UPDATE_ROW(crtc_update_row); - UINT8 *m_p_chargen; + uint8_t *m_p_chargen; required_device m_via_0; required_device m_via_1; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; virtual void machine_reset() override; virtual void video_start() override; required_device m_maincpu; @@ -124,9 +124,9 @@ void ec65_state::video_start() MC6845_UPDATE_ROW( ec65_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx,inv; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx,inv; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { diff --git a/src/mame/drivers/ecoinf2.cpp b/src/mame/drivers/ecoinf2.cpp index 0caf8d34ad5..c165b87b42c 100644 --- a/src/mame/drivers/ecoinf2.cpp +++ b/src/mame/drivers/ecoinf2.cpp @@ -47,9 +47,9 @@ public: required_ioport m_key; required_ioport m_panel; - UINT16 m_lamps[16]; - UINT16 m_leds[16]; - //UINT16 m_chars[14]; + uint16_t m_lamps[16]; + uint16_t m_leds[16]; + //uint16_t m_chars[14]; // void update_display(); int m_optic_pattern; DECLARE_WRITE_LINE_MEMBER(reel0_optic_cb) { if (state) m_optic_pattern |= 0x01; else m_optic_pattern &= ~0x01; } diff --git a/src/mame/drivers/ecoinf3.cpp b/src/mame/drivers/ecoinf3.cpp index 82e78a05a60..55a972cab68 100644 --- a/src/mame/drivers/ecoinf3.cpp +++ b/src/mame/drivers/ecoinf3.cpp @@ -42,8 +42,8 @@ public: required_device m_reel2; required_device m_reel3; - UINT16 m_lamps[16]; - UINT16 m_chars[14]; + uint16_t m_lamps[16]; + uint16_t m_chars[14]; void update_display(); int strobe_addr; @@ -275,7 +275,7 @@ public: // this is a copy of roc10937charset for now, I don't know what chip we're meant be using here // it is some kind of 14 digit, 16 seg display tho -static const UINT16 ecoin_charset[]= +static const uint16_t ecoin_charset[]= { // FEDC BA98 7654 3210 0x507F, // 0101 0000 0111 1111 @. 0x44CF, // 0100 0100 1100 1111 A. @@ -345,7 +345,7 @@ static const UINT16 ecoin_charset[]= 0x1407, // 0001 0100 0000 0111 ?. }; -static UINT32 set_display(UINT32 segin) +static uint32_t set_display(uint32_t segin) { return BITSWAP32(segin, 31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,11,9,15,13,12,8,10,14,7,6,5,4,3,2,1,0); } @@ -364,7 +364,7 @@ WRITE8_MEMBER(ecoinf3_state::ppi8255_intf_e_write_a_alpha_display) if ((data>=0x20) && (data<0x5b)) logerror("%04x - ppi8255_intf_e_write_a %02x (alpha) '%c'\n", m_maincpu->pcbase(), data, data); else logerror("%04x - ppi8255_intf_e_write_a %02x (alpha)\n", m_maincpu->pcbase(), data); - static UINT8 send_buffer = 0; + static uint8_t send_buffer = 0; static int count = 0; // writes the 'PYRAMID' string from RAM (copied from ROM) here... // along with port 40/41/42 accesses @@ -821,7 +821,7 @@ DRIVER_INIT_MEMBER(ecoinf3_state,ecoinf3) DRIVER_INIT_MEMBER(ecoinf3_state,ecoinf3_swap) { // not all sets have this, are they just badly dumped? - UINT8 table[] = + uint8_t table[] = { 0x48, 0x4c, 0x49, 0x4d, 0x40, 0x44, 0x41, 0x45, 0x68, 0x78, 0x60, 0x70, 0x6a, 0x7a, 0x62, 0x72, 0x08, 0x0c, 0x09, 0x0d, 0x00, 0x04, 0x01, 0x05, 0x6c, 0x7c, 0x64, 0x74, 0x6e, 0x7e, 0x66, 0x76, @@ -833,8 +833,8 @@ DRIVER_INIT_MEMBER(ecoinf3_state,ecoinf3_swap) 0x06, 0x02, 0x07, 0x03, 0x0e, 0x0a, 0x0f, 0x0b, 0x31, 0x21, 0x39, 0x29, 0x33, 0x23, 0x3b, 0x2b, }; - auto buffer = std::make_unique(0x10000); - UINT8 *rom = memregion( "maincpu" )->base(); + auto buffer = std::make_unique(0x10000); + uint8_t *rom = memregion( "maincpu" )->base(); for (int i=0;i<0x10000;i++) diff --git a/src/mame/drivers/ecoinfr.cpp b/src/mame/drivers/ecoinfr.cpp index 6f7c2ba23c4..20e06a39e78 100644 --- a/src/mame/drivers/ecoinfr.cpp +++ b/src/mame/drivers/ecoinfr.cpp @@ -69,15 +69,15 @@ public: DECLARE_WRITE_LINE_MEMBER(reel2_optic_cb) { if (state) m_optic_pattern |= 0x04; else m_optic_pattern &= ~0x04; } DECLARE_WRITE_LINE_MEMBER(reel3_optic_cb) { if (state) m_optic_pattern |= 0x08; else m_optic_pattern &= ~0x08; } - UINT8 port09_value; - UINT8 port10_value; - UINT8 port11_value; - UINT8 port12_value; - UINT8 port13_value; - UINT8 port14_value; - UINT8 port15_value; - UINT8 port16_value; - UINT8 port17_value; + uint8_t port09_value; + uint8_t port10_value; + uint8_t port11_value; + uint8_t port12_value; + uint8_t port13_value; + uint8_t port14_value; + uint8_t port15_value; + uint8_t port16_value; + uint8_t port17_value; DECLARE_WRITE8_MEMBER(ec_port00_out_w); DECLARE_WRITE8_MEMBER(ec_port01_out_w); @@ -114,8 +114,8 @@ public: virtual void machine_reset() override; TIMER_DEVICE_CALLBACK_MEMBER(ecoinfr_irq_timer); - UINT8 m_banksel; - UINT8 m_credsel; + uint8_t m_banksel; + uint8_t m_credsel; required_device m_maincpu; required_device m_reel0; @@ -322,7 +322,7 @@ WRITE8_MEMBER(ecoinfr_state::ec_port0d_out_cred_data_w) { if (m_credsel!=0xff) { - UINT8 bf7segdata = BITSWAP8(data,7,0,1,2,3,4,5,6); + uint8_t bf7segdata = BITSWAP8(data,7,0,1,2,3,4,5,6); output().set_digit_value(m_credsel+8, bf7segdata); } } @@ -335,7 +335,7 @@ WRITE8_MEMBER(ecoinfr_state::ec_port0f_out_bank_segdata_w) { if (m_banksel!=0xff) { - UINT8 bf7segdata = BITSWAP8(data,7,0,1,2,3,4,5,6); + uint8_t bf7segdata = BITSWAP8(data,7,0,1,2,3,4,5,6); output().set_digit_value(m_banksel, bf7segdata); } } diff --git a/src/mame/drivers/egghunt.cpp b/src/mame/drivers/egghunt.cpp index a41444d08ee..dda408b1058 100644 --- a/src/mame/drivers/egghunt.cpp +++ b/src/mame/drivers/egghunt.cpp @@ -63,19 +63,19 @@ public: /* video-related */ tilemap_t *m_bg_tilemap; - UINT8 m_vidram_bank; + uint8_t m_vidram_bank; /* misc */ - UINT8 m_okibanking; - UINT8 m_gfx_banking; + uint8_t m_okibanking; + uint8_t m_gfx_banking; /* devices */ required_device m_audiocpu; /* memory */ - required_shared_ptr m_atram; - UINT8 m_bgram[0x1000]; - UINT8 m_spram[0x1000]; + required_shared_ptr m_atram; + uint8_t m_bgram[0x1000]; + uint8_t m_spram[0x1000]; DECLARE_READ8_MEMBER(egghunt_bgram_r); DECLARE_WRITE8_MEMBER(egghunt_bgram_w); DECLARE_WRITE8_MEMBER(egghunt_atram_w); @@ -88,7 +88,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_egghunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_egghunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); required_device m_maincpu; required_device m_oki; @@ -194,7 +194,7 @@ void egghunt_state::video_start() save_item(NAME(m_spram)); } -UINT32 egghunt_state::screen_update_egghunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t egghunt_state::screen_update_egghunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp index 67b2edf0e36..59b2c1b4824 100644 --- a/src/mame/drivers/einstein.cpp +++ b/src/mame/drivers/einstein.cpp @@ -95,8 +95,8 @@ READ8_MEMBER(einstein_state::einstein_80col_ram_r) MC6845_UPDATE_ROW( einstein_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *data = m_region_gfx1->base(); - UINT8 char_code, data_byte; + uint8_t *data = m_region_gfx1->base(); + uint8_t char_code, data_byte; int i, x; for (i = 0, x = 0; i < x_count; i++, x += 8) @@ -127,7 +127,7 @@ WRITE_LINE_MEMBER(einstein_state::einstein_6845_de_changed) */ READ8_MEMBER(einstein_state::einstein_80col_state_r) { - UINT8 result = 0; + uint8_t result = 0; result |= m_de; result |= m_80column_dips->read() & 0x06; @@ -155,7 +155,7 @@ static const z80_daisy_config einstein_daisy_chain[] = /* refresh keyboard data. It is refreshed when the keyboard line is written */ void einstein_state::einstein_scan_keyboard() { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(m_keyboard_line, 0)) data &= m_line0->read(); if (!BIT(m_keyboard_line, 1)) data &= m_line1->read(); @@ -310,7 +310,7 @@ WRITE_LINE_MEMBER(einstein_state::write_centronics_fault) READ8_MEMBER(einstein_state::einstein_kybintmsk_r) { - UINT8 data = 0; + uint8_t data = 0; /* clear key int. a read of this I/O port will do this or a reset */ m_interrupt &= ~EINSTEIN_KEY_INT; @@ -397,7 +397,7 @@ void einstein_state::machine_start() void einstein_state::machine_reset() { //device_t *floppy; - //UINT8 config = m_config->read(); + //uint8_t config = m_config->read(); /* initialize memory mapping */ m_bank2->set_base(m_ram->pointer()); @@ -437,8 +437,8 @@ MACHINE_RESET_MEMBER(einstein_state,einstein2) MACHINE_START_MEMBER(einstein_state,einstein2) { - m_crtc_ram = std::make_unique(2048); - memset(m_crtc_ram.get(), 0, sizeof(UINT8) * 2048); + m_crtc_ram = std::make_unique(2048); + memset(m_crtc_ram.get(), 0, sizeof(uint8_t) * 2048); einstein_state::machine_start(); } @@ -447,7 +447,7 @@ MACHINE_START_MEMBER(einstein_state,einstein2) VIDEO EMULATION ***************************************************************************/ -UINT32 einstein_state::screen_update_einstein2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t einstein_state::screen_update_einstein2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (&screen == m_color_screen) { diff --git a/src/mame/drivers/elekscmp.cpp b/src/mame/drivers/elekscmp.cpp index 0eecbf9df4e..9fa5088b8ae 100644 --- a/src/mame/drivers/elekscmp.cpp +++ b/src/mame/drivers/elekscmp.cpp @@ -42,7 +42,7 @@ public: DECLARE_READ8_MEMBER(keyboard_r); DECLARE_WRITE8_MEMBER(hex_display_w); - UINT8 convert_key(UINT8 data); + uint8_t convert_key(uint8_t data); protected: required_device m_maincpu; @@ -58,9 +58,9 @@ WRITE8_MEMBER(elekscmp_state::hex_display_w) output().set_digit_value(offset, data); } -UINT8 elekscmp_state::convert_key(UINT8 data) +uint8_t elekscmp_state::convert_key(uint8_t data) { - UINT8 i; + uint8_t i; for (i = 0; i < 8; i++) if (BIT(data, i)) return i; @@ -70,7 +70,7 @@ UINT8 elekscmp_state::convert_key(UINT8 data) READ8_MEMBER(elekscmp_state::keyboard_r) { - UINT8 data; + uint8_t data; data = m_x0->read(); diff --git a/src/mame/drivers/elwro800.cpp b/src/mame/drivers/elwro800.cpp index f30de584e65..4682eb5c3eb 100644 --- a/src/mame/drivers/elwro800.cpp +++ b/src/mame/drivers/elwro800.cpp @@ -48,11 +48,11 @@ public: /* for elwro800 */ /* RAM mapped at 0 */ - UINT8 m_ram_at_0000; + uint8_t m_ram_at_0000; /* NR signal */ - UINT8 m_NR; - UINT8 m_df_on_databus; + uint8_t m_NR; + uint8_t m_df_on_databus; DECLARE_DIRECT_UPDATE_MEMBER(elwro800_direct_handler); DECLARE_WRITE8_MEMBER(elwro800jr_fdc_control_w); @@ -72,7 +72,7 @@ protected: required_ioport m_io_line9; required_ioport m_io_network_id; - void elwro800jr_mmu_w(UINT8 data); + void elwro800jr_mmu_w(uint8_t data); int m_centronics_ack; }; @@ -118,12 +118,12 @@ WRITE8_MEMBER(elwro800_state::elwro800jr_fdc_control_w) * *************************************/ -void elwro800_state::elwro800jr_mmu_w(UINT8 data) +void elwro800_state::elwro800jr_mmu_w(uint8_t data) { - UINT8 *prom = memregion("proms")->base() + 0x200; - UINT8 *messram = m_ram->pointer(); - UINT8 cs; - UINT8 ls175; + uint8_t *prom = memregion("proms")->base() + 0x200; + uint8_t *messram = m_ram->pointer(); + uint8_t cs; + uint8_t ls175; ls175 = BITSWAP8(data, 7, 6, 5, 4, 4, 5, 7, 6) & 0x0f; @@ -225,8 +225,8 @@ WRITE8_MEMBER(elwro800_state::i8255_port_c_w) READ8_MEMBER(elwro800_state::elwro800jr_io_r) { - UINT8 *prom = memregion("proms")->base(); - UINT8 cs = prom[offset & 0x1ff]; + uint8_t *prom = memregion("proms")->base(); + uint8_t cs = prom[offset & 0x1ff]; if (!BIT(cs,0)) { @@ -309,8 +309,8 @@ READ8_MEMBER(elwro800_state::elwro800jr_io_r) WRITE8_MEMBER(elwro800_state::elwro800jr_io_w) { - UINT8 *prom = memregion("proms")->base(); - UINT8 cs = prom[offset & 0x1ff]; + uint8_t *prom = memregion("proms")->base(); + uint8_t cs = prom[offset & 0x1ff]; if (!BIT(cs,0)) { @@ -494,7 +494,7 @@ INPUT_PORTS_END MACHINE_RESET_MEMBER(elwro800_state,elwro800) { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); m_df_on_databus = 0xdf; memset(messram, 0, 64*1024); diff --git a/src/mame/drivers/embargo.cpp b/src/mame/drivers/embargo.cpp index 586b96e16af..3d373805bb8 100644 --- a/src/mame/drivers/embargo.cpp +++ b/src/mame/drivers/embargo.cpp @@ -19,12 +19,12 @@ public: m_maincpu(*this, "maincpu") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* misc */ - UINT8 m_dial_enable_1; - UINT8 m_dial_enable_2; - UINT8 m_input_select; + uint8_t m_dial_enable_1; + uint8_t m_dial_enable_2; + uint8_t m_input_select; DECLARE_READ8_MEMBER(input_port_bit_r); DECLARE_READ8_MEMBER(dial_r); DECLARE_WRITE8_MEMBER(port_1_w); @@ -32,7 +32,7 @@ public: DECLARE_WRITE8_MEMBER(input_select_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_embargo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_embargo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -43,7 +43,7 @@ public: * *************************************/ -UINT32 embargo_state::screen_update_embargo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t embargo_state::screen_update_embargo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -51,9 +51,9 @@ UINT32 embargo_state::screen_update_embargo(screen_device &screen, bitmap_rgb32 { int i; - UINT8 x = offs << 3; - UINT8 y = offs >> 5; - UINT8 data = m_videoram[offs]; + uint8_t x = offs << 3; + uint8_t y = offs >> 5; + uint8_t data = m_videoram[offs]; for (i = 0; i < 8; i++) { @@ -84,17 +84,17 @@ READ8_MEMBER(embargo_state::input_port_bit_r) READ8_MEMBER(embargo_state::dial_r) { - UINT8 lo = 0; - UINT8 hi = 0; + uint8_t lo = 0; + uint8_t hi = 0; - UINT8 mapped_lo = 0; - UINT8 mapped_hi = 0; + uint8_t mapped_lo = 0; + uint8_t mapped_hi = 0; int i; /* game reads 4 bits per dial and maps them onto clock directions */ - static const UINT8 map[] = + static const uint8_t map[] = { 0x00, 0x0b, 0x01, 0x02, 0x04, 0x04, 0x02, 0x03, 0x09, 0x0a, 0x08, 0x09, 0x08, 0x05, 0x07, 0x06 diff --git a/src/mame/drivers/enigma2.cpp b/src/mame/drivers/enigma2.cpp index eeef544e53b..13f60d38d33 100644 --- a/src/mame/drivers/enigma2.cpp +++ b/src/mame/drivers/enigma2.cpp @@ -69,14 +69,14 @@ public: m_stars(*this, "stars"){ } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* misc */ int m_blink_count; - UINT8 m_sound_latch; - UINT8 m_last_sound_data; - UINT8 m_protection_data; - UINT8 m_flip_screen; + uint8_t m_sound_latch; + uint8_t m_last_sound_data; + uint8_t m_protection_data; + uint8_t m_flip_screen; emu_timer *m_interrupt_clear_timer; emu_timer *m_interrupt_assert_timer; @@ -86,8 +86,8 @@ public: required_device m_audiocpu; required_device m_screen; optional_device m_palette; - optional_region_ptr m_colors; - optional_region_ptr m_stars; + optional_region_ptr m_colors; + optional_region_ptr m_stars; DECLARE_READ8_MEMBER(dip_switch_r); DECLARE_WRITE8_MEMBER(sound_data_w); @@ -99,12 +99,12 @@ public: DECLARE_DRIVER_INIT(enigma2); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_enigma2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_enigma2a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_enigma2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_enigma2a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(interrupt_clear_callback); TIMER_CALLBACK_MEMBER(interrupt_assert_callback); - inline UINT16 vpos_to_vysnc_chain_counter( int vpos ); - inline int vysnc_chain_counter_to_vpos( UINT16 counter ); + inline uint16_t vpos_to_vysnc_chain_counter( int vpos ); + inline int vysnc_chain_counter_to_vpos( uint16_t counter ); void create_interrupt_timers( ); void start_interrupt_timers( ); }; @@ -117,13 +117,13 @@ public: *************************************/ -UINT16 enigma2_state::vpos_to_vysnc_chain_counter( int vpos ) +uint16_t enigma2_state::vpos_to_vysnc_chain_counter( int vpos ) { return vpos + VCOUNTER_START; } -int enigma2_state::vysnc_chain_counter_to_vpos( UINT16 counter ) +int enigma2_state::vysnc_chain_counter_to_vpos( uint16_t counter ) { return counter - VCOUNTER_START; } @@ -137,13 +137,13 @@ TIMER_CALLBACK_MEMBER(enigma2_state::interrupt_clear_callback) TIMER_CALLBACK_MEMBER(enigma2_state::interrupt_assert_callback) { - UINT16 next_counter; + uint16_t next_counter; int next_vpos; /* compute vector and set the interrupt line */ int vpos = m_screen->vpos(); - UINT16 counter = vpos_to_vysnc_chain_counter(vpos); - UINT8 vector = 0xc7 | ((counter & 0x80) >> 3) | ((~counter & 0x80) >> 4); + uint16_t counter = vpos_to_vysnc_chain_counter(vpos); + uint8_t vector = 0xc7 | ((counter & 0x80) >> 3) | ((~counter & 0x80) >> 4); m_maincpu->set_input_line_and_vector(0, ASSERT_LINE, vector); /* set up for next interrupt */ @@ -205,21 +205,21 @@ void enigma2_state::machine_reset() * *************************************/ -UINT32 enigma2_state::screen_update_enigma2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t enigma2_state::screen_update_enigma2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const rectangle &visarea = screen.visible_area(); - UINT8 x = 0; - UINT16 bitmap_y = visarea.min_y; - UINT8 y = (UINT8)vpos_to_vysnc_chain_counter(bitmap_y); - UINT8 video_data = 0; - UINT8 fore_color = 0; - UINT8 star_color = 0; + uint8_t x = 0; + uint16_t bitmap_y = visarea.min_y; + uint8_t y = (uint8_t)vpos_to_vysnc_chain_counter(bitmap_y); + uint8_t video_data = 0; + uint8_t fore_color = 0; + uint8_t star_color = 0; while (1) { - UINT8 bit; - UINT8 color; + uint8_t bit; + uint8_t color; /* read the video RAM */ if ((x & 0x07) == 0x00) @@ -292,17 +292,17 @@ UINT32 enigma2_state::screen_update_enigma2(screen_device &screen, bitmap_rgb32 } -UINT32 enigma2_state::screen_update_enigma2a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t enigma2_state::screen_update_enigma2a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 x = 0; + uint8_t x = 0; const rectangle &visarea = screen.visible_area(); - UINT16 bitmap_y = visarea.min_y; - UINT8 y = (UINT8)vpos_to_vysnc_chain_counter(bitmap_y); - UINT8 video_data = 0; + uint16_t bitmap_y = visarea.min_y; + uint8_t y = (uint8_t)vpos_to_vysnc_chain_counter(bitmap_y); + uint8_t video_data = 0; while (1) { - UINT8 bit; + uint8_t bit; pen_t pen; /* read the video RAM */ @@ -355,7 +355,7 @@ UINT32 enigma2_state::screen_update_enigma2a(screen_device &screen, bitmap_rgb32 READ8_MEMBER(enigma2_state::dip_switch_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; if (LOG_PROT) logerror("DIP SW Read: %x at %x (prot data %x)\n", offset, space.device().safe_pc(), m_protection_data); switch (offset) @@ -694,7 +694,7 @@ ROM_END DRIVER_INIT_MEMBER(enigma2_state,enigma2) { offs_t i; - UINT8 *rom = memregion("audiocpu")->base(); + uint8_t *rom = memregion("audiocpu")->base(); for(i = 0; i < 0x2000; i++) { diff --git a/src/mame/drivers/enmirage.cpp b/src/mame/drivers/enmirage.cpp index 0d0bb3aa935..4ab0c6c2379 100644 --- a/src/mame/drivers/enmirage.cpp +++ b/src/mame/drivers/enmirage.cpp @@ -76,13 +76,13 @@ public: DECLARE_DRIVER_INIT(mirage); virtual void video_start() override; - UINT32 screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(mirage_via_write_porta); DECLARE_WRITE8_MEMBER(mirage_via_write_portb); DECLARE_WRITE_LINE_MEMBER(mirage_doc_irq); DECLARE_READ8_MEMBER(mirage_adc_read); - UINT8 m_l_segs, m_r_segs; + uint8_t m_l_segs, m_r_segs; int m_l_hi, m_r_hi; }; @@ -108,7 +108,7 @@ void mirage_state::video_start() { } -UINT32 mirage_state::screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mirage_state::screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } @@ -138,7 +138,7 @@ ADDRESS_MAP_END // bits 5/6/7 keypad rows 0/1/2 return WRITE8_MEMBER(mirage_state::mirage_via_write_porta) { - UINT8 seg = data & 7; + uint8_t seg = data & 7; static const int segconv[8] = { 16, 8, 32, 2, 1, 64, 128, 4 diff --git a/src/mame/drivers/eolith.cpp b/src/mame/drivers/eolith.cpp index 5403f5f07c1..eb8a7b6e0de 100644 --- a/src/mame/drivers/eolith.cpp +++ b/src/mame/drivers/eolith.cpp @@ -1516,7 +1516,7 @@ DRIVER_INIT_MEMBER(eolith_state,landbrka) //it fails compares with memories: //$4002d338 -> $4002d348 .... $4002d33f -> $4002d34f //related with bits 0x100 - 0x200 read at startup from input(0) ? - UINT32 *rombase = (UINT32*)memregion("maincpu")->base(); + uint32_t *rombase = (uint32_t*)memregion("maincpu")->base(); rombase[0x14f00/4] = (rombase[0x14f00/4] & 0xffff) | 0x03000000; /* Change BR to NOP */ m_coin_counter_bit = 0x2000; @@ -1527,7 +1527,7 @@ DRIVER_INIT_MEMBER(eolith_state,landbrka) DRIVER_INIT_MEMBER(eolith_state,hidctch2) { //it fails compares in memory like in landbrka - UINT32 *rombase = (UINT32*)memregion("maincpu")->base(); + uint32_t *rombase = (uint32_t*)memregion("maincpu")->base(); rombase[0xbcc8/4] = (rombase[0xbcc8/4] & 0xffff) | 0x03000000; /* Change BR to NOP */ DRIVER_INIT_CALL(eolith); @@ -1536,7 +1536,7 @@ DRIVER_INIT_MEMBER(eolith_state,hidctch2) DRIVER_INIT_MEMBER(eolith_state,hidnc2k) { - UINT32 *rombase = (UINT32*)memregion("maincpu")->base(); + uint32_t *rombase = (uint32_t*)memregion("maincpu")->base(); rombase[0x17b2c/4] = (rombase[0x17b2c/4] & 0x0000ffff) | 0x03000000; /* Change BR to NOP */ DRIVER_INIT_CALL(eolith); } diff --git a/src/mame/drivers/eolith16.cpp b/src/mame/drivers/eolith16.cpp index fe33a8b874a..15e5fb7ac8c 100644 --- a/src/mame/drivers/eolith16.cpp +++ b/src/mame/drivers/eolith16.cpp @@ -25,7 +25,7 @@ public: eolith16_state(const machine_config &mconfig, device_type type, const char *tag) : eolith_state(mconfig, type, tag) { } - std::unique_ptr m_vram; + std::unique_ptr m_vram; int m_vbuffer; DECLARE_WRITE16_MEMBER(eeprom_w); @@ -37,7 +37,7 @@ public: DECLARE_VIDEO_START(eolith16); DECLARE_PALETTE_INIT(eolith16); - UINT32 screen_update_eolith16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_eolith16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -116,12 +116,12 @@ INPUT_PORTS_END VIDEO_START_MEMBER(eolith16_state,eolith16) { - m_vram = std::make_unique(0x10000); + m_vram = std::make_unique(0x10000); save_pointer(NAME(m_vram.get()), 0x10000); save_item(NAME(m_vbuffer)); } -UINT32 eolith16_state::screen_update_eolith16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t eolith16_state::screen_update_eolith16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count; int color; diff --git a/src/mame/drivers/ep64.cpp b/src/mame/drivers/ep64.cpp index 53e4a23b9c1..a1b9c94f4c2 100644 --- a/src/mame/drivers/ep64.cpp +++ b/src/mame/drivers/ep64.cpp @@ -209,7 +209,7 @@ public: DECLARE_READ8_MEMBER( rd1_r ); DECLARE_WRITE8_MEMBER( wr2_w ); - UINT8 m_key; + uint8_t m_key; DECLARE_WRITE_LINE_MEMBER(write_centronics_busy); int m_centronics_busy; @@ -227,7 +227,7 @@ public: READ8_MEMBER( ep64_state::rd0_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_key < 10) { @@ -300,7 +300,7 @@ READ8_MEMBER( ep64_state::rd1_r ) */ - UINT8 data = 0; + uint8_t data = 0; // printer data |= m_centronics_busy << 3; diff --git a/src/mame/drivers/epos.cpp b/src/mame/drivers/epos.cpp index 2afbd439cdd..2ed9fe277e0 100644 --- a/src/mame/drivers/epos.cpp +++ b/src/mame/drivers/epos.cpp @@ -387,7 +387,7 @@ void epos_state::machine_reset() MACHINE_START_MEMBER(epos_state,dealer) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x0000], 0x10000); membank("bank2")->configure_entries(0, 2, &ROM[0x6000], 0x1000); @@ -628,7 +628,7 @@ ROM_END DRIVER_INIT_MEMBER(epos_state,dealer) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int A; /* Key 0 */ diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp index 2a3ec845281..e8a88b9f7e9 100644 --- a/src/mame/drivers/equites.cpp +++ b/src/mame/drivers/equites.cpp @@ -392,7 +392,7 @@ TIMER_CALLBACK_MEMBER(equites_state::equites_nmi_callback) TIMER_CALLBACK_MEMBER(equites_state::equites_frq_adjuster_callback) { - UINT8 frq = ioport(FRQ_ADJUSTER_TAG)->read(); + uint8_t frq = ioport(FRQ_ADJUSTER_TAG)->read(); m_msm->set_clock(MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100); //popmessage("8155: C %02x A %02x AY: A %02x B %02x Unk:%x", m_eq8155_port_c, m_eq8155_port_a, m_ay_port_a, m_ay_port_b, m_eq_cymbal_ctrl & 15); @@ -1931,7 +1931,7 @@ ROM_END void equites_state::unpack_block(const char *region, int offset, int size) { - UINT8 *rom = memregion(region)->base(); + uint8_t *rom = memregion(region)->base(); for (int i = 0; i < size; i++) { diff --git a/src/mame/drivers/esd16.cpp b/src/mame/drivers/esd16.cpp index fe1e083ba41..8fc6444b932 100644 --- a/src/mame/drivers/esd16.cpp +++ b/src/mame/drivers/esd16.cpp @@ -582,7 +582,7 @@ GFXDECODE_END void esd16_state::machine_start() { - UINT8 *AUDIO = memregion("audiocpu")->base(); + uint8_t *AUDIO = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 16, &AUDIO[0x0000], 0x4000); diff --git a/src/mame/drivers/esh.cpp b/src/mame/drivers/esh.cpp index 588782f3394..c1966c1e119 100644 --- a/src/mame/drivers/esh.cpp +++ b/src/mame/drivers/esh.cpp @@ -48,8 +48,8 @@ public: required_device m_laserdisc; required_device m_screen; - required_shared_ptr m_tile_ram; - required_shared_ptr m_tile_control_ram; + required_shared_ptr m_tile_ram; + required_shared_ptr m_tile_control_ram; bool m_ld_video_visible; DECLARE_READ8_MEMBER(ldp_read); DECLARE_WRITE8_MEMBER(ldp_write); @@ -60,7 +60,7 @@ public: bool m_nmi_enable; virtual void machine_start() override; DECLARE_PALETTE_INIT(esh); - UINT32 screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_callback_esh); DECLARE_WRITE_LINE_MEMBER(ld_command_strobe_cb); required_device m_maincpu; @@ -78,11 +78,11 @@ protected: /* VIDEO GOODS */ -UINT32 esh_state::screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t esh_state::screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int charx, chary; - const UINT8 pal_bank = m_ld_video_visible == true ? 0x10 : 0x00; - const UINT32 trans_mask = m_ld_video_visible == true ? 0 : -1; + const uint8_t pal_bank = m_ld_video_visible == true ? 0x10 : 0x00; + const uint32_t trans_mask = m_ld_video_visible == true ? 0 : -1; gfx_element *gfx;// = m_gfxdecode->gfx(0); /* clear */ @@ -274,7 +274,7 @@ INPUT_PORTS_END PALETTE_INIT_MEMBER(esh_state, esh) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; /* Oddly enough, the top 4 bits of each byte is 0 <- ??? */ diff --git a/src/mame/drivers/esq1.cpp b/src/mame/drivers/esq1.cpp index 51310b25c8d..aa4a9b129a2 100644 --- a/src/mame/drivers/esq1.cpp +++ b/src/mame/drivers/esq1.cpp @@ -194,12 +194,12 @@ class esq1_filters : public device_t, { public: // construction/destruction - esq1_filters(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + esq1_filters(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_vca(int channel, UINT8 value); - void set_vpan(int channel, UINT8 value); - void set_vq(int channel, UINT8 value); - void set_vfc(int channel, UINT8 value); + void set_vca(int channel, uint8_t value); + void set_vpan(int channel, uint8_t value); + void set_vq(int channel, uint8_t value); + void set_vfc(int channel, uint8_t value); protected: // device-level overrides @@ -210,7 +210,7 @@ protected: private: struct filter { - UINT8 vca, vpan, vq, vfc; + uint8_t vca, vpan, vq, vfc; double amp, lamp, ramp; double a[5], b[5]; double x[4], y[4]; @@ -225,13 +225,13 @@ private: static const device_type ESQ1_FILTERS = &device_creator; -esq1_filters::esq1_filters(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +esq1_filters::esq1_filters(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ESQ1_FILTERS, "ESQ1 Filters stage", tag, owner, clock, "esq1-filters", __FILE__), device_sound_interface(mconfig, *this) { } -void esq1_filters::set_vca(int channel, UINT8 value) +void esq1_filters::set_vca(int channel, uint8_t value) { if(filters[channel].vca != value) { stream->update(); @@ -240,7 +240,7 @@ void esq1_filters::set_vca(int channel, UINT8 value) } } -void esq1_filters::set_vpan(int channel, UINT8 value) +void esq1_filters::set_vpan(int channel, uint8_t value) { if(filters[channel].vpan != value) { stream->update(); @@ -249,7 +249,7 @@ void esq1_filters::set_vpan(int channel, UINT8 value) } } -void esq1_filters::set_vq(int channel, UINT8 value) +void esq1_filters::set_vq(int channel, uint8_t value) { if(filters[channel].vq != value) { stream->update(); @@ -258,7 +258,7 @@ void esq1_filters::set_vq(int channel, UINT8 value) } } -void esq1_filters::set_vfc(int channel, UINT8 value) +void esq1_filters::set_vfc(int channel, uint8_t value) { if(filters[channel].vfc != value) { stream->update(); @@ -416,12 +416,12 @@ public: int m_mapper_state; int m_seq_bank; - UINT8 m_seqram[0x10000]; - UINT8 m_dosram[0x2000]; + uint8_t m_seqram[0x10000]; + uint8_t m_dosram[0x2000]; virtual void machine_reset() override; DECLARE_INPUT_CHANGED_MEMBER(key_stroke); - void send_through_panel(UINT8 data); + void send_through_panel(uint8_t data); }; @@ -562,7 +562,7 @@ WRITE_LINE_MEMBER(esq1_state::duart_tx_b) m_panel->rx_w(state); } -void esq1_state::send_through_panel(UINT8 data) +void esq1_state::send_through_panel(uint8_t data) { m_panel->xmit_char(data); } @@ -571,13 +571,13 @@ INPUT_CHANGED_MEMBER(esq1_state::key_stroke) { if (oldval == 0 && newval == 1) { - send_through_panel((UINT8)(uintptr_t)param); - send_through_panel((UINT8)(uintptr_t)0x00); + send_through_panel((uint8_t)(uintptr_t)param); + send_through_panel((uint8_t)(uintptr_t)0x00); } else if (oldval == 1 && newval == 0) { - send_through_panel((UINT8)(uintptr_t)param&0x7f); - send_through_panel((UINT8)(uintptr_t)0x00); + send_through_panel((uint8_t)(uintptr_t)param&0x7f); + send_through_panel((uint8_t)(uintptr_t)0x00); } } diff --git a/src/mame/drivers/esq5505.cpp b/src/mame/drivers/esq5505.cpp index b9e72bec995..b09ea857a02 100644 --- a/src/mame/drivers/esq5505.cpp +++ b/src/mame/drivers/esq5505.cpp @@ -202,11 +202,11 @@ public: DECLARE_WRITE8_MEMBER(duart_output); int m_system_type; - UINT8 m_duart_io; - UINT8 otis_irq_state; - UINT8 dmac_irq_state; + uint8_t m_duart_io; + uint8_t otis_irq_state; + uint8_t dmac_irq_state; int dmac_irq_vector; - UINT8 duart_irq_state; + uint8_t duart_irq_state; int duart_irq_vector; void update_irq_to_maincpu(); @@ -214,8 +214,8 @@ public: DECLARE_FLOPPY_FORMATS( floppy_formats ); private: - UINT16 *m_rom, *m_ram; - UINT16 m_analog_values[8]; + uint16_t *m_rom, *m_ram; + uint16_t m_analog_values[8]; public: DECLARE_DRIVER_INIT(eps); @@ -263,8 +263,8 @@ void esq5505_state::machine_start() m_pump->set_otis(m_otis); m_pump->set_esp(m_esp); - m_rom = (UINT16 *)(void *)memregion("osrom")->base(); - m_ram = (UINT16 *)(void *)memshare("osram")->ptr(); + m_rom = (uint16_t *)(void *)memregion("osrom")->base(); + m_ram = (uint16_t *)(void *)memshare("osram")->ptr(); } void esq5505_state::machine_reset() @@ -332,8 +332,8 @@ READ16_MEMBER(esq5505_state::lower_r) // get pointers when 68k resets if (!m_rom) { - m_rom = (UINT16 *)(void *)memregion("osrom")->base(); - m_ram = (UINT16 *)(void *)memshare("osram")->ptr(); + m_rom = (uint16_t *)(void *)memregion("osrom")->base(); + m_ram = (uint16_t *)(void *)memshare("osram")->ptr(); } if (!space.debugger_access() && m_maincpu->get_fc() == 0x6) // supervisor mode = ROM @@ -548,7 +548,7 @@ WRITE8_MEMBER(esq5505_state::fdc_write_byte) #if KEYBOARD_HACK INPUT_CHANGED_MEMBER(esq5505_state::key_stroke) { - int val = (UINT8)(uintptr_t)param; + int val = (uint8_t)(uintptr_t)param; int cmp = 0x60; if (m_system_type == SQ1) @@ -591,7 +591,7 @@ INPUT_CHANGED_MEMBER(esq5505_state::key_stroke) } else if (oldval == 1 && newval == 0) { - // printf("key off %x\n", (UINT8)(uintptr_t)param); + // printf("key off %x\n", (uint8_t)(uintptr_t)param); m_panel->xmit_char(val&0x7f); m_panel->xmit_char(0x00); } @@ -974,9 +974,9 @@ DRIVER_INIT_MEMBER(esq5505_state,sq1) DRIVER_INIT_MEMBER(esq5505_state,denib) { - UINT8 *pNibbles = (UINT8 *)memregion("nibbles")->base(); - UINT8 *pBS0L = (UINT8 *)memregion("waverom")->base(); - UINT8 *pBS0H = pBS0L + 0x100000; + uint8_t *pNibbles = (uint8_t *)memregion("nibbles")->base(); + uint8_t *pBS0L = (uint8_t *)memregion("waverom")->base(); + uint8_t *pBS0H = pBS0L + 0x100000; DRIVER_INIT_CALL(common); diff --git a/src/mame/drivers/esqkt.cpp b/src/mame/drivers/esqkt.cpp index a541f74ad67..5540987f51d 100644 --- a/src/mame/drivers/esqkt.cpp +++ b/src/mame/drivers/esqkt.cpp @@ -120,7 +120,7 @@ public: DECLARE_WRITE_LINE_MEMBER(duart_tx_b); DECLARE_WRITE8_MEMBER(duart_output); - UINT8 m_duart_io; + uint8_t m_duart_io; bool m_bCalibSecondByte; public: diff --git a/src/mame/drivers/esripsys.cpp b/src/mame/drivers/esripsys.cpp index bf62a7e04fc..52517389199 100644 --- a/src/mame/drivers/esripsys.cpp +++ b/src/mame/drivers/esripsys.cpp @@ -95,7 +95,7 @@ READ8_MEMBER(esripsys_state::g_status_r) WRITE8_MEMBER(esripsys_state::g_status_w) { int bankaddress; - UINT8 *rom = memregion("game_cpu")->base(); + uint8_t *rom = memregion("game_cpu")->base(); m_g_status = data; @@ -135,7 +135,7 @@ WRITE8_MEMBER(esripsys_state::g_status_w) READ8_MEMBER(esripsys_state::f_status_r) { int vblank = m_screen->vblank(); - UINT8 rip_status = m_videocpu->get_rip_status(); + uint8_t rip_status = m_videocpu->get_rip_status(); rip_status = (rip_status & 0x18) | (BIT(rip_status, 6) << 1) | BIT(rip_status, 7); @@ -229,8 +229,8 @@ WRITE16_MEMBER( esripsys_state::fdt_rip_w ) READ8_MEMBER(esripsys_state::rip_status_in) { int vpos = m_screen->vpos(); - UINT8 _vblank = !(vpos >= ESRIPSYS_VBLANK_START); -// UINT8 _hblank = !m_screen->hblank(); + uint8_t _vblank = !(vpos >= ESRIPSYS_VBLANK_START); +// uint8_t _hblank = !m_screen->hblank(); return _vblank | (m_hblank << 1) @@ -478,7 +478,7 @@ WRITE8_MEMBER(esripsys_state::s_200e_w) WRITE8_MEMBER(esripsys_state::s_200f_w) { - UINT8 *rom = memregion("sound_data")->base(); + uint8_t *rom = memregion("sound_data")->base(); int rombank = data & 0x20 ? 0x2000 : 0; /* Bit 6 -> Reset latch U56A */ @@ -510,7 +510,7 @@ READ8_MEMBER(esripsys_state::tms5220_r) if (offset == 0) { /* TMS5220 core returns status bits in D7-D6 */ - UINT8 status = m_tms->status_r(space, 0); + uint8_t status = m_tms->status_r(space, 0); status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5); return (m_tms->readyq_r() << 7) | (m_tms->intq_r() << 6) | status; @@ -551,7 +551,7 @@ WRITE8_MEMBER(esripsys_state::esripsys_dac_w) } else { - UINT16 dac_data = (m_dac_msb << 8) | data; + uint16_t dac_data = (m_dac_msb << 8) | data; m_dac->write(dac_data); } } @@ -616,11 +616,11 @@ ADDRESS_MAP_END DRIVER_INIT_MEMBER(esripsys_state,esripsys) { - UINT8 *rom = memregion("sound_data")->base(); + uint8_t *rom = memregion("sound_data")->base(); - m_fdt_a = std::make_unique(FDT_RAM_SIZE); - m_fdt_b = std::make_unique(FDT_RAM_SIZE); - m_cmos_ram = std::make_unique(CMOS_RAM_SIZE); + m_fdt_a = std::make_unique(FDT_RAM_SIZE); + m_fdt_b = std::make_unique(FDT_RAM_SIZE); + m_cmos_ram = std::make_unique(CMOS_RAM_SIZE); machine().device("nvram")->set_base(m_cmos_ram.get(), CMOS_RAM_SIZE); diff --git a/src/mame/drivers/et3400.cpp b/src/mame/drivers/et3400.cpp index e17a2df0c1a..eb3c5515ad5 100644 --- a/src/mame/drivers/et3400.cpp +++ b/src/mame/drivers/et3400.cpp @@ -60,7 +60,7 @@ private: READ8_MEMBER( et3400_state::keypad_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (~offset & 4) data &= ioport("X2")->read(); @@ -76,10 +76,10 @@ WRITE8_MEMBER( et3400_state::display_w ) { /* This computer sets each segment, one at a time. */ - static const UINT8 segments[8]={0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x80}; - UINT8 digit = (offset >> 4) & 7; - UINT8 segment = segments[offset & 7]; - UINT8 segdata = output().get_digit_value(digit); + static const uint8_t segments[8]={0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x80}; + uint8_t digit = (offset >> 4) & 7; + uint8_t segment = segments[offset & 7]; + uint8_t segdata = output().get_digit_value(digit); if (data & 1) segdata |= segment; diff --git a/src/mame/drivers/eti660.cpp b/src/mame/drivers/eti660.cpp index 74227888bb0..aabf6e6b055 100644 --- a/src/mame/drivers/eti660.cpp +++ b/src/mame/drivers/eti660.cpp @@ -42,14 +42,14 @@ READ8_MEMBER( eti660_state::pia_r ) { - UINT8 pia_offset = m_maincpu->get_memory_address() & 0x03; + uint8_t pia_offset = m_maincpu->get_memory_address() & 0x03; return m_pia->read(space, pia_offset); } WRITE8_MEMBER( eti660_state::pia_w ) { - UINT8 pia_offset = m_maincpu->get_memory_address() & 0x03; + uint8_t pia_offset = m_maincpu->get_memory_address() & 0x03; // Some PIA hacks here, as mentioned in the ToDo. if (pia_offset == 1) @@ -69,7 +69,7 @@ WRITE8_MEMBER( eti660_state::colorram_w ) { offset = m_maincpu->get_memory_address() - 0xc80; - UINT8 colorram_offset = (((offset & 0x1f0) >> 1) | (offset & 0x07)); + uint8_t colorram_offset = (((offset & 0x1f0) >> 1) | (offset & 0x07)); if (colorram_offset < 0xc0) m_color_ram[colorram_offset] = data; @@ -187,7 +187,7 @@ WRITE8_MEMBER( eti660_state::dma_w ) if (m_color_on) { - UINT8 colorram_offset = ((offset & 0x1f0) >> 1) | (offset & 0x07); + uint8_t colorram_offset = ((offset & 0x1f0) >> 1) | (offset & 0x07); if (colorram_offset < 0xc0) m_color = m_color_ram[colorram_offset]; @@ -218,7 +218,7 @@ READ8_MEMBER( eti660_state::pia_pa_r ) */ - UINT8 i, data = 0xff; + uint8_t i, data = 0xff; for (i = 0; i < 4; i++) if (BIT(m_keylatch, i)) @@ -267,7 +267,7 @@ QUICKLOAD_LOAD_MEMBER( eti660_state, eti660 ) int i; int quick_addr = 0x600; int quick_length; - std::vector quick_data; + std::vector quick_data; int read_; image_init_result result = image_init_result::FAIL; diff --git a/src/mame/drivers/ettrivia.cpp b/src/mame/drivers/ettrivia.cpp index 52293f5ee2e..1caee74215b 100644 --- a/src/mame/drivers/ettrivia.cpp +++ b/src/mame/drivers/ettrivia.cpp @@ -49,8 +49,8 @@ public: int m_b000_val; int m_b000_ret; int m_b800_prev; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; DECLARE_WRITE8_MEMBER(ettrivia_fg_w); @@ -64,9 +64,9 @@ public: TILE_GET_INFO_MEMBER(get_tile_info_fg); virtual void video_start() override; DECLARE_PALETTE_INIT(ettrivia); - UINT32 screen_update_ettrivia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ettrivia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ettrivia_interrupt); - inline void get_tile_info(tile_data &tileinfo, int tile_index, UINT8 *vidram, int gfx_code); + inline void get_tile_info(tile_data &tileinfo, int tile_index, uint8_t *vidram, int gfx_code); required_device m_maincpu; required_device m_gfxdecode; }; @@ -100,7 +100,7 @@ WRITE8_MEMBER(ettrivia_state::ettrivia_control_w) READ8_MEMBER(ettrivia_state::ettrivia_question_r) { - UINT8 *QUESTIONS = memregion("user1")->base(); + uint8_t *QUESTIONS = memregion("user1")->base(); return QUESTIONS[offset + 0x10000 * m_question_bank]; } @@ -203,7 +203,7 @@ static GFXDECODE_START( ettrivia ) GFXDECODE_ENTRY( "gfx2", 0, charlayout, 32*4, 32 ) GFXDECODE_END -void ettrivia_state::get_tile_info(tile_data &tileinfo, int tile_index, UINT8 *vidram, int gfx_code) +void ettrivia_state::get_tile_info(tile_data &tileinfo, int tile_index, uint8_t *vidram, int gfx_code) { int code = vidram[tile_index]; int color = (code >> 5) + 8 * m_palreg; @@ -225,7 +225,7 @@ TILE_GET_INFO_MEMBER(ettrivia_state::get_tile_info_fg) PALETTE_INIT_MEMBER(ettrivia_state, ettrivia) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); static const int resistances[2] = { 270, 130 }; double weights[2]; int i; @@ -268,7 +268,7 @@ void ettrivia_state::video_start() m_fg_tilemap->set_transparent_pen(0); } -UINT32 ettrivia_state::screen_update_ettrivia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ettrivia_state::screen_update_ettrivia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0); diff --git a/src/mame/drivers/europc.cpp b/src/mame/drivers/europc.cpp index c2171d44749..ab9b0273690 100644 --- a/src/mame/drivers/europc.cpp +++ b/src/mame/drivers/europc.cpp @@ -37,11 +37,11 @@ public: void europc_rtc_set_time(); - UINT8 m_jim_data[16]; - UINT8 m_jim_state; + uint8_t m_jim_data[16]; + uint8_t m_jim_state; AGA_MODE m_jim_mode; int m_port61; // bit 0,1 must be 0 for startup; reset? - UINT8 m_rtc_data[0x10]; + uint8_t m_rtc_data[0x10]; int m_rtc_reg; int m_rtc_state; @@ -323,7 +323,7 @@ WRITE8_MEMBER( europc_pc_state::europc_rtc_w ) DRIVER_INIT_MEMBER(europc_pc_state,europc) { - UINT8 *rom = &memregion("bios")->base()[0]; + uint8_t *rom = &memregion("bios")->base()[0]; int i; /* @@ -331,7 +331,7 @@ DRIVER_INIT_MEMBER(europc_pc_state,europc) if year <79 month (and not CENTURY) is loaded with 0x20 */ if (rom[0xf93e]==0xb6){ // mov dh, - UINT8 a; + uint8_t a; rom[0xf93e]=0xb5; // mov ch, for (i=0x8000, a=0; i<0xffff; i++ ) a+=rom[i]; rom[0xffff]=256-a; diff --git a/src/mame/drivers/evmbug.cpp b/src/mame/drivers/evmbug.cpp index 70fb61a2f51..3017b19ebe9 100644 --- a/src/mame/drivers/evmbug.cpp +++ b/src/mame/drivers/evmbug.cpp @@ -31,8 +31,8 @@ public: DECLARE_WRITE8_MEMBER(rs232_w); DECLARE_WRITE8_MEMBER(kbd_put); virtual void machine_reset() override; - UINT8 m_term_data; - UINT8 m_term_out; + uint8_t m_term_data; + uint8_t m_term_out; required_device m_maincpu; required_device m_terminal; }; @@ -54,7 +54,7 @@ INPUT_PORTS_END READ8_MEMBER( evmbug_state::rs232_r ) { - static UINT8 temp = 0; + static uint8_t temp = 0; temp^=0xff; if (offset == 1) return temp; @@ -64,7 +64,7 @@ READ8_MEMBER( evmbug_state::rs232_r ) return 0xff;//(m_term_data) ? 0 : 0xff; } - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/excali64.cpp b/src/mame/drivers/excali64.cpp index 1786233ea9d..ec9fd98e00e 100644 --- a/src/mame/drivers/excali64.cpp +++ b/src/mame/drivers/excali64.cpp @@ -90,11 +90,11 @@ public: required_device m_palette; private: - const UINT8 *m_p_chargen; - UINT8 *m_p_videoram; - UINT8 *m_p_hiresram; - UINT8 m_sys_status; - UINT8 m_kbdrow; + const uint8_t *m_p_chargen; + uint8_t *m_p_videoram; + uint8_t *m_p_hiresram; + uint8_t m_sys_status; + uint8_t m_kbdrow; bool m_crtc_vs; bool m_crtc_hs; bool m_motor; @@ -244,7 +244,7 @@ WRITE8_MEMBER( excali64_state::motor_w ) READ8_MEMBER( excali64_state::porte8_r ) { - return 0xfc | (UINT8)m_motor; + return 0xfc | (uint8_t)m_motor; } WRITE8_MEMBER( excali64_state::porte4_w ) @@ -311,8 +311,8 @@ WRITE8_MEMBER( excali64_state::ppib_w ) READ8_MEMBER( excali64_state::ppic_r ) { - UINT8 data = 0xf4; // READY line must be low to print - data |= (UINT8)m_centronics_busy; + uint8_t data = 0xf4; // READY line must be low to print + data |= (uint8_t)m_centronics_busy; data |= (m_cass->input() > 0.1) << 3; return data; } @@ -325,7 +325,7 @@ WRITE8_MEMBER( excali64_state::ppic_w ) READ8_MEMBER( excali64_state::port00_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 8; i++) { @@ -346,9 +346,9 @@ d5 : rombank */ READ8_MEMBER( excali64_state::port50_r ) { - UINT8 data = m_sys_status & 0x2f; + uint8_t data = m_sys_status & 0x2f; bool csync = m_crtc_hs | m_crtc_vs; - data |= (UINT8)csync << 4; + data |= (uint8_t)csync << 4; return data; } @@ -449,8 +449,8 @@ PALETTE_INIT_MEMBER( excali64_state, excali64 ) m_p_videoram = memregion("videoram")->base(); m_p_chargen = memregion("chargen")->base(); m_p_hiresram = m_p_videoram + 0x2000; - UINT8 *main = memregion("roms")->base(); - UINT8 *ram = memregion("rambank")->base(); + uint8_t *main = memregion("roms")->base(); + uint8_t *ram = memregion("rambank")->base(); // main ram (cp/m mode) membank("bankr1")->configure_entry(0, &ram[0x0000]); @@ -477,7 +477,7 @@ PALETTE_INIT_MEMBER( excali64_state, excali64 ) membank("bankw4")->configure_entry(2, &m_p_hiresram[0x0000]); // Set up foreground colours - UINT8 r,g,b,i,code; + uint8_t r,g,b,i,code; for (i = 0; i < 32; i++) { code = m_p_chargen[0x1000+i]; @@ -501,10 +501,10 @@ PALETTE_INIT_MEMBER( excali64_state, excali64 ) MC6845_UPDATE_ROW( excali64_state::update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx,col,bg,fg; - UINT16 mem,x; - UINT8 col_base = BIT(m_sys_status, 3) ? 16 : 0; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx,col,bg,fg; + uint16_t mem,x; + uint8_t col_base = BIT(m_sys_status, 3) ? 16 : 0; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { @@ -516,7 +516,7 @@ MC6845_UPDATE_ROW( excali64_state::update_row ) if (BIT(col, 0)) { - UINT8 h = m_p_videoram[mem+0x1000] - 4; + uint8_t h = m_p_videoram[mem+0x1000] - 4; if (h > 5) h = 0; // keep us in bounds // hires definition - pixels are opposite order to characters diff --git a/src/mame/drivers/exelv.cpp b/src/mame/drivers/exelv.cpp index b32bad27f73..b28baa0c1d5 100644 --- a/src/mame/drivers/exelv.cpp +++ b/src/mame/drivers/exelv.cpp @@ -94,16 +94,16 @@ public: DECLARE_MACHINE_START(exeltel); /* tms7020 i/o ports */ - UINT8 m_tms7020_portb; + uint8_t m_tms7020_portb; /* tms7041 i/o ports */ - UINT8 m_tms7041_portb; - UINT8 m_tms7041_portc; - UINT8 m_tms7041_portd; + uint8_t m_tms7041_portb; + uint8_t m_tms7041_portc; + uint8_t m_tms7041_portd; /* mailbox data */ - UINT8 m_wx318; /* data of 74ls374 labeled wx318 */ - UINT8 m_wx319; /* data of 74sl374 labeled wx319 */ + uint8_t m_wx318; /* data of 74ls374 labeled wx318 */ + uint8_t m_wx319; /* data of 74sl374 labeled wx319 */ TIMER_DEVICE_CALLBACK_MEMBER(exelv_hblank_interrupt); @@ -255,8 +255,8 @@ WRITE8_MEMBER(exelv_state::tms7020_portb_w) */ READ8_MEMBER(exelv_state::tms7041_porta_r) { - UINT8 data = 0x00; - static UINT8 data_last=0; + uint8_t data = 0x00; + static uint8_t data_last=0; // TMS5220 OK data |= m_tms5220c->intq_r() ? 0x08 : 0x00; // A3 @@ -314,7 +314,7 @@ WRITE8_MEMBER(exelv_state::tms7041_portb_w) */ READ8_MEMBER(exelv_state::tms7041_portc_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; logerror("tms7041_portc_r\n"); /* Check if wx318 output is enabled */ @@ -345,7 +345,7 @@ WRITE8_MEMBER(exelv_state::tms7041_portc_w) */ READ8_MEMBER(exelv_state::tms7041_portd_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; data=m_tms5220c->status_r(space, 0, data); logerror("tms7041_portd_r\n"); return data; @@ -464,7 +464,7 @@ MACHINE_START_MEMBER( exelv_state, exl100) MACHINE_START_MEMBER( exelv_state, exeltel) { - UINT8 *rom = memregion("user1")->base() + 0x0200; + uint8_t *rom = memregion("user1")->base() + 0x0200; membank("bank1")->configure_entry(0, rom); membank("bank1")->set_entry(0); diff --git a/src/mame/drivers/exerion.cpp b/src/mame/drivers/exerion.cpp index 97ae0912dc7..bd73af6b6ac 100644 --- a/src/mame/drivers/exerion.cpp +++ b/src/mame/drivers/exerion.cpp @@ -509,11 +509,11 @@ ROM_END DRIVER_INIT_MEMBER(exerion_state,exerion) { - UINT32 oldaddr, newaddr, length; - UINT8 *src, *dst; + uint32_t oldaddr, newaddr, length; + uint8_t *src, *dst; /* allocate some temporary space */ - std::vector temp(0x10000); + std::vector temp(0x10000); /* make a temporary copy of the character data */ src = &temp[0]; @@ -556,7 +556,7 @@ DRIVER_INIT_MEMBER(exerion_state,exerion) DRIVER_INIT_MEMBER(exerion_state,exerionb) { - UINT8 *ram = memregion("maincpu")->base(); + uint8_t *ram = memregion("maincpu")->base(); int addr; /* the program ROMs have data lines D1 and D2 swapped. Decode them. */ diff --git a/src/mame/drivers/exidy.cpp b/src/mame/drivers/exidy.cpp index ab9b5b3aecd..e51782a85b9 100644 --- a/src/mame/drivers/exidy.cpp +++ b/src/mame/drivers/exidy.cpp @@ -159,7 +159,7 @@ Fax 1982 6502 FXL, FLA CUSTOM_INPUT_MEMBER(exidy_state::teetert_input_r) { - UINT8 dial = ioport("DIAL")->read(); + uint8_t dial = ioport("DIAL")->read(); int result = 0; result = (dial != m_last_dial) << 4; diff --git a/src/mame/drivers/exidy440.cpp b/src/mame/drivers/exidy440.cpp index c85a5b01ba5..fd78f84ec2b 100644 --- a/src/mame/drivers/exidy440.cpp +++ b/src/mame/drivers/exidy440.cpp @@ -283,7 +283,7 @@ CUSTOM_INPUT_MEMBER(exidy440_state::firq_vblank_r) CUSTOM_INPUT_MEMBER(exidy440_state::hitnmiss_button1_r) { /* button 1 shows up in two bits */ - UINT32 button1 = ioport("HITNMISS_BUTTON1")->read(); + uint32_t button1 = ioport("HITNMISS_BUTTON1")->read(); return (button1 << 1) | button1; } @@ -295,7 +295,7 @@ CUSTOM_INPUT_MEMBER(exidy440_state::hitnmiss_button1_r) * *************************************/ -void exidy440_state::exidy440_bank_select(UINT8 bank) +void exidy440_state::exidy440_bank_select(uint8_t bank) { /* for the showdown case, bank 0 is a PLD */ if (m_showdown_bank_data[0] != nullptr) @@ -390,7 +390,7 @@ READ8_MEMBER(exidy440_state::showdown_bank0_r) { /* showdown relies on different values from different memory locations */ /* yukon relies on multiple reads from the same location returning different values */ - UINT8 result = 0xff; + uint8_t result = 0xff; /* fetch the special data if a bank is selected */ if (m_showdown_bank_select >= 0) @@ -443,7 +443,7 @@ WRITE8_MEMBER(exidy440_state::topsecex_yscroll_w) void exidy440_state::machine_start() { /* the EEROM lives in the uppermost 8k of the top bank */ - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); machine().device("nvram")->set_base(&rom[0x10000 + 15 * 0x4000 + 0x2000], 0x2000); } @@ -2020,13 +2020,13 @@ DRIVER_INIT_MEMBER(exidy440_state,topsecex) DRIVER_INIT_MEMBER(exidy440_state,showdown) { - static const UINT8 bankdata0[0x18] = + static const uint8_t bankdata0[0x18] = { 0x15,0x40,0xc1,0x8d,0x4c,0x84,0x0e,0xce, 0x52,0xd0,0x99,0x48,0x80,0x09,0xc9,0x45, 0xc4,0x8e,0x5a,0x92,0x18,0xd8,0x51,0xc0 }; - static const UINT8 bankdata1[0x18] = + static const uint8_t bankdata1[0x18] = { 0x11,0x51,0xc0,0x89,0x4d,0x85,0x0c,0xcc, 0x46,0xd2,0x98,0x59,0x91,0x08,0xc8,0x41, @@ -2043,13 +2043,13 @@ DRIVER_INIT_MEMBER(exidy440_state,showdown) DRIVER_INIT_MEMBER(exidy440_state,yukon) { - static const UINT8 bankdata0[0x18] = + static const uint8_t bankdata0[0x18] = { 0x31,0x40,0xc1,0x95,0x54,0x90,0x16,0xd6, 0x62,0xe0,0xa5,0x44,0x80,0x05,0xc5,0x51, 0xd0,0x96,0x66,0xa2,0x24,0xe4,0x61,0xc0 }; - static const UINT8 bankdata1[0x18] = + static const uint8_t bankdata1[0x18] = { 0x21,0x61,0xc0,0x85,0x55,0x91,0x14,0xd4, 0x52,0xe2,0xa4,0x65,0xa1,0x04,0xc4,0x41, diff --git a/src/mame/drivers/expro02.cpp b/src/mame/drivers/expro02.cpp index cf39a1db0a7..09dc31b2941 100644 --- a/src/mame/drivers/expro02.cpp +++ b/src/mame/drivers/expro02.cpp @@ -233,12 +233,12 @@ public: required_device m_palette; required_device m_screen; - required_shared_ptr m_paletteram; - required_shared_ptr m_fg_ind8_pixram; - required_shared_ptr m_bg_rgb555_pixram; + required_shared_ptr m_paletteram; + required_shared_ptr m_fg_ind8_pixram; + required_shared_ptr m_bg_rgb555_pixram; optional_device m_view2_0; required_device m_kaneko_spr; - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; DECLARE_WRITE16_MEMBER(expro02_6295_bankswitch_w); @@ -246,9 +246,9 @@ public: virtual void machine_start() override; DECLARE_PALETTE_INIT(expro02); - UINT32 screen_update_backgrounds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_zipzap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_backgrounds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_zipzap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline); // comad @@ -274,7 +274,7 @@ PALETTE_INIT_MEMBER(expro02_state, expro02) palette.set_pen_color(2048 + i,pal5bit(i >> 5),pal5bit(i >> 10),pal5bit(i >> 0)); } -UINT32 expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // kaneko16_fill_bitmap(machine(),bitmap,cliprect); int y,x; @@ -284,11 +284,11 @@ UINT32 expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_in count = 0; for (y=0;y<256;y++) { - UINT16 *dest = &bitmap.pix16(y); + uint16_t *dest = &bitmap.pix16(y); for (x=0;x<256;x++) { - UINT16 dat = (m_bg_rgb555_pixram[count] & 0xfffe)>>1; + uint16_t dat = (m_bg_rgb555_pixram[count] & 0xfffe)>>1; dat+=2048; // never seen to test @@ -310,11 +310,11 @@ UINT32 expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_in count = 0; for (y=0;y<256;y++) { - UINT16 *dest = &bitmap.pix16(y); + uint16_t *dest = &bitmap.pix16(y); for (x=0;x<256;x++) { - UINT16 dat = (m_fg_ind8_pixram[count]); + uint16_t dat = (m_fg_ind8_pixram[count]); dat &=0x7ff; if (!(m_paletteram[(dat&0x7ff)] & 0x0001)) dest[x] = dat; @@ -341,14 +341,14 @@ UINT32 expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_in return 0; } -UINT32 expro02_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t expro02_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_update_backgrounds(screen, bitmap, cliprect); m_kaneko_spr->kaneko16_render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); return 0; } -UINT32 expro02_state::screen_update_zipzap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t expro02_state::screen_update_zipzap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_update_backgrounds(screen, bitmap, cliprect); m_kaneko_spr->bootleg_draw_sprites(bitmap,cliprect, m_spriteram, m_spriteram.bytes()); @@ -834,7 +834,7 @@ READ16_MEMBER(expro02_state::comad_timer_r) /* a kludge! */ READ8_MEMBER(expro02_state::comad_okim6295_r) { - UINT16 retvalue; + uint16_t retvalue; // retvalue = m_oki->read_status(); // doesn't work, causes lockups when girls change.. retvalue = machine().rand(); return retvalue; @@ -1775,8 +1775,8 @@ ROM_END DRIVER_INIT_MEMBER(expro02_state,expro02) { - UINT32 *src = (UINT32 *)memregion("gfx3" )->base(); - UINT32 *dst = (UINT32 *)memregion("gfx2" )->base(); + uint32_t *src = (uint32_t *)memregion("gfx3" )->base(); + uint32_t *dst = (uint32_t *)memregion("gfx2" )->base(); int x, offset; // the VIEW2 tiledata is scrambled diff --git a/src/mame/drivers/exprraid.cpp b/src/mame/drivers/exprraid.cpp index beb88a4cb1c..b04ab813bfc 100644 --- a/src/mame/drivers/exprraid.cpp +++ b/src/mame/drivers/exprraid.cpp @@ -818,7 +818,7 @@ void exprraid_state::exprraid_gfx_expand() { /* Expand the background rom so we can use regular decode routines */ - UINT8 *gfx = memregion("gfx3")->base(); + uint8_t *gfx = memregion("gfx3")->base(); int offs = 0x10000 - 0x1000; int i; @@ -837,7 +837,7 @@ void exprraid_state::exprraid_gfx_expand() DRIVER_INIT_MEMBER(exprraid_state,wexpressb) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* HACK: this set uses M6502 irq vectors but DECO CPU-16 opcodes??? */ rom[0xfff7] = rom[0xfffa]; diff --git a/src/mame/drivers/exterm.cpp b/src/mame/drivers/exterm.cpp index ec8dfdcc9fc..aa597eb1fb0 100644 --- a/src/mame/drivers/exterm.cpp +++ b/src/mame/drivers/exterm.cpp @@ -98,15 +98,15 @@ READ16_MEMBER(exterm_state::exterm_host_data_r) * *************************************/ -UINT16 exterm_state::exterm_trackball_port_r(int which, UINT16 mem_mask) +uint16_t exterm_state::exterm_trackball_port_r(int which, uint16_t mem_mask) { - UINT16 port; + uint16_t port; /* Read the fake input port */ - UINT8 trackball_pos = ioport(which ? "DIAL1" : "DIAL0")->read(); + uint8_t trackball_pos = ioport(which ? "DIAL1" : "DIAL0")->read(); /* Calculate the change from the last position. */ - UINT8 trackball_diff = m_trackball_old[which] - trackball_pos; + uint8_t trackball_diff = m_trackball_old[which] - trackball_pos; /* Store the new position for the next comparision. */ m_trackball_old[which] = trackball_pos; diff --git a/src/mame/drivers/exzisus.cpp b/src/mame/drivers/exzisus.cpp index ddb590701c7..dfa837d47f8 100644 --- a/src/mame/drivers/exzisus.cpp +++ b/src/mame/drivers/exzisus.cpp @@ -80,7 +80,7 @@ WRITE8_MEMBER(exzisus_state::cpub_reset_w) // the RAM check to work DRIVER_INIT_MEMBER(exzisus_state,exzisus) { - UINT8 *RAM = memregion("cpua")->base(); + uint8_t *RAM = memregion("cpua")->base(); /* Fix WORK RAM error */ RAM[0x67fd] = 0x18; diff --git a/src/mame/drivers/f-32.cpp b/src/mame/drivers/f-32.cpp index 3d994121908..c2cdd487bdc 100644 --- a/src/mame/drivers/f-32.cpp +++ b/src/mame/drivers/f-32.cpp @@ -45,14 +45,14 @@ public: required_device m_maincpu; /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; DECLARE_READ32_MEMBER(f32_input_port_1_r); - UINT32 screen_update_mosaicf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mosaicf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; -UINT32 mosaicf2_state::screen_update_mosaicf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mosaicf2_state::screen_update_mosaicf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { offs_t offs; diff --git a/src/mame/drivers/f1gp.cpp b/src/mame/drivers/f1gp.cpp index 3285d2c9873..dbea85bf3c5 100644 --- a/src/mame/drivers/f1gp.cpp +++ b/src/mame/drivers/f1gp.cpp @@ -139,8 +139,8 @@ WRITE16_MEMBER(f1gp_state::f1gpb_misc_w) if(old_bank != new_bank && new_bank < 5) { // oki banking - UINT8 *src = memregion("oki")->base() + 0x40000 + 0x10000 * new_bank; - UINT8 *dst = memregion("oki")->base() + 0x30000; + uint8_t *src = memregion("oki")->base() + 0x40000 + 0x10000 * new_bank; + uint8_t *dst = memregion("oki")->base() + 0x30000; memcpy(dst, src, 0x10000); old_bank = new_bank; diff --git a/src/mame/drivers/famibox.cpp b/src/mame/drivers/famibox.cpp index 8645b119da1..e46d1b26855 100644 --- a/src/mame/drivers/famibox.cpp +++ b/src/mame/drivers/famibox.cpp @@ -77,24 +77,24 @@ public: required_device m_maincpu; required_device m_ppu; - std::unique_ptr m_nt_ram; - UINT8* m_nt_page[4]; + std::unique_ptr m_nt_ram; + uint8_t* m_nt_page[4]; - UINT32 m_in_0; - UINT32 m_in_1; - UINT32 m_in_0_shift; - UINT32 m_in_1_shift; + uint32_t m_in_0; + uint32_t m_in_1; + uint32_t m_in_0_shift; + uint32_t m_in_1_shift; - UINT8 m_exception_mask; - UINT8 m_exception_cause; + uint8_t m_exception_mask; + uint8_t m_exception_cause; emu_timer* m_attract_timer; - UINT8 m_attract_timer_period; + uint8_t m_attract_timer_period; - UINT32 m_coins; + uint32_t m_coins; emu_timer* m_gameplay_timer; - UINT8 m_money_reg; + uint8_t m_money_reg; DECLARE_WRITE8_MEMBER(famibox_nt_w); DECLARE_READ8_MEMBER(famibox_nt_r); @@ -111,10 +111,10 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(famibox); - UINT32 screen_update_famibox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_famibox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(famicombox_attract_timer_callback); TIMER_CALLBACK_MEMBER(famicombox_gameplay_timer_callback); - void famicombox_bankswitch(UINT8 bank); + void famicombox_bankswitch(uint8_t bank); void famicombox_reset(); void ppu_irq(int *ppu_regs); }; @@ -222,11 +222,11 @@ READ8_MEMBER(famibox_state::famibox_IN1_r) System *******************************************************/ -void famibox_state::famicombox_bankswitch(UINT8 bank) +void famibox_state::famicombox_bankswitch(uint8_t bank) { struct { - UINT8 bank; + uint8_t bank; const char* memory_region; offs_t bank1_offset; offs_t bank2_offset; @@ -303,7 +303,7 @@ READ8_MEMBER(famibox_state::famibox_system_r) { case 0: /* device which caused exception */ { - UINT8 ret = m_exception_cause; + uint8_t ret = m_exception_cause; m_exception_cause = 0xff; return ret; } @@ -337,7 +337,7 @@ WRITE8_MEMBER(famibox_state::famibox_system_w) { if (m_attract_timer->start() != attotime::never) { - m_attract_timer->adjust(attotime::from_seconds((INT32)((double)1.0/6.8274*m_attract_timer_period)), 0, attotime::never); + m_attract_timer->adjust(attotime::from_seconds((int32_t)((double)1.0/6.8274*m_attract_timer_period)), 0, attotime::never); } } break; @@ -503,7 +503,7 @@ void famibox_state::video_start() { } -UINT32 famibox_state::screen_update_famibox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t famibox_state::screen_update_famibox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* render the ppu */ m_ppu->render(bitmap, 0, 0, 0, 0); @@ -521,7 +521,7 @@ void famibox_state::machine_reset() void famibox_state::machine_start() { - m_nt_ram = std::make_unique(0x1000); + m_nt_ram = std::make_unique(0x1000); m_nt_page[0] = m_nt_ram.get(); m_nt_page[1] = m_nt_ram.get() + 0x400; m_nt_page[2] = m_nt_ram.get() + 0x800; diff --git a/src/mame/drivers/fantland.cpp b/src/mame/drivers/fantland.cpp index 552fe5a4869..16fedf498ee 100644 --- a/src/mame/drivers/fantland.cpp +++ b/src/mame/drivers/fantland.cpp @@ -93,19 +93,19 @@ WRITE16_MEMBER(fantland_state::fantland_soundlatch_16_w) READ16_MEMBER(fantland_state::spriteram_16_r) { - UINT8 *spriteram = m_spriteram; + uint8_t *spriteram = m_spriteram; return spriteram[2 * offset + 0] | (spriteram[2 * offset + 1] << 8); } READ16_MEMBER(fantland_state::spriteram2_16_r) { - UINT8 *spriteram_2 = m_spriteram2; + uint8_t *spriteram_2 = m_spriteram2; return spriteram_2[2 * offset + 0] | (spriteram_2[2 * offset + 1] << 8); } WRITE16_MEMBER(fantland_state::spriteram_16_w) { - UINT8 *spriteram = m_spriteram; + uint8_t *spriteram = m_spriteram; if (ACCESSING_BITS_0_7) spriteram[2 * offset + 0] = data; if (ACCESSING_BITS_8_15) @@ -114,7 +114,7 @@ WRITE16_MEMBER(fantland_state::spriteram_16_w) WRITE16_MEMBER(fantland_state::spriteram2_16_w) { - UINT8 *spriteram_2 = m_spriteram2; + uint8_t *spriteram_2 = m_spriteram2; if (ACCESSING_BITS_0_7) spriteram_2[2 * offset + 0] = data; if (ACCESSING_BITS_8_15) @@ -360,7 +360,7 @@ WRITE8_MEMBER(fantland_state::borntofi_msm5205_w) void fantland_state::borntofi_adpcm_int( msm5205_device *device, int voice ) { - UINT8 *rom; + uint8_t *rom; size_t len; int start, stop; diff --git a/src/mame/drivers/fanucspmg.cpp b/src/mame/drivers/fanucspmg.cpp index 5c3a67e6b91..4918eb88a84 100644 --- a/src/mame/drivers/fanucspmg.cpp +++ b/src/mame/drivers/fanucspmg.cpp @@ -592,7 +592,7 @@ public: required_device m_dmac; required_device m_crtc; required_device m_fdc; - required_shared_ptr m_shared; + required_shared_ptr m_shared; required_memory_region m_chargen; DECLARE_FLOPPY_FORMATS( floppy_formats ); @@ -627,16 +627,16 @@ public: DECLARE_DRIVER_INIT(fanucspmg); - UINT8 m_vram[24576]; - UINT8 m_video_ctrl; + uint8_t m_vram[24576]; + uint8_t m_video_ctrl; private: virtual void machine_reset() override; - INT32 m_vram_bank; - UINT8 m_vbl_ctrl; - UINT8 m_keyboard_row; - UINT8 m_vbl_stat; - UINT8 m_dma_page; + int32_t m_vram_bank; + uint8_t m_vbl_ctrl; + uint8_t m_keyboard_row; + uint8_t m_vbl_stat; + uint8_t m_dma_page; }; DRIVER_INIT_MEMBER(fanucspmg_state, fanucspmg) @@ -851,23 +851,23 @@ WRITE8_MEMBER(fanucspmg_state::memory_write_byte) MC6845_UPDATE_ROW( fanucspmg_state::crtc_update_row ) { - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); int i; - UINT8 *chargen = m_chargen->base(); + uint8_t *chargen = m_chargen->base(); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ma + i ); + uint16_t offset = ( ma + i ); if (m_video_ctrl & 0x02) { if (offset <= 0x5ff) { - UINT8 chr = m_vram[offset + 0x600]; - UINT8 attr = m_vram[offset]; - UINT8 data = chargen[ chr + (ra * 256) ]; - UINT32 fg = 0; - UINT32 bg = 0; + uint8_t chr = m_vram[offset + 0x600]; + uint8_t attr = m_vram[offset]; + uint8_t data = chargen[ chr + (ra * 256) ]; + uint32_t fg = 0; + uint32_t bg = 0; if (attr & 0x20) fg |= 0xff0000; if (attr & 0x40) fg |= 0x00ff00; @@ -899,23 +899,23 @@ MC6845_UPDATE_ROW( fanucspmg_state::crtc_update_row ) MC6845_UPDATE_ROW( fanucspmg_state::crtc_update_row_mono ) { - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); int i; - UINT8 *chargen = m_chargen->base(); + uint8_t *chargen = m_chargen->base(); for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ( ma + i ); + uint16_t offset = ( ma + i ); if (m_video_ctrl & 0x02) { if (offset <= 0x5ff) { - UINT8 chr = m_vram[offset + 0x600]; -// UINT8 attr = m_vram[offset]; - UINT8 data = chargen[ chr + (ra * 256) ]; - UINT32 fg = 0xff00; - UINT32 bg = 0; + uint8_t chr = m_vram[offset + 0x600]; +// uint8_t attr = m_vram[offset]; + uint8_t data = chargen[ chr + (ra * 256) ]; + uint32_t fg = 0xff00; + uint32_t bg = 0; *p++ = ( data & 0x01 ) ? fg : bg; *p++ = ( data & 0x02 ) ? fg : bg; diff --git a/src/mame/drivers/fastfred.cpp b/src/mame/drivers/fastfred.cpp index 88442b52d86..c0e59a2f237 100644 --- a/src/mame/drivers/fastfred.cpp +++ b/src/mame/drivers/fastfred.cpp @@ -152,8 +152,8 @@ WRITE8_MEMBER(fastfred_state::imago_sprites_bank_w) WRITE8_MEMBER(fastfred_state::imago_sprites_dma_w) { - UINT8 *rom = (UINT8 *)memregion("gfx2")->base(); - UINT8 sprites_data; + uint8_t *rom = (uint8_t *)memregion("gfx2")->base(); + uint8_t sprites_data; sprites_data = rom[m_imago_sprites_address + 0x2000*0 + m_imago_sprites_bank * 0x1000]; m_imago_sprites[offset + 0x800*0] = sprites_data; diff --git a/src/mame/drivers/fastinvaders.cpp b/src/mame/drivers/fastinvaders.cpp index 46ed0515414..74970ccfabf 100644 --- a/src/mame/drivers/fastinvaders.cpp +++ b/src/mame/drivers/fastinvaders.cpp @@ -35,38 +35,38 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; optional_device m_crtc8275; optional_device m_crtc6845; required_device m_pic8259; required_device m_dma8257; - UINT8 m_rest55; - UINT8 m_rest65; - UINT8 m_trap; - UINT8 m_ar; - UINT8 m_av; - UINT8 m_prom[256]; - UINT8 m_riga_sup; - UINT8 m_scudi; - UINT8 m_cannone; - UINT8 m_riga_inf; - - UINT8 m_irq0; - UINT8 m_irq1; - UINT8 m_irq2; - UINT8 m_irq3; - UINT8 m_irq4; - UINT8 m_irq5; - UINT8 m_irq6; - UINT8 m_irq7; - - - UINT8 m_start2_value; - UINT8 m_dma1; - UINT8 m_io_40; - UINT8 m_hsync; + uint8_t m_rest55; + uint8_t m_rest65; + uint8_t m_trap; + uint8_t m_ar; + uint8_t m_av; + uint8_t m_prom[256]; + uint8_t m_riga_sup; + uint8_t m_scudi; + uint8_t m_cannone; + uint8_t m_riga_inf; + + uint8_t m_irq0; + uint8_t m_irq1; + uint8_t m_irq2; + uint8_t m_irq3; + uint8_t m_irq4; + uint8_t m_irq5; + uint8_t m_irq6; + uint8_t m_irq7; + + + uint8_t m_start2_value; + uint8_t m_dma1; + uint8_t m_io_40; + uint8_t m_hsync; DECLARE_WRITE8_MEMBER(io_40_w); @@ -106,7 +106,7 @@ public: DECLARE_WRITE8_MEMBER(memory_write_byte); DECLARE_WRITE8_MEMBER(dark_1_clr); DECLARE_WRITE8_MEMBER(dark_2_clr); - 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); DECLARE_DRIVER_INIT(fi6845); @@ -205,7 +205,7 @@ void fastinvaders_state::video_start() { } -UINT32 fastinvaders_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t fastinvaders_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); @@ -217,7 +217,7 @@ UINT32 fastinvaders_state::screen_update(screen_device &screen, bitmap_ind16 &bi { for (int x = 0;x < 40;x++) { - UINT8 tile = m_videoram[count]; + uint8_t tile = m_videoram[count]; gfx->transpen( @@ -253,7 +253,7 @@ logerror("Audio write &02X\n",data); READ8_MEMBER(fastinvaders_state::io_60_r) { - UINT8 tmp=0; + uint8_t tmp=0; //0x60 ds6 input bit 0 DX or SX // bit 1 DX or SX // bit 2-7 dip switch @@ -351,7 +351,7 @@ WRITE8_MEMBER(fastinvaders_state::io_f0_w) READ_LINE_MEMBER(fastinvaders_state::sid_read) { - UINT8 tmp= m_start2_value ? ASSERT_LINE : CLEAR_LINE; + uint8_t tmp= m_start2_value ? ASSERT_LINE : CLEAR_LINE; m_start2_value=0; return tmp; } @@ -693,7 +693,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(fastinvaders_state, fi6845) { -const UINT8 *prom = memregion("prom")->base(); +const uint8_t *prom = memregion("prom")->base(); int i; for (i=0;i<256;i++){ m_prom[i]=prom[i]; diff --git a/src/mame/drivers/fastlane.cpp b/src/mame/drivers/fastlane.cpp index a8358444eb3..a0a2cd7bc45 100644 --- a/src/mame/drivers/fastlane.cpp +++ b/src/mame/drivers/fastlane.cpp @@ -190,7 +190,7 @@ WRITE8_MEMBER(fastlane_state::volume_callback1) void fastlane_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000); } diff --git a/src/mame/drivers/fc100.cpp b/src/mame/drivers/fc100.cpp index cacf5042f5b..ca1cc9039f1 100644 --- a/src/mame/drivers/fc100.cpp +++ b/src/mame/drivers/fc100.cpp @@ -75,7 +75,7 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_p); TIMER_DEVICE_CALLBACK_MEMBER(timer_k); - UINT8 *m_p_chargen; + uint8_t *m_p_chargen; MC6847_GET_CHARROM_MEMBER(get_char_rom) { @@ -86,23 +86,23 @@ private: virtual void machine_reset() override; // graphics signals - UINT8 m_ag; - UINT8 m_gm2; - UINT8 m_gm1; - UINT8 m_gm0; - UINT8 m_as; - UINT8 m_css; - UINT8 m_intext; - UINT8 m_inv; - UINT8 m_cass_data[4]; + uint8_t m_ag; + uint8_t m_gm2; + uint8_t m_gm1; + uint8_t m_gm0; + uint8_t m_as; + uint8_t m_css; + uint8_t m_intext; + uint8_t m_inv; + uint8_t m_cass_data[4]; bool m_cass_state; bool m_cassold; - UINT8 m_key_pressed; + uint8_t m_key_pressed; bool m_banksw_unlocked; required_device m_maincpu; required_device m_vdg; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_device m_cass; required_device m_cart; required_device m_uart; @@ -290,7 +290,7 @@ READ8_MEMBER( fc100_state::port00_r ) TIMER_DEVICE_CALLBACK_MEMBER( fc100_state::timer_k) { /* scan the keyboard */ - UINT8 i; + uint8_t i; for (i = 0; i < 16; i++) { @@ -359,8 +359,8 @@ READ8_MEMBER( fc100_state::mc6847_videoram_r ) } // Standard text - UINT8 data = m_p_videoram[offset]; - UINT8 attr = m_p_videoram[offset+0x200]; + uint8_t data = m_p_videoram[offset]; + uint8_t attr = m_p_videoram[offset+0x200]; // unknown bits 1,2,4,7 m_vdg->inv_w( BIT( attr, 0 )); @@ -441,7 +441,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( fc100_state::timer_p) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -501,8 +501,8 @@ WRITE8_MEMBER( fc100_state::port70_w ) DRIVER_INIT_MEMBER( fc100_state, fc100 ) { - UINT8 *ram = memregion("ram")->base(); - UINT8 *cgen = memregion("chargen")->base()+0x800; + uint8_t *ram = memregion("ram")->base(); + uint8_t *cgen = memregion("chargen")->base()+0x800; membank("bankr")->configure_entry(0, &cgen[0]); membank("bankw")->configure_entry(0, &ram[0]); diff --git a/src/mame/drivers/fccpu30.cpp b/src/mame/drivers/fccpu30.cpp index e811628ec57..833ce38bd73 100644 --- a/src/mame/drivers/fccpu30.cpp +++ b/src/mame/drivers/fccpu30.cpp @@ -234,7 +234,7 @@ fccpu30_state(const machine_config &mconfig, device_type type, const char *tag) /* Interrupt support */ // IRQ_CALLBACK_MEMBER(maincpu_iack_callback); DECLARE_WRITE_LINE_MEMBER(fga_irq_callback); - UINT8 fga_irq_state; + uint8_t fga_irq_state; // int fga_irq_vector; int fga_irq_level; @@ -272,8 +272,8 @@ private: void update_irq_to_maincpu(); // Pointer to System ROMs needed by bootvect_r and masking RAM buffer for post reset accesses - UINT32 *m_sysrom; - UINT32 m_sysram[2]; + uint32_t *m_sysrom; + uint32_t m_sysram[2]; }; static ADDRESS_MAP_START (fccpu30_mem, AS_PROGRAM, 32, fccpu30_state) @@ -307,7 +307,7 @@ void fccpu30_state::machine_start () save_pointer (NAME (m_sysram), sizeof(m_sysram)); /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */ - m_sysrom = (UINT32*)(memregion ("roms")->base () + 0x800000); + m_sysrom = (uint32_t*)(memregion ("roms")->base () + 0x800000); } void fccpu30_state::machine_reset () @@ -316,7 +316,7 @@ void fccpu30_state::machine_reset () /* Reset pointer to bootvector in ROM for bootvector handler bootvect_r */ if (m_sysrom == &m_sysram[0]) /* Condition needed because memory map is not setup first time */ - m_sysrom = (UINT32*)(memregion ("roms")->base () + 0x800000); + m_sysrom = (uint32_t*)(memregion ("roms")->base () + 0x800000); } /* Boot vector handler, the PCB hardwires the first 8 bytes from 0xff800000 to 0x0 at reset*/ @@ -459,7 +459,7 @@ WRITE8_MEMBER (fccpu30_state::pit2c_w){ /* Dummy VME access methods until the VME bus device is ready for use */ READ16_MEMBER (fccpu30_state::vme_a24_r){ LOG (logerror ("vme_a24_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (fccpu30_state::vme_a24_w){ @@ -468,7 +468,7 @@ WRITE16_MEMBER (fccpu30_state::vme_a24_w){ READ16_MEMBER (fccpu30_state::vme_a16_r){ LOG (logerror ("vme_16_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (fccpu30_state::vme_a16_w){ @@ -714,30 +714,30 @@ ROM_END * Repeated setup for channel B * * FGA setup -void fga002_device::do_fga002reg_icrtim0_w(UINT8)(00) -void fga002_device::do_fga002reg_ctl3_w(UINT8)(0c) -void fga002_device::do_fga002reg_icrlocal0_w(UINT8)(00) -void fga002_device::do_fga002reg_icrlocal1_w(UINT8)(00) -void fga002_device::do_fga002reg_icrlocal2_w(UINT8)(00) -void fga002_device::do_fga002reg_icrlocal3_w(UINT8)(00) -void fga002_device::do_fga002reg_icrlocal4_w(UINT8)(00) -void fga002_device::do_fga002reg_icrlocal5_w(UINT8)(00) -void fga002_device::do_fga002reg_icrlocal6_w(UINT8)(00) -void fga002_device::do_fga002reg_icrlocal7_w(UINT8)(00) +void fga002_device::do_fga002reg_icrtim0_w(uint8_t)(00) +void fga002_device::do_fga002reg_ctl3_w(uint8_t)(0c) +void fga002_device::do_fga002reg_icrlocal0_w(uint8_t)(00) +void fga002_device::do_fga002reg_icrlocal1_w(uint8_t)(00) +void fga002_device::do_fga002reg_icrlocal2_w(uint8_t)(00) +void fga002_device::do_fga002reg_icrlocal3_w(uint8_t)(00) +void fga002_device::do_fga002reg_icrlocal4_w(uint8_t)(00) +void fga002_device::do_fga002reg_icrlocal5_w(uint8_t)(00) +void fga002_device::do_fga002reg_icrlocal6_w(uint8_t)(00) +void fga002_device::do_fga002reg_icrlocal7_w(uint8_t)(00) * A Reg 10 <- 20 -UINT8 duscc_channel::do_dusccreg_rxfifo_r() +uint8_t duscc_channel::do_dusccreg_rxfifo_r() - RX rp:0 wp:1 sz:4 - RX reading out data:6e 'n' -UINT8 duscc_channel::do_dusccreg_rxfifo_r() +uint8_t duscc_channel::do_dusccreg_rxfifo_r() - RX rp:1 wp:2 sz:4 - RX reading out data:6e 'n' * A Reg 10 <- 6e * A Reg 10 <- 0d * A Reg 10 <- 0a -void fga002_device::do_fga002reg_icrlocal2_w(UINT8)(4d) -void fga002_device::do_fga002reg_icrlocal4_w(UINT8)(1c) +void fga002_device::do_fga002reg_icrlocal2_w(uint8_t)(4d) +void fga002_device::do_fga002reg_icrlocal4_w(uint8_t)(1c) * A Reg 0f <- 00 * A Reg 0f <- 40 * A Reg 00 <- 07 @@ -749,11 +749,11 @@ void fga002_device::do_fga002reg_icrlocal4_w(UINT8)(1c) * A Reg 07 <- 2d * A Reg 05 <- 3d * A Reg 1c <- 10 -void duscc_channel::do_dusccreg_ier_w(UINT8)(10) +void duscc_channel::do_dusccreg_ier_w(uint8_t)(10) - RXRDY interrupts enabled :duscc void duscc_device::check_interrupts()() :duscc virtual int duscc_device::z80daisy_irq_state() A:[00][00][00][00] B:[00][00][00][00] Interrupt State 00 -void fga002_device::trigger_interrupt(UINT8)(34) +void fga002_device::trigger_interrupt(uint8_t)(34) Interrupt Level 4, caused by ICR 1c with vector 34 void fga002_device::check_interrupts()() :fga002 virtual int fga002_device::z80daisy_irq_state() Level 0-7:[00][00] [00][00] [01][00] [00][00] diff --git a/src/mame/drivers/fcisio.cpp b/src/mame/drivers/fcisio.cpp index 6b068f4c9e7..150eba2fe0c 100644 --- a/src/mame/drivers/fcisio.cpp +++ b/src/mame/drivers/fcisio.cpp @@ -105,7 +105,7 @@ private: required_device m_pit; // Pointer to System ROMs needed by bootvect_r - UINT16 *m_sysrom; + uint16_t *m_sysrom; }; static ADDRESS_MAP_START (fcisio1_mem, AS_PROGRAM, 16, fcisio1_state) @@ -127,7 +127,7 @@ void fcisio1_state::machine_start () LOG (("machine_start\n")); /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */ - m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0xf00000); + m_sysrom = (uint16_t*)(memregion ("maincpu")->base () + 0xf00000); } /* Boot vector handler, the PCB hardwires the first 8 bytes from 0x80000 to 0x0 */ @@ -141,7 +141,7 @@ READ8_MEMBER (fcisio1_state::not_implemented_r){ logerror(TODO); printf(TODO); } - return (UINT8) 0; + return (uint8_t) 0; } WRITE8_MEMBER (fcisio1_state::not_implemented_w){ @@ -155,7 +155,7 @@ WRITE8_MEMBER (fcisio1_state::not_implemented_w){ // TODO: Get a manual to understand the config options for real READ8_MEMBER (fcisio1_state::config_rd){ - UINT8 ret = 0; + uint8_t ret = 0; LOG(("%s\n", FUNCNAME)); // Port B bit #7, 0x80 Self test bit, choose either of these two lines diff --git a/src/mame/drivers/fcombat.cpp b/src/mame/drivers/fcombat.cpp index 43f8afc5682..b711d06b6af 100644 --- a/src/mame/drivers/fcombat.cpp +++ b/src/mame/drivers/fcombat.cpp @@ -327,11 +327,11 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(fcombat_state,fcombat) { - UINT32 oldaddr, newaddr, length; - UINT8 *src, *dst; + uint32_t oldaddr, newaddr, length; + uint8_t *src, *dst; /* allocate some temporary space */ - std::vector temp(0x10000); + std::vector temp(0x10000); /* make a temporary copy of the character data */ src = &temp[0]; diff --git a/src/mame/drivers/fcrash.cpp b/src/mame/drivers/fcrash.cpp index ac5f9eafee4..d24b4aa496d 100644 --- a/src/mame/drivers/fcrash.cpp +++ b/src/mame/drivers/fcrash.cpp @@ -490,8 +490,8 @@ void cps_state::fcrash_render_sprites( screen_device &screen, bitmap_ind16 &bitm int base = m_sprite_base / 2; int num_sprites = m_gfxdecode->gfx(2)->elements(); int last_sprite_offset = 0x1ffc; - UINT16 *sprite_ram = m_gfxram; - UINT16 tileno,flipx,flipy,colour,xpos,ypos; + uint16_t *sprite_ram = m_gfxram; + uint16_t tileno,flipx,flipy,colour,xpos,ypos; /* if we have separate sprite ram, use it */ if (m_bootleg_sprite_ram) sprite_ram = m_bootleg_sprite_ram.get(); @@ -577,7 +577,7 @@ void cps_state::fcrash_build_palette() } } -UINT32 cps_state::screen_update_fcrash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cps_state::screen_update_fcrash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layercontrol, l0, l1, l2, l3; int videocontrol = m_cps_a_regs[0x22 / 2]; @@ -1421,7 +1421,7 @@ INPUT_PORTS_END MACHINE_START_MEMBER(cps_state,fcrash) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); @@ -1484,7 +1484,7 @@ MACHINE_START_MEMBER(cps_state, cawingbl) MACHINE_START_MEMBER(cps_state, sf2mdt) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); @@ -1508,7 +1508,7 @@ MACHINE_START_MEMBER(cps_state, sf2mdt) MACHINE_START_MEMBER(cps_state, knightsb) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x4000); @@ -1527,7 +1527,7 @@ MACHINE_START_MEMBER(cps_state, knightsb) MACHINE_START_MEMBER(cps_state, sf2m1) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); @@ -1937,7 +1937,7 @@ DRIVER_INIT_MEMBER(cps_state, kodb) /* the original game alternates between 2 sprite ram areas to achieve flashing sprites - the bootleg doesn't do the write to the register to achieve this mapping both sprite ram areas to the same bootleg sprite ram - similar to how sf2mdt works */ - m_bootleg_sprite_ram = std::make_unique(0x2000); + m_bootleg_sprite_ram = std::make_unique(0x2000); m_maincpu->space(AS_PROGRAM).install_ram(0x900000, 0x903fff, m_bootleg_sprite_ram.get()); m_maincpu->space(AS_PROGRAM).install_ram(0x904000, 0x907fff, m_bootleg_sprite_ram.get()); /* both of these need to be mapped */ @@ -2241,7 +2241,7 @@ ROM_END DRIVER_INIT_MEMBER(cps_state, dinopic) { - m_bootleg_sprite_ram = std::make_unique(0x2000); + m_bootleg_sprite_ram = std::make_unique(0x2000); m_maincpu->space(AS_PROGRAM).install_ram(0x990000, 0x993fff, m_bootleg_sprite_ram.get()); DRIVER_INIT_CALL(cps1); } @@ -2518,7 +2518,7 @@ ROM_END DRIVER_INIT_MEMBER(cps_state, punipic) { - UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); mem16[0x5A8/2] = 0x4E71; // set data pointers mem16[0x4DF0/2] = 0x33ED; mem16[0x4DF2/2] = 0xDB2E; @@ -2531,7 +2531,7 @@ DRIVER_INIT_MEMBER(cps_state, punipic) DRIVER_INIT_MEMBER(cps_state, punipic3) { - UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); mem16[0x5A6/2] = 0x4E71; // set data pointers mem16[0x5A8/2] = 0x4E71; @@ -2608,7 +2608,7 @@ ROM_END DRIVER_INIT_MEMBER(cps_state, sf2m1) { - UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); mem16[0x64E/2] = 0x6046; // fix priorities DRIVER_INIT_CALL(dinopic); @@ -2789,9 +2789,9 @@ ROM_END DRIVER_INIT_MEMBER(cps_state, sf2mdt) { int i; - UINT32 gfx_size = memregion( "gfx" )->bytes(); - UINT8 *rom = memregion( "gfx" )->base(); - UINT8 tmp; + uint32_t gfx_size = memregion( "gfx" )->bytes(); + uint8_t *rom = memregion( "gfx" )->base(); + uint8_t tmp; for( i = 0; i < gfx_size; i += 8 ) { @@ -2812,9 +2812,9 @@ DRIVER_INIT_MEMBER(cps_state, sf2mdt) DRIVER_INIT_MEMBER(cps_state, sf2mdtb) { int i; - UINT32 gfx_size = memregion( "gfx" )->bytes(); - UINT8 *rom = memregion( "gfx" )->base(); - UINT8 tmp; + uint32_t gfx_size = memregion( "gfx" )->bytes(); + uint8_t *rom = memregion( "gfx" )->base(); + uint8_t tmp; for( i = 0; i < gfx_size; i += 8 ) { @@ -2827,7 +2827,7 @@ DRIVER_INIT_MEMBER(cps_state, sf2mdtb) } /* bootleg sprite ram */ - m_bootleg_sprite_ram = std::make_unique(0x2000); + m_bootleg_sprite_ram = std::make_unique(0x2000); m_maincpu->space(AS_PROGRAM).install_ram(0x700000, 0x703fff, m_bootleg_sprite_ram.get()); m_maincpu->space(AS_PROGRAM).install_ram(0x704000, 0x707fff, m_bootleg_sprite_ram.get()); /* both of these need to be mapped */ @@ -2838,11 +2838,11 @@ DRIVER_INIT_MEMBER(cps_state, sf2mdtb) DRIVER_INIT_MEMBER(cps_state, sf2mdta) { /* bootleg sprite ram */ - m_bootleg_sprite_ram = std::make_unique(0x2000); + m_bootleg_sprite_ram = std::make_unique(0x2000); m_maincpu->space(AS_PROGRAM).install_ram(0x700000, 0x703fff, m_bootleg_sprite_ram.get()); m_maincpu->space(AS_PROGRAM).install_ram(0x704000, 0x707fff, m_bootleg_sprite_ram.get()); /* both of these need to be mapped - see the "Magic Delta Turbo" text on the title screen */ - m_bootleg_work_ram = std::make_unique(0x8000); + m_bootleg_work_ram = std::make_unique(0x8000); m_maincpu->space(AS_PROGRAM).install_ram(0xfc0000, 0xfcffff, m_bootleg_work_ram.get()); /* this has moved */ DRIVER_INIT_CALL(cps1); @@ -2851,7 +2851,7 @@ DRIVER_INIT_MEMBER(cps_state, sf2mdta) DRIVER_INIT_MEMBER(cps_state, sf2b) { /* bootleg sprite ram */ - m_bootleg_sprite_ram = std::make_unique(0x2000); + m_bootleg_sprite_ram = std::make_unique(0x2000); m_maincpu->space(AS_PROGRAM).install_ram(0x700000, 0x703fff, m_bootleg_sprite_ram.get()); m_maincpu->space(AS_PROGRAM).install_ram(0x704000, 0x707fff, m_bootleg_sprite_ram.get()); diff --git a/src/mame/drivers/fcscsi.cpp b/src/mame/drivers/fcscsi.cpp index 41f6d745b5e..dabad9ab965 100644 --- a/src/mame/drivers/fcscsi.cpp +++ b/src/mame/drivers/fcscsi.cpp @@ -104,8 +104,8 @@ fcscsi1_state(const machine_config &mconfig, device_type type, const char *tag) DECLARE_READ8_MEMBER (not_implemented_r); DECLARE_WRITE8_MEMBER (not_implemented_w); - UINT8 fdc_irq_state; - UINT8 dmac_irq_state; + uint8_t fdc_irq_state; + uint8_t dmac_irq_state; int dmac_irq_vector; virtual void machine_start () override; @@ -120,10 +120,10 @@ private: required_device m_dmac; - UINT8 m_tcr; + uint8_t m_tcr; // Pointer to System ROMs needed by bootvect_r - UINT16 *m_sysrom; + uint16_t *m_sysrom; }; static ADDRESS_MAP_START (fcscsi1_mem, AS_PROGRAM, 16, fcscsi1_state) @@ -151,7 +151,7 @@ void fcscsi1_state::machine_start () LOG (("machine_start\n")); /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */ - m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0xe00000); + m_sysrom = (uint16_t*)(memregion ("maincpu")->base () + 0xe00000); } @@ -174,7 +174,7 @@ Bit #: 7 6 5 4 3 2 1 0 READ8_MEMBER (fcscsi1_state::tcr_r){ LOG(("%s\n", FUNCNAME)); - return (UINT8) m_tcr; + return (uint8_t) m_tcr; } WRITE8_MEMBER (fcscsi1_state::tcr_w){ @@ -243,7 +243,7 @@ READ8_MEMBER (fcscsi1_state::not_implemented_r){ logerror(TODO); printf(TODO); } - return (UINT8) 0; + return (uint8_t) 0; } WRITE8_MEMBER (fcscsi1_state::not_implemented_w){ diff --git a/src/mame/drivers/feversoc.cpp b/src/mame/drivers/feversoc.cpp index b217c18b8e0..db15bca192b 100644 --- a/src/mame/drivers/feversoc.cpp +++ b/src/mame/drivers/feversoc.cpp @@ -90,15 +90,15 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_mainram1; - required_shared_ptr m_mainram2; - required_shared_ptr m_nvram; - required_shared_ptr m_spriteram; + required_shared_ptr m_mainram1; + required_shared_ptr m_mainram2; + required_shared_ptr m_nvram; + required_shared_ptr m_spriteram; DECLARE_READ32_MEMBER(in0_r); DECLARE_WRITE32_MEMBER(output_w); DECLARE_DRIVER_INIT(feversoc); virtual void video_start() override; - UINT32 screen_update_feversoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_feversoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(feversoc_irq); required_device m_maincpu; required_device m_oki; @@ -115,9 +115,9 @@ void feversoc_state::video_start() { } -UINT32 feversoc_state::screen_update_feversoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t feversoc_state::screen_update_feversoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT32 *spriteram32 = m_spriteram; + uint32_t *spriteram32 = m_spriteram; int offs,spr_offs,colour,sx,sy,h,w,dx,dy; bitmap.fill(m_palette->pen(0), cliprect); //black pen @@ -148,8 +148,8 @@ UINT32 feversoc_state::screen_update_feversoc(screen_device &screen, bitmap_ind1 READ32_MEMBER(feversoc_state::in0_r) { - UINT32 io0 = (ioport("IN1")->read()&0xffff) << 16; - UINT32 io1 = (ioport("IN0")->read()&0xffff) << 0; + uint32_t io0 = (ioport("IN1")->read()&0xffff) << 16; + uint32_t io1 = (ioport("IN0")->read()&0xffff) << 0; return io0 | io1; } @@ -321,7 +321,7 @@ ROM_END DRIVER_INIT_MEMBER(feversoc_state,feversoc) { - UINT32 *rom = (UINT32 *)memregion("maincpu")->base(); + uint32_t *rom = (uint32_t *)memregion("maincpu")->base(); seibuspi_rise11_sprite_decrypt_feversoc(memregion("gfx1")->base(), 0x200000); diff --git a/src/mame/drivers/fgoal.cpp b/src/mame/drivers/fgoal.cpp index 3e6f16a9410..5cff5017581 100644 --- a/src/mame/drivers/fgoal.cpp +++ b/src/mame/drivers/fgoal.cpp @@ -48,14 +48,14 @@ int fgoal_state::intensity(int bits) PALETTE_INIT_MEMBER(fgoal_state, fgoal) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; /* for B/W screens PCB can be jumpered to use lower half of PROM */ for (i = 0; i < 128; i++) { - UINT8 color = color_prom[0x80 | i] & 63; + uint8_t color = color_prom[0x80 | i] & 63; palette.set_pen_color(i, intensity(color >> 4), intensity(color >> 2), intensity(color >> 0)); } @@ -118,7 +118,7 @@ READ8_MEMBER(fgoal_state::analog_r) CUSTOM_INPUT_MEMBER(fgoal_state::_80_r) { - UINT8 ret = (m_screen->vpos() & 0x80) ? 1 : 0; + uint8_t ret = (m_screen->vpos() & 0x80) ? 1 : 0; return ret; } @@ -169,14 +169,14 @@ READ8_MEMBER(fgoal_state::address_lo_r) READ8_MEMBER(fgoal_state::shifter_r) { - UINT8 v = m_mb14241->shift_result_r(space, 0); + uint8_t v = m_mb14241->shift_result_r(space, 0); return BITSWAP8(v, 7, 6, 5, 4, 3, 2, 1, 0); } READ8_MEMBER(fgoal_state::shifter_reverse_r) { - UINT8 v = m_mb14241->shift_result_r(space, 0); + uint8_t v = m_mb14241->shift_result_r(space, 0); return BITSWAP8(v, 0, 1, 2, 3, 4, 5, 6, 7); } @@ -293,7 +293,7 @@ static INPUT_PORTS_START( fgoal ) PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(1, 254) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE PORT_PLAYER(2) INPUT_PORTS_END -static const UINT32 gfxlayout_xoffset[64] = +static const uint32_t gfxlayout_xoffset[64] = { 0x000, 0x008, 0x010, 0x018, 0x020, 0x028, 0x030, 0x038, 0x040, 0x048, 0x050, 0x058, 0x060, 0x068, 0x070, 0x078, @@ -305,7 +305,7 @@ static const UINT32 gfxlayout_xoffset[64] = 0x1c0, 0x1c8, 0x1d0, 0x1d8, 0x1e0, 0x1e8, 0x1f0, 0x1f8 }; -static const UINT32 gfxlayout_yoffset[64] = +static const uint32_t gfxlayout_yoffset[64] = { 0x0000, 0x0200, 0x0400, 0x0600, 0x0800, 0x0a00, 0x0c00, 0x0e00, 0x1000, 0x1200, 0x1400, 0x1600, 0x1800, 0x1a00, 0x1c00, 0x1e00, diff --git a/src/mame/drivers/fidel6502.cpp b/src/mame/drivers/fidel6502.cpp index f702d3ef68b..01ea0e4b60a 100644 --- a/src/mame/drivers/fidel6502.cpp +++ b/src/mame/drivers/fidel6502.cpp @@ -525,7 +525,7 @@ WRITE8_MEMBER(fidel6502_state::csc_pia0_pb_w) READ8_MEMBER(fidel6502_state::csc_pia0_pb_r) { // d2: printer? - UINT8 data = 0x04; + uint8_t data = 0x04; // d3: TSI BUSY line if (m_speech->busy_r()) @@ -669,7 +669,7 @@ WRITE8_MEMBER(fidel6502_state::eas_ppi_portc_w) READ8_MEMBER(fidel6502_state::eas_ppi_portb_r) { // d0: printer? white wire from LED pcb - UINT8 data = 1; + uint8_t data = 1; // d1: TSI BUSY line data |= (m_speech->busy_r()) ? 2 : 0; @@ -702,7 +702,7 @@ WRITE8_MEMBER(fidel6502_state::sc9_control_w) { // d0-d3: 74245 P0-P3 // 74245 Q0-Q8: input mux, led select - UINT16 sel = 1 << (data & 0xf) & 0x3ff; + uint16_t sel = 1 << (data & 0xf) & 0x3ff; m_inp_mux = sel & 0x1ff; sc9_prepare_display(); @@ -738,7 +738,7 @@ WRITE8_MEMBER(fidel6502_state::sc12_control_w) { // d0-d3: 7442 a0-a3 // 7442 0-8: led data, input mux - UINT16 sel = 1 << (data & 0xf) & 0x3ff; + uint16_t sel = 1 << (data & 0xf) & 0x3ff; m_inp_mux = sel & 0x1ff; // 7442 9: speaker out @@ -793,24 +793,24 @@ READ8_MEMBER(fidel6502_state::fexcelv_speech_r) WRITE8_MEMBER(fidel6502_state::fexcel_ttl_w) { // a0-a2,d0: 74259(1) - UINT8 mask = 1 << offset; + uint8_t mask = 1 << offset; m_led_select = (m_led_select & ~mask) | ((data & 1) ? mask : 0); // 74259 Q0-Q3: 7442 a0-a3 // 7442 0-8: led data, input mux - UINT16 sel = 1 << (m_led_select & 0xf) & 0x3ff; - UINT8 led_data = sel & 0xff; + uint16_t sel = 1 << (m_led_select & 0xf) & 0x3ff; + uint8_t led_data = sel & 0xff; m_inp_mux = sel & 0x1ff; // 7442 9: speaker out (optional?) m_dac->write(BIT(sel, 9)); // 74259 Q4-Q7,Q2,Q1: digit/led select (active low) - UINT8 led_sel = ~BITSWAP8(m_led_select,0,3,1,2,7,6,5,4) & 0x3f; + uint8_t led_sel = ~BITSWAP8(m_led_select,0,3,1,2,7,6,5,4) & 0x3f; // a0-a2,d1: digit segment data (model 6093) m_7seg_data = (m_7seg_data & ~mask) | ((data & 2) ? mask : 0); - UINT8 seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4); + uint8_t seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4); // update display: 4 7seg leds, 2*8 chessboard leds for (int i = 0; i < 6; i++) @@ -840,7 +840,7 @@ WRITE8_MEMBER(fidel6502_state::fexcel_ttl_w) READ8_MEMBER(fidel6502_state::fexcelb_ttl_r) { // a0-a2,d6: from speech board: language switches and TSI BUSY line, otherwise tied to VCC - UINT8 d6 = (m_inp_matrix[9].read_safe(0xff) >> offset & 1) ? 0x40 : 0; + uint8_t d6 = (m_inp_matrix[9].read_safe(0xff) >> offset & 1) ? 0x40 : 0; // a0-a2,d7: multiplexed inputs (active low) return d6 | ((read_inputs(9) >> offset & 1) ? 0 : 0x80); @@ -848,7 +848,7 @@ READ8_MEMBER(fidel6502_state::fexcelb_ttl_r) READ8_MEMBER(fidel6502_state::fexcel_ttl_r) { - UINT8 d7 = 0x80; + uint8_t d7 = 0x80; // 74259(1) Q7 + 74251 I0: battery status if (m_inp_mux == 1 && ~m_led_select & 0x80) @@ -869,12 +869,12 @@ READ8_MEMBER(fidel6502_state::fexcel_ttl_r) WRITE8_MEMBER(fidel6502_state::chesster_control_w) { // a0-a2,d7: 74259(1) - UINT8 mask = 1 << offset; + uint8_t mask = 1 << offset; m_led_select = (m_led_select & ~mask) | ((data & 0x80) ? mask : 0); // 74259 Q4-Q7: 7442 a0-a3 // 7442 0-8: led data, input mux - UINT16 sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff; + uint16_t sel = 1 << (m_led_select >> 4 & 0xf) & 0x3ff; m_inp_mux = sel & 0x1ff; // 74259 Q0,Q1: led select (active low) diff --git a/src/mame/drivers/fidel68k.cpp b/src/mame/drivers/fidel68k.cpp index 617cf5b57e2..856aa6bc89b 100644 --- a/src/mame/drivers/fidel68k.cpp +++ b/src/mame/drivers/fidel68k.cpp @@ -184,7 +184,7 @@ public: void fidel68k_state::eag_prepare_display() { // 8*7seg leds, (8+1)*8 chessboard leds - UINT8 seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4); + uint8_t seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4); set_display_segmask(0x1ef, 0x7f); display_matrix(16, 9, m_led_data << 8 | seg_data, m_inp_mux); } @@ -223,7 +223,7 @@ WRITE8_MEMBER(fidel68k_state::eag_mux_w) // d0-d3: 74145 A-D // 74145 0-8: input mux, digit/led select // 74145 9: speaker out - UINT16 sel = 1 << (data & 0xf); + uint16_t sel = 1 << (data & 0xf); m_dac->write(BIT(sel, 9)); m_inp_mux = sel & 0x1ff; eag_prepare_display(); diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp index 6b8782c0c02..3d42cd37298 100644 --- a/src/mame/drivers/fidelz80.cpp +++ b/src/mame/drivers/fidelz80.cpp @@ -620,7 +620,7 @@ void fidelz80base_state::machine_reset() void fidelz80base_state::display_update() { - UINT32 active_state[0x20]; + uint32_t active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -633,7 +633,7 @@ void fidelz80base_state::display_update() m_display_decay[y][x] = m_display_wait; // determine active state - UINT32 ds = (m_display_decay[y][x] != 0) ? 1 : 0; + uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0; active_state[y] |= (ds << x); } } @@ -688,7 +688,7 @@ void fidelz80base_state::set_display_size(int maxx, int maxy) m_display_maxy = maxy; } -void fidelz80base_state::set_display_segmask(UINT32 digits, UINT32 mask) +void fidelz80base_state::set_display_segmask(uint32_t digits, uint32_t mask) { // set a segment mask per selected digit, but leave unselected ones alone for (int i = 0; i < 0x20; i++) @@ -699,12 +699,12 @@ void fidelz80base_state::set_display_segmask(UINT32 digits, UINT32 mask) } } -void fidelz80base_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update) +void fidelz80base_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update) { set_display_size(maxx, maxy); // update current state - UINT32 mask = (1 << maxx) - 1; + uint32_t mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; @@ -715,9 +715,9 @@ void fidelz80base_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 // generic input handlers -UINT16 fidelz80base_state::read_inputs(int columns) +uint16_t fidelz80base_state::read_inputs(int columns) { - UINT16 ret = 0; + uint16_t ret = 0; // read selected input rows for (int i = 0; i < columns; i++) @@ -741,7 +741,7 @@ INPUT_CHANGED_MEMBER(fidelz80_state::reset_button) DEVICE_IMAGE_LOAD_MEMBER(fidelz80base_state, scc_cartridge) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); // max size is 16KB? if (size > 0x4000) @@ -769,7 +769,7 @@ DEVICE_IMAGE_LOAD_MEMBER(fidelz80base_state, scc_cartridge) void fidelz80_state::vcc_prepare_display() { // 4 7seg leds (note: sel d0 for extra leds) - UINT8 outdata = (m_7seg_data & 0x7f) | (m_led_select << 7 & 0x80); + uint8_t outdata = (m_7seg_data & 0x7f) | (m_led_select << 7 & 0x80); set_display_segmask(0xf, 0x7f); display_matrix(8, 4, outdata, m_led_select >> 2 & 0xf); } @@ -836,7 +836,7 @@ WRITE8_MEMBER(fidelz80_state::vcc_ppi_portb_w) READ8_MEMBER(fidelz80_state::vcc_ppi_portc_r) { // d0-d3: multiplexed inputs (active low), also language switches - UINT8 lan = (~m_led_select & 0x40) ? m_inp_matrix[4]->read() : 0; + uint8_t lan = (~m_led_select & 0x40) ? m_inp_matrix[4]->read() : 0; return ~(lan | read_inputs(4)) & 0xf; } @@ -879,7 +879,7 @@ WRITE8_MEMBER(fidelz80_state::cc10_ppi_porta_w) WRITE8_MEMBER(fidelz80_state::bcc_control_w) { // a0-a2,d7: digit segment data via NE591, Q7 is speaker out - UINT8 mask = 1 << (offset & 7); + uint8_t mask = 1 << (offset & 7); m_7seg_data = (m_7seg_data & ~mask) | ((data & 0x80) ? mask : 0); m_dac->write(BIT(m_7seg_data, 7)); @@ -951,7 +951,7 @@ READ8_MEMBER(fidelz80_state::vsc_pio_porta_r) READ8_MEMBER(fidelz80_state::vsc_pio_portb_r) { - UINT8 data = 0; + uint8_t data = 0; // d4: TSI BUSY line data |= (m_speech->busy_r()) ? 0 : 0x10; @@ -987,7 +987,7 @@ WRITE8_MEMBER(fidelz80_state::vsc_pio_portb_w) void fidelz80_state::vbrc_prepare_display() { // 14seg led segments, d15 is extra led, d14 is unused (tone on prototype?) - UINT16 outdata = BITSWAP16(m_7seg_data,12,13,1,6,5,2,0,7,15,11,10,14,4,3,9,8); + uint16_t outdata = BITSWAP16(m_7seg_data,12,13,1,6,5,2,0,7,15,11,10,14,4,3,9,8); set_display_segmask(0xff, 0x3fff); display_matrix(16, 8, outdata, m_led_select); } @@ -1093,7 +1093,7 @@ ADDRESS_MAP_END // VSC io: A2 is 8255 _CE, A3 is Z80 PIO _CE - in theory, both chips can be accessed simultaneously READ8_MEMBER(fidelz80_state::vsc_io_trampoline_r) { - UINT8 data = 0xff; // open bus + uint8_t data = 0xff; // open bus if (~offset & 4) data &= m_ppi8255->read(space, offset & 3); if (~offset & 8) diff --git a/src/mame/drivers/fireball.cpp b/src/mame/drivers/fireball.cpp index 12fa1e114fa..bb8385e6cc5 100644 --- a/src/mame/drivers/fireball.cpp +++ b/src/mame/drivers/fireball.cpp @@ -50,13 +50,13 @@ public: m_eeprom(*this, "eeprom") { } - UINT8 m_p1_data; - UINT8 m_p3_data; - UINT8 int_timing; - UINT8 int_data; - UINT8 ay_data; - UINT8 to_ay_data; - UINT8 m_display_data; + uint8_t m_p1_data; + uint8_t m_p3_data; + uint8_t int_timing; + uint8_t int_data; + uint8_t ay_data; + uint8_t to_ay_data; + uint8_t m_display_data; DECLARE_WRITE8_MEMBER(io_00_w); DECLARE_READ8_MEMBER(io_00_r); @@ -92,7 +92,7 @@ private: READ8_MEMBER(fireball_state::io_00_r) { - UINT8 tmp=0; + uint8_t tmp=0; tmp=ioport("X2-4")->read(); @@ -130,7 +130,7 @@ WRITE8_MEMBER(fireball_state::io_00_w) READ8_MEMBER(fireball_state::io_02_r) { - UINT8 tmp=0; + uint8_t tmp=0; tmp=ioport("X6-8")->read(); @@ -156,7 +156,7 @@ WRITE8_MEMBER(fireball_state::io_02_w) READ8_MEMBER(fireball_state::io_04_r) { //contraves per mod prog - UINT8 tmp=0; + uint8_t tmp=0; tmp=ioport("X10-12")->read(); @@ -192,15 +192,15 @@ WRITE8_MEMBER(fireball_state::io_06_w) to_ay_data= data; if (LOG_DISPLAY2) - logerror("On board display write %02X\n",UINT8(~(data&0xff))); + logerror("On board display write %02X\n",uint8_t(~(data&0xff))); - output().set_digit_value(7, UINT8(~(data&0xff))); + output().set_digit_value(7, uint8_t(~(data&0xff))); } READ8_MEMBER(fireball_state::p1_r) { - UINT8 tmp=0; + uint8_t tmp=0; tmp=(m_p1_data&0xfe)|(m_eeprom->do_read()); if (LOG_P1) logerror("readP1 port data %02X\n",tmp&0x01); @@ -268,7 +268,7 @@ WRITE8_MEMBER(fireball_state::io_06_w) READ8_MEMBER(fireball_state::p3_r) { - UINT8 ret = 0xfb | ((int_data&1)<<2); + uint8_t ret = 0xfb | ((int_data&1)<<2); if (LOG_P3) logerror("read P3 port data = %02X\n",ret); return ret; diff --git a/src/mame/drivers/firebeat.cpp b/src/mame/drivers/firebeat.cpp index 89665e9625c..f88dbb63e1d 100644 --- a/src/mame/drivers/firebeat.cpp +++ b/src/mame/drivers/firebeat.cpp @@ -154,9 +154,9 @@ Keyboard Mania 2nd Mix - dongle, program CD, audio CD struct IBUTTON_SUBKEY { - UINT8 identifier[8]; - UINT8 password[8]; - UINT8 data[0x30]; + uint8_t identifier[8]; + uint8_t password[8]; + uint8_t data[0x30]; }; struct IBUTTON @@ -190,7 +190,7 @@ public: required_device m_maincpu; optional_device m_audiocpu; - required_shared_ptr m_work_ram; + required_shared_ptr m_work_ram; required_device m_flash_main; required_device m_flash_snd1; required_device m_flash_snd2; @@ -203,19 +203,19 @@ public: required_device m_gcu1; optional_device m_spuata; - UINT8 m_extend_board_irq_enable; - UINT8 m_extend_board_irq_active; + uint8_t m_extend_board_irq_enable; + uint8_t m_extend_board_irq_active; // emu_timer *m_keyboard_timer; int m_tick; int m_layer; int m_cab_data_ptr; const int * m_cur_cab_data; // int m_keyboard_state[2]; - UINT8 m_spu_shared_ram[0x400]; + uint8_t m_spu_shared_ram[0x400]; IBUTTON m_ibutton; int m_ibutton_state; int m_ibutton_read_subkey_ptr; - UINT8 m_ibutton_subkey_data[0x40]; + uint8_t m_ibutton_subkey_data[0x40]; DECLARE_READ8_MEMBER(soundram_r); DECLARE_DRIVER_INIT(ppd); @@ -224,8 +224,8 @@ public: DECLARE_MACHINE_START(firebeat); DECLARE_MACHINE_RESET(firebeat); DECLARE_VIDEO_START(firebeat); - UINT32 screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(firebeat_interrupt); DECLARE_READ32_MEMBER(input_r); DECLARE_READ32_MEMBER(sensor_r ); @@ -264,8 +264,8 @@ public: DECLARE_WRITE_LINE_MEMBER(spu_ata_interrupt); // TIMER_CALLBACK_MEMBER(keyboard_timer_callback); TIMER_DEVICE_CALLBACK_MEMBER(spu_timer_callback); - void set_ibutton(UINT8 *data); - int ibutton_w(UINT8 data); + void set_ibutton(uint8_t *data); + int ibutton_w(uint8_t data); DECLARE_WRITE8_MEMBER(security_w); void init_lights(write32_delegate out1, write32_delegate out2, write32_delegate out3); void init_firebeat(); @@ -286,14 +286,14 @@ VIDEO_START_MEMBER(firebeat_state,firebeat) { } -UINT32 firebeat_state::screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu0->draw(screen, bitmap, cliprect); } -UINT32 firebeat_state::screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu1->draw(screen, bitmap, cliprect); } +uint32_t firebeat_state::screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu0->draw(screen, bitmap, cliprect); } +uint32_t firebeat_state::screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu1->draw(screen, bitmap, cliprect); } /*****************************************************************************/ READ32_MEMBER(firebeat_state::input_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { @@ -325,7 +325,7 @@ READ32_MEMBER(firebeat_state::sensor_r ) READ32_MEMBER(firebeat_state::flashram_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= (m_flash_main->read((offset*4)+0) & 0xff) << 24; @@ -367,7 +367,7 @@ WRITE32_MEMBER(firebeat_state::flashram_w) READ32_MEMBER(firebeat_state::soundflash_r) { - UINT32 r = 0; + uint32_t r = 0; fujitsu_29f016a_device *chip; if (offset < 0x200000/4) { @@ -438,7 +438,7 @@ WRITE32_MEMBER(firebeat_state::soundflash_w) READ32_MEMBER(firebeat_state::ata_command_r ) { - UINT16 r; + uint16_t r; // printf("ata_command_r: %08X, %08X\n", offset, mem_mask); if (ACCESSING_BITS_16_31) { @@ -469,7 +469,7 @@ WRITE32_MEMBER(firebeat_state::ata_command_w ) READ32_MEMBER(firebeat_state::ata_control_r ) { - UINT16 r; + uint16_t r; // printf("ata_control_r: %08X, %08X\n", offset, mem_mask); if (ACCESSING_BITS_16_31) @@ -501,7 +501,7 @@ WRITE32_MEMBER(firebeat_state::ata_control_w ) /* READ32_MEMBER(firebeat_state::comm_uart_r ) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { @@ -558,7 +558,7 @@ static const int ppd_cab_data[2] = { 0x1, 0x9 }; READ32_MEMBER(firebeat_state::cabinet_r ) { - UINT32 r = 0; + uint32_t r = 0; // printf("cabinet_r: %08X, %08X\n", offset, mem_mask); @@ -663,7 +663,7 @@ TIMER_CALLBACK_MEMBER(firebeat_state::keyboard_timer_callback) for (keyboard=0; keyboard < 2; keyboard++) { - UINT32 kbstate = ioport(keynames[keyboard])->read(); + uint32_t kbstate = ioport(keynames[keyboard])->read(); int uart_channel = kb_uart_channel[keyboard]; if (kbstate != m_keyboard_state[keyboard]) @@ -708,7 +708,7 @@ TIMER_CALLBACK_MEMBER(firebeat_state::keyboard_timer_callback) READ32_MEMBER(firebeat_state::extend_board_irq_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { @@ -873,7 +873,7 @@ WRITE32_MEMBER(firebeat_state::lamp_output3_ppp_w ) READ32_MEMBER(firebeat_state::ppc_spu_share_r) { - UINT32 r = 0; + uint32_t r = 0; #if PRINT_SPU_MEM printf("ppc_spu_share_r: %08X, %08X at %08X\n", offset, mem_mask, space.device().safe_pc()); @@ -928,7 +928,7 @@ WRITE32_MEMBER(firebeat_state::ppc_spu_share_w) printf("SPU command %02X%02X\n", m_spu_shared_ram[0], m_spu_shared_ram[1]); - UINT16 cmd = ((UINT16)(m_spu_shared_ram[0]) << 8) | m_spu_shared_ram[1]; + uint16_t cmd = ((uint16_t)(m_spu_shared_ram[0]) << 8) | m_spu_shared_ram[1]; if (cmd == 0x1110) { printf(" [%02X %02X %02X %02X %02X]\n", m_spu_shared_ram[0x10], m_spu_shared_ram[0x11], m_spu_shared_ram[0x12], m_spu_shared_ram[0x13], m_spu_shared_ram[0x14]); @@ -958,7 +958,7 @@ READ16_MEMBER(firebeat_state::m68k_spu_share_r) #if PRINT_SPU_MEM printf("m68k_spu_share_r: %08X, %08X\n", offset, mem_mask); #endif - UINT16 r = 0; + uint16_t r = 0; if (ACCESSING_BITS_0_7) { @@ -992,7 +992,7 @@ READ16_MEMBER(firebeat_state::spu_unk_r) { // dipswitches? - UINT16 r = 0; + uint16_t r = 0; r |= 0x80; // if set, uses ATA PIO mode, otherwise DMA r |= 0x01; // enable SDRAM test @@ -1441,7 +1441,7 @@ enum -void firebeat_state::set_ibutton(UINT8 *data) +void firebeat_state::set_ibutton(uint8_t *data) { int i, j; @@ -1467,7 +1467,7 @@ void firebeat_state::set_ibutton(UINT8 *data) } } -int firebeat_state::ibutton_w(UINT8 data) +int firebeat_state::ibutton_w(uint8_t data) { int r = -1; @@ -1579,7 +1579,7 @@ void firebeat_state::init_lights(write32_delegate out1, write32_delegate out2, w void firebeat_state::init_firebeat() { - UINT8 *rom = memregion("user2")->base(); + uint8_t *rom = memregion("user2")->base(); // pc16552d_init(machine(), 0, 19660800, comm_uart_irq_callback, 0); // Network UART // pc16552d_init(machine(), 1, 24000000, midi_uart_irq_callback, 0); // MIDI UART diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp index 30a7e9c7ac7..3d527bd39c5 100644 --- a/src/mame/drivers/firefox.cpp +++ b/src/mame/drivers/firefox.cpp @@ -60,7 +60,7 @@ public: required_device m_laserdisc; required_shared_ptr m_tileram; - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; required_shared_ptr m_sprite_palette; required_shared_ptr m_tile_palette; int m_n_disc_lock; @@ -70,8 +70,8 @@ public: x2212_device *m_nvram_1d; tilemap_t *m_bgtiles; int m_control_num; - UINT8 m_sound_to_main_flag; - UINT8 m_main_to_sound_flag; + uint8_t m_sound_to_main_flag; + uint8_t m_main_to_sound_flag; int m_sprite_bank; DECLARE_READ8_MEMBER(firefox_disc_status_r); DECLARE_READ8_MEMBER(firefox_disc_data_r); @@ -110,7 +110,7 @@ public: TILE_GET_INFO_MEMBER(bgtile_get_info); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(video_timer_callback); void set_rgba( int start, int index, unsigned char *palette_ram ); void firq_gen(phillips_22vp931_device &laserdisc, int state); @@ -154,7 +154,7 @@ fffe=reset e7cc */ READ8_MEMBER(firefox_state::firefox_disc_status_r) { - UINT8 result = 0xff; + uint8_t result = 0xff; result ^= 0x20; if (!m_laserdisc->ready_r()) @@ -237,7 +237,7 @@ void firefox_state::video_start() } -UINT32 firefox_state::screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t firefox_state::screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int sprite; int gfxtop = screen.visible_area().min_y; @@ -246,7 +246,7 @@ UINT32 firefox_state::screen_update_firefox(screen_device &screen, bitmap_rgb32 for( sprite = 0; sprite < 32; sprite++ ) { - UINT8 *sprite_data = m_spriteram + ( 0x200 * m_sprite_bank ) + ( sprite * 16 ); + uint8_t *sprite_data = m_spriteram + ( 0x200 * m_sprite_bank ) + ( sprite * 16 ); int flags = sprite_data[ 0 ]; int y = sprite_data[ 1 ] + ( 256 * ( ( flags >> 0 ) & 1 ) ); int x = sprite_data[ 2 ] + ( 256 * ( ( flags >> 1 ) & 1 ) ); diff --git a/src/mame/drivers/firetrap.cpp b/src/mame/drivers/firetrap.cpp index 6a2dc7d14a5..300e65084b6 100644 --- a/src/mame/drivers/firetrap.cpp +++ b/src/mame/drivers/firetrap.cpp @@ -192,8 +192,8 @@ READ8_MEMBER(firetrap_state::firetrap_8751_bootleg_r) /* Check for coin insertion */ /* the following only works in the bootleg version, which doesn't have an */ /* 8751 - the real thing is much more complicated than that. */ - UINT8 coin = 0; - UINT8 port = ioport("IN2")->read() & 0x70; + uint8_t coin = 0; + uint8_t port = ioport("IN2")->read() & 0x70; if (space.device().safe_pc() == 0x1188) return ~m_coin_command_pending; @@ -221,7 +221,7 @@ READ8_MEMBER(firetrap_state::firetrap_8751_r) WRITE8_MEMBER(firetrap_state::firetrap_8751_w) { - static const UINT8 i8751_init_data[]={ + static const uint8_t i8751_init_data[]={ 0xf5,0xd5,0xdd,0x21,0x05,0xc1,0x87,0x5f,0x87,0x83,0x5f,0x16,0x00,0xdd,0x19,0xd1, 0xf1,0xc9,0xf5,0xd5,0xfd,0x21,0x2f,0xc1,0x87,0x5f,0x16,0x00,0xfd,0x19,0xd1,0xf1, 0xc9,0xe3,0xd5,0xc5,0xf5,0xdd,0xe5,0xfd,0xe5,0xe9,0xe1,0xfd,0xe1,0xdd,0xe1,0xf1, @@ -409,7 +409,7 @@ INPUT_CHANGED_MEMBER(firetrap_state::coin_inserted) /* coin insertion causes an IRQ */ if(newval) { - m_coin_command_pending = (UINT8)(uintptr_t)(param); + m_coin_command_pending = (uint8_t)(uintptr_t)(param); /* Make sure coin IRQ's aren't generated when another command is pending, the main cpu definitely doesn't expect them as it locks out the coin routine */ @@ -581,8 +581,8 @@ INTERRUPT_GEN_MEMBER(firetrap_state::firetrap_irq) void firetrap_state::machine_start() { - UINT8 *MAIN = memregion("maincpu")->base(); - UINT8 *SOUND = memregion("audiocpu")->base(); + uint8_t *MAIN = memregion("maincpu")->base(); + uint8_t *SOUND = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 4, &MAIN[0x10000], 0x4000); membank("bank2")->configure_entries(0, 2, &SOUND[0x10000], 0x4000); diff --git a/src/mame/drivers/firetrk.cpp b/src/mame/drivers/firetrk.cpp index c0f4bf3539c..68d6c2f01ed 100644 --- a/src/mame/drivers/firetrk.cpp +++ b/src/mame/drivers/firetrk.cpp @@ -155,8 +155,8 @@ void firetrk_state::machine_reset() READ8_MEMBER(firetrk_state::firetrk_dip_r) { - UINT8 val0 = m_dips[0]->read(); - UINT8 val1 = m_dips[1]->read(); + uint8_t val0 = m_dips[0]->read(); + uint8_t val1 = m_dips[1]->read(); if (val1 & (1 << (2 * offset + 0))) val0 |= 1; if (val1 & (1 << (2 * offset + 1))) val0 |= 2; @@ -167,8 +167,8 @@ READ8_MEMBER(firetrk_state::firetrk_dip_r) READ8_MEMBER(firetrk_state::montecar_dip_r) { - UINT8 val0 = m_dips[0]->read(); - UINT8 val1 = m_dips[1]->read(); + uint8_t val0 = m_dips[0]->read(); + uint8_t val1 = m_dips[1]->read(); if (val1 & (1 << (3 - offset))) val0 |= 1; if (val1 & (1 << (7 - offset))) val0 |= 2; @@ -191,7 +191,7 @@ CUSTOM_INPUT_MEMBER(firetrk_state::steer_flag_r) CUSTOM_INPUT_MEMBER(firetrk_state::skid_r) { - UINT32 ret; + uint32_t ret; int which = (uintptr_t)param; if (which != 2) @@ -205,7 +205,7 @@ CUSTOM_INPUT_MEMBER(firetrk_state::skid_r) CUSTOM_INPUT_MEMBER(firetrk_state::crash_r) { - UINT32 ret; + uint32_t ret; int which = (uintptr_t)param; if (which != 2) @@ -230,8 +230,8 @@ READ8_MEMBER(firetrk_state::firetrk_input_r) /* update steering wheels */ for (i = 0; i < 2; i++) { - UINT32 const new_dial = m_steer[i].read_safe(0); - INT32 const delta = new_dial - m_dial[i]; + uint32_t const new_dial = m_steer[i].read_safe(0); + int32_t const delta = new_dial - m_dial[i]; if (delta != 0) { @@ -250,7 +250,7 @@ READ8_MEMBER(firetrk_state::firetrk_input_r) READ8_MEMBER(firetrk_state::montecar_input_r) { - UINT8 ret = firetrk_input_r(space, offset); + uint8_t ret = firetrk_input_r(space, offset); if (m_crash[0]) ret |= 0x02; @@ -788,7 +788,7 @@ static const gfx_layout superbug_car_layout2 = 0x001 }; -static const UINT32 firetrk_trailer_layout_xoffset[64] = +static const uint32_t firetrk_trailer_layout_xoffset[64] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, @@ -800,7 +800,7 @@ static const UINT32 firetrk_trailer_layout_xoffset[64] = 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f }; -static const UINT32 firetrk_trailer_layout_yoffset[64] = +static const uint32_t firetrk_trailer_layout_yoffset[64] = { 0x000, 0x040, 0x080, 0x0c0, 0x100, 0x140, 0x180, 0x1c0, 0x200, 0x240, 0x280, 0x2c0, 0x300, 0x340, 0x380, 0x3c0, diff --git a/src/mame/drivers/fitfight.cpp b/src/mame/drivers/fitfight.cpp index d0d35212f14..cdef98489ca 100644 --- a/src/mame/drivers/fitfight.cpp +++ b/src/mame/drivers/fitfight.cpp @@ -97,20 +97,20 @@ READ16_MEMBER( fitfight_state::hotmindff_unk_r ) READ16_MEMBER(fitfight_state::fitfight_700000_r) { - UINT16 data = m_fof_700000_data; + uint16_t data = m_fof_700000_data; return (data << 2); } READ16_MEMBER(fitfight_state::histryma_700000_r) { - UINT16 data = (m_fof_700000_data & 0x00AA); + uint16_t data = (m_fof_700000_data & 0x00AA); data |= ((m_fof_700000_data & 0x0055) >> 2); return (data); } READ16_MEMBER(fitfight_state::bbprot_700000_r) { - UINT16 data = 0; + uint16_t data = 0; data = (m_fof_700000_data & 0x000b); data |= ((m_fof_700000_data & 0x01d0) >> 2); data |= ((m_fof_700000_data & 0x0004) << 6); @@ -991,7 +991,7 @@ ROM_END DRIVER_INIT_MEMBER(fitfight_state,fitfight) { -// UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); +// uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); // mem16[0x0165B2/2] = 0x4e71; // for now so it boots m_maincpu->space(AS_PROGRAM).install_read_handler(0x700000, 0x700001, read16_delegate(FUNC(fitfight_state::fitfight_700000_r),this)); m_bbprot_kludge = 0; @@ -999,7 +999,7 @@ DRIVER_INIT_MEMBER(fitfight_state,fitfight) DRIVER_INIT_MEMBER(fitfight_state,histryma) { -// UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); +// uint16_t *mem16 = (uint16_t *)memregion("maincpu")->base(); // mem16[0x017FDC/2] = 0x4e71; // for now so it boots m_maincpu->space(AS_PROGRAM).install_read_handler(0x700000, 0x700001, read16_delegate(FUNC(fitfight_state::histryma_700000_r),this)); m_bbprot_kludge = 0; diff --git a/src/mame/drivers/fk1.cpp b/src/mame/drivers/fk1.cpp index d3d32f1dc5e..23419e04572 100644 --- a/src/mame/drivers/fk1.cpp +++ b/src/mame/drivers/fk1.cpp @@ -53,10 +53,10 @@ public: DECLARE_WRITE8_MEMBER(fk1_disk_w); DECLARE_READ8_MEMBER(fk1_mouse_r); DECLARE_WRITE8_MEMBER(fk1_reset_int_w); - UINT8 m_video_rol; - UINT8 m_int_vector; + uint8_t m_video_rol; + uint8_t m_int_vector; virtual void machine_reset() override; - 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); TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); TIMER_DEVICE_CALLBACK_MEMBER(vsync_callback); IRQ_CALLBACK_MEMBER(fk1_irq_callback); @@ -250,7 +250,7 @@ WRITE8_MEMBER( fk1_state::fk1_intr_w ) READ8_MEMBER( fk1_state::fk1_bank_ram_r ) { address_space &space_mem = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); space_mem.install_write_bank(0x0000, 0x3fff, "bank1"); membank("bank1")->set_base(ram); @@ -374,7 +374,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(fk1_state::vsync_callback) void fk1_state::machine_reset() { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); space.unmap_write(0x0000, 0x3fff); membank("bank1")->set_base(memregion("maincpu")->base()); // ROM @@ -383,11 +383,11 @@ void fk1_state::machine_reset() membank("bank4")->set_base(ram + 0xc000); } -UINT32 fk1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t fk1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 code; + uint8_t code; int y, x, b; - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); for (x = 0; x < 64; x++) { diff --git a/src/mame/drivers/flicker.cpp b/src/mame/drivers/flicker.cpp index 602044c8c02..b054c810054 100644 --- a/src/mame/drivers/flicker.cpp +++ b/src/mame/drivers/flicker.cpp @@ -39,7 +39,7 @@ public: DECLARE_WRITE8_MEMBER(port10_w); DECLARE_READ8_MEMBER(port02_r); private: - UINT8 m_out_data; + uint8_t m_out_data; required_device m_maincpu; required_ioport m_testport; required_ioport m_coinport; @@ -125,7 +125,7 @@ READ8_MEMBER( flicker_state::port02_r ) WRITE8_MEMBER( flicker_state::port00_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; offset = m_maincpu->state_int(I4004_RAM); // we need the full address output().set_digit_value(offset, patterns[data]); } @@ -135,8 +135,8 @@ WRITE8_MEMBER( flicker_state::port01_w ) // The output lines operate the various lamps (44 of them) offset = m_maincpu->state_int(I4004_RAM) & 0x0f; // we need the full address - UINT16 test_port = m_testport->read() & 0xf81e; - UINT16 coin_port = m_coinport->read() & 0x07e0; + uint16_t test_port = m_testport->read() & 0xf81e; + uint16_t coin_port = m_coinport->read() & 0x07e0; if (BIT(m_coinport->read(), 0) ) test_port |= coin_port; diff --git a/src/mame/drivers/flipjack.cpp b/src/mame/drivers/flipjack.cpp index 777686e7b7b..63d63b9803e 100644 --- a/src/mame/drivers/flipjack.cpp +++ b/src/mame/drivers/flipjack.cpp @@ -109,16 +109,16 @@ public: required_device m_audiocpu; required_device m_crtc; - required_shared_ptr m_fbram; - required_shared_ptr m_vram; - required_shared_ptr m_cram; + required_shared_ptr m_fbram; + required_shared_ptr m_vram; + required_shared_ptr m_cram; required_device m_gfxdecode; required_device m_palette; - UINT8 m_soundlatch; - UINT8 m_bank; - UINT8 m_layer; + uint8_t m_soundlatch; + uint8_t m_bank; + uint8_t m_layer; DECLARE_WRITE8_MEMBER(flipjack_sound_nmi_ack_w); DECLARE_WRITE8_MEMBER(flipjack_soundlatch_w); @@ -129,7 +129,7 @@ public: DECLARE_WRITE8_MEMBER(flipjack_portc_w); virtual void machine_start() override; DECLARE_PALETTE_INIT(flipjack); - UINT32 screen_update_flipjack(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_flipjack(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -142,7 +142,7 @@ public: PALETTE_INIT_MEMBER(flipjack_state, flipjack) { // from prom - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); for (int i = 0; i < 0x40; i++) { palette.set_pen_color(2*i+1, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0)); @@ -155,7 +155,7 @@ PALETTE_INIT_MEMBER(flipjack_state, flipjack) } -UINT32 flipjack_state::screen_update_flipjack(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t flipjack_state::screen_update_flipjack(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; @@ -164,7 +164,7 @@ UINT32 flipjack_state::screen_update_flipjack(screen_device &screen, bitmap_rgb3 // draw playfield if (m_layer & 2) { - const UINT8 *blit_data = memregion("gfx2")->base(); + const uint8_t *blit_data = memregion("gfx2")->base(); count = 0; @@ -172,7 +172,7 @@ UINT32 flipjack_state::screen_update_flipjack(screen_device &screen, bitmap_rgb3 { for(x=0;x<256;x+=8) { - UINT32 pen_r,pen_g,pen_b,color; + uint32_t pen_r,pen_g,pen_b,color; int xi; pen_r = (blit_data[count] & 0xff)>>0; @@ -217,7 +217,7 @@ UINT32 flipjack_state::screen_update_flipjack(screen_device &screen, bitmap_rgb3 { for(x=0;x<256;x+=8) { - UINT32 pen,color; + uint32_t pen,color; int xi; pen = (m_fbram[count] & 0xff)>>0; @@ -422,7 +422,7 @@ GFXDECODE_END void flipjack_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000); membank("bank1")->set_entry(0); diff --git a/src/mame/drivers/flkatck.cpp b/src/mame/drivers/flkatck.cpp index 57b6d209c80..51f03c95d88 100644 --- a/src/mame/drivers/flkatck.cpp +++ b/src/mame/drivers/flkatck.cpp @@ -185,7 +185,7 @@ WRITE8_MEMBER(flkatck_state::volume_callback) void flkatck_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 3, &ROM[0x10000], 0x2000); diff --git a/src/mame/drivers/flower.cpp b/src/mame/drivers/flower.cpp index 6bce77cad69..3b895ac8af8 100644 --- a/src/mame/drivers/flower.cpp +++ b/src/mame/drivers/flower.cpp @@ -90,11 +90,11 @@ public: required_device m_palette; required_device m_gfxdecode; - required_shared_ptr m_txvram; - required_shared_ptr m_bgvram; - required_shared_ptr m_fgvram; + required_shared_ptr m_txvram; + required_shared_ptr m_bgvram; + required_shared_ptr m_fgvram; - 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); void legacy_tx_draw(bitmap_ind16 &bitmap,const rectangle &cliprect); void legacy_layers_draw(bitmap_ind16 &bitmap,const rectangle &cliprect); }; @@ -111,8 +111,8 @@ void flower_state::legacy_tx_draw(bitmap_ind16 &bitmap,const rectangle &cliprect int x = count % 32; int y = count / 32; - UINT8 tile = m_txvram[count]; - UINT8 attr = m_txvram[count+0x400]; + uint8_t tile = m_txvram[count]; + uint8_t attr = m_txvram[count+0x400]; if(attr & 0x03) // debug attr = machine().rand() & 0xfc; @@ -125,8 +125,8 @@ void flower_state::legacy_tx_draw(bitmap_ind16 &bitmap,const rectangle &cliprect int x = count / 32; int y = count % 32; - UINT8 tile = m_txvram[count]; - UINT8 attr = m_txvram[count+0x400]; + uint8_t tile = m_txvram[count]; + uint8_t attr = m_txvram[count+0x400]; if(attr & 0x03) // debug attr = machine().rand() & 0xfc; @@ -145,7 +145,7 @@ void flower_state::legacy_layers_draw(bitmap_ind16 &bitmap,const rectangle &clip { int x = count % 16; int y = count / 16; - UINT8 tile, attr; + uint8_t tile, attr; tile = m_bgvram[count]; attr = m_bgvram[count+0x100]; @@ -163,7 +163,7 @@ void flower_state::legacy_layers_draw(bitmap_ind16 &bitmap,const rectangle &clip } } -UINT32 flower_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t flower_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { legacy_layers_draw(bitmap,cliprect); legacy_tx_draw(bitmap,cliprect); diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp index 2d1ade9af49..88505594557 100644 --- a/src/mame/drivers/flstory.cpp +++ b/src/mame/drivers/flstory.cpp @@ -186,7 +186,7 @@ READ8_MEMBER(flstory_state::rumba_mcu_r) According to a PCB test, game should roll back to level 1 layout but level counter should say "17" instead of current "11". Some of these ports also appears to control game-play speed and who is playing between player 1 and 2. */ - //static UINT8 level_val; + //static uint8_t level_val; //level_val = read_byte(0xe247); diff --git a/src/mame/drivers/flyball.cpp b/src/mame/drivers/flyball.cpp index c1bab2d6190..e10e0bc38a4 100644 --- a/src/mame/drivers/flyball.cpp +++ b/src/mame/drivers/flyball.cpp @@ -50,19 +50,19 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_playfield_ram; + required_shared_ptr m_playfield_ram; /* video-related */ tilemap_t *m_tmap; - UINT8 m_pitcher_vert; - UINT8 m_pitcher_horz; - UINT8 m_pitcher_pic; - UINT8 m_ball_vert; - UINT8 m_ball_horz; + uint8_t m_pitcher_vert; + uint8_t m_pitcher_horz; + uint8_t m_pitcher_pic; + uint8_t m_ball_vert; + uint8_t m_ball_horz; /* misc */ - UINT8 m_potmask; - UINT8 m_potsense; + uint8_t m_potmask; + uint8_t m_potsense; emu_timer *m_pot_clear_timer; emu_timer *m_quarter_timer; @@ -86,7 +86,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(flyball); - 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); TIMER_CALLBACK_MEMBER(joystick_callback); TIMER_CALLBACK_MEMBER(quarter_callback); @@ -113,7 +113,7 @@ TILEMAP_MAPPER_MEMBER(flyball_state::get_memory_offset) TILE_GET_INFO_MEMBER(flyball_state::get_tile_info) { - UINT8 data = m_playfield_ram[tile_index]; + uint8_t data = m_playfield_ram[tile_index]; int flags = ((data & 0x40) ? TILE_FLIPX : 0) | ((data & 0x80) ? TILE_FLIPY : 0); int code = data & 63; @@ -130,7 +130,7 @@ void flyball_state::video_start() } -UINT32 flyball_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t flyball_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int pitcherx = m_pitcher_horz; int pitchery = m_pitcher_vert - 31; @@ -424,9 +424,9 @@ PALETTE_INIT_MEMBER(flyball_state, flyball) void flyball_state::machine_start() { /* address bits 0 through 8 are inverted */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int len = memregion("maincpu")->bytes(); - std::vector buf(len); + std::vector buf(len); for (int i = 0; i < len; i++) buf[i ^ 0x1ff] = ROM[i]; memcpy(ROM, &buf[0], len); diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp index 6032a3d9beb..b3a172ae740 100644 --- a/src/mame/drivers/fm7.cpp +++ b/src/mame/drivers/fm7.cpp @@ -58,7 +58,7 @@ * when kana is active. */ // TODO: fill in shift,ctrl,graph and kana code -static const UINT16 fm7_key_list[0x60][7] = +static const uint16_t fm7_key_list[0x60][7] = { // norm shift ctrl graph kana sh.kana scan {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, {0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x01}, // ESC @@ -161,7 +161,7 @@ static const UINT16 fm7_key_list[0x60][7] = }; -void fm7_state::main_irq_set_flag(UINT8 flag) +void fm7_state::main_irq_set_flag(uint8_t flag) { m_irq_flags |= flag; @@ -169,7 +169,7 @@ void fm7_state::main_irq_set_flag(UINT8 flag) m_maincpu->set_input_line(M6809_IRQ_LINE,ASSERT_LINE); } -void fm7_state::main_irq_clear_flag(UINT8 flag) +void fm7_state::main_irq_clear_flag(uint8_t flag) { m_irq_flags &= ~flag; @@ -245,7 +245,7 @@ WRITE8_MEMBER(fm7_state::fm7_irq_mask_w) */ READ8_MEMBER(fm7_state::fm7_irq_cause_r) { - UINT8 ret = ~m_irq_flags; + uint8_t ret = ~m_irq_flags; // Timer and Printer IRQ flags are cleared when this port is read // Keyboard IRQ flag is cleared when the scancode is read from @@ -313,7 +313,7 @@ READ8_MEMBER(fm7_state::fm7_sub_beeper_r) READ8_MEMBER(fm7_state::vector_r) { - UINT32 init_size = m_rom_ptr.bytes(); + uint32_t init_size = m_rom_ptr.bytes(); if (m_init_rom_en) { @@ -344,7 +344,7 @@ WRITE8_MEMBER(fm7_state::vector_w) */ READ8_MEMBER(fm7_state::fm7_fd04_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; if(m_video.attn_irq != 0) { @@ -368,7 +368,7 @@ READ8_MEMBER(fm7_state::fm7_rom_en_r) { if(!space.debugger_access()) { - UINT8* RAM = memregion("maincpu")->base(); + uint8_t* RAM = memregion("maincpu")->base(); m_basic_rom_en = 1; if(m_type == SYS_FM7) @@ -384,7 +384,7 @@ READ8_MEMBER(fm7_state::fm7_rom_en_r) WRITE8_MEMBER(fm7_state::fm7_rom_en_w) { - UINT8* RAM = memregion("maincpu")->base(); + uint8_t* RAM = memregion("maincpu")->base(); m_basic_rom_en = 0; if(m_type == SYS_FM7) @@ -432,7 +432,7 @@ WRITE_LINE_MEMBER(fm7_state::fm7_fdc_drq_w) READ8_MEMBER(fm7_state::fm7_fdc_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch(offset) { @@ -529,7 +529,7 @@ WRITE8_MEMBER(fm7_state::fm7_fdc_w) */ READ8_MEMBER(fm7_state::fm7_keyboard_r) { - UINT8 ret; + uint8_t ret; switch(offset) { case 0: @@ -546,7 +546,7 @@ READ8_MEMBER(fm7_state::fm7_keyboard_r) READ8_MEMBER(fm7_state::fm7_sub_keyboard_r) { - UINT8 ret; + uint8_t ret; switch(offset) { case 0: @@ -587,7 +587,7 @@ READ8_MEMBER(fm7_state::fm7_sub_keyboard_r) */ READ8_MEMBER(fm7_state::fm77av_key_encoder_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; switch(offset) { case 0x00: // data register @@ -779,7 +779,7 @@ READ8_MEMBER(fm7_state::fm7_cassette_printer_r) // bit 2: printer acknowledge // bit 1: printer error // bit 0: printer busy - UINT8 ret = 0; + uint8_t ret = 0; if(m_cassette->input() > 0.03) ret |= 0x80; @@ -827,7 +827,7 @@ WRITE8_MEMBER(fm7_state::fm7_cassette_printer_w) */ READ8_MEMBER(fm7_state::fm77av_boot_mode_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; if(m_dsw->read() & 0x02) ret &= ~0x01; @@ -953,7 +953,7 @@ WRITE8_MEMBER(fm7_state::fm7_main_shared_w) READ8_MEMBER(fm7_state::fm7_fmirq_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; if(m_fm77av_ym_irq != 0) ret &= ~0x08; @@ -1005,14 +1005,14 @@ READ8_MEMBER(fm7_state::fm7_mmr_r) return 0xff; } -void fm7_state::fm7_update_bank(address_space & space, int bank, UINT8 physical) +void fm7_state::fm7_update_bank(address_space & space, int bank, uint8_t physical) { address_map_bank_device* avbank[16] = { m_avbank1, m_avbank2, m_avbank3, m_avbank4, m_avbank5, m_avbank6, m_avbank7 , m_avbank8, m_avbank9, m_avbank10, m_avbank11, m_avbank12, m_avbank13, m_avbank14, m_avbank15, m_avbank16 }; avbank[bank]->set_bank(physical); -/* UINT8* RAM = memregion("maincpu")->base(); - UINT16 size = 0xfff; +/* uint8_t* RAM = memregion("maincpu")->base(); + uint16_t size = 0xfff; char bank_name[10]; if(bank == 15) @@ -1115,8 +1115,8 @@ void fm7_state::fm7_update_bank(address_space & space, int bank, UINT8 physical) void fm7_state::fm7_mmr_refresh(address_space& space) { int x; - UINT16 window_addr; - UINT8* RAM = memregion("maincpu")->base(); + uint16_t window_addr; + uint8_t* RAM = memregion("maincpu")->base(); if(m_mmr.enabled) { @@ -1211,8 +1211,8 @@ WRITE8_MEMBER(fm7_state::fm7_mmr_w) */ READ8_MEMBER(fm7_state::fm7_kanji_r) { - UINT8* KROM = m_kanji->base(); - UINT32 addr = m_kanji_address << 1; + uint8_t* KROM = m_kanji->base(); + uint32_t addr = m_kanji_address << 1; switch(offset) { @@ -1232,7 +1232,7 @@ READ8_MEMBER(fm7_state::fm7_kanji_r) WRITE8_MEMBER(fm7_state::fm7_kanji_w) { - UINT16 addr; + uint16_t addr; switch(offset) { @@ -1268,7 +1268,7 @@ TIMER_CALLBACK_MEMBER(fm7_state::fm7_subtimer_irq) // When a key is pressed or released (in scan mode only), an IRQ is generated on the main CPU, // or an FIRQ on the sub CPU, if masked. Both CPUs have ports to read keyboard data. // Scancodes are 9 bits in FM-7 mode, 8 bits in scan mode. -void fm7_state::key_press(UINT16 scancode) +void fm7_state::key_press(uint16_t scancode) { m_current_scancode = scancode; @@ -1290,9 +1290,9 @@ void fm7_state::fm7_keyboard_poll_scan() { int bit = 0; int x,y; - UINT32 keys; - UINT32 modifiers = m_keymod->read(); - static const UINT16 modscancodes[6] = { 0x52, 0x53, 0x54, 0x55, 0x56, 0x5a }; + uint32_t keys; + uint32_t modifiers = m_keymod->read(); + static const uint16_t modscancodes[6] = { 0x52, 0x53, 0x54, 0x55, 0x56, 0x5a }; for(x=0;x<3;x++) { @@ -1335,8 +1335,8 @@ TIMER_CALLBACK_MEMBER(fm7_state::fm7_keyboard_poll) int x,y; int bit = 0; int mod = 0; - UINT32 keys; - UINT32 modifiers = m_keymod->read(); + uint32_t keys; + uint32_t modifiers = m_keymod->read(); if (m_kb_ports[2]->read() & 0x40000) { @@ -1889,8 +1889,8 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER(fm7_state,fm7) { -// m_shared_ram = std::make_unique(0x80); - m_video_ram = std::make_unique(0x18000); // 2 pages on some systems +// m_shared_ram = std::make_unique(0x80); + m_video_ram = std::make_unique(0x18000); // 2 pages on some systems m_timer = timer_alloc(TIMER_FM7_IRQ); m_subtimer = timer_alloc(TIMER_FM7_SUBTIMER_IRQ); m_keyboard_timer = timer_alloc(TIMER_FM7_KEYBOARD_POLL); @@ -1901,7 +1901,7 @@ MACHINE_START_MEMBER(fm7_state,fm7) { // The FM-7 has no initialisation ROM, and no other obvious // way to set the reset vector, so for now this will have to do. - UINT8* RAM = memregion("maincpu")->base(); + uint8_t* RAM = memregion("maincpu")->base(); RAM[0xfffe] = 0xfe; RAM[0xffff] = 0x00; @@ -1914,8 +1914,8 @@ MACHINE_START_MEMBER(fm7_state,fm7) MACHINE_START_MEMBER(fm7_state,fm77av) { - UINT8* RAM = memregion("maincpu")->base(); - UINT8* ROM = memregion("init")->base(); + uint8_t* RAM = memregion("maincpu")->base(); + uint8_t* ROM = memregion("init")->base(); memset(m_shared_ram,0xff,0x80); @@ -1934,8 +1934,8 @@ MACHINE_START_MEMBER(fm7_state,fm77av) MACHINE_START_MEMBER(fm7_state,fm11) { - UINT8* RAM = memregion("maincpu")->base(); - UINT8* ROM = memregion("init")->base(); + uint8_t* RAM = memregion("maincpu")->base(); + uint8_t* ROM = memregion("init")->base(); memset(m_shared_ram,0xff,0x80); m_type = SYS_FM11; @@ -2030,7 +2030,7 @@ void fm7_state::machine_reset() m_x86->set_input_line(INPUT_LINE_HALT,ASSERT_LINE); } - memset(m_video_ram.get(), 0, sizeof(UINT8) * 0x18000); + memset(m_video_ram.get(), 0, sizeof(uint8_t) * 0x18000); } diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp index 5b489a2c17d..745e15d8d47 100644 --- a/src/mame/drivers/fmtowns.cpp +++ b/src/mame/drivers/fmtowns.cpp @@ -201,19 +201,19 @@ enum -inline UINT8 towns_state::byte_to_bcd(UINT8 val) +inline uint8_t towns_state::byte_to_bcd(uint8_t val) { return ((val / 10) << 4) | (val % 10); } -inline UINT8 towns_state::bcd_to_byte(UINT8 val) +inline uint8_t towns_state::bcd_to_byte(uint8_t val) { return (((val & 0xf0) >> 4) * 10) + (val & 0x0f); } -inline UINT32 towns_state::msf_to_lbafm(UINT32 val) // because the CDROM core doesn't provide this +inline uint32_t towns_state::msf_to_lbafm(uint32_t val) // because the CDROM core doesn't provide this { - UINT8 m,s,f; + uint8_t m,s,f; f = bcd_to_byte(val & 0x0000ff); s = (bcd_to_byte((val & 0x00ff00) >> 8)); m = (bcd_to_byte((val & 0xff0000) >> 16)); @@ -224,8 +224,8 @@ void towns_state::init_serial_rom() { // TODO: init serial ROM contents int x; - static const UINT8 code[8] = { 0x04,0x65,0x54,0xA4,0x95,0x45,0x35,0x5F }; - UINT8* srom = nullptr; + static const uint8_t code[8] = { 0x04,0x65,0x54,0xA4,0x95,0x45,0x35,0x5F }; + uint8_t* srom = nullptr; if(m_serial) srom = m_serial->base(); @@ -290,7 +290,7 @@ void towns_state::init_rtc() READ8_MEMBER(towns_state::towns_system_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch(offset) { @@ -387,7 +387,7 @@ WRITE8_MEMBER(towns_state::towns_intervaltimer2_w) READ8_MEMBER(towns_state::towns_intervaltimer2_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch(offset) { @@ -507,7 +507,7 @@ WRITE_LINE_MEMBER( towns_state::mb8877a_drq_w ) READ8_MEMBER(towns_state::towns_floppy_r) { - UINT8 ret; + uint8_t ret; switch(offset) { @@ -632,7 +632,7 @@ WRITE8_MEMBER(towns_state::towns_floppy_w) } READ16_MEMBER(towns_state::towns_fdc_dma_r) -{ UINT16 data = m_fdc->data_r(generic_space(), 0); +{ uint16_t data = m_fdc->data_r(generic_space(), 0); return data; } @@ -657,7 +657,7 @@ WRITE16_MEMBER(towns_state::towns_fdc_dma_w) * bit 7 = always 0 * bits 6-0 = key scancode */ -void towns_state::kb_sendcode(UINT8 scancode, int release) +void towns_state::kb_sendcode(uint8_t scancode, int release) { switch(release) { @@ -698,8 +698,8 @@ void towns_state::kb_sendcode(UINT8 scancode, int release) void towns_state::poll_keyboard() { int port,bit; - UINT8 scan; - UINT32 portval; + uint8_t scan; + uint32_t portval; scan = 0; for(port=0;port<4;port++) @@ -722,7 +722,7 @@ void towns_state::poll_keyboard() READ8_MEMBER(towns_state::towns_keyboard_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; switch(offset) { @@ -774,13 +774,13 @@ WRITE8_MEMBER(towns_state::towns_keyboard_w) * On write: bits 2-0: Timer mask set * bit 7: Timer 0 output reset */ -UINT8 towns_state::speaker_get_spk() +uint8_t towns_state::speaker_get_spk() { return m_towns_spkrdata & m_pit_out2; } -void towns_state::speaker_set_spkrdata(UINT8 data) +void towns_state::speaker_set_spkrdata(uint8_t data) { m_towns_spkrdata = data ? 1 : 0; m_speaker->level_w(speaker_get_spk()); @@ -789,7 +789,7 @@ void towns_state::speaker_set_spkrdata(UINT8 data) READ8_MEMBER(towns_state::towns_port60_r) { - UINT8 val = 0x00; + uint8_t val = 0x00; if (m_pit_out0) val |= 0x01; @@ -854,7 +854,7 @@ WRITE8_MEMBER(towns_state::towns_sys5e8_w) // W/O -- (0x4ec) LED control READ8_MEMBER(towns_state::towns_sound_ctrl_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch(offset) { @@ -901,11 +901,11 @@ void towns_state::mouse_timeout() READ8_MEMBER(towns_state::towns_padport_r) { - UINT8 ret = 0x00; - UINT32 porttype = m_ctrltype->read(); - UINT8 extra1; - UINT8 extra2; - UINT32 state; + uint8_t ret = 0x00; + uint32_t porttype = m_ctrltype->read(); + uint8_t extra1; + uint8_t extra2; + uint32_t state; if(offset == 0) { @@ -1086,8 +1086,8 @@ READ8_MEMBER(towns_state::towns_padport_r) WRITE8_MEMBER(towns_state::towns_pad_mask_w) { - UINT8 current_x,current_y; - UINT32 type = m_ctrltype->read(); + uint8_t current_x,current_y; + uint32_t type = m_ctrltype->read(); m_towns_pad_mask = (data & 0xff); if((type & 0x0f) == 0x02) // mouse @@ -1204,7 +1204,7 @@ WRITE8_MEMBER( towns_state::towns_cmos_w ) void towns_state::towns_update_video_banks(address_space& space) { - UINT8* ROM; + uint8_t* ROM; if(m_towns_mainmem_enable != 0) // first MB is RAM { @@ -1378,7 +1378,7 @@ void towns_state::towns_cd_status_ready() towns_cdrom_set_irq(TOWNS_CD_IRQ_MPU,1); } -void towns_state::towns_cd_set_status(UINT8 st0, UINT8 st1, UINT8 st2, UINT8 st3) +void towns_state::towns_cd_set_status(uint8_t st0, uint8_t st1, uint8_t st2, uint8_t st3) { m_towns_cd.cmd_status[0] = st0; m_towns_cd.cmd_status[1] = st1; @@ -1388,11 +1388,11 @@ void towns_state::towns_cd_set_status(UINT8 st0, UINT8 st1, UINT8 st2, UINT8 st3 m_towns_status_timer->adjust(attotime::from_msec(1),0,attotime::never); } -UINT8 towns_state::towns_cd_get_track() +uint8_t towns_state::towns_cd_get_track() { cdrom_image_device* cdrom = m_cdrom; - UINT32 lba = m_cdda->get_audio_lba(); - UINT8 track; + uint32_t lba = m_cdda->get_audio_lba(); + uint8_t track; for(track=1;track<99;track++) { @@ -1452,9 +1452,9 @@ TIMER_CALLBACK_MEMBER(towns_state::towns_cdrom_read_byte) } } -UINT8 towns_state::towns_cdrom_read_byte_software() +uint8_t towns_state::towns_cdrom_read_byte_software() { - UINT8 ret; + uint8_t ret; if(m_towns_cd.buffer_ptr < 0) // transfer has ended return 0x00; @@ -1496,7 +1496,7 @@ void towns_state::towns_cdrom_read(cdrom_image_device* device) // parameters: // 3 bytes: MSF of first sector to read // 3 bytes: MSF of last sector to read - UINT32 lba1,lba2,track; + uint32_t lba1,lba2,track; lba1 = m_towns_cd.parameter[7] << 16; lba1 += m_towns_cd.parameter[6] << 8; @@ -1564,7 +1564,7 @@ void towns_state::towns_cdrom_play_cdda(cdrom_image_device* device) // Parameters: // 3 bytes: starting MSF of audio to play // 3 bytes: ending MSF of audio to play (can span multiple tracks) - UINT32 lba1,lba2; + uint32_t lba1,lba2; lba1 = m_towns_cd.parameter[7] << 16; lba1 += m_towns_cd.parameter[6] << 8; @@ -1704,8 +1704,8 @@ READ16_MEMBER(towns_state::towns_cdrom_dma_r) READ8_MEMBER(towns_state::towns_cdrom_r) { - UINT32 addr = 0; - UINT8 ret = 0; + uint32_t addr = 0; + uint8_t ret = 0; ret = m_towns_cd.cmd_status[m_towns_cd.cmd_status_ptr]; @@ -2564,12 +2564,12 @@ INPUT_PORTS_END void towns_state::driver_start() { - m_towns_vram = std::make_unique(0x20000); - m_towns_gfxvram = std::make_unique(0x80000); - m_towns_txtvram = std::make_unique(0x20000); - memset(m_towns_txtvram.get(), 0, sizeof(UINT8)*0x20000); - //towns_sprram = std::make_unique(0x20000); - m_towns_serial_rom = std::make_unique(256/8); + m_towns_vram = std::make_unique(0x20000); + m_towns_gfxvram = std::make_unique(0x80000); + m_towns_txtvram = std::make_unique(0x20000); + memset(m_towns_txtvram.get(), 0, sizeof(uint8_t)*0x20000); + //towns_sprram = std::make_unique(0x20000); + m_towns_serial_rom = std::make_unique(256/8); init_serial_rom(); init_rtc(); m_towns_rtc_timer = timer_alloc(TIMER_RTC); diff --git a/src/mame/drivers/force68k.cpp b/src/mame/drivers/force68k.cpp index 08151b2127b..3f5b59d308c 100644 --- a/src/mame/drivers/force68k.cpp +++ b/src/mame/drivers/force68k.cpp @@ -171,14 +171,14 @@ private: required_device m_aciaremt; optional_device m_centronics; - INT32 m_centronics_ack; - INT32 m_centronics_busy; - INT32 m_centronics_perror; - INT32 m_centronics_select; + int32_t m_centronics_ack; + int32_t m_centronics_busy; + int32_t m_centronics_perror; + int32_t m_centronics_select; // Pointer to System ROMs needed by bootvect_r - UINT16 *m_sysrom; - UINT16 *m_usrrom; + uint16_t *m_sysrom; + uint16_t *m_usrrom; required_device m_cart; }; @@ -291,12 +291,12 @@ void force68k_state::machine_start () save_item (NAME (m_centronics_perror)); /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */ - m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0x080000); + m_sysrom = (uint16_t*)(memregion ("maincpu")->base () + 0x080000); /* Map user ROM/RAM socket(s) */ if (m_cart->exists()) { - m_usrrom = (UINT16*)m_cart->get_rom_base(); + m_usrrom = (uint16_t*)m_cart->get_rom_base(); #if 0 // This should be the correct way but produces odd and even bytes swapped m_maincpu->space(AS_PROGRAM).install_read_handler(0xa0000, 0xbffff, read16_delegate(FUNC(generic_slot_device::read16_rom), (generic_slot_device*)m_cart)); #else // So we installs a custom very ineffecient handler for now until we understand hwp to solve the problem better @@ -337,7 +337,7 @@ READ16_MEMBER (force68k_state::bootvect_r){ /* Dummy VME access methods until the VME bus device is ready for use */ READ16_MEMBER (force68k_state::vme_a24_r){ LOG (logerror ("vme_a24_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (force68k_state::vme_a24_w){ @@ -346,7 +346,7 @@ WRITE16_MEMBER (force68k_state::vme_a24_w){ READ16_MEMBER (force68k_state::vme_a16_r){ LOG (logerror ("vme_16_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (force68k_state::vme_a16_w){ @@ -402,7 +402,7 @@ MACHINE_CONFIG_END ****************************/ image_init_result force68k_state::force68k_load_cart(device_image_interface &image, generic_slot_device *slot) { - UINT32 size = slot->common_get_size("rom"); + uint32_t size = slot->common_get_size("rom"); if (size > 0x20000) // Max 128Kb { diff --git a/src/mame/drivers/forte2.cpp b/src/mame/drivers/forte2.cpp index 6cd35edaa74..1e0d02f5920 100644 --- a/src/mame/drivers/forte2.cpp +++ b/src/mame/drivers/forte2.cpp @@ -52,7 +52,7 @@ public: required_device m_maincpu; - UINT8 m_input_mask; + uint8_t m_input_mask; DECLARE_READ8_MEMBER(forte2_ay8910_read_input); DECLARE_WRITE8_MEMBER(forte2_ay8910_set_input_mask); @@ -139,7 +139,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(forte2_state,pesadelo) { - UINT8 *mem = memregion("maincpu")->base(); + uint8_t *mem = memregion("maincpu")->base(); int memsize = memregion("maincpu")->bytes(); // data swap @@ -149,7 +149,7 @@ DRIVER_INIT_MEMBER(forte2_state,pesadelo) } // address line swap - std::vector buf(memsize); + std::vector buf(memsize); memcpy(&buf[0], mem, memsize); for (int i = 0; i < memsize; i++) { diff --git a/src/mame/drivers/fortecar.cpp b/src/mame/drivers/fortecar.cpp index 65a90424f52..3975a3cbeb9 100644 --- a/src/mame/drivers/fortecar.cpp +++ b/src/mame/drivers/fortecar.cpp @@ -342,7 +342,7 @@ public: required_device m_maincpu; required_device m_watchdog; - required_shared_ptr m_vram; + required_shared_ptr m_vram; DECLARE_WRITE8_MEMBER(ppi0_portc_w); DECLARE_READ8_MEMBER(ppi0_portc_r); DECLARE_WRITE8_MEMBER(ayporta_w); @@ -351,7 +351,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(fortecar); - UINT32 screen_update_fortecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fortecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_eeprom; required_device m_gfxdecode; required_device m_palette; @@ -366,7 +366,7 @@ void fortecar_state::video_start() { } -UINT32 fortecar_state::screen_update_fortecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t fortecar_state::screen_update_fortecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, count; count = 0; @@ -395,7 +395,7 @@ UINT32 fortecar_state::screen_update_fortecar(screen_device &screen, bitmap_ind1 PALETTE_INIT_MEMBER(fortecar_state, fortecar) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); /* Video resistors... O1 (LS374) R1K RED diff --git a/src/mame/drivers/fp1100.cpp b/src/mame/drivers/fp1100.cpp index 7067b5e3c96..4301af2b1af 100644 --- a/src/mame/drivers/fp1100.cpp +++ b/src/mame/drivers/fp1100.cpp @@ -102,32 +102,32 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_c); required_device m_palette; private: - UINT8 m_irq_mask; - UINT8 m_main_latch; - UINT8 m_sub_latch; - UINT8 m_slot_num; - UINT8 m_kbd_row; - UINT8 m_col_border; - UINT8 m_col_cursor; - UINT8 m_col_display; - UINT8 m_centronics_busy; - UINT8 m_cass_data[4]; + uint8_t m_irq_mask; + uint8_t m_main_latch; + uint8_t m_sub_latch; + uint8_t m_slot_num; + uint8_t m_kbd_row; + uint8_t m_col_border; + uint8_t m_col_cursor; + uint8_t m_col_display; + uint8_t m_centronics_busy; + uint8_t m_cass_data[4]; bool m_cass_state; bool m_cassold; struct { - UINT8 id; + uint8_t id; }m_slot[8]; struct { - UINT8 porta; - UINT8 portb; - UINT8 portc; + uint8_t porta; + uint8_t portb; + uint8_t portc; }m_upd7801; required_device m_maincpu; required_device m_subcpu; required_device m_crtc; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_ioport_array<16> m_keyboard; required_device m_beep; required_device m_centronics; @@ -137,9 +137,9 @@ private: MC6845_UPDATE_ROW( fp1100_state::fp1100_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 r,g,b,col,i; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t r,g,b,col,i; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); if (BIT(m_upd7801.porta, 4)) { // green screen @@ -316,7 +316,7 @@ WRITE8_MEMBER( fp1100_state::porta_w ) READ8_MEMBER( fp1100_state::portb_r ) { - UINT8 data = m_keyboard[m_kbd_row]->read() ^ 0xff; + uint8_t data = m_keyboard[m_kbd_row]->read() ^ 0xff; //m_subcpu->set_input_line(UPD7810_INTF0, BIT(data, 7) ? HOLD_LINE : CLEAR_LINE); return data; } @@ -603,8 +603,8 @@ INTERRUPT_GEN_MEMBER(fp1100_state::fp1100_vblank_irq) MACHINE_RESET_MEMBER( fp1100_state, fp1100 ) { int i; - UINT8 slot_type; - const UINT8 id_type[4] = { 0xff, 0x00, 0x01, 0x04}; + uint8_t slot_type; + const uint8_t id_type[4] = { 0xff, 0x00, 0x01, 0x04}; for(i=0;i<8;i++) { slot_type = (ioport("SLOTS")->read() >> i*2) & 3; @@ -631,8 +631,8 @@ MACHINE_RESET_MEMBER( fp1100_state, fp1100 ) DRIVER_INIT_MEMBER( fp1100_state, fp1100 ) { - UINT8 *main = memregion("ipl")->base(); - UINT8 *wram = memregion("wram")->base(); + uint8_t *main = memregion("ipl")->base(); + uint8_t *wram = memregion("wram")->base(); membank("bankr0")->configure_entry(1, &wram[0x0000]); membank("bankr0")->configure_entry(0, &main[0x0000]); diff --git a/src/mame/drivers/fp200.cpp b/src/mame/drivers/fp200.cpp index 0bf5c3a0239..2c6608a3eef 100644 --- a/src/mame/drivers/fp200.cpp +++ b/src/mame/drivers/fp200.cpp @@ -35,24 +35,24 @@ public: // devices required_device m_maincpu; - UINT8 m_io_type; - UINT8 *m_chargen; - UINT8 m_keyb_mux; + uint8_t m_io_type; + uint8_t *m_chargen; + uint8_t m_keyb_mux; struct{ - UINT8 x; - UINT8 y; - UINT8 status; - std::unique_ptr vram; - std::unique_ptr attr; + uint8_t x; + uint8_t y; + uint8_t status; + std::unique_ptr vram; + std::unique_ptr attr; }m_lcd; - UINT8 read_lcd_attr(UINT16 X, UINT16 Y); - UINT8 read_lcd_vram(UINT16 X, UINT16 Y); - void write_lcd_attr(UINT16 X, UINT16 Y,UINT8 data); - void write_lcd_vram(UINT16 X, UINT16 Y,UINT8 data); + uint8_t read_lcd_attr(uint16_t X, uint16_t Y); + uint8_t read_lcd_vram(uint16_t X, uint16_t Y); + void write_lcd_attr(uint16_t X, uint16_t Y,uint8_t data); + void write_lcd_vram(uint16_t X, uint16_t Y,uint8_t data); // screen updates - 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); DECLARE_READ8_MEMBER(fp200_io_r); DECLARE_WRITE8_MEMBER(fp200_io_w); @@ -76,14 +76,14 @@ protected: void fp200_state::video_start() { - m_lcd.vram = make_unique_clear(20*64); - m_lcd.attr = make_unique_clear(20*64); + m_lcd.vram = make_unique_clear(20*64); + m_lcd.attr = make_unique_clear(20*64); } /* TODO: Very preliminary, I actually believe that the LCDC writes in a blitter fashion ... */ -UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { - UINT16 l_offs, r_offs; + uint16_t l_offs, r_offs; bitmap.fill(0, cliprect); @@ -117,7 +117,7 @@ UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, { for(int x=0;x<80;x++) { - UINT16 yoffs; + uint16_t yoffs; yoffs = y + l_offs; @@ -126,7 +126,7 @@ UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, if(m_lcd.attr[x/8+yoffs*20] == 0x60 || m_lcd.attr[x/8+yoffs*20] == 0x50) { - UINT8 vram,pix; + uint8_t vram,pix; vram = m_lcd.vram[x/8+yoffs*20]; pix = ((m_chargen[vram*8+(x & 7)]) >> (7-(yoffs & 7))) & 1; @@ -135,7 +135,7 @@ UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, /* else if(m_lcd.attr[x/8+yoffs*20] == 0x40) { - UINT8 vram,pix; + uint8_t vram,pix; vram = m_lcd.vram[x/8+yoffs*20]; pix = (vram) >> (7-(yoffs & 7)) & 1; @@ -148,7 +148,7 @@ UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, { for(int x=80;x<160;x++) { - UINT16 yoffs; + uint16_t yoffs; yoffs = y + r_offs; @@ -157,7 +157,7 @@ UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, if(m_lcd.attr[x/8+yoffs*20] == 0x60 || m_lcd.attr[x/8+yoffs*20] == 0x50) { - UINT8 vram,pix; + uint8_t vram,pix; vram = m_lcd.vram[x/8+yoffs*20]; pix = ((m_chargen[vram*8+(x & 7)]) >> (7-(yoffs & 7))) & 1; @@ -165,7 +165,7 @@ UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, } /*else if(m_lcd.attr[x/8+yoffs*20] == 0x40) { - UINT8 vram,pix; + uint8_t vram,pix; vram = m_lcd.vram[x/8+yoffs*20]; pix = (vram) >> (7-(yoffs & 7)) & 1; @@ -184,10 +184,10 @@ UINT32 fp200_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, [8] SSSS --YY Status code (1=vram type/0xb=attr type) / upper part of Y address [9] YYYY XXXX lower part of Y address / X address */ -UINT8 fp200_state::read_lcd_attr(UINT16 X, UINT16 Y) +uint8_t fp200_state::read_lcd_attr(uint16_t X, uint16_t Y) { - UINT16 base_offs; - UINT8 res = 0; + uint16_t base_offs; + uint8_t res = 0; for(int yi=0;yi<8;yi++) { @@ -202,10 +202,10 @@ UINT8 fp200_state::read_lcd_attr(UINT16 X, UINT16 Y) return res; } -UINT8 fp200_state::read_lcd_vram(UINT16 X, UINT16 Y) +uint8_t fp200_state::read_lcd_vram(uint16_t X, uint16_t Y) { - UINT16 base_offs; - UINT8 res = 0; + uint16_t base_offs; + uint8_t res = 0; for(int yi=0;yi<8;yi++) { @@ -222,7 +222,7 @@ UINT8 fp200_state::read_lcd_vram(UINT16 X, UINT16 Y) READ8_MEMBER(fp200_state::fp200_lcd_r) { - UINT8 res; + uint8_t res; res = 0; @@ -256,9 +256,9 @@ READ8_MEMBER(fp200_state::fp200_lcd_r) return res; } -void fp200_state::write_lcd_attr(UINT16 X, UINT16 Y,UINT8 data) +void fp200_state::write_lcd_attr(uint16_t X, uint16_t Y,uint8_t data) { - UINT16 base_offs; + uint16_t base_offs; for(int yi=0;yi<8;yi++) { @@ -274,9 +274,9 @@ void fp200_state::write_lcd_attr(UINT16 X, UINT16 Y,UINT8 data) } } -void fp200_state::write_lcd_vram(UINT16 X, UINT16 Y,UINT8 data) +void fp200_state::write_lcd_vram(uint16_t X, uint16_t Y,uint8_t data) { - UINT16 base_offs; + uint16_t base_offs; for(int yi=0;yi<8;yi++) { @@ -325,7 +325,7 @@ READ8_MEMBER(fp200_state::fp200_keyb_r) "KEY4", "KEY5", "KEY6", "KEY7", "KEY8", "KEY9", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED"}; - UINT8 res; + uint8_t res; if(offset == 0) res = ioport(keynames[m_keyb_mux])->read(); @@ -366,7 +366,7 @@ SOD = 1 */ READ8_MEMBER(fp200_state::fp200_io_r) { - UINT8 res; + uint8_t res; if(m_io_type == 0) { @@ -547,7 +547,7 @@ GFXDECODE_END void fp200_state::machine_start() { - UINT8 *raw_gfx = memregion("raw_gfx")->base(); + uint8_t *raw_gfx = memregion("raw_gfx")->base(); m_chargen = memregion("chargen")->base(); for(int i=0;i<0x800;i++) diff --git a/src/mame/drivers/fp6000.cpp b/src/mame/drivers/fp6000.cpp index fba366c95d9..a2fd2098fa6 100644 --- a/src/mame/drivers/fp6000.cpp +++ b/src/mame/drivers/fp6000.cpp @@ -36,13 +36,13 @@ public: m_palette(*this, "palette") { } - UINT8 *m_char_rom; - required_shared_ptr m_gvram; - required_shared_ptr m_vram; - UINT8 m_crtc_vreg[0x100],m_crtc_index; + uint8_t *m_char_rom; + required_shared_ptr m_gvram; + required_shared_ptr m_vram; + uint8_t m_crtc_vreg[0x100],m_crtc_index; struct { - UINT16 cmd; + uint16_t cmd; }m_key; DECLARE_READ8_MEMBER(fp6000_pcg_r); DECLARE_WRITE8_MEMBER(fp6000_pcg_w); @@ -56,7 +56,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_fp6000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fp6000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_devicem_crtc; required_device m_gfxdecode; @@ -85,12 +85,12 @@ void fp6000_state::video_start() #define mc6845_update_addr (((m_crtc_vreg[0x12]<<8) & 0x3f00) | (m_crtc_vreg[0x13] & 0xff)) -UINT32 fp6000_state::screen_update_fp6000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t fp6000_state::screen_update_fp6000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int xi,yi; - UINT8 *gfx_rom = memregion("pcg")->base(); - UINT32 count; + uint8_t *gfx_rom = memregion("pcg")->base(); + uint32_t count; count = 0; diff --git a/src/mame/drivers/freekick.cpp b/src/mame/drivers/freekick.cpp index 3706a9de1ca..6f4d93f3705 100644 --- a/src/mame/drivers/freekick.cpp +++ b/src/mame/drivers/freekick.cpp @@ -1194,7 +1194,7 @@ DRIVER_INIT_MEMBER(freekick_state,gigasb) DRIVER_INIT_MEMBER(freekick_state,pbillrds) { - UINT8 *decrypted_opcodes = auto_alloc_array(machine(), UINT8, 0x10000); + uint8_t *decrypted_opcodes = auto_alloc_array(machine(), uint8_t, 0x10000); mc8123_decode(memregion("maincpu")->base(), decrypted_opcodes, memregion("user1")->base(), 0x10000); membank("bank0d")->set_base(decrypted_opcodes); m_bank1d->configure_entries(0, 2, decrypted_opcodes + 0x8000, 0x4000); @@ -1202,7 +1202,7 @@ DRIVER_INIT_MEMBER(freekick_state,pbillrds) DRIVER_INIT_MEMBER(freekick_state,gigas) { - UINT8 *decrypted_opcodes = auto_alloc_array(machine(), UINT8, 0xc000); + uint8_t *decrypted_opcodes = auto_alloc_array(machine(), uint8_t, 0xc000); mc8123_decode(memregion("maincpu")->base(), decrypted_opcodes, memregion("user1")->base(), 0xc000); membank("bank0d")->set_base(decrypted_opcodes); m_bank1d->set_base(decrypted_opcodes + 0x8000); diff --git a/src/mame/drivers/fresh.cpp b/src/mame/drivers/fresh.cpp index 4bc828222ef..cbedc623176 100644 --- a/src/mame/drivers/fresh.cpp +++ b/src/mame/drivers/fresh.cpp @@ -44,10 +44,10 @@ public: tilemap_t *m_bg_tilemap; tilemap_t *m_bg_2_tilemap; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_bg_2_videoram; - required_shared_ptr m_attr_videoram; - required_shared_ptr m_attr_2_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_bg_2_videoram; + required_shared_ptr m_attr_videoram; + required_shared_ptr m_attr_2_videoram; DECLARE_WRITE16_MEMBER(fresh_bg_videoram_w); @@ -58,7 +58,7 @@ public: TILE_GET_INFO_MEMBER(get_fresh_bg_2_tile_info); - UINT16 m_d30000_value; + uint16_t m_d30000_value; DECLARE_WRITE16_MEMBER( d30000_write ) { @@ -95,7 +95,7 @@ public: virtual void video_start() override; - UINT32 screen_update_fresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -156,7 +156,7 @@ void fresh_state::video_start() m_bg_tilemap->set_transparent_pen(255); } -UINT32 fresh_state::screen_update_fresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t fresh_state::screen_update_fresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_2_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/drivers/fromanc2.cpp b/src/mame/drivers/fromanc2.cpp index 79bf11e54d5..b6b85fe9670 100644 --- a/src/mame/drivers/fromanc2.cpp +++ b/src/mame/drivers/fromanc2.cpp @@ -54,7 +54,7 @@ WRITE16_MEMBER(fromanc2_state::fromanc2_portselect_w) READ16_MEMBER(fromanc2_state::fromanc2_keymatrix_r) { - UINT16 ret; + uint16_t ret; switch (m_portselect) { @@ -477,7 +477,7 @@ MACHINE_START_MEMBER(fromanc2_state,fromanc4) MACHINE_START_MEMBER(fromanc2_state,fromanc2) { - m_bankedram = std::make_unique(0x4000 * 3); + m_bankedram = std::make_unique(0x4000 * 3); membank("bank1")->configure_entries(0, 4, memregion("sub")->base(), 0x4000); membank("bank2")->configure_entry(0, memregion("sub")->base() + 0x08000); diff --git a/src/mame/drivers/fromance.cpp b/src/mame/drivers/fromance.cpp index 19f61ff750a..f135a184c0d 100644 --- a/src/mame/drivers/fromance.cpp +++ b/src/mame/drivers/fromance.cpp @@ -876,7 +876,7 @@ GFXDECODE_END MACHINE_START_MEMBER(fromance_state,fromance) { - UINT8 *ROM = memregion("sub")->base(); + uint8_t *ROM = memregion("sub")->base(); membank("bank1")->configure_entries(0, 0x100, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/ft68m.cpp b/src/mame/drivers/ft68m.cpp index e8077b58b89..953ba0d28d1 100644 --- a/src/mame/drivers/ft68m.cpp +++ b/src/mame/drivers/ft68m.cpp @@ -35,16 +35,16 @@ public: DECLARE_READ16_MEMBER(status_r); DECLARE_READ16_MEMBER(switches_r); private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; - required_shared_ptr m_p_base; + required_shared_ptr m_p_base; required_device m_maincpu; required_device m_terminal; }; READ16_MEMBER( ft68m_state::keyin_r ) { - UINT16 ret = m_term_data; + uint16_t ret = m_term_data; m_term_data = 0; return ret << 8; } @@ -83,7 +83,7 @@ INPUT_PORTS_END void ft68m_state::machine_reset() { - UINT8* ROM = memregion("roms")->base(); + uint8_t* ROM = memregion("roms")->base(); memcpy(m_p_base, ROM, 8); m_maincpu->reset(); } diff --git a/src/mame/drivers/funkball.cpp b/src/mame/drivers/funkball.cpp index 8ad6ae5b66f..2fd5f95a6b8 100644 --- a/src/mame/drivers/funkball.cpp +++ b/src/mame/drivers/funkball.cpp @@ -93,19 +93,19 @@ public: , m_inputs(*this, "IN.%u", 0) { } - UINT8 m_funkball_config_reg_sel; - UINT8 m_funkball_config_regs[256]; - UINT32 m_cx5510_regs[256/4]; - std::unique_ptr m_bios_ram; + uint8_t m_funkball_config_reg_sel; + uint8_t m_funkball_config_regs[256]; + uint32_t m_cx5510_regs[256/4]; + std::unique_ptr m_bios_ram; - UINT32 m_biu_ctrl_reg[256/4]; + uint32_t m_biu_ctrl_reg[256/4]; - UINT32 flashbank_addr; + uint32_t flashbank_addr; // devices required_device m_voodoo; - required_shared_ptr m_unk_ram; + required_shared_ptr m_unk_ram; required_device m_flashbank; required_device m_terminal; required_ioport_array<16> m_inputs; @@ -116,19 +116,19 @@ public: DECLARE_READ8_MEMBER( serial_r ); DECLARE_WRITE8_MEMBER( serial_w ); - UINT8 funkball_config_reg_r(); - void funkball_config_reg_w(UINT8 data); + uint8_t funkball_config_reg_r(); + void funkball_config_reg_w(uint8_t data); virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); struct { /* PCI */ - UINT32 command; - UINT32 base_addr; + uint32_t command; + uint32_t base_addr; - UINT32 init_enable; + uint32_t init_enable; } m_voodoo_pci_regs; DECLARE_READ32_MEMBER(biu_ctrl_r); DECLARE_WRITE32_MEMBER(biu_ctrl_w); @@ -143,15 +143,15 @@ void funkball_state::video_start() { } -UINT32 funkball_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t funkball_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { return m_voodoo->voodoo_update(bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } -static UINT32 voodoo_0_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t voodoo_0_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { funkball_state* state = device->machine().driver_data(); - UINT32 val = 0; + uint32_t val = 0; printf("Voodoo PCI R: %x\n", reg); @@ -170,7 +170,7 @@ static UINT32 voodoo_0_pci_r(device_t *busdevice, device_t *device, int function return val; } -static void voodoo_0_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void voodoo_0_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { funkball_state* state = device->machine().driver_data(); @@ -194,7 +194,7 @@ static void voodoo_0_pci_w(device_t *busdevice, device_t *device, int function, } } -static UINT32 cx5510_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t cx5510_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { funkball_state *state = busdevice->machine().driver_data(); @@ -207,7 +207,7 @@ static UINT32 cx5510_pci_r(device_t *busdevice, device_t *device, int function, return state->m_cx5510_regs[reg/4]; } -static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { funkball_state *state = busdevice->machine().driver_data(); @@ -236,13 +236,13 @@ WRITE8_MEMBER( funkball_state::serial_w ) } } -UINT8 funkball_state::funkball_config_reg_r() +uint8_t funkball_state::funkball_config_reg_r() { //osd_printf_debug("funkball_config_reg_r %02X\n", funkball_config_reg_sel); return m_funkball_config_regs[m_funkball_config_reg_sel]; } -void funkball_state::funkball_config_reg_w(UINT8 data) +void funkball_state::funkball_config_reg_w(uint8_t data) { //osd_printf_debug("funkball_config_reg_w %02X, %02X\n", funkball_config_reg_sel, data); m_funkball_config_regs[m_funkball_config_reg_sel] = data; @@ -250,7 +250,7 @@ void funkball_state::funkball_config_reg_w(UINT8 data) READ8_MEMBER(funkball_state::io20_r) { - UINT8 r = 0; + uint8_t r = 0; // 0x22, 0x23, Cyrix configuration registers if (offset == 0x00) @@ -782,7 +782,7 @@ INPUT_PORTS_END void funkball_state::machine_start() { - m_bios_ram = std::make_unique(0x20000); + m_bios_ram = std::make_unique(0x20000); /* defaults, otherwise it won't boot */ m_unk_ram[0x010/4] = 0x2f8d85ff; diff --git a/src/mame/drivers/funkyjet.cpp b/src/mame/drivers/funkyjet.cpp index 44f4e923553..f49468be8e1 100644 --- a/src/mame/drivers/funkyjet.cpp +++ b/src/mame/drivers/funkyjet.cpp @@ -104,12 +104,12 @@ Notes: READ16_MEMBER( funkyjet_state::funkyjet_protection_region_0_146_r ) { -// UINT16 realdat = deco16_146_funkyjet_prot_r(space,offset&0x3ff,mem_mask); +// uint16_t realdat = deco16_146_funkyjet_prot_r(space,offset&0x3ff,mem_mask); int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, /* note, same bitswap as fghthist */ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); // if ((realdat & mem_mask) != (data & mem_mask)) // printf("returned %04x instead of %04x (real address %08x swapped addr %08x)\n", data, realdat, real_address, deco146_addr); @@ -123,7 +123,7 @@ WRITE16_MEMBER( funkyjet_state::funkyjet_protection_region_0_146_w ) int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, /* note, same bitswap as fghthist */ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } diff --git a/src/mame/drivers/funtech.cpp b/src/mame/drivers/funtech.cpp index 698f3229af7..3eef5ad4ff6 100644 --- a/src/mame/drivers/funtech.cpp +++ b/src/mame/drivers/funtech.cpp @@ -46,14 +46,14 @@ public: m_hopper(*this, "hopper"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_fgram; - required_shared_ptr m_reel1_ram; - required_shared_ptr m_reel2_ram; - required_shared_ptr m_reel3_ram; - required_shared_ptr m_reel1_scroll; - required_shared_ptr m_reel2_scroll; - required_shared_ptr m_reel3_scroll; - required_shared_ptr m_reel1_alt_scroll; + required_shared_ptr m_fgram; + required_shared_ptr m_reel1_ram; + required_shared_ptr m_reel2_ram; + required_shared_ptr m_reel3_ram; + required_shared_ptr m_reel1_scroll; + required_shared_ptr m_reel2_scroll; + required_shared_ptr m_reel3_scroll; + required_shared_ptr m_reel1_alt_scroll; INTERRUPT_GEN_MEMBER(funtech_vblank_interrupt); @@ -63,7 +63,7 @@ public: DECLARE_WRITE8_MEMBER(funtech_vreg_w); - UINT8 m_vreg; + uint8_t m_vreg; tilemap_t *m_fg_tilemap; @@ -86,7 +86,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_funtech(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_funtech(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_hopper; required_device m_gfxdecode; @@ -188,7 +188,7 @@ WRITE8_MEMBER(fun_tech_corp_state::fgram_w) } -UINT32 fun_tech_corp_state::screen_update_funtech(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t fun_tech_corp_state::screen_update_funtech(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); diff --git a/src/mame/drivers/funworld.cpp b/src/mame/drivers/funworld.cpp index 1e0b4e18a4a..e79f7e6966e 100644 --- a/src/mame/drivers/funworld.cpp +++ b/src/mame/drivers/funworld.cpp @@ -1079,11 +1079,11 @@ static ADDRESS_MAP_START( funworld_map, AS_PROGRAM, 8, funworld_state ) AM_RANGE(0xc000, 0xffff) AM_ROM ADDRESS_MAP_END -static UINT8 funquiz_question_bank = 0x80; +static uint8_t funquiz_question_bank = 0x80; READ8_MEMBER(funworld_state::questions_r) { - UINT8* quiz = memregion("questions")->base(); + uint8_t* quiz = memregion("questions")->base(); int extraoffset = ((funquiz_question_bank & 0x1f) * 0x8000); // if 0x80 is set, read the 2nd half of the question rom (contains header info) @@ -2950,13 +2950,13 @@ READ8_MEMBER(funworld_state::funquiz_ay8910_b_r) MACHINE_START_MEMBER(funworld_state, lunapark) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0], 0x8000); } MACHINE_RESET_MEMBER(funworld_state, lunapark) { - UINT8 seldsw = (ioport("SELDSW")->read() ); + uint8_t seldsw = (ioport("SELDSW")->read() ); popmessage("ROM Bank: %02X", seldsw); membank("bank1")->set_entry(seldsw); @@ -6042,7 +6042,7 @@ DRIVER_INIT_MEMBER(funworld_state, tabblue) *****************************************************************************************************/ int x, na, nb, nad, nbd; - UINT8 *src = memregion( "gfx1" )->base(); + uint8_t *src = memregion( "gfx1" )->base(); for (x=0x0000; x < 0x10000; x++) @@ -6073,7 +6073,7 @@ DRIVER_INIT_MEMBER(funworld_state, magicd2b) ******************************************************************/ { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xc1c6] = 0x92; } @@ -6083,8 +6083,8 @@ DRIVER_INIT_MEMBER(funworld_state, magicd2c) /*** same as blue TAB PCB, with the magicd2a patch ***/ { int x, na, nb, nad, nbd; - UINT8 *src = memregion( "gfx1" )->base(); - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *src = memregion( "gfx1" )->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (x=0x0000; x < 0x10000; x++) { @@ -6104,7 +6104,7 @@ DRIVER_INIT_MEMBER(funworld_state, magicd2c) DRIVER_INIT_MEMBER(funworld_state, mongolnw) { /* temporary patch to avoid hardware errors for debug purposes */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x9115] = 0xa5; @@ -6116,7 +6116,7 @@ DRIVER_INIT_MEMBER(funworld_state, mongolnw) DRIVER_INIT_MEMBER(funworld_state, soccernw) { /* temporary patch to avoid hardware errors for debug purposes */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x80b2] = 0xa9; ROM[0x80b3] = 0x00; @@ -6149,15 +6149,15 @@ DRIVER_INIT_MEMBER(funworld_state, saloon) *************************************************/ { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); int start = 0x8000; - UINT8 *gfxrom = memregion("gfx1")->base(); + uint8_t *gfxrom = memregion("gfx1")->base(); int sizeg = memregion("gfx1")->bytes(); int startg = 0; - UINT8 *prom = memregion("proms")->base(); + uint8_t *prom = memregion("proms")->base(); int sizep = memregion("proms")->bytes(); int startp = 0; @@ -6175,7 +6175,7 @@ DRIVER_INIT_MEMBER(funworld_state, saloon) } { - std::vector buffer(size); + std::vector buffer(size); memcpy(&buffer[0], rom, size); @@ -6194,7 +6194,7 @@ DRIVER_INIT_MEMBER(funworld_state, saloon) ******************************/ { - std::vector buffer(sizeg); + std::vector buffer(sizeg); memcpy(&buffer[0], gfxrom, sizeg); /* address lines swap: fedcba9876543210 -> fedcb67584a39012 */ @@ -6219,7 +6219,7 @@ DRIVER_INIT_MEMBER(funworld_state, saloon) } { - std::vector buffer(sizep); + std::vector buffer(sizep); memcpy(&buffer[0], prom, sizep); @@ -6244,14 +6244,14 @@ DRIVER_INIT_MEMBER(funworld_state, multiwin) ******************************************************/ { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int x; for (x=0x8000; x < 0x10000; x++) { ROM[x] = ROM[x] ^ 0x91; - UINT8 code; + uint8_t code; ROM[x] = BITSWAP8(ROM[x],5,6,7,2,3,0,1,4); @@ -6275,14 +6275,14 @@ DRIVER_INIT_MEMBER(funworld_state, royalcdc) ******************************************************/ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int x; for (x=0x8000; x < 0x10000; x++) { ROM[x] = ROM[x] ^ 0x22; - UINT8 code; + uint8_t code; // this seems correct for the data, plaintext decrypts fine ROM[x] = BITSWAP8(ROM[x],2,6,7,4,3,1,5,0); @@ -6332,11 +6332,11 @@ DRIVER_INIT_MEMBER(funworld_state, dino4) ******************************************************/ { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); int start = 0x8000; - UINT8 *gfxrom = memregion("gfx1")->base(); + uint8_t *gfxrom = memregion("gfx1")->base(); int sizeg = memregion("gfx1")->bytes(); int startg = 0; @@ -6354,7 +6354,7 @@ DRIVER_INIT_MEMBER(funworld_state, dino4) } { - std::vector buffer(size); + std::vector buffer(size); memcpy(&buffer[0], rom, size); @@ -6373,7 +6373,7 @@ DRIVER_INIT_MEMBER(funworld_state, dino4) ******************************/ { - std::vector buffer(sizeg); + std::vector buffer(sizeg); memcpy(&buffer[0], gfxrom, sizeg); /* address lines swap: fedcba9876543210 -> fedcb67584a39012 */ @@ -6395,11 +6395,11 @@ DRIVER_INIT_MEMBER(funworld_state, ctunk) *********************************************************/ { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); int start = 0x8000; - //UINT8 *buffer; + //uint8_t *buffer; int i;// a; /***************************** @@ -6413,7 +6413,7 @@ DRIVER_INIT_MEMBER(funworld_state, ctunk) rom[i] = BITSWAP8(rom[i], 5, 6, 7, 3, 4, 0, 1, 2); } - //buffer = std::make_unique(size); + //buffer = std::make_unique(size); //memcpy(buffer, rom, size); @@ -6422,8 +6422,8 @@ DRIVER_INIT_MEMBER(funworld_state, ctunk) *****************************/ int x, na, nb, nad, nbd; - UINT8 *src = memregion( "gfx1" )->base(); - //UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *src = memregion( "gfx1" )->base(); + //uint8_t *ROM = memregion("maincpu")->base(); for (x=0x0000; x < 0x10000; x++) { @@ -6438,7 +6438,7 @@ DRIVER_INIT_MEMBER(funworld_state, ctunk) } -static void decrypt_rcdino4(UINT8 *rom, int size, UINT8 *gfxrom, int sizeg, UINT8 *src) +static void decrypt_rcdino4(uint8_t *rom, int size, uint8_t *gfxrom, int sizeg, uint8_t *src) { int start = 0x0000; @@ -6458,7 +6458,7 @@ static void decrypt_rcdino4(UINT8 *rom, int size, UINT8 *gfxrom, int sizeg, UINT } { - std::vector buffer(size); + std::vector buffer(size); memcpy(&buffer[0], rom, size); @@ -6477,7 +6477,7 @@ static void decrypt_rcdino4(UINT8 *rom, int size, UINT8 *gfxrom, int sizeg, UINT ******************************/ { - std::vector buffer(sizeg); + std::vector buffer(sizeg); memcpy(&buffer[0], gfxrom, sizeg); /* address lines swap: fedcba9876543210 -> fedcb67584a39012 */ @@ -6503,7 +6503,7 @@ static void decrypt_rcdino4(UINT8 *rom, int size, UINT8 *gfxrom, int sizeg, UINT -static UINT8 rcdino4_add[] = +static uint8_t rcdino4_add[] = { /* 0 1 2 3 4 5 6 7 8 9 a b c d e f*/ /*0*/ 1, 9, 9, 9, 9, 2, 9, 9, 1, 2, 1, 9, 9, 3, 9, 9, @@ -6524,7 +6524,7 @@ static UINT8 rcdino4_add[] = /*f*/ 2, 9, 9, 9, 9, 2, 9, 9, 1, 3, 1, 9, 9, 3, 9, 9 }; -static UINT8 rcdino4_keys40[] = +static uint8_t rcdino4_keys40[] = { /* 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d*/ 0x36, 0x54, 0x47, 0x6b, 0xce, 0x95, 0xa2, 0x66, 0x3a, 0x46, 0x53, 0xd7, 0xc4, 0xa4, @@ -6534,7 +6534,7 @@ static UINT8 rcdino4_keys40[] = 0x56 }; -static UINT8 rcdino4_keys80[] = +static uint8_t rcdino4_keys80[] = { /* 81 82 83 84 85 */ 0xb8, 0x32, 0x1c, 0x23, 0xe2, @@ -6601,7 +6601,7 @@ DRIVER_INIT_MEMBER(funworld_state, rcdino4) ******************************************************/ { int i, j; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); decrypt_rcdino4(rom, memregion("maincpu")->bytes(), memregion("gfx1")->base(), memregion("gfx1")->bytes(), memregion( "gfx1" )->base()); @@ -6609,13 +6609,13 @@ DRIVER_INIT_MEMBER(funworld_state, rcdino4) for (i = 0x40; i < (0x40 + ARRAY_LENGTH(rcdino4_keys40));) { - UINT8 key; + uint8_t key; key = rcdino4_keys40[i - 0x40]; do { - UINT8 c; + uint8_t c; int add; c = rom[(i << 8) + j] ^ key; @@ -6643,13 +6643,13 @@ DRIVER_INIT_MEMBER(funworld_state, rcdino4) do { - UINT8 key; + uint8_t key; key = rcdino4_keys80[i - 0x81]; do { - UINT8 c; + uint8_t c; int add; c = rom[(i << 8) + j] ^ key; diff --git a/src/mame/drivers/funybubl.cpp b/src/mame/drivers/funybubl.cpp index a1f7937d76e..f961f6faf3b 100644 --- a/src/mame/drivers/funybubl.cpp +++ b/src/mame/drivers/funybubl.cpp @@ -201,7 +201,7 @@ GFXDECODE_END void funybubl_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); save_item(NAME(m_banked_vram)); diff --git a/src/mame/drivers/fuukifg2.cpp b/src/mame/drivers/fuukifg2.cpp index 37a090df5c7..6898e4be8c3 100644 --- a/src/mame/drivers/fuukifg2.cpp +++ b/src/mame/drivers/fuukifg2.cpp @@ -63,8 +63,8 @@ To Do: WRITE16_MEMBER(fuuki16_state::vregs_w) { - UINT16 old_data = m_vregs[offset]; - UINT16 new_data = COMBINE_DATA(&m_vregs[offset]); + uint16_t old_data = m_vregs[offset]; + uint16_t new_data = COMBINE_DATA(&m_vregs[offset]); if ((offset == 0x1c/2) && old_data != new_data) { const rectangle &visarea = m_screen->visible_area(); @@ -419,7 +419,7 @@ void fuuki16_state::device_timer(emu_timer &timer, device_timer_id id, int param void fuuki16_state::machine_start() { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 3, &ROM[0x10000], 0x8000); diff --git a/src/mame/drivers/fuukifg3.cpp b/src/mame/drivers/fuukifg3.cpp index 24bc9f565f4..24587f937dd 100644 --- a/src/mame/drivers/fuukifg3.cpp +++ b/src/mame/drivers/fuukifg3.cpp @@ -175,7 +175,7 @@ FG-3J ROM-J 507KA0301P04 Rev:1.3 READ32_MEMBER(fuuki32_state::snd_020_r) { machine().scheduler().synchronize(); - UINT32 retdata = m_shared_ram[offset * 2] << 16 | m_shared_ram[(offset * 2) + 1]; + uint32_t retdata = m_shared_ram[offset * 2] << 16 | m_shared_ram[(offset * 2) + 1]; return retdata; } @@ -243,7 +243,7 @@ WRITE8_MEMBER(fuuki32_state::sound_bw_w) READ8_MEMBER(fuuki32_state::snd_z80_r) { - UINT8 retdata = m_shared_ram[offset]; + uint8_t retdata = m_shared_ram[offset]; return retdata; } @@ -521,7 +521,7 @@ void fuuki32_state::device_timer(emu_timer &timer, device_timer_id id, int param void fuuki32_state::machine_start() { - UINT8 *ROM = memregion("soundcpu")->base(); + uint8_t *ROM = memregion("soundcpu")->base(); membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000); diff --git a/src/mame/drivers/g627.cpp b/src/mame/drivers/g627.cpp index 5b4dbdad696..7631bc5bbaf 100644 --- a/src/mame/drivers/g627.cpp +++ b/src/mame/drivers/g627.cpp @@ -64,9 +64,9 @@ public: DECLARE_WRITE8_MEMBER(disp_w); DECLARE_WRITE8_MEMBER(lamp_w); private: - UINT8 m_seg[6]; - UINT8 m_portc; - UINT8 m_motor; + uint8_t m_seg[6]; + uint8_t m_portc; + uint8_t m_motor; bool m_type; required_device m_maincpu; required_ioport_array<7> m_switch; @@ -227,7 +227,7 @@ WRITE8_MEMBER( g627_state::portc_w ) // save segments until we can write the digits WRITE8_MEMBER( g627_state::disp_w ) { - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 offset <<= 1; m_seg[offset] = patterns[data>>4]; m_seg[++offset] = patterns[data&15]; @@ -254,7 +254,7 @@ WRITE8_MEMBER( g627_state::lamp_w ) */ - UINT16 solenoid = (offset << 8) | data; + uint16_t solenoid = (offset << 8) | data; switch (solenoid) { case 0x0101: diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp index 27491d2e0ee..14cfeb30156 100644 --- a/src/mame/drivers/gaelco3d.cpp +++ b/src/mame/drivers/gaelco3d.cpp @@ -188,16 +188,16 @@ void gaelco3d_state::machine_start() MACHINE_RESET_MEMBER(gaelco3d_state,common) { - UINT16 *src; + uint16_t *src; int i; m_framenum = 0; /* boot the ADSP chip */ - src = (UINT16 *)memregion("user1")->base(); + src = (uint16_t *)memregion("user1")->base(); for (i = 0; i < (src[3] & 0xff) * 8; i++) { - UINT32 opcode = ((src[i*4+0] & 0xff) << 16) | ((src[i*4+1] & 0xff) << 8) | (src[i*4+2] & 0xff); + uint32_t opcode = ((src[i*4+0] & 0xff) << 16) | ((src[i*4+1] & 0xff) << 8) | (src[i*4+2] & 0xff); m_adsp_ram_base[i] = opcode; } @@ -272,7 +272,7 @@ WRITE32_MEMBER(gaelco3d_state::irq_ack32_w) READ16_MEMBER(gaelco3d_state::eeprom_data_r) { - UINT32 result = 0xffff; + uint32_t result = 0xffff; if (ACCESSING_BITS_0_7) { @@ -295,7 +295,7 @@ READ32_MEMBER(gaelco3d_state::eeprom_data32_r) return (eeprom_data_r(space, 0, mem_mask >> 16) << 16) | 0xffff; else if (ACCESSING_BITS_0_7) { - UINT8 data = m_serial->data_r(space,0); + uint8_t data = m_serial->data_r(space,0); if (LOG) logerror("%06X:read(%02X) = %08X & %08X\n", m_maincpu->pc(), offset, data, mem_mask); return data | 0xffffff00; @@ -454,8 +454,8 @@ WRITE16_MEMBER(gaelco3d_state::analog_port_latch_w) READ32_MEMBER(gaelco3d_state::tms_m68k_ram_r) { -// logerror("%06X:tms_m68k_ram_r(%04X) = %08X\n", space.device().safe_pc(), offset, !(offset & 1) ? ((INT32)m_m68k_ram_base[offset/2] >> 16) : (int)(INT16)m_m68k_ram_base[offset/2]); - return (INT32)(INT16)m_m68k_ram_base[offset ^ m_tms_offset_xor]; +// logerror("%06X:tms_m68k_ram_r(%04X) = %08X\n", space.device().safe_pc(), offset, !(offset & 1) ? ((int32_t)m_m68k_ram_base[offset/2] >> 16) : (int)(int16_t)m_m68k_ram_base[offset/2]); + return (int32_t)(int16_t)m_m68k_ram_base[offset ^ m_tms_offset_xor]; } @@ -613,7 +613,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(gaelco3d_state::adsp_autobuffer_irq) /* copy the current data into the buffer */ // logerror("ADSP buffer: I%d=%04X incs=%04X size=%04X\n", m_adsp_ireg, reg, m_adsp_incs, m_adsp_size); if (m_adsp_incs) - dmadac_transfer(&m_dmadac[0], SOUND_CHANNELS, m_adsp_incs, SOUND_CHANNELS * m_adsp_incs, m_adsp_size / (SOUND_CHANNELS * m_adsp_incs), (INT16 *)&m_adsp_fastram_base[reg - 0x3800]); + dmadac_transfer(&m_dmadac[0], SOUND_CHANNELS, m_adsp_incs, SOUND_CHANNELS * m_adsp_incs, m_adsp_size / (SOUND_CHANNELS * m_adsp_incs), (int16_t *)&m_adsp_fastram_base[reg - 0x3800]); /* increment it */ reg += m_adsp_size; @@ -646,7 +646,7 @@ WRITE32_MEMBER(gaelco3d_state::adsp_tx_callback) { /* get the autobuffer registers */ int mreg, lreg; - UINT16 source; + uint16_t source; attotime sample_period; m_adsp_ireg = (m_adsp_control_regs[S1_AUTOBUF_REG] >> 9) & 7; diff --git a/src/mame/drivers/gaiden.cpp b/src/mame/drivers/gaiden.cpp index d6556c5481d..6fb878d3df6 100644 --- a/src/mame/drivers/gaiden.cpp +++ b/src/mame/drivers/gaiden.cpp @@ -1562,12 +1562,12 @@ DRIVER_INIT_MEMBER(gaiden_state,raiga) void gaiden_state::descramble_drgnbowl(int descramble_cpu) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); if (descramble_cpu) { - std::vector buffer(size); + std::vector buffer(size); memcpy(&buffer[0], ROM, size); for( i = 0; i < size; i++ ) @@ -1584,7 +1584,7 @@ void gaiden_state::descramble_drgnbowl(int descramble_cpu) ROM = memregion("gfx2")->base(); size = memregion("gfx2")->bytes(); { - std::vector buffer(size); + std::vector buffer(size); memcpy(&buffer[0],ROM,size); for( i = 0; i < size; i++ ) @@ -1613,13 +1613,13 @@ DRIVER_INIT_MEMBER(gaiden_state,drgnbowla) descramble_drgnbowl(0); } -void gaiden_state::descramble_mastninj_gfx(UINT8* src) +void gaiden_state::descramble_mastninj_gfx(uint8_t* src) { int len = 0x80000; /* rearrange gfx */ { - std::vector buffer(len); + std::vector buffer(len); int i; for (i = 0;i < len; i++) { @@ -1635,7 +1635,7 @@ void gaiden_state::descramble_mastninj_gfx(UINT8* src) } { - std::vector buffer(len); + std::vector buffer(len); int i; for (i = 0; i < len; i++) { diff --git a/src/mame/drivers/gal3.cpp b/src/mame/drivers/gal3.cpp index 4fcb523ade2..1004063b06e 100644 --- a/src/mame/drivers/gal3.cpp +++ b/src/mame/drivers/gal3.cpp @@ -144,13 +144,13 @@ public: m_rso_shared_ram(*this, "rso_shared_ram"), m_generic_paletteram_16(*this, "paletteram") { } - UINT32 *m_mpSharedRAM0; - //UINT32 *m_mpSharedRAM1; - UINT16 m_namcos21_video_enable; - required_shared_ptr m_rso_shared_ram; - optional_shared_ptr m_generic_paletteram_16; - UINT32 m_led_mst; - UINT32 m_led_slv; + uint32_t *m_mpSharedRAM0; + //uint32_t *m_mpSharedRAM1; + uint16_t m_namcos21_video_enable; + required_shared_ptr m_rso_shared_ram; + optional_shared_ptr m_generic_paletteram_16; + uint32_t m_led_mst; + uint32_t m_led_slv; DECLARE_READ32_MEMBER(led_mst_r); DECLARE_WRITE32_MEMBER(led_mst_w); DECLARE_READ32_MEMBER(led_slv_r); @@ -162,7 +162,7 @@ public: DECLARE_READ32_MEMBER(rso_r); DECLARE_WRITE32_MEMBER(rso_w); DECLARE_VIDEO_START(gal3); - UINT32 screen_update_gal3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gal3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void update_palette( ); }; @@ -186,7 +186,7 @@ VIDEO_START_MEMBER(gal3_state,gal3) void gal3_state::update_palette( ) { int i; - INT16 data1,data2; + int16_t data1,data2; int r,g,b; for( i=0; i>16; @@ -320,7 +320,7 @@ READ32_MEMBER(gal3_state::rso_r) WRITE32_MEMBER(gal3_state::rso_w) { - UINT32 v; + uint32_t v; offset *= 2; v = (m_rso_shared_ram[offset]<<16)|m_rso_shared_ram[offset+1]; COMBINE_DATA( &v ); diff --git a/src/mame/drivers/galaga.cpp b/src/mame/drivers/galaga.cpp index 891cde3a576..bb81a8c1fcc 100644 --- a/src/mame/drivers/galaga.cpp +++ b/src/mame/drivers/galaga.cpp @@ -800,7 +800,7 @@ WRITE8_MEMBER(galaga_state::out_1) READ8_MEMBER(galaga_state::namco_52xx_rom_r) { - UINT32 length = memregion("52xx")->bytes(); + uint32_t length = memregion("52xx")->bytes(); //printf("ROM read %04X\n", offset); if (!(offset & 0x1000)) offset = (offset & 0xfff) | 0x0000; @@ -3361,7 +3361,7 @@ ROM_END DRIVER_INIT_MEMBER(galaga_state,galaga) { /* swap bytes for flipped character so we can decode them together with normal characters */ - UINT8 *rom = memregion("gfx1")->base(); + uint8_t *rom = memregion("gfx1")->base(); int i, len = memregion("gfx1")->bytes(); for (i = 0;i < len;i++) @@ -3386,7 +3386,7 @@ DRIVER_INIT_MEMBER(galaga_state,gatsbee) DRIVER_INIT_MEMBER(xevious_state,xevious) { - UINT8 *rom; + uint8_t *rom; int i; rom = memregion("gfx3")->base() + 0x5000; @@ -3397,7 +3397,7 @@ DRIVER_INIT_MEMBER(xevious_state,xevious) DRIVER_INIT_MEMBER(xevious_state,xevios) { int A; - UINT8 *rom; + uint8_t *rom; /* convert one of the sprite ROMs to the format used by Xevious */ diff --git a/src/mame/drivers/galaxi.cpp b/src/mame/drivers/galaxi.cpp index ae4e7720194..8fbdf6b1dea 100644 --- a/src/mame/drivers/galaxi.cpp +++ b/src/mame/drivers/galaxi.cpp @@ -61,12 +61,12 @@ public: { } /* memory pointers */ - required_shared_ptr m_bg1_ram; - required_shared_ptr m_bg2_ram; - required_shared_ptr m_bg3_ram; - required_shared_ptr m_bg4_ram; - required_shared_ptr m_fg_ram; -// UINT16 * m_nvram; // currently this uses generic nvram handling + required_shared_ptr m_bg1_ram; + required_shared_ptr m_bg2_ram; + required_shared_ptr m_bg3_ram; + required_shared_ptr m_bg4_ram; + required_shared_ptr m_fg_ram; +// uint16_t * m_nvram; // currently this uses generic nvram handling /* video-related */ tilemap_t *m_bg1_tmap; @@ -75,13 +75,13 @@ public: tilemap_t *m_bg4_tmap; tilemap_t *m_fg_tmap; - UINT16 m_bg3_xscroll; - UINT16 m_bg3_yscroll; + uint16_t m_bg3_xscroll; + uint16_t m_bg3_yscroll; /* misc */ int m_hopper; int m_ticket; - UINT16 m_out; + uint16_t m_out; DECLARE_WRITE16_MEMBER(galaxi_bg1_w); DECLARE_WRITE16_MEMBER(galaxi_bg2_w); @@ -101,7 +101,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_galaxi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galaxi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void show_out( ); required_device m_maincpu; required_device m_gfxdecode; @@ -116,31 +116,31 @@ public: TILE_GET_INFO_MEMBER(galaxi_state::get_bg1_tile_info) { - UINT16 code = m_bg1_ram[tile_index]; + uint16_t code = m_bg1_ram[tile_index]; SET_TILE_INFO_MEMBER(0, code, 0x10 + (code >> 12), 0); } TILE_GET_INFO_MEMBER(galaxi_state::get_bg2_tile_info) { - UINT16 code = m_bg2_ram[tile_index]; + uint16_t code = m_bg2_ram[tile_index]; SET_TILE_INFO_MEMBER(0, code, 0x10 + (code >> 12), 0); } TILE_GET_INFO_MEMBER(galaxi_state::get_bg3_tile_info) { - UINT16 code = m_bg3_ram[tile_index]; + uint16_t code = m_bg3_ram[tile_index]; SET_TILE_INFO_MEMBER(0, code, (code >> 12), 0); } TILE_GET_INFO_MEMBER(galaxi_state::get_bg4_tile_info) { - UINT16 code = m_bg4_ram[tile_index]; + uint16_t code = m_bg4_ram[tile_index]; SET_TILE_INFO_MEMBER(0, code, (code >> 12), 0); } TILE_GET_INFO_MEMBER(galaxi_state::get_fg_tile_info) { - UINT16 code = m_fg_ram[tile_index]; + uint16_t code = m_fg_ram[tile_index]; SET_TILE_INFO_MEMBER(1, code, 0x20 + (code >> 12), 0); } @@ -191,7 +191,7 @@ void galaxi_state::video_start() m_fg_tmap->set_transparent_pen(0); } -UINT32 galaxi_state::screen_update_galaxi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t galaxi_state::screen_update_galaxi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg3_tmap->set_scrollx(m_bg3_xscroll); m_bg3_tmap->set_scrolly(m_bg3_yscroll); diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp index ce8bb01b2eb..8dad032bb3c 100644 --- a/src/mame/drivers/galaxian.cpp +++ b/src/mame/drivers/galaxian.cpp @@ -750,7 +750,7 @@ WRITE8_MEMBER(galaxian_state::coin_count_1_w) READ8_MEMBER(galaxian_state::konami_ay8910_r) { /* the decoding here is very simplistic, and you can address both simultaneously */ - UINT8 result = 0xff; + uint8_t result = 0xff; if (offset & 0x20) result &= m_ay8910_1->data_r(space, 0); if (offset & 0x80) result &= m_ay8910_0->data_r(space, 0); return result; @@ -775,7 +775,7 @@ WRITE8_MEMBER(galaxian_state::konami_ay8910_w) WRITE8_MEMBER(galaxian_state::konami_sound_control_w) { - UINT8 old = m_konami_sound_control; + uint8_t old = m_konami_sound_control; m_konami_sound_control = data; /* the inverse of bit 3 clocks the flip flop to signal an INT */ @@ -804,8 +804,8 @@ READ8_MEMBER(galaxian_state::konami_sound_timer_r) current counter index, we use the sound cpu clock times 8 mod 16*16*2*8*5*2. */ - UINT32 cycles = (m_audiocpu->total_cycles() * 8) % (UINT64)(16*16*2*8*5*2); - UINT8 hibit = 0; + uint32_t cycles = (m_audiocpu->total_cycles() * 8) % (uint64_t)(16*16*2*8*5*2); + uint8_t hibit = 0; /* separate the high bit from the others */ if (cycles >= 16*16*2*8*5) @@ -836,7 +836,7 @@ WRITE8_MEMBER(galaxian_state::konami_sound_filter_w) if (machine().device(ayname[which]) != nullptr) for (chan = 0; chan < 3; chan++) { - UINT8 bits = (offset >> (2 * chan + 6 * (1 - which))) & 3; + uint8_t bits = (offset >> (2 * chan + 6 * (1 - which))) & 3; /* low bit goes to 0.22uF capacitor = 220000pF */ /* high bit goes to 0.047uF capacitor = 47000pF */ @@ -866,7 +866,7 @@ WRITE8_MEMBER(galaxian_state::konami_portc_1_w) READ8_MEMBER(galaxian_state::theend_ppi8255_r) { /* the decoding here is very simplistic, and you can address both simultaneously */ - UINT8 result = 0xff; + uint8_t result = 0xff; if (offset & 0x0100) result &= m_ppi8255_0->read(space, offset & 3); if (offset & 0x0200) result &= m_ppi8255_1->read(space, offset & 3); return result; @@ -962,7 +962,7 @@ READ8_MEMBER(galaxian_state::explorer_sound_latch_r) READ8_MEMBER(galaxian_state::sfx_sample_io_r) { /* the decoding here is very simplistic, and you can address both simultaneously */ - UINT8 result = 0xff; + uint8_t result = 0xff; if (offset & 0x04) result &= m_ppi8255_2->read(space, offset & 3); return result; } @@ -978,7 +978,7 @@ WRITE8_MEMBER(galaxian_state::sfx_sample_io_w) WRITE8_MEMBER(galaxian_state::sfx_sample_control_w) { - UINT8 old = m_sfx_sample_control; + uint8_t old = m_sfx_sample_control; m_sfx_sample_control = data; /* the inverse of bit 0 clocks the flip flop to signal an INT */ @@ -1013,7 +1013,7 @@ READ8_MEMBER(galaxian_state::monsterz_protection_r) void galaxian_state::monsterz_set_latch() { // read from a rom (which one?? "a-3e.k3" from audiocpu ($2700-$2fff) looks very suspicious) - UINT8 *rom = memregion("audiocpu")->base(); + uint8_t *rom = memregion("audiocpu")->base(); m_protection_result = rom[0x2000 | (m_protection_state & 0x1fff)]; // probably needs a BITSWAP8 // and an irq on the main z80 afterwards @@ -1054,7 +1054,7 @@ WRITE8_MEMBER(galaxian_state::monsterz_portc_1_w) READ8_MEMBER(galaxian_state::frogger_ppi8255_r) { /* the decoding here is very simplistic, and you can address both simultaneously */ - UINT8 result = 0xff; + uint8_t result = 0xff; if (offset & 0x1000) result &= m_ppi8255_1->read(space, (offset >> 1) & 3); if (offset & 0x2000) result &= m_ppi8255_0->read(space, (offset >> 1) & 3); return result; @@ -1072,7 +1072,7 @@ WRITE8_MEMBER(galaxian_state::frogger_ppi8255_w) READ8_MEMBER(galaxian_state::frogger_ay8910_r) { /* the decoding here is very simplistic */ - UINT8 result = 0xff; + uint8_t result = 0xff; if (offset & 0x40) result &= m_ay8910_0->data_r(space, 0); return result; } @@ -1092,7 +1092,7 @@ WRITE8_MEMBER(galaxian_state::frogger_ay8910_w) READ8_MEMBER(galaxian_state::frogger_sound_timer_r) { /* same as regular Konami sound but with bits 3,5 swapped */ - UINT8 konami_value = konami_sound_timer_r(space, 0); + uint8_t konami_value = konami_sound_timer_r(space, 0); return BITSWAP8(konami_value, 7,6,3,4,5,2,1,0); } @@ -1119,7 +1119,7 @@ IRQ_CALLBACK_MEMBER(galaxian_state::froggermc_audiocpu_irq_ack) READ8_MEMBER(galaxian_state::frogf_ppi8255_r) { /* the decoding here is very simplistic, and you can address both simultaneously */ - UINT8 result = 0xff; + uint8_t result = 0xff; if (offset & 0x1000) result &= m_ppi8255_0->read(space, (offset >> 3) & 3); if (offset & 0x2000) result &= m_ppi8255_1->read(space, (offset >> 3) & 3); return result; @@ -1157,7 +1157,7 @@ WRITE8_MEMBER(galaxian_state::turtles_ppi8255_1_w){ m_ppi8255_1->write(space, (o READ8_MEMBER(galaxian_state::scorpion_ay8910_r) { /* the decoding here is very simplistic, and you can address both simultaneously */ - UINT8 result = 0xff; + uint8_t result = 0xff; if (offset & 0x08) result &= m_ay8910_2->data_r(space, 0); if (offset & 0x20) result &= m_ay8910_1->data_r(space, 0); if (offset & 0x80) result &= m_ay8910_0->data_r(space, 0); @@ -1179,8 +1179,8 @@ WRITE8_MEMBER(galaxian_state::scorpion_ay8910_w) READ8_MEMBER(galaxian_state::scorpion_protection_r) { - UINT16 paritybits; - UINT8 parity = 0; + uint16_t paritybits; + uint8_t parity = 0; /* compute parity of the current (bitmask & $CE29) */ for (paritybits = m_protection_state & 0xce29; paritybits != 0; paritybits >>= 1) @@ -4902,7 +4902,7 @@ CUSTOM_INPUT_MEMBER(galaxian_state::moonwar_dial_r) signed char dialread = ioport(dialname[p])->read(); - UINT8 ret; + uint8_t ret; if (dialread < 0) m_direction[p] = 0x00; else if (dialread > 0) m_direction[p] = 0x10; @@ -5706,7 +5706,7 @@ MACHINE_CONFIG_END TIMER_DEVICE_CALLBACK_MEMBER(galaxian_state::timefgtr_scanline) { - UINT8 split = param + 16; + uint8_t split = param + 16; // change spriteram base per each 64-line part of the screen if ((split & 0x3f) == 0) @@ -6187,15 +6187,15 @@ MACHINE_CONFIG_END * *************************************/ -void galaxian_state::decode_mooncrst(int length, UINT8 *dest) +void galaxian_state::decode_mooncrst(int length, uint8_t *dest) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int offs; for (offs = 0; offs < length; offs++) { - UINT8 data = rom[offs]; - UINT8 res = data; + uint8_t data = rom[offs]; + uint8_t res = data; if (BIT(data,1)) res ^= 0x40; if (BIT(data,5)) res ^= 0x04; if ((offs & 1) == 0) res = BITSWAP8(res,7,2,5,4,3,6,1,0); @@ -6240,7 +6240,7 @@ void galaxian_state::decode_checkman() +-------+ Pin layout is such that links can replace the PAL if encryption is not used. */ - static const UINT8 xortable[8][4] = + static const uint8_t xortable[8][4] = { { 6,0,6,0 }, { 5,1,5,1 }, @@ -6251,14 +6251,14 @@ void galaxian_state::decode_checkman() { 0,2,0,2 }, { 1,4,1,4 } }; - UINT8 *rombase = memregion("maincpu")->base(); - UINT32 romlength = memregion("maincpu")->bytes(); - UINT32 offs; + uint8_t *rombase = memregion("maincpu")->base(); + uint32_t romlength = memregion("maincpu")->bytes(); + uint32_t offs; for (offs = 0; offs < romlength; offs++) { - UINT8 data = rombase[offs]; - UINT32 line = offs & 0x07; + uint8_t data = rombase[offs]; + uint32_t line = offs & 0x07; data ^= (BIT(data,xortable[line][0]) << xortable[line][1]) | (BIT(data,xortable[line][2]) << xortable[line][3]); rombase[offs] = data; @@ -6268,13 +6268,13 @@ void galaxian_state::decode_checkman() void galaxian_state::decode_dingoe() { - UINT8 *rombase = memregion("maincpu")->base(); - UINT32 romlength = memregion("maincpu")->bytes(); - UINT32 offs; + uint8_t *rombase = memregion("maincpu")->base(); + uint32_t romlength = memregion("maincpu")->bytes(); + uint32_t offs; for (offs = 0; offs < romlength; offs++) { - UINT8 data = rombase[offs]; + uint8_t data = rombase[offs]; /* XOR bit 4 with bit 2, and bit 0 with bit 5, and invert bit 1 */ data ^= BIT(data, 2) << 4; @@ -6291,8 +6291,8 @@ void galaxian_state::decode_dingoe() void galaxian_state::decode_frogger_sound() { - UINT8 *rombase = memregion("audiocpu")->base(); - UINT32 offs; + uint8_t *rombase = memregion("audiocpu")->base(); + uint32_t offs; /* the first ROM of the sound CPU has data lines D0 and D1 swapped */ for (offs = 0; offs < 0x800; offs++) @@ -6302,8 +6302,8 @@ void galaxian_state::decode_frogger_sound() // froggermc has a bigger first ROM of the sound CPU, thus a different decode void galaxian_state::decode_froggermc_sound() { - UINT8 *rombase = memregion("audiocpu")->base(); - UINT32 offs; + uint8_t *rombase = memregion("audiocpu")->base(); + uint32_t offs; /* the first ROM of the sound CPU has data lines D0 and D1 swapped */ for (offs = 0; offs < 0x1000; offs++) @@ -6313,8 +6313,8 @@ void galaxian_state::decode_froggermc_sound() void galaxian_state::decode_frogger_gfx() { - UINT8 *rombase = memregion("gfx1")->base(); - UINT32 offs; + uint8_t *rombase = memregion("gfx1")->base(); + uint32_t offs; /* the 2nd gfx ROM has data lines D0 and D1 swapped */ for (offs = 0x0800; offs < 0x1000; offs++) @@ -6324,15 +6324,15 @@ void galaxian_state::decode_frogger_gfx() void galaxian_state::decode_anteater_gfx() { - UINT32 romlength = memregion("gfx1")->bytes(); - UINT8 *rombase = memregion("gfx1")->base(); - std::vector scratch(romlength); - UINT32 offs; + uint32_t romlength = memregion("gfx1")->bytes(); + uint8_t *rombase = memregion("gfx1")->base(); + std::vector scratch(romlength); + uint32_t offs; memcpy(&scratch[0], rombase, romlength); for (offs = 0; offs < romlength; offs++) { - UINT32 srcoffs = offs & 0x9bf; + uint32_t srcoffs = offs & 0x9bf; srcoffs |= (BIT(offs,4) ^ BIT(offs,9) ^ (BIT(offs,2) & BIT(offs,10))) << 6; srcoffs |= (BIT(offs,2) ^ BIT(offs,10)) << 9; srcoffs |= (BIT(offs,0) ^ BIT(offs,6) ^ 1) << 10; @@ -6343,15 +6343,15 @@ void galaxian_state::decode_anteater_gfx() void galaxian_state::decode_losttomb_gfx() { - UINT32 romlength = memregion("gfx1")->bytes(); - UINT8 *rombase = memregion("gfx1")->base(); - std::vector scratch(romlength); - UINT32 offs; + uint32_t romlength = memregion("gfx1")->bytes(); + uint8_t *rombase = memregion("gfx1")->base(); + std::vector scratch(romlength); + uint32_t offs; memcpy(&scratch[0], rombase, romlength); for (offs = 0; offs < romlength; offs++) { - UINT32 srcoffs = offs & 0xa7f; + uint32_t srcoffs = offs & 0xa7f; srcoffs |= ((BIT(offs,1) & BIT(offs,8)) | ((1 ^ BIT(offs,1)) & (BIT(offs,10)))) << 7; srcoffs |= (BIT(offs,7) ^ (BIT(offs,1) & (BIT(offs,7) ^ BIT(offs,10)))) << 8; srcoffs |= ((BIT(offs,1) & BIT(offs,7)) | ((1 ^ BIT(offs,1)) & (BIT(offs,8)))) << 10; @@ -6363,7 +6363,7 @@ void galaxian_state::decode_losttomb_gfx() void galaxian_state::decode_superbon() { offs_t i; - UINT8 *RAM; + uint8_t *RAM; /* Decryption worked out by hand by Chris Hardy. */ @@ -6450,9 +6450,9 @@ DRIVER_INIT_MEMBER(galaxian_state,nolock) DRIVER_INIT_MEMBER(galaxian_state, warofbugg) { - UINT8* romdata = memregion("maincpu")->base(); + uint8_t* romdata = memregion("maincpu")->base(); assert(memregion("maincpu")->bytes() == 0x4000); - UINT8 buf[0x4000]; + uint8_t buf[0x4000]; memcpy(buf, romdata, 0x4000); // the rom data is at the very least, backwards, but there still seems to be missing code @@ -6602,8 +6602,8 @@ READ8_MEMBER(galaxian_state::tenspot_dsw_read) void galaxian_state::tenspot_set_game_bank(int bank, int from_game) { char tmp[64]; - UINT8* srcregion; - UINT8* dstregion; + uint8_t* srcregion; + uint8_t* dstregion; int x; sprintf(tmp,"game_%d_cpu", bank); @@ -6825,14 +6825,14 @@ DRIVER_INIT_MEMBER(galaxian_state,kong) } -void galaxian_state::mshuttle_decode(const UINT8 convtable[8][16]) +void galaxian_state::mshuttle_decode(const uint8_t convtable[8][16]) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (int A = 0x0000;A < 0x8000;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 */ @@ -6849,7 +6849,7 @@ void galaxian_state::mshuttle_decode(const UINT8 convtable[8][16]) DRIVER_INIT_MEMBER(galaxian_state,mshuttle) { - static const UINT8 convtable[8][16] = + static const uint8_t convtable[8][16] = { /* 0xff marks spots which are unused and therefore unknown */ { 0x40,0x41,0x44,0x15,0x05,0x51,0x54,0x55,0x50,0x00,0x01,0x04,0xff,0x10,0x11,0x14 }, @@ -6875,7 +6875,7 @@ DRIVER_INIT_MEMBER(galaxian_state,mshuttle) DRIVER_INIT_MEMBER(galaxian_state,mshuttlj) { - 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 }, @@ -6910,7 +6910,7 @@ DRIVER_INIT_MEMBER(galaxian_state,fantastc) m_bullets_base = 0xc0; /* decode code */ - static const UINT16 lut_am_unscramble[32] = { + static const uint16_t lut_am_unscramble[32] = { 0, 2, 4, 6, // ok! 7, 3, 5, 1, // ok! 6, 0, 2, 4, // ok! @@ -6921,9 +6921,9 @@ DRIVER_INIT_MEMBER(galaxian_state,fantastc) 3, 7, 7, 7 // ok! }; - UINT8* romdata = memregion("maincpu")->base(); + uint8_t* romdata = memregion("maincpu")->base(); assert(memregion("maincpu")->bytes() == 0x8000); - UINT8 buf[0x8000]; + uint8_t buf[0x8000]; memcpy(buf, romdata, 0x8000); for (int i = 0; i < 32; i++) @@ -7067,7 +7067,7 @@ DRIVER_INIT_MEMBER(galaxian_state,scobra) DRIVER_INIT_MEMBER(galaxian_state,scobrae) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int offs; for (offs = 0; offs < 0x6000; offs++) @@ -7188,13 +7188,13 @@ DRIVER_INIT_MEMBER(galaxian_state,scorpion) save_item(NAME(m_protection_state)); /* { - const UINT8 *rom = memregion("speech")->base(); + const uint8_t *rom = memregion("speech")->base(); int i; for (i = 0; i < 0x2c; i++) { - UINT16 addr = (rom[2*i] << 8) | rom[2*i+1]; - UINT16 endaddr = (rom[2*i+2] << 8) | rom[2*i+3]; + uint16_t addr = (rom[2*i] << 8) | rom[2*i+1]; + uint16_t endaddr = (rom[2*i+2] << 8) | rom[2*i+3]; int j; printf("Cmd %02X -> %04X-%04X:", i, addr, endaddr - 1); for (j = 0; j < 32 && addr < endaddr; j++) diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp index 79f0270fb06..24c10ab71cc 100644 --- a/src/mame/drivers/galaxold.cpp +++ b/src/mame/drivers/galaxold.cpp @@ -417,12 +417,12 @@ WRITE8_MEMBER( galaxold_state::guttang_rombank_w ) // printf("rombank %02x\n",data); if (data&1) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); membank("cpubank")->set_base(rom + 0x4000); } else { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); membank("cpubank")->set_base(rom + 0x2000); } } @@ -2781,7 +2781,7 @@ ROM_END DRIVER_INIT_MEMBER(galaxold_state,ckonggx) { - UINT16 ckonggx_remap[88] = { + uint16_t ckonggx_remap[88] = { 0x5000, 0x0d00, 0x0e00, 0x0f00, 0x0c00, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0a00, 0x0b00, 0x1400, 0x1500, 0x1600, 0x1700, 0x1800, 0x1900, 0x1a00, 0x1b00, 0x1c00, 0x1d00, 0x1e00, 0x1f00, 0x1000, 0x1100, 0x1200, 0x1300, 0x2400, 0x2500, 0x2600, 0x2700, 0x2800, 0x2900, 0x2a00, 0x2b00, 0x2c00, 0x2d00, 0x2e00, 0x2f00, 0x2000, 0x2100, 0x2200, 0x2300, @@ -2791,8 +2791,8 @@ DRIVER_INIT_MEMBER(galaxold_state,ckonggx) /*^ at 0x0000 there is alt startup code? does it get banked in? */ }; - UINT8 *rom = memregion("maincpu")->base(); - std::vector buffer(0x5800); + uint8_t *rom = memregion("maincpu")->base(); + std::vector buffer(0x5800); for (int i=0;i<88;i++) { @@ -3485,7 +3485,7 @@ DRIVER_INIT_MEMBER(galaxold_state,guttangt) { address_space &space = m_maincpu->space(AS_PROGRAM); space.install_read_bank( 0x2000, 0x27ff, "cpubank" ); - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); membank("cpubank")->set_base(rom + 0x2000); } diff --git a/src/mame/drivers/galgame.cpp b/src/mame/drivers/galgame.cpp index 07c9b348eec..fe400cf9d64 100644 --- a/src/mame/drivers/galgame.cpp +++ b/src/mame/drivers/galgame.cpp @@ -24,18 +24,18 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - UINT16 m_clk; + uint16_t m_clk; - UINT16 m_x; - UINT16 m_y; + uint16_t m_x; + uint16_t m_y; - INT16 m_mq; - INT16 m_ac; + int16_t m_mq; + int16_t m_ac; struct { - UINT16 x; - UINT16 y; + uint16_t x; + uint16_t y; } m_point_work_list[MAX_POINTS], m_point_display_list[MAX_POINTS]; int m_point_work_list_index; @@ -50,7 +50,7 @@ public: DECLARE_WRITE16_MEMBER(clk_w); DECLARE_DRIVER_INIT(galaxygame); virtual void machine_reset() override; - UINT32 screen_update_galaxygame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galaxygame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(galaxygame_irq); IRQ_CALLBACK_MEMBER(galaxygame_irq_callback); required_device m_maincpu; @@ -65,7 +65,7 @@ public: READ16_MEMBER(galaxygame_state::ke_r) { - UINT16 ret; + uint16_t ret; switch( offset ) { @@ -97,9 +97,9 @@ WRITE16_MEMBER(galaxygame_state::ke_w) { if ( data != 0 ) { - INT32 dividend = (INT32)((UINT32)((UINT16)m_ac << 16) | (UINT16)(m_mq)); - m_mq = dividend / (INT16)data; - m_ac = dividend % (INT16)data; + int32_t dividend = (int32_t)((uint32_t)((uint16_t)m_ac << 16) | (uint16_t)(m_mq)); + m_mq = dividend / (int16_t)data; + m_ac = dividend % (int16_t)data; } else { @@ -109,10 +109,10 @@ WRITE16_MEMBER(galaxygame_state::ke_w) } break; case 1: // AC - m_ac = (INT16)data; + m_ac = (int16_t)data; break; case 2: // MQ - m_mq = (INT16)data; + m_mq = (int16_t)data; if (m_mq < 0) { m_ac = -1; @@ -124,7 +124,7 @@ WRITE16_MEMBER(galaxygame_state::ke_w) break; case 3: // X { - INT32 mulres = (INT32)m_mq*(INT32)(INT16)data; + int32_t mulres = (int32_t)m_mq*(int32_t)(int16_t)data; m_ac = mulres >> 16; m_mq = mulres & 0xffff; } @@ -132,7 +132,7 @@ WRITE16_MEMBER(galaxygame_state::ke_w) case 6: // LSH { data &= 63; - INT32 val = (INT32)((UINT32)((UINT16)m_ac << 16) | (UINT16)(m_mq)); + int32_t val = (int32_t)((uint32_t)((uint16_t)m_ac << 16) | (uint16_t)(m_mq)); if ( data < 32 ) { val = val << data; @@ -148,7 +148,7 @@ WRITE16_MEMBER(galaxygame_state::ke_w) case 7: // ASH { data &= 63; - INT32 val = (INT32)((UINT32)((UINT16)m_ac << 16) | (UINT16)(m_mq)); + int32_t val = (int32_t)((uint32_t)((uint16_t)m_ac << 16) | (uint16_t)(m_mq)); if ( data < 32 ) { val = val << data; @@ -174,7 +174,7 @@ WRITE16_MEMBER(galaxygame_state::ke_w) * *************************************/ -UINT32 galaxygame_state::screen_update_galaxygame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t galaxygame_state::screen_update_galaxygame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); for (int i = 0; i < m_point_display_list_index; i++ ) @@ -351,7 +351,7 @@ ROM_END * *************************************/ -static UINT8 read_uint16(UINT16 *pval, int pos, const UINT8* line, int linelen) +static uint8_t read_uint16(uint16_t *pval, int pos, const uint8_t* line, int linelen) { int i; @@ -369,7 +369,7 @@ static UINT8 read_uint16(UINT16 *pval, int pos, const UINT8* line, int linelen) return 1; } -static UINT8 read_uint8(UINT8 *pval, int pos, const UINT8* line, int linelen) +static uint8_t read_uint8(uint8_t *pval, int pos, const uint8_t* line, int linelen) { int i; @@ -390,13 +390,13 @@ static UINT8 read_uint8(UINT8 *pval, int pos, const UINT8* line, int linelen) DRIVER_INIT_MEMBER(galaxygame_state,galaxygame) { address_space &main = m_maincpu->space(AS_PROGRAM); - UINT8 *code = memregion("code")->base(); + uint8_t *code = memregion("code")->base(); int filepos = 0, linepos, linelen; - UINT8 line[256]; - UINT16 address; - UINT16 val; - UINT8 val8; + uint8_t line[256]; + uint16_t address; + uint16_t val; + uint8_t val8; //load lst file while( code[filepos] != 0 ) diff --git a/src/mame/drivers/galivan.cpp b/src/mame/drivers/galivan.cpp index 67230e355df..6e2a1e4202e 100644 --- a/src/mame/drivers/galivan.cpp +++ b/src/mame/drivers/galivan.cpp @@ -371,7 +371,7 @@ GFXDECODE_END MACHINE_START_MEMBER(galivan_state,galivan) { /* configure ROM banking */ - UINT8 *rombase = memregion("maincpu")->base(); + uint8_t *rombase = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &rombase[0x10000], 0x2000); membank("bank1")->set_entry(0); @@ -385,7 +385,7 @@ MACHINE_START_MEMBER(galivan_state,galivan) MACHINE_START_MEMBER(galivan_state,ninjemak) { /* configure ROM banking */ - UINT8 *rombase = memregion("maincpu")->base(); + uint8_t *rombase = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x2000); membank("bank1")->set_entry(0); diff --git a/src/mame/drivers/galpani2.cpp b/src/mame/drivers/galpani2.cpp index b4bbef370ac..80e5ac5b9fc 100644 --- a/src/mame/drivers/galpani2.cpp +++ b/src/mame/drivers/galpani2.cpp @@ -124,7 +124,7 @@ WRITE16_MEMBER(galpani2_state::galpani2_eeprom_w) void galpani2_state::machine_start() { - UINT8 *ROM = memregion("subdata")->base(); + uint8_t *ROM = memregion("subdata")->base(); membank("subdatabank")->configure_entries(0, 0x2000000/0x0800000, ROM, 0x0800000); membank("subdatabank")->set_entry(0); @@ -172,7 +172,7 @@ WRITE8_MEMBER(galpani2_state::galpani2_mcu_init_w) { address_space &srcspace = m_maincpu->space(AS_PROGRAM); address_space &dstspace = m_subcpu->space(AS_PROGRAM); - UINT32 mcu_address, mcu_data; + uint32_t mcu_address, mcu_data; for ( mcu_address = 0x100010; mcu_address < (0x100010 + 6); mcu_address += 1 ) { @@ -186,7 +186,7 @@ void galpani2_state::galpani2_mcu_nmi1() { address_space &srcspace = m_maincpu->space(AS_PROGRAM); address_space &dstspace = m_subcpu->space(AS_PROGRAM); - UINT32 mcu_list, mcu_command, mcu_address, mcu_extra, mcu_src, mcu_dst, mcu_size; + uint32_t mcu_list, mcu_command, mcu_address, mcu_extra, mcu_src, mcu_dst, mcu_size; for ( mcu_list = 0x100021; mcu_list < (0x100021 + 0x40); mcu_list += 4 ) { @@ -331,7 +331,7 @@ WRITE8_MEMBER(galpani2_state::galpani2_coin_lockout_w) WRITE8_MEMBER(galpani2_state::galpani2_oki1_bank_w) { - UINT8 *ROM = memregion("oki1")->base(); + uint8_t *ROM = memregion("oki1")->base(); logerror("%s : %s bank %08X\n",machine().describe_context(),tag(),data); memcpy(ROM + 0x30000, ROM + 0x40000 + 0x10000 * (~data & 0xf), 0x10000); } diff --git a/src/mame/drivers/galpani3.cpp b/src/mame/drivers/galpani3.cpp index 17e8f2d0b87..a048fa9ba34 100644 --- a/src/mame/drivers/galpani3.cpp +++ b/src/mame/drivers/galpani3.cpp @@ -98,16 +98,16 @@ public: required_device m_palette; required_device m_spritegen; - required_shared_ptr m_paletteram; - optional_shared_ptr m_spriteram; - required_shared_ptr m_priority_buffer; - required_shared_ptr m_sprregs; + required_shared_ptr m_paletteram; + optional_shared_ptr m_spriteram; + required_shared_ptr m_priority_buffer; + required_shared_ptr m_sprregs; bitmap_ind16 m_sprite_bitmap_1; - UINT16 m_priority_buffer_scrollx; - UINT16 m_priority_buffer_scrolly; - UINT32 m_spriteram32[0x4000/4]; - UINT32 m_spc_regs[0x40/4]; + uint16_t m_priority_buffer_scrollx; + uint16_t m_priority_buffer_scrolly; + uint32_t m_spriteram32[0x4000/4]; + uint32_t m_spc_regs[0x40/4]; DECLARE_WRITE16_MEMBER(galpani3_suprnova_sprite32_w); DECLARE_WRITE16_MEMBER(galpani3_suprnova_sprite32regs_w); @@ -117,7 +117,7 @@ public: virtual void video_start() override; - UINT32 screen_update_galpani3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galpani3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(galpani3_vblank); int gp3_is_alpha_pen(int pen); }; @@ -161,7 +161,7 @@ void galpani3_state::video_start() int galpani3_state::gp3_is_alpha_pen(int pen) { - UINT16 dat = 0; + uint16_t dat = 0; if (pen<0x4000) { @@ -197,12 +197,12 @@ int galpani3_state::gp3_is_alpha_pen(int pen) } -UINT32 galpani3_state::screen_update_galpani3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t galpani3_state::screen_update_galpani3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; - UINT16* src1; - UINT32* dst; - UINT16 pixdata1; + uint16_t* src1; + uint32_t* dst; + uint16_t pixdata1; const pen_t *paldata = m_palette->pens(); bitmap.fill(0x0000, cliprect); @@ -215,11 +215,11 @@ UINT32 galpani3_state::screen_update_galpani3(screen_device &screen, bitmap_rgb3 int drawy, drawx; for (drawy=0;drawy<512;drawy++) { - UINT16* srcline1 = m_grap2_0->m_framebuffer.get() + ((drawy+m_grap2_0->m_framebuffer_scrolly+11)&0x1ff) * 0x200; - UINT16* srcline2 = m_grap2_1->m_framebuffer.get() + ((drawy+m_grap2_1->m_framebuffer_scrolly+11)&0x1ff) * 0x200; - UINT16* srcline3 = m_grap2_2->m_framebuffer.get() + ((drawy+m_grap2_2->m_framebuffer_scrolly+11)&0x1ff) * 0x200; + uint16_t* srcline1 = m_grap2_0->m_framebuffer.get() + ((drawy+m_grap2_0->m_framebuffer_scrolly+11)&0x1ff) * 0x200; + uint16_t* srcline2 = m_grap2_1->m_framebuffer.get() + ((drawy+m_grap2_1->m_framebuffer_scrolly+11)&0x1ff) * 0x200; + uint16_t* srcline3 = m_grap2_2->m_framebuffer.get() + ((drawy+m_grap2_2->m_framebuffer_scrolly+11)&0x1ff) * 0x200; - UINT16* priline = m_priority_buffer + ((drawy+m_priority_buffer_scrolly+11)&0x1ff) * 0x200; + uint16_t* priline = m_priority_buffer + ((drawy+m_priority_buffer_scrolly+11)&0x1ff) * 0x200; for (drawx=0;drawx<512;drawx++) { @@ -229,13 +229,13 @@ UINT32 galpani3_state::screen_update_galpani3(screen_device &screen, bitmap_rgb3 int prioffs = (drawx+m_priority_buffer_scrollx+66)&0x1ff; - UINT8 dat1 = srcline1[srcoffs1]; - UINT8 dat2 = srcline2[srcoffs2]; - UINT8 dat3 = srcline3[srcoffs3]; + uint8_t dat1 = srcline1[srcoffs1]; + uint8_t dat2 = srcline2[srcoffs2]; + uint8_t dat3 = srcline3[srcoffs3]; - UINT8 pridat = priline[prioffs]; + uint8_t pridat = priline[prioffs]; - UINT32* dst = &bitmap.pix32(drawy, drawx); + uint32_t* dst = &bitmap.pix32(drawy, drawx); @@ -264,8 +264,8 @@ UINT32 galpani3_state::screen_update_galpani3(screen_device &screen, bitmap_rgb3 enable -- see fading in intro */ if (dat1 && m_grap2_0->m_framebuffer_enable) { - UINT16 pen = dat1+0x4000; - UINT32 pal = paldata[pen]; + uint16_t pen = dat1+0x4000; + uint32_t pal = paldata[pen]; if (gp3_is_alpha_pen(pen)) { @@ -292,8 +292,8 @@ UINT32 galpani3_state::screen_update_galpani3(screen_device &screen, bitmap_rgb3 if (dat2 && m_grap2_1->m_framebuffer_enable) { - UINT16 pen = dat2+0x4100; - UINT32 pal = paldata[pen]; + uint16_t pen = dat2+0x4100; + uint32_t pal = paldata[pen]; if (gp3_is_alpha_pen(pen)) { diff --git a/src/mame/drivers/gamate.cpp b/src/mame/drivers/gamate.cpp index 2035e939453..26047502371 100644 --- a/src/mame/drivers/gamate.cpp +++ b/src/mame/drivers/gamate.cpp @@ -46,7 +46,7 @@ public: DECLARE_READ8_MEMBER(gamate_nmi_r); DECLARE_WRITE8_MEMBER(gamate_video_w); DECLARE_DRIVER_INIT(gamate); - UINT32 screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(gamate_interrupt); TIMER_CALLBACK_MEMBER(gamate_timer); TIMER_CALLBACK_MEMBER(gamate_timer2); @@ -56,14 +56,14 @@ private: struct { - UINT8 reg[8]; + uint8_t reg[8]; struct { bool page2; // else page1 - UINT8 ypos, xpos/*tennis*/; - UINT8 data[2][0x100][0x20]; + uint8_t ypos, xpos/*tennis*/; + uint8_t data[2][0x100][0x20]; } bitmap; - UINT8 x, y; + uint8_t x, y; bool y_increment; } video; @@ -71,8 +71,8 @@ private: { bool set; int bit_shifter; - UINT8 cartridge_byte; - UINT16 address; // in reality something more like short local cartridge address offset + uint8_t cartridge_byte; + uint16_t address; // in reality something more like short local cartridge address offset bool unprotected; bool failed; } card_protection; @@ -82,13 +82,13 @@ private: required_device m_cart; required_ioport m_io_joy; required_device m_palette; - required_shared_ptr m_bios; + required_shared_ptr m_bios; required_memory_bank m_bank; required_memory_bank m_bankmulti; emu_timer *timer1; emu_timer *timer2; - UINT8 bank_multi; - UINT8 *m_cart_ptr; + uint8_t bank_multi; + uint8_t *m_cart_ptr; }; WRITE8_MEMBER( gamate_state::gamate_cart_protection_w ) @@ -111,7 +111,7 @@ WRITE8_MEMBER( gamate_state::gamate_cart_protection_w ) READ8_MEMBER( gamate_state::gamate_cart_protection_r ) { - UINT8 ret=1; + uint8_t ret=1; if (card_protection.bit_shifter==7 && card_protection.unprotected) { ret=m_cart_ptr[bank_multi*0x4000]; @@ -206,7 +206,7 @@ READ8_MEMBER( gamate_state::gamate_video_r ) { if (offset!=6) return 0; - UINT8 data = video.bitmap.data[video.bitmap.page2][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]; + uint8_t data = video.bitmap.data[video.bitmap.page2][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]; // if (m_maincpu->pc()<0xf000) // machine().ui().popup_time(2, "lcd read x:%x y:%x mode:%x data:%x\n", video.x, video.y, video.reg[1], data); if (video.y_increment) @@ -219,7 +219,7 @@ READ8_MEMBER( gamate_state::gamate_video_r ) READ8_MEMBER( gamate_state::gamate_nmi_r ) { - UINT8 data=0; + uint8_t data=0; machine().ui().popup_time(2, "nmi/4800 read\n"); return data; } @@ -273,7 +273,7 @@ PALETTE_INIT_MEMBER(gamate_state, gamate) } } -static void BlitPlane(UINT16* line, UINT8 plane1, UINT8 plane2) +static void BlitPlane(uint16_t* line, uint8_t plane1, uint8_t plane2) { line[3]=(plane1&1)|((plane2<<1)&2); line[2]=((plane1>>1)&1)|((plane2<<0)&2); @@ -281,14 +281,14 @@ static void BlitPlane(UINT16* line, UINT8 plane1, UINT8 plane2) line[0]=((plane1>>3)&1)|((plane2>>2)&2); } -UINT32 gamate_state::screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gamate_state::screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, j; for (y=0;y<152;y++) { for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) { - UINT8 d1, d2; + uint8_t d1, d2; if (video.bitmap.ypos<200) { d1=video.bitmap.data[0][(y+video.bitmap.ypos)%200][(j+video.bitmap.xpos/8)&0x1f]; diff --git a/src/mame/drivers/gambl186.cpp b/src/mame/drivers/gambl186.cpp index 37360a09512..09e874d792c 100644 --- a/src/mame/drivers/gambl186.cpp +++ b/src/mame/drivers/gambl186.cpp @@ -67,7 +67,7 @@ public: optional_device m_upd7759; int m_comms_state; int m_comms_ind; - UINT8 m_comms_data[1002]; + uint8_t m_comms_data[1002]; int m_comms_cmd; int m_comms_expect; int m_comms_blocks; @@ -85,11 +85,11 @@ void gambl186_state::machine_start() membank("data_bank")->configure_entries(0, 4, memregion("data")->base(), 0x40000); } -static const UINT8 password[] = {5, 2, 0, 3, 0, 0, 2, 4, 5, 6, 0x16}; +static const uint8_t password[] = {5, 2, 0, 3, 0, 0, 2, 4, 5, 6, 0x16}; READ16_MEMBER(gambl186_state::comms_r) { - UINT16 retval = 0; + uint16_t retval = 0; if ((offset == 0) && ACCESSING_BITS_0_7) //port 680 == data { @@ -292,7 +292,7 @@ WRITE16_MEMBER(gambl186_state::comms_w) data = 5; } - m_comms_data[++m_comms_ind] = (UINT8) data; + m_comms_data[++m_comms_ind] = (uint8_t) data; } m_comms_ack = false; diff --git a/src/mame/drivers/gamecom.cpp b/src/mame/drivers/gamecom.cpp index 1ece0f8cd2f..63187d1124b 100644 --- a/src/mame/drivers/gamecom.cpp +++ b/src/mame/drivers/gamecom.cpp @@ -230,7 +230,7 @@ PALETTE_INIT_MEMBER(gamecom_state, gamecom) palette.set_pen_color(4, 0xDF, 0xFF, 0x8F ); // White } -UINT32 gamecom_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gamecom_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; diff --git a/src/mame/drivers/gamecstl.cpp b/src/mame/drivers/gamecstl.cpp index 97e2e248323..f08e3836597 100644 --- a/src/mame/drivers/gamecstl.cpp +++ b/src/mame/drivers/gamecstl.cpp @@ -81,12 +81,12 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_cga_ram; + required_shared_ptr m_cga_ram; required_device m_gfxdecode; required_device m_palette; - std::unique_ptr m_bios_ram; - UINT8 m_mtxc_config_reg[256]; - UINT8 m_piix4_config_reg[4][256]; + std::unique_ptr m_bios_ram; + uint8_t m_mtxc_config_reg[256]; + uint8_t m_piix4_config_reg[4][256]; DECLARE_WRITE32_MEMBER(pnp_config_w); DECLARE_WRITE32_MEMBER(pnp_data_w); @@ -95,7 +95,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_gamecstl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gamecstl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y); void intel82439tx_init(); }; @@ -119,17 +119,17 @@ void gamecstl_state::video_start() void gamecstl_state::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y) { int i,j; - const UINT8 *dp; + const uint8_t *dp; int index = 0; dp = gfx->get_data(ch); for (j=y; j < y+8; j++) { - UINT16 *p = &bitmap.pix16(j); + uint16_t *p = &bitmap.pix16(j); for (i=x; i < x+8; i++) { - UINT8 pen = dp[index++]; + uint8_t pen = dp[index++]; if (pen) p[i] = gfx->colorbase() + (att & 0xf); else @@ -138,11 +138,11 @@ void gamecstl_state::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, } } -UINT32 gamecstl_state::screen_update_gamecstl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gamecstl_state::screen_update_gamecstl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, j; gfx_element *gfx = m_gfxdecode->gfx(0); - UINT32 *cga = m_cga_ram; + uint32_t *cga = m_cga_ram; int index = 0; bitmap.fill(0, cliprect); @@ -166,14 +166,14 @@ UINT32 gamecstl_state::screen_update_gamecstl(screen_device &screen, bitmap_ind1 // Intel 82439TX System Controller (MTXC) -static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) { gamecstl_state *state = busdevice->machine().driver_data(); printf("MTXC: read %d, %02X\n", function, reg); return state->m_mtxc_config_reg[reg]; } -static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { gamecstl_state *state = busdevice->machine().driver_data(); printf("%s:MTXC: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data); @@ -207,9 +207,9 @@ void gamecstl_state::intel82439tx_init() m_mtxc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; @@ -229,7 +229,7 @@ static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -251,23 +251,23 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) -static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { gamecstl_state *state = busdevice->machine().driver_data(); printf("PIIX4: read %d, %02X\n", function, reg); return state->m_piix4_config_reg[function][reg]; } -static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { gamecstl_state *state = busdevice->machine().driver_data(); printf("%s:PIIX4: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data); state->m_piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= piix4_config_r(busdevice, device, function, reg + 3) << 24; @@ -287,7 +287,7 @@ static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -460,7 +460,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(gamecstl_state,gamecstl) { - m_bios_ram = std::make_unique(0x10000/4); + m_bios_ram = std::make_unique(0x10000/4); intel82439tx_init(); } diff --git a/src/mame/drivers/gameking.cpp b/src/mame/drivers/gameking.cpp index 0a5755c96d1..2caae4b3422 100644 --- a/src/mame/drivers/gameking.cpp +++ b/src/mame/drivers/gameking.cpp @@ -55,17 +55,17 @@ public: TIMER_CALLBACK_MEMBER(gameking_timer); TIMER_CALLBACK_MEMBER(gameking_timer2); - UINT32 screen_update_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gameking_cart); struct Gkio { - UINT8 input, input2; - UINT8 timer; - UINT8 res3[0x2f]; - UINT8 bank4000_address; // 32 - UINT8 bank4000_cart; //33 bit 0 only? - UINT8 bank8000_cart; //34 bit 7; bits 0,1,.. a15,a16,.. - UINT8 res2[0x4c]; + uint8_t input, input2; + uint8_t timer; + uint8_t res3[0x2f]; + uint8_t bank4000_address; // 32 + uint8_t bank4000_cart; //33 bit 0 only? + uint8_t bank8000_cart; //34 bit 7; bits 0,1,.. a15,a16,.. + uint8_t res2[0x4c]; }; protected: required_device m_maincpu; @@ -97,13 +97,13 @@ WRITE8_MEMBER(gameking_state::io_w) Gkio *io = reinterpret_cast(maincpu_rom->base()); if (offset == offsetof(Gkio, bank4000_address) || offset == offsetof(Gkio, bank4000_cart)) { - UINT8 bank = io->bank4000_address ^ 1; - UINT8 *base = io->bank4000_cart & 1/*?*/ && m_cart_rom ? m_cart_rom->base() : maincpu_rom->base() + 0x10000; + uint8_t bank = io->bank4000_address ^ 1; + uint8_t *base = io->bank4000_cart & 1/*?*/ && m_cart_rom ? m_cart_rom->base() : maincpu_rom->base() + 0x10000; m_bank4000->set_base(base + bank * 0x4000); } if (offset == offsetof(Gkio, bank8000_cart)) { - UINT8 *base = io->bank8000_cart & 0x80/*?*/ && m_cart_rom ? m_cart_rom->base() : maincpu_rom->base() + 0x10000; - UINT8 bank = io->bank8000_cart & 0x7f; + uint8_t *base = io->bank8000_cart & 0x80/*?*/ && m_cart_rom ? m_cart_rom->base() : maincpu_rom->base() + 0x10000; + uint8_t bank = io->bank8000_cart & 0x7f; m_bank8000->set_base(base + bank * 0x8000); } } @@ -111,7 +111,7 @@ WRITE8_MEMBER(gameking_state::io_w) READ8_MEMBER(gameking_state::io_r) { memory_region *maincpu_rom = memregion("maincpu"); - UINT8 data = maincpu_rom->base()[offset]; + uint8_t data = maincpu_rom->base()[offset]; switch (offset) { case offsetof(Gkio, input): data = m_io_joy->read() | ~3; @@ -138,7 +138,7 @@ WRITE8_MEMBER( gameking_state::lcd_w ) READ8_MEMBER(gameking_state::lcd_r) { memory_region *maincpu_rom = memregion("maincpu"); - UINT8 data = maincpu_rom->base()[offset + 0x600]; + uint8_t data = maincpu_rom->base()[offset + 0x600]; return data; } @@ -185,14 +185,14 @@ PALETTE_INIT_MEMBER(gameking_state, gameking) } -UINT32 gameking_state::screen_update_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gameking_state::screen_update_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y=31, i=0;i<32;i++,y--) { for (int x=0, j=0;j<48/4;x+=4, j++) { memory_region *maincpu_rom = memregion("maincpu"); - UINT8 data=maincpu_rom->base()[0x600+j+i*12]; + uint8_t data=maincpu_rom->base()[0x600+j+i*12]; bitmap.pix16(y, x+3)=data&3; bitmap.pix16(y, x+2)=(data>>2)&3; bitmap.pix16(y, x+1)=(data>>4)&3; @@ -229,7 +229,7 @@ TIMER_CALLBACK_MEMBER(gameking_state::gameking_timer2) DEVICE_IMAGE_LOAD_MEMBER( gameking_state, gameking_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size > 0x80000) { diff --git a/src/mame/drivers/gaplus.cpp b/src/mame/drivers/gaplus.cpp index a84134081ca..90dc53a7c46 100644 --- a/src/mame/drivers/gaplus.cpp +++ b/src/mame/drivers/gaplus.cpp @@ -979,7 +979,7 @@ ROM_END DRIVER_INIT_MEMBER(gaplus_state,gaplus) { - UINT8 *rom; + uint8_t *rom; rom = memregion("gfx1")->base(); for (int i = 0;i < 0x2000;i++) diff --git a/src/mame/drivers/gauntlet.cpp b/src/mame/drivers/gauntlet.cpp index 87cf50209ee..620dc364379 100644 --- a/src/mame/drivers/gauntlet.cpp +++ b/src/mame/drivers/gauntlet.cpp @@ -1636,8 +1636,8 @@ ROM_END void gauntlet_state::swap_memory(void *ptr1, void *ptr2, int bytes) { - UINT8 *p1 = (UINT8 *)ptr1; - UINT8 *p2 = (UINT8 *)ptr2; + uint8_t *p1 = (uint8_t *)ptr1; + uint8_t *p2 = (uint8_t *)ptr2; while (bytes--) { int temp = *p1; @@ -1648,7 +1648,7 @@ void gauntlet_state::swap_memory(void *ptr1, void *ptr2, int bytes) void gauntlet_state::common_init(int vindctr2) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); slapstic_configure(*m_maincpu, 0x038000, 0, memregion("maincpu")->base() + 0x38000); /* swap the top and bottom halves of the main CPU ROM images */ @@ -1671,8 +1671,8 @@ DRIVER_INIT_MEMBER(gauntlet_state,gauntlet) DRIVER_INIT_MEMBER(gauntlet_state,vindctr2) { - UINT8 *gfx2_base = memregion("gfx2")->base(); - std::vector data(0x8000); + uint8_t *gfx2_base = memregion("gfx2")->base(); + std::vector data(0x8000); int i; common_init(1); diff --git a/src/mame/drivers/gb.cpp b/src/mame/drivers/gb.cpp index 6ecf6b78ae8..50f23ee8211 100644 --- a/src/mame/drivers/gb.cpp +++ b/src/mame/drivers/gb.cpp @@ -314,7 +314,7 @@ READ8_MEMBER(gb_state::gb_cart_r) { if (offset < 0x100) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); if (m_bios_hack->read()) { // patch out logo and checksum checks @@ -344,7 +344,7 @@ READ8_MEMBER(gb_state::gbc_cart_r) { if (offset < 0x100) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); if (m_bios_hack->read()) { // patch out logo and checksum checks @@ -359,7 +359,7 @@ READ8_MEMBER(gb_state::gbc_cart_r) } else if (offset >= 0x200 && offset < 0x900) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); return ROM[offset - 0x100]; } else if (m_cartslot) diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp index f05c534146c..60c5b11661f 100644 --- a/src/mame/drivers/gba.cpp +++ b/src/mame/drivers/gba.cpp @@ -129,10 +129,10 @@ static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, co } } -static const UINT32 timer_clks[4] = { XTAL_16_777216MHz, XTAL_16_777216MHz / 64, XTAL_16_777216MHz / 256, XTAL_16_777216MHz / 1024 }; +static const uint32_t timer_clks[4] = { XTAL_16_777216MHz, XTAL_16_777216MHz / 64, XTAL_16_777216MHz / 256, XTAL_16_777216MHz / 1024 }; -void gba_state::request_irq(UINT32 int_type) +void gba_state::request_irq(uint32_t int_type) { // set flag for later recovery IF_SET(int_type); @@ -152,7 +152,7 @@ void gba_state::request_irq(UINT32 int_type) TIMER_CALLBACK_MEMBER(gba_state::dma_complete) { - static const UINT32 ch_int[4] = { INT_DMA0, INT_DMA1, INT_DMA2, INT_DMA3 }; + static const uint32_t ch_int[4] = { INT_DMA0, INT_DMA1, INT_DMA2, INT_DMA3 }; uintptr_t ch = param; @@ -193,9 +193,9 @@ TIMER_CALLBACK_MEMBER(gba_state::dma_complete) void gba_state::dma_exec(int ch) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT32 src = m_dma_src[ch]; - UINT32 dst = m_dma_dst[ch]; - UINT16 ctrl = DMACNT_H(ch); + uint32_t src = m_dma_src[ch]; + uint32_t dst = m_dma_dst[ch]; + uint16_t ctrl = DMACNT_H(ch); int srcadd = (ctrl >> 7) & 3; int dstadd = (ctrl >> 5) & 3; @@ -308,7 +308,7 @@ void gba_state::dma_exec(int ch) m_dma_src[ch] = src; m_dma_dst[ch] = dst; -// printf("settng DMA timer %d for %d cycs (tmr %x)\n", ch, cnt, (UINT32)m_dma_timer[ch]); +// printf("settng DMA timer %d for %d cycs (tmr %x)\n", ch, cnt, (uint32_t)m_dma_timer[ch]); // m_dma_timer[ch]->adjust(ATTOTIME_IN_CYCLES(0, cnt), ch); dma_complete(nullptr, ch); } @@ -393,7 +393,7 @@ void gba_state::audio_tick(int ref) TIMER_CALLBACK_MEMBER(gba_state::timer_expire) { - static const UINT32 tmr_ints[4] = { INT_TM0_OVERFLOW, INT_TM1_OVERFLOW, INT_TM2_OVERFLOW, INT_TM3_OVERFLOW }; + static const uint32_t tmr_ints[4] = { INT_TM0_OVERFLOW, INT_TM1_OVERFLOW, INT_TM2_OVERFLOW, INT_TM3_OVERFLOW }; uintptr_t tmr = (uintptr_t) param; // "The reload value is copied into the counter only upon following two situations: Automatically upon timer overflows," @@ -545,7 +545,7 @@ static const char *reg_names[] = { READ32_MEMBER(gba_state::gba_io_r) { - UINT32 retval = 0; + uint32_t retval = 0; switch( offset + 0x60/4 ) { @@ -662,7 +662,7 @@ READ32_MEMBER(gba_state::gba_io_r) case 0x0108/4: case 0x010c/4: { - UINT32 elapsed; + uint32_t elapsed; double time, ticks; int timer = offset + 0x60/4 - 0x100/4; @@ -686,7 +686,7 @@ READ32_MEMBER(gba_state::gba_io_r) time *= ticks; time /= (1.0 / m_timer_hz[timer]); - elapsed = (UINT32)time; + elapsed = (uint32_t)time; } // printf("elapsed = %x\n", elapsed); @@ -741,9 +741,9 @@ READ32_MEMBER(gba_state::gba_io_r) WRITE32_MEMBER(gba_state::gba_io_w) { - UINT8 soundcnt_x = SOUNDCNT_X; - UINT16 siocnt = SIOCNT; - UINT16 dmachcnt[4] = { DMACNT_H(0), DMACNT_H(1), DMACNT_H(2), DMACNT_H(3) }; + uint8_t soundcnt_x = SOUNDCNT_X; + uint16_t siocnt = SIOCNT; + uint16_t dmachcnt[4] = { DMACNT_H(0), DMACNT_H(1), DMACNT_H(2), DMACNT_H(3) }; COMBINE_DATA(&m_regs[offset]); @@ -1024,7 +1024,7 @@ WRITE32_MEMBER(gba_state::gba_io_w) case 0x010c/4: { double rate, clocksel; - UINT32 old_timer_regs; + uint32_t old_timer_regs; int timer = offset + 0x60/4 - 0x100/4; @@ -1132,7 +1132,7 @@ WRITE32_MEMBER(gba_state::gba_io_w) READ32_MEMBER(gba_state::gba_bios_r) { - UINT32 *rom = m_region_maincpu; + uint32_t *rom = m_region_maincpu; if (m_bios_hack->read()) { // partially patch out logo and checksum checks @@ -1149,16 +1149,16 @@ READ32_MEMBER(gba_state::gba_bios_r) READ32_MEMBER(gba_state::gba_10000000_r) { - UINT32 data; - UINT32 pc = m_maincpu->state_int(ARM7_PC); - UINT32 cpsr = m_maincpu->state_int(ARM7_CPSR); + uint32_t data; + uint32_t pc = m_maincpu->state_int(ARM7_PC); + uint32_t cpsr = m_maincpu->state_int(ARM7_CPSR); if (T_IS_SET( cpsr)) { data = space.read_dword(pc + 8); } else { - UINT16 insn = space.read_word(pc + 4); + uint16_t insn = space.read_word(pc + 4); data = (insn << 16) | (insn << 0); } logerror("%s: unmapped program memory read from %08X = %08X & %08X\n", machine().describe_context( ), 0x10000000 + (offset << 2), data, mem_mask); diff --git a/src/mame/drivers/gberet.cpp b/src/mame/drivers/gberet.cpp index 27567e10507..275c40b59e2 100644 --- a/src/mame/drivers/gberet.cpp +++ b/src/mame/drivers/gberet.cpp @@ -87,7 +87,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(gberet_state::gberet_interrupt_tick) { - UINT8 ticks_mask = ~m_interrupt_ticks & (m_interrupt_ticks + 1); // 0->1 + uint8_t ticks_mask = ~m_interrupt_ticks & (m_interrupt_ticks + 1); // 0->1 m_interrupt_ticks++; // NMI on d0 @@ -130,7 +130,7 @@ WRITE8_MEMBER(gberet_state::mrgoemon_coin_counter_w) WRITE8_MEMBER(gberet_state::gberet_flipscreen_w) { /* bits 0/1/2 = interrupt enable */ - UINT8 ack_mask = ~data & m_interrupt_mask; // 1->0 + uint8_t ack_mask = ~data & m_interrupt_mask; // 1->0 if (ack_mask & 1) m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); @@ -573,7 +573,7 @@ ROM_END DRIVER_INIT_MEMBER(gberet_state,mrgoemon) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x800); } diff --git a/src/mame/drivers/gcpinbal.cpp b/src/mame/drivers/gcpinbal.cpp index 98981a509da..7a755a4f2f4 100644 --- a/src/mame/drivers/gcpinbal.cpp +++ b/src/mame/drivers/gcpinbal.cpp @@ -255,7 +255,7 @@ WRITE_LINE_MEMBER(gcpinbal_state::gcp_adpcm_int) } else { - UINT8 *ROM = memregion("msm")->base(); + uint8_t *ROM = memregion("msm")->base(); m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_start] & 0x0f) : (ROM[m_adpcm_start] & 0xf0) >> 4)); m_msm->data_w(m_adpcm_data & 0xf); diff --git a/src/mame/drivers/gei.cpp b/src/mame/drivers/gei.cpp index 1e46fe8e471..f05e1c6b154 100644 --- a/src/mame/drivers/gei.cpp +++ b/src/mame/drivers/gei.cpp @@ -97,17 +97,17 @@ public: virtual void video_start() override; - 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); bitmap_ind16 m_bitmap; - UINT8 m_drawctrl[3]; - UINT8 m_color[8]; + uint8_t m_drawctrl[3]; + uint8_t m_color[8]; int m_prevoffset; int m_yadd; int m_signature_answer; int m_signature_pos; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(gei_drawctrl_w); DECLARE_WRITE8_MEMBER(gei_bitmap_w); DECLARE_READ8_MEMBER(catchall); @@ -181,7 +181,7 @@ void gei_state::video_start() m_screen->register_screen_bitmap(m_bitmap); } -UINT32 gei_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gei_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; @@ -403,7 +403,7 @@ WRITE8_MEMBER(gei_state::signature_w) if (data == 0) m_signature_pos = 0; else { - static const UINT8 signature[8] = { 0xff, 0x01, 0xfd, 0x05, 0xf5, 0x15, 0xd5, 0x55 }; + static const uint8_t signature[8] = { 0xff, 0x01, 0xfd, 0x05, 0xf5, 0x15, 0xd5, 0x55 }; m_signature_answer = signature[m_signature_pos++]; @@ -416,7 +416,7 @@ WRITE8_MEMBER(gei_state::signature2_w) if (data == 0) m_signature_pos = 0; else { - static const UINT8 signature[8] = { 0xff, 0x01, 0xf7, 0x11, 0xd7, 0x51, 0x57, 0x51 }; + static const uint8_t signature[8] = { 0xff, 0x01, 0xf7, 0x11, 0xd7, 0x51, 0x57, 0x51 }; m_signature_answer = signature[m_signature_pos++]; diff --git a/src/mame/drivers/geneve.cpp b/src/mame/drivers/geneve.cpp index 28829198c12..1e54a336e6f 100644 --- a/src/mame/drivers/geneve.cpp +++ b/src/mame/drivers/geneve.cpp @@ -189,7 +189,7 @@ the keyboard pulses the clock line low 9 times, and the Geneve samples all 8 bits of data (plus one start bit) on each falling edge of the clock. When the key code buffer is full, the Geneve gate array asserts the kbdint* - line (connected to 9901 INT8*). The Geneve gate array will hold the + line (connected to 9901 int8_t*). The Geneve gate array will hold the CTS/clock line low as long as the keyboard buffer is full or CRU bit @>F78 is 0. Writing a 0 to >F79 will clear the Geneve keyboard buffer, and writing a 1 will resume normal operation: you need to write a 0 to >F78 @@ -419,7 +419,7 @@ WRITE8_MEMBER ( geneve_state::cruwrite ) READ8_MEMBER( geneve_state::cruread ) { - UINT8 value = 0; + uint8_t value = 0; int addroff = offset << 4; // Single step @@ -464,7 +464,7 @@ READ8_MEMBER( geneve_state::read_by_9901 ) break; case TMS9901_INT8_INT15: - // Read pins INT8*-INT15* of Geneve 9901. + // Read pins int8_t*-INT15* of Geneve 9901. // // bit 0: keyboard interrupt // bit 1: unused diff --git a/src/mame/drivers/geniusiq.cpp b/src/mame/drivers/geniusiq.cpp index bb1ec82b0aa..2f4c0f1c44d 100644 --- a/src/mame/drivers/geniusiq.cpp +++ b/src/mame/drivers/geniusiq.cpp @@ -266,14 +266,14 @@ public: required_device m_maincpu; required_device m_cart; - required_region_ptr m_rom; - required_shared_ptr m_vram; - required_shared_ptr m_mouse_gfx; + required_region_ptr m_rom; + required_shared_ptr m_vram; + required_shared_ptr m_mouse_gfx; virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(geniusiq); - virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER(input_r); DECLARE_WRITE16_MEMBER(mouse_pos_w); @@ -283,7 +283,7 @@ public: DECLARE_WRITE16_MEMBER(gfx_dest_w); DECLARE_WRITE16_MEMBER(gfx_color_w); DECLARE_WRITE16_MEMBER(gfx_idx_w); - void queue_input(UINT16 data); + void queue_input(uint16_t data); DECLARE_READ16_MEMBER(cart_state_r); DECLARE_READ16_MEMBER(unk0_r) { return 0; } @@ -292,18 +292,18 @@ public: DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( iq128_cart ); private: - UINT16 m_gfx_y; - UINT16 m_gfx_x; - UINT32 m_gfx_base; - UINT8 m_gfx_color[2]; - UINT8 m_mouse_posx; - UINT8 m_mouse_posy; - UINT16 m_mouse_gfx_posx; - UINT16 m_mouse_gfx_posy; - UINT8 m_cart_state; + uint16_t m_gfx_y; + uint16_t m_gfx_x; + uint32_t m_gfx_base; + uint8_t m_gfx_color[2]; + uint8_t m_mouse_posx; + uint8_t m_mouse_posy; + uint16_t m_mouse_gfx_posx; + uint16_t m_mouse_gfx_posy; + uint8_t m_cart_state; struct { - UINT16 buffer[KEYBOARD_QUEUE_SIZE]; + uint16_t buffer[KEYBOARD_QUEUE_SIZE]; int head; int tail; } m_keyboard; @@ -319,13 +319,13 @@ public: required_device m_maincpu; - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; PALETTE_INIT_MEMBER(geniusiq_state, geniusiq) { // shades need to be verified - const UINT8 palette_val[] = + const uint8_t palette_val[] = { 0x00, 0x00, 0x00, // Black?? (used in the cursor for transparency) 0xff, 0xff, 0xff, // White @@ -349,17 +349,17 @@ PALETTE_INIT_MEMBER(geniusiq_state, geniusiq) palette.set_pen_color(i, palette_val[i*3], palette_val[i*3+1], palette_val[i*3+2]); } -UINT32 gl8008cx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t gl8008cx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } -UINT32 geniusiq_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t geniusiq_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y=0; y<256; y++) for (int x=0; x<256; x+=2) { - UINT16 data = m_vram[(y*256 + x)>>1]; + uint16_t data = m_vram[(y*256 + x)>>1]; for(int b=0; b<4; b++) { @@ -372,11 +372,11 @@ UINT32 geniusiq_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap for (int y=0; y<16; y++) for (int x=0; x<6; x+=2) { - UINT16 data = m_mouse_gfx[(y*6 + x)>>1]; + uint16_t data = m_mouse_gfx[(y*6 + x)>>1]; for(int b=0; b<8; b++) { - UINT8 pen = (data>>14) & 0x03; + uint8_t pen = (data>>14) & 0x03; // I assume color 0 is transparent if(pen != 0 && screen.visible_area().contains(m_mouse_gfx_posx + x*4 + b, m_mouse_gfx_posy + y)) @@ -424,18 +424,18 @@ WRITE16_MEMBER(geniusiq_state::gfx_base_w) WRITE16_MEMBER(geniusiq_state::gfx_idx_w) { - UINT16 *gfx = m_rom + ((m_gfx_base + (data & 0xff)*32)>>1); + uint16_t *gfx = m_rom + ((m_gfx_base + (data & 0xff)*32)>>1); // first 16 bits are used to define the character size - UINT8 gfx_heigh = (gfx[0]>>0) & 0xff; - UINT8 gfx_width = (gfx[0]>>8) & 0xff; + uint8_t gfx_heigh = (gfx[0]>>0) & 0xff; + uint8_t gfx_width = (gfx[0]>>8) & 0xff; for(int y=0; y>2] = (m_vram[dst>>2] & ~(0x0f << bit_pos)) | (pen << bit_pos); @@ -453,7 +453,7 @@ READ16_MEMBER( geniusiq_state::input_r ) ---- ---- -xxx xxxx this is the scan code */ - UINT16 data = 0; + uint16_t data = 0; if(m_keyboard.head != m_keyboard.tail) { @@ -470,7 +470,7 @@ READ16_MEMBER( geniusiq_state::input_r ) return data; } -void geniusiq_state::queue_input(UINT16 data) +void geniusiq_state::queue_input(uint16_t data) { m_keyboard.buffer[m_keyboard.tail] = data; @@ -482,12 +482,12 @@ void geniusiq_state::queue_input(UINT16 data) INPUT_CHANGED_MEMBER( geniusiq_state::send_mouse_input ) { - UINT8 new_mouse_x = ioport("MOUSEX")->read(); - UINT8 new_mouse_y = ioport("MOUSEY")->read(); - UINT8 mouse_buttons = ioport("MOUSE")->read(); + uint8_t new_mouse_x = ioport("MOUSEX")->read(); + uint8_t new_mouse_y = ioport("MOUSEY")->read(); + uint8_t mouse_buttons = ioport("MOUSE")->read(); - UINT8 delta_x = (UINT8)(new_mouse_x - m_mouse_posx); - UINT8 delta_y = (UINT8)(new_mouse_y - m_mouse_posy); + uint8_t delta_x = (uint8_t)(new_mouse_x - m_mouse_posx); + uint8_t delta_y = (uint8_t)(new_mouse_y - m_mouse_posy); m_mouse_posx = new_mouse_x; m_mouse_posy = new_mouse_y; @@ -498,7 +498,7 @@ INPUT_CHANGED_MEMBER( geniusiq_state::send_mouse_input ) INPUT_CHANGED_MEMBER( geniusiq_state::send_input ) { - UINT16 data = (UINT16)(uintptr_t)param; + uint16_t data = (uint16_t)(uintptr_t)param; // set bit 7 if the key is released if (!newval) @@ -762,7 +762,7 @@ void geniusiq_state::machine_reset() DEVICE_IMAGE_LOAD_MEMBER(geniusiq_state,iq128_cart) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); // we always a 0x100000 region, for easier mapping in the memory map m_cart->rom_alloc(0x100000, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); diff --git a/src/mame/drivers/ghosteo.cpp b/src/mame/drivers/ghosteo.cpp index 67ad8f62cd9..282486b96cb 100644 --- a/src/mame/drivers/ghosteo.cpp +++ b/src/mame/drivers/ghosteo.cpp @@ -99,10 +99,10 @@ public: required_device m_i2cmem; required_device m_s3c2410; required_device m_soundlatch; - required_shared_ptr m_system_memory; + required_shared_ptr m_system_memory; int m_security_count; - UINT32 m_bballoon_port[20]; + uint32_t m_bballoon_port[20]; struct nand_t m_nand; DECLARE_READ32_MEMBER(bballoon_speedup_r); DECLARE_READ32_MEMBER(touryuu_port_10000000_r); @@ -115,7 +115,7 @@ public: DECLARE_WRITE8_MEMBER(qs1000_p3_w); int m_rom_pagesize; - UINT8* m_flash; + uint8_t* m_flash; DECLARE_DRIVER_INIT(touryuu); DECLARE_DRIVER_INIT(bballoon); virtual void machine_start() override; @@ -185,11 +185,11 @@ WRITE8_MEMBER( ghosteo_state::qs1000_p3_w ) // GPIO -static const UINT8 security_data[] = { 0x01, 0xC4, 0xFF, 0x22, 0xFF, 0xFF, 0xFF, 0xFF }; +static const uint8_t security_data[] = { 0x01, 0xC4, 0xFF, 0x22, 0xFF, 0xFF, 0xFF, 0xFF }; READ32_MEMBER(ghosteo_state::s3c2410_gpio_port_r) { - UINT32 data = m_bballoon_port[offset]; + uint32_t data = m_bballoon_port[offset]; switch (offset) { case S3C2410_GPIO_PORT_F : @@ -209,7 +209,7 @@ READ32_MEMBER(ghosteo_state::s3c2410_gpio_port_r) WRITE32_MEMBER(ghosteo_state::s3c2410_gpio_port_w) { - UINT32 old_value = m_bballoon_port[offset]; + uint32_t old_value = m_bballoon_port[offset]; m_bballoon_port[offset] = data; switch (offset) { @@ -330,7 +330,7 @@ READ8_MEMBER(ghosteo_state::s3c2410_nand_data_r ) { struct nand_t &nand = m_nand; // device_t *nand = space.machine().device( "nand"); - UINT8 data = 0; + uint8_t data = 0; switch (nand.mode) { case NAND_M_INIT : @@ -348,7 +348,7 @@ READ8_MEMBER(ghosteo_state::s3c2410_nand_data_r ) { if ((nand.byte_addr >= 0x200) && (nand.byte_addr < 0x204)) { - UINT8 mecc[4]; + uint8_t mecc[4]; m_s3c2410->s3c2410_nand_calculate_mecc( m_flash + nand.page_addr * 0x200, 0x200, mecc); data = mecc[nand.byte_addr-0x200]; } @@ -405,8 +405,8 @@ WRITE_LINE_MEMBER(ghosteo_state::s3c2410_i2c_sda_w ) READ32_MEMBER( ghosteo_state::touryuu_port_10000000_r ) { - UINT32 port_g = m_bballoon_port[S3C2410_GPIO_PORT_G]; - UINT32 data = 0xFFFFFFFF; + uint32_t port_g = m_bballoon_port[S3C2410_GPIO_PORT_G]; + uint32_t data = 0xFFFFFFFF; switch (port_g) { case 0x8 : data = ioport( "10000000-08")->read(); break; @@ -565,7 +565,7 @@ INPUT_PORTS_END READ32_MEMBER(ghosteo_state::bballoon_speedup_r) { - UINT32 ret = m_s3c2410->s3c24xx_lcd_r(space, offset+0x10/4, mem_mask); + uint32_t ret = m_s3c2410->s3c24xx_lcd_r(space, offset+0x10/4, mem_mask); int pc = space.device().safe_pc(); @@ -597,7 +597,7 @@ WRITE32_MEMBER(ghosteo_state::soundlatch_w) void ghosteo_state::machine_start() { - m_flash = (UINT8 *)memregion( "user1")->base(); + m_flash = (uint8_t *)memregion( "user1")->base(); // Set up the QS1000 program ROM banking, taking care not to overlap the internal RAM machine().device("qs1000:cpu")->memory().space(AS_IO).install_read_bank(0x0100, 0xffff, "bank"); diff --git a/src/mame/drivers/gijoe.cpp b/src/mame/drivers/gijoe.cpp index 7f29fd19907..5b0368bde6b 100644 --- a/src/mame/drivers/gijoe.cpp +++ b/src/mame/drivers/gijoe.cpp @@ -142,7 +142,7 @@ WRITE16_MEMBER(gijoe_state::control2_w) void gijoe_state::gijoe_objdma( ) { - UINT16 *src_head, *src_tail, *dst_head, *dst_tail; + uint16_t *src_head, *src_tail, *dst_head, *dst_tail; src_head = m_spriteram; src_tail = m_spriteram + 255 * 8; diff --git a/src/mame/drivers/gimix.cpp b/src/mame/drivers/gimix.cpp index 23684f53b9b..9a00d2216f6 100644 --- a/src/mame/drivers/gimix.cpp +++ b/src/mame/drivers/gimix.cpp @@ -119,20 +119,20 @@ public: DECLARE_FLOPPY_FORMATS(floppy_formats); private: - UINT8 m_term_data; - UINT8 m_dma_status; - UINT8 m_dma_ctrl; - UINT8 m_dma_drive_select; - UINT16 m_dma_start_addr; - UINT32 m_dma_current_addr; - UINT8 m_task; - UINT8 m_task_banks[16][16]; - UINT8 m_selected_drive; + uint8_t m_term_data; + uint8_t m_dma_status; + uint8_t m_dma_ctrl; + uint8_t m_dma_drive_select; + uint16_t m_dma_start_addr; + uint32_t m_dma_current_addr; + uint8_t m_task; + uint8_t m_task_banks[16][16]; + uint8_t m_selected_drive; bool m_floppy0_ready; bool m_floppy1_ready; - UINT8 m_pia1_pa; - UINT8 m_pia1_pb; + uint8_t m_pia1_pa; + uint8_t m_pia1_pb; virtual void machine_reset() override; virtual void machine_start() override; @@ -228,7 +228,7 @@ INPUT_PORTS_END READ8_MEMBER( gimix_state::keyin_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -498,7 +498,7 @@ void gimix_state::machine_reset() void gimix_state::machine_start() { - UINT8* ROM = m_rom->base(); + uint8_t* ROM = m_rom->base(); m_rombank1->configure_entries(0,4,ROM,0x800); m_rombank2->configure_entries(0,4,ROM,0x800); m_fixedrombank->configure_entries(0,4,ROM+0x700,0x800); diff --git a/src/mame/drivers/ginganin.cpp b/src/mame/drivers/ginganin.cpp index 4510b0c22fc..2346803e542 100644 --- a/src/mame/drivers/ginganin.cpp +++ b/src/mame/drivers/ginganin.cpp @@ -361,10 +361,10 @@ ROM_END DRIVER_INIT_MEMBER(ginganin_state,ginganin) { - UINT16 *rom; + uint16_t *rom; /* main cpu patches */ - rom = (UINT16 *)memregion("maincpu")->base(); + rom = (uint16_t *)memregion("maincpu")->base(); /* avoid writes to rom getting to the log */ rom[0x408 / 2] = 0x6000; rom[0x40a / 2] = 0x001c; diff --git a/src/mame/drivers/gizmondo.cpp b/src/mame/drivers/gizmondo.cpp index a520c72fc7f..ecfc2f97276 100644 --- a/src/mame/drivers/gizmondo.cpp +++ b/src/mame/drivers/gizmondo.cpp @@ -39,7 +39,7 @@ SYSINTR_GPS = INT_EINT3, INT_EINT8_23 (EINT18) #define VERBOSE_LEVEL ( 0 ) -#define BITS(x,m,n) (((x)>>(n))&(((UINT32)1<<((m)-(n)+1))-1)) +#define BITS(x,m,n) (((x)>>(n))&(((uint32_t)1<<((m)-(n)+1))-1)) class gizmondo_state : public driver_device { @@ -51,7 +51,7 @@ public: m_gf4500(*this, "gf4500") { } - UINT32 m_port[9]; + uint32_t m_port[9]; required_device m_s3c2440; DECLARE_DRIVER_INIT(gizmondo); virtual void machine_start() override; @@ -87,7 +87,7 @@ inline void gizmondo_state::verboselog( int n_level, const char *s_fmt, ...) READ32_MEMBER(gizmondo_state::s3c2440_gpio_port_r) { - UINT32 data = m_port[offset]; + uint32_t data = m_port[offset]; switch (offset) { case S3C2440_GPIO_PORT_D : @@ -98,7 +98,7 @@ READ32_MEMBER(gizmondo_state::s3c2440_gpio_port_r) break; case S3C2440_GPIO_PORT_F : { - UINT32 port_c = m_port[S3C2440_GPIO_PORT_C]; + uint32_t port_c = m_port[S3C2440_GPIO_PORT_C]; data = data & ~0x000000F2; // keys data |= 0x00F2; diff --git a/src/mame/drivers/gkigt.cpp b/src/mame/drivers/gkigt.cpp index fe2411e57f5..2d4f40082d7 100644 --- a/src/mame/drivers/gkigt.cpp +++ b/src/mame/drivers/gkigt.cpp @@ -94,7 +94,7 @@ public: { } virtual void video_start() override; - UINT32 screen_update_igt_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_igt_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void machine_start() override; virtual void machine_reset() override; @@ -129,7 +129,7 @@ void igt_gameking_state::video_start() { } -UINT32 igt_gameking_state::screen_update_igt_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igt_gameking_state::screen_update_igt_gameking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/gladiatr.cpp b/src/mame/drivers/gladiatr.cpp index 2c82af4487a..2fdda445943 100644 --- a/src/mame/drivers/gladiatr.cpp +++ b/src/mame/drivers/gladiatr.cpp @@ -949,7 +949,7 @@ ROM_START( gcastle ) ROM_END -void gladiatr_state::swap_block(UINT8 *src1,UINT8 *src2,int len) +void gladiatr_state::swap_block(uint8_t *src1,uint8_t *src2,int len) { int i,t; @@ -963,7 +963,7 @@ void gladiatr_state::swap_block(UINT8 *src1,UINT8 *src2,int len) DRIVER_INIT_MEMBER(gladiatr_state,gladiatr) { - UINT8 *rom; + uint8_t *rom; int i,j; rom = memregion("gfx2")->base(); @@ -1014,7 +1014,7 @@ READ8_MEMBER(gladiatr_state::ppking_f6a3_r) DRIVER_INIT_MEMBER(gladiatr_state,ppking) { - UINT8 *rom; + uint8_t *rom; int i,j; rom = memregion("gfx2")->base(); diff --git a/src/mame/drivers/glasgow.cpp b/src/mame/drivers/glasgow.cpp index 18e2d1fc5cd..ac3a9b22e7d 100644 --- a/src/mame/drivers/glasgow.cpp +++ b/src/mame/drivers/glasgow.cpp @@ -85,20 +85,20 @@ public: DECLARE_MACHINE_RESET(glasgow); private: - UINT8 m_lcd_shift_counter; - UINT8 m_led7; - UINT8 m_key_select; + uint8_t m_lcd_shift_counter; + uint8_t m_led7; + uint8_t m_key_select; bool m_lcd_invert; bool m_key_selector; - UINT8 m_read_board_flag; - UINT8 m_mouse_hold; - UINT8 m_board_row; - UINT8 m_mouse_down; - UINT16 m_Line18_LED; - UINT16 m_Line18_REED; - UINT8 m_selected[2]; - - UINT8 pos_to_num( UINT8 ); + uint8_t m_read_board_flag; + uint8_t m_mouse_hold; + uint8_t m_board_row; + uint8_t m_mouse_down; + uint16_t m_Line18_LED; + uint16_t m_Line18_REED; + uint8_t m_selected[2]; + + uint8_t pos_to_num( uint8_t ); void set_board( ); void glasgow_pieces_w( ); @@ -109,8 +109,8 @@ private: typedef struct { - UINT8 field; - UINT8 piece; + uint8_t field; + uint8_t piece; } BOARD_FIELD; BOARD_FIELD l_board[8][8]; @@ -130,7 +130,7 @@ const BOARD_FIELD l_start_board[8][8] = { {63,4}, {62,2}, {61,3}, {60,5}, {59,6}, {58,3}, {57,2}, {56,4} } }; -UINT8 glasgow_state::pos_to_num( UINT8 val ) +uint8_t glasgow_state::pos_to_num( uint8_t val ) { switch (val) { @@ -148,7 +148,7 @@ UINT8 glasgow_state::pos_to_num( UINT8 val ) void glasgow_state::set_board( ) { - UINT8 i_AH, i_18; + uint8_t i_AH, i_18; for (i_AH = 0; i_AH < 8; i_AH++) { @@ -163,7 +163,7 @@ void glasgow_state::set_board( ) void glasgow_state::glasgow_pieces_w( ) { // This causes the pieces to display on-screen - UINT8 i_18, i_AH; + uint8_t i_18, i_AH; for (i_18 = 0; i_18 < 8; i_18++) for (i_AH = 0; i_AH < 8; i_AH++) @@ -172,7 +172,7 @@ void glasgow_state::glasgow_pieces_w( ) WRITE16_MEMBER( glasgow_state::glasgow_lcd_w ) { - UINT8 lcd_data = data >> 8; + uint8_t lcd_data = data >> 8; if (m_led7 == 0) output().set_digit_value(m_lcd_shift_counter, lcd_data); @@ -183,7 +183,7 @@ WRITE16_MEMBER( glasgow_state::glasgow_lcd_w ) WRITE16_MEMBER( glasgow_state::glasgow_lcd_flag_w ) { - UINT16 lcd_flag = data & 0x8100; + uint16_t lcd_flag = data & 0x8100; m_beep->set_state(BIT(lcd_flag, 8)); @@ -202,12 +202,12 @@ READ16_MEMBER( glasgow_state::glasgow_keys_r ) m_board_row &= 7; // See if we are moving a piece - UINT8 data = m_keyboard[m_board_row]->read(); + uint8_t data = m_keyboard[m_board_row]->read(); if ((data < 0xff) && (m_mouse_down == 0)) { - UINT8 pos2num_res = pos_to_num(data); - UINT8 piece = l_board[m_board_row][pos2num_res].piece; + uint8_t pos2num_res = pos_to_num(data); + uint8_t piece = l_board[m_board_row][pos2num_res].piece; if (pos2num_res > 7) logerror("Position out of bound!"); @@ -268,7 +268,7 @@ WRITE16_MEMBER( glasgow_state::glasgow_keys_w ) READ16_MEMBER( glasgow_state::glasgow_board_r ) { - UINT8 i_AH, data = 0; + uint8_t i_AH, data = 0; if (m_Line18_REED < 8) { @@ -305,9 +305,9 @@ WRITE16_MEMBER( glasgow_state::glasgow_board_w ) WRITE16_MEMBER( glasgow_state::glasgow_beeper_w ) { - UINT8 i_AH, i_18; - UINT8 LED; - UINT16 LineAH = data >> 8; + uint8_t i_AH, i_18; + uint8_t LED; + uint16_t LineAH = data >> 8; if (LineAH && m_Line18_LED) { @@ -352,7 +352,7 @@ WRITE16_MEMBER( glasgow_state::write_beeper ) WRITE16_MEMBER( glasgow_state::write_lcd ) { - UINT8 lcd_data = data >> 8; + uint8_t lcd_data = data >> 8; output().set_digit_value(m_lcd_shift_counter, m_lcd_invert ? lcd_data^0xff : lcd_data); m_lcd_shift_counter--; @@ -363,7 +363,7 @@ WRITE16_MEMBER( glasgow_state::write_lcd ) WRITE16_MEMBER( glasgow_state::write_lcd_flag ) { m_lcd_invert = 0; - UINT8 lcd_flag = data >> 8; + uint8_t lcd_flag = data >> 8; //beep_set_state(0, lcd_flag & 1 ? 1 : 0); if (lcd_flag == 0) m_key_selector = 1; @@ -382,7 +382,7 @@ READ16_MEMBER( glasgow_state::read_board ) WRITE16_MEMBER( glasgow_state::write_board ) { - UINT8 board = data >> 8; + uint8_t board = data >> 8; if (board == 0xff) m_key_selector = 0; @@ -401,7 +401,7 @@ WRITE16_MEMBER( glasgow_state::write_irq_flag ) READ16_MEMBER( glasgow_state::read_newkeys16 ) //Amsterdam, Roma { - UINT16 data; + uint16_t data; if (m_key_selector) data = ioport("LINE1")->read(); @@ -430,7 +430,7 @@ READ16_MEMBER(read_test) WRITE32_MEMBER( glasgow_state::write_lcd32 ) { - UINT8 lcd_data = data >> 8; + uint8_t lcd_data = data >> 8; output().set_digit_value(m_lcd_shift_counter, m_lcd_invert ? lcd_data^0xff : lcd_data); m_lcd_shift_counter--; @@ -440,7 +440,7 @@ WRITE32_MEMBER( glasgow_state::write_lcd32 ) WRITE32_MEMBER( glasgow_state::write_lcd_flag32 ) { - UINT8 lcd_flag = data >> 24; + uint8_t lcd_flag = data >> 24; m_lcd_invert = 0; @@ -463,7 +463,7 @@ WRITE32_MEMBER( glasgow_state::write_keys32 ) READ32_MEMBER( glasgow_state::read_newkeys32 ) // Dallas 32, Roma 32 { - UINT32 data; + uint32_t data; if (m_key_selector) data = ioport("LINE1")->read(); @@ -491,7 +491,7 @@ READ16_MEMBER(read_board_amsterd) WRITE32_MEMBER( glasgow_state::write_board32 ) { - UINT8 board = data >> 24; + uint8_t board = data >> 24; if (board == 0xff) m_key_selector = 0; logerror("Write Board = %x \n", data); diff --git a/src/mame/drivers/glass.cpp b/src/mame/drivers/glass.cpp index 285970b54e7..a770362abef 100644 --- a/src/mame/drivers/glass.cpp +++ b/src/mame/drivers/glass.cpp @@ -324,10 +324,10 @@ void glass_state::ROM16_split_gfx( const char *src_reg, const char *dst_reg, int 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++) @@ -346,7 +346,7 @@ void glass_state::ROM16_split_gfx( const char *src_reg, const char *dst_reg, int READ16_MEMBER( glass_state::mainram_r ) { - UINT16 ret = m_mainram[offset]; + uint16_t ret = m_mainram[offset]; int pc = space.device().safe_pc(); if (offset == (0xfede96 - 0xfec000)>>1) diff --git a/src/mame/drivers/gluck2.cpp b/src/mame/drivers/gluck2.cpp index b7f35d8552c..a2b46f8ebe8 100644 --- a/src/mame/drivers/gluck2.cpp +++ b/src/mame/drivers/gluck2.cpp @@ -214,8 +214,8 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; @@ -227,7 +227,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(gluck2); - 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); }; @@ -272,7 +272,7 @@ void gluck2_state::video_start() } -UINT32 gluck2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gluck2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -281,7 +281,7 @@ UINT32 gluck2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, PALETTE_INIT_MEMBER(gluck2_state, gluck2) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < 0x100; i++) diff --git a/src/mame/drivers/gmaster.cpp b/src/mame/drivers/gmaster.cpp index dc586efab82..f414bdf1ac6 100644 --- a/src/mame/drivers/gmaster.cpp +++ b/src/mame/drivers/gmaster.cpp @@ -29,23 +29,23 @@ public: DECLARE_READ8_MEMBER(gmaster_port_r); DECLARE_WRITE8_MEMBER(gmaster_port_w); DECLARE_DRIVER_INIT(gmaster) { memset(&m_video, 0, sizeof(m_video)); memset(m_ram, 0, sizeof(m_ram)); } - UINT32 screen_update_gmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: virtual void machine_start() override; struct { - UINT8 data[8]; + uint8_t data[8]; int index; int x, y; bool mode; // true read does not increase address bool delayed; - UINT8 pixels[8][64]; + uint8_t pixels[8][64]; } m_video; - UINT8 m_ports[5]; - UINT8 m_ram[0x4000]; + uint8_t m_ports[5]; + uint8_t m_ram[0x4000]; required_device m_maincpu; required_device m_speaker; required_device m_cart; @@ -55,7 +55,7 @@ private: READ8_MEMBER(gmaster_state::gmaster_io_r) { - UINT8 data = 0; + uint8_t data = 0; if (m_ports[2] & 1) { @@ -151,8 +151,8 @@ WRITE8_MEMBER(gmaster_state::gmaster_io_w) READ8_MEMBER(gmaster_state::gmaster_port_r) { -// UINT8 data = m_ports[offset]; - UINT8 data = 0xff; +// uint8_t data = m_ports[offset]; + uint8_t data = 0xff; switch (offset) { case UPD7810_PORTA: @@ -230,15 +230,15 @@ PALETTE_INIT_MEMBER(gmaster_state, gmaster) } -UINT32 gmaster_state::screen_update_gmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gmaster_state::screen_update_gmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; for (y = 0; y < ARRAY_LENGTH(m_video.pixels); y++) { for (x = 0; x < ARRAY_LENGTH(m_video.pixels[0]); x++) { - UINT8 d = m_video.pixels[y][x]; - UINT16 *line; + uint8_t d = m_video.pixels[y][x]; + uint16_t *line; line = &bitmap.pix16((y * 8), x); line[0] = BIT(d, 0); diff --git a/src/mame/drivers/gng.cpp b/src/mame/drivers/gng.cpp index 21b0b3b6c14..656aa49b122 100644 --- a/src/mame/drivers/gng.cpp +++ b/src/mame/drivers/gng.cpp @@ -305,7 +305,7 @@ GFXDECODE_END void gng_state::machine_start() { - UINT8 *rombase = memregion("maincpu")->base(); + uint8_t *rombase = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x2000); membank("bank1")->configure_entry(4, &rombase[0x4000]); diff --git a/src/mame/drivers/go2000.cpp b/src/mame/drivers/go2000.cpp index 82316f301df..2eccde30471 100644 --- a/src/mame/drivers/go2000.cpp +++ b/src/mame/drivers/go2000.cpp @@ -53,8 +53,8 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; /* devices */ required_device m_maincpu; @@ -68,7 +68,7 @@ public: DECLARE_WRITE8_MEMBER(go2000_pcm_1_bankswitch_w); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_go2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_go2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -190,7 +190,7 @@ void go2000_state::video_start() { } -UINT32 go2000_state::screen_update_go2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t go2000_state::screen_update_go2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int count = 0; @@ -320,7 +320,7 @@ UINT32 go2000_state::screen_update_go2000(screen_device &screen, bitmap_ind16 &b void go2000_state::machine_start() { - UINT8 *SOUND = memregion("soundcpu")->base(); + uint8_t *SOUND = memregion("soundcpu")->base(); int i; for (i = 0; i < 8; i++) diff --git a/src/mame/drivers/goal92.cpp b/src/mame/drivers/goal92.cpp index 26fc4e032ae..1e3f99e4f9c 100644 --- a/src/mame/drivers/goal92.cpp +++ b/src/mame/drivers/goal92.cpp @@ -273,7 +273,7 @@ GFXDECODE_END void goal92_state::machine_start() { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/goindol.cpp b/src/mame/drivers/goindol.cpp index 6c1a76541ed..72dd3c7fed0 100644 --- a/src/mame/drivers/goindol.cpp +++ b/src/mame/drivers/goindol.cpp @@ -216,7 +216,7 @@ GFXDECODE_END void goindol_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000); @@ -375,7 +375,7 @@ ROM_END DRIVER_INIT_MEMBER(goindol_state,goindol) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* I hope that's all patches to avoid protection */ diff --git a/src/mame/drivers/goldngam.cpp b/src/mame/drivers/goldngam.cpp index 18ad31bd62d..4fe59c830b4 100644 --- a/src/mame/drivers/goldngam.cpp +++ b/src/mame/drivers/goldngam.cpp @@ -247,11 +247,11 @@ public: m_videoram(*this, "videoram"), m_maincpu(*this, "maincpu") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; DECLARE_READ16_MEMBER(unk_r); virtual void video_start() override; DECLARE_PALETTE_INIT(goldngam); - UINT32 screen_update_goldngam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_goldngam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -264,7 +264,7 @@ void goldngam_state::video_start() { } -UINT32 goldngam_state::screen_update_goldngam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t goldngam_state::screen_update_goldngam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int index = 0; @@ -272,7 +272,7 @@ UINT32 goldngam_state::screen_update_goldngam(screen_device &screen, bitmap_ind1 { for(int x = 0; x < 384; x += 2) { - UINT16 word = m_videoram[index]; + uint16_t word = m_videoram[index]; bitmap.pix16(y, x) = word >> 8; bitmap.pix16(y, x+1) = word & 0xff; ++index; diff --git a/src/mame/drivers/goldnpkr.cpp b/src/mame/drivers/goldnpkr.cpp index 97249007cca..8ca168162d6 100644 --- a/src/mame/drivers/goldnpkr.cpp +++ b/src/mame/drivers/goldnpkr.cpp @@ -1103,11 +1103,11 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; - UINT8 m_mux_data; - UINT8 m_pia0_PA_data; + uint8_t m_mux_data; + uint8_t m_pia0_PA_data; DECLARE_WRITE8_MEMBER(goldnpkr_videoram_w); DECLARE_WRITE8_MEMBER(goldnpkr_colorram_w); DECLARE_READ8_MEMBER(goldnpkr_mux_port_r); @@ -1154,7 +1154,7 @@ public: DECLARE_PALETTE_INIT(wcrdxtnd); DECLARE_MACHINE_START(mondial); DECLARE_MACHINE_RESET(mondial); - UINT32 screen_update_goldnpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_goldnpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; optional_device m_discrete; required_device m_gfxdecode; @@ -1225,7 +1225,7 @@ VIDEO_START_MEMBER(goldnpkr_state,wcrdxtnd) m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(goldnpkr_state::wcrdxtnd_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 goldnpkr_state::screen_update_goldnpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t goldnpkr_state::screen_update_goldnpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -1233,7 +1233,7 @@ UINT32 goldnpkr_state::screen_update_goldnpkr(screen_device &screen, bitmap_ind1 PALETTE_INIT_MEMBER(goldnpkr_state, goldnpkr) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); /* prom bits 7654 3210 ---- ---x red component. @@ -1277,7 +1277,7 @@ PALETTE_INIT_MEMBER(goldnpkr_state, goldnpkr) PALETTE_INIT_MEMBER(goldnpkr_state,witchcrd) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); /* This hardware has a feature called BLUE KILLER. Using the original intensity line, the PCB has a bridge @@ -1325,7 +1325,7 @@ PALETTE_INIT_MEMBER(goldnpkr_state,witchcrd) PALETTE_INIT_MEMBER(goldnpkr_state,wcrdxtnd) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); /* Using the original intensity line, the PCB has a bridge that allow (as default) turn the background dark blue. @@ -1400,7 +1400,7 @@ READ8_MEMBER(goldnpkr_state::goldnpkr_mux_port_r) READ8_MEMBER(goldnpkr_state::pottnpkr_mux_port_r) { - UINT8 pa_0_4 = 0xff, pa_7; /* Temporary place holder for bits 0 to 4 & 7 */ + uint8_t pa_0_4 = 0xff, pa_7; /* Temporary place holder for bits 0 to 4 & 7 */ switch( m_mux_data & 0xf0 ) /* bits 4-7 */ { @@ -1429,7 +1429,7 @@ WRITE8_MEMBER(goldnpkr_state::mux_port_w) /* Demuxing ay8910 data/address from Falcon board, PIA portA out */ -UINT8 wcfalcon_flag = 0; +uint8_t wcfalcon_flag = 0; WRITE8_MEMBER(goldnpkr_state::wcfalcon_snd_w) { @@ -4005,13 +4005,13 @@ DISCRETE_SOUND_END MACHINE_START_MEMBER(goldnpkr_state, mondial) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0], 0x4000); } MACHINE_RESET_MEMBER(goldnpkr_state, mondial) { - UINT8 seldsw = (ioport("SELDSW")->read() ); + uint8_t seldsw = (ioport("SELDSW")->read() ); popmessage("ROM Bank: %02X", seldsw); membank("bank1")->set_entry(seldsw); @@ -10495,7 +10495,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, flcnw) { /* Attempt to decrypt the MCU program (we're sooo close!) */ - UINT8 *ROM = memregion("mcu")->base(); + uint8_t *ROM = memregion("mcu")->base(); int size = memregion("mcu")->bytes(); int start = 0x0000; int i; @@ -10514,7 +10514,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlsa) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe097] = 0xea; ROM[0xe098] = 0xea; @@ -10526,7 +10526,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlsb) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe87b] = 0xea; ROM[0xe87c] = 0xea; @@ -10538,7 +10538,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlsc) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x453a] = 0xea; ROM[0x453b] = 0xea; @@ -10550,7 +10550,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlsww) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xf2c9] = 0xea; ROM[0xf2ca] = 0xea; @@ -10562,7 +10562,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwa) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xdf80] = 0xea; ROM[0xdf81] = 0xea; @@ -10574,7 +10574,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwc) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe42f] = 0xea; ROM[0xe430] = 0xea; @@ -10586,7 +10586,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwd) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe442] = 0xea; ROM[0xe443] = 0xea; @@ -10598,7 +10598,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwh) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe4d5] = 0xea; ROM[0xe4d6] = 0xea; @@ -10610,7 +10610,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwl) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe87c] = 0xea; ROM[0xe87d] = 0xea; @@ -10622,7 +10622,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwo) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe7d5] = 0xea; ROM[0xe7d6] = 0xea; @@ -10634,7 +10634,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwp) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe7d9] = 0xea; ROM[0xe7da] = 0xea; @@ -10646,7 +10646,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwr) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe7f7] = 0xea; ROM[0xe7f8] = 0xea; @@ -10658,7 +10658,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswws) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe8a5] = 0xea; ROM[0xe8a6] = 0xea; @@ -10670,7 +10670,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwt) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xe955] = 0xea; ROM[0xe956] = 0xea; @@ -10682,7 +10682,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwu) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xee6b] = 0xea; ROM[0xee6c] = 0xea; @@ -10694,7 +10694,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, vkdlswwv) after compare with Dallas TK data */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xf052] = 0xea; ROM[0xf053] = 0xea; @@ -10742,7 +10742,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, icp1db) { /* int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); unsigned char rawData[256] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, @@ -10815,7 +10815,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, wstrike) after compare with a string inside the Dallas TK RAM */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0xf2e1] = 0xea; ROM[0xf2e2] = 0xea; @@ -10826,7 +10826,7 @@ DRIVER_INIT_MEMBER(goldnpkr_state, bchancep) { /* Attempt to invert the color data from the bipolar PROM */ - UINT8 *ROM = memregion("proms")->base(); + uint8_t *ROM = memregion("proms")->base(); int size = memregion("proms")->bytes(); int start = 0x0000; int i; diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp index 9369b45b194..68f56f3fb1a 100644 --- a/src/mame/drivers/goldstar.cpp +++ b/src/mame/drivers/goldstar.cpp @@ -7370,12 +7370,12 @@ static const gfx_layout tiles8x32x4alt_layout = 16*32 }; -static const UINT32 layout_xoffset[128] = +static const uint32_t layout_xoffset[128] = { STEP32(0*128,4),STEP32(1*128,4),STEP32(2*128,4),STEP32(3*128,4) }; -static const UINT32 layout_yoffset[128] = +static const uint32_t layout_yoffset[128] = { STEP32(0*16384, 512),STEP32(1*16384,512),STEP32(2*16384,512),STEP32(3*16384,512) }; @@ -7394,12 +7394,12 @@ static const gfx_layout tiles128x128x4_layout = }; -static const UINT32 layout_xoffset256[256] = +static const uint32_t layout_xoffset256[256] = { STEP32(0*128,4),STEP32(1*128,4),STEP32(2*128,4),STEP32(3*128,4), STEP32(4*128,4), STEP32(5*128,4), STEP32(6*128,4), STEP32(7*128,4) }; -static const UINT32 layout_yoffset256[256] = +static const uint32_t layout_yoffset256[256] = { STEP32(0*32768, 1024),STEP32(1*32768,1024),STEP32(2*32768,1024),STEP32(3*32768,1024),STEP32(4*32768,1024), STEP32(5*32768,1024),STEP32(6*32768,1024),STEP32(7*32768,1024) }; @@ -8019,8 +8019,8 @@ PALETTE_INIT_MEMBER(goldstar_state, cm) for (i = 0; i < 0x100; i++) { - UINT8 data; - UINT8*proms = memregion("proms")->base(); + uint8_t data; + uint8_t*proms = memregion("proms")->base(); data = proms[0x000 + i] | (proms[0x100 + i] << 4); @@ -8035,7 +8035,7 @@ PALETTE_INIT_MEMBER(goldstar_state, cmast91) { int r,g,b; - UINT8*proms = memregion("proms")->base(); + uint8_t*proms = memregion("proms")->base(); b = proms[0x000 + i] << 4; g = proms[0x100 + i] << 4; @@ -8050,8 +8050,8 @@ PALETTE_INIT_MEMBER(goldstar_state, lucky8) /* BBGGGRRR */ int i; - UINT8 data; - UINT8 *proms; + uint8_t data; + uint8_t *proms; proms = memregion("proms")->base(); for (i = 0; i < 0x100; i++) @@ -8446,10 +8446,10 @@ PALETTE_INIT_MEMBER(wingco_state, magodds) { for (int i = 0; i < 0x100; i++) { - UINT8 *proms = memregion("proms")->base(); - UINT8 b = proms[0x000 + i] << 4; - UINT8 g = proms[0x100 + i] << 4; - UINT8 r = proms[0x200 + i] << 4; + uint8_t *proms = memregion("proms")->base(); + uint8_t b = proms[0x000 + i] << 4; + uint8_t g = proms[0x100 + i] << 4; + uint8_t r = proms[0x200 + i] << 4; palette.set_pen_color(i, rgb_t(r, g, b)); } @@ -11556,7 +11556,7 @@ is this the original Magical Odds? DRIVER_INIT_MEMBER(wingco_state, magoddsc) { int A; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (A = 0;A < 0x8000;A++) { @@ -12950,10 +12950,10 @@ ROM_END DRIVER_INIT_MEMBER(cmaster_state, fb2010) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0;i < 0x10000;i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 0x22) { @@ -14898,7 +14898,7 @@ ROM_END DRIVER_INIT_MEMBER(goldstar_state,goldstar) { int A; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (A = 0; A < 0x10000; A++) { @@ -14911,11 +14911,11 @@ DRIVER_INIT_MEMBER(goldstar_state,goldstar) // this block swapping is the same for chry10, chrygld and cb3 // the underlying bitswaps / xors are different however -void cb3_state::do_blockswaps(UINT8* ROM) +void cb3_state::do_blockswaps(uint8_t* ROM) { int A; - static const UINT16 cherry_swaptables[32] = { + static const uint16_t cherry_swaptables[32] = { /* to align with goldstar */ 0x0800, 0x4000, 0x2800, 0x5800, 0x1800, 0x3000, 0x6800, 0x7000, @@ -14929,7 +14929,7 @@ void cb3_state::do_blockswaps(UINT8* ROM) 0xa000, 0xa800, 0xb000, 0xb800, }; - std::vector buffer(0x10000); + std::vector buffer(0x10000); memcpy(&buffer[0], ROM, 0x10000); // swap some 0x800 blocks around.. @@ -14939,7 +14939,7 @@ void cb3_state::do_blockswaps(UINT8* ROM) } } -void cb3_state::dump_to_file( UINT8* ROM) +void cb3_state::dump_to_file( uint8_t* ROM) { #if 0 { @@ -14956,10 +14956,10 @@ void cb3_state::dump_to_file( UINT8* ROM) #endif } -UINT8 cb3_state::cb3_decrypt(UINT8 cipherText, UINT16 address) +uint8_t cb3_state::cb3_decrypt(uint8_t cipherText, uint16_t address) { int idx; - UINT8 output; + uint8_t output; int rotation[8] = {1, 0, 0, 1, 0, 1, 1, 1}; int sbox[8] = {0x08, 0x08, 0x28, 0x00, 0x20, 0x20, 0x88, 0x88}; @@ -14973,14 +14973,14 @@ UINT8 cb3_state::cb3_decrypt(UINT8 cipherText, UINT16 address) return output ^ sbox[idx]; } -UINT8 cb3_state::chry10_decrypt(UINT8 cipherText) +uint8_t cb3_state::chry10_decrypt(uint8_t cipherText) { return cipherText ^ (BIT(cipherText, 4) << 3) ^ (BIT(cipherText, 1) << 5) ^ (BIT(cipherText, 6) << 7); } DRIVER_INIT_MEMBER(cb3_state, chry10) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); int start = 0; @@ -15004,7 +15004,7 @@ DRIVER_INIT_MEMBER(cb3_state, chry10) DRIVER_INIT_MEMBER(cb3_state, cb3) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); int start = 0; @@ -15023,13 +15023,13 @@ DRIVER_INIT_MEMBER(cb3_state, cb3) DRIVER_INIT_MEMBER(cb3_state, chrygld) { int A; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); do_blockswaps(ROM); // a data bitswap for (A = 0; A < 0x10000; A++) { - UINT8 dat = ROM[A]; + uint8_t dat = ROM[A]; dat = BITSWAP8(dat, 5, 6, 3, 4, 7, 2, 1, 0); ROM[A] = dat; } @@ -15039,7 +15039,7 @@ DRIVER_INIT_MEMBER(cb3_state, chrygld) DRIVER_INIT_MEMBER(cmaster_state, cm) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* forcing PPI mode 0 for all, and A, B & C as input. the mixed modes 2-0 are not working properly. @@ -15050,7 +15050,7 @@ DRIVER_INIT_MEMBER(cmaster_state, cm) DRIVER_INIT_MEMBER(cmaster_state, cmv4) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* forcing PPI mode 0 for all, and A, B & C as input. the mixed modes 2-0 are not working properly. @@ -15061,7 +15061,7 @@ DRIVER_INIT_MEMBER(cmaster_state, cmv4) DRIVER_INIT_MEMBER(goldstar_state, cmast91) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* forcing PPI mode 0 for all, and A, B & C as input. the mixed modes 2-0 are not working properly. @@ -15072,7 +15072,7 @@ DRIVER_INIT_MEMBER(goldstar_state, cmast91) DRIVER_INIT_MEMBER(wingco_state, lucky8a) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x0010] = 0x21; } @@ -15080,11 +15080,11 @@ DRIVER_INIT_MEMBER(wingco_state, lucky8a) DRIVER_INIT_MEMBER(cmaster_state, nfb96sea) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 7) { case 0: x = BITSWAP8(x ^ 0x80, 1, 6, 7, 4, 5, 2, 3, 0); break; @@ -15105,10 +15105,10 @@ DRIVER_INIT_MEMBER(cmaster_state, nfb96sea) DRIVER_INIT_MEMBER(cmaster_state, schery97) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 0x12) { case 0x00: x = BITSWAP8(x ^ 0x3e, 1, 0, 7, 6, 5, 4, 3, 2); break; @@ -15127,10 +15127,10 @@ DRIVER_INIT_MEMBER(cmaster_state, schery97) DRIVER_INIT_MEMBER(cmaster_state, schery97a) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 6) { case 0: x = BITSWAP8(x ^ 0xb9, 4, 0, 6, 7, 3, 1, 5, 2); break; @@ -15150,10 +15150,10 @@ DRIVER_INIT_MEMBER(cmaster_state, schery97a) DRIVER_INIT_MEMBER(cmaster_state, skill98) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 0x12) { case 0x00: x = BITSWAP8(x ^ 0x21, 2, 1, 0, 7, 6, 5, 4, 3); break; @@ -15171,10 +15171,10 @@ DRIVER_INIT_MEMBER(cmaster_state, skill98) DRIVER_INIT_MEMBER(cmaster_state, nfb96_c1) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 0x12) { @@ -15192,10 +15192,10 @@ DRIVER_INIT_MEMBER(cmaster_state, nfb96_c1) DRIVER_INIT_MEMBER(cmaster_state, nfb96_c2) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 0x22) { @@ -15213,10 +15213,10 @@ DRIVER_INIT_MEMBER(cmaster_state, nfb96_c2) DRIVER_INIT_MEMBER(cmaster_state, nfb96_d) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 5) { @@ -15240,10 +15240,10 @@ DRIVER_INIT_MEMBER(cmaster_state, nfb96_d) DRIVER_INIT_MEMBER(cmaster_state, nfb96_dk) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 5) { @@ -15261,10 +15261,10 @@ DRIVER_INIT_MEMBER(cmaster_state, nfb96_dk) DRIVER_INIT_MEMBER(cmaster_state, rp35) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 3) { @@ -15283,10 +15283,10 @@ DRIVER_INIT_MEMBER(cmaster_state, rp35) DRIVER_INIT_MEMBER(cmaster_state, rp36) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 5) { @@ -15305,10 +15305,10 @@ DRIVER_INIT_MEMBER(cmaster_state, rp36) DRIVER_INIT_MEMBER(cmaster_state, rp36c3) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 0xa) { @@ -15327,10 +15327,10 @@ DRIVER_INIT_MEMBER(cmaster_state, rp36c3) DRIVER_INIT_MEMBER(cmaster_state, rp96sub) // 95 33 95 33 70 6C 70 6C... XORs seem ok. need bitswap and handler. { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 5) { @@ -15350,10 +15350,10 @@ DRIVER_INIT_MEMBER(cmaster_state, rp96sub) // 95 33 95 33 70 6C 70 6C... XORs s DRIVER_INIT_MEMBER(cmaster_state, po33) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 0x14) { @@ -15373,10 +15373,10 @@ DRIVER_INIT_MEMBER(cmaster_state, po33) DRIVER_INIT_MEMBER(cmaster_state, match133) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i = 0; i < 0x10000; i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 0x12) { @@ -15396,7 +15396,7 @@ DRIVER_INIT_MEMBER(cmaster_state, match133) DRIVER_INIT_MEMBER(cb3_state, cherrys) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); unsigned char rawData[256] = { 0xCC, 0xCD, 0xCE, 0xCF, 0xC8, 0xC9, 0xCA, 0xCB, 0xC4, 0xC5, 0xC6, 0xC7, @@ -15436,7 +15436,7 @@ DRIVER_INIT_MEMBER(unkch_state, unkch1) // game stores $02 at ($D75C) and expects it to change // possibly expecting stack to grow to this point in NMI handler? // it does this before enabling vblank irq, so if that's the case there's a missing nmi source - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x9d52] = 0x00; ROM[0x9d53] = 0x00; } @@ -15446,7 +15446,7 @@ DRIVER_INIT_MEMBER(unkch_state, unkch3) // game stores $04 at ($D77F) and expects it to change // possibly expecting stack to grow to this point in NMI handler? // it does this before enabling vblank irq, so if that's the case there's a missing nmi source - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x9b86] = 0x00; ROM[0x9b87] = 0x00; } @@ -15456,7 +15456,7 @@ DRIVER_INIT_MEMBER(unkch_state, unkch4) // game stores $02 at ($D75C) and expects it to change // possibly expecting stack to grow to this point in NMI handler? // it does this before enabling vblank irq, so if that's the case there's a missing nmi source - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x9a6e] = 0x00; ROM[0x9a6f] = 0x00; } @@ -15474,7 +15474,7 @@ DRIVER_INIT_MEMBER(cmaster_state, tonypok) DRIVER_INIT_MEMBER(goldstar_state, super9) { int i; - UINT8 *src = memregion("gfx1")->base(); + uint8_t *src = memregion("gfx1")->base(); for (i = 0; i < 0x20000; i++) { // src[i] = BITSWAP8(src[i], 7, 4, 2, 1, 6, 5, 3, 0); @@ -15482,7 +15482,7 @@ DRIVER_INIT_MEMBER(goldstar_state, super9) src[i] = BITSWAP8(src[i], 7, 3, 2, 6, 5, 1, 4, 0); } - UINT8 *src2 = memregion("gfx2")->base(); + uint8_t *src2 = memregion("gfx2")->base(); for (i = 0; i < 0x8000; i++) { // src2[i] = BITSWAP8(src2[i], 7, 4, 2, 1, 6, 5, 3, 0); @@ -15496,26 +15496,26 @@ DRIVER_INIT_MEMBER(cb3_state, cb3e) { /* program bitswap */ int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); do_blockswaps(ROM); for (i = 0; i < 0x10000; i++) { - UINT8 dat = ROM[i]; + uint8_t dat = ROM[i]; dat = BITSWAP8(dat, 5, 6, 3, 4, 7, 2, 1, 0); ROM[i] = dat; } /* bank 1 graphics */ // int i; - UINT8 *src = memregion("gfx1")->base(); + uint8_t *src = memregion("gfx1")->base(); for (i = 0; i < 0x20000; i++) { src[i] = BITSWAP8(src[i], 4, 3, 2, 5, 1, 6, 0, 7); // OK } /* bank 2 graphics */ - UINT8 *src2 = memregion("gfx2")->base(); + uint8_t *src2 = memregion("gfx2")->base(); for (i = 0; i < 0x8000; i++) { src2[i] = BITSWAP8(src2[i], 3, 4, 2, 5, 1, 6, 0, 7); // OK @@ -15526,14 +15526,14 @@ DRIVER_INIT_MEMBER(goldstar_state, wcherry) { /* bank 1 graphics */ int i; - UINT8 *src = memregion("gfx1")->base(); + uint8_t *src = memregion("gfx1")->base(); for (i = 0; i < 0x20000; i++) { src[i] = BITSWAP8(src[i], 4, 3, 2, 5, 1, 6, 0, 7); // OK } /* bank 2 graphics */ - UINT8 *src2 = memregion("gfx2")->base(); + uint8_t *src2 = memregion("gfx2")->base(); for (i = 0; i < 0x8000; i++) { src2[i] = BITSWAP8(src2[i], 3, 4, 2, 5, 1, 6, 0, 7); // OK @@ -15551,14 +15551,14 @@ DRIVER_INIT_MEMBER(wingco_state, flaming7) { /* bank 1 graphics */ int i; - UINT8 *src = memregion("gfx1")->base(); + uint8_t *src = memregion("gfx1")->base(); for (i = 0; i < 0x20000; i++) { src[i] = BITSWAP8(src[i], 4, 3, 2, 5, 1, 6, 0, 7); // OK } /* bank 2 graphics */ - UINT8 *src2 = memregion("gfx2")->base(); + uint8_t *src2 = memregion("gfx2")->base(); for (i = 0; i < 0x8000; i++) { src2[i] = BITSWAP8(src2[i], 3, 4, 2, 5, 1, 6, 0, 7); // OK @@ -15570,7 +15570,7 @@ DRIVER_INIT_MEMBER(wingco_state, flaming7) just patched to jump to $5D80 (jmp $6115) where the check is succesfull. */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x5d7a] = 0x05; } @@ -15589,7 +15589,7 @@ DRIVER_INIT_MEMBER(wingco_state, flam7_tw) Just patched to jump to $60B9 (jmp $644E) where the check is succesfull. */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x60b3] = 0x05; } diff --git a/src/mame/drivers/good.cpp b/src/mame/drivers/good.cpp index 3042cad5260..a82e454f376 100644 --- a/src/mame/drivers/good.cpp +++ b/src/mame/drivers/good.cpp @@ -48,9 +48,9 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_fg_tilemapram; - required_shared_ptr m_bg_tilemapram; - UINT16 * m_sprites; + required_shared_ptr m_fg_tilemapram; + required_shared_ptr m_bg_tilemapram; + uint16_t * m_sprites; /* video-related */ tilemap_t *m_bg_tilemap; @@ -60,7 +60,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; - UINT32 screen_update_good(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_good(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -101,7 +101,7 @@ void good_state::video_start() m_fg_tilemap->set_transparent_pen(0xf); } -UINT32 good_state::screen_update_good(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t good_state::screen_update_good(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/drivers/goodejan.cpp b/src/mame/drivers/goodejan.cpp index e4114cbea34..319c036c2f7 100644 --- a/src/mame/drivers/goodejan.cpp +++ b/src/mame/drivers/goodejan.cpp @@ -93,21 +93,21 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_sc0_vram; - required_shared_ptr m_sc1_vram; - required_shared_ptr m_sc2_vram; - required_shared_ptr m_sc3_vram; - required_shared_ptr m_spriteram16; + required_shared_ptr m_sc0_vram; + required_shared_ptr m_sc1_vram; + required_shared_ptr m_sc2_vram; + required_shared_ptr m_sc3_vram; + required_shared_ptr m_spriteram16; tilemap_t *m_sc0_tilemap; tilemap_t *m_sc1_tilemap; tilemap_t *m_sc2_tilemap; tilemap_t *m_sc3_tilemap; - UINT16 m_mux_data; - UINT16 m_seibucrtc_sc0bank; - UINT16 m_layer_en; - UINT16 m_scrollram[6]; + uint16_t m_mux_data; + uint16_t m_seibucrtc_sc0bank; + uint16_t m_layer_en; + uint16_t m_scrollram[6]; DECLARE_WRITE16_MEMBER(gfxbank_w); DECLARE_READ16_MEMBER(mahjong_panel_r); @@ -126,10 +126,10 @@ public: INTERRUPT_GEN_MEMBER(irq); - void seibucrtc_sc0bank_w(UINT16 data); + void seibucrtc_sc0bank_w(uint16_t data); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); virtual void video_start() override; - 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); }; /******************************* @@ -263,7 +263,7 @@ WRITE16_MEMBER( goodejan_state::seibucrtc_sc3vram_w ) m_sc3_tilemap->mark_tile_dirty(offset); } -void goodejan_state::seibucrtc_sc0bank_w(UINT16 data) +void goodejan_state::seibucrtc_sc0bank_w(uint16_t data) { m_seibucrtc_sc0bank = data & 1; m_sc0_tilemap->mark_all_dirty(); @@ -364,7 +364,7 @@ void goodejan_state::video_start() save_item(NAME(m_scrollram)); } -UINT32 goodejan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t goodejan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->pen(0x7ff), cliprect); //black pen @@ -403,7 +403,7 @@ WRITE16_MEMBER(goodejan_state::gfxbank_w) /* Multiplexer device for the mahjong panel */ READ16_MEMBER(goodejan_state::mahjong_panel_r) { - UINT16 ret; + uint16_t ret; ret = 0xffff; switch(m_mux_data) diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp index 5fb828631be..7e2af6ab83e 100644 --- a/src/mame/drivers/gottlieb.cpp +++ b/src/mame/drivers/gottlieb.cpp @@ -237,7 +237,7 @@ void gottlieb_state::machine_start() m_laserdisc_philips_timer = timer_alloc(TIMER_LASERDISC_PHILIPS); /* create some audio RAM */ - m_laserdisc_audio_buffer = std::make_unique(AUDIORAM_SIZE); + m_laserdisc_audio_buffer = std::make_unique(AUDIORAM_SIZE); m_laserdisc_status = 0x38; /* more save state registration */ @@ -385,7 +385,7 @@ READ8_MEMBER(gottlieb_state::laserdisc_status_r) } else { - UINT8 result = m_laserdisc_audio_buffer[m_laserdisc_audio_address++]; + uint8_t result = m_laserdisc_audio_buffer[m_laserdisc_audio_address++]; m_laserdisc_audio_address %= AUDIORAM_SIZE; return result; } @@ -421,7 +421,7 @@ WRITE8_MEMBER(gottlieb_state::laserdisc_command_w) TIMER_CALLBACK_MEMBER(gottlieb_state::laserdisc_philips_callback) { - UINT32 newcode = m_laserdisc->get_field_code((param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18, TRUE); + uint32_t newcode = m_laserdisc->get_field_code((param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18, TRUE); /* the PR8210 sends line 17/18 data on each frame; the laserdisc interface board receives notification and latches the most recent frame number */ @@ -448,8 +448,8 @@ TIMER_CALLBACK_MEMBER(gottlieb_state::laserdisc_bit_off_callback) TIMER_CALLBACK_MEMBER(gottlieb_state::laserdisc_bit_callback) { - UINT8 bitsleft = param >> 16; - UINT8 data = param; + uint8_t bitsleft = param >> 16; + uint8_t data = param; attotime duration; /* assert the line and set a timer for deassertion */ @@ -579,7 +579,7 @@ void gottlieb_state::audio_handle_zero_crossing(const attotime &zerotime, int lo } -void gottlieb_state::laserdisc_audio_process(laserdisc_device &device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1) +void gottlieb_state::laserdisc_audio_process(laserdisc_device &device, int samplerate, int samples, const int16_t *ch0, const int16_t *ch1) { int logit = LOG_AUDIO_DECODE && machine().input().code_pressed(KEYCODE_L); attotime time_per_sample = attotime::from_hz(samplerate); @@ -599,7 +599,7 @@ void gottlieb_state::laserdisc_audio_process(laserdisc_device &device, int sampl /* iterate over samples */ for (cursamp = 0; cursamp < samples; cursamp++) { - INT16 sample = ch1[cursamp]; + int16_t sample = ch1[cursamp]; /* start by logging the current sample and time */ if (logit) @@ -652,7 +652,7 @@ void gottlieb_state::laserdisc_audio_process(laserdisc_device &device, int sampl // a real kicker/knocker, hook it up via output "knocker0") //------------------------------------------------- -void gottlieb_state::qbert_knocker(UINT8 knock) +void gottlieb_state::qbert_knocker(uint8_t knock) { output().set_value("knocker0", knock); diff --git a/src/mame/drivers/goupil.cpp b/src/mame/drivers/goupil.cpp index d13d2bc4eee..e932d0e30b0 100644 --- a/src/mame/drivers/goupil.cpp +++ b/src/mame/drivers/goupil.cpp @@ -72,12 +72,12 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT8 m_row_kbd1; - UINT8 m_row_kbd2; + uint8_t m_row_kbd1; + uint8_t m_row_kbd2; int old_state_ca2; - UINT8 via_video_pbb_data; - UINT8 cnttim; - UINT8 valkeyb; + uint8_t via_video_pbb_data; + uint8_t cnttim; + uint8_t valkeyb; TIMER_DEVICE_CALLBACK_MEMBER(goupil_scanline); private: @@ -104,7 +104,7 @@ private: TIMER_DEVICE_CALLBACK_MEMBER( goupil_g1_state::goupil_scanline ) { - m_ef9364->update_scanline((UINT16)param); + m_ef9364->update_scanline((uint16_t)param); } static ADDRESS_MAP_START(goupil_mem, AS_PROGRAM, 8, goupil_g1_state) @@ -193,7 +193,7 @@ READ8_MEMBER( goupil_g1_state::shift_kb2_r ) READ8_MEMBER( goupil_g1_state::kbd1_r ) { char kbdrow[6]; - UINT8 data = 0xff; + uint8_t data = 0xff; kbdrow[0] = 'A'; kbdrow[1] = 'X'; @@ -218,7 +218,7 @@ READ_LINE_MEMBER( goupil_g1_state::via_keyb_ca2_r ) READ8_MEMBER( goupil_g1_state::kbd2_r ) { char kbdrow[6]; - UINT8 data = 0xff; + uint8_t data = 0xff; kbdrow[0] = 'B'; kbdrow[1] = 'X'; diff --git a/src/mame/drivers/gp2x.cpp b/src/mame/drivers/gp2x.cpp index 0865638044e..78ecdfb2545 100644 --- a/src/mame/drivers/gp2x.cpp +++ b/src/mame/drivers/gp2x.cpp @@ -33,7 +33,7 @@ public: m_ram(*this, "ram"){ } required_device m_maincpu; - required_region_ptr m_maincpu_region; + required_region_ptr m_maincpu_region; DECLARE_READ32_MEMBER(gp2x_lcdc_r); DECLARE_WRITE32_MEMBER(gp2x_lcdc_w); DECLARE_READ32_MEMBER(nand_r); @@ -44,15 +44,15 @@ public: DECLARE_READ32_MEMBER(nand_ctrl_r); DECLARE_WRITE32_MEMBER(nand_ctrl_w); DECLARE_READ32_MEMBER(sdcard_r); - required_shared_ptr m_ram; - UINT16 m_vidregs[0x200/2]; - UINT32 m_nand_ptr; - UINT32 m_nand_cmd; - UINT32 m_nand_subword_stage; - UINT32 m_nand_stage; - UINT32 m_nand_ptr_temp; - UINT32 m_timer; - UINT32 screen_update_gp2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + required_shared_ptr m_ram; + uint16_t m_vidregs[0x200/2]; + uint32_t m_nand_ptr; + uint32_t m_nand_cmd; + uint32_t m_nand_subword_stage; + uint32_t m_nand_stage; + uint32_t m_nand_ptr_temp; + uint32_t m_timer; + uint32_t screen_update_gp2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -144,7 +144,7 @@ static const char *const gp2x_regnames[0x200] = "YUV Source region A H", }; #endif -UINT32 gp2x_state::screen_update_gp2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t gp2x_state::screen_update_gp2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // display enabled? if (m_vidregs[0] & 1) @@ -153,7 +153,7 @@ UINT32 gp2x_state::screen_update_gp2x(screen_device &screen, bitmap_rgb32 &bitma if (m_vidregs[0x80/2] & 4) { int x, y; - UINT16 *vram = (UINT16 *)&m_ram[0x2100000/4]; + uint16_t *vram = (uint16_t *)&m_ram[0x2100000/4]; /* printf("RGB still image 1 enabled, bpp %d, size is %d %d %d %d\n", (m_vidregs[(0xda/2)]>>9)&3, @@ -165,11 +165,11 @@ UINT32 gp2x_state::screen_update_gp2x(screen_device &screen, bitmap_rgb32 &bitma for (y = 0; y < 240; y++) { - UINT32 *scanline = &bitmap.pix32(y); + uint32_t *scanline = &bitmap.pix32(y); for (x = 0; x < 320; x++) { - UINT16 pixel = vram[(320*y)+x]; + uint16_t pixel = vram[(320*y)+x]; *scanline++ = rgb_t(0xff, (pixel>>11)<<3, ((pixel>>5)&0x3f)<<2, (pixel&0x1f)<<3); } @@ -205,8 +205,8 @@ WRITE32_MEMBER( gp2x_state::gp2x_lcdc_w ) READ32_MEMBER( gp2x_state::nand_r ) { - UINT32 *ROM = m_maincpu_region; - UINT32 ret; + uint32_t *ROM = m_maincpu_region; + uint32_t ret; if (offset == 0) { diff --git a/src/mame/drivers/gp32.cpp b/src/mame/drivers/gp32.cpp index b4050f0a39e..dc2db05bca6 100644 --- a/src/mame/drivers/gp32.cpp +++ b/src/mame/drivers/gp32.cpp @@ -56,9 +56,9 @@ static inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, co #define BPPMODE_TFT_08 0x0B #define BPPMODE_TFT_16 0x0C -inline rgb_t gp32_state::s3c240x_get_color_5551( UINT16 data) +inline rgb_t gp32_state::s3c240x_get_color_5551( uint16_t data) { - UINT8 r, g, b, i; + uint8_t r, g, b, i; r = BITS( data, 15, 11) << 3; g = BITS( data, 10, 6) << 3; b = BITS( data, 5, 1) << 3; @@ -86,13 +86,13 @@ void gp32_state::s3c240x_lcd_dma_init() m_s3c240x_lcd.hozval = BITS( m_s3c240x_lcd_regs[2], 18, 8); } -UINT32 gp32_state::s3c240x_lcd_dma_read( ) +uint32_t gp32_state::s3c240x_lcd_dma_read( ) { - UINT8 *vram, data[4]; + uint8_t *vram, data[4]; int i; for (i = 0; i < 2; i++) { - vram = (UINT8 *)m_s3c240x_ram.target() + m_s3c240x_lcd.vramaddr_cur - 0x0C000000; + vram = (uint8_t *)m_s3c240x_ram.target() + m_s3c240x_lcd.vramaddr_cur - 0x0C000000; data[i*2+0] = vram[0]; data[i*2+1] = vram[1]; m_s3c240x_lcd.vramaddr_cur += 2; @@ -130,11 +130,11 @@ UINT32 gp32_state::s3c240x_lcd_dma_read( ) void gp32_state::s3c240x_lcd_render_01( ) { bitmap_rgb32 &bitmap = m_bitmap; - UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); int i, j; for (i = 0; i < 4; i++) { - UINT32 data = s3c240x_lcd_dma_read(); + uint32_t data = s3c240x_lcd_dma_read(); for (j = 0; j < 32; j++) { *scanline++ = m_palette->pen_color((data >> 31) & 0x01); @@ -153,11 +153,11 @@ void gp32_state::s3c240x_lcd_render_01( ) void gp32_state::s3c240x_lcd_render_02( ) { bitmap_rgb32 &bitmap = m_bitmap; - UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); int i, j; for (i = 0; i < 4; i++) { - UINT32 data = s3c240x_lcd_dma_read(); + uint32_t data = s3c240x_lcd_dma_read(); for (j = 0; j < 16; j++) { *scanline++ = m_palette->pen_color((data >> 30) & 0x03); @@ -176,11 +176,11 @@ void gp32_state::s3c240x_lcd_render_02( ) void gp32_state::s3c240x_lcd_render_04( ) { bitmap_rgb32 &bitmap = m_bitmap; - UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); int i, j; for (i = 0; i < 4; i++) { - UINT32 data = s3c240x_lcd_dma_read( ); + uint32_t data = s3c240x_lcd_dma_read( ); for (j = 0; j < 8; j++) { *scanline++ = m_palette->pen_color((data >> 28) & 0x0F); @@ -199,11 +199,11 @@ void gp32_state::s3c240x_lcd_render_04( ) void gp32_state::s3c240x_lcd_render_08( ) { bitmap_rgb32 &bitmap = m_bitmap; - UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); int i, j; for (i = 0; i < 4; i++) { - UINT32 data = s3c240x_lcd_dma_read(); + uint32_t data = s3c240x_lcd_dma_read(); for (j = 0; j < 4; j++) { *scanline++ = m_palette->pen_color((data >> 24) & 0xFF); @@ -222,11 +222,11 @@ void gp32_state::s3c240x_lcd_render_08( ) void gp32_state::s3c240x_lcd_render_16( ) { bitmap_rgb32 &bitmap = m_bitmap; - UINT32 *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); + uint32_t *scanline = &bitmap.pix32(m_s3c240x_lcd.vpos, m_s3c240x_lcd.hpos); int i, j; for (i = 0; i < 4; i++) { - UINT32 data = s3c240x_lcd_dma_read(); + uint32_t data = s3c240x_lcd_dma_read(); for (j = 0; j < 2; j++) { *scanline++ = s3c240x_get_color_5551( (data >> 16) & 0xFFFF); @@ -275,7 +275,7 @@ void gp32_state::video_start() machine().first_screen()->register_screen_bitmap(m_bitmap); } -UINT32 gp32_state::screen_update_gp32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t gp32_state::screen_update_gp32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); s3c240x_lcd_dma_init(); @@ -284,14 +284,14 @@ UINT32 gp32_state::screen_update_gp32(screen_device &screen, bitmap_rgb32 &bitma READ32_MEMBER(gp32_state::s3c240x_lcd_r) { - UINT32 data = m_s3c240x_lcd_regs[offset]; + uint32_t data = m_s3c240x_lcd_regs[offset]; switch (offset) { // LCDCON1 case 0x00 / 4 : { // make sure line counter is going - UINT32 lineval = BITS( m_s3c240x_lcd_regs[1], 23, 14); + uint32_t lineval = BITS( m_s3c240x_lcd_regs[1], 23, 14); data = (data & ~0xFFFC0000) | ((lineval - machine().first_screen()->vpos()) << 18); } break; @@ -303,7 +303,7 @@ READ32_MEMBER(gp32_state::s3c240x_lcd_r) void gp32_state::s3c240x_lcd_configure() { screen_device *screen = machine().first_screen(); - UINT32 vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk; + uint32_t vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk; double framerate, vclk; rectangle visarea; vspw = BITS( m_s3c240x_lcd_regs[1], 5, 0); @@ -355,7 +355,7 @@ void gp32_state::s3c240x_lcd_recalc() WRITE32_MEMBER(gp32_state::s3c240x_lcd_w) { - UINT32 old_value = m_s3c240x_lcd_regs[offset]; + uint32_t old_value = m_s3c240x_lcd_regs[offset]; verboselog(*this, 9, "(LCD) %08X <- %08X (PC %08X)\n", 0x14A00000 + (offset << 2), data, space.device().safe_pc( )); COMBINE_DATA(&m_s3c240x_lcd_regs[offset]); switch (offset) @@ -377,7 +377,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_lcd_w) READ32_MEMBER(gp32_state::s3c240x_lcd_palette_r) { - UINT32 data = m_s3c240x_lcd_palette[offset]; + uint32_t data = m_s3c240x_lcd_palette[offset]; verboselog(*this, 9, "(LCD) %08X -> %08X (PC %08X)\n", 0x14A00400 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -396,17 +396,17 @@ WRITE32_MEMBER(gp32_state::s3c240x_lcd_palette_w) // CLOCK & POWER MANAGEMENT -UINT32 gp32_state::s3c240x_get_fclk(int reg) +uint32_t gp32_state::s3c240x_get_fclk(int reg) { - UINT32 data, mdiv, pdiv, sdiv; + uint32_t data, mdiv, pdiv, sdiv; data = m_s3c240x_clkpow_regs[reg]; // MPLLCON or UPLLCON mdiv = BITS( data, 19, 12); pdiv = BITS( data, 9, 4); sdiv = BITS( data, 1, 0); - return (UINT32)((double)((mdiv + 8) * 12000000) / (double)((pdiv + 2) * (1 << sdiv))); + return (uint32_t)((double)((mdiv + 8) * 12000000) / (double)((pdiv + 2) * (1 << sdiv))); } -UINT32 gp32_state::s3c240x_get_hclk(int reg) +uint32_t gp32_state::s3c240x_get_hclk(int reg) { switch (m_s3c240x_clkpow_regs[5] & 0x3) // CLKDIVN { @@ -418,7 +418,7 @@ UINT32 gp32_state::s3c240x_get_hclk(int reg) return 0; } -UINT32 gp32_state::s3c240x_get_pclk(int reg) +uint32_t gp32_state::s3c240x_get_pclk(int reg) { switch (m_s3c240x_clkpow_regs[5] & 0x3) // CLKDIVN { @@ -432,7 +432,7 @@ UINT32 gp32_state::s3c240x_get_pclk(int reg) READ32_MEMBER(gp32_state::s3c240x_clkpow_r) { - UINT32 data = m_s3c240x_clkpow_regs[offset]; + uint32_t data = m_s3c240x_clkpow_regs[offset]; verboselog(*this, 9, "(CLKPOW) %08X -> %08X (PC %08X)\n", 0x14800000 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -459,7 +459,7 @@ void gp32_state::s3c240x_check_pending_irq() { if (m_s3c240x_irq_regs[0] != 0) { - UINT32 int_type = 0, temp; + uint32_t int_type = 0, temp; temp = m_s3c240x_irq_regs[0]; while (!(temp & 1)) { @@ -476,7 +476,7 @@ void gp32_state::s3c240x_check_pending_irq() } } -void gp32_state::s3c240x_request_irq(UINT32 int_type) +void gp32_state::s3c240x_request_irq(uint32_t int_type) { verboselog(*this, 5, "request irq %d\n", int_type); if (m_s3c240x_irq_regs[0] == 0) @@ -496,14 +496,14 @@ void gp32_state::s3c240x_request_irq(UINT32 int_type) READ32_MEMBER(gp32_state::s3c240x_irq_r) { - UINT32 data = m_s3c240x_irq_regs[offset]; + uint32_t data = m_s3c240x_irq_regs[offset]; verboselog(*this, 9, "(IRQ) %08X -> %08X (PC %08X)\n", 0x14400000 + (offset << 2), data, space.device().safe_pc( )); return data; } WRITE32_MEMBER(gp32_state::s3c240x_irq_w) { - UINT32 old_value = m_s3c240x_irq_regs[offset]; + uint32_t old_value = m_s3c240x_irq_regs[offset]; verboselog(*this, 9, "(IRQ) %08X <- %08X (PC %08X)\n", 0x14400000 + (offset << 2), data, space.device().safe_pc( )); COMBINE_DATA(&m_s3c240x_irq_regs[offset]); switch (offset) @@ -553,7 +553,7 @@ static const char *const timer_reg_names[] = READ32_MEMBER(gp32_state::s3c240x_pwm_r) { - UINT32 data = m_s3c240x_pwm_regs[offset]; + uint32_t data = m_s3c240x_pwm_regs[offset]; verboselog(*this, 9, "(PWM) %08X -> %08X (PC %08X)\n", 0x15100000 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -564,8 +564,8 @@ void gp32_state::s3c240x_pwm_start(int timer) static const int prescaler_shift[] = { 0, 0, 8, 8, 8 }; static const int mux_shift[] = { 0, 4, 8, 12, 16 }; static const int tcon_shift[] = { 0, 8, 12, 16, 20 }; - const UINT32 *regs = &m_s3c240x_pwm_regs[3+timer*3]; - UINT32 prescaler, mux, cnt, cmp, auto_reload; + const uint32_t *regs = &m_s3c240x_pwm_regs[3+timer*3]; + uint32_t prescaler, mux, cnt, cmp, auto_reload; double freq, hz; verboselog(*this, 1, "PWM %d start\n", timer); prescaler = (m_s3c240x_pwm_regs[0] >> prescaler_shift[timer]) & 0xFF; @@ -615,7 +615,7 @@ void gp32_state::s3c240x_pwm_recalc(int timer) WRITE32_MEMBER(gp32_state::s3c240x_pwm_w) { - UINT32 old_value = m_s3c240x_pwm_regs[offset]; + uint32_t old_value = m_s3c240x_pwm_regs[offset]; verboselog(*this, 9, "(PWM) %08X <- %08X (PC %08X)\n", 0x15100000 + (offset << 2), data, space.device().safe_pc( )); COMBINE_DATA(&m_s3c240x_pwm_regs[offset]); switch (offset) @@ -667,7 +667,7 @@ TIMER_CALLBACK_MEMBER(gp32_state::s3c240x_pwm_timer_exp) void gp32_state::s3c240x_dma_reload(int dma) { - UINT32 *regs = &m_s3c240x_dma_regs[dma<<3]; + uint32_t *regs = &m_s3c240x_dma_regs[dma<<3]; regs[3] = (regs[3] & ~0x000FFFFF) | BITS( regs[2], 19, 0); regs[4] = (regs[4] & ~0x1FFFFFFF) | BITS( regs[0], 28, 0); regs[5] = (regs[5] & ~0x1FFFFFFF) | BITS( regs[1], 28, 0); @@ -675,11 +675,11 @@ void gp32_state::s3c240x_dma_reload(int dma) void gp32_state::s3c240x_dma_trigger(int dma) { - UINT32 *regs = &m_s3c240x_dma_regs[dma<<3]; - UINT32 curr_tc, curr_src, curr_dst; + uint32_t *regs = &m_s3c240x_dma_regs[dma<<3]; + uint32_t curr_tc, curr_src, curr_dst; address_space &space = m_maincpu->space( AS_PROGRAM); int dsz, inc_src, inc_dst, servmode; - static const UINT32 ch_int[] = { INT_DMA0, INT_DMA1, INT_DMA2, INT_DMA3 }; + static const uint32_t ch_int[] = { INT_DMA0, INT_DMA1, INT_DMA2, INT_DMA3 }; verboselog(*this, 5, "DMA %d trigger\n", dma); curr_tc = BITS( regs[3], 19, 0); curr_src = BITS( regs[4], 28, 0); @@ -731,7 +731,7 @@ void gp32_state::s3c240x_dma_trigger(int dma) void gp32_state::s3c240x_dma_request_iis() { - UINT32 *regs = &m_s3c240x_dma_regs[2<<3]; + uint32_t *regs = &m_s3c240x_dma_regs[2<<3]; verboselog(*this, 5, "s3c240x_dma_request_iis\n"); if ((BIT( regs[6], 1) != 0) && (BIT( regs[2], 23) != 0) && (BITS( regs[2], 25, 24) == 0)) { @@ -747,7 +747,7 @@ void gp32_state::s3c240x_dma_request_pwm() { if (i != 1) { - UINT32 *regs = &m_s3c240x_dma_regs[i<<3]; + uint32_t *regs = &m_s3c240x_dma_regs[i<<3]; if ((BIT( regs[6], 1) != 0) && (BIT( regs[2], 23) != 0) && (BITS( regs[2], 25, 24) == 3)) { s3c240x_dma_trigger(i); @@ -758,9 +758,9 @@ void gp32_state::s3c240x_dma_request_pwm() void gp32_state::s3c240x_dma_start(int dma) { - UINT32 addr_src, addr_dst, tc; - UINT32 *regs = &m_s3c240x_dma_regs[dma<<3]; - UINT32 dsz, tsz, reload; + uint32_t addr_src, addr_dst, tc; + uint32_t *regs = &m_s3c240x_dma_regs[dma<<3]; + uint32_t dsz, tsz, reload; int inc_src, inc_dst, _int, servmode, swhwsel, hwsrcsel; verboselog(*this, 1, "DMA %d start\n", dma); addr_src = BITS( regs[0], 28, 0); @@ -803,14 +803,14 @@ void gp32_state::s3c240x_dma_recalc(int dma) READ32_MEMBER(gp32_state::s3c240x_dma_r) { - UINT32 data = m_s3c240x_dma_regs[offset]; + uint32_t data = m_s3c240x_dma_regs[offset]; verboselog(*this, 9, "(DMA) %08X -> %08X (PC %08X)\n", 0x14600000 + (offset << 2), data, space.device().safe_pc( )); return data; } WRITE32_MEMBER(gp32_state::s3c240x_dma_w) { - UINT32 old_value = m_s3c240x_dma_regs[offset]; + uint32_t old_value = m_s3c240x_dma_regs[offset]; verboselog(*this, 9, "(DMA) %08X <- %08X (PC %08X)\n", 0x14600000 + (offset << 2), data, space.device().safe_pc( )); COMBINE_DATA(&m_s3c240x_dma_regs[offset]); switch (offset) @@ -905,15 +905,15 @@ void gp32_state::smc_init() smc_reset(); } -UINT8 gp32_state::smc_read() +uint8_t gp32_state::smc_read() { - UINT8 data; + uint8_t data; data = m_smartmedia->data_r(); verboselog(*this, 5, "smc_read %08X\n", data); return data; } -void gp32_state::smc_write(UINT8 data) +void gp32_state::smc_write(uint8_t data) { verboselog(*this, 5, "smc_write %08X\n", data); if ((m_smc.chip) && (!m_smc.read)) @@ -1014,7 +1014,7 @@ void gp32_state::i2s_write(int line, int data) READ32_MEMBER(gp32_state::s3c240x_gpio_r) { - UINT32 data = m_s3c240x_gpio[offset]; + uint32_t data = m_s3c240x_gpio[offset]; switch (offset) { // PBCON @@ -1125,7 +1125,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_gpio_w) READ32_MEMBER(gp32_state::s3c240x_memcon_r) { - UINT32 data = m_s3c240x_memcon_regs[offset]; + uint32_t data = m_s3c240x_memcon_regs[offset]; verboselog(*this, 9, "(MEMCON) %08X -> %08X (PC %08X)\n", 0x14000000 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -1141,7 +1141,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_memcon_w) READ32_MEMBER(gp32_state::s3c240x_usb_host_r) { - UINT32 data = m_s3c240x_usb_host_regs[offset]; + uint32_t data = m_s3c240x_usb_host_regs[offset]; verboselog(*this, 9, "(USB H) %08X -> %08X (PC %08X)\n", 0x14200000 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -1157,7 +1157,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_usb_host_w) READ32_MEMBER(gp32_state::s3c240x_uart_0_r) { - UINT32 data = m_s3c240x_uart_0_regs[offset]; + uint32_t data = m_s3c240x_uart_0_regs[offset]; switch (offset) { // UTRSTAT0 @@ -1182,7 +1182,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_uart_0_w) READ32_MEMBER(gp32_state::s3c240x_uart_1_r) { - UINT32 data = m_s3c240x_uart_1_regs[offset]; + uint32_t data = m_s3c240x_uart_1_regs[offset]; switch (offset) { // UTRSTAT1 @@ -1207,7 +1207,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_uart_1_w) READ32_MEMBER(gp32_state::s3c240x_usb_device_r) { - UINT32 data = m_s3c240x_usb_device_regs[offset]; + uint32_t data = m_s3c240x_usb_device_regs[offset]; verboselog(*this, 9, "(USB D) %08X -> %08X (PC %08X)\n", 0x15200140 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -1223,7 +1223,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_usb_device_w) READ32_MEMBER(gp32_state::s3c240x_watchdog_r) { - UINT32 data = m_s3c240x_watchdog_regs[offset]; + uint32_t data = m_s3c240x_watchdog_regs[offset]; verboselog(*this, 9, "(WDOG) %08X -> %08X (PC %08X)\n", 0x15300000 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -1236,15 +1236,15 @@ WRITE32_MEMBER(gp32_state::s3c240x_watchdog_w) // EEPROM -UINT8 gp32_state::eeprom_read(UINT16 address) +uint8_t gp32_state::eeprom_read(uint16_t address) { - UINT8 data; + uint8_t data; data = m_eeprom_data[address]; verboselog(*this, 5, "EEPROM %04X -> %02X\n", address, data); return data; } -void gp32_state::eeprom_write(UINT16 address, UINT8 data) +void gp32_state::eeprom_write(uint16_t address, uint8_t data) { verboselog(*this, 5, "EEPROM %04X <- %02X\n", address, data); m_eeprom_data[address] = data; @@ -1253,9 +1253,9 @@ void gp32_state::eeprom_write(UINT16 address, UINT8 data) // IIC #if 0 -UINT8 gp32_state::i2cmem_read_byte( int last) +uint8_t gp32_state::i2cmem_read_byte( int last) { - UINT8 data = 0; + uint8_t data = 0; int i; i2cmem_write( machine, 0, I2CMEM_SDA, 1); for (i = 0; i < 8; i++) @@ -1272,7 +1272,7 @@ UINT8 gp32_state::i2cmem_read_byte( int last) #endif #if 0 -void gp32_state::i2cmem_write_byte( UINT8 data) +void gp32_state::i2cmem_write_byte( uint8_t data) { int i; for (i = 0; i < 8; i++) @@ -1329,7 +1329,7 @@ void gp32_state::iic_resume() READ32_MEMBER(gp32_state::s3c240x_iic_r) { - UINT32 data = m_s3c240x_iic_regs[offset]; + uint32_t data = m_s3c240x_iic_regs[offset]; switch (offset) { // IICSTAT @@ -1404,12 +1404,12 @@ TIMER_CALLBACK_MEMBER(gp32_state::s3c240x_iic_timer_exp) { if (m_s3c240x_iic.data_index == 0) { - UINT8 data_shift = m_s3c240x_iic_regs[3] & 0xFF; + uint8_t data_shift = m_s3c240x_iic_regs[3] & 0xFF; verboselog(*this, 5, "IIC write %02X\n", data_shift); } else { - UINT8 data_shift = eeprom_read(m_s3c240x_iic.address); + uint8_t data_shift = eeprom_read(m_s3c240x_iic.address); verboselog(*this, 5, "IIC read %02X\n", data_shift); m_s3c240x_iic_regs[3] = (m_s3c240x_iic_regs[3] & ~0xFF) | data_shift; } @@ -1419,7 +1419,7 @@ TIMER_CALLBACK_MEMBER(gp32_state::s3c240x_iic_timer_exp) // master transmit mode case 3 : { - UINT8 data_shift = m_s3c240x_iic_regs[3] & 0xFF; + uint8_t data_shift = m_s3c240x_iic_regs[3] & 0xFF; verboselog(*this, 5, "IIC write %02X\n", data_shift); m_s3c240x_iic.data[m_s3c240x_iic.data_index++] = data_shift; if (m_s3c240x_iic.data_index == 3) @@ -1444,7 +1444,7 @@ TIMER_CALLBACK_MEMBER(gp32_state::s3c240x_iic_timer_exp) void gp32_state::s3c240x_iis_start() { - static const UINT32 codeclk_table[] = { 256, 384 }; + static const uint32_t codeclk_table[] = { 256, 384 }; double freq; int prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk; verboselog(*this, 1, "IIS start\n"); @@ -1477,7 +1477,7 @@ void gp32_state::s3c240x_iis_recalc() READ32_MEMBER(gp32_state::s3c240x_iis_r) { - UINT32 data = m_s3c240x_iis_regs[offset]; + uint32_t data = m_s3c240x_iis_regs[offset]; #if 0 switch (offset) { @@ -1495,7 +1495,7 @@ READ32_MEMBER(gp32_state::s3c240x_iis_r) WRITE32_MEMBER(gp32_state::s3c240x_iis_w) { - UINT32 old_value = m_s3c240x_iis_regs[offset]; + uint32_t old_value = m_s3c240x_iis_regs[offset]; verboselog(*this, 9, "(IIS) %08X <- %08X (PC %08X)\n", 0x15508000 + (offset << 2), data, space.device().safe_pc( )); COMBINE_DATA(&m_s3c240x_iis_regs[offset]); switch (offset) @@ -1539,7 +1539,7 @@ TIMER_CALLBACK_MEMBER(gp32_state::s3c240x_iis_timer_exp) READ32_MEMBER(gp32_state::s3c240x_rtc_r) { - UINT32 data = m_s3c240x_rtc_regs[offset]; + uint32_t data = m_s3c240x_rtc_regs[offset]; verboselog(*this, 9, "(RTC) %08X -> %08X (PC %08X)\n", 0x15700040 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -1555,7 +1555,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_rtc_w) READ32_MEMBER(gp32_state::s3c240x_adc_r) { - UINT32 data = m_s3c240x_adc_regs[offset]; + uint32_t data = m_s3c240x_adc_regs[offset]; verboselog(*this, 9, "(ADC) %08X -> %08X (PC %08X)\n", 0x15800000 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -1571,7 +1571,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_adc_w) READ32_MEMBER(gp32_state::s3c240x_spi_r) { - UINT32 data = m_s3c240x_spi_regs[offset]; + uint32_t data = m_s3c240x_spi_regs[offset]; verboselog(*this, 9, "(SPI) %08X -> %08X (PC %08X)\n", 0x15900000 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -1587,7 +1587,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_spi_w) READ32_MEMBER(gp32_state::s3c240x_mmc_r) { - UINT32 data = m_s3c240x_mmc_regs[offset]; + uint32_t data = m_s3c240x_mmc_regs[offset]; verboselog(*this, 9, "(MMC) %08X -> %08X (PC %08X)\n", 0x15A00000 + (offset << 2), data, space.device().safe_pc( )); return data; } @@ -1614,7 +1614,7 @@ void gp32_state::s3c240x_machine_start() m_s3c240x_iic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iic_timer_exp),this), (void *)(uintptr_t)0); m_s3c240x_iis_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iis_timer_exp),this), (void *)(uintptr_t)0); m_s3c240x_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_lcd_timer_exp),this), (void *)(uintptr_t)0); - m_eeprom_data = std::make_unique(0x2000); + m_eeprom_data = std::make_unique(0x2000); m_nvram->set_base(m_eeprom_data.get(), 0x2000); smc_init(); i2s_init(); diff --git a/src/mame/drivers/gp_1.cpp b/src/mame/drivers/gp_1.cpp index 2744f11a2c4..cd67da0dd9e 100644 --- a/src/mame/drivers/gp_1.cpp +++ b/src/mame/drivers/gp_1.cpp @@ -53,9 +53,9 @@ public: DECLARE_READ8_MEMBER(portb_r); TIMER_DEVICE_CALLBACK_MEMBER(zero_timer); private: - UINT8 m_u14; - UINT8 m_digit; - UINT8 m_segment[16]; + uint8_t m_u14; + uint8_t m_digit; + uint8_t m_segment[16]; virtual void machine_reset() override; required_device m_maincpu; required_device m_ctc; @@ -343,7 +343,7 @@ WRITE8_MEMBER( gp_1_state::porta_w ) } } - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 if (m_digit == 7) m_segment[m_u14] = data & 15; // only 8,9,10,11 are needed else diff --git a/src/mame/drivers/gp_2.cpp b/src/mame/drivers/gp_2.cpp index 280da8611c4..1b568fb10e5 100644 --- a/src/mame/drivers/gp_2.cpp +++ b/src/mame/drivers/gp_2.cpp @@ -64,9 +64,9 @@ public: DECLARE_READ8_MEMBER(portb_r); TIMER_DEVICE_CALLBACK_MEMBER(zero_timer); private: - UINT8 m_u14; - UINT8 m_digit; - UINT8 m_segment[16]; + uint8_t m_u14; + uint8_t m_digit; + uint8_t m_segment[16]; virtual void machine_reset() override; required_device m_maincpu; required_device m_ctc; @@ -530,7 +530,7 @@ WRITE8_MEMBER( gp_2_state::porta_w ) } } - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 if (m_digit == 7) m_segment[m_u14] = data & 15; else diff --git a/src/mame/drivers/gpworld.cpp b/src/mame/drivers/gpworld.cpp index 9140db8af75..efe7d45b0b3 100644 --- a/src/mame/drivers/gpworld.cpp +++ b/src/mame/drivers/gpworld.cpp @@ -64,15 +64,15 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_nmi_enable; - UINT8 m_start_lamp; - UINT8 m_ldp_read_latch; - UINT8 m_ldp_write_latch; - UINT8 m_brake_gas; + uint8_t m_nmi_enable; + uint8_t m_start_lamp; + uint8_t m_ldp_read_latch; + uint8_t m_ldp_write_latch; + uint8_t m_brake_gas; required_device m_laserdisc; - required_shared_ptr m_sprite_ram; - required_shared_ptr m_palette_ram; - required_shared_ptr m_tile_ram; + required_shared_ptr m_sprite_ram; + required_shared_ptr m_palette_ram; + required_shared_ptr m_tile_ram; DECLARE_READ8_MEMBER(ldp_read); DECLARE_READ8_MEMBER(pedal_in); DECLARE_WRITE8_MEMBER(ldp_write); @@ -81,7 +81,7 @@ public: DECLARE_WRITE8_MEMBER(palette_write); DECLARE_DRIVER_INIT(gpworld); virtual void machine_start() override; - UINT32 screen_update_gpworld(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gpworld(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_callback_gpworld); void gpworld_draw_tiles(bitmap_rgb32 &bitmap,const rectangle &cliprect); inline void draw_pixel(bitmap_rgb32 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip); @@ -105,7 +105,7 @@ protected: /* VIDEO GOODS */ void gpworld_state::gpworld_draw_tiles(bitmap_rgb32 &bitmap,const rectangle &cliprect) { - UINT8 characterX, characterY; + uint8_t characterX, characterY; /* Temporarily set to 64 wide to accommodate two screens */ for (characterX = 0; characterX < 64; characterX++) @@ -146,12 +146,12 @@ void gpworld_state::gpworld_draw_sprites(bitmap_rgb32 &bitmap, const rectangle & int i; - UINT8 *GFX = memregion("gfx2")->base(); + uint8_t *GFX = memregion("gfx2")->base(); /* Heisted from Daphne which heisted it from MAME */ for (i = 0; i < 0x800; i += 8) { - UINT8 *spr_reg = m_sprite_ram + i; + uint8_t *spr_reg = m_sprite_ram + i; if (spr_reg[SPR_Y_BOTTOM] && spr_reg[SPR_X_LO] != 0xff) { @@ -189,7 +189,7 @@ void gpworld_state::gpworld_draw_sprites(bitmap_rgb32 &bitmap, const rectangle & while (1) { int data_lo, data_high; - UINT8 pixel1, pixel2, pixel3, pixel4; + uint8_t pixel1, pixel2, pixel3, pixel4; data_lo = GFX[(src2 & 0x7fff) | (sprite_bank << 16)]; data_high = GFX[(src2 & 0x7fff) | 0x8000 | (sprite_bank << 16)]; @@ -202,7 +202,7 @@ void gpworld_state::gpworld_draw_sprites(bitmap_rgb32 &bitmap, const rectangle & /* we'll see if this is still applicable */ if (src & 0x8000) { - UINT8 temp_pixel; + uint8_t temp_pixel; temp_pixel = pixel1; pixel1 = pixel4; pixel4 = temp_pixel; @@ -242,7 +242,7 @@ void gpworld_state::gpworld_draw_sprites(bitmap_rgb32 &bitmap, const rectangle & } -UINT32 gpworld_state::screen_update_gpworld(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t gpworld_state::screen_update_gpworld(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); diff --git a/src/mame/drivers/grchamp.cpp b/src/mame/drivers/grchamp.cpp index ae8518ba75b..c5cc36ece7a 100644 --- a/src/mame/drivers/grchamp.cpp +++ b/src/mame/drivers/grchamp.cpp @@ -128,7 +128,7 @@ INTERRUPT_GEN_MEMBER(grchamp_state::cpu1_interrupt) WRITE8_MEMBER(grchamp_state::cpu0_outputs_w) { - UINT8 diff = data ^ m_cpu0_out[offset]; + uint8_t diff = data ^ m_cpu0_out[offset]; m_cpu0_out[offset] = data; switch (offset) @@ -209,7 +209,7 @@ WRITE8_MEMBER(grchamp_state::cpu0_outputs_w) WRITE8_MEMBER(grchamp_state::led_board_w) { - static const UINT8 ls247_map[16] = + static const uint8_t ls247_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x58,0x4c,0x62,0x69,0x78,0x00 }; switch (offset) @@ -253,7 +253,7 @@ WRITE8_MEMBER(grchamp_state::led_board_w) WRITE8_MEMBER(grchamp_state::cpu1_outputs_w) { - UINT8 diff = data ^ m_cpu1_out[offset]; + uint8_t diff = data ^ m_cpu1_out[offset]; m_cpu1_out[offset] = data; switch (offset) @@ -344,7 +344,7 @@ WRITE8_MEMBER(grchamp_state::cpu1_outputs_w) * *************************************/ -UINT8 grchamp_state::get_pc3259_bits(int offs) +uint8_t grchamp_state::get_pc3259_bits(int offs) { int bits; diff --git a/src/mame/drivers/grfd2301.cpp b/src/mame/drivers/grfd2301.cpp index cdbac8b8394..087d86273e1 100644 --- a/src/mame/drivers/grfd2301.cpp +++ b/src/mame/drivers/grfd2301.cpp @@ -45,9 +45,9 @@ public: public: virtual void machine_reset() override; - const UINT8 *m_p_chargen; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; private: required_device m_maincpu; @@ -73,16 +73,16 @@ void grfd2301_state::machine_reset() m_maincpu->set_pc(0xe000); } -UINT32 grfd2301_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t grfd2301_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for (y = 0; y < 24; y++) { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = 0; x < 80; x++) { diff --git a/src/mame/drivers/gridlee.cpp b/src/mame/drivers/gridlee.cpp index c452e2580d8..23d20ad86ba 100644 --- a/src/mame/drivers/gridlee.cpp +++ b/src/mame/drivers/gridlee.cpp @@ -169,7 +169,7 @@ void gridlee_state::machine_reset() READ8_MEMBER(gridlee_state::analog_port_r) { int delta, sign, magnitude; - UINT8 newval; + uint8_t newval; static const char *const portnames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" }; /* first read the new trackball value and compute the signed delta */ @@ -220,11 +220,11 @@ READ8_MEMBER(gridlee_state::analog_port_r) void gridlee_state::poly17_init() { - UINT32 i, x = 0; - UINT8 *p, *r; + uint32_t i, x = 0; + uint8_t *p, *r; /* allocate memory */ - m_poly17 = std::make_unique(2 * (POLY17_SIZE + 1)); + m_poly17 = std::make_unique(2 * (POLY17_SIZE + 1)); p = m_poly17.get(); r = m_rand17 = m_poly17.get() + POLY17_SIZE + 1; @@ -250,7 +250,7 @@ void gridlee_state::poly17_init() READ8_MEMBER(gridlee_state::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(); diff --git a/src/mame/drivers/groundfx.cpp b/src/mame/drivers/groundfx.cpp index d00eb7b0622..6efe31f8f2b 100644 --- a/src/mame/drivers/groundfx.cpp +++ b/src/mame/drivers/groundfx.cpp @@ -413,8 +413,8 @@ READ32_MEMBER(groundfx_state::irq_speedup_r_groundfx) DRIVER_INIT_MEMBER(groundfx_state,groundfx) { - UINT32 offset,i; - UINT8 *gfx = memregion("gfx3")->base(); + uint32_t offset,i; + uint8_t *gfx = memregion("gfx3")->base(); int size=memregion("gfx3")->bytes(); int data; diff --git a/src/mame/drivers/gstream.cpp b/src/mame/drivers/gstream.cpp index dfa06d1ca95..1eb7da63744 100644 --- a/src/mame/drivers/gstream.cpp +++ b/src/mame/drivers/gstream.cpp @@ -159,17 +159,17 @@ public: optional_device m_oki_2; /* memory pointers */ - required_shared_ptr m_workram; - required_shared_ptr m_vram; -// UINT32 * m_nvram; // currently this uses generic nvram handling + required_shared_ptr m_workram; + required_shared_ptr m_vram; +// uint32_t * m_nvram; // currently this uses generic nvram handling /* video-related */ - UINT32 m_tmap1_scrollx; - UINT32 m_tmap2_scrollx; - UINT32 m_tmap3_scrollx; - UINT32 m_tmap1_scrolly; - UINT32 m_tmap2_scrolly; - UINT32 m_tmap3_scrolly; + uint32_t m_tmap1_scrollx; + uint32_t m_tmap2_scrollx; + uint32_t m_tmap3_scrollx; + uint32_t m_tmap1_scrolly; + uint32_t m_tmap2_scrolly; + uint32_t m_tmap3_scrolly; /* misc */ int m_oki_bank_1; @@ -198,11 +198,11 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_gstream(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void draw_bg_gstream(bitmap_rgb32 &bitmap, const rectangle &cliprect, int xscrl, int yscrl, int map, UINT32* ram, int palbase); + uint32_t screen_update_gstream(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void draw_bg_gstream(bitmap_rgb32 &bitmap, const rectangle &cliprect, int xscrl, int yscrl, int map, uint32_t* ram, int palbase); - void rearrange_sprite_data(UINT8* ROM, UINT32* NEW, UINT32* NEW2); - void rearrange_tile_data(UINT8* ROM, UINT32* NEW, UINT32* NEW2); + void rearrange_sprite_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2); + void rearrange_tile_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2); required_device m_gfxdecode; required_device m_palette; @@ -594,8 +594,8 @@ void gstream_state::video_start() // custom drawgfx function for x2222 to draw RGB data instead of indexed data, needed because our regular drawgfx and tilemap code don't support that void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx,gfx_element *gfx2, - UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, - UINT32 transpen) + uint32_t code, uint32_t color, int flipx, int flipy, int32_t destx, int32_t desty, + uint32_t transpen) { // use pen usage to optimize code %= gfx->elements(); @@ -605,11 +605,11 @@ void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_e do { g_profiler.start(PROFILER_DRAWGFX); do { - const UINT8 *srcdata, *srcdata2; - INT32 destendx, destendy; - INT32 srcx, srcy; - INT32 curx, cury; - INT32 dy; + const uint8_t *srcdata, *srcdata2; + int32_t destendx, destendy; + int32_t srcx, srcy; + int32_t curx, cury; + int32_t dy; assert(dest.valid()); assert(gfx != nullptr); @@ -671,7 +671,7 @@ void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_e srcdata2 = gfx2->get_data(code); /* compute how many blocks of 4 pixels we have */ - UINT32 leftovers = (destendx + 1 - destx); + uint32_t leftovers = (destendx + 1 - destx); /* adjust srcdata to point to the first source pixel of the row */ srcdata += srcy * gfx->rowbytes() + srcx; @@ -683,9 +683,9 @@ void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_e /* iterate over pixels in Y */ for (cury = desty; cury <= destendy; cury++) { - UINT32 *destptr = &dest.pixt(cury, destx); - const UINT8 *srcptr = srcdata; - const UINT8 *srcptr2 = srcdata2; + uint32_t *destptr = &dest.pixt(cury, destx); + const uint8_t *srcptr = srcdata; + const uint8_t *srcptr2 = srcdata2; srcdata += dy; srcdata2 += dy; @@ -694,14 +694,14 @@ void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_e /* iterate over leftover pixels */ for (curx = 0; curx < leftovers; curx++) { - UINT32 srcdata = (srcptr[0]); - UINT32 srcdata2 = (srcptr2[0]); - - UINT32 fullval = (srcdata | (srcdata2 << 8)); - UINT32 r = ((fullval >> 0) & 0x1f) << 3; - UINT32 g = ((fullval >> 5) & 0x3f) << 2; - UINT32 b = ((fullval >> 11) & 0x1f) << 3; - UINT32 full = (r << 16) | (g << 8) | (b << 0); + uint32_t srcdata = (srcptr[0]); + uint32_t srcdata2 = (srcptr2[0]); + + uint32_t fullval = (srcdata | (srcdata2 << 8)); + uint32_t r = ((fullval >> 0) & 0x1f) << 3; + uint32_t g = ((fullval >> 5) & 0x3f) << 2; + uint32_t b = ((fullval >> 11) & 0x1f) << 3; + uint32_t full = (r << 16) | (g << 8) | (b << 0); if (full != 0) destptr[0] = full; @@ -718,9 +718,9 @@ void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_e /* iterate over pixels in Y */ for (cury = desty; cury <= destendy; cury++) { - UINT32 *destptr = &dest.pixt(cury, destx); - const UINT8 *srcptr = srcdata; - const UINT8 *srcptr2 = srcdata2; + uint32_t *destptr = &dest.pixt(cury, destx); + const uint8_t *srcptr = srcdata; + const uint8_t *srcptr2 = srcdata2; srcdata += dy; srcdata2 += dy; @@ -728,14 +728,14 @@ void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_e /* iterate over leftover pixels */ for (curx = 0; curx < leftovers; curx++) { - UINT32 srcdata = (srcptr[0]); - UINT32 srcdata2 = (srcptr2[0]); - - UINT32 fullval = (srcdata | (srcdata2 << 8)); - UINT32 r = ((fullval >> 0) & 0x1f) << 3; - UINT32 g = ((fullval >> 5) & 0x3f) << 2; - UINT32 b = ((fullval >> 11) & 0x1f) << 3; - UINT32 full = (r << 16) | (g << 8) | (b << 0); + uint32_t srcdata = (srcptr[0]); + uint32_t srcdata2 = (srcptr2[0]); + + uint32_t fullval = (srcdata | (srcdata2 << 8)); + uint32_t r = ((fullval >> 0) & 0x1f) << 3; + uint32_t g = ((fullval >> 5) & 0x3f) << 2; + uint32_t b = ((fullval >> 11) & 0x1f) << 3; + uint32_t full = (r << 16) | (g << 8) | (b << 0); if (full != 0) destptr[0] = full; @@ -750,7 +750,7 @@ void drawgfx_transpen_x2222(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_e } while (0); } -void gstream_state::draw_bg_gstream(bitmap_rgb32 &bitmap, const rectangle &cliprect, int xscrl, int yscrl, int map, UINT32* ram, int palbase ) +void gstream_state::draw_bg_gstream(bitmap_rgb32 &bitmap, const rectangle &cliprect, int xscrl, int yscrl, int map, uint32_t* ram, int palbase ) { int scrollx; int scrolly; @@ -758,10 +758,10 @@ void gstream_state::draw_bg_gstream(bitmap_rgb32 &bitmap, const rectangle &clipr scrollx = xscrl&0x1ff; scrolly = yscrl&0x1ff; - UINT16 basey = scrolly>>5; + uint16_t basey = scrolly>>5; for (int y=0;y<13;y++) { - UINT16 basex = scrollx>>5; + uint16_t basex = scrollx>>5; for (int x=0;x<16;x++) { int vram_data = (ram[(basex&0x0f)+((basey&0x0f)*0x10)]); @@ -781,7 +781,7 @@ void gstream_state::draw_bg_gstream(bitmap_rgb32 &bitmap, const rectangle &clipr } } -UINT32 gstream_state::screen_update_gstream(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t gstream_state::screen_update_gstream(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { /* The tilemaps and sprite are interleaved together. Even Words are tilemap tiles @@ -1137,7 +1137,7 @@ DRIVER_INIT_MEMBER(gstream_state,gstream) } -void gstream_state::rearrange_tile_data(UINT8* ROM, UINT32* NEW, UINT32* NEW2) +void gstream_state::rearrange_tile_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2) { int i; for (i = 0; i < 0x80000; i++) @@ -1147,7 +1147,7 @@ void gstream_state::rearrange_tile_data(UINT8* ROM, UINT32* NEW, UINT32* NEW2) } } -void gstream_state::rearrange_sprite_data(UINT8* ROM, UINT32* NEW, UINT32* NEW2) +void gstream_state::rearrange_sprite_data(uint8_t* ROM, uint32_t* NEW, uint32_t* NEW2) { int i; for (i = 0; i < 0x200000; i++) @@ -1162,10 +1162,10 @@ DRIVER_INIT_MEMBER(gstream_state,x2222) m_maincpu->space(AS_PROGRAM).install_read_handler(0x7ffac, 0x7ffaf, read32_delegate(FUNC(gstream_state::x2222_speedup_r), this)); // older m_maincpu->space(AS_PROGRAM).install_read_handler(0x84e3c, 0x84e3f, read32_delegate(FUNC(gstream_state::x2222_speedup2_r), this)); // newer - rearrange_sprite_data(memregion("sprites")->base(), (UINT32*)memregion("gfx1")->base(), (UINT32*)memregion("gfx1_lower")->base() ); - rearrange_tile_data(memregion("bg1")->base(), (UINT32*)memregion("gfx2")->base(), (UINT32*)memregion("gfx2_lower")->base()); - rearrange_tile_data(memregion("bg2")->base(), (UINT32*)memregion("gfx3")->base(), (UINT32*)memregion("gfx3_lower")->base()); - rearrange_tile_data(memregion("bg3")->base(), (UINT32*)memregion("gfx4")->base(), (UINT32*)memregion("gfx4_lower")->base()); + rearrange_sprite_data(memregion("sprites")->base(), (uint32_t*)memregion("gfx1")->base(), (uint32_t*)memregion("gfx1_lower")->base() ); + rearrange_tile_data(memregion("bg1")->base(), (uint32_t*)memregion("gfx2")->base(), (uint32_t*)memregion("gfx2_lower")->base()); + rearrange_tile_data(memregion("bg2")->base(), (uint32_t*)memregion("gfx3")->base(), (uint32_t*)memregion("gfx3_lower")->base()); + rearrange_tile_data(memregion("bg3")->base(), (uint32_t*)memregion("gfx4")->base(), (uint32_t*)memregion("gfx4_lower")->base()); m_xoffset = 0; } diff --git a/src/mame/drivers/gsword.cpp b/src/mame/drivers/gsword.cpp index 621683e6b49..3e12a6a93e8 100644 --- a/src/mame/drivers/gsword.cpp +++ b/src/mame/drivers/gsword.cpp @@ -171,7 +171,7 @@ int gsword_state::coins_in(void) /* (4004,4005) clear down counter , if (4004,4005)==0 then (402E)=0 */ READ8_MEMBER(gsword_state::gsword_hack_r) { - UINT8 data = m_cpu2_ram[offset + 4]; + uint8_t data = m_cpu2_ram[offset + 4]; /*if(offset==1)osd_printf_debug("CNT %02X%02X\n",m_cpu2_ram[5],m_cpu2_ram[4]); */ @@ -875,7 +875,7 @@ ROM_END DRIVER_INIT_MEMBER(gsword_state,gsword) { #if 0 - UINT8 *ROM2 = memregion("sub")->base(); + uint8_t *ROM2 = memregion("sub")->base(); ROM2[0x1da] = 0xc3; /* patch for rom self check */ ROM2[0x71e] = 0; /* patch for sound protection or time out function */ @@ -890,7 +890,7 @@ DRIVER_INIT_MEMBER(gsword_state,gsword) DRIVER_INIT_MEMBER(gsword_state,gsword2) { #if 0 - UINT8 *ROM2 = memregion("sub")->base(); + uint8_t *ROM2 = memregion("sub")->base(); ROM2[0x1da] = 0xc3; /* patch for rom self check */ ROM2[0x726] = 0; /* patch for sound protection or time out function */ diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp index 39c4090ec11..6c40020cc4e 100644 --- a/src/mame/drivers/gticlub.cpp +++ b/src/mame/drivers/gticlub.cpp @@ -287,8 +287,8 @@ public: optional_device m_k001604_1; optional_device m_k001604_2; - required_shared_ptr m_work_ram; - required_shared_ptr m_generic_paletteram_32; + required_shared_ptr m_work_ram; + required_shared_ptr m_generic_paletteram_32; optional_ioport m_analog0, m_analog1, m_analog2, m_analog3; @@ -325,16 +325,16 @@ public: ADC1038_INPUT_CB(adc1038_input_callback); - UINT32 screen_update_gticlub(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hangplt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gticlub(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hangplt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: - void gticlub_led_setreg(int offset, UINT8 data); + void gticlub_led_setreg(int offset, uint8_t data); - UINT8 m_gticlub_led_reg[2]; + uint8_t m_gticlub_led_reg[2]; emu_timer *m_sound_irq_timer; - std::unique_ptr m_sharc_dataram_0; - std::unique_ptr m_sharc_dataram_1; + std::unique_ptr m_sharc_dataram_0; + std::unique_ptr m_sharc_dataram_1; }; @@ -415,8 +415,8 @@ READ8_MEMBER(gticlub_state::sysreg_r) // a = ADC readout // e = EEPROM data out - UINT32 eeprom_bit = (m_eeprom->do_read() << 1); - UINT32 adc_bit = (m_adc1038->do_read() << 2); + uint32_t eeprom_bit = (m_eeprom->do_read() << 1); + uint32_t adc_bit = (m_adc1038->do_read() << 2); return (eeprom_bit | adc_bit); } @@ -821,7 +821,7 @@ MACHINE_RESET_MEMBER(gticlub_state,gticlub) m_dsp->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); } -void gticlub_state::gticlub_led_setreg(int offset, UINT8 data) +void gticlub_state::gticlub_led_setreg(int offset, uint8_t data) { m_gticlub_led_reg[offset] = data; } @@ -837,7 +837,7 @@ VIDEO_START_MEMBER(gticlub_state,gticlub) */ } -UINT32 gticlub_state::screen_update_gticlub(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t gticlub_state::screen_update_gticlub(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_k001604_1->draw_back_layer(bitmap, cliprect); @@ -879,13 +879,13 @@ UINT32 gticlub_state::screen_update_gticlub(screen_device &screen, bitmap_rgb32 int index = (debug_tex_page - 1) * 0x40000; int pal = debug_tex_palette & 7; int tp = (debug_tex_palette >> 3) & 1; - UINT8 *rom = machine.root_device().memregion("gfx1")->base(); + uint8_t *rom = machine.root_device().memregion("gfx1")->base(); for (y=0; y < 384; y++) { for (x=0; x < 512; x++) { - UINT8 pixel = rom[index + (y*512) + x]; + uint8_t pixel = rom[index + (y*512) + x]; bitmap.pix32(y, x) = K001006_palette[tp][(pal * 256) + pixel]; } } @@ -903,7 +903,7 @@ UINT32 gticlub_state::screen_update_gticlub(screen_device &screen, bitmap_rgb32 return 0; } -UINT32 gticlub_state::screen_update_hangplt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t gticlub_state::screen_update_hangplt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->pen(0), cliprect); @@ -1400,7 +1400,7 @@ ROM_END DRIVER_INIT_MEMBER(gticlub_state,gticlub) { - m_sharc_dataram_0 = std::make_unique(0x100000/4); + m_sharc_dataram_0 = std::make_unique(0x100000/4); m_dsp->enable_recompiler(); } @@ -1409,8 +1409,8 @@ void gticlub_state::init_hangplt_common() { m_konppc->set_cgboard_texture_bank(0, "bank5", memregion("user5")->base()); m_konppc->set_cgboard_texture_bank(1, "bank6", memregion("user5")->base()); - m_sharc_dataram_0 = std::make_unique(0x100000/4); - m_sharc_dataram_1 = std::make_unique(0x100000/4); + m_sharc_dataram_0 = std::make_unique(0x100000/4); + m_sharc_dataram_1 = std::make_unique(0x100000/4); } DRIVER_INIT_MEMBER(gticlub_state,hangplt) @@ -1418,7 +1418,7 @@ DRIVER_INIT_MEMBER(gticlub_state,hangplt) init_hangplt_common(); // workaround for lock/unlock errors - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); rom[(0x153ac^4) / 4] = 0x4e800020; rom[(0x15428^4) / 4] = 0x4e800020; } @@ -1428,7 +1428,7 @@ DRIVER_INIT_MEMBER(gticlub_state,hangpltu) init_hangplt_common(); // workaround for lock/unlock errors - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); rom[(0x153d0^4) / 4] = 0x4e800020; rom[(0x15428^4) / 4] = 0x4e800020; } diff --git a/src/mame/drivers/gts1.cpp b/src/mame/drivers/gts1.cpp index 92d72a62d20..2d7915f1976 100644 --- a/src/mame/drivers/gts1.cpp +++ b/src/mame/drivers/gts1.cpp @@ -110,12 +110,12 @@ private: virtual void machine_reset() override; required_device m_maincpu; required_ioport_array<5> m_switches; - UINT8 m_strobe; //!< switches strobe lines (5 lower bits used) - UINT8 m_nvram_addr; //!< NVRAM address + uint8_t m_strobe; //!< switches strobe lines (5 lower bits used) + uint8_t m_nvram_addr; //!< NVRAM address bool m_nvram_e2; //!< NVRWAM enable (E2 line) bool m_nvram_wr; //!< NVRWAM write (W/R line) - UINT16 m_6351_addr; //!< ROM MM6351 address (12 bits) - UINT16 m_z30_out; //!< 4-to-16 decoder outputs + uint16_t m_6351_addr; //!< ROM MM6351 address (12 bits) + uint16_t m_z30_out; //!< 4-to-16 decoder outputs }; static ADDRESS_MAP_START( gts1_map, AS_PROGRAM, 8, gts1_state ) @@ -342,7 +342,7 @@ DRIVER_INIT_MEMBER(gts1_state,gts1) READ8_MEMBER (gts1_state::gts1_solenoid_r) { - UINT8 data = 0; + uint8_t data = 0; LOG(("%s: solenoid[%02x] -> %x\n", __FUNCTION__, offset, data)); return data; } @@ -397,7 +397,7 @@ WRITE8_MEMBER(gts1_state::gts1_solenoid_w) READ8_MEMBER (gts1_state::gts1_switches_r) { - UINT8 data = 1; + uint8_t data = 1; if (offset >= 8 && offset < 16) { const int bit = offset - 8; for (int i = 0; i < 5; i++) { @@ -439,7 +439,7 @@ WRITE8_MEMBER(gts1_state::gts1_display_w) #define _f (1 << 5) #define _g (1 << 6) #define _h (1 << 7) - static const UINT8 ttl7448_mod[16] = { + static const uint8_t ttl7448_mod[16] = { /* 0 */ _a | _b | _c | _d | _e | _f, /* 1 */ _h, /* 2 */ _a | _b | _d | _e | _g, @@ -457,8 +457,8 @@ WRITE8_MEMBER(gts1_state::gts1_display_w) /* e */ _d | _e | _f | _g, /* f */ 0 }; - UINT8 a = ttl7448_mod[(data >> 0) & 15]; - UINT8 b = ttl7448_mod[(data >> 4) & 15]; + uint8_t a = ttl7448_mod[(data >> 0) & 15]; + uint8_t b = ttl7448_mod[(data >> 4) & 15]; // LOG(("%s: offset:%d data:%02x a:%02x b:%02x\n", __FUNCTION__, offset, data, a, b)); if ((offset % 8) < 7) { output().set_indexed_value("digit8_", offset, a); @@ -493,13 +493,13 @@ WRITE8_MEMBER(gts1_state::gts1_display_w) */ READ8_MEMBER (gts1_state::gts1_nvram_r) { - UINT8 data = 0x0f; + uint8_t data = 0x0f; switch (offset) { case 0: // group A // FIXME: Schematics says TO Z5 if (!m_nvram_wr && m_nvram_e2) { - UINT8* nvram = memregion("nvram")->base(); + uint8_t* nvram = memregion("nvram")->base(); assert(nvram != nullptr); data = nvram[m_nvram_addr]; LOG(("%s: nvram[%02x] -> %x\n", __FUNCTION__, m_nvram_addr, data)); @@ -531,7 +531,7 @@ WRITE8_MEMBER(gts1_state::gts1_nvram_w) case 2: // group C - data bits 3:0 of NVRAM if (m_nvram_wr && m_nvram_e2) { LOG(("%s: nvram[%02x] <- %x\n", __FUNCTION__, m_nvram_addr, data & 15)); - UINT8* nvram = memregion("nvram")->base(); + uint8_t* nvram = memregion("nvram")->base(); assert(nvram != nullptr); nvram[m_nvram_addr] = data & 15; } @@ -546,11 +546,11 @@ WRITE8_MEMBER(gts1_state::gts1_nvram_w) */ READ8_MEMBER (gts1_state::gts1_lamp_apm_r) { - UINT8 data = 0x0f; + uint8_t data = 0x0f; switch (offset) { case 0: // group A switches S01-S04, S09-S12, S17-S20 if (m_z30_out & 1) { - UINT8 dsw0 = ioport("DSW0")->read(); + uint8_t dsw0 = ioport("DSW0")->read(); if (0 == BIT(dsw0,0)) // S01 data &= ~(1 << 3); if (0 == BIT(dsw0,1)) // S02 @@ -561,7 +561,7 @@ READ8_MEMBER (gts1_state::gts1_lamp_apm_r) data &= ~(1 << 0); } if (m_z30_out & 2) { - UINT8 dsw1 = ioport("DSW1")->read(); + uint8_t dsw1 = ioport("DSW1")->read(); if (0 == BIT(dsw1,0)) // S09 data &= ~(1 << 0); if (0 == BIT(dsw1,1)) // S10 @@ -572,7 +572,7 @@ READ8_MEMBER (gts1_state::gts1_lamp_apm_r) data &= ~(1 << 3); } if (m_z30_out & 4) { - UINT8 dsw2 = ioport("DSW2")->read(); + uint8_t dsw2 = ioport("DSW2")->read(); if (0 == BIT(dsw2,0)) // S17 data &= ~(1 << 0); if (0 == BIT(dsw2,1)) // S18 @@ -585,7 +585,7 @@ READ8_MEMBER (gts1_state::gts1_lamp_apm_r) break; case 1: // group B switches S05-S08, S09-S12, S17-S20 if (m_z30_out & 1) { - UINT8 dsw0 = ioport("DSW0")->read(); + uint8_t dsw0 = ioport("DSW0")->read(); if (0 == BIT(dsw0,4)) // S05 data &= ~(1 << 3); if (0 == BIT(dsw0,5)) // S06 @@ -596,7 +596,7 @@ READ8_MEMBER (gts1_state::gts1_lamp_apm_r) data &= ~(1 << 0); } if (m_z30_out & 2) { - UINT8 dsw1 = ioport("DSW1")->read(); + uint8_t dsw1 = ioport("DSW1")->read(); if (0 == BIT(dsw1,4)) // S13 data &= ~(1 << 0); if (0 == BIT(dsw1,5)) // S14 @@ -607,7 +607,7 @@ READ8_MEMBER (gts1_state::gts1_lamp_apm_r) data &= ~(1 << 3); } if (m_z30_out & 4) { - UINT8 dsw2 = ioport("DSW2")->read(); + uint8_t dsw2 = ioport("DSW2")->read(); if (0 == BIT(dsw2,4)) // S21 data &= ~(1 << 0); if (0 == BIT(dsw2,5)) // S22 @@ -650,7 +650,7 @@ WRITE8_MEMBER(gts1_state::gts1_lamp_apm_w) READ8_MEMBER (gts1_state::gts1_io_r) { - const UINT8 data = 0x0f; + const uint8_t data = 0x0f; LOG(("%s: unmapped io[%02x] -> %x\n", __FUNCTION__, offset, data)); return data; } @@ -663,8 +663,8 @@ WRITE8_MEMBER(gts1_state::gts1_io_w) READ8_MEMBER (gts1_state::gts1_pa_r) { // return ROM nibble - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 data = ROM[0x2000 + m_6351_addr] & 0x0f; + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t data = ROM[0x2000 + m_6351_addr] & 0x0f; LOG(("%s: ROM[%03x]:%02x\n", __FUNCTION__, m_6351_addr, data)); return data; } diff --git a/src/mame/drivers/gts3.cpp b/src/mame/drivers/gts3.cpp index 25e96b38a96..8cd6912fafa 100644 --- a/src/mame/drivers/gts3.cpp +++ b/src/mame/drivers/gts3.cpp @@ -56,10 +56,10 @@ public: private: bool m_dispclk; bool m_lampclk; - UINT8 m_digit; - UINT8 m_row; // for lamps and switches - UINT8 m_segment[4]; - UINT8 m_u4b; + uint8_t m_digit; + uint8_t m_row; // for lamps and switches + uint8_t m_segment[4]; + uint8_t m_u4b; virtual void machine_reset() override; required_device m_maincpu; required_device m_u4; @@ -216,7 +216,7 @@ WRITE_LINE_MEMBER( gts3_state::nmi_w ) WRITE8_MEMBER( gts3_state::segbank_w ) { - UINT32 seg1,seg2; + uint32_t seg1,seg2; m_segment[offset] = data; seg1 = m_segment[offset&2] | (m_segment[offset|1] << 8); seg2 = BITSWAP32(seg1,16,16,16,16,16,16,16,16,16,16,16,16,16,16,15,14,9,7,13,11,10,6,8,12,5,4,3,3,2,1,0,0); diff --git a/src/mame/drivers/gts3a.cpp b/src/mame/drivers/gts3a.cpp index e05c41c47b6..d567ad00609 100644 --- a/src/mame/drivers/gts3a.cpp +++ b/src/mame/drivers/gts3a.cpp @@ -51,11 +51,11 @@ public: private: bool m_dispclk; bool m_lampclk; - UINT8 m_digit; - UINT8 m_row; // for lamps and switches - UINT8 m_segment[4]; - UINT8 m_u4b; - UINT8 m_dmd; + uint8_t m_digit; + uint8_t m_row; // for lamps and switches + uint8_t m_segment[4]; + uint8_t m_u4b; + uint8_t m_dmd; virtual void machine_reset() override; required_device m_maincpu; required_device m_dmdcpu; @@ -225,7 +225,7 @@ WRITE_LINE_MEMBER( gts3a_state::nmi_w ) WRITE8_MEMBER( gts3a_state::segbank_w ) { // this is all wrong - UINT32 seg1,seg2; + uint32_t seg1,seg2; m_segment[offset] = data; seg1 = m_segment[offset&2] | (m_segment[offset|1] << 8); seg2 = BITSWAP32(seg1,16,16,16,16,16,16,16,16,16,16,16,16,16,16,15,14,9,7,13,11,10,6,8,12,5,4,3,3,2,1,0,0); @@ -280,7 +280,7 @@ void gts3a_state::machine_reset() DRIVER_INIT_MEMBER( gts3a_state, gts3a ) { - UINT8 *dmd = memregion("dmdcpu")->base(); + uint8_t *dmd = memregion("dmdcpu")->base(); membank("bank1")->configure_entries(0, 32, &dmd[0x0000], 0x4000); } @@ -305,9 +305,9 @@ PALETTE_INIT_MEMBER( gts3a_state, gts3a ) MC6845_UPDATE_ROW( gts3a_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 gfx=0; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t gfx=0; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { diff --git a/src/mame/drivers/gts80.cpp b/src/mame/drivers/gts80.cpp index 58d014d4c08..09e1adc3500 100644 --- a/src/mame/drivers/gts80.cpp +++ b/src/mame/drivers/gts80.cpp @@ -47,10 +47,10 @@ public: DECLARE_WRITE8_MEMBER(port3a_w); DECLARE_WRITE8_MEMBER(port3b_w); private: - UINT8 m_port2; - UINT8 m_segment; - UINT8 m_lamprow; - UINT8 m_swrow; + uint8_t m_port2; + uint8_t m_segment; + uint8_t m_lamprow; + uint8_t m_swrow; virtual void machine_reset() override; required_device m_maincpu; optional_device m_r0_sound; @@ -261,7 +261,7 @@ INPUT_PORTS_END READ8_MEMBER( gts80_state::port1a_r ) { char kbdrow[8]; - UINT8 data = 0; + uint8_t data = 0; if ((m_lamprow < 4) && (m_segment==0x80)) { sprintf(kbdrow,"DSW.%d",m_lamprow); @@ -291,9 +291,9 @@ WRITE8_MEMBER( gts80_state::port1b_w ) WRITE8_MEMBER( gts80_state::port2a_w ) { m_port2 = data; - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 - UINT16 seg1 = (UINT16)patterns[m_segment & 15]; - UINT16 seg2 = BITSWAP16(seg1, 8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 3, 2, 1, 0); + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 + uint16_t seg1 = (uint16_t)patterns[m_segment & 15]; + uint16_t seg2 = BITSWAP16(seg1, 8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 3, 2, 1, 0); switch (data & 0x70) { case 0x10: // player 1&2 @@ -325,7 +325,7 @@ WRITE8_MEMBER( gts80_state::port3a_w ) //pb0-3 = sound; pb4-7 = lamprow WRITE8_MEMBER( gts80_state::port3b_w ) { - UINT8 sndcmd = data & 15; + uint8_t sndcmd = data & 15; m_lamprow = data >> 4; if (m_r0_sound) m_r0_sound->write(space, offset, sndcmd); diff --git a/src/mame/drivers/gts80a.cpp b/src/mame/drivers/gts80a.cpp index 5d883ec4dfa..ec1dbc032a9 100644 --- a/src/mame/drivers/gts80a.cpp +++ b/src/mame/drivers/gts80a.cpp @@ -36,10 +36,10 @@ public: DECLARE_WRITE8_MEMBER(port3a_w); DECLARE_WRITE8_MEMBER(port3b_w); private: - UINT8 m_port2; - UINT8 m_segment; - UINT8 m_lamprow; - UINT8 m_swrow; + uint8_t m_port2; + uint8_t m_segment; + uint8_t m_lamprow; + uint8_t m_swrow; virtual void machine_reset() override; required_device m_maincpu; optional_device m_r0_sound; @@ -250,7 +250,7 @@ INPUT_PORTS_END READ8_MEMBER( gts80a_state::port1a_r ) { char kbdrow[8]; - UINT8 data = 0; + uint8_t data = 0; if ((m_lamprow < 4) && (m_segment==0x80)) { sprintf(kbdrow,"DSW.%d",m_lamprow); @@ -280,9 +280,9 @@ WRITE8_MEMBER( gts80a_state::port1b_w ) WRITE8_MEMBER( gts80a_state::port2a_w ) { m_port2 = data; - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 - UINT16 seg1 = (UINT16)patterns[m_segment & 15]; - UINT16 seg2 = BITSWAP16(seg1, 8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 3, 2, 1, 0); + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 + uint16_t seg1 = (uint16_t)patterns[m_segment & 15]; + uint16_t seg2 = BITSWAP16(seg1, 8, 8, 8, 8, 8, 8, 7, 7, 6, 6, 5, 4, 3, 2, 1, 0); switch (data & 0x70) { case 0x10: // player 1&2 @@ -314,7 +314,7 @@ WRITE8_MEMBER( gts80a_state::port3a_w ) //pb0-3 = sound; pb4-7 = lamprow WRITE8_MEMBER( gts80a_state::port3b_w ) { - UINT8 sndcmd = data & 15; + uint8_t sndcmd = data & 15; m_lamprow = data >> 4; if (m_r0_sound) m_r0_sound->write(space, offset, sndcmd); @@ -390,21 +390,21 @@ public: { } - UINT32 screen_update_caveman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_caveman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: required_device m_videocpu; - required_shared_ptr m_vram; + required_shared_ptr m_vram; }; -UINT32 caveman_state::screen_update_caveman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t caveman_state::screen_update_caveman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int count = 0; for (int y = 0; y < 256; y++) { for (int x = 0; x < 256; x += 4) { - UINT8 pix = m_vram[count]; + uint8_t pix = m_vram[count]; bitmap.pix16(y, x+0) = (pix >> 6)&0x3; bitmap.pix16(y, x+1) = (pix >> 4)&0x3; diff --git a/src/mame/drivers/gts80b.cpp b/src/mame/drivers/gts80b.cpp index 41419b762e6..fdd883cb3f2 100644 --- a/src/mame/drivers/gts80b.cpp +++ b/src/mame/drivers/gts80b.cpp @@ -37,13 +37,13 @@ public: DECLARE_WRITE8_MEMBER(port3a_w); DECLARE_WRITE8_MEMBER(port3b_w); private: - UINT8 m_dispcmd; - UINT8 m_port2a; - UINT8 m_port2b; - UINT8 m_lamprow; - UINT8 m_swrow; + uint8_t m_dispcmd; + uint8_t m_port2a; + uint8_t m_port2b; + uint8_t m_lamprow; + uint8_t m_swrow; bool m_in_cmd_mode[2]; - UINT8 m_digit[2]; + uint8_t m_digit[2]; virtual void machine_reset() override; required_device m_maincpu; optional_device m_r0_sound; @@ -251,7 +251,7 @@ static INPUT_PORTS_START( gts80b ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_O) INPUT_PORTS_END -static const UINT16 patterns[] = { +static const uint16_t patterns[] = { /* 0x00-0x07 */ 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, /* 0x08-0x0f */ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, /* 0x10-0x17 */ 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, @@ -273,7 +273,7 @@ static const UINT16 patterns[] = { READ8_MEMBER( gts80b_state::port1a_r ) { char kbdrow[8]; - UINT8 data = 0; + uint8_t data = 0; if ((m_lamprow < 4) && (m_port2b==0x80)) { sprintf(kbdrow,"DSW.%d",m_lamprow); @@ -312,10 +312,10 @@ WRITE8_MEMBER( gts80b_state::port2a_w ) WRITE8_MEMBER( gts80b_state::port2b_w ) { m_port2b = data & 15; - UINT16 segment; + uint16_t segment; // crude approximation of the Rockwell display chips - for (UINT8 i = 0; i < 2; i++) // 2 chips + for (uint8_t i = 0; i < 2; i++) // 2 chips { if (!BIT(data, i+4)) // are we addressing the chip? { @@ -350,7 +350,7 @@ WRITE8_MEMBER( gts80b_state::port3a_w ) //pb0-3 = sound; pb4-7 = lamprow WRITE8_MEMBER( gts80b_state::port3b_w ) { - UINT8 sndcmd = data & 15; + uint8_t sndcmd = data & 15; m_lamprow = data >> 4; if (m_r0_sound) m_r0_sound->write(space, offset, sndcmd); diff --git a/src/mame/drivers/guab.cpp b/src/mame/drivers/guab.cpp index 62a04e77e23..cbe918479e2 100644 --- a/src/mame/drivers/guab.cpp +++ b/src/mame/drivers/guab.cpp @@ -56,8 +56,8 @@ enum int_levels struct ef9369 { - UINT32 addr; - UINT16 clut[16]; /* 13-bits - a marking bit and a 444 color */ + uint32_t addr; + uint16_t clut[16]; /* 13-bits - a marking bit and a 444 color */ }; @@ -82,7 +82,7 @@ public: DECLARE_WRITE16_MEMBER(io_w); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); DECLARE_WRITE_LINE_MEMBER(ptm_irq); - UINT32 screen_update_guab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_guab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -148,7 +148,7 @@ WRITE16_MEMBER(guab_state::guab_tms34061_w) READ16_MEMBER(guab_state::guab_tms34061_r) { - UINT16 data = 0; + uint16_t data = 0; int func = (offset >> 19) & 3; int row = (offset >> 7) & 0xff; int col; @@ -187,7 +187,7 @@ WRITE16_MEMBER(guab_state::ef9369_w) /* Data register */ else { - UINT32 entry = pal.addr >> 1; + uint32_t entry = pal.addr >> 1; if ((pal.addr & 1) == 0) { @@ -196,7 +196,7 @@ WRITE16_MEMBER(guab_state::ef9369_w) } else { - UINT16 col; + uint16_t col; pal.clut[entry] &= ~0x1f00; pal.clut[entry] |= (data & 0x1f) << 8; @@ -219,7 +219,7 @@ READ16_MEMBER(guab_state::ef9369_r) struct ef9369 &pal = m_pal; if ((offset & 1) == 0) { - UINT16 col = pal.clut[pal.addr >> 1]; + uint16_t col = pal.clut[pal.addr >> 1]; if ((pal.addr & 1) == 0) return col & 0xff; @@ -233,7 +233,7 @@ READ16_MEMBER(guab_state::ef9369_r) } } -UINT32 guab_state::screen_update_guab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t guab_state::screen_update_guab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; @@ -248,12 +248,12 @@ UINT32 guab_state::screen_update_guab(screen_device &screen, bitmap_ind16 &bitma for (y = cliprect.min_y; y <= cliprect.max_y; ++y) { - UINT8 *src = &m_tms34061->m_display.vram[256 * y]; - UINT16 *dest = &bitmap.pix16(y); + uint8_t *src = &m_tms34061->m_display.vram[256 * y]; + uint16_t *dest = &bitmap.pix16(y); for (x = cliprect.min_x; x <= cliprect.max_x; x += 2) { - UINT8 pen = src[x >> 1]; + uint8_t pen = src[x >> 1]; /* Draw two 4-bit pixels */ *dest++ = m_palette->pen(pen >> 4); @@ -300,11 +300,11 @@ INPUT_CHANGED_MEMBER(guab_state::coin_inserted) { if (newval == 0) { - UINT32 credit; + uint32_t credit; address_space &space = m_maincpu->space(AS_PROGRAM); /* Get the current credit value and add the new coin value */ - credit = space.read_dword(0x8002c) + (UINT32)(uintptr_t)param; + credit = space.read_dword(0x8002c) + (uint32_t)(uintptr_t)param; space.write_dword(0x8002c, credit); } } diff --git a/src/mame/drivers/gundealr.cpp b/src/mame/drivers/gundealr.cpp index b8a2afed7c2..21f077ab6c5 100644 --- a/src/mame/drivers/gundealr.cpp +++ b/src/mame/drivers/gundealr.cpp @@ -375,7 +375,7 @@ GFXDECODE_END void gundealr_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); @@ -433,9 +433,9 @@ MACHINE_CONFIG_END TIMER_DEVICE_CALLBACK_MEMBER(gundealr_state::yamyam_mcu_sim) { - static const UINT8 snipped_cmd03[8] = { 0x3a, 0x00, 0xc0, 0x47, 0x3a, 0x01, 0xc0, 0xc9 }; - static const UINT8 snipped_cmd05_1[5] = { 0xcd, 0x20, 0xe0, 0x7e, 0xc9 }; - static const UINT8 snipped_cmd05_2[8] = { 0xc5, 0x01, 0x00, 0x00, 0x4f, 0x09, 0xc1, 0xc9 }; + static const uint8_t snipped_cmd03[8] = { 0x3a, 0x00, 0xc0, 0x47, 0x3a, 0x01, 0xc0, 0xc9 }; + static const uint8_t snipped_cmd05_1[5] = { 0xcd, 0x20, 0xe0, 0x7e, 0xc9 }; + static const uint8_t snipped_cmd05_2[8] = { 0xc5, 0x01, 0x00, 0x00, 0x4f, 0x09, 0xc1, 0xc9 }; int i; diff --git a/src/mame/drivers/gunpey.cpp b/src/mame/drivers/gunpey.cpp index d7ccfe19747..78422ba6fb5 100644 --- a/src/mame/drivers/gunpey.cpp +++ b/src/mame/drivers/gunpey.cpp @@ -207,12 +207,12 @@ public: required_device m_maincpu; required_device m_oki; - required_shared_ptr m_wram; + required_shared_ptr m_wram; required_device m_palette; - std::unique_ptr m_blit_buffer; - UINT16 m_blit_ram[0x10]; - UINT8 m_irq_cause, m_irq_mask; + std::unique_ptr m_blit_buffer; + uint16_t m_blit_ram[0x10]; + uint8_t m_irq_cause, m_irq_mask; DECLARE_WRITE8_MEMBER(gunpey_status_w); DECLARE_READ8_MEMBER(gunpey_status_r); DECLARE_READ8_MEMBER(gunpey_inputs_r); @@ -224,18 +224,18 @@ public: DECLARE_WRITE16_MEMBER(gunpey_vregs_addr_w); DECLARE_DRIVER_INIT(gunpey); virtual void video_start() override; - UINT32 screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(gunpey_scanline); TIMER_CALLBACK_MEMBER(blitter_end); - void gunpey_irq_check(UINT8 irq_type); - UINT8 draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int count,UINT8 scene_gradient); - UINT16 m_vram_bank; - UINT16 m_vreg_addr; + void gunpey_irq_check(uint8_t irq_type); + uint8_t draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int count,uint8_t scene_gradient); + uint16_t m_vram_bank; + uint16_t m_vreg_addr; - UINT8* m_blit_rom; - UINT8* m_blit_rom2; + uint8_t* m_blit_rom; + uint8_t* m_blit_rom2; - UINT8* m_vram; + uint8_t* m_vram; // work variables for the decompression int m_srcx; @@ -243,7 +243,7 @@ public: int m_scrxcount; int m_srcy; int m_srcycount; - UINT8 m_sourcewide; + uint8_t m_sourcewide; int m_ysize; int m_xsize; int m_dstx; @@ -254,24 +254,24 @@ public: bool m_out_of_data; int m_latched_bits_left; - UINT8 m_latched_byte; + uint8_t m_latched_byte; int m_zero_bit_count; void get_stream_next_byte(void); int get_stream_bit(void); - UINT32 gunpey_state_get_stream_bits(int bits); + uint32_t gunpey_state_get_stream_bits(int bits); - int write_dest_byte(UINT8 usedata); - //UINT16 main_m_vram[0x800][0x800]; + int write_dest_byte(uint8_t usedata); + //uint16_t main_m_vram[0x800][0x800]; }; void gunpey_state::video_start() { - m_blit_buffer = std::make_unique(512*512); + m_blit_buffer = std::make_unique(512*512); } -UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int count,UINT8 scene_gradient) +uint8_t gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int count,uint8_t scene_gradient) { int x,y; int bpp_sel; @@ -306,23 +306,23 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int { x = (m_wram[count+3] >> 8) | ((m_wram[count+4] & 0x03) << 8); y = (m_wram[count+4] >> 8) | ((m_wram[count+4] & 0x30) << 4); - UINT8 zoomheight = (m_wram[count+5] >> 8); - UINT8 zoomwidth = (m_wram[count+5] & 0xff); + uint8_t zoomheight = (m_wram[count+5] >> 8); + uint8_t zoomwidth = (m_wram[count+5] & 0xff); bpp_sel = (m_wram[count+0] & 0x18); color = (m_wram[count+0] >> 8); x-=0x160; y-=0x188; - UINT8 sourcewidth = (m_wram[count+6] & 0xff); - UINT8 sourceheight = (m_wram[count+7] >> 8); + uint8_t sourcewidth = (m_wram[count+6] & 0xff); + uint8_t sourceheight = (m_wram[count+7] >> 8); int xsource = ((m_wram[count+2] & 0x003f) << 5) | ((m_wram[count+1] & 0xf800) >> 11); int ysource = ((m_wram[count+3] & 0x001f) << 6) | ((m_wram[count+2] & 0xfc00) >> 10); int alpha = m_wram[count+1] & 0x1f; - UINT16 unused; + uint16_t unused; if (debug) printf("sprite %04x %04x %04x %04x %04x %04x %04x %04x\n", m_wram[count+0], m_wram[count+1], m_wram[count+2], m_wram[count+3], m_wram[count+4], m_wram[count+5], m_wram[count+6], m_wram[count+7]); unused = m_wram[count+0]&~0xff98; if (unused) printf("unused bits set in word 0 - %04x\n", unused); @@ -345,10 +345,10 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int { for(int xi=0;xi> 10)&0x1f)*alpha; int base_g = ((basecolor >> 5)&0x1f)*alpha; int base_b = ((basecolor >> 0)&0x1f)*alpha; @@ -430,7 +430,7 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int } else { - UINT16 basecolor = bitmap.pix16(y+yi, x+1+(xi*2)); + uint16_t basecolor = bitmap.pix16(y+yi, x+1+(xi*2)); int base_r = ((basecolor >> 10)&0x1f)*alpha; int base_g = ((basecolor >> 5)&0x1f)*alpha; int base_b = ((basecolor >> 0)&0x1f)*alpha; @@ -458,10 +458,10 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int { for(int xi=0;xi> 10)&0x1f)*alpha; int base_g = ((basecolor >> 5)&0x1f)*alpha; int base_b = ((basecolor >> 0)&0x1f)*alpha; @@ -545,12 +545,12 @@ UINT8 gunpey_state::draw_gfx(bitmap_ind16 &bitmap,const rectangle &cliprect,int return m_wram[count+0] & 0x80; } -UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - //UINT16 *blit_buffer = m_blit_buffer; - UINT16 vram_bank = m_vram_bank & 0x7fff; - UINT16 vreg_addr = m_vreg_addr & 0x7fff; - UINT8 end_mark; + //uint16_t *blit_buffer = m_blit_buffer; + uint16_t vram_bank = m_vram_bank & 0x7fff; + uint16_t vreg_addr = m_vreg_addr & 0x7fff; + uint8_t end_mark; int count; int scene_index; @@ -561,11 +561,11 @@ UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &b for(scene_index = vreg_addr/2;scene_index<(vreg_addr+0x400)/2;scene_index+=0x10/2) { - UINT16 start_offs; - UINT16 end_offs; - UINT8 scene_end_mark; - UINT8 scene_enabled; - UINT8 scene_gradient; + uint16_t start_offs; + uint16_t end_offs; + uint8_t scene_end_mark; + uint8_t scene_enabled; + uint8_t scene_gradient; start_offs = (vram_bank+(m_wram[scene_index+5] << 8))/2; end_offs = (vram_bank+(m_wram[scene_index+5] << 8)+0x1000)/2; //safety check @@ -594,7 +594,7 @@ UINT32 gunpey_state::screen_update_gunpey(screen_device &screen, bitmap_ind16 &b return 0; } -void gunpey_state::gunpey_irq_check(UINT8 irq_type) +void gunpey_state::gunpey_irq_check(uint8_t irq_type) { m_irq_cause |= irq_type; @@ -684,9 +684,9 @@ int gunpey_state::get_stream_bit(void) return bit; } -UINT32 gunpey_state::gunpey_state_get_stream_bits(int bits) +uint32_t gunpey_state::gunpey_state_get_stream_bits(int bits) { - UINT32 output = 0; + uint32_t output = 0; for (int i=0;ibase(); + uint8_t *rombase = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x4000); diff --git a/src/mame/drivers/h19.cpp b/src/mame/drivers/h19.cpp index 8a5c968021d..cd908ddda2b 100644 --- a/src/mame/drivers/h19.cpp +++ b/src/mame/drivers/h19.cpp @@ -75,10 +75,10 @@ public: DECLARE_WRITE8_MEMBER(h19_c0_w); DECLARE_WRITE8_MEMBER(h19_kbd_put); MC6845_UPDATE_ROW(crtc_update_row); - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_device m_palette; - UINT8 *m_p_chargen; - UINT8 m_term_data; + uint8_t *m_p_chargen; + uint8_t m_term_data; virtual void machine_reset() override; virtual void video_start() override; @@ -102,7 +102,7 @@ void h19_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo READ8_MEMBER( h19_state::h19_80_r ) { // keyboard data - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -121,7 +121,7 @@ WRITE8_MEMBER( h19_state::h19_c0_w ) offset 00-1F = keyclick offset 20-3F = terminal bell */ - UINT8 length = (offset & 0x20) ? 200 : 4; + uint8_t length = (offset & 0x20) ? 200 : 4; m_beep->set_state(1); timer_set(attotime::from_msec(length), TIMER_BEEP_OFF); } @@ -324,13 +324,13 @@ void h19_state::video_start() MC6845_UPDATE_ROW( h19_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { - UINT8 inv=0; + uint8_t inv=0; if (x == cursor_x) inv=0xff; mem = (ma + x) & 0x7ff; chr = m_p_videoram[mem]; diff --git a/src/mame/drivers/h8.cpp b/src/mame/drivers/h8.cpp index f3fa1e15cbc..709363ed144 100644 --- a/src/mame/drivers/h8.cpp +++ b/src/mame/drivers/h8.cpp @@ -78,11 +78,11 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(h8_c); TIMER_DEVICE_CALLBACK_MEMBER(h8_p); private: - UINT8 m_digit; - UINT8 m_segment; - UINT8 m_irq_ctl; + uint8_t m_digit; + uint8_t m_segment; + uint8_t m_irq_ctl; bool m_ff_b; - UINT8 m_cass_data[4]; + uint8_t m_cass_data[4]; bool m_cass_state; bool m_cassold; virtual void machine_reset() override; @@ -112,7 +112,7 @@ READ8_MEMBER( h8_state::portf0_r ) // - if 0 and RTM pressed, causes int10 // - if 0 and RST pressed, resets cpu - UINT8 i,keyin,data = 0xff; + uint8_t i,keyin,data = 0xff; keyin = ioport("X0")->read(); if (keyin != 0xff) @@ -294,7 +294,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(h8_state::h8_p) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { diff --git a/src/mame/drivers/h89.cpp b/src/mame/drivers/h89.cpp index 4e50ebdae18..4431a1a4e99 100644 --- a/src/mame/drivers/h89.cpp +++ b/src/mame/drivers/h89.cpp @@ -38,7 +38,7 @@ public: DECLARE_WRITE8_MEMBER( port_f2_w ); - UINT8 m_port_f2; + uint8_t m_port_f2; virtual void machine_reset() override; TIMER_DEVICE_CALLBACK_MEMBER(h89_irq_timer); }; diff --git a/src/mame/drivers/halleys.cpp b/src/mame/drivers/halleys.cpp index 77ed4220bc6..f94c9616cbd 100644 --- a/src/mame/drivers/halleys.cpp +++ b/src/mame/drivers/halleys.cpp @@ -220,21 +220,21 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - UINT16 *m_render_layer[MAX_LAYERS]; - UINT8 m_sound_fifo[MAX_SOUNDS]; - UINT8 *m_gfx_plane02; - UINT8 *m_gfx_plane13; - std::unique_ptr m_collision_list; - UINT8 *m_scrolly0; - UINT8 *m_scrollx0; - UINT8 *m_scrolly1; - UINT8 *m_scrollx1; - std::unique_ptr m_internal_palette; - std::unique_ptr m_alpha_table; - UINT8 *m_cpu1_base; - std::unique_ptr m_gfx1_base; - required_shared_ptr m_blitter_ram; - required_shared_ptr m_io_ram; + uint16_t *m_render_layer[MAX_LAYERS]; + uint8_t m_sound_fifo[MAX_SOUNDS]; + uint8_t *m_gfx_plane02; + uint8_t *m_gfx_plane13; + std::unique_ptr m_collision_list; + uint8_t *m_scrolly0; + uint8_t *m_scrollx0; + uint8_t *m_scrolly1; + uint8_t *m_scrollx1; + std::unique_ptr m_internal_palette; + std::unique_ptr m_alpha_table; + uint8_t *m_cpu1_base; + std::unique_ptr m_gfx1_base; + required_shared_ptr m_blitter_ram; + required_shared_ptr m_io_ram; int m_game_id; int m_blitter_busy; int m_collision_count; @@ -249,7 +249,7 @@ public: emu_timer *m_blitter_reset_timer; offs_t m_collision_detection; int m_latch_delay; - std::vector m_paletteram; + std::vector m_paletteram; DECLARE_WRITE8_MEMBER(bgtile_w); DECLARE_READ8_MEMBER(blitter_status_r); @@ -271,16 +271,16 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(halleys); - UINT32 screen_update_halleys(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_benberob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_halleys(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_benberob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(blitter_reset); TIMER_DEVICE_CALLBACK_MEMBER(halleys_scanline); TIMER_DEVICE_CALLBACK_MEMBER(benberob_scanline); - void halleys_decode_rgb(UINT32 *r, UINT32 *g, UINT32 *b, int addr, int data); - void copy_scroll_op(bitmap_ind16 &bitmap, UINT16 *source, int sx, int sy); - void copy_scroll_xp(bitmap_ind16 &bitmap, UINT16 *source, int sx, int sy); - void copy_fixed_xp(bitmap_ind16 &bitmap, UINT16 *source); - void copy_fixed_2b(bitmap_ind16 &bitmap, UINT16 *source); + void halleys_decode_rgb(uint32_t *r, uint32_t *g, uint32_t *b, int addr, int data); + void copy_scroll_op(bitmap_ind16 &bitmap, uint16_t *source, int sx, int sy); + void copy_scroll_xp(bitmap_ind16 &bitmap, uint16_t *source, int sx, int sy); + void copy_fixed_xp(bitmap_ind16 &bitmap, uint16_t *source); + void copy_fixed_2b(bitmap_ind16 &bitmap, uint16_t *source); void filter_bitmap(bitmap_ind16 &bitmap, int mask); void init_common(); required_device m_maincpu; @@ -361,21 +361,21 @@ void halleys_state::blit(int offset) #define XMASK (SCREEN_WIDTH-1) #define YMASK (SCREEN_HEIGHT-1) - static const UINT8 penxlat[16]={0x03,0x07,0x0b,0x0f,0x02,0x06,0x0a,0x0e,0x01,0x05,0x09,0x0d,0x00,0x04,0x08,0x0c}; - static const UINT8 rgbmask[16]={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xff}; - static const UINT8 tyremap[ 8]={ 0, 5, 9,13,16,20,24,28}; + static const uint8_t penxlat[16]={0x03,0x07,0x0b,0x0f,0x02,0x06,0x0a,0x0e,0x01,0x05,0x09,0x0d,0x00,0x04,0x08,0x0c}; + static const uint8_t rgbmask[16]={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xff}; + static const uint8_t tyremap[ 8]={ 0, 5, 9,13,16,20,24,28}; - UINT8 *param, *src_base; - UINT16 *dst_base; + uint8_t *param, *src_base; + uint16_t *dst_base; int stptr, mode, color, code, y, x, h, w, src1, src2; int status, flags, group, command, bank, layer, pen0, pen1; int yclip, xclip, src_yskip, src_xskip, dst_skip, hclip, wclip, src_dy, src_dx; - UINT32 *pal_ptr; - UINT8 *src1_ptr, *src2_ptr; // esi alias, ebx alias - UINT16 *dst_ptr; // edi alias + uint32_t *pal_ptr; + uint8_t *src1_ptr, *src2_ptr; // esi alias, ebx alias + uint16_t *dst_ptr; // edi alias void *edi; // scratch int eax, ebx, ecx, edx; // scratch - UINT16 ax; UINT8 al, ah; // partial regs + uint16_t ax; uint8_t al, ah; // partial regs param = m_blitter_ram + offset; @@ -493,7 +493,7 @@ if (0) { if (src1 == src2) { flags |= SINGLE_PEN; - eax = (UINT32)penxlat[color & PENCOLOR]; + eax = (uint32_t)penxlat[color & PENCOLOR]; if (eax) pen1 = pen0 + eax; } else if (color & PENCOLOR) flags |= RGB_MASK; @@ -505,7 +505,7 @@ if (0) { eax = wclip<<1; \ ecx = hclip; \ edi = dst_ptr; \ - do { memset((UINT8*)edi, 0, eax); edi = (UINT8*)edi + SCREEN_BYTEWIDTH; } while (--ecx); \ + do { memset((uint8_t*)edi, 0, eax); edi = (uint8_t*)edi + SCREEN_BYTEWIDTH; } while (--ecx); \ } //-------------------------------------------------------------------------- @@ -521,7 +521,7 @@ if (0) { if (!(flags & PPCD_ON)) { - al = ah = (UINT8)pen0; + al = ah = (uint8_t)pen0; if (!(flags & BACKMODE)) { @@ -531,7 +531,7 @@ if (0) { src1_ptr += edx; al |= *src2_ptr; src2_ptr += edx; - if (al & 0xf) { dst_ptr[ecx] = (UINT16)al; al = ah;} + if (al & 0xf) { dst_ptr[ecx] = (uint16_t)al; al = ah;} } while (++ecx); ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH; @@ -546,7 +546,7 @@ if (0) { src1_ptr += edx; al |= *src2_ptr; src2_ptr += edx; - if (al & 0xf) { dst_ptr[ecx] = (UINT16)al | SP_2BACK; al = ah; } + if (al & 0xf) { dst_ptr[ecx] = (uint16_t)al | SP_2BACK; al = ah; } } while (++ecx); ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH; @@ -564,7 +564,7 @@ if (0) { src1_ptr += edx; al |= *src2_ptr; src2_ptr += edx; - if (al & 0xf) { dst_ptr[ecx] = (UINT16)al | SP_COLLD; } // set collision flag on group one pixels + if (al & 0xf) { dst_ptr[ecx] = (uint16_t)al | SP_COLLD; } // set collision flag on group one pixels } while (++ecx); ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH; @@ -579,7 +579,7 @@ if (0) { src1_ptr += edx; al |= *src2_ptr; src2_ptr += edx; - if (al & 0xf) { ax |= dst_ptr[ecx]; dst_ptr[ecx] = (UINT16)al; } // combine collision flags in ax + if (al & 0xf) { ax |= dst_ptr[ecx]; dst_ptr[ecx] = (uint16_t)al; } // combine collision flags in ax } while (++ecx); ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH; @@ -607,7 +607,7 @@ if (0) { if (!(flags & IGNORE_0)) BLOCK_WIPE_COMMON dst_ptr += wclip; ecx = wclip = -wclip; - al = ah = (UINT8)pen0; + al = ah = (uint8_t)pen0; ebx = rgbmask[color & PENCOLOR] | 0xffffff00; do { @@ -616,7 +616,7 @@ if (0) { src1_ptr += src_dx; al |= *src2_ptr; src2_ptr += src_dx; - if (al & 0xf) { edx = (UINT32)al; al = ah; dst_ptr[ecx] = pal_ptr[edx] & ebx; } + if (al & 0xf) { edx = (uint32_t)al; al = ah; dst_ptr[ecx] = pal_ptr[edx] & ebx; } } while (++ecx); ecx = wclip; src1_ptr += src_dy; src2_ptr += src_dy; dst_ptr += SCREEN_WIDTH; @@ -634,7 +634,7 @@ if (0) { ebx = hclip; ecx = wclip = -wclip; edx = src_dx; - ax = (UINT16)pen1; + ax = (uint16_t)pen1; do { do { @@ -802,12 +802,12 @@ if (0) { for (yclip=y+h; y 0) { ecx = edx; - dst_ptr = (UINT16*)edi; + dst_ptr = (uint16_t*)edi; WARP_LINE_COMMON ecx = SCREEN_WIDTH - xclip; } else ecx = w; - dst_ptr = (UINT16*)edi + xclip; + dst_ptr = (uint16_t*)edi + xclip; WARP_LINE_COMMON } - edi = src1_ptr; src1_ptr = src2_ptr; src2_ptr = (UINT8*)edi; + edi = src1_ptr; src1_ptr = src2_ptr; src2_ptr = (uint8_t*)edi; } #undef WARP_LINE_COMMON @@ -1010,8 +1010,8 @@ if (0) { WRITE8_MEMBER(halleys_state::bgtile_w) { int yskip, xskip, ecx; - UINT16 *edi; - UINT16 ax; + uint16_t *edi; + uint16_t ax; m_cpu1_base[0x1f00+offset] = data; offset -= 0x18; @@ -1026,7 +1026,7 @@ WRITE8_MEMBER(halleys_state::bgtile_w) edi = m_render_layer[2] + (yskip<(PALETTE_SIZE); - UINT32 *pal_ptr = m_internal_palette.get(); + m_internal_palette = std::make_unique(PALETTE_SIZE); + uint32_t *pal_ptr = m_internal_palette.get(); for (count=0; count<1024; count++) { @@ -1168,7 +1168,7 @@ PALETTE_INIT_MEMBER(halleys_state, halleys) } } -void halleys_state::halleys_decode_rgb(UINT32 *r, UINT32 *g, UINT32 *b, int addr, int data) +void halleys_state::halleys_decode_rgb(uint32_t *r, uint32_t *g, uint32_t *b, int addr, int data) { /* proms contain: @@ -1176,8 +1176,8 @@ void halleys_state::halleys_decode_rgb(UINT32 *r, UINT32 *g, UINT32 *b, int addr 00 00 00 00 01 61 29 26 0b f5 e2 17 57 fb cf f7 */ int latch1_273, latch2_273; - UINT8 *sram_189; - UINT8 *prom_6330; + uint8_t *sram_189; + uint8_t *prom_6330; int bit0, bit1, bit2, bit3, bit4; @@ -1220,11 +1220,11 @@ READ8_MEMBER(halleys_state::paletteram_r) WRITE8_MEMBER(halleys_state::paletteram_w) { - UINT32 d, r, g, b, i, j; - UINT32 *pal_ptr = m_internal_palette.get(); + uint32_t d, r, g, b, i, j; + uint32_t *pal_ptr = m_internal_palette.get(); m_paletteram[offset] = data; - d = (UINT32)data; + d = (uint32_t)data; j = d | BG_RGB; pal_ptr[offset] = j; pal_ptr[offset+SP_2BACK] = j; @@ -1281,7 +1281,7 @@ void halleys_state::video_start() } -void halleys_state::copy_scroll_op(bitmap_ind16 &bitmap, UINT16 *source, int sx, int sy) +void halleys_state::copy_scroll_op(bitmap_ind16 &bitmap, uint16_t *source, int sx, int sy) { sx = -sx & 0xff; sy = -sy & 0xff; @@ -1294,11 +1294,11 @@ void halleys_state::copy_scroll_op(bitmap_ind16 &bitmap, UINT16 *source, int sx, if (bch < 0) bch = 0; - const UINT16 *src = source + CLIP_SKIP + sy * SCREEN_WIDTH; + const uint16_t *src = source + CLIP_SKIP + sy * SCREEN_WIDTH; // draw top split for (int y=0; y != bch; y++) { - UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); + uint16_t *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); memcpy(dest, src+sx, 2*rcw); memcpy(dest + rcw, src, 2*(CLIP_W - rcw)); src += SCREEN_WIDTH; @@ -1308,7 +1308,7 @@ void halleys_state::copy_scroll_op(bitmap_ind16 &bitmap, UINT16 *source, int sx, // draw bottom split for (int y = bch; y != CLIP_H; y++) { - UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); + uint16_t *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); memcpy(dest, src+sx, 2*rcw); memcpy(dest + rcw, src, 2*(CLIP_W - rcw)); src += SCREEN_WIDTH; @@ -1316,7 +1316,7 @@ void halleys_state::copy_scroll_op(bitmap_ind16 &bitmap, UINT16 *source, int sx, } -void halleys_state::copy_scroll_xp(bitmap_ind16 &bitmap, UINT16 *source, int sx, int sy) +void halleys_state::copy_scroll_xp(bitmap_ind16 &bitmap, uint16_t *source, int sx, int sy) { sx = -sx & 0xff; sy = -sy & 0xff; @@ -1329,14 +1329,14 @@ void halleys_state::copy_scroll_xp(bitmap_ind16 &bitmap, UINT16 *source, int sx, if (bch < 0) bch = 0; - const UINT16 *src_base = source + CLIP_SKIP + sy * SCREEN_WIDTH; + const uint16_t *src_base = source + CLIP_SKIP + sy * SCREEN_WIDTH; // draw top split for (int y=0; y != bch; y++) { - UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); - const UINT16 *src = src_base + sx; + uint16_t *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); + const uint16_t *src = src_base + sx; for(int x=0; x != rcw; x++) { - UINT16 pixel = *src++; + uint16_t pixel = *src++; if(pixel) *dest = pixel; dest++; @@ -1345,7 +1345,7 @@ void halleys_state::copy_scroll_xp(bitmap_ind16 &bitmap, UINT16 *source, int sx, src = src_base; for(int x=rcw; x != CLIP_W; x++) { - UINT16 pixel = *src++; + uint16_t pixel = *src++; if(pixel) *dest = pixel; dest++; @@ -1358,10 +1358,10 @@ void halleys_state::copy_scroll_xp(bitmap_ind16 &bitmap, UINT16 *source, int sx, // draw bottom split for (int y = bch; y != CLIP_H; y++) { - UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); - const UINT16 *src = src_base + sx; + uint16_t *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); + const uint16_t *src = src_base + sx; for(int x=0; x != rcw; x++) { - UINT16 pixel = *src++; + uint16_t pixel = *src++; if(pixel) *dest = pixel; dest++; @@ -1370,7 +1370,7 @@ void halleys_state::copy_scroll_xp(bitmap_ind16 &bitmap, UINT16 *source, int sx, src = src_base; for(int x=rcw; x != CLIP_W; x++) { - UINT16 pixel = *src++; + uint16_t pixel = *src++; if(pixel) *dest = pixel; dest++; @@ -1382,13 +1382,13 @@ void halleys_state::copy_scroll_xp(bitmap_ind16 &bitmap, UINT16 *source, int sx, -void halleys_state::copy_fixed_xp(bitmap_ind16 &bitmap, UINT16 *source) +void halleys_state::copy_fixed_xp(bitmap_ind16 &bitmap, uint16_t *source) { - UINT16 *src = source + CLIP_SKIP; + uint16_t *src = source + CLIP_SKIP; for(int y=0; y != CLIP_H; y++) { - UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); + uint16_t *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); for(int x=0; x != CLIP_W; x++) { - UINT16 pixel = src[x]; + uint16_t pixel = src[x]; if (pixel) dest[x] = pixel; @@ -1398,13 +1398,13 @@ void halleys_state::copy_fixed_xp(bitmap_ind16 &bitmap, UINT16 *source) } } -void halleys_state::copy_fixed_2b(bitmap_ind16 &bitmap, UINT16 *source) +void halleys_state::copy_fixed_2b(bitmap_ind16 &bitmap, uint16_t *source) { - UINT16 *src = source + CLIP_SKIP; + uint16_t *src = source + CLIP_SKIP; for(int y=0; y != CLIP_H; y++) { - UINT16 *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); + uint16_t *dest = &bitmap.pix16(VIS_MINY + y, VIS_MINX); for(int x=0; x != CLIP_W; x++) { - UINT16 pixel = src[x]; + uint16_t pixel = src[x]; if ((pixel && !(pixel & SP_2BACK)) || !dest[x]) dest[x] = pixel; @@ -1419,12 +1419,12 @@ void halleys_state::filter_bitmap(bitmap_ind16 &bitmap, int mask) return; int dst_pitch; - UINT32 *pal_ptr, *edi; + uint32_t *pal_ptr, *edi; int esi, eax, ebx, ecx, edx; pal_ptr = m_internal_palette.get(); esi = mask | 0xffffff00; - edi = (UINT32*)&bitmap.pix16(VIS_MINY, VIS_MINX + CLIP_W); + edi = (uint32_t*)&bitmap.pix16(VIS_MINY, VIS_MINX + CLIP_W); dst_pitch = bitmap.rowpixels() >> 1; ecx = -(CLIP_W>>1); edx = CLIP_H; @@ -1455,7 +1455,7 @@ void halleys_state::filter_bitmap(bitmap_ind16 &bitmap, int mask) } -UINT32 halleys_state::screen_update_halleys(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t halleys_state::screen_update_halleys(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, j; @@ -1483,7 +1483,7 @@ UINT32 halleys_state::screen_update_halleys(screen_device &screen, bitmap_ind16 } -UINT32 halleys_state::screen_update_benberob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t halleys_state::screen_update_benberob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_io_ram[0xa0] & 0x80) copy_scroll_op(bitmap, m_render_layer[2], *m_scrollx1, *m_scrolly1); @@ -2115,32 +2115,32 @@ ROM_END void halleys_state::init_common() { - UINT8 *buf, *rom; + uint8_t *buf, *rom; int addr, i; - UINT8 al, ah, dl, dh; + uint8_t al, ah, dl, dh; // allocate memory for unpacked graphics - buf = auto_alloc_array(machine(), UINT8, 0x100000); + buf = auto_alloc_array(machine(), uint8_t, 0x100000); m_gfx_plane02 = buf; m_gfx_plane13 = buf + 0x80000; // allocate memory for render layers - buf = auto_alloc_array(machine(), UINT8, SCREEN_BYTESIZE * MAX_LAYERS); - for (i=0; i(0x20000); + m_gfx1_base = std::make_unique(0x20000); // allocate memory for alpha table - m_alpha_table = std::make_unique(0x10000); + m_alpha_table = std::make_unique(0x10000); // allocate memory for hardware collision list - m_collision_list = std::make_unique(MAX_SPRITES); + m_collision_list = std::make_unique(MAX_SPRITES); // decrypt main program ROM diff --git a/src/mame/drivers/hanaawas.cpp b/src/mame/drivers/hanaawas.cpp index 843ad3bd9e6..b28780746b3 100644 --- a/src/mame/drivers/hanaawas.cpp +++ b/src/mame/drivers/hanaawas.cpp @@ -35,7 +35,7 @@ READ8_MEMBER(hanaawas_state::hanaawas_input_port_0_r) { int i, ordinal = 0; - UINT16 buttons = 0; + uint16_t buttons = 0; switch (m_mux) { diff --git a/src/mame/drivers/hankin.cpp b/src/mame/drivers/hankin.cpp index 8d99c6de57e..e19031b9898 100644 --- a/src/mame/drivers/hankin.cpp +++ b/src/mame/drivers/hankin.cpp @@ -63,21 +63,21 @@ public: private: bool m_timer_x; bool m_timer_sb; - UINT8 m_timer_s[3]; - UINT8 m_vol; - UINT8 m_ic2a; - UINT8 m_ic2b; - UINT8 m_ic10a; - UINT8 m_ic10b; - UINT8 m_ic11a; + uint8_t m_timer_s[3]; + uint8_t m_vol; + uint8_t m_ic2a; + uint8_t m_ic2b; + uint8_t m_ic10a; + uint8_t m_ic10b; + uint8_t m_ic11a; bool m_ic11_ca2; bool m_ic10_cb2; bool m_ic2_ca2; bool m_ic2_cb2; - UINT8 m_counter; - UINT8 m_digit; - UINT8 m_segment[5]; - UINT8 *m_p_prom; + uint8_t m_counter; + uint8_t m_digit; + uint8_t m_segment[5]; + uint8_t *m_p_prom; virtual void machine_reset() override; required_device m_maincpu; required_device m_audiocpu; @@ -273,8 +273,8 @@ WRITE8_MEMBER( hankin_state::ic10_a_w ) // use is to place the '1' digit in the centre segments. if (BIT(data, 0) && (m_counter > 8)) { - static const UINT8 patterns[16] = { 0x3f,0x80,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 with '1' adjusted - UINT16 i, seg1, seg2; + static const uint8_t patterns[16] = { 0x3f,0x80,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 with '1' adjusted + uint16_t i, seg1, seg2; for (i = 0; i < 5; i++) { seg1 = patterns[m_segment[i]]; @@ -353,7 +353,7 @@ WRITE8_MEMBER( hankin_state::ic11_a_w ) READ8_MEMBER( hankin_state::ic11_b_r ) { - UINT8 data = 0; + uint8_t data = 0; if (BIT(m_ic11a, 0)) data |= m_io_x0->read(); diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp index 224e9b83062..3edf8bfde49 100644 --- a/src/mame/drivers/harddriv.cpp +++ b/src/mame/drivers/harddriv.cpp @@ -339,7 +339,7 @@ Notes: const device_type HARDDRIV_DEVICE = &device_creator; -harddriv_state::harddriv_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +harddriv_state::harddriv_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, HARDDRIV_DEVICE, "Hard Drivin' PCB Family", tag, owner, clock, "harddriv_pcb", __FILE__), /* device_video_interface(mconfig, *this, false), */ m_maincpu(*this, "maincpu"), @@ -1745,7 +1745,7 @@ MACHINE_CONFIG_END const device_type HARDDRIV_BOARD_DEVICE = &device_creator; -harddriv_board_device_state::harddriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +harddriv_board_device_state::harddriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : harddriv_state(mconfig, tag, owner, clock) { } @@ -1771,7 +1771,7 @@ void harddrivc_board_device_state::device_start() const device_type HARDDRIVC_BOARD_DEVICE = &device_creator; -harddrivc_board_device_state::harddrivc_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +harddrivc_board_device_state::harddrivc_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : harddriv_state(mconfig, tag, owner, clock) { } @@ -1799,7 +1799,7 @@ void racedrivb1_board_device_state::device_start() const device_type RACEDRIV_BOARD_DEVICE = &device_creator; const device_type RACEDRIVB1_BOARD_DEVICE = &device_creator; -racedriv_board_device_state::racedriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +racedriv_board_device_state::racedriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : harddriv_state(mconfig, tag, owner, clock) { } @@ -1836,7 +1836,7 @@ const device_type RACEDRIVC_BOARD_DEVICE = &device_creator; const device_type RACEDRIVC_PANORAMA_SIDE_BOARD_DEVICE = &device_creator; -racedrivc_board_device_state::racedrivc_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +racedrivc_board_device_state::racedrivc_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : harddriv_state(mconfig, tag, owner, clock) { } @@ -1862,7 +1862,7 @@ void stunrun_board_device_state::device_start() const device_type STUNRUN_BOARD_DEVICE = &device_creator; -stunrun_board_device_state::stunrun_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +stunrun_board_device_state::stunrun_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : harddriv_state(mconfig, tag, owner, clock) { } @@ -1896,7 +1896,7 @@ const device_type STEELTAL_BOARD_DEVICE = &device_creator; const device_type STEELTALP_BOARD_DEVICE = &device_creator; -steeltal_board_device_state::steeltal_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +steeltal_board_device_state::steeltal_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : harddriv_state(mconfig, tag, owner, clock) { } @@ -1916,7 +1916,7 @@ void strtdriv_board_device_state::device_start() const device_type STRTDRIV_BOARD_DEVICE = &device_creator; -strtdriv_board_device_state::strtdriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +strtdriv_board_device_state::strtdriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : harddriv_state(mconfig, tag, owner, clock) { } @@ -1943,7 +1943,7 @@ void hdrivairp_board_device_state::device_start() const device_type HDRIVAIR_BOARD_DEVICE = &device_creator; const device_type HDRIVAIRP_BOARD_DEVICE = &device_creator; -hdrivair_board_device_state::hdrivair_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +hdrivair_board_device_state::hdrivair_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : harddriv_state(mconfig, tag, owner, clock) { } @@ -4773,7 +4773,7 @@ void harddriv_state::init_ds3() /* COMMON INIT: initialize the DSK add-on board */ void harddriv_state::init_dsk() { - UINT8 *usr3 = memregion("user3")->base(); + uint8_t *usr3 = memregion("user3")->base(); /* install ASIC61 */ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x85c000, 0x85c7ff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_r), this), write16_delegate(FUNC(harddriv_state::hd68k_dsk_dsp32_w), this)); @@ -4783,7 +4783,7 @@ void harddriv_state::init_dsk() /* install extra RAM */ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x900000, 0x90ffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_r), this), write16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_w), this)); - m_dsk_ram = (UINT16 *)(usr3 + 0x40000); + m_dsk_ram = (uint16_t *)(usr3 + 0x40000); /* install extra ZRAM */ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x910000, 0x910fff, read8_delegate(FUNC(eeprom_parallel_28xx_device::read), m_dsk_10c.target()), write8_delegate(FUNC(eeprom_parallel_28xx_device::write), m_dsk_10c.target()), 0xff00); @@ -4796,14 +4796,14 @@ void harddriv_state::init_dsk() /* install extra ROM */ m_maincpu->space(AS_PROGRAM).install_read_handler(0x940000, 0x9fffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_small_rom_r), this)); - m_dsk_rom = (UINT16 *)(usr3 + 0x00000); + m_dsk_rom = (uint16_t *)(usr3 + 0x00000); } /* COMMON INIT: initialize the DSK II add-on board */ void harddriv_state::init_dsk2() { - UINT8 *usr3 = memregion("user3")->base(); + uint8_t *usr3 = memregion("user3")->base(); /* install ASIC65 */ m_maincpu->space(AS_PROGRAM).install_write_handler(0x824000, 0x824003, write16_delegate(FUNC(asic65_device::data_w), (asic65_device*)m_asic65)); @@ -4818,11 +4818,11 @@ void harddriv_state::init_dsk2() /* install extra RAM */ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x880000, 0x8bffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_r), this), write16_delegate(FUNC(harddriv_state::hd68k_dsk_ram_w), this)); - m_dsk_ram = (UINT16 *)(usr3 + 0x100000); + m_dsk_ram = (uint16_t *)(usr3 + 0x100000); /* install extra ROM */ m_maincpu->space(AS_PROGRAM).install_read_handler(0x900000, 0x9fffff, read16_delegate(FUNC(harddriv_state::hd68k_dsk_rom_r), this)); - m_dsk_rom = (UINT16 *)(usr3 + 0x000000); + m_dsk_rom = (uint16_t *)(usr3 + 0x000000); } @@ -4869,14 +4869,14 @@ void harddriv_state::init_harddriv(void) m_gsp->space(AS_PROGRAM).install_write_handler(0xfffcfc00, 0xfffcfc0f, write16_delegate(FUNC(harddriv_state::hdgsp_speedup2_w), this)); m_gsp->space(AS_PROGRAM).install_read_handler(0xfff9fc00, 0xfff9fc0f, read16_delegate(FUNC(harddriv_state::hdgsp_speedup_r), this)); m_gsp_speedup_pc = 0xffc00f10; - m_gsp_speedup_addr[0] = (UINT16 *)(m_gsp_vram + ((0xfff9fc00 - 0xff800000) >> 3)); // Addresses are in bits. Really. - m_gsp_speedup_addr[1] = (UINT16 *)(m_gsp_vram + ((0xfffcfc00 - 0xff800000) >> 3)); + m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff9fc00 - 0xff800000) >> 3)); // Addresses are in bits. Really. + m_gsp_speedup_addr[1] = (uint16_t *)(m_gsp_vram + ((0xfffcfc00 - 0xff800000) >> 3)); /* set up msp speedup handler */ m_msp->space(AS_PROGRAM).install_write_handler(0x00751b00, 0x00751b0f, write16_delegate(FUNC(harddriv_state::hdmsp_speedup_w), this)); m_msp->space(AS_PROGRAM).install_read_handler(0x00751b00, 0x00751b0f, read16_delegate(FUNC(harddriv_state::hdmsp_speedup_r), this)); m_msp_speedup_pc = 0x00723b00; - m_msp_speedup_addr = m_msp_ram + ((0x751b00 - 0x700000) >> 4); // Address in bits, plus UINT16 * + m_msp_speedup_addr = m_msp_ram + ((0x751b00 - 0x700000) >> 4); // Address in bits, plus uint16_t * /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); @@ -4895,14 +4895,14 @@ void harddriv_state::init_harddrivc(void) m_gsp->space(AS_PROGRAM).install_write_handler(0xfffcfc00, 0xfffcfc0f, write16_delegate(FUNC(harddriv_state::hdgsp_speedup2_w), this)); m_gsp->space(AS_PROGRAM).install_read_handler(0xfff9fc00, 0xfff9fc0f, read16_delegate(FUNC(harddriv_state::hdgsp_speedup_r), this)); m_gsp_speedup_pc = 0xfff40ff0; - m_gsp_speedup_addr[0] = (UINT16 *)(m_gsp_vram + ((0xfff9fc00 - 0xffc00000) >> 3)); // Addresses are in bits. Really. - m_gsp_speedup_addr[1] = (UINT16 *)(m_gsp_vram + ((0xfffcfc00 - 0xffc00000) >> 3)); + m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff9fc00 - 0xffc00000) >> 3)); // Addresses are in bits. Really. + m_gsp_speedup_addr[1] = (uint16_t *)(m_gsp_vram + ((0xfffcfc00 - 0xffc00000) >> 3)); /* set up msp speedup handler */ m_msp->space(AS_PROGRAM).install_write_handler(0x00751b00, 0x00751b0f, write16_delegate(FUNC(harddriv_state::hdmsp_speedup_w), this)); m_msp->space(AS_PROGRAM).install_read_handler(0x00751b00, 0x00751b0f, read16_delegate(FUNC(harddriv_state::hdmsp_speedup_r), this)); m_msp_speedup_pc = 0x00723b00; - m_msp_speedup_addr = m_msp_ram + ((0x751b00 - 0x700000) >> 4); // Address in bits, plus UINT16 * + m_msp_speedup_addr = m_msp_ram + ((0x751b00 - 0x700000) >> 4); // Address in bits, plus uint16_t * /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); @@ -4920,8 +4920,8 @@ void harddriv_state::init_stunrun(void) m_gsp->space(AS_PROGRAM).install_write_handler(0xfffcfc00, 0xfffcfc0f, write16_delegate(FUNC(harddriv_state::hdgsp_speedup2_w), this)); m_gsp->space(AS_PROGRAM).install_read_handler(0xfff9fc00, 0xfff9fc0f, read16_delegate(FUNC(harddriv_state::hdgsp_speedup_r), this)); m_gsp_speedup_pc = 0xfff41070; - m_gsp_speedup_addr[0] = (UINT16 *)(m_gsp_vram + ((0xfff9fc00 - 0xffc00000) >> 3)); // Addresses are in bits. Really. - m_gsp_speedup_addr[1] = (UINT16 *)(m_gsp_vram + ((0xfffcfc00 - 0xffc00000) >> 3)); + m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff9fc00 - 0xffc00000) >> 3)); // Addresses are in bits. Really. + m_gsp_speedup_addr[1] = (uint16_t *)(m_gsp_vram + ((0xfffcfc00 - 0xffc00000) >> 3)); /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); @@ -4939,7 +4939,7 @@ void harddriv_state::init_racedriv(void) /* set up the slapstic */ m_slapstic_device->slapstic_init(); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::rd68k_slapstic_r), this), write16_delegate(FUNC(harddriv_state::rd68k_slapstic_w), this)); - m_m68k_slapstic_base = (UINT16 *)(memregion("maincpu")->base() + 0xe0000); + m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000); /* synchronization */ m_dsp32->space(AS_PROGRAM).install_write_handler(0x613c00, 0x613c03, write32_delegate(FUNC(harddriv_state::rddsp32_sync0_w), this)); @@ -4964,7 +4964,7 @@ void harddriv_state::racedrivc_init_common(offs_t gsp_protection) /* set up the slapstic */ m_slapstic_device->slapstic_init(); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::rd68k_slapstic_r), this), write16_delegate(FUNC(harddriv_state::rd68k_slapstic_w), this)); - m_m68k_slapstic_base = (UINT16 *)(memregion("maincpu")->base() + 0xe0000); + m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000); /* synchronization */ m_dsp32->space(AS_PROGRAM).install_write_handler(0x613c00, 0x613c03, write32_delegate(FUNC(harddriv_state::rddsp32_sync0_w), this)); @@ -4974,13 +4974,13 @@ void harddriv_state::racedrivc_init_common(offs_t gsp_protection) /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(gsp_protection, gsp_protection + 0x0f, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), this)); - m_gsp_protection = (UINT16 *)(m_gsp_vram + ((gsp_protection - 0xffc00000) >> 3)); + m_gsp_protection = (uint16_t *)(m_gsp_vram + ((gsp_protection - 0xffc00000) >> 3)); /* set up gsp speedup handler */ m_gsp->space(AS_PROGRAM).install_write_handler(0xfff76f60, 0xfff76f6f, write16_delegate(FUNC(harddriv_state::rdgsp_speedup1_w), this)); m_gsp->space(AS_PROGRAM).install_read_handler(0xfff76f60, 0xfff76f6f, read16_delegate(FUNC(harddriv_state::rdgsp_speedup1_r), this)); m_gsp_speedup_pc = 0xfff43a00; - m_gsp_speedup_addr[0] = (UINT16 *)(m_gsp_vram + ((0xfff76f60 - 0xffc00000) >> 3)); + m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff76f60 - 0xffc00000) >> 3)); /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); @@ -4999,17 +4999,17 @@ void harddriv_state::init_racedrivc_panorama_side() /* set up the slapstic */ m_slapstic_device->slapstic_init(); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::rd68k_slapstic_r), this), write16_delegate(FUNC(harddriv_state::rd68k_slapstic_w), this)); - m_m68k_slapstic_base = (UINT16 *)(memregion("maincpu")->base() + 0xe0000); + m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000); /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(gsp_protection, gsp_protection + 0x0f, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), this)); - m_gsp_protection = (UINT16 *)(m_gsp_vram + ((gsp_protection - 0xffc00000) >> 3)); + m_gsp_protection = (uint16_t *)(m_gsp_vram + ((gsp_protection - 0xffc00000) >> 3)); /* set up gsp speedup handler (todo, work these out) */ // m_gsp->space(AS_PROGRAM).install_write_handler(0xfff76f60, 0xfff76f6f, write16_delegate(FUNC(harddriv_state::rdgsp_speedup1_w), this)); // m_gsp->space(AS_PROGRAM).install_read_handler(0xfff76f60, 0xfff76f6f, read16_delegate(FUNC(harddriv_state::rdgsp_speedup1_r), this)); // m_gsp_speedup_pc = 0xfff43a00; -// m_gsp_speedup_addr[0] = (UINT16 *)(m_gsp_vram + ((0xfff76f60 - 0xffc00000) >> 3)); +// m_gsp_speedup_addr[0] = (uint16_t *)(m_gsp_vram + ((0xfff76f60 - 0xffc00000) >> 3)); /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); @@ -5056,12 +5056,12 @@ void harddriv_state::steeltal_init_common(offs_t ds3_transfer_pc, int proto_sloo else m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::st68k_protosloop_r), this), write16_delegate(FUNC(harddriv_state::st68k_protosloop_w), this)); - m_m68k_slapstic_base = (UINT16 *)(memregion("maincpu")->base() + 0xe0000); - m_m68k_sloop_alt_base = (UINT16 *)(memregion("maincpu")->base() + 0x4e000); + m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000); + m_m68k_sloop_alt_base = (uint16_t *)(memregion("maincpu")->base() + 0x4e000); /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(0xfff965d0, 0xfff965df, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), this)); - m_gsp_protection = (UINT16 *)(m_gsp_vram + ((0xfff965d0 - 0xffc00000) >> 3)); + m_gsp_protection = (uint16_t *)(m_gsp_vram + ((0xfff965d0 - 0xffc00000) >> 3)); /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); @@ -5099,7 +5099,7 @@ void harddriv_state::init_strtdriv(void) /* set up the slapstic */ m_slapstic_device->slapstic_init(); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xe0000, 0xfffff, read16_delegate(FUNC(harddriv_state::rd68k_slapstic_r), this), write16_delegate(FUNC(harddriv_state::rd68k_slapstic_w), this)); - m_m68k_slapstic_base = (UINT16 *)(memregion("maincpu")->base() + 0xe0000); + m_m68k_slapstic_base = (uint16_t *)(memregion("maincpu")->base() + 0xe0000); m_maincpu->space(AS_PROGRAM).install_read_handler(0xa80000, 0xafffff, read16_delegate(FUNC(harddriv_state::hda68k_port1_r), this)); @@ -5111,7 +5111,7 @@ void harddriv_state::init_strtdriv(void) /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(0xfff960a0, 0xfff960af, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), this)); - m_gsp_protection = (UINT16 *)(m_gsp_vram + ((0xfff960a0 - 0xffc00000) >> 3)); + m_gsp_protection = (uint16_t *)(m_gsp_vram + ((0xfff960a0 - 0xffc00000) >> 3)); /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); @@ -5139,7 +5139,7 @@ void harddriv_state::init_hdrivair(void) /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(0xfff960a0, 0xfff960af, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), this)); - m_gsp_protection = (UINT16 *)(m_gsp_vram + ((0xfff960a0 - 0xffc00000) >> 3)); + m_gsp_protection = (uint16_t *)(m_gsp_vram + ((0xfff960a0 - 0xffc00000) >> 3)); /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); @@ -5167,7 +5167,7 @@ void harddriv_state::init_hdrivairp(void) /* set up protection hacks */ m_gsp->space(AS_PROGRAM).install_write_handler(0xfff916c0, 0xfff916cf, write16_delegate(FUNC(harddriv_state::hdgsp_protection_w), this)); - m_gsp_protection = (UINT16 *)(m_gsp_vram + ((0xfff916c0 - 0xffc00000) >> 3)); + m_gsp_protection = (uint16_t *)(m_gsp_vram + ((0xfff916c0 - 0xffc00000) >> 3)); /* set up adsp speedup handlers */ m_adsp->space(AS_DATA).install_read_handler(0x1fff, 0x1fff, read16_delegate(FUNC(harddriv_state::hdadsp_speedup_r), this)); diff --git a/src/mame/drivers/harriet.cpp b/src/mame/drivers/harriet.cpp index a589f2d51af..1ef3b96c0c2 100644 --- a/src/mame/drivers/harriet.cpp +++ b/src/mame/drivers/harriet.cpp @@ -33,10 +33,10 @@ public: required_device m_terminal; // screen updates - 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); - UINT8 m_teletype_data; - UINT8 m_teletype_status; + uint8_t m_teletype_data; + uint8_t m_teletype_status; DECLARE_READ8_MEMBER(unk_r); DECLARE_WRITE8_MEMBER(unk_w); @@ -57,7 +57,7 @@ void harriet_state::video_start() { } -UINT32 harriet_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t harriet_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } @@ -97,7 +97,7 @@ READ8_MEMBER(harriet_state::unk3_r) /* 0x314c bit 7: keyboard status */ READ8_MEMBER(harriet_state::keyboard_status_r) { - UINT8 res; + uint8_t res; res = m_teletype_status | m_teletype_data; m_teletype_status &= ~0x80; diff --git a/src/mame/drivers/hcastle.cpp b/src/mame/drivers/hcastle.cpp index 6a82dc5e833..9f69f78f072 100644 --- a/src/mame/drivers/hcastle.cpp +++ b/src/mame/drivers/hcastle.cpp @@ -164,7 +164,7 @@ WRITE8_MEMBER(hcastle_state::volume_callback) void hcastle_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 16, &ROM[0x10000], 0x2000); diff --git a/src/mame/drivers/headonb.cpp b/src/mame/drivers/headonb.cpp index 6a0ad0b53e4..0cf030d632f 100644 --- a/src/mame/drivers/headonb.cpp +++ b/src/mame/drivers/headonb.cpp @@ -44,7 +44,7 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; tilemap_t *m_tilemap; @@ -52,7 +52,7 @@ public: virtual void video_start() override; - 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); TILE_GET_INFO_MEMBER(get_tile_info); }; @@ -66,7 +66,7 @@ public: TILE_GET_INFO_MEMBER(headonb_state::get_tile_info) { - UINT8 code = m_video_ram[tile_index]; + uint8_t code = m_video_ram[tile_index]; SET_TILE_INFO_MEMBER(0, code, 0, 0); } @@ -75,7 +75,7 @@ void headonb_state::video_start() m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(headonb_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 headonb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t headonb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/hec2hrp.cpp b/src/mame/drivers/hec2hrp.cpp index ef9e3cac314..d847af779ca 100644 --- a/src/mame/drivers/hec2hrp.cpp +++ b/src/mame/drivers/hec2hrp.cpp @@ -305,7 +305,7 @@ MACHINE_RESET_MEMBER(hec2hrp_state,hec2hrp) MACHINE_START_MEMBER(hec2hrp_state,hec2hrx) /*****************************************************************************/ { - UINT8 *RAM = memregion("maincpu" )->base(); // pointer to mess ram + uint8_t *RAM = memregion("maincpu" )->base(); // pointer to mess ram //Patch rom possible ! //RAMD2[0xff6b] = 0x0ff; // force verbose mode hector ! @@ -339,7 +339,7 @@ MACHINE_START_MEMBER(hec2hrp_state,hec2mdhrx) /*****************************************************************************/ //minidisc { - UINT8 *RAM = memregion("maincpu" )->base(); // pointer to mess ram + uint8_t *RAM = memregion("maincpu" )->base(); // pointer to mess ram // Memory install for bank switching membank("bank1")->configure_entry(HECTOR_BANK_PROG , &RAM[0xc000] ); // Mess ram diff --git a/src/mame/drivers/hh_amis2k.cpp b/src/mame/drivers/hh_amis2k.cpp index 1cf99b74180..e2a9f88427a 100644 --- a/src/mame/drivers/hh_amis2k.cpp +++ b/src/mame/drivers/hh_amis2k.cpp @@ -48,14 +48,14 @@ public: required_device m_speaker; required_device m_a12_decay_timer; - UINT8 m_d; - UINT16 m_a; - UINT8 m_q2; - UINT8 m_q3; + uint8_t m_d; + uint16_t m_a; + uint8_t m_q2; + uint8_t m_q3; - UINT16 m_display_state[0x10]; - UINT16 m_display_cache[0x10]; - UINT8 m_display_decay[0x100]; + uint16_t m_display_state[0x10]; + uint16_t m_display_cache[0x10]; + uint8_t m_display_decay[0x100]; DECLARE_WRITE8_MEMBER(write_d); DECLARE_WRITE16_MEMBER(write_a); @@ -110,7 +110,7 @@ inline bool wildfire_state::index_is_7segled(int index) void wildfire_state::display_update() { - UINT16 active_state[0x10]; + uint16_t active_state[0x10]; for (int i = 0; i < 0x10; i++) { @@ -292,7 +292,7 @@ enum lG = 0x01 }; -static const UINT8 wildfire_7seg_table[0x10] = +static const uint8_t wildfire_7seg_table[0x10] = { 0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x5f, 0x70, 0x7f, 0x7b, // 0-9 unaltered 0x77, // A -> unused? diff --git a/src/mame/drivers/hh_cop400.cpp b/src/mame/drivers/hh_cop400.cpp index d6590a10c99..30b49d38ee7 100644 --- a/src/mame/drivers/hh_cop400.cpp +++ b/src/mame/drivers/hh_cop400.cpp @@ -46,30 +46,30 @@ public: optional_ioport_array<5> m_inp_matrix; // max 5 // misc common - UINT8 m_l; // MCU port L write data - UINT8 m_g; // MCU port G write data - UINT8 m_d; // MCU port D write data + uint8_t m_l; // MCU port L write data + uint8_t m_g; // MCU port G write data + uint8_t m_d; // MCU port D write data int m_so; // MCU SO line state int m_sk; // MCU SK line state - UINT16 m_inp_mux; // multiplexed inputs mask + uint16_t m_inp_mux; // multiplexed inputs mask - UINT16 read_inputs(int columns); + uint16_t read_inputs(int columns); // display common int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 31 for now) - UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) + uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + uint32_t m_display_cache[0x20]; // (internal use) + uint8_t m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); void set_display_size(int maxx, int maxy); - void set_display_segmask(UINT32 digits, UINT32 mask); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true); + void set_display_segmask(uint32_t digits, uint32_t mask); + void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true); protected: virtual void machine_start() override; @@ -129,7 +129,7 @@ void hh_cop400_state::machine_reset() void hh_cop400_state::display_update() { - UINT32 active_state[0x20]; + uint32_t active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -142,7 +142,7 @@ void hh_cop400_state::display_update() m_display_decay[y][x] = m_display_wait; // determine active state - UINT32 ds = (m_display_decay[y][x] != 0) ? 1 : 0; + uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0; active_state[y] |= (ds << x); } } @@ -197,7 +197,7 @@ void hh_cop400_state::set_display_size(int maxx, int maxy) m_display_maxy = maxy; } -void hh_cop400_state::set_display_segmask(UINT32 digits, UINT32 mask) +void hh_cop400_state::set_display_segmask(uint32_t digits, uint32_t mask) { // set a segment mask per selected digit, but leave unselected ones alone for (int i = 0; i < 0x20; i++) @@ -208,12 +208,12 @@ void hh_cop400_state::set_display_segmask(UINT32 digits, UINT32 mask) } } -void hh_cop400_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update) +void hh_cop400_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update) { set_display_size(maxx, maxy); // update current state - UINT32 mask = (1 << maxx) - 1; + uint32_t mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; @@ -224,10 +224,10 @@ void hh_cop400_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 set // generic input handlers -UINT16 hh_cop400_state::read_inputs(int columns) +uint16_t hh_cop400_state::read_inputs(int columns) { // active low - UINT16 ret = 0xffff; + uint16_t ret = 0xffff; // read selected input rows for (int i = 0; i < columns; i++) @@ -381,8 +381,8 @@ WRITE8_MEMBER(h2hbaskb_state::write_g) WRITE8_MEMBER(h2hbaskb_state::write_l) { // D2,D3 double as multiplexer - UINT16 mask = ((m_d >> 2 & 1) * 0x00ff) | ((m_d >> 3 & 1) * 0xff00); - UINT16 sel = (m_g | m_d << 4 | m_g << 8 | m_d << 12) & mask; + uint16_t mask = ((m_d >> 2 & 1) * 0x00ff) | ((m_d >> 3 & 1) * 0xff00); + uint16_t sel = (m_g | m_d << 4 | m_g << 8 | m_d << 12) & mask; // D2+G0,G1 are 7segs set_display_segmask(3, 0x7f); @@ -501,8 +501,8 @@ void einvaderc_state::prepare_display() m_display_segmask[y] = 0x7f; // update display - UINT8 l = BITSWAP8(m_l,7,6,0,1,2,3,4,5); - UINT16 grid = (m_d | m_g << 4 | m_sk << 8 | m_so << 9) ^ 0x0ff; + uint8_t l = BITSWAP8(m_l,7,6,0,1,2,3,4,5); + uint16_t grid = (m_d | m_g << 4 | m_sk << 8 | m_so << 9) ^ 0x0ff; display_matrix(8, 10, l, grid); } @@ -899,7 +899,7 @@ public: void lightfgt_state::prepare_display() { - UINT8 grid = (m_so | m_d << 1) ^ 0x1f; + uint8_t grid = (m_so | m_d << 1) ^ 0x1f; display_matrix(5, 5, m_l, grid); } diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp index 677e3be8862..af875309e7c 100644 --- a/src/mame/drivers/hh_hmcs40.cpp +++ b/src/mame/drivers/hh_hmcs40.cpp @@ -122,12 +122,12 @@ public: optional_device m_speaker; // misc common - UINT8 m_r[8]; // MCU R ports write data (optional) - UINT16 m_d; // MCU D port write data (optional) - UINT8 m_int[2]; // MCU INT0/1 pins state - UINT16 m_inp_mux; // multiplexed inputs mask + uint8_t m_r[8]; // MCU R ports write data (optional) + uint16_t m_d; // MCU D port write data (optional) + uint8_t m_int[2]; // MCU INT0/1 pins state + uint16_t m_inp_mux; // multiplexed inputs mask - UINT16 read_inputs(int columns); + uint16_t read_inputs(int columns); void refresh_interrupts(void); void set_interrupt(int line, int state); DECLARE_INPUT_CHANGED_MEMBER(single_interrupt_line); @@ -137,19 +137,19 @@ public: int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 47 for now) - UINT32 m_grid; // VFD current row data - UINT64 m_plate; // VFD current column data + uint32_t m_grid; // VFD current row data + uint64_t m_plate; // VFD current column data - UINT64 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT64 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x40]; // (internal use) + uint64_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + uint64_t m_display_cache[0x20]; // (internal use) + uint8_t m_display_decay[0x20][0x40]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); void set_display_size(int maxx, int maxy); - void set_display_segmask(UINT32 digits, UINT32 mask); - void display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety, bool update = true); + void set_display_segmask(uint32_t digits, uint32_t mask); + void display_matrix(int maxx, int maxy, uint64_t setx, uint32_t sety, bool update = true); protected: virtual void machine_start() override; @@ -210,7 +210,7 @@ void hh_hmcs40_state::machine_reset() void hh_hmcs40_state::display_update() { - UINT64 active_state[0x20]; + uint64_t active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -223,7 +223,7 @@ void hh_hmcs40_state::display_update() m_display_decay[y][x] = m_display_wait; // determine active state - UINT64 ds = (m_display_decay[y][x] != 0) ? 1 : 0; + uint64_t ds = (m_display_decay[y][x] != 0) ? 1 : 0; active_state[y] |= (ds << x); } } @@ -278,7 +278,7 @@ void hh_hmcs40_state::set_display_size(int maxx, int maxy) m_display_maxy = maxy; } -void hh_hmcs40_state::set_display_segmask(UINT32 digits, UINT32 mask) +void hh_hmcs40_state::set_display_segmask(uint32_t digits, uint32_t mask) { // set a segment mask per selected digit, but leave unselected ones alone for (int i = 0; i < 0x20; i++) @@ -289,12 +289,12 @@ void hh_hmcs40_state::set_display_segmask(UINT32 digits, UINT32 mask) } } -void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety, bool update) +void hh_hmcs40_state::display_matrix(int maxx, int maxy, uint64_t setx, uint32_t sety, bool update) { set_display_size(maxx, maxy); // update current state - UINT64 mask = (U64(1) << maxx) - 1; + uint64_t mask = (U64(1) << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (U64(1) << maxx)) : 0; @@ -305,9 +305,9 @@ void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 set // generic input handlers -UINT16 hh_hmcs40_state::read_inputs(int columns) +uint16_t hh_hmcs40_state::read_inputs(int columns) { - UINT16 ret = 0; + uint16_t ret = 0; // read selected input rows for (int i = 0; i < columns; i++) @@ -382,7 +382,7 @@ WRITE8_MEMBER(bambball_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT16 plate = BITSWAP16(m_plate,13,8,4,12,9,10,14,1,7,0,15,11,6,3,5,2); + uint16_t plate = BITSWAP16(m_plate,13,8,4,12,9,10,14,1,7,0,15,11,6,3,5,2); display_matrix(16, 9, plate, m_grid); } @@ -491,8 +491,8 @@ public: void bmboxing_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8); - UINT32 plate = BITSWAP16(m_plate,15,14,13,12,1,2,0,3,11,4,10,7,5,6,9,8); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8); + uint32_t plate = BITSWAP16(m_plate,15,14,13,12,1,2,0,3,11,4,10,7,5,6,9,8); display_matrix(12, 9, plate, grid); } @@ -630,8 +630,8 @@ public: void bfriskyt_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,0,1,2,3,4,5,6,7); - UINT32 plate = BITSWAP24(m_plate,23,22,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,0,1,2,3,4,5,6,7); + uint32_t plate = BITSWAP24(m_plate,23,22,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21); display_matrix(22, 8, plate, grid); } @@ -649,7 +649,7 @@ WRITE16_MEMBER(bfriskyt_state::grid_w) m_speaker->level_w(data >> 6 & 1); // D11-D15: input mux - UINT8 inp_mux = data >> 11 & 0x1f; + uint8_t inp_mux = data >> 11 & 0x1f; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -763,8 +763,8 @@ WRITE8_MEMBER(packmon_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,0,1,2,3,4,5,6,19,18,17,16,15,14,13,12,11,10,9,8,7); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,0,1,2,3,4,5,6,19,18,17,16,15,14,13,12,11,10,9,8,7); display_matrix(20, 10, plate, grid); } @@ -873,8 +873,8 @@ public: void msthawk_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); - UINT32 plate = BITSWAP24(m_plate,23,22,21,19,20,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); + uint32_t plate = BITSWAP24(m_plate,23,22,21,19,20,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); display_matrix(21, 10, plate, grid); } @@ -892,7 +892,7 @@ WRITE16_MEMBER(msthawk_state::grid_w) m_speaker->level_w(data >> 5 & 1); // D10-D15: input mux - UINT8 inp_mux = data >> 10 & 0x3f; + uint8_t inp_mux = data >> 10 & 0x3f; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -1006,8 +1006,8 @@ WRITE8_MEMBER(bzaxxon_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,6,7,8,9,10,5,4,3,2,1,0); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,5,7,0,1,2,3,4,6,19,16,17,18,15,14,13,12,10,8,9,11) | 0x800; + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,6,7,8,9,10,5,4,3,2,1,0); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,5,7,0,1,2,3,4,6,19,16,17,18,15,14,13,12,10,8,9,11) | 0x800; display_matrix(20, 11, plate, grid); } @@ -1017,7 +1017,7 @@ WRITE16_MEMBER(bzaxxon_state::grid_w) m_speaker->level_w(data >> 4 & 1); // D7-D10: input mux - UINT8 inp_mux = data >> 7 & 0xf; + uint8_t inp_mux = data >> 7 & 0xf; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -1127,8 +1127,8 @@ WRITE8_MEMBER(zackman_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); - UINT32 plate = BITSWAP32(m_plate,31,30,27,0,1,2,3,4,5,6,7,8,9,10,11,24,25,26,29,28,23,22,21,20,19,18,17,16,15,14,13,12); + uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); + uint32_t plate = BITSWAP32(m_plate,31,30,27,0,1,2,3,4,5,6,7,8,9,10,11,24,25,26,29,28,23,22,21,20,19,18,17,16,15,14,13,12); display_matrix(29, 8, plate, grid); } @@ -1138,7 +1138,7 @@ WRITE16_MEMBER(zackman_state::grid_w) m_speaker->level_w(data >> 2 & 1); // D11-D14: input mux - UINT8 inp_mux = data >> 11 & 0xf; + uint8_t inp_mux = data >> 11 & 0xf; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -1243,8 +1243,8 @@ public: void bpengo_state::prepare_display() { - UINT8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); - UINT32 plate = BITSWAP32(m_plate,31,30,29,28,23,22,21,16,17,18,19,20,27,26,25,24,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); + uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); + uint32_t plate = BITSWAP32(m_plate,31,30,29,28,23,22,21,16,17,18,19,20,27,26,25,24,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); display_matrix(25, 8, plate, grid); } @@ -1262,7 +1262,7 @@ WRITE16_MEMBER(bpengo_state::grid_w) m_speaker->level_w(data >> 10 & 1); // D12-D15: input mux - UINT8 inp_mux = data >> 12 & 0xf; + uint8_t inp_mux = data >> 12 & 0xf; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -1372,8 +1372,8 @@ public: void bbtime_state::prepare_display() { - UINT8 grid = BITSWAP8(m_grid,7,6,0,1,2,3,4,5); - UINT32 plate = BITSWAP32(m_plate,31,30,29,28,25,24,26,27,22,23,15,14,12,11,10,8,7,6,4,1,5,9,13,3,2,16,17,18,19,20,0,21) | 0x1; + uint8_t grid = BITSWAP8(m_grid,7,6,0,1,2,3,4,5); + uint32_t plate = BITSWAP32(m_plate,31,30,29,28,25,24,26,27,22,23,15,14,12,11,10,8,7,6,4,1,5,9,13,3,2,16,17,18,19,20,0,21) | 0x1; display_matrix(28, 6, plate, grid); } @@ -1391,7 +1391,7 @@ WRITE16_MEMBER(bbtime_state::grid_w) m_speaker->level_w(data >> 3 & 1); // D10-D14: input mux - UINT8 inp_mux = data >> 10 & 0x1f; + uint8_t inp_mux = data >> 10 & 0x1f; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -1498,8 +1498,8 @@ WRITE8_MEMBER(bdoramon_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,7,6); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,11,19,18,17,16,15,14,13,12,10,9,8,7,6,5,4,3,2,1,0); + uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,7,6); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,11,19,18,17,16,15,14,13,12,10,9,8,7,6,5,4,3,2,1,0); display_matrix(19, 8, plate, grid); } @@ -1597,8 +1597,8 @@ WRITE8_MEMBER(bultrman_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,0,18,17,16,15,14,13,12,3,11,10,9,8,7,6,5,4,1,2); + uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,0,18,17,16,15,14,13,12,3,11,10,9,8,7,6,5,4,1,2); display_matrix(18, 8, plate, grid); } @@ -1684,7 +1684,7 @@ public: void machiman_state::prepare_display() { - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18); display_matrix(19, 5, plate, m_grid); } @@ -1938,7 +1938,7 @@ WRITE8_MEMBER(alnattck_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,16,11,9,8,10,7,2,0,1,3,4,5,6,12,13,14,15); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,16,11,9,8,10,7,2,0,1,3,4,5,6,12,13,14,15); display_matrix(20, 10, plate, m_grid); } @@ -2065,7 +2065,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(cdkong_state::speaker_decay_sim) void cdkong_state::prepare_display() { - UINT32 plate = BITSWAP32(m_plate,31,30,29,24,0,16,8,1,23,17,9,2,18,10,25,27,26,3,15,27,11,11,14,22,6,13,21,5,19,12,20,4) | 0x800800; + uint32_t plate = BITSWAP32(m_plate,31,30,29,24,0,16,8,1,23,17,9,2,18,10,25,27,26,3,15,27,11,11,14,22,6,13,21,5,19,12,20,4) | 0x800800; display_matrix(29, 11, plate, m_grid); } @@ -2183,8 +2183,8 @@ public: void cgalaxn_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,1,2,0,11,10,9,8,7,6,5,4,3); - UINT16 plate = BITSWAP16(m_plate,15,14,6,5,4,3,2,1,7,8,9,10,11,0,12,13); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,1,2,0,11,10,9,8,7,6,5,4,3); + uint16_t plate = BITSWAP16(m_plate,15,14,6,5,4,3,2,1,7,8,9,10,11,0,12,13); display_matrix(15, 12, plate, grid); } @@ -2319,8 +2319,8 @@ WRITE8_MEMBER(cpacman_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10); - UINT32 plate = BITSWAP32(m_plate,31,30,29,28,27,0,1,2,3,8,9,10,11,16,17,18,19,25,26,23,22,21,20,24,15,14,13,12,4,5,6,7); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10); + uint32_t plate = BITSWAP32(m_plate,31,30,29,28,27,0,1,2,3,8,9,10,11,16,17,18,19,25,26,23,22,21,20,24,15,14,13,12,4,5,6,7); display_matrix(27, 11, plate, grid); } @@ -2436,8 +2436,8 @@ WRITE8_MEMBER(cmspacmn_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT16 grid = BITSWAP16(m_grid,15,14,13,11,10,9,8,7,6,5,4,3,2,1,0,1); - UINT64 plate = BIT(m_plate,15)<<32 | BITSWAP32(m_plate,14,13,12,4,5,6,7,24,23,25,22,21,20,13,24,3,19,14,12,11,24,2,10,8,7,25,0,9,1,18,17,16) | 0x1004080; + uint16_t grid = BITSWAP16(m_grid,15,14,13,11,10,9,8,7,6,5,4,3,2,1,0,1); + uint64_t plate = BIT(m_plate,15)<<32 | BITSWAP32(m_plate,14,13,12,4,5,6,7,24,23,25,22,21,20,13,24,3,19,14,12,11,24,2,10,8,7,25,0,9,1,18,17,16) | 0x1004080; display_matrix(33, 12, plate, grid); } @@ -2552,7 +2552,7 @@ void sag_state::prepare_display() // grid 8-11 are 7segs set_display_segmask(0xf00, 0x7f); - UINT8 seg = BITSWAP8(m_plate,3,4,5,6,7,8,9,10); + uint8_t seg = BITSWAP8(m_plate,3,4,5,6,7,8,9,10); for (int y = 8; y < 12; y++) m_display_state[y] = (m_grid >> y & 1) ? seg : 0; @@ -2682,8 +2682,8 @@ public: void egalaxn2_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,15,14,13,12,7,6,5,4,3,2,1,0,19,18,17,16,11,10,9,8); + uint16_t grid = BITSWAP16(m_grid,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,15,14,13,12,7,6,5,4,3,2,1,0,19,18,17,16,11,10,9,8); display_matrix(24, 15, plate, grid); } @@ -2865,7 +2865,7 @@ public: DECLARE_WRITE8_MEMBER(plate_w); DECLARE_WRITE16_MEMBER(grid_w); - UINT8 m_cop_irq; + uint8_t m_cop_irq; DECLARE_WRITE_LINE_MEMBER(speaker_w); DECLARE_WRITE8_MEMBER(cop_irq_w); DECLARE_READ8_MEMBER(cop_latch_r); @@ -2882,8 +2882,8 @@ protected: void eturtles_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,1,14,13,12,11,10,9,8,7,6,5,4,3,2,0); - UINT32 plate = BITSWAP32(m_plate,31,30,11,12,18,19,16,17,22,15,20,21,27,26,23,25,24,2,3,1,0,6,4,5,10,9,2,8,7,14,1,13); + uint16_t grid = BITSWAP16(m_grid,15,1,14,13,12,11,10,9,8,7,6,5,4,3,2,0); + uint32_t plate = BITSWAP32(m_plate,31,30,11,12,18,19,16,17,22,15,20,21,27,26,23,25,24,2,3,1,0,6,4,5,10,9,2,8,7,14,1,13); display_matrix(30, 15, plate | (grid >> 5 & 8), grid); // grid 8 also forces plate 3 high } @@ -2902,7 +2902,7 @@ WRITE16_MEMBER(eturtles_state::grid_w) m_d = data; // D1-D6: input mux - UINT8 inp_mux = data >> 1 & 0x3f; + uint8_t inp_mux = data >> 1 & 0x3f; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -2917,7 +2917,7 @@ WRITE16_MEMBER(eturtles_state::grid_w) void eturtles_state::update_int() { // INT0/1 on multiplexed inputs, and from COP D0 - UINT8 inp = read_inputs(6); + uint8_t inp = read_inputs(6); set_interrupt(0, (inp & 1) | m_cop_irq); set_interrupt(1, inp & 2); } @@ -3062,8 +3062,8 @@ public: void estargte_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,0,14,13,12,11,10,9,8,7,6,5,4,3,2,1); - UINT32 plate = BITSWAP32(m_plate,31,30,29,15,17,19,21,23,25,27,26,24,3,22,20,18,16,14,12,10,8,6,4,2,0,1,3,5,7,9,11,13); + uint16_t grid = BITSWAP16(m_grid,15,0,14,13,12,11,10,9,8,7,6,5,4,3,2,1); + uint32_t plate = BITSWAP32(m_plate,31,30,29,15,17,19,21,23,25,27,26,24,3,22,20,18,16,14,12,10,8,6,4,2,0,1,3,5,7,9,11,13); display_matrix(29, 14, plate, grid); } @@ -3179,8 +3179,8 @@ WRITE8_MEMBER(ghalien_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,14,12,10,8,9,13,15,2,0,1,3,11,7,5,4,6,19,17,16,18); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,14,12,10,8,9,13,15,2,0,1,3,11,7,5,4,6,19,17,16,18); display_matrix(20, 10, plate, grid); } @@ -3298,8 +3298,8 @@ WRITE8_MEMBER(gckong_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10); - UINT32 plate = BITSWAP32(m_plate,31,30,29,28,27,26,25,6,7,8,12,13,14,15,16,17,18,17,16,12,11,10,9,8,7,6,5,4,3,2,1,0) | 0x8000; + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,0,1,2,3,4,5,6,7,8,9,10); + uint32_t plate = BITSWAP32(m_plate,31,30,29,28,27,26,25,6,7,8,12,13,14,15,16,17,18,17,16,12,11,10,9,8,7,6,5,4,3,2,1,0) | 0x8000; display_matrix(32, 11, plate, grid); } @@ -3309,7 +3309,7 @@ WRITE16_MEMBER(gckong_state::grid_w) m_speaker->level_w(data >> 2 & 1); // D5-D8: input mux - UINT8 inp_mux = data >> 5 & 0xf; + uint8_t inp_mux = data >> 5 & 0xf; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -3422,7 +3422,7 @@ WRITE8_MEMBER(gdigdug_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT32 plate = BITSWAP32(m_plate,30,31,0,1,2,3,4,5,6,7,20,21,22,27,26,25,28,29,24,23,15,14,13,12,8,9,10,11,19,18,17,16); + uint32_t plate = BITSWAP32(m_plate,30,31,0,1,2,3,4,5,6,7,20,21,22,27,26,25,28,29,24,23,15,14,13,12,8,9,10,11,19,18,17,16); display_matrix(32, 9, plate, m_grid); } @@ -3432,7 +3432,7 @@ WRITE16_MEMBER(gdigdug_state::grid_w) m_speaker->level_w(data >> 6 & 1); // D11-D15: input mux - UINT8 inp_mux = data >> 11 & 0x1f; + uint8_t inp_mux = data >> 11 & 0x1f; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -3543,7 +3543,7 @@ public: void mwcbaseb_state::prepare_display() { - UINT8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); + uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); display_matrix(16, 8, m_plate, grid); } @@ -3641,7 +3641,7 @@ static INPUT_PORTS_START( mwcbaseb ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("P1 1") INPUT_PORTS_END -static const INT16 mwcbaseb_speaker_levels[] = { 0, 0x3fff, -0x4000, 0, -0x4000, 0, -0x8000, -0x4000 }; +static const int16_t mwcbaseb_speaker_levels[] = { 0, 0x3fff, -0x4000, 0, -0x4000, 0, -0x8000, -0x4000 }; static MACHINE_CONFIG_START( mwcbaseb, mwcbaseb_state ) @@ -3703,7 +3703,7 @@ WRITE8_MEMBER(pbqbert_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT32 plate = BITSWAP32(m_plate,31,30,24,25,26,27,28,15,14,29,13,12,11,10,9,8,7,6,5,4,3,2,1,0,16,17,18,19,20,21,22,23) | 0x400000; + uint32_t plate = BITSWAP32(m_plate,31,30,24,25,26,27,28,15,14,29,13,12,11,10,9,8,7,6,5,4,3,2,1,0,16,17,18,19,20,21,22,23) | 0x400000; display_matrix(30, 8, plate, m_grid); } @@ -3791,8 +3791,8 @@ public: void kingman_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8); - UINT32 plate = BITSWAP24(m_plate,23,6,7,5,4,3,2,1,0,13,12,20,19,18,17,16,10,11,9,8,14,15,13,12); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8); + uint32_t plate = BITSWAP24(m_plate,23,6,7,5,4,3,2,1,0,13,12,20,19,18,17,16,10,11,9,8,14,15,13,12); display_matrix(23, 9, plate, grid); } @@ -3810,7 +3810,7 @@ WRITE16_MEMBER(kingman_state::grid_w) m_speaker->level_w(data >> 6 & 1); // D12-D15: input mux - UINT8 inp_mux = data >> 12 & 0xf; + uint8_t inp_mux = data >> 12 & 0xf; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -3913,8 +3913,8 @@ public: void tmtron_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,1,2,3,4,5,6,7,8,9,0); - UINT32 plate = BITSWAP24(m_plate,23,5,2,21,1,6,7,9,10,11,21,0,19,3,4,8,3,18,17,16,12,13,14,15); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,1,2,3,4,5,6,7,8,9,0); + uint32_t plate = BITSWAP24(m_plate,23,5,2,21,1,6,7,9,10,11,21,0,19,3,4,8,3,18,17,16,12,13,14,15); display_matrix(23, 10, plate, grid); } @@ -3932,7 +3932,7 @@ WRITE16_MEMBER(tmtron_state::grid_w) m_speaker->level_w(data >> 4 & 1); // D12-D15: input mux - UINT8 inp_mux = data >> 12 & 0xf; + uint8_t inp_mux = data >> 12 & 0xf; if (inp_mux != m_inp_mux) { m_inp_mux = inp_mux; @@ -4040,7 +4040,7 @@ WRITE8_MEMBER(vinvader_state::plate_w) m_plate = (m_plate & ~(0xf << shift)) | (data << shift); // update display - UINT16 plate = BITSWAP16(m_plate,15,11,7,3,10,6,14,2,9,5,13,1,8,4,12,0); + uint16_t plate = BITSWAP16(m_plate,15,11,7,3,10,6,14,2,9,5,13,1,8,4,12,0); display_matrix(12, 9, plate, m_grid); } diff --git a/src/mame/drivers/hh_melps4.cpp b/src/mame/drivers/hh_melps4.cpp index e1315a3ede4..aebaef2ff7e 100644 --- a/src/mame/drivers/hh_melps4.cpp +++ b/src/mame/drivers/hh_melps4.cpp @@ -34,9 +34,9 @@ public: optional_device m_speaker; // misc common - UINT16 m_inp_mux; // multiplexed inputs mask + uint16_t m_inp_mux; // multiplexed inputs mask - UINT8 read_inputs(int columns); + uint8_t read_inputs(int columns); DECLARE_INPUT_CHANGED_MEMBER(reset_button); // display common @@ -44,18 +44,18 @@ public: int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 31 for now) - UINT32 m_grid; // VFD current row data - UINT32 m_plate; // VFD current column data + uint32_t m_grid; // VFD current row data + uint32_t m_plate; // VFD current column data - UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) + uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + uint32_t m_display_cache[0x20]; // (internal use) + uint8_t m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); void set_display_size(int maxx, int maxy); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true); + void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true); protected: virtual void machine_start() override; @@ -109,7 +109,7 @@ void hh_melps4_state::machine_reset() void hh_melps4_state::display_update() { - UINT32 active_state[0x20]; + uint32_t active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -122,7 +122,7 @@ void hh_melps4_state::display_update() m_display_decay[y][x] = m_display_wait; // determine active state - UINT32 ds = (m_display_decay[y][x] != 0) ? 1 : 0; + uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0; active_state[y] |= (ds << x); } } @@ -177,12 +177,12 @@ void hh_melps4_state::set_display_size(int maxx, int maxy) m_display_maxy = maxy; } -void hh_melps4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update) +void hh_melps4_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update) { set_display_size(maxx, maxy); // update current state - UINT32 mask = (1 << maxx) - 1; + uint32_t mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; @@ -193,9 +193,9 @@ void hh_melps4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 set // generic input handlers -UINT8 hh_melps4_state::read_inputs(int columns) +uint8_t hh_melps4_state::read_inputs(int columns) { - UINT8 ret = 0; + uint8_t ret = 0; // read selected input rows for (int i = 0; i < columns; i++) @@ -246,8 +246,8 @@ public: void cfrogger_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,0,1,2,3,4,5,6,7,8,9,10,11); - UINT16 plate = BITSWAP16(m_plate,12,4,13,5,14,6,15,7,3,11,2,10,1,9,0,8); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,0,1,2,3,4,5,6,7,8,9,10,11); + uint16_t plate = BITSWAP16(m_plate,12,4,13,5,14,6,15,7,3,11,2,10,1,9,0,8); display_matrix(16, 12, plate, grid); } @@ -362,8 +362,8 @@ public: void gjungler_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,7,6,5,4,3,2,0,1); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,8,9,10,11,13,16,15,14,13,12,7,0,6,1,5,2,4,3) | 0x2000; + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,7,6,5,4,3,2,0,1); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,18,8,9,10,11,13,16,15,14,13,12,7,0,6,1,5,2,4,3) | 0x2000; display_matrix(18, 12, plate, grid); } diff --git a/src/mame/drivers/hh_pic16.cpp b/src/mame/drivers/hh_pic16.cpp index 342c833b2f8..6bb594cc30e 100644 --- a/src/mame/drivers/hh_pic16.cpp +++ b/src/mame/drivers/hh_pic16.cpp @@ -50,23 +50,23 @@ public: optional_device m_speaker; // misc common - UINT8 m_b; // MCU port B data - UINT8 m_c; // MCU port C data + uint8_t m_b; // MCU port B data + uint8_t m_c; // MCU port C data // display common int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 31 for now) - UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) + uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + uint32_t m_display_cache[0x20]; // (internal use) + uint8_t m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); void set_display_size(int maxx, int maxy); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true); + void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true); protected: virtual void machine_start() override; @@ -118,7 +118,7 @@ void hh_pic16_state::machine_reset() void hh_pic16_state::display_update() { - UINT32 active_state[0x20]; + uint32_t active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -131,7 +131,7 @@ void hh_pic16_state::display_update() m_display_decay[y][x] = m_display_wait; // determine active state - UINT32 ds = (m_display_decay[y][x] != 0) ? 1 : 0; + uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0; active_state[y] |= (ds << x); } } @@ -186,12 +186,12 @@ void hh_pic16_state::set_display_size(int maxx, int maxy) m_display_maxy = maxy; } -void hh_pic16_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update) +void hh_pic16_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update) { set_display_size(maxx, maxy); // update current state - UINT32 mask = (1 << maxx) - 1; + uint32_t mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; @@ -258,7 +258,7 @@ static INPUT_PORTS_START( maniac ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) // upper-left INPUT_PORTS_END -static const INT16 maniac_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; +static const int16_t maniac_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; static MACHINE_CONFIG_START( maniac, maniac_state ) diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index 0a3b5263a30..2d9f21322df 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -34,11 +34,11 @@ public: optional_device m_speaker; // misc common - UINT16 m_inp_mux; // multiplexed inputs mask + uint16_t m_inp_mux; // multiplexed inputs mask int m_inp_lines; // number of input mux columns - UINT8 m_lcd_output_cache[0x100]; + uint8_t m_lcd_output_cache[0x100]; - UINT8 read_inputs(int columns); + uint8_t read_inputs(int columns); virtual void update_k_line(); virtual DECLARE_INPUT_CHANGED_MEMBER(input_changed); @@ -87,7 +87,7 @@ WRITE16_MEMBER(hh_sm510_state::lcd_segment_w) for (int seg = 0; seg < 0x10; seg++) { int index = offset << 4 | seg; - UINT8 state = data >> seg & 1; + uint8_t state = data >> seg & 1; if (state != m_lcd_output_cache[index]) { @@ -107,9 +107,9 @@ WRITE16_MEMBER(hh_sm510_state::lcd_segment_w) // generic input handlers - usually S output is input mux, and K input for buttons -UINT8 hh_sm510_state::read_inputs(int columns) +uint8_t hh_sm510_state::read_inputs(int columns) { - UINT8 ret = 0; + uint8_t ret = 0; // read selected input rows for (int i = 0; i < columns; i++) diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index 25d0b2cff75..3802c4f1388 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -240,7 +240,7 @@ void hh_tms1k_state::machine_reset() void hh_tms1k_state::display_update() { - UINT32 active_state[0x20]; + uint32_t active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -253,7 +253,7 @@ void hh_tms1k_state::display_update() m_display_decay[y][x] = m_display_wait; // determine active state - UINT32 ds = (m_display_decay[y][x] != 0) ? 1 : 0; + uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0; active_state[y] |= (ds << x); } } @@ -315,7 +315,7 @@ void hh_tms1k_state::set_display_size(int maxx, int maxy) m_display_maxy = maxy; } -void hh_tms1k_state::set_display_segmask(UINT32 digits, UINT32 mask) +void hh_tms1k_state::set_display_segmask(uint32_t digits, uint32_t mask) { // set a segment mask per selected digit, but leave unselected ones alone for (int i = 0; i < 0x20; i++) @@ -326,12 +326,12 @@ void hh_tms1k_state::set_display_segmask(UINT32 digits, UINT32 mask) } } -void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update) +void hh_tms1k_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update) { set_display_size(maxx, maxy); // update current state - UINT32 mask = (1 << maxx) - 1; + uint32_t mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; @@ -342,9 +342,9 @@ void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety // generic input handlers -UINT8 hh_tms1k_state::read_inputs(int columns) +uint8_t hh_tms1k_state::read_inputs(int columns) { - UINT8 ret = 0; + uint8_t ret = 0; // read selected input rows for (int i = 0; i < columns; i++) @@ -354,10 +354,10 @@ UINT8 hh_tms1k_state::read_inputs(int columns) return ret; } -UINT8 hh_tms1k_state::read_rotated_inputs(int columns, UINT8 rowmask) +uint8_t hh_tms1k_state::read_rotated_inputs(int columns, uint8_t rowmask) { - UINT8 ret = 0; - UINT16 colmask = (1 << columns) - 1; + uint8_t ret = 0; + uint16_t colmask = (1 << columns) - 1; // read selected input columns for (int i = 0; i < 8; i++) @@ -500,7 +500,7 @@ static INPUT_PORTS_START( matchnum ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Square 1") INPUT_PORTS_END -static const INT16 matchnum_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 }; +static const int16_t matchnum_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 }; static MACHINE_CONFIG_START( matchnum, matchnum_state ) @@ -646,7 +646,7 @@ static INPUT_PORTS_START( mathmagi ) INPUT_PORTS_END // output PLA is not decapped -static const UINT16 mathmagi_output_pla[0x20] = +static const uint16_t mathmagi_output_pla[0x20] = { lA+lB+lC+lD+lE+lF, // 0 lB+lC, // 1 @@ -759,7 +759,7 @@ WRITE16_MEMBER(amaztron_state::write_o) READ8_MEMBER(amaztron_state::read_k) { // K: multiplexed inputs - UINT8 k = read_inputs(6); + uint8_t k = read_inputs(6); // the 5th column is tied to K4+K8 if (k & 0x10) k |= 0xc; @@ -952,7 +952,7 @@ static INPUT_PORTS_START( zodiac ) INPUT_PORTS_END // output PLA is not decapped -static const UINT16 zodiac_output_pla[0x20] = +static const uint16_t zodiac_output_pla[0x20] = { 0x80, // empty/led 1/7 lC, // i/led 2/8 @@ -1040,7 +1040,7 @@ public: void cqback_state::prepare_display() { // R9 selects between segments B/C or A'/D' - UINT16 seg = m_o; + uint16_t seg = m_o; if (m_r & 0x200) seg = (m_o << 7 & 0x300) | (m_o & 0xf9); @@ -1751,7 +1751,7 @@ static INPUT_PORTS_START( cnfball ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY INPUT_PORTS_END -static const INT16 cnfball_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 }; +static const int16_t cnfball_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 }; static MACHINE_CONFIG_START( cnfball, cnfball_state ) @@ -1807,7 +1807,7 @@ public: void cnfball2_state::prepare_display() { // R1 selects between segments B/C or A'/D' - UINT16 seg = m_o; + uint16_t seg = m_o; if (~m_r & 2) seg = (m_o << 7 & 0x300) | (m_o & 0xf9); @@ -1869,7 +1869,7 @@ static INPUT_PORTS_START( cnfball2 ) INPUT_PORTS_END // output PLA is not decapped -static const UINT16 cnfball2_output_pla[0x20] = +static const uint16_t cnfball2_output_pla[0x20] = { // first half was dumped electronically 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x40, 0x01, 0x08, 0x02, 0x04, 0x00, @@ -2899,7 +2899,7 @@ void raisedvl_state::set_clock() // 0: R=47K -> ~350kHz // 2,3: R=35K8 -> ~425kHz (combined) // 4: R=32K -> ~465kHz (combined) - UINT8 inp = m_inp_matrix[1]->read(); + uint8_t inp = m_inp_matrix[1]->read(); m_maincpu->set_unscaled_clock((inp & 0x20) ? 465000 : ((inp & 0x10) ? 425000 : 350000)); } @@ -3430,7 +3430,7 @@ static INPUT_PORTS_START( elecdet ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false) INPUT_PORTS_END -static const INT16 elecdet_speaker_levels[4] = { 0, 0x3fff, 0x3fff, 0x7fff }; +static const int16_t elecdet_speaker_levels[4] = { 0, 0x3fff, 0x3fff, 0x7fff }; static MACHINE_CONFIG_START( elecdet, elecdet_state ) @@ -3756,8 +3756,8 @@ void elecbowl_state::prepare_display() } // lamp muxes - UINT8 mask = 1 << (m_o & 7); - UINT8 d = (m_r & 2) ? mask : 0; + uint8_t mask = 1 << (m_o & 7); + uint8_t d = (m_r & 2) ? mask : 0; if (~m_r & 1) m_display_state[5] = (m_display_state[5] & ~mask) | d; if (~m_r & 4) @@ -3834,7 +3834,7 @@ static INPUT_PORTS_START( elecbowl ) INPUT_PORTS_END // output PLA is not decapped -static const UINT16 elecbowl_output_pla[0x20] = +static const uint16_t elecbowl_output_pla[0x20] = { lA+lB+lC+lD+lE+lF, // 0 lB+lC, // 1 @@ -4640,7 +4640,7 @@ void ssimon_state::set_clock() // 0 Simple: R=51K -> ~200kHz // 1 Normal: R=37K -> ~275kHz // 2 Super: R=22K -> ~400kHz - UINT8 inp = m_inp_matrix[6]->read(); + uint8_t inp = m_inp_matrix[6]->read(); m_maincpu->set_unscaled_clock((inp & 2) ? 400000 : ((inp & 1) ? 275000 : 200000)); } @@ -4828,7 +4828,7 @@ void bigtrak_state::machine_start() save_item(NAME(m_gearbox_pos)); } -static const INT16 bigtrak_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff }; +static const int16_t bigtrak_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff }; static MACHINE_CONFIG_START( bigtrak, bigtrak_state ) @@ -4952,7 +4952,7 @@ void mbdtower_state::prepare_display() // update current state if (~m_r & 0x10) { - UINT8 o = BITSWAP8(m_o,7,0,4,3,2,1,6,5) & 0x7f; + uint8_t o = BITSWAP8(m_o,7,0,4,3,2,1,6,5) & 0x7f; m_display_state[2] = (m_o & 0x80) ? o : 0; m_display_state[1] = (m_o & 0x80) ? 0 : o; m_display_state[0] = (m_r >> 8 & 1) | (m_r >> 4 & 0xe); @@ -5294,7 +5294,7 @@ static INPUT_PORTS_START( merlin ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("New Game") INPUT_PORTS_END -static const INT16 merlin_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff }; +static const int16_t merlin_speaker_levels[8] = { 0, 0x7fff/3, 0x7fff/3, 0x7fff/3*2, 0x7fff/3, 0x7fff/3*2, 0x7fff/3*2, 0x7fff }; static MACHINE_CONFIG_START( merlin, merlin_state ) @@ -5473,7 +5473,7 @@ static INPUT_PORTS_START( stopthief ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false) INPUT_PORTS_END -static const INT16 stopthief_speaker_levels[7] = { 0, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff }; +static const int16_t stopthief_speaker_levels[7] = { 0, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff }; static MACHINE_CONFIG_START( stopthief, stopthief_state ) @@ -5807,7 +5807,7 @@ static INPUT_PORTS_START( lostreas ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("Up") INPUT_PORTS_END -static const INT16 lostreas_speaker_levels[16] = +static const int16_t lostreas_speaker_levels[16] = { 0, 0x7fff/15, 0x7fff/14, 0x7fff/13, 0x7fff/12, 0x7fff/11, 0x7fff/10, 0x7fff/9, 0x7fff/8, 0x7fff/7, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff/1 @@ -5865,8 +5865,8 @@ public: void tcfball_state::prepare_display() { // R8 enables leds, R9 enables digits - UINT16 mask = ((m_r >> 9 & 1) * 0x7f) | ((m_r >> 8 & 1) * 0x780); - UINT16 sel = ((m_r & 0x7f) | (m_r << 7 & 0x780)) & mask; + uint16_t mask = ((m_r >> 9 & 1) * 0x7f) | ((m_r >> 8 & 1) * 0x780); + uint16_t sel = ((m_r & 0x7f) | (m_r << 7 & 0x780)) & mask; set_display_segmask(0x77, 0x7f); set_display_segmask(0x08, 0xff); // R3 has DP @@ -5981,7 +5981,7 @@ static INPUT_PORTS_START( tcfballa ) INPUT_PORTS_END // output PLA is not decapped, dumped electronically -static const UINT16 tcfballa_output_pla[0x20] = +static const uint16_t tcfballa_output_pla[0x20] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x00, 0x46, 0x70, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 @@ -6139,7 +6139,7 @@ static INPUT_PORTS_START( tandy12 ) INPUT_PORTS_END // output PLA is not decapped -static const UINT16 tandy12_output_pla[0x20] = +static const uint16_t tandy12_output_pla[0x20] = { // these are certain 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, @@ -6404,7 +6404,7 @@ static INPUT_PORTS_START( copycat ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -static const INT16 copycat_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 }; +static const int16_t copycat_speaker_levels[4] = { 0, 0x7fff, -0x8000, 0 }; static MACHINE_CONFIG_START( copycat, copycat_state ) @@ -6619,7 +6619,7 @@ public: { } required_device m_expander; - UINT8 m_exp_port[7]; + uint8_t m_exp_port[7]; DECLARE_WRITE8_MEMBER(expander_w); void prepare_display(); @@ -7008,7 +7008,7 @@ static INPUT_PORTS_START( ssports4 ) INPUT_PORTS_END // output PLA is not decapped, dumped electronically -static const UINT16 ssports4_output_pla[0x20] = +static const uint16_t ssports4_output_pla[0x20] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40 diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp index 4aba54a2591..5b2414f4fd4 100644 --- a/src/mame/drivers/hh_ucom4.cpp +++ b/src/mame/drivers/hh_ucom4.cpp @@ -129,7 +129,7 @@ void hh_ucom4_state::machine_reset() void hh_ucom4_state::display_update() { - UINT32 active_state[0x20]; + uint32_t active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -142,7 +142,7 @@ void hh_ucom4_state::display_update() m_display_decay[y][x] = m_display_wait; // determine active state - UINT32 ds = (m_display_decay[y][x] != 0) ? 1 : 0; + uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0; active_state[y] |= (ds << x); } } @@ -197,12 +197,12 @@ void hh_ucom4_state::set_display_size(int maxx, int maxy) m_display_maxy = maxy; } -void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update) +void hh_ucom4_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update) { set_display_size(maxx, maxy); // update current state - UINT32 mask = (1 << maxx) - 1; + uint32_t mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; @@ -213,9 +213,9 @@ void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety // generic input handlers -UINT8 hh_ucom4_state::read_inputs(int columns) +uint8_t hh_ucom4_state::read_inputs(int columns) { - UINT8 ret = 0; + uint8_t ret = 0; // read selected input rows for (int i = 0; i < columns; i++) @@ -294,8 +294,8 @@ public: void ufombs_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,3,2,1,0,4,5,6,7,8); - UINT16 plate = BITSWAP16(m_plate,15,14,13,12,11,7,10,6,9,5,8,4,0,1,2,3); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,3,2,1,0,4,5,6,7,8); + uint16_t plate = BITSWAP16(m_plate,15,14,13,12,11,7,10,6,9,5,8,4,0,1,2,3); display_matrix(10, 9, plate, grid); } @@ -339,7 +339,7 @@ static INPUT_PORTS_START( ufombs ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -static const INT16 ufombs_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; +static const int16_t ufombs_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; static MACHINE_CONFIG_START( ufombs, ufombs_state ) @@ -406,7 +406,7 @@ public: void ssfball_state::prepare_display() { - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,11,7,3,12,17,13,18,16,14,15,10,9,8,0,1,2,4,5,6); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,11,7,3,12,17,13,18,16,14,15,10,9,8,0,1,2,4,5,6); display_matrix(16, 9, plate, m_grid); } @@ -485,7 +485,7 @@ static INPUT_PORTS_START( ssfball ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY INPUT_PORTS_END -static const INT16 ssfball_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; +static const int16_t ssfball_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; static MACHINE_CONFIG_START( ssfball, ssfball_state ) @@ -550,7 +550,7 @@ public: void bmsoccer_state::prepare_display() { - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,11,7,3,12,17,13,18,16,14,15,8,4,0,9,5,1,10,6,2); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,11,7,3,12,17,13,18,16,14,15,8,4,0,9,5,1,10,6,2); display_matrix(16, 9, plate, m_grid); } @@ -673,8 +673,8 @@ public: void bmsafari_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8); - UINT16 plate = BITSWAP16(m_plate,15,14,13,12,11,7,10,2,9,5,8,4,0,1,6,3); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,0,1,2,3,4,5,6,7,8); + uint16_t plate = BITSWAP16(m_plate,15,14,13,12,11,7,10,2,9,5,8,4,0,1,6,3); display_matrix(10, 9, plate, grid); } @@ -783,7 +783,7 @@ public: void splasfgt_state::prepare_display() { - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,13,1,0,8,6,0,10,11,14,15,16,9,5,7,4,2,3); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,13,1,0,8,6,0,10,11,14,15,16,9,5,7,4,2,3); display_matrix(16, 9, plate, m_grid); } @@ -871,7 +871,7 @@ static INPUT_PORTS_START( splasfgt ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -static const INT16 splasfgt_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; +static const int16_t splasfgt_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; static MACHINE_CONFIG_START( splasfgt, splasfgt_state ) @@ -935,8 +935,8 @@ public: void bcclimbr_state::prepare_display() { - UINT8 grid = BITSWAP8(m_grid,7,6,0,1,2,3,4,5); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,16,17,18,19,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); + uint8_t grid = BITSWAP8(m_grid,7,6,0,1,2,3,4,5); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,16,17,18,19,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0); display_matrix(20, 6, plate, grid); } @@ -1153,8 +1153,8 @@ public: void invspace_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,8,9,7,6,5,4,3,2,1,0); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,9,14,13,8,15,11,10,7,11,3,2,6,10,1,5,9,0,4,8); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,8,9,7,6,5,4,3,2,1,0); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,9,14,13,8,15,11,10,7,11,3,2,6,10,1,5,9,0,4,8); display_matrix(19, 9, plate, grid); } @@ -1257,7 +1257,7 @@ public: void efball_state::prepare_display() { - UINT16 plate = BITSWAP16(m_plate,15,14,13,12,11,4,3,0,2,1,6,10,9,5,8,7); + uint16_t plate = BITSWAP16(m_plate,15,14,13,12,11,4,3,0,2,1,6,10,9,5,8,7); display_matrix(11, 10, plate, m_grid); } @@ -1370,8 +1370,8 @@ public: void galaxy2_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); - UINT16 plate = BITSWAP16(m_plate,15,3,2,6,1,5,4,0,11,10,7,12,14,13,8,9); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); + uint16_t plate = BITSWAP16(m_plate,15,3,2,6,1,5,4,0,11,10,7,12,14,13,8,9); display_matrix(15, 10, plate, grid); } @@ -1481,8 +1481,8 @@ public: void astrocmd_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,4,5,6,7,0,1,2,3); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,3,2,12,13,14,15,16,17,18,0,1,4,8,5,9,7,11,6,10); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,4,5,6,7,0,1,2,3); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,3,2,12,13,14,15,16,17,18,0,1,4,8,5,9,7,11,6,10); display_matrix(17, 9, plate, grid); } @@ -1874,8 +1874,8 @@ public: void mvbfree_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); - UINT16 plate = BITSWAP16(m_plate,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); + uint16_t grid = BITSWAP16(m_grid,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); + uint16_t plate = BITSWAP16(m_plate,15,14,13,12,11,10,0,1,2,3,4,5,6,7,8,9); display_matrix(10, 14, plate, grid); } @@ -1980,8 +1980,8 @@ public: void tccombat_state::prepare_display() { - UINT16 grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,3,2,1,0,7,6,5,4); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,11,15,3,10,14,2,9,13,1,0,12,8,15,1,5,0,3,7,2,6); + uint16_t grid = BITSWAP16(m_grid,15,14,13,12,11,10,9,8,3,2,1,0,7,6,5,4); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,11,15,3,10,14,2,9,13,1,0,12,8,15,1,5,0,3,7,2,6); display_matrix(20, 9, plate, grid); } @@ -2243,8 +2243,8 @@ public: void tmpacman_state::prepare_display() { - UINT8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,16,17,18,11,10,9,8,0,2,3,1,4,5,6,7,12,13,14,15) | 0x100; + uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,16,17,18,11,10,9,8,0,2,3,1,4,5,6,7,12,13,14,15) | 0x100; display_matrix(19, 8, plate, grid); } @@ -2348,7 +2348,7 @@ public: void tmscramb_state::prepare_display() { - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,3,15,2,14,1,13,16,0,12,8,4,9,5,10,6,11,7) | 0x400; + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,18,17,3,15,2,14,1,13,16,0,12,8,4,9,5,10,6,11,7) | 0x400; display_matrix(17, 10, plate, m_grid); } @@ -2450,8 +2450,8 @@ public: void tcaveman_state::prepare_display() { - UINT8 grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); - UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,10,11,5,6,7,8,0,9,2,18,17,16,3,15,14,13,12,4,1) | 0x40; + uint8_t grid = BITSWAP8(m_grid,0,1,2,3,4,5,6,7); + uint32_t plate = BITSWAP24(m_plate,23,22,21,20,19,10,11,5,6,7,8,0,9,2,18,17,16,3,15,14,13,12,4,1) | 0x40; display_matrix(19, 8, plate, grid); } diff --git a/src/mame/drivers/hideseek.cpp b/src/mame/drivers/hideseek.cpp index 59ae4bd5d51..edf55ea27bc 100644 --- a/src/mame/drivers/hideseek.cpp +++ b/src/mame/drivers/hideseek.cpp @@ -44,7 +44,7 @@ public: DECLARE_DRIVER_INIT(hideseek); virtual void video_start() override; DECLARE_PALETTE_INIT(hideseek); - UINT32 screen_update_hideseek(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hideseek(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -54,7 +54,7 @@ void hideseek_state::video_start() } -UINT32 hideseek_state::screen_update_hideseek(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hideseek_state::screen_update_hideseek(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/highvdeo.cpp b/src/mame/drivers/highvdeo.cpp index aad4ce7df35..1e9da3a340c 100644 --- a/src/mame/drivers/highvdeo.cpp +++ b/src/mame/drivers/highvdeo.cpp @@ -115,10 +115,10 @@ public: m_okim6376(*this, "oki"), m_palette(*this, "palette") { } - required_shared_ptr m_blit_ram; - UINT16 m_vblank_bit; - UINT16 m_brasil_prot_latch; - UINT16 m_grancapi_prot_latch; + required_shared_ptr m_blit_ram; + uint16_t m_vblank_bit; + uint16_t m_brasil_prot_latch; + uint16_t m_grancapi_prot_latch; DECLARE_READ16_MEMBER(read0_r); DECLARE_READ16_MEMBER(read1_r); DECLARE_READ16_MEMBER(read2_r); @@ -147,8 +147,8 @@ public: DECLARE_DRIVER_INIT(ciclone); DECLARE_DRIVER_INIT(record); DECLARE_VIDEO_START(tourvisn); - UINT32 screen_update_tourvisn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_brasil(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tourvisn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_brasil(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(vblank_irq_80186); required_device m_maincpu; @@ -163,7 +163,7 @@ VIDEO_START_MEMBER(highvdeo_state,tourvisn) { } -UINT32 highvdeo_state::screen_update_tourvisn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t highvdeo_state::screen_update_tourvisn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; @@ -173,7 +173,7 @@ UINT32 highvdeo_state::screen_update_tourvisn(screen_device &screen, bitmap_rgb3 { for(x=0;x<(screen.visible_area().max_x+1)/2;x++) { - UINT32 color; + uint32_t color; color = ((m_blit_ram[count]) & 0x00ff)>>0; @@ -193,7 +193,7 @@ UINT32 highvdeo_state::screen_update_tourvisn(screen_device &screen, bitmap_rgb3 } /*Later HW, RGB565 instead of RAM-based pens (+ ramdac).*/ -UINT32 highvdeo_state::screen_update_brasil(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t highvdeo_state::screen_update_brasil(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; @@ -203,10 +203,10 @@ UINT32 highvdeo_state::screen_update_brasil(screen_device &screen, bitmap_rgb32 { for(x=0;x<400;x++) { - UINT32 color; - UINT32 b; - UINT32 g; - UINT32 r; + uint32_t color; + uint32_t b; + uint32_t g; + uint32_t r; color = (m_blit_ram[count]) & 0xffff; @@ -243,8 +243,8 @@ READ16_MEMBER(highvdeo_state::read2_r) WRITE16_MEMBER(highvdeo_state::tv_vcf_bankselect_w) { - UINT32 bankaddress; - UINT8 *ROM = memregion("user1")->base(); + uint32_t bankaddress; + uint8_t *ROM = memregion("user1")->base(); /* bits 0, 1 select the ROM bank */ bankaddress = (data & 0x03) * 0x40000; @@ -409,8 +409,8 @@ WRITE16_MEMBER(highvdeo_state::nyj_write2_w) WRITE16_MEMBER(highvdeo_state::tv_tcf_bankselect_w) { - UINT32 bankaddress; - UINT8 *ROM = memregion("user1")->base(); + uint32_t bankaddress; + uint8_t *ROM = memregion("user1")->base(); /* bits 0, 1, 2 select the ROM bank */ bankaddress = (data & 0x07) * 0x40000; @@ -508,7 +508,7 @@ ADDRESS_MAP_END READ16_MEMBER(highvdeo_state::brasil_status_r) { - static UINT16 resetpulse; + static uint16_t resetpulse; switch(offset*2) { @@ -525,8 +525,8 @@ READ16_MEMBER(highvdeo_state::brasil_status_r) /*bankaddress might be incorrect.*/ WRITE16_MEMBER(highvdeo_state::brasil_status_w) { - UINT32 bankaddress; - UINT8 *ROM = memregion("user1")->base(); + uint32_t bankaddress; + uint8_t *ROM = memregion("user1")->base(); switch(data & 3) //data & 7? { @@ -544,7 +544,7 @@ WRITE16_MEMBER(highvdeo_state::brasil_status_w) READ16_MEMBER(highvdeo_state::grancapi_status_r) { - static UINT16 resetpulse; + static uint16_t resetpulse; switch(offset*2) { @@ -561,8 +561,8 @@ READ16_MEMBER(highvdeo_state::grancapi_status_r) /*bankaddress might be incorrect.*/ WRITE16_MEMBER(highvdeo_state::grancapi_status_w) { - UINT32 bankaddress; - UINT8 *ROM = memregion("user1")->base(); + uint32_t bankaddress; + uint8_t *ROM = memregion("user1")->base(); switch(data & 3) //data & 7? { @@ -580,7 +580,7 @@ WRITE16_MEMBER(highvdeo_state::grancapi_status_w) READ16_MEMBER(highvdeo_state::magicbom_status_r) { - static UINT16 resetpulse; + static uint16_t resetpulse; switch(offset*2) { @@ -1496,7 +1496,7 @@ ROM_END /*Ciclone*/ READ16_MEMBER(highvdeo_state::ciclone_status_r) { - static UINT16 resetpulse; + static uint16_t resetpulse; switch(offset*2) { case 0: @@ -1623,7 +1623,7 @@ ROM_END READ16_MEMBER(highvdeo_state::record_status_r) { - static UINT16 resetpulse; + static uint16_t resetpulse; switch(offset*2) { case 0: diff --git a/src/mame/drivers/hikaru.cpp b/src/mame/drivers/hikaru.cpp index b5575b1297f..d3f4a0fffa9 100644 --- a/src/mame/drivers/hikaru.cpp +++ b/src/mame/drivers/hikaru.cpp @@ -393,7 +393,7 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } virtual void video_start() override; - UINT32 screen_update_hikaru(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hikaru(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -401,7 +401,7 @@ void hikaru_state::video_start() { } -UINT32 hikaru_state::screen_update_hikaru(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hikaru_state::screen_update_hikaru(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/himesiki.cpp b/src/mame/drivers/himesiki.cpp index c61d2939a01..4fbaf602e34 100644 --- a/src/mame/drivers/himesiki.cpp +++ b/src/mame/drivers/himesiki.cpp @@ -398,7 +398,7 @@ GFXDECODE_END void himesiki_state::machine_start() { - UINT8 *ROM = memregion("banks")->base(); + uint8_t *ROM = memregion("banks")->base(); membank("bank1")->configure_entries(0, 4, ROM, 0x4000); diff --git a/src/mame/drivers/hitme.cpp b/src/mame/drivers/hitme.cpp index 076a3d6d211..d9e49335a36 100644 --- a/src/mame/drivers/hitme.cpp +++ b/src/mame/drivers/hitme.cpp @@ -35,7 +35,7 @@ TILE_GET_INFO_MEMBER(hitme_state::get_hitme_tile_info) { /* the code is the low 6 bits */ - UINT8 code = m_videoram[tile_index] & 0x3f; + uint8_t code = m_videoram[tile_index] & 0x3f; SET_TILE_INFO_MEMBER(0, code, 0, 0); } @@ -67,7 +67,7 @@ VIDEO_START_MEMBER(hitme_state,barricad) } -UINT32 hitme_state::screen_update_hitme(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hitme_state::screen_update_hitme(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* the card width resistor comes from an input port, scaled to the range 0-25 kOhms */ double width_resist = ioport("WIDTH")->read() * 25000 / 100; @@ -96,7 +96,7 @@ UINT32 hitme_state::screen_update_hitme(screen_device &screen, bitmap_ind16 &bit /* invert pixels until we run out */ for (xx = 0; xx < 8 && inv; xx++, inv--) { - UINT16 *dest = &bitmap.pix16(y * 10, x * 8 + xx); + uint16_t *dest = &bitmap.pix16(y * 10, x * 8 + xx); dest[0 * dy] ^= 1; dest[1 * dy] ^= 1; dest[2 * dy] ^= 1; @@ -114,7 +114,7 @@ UINT32 hitme_state::screen_update_hitme(screen_device &screen, bitmap_ind16 &bit } -UINT32 hitme_state::screen_update_barricad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hitme_state::screen_update_barricad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -128,20 +128,20 @@ UINT32 hitme_state::screen_update_barricad(screen_device &screen, bitmap_ind16 & * *************************************/ -UINT8 hitme_state::read_port_and_t0( int port ) +uint8_t hitme_state::read_port_and_t0( int port ) { static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; - UINT8 val = ioport(portnames[port])->read(); + uint8_t val = ioport(portnames[port])->read(); if (machine().time() > m_timeout_time) val ^= 0x80; return val; } -UINT8 hitme_state::read_port_and_t0_and_hblank( int port ) +uint8_t hitme_state::read_port_and_t0_and_hblank( int port ) { - UINT8 val = read_port_and_t0(port); + uint8_t val = read_port_and_t0(port); if (m_screen->hpos() < (m_screen->width() * 9 / 10)) val ^= 0x04; return val; @@ -187,7 +187,7 @@ WRITE8_MEMBER(hitme_state::output_port_0_w) In fact, it is very important that our timing calculation timeout AFTER the sound system's equivalent computation, or else we will hang notes. */ - UINT8 raw_game_speed = ioport("R3")->read(); + uint8_t raw_game_speed = ioport("R3")->read(); double resistance = raw_game_speed * 25000 / 100; attotime duration = attotime(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data + 1)); m_timeout_time = machine().time() + duration; diff --git a/src/mame/drivers/hitpoker.cpp b/src/mame/drivers/hitpoker.cpp index 5991792fb5a..8d3c8fd7409 100644 --- a/src/mame/drivers/hitpoker.cpp +++ b/src/mame/drivers/hitpoker.cpp @@ -61,14 +61,14 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_sys_regs; + required_shared_ptr m_sys_regs; - UINT8 m_pic_data; - std::unique_ptr m_videoram; - std::unique_ptr m_paletteram; - std::unique_ptr m_colorram; - UINT8 m_eeprom_data[0x1000]; - UINT16 m_eeprom_index; + uint8_t m_pic_data; + std::unique_ptr m_videoram; + std::unique_ptr m_paletteram; + std::unique_ptr m_colorram; + uint8_t m_eeprom_data[0x1000]; + uint16_t m_eeprom_index; DECLARE_READ8_MEMBER(hitpoker_vram_r); DECLARE_WRITE8_MEMBER(hitpoker_vram_w); @@ -84,7 +84,7 @@ public: DECLARE_WRITE8_MEMBER(hitpoker_pic_w); DECLARE_DRIVER_INIT(hitpoker); virtual void video_start() override; - UINT32 screen_update_hitpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hitpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(hitpoker_irq); required_device m_maincpu; required_device m_gfxdecode; @@ -96,12 +96,12 @@ public: void hitpoker_state::video_start() { - m_videoram = std::make_unique(0x35ff); - m_paletteram = std::make_unique(0x1000); - m_colorram = std::make_unique(0x2000); + m_videoram = std::make_unique(0x35ff); + m_paletteram = std::make_unique(0x1000); + m_colorram = std::make_unique(0x2000); } -UINT32 hitpoker_state::screen_update_hitpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hitpoker_state::screen_update_hitpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int count = 0; int y,x; @@ -129,7 +129,7 @@ UINT32 hitpoker_state::screen_update_hitpoker(screen_device &screen, bitmap_ind1 READ8_MEMBER(hitpoker_state::hitpoker_vram_r) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); if(m_pic_data & 0x10) return m_videoram[offset]; @@ -139,7 +139,7 @@ READ8_MEMBER(hitpoker_state::hitpoker_vram_r) WRITE8_MEMBER(hitpoker_state::hitpoker_vram_w) { -// UINT8 *ROM = memregion("maincpu")->base(); +// uint8_t *ROM = memregion("maincpu")->base(); // if(m_sys_regs[0x00] & 0x10) m_videoram[offset] = data; @@ -147,7 +147,7 @@ WRITE8_MEMBER(hitpoker_state::hitpoker_vram_w) READ8_MEMBER(hitpoker_state::hitpoker_cram_r) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); if(m_pic_data & 0x10) return m_colorram[offset]; @@ -162,7 +162,7 @@ WRITE8_MEMBER(hitpoker_state::hitpoker_cram_w) READ8_MEMBER(hitpoker_state::hitpoker_paletteram_r) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); if(m_pic_data & 0x10) return m_paletteram[offset]; @@ -502,7 +502,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(hitpoker_state,hitpoker) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // init nvram machine().device("nvram")->set_base(m_eeprom_data, sizeof(m_eeprom_data)); diff --git a/src/mame/drivers/hk68v10.cpp b/src/mame/drivers/hk68v10.cpp index 0020375ea63..849c0576f8c 100644 --- a/src/mame/drivers/hk68v10.cpp +++ b/src/mame/drivers/hk68v10.cpp @@ -214,8 +214,8 @@ required_device m_maincpu; required_device m_sccterm; // Pointer to System ROMs needed by bootvect_r and masking RAM buffer for post reset accesses - UINT16 *m_sysrom; - UINT16 m_sysram[4]; + uint16_t *m_sysrom; + uint16_t m_sysram[4]; }; static ADDRESS_MAP_START (hk68v10_mem, AS_PROGRAM, 16, hk68v10_state) @@ -244,7 +244,7 @@ void hk68v10_state::machine_start () LOG(("%s\n", FUNCNAME)); /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */ - m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0x0fc0000); + m_sysrom = (uint16_t*)(memregion ("maincpu")->base () + 0x0fc0000); } /* Support CPU resets @@ -259,7 +259,7 @@ void hk68v10_state::machine_reset () /* Reset pointer to bootvector in ROM for bootvector handler bootvect_r */ if (m_sysrom == &m_sysram[0]) /* Condition needed because memory map is not setup first time */ - m_sysrom = (UINT16*)(memregion ("maincpu")->base () + 0x0fc0000); + m_sysrom = (uint16_t*)(memregion ("maincpu")->base () + 0x0fc0000); } /* Boot vector handler, the PCB hardwires the first 8 bytes from 0xfc0000 to 0x0 at reset*/ @@ -285,7 +285,7 @@ WRITE16_MEMBER (hk68v10_state::bootvect_w){ /* Dummy VME access methods until the VME bus device is ready for use */ READ16_MEMBER (hk68v10_state::vme_a24_r){ LOG(("%s\n", FUNCNAME)); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (hk68v10_state::vme_a24_w){ @@ -294,7 +294,7 @@ WRITE16_MEMBER (hk68v10_state::vme_a24_w){ READ16_MEMBER (hk68v10_state::vme_a16_r){ LOG(("%s\n", FUNCNAME)); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (hk68v10_state::vme_a16_w){ diff --git a/src/mame/drivers/hnayayoi.cpp b/src/mame/drivers/hnayayoi.cpp index 39c2081a0bf..64bfd0edb22 100644 --- a/src/mame/drivers/hnayayoi.cpp +++ b/src/mame/drivers/hnayayoi.cpp @@ -651,7 +651,7 @@ ROM_END DRIVER_INIT_MEMBER(hnayayoi_state,hnfubuki) { - UINT8 *rom = memregion("gfx1")->base(); + uint8_t *rom = memregion("gfx1")->base(); int len = memregion("gfx1")->bytes(); int i, j; @@ -662,7 +662,7 @@ DRIVER_INIT_MEMBER(hnayayoi_state,hnfubuki) { for (j = 0; j < 0x10; j++) { - UINT8 t = rom[i + j + 0x10]; + uint8_t t = rom[i + j + 0x10]; rom[i + j + 0x10] = rom[i + j + 0x20]; rom[i + j + 0x20] = t; } diff --git a/src/mame/drivers/hng64.cpp b/src/mame/drivers/hng64.cpp index b5f013580ba..df56b07a5c4 100644 --- a/src/mame/drivers/hng64.cpp +++ b/src/mame/drivers/hng64.cpp @@ -505,7 +505,7 @@ READ8_MEMBER(hng64_state::hng64_com_share_r) READ32_MEMBER(hng64_state::hng64_sysregs_r) { - UINT16 rtc_addr; + uint16_t rtc_addr; #if 0 if((offset*4) != 0x1084) @@ -549,7 +549,7 @@ void hng64_state::do_dma(address_space &space) while (m_dma_len >= 0) { - UINT32 dat; + uint32_t dat; dat = space.read_dword(m_dma_start); space.write_dword(m_dma_dst, dat); @@ -686,7 +686,7 @@ READ32_MEMBER(hng64_state::shoot_io_r) } case 0x018: { - UINT8 p1_x, p1_y, p2_x, p2_y; + uint8_t p1_x, p1_y, p2_x, p2_y; p1_x = ioport("LIGHT_P1_X")->read() & 0xff; p1_y = ioport("LIGHT_P1_Y")->read() & 0xff; p2_x = ioport("LIGHT_P2_X")->read() & 0xff; @@ -696,7 +696,7 @@ READ32_MEMBER(hng64_state::shoot_io_r) } case 0x01c: { - UINT8 p3_x, p3_y; + uint8_t p3_x, p3_y; p3_x = ioport("LIGHT_P3_X")->read() & 0xff; p3_y = ioport("LIGHT_P3_Y")->read() & 0xff; @@ -728,7 +728,7 @@ READ32_MEMBER(hng64_state::racing_io_r) case 0x014: return ioport("VIEW")->read(); case 0x018: { - UINT8 handle, acc, brake; + uint8_t handle, acc, brake; handle = ioport("HANDLE")->read() & 0xff; acc = ioport("ACCELERATOR")->read() & 0xff; brake = ioport("BRAKE")->read() & 0xff; @@ -790,13 +790,13 @@ WRITE32_MEMBER(hng64_state::hng64_dualport_w) // Transition Control memory. WRITE32_MEMBER(hng64_state::tcram_w) { - UINT32 *hng64_tcram = m_tcram; + uint32_t *hng64_tcram = m_tcram; COMBINE_DATA (&hng64_tcram[offset]); if(offset == 0x02) { - UINT16 min_x, min_y, max_x, max_y; + uint16_t min_x, min_y, max_x, max_y; rectangle visarea = m_screen->visible_area(); min_x = (hng64_tcram[1] & 0xffff0000) >> 16; @@ -848,7 +848,7 @@ READ32_MEMBER(hng64_state::unk_vreg_r) /* The following is guesswork, needs confirmation with a test on the real board. */ WRITE32_MEMBER(hng64_state::hng64_sprite_clear_even_w) { - UINT32 spr_offs; + uint32_t spr_offs; spr_offs = (offset) * 0x10 * 4; @@ -870,7 +870,7 @@ WRITE32_MEMBER(hng64_state::hng64_sprite_clear_even_w) WRITE32_MEMBER(hng64_state::hng64_sprite_clear_odd_w) { - UINT32 spr_offs; + uint32_t spr_offs; spr_offs = (offset) * 0x10 * 4; @@ -1339,8 +1339,8 @@ static const gfx_layout hng64_16x16x8_spritelayout = 32*64 }; -static const UINT32 texlayout_xoffset[1024] = { STEP1024(0,8) }; -static const UINT32 texlayout_yoffset[512] = { STEP512(0,8192) }; +static const uint32_t texlayout_xoffset[1024] = { STEP1024(0,8) }; +static const uint32_t texlayout_yoffset[512] = { STEP512(0,8192) }; static const gfx_layout hng64_texlayout = { 1024, 512, @@ -1368,13 +1368,13 @@ static GFXDECODE_START( hng64 ) GFXDECODE_ENTRY( "textures", 0, hng64_texlayout, 0x0, 0x10 ) /* textures */ GFXDECODE_END -static void hng64_reorder( UINT8* gfxregion, size_t gfxregionsize) +static void hng64_reorder( uint8_t* gfxregion, size_t gfxregionsize) { // by default 2 4bpp tiles are stored in each 8bpp tile, this makes decoding in MAME harder than it needs to be // reorder them - UINT8 tilesize = 4*8; // 4 bytes per line, 8 lines + uint8_t tilesize = 4*8; // 4 bytes per line, 8 lines - std::vector buffer(gfxregionsize); + std::vector buffer(gfxregionsize); for (int i = 0; i < gfxregionsize/2; i += tilesize) { @@ -1393,11 +1393,11 @@ DRIVER_INIT_MEMBER(hng64_state,hng64_reorder_gfx) DRIVER_INIT_MEMBER(hng64_state,hng64) { /* 1 meg of virtual address space for the com cpu */ - m_com_virtual_mem = std::make_unique(0x100000); - m_com_op_base = std::make_unique(0x10000); + m_com_virtual_mem = std::make_unique(0x100000); + m_com_op_base = std::make_unique(0x10000); - m_soundram = std::make_unique(0x200000/2); - m_soundram2 = std::make_unique(0x200000/2); + m_soundram = std::make_unique(0x200000/2); + m_soundram2 = std::make_unique(0x200000/2); DRIVER_INIT_CALL(hng64_reorder_gfx); } @@ -1441,7 +1441,7 @@ DRIVER_INIT_MEMBER(hng64_state,hng64_shoot) DRIVER_INIT_CALL(hng64); } -void hng64_state::set_irq(UINT32 irq_vector) +void hng64_state::set_irq(uint32_t irq_vector) { /* TODO: @@ -1509,7 +1509,7 @@ void hng64_state::machine_start() m_maincpu->add_fastram(0x1fc00000, 0x1fc7ffff, TRUE, m_rombase); m_comm_rom = memregion("user2")->base(); - m_comm_ram = std::make_unique(0x10000); + m_comm_ram = std::make_unique(0x10000); for (int i = 0; i < 0x38 / 4; i++) { diff --git a/src/mame/drivers/homedata.cpp b/src/mame/drivers/homedata.cpp index de8133351ba..694efaeed71 100644 --- a/src/mame/drivers/homedata.cpp +++ b/src/mame/drivers/homedata.cpp @@ -1141,7 +1141,7 @@ MACHINE_START_MEMBER(homedata_state,homedata) MACHINE_START_MEMBER(homedata_state,reikaids) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0xc000], 0x4000); membank("bank2")->configure_entries(0, 4, memregion("audiocpu")->base(), 0x10000); @@ -1157,7 +1157,7 @@ MACHINE_START_MEMBER(homedata_state,reikaids) MACHINE_START_MEMBER(homedata_state,pteacher) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000); membank("bank2")->configure_entries(0, 4, memregion("audiocpu")->base(), 0x10000); diff --git a/src/mame/drivers/homelab.cpp b/src/mame/drivers/homelab.cpp index 2efc82859f4..da091d92203 100644 --- a/src/mame/drivers/homelab.cpp +++ b/src/mame/drivers/homelab.cpp @@ -62,8 +62,8 @@ public: DECLARE_WRITE8_MEMBER(brailab4_port7f_w); DECLARE_WRITE8_MEMBER(brailab4_portff_w); DECLARE_CUSTOM_INPUT_MEMBER(cass3_r); - const UINT8 *m_p_chargen; - const UINT8 *m_p_videoram; + const uint8_t *m_p_chargen; + const uint8_t *m_p_videoram; bool m_nmi; required_device m_maincpu; required_device m_dac; @@ -74,8 +74,8 @@ public: DECLARE_VIDEO_START(homelab3); DECLARE_MACHINE_RESET(brailab4); DECLARE_VIDEO_START(brailab4); - UINT32 screen_update_homelab2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_homelab3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_homelab2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_homelab3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(homelab_frame); DECLARE_QUICKLOAD_LOAD_MEMBER(homelab); }; @@ -94,7 +94,7 @@ READ8_MEMBER( homelab_state::key_r ) // offset 27F-2FE return 0; } - UINT8 i,data = 0xff; + uint8_t i,data = 0xff; char kbdrow[8]; for (i=0; i<8; i++) @@ -182,7 +182,7 @@ READ8_MEMBER( homelab_state::exxx_r ) } char kbdrow[8]; - UINT8 data = 0xff; + uint8_t data = 0xff; if (offset < 0x10) { sprintf(kbdrow,"X%X", offset); @@ -561,16 +561,16 @@ VIDEO_START_MEMBER(homelab_state,brailab4) m_p_videoram = memregion("maincpu")->base()+0x17800; } -UINT32 homelab_state::screen_update_homelab2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t homelab_state::screen_update_homelab2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for(y = 0; y < 25; y++ ) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 40; x++) { @@ -593,16 +593,16 @@ UINT32 homelab_state::screen_update_homelab2(screen_device &screen, bitmap_ind16 return 0; } -UINT32 homelab_state::screen_update_homelab3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t homelab_state::screen_update_homelab3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for(y = 0; y < 32; y++ ) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 64; x++) { @@ -647,13 +647,13 @@ QUICKLOAD_LOAD_MEMBER( homelab_state,homelab) { address_space &space = m_maincpu->space(AS_PROGRAM); int i=0; - UINT8 ch; - UINT16 quick_addr; - UINT16 quick_length; - UINT16 quick_end; - std::vector quick_data; + uint8_t ch; + uint16_t quick_addr; + uint16_t quick_length; + uint16_t quick_end; + std::vector quick_data; char pgmname[256]; - UINT16 args[2]; + uint16_t args[2]; int read_; quick_length = image.length(); @@ -833,7 +833,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(homelab_state,brailab4) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &RAM[0xf800], 0x8000); } diff --git a/src/mame/drivers/homerun.cpp b/src/mame/drivers/homerun.cpp index 4e12654178b..779a01e73ec 100644 --- a/src/mame/drivers/homerun.cpp +++ b/src/mame/drivers/homerun.cpp @@ -322,7 +322,7 @@ GFXDECODE_END void homerun_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entry(0, &ROM[0x00000]); membank("bank1")->configure_entries(1, 7, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/homez80.cpp b/src/mame/drivers/homez80.cpp index ea517b55d81..fdcb5341abb 100644 --- a/src/mame/drivers/homez80.cpp +++ b/src/mame/drivers/homez80.cpp @@ -35,12 +35,12 @@ public: required_device m_maincpu; DECLARE_READ8_MEMBER( homez80_keyboard_r ); - required_shared_ptr m_p_videoram; - UINT8* m_p_chargen; + required_shared_ptr m_p_videoram; + uint8_t* m_p_chargen; bool m_irq; virtual void machine_reset() override; virtual void video_start() override; - 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); INTERRUPT_GEN_MEMBER(homez80_interrupt); }; @@ -223,16 +223,16 @@ void homez80_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 homez80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t homez80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for (y = 0; y < 32; y++) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++, 44); + uint16_t *p = &bitmap.pix16(sy++, 44); for (x = ma; x < ma+32; x++) { diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp index b08482f3a8a..fd696f62d68 100644 --- a/src/mame/drivers/hornet.cpp +++ b/src/mame/drivers/hornet.cpp @@ -362,9 +362,9 @@ public: // TODO: Needs verification on real hardware static const int m_sound_timer_usec = 2800; - required_shared_ptr m_workram; - required_shared_ptr m_sharc_dataram0; - optional_shared_ptr m_sharc_dataram1; + required_shared_ptr m_workram; + required_shared_ptr m_sharc_dataram0; + optional_shared_ptr m_sharc_dataram1; required_device m_maincpu; required_device m_audiocpu; required_device m_k056800; @@ -378,19 +378,19 @@ public: optional_device m_lan_eeprom; required_ioport m_in0, m_in1, m_in2, m_dsw; optional_ioport m_eepromout, m_analog1, m_analog2; - optional_region_ptr m_user3_ptr; - optional_region_ptr m_user5_ptr; + optional_region_ptr m_user3_ptr; + optional_region_ptr m_user5_ptr; optional_device m_lan_ds2401; required_device m_watchdog; emu_timer *m_sound_irq_timer; - UINT8 m_led_reg0; - UINT8 m_led_reg1; - std::unique_ptr m_jvs_sdata; - UINT32 m_jvs_sdata_ptr; - UINT16 m_gn680_latch; - UINT16 m_gn680_ret0; - UINT16 m_gn680_ret1; + uint8_t m_led_reg0; + uint8_t m_led_reg1; + std::unique_ptr m_jvs_sdata; + uint32_t m_jvs_sdata_ptr; + uint16_t m_gn680_latch; + uint16_t m_gn680_ret0; + uint16_t m_gn680_ret1; DECLARE_READ32_MEMBER(hornet_k037122_sram_r); DECLARE_WRITE32_MEMBER(hornet_k037122_sram_w); @@ -429,11 +429,11 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_MACHINE_RESET(hornet_2board); - UINT32 screen_update_hornet(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hornet_2board(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hornet(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hornet_2board(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(sound_irq); - int jvs_encode_data(UINT8 *in, int length); - int jvs_decode_data(UINT8 *in, UINT8 *out, int length); + int jvs_encode_data(uint8_t *in, int length); + int jvs_decode_data(uint8_t *in, uint8_t *out, int length); void jamma_jvs_cmd_exec(); }; @@ -486,7 +486,7 @@ WRITE_LINE_MEMBER(hornet_state::voodoo_vblank_1) { } -UINT32 hornet_state::screen_update_hornet(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hornet_state::screen_update_hornet(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { voodoo_device* voodoo = (voodoo_device*)machine().device("voodoo0"); @@ -499,7 +499,7 @@ UINT32 hornet_state::screen_update_hornet(screen_device &screen, bitmap_rgb32 &b return 0; } -UINT32 hornet_state::screen_update_hornet_2board(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hornet_state::screen_update_hornet_2board(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (strcmp(screen.tag(), ":lscreen") == 0) { @@ -527,7 +527,7 @@ UINT32 hornet_state::screen_update_hornet_2board(screen_device &screen, bitmap_r READ8_MEMBER(hornet_state::sysreg_r) { - UINT8 r = 0; + uint8_t r = 0; switch (offset) { @@ -655,7 +655,7 @@ WRITE8_MEMBER(hornet_state::sysreg_w) READ8_MEMBER(hornet_state::comm_eeprom_r) { - UINT8 r = 0; + uint8_t r = 0; r |= (m_lan_eeprom->do_read() & 1) << 1; r |= m_lan_ds2401->read() & 1; return r; @@ -675,7 +675,7 @@ WRITE32_MEMBER(hornet_state::comm1_w) WRITE32_MEMBER(hornet_state::comm_rombank_w) { int bank = data >> 24; - UINT8 *usr3 = memregion("user3")->base(); + uint8_t *usr3 = memregion("user3")->base(); if (usr3 != nullptr) membank("bank1")->set_entry(bank & 0x7f); } @@ -953,7 +953,7 @@ INPUT_PORTS_END void hornet_state::machine_start() { m_jvs_sdata_ptr = 0; - m_jvs_sdata = make_unique_clear(1024); + m_jvs_sdata = make_unique_clear(1024); /* set conservative DRC options */ m_maincpu->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS); @@ -974,7 +974,7 @@ void hornet_state::machine_reset() memory_region* comm_region = memregion("user3"); if (comm_region != nullptr) { - UINT8* comm_rom = comm_region->base(); + uint8_t* comm_rom = comm_region->base(); membank("bank1")->configure_entries(0, comm_region->bytes() / 0x10000, comm_rom, 0x10000); membank("bank1")->set_entry(0); } @@ -1165,14 +1165,14 @@ WRITE8_MEMBER(hornet_state::jamma_jvs_w) jamma_jvs_cmd_exec(); } -int hornet_state::jvs_encode_data(UINT8 *in, int length) +int hornet_state::jvs_encode_data(uint8_t *in, int length) { int inptr = 0; int sum = 0; while (inptr < length) { - UINT8 b = in[inptr++]; + uint8_t b = in[inptr++]; if (b == 0xe0) { sum += 0xd0 + 0xdf; @@ -1194,17 +1194,17 @@ int hornet_state::jvs_encode_data(UINT8 *in, int length) return sum; } -int hornet_state::jvs_decode_data(UINT8 *in, UINT8 *out, int length) +int hornet_state::jvs_decode_data(uint8_t *in, uint8_t *out, int length) { int outptr = 0; int inptr = 0; while (inptr < length) { - UINT8 b = in[inptr++]; + uint8_t b = in[inptr++]; if (b == 0xd0) { - UINT8 b2 = in[inptr++]; + uint8_t b2 = in[inptr++]; out[outptr++] = b2 + 1; } else @@ -1218,8 +1218,8 @@ int hornet_state::jvs_decode_data(UINT8 *in, UINT8 *out, int length) void hornet_state::jamma_jvs_cmd_exec() { - UINT8 byte_num; - UINT8 data[1024], rdata[1024]; + uint8_t byte_num; + uint8_t data[1024], rdata[1024]; #if 0 int length; #endif diff --git a/src/mame/drivers/hotblock.cpp b/src/mame/drivers/hotblock.cpp index e6fd43c2d78..776c2635caf 100644 --- a/src/mame/drivers/hotblock.cpp +++ b/src/mame/drivers/hotblock.cpp @@ -56,14 +56,14 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_vram; + required_shared_ptr m_vram; /* misc */ int m_port0; int m_port4; /* memory */ - UINT8 m_pal[0x10000]; + uint8_t m_pal[0x10000]; DECLARE_READ8_MEMBER(video_read); DECLARE_READ8_MEMBER(port4_r); @@ -73,7 +73,7 @@ public: virtual void video_start() override; - 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); }; @@ -151,7 +151,7 @@ void hotblock_state::video_start() save_item(NAME(m_port4)); //stored but not read for now } -UINT32 hotblock_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hotblock_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y, x, count; int i; diff --git a/src/mame/drivers/hotstuff.cpp b/src/mame/drivers/hotstuff.cpp index ac5d14e0366..3819bf68296 100644 --- a/src/mame/drivers/hotstuff.cpp +++ b/src/mame/drivers/hotstuff.cpp @@ -14,17 +14,17 @@ public: m_bitmapram(*this, "bitmapram"), m_maincpu(*this, "maincpu") { } - required_shared_ptr m_bitmapram; + required_shared_ptr m_bitmapram; struct { - UINT8 index; + uint8_t index; }m_ioboard; DECLARE_READ8_MEMBER(ioboard_status_r); DECLARE_READ8_MEMBER(ioboard_unk_r); DECLARE_WRITE8_MEMBER(ioboard_data_w); DECLARE_WRITE8_MEMBER(ioboard_reg_w); virtual void video_start() override; - UINT32 screen_update_hotstuff(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hotstuff(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -35,10 +35,10 @@ void hotstuff_state::video_start() /* the first 0x20 bytes in every 0x200 (each line) of video ram are the colour data, providing a palette of 16 RGB444 colours for that line */ -UINT32 hotstuff_state::screen_update_hotstuff(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hotstuff_state::screen_update_hotstuff(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int count, y,yyy,x,xxx; - UINT16 row_palette_data[0x10]; + uint16_t row_palette_data[0x10]; rgb_t row_palette_data_as_rgb32_pen_data[0x10]; yyy=512;xxx=512*2; @@ -79,7 +79,7 @@ UINT32 hotstuff_state::screen_update_hotstuff(screen_device &screen, bitmap_rgb3 /* TODO: identify this ... */ READ8_MEMBER(hotstuff_state::ioboard_status_r) { - UINT8 res; + uint8_t res; printf("STATUS R\n"); diff --git a/src/mame/drivers/hp16500.cpp b/src/mame/drivers/hp16500.cpp index d1783557ad7..4cbe85a3f35 100644 --- a/src/mame/drivers/hp16500.cpp +++ b/src/mame/drivers/hp16500.cpp @@ -66,13 +66,13 @@ public: { } virtual void video_start() override; - UINT32 screen_update_hp16500(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hp16500a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hp16500(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hp16500a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; - std::vector m_vram; + std::vector m_vram; - UINT8 m_mask, m_val; + uint8_t m_mask, m_val; DECLARE_WRITE32_MEMBER(palette_w); @@ -99,7 +99,7 @@ public: INTERRUPT_GEN_MEMBER(vblank); private: - UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs; + uint32_t m_palette[256], m_colors[3], m_count, m_clutoffs; }; READ32_MEMBER(hp16500_state::vbl_state_r) @@ -133,7 +133,7 @@ WRITE_LINE_MEMBER( hp16500_state::vsync_changed ) MC6845_UPDATE_ROW( hp16500_state::crtc_update_row ) { - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); int i, pos; pos = y * 144; @@ -155,7 +155,7 @@ MC6845_UPDATE_ROW( hp16500_state::crtc_update_row ) MC6845_UPDATE_ROW( hp16500_state::crtc_update_row_1650 ) { - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); int i, pos; pos = y * 148; @@ -279,7 +279,7 @@ static ADDRESS_MAP_START(hp16500a_map, AS_PROGRAM, 16, hp16500_state) AM_RANGE(0x980000, 0xa7ffff) AM_RAM ADDRESS_MAP_END -UINT32 hp16500_state::screen_update_hp16500a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hp16500_state::screen_update_hp16500a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } @@ -375,12 +375,12 @@ WRITE32_MEMBER(hp16500_state::palette_w) // 4 bpp // addr = ((Y * 0xfc0) + 0x360) + (X * 4) -UINT32 hp16500_state::screen_update_hp16500(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hp16500_state::screen_update_hp16500(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int pos = 0; for (int y = 0; y < 384; y++) { - UINT32 *scanline = &bitmap.pix32(y); + uint32_t *scanline = &bitmap.pix32(y); for (int x = 0; x < 576; x+=4) { diff --git a/src/mame/drivers/hp49gp.cpp b/src/mame/drivers/hp49gp.cpp index fcadcfa0f87..64b00197328 100644 --- a/src/mame/drivers/hp49gp.cpp +++ b/src/mame/drivers/hp49gp.cpp @@ -18,7 +18,7 @@ struct lcd_spi_t int l1; int data; int l3; - UINT32 shift, bits; + uint32_t shift, bits; }; class hp49gp_state : public driver_device @@ -30,9 +30,9 @@ public: m_steppingstone(*this, "steppingstone"), m_maincpu(*this, "maincpu") { } - UINT32 m_port[9]; + uint32_t m_port[9]; required_device m_s3c2410; - required_shared_ptr m_steppingstone; + required_shared_ptr m_steppingstone; lcd_spi_t m_lcd_spi; DECLARE_DRIVER_INIT(hp49gp); virtual void machine_start() override; @@ -171,7 +171,7 @@ int hp49gp_state::lcd_spi_line_r( int line) READ32_MEMBER(hp49gp_state::s3c2410_gpio_port_r) { - UINT32 data = m_port[offset]; + uint32_t data = m_port[offset]; switch (offset) { case S3C2410_GPIO_PORT_C : @@ -270,7 +270,7 @@ ADDRESS_MAP_END DRIVER_INIT_MEMBER(hp49gp_state,hp49gp) { - UINT8 *rom = (UINT8 *)memregion( "maincpu")->base(); + uint8_t *rom = (uint8_t *)memregion( "maincpu")->base(); memcpy( m_steppingstone, rom, 1024); lcd_spi_init(); } diff --git a/src/mame/drivers/hp64k.cpp b/src/mame/drivers/hp64k.cpp index d23e5525066..6afc13f6f5f 100644 --- a/src/mame/drivers/hp64k.cpp +++ b/src/mame/drivers/hp64k.cpp @@ -176,7 +176,7 @@ public: virtual void video_start() override; virtual void machine_reset() override; - UINT8 hp64k_crtc_filter(UINT8 data); + uint8_t hp64k_crtc_filter(uint8_t data); DECLARE_WRITE16_MEMBER(hp64k_crtc_w); DECLARE_WRITE_LINE_MEMBER(hp64k_crtc_drq_w); DECLARE_WRITE_LINE_MEMBER(hp64k_crtc_vrtc_w); @@ -252,33 +252,33 @@ private: required_device m_rs232; // Character generator - const UINT8 *m_chargen; + const uint8_t *m_chargen; - UINT32 m_crtc_ptr; + uint32_t m_crtc_ptr; bool m_crtc_drq; bool m_vrtc; // Interrupt handling - UINT8 m_irl_mask; - UINT8 m_irl_pending; + uint8_t m_irl_mask; + uint8_t m_irl_pending; // State of keyboard ioport_value m_kb_state[ 4 ]; - UINT8 m_kb_row_col; + uint8_t m_kb_row_col; bool m_kb_scan_on; bool m_kb_pressed; // Slot selection - std::vector m_low32k_ram; - UINT8 m_slot_select; - UINT8 m_slot_map; + std::vector m_low32k_ram; + uint8_t m_slot_select; + uint8_t m_slot_map; // Floppy I/F - UINT8 m_floppy_in_latch_msb; // U23 - UINT8 m_floppy_in_latch_lsb; // U38 - UINT8 m_floppy_out_latch_msb; // U22 - UINT8 m_floppy_out_latch_lsb; // U37 - UINT8 m_floppy_if_ctrl; // U24 + uint8_t m_floppy_in_latch_msb; // U23 + uint8_t m_floppy_in_latch_lsb; // U38 + uint8_t m_floppy_out_latch_msb; // U22 + uint8_t m_floppy_out_latch_lsb; // U37 + uint8_t m_floppy_if_ctrl; // U24 bool m_floppy_dmaen; bool m_floppy_dmai; bool m_floppy_mdci; @@ -286,8 +286,8 @@ private: bool m_floppy_drq; bool m_floppy0_wpt; bool m_floppy1_wpt; - UINT8 m_floppy_drv_ctrl; // U39 - UINT8 m_floppy_status; // U25 + uint8_t m_floppy_drv_ctrl; // U39 + uint8_t m_floppy_status; // U25 typedef enum { HP64K_FLPST_IDLE, @@ -303,7 +303,7 @@ private: // RS232 I/F bool m_16x_clk; bool m_baud_clk; - UINT8 m_16x_div; + uint8_t m_16x_div; bool m_loopback; bool m_txd_state; bool m_dtr_state; @@ -415,7 +415,7 @@ void hp64k_state::machine_reset() } -UINT8 hp64k_state::hp64k_crtc_filter(UINT8 data) +uint8_t hp64k_state::hp64k_crtc_filter(uint8_t data) { bool inv = (data & 0xe0) == 0xe0; @@ -424,7 +424,7 @@ UINT8 hp64k_state::hp64k_crtc_filter(UINT8 data) WRITE16_MEMBER(hp64k_state::hp64k_crtc_w) { - m_crtc->write(space , offset == 0 , hp64k_crtc_filter((UINT8)data)); + m_crtc->write(space , offset == 0 , hp64k_crtc_filter((uint8_t)data)); } WRITE_LINE_MEMBER(hp64k_state::hp64k_crtc_drq_w) @@ -436,7 +436,7 @@ WRITE_LINE_MEMBER(hp64k_state::hp64k_crtc_drq_w) if (!prev_crtc && crtc_drq) { address_space& prog_space = m_cpu->space(AS_PROGRAM); - UINT8 data = prog_space.read_byte(m_crtc_ptr); + uint8_t data = prog_space.read_byte(m_crtc_ptr); m_crtc_ptr++; m_crtc->dack_w(prog_space , 0 , hp64k_crtc_filter(data)); @@ -456,9 +456,9 @@ WRITE_LINE_MEMBER(hp64k_state::hp64k_crtc_vrtc_w) I8275_DRAW_CHARACTER_MEMBER(hp64k_state::crtc_display_pixels) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chargen_byte = m_chargen[ linecount | ((unsigned)charcode << 4) ]; + uint8_t chargen_byte = m_chargen[ linecount | ((unsigned)charcode << 4) ]; bool lvid , livid; - UINT16 pixels_lvid , pixels_livid; + uint16_t pixels_lvid , pixels_livid; unsigned i; if (vsp) { @@ -472,9 +472,9 @@ I8275_DRAW_CHARACTER_MEMBER(hp64k_state::crtc_display_pixels) } } else if (rvv) { pixels_lvid = ~0; - pixels_livid = (UINT16)chargen_byte << 1; + pixels_livid = (uint16_t)chargen_byte << 1; } else { - pixels_lvid = ~((UINT16)chargen_byte << 1); + pixels_lvid = ~((uint16_t)chargen_byte << 1); pixels_livid = ~0; } @@ -517,7 +517,7 @@ void hp64k_state::hp64k_update_irl(void) WRITE16_MEMBER(hp64k_state::hp64k_irl_mask_w) { - m_irl_mask = (UINT8)data; + m_irl_mask = (uint8_t)data; hp64k_update_irl(); } @@ -555,7 +555,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(hp64k_state::hp64k_kb_scan) READ16_MEMBER(hp64k_state::hp64k_kb_r) { - UINT16 ret = 0xff00 | m_kb_row_col; + uint16_t ret = 0xff00 | m_kb_row_col; if (m_kb_pressed) { BIT_SET(ret , 7); @@ -628,8 +628,8 @@ WRITE16_MEMBER(hp64k_state::hp64k_slot_w) WRITE16_MEMBER(hp64k_state::hp64k_slot_sel_w) { - m_slot_map = (UINT8)offset; - m_slot_select = (UINT8)((data >> 8) & 0x3f); + m_slot_map = (uint8_t)offset; + m_slot_select = (uint8_t)((data >> 8) & 0x3f); } READ16_MEMBER(hp64k_state::hp64k_flp_r) @@ -669,7 +669,7 @@ READ16_MEMBER(hp64k_state::hp64k_flp_r) hp64k_update_floppy_irq(); - return ((UINT16)m_floppy_out_latch_msb << 8) | (UINT16)m_floppy_out_latch_lsb; + return ((uint16_t)m_floppy_out_latch_msb << 8) | (uint16_t)m_floppy_out_latch_lsb; } WRITE16_MEMBER(hp64k_state::hp64k_flp_w) @@ -680,8 +680,8 @@ WRITE16_MEMBER(hp64k_state::hp64k_flp_w) return; } - m_floppy_in_latch_msb = (UINT8)(data >> 8); - m_floppy_in_latch_lsb = (UINT8)data; + m_floppy_in_latch_msb = (uint8_t)(data >> 8); + m_floppy_in_latch_lsb = (uint8_t)data; switch (offset) { case 0: @@ -936,7 +936,7 @@ void hp64k_state::hp64k_floppy_wpt_cb(floppy_image_device *floppy , int state) READ16_MEMBER(hp64k_state::hp64k_usart_r) { - UINT16 tmp; + uint16_t tmp; if ((offset & 1) == 0) { tmp = m_uart->status_r(space , 0); @@ -958,9 +958,9 @@ READ16_MEMBER(hp64k_state::hp64k_usart_r) WRITE16_MEMBER(hp64k_state::hp64k_usart_w) { if ((offset & 1) == 0) { - m_uart->control_w(space , 0 , (UINT8)(data & 0xff)); + m_uart->control_w(space , 0 , (uint8_t)(data & 0xff)); } else { - m_uart->data_w(space , 0 , (UINT8)(data & 0xff)); + m_uart->data_w(space , 0 , (uint8_t)(data & 0xff)); } } diff --git a/src/mame/drivers/hp9845.cpp b/src/mame/drivers/hp9845.cpp index c93fac46164..95dc9c23992 100644 --- a/src/mame/drivers/hp9845.cpp +++ b/src/mame/drivers/hp9845.cpp @@ -89,13 +89,13 @@ public: driver_device(mconfig, type, tag) { } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; static INPUT_PORTS_START( hp9845 ) INPUT_PORTS_END -UINT32 hp9845_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hp9845_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } @@ -262,7 +262,7 @@ hp9845b_state::hp9845b_state(const machine_config &mconfig, device_type type, co { } -UINT32 hp9845b_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hp9845b_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_graphic_sel) { copybitmap(bitmap, m_bitmap, 0, 0, GVIDEO_HBEND, GVIDEO_VBEND, cliprect); @@ -325,7 +325,7 @@ void hp9845b_state::machine_reset() logerror("STS=%04x FLG=%04x\n" , m_sts_status , m_flg_status); } -void hp9845b_state::set_video_mar(UINT16 mar) +void hp9845b_state::set_video_mar(uint16_t mar) { m_video_mar = (mar & 0xfff) | VIDEO_BUFFER_BASE; } @@ -334,7 +334,7 @@ void hp9845b_state::video_fill_buff(bool buff_idx) { unsigned char_idx = 0; unsigned iters = 0; - UINT8 byte; + uint8_t byte; address_space& prog_space = m_ppu->space(AS_PROGRAM); m_video_buff[ buff_idx ].full = false; @@ -358,12 +358,12 @@ void hp9845b_state::video_fill_buff(bool buff_idx) } else { // Read normal word from frame buffer, start parsing at MSB set_video_mar(m_video_mar + 1); - byte = (UINT8)(m_video_word >> 8); + byte = (uint8_t)(m_video_word >> 8); m_video_byte_idx = true; } } else { // Parse LSB - byte = (UINT8)(m_video_word & 0xff); + byte = (uint8_t)(m_video_word & 0xff); m_video_byte_idx = false; } if ((byte & 0xc0) == 0x80) { @@ -414,10 +414,10 @@ void hp9845b_state::video_render_buff(unsigned video_scanline , unsigned line_in bool char_blink = BIT(video_frame , 4); for (unsigned i = 0; i < 80; i++) { - UINT8 charcode = m_video_buff[ buff_idx ].chars[ i ]; - UINT8 attrs = m_video_buff[ buff_idx ].attrs[ i ]; - UINT16 chrgen_addr = ((UINT16)(charcode ^ 0x7f) << 4) | line_in_row; - UINT16 pixels; + uint8_t charcode = m_video_buff[ buff_idx ].chars[ i ]; + uint8_t attrs = m_video_buff[ buff_idx ].attrs[ i ]; + uint16_t chrgen_addr = ((uint16_t)(charcode ^ 0x7f) << 4) | line_in_row; + uint16_t pixels; if ((ul_line && BIT(attrs , 3)) || (cursor_line && cursor_blink && BIT(attrs , 0))) { @@ -425,9 +425,9 @@ void hp9845b_state::video_render_buff(unsigned video_scanline , unsigned line_in } else if (char_blink && BIT(attrs , 2)) { pixels = 0; } else if (BIT(attrs , 4)) { - pixels = (UINT16)(m_optional_chargen[ chrgen_addr ] & 0x7f) << 1; + pixels = (uint16_t)(m_optional_chargen[ chrgen_addr ] & 0x7f) << 1; } else { - pixels = (UINT16)(m_chargen[ chrgen_addr ] & 0x7f) << 1; + pixels = (uint16_t)(m_chargen[ chrgen_addr ] & 0x7f) << 1; } if (BIT(attrs , 1)) { @@ -502,7 +502,7 @@ void hp9845b_state::set_graphic_mode(bool graphic) READ16_MEMBER(hp9845b_state::graphic_r) { - UINT16 res = 0; + uint16_t res = 0; switch (offset) { case 0: @@ -553,7 +553,7 @@ WRITE16_MEMBER(hp9845b_state::graphic_w) case 1: // R5: command register - m_gv_cmd = (UINT8)(data & 0xf); + m_gv_cmd = (uint8_t)(data & 0xf); if (BIT(data , 5)) { m_gv_fsm_state = GV_STAT_RESET; } @@ -714,7 +714,7 @@ void hp9845b_state::advance_gv_fsm(bool ds , bool trigger) if (time_mem_av.is_zero()) { // Write a single pixel to graphic memory //logerror("wr gv pixel @%04x:%x = %d\n" , m_gv_io_counter , m_gv_data_w & 0xf , BIT(m_gv_data_w , 15)); - UINT16 mask = 0x8000 >> (m_gv_data_w & 0xf); + uint16_t mask = 0x8000 >> (m_gv_data_w & 0xf); if (BIT(m_gv_data_w , 15)) { // Set pixel m_graphic_mem[ m_gv_io_counter ] |= mask; @@ -780,9 +780,9 @@ void hp9845b_state::graphic_video_render(unsigned video_scanline) unsigned mem_idx = 36 * (video_scanline - GVIDEO_VBEND); for (unsigned i = 0; i < GVIDEO_HPIXELS; i += 16) { - UINT16 word = m_graphic_mem[ mem_idx++ ]; + uint16_t word = m_graphic_mem[ mem_idx++ ]; unsigned x = i; - for (UINT16 mask = 0x8000; mask != 0; mask >>= 1) { + for (uint16_t mask = 0x8000; mask != 0; mask >>= 1) { unsigned cnt_h = x + GVIDEO_HBEND + GVIDEO_HCNT_OFF; bool xc = cnt_h == (m_gv_cursor_x + 6); bool xw = m_gv_cursor_fs || (cnt_h >= (m_gv_cursor_x + 2) && cnt_h <= (m_gv_cursor_x + 10)); @@ -816,7 +816,7 @@ void hp9845b_state::update_irq(void) m_ppu->set_input_line(HPHYBRID_IRH , m_irh_pending != 0); } -void hp9845b_state::irq_w(UINT8 sc , int state) +void hp9845b_state::irq_w(uint8_t sc , int state) { unsigned bit_n = sc % 8; @@ -844,7 +844,7 @@ void hp9845b_state::update_flg_sts(void) m_ppu->flag_w(flg); } -void hp9845b_state::sts_w(UINT8 sc , int state) +void hp9845b_state::sts_w(uint8_t sc , int state) { if (state) { BIT_SET(m_sts_status, sc); @@ -856,7 +856,7 @@ void hp9845b_state::sts_w(UINT8 sc , int state) } } -void hp9845b_state::flg_w(UINT8 sc , int state) +void hp9845b_state::flg_w(uint8_t sc , int state) { if (state) { BIT_SET(m_flg_status, sc); @@ -868,7 +868,7 @@ void hp9845b_state::flg_w(UINT8 sc , int state) } } -void hp9845b_state::install_readwrite_handler(UINT8 sc , read16_delegate rhandler, write16_delegate whandler) +void hp9845b_state::install_readwrite_handler(uint8_t sc , read16_delegate rhandler, write16_delegate whandler) { // Install r/w handlers to cover all I/O addresses of PPU belonging to "sc" select code m_ppu->space(AS_IO).install_readwrite_handler(sc * 4 , sc * 4 + 3 , rhandler , whandler); diff --git a/src/mame/drivers/hp9k.cpp b/src/mame/drivers/hp9k.cpp index 13972ae06b5..a60d7f00fad 100644 --- a/src/mame/drivers/hp9k.cpp +++ b/src/mame/drivers/hp9k.cpp @@ -50,7 +50,7 @@ TODO: boot tests fail // -static UINT8 prom16a[256] = { +static uint8_t prom16a[256] = { 0x00,0x00, // checksum 0x00, // 256 bytes idprom '2', '0', '1', '0', 'A', '0', '0', '0', '0', '0', '0', // serial in ascii DDDDCSSSSSS date code, country, serial number @@ -116,8 +116,8 @@ private: int crtc_addrStartHi; int crtc_addrStartLow; - void calc_prom_crc(UINT8* prom); - void putChar(UINT8 thec,int x,int y,bitmap_ind16 &bitmap); + void calc_prom_crc(uint8_t* prom); + void putChar(uint8_t thec,int x,int y,bitmap_ind16 &bitmap); public: hp9k_state(const machine_config &mconfig, device_type type, const char *tag) @@ -134,14 +134,14 @@ public: calc_prom_crc(prom16a); } - UINT8 kbdBit; + uint8_t kbdBit; required_device m_maincpu; //required_device<> m_terminal; required_device m_6845; - UINT8 m_videoram[0x4000]; - UINT8 m_screenram[0x800]; + uint8_t m_videoram[0x4000]; + uint8_t m_screenram[0x800]; DECLARE_DRIVER_INIT(hp9k); @@ -162,14 +162,14 @@ public: DECLARE_WRITE8_MEMBER(kbd_put); - 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); required_device m_gfxdecode; }; // -void hp9k_state::calc_prom_crc(UINT8* prom) +void hp9k_state::calc_prom_crc(uint8_t* prom) { int chksum; int i; @@ -187,8 +187,8 @@ void hp9k_state::calc_prom_crc(UINT8* prom) if (chksum!=0) { chksum=(0x10000-chksum); - prom[0]=(UINT8)(chksum>>8); - prom[1]=(UINT8)(chksum&0xff); + prom[0]=(uint8_t)(chksum>>8); + prom[1]=(uint8_t)(chksum&0xff); } } @@ -279,7 +279,7 @@ WRITE16_MEMBER( hp9k_state::hp9k_videoram_w ) m_screenram[offset&0x7ff]=data>>8; m_videoram[offset&0x3fff]=data>>8; - //UINT8 *rom = machine().region("bootrom")->base(); + //uint8_t *rom = machine().region("bootrom")->base(); //rom[0x90B]=0x00; } else @@ -348,23 +348,23 @@ static GFXDECODE_START( hp9k ) GFXDECODE_ENTRY( "bootrom", 0x2000, hp9k_charlayout, 0, 1 ) GFXDECODE_END -void hp9k_state::putChar(UINT8 thec,int x,int y,bitmap_ind16 &bitmap) +void hp9k_state::putChar(uint8_t thec,int x,int y,bitmap_ind16 &bitmap) { - const UINT8* pchar=m_gfxdecode->gfx(0)->get_data(thec); + const uint8_t* pchar=m_gfxdecode->gfx(0)->get_data(thec); for (int py=0;py m_maincpu; virtual void machine_reset() override; - optional_shared_ptr m_vram16; - optional_shared_ptr m_vram; + optional_shared_ptr m_vram16; + optional_shared_ptr m_vram; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 hp98544_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 hp98544_16_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t hp98544_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t hp98544_16_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER(buserror16_r); DECLARE_WRITE16_MEMBER(buserror16_w); @@ -81,15 +81,15 @@ public: private: bool m_in_buserr; - UINT32 m_last_buserr_pc; + uint32_t m_last_buserr_pc; }; -UINT32 hp9k3xx_state::hp98544_16_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hp9k3xx_state::hp98544_16_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT16 pixels; - UINT32 m_palette[2] = { 0x00000000, 0xffffffff }; + uint16_t pixels; + uint32_t m_palette[2] = { 0x00000000, 0xffffffff }; for (y = 0; y < 768; y++) { @@ -106,12 +106,12 @@ UINT32 hp9k3xx_state::hp98544_16_update(screen_device &screen, bitmap_rgb32 &bit return 0; } -UINT32 hp9k3xx_state::hp98544_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hp9k3xx_state::hp98544_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT32 pixels; - UINT32 m_palette[2] = { 0x00000000, 0xffffffff }; + uint32_t pixels; + uint32_t m_palette[2] = { 0x00000000, 0xffffffff }; for (y = 0; y < 768; y++) { @@ -200,7 +200,7 @@ static ADDRESS_MAP_START(hp9k382_map, AS_PROGRAM, 32, hp9k3xx_state) AM_IMPORT_FROM(hp9k3xx_common) ADDRESS_MAP_END -UINT32 hp9k3xx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hp9k3xx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/hp_ipc.cpp b/src/mame/drivers/hp_ipc.cpp index 1eddffdf46f..e59559cb791 100644 --- a/src/mame/drivers/hp_ipc.cpp +++ b/src/mame/drivers/hp_ipc.cpp @@ -280,10 +280,10 @@ public: private: required_device m_maincpu; - UINT32 m_mmu[4]; - UINT16 m_internal_ram[0x40000]; + uint32_t m_mmu[4]; + uint16_t m_internal_ram[0x40000]; - inline UINT32 get_ram_address(offs_t offset) { return (m_mmu[(m_maincpu->get_fc() >> 1) & 3] + offset) & 0x3FFFFF; } + inline uint32_t get_ram_address(offs_t offset) { return (m_mmu[(m_maincpu->get_fc() >> 1) & 3] + offset) & 0x3FFFFF; } }; @@ -307,7 +307,7 @@ WRITE16_MEMBER(hp_ipc_state::mmu_w) READ16_MEMBER(hp_ipc_state::ram_r) { - UINT32 ram_address = get_ram_address(offset); + uint32_t ram_address = get_ram_address(offset); //logerror("RAM read, offset = %08x, ram address = %08X\n", offset, ram_address); @@ -326,7 +326,7 @@ READ16_MEMBER(hp_ipc_state::ram_r) WRITE16_MEMBER(hp_ipc_state::ram_w) { - UINT32 ram_address = get_ram_address(offset); + uint32_t ram_address = get_ram_address(offset); //logerror("RAM write, offset = %08x, ram address = %08X, data = %04x\n", offset, ram_address, data); diff --git a/src/mame/drivers/hprot1.cpp b/src/mame/drivers/hprot1.cpp index 479b5b3ab2b..292f009cbf4 100644 --- a/src/mame/drivers/hprot1.cpp +++ b/src/mame/drivers/hprot1.cpp @@ -91,8 +91,8 @@ ADDRESS_MAP_END DRIVER_INIT_MEMBER( hprot1_state, hprot1 ) { int i; - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 bitswapped_ROM[0x10000]; + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t bitswapped_ROM[0x10000]; for(i=0x0000;i<0x10000;i++) bitswapped_ROM[i] = ROM[i]; @@ -195,7 +195,7 @@ READ8_MEMBER(hprot1_state::henry_io_r) { case 0x01: { - UINT8 value = ioport("inputs")->read(); + uint8_t value = ioport("inputs")->read(); #if LOG_IO_PORTS printf("value:%02X\n", value); #endif @@ -212,7 +212,7 @@ READ8_MEMBER(hprot1_state::henry_io_r) /* WRITE8_MEMBER(hprot1_state::henry_io_w) { - static UINT8 p0=0, p1=0, p2=0, p3=0; + static uint8_t p0=0, p1=0, p2=0, p3=0; switch (offset) { case 0x00: diff --git a/src/mame/drivers/hpz80unk.cpp b/src/mame/drivers/hpz80unk.cpp index db39fbcc6d6..c84bcaa369f 100644 --- a/src/mame/drivers/hpz80unk.cpp +++ b/src/mame/drivers/hpz80unk.cpp @@ -56,9 +56,9 @@ public: DECLARE_READ8_MEMBER(port04_r); DECLARE_READ8_MEMBER(portfc_r); DECLARE_WRITE8_MEMBER(kbd_put); - required_shared_ptr m_p_rom; - UINT8 m_term_data; - UINT8 m_port02_data; + required_shared_ptr m_p_rom; + uint8_t m_term_data; + uint8_t m_port02_data; virtual void machine_reset() override; }; @@ -75,7 +75,7 @@ READ8_MEMBER( hpz80unk_state::port03_r ) READ8_MEMBER( hpz80unk_state::port04_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -108,8 +108,8 @@ INPUT_PORTS_END void hpz80unk_state::machine_reset() { - UINT8* user1 = memregion("user1")->base(); - memcpy((UINT8*)m_p_rom, user1, 0x4000); + uint8_t* user1 = memregion("user1")->base(); + memcpy((uint8_t*)m_p_rom, user1, 0x4000); // this should be rom/ram banking } diff --git a/src/mame/drivers/hshavoc.cpp b/src/mame/drivers/hshavoc.cpp index 2706b98c034..4a9e6213155 100644 --- a/src/mame/drivers/hshavoc.cpp +++ b/src/mame/drivers/hshavoc.cpp @@ -114,9 +114,9 @@ ROM_END DRIVER_INIT_MEMBER(md_boot_state,hshavoc) { int x; - UINT16 *src = (UINT16 *)memregion("maincpu")->base(); + uint16_t *src = (uint16_t *)memregion("maincpu")->base(); - static const UINT16 typedat[16] = { + static const uint16_t typedat[16] = { 1,1,1,1, 1,1,1,1, 1,0,0,1, 1,0,1,1 }; diff --git a/src/mame/drivers/ht68k.cpp b/src/mame/drivers/ht68k.cpp index b09ae69ce60..637672a636a 100644 --- a/src/mame/drivers/ht68k.cpp +++ b/src/mame/drivers/ht68k.cpp @@ -62,7 +62,7 @@ public: DECLARE_WRITE_LINE_MEMBER(duart_irq_handler); DECLARE_WRITE_LINE_MEMBER(duart_txb); DECLARE_WRITE8_MEMBER(duart_output); - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; virtual void machine_reset() override; }; @@ -83,9 +83,9 @@ INPUT_PORTS_END void ht68k_state::machine_reset() { - UINT8* user1 = memregion("user1")->base(); + uint8_t* user1 = memregion("user1")->base(); - memcpy((UINT8*)m_p_ram.target(),user1,0x8000); + memcpy((uint8_t*)m_p_ram.target(),user1,0x8000); m_maincpu->reset(); diff --git a/src/mame/drivers/huebler.cpp b/src/mame/drivers/huebler.cpp index c552329d99a..24a2cde6605 100644 --- a/src/mame/drivers/huebler.cpp +++ b/src/mame/drivers/huebler.cpp @@ -26,7 +26,7 @@ void amu880_state::scan_keyboard() { - UINT8 data = m_key_row[m_key_a8 ? m_key_d6 : m_key_d7]->read(); + uint8_t data = m_key_row[m_key_a8 ? m_key_d6 : m_key_d7]->read(); int a8 = (data & 0x0f) == 0x0f; @@ -68,13 +68,13 @@ READ8_MEMBER( amu880_state::keyboard_r ) */ - UINT8 special = m_special->read(); + uint8_t special = m_special->read(); int ctrl = BIT(special, 0); int shift = BIT(special, 2) & BIT(special, 1); int ab0 = BIT(offset, 0); - UINT16 address = (ab0 << 9) | (m_key_a8 << 8) | (ctrl << 7) | (shift << 6) | (m_key_a5 << 5) | (m_key_a4 << 4) | m_key_d7; + uint16_t address = (ab0 << 9) | (m_key_a8 << 8) | (ctrl << 7) | (shift << 6) | (m_key_a5 << 5) | (m_key_a4 << 4) | m_key_d7; return m_kb_rom->base()[address]; } @@ -209,7 +209,7 @@ INPUT_PORTS_END /* Video */ -UINT32 amu880_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t amu880_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int y, sx, x, line; const pen_t *pen = m_palette->pens(); @@ -220,11 +220,11 @@ UINT32 amu880_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, for (sx = 0; sx < 64; sx++) { - UINT16 videoram_addr = ((y / 10) * 64) + sx; - UINT8 videoram_data = m_video_ram[videoram_addr & 0x7ff]; + uint16_t videoram_addr = ((y / 10) * 64) + sx; + uint8_t videoram_data = m_video_ram[videoram_addr & 0x7ff]; - UINT16 charrom_addr = ((videoram_data & 0x7f) << 3) | line; - UINT8 data = m_char_rom->base()[charrom_addr & 0x3ff]; + uint16_t charrom_addr = ((videoram_data & 0x7f) << 3) | line; + uint8_t data = m_char_rom->base()[charrom_addr & 0x3ff]; for (x = 0; x < 6; x++) { diff --git a/src/mame/drivers/hunter2.cpp b/src/mame/drivers/hunter2.cpp index 118181351c5..1657975efd0 100644 --- a/src/mame/drivers/hunter2.cpp +++ b/src/mame/drivers/hunter2.cpp @@ -67,8 +67,8 @@ public: DECLARE_WRITE_LINE_MEMBER(rxd_w); private: - UINT8 m_keydata; - UINT8 m_irq_mask; + uint8_t m_keydata; + uint8_t m_irq_mask; virtual void machine_reset() override; required_device m_maincpu; required_device m_speaker; @@ -189,7 +189,7 @@ INPUT_PORTS_END READ8_MEMBER( hunter2_state::keyboard_r ) { - UINT8 i,data = 0xff; + uint8_t i,data = 0xff; for (i = 0; i < 7; i++) { if (!BIT(m_keydata, i)) @@ -204,7 +204,7 @@ READ8_MEMBER( hunter2_state::keyboard_r ) READ8_MEMBER( hunter2_state::serial_dsr_r ) { - UINT8 res = 0x00; + uint8_t res = 0x00; if(m_rs232->dsr_r()) res |= 0x80; @@ -220,7 +220,7 @@ WRITE8_MEMBER( hunter2_state::keyboard_w ) READ8_MEMBER( hunter2_state::serial_rx_r ) { - UINT8 res = 0x28; + uint8_t res = 0x28; if(m_rs232->rxd_r()) res |= 0x01; @@ -305,7 +305,7 @@ WRITE8_MEMBER( hunter2_state::memmap_w ) else if (data >= 0x80) { - UINT8 bank = data & 0x0f; + uint8_t bank = data & 0x0f; m_bank1->set_bank(16 + (bank*3)); m_bank2->set_bank(17 + (bank*3)); m_bank3->set_bank(18 + (bank*3)); @@ -324,7 +324,7 @@ void hunter2_state::machine_reset() // it is presumed that writing to rom will go nowhere DRIVER_INIT_MEMBER( hunter2_state, hunter2 ) { - UINT8 *ram = m_ram->base(); + uint8_t *ram = m_ram->base(); m_nvram->set_base(ram,m_ram->bytes()); } diff --git a/src/mame/drivers/hvyunit.cpp b/src/mame/drivers/hvyunit.cpp index 9af6bcac668..a13120f1e67 100644 --- a/src/mame/drivers/hvyunit.cpp +++ b/src/mame/drivers/hvyunit.cpp @@ -102,20 +102,20 @@ public: required_device m_soundlatch; /* Video */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; - UINT16 m_scrollx; - UINT16 m_scrolly; - UINT16 m_port0_data; + uint16_t m_scrollx; + uint16_t m_scrolly; + uint16_t m_port0_data; /* Mermaid */ - UINT8 m_data_to_mermaid; - UINT8 m_data_to_z80; - UINT8 m_mermaid_to_z80_full; - UINT8 m_z80_to_mermaid_full; - UINT8 m_mermaid_int0_l; - UINT8 m_mermaid_p[4]; + uint8_t m_data_to_mermaid; + uint8_t m_data_to_z80; + uint8_t m_mermaid_to_z80_full; + uint8_t m_z80_to_mermaid_full; + uint8_t m_mermaid_int0_l; + uint8_t m_mermaid_p[4]; DECLARE_WRITE8_MEMBER(trigger_nmi_on_slave_cpu); DECLARE_WRITE8_MEMBER(master_bankswitch_w); @@ -145,7 +145,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); void screen_eof(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(scanline); @@ -204,7 +204,7 @@ void hvyunit_state::video_start() save_item(NAME(m_port0_data)); } -UINT32 hvyunit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hvyunit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { #define SX_POS 96 #define SY_POS 0 @@ -386,9 +386,9 @@ WRITE8_MEMBER(hvyunit_state::mermaid_p2_w) READ8_MEMBER(hvyunit_state::mermaid_p3_r) { - UINT8 dsw = 0; - UINT8 dsw1 = ioport("DSW1")->read(); - UINT8 dsw2 = ioport("DSW2")->read(); + uint8_t dsw = 0; + uint8_t dsw1 = ioport("DSW1")->read(); + uint8_t dsw2 = ioport("DSW2")->read(); switch ((m_mermaid_p[0] >> 5) & 3) { diff --git a/src/mame/drivers/hx20.cpp b/src/mame/drivers/hx20.cpp index 89ca8fddefe..15b46fa578e 100644 --- a/src/mame/drivers/hx20.cpp +++ b/src/mame/drivers/hx20.cpp @@ -64,7 +64,7 @@ WRITE8_MEMBER( hx20_state::ksc_w ) READ8_MEMBER( hx20_state::krtn07_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(m_ksc, 0)) data &= m_ksc0->read(); if (!BIT(m_ksc, 1)) data &= m_ksc1->read(); @@ -100,7 +100,7 @@ READ8_MEMBER( hx20_state::krtn89_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(m_ksc, 0)) data &= m_ksc0->read() >> 8; if (!BIT(m_ksc, 1)) data &= m_ksc1->read() >> 8; @@ -203,7 +203,7 @@ READ8_MEMBER( hx20_state::main_p1_r ) */ - UINT8 data = 0x98; + uint8_t data = 0x98; // RS-232 data |= m_rs232->dsr_r(); @@ -263,7 +263,7 @@ READ8_MEMBER( hx20_state::main_p2_r ) */ - UINT8 data = M6801_MODE_4; + uint8_t data = M6801_MODE_4; // serial data &= ~(!m_slave_flag << 2); @@ -332,7 +332,7 @@ READ8_MEMBER( hx20_state::slave_p1_r ) */ - UINT8 data = 0; + uint8_t data = 0; return data; } @@ -385,7 +385,7 @@ READ8_MEMBER( hx20_state::slave_p2_r ) */ - UINT8 data = M6801_MODE_7; + uint8_t data = M6801_MODE_7; // serial data |= m_slave_tx << 3; @@ -441,7 +441,7 @@ READ8_MEMBER( hx20_state::slave_p3_r ) */ - UINT8 data = 0; + uint8_t data = 0; return data; } @@ -497,7 +497,7 @@ READ8_MEMBER( hx20_state::slave_p4_r ) */ - UINT8 data = 0; + uint8_t data = 0; // RS-232 data |= m_rs232->dcd_r() << 7; @@ -771,7 +771,7 @@ PALETTE_INIT_MEMBER(hx20_state, hx20) // SCREEN_UPDATE( hx20 ) //------------------------------------------------- -UINT32 hx20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t hx20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_lcdc0->screen_update(screen, bitmap, cliprect); m_lcdc1->screen_update(screen, bitmap, cliprect); diff --git a/src/mame/drivers/hyperscan.cpp b/src/mame/drivers/hyperscan.cpp index da5fd6e7895..457d2df700c 100644 --- a/src/mame/drivers/hyperscan.cpp +++ b/src/mame/drivers/hyperscan.cpp @@ -74,18 +74,18 @@ public: virtual void machine_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - UINT32 spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ32_MEMBER(spg290_regs_r); DECLARE_WRITE32_MEMBER(spg290_regs_w); void spg290_timers_update(); void spg290_vblank_irq(screen_device &screen, bool state); - inline UINT32 spg290_read_mem(UINT32 offset); - inline void spg290_write_mem(UINT32 offset, UINT32 data); - void spg290_argb1555(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 posy, UINT16 posx, UINT16 argb); - void spg290_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 posy, UINT16 posx, UINT16 rgb, UINT32 transrgb); - void spg290_blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 control, UINT32 attribute, UINT32 *palettes, UINT32 buf_start); - void spg290_blit_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 control, UINT32 attribute, int posy, int posx, UINT32 nptr, UINT32 buf_start, UINT32 transrgb); - void spg290_blit_character(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 control, UINT32 attribute, int posy, int posx, UINT32 nptr, UINT32 buf_start, UINT32 transrgb); + inline uint32_t spg290_read_mem(uint32_t offset); + inline void spg290_write_mem(uint32_t offset, uint32_t data); + void spg290_argb1555(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t argb); + void spg290_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t rgb, uint32_t transrgb); + void spg290_blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, uint32_t *palettes, uint32_t buf_start); + void spg290_blit_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb); + void spg290_blit_character(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb); private: static const device_timer_id TIMER_SPG290 = 0; @@ -93,57 +93,57 @@ private: struct spg290_miu { - UINT32 status; + uint32_t status; }; struct spg290_ppu { - UINT32 control; - UINT32 irq_control; - UINT32 irq_status; - UINT32 sprite_max; - UINT32 sprite_buf_start; - UINT32 frame_buff[3]; - UINT32 palettes[0x200]; - UINT32 tx_hoffset[0x200]; - UINT32 tx_hcomp[0x200]; - UINT32 transrgb; + uint32_t control; + uint32_t irq_control; + uint32_t irq_status; + uint32_t sprite_max; + uint32_t sprite_buf_start; + uint32_t frame_buff[3]; + uint32_t palettes[0x200]; + uint32_t tx_hoffset[0x200]; + uint32_t tx_hcomp[0x200]; + uint32_t transrgb; struct ppu_spite { - UINT32 control; - UINT32 attribute; + uint32_t control; + uint32_t attribute; } sprites[0x200]; struct ppu_tx { - UINT32 control; - UINT32 attribute; - UINT32 posx; - UINT32 posy; - UINT32 nptr; - UINT32 buf_start[3]; + uint32_t control; + uint32_t attribute; + uint32_t posx; + uint32_t posy; + uint32_t nptr; + uint32_t buf_start[3]; } txs[3]; }; struct spg290_timer { - UINT32 control; - UINT32 control2; - UINT16 preload; - UINT16 counter; + uint32_t control; + uint32_t control2; + uint16_t preload; + uint16_t counter; }; struct spg290_i2c { - UINT32 config; - UINT32 irq_control; - UINT32 clock; - UINT8 count; - UINT32 id; - UINT32 port_addr; - UINT32 wdata; - UINT32 rdata; + uint32_t config; + uint32_t irq_control; + uint32_t clock; + uint8_t count; + uint32_t id; + uint32_t port_addr; + uint32_t wdata; + uint32_t rdata; }; spg290_miu m_miu; @@ -157,7 +157,7 @@ private: #if LOG_SPG290_REGISTER_ACCESS -static void log_spg290_regs(device_t *device,UINT8 module, UINT16 reg, UINT32 mem_mask, bool write, UINT32 data=0) +static void log_spg290_regs(device_t *device,uint8_t module, uint16_t reg, uint32_t mem_mask, bool write, uint32_t data=0) { static const char *const modules_name[] = { @@ -187,8 +187,8 @@ static void log_spg290_regs(device_t *device,UINT8 module, UINT16 reg, UINT32 me READ32_MEMBER(hyperscan_state::spg290_regs_r) { - UINT32 addr = offset << 2; - UINT32 data = 0; + uint32_t addr = offset << 2; + uint32_t data = 0; if (addr == 0x010000) // PPU Control { @@ -233,7 +233,7 @@ READ32_MEMBER(hyperscan_state::spg290_regs_r) WRITE32_MEMBER(hyperscan_state::spg290_regs_w) { - UINT32 addr = offset << 2; + uint32_t addr = offset << 2; if (addr == 0x010000) // PPU Control { @@ -341,7 +341,7 @@ WRITE32_MEMBER(hyperscan_state::spg290_regs_w) } else if (addr == 0x2100e4) // Timer Source Clock Selection { - UINT32 timers_clk = XTAL_27MHz / ((data & 0xff) + 1); + uint32_t timers_clk = XTAL_27MHz / ((data & 0xff) + 1); m_update_timer->adjust(attotime::from_hz(timers_clk), 0, attotime::from_hz(timers_clk)); } else if(addr == 0x130020) // I2C configuration @@ -358,7 +358,7 @@ WRITE32_MEMBER(hyperscan_state::spg290_regs_w) else if(addr == 0x130028) // I2C clock setting { COMBINE_DATA(&m_i2c.clock); - UINT32 i2c_clk = XTAL_27MHz / ((m_i2c.clock & 0x3ff) + 1); + uint32_t i2c_clk = XTAL_27MHz / ((m_i2c.clock & 0x3ff) + 1); m_i2c_timer->adjust(attotime::from_hz(i2c_clk), 0, attotime::from_hz(i2c_clk)); } else if(addr == 0x13002c) // I2C ID @@ -392,17 +392,17 @@ WRITE32_MEMBER(hyperscan_state::spg290_regs_w) #endif } -inline UINT32 hyperscan_state::spg290_read_mem(UINT32 offset) +inline uint32_t hyperscan_state::spg290_read_mem(uint32_t offset) { return m_maincpu->space(0).read_dword(offset); } -inline void hyperscan_state::spg290_write_mem(UINT32 offset, UINT32 data) +inline void hyperscan_state::spg290_write_mem(uint32_t offset, uint32_t data) { return m_maincpu->space(0).write_dword(offset, data); } -void hyperscan_state::spg290_argb1555(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 posy, UINT16 posx, UINT16 argb) +void hyperscan_state::spg290_argb1555(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t argb) { if (!(argb & 0x8000) && cliprect.contains(posx, posy)) { @@ -411,7 +411,7 @@ void hyperscan_state::spg290_argb1555(bitmap_rgb32 &bitmap, const rectangle &cli } } -void hyperscan_state::spg290_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 posy, UINT16 posx, UINT16 rgb, UINT32 transrgb) +void hyperscan_state::spg290_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t posy, uint16_t posx, uint16_t rgb, uint32_t transrgb) { if ((!(transrgb & 0x10000) || (transrgb & 0xffff) != rgb) && cliprect.contains(posx, posy)) { @@ -420,33 +420,33 @@ void hyperscan_state::spg290_rgb565(bitmap_rgb32 &bitmap, const rectangle &clipr } } -void hyperscan_state::spg290_blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 control, UINT32 attribute, UINT32 *palettes, UINT32 buf_start) +void hyperscan_state::spg290_blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, uint32_t *palettes, uint32_t buf_start) { - UINT32 sprite_base = buf_start + ((control & 0xffff) << 8); - UINT16 sprite_x = (control >> 16) & 0x3ff; - UINT16 sprite_y = (attribute >> 16) & 0x3ff; - UINT8 sprite_hsize = 8 << ((attribute >> 4) & 0x03); - UINT8 sprite_vsize = 8 << ((attribute >> 6) & 0x03); - UINT8 bit_pixel = ((attribute & 3) + 1) << 1; - UINT8 pixel_word = 32 / bit_pixel; - UINT8 word_line = sprite_hsize / pixel_word; - UINT8 sprite_flip = (attribute >> 2) & 0x03; + uint32_t sprite_base = buf_start + ((control & 0xffff) << 8); + uint16_t sprite_x = (control >> 16) & 0x3ff; + uint16_t sprite_y = (attribute >> 16) & 0x3ff; + uint8_t sprite_hsize = 8 << ((attribute >> 4) & 0x03); + uint8_t sprite_vsize = 8 << ((attribute >> 6) & 0x03); + uint8_t bit_pixel = ((attribute & 3) + 1) << 1; + uint8_t pixel_word = 32 / bit_pixel; + uint8_t word_line = sprite_hsize / pixel_word; + uint8_t sprite_flip = (attribute >> 2) & 0x03; for (int y=0; y < sprite_vsize; y++) for (int x=0; x < word_line; x++) { - UINT32 data = spg290_read_mem(sprite_base + (y * pixel_word + x) * 4); + uint32_t data = spg290_read_mem(sprite_base + (y * pixel_word + x) * 4); for (int b=0; b < pixel_word; b++) { - UINT16 pen = ((data >> (b * bit_pixel)) & ((1 << bit_pixel) - 1)); - UINT16 posx; + uint16_t pen = ((data >> (b * bit_pixel)) & ((1 << bit_pixel) - 1)); + uint16_t posx; if (sprite_flip & 0x01) posx = sprite_x + (sprite_hsize - (x * word_line + b)); else posx = sprite_x + x * (word_line) + b; - UINT16 posy; + uint16_t posy; if (sprite_flip & 0x02) posy = sprite_y + (sprite_vsize - y); else @@ -457,22 +457,22 @@ void hyperscan_state::spg290_blit_sprite(bitmap_rgb32 &bitmap, const rectangle & } } -void hyperscan_state::spg290_blit_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 control, UINT32 attribute, int posy, int posx, UINT32 nptr, UINT32 buf_start, UINT32 transrgb) +void hyperscan_state::spg290_blit_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb) { for (int y=0; y<512; y++) { int line = (control & 0x04) ? 0 : y; - UINT32 tx_start = spg290_read_mem(nptr + (posy + line) * 4); + uint32_t tx_start = spg290_read_mem(nptr + (posy + line) * 4); for (int x=0; x < 1024>>1; x++) { - UINT32 data = spg290_read_mem(buf_start + (tx_start + posx) * 2 + x * 4); + uint32_t data = spg290_read_mem(buf_start + (tx_start + posx) * 2 + x * 4); for (int b=0; b < 2; b++) { - UINT16 posx = x * 2 + b; - UINT16 posy = y; - UINT16 pix = (data >> (b*16)) & 0xffff; + uint16_t posx = x * 2 + b; + uint16_t posy = y; + uint16_t pix = (data >> (b*16)) & 0xffff; if (control & 0x0080) spg290_argb1555(bitmap, cliprect, posy, posx, pix); @@ -483,13 +483,13 @@ void hyperscan_state::spg290_blit_bitmap(bitmap_rgb32 &bitmap, const rectangle & } } -void hyperscan_state::spg290_blit_character(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 control, UINT32 attribute, int posy, int posx, UINT32 nptr, UINT32 buf_start, UINT32 transrgb) +void hyperscan_state::spg290_blit_character(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t control, uint32_t attribute, int posy, int posx, uint32_t nptr, uint32_t buf_start, uint32_t transrgb) { // TODO } -UINT32 hyperscan_state::spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t hyperscan_state::spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_ppu.control & 0x1000) { diff --git a/src/mame/drivers/hyprduel.cpp b/src/mame/drivers/hyprduel.cpp index d8f63a29f25..e7bd0b1b34a 100644 --- a/src/mame/drivers/hyprduel.cpp +++ b/src/mame/drivers/hyprduel.cpp @@ -198,7 +198,7 @@ TIMER_CALLBACK_MEMBER(hyprduel_state::magerror_irq_callback) READ16_MEMBER(hyprduel_state::hyprduel_bankedrom_r) { - UINT8 *ROM = memregion("gfx1")->base(); + uint8_t *ROM = memregion("gfx1")->base(); size_t len = memregion("gfx1")->bytes(); offset = offset * 2 + 0x10000 * (*m_rombank); @@ -259,12 +259,12 @@ TIMER_CALLBACK_MEMBER(hyprduel_state::hyprduel_blit_done) update_irq_state(); } -inline int hyprduel_state::blt_read( const UINT8 *ROM, const int offs ) +inline int hyprduel_state::blt_read( const uint8_t *ROM, const int offs ) { return ROM[offs]; } -void hyprduel_state::blt_write( address_space &space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask ) +void hyprduel_state::blt_write( address_space &space, const int tmap, const offs_t offs, const uint16_t data, const uint16_t mask ) { switch( tmap ) { @@ -282,15 +282,15 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w) if (offset == 0xc / 2) { - UINT8 *src = memregion("gfx1")->base(); + uint8_t *src = memregion("gfx1")->base(); size_t src_len = memregion("gfx1")->bytes(); - UINT32 tmap = (m_blitter_regs[0x00 / 2] << 16) + m_blitter_regs[0x02 / 2]; - UINT32 src_offs = (m_blitter_regs[0x04 / 2] << 16) + m_blitter_regs[0x06 / 2]; - UINT32 dst_offs = (m_blitter_regs[0x08 / 2] << 16) + m_blitter_regs[0x0a / 2]; + uint32_t tmap = (m_blitter_regs[0x00 / 2] << 16) + m_blitter_regs[0x02 / 2]; + uint32_t src_offs = (m_blitter_regs[0x04 / 2] << 16) + m_blitter_regs[0x06 / 2]; + uint32_t dst_offs = (m_blitter_regs[0x08 / 2] << 16) + m_blitter_regs[0x0a / 2]; int shift = (dst_offs & 0x80) ? 0 : 8; - UINT16 mask = (dst_offs & 0x80) ? 0x00ff : 0xff00; + uint16_t mask = (dst_offs & 0x80) ? 0x00ff : 0xff00; // logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n", space.device().safe_pc(), tmap, src_offs, dst_offs); @@ -308,7 +308,7 @@ WRITE16_MEMBER(hyprduel_state::hyprduel_blitter_w) while (1) { - UINT16 b1, b2, count; + uint16_t b1, b2, count; src_offs %= src_len; b1 = blt_read(src, src_offs); diff --git a/src/mame/drivers/i7000.cpp b/src/mame/drivers/i7000.cpp index 7103a927a5b..ad4c4c666bd 100644 --- a/src/mame/drivers/i7000.cpp +++ b/src/mame/drivers/i7000.cpp @@ -68,10 +68,10 @@ public: required_device m_maincpu; required_device m_card; required_device m_gfxdecode; - required_shared_ptr m_videoram; - UINT32 screen_update_i7000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT8 *m_char_rom; - UINT8 m_row; + required_shared_ptr m_videoram; + uint32_t screen_update_i7000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint8_t *m_char_rom; + uint8_t m_row; tilemap_t *m_bg_tilemap; TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -91,7 +91,7 @@ WRITE8_MEMBER( i7000_state::i7000_scanlines_w ) READ8_MEMBER( i7000_state::i7000_kbd_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i=0; i<40*25; i++){ m_bg_tilemap->mark_tile_dirty(i); @@ -277,7 +277,7 @@ ADDRESS_MAP_END DEVICE_IMAGE_LOAD_MEMBER( i7000_state, i7000_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_BIG); m_card->common_load_rom(m_card->get_rom_base(), size, "rom"); @@ -316,7 +316,7 @@ void i7000_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(i7000_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 40, 25); } -UINT32 i7000_state::screen_update_i7000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t i7000_state::screen_update_i7000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/ibm3153.cpp b/src/mame/drivers/ibm3153.cpp index df8befae1dd..92dfb62537b 100644 --- a/src/mame/drivers/ibm3153.cpp +++ b/src/mame/drivers/ibm3153.cpp @@ -48,9 +48,9 @@ public: , m_maincpu(*this, "maincpu") { } - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; DECLARE_PALETTE_INIT(ibm3153); - 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); private: virtual void machine_reset() override; required_device m_maincpu; @@ -73,7 +73,7 @@ ADDRESS_MAP_END static INPUT_PORTS_START( ibm3153 ) INPUT_PORTS_END -UINT32 ibm3153_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ibm3153_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/ibm6580.cpp b/src/mame/drivers/ibm6580.cpp index 93162d7a3a9..c74a325e8ea 100644 --- a/src/mame/drivers/ibm6580.cpp +++ b/src/mame/drivers/ibm6580.cpp @@ -27,9 +27,9 @@ public: , m_maincpu(*this, "maincpu") { } - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; DECLARE_PALETTE_INIT(ibm6580); - 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); private: virtual void machine_reset() override; required_device m_maincpu; @@ -52,7 +52,7 @@ ADDRESS_MAP_END static INPUT_PORTS_START( ibm6580 ) INPUT_PORTS_END -UINT32 ibm6580_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ibm6580_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/ibmpcjr.cpp b/src/mame/drivers/ibmpcjr.cpp index 2bc58e7113d..dcb8d3dd39c 100644 --- a/src/mame/drivers/ibmpcjr.cpp +++ b/src/mame/drivers/ibmpcjr.cpp @@ -69,24 +69,24 @@ public: image_init_result load_cart(device_image_interface &image, generic_slot_device *slot); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pcjr_cart1) { return load_cart(image, m_cart1); } DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pcjr_cart2) { return load_cart(image, m_cart2); } - void pc_speaker_set_spkrdata(UINT8 data); - - UINT8 m_pc_spkrdata; - UINT8 m_pit_out2; - UINT8 m_pcjr_dor; - UINT8 m_pcjx_1ff_count; - UINT8 m_pcjx_1ff_val; - UINT8 m_pcjx_1ff_bankval; - UINT8 m_pcjx_1ff_bank[20][2]; + void pc_speaker_set_spkrdata(uint8_t data); + + uint8_t m_pc_spkrdata; + uint8_t m_pit_out2; + uint8_t m_pcjr_dor; + uint8_t m_pcjx_1ff_count; + uint8_t m_pcjx_1ff_val; + uint8_t m_pcjx_1ff_bankval; + uint8_t m_pcjx_1ff_bank[20][2]; int m_ppi_portc_switch_high; - UINT8 m_ppi_portb; + uint8_t m_ppi_portb; - UINT8 m_pc_keyb_data; - UINT8 m_transferring; - UINT8 m_latch; - UINT32 m_raw_keyb_data; + uint8_t m_pc_keyb_data; + uint8_t m_transferring; + uint8_t m_latch; + uint32_t m_raw_keyb_data; int m_signal_count; - UINT8 m_nmi_enabled; + uint8_t m_nmi_enabled; void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; emu_timer *m_pc_int_delay_timer; @@ -186,7 +186,7 @@ void pcjr_state::device_timer(emu_timer &timer, device_timer_id id, int param, v WRITE_LINE_MEMBER(pcjr_state::pic8259_set_int_line) { - UINT32 pc = m_maincpu->pc(); + uint32_t pc = m_maincpu->pc(); if ( (pc == 0xF0453) || (pc == 0xFF196) ) { m_pc_int_delay_timer->adjust( m_maincpu->cycles_to_attotime(20), state ); @@ -202,7 +202,7 @@ WRITE_LINE_MEMBER(pcjr_state::pic8259_set_int_line) * PC Speaker related * *************************************************************************/ -void pcjr_state::pc_speaker_set_spkrdata(UINT8 data) +void pcjr_state::pc_speaker_set_spkrdata(uint8_t data) { m_pc_spkrdata = data ? 1 : 0; m_speaker->level_w(m_pc_spkrdata & m_pit_out2); @@ -258,7 +258,7 @@ WRITE_LINE_MEMBER(pcjr_state::keyb_interrupt) if(state && (data = m_keyboard->read(machine().driver_data()->generic_space(), 0))) { - UINT8 parity = 0; + uint8_t parity = 0; int i; m_latch = 1; @@ -369,7 +369,7 @@ READ8_MEMBER(pcjr_state::pcjr_ppi_portc_r) WRITE8_MEMBER(pcjr_state::pcjr_fdc_dor_w) { logerror("fdc: dor = %02x\n", data); - UINT8 pdor = m_pcjr_dor; + uint8_t pdor = m_pcjr_dor; floppy_image_device *floppy0 = m_fdc->subdevice("0")->get_device(); floppy_image_device *floppy1 = nullptr; @@ -438,7 +438,7 @@ READ8_MEMBER(pcjr_state::pcjx_port_1ff_r) image_init_result pcjr_state::load_cart(device_image_interface &image, generic_slot_device *slot) { - UINT32 size = slot->common_get_size("rom"); + uint32_t size = slot->common_get_size("rom"); bool imagic_hack = false; if (image.software_entry() == nullptr) @@ -478,7 +478,7 @@ image_init_result pcjr_state::load_cart(device_image_interface &image, generic_s // the first chunk is unique, the second is repeated 4 times up to 0xa000 size // mirroring - UINT8 *ROM = slot->get_rom_base(); + uint8_t *ROM = slot->get_rom_base(); memcpy(ROM + 0xe000, ROM + 0x2000, 0x2000); memcpy(ROM + 0xc000, ROM + 0x2000, 0x2000); memcpy(ROM + 0xa000, ROM + 0x2000, 0x2000); diff --git a/src/mame/drivers/icecold.cpp b/src/mame/drivers/icecold.cpp index b3776f4948c..1d7a310ea32 100644 --- a/src/mame/drivers/icecold.cpp +++ b/src/mame/drivers/icecold.cpp @@ -46,10 +46,10 @@ public: required_device m_ay8910_1; required_device m_pia1; - UINT8 m_digit; // scanlines from i8279 - UINT8 m_sound_latch; // sound bus latch - UINT8 m_ay_ctrl; // ay controls line - UINT8 m_motors_ctrl; // motors control + uint8_t m_digit; // scanlines from i8279 + uint8_t m_sound_latch; // sound bus latch + uint8_t m_ay_ctrl; // ay controls line + uint8_t m_motors_ctrl; // motors control int m_sint; // SINT line int m_motenbl; // /MOTENBL line int m_ball_gate_sw; // ball gate switch @@ -174,7 +174,7 @@ void icecold_state::machine_reset() CUSTOM_INPUT_MEMBER( icecold_state::motors_limit_r ) { - UINT8 data = 0; + uint8_t data = 0; if (m_rmotor <= 1) data |= 0x01; // right down limit if (m_lmotor <= 1) data |= 0x04; // left down limit diff --git a/src/mame/drivers/ichiban.cpp b/src/mame/drivers/ichiban.cpp index b53c0fa1be7..5b6d3dcaa08 100644 --- a/src/mame/drivers/ichiban.cpp +++ b/src/mame/drivers/ichiban.cpp @@ -60,14 +60,14 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); }; void ichibanjyan_state::video_start() { } -UINT32 ichibanjyan_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t ichibanjyan_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } @@ -103,7 +103,7 @@ GFXDECODE_END void ichibanjyan_state::machine_start() { - UINT8 *ROM = memregion("code")->base(); + uint8_t *ROM = memregion("code")->base(); membank("bank1")->configure_entries(0, 4, ROM, 0x8000); } diff --git a/src/mame/drivers/idsa.cpp b/src/mame/drivers/idsa.cpp index ac9367e8491..3df6f9cd924 100644 --- a/src/mame/drivers/idsa.cpp +++ b/src/mame/drivers/idsa.cpp @@ -50,7 +50,7 @@ public: DECLARE_WRITE8_MEMBER(ay2_b_w); private: - UINT16 m_irqcnt; + uint16_t m_irqcnt; virtual void machine_reset() override; required_device m_maincpu; required_device m_speech; @@ -208,8 +208,8 @@ INPUT_PORTS_END // This came from pinmame, even though there's no spb640 chip READ8_MEMBER( idsa_state::portb0_r ) { - UINT16 data = m_speech->spb640_r(space, offset / 2); - return offset % 2 ? (UINT8)(data >> 8) : (UINT8)(data & 0xff); + uint16_t data = m_speech->spb640_r(space, offset / 2); + return offset % 2 ? (uint8_t)(data >> 8) : (uint8_t)(data & 0xff); } // ports 80 & 90 for the display diff --git a/src/mame/drivers/ie15.cpp b/src/mame/drivers/ie15.cpp index 28c0304a1c4..dff8c1fcaca 100644 --- a/src/mame/drivers/ie15.cpp +++ b/src/mame/drivers/ie15.cpp @@ -64,7 +64,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); TIMER_DEVICE_CALLBACK_MEMBER( scanline_callback ); DECLARE_WRITE16_MEMBER( kbd_put ); DECLARE_PALETTE_INIT( ie15 ); @@ -101,30 +101,30 @@ public: private: TIMER_CALLBACK_MEMBER(ie15_beepoff); void update_leds(); - UINT32 draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline); + uint32_t draw_scanline(uint16_t *p, uint16_t offset, uint8_t scanline); rectangle m_tmpclip; bitmap_ind16 m_tmpbmp; bitmap_ind16 m_offbmp; - const UINT8 *m_p_chargen; - UINT8 *m_p_videoram; - UINT8 m_long_beep; - UINT8 m_kb_control; - UINT8 m_kb_data; - UINT8 m_kb_flag0; - UINT8 m_kb_flag; - UINT8 m_kb_ruslat; - UINT8 m_latch; + const uint8_t *m_p_chargen; + uint8_t *m_p_videoram; + uint8_t m_long_beep; + uint8_t m_kb_control; + uint8_t m_kb_data; + uint8_t m_kb_flag0; + uint8_t m_kb_flag; + uint8_t m_kb_ruslat; + uint8_t m_latch; struct { - UINT8 cursor; - UINT8 enable; - UINT8 line25; - UINT32 ptr1; - UINT32 ptr2; + uint8_t cursor; + uint8_t enable; + uint8_t line25; + uint32_t ptr1; + uint32_t ptr2; } m_video; - UINT8 m_serial_rx_ready; - UINT8 m_serial_tx_ready; + uint8_t m_serial_rx_ready; + uint8_t m_serial_tx_ready; protected: required_device m_maincpu; @@ -135,7 +135,7 @@ protected: }; READ8_MEMBER( ie15_state::mem_r ) { - UINT8 ret; + uint8_t ret; ret = m_p_videoram[m_video.ptr1]; if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0 && m_video.ptr1 >= SCREEN_PAGE) @@ -182,7 +182,7 @@ WRITE8_MEMBER( ie15_state::mem_addr_dec_w ) { } WRITE8_MEMBER( ie15_state::mem_addr_lo_w ) { - UINT16 tmp = m_video.ptr1; + uint16_t tmp = m_video.ptr1; tmp &= 0xff0; tmp |= ((data >> 4) & 0xf); @@ -196,7 +196,7 @@ WRITE8_MEMBER( ie15_state::mem_addr_lo_w ) { } WRITE8_MEMBER( ie15_state::mem_addr_hi_w ) { - UINT16 tmp = m_video.ptr1; + uint16_t tmp = m_video.ptr1; tmp &= 0xf; tmp |= (data << 4); @@ -215,7 +215,7 @@ TIMER_CALLBACK_MEMBER(ie15_state::ie15_beepoff) } WRITE8_MEMBER( ie15_state::beep_w ) { - UINT16 length = (m_long_beep & IE_TRUE) ? 150 : 400; + uint16_t length = (m_long_beep & IE_TRUE) ? 150 : 400; if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) { @@ -295,7 +295,7 @@ void ie15_state::rcv_complete() void ie15_state::tra_callback() { - UINT8 bit = transmit_register_get_data_bit(); + uint8_t bit = transmit_register_get_data_bit(); m_rs232->write_txd(bit); } @@ -316,7 +316,7 @@ READ8_MEMBER( ie15_state::serial_tx_ready_r ) { // not called unless data are ready READ8_MEMBER( ie15_state::serial_r ) { - UINT8 data; + uint8_t data; data = get_received_char(); m_serial_rx_ready = IE_TRUE; @@ -336,7 +336,7 @@ WRITE8_MEMBER( ie15_state::serial_speed_w ) { } READ8_MEMBER( ie15_state::flag_r ) { - UINT8 ret = 0; + uint8_t ret = 0; switch (offset) { @@ -500,10 +500,10 @@ void ie15_state::video_start() XXX 'dotted look' is caused by strobe at 2x pixel clock -- use HLSL for this. */ -UINT32 ie15_state::draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline) +uint32_t ie15_state::draw_scanline(uint16_t *p, uint16_t offset, uint8_t scanline) { - UINT8 gfx, fg, bg, ra, blink, red; - UINT16 x, chr; + uint8_t gfx, fg, bg, ra, blink, red; + uint16_t x, chr; bg = 0; fg = 1; ra = scanline % 8; blink = (m_screen->frame_number() % 10) > 4; @@ -539,7 +539,7 @@ UINT32 ie15_state::draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline) void ie15_state::update_leds() { - UINT8 data = m_io_keyboard->read(); + uint8_t data = m_io_keyboard->read(); output().set_value("lat_led", m_kb_ruslat ^ 1); output().set_value("nr_led", BIT(m_kb_control, IE_KB_NR_BIT) ^ 1); output().set_value("pch_led", BIT(data, IE_KB_PCH_BIT) ^ 1); @@ -556,7 +556,7 @@ void ie15_state::update_leds() */ TIMER_DEVICE_CALLBACK_MEMBER(ie15_state::scanline_callback) { - UINT16 y = m_screen->vpos(); + uint16_t y = m_screen->vpos(); DBG_LOG(3,"scanline_cb", ("addr %03x frame %d x %.4d y %.3d row %.2d e:c:s %d:%d:%d\n", @@ -574,7 +574,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ie15_state::scanline_callback) } } -UINT32 ie15_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ie15_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { update_leds(); copybitmap(bitmap, m_tmpbmp, 0, 0, IE15_HORZ_START, IE15_VERT_START, cliprect); diff --git a/src/mame/drivers/if800.cpp b/src/mame/drivers/if800.cpp index 70e04f531d1..4b93ffd07f1 100644 --- a/src/mame/drivers/if800.cpp +++ b/src/mame/drivers/if800.cpp @@ -25,7 +25,7 @@ public: required_device m_hgdc; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; virtual void machine_start() override; virtual void machine_reset() override; required_device m_maincpu; @@ -38,7 +38,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( if800_state::hgdc_display_pixels ) const rgb_t *palette = m_palette->palette()->entry_list_raw(); int xi,gfx; - UINT8 pen; + uint8_t pen; gfx = m_video_ram[address >> 1]; diff --git a/src/mame/drivers/igs009.cpp b/src/mame/drivers/igs009.cpp index 1e79d7a871f..f10f8165918 100644 --- a/src/mame/drivers/igs009.cpp +++ b/src/mame/drivers/igs009.cpp @@ -58,14 +58,14 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_bg_scroll; - required_shared_ptr m_reel1_ram; - required_shared_ptr m_reel2_ram; - required_shared_ptr m_reel3_ram; - required_shared_ptr m_reel4_ram; - required_shared_ptr m_bg_scroll2; - required_shared_ptr m_fg_tile_ram; - required_shared_ptr m_fg_color_ram; + required_shared_ptr m_bg_scroll; + required_shared_ptr m_reel1_ram; + required_shared_ptr m_reel2_ram; + required_shared_ptr m_reel3_ram; + required_shared_ptr m_reel4_ram; + required_shared_ptr m_bg_scroll2; + required_shared_ptr m_fg_tile_ram; + required_shared_ptr m_fg_color_ram; tilemap_t *m_reel1_tilemap; tilemap_t *m_reel2_tilemap; @@ -75,8 +75,8 @@ public: int m_video_enable; int m_nmi_enable; int m_hopper; - UINT8 m_out[3]; - UINT8 m_igs_magic[2]; + uint8_t m_out[3]; + uint8_t m_igs_magic[2]; DECLARE_WRITE8_MEMBER(reel1_ram_w); DECLARE_WRITE8_MEMBER(reel2_ram_w); @@ -114,7 +114,7 @@ public: virtual void video_start() override; DECLARE_VIDEO_START(gp98); - 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); }; @@ -295,7 +295,7 @@ VIDEO_START_MEMBER(igs009_state,gp98) } -UINT32 igs009_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igs009_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = m_video_enable ? -1 : 0; @@ -1056,12 +1056,12 @@ ROM_END void igs009_state::decrypt_jingbell() { - UINT8 *rom = (UINT8 *)memregion("maincpu")->base(); + uint8_t *rom = (uint8_t *)memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); for (int i=0; ibase(); + uint8_t *rom = (uint8_t *)memregion("maincpu")->base(); rom[0x01f19] = 0x18; } @@ -1093,7 +1093,7 @@ DRIVER_INIT_MEMBER(igs009_state,jingbell) decrypt_jingbell(); // protection patch - UINT8 *rom = (UINT8 *)memregion("maincpu")->base(); + uint8_t *rom = (uint8_t *)memregion("maincpu")->base(); rom[0x0e753] = 0x18; } diff --git a/src/mame/drivers/igs011.cpp b/src/mame/drivers/igs011.cpp index 80dd5d8e91f..a2d18ca6302 100644 --- a/src/mame/drivers/igs011.cpp +++ b/src/mame/drivers/igs011.cpp @@ -74,7 +74,7 @@ Notes: struct blitter_t { - UINT16 x, y, w, h, + uint16_t x, y, w, h, gfx_lo, gfx_hi, depth, pen, @@ -105,37 +105,37 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_priority_ram; - optional_shared_ptr m_vbowl_trackball; - required_shared_ptr m_generic_paletteram_16; + required_shared_ptr m_priority_ram; + optional_shared_ptr m_vbowl_trackball; + required_shared_ptr m_generic_paletteram_16; /* memory regions */ required_memory_region m_gfx_region; optional_memory_region m_gfx2_region; - std::unique_ptr m_layer[8]; - UINT16 m_priority; - UINT8 m_lhb2_pen_hi; - UINT16 m_igs_dips_sel; - UINT16 m_igs_input_sel; - UINT16 m_igs_hopper; - UINT8 m_prot1; - UINT8 m_prot1_swap; - UINT32 m_prot1_addr; - UINT8 m_prot2; - UINT8 m_igs012_prot; - UINT8 m_igs012_prot_swap; - UINT8 m_igs012_prot_mode; - UINT16 m_igs003_reg[2]; - UINT16 m_lhb_irq_enable; + std::unique_ptr m_layer[8]; + uint16_t m_priority; + uint8_t m_lhb2_pen_hi; + uint16_t m_igs_dips_sel; + uint16_t m_igs_input_sel; + uint16_t m_igs_hopper; + uint8_t m_prot1; + uint8_t m_prot1_swap; + uint32_t m_prot1_addr; + uint8_t m_prot2; + uint8_t m_igs012_prot; + uint8_t m_igs012_prot_swap; + uint8_t m_igs012_prot_mode; + uint16_t m_igs003_reg[2]; + uint16_t m_lhb_irq_enable; blitter_t m_blitter; - UINT16 m_igs003_prot_hold; - UINT8 m_igs003_prot_x; - UINT8 m_igs003_prot_y; - UINT8 m_igs003_prot_z; - UINT8 m_igs003_prot_h1; - UINT8 m_igs003_prot_h2; + uint16_t m_igs003_prot_hold; + uint8_t m_igs003_prot_x; + uint8_t m_igs003_prot_y; + uint8_t m_igs003_prot_z; + uint8_t m_igs003_prot_h1; + uint8_t m_igs003_prot_h2; DECLARE_WRITE16_MEMBER(igs011_priority_w); DECLARE_READ16_MEMBER(igs011_layers_r); @@ -199,7 +199,7 @@ public: DECLARE_WRITE16_MEMBER(vbowl_link_1_w); DECLARE_WRITE16_MEMBER(vbowl_link_2_w); DECLARE_WRITE16_MEMBER(vbowl_link_3_w); - UINT16 igs_dips_r(int NUM); + uint16_t igs_dips_r(int NUM); DECLARE_CUSTOM_INPUT_MEMBER(igs_hopper_r); DECLARE_WRITE16_MEMBER(lhb_okibank_w); DECLARE_READ16_MEMBER(ics2115_word_r); @@ -228,7 +228,7 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(lev3_timer_irq_cb); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_igs011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_igs011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_vbowl(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(lhb_vblank_irq); void wlcc_decrypt(); @@ -283,7 +283,7 @@ void igs011_state::video_start() { for (int i = 0; i < 8; i++) { - m_layer[i] = std::make_unique(512 * 256); + m_layer[i] = std::make_unique(512 * 256); save_pointer(NAME(m_layer[i].get()), 512 * 256, i); } @@ -302,14 +302,14 @@ void igs011_state::video_start() save_item(NAME(m_blitter.flags)); } -UINT32 igs011_state::screen_update_igs011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igs011_state::screen_update_igs011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { #ifdef MAME_DEBUG int layer_enable = -1; #endif int x,y,l,scr_addr,pri_addr; - UINT16 *pri_ram; + uint16_t *pri_ram; #ifdef MAME_DEBUG if (machine().input().code_pressed(KEYCODE_Z)) @@ -382,8 +382,8 @@ READ16_MEMBER(igs011_state::igs011_layers_r) { int layer0 = ((offset & (0x80000/2)) ? 4 : 0) + ((offset & 1) ? 0 : 2); - UINT8 *l0 = m_layer[layer0].get(); - UINT8 *l1 = m_layer[layer0+1].get(); + uint8_t *l0 = m_layer[layer0].get(); + uint8_t *l1 = m_layer[layer0+1].get(); offset >>= 1; offset &= 0x1ffff; @@ -393,12 +393,12 @@ READ16_MEMBER(igs011_state::igs011_layers_r) WRITE16_MEMBER(igs011_state::igs011_layers_w) { - UINT16 word; + uint16_t word; int layer0 = ((offset & (0x80000/2)) ? 4 : 0) + ((offset & 1) ? 0 : 2); - UINT8 *l0 = m_layer[layer0].get(); - UINT8 *l1 = m_layer[layer0+1].get(); + uint8_t *l0 = m_layer[layer0].get(); + uint8_t *l1 = m_layer[layer0+1].get(); offset >>= 1; offset &= 0x1ffff; @@ -490,13 +490,13 @@ WRITE16_MEMBER(igs011_state::igs011_blit_flags_w) int x, xstart, xend, xinc, flipx; int y, ystart, yend, yinc, flipy; int depth4, clear, opaque, z; - UINT8 trans_pen, clear_pen, pen_hi, *dest; - UINT8 pen = 0; + uint8_t trans_pen, clear_pen, pen_hi, *dest; + uint8_t pen = 0; - UINT8 *gfx = m_gfx_region->base(); + uint8_t *gfx = m_gfx_region->base(); int gfx_size = m_gfx_region->bytes(); - UINT8 *gfx2 = (m_gfx2_region != nullptr) ? m_gfx2_region->base() : nullptr; + uint8_t *gfx2 = (m_gfx2_region != nullptr) ? m_gfx2_region->base() : nullptr; int gfx2_size = (m_gfx2_region != nullptr) ? m_gfx2_region->bytes() : 0; const rectangle &clip = m_screen->visible_area(); @@ -634,10 +634,10 @@ WRITE16_MEMBER(igs011_state::igs_dips_w) COMBINE_DATA(&m_igs_dips_sel); } -UINT16 igs011_state::igs_dips_r(int NUM) +uint16_t igs011_state::igs_dips_r(int NUM) { int i; - UINT16 ret=0; + uint16_t ret=0; static const char *const dipnames[] = { "DSW1", "DSW2", "DSW3", "DSW4", "DSW5" }; for (i = 0; i < NUM; i++) @@ -662,13 +662,13 @@ READ16_MEMBER(igs011_state::igs_5_dips_r){ return igs_dips_r(5); } void igs011_state::wlcc_decrypt() { int i; - UINT16 *src = (UINT16 *) (memregion("maincpu")->base()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for (i=0; ibase()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for (i=0; ibase()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for (i=0; ibase()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for (i=0; ibase()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for (i=0; ibase()); - std::vector result_data(rom_size/2); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); + std::vector result_data(rom_size/2); for (i=0; ibase()); - std::vector result_data(rom_size/2); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); + std::vector result_data(rom_size/2); for (i=0; ibase()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for(i=0; ibase()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for (i=0; ibase(); + uint16_t *src = (uint16_t *) memregion("maincpu")->base(); int rom_size = 0x80000; for (i=0; ibase()); - std::vector result_data(rom_size); + uint8_t *src = (uint8_t *) (memregion("blitter")->base()); + std::vector result_data(rom_size); for (i=0; ibase()); - std::vector result_data(rom_size); + uint8_t *src = (uint8_t *) (memregion("blitter")->base()); + std::vector result_data(rom_size); for (i=0; ispace(AS_PROGRAM); - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // Plug previous address range with ROM access sp.install_rom(m_prot1_addr + 0, m_prot1_addr + 9, rom + m_prot1_addr); @@ -1192,7 +1192,7 @@ WRITE16_MEMBER(igs011_state::drgnwrld_igs011_prot2_swap_w) // if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) ) { // (b3&b0) . b2 . (b0|b1) . (b2^!b4) . (!b1^b3) - UINT8 x = m_prot2; + uint8_t x = m_prot2; m_prot2 = ((BIT(x,3)&BIT(x,0))<<4) | (BIT(x,2)<<3) | ((BIT(x,0)|BIT(x,1))<<2) | ((BIT(x,2)^BIT(x,4)^1)<<1) | (BIT(x,1)^1^BIT(x,3)); } // else @@ -1207,7 +1207,7 @@ WRITE16_MEMBER(igs011_state::lhb_igs011_prot2_swap_w) // if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) ) { // (!b0|b1) . b2 . (b0&b1) - UINT8 x = m_prot2; + uint8_t x = m_prot2; m_prot2 = (((BIT(x,0)^1)|BIT(x,1))<<2) | (BIT(x,2)<<1) | (BIT(x,0)&BIT(x,1)); } // else @@ -1222,7 +1222,7 @@ WRITE16_MEMBER(igs011_state::wlcc_igs011_prot2_swap_w) // if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) ) { // (b3 ^ b2) . (b2 ^ b1) . (b1 ^ b0) . !(b4 ^ b0) . !(b4 ^ b3) - UINT8 x = m_prot2; + uint8_t x = m_prot2; m_prot2 = ((BIT(x,3)^BIT(x,2))<<4) | ((BIT(x,2)^BIT(x,1))<<3) | ((BIT(x,1)^BIT(x,0))<<2) | ((BIT(x,4)^BIT(x,0)^1)<<1) | (BIT(x,4)^BIT(x,3)^1); } // else @@ -1237,7 +1237,7 @@ WRITE16_MEMBER(igs011_state::vbowl_igs011_prot2_swap_w) // if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) ) { // (b3 ^ b2) . (b2 ^ b1) . (b1 ^ b0) . (b4 ^ b0) . (b4 ^ b3) - UINT8 x = m_prot2; + uint8_t x = m_prot2; m_prot2 = ((BIT(x,3)^BIT(x,2))<<4) | ((BIT(x,2)^BIT(x,1))<<3) | ((BIT(x,1)^BIT(x,0))<<2) | ((BIT(x,4)^BIT(x,0))<<1) | (BIT(x,4)^BIT(x,3)); } // else @@ -1250,15 +1250,15 @@ WRITE16_MEMBER(igs011_state::vbowl_igs011_prot2_swap_w) READ16_MEMBER(igs011_state::drgnwrldv21_igs011_prot2_r) { // b9 = (!b4) | (!b0 & b2) | (!(b3 ^ b1) & !(!(b4 & b0) | b2)) - UINT8 x = m_prot2; - UINT8 b9 = (BIT(x,4)^1) | ((BIT(x,0)^1) & BIT(x,2)) | ( (BIT(x,3)^BIT(x,1)^1) & ((((BIT(x,4)^1) & BIT(x,0)) | BIT(x,2))^1) ); + uint8_t x = m_prot2; + uint8_t b9 = (BIT(x,4)^1) | ((BIT(x,0)^1) & BIT(x,2)) | ( (BIT(x,3)^BIT(x,1)^1) & ((((BIT(x,4)^1) & BIT(x,0)) | BIT(x,2))^1) ); return (b9 << 9); } READ16_MEMBER(igs011_state::drgnwrldv20j_igs011_prot2_r) { // b9 = (!b4 | !b0) | !(b3 | b1) | !(b2 & b0) - UINT8 x = m_prot2; - UINT8 b9 = ((BIT(x,4)^1) | (BIT(x,0)^1)) | ((BIT(x,3) | BIT(x,1))^1) | ((BIT(x,2) & BIT(x,0))^1); + uint8_t x = m_prot2; + uint8_t b9 = ((BIT(x,4)^1) | (BIT(x,0)^1)) | ((BIT(x,3) | BIT(x,1))^1) | ((BIT(x,2) & BIT(x,0))^1); return (b9 << 9); } @@ -1266,8 +1266,8 @@ READ16_MEMBER(igs011_state::drgnwrldv20j_igs011_prot2_r) READ16_MEMBER(igs011_state::lhb_igs011_prot2_r) { // b9 = !b2 | (b1 & b0) - UINT8 x = m_prot2; - UINT8 b9 = (BIT(x,2)^1) | (BIT(x,1) & BIT(x,0)); + uint8_t x = m_prot2; + uint8_t b9 = (BIT(x,2)^1) | (BIT(x,1) & BIT(x,0)); return (b9 << 9); } @@ -1275,8 +1275,8 @@ READ16_MEMBER(igs011_state::lhb_igs011_prot2_r) READ16_MEMBER(igs011_state::dbc_igs011_prot2_r) { // b9 = !b1 | (!b0 & b2) - UINT8 x = m_prot2; - UINT8 b9 = (BIT(x,1)^1) | ((BIT(x,0)^1) & BIT(x,2)); + uint8_t x = m_prot2; + uint8_t b9 = (BIT(x,1)^1) | ((BIT(x,0)^1) & BIT(x,2)); return (b9 << 9); } @@ -1284,8 +1284,8 @@ READ16_MEMBER(igs011_state::dbc_igs011_prot2_r) READ16_MEMBER(igs011_state::ryukobou_igs011_prot2_r) { // b9 = (!b1 | b2) & b0 - UINT8 x = m_prot2; - UINT8 b9 = ((BIT(x,1)^1) | BIT(x,2)) & BIT(x,0); + uint8_t x = m_prot2; + uint8_t b9 = ((BIT(x,1)^1) | BIT(x,2)) & BIT(x,0); return (b9 << 9); } @@ -1293,16 +1293,16 @@ READ16_MEMBER(igs011_state::ryukobou_igs011_prot2_r) READ16_MEMBER(igs011_state::lhb2_igs011_prot2_r) { // b3 = !b2 | !b1 | b0 - UINT8 x = m_prot2; - UINT8 b3 = (BIT(x,2)^1) | (BIT(x,1)^1) | BIT(x,0); + uint8_t x = m_prot2; + uint8_t b3 = (BIT(x,2)^1) | (BIT(x,1)^1) | BIT(x,0); return (b3 << 3); } // vbowl READ16_MEMBER(igs011_state::vbowl_igs011_prot2_r) { - UINT8 x = m_prot2; - UINT8 b9 = ((BIT(x,4)^1) & (BIT(x,3)^1)) | ((BIT(x,2) & BIT(x,1))^1) | ((BIT(x,4) | BIT(x,0))^1); + uint8_t x = m_prot2; + uint8_t b9 = ((BIT(x,4)^1) & (BIT(x,3)^1)) | ((BIT(x,2) & BIT(x,1))^1) | ((BIT(x,4) | BIT(x,0))^1); return (b9 << 9); } @@ -1414,7 +1414,7 @@ WRITE16_MEMBER(igs011_state::igs012_prot_swap_w) if ( MODE_AND_DATA(0, 0x55) || MODE_AND_DATA(1, 0xa5) ) { // !(3 | 1)..(2 & 1)..(3 ^ 0)..(!2) - UINT8 x = m_igs012_prot; + uint8_t x = m_igs012_prot; m_igs012_prot_swap = (((BIT(x,3)|BIT(x,1))^1)<<3) | ((BIT(x,2)&BIT(x,1))<<2) | ((BIT(x,3)^BIT(x,0))<<1) | (BIT(x,2)^1); } else @@ -1424,10 +1424,10 @@ WRITE16_MEMBER(igs011_state::igs012_prot_swap_w) READ16_MEMBER(igs011_state::igs012_prot_r) { // FIXME: mode 0 and mode 1 are mapped to different memory ranges - UINT8 x = m_igs012_prot; + uint8_t x = m_igs012_prot; - UINT8 b1 = (BIT(x,3) | BIT(x,1))^1; - UINT8 b0 = BIT(x,3) ^ BIT(x,0); + uint8_t b1 = (BIT(x,3) | BIT(x,1))^1; + uint8_t b0 = BIT(x,3) ^ BIT(x,0); return (b1 << 1) | (b0 << 0); } @@ -1619,7 +1619,7 @@ WRITE16_MEMBER(igs011_state::lhb2_igs003_w) case 0x86: case 0x87: { - UINT16 old; + uint16_t old; m_igs003_prot_y = m_igs003_reg[0] & 0x07; m_igs003_prot_z = data; @@ -1891,7 +1891,7 @@ WRITE16_MEMBER(igs011_state::vbowl_igs003_w) case 0x86: case 0x87: { - UINT16 old; + uint16_t old; m_igs003_prot_y = m_igs003_reg[0] & 0x07; m_igs003_prot_z = data; @@ -1967,7 +1967,7 @@ READ16_MEMBER(igs011_state::vbowl_igs003_r) // V0400O DRIVER_INIT_MEMBER(igs011_state,drgnwrld) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); drgnwrld_type1_decrypt(); drgnwrld_gfx_decrypt(); @@ -1993,7 +1993,7 @@ DRIVER_INIT_MEMBER(igs011_state,drgnwrld) DRIVER_INIT_MEMBER(igs011_state,drgnwrldv30) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); drgnwrld_type1_decrypt(); drgnwrld_gfx_decrypt(); @@ -2018,7 +2018,7 @@ DRIVER_INIT_MEMBER(igs011_state,drgnwrldv30) DRIVER_INIT_MEMBER(igs011_state,drgnwrldv21) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); drgnwrld_type2_decrypt(); drgnwrld_gfx_decrypt(); @@ -2047,7 +2047,7 @@ DRIVER_INIT_MEMBER(igs011_state,drgnwrldv21) DRIVER_INIT_MEMBER(igs011_state,drgnwrldv21j) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); drgnwrld_type3_decrypt(); drgnwrld_gfx_decrypt(); @@ -2074,7 +2074,7 @@ DRIVER_INIT_MEMBER(igs011_state,drgnwrldv21j) DRIVER_INIT_MEMBER(igs011_state,drgnwrldv20j) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); drgnwrld_type3_decrypt(); drgnwrld_gfx_decrypt(); @@ -2120,7 +2120,7 @@ DRIVER_INIT_MEMBER(igs011_state,drgnwrldv11h) DRIVER_INIT_MEMBER(igs011_state,drgnwrldv10c) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); drgnwrld_type1_decrypt(); drgnwrld_gfx_decrypt(); @@ -2146,7 +2146,7 @@ DRIVER_INIT_MEMBER(igs011_state,drgnwrldv10c) DRIVER_INIT_MEMBER(igs011_state,lhb) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); lhb_decrypt(); @@ -2156,7 +2156,7 @@ DRIVER_INIT_MEMBER(igs011_state,lhb) DRIVER_INIT_MEMBER(igs011_state,lhbv33c) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); lhb_decrypt(); @@ -2166,7 +2166,7 @@ DRIVER_INIT_MEMBER(igs011_state,lhbv33c) DRIVER_INIT_MEMBER(igs011_state,dbc) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); dbc_decrypt(); @@ -2196,7 +2196,7 @@ DRIVER_INIT_MEMBER(igs011_state,dbc) DRIVER_INIT_MEMBER(igs011_state,ryukobou) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); ryukobou_decrypt(); @@ -2209,7 +2209,7 @@ DRIVER_INIT_MEMBER(igs011_state,ryukobou) DRIVER_INIT_MEMBER(igs011_state,xymg) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); lhb_decrypt(); /* @@ -2243,7 +2243,7 @@ DRIVER_INIT_MEMBER(igs011_state,xymg) DRIVER_INIT_MEMBER(igs011_state,wlcc) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); wlcc_decrypt(); /* @@ -2267,7 +2267,7 @@ DRIVER_INIT_MEMBER(igs011_state,wlcc) DRIVER_INIT_MEMBER(igs011_state,lhb2) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); lhb2_decrypt(); lhb2_decrypt_gfx(); @@ -2290,8 +2290,8 @@ DRIVER_INIT_MEMBER(igs011_state,lhb2) DRIVER_INIT_MEMBER(igs011_state,vbowl) { - UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); - UINT8 *gfx = (UINT8 *) memregion("blitter")->base(); + uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); + uint8_t *gfx = (uint8_t *) memregion("blitter")->base(); int i; vbowlj_decrypt(); @@ -2317,8 +2317,8 @@ DRIVER_INIT_MEMBER(igs011_state,vbowl) DRIVER_INIT_MEMBER(igs011_state,vbowlj) { -// UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); - UINT8 *gfx = (UINT8 *) memregion("blitter")->base(); +// uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); + uint8_t *gfx = (uint8_t *) memregion("blitter")->base(); int i; vbowlj_decrypt(); @@ -2341,7 +2341,7 @@ DRIVER_INIT_MEMBER(igs011_state,vbowlj) DRIVER_INIT_MEMBER(igs011_state,nkishusp) { - UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); nkishusp_decrypt(); lhb2_decrypt_gfx(); diff --git a/src/mame/drivers/igs017.cpp b/src/mame/drivers/igs017.cpp index c2719ef35b9..508567fa4dc 100644 --- a/src/mame/drivers/igs017.cpp +++ b/src/mame/drivers/igs017.cpp @@ -81,7 +81,7 @@ public: optional_device m_igs022; // Mj Shuang Long Qiang Zhu 2 required_device m_screen; required_device m_palette; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; required_device m_igs017_igs031; @@ -89,23 +89,23 @@ public: - UINT8 m_input_select; - UINT8 m_hopper; - UINT16 m_igs_magic[2]; - UINT8 m_scramble_data; + uint8_t m_input_select; + uint8_t m_hopper; + uint16_t m_igs_magic[2]; + uint8_t m_scramble_data; - UINT8 m_dsw_select; + uint8_t m_dsw_select; // lhzb2a protection: - UINT16 m_prot_regs[2], m_prot_val, m_prot_word, m_prot_m3, m_prot_mf; - UINT8 m_prot2; + uint16_t m_prot_regs[2], m_prot_val, m_prot_word, m_prot_m3, m_prot_mf; + uint8_t m_prot2; // IGS029 protection (communication) - UINT8 m_igs029_send_data, m_igs029_recv_data; - UINT8 m_igs029_send_buf[256], m_igs029_recv_buf[256]; + uint8_t m_igs029_send_data, m_igs029_recv_data; + uint8_t m_igs029_send_buf[256], m_igs029_recv_buf[256]; int m_igs029_send_len, m_igs029_recv_len; // IGS029 protection (mgcs) - UINT32 m_igs029_mgcs_long; + uint32_t m_igs029_mgcs_long; DECLARE_WRITE8_MEMBER(input_select_w); @@ -113,10 +113,10 @@ public: DECLARE_WRITE16_MEMBER(mgcs_magic_w); DECLARE_READ16_MEMBER(mgcs_magic_r); - UINT16 mgcs_palette_bitswap(UINT16 bgr); - UINT16 lhzb2a_palette_bitswap(UINT16 bgr); - UINT16 tjsb_palette_bitswap(UINT16 bgr); - UINT16 slqz2_palette_bitswap(UINT16 bgr); + uint16_t mgcs_palette_bitswap(uint16_t bgr); + uint16_t lhzb2a_palette_bitswap(uint16_t bgr); + uint16_t tjsb_palette_bitswap(uint16_t bgr); + uint16_t slqz2_palette_bitswap(uint16_t bgr); DECLARE_READ8_MEMBER(sdmg2_keys_r); DECLARE_WRITE16_MEMBER(sdmg2_magic_w); @@ -167,7 +167,7 @@ public: DECLARE_MACHINE_RESET(iqblocka); DECLARE_MACHINE_RESET(mgcs); DECLARE_MACHINE_RESET(lhzb2a); - UINT32 screen_update_igs017(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_igs017(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(iqblocka_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(mgcs_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(mgdh_interrupt); @@ -184,7 +184,7 @@ public: void tarzan_decrypt_tiles(); void tarzan_decrypt_program_rom(); void tarzana_decrypt_program_rom(); - void starzan_decrypt(UINT8 *ROM, int size, bool isOpcode); + void starzan_decrypt(uint8_t *ROM, int size, bool isOpcode); void lhzb2_patch_rom(); void lhzb2_decrypt_tiles(); void lhzb2_decrypt_sprites(); @@ -208,33 +208,33 @@ void igs017_state::video_start() m_igs017_igs031->video_start(); } -UINT32 igs017_state::screen_update_igs017(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igs017_state::screen_update_igs017(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_igs017_igs031->screen_update_igs017(screen, bitmap, cliprect); return 0; } // palette bitswap callbacks -UINT16 igs017_state::mgcs_palette_bitswap(UINT16 bgr) +uint16_t igs017_state::mgcs_palette_bitswap(uint16_t bgr) { bgr = ((bgr & 0xff00) >> 8) | ((bgr & 0x00ff) << 8); return BITSWAP16(bgr, 7, 8, 9, 2, 14, 3, 13, 15, 12, 11, 10, 0, 1, 4, 5, 6); } -UINT16 igs017_state::lhzb2a_palette_bitswap(UINT16 bgr) +uint16_t igs017_state::lhzb2a_palette_bitswap(uint16_t bgr) { // bgr = ((bgr & 0xff00) >> 8) | ((bgr & 0x00ff) << 8); return BITSWAP16(bgr, 15,9,13,12,11,5,4,8,7,6,0,14,3,2,1,10); } -UINT16 igs017_state::tjsb_palette_bitswap(UINT16 bgr) +uint16_t igs017_state::tjsb_palette_bitswap(uint16_t bgr) { // bitswap return BITSWAP16(bgr, 15,12,3,6,10,5,4,2,9,13,8,7,11,1,0,14); } -UINT16 igs017_state::slqz2_palette_bitswap(UINT16 bgr) +uint16_t igs017_state::slqz2_palette_bitswap(uint16_t bgr) { return BITSWAP16(bgr, 15,14,9,4,11,10,12,3,7,6,5,8,13,2,1,0); } @@ -249,8 +249,8 @@ UINT16 igs017_state::slqz2_palette_bitswap(UINT16 bgr) void igs017_state::decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0) { int length = memregion("maincpu")->bytes(); - UINT8 *rom = memregion("maincpu")->base(); - std::unique_ptr tmp = std::make_unique(length); + uint8_t *rom = memregion("maincpu")->base(); + std::unique_ptr tmp = std::make_unique(length); int i; // decrypt the program ROM @@ -307,7 +307,7 @@ void igs017_state::decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, void igs017_state::iqblocka_patch_rom() { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // rom[0x7b64] = 0xc9; @@ -349,8 +349,8 @@ DRIVER_INIT_MEMBER(igs017_state,iqblockf) void igs017_state::tjsb_decrypt_sprites() { int length = memregion("sprites")->bytes(); - UINT8 *rom = memregion("sprites")->base(); - std::unique_ptr tmp = std::make_unique(length); + uint8_t *rom = memregion("sprites")->base(); + std::unique_ptr tmp = std::make_unique(length); int i, addr; // address lines swap @@ -364,7 +364,7 @@ void igs017_state::tjsb_decrypt_sprites() // data lines swap for (i = 0; i < length; i += 2) { - UINT16 data = (rom[i+1] << 8) | rom[i+0]; // x-22222-11111-00000 + uint16_t data = (rom[i+1] << 8) | rom[i+0]; // x-22222-11111-00000 data = BITSWAP16(data, 15, 14,13,12,11,10, 9,1,7,6,5, 4,3,2,8,0); rom[i+0] = data; rom[i+1] = data >> 8; @@ -384,13 +384,13 @@ DRIVER_INIT_MEMBER(igs017_state,tjsb) void igs017_state::mgcs_decrypt_program_rom() { int i; - UINT16 *src = (UINT16 *)memregion("maincpu")->base(); + uint16_t *src = (uint16_t *)memregion("maincpu")->base(); int rom_size = 0x80000; for (i=0; ibytes(); - UINT8 *rom = memregion("tilemaps")->base(); - std::vector tmp(length); + uint8_t *rom = memregion("tilemaps")->base(); + std::vector tmp(length); int i; memcpy(&tmp[0],rom,length); @@ -449,12 +449,12 @@ void igs017_state::mgcs_decrypt_tiles() void igs017_state::mgcs_flip_sprites() { int length = memregion("sprites")->bytes(); - UINT8 *rom = memregion("sprites")->base(); + uint8_t *rom = memregion("sprites")->base(); int i; for (i = 0;i < length;i+=2) { - UINT16 pixels = (rom[i+1] << 8) | rom[i+0]; + uint16_t pixels = (rom[i+1] << 8) | rom[i+0]; // flip bits pixels = BITSWAP16(pixels,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); @@ -469,7 +469,7 @@ void igs017_state::mgcs_flip_sprites() void igs017_state::mgcs_patch_rom() { -// UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); // rom[0x20666/2] = 0x601e; // 020666: 671E beq $20686 (rom check) @@ -494,8 +494,8 @@ DRIVER_INIT_MEMBER(igs017_state,mgcs) void igs017_state::tarzan_decrypt_tiles() { int length = memregion("tilemaps")->bytes(); - UINT8 *rom = memregion("tilemaps")->base(); - std::vector tmp(length); + uint8_t *rom = memregion("tilemaps")->base(); + std::vector tmp(length); int i; memcpy(&tmp[0],rom,length); @@ -509,13 +509,13 @@ void igs017_state::tarzan_decrypt_tiles() // decryption is incomplete, the first part of code doesn't seem right. void igs017_state::tarzan_decrypt_program_rom() { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); int i; int size = 0x40000; for(i=0; ibase(); + uint8_t *ROM = memregion("maincpu")->base(); int i; int size = 0x80000; for (i = 0; i < size; i++) { - UINT8 x = 0; + uint8_t x = 0; if ((i & 0x00011) == 0x00011) x ^= 0x01; if ((i & 0x02180) == 0x00000) x ^= 0x01; if ((i & 0x001a0) != 0x00020) x ^= 0x20; @@ -567,12 +567,12 @@ DRIVER_INIT_MEMBER(igs017_state,tarzana) // decryption is incomplete: data decryption is correct but opcodes are encrypted differently. -void igs017_state::starzan_decrypt(UINT8 *ROM, int size, bool isOpcode) +void igs017_state::starzan_decrypt(uint8_t *ROM, int size, bool isOpcode) { for(int i=0; ibase(); - UINT8 *code = m_decrypted_opcodes; + uint8_t *data = memregion("maincpu")->base(); + uint8_t *code = m_decrypted_opcodes; memcpy(code, data, size); starzan_decrypt(data, size, false); // data @@ -635,13 +635,13 @@ DRIVER_INIT_MEMBER(igs017_state,starzan) DRIVER_INIT_MEMBER(igs017_state,sdmg2) { int i; - UINT16 *src = (UINT16 *)memregion("maincpu")->base(); + uint16_t *src = (uint16_t *)memregion("maincpu")->base(); int rom_size = 0x80000; for (i=0; ibase(); + uint16_t *src = (uint16_t *)memregion("maincpu")->base(); int rom_size = 0x80000; for (i=0; ibase(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); // additional protection rom[0x4ad50/2] = 0x4e71; @@ -739,7 +739,7 @@ DRIVER_INIT_MEMBER(igs017_state,mgdh) void igs017_state::lhzb2_patch_rom() { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); // Prot. checks: rom[0x14786/2] = 0x6044; // 014786: 6744 beq $147cc @@ -751,8 +751,8 @@ void igs017_state::lhzb2_patch_rom() void igs017_state::lhzb2_decrypt_tiles() { int length = memregion("tilemaps")->bytes(); - UINT8 *rom = memregion("tilemaps")->base(); - std::vector tmp(length); + uint8_t *rom = memregion("tilemaps")->base(); + std::vector tmp(length); int i; int addr; @@ -767,8 +767,8 @@ void igs017_state::lhzb2_decrypt_tiles() void igs017_state::lhzb2_decrypt_sprites() { int length = memregion("sprites")->bytes(); - UINT8 *rom = memregion("sprites")->base(); - std::unique_ptr tmp = std::make_unique(length); + uint8_t *rom = memregion("sprites")->base(); + std::unique_ptr tmp = std::make_unique(length); int i, addr; // address lines swap @@ -782,7 +782,7 @@ void igs017_state::lhzb2_decrypt_sprites() // data lines swap for (i = 0;i < length;i+=2) { - UINT16 data = (rom[i+1] << 8) | rom[i+0]; // x-22222-11111-00000 + uint16_t data = (rom[i+1] << 8) | rom[i+0]; // x-22222-11111-00000 data = BITSWAP16(data, 15, 7,6,5,4,3, 2,1,0,14,13, 12,11,10,9,8); rom[i+0] = data; rom[i+1] = data >> 8; @@ -799,13 +799,13 @@ void igs017_state::igs025_to_igs022_callback( void ) DRIVER_INIT_MEMBER(igs017_state,lhzb2) { int i; - UINT16 *src = (UINT16 *) (memregion("maincpu")->base()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for (i=0; ibase()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for (i=0; ibase(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); // Prot. checks: rom[0x1489c/2] = 0x6044; // 01489C: 6744 beq $148e2 @@ -976,8 +976,8 @@ void igs017_state::slqz2_patch_rom() void igs017_state::slqz2_decrypt_tiles() { int length = memregion("tilemaps")->bytes(); - UINT8 *rom = memregion("tilemaps")->base(); - std::vector tmp(length); + uint8_t *rom = memregion("tilemaps")->base(); + std::vector tmp(length); int i; memcpy(&tmp[0],rom,length); @@ -991,13 +991,13 @@ void igs017_state::slqz2_decrypt_tiles() DRIVER_INIT_MEMBER(igs017_state,slqz2) { int i; - UINT16 *src = (UINT16 *) (memregion("maincpu")->base()); + uint16_t *src = (uint16_t *) (memregion("maincpu")->base()); int rom_size = 0x80000; for (i=0; ibytes(); - UINT8 *rom = memregion("sprites")->base(); - std::unique_ptr tmp = std::make_unique(length); + uint8_t *rom = memregion("sprites")->base(); + std::unique_ptr tmp = std::make_unique(length); int i, addr; // address lines swap @@ -1197,8 +1197,8 @@ void igs017_state::mgcs_igs029_run() if (m_igs029_send_buf[0] == 0x05 && m_igs029_send_buf[1] == 0x5a) { - UINT8 data = m_igs029_send_buf[2]; - UINT8 port = m_igs029_send_buf[3]; + uint8_t data = m_igs029_send_buf[2]; + uint8_t port = m_igs029_send_buf[3]; logerror("PORT %02x = %02x\n", port, data); @@ -1239,7 +1239,7 @@ void igs017_state::mgcs_igs029_run() // No inputs. Returns 1 long - UINT8 min_bets[4] = {1, 2, 3, 5}; + uint8_t min_bets[4] = {1, 2, 3, 5}; m_igs029_recv_len = 0; m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; @@ -1252,7 +1252,7 @@ void igs017_state::mgcs_igs029_run() { logerror("READ DSW\n"); - UINT8 ret; + uint8_t ret; if (~m_dsw_select & 0x01) ret = ioport("DSW1")->read(); else if (~m_dsw_select & 0x02) ret = ioport("DSW2")->read(); else @@ -1406,14 +1406,14 @@ READ16_MEMBER(igs017_state::mgcs_magic_r) case 0x01: { - UINT16 ret = BITSWAP8( (BITSWAP8(m_scramble_data, 0,1,2,3,4,5,6,7) + 1) & 3, 4,5,6,7, 0,1,2,3); + uint16_t ret = BITSWAP8( (BITSWAP8(m_scramble_data, 0,1,2,3,4,5,6,7) + 1) & 3, 4,5,6,7, 0,1,2,3); logerror("%s: reading %02x from igs_magic = %02x\n", machine().describe_context(), ret, m_igs_magic[0]); return ret; } case 0x02: { - UINT8 ret = m_igs029_recv_data; + uint8_t ret = m_igs029_recv_data; logerror("%s: reading %02x from igs_magic = %02x\n", machine().describe_context(), ret, m_igs_magic[0]); return ret; } @@ -1509,7 +1509,7 @@ READ16_MEMBER(igs017_state::sdmg2_magic_r) { case 0x00: { - UINT16 hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001; + uint16_t hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001; return ioport("COINS")->read() | hopper_bit; } @@ -1625,7 +1625,7 @@ READ16_MEMBER(igs017_state::mgdha_magic_r) case 0x03: { - UINT16 hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001; + uint16_t hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001; return ioport("COINS")->read() | hopper_bit; } @@ -1692,7 +1692,7 @@ READ8_MEMBER(igs017_state::tjsb_input_r) case 0x02: return ioport("COINS")->read(); case 0x03: { - UINT8 hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x00 : 0x20; + uint8_t hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x00 : 0x20; return ioport("HOPPER")->read() | hopper_bit; } @@ -1965,10 +1965,10 @@ WRITE16_MEMBER(igs017_state::lhzb2a_prot_w) case 0x86: case 0x87: { - UINT16 x = m_prot_val; - UINT16 mf = m_prot_mf; + uint16_t x = m_prot_val; + uint16_t mf = m_prot_mf; - UINT16 bit0 = 0; + uint16_t bit0 = 0; switch (m_prot_m3) { case 0: bit0 = BIT(~x,12) ^ BIT(~x,15) ^ BIT( x, 8) ^ BIT(~x, 3); break; @@ -1977,7 +1977,7 @@ WRITE16_MEMBER(igs017_state::lhzb2a_prot_w) case 3: bit0 = BIT(~x,15) ^ BIT(~x, 9) ^ BIT( x,12) ^ BIT(~x,11); break; } - UINT16 xor0 = BIT(m_prot_regs[1], m_prot_regs[0] - 0x80); + uint16_t xor0 = BIT(m_prot_regs[1], m_prot_regs[0] - 0x80); bit0 ^= xor0; m_prot_val = ( BIT( x,14) << 15 ) | @@ -2019,8 +2019,8 @@ READ16_MEMBER(igs017_state::lhzb2a_prot_r) { case 0x03: // result { - UINT16 x = m_prot_val; - UINT16 res = (BIT(x, 5) << 7) | + uint16_t x = m_prot_val; + uint16_t res = (BIT(x, 5) << 7) | (BIT(x, 2) << 6) | (BIT(x, 9) << 5) | (BIT(x, 7) << 4) | @@ -2063,8 +2063,8 @@ WRITE16_MEMBER(igs017_state::lhzb2a_prot2_dec_w) READ16_MEMBER(igs017_state::lhzb2a_prot2_r) { - UINT8 x = m_prot2; - UINT8 res = (BIT(x, 0) << 7) | + uint8_t x = m_prot2; + uint8_t res = (BIT(x, 0) << 7) | (BIT(x, 3) << 5) | (BIT(x, 2) << 4) | (BIT(x, 1) << 2) ; @@ -2093,7 +2093,7 @@ READ16_MEMBER(igs017_state::lhzb2a_input_r) case 0x02: { - UINT16 hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x0000 : 0x0002; + uint16_t hopper_bit = (m_hopper && ((m_screen->frame_number()/10)&1)) ? 0x0000 : 0x0002; return (ioport("DSW1")->read() << 8) | ioport("COINS")->read() | hopper_bit; } diff --git a/src/mame/drivers/igs_fear.cpp b/src/mame/drivers/igs_fear.cpp index 19a3976954c..3e01b2fe2a5 100644 --- a/src/mame/drivers/igs_fear.cpp +++ b/src/mame/drivers/igs_fear.cpp @@ -23,7 +23,7 @@ public: DECLARE_DRIVER_INIT(igs_fear); //virtual void video_start(); virtual void video_start_igs_fear(); - UINT32 screen_update_igs_fear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_igs_fear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void pgm_create_dummy_internal_arm_region(); required_device m_maincpu; optional_device m_gfxdecode; @@ -36,7 +36,7 @@ void igs_fear_state::video_start_igs_fear() } -UINT32 igs_fear_state::screen_update_igs_fear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igs_fear_state::screen_update_igs_fear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } @@ -134,7 +134,7 @@ ROM_END void igs_fear_state::pgm_create_dummy_internal_arm_region() { - UINT16 *temp16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *temp16 = (uint16_t *)memregion("maincpu")->base(); // fill with RX 14 int i; diff --git a/src/mame/drivers/igs_m027.cpp b/src/mame/drivers/igs_m027.cpp index 3edc07d09fb..2c1d9e053e6 100644 --- a/src/mame/drivers/igs_m027.cpp +++ b/src/mame/drivers/igs_m027.cpp @@ -38,7 +38,7 @@ public: m_igs017_igs031(*this, "igs017_igs031") { } - optional_shared_ptr m_igs_mainram; + optional_shared_ptr m_igs_mainram; required_device m_maincpu; required_device m_igs017_igs031; @@ -59,7 +59,7 @@ public: DECLARE_DRIVER_INIT(amazoni2); virtual void video_start() override; - UINT32 screen_update_igs_majhong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_igs_majhong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(igs_majhong_interrupt); void sdwx_gfx_decrypt(); @@ -125,7 +125,7 @@ void igs_m027_state::video_start() -UINT32 igs_m027_state::screen_update_igs_majhong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igs_m027_state::screen_update_igs_majhong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_igs017_igs031->screen_update_igs017(screen, bitmap, cliprect); return 0; @@ -180,7 +180,7 @@ ADDRESS_MAP_END ***************************************************************************/ #if 0 -static const UINT8 sdwx_tab[] = +static const uint8_t sdwx_tab[] = { 0x49,0x47,0x53,0x30,0x30,0x35,0x35,0x52,0x44,0x34,0x30,0x32,0x30,0x36,0x32,0x31, 0x8A,0xBB,0x20,0x67,0x97,0xA5,0x20,0x45,0x6B,0xC0,0xE8,0x0C,0x80,0xFB,0x49,0xAA, @@ -207,8 +207,8 @@ void igs_m027_state::sdwx_gfx_decrypt() { int i; unsigned rom_size = 0x80000; - UINT8 *src = (UINT8 *) (memregion("tilemaps")->base()); - std::vector result_data(rom_size); + uint8_t *src = (uint8_t *) (memregion("tilemaps")->base()); + std::vector result_data(rom_size); for (i=0; ibase(); + uint16_t *temp16 = (uint16_t *)memregion("maincpu")->base(); // fill with RX 14 int i; diff --git a/src/mame/drivers/igs_m036.cpp b/src/mame/drivers/igs_m036.cpp index a101a74b3b9..bd26fda4433 100644 --- a/src/mame/drivers/igs_m036.cpp +++ b/src/mame/drivers/igs_m036.cpp @@ -70,7 +70,7 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - UINT32 screen_update_igs_m036(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_igs_m036(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_DRIVER_INIT(igs_m036); DECLARE_DRIVER_INIT(cjdh2); @@ -86,7 +86,7 @@ public: -UINT32 igs_m036_state::screen_update_igs_m036(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igs_m036_state::screen_update_igs_m036(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } @@ -208,7 +208,7 @@ ROM_END void igs_m036_state::pgm_create_dummy_internal_arm_region(void) { - UINT16 *temp16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *temp16 = (uint16_t *)memregion("maincpu")->base(); int i; for (i=0;i<0x4000/2;i+=2) { diff --git a/src/mame/drivers/igspoker.cpp b/src/mame/drivers/igspoker.cpp index 183088c3b78..532526dd575 100644 --- a/src/mame/drivers/igspoker.cpp +++ b/src/mame/drivers/igspoker.cpp @@ -87,9 +87,9 @@ public: m_palette(*this, "palette"){ } required_device m_maincpu; - optional_shared_ptr m_bg_tile_ram; - required_shared_ptr m_fg_tile_ram; - required_shared_ptr m_fg_color_ram; + optional_shared_ptr m_bg_tile_ram; + required_shared_ptr m_fg_tile_ram; + required_shared_ptr m_fg_color_ram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; @@ -98,8 +98,8 @@ public: int m_hopper; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT8 m_out[3]; - UINT8 m_protection_res; + uint8_t m_out[3]; + uint8_t m_protection_res; DECLARE_READ8_MEMBER(igs_irqack_r); DECLARE_WRITE8_MEMBER(igs_irqack_w); @@ -128,8 +128,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_VIDEO_START(cpokerpk); - UINT32 screen_update_igs_video(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cpokerpk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_igs_video(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cpokerpk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(igs_interrupt); }; @@ -208,7 +208,7 @@ void igspoker_state::video_start() m_fg_tilemap->set_transparent_pen(0); } -UINT32 igspoker_state::screen_update_igs_video(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igspoker_state::screen_update_igs_video(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -225,7 +225,7 @@ VIDEO_START_MEMBER(igspoker_state,cpokerpk) m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(igspoker_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); } -UINT32 igspoker_state::screen_update_cpokerpk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igspoker_state::screen_update_cpokerpk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -361,7 +361,7 @@ CUSTOM_INPUT_MEMBER(igspoker_state::hopper_r) READ8_MEMBER(igspoker_state::exp_rom_r) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); return rom[offset+0x10000]; } @@ -1935,7 +1935,7 @@ ROM_END DRIVER_INIT_MEMBER(igspoker_state,cpoker) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0; A < 0x10000; A++) @@ -1949,7 +1949,7 @@ DRIVER_INIT_MEMBER(igspoker_state,cpoker) DRIVER_INIT_MEMBER(igspoker_state,cpokert) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; /* decrypt the program ROM */ @@ -1979,7 +1979,7 @@ DRIVER_INIT_MEMBER(igspoker_state,cpokert) DRIVER_INIT_MEMBER(igspoker_state,cska) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0; A < 0x10000; A++) @@ -1996,7 +1996,7 @@ DRIVER_INIT_MEMBER(igspoker_state,cska) DRIVER_INIT_MEMBER(igspoker_state,igs_ncs) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0; A < 0x10000; A++) @@ -2157,7 +2157,7 @@ Clocks DRIVER_INIT_MEMBER(igspoker_state,igs_ncs2) { - UINT8 *src = (UINT8 *) (memregion("maincpu")->base()); + uint8_t *src = (uint8_t *) (memregion("maincpu")->base()); int i; for(i = 0; i < 0x10000; i++) @@ -2232,7 +2232,7 @@ DRIVER_INIT_MEMBER(igspoker_state,chleague) { int A; int length; - UINT8 *rom; + uint8_t *rom; rom = memregion("maincpu")->base(); length = memregion("maincpu")->bytes(); @@ -2442,7 +2442,7 @@ DRIVER_INIT_MEMBER(igspoker_state,number10) { int A; int length; - UINT8 *rom; + uint8_t *rom; rom = memregion("maincpu")->base(); length = memregion("maincpu")->bytes(); @@ -2476,7 +2476,7 @@ DRIVER_INIT_MEMBER(igspoker_state,number10) /* Descramble graphic */ rom = memregion("gfx1")->base(); length = memregion("gfx1")->bytes(); - std::vector tmp(length); + std::vector tmp(length); memcpy(&tmp[0],rom,length); for (A = 0; A < length; A++) { @@ -2521,7 +2521,7 @@ ROM_END DRIVER_INIT_MEMBER(igspoker_state,cpokerpk) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0x0714; A < 0xF000; A += 0x1000) rom[A] ^= 0x20; @@ -2589,7 +2589,7 @@ ROM_END DRIVER_INIT_MEMBER(igspoker_state,pktet346) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0;A < 0x10000; A++) @@ -2668,7 +2668,7 @@ ROM_END DRIVER_INIT_MEMBER(igspoker_state, kungfu) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0x4000;A < 0x10000; A++) { diff --git a/src/mame/drivers/imds.cpp b/src/mame/drivers/imds.cpp index a707e7df6fa..2c6df441971 100644 --- a/src/mame/drivers/imds.cpp +++ b/src/mame/drivers/imds.cpp @@ -38,13 +38,13 @@ public: DECLARE_READ8_MEMBER(term_r); DECLARE_READ8_MEMBER(term_status_r); DECLARE_WRITE8_MEMBER(kbd_put); - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; }; READ8_MEMBER( imds_state::term_status_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/imds2.cpp b/src/mame/drivers/imds2.cpp index 23094966ab5..46edcaa687b 100644 --- a/src/mame/drivers/imds2.cpp +++ b/src/mame/drivers/imds2.cpp @@ -220,7 +220,7 @@ WRITE8_MEMBER(imds2_state::imds2_ipc_control_w) // See A84, pg 28 of [1] // b3 is ~(bit to be written) // b2-b0 is ~(no. of bit to be written) - UINT8 mask = (1U << (~data & 0x07)); + uint8_t mask = (1U << (~data & 0x07)); if (BIT(data , 3)) { m_ipc_control &= ~mask; @@ -276,7 +276,7 @@ WRITE8_MEMBER(imds2_state::imds2_miscout_w) READ8_MEMBER(imds2_state::imds2_miscin_r) { - UINT8 res = m_ioc_options->read(); + uint8_t res = m_ioc_options->read(); return res | ((m_beeper_timer == 0) << 2); } @@ -524,8 +524,8 @@ I8275_DRAW_CHARACTER_MEMBER(imds2_state::crtc_display_pixels) { unsigned i; const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chargen_byte = m_chargen[ (linecount & 7) | ((unsigned)charcode << 3) ]; - UINT16 pixels; + uint8_t chargen_byte = m_chargen[ (linecount & 7) | ((unsigned)charcode << 3) ]; + uint16_t pixels; if (lten) { pixels = ~0; @@ -534,10 +534,10 @@ I8275_DRAW_CHARACTER_MEMBER(imds2_state::crtc_display_pixels) } else { // See [2], pg 58 for the very peculiar way of generating character images // Here each half-pixel is translated into a full pixel - UINT16 exp_pix_l; - UINT16 exp_pix_r; + uint16_t exp_pix_l; + uint16_t exp_pix_r; - exp_pix_l = (UINT16)chargen_byte; + exp_pix_l = (uint16_t)chargen_byte; exp_pix_l = ((exp_pix_l & 0x80) << 5) | ((exp_pix_l & 0x40) << 4) | ((exp_pix_l & 0x20) << 3) | @@ -633,7 +633,7 @@ void imds2_state::imds2_update_beeper(void) void imds2_state::imds2_update_printer(void) { // Data to printer is ~P1 when STATUS ENABLE/==1, else 0xff (assuming pull-ups on printer) - UINT8 printer_data; + uint8_t printer_data; if ((m_pio_port2 & 0x7f) == 0x6c) { printer_data = 0xff; } else { diff --git a/src/mame/drivers/imolagp.cpp b/src/mame/drivers/imolagp.cpp index 0e43b33c414..5d490f09009 100644 --- a/src/mame/drivers/imolagp.cpp +++ b/src/mame/drivers/imolagp.cpp @@ -103,13 +103,13 @@ public: required_device m_steer_pot_timer; required_ioport m_steer_inp; - UINT8 m_videoram[2][0x4000]; // 2 layers of 16KB - UINT8 m_comms_latch[2]; - UINT8 m_vcontrol; - UINT8 m_vreg[0x10]; - UINT8 m_scroll; - UINT8 m_steerlatch; - UINT8 m_draw_mode; + uint8_t m_videoram[2][0x4000]; // 2 layers of 16KB + uint8_t m_comms_latch[2]; + uint8_t m_vcontrol; + uint8_t m_vreg[0x10]; + uint8_t m_scroll; + uint8_t m_steerlatch; + uint8_t m_draw_mode; DECLARE_WRITE8_MEMBER(transmit_data_w); DECLARE_READ8_MEMBER(trigger_slave_nmi_r); @@ -128,7 +128,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(imolagp); - UINT32 screen_update_imolagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_imolagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -158,26 +158,26 @@ void imolagp_state::video_start() } -UINT32 imolagp_state::screen_update_imolagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t imolagp_state::screen_update_imolagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // draw solid background layer first, then sprites on top for (int layer = 0; layer < 2; layer++) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - const UINT8 *source = &m_videoram[layer][(y & 0xff) * 0x40]; - UINT16 *dest = &bitmap.pix16(y & 0xff); + const uint8_t *source = &m_videoram[layer][(y & 0xff) * 0x40]; + uint16_t *dest = &bitmap.pix16(y & 0xff); for (int i = 0; i < 0x40; i++) { - UINT8 data = source[i]; + uint8_t data = source[i]; if (data || layer == 0) { // one color per each 4 pixels - UINT8 color = (data & 0xf0) >> 3; - UINT8 x = (i << 2) - (m_scroll ^ 3); + uint8_t color = (data & 0xf0) >> 3; + uint8_t x = (i << 2) - (m_scroll ^ 3); for (int x2 = 0; x2 < 4; x2++) { - UINT8 offset = x + x2; + uint8_t offset = x + x2; if (offset >= cliprect.min_x && offset <= cliprect.max_x) dest[offset] = color | (data >> x2 & 1); } @@ -259,7 +259,7 @@ READ8_MEMBER(imolagp_state::trigger_slave_nmi_r) WRITE8_MEMBER(imolagp_state::imola_led_board_w) { // not sure what chip is used here, this is copied from turbo.c - static const UINT8 ls48_map[16] = + static const uint8_t ls48_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; output().set_digit_value(offset, ls48_map[data & 0x0f]); diff --git a/src/mame/drivers/imsai.cpp b/src/mame/drivers/imsai.cpp index c41ada8d586..4c6e92f6eea 100644 --- a/src/mame/drivers/imsai.cpp +++ b/src/mame/drivers/imsai.cpp @@ -43,7 +43,7 @@ public: DECLARE_WRITE_LINE_MEMBER(write_uart_clock); private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; required_device m_maincpu; required_device m_terminal; @@ -80,7 +80,7 @@ INPUT_PORTS_END READ8_MEMBER( imsai_state::keyin_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/inder.cpp b/src/mame/drivers/inder.cpp index 516bda804b8..b9a9fb2eef9 100644 --- a/src/mame/drivers/inder.cpp +++ b/src/mame/drivers/inder.cpp @@ -78,14 +78,14 @@ public: DECLARE_DRIVER_INIT(inder1); private: bool m_pc0; - UINT8 m_game; - UINT8 m_portc; - UINT8 m_row; - UINT8 m_segment[8]; - UINT8 m_sndcmd; - UINT8 m_sndbank; - UINT32 m_sound_addr; - UINT8 *m_p_speech; + uint8_t m_game; + uint8_t m_portc; + uint8_t m_row; + uint8_t m_segment[8]; + uint8_t m_sndcmd; + uint8_t m_sndbank; + uint32_t m_sound_addr; + uint8_t *m_p_speech; virtual void machine_reset() override; required_device m_maincpu; optional_device m_audiocpu; @@ -1178,7 +1178,7 @@ WRITE8_MEMBER( inder_state::sol_canasta_w ) WRITE8_MEMBER( inder_state::disp_w ) { - UINT8 i; + uint8_t i; if (offset < 8) m_segment[offset] = data; else @@ -1194,7 +1194,7 @@ WRITE8_MEMBER( inder_state::disp_w ) WRITE8_MEMBER( inder_state::ppi60a_w ) { if (data) - for (UINT8 i = 0; i < 8; i++) + for (uint8_t i = 0; i < 8; i++) if (BIT(data, i)) m_row = i; } @@ -1203,14 +1203,14 @@ WRITE8_MEMBER( inder_state::ppi60a_w ) WRITE8_MEMBER( inder_state::ppi60b_w ) { if (data & 7) - for (UINT8 i = 0; i < 3; i++) + for (uint8_t i = 0; i < 3; i++) if (BIT(data, i)) m_row = i+8; } WRITE8_MEMBER( inder_state::ppi64c_w ) { - UINT8 i; + uint8_t i; data &= 15; if (BIT(data, 3)) // 8 to 15) { @@ -1227,7 +1227,7 @@ WRITE8_MEMBER( inder_state::ppi64c_w ) WRITE8_MEMBER( inder_state::sndbank_w ) { m_sndbank = data; - UINT8 i; + uint8_t i; // look for last rom enabled for (i = 0; i < 4; i++) if (!(BIT(data, i))) diff --git a/src/mame/drivers/indigo.cpp b/src/mame/drivers/indigo.cpp index 5fe06760c67..5459b32ed69 100644 --- a/src/mame/drivers/indigo.cpp +++ b/src/mame/drivers/indigo.cpp @@ -54,24 +54,24 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); private: struct hpc_t { - UINT8 m_misc_status; - UINT32 m_parbuf_ptr; - UINT32 m_local_ioreg0_mask; - UINT32 m_local_ioreg1_mask; - UINT32 m_vme_intmask0; - UINT32 m_vme_intmask1; - UINT32 m_scsi0_descriptor; - UINT32 m_scsi0_dma_ctrl; + uint8_t m_misc_status; + uint32_t m_parbuf_ptr; + uint32_t m_local_ioreg0_mask; + uint32_t m_local_ioreg1_mask; + uint32_t m_vme_intmask0; + uint32_t m_vme_intmask1; + uint32_t m_scsi0_descriptor; + uint32_t m_scsi0_dma_ctrl; }; struct rtc_t { - UINT8 nRAM[32]; + uint8_t nRAM[32]; }; required_device m_maincpu; @@ -110,7 +110,7 @@ void indigo_state::video_start() { } -UINT32 indigo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t indigo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } @@ -276,7 +276,7 @@ WRITE32_MEMBER(indigo_state::hpc_w) #if 0 if (data & 0x80) { - UINT32 next; + uint32_t next; osd_printf_info("DMA activated for SCSI0\n"); osd_printf_info("Descriptor block:\n"); diff --git a/src/mame/drivers/indy_indigo2.cpp b/src/mame/drivers/indy_indigo2.cpp index 5eadc569c0a..a82db77fa31 100644 --- a/src/mame/drivers/indy_indigo2.cpp +++ b/src/mame/drivers/indy_indigo2.cpp @@ -74,7 +74,7 @@ class ioc2_device : public device_t { public: - ioc2_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, UINT8 id); + ioc2_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, uint8_t id); DECLARE_WRITE32_MEMBER( write ); DECLARE_READ32_MEMBER( read ); @@ -83,10 +83,10 @@ public: DECLARE_INPUT_CHANGED_MEMBER( volume_down ); DECLARE_INPUT_CHANGED_MEMBER( volume_up ); - void lower_local0_irq(UINT8 source_mask); - void raise_local0_irq(UINT8 source_mask); - void lower_local1_irq(UINT8 source_mask); - void raise_local1_irq(UINT8 source_mask); + void lower_local0_irq(uint8_t source_mask); + void raise_local0_irq(uint8_t source_mask); + void lower_local1_irq(uint8_t source_mask); + void raise_local1_irq(uint8_t source_mask); protected: virtual void device_start() override; @@ -101,58 +101,58 @@ protected: required_device m_kbdc; required_device m_pit; - virtual void handle_reset_reg_write(UINT8 data); - - UINT8 m_gen_ctrl_select_reg; - UINT8 m_gen_ctrl_reg; - UINT8 m_front_panel_reg; - - UINT8 m_read_reg; - UINT8 m_dma_sel; - UINT8 m_reset_reg; - UINT8 m_write_reg; - - UINT8 m_int3_local0_status_reg; - UINT8 m_int3_local0_mask_reg; - UINT8 m_int3_local1_status_reg; - UINT8 m_int3_local1_mask_reg; - UINT8 m_int3_map_status_reg; - UINT8 m_int3_map_mask0_reg; - UINT8 m_int3_map_mask1_reg; - UINT8 m_int3_map_pol_reg; - UINT8 m_int3_timer_clear_reg; - UINT8 m_int3_err_status_reg; - - UINT32 m_par_read_cnt; - UINT32 m_par_cntl; - UINT8 m_system_id; + virtual void handle_reset_reg_write(uint8_t data); + + uint8_t m_gen_ctrl_select_reg; + uint8_t m_gen_ctrl_reg; + uint8_t m_front_panel_reg; + + uint8_t m_read_reg; + uint8_t m_dma_sel; + uint8_t m_reset_reg; + uint8_t m_write_reg; + + uint8_t m_int3_local0_status_reg; + uint8_t m_int3_local0_mask_reg; + uint8_t m_int3_local1_status_reg; + uint8_t m_int3_local1_mask_reg; + uint8_t m_int3_map_status_reg; + uint8_t m_int3_map_mask0_reg; + uint8_t m_int3_map_mask1_reg; + uint8_t m_int3_map_pol_reg; + uint8_t m_int3_timer_clear_reg; + uint8_t m_int3_err_status_reg; + + uint32_t m_par_read_cnt; + uint32_t m_par_cntl; + uint8_t m_system_id; }; class ioc2_guinness_device : public ioc2_device { public: - ioc2_guinness_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ioc2_guinness_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) + ioc2_guinness_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ioc2_guinness_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) : ioc2_device(mconfig, type, name, tag, owner, clock, shortname, source, 0x01) { } }; class ioc2_full_house_device : public ioc2_device { public: - ioc2_full_house_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - ioc2_full_house_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) + ioc2_full_house_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ioc2_full_house_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) : ioc2_device(mconfig, type, name, tag, owner, clock, shortname, source, 0x20) { } }; const device_type SGI_IOC2_GUINNESS = &device_creator; const device_type SGI_IOC2_FULL_HOUSE = &device_creator; -ioc2_guinness_device::ioc2_guinness_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ioc2_guinness_device::ioc2_guinness_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ioc2_guinness_device(mconfig, SGI_IOC2_GUINNESS, "SGI IOC2 (Guinness)", tag, owner, clock, "ioc2g", __FILE__) { } -ioc2_full_house_device::ioc2_full_house_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +ioc2_full_house_device::ioc2_full_house_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ioc2_full_house_device(mconfig, SGI_IOC2_FULL_HOUSE, "SGI IOC2 (Full House)", tag, owner, clock, "ioc2f", __FILE__) { } @@ -190,7 +190,7 @@ machine_config_constructor ioc2_device::device_mconfig_additions() const return MACHINE_CONFIG_NAME(ioc2_device); } -ioc2_device::ioc2_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, UINT8 id) +ioc2_device::ioc2_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, uint8_t id) : device_t(mconfig, type, name, tag, owner, clock, shortname, source) , m_maincpu(*this, "^maincpu") , m_scc(*this, SCC_TAG) @@ -276,24 +276,24 @@ void ioc2_device::device_reset() #define INT3_LOCAL1_VSYNC (0x40) #define INT3_LOCAL1_RETRACE (0x80) -void ioc2_device::raise_local0_irq(UINT8 source_mask) +void ioc2_device::raise_local0_irq(uint8_t source_mask) { m_int3_local0_status_reg |= source_mask; m_maincpu->set_input_line(MIPS3_IRQ0, (m_int3_local0_mask_reg & m_int3_local0_status_reg) != 0 ? ASSERT_LINE : CLEAR_LINE); } -void ioc2_device::lower_local0_irq(UINT8 source_mask) +void ioc2_device::lower_local0_irq(uint8_t source_mask) { m_int3_local0_status_reg &= ~source_mask; } -void ioc2_device::raise_local1_irq(UINT8 source_mask) +void ioc2_device::raise_local1_irq(uint8_t source_mask) { m_int3_local1_status_reg |= source_mask; m_maincpu->set_input_line(MIPS3_IRQ1, (m_int3_local1_mask_reg & m_int3_local1_status_reg) != 0 ? ASSERT_LINE : CLEAR_LINE); } -void ioc2_device::lower_local1_irq(UINT8 source_mask) +void ioc2_device::lower_local1_irq(uint8_t source_mask) { m_int3_local1_status_reg &= ~source_mask; } @@ -444,9 +444,9 @@ WRITE32_MEMBER( ioc2_device::write ) // 2 RW Parallel Port DMA Select. A high bit selects the Parallel Port DMA channel. 0\h is the default after reset. [this makes sense. -ed.] // 1 RW ISDN Channel B DMA Select. A high bit selects the Parallel Port DMA channel. 0\h is the default after reset. [is this a copy/paste error? perhaps "Parallel Port" should be "ISDN Channel B"?] // 0 RW [same text as above. Another copy/paste error, maybe? Should be channel A, with the bit selecting DMA channel 0/1 for ISDN channel A, the and the same for ISDN channel B in bit 1?] - UINT8 old = m_dma_sel; + uint8_t old = m_dma_sel; m_dma_sel = data; - UINT8 diff = old ^ m_dma_sel; + uint8_t diff = old ^ m_dma_sel; if (diff & DMA_SEL_CLOCK_SEL_MASK) { if (diff & DMA_SEL_CLOCK_SEL_EXT) @@ -475,7 +475,7 @@ WRITE32_MEMBER( ioc2_device::write ) case 0x84/4: // INT3 Local0 Mask Register { - UINT8 old = m_int3_local0_mask_reg; + uint8_t old = m_int3_local0_mask_reg; m_int3_local0_mask_reg = data; bool old_line = (old & m_int3_local0_status_reg) != 0; bool new_line = (m_int3_local0_mask_reg & m_int3_local0_status_reg) != 0; @@ -486,7 +486,7 @@ WRITE32_MEMBER( ioc2_device::write ) case 0x8c/4: // INT3 Local1 Mask Register { - UINT8 old = m_int3_local0_mask_reg; + uint8_t old = m_int3_local0_mask_reg; m_int3_local0_mask_reg = data; bool old_line = (old & m_int3_local0_status_reg) != 0; bool new_line = (m_int3_local0_mask_reg & m_int3_local0_status_reg) != 0; @@ -519,7 +519,7 @@ WRITE32_MEMBER( ioc2_device::write ) } } -void ioc2_device::handle_reset_reg_write(UINT8 data) +void ioc2_device::handle_reset_reg_write(uint8_t data) { // guinness/fullhouse-specific implementations can handle bit 3 being used for ISDN reset on Indy only and bit 2 for EISA reset on Indigo 2 only, but for now we do nothing with it m_reset_reg = data; @@ -564,28 +564,28 @@ INPUT_CHANGED_MEMBER( ioc2_device::volume_down ) struct hpc3_t { - UINT32 m_enetr_nbdp; - UINT32 m_enetr_cbp; - UINT32 m_unk0; - UINT32 m_unk1; - UINT32 m_ic_unk0; - UINT32 m_scsi0_desc; - UINT32 m_scsi0_dma_ctrl; + uint32_t m_enetr_nbdp; + uint32_t m_enetr_cbp; + uint32_t m_unk0; + uint32_t m_unk1; + uint32_t m_ic_unk0; + uint32_t m_scsi0_desc; + uint32_t m_scsi0_dma_ctrl; }; struct hal2 { - UINT32 m_iar; - UINT32 m_idr[4]; + uint32_t m_iar; + uint32_t m_idr[4]; }; struct pbus_dma_t { - UINT8 m_active; - UINT32 m_cur_ptr; - UINT32 m_desc_ptr; - UINT32 m_next_ptr; - UINT32 m_words_left; + uint8_t m_active; + uint32_t m_cur_ptr; + uint32_t m_desc_ptr; + uint32_t m_next_ptr; + uint32_t m_words_left; }; class ip22_state : public driver_device @@ -640,22 +640,22 @@ protected: required_device m_maincpu; required_device m_wd33c93; - required_shared_ptr m_unkpbus0; - required_shared_ptr m_mainram; + required_shared_ptr m_unkpbus0; + required_shared_ptr m_mainram; required_device m_sgi_mc; required_device m_newport; required_device m_dac; required_device m_ioc2; required_device m_rtc; - void dump_chain(address_space &space, UINT32 ch_base); + void dump_chain(address_space &space, uint32_t ch_base); hpc3_t m_hpc3; hal2 m_hal2; pbus_dma_t m_pbus_dma; - UINT8 m_dma_buffer[4096]; + uint8_t m_dma_buffer[4096]; inline void ATTR_PRINTF(3,4) verboselog(int n_level, const char *s_fmt, ... ); }; @@ -1021,8 +1021,8 @@ TIMER_CALLBACK_MEMBER(ip22_state::ip22_dma) #if 0 if( m_pbus_dma.m_active ) { - UINT16 temp16 = ( m_mainram[(m_pbus_dma.m_cur_ptr - 0x08000000)/4] & 0xffff0000 ) >> 16; - INT16 stemp16 = (INT16)((temp16 >> 8) | (temp16 << 8)); + uint16_t temp16 = ( m_mainram[(m_pbus_dma.m_cur_ptr - 0x08000000)/4] & 0xffff0000 ) >> 16; + int16_t stemp16 = (int16_t)((temp16 >> 8) | (temp16 << 8)); m_dac->write_signed16(stemp16); @@ -1051,14 +1051,14 @@ TIMER_CALLBACK_MEMBER(ip22_state::ip22_dma) READ32_MEMBER(ip22_state::hpc3_pbusdma_r) { - //UINT32 channel = offset / (0x2000/4); + //uint32_t channel = offset / (0x2000/4); //verboselog((machine(), 0, "PBUS DMA Channel %d Read: 0x%08x (%08x)\n", channel, 0x1fb80000 + offset*4, mem_mask ); return 0; } WRITE32_MEMBER(ip22_state::hpc3_pbusdma_w) { - UINT32 channel = offset / (0x2000/4); + uint32_t channel = offset / (0x2000/4); switch( offset & 0x07ff ) { @@ -1170,7 +1170,7 @@ void ip22_state::machine_reset() m_maincpu->mips3drc_set_options(MIPS3DRC_COMPATIBLE_OPTIONS | MIPS3DRC_CHECK_OVERFLOWS); } -void ip22_state::dump_chain(address_space &space, UINT32 ch_base) +void ip22_state::dump_chain(address_space &space, uint32_t ch_base) { printf("node: %08x %08x %08x (len = %x)\n", space.read_dword(ch_base), space.read_dword(ch_base+4), space.read_dword(ch_base+8), space.read_dword(ch_base+4) & 0x3fff); @@ -1204,7 +1204,7 @@ WRITE_LINE_MEMBER(ip22_state::scsi_irq) // HPC3 DMA: host to device if ((m_hpc3.m_scsi0_dma_ctrl & HPC3_DMACTRL_ENABLE) && (m_hpc3.m_scsi0_dma_ctrl & HPC3_DMACTRL_DIR)) { - UINT32 wptr, tmpword; + uint32_t wptr, tmpword; int words, dptr, twords; words = m_wd33c93->get_dma_count(); @@ -1292,9 +1292,9 @@ WRITE_LINE_MEMBER(ip22_state::scsi_irq) // clear DMA on the controller too m_wd33c93->clear_dma(); #if 0 - UINT32 dptr, tmpword; - UINT32 bc = space.read_dword(m_hpc3.m_scsi0_desc + 4); - UINT32 rptr = space.read_dword(m_hpc3.m_scsi0_desc); + uint32_t dptr, tmpword; + uint32_t bc = space.read_dword(m_hpc3.m_scsi0_desc + 4); + uint32_t rptr = space.read_dword(m_hpc3.m_scsi0_desc); int length = bc & 0x3fff; int xie = (bc & 0x20000000) ? 1 : 0; int eox = (bc & 0x80000000) ? 1 : 0; @@ -1346,7 +1346,7 @@ WRITE_LINE_MEMBER(ip22_state::scsi_irq) // HPC3 DMA: device to host if ((m_hpc3.m_scsi0_dma_ctrl & HPC3_DMACTRL_ENABLE) && !(m_hpc3.m_scsi0_dma_ctrl & HPC3_DMACTRL_DIR)) { - UINT32 wptr, tmpword; + uint32_t wptr, tmpword; int words, sptr, twords; words = m_wd33c93->get_dma_count(); diff --git a/src/mame/drivers/instruct.cpp b/src/mame/drivers/instruct.cpp index 13b7a632296..29c77169dd7 100644 --- a/src/mame/drivers/instruct.cpp +++ b/src/mame/drivers/instruct.cpp @@ -75,15 +75,15 @@ public: INTERRUPT_GEN_MEMBER(t2l_int); private: virtual void machine_reset() override; - UINT16 m_lar; - UINT8 m_digit; + uint16_t m_lar; + uint8_t m_digit; bool m_valid_digit; bool m_cassin; bool m_irqstate; required_device m_maincpu; - required_shared_ptr m_p_ram; - required_shared_ptr m_p_smiram; - required_shared_ptr m_p_extram; + required_shared_ptr m_p_ram; + required_shared_ptr m_p_smiram; + required_shared_ptr m_p_extram; required_device m_cass; }; @@ -151,7 +151,7 @@ READ8_MEMBER( instruct_state::portfd_r ) // read keyboard READ8_MEMBER( instruct_state::portfe_r ) { - for (UINT8 i = 0; i < 6; i++) + for (uint8_t i = 0; i < 6; i++) { if (BIT(m_digit, i)) { @@ -176,7 +176,7 @@ READ8_MEMBER( instruct_state::sense_r ) INTERRUPT_GEN_MEMBER( instruct_state::t2l_int ) { - UINT8 hwkeys = ioport("HW")->read(); + uint8_t hwkeys = ioport("HW")->read(); // check RST key if (BIT(hwkeys, 3)) @@ -193,10 +193,10 @@ INTERRUPT_GEN_MEMBER( instruct_state::t2l_int ) } else { - UINT8 switches = ioport("SW")->read(); + uint8_t switches = ioport("SW")->read(); // Set vector from INDIRECT sw - UINT8 vector = BIT(switches, 0) ? 0x87 : 0x07; + uint8_t vector = BIT(switches, 0) ? 0x87 : 0x07; // Check INT sw & key if (BIT(switches, 1)) @@ -322,7 +322,7 @@ void instruct_state::machine_reset() QUICKLOAD_LOAD_MEMBER( instruct_state, instruct ) { - UINT16 i, exec_addr, quick_length, read_; + uint16_t i, exec_addr, quick_length, read_; image_init_result result = image_init_result::FAIL; quick_length = image.length(); @@ -339,7 +339,7 @@ QUICKLOAD_LOAD_MEMBER( instruct_state, instruct ) } else { - std::vector quick_data(quick_length); + std::vector quick_data(quick_length); read_ = image.fread( &quick_data[0], quick_length); if (read_ != quick_length) { diff --git a/src/mame/drivers/interact.cpp b/src/mame/drivers/interact.cpp index 35ecbbf2276..6da7f894e3f 100644 --- a/src/mame/drivers/interact.cpp +++ b/src/mame/drivers/interact.cpp @@ -70,10 +70,10 @@ public: : hec2hrp_state(mconfig, type, tag), m_videoram(*this, "videoram") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; DECLARE_MACHINE_START(interact); DECLARE_MACHINE_RESET(interact); - UINT32 screen_update_interact(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_interact(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -110,9 +110,9 @@ MACHINE_START_MEMBER(interact_state,interact) hector_init(); } -UINT32 interact_state::screen_update_interact(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t interact_state::screen_update_interact(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; screen.set_visible_area(0, 113, 0, 75); hector_hr(bitmap, videoram, 77, 32); return 0; diff --git a/src/mame/drivers/intrscti.cpp b/src/mame/drivers/intrscti.cpp index 9c27cd17f45..3c52f82fe77 100644 --- a/src/mame/drivers/intrscti.cpp +++ b/src/mame/drivers/intrscti.cpp @@ -31,20 +31,20 @@ public: required_device m_maincpu; required_device m_subcpu; - required_shared_ptr m_vram; + required_shared_ptr m_vram; required_device m_gfxdecode; required_device m_palette; DECLARE_DRIVER_INIT(intrscti); virtual void video_start() override; - UINT32 screen_update_intrscti(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_intrscti(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; void intrscti_state::video_start() { } -UINT32 intrscti_state::screen_update_intrscti(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t intrscti_state::screen_update_intrscti(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y,x; int count; @@ -218,7 +218,7 @@ ROM_END DRIVER_INIT_MEMBER(intrscti_state,intrscti) { - UINT8 *cpu = memregion( "maincpu" )->base(); + uint8_t *cpu = memregion( "maincpu" )->base(); int i; for (i=0;i<0x1000;i++) cpu[i+0x8000]=0xc9; // ret diff --git a/src/mame/drivers/intv.cpp b/src/mame/drivers/intv.cpp index 68dec527564..fcceca312c2 100644 --- a/src/mame/drivers/intv.cpp +++ b/src/mame/drivers/intv.cpp @@ -88,7 +88,7 @@ static const unsigned char intv_colors[] = PALETTE_INIT_MEMBER(intv_state, intv) { int k = 0; - UINT8 r, g, b; + uint8_t r, g, b; /* Two copies of everything (why?) */ for (int i = 0; i < 16; i++) diff --git a/src/mame/drivers/inufuku.cpp b/src/mame/drivers/inufuku.cpp index 6bc01f82fd1..80ba8069177 100644 --- a/src/mame/drivers/inufuku.cpp +++ b/src/mame/drivers/inufuku.cpp @@ -119,7 +119,7 @@ WRITE8_MEMBER(inufuku_state::inufuku_soundrombank_w) CUSTOM_INPUT_MEMBER(inufuku_state::soundflag_r) { - UINT16 soundflag = m_pending_command ? 0 : 1; + uint16_t soundflag = m_pending_command ? 0 : 1; return soundflag; } @@ -324,7 +324,7 @@ GFXDECODE_END void inufuku_state::machine_start() { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x00000], 0x8000); membank("bank1")->set_entry(0); diff --git a/src/mame/drivers/invqix.cpp b/src/mame/drivers/invqix.cpp index 02bb74ee05c..20f755cc13d 100644 --- a/src/mame/drivers/invqix.cpp +++ b/src/mame/drivers/invqix.cpp @@ -133,7 +133,7 @@ public: m_vram(*this, "vram") { } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER(port3_r); DECLARE_WRITE16_MEMBER(port3_w); @@ -150,13 +150,13 @@ protected: // devices required_device m_maincpu; required_device m_eeprom; - required_shared_ptr m_vram; + required_shared_ptr m_vram; // driver_device overrides virtual void video_start() override; private: - UINT16 m_vctl; // 0000 for normal, 0001 for flip, 0100 when going to change (blank?) + uint16_t m_vctl; // 0000 for normal, 0001 for flip, 0100 when going to change (blank?) }; @@ -165,7 +165,7 @@ void invqix_state::video_start() save_item(NAME(m_vctl)); } -UINT32 invqix_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t invqix_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; @@ -181,7 +181,7 @@ UINT32 invqix_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, { for(x=0;x<256;x++) { - UINT8 r,g,b; + uint8_t r,g,b; int pen_data; pen_data = (m_vram[(x+y*256)]); @@ -203,7 +203,7 @@ UINT32 invqix_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, { for(x=0;x<256;x++) { - UINT8 r,g,b; + uint8_t r,g,b; int pen_data; pen_data = (m_vram[(256-x)+((256-y)*256)]); diff --git a/src/mame/drivers/ipc.cpp b/src/mame/drivers/ipc.cpp index 04798d223a9..b537510e628 100644 --- a/src/mame/drivers/ipc.cpp +++ b/src/mame/drivers/ipc.cpp @@ -60,14 +60,14 @@ public: DECLARE_READ8_MEMBER( ipc_f4_r ); DECLARE_READ8_MEMBER( ipc_f5_r ); DECLARE_WRITE8_MEMBER( kbd_put ); - UINT8 *m_ram; - UINT8 m_term_data; + uint8_t *m_ram; + uint8_t m_term_data; virtual void machine_reset() override; }; READ8_MEMBER( ipc_state::ipc_f4_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/ipds.cpp b/src/mame/drivers/ipds.cpp index 7dfb1398b31..744ef86aa9d 100644 --- a/src/mame/drivers/ipds.cpp +++ b/src/mame/drivers/ipds.cpp @@ -35,7 +35,7 @@ public: DECLARE_WRITE8_MEMBER(ipds_b1_w); DECLARE_WRITE8_MEMBER(kbd_put); I8275_DRAW_CHARACTER_MEMBER( crtc_display_pixels ); - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; }; @@ -49,7 +49,7 @@ READ8_MEMBER( ipds_state::ipds_b0_r ) READ8_MEMBER( ipds_state::ipds_b1_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -86,8 +86,8 @@ I8275_DRAW_CHARACTER_MEMBER( ipds_state::crtc_display_pixels ) { int i; const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *charmap = memregion("chargen")->base(); - UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; + uint8_t *charmap = memregion("chargen")->base(); + uint8_t pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; if (vsp) pixels = 0; diff --git a/src/mame/drivers/iq151.cpp b/src/mame/drivers/iq151.cpp index 88a085c71bd..13927e1f491 100644 --- a/src/mame/drivers/iq151.cpp +++ b/src/mame/drivers/iq151.cpp @@ -89,11 +89,11 @@ public: DECLARE_READ8_MEMBER(cartslot_io_r); DECLARE_WRITE8_MEMBER(cartslot_io_w); virtual void machine_reset() override; - 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); - UINT8 m_vblank_irq_state; - UINT8 m_cassette_clk; - UINT8 m_cassette_data; + uint8_t m_vblank_irq_state; + uint8_t m_cassette_clk; + uint8_t m_cassette_data; iq151cart_slot_device * m_carts[5]; DECLARE_DRIVER_INIT(iq151); INTERRUPT_GEN_MEMBER(iq151_vblank_interrupt); @@ -104,7 +104,7 @@ public: READ8_MEMBER(iq151_state::keyboard_row_r) { char kbdrow[6]; - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 8; i++) { @@ -118,7 +118,7 @@ READ8_MEMBER(iq151_state::keyboard_row_r) READ8_MEMBER(iq151_state::keyboard_column_r) { char kbdrow[6]; - UINT8 data = 0x00; + uint8_t data = 0x00; for (int i = 0; i < 8; i++) { @@ -132,7 +132,7 @@ READ8_MEMBER(iq151_state::keyboard_column_r) READ8_MEMBER(iq151_state::ppi_portc_r) { - UINT8 data = 0x00; + uint8_t data = 0x00; if (m_cassette_data & 0x06) { @@ -168,7 +168,7 @@ WRITE8_MEMBER(iq151_state::boot_bank_w) READ8_MEMBER(iq151_state::cartslot_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (auto & elem : m_carts) elem->read(offset, data); @@ -184,7 +184,7 @@ WRITE8_MEMBER(iq151_state::cartslot_w) READ8_MEMBER(iq151_state::cartslot_io_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (auto & elem : m_carts) elem->io_read(offset, data); @@ -331,7 +331,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(iq151_state::cassette_timer) DRIVER_INIT_MEMBER(iq151_state,iq151) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entry(0, RAM + 0xf800); membank("boot")->configure_entry(1, RAM + 0x0000); @@ -351,7 +351,7 @@ void iq151_state::machine_reset() } // this machine don't have a built-in video controller, but uses external cartridge -UINT32 iq151_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t iq151_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); diff --git a/src/mame/drivers/iqblock.cpp b/src/mame/drivers/iqblock.cpp index 18f8b20b8f5..8f2fbb9d95a 100644 --- a/src/mame/drivers/iqblock.cpp +++ b/src/mame/drivers/iqblock.cpp @@ -499,7 +499,7 @@ ROM_END DRIVER_INIT_MEMBER(iqblock_state,iqblock) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; /* decrypt the program ROM */ @@ -516,7 +516,7 @@ DRIVER_INIT_MEMBER(iqblock_state,iqblock) DRIVER_INIT_MEMBER(iqblock_state,grndtour) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; /* decrypt the program ROM */ diff --git a/src/mame/drivers/iris3130.cpp b/src/mame/drivers/iris3130.cpp index 11ace305b2f..070c1ae8460 100644 --- a/src/mame/drivers/iris3130.cpp +++ b/src/mame/drivers/iris3130.cpp @@ -94,21 +94,21 @@ public: DECLARE_WRITE_LINE_MEMBER(duartb_irq_handler); required_device m_maincpu; protected: - required_shared_ptr m_mainram; + required_shared_ptr m_mainram; required_device m_duarta; required_device m_duartb; - required_shared_ptr m_bss; - required_shared_ptr m_ptmap; + required_shared_ptr m_bss; + required_shared_ptr m_ptmap; required_device m_rtc; private: - UINT8 m_mbut; - UINT16 m_mquad; - UINT16 m_tdbase; - UINT16 m_tdlmt; - UINT16 m_stkbase; - UINT16 m_stklmt; - UINT8 m_parctl; - UINT8 m_mbp; + uint8_t m_mbut; + uint16_t m_mquad; + uint16_t m_tdbase; + uint16_t m_tdlmt; + uint16_t m_stkbase; + uint16_t m_stklmt; + uint8_t m_parctl; + uint8_t m_mbp; virtual void machine_start() override; virtual void machine_reset() override; inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); @@ -183,7 +183,7 @@ READ16_MEMBER(sgi_ip2_state::sgi_ip2_swtch_r) READ8_MEMBER(sgi_ip2_state::sgi_ip2_clock_ctl_r) { - UINT8 ret = m_rtc->read(space, 1); + uint8_t ret = m_rtc->read(space, 1); verboselog(1, "sgi_ip2_clock_ctl_r: %02x\n", ret); return ret; } @@ -196,7 +196,7 @@ WRITE8_MEMBER(sgi_ip2_state::sgi_ip2_clock_ctl_w) READ8_MEMBER(sgi_ip2_state::sgi_ip2_clock_data_r) { - UINT8 ret = m_rtc->read(space, 0); + uint8_t ret = m_rtc->read(space, 0); verboselog(1, "sgi_ip2_clock_data_r: %02x\n", ret); return ret; } @@ -487,8 +487,8 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER(sgi_ip2_state,sgi_ip2) { - UINT32 *src = (UINT32*)(memregion("maincpu")->base()); - UINT32 *dst = m_mainram; + uint32_t *src = (uint32_t*)(memregion("maincpu")->base()); + uint32_t *dst = m_mainram; memcpy(dst, src, 8); m_maincpu->reset(); diff --git a/src/mame/drivers/irisha.cpp b/src/mame/drivers/irisha.cpp index 7e976357699..2f5142791a9 100644 --- a/src/mame/drivers/irisha.cpp +++ b/src/mame/drivers/irisha.cpp @@ -46,15 +46,15 @@ public: DECLARE_WRITE_LINE_MEMBER(speaker_w); DECLARE_WRITE_LINE_MEMBER(write_uart_clock); TIMER_CALLBACK_MEMBER(irisha_key); - UINT32 screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_videoram; + uint32_t screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; private: bool m_sg1_line; bool m_keypressed; - UINT8 m_keyboard_cnt; - UINT8 m_ppi_porta; - UINT8 m_ppi_portc; + uint8_t m_keyboard_cnt; + uint8_t m_ppi_porta; + uint8_t m_ppi_portc; void update_speaker(); virtual void machine_start() override; virtual void machine_reset() override; @@ -191,11 +191,11 @@ INPUT_PORTS_END *************************************************/ -UINT32 irisha_state::screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t irisha_state::screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 gfx; - UINT16 y,ma=0,x; - UINT16 *p; + uint8_t gfx; + uint16_t y,ma=0,x; + uint16_t *p; for (y = 0; y < 200; y++) { @@ -324,7 +324,7 @@ TIMER_CALLBACK_MEMBER(irisha_state::irisha_key) READ8_MEMBER(irisha_state::irisha_keyboard_r) { - UINT8 keycode; + uint8_t keycode; if (m_keyboard_cnt!=0 && m_keyboard_cnt<11) keycode = m_io_ports[m_keyboard_cnt-1]->read() ^ 0xff; @@ -356,7 +356,7 @@ void irisha_state::machine_start() "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" }; - for ( UINT8 i = 0; i < 10; i++ ) + for ( uint8_t i = 0; i < 10; i++ ) m_io_ports[i] = ioport( keynames[i] ); machine().scheduler().timer_pulse(attotime::from_msec(30), timer_expired_delegate(FUNC(irisha_state::irisha_key),this)); diff --git a/src/mame/drivers/isbc8010.cpp b/src/mame/drivers/isbc8010.cpp index 52812eb7b55..e7e0f9a60cc 100644 --- a/src/mame/drivers/isbc8010.cpp +++ b/src/mame/drivers/isbc8010.cpp @@ -54,7 +54,7 @@ public: , m_usart_clock_state(0) { } - 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); DECLARE_WRITE_LINE_MEMBER( usart_clock_tick ); @@ -66,8 +66,8 @@ private: required_device m_rs232; required_ioport m_usart_baud_rate; - UINT8 m_usart_divide_counter; - UINT8 m_usart_clock_state; + uint8_t m_usart_divide_counter; + uint8_t m_usart_clock_state; }; static ADDRESS_MAP_START(isbc8010_mem, AS_PROGRAM, 8, isbc8010_state) @@ -131,17 +131,17 @@ static GFXDECODE_START( isbc8010 ) GFXDECODE_END #endif -UINT32 isbc8010_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t isbc8010_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } WRITE_LINE_MEMBER( isbc8010_state::usart_clock_tick ) { - UINT8 old_counter = m_usart_divide_counter; + uint8_t old_counter = m_usart_divide_counter; m_usart_divide_counter++; - UINT8 transition = (old_counter ^ m_usart_divide_counter) & m_usart_baud_rate->read(); + uint8_t transition = (old_counter ^ m_usart_divide_counter) & m_usart_baud_rate->read(); if (transition) { m_usart->write_txc(m_usart_clock_state); diff --git a/src/mame/drivers/isbc8030.cpp b/src/mame/drivers/isbc8030.cpp index 5b7e4be1649..bc4b96f2877 100644 --- a/src/mame/drivers/isbc8030.cpp +++ b/src/mame/drivers/isbc8030.cpp @@ -74,8 +74,8 @@ private: required_device m_rs232; required_ioport m_usart_baud_rate; - UINT8 m_usart_divide_counter; - UINT8 m_usart_clock_state; + uint8_t m_usart_divide_counter; + uint8_t m_usart_clock_state; }; static ADDRESS_MAP_START(isbc8030_mem, AS_PROGRAM, 8, isbc8030_state) @@ -108,10 +108,10 @@ INPUT_PORTS_END WRITE_LINE_MEMBER( isbc8030_state::usart_clock_tick ) { - UINT8 old_counter = m_usart_divide_counter; + uint8_t old_counter = m_usart_divide_counter; m_usart_divide_counter++; - UINT8 transition = (old_counter ^ m_usart_divide_counter) & m_usart_baud_rate->read(); + uint8_t transition = (old_counter ^ m_usart_divide_counter) & m_usart_baud_rate->read(); if (transition) { m_usart->write_txc(m_usart_clock_state); diff --git a/src/mame/drivers/istellar.cpp b/src/mame/drivers/istellar.cpp index 272eb7b1e9a..ffc9a63c37d 100644 --- a/src/mame/drivers/istellar.cpp +++ b/src/mame/drivers/istellar.cpp @@ -42,12 +42,12 @@ public: m_palette(*this, "palette") { } required_device m_laserdisc; - required_shared_ptr m_tile_ram; - required_shared_ptr m_tile_control_ram; - required_shared_ptr m_sprite_ram; - UINT8 m_ldp_latch1; - UINT8 m_ldp_latch2; - UINT8 m_z80_2_nmi_enable; + required_shared_ptr m_tile_ram; + required_shared_ptr m_tile_control_ram; + required_shared_ptr m_sprite_ram; + uint8_t m_ldp_latch1; + uint8_t m_ldp_latch2; + uint8_t m_z80_2_nmi_enable; DECLARE_READ8_MEMBER(z80_0_latch1_read); DECLARE_WRITE8_MEMBER(z80_0_latch2_write); DECLARE_READ8_MEMBER(z80_2_ldp_read); @@ -59,7 +59,7 @@ public: DECLARE_DRIVER_INIT(istellar); virtual void machine_start() override; DECLARE_PALETTE_INIT(istellar); - UINT32 screen_update_istellar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_istellar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_callback_istellar); required_device m_maincpu; required_device m_subcpu; @@ -73,7 +73,7 @@ public: /* VIDEO GOODS */ -UINT32 istellar_state::screen_update_istellar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t istellar_state::screen_update_istellar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x, y; @@ -134,7 +134,7 @@ WRITE8_MEMBER(istellar_state::z80_0_latch2_write) /* Z80 2 R/W */ READ8_MEMBER(istellar_state::z80_2_ldp_read) { - UINT8 readResult = m_laserdisc->status_r(); + uint8_t readResult = m_laserdisc->status_r(); logerror("CPU2 : reading LDP : %x\n", readResult); return readResult; } @@ -277,7 +277,7 @@ INPUT_PORTS_END PALETTE_INIT_MEMBER(istellar_state, istellar) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < palette.entries(); i++) @@ -418,7 +418,7 @@ DRIVER_INIT_MEMBER(istellar_state,istellar) #if 0 { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x4465] = 0x00; ROM[0x4466] = 0x00; diff --git a/src/mame/drivers/istrebiteli.cpp b/src/mame/drivers/istrebiteli.cpp index c1538d33c74..a304b71a7f3 100644 --- a/src/mame/drivers/istrebiteli.cpp +++ b/src/mame/drivers/istrebiteli.cpp @@ -33,9 +33,9 @@ class istrebiteli_sound_device : public device_t, public device_sound_interface { public: - istrebiteli_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + istrebiteli_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void sound_w(UINT8 data); + void sound_w(uint8_t data); protected: // device-level overrides virtual void device_start() override; @@ -45,13 +45,13 @@ protected: private: // internal state sound_stream *m_channel; - UINT8 *m_rom; + uint8_t *m_rom; int m_rom_cnt; int m_rom_incr; int m_sample_num; bool m_cnt_reset; bool m_rom_out_en; - UINT8 m_prev_data; + uint8_t m_prev_data; }; extern const device_type ISTREBITELI_SOUND; @@ -60,7 +60,7 @@ extern const device_type ISTREBITELI_SOUND; const device_type ISTREBITELI_SOUND = &device_creator; -istrebiteli_sound_device::istrebiteli_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +istrebiteli_sound_device::istrebiteli_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ISTREBITELI_SOUND, "Istrebiteli Sound", tag, owner, clock, "istrebiteli_sound", __FILE__), device_sound_interface(mconfig, *this), m_channel(nullptr), @@ -100,7 +100,7 @@ void istrebiteli_sound_device::sound_stream_update(sound_stream &stream, stream_ } } -void istrebiteli_sound_device::sound_w(UINT8 data) +void istrebiteli_sound_device::sound_w(uint8_t data) { m_cnt_reset = (data & 2) ? true : false; m_sample_num = (data >> 2) & 7; @@ -159,13 +159,13 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); tilemap_t *m_tilemap; - 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); - UINT8 coin_count; - UINT8 m_spr_ctrl[2]; - UINT8 m_spr_collision[2]; - UINT8 m_spr_xy[8]; - UINT8 m_tileram[16]; + uint8_t coin_count; + uint8_t m_spr_ctrl[2]; + uint8_t m_spr_collision[2]; + uint8_t m_spr_xy[8]; + uint8_t m_tileram[16]; }; void istrebiteli_state::machine_start() @@ -205,8 +205,8 @@ TILE_GET_INFO_MEMBER(istrebiteli_state::get_tile_info) void istrebiteli_state::video_start() { - UINT8 *gfx = memregion("sprite")->base(); - UINT8 temp[64]; + uint8_t *gfx = memregion("sprite")->base(); + uint8_t temp[64]; for (int offs = 0; offs < 0x200; offs += 0x40) { @@ -222,7 +222,7 @@ void istrebiteli_state::video_start() m_tilemap->set_scrolldx(96, 96); } -UINT32 istrebiteli_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t istrebiteli_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(1); diff --git a/src/mame/drivers/itech32.cpp b/src/mame/drivers/itech32.cpp index d28d0c2fda6..b38d9b19d01 100644 --- a/src/mame/drivers/itech32.cpp +++ b/src/mame/drivers/itech32.cpp @@ -633,7 +633,7 @@ READ16_MEMBER(itech32_state::wcbowl_prot_result_r) READ32_MEMBER(itech32_state::itech020_prot_result_r) { - UINT32 result = ((UINT32 *)m_main_ram.target())[m_itech020_prot_address >> 2]; + uint32_t result = ((uint32_t *)m_main_ram.target())[m_itech020_prot_address >> 2]; result >>= (~m_itech020_prot_address & 3) * 8; return (result & 0xff) << 8; } @@ -877,11 +877,11 @@ void itech32_state::nvram_init(nvram_device &nvram, void *base, size_t length) // if nvram is the main RAM, don't overwrite exception vectors int start = (base == m_main_ram) ? 0x80 : 0x00; for (int i = start; i < length; i++) - ((UINT8 *)base)[i] = machine().rand(); + ((uint8_t *)base)[i] = machine().rand(); // due to accessing uninitialized RAM, we need this hack if (m_is_drivedge) - ((UINT32 *)m_main_ram.target())[0x2ce4/4] = 0x0000001e; + ((uint32_t *)m_main_ram.target())[0x2ce4/4] = 0x0000001e; } @@ -939,7 +939,7 @@ READ32_MEMBER(itech32_state::test1_r) if (ACCESSING_BITS_16_23 && !m_written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0x100 + offset*4+1); if (ACCESSING_BITS_8_15 && !m_written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0x100 + offset*4+2); if (ACCESSING_BITS_0_7 && !m_written[0x100 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0x100 + offset*4+3); - return ((UINT32 *)m_main_ram)[0x100/4 + offset]; + return ((uint32_t *)m_main_ram)[0x100/4 + offset]; } WRITE32_MEMBER(itech32_state::test1_w) @@ -948,7 +948,7 @@ WRITE32_MEMBER(itech32_state::test1_w) if (ACCESSING_BITS_16_23) m_written[0x100 + offset*4+1] = 1; if (ACCESSING_BITS_8_15) m_written[0x100 + offset*4+2] = 1; if (ACCESSING_BITS_0_7) m_written[0x100 + offset*4+3] = 1; - COMBINE_DATA(&((UINT32 *)m_main_ram)[0x100/4 + offset]); + COMBINE_DATA(&((uint32_t *)m_main_ram)[0x100/4 + offset]); } READ32_MEMBER(itech32_state::test2_r) @@ -957,7 +957,7 @@ READ32_MEMBER(itech32_state::test2_r) if (ACCESSING_BITS_16_23 && !m_written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0xc00 + offset*4+1); if (ACCESSING_BITS_8_15 && !m_written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0xc00 + offset*4+2); if (ACCESSING_BITS_0_7 && !m_written[0xc00 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", space.device().safe_pc(), 0xc00 + offset*4+3); - return ((UINT32 *)m_main_ram)[0xc00/4 + offset]; + return ((uint32_t *)m_main_ram)[0xc00/4 + offset]; } WRITE32_MEMBER(itech32_state::test2_w) @@ -966,7 +966,7 @@ WRITE32_MEMBER(itech32_state::test2_w) if (ACCESSING_BITS_16_23) m_written[0xc00 + offset*4+1] = 1; if (ACCESSING_BITS_8_15) m_written[0xc00 + offset*4+2] = 1; if (ACCESSING_BITS_0_7) m_written[0xc00 + offset*4+3] = 1; - COMBINE_DATA(&((UINT32 *)m_main_ram)[0xc00/4 + offset]); + COMBINE_DATA(&((uint32_t *)m_main_ram)[0xc00/4 + offset]); } #endif diff --git a/src/mame/drivers/itgambl2.cpp b/src/mame/drivers/itgambl2.cpp index 26c8394e937..ee95595d1e6 100644 --- a/src/mame/drivers/itgambl2.cpp +++ b/src/mame/drivers/itgambl2.cpp @@ -75,7 +75,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(itgambl2); - UINT32 screen_update_itgambl2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_itgambl2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_palette; }; @@ -93,10 +93,10 @@ void itgambl2_state::video_start() } /* (dirty) debug code for looking 8bpps blitter-based gfxs */ -UINT32 itgambl2_state::screen_update_itgambl2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t itgambl2_state::screen_update_itgambl2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; - const UINT8 *blit_ram = memregion("gfx1")->base(); + const uint8_t *blit_ram = memregion("gfx1")->base(); if(machine().input().code_pressed(KEYCODE_Z)) m_test_x++; @@ -132,7 +132,7 @@ UINT32 itgambl2_state::screen_update_itgambl2(screen_device &screen, bitmap_rgb3 { for(x = 0; x < m_test_x; x++) { - UINT32 color; + uint32_t color; color = (blit_ram[count] & 0xff) >> 0; diff --git a/src/mame/drivers/itgambl3.cpp b/src/mame/drivers/itgambl3.cpp index 96ac6efe2b8..95a592a6f6f 100644 --- a/src/mame/drivers/itgambl3.cpp +++ b/src/mame/drivers/itgambl3.cpp @@ -61,7 +61,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(itgambl3); - UINT32 screen_update_itgambl3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_itgambl3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_palette; }; @@ -79,10 +79,10 @@ void itgambl3_state::video_start() } /* (dirty) debug code for looking 8bpps blitter-based gfxs */ -UINT32 itgambl3_state::screen_update_itgambl3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t itgambl3_state::screen_update_itgambl3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; - const UINT8 *blit_ram = memregion("gfx1")->base(); + const uint8_t *blit_ram = memregion("gfx1")->base(); if(machine().input().code_pressed(KEYCODE_Z)) m_test_x++; @@ -118,7 +118,7 @@ UINT32 itgambl3_state::screen_update_itgambl3(screen_device &screen, bitmap_rgb3 { for(x=0;x>0; diff --git a/src/mame/drivers/itgamble.cpp b/src/mame/drivers/itgamble.cpp index c4caaa27b74..d87374c380d 100644 --- a/src/mame/drivers/itgamble.cpp +++ b/src/mame/drivers/itgamble.cpp @@ -70,7 +70,7 @@ public: m_palette(*this, "palette") { } - 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: @@ -92,7 +92,7 @@ void itgamble_state::video_start() { } -UINT32 itgamble_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t itgamble_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen()); return 0; diff --git a/src/mame/drivers/itt3030.cpp b/src/mame/drivers/itt3030.cpp index de73beedcd9..9d101935040 100644 --- a/src/mame/drivers/itt3030.cpp +++ b/src/mame/drivers/itt3030.cpp @@ -236,10 +236,10 @@ public: required_ioport_array<16> m_keyrows; // shared pointers - required_shared_ptr m_vram; + required_shared_ptr m_vram; // screen updates - 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: // driver_device overrides @@ -266,7 +266,7 @@ public: DECLARE_PALETTE_INIT(itt3030); private: - UINT8 m_kbdclk, m_kbdread, m_kbdport2; + uint8_t m_kbdclk, m_kbdread, m_kbdport2; required_device m_gfxdecode; required_device m_palette; floppy_image_device *m_curfloppy; @@ -276,7 +276,7 @@ private: READ8_MEMBER(itt3030_state::vsync_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (machine().first_screen()->vblank()) { @@ -310,7 +310,7 @@ WRITE8_MEMBER(itt3030_state::bank_w) m_48kbank->set_bank(bank); } -UINT32 itt3030_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t itt3030_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int start = m_crtc->upscroll_offset(); for(int y = 0; y < 24; y++ ) @@ -318,7 +318,7 @@ UINT32 itt3030_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap int vramy = (start + y) % 24; for(int x = 0; x < 80; x++ ) { - UINT8 code = m_vram[x + vramy*128]; + uint8_t code = m_vram[x + vramy*128]; int invert = code & 0x80 ? 1 : 0; code &= 0x7f; m_gfxdecode->gfx(invert)->opaque(bitmap,cliprect, code , 0, 0,0, x*8,y*12); @@ -357,7 +357,7 @@ WRITE_LINE_MEMBER(itt3030_state::fdchld_w) */ READ8_MEMBER(itt3030_state::fdc_stat_r) { - UINT8 res = 0; + uint8_t res = 0; floppy_image_device *floppy1 = m_con1 ? m_con1->get_device() : nullptr; floppy_image_device *floppy2 = m_con2 ? m_con2->get_device() : nullptr; floppy_image_device *floppy3 = m_con3 ? m_con3->get_device() : nullptr; diff --git a/src/mame/drivers/jack.cpp b/src/mame/drivers/jack.cpp index 3e0c7c6c499..fa3c4e70489 100644 --- a/src/mame/drivers/jack.cpp +++ b/src/mame/drivers/jack.cpp @@ -125,7 +125,7 @@ READ8_MEMBER(jack_state::striv_question_r) // Read the actual byte from question roms else { - UINT8 *ROM = memregion("user1")->base(); + uint8_t *ROM = memregion("user1")->base(); int real_address; real_address = m_question_address | (offset & 0x3f0) | m_remap_address[offset & 0x0f]; @@ -1471,12 +1471,12 @@ DRIVER_INIT_MEMBER(jack_state,zzyzzyxx) void jack_state::treahunt_decode( ) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* Thanks to Mike Balfour for helping out with the decryption */ for (int A = 0; A < 0x4000; A++) { - UINT8 data = rom[A]; + uint8_t data = rom[A]; if (A & 0x1000) { @@ -1528,7 +1528,7 @@ DRIVER_INIT_MEMBER(jack_state,loverboy) code, the protection device is disabled or changes behaviour via writes at 0xf000 and 0xf008. -AS */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x13] = 0x01; ROM[0x12] = 0x9d; @@ -1538,8 +1538,8 @@ DRIVER_INIT_MEMBER(jack_state,loverboy) DRIVER_INIT_MEMBER(jack_state,striv) { - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 data; + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t data; int A; /* decrypt program rom */ diff --git a/src/mame/drivers/jackal.cpp b/src/mame/drivers/jackal.cpp index e03dec43873..9b768ada806 100644 --- a/src/mame/drivers/jackal.cpp +++ b/src/mame/drivers/jackal.cpp @@ -114,7 +114,7 @@ READ8_MEMBER(jackal_state::jackal_spriteram_r) WRITE8_MEMBER(jackal_state::jackal_rambank_w) { - UINT8 *rgn = memregion("master")->base(); + uint8_t *rgn = memregion("master")->base(); if (data & 0x04) popmessage("jackal_rambank_w %02x", data); @@ -329,7 +329,7 @@ INTERRUPT_GEN_MEMBER(jackal_state::jackal_interrupt) void jackal_state::machine_start() { - UINT8 *ROM = memregion("master")->base(); + uint8_t *ROM = memregion("master")->base(); membank("bank1")->configure_entry(0, &ROM[0x04000]); membank("bank1")->configure_entry(1, &ROM[0x14000]); @@ -340,7 +340,7 @@ void jackal_state::machine_start() void jackal_state::machine_reset() { - UINT8 *rgn = memregion("master")->base(); + uint8_t *rgn = memregion("master")->base(); // HACK: running at the nominal clock rate, music stops working // at the beginning of the game. This fixes it. diff --git a/src/mame/drivers/jackie.cpp b/src/mame/drivers/jackie.cpp index 3873e1e9cc4..98a7b1bf3c7 100644 --- a/src/mame/drivers/jackie.cpp +++ b/src/mame/drivers/jackie.cpp @@ -72,13 +72,13 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_bg_scroll2; - required_shared_ptr m_bg_scroll; - required_shared_ptr m_reel1_ram; - required_shared_ptr m_reel2_ram; - required_shared_ptr m_reel3_ram; - required_shared_ptr m_fg_tile_ram; - required_shared_ptr m_fg_color_ram; + required_shared_ptr m_bg_scroll2; + required_shared_ptr m_bg_scroll; + required_shared_ptr m_reel1_ram; + required_shared_ptr m_reel2_ram; + required_shared_ptr m_reel3_ram; + required_shared_ptr m_fg_tile_ram; + required_shared_ptr m_fg_color_ram; int m_exp_bank; tilemap_t *m_fg_tilemap; @@ -89,8 +89,8 @@ public: int m_nmi_enable; int m_bg_enable; int m_hopper; - UINT8 m_out[3]; - UINT16 m_unk_reg[3][5]; + uint8_t m_out[3]; + uint16_t m_unk_reg[3][5]; DECLARE_WRITE8_MEMBER(fg_tile_w); DECLARE_WRITE8_MEMBER(fg_color_w); @@ -110,8 +110,8 @@ public: DECLARE_WRITE8_MEMBER(igs_irqack_w); DECLARE_READ8_MEMBER(expram_r); - void unk_reg_lo_w( int offset, UINT8 data, int reg ); - void unk_reg_hi_w( int offset, UINT8 data, int reg ); + void unk_reg_lo_w( int offset, uint8_t data, int reg ); + void unk_reg_hi_w( int offset, uint8_t data, int reg ); void show_out(); DECLARE_CUSTOM_INPUT_MEMBER(hopper_r); @@ -126,7 +126,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); TIMER_DEVICE_CALLBACK_MEMBER(irq); }; @@ -215,7 +215,7 @@ void jackie_state::video_start() } -UINT32 jackie_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jackie_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i,j; int startclipmin = 0; @@ -294,7 +294,7 @@ void jackie_state::show_out() #endif } -void jackie_state::unk_reg_lo_w( int offset, UINT8 data, int reg ) +void jackie_state::unk_reg_lo_w( int offset, uint8_t data, int reg ) { m_unk_reg[reg][offset] &= 0xff00; m_unk_reg[reg][offset] |= data; @@ -305,7 +305,7 @@ WRITE8_MEMBER(jackie_state::unk_reg1_lo_w){ unk_reg_lo_w( offset, data, 0 ); } WRITE8_MEMBER(jackie_state::unk_reg2_lo_w){ unk_reg_lo_w( offset, data, 1 ); } WRITE8_MEMBER(jackie_state::unk_reg3_lo_w){ unk_reg_lo_w( offset, data, 2 ); } -void jackie_state::unk_reg_hi_w( int offset, UINT8 data, int reg ) +void jackie_state::unk_reg_hi_w( int offset, uint8_t data, int reg ) { m_unk_reg[reg][offset] &= 0xff; m_unk_reg[reg][offset] |= data << 8; @@ -373,7 +373,7 @@ WRITE8_MEMBER(jackie_state::igs_irqack_w) READ8_MEMBER(jackie_state::expram_r) { - UINT8 *rom = memregion("gfx3")->base(); + uint8_t *rom = memregion("gfx3")->base(); offset += m_exp_bank * 0x8000; // logerror("PC %06X: %04x = %02x\n",space.device().safe_pc(),offset,rom[offset]); @@ -566,7 +566,7 @@ GFXDECODE_END DRIVER_INIT_MEMBER(jackie_state,jackie) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0;A < 0xf000;A++) { diff --git a/src/mame/drivers/jackpool.cpp b/src/mame/drivers/jackpool.cpp index b5528b4fc8b..c0257234633 100644 --- a/src/mame/drivers/jackpool.cpp +++ b/src/mame/drivers/jackpool.cpp @@ -35,15 +35,15 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_vram; - UINT8 m_map_vreg; - required_shared_ptr m_io; + required_shared_ptr m_vram; + uint8_t m_map_vreg; + required_shared_ptr m_io; DECLARE_READ16_MEMBER(jackpool_ff_r); DECLARE_READ16_MEMBER(jackpool_io_r); DECLARE_WRITE16_MEMBER(jackpool_io_w); DECLARE_DRIVER_INIT(jackpool); virtual void video_start() override; - UINT32 screen_update_jackpool(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jackpool(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(jackpool_interrupt); required_device m_maincpu; required_device m_eeprom; @@ -56,7 +56,7 @@ void jackpool_state::video_start() { } -UINT32 jackpool_state::screen_update_jackpool(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jackpool_state::screen_update_jackpool(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int count;// = 0x00000/2; @@ -309,7 +309,7 @@ ROM_END DRIVER_INIT_MEMBER(jackpool_state,jackpool) { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); /* patch NVRAM routine */ rom[0x9040/2] = 0x6602; diff --git a/src/mame/drivers/jade.cpp b/src/mame/drivers/jade.cpp index 38710c20bd8..ad281aea28b 100644 --- a/src/mame/drivers/jade.cpp +++ b/src/mame/drivers/jade.cpp @@ -35,7 +35,7 @@ public: DECLARE_READ8_MEMBER(keyin_r); DECLARE_READ8_MEMBER(status_r); private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; required_device m_maincpu; required_device m_terminal; @@ -64,7 +64,7 @@ INPUT_PORTS_END READ8_MEMBER( jade_state::keyin_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return (ret) ? ret : 0x13; } diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp index a008d2eaaa2..5ec2ad378ef 100644 --- a/src/mame/drivers/jaguar.cpp +++ b/src/mame/drivers/jaguar.cpp @@ -376,7 +376,7 @@ extern const device_type COJAG_HARDDISK; class cojag_hdd : public ide_hdd_device { public: - cojag_hdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + cojag_hdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ide_hdd_device(mconfig, COJAG_HARDDISK, "HDD CoJag", tag, owner, clock, "cojag_hdd", __FILE__) { } @@ -428,7 +428,7 @@ void jaguar_state::machine_reset() /* configure banks for gfx/sound ROMs */ if (m_romboard_region != nullptr) { - UINT8 *romboard = m_romboard_region->base(); + uint8_t *romboard = m_romboard_region->base(); /* graphics banks */ if (m_is_r3000) @@ -477,7 +477,7 @@ void jaguar_state::machine_reset() * ********************************************************************/ /* -emu_file jaguar_state::*jaguar_nvram_fopen( UINT32 openflags) +emu_file jaguar_state::*jaguar_nvram_fopen( uint32_t openflags) { device_image_interface *image = dynamic_cast(machine().device("cart")); osd_file::error filerr; @@ -675,8 +675,8 @@ WRITE32_MEMBER(jaguar_state::dspctrl_w) READ32_MEMBER(jaguar_state::joystick_r) { - UINT16 joystick_result = 0xfffe; - UINT16 joybuts_result = 0xffef; + uint16_t joystick_result = 0xfffe; + uint16_t joybuts_result = 0xffef; int i; static const char *const keynames[2][8] = { @@ -911,7 +911,7 @@ READ32_MEMBER(jaguar_state::gpu_jump_r) READ32_MEMBER(jaguar_state::cojagr3k_main_speedup_r) { - UINT64 curcycles = m_maincpu->total_cycles(); + uint64_t curcycles = m_maincpu->total_cycles(); /* if it's been less than main_speedup_max_cycles cycles since the last time */ if (curcycles - m_main_speedup_last_cycles < m_main_speedup_max_cycles) @@ -985,7 +985,7 @@ READ32_MEMBER(jaguar_state::main_gpu_wait_r) WRITE32_MEMBER(jaguar_state::area51_main_speedup_w) { - UINT64 curcycles = m_maincpu->total_cycles(); + uint64_t curcycles = m_maincpu->total_cycles(); /* store the data */ COMBINE_DATA(m_main_speedup); @@ -1019,7 +1019,7 @@ WRITE32_MEMBER(jaguar_state::area51_main_speedup_w) WRITE32_MEMBER(jaguar_state::area51mx_main_speedup_w) { - UINT64 curcycles = m_maincpu->total_cycles(); + uint64_t curcycles = m_maincpu->total_cycles(); /* store the data */ COMBINE_DATA(&m_main_speedup[offset]); @@ -1217,7 +1217,7 @@ WRITE32_MEMBER(jaguar_state::butch_regs_w) switch((m_butch_regs[offset] & 0xff00) >> 8) { case 0x03: // Read TOC - UINT32 msf; + uint32_t msf; if(m_butch_regs[offset] & 0xff) // Multi Session CD, TODO { @@ -1247,7 +1247,7 @@ WRITE32_MEMBER(jaguar_state::butch_regs_w) break; case 0x14: // Read Long TOC { - UINT32 msf; + uint32_t msf; int ntrks = cdrom_get_last_track(m_cd_file); for(int i=0;ibase(); - UINT32 i; + uint8_t j[4]; + uint8_t *ram = memregion("maincpu")->base(); + uint32_t i; size += addr; logerror("File Loaded to address range %X to %X\n",addr,size-1); for (i = addr; i < size; i+=4) @@ -1999,7 +1999,7 @@ image_init_result jaguar_state::quickload(device_image_interface &image, const c else /* PRG */ if (((m_shared_ram[0x1000] & 0xffff0000) == 0x601A0000) && (m_shared_ram[0x1007] == 0x4A414752)) { - UINT32 type = m_shared_ram[0x1008] >> 16; + uint32_t type = m_shared_ram[0x1008] >> 16; start = ((m_shared_ram[0x1008] & 0xffff) << 16) | (m_shared_ram[0x1009] >> 16); skip = 28; if (type == 2) skip = 42; @@ -2055,7 +2055,7 @@ void jaguar_state::cart_start() DEVICE_IMAGE_LOAD_MEMBER( jaguar_state, jaguar_cart ) { - UINT32 size, load_offset = 0; + uint32_t size, load_offset = 0; if (image.software_entry() == nullptr) { @@ -2530,7 +2530,7 @@ ROM_END * *************************************/ -void jaguar_state::cojag_common_init(UINT16 gpu_jump_offs, UINT16 spin_pc) +void jaguar_state::cojag_common_init(uint16_t gpu_jump_offs, uint16_t spin_pc) { m_is_cojag = true; m_is_jagcd = false; diff --git a/src/mame/drivers/jalmah.cpp b/src/mame/drivers/jalmah.cpp index e95bf5877ec..788c7c2569b 100644 --- a/src/mame/drivers/jalmah.cpp +++ b/src/mame/drivers/jalmah.cpp @@ -150,28 +150,28 @@ public: tilemap_t *m_sc3_tilemap_0; tilemap_t *m_sc3_tilemap_2; tilemap_t *m_sc3_tilemap_3; - required_shared_ptr m_sc0_vram; - optional_shared_ptr m_sc1_vram; - optional_shared_ptr m_sc2_vram; - required_shared_ptr m_sc3_vram; - std::unique_ptrm_jm_scrollram; - std::unique_ptr m_jm_vregs; - UINT16 m_sc0bank; - UINT16 m_pri; - UINT8 m_sc0_prin; - UINT8 m_sc1_prin; - UINT8 m_sc2_prin; - UINT8 m_sc3_prin; - required_shared_ptr m_jm_shared_ram; - required_shared_ptr m_jm_mcu_code; - UINT8 m_mcu_prg; + required_shared_ptr m_sc0_vram; + optional_shared_ptr m_sc1_vram; + optional_shared_ptr m_sc2_vram; + required_shared_ptr m_sc3_vram; + std::unique_ptrm_jm_scrollram; + std::unique_ptr m_jm_vregs; + uint16_t m_sc0bank; + uint16_t m_pri; + uint8_t m_sc0_prin; + uint8_t m_sc1_prin; + uint8_t m_sc2_prin; + uint8_t m_sc3_prin; + required_shared_ptr m_jm_shared_ram; + required_shared_ptr m_jm_mcu_code; + uint8_t m_mcu_prg; int m_respcount; - UINT8 m_test_mode; - UINT16 m_dma_old; - UINT16 m_prg_prot; - UINT8 m_oki_rom; - UINT8 m_oki_bank; - UINT8 m_oki_za; + uint8_t m_test_mode; + uint16_t m_dma_old; + uint16_t m_prg_prot; + uint8_t m_oki_rom; + uint8_t m_oki_bank; + uint8_t m_oki_za; DECLARE_WRITE16_MEMBER(sc0_vram_w); DECLARE_WRITE16_MEMBER(sc3_vram_w); DECLARE_WRITE16_MEMBER(sc1_vram_w); @@ -213,15 +213,15 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_VIDEO_START(urashima); - UINT32 screen_update_jalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_urashima(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_urashima(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(jalmah_mcu_sim); void jalmah_priority_system(); void draw_sc0_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sc1_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sc2_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sc3_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void daireika_palette_dma(UINT16 val); + void daireika_palette_dma(uint16_t val); void daireika_mcu_run(); void mjzoomin_mcu_run(); void urashima_mcu_run(); @@ -338,8 +338,8 @@ void jalmah_state::video_start() m_sc3_tilemap_2 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(jalmah_state::get_sc3_tile_info),this),tilemap_mapper_delegate(FUNC(jalmah_state::range2_8x8),this),8,8,128,64); m_sc3_tilemap_3 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(jalmah_state::get_sc3_tile_info),this),tilemap_mapper_delegate(FUNC(jalmah_state::range3_8x8),this),8,8,64,128); - m_jm_scrollram = std::make_unique(0x80/2); - m_jm_vregs = std::make_unique(0x40/2); + m_jm_scrollram = std::make_unique(0x80/2); + m_jm_vregs = std::make_unique(0x40/2); m_sc0_tilemap_0->set_transparent_pen(15); m_sc0_tilemap_1->set_transparent_pen(15); @@ -367,8 +367,8 @@ VIDEO_START_MEMBER(jalmah_state,urashima) m_sc0_tilemap_0 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(jalmah_state::get_sc0_tile_info),this),tilemap_mapper_delegate(FUNC(jalmah_state::range0_16x16),this),16,16,256,32); m_sc3_tilemap_0 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(jalmah_state::get_sc3_tile_info),this),tilemap_mapper_delegate(FUNC(jalmah_state::range2_8x8),this),8,8,128,64); - m_jm_scrollram = std::make_unique(0x80/2); - m_jm_vregs = std::make_unique(0x40/2); + m_jm_scrollram = std::make_unique(0x80/2); + m_jm_vregs = std::make_unique(0x40/2); m_sc0_tilemap_0->set_transparent_pen(15); m_sc3_tilemap_0->set_transparent_pen(15); @@ -386,9 +386,9 @@ priority = 8, then 4, 2 and finally 1). ***************************************************************************************/ void jalmah_state::jalmah_priority_system() { - UINT8 *pri_rom = memregion("user1")->base(); - UINT8 i; - UINT8 prinum[0x10]; + uint8_t *pri_rom = memregion("user1")->base(); + uint8_t i; + uint8_t prinum[0x10]; m_sc0_prin = 0; m_sc1_prin = 0; @@ -452,10 +452,10 @@ void jalmah_state::draw_sc3_layer(screen_device &screen, bitmap_ind16 &bitmap, c } } -UINT32 jalmah_state::screen_update_jalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jalmah_state::screen_update_jalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 *jm_scrollram = m_jm_scrollram.get(); - UINT8 cur_prin; + uint16_t *jm_scrollram = m_jm_scrollram.get(); + uint8_t cur_prin; jalmah_priority_system(); m_sc0_tilemap_0->set_scrollx(0, jm_scrollram[0] & 0xfff); @@ -512,9 +512,9 @@ UINT32 jalmah_state::screen_update_jalmah(screen_device &screen, bitmap_ind16 &b return 0; } -UINT32 jalmah_state::screen_update_urashima(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jalmah_state::screen_update_urashima(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 *jm_scrollram = m_jm_scrollram.get(); + uint16_t *jm_scrollram = m_jm_scrollram.get(); /*this game doesn't use the RANGE register at all.*/ m_sc0_tilemap_0->set_scrollx(0, jm_scrollram[0]); m_sc3_tilemap_0->set_scrollx(0, jm_scrollram[3]); @@ -601,8 +601,8 @@ WRITE16_MEMBER(jalmah_state::jalmah_tilebank_w) WRITE16_MEMBER(jalmah_state::jalmah_scroll_w) { - UINT16 *jm_scrollram = m_jm_scrollram.get(); - UINT16 *jm_vregs = m_jm_vregs.get(); + uint16_t *jm_scrollram = m_jm_scrollram.get(); + uint16_t *jm_vregs = m_jm_vregs.get(); //logerror("[%04x]<-%04x\n",(offset+0x10)*2,data); switch(offset+(0x10)) { @@ -657,8 +657,8 @@ WRITE16_MEMBER(jalmah_state::urashima_sc3_vram_w) /*Urashima Mahjong uses a bigger (and mostly unused/wasted) video register ram.*/ WRITE16_MEMBER(jalmah_state::urashima_vregs_w) { - UINT16 *jm_scrollram = m_jm_scrollram.get(); - UINT16 *jm_vregs = m_jm_vregs.get(); + uint16_t *jm_scrollram = m_jm_scrollram.get(); + uint16_t *jm_vregs = m_jm_vregs.get(); //logerror("[%04x]<-%04x\n",(offset)*2,data); switch(offset) { @@ -734,17 +734,17 @@ WRITE16_MEMBER(jalmah_state::urashima_dma_w) { if(data & 4) { - UINT32 i; + uint32_t i; for(i = 0; i < 0x200; i += 2) space.write_word(0x88200 + i, space.read_word(0x88400 + i)); } } /*same as $f00c0 sub-routine,but with additional work-around,to remove from here...*/ -void jalmah_state::daireika_palette_dma(UINT16 val) +void jalmah_state::daireika_palette_dma(uint16_t val) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT32 index_1, index_2, src_addr, tmp_addr; + uint32_t index_1, index_2, src_addr, tmp_addr; /*a0=301c0+jm_shared_ram[0x540/2] & 0xf00 */ /*a1=88000*/ src_addr = 0x301c0 + (val * 0x40); @@ -764,7 +764,7 @@ void jalmah_state::daireika_palette_dma(UINT16 val) /*RAM-based protection handlings*/ void jalmah_state::daireika_mcu_run() { - UINT16 *jm_shared_ram = m_jm_shared_ram; + uint16_t *jm_shared_ram = m_jm_shared_ram; if(((jm_shared_ram[0x550/2] & 0xf00) == 0x700) && ((jm_shared_ram[0x540/2] & 0xf00) != m_dma_old)) { @@ -813,7 +813,7 @@ void jalmah_state::daireika_mcu_run() void jalmah_state::mjzoomin_mcu_run() { - UINT16 *jm_shared_ram = m_jm_shared_ram; + uint16_t *jm_shared_ram = m_jm_shared_ram; if(m_test_mode) //service_mode { @@ -857,7 +857,7 @@ void jalmah_state::mjzoomin_mcu_run() void jalmah_state::urashima_mcu_run() { - UINT16 *jm_shared_ram = m_jm_shared_ram; + uint16_t *jm_shared_ram = m_jm_shared_ram; if(m_test_mode) //service_mode { @@ -901,7 +901,7 @@ void jalmah_state::urashima_mcu_run() void jalmah_state::second_mcu_run() { - UINT16 *jm_shared_ram = m_jm_shared_ram; + uint16_t *jm_shared_ram = m_jm_shared_ram; if(m_test_mode) //service_mode { jm_shared_ram[0x200/2] = ioport("KEY0")->read(); @@ -971,7 +971,7 @@ WRITE16_MEMBER(jalmah_state::jalmah_okirom_w) { if(ACCESSING_BITS_0_7) { - UINT8 *oki = memregion("oki")->base(); + uint8_t *oki = memregion("oki")->base(); m_oki_rom = data & 1; @@ -988,7 +988,7 @@ WRITE16_MEMBER(jalmah_state::jalmah_okibank_w) { if(ACCESSING_BITS_0_7) { - UINT8 *oki = memregion("oki")->base(); + uint8_t *oki = memregion("oki")->base(); m_oki_bank = data & 3; @@ -1778,8 +1778,8 @@ data value is REQ under mjzoomin video test menu.It is related to the MCU? */ WRITE16_MEMBER(jalmah_state::urashima_mcu_w) { - UINT16 *jm_shared_ram = m_jm_shared_ram; - UINT16 *jm_mcu_code = m_jm_mcu_code; + uint16_t *jm_shared_ram = m_jm_shared_ram; + uint16_t *jm_mcu_code = m_jm_mcu_code; if(ACCESSING_BITS_0_7 && data) { /******************************************************* @@ -1994,14 +1994,14 @@ READ16_MEMBER(jalmah_state::daireika_mcu_r) /* data value is REQ under mjzoomin video test menu.It is related to the MCU? */ -static const UINT16 dai_mcu_code[0x11] = { 0x33c5, 0x0010, 0x07fe, 0x3a39,0x000f,0x000c,0xda86,0x0245, +static const uint16_t dai_mcu_code[0x11] = { 0x33c5, 0x0010, 0x07fe, 0x3a39,0x000f,0x000c,0xda86,0x0245, 0x003f, 0x33c5, 0x000f, 0x000c,0x3a39,0x0010,0x07fe,0x4e75 }; WRITE16_MEMBER(jalmah_state::daireika_mcu_w) { - UINT16 *jm_shared_ram = m_jm_shared_ram; - UINT16 *jm_mcu_code = m_jm_mcu_code; - UINT16 i; + uint16_t *jm_shared_ram = m_jm_shared_ram; + uint16_t *jm_mcu_code = m_jm_mcu_code; + uint16_t i; if(ACCESSING_BITS_0_7 && data) { @@ -2275,8 +2275,8 @@ data value is REQ under mjzoomin video test menu.It is related to the MCU? */ WRITE16_MEMBER(jalmah_state::mjzoomin_mcu_w) { - UINT16 *jm_shared_ram = m_jm_shared_ram; - UINT16 *jm_mcu_code = m_jm_mcu_code; + uint16_t *jm_shared_ram = m_jm_shared_ram; + uint16_t *jm_mcu_code = m_jm_mcu_code; if(ACCESSING_BITS_0_7 && data) { /****************************************************** diff --git a/src/mame/drivers/jangou.cpp b/src/mame/drivers/jangou.cpp index ba6e0c150b1..ed3bf5086c5 100644 --- a/src/mame/drivers/jangou.cpp +++ b/src/mame/drivers/jangou.cpp @@ -55,16 +55,16 @@ public: /* sound-related */ // Jangou CVSD Sound emu_timer *m_cvsd_bit_timer; - UINT8 m_cvsd_shiftreg; + uint8_t m_cvsd_shiftreg; int m_cvsd_shift_cnt; // Jangou Lady ADPCM Sound - UINT8 m_adpcm_byte; + uint8_t m_adpcm_byte; int m_msm5205_vclk_toggle; /* misc */ - UINT8 m_mux_data; - UINT8 m_nsc_latch; - UINT8 m_z80_latch; + uint8_t m_mux_data; + uint8_t m_nsc_latch; + uint8_t m_z80_latch; /* devices */ required_device m_cpu_0; @@ -100,7 +100,7 @@ public: DECLARE_MACHINE_RESET(jngolady); DECLARE_MACHINE_START(common); DECLARE_MACHINE_RESET(common); - UINT32 screen_update_jangou(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jangou(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(cvsd_bit_timer_callback); DECLARE_WRITE_LINE_MEMBER(jngolady_vclk_cb); @@ -117,7 +117,7 @@ public: /* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */ PALETTE_INIT_MEMBER(jangou_state, jangou) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); static const int resistances_rg[3] = { 1000, 470, 220 }; static const int resistances_b [2] = { 470, 220 }; double weights_rg[3], weights_b[2]; @@ -160,23 +160,23 @@ void jangou_state::video_start() m_tmp_bitmap = std::make_unique(256, 256); } -UINT32 jangou_state::screen_update_jangou(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jangou_state::screen_update_jangou(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; for (y = cliprect.min_y; y <= cliprect.max_y; ++y) { - UINT8 *src = &m_blitter->m_blit_buffer[y * 256 + cliprect.min_x]; - UINT16 *dst = &m_tmp_bitmap->pix16(y, cliprect.min_x); + uint8_t *src = &m_blitter->m_blit_buffer[y * 256 + cliprect.min_x]; + uint16_t *dst = &m_tmp_bitmap->pix16(y, cliprect.min_x); for (x = cliprect.min_x; x <= cliprect.max_x; x += 2) { - UINT32 srcpix = *src++; + uint32_t srcpix = *src++; *dst++ = m_palette->pen(srcpix & 0xf); *dst++ = m_palette->pen((srcpix >> 4) & 0xf); } } - //void copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect) + //void copybitmap(bitmap_rgb32 &dest, const bitmap_rgb32 &src, int flipx, int flipy, int32_t destx, int32_t desty, const rectangle &cliprect) copybitmap(bitmap, *m_tmp_bitmap, flip_screen(), flip_screen(),0,0, cliprect); @@ -1219,7 +1219,7 @@ DRIVER_INIT_MEMBER(jangou_state,luckygrl) { // this is WRONG int A; - UINT8 *ROM = memregion("cpu0")->base(); + uint8_t *ROM = memregion("cpu0")->base(); unsigned char patn1[32] = { 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, @@ -1233,7 +1233,7 @@ DRIVER_INIT_MEMBER(jangou_state,luckygrl) for (A = 0; A < 0x3000; A++) { - UINT8 dat = ROM[A]; + uint8_t dat = ROM[A]; if (A&0x100) dat = dat ^ patn2[A & 0x1f]; else dat = dat ^ patn1[A & 0x1f]; diff --git a/src/mame/drivers/jankenmn.cpp b/src/mame/drivers/jankenmn.cpp index f504b477348..d94ebd1ae22 100644 --- a/src/mame/drivers/jankenmn.cpp +++ b/src/mame/drivers/jankenmn.cpp @@ -178,7 +178,7 @@ public: * Read/Write Handlers * *********************************************/ -static const UINT8 led_map[16] = // 7748 IC? +static const uint8_t led_map[16] = // 7748 IC? { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0x00 }; WRITE8_MEMBER(jankenmn_state::lamps1_w) diff --git a/src/mame/drivers/jantotsu.cpp b/src/mame/drivers/jantotsu.cpp index 94a3cbd8710..b115bb299e2 100644 --- a/src/mame/drivers/jantotsu.cpp +++ b/src/mame/drivers/jantotsu.cpp @@ -111,19 +111,19 @@ public: m_palette(*this, "palette"){ } /* sound-related */ - UINT32 m_adpcm_pos; - UINT8 m_adpcm_idle; + uint32_t m_adpcm_pos; + uint8_t m_adpcm_idle; int m_adpcm_data; - UINT8 m_adpcm_trigger; + uint8_t m_adpcm_trigger; /* misc */ - UINT8 m_mux_data; + uint8_t m_mux_data; /* video-related */ - UINT8 m_vram_bank; - UINT8 m_col_bank; - UINT8 m_display_on; - UINT8 m_bitmap[0x8000]; + uint8_t m_vram_bank; + uint8_t m_col_bank; + uint8_t m_display_on; + uint8_t m_bitmap[0x8000]; DECLARE_READ8_MEMBER(jantotsu_bitmap_r); DECLARE_WRITE8_MEMBER(jantotsu_bitmap_w); DECLARE_WRITE8_MEMBER(bankaddr_w); @@ -135,7 +135,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(jantotsu); - UINT32 screen_update_jantotsu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jantotsu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(jan_adpcm_int); required_device m_maincpu; required_device m_adpcm; @@ -154,11 +154,11 @@ void jantotsu_state::video_start() save_item(NAME(m_bitmap)); } -UINT32 jantotsu_state::screen_update_jantotsu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t jantotsu_state::screen_update_jantotsu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x, y, i; int count = 0; - UINT8 pen_i; + uint8_t pen_i; if(!m_display_on) return 0; @@ -167,7 +167,7 @@ UINT32 jantotsu_state::screen_update_jantotsu(screen_device &screen, bitmap_rgb3 { for (x = 0; x < 256; x += 8) { - UINT8 color; + uint8_t color; for (i = 0; i < 8; i++) { @@ -211,7 +211,7 @@ WRITE8_MEMBER(jantotsu_state::bankaddr_w) PALETTE_INIT_MEMBER(jantotsu_state, jantotsu) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit0, bit1, bit2, r, g, b; int i; @@ -246,7 +246,7 @@ READ8_MEMBER(jantotsu_state::jantotsu_mux_r) { const char *const portnames[] = { "PL1_1", "PL1_2", "PL1_3", "PL1_4", "PL2_1", "PL2_2", "PL2_3", "PL2_4" }; - UINT8 i,res; + uint8_t i,res; // printf("%02x\n", m_mux_data); res = ioport("COINS")->read(); @@ -307,7 +307,7 @@ WRITE_LINE_MEMBER(jantotsu_state::jan_adpcm_int) } else { - UINT8 *ROM = memregion("adpcm")->base(); + uint8_t *ROM = memregion("adpcm")->base(); m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0) >> 4)); m_adpcm->data_w(m_adpcm_data & 0xf); diff --git a/src/mame/drivers/jchan.cpp b/src/mame/drivers/jchan.cpp index fa8857ddff3..e24d28f5be2 100644 --- a/src/mame/drivers/jchan.cpp +++ b/src/mame/drivers/jchan.cpp @@ -189,19 +189,19 @@ public: required_device m_spritegen2; required_device m_view2_0; - required_shared_ptr m_spriteram_1; - required_shared_ptr m_sprregs_1; - required_shared_ptr m_spriteram_2; - required_shared_ptr m_sprregs_2; - required_shared_ptr m_mainsub_shared_ram; - required_shared_ptr m_ctrl; + required_shared_ptr m_spriteram_1; + required_shared_ptr m_sprregs_1; + required_shared_ptr m_spriteram_2; + required_shared_ptr m_sprregs_2; + required_shared_ptr m_mainsub_shared_ram; + required_shared_ptr m_ctrl; std::unique_ptr m_sprite_bitmap_1; std::unique_ptr m_sprite_bitmap_2; - std::unique_ptr m_sprite_ram32_1; - std::unique_ptr m_sprite_ram32_2; - std::unique_ptr m_sprite_regs32_1; - std::unique_ptr m_sprite_regs32_2; + std::unique_ptr m_sprite_ram32_1; + std::unique_ptr m_sprite_ram32_2; + std::unique_ptr m_sprite_regs32_1; + std::unique_ptr m_sprite_regs32_2; int m_irq_sub_enable; DECLARE_WRITE16_MEMBER(ctrl_w); @@ -216,7 +216,7 @@ public: DECLARE_DRIVER_INIT(jchan); virtual void video_start() override; - 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); TIMER_DEVICE_CALLBACK_MEMBER(vblank); }; @@ -266,11 +266,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(jchan_state::vblank) void jchan_state::video_start() { /* so we can use sknsspr.c */ - m_sprite_ram32_1 = std::make_unique(0x4000/4); - m_sprite_ram32_2 = std::make_unique(0x4000/4); + m_sprite_ram32_1 = std::make_unique(0x4000/4); + m_sprite_ram32_2 = std::make_unique(0x4000/4); - m_sprite_regs32_1 = std::make_unique(0x40/4); - m_sprite_regs32_2 = std::make_unique(0x40/4); + m_sprite_regs32_1 = std::make_unique(0x40/4); + m_sprite_regs32_2 = std::make_unique(0x40/4); m_sprite_bitmap_1 = std::make_unique(1024,1024); m_sprite_bitmap_2 = std::make_unique(1024,1024); @@ -291,14 +291,14 @@ void jchan_state::video_start() -UINT32 jchan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jchan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; - UINT16* src1; - UINT16* src2; - UINT16* dst; - UINT16 pixdata1; - UINT16 pixdata2; + uint16_t* src1; + uint16_t* src2; + uint16_t* dst; + uint16_t pixdata1; + uint16_t pixdata2; bitmap.fill(m_palette->black_pen(), cliprect); diff --git a/src/mame/drivers/jclub2.cpp b/src/mame/drivers/jclub2.cpp index daae934128e..b25f1491c73 100644 --- a/src/mame/drivers/jclub2.cpp +++ b/src/mame/drivers/jclub2.cpp @@ -121,15 +121,15 @@ public: tilemap_t *m_tmap; tilemap_t *m_tmap2; - optional_shared_ptr m_tmapram; - optional_shared_ptr m_tmapscroll; - optional_shared_ptr m_tmapram2; - optional_shared_ptr m_tmapscroll2; - UINT32 m_input_sel; - UINT32 m_input_sel_jc_1p; - UINT32 m_input_sel_jc_2p; + optional_shared_ptr m_tmapram; + optional_shared_ptr m_tmapscroll; + optional_shared_ptr m_tmapram2; + optional_shared_ptr m_tmapscroll2; + uint32_t m_input_sel; + uint32_t m_input_sel_jc_1p; + uint32_t m_input_sel_jc_2p; int m_jclub2_gfx_index; - optional_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram; optional_device m_gdfs_st0020; required_device m_gamecpu; required_device m_eeprom; @@ -151,9 +151,9 @@ public: DECLARE_VIDEO_START(darkhors); DECLARE_VIDEO_START(jclub2); DECLARE_VIDEO_START(jclub2o); - UINT32 screen_update_darkhors(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_jclub2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_darkhors(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jclub2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(darkhors_irq); void draw_sprites_darkhors(bitmap_ind16 &bitmap, const rectangle &cliprect); optional_device m_gfxdecode; @@ -178,15 +178,15 @@ public: TILE_GET_INFO_MEMBER(darkhors_state::get_tile_info_0) { - UINT16 tile = m_tmapram[tile_index] >> 16; - UINT16 color = m_tmapram[tile_index] & 0xffff; + uint16_t tile = m_tmapram[tile_index] >> 16; + uint16_t color = m_tmapram[tile_index] & 0xffff; SET_TILE_INFO_MEMBER(0, tile/2, (color & 0x200) ? (color & 0x1ff) : ((color & 0x0ff) * 4) , 0); } TILE_GET_INFO_MEMBER(darkhors_state::get_tile_info_1) { - UINT16 tile = m_tmapram2[tile_index] >> 16; - UINT16 color = m_tmapram2[tile_index] & 0xffff; + uint16_t tile = m_tmapram2[tile_index] >> 16; + uint16_t color = m_tmapram2[tile_index] & 0xffff; SET_TILE_INFO_MEMBER(0, tile/2, (color & 0x200) ? (color & 0x1ff) : ((color & 0x0ff) * 4) , 0); } @@ -203,8 +203,8 @@ WRITE32_MEMBER(darkhors_state::darkhors_tmapram2_w) void darkhors_state::draw_sprites_darkhors(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT32 *s = m_spriteram; - UINT32 *end = m_spriteram + 0x02000/4; + uint32_t *s = m_spriteram; + uint32_t *end = m_spriteram + 0x02000/4; for ( ; s < end; s += 8/4 ) { @@ -245,7 +245,7 @@ VIDEO_START_MEMBER(darkhors_state,darkhors) m_gfxdecode->gfx(0)->set_granularity(64); /* 256 colour sprites with palette selectable on 64 colour boundaries */ } -UINT32 darkhors_state::screen_update_darkhors(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t darkhors_state::screen_update_darkhors(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; @@ -370,7 +370,7 @@ READ32_MEMBER(darkhors_state::darkhors_input_sel_r) READ32_MEMBER(darkhors_state::p_580004) { -UINT32 ret = ioport("580004")->read()& 0x00ffffff; +uint32_t ret = ioport("580004")->read()& 0x00ffffff; switch (m_input_sel_jc_2p){ case 0x01: return ret | (ioport("580004-01")->read()<<24); case 0x02: return ret | (ioport("580004-02")->read()<<24); @@ -388,7 +388,7 @@ switch (m_input_sel_jc_2p){ READ32_MEMBER(darkhors_state::p_4e0000) { -UINT32 ret = ioport("4E0000")->read()& 0x00ffffff; +uint32_t ret = ioport("4E0000")->read()& 0x00ffffff; switch (m_input_sel_jc_2p){ case 0x01: return ret | (ioport("4E0000-01")->read()<<24); case 0x02: return ret | (ioport("4E0000-02")->read()<<24); @@ -996,7 +996,7 @@ VIDEO_START_MEMBER(darkhors_state,jclub2) { } -UINT32 darkhors_state::screen_update_jclub2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t darkhors_state::screen_update_jclub2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // this isn't an st0020.. m_gdfs_st0020->st0020_draw_all(bitmap, cliprect); @@ -1067,7 +1067,7 @@ VIDEO_START_MEMBER(darkhors_state,jclub2o) { } -UINT32 darkhors_state::screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t darkhors_state::screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_gdfs_st0020->st0020_draw_all(bitmap, cliprect); return 0; @@ -1305,11 +1305,11 @@ DRIVER_INIT_MEMBER(darkhors_state,darkhors) // the eeprom contains the game ID, which must be valid for it to boot // is there a way (key sequence) to reprogram it?? // I bet the original sets need similar get further in their boot sequence - UINT8 *eeprom = (UINT8 *) memregion("eeprom")->base(); + uint8_t *eeprom = (uint8_t *) memregion("eeprom")->base(); if (eeprom != 0x00) { size_t len = memregion("eeprom")->bytes(); - std::vector temp(len); + std::vector temp(len); int i; for (i = 0; i < len; i++) temp[i] = eeprom[BITSWAP8(i,7,5,4,3,2,1,0,6)]; diff --git a/src/mame/drivers/jedi.cpp b/src/mame/drivers/jedi.cpp index 47242667e31..ed22eeaf888 100644 --- a/src/mame/drivers/jedi.cpp +++ b/src/mame/drivers/jedi.cpp @@ -208,7 +208,7 @@ WRITE8_MEMBER(jedi_state::rom_banksel_w) READ8_MEMBER(jedi_state::a2d_data_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch (m_a2d_select) { diff --git a/src/mame/drivers/jeutel.cpp b/src/mame/drivers/jeutel.cpp index f8288b4ae03..9977c942037 100644 --- a/src/mame/drivers/jeutel.cpp +++ b/src/mame/drivers/jeutel.cpp @@ -41,8 +41,8 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_a); private: bool m_timer_a; - UINT8 m_sndcmd; - UINT8 m_digit; + uint8_t m_sndcmd; + uint8_t m_digit; virtual void machine_reset() override; required_device m_maincpu; required_device m_cpu2; @@ -114,7 +114,7 @@ WRITE8_MEMBER( jeutel_state::porta_w ) WRITE8_MEMBER( jeutel_state::ppi0a_w ) { - UINT16 segment; + uint16_t segment; bool blank = !BIT(data, 7); if (BIT(data, 6)) diff --git a/src/mame/drivers/jokrwild.cpp b/src/mame/drivers/jokrwild.cpp index 12e73a822f5..304641d669d 100644 --- a/src/mame/drivers/jokrwild.cpp +++ b/src/mame/drivers/jokrwild.cpp @@ -90,8 +90,8 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(jokrwild_videoram_w); DECLARE_WRITE8_MEMBER(jokrwild_colorram_w); @@ -102,7 +102,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(jokrwild); - UINT32 screen_update_jokrwild(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jokrwild(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -143,7 +143,7 @@ void jokrwild_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(jokrwild_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 24, 26); } -UINT32 jokrwild_state::screen_update_jokrwild(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jokrwild_state::screen_update_jokrwild(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -490,7 +490,7 @@ DRIVER_INIT_MEMBER(jokrwild_state,jokrwild) *****************************************************************************/ { int i, offs; - UINT8 *srcp = memregion( "maincpu" )->base(); + uint8_t *srcp = memregion( "maincpu" )->base(); for (i = 0x8000; i < 0x10000; i++) { diff --git a/src/mame/drivers/jollyjgr.cpp b/src/mame/drivers/jollyjgr.cpp index ac9ab451145..debd0ca52c0 100644 --- a/src/mame/drivers/jollyjgr.cpp +++ b/src/mame/drivers/jollyjgr.cpp @@ -120,22 +120,22 @@ public: m_bm_palette(*this, "bm_palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - required_shared_ptr m_bitmap; - optional_shared_ptr m_bulletram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_bitmap; + optional_shared_ptr m_bulletram; /* video-related */ tilemap_t *m_bg_tilemap; /* misc */ - UINT8 m_nmi_enable; - UINT8 m_flip_x; - UINT8 m_flip_y; - UINT8 m_bitmap_disable; - UINT8 m_tilemap_bank; - UINT8 m_pri; + uint8_t m_nmi_enable; + uint8_t m_flip_x; + uint8_t m_flip_y; + uint8_t m_bitmap_disable; + uint8_t m_tilemap_bank; + uint8_t m_pri; DECLARE_WRITE8_MEMBER(jollyjgr_videoram_w); DECLARE_WRITE8_MEMBER(jollyjgr_attrram_w); DECLARE_WRITE8_MEMBER(jollyjgr_misc_w); @@ -145,8 +145,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(jollyjgr); - UINT32 screen_update_jollyjgr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_fspider(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jollyjgr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fspider(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(jollyjgr_interrupt); void draw_bitmap( bitmap_rgb32 &bitmap ); required_device m_maincpu; @@ -420,7 +420,7 @@ INPUT_PORTS_END /* tilemap / sprites palette */ PALETTE_INIT_MEMBER(jollyjgr_state, jollyjgr) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); for (int i = 0; i < 32; i++) { @@ -498,9 +498,9 @@ void jollyjgr_state::draw_bitmap( bitmap_rgb32 &bitmap ) } } -UINT32 jollyjgr_state::screen_update_jollyjgr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t jollyjgr_state::screen_update_jollyjgr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 *spriteram = m_spriteram; + uint8_t *spriteram = m_spriteram; int offs; bitmap.fill(m_bm_palette->pen_color(0), cliprect); @@ -553,7 +553,7 @@ UINT32 jollyjgr_state::screen_update_jollyjgr(screen_device &screen, bitmap_rgb3 return 0; } -UINT32 jollyjgr_state::screen_update_fspider(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t jollyjgr_state::screen_update_fspider(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // Draw bg and sprites screen_update_jollyjgr(screen, bitmap, cliprect); @@ -563,9 +563,9 @@ UINT32 jollyjgr_state::screen_update_fspider(screen_device &screen, bitmap_rgb32 Assume bullets to look the same as on Galaxian hw, that is, simply 4 pixels. Colours are unknown. */ for (int offs=0;offs<0x10;offs+=2) { - UINT8 sy=~m_bulletram[offs]; - UINT8 sx=~m_bulletram[offs|1]; - UINT16 bc=(offs<4)? + uint8_t sy=~m_bulletram[offs]; + uint8_t sx=~m_bulletram[offs|1]; + uint16_t bc=(offs<4)? 7: // player, white 3; // enemy, yellow diff --git a/src/mame/drivers/jongkyo.cpp b/src/mame/drivers/jongkyo.cpp index 2697805726f..eefafe13c89 100644 --- a/src/mame/drivers/jongkyo.cpp +++ b/src/mame/drivers/jongkyo.cpp @@ -43,13 +43,13 @@ public: m_maincpu(*this, "maincpu") { } /* misc */ - UINT8 m_rom_bank; - UINT8 m_mux_data; - UINT8 m_flip_screen; + uint8_t m_rom_bank; + uint8_t m_mux_data; + uint8_t m_flip_screen; /* memory pointers */ - required_shared_ptr m_videoram; - UINT8 m_videoram2[0x4000]; + required_shared_ptr m_videoram; + uint8_t m_videoram2[0x4000]; DECLARE_WRITE8_MEMBER(bank_select_w); DECLARE_WRITE8_MEMBER(mux_w); DECLARE_WRITE8_MEMBER(jongkyo_coin_counter_w); @@ -62,7 +62,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(jongkyo); - UINT32 screen_update_jongkyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jongkyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -77,7 +77,7 @@ void jongkyo_state::video_start() { } -UINT32 jongkyo_state::screen_update_jongkyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jongkyo_state::screen_update_jongkyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y; @@ -89,9 +89,9 @@ UINT32 jongkyo_state::screen_update_jongkyo(screen_device &screen, bitmap_ind16 { int b; int res_x,res_y; - UINT8 data1; - UINT8 data2; - UINT8 data3; + uint8_t data1; + uint8_t data2; + uint8_t data3; // data3 = m_videoram2[x/4 + y*64]; // wrong @@ -161,7 +161,7 @@ WRITE8_MEMBER(jongkyo_state::jongkyo_coin_counter_w) READ8_MEMBER(jongkyo_state::input_1p_r) { - UINT8 cr_clear = ioport("CR_CLEAR")->read(); + uint8_t cr_clear = ioport("CR_CLEAR")->read(); switch (m_mux_data) { @@ -180,7 +180,7 @@ READ8_MEMBER(jongkyo_state::input_1p_r) READ8_MEMBER(jongkyo_state::input_2p_r) { - UINT8 coin_port = ioport("COINS")->read(); + uint8_t coin_port = ioport("COINS")->read(); switch (m_mux_data) { @@ -452,7 +452,7 @@ INPUT_PORTS_END PALETTE_INIT_MEMBER(jongkyo_state, jongkyo) { int i; - UINT8* proms = memregion("proms")->base(); + uint8_t* proms = memregion("proms")->base(); for (i = 0; i < 0x40; i++) { int data = proms[i]; @@ -557,7 +557,7 @@ ROM_END DRIVER_INIT_MEMBER(jongkyo_state,jongkyo) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* first of all, do a simple bitswap */ for (int i = 0x6000; i < 0x8c00; ++i) @@ -565,7 +565,7 @@ DRIVER_INIT_MEMBER(jongkyo_state,jongkyo) rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0); } - UINT8 *opcodes = auto_alloc_array(machine(), UINT8, 0x6c00+0x400*8); + uint8_t *opcodes = auto_alloc_array(machine(), uint8_t, 0x6c00+0x400*8); segacrpt_z80_device* cpu = (segacrpt_z80_device*)machine().device(":maincpu"); diff --git a/src/mame/drivers/jonos.cpp b/src/mame/drivers/jonos.cpp index 9188de5bc70..b487877e81d 100644 --- a/src/mame/drivers/jonos.cpp +++ b/src/mame/drivers/jonos.cpp @@ -31,10 +31,10 @@ public: { } DECLARE_DRIVER_INIT(jonos); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_videoram; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; private: - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; virtual void machine_reset() override; virtual void video_start() override; required_device m_maincpu; @@ -65,16 +65,16 @@ void jonos_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 jonos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jonos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for (y = 0; y < 25; y++) { for (ra = 0; ra < 12; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 80; x++) { diff --git a/src/mame/drivers/joystand.cpp b/src/mame/drivers/joystand.cpp index 88cd4581426..12a84006bed 100644 --- a/src/mame/drivers/joystand.cpp +++ b/src/mame/drivers/joystand.cpp @@ -153,13 +153,13 @@ public: required_device m_oki; // memory pointers - required_shared_ptr m_bg1_ram; - required_shared_ptr m_bg2_ram; - required_shared_ptr m_bg15_0_ram; - required_shared_ptr m_bg15_1_ram; - required_shared_ptr m_scroll; - required_shared_ptr m_enable; - required_shared_ptr m_outputs; + required_shared_ptr m_bg1_ram; + required_shared_ptr m_bg2_ram; + required_shared_ptr m_bg15_0_ram; + required_shared_ptr m_bg15_1_ram; + required_shared_ptr m_scroll; + required_shared_ptr m_enable; + required_shared_ptr m_outputs; // tilemaps tilemap_t *m_bg1_tmap; @@ -174,7 +174,7 @@ public: DECLARE_WRITE16_MEMBER(bg15_0_w); DECLARE_WRITE16_MEMBER(bg15_1_w); static const rgb_t BG15_TRANSPARENT; - void draw_bg15_tile(address_space &space, int x, int y, UINT16 code); + void draw_bg15_tile(address_space &space, int x, int y, uint16_t code); void draw_bg15_tilemap(); bool bg15_tiles_dirty; @@ -194,7 +194,7 @@ public: DECLARE_WRITE16_MEMBER(outputs_w); // screen updates - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void video_start() override; // machine @@ -213,13 +213,13 @@ const rgb_t joystand_state::BG15_TRANSPARENT = 0x99999999; TILE_GET_INFO_MEMBER(joystand_state::get_bg1_tile_info) { - UINT32 code = (m_bg1_ram[tile_index * 2 + 0] << 16) | m_bg1_ram[tile_index * 2 + 1]; + uint32_t code = (m_bg1_ram[tile_index * 2 + 0] << 16) | m_bg1_ram[tile_index * 2 + 1]; SET_TILE_INFO_MEMBER(0, code & 0x00ffffff, code >> 24, 0); } TILE_GET_INFO_MEMBER(joystand_state::get_bg2_tile_info) { - UINT32 code = (m_bg2_ram[tile_index * 2 + 0] << 16) | m_bg2_ram[tile_index * 2 + 1]; + uint32_t code = (m_bg2_ram[tile_index * 2 + 0] << 16) | m_bg2_ram[tile_index * 2 + 1]; SET_TILE_INFO_MEMBER(0, code & 0x00ffffff, code >> 24, 0); } @@ -244,12 +244,12 @@ WRITE16_MEMBER(joystand_state::bg2_w) // pixel-based WRITE16_MEMBER(joystand_state::bg15_0_w) { - UINT16 val = COMBINE_DATA(&m_bg15_0_ram[offset]); + uint16_t val = COMBINE_DATA(&m_bg15_0_ram[offset]); m_bg15_bitmap[0].pix32(offset >> 9, offset & 0x1ff) = (val & 0x8000) ? BG15_TRANSPARENT : m_bg15_palette->pen_color(val & 0x7fff); } // tile-based -void joystand_state::draw_bg15_tile(address_space &space, int x, int y, UINT16 code) +void joystand_state::draw_bg15_tile(address_space &space, int x, int y, uint16_t code) { x *= 16; y *= 16; @@ -259,7 +259,7 @@ void joystand_state::draw_bg15_tile(address_space &space, int x, int y, UINT16 c { for (int tx = 0; tx < 16; ++tx) { - UINT16 val = space.read_word(srcaddr + ty * 16 * 2 + tx * 2); + uint16_t val = space.read_word(srcaddr + ty * 16 * 2 + tx * 2); m_bg15_bitmap[1].pix32(y + ty , x + tx) = (val & 0x8000) ? BG15_TRANSPARENT : m_bg15_palette->pen_color(val & 0x7fff); } } @@ -273,7 +273,7 @@ void joystand_state::draw_bg15_tilemap() bg15_tiles_dirty = false; address_space &space = m_maincpu->space(AS_PROGRAM); - UINT16 *src = m_bg15_1_ram + 2/2; + uint16_t *src = m_bg15_1_ram + 2/2; for (int y = 0; y < 0x10; ++y) { for (int x = 0; x < 0x20; ++x) @@ -287,7 +287,7 @@ void joystand_state::draw_bg15_tilemap() WRITE16_MEMBER(joystand_state::bg15_1_w) { - UINT16 code = COMBINE_DATA(&m_bg15_1_ram[offset]); + uint16_t code = COMBINE_DATA(&m_bg15_1_ram[offset]); if ((offset & 0x83) == 0x01) draw_bg15_tile(space, (offset/4) & 0x1f, offset/0x100, code); } @@ -315,7 +315,7 @@ void joystand_state::video_start() bg15_tiles_dirty = true; } -UINT32 joystand_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t joystand_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { int layers_ctrl = -1; diff --git a/src/mame/drivers/jp.cpp b/src/mame/drivers/jp.cpp index a7d335e4788..f2150c0f5f1 100644 --- a/src/mame/drivers/jp.cpp +++ b/src/mame/drivers/jp.cpp @@ -40,8 +40,8 @@ public: DECLARE_DRIVER_INIT(jp); private: bool m_clock_bit; - UINT8 m_row; - UINT32 m_disp_data; + uint8_t m_row; + uint32_t m_disp_data; virtual void machine_reset() override; required_device m_maincpu; }; @@ -180,7 +180,7 @@ INPUT_PORTS_END WRITE8_MEMBER( jp_state::disp_w ) { - UINT8 i; + uint8_t i; m_row = data >> 3; // d3..d7 = switch strobes // d0 = data; d1 = clock; d2 = strobe @@ -193,7 +193,7 @@ WRITE8_MEMBER( jp_state::disp_w ) if (BIT(data, 2)) { - UINT8 segment, t = (m_disp_data >> 24) & 15; + uint8_t segment, t = (m_disp_data >> 24) & 15; if (t == 8) { // ball number segment = m_disp_data >> 6; diff --git a/src/mame/drivers/jpmimpct.cpp b/src/mame/drivers/jpmimpct.cpp index 54394084b62..f57727acceb 100644 --- a/src/mame/drivers/jpmimpct.cpp +++ b/src/mame/drivers/jpmimpct.cpp @@ -208,7 +208,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(jpmimpct_state::duart_1_timer_event) READ16_MEMBER(jpmimpct_state::duart_1_r) { struct duart_t &duart_1 = m_duart_1; - UINT16 val = 0xffff; + uint16_t val = 0xffff; switch (offset) { case 0x1: @@ -382,7 +382,7 @@ READ16_MEMBER(jpmimpct_state::duart_2_r) } case 0xb: { - UINT16 val = m_touch_data[m_touch_cnt]; + uint16_t val = m_touch_data[m_touch_cnt]; if (m_touch_cnt++ == 3) m_touch_cnt = 0; @@ -426,7 +426,7 @@ WRITE16_MEMBER(jpmimpct_state::duart_2_w) READ16_MEMBER(jpmimpct_state::inputs1_r) { - UINT16 val = 0x00ff; + uint16_t val = 0x00ff; switch (offset) { @@ -1000,7 +1000,7 @@ MACHINE_RESET_MEMBER(jpmimpct_state,impctawp) */ READ16_MEMBER(jpmimpct_state::inputs1awp_r) { - UINT16 val = 0x00; + uint16_t val = 0x00; { switch (offset) diff --git a/src/mame/drivers/jpmmps.cpp b/src/mame/drivers/jpmmps.cpp index 2809d3e0005..7986c1cdd70 100644 --- a/src/mame/drivers/jpmmps.cpp +++ b/src/mame/drivers/jpmmps.cpp @@ -142,8 +142,8 @@ public: m_psg(*this, "sn"), m_meters(*this, "meters") { } - UINT8 m_sound_buffer; - UINT8 m_psg_latch; + uint8_t m_sound_buffer; + uint8_t m_psg_latch; virtual void machine_reset() override; protected: diff --git a/src/mame/drivers/jpmsys5.cpp b/src/mame/drivers/jpmsys5.cpp index 4cfaf25ec89..458808aa15b 100644 --- a/src/mame/drivers/jpmsys5.cpp +++ b/src/mame/drivers/jpmsys5.cpp @@ -93,7 +93,7 @@ WRITE16_MEMBER(jpmsys5_state::sys5_tms34061_w) READ16_MEMBER(jpmsys5_state::sys5_tms34061_r) { - UINT16 data = 0; + uint16_t data = 0; int func = (offset >> 19) & 3; int row = (offset >> 7) & 0x1ff; int col; @@ -142,7 +142,7 @@ WRITE16_MEMBER(jpmsys5_state::ramdac_w) } } -UINT32 jpmsys5_state::screen_update_jpmsys5v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t jpmsys5_state::screen_update_jpmsys5v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x, y; @@ -156,12 +156,12 @@ UINT32 jpmsys5_state::screen_update_jpmsys5v(screen_device &screen, bitmap_rgb32 for (y = cliprect.min_y; y <= cliprect.max_y; ++y) { - UINT8 *src = &m_tms34061->m_display.vram[(m_tms34061->m_display.dispstart & 0xffff)*2 + 256 * y]; - UINT32 *dest = &bitmap.pix32(y, cliprect.min_x); + uint8_t *src = &m_tms34061->m_display.vram[(m_tms34061->m_display.dispstart & 0xffff)*2 + 256 * y]; + uint32_t *dest = &bitmap.pix32(y, cliprect.min_x); for (x = cliprect.min_x; x <= cliprect.max_x; x +=2) { - UINT8 pen = src[(x-cliprect.min_x)>>1]; + uint8_t pen = src[(x-cliprect.min_x)>>1]; /* Draw two 4-bit pixels */ *dest++ = m_palette->pen((pen >> 4) & 0xf); @@ -191,7 +191,7 @@ void jpmsys5_state::sys5_draw_lamps() WRITE16_MEMBER(jpmsys5_state::rombank_w) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); data &= 0x1f; membank("bank1")->set_base(&rom[0x20000 + 0x20000 * data]); } diff --git a/src/mame/drivers/jr100.cpp b/src/mame/drivers/jr100.cpp index 200deba0c35..fc0b989c390 100644 --- a/src/mame/drivers/jr100.cpp +++ b/src/mame/drivers/jr100.cpp @@ -47,25 +47,25 @@ public: m_line8(*this, "LINE8") , m_maincpu(*this, "maincpu") { } - required_shared_ptr m_ram; - required_shared_ptr m_pcg; - required_shared_ptr m_vram; - UINT8 m_keyboard_line; + required_shared_ptr m_ram; + required_shared_ptr m_pcg; + required_shared_ptr m_vram; + uint8_t m_keyboard_line; bool m_use_pcg; - UINT8 m_speaker_data; - UINT16 m_t1latch; - UINT8 m_beep_en; + uint8_t m_speaker_data; + uint16_t m_t1latch; + uint8_t m_beep_en; DECLARE_WRITE8_MEMBER(jr100_via_w); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_jr100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jr100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(sound_tick); DECLARE_READ8_MEMBER(jr100_via_read_b); DECLARE_WRITE8_MEMBER(jr100_via_write_a); DECLARE_WRITE8_MEMBER(jr100_via_write_b); DECLARE_WRITE_LINE_MEMBER(jr100_via_write_cb2); - UINT32 readByLittleEndian(UINT8 *buf,int pos); + uint32_t readByLittleEndian(uint8_t *buf,int pos); DECLARE_QUICKLOAD_LOAD_MEMBER(jr100); @@ -213,19 +213,19 @@ void jr100_state::video_start() { } -UINT32 jr100_state::screen_update_jr100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jr100_state::screen_update_jr100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,xi,yi; - UINT8 *rom_pcg = m_region_maincpu->base() + 0xe000; + uint8_t *rom_pcg = m_region_maincpu->base() + 0xe000; for (y = 0; y < 24; y++) { for (x = 0; x < 32; x++) { - UINT8 tile = m_vram[x + y*32]; - UINT8 attr = tile >> 7; + uint8_t tile = m_vram[x + y*32]; + uint8_t attr = tile >> 7; // ATTR is inverted for normal char or use PCG in case of CMODE1 - UINT8 *gfx_data = rom_pcg; + uint8_t *gfx_data = rom_pcg; if (m_use_pcg && attr) { gfx_data = m_pcg; attr = 0; // clear attr so bellow code stay same @@ -235,7 +235,7 @@ UINT32 jr100_state::screen_update_jr100(screen_device &screen, bitmap_ind16 &bit { for(xi=0;xi<8;xi++) { - UINT8 pen = (gfx_data[(tile*8)+yi]>>(7-xi) & 1); + uint8_t pen = (gfx_data[(tile*8)+yi]>>(7-xi) & 1); bitmap.pix16(y*8+yi, x*8+xi) = attr ^ pen; } } @@ -262,7 +262,7 @@ GFXDECODE_END READ8_MEMBER(jr100_state::jr100_via_read_b) { - UINT8 val = 0x1f; + uint8_t val = 0x1f; switch ( m_keyboard_line ) { case 0: val = m_line0->read(); break; @@ -309,7 +309,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(jr100_state::sound_tick) } } -UINT32 jr100_state::readByLittleEndian(UINT8 *buf,int pos) +uint32_t jr100_state::readByLittleEndian(uint8_t *buf,int pos) { return buf[pos] + (buf[pos+1] << 8) + (buf[pos+2] << 16) + (buf[pos+3] << 24); } @@ -317,7 +317,7 @@ UINT32 jr100_state::readByLittleEndian(UINT8 *buf,int pos) QUICKLOAD_LOAD_MEMBER( jr100_state,jr100) { int quick_length; - UINT8 buf[0x10000]; + uint8_t buf[0x10000]; int read_; quick_length = image.length(); if (quick_length >= 0xffff) @@ -336,13 +336,13 @@ QUICKLOAD_LOAD_MEMBER( jr100_state,jr100) return image_init_result::FAIL; } pos += 4; - UINT32 len =readByLittleEndian(buf,pos); pos+= 4; + uint32_t len =readByLittleEndian(buf,pos); pos+= 4; pos += len; // skip name - UINT32 start_address = readByLittleEndian(buf,pos); pos+= 4; - UINT32 code_length = readByLittleEndian(buf,pos); pos+= 4; - UINT32 flag = readByLittleEndian(buf,pos); pos+= 4; + uint32_t start_address = readByLittleEndian(buf,pos); pos+= 4; + uint32_t code_length = readByLittleEndian(buf,pos); pos+= 4; + uint32_t flag = readByLittleEndian(buf,pos); pos+= 4; - UINT32 end_address = start_address + code_length - 1; + uint32_t end_address = start_address + code_length - 1; // copy code memcpy(m_ram + start_address,buf + pos,code_length); if (flag == 0) { diff --git a/src/mame/drivers/jr200.cpp b/src/mame/drivers/jr200.cpp index 1f820a2fcc4..6b5a3315443 100644 --- a/src/mame/drivers/jr200.cpp +++ b/src/mame/drivers/jr200.cpp @@ -48,12 +48,12 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_vram; - required_shared_ptr m_cram; - required_shared_ptr m_mn1271_ram; - UINT8 m_border_col; - UINT8 m_old_keydata; - UINT8 m_freq_reg[2]; + required_shared_ptr m_vram; + required_shared_ptr m_cram; + required_shared_ptr m_mn1271_ram; + uint8_t m_border_col; + uint8_t m_old_keydata; + uint8_t m_freq_reg[2]; emu_timer *m_timer_d; DECLARE_READ8_MEMBER(jr200_pcg_1_r); DECLARE_READ8_MEMBER(jr200_pcg_2_r); @@ -70,7 +70,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_jr200(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jr200(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(timer_d_callback); protected: @@ -96,7 +96,7 @@ protected: /* TODO: double check this */ -static const UINT8 jr200_keycodes[4][9][8] = +static const uint8_t jr200_keycodes[4][9][8] = { /* unshifted */ { @@ -156,7 +156,7 @@ void jr200_state::video_start() { } -UINT32 jr200_state::screen_update_jr200(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jr200_state::screen_update_jr200(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,xi,yi,pen; @@ -166,14 +166,14 @@ UINT32 jr200_state::screen_update_jr200(screen_device &screen, bitmap_ind16 &bit { for (x = 0; x < 32; x++) { - UINT8 tile = m_vram[x + y*32]; - UINT8 attr = m_cram[x + y*32]; + uint8_t tile = m_vram[x + y*32]; + uint8_t attr = m_cram[x + y*32]; for(yi=0;yi<8;yi++) { for(xi=0;xi<8;xi++) { - UINT8 *gfx_data; + uint8_t *gfx_data; if(attr & 0x80) //bitmap mode { @@ -254,7 +254,7 @@ I/O Device READ8_MEMBER(jr200_state::mcu_keyb_r) { int row, col, table = 0; - UINT8 keydata = 0; + uint8_t keydata = 0; if (m_row9->read() & 0x07) { @@ -265,7 +265,7 @@ READ8_MEMBER(jr200_state::mcu_keyb_r) /* scan keyboard */ for (row = 0; row < 9; row++) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch ( row ) { @@ -306,7 +306,7 @@ WRITE8_MEMBER(jr200_state::jr200_beep_w) WRITE8_MEMBER(jr200_state::jr200_beep_freq_w) { - UINT32 beep_freq; + uint32_t beep_freq; m_freq_reg[offset] = data; @@ -328,7 +328,7 @@ TIMER_CALLBACK_MEMBER(jr200_state::timer_d_callback) READ8_MEMBER(jr200_state::mn1271_io_r) { - UINT8 retVal = m_mn1271_ram[offset]; + uint8_t retVal = m_mn1271_ram[offset]; if((offset+0xc800) > 0xca00) retVal= 0xff; @@ -517,8 +517,8 @@ void jr200_state::machine_start() void jr200_state::machine_reset() { - UINT8 *gfx_rom = m_gfx_rom->base(); - UINT8 *gfx_ram = m_gfx_ram->base(); + uint8_t *gfx_rom = m_gfx_rom->base(); + uint8_t *gfx_ram = m_gfx_ram->base(); int i; memset(m_mn1271_ram,0,0x800); diff --git a/src/mame/drivers/jrpacman.cpp b/src/mame/drivers/jrpacman.cpp index 773a6788d4a..f0c42233d7a 100644 --- a/src/mame/drivers/jrpacman.cpp +++ b/src/mame/drivers/jrpacman.cpp @@ -400,7 +400,7 @@ DRIVER_INIT_MEMBER(jrpacman_state,jrpacman) { 0,0 } }; - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); int i, j, A; for (i = A = 0; table[i].count; i++) diff --git a/src/mame/drivers/jtc.cpp b/src/mame/drivers/jtc.cpp index bcfd6864a5b..4e8eb6fd175 100644 --- a/src/mame/drivers/jtc.cpp +++ b/src/mame/drivers/jtc.cpp @@ -41,13 +41,13 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); DECLARE_WRITE8_MEMBER( p2_w ); DECLARE_READ8_MEMBER( p3_r ); DECLARE_WRITE8_MEMBER( p3_w ); DECLARE_PALETTE_INIT(jtc_es40); - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; int m_centronics_busy; DECLARE_WRITE_LINE_MEMBER(write_centronics_busy); @@ -71,7 +71,7 @@ public: { } virtual void video_start() override; - 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); }; @@ -83,16 +83,16 @@ public: { } virtual void video_start() override; - 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); DECLARE_READ8_MEMBER( videoram_r ); DECLARE_WRITE8_MEMBER( videoram_w ); DECLARE_WRITE8_MEMBER( banksel_w ); - UINT8 m_video_bank; - std::unique_ptr m_color_ram_r; - std::unique_ptr m_color_ram_g; - std::unique_ptr m_color_ram_b; + uint8_t m_video_bank; + std::unique_ptr m_color_ram_r; + std::unique_ptr m_color_ram_g; + std::unique_ptr m_color_ram_b; }; @@ -140,7 +140,7 @@ READ8_MEMBER( jtc_state::p3_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= ((m_cassette)->input() < 0.0) ? 1 : 0; data |= m_centronics_busy << 3; @@ -174,7 +174,7 @@ WRITE8_MEMBER( jtc_state::p3_w ) READ8_MEMBER( jtces40_state::videoram_r ) { - UINT8 data = 0; + uint8_t data = 0; if (m_video_bank & 0x80) data |= m_color_ram_r[offset]; if (m_video_bank & 0x40) data |= m_color_ram_g[offset]; @@ -582,7 +582,7 @@ void jtc_state::video_start() { } -UINT32 jtc_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jtc_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, sx; @@ -590,7 +590,7 @@ UINT32 jtc_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con { for (sx = 0; sx < 8; sx++) { - UINT8 data = m_video_ram[(y * 8) + sx]; + uint8_t data = m_video_ram[(y * 8) + sx]; for (x = 0; x < 8; x++) { @@ -607,7 +607,7 @@ void jtces23_state::video_start() { } -UINT32 jtces23_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jtces23_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, sx; @@ -615,7 +615,7 @@ UINT32 jtces23_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, { for (sx = 0; sx < 16; sx++) { - UINT8 data = m_video_ram[(y * 16) + sx]; + uint8_t data = m_video_ram[(y * 16) + sx]; for (x = 0; x < 8; x++) { @@ -636,9 +636,9 @@ void jtces40_state::video_start() { /* allocate memory */ m_video_ram.allocate(JTC_ES40_VIDEORAM_SIZE); - m_color_ram_r = std::make_unique(JTC_ES40_VIDEORAM_SIZE); - m_color_ram_g = std::make_unique(JTC_ES40_VIDEORAM_SIZE); - m_color_ram_b = std::make_unique(JTC_ES40_VIDEORAM_SIZE); + m_color_ram_r = std::make_unique(JTC_ES40_VIDEORAM_SIZE); + m_color_ram_g = std::make_unique(JTC_ES40_VIDEORAM_SIZE); + m_color_ram_b = std::make_unique(JTC_ES40_VIDEORAM_SIZE); /* register for state saving */ save_item(NAME(m_video_bank)); @@ -649,7 +649,7 @@ void jtces40_state::video_start() save_item(NAME(m_centronics_busy)); } -UINT32 jtces40_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jtces40_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, sx; @@ -657,10 +657,10 @@ UINT32 jtces40_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, { for (sx = 0; sx < 40; sx++) { - UINT8 data = m_video_ram[(y * 40) + sx]; - UINT8 color_r = m_color_ram_r[(y * 40) + sx]; - UINT8 color_g = m_color_ram_g[(y * 40) + sx]; - UINT8 color_b = m_color_ram_b[(y * 40) + sx]; + uint8_t data = m_video_ram[(y * 40) + sx]; + uint8_t color_r = m_color_ram_r[(y * 40) + sx]; + uint8_t color_g = m_color_ram_g[(y * 40) + sx]; + uint8_t color_b = m_color_ram_b[(y * 40) + sx]; for (x = 0; x < 8; x++) { diff --git a/src/mame/drivers/jubilee.cpp b/src/mame/drivers/jubilee.cpp index 7d114170325..ccd5ad9fc33 100644 --- a/src/mame/drivers/jubilee.cpp +++ b/src/mame/drivers/jubilee.cpp @@ -213,11 +213,11 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - UINT8 mux_sel; - UINT8 muxlamps; + uint8_t mux_sel; + uint8_t muxlamps; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(jubileep_videoram_w); DECLARE_WRITE8_MEMBER(jubileep_colorram_w); @@ -225,7 +225,7 @@ public: DECLARE_READ8_MEMBER(mux_port_r); TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; - UINT32 screen_update_jubileep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jubileep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(jubileep_interrupt); required_device m_maincpu; required_device m_gfxdecode; @@ -271,7 +271,7 @@ void jubilee_state::video_start() m_bg_tilemap->set_scrolldx(8, 0); /* guess */ } -UINT32 jubilee_state::screen_update_jubileep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jubilee_state::screen_update_jubileep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/juicebox.cpp b/src/mame/drivers/juicebox.cpp index f24d24f85ff..828a35afea1 100644 --- a/src/mame/drivers/juicebox.cpp +++ b/src/mame/drivers/juicebox.cpp @@ -42,7 +42,7 @@ public: required_device m_maincpu; required_device m_s3c44b0; required_device m_smartmedia; - UINT32 port[9]; + uint32_t port[9]; jb_smc_t smc; #if defined(JUICEBOX_ENTER_DEBUG_MENU) || defined(JUICEBOX_DISPLAY_ROM_ID) @@ -57,8 +57,8 @@ public: inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4); void smc_reset( ); void smc_init( ); - UINT8 smc_read( ); - void smc_write( UINT8 data); + uint8_t smc_read( ); + void smc_write( uint8_t data); DECLARE_READ32_MEMBER(s3c44b0_gpio_port_r); DECLARE_WRITE32_MEMBER(s3c44b0_gpio_port_w); DECLARE_WRITE16_MEMBER(s3c44b0_i2s_data_w); @@ -98,9 +98,9 @@ void juicebox_state::smc_init( ) smc_reset(); } -UINT8 juicebox_state::smc_read( ) +uint8_t juicebox_state::smc_read( ) { - UINT8 data; + uint8_t data; if (m_smartmedia->is_present()) { data = m_smartmedia->data_r(); @@ -113,7 +113,7 @@ UINT8 juicebox_state::smc_read( ) return data; } -void juicebox_state::smc_write( UINT8 data) +void juicebox_state::smc_write( uint8_t data) { verboselog(5, "smc_write %08X\n", data); if (m_smartmedia->is_present()) @@ -138,7 +138,7 @@ void juicebox_state::smc_write( UINT8 data) READ32_MEMBER(juicebox_state::s3c44b0_gpio_port_r) { - UINT32 data = port[offset]; + uint32_t data = port[offset]; switch (offset) { case S3C44B0_GPIO_PORT_A : @@ -221,7 +221,7 @@ WRITE32_MEMBER(juicebox_state::s3c44b0_gpio_port_w) READ32_MEMBER(juicebox_state::juicebox_nand_r) { - UINT32 data = 0; + uint32_t data = 0; if (ACCESSING_BITS_0_7) data = data | (smc_read() << 0); if (ACCESSING_BITS_8_15) data = data | (smc_read() << 8); if (ACCESSING_BITS_16_23) data = data | (smc_read() << 16); diff --git a/src/mame/drivers/jungleyo.cpp b/src/mame/drivers/jungleyo.cpp index ddaae91f254..08db2988447 100644 --- a/src/mame/drivers/jungleyo.cpp +++ b/src/mame/drivers/jungleyo.cpp @@ -54,7 +54,7 @@ public: /* video-related */ virtual void video_start() override; - UINT32 screen_update_jungleyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jungleyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -63,7 +63,7 @@ void jungleyo_state::video_start() { } -UINT32 jungleyo_state::screen_update_jungleyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jungleyo_state::screen_update_jungleyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/junior.cpp b/src/mame/drivers/junior.cpp index 7cf9f09ccce..bae6c5b28ce 100644 --- a/src/mame/drivers/junior.cpp +++ b/src/mame/drivers/junior.cpp @@ -45,9 +45,9 @@ public: DECLARE_READ8_MEMBER(junior_riot_b_r); DECLARE_WRITE8_MEMBER(junior_riot_a_w); DECLARE_WRITE8_MEMBER(junior_riot_b_w); - UINT8 m_port_a; - UINT8 m_port_b; - UINT8 m_led_time[6]; + uint8_t m_port_a; + uint8_t m_port_b; + uint8_t m_led_time[6]; virtual void machine_start() override; virtual void machine_reset() override; DECLARE_INPUT_CHANGED_MEMBER(junior_reset); @@ -124,7 +124,7 @@ INPUT_PORTS_END READ8_MEMBER( junior_state::junior_riot_a_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch( ( m_port_b >> 1 ) & 0x0f ) { @@ -155,7 +155,7 @@ READ8_MEMBER( junior_state::junior_riot_b_r ) WRITE8_MEMBER( junior_state::junior_riot_a_w ) { - UINT8 idx = ( m_port_b >> 1 ) & 0x0f; + uint8_t idx = ( m_port_b >> 1 ) & 0x0f; m_port_a = data; @@ -169,7 +169,7 @@ WRITE8_MEMBER( junior_state::junior_riot_a_w ) WRITE8_MEMBER( junior_state::junior_riot_b_w ) { - UINT8 idx = ( data >> 1 ) & 0x0f; + uint8_t idx = ( data >> 1 ) & 0x0f; m_port_b = data; diff --git a/src/mame/drivers/junofrst.cpp b/src/mame/drivers/junofrst.cpp index a3fe2a21ede..4f6fa7be23e 100644 --- a/src/mame/drivers/junofrst.cpp +++ b/src/mame/drivers/junofrst.cpp @@ -111,7 +111,7 @@ public: required_device m_filter_0_1; required_device m_filter_0_2; - UINT8 m_blitterdata[4]; + uint8_t m_blitterdata[4]; int m_i8039_status; int m_last_irq; @@ -160,7 +160,7 @@ WRITE8_MEMBER(junofrst_state::blitter_w) if (offset == 3) { int i; - UINT8 *gfx_rom = memregion("gfx1")->base(); + uint8_t *gfx_rom = memregion("gfx1")->base(); offs_t src = ((m_blitterdata[2] << 8) | m_blitterdata[3]) & 0xfffc; offs_t dest = (m_blitterdata[0] << 8) | m_blitterdata[1]; @@ -174,7 +174,7 @@ WRITE8_MEMBER(junofrst_state::blitter_w) for (j = 0; j < 16; j++) { - UINT8 data; + uint8_t data; if (src & 1) data = gfx_rom[src >> 1] & 0x0f; diff --git a/src/mame/drivers/jupace.cpp b/src/mame/drivers/jupace.cpp index 987a27dc0c8..456bef25b12 100644 --- a/src/mame/drivers/jupace.cpp +++ b/src/mame/drivers/jupace.cpp @@ -93,7 +93,7 @@ public: virtual void machine_start() override; - 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); DECLARE_READ8_MEMBER( io_r ); DECLARE_WRITE8_MEMBER( io_w ); @@ -131,8 +131,8 @@ private: required_device m_centronics; required_device m_ram; required_device m_sp0256; - required_shared_ptr m_video_ram; - required_shared_ptr m_char_ram; + required_shared_ptr m_video_ram; + required_shared_ptr m_char_ram; required_ioport m_a8; required_ioport m_a9; required_ioport m_a10; @@ -160,7 +160,7 @@ private: SNAPSHOT_LOAD_MEMBER( ace_state, ace ) { cpu_device *cpu = m_maincpu; - UINT8 *RAM = memregion(cpu->tag())->base(); + uint8_t *RAM = memregion(cpu->tag())->base(); address_space &space = cpu->space(AS_PROGRAM); unsigned char ace_repeat, ace_byte, loop; int done=0, ace_index=0x2000; @@ -257,7 +257,7 @@ SNAPSHOT_LOAD_MEMBER( ace_state, ace ) READ8_MEMBER( ace_state::io_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(offset, 8)) data &= m_a8->read(); if (!BIT(offset, 9)) data &= m_a9->read(); @@ -569,16 +569,16 @@ TIMER_DEVICE_CALLBACK_MEMBER(ace_state::clear_irq) } -UINT32 ace_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ace_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=56,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=56,ma=0,x; for (y = 0; y < 24; y++) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++, 40); + uint16_t *p = &bitmap.pix16(sy++, 40); for (x = ma; x < ma+32; x++) { diff --git a/src/mame/drivers/jupiter.cpp b/src/mame/drivers/jupiter.cpp index a9eb865b7d1..0c30d5b4b8c 100644 --- a/src/mame/drivers/jupiter.cpp +++ b/src/mame/drivers/jupiter.cpp @@ -110,7 +110,7 @@ INPUT_PORTS_END READ8_MEMBER( jupiter3_state::key_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -136,16 +136,16 @@ void jupiter3_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 jupiter3_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t jupiter3_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for (y = 0; y < 32; y++) { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 64; x++) { @@ -203,7 +203,7 @@ void jupiter2_state::machine_start() void jupiter3_state::machine_reset() { - UINT8* ROM = memregion(Z80_TAG)->base(); + uint8_t* ROM = memregion(Z80_TAG)->base(); memcpy(m_p_ram, ROM, 0x1000); m_maincpu->set_pc(0xe000); } @@ -319,8 +319,8 @@ ROM_END DRIVER_INIT_MEMBER(jupiter2_state,jupiter) { - UINT8 *rom = memregion(MCM6571AP_TAG)->base(); - UINT8 inverted[0x1000]; + uint8_t *rom = memregion(MCM6571AP_TAG)->base(); + uint8_t inverted[0x1000]; memcpy(inverted, rom, 0x1000); @@ -341,8 +341,8 @@ DRIVER_INIT_MEMBER(jupiter2_state,jupiter) DRIVER_INIT_MEMBER(jupiter3_state,jupiter3) { - UINT8 *rom = memregion(Z80_TAG)->base(); - UINT8 inverted[0x1000]; + uint8_t *rom = memregion(Z80_TAG)->base(); + uint8_t inverted[0x1000]; memcpy(inverted, rom, 0x1000); diff --git a/src/mame/drivers/k1003.cpp b/src/mame/drivers/k1003.cpp index fd95cf461d3..39843f93e97 100644 --- a/src/mame/drivers/k1003.cpp +++ b/src/mame/drivers/k1003.cpp @@ -58,9 +58,9 @@ public: DECLARE_WRITE8_MEMBER(disp_1_w); DECLARE_WRITE8_MEMBER(disp_2_w); DECLARE_WRITE8_MEMBER(disp_w); - UINT8 m_disp_1; - UINT8 m_disp_2; - UINT8 bit_to_dec(UINT8 val); + uint8_t m_disp_1; + uint8_t m_disp_2; + uint8_t bit_to_dec(uint8_t val); virtual void machine_reset() override; required_device m_maincpu; }; @@ -96,7 +96,7 @@ WRITE8_MEMBER( k1003_state::disp_2_w ) m_disp_2 = data; } -UINT8 k1003_state::bit_to_dec(UINT8 val) +uint8_t k1003_state::bit_to_dec(uint8_t val) { if (BIT(val,0)) return 0; if (BIT(val,1)) return 1; diff --git a/src/mame/drivers/k28.cpp b/src/mame/drivers/k28.cpp index 6bca21060f5..d7dda72a3bd 100644 --- a/src/mame/drivers/k28.cpp +++ b/src/mame/drivers/k28.cpp @@ -55,26 +55,26 @@ public: int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 31 for now) - UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) + uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + uint32_t m_display_cache[0x20]; // (internal use) + uint8_t m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); void set_display_size(int maxx, int maxy); - void set_display_segmask(UINT32 digits, UINT32 mask); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true); + void set_display_segmask(uint32_t digits, uint32_t mask); + void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true); bool m_power_on; - UINT8 m_inp_mux; - UINT8 m_phoneme; + uint8_t m_inp_mux; + uint8_t m_phoneme; int m_speech_strobe; int m_vfd_data_enable; int m_vfd_data_in; int m_vfd_clock; - UINT64 m_vfd_shiftreg; - UINT64 m_vfd_shiftreg_out; + uint64_t m_vfd_shiftreg; + uint64_t m_vfd_shiftreg_out; int m_vfd_shiftcount; DECLARE_WRITE8_MEMBER(mcu_p0_w); @@ -169,7 +169,7 @@ void k28_state::power_off() void k28_state::display_update() { - UINT32 active_state[0x20]; + uint32_t active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -182,7 +182,7 @@ void k28_state::display_update() m_display_decay[y][x] = m_display_wait; // determine active state - UINT32 ds = (m_display_decay[y][x] != 0) ? 1 : 0; + uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0; active_state[y] |= (ds << x); } } @@ -237,7 +237,7 @@ void k28_state::set_display_size(int maxx, int maxy) m_display_maxy = maxy; } -void k28_state::set_display_segmask(UINT32 digits, UINT32 mask) +void k28_state::set_display_segmask(uint32_t digits, uint32_t mask) { // set a segment mask per selected digit, but leave unselected ones alone for (int i = 0; i < 0x20; i++) @@ -248,12 +248,12 @@ void k28_state::set_display_segmask(UINT32 digits, UINT32 mask) } } -void k28_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update) +void k28_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update) { set_display_size(maxx, maxy); // update current state - UINT32 mask = (1 << maxx) - 1; + uint32_t mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; @@ -298,7 +298,7 @@ WRITE8_MEMBER(k28_state::mcu_p0_w) READ8_MEMBER(k28_state::mcu_p1_r) { - UINT8 data = 0; + uint8_t data = 0; // multiplexed inputs (active low) for (int i = 0; i < 7; i++) @@ -353,11 +353,11 @@ WRITE8_MEMBER(k28_state::mcu_prog_w) m_vfd_shiftcount = 0; // output 0-15: digit segment data - UINT16 seg_data = (UINT16)(m_vfd_shiftreg >> 19); + uint16_t seg_data = (uint16_t)(m_vfd_shiftreg >> 19); seg_data = BITSWAP16(seg_data,0,1,13,9,10,12,14,8,3,4,5,2,15,11,6,7); // output 16-24: digit select - UINT16 digit_sel = (UINT16)(m_vfd_shiftreg >> 10) & 0x1ff; + uint16_t digit_sel = (uint16_t)(m_vfd_shiftreg >> 10) & 0x1ff; set_display_segmask(0x1ff, 0x3fff); display_matrix(16, 9, seg_data, digit_sel); diff --git a/src/mame/drivers/k8915.cpp b/src/mame/drivers/k8915.cpp index a4d9f0e1dd4..947afbc0f5b 100644 --- a/src/mame/drivers/k8915.cpp +++ b/src/mame/drivers/k8915.cpp @@ -31,20 +31,20 @@ public: DECLARE_READ8_MEMBER( k8915_53_r ); DECLARE_WRITE8_MEMBER( k8915_a8_w ); DECLARE_WRITE8_MEMBER( kbd_put ); - required_shared_ptr m_p_videoram; - UINT8 *m_p_chargen; - UINT8 m_framecnt; - UINT8 m_term_data; + required_shared_ptr m_p_videoram; + uint8_t *m_p_chargen; + uint8_t m_framecnt; + uint8_t m_term_data; virtual void machine_reset() override; virtual void video_start() override; - 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); DECLARE_DRIVER_INIT(k8915); }; READ8_MEMBER( k8915_state::k8915_52_r ) { // get data from ascii keyboard - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -89,7 +89,7 @@ void k8915_state::machine_reset() DRIVER_INIT_MEMBER(k8915_state,k8915) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0x10000); } @@ -98,10 +98,10 @@ void k8915_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 k8915_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t k8915_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; m_framecnt++; @@ -109,7 +109,7 @@ UINT32 k8915_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 80; x++) { diff --git a/src/mame/drivers/kaneko16.cpp b/src/mame/drivers/kaneko16.cpp index d8b5850b267..1b180d3d015 100644 --- a/src/mame/drivers/kaneko16.cpp +++ b/src/mame/drivers/kaneko16.cpp @@ -249,7 +249,7 @@ WRITE8_MEMBER(kaneko16_state::eeprom_w) READ16_MEMBER(kaneko16_berlwall_state::berlwall_oki_r) { - UINT16 ret; + uint16_t ret; if (mem_mask == 0xff00) // reads / writes to the upper byte only appear to act as a mirror to the lower byte, 16-bit reads/writes only access the lower byte. { @@ -690,8 +690,8 @@ ADDRESS_MAP_END void kaneko16_state::kaneko16_common_oki_bank_w( const char *bankname, const char* tag, int bank, size_t fixedsize, size_t bankedsize ) { - UINT32 bankaddr; - UINT8* samples = memregion(tag)->base(); + uint32_t bankaddr; + uint8_t* samples = memregion(tag)->base(); size_t length = memregion(tag)->bytes(); bankaddr = fixedsize + (bankedsize * bank); @@ -2332,7 +2332,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_state::shogwarr_interrupt) } /* -static const UINT16 shogwarr_default_eeprom[64] = { +static const uint16_t shogwarr_default_eeprom[64] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4B41, 0x4E45, 0x4B4F, 0x2F41, 0x544F, 0x5020, 0x3139, 0x3932, 0x4655, 0x4A49, 0xFFFF, 0x4D41, 0x2042, 0x5553, 0x5445, 0x5220, @@ -2345,7 +2345,7 @@ static const UINT16 shogwarr_default_eeprom[64] = { */ // the above eeprom looks corrupt, some of the text is wrong, the game never writes this text tho.. maybe it should be as below // leaving both here incase they relate to which tables get 'locked out' by the MCU somehow -static const UINT16 shogwarr_default_eeprom[64] = { +static const uint16_t shogwarr_default_eeprom[64] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4B41, 0x4E45, 0x4B4F, 0x2F41, 0x544F, 0x5020, 0x3139, 0x3932, 0x4655, 0x4A49, 0x5941, 0x4D41, 0x2042, 0x5553, 0x5445, 0x5220, @@ -2425,7 +2425,7 @@ static MACHINE_CONFIG_START( shogwarr, kaneko16_shogwarr_state ) MACHINE_CONFIG_END -static const UINT16 brapboys_default_eeprom[64] = { +static const uint16_t brapboys_default_eeprom[64] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0005, 0x0006, 0x2030, 0x0003, 0x6818, 0x0101, 0x0101, 0x0101, 0x0001, 0x0004, 0x0008, 0x4B41, 0x4E45, 0x4B4F, 0x2020, @@ -2474,7 +2474,7 @@ void kaneko16_state::kaneko16_unscramble_tiles(const char *region) return; } - UINT8 *ram = tile_region->base(); + uint8_t *ram = tile_region->base(); int size = tile_region->bytes(); for (int i = 0; i < size; i ++) @@ -2495,7 +2495,7 @@ void kaneko16_state::kaneko16_expand_sample_banks(const char *region) possible combinations of these and swap between them. */ int bank; - UINT8 *src0; + uint8_t *src0; if (memregion(region)->bytes() < 0x40000 * 16) fatalerror("gtmr SOUND1 region too small\n"); @@ -2504,8 +2504,8 @@ void kaneko16_state::kaneko16_expand_sample_banks(const char *region) src0 = memregion(region)->base(); for (bank = 15; bank > 0; bank--) { - UINT8 *srcn = src0 + 0x10000 * (bank < 3 ? 3 : bank); - UINT8 *dst = src0 + 0x40000 * bank; + uint8_t *srcn = src0 + 0x10000 * (bank < 3 ? 3 : bank); + uint8_t *dst = src0 + 0x40000 * bank; memcpy(dst + 0x30000, srcn + 0x00000, 0x10000); memcpy(dst + 0x00000, src0 + 0x00000, 0x30000); diff --git a/src/mame/drivers/karnov.cpp b/src/mame/drivers/karnov.cpp index d78d66fad8a..c9f41be03f8 100644 --- a/src/mame/drivers/karnov.cpp +++ b/src/mame/drivers/karnov.cpp @@ -726,7 +726,7 @@ GFXDECODE_END INTERRUPT_GEN_MEMBER(karnov_state::karnov_interrupt) { - UINT8 port = ioport("FAKE")->read(); + uint8_t port = ioport("FAKE")->read(); /* Coin input to the i8751 generates an interrupt to the main cpu */ if (port == m_coin_mask) @@ -1288,7 +1288,7 @@ DRIVER_INIT_MEMBER(karnov_state,wndrplnt) DRIVER_INIT_MEMBER(karnov_state,chelnov) { - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); m_microcontroller_id = CHELNOV; m_coin_mask = 0xe0; @@ -1297,7 +1297,7 @@ DRIVER_INIT_MEMBER(karnov_state,chelnov) DRIVER_INIT_MEMBER(karnov_state,chelnovu) { - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); m_microcontroller_id = CHELNOVU; m_coin_mask = 0xe0; @@ -1306,7 +1306,7 @@ DRIVER_INIT_MEMBER(karnov_state,chelnovu) DRIVER_INIT_MEMBER(karnov_state,chelnovj) { - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); m_microcontroller_id = CHELNOVJ; m_coin_mask = 0xe0; diff --git a/src/mame/drivers/kas89.cpp b/src/mame/drivers/kas89.cpp index 206c51dfff5..0a9b434674e 100644 --- a/src/mame/drivers/kas89.cpp +++ b/src/mame/drivers/kas89.cpp @@ -222,12 +222,12 @@ public: m_unk(*this, "UNK") { } - UINT8 m_mux_data; - UINT8 m_main_nmi_enable; + uint8_t m_mux_data; + uint8_t m_main_nmi_enable; - UINT8 m_leds_mux_selector; - UINT8 m_leds_mux_data; - UINT8 m_outdata; /* Muxed with the sound latch. Output to a sign? */ + uint8_t m_leds_mux_selector; + uint8_t m_leds_mux_data; + uint8_t m_outdata; /* Muxed with the sound latch. Output to a sign? */ required_device m_maincpu; required_device m_audiocpu; @@ -364,7 +364,7 @@ WRITE8_MEMBER(kas89_state::sound_comm_w) if (m_outdata == 0x3f) { - UINT8 i; + uint8_t i; for ( i = 0; i < 37; i++ ) { output().set_lamp_value(i, 0); /* All roulette LEDs OFF */ @@ -410,7 +410,7 @@ WRITE8_MEMBER(kas89_state::led_mux_select_w) m_leds_mux_selector = data; - UINT8 i; + uint8_t i; for ( i = 0; i < 37; i++ ) { output().set_lamp_value(i, 0); /* All LEDs OFF */ @@ -832,7 +832,7 @@ ROM_END DRIVER_INIT_MEMBER(kas89_state,kas89) { int i; - UINT8 *mem = memregion("maincpu")->base(); + uint8_t *mem = memregion("maincpu")->base(); int memsize = memregion("maincpu")->bytes(); /* Unscrambling data lines */ @@ -842,7 +842,7 @@ DRIVER_INIT_MEMBER(kas89_state,kas89) } /* Unscrambling address lines */ - std::vector buf(memsize); + std::vector buf(memsize); memcpy(&buf[0], mem, memsize); for ( i = 0; i < memsize; i++ ) { diff --git a/src/mame/drivers/kaypro.cpp b/src/mame/drivers/kaypro.cpp index 6e5b2e3d510..2bfec2e002d 100644 --- a/src/mame/drivers/kaypro.cpp +++ b/src/mame/drivers/kaypro.cpp @@ -329,8 +329,8 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER( kaypro_state, kaypro ) { - UINT8 *main = memregion("roms")->base(); - UINT8 *ram = memregion("rambank")->base(); + uint8_t *main = memregion("roms")->base(); + uint8_t *ram = memregion("rambank")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &ram[0x0000]); diff --git a/src/mame/drivers/kchamp.cpp b/src/mame/drivers/kchamp.cpp index e8f9b0deec9..8403d9ac9a6 100644 --- a/src/mame/drivers/kchamp.cpp +++ b/src/mame/drivers/kchamp.cpp @@ -712,7 +712,7 @@ ROM_END void kchamp_state::decrypt_code() { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (int A = 0; A < 0x10000; A++) m_decrypted_opcodes[A] = (rom[A] & 0x55) | ((rom[A] & 0x88) >> 2) | ((rom[A] & 0x22) << 2); } @@ -722,7 +722,7 @@ DRIVER_INIT_MEMBER(kchamp_state,kchampvs) { decrypt_code(); - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int A; /* diff --git a/src/mame/drivers/kenseim.cpp b/src/mame/drivers/kenseim.cpp index 9bec8f3153b..8fb73325ee5 100644 --- a/src/mame/drivers/kenseim.cpp +++ b/src/mame/drivers/kenseim.cpp @@ -224,10 +224,10 @@ public: WRITE8_MEMBER(mb8936_portb_w); // maybe molesb output? (6-bits?) WRITE8_MEMBER(mb8936_portf_w); // maybe strobe output? - UINT8 m_to_68k_cmd_low; - UINT8 m_to_68k_cmd_d9; - UINT8 m_to_68k_cmd_req; - UINT8 m_to_68k_cmd_LVm; + uint8_t m_to_68k_cmd_low; + uint8_t m_to_68k_cmd_d9; + uint8_t m_to_68k_cmd_req; + uint8_t m_to_68k_cmd_LVm; int m_from68k_ack; @@ -242,7 +242,7 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(kenseim_cmd_req_r); DECLARE_CUSTOM_INPUT_MEMBER(kenseim_cmd_LVm_r); - void set_leds(UINT32 ledstates); + void set_leds(uint32_t ledstates); int m_led_latch; int m_led_serial_data; int m_led_clock; @@ -257,7 +257,7 @@ public: Misc System Functions ******************************/ -void kenseim_state::set_leds(UINT32 ledstates) +void kenseim_state::set_leds(uint32_t ledstates) { for (int i=0; i<20; i++) output().set_lamp_value(i+1, ((ledstates & (1 << i)) != 0)); diff --git a/src/mame/drivers/kickgoal.cpp b/src/mame/drivers/kickgoal.cpp index b1fd4983636..4a4b2b60df8 100644 --- a/src/mame/drivers/kickgoal.cpp +++ b/src/mame/drivers/kickgoal.cpp @@ -55,7 +55,7 @@ lev 7 : 0x7c : 0000 0000 - x */ #ifdef UNUSED_DEFINITION -static const UINT8 kickgoal_cmd_snd[128] = +static const uint8_t kickgoal_cmd_snd[128] = { /*00*/ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /*08*/ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x70, 0x71, @@ -430,7 +430,7 @@ INTERRUPT_GEN_MEMBER(kickgoal_state::kickgoal_interrupt) } -static const UINT16 kickgoal_default_eeprom_type1[64] = { +static const uint16_t kickgoal_default_eeprom_type1[64] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -766,7 +766,7 @@ ROM_END DRIVER_INIT_MEMBER(kickgoal_state,kickgoal) { #if 0 /* we should find a real fix instead */ - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); /* fix "bug" that prevents game from writing to EEPROM */ rom[0x12b0/2] = 0x0001; diff --git a/src/mame/drivers/kim1.cpp b/src/mame/drivers/kim1.cpp index a599c7959b4..dec653838a9 100644 --- a/src/mame/drivers/kim1.cpp +++ b/src/mame/drivers/kim1.cpp @@ -137,7 +137,7 @@ INPUT_PORTS_END // Read from keyboard READ8_MEMBER( kim1_state::kim1_u2_read_a ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch( ( m_u2_port_b >> 1 ) & 0x0f ) { @@ -157,7 +157,7 @@ READ8_MEMBER( kim1_state::kim1_u2_read_a ) // Write to 7-Segment LEDs WRITE8_MEMBER( kim1_state::kim1_u2_write_a ) { - UINT8 idx = ( m_u2_port_b >> 1 ) & 0x0f; + uint8_t idx = ( m_u2_port_b >> 1 ) & 0x0f; if ( idx >= 4 && idx < 10 ) { @@ -210,7 +210,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(kim1_state::kim1_cassette_input) // Blank LEDs during cassette operations TIMER_DEVICE_CALLBACK_MEMBER(kim1_state::kim1_update_leds) { - UINT8 i; + uint8_t i; for ( i = 0; i < 6; i++ ) { @@ -231,7 +231,7 @@ void kim1_state::machine_start() void kim1_state::machine_reset() { - UINT8 i; + uint8_t i; for ( i = 0; i < 6; i++ ) m_led_time[i] = 0; diff --git a/src/mame/drivers/kingdrby.cpp b/src/mame/drivers/kingdrby.cpp index 7e1c46776c2..ab991ca97fd 100644 --- a/src/mame/drivers/kingdrby.cpp +++ b/src/mame/drivers/kingdrby.cpp @@ -94,16 +94,16 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_sound_cmd; - required_shared_ptr m_vram; - required_shared_ptr m_attr; + uint8_t m_sound_cmd; + required_shared_ptr m_vram; + required_shared_ptr m_attr; tilemap_t *m_sc0_tilemap; tilemap_t *m_sc0w_tilemap; tilemap_t *m_sc1_tilemap; - UINT8 m_p1_hopper; - UINT8 m_p2_hopper; - UINT8 m_mux_data; - required_shared_ptr m_spriteram; + uint8_t m_p1_hopper; + uint8_t m_p2_hopper; + uint8_t m_mux_data; + required_shared_ptr m_spriteram; DECLARE_WRITE8_MEMBER(sc0_vram_w); DECLARE_WRITE8_MEMBER(sc0_attr_w); DECLARE_WRITE8_MEMBER(led_array_w); @@ -121,7 +121,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(kingdrby); DECLARE_PALETTE_INIT(kingdrbb); - UINT32 screen_update_kingdrby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kingdrby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_soundcpu; required_device m_gfxdecode; @@ -190,7 +190,7 @@ void kingdrby_state::video_start() m_sc1_tilemap->set_transparent_pen(0); } -static const UINT8 hw_sprite[16] = +static const uint8_t hw_sprite[16] = { 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x22, 0x22 @@ -198,7 +198,7 @@ static const UINT8 hw_sprite[16] = void kingdrby_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *spriteram = m_spriteram; + uint8_t *spriteram = m_spriteram; int count = 0; /*sprites not fully understood.*/ @@ -240,7 +240,7 @@ void kingdrby_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } } -UINT32 kingdrby_state::screen_update_kingdrby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t kingdrby_state::screen_update_kingdrby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { const rectangle &visarea = screen.visible_area(); rectangle clip; @@ -324,8 +324,8 @@ READ8_MEMBER(kingdrby_state::input_mux_r) READ8_MEMBER(kingdrby_state::key_matrix_r) { - UINT16 p1_val,p2_val; - UINT8 p1_res,p2_res; + uint16_t p1_val,p2_val; + uint8_t p1_res,p2_res; p1_val = ioport("KEY_1P")->read(); p2_val = ioport("KEY_2P")->read(); @@ -379,7 +379,7 @@ READ8_MEMBER(kingdrby_state::sound_cmd_r) return m_sound_cmd; } -static const UINT8 led_map[16] = +static const uint8_t led_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x77,0x7c,0x39,0x5e,0x79,0x00 }; WRITE8_MEMBER(kingdrby_state::led_array_w) @@ -866,7 +866,7 @@ GFXDECODE_END PALETTE_INIT_MEMBER(kingdrby_state,kingdrby) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit0, bit1, bit2 , r, g, b; int i; @@ -892,8 +892,8 @@ PALETTE_INIT_MEMBER(kingdrby_state,kingdrby) PALETTE_INIT_MEMBER(kingdrby_state,kingdrbb) { - UINT8 *raw_prom = memregion("raw_prom")->base(); - UINT8 *prom = memregion("proms")->base(); + uint8_t *raw_prom = memregion("raw_prom")->base(); + uint8_t *prom = memregion("proms")->base(); int bit0, bit1, bit2 , r, g, b; int i; diff --git a/src/mame/drivers/kingobox.cpp b/src/mame/drivers/kingobox.cpp index de077e75212..7ce567dafe0 100644 --- a/src/mame/drivers/kingobox.cpp +++ b/src/mame/drivers/kingobox.cpp @@ -778,7 +778,7 @@ ROM_END DRIVER_INIT_MEMBER(kingofb_state,ringking3) { int i; - UINT8 *RAM = memregion("proms")->base(); + uint8_t *RAM = memregion("proms")->base(); /* expand the first color PROM to look like the kingofb ones... */ for (i = 0; i < 0x100; i++) @@ -789,8 +789,8 @@ DRIVER_INIT_MEMBER(kingofb_state,ringking3) DRIVER_INIT_MEMBER(kingofb_state,ringkingw) { int i,j,k; - UINT8 *PROMS = memregion("proms")->base(); - UINT8 *USER1 = memregion("user1")->base(); + uint8_t *PROMS = memregion("proms")->base(); + uint8_t *USER1 = memregion("user1")->base(); /* change the PROMs encode in a simple format to use kingofb decode */ for(i = 0, j = 0; j < 0x40; i++, j++) diff --git a/src/mame/drivers/kinst.cpp b/src/mame/drivers/kinst.cpp index c158bf95c05..0688dc743fe 100644 --- a/src/mame/drivers/kinst.cpp +++ b/src/mame/drivers/kinst.cpp @@ -158,12 +158,12 @@ public: { } - required_shared_ptr m_rambase; - required_shared_ptr m_rambase2; - required_shared_ptr m_control; - required_shared_ptr m_rombase; - UINT32 *m_video_base; - const UINT8 *m_control_map; + required_shared_ptr m_rambase; + required_shared_ptr m_rambase2; + required_shared_ptr m_control; + required_shared_ptr m_rombase; + uint32_t *m_video_base; + const uint8_t *m_control_map; DECLARE_READ32_MEMBER(kinst_control_r); DECLARE_WRITE32_MEMBER(kinst_control_w); DECLARE_READ32_MEMBER(kinst_ide_r); @@ -174,7 +174,7 @@ public: DECLARE_DRIVER_INIT(kinst2); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_kinst(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kinst(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(irq0_start); required_device m_maincpu; required_device m_ata; @@ -219,7 +219,7 @@ void kinst_state::machine_start() void kinst_state::machine_reset() { ide_hdd_device *hdd = m_ata->subdevice("0")->subdevice("hdd"); - UINT16 *identify_device = hdd->identify_device_buffer(); + uint16_t *identify_device = hdd->identify_device_buffer(); if (strncmp(machine().system().name, "kinst2", 6) != 0) { @@ -252,21 +252,21 @@ void kinst_state::machine_reset() * *************************************/ -UINT32 kinst_state::screen_update_kinst(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t kinst_state::screen_update_kinst(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y; /* loop over rows and copy to the destination */ for (y = cliprect.min_y; y <= cliprect.max_y; y++) { - UINT32 *src = &m_video_base[640/4 * y]; - UINT16 *dest = &bitmap.pix16(y, cliprect.min_x); + uint32_t *src = &m_video_base[640/4 * y]; + uint16_t *dest = &bitmap.pix16(y, cliprect.min_x); int x; /* loop over columns */ for (x = cliprect.min_x; x < cliprect.max_x; x += 2) { - UINT32 data = *src++; + uint32_t data = *src++; /* store two pixels */ *dest++ = (data >> 0) & 0x7fff; @@ -343,7 +343,7 @@ WRITE32_MEMBER(kinst_state::kinst_ide_extra_w) READ32_MEMBER(kinst_state::kinst_control_r) { - UINT32 result; + uint32_t result; static const char *const portnames[] = { "P1", "P2", "VOLUME", "UNUSED", "DSW" }; /* apply shuffling */ @@ -378,7 +378,7 @@ READ32_MEMBER(kinst_state::kinst_control_r) WRITE32_MEMBER(kinst_state::kinst_control_w) { - UINT32 olddata; + uint32_t olddata; /* apply shuffling */ offset = m_control_map[offset / 2]; @@ -897,7 +897,7 @@ ROM_END DRIVER_INIT_MEMBER(kinst_state,kinst) { - static const UINT8 kinst_control_map[8] = { 0,1,2,3,4,5,6,7 }; + static const uint8_t kinst_control_map[8] = { 0,1,2,3,4,5,6,7 }; /* set up the control register mapping */ m_control_map = kinst_control_map; @@ -906,7 +906,7 @@ DRIVER_INIT_MEMBER(kinst_state,kinst) DRIVER_INIT_MEMBER(kinst_state,kinst2) { - static const UINT8 kinst2_control_map[8] = { 2,4,1,0,3,5,6,7 }; + static const uint8_t kinst2_control_map[8] = { 2,4,1,0,3,5,6,7 }; // read: $80 on ki2 = $90 on ki // read: $88 on ki2 = $a0 on ki diff --git a/src/mame/drivers/koftball.cpp b/src/mame/drivers/koftball.cpp index 92c976f9095..86196495c7d 100644 --- a/src/mame/drivers/koftball.cpp +++ b/src/mame/drivers/koftball.cpp @@ -50,14 +50,14 @@ public: m_palette(*this, "palette") { } required_device m_maincpu; - required_shared_ptr m_main_ram; - required_shared_ptr m_bmc_1_videoram; - required_shared_ptr m_bmc_2_videoram; + required_shared_ptr m_main_ram; + required_shared_ptr m_bmc_1_videoram; + required_shared_ptr m_bmc_2_videoram; required_device m_gfxdecode; required_device m_palette; tilemap_t *m_tilemap_1; tilemap_t *m_tilemap_2; - UINT16 m_prot_data; + uint16_t m_prot_data; DECLARE_READ16_MEMBER(random_number_r); DECLARE_READ16_MEMBER(prot_r); @@ -68,7 +68,7 @@ public: TILE_GET_INFO_MEMBER(get_t1_tile_info); TILE_GET_INFO_MEMBER(get_t2_tile_info); virtual void video_start() override; - UINT32 screen_update_koftball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_koftball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(bmc_interrupt); }; @@ -99,7 +99,7 @@ void koftball_state::video_start() m_tilemap_1->set_transparent_pen(0); } -UINT32 koftball_state::screen_update_koftball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t koftball_state::screen_update_koftball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap_2->draw(screen, bitmap, cliprect, 0, 0); m_tilemap_1->draw(screen, bitmap, cliprect, 0, 0); @@ -274,7 +274,7 @@ ROM_END #if NVRAM_HACK -static const UINT16 nvram[]= +static const uint16_t nvram[]= { 0x0000,0x5555,0x0000,0x5555,0x0000,0x5555,0x0000,0x5555, 0x0000,0x5555,0x0000,0x0000,0x0000,0x0000,0x5555,0x5555, diff --git a/src/mame/drivers/koikoi.cpp b/src/mame/drivers/koikoi.cpp index bbc0911a830..980c0b64c7e 100644 --- a/src/mame/drivers/koikoi.cpp +++ b/src/mame/drivers/koikoi.cpp @@ -57,7 +57,7 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* video-related */ tilemap_t *m_tmap; @@ -77,7 +77,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(koikoi); - UINT32 screen_update_koikoi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_koikoi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -100,7 +100,7 @@ TILE_GET_INFO_MEMBER(koikoi_state::get_tile_info) PALETTE_INIT_MEMBER(koikoi_state, koikoi) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; /* create a lookup table for the palette */ @@ -136,7 +136,7 @@ PALETTE_INIT_MEMBER(koikoi_state, koikoi) /* characters/sprites */ for (i = 0; i < 0x100; i++) { - UINT8 ctabentry = color_prom[i] & 0x0f; + uint8_t ctabentry = color_prom[i] & 0x0f; palette.set_pen_indirect(i, ctabentry); } } @@ -146,7 +146,7 @@ void koikoi_state::video_start() m_tmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(koikoi_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 koikoi_state::screen_update_koikoi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t koikoi_state::screen_update_koikoi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tmap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/konamigq.cpp b/src/mame/drivers/konamigq.cpp index 458737b8556..62658e0bf4f 100644 --- a/src/mame/drivers/konamigq.cpp +++ b/src/mame/drivers/konamigq.cpp @@ -100,10 +100,10 @@ public: required_device m_am53cf96; required_device m_k056800; - UINT8 *m_p_n_pcmram; - UINT8 m_sector_buffer[ 512 ]; - UINT8 m_sound_ctrl; - UINT8 m_sound_intck; + uint8_t *m_p_n_pcmram; + uint8_t m_sector_buffer[ 512 ]; + uint8_t m_sound_ctrl; + uint8_t m_sound_intck; DECLARE_WRITE16_MEMBER(eeprom_w); DECLARE_WRITE8_MEMBER(pcmram_w); @@ -118,13 +118,13 @@ public: INTERRUPT_GEN_MEMBER(tms_sync); DECLARE_WRITE_LINE_MEMBER(k054539_irq_gen); - void scsi_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ); - void scsi_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ); + void scsi_dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); + void scsi_dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); }; /* EEPROM */ -static const UINT16 konamigq_def_eeprom[64] = +static const uint16_t konamigq_def_eeprom[64] = { 0x292b, 0x5256, 0x2094, 0x4155, 0x0041, 0x1414, 0x0003, 0x0101, 0x0103, 0x0000, 0x0707, 0x0001, 0xaa00, 0xaaaa, 0xaaaa, 0xaaaa, @@ -253,9 +253,9 @@ WRITE_LINE_MEMBER(konamigq_state::k054539_irq_gen) /* SCSI */ -void konamigq_state::scsi_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void konamigq_state::scsi_dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { - UINT8 *sector_buffer = m_sector_buffer; + uint8_t *sector_buffer = m_sector_buffer; int i; int n_this; @@ -287,7 +287,7 @@ void konamigq_state::scsi_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 } } -void konamigq_state::scsi_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void konamigq_state::scsi_dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { } diff --git a/src/mame/drivers/konamigv.cpp b/src/mame/drivers/konamigv.cpp index a57601ad6d2..ea47f2a2bfd 100644 --- a/src/mame/drivers/konamigv.cpp +++ b/src/mame/drivers/konamigv.cpp @@ -153,8 +153,8 @@ public: DECLARE_READ16_MEMBER(tokimeki_serial_r); DECLARE_WRITE16_MEMBER(tokimeki_serial_w); DECLARE_DRIVER_INIT(simpbowl); - void scsi_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ); - void scsi_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ); + void scsi_dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); + void scsi_dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); protected: virtual void driver_start() override; @@ -162,16 +162,16 @@ protected: private: required_device m_am53cf96; - UINT32 m_flash_address; + uint32_t m_flash_address; - UINT16 m_trackball_prev[ 2 ]; - UINT16 m_trackball_data[ 2 ]; - UINT16 m_btc_trackball_prev[ 4 ]; - UINT16 m_btc_trackball_data[ 4 ]; + uint16_t m_trackball_prev[ 2 ]; + uint16_t m_trackball_data[ 2 ]; + uint16_t m_btc_trackball_prev[ 4 ]; + uint16_t m_btc_trackball_data[ 4 ]; fujitsu_29f016a_device *m_flash8[4]; - UINT8 m_sector_buffer[ 4096 ]; + uint8_t m_sector_buffer[ 4096 ]; required_device m_maincpu; }; @@ -223,9 +223,9 @@ ADDRESS_MAP_END /* SCSI */ -void konamigv_state::scsi_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void konamigv_state::scsi_dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { - UINT8 *sector_buffer = m_sector_buffer; + uint8_t *sector_buffer = m_sector_buffer; int i; int n_this; @@ -267,9 +267,9 @@ void konamigv_state::scsi_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 } } -void konamigv_state::scsi_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void konamigv_state::scsi_dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { - UINT8 *sector_buffer = m_sector_buffer; + uint8_t *sector_buffer = m_sector_buffer; int i; int n_this; @@ -476,7 +476,7 @@ READ16_MEMBER(konamigv_state::trackball_r) for( int axis = 0; axis < 2; axis++ ) { - UINT16 value = ioport(axisnames[axis])->read(); + uint16_t value = ioport(axisnames[axis])->read(); m_trackball_data[ axis ] = value - m_trackball_prev[ axis ]; m_trackball_prev[ axis ] = value; } @@ -536,7 +536,7 @@ READ16_MEMBER(konamigv_state::btc_trackball_r) for( int axis = 0; axis < 4; axis++ ) { - UINT16 value = ioport(axisnames[axis])->read(); + uint16_t value = ioport(axisnames[axis])->read(); m_btc_trackball_data[ axis ] = value - m_btc_trackball_prev[ axis ]; m_btc_trackball_prev[ axis ] = value; } diff --git a/src/mame/drivers/konamigx.cpp b/src/mame/drivers/konamigx.cpp index 29ba3d5cc69..9f240ac9ac8 100644 --- a/src/mame/drivers/konamigx.cpp +++ b/src/mame/drivers/konamigx.cpp @@ -182,16 +182,16 @@ static struct sprite_entry { int pri; - UINT32 adr; + uint32_t adr; } sprites[0x100]; -void konamigx_state::generate_sprites(address_space &space, UINT32 src, UINT32 spr, int count) +void konamigx_state::generate_sprites(address_space &space, uint32_t src, uint32_t spr, int count) { int scount = 0; int ecount = 0; for(int i=0; i= 0x200000 && set < 0xd00000) { - UINT16 count2 = space.read_word(set); + uint16_t count2 = space.read_word(set); set += 2; while(count2) { - UINT16 idx = space.read_word(set); - UINT16 flip = space.read_word(set+2); - UINT16 col = space.read_word(set+4); + uint16_t idx = space.read_word(set); + uint16_t flip = space.read_word(set+2); + uint16_t col = space.read_word(set+4); short y = space.read_word(set+6); short x = space.read_word(set+8); @@ -321,22 +321,22 @@ void konamigx_state::generate_sprites(address_space &space, UINT32 src, UINT32 s } } -void konamigx_state::tkmmpzdm_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4) +void konamigx_state::tkmmpzdm_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4) { konamigx_esc_alert(m_workram, 0x0142, 0x100, 0); } -void konamigx_state::dragoonj_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4) +void konamigx_state::dragoonj_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4) { konamigx_esc_alert(m_workram, 0x5c00, 0x100, 0); } -void konamigx_state::sal2_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4) +void konamigx_state::sal2_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4) { konamigx_esc_alert(m_workram, 0x1c8c, 0x172, 1); } -void konamigx_state::sexyparo_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4) +void konamigx_state::sexyparo_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4) { // The d20000 should probably be p3 // TODO: debugging bootcamp, remove once finished @@ -355,20 +355,20 @@ void konamigx_state::sexyparo_esc(address_space &space, UINT32 p1, UINT32 p2, UI generate_sprites(space, 0xc00604, 0xd20000, 0xfc); } -void konamigx_state::tbyahhoo_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4) +void konamigx_state::tbyahhoo_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4) { generate_sprites(space, 0xc00000, 0xd20000, 0x100); } -void konamigx_state::daiskiss_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4) +void konamigx_state::daiskiss_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4) { generate_sprites(space, 0xc00000, 0xd20000, 0x100); } WRITE32_MEMBER(konamigx_state::esc_w) { - UINT32 opcode; - UINT32 params; + uint32_t opcode; + uint32_t params; /* ignore nullptr writes to the ESC (these appear to be "keepalives" on the real hardware) */ if (!data) @@ -414,10 +414,10 @@ WRITE32_MEMBER(konamigx_state::esc_w) break; case 1: // Run program if(m_esc_cb) { - UINT32 p1 = (space.read_word(params+0)<<16) | space.read_word(params+2); - UINT32 p2 = (space.read_word(params+4)<<16) | space.read_word(params+6); - UINT32 p3 = (space.read_word(params+8)<<16) | space.read_word(params+10); - UINT32 p4 = (space.read_word(params+12)<<16) | space.read_word(params+14); + uint32_t p1 = (space.read_word(params+0)<<16) | space.read_word(params+2); + uint32_t p2 = (space.read_word(params+4)<<16) | space.read_word(params+6); + uint32_t p3 = (space.read_word(params+8)<<16) | space.read_word(params+10); + uint32_t p4 = (space.read_word(params+12)<<16) | space.read_word(params+14); (this->*m_esc_cb)(space, p1, p2, p3, p4); } break; @@ -457,7 +457,7 @@ CUSTOM_INPUT_MEMBER(konamigx_state::gx_rdport1_3_r) WRITE32_MEMBER(konamigx_state::eeprom_w) { - UINT32 odata; + uint32_t odata; if (ACCESSING_BITS_24_31) { @@ -506,7 +506,7 @@ WRITE32_MEMBER(konamigx_state::eeprom_w) WRITE32_MEMBER(konamigx_state::control_w) { // TODO: derive from reported PCB XTALs - const UINT32 pixclock[4] = { XTAL_6MHz, XTAL_8MHz, XTAL_12MHz, XTAL_16MHz}; + const uint32_t pixclock[4] = { XTAL_6MHz, XTAL_8MHz, XTAL_12MHz, XTAL_16MHz}; //logerror("write %x to control register (mask=%x)\n", data, mem_mask); // known controls: @@ -762,14 +762,14 @@ READ32_MEMBER(konamigx_state::le2_gun_V_r) READ32_MEMBER(konamigx_state::type1_roz_r1) { - UINT32 *ROM = (UINT32 *)memregion("gfx3")->base(); + uint32_t *ROM = (uint32_t *)memregion("gfx3")->base(); return ROM[offset]; } READ32_MEMBER(konamigx_state::type1_roz_r2) { - UINT32 *ROM = (UINT32 *)memregion("gfx3")->base(); + uint32_t *ROM = (uint32_t *)memregion("gfx3")->base(); ROM += (0x600000/2); @@ -3772,9 +3772,9 @@ MACHINE_RESET_MEMBER(konamigx_state,konamigx) struct GXGameInfoT { const char *romname; - UINT32 cfgport; - UINT32 special; - UINT32 readback; + uint32_t cfgport; + uint32_t special; + uint32_t readback; }; #define BPP4 0 @@ -3861,7 +3861,7 @@ DRIVER_INIT_MEMBER(konamigx_state,konamigx) break; case 2: // tkmmpzdm hack { - UINT32 *rom = (UINT32*)memregion("maincpu")->base(); + uint32_t *rom = (uint32_t*)memregion("maincpu")->base(); // The display is initialized after POST but the copyright screen disabled // planes B,C,D and didn't bother restoring them. I've spent a good diff --git a/src/mame/drivers/konamim2.cpp b/src/mame/drivers/konamim2.cpp index 426556d0e95..ec9231b3f77 100644 --- a/src/mame/drivers/konamim2.cpp +++ b/src/mame/drivers/konamim2.cpp @@ -196,9 +196,9 @@ Notes: struct CDE_DMA { - UINT32 dst_addr; + uint32_t dst_addr; int length; - UINT32 next_dst_addr; + uint32_t next_dst_addr; int next_length; int dma_done; }; @@ -212,18 +212,18 @@ public: m_maincpu(*this, "maincpu"), m_subcpu(*this, "sub") { } - required_shared_ptr m_main_ram; - UINT32 m_vdl0_address; - UINT32 m_vdl1_address; - UINT32 m_irq_enable; - UINT32 m_irq_active; - UINT64 m_unk3; - UINT32 m_unk20004; + required_shared_ptr m_main_ram; + uint32_t m_vdl0_address; + uint32_t m_vdl1_address; + uint32_t m_irq_enable; + uint32_t m_irq_active; + uint64_t m_unk3; + uint32_t m_unk20004; int m_counter1; int m_cde_num_status_bytes; - UINT32 m_cde_status_bytes[16]; + uint32_t m_cde_status_bytes[16]; int m_cde_status_byte_ptr; - UINT32 m_cde_command_bytes[16]; + uint32_t m_cde_command_bytes[16]; int m_cde_command_byte_ptr; int m_cde_response; int m_cde_drive_state; @@ -253,7 +253,7 @@ public: DECLARE_READ64_MEMBER(cpu_r); DECLARE_DRIVER_INIT(m2); virtual void video_start() override; - UINT32 screen_update_m2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(m2); void cde_init(); void cde_handle_command(); @@ -268,23 +268,23 @@ void konamim2_state::video_start() { } -UINT32 konamim2_state::screen_update_m2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t konamim2_state::screen_update_m2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, j; - UINT32 fb_start = 0xffffffff; + uint32_t fb_start = 0xffffffff; if (m_vdl0_address != 0) { - fb_start = *(UINT32*)&m_main_ram[(m_vdl0_address - 0x40000000) / 8] - 0x40000000; + fb_start = *(uint32_t*)&m_main_ram[(m_vdl0_address - 0x40000000) / 8] - 0x40000000; } if (fb_start <= 0x800000) { - UINT16 *frame = (UINT16*)&m_main_ram[fb_start/8]; + uint16_t *frame = (uint16_t*)&m_main_ram[fb_start/8]; for (j=0; j < 384; j++) { - UINT16 *fb = &frame[(j*512)]; - UINT16 *d = &bitmap.pix16(j); + uint16_t *fb = &frame[(j*512)]; + uint16_t *d = &bitmap.pix16(j); for (i=0; i < 512; i++) { d[i^3] = *fb++ & 0x7fff; @@ -300,11 +300,11 @@ UINT32 konamim2_state::screen_update_m2(screen_device &screen, bitmap_ind16 &bit READ64_MEMBER(konamim2_state::irq_enable_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_32_63) { - r |= (UINT64)(m_irq_enable) << 32; + r |= (uint64_t)(m_irq_enable) << 32; } return r; @@ -314,17 +314,17 @@ WRITE64_MEMBER(konamim2_state::irq_enable_w) { if (ACCESSING_BITS_32_63) { - m_irq_enable |= (UINT32)(data >> 32); + m_irq_enable |= (uint32_t)(data >> 32); } } READ64_MEMBER(konamim2_state::irq_active_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_32_63) { - r |= (UINT64)(m_irq_active) << 32; + r |= (uint64_t)(m_irq_active) << 32; } return r; @@ -343,7 +343,7 @@ READ64_MEMBER(konamim2_state::unk2_r) { if (ACCESSING_BITS_32_63) { - return (UINT64)0xa5 << 32; + return (uint64_t)0xa5 << 32; } return 0; } @@ -357,13 +357,13 @@ READ64_MEMBER(konamim2_state::unk3_r) READ64_MEMBER(konamim2_state::unk4_r) { - UINT64 r = 0; -// logerror("unk4_r: %08X, %08X%08X at %08X\n", offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), space.device().safe_pc()); + uint64_t r = 0; +// logerror("unk4_r: %08X, %08X%08X at %08X\n", offset, (uint32_t)(mem_mask>>32), (uint32_t)(mem_mask), space.device().safe_pc()); if (ACCESSING_BITS_32_63) { // MCfg - r |= (UINT64)((0 << 13) | (5 << 10)) << 32; + r |= (uint64_t)((0 << 13) | (5 << 10)) << 32; } if (ACCESSING_BITS_0_31) { @@ -374,8 +374,8 @@ READ64_MEMBER(konamim2_state::unk4_r) WRITE64_MEMBER(konamim2_state::unk4_w) { -// logerror("unk4_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), -// offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), space.device().safe_pc()); +// logerror("unk4_w: %08X%08X, %08X, %08X%08X at %08X\n", (uint32_t)(data >> 32), (uint32_t)(data), +// offset, (uint32_t)(mem_mask>>32), (uint32_t)(mem_mask), space.device().safe_pc()); if (ACCESSING_BITS_0_31) { @@ -385,7 +385,7 @@ WRITE64_MEMBER(konamim2_state::unk4_w) m_subcpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); } - m_unk20004 = (UINT32)(data); + m_unk20004 = (uint32_t)(data); return; } } @@ -393,7 +393,7 @@ WRITE64_MEMBER(konamim2_state::unk4_w) READ64_MEMBER(konamim2_state::unk30000_r) { m_counter1++; - return (UINT64)(m_counter1 & 0x7f) << 32; + return (uint64_t)(m_counter1 & 0x7f) << 32; } READ64_MEMBER(konamim2_state::unk30030_r) @@ -409,11 +409,11 @@ WRITE64_MEMBER(konamim2_state::video_w) { if (ACCESSING_BITS_32_63) { - m_vdl0_address = (UINT32)(data >> 32); + m_vdl0_address = (uint32_t)(data >> 32); } if (ACCESSING_BITS_0_31) { - m_vdl1_address = (UINT32)(data); + m_vdl1_address = (uint32_t)(data); } } @@ -434,7 +434,7 @@ READ64_MEMBER(konamim2_state::unk4000280_r) { // SysCfg - UINT32 sys_config = 0x03600000; + uint32_t sys_config = 0x03600000; sys_config |= 0 << 0; // Bit 0: PAL/NTSC switch (default is selected by encoder) sys_config |= 0 << 2; // Bit 2-3: Video Encoder (0 = MEIENC, 1 = VP536, 2 = BT9103, 3 = DENC) @@ -450,7 +450,7 @@ READ64_MEMBER(konamim2_state::unk4000280_r) // 0xf = Multiplayer (not allowed) sys_config |= 3 << 29; // Bit 29-30: Audio chip (1 = CS4216, 3 = Asahi AK4309) - return ((UINT64)(sys_config) << 32); + return ((uint64_t)(sys_config) << 32); } @@ -462,7 +462,7 @@ WRITE64_MEMBER(konamim2_state::unk4000010_w) } else { -// osd_printf_debug("%c", (UINT8)(data & 0xff)); +// osd_printf_debug("%c", (uint8_t)(data & 0xff)); } } @@ -827,7 +827,7 @@ void konamim2_state::cde_handle_reports() void konamim2_state::cde_dma_transfer(address_space &space, int channel, int next) { - UINT32 address; + uint32_t address; //int length; int i; @@ -851,7 +851,7 @@ void konamim2_state::cde_dma_transfer(address_space &space, int channel, int nex READ64_MEMBER(konamim2_state::cde_r) { - UINT32 r = 0; + uint32_t r = 0; int reg = offset * 2; if (ACCESSING_BITS_0_31) @@ -916,27 +916,27 @@ READ64_MEMBER(konamim2_state::cde_r) if (reg & 1) { - return (UINT64)(r); + return (uint64_t)(r); } else { - return (UINT64)(r) << 32; + return (uint64_t)(r) << 32; } } WRITE64_MEMBER(konamim2_state::cde_w) { int reg = offset * 2; - UINT32 d; + uint32_t d; if (ACCESSING_BITS_0_31) { reg++; - d = (UINT32)(data); + d = (uint32_t)(data); } else { - d = (UINT32)(data >> 32); + d = (uint32_t)(data >> 32); } switch (reg) @@ -1079,7 +1079,7 @@ WRITE64_MEMBER(konamim2_state::cde_w) READ64_MEMBER(konamim2_state::device2_r) { - UINT32 r = 0; + uint32_t r = 0; int reg = offset * 2; if (ACCESSING_BITS_0_31) @@ -1100,21 +1100,21 @@ READ64_MEMBER(konamim2_state::device2_r) if (reg & 1) { - return (UINT64)(r); + return (uint64_t)(r); } else { - return (UINT64)(r) << 32; + return (uint64_t)(r) << 32; } } READ64_MEMBER(konamim2_state::cpu_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_32_63) { - r = (UINT64)((&space.device() != m_maincpu) ? 0x80000000 : 0); + r = (uint64_t)((&space.device() != m_maincpu) ? 0x80000000 : 0); //r |= 0x40000000; // sets Video-LowRes !? return r << 32; } diff --git a/src/mame/drivers/konendev.cpp b/src/mame/drivers/konendev.cpp index 801789a7df5..c3c67107d41 100644 --- a/src/mame/drivers/konendev.cpp +++ b/src/mame/drivers/konendev.cpp @@ -75,19 +75,19 @@ public: DECLARE_WRITE_LINE_MEMBER(gcu_interrupt); INTERRUPT_GEN_MEMBER(vbl_interrupt); - UINT8 rtc_dev_r(UINT32 reg); + uint8_t rtc_dev_r(uint32_t reg); - 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); }; -UINT32 konendev_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t konendev_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return m_gcu->draw(screen, bitmap, cliprect); } READ32_MEMBER(konendev_state::mcu2_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { @@ -118,7 +118,7 @@ READ32_MEMBER(konendev_state::mcu2_r) READ32_MEMBER(konendev_state::ifu2_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_0_7) { @@ -129,7 +129,7 @@ READ32_MEMBER(konendev_state::ifu2_r) } // This seems to be Epson RTC-72423 -UINT8 konendev_state::rtc_dev_r(UINT32 reg) +uint8_t konendev_state::rtc_dev_r(uint32_t reg) { switch (reg) { @@ -153,16 +153,16 @@ UINT8 konendev_state::rtc_dev_r(UINT32 reg) READ32_MEMBER(konendev_state::rtc_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) - r |= (UINT32)(rtc_dev_r(offset * 4)) << 24; + r |= (uint32_t)(rtc_dev_r(offset * 4)) << 24; if (ACCESSING_BITS_16_23) - r |= (UINT32)(rtc_dev_r((offset * 4)+1)) << 16; + r |= (uint32_t)(rtc_dev_r((offset * 4)+1)) << 16; if (ACCESSING_BITS_8_15) - r |= (UINT32)(rtc_dev_r((offset * 4)+2)) << 8; + r |= (uint32_t)(rtc_dev_r((offset * 4)+2)) << 8; if (ACCESSING_BITS_0_7) - r |= (UINT32)(rtc_dev_r((offset * 4)+3)); + r |= (uint32_t)(rtc_dev_r((offset * 4)+3)); return r; } @@ -173,7 +173,7 @@ WRITE32_MEMBER(konendev_state::rtc_w) READ32_MEMBER(konendev_state::ctrl0_r) { - return ((UINT32)(ioport("IN1")->read() & 0xffff) << 16) | 0xffff; + return ((uint32_t)(ioport("IN1")->read() & 0xffff) << 16) | 0xffff; } READ32_MEMBER(konendev_state::ctrl1_r) @@ -186,7 +186,7 @@ READ32_MEMBER(konendev_state::ctrl1_r) READ32_MEMBER(konendev_state::ctrl2_r) { - return ((UINT32)(ioport("IN0")->read() & 0xffff) << 16) | 0xffff; + return ((uint32_t)(ioport("IN0")->read() & 0xffff) << 16) | 0xffff; } WRITE32_MEMBER(konendev_state::eeprom_w) @@ -481,7 +481,7 @@ DRIVER_INIT_MEMBER(konendev_state,konendev) DRIVER_INIT_MEMBER(konendev_state,enchlamp) { - UINT32 *rom = (UINT32*)memregion("program")->base(); + uint32_t *rom = (uint32_t*)memregion("program")->base(); rom[0x24/4] = 0x00002743; // patch flash checksum for now // patch sound data checksums diff --git a/src/mame/drivers/kontest.cpp b/src/mame/drivers/kontest.cpp index f14f545f840..94d0004e875 100644 --- a/src/mame/drivers/kontest.cpp +++ b/src/mame/drivers/kontest.cpp @@ -38,14 +38,14 @@ public: // devices required_device m_maincpu; - required_shared_ptr m_ram; + required_shared_ptr m_ram; required_device m_palette; // screen updates - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // driver state - UINT8 m_control; + uint8_t m_control; // member functions DECLARE_WRITE8_MEMBER(control_w); @@ -70,7 +70,7 @@ public: PALETTE_INIT_MEMBER(kontest_state, kontest) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit0, bit1, bit2 , r, g, b; int i; @@ -97,12 +97,12 @@ void kontest_state::video_start() { } -UINT32 kontest_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t kontest_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { int x,y; int xi,yi; - UINT16 tile; - UINT8 attr; + uint16_t tile; + uint8_t attr; for(y=0;y<32;y++) { @@ -117,8 +117,8 @@ UINT32 kontest_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap { for(xi=0;xi<8;xi++) { - UINT8 color,pen[2]; - UINT8 x_step; + uint8_t color,pen[2]; + uint8_t x_step; int res_x,res_y; x_step = xi >> 2; diff --git a/src/mame/drivers/ksayakyu.cpp b/src/mame/drivers/ksayakyu.cpp index d54dedb4657..dbedec9443c 100644 --- a/src/mame/drivers/ksayakyu.cpp +++ b/src/mame/drivers/ksayakyu.cpp @@ -231,7 +231,7 @@ GFXDECODE_END void ksayakyu_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/ksys573.cpp b/src/mame/drivers/ksys573.cpp index 781b8f4ba36..b6019514d81 100644 --- a/src/mame/drivers/ksys573.cpp +++ b/src/mame/drivers/ksys573.cpp @@ -456,8 +456,8 @@ public: DECLARE_WRITE8_MEMBER( punchmania_output_callback ); ADC083X_INPUT_CB(analogue_inputs_callback); - void cdrom_dma_read( UINT32 *ram, UINT32 n_address, INT32 n_size ); - void cdrom_dma_write( UINT32 *ram, UINT32 n_address, INT32 n_size ); + void cdrom_dma_read( uint32_t *ram, uint32_t n_address, int32_t n_size ); + void cdrom_dma_write( uint32_t *ram, uint32_t n_address, int32_t n_size ); void sys573_vblank( screen_device &screen, bool vblank_state ); double m_pad_position[ 6 ]; required_ioport m_analog0; @@ -472,8 +472,8 @@ protected: private: inline void ATTR_PRINTF( 3,4 ) verboselog( int n_level, const char *s_fmt, ... ); void update_disc(); - void gx700pwbf_output( int offset, UINT8 data ); - void gx700pwfbf_init( void ( ksys573_state::*output_callback_func )( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask ) ); + void gx700pwbf_output( int offset, uint8_t data ); + void gx700pwfbf_init( void ( ksys573_state::*output_callback_func )( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t data, ATTR_UNUSED uint8_t mem_mask ) ); void gn845pwbb_do_w( int offset, int data ); void gn845pwbb_clk_w( int offset, int data ); @@ -485,17 +485,17 @@ private: int m_atapi_xferbase; int m_atapi_xfersize; - UINT32 m_control; - UINT16 m_n_security_control; + uint32_t m_control; + uint16_t m_n_security_control; - required_region_ptr m_h8_response; + required_region_ptr m_h8_response; int m_h8_index; int m_h8_clk; - UINT8 m_gx700pwbf_output_data[ 4 ]; - void ( ksys573_state::*m_gx700pwfbf_output_callback )( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask ); + uint8_t m_gx700pwbf_output_data[ 4 ]; + void ( ksys573_state::*m_gx700pwfbf_output_callback )( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t data, ATTR_UNUSED uint8_t mem_mask ); - UINT32 m_stage_mask; + uint32_t m_stage_mask; struct { int DO; @@ -518,7 +518,7 @@ private: int m_hyperbbc_lamp_strobe2; int m_hyperbbc_lamp_strobe3; - UINT32 *m_p_n_psxram; + uint32_t *m_p_n_psxram; int m_tank_shutter_position; int m_cable_holder_release; @@ -629,15 +629,15 @@ TIMER_CALLBACK_MEMBER( ksys573_state::atapi_xfer_end ) for( int i = 0; i < m_atapi_xfersize; i++ ) { - UINT32 d = m_ata->read_cs0( space, (UINT32) 0, (UINT32) 0xffff ) << 0; - d |= m_ata->read_cs0( space, (UINT32) 0, (UINT32) 0xffff ) << 16; + uint32_t d = m_ata->read_cs0( space, (uint32_t) 0, (uint32_t) 0xffff ) << 0; + d |= m_ata->read_cs0( space, (uint32_t) 0, (uint32_t) 0xffff ) << 16; m_p_n_psxram[ m_atapi_xferbase / 4 ] = d; m_atapi_xferbase += 4; } /// HACK: konami80s only works if you dma more data than requested - if( ( m_ata->read_cs1( space, (UINT32) 6, (UINT32) 0xffff ) & 8 ) != 0 ) + if( ( m_ata->read_cs1( space, (uint32_t) 6, (uint32_t) 0xffff ) & 8 ) != 0 ) { m_atapi_timer->adjust( m_maincpu->cycles_to_attotime( ( ATAPI_CYCLES_PER_SECTOR * ( m_atapi_xfersize / 64 ) ) ) ); } @@ -656,13 +656,13 @@ WRITE16_MEMBER( ksys573_state::atapi_reset_w ) } } -void ksys573_state::cdrom_dma_read( UINT32 *ram, UINT32 n_address, INT32 n_size ) +void ksys573_state::cdrom_dma_read( uint32_t *ram, uint32_t n_address, int32_t n_size ) { verboselog( 2, "cdrom_dma_read( %08x, %08x )\n", n_address, n_size ); // osd_printf_debug( "DMA read: address %08x size %08x\n", n_address, n_size ); } -void ksys573_state::cdrom_dma_write( UINT32 *ram, UINT32 n_address, INT32 n_size ) +void ksys573_state::cdrom_dma_write( uint32_t *ram, uint32_t n_address, int32_t n_size ) { m_p_n_psxram = ram; @@ -686,7 +686,7 @@ WRITE16_MEMBER( ksys573_state::security_w ) READ16_MEMBER( ksys573_state::security_r ) { - UINT16 data = m_n_security_control; + uint16_t data = m_n_security_control; verboselog( 2, "security_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); return data; } @@ -752,7 +752,7 @@ void ksys573_state::sys573_vblank( screen_device &screen, bool vblank_state ) { /* patch out security-plate error */ - UINT32 *p_n_psxram = (UINT32 *) m_ram->pointer(); + uint32_t *p_n_psxram = (uint32_t *) m_ram->pointer(); /* install cd */ @@ -776,7 +776,7 @@ void ksys573_state::sys573_vblank( screen_device &screen, bool vblank_state ) { /* patch out security-plate error */ - UINT32 *p_n_psxram = (UINT32 *) m_ram->pointer(); + uint32_t *p_n_psxram = (uint32_t *) m_ram->pointer(); /* 8001f850: jal $8003221c */ if( p_n_psxram[ 0x1f850 / 4 ] == 0x0c00c887 ) @@ -838,7 +838,7 @@ todo: READ16_MEMBER( ksys573_state::ge765pwbba_r ) { - UINT32 data = 0; + uint32_t data = 0; switch( offset ) { @@ -910,7 +910,7 @@ Analogue I/O board READ16_MEMBER( ksys573_state::gx700pwbf_io_r ) { - UINT32 data = 0; + uint32_t data = 0; switch( offset ) { case 0x40: @@ -939,7 +939,7 @@ READ16_MEMBER( ksys573_state::gx700pwbf_io_r ) return data; } -void ksys573_state::gx700pwbf_output( int offset, UINT8 data ) +void ksys573_state::gx700pwbf_output( int offset, uint8_t data ) { if( m_gx700pwfbf_output_callback != nullptr ) { @@ -986,7 +986,7 @@ WRITE16_MEMBER( ksys573_state::gx700pwbf_io_w ) } } -void ksys573_state::gx700pwfbf_init( void ( ksys573_state::*output_callback_func )( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data, ATTR_UNUSED UINT8 mem_mask ) ) +void ksys573_state::gx700pwfbf_init( void ( ksys573_state::*output_callback_func )( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint8_t data, ATTR_UNUSED uint8_t mem_mask ) ) { memset( m_gx700pwbf_output_data, 0, sizeof( m_gx700pwbf_output_data ) ); @@ -1966,7 +1966,7 @@ CUSTOM_INPUT_MEMBER( ksys573_state::gunmania_cable_holder_sensor ) READ16_MEMBER( ksys573_state::gunmania_r ) { - UINT32 data = 0; + uint32_t data = 0; switch( offset ) { diff --git a/src/mame/drivers/kungfur.cpp b/src/mame/drivers/kungfur.cpp index 0a4d2b5c86c..fda356a1cce 100644 --- a/src/mame/drivers/kungfur.cpp +++ b/src/mame/drivers/kungfur.cpp @@ -74,12 +74,12 @@ public: m_adpcm2(*this, "adpcm2") { } - UINT8 m_latch[3]; - UINT8 m_control; + uint8_t m_latch[3]; + uint8_t m_control; - UINT32 m_adpcm_pos[2]; - UINT8 m_adpcm_data[2]; - UINT8 m_adpcm_sel[2]; + uint32_t m_adpcm_pos[2]; + uint8_t m_adpcm_data[2]; + uint8_t m_adpcm_sel[2]; DECLARE_WRITE8_MEMBER(kungfur_output_w); DECLARE_WRITE8_MEMBER(kungfur_latch1_w); DECLARE_WRITE8_MEMBER(kungfur_latch2_w); @@ -201,8 +201,8 @@ WRITE8_MEMBER(kungfur_state::kungfur_adpcm2_w) // adpcm callbacks WRITE_LINE_MEMBER(kungfur_state::kfr_adpcm1_int) { - UINT8 *ROM = memregion("adpcm1")->base(); - UINT8 data = ROM[m_adpcm_pos[0] & 0x1ffff]; + uint8_t *ROM = memregion("adpcm1")->base(); + uint8_t data = ROM[m_adpcm_pos[0] & 0x1ffff]; m_adpcm1->data_w(m_adpcm_sel[0] ? data & 0xf : data >> 4 & 0xf); m_adpcm_pos[0] += m_adpcm_sel[0]; @@ -211,8 +211,8 @@ WRITE_LINE_MEMBER(kungfur_state::kfr_adpcm1_int) WRITE_LINE_MEMBER(kungfur_state::kfr_adpcm2_int) { - UINT8 *ROM = memregion("adpcm2")->base(); - UINT8 data = ROM[m_adpcm_pos[1] & 0x3ffff]; + uint8_t *ROM = memregion("adpcm2")->base(); + uint8_t data = ROM[m_adpcm_pos[1] & 0x3ffff]; m_adpcm2->data_w(m_adpcm_sel[1] ? data & 0xf : data >> 4 & 0xf); m_adpcm_pos[1] += m_adpcm_sel[1]; diff --git a/src/mame/drivers/kurukuru.cpp b/src/mame/drivers/kurukuru.cpp index bc9b968bf7e..33c82310780 100644 --- a/src/mame/drivers/kurukuru.cpp +++ b/src/mame/drivers/kurukuru.cpp @@ -284,8 +284,8 @@ public: required_device m_soundlatch; required_memory_bank m_bank1; - UINT8 m_sound_irq_cause; - UINT8 m_adpcm_data; + uint8_t m_sound_irq_cause; + uint8_t m_adpcm_data; DECLARE_WRITE8_MEMBER(kurukuru_out_latch_w); DECLARE_WRITE8_MEMBER(kurukuru_bankswitch_w); @@ -297,7 +297,7 @@ public: DECLARE_WRITE8_MEMBER(ym2149_aout_w); DECLARE_WRITE8_MEMBER(ym2149_bout_w); - void update_sound_irq(UINT8 cause); + void update_sound_irq(uint8_t cause); virtual void machine_start() override; virtual void machine_reset() override; DECLARE_WRITE_LINE_MEMBER(kurukuru_msm5205_vck); @@ -317,7 +317,7 @@ public: *************************************************/ -void kurukuru_state::update_sound_irq(UINT8 cause) +void kurukuru_state::update_sound_irq(uint8_t cause) { m_sound_irq_cause = cause & 3; if (m_sound_irq_cause) @@ -326,7 +326,7 @@ void kurukuru_state::update_sound_irq(UINT8 cause) // latch irq vector is $ef (rst $28) // timer irq vector is $f7 (rst $30) // if both are asserted, the vector becomes $f7 AND $ef = $e7 (rst $20) - const UINT8 irq_vector[4] = { 0x00, 0xef, 0xf7, 0xe7 }; + const uint8_t irq_vector[4] = { 0x00, 0xef, 0xf7, 0xe7 }; m_audiocpu->set_input_line_and_vector(0, ASSERT_LINE, irq_vector[m_sound_irq_cause]); } else diff --git a/src/mame/drivers/kyocera.cpp b/src/mame/drivers/kyocera.cpp index d6f155da916..59beb7683cb 100644 --- a/src/mame/drivers/kyocera.cpp +++ b/src/mame/drivers/kyocera.cpp @@ -91,7 +91,7 @@ READ8_MEMBER( pc8201_state::bank_r ) return (m_iosel << 5) | m_bank; } -void pc8201_state::bankswitch(UINT8 data) +void pc8201_state::bankswitch(uint8_t data) { address_space &program = m_maincpu->space(AS_PROGRAM); @@ -243,7 +243,7 @@ READ8_MEMBER( kc85_state::uart_status_r ) */ - UINT8 data = 0x40; + uint8_t data = 0x40; // carrier detect data |= m_rs232->dcd_r(); @@ -286,7 +286,7 @@ READ8_MEMBER( pc8201_state::uart_status_r ) */ - UINT8 data = 0x40; + uint8_t data = 0x40; // data carrier detect / ring detect data |= m_rs232->dcd_r(); @@ -378,7 +378,7 @@ WRITE8_MEMBER( pc8201_state::romam_w ) READ8_MEMBER( pc8201_state::romrd_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_rom_sel) data = m_cas_cart->read_rom(space, m_rom_addr & 0x1ffff); @@ -438,7 +438,7 @@ WRITE8_MEMBER( kc85_state::ctrl_w ) READ8_MEMBER( kc85_state::keyboard_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 9; i++) { @@ -448,7 +448,7 @@ READ8_MEMBER( kc85_state::keyboard_r ) return data; } -void tandy200_state::bankswitch(UINT8 data) +void tandy200_state::bankswitch(uint8_t data) { address_space &program = m_maincpu->space(AS_PROGRAM); @@ -493,7 +493,7 @@ WRITE8_MEMBER( tandy200_state::bank_w ) READ8_MEMBER( tandy200_state::stbk_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 9; i++) { @@ -529,7 +529,7 @@ WRITE8_MEMBER( tandy200_state::stbk_w ) READ8_MEMBER( kc85_state::lcd_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= m_lcdc0->read(space, offset); data |= m_lcdc1->read(space, offset); @@ -1032,7 +1032,7 @@ READ8_MEMBER( kc85_state::i8155_pc_r ) */ - UINT8 data = 0; + uint8_t data = 0; // clock data input data |= m_rtc->data_out_r(); @@ -1133,7 +1133,7 @@ READ8_MEMBER( tandy200_state::i8155_pc_r ) */ - UINT8 data = 0x01; + uint8_t data = 0x01; // centronics data |= m_centronics_select << 1; @@ -1200,7 +1200,7 @@ void kc85_state::machine_start() void pc8201_state::machine_start() { - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); std::string region_tag; m_opt_region = memregion(region_tag.assign(m_opt_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); diff --git a/src/mame/drivers/labyrunr.cpp b/src/mame/drivers/labyrunr.cpp index 948d851040e..9b56dd489f3 100644 --- a/src/mame/drivers/labyrunr.cpp +++ b/src/mame/drivers/labyrunr.cpp @@ -158,7 +158,7 @@ GFXDECODE_END void labyrunr_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000); } diff --git a/src/mame/drivers/ladybug.cpp b/src/mame/drivers/ladybug.cpp index d5f22026828..dc15d96b067 100644 --- a/src/mame/drivers/ladybug.cpp +++ b/src/mame/drivers/ladybug.cpp @@ -111,7 +111,7 @@ CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p1_control_r) CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r) { - UINT32 ret; + uint32_t ret; /* upright cabinet only uses a single set of controls */ if (m_port_dsw0->read() & 0x20) @@ -725,8 +725,8 @@ DRIVER_INIT_MEMBER(ladybug_state,dorodon) /* decode the opcodes */ offs_t i; - UINT8 *rom = memregion("maincpu")->base(); - UINT8 *table = memregion("user1")->base(); + uint8_t *rom = memregion("maincpu")->base(); + uint8_t *table = memregion("user1")->base(); for (i = 0; i < 0x6000; i++) m_decrypted_opcodes[i] = table[rom[i]]; diff --git a/src/mame/drivers/laser3k.cpp b/src/mame/drivers/laser3k.cpp index b4e5482c93a..c35dd52c45b 100644 --- a/src/mame/drivers/laser3k.cpp +++ b/src/mame/drivers/laser3k.cpp @@ -100,7 +100,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(laser3k); - 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); void text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); void hgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); void dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow); @@ -110,20 +110,20 @@ public: DECLARE_WRITE_LINE_MEMBER(ay3600_data_ready_w); private: - UINT8 m_bank0val, m_bank1val, m_bank2val, m_bank3val; + uint8_t m_bank0val, m_bank1val, m_bank2val, m_bank3val; int m_flash; int m_speaker_state; int m_disp_page; int m_bg_color, m_fg_color, m_border_color; - UINT16 m_lastchar, m_strobe; - UINT8 m_transchar; + uint16_t m_lastchar, m_strobe; + uint8_t m_transchar; bool m_80col; bool m_mix; int m_gfxmode; - std::unique_ptr m_hires_artifact_map; - std::unique_ptr m_dhires_artifact_map; + std::unique_ptr m_hires_artifact_map; + std::unique_ptr m_dhires_artifact_map; - void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen); + void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, const uint8_t *textgfx_data, uint32_t textgfx_datalen); void do_io(int offset); }; @@ -148,13 +148,13 @@ ADDRESS_MAP_END void laser3k_state::machine_start() { - static const UINT8 hires_artifact_color_table[] = + static const uint8_t hires_artifact_color_table[] = { BLACK, PURPLE, GREEN, WHITE, BLACK, BLUE, ORANGE, WHITE }; - static const UINT8 dhires_artifact_color_table[] = + static const uint8_t dhires_artifact_color_table[] = { BLACK, DKGREEN, BROWN, GREEN, DKRED, DKGRAY, ORANGE, YELLOW, @@ -162,13 +162,13 @@ void laser3k_state::machine_start() PURPLE, LTBLUE, PINK, WHITE }; int i, j; - UINT16 c; + uint16_t c; /* 2^3 dependent pixels * 2 color sets * 2 offsets */ - m_hires_artifact_map = std::make_unique(8 * 2 * 2); + m_hires_artifact_map = std::make_unique(8 * 2 * 2); /* 2^4 dependent pixels */ - m_dhires_artifact_map = std::make_unique(16); + m_dhires_artifact_map = std::make_unique(16); /* build hires artifact map */ for (i = 0; i < 8; i++) @@ -229,7 +229,7 @@ void laser3k_state::machine_reset() m_mix = false; m_gfxmode = TEXT; - UINT8 *rom = (UINT8 *)memregion("maincpu")->base(); + uint8_t *rom = (uint8_t *)memregion("maincpu")->base(); // patch out disk controller ID for now so it drops right into BASIC rom[0x4607] = 0; @@ -392,7 +392,7 @@ READ8_MEMBER( laser3k_state::io_r ) case 0x10: // keyboard strobe { - UINT8 rv = m_transchar | m_strobe; + uint8_t rv = m_transchar | m_strobe; m_strobe = 0; return rv; } @@ -479,14 +479,14 @@ READ8_MEMBER( laser3k_state::io2_r ) return 0xff; } -void laser3k_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, - const UINT8 *textgfx_data, UINT32 textgfx_datalen) +void laser3k_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, + const uint8_t *textgfx_data, uint32_t textgfx_datalen) { int x, y, i; int fg = m_fg_color; int bg = m_bg_color; - const UINT8 *chardata; - UINT16 color; + const uint8_t *chardata; + uint16_t color; /* look up the character data */ chardata = &textgfx_data[(code * 8) % textgfx_datalen]; @@ -516,9 +516,9 @@ void laser3k_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos void laser3k_state::text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow) { int row, col; - UINT32 start_address; - UINT32 address; - UINT8 *m_a2_videoram = m_ram->pointer(); + uint32_t start_address; + uint32_t address; + uint8_t *m_a2_videoram = m_ram->pointer(); if (m_80col) { @@ -564,14 +564,14 @@ void laser3k_state::text_update(screen_device &screen, bitmap_ind16 &bitmap, con void laser3k_state::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow) { - const UINT8 *vram; + const uint8_t *vram; int row, col, b; int offset; - UINT8 vram_row[42] ; - UINT16 v; - UINT16 *p; - UINT32 w; - UINT16 *artifact_map_ptr; + uint8_t vram_row[42] ; + uint16_t v; + uint16_t *p; + uint32_t w; + uint16_t *artifact_map_ptr; /* sanity checks */ if (beginrow < cliprect.min_y) @@ -598,9 +598,9 @@ void laser3k_state::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, cons for (col = 0; col < 40; col++) { - w = (((UINT32) vram_row[col+0] & 0x7f) << 0) - | (((UINT32) vram_row[col+1] & 0x7f) << 7) - | (((UINT32) vram_row[col+2] & 0x7f) << 14); + w = (((uint32_t) vram_row[col+0] & 0x7f) << 0) + | (((uint32_t) vram_row[col+1] & 0x7f) << 7) + | (((uint32_t) vram_row[col+2] & 0x7f) << 14); artifact_map_ptr = &m_hires_artifact_map[((vram_row[col+1] & 0x80) >> 7) * 16]; for (b = 0; b < 7; b++) @@ -615,13 +615,13 @@ void laser3k_state::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, cons void laser3k_state::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow) { - const UINT8 *vram; + const uint8_t *vram; int row, col, b; int offset; - UINT8 vram_row[82]; - UINT16 v; - UINT16 *p; - UINT32 w; + uint8_t vram_row[82]; + uint16_t v; + uint16_t *p; + uint32_t w; /* sanity checks */ if (beginrow < cliprect.min_y) @@ -657,9 +657,9 @@ void laser3k_state::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, con for (col = 0; col < 80; col++) { - w = (((UINT32) vram_row[col+0] & 0x7f) << 0) - | (((UINT32) vram_row[col+1] & 0x7f) << 7) - | (((UINT32) vram_row[col+2] & 0x7f) << 14); + w = (((uint32_t) vram_row[col+0] & 0x7f) << 0) + | (((uint32_t) vram_row[col+1] & 0x7f) << 7) + | (((uint32_t) vram_row[col+2] & 0x7f) << 14); for (b = 0; b < 7; b++) { @@ -670,7 +670,7 @@ void laser3k_state::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, con } } -UINT32 laser3k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t laser3k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { switch (m_gfxmode) { @@ -730,7 +730,7 @@ READ_LINE_MEMBER(laser3k_state::ay3600_control_r) return CLEAR_LINE; } -static const UINT8 key_remap[0x32][4] = +static const uint8_t key_remap[0x32][4] = { /* norm shft ctrl both */ { 0x33,0x23,0x33,0x23 }, /* 3 # 00 */ diff --git a/src/mame/drivers/laserbas.cpp b/src/mame/drivers/laserbas.cpp index 77684ccfc78..e4c6d38b9d0 100644 --- a/src/mame/drivers/laserbas.cpp +++ b/src/mame/drivers/laserbas.cpp @@ -67,10 +67,10 @@ public: /* video-related */ int m_vrambank; - UINT8 m_vram1[0x8000]; - UINT8 m_vram2[0x8000]; + uint8_t m_vram1[0x8000]; + uint8_t m_vram2[0x8000]; bool m_flipscreen; - required_shared_ptr m_protram; + required_shared_ptr m_protram; DECLARE_READ8_MEMBER(vram_r); DECLARE_WRITE8_MEMBER(vram_w); DECLARE_WRITE8_MEMBER(vrambank_w); @@ -82,7 +82,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_laserbas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_laserbas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -93,7 +93,7 @@ void laserbas_state::video_start() save_item(NAME(m_flipscreen)); } -UINT32 laserbas_state::screen_update_laserbas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t laserbas_state::screen_update_laserbas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y, x0,y0, x1,y1, delta; @@ -115,10 +115,10 @@ UINT32 laserbas_state::screen_update_laserbas(screen_device &screen, bitmap_ind1 { for (x = x0; x != x1; x += delta) { - UINT8 p1 = m_vram1[pixaddr/2]; - UINT8 p2 = m_vram2[pixaddr/2]; - UINT8 mask = (pixaddr & 1) ? 0xf0 : 0x0f; - UINT8 shift = (pixaddr & 1) ? 4 : 0; + uint8_t p1 = m_vram1[pixaddr/2]; + uint8_t p2 = m_vram2[pixaddr/2]; + uint8_t mask = (pixaddr & 1) ? 0xf0 : 0x0f; + uint8_t shift = (pixaddr & 1) ? 4 : 0; if (p2 & mask) bitmap.pix16(y, x) = (p2 & mask) >> shift; @@ -164,7 +164,7 @@ WRITE8_MEMBER(laserbas_state::vrambank_w) READ8_MEMBER(laserbas_state::protram_r) { - UINT8 prot = m_protram[offset]; + uint8_t prot = m_protram[offset]; // prot = machine().rand(); // logerror("%s: Z1 read %03x = %02x\n", machine().describe_context(), offset, prot); return prot; @@ -178,8 +178,8 @@ WRITE8_MEMBER(laserbas_state::protram_w) READ8_MEMBER(laserbas_state::track_lo_r) { - UINT8 dx = ioport("TRACK_X")->read(); - UINT8 dy = ioport("TRACK_Y")->read(); + uint8_t dx = ioport("TRACK_X")->read(); + uint8_t dy = ioport("TRACK_Y")->read(); if (dx & 0x10) dx ^= 0x0f; if (dy & 0x10) @@ -193,7 +193,7 @@ READ8_MEMBER(laserbas_state::track_hi_r) WRITE8_MEMBER(laserbas_state::out_w) { - static UINT8 out[4]; + static uint8_t out[4]; out[offset] = data; // port 20: mask 01 = service1, mask 02 = pulsed (no delay) waiting for start1, mask 08 = coin2, mask 40 = coin1 popmessage("OUT 20: %02x %02x - %02x %02x", out[0], out[1], out[2], out[3]); diff --git a/src/mame/drivers/lasso.cpp b/src/mame/drivers/lasso.cpp index 935a0bc6cc8..7a765e90717 100644 --- a/src/mame/drivers/lasso.cpp +++ b/src/mame/drivers/lasso.cpp @@ -61,7 +61,7 @@ READ8_MEMBER(lasso_state::sound_status_r) WRITE8_MEMBER(lasso_state::sound_select_w) { - UINT8 to_write = BITSWAP8(*m_chip_data, 0, 1, 2, 3, 4, 5, 6, 7); + uint8_t to_write = BITSWAP8(*m_chip_data, 0, 1, 2, 3, 4, 5, 6, 7); if (~data & 0x01) /* chip #0 */ m_sn_1->write(space, 0, to_write); diff --git a/src/mame/drivers/lastbank.cpp b/src/mame/drivers/lastbank.cpp index 14c2cb772a6..94526115a8c 100644 --- a/src/mame/drivers/lastbank.cpp +++ b/src/mame/drivers/lastbank.cpp @@ -33,14 +33,14 @@ public: required_device m_vdp; virtual void video_start() override; - 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); void screen_eof(screen_device &screen, bool state); - UINT8 m_ram_bank[4]; - UINT8 m_rom_bank; - UINT8 m_irq_vector[3]; - UINT8 m_irq_enable; - UINT8 m_mux_data; + uint8_t m_ram_bank[4]; + uint8_t m_rom_bank; + uint8_t m_irq_vector[3]; + uint8_t m_irq_enable; + uint8_t m_mux_data; DECLARE_READ8_MEMBER(lastbank_rom_r); @@ -65,8 +65,8 @@ public: DECLARE_READ8_MEMBER(lastbank_irq_enable_r); DECLARE_WRITE8_MEMBER(lastbank_irq_enable_w); - UINT8 ram_bank_r(UINT16 offset, UINT8 bank_num); - void ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num); + uint8_t ram_bank_r(uint16_t offset, uint8_t bank_num); + void ram_bank_w(uint16_t offset, uint8_t data, uint8_t bank_num); TIMER_DEVICE_CALLBACK_MEMBER(lastbank_irq_scanline); }; @@ -74,7 +74,7 @@ void lastbank_state::video_start() { } -UINT32 lastbank_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t lastbank_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); @@ -93,7 +93,7 @@ void lastbank_state::screen_eof(screen_device &screen, bool state) READ8_MEMBER(lastbank_state::lastbank_rom_r) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); return ROM[offset + m_rom_bank * 0x2000]; } @@ -138,13 +138,13 @@ WRITE8_MEMBER(lastbank_state::lastbank_ram_bank_w) m_ram_bank[offset] = data; } -UINT8 lastbank_state::ram_bank_r(UINT16 offset, UINT8 bank_num) +uint8_t lastbank_state::ram_bank_r(uint16_t offset, uint8_t bank_num) { address_space &vdp_space = machine().device("tc0091lvc")->space(); return vdp_space.read_byte(offset + (m_ram_bank[bank_num]) * 0x1000);; } -void lastbank_state::ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num) +void lastbank_state::ram_bank_w(uint16_t offset, uint8_t data, uint8_t bank_num) { address_space &vdp_space = machine().device("tc0091lvc")->space(); vdp_space.write_byte(offset + (m_ram_bank[bank_num]) * 0x1000,data);; @@ -166,7 +166,7 @@ READ8_MEMBER(lastbank_state::mux_0_r) const char *const keynames[2][5] = { {"P1_KEY0", "P1_KEY1", "P1_KEY2", "P1_KEY3", "P1_KEY4"}, {"P2_KEY0", "P2_KEY1", "P2_KEY2", "P2_KEY3", "P2_KEY4"} }; - UINT8 res; + uint8_t res; int i; res = 0xff; diff --git a/src/mame/drivers/lastduel.cpp b/src/mame/drivers/lastduel.cpp index a6fddcd68c2..6cd3d5242f2 100644 --- a/src/mame/drivers/lastduel.cpp +++ b/src/mame/drivers/lastduel.cpp @@ -463,7 +463,7 @@ MACHINE_START_MEMBER(lastduel_state,lastduel) MACHINE_START_MEMBER(lastduel_state,madgear) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/lastfght.cpp b/src/mame/drivers/lastfght.cpp index b4d34c73d1c..e3808728387 100644 --- a/src/mame/drivers/lastfght.cpp +++ b/src/mame/drivers/lastfght.cpp @@ -99,7 +99,7 @@ public: int m_view_roms; /* misc */ - UINT16 m_c00006; + uint16_t m_c00006; /* devices */ required_device m_maincpu; @@ -107,7 +107,7 @@ public: required_device m_palette; /* memory */ - UINT8 m_colorram[256 * 3]; + uint8_t m_colorram[256 * 3]; DECLARE_WRITE16_MEMBER(colordac_w); DECLARE_WRITE16_MEMBER(lastfght_hi_w); DECLARE_WRITE16_MEMBER(lastfght_x_w); @@ -130,7 +130,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_lastfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lastfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -150,14 +150,14 @@ void lastfght_state::video_start() } -UINT32 lastfght_state::screen_update_lastfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t lastfght_state::screen_update_lastfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { #ifdef MAME_DEBUG #if 1 // gfx roms viewer (toggle with enter, use pgup/down to browse) int x, y, count = 0; - UINT8 *gfxdata = memregion("gfx1")->base(); - UINT8 data; + uint8_t *gfxdata = memregion("gfx1")->base(); + uint8_t data; if (machine().input().code_pressed_once(KEYCODE_ENTER)) m_view_roms ^= 1; if (m_view_roms) @@ -328,7 +328,7 @@ WRITE16_MEMBER(lastfght_state::lastfght_blit_w) if (ACCESSING_BITS_8_15) { int x, y, addr; - UINT8 *gfxdata = memregion( "gfx1" )->base(); + uint8_t *gfxdata = memregion( "gfx1" )->base(); bitmap_ind16 &dest = m_bitmap[m_dest]; #if 0 @@ -601,7 +601,7 @@ ROM_END DRIVER_INIT_MEMBER(lastfght_state,lastfght) { - UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t*)memregion("maincpu")->base(); // pass initial check (protection ? hw?) rom[0x00354 / 2] = 0x403e; diff --git a/src/mame/drivers/lazercmd.cpp b/src/mame/drivers/lazercmd.cpp index df7f7d26933..c7ddcea5c2f 100644 --- a/src/mame/drivers/lazercmd.cpp +++ b/src/mame/drivers/lazercmd.cpp @@ -289,7 +289,7 @@ WRITE8_MEMBER(lazercmd_state::lazercmd_ctrl_port_w) /* triggered by REDC,r opcode */ READ8_MEMBER(lazercmd_state::lazercmd_ctrl_port_r) { - UINT8 data = 0; + uint8_t data = 0; return data; } @@ -301,7 +301,7 @@ WRITE8_MEMBER(lazercmd_state::lazercmd_data_port_w) /* triggered by REDD,r opcode */ READ8_MEMBER(lazercmd_state::lazercmd_data_port_r) { - UINT8 data = ioport("DSW")->read() & 0x0f; + uint8_t data = ioport("DSW")->read() & 0x0f; return data; } @@ -369,7 +369,7 @@ WRITE8_MEMBER(lazercmd_state::bbonk_hardware_w) READ8_MEMBER(lazercmd_state::lazercmd_hardware_r) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -780,7 +780,7 @@ ROM_END DRIVER_INIT_MEMBER(lazercmd_state,lazercmd) { int i, y; - UINT8 *gfx = memregion("gfx1")->base(); + uint8_t *gfx = memregion("gfx1")->base(); /****************************************************************** * To show the maze bit #6 and #7 of the video ram are used. @@ -792,8 +792,8 @@ DRIVER_INIT_MEMBER(lazercmd_state,lazercmd) ******************************************************************/ for (i = 0; i < 0x40; i++) { - UINT8 *d = &gfx[0 * 64 * 10 + i * VERT_CHR]; - UINT8 *s = &gfx[4 * 64 * 10 + i * VERT_FNT]; + uint8_t *d = &gfx[0 * 64 * 10 + i * VERT_CHR]; + uint8_t *s = &gfx[4 * 64 * 10 + i * VERT_FNT]; for (y = 0; y < VERT_CHR; y++) { diff --git a/src/mame/drivers/lbeach.cpp b/src/mame/drivers/lbeach.cpp index 34e11f9bb97..4b9482f5bf3 100644 --- a/src/mame/drivers/lbeach.cpp +++ b/src/mame/drivers/lbeach.cpp @@ -50,11 +50,11 @@ public: /* devices / memory pointers */ required_device m_maincpu; - required_shared_ptr m_bg_vram; - required_shared_ptr m_fg_vram; - required_shared_ptr m_scroll_y; - required_shared_ptr m_sprite_x; - required_shared_ptr m_sprite_code; + required_shared_ptr m_bg_vram; + required_shared_ptr m_fg_vram; + required_shared_ptr m_scroll_y; + required_shared_ptr m_sprite_x; + required_shared_ptr m_sprite_code; int m_collision_bg_car; int m_collision_fg_car; @@ -77,7 +77,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(lbeach); - UINT32 screen_update_lbeach(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lbeach(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -118,14 +118,14 @@ TILE_GET_INFO_MEMBER(lbeach_state::get_bg_tile_info) // d0-d4: code // d5: unused? // d6,d7: color - UINT8 code = m_bg_vram[tile_index]; + uint8_t code = m_bg_vram[tile_index]; SET_TILE_INFO_MEMBER(1, code & 0x1f, code >> 6 & 3, 0); } TILE_GET_INFO_MEMBER(lbeach_state::get_fg_tile_info) { - UINT8 code = m_fg_vram[tile_index]; + uint8_t code = m_fg_vram[tile_index]; SET_TILE_INFO_MEMBER(0, code, 0, 0); } @@ -141,7 +141,7 @@ void lbeach_state::video_start() } -UINT32 lbeach_state::screen_update_lbeach(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t lbeach_state::screen_update_lbeach(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // draw bg layer (road) m_bg_tilemap->set_scrolly(0, *m_scroll_y); @@ -207,8 +207,8 @@ READ8_MEMBER(lbeach_state::lbeach_in1_r) READ8_MEMBER(lbeach_state::lbeach_in2_r) { // d6 and d7 are for collision detection - UINT8 d6 = m_collision_fg_car ? 0x40 : 0; - UINT8 d7 = m_collision_bg_car ? 0x80 : 0; + uint8_t d6 = m_collision_fg_car ? 0x40 : 0; + uint8_t d7 = m_collision_bg_car ? 0x80 : 0; return (ioport("IN2")->read() & 0x3f) | d6 | d7; } diff --git a/src/mame/drivers/lc80.cpp b/src/mame/drivers/lc80.cpp index 9deed1fc2fe..34017c6c373 100644 --- a/src/mame/drivers/lc80.cpp +++ b/src/mame/drivers/lc80.cpp @@ -237,7 +237,7 @@ READ8_MEMBER( lc80_state::pio2_pb_r ) */ - UINT8 data = 0xf0; + uint8_t data = 0xf0; int i; for (i = 0; i < 6; i++) @@ -272,7 +272,7 @@ void lc80_state::machine_start() { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *ROM = memregion(Z80_TAG)->base(); + uint8_t *ROM = memregion(Z80_TAG)->base(); /* setup memory banking */ membank("bank1")->configure_entry(0, &ROM[0]); // TODO diff --git a/src/mame/drivers/lcmate2.cpp b/src/mame/drivers/lcmate2.cpp index 77383d393ab..a7570d15f54 100644 --- a/src/mame/drivers/lcmate2.cpp +++ b/src/mame/drivers/lcmate2.cpp @@ -70,7 +70,7 @@ WRITE8_MEMBER( lcmate2_state::speaker_w ) // offsets are FE,FD,FB,F7,EF,DF,BF,7F to scan a particular row, or 00 to check if any key pressed READ8_MEMBER( lcmate2_state::key_r ) { - UINT8 i,data = 0xff; + uint8_t i,data = 0xff; char kbdrow[8]; for (i=0; i<8; i++) @@ -202,7 +202,7 @@ PALETTE_INIT_MEMBER(lcmate2_state, lcmate2) void lcmate2_state::machine_start() { - membank("rombank")->configure_entries(0, 0x10, (UINT8*)memregion("maincpu")->base(), 0x4000); + membank("rombank")->configure_entries(0, 0x10, (uint8_t*)memregion("maincpu")->base(), 0x4000); } static const gfx_layout lcmate2_charlayout = diff --git a/src/mame/drivers/leapster.cpp b/src/mame/drivers/leapster.cpp index 47e36349c13..e25c835e763 100644 --- a/src/mame/drivers/leapster.cpp +++ b/src/mame/drivers/leapster.cpp @@ -225,7 +225,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_leapster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_leapster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(leapster_cart); DECLARE_DRIVER_INIT(leapster); @@ -254,14 +254,14 @@ INPUT_PORTS_END -UINT32 leapster_state::screen_update_leapster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t leapster_state::screen_update_leapster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } DEVICE_IMAGE_LOAD_MEMBER( leapster_state, leapster_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); m_cart->rom_alloc(size, GENERIC_ROM32_WIDTH, ENDIANNESS_LITTLE); m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); diff --git a/src/mame/drivers/legionna.cpp b/src/mame/drivers/legionna.cpp index 814603b9900..3877657df2a 100644 --- a/src/mame/drivers/legionna.cpp +++ b/src/mame/drivers/legionna.cpp @@ -1048,12 +1048,12 @@ static const gfx_layout legionna_new_charlayout = }; -void legionna_state::descramble_legionnaire_gfx(UINT8* src) +void legionna_state::descramble_legionnaire_gfx(uint8_t* src) { int len = 0x10000; /* rearrange gfx */ - std::vector buffer(len); + std::vector buffer(len); { int i; for (i = 0;i < len; i++) @@ -2380,7 +2380,7 @@ ROM_END DRIVER_INIT_MEMBER(legionna_state, cupsoc_debug) { #if CUPSOC_DEBUG_MODE - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); ROM[0xffffa/2] = 0x0000; ROM[0xffff6/2] ^= 0x00ff; #endif @@ -2388,7 +2388,7 @@ DRIVER_INIT_MEMBER(legionna_state, cupsoc_debug) DRIVER_INIT_MEMBER(legionna_state, olysoc92) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); ROM[0xffffe/2] ^= 0x0003; // show Olympic Soccer '92 title DRIVER_INIT_CALL(cupsoc_debug); @@ -2396,7 +2396,7 @@ DRIVER_INIT_MEMBER(legionna_state, olysoc92) DRIVER_INIT_MEMBER(legionna_state, cupsocs) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); ROM[0xffffa/2] = 0x00ff; // disable debug text (this is already 0x00ff in the bootleg sets for the same reason) DRIVER_INIT_CALL(cupsoc_debug); diff --git a/src/mame/drivers/leland.cpp b/src/mame/drivers/leland.cpp index 51b5a0d0384..91e234c963d 100644 --- a/src/mame/drivers/leland.cpp +++ b/src/mame/drivers/leland.cpp @@ -2574,7 +2574,7 @@ ROM_END * *************************************/ -void leland_state::init_master_ports(UINT8 mvram_base, UINT8 io_base) +void leland_state::init_master_ports(uint8_t mvram_base, uint8_t io_base) { /* set up the master CPU VRAM I/O */ m_master->space(AS_IO).install_readwrite_handler(mvram_base, mvram_base + 0x1f, read8_delegate(FUNC(leland_state::leland_mvram_port_r),this), write8_delegate(FUNC(leland_state::leland_mvram_port_w),this)); diff --git a/src/mame/drivers/lemmings.cpp b/src/mame/drivers/lemmings.cpp index f146938b059..9e67c7ec820 100644 --- a/src/mame/drivers/lemmings.cpp +++ b/src/mame/drivers/lemmings.cpp @@ -48,7 +48,7 @@ READ16_MEMBER(lemmings_state::lemmings_trackball_r) -void lemmings_state::lemmings_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ) +void lemmings_state::lemmings_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ) { m_soundlatch->write(space, 0, data & 0xff); m_audiocpu->set_input_line(1, HOLD_LINE); @@ -63,8 +63,8 @@ READ16_MEMBER( lemmings_state::lem_protection_region_0_146_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -72,7 +72,7 @@ WRITE16_MEMBER( lemmings_state::lem_protection_region_0_146_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } diff --git a/src/mame/drivers/lft.cpp b/src/mame/drivers/lft.cpp index 63479765180..e067ac93994 100644 --- a/src/mame/drivers/lft.cpp +++ b/src/mame/drivers/lft.cpp @@ -27,7 +27,7 @@ public: DECLARE_READ16_MEMBER(status_r); private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; required_device m_maincpu; required_device m_terminal; @@ -57,7 +57,7 @@ INPUT_PORTS_END READ16_MEMBER( lft_state::keyin_r ) { - UINT16 ret = m_term_data; + uint16_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/lgp.cpp b/src/mame/drivers/lgp.cpp index 85edb077992..9b4e2dd8310 100644 --- a/src/mame/drivers/lgp.cpp +++ b/src/mame/drivers/lgp.cpp @@ -84,13 +84,13 @@ public: m_palette(*this, "palette") { } required_device m_laserdisc; - required_shared_ptr m_tile_ram; - required_shared_ptr m_tile_control_ram; + required_shared_ptr m_tile_ram; + required_shared_ptr m_tile_control_ram; DECLARE_READ8_MEMBER(ldp_read); DECLARE_WRITE8_MEMBER(ldp_write); DECLARE_DRIVER_INIT(lgp); virtual void machine_start() override; - UINT32 screen_update_lgp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lgp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_callback_lgp); DECLARE_WRITE_LINE_MEMBER(ld_command_strobe_cb); DECLARE_PALETTE_INIT(lgp); @@ -106,7 +106,7 @@ public: /* VIDEO GOODS */ -UINT32 lgp_state::screen_update_lgp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t lgp_state::screen_update_lgp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int charx, chary; @@ -362,7 +362,7 @@ WRITE_LINE_MEMBER(lgp_state::ld_command_strobe_cb) PALETTE_INIT_MEMBER(lgp_state, lgp) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; // for (i = 0; i < palette.entries(); i++) diff --git a/src/mame/drivers/liberate.cpp b/src/mame/drivers/liberate.cpp index 41ed2c97766..1665d748bb9 100644 --- a/src/mame/drivers/liberate.cpp +++ b/src/mame/drivers/liberate.cpp @@ -31,7 +31,7 @@ READ8_MEMBER(liberate_state::deco16_bank_r) { - const UINT8 *ROM = memregion("user1")->base(); + const uint8_t *ROM = memregion("user1")->base(); /* The tilemap bank can be swapped into main memory */ if (m_bank) @@ -80,7 +80,7 @@ WRITE8_MEMBER(liberate_state::deco16_bank_w) READ8_MEMBER(liberate_state::prosoccr_bank_r) { - const UINT8 *ROM = memregion("user1")->base(); + const uint8_t *ROM = memregion("user1")->base(); /* The tilemap bank can be swapped into main memory */ if (m_bank) @@ -109,7 +109,7 @@ READ8_MEMBER(liberate_state::prosoccr_bank_r) READ8_MEMBER(liberate_state::prosoccr_charram_r) { - UINT8 *SRC_GFX = memregion("shared_gfx")->base(); + uint8_t *SRC_GFX = memregion("shared_gfx")->base(); if (m_gfx_rom_readback) { @@ -184,7 +184,7 @@ WRITE8_MEMBER(liberate_state::prosoccr_io_bank_w) READ8_MEMBER(liberate_state::prosport_charram_r) { - UINT8 *FG_GFX = memregion("progolf_fg_gfx")->base(); + uint8_t *FG_GFX = memregion("progolf_fg_gfx")->base(); switch (offset & 0x1800) { @@ -204,7 +204,7 @@ READ8_MEMBER(liberate_state::prosport_charram_r) WRITE8_MEMBER(liberate_state::prosport_charram_w) { - UINT8 *FG_GFX = memregion("progolf_fg_gfx")->base(); + uint8_t *FG_GFX = memregion("progolf_fg_gfx")->base(); switch (offset & 0x1800) { @@ -1265,7 +1265,7 @@ ROM_END DRIVER_INIT_MEMBER(liberate_state,prosport) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); int i; /* Main cpu has the nibbles swapped */ @@ -1283,7 +1283,7 @@ DRIVER_INIT_MEMBER(liberate_state,yellowcb) DRIVER_INIT_MEMBER(liberate_state,liberate) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* Swap bits for opcodes only, not data */ for (int A = 0; A < 0x8000; A++) { diff --git a/src/mame/drivers/liberatr.cpp b/src/mame/drivers/liberatr.cpp index 121050b3bd9..e0626ac0cda 100644 --- a/src/mame/drivers/liberatr.cpp +++ b/src/mame/drivers/liberatr.cpp @@ -192,8 +192,8 @@ WRITE8_MEMBER( liberatr_state::trackball_reset_w ) /* input becomes the starting point for the trackball counters */ if (((data ^ m_ctrld) & 0x10) && (data & 0x10)) { - UINT8 trackball = ioport("FAKE")->read(); - UINT8 switches = ioport("IN0")->read(); + uint8_t trackball = ioport("FAKE")->read(); + uint8_t switches = ioport("IN0")->read(); m_trackball_offset = ((trackball & 0xf0) - (switches & 0xf0)) | ((trackball - switches) & 0x0f); } m_ctrld = data & 0x10; @@ -205,7 +205,7 @@ READ8_MEMBER( liberatr_state::port0_r ) /* if ctrld is high, the /ld signal on the LS191 is NOT set, meaning that the trackball is counting */ if (m_ctrld) { - UINT8 trackball = ioport("FAKE")->read(); + uint8_t trackball = ioport("FAKE")->read(); return ((trackball & 0xf0) - (m_trackball_offset & 0xf0)) | ((trackball - m_trackball_offset) & 0x0f); } diff --git a/src/mame/drivers/limenko.cpp b/src/mame/drivers/limenko.cpp index f450cecd194..40b9c8f2997 100644 --- a/src/mame/drivers/limenko.cpp +++ b/src/mame/drivers/limenko.cpp @@ -58,13 +58,13 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_mainram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_md_videoram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; - required_shared_ptr m_videoreg; + required_shared_ptr m_mainram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_md_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_videoreg; tilemap_t *m_bg_tilemap; tilemap_t *m_md_tilemap; @@ -74,7 +74,7 @@ public: bitmap_ind16 m_sprites_bitmap; bitmap_ind8 m_sprites_bitmap_pri; int m_prev_sprites_count; - UINT8 m_spotty_sound_cmd; + uint8_t m_spotty_sound_cmd; DECLARE_WRITE32_MEMBER(limenko_coincounter_w); DECLARE_WRITE32_MEMBER(bg_videoram_w); @@ -108,9 +108,9 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); virtual void video_start() override; - UINT32 screen_update_limenko(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_single_sprite(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_element *gfx,UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,int priority); - void draw_sprites(UINT32 *sprites, const rectangle &cliprect, int count); + uint32_t screen_update_limenko(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_single_sprite(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_element *gfx,uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy,int priority); + void draw_sprites(uint32_t *sprites, const rectangle &cliprect, int count); void copy_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &sprites_bitmap, bitmap_ind8 &priority_bitmap, const rectangle &cliprect); }; @@ -322,11 +322,11 @@ TILE_GET_INFO_MEMBER(limenko_state::get_fg_tile_info) } void limenko_state::draw_single_sprite(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 priority) { int pal_base = 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 = ((1<<16)*gfx->height()+0x8000)>>16; int sprite_screen_width = ((1<<16)*gfx->width()+0x8000)>>16; @@ -393,9 +393,9 @@ void limenko_state::draw_single_sprite(bitmap_ind16 &dest_bmp,const rectangle &c for( y=sy; y>16) * gfx->rowbytes(); - UINT16 *dest = &dest_bmp.pix16(y); - UINT8 *pri = &m_sprites_bitmap_pri.pix8(y); + const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes(); + uint16_t *dest = &dest_bmp.pix16(y); + uint8_t *pri = &m_sprites_bitmap_pri.pix8(y); int x, x_index = x_index_base; for( x=sx; xbase(); - UINT8 *gfx_max = base_gfx + memregion("gfx1")->bytes(); + uint8_t *base_gfx = memregion("gfx1")->base(); + uint8_t *gfx_max = base_gfx + memregion("gfx1")->bytes(); - UINT8 *gfxdata; + uint8_t *gfxdata; for(i = 0; i <= count*2; i += 2) { @@ -482,10 +482,10 @@ void limenko_state::copy_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &sprites_bit int y; for( y=cliprect.min_y; y<=cliprect.max_y; y++ ) { - UINT16 *source = &sprites_bitmap.pix16(y); - UINT16 *dest = &bitmap.pix16(y); - UINT8 *dest_pri = &priority_bitmap.pix8(y); - UINT8 *source_pri = &m_sprites_bitmap_pri.pix8(y); + uint16_t *source = &sprites_bitmap.pix16(y); + uint16_t *dest = &bitmap.pix16(y); + uint8_t *dest_pri = &priority_bitmap.pix8(y); + uint8_t *source_pri = &m_sprites_bitmap_pri.pix8(y); int x; for( x=cliprect.min_x; x<=cliprect.max_x; x++ ) @@ -515,7 +515,7 @@ void limenko_state::video_start() save_item(NAME(m_prev_sprites_count)); } -UINT32 limenko_state::screen_update_limenko(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t limenko_state::screen_update_limenko(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // m_videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?) @@ -1139,8 +1139,8 @@ DRIVER_INIT_MEMBER(limenko_state,sb2003) DRIVER_INIT_MEMBER(limenko_state,spotty) { - UINT8 *dst = memregion("gfx1")->base(); - UINT8 *src = memregion("user2")->base(); + uint8_t *dst = memregion("gfx1")->base(); + uint8_t *src = memregion("user2")->base(); int x; /* expand 4bpp roms to 8bpp space */ diff --git a/src/mame/drivers/littlerb.cpp b/src/mame/drivers/littlerb.cpp index 122f7f0f889..52bafd6cd9f 100644 --- a/src/mame/drivers/littlerb.cpp +++ b/src/mame/drivers/littlerb.cpp @@ -90,14 +90,14 @@ public: required_device m_ldac; required_device m_rdac; - UINT8 m_sound_index_l,m_sound_index_r; - UINT16 m_sound_pointer_l,m_sound_pointer_r; + uint8_t m_sound_index_l,m_sound_index_r; + uint16_t m_sound_pointer_l,m_sound_pointer_r; int m_soundframe; DECLARE_CUSTOM_INPUT_MEMBER(littlerb_frame_step_r); DECLARE_WRITE16_MEMBER(littlerb_l_sound_w); DECLARE_WRITE16_MEMBER(littlerb_r_sound_w); - UINT8 sound_data_shift(); + uint8_t sound_data_shift(); TIMER_DEVICE_CALLBACK_MEMBER(littlerb_sound_step_cb); TIMER_DEVICE_CALLBACK_MEMBER(littlerb_sound_cb); @@ -106,7 +106,7 @@ public: /* could be slightly different (timing wise, directly related to the irqs), but certainly they smoked some bad pot for this messy way ... */ -UINT8 littlerb_state::sound_data_shift() +uint8_t littlerb_state::sound_data_shift() { return ((m_soundframe % 16) == 0) ? 8 : 0; } @@ -147,7 +147,7 @@ ADDRESS_MAP_END /* guess according to DASM code and checking the gameplay speed, could be different */ CUSTOM_INPUT_MEMBER(littlerb_state::littlerb_frame_step_r) { - UINT32 ret = m_soundframe; + uint32_t ret = m_soundframe; return (ret) & 7; } @@ -232,7 +232,7 @@ INPUT_PORTS_END TIMER_DEVICE_CALLBACK_MEMBER(littlerb_state::littlerb_sound_cb) { - UINT8 *sample_rom = memregion("samples")->base(); + uint8_t *sample_rom = memregion("samples")->base(); m_ldac->write(sample_rom[m_sound_pointer_l | (m_sound_index_l << 10) | 0x40000]); m_rdac->write(sample_rom[m_sound_pointer_r | (m_sound_index_r << 10) | 0x00000]); diff --git a/src/mame/drivers/llc.cpp b/src/mame/drivers/llc.cpp index a5f300c6fd1..e01e1ad72b9 100644 --- a/src/mame/drivers/llc.cpp +++ b/src/mame/drivers/llc.cpp @@ -123,9 +123,9 @@ INPUT_PORTS_END WRITE8_MEMBER( llc_state::kbd_put ) { - static UINT8 s1[16]={0x40, 0x1e, 0x12, 0x1b, 0x19, 0x14, 0x15, 0x1d, 0x16, 0x17, 0x1c, 0x3c, 0x3f, 0x3d, 0x3e, 0x10}; // 0x20 to 0x2F - static UINT8 s2[7] ={0x1a, 0x11, 0x7c, 0x13, 0x7b, 0x1f, 0x00}; // 0x3A to 0x40 - static UINT8 s3[6] ={0x5c, 0x00, 0x5b, 0x7e, 0x00, 0x5e}; // 0x5B to 0x60 + static uint8_t s1[16]={0x40, 0x1e, 0x12, 0x1b, 0x19, 0x14, 0x15, 0x1d, 0x16, 0x17, 0x1c, 0x3c, 0x3f, 0x3d, 0x3e, 0x10}; // 0x20 to 0x2F + static uint8_t s2[7] ={0x1a, 0x11, 0x7c, 0x13, 0x7b, 0x1f, 0x00}; // 0x3A to 0x40 + static uint8_t s3[6] ={0x5c, 0x00, 0x5b, 0x7e, 0x00, 0x5e}; // 0x5B to 0x60 m_term_data = data; diff --git a/src/mame/drivers/lola8a.cpp b/src/mame/drivers/lola8a.cpp index ae8b90b6a8e..4e573c58a63 100644 --- a/src/mame/drivers/lola8a.cpp +++ b/src/mame/drivers/lola8a.cpp @@ -54,7 +54,7 @@ public: MC6845_UPDATE_ROW(crtc_update_row); private: - UINT8 m_portb; + uint8_t m_portb; required_device m_cass; public: required_device m_palette; @@ -192,8 +192,8 @@ MC6845_UPDATE_ROW( lola8a_state::crtc_update_row ) for (int sx = 0; sx < x_count; sx++) { - UINT16 addr = 0xa000 + sx*8 + ra + ma * 8; - UINT8 code = program.read_byte(addr); + uint16_t addr = 0xa000 + sx*8 + ra + ma * 8; + uint8_t code = program.read_byte(addr); for (int x = 0; x <= 8; x++) { diff --git a/src/mame/drivers/looping.cpp b/src/mame/drivers/looping.cpp index e7c6a4691b9..4b4218fc570 100644 --- a/src/mame/drivers/looping.cpp +++ b/src/mame/drivers/looping.cpp @@ -116,16 +116,16 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - UINT8 m_cop_port_l; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + uint8_t m_cop_port_l; /* tilemaps */ tilemap_t * m_bg_tilemap; /* sound state */ - UINT8 m_sound[8]; + uint8_t m_sound[8]; int m_last; @@ -157,7 +157,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(looping); - UINT32 screen_update_looping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_looping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(looping_interrupt); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; @@ -178,7 +178,7 @@ public: PALETTE_INIT_MEMBER(looping_state, looping) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); static const int resistances[3] = { 1000, 470, 220 }; double rweights[3], gweights[3], bweights[2]; int i; @@ -297,7 +297,7 @@ WRITE8_MEMBER(looping_state::looping_colorram_w) void looping_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - const UINT8 *source; + const uint8_t *source; for (source = m_spriteram; source < m_spriteram + 0x40; source += 4) { @@ -325,7 +325,7 @@ void looping_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect } -UINT32 looping_state::screen_update_looping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t looping_state::screen_update_looping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -893,7 +893,7 @@ ROM_END DRIVER_INIT_MEMBER(looping_state,looping) { int length = memregion("maincpu")->bytes(); - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; m_cop_port_l = 0; diff --git a/src/mame/drivers/lordgun.cpp b/src/mame/drivers/lordgun.cpp index 20c20103e2c..d80dfc1d1b8 100644 --- a/src/mame/drivers/lordgun.cpp +++ b/src/mame/drivers/lordgun.cpp @@ -81,7 +81,7 @@ READ16_MEMBER(lordgun_state::lordgun_protection_r) { case 0x40/2: // bitswap and xor counter { - UINT8 x = m_protection_data; + uint8_t x = m_protection_data; m_protection_data = ((( x >> 0) | ( x >> 1)) & 1) << 4; m_protection_data |= ((~x >> 2) & 1) << 3; @@ -132,7 +132,7 @@ READ16_MEMBER(lordgun_state::aliencha_protection_r) case 0x40/2: // bitswap and xor counter { - UINT8 x = m_protection_data; + uint8_t x = m_protection_data; m_protection_data = (((x >> 3) ^ (x >> 2)) & 1) << 4; m_protection_data |= (((x >> 2) ^ (x >> 1)) & 1) << 3; @@ -1043,12 +1043,12 @@ ROM_END DRIVER_INIT_MEMBER(lordgun_state, lordgun) { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); int rom_size = 0x100000; for(int i = 0; i < rom_size/2; i++) { - UINT16 x = rom[i]; + uint16_t x = rom[i]; if((i & 0x0120) == 0x0100 || (i & 0x0a00) == 0x0800) x ^= 0x0010; diff --git a/src/mame/drivers/lsasquad.cpp b/src/mame/drivers/lsasquad.cpp index 7f2a5357e6d..0aefa8c1a18 100644 --- a/src/mame/drivers/lsasquad.cpp +++ b/src/mame/drivers/lsasquad.cpp @@ -545,7 +545,7 @@ WRITE8_MEMBER(lsasquad_state::unk) MACHINE_START_MEMBER(lsasquad_state,lsasquad) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000); diff --git a/src/mame/drivers/ltcasino.cpp b/src/mame/drivers/ltcasino.cpp index aedbc251deb..458f27d342c 100644 --- a/src/mame/drivers/ltcasino.cpp +++ b/src/mame/drivers/ltcasino.cpp @@ -30,15 +30,15 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_tile_num_ram; - required_shared_ptr m_tile_atr_ram; + required_shared_ptr m_tile_num_ram; + required_shared_ptr m_tile_atr_ram; tilemap_t *m_tilemap; DECLARE_WRITE8_MEMBER(ltcasino_tile_num_w); DECLARE_WRITE8_MEMBER(ltcasino_tile_atr_w); DECLARE_DRIVER_INIT(mv4in1); TILE_GET_INFO_MEMBER(get_ltcasino_tile_info); virtual void video_start() override; - UINT32 screen_update_ltcasino(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ltcasino(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -642,7 +642,7 @@ static GFXDECODE_START( ltcasino ) GFXDECODE_END -UINT32 ltcasino_state::screen_update_ltcasino(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ltcasino_state::screen_update_ltcasino(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap->draw(screen, bitmap, cliprect, 0,0); return 0; @@ -719,7 +719,7 @@ ROM_END DRIVER_INIT_MEMBER(ltcasino_state,mv4in1) { int i; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for(i=0;i<0x10000;i++) rom[i]=BITSWAP8(rom[i],7,6,5,4,3,1,2,0); } diff --git a/src/mame/drivers/ltd.cpp b/src/mame/drivers/ltd.cpp index 61893d4685a..df1259f3ef3 100644 --- a/src/mame/drivers/ltd.cpp +++ b/src/mame/drivers/ltd.cpp @@ -70,14 +70,14 @@ public: private: bool m_timer_r; bool m_clear; - UINT8 m_counter; - UINT8 m_digit; - UINT8 m_game; - UINT8 m_out_offs; - UINT8 m_port2; + uint8_t m_counter; + uint8_t m_digit; + uint8_t m_game; + uint8_t m_out_offs; + uint8_t m_port2; virtual void machine_reset() override; required_device m_maincpu; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; }; @@ -266,7 +266,7 @@ READ8_MEMBER( ltd_state:: port1_r ) { if (~m_port2 & 0x10) { - UINT8 row = m_digit >> 4; + uint8_t row = m_digit >> 4; if (row==0) return ioport("X0")->read(); @@ -299,8 +299,8 @@ WRITE8_MEMBER( ltd_state::port1_w ) { if (m_port2 & 0x10) { - UINT8 row = m_digit & 15; - UINT8 segment = BITSWAP8(data, 7, 0, 1, 2, 3, 4, 5, 6); + uint8_t row = m_digit & 15; + uint8_t segment = BITSWAP8(data, 7, 0, 1, 2, 3, 4, 5, 6); switch (m_counter) { @@ -388,7 +388,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( ltd_state::timer_r ) { m_timer_r ^= 1; m_maincpu->set_input_line(M6802_IRQ_LINE, (m_timer_r) ? CLEAR_LINE : ASSERT_LINE); - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 m_out_offs++; if (m_out_offs > 0x7f) m_out_offs = 0x60; diff --git a/src/mame/drivers/luckgrln.cpp b/src/mame/drivers/luckgrln.cpp index ecf47f396e3..f95038a3b9c 100644 --- a/src/mame/drivers/luckgrln.cpp +++ b/src/mame/drivers/luckgrln.cpp @@ -109,29 +109,29 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_nmi_enable; + uint8_t m_nmi_enable; tilemap_t *m_reel1_tilemap; tilemap_t *m_reel2_tilemap; tilemap_t *m_reel3_tilemap; tilemap_t *m_reel4_tilemap; - required_shared_ptr m_reel1_ram; - required_shared_ptr m_reel1_attr; - required_shared_ptr m_reel1_scroll; - required_shared_ptr m_reel2_ram; - required_shared_ptr m_reel2_attr; - required_shared_ptr m_reel2_scroll; - required_shared_ptr m_reel3_ram; - required_shared_ptr m_reel3_attr; - required_shared_ptr m_reel3_scroll; - required_shared_ptr m_reel4_ram; - required_shared_ptr m_reel4_attr; - required_shared_ptr m_reel4_scroll; - required_shared_ptr m_luck_vram1; - required_shared_ptr m_luck_vram2; - required_shared_ptr m_luck_vram3; + required_shared_ptr m_reel1_ram; + required_shared_ptr m_reel1_attr; + required_shared_ptr m_reel1_scroll; + required_shared_ptr m_reel2_ram; + required_shared_ptr m_reel2_attr; + required_shared_ptr m_reel2_scroll; + required_shared_ptr m_reel3_ram; + required_shared_ptr m_reel3_attr; + required_shared_ptr m_reel3_scroll; + required_shared_ptr m_reel4_ram; + required_shared_ptr m_reel4_attr; + required_shared_ptr m_reel4_scroll; + required_shared_ptr m_luck_vram1; + required_shared_ptr m_luck_vram2; + required_shared_ptr m_luck_vram3; int m_palette_count; - UINT8 m_palette_ram[0x10000]; + uint8_t m_palette_ram[0x10000]; DECLARE_WRITE8_MEMBER(luckgrln_reel1_ram_w); DECLARE_WRITE8_MEMBER(luckgrln_reel1_attr_w); DECLARE_WRITE8_MEMBER(luckgrln_reel2_ram_w); @@ -155,7 +155,7 @@ public: TILE_GET_INFO_MEMBER(get_luckgrln_reel3_tile_info); TILE_GET_INFO_MEMBER(get_luckgrln_reel4_tile_info); virtual void video_start() override; - UINT32 screen_update_luckgrln(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_luckgrln(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(luckgrln_irq); required_device m_maincpu; required_device m_gfxdecode; @@ -293,7 +293,7 @@ void luckgrln_state::video_start() m_reel4_tilemap->set_transparent_pen(0 ); } -UINT32 luckgrln_state::screen_update_luckgrln(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t luckgrln_state::screen_update_luckgrln(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y,x; int count = 0; @@ -323,12 +323,12 @@ UINT32 luckgrln_state::screen_update_luckgrln(screen_device &screen, bitmap_ind1 for (x=0;x<64;x++) { - UINT16 tile = (m_luck_vram1[count] & 0xff); - UINT16 tile_high = (m_luck_vram2[count]); - UINT16 tileattr = (m_luck_vram3[count]); - UINT8 col = 0; - UINT8 region = 0; - UINT8 bgenable; + uint16_t tile = (m_luck_vram1[count] & 0xff); + uint16_t tile_high = (m_luck_vram2[count]); + uint16_t tileattr = (m_luck_vram3[count]); + uint8_t col = 0; + uint8_t region = 0; + uint8_t bgenable; clip.min_x = x*8; clip.max_x = x*8+8; @@ -462,7 +462,7 @@ WRITE8_MEMBER(luckgrln_state::palette_w) { int r,g,b; int offs; - UINT16 dat; + uint16_t dat; offs = m_palette_count&~0x1; dat = m_palette_ram[offs] | m_palette_ram[offs+1]<<8; @@ -1017,8 +1017,8 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(luckgrln_state,luckgrln) { int i; - UINT8 x,v; - UINT8* rom = memregion("rom_data")->base(); + uint8_t x,v; + uint8_t* rom = memregion("rom_data")->base(); for (i=0;i<0x20000;i++) { diff --git a/src/mame/drivers/lucky74.cpp b/src/mame/drivers/lucky74.cpp index 31293b72645..9d37709b023 100644 --- a/src/mame/drivers/lucky74.cpp +++ b/src/mame/drivers/lucky74.cpp @@ -1398,7 +1398,7 @@ void lucky74_state::sound_start() { /* cleaning all 09R81P registers */ - UINT8 i; + uint8_t i; for (i = 0; i < 6; i++) { diff --git a/src/mame/drivers/lwings.cpp b/src/mame/drivers/lwings.cpp index 518714ab720..30a37fe3ecd 100644 --- a/src/mame/drivers/lwings.cpp +++ b/src/mame/drivers/lwings.cpp @@ -269,7 +269,7 @@ READ8_MEMBER(lwings_state::avengers_protection_r) READ8_MEMBER(lwings_state::avengers_soundlatch2_r) { - UINT8 data = *m_soundlatch2 | m_soundstate; + uint8_t data = *m_soundlatch2 | m_soundstate; m_soundstate = 0; return(data); } @@ -841,7 +841,7 @@ GFXDECODE_END void lwings_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000); @@ -891,7 +891,7 @@ void lwings_state::machine_start() if (membank("samplebank")) { - UINT8 *OKIROM = memregion("oki")->base(); + uint8_t *OKIROM = memregion("oki")->base(); membank("samplebank")->configure_entries(0, 8, OKIROM, 0x20000); } diff --git a/src/mame/drivers/lynx.cpp b/src/mame/drivers/lynx.cpp index b6d6fa5349d..4624a9e7f88 100644 --- a/src/mame/drivers/lynx.cpp +++ b/src/mame/drivers/lynx.cpp @@ -60,7 +60,7 @@ void lynx_state::video_start() machine().first_screen()->register_screen_bitmap(m_bitmap); } -UINT32 lynx_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t lynx_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; @@ -152,10 +152,10 @@ ROM_END QUICKLOAD_LOAD_MEMBER( lynx_state, lynx ) { address_space &space = m_maincpu->space(AS_PROGRAM); - std::vector data; - UINT8 *rom = memregion("maincpu")->base(); - UINT8 header[10]; // 80 08 dw Start dw Len B S 9 3 - UINT16 start, length; + std::vector data; + uint8_t *rom = memregion("maincpu")->base(); + uint8_t header[10]; // 80 08 dw Start dw Len B S 9 3 + uint16_t start, length; int i; if (image.fread( header, sizeof(header)) != sizeof(header)) diff --git a/src/mame/drivers/m107.cpp b/src/mame/drivers/m107.cpp index 01cfb02a90c..c2df3bc0ec2 100644 --- a/src/mame/drivers/m107.cpp +++ b/src/mame/drivers/m107.cpp @@ -1053,7 +1053,7 @@ ROM_END DRIVER_INIT_MEMBER(m107_state,firebarr) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->set_base(&ROM[0xa0000]); @@ -1062,7 +1062,7 @@ DRIVER_INIT_MEMBER(m107_state,firebarr) DRIVER_INIT_MEMBER(m107_state,dsoccr94) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000); m_maincpu->space(AS_IO).install_write_handler(0x06, 0x07, write16_delegate(FUNC(m107_state::bankswitch_w),this)); diff --git a/src/mame/drivers/m14.cpp b/src/mame/drivers/m14.cpp index 2be9b7950c2..b312dcabc27 100644 --- a/src/mame/drivers/m14.cpp +++ b/src/mame/drivers/m14.cpp @@ -68,11 +68,11 @@ public: /* video-related */ tilemap_t *m_m14_tilemap; - required_shared_ptr m_video_ram; - required_shared_ptr m_color_ram; + required_shared_ptr m_video_ram; + required_shared_ptr m_color_ram; /* input-related */ - UINT8 m_hop_mux; + uint8_t m_hop_mux; /* devices */ required_device m_maincpu; @@ -90,7 +90,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(m14); - UINT32 screen_update_m14(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m14(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(m14_irq); }; @@ -137,7 +137,7 @@ void m14_state::video_start() m_m14_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m14_state::m14_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 m14_state::screen_update_m14(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t m14_state::screen_update_m14(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_m14_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -183,7 +183,7 @@ READ8_MEMBER(m14_state::input_buttons_r) #if 0 WRITE8_MEMBER(m14_state::test_w) { - static UINT8 x[5]; + static uint8_t x[5]; x[offset] = data; diff --git a/src/mame/drivers/m20.cpp b/src/mame/drivers/m20.cpp index d2c60e88f4b..2dd25590d9c 100644 --- a/src/mame/drivers/m20.cpp +++ b/src/mame/drivers/m20.cpp @@ -84,7 +84,7 @@ public: required_device m_floppy1; optional_device m_apb; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_device m_palette; virtual void machine_start() override; @@ -102,7 +102,7 @@ public: private: offs_t m_memsize; - UINT8 m_port21; + uint8_t m_port21; void install_memory(); public: @@ -117,14 +117,14 @@ public: MC6845_UPDATE_ROW( m20_state::update_row ) { - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); const rgb_t *palette = m_palette->palette()->entry_list_raw(); int i, j; for ( i = 0; i < x_count; i++ ) { - UINT16 offset = ((ma | (ra << 1)) << 4) + i; - UINT16 data = m_p_videoram[ offset ]; + uint16_t offset = ((ma | (ra << 1)) << 4) + i; + uint16_t data = m_p_videoram[ offset ]; for ( j = 15; j >= 0; j-- ) { @@ -326,7 +326,7 @@ ADDRESS_MAP_END void m20_state::install_memory() { m_memsize = m_ram->size(); - UINT8 *memptr = m_ram->pointer(); + uint8_t *memptr = m_ram->pointer(); address_space& pspace = m_maincpu->space(AS_PROGRAM); address_space& dspace = m_maincpu->space(AS_DATA); @@ -739,8 +739,8 @@ void m20_state::machine_start() void m20_state::machine_reset() { - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 *RAM = (UINT8 *)(m_ram->pointer() + 0x4000); + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *RAM = (uint8_t *)(m_ram->pointer() + 0x4000); if (m_memsize >= 256 * 1024) m_port21 = 0xdf; diff --git a/src/mame/drivers/m24.cpp b/src/mame/drivers/m24.cpp index f3fd5372efe..21ac6bd26c9 100644 --- a/src/mame/drivers/m24.cpp +++ b/src/mame/drivers/m24.cpp @@ -45,7 +45,7 @@ public: void machine_reset() override; - UINT8 m_sysctl, m_pa, m_kbcin, m_kbcout; + uint8_t m_sysctl, m_pa, m_kbcin, m_kbcout; bool m_kbcibf, m_kbdata, m_i86_halt, m_i86_halt_perm; }; diff --git a/src/mame/drivers/m5.cpp b/src/mame/drivers/m5.cpp index 3a8d16e0985..c1192e3f35d 100644 --- a/src/mame/drivers/m5.cpp +++ b/src/mame/drivers/m5.cpp @@ -326,7 +326,7 @@ READ8_MEMBER( m5_state::sts_r ) */ - UINT8 data = 0; + uint8_t data = 0; // cassette input data |= m_cassette->input() >= 0 ? 1 : 0; diff --git a/src/mame/drivers/m52.cpp b/src/mame/drivers/m52.cpp index 591b93ef99d..81f1411f5a8 100644 --- a/src/mame/drivers/m52.cpp +++ b/src/mame/drivers/m52.cpp @@ -327,7 +327,7 @@ static const gfx_layout spritelayout = 32*8 }; -static const UINT32 bgcharlayout_xoffset[256] = +static const uint32_t bgcharlayout_xoffset[256] = { STEP4(0x000,1), STEP4(0x008,1), STEP4(0x010,1), STEP4(0x018,1), STEP4(0x020,1), STEP4(0x028,1), STEP4(0x030,1), STEP4(0x038,1), @@ -347,7 +347,7 @@ static const UINT32 bgcharlayout_xoffset[256] = STEP4(0x1e0,1), STEP4(0x1e8,1), STEP4(0x1f0,1), STEP4(0x1f8,1) }; -static const UINT32 bgcharlayout_yoffset[64] = +static const uint32_t bgcharlayout_yoffset[64] = { STEP32(0x0000,0x200), STEP32(0x4000,0x200) }; diff --git a/src/mame/drivers/m63.cpp b/src/mame/drivers/m63.cpp index abe42f69e37..28d694dddda 100644 --- a/src/mame/drivers/m63.cpp +++ b/src/mame/drivers/m63.cpp @@ -145,13 +145,13 @@ public: { } - required_shared_ptr m_spriteram; - required_shared_ptr m_scrollram; - required_shared_ptr m_videoram2; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scrollram; + required_shared_ptr m_videoram2; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; /* video-related */ tilemap_t *m_bg_tilemap; @@ -161,11 +161,11 @@ public: int m_sy_offset; /* sound-related */ - UINT8 m_sound_irq; + uint8_t m_sound_irq; int m_sound_status; int m_p1; int m_p2; - std::unique_ptr m_samplebuf; + std::unique_ptr m_samplebuf; /* devices */ required_device m_maincpu; @@ -202,7 +202,7 @@ public: DECLARE_MACHINE_RESET(m63); DECLARE_VIDEO_START(m63); DECLARE_PALETTE_INIT(m63); - UINT32 screen_update_m63(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m63(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(snd_irq); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); @@ -211,7 +211,7 @@ public: PALETTE_INIT_MEMBER(m63_state,m63) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < 256; i++) @@ -372,7 +372,7 @@ void m63_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) } } -UINT32 m63_state::screen_update_m63(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t m63_state::screen_update_m63(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int col; @@ -706,13 +706,13 @@ GFXDECODE_END SAMPLES_START_CB_MEMBER(m63_state::fghtbskt_sh_start) { int i, len = memregion("samples")->bytes(); - UINT8 *ROM = memregion("samples")->base(); + uint8_t *ROM = memregion("samples")->base(); - m_samplebuf = std::make_unique(len); + m_samplebuf = std::make_unique(len); save_pointer(NAME(m_samplebuf.get()), len); for(i = 0; i < len; i++) - m_samplebuf[i] = ((INT8)(ROM[i] ^ 0x80)) * 256; + m_samplebuf[i] = ((int8_t)(ROM[i] ^ 0x80)) * 256; } INTERRUPT_GEN_MEMBER(m63_state::snd_irq) diff --git a/src/mame/drivers/m72.cpp b/src/mame/drivers/m72.cpp index 98cefc79b33..ce12bce08da 100644 --- a/src/mame/drivers/m72.cpp +++ b/src/mame/drivers/m72.cpp @@ -335,9 +335,9 @@ The protection device does TIMER_CALLBACK_MEMBER(m72_state::delayed_ram16_w) { - UINT16 val = ((UINT32) param) & 0xffff; - UINT16 offset = (((UINT32) param) >> 16) & 0xffff; - UINT16 *ram = (UINT16 *)ptr; + uint16_t val = ((uint32_t) param) & 0xffff; + uint16_t offset = (((uint32_t) param) >> 16) & 0xffff; + uint16_t *ram = (uint16_t *)ptr; ram[offset] = val; } @@ -357,7 +357,7 @@ WRITE16_MEMBER(m72_state::main_mcu_sound_w) WRITE16_MEMBER(m72_state::main_mcu_w) { - UINT16 val = m_protection_ram[offset]; + uint16_t val = m_protection_ram[offset]; COMBINE_DATA(&val); @@ -379,7 +379,7 @@ WRITE16_MEMBER(m72_state::main_mcu_w) WRITE8_MEMBER(m72_state::mcu_data_w) { - UINT16 val; + uint16_t val; if (offset&1) val = (m_protection_ram[offset/2] & 0x00ff) | (data << 8); else val = (m_protection_ram[offset/2] & 0xff00) | (data&0xff); @@ -388,7 +388,7 @@ WRITE8_MEMBER(m72_state::mcu_data_w) READ8_MEMBER(m72_state::mcu_data_r) { - UINT8 ret; + uint8_t ret; if (offset == 0x0fff || offset == 0x0ffe) { @@ -410,7 +410,7 @@ INTERRUPT_GEN_MEMBER(m72_state::mcu_int) READ8_MEMBER(m72_state::mcu_sample_r) { - UINT8 sample; + uint8_t sample; sample = memregion("samples")->base()[m_mcu_sample_addr++]; return sample; } @@ -467,7 +467,7 @@ DRIVER_INIT_MEMBER(m72_state,m72_8751) address_space &io = m_maincpu->space(AS_IO); address_space &sndio = m_soundcpu->space(AS_IO); - m_protection_ram = std::make_unique(0x10000/2); + m_protection_ram = std::make_unique(0x10000/2); program.install_read_bank(0xb0000, 0xbffff, "bank1"); program.install_write_handler(0xb0000, 0xb0fff, write16_delegate(FUNC(m72_state::main_mcu_w),this)); membank("bank1")->configure_entry(0, m_protection_ram.get()); @@ -492,7 +492,7 @@ DRIVER_INIT_MEMBER(m72_state,m72_8751) * prefetching on the V30. */ { - UINT8 *rom=memregion("mcu")->base(); + uint8_t *rom=memregion("mcu")->base(); rom[0x12d+5] += 1; printf(" 5: %d\n", rom[0x12d+5]); rom[0x12d+8] += 5; printf(" 8: %d\n", rom[0x12d+8]); @@ -532,7 +532,7 @@ the NMI handler in the other games. #if 0 int m72_state::find_sample(int num) { - UINT8 *rom = memregion("samples")->base(); + uint8_t *rom = memregion("samples")->base(); int len = memregion("samples")->bytes(); int addr = 0; @@ -655,7 +655,7 @@ running, but they have not been derived from the real 8751 code. #define CRC_LEN 18 /* Battle Chopper / Mr. Heli */ -static const UINT8 bchopper_code[CODE_LEN] = +static const uint8_t bchopper_code[CODE_LEN] = { 0x68,0x00,0xa0, // push 0a000h 0x1f, // pop ds @@ -675,11 +675,11 @@ static const UINT8 bchopper_code[CODE_LEN] = 0x1f, // pop ds 0xea,0x68,0x01,0x40,0x00 // jmp 0040:$0168 }; -static const UINT8 bchopper_crc[CRC_LEN] = { 0x1a,0x12,0x5c,0x08, 0x84,0xb6,0x73,0xd1, +static const uint8_t bchopper_crc[CRC_LEN] = { 0x1a,0x12,0x5c,0x08, 0x84,0xb6,0x73,0xd1, 0x54,0x91,0x94,0xeb, 0x00,0x00 }; /* Ninja Spirit */ -static const UINT8 nspirit_code[CODE_LEN] = +static const uint8_t nspirit_code[CODE_LEN] = { 0x68,0x00,0xa0, // push 0a000h 0x1f, // pop ds @@ -698,10 +698,10 @@ static const UINT8 nspirit_code[CODE_LEN] = 0x1f, // pop ds 0xea,0x00,0x00,0x40,0x00 // jmp 0040:$0000 }; -static const UINT8 nspirit_crc[CRC_LEN] = { 0xfe,0x94,0x6e,0x4e, 0xc8,0x33,0xa7,0x2d, +static const uint8_t nspirit_crc[CRC_LEN] = { 0xfe,0x94,0x6e,0x4e, 0xc8,0x33,0xa7,0x2d, 0xf2,0xa3,0xf9,0xe1, 0xa9,0x6c,0x02,0x95, 0x00,0x00 }; /* Image Fight */ -static const UINT8 imgfight_code[CODE_LEN] = +static const uint8_t imgfight_code[CODE_LEN] = { 0x68,0x00,0xa0, // push 0a000h 0x1f, // pop ds @@ -726,11 +726,11 @@ static const UINT8 imgfight_code[CODE_LEN] = }; // these are for the japan set where we have the mcu anyway... -static const UINT8 imgfightj_crc[CRC_LEN] = { 0x7e,0xcc,0xec,0x03, 0x04,0x33,0xb6,0xc5, +static const uint8_t imgfightj_crc[CRC_LEN] = { 0x7e,0xcc,0xec,0x03, 0x04,0x33,0xb6,0xc5, 0xbf,0x37,0x92,0x94, 0x00,0x00 }; /* Legend of Hero Tonma */ -static const UINT8 loht_code[CODE_LEN] = +static const uint8_t loht_code[CODE_LEN] = { 0x68,0x00,0xa0, // push 0a000h 0x1f, // pop ds @@ -748,21 +748,21 @@ static const UINT8 loht_code[CODE_LEN] = 0xea,0x5d,0x01,0x40,0x00 // jmp 0040:$015d }; -static const UINT8 loht_crc[CRC_LEN] = { 0x39,0x00,0x82,0xae, 0x2c,0x9d,0x4b,0x73, +static const uint8_t loht_crc[CRC_LEN] = { 0x39,0x00,0x82,0xae, 0x2c,0x9d,0x4b,0x73, 0xfb,0xac,0xd4,0x6d, 0x6d,0x5b,0x77,0xc0, 0x00,0x00 }; /* Dragon Breed */ -static const UINT8 dbreedm72_code[CODE_LEN] = +static const uint8_t dbreedm72_code[CODE_LEN] = { 0xea,0x6c,0x00,0x00,0x00 // jmp 0000:$006c }; -static const UINT8 dbreedm72_crc[CRC_LEN] = { 0xa4,0x96,0x5f,0xc0, 0xab,0x49,0x9f,0x19, +static const uint8_t dbreedm72_crc[CRC_LEN] = { 0xa4,0x96,0x5f,0xc0, 0xab,0x49,0x9f,0x19, 0x84,0xe6,0xd6,0xca, 0x00,0x00 }; /* Air Duel */ -static const UINT8 airduelm72_code[CODE_LEN] = +static const uint8_t airduelm72_code[CODE_LEN] = { 0x68,0x00,0xd0, // push 0d000h 0x1f, // pop ds @@ -772,20 +772,20 @@ static const UINT8 airduelm72_code[CODE_LEN] = 0xc6,0x06,0xc0,0x1c,0x57, // mov [1cc0h], byte 057h 0xea,0x69,0x0b,0x00,0x00 // jmp 0000:$0b69 }; -static const UINT8 airduelm72_crc[CRC_LEN] = { 0x72,0x9c,0xca,0x85, 0xc9,0x12,0xcc,0xea, +static const uint8_t airduelm72_crc[CRC_LEN] = { 0x72,0x9c,0xca,0x85, 0xc9,0x12,0xcc,0xea, 0x00,0x00 }; /* Daiku no Gensan */ -static const UINT8 dkgenm72_code[CODE_LEN] = +static const uint8_t dkgenm72_code[CODE_LEN] = { 0xea,0x3d,0x00,0x00,0x10 // jmp 1000:$003d }; -static const UINT8 dkgenm72_crc[CRC_LEN] = { 0xc8,0xb4,0xdc,0xf8, 0xd3,0xba,0x48,0xed, +static const uint8_t dkgenm72_crc[CRC_LEN] = { 0xc8,0xb4,0xdc,0xf8, 0xd3,0xba,0x48,0xed, 0x79,0x08,0x1c,0xb3, 0x00,0x00 }; -void m72_state::copy_le(UINT16 *dest, const UINT8 *src, UINT8 bytes) +void m72_state::copy_le(uint16_t *dest, const uint8_t *src, uint8_t bytes) { int i; @@ -810,9 +810,9 @@ WRITE16_MEMBER(m72_state::protection_w) copy_le(&m_protection_ram[0x0fe0],m_protection_crc,CRC_LEN); } -void m72_state::install_protection_handler(const UINT8 *code,const UINT8 *crc) +void m72_state::install_protection_handler(const uint8_t *code,const uint8_t *crc) { - m_protection_ram = std::make_unique(0x1000/2); + m_protection_ram = std::make_unique(0x1000/2); m_protection_code = code; m_protection_crc = crc; m_maincpu->space(AS_PROGRAM).install_read_bank(0xb0000, 0xb0fff, "bank1"); diff --git a/src/mame/drivers/m79152pc.cpp b/src/mame/drivers/m79152pc.cpp index 6cc765a5fd0..33793aee66b 100644 --- a/src/mame/drivers/m79152pc.cpp +++ b/src/mame/drivers/m79152pc.cpp @@ -22,12 +22,12 @@ public: m_p_attributes(*this, "p_attributes"), m_maincpu(*this, "maincpu") { } - UINT8 *m_p_chargen; - required_shared_ptr m_p_videoram; - required_shared_ptr m_p_attributes; + uint8_t *m_p_chargen; + required_shared_ptr m_p_videoram; + required_shared_ptr m_p_attributes; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_m79152pc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m79152pc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -58,17 +58,17 @@ void m79152pc_state::video_start() m_p_chargen = memregion("chargen")->base()+4; } -UINT32 m79152pc_state::screen_update_m79152pc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t m79152pc_state::screen_update_m79152pc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // Attributes are unknown so are not implemented - UINT8 y,ra,chr,gfx; //,attr; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; //,attr; + uint16_t sy=0,ma=0,x; for (y = 0; y < 25; y++) { for (ra = 0; ra < 12; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 80; x++) { diff --git a/src/mame/drivers/m79amb.cpp b/src/mame/drivers/m79amb.cpp index 0a3f791529e..89cdb4937cd 100644 --- a/src/mame/drivers/m79amb.cpp +++ b/src/mame/drivers/m79amb.cpp @@ -65,7 +65,7 @@ WRITE8_MEMBER(m79amb_state::ramtek_videoram_w) m_videoram[offset] = data & ~*m_mask; } -UINT32 m79amb_state::screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t m79amb_state::screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -73,7 +73,7 @@ UINT32 m79amb_state::screen_update_ramtek(screen_device &screen, bitmap_rgb32 &b { int i; - UINT8 data = m_videoram[offs]; + uint8_t data = m_videoram[offs]; int y = offs >> 5; int x = (offs & 0x1f) << 3; @@ -93,16 +93,16 @@ UINT32 m79amb_state::screen_update_ramtek(screen_device &screen, bitmap_rgb32 &b READ8_MEMBER(m79amb_state::gray5bit_controller0_r) { - UINT8 port_data = ioport("8004")->read(); - UINT8 gun_pos = ioport("GUN1")->read(); + uint8_t port_data = ioport("8004")->read(); + uint8_t gun_pos = ioport("GUN1")->read(); return (port_data & 0xe0) | m_lut_gun1[gun_pos]; } READ8_MEMBER(m79amb_state::gray5bit_controller1_r) { - UINT8 port_data = ioport("8005")->read(); - UINT8 gun_pos = ioport("GUN2")->read(); + uint8_t port_data = ioport("8005")->read(); + uint8_t gun_pos = ioport("GUN2")->read(); return (port_data & 0xe0) | m_lut_gun2[gun_pos]; } @@ -251,14 +251,14 @@ ROM_END 181.6, 199.9, 205.4, 211.9, 223.5, 232.4, 254.0, 254.0 */ -static const UINT8 lut_cross[0x20] = { +static const uint8_t lut_cross[0x20] = { 19, 20, 21, 23, 25, 27, 29, 37, 45, 53, 66, 82, 88, 95, 105, 111, 118, 130, 142, 149, 158, 165, 170, 177, 191, 203, 209, 218, 228, 243, 249, 255, }; -static const UINT8 lut_pos[0x20] = { +static const uint8_t lut_pos[0x20] = { 0x1f, 0x1e, 0x1c, 0x1d, 0x19, 0x18, 0x1a, 0x1b, 0x13, 0x12, 0x10, 0x11, 0x15, 0x14, 0x16, 0x17, 0x07, 0x06, 0x04, 0x05, 0x01, 0x00, 0x02, 0x03, @@ -268,7 +268,7 @@ static const UINT8 lut_pos[0x20] = { DRIVER_INIT_MEMBER(m79amb_state,m79amb) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i, j; /* PROM data is active low */ diff --git a/src/mame/drivers/m90.cpp b/src/mame/drivers/m90.cpp index 6658e5c0e53..b363d806a68 100644 --- a/src/mame/drivers/m90.cpp +++ b/src/mame/drivers/m90.cpp @@ -1212,7 +1212,7 @@ DRIVER_INIT_MEMBER(m90_state,quizf1) DRIVER_INIT_MEMBER(m90_state,bomblord) { - UINT16 *ROM = (UINT16 *)(memregion("maincpu")->base()); + uint16_t *ROM = (uint16_t *)(memregion("maincpu")->base()); for (int i = 0; i < 0x100000 / 2; i += 4) { diff --git a/src/mame/drivers/m92.cpp b/src/mame/drivers/m92.cpp index 4ed36a7899e..71cd8aca63d 100644 --- a/src/mame/drivers/m92.cpp +++ b/src/mame/drivers/m92.cpp @@ -290,14 +290,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(m92_state::m92_scanline_interrupt) READ16_MEMBER(m92_state::m92_eeprom_r) { - UINT8 *RAM = memregion("eeprom")->base(); + uint8_t *RAM = memregion("eeprom")->base(); // logerror("%05x: EEPROM RE %04x\n",space.device().safe_pc(),offset); return RAM[offset] | 0xff00; } WRITE16_MEMBER(m92_state::m92_eeprom_w) { - UINT8 *RAM = memregion("eeprom")->base(); + uint8_t *RAM = memregion("eeprom")->base(); // logerror("%05x: EEPROM WR %04x\n",space.device().safe_pc(),offset); if (ACCESSING_BITS_0_7) RAM[offset] = data; @@ -2240,7 +2240,7 @@ ROM_END DRIVER_INIT_MEMBER(m92_state,m92) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->set_base(&ROM[0xa0000]); @@ -2256,7 +2256,7 @@ DRIVER_INIT_MEMBER(m92_state,lethalth) /* has bankswitching */ DRIVER_INIT_MEMBER(m92_state,m92_bank) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000); m_maincpu->space(AS_IO).install_write_handler(0x20, 0x21, write16_delegate(FUNC(m92_state::m92_bankswitch_w),this)); @@ -2267,7 +2267,7 @@ DRIVER_INIT_MEMBER(m92_state,m92_bank) /* has bankswitching, has eeprom, needs sprite kludge */ DRIVER_INIT_MEMBER(m92_state,majtitl2) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x80000], 0x20000); m_maincpu->space(AS_IO).install_write_handler(0x20, 0x21, write16_delegate(FUNC(m92_state::m92_bankswitch_w),this)); @@ -2281,7 +2281,7 @@ DRIVER_INIT_MEMBER(m92_state,majtitl2) /* TODO: figure out actual address map and other differences from real Irem h/w */ DRIVER_INIT_MEMBER(m92_state,ppan) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->set_base(&ROM[0xa0000]); m_game_kludge = 0; diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp index 4b88606d1f9..32eee18f044 100644 --- a/src/mame/drivers/mac.cpp +++ b/src/mame/drivers/mac.cpp @@ -215,7 +215,7 @@ WRITE8_MEMBER( mac_state::mac_sonora_vctl_w ) void mac_state::rbv_recalc_irqs() { // check slot interrupts and bubble them down to IFR - UINT8 slot_irqs = (~m_rbv_regs[2]) & 0x78; + uint8_t slot_irqs = (~m_rbv_regs[2]) & 0x78; slot_irqs &= (m_rbv_regs[0x12] & 0x78); if (slot_irqs) @@ -227,7 +227,7 @@ void mac_state::rbv_recalc_irqs() m_rbv_regs[3] &= ~2; // any slot } - UINT8 ifr = (m_rbv_regs[3] & m_rbv_ier) & 0x1b; //m_rbv_regs[0x13]); + uint8_t ifr = (m_rbv_regs[3] & m_rbv_ier) & 0x1b; //m_rbv_regs[0x13]); // printf("ifr = %02x (reg3 %02x reg13 %02x)\n", ifr, m_rbv_regs[3], m_rbv_regs[0x13]); if (ifr != 0) @@ -502,7 +502,7 @@ WRITE8_MEMBER(mac_state::amic_dma_w) // HMC has one register: a 35-bit shift register which is accessed one bit at a time (see pmac6100 code at 4030383c which makes this obvious) READ8_MEMBER(mac_state::hmc_r) { - UINT8 rv = (UINT8)(m_hmc_shiftout&1); + uint8_t rv = (uint8_t)(m_hmc_shiftout&1); m_hmc_shiftout>>= 1; return rv; } @@ -516,7 +516,7 @@ WRITE8_MEMBER(mac_state::hmc_w) } else { - UINT64 temp = (data & 1) ? U64(0x400000000) : U64(0x0); + uint64_t temp = (data & 1) ? U64(0x400000000) : U64(0x0); m_hmc_reg >>= 1; m_hmc_reg |= temp; } @@ -569,15 +569,15 @@ WRITE8_MEMBER(mac_state::mac_5396_w) TIMER_DEVICE_CALLBACK_MEMBER(mac_state::mac_scanline) { int scanline = param; - UINT16 *mac_snd_buf_ptr; + uint16_t *mac_snd_buf_ptr; if (m_main_buffer) { - mac_snd_buf_ptr = (UINT16 *)(m_ram->pointer() + m_ram->size() - MAC_MAIN_SND_BUF_OFFSET); + mac_snd_buf_ptr = (uint16_t *)(m_ram->pointer() + m_ram->size() - MAC_MAIN_SND_BUF_OFFSET); } else { - mac_snd_buf_ptr = (UINT16 *)(m_ram->pointer() + m_ram->size() - MAC_ALT_SND_BUF_OFFSET); + mac_snd_buf_ptr = (uint16_t *)(m_ram->pointer() + m_ram->size() - MAC_ALT_SND_BUF_OFFSET); } m_dac->write(mac_snd_buf_ptr[scanline] >> 8); diff --git a/src/mame/drivers/macpci.cpp b/src/mame/drivers/macpci.cpp index 69b79d6f386..28e028f1e9f 100644 --- a/src/mame/drivers/macpci.cpp +++ b/src/mame/drivers/macpci.cpp @@ -53,7 +53,7 @@ READ64_MEMBER( macpci_state::unk1_r ) READ64_MEMBER( macpci_state::unk2_r ) { if (ACCESSING_BITS_32_47) - return (UINT64)0xe1 << 32; //PC=fff04810 + return (uint64_t)0xe1 << 32; //PC=fff04810 return 0; } @@ -82,7 +82,7 @@ static INPUT_PORTS_START( pippin ) INPUT_PORTS_END -UINT32 macpci_state::screen_update_pippin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t macpci_state::screen_update_pippin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/macrossp.cpp b/src/mame/drivers/macrossp.cpp index 06ac837ff20..c893b353d35 100644 --- a/src/mame/drivers/macrossp.cpp +++ b/src/mame/drivers/macrossp.cpp @@ -328,7 +328,7 @@ WRITE16_MEMBER(macrossp_state::palette_fade_w) if (data >> 8 != 0xff) { // range seems to be 40 (brightest) to 252 (darkest) - UINT8 fade = ((data >> 8) - 40) / 212.0 * 255.0; + uint8_t fade = ((data >> 8) - 40) / 212.0 * 255.0; m_screen->set_brightness(0xff - fade); } } diff --git a/src/mame/drivers/macs.cpp b/src/mame/drivers/macs.cpp index c544db1e075..d6bc3b094c1 100644 --- a/src/mame/drivers/macs.cpp +++ b/src/mame/drivers/macs.cpp @@ -75,11 +75,11 @@ public: m_cart2(*this, "slot_b") { } - UINT8 m_mux_data; - UINT8 m_rev; - UINT8 m_cart_bank; - std::unique_ptr m_ram1; - required_shared_ptr m_ram2; + uint8_t m_mux_data; + uint8_t m_rev; + uint8_t m_cart_bank; + std::unique_ptr m_ram1; + required_shared_ptr m_ram2; DECLARE_WRITE8_MEMBER(rambank_w); DECLARE_READ8_MEMBER(macs_input_r); DECLARE_WRITE8_MEMBER(macs_rom_bank_w); @@ -92,7 +92,7 @@ public: DECLARE_MACHINE_START(macs); ST0016_DMA_OFFS_CB(dma_offset); - UINT32 screen_update_macs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); optional_device m_maincpu; optional_device m_cart1; @@ -475,7 +475,7 @@ static INPUT_PORTS_START( macs_h ) INPUT_PORTS_END -UINT32 macs_state::screen_update_macs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t macs_state::screen_update_macs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return m_maincpu->update(screen,bitmap,cliprect); } @@ -629,7 +629,7 @@ ROM_START( yujan ) ROM_END #if 0 -static const UINT8 ramdata[160]= +static const uint8_t ramdata[160]= { 0xAF, 0xED, 0x47, 0xD3, 0xC1, 0xD3, 0x0C, 0xD3, 0xAF, 0xED, 0x47, 0xD3, 0xC1, 0xD3, 0x0C, 0xD3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -666,8 +666,8 @@ MACHINE_START_MEMBER(macs_state,macs) MACHINE_RESET_MEMBER(macs_state,macs) { #if 0 - UINT8 *macs_ram1 = m_ram1.get(); - UINT8 *macs_ram2 = m_ram2; + uint8_t *macs_ram1 = m_ram1.get(); + uint8_t *macs_ram2 = m_ram2; /* BIOS ram init: @@ -740,28 +740,28 @@ MACHINE_RESET_MEMBER(macs_state,macs) DRIVER_INIT_MEMBER(macs_state,macs) { - m_ram1=std::make_unique(0x20000); + m_ram1=std::make_unique(0x20000); m_maincpu->set_st0016_game_flag((10 | 0x80)); m_rev = 1; } DRIVER_INIT_MEMBER(macs_state,macs2) { - m_ram1=std::make_unique(0x20000); + m_ram1=std::make_unique(0x20000); m_maincpu->set_st0016_game_flag((10 | 0x80)); m_rev = 2; } DRIVER_INIT_MEMBER(macs_state,kisekaeh) { - m_ram1=std::make_unique(0x20000); + m_ram1=std::make_unique(0x20000); m_maincpu->set_st0016_game_flag((11 | 0x180)); m_rev = 1; } DRIVER_INIT_MEMBER(macs_state,kisekaem) { - m_ram1=std::make_unique(0x20000); + m_ram1=std::make_unique(0x20000); m_maincpu->set_st0016_game_flag((10 | 0x180)); m_rev = 1; } diff --git a/src/mame/drivers/madalien.cpp b/src/mame/drivers/madalien.cpp index a258629b02b..15f9f3cdc87 100644 --- a/src/mame/drivers/madalien.cpp +++ b/src/mame/drivers/madalien.cpp @@ -25,9 +25,9 @@ INPUT_CHANGED_MEMBER(madalien_state::coin_inserted) } -inline UINT8 madalien_state::shift_common(UINT8 hi, UINT8 lo) +inline uint8_t madalien_state::shift_common(uint8_t hi, uint8_t lo) { - const UINT8 *table = memregion("user2")->base(); + const uint8_t *table = memregion("user2")->base(); return table[((hi & 0x07) << 8) | lo]; } @@ -39,10 +39,10 @@ READ8_MEMBER(madalien_state::shift_r) READ8_MEMBER(madalien_state::shift_rev_r) { - UINT8 hi = *m_shift_hi ^ 0x07; - UINT8 lo = BITSWAP8(*m_shift_lo,0,1,2,3,4,5,6,7); + uint8_t hi = *m_shift_hi ^ 0x07; + uint8_t lo = BITSWAP8(*m_shift_lo,0,1,2,3,4,5,6,7); - UINT8 ret = shift_common(hi, lo); + uint8_t ret = shift_common(hi, lo); return BITSWAP8(ret,7,0,1,2,3,4,5,6) & 0x7f; } diff --git a/src/mame/drivers/madmotor.cpp b/src/mame/drivers/madmotor.cpp index 74b4215cd40..12e134e15c5 100644 --- a/src/mame/drivers/madmotor.cpp +++ b/src/mame/drivers/madmotor.cpp @@ -338,7 +338,7 @@ ROM_END DRIVER_INIT_MEMBER(madmotor_state,madmotor) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; for (i = 0x00000;i < 0x80000;i++) diff --git a/src/mame/drivers/magic10.cpp b/src/mame/drivers/magic10.cpp index 00d2957e6a7..08612642b5d 100644 --- a/src/mame/drivers/magic10.cpp +++ b/src/mame/drivers/magic10.cpp @@ -119,12 +119,12 @@ public: tilemap_t *m_layer0_tilemap; tilemap_t *m_layer1_tilemap; tilemap_t *m_layer2_tilemap; - required_shared_ptr m_layer0_videoram; - required_shared_ptr m_layer1_videoram; - required_shared_ptr m_layer2_videoram; + required_shared_ptr m_layer0_videoram; + required_shared_ptr m_layer1_videoram; + required_shared_ptr m_layer2_videoram; int m_layer2_offset[2]; - required_shared_ptr m_vregs; - UINT16 m_magic102_ret; + required_shared_ptr m_vregs; + uint16_t m_magic102_ret; DECLARE_WRITE16_MEMBER(layer0_videoram_w); DECLARE_WRITE16_MEMBER(layer1_videoram_w); DECLARE_WRITE16_MEMBER(layer2_videoram_w); @@ -142,7 +142,7 @@ public: TILE_GET_INFO_MEMBER(get_layer1_tile_info); TILE_GET_INFO_MEMBER(get_layer2_tile_info); virtual void video_start() override; - UINT32 screen_update_magic10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_magic10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -205,7 +205,7 @@ void magic10_state::video_start() m_layer2_tilemap->set_transparent_pen(0); } -UINT32 magic10_state::screen_update_magic10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t magic10_state::screen_update_magic10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /*TODO: understand where this comes from. */ m_layer2_tilemap->set_scrollx(0, m_layer2_offset[0]); @@ -1477,7 +1477,7 @@ DRIVER_INIT_MEMBER(magic10_state, altaten) m_layer2_offset[1] = 16; // patching the boot protection... - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); rom[0x7668] = 0x71; rom[0x7669] = 0x4e; diff --git a/src/mame/drivers/magicard.cpp b/src/mame/drivers/magicard.cpp index dc84f9c659a..b6b868d8ade 100644 --- a/src/mame/drivers/magicard.cpp +++ b/src/mame/drivers/magicard.cpp @@ -191,17 +191,17 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_magicram; - required_shared_ptr m_magicramb; - required_shared_ptr m_pcab_vregs; - required_shared_ptr m_scc68070_ext_irqc_regs; - required_shared_ptr m_scc68070_iic_regs; - required_shared_ptr m_scc68070_uart_regs; - required_shared_ptr m_scc68070_timer_regs; - required_shared_ptr m_scc68070_int_irqc_regs; - required_shared_ptr m_scc68070_dma_ch1_regs; - required_shared_ptr m_scc68070_dma_ch2_regs; - required_shared_ptr m_scc68070_mmu_regs; + required_shared_ptr m_magicram; + required_shared_ptr m_magicramb; + required_shared_ptr m_pcab_vregs; + required_shared_ptr m_scc68070_ext_irqc_regs; + required_shared_ptr m_scc68070_iic_regs; + required_shared_ptr m_scc68070_uart_regs; + required_shared_ptr m_scc68070_timer_regs; + required_shared_ptr m_scc68070_int_irqc_regs; + required_shared_ptr m_scc68070_dma_ch1_regs; + required_shared_ptr m_scc68070_dma_ch2_regs; + required_shared_ptr m_scc68070_mmu_regs; DECLARE_READ16_MEMBER(test_r); DECLARE_READ16_MEMBER(philips_66470_r); DECLARE_WRITE16_MEMBER(philips_66470_w); @@ -224,7 +224,7 @@ public: DECLARE_DRIVER_INIT(magicard); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_magicard(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_magicard(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(magicard_irq); required_device m_maincpu; required_device m_screen; @@ -423,10 +423,10 @@ void magicard_state::video_start() { } -UINT32 magicard_state::screen_update_magicard(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t magicard_state::screen_update_magicard(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x, y; - UINT32 count; + uint32_t count; bitmap.fill(m_palette->black_pen(), cliprect); //TODO @@ -441,7 +441,7 @@ UINT32 magicard_state::screen_update_magicard(screen_device &screen, bitmap_rgb3 { for(x = 0; x < 84; x++) { - UINT32 color; + uint32_t color; color = ((m_magicram[count]) & 0x000f) >> 0; @@ -473,7 +473,7 @@ UINT32 magicard_state::screen_update_magicard(screen_device &screen, bitmap_rgb3 { for(x = 0; x < 168; x++) { - UINT32 color; + uint32_t color; color = ((m_magicram[count]) & 0x00ff) >> 0; @@ -509,7 +509,7 @@ READ16_MEMBER(magicard_state::philips_66470_r) { case 0/2: { - UINT8 vdisp; + uint8_t vdisp; vdisp = m_screen->vpos() < 256; return (m_pcab_vregs[offset] & 0xff7f) | vdisp << 7; //TODO @@ -716,8 +716,8 @@ INPUT_PORTS_END void magicard_state::machine_reset() { - UINT16 *src = (UINT16*)memregion("maincpu" )->base(); - UINT16 *dst = m_magicram; + uint16_t *src = (uint16_t*)memregion("maincpu" )->base(); + uint16_t *dst = m_magicram; memcpy (dst, src, 0x80000); memcpy (dst + 0x40000 * 1, src, 0x80000); memcpy (dst + 0x40000 * 2, src, 0x80000); diff --git a/src/mame/drivers/magicfly.cpp b/src/mame/drivers/magicfly.cpp index 479574b3d90..cd2c3759866 100644 --- a/src/mame/drivers/magicfly.cpp +++ b/src/mame/drivers/magicfly.cpp @@ -462,8 +462,8 @@ public: m_dac(*this, "dac"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; int m_input_selector; DECLARE_WRITE8_MEMBER(magicfly_videoram_w); @@ -476,7 +476,7 @@ public: DECLARE_PALETTE_INIT(magicfly); DECLARE_PALETTE_INIT(bchance); DECLARE_VIDEO_START(7mezzo); - UINT32 screen_update_magicfly(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_magicfly(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_dac; required_device m_gfxdecode; @@ -563,7 +563,7 @@ VIDEO_START_MEMBER(magicfly_state, 7mezzo) } -UINT32 magicfly_state::screen_update_magicfly(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t magicfly_state::screen_update_magicfly(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/magictg.cpp b/src/mame/drivers/magictg.cpp index 4388cc4fb5a..58225283cd7 100644 --- a/src/mame/drivers/magictg.cpp +++ b/src/mame/drivers/magictg.cpp @@ -160,22 +160,22 @@ public: /* ASIC */ struct { - UINT32 src_addr; - UINT32 dst_addr; - UINT32 ctrl; - UINT32 count; + uint32_t src_addr; + uint32_t dst_addr; + uint32_t ctrl; + uint32_t count; } m_dma_ch[3]; /* ADSP-2181 */ - required_shared_ptr m_adsp_pram; + required_shared_ptr m_adsp_pram; struct { - UINT16 bdma_internal_addr; - UINT16 bdma_external_addr; - UINT16 bdma_control; - UINT16 bdma_word_count; + uint16_t bdma_internal_addr; + uint16_t bdma_external_addr; + uint16_t bdma_control; + uint16_t bdma_word_count; } m_adsp_regs; @@ -185,21 +185,21 @@ public: struct { /* PCI */ - UINT32 command; - UINT32 base_addr; + uint32_t command; + uint32_t base_addr; - UINT32 init_enable; + uint32_t init_enable; } m_voodoo_pci_regs[2]; struct { /* PCI */ - UINT32 command; - UINT32 base_addr; + uint32_t command; + uint32_t base_addr; /* Memory-mapped */ - UINT32 as_regs[19]; + uint32_t as_regs[19]; } m_zr36120; @@ -229,7 +229,7 @@ protected: virtual void machine_reset() override; virtual void video_start() override; public: - UINT32 screen_update_magictg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_magictg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -248,14 +248,14 @@ void magictg_state::machine_start() void magictg_state::machine_reset() { - UINT8 *adsp_boot = (UINT8*)memregion("adsp")->base(); + uint8_t *adsp_boot = (uint8_t*)memregion("adsp")->base(); zr36120_reset(); /* Load 32 program words (96 bytes) via BDMA */ for (int i = 0; i < 32; i ++) { - UINT32 word; + uint32_t word; word = adsp_boot[i*3 + 0] << 16; word |= adsp_boot[i*3 + 1] << 8; @@ -276,7 +276,7 @@ void magictg_state::video_start() { } -UINT32 magictg_state::screen_update_magictg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t magictg_state::screen_update_magictg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return m_voodoo[0]->voodoo_update(bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } @@ -288,21 +288,21 @@ UINT32 magictg_state::screen_update_magictg(screen_device &screen, bitmap_rgb32 * *************************************/ -static UINT32 pci_dev0_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t pci_dev0_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { osd_printf_debug("PCI[0] READ: %x\n", reg); return 0x00000000; // TODO } -static void pci_dev0_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void pci_dev0_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { } -static UINT32 voodoo_0_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t voodoo_0_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { magictg_state* state = device->machine().driver_data(); - UINT32 val = 0; + uint32_t val = 0; switch (reg) { @@ -321,7 +321,7 @@ static UINT32 voodoo_0_pci_r(device_t *busdevice, device_t *device, int function return val; } -static void voodoo_0_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void voodoo_0_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { magictg_state* state = device->machine().driver_data(); @@ -347,10 +347,10 @@ static void voodoo_0_pci_w(device_t *busdevice, device_t *device, int function, } #if defined(USE_TWO_3DFX) -static UINT32 voodoo_1_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t voodoo_1_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { magictg_state* state = space.machine().driver_data(); - UINT32 val = 0; + uint32_t val = 0; switch (reg) { @@ -369,7 +369,7 @@ static UINT32 voodoo_1_pci_r(device_t *busdevice, device_t *device, int function return val; } -static void voodoo_1_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void voodoo_1_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { magictg_state* state = space.machine().driver_data(); @@ -429,10 +429,10 @@ void magictg_state::zr36120_reset() m_zr36120.as_regs[0x48/4] = 1 << 23; } -static UINT32 zr36120_pci_r(device_t* busdevice, device_t* device, int function, int reg, UINT32 mem_mask) +static uint32_t zr36120_pci_r(device_t* busdevice, device_t* device, int function, int reg, uint32_t mem_mask) { magictg_state* state = busdevice->machine().driver_data(); - UINT32 val = 0; + uint32_t val = 0; switch (reg) { @@ -454,7 +454,7 @@ static UINT32 zr36120_pci_r(device_t* busdevice, device_t* device, int function, return val; } -static void zr36120_pci_w(device_t* busdevice, device_t* device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void zr36120_pci_w(device_t* busdevice, device_t* device, int function, int reg, uint32_t data, uint32_t mem_mask) { magictg_state* state = busdevice->machine().driver_data(); @@ -473,7 +473,7 @@ static void zr36120_pci_w(device_t* busdevice, device_t* device, int function, i READ32_MEMBER( magictg_state::zr36120_r ) { - UINT32 res = 0; + uint32_t res = 0; offset <<= 2; @@ -515,9 +515,9 @@ WRITE32_MEMBER( magictg_state::zr36120_w ) } else { - UINT32 guest = (data >> 20) & 3; - UINT32 g_data = data & 0xff; - UINT32 g_reg = (data >> 16) & 7; + uint32_t guest = (data >> 20) & 3; + uint32_t g_data = data & 0xff; + uint32_t g_reg = (data >> 16) & 7; /* Direction - 0 for read, 1 for write */ // zr36120_guest_write(guest, g_data, g_reg); @@ -597,8 +597,8 @@ WRITE32_MEMBER( magictg_state::f0_w ) if (data & 0x1000) { - UINT32 src_addr = m_dma_ch[ch].src_addr; - UINT32 dst_addr = m_dma_ch[ch].dst_addr; + uint32_t src_addr = m_dma_ch[ch].src_addr; + uint32_t dst_addr = m_dma_ch[ch].dst_addr; //device_t *voodoo = dst_addr > 0xa000000 voodoo0 : voodoo1; assert((src_addr & 3) == 0); @@ -606,7 +606,7 @@ WRITE32_MEMBER( magictg_state::f0_w ) while (m_dma_ch[ch].count > 3) { - UINT32 src_dword = flipendian_int32(space.read_dword(src_addr)); + uint32_t src_dword = flipendian_int32(space.read_dword(src_addr)); space.write_dword(dst_addr, src_dword); src_addr += 4; dst_addr += 4; @@ -616,9 +616,9 @@ WRITE32_MEMBER( magictg_state::f0_w ) // FIXME! if (m_dma_ch[ch].count & 3) { - UINT32 src_dword = flipendian_int32(space.read_dword(src_addr)); - UINT32 dst_dword = space.read_dword(dst_addr); - UINT32 mask = 0xffffffff >> ((m_dma_ch[ch].count & 3) << 3); + uint32_t src_dword = flipendian_int32(space.read_dword(src_addr)); + uint32_t dst_dword = space.read_dword(dst_addr); + uint32_t mask = 0xffffffff >> ((m_dma_ch[ch].count & 3) << 3); dst_dword = (dst_dword & ~mask) | (src_dword & mask); space.write_dword(dst_addr, dst_dword); @@ -646,7 +646,7 @@ WRITE32_MEMBER( magictg_state::f0_w ) READ32_MEMBER( magictg_state::f0_r ) { int ch; - UINT32 val = 0; + uint32_t val = 0; offset *= 4; ch = ((offset >> 2) & 3) - 1; @@ -731,7 +731,7 @@ READ32_MEMBER( magictg_state::adsp_status_r ) READ16_MEMBER( magictg_state::adsp_control_r ) { - UINT16 res = 0; + uint16_t res = 0; switch (offset) { @@ -766,13 +766,13 @@ WRITE16_MEMBER( magictg_state::adsp_control_w ) if (data > 0) { - UINT8* adsp_rom = (UINT8*)memregion("adsp")->base(); + uint8_t* adsp_rom = (uint8_t*)memregion("adsp")->base(); - UINT32 page = (m_adsp_regs.bdma_control >> 8) & 0xff; - UINT32 dir = (m_adsp_regs.bdma_control >> 2) & 1; - UINT32 type = m_adsp_regs.bdma_control & 3; + uint32_t page = (m_adsp_regs.bdma_control >> 8) & 0xff; + uint32_t dir = (m_adsp_regs.bdma_control >> 2) & 1; + uint32_t type = m_adsp_regs.bdma_control & 3; - UINT32 src_addr = (page << 14) | m_adsp_regs.bdma_external_addr; + uint32_t src_addr = (page << 14) | m_adsp_regs.bdma_external_addr; address_space &addr_space = m_adsp->space((type == 0) ? AS_PROGRAM : AS_DATA); @@ -782,7 +782,7 @@ WRITE16_MEMBER( magictg_state::adsp_control_w ) { if (type == 0) { - UINT32 src_word =(adsp_rom[src_addr + 0] << 16) | + uint32_t src_word =(adsp_rom[src_addr + 0] << 16) | (adsp_rom[src_addr + 1] << 8) | (adsp_rom[src_addr + 2]); @@ -793,7 +793,7 @@ WRITE16_MEMBER( magictg_state::adsp_control_w ) } else if (type == 1) { - UINT32 src_word =(adsp_rom[src_addr + 0] << 8) | adsp_rom[src_addr + 1]; + uint32_t src_word =(adsp_rom[src_addr + 0] << 8) | adsp_rom[src_addr + 1]; addr_space.write_dword(m_adsp_regs.bdma_internal_addr * 2, src_word); diff --git a/src/mame/drivers/majorpkr.cpp b/src/mame/drivers/majorpkr.cpp index 7c4458cdac7..8930ad58fd4 100644 --- a/src/mame/drivers/majorpkr.cpp +++ b/src/mame/drivers/majorpkr.cpp @@ -480,8 +480,8 @@ public: required_device m_vram_bank; required_memory_bank m_rom_bank; - required_shared_ptr m_fg_vram; - required_shared_ptr m_bg_vram; + required_shared_ptr m_fg_vram; + required_shared_ptr m_bg_vram; tilemap_t *m_bg_tilemap, *m_fg_tilemap; @@ -504,7 +504,7 @@ public: TILE_GET_INFO_MEMBER(bg_get_tile_info); TILE_GET_INFO_MEMBER(fg_get_tile_info); virtual void video_start() override; - UINT32 screen_update_majorpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_majorpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -541,7 +541,7 @@ void majorpkr_state::video_start() } -UINT32 majorpkr_state::screen_update_majorpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t majorpkr_state::screen_update_majorpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0); @@ -1168,7 +1168,7 @@ ROM_END DRIVER_INIT_MEMBER(majorpkr_state, majorpkr) { - UINT8 * ROM = (UINT8 *)memregion("maincpu")->base(); + uint8_t * ROM = (uint8_t *)memregion("maincpu")->base(); m_rom_bank->configure_entries(0, 4, &ROM[0xe000], 0x800); } diff --git a/src/mame/drivers/mappy.cpp b/src/mame/drivers/mappy.cpp index 92c8cc959c8..090a46a8d81 100644 --- a/src/mame/drivers/mappy.cpp +++ b/src/mame/drivers/mappy.cpp @@ -577,7 +577,7 @@ TODO: /***************************************************************************/ -void mappy_state::common_latch_w(UINT32 offset) +void mappy_state::common_latch_w(uint32_t offset) { int bit = offset & 1; diff --git a/src/mame/drivers/marywu.cpp b/src/mame/drivers/marywu.cpp index 445127d7a2f..eff149e83f6 100644 --- a/src/mame/drivers/marywu.cpp +++ b/src/mame/drivers/marywu.cpp @@ -158,7 +158,7 @@ READ8_MEMBER( marywu_state::keyboard_r ) WRITE8_MEMBER( marywu_state::display_7seg_data_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // HEF4511BP (7 seg display driver) + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // HEF4511BP (7 seg display driver) output().set_digit_value(2 * m_selected_7seg_module + 0, patterns[data & 0x0F]); output().set_digit_value(2 * m_selected_7seg_module + 1, patterns[(data >> 4) & 0x0F]); diff --git a/src/mame/drivers/mastboy.cpp b/src/mame/drivers/mastboy.cpp index 5687defd7b2..cf7241a0745 100644 --- a/src/mame/drivers/mastboy.cpp +++ b/src/mame/drivers/mastboy.cpp @@ -461,13 +461,13 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_nvram; - required_shared_ptr m_workram; - required_shared_ptr m_tileram; - required_shared_ptr m_colram; + required_shared_ptr m_nvram; + required_shared_ptr m_workram; + required_shared_ptr m_tileram; + required_shared_ptr m_colram; - UINT8* m_vram; - UINT8 m_bank; + uint8_t* m_vram; + uint8_t m_bank; int m_irq0_ack; int m_backupram_enabled; int m_m5205_next; @@ -494,7 +494,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); INTERRUPT_GEN_MEMBER(interrupt); }; @@ -509,7 +509,7 @@ void mastboy_state::video_start() save_pointer(NAME(m_vram), 0x10000); } -UINT32 mastboy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mastboy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y,x,i; int count = 0x000; @@ -565,7 +565,7 @@ READ8_MEMBER(mastboy_state::banked_ram_r) if (bank>0x3) // ROM access { - UINT8 *src = memregion( "gfx1" )->base(); + uint8_t *src = memregion( "gfx1" )->base(); bank &=0x3; return src[offset+(bank*0x4000)]; } @@ -578,7 +578,7 @@ READ8_MEMBER(mastboy_state::banked_ram_r) } else { - UINT8 *src; + uint8_t *src; int bank; bank = m_bank & 0x7f; src = memregion ( "user1" )->base() + bank * 0x4000; diff --git a/src/mame/drivers/maxaflex.cpp b/src/mame/drivers/maxaflex.cpp index d50793e9377..ddb92c068da 100644 --- a/src/mame/drivers/maxaflex.cpp +++ b/src/mame/drivers/maxaflex.cpp @@ -39,19 +39,19 @@ public: m_joy23(*this, "djoy_2_3") { } - UINT8 m_portA_in; - UINT8 m_portA_out; - UINT8 m_ddrA; - UINT8 m_portB_in; - UINT8 m_portB_out; - UINT8 m_ddrB; - UINT8 m_portC_in; - UINT8 m_portC_out; - UINT8 m_ddrC; - UINT8 m_tdr; - UINT8 m_tcr; + uint8_t m_portA_in; + uint8_t m_portA_out; + uint8_t m_ddrA; + uint8_t m_portB_in; + uint8_t m_portB_out; + uint8_t m_ddrB; + uint8_t m_portC_in; + uint8_t m_portC_out; + uint8_t m_ddrC; + uint8_t m_tdr; + uint8_t m_tcr; timer_device *m_mcu_timer; - void mmu(UINT8 new_mmu); + void mmu(uint8_t new_mmu); DECLARE_READ8_MEMBER(mcu_portA_r); DECLARE_WRITE8_MEMBER(mcu_portA_w); DECLARE_READ8_MEMBER(mcu_portB_r); @@ -78,7 +78,7 @@ public: //required_device m_maincpu; // maincpu is already contained in atari_common_state required_device m_mcu; required_device m_speaker; - required_region_ptr m_region_maincpu; + required_region_ptr m_region_maincpu; required_ioport m_dsw; required_ioport m_coin; required_ioport m_console; @@ -87,7 +87,7 @@ public: }; -void maxaflex_state::mmu(UINT8 new_mmu) +void maxaflex_state::mmu(uint8_t new_mmu) { /* check if self-test ROM changed */ if (new_mmu & 0x80) @@ -148,7 +148,7 @@ READ8_MEMBER(maxaflex_state::mcu_portB_r) WRITE8_MEMBER(maxaflex_state::mcu_portB_w) { - UINT8 diff = data ^ m_portB_out; + uint8_t diff = data ^ m_portB_out; m_portB_out = data; /* clear coin interrupt */ @@ -186,7 +186,7 @@ READ8_MEMBER(maxaflex_state::mcu_portC_r) WRITE8_MEMBER(maxaflex_state::mcu_portC_w) { /* uses a 7447A, which is equivalent to an LS47/48 */ - static const UINT8 ls48_map[16] = + static const uint8_t ls48_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; m_portC_out = data & 0x0f; diff --git a/src/mame/drivers/maygay1b.cpp b/src/mame/drivers/maygay1b.cpp index 5659cfe42b5..d2cbb15e55d 100644 --- a/src/mame/drivers/maygay1b.cpp +++ b/src/mame/drivers/maygay1b.cpp @@ -737,7 +737,7 @@ WRITE8_MEMBER(maygay1b_state::mcu_port3_w) READ8_MEMBER(maygay1b_state::mcu_port0_r) { - UINT8 ret = m_lamp_strobe; + uint8_t ret = m_lamp_strobe; #ifdef USE_MCU // the MCU code checks to see if the input from this port is stable in // the main loop @@ -754,7 +754,7 @@ READ8_MEMBER(maygay1b_state::mcu_port2_r) // this is read in BOTH the external interrupts // it seems that both the writes from the main cpu go here // and the MCU knows which is is based on the interrupt level - UINT8 ret = m_main_to_mcu; + uint8_t ret = m_main_to_mcu; #ifdef USE_MCU logerror("%s: mcu_port2_r returning %02x\n", machine().describe_context(), ret); #endif @@ -862,20 +862,20 @@ WRITE8_MEMBER(maygay1b_state::m1ab_no_oki_w) DRIVER_INIT_MEMBER(maygay1b_state,m1common) { //Initialise paging for non-extended ROM space - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &rom[0x0e000], 0x10000); membank("bank1")->set_entry(0); // print out the rom id / header info to give us some hints // note this isn't always correct, alley cat has 'Calpsyo' still in the ident string? { - UINT8 *cpu = memregion( "maincpu" )->base(); + uint8_t *cpu = memregion( "maincpu" )->base(); int base = 0xff20; for (int i=0;i<14;i++) { for (int j=0;j<16;j++) { - UINT8 rom = cpu[base]; + uint8_t rom = cpu[base]; if ((rom>=0x20) && (rom<0x7f)) { diff --git a/src/mame/drivers/maygayep.cpp b/src/mame/drivers/maygayep.cpp index fa9c5568a3d..ac28c22b2c9 100644 --- a/src/mame/drivers/maygayep.cpp +++ b/src/mame/drivers/maygayep.cpp @@ -80,11 +80,11 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER(maygayep_state,maygayep) { - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); for (int i=0x100;i<0x210;i++) { - UINT8 val = src[i^1]; + uint8_t val = src[i^1]; if (i%0x40 == 0) printf("\n"); diff --git a/src/mame/drivers/maygayv1.cpp b/src/mame/drivers/maygayv1.cpp index 23a0f61d757..755714ea928 100644 --- a/src/mame/drivers/maygayv1.cpp +++ b/src/mame/drivers/maygayv1.cpp @@ -192,16 +192,16 @@ enum #define VCR0_DUTY_MASK 0xe000 #define VCR0_DUTY_SHIFT 13 -static const UINT32 banks[4] = { 0, 0x40000/2, 0x20000/2, 0x60000/2 }; +static const uint32_t banks[4] = { 0, 0x40000/2, 0x20000/2, 0x60000/2 }; #define DRAM_BANK_SEL (banks[(VREG(DSBA) >> 7) & 3]) struct i82716_t { - UINT16 r[16]; - std::unique_ptr dram; + uint16_t r[16]; + std::unique_ptr dram; - std::unique_ptr line_buf; // there's actually two + std::unique_ptr line_buf; // there's actually two }; @@ -225,8 +225,8 @@ public: int m_lamp_strobe; int m_old_lamp_strobe; int m_vsync_latch_preset; - UINT8 m_p1; - UINT8 m_p3; + uint8_t m_p1; + uint8_t m_p3; int m_d68681_val; i82716_t m_i82716; DECLARE_WRITE16_MEMBER(i82716_w); @@ -245,7 +245,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_maygayv1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_maygayv1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_maygayv1(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(vsync_interrupt); DECLARE_WRITE8_MEMBER(data_from_i8031); @@ -303,11 +303,11 @@ void maygayv1_state::video_start() } -UINT32 maygayv1_state::screen_update_maygayv1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t maygayv1_state::screen_update_maygayv1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { i82716_t &i82716 = m_i82716; - UINT16 *atable = &i82716.dram[VREG(ATBA)]; - UINT16 *otable = &i82716.dram[VREG(ODTBA) & 0xfc00]; // both must be bank 0 + uint16_t *atable = &i82716.dram[VREG(ATBA)]; + uint16_t *otable = &i82716.dram[VREG(ODTBA) & 0xfc00]; // both must be bank 0 int sl, sx; int slmask = 0xffff; // TODO: Save if using scanline callbacks @@ -327,10 +327,10 @@ UINT32 maygayv1_state::screen_update_maygayv1(screen_device &screen, bitmap_ind1 for (sl = cliprect.min_x; sl <= cliprect.max_y; ++sl) { int obj; - UINT16 aflags = atable[sl]; - UINT16 slmask_old = slmask; + uint16_t aflags = atable[sl]; + uint16_t slmask_old = slmask; - UINT16 *bmp_ptr = &bitmap.pix16(sl); + uint16_t *bmp_ptr = &bitmap.pix16(sl); slmask = 0xffff ^ (slmask ^ aflags); @@ -346,11 +346,11 @@ UINT32 maygayv1_state::screen_update_maygayv1(screen_device &screen, bitmap_ind1 // Draw on this line? if ( !BIT(slmask, obj) ) { - UINT32 objbase, trans, width; - INT32 x, xpos; - UINT16 w0, w1, w2; - UINT16 *objptr; - UINT8 *bmpptr; // ? + uint32_t objbase, trans, width; + int32_t x, xpos; + uint16_t w0, w1, w2; + uint16_t *objptr; + uint8_t *bmpptr; // ? /* Get object table entry words */ w0 = otable[offs]; @@ -396,15 +396,15 @@ UINT32 maygayv1_state::screen_update_maygayv1(screen_device &screen, bitmap_ind1 objptr = &i82716.dram[objbase + ((4 * width) * otable[offs + 3])]; // endian alert - bmpptr = (UINT8*)objptr; + bmpptr = (uint8_t*)objptr; // 4bpp for (x = xpos; x < std::min(xbound, int(xpos + width * 8)); ++x) { if (x >= 0) { - UINT8 p1 = *bmpptr & 0xf; - UINT8 p2 = *bmpptr >> 4; + uint8_t p1 = *bmpptr & 0xf; + uint8_t p2 = *bmpptr >> 4; if (!trans || p1) i82716.line_buf[x] = p1; @@ -423,7 +423,7 @@ UINT32 maygayv1_state::screen_update_maygayv1(screen_device &screen, bitmap_ind1 // Write it out for (sx = cliprect.min_x; sx < cliprect.max_x; sx += 2) { - UINT8 pix = i82716.line_buf[sx / 2]; + uint8_t pix = i82716.line_buf[sx / 2]; bmp_ptr[sx + 0] = pix & 0xf; bmp_ptr[sx + 1] = pix >> 4; @@ -456,11 +456,11 @@ void maygayv1_state::screen_eof_maygayv1(screen_device &screen, bool state) if (!(VREG(VCR0) & VCR0_DEI)) { int i; - UINT16 *palbase = &i82716.dram[VREG(CTBA)]; + uint16_t *palbase = &i82716.dram[VREG(CTBA)]; for (i = 0; i < 16; ++i) { - UINT16 entry = *palbase++; + uint16_t entry = *palbase++; m_palette->set_pen_color(entry & 0xf, pal4bit(entry >> 12), pal4bit(entry >> 8), pal4bit(entry >> 4)); } } @@ -838,8 +838,8 @@ WRITE8_MEMBER(maygayv1_state::b_writ) void maygayv1_state::machine_start() { i82716_t &i82716 = m_i82716; - i82716.dram = std::make_unique(0x80000/2); // ??? - i82716.line_buf = std::make_unique(512); + i82716.dram = std::make_unique(0x80000/2); // ??? + i82716.line_buf = std::make_unique(512); save_pointer(NAME(i82716.dram.get()), 0x40000); } diff --git a/src/mame/drivers/mayumi.cpp b/src/mame/drivers/mayumi.cpp index 34a6e780911..898d2ddf5d5 100644 --- a/src/mame/drivers/mayumi.cpp +++ b/src/mame/drivers/mayumi.cpp @@ -28,9 +28,9 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_i8255; -// UINT8 * m_nvram; // this currently uses generic nvram handlers +// uint8_t * m_nvram; // this currently uses generic nvram handlers /* video-related */ tilemap_t *m_tilemap; @@ -38,7 +38,7 @@ public: /* misc */ int m_int_enable; int m_input_sel; - UINT8 key_matrix_r(UINT8 offset); + uint8_t key_matrix_r(uint8_t offset); DECLARE_WRITE8_MEMBER(mayumi_videoram_w); DECLARE_WRITE8_MEMBER(bank_sel_w); DECLARE_WRITE8_MEMBER(input_sel_w); @@ -48,7 +48,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mayumi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mayumi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mayumi_interrupt); required_device m_maincpu; required_device m_gfxdecode; @@ -80,7 +80,7 @@ WRITE8_MEMBER(mayumi_state::mayumi_videoram_w) m_tilemap->mark_tile_dirty(offset & 0x7ff); } -UINT32 mayumi_state::screen_update_mayumi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mayumi_state::screen_update_mayumi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -290,7 +290,7 @@ WRITE8_MEMBER(mayumi_state::input_sel_w) m_input_sel = data; } -UINT8 mayumi_state::key_matrix_r(UINT8 offset) +uint8_t mayumi_state::key_matrix_r(uint8_t offset) { int p, i, ret; static const char *const keynames[2][5] = @@ -351,7 +351,7 @@ GFXDECODE_END void mayumi_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x8000], 0x4000); membank("bank1")->set_entry(0); diff --git a/src/mame/drivers/mazerbla.cpp b/src/mame/drivers/mazerbla.cpp index c172f1ee6c9..305fac7235d 100644 --- a/src/mame/drivers/mazerbla.cpp +++ b/src/mame/drivers/mazerbla.cpp @@ -151,39 +151,39 @@ public: /* video-related */ bitmap_ind16 m_tmpbitmaps[4]; - UINT8 m_vcu_video_reg[4]; - UINT32 m_vcu_gfx_addr; - UINT32 m_vcu_gfx_param_addr; - - UINT8 m_bknd_col; - UINT8 m_port02_status; - UINT8 m_vbank; /* video page select signal, likely for double buffering ?*/ - UINT32 m_xpos; - UINT32 m_ypos; - UINT32 m_pix_xsize; - UINT32 m_pix_ysize; - UINT8 m_color1; - UINT8 m_color2; - UINT8 m_mode; - UINT8 m_plane; - UINT8 m_lookup_ram[0x100*4]; - UINT32 m_gfx_rom_bank; /* graphics ROMs are banked */ + uint8_t m_vcu_video_reg[4]; + uint32_t m_vcu_gfx_addr; + uint32_t m_vcu_gfx_param_addr; + + uint8_t m_bknd_col; + uint8_t m_port02_status; + uint8_t m_vbank; /* video page select signal, likely for double buffering ?*/ + uint32_t m_xpos; + uint32_t m_ypos; + uint32_t m_pix_xsize; + uint32_t m_pix_ysize; + uint8_t m_color1; + uint8_t m_color2; + uint8_t m_mode; + uint8_t m_plane; + uint8_t m_lookup_ram[0x100*4]; + uint32_t m_gfx_rom_bank; /* graphics ROMs are banked */ double m_weights_r[2]; double m_weights_g[3]; double m_weights_b[3]; /* misc */ - UINT8 m_game_id; /* hacks per game */ - UINT8 m_ls670_0[4]; - UINT8 m_ls670_1[4]; + uint8_t m_game_id; /* hacks per game */ + uint8_t m_ls670_0[4]; + uint8_t m_ls670_1[4]; - UINT8 m_zpu_int_vector; + uint8_t m_zpu_int_vector; - UINT8 m_bcd_7445; + uint8_t m_bcd_7445; - UINT8 m_vsb_ls273; - UINT8 m_soundlatch; + uint8_t m_vsb_ls273; + uint8_t m_soundlatch; #if 0 int m_dbg_info; @@ -219,7 +219,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(mazerbla); - UINT32 screen_update_mazerbla(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mazerbla(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(sound_interrupt); TIMER_CALLBACK_MEMBER(deferred_ls670_0_w); @@ -283,7 +283,7 @@ void mazerbla_state::video_start() } -UINT32 mazerbla_state::screen_update_mazerbla(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mazerbla_state::screen_update_mazerbla(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_vcu->screen_update(screen,bitmap,cliprect); return 0; @@ -379,11 +379,11 @@ READ8_MEMBER(mazerbla_state::vcu_set_cmd_param_r) READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r) { - UINT8 * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000; + uint8_t * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000; int offs; int x, y; int bits = 0; - UINT8 color_base = 0; + uint8_t color_base = 0; color_base = m_vcu_video_reg[1] << 4; @@ -448,9 +448,9 @@ READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r) { for (x = 0; x <= m_pix_xsize; x++) { - UINT8 pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; - UINT8 data = (pixeldata >> (6 - (bits & 7))) & 3; - UINT8 col = 0; + uint8_t pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; + uint8_t data = (pixeldata >> (6 - (bits & 7))) & 3; + uint8_t col = 0; switch(data) { @@ -491,8 +491,8 @@ READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r) { for (x = 0; x <= m_pix_xsize; x++) { - UINT8 pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; - UINT8 data = (pixeldata >> (7 - (bits & 7))) & 1; + uint8_t pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; + uint8_t data = (pixeldata >> (7 - (bits & 7))) & 1; /* color = 4 MSB = front PEN, 4 LSB = background PEN */ @@ -518,9 +518,9 @@ READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r) { for (x = 0; x <= m_pix_xsize; x++) { - UINT8 pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; - UINT8 data = (pixeldata >> (4 - (bits & 7))) & 15; - UINT8 col = 0; + uint8_t pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; + uint8_t data = (pixeldata >> (4 - (bits & 7))) & 15; + uint8_t col = 0; col = color_base | data; @@ -543,12 +543,12 @@ READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r) READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r) { - UINT8 * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000; + uint8_t * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000; int offs; int x, y; int bits = 0; - UINT8 color_base = 0; + uint8_t color_base = 0; /* @@ -604,9 +604,9 @@ READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r) { for (x = 0; x <= m_pix_xsize; x++) { - UINT8 pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; - UINT8 data = (pixeldata >> (6 - (bits & 7))) & 3; - UINT8 col = 0; + uint8_t pixeldata = rom[(offs + (bits >> 3)) % 0x2000]; + uint8_t data = (pixeldata >> (6 - (bits & 7))) & 3; + uint8_t col = 0; switch(data) { @@ -650,7 +650,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r) { for (x = 0; x < 16; x++) { - UINT8 colour = m_cfb_ram[offs + x + y * 16]; + uint8_t colour = m_cfb_ram[offs + x + y * 16]; /* red component */ bit1 = (colour >> 7) & 0x01; @@ -685,7 +685,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r) { for (x = 0; x < 16; x++) { - UINT8 dat = m_cfb_ram[offs + x + y * 16]; + uint8_t dat = m_cfb_ram[offs + x + y * 16]; m_lookup_ram[lookup_offs + x + y * 16] = dat; } } @@ -699,7 +699,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r) { for (x = 0; x < 16; x++) { - UINT8 dat = m_cfb_ram[offs + x + y * 16]; + uint8_t dat = m_cfb_ram[offs + x + y * 16]; m_lookup_ram[lookup_offs + x + y * 16] = dat; } } @@ -713,7 +713,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r) { for (x = 0; x < 16; x++) { - UINT8 dat = m_cfb_ram[offs + x + y * 16]; + uint8_t dat = m_cfb_ram[offs + x + y * 16]; m_lookup_ram[lookup_offs + x + y * 16] = dat; } } @@ -865,7 +865,7 @@ READ8_MEMBER(mazerbla_state::zpu_inputs_r) static const char *const strobenames[] = { "ZPU", "DSW0", "DSW1", "DSW2", "DSW3", "BUTTONS", "STICK0_X", "STICK0_Y", "STICK1_X", "STICK1_Y", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED" }; - UINT8 ret = 0; + uint8_t ret = 0; ret = ioport(strobenames[m_bcd_7445])->read(); @@ -1649,7 +1649,7 @@ DRIVER_INIT_MEMBER(mazerbla_state,mazerbla) DRIVER_INIT_MEMBER(mazerbla_state,greatgun) { - UINT8 *rom = memregion("sub2")->base(); + uint8_t *rom = memregion("sub2")->base(); m_game_id = GREATGUN; diff --git a/src/mame/drivers/mbc200.cpp b/src/mame/drivers/mbc200.cpp index 01c2dcc3ad4..8eb88009cf4 100644 --- a/src/mame/drivers/mbc200.cpp +++ b/src/mame/drivers/mbc200.cpp @@ -83,11 +83,11 @@ public: private: virtual void machine_start() override; virtual void machine_reset() override; - UINT8 m_comm_latch; - UINT8 m_term_data; + uint8_t m_comm_latch; + uint8_t m_term_data; required_device m_crtc; required_device m_ppi_m; - required_shared_ptr m_vram; + required_shared_ptr m_vram; required_device m_maincpu; required_device m_beep; required_device m_speaker; @@ -160,7 +160,7 @@ ADDRESS_MAP_END READ8_MEMBER(mbc200_state::p2_porta_r) { machine().scheduler().synchronize(); // force resync - UINT8 tmp = m_comm_latch; + uint8_t tmp = m_comm_latch; m_comm_latch = 0; m_ppi_m->pc6_w(0); // ppi_ack return tmp; @@ -181,7 +181,7 @@ INPUT_PORTS_END READ8_MEMBER( mbc200_state::keyboard_r ) { - UINT8 data = 0; + uint8_t data = 0; if (offset) { if (m_term_data) @@ -241,8 +241,8 @@ void mbc200_state::machine_start() void mbc200_state::machine_reset() { - UINT8* roms = memregion("roms")->base(); - UINT8* main = memregion("maincpu")->base(); + uint8_t* roms = memregion("roms")->base(); + uint8_t* main = memregion("maincpu")->base(); memcpy(main, roms, 0x1000); } @@ -253,9 +253,9 @@ SLOT_INTERFACE_END MC6845_UPDATE_ROW( mbc200_state::update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 gfx; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t gfx; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { diff --git a/src/mame/drivers/mc10.cpp b/src/mame/drivers/mc10.cpp index 1817a096725..71387f8cb1c 100644 --- a/src/mame/drivers/mc10.cpp +++ b/src/mame/drivers/mc10.cpp @@ -54,15 +54,15 @@ public: required_device m_cassette; required_device m_printer; - UINT8 *m_ram_base; - UINT32 m_ram_size; - UINT8 m_keyboard_strobe; - UINT8 m_port2; + uint8_t *m_ram_base; + uint32_t m_ram_size; + uint8_t m_keyboard_strobe; + uint8_t m_port2; // printer - UINT8 m_pr_buffer; - UINT8 m_pr_counter; - UINT8 m_pr_state; + uint8_t m_pr_buffer; + uint8_t m_pr_counter; + uint8_t m_pr_state; DECLARE_READ8_MEMBER( mc10_bfff_r ); DECLARE_WRITE8_MEMBER( mc10_bfff_w ); @@ -84,7 +84,7 @@ public: READ8_MEMBER( mc10_state::mc10_bfff_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; if (!BIT(m_keyboard_strobe, 0)) result &= ioport("pb0")->read(); if (!BIT(m_keyboard_strobe, 1)) result &= ioport("pb1")->read(); @@ -100,7 +100,7 @@ READ8_MEMBER( mc10_state::mc10_bfff_r ) READ8_MEMBER( mc10_state::alice90_bfff_r ) { - UINT8 result = 0xff; + uint8_t result = 0xff; if (!BIT(m_keyboard_strobe, 7)) result &= ioport("pb7")->read(); else @@ -160,7 +160,7 @@ WRITE8_MEMBER( mc10_state::mc10_port1_w ) READ8_MEMBER( mc10_state::mc10_port2_r ) { - UINT8 result = 0xeb; + uint8_t result = 0xeb; /* bit 1, keyboard line pa6 */ if (!BIT(m_keyboard_strobe, 0)) result &= ioport("pb0")->read() >> 5; @@ -225,7 +225,7 @@ READ8_MEMBER( mc10_state::mc6847_videoram_r ) TIMER_DEVICE_CALLBACK_MEMBER(mc10_state::alice32_scanline) { - m_ef9345->update_scanline((UINT16)param); + m_ef9345->update_scanline((uint16_t)param); } /*************************************************************************** diff --git a/src/mame/drivers/mc1000.cpp b/src/mame/drivers/mc1000.cpp index f805132534d..84810ed4cd9 100644 --- a/src/mame/drivers/mc1000.cpp +++ b/src/mame/drivers/mc1000.cpp @@ -70,8 +70,8 @@ public: required_device m_cassette; required_device m_ram; required_memory_region m_rom; - required_shared_ptr m_mc6845_video_ram; - required_shared_ptr m_mc6847_video_ram; + required_shared_ptr m_mc6845_video_ram; + required_shared_ptr m_mc6847_video_ram; required_ioport_array<8> m_y; required_ioport_array<2> m_joy; required_ioport m_modifiers; @@ -107,7 +107,7 @@ public: /* video state */ int m_hsync; int m_vsync; - UINT8 m_mc6847_attr; + uint8_t m_mc6847_attr; DECLARE_WRITE_LINE_MEMBER(write_centronics_busy); int m_centronics_busy; @@ -382,7 +382,7 @@ WRITE8_MEMBER( mc1000_state::keylatch_w ) READ8_MEMBER( mc1000_state::keydata_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(m_keylatch, 0)) { @@ -418,7 +418,7 @@ void mc1000_state::machine_start() address_space &program = m_maincpu->space(AS_PROGRAM); /* setup memory banking */ - UINT8 *rom = m_rom->base(); + uint8_t *rom = m_rom->base(); program.install_readwrite_bank(0x0000, 0x1fff, "bank1"); membank("bank1")->configure_entry(0, rom); diff --git a/src/mame/drivers/mc1502.cpp b/src/mame/drivers/mc1502.cpp index 2ad1fc20adc..409798cd3a2 100644 --- a/src/mame/drivers/mc1502.cpp +++ b/src/mame/drivers/mc1502.cpp @@ -40,7 +40,7 @@ TIMER_CALLBACK_MEMBER(mc1502_state::keyb_signal_callback) { - UINT8 key = 0; + uint8_t key = 0; key |= ioport("Y1")->read(); key |= ioport("Y2")->read(); @@ -114,7 +114,7 @@ READ8_MEMBER(mc1502_state::mc1502_ppi_portc_r) READ8_MEMBER(mc1502_state::mc1502_kppi_porta_r) { - UINT8 key = 0; + uint8_t key = 0; if (m_kbd.mask & 0x0001) { key |= ioport("Y1")->read(); } if (m_kbd.mask & 0x0002) { key |= ioport("Y2")->read(); } diff --git a/src/mame/drivers/mc80.cpp b/src/mame/drivers/mc80.cpp index a84fae0b6bb..987a598ca0c 100644 --- a/src/mame/drivers/mc80.cpp +++ b/src/mame/drivers/mc80.cpp @@ -140,7 +140,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(mc80_state::mc8020_kbd) { address_space &mem = m_maincpu->space(AS_PROGRAM); char kbdrow[6]; - UINT8 i; + uint8_t i; for (i = 1; i < 8; i++) { sprintf(kbdrow,"X%X", i); diff --git a/src/mame/drivers/mcatadv.cpp b/src/mame/drivers/mcatadv.cpp index a116b708976..594bdb960ad 100644 --- a/src/mame/drivers/mcatadv.cpp +++ b/src/mame/drivers/mcatadv.cpp @@ -415,7 +415,7 @@ GFXDECODE_END void mcatadv_state::machine_start() { - UINT8 *ROM = memregion("soundcpu")->base(); + uint8_t *ROM = memregion("soundcpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); membank("bank1")->set_entry(1); diff --git a/src/mame/drivers/mcb216.cpp b/src/mame/drivers/mcb216.cpp index 05aaf8960f8..86112783d16 100644 --- a/src/mame/drivers/mcb216.cpp +++ b/src/mame/drivers/mcb216.cpp @@ -55,7 +55,7 @@ public: DECLARE_MACHINE_RESET(cb308); private: - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; required_device m_terminal; }; @@ -87,7 +87,7 @@ INPUT_PORTS_END READ8_MEMBER( mcb216_state::keyin_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/mccpm.cpp b/src/mame/drivers/mccpm.cpp index c52f9d234cd..b008301b972 100644 --- a/src/mame/drivers/mccpm.cpp +++ b/src/mame/drivers/mccpm.cpp @@ -75,8 +75,8 @@ public: DECLARE_READ8_MEMBER(mccpm_f0_r); DECLARE_READ8_MEMBER(mccpm_f1_r); DECLARE_WRITE8_MEMBER(kbd_put); - required_shared_ptr m_p_ram; - UINT8 m_term_data; + required_shared_ptr m_p_ram; + uint8_t m_term_data; virtual void machine_reset() override; }; @@ -84,7 +84,7 @@ public: READ8_MEMBER( mccpm_state::mccpm_f0_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -115,7 +115,7 @@ INPUT_PORTS_END void mccpm_state::machine_reset() { - UINT8* bios = memregion("maincpu")->base(); + uint8_t* bios = memregion("maincpu")->base(); memcpy(m_p_ram, bios, 0x1000); } diff --git a/src/mame/drivers/mcr.cpp b/src/mame/drivers/mcr.cpp index 9f02ea9d8b6..08979187d02 100644 --- a/src/mame/drivers/mcr.cpp +++ b/src/mame/drivers/mcr.cpp @@ -292,11 +292,11 @@ #include "dpoker.lh" -static UINT8 input_mux; -static UINT8 last_op4; +static uint8_t input_mux; +static uint8_t last_op4; -static UINT8 dpoker_coin_status; -static UINT8 dpoker_output; +static uint8_t dpoker_coin_status; +static uint8_t dpoker_output; @@ -411,7 +411,7 @@ READ8_MEMBER(mcr_state::dpoker_ip0_r) // d3: Coin-out Down // d6: Coin-drop Hit // d7: Coin-drop Release - UINT8 p0 = ioport("ssio:IP0")->read(); + uint8_t p0 = ioport("ssio:IP0")->read(); p0 |= (dpoker_coin_status >> 1 & 1); p0 ^= (p0 << 1 & 0x80) | dpoker_coin_status; return p0; @@ -642,7 +642,7 @@ WRITE8_MEMBER(mcr_state::dotron_op4_w) READ8_MEMBER(mcr_state::nflfoot_ip2_r) { /* bit 7 = J3-2 on IPU board = TXDA on SIO */ - UINT8 val = m_sio_txda << 7; + uint8_t val = m_sio_txda << 7; if (space.device().safe_pc() != 0x107) logerror("%04X:ip2_r = %02X\n", space.device().safe_pc(), val); diff --git a/src/mame/drivers/mcr3.cpp b/src/mame/drivers/mcr3.cpp index 0dda83ab1b3..4f4efe6ef98 100644 --- a/src/mame/drivers/mcr3.cpp +++ b/src/mame/drivers/mcr3.cpp @@ -185,9 +185,9 @@ READ8_MEMBER(mcr3_state::maxrpm_ip1_r) READ8_MEMBER(mcr3_state::maxrpm_ip2_r) { /* this is a blatant hack, should really do a better implementation */ - static const UINT8 shift_bits[5] = { 0x00, 0x05, 0x06, 0x01, 0x02 }; - UINT8 start = ioport("MONO.IP0")->read(); - UINT8 shift = ioport("SHIFT")->read(); + static const uint8_t shift_bits[5] = { 0x00, 0x05, 0x06, 0x01, 0x02 }; + uint8_t start = ioport("MONO.IP0")->read(); + uint8_t shift = ioport("SHIFT")->read(); /* reset on a start */ if (!(start & 0x08)) @@ -349,7 +349,7 @@ WRITE8_MEMBER(mcr3_state::powerdrv_op6_w) READ8_MEMBER(mcr3_state::stargrds_ip0_r) { - UINT8 result = ioport("MONO.IP0")->read(); + uint8_t result = ioport("MONO.IP0")->read(); if (m_input_mux) result = (result & ~0x0a) | (ioport("MONO.IP0.ALT")->read() & 0x0a); return (result & ~0x10) | ((m_sounds_good->read(space, 0) << 4) & 0x10); @@ -1020,7 +1020,7 @@ INPUT_PORTS_END * *************************************/ -static const UINT32 spyhunt_charlayout_xoffset[64] = +static const uint32_t spyhunt_charlayout_xoffset[64] = { 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30, diff --git a/src/mame/drivers/mcr68.cpp b/src/mame/drivers/mcr68.cpp index 5b14fffa3ea..f81a0329026 100644 --- a/src/mame/drivers/mcr68.cpp +++ b/src/mame/drivers/mcr68.cpp @@ -191,7 +191,7 @@ WRITE16_MEMBER(mcr68_state::spyhunt2_control_w) * 1111 = right/down full */ -static const UINT8 translate49[7] = { 0x7, 0x3, 0x1, 0x0, 0xc, 0xe, 0xf }; +static const uint8_t translate49[7] = { 0x7, 0x3, 0x1, 0x0, 0xc, 0xe, 0xf }; READ16_MEMBER(mcr68_state::archrivl_port_1_r) { @@ -281,8 +281,8 @@ READ16_MEMBER(mcr68_state::pigskin_port_2_r) READ16_MEMBER(mcr68_state::trisport_port_1_r) { - int xaxis = (INT8)ioport("AN1")->read(); - int yaxis = (INT8)ioport("AN2")->read(); + int xaxis = (int8_t)ioport("AN1")->read(); + int yaxis = (int8_t)ioport("AN2")->read(); int result = ioport("IN1")->read(); result |= (xaxis & 0x3c) << 6; diff --git a/src/mame/drivers/meadows.cpp b/src/mame/drivers/meadows.cpp index ff2e5847de6..f3613b190f8 100644 --- a/src/mame/drivers/meadows.cpp +++ b/src/mame/drivers/meadows.cpp @@ -136,21 +136,21 @@ READ8_MEMBER(meadows_state::hsync_chain_r) { - UINT8 val = m_screen->hpos(); + uint8_t val = m_screen->hpos(); return BITSWAP8(val,0,1,2,3,4,5,6,7); } READ8_MEMBER(meadows_state::vsync_chain_hi_r) { - UINT8 val = m_screen->vpos(); + uint8_t val = m_screen->vpos(); return ((val >> 1) & 0x08) | ((val >> 3) & 0x04) | ((val >> 5) & 0x02) | (val >> 7); } READ8_MEMBER(meadows_state::vsync_chain_lo_r) { - UINT8 val = m_screen->vpos(); + uint8_t val = m_screen->vpos(); return val & 0x0f; } @@ -831,7 +831,7 @@ ROM_END /* A fake for the missing ball sprites #3 and #4 */ DRIVER_INIT_MEMBER(meadows_state,gypsyjug) { - static const UINT8 ball[16*2] = + static const uint8_t ball[16*2] = { 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, @@ -839,10 +839,10 @@ DRIVER_INIT_MEMBER(meadows_state,gypsyjug) 0x01,0x80, 0x03,0xc0, 0x03,0xc0, 0x01,0x80 }; int i; - UINT8 *gfx2 = memregion("gfx2")->base(); - UINT8 *gfx3 = memregion("gfx3")->base(); - UINT8 *gfx4 = memregion("gfx4")->base(); - UINT8 *gfx5 = memregion("gfx5")->base(); + uint8_t *gfx2 = memregion("gfx2")->base(); + uint8_t *gfx3 = memregion("gfx3")->base(); + uint8_t *gfx4 = memregion("gfx4")->base(); + uint8_t *gfx5 = memregion("gfx5")->base(); int len3 = memregion("gfx3")->bytes(); int len4 = memregion("gfx4")->bytes(); @@ -860,7 +860,7 @@ DRIVER_INIT_MEMBER(meadows_state,gypsyjug) DRIVER_INIT_MEMBER(meadows_state,minferno) { int i, length; - UINT8 *mem; + uint8_t *mem; /* create an inverted copy of the graphics data */ mem = memregion("gfx1")->base(); diff --git a/src/mame/drivers/mediagx.cpp b/src/mame/drivers/mediagx.cpp index df142524f37..2d4d90959b8 100644 --- a/src/mame/drivers/mediagx.cpp +++ b/src/mame/drivers/mediagx.cpp @@ -79,8 +79,8 @@ struct speedup_entry { - UINT32 offset; - UINT32 pc; + uint32_t offset; + uint32_t pc; }; class mediagx_state : public pcat_base_state @@ -100,53 +100,53 @@ public: { } required_device m_ide; - required_shared_ptr m_main_ram; - required_shared_ptr m_cga_ram; - required_shared_ptr m_bios_ram; - required_shared_ptr m_vram; + required_shared_ptr m_main_ram; + required_shared_ptr m_cga_ram; + required_shared_ptr m_bios_ram; + required_shared_ptr m_vram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - UINT8 m_pal[768]; + uint8_t m_pal[768]; optional_ioport_array<9> m_ports; // but parallel_pointer takes values 0 -> 23 - UINT32 m_disp_ctrl_reg[256/4]; + uint32_t m_disp_ctrl_reg[256/4]; int m_frame_width; int m_frame_height; - UINT32 m_memory_ctrl_reg[256/4]; + uint32_t m_memory_ctrl_reg[256/4]; int m_pal_index; - UINT32 m_biu_ctrl_reg[256/4]; + uint32_t m_biu_ctrl_reg[256/4]; - UINT8 m_mediagx_config_reg_sel; - UINT8 m_mediagx_config_regs[256]; + uint8_t m_mediagx_config_reg_sel; + uint8_t m_mediagx_config_regs[256]; - //UINT8 m_controls_data; - UINT8 m_parallel_pointer; - UINT8 m_parallel_latched; - UINT32 m_parport; + //uint8_t m_controls_data; + uint8_t m_parallel_pointer; + uint8_t m_parallel_latched; + uint32_t m_parport; //int m_control_num; //int m_control_num2; //int m_control_read; - UINT32 m_cx5510_regs[256/4]; + uint32_t m_cx5510_regs[256/4]; - std::unique_ptr m_dacl; - std::unique_ptr m_dacr; + std::unique_ptr m_dacl; + std::unique_ptr m_dacr; int m_dacl_ptr; int m_dacr_ptr; - UINT8 m_ad1847_regs[16]; - UINT32 m_ad1847_sample_counter; - UINT32 m_ad1847_sample_rate; + uint8_t m_ad1847_regs[16]; + uint32_t m_ad1847_sample_counter; + uint32_t m_ad1847_sample_rate; dmadac_sound_device *m_dmadac[2]; #if SPEEDUP_HACKS const speedup_entry *m_speedup_table; - UINT32 m_speedup_hits[12]; + uint32_t m_speedup_hits[12]; int m_speedup_count; #endif DECLARE_READ32_MEMBER(disp_ctrl_r); @@ -165,7 +165,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ32_MEMBER(speedup0_r); DECLARE_READ32_MEMBER(speedup1_r); DECLARE_READ32_MEMBER(speedup2_r); @@ -182,8 +182,8 @@ public: void draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y); void draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void ad1847_reg_write(int reg, UINT8 data); - inline UINT32 generic_speedup(address_space &space, int idx); + void ad1847_reg_write(int reg, uint8_t data); + inline uint32_t generic_speedup(address_space &space, int idx); void report_speedups(); void install_speedups(const speedup_entry *entries, int count); void init_mediagx(); @@ -242,7 +242,7 @@ void mediagx_state::video_start() void mediagx_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y) { int i,j; - const UINT8 *dp; + const uint8_t *dp; int index = 0; const pen_t *pens = &m_palette->pen(0); @@ -250,10 +250,10 @@ void mediagx_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, g for (j=y; j < y+8; j++) { - UINT32 *p = &bitmap.pix32(j); + uint32_t *p = &bitmap.pix32(j); for (i=x; i < x+8; i++) { - UINT8 pen = dp[index++]; + uint8_t pen = dp[index++]; if (pen) p[i] = pens[gfx->colorbase() + (att & 0xf)]; else @@ -294,13 +294,13 @@ void mediagx_state::draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &clip if (m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1) // 8-bit mode { - UINT8 *framebuf = (UINT8*)&m_vram[m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; - UINT8 *pal = m_pal; + uint8_t *framebuf = (uint8_t*)&m_vram[m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; + uint8_t *pal = m_pal; for (j=0; j < m_frame_height; j++) { - UINT32 *p = &bitmap.pix32(j); - UINT8 *si = &framebuf[j * line_delta]; + uint32_t *p = &bitmap.pix32(j); + uint8_t *si = &framebuf[j * line_delta]; for (i=0; i < m_frame_width; i++) { int c = *si++; @@ -314,18 +314,18 @@ void mediagx_state::draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &clip } else // 16-bit { - UINT16 *framebuf = (UINT16*)&m_vram[m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; + uint16_t *framebuf = (uint16_t*)&m_vram[m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; // RGB 5-6-5 mode if ((m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x2) == 0) { for (j=0; j < m_frame_height; j++) { - UINT32 *p = &bitmap.pix32(j); - UINT16 *si = &framebuf[j * (line_delta/2)]; + uint32_t *p = &bitmap.pix32(j); + uint16_t *si = &framebuf[j * (line_delta/2)]; for (i=0; i < m_frame_width; i++) { - UINT16 c = *si++; + uint16_t c = *si++; int r = ((c >> 11) & 0x1f) << 3; int g = ((c >> 5) & 0x3f) << 2; int b = (c & 0x1f) << 3; @@ -339,11 +339,11 @@ void mediagx_state::draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &clip { for (j=0; j < m_frame_height; j++) { - UINT32 *p = &bitmap.pix32(j); - UINT16 *si = &framebuf[j * (line_delta/2)]; + uint32_t *p = &bitmap.pix32(j); + uint16_t *si = &framebuf[j * (line_delta/2)]; for (i=0; i < m_frame_width; i++) { - UINT16 c = *si++; + uint16_t c = *si++; int r = ((c >> 10) & 0x1f) << 3; int g = ((c >> 5) & 0x1f) << 3; int b = (c & 0x1f) << 3; @@ -359,7 +359,7 @@ void mediagx_state::draw_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect) { int i, j; gfx_element *gfx = m_gfxdecode->gfx(0); - UINT32 *cga = m_cga_ram; + uint32_t *cga = m_cga_ram; int index = 0; for (j=0; j < 25; j++) @@ -378,7 +378,7 @@ void mediagx_state::draw_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect) } } -UINT32 mediagx_state::screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mediagx_state::screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); @@ -393,7 +393,7 @@ UINT32 mediagx_state::screen_update_mediagx(screen_device &screen, bitmap_rgb32 READ32_MEMBER(mediagx_state::disp_ctrl_r) { - UINT32 r = m_disp_ctrl_reg[offset]; + uint32_t r = m_disp_ctrl_reg[offset]; switch (offset) { @@ -489,7 +489,7 @@ WRITE32_MEMBER(mediagx_state::bios_ram_w) READ8_MEMBER(mediagx_state::io20_r) { - UINT8 r = 0; + uint8_t r = 0; // 0x22, 0x23, Cyrix configuration registers if (offset == 0x00) @@ -517,11 +517,11 @@ WRITE8_MEMBER(mediagx_state::io20_w) READ32_MEMBER(mediagx_state::parallel_port_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_8_15) { - UINT8 nibble = m_parallel_latched; + uint8_t nibble = m_parallel_latched; r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11); logerror("%08X:parallel_port_r()\n", space.device().safe_pc()); #if 0 @@ -630,7 +630,7 @@ WRITE32_MEMBER(mediagx_state::parallel_port_w) } } -static UINT32 cx5510_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t cx5510_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { mediagx_state *state = busdevice->machine().driver_data(); @@ -643,7 +643,7 @@ static UINT32 cx5510_pci_r(device_t *busdevice, device_t *device, int function, return state->m_cx5510_regs[reg/4]; } -static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { mediagx_state *state = busdevice->machine().driver_data(); @@ -665,7 +665,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(mediagx_state::sound_timer_callback) m_dacr_ptr = 0; } -void mediagx_state::ad1847_reg_write(int reg, UINT8 data) +void mediagx_state::ad1847_reg_write(int reg, uint8_t data) { static const int divide_factor[] = { 3072, 1536, 896, 768, 448, 384, 512, 2560 }; @@ -719,12 +719,12 @@ WRITE32_MEMBER(mediagx_state::ad1847_w) { if (ACCESSING_BITS_16_31) { - UINT16 ldata = (data >> 16) & 0xffff; + uint16_t ldata = (data >> 16) & 0xffff; m_dacl[m_dacl_ptr++] = ldata; } if (ACCESSING_BITS_0_15) { - UINT16 rdata = data & 0xffff; + uint16_t rdata = data & 0xffff; m_dacr[m_dacr_ptr++] = rdata; } @@ -846,13 +846,13 @@ INPUT_PORTS_END void mediagx_state::machine_start() { - m_dacl = std::make_unique(65536); - m_dacr = std::make_unique(65536); + m_dacl = std::make_unique(65536); + m_dacr = std::make_unique(65536); } void mediagx_state::machine_reset() { - UINT8 *rom = memregion("bios")->base(); + uint8_t *rom = memregion("bios")->base(); memcpy(m_bios_ram, rom, 0x40000); m_maincpu->reset(); @@ -917,7 +917,7 @@ void mediagx_state::init_mediagx() #if SPEEDUP_HACKS -UINT32 mediagx_state::generic_speedup(address_space &space, int idx) +uint32_t mediagx_state::generic_speedup(address_space &space, int idx) { if (space.device().safe_pc() == m_speedup_table[idx].pc) { diff --git a/src/mame/drivers/megadriv.cpp b/src/mame/drivers/megadriv.cpp index 53bf399171f..50f0203c989 100644 --- a/src/mame/drivers/megadriv.cpp +++ b/src/mame/drivers/megadriv.cpp @@ -25,10 +25,10 @@ READ8_MEMBER(md_cons_state::mess_md_io_read_data_port) { int portnum = offset; - UINT8 retdata; + uint8_t retdata; int controller; - UINT8 helper_6b = (m_megadrive_io_ctrl_regs[portnum] & 0x3f) | 0xc0; // bits 6 & 7 always come from megadrive_io_data_regs - UINT8 helper_3b = (m_megadrive_io_ctrl_regs[portnum] & 0x7f) | 0x80; // bit 7 always comes from megadrive_io_data_regs + uint8_t helper_6b = (m_megadrive_io_ctrl_regs[portnum] & 0x3f) | 0xc0; // bits 6 & 7 always come from megadrive_io_data_regs + uint8_t helper_3b = (m_megadrive_io_ctrl_regs[portnum] & 0x7f) | 0x80; // bit 7 always comes from megadrive_io_data_regs switch (portnum) { @@ -94,7 +94,7 @@ READ8_MEMBER(md_cons_state::mess_md_io_read_data_port) /* Otherwise it's a 3 buttons Joypad */ else { - UINT8 svp_test = 0; + uint8_t svp_test = 0; if (m_cart) svp_test = m_cart->read_test(); @@ -526,10 +526,10 @@ DRIVER_INIT_MEMBER(md_cons_state, md_jpn) DEVICE_IMAGE_LOAD_MEMBER( md_cons_state, _32x_cart ) { - UINT32 length; - std::vector temp_copy; - UINT16 *ROM16; - UINT32 *ROM32; + uint32_t length; + std::vector temp_copy; + uint16_t *ROM16; + uint32_t *ROM32; int i; if (image.software_entry() == nullptr) @@ -547,15 +547,15 @@ DEVICE_IMAGE_LOAD_MEMBER( md_cons_state, _32x_cart ) /* Copy the cart image in the locations the driver expects */ // Notice that, by using pick_integer, we are sure the code works on both LE and BE machines - ROM16 = (UINT16 *) memregion("gamecart")->base(); + ROM16 = (uint16_t *) memregion("gamecart")->base(); for (i = 0; i < length; i += 2) ROM16[i / 2] = pick_integer_be(&temp_copy[0], i, 2); - ROM32 = (UINT32 *) memregion("gamecart_sh2")->base(); + ROM32 = (uint32_t *) memregion("gamecart_sh2")->base(); for (i = 0; i < length; i += 4) ROM32[i / 4] = pick_integer_be(&temp_copy[0], i, 4); - ROM16 = (UINT16 *) memregion("maincpu")->base(); + ROM16 = (uint16_t *) memregion("maincpu")->base(); for (i = 0x00; i < length; i += 2) ROM16[i / 2] = pick_integer_be(&temp_copy[0], i, 2); @@ -563,7 +563,7 @@ DEVICE_IMAGE_LOAD_MEMBER( md_cons_state, _32x_cart ) } -void md_cons_state::_32x_scanline_callback(int x, UINT32 priority, UINT16 &lineptr) +void md_cons_state::_32x_scanline_callback(int x, uint32_t priority, uint16_t &lineptr) { if (m_32x) m_32x->_32x_render_videobuffer_to_screenbuffer(x, priority, lineptr); diff --git a/src/mame/drivers/megadrvb.cpp b/src/mame/drivers/megadrvb.cpp index 8f8a438f7f9..c474d004107 100644 --- a/src/mame/drivers/megadrvb.cpp +++ b/src/mame/drivers/megadrvb.cpp @@ -409,7 +409,7 @@ WRITE16_MEMBER(md_boot_state::bl_710000_w) READ16_MEMBER(md_boot_state::bl_710000_r) { - UINT16 ret; + uint16_t ret; int pc = space.device().safe_pc(); logerror("%06x reading from bl_710000_r\n", pc); @@ -790,7 +790,7 @@ DRIVER_INIT_MEMBER(md_boot_state,aladmdb) * Game does a check @ 1afc00 with work RAM fff57c that makes it play like the original console version (i.e. 8 energy hits instead of 2) */ #if ENERGY_CONSOLE_MODE - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); rom[0x1afc08/2] = 0x6600; #endif @@ -805,7 +805,7 @@ DRIVER_INIT_MEMBER(md_boot_state,aladmdb) // after this decode look like intentional changes DRIVER_INIT_MEMBER(md_boot_state,mk3mdb) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (int x = 0x000001; x < 0x100001; x += 2) { @@ -870,7 +870,7 @@ DRIVER_INIT_MEMBER(md_boot_state,ssf2mdb) DRIVER_INIT_MEMBER(md_boot_state,srmdb) { - UINT8* rom = memregion("maincpu")->base(); + uint8_t* rom = memregion("maincpu")->base(); for (int x = 0x00001; x < 0x40000; x += 2) { diff --git a/src/mame/drivers/megaphx.cpp b/src/mame/drivers/megaphx.cpp index 6d52fc87404..56581c376f4 100644 --- a/src/mame/drivers/megaphx.cpp +++ b/src/mame/drivers/megaphx.cpp @@ -84,7 +84,7 @@ public: } required_device m_maincpu; - required_shared_ptr m_mainram; + required_shared_ptr m_mainram; @@ -102,9 +102,9 @@ public: int m_pic_clock; int m_pic_readbit; - UINT16 m_pic_result; + uint16_t m_pic_result; - UINT8 port_c_value; + uint8_t port_c_value; required_device m_indersb; required_device m_indervid; @@ -245,7 +245,7 @@ READ8_MEMBER(megaphx_state::port_c_r) //printf("read port c - write value was %02x\n", port_c_value); // int pc = machine().device("maincpu")->safe_pc(); - UINT8 ret = 0; + uint8_t ret = 0; // printf("(%06x) port_c_r (thru 8255)\n", pc); @@ -370,7 +370,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(megaphx_state,megaphx) { - UINT16 *src = (UINT16*)memregion( "roms67" )->base(); + uint16_t *src = (uint16_t*)memregion( "roms67" )->base(); // copy vector table? - it must be writable because the game write the irq vector.. memcpy(m_mainram, src, 0x80); diff --git a/src/mame/drivers/megaplay.cpp b/src/mame/drivers/megaplay.cpp index 1d358e75997..b045ec1b227 100644 --- a/src/mame/drivers/megaplay.cpp +++ b/src/mame/drivers/megaplay.cpp @@ -97,27 +97,27 @@ public: DECLARE_DRIVER_INIT(megaplay); DECLARE_VIDEO_START(megplay); DECLARE_MACHINE_RESET(megaplay); - UINT32 screen_update_megplay(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_megplay(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: - UINT32 m_bios_mode; // determines whether ROM banks or Game data is to read from 0x8000-0xffff + uint32_t m_bios_mode; // determines whether ROM banks or Game data is to read from 0x8000-0xffff - UINT32 m_bios_bank; // ROM bank selection - UINT16 m_game_banksel; // Game bank selection - UINT32 m_readpos; // serial bank selection position (9-bit) - UINT32 m_bios_bank_addr; + uint32_t m_bios_bank; // ROM bank selection + uint16_t m_game_banksel; // Game bank selection + uint32_t m_readpos; // serial bank selection position (9-bit) + uint32_t m_bios_bank_addr; - UINT32 m_bios_width; // determines the way the game info ROM is read - UINT8 m_bios_ctrl[6]; - UINT8 m_bios_6600; - UINT8 m_bios_6403; - UINT8 m_bios_6404; + uint32_t m_bios_width; // determines the way the game info ROM is read + uint8_t m_bios_ctrl[6]; + uint8_t m_bios_6600; + uint8_t m_bios_6403; + uint8_t m_bios_6404; - std::unique_ptr m_ic36_ram; - std::unique_ptr m_ic37_ram; + std::unique_ptr m_ic36_ram; + std::unique_ptr m_ic37_ram; - required_shared_ptr m_ic3_ram; + required_shared_ptr m_ic3_ram; optional_device m_vdp1; required_device m_bioscpu; }; @@ -438,8 +438,8 @@ READ16_MEMBER(mplay_state::mp_io_read) READ8_MEMBER(mplay_state::bank_r) { - UINT8* bank = memregion("mtbios")->base(); - UINT32 fulladdress = m_bios_bank_addr + offset; + uint8_t* bank = memregion("mtbios")->base(); + uint32_t fulladdress = m_bios_bank_addr + offset; if (fulladdress <= 0x3fffff) // ROM addresses { @@ -474,7 +474,7 @@ READ8_MEMBER(mplay_state::bank_r) WRITE8_MEMBER(mplay_state::bank_w) { - UINT32 fulladdress = m_bios_bank_addr + offset; + uint32_t fulladdress = m_bios_bank_addr + offset; if (fulladdress <= 0x3fffff && m_bios_width & 0x08) // ROM / Megaplay Custom Addresses { @@ -614,7 +614,7 @@ static ADDRESS_MAP_START( megaplay_bios_io_map, AS_IO, 8, mplay_state ) ADDRESS_MAP_END -UINT32 mplay_state::screen_update_megplay(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mplay_state::screen_update_megplay(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { //printf("megplay vu\n"); screen_update_megadriv(screen, bitmap, cliprect); @@ -626,12 +626,12 @@ UINT32 mplay_state::screen_update_megplay(screen_device &screen, bitmap_rgb32 &b // overlay, only drawn for pixels != 0 for (int y = 0; y < 224; y++) { - UINT32* lineptr = &bitmap.pix32(y); - UINT32* srcptr = &m_vdp1->get_bitmap().pix32(y + SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT); + uint32_t* lineptr = &bitmap.pix32(y); + uint32_t* srcptr = &m_vdp1->get_bitmap().pix32(y + SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT); for (int x = 0; x < SEGA315_5124_WIDTH; x++) { - UINT32 src = srcptr[x] & 0xffffff; + uint32_t src = srcptr[x] & 0xffffff; if (src) { @@ -878,20 +878,20 @@ DRIVER_INIT_MEMBER(mplay_state,megaplay) { // copy game instruction rom to main map. maybe this should just be accessed // through a handler instead? - UINT8 *instruction_rom = memregion("user1")->base(); - UINT8 *game_rom = memregion("maincpu")->base(); + uint8_t *instruction_rom = memregion("user1")->base(); + uint8_t *game_rom = memregion("maincpu")->base(); for (int offs = 0; offs < 0x8000; offs++) { - UINT8 dat = instruction_rom[offs]; + uint8_t dat = instruction_rom[offs]; game_rom[0x300000 + offs * 2] = dat; game_rom[0x300001 + offs * 2] = dat; } // to support the old code - m_ic36_ram = std::make_unique(0x10000 / 2); - m_ic37_ram = std::make_unique(0x10000); + m_ic36_ram = std::make_unique(0x10000 / 2); + m_ic37_ram = std::make_unique(0x10000); DRIVER_INIT_CALL(megadrij); m_megadrive_io_read_data_port_ptr = read8_delegate(FUNC(md_base_state::megadrive_io_read_data_port_3button),this); diff --git a/src/mame/drivers/megasys1.cpp b/src/mame/drivers/megasys1.cpp index 842a07ee80f..121d4a0a0c7 100644 --- a/src/mame/drivers/megasys1.cpp +++ b/src/mame/drivers/megasys1.cpp @@ -4088,7 +4088,7 @@ ROM_END void megasys1_state::rodland_gfx_unmangle(const char *region) { - UINT8 *rom = memregion(region)->base(); + uint8_t *rom = memregion(region)->base(); int size = memregion(region)->bytes(); int i; @@ -4099,7 +4099,7 @@ void megasys1_state::rodland_gfx_unmangle(const char *region) | ((rom[i] & 0x48) << 1) | ((rom[i] & 0x10) << 2); - std::vector buffer(size); + std::vector buffer(size); memcpy(&buffer[0],rom,size); @@ -4117,7 +4117,7 @@ void megasys1_state::rodland_gfx_unmangle(const char *region) void megasys1_state::jitsupro_gfx_unmangle(const char *region) { - UINT8 *rom = memregion(region)->base(); + uint8_t *rom = memregion(region)->base(); int size = memregion(region)->bytes(); int i; @@ -4125,7 +4125,7 @@ void megasys1_state::jitsupro_gfx_unmangle(const char *region) for (i = 0;i < size;i++) rom[i] = BITSWAP8(rom[i],0x4,0x3,0x5,0x7,0x6,0x2,0x1,0x0); - std::vector buffer(size); + std::vector buffer(size); memcpy(&buffer[0],rom,size); @@ -4141,7 +4141,7 @@ void megasys1_state::jitsupro_gfx_unmangle(const char *region) void megasys1_state::stdragona_gfx_unmangle(const char *region) { - UINT8 *rom = memregion(region)->base(); + uint8_t *rom = memregion(region)->base(); int size = memregion(region)->bytes(); int i; @@ -4149,7 +4149,7 @@ void megasys1_state::stdragona_gfx_unmangle(const char *region) for (i = 0;i < size;i++) rom[i] = BITSWAP8(rom[i],3,7,5,6,4,2,1,0); - std::vector buffer(size); + std::vector buffer(size); memcpy(&buffer[0],rom,size); @@ -4187,7 +4187,7 @@ void megasys1_state::stdragona_gfx_unmangle(const char *region) DRIVER_INIT_MEMBER(megasys1_state,64street) { -// UINT16 *ROM = (UINT16 *) memregion("maincpu")->base(); +// uint16_t *ROM = (uint16_t *) memregion("maincpu")->base(); // ROM[0x006b8/2] = 0x6004; // d8001 test // ROM[0x10EDE/2] = 0x6012; // watchdog @@ -4432,7 +4432,7 @@ DRIVER_INIT_MEMBER(megasys1_state,jitsupro) DRIVER_INIT_MEMBER(megasys1_state,peekaboo) { - UINT8 *ROM = memregion("oki1")->base(); + uint8_t *ROM = memregion("oki1")->base(); memory_bank *okibank = membank("okibank"); okibank->configure_entry(7, &ROM[0x20000]); @@ -4572,7 +4572,7 @@ DRIVER_INIT_MEMBER(megasys1_state,monkelf) // convert bootleg priority format to standard { int i; - UINT8 *ROM = memregion("proms")->base(); + uint8_t *ROM = memregion("proms")->base(); for (i = 0x1fe; i >= 0; i -= 2) { ROM[i+0] = ROM[i+1] = (ROM[i/2] >> 4) & 0x0f; diff --git a/src/mame/drivers/megatech.cpp b/src/mame/drivers/megatech.cpp index eabc98fbe22..bdea357a590 100644 --- a/src/mame/drivers/megatech.cpp +++ b/src/mame/drivers/megatech.cpp @@ -135,16 +135,16 @@ public: DECLARE_DEVICE_IMAGE_LOAD_MEMBER( mt_cart7 ) { return load_cart(image, m_cart7, 6); } DECLARE_DEVICE_IMAGE_LOAD_MEMBER( mt_cart8 ) { return load_cart(image, m_cart8, 7); } - UINT32 screen_update_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_menu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_menu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_main(screen_device &screen, bool state); private: - UINT8 m_mt_cart_select_reg; - UINT32 m_bios_port_ctrl; + uint8_t m_mt_cart_select_reg; + uint32_t m_bios_port_ctrl; int m_current_MACHINE_IS_sms; // is the current game SMS based (running on genesis z80, in VDP compatibility mode) - UINT32 m_bios_ctrl_inputs; - UINT8 m_bios_ctrl[6]; + uint32_t m_bios_ctrl_inputs; + uint8_t m_bios_ctrl[6]; int m_mt_bank_addr; int m_cart_is_genesis[8]; @@ -154,9 +154,9 @@ private: void switch_cart(int gameno); - std::unique_ptr m_banked_ram; - std::unique_ptr sms_mainram; - std::unique_ptr sms_rom; + std::unique_ptr m_banked_ram; + std::unique_ptr sms_mainram; + std::unique_ptr sms_rom; required_device m_vdp1; required_device m_cart1; @@ -365,12 +365,12 @@ void mtech_state::set_genz80_as_sms() address_space &io = m_z80snd->space(AS_IO); // main ram area - sms_mainram = std::make_unique(0x2000); + sms_mainram = std::make_unique(0x2000); prg.install_ram(0xc000, 0xdfff, 0x2000, sms_mainram.get()); memset(sms_mainram.get(), 0x00, 0x2000); // fixed rom bank area - sms_rom = std::make_unique(0xc000); + sms_rom = std::make_unique(0xc000); prg.install_rom(0x0000, 0xbfff, sms_rom.get()); memcpy(sms_rom.get(), m_region_maincpu->base(), 0xc000); @@ -493,7 +493,7 @@ WRITE8_MEMBER(mtech_state::bios_ctrl_w ) READ8_MEMBER(mtech_state::read_68k_banked_data ) { address_space &space68k = m_maincpu->space(); - UINT8 ret = space68k.read_byte(m_mt_bank_addr + offset); + uint8_t ret = space68k.read_byte(m_mt_bank_addr + offset); return ret; } @@ -546,7 +546,7 @@ WRITE8_MEMBER(mtech_state::bios_port_ctrl_w ) /* the test mode accesses the joypad/stick inputs like this */ READ8_MEMBER(mtech_state::bios_joypad_r ) { - UINT8 retdata = 0; + uint8_t retdata = 0; if (m_bios_port_ctrl == 0x55) { @@ -595,7 +595,7 @@ ADDRESS_MAP_END DRIVER_INIT_MEMBER(mtech_state,mt_slot) { - m_banked_ram = std::make_unique(0x1000*8); + m_banked_ram = std::make_unique(0x1000*8); DRIVER_INIT_CALL(megadriv); @@ -605,14 +605,14 @@ DRIVER_INIT_MEMBER(mtech_state,mt_slot) DRIVER_INIT_MEMBER(mtech_state,mt_crt) { - UINT8* pin = memregion("sms_pin")->base(); + uint8_t* pin = memregion("sms_pin")->base(); DRIVER_INIT_CALL(mt_slot); m_cart_is_genesis[0] = !pin[0] ? 1 : 0;; } -UINT32 mtech_state::screen_update_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mtech_state::screen_update_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // if we're running an sms game then use the SMS update.. maybe this should be moved to the megadrive emulation core as compatibility mode is a feature of the chip if (!m_current_MACHINE_IS_sms) @@ -624,8 +624,8 @@ UINT32 mtech_state::screen_update_main(screen_device &screen, bitmap_rgb32 &bitm // when launching megatech + both sms and megadrive games, the following would be needed... for (int y = 0; y < 224; y++) { - UINT32* lineptr = &bitmap.pix32(y); - UINT32* srcptr = &m_vdp->get_bitmap().pix32(y + SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT); + uint32_t* lineptr = &bitmap.pix32(y); + uint32_t* srcptr = &m_vdp->get_bitmap().pix32(y + SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT); for (int x = 0; x < SEGA315_5124_WIDTH; x++) lineptr[x] = srcptr[x]; @@ -669,7 +669,7 @@ MACHINE_RESET_MEMBER(mtech_state, megatech) switch_cart(0); } -UINT32 mtech_state::screen_update_menu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mtech_state::screen_update_menu(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_vdp1->screen_update(screen, bitmap, cliprect); return 0; @@ -720,9 +720,9 @@ MACHINE_CONFIG_END image_init_result mtech_state::load_cart(device_image_interface &image, generic_slot_device *slot, int gameno) { - UINT8 *ROM; + uint8_t *ROM; const char *pcb_name; - UINT32 size = slot->common_get_size("rom"); + uint32_t size = slot->common_get_size("rom"); if (image.software_entry() == nullptr) return image_init_result::FAIL; diff --git a/src/mame/drivers/meijinsn.cpp b/src/mame/drivers/meijinsn.cpp index 0fc1c12a08a..ed85ddf70ec 100644 --- a/src/mame/drivers/meijinsn.cpp +++ b/src/mame/drivers/meijinsn.cpp @@ -80,19 +80,19 @@ public: required_device m_maincpu; required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_shared_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_shared_ram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_bg_bank; + uint8_t m_bg_bank; /* misc */ - UINT8 m_deposits1; - UINT8 m_deposits2; - UINT8 m_credits; - UINT8 m_coinvalue; + uint8_t m_deposits1; + uint8_t m_deposits2; + uint8_t m_credits; + uint8_t m_coinvalue; int m_mcu_latch; DECLARE_WRITE16_MEMBER(sound_w); @@ -101,7 +101,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(meijinsn); - UINT32 screen_update_meijinsn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_meijinsn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(meijinsn_interrupt); }; @@ -115,8 +115,8 @@ WRITE16_MEMBER(meijinsn_state::sound_w) READ16_MEMBER(meijinsn_state::alpha_mcu_r) { - static const UINT8 coinage1[2][2] = {{1,1}, {1,2}}; - static const UINT8 coinage2[2][2] = {{1,5}, {2,1}}; + static const uint8_t coinage1[2][2] = {{1,1}, {1,2}}; + static const uint8_t coinage2[2][2] = {{1,5}, {2,1}}; int source = m_shared_ram[offset]; @@ -259,7 +259,7 @@ void meijinsn_state::video_start() PALETTE_INIT_MEMBER(meijinsn_state, meijinsn) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; static const int resistances_b[2] = { 470, 220 }; static const int resistances_rg[3] = { 1000, 470, 220 }; @@ -297,7 +297,7 @@ PALETTE_INIT_MEMBER(meijinsn_state, meijinsn) } -UINT32 meijinsn_state::screen_update_meijinsn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t meijinsn_state::screen_update_meijinsn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int offs; diff --git a/src/mame/drivers/mekd2.cpp b/src/mame/drivers/mekd2.cpp index f4f08addf85..62cfc782b1b 100644 --- a/src/mame/drivers/mekd2.cpp +++ b/src/mame/drivers/mekd2.cpp @@ -115,10 +115,10 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT8 m_cass_data[4]; - UINT8 m_segment; - UINT8 m_digit; - UINT8 m_keydata; + uint8_t m_cass_data[4]; + uint8_t m_segment; + uint8_t m_digit; + uint8_t m_keydata; bool m_cass_state; bool m_cassold; required_device m_maincpu; @@ -234,7 +234,7 @@ READ_LINE_MEMBER( mekd2_state::mekd2_key40_r ) READ8_MEMBER( mekd2_state::mekd2_key_r ) { char kbdrow[4]; - UINT8 i; + uint8_t i; m_keydata = 0xff; for (i = 0; i < 6; i++) @@ -276,7 +276,7 @@ WRITE8_MEMBER( mekd2_state::mekd2_segment_w ) WRITE8_MEMBER( mekd2_state::mekd2_digit_w ) { - UINT8 i; + uint8_t i; if (data < 0x3f) { for (i = 0; i < 6; i++) @@ -305,8 +305,8 @@ QUICKLOAD_LOAD_MEMBER( mekd2_state, mekd2_quik ) { static const char magic[] = "MEK6800D2"; char buff[9]; - UINT16 addr, size; - UINT8 ident, *RAM = memregion("maincpu")->base(); + uint16_t addr, size; + uint8_t ident, *RAM = memregion("maincpu")->base(); image.fread(buff, sizeof (buff)); if (memcmp(buff, magic, sizeof (buff))) @@ -346,7 +346,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(mekd2_state::mekd2_p) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { diff --git a/src/mame/drivers/mephisto.cpp b/src/mame/drivers/mephisto.cpp index 987e8442a92..b010de34dd8 100644 --- a/src/mame/drivers/mephisto.cpp +++ b/src/mame/drivers/mephisto.cpp @@ -99,11 +99,11 @@ public: DECLARE_READ8_MEMBER(read_keys); DECLARE_WRITE8_MEMBER(write_led); DECLARE_WRITE8_MEMBER(write_led_mm2); - UINT8 m_lcd_shift_counter; - UINT8 m_led_status; - //UINT8 *m_p_ram; - UINT8 m_led7; - UINT8 m_allowNMI; + uint8_t m_lcd_shift_counter; + uint8_t m_led_status; + //uint8_t *m_p_ram; + uint8_t m_led7; + uint8_t m_allowNMI; DECLARE_DRIVER_INIT(mephisto); virtual void machine_start() override; virtual void machine_reset() override; @@ -148,7 +148,7 @@ WRITE8_MEMBER( mephisto_state::mephisto_NMI ) READ8_MEMBER( mephisto_state::read_keys ) { - UINT8 data = 0; + uint8_t data = 0; if (((m_led_status & 0x80) == 0x00)) { @@ -185,7 +185,7 @@ READ8_MEMBER( mephisto_state::read_keys ) WRITE8_MEMBER( mephisto_state::write_led ) { - UINT8 LED_offset=100; + uint8_t LED_offset=100; data &= 0x80; if (data==0)m_led_status &= 255-(1< m_ram_attr; - required_shared_ptr m_ram_video; - std::unique_ptr m_ram_palette; - UINT8 m_lscnblk; + required_shared_ptr m_ram_attr; + required_shared_ptr m_ram_video; + std::unique_ptr m_ram_palette; + uint8_t m_lscnblk; int m_extra_video_bank_bit; int m_question_address; int m_decryption_key; - optional_shared_ptr m_backup_ram; + optional_shared_ptr m_backup_ram; DECLARE_READ8_MEMBER(questions_r); DECLARE_WRITE8_MEMBER(low_offset_w); DECLARE_WRITE8_MEMBER(med_offset_w); @@ -137,7 +137,7 @@ public: void merit_state::machine_start() { m_question_address = 0; - m_ram_palette = std::make_unique(RAM_PALETTE_SIZE); + m_ram_palette = std::make_unique(RAM_PALETTE_SIZE); save_pointer(NAME(m_ram_palette.get()), RAM_PALETTE_SIZE); save_item(NAME(m_lscnblk)); @@ -149,7 +149,7 @@ void merit_state::machine_start() READ8_MEMBER(merit_state::questions_r) { - UINT8 *questions = memregion("user1")->base(); + uint8_t *questions = memregion("user1")->base(); int address; switch(m_question_address >> 16) @@ -258,8 +258,8 @@ MC6845_BEGIN_UPDATE( merit_state::crtc_begin_update ) MC6845_UPDATE_ROW( merit_state::crtc_update_row ) { - UINT8 *gfx[2]; - UINT16 x = 0; + uint8_t *gfx[2]; + uint16_t x = 0; int rlen; gfx[0] = memregion("gfx1")->base(); @@ -267,14 +267,14 @@ MC6845_UPDATE_ROW( merit_state::crtc_update_row ) rlen = memregion("gfx2")->bytes(); //ma = ma ^ 0x7ff; - for (UINT8 cx = 0; cx < x_count; cx++) + for (uint8_t cx = 0; cx < x_count; cx++) { int i; int attr = m_ram_attr[ma & 0x7ff]; int region = (attr & 0x40) >> 6; int addr = ((m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (m_extra_video_bank_bit)) << 4) | (ra & 0x0f); int colour = (attr & 0x7f) << 3; - UINT8 *data; + uint8_t *data; addr &= (rlen-1); data = gfx[region]; @@ -1343,7 +1343,7 @@ INPUT_PORTS_END void merit_state::dodge_nvram_init(nvram_device &nvram, void *base, size_t size) { memset(base, 0x00, size); - reinterpret_cast(base)[0x1040] = 0xc9; /* ret */ + reinterpret_cast(base)[0x1040] = 0xc9; /* ret */ } MACHINE_START_MEMBER(merit_state,casino5) @@ -2382,7 +2382,7 @@ DRIVER_INIT_MEMBER(merit_state,key_7) DRIVER_INIT_MEMBER(merit_state,couple) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); #if 0 //quick rom compare test { @@ -2408,7 +2408,7 @@ DRIVER_INIT_MEMBER(merit_state,couple) DRIVER_INIT_MEMBER(merit_state,dtrvwz5) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* fill b000 - b0ff with ret 0xc9 */ for ( i = 0xb000; i < 0xb100; i++ ) ROM[i] = 0xc9; diff --git a/src/mame/drivers/meritm.cpp b/src/mame/drivers/meritm.cpp index cdc8d4e7d10..e36e76aa987 100644 --- a/src/mame/drivers/meritm.cpp +++ b/src/mame/drivers/meritm.cpp @@ -220,7 +220,7 @@ public: optional_memory_bank m_bank3; required_memory_region m_region_maincpu; optional_memory_region m_region_extra; - std::unique_ptr m_ram; + std::unique_ptr m_ram; int m_vint; int m_interrupt_vdp0_state; @@ -229,7 +229,7 @@ public: int m_layer1_enabled; int m_bank; int m_psd_a15; - UINT16 m_questions_loword_address; + uint16_t m_questions_loword_address; DECLARE_WRITE8_MEMBER(meritm_crt250_bank_w); DECLARE_WRITE8_MEMBER(meritm_psd_a15_w); @@ -255,13 +255,13 @@ public: DECLARE_MACHINE_START(meritm_crt250_crt252_crt258); DECLARE_MACHINE_START(meritm_crt260); DECLARE_MACHINE_START(merit_common); - UINT32 screen_update_meritm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_meritm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(vblank_start_tick); TIMER_DEVICE_CALLBACK_MEMBER(vblank_end_tick); void meritm_crt250_switch_banks( ); void meritm_switch_banks( ); int meritm_touch_coord_transform(int *touch_x, int *touch_y); - UINT8 binary_to_BCD(UINT8 data); + uint8_t binary_to_BCD(uint8_t data); DECLARE_WRITE_LINE_MEMBER(meritm_vdp0_interrupt); DECLARE_WRITE_LINE_MEMBER(meritm_vdp1_interrupt); }; @@ -331,7 +331,7 @@ void meritm_state::video_start() save_item(NAME(m_interrupt_vdp1_state)); } -UINT32 meritm_state::screen_update_meritm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t meritm_state::screen_update_meritm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if(machine().input().code_pressed_once(KEYCODE_Q)) { @@ -425,8 +425,8 @@ WRITE8_MEMBER(meritm_state::meritm_crt250_questions_hi_w) WRITE8_MEMBER(meritm_state::meritm_crt250_questions_bank_w) { - UINT32 questions_address; - UINT8 *dst; + uint32_t questions_address; + uint8_t *dst; if ((m_bank & 0x07) != 0) { @@ -491,7 +491,7 @@ WRITE8_MEMBER(meritm_state::meritm_ds1644_w) } } -UINT8 meritm_state::binary_to_BCD(UINT8 data) +uint8_t meritm_state::binary_to_BCD(uint8_t data) { data %= 100; @@ -1055,7 +1055,7 @@ MACHINE_START_MEMBER(meritm_state,meritm_crt250_crt252_crt258) MACHINE_START_MEMBER(meritm_state,meritm_crt260) { - m_ram = std::make_unique( 0x8000 ); + m_ram = std::make_unique( 0x8000 ); machine().device("nvram")->set_base(m_ram.get(), 0x8000); memset(m_ram.get(), 0x00, 0x8000); m_bank1->configure_entries(0, 128, m_region_maincpu->base(), 0x8000); diff --git a/src/mame/drivers/mermaid.cpp b/src/mame/drivers/mermaid.cpp index 54011c36710..e11d435d624 100644 --- a/src/mame/drivers/mermaid.cpp +++ b/src/mame/drivers/mermaid.cpp @@ -406,7 +406,7 @@ WRITE_LINE_MEMBER(mermaid_state::rougien_adpcm_int) } else { - UINT8 *ROM = memregion("adpcm")->base(); + uint8_t *ROM = memregion("adpcm")->base(); m_adpcm_data = ((m_adpcm_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0) >> 4)); m_adpcm->data_w(m_adpcm_data & 0xf); diff --git a/src/mame/drivers/mes.cpp b/src/mame/drivers/mes.cpp index 7fba4e556b0..416d76dc6cd 100644 --- a/src/mame/drivers/mes.cpp +++ b/src/mame/drivers/mes.cpp @@ -21,11 +21,11 @@ public: m_p_videoram(*this, "p_videoram"){ } required_device m_maincpu; - const UINT8 *m_p_chargen; - required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + required_shared_ptr m_p_videoram; virtual void machine_reset() override; virtual void video_start() override; - 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); }; @@ -56,11 +56,11 @@ void mes_state::video_start() /* This system appears to have 2 screens. Not implemented. Also the screen dimensions are a guess. */ -UINT32 mes_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mes_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - //static UINT8 framecnt=0; - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x,xx; + //static uint8_t framecnt=0; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x,xx; //framecnt++; @@ -68,7 +68,7 @@ UINT32 mes_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); xx = ma; for (x = ma; x < ma + 80; x++) diff --git a/src/mame/drivers/metalmx.cpp b/src/mame/drivers/metalmx.cpp index e5e18ae26e6..d5de7b61536 100644 --- a/src/mame/drivers/metalmx.cpp +++ b/src/mame/drivers/metalmx.cpp @@ -279,19 +279,19 @@ void metalmx_state::video_start() { } -UINT32 metalmx_state::screen_update_metalmx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t metalmx_state::screen_update_metalmx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* TODO: TMS34020 should take care of this */ -// UINT32 *src_base = &gsp_vram[(vreg_base[0x40/4] & 0x40) ? 0x20000 : 0]; - UINT16 *src_base = m_gsp_vram; +// uint32_t *src_base = &gsp_vram[(vreg_base[0x40/4] & 0x40) ? 0x20000 : 0]; + uint16_t *src_base = m_gsp_vram; int y; for (y = 0; y < 384; ++y) { int x; - UINT16 *src = &src_base[512 * y]; - UINT16 *dst = &bitmap.pix16(y); + uint16_t *src = &src_base[512 * y]; + uint16_t *dst = &bitmap.pix16(y); for(x = 0; x < 512; x++) *dst++ = *src++; @@ -344,7 +344,7 @@ WRITE32_MEMBER(metalmx_state::reset_w) READ32_MEMBER(metalmx_state::sound_data_r) { - UINT32 result = 0; + uint32_t result = 0; if (ACCESSING_BITS_0_15) result |= m_cage->control_r(); @@ -386,7 +386,7 @@ WRITE32_MEMBER(metalmx_state::dsp32c_1_w) READ32_MEMBER(metalmx_state::dsp32c_1_r) { - UINT32 data; + uint32_t data; offset <<= 1; @@ -415,7 +415,7 @@ WRITE32_MEMBER(metalmx_state::dsp32c_2_w) READ32_MEMBER(metalmx_state::dsp32c_2_r) { - UINT32 data; + uint32_t data; offset <<= 1; @@ -448,7 +448,7 @@ WRITE32_MEMBER(metalmx_state::host_gsp_w) READ32_MEMBER(metalmx_state::host_gsp_r) { address_space &gsp_space = m_gsp->space(AS_PROGRAM); - UINT32 val; + uint32_t val; val = gsp_space.read_word((0xc0000000 + (offset << 5) + 0x10) / 8); val |= gsp_space.read_word((0xc0000000 + (offset << 5)) / 8) << 16; @@ -725,7 +725,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(metalmx_state,metalmx) { - UINT8 *adsp_boot = (UINT8*)memregion("adsp")->base(); + uint8_t *adsp_boot = (uint8_t*)memregion("adsp")->base(); m_adsp->load_boot_data(adsp_boot, m_adsp_internal_program_ram); } diff --git a/src/mame/drivers/metlfrzr.cpp b/src/mame/drivers/metlfrzr.cpp index 6f91fdc8525..07509041d48 100644 --- a/src/mame/drivers/metlfrzr.cpp +++ b/src/mame/drivers/metlfrzr.cpp @@ -45,19 +45,19 @@ public: void legacy_bg_draw(bitmap_ind16 &bitmap, const rectangle &cliprect); void legacy_obj_draw(bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_metlfrzr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_metlfrzr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; - required_shared_ptr m_decrypted_opcodes; - required_shared_ptr m_work_ram; - required_shared_ptr m_vram; - required_shared_ptr m_video_regs; + required_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_work_ram; + required_shared_ptr m_vram; + required_shared_ptr m_video_regs; required_device m_palette; required_device m_gfxdecode; DECLARE_DRIVER_INIT(metlfrzr); DECLARE_WRITE8_MEMBER(output_w); TIMER_DEVICE_CALLBACK_MEMBER(scanline); - UINT8 m_fg_tilebank; + uint8_t m_fg_tilebank; bool m_rowscroll_enable; }; @@ -78,11 +78,11 @@ void metlfrzr_state::video_start() void metlfrzr_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(m_fg_tilebank); - const UINT16 vram_mask = m_vram.mask() >> 1; + const uint16_t vram_mask = m_vram.mask() >> 1; int count; int x_scroll_base; int x_scroll_shift; - UINT16 x_scroll_value; + uint16_t x_scroll_value; x_scroll_value = m_video_regs[0x17] + ((m_video_regs[0x06] & 1) << 8); x_scroll_base = (x_scroll_value >> 3) * 32; @@ -101,8 +101,8 @@ void metlfrzr_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &clipre int x = (count / 32); - UINT16 tile = m_vram[tile_base*2+0] + ((m_vram[tile_base*2+1] & 0xf0) << 4); - UINT8 color = m_vram[tile_base*2+1] & 0xf; + uint16_t tile = m_vram[tile_base*2+0] + ((m_vram[tile_base*2+1] & 0xf0) << 4); + uint8_t color = m_vram[tile_base*2+1] & 0xf; gfx->transpen(bitmap,cliprect,tile,color,0,0,x*8-x_scroll_shift,y*8,0xf); } @@ -127,14 +127,14 @@ void metlfrzr_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr gfx_element *gfx_2 = m_gfxdecode->gfx(2); gfx_element *gfx_3 = m_gfxdecode->gfx(3); int count; - UINT8 *base_spriteram = m_work_ram + 0xe00; + uint8_t *base_spriteram = m_work_ram + 0xe00; for(count=0x200-4;count>-1;count-=4) { gfx_element *cur_gfx = base_spriteram[count+1] & 0x40 ? gfx_3 : gfx_2; - UINT8 tile_bank = (base_spriteram[count+1] & 0x30) >> 4; - UINT16 tile = base_spriteram[count] | (tile_bank << 8); - UINT8 color = base_spriteram[count+1] & 0xf; + uint8_t tile_bank = (base_spriteram[count+1] & 0x30) >> 4; + uint16_t tile = base_spriteram[count] | (tile_bank << 8); + uint8_t color = base_spriteram[count+1] & 0xf; int y = base_spriteram[count+2]; int x = base_spriteram[count+3]; if(base_spriteram[count+1] & 0x80) @@ -144,7 +144,7 @@ void metlfrzr_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr } } -UINT32 metlfrzr_state::screen_update_metlfrzr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t metlfrzr_state::screen_update_metlfrzr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -428,7 +428,7 @@ ROM_END DRIVER_INIT_MEMBER(metlfrzr_state, metlfrzr) { // same as cshooter.cpp - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (int A = 0x0000;A < 0x8000;A++) { diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp index 780d7307df6..7fadec702d9 100644 --- a/src/mame/drivers/metro.cpp +++ b/src/mame/drivers/metro.cpp @@ -135,7 +135,7 @@ READ16_MEMBER(metro_state::metro_irq_cause_r) */ - UINT16 res = 0; + uint16_t res = 0; for (int i = 0; i < 8; i++) res |= (m_requested_int[i] << i); @@ -149,12 +149,12 @@ void metro_state::update_irq_state() address_space &space = m_maincpu->space(AS_PROGRAM); /* Get the pending IRQs (only the enabled ones, e.g. where irq_enable is *0*) */ - UINT16 irq = metro_irq_cause_r(space, 0, 0xffff) & ~*m_irq_enable; + uint16_t irq = metro_irq_cause_r(space, 0, 0xffff) & ~*m_irq_enable; if (m_irq_line == -1) /* mouja, gakusai, gakusai2, dokyusei, dokyusp */ { /* This is for games that supply an *IRQ Vector* on the data bus together with an IRQ level for each possible IRQ source */ - UINT8 irq_level[8] = { 0 }; + uint8_t irq_level[8] = { 0 }; int i; for (i = 0; i < 8; i++) @@ -267,7 +267,7 @@ INTERRUPT_GEN_MEMBER(metro_state::puzzlet_interrupt) READ_LINE_MEMBER(metro_state::metro_rxd_r) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 data = m_soundlatch->read(space, 0); + uint8_t data = m_soundlatch->read(space, 0); m_soundlatch->write(space, 0, data >> 1); @@ -307,7 +307,7 @@ WRITE16_MEMBER(metro_state::metro_soundstatus_w) WRITE8_MEMBER(metro_state::metro_sound_rombank_w) { int bankaddress; - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); bankaddress = 0x10000-0x4000 + ((data >> 4) & 0x03) * 0x4000; if (bankaddress < 0x10000) bankaddress = 0x0000; @@ -318,7 +318,7 @@ WRITE8_MEMBER(metro_state::metro_sound_rombank_w) WRITE8_MEMBER(metro_state::daitorid_sound_rombank_w) { int bankaddress; - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); bankaddress = 0x10000-0x4000 + ((data >> 4) & 0x07) * 0x4000; if (bankaddress < 0x10000) bankaddress = 0x10000; @@ -483,7 +483,7 @@ WRITE16_MEMBER(metro_state::metro_coin_lockout_4words_w) READ16_MEMBER(metro_state::metro_bankedrom_r) { - UINT8 *ROM = memregion("gfx1")->base(); + uint8_t *ROM = memregion("gfx1")->base(); size_t len = memregion("gfx1")->bytes(); offset = offset * 2 + 0x10000 * (*m_rombank); @@ -549,12 +549,12 @@ TIMER_CALLBACK_MEMBER(metro_state::metro_blit_done) update_irq_state(); } -inline int metro_state::blt_read( const UINT8 *ROM, const int offs ) +inline int metro_state::blt_read( const uint8_t *ROM, const int offs ) { return ROM[offs]; } -void metro_state::blt_write( address_space &space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask ) +void metro_state::blt_write( address_space &space, const int tmap, const offs_t offs, const uint16_t data, const uint16_t mask ) { switch(tmap) { @@ -572,15 +572,15 @@ WRITE16_MEMBER(metro_state::metro_blitter_w) if (offset == 0x0c / 2) { - UINT8 *src = memregion("gfx1")->base(); + uint8_t *src = memregion("gfx1")->base(); size_t src_len = memregion("gfx1")->bytes(); - UINT32 tmap = (m_blitter_regs[0x00 / 2] << 16) + m_blitter_regs[0x02 / 2]; - UINT32 src_offs = (m_blitter_regs[0x04 / 2] << 16) + m_blitter_regs[0x06 / 2]; - UINT32 dst_offs = (m_blitter_regs[0x08 / 2] << 16) + m_blitter_regs[0x0a / 2]; + uint32_t tmap = (m_blitter_regs[0x00 / 2] << 16) + m_blitter_regs[0x02 / 2]; + uint32_t src_offs = (m_blitter_regs[0x04 / 2] << 16) + m_blitter_regs[0x06 / 2]; + uint32_t dst_offs = (m_blitter_regs[0x08 / 2] << 16) + m_blitter_regs[0x0a / 2]; int shift = (dst_offs & 0x80) ? 0 : 8; - UINT16 mask = (dst_offs & 0x80) ? 0x00ff : 0xff00; + uint16_t mask = (dst_offs & 0x80) ? 0x00ff : 0xff00; // logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n", space.device().safe_pc(), tmap, src_offs, dst_offs); @@ -598,7 +598,7 @@ WRITE16_MEMBER(metro_state::metro_blitter_w) while (1) { - UINT16 b1, b2, count; + uint16_t b1, b2, count; src_offs %= src_len; b1 = blt_read(src, src_offs); @@ -739,9 +739,9 @@ ADDRESS_MAP_END /* Really weird way of mapping 3 DSWs */ READ16_MEMBER(metro_state::balcube_dsw_r) { - UINT16 dsw1 = ioport("DSW0")->read() >> 0; - UINT16 dsw2 = ioport("DSW0")->read() >> 8; - UINT16 dsw3 = ioport("IN2")->read(); + uint16_t dsw1 = ioport("DSW0")->read() >> 0; + uint16_t dsw2 = ioport("DSW0")->read() >> 8; + uint16_t dsw3 = ioport("IN2")->read(); switch (offset * 2) { @@ -1195,7 +1195,7 @@ WRITE16_MEMBER(metro_state::gakusai_oki_bank_lo_w) READ16_MEMBER(metro_state::gakusai_input_r) { - UINT16 input_sel = (*m_input_sel) ^ 0x3e; + uint16_t input_sel = (*m_input_sel) ^ 0x3e; // Bit 0 ?? if (input_sel & 0x0002) return ioport("KEY0")->read(); if (input_sel & 0x0004) return ioport("KEY1")->read(); @@ -1596,7 +1596,7 @@ WRITE16_MEMBER(metro_state::blzntrnd_sound_w) WRITE8_MEMBER(metro_state::blzntrnd_sh_bankswitch_w) { - UINT8 *RAM = memregion("audiocpu")->base(); + uint8_t *RAM = memregion("audiocpu")->base(); int bankaddress; bankaddress = 0x10000 + (data & 0x03) * 0x4000; @@ -1713,7 +1713,7 @@ ADDRESS_MAP_END class puzzlet_io_device : public device_t { public: - puzzlet_io_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + puzzlet_io_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 ); @@ -1729,13 +1729,13 @@ private: required_ioport port; int ce, clk; int cur_bit; - UINT8 value; + uint8_t value; }; const device_type PUZZLET_IO = &device_creator; -puzzlet_io_device::puzzlet_io_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +puzzlet_io_device::puzzlet_io_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PUZZLET_IO, "Puzzlet Coin/Start I/O", tag, owner, clock, "puzzlet_io", __FILE__), data_cb(*this), port(*this, ":IN0") @@ -6269,7 +6269,7 @@ DRIVER_INIT_MEMBER(metro_state,daitorid) /* Unscramble the GFX ROMs */ DRIVER_INIT_MEMBER(metro_state,balcube) { - UINT8 *ROM = memregion("gfx1")->base(); + uint8_t *ROM = memregion("gfx1")->base(); const unsigned len = memregion("gfx1")->bytes(); for (unsigned i = 0; i < len; i+=2) @@ -6284,12 +6284,12 @@ DRIVER_INIT_MEMBER(metro_state,balcube) DRIVER_INIT_MEMBER(metro_state,dharmak) { - UINT8 *src = memregion( "gfx1" )->base(); + uint8_t *src = memregion( "gfx1" )->base(); int i; for (i = 0; i < 0x200000; i += 4) { - UINT8 dat; + uint8_t dat; dat = src[i + 1]; dat = BITSWAP8(dat, 7,3,2,4, 5,6,1,0); src[i + 1] = dat; diff --git a/src/mame/drivers/mexico86.cpp b/src/mame/drivers/mexico86.cpp index 80812407f14..ba06b521eb8 100644 --- a/src/mame/drivers/mexico86.cpp +++ b/src/mame/drivers/mexico86.cpp @@ -64,7 +64,7 @@ PS4 J8635 PS4 J8541 PS4 J8648 READ8_MEMBER(mexico86_state::kiki_ym2203_r) { - UINT8 result = m_ymsnd->read(space, offset); + uint8_t result = m_ymsnd->read(space, offset); if (offset == 0) result &= 0x7f; @@ -397,7 +397,7 @@ GFXDECODE_END void mexico86_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 6, &ROM[0x08000], 0x4000); diff --git a/src/mame/drivers/meyc8080.cpp b/src/mame/drivers/meyc8080.cpp index 095c615ae2e..d797f33f6eb 100644 --- a/src/mame/drivers/meyc8080.cpp +++ b/src/mame/drivers/meyc8080.cpp @@ -77,9 +77,9 @@ public: m_maincpu(*this, "maincpu"), m_dac(*this, "dac") { } - required_shared_ptr m_videoram_0; - required_shared_ptr m_videoram_1; - required_shared_ptr m_videoram_2; + required_shared_ptr m_videoram_0; + required_shared_ptr m_videoram_1; + required_shared_ptr m_videoram_2; DECLARE_WRITE8_MEMBER(lights_1_w); DECLARE_WRITE8_MEMBER(lights_2_w); @@ -88,7 +88,7 @@ public: DECLARE_WRITE8_MEMBER(meyc8080_dac_2_w); DECLARE_WRITE8_MEMBER(meyc8080_dac_3_w); DECLARE_WRITE8_MEMBER(meyc8080_dac_4_w); - UINT32 screen_update_meyc8080(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_meyc8080(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_dac; }; @@ -100,7 +100,7 @@ public: * *************************************/ -UINT32 meyc8080_state::screen_update_meyc8080(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t meyc8080_state::screen_update_meyc8080(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -108,18 +108,18 @@ UINT32 meyc8080_state::screen_update_meyc8080(screen_device &screen, bitmap_rgb3 { int i; - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; - UINT8 data0 = m_videoram_0[offs]; - UINT8 data1 = m_videoram_1[offs]; - UINT8 data2 = m_videoram_2[offs]; + uint8_t data0 = m_videoram_0[offs]; + uint8_t data1 = m_videoram_1[offs]; + uint8_t data2 = m_videoram_2[offs]; /* weird equations, but it matches every flyer screenshot - perhaphs they used a look-up PROM? */ - UINT8 data_r = data0; - UINT8 data_g = (data2 & ~data0) | (data2 & data1) | (~data2 & ~data1 & data0); - UINT8 data_b = data0 ^ data1; + uint8_t data_r = data0; + uint8_t data_g = (data2 & ~data0) | (data2 & data1) | (~data2 & ~data1 & data0); + uint8_t data_b = data0 ^ data1; for (i = 0; i < 8; i++) { diff --git a/src/mame/drivers/meyc8088.cpp b/src/mame/drivers/meyc8088.cpp index 3930afc0fc1..f95642afb58 100644 --- a/src/mame/drivers/meyc8088.cpp +++ b/src/mame/drivers/meyc8088.cpp @@ -47,13 +47,13 @@ public: { } required_device m_maincpu; - required_shared_ptr m_vram; + required_shared_ptr m_vram; required_device m_heartbeat; optional_ioport_array<4> m_switches; - UINT8 m_status; - UINT8 m_common; + uint8_t m_status; + uint8_t m_common; DECLARE_WRITE8_MEMBER(drive_w); DECLARE_WRITE8_MEMBER(video5_flip_w); @@ -67,7 +67,7 @@ public: DECLARE_WRITE8_MEMBER(meyc8088_common_w); DECLARE_PALETTE_INIT(meyc8088); - UINT32 screen_update_meyc8088(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_meyc8088(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_meyc8088(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(heartbeat_callback); }; @@ -121,16 +121,16 @@ static const res_net_info meyc8088_net_info = PALETTE_INIT_MEMBER(meyc8088_state, meyc8088) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); std::vector rgb; compute_res_net_all(rgb, color_prom, meyc8088_decode_info, meyc8088_net_info); palette.set_pen_colors(0, rgb); } -UINT32 meyc8088_state::screen_update_meyc8088(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t meyc8088_state::screen_update_meyc8088(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 v[5]; + uint8_t v[5]; v[4] = m_status << 2 & 0x10; // video5: color prom d4 if (~m_status & 2) @@ -142,8 +142,8 @@ UINT32 meyc8088_state::screen_update_meyc8088(screen_device &screen, bitmap_ind1 for (offs_t offs = 0x800; offs < 0x4000; offs+=2) { - UINT8 y = (offs-0x800) >> 6; - UINT8 x = (offs-0x800) << 2; + uint8_t y = (offs-0x800) >> 6; + uint8_t x = (offs-0x800) << 2; v[0] = m_vram[offs|0x0000]; // video1: color prom d0 v[1] = m_vram[offs|0x0001]; // video2: color prom d1 @@ -228,7 +228,7 @@ ADDRESS_MAP_END READ8_MEMBER(meyc8088_state::meyc8088_input_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; // multiplexed switch inputs if (~m_common & 1) ret &= m_switches[0].read_safe(0); // bit switches diff --git a/src/mame/drivers/mgames.cpp b/src/mame/drivers/mgames.cpp index 7cb3ec90378..2e15e71fccb 100644 --- a/src/mame/drivers/mgames.cpp +++ b/src/mame/drivers/mgames.cpp @@ -230,8 +230,8 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_output[8]; - required_shared_ptr m_video; + uint8_t m_output[8]; + required_shared_ptr m_video; int m_mixdata; DECLARE_READ8_MEMBER(mixport_r); DECLARE_WRITE8_MEMBER(outport0_w); @@ -244,7 +244,7 @@ public: DECLARE_WRITE8_MEMBER(outport7_w); virtual void video_start() override; DECLARE_PALETTE_INIT(mgames); - UINT32 screen_update_mgames(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mgames(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -255,7 +255,7 @@ void mgames_state::video_start() { } -UINT32 mgames_state::screen_update_mgames(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mgames_state::screen_update_mgames(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y,x; int count; @@ -266,8 +266,8 @@ UINT32 mgames_state::screen_update_mgames(screen_device &screen, bitmap_ind16 &b { for (x = 0; x < 32; x++) { - UINT16 dat = m_video[count]; - UINT16 col = m_video[count + 0x400] & 0x7f; + uint16_t dat = m_video[count]; + uint16_t col = m_video[count + 0x400] & 0x7f; gfx->opaque(bitmap, cliprect, dat, col, 0, 0, x * 16, y * 16); count++; } diff --git a/src/mame/drivers/mgavegas.cpp b/src/mame/drivers/mgavegas.cpp index 27033c0d759..410359dc040 100644 --- a/src/mame/drivers/mgavegas.cpp +++ b/src/mame/drivers/mgavegas.cpp @@ -59,66 +59,66 @@ public: { } - UINT8 m_int; + uint8_t m_int; //OUT1 - UINT8 m_ckmod; - UINT8 m_dmod; - UINT8 m_emod; - UINT8 m_inh; - UINT8 m_hop; - UINT8 m_seg; - UINT8 m_printer; - UINT8 m_auxp; + uint8_t m_ckmod; + uint8_t m_dmod; + uint8_t m_emod; + uint8_t m_inh; + uint8_t m_hop; + uint8_t m_seg; + uint8_t m_printer; + uint8_t m_auxp; //helper... - UINT8 m_old_ckmod; - UINT8 m_old_emod; + uint8_t m_old_ckmod; + uint8_t m_old_emod; //OUT2 - UINT8 m_bobina_ctrl; - UINT8 m_timbre; - UINT8 m_coil_1; - UINT8 m_coil_2; - UINT8 m_coil_3; - UINT8 m_cont_ent; - UINT8 m_cont_sal; - UINT8 m_cont_caj; + uint8_t m_bobina_ctrl; + uint8_t m_timbre; + uint8_t m_coil_1; + uint8_t m_coil_2; + uint8_t m_coil_3; + uint8_t m_cont_ent; + uint8_t m_cont_sal; + uint8_t m_cont_caj; //lamps out - UINT64 m_custom_data; - UINT8 m_auxs; - UINT8 m_anal; - UINT8 m_anacl; - UINT8 m_anacr; - UINT8 m_anar; - UINT8 m_pl; - UINT8 m_pc; - UINT8 m_pr; - UINT8 m_luz_250_rul; - UINT8 m_luz_100_rul; - UINT8 m_luz_50_rlul; - UINT8 m_luz_25_lrul; - UINT8 m_luz_25_rrul; - UINT8 m_fl; - UINT8 m_fc; - UINT8 m_fr; - UINT8 m_insert_coin; - UINT8 m_no_cambio; - UINT8 m_fuse; - UINT8 m_falta; - UINT8 m_anag; - UINT8 m_cl; - UINT8 m_cc; - UINT8 m_cr; - UINT8 m_premio_s; - UINT8 m_100; - UINT8 m_200; - UINT8 m_300; - UINT8 m_500; - UINT8 m_ml; - UINT8 m_mc; - UINT8 m_mr; + uint64_t m_custom_data; + uint8_t m_auxs; + uint8_t m_anal; + uint8_t m_anacl; + uint8_t m_anacr; + uint8_t m_anar; + uint8_t m_pl; + uint8_t m_pc; + uint8_t m_pr; + uint8_t m_luz_250_rul; + uint8_t m_luz_100_rul; + uint8_t m_luz_50_rlul; + uint8_t m_luz_25_lrul; + uint8_t m_luz_25_rrul; + uint8_t m_fl; + uint8_t m_fc; + uint8_t m_fr; + uint8_t m_insert_coin; + uint8_t m_no_cambio; + uint8_t m_fuse; + uint8_t m_falta; + uint8_t m_anag; + uint8_t m_cl; + uint8_t m_cc; + uint8_t m_cr; + uint8_t m_premio_s; + uint8_t m_100; + uint8_t m_200; + uint8_t m_300; + uint8_t m_500; + uint8_t m_ml; + uint8_t m_mc; + uint8_t m_mr; DECLARE_READ8_MEMBER(start_read); @@ -210,7 +210,7 @@ void mgavegas_state::update_lamp(){ void mgavegas_state::update_custom(){ -UINT64 tmp; +uint64_t tmp; if( (m_ckmod==1) & (m_old_ckmod==0) ){ //vadid clock, sample the data @@ -284,7 +284,7 @@ READ8_MEMBER( mgavegas_state::start_read ) ****************************/ READ8_MEMBER(mgavegas_state::r_a0) { -UINT8 ret=0; +uint8_t ret=0; switch (offset&0x03) @@ -335,7 +335,7 @@ WRITE8_MEMBER(mgavegas_state::w_a0) READ8_MEMBER(mgavegas_state::csoki_r) { -UINT8 ret=0; +uint8_t ret=0; if (LOG_MSM5205) logerror("read from %04X return %02X\n",offset+0xc800,ret); @@ -392,7 +392,7 @@ WRITE8_MEMBER(mgavegas_state::cso2_w) READ8_MEMBER(mgavegas_state::ay8910_a_r) { - UINT8 ret=0xff; + uint8_t ret=0xff; ret=ioport("INA")->read(); @@ -404,7 +404,7 @@ READ8_MEMBER(mgavegas_state::ay8910_a_r) READ8_MEMBER(mgavegas_state::ay8910_b_r) { - UINT8 ret=0xff; + uint8_t ret=0xff; ret=ioport("DSW1")->read(); diff --git a/src/mame/drivers/mgolf.cpp b/src/mame/drivers/mgolf.cpp index 695fd81c85a..b7dda8a524a 100644 --- a/src/mame/drivers/mgolf.cpp +++ b/src/mame/drivers/mgolf.cpp @@ -32,14 +32,14 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; /* video-related */ tilemap_t* m_bg_tilemap; /* misc */ - UINT8 m_prev; - UINT8 m_mask; + uint8_t m_prev; + uint8_t m_mask; attotime m_time_pushed; attotime m_time_released; emu_timer *m_interrupt_timer; @@ -57,7 +57,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(mgolf); - 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); TIMER_CALLBACK_MEMBER(interrupt_callback); @@ -71,7 +71,7 @@ protected: TILE_GET_INFO_MEMBER(mgolf_state::get_tile_info) { - UINT8 code = m_video_ram[tile_index]; + uint8_t code = m_video_ram[tile_index]; SET_TILE_INFO_MEMBER(0, code, code >> 7, 0); } @@ -90,7 +90,7 @@ void mgolf_state::video_start() } -UINT32 mgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i; @@ -120,7 +120,7 @@ UINT32 mgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c void mgolf_state::update_plunger( ) { - UINT8 val = ioport("BUTTON")->read(); + uint8_t val = ioport("BUTTON")->read(); if (m_prev != val) { @@ -183,7 +183,7 @@ READ8_MEMBER(mgolf_state::wram_r) READ8_MEMBER(mgolf_state::dial_r) { - UINT8 val = ioport("41")->read(); + uint8_t val = ioport("41")->read(); if ((ioport("DIAL")->read() + 0x00) & 0x20) { @@ -202,7 +202,7 @@ READ8_MEMBER(mgolf_state::misc_r) { double plunger = calc_plunger_pos(); /* see Video Pinball */ - UINT8 val = ioport("61")->read(); + uint8_t val = ioport("61")->read(); if (plunger >= 0.000 && plunger <= 0.001) { diff --git a/src/mame/drivers/mice.cpp b/src/mame/drivers/mice.cpp index 35b9d870589..f3a868c04b6 100644 --- a/src/mame/drivers/mice.cpp +++ b/src/mame/drivers/mice.cpp @@ -37,14 +37,14 @@ public: DECLARE_READ8_MEMBER(port50_r); DECLARE_READ8_MEMBER(port51_r); DECLARE_WRITE8_MEMBER(kbd_put); - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; }; READ8_MEMBER( mice_state::port50_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/micral.cpp b/src/mame/drivers/micral.cpp index 3aca6e673ee..4c4600051b6 100644 --- a/src/mame/drivers/micral.cpp +++ b/src/mame/drivers/micral.cpp @@ -38,7 +38,7 @@ public: DECLARE_DRIVER_INIT(micral); DECLARE_MACHINE_RESET(micral); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: required_device m_maincpu; @@ -198,7 +198,7 @@ static INPUT_PORTS_START( micral ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) // ?? INPUT_PORTS_END -UINT32 micral_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t micral_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // for (int y = 0; y < 32*8; y++) // { @@ -206,13 +206,13 @@ UINT32 micral_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, // for (int sx = 0; sx < 64; sx++) // { -// UINT8 code = m_video_ram[offset++]; -// UINT8 attr = m_video_ram[offset++]; +// uint8_t code = m_video_ram[offset++]; +// uint8_t attr = m_video_ram[offset++]; // offs_t char_offs = ((code & 0x7f) << 3) | (y & 0x07); // if (BIT(code, 7)) char_offs = ((code & 0x7f) << 3) | ((y >> 1) & 0x07); -// UINT8 data = m_char_rom->base()[char_offs]; +// uint8_t data = m_char_rom->base()[char_offs]; // rgb_t fg = m_palette->pen_color(attr & 0x07); // rgb_t bg = m_palette->pen_color((attr >> 3) & 0x07); @@ -231,7 +231,7 @@ UINT32 micral_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, DRIVER_INIT_MEMBER( micral_state, micral ) { - //UINT8 *main = memregion("maincpu")->base(); + //uint8_t *main = memregion("maincpu")->base(); //membank("bankr0")->configure_entry(1, &main[0xf800]); //membank("bankr0")->configure_entry(0, &main[0x10000]); diff --git a/src/mame/drivers/microdec.cpp b/src/mame/drivers/microdec.cpp index 29cd9198146..b8a42c53e4f 100644 --- a/src/mame/drivers/microdec.cpp +++ b/src/mame/drivers/microdec.cpp @@ -57,8 +57,8 @@ public: DECLARE_WRITE8_MEMBER(portf8_w); DECLARE_DRIVER_INIT(microdec); private: - UINT8 m_term_data; - UINT8 m_portf8; + uint8_t m_term_data; + uint8_t m_portf8; bool m_fdc_rdy; virtual void machine_reset() override; virtual void machine_start() override; @@ -77,7 +77,7 @@ READ8_MEMBER( microdec_state::status_r ) READ8_MEMBER( microdec_state::keyin_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -91,7 +91,7 @@ READ8_MEMBER( microdec_state::portf5_r ) { m_fdc->set_ready_line_connected(m_fdc_rdy); - UINT8 data = m_portf8 | ioport("DIAG")->read() | 0xc0; + uint8_t data = m_portf8 | ioport("DIAG")->read() | 0xc0; return data; } @@ -194,7 +194,7 @@ SLOT_INTERFACE_END DRIVER_INIT_MEMBER( microdec_state, microdec ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x1000]); diff --git a/src/mame/drivers/microkit.cpp b/src/mame/drivers/microkit.cpp index ae4050b11a4..765c95e04db 100644 --- a/src/mame/drivers/microkit.cpp +++ b/src/mame/drivers/microkit.cpp @@ -55,8 +55,8 @@ public: private: virtual void machine_reset() override; - UINT8 m_resetcnt; - UINT8 m_ram_data; + uint8_t m_resetcnt; + uint8_t m_ram_data; required_device m_maincpu; required_device m_rs232; required_device m_terminal; diff --git a/src/mame/drivers/micronic.cpp b/src/mame/drivers/micronic.cpp index c11d541c198..cbbcd78e40d 100644 --- a/src/mame/drivers/micronic.cpp +++ b/src/mame/drivers/micronic.cpp @@ -119,9 +119,9 @@ READ8_MEMBER( micronic_state::keypad_r ) { - UINT8 data = 0; + uint8_t data = 0; - for (UINT8 bit = 0; bit < 8; bit++) + for (uint8_t bit = 0; bit < 8; bit++) { if (m_kp_matrix & (1 << bit)) { @@ -153,7 +153,7 @@ WRITE8_MEMBER( micronic_state::kp_matrix_w ) WRITE8_MEMBER( micronic_state::beep_w ) { - UINT16 frequency[16] = + uint16_t frequency[16] = { 0, 4000, 2000, 1333, 1000, 800, 667, 571, 500, 444, 400, 364, 333, 308, 286, 267 diff --git a/src/mame/drivers/micropin.cpp b/src/mame/drivers/micropin.cpp index 59b3a27b162..476ba8b7ed1 100644 --- a/src/mame/drivers/micropin.cpp +++ b/src/mame/drivers/micropin.cpp @@ -52,10 +52,10 @@ public: DECLARE_DRIVER_INIT(micropin); TIMER_DEVICE_CALLBACK_MEMBER(timer_a); private: - UINT8 m_row; - UINT8 m_counter; - UINT8 m_beep_time; - UINT8 m_led_time[8]; + uint8_t m_row; + uint8_t m_counter; + uint8_t m_beep_time; + uint8_t m_led_time[8]; virtual void machine_reset() override; optional_device m_v1cpu; optional_device m_v2cpu; @@ -188,7 +188,7 @@ WRITE8_MEMBER( micropin_state::p50a_w ) m_counter++; if (m_counter == 1) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7448 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7448 output().set_digit_value(m_row, patterns[data&15]); output().set_digit_value(m_row+20, patterns[data>>4]); } @@ -199,7 +199,7 @@ WRITE8_MEMBER( micropin_state::p50b_w ) m_counter++; if (m_counter == 2) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7448 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7448 output().set_digit_value(m_row+40, patterns[data&15]); output().set_digit_value(m_row+60, patterns[data>>4]); } @@ -224,7 +224,7 @@ WRITE_LINE_MEMBER( micropin_state::p50ca2_w ) // make the tones, and turn it off if no new commands arrive within .1 second. WRITE8_MEMBER( micropin_state::p51a_w ) { - static UINT16 frequency[16] = { 387, 435, 488, 517, 581, 652, 691, 775, 870, 977, 1035, 1161, 1304, 1381, 1550, 1740 }; + static uint16_t frequency[16] = { 387, 435, 488, 517, 581, 652, 691, 775, 870, 977, 1035, 1161, 1304, 1381, 1550, 1740 }; m_beep->set_clock(frequency[data & 15]); m_beep_time = 10; // number of 10ms intervals before it is silenced m_beep->set_state(1); @@ -248,7 +248,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( micropin_state::timer_a ) // turn off round leds that aren't being refreshed - UINT8 i; + uint8_t i; char wordnum[8]; for (i = 0; i < 8; i++) @@ -267,7 +267,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( micropin_state::timer_a ) void micropin_state::machine_reset() { - UINT8 i; + uint8_t i; m_row = 0; m_beep_time = 5; for (i = 0; i < 8; i++) diff --git a/src/mame/drivers/microvsn.cpp b/src/mame/drivers/microvsn.cpp index abf820992a4..038ecbeba7f 100644 --- a/src/mame/drivers/microvsn.cpp +++ b/src/mame/drivers/microvsn.cpp @@ -39,7 +39,7 @@ public: m_cart(*this, "cartslot") { } - 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); DECLARE_PALETTE_INIT(microvision); DECLARE_MACHINE_START(microvision); @@ -100,24 +100,24 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; // i8021 variables - UINT8 m_p0; - UINT8 m_p2; - UINT8 m_t1; + uint8_t m_p0; + uint8_t m_p2; + uint8_t m_t1; // tms1100 variables - UINT16 m_r; - UINT16 m_o; + uint16_t m_r; + uint16_t m_o; // generic variables void update_lcd(); - void lcd_write(UINT8 control, UINT8 data); + void lcd_write(uint8_t control, uint8_t data); bool m_pla; - UINT8 m_lcd_latch[8]; - UINT8 m_lcd_holding_latch[8]; - UINT8 m_lcd_latch_index; - UINT8 m_lcd[16][16]; - UINT8 m_lcd_control_old; + uint8_t m_lcd_latch[8]; + uint8_t m_lcd_holding_latch[8]; + uint8_t m_lcd_latch_index; + uint8_t m_lcd[16][16]; + uint8_t m_lcd_control_old; }; @@ -216,13 +216,13 @@ MACHINE_RESET_MEMBER(microvision_state, microvision) void microvision_state::update_lcd() { - UINT16 row = ( m_lcd_holding_latch[0] << 12 ) | ( m_lcd_holding_latch[1] << 8 ) | ( m_lcd_holding_latch[2] << 4 ) | m_lcd_holding_latch[3]; - UINT16 col = ( m_lcd_holding_latch[4] << 12 ) | ( m_lcd_holding_latch[5] << 8 ) | ( m_lcd_holding_latch[6] << 4 ) | m_lcd_holding_latch[7]; + uint16_t row = ( m_lcd_holding_latch[0] << 12 ) | ( m_lcd_holding_latch[1] << 8 ) | ( m_lcd_holding_latch[2] << 4 ) | m_lcd_holding_latch[3]; + uint16_t col = ( m_lcd_holding_latch[4] << 12 ) | ( m_lcd_holding_latch[5] << 8 ) | ( m_lcd_holding_latch[6] << 4 ) | m_lcd_holding_latch[7]; if (LOG) logerror("row = %04x, col = %04x\n", row, col ); for ( int i = 0; i < 16; i++ ) { - UINT16 temp = row; + uint16_t temp = row; for (auto & elem : m_lcd) { @@ -237,11 +237,11 @@ void microvision_state::update_lcd() } -UINT32 microvision_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t microvision_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - for ( UINT8 i = 0; i < 16; i++ ) + for ( uint8_t i = 0; i < 16; i++ ) { - for ( UINT8 j = 0; j < 16; j++ ) + for ( uint8_t j = 0; j < 16; j++ ) { bitmap.pix16(i,j) = m_lcd [i] [j]; } @@ -280,7 +280,7 @@ control is signals LCD5 LCD4 LCD0 = Data 3 data is signals LCD3 LCD2 LCD1 LCD0 */ -void microvision_state::lcd_write(UINT8 control, UINT8 data) +void microvision_state::lcd_write(uint8_t control, uint8_t data) { // Latch pulse, when high, resets the %8 latch address counter if ( control & 0x01 ) { @@ -380,7 +380,7 @@ WRITE8_MEMBER( microvision_state::i8021_p2_write ) else { // Start paddle timer (min is 160uS, max is 678uS) - UINT8 paddle = 255 - ioport("PADDLE")->read(); + uint8_t paddle = 255 - ioport("PADDLE")->read(); m_paddle_timer->adjust( attotime::from_usec(160 + ( 518 * paddle ) / 255 ) ); } } @@ -394,34 +394,34 @@ READ8_MEMBER( microvision_state::i8021_t1_read ) READ8_MEMBER( microvision_state::i8021_bus_read ) { - UINT8 data = m_p0; + uint8_t data = m_p0; - UINT8 col0 = ioport("COL0")->read(); - UINT8 col1 = ioport("COL1")->read(); - UINT8 col2 = ioport("COL2")->read(); + uint8_t col0 = ioport("COL0")->read(); + uint8_t col1 = ioport("COL1")->read(); + uint8_t col2 = ioport("COL2")->read(); // Row scanning if ( ! ( m_p0 & 0x80 ) ) { - UINT8 t = ( ( col0 & 0x01 ) << 2 ) | ( ( col1 & 0x01 ) << 1 ) | ( col2 & 0x01 ); + uint8_t t = ( ( col0 & 0x01 ) << 2 ) | ( ( col1 & 0x01 ) << 1 ) | ( col2 & 0x01 ); data &= ( t ^ 0xFF ); } if ( ! ( m_p0 & 0x40 ) ) { - UINT8 t = ( ( col0 & 0x02 ) << 1 ) | ( col1 & 0x02 ) | ( ( col2 & 0x02 ) >> 1 ); + uint8_t t = ( ( col0 & 0x02 ) << 1 ) | ( col1 & 0x02 ) | ( ( col2 & 0x02 ) >> 1 ); data &= ( t ^ 0xFF ); } if ( ! ( m_p0 & 0x20 ) ) { - UINT8 t = ( col0 & 0x04 ) | ( ( col1 & 0x04 ) >> 1 ) | ( ( col2 & 0x04 ) >> 2 ); + uint8_t t = ( col0 & 0x04 ) | ( ( col1 & 0x04 ) >> 1 ) | ( ( col2 & 0x04 ) >> 2 ); data &= ( t ^ 0xFF ); } if ( ! ( m_p0 & 0x10 ) ) { - UINT8 t = ( ( col0 & 0x08 ) >> 1 ) | ( ( col1 & 0x08 ) >> 2 ) | ( ( col2 & 0x08 ) >> 3 ); + uint8_t t = ( ( col0 & 0x08 ) >> 1 ) | ( ( col1 & 0x08 ) >> 2 ) | ( ( col2 & 0x08 ) >> 3 ); data &= ( t ^ 0xFF ); } @@ -431,7 +431,7 @@ READ8_MEMBER( microvision_state::i8021_bus_read ) READ8_MEMBER( microvision_state::tms1100_read_k ) { - UINT8 data = 0; + uint8_t data = 0; if (LOG) logerror("read_k\n"); @@ -481,7 +481,7 @@ WRITE16_MEMBER( microvision_state::tms1100_write_r ) } -static const UINT16 microvision_output_pla_0[0x20] = +static const uint16_t microvision_output_pla_0[0x20] = { /* O output PLA configuration currently unknown */ 0x00, 0x08, 0x04, 0x0C, 0x02, 0x0A, 0x06, 0x0E, @@ -491,7 +491,7 @@ static const UINT16 microvision_output_pla_0[0x20] = }; -static const UINT16 microvision_output_pla_1[0x20] = +static const uint16_t microvision_output_pla_1[0x20] = { /* O output PLA configuration currently unknown */ /* Reversed bit order */ @@ -504,9 +504,9 @@ static const UINT16 microvision_output_pla_1[0x20] = DEVICE_IMAGE_LOAD_MEMBER(microvision_state, microvsn_cart) { - UINT8 *rom1 = memregion("maincpu1")->base(); - UINT8 *rom2 = memregion("maincpu2")->base(); - UINT32 file_size = m_cart->common_get_size("rom"); + uint8_t *rom1 = memregion("maincpu1")->base(); + uint8_t *rom2 = memregion("maincpu2")->base(); + uint32_t file_size = m_cart->common_get_size("rom"); m_pla = 0; if ( file_size != 1024 && file_size != 2048 ) diff --git a/src/mame/drivers/midas.cpp b/src/mame/drivers/midas.cpp index 8fbe0890bef..e4a5b4aa61e 100644 --- a/src/mame/drivers/midas.cpp +++ b/src/mame/drivers/midas.cpp @@ -86,14 +86,14 @@ public: virtual void machine_reset() override; - UINT32 screen_update_midas(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_midas(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_eeprom; required_device m_gfxdecode; required_device m_palette; required_device m_sprgen; required_device m_screen; - required_shared_ptr m_zoomram; + required_shared_ptr m_zoomram; void screen_eof_midas(screen_device &screen, bool state); @@ -108,7 +108,7 @@ void midas_state::video_start() { } -UINT32 midas_state::screen_update_midas(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t midas_state::screen_update_midas(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // fill with background color first bitmap.fill(0x0, cliprect); @@ -161,7 +161,7 @@ WRITE16_MEMBER(midas_state::midas_gfxregs_w) WRITE16_MEMBER(midas_state::midas_zoomtable_w) { COMBINE_DATA(&m_zoomram[offset]); - UINT8 *rgn = memregion("zoomy")->base(); + uint8_t *rgn = memregion("zoomy")->base(); if (ACCESSING_BITS_0_7) { @@ -791,7 +791,7 @@ ROM_END DRIVER_INIT_MEMBER(midas_state,livequiz) { - UINT16 *rom = (UINT16 *) memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *) memregion("maincpu")->base(); // PROTECTION CHECKS rom[0x13345a/2] = 0x4e75; diff --git a/src/mame/drivers/midqslvr.cpp b/src/mame/drivers/midqslvr.cpp index 35dc9607862..eb7f3bba092 100644 --- a/src/mame/drivers/midqslvr.cpp +++ b/src/mame/drivers/midqslvr.cpp @@ -40,15 +40,15 @@ public: { } - std::unique_ptr m_bios_ram; - std::unique_ptr m_bios_ext1_ram; - std::unique_ptr m_bios_ext2_ram; - std::unique_ptr m_bios_ext3_ram; - std::unique_ptr m_bios_ext4_ram; - std::unique_ptr m_isa_ram1; - std::unique_ptr m_isa_ram2; - UINT8 m_mtxc_config_reg[256]; - UINT8 m_piix4_config_reg[4][256]; + std::unique_ptr m_bios_ram; + std::unique_ptr m_bios_ext1_ram; + std::unique_ptr m_bios_ext2_ram; + std::unique_ptr m_bios_ext3_ram; + std::unique_ptr m_bios_ext4_ram; + std::unique_ptr m_isa_ram1; + std::unique_ptr m_isa_ram2; + uint8_t m_mtxc_config_reg[256]; + uint8_t m_piix4_config_reg[4][256]; DECLARE_WRITE32_MEMBER( isa_ram1_w ); DECLARE_WRITE32_MEMBER( isa_ram2_w ); @@ -67,7 +67,7 @@ public: // Intel 82439TX System Controller (MTXC) -static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) { midqslvr_state *state = busdevice->machine().driver_data(); // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); @@ -78,7 +78,7 @@ static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, return state->m_mtxc_config_reg[reg]; } -static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { midqslvr_state *state = busdevice->machine().driver_data(); printf("MTXC: write %d, %02X, %02X\n", function, reg, data); @@ -170,9 +170,9 @@ void midqslvr_state::intel82439tx_init() m_mtxc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; @@ -192,7 +192,7 @@ static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -214,7 +214,7 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) -static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { midqslvr_state *state = busdevice->machine().driver_data(); address_space &space = state->m_maincpu->space( AS_PROGRAM ); @@ -226,14 +226,14 @@ static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, if(reg == 0xe) { - const UINT8 header_type_val[4] = { 0x80, 0x00, 0x00, 0x00 }; + const uint8_t header_type_val[4] = { 0x80, 0x00, 0x00, 0x00 }; return header_type_val[function]; } if((reg & 0xfc) == 0x8) { /* TODO: reg 8 indicates Revision ID */ - const UINT32 class_code_val[4] = { 0x06010000, 0x01018000, 0x0c030000, 0x06800000 }; + const uint32_t class_code_val[4] = { 0x06010000, 0x01018000, 0x0c030000, 0x06800000 }; return (((class_code_val[function]) >> (reg & 3)*8) & 0xff); } @@ -243,7 +243,7 @@ static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, return state->m_piix4_config_reg[function][reg]; } -static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { midqslvr_state *state = busdevice->machine().driver_data(); printf("PIIX4: write %d, %02X, %02X\n", function, reg, data); @@ -253,9 +253,9 @@ static void piix4_config_w(device_t *busdevice, device_t *device, int function, state->m_piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= piix4_config_r(busdevice, device, function, reg + 3) << 24; @@ -275,7 +275,7 @@ static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -385,13 +385,13 @@ ADDRESS_MAP_END void midqslvr_state::machine_start() { - m_bios_ram = std::make_unique(0x10000/4); - m_bios_ext1_ram = std::make_unique(0x4000/4); - m_bios_ext2_ram = std::make_unique(0x4000/4); - m_bios_ext3_ram = std::make_unique(0x4000/4); - m_bios_ext4_ram = std::make_unique(0x4000/4); - m_isa_ram1 = std::make_unique(0x4000/4); - m_isa_ram2 = std::make_unique(0x4000/4); + m_bios_ram = std::make_unique(0x10000/4); + m_bios_ext1_ram = std::make_unique(0x4000/4); + m_bios_ext2_ram = std::make_unique(0x4000/4); + m_bios_ext3_ram = std::make_unique(0x4000/4); + m_bios_ext4_ram = std::make_unique(0x4000/4); + m_isa_ram1 = std::make_unique(0x4000/4); + m_isa_ram2 = std::make_unique(0x4000/4); intel82439tx_init(); } diff --git a/src/mame/drivers/midvunit.cpp b/src/mame/drivers/midvunit.cpp index 4f9412873f6..0014ae286cd 100644 --- a/src/mame/drivers/midvunit.cpp +++ b/src/mame/drivers/midvunit.cpp @@ -97,8 +97,8 @@ MACHINE_RESET_MEMBER(midvunit_state,midvplus) READ32_MEMBER(midvunit_state::port0_r) { - UINT16 val = ioport("IN0")->read(); - UINT16 diff = val ^ m_last_port0; + uint16_t val = ioport("IN0")->read(); + uint16_t diff = val ^ m_last_port0; /* make sure the shift controls are mutually exclusive */ if ((diff & 0x0400) && !(val & 0x0400)) @@ -187,7 +187,7 @@ READ32_MEMBER(midvunit_state::midvunit_cmos_r) WRITE32_MEMBER(midvunit_state::midvunit_control_w) { - UINT16 olddata = m_control_data; + uint16_t olddata = m_control_data; COMBINE_DATA(&m_control_data); /* bit 7 is the LED */ @@ -207,7 +207,7 @@ WRITE32_MEMBER(midvunit_state::midvunit_control_w) WRITE32_MEMBER(midvunit_state::crusnwld_control_w) { - UINT16 olddata = m_control_data; + uint16_t olddata = m_control_data; COMBINE_DATA(&m_control_data); /* bit 11 is the DCS sound reset */ @@ -246,7 +246,7 @@ READ32_MEMBER(midvunit_state::tms32031_control_r) { /* timer is clocked at 100ns */ int which = (offset >> 4) & 1; - INT32 result = (m_timer[which]->time_elapsed() * m_timer_rate).as_double(); + int32_t result = (m_timer[which]->time_elapsed() * m_timer_rate).as_double(); // logerror("%06X:tms32031_control_r(%02X) = %08X\n", space.device().safe_pc(), offset, result); return result; } @@ -325,7 +325,7 @@ WRITE32_MEMBER(midvunit_state::crusnwld_serial_data_w) *************************************/ /* values from offset 3, 6, and 10 must add up to 0x904752a2 */ -static const UINT32 bit_data[0x10] = +static const uint32_t bit_data[0x10] = { 0x3017c636,0x3017c636,0x3017c636,0x3017c636, 0x3017c636,0x3017c636,0x3017c636,0x3017c636, @@ -387,8 +387,8 @@ void midvunit_state::set_input(const char *s) WRITE32_MEMBER(midvunit_state::midvunit_output_w) { - UINT8 op = (data >> 8) & 0xF; - UINT8 arg = data & 0xFF; + uint8_t op = (data >> 8) & 0xF; + uint8_t arg = data & 0xFF; switch (op) { default: @@ -419,7 +419,7 @@ WRITE32_MEMBER(midvunit_state::midvunit_output_w) break; case 0x05: - for (UINT8 bit = 0; bit < 8; bit++) + for (uint8_t bit = 0; bit < 8; bit++) output().set_lamp_value(bit, (arg >> bit) & 0x1); break; @@ -494,7 +494,7 @@ WRITE32_MEMBER(midvunit_state::midvunit_output_w) READ32_MEMBER(midvunit_state::midvplus_misc_r) { - UINT32 result = m_midvplus_misc[offset]; + uint32_t result = m_midvplus_misc[offset]; switch (offset) { @@ -519,7 +519,7 @@ READ32_MEMBER(midvunit_state::midvplus_misc_r) WRITE32_MEMBER(midvunit_state::midvplus_misc_w) { - UINT32 olddata = m_midvplus_misc[offset]; + uint32_t olddata = m_midvplus_misc[offset]; int logit = 1; COMBINE_DATA(&m_midvplus_misc[offset]); @@ -1903,7 +1903,7 @@ DRIVER_INIT_MEMBER(midvunit_state,offroadc) DRIVER_INIT_MEMBER(midvunit_state,wargods) { - UINT8 default_nvram[256]; + uint8_t default_nvram[256]; /* initialize the subsystems */ m_adc_shift = 16; diff --git a/src/mame/drivers/midzeus.cpp b/src/mame/drivers/midzeus.cpp index 1680726be6c..057259dc562 100644 --- a/src/mame/drivers/midzeus.cpp +++ b/src/mame/drivers/midzeus.cpp @@ -44,16 +44,16 @@ The Grid v1.2 10/18/2000 #define BEAM_DX 3 #define BEAM_XOFFS 40 /* table in the code indicates an offset of 20 with a beam height of 7 */ -static UINT32 gun_control; -static UINT8 gun_irq_state; +static uint32_t gun_control; +static uint8_t gun_irq_state; static emu_timer * gun_timer[2]; -static INT32 gun_x[2], gun_y[2]; +static int32_t gun_x[2], gun_y[2]; -static UINT8 crusnexo_leds_select; -static UINT8 keypad_select; -static UINT8 bitlatch[10]; +static uint8_t crusnexo_leds_select; +static uint8_t keypad_select; +static uint8_t bitlatch[10]; -static UINT8 cmos_protected; +static uint8_t cmos_protected; static emu_timer *timer[2]; @@ -246,7 +246,7 @@ READ32_MEMBER(midzeus_state::bitlatches_r) WRITE32_MEMBER(midzeus_state::bitlatches_w) { - UINT32 oldval = bitlatch[offset]; + uint32_t oldval = bitlatch[offset]; bitlatch[offset] = data; switch (offset) @@ -400,7 +400,7 @@ READ32_MEMBER(midzeus_state::tms32031_control_r) { /* timer is clocked at 100ns */ int which = (offset >> 4) & 1; - INT32 result = (timer[which]->elapsed() * 10000000).as_double(); + int32_t result = (timer[which]->elapsed() * 10000000).as_double(); return result; } @@ -441,7 +441,7 @@ WRITE32_MEMBER(midzeus_state::tms32031_control_w) CUSTOM_INPUT_MEMBER(midzeus_state::custom_49way_r) { - static const UINT8 translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 }; + static const uint8_t translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 }; const char *namex = (const char *)param; const char *namey = namex + strlen(namex) + 1; return (translate49[ioport(namey)->read() >> 4] << 4) | translate49[ioport(namex)->read() >> 4]; @@ -457,8 +457,8 @@ WRITE32_MEMBER(midzeus_state::keypad_select_w) CUSTOM_INPUT_MEMBER(midzeus_state::keypad_r) { - UINT32 bits = ioport((const char *)param)->read(); - UINT8 select = keypad_select; + uint32_t bits = ioport((const char *)param)->read(); + uint8_t select = keypad_select; while ((select & 1) != 0) { select >>= 1; @@ -525,7 +525,7 @@ TIMER_CALLBACK_MEMBER(midzeus_state::invasn_gun_callback) WRITE32_MEMBER(midzeus_state::invasn_gun_w) { - UINT32 old_control = gun_control; + uint32_t old_control = gun_control; int player; COMBINE_DATA(&gun_control); @@ -537,7 +537,7 @@ WRITE32_MEMBER(midzeus_state::invasn_gun_w) for (player = 0; player < 2; player++) { - UINT8 pmask = 0x04 << player; + uint8_t pmask = 0x04 << player; if (((old_control ^ gun_control) & pmask) != 0 && (gun_control & pmask) == 0) { const rectangle &visarea = m_screen->visible_area(); @@ -558,7 +558,7 @@ READ32_MEMBER(midzeus_state::invasn_gun_r) { int beamx = m_screen->hpos(); int beamy = m_screen->vpos(); - UINT32 result = 0xffff; + uint32_t result = 0xffff; int player; for (player = 0; player < 2; player++) diff --git a/src/mame/drivers/mikromik.cpp b/src/mame/drivers/mikromik.cpp index 79741fc137a..2de2afac5e6 100644 --- a/src/mame/drivers/mikromik.cpp +++ b/src/mame/drivers/mikromik.cpp @@ -81,8 +81,8 @@ READ8_MEMBER( mm1_state::read ) { - UINT8 data = 0; - UINT8 mmu = m_mmu_rom->base()[(m_a8 << 8) | (offset >> 8)]; + uint8_t data = 0; + uint8_t mmu = m_mmu_rom->base()[(m_a8 << 8) | (offset >> 8)]; if (mmu & MMU_IOEN) { @@ -151,7 +151,7 @@ READ8_MEMBER( mm1_state::read ) WRITE8_MEMBER( mm1_state::write ) { - UINT8 mmu = m_mmu_rom->base()[(m_a8 << 8) | (offset >> 8)]; + uint8_t mmu = m_mmu_rom->base()[(m_a8 << 8) | (offset >> 8)]; if (mmu & MMU_IOEN) { diff --git a/src/mame/drivers/mikrosha.cpp b/src/mame/drivers/mikrosha.cpp index fa92fd38d6c..d94a0387fc6 100644 --- a/src/mame/drivers/mikrosha.cpp +++ b/src/mame/drivers/mikrosha.cpp @@ -160,8 +160,8 @@ I8275_DRAW_CHARACTER_MEMBER(mikrosha_state::display_pixels) { int i; const rgb_t *palette = m_palette->palette()->entry_list_raw(); - const UINT8 *charmap = m_charmap + (m_mikrosha_font_page & 1) * 0x400; - UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; + const uint8_t *charmap = m_charmap + (m_mikrosha_font_page & 1) * 0x400; + uint8_t pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; if(linecount == 8) pixels = 0; if (vsp) { diff --git a/src/mame/drivers/mil4000.cpp b/src/mame/drivers/mil4000.cpp index f7d9ea479a2..1de41c22541 100644 --- a/src/mame/drivers/mil4000.cpp +++ b/src/mame/drivers/mil4000.cpp @@ -132,18 +132,18 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_sc0_vram; - required_shared_ptr m_sc1_vram; - required_shared_ptr m_sc2_vram; - required_shared_ptr m_sc3_vram; + required_shared_ptr m_sc0_vram; + required_shared_ptr m_sc1_vram; + required_shared_ptr m_sc2_vram; + required_shared_ptr m_sc3_vram; tilemap_t *m_sc0_tilemap; tilemap_t *m_sc1_tilemap; tilemap_t *m_sc2_tilemap; tilemap_t *m_sc3_tilemap; - UINT16 m_vblank; - UINT16 m_hblank; - UINT8 mcucomm; - UINT8 mcudata; + uint16_t m_vblank; + uint16_t m_hblank; + uint8_t mcucomm; + uint8_t mcudata; DECLARE_READ16_MEMBER(hvretrace_r); DECLARE_READ16_MEMBER(unk_r); DECLARE_READ16_MEMBER(chewheel_mcu_r); @@ -159,7 +159,7 @@ public: TILE_GET_INFO_MEMBER(get_sc2_tile_info); TILE_GET_INFO_MEMBER(get_sc3_tile_info); virtual void video_start() override; - UINT32 screen_update_mil4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mil4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -167,7 +167,7 @@ public: TILE_GET_INFO_MEMBER(mil4000_state::get_sc0_tile_info) { - UINT32 data = (m_sc0_vram[tile_index*2]<<16) | m_sc0_vram[tile_index*2+1]; + uint32_t data = (m_sc0_vram[tile_index*2]<<16) | m_sc0_vram[tile_index*2+1]; int tile = data >> 14; int color = (m_sc0_vram[tile_index*2+1] & 0x1f)+0; @@ -179,7 +179,7 @@ TILE_GET_INFO_MEMBER(mil4000_state::get_sc0_tile_info) TILE_GET_INFO_MEMBER(mil4000_state::get_sc1_tile_info) { - UINT32 data = (m_sc1_vram[tile_index*2]<<16) | m_sc1_vram[tile_index*2+1]; + uint32_t data = (m_sc1_vram[tile_index*2]<<16) | m_sc1_vram[tile_index*2+1]; int tile = data >> 14; int color = (m_sc1_vram[tile_index*2+1] & 0x1f)+0x10; @@ -191,7 +191,7 @@ TILE_GET_INFO_MEMBER(mil4000_state::get_sc1_tile_info) TILE_GET_INFO_MEMBER(mil4000_state::get_sc2_tile_info) { - UINT32 data = (m_sc2_vram[tile_index*2]<<16) | m_sc2_vram[tile_index*2+1]; + uint32_t data = (m_sc2_vram[tile_index*2]<<16) | m_sc2_vram[tile_index*2+1]; int tile = data >> 14; int color = (m_sc2_vram[tile_index*2+1] & 0x1f)+0x20; @@ -203,7 +203,7 @@ TILE_GET_INFO_MEMBER(mil4000_state::get_sc2_tile_info) TILE_GET_INFO_MEMBER(mil4000_state::get_sc3_tile_info) { - UINT32 data = (m_sc3_vram[tile_index*2]<<16) | m_sc3_vram[tile_index*2+1]; + uint32_t data = (m_sc3_vram[tile_index*2]<<16) | m_sc3_vram[tile_index*2+1]; int tile = data >> 14; int color = (m_sc3_vram[tile_index*2+1] & 0x1f)+0x30; @@ -225,7 +225,7 @@ void mil4000_state::video_start() m_sc3_tilemap->set_transparent_pen(0); } -UINT32 mil4000_state::screen_update_mil4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mil4000_state::screen_update_mil4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0); m_sc1_tilemap->draw(screen, bitmap, cliprect, 0,0); @@ -237,7 +237,7 @@ UINT32 mil4000_state::screen_update_mil4000(screen_device &screen, bitmap_ind16 /*TODO*/ READ16_MEMBER(mil4000_state::hvretrace_r) { - UINT16 res; + uint16_t res; res = 0; diff --git a/src/mame/drivers/mini2440.cpp b/src/mame/drivers/mini2440.cpp index afc143249d8..0db2d8acbac 100644 --- a/src/mame/drivers/mini2440.cpp +++ b/src/mame/drivers/mini2440.cpp @@ -37,7 +37,7 @@ public: required_ioport m_penx; required_ioport m_peny; - UINT32 m_port[9]; + uint32_t m_port[9]; DECLARE_DRIVER_INIT(mini2440); virtual void machine_start() override; virtual void machine_reset() override; @@ -76,7 +76,7 @@ inline void mini2440_state::verboselog(int n_level, const char *s_fmt, ...) READ32_MEMBER(mini2440_state::s3c2440_gpio_port_r) { - UINT32 data = m_port[offset]; + uint32_t data = m_port[offset]; switch (offset) { case S3C2440_GPIO_PORT_G : @@ -168,7 +168,7 @@ WRITE16_MEMBER(mini2440_state::s3c2440_i2s_data_w ) READ32_MEMBER(mini2440_state::s3c2440_adc_data_r ) { - UINT32 data = 0; + uint32_t data = 0; switch (offset) { case 2 + 0 : data = m_penx->read(); break; diff --git a/src/mame/drivers/miniboy7.cpp b/src/mame/drivers/miniboy7.cpp index 1f1f53dfa55..e8f71329de4 100644 --- a/src/mame/drivers/miniboy7.cpp +++ b/src/mame/drivers/miniboy7.cpp @@ -162,13 +162,13 @@ public: m_palette(*this, "palette"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram_a; - required_shared_ptr m_colorram_a; - required_shared_ptr m_videoram_b; - required_shared_ptr m_colorram_b; - required_region_ptr m_gfx1; - required_region_ptr m_gfx2; - required_region_ptr m_proms; + required_shared_ptr m_videoram_a; + required_shared_ptr m_colorram_a; + required_shared_ptr m_videoram_b; + required_shared_ptr m_colorram_b; + required_region_ptr m_gfx1; + required_region_ptr m_gfx2; + required_region_ptr m_proms; required_ioport m_input2; required_ioport m_dsw2; required_device m_maincpu; @@ -182,12 +182,12 @@ public: void machine_reset() override; - int get_color_offset(UINT8 tile, UINT8 attr, int ra, int px); + int get_color_offset(uint8_t tile, uint8_t attr, int ra, int px); MC6845_UPDATE_ROW(crtc_update_row); DECLARE_PALETTE_INIT(miniboy7); private: - UINT8 m_ay_pb; + uint8_t m_ay_pb; int m_gpri; }; @@ -196,7 +196,7 @@ private: * Video Hardware * ***********************************/ -int miniboy7_state::get_color_offset(UINT8 tile, UINT8 attr, int ra, int px) +int miniboy7_state::get_color_offset(uint8_t tile, uint8_t attr, int ra, int px) { /* - bits - 7654 3210 @@ -209,16 +209,16 @@ int miniboy7_state::get_color_offset(UINT8 tile, UINT8 attr, int ra, int px) if (attr & 0x04) { int bank = (attr & 0x03) << 8; - UINT8 bitplane0 = m_gfx2[0x0000 + ((tile + bank) << 3) + ra]; - UINT8 bitplane1 = m_gfx2[0x2000 + ((tile + bank) << 3) + ra]; - UINT8 bitplane2 = m_gfx2[0x4000 + ((tile + bank) << 3) + ra]; + uint8_t bitplane0 = m_gfx2[0x0000 + ((tile + bank) << 3) + ra]; + uint8_t bitplane1 = m_gfx2[0x2000 + ((tile + bank) << 3) + ra]; + uint8_t bitplane2 = m_gfx2[0x4000 + ((tile + bank) << 3) + ra]; return (color << 3) + ((BIT(bitplane0 << px, 7) << 0) | (BIT(bitplane1 << px, 7) << 1) | (BIT(bitplane2 << px, 7) << 2)); } else { int bank = (attr & 0x01) << 8; - UINT8 bitplane0 = m_gfx1[((tile + bank) << 3) + ra]; + uint8_t bitplane0 = m_gfx1[((tile + bank) << 3) + ra]; return (color << 3) + BIT(bitplane0 << px, 7); } } @@ -227,14 +227,14 @@ MC6845_UPDATE_ROW( miniboy7_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - for (UINT8 cx = 0; cx < x_count; cx+=1) + for (uint8_t cx = 0; cx < x_count; cx+=1) { for (int px = 0; px < 8; px++) { int offset_a = (m_gpri ? 0x80 : 0) + get_color_offset(m_videoram_a[ma + cx], m_colorram_a[ma + cx], ra, px); int offset_b = (m_gpri ? 0 : 0x80) + get_color_offset(m_videoram_b[ma + cx], m_colorram_b[ma + cx], ra, px); - UINT8 color_a = m_proms[offset_a] & 0x0f; - UINT8 color_b = m_proms[offset_b] & 0x0f; + uint8_t color_a = m_proms[offset_a] & 0x0f; + uint8_t color_b = m_proms[offset_b] & 0x0f; if (color_a && (m_gpri || !color_b)) // videoram A has priority bitmap.pix32(y, (cx << 3) + px) = palette[offset_a]; diff --git a/src/mame/drivers/minicom.cpp b/src/mame/drivers/minicom.cpp index 56a1ca2d0c9..a1695237b4a 100644 --- a/src/mame/drivers/minicom.cpp +++ b/src/mame/drivers/minicom.cpp @@ -56,8 +56,8 @@ public: DECLARE_READ8_MEMBER(minicom_io_r); DECLARE_DRIVER_INIT(minicom); private: - UINT8 m_p[4]; - UINT16 m_display_data; + uint8_t m_p[4]; + uint16_t m_display_data; int m_digit_index; virtual void machine_start() override; virtual void machine_reset() override; @@ -111,7 +111,7 @@ READ8_MEMBER(minicom_state::minicom_io_r) } #if LOG_IO_PORTS -static void printbits(UINT8 v) { +static void printbits(uint8_t v) { int i; for(i = 7; i >= 0; i--) putchar('0' + ((v >> i) & 1)); } @@ -150,7 +150,7 @@ WRITE8_MEMBER(minicom_state::minicom_io_w) if (data != m_p[offset]) { #if LOG_IO_PORTS - UINT8 changed = m_p[offset] ^ data; + uint8_t changed = m_p[offset] ^ data; if (changed ^ P1_UNKNOWN_BITS) { printf("Write to P1: %02X changed: ( ) (", data); @@ -172,7 +172,7 @@ WRITE8_MEMBER(minicom_state::minicom_io_w) if (data != m_p[offset]) { #if LOG_IO_PORTS - UINT8 changed = m_p[offset] ^ data; + uint8_t changed = m_p[offset] ^ data; if (changed ^ P2_UNKNOWN_BITS) { printf("Write to P2: %02X changed: ( ) ( ) (", data); @@ -188,7 +188,7 @@ WRITE8_MEMBER(minicom_state::minicom_io_w) { if (data != m_p[offset]) { - UINT8 changed = m_p[offset] ^ data; + uint8_t changed = m_p[offset] ^ data; #if LOG_IO_PORTS if (changed ^ P3_UNKNOWN_BITS) { diff --git a/src/mame/drivers/minivadr.cpp b/src/mame/drivers/minivadr.cpp index 6d847f5468f..0add43544fd 100644 --- a/src/mame/drivers/minivadr.cpp +++ b/src/mame/drivers/minivadr.cpp @@ -47,8 +47,8 @@ public: m_maincpu(*this, "maincpu") { } /* memory pointers */ - required_shared_ptr m_videoram; - UINT32 screen_update_minivadr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + required_shared_ptr m_videoram; + uint32_t screen_update_minivadr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -58,7 +58,7 @@ public: * *************************************/ -UINT32 minivadr_state::screen_update_minivadr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t minivadr_state::screen_update_minivadr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -66,9 +66,9 @@ UINT32 minivadr_state::screen_update_minivadr(screen_device &screen, bitmap_rgb3 { int i; - UINT8 x = offs << 3; + uint8_t x = offs << 3; int y = offs >> 5; - UINT8 data = m_videoram[offs]; + uint8_t data = m_videoram[offs]; for (i = 0; i < 8; i++) { diff --git a/src/mame/drivers/mirage.cpp b/src/mame/drivers/mirage.cpp index db587ab14b9..ebb325659ab 100644 --- a/src/mame/drivers/mirage.cpp +++ b/src/mame/drivers/mirage.cpp @@ -60,7 +60,7 @@ public: /* misc */ - UINT8 m_mux_data; + uint8_t m_mux_data; /* devices */ required_device m_maincpu; @@ -69,8 +69,8 @@ public: required_device m_oki_bgm; required_device m_spriteram; /* memory pointers */ - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; optional_device m_sprgen; DECLARE_WRITE16_MEMBER(mirage_mux_w); @@ -81,7 +81,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECO16IC_BANK_CB_MEMBER(bank_callback); }; @@ -90,10 +90,10 @@ void miragemi_state::video_start() m_sprgen->alloc_sprite_bitmap(); } -UINT32 miragemi_state::screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t miragemi_state::screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { address_space &space = machine().driver_data()->generic_space(); - UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); diff --git a/src/mame/drivers/mirax.cpp b/src/mame/drivers/mirax.cpp index c4b11028968..01ca6221106 100644 --- a/src/mame/drivers/mirax.cpp +++ b/src/mame/drivers/mirax.cpp @@ -126,14 +126,14 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; - UINT8 m_nAyCtrl; - UINT8 m_nmi_mask; - UINT8 m_flipscreen_x; - UINT8 m_flipscreen_y; + uint8_t m_nAyCtrl; + uint8_t m_nmi_mask; + uint8_t m_flipscreen_x; + uint8_t m_flipscreen_y; DECLARE_WRITE8_MEMBER(audio_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); @@ -148,8 +148,8 @@ public: DECLARE_PALETTE_INIT(mirax); virtual void machine_start() override; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 draw_flag); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t draw_flag); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); @@ -158,7 +158,7 @@ public: PALETTE_INIT_MEMBER(mirax_state, mirax) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0;i < palette.entries();i++) @@ -185,7 +185,7 @@ PALETTE_INIT_MEMBER(mirax_state, mirax) } -void mirax_state::draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 draw_flag) +void mirax_state::draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t draw_flag) { gfx_element *gfx = m_gfxdecode->gfx(0); int y,x; @@ -238,7 +238,7 @@ void mirax_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) } } -UINT32 mirax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mirax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { draw_tilemap(bitmap,cliprect,1); draw_sprites(bitmap,cliprect); @@ -568,8 +568,8 @@ ROM_END DRIVER_INIT_MEMBER(mirax_state,mirax) { - UINT8 *DATA = memregion("data_code")->base(); - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *DATA = memregion("data_code")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; for(i=0x0000;i<0x4000;i++) diff --git a/src/mame/drivers/missb2.cpp b/src/mame/drivers/missb2.cpp index fe21c075f7f..25571d051cd 100644 --- a/src/mame/drivers/missb2.cpp +++ b/src/mame/drivers/missb2.cpp @@ -33,28 +33,28 @@ public: m_bgpalette(*this, "bgpalette") { } - required_shared_ptr m_bgvram; + required_shared_ptr m_bgvram; required_device m_bgpalette; DECLARE_WRITE8_MEMBER(missb2_bg_bank_w); DECLARE_WRITE_LINE_MEMBER(irqhandler); DECLARE_DRIVER_INIT(missb2); DECLARE_MACHINE_START(missb2); DECLARE_MACHINE_RESET(missb2); - UINT32 screen_update_missb2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_missb2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void configure_banks(); }; /* Video Hardware */ -UINT32 missb2_state::screen_update_missb2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t missb2_state::screen_update_missb2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int offs; int sx, sy, xc, yc; int gfx_num, gfx_attr, gfx_offs; - const UINT8 *prom; - const UINT8 *prom_line; - UINT16 bg_offs; + const uint8_t *prom; + const uint8_t *prom_line; + uint16_t bg_offs; /* Bubble Bobble doesn't have a real video RAM. All graphics (characters */ /* and sprites) are stored in the same memory region, and information on */ @@ -83,9 +83,9 @@ UINT32 missb2_state::screen_update_missb2(screen_device &screen, bitmap_rgb32 &b for (offs = 0; offs < m_objectram.bytes(); offs += 4) { /* skip empty sprites */ - /* this is dword aligned so the UINT32 * cast shouldn't give problems */ + /* this is dword aligned so the uint32_t * cast shouldn't give problems */ /* on any architecture */ - if (*(UINT32 *)(&m_objectram[offs]) == 0) + if (*(uint32_t *)(&m_objectram[offs]) == 0) continue; gfx_num = m_objectram[offs + 1]; @@ -286,7 +286,7 @@ static const gfx_layout charlayout = 16*8 }; -static const UINT32 bglayout_xoffset[256] = +static const uint32_t bglayout_xoffset[256] = { 0*8, 1*8, 2048*8, 2049*8, 8*8, 9*8, 2056*8, 2057*8, 4*8, 5*8, 2052*8, 2053*8, 12*8, 13*8, 2060*8, 2061*8, @@ -335,7 +335,7 @@ static const gfx_layout bglayout = nullptr }; -static const UINT32 bglayout_xoffset_alt[256] = +static const uint32_t bglayout_xoffset_alt[256] = { (256*0+0)*8 , (256*0+1)*8 , (256*0+2)*8 , (256*0+3)*8 , (256*0+4)*8 , (256*0+5)*8 , (256*0+6)*8 , (256*0+7)*8, (256*0+8)*8 , (256*0+9)*8 , (256*0+10)*8, (256*0+11)*8, (256*0+12)*8, (256*0+13)*8, (256*0+14)*8, (256*0+15)*8, @@ -559,8 +559,8 @@ ROM_END void missb2_state::configure_banks() { - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 *SLAVE = memregion("slave")->base(); + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *SLAVE = memregion("slave")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/missile.cpp b/src/mame/drivers/missile.cpp index c83947bcf8a..b0268101d15 100644 --- a/src/mame/drivers/missile.cpp +++ b/src/mame/drivers/missile.cpp @@ -377,7 +377,7 @@ public: { } required_device m_maincpu; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_watchdog; required_device m_pokey; required_ioport m_in0; @@ -391,14 +391,14 @@ public: required_device m_screen; required_device m_palette; - const UINT8 *m_mainrom; - const UINT8 *m_writeprom; + const uint8_t *m_mainrom; + const uint8_t *m_writeprom; emu_timer *m_irq_timer; emu_timer *m_cpu_timer; - UINT8 m_irq_state; - UINT8 m_ctrld; - UINT8 m_flipscreen; - UINT64 m_madsel_lastcycles; + uint8_t m_irq_state; + uint8_t m_ctrld; + uint8_t m_flipscreen; + uint64_t m_madsel_lastcycles; DECLARE_WRITE8_MEMBER(missile_w); DECLARE_READ8_MEMBER(missile_r); @@ -407,15 +407,15 @@ public: DECLARE_DRIVER_INIT(suprmatk); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_missile(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_missile(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); inline int scanline_to_v(int scanline); inline int v_to_scanline(int v); inline void schedule_next_irq(int curv); inline bool get_madsel(); inline offs_t get_bit3_addr(offs_t pixaddr); - void write_vram(address_space &space, offs_t address, UINT8 data); - UINT8 read_vram(address_space &space, offs_t address); + void write_vram(address_space &space, offs_t address, uint8_t data); + uint8_t read_vram(address_space &space, offs_t address); TIMER_CALLBACK_MEMBER(clock_irq); TIMER_CALLBACK_MEMBER(adjust_cpu_speed); @@ -589,12 +589,12 @@ offs_t missile_state::get_bit3_addr(offs_t pixaddr) } -void missile_state::write_vram(address_space &space, offs_t address, UINT8 data) +void missile_state::write_vram(address_space &space, offs_t address, uint8_t data) { - static const UINT8 data_lookup[4] = { 0x00, 0x0f, 0xf0, 0xff }; + static const uint8_t data_lookup[4] = { 0x00, 0x0f, 0xf0, 0xff }; offs_t vramaddr; - UINT8 vramdata; - UINT8 vrammask; + uint8_t vramdata; + uint8_t vrammask; /* basic 2 bit VRAM writes go to addr >> 2 */ /* data comes from bits 6 and 7 */ @@ -619,12 +619,12 @@ void missile_state::write_vram(address_space &space, offs_t address, UINT8 data) } -UINT8 missile_state::read_vram(address_space &space, offs_t address) +uint8_t missile_state::read_vram(address_space &space, offs_t address) { offs_t vramaddr; - UINT8 vramdata; - UINT8 vrammask; - UINT8 result = 0xff; + uint8_t vramdata; + uint8_t vrammask; + uint8_t result = 0xff; /* basic 2 bit VRAM reads go to addr >> 2 */ /* data goes to bits 6 and 7 */ @@ -661,19 +661,19 @@ UINT8 missile_state::read_vram(address_space &space, offs_t address) * *************************************/ -UINT32 missile_state::screen_update_missile(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t missile_state::screen_update_missile(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int x, y; /* draw the bitmap to the screen, looping over Y */ for (y = cliprect.min_y; y <= cliprect.max_y; y++) { - UINT16 *dst = &bitmap.pix16(y); + uint16_t *dst = &bitmap.pix16(y); int effy = m_flipscreen ? ((256+24 - y) & 0xff) : y; - UINT8 *src = &videoram[effy * 64]; - UINT8 *src3 = nullptr; + uint8_t *src = &videoram[effy * 64]; + uint8_t *src3 = nullptr; /* compute the base of the 3rd pixel row */ if (effy >= 224) @@ -682,7 +682,7 @@ UINT32 missile_state::screen_update_missile(screen_device &screen, bitmap_ind16 /* loop over X */ for (x = cliprect.min_x; x <= cliprect.max_x; x++) { - UINT8 pix = src[x / 4] >> (x & 3); + uint8_t pix = src[x / 4] >> (x & 3); pix = ((pix >> 2) & 4) | ((pix << 1) & 2); /* if we're in the lower region, get the 3rd bit */ @@ -705,7 +705,7 @@ UINT32 missile_state::screen_update_missile(screen_device &screen, bitmap_ind16 WRITE8_MEMBER(missile_state::missile_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; /* if this is a MADSEL cycle, write to video RAM */ if (get_madsel()) @@ -765,8 +765,8 @@ WRITE8_MEMBER(missile_state::missile_w) READ8_MEMBER(missile_state::missile_r) { - UINT8 *videoram = m_videoram; - UINT8 result = 0xff; + uint8_t *videoram = m_videoram; + uint8_t result = 0xff; /* if this is a MADSEL cycle, read from video RAM */ if (get_madsel()) @@ -1212,7 +1212,7 @@ ROM_END DRIVER_INIT_MEMBER(missile_state,suprmatk) { int i; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (i = 0; i < 0x40; i++) { @@ -1285,8 +1285,8 @@ DRIVER_INIT_MEMBER(missile_state,suprmatk) DRIVER_INIT_MEMBER(missile_state,missilem) { - UINT8 *src = memregion("user1")->base(); - UINT8 *dest = memregion("maincpu")->base(); + uint8_t *src = memregion("user1")->base(); + uint8_t *dest = memregion("maincpu")->base(); // decrypt rom and put in maincpu region (result looks correct, but is untested) for (int i = 0; i < 0x10000; i++) diff --git a/src/mame/drivers/mitchell.cpp b/src/mame/drivers/mitchell.cpp index a92ee546a95..a3a0ad9a0b6 100644 --- a/src/mame/drivers/mitchell.cpp +++ b/src/mame/drivers/mitchell.cpp @@ -2175,11 +2175,11 @@ void mitchell_state::bootleg_decode() } -void mitchell_state::configure_banks(void (*decode)(UINT8 *src, UINT8 *dst, int size)) +void mitchell_state::configure_banks(void (*decode)(uint8_t *src, uint8_t *dst, int size)) { - UINT8 *src = memregion("maincpu")->base(); + uint8_t *src = memregion("maincpu")->base(); int size = memregion("maincpu")->bytes(); - UINT8 *dst = auto_alloc_array(machine(), UINT8, size); + uint8_t *dst = auto_alloc_array(machine(), uint8_t, size); decode(src, dst, size); m_bank1->configure_entries(0, 16, src + 0x10000, 0x4000); m_bank0d->set_base(dst); @@ -2295,8 +2295,8 @@ DRIVER_INIT_MEMBER(mitchell_state,mstworld) { /* descramble the program rom .. */ int len = memregion("maincpu")->bytes(); - std::vector source(len); - UINT8* dst = memregion("maincpu")->base() ; + std::vector source(len); + uint8_t* dst = memregion("maincpu")->base() ; int x; static const int tablebank[]= diff --git a/src/mame/drivers/mits680b.cpp b/src/mame/drivers/mits680b.cpp index d42017d240e..b7dac966cc9 100644 --- a/src/mame/drivers/mits680b.cpp +++ b/src/mame/drivers/mits680b.cpp @@ -45,7 +45,7 @@ public: DECLARE_READ8_MEMBER(terminal_r); DECLARE_READ8_MEMBER(status_check_r); DECLARE_WRITE8_MEMBER(kbd_put); - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; }; @@ -61,7 +61,7 @@ READ8_MEMBER( mits680b_state::terminal_status_r ) READ8_MEMBER( mits680b_state::terminal_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/mjkjidai.cpp b/src/mame/drivers/mjkjidai.cpp index e0a7bb53113..366849496d3 100644 --- a/src/mame/drivers/mjkjidai.cpp +++ b/src/mame/drivers/mjkjidai.cpp @@ -44,7 +44,7 @@ WRITE_LINE_MEMBER(mjkjidai_state::adpcm_int) } else { - UINT8 const data = m_adpcmrom[m_adpcm_pos / 2]; + uint8_t const data = m_adpcmrom[m_adpcm_pos / 2]; m_msm->data_w(m_adpcm_pos & 1 ? data & 0xf : data >> 4); m_adpcm_pos++; } diff --git a/src/mame/drivers/mjsenpu.cpp b/src/mame/drivers/mjsenpu.cpp index f4c585d0fcb..cc25daf12d2 100644 --- a/src/mame/drivers/mjsenpu.cpp +++ b/src/mame/drivers/mjsenpu.cpp @@ -67,13 +67,13 @@ public: required_device m_oki; required_device m_hopper; - required_shared_ptr m_mainram; -// required_shared_ptr m_vram; - UINT8 m_pal[0x200]; - UINT32 m_vram0[0x20000 / 4]; - UINT32 m_vram1[0x20000 / 4]; - UINT8 m_control; - UINT8 m_mux; + required_shared_ptr m_mainram; +// required_shared_ptr m_vram; + uint8_t m_pal[0x200]; + uint32_t m_vram0[0x20000 / 4]; + uint32_t m_vram1[0x20000 / 4]; + uint8_t m_control; + uint8_t m_mux; DECLARE_READ8_MEMBER(palette_low_r); DECLARE_READ8_MEMBER(palette_high_r); @@ -95,7 +95,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mjsenpu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mjsenpu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_palette; }; @@ -114,7 +114,7 @@ READ8_MEMBER(mjsenpu_state::palette_high_r) void mjsenpu_state::set_palette(int offset) { - UINT16 paldata = (m_pal[(offset * 2) + 0] << 8) | (m_pal[(offset * 2) + 1]); + uint16_t paldata = (m_pal[(offset * 2) + 0] << 8) | (m_pal[(offset * 2) + 1]); m_palette->set_pen_color(offset, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal6bit(paldata >> 10)); } @@ -394,12 +394,12 @@ void mjsenpu_state::video_start() -UINT32 mjsenpu_state::screen_update_mjsenpu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mjsenpu_state::screen_update_mjsenpu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count; int color; - UINT32* vram; + uint32_t* vram; if (m_control & 0x01) vram = m_vram0; else vram = m_vram1; diff --git a/src/mame/drivers/mjsister.cpp b/src/mame/drivers/mjsister.cpp index aa2e45514d8..d45687dac4e 100644 --- a/src/mame/drivers/mjsister.cpp +++ b/src/mame/drivers/mjsister.cpp @@ -47,11 +47,11 @@ public: int m_rombank0; int m_rombank1; - UINT32 m_dac_adr; - UINT32 m_dac_bank; - UINT32 m_dac_adr_s; - UINT32 m_dac_adr_e; - UINT32 m_dac_busy; + uint32_t m_dac_adr; + uint32_t m_dac_bank; + uint32_t m_dac_adr_s; + uint32_t m_dac_adr_e; + uint32_t m_dac_busy; /* devices */ required_device m_maincpu; @@ -59,8 +59,8 @@ public: required_device m_dac; /* memory */ - UINT8 m_videoram0[0x8000]; - UINT8 m_videoram1[0x8000]; + uint8_t m_videoram0[0x8000]; + uint8_t m_videoram1[0x8000]; DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_WRITE8_MEMBER(dac_adr_s_w); DECLARE_WRITE8_MEMBER(dac_adr_e_w); @@ -73,10 +73,10 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - 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); void redraw(); - void plot0( int offset, UINT8 data ); - void plot1( int offset, UINT8 data ); + void plot0( int offset, uint8_t data ); + void plot1( int offset, uint8_t data ); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -98,7 +98,7 @@ void mjsister_state::video_start() save_item(NAME(m_videoram1)); } -void mjsister_state::plot0( int offset, UINT8 data ) +void mjsister_state::plot0( int offset, uint8_t data ) { int x, y, c1, c2; @@ -112,7 +112,7 @@ void mjsister_state::plot0( int offset, UINT8 data ) m_tmpbitmap0->pix16(y, x * 2 + 1) = c2; } -void mjsister_state::plot1( int offset, UINT8 data ) +void mjsister_state::plot1( int offset, uint8_t data ) { int x, y, c1, c2; @@ -145,7 +145,7 @@ WRITE8_MEMBER(mjsister_state::videoram_w) } } -UINT32 mjsister_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mjsister_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int flip = m_flip_screen; int i, j; @@ -196,7 +196,7 @@ void mjsister_state::device_timer(emu_timer &timer, device_timer_id id, int para TIMER_CALLBACK_MEMBER(mjsister_state::dac_callback) { - UINT8 *DACROM = memregion("samples")->base(); + uint8_t *DACROM = memregion("samples")->base(); m_dac->write(DACROM[(m_dac_bank * 0x10000 + m_dac_adr++) & 0x1ffff]); @@ -437,7 +437,7 @@ void mjsister_state::redraw() void mjsister_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x8000); diff --git a/src/mame/drivers/mk1.cpp b/src/mame/drivers/mk1.cpp index ef66e66594c..96c205b1a52 100644 --- a/src/mame/drivers/mk1.cpp +++ b/src/mame/drivers/mk1.cpp @@ -56,8 +56,8 @@ public: DECLARE_READ8_MEMBER(mk1_f8_r); DECLARE_WRITE8_MEMBER(mk1_f8_w); - UINT8 m_f8[2]; - UINT8 m_led[4]; + uint8_t m_f8[2]; + uint8_t m_led[4]; virtual void machine_start() override; TIMER_DEVICE_CALLBACK_MEMBER(mk1_update_leds); F3853_INTERRUPT_REQ_CB(mk1_interrupt); @@ -70,7 +70,7 @@ public: READ8_MEMBER( mk1_state::mk1_f8_r ) { - UINT8 i, data = m_f8[offset]; + uint8_t i, data = m_f8[offset]; if ( offset == 0 ) { diff --git a/src/mame/drivers/mk2.cpp b/src/mame/drivers/mk2.cpp index 34c504a4d3e..0c59d889926 100644 --- a/src/mame/drivers/mk2.cpp +++ b/src/mame/drivers/mk2.cpp @@ -73,7 +73,7 @@ public: DECLARE_WRITE8_MEMBER(mk2_write_a); DECLARE_READ8_MEMBER(mk2_read_b); DECLARE_WRITE8_MEMBER(mk2_write_b); - UINT8 m_led[5]; + uint8_t m_led[5]; virtual void machine_start() override; TIMER_DEVICE_CALLBACK_MEMBER(update_leds); }; @@ -160,7 +160,7 @@ READ8_MEMBER( mk2_state::mk2_read_a ) WRITE8_MEMBER( mk2_state::mk2_write_a ) { - UINT8 temp = m_miot->portb_out_get(); + uint8_t temp = m_miot->portb_out_get(); m_led[temp & 3] |= data; } diff --git a/src/mame/drivers/mk85.cpp b/src/mame/drivers/mk85.cpp index 2ac48fe1071..8442093fbf5 100644 --- a/src/mame/drivers/mk85.cpp +++ b/src/mame/drivers/mk85.cpp @@ -32,7 +32,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mk85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mk85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -56,7 +56,7 @@ void mk85_state::video_start() { } -UINT32 mk85_state::screen_update_mk85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mk85_state::screen_update_mk85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/mk90.cpp b/src/mame/drivers/mk90.cpp index 68134c41490..d90142bf109 100644 --- a/src/mame/drivers/mk90.cpp +++ b/src/mame/drivers/mk90.cpp @@ -29,7 +29,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mk90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mk90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -61,7 +61,7 @@ void mk90_state::video_start() { } -UINT32 mk90_state::screen_update_mk90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mk90_state::screen_update_mk90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/mkit09.cpp b/src/mame/drivers/mkit09.cpp index 1430ffcbc24..b9577d2df34 100644 --- a/src/mame/drivers/mkit09.cpp +++ b/src/mame/drivers/mkit09.cpp @@ -56,7 +56,7 @@ public: DECLARE_INPUT_CHANGED_MEMBER(trigger_reset); DECLARE_INPUT_CHANGED_MEMBER(trigger_nmi); private: - UINT8 m_keydata; + uint8_t m_keydata; virtual void machine_reset() override; required_device m_pia; required_device m_cass; diff --git a/src/mame/drivers/mlanding.cpp b/src/mame/drivers/mlanding.cpp index f321c4c7939..febfef81e74 100644 --- a/src/mame/drivers/mlanding.cpp +++ b/src/mame/drivers/mlanding.cpp @@ -69,7 +69,7 @@ public: TIMER_DMA_COMPLETE }; - static const UINT32 c_dma_bank_words = 0x2000; + static const uint32_t c_dma_bank_words = 0x2000; mlanding_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), @@ -101,26 +101,26 @@ public: required_device m_ctc; required_memory_bank m_dma_bank; - required_region_ptr m_msm1_rom; - required_region_ptr m_msm2_rom; + required_region_ptr m_msm1_rom; + required_region_ptr m_msm2_rom; - required_shared_ptr m_g_ram; - required_shared_ptr m_cha_ram; - required_shared_ptr m_dot_ram; - required_shared_ptr m_power_ram; + required_shared_ptr m_g_ram; + required_shared_ptr m_cha_ram; + required_shared_ptr m_dot_ram; + required_shared_ptr m_power_ram; required_device m_palette; - std::unique_ptr m_dma_ram; - UINT8 m_dma_cpu_bank; - UINT8 m_dma_busy; - UINT16 m_dsp_hold_signal; + std::unique_ptr m_dma_ram; + uint8_t m_dma_cpu_bank; + uint8_t m_dma_busy; + uint16_t m_dsp_hold_signal; - UINT32 m_msm_pos[2]; - UINT8 m_msm_reset[2]; - UINT8 m_msm_nibble[2]; - UINT8 m_msm2_vck; - UINT8 m_msm2_vck2; + uint32_t m_msm_pos[2]; + uint8_t m_msm_reset[2]; + uint8_t m_msm_nibble[2]; + uint8_t m_msm2_vck; + uint8_t m_msm2_vck2; virtual void machine_start() override; virtual void machine_reset() override; @@ -153,8 +153,8 @@ public: DECLARE_READ8_MEMBER(motor_r); - UINT32 screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 exec_dma(); + uint32_t screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t exec_dma(); void msm5205_update(int chip); protected: @@ -172,7 +172,7 @@ protected: void mlanding_state::machine_start() { // Allocate two DMA RAM banks - m_dma_ram = std::make_unique(c_dma_bank_words * 2); + m_dma_ram = std::make_unique(c_dma_bank_words * 2); m_dma_bank->configure_entries(0, 2, m_dma_ram.get(), c_dma_bank_words * 2); // Register state for saving @@ -215,16 +215,16 @@ void mlanding_state::machine_reset() * *************************************/ -UINT32 mlanding_state::screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mlanding_state::screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { const pen_t *pens = m_palette->pens(); - for (UINT32 y = cliprect.min_y; y <= cliprect.max_y; ++y) + for (uint32_t y = cliprect.min_y; y <= cliprect.max_y; ++y) { - UINT16 *src = &m_g_ram[(112 + y) * 512 + cliprect.min_x]; - UINT16 *dst = &bitmap.pix16(y, cliprect.min_x); + uint16_t *src = &m_g_ram[(112 + y) * 512 + cliprect.min_x]; + uint16_t *dst = &bitmap.pix16(y, cliprect.min_x); - for (UINT32 x = cliprect.min_x; x <= cliprect.max_x; ++x) + for (uint32_t x = cliprect.min_x; x <= cliprect.max_x; ++x) { *dst++ = pens[*src++ & 0x3fff]; } @@ -246,7 +246,7 @@ WRITE16_MEMBER(mlanding_state::dma_start_w) m_dma_cpu_bank ^= 1; membank("dma_ram")->set_entry(m_dma_cpu_bank); - UINT32 pixels = exec_dma(); + uint32_t pixels = exec_dma(); if (pixels) { @@ -282,58 +282,58 @@ WRITE16_MEMBER(mlanding_state::dma_stop_w) 3 ........ ....xxxx Colour */ -UINT32 mlanding_state::exec_dma() +uint32_t mlanding_state::exec_dma() { - UINT32 pixcnt = 0; - UINT32 gram_mask = m_g_ram.bytes() - 1; - UINT16 *dma_ram = &m_dma_ram[(m_dma_cpu_bank ^ 1) * c_dma_bank_words]; + uint32_t pixcnt = 0; + uint32_t gram_mask = m_g_ram.bytes() - 1; + uint16_t *dma_ram = &m_dma_ram[(m_dma_cpu_bank ^ 1) * c_dma_bank_words]; // Process the entries in DMA RAM - for (UINT32 offs = 0; offs < c_dma_bank_words; offs += 4) + for (uint32_t offs = 0; offs < c_dma_bank_words; offs += 4) { - UINT16 attr = dma_ram[offs]; + uint16_t attr = dma_ram[offs]; if (attr == 0) continue; - UINT16 code = attr & 0x1fff; + uint16_t code = attr & 0x1fff; - UINT16 xword = dma_ram[offs + 1]; - UINT16 yword = dma_ram[offs + 2]; + uint16_t xword = dma_ram[offs + 1]; + uint16_t yword = dma_ram[offs + 2]; - UINT16 x = xword & 0x1ff; - UINT16 y = yword & 0x1ff; - UINT16 sx = ((xword >> 11) & 0x1f) + 1; - UINT16 sy = ((yword >> 11) & 0x1f) + 1; + uint16_t x = xword & 0x1ff; + uint16_t y = yword & 0x1ff; + uint16_t sx = ((xword >> 11) & 0x1f) + 1; + uint16_t sy = ((yword >> 11) & 0x1f) + 1; - UINT8 colour = dma_ram[offs + 3] & 0xff; + uint8_t colour = dma_ram[offs + 3] & 0xff; if ((attr & 0x2000) == 0) { // Normal draw mode - UINT8 basepix = colour << 4; + uint8_t basepix = colour << 4; - for (UINT32 j = 0; j < sx; ++j) + for (uint32_t j = 0; j < sx; ++j) { - for (UINT32 k = 0; k < sy; ++k) + for (uint32_t k = 0; k < sy; ++k) { // Draw an 8x8 tile - for (UINT32 y1 = 0; y1 < 8; ++y1) + for (uint32_t y1 = 0; y1 < 8; ++y1) { - UINT16 *src = &m_cha_ram[(code * 2 * 8) + y1 * 2]; - UINT32 byteaddr = ((y + k * 8 + y1) * 512 + (j * 8 + x)) * 2; + uint16_t *src = &m_cha_ram[(code * 2 * 8) + y1 * 2]; + uint32_t byteaddr = ((y + k * 8 + y1) * 512 + (j * 8 + x)) * 2; - UINT8 *pixdata = reinterpret_cast(m_g_ram.target()) + BYTE_XOR_BE(1); + uint8_t *pixdata = reinterpret_cast(m_g_ram.target()) + BYTE_XOR_BE(1); - UINT8 p2 = *src & 0xff; - UINT8 p1 = *src++ >> 8; - UINT8 p4 = *src; - UINT8 p3 = *src++ >> 8; + uint8_t p2 = *src & 0xff; + uint8_t p1 = *src++ >> 8; + uint8_t p4 = *src; + uint8_t p3 = *src++ >> 8; // Draw 8 pixels - for (UINT32 x1 = 0; x1 < 8; ++x1) + for (uint32_t x1 = 0; x1 < 8; ++x1) { - UINT16 pix = (BIT(p4, x1) << 3) | (BIT(p3, x1) << 2) | (BIT(p2, x1) << 1) | BIT(p1, x1); + uint16_t pix = (BIT(p4, x1) << 3) | (BIT(p3, x1) << 2) | (BIT(p2, x1) << 1) | BIT(p1, x1); if ((attr & 0x8000) == 0) { @@ -359,16 +359,16 @@ UINT32 mlanding_state::exec_dma() else { // Set pixel or palette data - for (UINT32 y1 = 0; y1 < sy * 8; ++y1) + for (uint32_t y1 = 0; y1 < sy * 8; ++y1) { - UINT32 byteaddr = (((y + y1) * 512) + x) * 2; + uint32_t byteaddr = (((y + y1) * 512) + x) * 2; if ((attr & 0x4000) == 0) { // Clear pixel data - UINT8 *pixdata = reinterpret_cast(m_g_ram.target()) + BYTE_XOR_BE(1); + uint8_t *pixdata = reinterpret_cast(m_g_ram.target()) + BYTE_XOR_BE(1); - for (UINT32 x1 = 0; x1 < sx * 8; ++x1) + for (uint32_t x1 = 0; x1 < sx * 8; ++x1) { pixdata[byteaddr & gram_mask] = colour; byteaddr += 2; @@ -378,9 +378,9 @@ UINT32 mlanding_state::exec_dma() else { // Clear palette data - UINT8 *paldata = reinterpret_cast(m_g_ram.target()) + BYTE_XOR_BE(0); + uint8_t *paldata = reinterpret_cast(m_g_ram.target()) + BYTE_XOR_BE(0); - for (UINT32 x1 = 0; x1 < sx * 8; ++x1) + for (uint32_t x1 = 0; x1 < sx * 8; ++x1) { paldata[byteaddr & gram_mask] = colour; byteaddr += 2; @@ -425,8 +425,8 @@ READ16_MEMBER(mlanding_state::input_r) x....... ........ DMA busy */ - UINT8 dswa = ioport("DSWA")->read(); - UINT8 dswb = ioport("DSWB")->read() & 0x7f; + uint8_t dswa = ioport("DSWA")->read(); + uint8_t dswb = ioport("DSWB")->read() & 0x7f; return m_dma_busy << 15 | dswb << 8 | dswa; } @@ -483,10 +483,10 @@ READ16_MEMBER(mlanding_state::analog1_lsb_r) ..x..... Slot down .x...... Slot up */ - UINT16 throttle = ioport("THROTTLE")->read(); - UINT16 x = ioport("STICK_X")->read(); + uint16_t throttle = ioport("THROTTLE")->read(); + uint16_t x = ioport("STICK_X")->read(); - UINT8 res = 0x70 | (throttle & 0x0f); + uint8_t res = 0x70 | (throttle & 0x0f); if (throttle & 0x800) res ^= 0x20; @@ -519,10 +519,10 @@ READ16_MEMBER(mlanding_state::analog3_lsb_r) ..x..... Handle right .x...... Handle down */ - UINT16 x = ioport("STICK_X")->read(); - UINT16 y = ioport("STICK_Y")->read(); + uint16_t x = ioport("STICK_X")->read(); + uint16_t y = ioport("STICK_Y")->read(); - UINT8 res = 0x70 | (y & 0x0f); + uint8_t res = 0x70 | (y & 0x0f); if (y & 0x800) res ^= 0x40; @@ -576,8 +576,8 @@ void mlanding_state::msm5205_update(int chip) if (m_msm_reset[chip]) return; - const UINT8 *rom = chip ? m_msm2_rom : m_msm1_rom; - UINT8 data = rom[m_msm_pos[chip]]; + const uint8_t *rom = chip ? m_msm2_rom : m_msm1_rom; + uint8_t data = rom[m_msm_pos[chip]]; msm5205_device *msm = chip ? m_msm2 : m_msm1; msm->data_w((m_msm_nibble[chip] ? data : data >> 4) & 0xf); diff --git a/src/mame/drivers/mmagic.cpp b/src/mame/drivers/mmagic.cpp index 4c21963b0f4..6dd4cf4e1ba 100644 --- a/src/mame/drivers/mmagic.cpp +++ b/src/mame/drivers/mmagic.cpp @@ -84,7 +84,7 @@ public: DECLARE_WRITE8_MEMBER(color_w); DECLARE_WRITE8_MEMBER(audio_w); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: virtual void machine_start() override; @@ -93,13 +93,13 @@ private: required_device m_maincpu; required_device m_screen; required_device m_palette; - required_shared_ptr m_vram; - required_region_ptr m_tiles; - required_region_ptr m_colors; + required_shared_ptr m_vram; + required_region_ptr m_tiles; + required_region_ptr m_colors; - UINT8 m_ball_x; - UINT8 m_ball_y; - UINT8 m_color; + uint8_t m_ball_x; + uint8_t m_ball_y; + uint8_t m_color; }; @@ -169,7 +169,7 @@ INPUT_PORTS_END READ8_MEMBER( mmagic_state::vblank_r ) { - UINT8 data = 0; + uint8_t data = 0; // bit 0 = vblank data |= m_screen->vblank() << 0; @@ -198,22 +198,22 @@ WRITE8_MEMBER( mmagic_state::color_w ) m_color = data; } -UINT32 mmagic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mmagic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // draw playfield for (int y = 0; y < 192 / 12; y++) { for (int x = 0; x < 256 / 8; x++) { - UINT8 code = m_vram[(y * 32) + x] & 0x7f; + uint8_t code = m_vram[(y * 32) + x] & 0x7f; // normal palette 00..7f, alternate palette 80..ff - UINT8 color = m_colors[code | (BIT(m_color, 6) << 7)]; + uint8_t color = m_colors[code | (BIT(m_color, 6) << 7)]; // draw one tile for (int tx = 0; tx < 12; tx++) { - UINT8 gfx = m_tiles[(code << 4) + tx]; + uint8_t gfx = m_tiles[(code << 4) + tx]; bitmap.pix32(y * 12 + tx, x * 8 + 0) = BIT(gfx, 4) ? rgb_t::black : m_palette->pen_color(color); bitmap.pix32(y * 12 + tx, x * 8 + 1) = BIT(gfx, 5) ? rgb_t::black : m_palette->pen_color(color); diff --git a/src/mame/drivers/mmd1.cpp b/src/mame/drivers/mmd1.cpp index 690a58e2568..890b7c39c13 100644 --- a/src/mame/drivers/mmd1.cpp +++ b/src/mame/drivers/mmd1.cpp @@ -169,8 +169,8 @@ public: DECLARE_WRITE8_MEMBER(mmd2_digit_w); DECLARE_WRITE8_MEMBER(mmd2_status_callback); DECLARE_WRITE_LINE_MEMBER(mmd2_inte_callback); - UINT8 m_return_code; - UINT8 m_digit; + uint8_t m_return_code; + uint8_t m_digit; DECLARE_DRIVER_INIT(mmd2); DECLARE_MACHINE_RESET(mmd1); DECLARE_MACHINE_RESET(mmd2); @@ -217,9 +217,9 @@ WRITE8_MEMBER( mmd1_state::mmd1_port2_w ) // keyboard has a keydown and a keyup code. Keyup = last keydown + bit 7 set READ8_MEMBER( mmd1_state::mmd1_keyboard_r ) { - UINT8 line1 = ioport("LINE1")->read(); - UINT8 line2 = ioport("LINE2")->read(); - UINT8 i, data = 0xff; + uint8_t line1 = ioport("LINE1")->read(); + uint8_t line2 = ioport("LINE2")->read(); + uint8_t i, data = 0xff; for (i = 0; i < 8; i++) @@ -381,7 +381,7 @@ READ8_MEMBER( mmd1_state::mmd2_bank_r ) READ8_MEMBER( mmd1_state::mmd2_01_r ) { // need to add cassin, ttyin bits - UINT8 data = 0x87; + uint8_t data = 0x87; data |= ioport("DSW")->read(); return data; } @@ -399,7 +399,7 @@ WRITE8_MEMBER( mmd1_state::mmd2_digit_w ) READ8_MEMBER( mmd1_state::mmd2_kbd_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_digit < 4) { @@ -448,7 +448,7 @@ DRIVER_INIT_MEMBER(mmd1_state,mmd2) We preset all banks here, so that bankswitching will incur no speed penalty. 0000/0400 indicate ROMs, D800/DC00/E400 indicate RAM, 8000 is a dummy write area for ROM banks. */ - UINT8 *p_ram = memregion("maincpu")->base(); + uint8_t *p_ram = memregion("maincpu")->base(); membank("bank1")->configure_entry(0, &p_ram[0x0000]); membank("bank1")->configure_entry(1, &p_ram[0xd800]); membank("bank1")->configure_entry(2, &p_ram[0x0c00]); diff --git a/src/mame/drivers/mmodular.cpp b/src/mame/drivers/mmodular.cpp index ae98123c4e0..05b9b5de63c 100644 --- a/src/mame/drivers/mmodular.cpp +++ b/src/mame/drivers/mmodular.cpp @@ -90,31 +90,31 @@ Bit 5+6 LED 1-8 enable #include "machine/nvram.h" -//static UINT16 unknown2_data = 0; +//static uint16_t unknown2_data = 0; // Berlin Pro 68020 -static UINT32 BPL32latch_data = 0; +static uint32_t BPL32latch_data = 0; // Mephisto Academy -static UINT8 academyallowNMI = 0; +static uint8_t academyallowNMI = 0; //Monte Carlo IV key/board selects -static UINT8 monteciv_select[2] = { 0xff,0xff }; -static UINT8 montecivtop = 0, montecivbot = 0; -static UINT8 montecivtopnew = 0, montecivbotnew = 0; +static uint8_t monteciv_select[2] = { 0xff,0xff }; +static uint8_t montecivtop = 0, montecivbot = 0; +static uint8_t montecivtopnew = 0, montecivbotnew = 0; //Mephisto Mega IV latch -UINT8 latch2400 = 0; +uint8_t latch2400 = 0; -UINT8 diablo68_3c0000 = 0; +uint8_t diablo68_3c0000 = 0; -UINT8 sfortea_latch = 0; +uint8_t sfortea_latch = 0; INPUT_PORTS_EXTERN( chessboard ); -UINT8 lcd32_char; +uint8_t lcd32_char; class polgar_state : public driver_device { @@ -130,10 +130,10 @@ public: optional_device m_lcdc; optional_device m_beeper; - UINT8 led_status; - UINT8 lcd_char; - //UINT8 led7; - UINT8 latch_data; + uint8_t led_status; + uint8_t lcd_char; + //uint8_t led7; + uint8_t latch_data; DECLARE_WRITE8_MEMBER(write_polgar_IO); DECLARE_WRITE8_MEMBER(write_LCD_polgar); DECLARE_READ8_MEMBER(read_1ff1_sfortea); @@ -201,12 +201,12 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq2); TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq_academy); void common_chess_start(); - UINT8 convert_imputmask(UINT8 input); - UINT8 convertMCIV2LED(UINT8 codedchar); + uint8_t convert_imputmask(uint8_t input); + uint8_t convertMCIV2LED(uint8_t codedchar); void write_IOenable(unsigned char data,address_space &space); }; -UINT8 polgar_state::convert_imputmask(UINT8 input) +uint8_t polgar_state::convert_imputmask(uint8_t input) { input^=0xff; switch (input) { @@ -275,7 +275,7 @@ WRITE8_MEMBER(polgar_state::write_LCD_polgar) READ8_MEMBER(polgar_state::read_1ff1_sfortea) { - UINT8 data; + uint8_t data; data = ioport("BUTTONS_SFOR1")->read(); logerror("1ff0 data %02x\n",data); return 0; @@ -284,13 +284,13 @@ READ8_MEMBER(polgar_state::read_1ff1_sfortea) READ8_MEMBER(polgar_state::read_1ff0_sfortea) { - UINT8 data; + uint8_t data; data = ioport("BUTTONS_SFOR2")->read(); logerror("1ff0 data %02x\n",data); return 0; // return data; -// static UINT8 temp = 0; +// static uint8_t temp = 0; // temp++; // logerror("read 1ff0 %02x\n",temp); // printf("read 1ff0 %02x\n",temp); @@ -356,7 +356,7 @@ WRITE8_MEMBER(polgar_state::write_LCD_academy) READ16_MEMBER(polgar_state::diablo68_aciaread) { // device_t *acia = machine().device("acia65c51"); - UINT16 result; + uint16_t result; // result = acia_6551_r(acia, offset & 0x03); // logerror("ACIA read offset %02x\n",offset); // printf("ACIA read offset %02x\n",offset); @@ -398,7 +398,7 @@ WRITE16_MEMBER(polgar_state::diablo68_write_LCD) WRITE8_MEMBER(polgar_state::milano_write_LED) { - UINT8 LED_offset = 100; + uint8_t LED_offset = 100; if (data == 0xff) output().set_led_value(LED_offset+offset,1); else output().set_led_value(LED_offset+offset,0); @@ -524,9 +524,9 @@ WRITE8_MEMBER(polgar_state::polgar_write_LED) logerror("LEDs Offset = %d Data = %d\n",offset,data); } -UINT8 polgar_state::convertMCIV2LED(UINT8 codedchar) +uint8_t polgar_state::convertMCIV2LED(uint8_t codedchar) { - UINT8 data = 0; + uint8_t data = 0; if (BIT(codedchar,0)) data |= 0x80; if (BIT(codedchar,1)) data |= 0x01; if (BIT(codedchar,2)) data |= 0x20; @@ -541,8 +541,8 @@ UINT8 polgar_state::convertMCIV2LED(UINT8 codedchar) WRITE8_MEMBER(polgar_state::monteciv_write_LCD) // first write == 00 (start) then 8 writes (to 74595) x 4 chars, then ff to finish { - static UINT8 charstodisplay[4] = { 0,0,0,0 }; - static UINT8 tempchar = 0,shift = 0, whichchar = 0; + static uint8_t charstodisplay[4] = { 0,0,0,0 }; + static uint8_t tempchar = 0,shift = 0, whichchar = 0; if ((montecivtop == 0) && (montecivbot == 0)) { // if both are 0 then no screen chosen montecivbotnew = 1; @@ -646,8 +646,8 @@ READ8_MEMBER(polgar_state::milano_read_board) static const char *const board_lines[8] = { "LINE.0", "LINE.1", "LINE.2", "LINE.3", "LINE.4", "LINE.5", "LINE.6", "LINE.7" }; - UINT8 data = 0x00; - UINT8 tmp; // = 0xff; + uint8_t data = 0x00; + uint8_t tmp; // = 0xff; if (latch_data) { @@ -665,7 +665,7 @@ READ8_MEMBER(polgar_state::milano_read_board) READ8_MEMBER(polgar_state::read_keys) { - UINT8 data; + uint8_t data; static const char *const keynames[1][8] = { { "KEY1_0", "KEY1_1", "KEY1_2", "KEY1_3", "KEY1_4", "KEY1_5", "KEY1_6", "KEY1_7" } @@ -678,7 +678,7 @@ READ8_MEMBER(polgar_state::read_keys) READ8_MEMBER(polgar_state::read_keys_megaiv) { - UINT8 data; + uint8_t data; static const char *const keynames[1][8] = { { "KEY1_0", "KEY1_1", "KEY1_2", "KEY1_3", "KEY1_4", "KEY1_5", "KEY1_6", "KEY1_7" } @@ -692,8 +692,8 @@ READ8_MEMBER(polgar_state::read_keys_megaiv) READ32_MEMBER(polgar_state::read_keys_BPL32) { - UINT32 data = 0; - UINT8 tmp = 0xff, line = 0; + uint32_t data = 0; + uint8_t tmp = 0xff, line = 0; static const char *const board_lines[8] = { "LINE.0", "LINE.1", "LINE.2", "LINE.3", "LINE.4", "LINE.5", "LINE.6", "LINE.7" }; @@ -741,7 +741,7 @@ WRITE8_MEMBER(polgar_state::monteciv_select_line) // FIXME : unlike polgar, academy shares port IO for keys and board, and i just can't seem to get the board latched right (H7 and H8 are always flashing) -- Cow READ8_MEMBER(polgar_state::read_keys_board_monteciv) { - UINT8 data = 0; + uint8_t data = 0; if (monteciv_select[0] == 0xff && monteciv_select[1] == 0xff) { //data = mboard_read_board_8(space,0); @@ -773,8 +773,8 @@ READ8_MEMBER(polgar_state::read_keys_board_monteciv) READ8_MEMBER(polgar_state::read_keys_board_academy) { // static int startup = 0; - UINT8 data = 0; -// UINT8 tmp = 0xff, line = 0; + uint8_t data = 0; +// uint8_t tmp = 0xff, line = 0; // static const char *const board_lines[8] = // { "LINE.0", "LINE.1", "LINE.2", "LINE.3", "LINE.4", "LINE.5", "LINE.6", "LINE.7" }; @@ -821,7 +821,7 @@ WRITE32_MEMBER(polgar_state::write_board_BPL32) READ32_MEMBER(polgar_state::read_buttons_gen32) { - UINT32 data; + uint32_t data; static const char *const keynames[4] = { "BUTTON_1", "BUTTON_2", "", "BUTTON_3" }; data = ioport(keynames[offset])->read(); @@ -833,7 +833,7 @@ READ32_MEMBER(polgar_state::read_buttons_gen32) READ32_MEMBER(polgar_state::read_buttons_van32) { - UINT32 data; + uint32_t data; static const char *const keynames[4] = { "BUTTON_1", "", "BUTTON_2", "BUTTON_3" }; @@ -846,7 +846,7 @@ READ32_MEMBER(polgar_state::read_buttons_van32) READ16_MEMBER(polgar_state::read_buttons_van16) { - UINT16 data; + uint16_t data; static const char *const keynames[3] = { "BUTTON_1", "BUTTON_2", "BUTTON_3" }; @@ -992,7 +992,7 @@ MACHINE_START_MEMBER(polgar_state,van32) // patch LCD delay loop on the 68030 machines until waitstates and/or opcode timings are fixed in MAME core // patches gen32 gen32_41 lond030 - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); if(rom[0x870] == 0x0c && rom[0x871] == 0x78) { rom[0x870] = 0x38; diff --git a/src/mame/drivers/mod8.cpp b/src/mame/drivers/mod8.cpp index f3f55d7549e..1ddeccc7eb0 100644 --- a/src/mame/drivers/mod8.cpp +++ b/src/mame/drivers/mod8.cpp @@ -73,8 +73,8 @@ public: DECLARE_READ8_MEMBER(tty_r); IRQ_CALLBACK_MEMBER(mod8_irq_callback); private: - UINT16 m_tty_data; - UINT8 m_tty_key_data; + uint16_t m_tty_data; + uint8_t m_tty_key_data; int m_tty_cnt; virtual void machine_reset() override; required_device m_teleprinter; @@ -102,7 +102,7 @@ WRITE8_MEMBER( mod8_state::tty_w ) READ8_MEMBER( mod8_state::tty_r ) { - UINT8 d = m_tty_key_data & 1; + uint8_t d = m_tty_key_data & 1; m_tty_key_data >>= 1; return d; } diff --git a/src/mame/drivers/model1.cpp b/src/mame/drivers/model1.cpp index 389601152d2..dc9f1a59de6 100644 --- a/src/mame/drivers/model1.cpp +++ b/src/mame/drivers/model1.cpp @@ -810,7 +810,7 @@ WRITE16_MEMBER(model1_state::md0_w) WRITE16_MEMBER(model1_state::p_w) { - UINT16 old = m_paletteram16[offset]; + uint16_t old = m_paletteram16[offset]; m_palette->write(space, offset, data, mem_mask); if(0 && m_paletteram16[offset] != old) logerror("XVIDEO: p_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, space.device().safe_pc()); diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp index 749834b0879..bfb82e5be50 100644 --- a/src/mame/drivers/model2.cpp +++ b/src/mame/drivers/model2.cpp @@ -134,9 +134,9 @@ enum { #define COPRO_FIFOIN_SIZE 32000 -bool model2_state::copro_fifoin_pop(device_t *device, UINT32 *result,UINT32 offset, UINT32 mem_mask) +bool model2_state::copro_fifoin_pop(device_t *device, uint32_t *result,uint32_t offset, uint32_t mem_mask) { - UINT32 r; + uint32_t r; if (m_copro_fifoin_num == 0) { @@ -184,7 +184,7 @@ READ_LINE_MEMBER(model2_state::copro_tgp_fifoin_pop_ok) READ32_MEMBER(model2_state::copro_tgp_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 == COPRO_FIFOIN_SIZE) @@ -198,7 +198,7 @@ READ32_MEMBER(model2_state::copro_tgp_fifoin_pop) } -void model2_state::copro_fifoin_push(device_t *device, UINT32 data, UINT32 offset, UINT32 mem_mask) +void model2_state::copro_fifoin_push(device_t *device, uint32_t data, uint32_t offset, uint32_t mem_mask) { if (m_copro_fifoin_num == COPRO_FIFOIN_SIZE) { @@ -224,9 +224,9 @@ void model2_state::copro_fifoin_push(device_t *device, UINT32 data, UINT32 offse #define COPRO_FIFOOUT_SIZE 32000 -UINT32 model2_state::copro_fifoout_pop(address_space &space,UINT32 offset, UINT32 mem_mask) +uint32_t model2_state::copro_fifoout_pop(address_space &space,uint32_t offset, uint32_t mem_mask) { - UINT32 r; + uint32_t r; if (m_copro_fifoout_num == 0) { @@ -266,7 +266,7 @@ UINT32 model2_state::copro_fifoout_pop(address_space &space,UINT32 offset, UINT3 return r; } -void model2_state::copro_fifoout_push(device_t *device, UINT32 data,UINT32 offset,UINT32 mem_mask) +void model2_state::copro_fifoout_push(device_t *device, uint32_t data,uint32_t offset,uint32_t mem_mask) { if (m_copro_fifoout_num == COPRO_FIFOOUT_SIZE) { @@ -328,7 +328,7 @@ READ32_MEMBER(model2_state::timers_r) if (m_timerrun[offset]) { // get elapsed time, convert to units of 25 MHz - UINT32 cur = (m_timers[offset]->time_elapsed() * 25000000).as_double(); + uint32_t cur = (m_timers[offset]->time_elapsed() * 25000000).as_double(); // subtract units from starting value m_timervals[offset] = m_timerorig[offset] - cur; @@ -372,8 +372,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2_timer_cb) MACHINE_START_MEMBER(model2_state,model2) { - m_copro_fifoin_data = make_unique_clear(COPRO_FIFOIN_SIZE); - m_copro_fifoout_data = make_unique_clear(COPRO_FIFOOUT_SIZE); + m_copro_fifoin_data = make_unique_clear(COPRO_FIFOIN_SIZE); + m_copro_fifoout_data = make_unique_clear(COPRO_FIFOOUT_SIZE); } MACHINE_RESET_MEMBER(model2_state,model2_common) @@ -462,7 +462,7 @@ MACHINE_RESET_MEMBER(model2_state,model2c) m_dsp_type = DSP_TYPE_TGPX4; } -static void chcolor(palette_device &palette, pen_t color, UINT16 data) +static void chcolor(palette_device &palette, pen_t color, uint16_t data) { palette.set_pen_color(color, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10)); } @@ -497,7 +497,7 @@ WRITE32_MEMBER(model2_state::analog_2b_w) READ32_MEMBER(model2_state::fifoctl_r) { - UINT32 r = 0; + uint32_t r = 0; if (m_copro_fifoout_num == 0) { @@ -520,7 +520,7 @@ WRITE32_MEMBER(model2_state::videoctl_w) CUSTOM_INPUT_MEMBER(model2_state::_1c00000_r) { - UINT32 ret = m_in0->read(); + uint32_t ret = m_in0->read(); if(m_ctrlmode == 0) { @@ -535,7 +535,7 @@ CUSTOM_INPUT_MEMBER(model2_state::_1c00000_r) CUSTOM_INPUT_MEMBER(model2_state::_1c0001c_r) { - UINT32 iptval = 0x00ff; + uint32_t iptval = 0x00ff; if(m_analog_channel < 4) { iptval = m_analog_ports[m_analog_channel].read_safe(0); @@ -556,9 +556,9 @@ CUSTOM_INPUT_MEMBER(model2_state::_1c0001c_r) /* Used specifically by Sega Rally, others might be different */ CUSTOM_INPUT_MEMBER(model2_state::srallyc_gearbox_r) { - UINT8 res = m_gears.read_safe(0); + uint8_t res = m_gears.read_safe(0); int i; - const UINT8 gearvalue[5] = { 0, 2, 1, 6, 5 }; + const uint8_t gearvalue[5] = { 0, 2, 1, 6, 5 }; for(i=0;i<5;i++) { @@ -692,7 +692,7 @@ WRITE32_MEMBER(model2_state::copro_prg_w) if (m_coprocnt & 1) { m_tgpx4_program[m_coprocnt / 2] &= U64(0xffffffff); - m_tgpx4_program[m_coprocnt / 2] |= (UINT64)(data) << 32; + m_tgpx4_program[m_coprocnt / 2] |= (uint64_t)(data) << 32; } else { @@ -745,8 +745,8 @@ WRITE32_MEMBER(model2_state::copro_ctl1_w) WRITE32_MEMBER(model2_state::copro_function_port_w) { - UINT32 d = data & 0x800fffff; - UINT32 a = (offset >> 2) & 0xff; + uint32_t d = data & 0x800fffff; + uint32_t a = (offset >> 2) & 0xff; d |= a << 23; //logerror("copro_function_port_w: %08X, %08X, %08X\n", data, offset, mem_mask); @@ -926,7 +926,7 @@ WRITE32_MEMBER(model2_state::geo_sharc_iop_w) #endif -void model2_state::push_geo_data(UINT32 data) +void model2_state::push_geo_data(uint32_t data) { //osd_printf_debug("push_geo_data: %08X: %08X\n", 0x900000+m_geo_write_start_address, data); m_bufferram[m_geo_write_start_address/4] = data; @@ -980,7 +980,7 @@ WRITE32_MEMBER(model2_state::geo_w) /*if (data & 0x80000000) { int i; - UINT32 a; + uint32_t a; osd_printf_debug("GEO: jump to %08X\n", (data & 0xfffff)); a = (data & 0xfffff) / 4; for (i=0; i < 4; i++) @@ -1007,7 +1007,7 @@ WRITE32_MEMBER(model2_state::geo_w) if (data & 0x80000000) { - UINT32 r = 0; + uint32_t r = 0; r |= data & 0x800fffff; r |= ((address >> 4) & 0x3f) << 23; push_geo_data(r); @@ -1016,12 +1016,12 @@ WRITE32_MEMBER(model2_state::geo_w) { if ((address & 0xf) == 0) { - UINT32 r = 0; + uint32_t r = 0; r |= data & 0x000fffff; r |= ((address >> 4) & 0x3f) << 23; if((address >> 4) & 0xc0) { - UINT8 function = (address >> 4) & 0x3f; + uint8_t function = (address >> 4) & 0x3f; if(function == 1) { r |= ((address>>10)&3)<<29; // Eye Mode, used by Sega Rally on car select @@ -1053,13 +1053,13 @@ WRITE32_MEMBER(model2_state::geo_w) READ32_MEMBER(model2_state::hotd_lightgun_r) { - UINT16 res = 0xffff; + uint16_t res = 0xffff; if(m_lightgun_mux < 8) res = (m_lightgun_ports[m_lightgun_mux >> 1].read_safe(0) >> ((m_lightgun_mux & 1)*8)) & 0xff; else { - UINT16 p1x,p1y,p2x,p2y; + uint16_t p1x,p1y,p2x,p2y; res = 0xfffc; @@ -1101,7 +1101,7 @@ READ32_MEMBER(model2_state::daytona_unk_r) #if 0 READ32_MEMBER(model2_state::desert_unk_r) { - static UINT8 test; + static uint8_t test; test ^= 8; // vcop needs bit 3 clear (infinite loop otherwise) @@ -1140,7 +1140,7 @@ void model2_state::model2_check_irq_state() } } -void model2_state::model2_check_irqack_state(UINT32 data) +void model2_state::model2_check_irqack_state(uint32_t data) { const int irq_type[12]= {I960_IRQ0,I960_IRQ1,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ2,I960_IRQ3,I960_IRQ3}; @@ -1234,7 +1234,7 @@ WRITE32_MEMBER(model2_state::model2_serial_w) READ32_MEMBER(model2_state::model2_5881prot_r) { - UINT32 retval = 0; + uint32_t retval = 0; if (offset == 0x0000/4) { @@ -1252,7 +1252,7 @@ READ32_MEMBER(model2_state::model2_5881prot_r) } else { - UINT8* base; + uint8_t* base; retval = m_cryptdevice->do_decrypt(base); retval = ((retval & 0xff00) >> 8) | ((retval & 0x00ff) << 8); retval <<= 16; @@ -1300,7 +1300,7 @@ WRITE32_MEMBER(model2_state::model2_5881prot_w) READ32_MEMBER(model2_state::maxx_r) { - UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); if (offset <= 0x1f/4) { @@ -1477,7 +1477,7 @@ ADDRESS_MAP_END READ8_MEMBER(model2_state::virtuacop_lightgun_r) { - UINT8 res; + uint8_t res; res = (m_lightgun_ports[offset >> 1].read_safe(0) >> ((offset & 1)*8)) & 0xff; @@ -1487,8 +1487,8 @@ READ8_MEMBER(model2_state::virtuacop_lightgun_r) /* handles offscreen gun trigger detection here */ READ8_MEMBER(model2_state::virtuacop_lightgun_offscreen_r) { - UINT16 special_res = 0xfffc; - UINT16 p1x,p1y,p2x,p2y; + uint16_t special_res = 0xfffc; + uint16_t p1x,p1y,p2x,p2y; p1x = m_lightgun_ports[1].read_safe(0); p1y = m_lightgun_ports[0].read_safe(0); @@ -2234,7 +2234,7 @@ WRITE16_MEMBER(model2_state::model2snd_ctrl) // handle sample banking if (memregion("scsp")->bytes() > 0x800000) { - UINT8 *snd = memregion("scsp")->base(); + uint8_t *snd = memregion("scsp")->base(); if (data & 0x20) { membank("bank4")->set_base(snd + 0x200000); @@ -2270,7 +2270,7 @@ WRITE8_MEMBER(model2_state::scsp_irq) READ32_MEMBER(model2_state::copro_sharc_input_fifo_r) { - UINT32 result = 0; + uint32_t result = 0; bool type; //osd_printf_debug("SHARC FIFOIN pop at %08X\n", space.device().safe_pc()); @@ -2436,9 +2436,9 @@ static MACHINE_CONFIG_DERIVED( manxttdx, model2a ) /* Includes a Model 1 Sound b MCFG_SEGAM1AUDIO_ADD("m1audio") MACHINE_CONFIG_END -UINT16 model2_state::crypt_read_callback(UINT32 addr) +uint16_t model2_state::crypt_read_callback(uint32_t addr) { - UINT16 dat= m_maincpu->space().read_word((0x1d80000+2*addr)); + uint16_t dat= m_maincpu->space().read_word((0x1d80000+2*addr)); return ((dat&0xff00)>>8)|((dat&0x00ff)<<8); } @@ -5861,7 +5861,7 @@ DRIVER_INIT_MEMBER(model2_state,pltkids) DRIVER_INIT_CALL(genprot); // fix bug in program: it destroys the interrupt table and never fixes it - UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); ROM[0x730/4] = 0x08000004; } @@ -5870,7 +5870,7 @@ DRIVER_INIT_MEMBER(model2_state,zerogun) DRIVER_INIT_CALL(genprot); // fix bug in program: it destroys the interrupt table and never fixes it - UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); ROM[0x700/4] = 0x08000004; } @@ -5883,7 +5883,7 @@ DRIVER_INIT_MEMBER(model2_state,sgt24h) { // DRIVER_INIT_CALL(genprot); - UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); ROM[0x56578/4] = 0x08000004; //ROM[0x5b3e8/4] = 0x08000004; } @@ -5892,7 +5892,7 @@ DRIVER_INIT_MEMBER(model2_state,doa) { m_0229crypt->install_doa_protection(); - UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); ROM[0x630/4] = 0x08000004; ROM[0x808/4] = 0x08000004; } diff --git a/src/mame/drivers/model3.cpp b/src/mame/drivers/model3.cpp index 3c448e3912f..a49b05f83c5 100644 --- a/src/mame/drivers/model3.cpp +++ b/src/mame/drivers/model3.cpp @@ -755,7 +755,7 @@ void model3_state::update_irq_state() } } -void model3_state::set_irq_line(UINT8 bit, int line) +void model3_state::set_irq_line(uint8_t bit, int line) { if (line != CLEAR_LINE) m_irq_state |= bit; @@ -769,7 +769,7 @@ void model3_state::set_irq_line(UINT8 bit, int line) /* Motorola MPC105 PCI Bridge/Memory Controller */ -UINT32 model3_state::pci_device_get_reg() +uint32_t model3_state::pci_device_get_reg() { int device = m_pci_device; int reg = m_pci_reg; @@ -822,7 +822,7 @@ UINT32 model3_state::pci_device_get_reg() return 0; } -void model3_state::pci_device_set_reg(UINT32 value) +void model3_state::pci_device_set_reg(uint32_t value) { int device = m_pci_device; int reg = m_pci_reg; @@ -899,7 +899,7 @@ READ64_MEMBER(model3_state::mpc105_addr_r) { if (ACCESSING_BITS_32_63) { - return (UINT64)m_mpc105_addr << 32; + return (uint64_t)m_mpc105_addr << 32; } return 0; } @@ -908,7 +908,7 @@ WRITE64_MEMBER(model3_state::mpc105_addr_w) { if (ACCESSING_BITS_32_63) { - UINT32 d = flipendian_int32((UINT32)(data >> 32)); + uint32_t d = flipendian_int32((uint32_t)(data >> 32)); m_mpc105_addr = data >> 32; m_pci_bus = (d >> 16) & 0xff; @@ -921,8 +921,8 @@ WRITE64_MEMBER(model3_state::mpc105_addr_w) READ64_MEMBER(model3_state::mpc105_data_r) { if(m_pci_device == 0) { - return ((UINT64)(flipendian_int32(m_mpc105_regs[(m_pci_reg/2)+1])) << 32) | - ((UINT64)(flipendian_int32(m_mpc105_regs[(m_pci_reg/2)+0]))); + return ((uint64_t)(flipendian_int32(m_mpc105_regs[(m_pci_reg/2)+1])) << 32) | + ((uint64_t)(flipendian_int32(m_mpc105_regs[(m_pci_reg/2)+0]))); } return flipendian_int32(pci_device_get_reg()); } @@ -930,26 +930,26 @@ READ64_MEMBER(model3_state::mpc105_data_r) WRITE64_MEMBER(model3_state::mpc105_data_w) { if(m_pci_device == 0) { - m_mpc105_regs[(m_pci_reg/2)+1] = flipendian_int32((UINT32)(data >> 32)); - m_mpc105_regs[(m_pci_reg/2)+0] = flipendian_int32((UINT32)(data)); + m_mpc105_regs[(m_pci_reg/2)+1] = flipendian_int32((uint32_t)(data >> 32)); + m_mpc105_regs[(m_pci_reg/2)+0] = flipendian_int32((uint32_t)(data)); return; } if (ACCESSING_BITS_0_31) { - pci_device_set_reg(flipendian_int32((UINT32)data)); + pci_device_set_reg(flipendian_int32((uint32_t)data)); } } READ64_MEMBER(model3_state::mpc105_reg_r) { - return ((UINT64)(m_mpc105_regs[(offset*2)+0]) << 32) | - (UINT64)(m_mpc105_regs[(offset*2)+1]); + return ((uint64_t)(m_mpc105_regs[(offset*2)+0]) << 32) | + (uint64_t)(m_mpc105_regs[(offset*2)+1]); } WRITE64_MEMBER(model3_state::mpc105_reg_w) { - m_mpc105_regs[(offset*2)+0] = (UINT32)(data >> 32); - m_mpc105_regs[(offset*2)+1] = (UINT32)data; + m_mpc105_regs[(offset*2)+0] = (uint32_t)(data >> 32); + m_mpc105_regs[(offset*2)+1] = (uint32_t)data; } static void mpc105_init(running_machine &machine) @@ -976,7 +976,7 @@ READ64_MEMBER(model3_state::mpc106_addr_r) { if (ACCESSING_BITS_32_63) { - return (UINT64)m_mpc106_addr << 32; + return (uint64_t)m_mpc106_addr << 32; } return 0; } @@ -985,7 +985,7 @@ WRITE64_MEMBER(model3_state::mpc106_addr_w) { if (ACCESSING_BITS_32_63) { - UINT32 d = flipendian_int32((UINT32)(data >> 32)); + uint32_t d = flipendian_int32((uint32_t)(data >> 32)); if (((d >> 8) & 0xffffff) == 0x800000) { @@ -1006,42 +1006,42 @@ WRITE64_MEMBER(model3_state::mpc106_addr_w) READ64_MEMBER(model3_state::mpc106_data_r) { if(m_pci_device == 0) { - return ((UINT64)(flipendian_int32(m_mpc106_regs[(m_pci_reg/2)+1])) << 32) | - ((UINT64)(flipendian_int32(m_mpc106_regs[(m_pci_reg/2)+0]))); + return ((uint64_t)(flipendian_int32(m_mpc106_regs[(m_pci_reg/2)+1])) << 32) | + ((uint64_t)(flipendian_int32(m_mpc106_regs[(m_pci_reg/2)+0]))); } if (ACCESSING_BITS_32_63) { - return (UINT64)(flipendian_int32(pci_device_get_reg())) << 32; + return (uint64_t)(flipendian_int32(pci_device_get_reg())) << 32; } else { - return (UINT64)(flipendian_int32(pci_device_get_reg())); + return (uint64_t)(flipendian_int32(pci_device_get_reg())); } } WRITE64_MEMBER(model3_state::mpc106_data_w) { if(m_pci_device == 0) { - m_mpc106_regs[(m_pci_reg/2)+1] = flipendian_int32((UINT32)(data >> 32)); - m_mpc106_regs[(m_pci_reg/2)+0] = flipendian_int32((UINT32)(data)); + m_mpc106_regs[(m_pci_reg/2)+1] = flipendian_int32((uint32_t)(data >> 32)); + m_mpc106_regs[(m_pci_reg/2)+0] = flipendian_int32((uint32_t)(data)); return; } if (ACCESSING_BITS_0_31) { - pci_device_set_reg(flipendian_int32((UINT32)data)); + pci_device_set_reg(flipendian_int32((uint32_t)data)); } } READ64_MEMBER(model3_state::mpc106_reg_r) { - return ((UINT64)(m_mpc106_regs[(offset*2)+0]) << 32) | - (UINT64)(m_mpc106_regs[(offset*2)+1]); + return ((uint64_t)(m_mpc106_regs[(offset*2)+0]) << 32) | + (uint64_t)(m_mpc106_regs[(offset*2)+1]); } WRITE64_MEMBER(model3_state::mpc106_reg_w) { - m_mpc106_regs[(offset*2)+0] = (UINT32)(data >> 32); - m_mpc106_regs[(offset*2)+1] = (UINT32)data; + m_mpc106_regs[(offset*2)+0] = (uint32_t)(data >> 32); + m_mpc106_regs[(offset*2)+1] = (uint32_t)data; } static void mpc106_init(running_machine &machine) @@ -1070,30 +1070,30 @@ static void mpc106_init(running_machine &machine) READ64_MEMBER(model3_state::scsi_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; @@ -1131,7 +1131,7 @@ WRITE64_MEMBER(model3_state::scsi_w) LSI53C810_FETCH_CB(model3_state::scsi_fetch) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT32 result = space.read_dword(dsp); + uint32_t result = space.read_dword(dsp); return flipendian_int32(result); } @@ -1157,7 +1157,7 @@ READ64_MEMBER(model3_state::real3d_dma_r) } break; } - osd_printf_debug("real3d_dma_r: %08X, %08X%08X\n", offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); + osd_printf_debug("real3d_dma_r: %08X, %08X%08X\n", offset, (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); return 0; } @@ -1167,18 +1167,18 @@ WRITE64_MEMBER(model3_state::real3d_dma_w) { case 0: if(ACCESSING_BITS_32_63) { /* DMA source address */ - m_dma_source = flipendian_int32((UINT32)(data >> 32)); + m_dma_source = flipendian_int32((uint32_t)(data >> 32)); return; } if(ACCESSING_BITS_0_31) { /* DMA destination address */ - m_dma_dest = flipendian_int32((UINT32)(data)); + m_dma_dest = flipendian_int32((uint32_t)(data)); return; } break; case 1: if(ACCESSING_BITS_32_63) /* DMA length */ { - int length = flipendian_int32((UINT32)(data >> 32)) * 4; + int length = flipendian_int32((uint32_t)(data >> 32)) * 4; if (m_dma_endian & 0x80) { real3d_dma_callback(m_dma_source, m_dma_dest, length, 0); @@ -1207,7 +1207,7 @@ WRITE64_MEMBER(model3_state::real3d_dma_w) break; case 2: if(ACCESSING_BITS_32_63) { /* DMA command */ - UINT32 cmd = flipendian_int32((UINT32)(data >> 32)); + uint32_t cmd = flipendian_int32((uint32_t)(data >> 32)); if(cmd & 0x20000000) { m_dma_data = flipendian_int32(m_real3d_device_id); /* (PCI Vendor & Device ID) */ } @@ -1225,7 +1225,7 @@ WRITE64_MEMBER(model3_state::real3d_dma_w) } return; } - logerror("real3d_dma_w: %08X, %08X%08X, %08X%08X", offset, (UINT32)(data >> 32), (UINT32)(data), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); + logerror("real3d_dma_w: %08X, %08X%08X, %08X%08X", offset, (uint32_t)(data >> 32), (uint32_t)(data), (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); } LSI53C810_DMA_CB(model3_state::real3d_dma_callback) @@ -1375,7 +1375,7 @@ READ64_MEMBER(model3_state::model3_ctrl_r) case 0: if (ACCESSING_BITS_56_63) { - return (UINT64)m_controls_bank << 56; + return (uint64_t)m_controls_bank << 56; } else if (ACCESSING_BITS_24_31) { @@ -1393,7 +1393,7 @@ READ64_MEMBER(model3_state::model3_ctrl_r) case 1: if (ACCESSING_BITS_56_63) { - return (UINT64)ioport("IN2")->read() << 56; + return (uint64_t)ioport("IN2")->read() << 56; } else if (ACCESSING_BITS_24_31) { @@ -1413,14 +1413,14 @@ READ64_MEMBER(model3_state::model3_ctrl_r) case 5: if (ACCESSING_BITS_24_31) /* Serial comm RX FIFO 1 */ { - return (UINT64)m_serial_fifo1 << 24; + return (uint64_t)m_serial_fifo1 << 24; } break; case 6: if (ACCESSING_BITS_56_63) /* Serial comm RX FIFO 2 */ { - return (UINT64)m_serial_fifo2 << 56; + return (uint64_t)m_serial_fifo2 << 56; } else if (ACCESSING_BITS_24_31) /* Serial comm full/empty flags */ { @@ -1431,15 +1431,15 @@ READ64_MEMBER(model3_state::model3_ctrl_r) case 7: if (ACCESSING_BITS_24_31) /* ADC Data read */ { - const UINT8 adc_data = m_adc_ports[m_adc_channel].read_safe(0); + const uint8_t adc_data = m_adc_ports[m_adc_channel].read_safe(0); m_adc_channel++; m_adc_channel &= 0x7; - return (UINT64)adc_data << 24; + return (uint64_t)adc_data << 24; } break; } - logerror("ctrl_r: %02X, %08X%08X", offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); + logerror("ctrl_r: %02X, %08X%08X", offset, (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); return 0; } @@ -1514,7 +1514,7 @@ WRITE64_MEMBER(model3_state::model3_ctrl_w) } break; default: - //osd_printf_debug("Lightgun: Unknown command %02X at %08X\n", (UINT32)(data >> 24), space.device().safe_pc()); + //osd_printf_debug("Lightgun: Unknown command %02X at %08X\n", (uint32_t)(data >> 24), space.device().safe_pc()); break; } } @@ -1536,7 +1536,7 @@ WRITE64_MEMBER(model3_state::model3_ctrl_w) return; } - logerror("ctrl_w: %02X, %08X%08X, %08X%08X", offset, (UINT32)(data >> 32), (UINT32)(data), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); + logerror("ctrl_w: %02X, %08X%08X, %08X%08X", offset, (uint32_t)(data >> 32), (uint32_t)(data), (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); } READ64_MEMBER(model3_state::model3_sys_r) @@ -1548,14 +1548,14 @@ READ64_MEMBER(model3_state::model3_sys_r) case 0x08/8: if (ACCESSING_BITS_56_63) { - return ((UINT64)m_crom_bank << 56); + return ((uint64_t)m_crom_bank << 56); } break; case 0x10/8: if (ACCESSING_BITS_56_63) { - UINT64 res = tap_read(); + uint64_t res = tap_read(); return res<<61; } @@ -1563,14 +1563,14 @@ READ64_MEMBER(model3_state::model3_sys_r) { return (m_irq_enable<<24); } - else logerror("m3_sys: Unk sys_r @ 0x10: mask = %x\n", (UINT32)mem_mask); + else logerror("m3_sys: Unk sys_r @ 0x10: mask = %x\n", (uint32_t)mem_mask); break; case 0x18/8: // printf("read irq_state %x (PC %x)\n", m_irq_state, space.device().safe_pc()); - return (UINT64)m_irq_state<<56 | 0xff000000; + return (uint64_t)m_irq_state<<56 | 0xff000000; } - logerror("Unknown model3 sys_r: offs %08X mask %08X\n", offset, (UINT32)mem_mask); + logerror("Unknown model3 sys_r: offs %08X mask %08X\n", offset, (uint32_t)mem_mask); return 0; } @@ -1590,8 +1590,8 @@ WRITE64_MEMBER(model3_state::model3_sys_w) case 0x18/8: if ((mem_mask & 0xff000000) == 0xff000000) // int ACK with bits in REVERSE ORDER from the other registers (Seeeee-gaaaa!) { // may also be a secondary enable based on behavior of e.g. magtruck VBL handler -// UINT32 old_irq = m_irq_state; - UINT8 ack = (data>>24)&0xff, realack; +// uint32_t old_irq = m_irq_state; + uint8_t ack = (data>>24)&0xff, realack; int i; switch (ack) @@ -1646,12 +1646,12 @@ WRITE64_MEMBER(model3_state::model3_sys_w) READ64_MEMBER(model3_state::model3_rtc_r) { - UINT64 r = 0; + uint64_t r = 0; if(ACCESSING_BITS_56_63) { - r |= (UINT64)rtc72421_r(space, (offset*2)+0, (UINT32)(mem_mask >> 32)) << 32; + r |= (uint64_t)rtc72421_r(space, (offset*2)+0, (uint32_t)(mem_mask >> 32)) << 32; } if(ACCESSING_BITS_24_31) { - r |= (UINT64)rtc72421_r(space, (offset*2)+1, (UINT32)(mem_mask)); + r |= (uint64_t)rtc72421_r(space, (offset*2)+1, (uint32_t)(mem_mask)); } return r; } @@ -1659,10 +1659,10 @@ READ64_MEMBER(model3_state::model3_rtc_r) WRITE64_MEMBER(model3_state::model3_rtc_w) { if(ACCESSING_BITS_56_63) { - rtc72421_w(space, (offset*2)+0, (UINT32)(data >> 32), (UINT32)(mem_mask >> 32)); + rtc72421_w(space, (offset*2)+0, (uint32_t)(data >> 32), (uint32_t)(mem_mask >> 32)); } if(ACCESSING_BITS_24_31) { - rtc72421_w(space, (offset*2)+1, (UINT32)(data), (UINT32)(mem_mask)); + rtc72421_w(space, (offset*2)+1, (uint32_t)(data), (uint32_t)(mem_mask)); } } @@ -1687,7 +1687,7 @@ READ8_MEMBER(model3_state::model3_sound_r) { case 4: { - UINT8 res = 0; + uint8_t res = 0; res |= 1; res |= 0x2; // magtruck country check return res; @@ -1736,7 +1736,7 @@ WRITE8_MEMBER(model3_state::model3_sound_w) READ64_MEMBER(model3_state::model3_5881prot_r) { - UINT64 retvalue = U64(0xffffffffffffffff); + uint64_t retvalue = U64(0xffffffffffffffff); if (offset == 0x00 / 8) { @@ -1753,17 +1753,17 @@ READ64_MEMBER(model3_state::model3_5881prot_r) } else { - UINT8* base; + uint8_t* base; retvalue = m_cryptdevice->do_decrypt(base); // retvalue = ((retvalue & 0xff00) >> 8) | ((retvalue & 0x00ff) << 8); // don't endian swap the return value on this hardware retvalue <<= 16; } - // printf("model3_5881prot_r offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(retvalue >> 32), (UINT32)(retvalue & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff)); + // printf("model3_5881prot_r offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (uint32_t)(retvalue >> 32), (uint32_t)(retvalue & 0xffffffff), (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask & 0xffffffff)); } else { - printf("model3_5881prot_r offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(retvalue >> 32), (UINT32)(retvalue & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff)); + printf("model3_5881prot_r offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (uint32_t)(retvalue >> 32), (uint32_t)(retvalue & 0xffffffff), (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask & 0xffffffff)); } return retvalue; @@ -1786,14 +1786,14 @@ WRITE64_MEMBER(model3_state::model3_5881prot_w) } else if (offset == 0x18 / 8) { - UINT16 subkey = data >> (32 + 16); + uint16_t subkey = data >> (32 + 16); subkey = ((subkey & 0xff00) >> 8) | ((subkey & 0x00ff) << 8); // endian swap the sub-key for this hardware printf("model3_5881prot_w setting subkey %04x\n", subkey); m_cryptdevice->set_subkey(subkey); } else { - printf("model3_5881prot_w offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(data >> 32), (UINT32)(data & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff)); + printf("model3_5881prot_w offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (uint32_t)(data >> 32), (uint32_t)(data & 0xffffffff), (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask & 0xffffffff)); } } @@ -5475,7 +5475,7 @@ WRITE16_MEMBER(model3_state::model3snd_ctrl) // handle sample banking if (memregion("scsp2")->bytes() > 0x800000) { - UINT8 *snd = memregion("scsp2")->base(); + uint8_t *snd = memregion("scsp2")->base(); if (data & 0x20) { membank("bank4")->set_base(snd + 0x200000); @@ -5720,9 +5720,9 @@ static MACHINE_CONFIG_START(model3_21, model3_state) MACHINE_CONFIG_END -UINT16 model3_state::crypt_read_callback(UINT32 addr) +uint16_t model3_state::crypt_read_callback(uint32_t addr) { - UINT16 dat = 0; + uint16_t dat = 0; if (addr < 0x8000) { dat = m_maincpu->space().read_word((0xf0180000 + 4 * addr)); // every other word is unused in this RAM, probably 32-bit ram on 64-bit bus? @@ -5745,13 +5745,13 @@ static void interleave_vroms(running_machine &machine) model3_state *state = machine.driver_data(); int start; int i,j,x; - UINT16 *vrom1 = (UINT16*)state->memregion("user3")->base(); - UINT16 *vrom2 = (UINT16*)state->memregion("user4")->base(); + uint16_t *vrom1 = (uint16_t*)state->memregion("user3")->base(); + uint16_t *vrom2 = (uint16_t*)state->memregion("user4")->base(); int vrom_length = state->memregion("user3")->bytes(); - UINT16 *vrom; + uint16_t *vrom; - state->m_vrom = std::make_unique(0x4000000/4); - vrom = (UINT16 *)state->m_vrom.get(); + state->m_vrom = std::make_unique(0x4000000/4); + vrom = (uint16_t *)state->m_vrom.get(); if( vrom_length <= 0x1000000 ) { start = 0x1000000; @@ -5818,7 +5818,7 @@ DRIVER_INIT_MEMBER(model3_state,model3_20) DRIVER_INIT_MEMBER(model3_state,lostwsga) { - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_15); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xc1000000, 0xc10000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); @@ -5832,7 +5832,7 @@ DRIVER_INIT_MEMBER(model3_state,scud) /* TODO: network device at 0xC0000000 - FF */ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xf9000000, 0xf90000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this)); -// UINT32 *rom = (UINT32*)memregion("user1")->base(); +// uint32_t *rom = (uint32_t*)memregion("user1")->base(); // rom[(0x799de8^4)/4] = 0x00050208; // secret debug menu } @@ -5859,7 +5859,7 @@ DRIVER_INIT_MEMBER(model3_state,lemans24) DRIVER_INIT_MEMBER(model3_state,vf3) { - //UINT32 *rom = (UINT32*)memregion("user1")->base(); + //uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_10); @@ -5891,7 +5891,7 @@ DRIVER_INIT_MEMBER(model3_state,vs29815) { m_step15_with_mpc106 = true; - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); rom[(0x6028ec^4)/4] = 0x60000000; rom[(0x60290c^4)/4] = 0x60000000; @@ -5972,7 +5972,7 @@ DRIVER_INIT_MEMBER(model3_state,srally2) DRIVER_INIT_CALL(model3_20); - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); rom[(0x7c0c4^4)/4] = 0x60000000; rom[(0x7c0c8^4)/4] = 0x60000000; rom[(0x7c0cc^4)/4] = 0x60000000; @@ -5984,7 +5984,7 @@ DRIVER_INIT_MEMBER(model3_state,srally2) DRIVER_INIT_MEMBER(model3_state,swtrilgy) { - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_20); // Unemulated JTAG stuff, see srally2 @@ -6002,7 +6002,7 @@ DRIVER_INIT_MEMBER(model3_state,swtrilgy) DRIVER_INIT_MEMBER(model3_state,swtrilga) { - //UINT32 *rom = (UINT32*)memregion("user1")->base(); + //uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_20); DRIVER_INIT_CALL(genprot); @@ -6027,7 +6027,7 @@ DRIVER_INIT_MEMBER(model3_state,dirtdvls) DRIVER_INIT_MEMBER(model3_state,daytona2) { -// UINT32 *rom = (UINT32*)memregion("user1")->base(); +// uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_20); m_maincpu->space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this)); @@ -6043,7 +6043,7 @@ DRIVER_INIT_MEMBER(model3_state,daytona2) DRIVER_INIT_MEMBER(model3_state,dayto2pe) { -// UINT32 *rom = (UINT32*)memregion("user1")->base(); +// uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_20); m_maincpu->space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this)); @@ -6060,7 +6060,7 @@ DRIVER_INIT_MEMBER(model3_state,dayto2pe) DRIVER_INIT_MEMBER(model3_state,spikeout) { - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_20); rom[(0x6059cc^4)/4] = 0x60000000; @@ -6070,7 +6070,7 @@ DRIVER_INIT_MEMBER(model3_state,spikeout) DRIVER_INIT_MEMBER(model3_state,spikeofe) { - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_20); rom[(0x6059cc^4)/4] = 0x60000000; @@ -6084,7 +6084,7 @@ DRIVER_INIT_MEMBER(model3_state,eca) DRIVER_INIT_CALL(genprot); // base = 0xffc80000 - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); // cabinet network error rom[(0x4a45e4^4)/4] = 0x60000000; @@ -6096,7 +6096,7 @@ DRIVER_INIT_MEMBER(model3_state,eca) DRIVER_INIT_MEMBER(model3_state,skichamp) { - //UINT32 *rom = (UINT32*)memregion("user1")->base(); + //uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_20); /* @@ -6109,7 +6109,7 @@ DRIVER_INIT_MEMBER(model3_state,skichamp) DRIVER_INIT_MEMBER(model3_state,oceanhun) { - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); DRIVER_INIT_CALL(model3_20); rom[(0x57995c^4)/4] = 0x60000000; // decrementer diff --git a/src/mame/drivers/modellot.cpp b/src/mame/drivers/modellot.cpp index 215d966e890..06d7fc007be 100644 --- a/src/mame/drivers/modellot.cpp +++ b/src/mame/drivers/modellot.cpp @@ -35,11 +35,11 @@ public: DECLARE_READ8_MEMBER(port77_r); DECLARE_READ8_MEMBER(portff_r); DECLARE_WRITE8_MEMBER(kbd_put); - UINT32 screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_videoram; + uint32_t screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; private: - UINT8 m_term_data; - const UINT8 *m_p_chargen; + uint8_t m_term_data; + const uint8_t *m_p_chargen; virtual void machine_reset() override; required_device m_maincpu; }; @@ -70,7 +70,7 @@ READ8_MEMBER( modellot_state::port77_r) READ8_MEMBER( modellot_state::portff_r) { - UINT8 data = (m_term_data) ? m_term_data ^ 0x7f : 0xff; + uint8_t data = (m_term_data) ? m_term_data ^ 0x7f : 0xff; m_term_data = 0; return data; } @@ -104,16 +104,16 @@ static GFXDECODE_START( modellot ) GFXDECODE_END -UINT32 modellot_state::screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t modellot_state::screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx,inv; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx,inv; + uint16_t sy=0,ma=0,x; for (y = 0; y < 16; y++) { for (ra = 0; ra < 16; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = 0; x < 64; x++) { diff --git a/src/mame/drivers/mogura.cpp b/src/mame/drivers/mogura.cpp index 9040ec0e35d..d9990833a08 100644 --- a/src/mame/drivers/mogura.cpp +++ b/src/mame/drivers/mogura.cpp @@ -24,8 +24,8 @@ public: required_device m_maincpu; required_device m_ldac; required_device m_rdac; - required_shared_ptr m_gfxram; - required_shared_ptr m_tileram; + required_shared_ptr m_gfxram; + required_shared_ptr m_tileram; required_device m_gfxdecode; tilemap_t *m_tilemap; @@ -36,13 +36,13 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(mogura); - UINT32 screen_update_mogura(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mogura(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; PALETTE_INIT_MEMBER(mogura_state, mogura) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i, j; j = 0; @@ -91,7 +91,7 @@ void mogura_state::video_start() m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(mogura_state::get_mogura_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); } -UINT32 mogura_state::screen_update_mogura(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mogura_state::screen_update_mogura(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { const rectangle &visarea = screen.visible_area(); diff --git a/src/mame/drivers/mole.cpp b/src/mame/drivers/mole.cpp index ea6dc598ccf..12b2ca6c2ee 100644 --- a/src/mame/drivers/mole.cpp +++ b/src/mame/drivers/mole.cpp @@ -71,7 +71,7 @@ public: int m_tile_bank; /* memory */ - UINT16 m_tileram[0x400]; + uint16_t m_tileram[0x400]; DECLARE_WRITE8_MEMBER(mole_tileram_w); DECLARE_WRITE8_MEMBER(mole_tilebank_w); @@ -82,7 +82,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mole(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mole(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -94,7 +94,7 @@ public: TILE_GET_INFO_MEMBER(mole_state::get_bg_tile_info) { - UINT16 code = m_tileram[tile_index]; + uint16_t code = m_tileram[tile_index]; SET_TILE_INFO_MEMBER((code & 0x200) ? 1 : 0, code & 0x1ff, 0, 0); } @@ -128,7 +128,7 @@ WRITE8_MEMBER(mole_state::mole_flipscreen_w) flip_screen_set(data & 0x01); } -UINT32 mole_state::screen_update_mole(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mole_state::screen_update_mole(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/molecular.cpp b/src/mame/drivers/molecular.cpp index a31d817eeb4..b12b14b198b 100644 --- a/src/mame/drivers/molecular.cpp +++ b/src/mame/drivers/molecular.cpp @@ -68,12 +68,12 @@ public: required_device m_filecpu; // screen updates - 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); - UINT8 *m_file_rom; - UINT8 *m_app_rom; - std::unique_ptr m_file_ram; - std::unique_ptr m_app_ram; + uint8_t *m_file_rom; + uint8_t *m_app_rom; + std::unique_ptr m_file_ram; + std::unique_ptr m_app_ram; DECLARE_READ8_MEMBER(file_r); DECLARE_WRITE8_MEMBER(file_w); @@ -86,8 +86,8 @@ public: DECLARE_READ8_MEMBER( sio_r ); DECLARE_WRITE8_MEMBER( sio_w ); - UINT8 app_ram_enable; - UINT8 file_ram_enable; + uint8_t app_ram_enable; + uint8_t file_ram_enable; DECLARE_PALETTE_INIT(molecula); @@ -103,7 +103,7 @@ void molecula_state::video_start() { } -UINT32 molecula_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t molecula_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } @@ -267,8 +267,8 @@ void molecula_state::machine_start() m_file_rom = memregion("fileipl")->base(); m_app_rom = memregion("appipl")->base(); - m_file_ram = make_unique_clear(0x10000); - m_app_ram = make_unique_clear(0x10000); + m_file_ram = make_unique_clear(0x10000); + m_app_ram = make_unique_clear(0x10000); } void molecula_state::machine_reset() diff --git a/src/mame/drivers/momoko.cpp b/src/mame/drivers/momoko.cpp index 3702f925599..1c7c46a5a74 100644 --- a/src/mame/drivers/momoko.cpp +++ b/src/mame/drivers/momoko.cpp @@ -220,7 +220,7 @@ GFXDECODE_END void momoko_state::machine_start() { - UINT8 *BG_MAP = memregion("user1")->base(); + uint8_t *BG_MAP = memregion("user1")->base(); membank("bank1")->configure_entries(0, 32, &BG_MAP[0x0000], 0x1000); diff --git a/src/mame/drivers/monty.cpp b/src/mame/drivers/monty.cpp index 8275f40aeee..a2210d1e53e 100644 --- a/src/mame/drivers/monty.cpp +++ b/src/mame/drivers/monty.cpp @@ -54,7 +54,7 @@ public: DECLARE_WRITE8_MEMBER(ioCommandWrite1_w); // screen updates - UINT32 lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); + uint32_t lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); private: required_device m_maincpu; @@ -63,8 +63,8 @@ private: //required_device m_sed1; // TODO: Also, there are 2 SED1503Fs on the board - one is flipped upside down // Test - UINT8 m_writeUpper; - UINT32 m_pixels[42*32]; + uint8_t m_writeUpper; + uint32_t m_pixels[42*32]; bool m_sound_sw; bool m_dirty; }; @@ -187,8 +187,8 @@ WRITE8_MEMBER( monty_state::ioDisplayWrite_w ) // Offset directly corresponds to sed1503, DD RAM address (offset 0x7f may be special?) //printf("(%04x) %02x %02x\n", m_maincpu->pc(), offset, data); - UINT8 x = offset & 0x3f; - UINT8 y = (BIT(offset, 6) + (m_writeUpper ? 2 : 0)) << 3; + uint8_t x = offset & 0x3f; + uint8_t y = (BIT(offset, 6) + (m_writeUpper ? 2 : 0)) << 3; // Skip the controller and write straight to the LCD (pc=134f) for (int i = 0; i < 8; i++) @@ -202,12 +202,12 @@ WRITE8_MEMBER( monty_state::ioDisplayWrite_w ) } -UINT32 monty_state::lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect) +uint32_t monty_state::lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect) { if (!m_dirty) return 1; - UINT8 x,y,z; + uint8_t x,y,z; m_dirty = false; for (y = 0; y < 32; y++) { diff --git a/src/mame/drivers/monzagp.cpp b/src/mame/drivers/monzagp.cpp index 6f08b216b86..6b36dcc15f7 100644 --- a/src/mame/drivers/monzagp.cpp +++ b/src/mame/drivers/monzagp.cpp @@ -64,7 +64,7 @@ public: virtual void video_start() override; TIMER_DEVICE_CALLBACK_MEMBER(time_tick_timer); DECLARE_PALETTE_INIT(monzagp); - UINT32 screen_update_monzagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_monzagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -80,16 +80,16 @@ public: required_ioport m_dsw; private: - UINT8 m_p1; - UINT8 m_p2; - UINT8 m_video_ctrl[2][8]; + uint8_t m_p1; + uint8_t m_p2; + uint8_t m_video_ctrl[2][8]; bool m_time_tick; bool m_cp_ruote; - UINT8 m_collisions_ff; - UINT8 m_collisions_clk; - UINT8 m_mycar_pos; - std::unique_ptr m_vram; - std::unique_ptr m_score_ram; + uint8_t m_collisions_ff; + uint8_t m_collisions_clk; + uint8_t m_mycar_pos; + std::unique_ptr m_vram; + std::unique_ptr m_score_ram; }; @@ -115,7 +115,7 @@ PALETTE_INIT_MEMBER(monzagp_state, monzagp) for (int i = 0; i < 0x100; i++) { int bit0 = 0, bit1 = 0, bit2 = 0; - UINT8 d = m_proms->base()[0x400 + i] ^ 0x0f; + uint8_t d = m_proms->base()[0x400 + i] ^ 0x0f; if (d & 0x08) { @@ -141,8 +141,8 @@ PALETTE_INIT_MEMBER(monzagp_state, monzagp) void monzagp_state::video_start() { - m_vram = std::make_unique(0x800); - m_score_ram = std::make_unique(0x100); + m_vram = std::make_unique(0x800); + m_score_ram = std::make_unique(0x100); m_time_tick = 0; m_cp_ruote = 0; m_mycar_pos = 0; @@ -154,7 +154,7 @@ void monzagp_state::video_start() m_nvram->set_base(m_score_ram.get(), 0x100); } -UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* for(int i=0;i<8;i++) @@ -168,12 +168,12 @@ UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16 bitmap.fill(0, cliprect); // background tilemap - UINT8 *tile_table = m_proms->base() + 0x100; - UINT8 *collisions_prom = m_proms->base() + 0x200; + uint8_t *tile_table = m_proms->base() + 0x100; + uint8_t *collisions_prom = m_proms->base() + 0x200; - UINT8 start_tile = m_video_ctrl[0][0] ^ 0xff; - UINT8 inv_counter = m_video_ctrl[0][1] ^ 0xff; - UINT8 mycar_y = m_mycar_pos; + uint8_t start_tile = m_video_ctrl[0][0] ^ 0xff; + uint8_t inv_counter = m_video_ctrl[0][1] ^ 0xff; + uint8_t mycar_y = m_mycar_pos; bool inv = false; for(int y=0; y<=256; y++, start_tile += inv ? -1 : +1) @@ -181,12 +181,12 @@ UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16 if (inv_counter++ == 0xff) inv = true; - UINT16 start_x = (((m_video_ctrl[0][3] << 8) | m_video_ctrl[0][2]) ^ 0xffff); - UINT8 mycar_x = m_video_ctrl[1][2]; + uint16_t start_x = (((m_video_ctrl[0][3] << 8) | m_video_ctrl[0][2]) ^ 0xffff); + uint8_t mycar_x = m_video_ctrl[1][2]; for(int x=0; x<=256; x++, start_x++) { - UINT8 tile_attr = m_tile_attr->base()[((start_x >> 5) & 0x1ff) | ((m_video_ctrl[0][3] & 0x80) ? 0 : 0x200)]; + uint8_t tile_attr = m_tile_attr->base()[((start_x >> 5) & 0x1ff) | ((m_video_ctrl[0][3] & 0x80) ? 0 : 0x200)]; //if (tile_attr & 0x10) printf("dark on\n"); //if (tile_attr & 0x20) printf("light on\n"); @@ -195,8 +195,8 @@ UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16 int tile_idx = tile_table[((tile_attr & 0x0f) << 4) | (inv ? 0x08 : 0) | ((start_tile >> 5) & 0x07)]; int bit_pos = 3 - (start_x & 3); - UINT8 tile_data = m_gfx3->base()[(tile_idx << 8) | (((start_x << 3) & 0xe0) ^ 0x80) | (start_tile & 0x1f)]; - UINT8 tile_color = (BIT(tile_data, 4 + bit_pos) << 1) | BIT(tile_data, bit_pos); + uint8_t tile_data = m_gfx3->base()[(tile_idx << 8) | (((start_x << 3) & 0xe0) ^ 0x80) | (start_tile & 0x1f)]; + uint8_t tile_color = (BIT(tile_data, 4 + bit_pos) << 1) | BIT(tile_data, bit_pos); int color = (tile_idx << 2) | tile_color; @@ -218,8 +218,8 @@ UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16 else if (m_cp_ruote && (m_video_ctrl[1][3] & 0x10)) sprite_idx ^= 0x01; int bitpos = 3 - (hpos & 3); - UINT8 sprite_data = m_gfx2->base()[(sprite_idx << 5) | (vpos & 0x1f)]; - UINT8 sprite_color = (BIT(sprite_data, 4 + bitpos) << 1) | BIT(sprite_data, bitpos); + uint8_t sprite_data = m_gfx2->base()[(sprite_idx << 5) | (vpos & 0x1f)]; + uint8_t sprite_color = (BIT(sprite_data, 4 + bitpos) << 1) | BIT(sprite_data, bitpos); if ((sprite_color & 3) != 3) { @@ -233,8 +233,8 @@ UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16 bitmap.pix16(y, x) = color; // collisions - UINT8 coll_prom_addr = BITSWAP8(tile_idx, 7, 6, 5, 4, 2, 0, 1, 3); - UINT8 collisions = collisions_prom[((mycar && othercars) ? 0 : 0x80) | (inv ? 0x40 : 0) | (coll_prom_addr << 2) | (mycar ? 0 : 0x02) | (tile_color & 0x01)]; + uint8_t coll_prom_addr = BITSWAP8(tile_idx, 7, 6, 5, 4, 2, 0, 1, 3); + uint8_t collisions = collisions_prom[((mycar && othercars) ? 0 : 0x80) | (inv ? 0x40 : 0) | (coll_prom_addr << 2) | (mycar ? 0 : 0x02) | (tile_color & 0x01)]; m_collisions_ff |= ((m_collisions_clk ^ collisions) & collisions); m_collisions_clk = collisions; } @@ -264,7 +264,7 @@ ADDRESS_MAP_END READ8_MEMBER(monzagp_state::port_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!(m_p1 & 0x01)) // 8350 videoram { //printf("ext 0 r P1:%02x P2:%02x %02x\n", m_p1, m_p2, offset); @@ -354,7 +354,7 @@ WRITE8_MEMBER(monzagp_state::port_w) if ((ram_offset & 0x07) == 0) { // 74LS47 BCD-to-Seven-Segment Decoder - static UINT8 bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x49, 0x78, 0x00 }; + static uint8_t bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x49, 0x78, 0x00 }; output().set_digit_value(ram_offset >> 3, bcd2hex[data & 0x0f]); } } @@ -375,7 +375,7 @@ WRITE8_MEMBER(monzagp_state::port_w) if ((offset & 0x80) && (m_video_ctrl[1][3] & 0x01)) { - UINT8 steering_wheel = m_steering_wheel->read(); + uint8_t steering_wheel = m_steering_wheel->read(); if (steering_wheel & 0x01) m_mycar_pos--; if (steering_wheel & 0x02) m_mycar_pos++; } diff --git a/src/mame/drivers/moo.cpp b/src/mame/drivers/moo.cpp index 3291006439a..bb6f2344e54 100644 --- a/src/mame/drivers/moo.cpp +++ b/src/mame/drivers/moo.cpp @@ -157,7 +157,7 @@ WRITE16_MEMBER(moo_state::control2_w) void moo_state::moo_objdma() { int num_inactive; - UINT16 *src, *dst; + uint16_t *src, *dst; int counter = m_k053246->k053247_get_dy(); m_k053246->k053247_get_ram( &dst); @@ -282,7 +282,7 @@ WRITE16_MEMBER(moo_state::k053247_scattered_word_w) WRITE16_MEMBER(moo_state::moo_prot_w) { - UINT32 src1, src2, dst, length, a, b, res; + uint32_t src1, src2, dst, length, a, b, res; COMBINE_DATA(&m_protram[offset]); diff --git a/src/mame/drivers/mouser.cpp b/src/mame/drivers/mouser.cpp index ba1dd9a6722..a64e53aa513 100644 --- a/src/mame/drivers/mouser.cpp +++ b/src/mame/drivers/mouser.cpp @@ -288,8 +288,8 @@ DRIVER_INIT_MEMBER(mouser_state,mouser) /* Decode the opcodes */ offs_t i; - UINT8 *rom = memregion("maincpu")->base(); - UINT8 *table = memregion("user1")->base(); + uint8_t *rom = memregion("maincpu")->base(); + uint8_t *table = memregion("user1")->base(); for (i = 0; i < 0x6000; i++) { diff --git a/src/mame/drivers/mpf1.cpp b/src/mame/drivers/mpf1.cpp index 5f0b9eeb78b..cb5f0db7e9c 100644 --- a/src/mame/drivers/mpf1.cpp +++ b/src/mame/drivers/mpf1.cpp @@ -247,7 +247,7 @@ TIMER_CALLBACK_MEMBER(mpf1_state::led_refresh) READ8_MEMBER( mpf1_state::ppi_pa_r ) { - UINT8 data = 0x7f; + uint8_t data = 0x7f; /* bit 0 to 5, keyboard rows 0 to 5 */ if (!BIT(m_lednum, 0)) data &= m_pc0->read(); @@ -269,7 +269,7 @@ READ8_MEMBER( mpf1_state::ppi_pa_r ) WRITE8_MEMBER( mpf1_state::ppi_pb_w ) { /* swap bits around for the mame 7-segment emulation */ - UINT8 led_data = BITSWAP8(data, 6, 1, 2, 0, 7, 5, 4, 3); + uint8_t led_data = BITSWAP8(data, 6, 1, 2, 0, 7, 5, 4, 3); /* timer to update segments */ m_led_refresh_timer->adjust(attotime::from_usec(70), led_data); @@ -311,7 +311,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(mpf1_state::check_halt_callback) { // halt-LED; the red one, is turned on when the processor is halted // TODO: processor seems to halt, but restarts(?) at 0x0000 after a while -> fix - INT64 led_halt = m_maincpu->state_int(Z80_HALT); + int64_t led_halt = m_maincpu->state_int(Z80_HALT); output().set_led_value(1, led_halt); } diff --git a/src/mame/drivers/mpu12wbk.cpp b/src/mame/drivers/mpu12wbk.cpp index 8a15bb6ccc4..31e0b05bf44 100644 --- a/src/mame/drivers/mpu12wbk.cpp +++ b/src/mame/drivers/mpu12wbk.cpp @@ -225,8 +225,8 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(mpu12wbk_videoram_w); DECLARE_WRITE8_MEMBER(mpu12wbk_colorram_w); @@ -234,7 +234,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(mpu12wbk); - UINT32 screen_update_mpu12wbk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mpu12wbk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -281,7 +281,7 @@ void mpu12wbk_state::video_start() } -UINT32 mpu12wbk_state::screen_update_mpu12wbk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mpu12wbk_state::screen_update_mpu12wbk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/mpu3.cpp b/src/mame/drivers/mpu3.cpp index 91c81dc641e..774f8b1bf49 100644 --- a/src/mame/drivers/mpu3.cpp +++ b/src/mame/drivers/mpu3.cpp @@ -170,8 +170,8 @@ TODO: - Distinguish door switches using manual struct mpu3_chr_table { - UINT8 call; - UINT8 response; + uint8_t call; + uint8_t response; }; class mpu3_state : public driver_device @@ -208,8 +208,8 @@ public: int m_aux1_input; int m_aux2_input; int m_input_strobe; /* IC11 74LS138 A = CA2 IC3, B = CA2 IC4, C = CA2 IC5 */ - UINT8 m_lamp_strobe; - UINT8 m_led_strobe; + uint8_t m_lamp_strobe; + uint8_t m_led_strobe; int m_signal_50hz; const mpu3_chr_table* m_current_chr_table; diff --git a/src/mame/drivers/mpu4.cpp b/src/mame/drivers/mpu4.cpp index 913c7c4fa45..69cf56f7520 100644 --- a/src/mame/drivers/mpu4.cpp +++ b/src/mame/drivers/mpu4.cpp @@ -604,7 +604,7 @@ WRITE8_MEMBER(mpu4_state::pia_ic3_portb_w) /* Some games (like Connect 4) use 'programmable' LED displays, built from light display lines in section 2. */ /* These are mostly low-tech machines, where such wiring proved cheaper than an extender card */ /* TODO: replace this with 'segment' lamp masks, to make it more generic */ - UINT8 pled_segs[2] = {0,0}; + uint8_t pled_segs[2] = {0,0}; static const int lamps1[8] = { 106, 107, 108, 109, 104, 105, 110, 133 }; static const int lamps2[8] = { 114, 115, 116, 117, 112, 113, 118, 119 }; @@ -849,7 +849,7 @@ READ8_MEMBER(mpu4_state::pia_ic5_porta_r) } LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",machine().describe_context())); - UINT8 tempinput = m_aux1_port->read()|m_aux1_input; + uint8_t tempinput = m_aux1_port->read()|m_aux1_input; if (m_aux1_invert) { return ~tempinput; @@ -1052,7 +1052,7 @@ READ8_MEMBER(mpu4_state::pia_ic5_portb_r) machine().bookkeeping().coin_lockout_w(2, (m_pia5->b_output() & 0x04) ); machine().bookkeeping().coin_lockout_w(3, (m_pia5->b_output() & 0x08) ); - UINT8 tempinput = m_aux2_port->read()|m_aux2_input; + uint8_t tempinput = m_aux2_port->read()|m_aux2_input; if (m_aux2_invert) { return ~tempinput; @@ -1980,7 +1980,7 @@ READ8_MEMBER(mpu4_state::characteriser_r) int addr = space.device().state().state_int(M6809_X); if ((addr>=0x800) && (addr<=0xfff)) return 0x00; // prevent recursion, only care about ram/rom areas for this cheat. - UINT8 ret = space.read_byte(addr); + uint8_t ret = space.read_byte(addr); logerror(" (returning %02x)",ret); logerror("\n"); @@ -2475,7 +2475,7 @@ DRIVER_INIT_MEMBER(mpu4_state,m_blsbys) DRIVER_INIT_MEMBER(mpu4_state,m4default_banks) { //Initialise paging for non-extended ROM space - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 4, &rom[0x01000], 0x10000); membank("bank1")->set_entry(0); } @@ -2520,7 +2520,7 @@ DRIVER_INIT_MEMBER(mpu4_state,m4default_big) m_bwb_bank=1; space.install_write_handler(0x0858, 0x0858, write8_delegate(FUNC(mpu4_state::bankswitch_w),this)); space.install_write_handler(0x0878, 0x0878, write8_delegate(FUNC(mpu4_state::bankset_w),this)); - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); m_numbanks = size / 0x10000; @@ -2559,11 +2559,11 @@ DRIVER_INIT_MEMBER(mpu4_state,m_frkstn) } // thanks to Project Amber for descramble information -static void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor) +static void descramble_crystal( uint8_t* region, int start, int end, uint8_t extra_xor) { for (int i=start;i m_dealem_videoram; + optional_shared_ptr m_dealem_videoram; DECLARE_MACHINE_RESET(dealem_vid); DECLARE_PALETTE_INIT(dealem); - UINT32 screen_update_dealem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dealem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(dealem_vsync_changed); required_device m_gfxdecode; }; @@ -80,7 +80,7 @@ GFXDECODE_END PALETTE_INIT_MEMBER(mpu4dealem_state,dealem) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i, len; static const int resistances_rg[3] = { 1000, 470, 220 }; static const int resistances_b [2] = { 470, 220 }; @@ -117,7 +117,7 @@ PALETTE_INIT_MEMBER(mpu4dealem_state,dealem) } -UINT32 mpu4dealem_state::screen_update_dealem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mpu4dealem_state::screen_update_dealem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int count = 0; diff --git a/src/mame/drivers/mpu4mod2sw.hxx b/src/mame/drivers/mpu4mod2sw.hxx index 3239d9028a7..076049d65d2 100644 --- a/src/mame/drivers/mpu4mod2sw.hxx +++ b/src/mame/drivers/mpu4mod2sw.hxx @@ -30,7 +30,7 @@ DRIVER_INIT_MEMBER( mpu4_state, m4_showstring_mod2 ) // many original barcrest / bwb sets have identification info around here // this helps with sorting - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); printf("\ncopyright string:\n"); for (int i = 0xffe0; i<0xfff0; i++) { diff --git a/src/mame/drivers/mpu4mod4yam.hxx b/src/mame/drivers/mpu4mod4yam.hxx index 4400e026f6c..84f3ddd7878 100644 --- a/src/mame/drivers/mpu4mod4yam.hxx +++ b/src/mame/drivers/mpu4mod4yam.hxx @@ -15,7 +15,7 @@ DRIVER_INIT_MEMBER( mpu4_state, m4_debug_mod4yam ) // many original barcrest / bwb sets have identification info around here // this helps with sorting - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); int size = memregion( "maincpu" )->bytes(); for (int j=0;j m_plasmaram; + required_shared_ptr m_plasmaram; DECLARE_READ16_MEMBER( mpu4plasma_unk_r ) { @@ -30,7 +30,7 @@ public: DECLARE_WRITE16_MEMBER( mpu4plasma_unk_w ) { } - UINT32 screen_update_mpu4plasma(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mpu4plasma(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -49,13 +49,13 @@ static ADDRESS_MAP_START( mpu4plasma_map, AS_PROGRAM, 16, mpu4plasma_state ) AM_RANGE(0xffff04, 0xffff05) AM_WRITE( mpu4plasma_unk_w ) ADDRESS_MAP_END -UINT32 mpu4plasma_state::screen_update_mpu4plasma(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mpu4plasma_state::screen_update_mpu4plasma(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // don't know if this really gets drawn straight from ram.. int base = 0x1600 / 2; - UINT16* rambase = m_plasmaram; - UINT16* dst_bitmap; + uint16_t* rambase = m_plasmaram; + uint16_t* dst_bitmap; int i,y,x,p; i = 0; @@ -66,11 +66,11 @@ UINT32 mpu4plasma_state::screen_update_mpu4plasma(screen_device &screen, bitmap_ for (x=0;x<128/16;x++) { - UINT16 pix = rambase[base+i]; + uint16_t pix = rambase[base+i]; for (p=0;p<16;p++) { - UINT16 bit = (pix << p)&0x8000; + uint16_t bit = (pix << p)&0x8000; if (bit) dst_bitmap[x*16 + p] = 1; else dst_bitmap[x*16 + p] = 0; } diff --git a/src/mame/drivers/mpu4sw.hxx b/src/mame/drivers/mpu4sw.hxx index 0fd2188f7fd..fb871385700 100644 --- a/src/mame/drivers/mpu4sw.hxx +++ b/src/mame/drivers/mpu4sw.hxx @@ -39,7 +39,7 @@ DRIVER_INIT_MEMBER(mpu4_state,m4debug) { // many original barcrest / bwb sets have identification info around here // this helps with sorting - UINT8 *src = memregion( "maincpu" )->base(); + uint8_t *src = memregion( "maincpu" )->base(); int size = memregion( "maincpu" )->bytes(); // m4richfm__e only has 0x004000 @@ -64,8 +64,8 @@ DRIVER_INIT_MEMBER(mpu4_state,m4debug) printf("flags ENABLED\n"); for (int i = 0xff30; i<0xff9f; i+=2) { - UINT8 enable = src[j+i+0]; - UINT8 letter = src[j+i+1]; + uint8_t enable = src[j+i+0]; + uint8_t letter = src[j+i+1]; if (enable == 0x00) { @@ -76,8 +76,8 @@ DRIVER_INIT_MEMBER(mpu4_state,m4debug) printf("flags DISABLED\n"); for (int i = 0xff30; i<0xff9f; i+=2) { - UINT8 enable = src[j+i+0]; - UINT8 letter = src[j+i+1]; + uint8_t enable = src[j+i+0]; + uint8_t letter = src[j+i+1]; if (enable == 0xff) { diff --git a/src/mame/drivers/mpu4vid.cpp b/src/mame/drivers/mpu4vid.cpp index e2bcaf3a50d..1d69eb0ef83 100644 --- a/src/mame/drivers/mpu4vid.cpp +++ b/src/mame/drivers/mpu4vid.cpp @@ -202,16 +202,16 @@ TODO: struct ef9369_t { - UINT32 addr; - UINT16 clut[16]; /* 13-bits - a marking bit and a 444 color */ + uint32_t addr; + uint16_t clut[16]; /* 13-bits - a marking bit and a 444 color */ }; struct bt471_t { - UINT8 address; - UINT8 addr_cnt; - UINT8 pixmask; - UINT8 command; + uint8_t address; + uint8_t addr_cnt; + uint8_t pixmask; + uint8_t command; rgb_t color; }; @@ -236,8 +236,8 @@ public: required_device m_videocpu; optional_device m_scn2674; - optional_shared_ptr m_vid_vidram; - optional_shared_ptr m_vid_mainram; + optional_shared_ptr m_vid_vidram; + optional_shared_ptr m_vid_mainram; required_device m_acia_0; required_device m_acia_1; required_device m_ptm; @@ -249,10 +249,10 @@ public: struct bt471_t m_bt471; //Video - UINT8 m_m6840_irq_state; - UINT8 m_m6850_irq_state; + uint8_t m_m6840_irq_state; + uint8_t m_m6850_irq_state; int m_gfx_index; - INT8 m_cur[2]; + int8_t m_cur[2]; DECLARE_DRIVER_INIT(crmazea); @@ -404,8 +404,8 @@ SCN2674_DRAW_CHARACTER_MEMBER(mpu4vid_state::display_pixels) { if(!lg) { - UINT16 tile = m_vid_mainram[address & 0x7fff]; - const UINT8 *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff); + uint16_t tile = m_vid_mainram[address & 0x7fff]; + const uint8_t *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff); int offset = m_gfxdecode->gfx(m_gfx_index+0)->rowbytes() * linecount; for(int i = 0; i < 8; i++) bitmap.pix32(y, x + i) = (tile >> 12) ? m_palette->pen(line[offset + i]) : m_palette->black_pen(); @@ -441,7 +441,7 @@ VIDEO_START_MEMBER(mpu4vid_state,mpu4_vid) assert(m_gfx_index != MAX_GFX_ELEMENTS); /* create the char set (gfx will then be updated dynamically from RAM) */ - m_gfxdecode->set_gfx(m_gfx_index+0, std::make_unique(*m_palette, mpu4_vid_char_8x8_layout, reinterpret_cast(m_vid_vidram.target()), NATIVE_ENDIAN_VALUE_LE_BE(8,0), m_palette->entries() / 16, 0)); + m_gfxdecode->set_gfx(m_gfx_index+0, std::make_unique(*m_palette, mpu4_vid_char_8x8_layout, reinterpret_cast(m_vid_vidram.target()), NATIVE_ENDIAN_VALUE_LE_BE(8,0), m_palette->entries() / 16, 0)); } @@ -466,7 +466,7 @@ WRITE8_MEMBER(mpu4vid_state::ef9369_w ) /* Data register */ else { - UINT32 entry = pal.addr >> 1; + uint32_t entry = pal.addr >> 1; if ((pal.addr & 1) == 0) { @@ -475,7 +475,7 @@ WRITE8_MEMBER(mpu4vid_state::ef9369_w ) } else { - UINT16 col; + uint16_t col; pal.clut[entry] &= ~0x1f00; pal.clut[entry] |= (data & 0x1f) << 8; @@ -499,7 +499,7 @@ READ8_MEMBER(mpu4vid_state::ef9369_r ) struct ef9369_t &pal = m_pal; if ((offset & 1) == 0) { - UINT16 col = pal.clut[pal.addr >> 1]; + uint16_t col = pal.clut[pal.addr >> 1]; /* if ((pal.addr & 1) == 0) return col & 0xff; @@ -547,7 +547,7 @@ WRITE8_MEMBER(mpu4vid_state::bt471_w ) } case 0x1: { - UINT8 *addr_cnt = &bt471.addr_cnt; + uint8_t *addr_cnt = &bt471.addr_cnt; rgb_t *color = &bt471.color; color[*addr_cnt] = data; @@ -601,15 +601,15 @@ READ8_MEMBER(mpu4vid_state::pia_ic5_porta_track_r) LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",machine().describe_context())); - UINT8 data = m_aux1_port->read(); + uint8_t data = m_aux1_port->read(); - INT8 dx = m_trackx_port->read(); - INT8 dy = m_tracky_port->read(); + int8_t dx = m_trackx_port->read(); + int8_t dy = m_tracky_port->read(); m_cur[0] = dy + dx; m_cur[1] = dy - dx; - UINT8 xa, xb, ya, yb; + uint8_t xa, xb, ya, yb; /* generate pulses for the input port (A and B are 1 unit out of phase for direction sensing)*/ xa = ((m_cur[0] + 1) & 3) <= 1; @@ -1795,7 +1795,7 @@ DRIVER_INIT_MEMBER(mpu4vid_state,cybcas) void mpu4vid_state::mpu4vid_char_cheat( int address) { - UINT8* cheattable = memregion( "video" )->base()+address; + uint8_t* cheattable = memregion( "video" )->base()+address; m_current_chr_table = blank_data; for (int i=0;i<72;i++) { diff --git a/src/mame/drivers/mpu5.cpp b/src/mame/drivers/mpu5.cpp index d3c6c3cd39d..62227614415 100644 --- a/src/mame/drivers/mpu5.cpp +++ b/src/mame/drivers/mpu5.cpp @@ -205,20 +205,20 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - UINT32* m_cpuregion; - std::unique_ptr m_mainram; + uint32_t* m_cpuregion; + std::unique_ptr m_mainram; SEC sec; - UINT8 m_led_strobe_temp; - UINT8 m_led_strobe; - UINT8 m_pic_clk; + uint8_t m_led_strobe_temp; + uint8_t m_led_strobe; + uint8_t m_pic_clk; bool m_pic_transfer_in_progress; - UINT8 m_pic_bit1; - UINT8 m_pic_data; - UINT8 m_pic_clocked_bits; - UINT8 m_pic_stored_input; - UINT8 m_pic_output_bit; - UINT8 m_input_strobe; + uint8_t m_pic_bit1; + uint8_t m_pic_data; + uint8_t m_pic_clocked_bits; + uint8_t m_pic_stored_input; + uint8_t m_pic_output_bit; + uint8_t m_input_strobe; DECLARE_READ32_MEMBER(mpu5_mem_r); DECLARE_WRITE32_MEMBER(mpu5_mem_w); @@ -269,7 +269,7 @@ READ8_MEMBER(mpu5_state::asic_r8) READ32_MEMBER(mpu5_state::asic_r32) { - UINT32 retdata = 0; + uint32_t retdata = 0; if (ACCESSING_BITS_24_31) retdata |= asic_r8(space,(offset*4)+0) <<24; if (ACCESSING_BITS_16_23) retdata |= asic_r8(space,(offset*4)+1) <<16; if (ACCESSING_BITS_8_15) retdata |= asic_r8(space,(offset*4)+2) <<8; @@ -534,8 +534,8 @@ INPUT_PORTS_END void mpu5_state::machine_start() { - m_cpuregion = (UINT32*)memregion( "maincpu" )->base(); - m_mainram = make_unique_clear(0x10000); + m_cpuregion = (uint32_t*)memregion( "maincpu" )->base(); + m_mainram = make_unique_clear(0x10000); m_pic_output_bit =0; } diff --git a/src/mame/drivers/mpz80.cpp b/src/mame/drivers/mpz80.cpp index e5e05a051a4..13b4c8d2732 100644 --- a/src/mame/drivers/mpz80.cpp +++ b/src/mame/drivers/mpz80.cpp @@ -147,9 +147,9 @@ inline void mpz80_state::check_interrupt() inline offs_t mpz80_state::get_address(offs_t offset) { - UINT16 map_addr = ((m_task & 0x0f) << 5) | ((offset & 0xf000) >> 11); - UINT8 map = m_map_ram[map_addr]; - //UINT8 attr = m_map_ram[map_addr + 1]; + uint16_t map_addr = ((m_task & 0x0f) << 5) | ((offset & 0xf000) >> 11); + uint8_t map = m_map_ram[map_addr]; + //uint8_t attr = m_map_ram[map_addr + 1]; //logerror("task %02x map_addr %03x map %02x attr %02x address %06x\n", m_task, map_addr, map, attr, offset); @@ -165,7 +165,7 @@ inline offs_t mpz80_state::get_address(offs_t offset) READ8_MEMBER( mpz80_state::mmu_r ) { m_addr = get_address(offset); - UINT8 data = 0; + uint8_t data = 0; if (m_pretrap) { @@ -205,7 +205,7 @@ READ8_MEMBER( mpz80_state::mmu_r ) } else if (offset < 0xc00) { - UINT16 rom_addr = (m_trap_reset << 10) | (offset & 0x3ff); + uint16_t rom_addr = (m_trap_reset << 10) | (offset & 0x3ff); data = m_rom->base()[rom_addr]; } else @@ -458,7 +458,7 @@ READ8_MEMBER( mpz80_state::switch_r ) */ - UINT8 data = 0; + uint8_t data = 0; // trap reset data |= m_trap_reset; diff --git a/src/mame/drivers/mquake.cpp b/src/mame/drivers/mquake.cpp index f2bf1517e84..4f6c20ce618 100644 --- a/src/mame/drivers/mquake.cpp +++ b/src/mame/drivers/mquake.cpp @@ -60,7 +60,7 @@ public: private: required_device m_es5503; - required_region_ptr m_es5503_rom; + required_region_ptr m_es5503_rom; }; diff --git a/src/mame/drivers/mrdo.cpp b/src/mame/drivers/mrdo.cpp index 4ba5195aeda..a95c42c71ec 100644 --- a/src/mame/drivers/mrdo.cpp +++ b/src/mame/drivers/mrdo.cpp @@ -36,7 +36,7 @@ There's a chance that certain bootlegs might have the different 8/20 MHz XTALS. /* if a read from this address doesn't return the value it expects. */ READ8_MEMBER(mrdo_state::mrdo_SECRE_r) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); return RAM[space.device().state().state_int(Z80_HL)]; } diff --git a/src/mame/drivers/mrgame.cpp b/src/mame/drivers/mrgame.cpp index a17570c5b2e..66a9333be43 100644 --- a/src/mame/drivers/mrgame.cpp +++ b/src/mame/drivers/mrgame.cpp @@ -76,24 +76,24 @@ public: DECLARE_READ8_MEMBER(portc_r); DECLARE_READ8_MEMBER(rsw_r); TIMER_DEVICE_CALLBACK_MEMBER(irq_timer); - UINT32 screen_update_mrgame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mrgame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); std::unique_ptr m_tile_bitmap; required_device m_palette; - required_shared_ptr m_p_videoram; - required_shared_ptr m_p_objectram; + required_shared_ptr m_p_videoram; + required_shared_ptr m_p_objectram; required_device m_gfxdecode; private: bool m_ack1; bool m_ack2; bool m_ackv; bool m_flip; - UINT8 m_irq_state; - UINT8 m_row_data; - UINT8 m_sound_data; - UINT8 m_gfx_bank; - UINT8 m_video_data; - UINT8 m_video_status; - UINT8 m_video_ctrl[8]; + uint8_t m_irq_state; + uint8_t m_row_data; + uint8_t m_sound_data; + uint8_t m_gfx_bank; + uint8_t m_video_data; + uint8_t m_video_status; + uint8_t m_video_ctrl[8]; virtual void machine_start() override; virtual void machine_reset() override; required_device m_maincpu; @@ -207,7 +207,7 @@ INPUT_PORTS_END READ8_MEMBER( mrgame_state::rsw_r ) { - return m_io_dsw0->read() | ((UINT8)m_ack1 << 5) | ((UINT8)m_ack2 << 4); + return m_io_dsw0->read() | ((uint8_t)m_ack1 << 5) | ((uint8_t)m_ack2 << 4); } // this is like a keyboard, energise a row and read the column data @@ -295,7 +295,7 @@ WRITE8_MEMBER( mrgame_state::portb_w ) READ8_MEMBER( mrgame_state::portc_r ) { - return m_io_dsw1->read() | ((UINT8)m_ackv << 4); + return m_io_dsw1->read() | ((uint8_t)m_ackv << 4); } void mrgame_state::machine_start() @@ -372,8 +372,8 @@ PALETTE_INIT_MEMBER( mrgame_state, mrgame) { static const int resistances[3] = { 1000, 470, 220 }; double rweights[3], gweights[3], bweights[2]; - UINT8 i, bit0, bit1, bit2, r, g, b; - const UINT8 *color_prom = machine().root_device().memregion("proms")->base(); + uint8_t i, bit0, bit1, bit2, r, g, b; + const uint8_t *color_prom = machine().root_device().memregion("proms")->base(); /* compute the color output resistor weights */ compute_resistor_weights(0, 255, -1.0, @@ -407,11 +407,11 @@ PALETTE_INIT_MEMBER( mrgame_state, mrgame) } // most of this came from pinmame as the diagram doesn't make a lot of sense -UINT32 mrgame_state::screen_update_mrgame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mrgame_state::screen_update_mrgame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 x,y,ptr=0,col; - INT32 scrolly[32]; - UINT16 chr; + uint8_t x,y,ptr=0,col; + int32_t scrolly[32]; + uint16_t chr; bool flipx,flipy; // text diff --git a/src/mame/drivers/ms0515.cpp b/src/mame/drivers/ms0515.cpp index 89e38f4b16f..d4c852a1f9b 100644 --- a/src/mame/drivers/ms0515.cpp +++ b/src/mame/drivers/ms0515.cpp @@ -33,11 +33,11 @@ public: virtual void machine_reset() override; - UINT8 *m_video_ram; - UINT8 m_sysreg; + uint8_t *m_video_ram; + uint8_t m_sysreg; int m_blink; DECLARE_PALETTE_INIT(ms0515); - UINT32 screen_update_ms0515(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ms0515(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(ms0515_portc_w); }; @@ -87,7 +87,7 @@ ADDRESS_MAP_END WRITE16_MEMBER(ms0515_state::ms0515_bank_w) { - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); membank("bank0")->set_base(ram + 0000000 + BIT(data,0) * 0160000); membank("bank1")->set_base(ram + 0020000 + BIT(data,1) * 0160000); membank("bank2")->set_base(ram + 0040000 + BIT(data,2) * 0160000); @@ -122,7 +122,7 @@ WRITE8_MEMBER(ms0515_state::ms0515_sys_w) void ms0515_state::machine_reset() { - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); ms0515_bank_w(machine().driver_data()->generic_space(),0,0); m_video_ram = ram + 0000000 + 0340000; @@ -141,7 +141,7 @@ static SLOT_INTERFACE_START( ms0515_floppies ) SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // 720 KB SLOT_INTERFACE_END -UINT32 ms0515_state::screen_update_ms0515(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ms0515_state::screen_update_ms0515(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y, x, b; int addr = 0; @@ -151,7 +151,7 @@ UINT32 ms0515_state::screen_update_ms0515(screen_device &screen, bitmap_ind16 &b int horpos = 0; for (x = 0; x < 40; x++) { - UINT16 code = (m_video_ram[addr++] << 8); + uint16_t code = (m_video_ram[addr++] << 8); code += m_video_ram[addr++]; for (b = 0; b < 16; b++) { @@ -166,12 +166,12 @@ UINT32 ms0515_state::screen_update_ms0515(screen_device &screen, bitmap_ind16 &b int horpos = 0; for (x = 0; x < 40; x++) { - UINT8 code = m_video_ram[addr++]; - UINT8 attr = m_video_ram[addr++]; - UINT8 fg = (attr & 7) + BIT(attr,6)*8; - UINT8 bg = ((attr >> 3) & 7) + BIT(attr,6)*8; + uint8_t code = m_video_ram[addr++]; + uint8_t attr = m_video_ram[addr++]; + uint8_t fg = (attr & 7) + BIT(attr,6)*8; + uint8_t bg = ((attr >> 3) & 7) + BIT(attr,6)*8; if (BIT(attr,7) && (m_blink == 20)) { - UINT8 tmp = fg; + uint8_t tmp = fg; fg = bg; bg = tmp; m_blink = -1; } diff --git a/src/mame/drivers/ms32.cpp b/src/mame/drivers/ms32.cpp index 62cdec58fd9..e075b3c865f 100644 --- a/src/mame/drivers/ms32.cpp +++ b/src/mame/drivers/ms32.cpp @@ -180,7 +180,7 @@ Super Strong Warriors CUSTOM_INPUT_MEMBER(ms32_state::mahjong_ctrl_r) { - UINT32 mj_input; + uint32_t mj_input; switch (m_mahjong_input_select[0]) { @@ -2187,7 +2187,7 @@ void ms32_state::configure_banks() DRIVER_INIT_MEMBER(ms32_state,ms32_common) { - m_nvram_8 = std::make_unique(0x2000); + m_nvram_8 = std::make_unique(0x2000); configure_banks(); } @@ -2240,7 +2240,7 @@ DRIVER_INIT_MEMBER(ms32_state,47pie2) DRIVER_INIT_MEMBER(ms32_state,f1superb) { #if 0 // we shouldn't need this hack, something else is wrong, and the x offsets are never copied either, v70 problems?? - UINT32 *pROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *pROM = (uint32_t *)memregion("maincpu")->base(); pROM[0x19d04/4]=0x167a021a; // bne->br : sprite Y offset table is always copied to RAM #endif DRIVER_INIT_CALL(ss92046_01); diff --git a/src/mame/drivers/ms9540.cpp b/src/mame/drivers/ms9540.cpp index 2be054eeb5f..d159fc10bcb 100644 --- a/src/mame/drivers/ms9540.cpp +++ b/src/mame/drivers/ms9540.cpp @@ -43,9 +43,9 @@ public: DECLARE_WRITE8_MEMBER(kbd_put); private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; - required_shared_ptr m_p_base; + required_shared_ptr m_p_base; required_device m_maincpu; required_device m_terminal; }; @@ -67,7 +67,7 @@ INPUT_PORTS_END void ms9540_state::machine_reset() { - UINT8* ROM = memregion("9540")->base(); + uint8_t* ROM = memregion("9540")->base(); memcpy(m_p_base, ROM, 8); m_maincpu->reset(); } diff --git a/src/mame/drivers/msbc1.cpp b/src/mame/drivers/msbc1.cpp index 08178eaec02..25816c299d9 100644 --- a/src/mame/drivers/msbc1.cpp +++ b/src/mame/drivers/msbc1.cpp @@ -70,7 +70,7 @@ INPUT_PORTS_END void msbc1_state::machine_reset() { void *ram = m_maincpu->space(AS_PROGRAM).get_write_ptr(0); - UINT8 *rom = memregion(MC68000R12_TAG)->base(); + uint8_t *rom = memregion(MC68000R12_TAG)->base(); memcpy(ram, rom, 8); diff --git a/src/mame/drivers/msisaac.cpp b/src/mame/drivers/msisaac.cpp index 0e90da0184a..48ec76311a2 100644 --- a/src/mame/drivers/msisaac.cpp +++ b/src/mame/drivers/msisaac.cpp @@ -115,7 +115,7 @@ MCU simulation TODO: //6-down //7-leftdwn - UINT8 val= (ioport("IN1")->read() >> 2) & 0x0f; + uint8_t val= (ioport("IN1")->read() >> 2) & 0x0f; /* bit0 = left bit1 = right bit2 = down @@ -131,7 +131,7 @@ MCU simulation TODO: /* 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 */ /* nochange left right nochange down downlft dwnrght down up upleft uprgt up nochnge left right nochange */ - static const INT8 table[16] = { -1, 2, 6, -1, 0, 1, 7, 0, 4, 3, 5, 4, -1, 2, 6, -1 }; + static const int8_t table[16] = { -1, 2, 6, -1, 0, 1, 7, 0, 4, 3, 5, 4, -1, 2, 6, -1 }; if (table[val] >= 0) m_direction = table[val]; diff --git a/src/mame/drivers/mstation.cpp b/src/mame/drivers/mstation.cpp index 9adf896ade6..da34f317971 100644 --- a/src/mame/drivers/mstation.cpp +++ b/src/mame/drivers/mstation.cpp @@ -53,21 +53,21 @@ public: required_device m_bankdev1; required_device m_bankdev2; required_ioport_array<10> m_keyboard; - required_shared_ptr m_nvram; + required_shared_ptr m_nvram; - UINT8 m_bank1[2]; - UINT8 m_bank2[2]; - UINT8 *m_vram; - UINT8 m_screen_column; - UINT8 m_port2; - UINT8 m_irq; - UINT16 m_kb_matrix; + uint8_t m_bank1[2]; + uint8_t m_bank2[2]; + uint8_t *m_vram; + uint8_t m_screen_column; + uint8_t m_port2; + uint8_t m_irq; + uint16_t m_kb_matrix; DECLARE_READ8_MEMBER( modem_r ); DECLARE_WRITE8_MEMBER( modem_w ); - void lcd_w(UINT16 offset, int column, UINT8 data); - UINT8 lcd_r(UINT16 offset, int column); + void lcd_w(uint16_t offset, int column, uint8_t data); + uint8_t lcd_r(uint16_t offset, int column); DECLARE_READ8_MEMBER( lcd_right_r ); DECLARE_WRITE8_MEMBER( lcd_right_w ); DECLARE_READ8_MEMBER( lcd_left_r ); @@ -90,7 +90,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - 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); DECLARE_PALETTE_INIT(mstation); TIMER_DEVICE_CALLBACK_MEMBER(mstation_1hz_timer); TIMER_DEVICE_CALLBACK_MEMBER(mstation_kb_timer); @@ -111,7 +111,7 @@ WRITE8_MEMBER( mstation_state::modem_w ) // video hardware emulation //***************************************************************************/ -void mstation_state::lcd_w(UINT16 offset, int column, UINT8 data) +void mstation_state::lcd_w(uint16_t offset, int column, uint8_t data) { if (m_port2 & 0x08) m_vram[(column * 240) + (offset % 240)] = data; @@ -119,7 +119,7 @@ void mstation_state::lcd_w(UINT16 offset, int column, UINT8 data) m_screen_column = data % 20; } -UINT8 mstation_state::lcd_r(UINT16 offset, int column) +uint8_t mstation_state::lcd_r(uint16_t offset, int column) { if (m_port2 & 0x08) return m_vram[(column * 240) + (offset % 240)]; @@ -132,12 +132,12 @@ WRITE8_MEMBER( mstation_state::lcd_left_w ) { lcd_w(offset, m_screen_column, d READ8_MEMBER ( mstation_state::lcd_right_r ) { return lcd_r(offset, m_screen_column + 20); } WRITE8_MEMBER( mstation_state::lcd_right_w ) { lcd_w(offset, m_screen_column + 20, data); } -UINT32 mstation_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mstation_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int x=0; x<40; x++) for (int y=0; y<128; y++) { - UINT8 data = m_vram[56 + y + x * 240]; + uint8_t data = m_vram[56 + y + x * 240]; for (int b=0; b<8; b++) { @@ -237,7 +237,7 @@ WRITE8_MEMBER( mstation_state::kb_w ) READ8_MEMBER( mstation_state::kb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i=0; i<10; i++) { @@ -384,7 +384,7 @@ INPUT_PORTS_END void mstation_state::machine_start() { // allocate the videoram - m_vram = (UINT8*)machine().memory().region_alloc( "vram", 9600, 1, ENDIANNESS_LITTLE )->base(); + m_vram = (uint8_t*)machine().memory().region_alloc( "vram", 9600, 1, ENDIANNESS_LITTLE )->base(); // map firsh RAM bank at 0xc000-0xffff membank("sysram")->set_base(m_nvram); diff --git a/src/mame/drivers/mugsmash.cpp b/src/mame/drivers/mugsmash.cpp index 75271f73223..2b61c560ce1 100644 --- a/src/mame/drivers/mugsmash.cpp +++ b/src/mame/drivers/mugsmash.cpp @@ -150,7 +150,7 @@ WRITE16_MEMBER(mugsmash_state::mugsmash_reg2_w) #if USE_FAKE_INPUT_PORTS READ16_MEMBER(mugsmash_state::mugsmash_input_ports_r) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; switch (offset) { diff --git a/src/mame/drivers/multfish.cpp b/src/mame/drivers/multfish.cpp index b913573702b..9463e1188d6 100644 --- a/src/mame/drivers/multfish.cpp +++ b/src/mame/drivers/multfish.cpp @@ -219,7 +219,7 @@ void igrosoft_gamble_state::video_start() m_reel_tilemap->set_scroll_cols(64); } -UINT32 igrosoft_gamble_state::screen_update_igrosoft_gamble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t igrosoft_gamble_state::screen_update_igrosoft_gamble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i; @@ -433,9 +433,9 @@ A10 <-> A18 A12 <-> A13 */ - UINT32 i,j,jscr,romoffset; - UINT8 *igrosoft_gamble_gfx = memregion("gfx")->base(); - std::vector temprom(igrosoft_gamble_ROM_SIZE); + uint32_t i,j,jscr,romoffset; + uint8_t *igrosoft_gamble_gfx = memregion("gfx")->base(); + std::vector temprom(igrosoft_gamble_ROM_SIZE); /* ROM 1 decode */ @@ -480,9 +480,9 @@ A12 <-> A13 } } -static inline void rom_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) +static inline void rom_decodel(uint8_t *romptr, uint8_t *tmprom, uint8_t xor_data, uint32_t xor_add) { - UINT32 i, jscr; + uint32_t i, jscr; for (i = 0; i < igrosoft_gamble_ROM_SIZE; i++) { @@ -491,9 +491,9 @@ static inline void rom_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UIN } memcpy(romptr,tmprom,igrosoft_gamble_ROM_SIZE); } -static inline void rom_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) +static inline void rom_decodeh(uint8_t *romptr, uint8_t *tmprom, uint8_t xor_data, uint32_t xor_add) { - UINT32 i, jscr; + uint32_t i, jscr; for (i = 0; i < igrosoft_gamble_ROM_SIZE; i++) { @@ -503,10 +503,10 @@ static inline void rom_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UIN memcpy(romptr,tmprom,igrosoft_gamble_ROM_SIZE); } -static void lottery_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr) +static void lottery_decode(running_machine &machine, uint8_t xor12, uint8_t xor34, uint8_t xor56, uint8_t xor78, uint32_t xor_addr) { - UINT8 *igrosoft_gamble_gfx = machine.root_device().memregion("gfx")->base(); - std::vector temprom(igrosoft_gamble_ROM_SIZE); + uint8_t *igrosoft_gamble_gfx = machine.root_device().memregion("gfx")->base(); + std::vector temprom(igrosoft_gamble_ROM_SIZE); /* ROMs decode */ rom_decodel(&igrosoft_gamble_gfx[0x000000], &temprom[0], xor12, xor_addr); @@ -519,9 +519,9 @@ static void lottery_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, U rom_decodeh(&igrosoft_gamble_gfx[0x380000], &temprom[0], xor78, xor_addr); } -static inline void roment_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) +static inline void roment_decodel(uint8_t *romptr, uint8_t *tmprom, uint8_t xor_data, uint32_t xor_add) { - UINT32 i, jscr; + uint32_t i, jscr; for (i = 0; i < igrosoft_gamble_ROM_SIZE; i++) { @@ -530,9 +530,9 @@ static inline void roment_decodel(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, } memcpy(romptr,tmprom,igrosoft_gamble_ROM_SIZE); } -static inline void roment_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, UINT32 xor_add) +static inline void roment_decodeh(uint8_t *romptr, uint8_t *tmprom, uint8_t xor_data, uint32_t xor_add) { - UINT32 i, jscr; + uint32_t i, jscr; for (i = 0; i < igrosoft_gamble_ROM_SIZE; i++) { @@ -542,10 +542,10 @@ static inline void roment_decodeh(UINT8 *romptr, UINT8 *tmprom, UINT8 xor_data, memcpy(romptr,tmprom,igrosoft_gamble_ROM_SIZE); } -static void ent_decode(running_machine &machine, UINT8 xor12, UINT8 xor34, UINT8 xor56, UINT8 xor78, UINT32 xor_addr) +static void ent_decode(running_machine &machine, uint8_t xor12, uint8_t xor34, uint8_t xor56, uint8_t xor78, uint32_t xor_addr) { - UINT8 *igrosoft_gamble_gfx = machine.root_device().memregion("gfx")->base(); - std::vector temprom(igrosoft_gamble_ROM_SIZE); + uint8_t *igrosoft_gamble_gfx = machine.root_device().memregion("gfx")->base(); + std::vector temprom(igrosoft_gamble_ROM_SIZE); /* ROMs decode */ roment_decodel(&igrosoft_gamble_gfx[0x000000], &temprom[0], xor12, xor_addr); diff --git a/src/mame/drivers/multi16.cpp b/src/mame/drivers/multi16.cpp index 2e3dc0f7575..5a5911f6c7b 100644 --- a/src/mame/drivers/multi16.cpp +++ b/src/mame/drivers/multi16.cpp @@ -30,12 +30,12 @@ public: required_device m_palette; DECLARE_WRITE8_MEMBER(multi16_6845_address_w); DECLARE_WRITE8_MEMBER(multi16_6845_data_w); - required_shared_ptr m_p_vram; - UINT8 m_crtc_vreg[0x100],m_crtc_index; + required_shared_ptr m_p_vram; + uint8_t m_crtc_vreg[0x100],m_crtc_index; virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_multi16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_multi16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -61,7 +61,7 @@ void multi16_state::video_start() #define mc6845_update_addr (((m_crtc_vreg[0x12]<<8) & 0x3f00) | (m_crtc_vreg[0x13] & 0xff)) -UINT32 multi16_state::screen_update_multi16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t multi16_state::screen_update_multi16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int count; diff --git a/src/mame/drivers/multi8.cpp b/src/mame/drivers/multi8.cpp index 0739638b5ab..3a01417fd92 100644 --- a/src/mame/drivers/multi8.cpp +++ b/src/mame/drivers/multi8.cpp @@ -50,28 +50,28 @@ public: DECLARE_WRITE8_MEMBER(portb_w); DECLARE_WRITE8_MEMBER(portc_w); DECLARE_WRITE8_MEMBER(ym2203_porta_w); - UINT8 *m_p_vram; - UINT8 *m_p_wram; - UINT8 *m_p_kanji; - UINT8 *m_p_chargen; - UINT8 m_mcu_init; - UINT8 m_keyb_press; - UINT8 m_keyb_press_flag; - UINT8 m_shift_press_flag; - UINT8 m_display_reg; - UINT8 m_crtc_vreg[0x100],m_crtc_index; - UINT8 m_vram_bank; - UINT8 m_pen_clut[8]; - UINT8 m_bw_mode; - UINT16 m_knj_addr; + uint8_t *m_p_vram; + uint8_t *m_p_wram; + uint8_t *m_p_kanji; + uint8_t *m_p_chargen; + uint8_t m_mcu_init; + uint8_t m_keyb_press; + uint8_t m_keyb_press_flag; + uint8_t m_shift_press_flag; + uint8_t m_display_reg; + uint8_t m_crtc_vreg[0x100],m_crtc_index; + uint8_t m_vram_bank; + uint8_t m_pen_clut[8]; + uint8_t m_bw_mode; + uint16_t m_knj_addr; DECLARE_READ8_MEMBER(ay8912_0_r); DECLARE_READ8_MEMBER(ay8912_1_r); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_multi8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_multi8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); - void multi8_draw_pixel(bitmap_ind16 &bitmap,int y,int x,UINT8 pen,UINT8 width); + void multi8_draw_pixel(bitmap_ind16 &bitmap,int y,int x,uint8_t pen,uint8_t width); }; #define mc6845_h_char_total (m_crtc_vreg[0]) @@ -103,7 +103,7 @@ void multi8_state::video_start() m_p_chargen = memregion("chargen")->base(); } -void multi8_state::multi8_draw_pixel(bitmap_ind16 &bitmap,int y,int x,UINT8 pen,UINT8 width) +void multi8_state::multi8_draw_pixel(bitmap_ind16 &bitmap,int y,int x,uint8_t pen,uint8_t width) { if(!machine().first_screen()->visible_area().contains(x, y)) return; @@ -117,11 +117,11 @@ void multi8_state::multi8_draw_pixel(bitmap_ind16 &bitmap,int y,int x,UINT8 pen, bitmap.pix16(y, x) = pen; } -UINT32 multi8_state::screen_update_multi8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t multi8_state::screen_update_multi8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count; - UINT8 x_width; - UINT8 xi,yi; + uint8_t x_width; + uint8_t xi,yi; count = 0x0000; @@ -264,7 +264,7 @@ READ8_MEMBER( multi8_state::key_status_r ) READ8_MEMBER( multi8_state::multi8_vram_r ) { - UINT8 res; + uint8_t res; if (!BIT(m_vram_bank, 4)) //select plain work ram return m_p_wram[offset]; @@ -316,7 +316,7 @@ WRITE8_MEMBER( multi8_state::pal_w ) { m_pen_clut[offset] = data; - UINT8 i; + uint8_t i; for(i=0;i<8;i++) { if (m_pen_clut[i]) @@ -488,7 +488,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(multi8_state::keyboard_callback) { static const char *const portnames[3] = { "key1","key2","key3" }; int i,port_i,scancode; - UINT8 keymod = ioport("key_modifiers")->read() & 0x1f; + uint8_t keymod = ioport("key_modifiers")->read() & 0x1f; scancode = 0; m_shift_press_flag = ((keymod & 0x02) >> 1); diff --git a/src/mame/drivers/multigam.cpp b/src/mame/drivers/multigam.cpp index e3f72a883a0..a25889e7fc8 100644 --- a/src/mame/drivers/multigam.cpp +++ b/src/mame/drivers/multigam.cpp @@ -128,40 +128,40 @@ public: required_ioport m_p2; optional_ioport m_dsw; - std::unique_ptr m_nt_ram; - std::unique_ptr m_vram; - UINT8* m_nt_page[4]; - UINT32 m_in_0; - UINT32 m_in_1; - UINT32 m_in_0_shift; - UINT32 m_in_1_shift; - UINT32 m_in_dsw; - UINT32 m_in_dsw_shift; + std::unique_ptr m_nt_ram; + std::unique_ptr m_vram; + uint8_t* m_nt_page[4]; + uint32_t m_in_0; + uint32_t m_in_1; + uint32_t m_in_0_shift; + uint32_t m_in_1_shift; + uint32_t m_in_dsw; + uint32_t m_in_dsw_shift; int m_game_gfx_bank; int m_multigam3_mmc3_scanline_counter; int m_multigam3_mmc3_scanline_latch; int m_multigam3_mmc3_banks[2]; int m_multigam3_mmc3_4screen; int m_multigam3_mmc3_last_bank; - std::unique_ptr m_multigmc_mmc3_6000_ram; - UINT8* m_multigam3_mmc3_prg_base; + std::unique_ptr m_multigmc_mmc3_6000_ram; + uint8_t* m_multigam3_mmc3_prg_base; int m_multigam3_mmc3_prg_size; int m_multigam3_mmc3_chr_bank_base; int m_multigam3_mmc3_command; - UINT8* m_mapper02_prg_base; + uint8_t* m_mapper02_prg_base; int m_mapper02_prg_size; int m_mmc1_shiftreg; int m_mmc1_shiftcount; int m_mmc1_rom_mask; - UINT8* m_mmc1_prg_base; + uint8_t* m_mmc1_prg_base; int m_mmc1_prg_size; int m_mmc1_chr_bank_base; int m_mmc1_reg_write_enable; int m_size16k; int m_switchlow; int m_vrom4k; - UINT8 m_supergm3_prg_bank; - UINT8 m_supergm3_chr_bank; + uint8_t m_supergm3_prg_bank; + uint8_t m_supergm3_chr_bank; DECLARE_CUSTOM_INPUT_MEMBER(multigam_inputs_r); DECLARE_WRITE8_MEMBER(multigam_nt_w); DECLARE_READ8_MEMBER(multigam_nt_r); @@ -191,15 +191,15 @@ public: DECLARE_MACHINE_START(multigm3); DECLARE_MACHINE_RESET(multigm3); DECLARE_MACHINE_START(supergm3); - UINT32 screen_update_multigam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_multigam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(mmc1_resync_callback); void set_videorom_bank( int start, int count, int bank, int bank_size_in_kb); void set_videoram_bank( int start, int count, int bank, int bank_size_in_kb); - void multigam_init_mmc3(UINT8 *prg_base, int prg_size, int chr_bank_base); - void multigam_init_mapper02(UINT8* prg_base, int prg_size); - void multigam_init_mmc1(UINT8 *prg_base, int prg_size, int chr_bank_base); + void multigam_init_mmc3(uint8_t *prg_base, int prg_size, int chr_bank_base); + void multigam_init_mapper02(uint8_t* prg_base, int prg_size); + void multigam_init_mmc1(uint8_t *prg_base, int prg_size, int chr_bank_base); void supergm3_set_bank(); - void multigm3_decrypt(UINT8* mem, int memsize, const UINT8* decode_nibble); + void multigm3_decrypt(uint8_t* mem, int memsize, const uint8_t* decode_nibble); void multigam3_mmc3_scanline_cb(int scanline, int vblank, int blanked); void ppu_irq(int *ppu_regs); }; @@ -348,8 +348,8 @@ CUSTOM_INPUT_MEMBER(multigam_state::multigam_inputs_r) WRITE8_MEMBER(multigam_state::multigam_switch_prg_rom) { /* switch PRG rom */ - UINT8* dst = memregion("maincpu")->base(); - UINT8* src = memregion("user1")->base(); + uint8_t* dst = memregion("maincpu")->base(); + uint8_t* src = memregion("user1")->base(); if (data & 0x80) { @@ -456,7 +456,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w) if (m_multigam3_mmc3_last_bank != (data & 0xc0)) { int bank; - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); /* reset the banks */ if (m_multigam3_mmc3_command & 0x40) @@ -486,7 +486,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w) case 0x0001: { - UINT8 cmd = m_multigam3_mmc3_command & 0x07; + uint8_t cmd = m_multigam3_mmc3_command & 0x07; int page = (m_multigam3_mmc3_command & 0x80) >> 5; int bank; @@ -509,7 +509,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w) case 6: /* program banking */ { - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); if (m_multigam3_mmc3_command & 0x40) { /* high bank */ @@ -534,7 +534,7 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w) case 7: /* program banking */ { /* mid bank */ - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); m_multigam3_mmc3_banks[1] = data & bankmask; bank = m_multigam3_mmc3_banks[1] * 0x2000; @@ -590,9 +590,9 @@ WRITE8_MEMBER(multigam_state::multigam3_mmc3_rom_switch_w) } } -void multigam_state::multigam_init_mmc3(UINT8 *prg_base, int prg_size, int chr_bank_base) +void multigam_state::multigam_init_mmc3(uint8_t *prg_base, int prg_size, int chr_bank_base) { - UINT8* dst = memregion("maincpu")->base(); + uint8_t* dst = memregion("maincpu")->base(); // Tom & Jerry in Super Game III enables 6000 ram, but does not read/write it // however, it expects ROM from 6000 there (code jumps to $6xxx) @@ -636,8 +636,8 @@ WRITE8_MEMBER(multigam_state::multigm3_switch_gfx_rom) WRITE8_MEMBER(multigam_state::multigm3_switch_prg_rom) { /* switch PRG rom */ - UINT8* dst = memregion("maincpu")->base(); - UINT8* src = memregion("user1")->base(); + uint8_t* dst = memregion("maincpu")->base(); + uint8_t* src = memregion("user1")->base(); if (data == 0xa8) { @@ -697,14 +697,14 @@ ADDRESS_MAP_END WRITE8_MEMBER(multigam_state::multigam3_mapper02_rom_switch_w) { - UINT8* mem = memregion("maincpu")->base(); + uint8_t* mem = memregion("maincpu")->base(); int bankmask = (m_mapper02_prg_size/0x4000) - 1; memcpy(mem + 0x8000, m_mapper02_prg_base + 0x4000*(data & bankmask), 0x4000); } -void multigam_state::multigam_init_mapper02(UINT8* prg_base, int prg_size) +void multigam_state::multigam_init_mapper02(uint8_t* prg_base, int prg_size) { - UINT8* mem = memregion("maincpu")->base(); + uint8_t* mem = memregion("maincpu")->base(); memcpy(mem + 0x8000, prg_base + prg_size - 0x8000, 0x8000); m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::multigam3_mapper02_rom_switch_w),this)); @@ -823,7 +823,7 @@ WRITE8_MEMBER(multigam_state::mmc1_rom_switch_w) case 3: /* program banking */ { int bank = (m_mmc1_shiftreg & m_mmc1_rom_mask) * 0x4000; - UINT8 *prg = memregion("maincpu")->base(); + uint8_t *prg = memregion("maincpu")->base(); if (!m_size16k) { @@ -853,9 +853,9 @@ WRITE8_MEMBER(multigam_state::mmc1_rom_switch_w) } } -void multigam_state::multigam_init_mmc1(UINT8 *prg_base, int prg_size, int chr_bank_base) +void multigam_state::multigam_init_mmc1(uint8_t *prg_base, int prg_size, int chr_bank_base) { - UINT8* dst = memregion("maincpu")->base(); + uint8_t* dst = memregion("maincpu")->base(); memcpy(&dst[0x8000], prg_base + (prg_size - 0x8000), 0x8000); @@ -895,7 +895,7 @@ void multigam_state::multigam_init_mmc1(UINT8 *prg_base, int prg_size, int chr_b void multigam_state::supergm3_set_bank() { - UINT8* mem = memregion("maincpu")->base(); + uint8_t* mem = memregion("maincpu")->base(); // video bank if (m_supergm3_chr_bank == 0x10 || @@ -1133,7 +1133,7 @@ void multigam_state::video_start() { } -UINT32 multigam_state::screen_update_multigam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t multigam_state::screen_update_multigam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* render the ppu */ m_ppu->render(bitmap, 0, 0, 0, 0); @@ -1163,7 +1163,7 @@ MACHINE_RESET_MEMBER(multigam_state,multigm3) void multigam_state::machine_start() { - m_nt_ram = std::make_unique(0x1000); + m_nt_ram = std::make_unique(0x1000); m_nt_page[0] = m_nt_ram.get(); m_nt_page[1] = m_nt_ram.get() + 0x400; m_nt_page[2] = m_nt_ram.get() + 0x800; @@ -1176,7 +1176,7 @@ void multigam_state::machine_start() MACHINE_START_MEMBER(multigam_state,multigm3) { - m_nt_ram = std::make_unique(0x1000); + m_nt_ram = std::make_unique(0x1000); m_nt_page[0] = m_nt_ram.get(); m_nt_page[1] = m_nt_ram.get() + 0x400; m_nt_page[2] = m_nt_ram.get() + 0x800; @@ -1198,7 +1198,7 @@ MACHINE_START_MEMBER(multigam_state,multigm3) MACHINE_START_MEMBER(multigam_state,supergm3) { - m_nt_ram = std::make_unique(0x1000); + m_nt_ram = std::make_unique(0x1000); m_nt_page[0] = m_nt_ram.get(); m_nt_page[1] = m_nt_ram.get() + 0x400; m_nt_page[2] = m_nt_ram.get() + 0x800; @@ -1206,8 +1206,8 @@ MACHINE_START_MEMBER(multigam_state,supergm3) m_ppu->space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(multigam_state::multigam_nt_r),this), write8_delegate(FUNC(multigam_state::multigam_nt_w),this)); - m_vram = std::make_unique(0x2000); - m_multigmc_mmc3_6000_ram = std::make_unique(0x2000); + m_vram = std::make_unique(0x2000); + m_multigmc_mmc3_6000_ram = std::make_unique(0x2000); } static MACHINE_CONFIG_START( multigam, multigam_state ) @@ -1393,7 +1393,7 @@ DRIVER_INIT_MEMBER(multigam_state,multigam) multigam_switch_prg_rom(space, 0x0, 0x01); } -void multigam_state::multigm3_decrypt(UINT8* mem, int memsize, const UINT8* decode_nibble) +void multigam_state::multigm3_decrypt(uint8_t* mem, int memsize, const uint8_t* decode_nibble) { int i; for (i = 0; i < memsize; i++) @@ -1406,12 +1406,12 @@ DRIVER_INIT_MEMBER(multigam_state,multigm3) { address_space &space = m_maincpu->space(AS_PROGRAM); - const UINT8 decode[16] = { 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a }; + const uint8_t decode[16] = { 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a }; multigm3_decrypt(memregion("maincpu")->base(), memregion("maincpu")->bytes(), decode ); multigm3_decrypt(memregion("user1")->base(), memregion("user1")->bytes(), decode ); - m_multigmc_mmc3_6000_ram = std::make_unique(0x2000); + m_multigmc_mmc3_6000_ram = std::make_unique(0x2000); multigam_switch_prg_rom(space, 0x0, 0x01); } @@ -1420,8 +1420,8 @@ DRIVER_INIT_MEMBER(multigam_state,multigmt) { address_space &space = m_maincpu->space(AS_PROGRAM); - std::vector buf(0x80000); - UINT8 *rom; + std::vector buf(0x80000); + uint8_t *rom; int size; int i; int addr; diff --git a/src/mame/drivers/murogem.cpp b/src/mame/drivers/murogem.cpp index a39c141e09d..9935e42dea5 100644 --- a/src/mame/drivers/murogem.cpp +++ b/src/mame/drivers/murogem.cpp @@ -129,12 +129,12 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; DECLARE_WRITE8_MEMBER(outport_w); DECLARE_PALETTE_INIT(murogem); - 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); }; @@ -217,7 +217,7 @@ GFXDECODE_END PALETTE_INIT_MEMBER(murogem_state, murogem) {} -UINT32 murogem_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t murogem_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int xx,yy,count; count = 0x000; diff --git a/src/mame/drivers/murogmbl.cpp b/src/mame/drivers/murogmbl.cpp index fead2b8200b..e2b827548da 100644 --- a/src/mame/drivers/murogmbl.cpp +++ b/src/mame/drivers/murogmbl.cpp @@ -55,18 +55,18 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_video; + required_shared_ptr m_video; virtual void video_start() override; DECLARE_PALETTE_INIT(murogmbl); - 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); }; PALETTE_INIT_MEMBER(murogmbl_state, murogmbl) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit0, bit1, bit2 , r, g, b; int i; @@ -106,7 +106,7 @@ void murogmbl_state::video_start() { } -UINT32 murogmbl_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t murogmbl_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int count = 0; diff --git a/src/mame/drivers/mustache.cpp b/src/mame/drivers/mustache.cpp index 5703c6ffb74..2ed632e1d72 100644 --- a/src/mame/drivers/mustache.cpp +++ b/src/mame/drivers/mustache.cpp @@ -237,14 +237,14 @@ DRIVER_INIT_MEMBER(mustache_state,mustache) int G1 = memregion("gfx1")->bytes()/3; int G2 = memregion("gfx2")->bytes()/2; - UINT8 *gfx1 = memregion("gfx1")->base(); - UINT8 *gfx2 = memregion("gfx2")->base(); - std::vector buf(G2*2); + uint8_t *gfx1 = memregion("gfx1")->base(); + uint8_t *gfx2 = memregion("gfx2")->base(); + std::vector buf(G2*2); /* BG data lines */ for (i=0;i m_sccterm2; // Pointer to System ROMs needed by bootvect_r and masking RAM buffer for post reset accesses - UINT32 *m_sysrom; - UINT32 m_sysram[2]; + uint32_t *m_sysrom; + uint32_t m_sysram[2]; // PCC registers - UINT8 m_genpurp_stat; + uint8_t m_genpurp_stat; // VME chip registers - UINT8 m_vc_cntl_conf; + uint8_t m_vc_cntl_conf; }; static ADDRESS_MAP_START (mvme147_mem, AS_PROGRAM, 32, mvme147_state) @@ -255,7 +255,7 @@ void mvme147_state::machine_start () LOG(("--->%s\n", FUNCNAME)); /* Setup pointer to bootvector in ROM for bootvector handler bootvect_r */ - m_sysrom = (UINT32*)(memregion ("roms")->base () + 0x800000); + m_sysrom = (uint32_t*)(memregion ("roms")->base () + 0x800000); m_genpurp_stat = 0x02; /* Indicate power up reset */ m_vc_cntl_conf = 0x01; /* We are the system controller */ } @@ -266,7 +266,7 @@ void mvme147_state::machine_reset () /* Reset pointer to bootvector in ROM for bootvector handler bootvect_r */ if (m_sysrom == &m_sysram[0]) /* Condition needed because memory map is not setup first time */ - m_sysrom = (UINT32*)(memregion ("roms")->base () + 0x800000); + m_sysrom = (uint32_t*)(memregion ("roms")->base () + 0x800000); m_genpurp_stat &= 0xfe; /* Clear parity error bit - not used by MAME at this point so just for the record */ } @@ -312,7 +312,7 @@ WRITE32_MEMBER (mvme147_state::pcc32_w){ #define P16_TIMER2_COUNT (P16BASE + 6) READ16_MEMBER (mvme147_state::pcc16_r){ - UINT16 ret = 0; + uint16_t ret = 0; LOG(("Call to %s[%04x]", FUNCNAME, offset)); switch(offset) @@ -369,7 +369,7 @@ WRITE16_MEMBER (mvme147_state::pcc16_w){ #define P8_PRINTER_STATUS 0xfffe2800 READ8_MEMBER (mvme147_state::pcc8_r){ - UINT8 ret = 0; + uint8_t ret = 0; LOG(("Call to %s[%04x] ", FUNCNAME, offset)); switch(offset + P8BASE) @@ -492,7 +492,7 @@ WRITE8_MEMBER (mvme147_state::pcc8_w){ READ8_MEMBER (mvme147_state::vmechip_r){ - UINT8 ret = 0; + uint8_t ret = 0; LOG(("Call to %s[%04x] ", FUNCNAME, offset)); switch(offset * 2 + VCBASE) @@ -609,7 +609,7 @@ WRITE8_MEMBER (mvme147_state::vmechip_w){ /* Dummy VME access methods until the VME bus device is ready for use */ READ16_MEMBER (mvme147_state::vme_a24_r){ LOG (logerror ("vme_a24_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (mvme147_state::vme_a24_w){ @@ -618,7 +618,7 @@ WRITE16_MEMBER (mvme147_state::vme_a24_w){ READ16_MEMBER (mvme147_state::vme_a16_r){ LOG (logerror ("vme_16_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (mvme147_state::vme_a16_w){ diff --git a/src/mame/drivers/mvme350.cpp b/src/mame/drivers/mvme350.cpp index 64f66ee8418..624cdad5d00 100644 --- a/src/mame/drivers/mvme350.cpp +++ b/src/mame/drivers/mvme350.cpp @@ -201,7 +201,7 @@ void mvme350_state::machine_reset () /* Dummy VME access methods until the VME bus device is ready for use */ READ16_MEMBER (mvme350_state::vme_a24_r){ LOG (logerror ("vme_a24_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (mvme350_state::vme_a24_w){ @@ -210,7 +210,7 @@ WRITE16_MEMBER (mvme350_state::vme_a24_w){ READ16_MEMBER (mvme350_state::vme_a16_r){ LOG (logerror ("vme_16_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (mvme350_state::vme_a16_w){ diff --git a/src/mame/drivers/mw18w.cpp b/src/mame/drivers/mw18w.cpp index 7cf8e087138..0e24a1b7b51 100644 --- a/src/mame/drivers/mw18w.cpp +++ b/src/mame/drivers/mw18w.cpp @@ -138,7 +138,7 @@ WRITE8_MEMBER(mw18w_state::mw18w_lamps_w) WRITE8_MEMBER(mw18w_state::mw18w_led_display_w) { // d0-3: 7448 (BCD to LED segment) - const UINT8 _7448_map[16] = + const uint8_t _7448_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; // d4-7: 7442 (BCD to decimal) -> pick digit panel diff --git a/src/mame/drivers/mw8080bw.cpp b/src/mame/drivers/mw8080bw.cpp index 679a334813b..f9054d29e03 100644 --- a/src/mame/drivers/mw8080bw.cpp +++ b/src/mame/drivers/mw8080bw.cpp @@ -174,7 +174,7 @@ READ8_MEMBER(mw8080bw_state::mw8080bw_shift_result_rev_r) { - UINT8 ret = m_mb14241->shift_result_r(space, 0); + uint8_t ret = m_mb14241->shift_result_r(space, 0); return BITSWAP8(ret,0,1,2,3,4,5,6,7); } @@ -182,7 +182,7 @@ READ8_MEMBER(mw8080bw_state::mw8080bw_shift_result_rev_r) READ8_MEMBER(mw8080bw_state::mw8080bw_reversable_shift_result_r) { - UINT8 ret; + uint8_t ret; if (m_rev_shift_res) { @@ -286,7 +286,7 @@ WRITE8_MEMBER(mw8080bw_state::seawolf_explosion_lamp_w) "EXP_LAMP_C", "EXP_LAMP_D", "EXP_LAMP_E", "EXP_LAMP_F" }; - static const UINT8 bits_for_lamps[] = + static const uint8_t bits_for_lamps[] = { 0x18, 0x14, 0x12, 0x11, 0x28, 0x24, 0x22, 0x21, @@ -297,7 +297,7 @@ WRITE8_MEMBER(mw8080bw_state::seawolf_explosion_lamp_w) /* set each lamp */ for (i = 0; i < 16; i++) { - UINT8 bits_for_lamp = bits_for_lamps[i]; + uint8_t bits_for_lamp = bits_for_lamps[i]; output().set_value(lamp_names[i], (data & bits_for_lamp) == bits_for_lamp); } @@ -553,7 +553,7 @@ MACHINE_CONFIG_END #define TORNBASE_CAB_TYPE_PORT_TAG ("CAB") -UINT8 mw8080bw_state::tornbase_get_cabinet_type() +uint8_t mw8080bw_state::tornbase_get_cabinet_type() { return ioport(TORNBASE_CAB_TYPE_PORT_TAG)->read(); } @@ -567,7 +567,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_hit_left_input_r) CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_hit_right_input_r) { - UINT32 ret; + uint32_t ret; switch (tornbase_get_cabinet_type()) { @@ -588,7 +588,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_hit_right_input_r) CUSTOM_INPUT_MEMBER(mw8080bw_state::tornbase_pitch_left_input_r) { - UINT32 ret; + uint32_t ret; switch (tornbase_get_cabinet_type()) { @@ -1184,7 +1184,7 @@ MACHINE_START_MEMBER(mw8080bw_state,desertgu) CUSTOM_INPUT_MEMBER(mw8080bw_state::desertgu_gun_input_r) { - UINT32 ret; + uint32_t ret; if (m_desertgun_controller_select) ret = ioport(DESERTGU_GUN_X_PORT_TAG)->read(); @@ -1197,7 +1197,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::desertgu_gun_input_r) CUSTOM_INPUT_MEMBER(mw8080bw_state::desertgu_dip_sw_0_1_r) { - UINT32 ret; + uint32_t ret; if (m_desertgun_controller_select) ret = ioport(DESERTGU_DIP_SW_0_1_SET_2_TAG)->read(); @@ -1315,7 +1315,7 @@ MACHINE_CONFIG_END CUSTOM_INPUT_MEMBER(mw8080bw_state::dplay_pitch_left_input_r) { - UINT32 ret; + uint32_t ret; if (ioport(DPLAY_CAB_TYPE_PORT_TAG)->read() == DPLAY_CAB_TYPE_UPRIGHT) ret = ioport(DPLAY_L_PITCH_PORT_TAG)->read(); @@ -1706,7 +1706,7 @@ MACHINE_START_MEMBER(mw8080bw_state,clowns) CUSTOM_INPUT_MEMBER(mw8080bw_state::clowns_controller_r) { - UINT32 ret; + uint32_t ret; if (m_clowns_controller_select) { @@ -2166,7 +2166,7 @@ WRITE8_MEMBER(mw8080bw_state::spcenctr_io_w) else if ((offset & 0x07) == 0x03) { /* - - - - - 0 1 1 */ - UINT8 addr = ((offset & 0xc0) >> 4) | ((offset & 0x18) >> 3); + uint8_t addr = ((offset & 0xc0) >> 4) | ((offset & 0x18) >> 3); m_spcenctr_trench_slope[addr] = data; } else if ((offset & 0x07) == 0x04) @@ -2524,7 +2524,7 @@ MACHINE_START_MEMBER(mw8080bw_state,invaders) CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_coin_input_r) { - UINT32 ret = ioport(INVADERS_COIN_INPUT_PORT_TAG)->read(); + uint32_t ret = ioport(INVADERS_COIN_INPUT_PORT_TAG)->read(); machine().bookkeeping().coin_counter_w(0, !ret); @@ -2534,7 +2534,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_coin_input_r) CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_sw6_sw7_r) { - UINT32 ret; + uint32_t ret; /* upright PCB : switches visible cocktail PCB: HI */ @@ -2550,7 +2550,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_sw6_sw7_r) CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_sw5_r) { - UINT32 ret; + uint32_t ret; /* upright PCB : switch visible cocktail PCB: HI */ @@ -2566,7 +2566,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_sw5_r) CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_in0_control_r) { - UINT32 ret; + uint32_t ret; /* upright PCB : P1 controls cocktail PCB: HI */ @@ -2588,7 +2588,7 @@ CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_in1_control_r) CUSTOM_INPUT_MEMBER(mw8080bw_state::invaders_in2_control_r) { - UINT32 ret; + uint32_t ret; /* upright PCB : P1 controls cocktail PCB: P2 controls */ @@ -2733,7 +2733,7 @@ MACHINE_CONFIG_END CUSTOM_INPUT_MEMBER(mw8080bw_state::blueshrk_coin_input_r) { - UINT32 ret = ioport(BLUESHRK_COIN_INPUT_PORT_TAG)->read(); + uint32_t ret = ioport(BLUESHRK_COIN_INPUT_PORT_TAG)->read(); machine().bookkeeping().coin_counter_w(0, !ret); @@ -2812,9 +2812,9 @@ MACHINE_CONFIG_END #ifdef UNUSED_FUNCTION -UINT32 mw8080bw_state::invad2ct_coin_input_r(void *param) +uint32_t mw8080bw_state::invad2ct_coin_input_r(void *param) { - UINT32 ret = ioport(INVAD2CT_COIN_INPUT_PORT_TAG)->read(); + uint32_t ret = ioport(INVAD2CT_COIN_INPUT_PORT_TAG)->read(); coin_counter_w(machine, 0, !ret); diff --git a/src/mame/drivers/mwarr.cpp b/src/mame/drivers/mwarr.cpp index aded5d473f4..6d34a3363e8 100644 --- a/src/mame/drivers/mwarr.cpp +++ b/src/mame/drivers/mwarr.cpp @@ -69,16 +69,16 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_bg_videoram; - required_shared_ptr m_mlow_videoram; - required_shared_ptr m_mhigh_videoram; - required_shared_ptr m_tx_videoram; - required_shared_ptr m_bg_scrollram; - required_shared_ptr m_mlow_scrollram; - required_shared_ptr m_mhigh_scrollram; - required_shared_ptr m_vidattrram; - required_shared_ptr m_spriteram; - required_shared_ptr m_mwarr_ram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_mlow_videoram; + required_shared_ptr m_mhigh_videoram; + required_shared_ptr m_tx_videoram; + required_shared_ptr m_bg_scrollram; + required_shared_ptr m_mlow_scrollram; + required_shared_ptr m_mhigh_scrollram; + required_shared_ptr m_vidattrram; + required_shared_ptr m_spriteram; + required_shared_ptr m_mwarr_ram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -89,7 +89,7 @@ public: /* misc */ int m_which; - UINT16 m_sprites_buffer[0x800]; + uint16_t m_sprites_buffer[0x800]; DECLARE_WRITE16_MEMBER(bg_videoram_w); DECLARE_WRITE16_MEMBER(mlow_videoram_w); DECLARE_WRITE16_MEMBER(mhigh_videoram_w); @@ -104,7 +104,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mwarr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mwarr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_oki2; @@ -415,8 +415,8 @@ void mwarr_state::video_start() void mwarr_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { - const UINT16 *source = m_sprites_buffer + 0x800 - 4; - const UINT16 *finish = m_sprites_buffer; + const uint16_t *source = m_sprites_buffer + 0x800 - 4; + const uint16_t *finish = m_sprites_buffer; gfx_element *gfx = m_gfxdecode->gfx(0); int x, y, color, flipx, dy, pri, pri_mask, i; @@ -479,7 +479,7 @@ void mwarr_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, con } } -UINT32 mwarr_state::screen_update_mwarr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mwarr_state::screen_update_mwarr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i; diff --git a/src/mame/drivers/mwsub.cpp b/src/mame/drivers/mwsub.cpp index 5cfa56271db..38672507557 100644 --- a/src/mame/drivers/mwsub.cpp +++ b/src/mame/drivers/mwsub.cpp @@ -108,7 +108,7 @@ WRITE8_MEMBER(submar_state::submar_sound_w) WRITE8_MEMBER(submar_state::submar_led_w) { // 7447 (BCD to LED segment) - const UINT8 _7447_map[16] = + const uint8_t _7447_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; // 2 digits per write. port 4: time, port 5: score diff --git a/src/mame/drivers/mx2178.cpp b/src/mame/drivers/mx2178.cpp index c0e09f69578..c8256a2699a 100644 --- a/src/mame/drivers/mx2178.cpp +++ b/src/mame/drivers/mx2178.cpp @@ -45,14 +45,14 @@ public: DECLARE_WRITE_LINE_MEMBER(write_acia_clock); MC6845_UPDATE_ROW(crtc_update_row); - const UINT8 *m_p_chargen; - required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + required_shared_ptr m_p_videoram; protected: virtual void machine_reset() override; private: - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; required_device m_acia; public: @@ -85,7 +85,7 @@ READ8_MEMBER( mx2178_state::keyin_r ) { if (offset) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -102,9 +102,9 @@ WRITE8_MEMBER( mx2178_state::kbd_put ) MC6845_UPDATE_ROW( mx2178_state::crtc_update_row ) { const rgb_t *pens = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { diff --git a/src/mame/drivers/myb3k.cpp b/src/mame/drivers/myb3k.cpp index 97ceaf9b2fe..8b6f6b00a40 100644 --- a/src/mame/drivers/myb3k.cpp +++ b/src/mame/drivers/myb3k.cpp @@ -39,14 +39,14 @@ public: DECLARE_WRITE8_MEMBER(myb3k_6845_data_w); DECLARE_WRITE8_MEMBER(myb3k_video_mode_w); DECLARE_WRITE8_MEMBER(myb3k_fdc_output_w); - required_shared_ptr m_p_vram; + required_shared_ptr m_p_vram; required_device m_palette; - UINT8 m_crtc_vreg[0x100],m_crtc_index; - UINT8 m_vmode; + uint8_t m_crtc_vreg[0x100],m_crtc_index; + uint8_t m_vmode; virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_myb3k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_myb3k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; void myb3k_state::video_start() @@ -71,7 +71,7 @@ void myb3k_state::video_start() #define mc6845_update_addr (((m_crtc_vreg[0x12]<<8) & 0x3f00) | (m_crtc_vreg[0x13] & 0xff)) -UINT32 myb3k_state::screen_update_myb3k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t myb3k_state::screen_update_myb3k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int xi,yi; diff --git a/src/mame/drivers/mycom.cpp b/src/mame/drivers/mycom.cpp index ca84002695e..2ee718c675f 100644 --- a/src/mame/drivers/mycom.cpp +++ b/src/mame/drivers/mycom.cpp @@ -94,16 +94,16 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(mycom_kbd); DECLARE_WRITE8_MEMBER(mycom_rtc_w); MC6845_UPDATE_ROW(crtc_update_row); - UINT8 *m_p_videoram; - UINT8 *m_p_chargen; - UINT8 m_0a; + uint8_t *m_p_videoram; + uint8_t *m_p_chargen; + uint8_t m_0a; private: - UINT16 m_i_videoram; - UINT8 m_keyb_press; - UINT8 m_keyb_press_flag; - UINT8 m_sn_we; - UINT32 m_upper_sw; - UINT8 *m_p_ram; + uint16_t m_i_videoram; + uint8_t m_keyb_press; + uint8_t m_keyb_press_flag; + uint8_t m_sn_we; + uint32_t m_upper_sw; + uint8_t *m_p_ram; virtual void machine_reset() override; virtual void machine_start() override; virtual void video_start() override; @@ -134,15 +134,15 @@ void mycom_state::video_start() MC6845_UPDATE_ROW( mycom_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx=0,z; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx=0,z; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); if (m_0a & 0x40) { for (x = 0; x < x_count; x++) // lores pixels { - UINT8 dbit=1; + uint8_t dbit=1; if (x == cursor_x) dbit=0; mem = (ma + x) & 0x7ff; chr = m_p_videoram[mem]; @@ -162,7 +162,7 @@ MC6845_UPDATE_ROW( mycom_state::crtc_update_row ) { for (x = 0; x < x_count; x++) // text { - UINT8 inv=0; + uint8_t inv=0; if (x == cursor_x) inv=0xff; mem = (ma + x) & 0x7ff; if (ra > 7) @@ -358,7 +358,7 @@ READ8_MEMBER( mycom_state::mycom_08_r ) ---- --x- keyboard shift ---- ---x keyboard strobe */ - UINT8 data = 0; + uint8_t data = 0; data = m_keyb_press_flag; //~m_keyb_press_flag & 1; @@ -424,7 +424,7 @@ WRITE8_MEMBER(mycom_state::mycom_rtc_w) m_rtc->cs_w(BIT(data, 7)); } -static const UINT8 mycom_keyval[] = { 0, +static const uint8_t mycom_keyval[] = { 0, 0x1b,0x1b,0x7c,0x7c,0x18,0x18,0x0f,0x0f,0x09,0x09,0x1c,0x1c,0x30,0x00,0x50,0x70,0x3b,0x2b, 0x00,0x00,0x31,0x21,0x51,0x71,0x41,0x61,0x5a,0x7a,0x17,0x17,0x2d,0x3d,0x40,0x60,0x3a,0x2a, 0x0b,0x0b,0x32,0x22,0x57,0x77,0x53,0x73,0x58,0x78,0x03,0x03,0x5e,0x7e,0x5b,0x7b,0x5d,0x7d, @@ -438,11 +438,11 @@ static const UINT8 mycom_keyval[] = { 0, TIMER_DEVICE_CALLBACK_MEMBER(mycom_state::mycom_kbd) { - UINT8 x, y, scancode = 0; - UINT16 pressed[9]; + uint8_t x, y, scancode = 0; + uint16_t pressed[9]; char kbdrow[3]; - UINT8 modifiers = ioport("XX")->read(); - UINT8 shift_pressed = (modifiers & 2) >> 1; + uint8_t modifiers = ioport("XX")->read(); + uint8_t shift_pressed = (modifiers & 2) >> 1; m_keyb_press_flag = 0; /* see what is pressed */ @@ -497,7 +497,7 @@ void mycom_state::machine_reset() DRIVER_INIT_MEMBER(mycom_state,mycom) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0x10000); } diff --git a/src/mame/drivers/myvision.cpp b/src/mame/drivers/myvision.cpp index 81977c9d608..5a2e6b8554b 100644 --- a/src/mame/drivers/myvision.cpp +++ b/src/mame/drivers/myvision.cpp @@ -55,7 +55,7 @@ private: virtual void machine_reset() override; required_device m_maincpu; required_device m_cart; - UINT8 m_column; + uint8_t m_column; required_ioport m_io_row0; required_ioport m_io_row1; required_ioport m_io_row2; @@ -142,7 +142,7 @@ void myvision_state::machine_reset() DEVICE_IMAGE_LOAD_MEMBER( myvision_state, cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size != 0x4000 && size != 0x6000) { @@ -159,7 +159,7 @@ DEVICE_IMAGE_LOAD_MEMBER( myvision_state, cart ) READ8_MEMBER( myvision_state::ay_port_a_r ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; if ( ! ( m_column & 0x80 ) ) { diff --git a/src/mame/drivers/mz2000.cpp b/src/mame/drivers/mz2000.cpp index 99d78f6466e..e81558922da 100644 --- a/src/mame/drivers/mz2000.cpp +++ b/src/mame/drivers/mz2000.cpp @@ -74,24 +74,24 @@ public: floppy_image_device *m_floppy; - UINT8 m_ipl_enable; - UINT8 m_tvram_enable; - UINT8 m_gvram_enable; - UINT8 m_gvram_bank; + uint8_t m_ipl_enable; + uint8_t m_tvram_enable; + uint8_t m_gvram_enable; + uint8_t m_gvram_bank; - UINT8 m_key_mux; + uint8_t m_key_mux; - UINT8 m_old_portc; - UINT8 m_width80; - UINT8 m_tvram_attr; - UINT8 m_gvram_mask; + uint8_t m_old_portc; + uint8_t m_width80; + uint8_t m_tvram_attr; + uint8_t m_gvram_mask; - UINT8 m_color_mode; - UINT8 m_has_fdc; - UINT8 m_hi_mode; + uint8_t m_color_mode; + uint8_t m_has_fdc; + uint8_t m_hi_mode; - UINT8 m_porta_latch; - UINT8 m_tape_ctrl; + uint8_t m_porta_latch; + uint8_t m_tape_ctrl; DECLARE_READ8_MEMBER(mz2000_ipl_r); DECLARE_READ8_MEMBER(mz2000_wram_r); DECLARE_WRITE8_MEMBER(mz2000_wram_w); @@ -109,7 +109,7 @@ public: DECLARE_WRITE8_MEMBER(mz2000_gvram_mask_w); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mz2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mz2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(fdc_r); DECLARE_WRITE8_MEMBER(fdc_w); DECLARE_READ8_MEMBER(mz2000_porta_r); @@ -145,14 +145,14 @@ void mz2000_state::video_start() { } -UINT32 mz2000_state::screen_update_mz2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mz2000_state::screen_update_mz2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *tvram = m_region_tvram->base(); - UINT8 *gvram = m_region_gvram->base(); - UINT8 *gfx_data = m_region_chargen->base(); + uint8_t *tvram = m_region_tvram->base(); + uint8_t *gvram = m_region_gvram->base(); + uint8_t *gfx_data = m_region_chargen->base(); int x,y,xi,yi; - UINT8 x_size; - UINT32 count; + uint8_t x_size; + uint32_t count; count = 0; @@ -181,8 +181,8 @@ UINT32 mz2000_state::screen_update_mz2000(screen_device &screen, bitmap_ind16 &b { for(x=0;x> 12; @@ -297,7 +297,7 @@ READ8_MEMBER(mz2000_state::mz2000_mem_r) return mz2000_gvram_r(space,offset & 0x3fff); else { - UINT16 wram_mask = (m_ipl_enable) ? 0x7fff : 0xffff; + uint16_t wram_mask = (m_ipl_enable) ? 0x7fff : 0xffff; return mz2000_wram_r(space,offset & wram_mask); } } @@ -307,7 +307,7 @@ READ8_MEMBER(mz2000_state::mz2000_mem_r) WRITE8_MEMBER(mz2000_state::mz2000_mem_w) { - UINT8 page_mem; + uint8_t page_mem; page_mem = (offset & 0xf000) >> 12; @@ -322,7 +322,7 @@ WRITE8_MEMBER(mz2000_state::mz2000_mem_w) mz2000_gvram_w(space,offset & 0x3fff,data); else { - UINT16 wram_mask = (m_ipl_enable) ? 0x7fff : 0xffff; + uint16_t wram_mask = (m_ipl_enable) ? 0x7fff : 0xffff; mz2000_wram_w(space,offset & wram_mask,data); } @@ -693,7 +693,7 @@ READ8_MEMBER(mz2000_state::mz2000_portb_r) ---- x--- end of tape reached ---- ---x "blank" control */ - UINT8 res = 0x80; + uint8_t res = 0x80; if(m_cass->get_image() != nullptr) { diff --git a/src/mame/drivers/mz2500.cpp b/src/mame/drivers/mz2500.cpp index e07e05c1e7c..c7fb550dd22 100644 --- a/src/mame/drivers/mz2500.cpp +++ b/src/mame/drivers/mz2500.cpp @@ -93,61 +93,61 @@ public: floppy_image_device *m_floppy; - std::unique_ptr m_main_ram; - UINT8 *m_ipl_rom; - UINT8 *m_kanji_rom; - UINT8 *m_kanji2_rom; - std::unique_ptr m_pcg_ram; - std::unique_ptr m_emm_ram; - UINT8 *m_dic_rom; - UINT8 *m_phone_rom; - UINT8 *m_iplpro_rom; - - UINT8 m_bank_val[8]; - UINT8 m_bank_addr; - UINT8 m_irq_sel; - UINT8 m_irq_vector[4]; - UINT8 m_irq_mask[4]; - UINT8 m_irq_pending[4]; - UINT8 m_kanji_bank; - UINT8 m_dic_bank; - UINT8 m_fdc_reverse; - UINT8 m_key_mux; - UINT8 m_monitor_type; - UINT8 m_text_reg[0x100]; - UINT8 m_text_reg_index; - UINT8 m_text_col_size; - UINT8 m_text_font_reg; - UINT8 m_pal_select; - UINT16 m_cg_vs; - UINT16 m_cg_ve; - UINT16 m_cg_hs; - UINT16 m_cg_he; - INT16 m_tv_vs; - INT16 m_tv_ve; - INT16 m_tv_hs; - INT16 m_tv_he; - UINT8 m_cg_latch[4]; - UINT8 m_cg_reg_index; - UINT8 m_cg_reg[0x20]; - UINT8 m_clut16[0x10]; - UINT16 m_clut256[0x100]; - UINT8 m_cg_mask; + std::unique_ptr m_main_ram; + uint8_t *m_ipl_rom; + uint8_t *m_kanji_rom; + uint8_t *m_kanji2_rom; + std::unique_ptr m_pcg_ram; + std::unique_ptr m_emm_ram; + uint8_t *m_dic_rom; + uint8_t *m_phone_rom; + uint8_t *m_iplpro_rom; + + uint8_t m_bank_val[8]; + uint8_t m_bank_addr; + uint8_t m_irq_sel; + uint8_t m_irq_vector[4]; + uint8_t m_irq_mask[4]; + uint8_t m_irq_pending[4]; + uint8_t m_kanji_bank; + uint8_t m_dic_bank; + uint8_t m_fdc_reverse; + uint8_t m_key_mux; + uint8_t m_monitor_type; + uint8_t m_text_reg[0x100]; + uint8_t m_text_reg_index; + uint8_t m_text_col_size; + uint8_t m_text_font_reg; + uint8_t m_pal_select; + uint16_t m_cg_vs; + uint16_t m_cg_ve; + uint16_t m_cg_hs; + uint16_t m_cg_he; + int16_t m_tv_vs; + int16_t m_tv_ve; + int16_t m_tv_hs; + int16_t m_tv_he; + uint8_t m_cg_latch[4]; + uint8_t m_cg_reg_index; + uint8_t m_cg_reg[0x20]; + uint8_t m_clut16[0x10]; + uint16_t m_clut256[0x100]; + uint8_t m_cg_mask; int m_scr_x_size; int m_scr_y_size; - UINT8 m_cg_clear_flag; - UINT32 m_rom_index; - UINT8 m_hrom_index; - UINT8 m_lrom_index; - struct { UINT8 r,g,b; } m_pal[16]; - UINT8 m_joy_mode; - UINT16 m_kanji_index; - UINT32 m_emm_offset; - UINT8 m_old_portc; - UINT8 m_prev_col_val; - UINT8 m_pio_latchb; - UINT8 m_ym_porta; - UINT8 m_screen_enable; + uint8_t m_cg_clear_flag; + uint32_t m_rom_index; + uint8_t m_hrom_index; + uint8_t m_lrom_index; + struct { uint8_t r,g,b; } m_pal[16]; + uint8_t m_joy_mode; + uint16_t m_kanji_index; + uint32_t m_emm_offset; + uint8_t m_old_portc; + uint8_t m_prev_col_val; + uint8_t m_pio_latchb; + uint8_t m_ym_porta; + uint8_t m_screen_enable; DECLARE_READ8_MEMBER(bank0_r); DECLARE_READ8_MEMBER(bank1_r); DECLARE_READ8_MEMBER(bank2_r); @@ -193,14 +193,14 @@ public: DECLARE_READ8_MEMBER(mz2500_emm_data_r); DECLARE_WRITE8_MEMBER(mz2500_emm_addr_w); DECLARE_WRITE8_MEMBER(mz2500_emm_data_w); - UINT8 mz2500_cg_latch_compare(); - UINT8 mz2500_ram_read(UINT16 offset, UINT8 bank_num); - void mz2500_ram_write(UINT16 offset, UINT8 data, UINT8 bank_num); + uint8_t mz2500_cg_latch_compare(); + uint8_t mz2500_ram_read(uint16_t offset, uint8_t bank_num); + void mz2500_ram_write(uint16_t offset, uint8_t data, uint8_t bank_num); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(mz2500); - UINT32 screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mz2500_vbl); DECLARE_READ8_MEMBER(fdc_r); @@ -222,18 +222,18 @@ public: DECLARE_WRITE_LINE_MEMBER(mz2500_rtc_alarm_irq); IRQ_CALLBACK_MEMBER( mz2500_irq_ack ); - void draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UINT16 map_addr); - void draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,UINT16 map_addr); + void draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,uint16_t map_addr); + void draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,uint16_t map_addr); void draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); void draw_cg16_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,int x_size,int pri); void draw_cg256_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,int pri); void draw_tv_screen(bitmap_ind16 &bitmap,const rectangle &cliprect); void draw_cg_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); - void mz2500_draw_pixel(bitmap_ind16 &bitmap,int x,int y,UINT16 pen,UINT8 width,UINT8 height); + void mz2500_draw_pixel(bitmap_ind16 &bitmap,int x,int y,uint16_t pen,uint8_t width,uint8_t height); void mz2500_reconfigure_screen(); - UINT8 pal_256_param(int index, int param); - void mz2500_reset(mz2500_state *state, UINT8 type); + uint8_t pal_256_param(int index, int param); + void mz2500_reset(mz2500_state *state, uint8_t type); required_device m_palette; }; @@ -243,7 +243,7 @@ public: #define WRAM_RESET 0 #define IPL_RESET 1 -static const UINT8 bank_reset_val[2][8] = +static const uint8_t bank_reset_val[2][8] = { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }, { 0x34, 0x35, 0x36, 0x37, 0x04, 0x05, 0x06, 0x07 } @@ -266,7 +266,7 @@ void mz2500_state::video_start() */ /* helper function, to draw stuff without getting crazy with height / width conditions :) */ -void mz2500_state::mz2500_draw_pixel(bitmap_ind16 &bitmap,int x,int y,UINT16 pen,UINT8 width,UINT8 height) +void mz2500_state::mz2500_draw_pixel(bitmap_ind16 &bitmap,int x,int y,uint16_t pen,uint8_t width,uint8_t height) { if(width && height) { @@ -289,14 +289,14 @@ void mz2500_state::mz2500_draw_pixel(bitmap_ind16 &bitmap,int x,int y,UINT16 pe bitmap.pix16(y, x) = m_palette->pen(pen); } -void mz2500_state::draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UINT16 map_addr) +void mz2500_state::draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,uint16_t map_addr) { - UINT8 *vram = m_main_ram.get(); // TODO + uint8_t *vram = m_main_ram.get(); // TODO int x,y,count,xi,yi; - UINT8 *gfx_data; - UINT8 y_step; - UINT8 s_y; - UINT8 y_height; + uint8_t *gfx_data; + uint8_t y_step; + uint8_t s_y; + uint8_t y_height; count = (map_addr & 0x7ff); @@ -341,7 +341,7 @@ void mz2500_state::draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UIN { for(xi=0;xi<8;xi++) { - UINT8 pen_bit[3],pen; + uint8_t pen_bit[3],pen; int res_x,res_y; res_x = x*8+xi; @@ -378,14 +378,14 @@ void mz2500_state::draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UIN } } -void mz2500_state::draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,UINT16 map_addr) +void mz2500_state::draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,uint16_t map_addr) { - UINT8 *vram = m_main_ram.get(); // TODO + uint8_t *vram = m_main_ram.get(); // TODO int x,y,count,xi,yi; - UINT8 *gfx_data; - UINT8 y_step; - UINT8 s_y; - UINT8 y_height; + uint8_t *gfx_data; + uint8_t y_step; + uint8_t s_y; + uint8_t y_height; count = (((plane * 0x400) + map_addr) & 0x7ff); @@ -431,7 +431,7 @@ void mz2500_state::draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int { for(xi=0;xi<8;xi++) { - UINT8 pen_bit[3],pen; + uint8_t pen_bit[3],pen; int res_x,res_y; res_x = x*8+xi; @@ -470,9 +470,9 @@ void mz2500_state::draw_40x25(bitmap_ind16 &bitmap,const rectangle &cliprect,int void mz2500_state::draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri) { - UINT32 count; - UINT8 *vram = m_main_ram.get(); // TODO - UINT8 pen,pen_bit[2]; + uint32_t count; + uint8_t *vram = m_main_ram.get(); // TODO + uint8_t pen,pen_bit[2]; int x,y,xi,pen_i; int res_x,res_y; @@ -511,16 +511,16 @@ void mz2500_state::draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprec void mz2500_state::draw_cg16_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,int x_size,int pri) { - UINT32 count; - UINT8 *vram = m_main_ram.get(); //TODO - UINT8 pen,pen_bit[4]; + uint32_t count; + uint8_t *vram = m_main_ram.get(); //TODO + uint8_t pen,pen_bit[4]; int x,y,xi,pen_i; - UINT32 wa_reg; - UINT8 s_x; - UINT8 base_mask; + uint32_t wa_reg; + uint8_t s_x; + uint8_t base_mask; int res_x,res_y; - UINT8 cg_interlace; - UINT8 pen_mask; + uint8_t cg_interlace; + uint8_t pen_mask; base_mask = (x_size == 640) ? 0x3f : 0x1f; @@ -568,15 +568,15 @@ void mz2500_state::draw_cg16_screen(bitmap_ind16 &bitmap,const rectangle &clipre void mz2500_state::draw_cg256_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int plane,int pri) { - UINT32 count; - UINT8 *vram = m_main_ram.get(); - UINT8 pen,pen_bit[8]; + uint32_t count; + uint8_t *vram = m_main_ram.get(); + uint8_t pen,pen_bit[8]; int x,y,xi,pen_i; - UINT32 wa_reg; - UINT8 s_x; - UINT8 base_mask; + uint32_t wa_reg; + uint8_t s_x; + uint8_t base_mask; int res_x,res_y; - UINT8 cg_interlace; + uint8_t cg_interlace; base_mask = 0x3f; //no x_size == 640 @@ -625,7 +625,7 @@ void mz2500_state::draw_cg256_screen(bitmap_ind16 &bitmap,const rectangle &clipr void mz2500_state::draw_tv_screen(bitmap_ind16 &bitmap,const rectangle &cliprect) { - UINT16 base_addr; + uint16_t base_addr; base_addr = m_text_reg[1] | ((m_text_reg[2] & 0x7) << 8); @@ -694,7 +694,7 @@ void mz2500_state::draw_cg_screen(bitmap_ind16 &bitmap,const rectangle &cliprect } } -UINT32 mz2500_state::screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mz2500_state::screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->pen(0), cliprect); //TODO: correct? @@ -780,12 +780,12 @@ void mz2500_state::mz2500_reconfigure_screen() } } -UINT8 mz2500_state::mz2500_cg_latch_compare() +uint8_t mz2500_state::mz2500_cg_latch_compare() { - UINT8 compare_val = m_cg_reg[0x07] & 0xf; - UINT8 pix_val; - UINT8 res; - UINT16 i; + uint8_t compare_val = m_cg_reg[0x07] & 0xf; + uint8_t pix_val; + uint8_t res; + uint16_t i; res = 0; for(i=1;i<0x100;i<<=1) @@ -798,10 +798,10 @@ UINT8 mz2500_state::mz2500_cg_latch_compare() return res; } -UINT8 mz2500_state::mz2500_ram_read(UINT16 offset, UINT8 bank_num) +uint8_t mz2500_state::mz2500_ram_read(uint16_t offset, uint8_t bank_num) { - UINT8 *ram = m_main_ram.get(); // TODO - UINT8 cur_bank = m_bank_val[bank_num]; + uint8_t *ram = m_main_ram.get(); // TODO + uint8_t cur_bank = m_bank_val[bank_num]; switch(cur_bank) { @@ -856,10 +856,10 @@ UINT8 mz2500_state::mz2500_ram_read(UINT16 offset, UINT8 bank_num) return 0xff; } -void mz2500_state::mz2500_ram_write(UINT16 offset, UINT8 data, UINT8 bank_num) +void mz2500_state::mz2500_ram_write(uint16_t offset, uint8_t data, uint8_t bank_num) { - UINT8 *ram = m_main_ram.get(); // TODO - UINT8 cur_bank = m_bank_val[bank_num]; + uint8_t *ram = m_main_ram.get(); // TODO + uint8_t cur_bank = m_bank_val[bank_num]; // if(cur_bank >= 0x30 && cur_bank <= 0x33) // printf("CG REG = %02x %02x %02x %02x | offset = %04x | data = %02x\n",m_cg_reg[0],m_cg_reg[1],m_cg_reg[2],m_cg_reg[3],offset,data); @@ -1007,7 +1007,7 @@ WRITE8_MEMBER(mz2500_state::mz2500_bank_addr_w) READ8_MEMBER(mz2500_state::mz2500_bank_data_r) { - UINT8 res; + uint8_t res; res = m_bank_val[m_bank_addr]; @@ -1045,7 +1045,7 @@ WRITE8_MEMBER(mz2500_state::mz2500_dictionary_bank_w) /* 0xf4 - 0xf7 all returns vblank / hblank states */ READ8_MEMBER(mz2500_state::mz2500_crtc_hvblank_r) { - UINT8 vblank_bit, hblank_bit; + uint8_t vblank_bit, hblank_bit; vblank_bit = machine().first_screen()->vblank() ? 0 : 1; hblank_bit = machine().first_screen()->hblank() ? 0 : 2; @@ -1077,9 +1077,9 @@ TVRAM / CRTC registers [0x0f] ---- x--- sets monitor type interlace / progressive */ -UINT8 mz2500_state::pal_256_param(int index, int param) +uint8_t mz2500_state::pal_256_param(int index, int param) { - UINT8 val = 0; + uint8_t val = 0; switch(param & 3) { @@ -1116,7 +1116,7 @@ WRITE8_MEMBER(mz2500_state::mz2500_tv_crtc_w) if(m_text_reg_index == 0x0a) // set 256 color palette { int i,r,g,b; - UINT8 b_param,r_param,g_param; + uint8_t b_param,r_param,g_param; b_param = (data & 0x03) >> 0; r_param = (data & 0x0c) >> 2; @@ -1252,8 +1252,8 @@ WRITE8_MEMBER(mz2500_state::mz2500_rom_w) /* sets 16 color entries out of 4096 possible combinations */ WRITE8_MEMBER(mz2500_state::palette4096_io_w) { - UINT8 pal_index; - UINT8 pal_entry; + uint8_t pal_index; + uint8_t pal_entry; pal_index = m_maincpu->state_int(Z80_B); pal_entry = (pal_index & 0x1e) >> 1; @@ -1292,7 +1292,7 @@ READ8_MEMBER(mz2500_state::mz2500_rplane_latch_r) { if(m_cg_reg[0x07] & 0x10) { - UINT8 vblank_bit; + uint8_t vblank_bit; vblank_bit = machine().first_screen()->vblank() ? 0 : 0x80 | m_cg_clear_flag; @@ -1359,9 +1359,9 @@ WRITE8_MEMBER(mz2500_state::mz2500_cg_data_w) if((m_cg_reg_index & 0x1f) == 0x05 && (m_cg_reg[0x05] & 0xc0) == 0x80) //clear bitmap buffer { - UINT32 i; - UINT8 *vram = m_main_ram.get(); // TODO - UINT32 layer_bank; + uint32_t i; + uint8_t *vram = m_main_ram.get(); // TODO + uint32_t layer_bank; layer_bank = (m_cg_reg[0x0e] & 0x80) ? 0x10000 : 0x00000; @@ -1410,7 +1410,7 @@ WRITE8_MEMBER(mz2500_state::timer_w) READ8_MEMBER(mz2500_state::mz2500_joystick_r) { - UINT8 res,dir_en,in_r; + uint8_t res,dir_en,in_r; res = 0xff; in_r = ~ioport(m_joy_mode & 0x40 ? "JOY_2P" : "JOY_1P")->read(); @@ -1456,14 +1456,14 @@ WRITE8_MEMBER(mz2500_state::mz2500_kanji_w) READ8_MEMBER(mz2500_state::rp5c15_8_r) { - UINT8 rtc_index = (m_maincpu->state_int(Z80_B)); + uint8_t rtc_index = (m_maincpu->state_int(Z80_B)); return m_rtc->read(space, rtc_index); } WRITE8_MEMBER(mz2500_state::rp5c15_8_w) { - UINT8 rtc_index = (m_maincpu->state_int(Z80_B)); + uint8_t rtc_index = (m_maincpu->state_int(Z80_B)); m_rtc->write(space, rtc_index, data); } @@ -1471,7 +1471,7 @@ WRITE8_MEMBER(mz2500_state::rp5c15_8_w) READ8_MEMBER(mz2500_state::mz2500_emm_data_r) { - UINT8 emm_lo_index; + uint8_t emm_lo_index; emm_lo_index = (m_maincpu->state_int(Z80_B)); @@ -1485,7 +1485,7 @@ READ8_MEMBER(mz2500_state::mz2500_emm_data_r) WRITE8_MEMBER(mz2500_state::mz2500_emm_addr_w) { - UINT8 emm_hi_index; + uint8_t emm_hi_index; emm_hi_index = (m_maincpu->state_int(Z80_B)); @@ -1494,7 +1494,7 @@ WRITE8_MEMBER(mz2500_state::mz2500_emm_addr_w) WRITE8_MEMBER(mz2500_state::mz2500_emm_data_w) { - UINT8 emm_lo_index; + uint8_t emm_lo_index; emm_lo_index = (m_maincpu->state_int(Z80_B)); @@ -1722,7 +1722,7 @@ static INPUT_PORTS_START( mz2500 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -void mz2500_state::mz2500_reset(mz2500_state *state, UINT8 type) +void mz2500_state::mz2500_reset(mz2500_state *state, uint8_t type) { int i; @@ -1755,12 +1755,12 @@ static const gfx_layout mz2500_pcg_layout_3bpp = void mz2500_state::machine_start() { /* TODO: main RAM actually needs to be splitted */ - m_main_ram = make_unique_clear(0x80000); - m_pcg_ram = make_unique_clear(0x2000); + m_main_ram = make_unique_clear(0x80000); + m_pcg_ram = make_unique_clear(0x2000); m_ipl_rom = memregion("ipl")->base(); m_kanji_rom = memregion("kanji")->base(); m_kanji2_rom = memregion("kanji2")->base(); - m_emm_ram = make_unique_clear(0x100000); + m_emm_ram = make_unique_clear(0x100000); m_dic_rom = memregion("dictionary")->base(); m_phone_rom = memregion("phone")->base(); m_iplpro_rom = memregion("iplpro")->base(); @@ -1776,7 +1776,7 @@ void mz2500_state::machine_start() void mz2500_state::machine_reset() { - UINT32 i; + uint32_t i; mz2500_reset(this, IPL_RESET); @@ -1888,7 +1888,7 @@ READ8_MEMBER(mz2500_state::mz2500_porta_r) READ8_MEMBER(mz2500_state::mz2500_portb_r) { - UINT8 vblank_bit; + uint8_t vblank_bit; vblank_bit = machine().first_screen()->vblank() ? 0 : 1; //Guess: NOBO wants this bit to be high/low diff --git a/src/mame/drivers/mz3500.cpp b/src/mame/drivers/mz3500.cpp index 308148718cf..20f46da0cc7 100644 --- a/src/mame/drivers/mz3500.cpp +++ b/src/mame/drivers/mz3500.cpp @@ -61,22 +61,22 @@ public: required_device m_hgdc1; required_device m_hgdc2; required_device m_fdc; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; required_device m_beeper; required_device m_palette; - UINT8 *m_ipl_rom; - UINT8 *m_basic_rom; - std::unique_ptr m_work_ram; - std::unique_ptr m_shared_ram; - UINT8 *m_char_rom; + uint8_t *m_ipl_rom; + uint8_t *m_basic_rom; + std::unique_ptr m_work_ram; + std::unique_ptr m_shared_ram; + uint8_t *m_char_rom; - UINT8 m_ma,m_mo,m_ms,m_me2,m_me1; - UINT8 m_crtc[0x10]; + uint8_t m_ma,m_mo,m_ms,m_me2,m_me1; + uint8_t m_crtc[0x10]; - UINT8 m_srdy; + uint8_t m_srdy; - UINT8 m_fdd_sel; + uint8_t m_fdd_sel; DECLARE_READ8_MEMBER(mz3500_master_mem_r); DECLARE_WRITE8_MEMBER(mz3500_master_mem_w); @@ -97,7 +97,7 @@ public: DECLARE_WRITE8_MEMBER(mz3500_pc_w); // screen updates - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UPD7220_DISPLAY_PIXELS_MEMBER( hgdc_display_pixels ); UPD7220_DRAW_TEXT_LINE_MEMBER( hgdc_draw_text ); @@ -158,11 +158,11 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( mz3500_state::hgdc_draw_text ) int xi,yi; int tile; int attr; - UINT8 tile_data; - UINT8 width80; - UINT8 char_size; - UINT8 hires; - UINT8 color_mode; + uint8_t tile_data; + uint8_t width80; + uint8_t char_size; + uint8_t hires; + uint8_t color_mode; // popmessage("%02x",m_crtc[6]); @@ -232,7 +232,7 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( mz3500_state::hgdc_draw_text ) } -UINT32 mz3500_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t mz3500_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { bitmap.fill(m_palette->pen((m_crtc[4] & 2) ? m_crtc[3] & 7 : 0), cliprect); @@ -741,8 +741,8 @@ void mz3500_state::machine_start() m_ipl_rom = memregion("ipl")->base(); m_basic_rom = memregion("basic")->base(); m_char_rom = memregion("gfx1")->base(); - m_work_ram = make_unique_clear(0x40000); - m_shared_ram = make_unique_clear(0x800); + m_work_ram = make_unique_clear(0x40000); + m_shared_ram = make_unique_clear(0x800); static const char *const m_fddnames[4] = { "upd765a:0", "upd765a:1", "upd765a:2", "upd765a:3"}; diff --git a/src/mame/drivers/mz6500.cpp b/src/mame/drivers/mz6500.cpp index d513f30a33e..4314226b988 100644 --- a/src/mame/drivers/mz6500.cpp +++ b/src/mame/drivers/mz6500.cpp @@ -30,7 +30,7 @@ public: DECLARE_WRITE8_MEMBER(mz6500_vram_w); void fdc_irq(bool state); void fdc_drq(bool state); - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; virtual void machine_reset() override; virtual void video_start() override; required_device m_maincpu; @@ -42,7 +42,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( mz6500_state::hgdc_display_pixels ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); int gfx[3]; - UINT8 i,pen; + uint8_t i,pen; gfx[0] = m_video_ram[(address + 0x00000) >> 1]; gfx[1] = m_video_ram[(address + 0x10000) >> 1]; diff --git a/src/mame/drivers/mzr8105.cpp b/src/mame/drivers/mzr8105.cpp index ea2049ed8cf..69b0d54a67b 100644 --- a/src/mame/drivers/mzr8105.cpp +++ b/src/mame/drivers/mzr8105.cpp @@ -212,10 +212,10 @@ required_device m_maincpu; required_device m_updterm; // Pointer to System ROMs needed by bootvect_r -// UINT16 *m_sysrom; +// uint16_t *m_sysrom; #if CARDSLOT -UINT16 *m_usrrom; +uint16_t *m_usrrom; required_device m_cart; #endif }; @@ -252,7 +252,7 @@ void mzr8105_state::machine_start () /* Map user ROM/RAM socket(s) */ if (m_cart->exists()) { - m_usrrom = (UINT16*)m_cart->get_rom_base(); + m_usrrom = (uint16_t*)m_cart->get_rom_base(); m_maincpu->space(AS_PROGRAM).install_read_handler(0xa0000, 0xbffff, read16_delegate(FUNC(generic_slot_device::read16_rom), (generic_slot_device*)m_cart)); } #endif @@ -261,7 +261,7 @@ void mzr8105_state::machine_start () /* Dummy VME access methods until the VME bus device is ready for use */ READ16_MEMBER (mzr8105_state::vme_a24_r){ LOG (logerror ("vme_a24_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (mzr8105_state::vme_a24_w){ @@ -270,7 +270,7 @@ WRITE16_MEMBER (mzr8105_state::vme_a24_w){ READ16_MEMBER (mzr8105_state::vme_a16_r){ LOG (logerror ("vme_16_r\n")); - return (UINT16) 0; + return (uint16_t) 0; } WRITE16_MEMBER (mzr8105_state::vme_a16_w){ @@ -297,7 +297,7 @@ MACHINE_CONFIG_END ****************************/ int mzr8105_state::mzr8105_load_cart(device_image_interface &image, generic_slot_device *slot) { - UINT32 size = slot->common_get_size("rom"); + uint32_t size = slot->common_get_size("rom"); if (size > 0x20000) // Max 128Kb - not verified { diff --git a/src/mame/drivers/n64.cpp b/src/mame/drivers/n64.cpp index 45d10179295..53b0bfcf0f0 100644 --- a/src/mame/drivers/n64.cpp +++ b/src/mame/drivers/n64.cpp @@ -30,7 +30,7 @@ public: DECLARE_MACHINE_START(n64dd); INTERRUPT_GEN_MEMBER(n64_reset_poll); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(n64_cart); - void mempak_format(UINT8* pak); + void mempak_format(uint8_t* pak); image_init_result disk_load(device_image_interface &image); void disk_unload(device_image_interface &image); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( n64dd ); @@ -244,7 +244,7 @@ static INPUT_PORTS_START( n64 ) INPUT_PORTS_END -void n64_mess_state::mempak_format(UINT8* pak) +void n64_mess_state::mempak_format(uint8_t* pak) { unsigned char pak_header[] = { @@ -296,7 +296,7 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart) { int i, length; n64_periphs *periphs = machine().device("rcp"); - UINT8 *cart = memregion("user2")->base(); + uint8_t *cart = memregion("user2")->base(); if (image.software_entry() == nullptr) { @@ -313,10 +313,10 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart) { for (i = 0; i < length; i += 4) { - UINT8 b1 = cart[i + 0]; - UINT8 b2 = cart[i + 1]; - UINT8 b3 = cart[i + 2]; - UINT8 b4 = cart[i + 3]; + uint8_t b1 = cart[i + 0]; + uint8_t b2 = cart[i + 1]; + uint8_t b3 = cart[i + 2]; + uint8_t b4 = cart[i + 3]; cart[i + 0] = b3; cart[i + 1] = b4; cart[i + 2] = b1; @@ -327,10 +327,10 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart) { for (i = 0; i < length; i += 4) { - UINT8 b1 = cart[i + 0]; - UINT8 b2 = cart[i + 1]; - UINT8 b3 = cart[i + 2]; - UINT8 b4 = cart[i + 3]; + uint8_t b1 = cart[i + 0]; + uint8_t b2 = cart[i + 1]; + uint8_t b3 = cart[i + 2]; + uint8_t b4 = cart[i + 3]; cart[i + 0] = b4; cart[i + 1] = b3; cart[i + 2] = b2; @@ -346,7 +346,7 @@ DEVICE_IMAGE_LOAD_MEMBER(n64_mess_state,n64_cart) if(battery_image) { //printf("Loading\n"); - UINT8 data[0x30800]; + uint8_t data[0x30800]; battery_image->battery_load(data, 0x30800, 0x00); if (m_sram != nullptr) { @@ -371,14 +371,14 @@ MACHINE_START_MEMBER(n64_mess_state,n64dd) { machine_start(); machine().device("rcp")->dd_present = true; - UINT8 *ipl = memregion("ddipl")->base(); + uint8_t *ipl = memregion("ddipl")->base(); for (int i = 0; i < 0x400000; i += 4) { - UINT8 b1 = ipl[i + 0]; - UINT8 b2 = ipl[i + 1]; - UINT8 b3 = ipl[i + 2]; - UINT8 b4 = ipl[i + 3]; + uint8_t b1 = ipl[i + 0]; + uint8_t b2 = ipl[i + 1]; + uint8_t b3 = ipl[i + 2]; + uint8_t b4 = ipl[i + 3]; ipl[i + 0] = b1; ipl[i + 1] = b2; ipl[i + 2] = b3; diff --git a/src/mame/drivers/nakajies.cpp b/src/mame/drivers/nakajies.cpp index 6e18dea6601..051aededa15 100644 --- a/src/mame/drivers/nakajies.cpp +++ b/src/mame/drivers/nakajies.cpp @@ -293,7 +293,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - 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); void nakajies_update_irqs(); DECLARE_READ8_MEMBER( irq_clear_r ); @@ -305,7 +305,7 @@ public: DECLARE_READ8_MEMBER( keyboard_r ); DECLARE_WRITE8_MEMBER( banking_w ); void update_banks(); - void bank_w(UINT8 banknr, offs_t offset, UINT8 data); + void bank_w(uint8_t banknr, offs_t offset, uint8_t data); DECLARE_WRITE8_MEMBER( bank0_w ); DECLARE_WRITE8_MEMBER( bank1_w ); DECLARE_WRITE8_MEMBER( bank2_w ); @@ -316,25 +316,25 @@ public: DECLARE_WRITE8_MEMBER( bank7_w ); /* IRQ handling */ - UINT8 m_irq_enabled; - UINT8 m_irq_active; + uint8_t m_irq_enabled; + uint8_t m_irq_active; - UINT8 m_lcd_memory_start; - UINT8* m_ram_base1; + uint8_t m_lcd_memory_start; + uint8_t* m_ram_base1; - UINT8 m_matrix; + uint8_t m_matrix; /* ROM */ - UINT8 *m_rom_base; - UINT32 m_rom_size; + uint8_t *m_rom_base; + uint32_t m_rom_size; /* RAM */ - UINT8 *m_ram_base; - UINT32 m_ram_size; + uint8_t *m_ram_base; + uint32_t m_ram_size; /* Banking */ - UINT8 m_bank[8]; - UINT8 *m_bank_base[8]; + uint8_t m_bank[8]; + uint8_t *m_bank_base[8]; DECLARE_PALETTE_INIT(nakajies); DECLARE_INPUT_CHANGED_MEMBER(trigger_irq); TIMER_DEVICE_CALLBACK_MEMBER(kb_timer); @@ -371,7 +371,7 @@ void nakajies_state::update_banks() membank( "bank7" )->set_base( m_bank_base[7] ); } -void nakajies_state::bank_w( UINT8 banknr, offs_t offset, UINT8 data ) +void nakajies_state::bank_w( uint8_t banknr, offs_t offset, uint8_t data ) { if ( m_bank[banknr] & 0x10 ) { @@ -409,8 +409,8 @@ void nakajies_state::nakajies_update_irqs() { // Hack: IRQ mask is temporarily disabled because doesn't allow the IRQ vector 0xFA // and 0xFB that are used for scan the kb, this need further investigation. - UINT8 irq = m_irq_active; // & m_irq_enabled; - UINT8 vector = 0xff; + uint8_t irq = m_irq_active; // & m_irq_enabled; + uint8_t vector = 0xff; if (LOG) logerror("nakajies_update_irqs: irq_enabled = %02x, irq_active = %02x\n", m_irq_enabled, m_irq_active ); @@ -505,7 +505,7 @@ ADDRESS_MAP_END INPUT_CHANGED_MEMBER(nakajies_state::trigger_irq) { - UINT8 irqs = ioport( "debug" )->read(); + uint8_t irqs = ioport( "debug" )->read(); m_irq_active |= irqs; nakajies_update_irqs(); @@ -657,15 +657,15 @@ void nakajies_state::machine_reset() update_banks(); } -UINT32 nakajies_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t nakajies_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8* lcd_memory_start = m_ram_base + (m_lcd_memory_start<<9); + uint8_t* lcd_memory_start = m_ram_base + (m_lcd_memory_start<<9); int height = screen.height(); for (int y=0; yget_reg(5)-(32+1); + uint16_t triggerscanline=m_c116->get_reg(5)-(32+1); m_raster_interrupt_timer->adjust(m_screen->time_until_pos(triggerscanline)); } } @@ -790,7 +790,7 @@ ROM_END void namcofl_state::common_init() { - m_workram = std::make_unique(0x100000/4); + m_workram = std::make_unique(0x100000/4); membank("bank1")->set_base(memregion("maincpu")->base() ); membank("bank2")->set_base(m_workram.get()); diff --git a/src/mame/drivers/namcona1.cpp b/src/mame/drivers/namcona1.cpp index 840a0bb524b..575248ac9fd 100644 --- a/src/mame/drivers/namcona1.cpp +++ b/src/mame/drivers/namcona1.cpp @@ -187,7 +187,7 @@ void namcona1_state::simulate_mcu() */ void namcona1_state::write_version_info() { - static const UINT16 source[0x8] = + static const uint16_t source[0x8] = { /* "NSA-BIOS ver"... */ 0x534e,0x2d41,0x4942,0x534f,0x7620,0x7265,0x2e31,0x3133 }; @@ -266,7 +266,7 @@ READ16_MEMBER(namcona1_state::custom_key_r) if( offset==4 ) m_keyval = 0; if( offset==3 ) { - UINT16 res; + uint16_t res; res = BITSWAP16(m_keyval, 22,26,31,23,18,20,16,30,24,21,25,19,17,29,28,27); m_keyval >>= 1; @@ -295,9 +295,9 @@ WRITE16_MEMBER(namcona1_state::custom_key_w) /***************************************************************/ -int namcona1_state::transfer_dword( UINT32 dest, UINT32 source ) +int namcona1_state::transfer_dword( uint32_t dest, uint32_t source ) { - UINT16 data; + uint16_t data; address_space &space = m_maincpu->space(AS_PROGRAM); if( source>=0x400000 && source<0xc00000 ) @@ -425,8 +425,8 @@ void namcona1_state::blit() int gfxbank = m_vreg[0x6]; /* dest and source are provided as dword offsets */ - UINT32 src_baseaddr = 2*(0xffffff&((m_vreg[0x7]<<16)|m_vreg[0x8])); - UINT32 dst_baseaddr = 2*(0xffffff&((m_vreg[0x9]<<16)|m_vreg[0xa])); + uint32_t src_baseaddr = 2*(0xffffff&((m_vreg[0x7]<<16)|m_vreg[0x8])); + uint32_t dst_baseaddr = 2*(0xffffff&((m_vreg[0x9]<<16)|m_vreg[0xa])); int num_bytes = m_vreg[0xb]; @@ -570,7 +570,7 @@ ADDRESS_MAP_END READ16_MEMBER(namcona1_state::na1mcu_shared_r) { - UINT16 data = flipendian_int16(m_workram[offset]); + uint16_t data = flipendian_int16(m_workram[offset]); #if 0 if (offset >= 0x70000/2) @@ -688,8 +688,8 @@ WRITE8_MEMBER(namcona1_state::port8_w) void namcona1_state::machine_start() { - m_prgrom = (UINT16 *)memregion("maincpu")->base(); - m_maskrom = (UINT16 *)memregion("maskrom")->base(); + m_prgrom = (uint16_t *)memregion("maincpu")->base(); + m_maskrom = (uint16_t *)memregion("maskrom")->base(); m_mEnableInterrupts = 0; m_c140->set_base(m_workram); @@ -721,8 +721,8 @@ void namcona1_state::machine_reset() // bit 7 => port 7 READ8_MEMBER(namcona1_state::portana_r) { - static const UINT8 bitnum[8] = { 0x40, 0x20, 0x10, 0x01, 0x02, 0x04, 0x08, 0x80 }; - UINT8 port = m_io_p3->read(); + static const uint8_t bitnum[8] = { 0x40, 0x20, 0x10, 0x01, 0x02, 0x04, 0x08, 0x80 }; + uint8_t port = m_io_p3->read(); return (port & bitnum[offset>>1]) ? 0xff : 0x00; } diff --git a/src/mame/drivers/namconb1.cpp b/src/mame/drivers/namconb1.cpp index 2144c57cbd8..cacefc14731 100644 --- a/src/mame/drivers/namconb1.cpp +++ b/src/mame/drivers/namconb1.cpp @@ -305,7 +305,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(namconb1_state::scantimer) } // Handle POSIRQ - UINT32 posirq_scanline = m_c116->get_reg(5) - 32; + uint32_t posirq_scanline = m_c116->get_reg(5) - 32; if (scanline == posirq_scanline) { @@ -547,7 +547,7 @@ READ8_MEMBER(namconb1_state::namconb2_cpureg_r) READ32_MEMBER(namconb1_state::custom_key_r) { - UINT16 old_count = m_count; + uint16_t old_count = m_count; do { /* pick a random number, but don't pick the same twice in a row */ @@ -652,10 +652,10 @@ READ32_MEMBER(namconb1_state::gunbulet_gun_r) switch (offset) { - case 0: case 1: result = (UINT8)(0x0f + m_light1_y->read() * 224/255); break; /* Y (p2) */ - case 2: case 3: result = (UINT8)(0x26 + m_light1_x->read() * 288/314); break; /* X (p2) */ - case 4: case 5: result = (UINT8)(0x0f + m_light0_y->read() * 224/255); break; /* Y (p1) */ - case 6: case 7: result = (UINT8)(0x26 + m_light0_x->read() * 288/314); break; /* X (p1) */ + case 0: case 1: result = (uint8_t)(0x0f + m_light1_y->read() * 224/255); break; /* Y (p2) */ + case 2: case 3: result = (uint8_t)(0x26 + m_light1_x->read() * 288/314); break; /* X (p2) */ + case 4: case 5: result = (uint8_t)(0x0f + m_light0_y->read() * 224/255); break; /* Y (p1) */ + case 6: case 7: result = (uint8_t)(0x26 + m_light0_x->read() * 288/314); break; /* X (p1) */ } return result<<24; } /* gunbulet_gun_r */ diff --git a/src/mame/drivers/namcops2.cpp b/src/mame/drivers/namcops2.cpp index e5f527337c9..b37e15ea9a8 100644 --- a/src/mame/drivers/namcops2.cpp +++ b/src/mame/drivers/namcops2.cpp @@ -883,7 +883,7 @@ public: m_maincpu(*this, "maincpu") { } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: @@ -899,7 +899,7 @@ void namcops2_state::video_start() { } -UINT32 namcops2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t namcops2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/namcos10.cpp b/src/mame/drivers/namcos10.cpp index 5d72a034211..a4c1b526a48 100644 --- a/src/mame/drivers/namcos10.cpp +++ b/src/mame/drivers/namcos10.cpp @@ -304,8 +304,8 @@ public: DECLARE_READ16_MEMBER (sprot_r); DECLARE_WRITE16_MEMBER(sprot_w); - UINT8 *nand_base; - void nand_copy( UINT32 *dst, UINT32 address, int len ); + uint8_t *nand_base; + void nand_copy( uint32_t *dst, uint32_t address, int len ); private: enum { @@ -315,19 +315,19 @@ private: I2CP_RECIEVE_ACK_0 }; - UINT32 bank_base; - UINT32 nand_address; - UINT16 block[0x1ff]; + uint32_t bank_base; + uint32_t nand_address; + uint16_t block[0x1ff]; ns10_decrypter_device* decrypter; - UINT16 i2c_host_clock, i2c_host_data, i2c_dev_clock, i2c_dev_data, i2c_prev_clock, i2c_prev_data; + uint16_t i2c_host_clock, i2c_host_data, i2c_dev_clock, i2c_dev_data, i2c_prev_clock, i2c_prev_data; int i2cp_mode; - UINT8 i2c_byte; + uint8_t i2c_byte; int i2c_bit; int sprot_bit, sprot_byte; - UINT16 nand_read( UINT32 address ); - UINT16 nand_read2( UINT32 address ); + uint16_t nand_read( uint32_t address ); + uint16_t nand_read2( uint32_t address ); void i2c_update(); public: @@ -388,7 +388,7 @@ WRITE16_MEMBER(namcos10_state::bank_w) READ16_MEMBER(namcos10_state::range_r) { - UINT16 data = ((const UINT16 *)(memregion("maincpu:rom")->base()))[bank_base+offset]; + uint16_t data = ((const uint16_t *)(memregion("maincpu:rom")->base()))[bank_base+offset]; if (decrypter == nullptr) return data; @@ -432,13 +432,13 @@ READ16_MEMBER(namcos10_state::sprot_r) // If line 3 has 0x30/0x31 in it, something happens. That // something currently kills the system though. - const static UINT8 prot[0x40] = { + const static uint8_t prot[0x40] = { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, }; - UINT16 res = sprot_byte >= 0x20 ? 0x3 : + uint16_t res = sprot_byte >= 0x20 ? 0x3 : (((prot[sprot_byte ] >> sprot_bit) & 1) ? 1 : 0) | (((prot[sprot_byte+0x20] >> sprot_bit) & 1) ? 2 : 0); @@ -452,7 +452,7 @@ READ16_MEMBER(namcos10_state::sprot_r) READ16_MEMBER(namcos10_state::i2c_clock_r) { - UINT16 res = i2c_dev_clock & i2c_host_clock & 1; + uint16_t res = i2c_dev_clock & i2c_host_clock & 1; // logerror("i2c_clock_r %d (%x)\n", res, space.device().safe_pc()); return res; } @@ -467,7 +467,7 @@ WRITE16_MEMBER(namcos10_state::i2c_clock_w) READ16_MEMBER(namcos10_state::i2c_data_r) { - UINT16 res = i2c_dev_data & i2c_host_data & 1; + uint16_t res = i2c_dev_data & i2c_host_data & 1; // logerror("i2c_data_r %d (%x)\n", res, space.device().safe_pc()); return res; } @@ -482,8 +482,8 @@ WRITE16_MEMBER(namcos10_state::i2c_data_w) void namcos10_state::i2c_update() { - UINT16 clock = i2c_dev_clock & i2c_host_clock & 1; - UINT16 data = i2c_dev_data & i2c_host_data & 1; + uint16_t clock = i2c_dev_clock & i2c_host_clock & 1; + uint16_t data = i2c_dev_data & i2c_host_data & 1; if(i2c_prev_data == data && i2c_prev_clock == clock) return; @@ -577,13 +577,13 @@ WRITE8_MEMBER( namcos10_state::nand_address4_w ) logerror("nand_a4_w %08x (%08x) -> %08x\n", data, space.device().safe_pc(), nand_address*2); } -UINT16 namcos10_state::nand_read( UINT32 address ) +uint16_t namcos10_state::nand_read( uint32_t address ) { int index = ( ( address / 512 ) * 528 ) + ( address % 512 ); return nand_base[ index ] | ( nand_base[ index + 1 ] << 8 ); } -UINT16 namcos10_state::nand_read2( UINT32 address ) +uint16_t namcos10_state::nand_read2( uint32_t address ) { int index = ( ( address / 512 ) * 528 ) + ( address % 512 ); return nand_base[ index + 1 ] | ( nand_base[ index ] << 8 ); @@ -591,7 +591,7 @@ UINT16 namcos10_state::nand_read2( UINT32 address ) READ16_MEMBER( namcos10_state::nand_data_r ) { - UINT16 data = nand_read2( nand_address * 2 ); + uint16_t data = nand_read2( nand_address * 2 ); // logerror("read %08x = %04x\n", nand_address*2, data); // printf("read %08x = %04x\n", nand_address*2, data); @@ -609,7 +609,7 @@ READ16_MEMBER( namcos10_state::nand_data_r ) return data; } -void namcos10_state::nand_copy( UINT32 *dst, UINT32 address, int len ) +void namcos10_state::nand_copy( uint32_t *dst, uint32_t address, int len ) { while( len > 0 ) { @@ -645,19 +645,19 @@ ADDRESS_MAP_END void namcos10_state::memn_driver_init( ) { - UINT8 *BIOS = (UINT8 *)memregion( "maincpu:rom" )->base(); - nand_base = (UINT8 *)memregion( "user2" )->base(); + uint8_t *BIOS = (uint8_t *)memregion( "maincpu:rom" )->base(); + nand_base = (uint8_t *)memregion( "user2" )->base(); decrypter = static_cast(machine().root_device().subdevice("decrypter")); - nand_copy( (UINT32 *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 ); - nand_copy( (UINT32 *)( BIOS + 0x0020000 ), 0x24000, 0x03e0000 ); + nand_copy( (uint32_t *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 ); + nand_copy( (uint32_t *)( BIOS + 0x0020000 ), 0x24000, 0x03e0000 ); } static void decrypt_bios( running_machine &machine, const char *regionName, int start, int end, int b15, int b14, int b13, int b12, int b11, int b10, int b9, int b8, int b7, int b6, int b5, int b4, int b3, int b2, int b1, int b0 ) { memory_region *region = machine.root_device().memregion( regionName ); - UINT16 *BIOS = (UINT16 *)( region->base() + start ); + uint16_t *BIOS = (uint16_t *)( region->base() + start ); int len = (end - start) / 2; for( int i = 0; i < len; i++ ) diff --git a/src/mame/drivers/namcos11.cpp b/src/mame/drivers/namcos11.cpp index ca32271a958..f0370c8263a 100644 --- a/src/mame/drivers/namcos11.cpp +++ b/src/mame/drivers/namcos11.cpp @@ -332,13 +332,13 @@ protected: virtual void driver_start() override; private: - required_shared_ptr m_sharedram; + required_shared_ptr m_sharedram; required_device m_maincpu; required_device m_mcu; memory_bank *m_bank[8]; - UINT32 m_n_bankoffset; - UINT8 m_su_83; + uint32_t m_n_bankoffset; + uint8_t m_su_83; inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); }; @@ -397,7 +397,7 @@ WRITE16_MEMBER(namcos11_state::lightgun_w) READ16_MEMBER(namcos11_state::lightgun_r) { - UINT16 data = 0; + uint16_t data = 0; switch( offset ) { @@ -537,7 +537,7 @@ void namcos11_state::driver_start() memory_region *bankedroms = memregion( "bankedroms" ); if( bankedroms != nullptr ) { - UINT8 *base = bankedroms->base(); + uint8_t *base = bankedroms->base(); int entries = bankedroms->bytes() / ( 1024 * 1024 ); static const char * const bankname[] = { "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8" }; diff --git a/src/mame/drivers/namcos12.cpp b/src/mame/drivers/namcos12.cpp index b2afcbe8500..4a2f0a31255 100644 --- a/src/mame/drivers/namcos12.cpp +++ b/src/mame/drivers/namcos12.cpp @@ -1116,20 +1116,20 @@ public: required_device m_adc; required_device m_rtc; required_device m_settings; - required_shared_ptr m_sharedram; + required_shared_ptr m_sharedram; - UINT16 m_n_bankoffset; - UINT32 m_n_dmaoffset; - UINT32 m_n_tektagdmaoffset; + uint16_t m_n_bankoffset; + uint32_t m_n_dmaoffset; + uint32_t m_n_tektagdmaoffset; int m_has_tektagt_dma; int m_ttt_cnt; - UINT32 m_ttt_val[2]; - UINT8 m_sub_porta; - UINT8 m_sub_portb; + uint32_t m_ttt_val[2]; + uint8_t m_sub_porta; + uint8_t m_sub_portb; - UINT8 m_jvssense; - UINT8 m_tssio_port_4; + uint8_t m_jvssense; + uint8_t m_tssio_port_4; DECLARE_READ16_MEMBER(s12_mcu_p6_r); DECLARE_READ16_MEMBER(iob_p4_r); @@ -1160,7 +1160,7 @@ public: DECLARE_DRIVER_INIT(ptblank2); DECLARE_DRIVER_INIT(technodr); inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); - void namcos12_rom_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ); + void namcos12_rom_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); void namcos12_sub_irq( screen_device &screen, bool vblank_state ); protected: @@ -1225,19 +1225,19 @@ WRITE16_MEMBER(namcos12_state::dmaoffset_w) verboselog(1, "dmaoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, m_n_dmaoffset ); } -void namcos12_state::namcos12_rom_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void namcos12_state::namcos12_rom_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { const char *n_region; int n_offset; - INT32 n_romleft; + int32_t n_romleft; - UINT16 *source; - UINT16 *destination; - INT32 n_ramleft; + uint16_t *source; + uint16_t *destination; + int32_t n_ramleft; // TODO: the check for going past the end of ram should be in dma.c - UINT32 m_n_psxramsize = m_ram->size(); + uint32_t m_n_psxramsize = m_ram->size(); if(m_has_tektagt_dma && !m_n_dmaoffset) { @@ -1259,7 +1259,7 @@ void namcos12_state::namcos12_rom_read( UINT32 *p_n_psxram, UINT32 n_address, IN verboselog(1, "namcos12_rom_read( %08x, %08x ) game %08x\n", n_address, n_size, n_offset ); } - source = (UINT16 *) memregion( n_region )->base(); + source = (uint16_t *) memregion( n_region )->base(); n_romleft = ( memregion( n_region )->bytes() - n_offset ) / 4; if( n_size > n_romleft ) { @@ -1267,7 +1267,7 @@ void namcos12_state::namcos12_rom_read( UINT32 *p_n_psxram, UINT32 n_address, IN n_size = n_romleft; } - destination = (UINT16 *)p_n_psxram; + destination = (uint16_t *)p_n_psxram; n_ramleft = ( m_n_psxramsize - n_address ) / 4; if( n_size > n_ramleft ) @@ -1347,7 +1347,7 @@ WRITE16_MEMBER(namcos12_state::system11gun_w) READ16_MEMBER(namcos12_state::system11gun_r) { - UINT16 data = 0; + uint16_t data = 0; switch (offset) { @@ -1507,8 +1507,8 @@ void namcos12_state::machine_reset() strcmp( machine().system().name, "ghlpanic" ) == 0 ) { /* HACK: this is based on guesswork, it might not even be keycus. */ - UINT8 *rom = memregion( "maincpu:rom" )->base() + 0x20280; - UINT8 *ram = m_ram->pointer() + 0x10000; + uint8_t *rom = memregion( "maincpu:rom" )->base() + 0x20280; + uint8_t *ram = m_ram->pointer() + 0x10000; memcpy( ram, rom, 12 ); } @@ -1657,7 +1657,7 @@ DRIVER_INIT_MEMBER(namcos12_state,ptblank2) DRIVER_INIT_CALL(namcos12); /* HACK: patch out wait for dma 5 to complete */ - *( (UINT32 *)( memregion( "maincpu:rom" )->base() + 0x331c4 ) ) = 0; + *( (uint32_t *)( memregion( "maincpu:rom" )->base() + 0x331c4 ) ) = 0; } DRIVER_INIT_MEMBER(namcos12_state,technodr) @@ -1665,7 +1665,7 @@ DRIVER_INIT_MEMBER(namcos12_state,technodr) DRIVER_INIT_CALL(namcos12); // HACK: patch H8 to fix COIN ERROR - *( (UINT32 *)( memregion( "sub" )->base() + 0x14b6 ) ) = 0; + *( (uint32_t *)( memregion( "sub" )->base() + 0x14b6 ) ) = 0; } static MACHINE_CONFIG_START( coh700, namcos12_state ) @@ -1776,7 +1776,7 @@ WRITE16_MEMBER(namcos12_state::iob_p4_w) READ16_MEMBER(namcos12_state::iob_p6_r) { // d4 is service button - UINT8 sb = (ioport("SERVICE")->read() & 1) << 4; + uint8_t sb = (ioport("SERVICE")->read() & 1) << 4; // other bits: unknown return sb | 0; diff --git a/src/mame/drivers/namcos2.cpp b/src/mame/drivers/namcos2.cpp index 58dd3e17107..10d8330a649 100644 --- a/src/mame/drivers/namcos2.cpp +++ b/src/mame/drivers/namcos2.cpp @@ -5526,14 +5526,14 @@ DRIVER_INIT_MEMBER(namcos2_state,marvland) DRIVER_INIT_MEMBER(namcos2_state,metlhawk) { /* unscramble sprites */ - UINT8 *data = memregion("gfx1")->base(); + uint8_t *data = memregion("gfx1")->base(); for (int i=0; i<0x200000; i+=32*32) { for (int j=0; j<32*32; j+=32*4) { for (int k=0; k<32; k+=4) { - UINT8 v; + uint8_t v; int a; a = i+j+k+32; @@ -5662,7 +5662,7 @@ DRIVER_INIT_MEMBER(namcos2_state,bubbletr) DRIVER_INIT_MEMBER(namcos2_state,luckywld) { - UINT8 *pData = (UINT8 *)memregion( "gfx5" )->base(); + uint8_t *pData = (uint8_t *)memregion( "gfx5" )->base(); int i; for( i=0; i<32*0x4000; i++ ) { /* unscramble gfx mask */ diff --git a/src/mame/drivers/namcos21.cpp b/src/mame/drivers/namcos21.cpp index a596473c40f..e62a0241424 100644 --- a/src/mame/drivers/namcos21.cpp +++ b/src/mame/drivers/namcos21.cpp @@ -534,7 +534,7 @@ Filter Board #define ENABLE_LOGGING 0 -INT32 namcos21_state::read_pointrom_data(unsigned offset) +int32_t namcos21_state::read_pointrom_data(unsigned offset) { return m_ptrom24[offset]; } @@ -561,7 +561,7 @@ WRITE16_MEMBER(namcos21_state::dspcuskey_w) READ16_MEMBER(namcos21_state::dspcuskey_r) { - UINT16 result = 0; + uint16_t result = 0; if( m_gametype == NAMCOS21_SOLVALOU ) { switch( space.device().safe_pc() ) @@ -600,7 +600,7 @@ READ16_MEMBER(namcos21_state::dspcuskey_r) return result; } -void namcos21_state::transmit_word_to_slave(UINT16 data) +void namcos21_state::transmit_word_to_slave(uint16_t data) { unsigned offs = m_mpDspState->slaveInputStart+m_mpDspState->slaveBytesAvailable++; m_mpDspState->slaveInputBuffer[offs%DSP_BUF_MAX] = data; @@ -615,7 +615,7 @@ void namcos21_state::transmit_word_to_slave(UINT16 data) void namcos21_state::transfer_dsp_data() { - UINT16 addr = m_mpDspState->masterSourceAddr; + uint16_t addr = m_mpDspState->masterSourceAddr; int mode = addr&0x8000; addr&=0x7fff; if( addr ) @@ -623,8 +623,8 @@ void namcos21_state::transfer_dsp_data() for(;;) { int i; - UINT16 old = addr; - UINT16 code = m_dspram16[addr++]; + uint16_t old = addr; + uint16_t code = m_dspram16[addr++]; if( code == 0xffff ) { if( mode ) @@ -650,7 +650,7 @@ void namcos21_state::transfer_dsp_data() transmit_word_to_slave(code); for( i=0; i2 ) { transmit_word_to_slave(0); /* pad1 */ @@ -692,7 +692,7 @@ void namcos21_state::transfer_dsp_data() transmit_word_to_slave(primWords+1); for( i=0; im_dspslave->set_input_line(INPUT_LINE_RESET, PULSE_LINE); } -UINT16 namcos21_state::read_word_from_slave_input() +uint16_t namcos21_state::read_word_from_slave_input() { - UINT16 data = 0; + uint16_t data = 0; if( m_mpDspState->slaveBytesAvailable>0 ) { data = m_mpDspState->slaveInputBuffer[m_mpDspState->slaveInputStart++]; @@ -759,7 +759,7 @@ UINT16 namcos21_state::read_word_from_slave_input() return data; } -UINT16 namcos21_state::get_input_bytes_advertised_for_slave() +uint16_t namcos21_state::get_input_bytes_advertised_for_slave() { if( m_mpDspState->slaveBytesAdvertised < m_mpDspState->slaveBytesAvailable ) { @@ -802,7 +802,7 @@ WRITE16_MEMBER(namcos21_state::dspram16_w) int namcos21_state::init_dsp() { - UINT16 *pMem = (UINT16 *)memregion("dspmaster")->base(); + uint16_t *pMem = (uint16_t *)memregion("dspmaster")->base(); /** * DSP BIOS tests "CPU ID" on startup * "JAPAN (C)1990 NAMCO LTD. by H.F " @@ -822,10 +822,10 @@ int namcos21_state::init_dsp() READ16_MEMBER(namcos21_state::dsp_port0_r) { - INT32 data = read_pointrom_data(m_pointrom_idx++); - m_mPointRomMSB = (UINT8)(data>>16); + int32_t data = read_pointrom_data(m_pointrom_idx++); + m_mPointRomMSB = (uint8_t)(data>>16); m_mbPointRomDataAvailable = 1; - return (UINT16)data; + return (uint16_t)data; } WRITE16_MEMBER(namcos21_state::dsp_port0_w) @@ -929,8 +929,8 @@ WRITE16_MEMBER(namcos21_state::dsp_portb_w) int color = m_mpDspState->masterDirectDrawBuffer[0]; for( i=0; i<4; i++ ) { - sx[i] = NAMCOS21_POLY_FRAME_WIDTH/2 + (INT16)m_mpDspState->masterDirectDrawBuffer[i*3+1]; - sy[i] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)m_mpDspState->masterDirectDrawBuffer[i*3+2]; + sx[i] = NAMCOS21_POLY_FRAME_WIDTH/2 + (int16_t)m_mpDspState->masterDirectDrawBuffer[i*3+1]; + sy[i] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (int16_t)m_mpDspState->masterDirectDrawBuffer[i*3+2]; zcode[i] = m_mpDspState->masterDirectDrawBuffer[i*3+3]; } if( color&0x8000 ) @@ -997,7 +997,7 @@ ADDRESS_MAP_END /************************************************************************************/ -void namcos21_state::render_slave_output(UINT16 data) +void namcos21_state::render_slave_output(uint16_t data) { if( m_mpDspState->slaveOutputSize >= 4096 ) { @@ -1008,11 +1008,11 @@ void namcos21_state::render_slave_output(UINT16 data) m_mpDspState->slaveOutputBuffer[m_mpDspState->slaveOutputSize++] = data; { - UINT16 *pSource = m_mpDspState->slaveOutputBuffer; - UINT16 count = *pSource++; + uint16_t *pSource = m_mpDspState->slaveOutputBuffer; + uint16_t count = *pSource++; if( count && m_mpDspState->slaveOutputSize > count ) { - UINT16 color = *pSource++; + uint16_t color = *pSource++; int sx[4], sy[4],zcode[4]; int j; if( color&0x8000 ) @@ -1020,8 +1020,8 @@ void namcos21_state::render_slave_output(UINT16 data) if( count!=13 ) logerror( "?!direct-draw(%d)\n", count ); for( j=0; j<4; j++ ) { - sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (INT16)pSource[3*j+0]; - sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)pSource[3*j+1]; + sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (int16_t)pSource[3*j+0]; + sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (int16_t)pSource[3*j+1]; zcode[j] = pSource[3*j+2]; } draw_quad(sx, sy, zcode, color&0x7fff); @@ -1031,13 +1031,13 @@ void namcos21_state::render_slave_output(UINT16 data) int quad_idx = color*6; for(;;) { - UINT8 code = m_pointram[quad_idx++]; + uint8_t code = m_pointram[quad_idx++]; color = m_pointram[quad_idx++]|(code<<8); for( j=0; j<4; j++ ) { - UINT8 vi = m_pointram[quad_idx++]; - sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (INT16)pSource[vi*3+0]; - sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)pSource[vi*3+1]; + uint8_t vi = m_pointram[quad_idx++]; + sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (int16_t)pSource[vi*3+0]; + sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (int16_t)pSource[vi*3+1]; zcode[j] = pSource[vi*3+2]; } draw_quad(sx, sy, zcode, color&0x7fff); @@ -1131,7 +1131,7 @@ ADDRESS_MAP_END */ WRITE16_MEMBER(namcos21_state::pointram_control_w) { -// UINT16 prev = m_pointram_control; +// uint16_t prev = m_pointram_control; COMBINE_DATA( &m_pointram_control ); /* m_pointram_control&0x20 : bank for depthcue data */ @@ -1142,7 +1142,7 @@ WRITE16_MEMBER(namcos21_state::pointram_control_w) offset, m_pointram_control ); - UINT16 delta = (prev^m_pointram_control)&m_pointram_control; + uint16_t delta = (prev^m_pointram_control)&m_pointram_control; if( delta&0x10 ) { logerror( " [reset]" ); @@ -1274,13 +1274,13 @@ ADDRESS_MAP_END READ16_MEMBER(namcos21_state::winrun_dspcomram_r) { int bank = 1-(m_winrun_dspcomram_control[0x4/2]&1); - UINT16 *mem = &m_winrun_dspcomram[0x1000*bank]; + uint16_t *mem = &m_winrun_dspcomram[0x1000*bank]; return mem[offset]; } WRITE16_MEMBER(namcos21_state::winrun_dspcomram_w) { int bank = 1-(m_winrun_dspcomram_control[0x4/2]&1); - UINT16 *mem = &m_winrun_dspcomram[0x1000*bank]; + uint16_t *mem = &m_winrun_dspcomram[0x1000*bank]; COMBINE_DATA( &mem[offset] ); } @@ -1313,8 +1313,8 @@ void namcos21_state::winrun_flush_poly() { if( m_winrun_poly_index>0 ) { - const UINT16 *pSource = m_winrun_poly_buf; - UINT16 color; + const uint16_t *pSource = m_winrun_poly_buf; + uint16_t color; int sx[4], sy[4], zcode[4]; int j; color = *pSource++; @@ -1322,8 +1322,8 @@ void namcos21_state::winrun_flush_poly() { /* direct-draw */ for( j=0; j<4; j++ ) { - sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (INT16)*pSource++; - sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)*pSource++; + sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (int16_t)*pSource++; + sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (int16_t)*pSource++; zcode[j] = *pSource++; } draw_quad(sx, sy, zcode, color&0x7fff); @@ -1333,13 +1333,13 @@ void namcos21_state::winrun_flush_poly() int quad_idx = color*6; for(;;) { - UINT8 code = m_pointram[quad_idx++]; + uint8_t code = m_pointram[quad_idx++]; color = m_pointram[quad_idx++]; for( j=0; j<4; j++ ) { - UINT8 vi = m_pointram[quad_idx++]; - sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (INT16)pSource[vi*3+0]; - sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (INT16)pSource[vi*3+1]; + uint8_t vi = m_pointram[quad_idx++]; + sx[j] = NAMCOS21_POLY_FRAME_WIDTH/2 + (int16_t)pSource[vi*3+0]; + sy[j] = NAMCOS21_POLY_FRAME_HEIGHT/2 + (int16_t)pSource[vi*3+1]; zcode[j] = pSource[vi*3+2]; } draw_quad(sx, sy, zcode, color&0x7fff); @@ -1425,7 +1425,7 @@ WRITE16_MEMBER(namcos21_state::winrun_dspbios_w) COMBINE_DATA( &m_winrun_dspbios[offset] ); if( offset==0xfff ) { - UINT16 *mem = (UINT16 *)memregion("dsp")->base(); + uint16_t *mem = (uint16_t *)memregion("dsp")->base(); memcpy( mem, m_winrun_dspbios, 0x2000 ); m_winrun_dsp_alive = 1; } @@ -1439,14 +1439,14 @@ WRITE16_MEMBER(namcos21_state::winrun_dspbios_w) READ16_MEMBER(namcos21_state::winrun_68k_dspcomram_r) { int bank = m_winrun_dspcomram_control[0x4/2]&1; - UINT16 *mem = &m_winrun_dspcomram[0x1000*bank]; + uint16_t *mem = &m_winrun_dspcomram[0x1000*bank]; return mem[offset]; } WRITE16_MEMBER(namcos21_state::winrun_68k_dspcomram_w) { int bank = m_winrun_dspcomram_control[0x4/2]&1; - UINT16 *mem = &m_winrun_dspcomram[0x1000*bank]; + uint16_t *mem = &m_winrun_dspcomram[0x1000*bank]; COMBINE_DATA( &mem[offset] ); } @@ -2443,7 +2443,7 @@ ROM_END void namcos21_state::init(int game_type) { m_gametype = game_type; - m_pointram = std::make_unique(PTRAM_SIZE); + m_pointram = std::make_unique(PTRAM_SIZE); init_dsp(); m_mbNeedsKickstart = 20; if( game_type==NAMCOS21_CYBERSLED ) @@ -2454,15 +2454,15 @@ void namcos21_state::init(int game_type) DRIVER_INIT_MEMBER(namcos21_state,winrun) { - UINT16 *pMem = (UINT16 *)memregion("dsp")->base(); + uint16_t *pMem = (uint16_t *)memregion("dsp")->base(); int pc = 0; pMem[pc++] = 0xff80; /* b */ pMem[pc++] = 0; - m_winrun_dspcomram = std::make_unique(0x1000*2); + m_winrun_dspcomram = std::make_unique(0x1000*2); m_gametype = NAMCOS21_WINRUN91; - m_pointram = std::make_unique(PTRAM_SIZE); + m_pointram = std::make_unique(PTRAM_SIZE); m_pointram_idx = 0; m_mbNeedsKickstart = 0; } @@ -2485,7 +2485,7 @@ DRIVER_INIT_MEMBER(namcos21_state,cybsled) DRIVER_INIT_MEMBER(namcos21_state,solvalou) { - UINT16 *mem = (UINT16 *)memregion("maincpu")->base(); + uint16_t *mem = (uint16_t *)memregion("maincpu")->base(); mem[0x20ce4/2+1] = 0x0000; // $200128 mem[0x20cf4/2+0] = 0x4e71; // 2nd ptr_booting mem[0x20cf4/2+1] = 0x4e71; @@ -2496,13 +2496,13 @@ DRIVER_INIT_MEMBER(namcos21_state,solvalou) DRIVER_INIT_MEMBER(namcos21_state,driveyes) { - UINT16 *pMem = (UINT16 *)memregion("dsp")->base(); + uint16_t *pMem = (uint16_t *)memregion("dsp")->base(); int pc = 0; pMem[pc++] = 0xff80; /* b */ pMem[pc++] = 0; - m_winrun_dspcomram = std::make_unique(0x1000*2); + m_winrun_dspcomram = std::make_unique(0x1000*2); m_gametype = NAMCOS21_DRIVERS_EYES; - m_pointram = std::make_unique(PTRAM_SIZE); + m_pointram = std::make_unique(PTRAM_SIZE); m_pointram_idx = 0; m_mbNeedsKickstart = 0; } diff --git a/src/mame/drivers/namcos22.cpp b/src/mame/drivers/namcos22.cpp index bd79f9fcb95..05b0357621d 100644 --- a/src/mame/drivers/namcos22.cpp +++ b/src/mame/drivers/namcos22.cpp @@ -1648,7 +1648,7 @@ READ16_MEMBER(namcos22_state::namcos22_keycus_r) } // pick a random number, but don't pick the same twice in a row - UINT16 old_rng = m_keycus_rng; + uint16_t old_rng = m_keycus_rng; do { m_keycus_rng = machine().rand() & 0xffff; @@ -1679,7 +1679,7 @@ WRITE16_MEMBER(namcos22_state::namcos22_keycus_w) */ READ16_MEMBER(namcos22_state::namcos22_portbit_r) { - UINT16 ret = m_portbits[offset] & 1; + uint16_t ret = m_portbits[offset] & 1; m_portbits[offset] = m_portbits[offset] >> 1 | 0x8000; return ret; } @@ -1955,8 +1955,8 @@ ADDRESS_MAP_END // Time Crisis gun READ32_MEMBER(namcos22_state::namcos22_gun_r) { - UINT16 xpos = ioport("LIGHTX")->read(); - UINT16 ypos = ioport("LIGHTY")->read(); + uint16_t xpos = ioport("LIGHTX")->read(); + uint16_t ypos = ioport("LIGHTY")->read(); // ypos is not completely understood yet, there should be a difference between case 1 and 2 switch (offset) @@ -2038,7 +2038,7 @@ void namcos22_state::slave_enable() READ16_MEMBER(namcos22_state::namcos22_dspram16_r) { - UINT32 value = m_polygonram[offset]; + uint32_t value = m_polygonram[offset]; switch (m_dspram_bank) { @@ -2059,14 +2059,14 @@ READ16_MEMBER(namcos22_state::namcos22_dspram16_r) break; } - return (UINT16)value; + return (uint16_t)value; } WRITE16_MEMBER(namcos22_state::namcos22_dspram16_w) { - UINT32 value = m_polygonram[offset]; - UINT16 lo = value & 0xffff; - UINT16 hi = value >> 16; + uint32_t value = m_polygonram[offset]; + uint16_t lo = value & 0xffff; + uint16_t hi = value >> 16; switch (m_dspram_bank) { @@ -2096,7 +2096,7 @@ WRITE16_MEMBER(namcos22_state::namcos22_dspram16_bank_w) } -void namcos22_state::point_write(offs_t offs, UINT32 data) +void namcos22_state::point_write(offs_t offs, uint32_t data) { offs &= 0x00ffffff; /* 24 bit addressing */ if (m_is_ss22) @@ -2111,7 +2111,7 @@ void namcos22_state::point_write(offs_t offs, UINT32 data) } } -INT32 namcos22_state::point_read(INT32 addr) +int32_t namcos22_state::point_read(int32_t addr) { if (addr < 0) return -1; @@ -2121,7 +2121,7 @@ INT32 namcos22_state::point_read(INT32 addr) return m_pointrom[addr]; // point ram, only used in ram test? - INT32 result = 0; + int32_t result = 0; if (m_is_ss22) { if (addr >= 0xf80000 && addr < 0xfa0000) @@ -2173,12 +2173,12 @@ READ16_MEMBER(namcos22_state::pdp_status_r) return m_dsp_master_bioz; } -UINT32 namcos22_state::pdp_polygonram_read(offs_t offs) +uint32_t namcos22_state::pdp_polygonram_read(offs_t offs) { return m_polygonram[offs & 0x7fff]; } -void namcos22_state::pdp_polygonram_write(offs_t offs, UINT32 data) +void namcos22_state::pdp_polygonram_write(offs_t offs, uint32_t data) { m_polygonram[offs & 0x7fff] = data; } @@ -2188,16 +2188,16 @@ READ16_MEMBER(namcos22_state::pdp_begin_r) /* this feature appears to be only used on Super System22 hardware */ if (m_is_ss22) { - UINT16 offs = pdp_polygonram_read(0x7fff); + uint16_t offs = pdp_polygonram_read(0x7fff); m_dsp_master_bioz = 1; for (;;) { - UINT16 start = offs; - UINT16 cmd = pdp_polygonram_read(offs++); - UINT32 srcAddr; - UINT32 dstAddr; - UINT32 numWords; - UINT32 data; + uint16_t start = offs; + uint16_t cmd = pdp_polygonram_read(offs++); + uint32_t srcAddr; + uint32_t dstAddr; + uint32_t numWords; + uint32_t data; switch (cmd) { case 0xfff0: @@ -2680,13 +2680,13 @@ ADDRESS_MAP_END READ16_MEMBER(namcos22_state::s22mcu_shared_r) { - UINT16 *share16 = (UINT16 *)m_shareram.target(); + uint16_t *share16 = (uint16_t *)m_shareram.target(); return share16[BYTE_XOR_BE(offset)]; } WRITE16_MEMBER(namcos22_state::s22mcu_shared_w) { - UINT16 *share16 = (UINT16 *)m_shareram.target(); + uint16_t *share16 = (uint16_t *)m_shareram.target(); COMBINE_DATA(&share16[BYTE_XOR_BE(offset)]); } @@ -2787,7 +2787,7 @@ READ8_MEMBER(namcos22_state::mcu_port7_r) READ8_MEMBER(namcos22_state::namcos22s_mcu_adc_r) { - UINT16 adc = m_adc_ports[offset >> 1 & 7].read_safe(0) << 2; + uint16_t adc = m_adc_ports[offset >> 1 & 7].read_safe(0) << 2; return (offset & 1) ? adc >> 8 : adc; } @@ -2817,9 +2817,9 @@ ADDRESS_MAP_END /* TODO: REMOVE (THIS IS HANDLED BY "IOMCU") */ void namcos22_state::handle_coinage(int slots, int address_is_odd) { - UINT16 *share16 = (UINT16 *)m_shareram.target(); + uint16_t *share16 = (uint16_t *)m_shareram.target(); - UINT32 coin_state = ioport("INPUTS")->read() & 0x1200; + uint32_t coin_state = ioport("INPUTS")->read() & 0x1200; if (!(coin_state & 0x1000) && (m_old_coin_state & 0x1000)) { @@ -2846,12 +2846,12 @@ void namcos22_state::handle_driving_io() { if (m_syscontrol[0x18] != 0) { - UINT16 flags = ioport("INPUTS")->read(); - UINT16 coinram_address_is_odd = 0; + uint16_t flags = ioport("INPUTS")->read(); + uint16_t coinram_address_is_odd = 0; - UINT16 gas = ioport("GAS")->read(); - UINT16 brake = ioport("BRAKE")->read(); - UINT16 steer = ioport("STEER")->read(); + uint16_t gas = ioport("GAS")->read(); + uint16_t brake = ioport("BRAKE")->read(); + uint16_t steer = ioport("STEER")->read(); switch (m_gametype) { @@ -2905,12 +2905,12 @@ void namcos22_state::handle_cybrcomm_io() { if (m_syscontrol[0x18] != 0) { - UINT16 flags = ioport("INPUTS")->read(); + uint16_t flags = ioport("INPUTS")->read(); - UINT16 volume0 = ioport("STICKY1")->read() * 0x10; - UINT16 volume1 = ioport("STICKY2")->read() * 0x10; - UINT16 volume2 = ioport("STICKX1")->read() * 0x10; - UINT16 volume3 = ioport("STICKX2")->read() * 0x10; + uint16_t volume0 = ioport("STICKY1")->read() * 0x10; + uint16_t volume1 = ioport("STICKY2")->read() * 0x10; + uint16_t volume2 = ioport("STICKX1")->read() * 0x10; + uint16_t volume3 = ioport("STICKX2")->read() * 0x10; m_shareram[0x030/4] = (flags << 16) | volume0; m_shareram[0x034/4] = (volume1 << 16) | volume2; @@ -2981,7 +2981,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(namcos22_state::propcycl_pedal_interrupt) TIMER_DEVICE_CALLBACK_MEMBER(namcos22_state::propcycl_pedal_update) { // arbitrary timer for reading optical pedal - UINT8 i = ioport("PEDAL")->read(); + uint8_t i = ioport("PEDAL")->read(); if (i != 0) { @@ -3016,8 +3016,8 @@ TIMER_CALLBACK_MEMBER(namcos22_state::adillor_trackball_interrupt) TIMER_DEVICE_CALLBACK_MEMBER(namcos22_state::adillor_trackball_update) { // arbitrary timer for reading optical trackball - UINT8 ix = ioport("TRACKX")->read(); - UINT8 iy = ioport("TRACKY")->read(); + uint8_t ix = ioport("TRACKX")->read(); + uint8_t iy = ioport("TRACKY")->read(); if (ix != 0x80 || iy < 0x80) { @@ -5541,7 +5541,7 @@ DRIVER_INIT_MEMBER(namcos22_state,airco22) DRIVER_INIT_MEMBER(namcos22_state,propcycl) { - UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); // patch out strange routine (uninitialized-eeprom related?) // maybe needs more accurate 28C64 eeprom device emulation diff --git a/src/mame/drivers/namcos23.cpp b/src/mame/drivers/namcos23.cpp index 617457b73d3..cceca9fcbde 100644 --- a/src/mame/drivers/namcos23.cpp +++ b/src/mame/drivers/namcos23.cpp @@ -1303,9 +1303,9 @@ struct namcos23_render_entry { struct { - UINT16 model; - INT16 m[9]; - INT32 v[3]; + uint16_t model; + int16_t m[9]; + int32_t v[3]; float scaling; } model; }; @@ -1316,7 +1316,7 @@ struct namcos23_render_data running_machine *machine; const pen_t *pens; bitmap_rgb32 *bitmap; - UINT32 (*texture_lookup)(running_machine &machine, const pen_t *pens, float x, float y); + uint32_t (*texture_lookup)(running_machine &machine, const pen_t *pens, float x, float y); }; class namcos23_state; @@ -1326,7 +1326,7 @@ class namcos23_renderer : public poly_manager m_iocpu; required_device m_rtc; required_device m_settings; - required_shared_ptr m_mainram; - required_shared_ptr m_shared_ram; - required_shared_ptr m_gammaram; - required_shared_ptr m_charram; - required_shared_ptr m_textram; - optional_shared_ptr m_czattr; + required_shared_ptr m_mainram; + required_shared_ptr m_shared_ram; + required_shared_ptr m_gammaram; + required_shared_ptr m_charram; + required_shared_ptr m_textram; + optional_shared_ptr m_czattr; optional_device m_gmen_sh2; - optional_shared_ptr m_gmen_sh2_shared; + optional_shared_ptr m_gmen_sh2_shared; required_device m_gfxdecode; optional_ioport m_lightx; optional_ioport m_lighty; @@ -1451,7 +1451,7 @@ public: required_ioport m_p2; required_device m_screen; required_device m_palette; - required_shared_ptr m_generic_paletteram_32; + required_shared_ptr m_generic_paletteram_32; optional_ioport_array<4> m_adc_ports; c404_t m_c404; @@ -1463,22 +1463,22 @@ public: render_t m_render; tilemap_t *m_bgtilemap; - UINT8 m_jvssense; - INT32 m_has_jvsio; - UINT32 m_main_irqcause; + uint8_t m_jvssense; + int32_t m_has_jvsio; + uint32_t m_main_irqcause; bool m_ctl_vbl_active; - UINT8 m_ctl_led; - UINT16 m_ctl_inp_buffer[2]; + uint8_t m_ctl_led; + uint16_t m_ctl_inp_buffer[2]; bool m_subcpu_running; - UINT32 m_c435_address; - UINT32 m_c435_size; - const UINT32 *m_ptrom; - const UINT16 *m_tmlrom; - const UINT8 *m_tmhrom; - const UINT8 *m_texrom; - UINT32 m_tileid_mask; - UINT32 m_tile_mask; - UINT32 m_ptrom_limit; + uint32_t m_c435_address; + uint32_t m_c435_size; + const uint32_t *m_ptrom; + const uint16_t *m_tmlrom; + const uint8_t *m_tmhrom; + const uint8_t *m_texrom; + uint32_t m_tileid_mask; + uint32_t m_tile_mask; + uint32_t m_ptrom_limit; int m_vblank_count; @@ -1490,21 +1490,21 @@ public: // Matrices are stored in signed 2.14 fixed point // Vectors are stored in signed 10.14 fixed point - INT16 m_matrices[256][9]; - INT32 m_vectors[256][3]; - INT32 m_light_vector[3]; - UINT16 m_scaling; - INT32 m_spv[3]; - INT16 m_spm[3]; + int16_t m_matrices[256][9]; + int32_t m_vectors[256][3]; + int32_t m_light_vector[3]; + uint16_t m_scaling; + int32_t m_spv[3]; + int16_t m_spm[3]; - UINT16 m_c435_buffer[256]; + uint16_t m_c435_buffer[256]; int m_c435_buffer_pos; - UINT8 m_sub_porta; - UINT8 m_sub_portb; - UINT8 m_tssio_port_4; + uint8_t m_sub_porta; + uint8_t m_sub_portb; + uint8_t m_tssio_port_4; - void update_main_interrupts(UINT32 cause); + void update_main_interrupts(uint32_t cause); void update_mixer(); DECLARE_WRITE32_MEMBER(textram_w); @@ -1559,23 +1559,23 @@ public: DECLARE_MACHINE_RESET(gmen); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(interrupt); TIMER_CALLBACK_MEMBER(c361_timer_cb); void sub_irq(screen_device &screen, bool vblank_state); - UINT8 nthbyte(const UINT32 *pSource, int offs); - UINT16 nthword(const UINT32 *pSource, int offs); - inline INT32 u32_to_s24(UINT32 v); - inline INT32 u32_to_s10(UINT32 v); - float f24_to_f32(UINT32 v); + uint8_t nthbyte(const uint32_t *pSource, int offs); + uint16_t nthword(const uint32_t *pSource, int offs); + inline int32_t u32_to_s24(uint32_t v); + inline int32_t u32_to_s10(uint32_t v); + float f24_to_f32(uint32_t v); - INT32 *c435_getv(UINT16 id); - INT16 *c435_getm(UINT16 id); + int32_t *c435_getv(uint16_t id); + int16_t *c435_getm(uint16_t id); - void c435_state_set_interrupt(const UINT16 *param); - void c435_state_set_projection_matrix_line(const UINT16 *param); - void c435_state_set(UINT16 type, const UINT16 *param); - int c435_get_state_entry_size(UINT16 type); + void c435_state_set_interrupt(const uint16_t *param); + void c435_state_set_projection_matrix_line(const uint16_t *param); + void c435_state_set(uint16_t type, const uint16_t *param); + int c435_get_state_entry_size(uint16_t type); void c435_matrix_matrix_mul(); void c435_matrix_set(); @@ -1586,24 +1586,24 @@ public: void c435_render(); void c435_flush(); - void c435_pio_w(UINT16 data); - void c435_dma(address_space &space, UINT32 adr, UINT32 size); + void c435_pio_w(uint16_t data); + void c435_dma(address_space &space, uint32_t adr, uint32_t size); - void render_apply_transform(INT32 xi, INT32 yi, INT32 zi, const namcos23_render_entry *re, poly_vertex &pv); - void render_apply_matrot(INT32 xi, INT32 yi, INT32 zi, const namcos23_render_entry *re, INT32 &x, INT32 &y, INT32 &z); + void render_apply_transform(int32_t xi, int32_t yi, int32_t zi, const namcos23_render_entry *re, poly_vertex &pv); + void render_apply_matrot(int32_t xi, int32_t yi, int32_t zi, const namcos23_render_entry *re, int32_t &x, int32_t &y, int32_t &z); void render_project(poly_vertex &pv); void render_one_model(const namcos23_render_entry *re); void render_run(bitmap_rgb32 &bitmap); }; -UINT8 namcos23_state::nthbyte(const UINT32 *pSource, int offs) +uint8_t namcos23_state::nthbyte(const uint32_t *pSource, int offs) { pSource += offs/4; return (pSource[0]<<((offs&3)*8))>>24; } -UINT16 namcos23_state::nthword(const UINT32 *pSource, int offs) +uint16_t namcos23_state::nthword(const uint32_t *pSource, int offs) { pSource += offs/2; return (pSource[0]<<((offs&1)*16))>>16; @@ -1627,17 +1627,17 @@ namcos23_renderer::namcos23_renderer(namcos23_state &state) // 3D hardware, to throw at least in part in video/namcos23.c -inline INT32 namcos23_state::u32_to_s24(UINT32 v) +inline int32_t namcos23_state::u32_to_s24(uint32_t v) { return v & 0x800000 ? v | 0xff000000 : v & 0xffffff; } -inline INT32 namcos23_state::u32_to_s10(UINT32 v) +inline int32_t namcos23_state::u32_to_s10(uint32_t v) { return v & 0x200 ? v | 0xfffffe00 : v & 0x1ff; } -float namcos23_state::f24_to_f32(UINT32 v) +float namcos23_state::f24_to_f32(uint32_t v) { // 8 bits exponent, 16 mantissa // mantissa is 16-bits signed, 2-complement @@ -1648,9 +1648,9 @@ float namcos23_state::f24_to_f32(UINT32 v) if(!v) return 0; - UINT32 r = v & 0x8000 ? 0x80000000 : 0; - UINT16 m = r ? -v : v; - UINT8 e = (v >> 16) + 0x60; + uint32_t r = v & 0x8000 ? 0x80000000 : 0; + uint16_t m = r ? -v : v; + uint8_t e = (v >> 16) + 0x60; while(!(m & 0x8000)) { m <<= 1; e--; @@ -1660,16 +1660,16 @@ float namcos23_state::f24_to_f32(UINT32 v) return *(float *)&r; } -static inline UINT8 light(UINT8 c, float l) +static inline uint8_t light(uint8_t c, float l) { if(l < 1) l = l*c; else l = 255 - (255-c)/l; - return UINT8(l); + return uint8_t(l); } -INT32 *namcos23_state::c435_getv(UINT16 id) +int32_t *namcos23_state::c435_getv(uint16_t id) { if(id == 0x8000) return m_light_vector; @@ -1680,7 +1680,7 @@ INT32 *namcos23_state::c435_getv(UINT16 id) return m_vectors[id]; } -INT16 *namcos23_state::c435_getm(UINT16 id) +int16_t *namcos23_state::c435_getm(uint16_t id) { if(id >= 0x100) { memset(m_spm, 0, sizeof(m_spm)); @@ -1689,7 +1689,7 @@ INT16 *namcos23_state::c435_getm(UINT16 id) return m_matrices[id]; } -void namcos23_state::c435_state_set_interrupt(const UINT16 *param) +void namcos23_state::c435_state_set_interrupt(const uint16_t *param) { if(param[0] & 1) update_main_interrupts(m_main_irqcause | MAIN_C435_IRQ); @@ -1697,7 +1697,7 @@ void namcos23_state::c435_state_set_interrupt(const UINT16 *param) update_main_interrupts(m_main_irqcause & ~MAIN_C435_IRQ); } -void namcos23_state::c435_state_set_projection_matrix_line(const UINT16 *param) +void namcos23_state::c435_state_set_projection_matrix_line(const uint16_t *param) { // timecrs2: // sx = 640/2, sy = 480/2, t = tan(fov/2) (fov=45 degrees) @@ -1714,7 +1714,7 @@ void namcos23_state::c435_state_set_projection_matrix_line(const UINT16 *param) logerror(buf); } -void namcos23_state::c435_state_set(UINT16 type, const UINT16 *param) +void namcos23_state::c435_state_set(uint16_t type, const uint16_t *param) { switch(type) { case 0x0001: c435_state_set_interrupt(param); break; @@ -1747,7 +1747,7 @@ WRITE16_MEMBER(namcos23_state::c435_state_pio_w) m_c435_buffer_pos = 0; } -int namcos23_state::c435_get_state_entry_size(UINT16 type) +int namcos23_state::c435_get_state_entry_size(uint16_t type) { switch(type) { case 0x0001: return 1; @@ -1774,19 +1774,19 @@ void namcos23_state::c435_matrix_matrix_mul() // 0.0 if(m_c435_buffer[3] != 0xffff) logerror("WARNING: c435_matrix_matrix_mul with +2=%04x\n", m_c435_buffer[3]); - INT16 *t = c435_getm(m_c435_buffer[1]); - const INT16 *m2 = c435_getm(m_c435_buffer[2]); - const INT16 *m1 = c435_getm(m_c435_buffer[4]); - - t[0] = INT16((m1[0]*m2[0] + m1[1]*m2[1] + m1[2]*m2[2]) >> 14); - t[1] = INT16((m1[0]*m2[3] + m1[1]*m2[4] + m1[2]*m2[5]) >> 14); - t[2] = INT16((m1[0]*m2[6] + m1[1]*m2[7] + m1[2]*m2[8]) >> 14); - t[3] = INT16((m1[3]*m2[0] + m1[4]*m2[1] + m1[5]*m2[2]) >> 14); - t[4] = INT16((m1[3]*m2[3] + m1[4]*m2[4] + m1[5]*m2[5]) >> 14); - t[5] = INT16((m1[3]*m2[6] + m1[4]*m2[7] + m1[5]*m2[8]) >> 14); - t[6] = INT16((m1[6]*m2[0] + m1[7]*m2[1] + m1[8]*m2[2]) >> 14); - t[7] = INT16((m1[6]*m2[3] + m1[7]*m2[4] + m1[8]*m2[5]) >> 14); - t[8] = INT16((m1[6]*m2[6] + m1[7]*m2[7] + m1[8]*m2[8]) >> 14); + int16_t *t = c435_getm(m_c435_buffer[1]); + const int16_t *m2 = c435_getm(m_c435_buffer[2]); + const int16_t *m1 = c435_getm(m_c435_buffer[4]); + + t[0] = int16_t((m1[0]*m2[0] + m1[1]*m2[1] + m1[2]*m2[2]) >> 14); + t[1] = int16_t((m1[0]*m2[3] + m1[1]*m2[4] + m1[2]*m2[5]) >> 14); + t[2] = int16_t((m1[0]*m2[6] + m1[1]*m2[7] + m1[2]*m2[8]) >> 14); + t[3] = int16_t((m1[3]*m2[0] + m1[4]*m2[1] + m1[5]*m2[2]) >> 14); + t[4] = int16_t((m1[3]*m2[3] + m1[4]*m2[4] + m1[5]*m2[5]) >> 14); + t[5] = int16_t((m1[3]*m2[6] + m1[4]*m2[7] + m1[5]*m2[8]) >> 14); + t[6] = int16_t((m1[6]*m2[0] + m1[7]*m2[1] + m1[8]*m2[2]) >> 14); + t[7] = int16_t((m1[6]*m2[3] + m1[7]*m2[4] + m1[8]*m2[5]) >> 14); + t[8] = int16_t((m1[6]*m2[6] + m1[7]*m2[7] + m1[8]*m2[8]) >> 14); } void namcos23_state::c435_matrix_vector_mul() // 0.1 @@ -1801,23 +1801,23 @@ void namcos23_state::c435_matrix_vector_mul() // 0.1 if(m_c435_buffer[3] != 0xffff) { - INT32 *t = c435_getv(m_c435_buffer[1]); - const INT16 *m = c435_getm(m_c435_buffer[2]); - const INT32 *vt = c435_getv(m_c435_buffer[3]); - const INT32 *v = c435_getv(m_c435_buffer[4]); + int32_t *t = c435_getv(m_c435_buffer[1]); + const int16_t *m = c435_getm(m_c435_buffer[2]); + const int32_t *vt = c435_getv(m_c435_buffer[3]); + const int32_t *v = c435_getv(m_c435_buffer[4]); - t[0] = INT32((m[0]*INT64(v[0]) + m[1]*INT64(v[1]) + m[2]*INT64(v[2])) >> 14) + vt[0]; - t[1] = INT32((m[3]*INT64(v[0]) + m[4]*INT64(v[1]) + m[5]*INT64(v[2])) >> 14) + vt[1]; - t[2] = INT32((m[6]*INT64(v[0]) + m[7]*INT64(v[1]) + m[8]*INT64(v[2])) >> 14) + vt[2]; + t[0] = int32_t((m[0]*int64_t(v[0]) + m[1]*int64_t(v[1]) + m[2]*int64_t(v[2])) >> 14) + vt[0]; + t[1] = int32_t((m[3]*int64_t(v[0]) + m[4]*int64_t(v[1]) + m[5]*int64_t(v[2])) >> 14) + vt[1]; + t[2] = int32_t((m[6]*int64_t(v[0]) + m[7]*int64_t(v[1]) + m[8]*int64_t(v[2])) >> 14) + vt[2]; } else { - INT32 *t = c435_getv(m_c435_buffer[1]); - const INT16 *m = c435_getm(m_c435_buffer[2]); - const INT32 *v = c435_getv(m_c435_buffer[4]); + int32_t *t = c435_getv(m_c435_buffer[1]); + const int16_t *m = c435_getm(m_c435_buffer[2]); + const int32_t *v = c435_getv(m_c435_buffer[4]); - t[0] = INT32((m[0]*INT64(v[0]) + m[1]*INT64(v[1]) + m[2]*INT64(v[2])) >> 14); - t[1] = INT32((m[3]*INT64(v[0]) + m[4]*INT64(v[1]) + m[5]*INT64(v[2])) >> 14); - t[2] = INT32((m[6]*INT64(v[0]) + m[7]*INT64(v[1]) + m[8]*INT64(v[2])) >> 14); + t[0] = int32_t((m[0]*int64_t(v[0]) + m[1]*int64_t(v[1]) + m[2]*int64_t(v[2])) >> 14); + t[1] = int32_t((m[3]*int64_t(v[0]) + m[4]*int64_t(v[1]) + m[5]*int64_t(v[2])) >> 14); + t[2] = int32_t((m[6]*int64_t(v[0]) + m[7]*int64_t(v[1]) + m[8]*int64_t(v[2])) >> 14); } } @@ -1831,7 +1831,7 @@ void namcos23_state::c435_matrix_set() // 0.4 if(m_c435_buffer[0] != 0x004a) logerror("WARNING: c435_matrix_set header %04x\n", m_c435_buffer[0]); - INT16 *t = c435_getm(m_c435_buffer[1]); + int16_t *t = c435_getm(m_c435_buffer[1]); for(int i=0; i<9; i++) t[i] = m_c435_buffer[i+2]; } @@ -1845,7 +1845,7 @@ void namcos23_state::c435_vector_set() // 0.5 if(m_c435_buffer[0] != 0x057) logerror("WARNING: c435_vector_set header %04x\n", m_c435_buffer[0]); - INT32 *t = c435_getv(m_c435_buffer[1]); + int32_t *t = c435_getv(m_c435_buffer[1]); for(int i=0; i<3; i++) t[i] = u32_to_s24((m_c435_buffer[2*i+2] << 16) | m_c435_buffer[2*i+3]); } @@ -1893,8 +1893,8 @@ void namcos23_state::c435_render() // 8 } // Vector and matrix may be inverted - const INT16 *m = c435_getm(m_c435_buffer[2]); - const INT32 *v = c435_getv(m_c435_buffer[3]); + const int16_t *m = c435_getm(m_c435_buffer[2]); + const int32_t *v = c435_getv(m_c435_buffer[3]); namcos23_render_entry *re = render.entries[render.cur] + render.count[render.cur]; re->type = MODEL; @@ -1930,10 +1930,10 @@ void namcos23_state::c435_flush() // c } -void namcos23_state::c435_pio_w(UINT16 data) +void namcos23_state::c435_pio_w(uint16_t data) { m_c435_buffer[m_c435_buffer_pos++] = data; - UINT16 h = m_c435_buffer[0]; + uint16_t h = m_c435_buffer[0]; int psize; if((h & 0x4000) == 0x4000) psize = h & 0xff; @@ -1979,7 +1979,7 @@ void namcos23_state::c435_pio_w(UINT16 data) m_c435_buffer_pos = 0; } -void namcos23_state::c435_dma(address_space &space, UINT32 adr, UINT32 size) +void namcos23_state::c435_dma(address_space &space, uint32_t adr, uint32_t size) { adr &= 0x1fffffff; @@ -2020,7 +2020,7 @@ WRITE32_MEMBER(namcos23_state::c435_w) -void namcos23_renderer::render_scanline(INT32 scanline, const extent_t& extent, const namcos23_render_data& object, int threadid) +void namcos23_renderer::render_scanline(int32_t scanline, const extent_t& extent, const namcos23_render_data& object, int threadid) { const namcos23_render_data& rd = object; @@ -2033,11 +2033,11 @@ void namcos23_renderer::render_scanline(INT32 scanline, const extent_t& extent, float dv = extent.param[2].dpdx; float dl = extent.param[3].dpdx; - UINT32 *img = &object.bitmap->pix32(scanline, extent.startx); + uint32_t *img = &object.bitmap->pix32(scanline, extent.startx); for(int x = extent.startx; x < extent.stopx; x++) { float z = w ? 1/w : 0; - UINT32 pcol = rd.texture_lookup(*rd.machine, rd.pens, u*z, v*z); + uint32_t pcol = rd.texture_lookup(*rd.machine, rd.pens, u*z, v*z); float ll = l*z; *img = (light(pcol >> 16, ll) << 16) | (light(pcol >> 8, ll) << 8) | light(pcol, ll); @@ -2049,14 +2049,14 @@ void namcos23_renderer::render_scanline(INT32 scanline, const extent_t& extent, } } -void namcos23_state::render_apply_transform(INT32 xi, INT32 yi, INT32 zi, const namcos23_render_entry *re, poly_vertex &pv) +void namcos23_state::render_apply_transform(int32_t xi, int32_t yi, int32_t zi, const namcos23_render_entry *re, poly_vertex &pv) { - pv.x = (INT32((re->model.m[0]*INT64(xi) + re->model.m[1]*INT64(yi) + re->model.m[2]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[0])/16384.0f; - pv.y = (INT32((re->model.m[3]*INT64(xi) + re->model.m[4]*INT64(yi) + re->model.m[5]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[1])/16384.0f; - pv.p[0] = (INT32((re->model.m[6]*INT64(xi) + re->model.m[7]*INT64(yi) + re->model.m[8]*INT64(zi)) >> 14)*re->model.scaling + re->model.v[2])/16384.0f; + pv.x = (int32_t((re->model.m[0]*int64_t(xi) + re->model.m[1]*int64_t(yi) + re->model.m[2]*int64_t(zi)) >> 14)*re->model.scaling + re->model.v[0])/16384.0f; + pv.y = (int32_t((re->model.m[3]*int64_t(xi) + re->model.m[4]*int64_t(yi) + re->model.m[5]*int64_t(zi)) >> 14)*re->model.scaling + re->model.v[1])/16384.0f; + pv.p[0] = (int32_t((re->model.m[6]*int64_t(xi) + re->model.m[7]*int64_t(yi) + re->model.m[8]*int64_t(zi)) >> 14)*re->model.scaling + re->model.v[2])/16384.0f; } -void namcos23_state::render_apply_matrot(INT32 xi, INT32 yi, INT32 zi, const namcos23_render_entry *re, INT32 &x, INT32 &y, INT32 &z) +void namcos23_state::render_apply_matrot(int32_t xi, int32_t yi, int32_t zi, const namcos23_render_entry *re, int32_t &x, int32_t &y, int32_t &z) { x = (re->model.m[0]*xi + re->model.m[3]*yi + re->model.m[6]*zi) >> 14; y = (re->model.m[1]*xi + re->model.m[4]*yi + re->model.m[7]*zi) >> 14; @@ -2081,22 +2081,22 @@ void namcos23_state::render_project(poly_vertex &pv) pv.p[0] = 1.0f / pv.p[0]; } -static UINT32 render_texture_lookup_nocache_point(running_machine &machine, const pen_t *pens, float x, float y) +static uint32_t render_texture_lookup_nocache_point(running_machine &machine, const pen_t *pens, float x, float y) { namcos23_state *state = machine.driver_data(); - UINT32 xx = UINT32(x); - UINT32 yy = UINT32(y); - UINT32 tileid = ((xx >> 4) & 0xff) | ((yy << 4) & state->m_tileid_mask); - UINT8 attr = state->m_tmhrom[tileid >> 1]; + uint32_t xx = uint32_t(x); + uint32_t yy = uint32_t(y); + uint32_t tileid = ((xx >> 4) & 0xff) | ((yy << 4) & state->m_tileid_mask); + uint8_t attr = state->m_tmhrom[tileid >> 1]; if(tileid & 1) attr &= 15; else attr >>= 4; - UINT32 tile = (state->m_tmlrom[tileid] | (attr << 16)) & state->m_tile_mask; + uint32_t tile = (state->m_tmlrom[tileid] | (attr << 16)) & state->m_tile_mask; // Probably swapx/swapy to add on bits 2-3 of attr // Bits used by motoxgo at least - UINT8 color = state->m_texrom[(tile << 8) | ((yy << 4) & 0xf0) | (xx & 0x0f)]; + uint8_t color = state->m_texrom[(tile << 8) | ((yy << 4) & 0xf0) | (xx & 0x0f)]; return pens[color]; } @@ -2111,7 +2111,7 @@ void namcos23_state::render_one_model(const namcos23_render_entry *re) if(re->model.model == 3486) return; - UINT32 adr = m_ptrom[re->model.model]; + uint32_t adr = m_ptrom[re->model.model]; if(adr >= m_ptrom_limit) { logerror("WARNING: model %04x base address %08x out-of-bounds - pointram?\n", re->model.model, adr); return; @@ -2120,11 +2120,11 @@ void namcos23_state::render_one_model(const namcos23_render_entry *re) while(adr < m_ptrom_limit) { poly_vertex pv[15]; - UINT32 type = m_ptrom[adr++]; - UINT32 h = m_ptrom[adr++]; + uint32_t type = m_ptrom[adr++]; + uint32_t h = m_ptrom[adr++]; float tbase = (type >> 24) << 12; - UINT8 color = (h >> 24) & 0x7f; + uint8_t color = (h >> 24) & 0x7f; int lmode = (type >> 19) & 3; int ne = (type >> 8) & 15; @@ -2132,8 +2132,8 @@ void namcos23_state::render_one_model(const namcos23_render_entry *re) if(type & 0x00001000) adr++; - UINT32 light = 0; - UINT32 extptr = 0; + uint32_t light = 0; + uint32_t extptr = 0; if(lmode == 3) { extptr = adr; @@ -2146,9 +2146,9 @@ void namcos23_state::render_one_model(const namcos23_render_entry *re) float maxz = FLT_MIN; for(int i=0; i> 20) & 0xf00) | ((v2 >> 24 & 0xff))) + 0.5; @@ -2170,11 +2170,11 @@ void namcos23_state::render_one_model(const namcos23_render_entry *re) pv[i].p[3] = 1.0; break; case 3: { - UINT32 norm = m_ptrom[extptr++]; - INT32 nx = u32_to_s10(norm >> 20); - INT32 ny = u32_to_s10(norm >> 10); - INT32 nz = u32_to_s10(norm); - INT32 nrx, nry, nrz; + uint32_t norm = m_ptrom[extptr++]; + int32_t nx = u32_to_s10(norm >> 20); + int32_t ny = u32_to_s10(norm >> 10); + int32_t nz = u32_to_s10(norm); + int32_t nrx, nry, nrz; render_apply_matrot(nx, ny, nz, re, nrx, nry, nrz); float lsi = float(nrx*m_light_vector[0] + nry*m_light_vector[1] + nrz*m_light_vector[2])/4194304.0f; if(lsi < 0) @@ -2353,7 +2353,7 @@ WRITE32_MEMBER(namcos23_state::paletteram_w) TILE_GET_INFO_MEMBER(namcos23_state::TextTilemapGetInfo) { - UINT16 data = nthword( m_textram,tile_index ); + uint16_t data = nthword( m_textram,tile_index ); /** * xxxx.----.----.---- palette select * ----.xx--.----.---- flip @@ -2381,7 +2381,7 @@ WRITE32_MEMBER(namcos23_state::textchar_w) VIDEO_START_MEMBER(namcos23_state,s23) { - m_gfxdecode->gfx(0)->set_source(reinterpret_cast(m_charram.target())); + m_gfxdecode->gfx(0)->set_source(reinterpret_cast(m_charram.target())); m_bgtilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(namcos23_state::TextTilemapGetInfo),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); m_bgtilemap->set_transparent_pen(0xf); m_bgtilemap->set_scrolldx(860, 860); @@ -2389,7 +2389,7 @@ VIDEO_START_MEMBER(namcos23_state,s23) } -UINT32 namcos23_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t namcos23_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { update_mixer(); bitmap.fill(m_c404.bgcolor, cliprect); @@ -2418,9 +2418,9 @@ UINT32 namcos23_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap // Interrupts -void namcos23_state::update_main_interrupts(UINT32 cause) +void namcos23_state::update_main_interrupts(uint32_t cause) { - UINT32 changed = cause ^ m_main_irqcause; + uint32_t changed = cause ^ m_main_irqcause; m_main_irqcause = cause; // level 2: vblank @@ -2806,7 +2806,7 @@ READ16_MEMBER(namcos23_state::ctl_r) case 1: return 0x0000 | ioport("DSW")->read() | ((m_main_irqcause & MAIN_C361_IRQ) ? 0x400 : 0); case 2: case 3: { - UINT16 res = m_ctl_inp_buffer[offset-2] & 0x800 ? 0xffff : 0x0000; + uint16_t res = m_ctl_inp_buffer[offset-2] & 0x800 ? 0xffff : 0x0000; m_ctl_inp_buffer[offset-2] = (m_ctl_inp_buffer[offset-2] << 1) | 1; return res; } @@ -2974,7 +2974,7 @@ ADDRESS_MAP_END WRITE16_MEMBER(namcos23_state::sharedram_sub_w) { - UINT16 *shared16 = reinterpret_cast(m_shared_ram.target()); + uint16_t *shared16 = reinterpret_cast(m_shared_ram.target()); // fake that an I/O board is connected for games w/o a dump or that aren't properly communicating with it yet if(!m_has_jvsio) { @@ -2988,7 +2988,7 @@ WRITE16_MEMBER(namcos23_state::sharedram_sub_w) READ16_MEMBER(namcos23_state::sharedram_sub_r) { - UINT16 *shared16 = reinterpret_cast(m_shared_ram.target()); + uint16_t *shared16 = reinterpret_cast(m_shared_ram.target()); return shared16[BYTE_XOR_BE(offset)]; } @@ -3120,7 +3120,7 @@ WRITE16_MEMBER(namcos23_state::iob_p4_w) READ16_MEMBER(namcos23_state::iob_p6_r) { // d4 is service button - UINT8 sb = (ioport("SERVICE")->read() & 1) << 4; + uint8_t sb = (ioport("SERVICE")->read() & 1) << 4; // other bits: unknown return sb | 0; @@ -3163,8 +3163,8 @@ ADDRESS_MAP_END READ8_MEMBER(namcos23_state::iob_gun_r) { - UINT16 xpos = m_lightx->read(); - UINT16 ypos = m_lighty->read(); + uint16_t xpos = m_lightx->read(); + uint16_t ypos = m_lighty->read(); // ypos is not completely understood yet, there should be a difference between case 1/4 and 2/5 switch(offset) { @@ -3442,7 +3442,7 @@ void namcos23_state::machine_start() m_c361.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcos23_state::c361_timer_cb),this)); m_c361.timer->adjust(attotime::never); - m_maincpu->add_fastram(0, m_mainram.bytes()-1, FALSE, reinterpret_cast(memshare("mainram")->ptr())); + m_maincpu->add_fastram(0, m_mainram.bytes()-1, FALSE, reinterpret_cast(memshare("mainram")->ptr())); } @@ -3465,8 +3465,8 @@ MACHINE_RESET_MEMBER(namcos23_state,gmen) DRIVER_INIT_MEMBER(namcos23_state,s23) { - m_ptrom = (const UINT32 *)memregion("pointrom")->base(); - m_tmlrom = (const UINT16 *)memregion("textilemapl")->base(); + m_ptrom = (const uint32_t *)memregion("pointrom")->base(); + m_tmlrom = (const uint16_t *)memregion("textilemapl")->base(); m_tmhrom = memregion("textilemaph")->base(); m_texrom = memregion("textile")->base(); diff --git a/src/mame/drivers/namcos86.cpp b/src/mame/drivers/namcos86.cpp index a2bd0bf6ca3..e4455cac255 100644 --- a/src/mame/drivers/namcos86.cpp +++ b/src/mame/drivers/namcos86.cpp @@ -1666,25 +1666,25 @@ ROM_END DRIVER_INIT_MEMBER(namcos86_state,namco86) { int size; - UINT8 *gfx; + uint8_t *gfx; /* shuffle tile ROMs so regular gfx unpack routines can be used */ gfx = memregion("gfx1")->base(); size = memregion("gfx1")->bytes() * 2 / 3; { - std::vector buffer( size ); - UINT8 *dest1 = gfx; - UINT8 *dest2 = gfx + ( size / 2 ); - UINT8 *mono = gfx + size; + std::vector buffer( size ); + uint8_t *dest1 = gfx; + uint8_t *dest2 = gfx + ( size / 2 ); + uint8_t *mono = gfx + size; int i; memcpy( &buffer[0], gfx, size ); for ( i = 0; i < size; i += 2 ) { - UINT8 data1 = buffer[i]; - UINT8 data2 = buffer[i+1]; + uint8_t data1 = buffer[i]; + uint8_t data2 = buffer[i+1]; *dest1++ = ( data1 << 4 ) | ( data2 & 0xf ); *dest2++ = ( data1 & 0xf0 ) | ( data2 >> 4 ); @@ -1696,18 +1696,18 @@ DRIVER_INIT_MEMBER(namcos86_state,namco86) size = memregion("gfx2")->bytes() * 2 / 3; { - std::vector buffer( size ); - UINT8 *dest1 = gfx; - UINT8 *dest2 = gfx + ( size / 2 ); - UINT8 *mono = gfx + size; + std::vector buffer( size ); + uint8_t *dest1 = gfx; + uint8_t *dest2 = gfx + ( size / 2 ); + uint8_t *mono = gfx + size; int i; memcpy( &buffer[0], gfx, size ); for ( i = 0; i < size; i += 2 ) { - UINT8 data1 = buffer[i]; - UINT8 data2 = buffer[i+1]; + uint8_t data1 = buffer[i]; + uint8_t data2 = buffer[i+1]; *dest1++ = ( data1 << 4 ) | ( data2 & 0xf ); *dest2++ = ( data1 & 0xf0 ) | ( data2 >> 4 ); diff --git a/src/mame/drivers/nanos.cpp b/src/mame/drivers/nanos.cpp index de6ae52883c..97b897b7b74 100644 --- a/src/mame/drivers/nanos.cpp +++ b/src/mame/drivers/nanos.cpp @@ -54,10 +54,10 @@ public: required_device m_fdc; required_device m_key_t; required_device m_ram; - const UINT8 *m_p_chargen; - UINT8 m_key_command; - UINT8 m_last_code; - UINT8 m_key_pressed; + const uint8_t *m_p_chargen; + uint8_t m_key_command; + uint8_t m_last_code; + uint8_t m_key_pressed; DECLARE_WRITE8_MEMBER( nanos_tc_w ); DECLARE_WRITE_LINE_MEMBER( ctc_z0_w ); DECLARE_WRITE_LINE_MEMBER( ctc_z1_w ); @@ -65,7 +65,7 @@ public: virtual void machine_reset() override; virtual void machine_start() override; virtual void video_start() override; - 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); TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); DECLARE_WRITE_LINE_MEMBER(z80daisy_interrupt); DECLARE_READ8_MEMBER(nanos_port_a_r); @@ -80,7 +80,7 @@ protected: required_memory_bank m_bank3; required_ioport_array<7> m_lines; required_ioport m_linec; - UINT8 row_number(UINT8 code); + uint8_t row_number(uint8_t code); }; @@ -246,11 +246,11 @@ void nanos_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 nanos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t nanos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { -// static UINT8 framecnt=0; - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; +// static uint8_t framecnt=0; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; // framecnt++; @@ -258,7 +258,7 @@ UINT32 nanos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 80; x++) { @@ -290,7 +290,7 @@ UINT32 nanos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c READ8_MEMBER(nanos_state::nanos_port_a_r) { - UINT8 retVal; + uint8_t retVal; if (m_key_command==0) { return m_key_pressed; } else { @@ -316,7 +316,7 @@ WRITE8_MEMBER(nanos_state::nanos_port_b_w) } } -UINT8 nanos_state::row_number(UINT8 code) +uint8_t nanos_state::row_number(uint8_t code) { if (BIT(code, 0)) return 0; if (BIT(code, 1)) return 1; @@ -332,10 +332,10 @@ UINT8 nanos_state::row_number(UINT8 code) TIMER_DEVICE_CALLBACK_MEMBER(nanos_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; m_key_pressed = 0xff; for(i = 0; i < 7; i++) { diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp index 5bba754882b..4ca402f409c 100644 --- a/src/mame/drivers/naomi.cpp +++ b/src/mame/drivers/naomi.cpp @@ -1574,12 +1574,12 @@ Premier Eleven READ64_MEMBER(naomi_state::naomi_arm_r ) { - return *(reinterpret_cast(dc_sound_ram.target())+offset); + return *(reinterpret_cast(dc_sound_ram.target())+offset); } WRITE64_MEMBER(naomi_state::naomi_arm_w ) { - COMBINE_DATA(reinterpret_cast(dc_sound_ram.target()) + offset); + COMBINE_DATA(reinterpret_cast(dc_sound_ram.target()) + offset); } READ64_MEMBER(naomi_state::naomi_unknown1_r ) @@ -1795,18 +1795,18 @@ ADDRESS_MAP_END READ64_MEMBER(naomi_state::aw_flash_r ) { - return (UINT64)m_awflash->read(offset*8) | (UINT64)m_awflash->read((offset*8)+1)<<8 | (UINT64)m_awflash->read((offset*8)+2)<<16 | (UINT64)m_awflash->read((offset*8)+3)<<24 | - (UINT64)m_awflash->read((offset*8)+4)<<32 | (UINT64)m_awflash->read((offset*8)+5)<<40 | (UINT64)m_awflash->read((offset*8)+6)<<48 | (UINT64)m_awflash->read((offset*8)+7)<<56; + return (uint64_t)m_awflash->read(offset*8) | (uint64_t)m_awflash->read((offset*8)+1)<<8 | (uint64_t)m_awflash->read((offset*8)+2)<<16 | (uint64_t)m_awflash->read((offset*8)+3)<<24 | + (uint64_t)m_awflash->read((offset*8)+4)<<32 | (uint64_t)m_awflash->read((offset*8)+5)<<40 | (uint64_t)m_awflash->read((offset*8)+6)<<48 | (uint64_t)m_awflash->read((offset*8)+7)<<56; } WRITE64_MEMBER(naomi_state::aw_flash_w ) { int i; - UINT32 addr = offset * 8; + uint32_t addr = offset * 8; for (i = 0; i < 8; i++) { - if (mem_mask & ((UINT64)0xff)<< (i*8)) + if (mem_mask & ((uint64_t)0xff)<< (i*8)) { addr += i; break; @@ -1818,7 +1818,7 @@ WRITE64_MEMBER(naomi_state::aw_flash_w ) m_awflash->write(addr, data); } -inline int naomi_state::decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) +inline int naomi_state::decode_reg32_64(uint32_t offset, uint64_t mem_mask, uint64_t *shift) { int reg = offset * 2; @@ -1843,7 +1843,7 @@ inline int naomi_state::decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 * READ64_MEMBER(naomi_state::aw_modem_r ) { int reg; - UINT64 shift; + uint64_t shift; reg = decode_reg32_64(offset, mem_mask, &shift); @@ -1869,11 +1869,11 @@ READ64_MEMBER(naomi_state::aw_modem_r ) WRITE64_MEMBER(naomi_state::aw_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); if (reg == 0x284/4) { aw_ctrl_type = dat & 0xF0; @@ -6990,7 +6990,7 @@ time to go to sleep void naomi_write_keyfile(void) { // default key structure - UINT8 response[10][8] = { + uint8_t response[10][8] = { { ':', 0x70, 0x1f, 0x71, 0x1f, 0x00, 0x00, 0x00 }, // response to kayjyo!? { '8', 'V', 'E', 'R', '0', '0', '0', '1' }, // response to bsec_ver { '7', 'T', 'E', 'S', 'T', '_', 'O', 'K' }, // response to atestpic @@ -7008,7 +7008,7 @@ void naomi_write_keyfile(void) char picname[256]; // ######### edit this ########### - UINT64 key = 0x4FF16D1A9E0BFBCDULL; + uint64_t key = 0x4FF16D1A9E0BFBCDULL; memset(bootname,0x00,14); memset(picname,0x00,256); @@ -7031,7 +7031,7 @@ void naomi_write_keyfile(void) for (i=0;i<8;i++) { - UINT8 keybyte = (key>>(7-i)*8)&0xff; + uint8_t keybyte = (key>>(7-i)*8)&0xff; if (i<7) { @@ -9003,10 +9003,10 @@ ROM_END DRIVER_INIT_MEMBER(naomi_state,atomiswave) { - UINT64 *ROM = (UINT64 *)memregion("awflash")->base(); + uint64_t *ROM = (uint64_t *)memregion("awflash")->base(); // patch out long startup delay - ROM[0x98e/8] = (ROM[0x98e/8] & U64(0xffffffffffff)) | (UINT64)0x0009<<48; + ROM[0x98e/8] = (ROM[0x98e/8] & U64(0xffffffffffff)) | (uint64_t)0x0009<<48; aw_ctrl_type = 0; } @@ -9016,13 +9016,13 @@ READ64_MEMBER(naomi_state::xtrmhnt2_hack_r) // disable ALL.Net board check if (space.device().safe_pc() == 0xc03cb30) { - dc_ram[0x357fe/8] |= (UINT64)0x200 << 48; - dc_ram[0x358e2/8] |= (UINT64)0x200 << 16; - dc_ram[0x38bb2/8] |= (UINT64)0x200 << 16; - dc_ram[0x38bee/8] |= (UINT64)0x200 << 48; + dc_ram[0x357fe/8] |= (uint64_t)0x200 << 48; + dc_ram[0x358e2/8] |= (uint64_t)0x200 << 16; + dc_ram[0x38bb2/8] |= (uint64_t)0x200 << 16; + dc_ram[0x38bee/8] |= (uint64_t)0x200 << 48; } if (space.device().safe_pc() == 0xc108240) - dc_ram[0x9acc8/8] = (dc_ram[0x9acc8/8] & U64(0xffffffffffff0000)) | (UINT64)0x0009; + dc_ram[0x9acc8/8] = (dc_ram[0x9acc8/8] & U64(0xffffffffffff0000)) | (uint64_t)0x0009; return 0; } diff --git a/src/mame/drivers/nascom1.cpp b/src/mame/drivers/nascom1.cpp index 4618cc2be06..3b679ce5466 100644 --- a/src/mame/drivers/nascom1.cpp +++ b/src/mame/drivers/nascom1.cpp @@ -34,8 +34,8 @@ struct nascom1_portstat_t { - UINT8 stat_flags; - UINT8 stat_count; + uint8_t stat_flags; + uint8_t stat_count; }; class nascom_state : public driver_device @@ -59,11 +59,11 @@ public: required_device m_ram; required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_ioport_array<9> m_keyboard; int m_tape_size; - UINT8 *m_tape_image; + uint8_t *m_tape_image; int m_tape_index; nascom1_portstat_t m_portstat; @@ -94,7 +94,7 @@ public: nascom_state(mconfig, type, tag) {} - UINT32 screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: }; @@ -114,7 +114,7 @@ public: DECLARE_WRITE_LINE_MEMBER(ram_disable_cpm_w); DECLARE_DRIVER_INIT(nascom2); DECLARE_DRIVER_INIT(nascom2c); - UINT32 screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); image_init_result load_cart(device_image_interface &image, generic_slot_device *slot, int slot_id); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(socket1_load) { return load_cart(image, m_socket1, 1); } @@ -183,7 +183,7 @@ WRITE8_MEMBER( nascom_state::nascom1_port_01_w ) READ8_MEMBER( nascom_state::nascom1_port_02_r ) { - UINT8 data = 0x31; + uint8_t data = 0x31; m_hd6402->set_input_pin(AY31015_SWE, 0); data |= m_hd6402->get_output_pin(AY31015_OR ) ? 0x02 : 0; @@ -208,7 +208,7 @@ WRITE8_MEMBER( nascom_state::nascom1_hd6402_so ) DEVICE_IMAGE_LOAD_MEMBER( nascom_state, nascom1_cassette ) { m_tape_size = image.length(); - m_tape_image = (UINT8*)image.ptr(); + m_tape_image = (uint8_t*)image.ptr(); if (!m_tape_image) return image_init_result::FAIL; @@ -230,7 +230,7 @@ DEVICE_IMAGE_UNLOAD_MEMBER( nascom_state, nascom1_cassette ) SNAPSHOT_LOAD_MEMBER( nascom_state, nascom1 ) { - UINT8 line[35]; + uint8_t line[35]; while (image.fread( &line, sizeof(line)) == sizeof(line)) { @@ -287,25 +287,25 @@ image_init_result nascom2_state::load_cart(device_image_interface &image, generi // loading from software list. this supports multiple regions to load to else { - UINT8 *region_b000 = image.get_software_region("b000"); - UINT8 *region_c000 = image.get_software_region("c000"); - UINT8 *region_d000 = image.get_software_region("d000"); + uint8_t *region_b000 = image.get_software_region("b000"); + uint8_t *region_c000 = image.get_software_region("c000"); + uint8_t *region_d000 = image.get_software_region("d000"); if (region_b000 != nullptr) { - UINT32 size = image.get_software_region_length("b000"); + uint32_t size = image.get_software_region_length("b000"); m_maincpu->space(AS_PROGRAM).install_rom(0xb000, 0xb000 + size - 1, region_b000); } if (region_c000 != nullptr) { - UINT32 size = image.get_software_region_length("c000"); + uint32_t size = image.get_software_region_length("c000"); m_maincpu->space(AS_PROGRAM).install_rom(0xc000, 0xc000 + size - 1, region_c000); } if (region_d000 != nullptr) { - UINT32 size = image.get_software_region_length("d000"); + uint32_t size = image.get_software_region_length("d000"); m_maincpu->space(AS_PROGRAM).install_rom(0xd000, 0xd000 + size - 1, region_d000); } } @@ -410,7 +410,7 @@ static GFXDECODE_START( nascom1 ) GFXDECODE_ENTRY("gfx1", 0x0000, nascom1_charlayout, 0, 1) GFXDECODE_END -UINT32 nascom1_state::screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t nascom1_state::screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_update(bitmap, cliprect, 16); return 0; @@ -432,7 +432,7 @@ static GFXDECODE_START( nascom2 ) GFXDECODE_ENTRY("gfx1", 0x0000, nascom2_charlayout, 0, 1) GFXDECODE_END -UINT32 nascom2_state::screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t nascom2_state::screen_update_nascom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_update(bitmap, cliprect, 14); return 0; diff --git a/src/mame/drivers/naughtyb.cpp b/src/mame/drivers/naughtyb.cpp index 08c2e7e23f6..21ee2d04a88 100644 --- a/src/mame/drivers/naughtyb.cpp +++ b/src/mame/drivers/naughtyb.cpp @@ -146,7 +146,7 @@ READ8_MEMBER(naughtyb_state::popflame_protection_r)/* Not used by bootleg/hack * { static const int seed00[4] = { 0x78, 0x68, 0x48, 0x38|0x80 }; static const int seed10[4] = { 0x68, 0x60, 0x68, 0x60|0x80 }; - UINT8 seedxx; + uint8_t seedxx; seedxx = (m_r_index < 0x89) ? 1 : 0; diff --git a/src/mame/drivers/nbmj8688.cpp b/src/mame/drivers/nbmj8688.cpp index 2486f59a0df..21f22017d76 100644 --- a/src/mame/drivers/nbmj8688.cpp +++ b/src/mame/drivers/nbmj8688.cpp @@ -44,8 +44,8 @@ TODO: DRIVER_INIT_MEMBER(nbmj8688_state,mjcamera) { - UINT8 *rom = memregion("voice")->base() + 0x20000; - UINT8 *prot = memregion("user1")->base(); + uint8_t *rom = memregion("voice")->base() + 0x20000; + uint8_t *prot = memregion("user1")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the @@ -62,7 +62,7 @@ DRIVER_INIT_MEMBER(nbmj8688_state,mjcamera) DRIVER_INIT_MEMBER(nbmj8688_state,kanatuen) { /* uses the same protection data as mjcamer, but a different check */ - UINT8 *rom = memregion("voice")->base() + 0x30000; + uint8_t *rom = memregion("voice")->base() + 0x30000; rom[0x0004] = 0x09; rom[0x0103] = 0x0e; @@ -74,7 +74,7 @@ DRIVER_INIT_MEMBER(nbmj8688_state,kyuhito) { #if 1 /* uses the same protection data as ????, but a different check */ - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); rom[0x0149] = 0x00; rom[0x014a] = 0x00; @@ -84,8 +84,8 @@ DRIVER_INIT_MEMBER(nbmj8688_state,kyuhito) DRIVER_INIT_MEMBER(nbmj8688_state,idhimitu) { - UINT8 *rom = memregion("voice")->base() + 0x20000; - UINT8 *prot = memregion("user1")->base(); + uint8_t *rom = memregion("voice")->base() + 0x20000; + uint8_t *prot = memregion("user1")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the @@ -101,8 +101,8 @@ DRIVER_INIT_MEMBER(nbmj8688_state,idhimitu) DRIVER_INIT_MEMBER(nbmj8688_state,kaguya2) { - UINT8 *rom = memregion("voice")->base() + 0x20000; - UINT8 *prot = memregion("user1")->base(); + uint8_t *rom = memregion("voice")->base() + 0x20000; + uint8_t *prot = memregion("user1")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the diff --git a/src/mame/drivers/nbmj8891.cpp b/src/mame/drivers/nbmj8891.cpp index 64966bd50b3..09c383ceb5f 100644 --- a/src/mame/drivers/nbmj8891.cpp +++ b/src/mame/drivers/nbmj8891.cpp @@ -52,7 +52,7 @@ TODO: DRIVER_INIT_MEMBER(nbmj8891_state,gionbana) { - UINT8 *prot = memregion("protection")->base(); + uint8_t *prot = memregion("protection")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the @@ -69,7 +69,7 @@ DRIVER_INIT_MEMBER(nbmj8891_state,gionbana) DRIVER_INIT_MEMBER(nbmj8891_state,omotesnd) { #if 0 - UINT8 *prot = memregion("protection")->base(); + uint8_t *prot = memregion("protection")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the @@ -84,7 +84,7 @@ DRIVER_INIT_MEMBER(nbmj8891_state,omotesnd) #endif #if 1 - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // Protection ROM check skip ROM[0x0106] = 0x00; @@ -102,7 +102,7 @@ DRIVER_INIT_MEMBER(nbmj8891_state,omotesnd) DRIVER_INIT_MEMBER(nbmj8891_state,telmahjn) { - UINT8 *prot = memregion("protection")->base(); + uint8_t *prot = memregion("protection")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the @@ -118,7 +118,7 @@ DRIVER_INIT_MEMBER(nbmj8891_state,telmahjn) DRIVER_INIT_MEMBER(nbmj8891_state,mgmen89) { - UINT8 *prot = memregion("protection")->base(); + uint8_t *prot = memregion("protection")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the @@ -134,8 +134,8 @@ DRIVER_INIT_MEMBER(nbmj8891_state,mgmen89) DRIVER_INIT_MEMBER(nbmj8891_state,mjfocus) { - UINT8 *prot = memregion("protection")->base(); - UINT8 *ram = memregion("maincpu")->base() + 0xf800; + uint8_t *prot = memregion("protection")->base(); + uint8_t *ram = memregion("maincpu")->base() + 0xf800; int i; /* need to clear RAM otherwise it doesn't boot... */ @@ -155,7 +155,7 @@ DRIVER_INIT_MEMBER(nbmj8891_state,mjfocus) DRIVER_INIT_MEMBER(nbmj8891_state,mjfocusm) { #if 1 - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // Protection ROM check skip ROM[0x014e] = 0x00; @@ -166,7 +166,7 @@ DRIVER_INIT_MEMBER(nbmj8891_state,mjfocusm) DRIVER_INIT_MEMBER(nbmj8891_state,scandal) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; for (i = 0xf800; i < 0x10000; i++) ROM[i] = 0x00; @@ -176,7 +176,7 @@ DRIVER_INIT_MEMBER(nbmj8891_state,mjnanpas) { /* they forgot to enable the protection check in this game... */ #if 0 - UINT8 *prot = memregion("protection")->base(); + uint8_t *prot = memregion("protection")->base(); int i; memregion("maincpu")->base()[0x003d] = 0x01; // force the protection check to be executed @@ -195,7 +195,7 @@ DRIVER_INIT_MEMBER(nbmj8891_state,mjnanpas) DRIVER_INIT_MEMBER(nbmj8891_state,pairsnb) { - UINT8 *prot = memregion("protection")->base(); + uint8_t *prot = memregion("protection")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the @@ -211,7 +211,7 @@ DRIVER_INIT_MEMBER(nbmj8891_state,pairsnb) DRIVER_INIT_MEMBER(nbmj8891_state,pairsten) { - UINT8 *prot = memregion("protection")->base(); + uint8_t *prot = memregion("protection")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the diff --git a/src/mame/drivers/nbmj8900.cpp b/src/mame/drivers/nbmj8900.cpp index b35348273a7..29712b4136b 100644 --- a/src/mame/drivers/nbmj8900.cpp +++ b/src/mame/drivers/nbmj8900.cpp @@ -36,7 +36,7 @@ TODO: DRIVER_INIT_MEMBER(nbmj8900_state,ohpaipee) { #if 0 - UINT8 *prot = memregion("protdata")->base(); + uint8_t *prot = memregion("protdata")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the @@ -65,7 +65,7 @@ DRIVER_INIT_MEMBER(nbmj8900_state,ohpaipee) DRIVER_INIT_MEMBER(nbmj8900_state,togenkyo) { #if 0 - UINT8 *prot = memregion("protdata")->base(); + uint8_t *prot = memregion("protdata")->base(); int i; /* this is one possible way to rearrange the protection ROM data to get the diff --git a/src/mame/drivers/nbmj8991.cpp b/src/mame/drivers/nbmj8991.cpp index 9b8e578432f..52e561cee43 100644 --- a/src/mame/drivers/nbmj8991.cpp +++ b/src/mame/drivers/nbmj8991.cpp @@ -57,7 +57,7 @@ void nbmj8991_state::machine_reset() DRIVER_INIT_MEMBER(nbmj8991_state,finalbny) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; for (i = 0xf800; i < 0x10000; i++) ROM[i] = 0x00; @@ -66,7 +66,7 @@ DRIVER_INIT_MEMBER(nbmj8991_state,finalbny) DRIVER_INIT_MEMBER(nbmj8991_state,galkaika) { #if 1 - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // Patch to IM2 -> IM1 ROM[0x0002] = 0x56; @@ -76,7 +76,7 @@ DRIVER_INIT_MEMBER(nbmj8991_state,galkaika) DRIVER_INIT_MEMBER(nbmj8991_state,tokyogal) { #if 1 - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // Patch to IM2 -> IM1 ROM[0x0002] = 0x56; @@ -86,7 +86,7 @@ DRIVER_INIT_MEMBER(nbmj8991_state,tokyogal) DRIVER_INIT_MEMBER(nbmj8991_state,tokimbsj) { #if 1 - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // Patch to IM2 -> IM1 ROM[0x0002] = 0x56; diff --git a/src/mame/drivers/nbmj9195.cpp b/src/mame/drivers/nbmj9195.cpp index 46decf5721d..1c0d5a23835 100644 --- a/src/mame/drivers/nbmj9195.cpp +++ b/src/mame/drivers/nbmj9195.cpp @@ -223,7 +223,7 @@ void nbmj9195_state::machine_reset() DRIVER_INIT_MEMBER(nbmj9195_state,nbmj9195) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); // sound program patch ROM[0x0213] = 0x00; // DI -> NOP diff --git a/src/mame/drivers/nc.cpp b/src/mame/drivers/nc.cpp index 0f76cf72df1..301a49e5b9f 100644 --- a/src/mame/drivers/nc.cpp +++ b/src/mame/drivers/nc.cpp @@ -298,7 +298,7 @@ static const char *const nc_bankhandler_w[]={ void nc_state::nc_refresh_memory_bank_config(int bank) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *ptr; + uint8_t *ptr; int mem_type; int mem_bank; char bank1[10]; @@ -1204,7 +1204,7 @@ READ8_MEMBER(nc_state::nc200_card_battery_status_r) READ8_MEMBER(nc_state::nc200_printer_status_r) { - UINT8 result = 0; + uint8_t result = 0; result |= m_centronics_busy; diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp index 80a7b4fb6fc..515efc4c294 100644 --- a/src/mame/drivers/nemesis.cpp +++ b/src/mame/drivers/nemesis.cpp @@ -1415,9 +1415,9 @@ static const gfx_layout spritelayout168 = 4*16*8 }; -static const UINT32 spritelayout6464_xoffset[64] = { STEP64(0, 4) }; +static const uint32_t spritelayout6464_xoffset[64] = { STEP64(0, 4) }; -static const UINT32 spritelayout6464_yoffset[64] = { STEP64(0, 4*64) }; +static const uint32_t spritelayout6464_yoffset[64] = { STEP64(0, 4*64) }; static const gfx_layout spritelayout6464 = { diff --git a/src/mame/drivers/neogeo.cpp b/src/mame/drivers/neogeo.cpp index b990065dafb..488c5926942 100644 --- a/src/mame/drivers/neogeo.cpp +++ b/src/mame/drivers/neogeo.cpp @@ -494,28 +494,28 @@ void neogeo_state::adjust_display_position_interrupt_timer() { - attotime period = attotime::from_ticks((UINT64)m_display_counter + 1, NEOGEO_PIXEL_CLOCK); + attotime period = attotime::from_ticks((uint64_t)m_display_counter + 1, NEOGEO_PIXEL_CLOCK); if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer current y: %02x current x: %02x target y: %x target x: %x\n", m_screen->vpos(), m_screen->hpos(), (m_display_counter + 1) / NEOGEO_HTOTAL, (m_display_counter + 1) % NEOGEO_HTOTAL); m_display_position_interrupt_timer->adjust(period); } -void neogeo_state::set_display_position_interrupt_control(UINT16 data) +void neogeo_state::set_display_position_interrupt_control(uint16_t data) { m_display_position_interrupt_control = data; } -void neogeo_state::set_display_counter_msb(UINT16 data) +void neogeo_state::set_display_counter_msb(uint16_t data) { - m_display_counter = (m_display_counter & 0x0000ffff) | ((UINT32)data << 16); + m_display_counter = (m_display_counter & 0x0000ffff) | ((uint32_t)data << 16); if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", m_maincpu->pc(), m_display_counter); } -void neogeo_state::set_display_counter_lsb(UINT16 data) +void neogeo_state::set_display_counter_lsb(uint16_t data) { m_display_counter = (m_display_counter & 0xffff0000) | data; @@ -537,7 +537,7 @@ void neogeo_state::update_interrupts() } -void neogeo_state::acknowledge_interrupt(UINT16 data) +void neogeo_state::acknowledge_interrupt(uint16_t data) { if (data & 0x01) m_irq3_pending = 0; @@ -706,7 +706,7 @@ WRITE8_MEMBER(neogeo_state::io_control_w) READ16_MEMBER(neogeo_state::unmapped_r) { - UINT16 ret; + uint16_t ret; /* unmapped memory returns the last word on the data bus, which is almost always the opcode of the next instruction due to prefetch */ @@ -731,7 +731,7 @@ READ16_MEMBER(neogeo_state::unmapped_r) * *************************************/ -void neogeo_state::set_save_ram_unlock( UINT8 data ) +void neogeo_state::set_save_ram_unlock( uint8_t data ) { m_save_ram_unlocked = data; } @@ -763,7 +763,7 @@ READ16_MEMBER(neogeo_state::memcard_r) { m_maincpu->eat_cycles(2); // insert waitstate - UINT16 ret; + uint16_t ret; if (m_memcard->present() != -1) ret = m_memcard->read(space, offset) | 0xff00; @@ -805,7 +805,7 @@ WRITE8_MEMBER(neogeo_state::audio_command_w) READ8_MEMBER(neogeo_state::audio_command_r) { - UINT8 ret = m_soundlatch->read(space, 0); + uint8_t ret = m_soundlatch->read(space, 0); m_audio_cpu_nmi_pending = false; audio_cpu_check_nmi(); @@ -816,7 +816,7 @@ READ8_MEMBER(neogeo_state::audio_command_r) CUSTOM_INPUT_MEMBER(neogeo_state::get_audio_result) { - UINT8 ret = m_soundlatch2->read(m_audiocpu->space(AS_PROGRAM), 0); + uint8_t ret = m_soundlatch2->read(m_audiocpu->space(AS_PROGRAM), 0); return ret; } @@ -844,7 +844,7 @@ READ8_MEMBER(neogeo_state::audio_cpu_bank_select_r) WRITE8_MEMBER(neogeo_state::system_control_w) { - UINT8 bit = (offset >> 3) & 0x01; + uint8_t bit = (offset >> 3) & 0x01; switch (offset & 0x07) { @@ -891,7 +891,7 @@ WRITE8_MEMBER(neogeo_state::system_control_w) WRITE16_MEMBER(neogeo_state::write_banksel) { - UINT32 len = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_rom_size() == 0) ? m_region_maincpu->bytes() : m_slots[m_curr_slot]->get_rom_size(); + uint32_t len = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_rom_size() == 0) ? m_region_maincpu->bytes() : m_slots[m_curr_slot]->get_rom_size(); if ((len <= 0x100000) && (data & 0x07)) logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", space.device().safe_pc(), data); @@ -904,7 +904,7 @@ WRITE16_MEMBER(neogeo_state::write_banksel) logerror("PC %06x: warning: bankswitch to empty bank %02x\n", space.device().safe_pc(), data); bank = 0; } - UINT8 *ROM = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_rom_size() == 0) ? m_region_maincpu->base() : (UINT8 *)m_slots[m_curr_slot]->get_rom_base(); + uint8_t *ROM = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_rom_size() == 0) ? m_region_maincpu->base() : (uint8_t *)m_slots[m_curr_slot]->get_rom_base(); m_bank_base = (bank + 1) * 0x100000; m_bank_cartridge->set_base(ROM + m_bank_base); } @@ -919,7 +919,7 @@ WRITE16_MEMBER(neogeo_state::write_banksel) void neogeo_state::set_outputs( ) { - static const UINT8 led_map[0x10] = + static const uint8_t led_map[0x10] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x58,0x4c,0x62,0x69,0x78,0x00 }; /* EL */ @@ -935,11 +935,11 @@ void neogeo_state::set_outputs( ) } -void neogeo_state::set_output_latch( UINT8 data ) +void neogeo_state::set_output_latch( uint8_t data ) { /* looks like the LEDs are set on the falling edge */ - UINT8 falling_bits = m_output_latch & ~data; + uint8_t falling_bits = m_output_latch & ~data; if (falling_bits & 0x08) m_el_value = 16 - (m_output_data & 0x0f); @@ -959,7 +959,7 @@ void neogeo_state::set_output_latch( UINT8 data ) } -void neogeo_state::set_output_data( UINT8 data ) +void neogeo_state::set_output_data( uint8_t data ) { m_output_data = data; } @@ -979,7 +979,7 @@ void neogeo_state::set_output_data( UINT8 data ) WRITE16_MEMBER(neogeo_state::write_bankprot) { m_bank_base = m_slots[m_curr_slot]->get_bank_base(data); - m_bank_cartridge->set_base((UINT8 *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); + m_bank_cartridge->set_base((uint8_t *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); } WRITE16_MEMBER(neogeo_state::write_bankprot_pvc) @@ -991,7 +991,7 @@ WRITE16_MEMBER(neogeo_state::write_bankprot_pvc) if (offset >= 0xff8) { m_bank_base = m_slots[m_curr_slot]->get_bank_base(data); - m_bank_cartridge->set_base((UINT8 *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); + m_bank_cartridge->set_base((uint8_t *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); } } @@ -1004,7 +1004,7 @@ WRITE16_MEMBER(neogeo_state::write_bankprot_kf2k3bl) if (offset == 0x1ff0/2 || offset == 0x1ff2/2) { m_bank_base = m_slots[m_curr_slot]->get_bank_base(data); - m_bank_cartridge->set_base((UINT8 *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); + m_bank_cartridge->set_base((uint8_t *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); } } @@ -1015,12 +1015,12 @@ WRITE16_MEMBER(neogeo_state::write_bankprot_ms5p) if ((offset == 0) && (data == 0xa0)) { m_bank_base = 0xa0; - m_bank_cartridge->set_base((UINT8 *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); + m_bank_cartridge->set_base((uint8_t *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); } else if (offset == 2) { m_bank_base = m_slots[m_curr_slot]->get_bank_base(data); - m_bank_cartridge->set_base((UINT8 *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); + m_bank_cartridge->set_base((uint8_t *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); } } @@ -1032,13 +1032,13 @@ WRITE16_MEMBER(neogeo_state::write_bankprot_kof10th) { // Standard bankswitch m_bank_base = m_slots[m_curr_slot]->get_bank_base(data); - m_bank_cartridge->set_base((UINT8 *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); + m_bank_cartridge->set_base((uint8_t *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); } } READ16_MEMBER(neogeo_state::read_lorom_kof10th) { - UINT16* rom = (m_slots[m_curr_slot] && m_slots[m_curr_slot]->get_rom_size() > 0) ? m_slots[m_curr_slot]->get_rom_base() : (UINT16*)m_region_maincpu->base(); + uint16_t* rom = (m_slots[m_curr_slot] && m_slots[m_curr_slot]->get_rom_size() > 0) ? m_slots[m_curr_slot]->get_rom_base() : (uint16_t*)m_region_maincpu->base(); if (offset + 0x80/2 >= 0x10000/2) offset += m_slots[m_curr_slot]->get_special_bank(); return rom[offset + 0x80/2]; @@ -1052,8 +1052,8 @@ READ16_MEMBER(neogeo_state::read_lorom_kof10th) void neogeo_state::init_cpu() { - UINT8 *ROM = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_rom_size() == 0) ? m_region_maincpu->base() : (UINT8 *)m_slots[m_curr_slot]->get_rom_base(); - UINT32 len = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_rom_size() == 0) ? m_region_maincpu->bytes() : m_slots[m_curr_slot]->get_rom_size(); + uint8_t *ROM = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_rom_size() == 0) ? m_region_maincpu->base() : (uint8_t *)m_slots[m_curr_slot]->get_rom_base(); + uint32_t len = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_rom_size() == 0) ? m_region_maincpu->bytes() : m_slots[m_curr_slot]->get_rom_size(); if (len > 0x100000) m_bank_base = 0x100000; @@ -1065,9 +1065,9 @@ void neogeo_state::init_cpu() void neogeo_state::init_audio() { - UINT8 *ROM = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_audio_size() == 0) ? m_region_audiocpu->base() : m_slots[m_curr_slot]->get_audio_base(); - UINT32 len = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_audio_size() == 0) ? m_region_audiocpu->bytes() : m_slots[m_curr_slot]->get_audio_size(); - UINT32 address_mask; + uint8_t *ROM = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_audio_size() == 0) ? m_region_audiocpu->base() : m_slots[m_curr_slot]->get_audio_base(); + uint32_t len = (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_audio_size() == 0) ? m_region_audiocpu->bytes() : m_slots[m_curr_slot]->get_audio_size(); + uint32_t address_mask; /* audio bios/cartridge selection */ m_bank_audio_main->configure_entry(0, (m_region_audiobios != nullptr) ? m_region_audiobios->base() : ROM); /* on hardware with no SM1 ROM, the cart ROM is always enabled */ @@ -1085,7 +1085,7 @@ void neogeo_state::init_audio() { for (int bank = 0xff; bank >= 0; bank--) { - UINT32 bank_address = 0x10000 + ((bank << (11 + region)) & address_mask); + uint32_t bank_address = 0x10000 + ((bank << (11 + region)) & address_mask); m_bank_audio_cart[region]->configure_entry(bank, &ROM[bank_address]); } } @@ -1105,8 +1105,8 @@ void neogeo_state::init_audio() void neogeo_state::init_ym() { - UINT8 *ROM; - UINT32 len; + uint8_t *ROM; + uint32_t len; // Resetting a sound device causes the core to update() it and generate samples if it's not up to date. // Thus we preemptively reset it here while the old pointers are still valid so it's up to date and @@ -1174,9 +1174,9 @@ void neogeo_state::set_slot_idx(int slot) space.unmap_readwrite(0x000080, 0x0fffff); space.unmap_readwrite(0x200000, 0x2fffff); if (!m_slots[m_curr_slot] || m_slots[m_curr_slot]->get_rom_size() == 0) - space.install_rom(0x000080, 0x0fffff, (UINT16 *)m_region_maincpu->base() + 0x80/2); + space.install_rom(0x000080, 0x0fffff, (uint16_t *)m_region_maincpu->base() + 0x80/2); else - space.install_rom(0x000080, 0x0fffff, (UINT16 *)m_slots[m_curr_slot]->get_rom_base() + 0x80/2); + space.install_rom(0x000080, 0x0fffff, (uint16_t *)m_slots[m_curr_slot]->get_rom_base() + 0x80/2); space.install_read_bank(0x200000, 0x2fffff, "cartridge"); @@ -1379,7 +1379,7 @@ void neogeo_state::neogeo_postload() set_outputs(); if (m_type == NEOGEO_MVS || m_type == NEOGEO_AES) if (m_slots[m_curr_slot] && m_slots[m_curr_slot]->get_rom_size() > 0) - m_bank_cartridge->set_base((UINT8 *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); + m_bank_cartridge->set_base((uint8_t *)m_slots[m_curr_slot]->get_rom_base() + m_bank_base); } @@ -1426,12 +1426,12 @@ READ16_MEMBER(neogeo_state::banked_vectors_r) { if (!m_use_cart_vectors) { - UINT16* bios = (UINT16*)m_region_mainbios->base(); + uint16_t* bios = (uint16_t*)m_region_mainbios->base(); return bios[offset]; } else { - UINT16* rom = (m_slots[m_curr_slot] && m_slots[m_curr_slot]->get_rom_size() > 0) ? m_slots[m_curr_slot]->get_rom_base() : (UINT16*)m_region_maincpu->base(); + uint16_t* rom = (m_slots[m_curr_slot] && m_slots[m_curr_slot]->get_rom_size() > 0) ? m_slots[m_curr_slot]->get_rom_base() : (uint16_t*)m_region_maincpu->base(); return rom[offset]; } } @@ -1473,7 +1473,7 @@ ADDRESS_MAP_END READ16_MEMBER(aes_state::aes_in2_r) { - UINT32 ret = m_io_in2->read(); + uint32_t ret = m_io_in2->read(); ret = (ret & 0xfcff) | (m_ctrl1->read_start_sel() << 8); ret = (ret & 0xf3ff) | (m_ctrl2->read_start_sel() << 10); return ret; diff --git a/src/mame/drivers/neogeocd.cpp b/src/mame/drivers/neogeocd.cpp index db502f42ef2..60da15ab052 100644 --- a/src/mame/drivers/neogeocd.cpp +++ b/src/mame/drivers/neogeocd.cpp @@ -34,11 +34,11 @@ /* Stubs for various functions called by the FBA code, replace with MAME specifics later */ -UINT8 *NeoSpriteRAM, *NeoTextRAM; -//UINT8* NeoSpriteROM; -//UINT8* NeoTextROM; -UINT8* YM2610ADPCMAROM; -UINT8* NeoZ80ROMActive; +uint8_t *NeoSpriteRAM, *NeoTextRAM; +//uint8_t* NeoSpriteROM; +//uint8_t* NeoTextROM; +uint8_t* YM2610ADPCMAROM; +uint8_t* NeoZ80ROMActive; // was it actually released in eu / asia? #define NEOCD_REGION_ASIA 3 // IronClad runs with a darkened screen (MVS has the same issue) @@ -47,7 +47,7 @@ UINT8* NeoZ80ROMActive; #define NEOCD_REGION_JAPAN 0 -UINT8 NeoSystem = NEOCD_REGION_JAPAN; +uint8_t NeoSystem = NEOCD_REGION_JAPAN; class ngcd_state : public aes_state @@ -76,7 +76,7 @@ public: void NeoCDDoDMA(address_space& curr_space); - void set_DMA_regs(int offset, UINT16 wordValue); + void set_DMA_regs(int offset, uint16_t wordValue); DECLARE_READ16_MEMBER(neocd_memcard_r); DECLARE_WRITE16_MEMBER(neocd_memcard_w); @@ -92,16 +92,16 @@ public: // neoCD - INT32 nActiveTransferArea; - INT32 nSpriteTransferBank; - INT32 nADPCMTransferBank; - INT32 NeoCDDMAAddress1; - INT32 NeoCDDMAAddress2; - INT32 NeoCDDMAValue1; - INT32 NeoCDDMAValue2; - INT32 NeoCDDMACount; - INT32 NeoCDDMAMode; - INT32 nIRQAcknowledge; + int32_t nActiveTransferArea; + int32_t nSpriteTransferBank; + int32_t nADPCMTransferBank; + int32_t NeoCDDMAAddress1; + int32_t NeoCDDMAAddress2; + int32_t NeoCDDMAValue1; + int32_t NeoCDDMAValue2; + int32_t NeoCDDMACount; + int32_t NeoCDDMAMode; + int32_t nIRQAcknowledge; int nNeoCDIRQVectorAck; int nNeoCDIRQVector; @@ -113,28 +113,28 @@ public: int get_nNeoCDIRQVectorAck(void) { return nNeoCDIRQVectorAck; } void set_nNeoCDIRQVectorAck(int val) { nNeoCDIRQVectorAck = val; } int get_nNeoCDIRQVector(void) { return nNeoCDIRQVector; } - void NeoCDIRQUpdate(UINT8 byteValue); + void NeoCDIRQUpdate(uint8_t byteValue); // from the CDC void interrupt_callback_type1(void); void interrupt_callback_type2(void); void interrupt_callback_type3(void); - UINT8 nTransferWriteEnable; + uint8_t nTransferWriteEnable; bool prohibit_cdc_irq; // hack? - UINT32 screen_update_neocd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_neocd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_DRIVER_INIT(neocdz); DECLARE_DRIVER_INIT(neocdzj); IRQ_CALLBACK_MEMBER(neocd_int_callback); - std::unique_ptr m_meminternal_data; + std::unique_ptr m_meminternal_data; protected: - INT32 SekIdle(INT32 nCycles); + int32_t SekIdle(int32_t nCycles); }; @@ -172,7 +172,7 @@ WRITE16_MEMBER(ngcd_state::neocd_memcard_w) READ16_MEMBER(ngcd_state::neocd_control_r) { - UINT32 sekAddress = 0xff0000+ (offset*2); + uint32_t sekAddress = 0xff0000+ (offset*2); switch (sekAddress & 0xFFFF) { case 0x0016: @@ -201,8 +201,8 @@ READ16_MEMBER(ngcd_state::neocd_control_r) WRITE16_MEMBER(ngcd_state::neocd_control_w) { - UINT32 sekAddress = 0xff0000+ (offset*2); - UINT16 wordValue = data; + uint32_t sekAddress = 0xff0000+ (offset*2); + uint16_t wordValue = data; // bprintf(PRINT_NORMAL, _T(" - NGCD port 0x%06X -> 0x%04X (PC: 0x%06X)\n"), sekAddress, wordValue, SekGetPC(-1)); int byteValue = wordValue & 0xff; @@ -331,7 +331,7 @@ WRITE16_MEMBER(ngcd_state::neocd_control_w) m_use_cart_vectors = (data == 0 ? 0 : 1); } -//extern INT32 bRunPause; +//extern int32_t bRunPause; //bRunPause = 1; break; @@ -400,7 +400,7 @@ WRITE16_MEMBER(ngcd_state::neocd_control_w) READ8_MEMBER(ngcd_state::neocd_transfer_r) { - UINT32 sekAddress = 0xe00000+ (offset); + uint32_t sekAddress = 0xe00000+ (offset); int address; sekAddress ^= 1; @@ -430,8 +430,8 @@ READ8_MEMBER(ngcd_state::neocd_transfer_r) WRITE8_MEMBER(ngcd_state::neocd_transfer_w) { - UINT8 byteValue = data; - UINT32 sekAddress = 0xe00000+ (offset); + uint8_t byteValue = data; + uint32_t sekAddress = 0xe00000+ (offset); if (!nTransferWriteEnable) { // return; @@ -479,7 +479,7 @@ WRITE8_MEMBER(ngcd_state::neocd_transfer_w) -void ngcd_state::set_DMA_regs(int offset, UINT16 wordValue) +void ngcd_state::set_DMA_regs(int offset, uint16_t wordValue) { switch (offset) { @@ -524,7 +524,7 @@ void ngcd_state::set_DMA_regs(int offset, UINT16 wordValue) -INT32 ngcd_state::SekIdle(INT32 nCycles) +int32_t ngcd_state::SekIdle(int32_t nCycles) { return nCycles; } @@ -709,7 +709,7 @@ void ngcd_state::NeoCDDoDMA(address_space& curr_space) if (NeoCDDMAAddress2 == 0x0800) { // MapVectorTable(false); // bprintf(PRINT_ERROR, _T(" RAM vectors mapped (PC = 0x%08X\n"), SekGetPC(0)); -// extern INT32 bRunPause; +// extern int32_t bRunPause; // bRunPause = 1; } break; @@ -809,7 +809,7 @@ if (NeoCDDMAAddress2 == 0x0800) { //bprintf(PRINT_ERROR, _T(" Unknown transfer type 0x%04X (PC: 0x%06X)\n"), NeoCDDMAMode, SekGetPC(-1)); //bprintf(PRINT_NORMAL, _T(" ??? : 0x%08X 0x%08X 0x%04X 0x%04X 0x%08X\n"), NeoCDDMAAddress1, NeoCDDMAAddress2, NeoCDDMAValue1, NeoCDDMAValue2, NeoCDDMACount); -//extern INT32 bRunPause; +//extern int32_t bRunPause; //bRunPause = 1; } @@ -844,7 +844,7 @@ MACHINE_START_MEMBER(ngcd_state,neocd) // initialize the memcard data structure // NeoCD doesn't have memcard slots, rather, it has a larger internal memory which works the same - m_meminternal_data = make_unique_clear(0x2000); + m_meminternal_data = make_unique_clear(0x2000); machine().device("saveram")->set_base(m_meminternal_data.get(), 0x2000); save_pointer(NAME(m_meminternal_data.get()), 0x2000); @@ -993,7 +993,7 @@ void ngcd_state::interrupt_callback_type3(void) } -void ngcd_state::NeoCDIRQUpdate(UINT8 byteValue) +void ngcd_state::NeoCDIRQUpdate(uint8_t byteValue) { // do we also need to check the regular interrupts like FBA? @@ -1023,7 +1023,7 @@ void ngcd_state::NeoCDIRQUpdate(UINT8 byteValue) } -UINT32 ngcd_state::screen_update_neocd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t ngcd_state::screen_update_neocd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // fill with background color first bitmap.fill(*m_bg_pen, cliprect); diff --git a/src/mame/drivers/neopcb.cpp b/src/mame/drivers/neopcb.cpp index 199b2fab29f..9b6864ceb02 100644 --- a/src/mame/drivers/neopcb.cpp +++ b/src/mame/drivers/neopcb.cpp @@ -239,17 +239,17 @@ ROM_END /* ms5pcb and svcpcb have an additional scramble on top of the standard CMC scrambling */ void neopcb_state::svcpcb_gfx_decrypt() { - static const UINT8 xorval[4] = { 0x34, 0x21, 0xc4, 0xe9 }; + static const uint8_t xorval[4] = { 0x34, 0x21, 0xc4, 0xe9 }; int rom_size = memregion("sprites")->bytes(); - UINT8 *rom = memregion("sprites")->base(); - std::vector buf(rom_size); + uint8_t *rom = memregion("sprites")->base(); + std::vector buf(rom_size); for (int i = 0; i < rom_size; i++) rom[i] ^= xorval[(i % 4)]; for (int i = 0; i < rom_size; i += 4) { - UINT32 rom32 = rom[i] | rom[i+1]<<8 | rom[i+2]<<16 | rom[i+3]<<24; + uint32_t rom32 = rom[i] | rom[i+1]<<8 | rom[i+2]<<16 | rom[i+3]<<24; rom32 = BITSWAP32(rom32, 0x09, 0x0d, 0x13, 0x00, 0x17, 0x0f, 0x03, 0x05, 0x04, 0x0c, 0x11, 0x1e, 0x12, 0x15, 0x0b, 0x06, 0x1b, 0x0a, 0x1a, 0x1c, 0x14, 0x02, 0x0e, 0x1d, 0x18, 0x08, 0x01, 0x10, 0x19, 0x1f, 0x07, 0x16); buf[i] = rom32 & 0xff; buf[i+1] = (rom32>>8) & 0xff; @@ -270,7 +270,7 @@ void neopcb_state::svcpcb_gfx_decrypt() /* and a further swap on the s1 data */ void neopcb_state::svcpcb_s1data_decrypt() { - UINT8 *s1 = memregion("fixed")->base(); + uint8_t *s1 = memregion("fixed")->base(); size_t s1_size = memregion("fixed")->bytes(); for (int i = 0; i < s1_size; i++) // Decrypt S @@ -283,17 +283,17 @@ void neopcb_state::svcpcb_s1data_decrypt() /* Thanks to Razoola & Halrin for the info */ void neopcb_state::kf2k3pcb_gfx_decrypt() { - static const UINT8 xorval[4] = { 0x34, 0x21, 0xc4, 0xe9 }; + static const uint8_t xorval[4] = { 0x34, 0x21, 0xc4, 0xe9 }; int rom_size = memregion("sprites")->bytes(); - UINT8 *rom = memregion("sprites")->base(); - std::vector buf(rom_size); + uint8_t *rom = memregion("sprites")->base(); + std::vector buf(rom_size); for (int i = 0; i < rom_size; i++) rom[ i ] ^= xorval[ (i % 4) ]; for (int i = 0; i < rom_size; i +=4) { - UINT32 rom32 = rom[i] | rom[i+1]<<8 | rom[i+2]<<16 | rom[i+3]<<24; + uint32_t rom32 = rom[i] | rom[i+1]<<8 | rom[i+2]<<16 | rom[i+3]<<24; rom32 = BITSWAP32(rom32, 0x09, 0x0d, 0x13, 0x00, 0x17, 0x0f, 0x03, 0x05, 0x04, 0x0c, 0x11, 0x1e, 0x12, 0x15, 0x0b, 0x06, 0x1b, 0x0a, 0x1a, 0x1c, 0x14, 0x02, 0x0e, 0x1d, 0x18, 0x08, 0x01, 0x10, 0x19, 0x1f, 0x07, 0x16); buf[i] = rom32 & 0xff; buf[i+1] = (rom32>>8) & 0xff; @@ -314,8 +314,8 @@ void neopcb_state::kf2k3pcb_gfx_decrypt() /* and a further swap on the s1 data */ void neopcb_state::kf2k3pcb_decrypt_s1data() { - UINT8 *src; - UINT8 *dst; + uint8_t *src; + uint8_t *dst; int tx_size = memregion("fixed")->bytes(); int srom_size = memregion("sprites")->bytes(); src = memregion("sprites")->base() + srom_size - 0x1000000 - 0x80000; // Decrypt S @@ -340,7 +340,7 @@ void neopcb_state::kf2k3pcb_decrypt_s1data() /* only found on kf2k3pcb */ void neopcb_state::kf2k3pcb_sp1_decrypt() { - static const UINT8 address[0x40] = { + static const uint8_t address[0x40] = { 0x04,0x0a,0x04,0x0a,0x04,0x0a,0x04,0x0a, 0x0a,0x04,0x0a,0x04,0x0a,0x04,0x0a,0x04, 0x09,0x07,0x09,0x07,0x09,0x07,0x09,0x07, @@ -351,8 +351,8 @@ void neopcb_state::kf2k3pcb_sp1_decrypt() 0x04,0x00,0x04,0x00,0x0e,0x0a,0x0e,0x0a }; - UINT16 *rom = (UINT16 *)memregion("mainbios")->base(); - std::vector buf(0x80000/2); + uint16_t *rom = (uint16_t *)memregion("mainbios")->base(); + std::vector buf(0x80000/2); for (int i = 0; i < 0x80000/2; i++) { @@ -418,7 +418,7 @@ WRITE16_MEMBER(neopcb_state::write_bankpvc) void neopcb_state::install_common() { // install memory bank - m_maincpu->space(AS_PROGRAM).install_rom(0x000080, 0x0fffff, (UINT16 *)m_region_maincpu->base() + 0x80/2); + m_maincpu->space(AS_PROGRAM).install_rom(0x000080, 0x0fffff, (uint16_t *)m_region_maincpu->base() + 0x80/2); m_maincpu->space(AS_PROGRAM).install_read_bank(0x200000, 0x2fffff, "cpu_bank"); membank("cpu_bank")->set_base(m_region_maincpu->base() + 0x100000); @@ -496,7 +496,7 @@ DRIVER_INIT_MEMBER(neopcb_state, kf2k3pcb) // extra little swap on the m1 - this must be performed AFTER the m1 decrypt // or the m1 checksum (used to generate the key) for decrypting the m1 is // incorrect - UINT8* rom = memregion("audiocpu")->base(); + uint8_t* rom = memregion("audiocpu")->base(); for (int i = 0; i < 0x90000; i++) rom[i] = BITSWAP8(rom[i], 5, 6, 1, 4, 3, 0, 7, 2); diff --git a/src/mame/drivers/neoprint.cpp b/src/mame/drivers/neoprint.cpp index 9078f3e1d51..d26bb9a2ba2 100644 --- a/src/mame/drivers/neoprint.cpp +++ b/src/mame/drivers/neoprint.cpp @@ -45,8 +45,8 @@ public: m_soundlatch(*this, "soundlatch"), m_generic_paletteram_16(*this, "paletteram") { } - required_shared_ptr m_npvidram; - required_shared_ptr m_npvidregs; + required_shared_ptr m_npvidram; + required_shared_ptr m_npvidregs; required_device m_maincpu; required_device m_audiocpu; required_device m_upd4990a; @@ -54,11 +54,11 @@ public: required_device m_screen; required_device m_palette; required_device m_soundlatch; - optional_shared_ptr m_generic_paletteram_16; + optional_shared_ptr m_generic_paletteram_16; - UINT8 m_audio_result; - UINT8 m_bank_val; - UINT8 m_vblank; + uint8_t m_audio_result; + uint8_t m_bank_val; + uint8_t m_vblank; DECLARE_READ8_MEMBER(neoprint_calendar_r); DECLARE_WRITE8_MEMBER(neoprint_calendar_w); DECLARE_READ8_MEMBER(neoprint_unk_r); @@ -77,8 +77,8 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_MACHINE_RESET(nprsp); - UINT32 screen_update_neoprint(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_nprsp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_neoprint(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nprsp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_layer(bitmap_ind16 &bitmap,const rectangle &cliprect,int layer,int data_shift); void audio_cpu_assert_nmi(); }; @@ -101,7 +101,7 @@ void neoprint_state::draw_layer(bitmap_ind16 &bitmap,const rectangle &cliprect,i { int i, y, x; gfx_element *gfx = m_gfxdecode->gfx(0); - INT16 scrollx, scrolly; + int16_t scrollx, scrolly; i = (m_npvidregs[((layer*8)+0x06)/2] & 7) * 0x1000/4; scrollx = ((m_npvidregs[((layer*8)+0x00)/2] - (0xd8 + layer*4)) & 0x03ff); @@ -114,14 +114,14 @@ void neoprint_state::draw_layer(bitmap_ind16 &bitmap,const rectangle &cliprect,i { for (x=0;x<32;x++) { - UINT16 dat = m_npvidram[i*2] >> data_shift; // a video register? - UINT16 color; + uint16_t dat = m_npvidram[i*2] >> data_shift; // a video register? + uint16_t color; if(m_npvidram[i*2+1] & 0x0020) // TODO: 8bpp switch? color = ((m_npvidram[i*2+1] & 0x8000) << 1) | 0x200 | ((m_npvidram[i*2+1] & 0xff00) >> 7); else color = ((m_npvidram[i*2+1] & 0xff00) >> 8) | ((m_npvidram[i*2+1] & 0x0010) << 4); - UINT8 fx = (m_npvidram[i*2+1] & 0x0040); - UINT8 fy = (m_npvidram[i*2+1] & 0x0080); + uint8_t fx = (m_npvidram[i*2+1] & 0x0040); + uint8_t fy = (m_npvidram[i*2+1] & 0x0080); gfx->transpen(bitmap,cliprect,dat,color,fx,fy,x*16+scrollx,y*16-scrolly,0); gfx->transpen(bitmap,cliprect,dat,color,fx,fy,x*16+scrollx-512,y*16-scrolly,0); @@ -134,7 +134,7 @@ void neoprint_state::draw_layer(bitmap_ind16 &bitmap,const rectangle &cliprect,i } } -UINT32 neoprint_state::screen_update_neoprint(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t neoprint_state::screen_update_neoprint(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); @@ -144,7 +144,7 @@ UINT32 neoprint_state::screen_update_neoprint(screen_device &screen, bitmap_ind1 return 0; } -UINT32 neoprint_state::screen_update_nprsp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t neoprint_state::screen_update_nprsp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); @@ -213,7 +213,7 @@ WRITE8_MEMBER(neoprint_state::audio_command_w) READ8_MEMBER(neoprint_state::audio_command_r) { - UINT8 ret = m_soundlatch->read(space, 0); + uint8_t ret = m_soundlatch->read(space, 0); //if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", space.device().safe_pc(), ret); @@ -255,7 +255,7 @@ ADDRESS_MAP_END WRITE16_MEMBER(neoprint_state::nprsp_palette_w) { - UINT8 r,g,b,i; + uint8_t r,g,b,i; COMBINE_DATA(&m_generic_paletteram_16[offset]); @@ -272,7 +272,7 @@ WRITE16_MEMBER(neoprint_state::nprsp_palette_w) return; { - UINT32 pal_entry; + uint32_t pal_entry; pal_entry = ((offset & 0xfffe) >> 1) + ((offset & 0x20000) ? 0x8000 : 0); @@ -295,7 +295,7 @@ WRITE8_MEMBER(neoprint_state::nprsp_bank_w) READ16_MEMBER(neoprint_state::rom_window_r) { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); return rom[offset | 0x80000/2 | m_bank_val*0x40000/2]; } @@ -637,7 +637,7 @@ ROM_END /* FIXME: get rid of these two, probably something to do with irq3 and camera / printer devices */ DRIVER_INIT_MEMBER(neoprint_state,npcartv1) { - UINT16 *ROM = (UINT16 *)memregion( "maincpu" )->base(); + uint16_t *ROM = (uint16_t *)memregion( "maincpu" )->base(); ROM[0x1260/2] = 0x4e71; @@ -647,14 +647,14 @@ DRIVER_INIT_MEMBER(neoprint_state,npcartv1) DRIVER_INIT_MEMBER(neoprint_state,98best44) { - UINT16 *ROM = (UINT16 *)memregion( "maincpu" )->base(); + uint16_t *ROM = (uint16_t *)memregion( "maincpu" )->base(); ROM[0x1312/2] = 0x4e71; } DRIVER_INIT_MEMBER(neoprint_state,nprsp) { - UINT16 *ROM = (UINT16 *)memregion( "maincpu" )->base(); + uint16_t *ROM = (uint16_t *)memregion( "maincpu" )->base(); ROM[0x13a4/2] = 0x4e71; ROM[0x13bc/2] = 0x4e71; @@ -666,7 +666,7 @@ DRIVER_INIT_MEMBER(neoprint_state,nprsp) DRIVER_INIT_MEMBER(neoprint_state,unkneo) { - UINT16 *ROM = (UINT16 *)memregion( "maincpu" )->base(); + uint16_t *ROM = (uint16_t *)memregion( "maincpu" )->base(); ROM[0x12c2/2] = 0x4e71; } diff --git a/src/mame/drivers/neptunp2.cpp b/src/mame/drivers/neptunp2.cpp index f5b3b4c05f0..2567188da10 100644 --- a/src/mame/drivers/neptunp2.cpp +++ b/src/mame/drivers/neptunp2.cpp @@ -23,7 +23,7 @@ public: DECLARE_READ8_MEMBER(test_r); - 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: @@ -39,7 +39,7 @@ void neptunp2_state::video_start() { } -UINT32 neptunp2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t neptunp2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/nes.cpp b/src/mame/drivers/nes.cpp index 983736f4611..14a7fdcc098 100644 --- a/src/mame/drivers/nes.cpp +++ b/src/mame/drivers/nes.cpp @@ -181,7 +181,7 @@ void nes_state::setup_disk(nes_disksys_device *slot) MACHINE_START_MEMBER( nes_state, fds ) { - m_ciram = std::make_unique(0x800); + m_ciram = std::make_unique(0x800); m_io_disksel = ioport("FLIPDISK"); setup_disk(m_disk); diff --git a/src/mame/drivers/newbrain.cpp b/src/mame/drivers/newbrain.cpp index 5dd4764501b..e1a775cb407 100644 --- a/src/mame/drivers/newbrain.cpp +++ b/src/mame/drivers/newbrain.cpp @@ -89,7 +89,7 @@ READ8_MEMBER( newbrain_state::mreq_r ) { bool romov = 1, raminh = 0; int exrm = 0; - UINT8 data = m_exp->mreq_r(space, offset, 0xff, romov, exrm, raminh); + uint8_t data = m_exp->mreq_r(space, offset, 0xff, romov, exrm, raminh); int rom0 = 1, rom1 = 1, rom2 = 1; int a15_14_13 = romov ? (offset >> 13) : exrm; @@ -155,7 +155,7 @@ WRITE8_MEMBER( newbrain_state::mreq_w ) READ8_MEMBER( newbrain_state::iorq_r ) { bool prtov = 0; - UINT8 data = m_exp->iorq_r(space, offset, 0xff, prtov); + uint8_t data = m_exp->iorq_r(space, offset, 0xff, prtov); if (!prtov) { @@ -305,7 +305,7 @@ READ8_MEMBER( newbrain_state::ust_a_r ) */ - UINT8 data = 0x5d; + uint8_t data = 0x5d; // powered up data |= m_pwrup << 1; @@ -339,7 +339,7 @@ READ8_MEMBER( newbrain_state::ust_b_r ) */ - UINT8 data = 0x5c; + uint8_t data = 0x5c; // V24 data |= m_rs232_v24->rxd_r(); @@ -372,7 +372,7 @@ READ8_MEMBER( newbrain_state::cop_in_r ) */ - UINT8 data = 0xe; + uint8_t data = 0xe; // keyboard data |= BIT(m_keydata, 2); @@ -400,7 +400,7 @@ READ8_MEMBER( newbrain_state::cop_g_r ) */ - UINT8 data = 0x1; + uint8_t data = 0x1; // keyboard data |= BIT(m_keydata, 1) << 1; diff --git a/src/mame/drivers/next.cpp b/src/mame/drivers/next.cpp index 96bc17eca26..7fff206f5c8 100644 --- a/src/mame/drivers/next.cpp +++ b/src/mame/drivers/next.cpp @@ -32,7 +32,7 @@ #include "machine/nscsi_hd.h" #include "softlist.h" -UINT32 next_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t next_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // We don't handle partial updates, but we don't generate them either :-) if(cliprect.min_x || cliprect.min_y || cliprect.max_x+1 != screen_sx || cliprect.max_y+1 != screen_sy) @@ -43,29 +43,29 @@ UINT32 next_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, co // 1120x832 (8) // 832x624 (5c,9c) if(screen_color) { - const UINT32 *vr = vram; + const uint32_t *vr = vram; for(int y=0; y(bitmap.raw_pixptr(y)); + uint32_t *pix = reinterpret_cast(bitmap.raw_pixptr(y)); for(int x=0; x> (16-(xi*16))) & 0xffff; - UINT32 r = (pen & 0xf000) >> 12; - UINT32 g = (pen & 0x0f00) >> 8; - UINT32 b = (pen & 0x00f0) >> 4; - UINT32 col = (r << 20) | (r << 16) | (g << 12) | (g << 8) | (b << 4) | b; + uint16_t pen = (v >> (16-(xi*16))) & 0xffff; + uint32_t r = (pen & 0xf000) >> 12; + uint32_t g = (pen & 0x0f00) >> 8; + uint32_t b = (pen & 0x00f0) >> 4; + uint32_t col = (r << 20) | (r << 16) | (g << 12) | (g << 8) | (b << 4) | b; *pix++ = col; } } vr += screen_skip; } } else { - static UINT32 colors[4] = { 0xffffff, 0xaaaaaa, 0x555555, 0x000000 }; - const UINT32 *vr = vram; + static uint32_t colors[4] = { 0xffffff, 0xaaaaaa, 0x555555, 0x000000 }; + const uint32_t *vr = vram; for(int y=0; y(bitmap.raw_pixptr(y)); + uint32_t *pix = reinterpret_cast(bitmap.raw_pixptr(y)); for(int x=0; x> (30-(xi*2))) & 0x3]; } @@ -132,7 +132,7 @@ READ32_MEMBER( next_state::scr2_r ) */ - UINT32 data = scr2 & 0xfffffbff; + uint32_t data = scr2 & 0xfffffbff; data |= rtc->sdo_r() << 10; @@ -219,8 +219,8 @@ READ32_MEMBER( next_state::scr1_r ) void next_state::irq_set(int id, bool raise) { - UINT32 mask = 1U << id; - UINT32 old_status = irq_status; + uint32_t mask = 1U << id; + uint32_t old_status = irq_status; if(raise) irq_status |= mask; else @@ -248,7 +248,7 @@ WRITE32_MEMBER( next_state::irq_mask_w ) void next_state::irq_check() { - UINT32 act = irq_status & (irq_mask | 0x80000000); + uint32_t act = irq_status & (irq_mask | 0x80000000); int bit; for(bit=31; bit >= 0 && !(act & (1U << bit)); bit--); @@ -309,7 +309,7 @@ void next_state::dma_drq_w(int slot, bool state) if(ds.state & DMA_READ) { while(ds.drq) { dma_check_update(slot); - UINT8 val; + uint8_t val; bool eof; bool err; dma_read(slot, val, eof, err); @@ -326,7 +326,7 @@ void next_state::dma_drq_w(int slot, bool state) } else { while(ds.drq) { dma_check_update(slot); - UINT8 val = space.read_byte(ds.current++); + uint8_t val = space.read_byte(ds.current++); bool eof = ds.current == (ds.limit & 0x7fffffff) && (ds.limit & 0x80000000); bool err; dma_write(slot, val, eof, err); @@ -343,7 +343,7 @@ void next_state::dma_drq_w(int slot, bool state) } } -void next_state::dma_read(int slot, UINT8 &val, bool &eof, bool &err) +void next_state::dma_read(int slot, uint8_t &val, bool &eof, bool &err) { err = false; eof = false; @@ -375,7 +375,7 @@ void next_state::dma_read(int slot, UINT8 &val, bool &eof, bool &err) } } -void next_state::dma_write(int slot, UINT8 data, bool eof, bool &err) +void next_state::dma_write(int slot, uint8_t data, bool eof, bool &err) { err = false; switch(slot) { @@ -452,7 +452,7 @@ READ32_MEMBER( next_state::dma_regs_r) int slot = offset >> 2; int reg = offset & 3; - UINT32 res; + uint32_t res; switch(reg) { case 0: @@ -527,7 +527,7 @@ WRITE32_MEMBER( next_state::dma_ctrl_w) } } -void next_state::dma_do_ctrl_w(int slot, UINT8 data) +void next_state::dma_do_ctrl_w(int slot, uint8_t data) { const char *name = dma_name(slot); #if 0 @@ -574,7 +574,7 @@ const int next_state::scsi_clocks[4] = { 10000000, 12000000, 20000000, 16000000 READ32_MEMBER( next_state::scsictrl_r ) { - UINT32 res = (scsictrl << 24) | (scsistat << 16); + uint32_t res = (scsictrl << 24) | (scsistat << 16); logerror("scsictrl_read %08x @ %08x (%08x)\n", res, mem_mask, space.device().safe_pc()); return res; } @@ -640,7 +640,7 @@ READ32_MEMBER( next_state::fdc_control_r ) if(fdc) { floppy_image_device *fdev = machine().device(":fdc:0")->get_device(); if(fdev->exists()) { - UINT32 variant = fdev->get_variant(); + uint32_t variant = fdev->get_variant(); switch(variant) { case floppy_image::SSSD: case floppy_image::SSDD: @@ -835,7 +835,7 @@ WRITE8_MEMBER(next_state::ramdac_w) } } -void next_state::setup(UINT32 _scr1, int size_x, int size_y, int skip, bool color) +void next_state::setup(uint32_t _scr1, int size_x, int size_y, int skip, bool color) { scr1 = _scr1; screen_sx = size_x; diff --git a/src/mame/drivers/nexus3d.cpp b/src/mame/drivers/nexus3d.cpp index 60a0446704d..53b4385462e 100644 --- a/src/mame/drivers/nexus3d.cpp +++ b/src/mame/drivers/nexus3d.cpp @@ -32,7 +32,7 @@ public: m_serflash(*this, "flash") { } - required_shared_ptr m_mainram; + required_shared_ptr m_mainram; required_device m_maincpu; required_device m_serflash; @@ -45,7 +45,7 @@ public: DECLARE_DRIVER_INIT(nexus3d); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_nexus3d(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nexus3d(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -108,7 +108,7 @@ void nexus3d_state::video_start() { } -UINT32 nexus3d_state::screen_update_nexus3d(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nexus3d_state::screen_update_nexus3d(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/ngen.cpp b/src/mame/drivers/ngen.cpp index f6eb283c682..31a69f410ba 100644 --- a/src/mame/drivers/ngen.cpp +++ b/src/mame/drivers/ngen.cpp @@ -119,9 +119,9 @@ public: DECLARE_WRITE8_MEMBER(dma_write_word); MC6845_UPDATE_ROW(crtc_update_row); // TODO: sort out what devices use which channels - DECLARE_READ8_MEMBER( dma_0_dack_r ) { UINT16 ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; } - DECLARE_READ8_MEMBER( dma_1_dack_r ) { UINT16 ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; } - DECLARE_READ8_MEMBER( dma_2_dack_r ) { UINT16 ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; } + DECLARE_READ8_MEMBER( dma_0_dack_r ) { uint16_t ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; } + DECLARE_READ8_MEMBER( dma_1_dack_r ) { uint16_t ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; } + DECLARE_READ8_MEMBER( dma_2_dack_r ) { uint16_t ret = 0xffff; m_dma_high_byte = ret & 0xff00; return ret; } DECLARE_READ8_MEMBER( dma_3_dack_r ); DECLARE_WRITE8_MEMBER( dma_0_dack_w ){ popmessage("IOW0: data %02x",data); } DECLARE_WRITE8_MEMBER( dma_1_dack_w ){ } @@ -164,23 +164,23 @@ private: optional_device m_fdc_timer; optional_device m_hdc; optional_device m_hdc_timer; - optional_shared_ptr m_hd_buffer; + optional_shared_ptr m_hd_buffer; void set_dma_channel(int channel, int state); - UINT8 m_xbus_current; // currently selected X-Bus module - UINT16 m_peripheral; - UINT16 m_upper; - UINT16 m_middle; - UINT16 m_port00; - UINT16 m_periph141; - UINT8 m_dma_offset[4]; - INT8 m_dma_channel; - UINT16 m_dma_high_byte; - UINT16 m_control; - UINT16 m_disk_rom_ptr; - UINT8 m_hdc_control; - UINT8 m_disk_page; + uint8_t m_xbus_current; // currently selected X-Bus module + uint16_t m_peripheral; + uint16_t m_upper; + uint16_t m_middle; + uint16_t m_port00; + uint16_t m_periph141; + uint8_t m_dma_offset[4]; + int8_t m_dma_channel; + uint16_t m_dma_high_byte; + uint16_t m_control; + uint16_t m_disk_rom_ptr; + uint8_t m_hdc_control; + uint8_t m_disk_page; }; class ngen386_state : public ngen_state @@ -233,7 +233,7 @@ WRITE_LINE_MEMBER(ngen_state::timer_clk_out) WRITE16_MEMBER(ngen_state::cpu_peripheral_cb) { - UINT32 addr; + uint32_t addr; switch(offset) { @@ -341,7 +341,7 @@ WRITE16_MEMBER(ngen_state::peripheral_w) READ16_MEMBER(ngen_state::peripheral_r) { - UINT16 ret = 0xffff; + uint16_t ret = 0xffff; switch(offset) { case 0x00: @@ -422,7 +422,7 @@ READ16_MEMBER(ngen_state::peripheral_r) // TODO: make expansion modules slot devices WRITE16_MEMBER(ngen_state::xbus_w) { - UINT16 addr = (data & 0x00ff) << 8; + uint16_t addr = (data & 0x00ff) << 8; cpu_device* cpu; if(m_maincpu) @@ -451,7 +451,7 @@ WRITE16_MEMBER(ngen_state::xbus_w) // 0x3141 - QIC Tape module READ16_MEMBER(ngen_state::xbus_r) { - UINT16 ret = 0xffff; + uint16_t ret = 0xffff; switch(m_xbus_current) { @@ -532,7 +532,7 @@ WRITE16_MEMBER(ngen_state::hfd_w) READ16_MEMBER(ngen_state::hfd_r) { - UINT16 ret = 0xffff; + uint16_t ret = 0xffff; switch(offset) { @@ -684,7 +684,7 @@ WRITE_LINE_MEMBER( ngen_state::dack3_w ) { set_dma_channel(3, state); } READ8_MEMBER(ngen_state::dma_3_dack_r) { - UINT16 ret = 0xffff; + uint16_t ret = 0xffff; if((m_hdc_control & 0x04) && m_disk_rom) { @@ -703,7 +703,7 @@ READ8_MEMBER(ngen_state::dma_3_dack_r) READ8_MEMBER(ngen_state::dma_read_word) { cpu_device* cpu; - UINT16 result; + uint16_t result; if(m_maincpu) cpu = m_maincpu; @@ -743,11 +743,11 @@ WRITE8_MEMBER(ngen_state::dma_write_word) MC6845_UPDATE_ROW( ngen_state::crtc_update_row ) { - UINT16 addr = ma; + uint16_t addr = ma; for(int x=0;x m_tlcs900; @@ -175,13 +175,13 @@ public: required_device m_ldac; required_device m_rdac; required_device m_cart; - required_shared_ptr m_mainram; + required_shared_ptr m_mainram; required_device m_k1ge; DECLARE_READ8_MEMBER( ngp_io_r ); DECLARE_WRITE8_MEMBER( ngp_io_w ); - void flash_w( int which, offs_t offset, UINT8 data ); + void flash_w( int which, offs_t offset, uint8_t data ); DECLARE_WRITE8_MEMBER( flash0_w ); DECLARE_WRITE8_MEMBER( flash1_w ); @@ -194,7 +194,7 @@ public: DECLARE_WRITE_LINE_MEMBER( ngp_vblank_pin_w ); DECLARE_WRITE_LINE_MEMBER( ngp_hblank_pin_w ); DECLARE_WRITE8_MEMBER( ngp_tlcs900_porta ); - UINT32 screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_INPUT_CHANGED_MEMBER(power_callback); TIMER_CALLBACK_MEMBER(ngp_seconds_callback); @@ -248,7 +248,7 @@ TIMER_CALLBACK_MEMBER(ngp_state::ngp_seconds_callback) READ8_MEMBER( ngp_state::ngp_io_r ) { - UINT8 data = m_io_reg[offset]; + uint8_t data = m_io_reg[offset]; switch( offset ) { @@ -322,7 +322,7 @@ WRITE8_MEMBER( ngp_state::ngp_io_w ) } -void ngp_state::flash_w( int which, offs_t offset, UINT8 data ) +void ngp_state::flash_w( int which, offs_t offset, uint8_t data ) { if ( ! m_flash_chip[which].present ) return; @@ -346,7 +346,7 @@ void ngp_state::flash_w( int which, offs_t offset, UINT8 data ) if ( m_flash_chip[which].command[0] == 0x80 ) { int size = 0x10000; - UINT8 *block = m_flash_chip[which].data; + uint8_t *block = m_flash_chip[which].data; m_flash_chip[which].state = F_AUTO_BLOCK_ERASE; switch( m_flash_chip[which].device_id ) @@ -648,7 +648,7 @@ void ngp_state::machine_start() if (m_cart->exists()) { std::string region_tag; - UINT8 *cart = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str())->base(); + uint8_t *cart = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str())->base(); m_maincpu->space(AS_PROGRAM).install_read_bank(0x200000, 0x3fffff, "flash0"); m_maincpu->space(AS_PROGRAM).install_read_bank(0x800000, 0x9fffff, "flash1"); @@ -732,7 +732,7 @@ void ngp_state::machine_reset() } -UINT32 ngp_state::screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ngp_state::screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_k1ge->update( bitmap, cliprect ); return 0; @@ -741,7 +741,7 @@ UINT32 ngp_state::screen_update_ngp(screen_device &screen, bitmap_ind16 &bitmap, DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size != 0x8000 && size != 0x80000 && size != 0x100000 && size != 0x200000 && size != 0x400000) { diff --git a/src/mame/drivers/nibble.cpp b/src/mame/drivers/nibble.cpp index 747b870ca20..61275ba4dc1 100644 --- a/src/mame/drivers/nibble.cpp +++ b/src/mame/drivers/nibble.cpp @@ -65,7 +65,7 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; DECLARE_WRITE16_MEMBER(nibble_videoram_w); TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -74,7 +74,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(nibble); - UINT32 screen_update_nibble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nibble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(nibble_interrupt); required_device m_maincpu; required_device m_gfxdecode; @@ -101,7 +101,7 @@ TILE_GET_INFO_MEMBER(nibble_state::get_bg_tile_info) ---- ---- color code. ---- ---- seems unused. */ - UINT8 code = m_videoram[tile_index/2] >> (tile_index & 1 ? 0 : 8); + uint8_t code = m_videoram[tile_index/2] >> (tile_index & 1 ? 0 : 8); SET_TILE_INFO_MEMBER(0 /* bank */, code, 0 /* color */, 0); } @@ -111,7 +111,7 @@ void nibble_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nibble_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 nibble_state::screen_update_nibble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t nibble_state::screen_update_nibble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/nightgal.cpp b/src/mame/drivers/nightgal.cpp index 8bf1a91f83b..5a70f9ebf75 100644 --- a/src/mame/drivers/nightgal.cpp +++ b/src/mame/drivers/nightgal.cpp @@ -58,14 +58,14 @@ public: m_blitter(*this, "blitter") { } /* video-related */ - UINT8 m_blit_raw_data[3]; + uint8_t m_blit_raw_data[3]; /* misc */ - UINT8 m_nsc_latch; - UINT8 m_z80_latch; - UINT8 m_mux_data; + uint8_t m_nsc_latch; + uint8_t m_z80_latch; + uint8_t m_mux_data; - required_shared_ptr m_comms_ram; + required_shared_ptr m_comms_ram; /* devices */ required_device m_maincpu; @@ -90,7 +90,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(nightgal); - UINT32 screen_update_nightgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nightgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: required_ioport m_io_cr_clear; @@ -125,18 +125,18 @@ void nightgal_state::video_start() m_tmp_bitmap = std::make_unique(256, 256); } -UINT32 nightgal_state::screen_update_nightgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t nightgal_state::screen_update_nightgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; for (y = cliprect.min_y; y <= cliprect.max_y; ++y) { - UINT8 *src = &m_blitter->m_blit_buffer[y * 256 + cliprect.min_x]; - UINT16 *dst = &m_tmp_bitmap->pix16(y, cliprect.min_x); + uint8_t *src = &m_blitter->m_blit_buffer[y * 256 + cliprect.min_x]; + uint16_t *dst = &m_tmp_bitmap->pix16(y, cliprect.min_x); for (x = cliprect.min_x; x <= cliprect.max_x; x += 2) { - UINT32 srcpix = *src++; + uint32_t srcpix = *src++; *dst++ = m_palette->pen(srcpix & 0xf); *dst++ = m_palette->pen((srcpix >> 4) & 0xf); } @@ -150,7 +150,7 @@ UINT32 nightgal_state::screen_update_nightgal(screen_device &screen, bitmap_ind1 /* guess: use the same resistor values as Crazy Climber (needs checking on the real HW) */ PALETTE_INIT_MEMBER(nightgal_state, nightgal) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); static const int resistances_rg[3] = { 1000, 470, 220 }; static const int resistances_b [2] = { 470, 220 }; double weights_rg[3], weights_b[2]; @@ -263,7 +263,7 @@ WRITE8_MEMBER(nightgal_state::mux_w) READ8_MEMBER(nightgal_state::input_1p_r) { - UINT8 cr_clear = m_io_cr_clear->read(); + uint8_t cr_clear = m_io_cr_clear->read(); switch (m_mux_data) { @@ -282,7 +282,7 @@ READ8_MEMBER(nightgal_state::input_1p_r) READ8_MEMBER(nightgal_state::input_2p_r) { - UINT8 coin_port = m_io_coins->read(); + uint8_t coin_port = m_io_coins->read(); switch (m_mux_data) { @@ -1034,7 +1034,7 @@ ROM_END DRIVER_INIT_MEMBER(nightgal_state,royalqn) { - UINT8 *ROM = memregion("subrom")->base(); + uint8_t *ROM = memregion("subrom")->base(); /* patch open bus / protection */ ROM[0x027e] = 0x02; diff --git a/src/mame/drivers/ninjakd2.cpp b/src/mame/drivers/ninjakd2.cpp index 2d0d58f4df4..acf7df6fa58 100644 --- a/src/mame/drivers/ninjakd2.cpp +++ b/src/mame/drivers/ninjakd2.cpp @@ -178,9 +178,9 @@ SAMPLES_START_CB_MEMBER(ninjakd2_state::ninjakd2_init_samples) return; } - const UINT8* const rom = m_pcm_region->base(); + const uint8_t* const rom = m_pcm_region->base(); const int length = m_pcm_region->bytes(); - INT16* sampledata = auto_alloc_array(machine(), INT16, length); + int16_t* sampledata = auto_alloc_array(machine(), int16_t, length); // convert unsigned 8-bit PCM to signed 16-bit for (int i = 0; i < length; ++i) @@ -199,7 +199,7 @@ WRITE8_MEMBER(ninjakd2_state::ninjakd2_pcm_play_w) return; } - const UINT8* const rom = m_pcm_region->base(); + const uint8_t* const rom = m_pcm_region->base(); const int length = m_pcm_region->bytes(); const int start = data << 8; @@ -248,7 +248,7 @@ void ninjakd2_state::omegaf_io_protection_reset() READ8_MEMBER(ninjakd2_state::omegaf_io_protection_r) { - UINT8 result = 0xff; + uint8_t result = 0xff; switch (m_omegaf_io_protection[1] & 3) { @@ -1577,8 +1577,8 @@ by one place all the intervening bits. void ninjakd2_state::lineswap_gfx_roms(const char *region, const int bit) { const int length = memregion(region)->bytes(); - UINT8* const src = memregion(region)->base(); - std::vector temp(length); + uint8_t* const src = memregion(region)->base(); + std::vector temp(length); const int mask = (1 << (bit + 1)) - 1; for (int sa = 0; sa < length; sa++) @@ -1626,7 +1626,7 @@ READ8_MEMBER(ninjakd2_state::robokid_motion_error_verbose_r) return 0xe6; } -void ninjakd2_state::robokid_motion_error_kludge(UINT16 offset) +void ninjakd2_state::robokid_motion_error_kludge(uint16_t offset) { // patch out rare "5268 MOTION ERROR" (MT 05024) // It looks like it's due to a buggy random number generator, @@ -1634,7 +1634,7 @@ void ninjakd2_state::robokid_motion_error_kludge(UINT16 offset) // I doubt it is protection related, but you can never be sure. // Update 131016: there's also a 5208 VECTOR ERROR happening at worm mid-boss on stage 10, I'm prone to think it's // a timing/sprite fault on our side therefore marking as UNEMULATED_PROTECTION until this is resolved. -AS - UINT8 *ROM = memregion("maincpu")->base() + offset; + uint8_t *ROM = memregion("maincpu")->base() + offset; ROM[0] = 0xe6; ROM[1] = 0x03; // and 3 ROM[2] = 0x18; diff --git a/src/mame/drivers/ninjaw.cpp b/src/mame/drivers/ninjaw.cpp index ab2d09cafd4..b2c54139331 100644 --- a/src/mame/drivers/ninjaw.cpp +++ b/src/mame/drivers/ninjaw.cpp @@ -632,7 +632,7 @@ class subwoofer_device : public device_t, public device_sound_interface { public: - subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~subwoofer_device() {} protected: @@ -651,7 +651,7 @@ extern const device_type SUBWOOFER; const device_type SUBWOOFER = &device_creator; -subwoofer_device::subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +subwoofer_device::subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SUBWOOFER, "Subwoofer", tag, owner, clock), device_sound_interface(mconfig, *this) { diff --git a/src/mame/drivers/niyanpai.cpp b/src/mame/drivers/niyanpai.cpp index 553939db652..49e8660e5e4 100644 --- a/src/mame/drivers/niyanpai.cpp +++ b/src/mame/drivers/niyanpai.cpp @@ -60,7 +60,7 @@ WRITE8_MEMBER(niyanpai_state::soundlatch_clear_w) DRIVER_INIT_MEMBER(niyanpai_state,niyanpai) { - UINT8 *SNDROM = memregion("audiocpu")->base(); + uint8_t *SNDROM = memregion("audiocpu")->base(); // sound program patch SNDROM[0x0213] = 0x00; // DI -> NOP @@ -76,8 +76,8 @@ DRIVER_INIT_MEMBER(niyanpai_state,niyanpai) READ16_MEMBER(niyanpai_state::dipsw_r) { - UINT8 dipsw_a = ioport("DSWA")->read(); - UINT8 dipsw_b = ioport("DSWB")->read(); + uint8_t dipsw_a = ioport("DSWA")->read(); + uint8_t dipsw_b = ioport("DSWB")->read(); dipsw_a = BITSWAP8(dipsw_a,0,1,2,3,4,5,6,7); dipsw_b = BITSWAP8(dipsw_b,0,1,2,3,4,5,6,7); diff --git a/src/mame/drivers/nmg5.cpp b/src/mame/drivers/nmg5.cpp index d71e1141562..d0f2f0882cb 100644 --- a/src/mame/drivers/nmg5.cpp +++ b/src/mame/drivers/nmg5.cpp @@ -248,21 +248,21 @@ public: { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll_ram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_bitmap; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll_ram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_bitmap; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; /* misc */ - UINT8 m_prot_val; - UINT8 m_input_data; - UINT8 m_priority_reg; - UINT8 m_gfx_bank; + uint8_t m_prot_val; + uint8_t m_input_data; + uint8_t m_priority_reg; + uint8_t m_gfx_bank; /* devices */ required_device m_maincpu; @@ -289,7 +289,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_nmg5(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nmg5(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_bitmap( bitmap_ind16 &bitmap ); }; @@ -843,7 +843,7 @@ void nmg5_state::draw_bitmap( bitmap_ind16 &bitmap ) { int yyy = 256; int xxx = 512 / 4; - UINT16 x, y, count; + uint16_t x, y, count; int xoff = -12; int yoff = -9; int pix; @@ -868,7 +868,7 @@ void nmg5_state::draw_bitmap( bitmap_ind16 &bitmap ) } -UINT32 nmg5_state::screen_update_nmg5(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t nmg5_state::screen_update_nmg5(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrolly(0, m_scroll_ram[3] + 9); m_bg_tilemap->set_scrollx(0, m_scroll_ram[2] + 3); diff --git a/src/mame/drivers/nmk16.cpp b/src/mame/drivers/nmk16.cpp index 6f75d9c5b69..92b46e83315 100644 --- a/src/mame/drivers/nmk16.cpp +++ b/src/mame/drivers/nmk16.cpp @@ -194,7 +194,7 @@ WRITE16_MEMBER(nmk16_state::nmk16_bioship_x0016_w) WRITE16_MEMBER(nmk16_state::nmk16_mainram_strange_w) { #if 0 - UINT16* dstram; + uint16_t* dstram; dstram = m_mainram; @@ -246,7 +246,7 @@ READ16_MEMBER(nmk16_state::tharrier_mcu_r) all word accesses are to the input port */ if (ACCESSING_BITS_8_15 && !ACCESSING_BITS_0_7) { - static const UINT8 to_main[] = + static const uint8_t to_main[] = { 0x82,0xc7,0x00,0x2c,0x6c,0x00,0x9f,0xc7,0x00,0x29,0x69,0x00,0x8b,0xc7,0x00 }; @@ -736,11 +736,11 @@ WRITE16_MEMBER(nmk16_state::tdragon_mainram_w) } /*coin setting MCU simulation*/ -void nmk16_state::mcu_run(UINT8 dsw_setting) +void nmk16_state::mcu_run(uint8_t dsw_setting) { - UINT16 coin_input; - UINT8 dsw[2]; - UINT8 i; + uint16_t coin_input; + uint8_t dsw[2]; + uint8_t i; /*Accept the start button but needs some m68k processing first,otherwise you can't start a play with 1 credit inserted*/ if(m_start_helper & 1 && m_mainram[0x9000/2] & 0x0200) /*start 1 */ @@ -4681,9 +4681,9 @@ static MACHINE_CONFIG_START( manybloc, nmk16_state ) MACHINE_CONFIG_END -UINT8 nmk16_state::decode_byte(UINT8 src, const UINT8 *bitp) +uint8_t nmk16_state::decode_byte(uint8_t src, const uint8_t *bitp) { - UINT8 ret, i; + uint8_t ret, i; ret = 0; for (i=0; i<8; i++) @@ -4692,15 +4692,15 @@ UINT8 nmk16_state::decode_byte(UINT8 src, const UINT8 *bitp) return ret; } -UINT32 nmk16_state::bjtwin_address_map_bg0(UINT32 addr) +uint32_t nmk16_state::bjtwin_address_map_bg0(uint32_t addr) { return ((addr&0x00004)>> 2) | ((addr&0x00800)>> 10) | ((addr&0x40000)>>16); } -UINT16 nmk16_state::decode_word(UINT16 src, const UINT8 *bitp) +uint16_t nmk16_state::decode_word(uint16_t src, const uint8_t *bitp) { - UINT16 ret, i; + uint16_t ret, i; ret=0; for (i=0; i<16; i++) @@ -4710,7 +4710,7 @@ UINT16 nmk16_state::decode_word(UINT16 src, const UINT8 *bitp) } -UINT32 nmk16_state::bjtwin_address_map_sprites(UINT32 addr) +uint32_t nmk16_state::bjtwin_address_map_sprites(uint32_t addr) { return ((addr&0x00010)>> 4) | ((addr&0x20000)>>16) | ((addr&0x100000)>>18); } @@ -4719,10 +4719,10 @@ UINT32 nmk16_state::bjtwin_address_map_sprites(UINT32 addr) void nmk16_state::decode_gfx() { /* GFX are scrambled. We decode them here. (BIG Thanks to Antiriad for descrambling info) */ - UINT8 *rom; + uint8_t *rom; int A, len; - static const UINT8 decode_data_bg[8][8] = + static const uint8_t decode_data_bg[8][8] = { {0x3,0x0,0x7,0x2,0x5,0x1,0x4,0x6}, {0x1,0x2,0x6,0x5,0x4,0x0,0x3,0x7}, @@ -4734,7 +4734,7 @@ void nmk16_state::decode_gfx() {0x3,0x4,0x7,0x6,0x2,0x0,0x5,0x1}, }; - static const UINT8 decode_data_sprite[8][16] = + static const uint8_t decode_data_sprite[8][16] = { {0x9,0x3,0x4,0x5,0x7,0x1,0xb,0x8,0x0,0xd,0x2,0xc,0xe,0x6,0xf,0xa}, {0x1,0x3,0xc,0x4,0x0,0xf,0xb,0xa,0x8,0x5,0xe,0x6,0xd,0x2,0x7,0x9}, @@ -4761,7 +4761,7 @@ void nmk16_state::decode_gfx() len = memregion("sprites")->bytes(); for (A = 0;A < len;A += 2) { - UINT16 tmp = decode_word( rom[A+1]*256 + rom[A], decode_data_sprite[bjtwin_address_map_sprites(A)]); + uint16_t tmp = decode_word( rom[A+1]*256 + rom[A], decode_data_sprite[bjtwin_address_map_sprites(A)]); rom[A+1] = tmp >> 8; rom[A] = tmp & 0xff; } @@ -4772,17 +4772,17 @@ void nmk16_state::decode_tdragonb() /* Descrambling Info Again Taken from Raine, Huge Thanks to Antiriad and the Raine Team for going Open Source, best of luck in future development. */ - UINT8 *rom; + uint8_t *rom; int A, len; /* The Main 68k Program of the Bootleg is Bitswapped */ - static const UINT8 decode_data_tdragonb[1][16] = + static const uint8_t decode_data_tdragonb[1][16] = { {0xe,0xc,0xa,0x8,0x7,0x5,0x3,0x1,0xf,0xd,0xb,0x9,0x6,0x4,0x2,0x0}, }; /* Graphic Roms Could Also Do With Rearranging to make things simpler */ - static const UINT8 decode_data_tdragonbgfx[1][8] = + static const uint8_t decode_data_tdragonbgfx[1][8] = { {0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0}, }; @@ -4792,7 +4792,7 @@ void nmk16_state::decode_tdragonb() for (A = 0;A < len;A += 2) { int h = A+NATIVE_ENDIAN_VALUE_LE_BE(1,0), l = A+NATIVE_ENDIAN_VALUE_LE_BE(0,1); - UINT16 tmp = decode_word( rom[h]*256 + rom[l], decode_data_tdragonb[0]); + uint16_t tmp = decode_word( rom[h]*256 + rom[l], decode_data_tdragonb[0]); rom[h] = tmp >> 8; rom[l] = tmp & 0xff; } @@ -4815,11 +4815,11 @@ void nmk16_state::decode_tdragonb() void nmk16_state::decode_ssmissin() { /* Like Thunder Dragon Bootleg without the Program Rom Swapping */ - UINT8 *rom; + uint8_t *rom; int A, len; /* Graphic Roms Could Also Do With Rearranging to make things simpler */ - static const UINT8 decode_data_tdragonbgfx[1][8] = + static const uint8_t decode_data_tdragonbgfx[1][8] = { {0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0}, }; @@ -4858,7 +4858,7 @@ DRIVER_INIT_MEMBER(nmk16_state,tharrier) DRIVER_INIT_MEMBER(nmk16_state,hachamf_prot) { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); //rom[0x0006/2] = 0x7dc2; /* replace reset vector with the "real" one */ @@ -4876,7 +4876,7 @@ DRIVER_INIT_MEMBER(nmk16_state,tdragonb) DRIVER_INIT_MEMBER(nmk16_state,tdragon_prot) { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); //rom[0x94b0/2] = 0; /* Patch out JMP to shared memory (protection) */ //rom[0x94b2/2] = 0x92f4; @@ -4913,7 +4913,7 @@ DRIVER_INIT_MEMBER(nmk16_state,bjtwin) * 008F7E: 207C 000F 9000 movea.l #$f9000, A0 */ #if 0 - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); rom[0x09172/2] = 0x6006; /* patch checksum error */ rom[0x08f74/2] = 0x4e71; #endif @@ -5316,9 +5316,9 @@ static void decryptcode( running_machine &machine, int a23, int a22, int a21, in int a11, int a10, int a9, int a8, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0 ) { int i; - UINT8 *RAM = machine.root_device().memregion( "maincpu" )->base(); + uint8_t *RAM = machine.root_device().memregion( "maincpu" )->base(); size_t size = machine.root_device().memregion( "maincpu" )->bytes(); - std::vector buffer( size ); + std::vector buffer( size ); memcpy( &buffer[0], RAM, size ); for( i = 0; i < size; i++ ) diff --git a/src/mame/drivers/nokia_3310.cpp b/src/mame/drivers/nokia_3310.cpp index d48dfc64841..214597f30b5 100644 --- a/src/mame/drivers/nokia_3310.cpp +++ b/src/mame/drivers/nokia_3310.cpp @@ -65,18 +65,18 @@ public: private: void assert_fiq(int num); void assert_irq(int num); - void ack_fiq(UINT16 mask); - void ack_irq(UINT16 mask); - void nokia_ccont_w(UINT8 data); - UINT8 nokia_ccont_r(); - - std::unique_ptr m_ram; - std::unique_ptr m_dsp_ram; - UINT8 m_power_on; - UINT16 m_fiq_status; - UINT16 m_irq_status; - UINT16 m_timer1_counter; - UINT16 m_timer0_counter; + void ack_fiq(uint16_t mask); + void ack_irq(uint16_t mask); + void nokia_ccont_w(uint8_t data); + uint8_t nokia_ccont_r(); + + std::unique_ptr m_ram; + std::unique_ptr m_dsp_ram; + uint8_t m_power_on; + uint16_t m_fiq_status; + uint16_t m_irq_status; + uint16_t m_timer1_counter; + uint16_t m_timer0_counter; emu_timer * m_timer0; emu_timer * m_timer1; @@ -87,17 +87,17 @@ private: struct nokia_ccont { bool dc; - UINT8 cmd; - UINT8 watchdog; - UINT8 regs[0x10]; + uint8_t cmd; + uint8_t watchdog; + uint8_t regs[0x10]; } m_ccont; - UINT8 m_mad2_regs[0x100]; + uint8_t m_mad2_regs[0x100]; }; #if LOG_MAD2_REGISTER_ACCESS -static const char * nokia_mad2_reg_desc(UINT8 offset) +static const char * nokia_mad2_reg_desc(uint8_t offset) { switch(offset) { @@ -187,7 +187,7 @@ static const char * nokia_mad2_reg_desc(UINT8 offset) #endif #if LOG_CCONT_REGISTER_ACCESS -static const char * nokia_ccont_reg_desc(UINT8 offset) +static const char * nokia_ccont_reg_desc(uint8_t offset) { switch(offset) { @@ -214,8 +214,8 @@ static const char * nokia_ccont_reg_desc(UINT8 offset) void noki3310_state::machine_start() { - m_ram = std::make_unique(0x40000); - m_dsp_ram = std::make_unique(0x800); // DSP shared RAM + m_ram = std::make_unique(0x40000); + m_dsp_ram = std::make_unique(0x800); // DSP shared RAM // allocate timers m_timer0 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(noki3310_state::timer0), this)); @@ -296,7 +296,7 @@ void noki3310_state::assert_irq(int num) } } -void noki3310_state::ack_fiq(UINT16 mask) +void noki3310_state::ack_fiq(uint16_t mask) { m_fiq_status &= ~mask; @@ -304,7 +304,7 @@ void noki3310_state::ack_fiq(UINT16 mask) m_maincpu->set_input_line(1, CLEAR_LINE); } -void noki3310_state::ack_irq(UINT16 mask) +void noki3310_state::ack_irq(uint16_t mask) { m_irq_status &= ~mask; @@ -312,7 +312,7 @@ void noki3310_state::ack_irq(UINT16 mask) m_maincpu->set_input_line(0, CLEAR_LINE); } -void noki3310_state::nokia_ccont_w(UINT8 data) +void noki3310_state::nokia_ccont_w(uint8_t data) { if (m_ccont.dc == false) { @@ -323,14 +323,14 @@ void noki3310_state::nokia_ccont_w(UINT8 data) } else { - UINT8 addr = (m_ccont.cmd >> 3) & 0x0f; + uint8_t addr = (m_ccont.cmd >> 3) & 0x0f; switch(addr) { case 0x0: // ADC { - UINT16 ad_id = (data >> 4) & 0x07; - UINT16 ad_value = 0; + uint16_t ad_id = (data >> 4) & 0x07; + uint16_t ad_value = 0; switch(ad_id) { case 0: ad_value = 0x000; break; // Accessory Detect @@ -372,10 +372,10 @@ void noki3310_state::nokia_ccont_w(UINT8 data) m_ccont.dc = !m_ccont.dc; } -UINT8 noki3310_state::nokia_ccont_r() +uint8_t noki3310_state::nokia_ccont_r() { - UINT8 addr = (m_ccont.cmd >> 3) & 0x0f; - UINT8 data = m_ccont.regs[addr]; + uint8_t addr = (m_ccont.cmd >> 3) & 0x0f; + uint8_t data = m_ccont.regs[addr]; system_time systime; machine().current_datetime(systime); @@ -403,7 +403,7 @@ PCD8544_SCREEN_UPDATE(noki3310_state::pcd8544_screen_update) for (int r = 0; r < 6; r++) for (int x = 0; x < 84; x++) { - UINT8 gfx = vram[r*84 + x]; + uint8_t gfx = vram[r*84 + x]; for (int y = 0; y < 8; y++) { @@ -483,7 +483,7 @@ WRITE16_MEMBER(noki3310_state::dsp_ram_w) READ8_MEMBER(noki3310_state::mad2_io_r) { - UINT8 data = m_mad2_regs[offset]; + uint8_t data = m_mad2_regs[offset]; switch(offset) { diff --git a/src/mame/drivers/norautp.cpp b/src/mame/drivers/norautp.cpp index 12ec866ae0c..dfc2df9268b 100644 --- a/src/mame/drivers/norautp.cpp +++ b/src/mame/drivers/norautp.cpp @@ -567,11 +567,11 @@ void norautp_state::video_start() { - m_np_vram = make_unique_clear(0x1000/2); + m_np_vram = make_unique_clear(0x1000/2); } -UINT32 norautp_state::screen_update_norautp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t norautp_state::screen_update_norautp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, count; @@ -3466,21 +3466,21 @@ ROM_END */ //static DRIVER_INIT( norautrh ) //{ -// UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); +// uint8_t *ROM = machine.root_device().memregion("maincpu")->base(); // ROM[0x1110] = 0x00; // ROM[0x1111] = 0x00; //} //static DRIVER_INIT( norautpn ) //{ -// UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); +// uint8_t *ROM = machine.root_device().memregion("maincpu")->base(); // ROM[0x0827] = 0x00; // ROM[0x0828] = 0x00; //} //static DRIVER_INIT( norautu ) //{ -// UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); +// uint8_t *ROM = machine.root_device().memregion("maincpu")->base(); // ROM[0x083c] = 0x00; // ROM[0x083d] = 0x00; // ROM[0x083e] = 0x00; @@ -3488,7 +3488,7 @@ ROM_END //static DRIVER_INIT( gtipoker ) //{ -// UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); +// uint8_t *ROM = machine.root_device().memregion("maincpu")->base(); // ROM[0x0cc6] = 0x00; // ROM[0x0cc7] = 0x00; // ROM[0x0cc8] = 0x00; @@ -3499,7 +3499,7 @@ ROM_END //static DRIVER_INIT( dphl ) //{ -// UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); +// uint8_t *ROM = machine.root_device().memregion("maincpu")->base(); // ROM[0x1510] = 0x00; // ROM[0x1511] = 0x00; // ROM[0x1512] = 0x00; @@ -3507,7 +3507,7 @@ ROM_END //static DRIVER_INIT( dphla ) //{ -// UINT8 *ROM = machine.root_device().memregion("maincpu")->base(); +// uint8_t *ROM = machine.root_device().memregion("maincpu")->base(); // ROM[0x0b09] = 0x00; // ROM[0x0b0a] = 0x00; // ROM[0x0b0b] = 0x00; @@ -3517,8 +3517,8 @@ DRIVER_INIT_MEMBER(norautp_state,enc) { /* Attempt to decrypt the program ROM */ -// UINT8 *rom = memregion("maincpu")->base(); -// UINT8 *buffer; +// uint8_t *rom = memregion("maincpu")->base(); +// uint8_t *buffer; // int size = 0x2000; //memregion("maincpu")->bytes(); // int start = 0; // int i; @@ -3546,7 +3546,7 @@ DRIVER_INIT_MEMBER(norautp_state,enc) // i = i + 16; // } -// buffer = alloc_array_or_die(UINT8, size); +// buffer = alloc_array_or_die(uint8_t, size); // memcpy(buffer, rom, size); // free(buffer); @@ -3556,7 +3556,7 @@ DRIVER_INIT_MEMBER(norautp_state,deb) /* Just for debugging purposes */ /* Should be removed soon */ { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x02f7] = 0xca; ROM[0x02f8] = 0x18; ROM[0x206c] = 0xff; @@ -3566,7 +3566,7 @@ DRIVER_INIT_MEMBER(norautp_state,ssa) /* Passing the video PPI handshaking lines */ /* Just for debugging purposes */ { -// UINT8 *ROM = memregion("maincpu")->base(); +// uint8_t *ROM = memregion("maincpu")->base(); // ROM[0x073b] = 0x00; // ROM[0x073c] = 0x00; diff --git a/src/mame/drivers/notetaker.cpp b/src/mame/drivers/notetaker.cpp index 5c637919ca7..04c4f01d788 100644 --- a/src/mame/drivers/notetaker.cpp +++ b/src/mame/drivers/notetaker.cpp @@ -117,7 +117,7 @@ public: //declarations // screen - 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); // basic io DECLARE_WRITE16_MEMBER(IPConReg_w); DECLARE_WRITE16_MEMBER(FIFOReg_w); @@ -144,50 +144,50 @@ public: DECLARE_DRIVER_INIT(notetakr); //variables // IPConReg - UINT8 m_BootSeqDone; - UINT8 m_ProcLock; - UINT8 m_CharCtr; - UINT8 m_DisableROM; - UINT8 m_CorrOn_q; - UINT8 m_LedInd6; - UINT8 m_LedInd7; - UINT8 m_LedInd8; + uint8_t m_BootSeqDone; + uint8_t m_ProcLock; + uint8_t m_CharCtr; + uint8_t m_DisableROM; + uint8_t m_CorrOn_q; + uint8_t m_LedInd6; + uint8_t m_LedInd7; + uint8_t m_LedInd8; // FIFOReg - UINT8 m_TabletYOn; - UINT8 m_TabletXOn; - UINT8 m_FrSel2; - UINT8 m_FrSel1; - UINT8 m_FrSel0; - UINT8 m_SHConB; - UINT8 m_SHConA; - UINT8 m_SetSH; + uint8_t m_TabletYOn; + uint8_t m_TabletXOn; + uint8_t m_FrSel2; + uint8_t m_FrSel1; + uint8_t m_FrSel0; + uint8_t m_SHConB; + uint8_t m_SHConA; + uint8_t m_SetSH; // DiskReg - UINT8 m_ADCSpd0; - UINT8 m_ADCSpd1; - UINT8 m_StopWordClock_q; - UINT8 m_ClrDiskCont_q; - UINT8 m_ProgBitClk1; - UINT8 m_ProgBitClk2; - UINT8 m_ProgBitClk3; - UINT8 m_AnSel4; - UINT8 m_AnSel2; - UINT8 m_AnSel1; - UINT8 m_DriveSel1; - UINT8 m_DriveSel2; - UINT8 m_DriveSel3; - UINT8 m_SideSelect; - UINT8 m_Disk5VOn; - UINT8 m_Disk12VOn; + uint8_t m_ADCSpd0; + uint8_t m_ADCSpd1; + uint8_t m_StopWordClock_q; + uint8_t m_ClrDiskCont_q; + uint8_t m_ProgBitClk1; + uint8_t m_ProgBitClk2; + uint8_t m_ProgBitClk3; + uint8_t m_AnSel4; + uint8_t m_AnSel2; + uint8_t m_AnSel1; + uint8_t m_DriveSel1; + uint8_t m_DriveSel2; + uint8_t m_DriveSel3; + uint8_t m_SideSelect; + uint8_t m_Disk5VOn; + uint8_t m_Disk12VOn; // output fifo, for DAC - UINT16 m_outfifo[16]; // technically three 74LS225 5bit*16stage FIFO chips, arranged as a 16 stage, 12-bit wide fifo (one bit unused per chip) - UINT8 m_outfifo_count; - UINT8 m_outfifo_tail_ptr; - UINT8 m_outfifo_head_ptr; + uint16_t m_outfifo[16]; // technically three 74LS225 5bit*16stage FIFO chips, arranged as a 16 stage, 12-bit wide fifo (one bit unused per chip) + uint8_t m_outfifo_count; + uint8_t m_outfifo_tail_ptr; + uint8_t m_outfifo_head_ptr; // fifo timer emu_timer *m_FIFO_timer; TIMER_CALLBACK_MEMBER(timer_fifoclk); // framebuffer display starting address - UINT16 m_DispAddr; + uint16_t m_DispAddr; // separate cpu resets void ip_reset(); @@ -215,7 +215,7 @@ void notetaker_state::device_timer(emu_timer &timer, device_timer_id id, int par TIMER_CALLBACK_MEMBER(notetaker_state::timer_fifoclk) { - UINT16 data; + uint16_t data; //pop a value off the fifo and send it to the dac. #ifdef FIFO_VERBOSE if (m_outfifo_count == 0) logerror("output fifo is EMPTY! repeating previous sample!\n"); @@ -232,21 +232,21 @@ TIMER_CALLBACK_MEMBER(notetaker_state::timer_fifoclk) m_FIFO_timer->adjust(attotime::from_hz(((XTAL_960kHz/10)/4)/((m_FrSel0<<3)+(m_FrSel1<<2)+(m_FrSel2<<1)+1))); // FIFO timer is clocked by 960khz divided by 10 (74ls162 decade counter), divided by 4 (mc14568B with divider 1 pins set to 4), divided by 1,3,5,7,9,11,13,15 (or 0,2,4,6,8,10,12,14?) } -UINT32 notetaker_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t notetaker_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // have to figure out what resolution we're drawing to here and draw appropriately to screen // code borrowed/stolen from video/mac.cpp - UINT32 video_base; - UINT16 word; - UINT16 *line; + uint32_t video_base; + uint16_t word; + uint16_t *line; int y, x, b; video_base = (m_DispAddr << 3)&0x1FFFF; #ifdef DEBUG_VIDEO logerror("Video Base = 0x%05x\n", video_base); #endif - const UINT16 *video_ram_field1 = (UINT16 *)(memregion("mainram")->base()+video_base); - const UINT16 *video_ram_field2 = (UINT16 *)(memregion("mainram")->base()+video_base+0x4B00); + const uint16_t *video_ram_field1 = (uint16_t *)(memregion("mainram")->base()+video_base); + const uint16_t *video_ram_field2 = (uint16_t *)(memregion("mainram")->base()+video_base+0x4B00); for (y = 0; y < 480; y++) { @@ -286,7 +286,7 @@ READ16_MEMBER( notetaker_state::ReadKeyData_r ) READ16_MEMBER( notetaker_state::ReadOPStatus_r ) // 74ls368 hex inverter at #l7 provides 4 bits, inverted { - UINT16 data = 0xFFF0; + uint16_t data = 0xFFF0; data |= (m_outfifo_count >= 1) ? 0 : 0x08; // m_FIFOOutRdy is true if the fifo has at least 1 word in it, false otherwise data |= (m_outfifo_count < 16) ? 0 : 0x04; // m_FIFOInRdy is true if the fifo has less than 16 words in it, false otherwise // note /SWE is permanently enabled, so we don't enable it here for HD6402 reading @@ -421,7 +421,7 @@ READ16_MEMBER( notetaker_state::ReadEIAData_r ) READ16_MEMBER( notetaker_state::ReadEIAStatus_r ) // 74ls368 hex inverter at #f1 provides 2 bits, inverted { - UINT16 data = 0xFFFC; + uint16_t data = 0xFFFC; // note /SWE is permanently enabled, so we don't enable it here for HD6402 reading data |= m_eiauart->get_output_pin(AY31015_DAV ) ? 0 : 0x02; // DR - pin 19 data |= m_eiauart->get_output_pin(AY31015_TBMT) ? 0 : 0x01; // TBRE - pin 22 @@ -460,9 +460,9 @@ WRITE16_MEMBER( notetaker_state::EIAChipReset_w ) /* These next two members are memory map related for the iocpu */ READ16_MEMBER(notetaker_state::iocpu_r) { - UINT16 *rom = (UINT16 *)(memregion("iocpu")->base()); + uint16_t *rom = (uint16_t *)(memregion("iocpu")->base()); rom += 0x7f800; - UINT16 *ram = (UINT16 *)(memregion("mainram")->base()); + uint16_t *ram = (uint16_t *)(memregion("mainram")->base()); if ( (m_BootSeqDone == 0) || ((m_DisableROM == 0) && ((offset&0x7F800) == 0)) ) { rom += (offset&0x7FF); @@ -479,8 +479,8 @@ READ16_MEMBER(notetaker_state::iocpu_r) WRITE16_MEMBER(notetaker_state::iocpu_w) { - //UINT16 tempword; - UINT16 *ram = (UINT16 *)(memregion("mainram")->base()); + //uint16_t tempword; + uint16_t *ram = (uint16_t *)(memregion("mainram")->base()); if ( (m_BootSeqDone == 0) || ((m_DisableROM == 0) && ((offset&0x7F800) == 0)) ) { logerror("attempt to write %04X to ROM-mapped area at %06X ignored\n", data, offset<<1); @@ -838,11 +838,11 @@ DRIVER_INIT_MEMBER(notetaker_state,notetakr) // interfacing with older xerox technologies which used A0 and D0 as the MSB bits // or maybe because someone screwed up somewhere along the line. we may never know. // see http://bitsavers.informatik.uni-stuttgart.de/pdf/xerox/notetaker/schematics/19790423_Notetaker_IO_Processor.pdf pages 12 and onward - UINT16 *romsrc = (UINT16 *)(memregion("iocpuload")->base()); - UINT16 *romdst = (UINT16 *)(memregion("iocpu")->base()); - UINT16 *temppointer; - UINT16 wordtemp; - UINT16 addrtemp; + uint16_t *romsrc = (uint16_t *)(memregion("iocpuload")->base()); + uint16_t *romdst = (uint16_t *)(memregion("iocpu")->base()); + uint16_t *temppointer; + uint16_t wordtemp; + uint16_t addrtemp; // leave the src pointer alone, since we've only used a 0x1000 long address space romdst += 0x7f800; // set the dest pointer to 0xff000 (>>1 because 16 bits data) for (int i = 0; i < 0x800; i++) diff --git a/src/mame/drivers/nova2001.cpp b/src/mame/drivers/nova2001.cpp index fc1e89f98c0..f35c26daf8c 100644 --- a/src/mame/drivers/nova2001.cpp +++ b/src/mame/drivers/nova2001.cpp @@ -975,9 +975,9 @@ void nova2001_state::lineswap_gfx_roms(const char *region, const int bit) { const int length = memregion(region)->bytes(); - UINT8* const src = memregion(region)->base(); + uint8_t* const src = memregion(region)->base(); - std::vector temp(length); + std::vector temp(length); const int mask = (1 << (bit + 1)) - 1; diff --git a/src/mame/drivers/novag6502.cpp b/src/mame/drivers/novag6502.cpp index d5376fb7834..4f8f5916447 100644 --- a/src/mame/drivers/novag6502.cpp +++ b/src/mame/drivers/novag6502.cpp @@ -55,27 +55,27 @@ public: DECLARE_READ8_MEMBER(supercon_1f_r); // misc common - UINT16 m_inp_mux; // multiplexed keypad mask - UINT16 m_led_select; - UINT16 m_led_data; + uint16_t m_inp_mux; // multiplexed keypad mask + uint16_t m_led_select; + uint16_t m_led_data; - UINT16 read_inputs(int columns); + uint16_t read_inputs(int columns); // display common int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 31 for now) - UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) + uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + uint32_t m_display_cache[0x20]; // (internal use) + uint8_t m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); void set_display_size(int maxx, int maxy); - void set_display_segmask(UINT32 digits, UINT32 mask); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true); + void set_display_segmask(uint32_t digits, uint32_t mask); + void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true); protected: virtual void machine_start() override; @@ -129,7 +129,7 @@ void novag6502_state::machine_reset() void novag6502_state::display_update() { - UINT32 active_state[0x20]; + uint32_t active_state[0x20]; for (int y = 0; y < m_display_maxy; y++) { @@ -142,7 +142,7 @@ void novag6502_state::display_update() m_display_decay[y][x] = m_display_wait; // determine active state - UINT32 ds = (m_display_decay[y][x] != 0) ? 1 : 0; + uint32_t ds = (m_display_decay[y][x] != 0) ? 1 : 0; active_state[y] |= (ds << x); } } @@ -197,7 +197,7 @@ void novag6502_state::set_display_size(int maxx, int maxy) m_display_maxy = maxy; } -void novag6502_state::set_display_segmask(UINT32 digits, UINT32 mask) +void novag6502_state::set_display_segmask(uint32_t digits, uint32_t mask) { // set a segment mask per selected digit, but leave unselected ones alone for (int i = 0; i < 0x20; i++) @@ -208,12 +208,12 @@ void novag6502_state::set_display_segmask(UINT32 digits, UINT32 mask) } } -void novag6502_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update) +void novag6502_state::display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update) { set_display_size(maxx, maxy); // update current state - UINT32 mask = (1 << maxx) - 1; + uint32_t mask = (1 << maxx) - 1; for (int y = 0; y < maxy; y++) m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; @@ -224,9 +224,9 @@ void novag6502_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 set // generic input handlers -UINT16 novag6502_state::read_inputs(int columns) +uint16_t novag6502_state::read_inputs(int columns) { - UINT16 ret = 0; + uint16_t ret = 0; // read selected input rows for (int i = 0; i < columns; i++) diff --git a/src/mame/drivers/nsm.cpp b/src/mame/drivers/nsm.cpp index 60d4e0efd5a..e78733c82a1 100644 --- a/src/mame/drivers/nsm.cpp +++ b/src/mame/drivers/nsm.cpp @@ -43,8 +43,8 @@ protected: // driver_device overrides virtual void machine_reset() override; private: - UINT8 m_cru_data[9]; - UINT8 m_cru_count; + uint8_t m_cru_data[9]; + uint8_t m_cru_count; }; static ADDRESS_MAP_START( nsm_map, AS_PROGRAM, 8, nsm_state ) @@ -90,7 +90,7 @@ WRITE8_MEMBER( nsm_state::cru_w ) } m_cru_data[m_cru_count] |= (data << offset); - UINT8 i,j; + uint8_t i,j; int segments; if (!m_cru_count && (offset == 7)) { diff --git a/src/mame/drivers/nsmpoker.cpp b/src/mame/drivers/nsmpoker.cpp index 7546db2ec12..318e7d23cff 100644 --- a/src/mame/drivers/nsmpoker.cpp +++ b/src/mame/drivers/nsmpoker.cpp @@ -76,8 +76,8 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(nsmpoker_videoram_w); DECLARE_WRITE8_MEMBER(nsmpoker_colorram_w); @@ -86,7 +86,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(nsmpoker); virtual void machine_reset() override; - UINT32 screen_update_nsmpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nsmpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(nsmpoker_interrupt); required_device m_maincpu; required_device m_gfxdecode; @@ -135,7 +135,7 @@ void nsmpoker_state::video_start() } -UINT32 nsmpoker_state::screen_update_nsmpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t nsmpoker_state::screen_update_nsmpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/nss.cpp b/src/mame/drivers/nss.cpp index 43efd1ea496..d8285756571 100644 --- a/src/mame/drivers/nss.cpp +++ b/src/mame/drivers/nss.cpp @@ -321,11 +321,11 @@ public: required_device m_screen; optional_device m_palette; - UINT8 m_wram_wp_flag; - std::unique_ptr m_wram; - UINT8 m_nmi_enable; - UINT8 m_cart_sel; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint8_t m_wram_wp_flag; + std::unique_ptr m_wram; + uint8_t m_nmi_enable; + uint8_t m_cart_sel; + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(ram_wp_r); DECLARE_WRITE8_MEMBER(ram_wp_w); @@ -352,7 +352,7 @@ public: -UINT32 nss_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t nss_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { m_m50458->screen_update(screen,bitmap,cliprect); return 0; @@ -520,7 +520,7 @@ READ8_MEMBER(nss_state::port_00_r) ---- --x- Button "Joypad Left" (0=Released, 1=Pressed) ---- ---x Button "Joypad Right" (0=Released, 1=Pressed) */ - UINT8 res; + uint8_t res; res = (m_joy_flag) << 7; // TODO: reads from SNES screen output, correct? @@ -631,7 +631,7 @@ void nss_state::machine_start() snes_state::machine_start(); m_is_nss = 1; - m_wram = make_unique_clear(0x1000); + m_wram = make_unique_clear(0x1000); } @@ -1059,7 +1059,7 @@ ROM_END DRIVER_INIT_MEMBER(nss_state,nss) { - UINT8 *PROM = memregion("rp5h01")->base(); + uint8_t *PROM = memregion("rp5h01")->base(); for (int i = 0; i < 0x10; i++) PROM[i] = BITSWAP8(PROM[i],0,1,2,3,4,5,6,7) ^ 0xff; diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp index 1b216b62468..d58b4874f42 100644 --- a/src/mame/drivers/nwk-tr.cpp +++ b/src/mame/drivers/nwk-tr.cpp @@ -288,9 +288,9 @@ public: // TODO: Needs verification on real hardware static const int m_sound_timer_usec = 2400; - UINT8 m_led_reg0; - UINT8 m_led_reg1; - required_shared_ptr m_work_ram; + uint8_t m_led_reg0; + uint8_t m_led_reg1; + required_shared_ptr m_work_ram; required_device m_maincpu; required_device m_audiocpu; required_device m_dsp; @@ -299,14 +299,14 @@ public: required_device m_adc12138; required_ioport m_in0, m_in1, m_in2, m_dsw, m_analog1, m_analog2, m_analog3, m_analog4, m_analog5; required_device m_palette; - required_shared_ptr m_generic_paletteram_32; + required_shared_ptr m_generic_paletteram_32; emu_timer *m_sound_irq_timer; int m_fpga_uploaded; int m_lanc2_ram_r; int m_lanc2_ram_w; - UINT8 m_lanc2_reg[3]; - std::unique_ptr m_lanc2_ram; - std::unique_ptr m_sharc_dataram; + uint8_t m_lanc2_reg[3]; + std::unique_ptr m_lanc2_ram; + std::unique_ptr m_sharc_dataram; DECLARE_WRITE32_MEMBER(paletteram32_w); DECLARE_READ32_MEMBER(sysreg_r); DECLARE_WRITE32_MEMBER(sysreg_w); @@ -325,7 +325,7 @@ public: DECLARE_DRIVER_INIT(nwktr); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_nwktr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nwktr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void lanc2_init(); }; @@ -345,7 +345,7 @@ WRITE_LINE_MEMBER(nwktr_state::voodoo_vblank_0) } -UINT32 nwktr_state::screen_update_nwktr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t nwktr_state::screen_update_nwktr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { voodoo_device *voodoo = (voodoo_device*)machine().device("voodoo0"); @@ -367,7 +367,7 @@ UINT32 nwktr_state::screen_update_nwktr(screen_device &screen, bitmap_rgb32 &bit READ32_MEMBER(nwktr_state::sysreg_r) { - UINT32 r = 0; + uint32_t r = 0; if (offset == 0) { if (ACCESSING_BITS_24_31) @@ -444,7 +444,7 @@ void nwktr_state::lanc2_init() m_fpga_uploaded = 0; m_lanc2_ram_r = 0; m_lanc2_ram_w = 0; - m_lanc2_ram = std::make_unique(0x8000); + m_lanc2_ram = std::make_unique(0x8000); } READ32_MEMBER(nwktr_state::lanc1_r) @@ -453,7 +453,7 @@ READ32_MEMBER(nwktr_state::lanc1_r) { case 0x40/4: { - UINT32 r = 0; + uint32_t r = 0; r |= (m_fpga_uploaded) ? (1 << 6) : 0; r |= 1 << 5; @@ -476,7 +476,7 @@ WRITE32_MEMBER(nwktr_state::lanc1_w) READ32_MEMBER(nwktr_state::lanc2_r) { - UINT32 r = 0; + uint32_t r = 0; if (offset == 0) { @@ -510,7 +510,7 @@ WRITE32_MEMBER(nwktr_state::lanc2_w) { if (ACCESSING_BITS_24_31) { - UINT8 value = data >> 24; + uint8_t value = data >> 24; value = ((value >> 7) & 0x01) | ((value >> 5) & 0x02) | @@ -522,7 +522,7 @@ WRITE32_MEMBER(nwktr_state::lanc2_w) ((value << 7) & 0x80); m_fpga_uploaded = 1; - m_lanc2_reg[0] = (UINT8)(data >> 24); + m_lanc2_reg[0] = (uint8_t)(data >> 24); //printf("lanc2_fpga_w: %02X at %08X\n", value, space.device().safe_pc()); } @@ -530,7 +530,7 @@ WRITE32_MEMBER(nwktr_state::lanc2_w) { m_lanc2_ram_r = 0; m_lanc2_ram_w = 0; - m_lanc2_reg[1] = (UINT8)(data >> 8); + m_lanc2_reg[1] = (uint8_t)(data >> 8); } else if (ACCESSING_BITS_16_23) { @@ -539,7 +539,7 @@ WRITE32_MEMBER(nwktr_state::lanc2_w) m_lanc2_ram[2] = (data >> 20) & 0xf; m_lanc2_ram[3] = 0; } - m_lanc2_reg[2] = (UINT8)(data >> 16); + m_lanc2_reg[2] = (uint8_t)(data >> 16); } else if (ACCESSING_BITS_0_7) { @@ -840,7 +840,7 @@ DRIVER_INIT_MEMBER(nwktr_state, nwktr) { machine().device("konppc")->set_cgboard_texture_bank(0, "bank5", memregion("user5")->base()); - m_sharc_dataram = std::make_unique(0x100000/4); + m_sharc_dataram = std::make_unique(0x100000/4); m_led_reg0 = m_led_reg1 = 0x7f; lanc2_init(); diff --git a/src/mame/drivers/nycaptor.cpp b/src/mame/drivers/nycaptor.cpp index 2e5dbd7fb91..77d57cb49fc 100644 --- a/src/mame/drivers/nycaptor.cpp +++ b/src/mame/drivers/nycaptor.cpp @@ -1340,7 +1340,7 @@ DRIVER_INIT_MEMBER(nycaptor_state,cyclshtg) DRIVER_INIT_MEMBER(nycaptor_state,bronx) { int i; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (i = 0; i < 0x20000; i++) rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7); @@ -1351,7 +1351,7 @@ DRIVER_INIT_MEMBER(nycaptor_state,bronx) DRIVER_INIT_MEMBER(nycaptor_state,colt) { int i; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (i = 0; i < 0x20000; i++) rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7); diff --git a/src/mame/drivers/nyny.cpp b/src/mame/drivers/nyny.cpp index b6dd5556216..7f1909d61e8 100644 --- a/src/mame/drivers/nyny.cpp +++ b/src/mame/drivers/nyny.cpp @@ -108,16 +108,16 @@ public: m_soundlatch3(*this, "soundlatch3") { } /* memory pointers */ - required_shared_ptr m_videoram1; - required_shared_ptr m_colorram1; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram2; + required_shared_ptr m_videoram1; + required_shared_ptr m_colorram1; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram2; /* video-related */ int m_flipscreen; - UINT8 m_star_enable; - UINT16 m_star_delay_counter; - UINT16 m_star_shift_reg; + uint8_t m_star_enable; + uint16_t m_star_delay_counter; + uint16_t m_star_shift_reg; /* devices */ required_device m_maincpu; @@ -256,11 +256,11 @@ WRITE_LINE_MEMBER(nyny_state::flipscreen_w) MC6845_UPDATE_ROW( nyny_state::crtc_update_row ) { - UINT8 x = 0; + uint8_t x = 0; - for (UINT8 cx = 0; cx < x_count; cx++) + for (uint8_t cx = 0; cx < x_count; cx++) { - UINT8 data1, data2, color1, color2; + uint8_t data1, data2, color1, color2; /* the memory is hooked up to the MA, RA lines this way */ offs_t offs = ((ma << 5) & 0x8000) | @@ -278,7 +278,7 @@ MC6845_UPDATE_ROW( nyny_state::crtc_update_row ) for (int i = 0; i < 8; i++) { - UINT8 bit1, bit2, color; + uint8_t bit1, bit2, color; if (m_flipscreen) { @@ -322,7 +322,7 @@ void nyny_state::shift_star_generator( ) MC6845_END_UPDATE( nyny_state::crtc_end_update ) { /* draw the star field into the bitmap */ - UINT16 delay_counter = m_star_delay_counter; + uint16_t delay_counter = m_star_delay_counter; for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { @@ -333,7 +333,7 @@ MC6845_END_UPDATE( nyny_state::crtc_end_update ) ((m_star_shift_reg & 0x80ff) == 0x00ff) && (((y & 0x01) ^ m_flipscreen) ^ (((x & 0x08) >> 3) ^ m_flipscreen))) { - UINT8 color = ((m_star_shift_reg & 0x0100) >> 8) | /* R */ + uint8_t color = ((m_star_shift_reg & 0x0100) >> 8) | /* R */ ((m_star_shift_reg & 0x0400) >> 9) | /* G */ ((m_star_shift_reg & 0x1000) >> 10); /* B */ @@ -404,7 +404,7 @@ WRITE8_MEMBER(nyny_state::audio_2_command_w) READ8_MEMBER(nyny_state::nyny_pia_1_2_r) { - UINT8 ret = 0; + uint8_t ret = 0; /* the address bits are directly connected to the chip selects */ if (BIT(offset, 2)) ret = m_pia1->read(space, offset & 0x03); diff --git a/src/mame/drivers/ob68k1a.cpp b/src/mame/drivers/ob68k1a.cpp index 389a9e7f409..992eb10dce7 100644 --- a/src/mame/drivers/ob68k1a.cpp +++ b/src/mame/drivers/ob68k1a.cpp @@ -199,7 +199,7 @@ void ob68k1a_state::machine_reset() // set reset vector void *ram = m_maincpu->space(AS_PROGRAM).get_write_ptr(0); - UINT8 *rom = memregion(MC68000L10_TAG)->base(); + uint8_t *rom = memregion(MC68000L10_TAG)->base(); memcpy(ram, rom, 8); diff --git a/src/mame/drivers/octopus.cpp b/src/mame/drivers/octopus.cpp index 11a4eeae55b..5d967376e85 100644 --- a/src/mame/drivers/octopus.cpp +++ b/src/mame/drivers/octopus.cpp @@ -223,8 +223,8 @@ private: required_device m_maincpu; required_device m_subcpu; required_device m_crtc; - required_shared_ptr m_vram; - required_shared_ptr m_fontram; + required_shared_ptr m_vram; + required_shared_ptr m_fontram; required_device m_dma1; required_device m_dma2; required_device m_pic1; @@ -242,23 +242,23 @@ private: required_device m_z80_bankdev; required_device m_ram; - UINT8 m_hd_bank; // HD bank select - UINT8 m_fd_bank; // Floppy bank select - UINT8 m_z80_bank; // Z80 bank / RAM refresh - INT8 m_current_dma; // current DMA channel (-1 for none) - UINT8 m_current_drive; - UINT8 m_cntl; // RTC / FDC control (PPI port B) - UINT8 m_gpo; // General purpose outputs (PPI port C) - UINT8 m_vidctrl; + uint8_t m_hd_bank; // HD bank select + uint8_t m_fd_bank; // Floppy bank select + uint8_t m_z80_bank; // Z80 bank / RAM refresh + int8_t m_current_dma; // current DMA channel (-1 for none) + uint8_t m_current_drive; + uint8_t m_cntl; // RTC / FDC control (PPI port B) + uint8_t m_gpo; // General purpose outputs (PPI port C) + uint8_t m_vidctrl; bool m_speaker_active; bool m_beep_active; bool m_speaker_level; bool m_z80_active; bool m_rtc_address; bool m_rtc_data; - UINT8 m_prev_cntl; - UINT8 m_rs232_vector; - UINT8 m_rs422_vector; + uint8_t m_prev_cntl; + uint8_t m_rs232_vector; + uint8_t m_rs422_vector; bool m_printer_busy; bool m_printer_slctout; @@ -429,7 +429,7 @@ WRITE8_MEMBER(octopus_state::system_w) READ8_MEMBER(octopus_state::system_r) { - UINT8 val = 0x00; + uint8_t val = 0x00; switch(offset) { case 0: @@ -498,7 +498,7 @@ WRITE8_MEMBER(octopus_state::z80_vector_w) // bit 3 = Address strobe? READ8_MEMBER(octopus_state::rtc_r) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; if(m_rtc_data) ret = m_rtc->read(space,1); @@ -678,7 +678,7 @@ WRITE8_MEMBER(octopus_state::parallel_w) READ8_MEMBER(octopus_state::dma_read) { - UINT8 byte; + uint8_t byte; address_space& prog_space = m_maincpu->space(AS_PROGRAM); // get the right address space if(m_current_dma == -1) return 0; @@ -705,7 +705,7 @@ WRITE_LINE_MEMBER( octopus_state::dma_hrq_changed ) // Any interrupt will also give bus control back to the 8088 IRQ_CALLBACK_MEMBER(octopus_state::x86_irq_cb) { - UINT8 vector; + uint8_t vector; m_subcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); m_z80_active = false; @@ -748,8 +748,8 @@ SCN2674_DRAW_CHARACTER_MEMBER(octopus_state::display_pixels) { if(!lg) { - UINT8 tile = m_vram[address & 0x0fff]; - UINT8 data = m_fontram[(tile * 16) + linecount]; + uint8_t tile = m_vram[address & 0x0fff]; + uint8_t data = m_fontram[(tile * 16) + linecount]; for (int z=0;z<8;z++) bitmap.pix32(y,x + z) = BIT(data,z) ? rgb_t::white : rgb_t::black; } diff --git a/src/mame/drivers/odyssey2.cpp b/src/mame/drivers/odyssey2.cpp index e3b4e65ea48..dcac941e74d 100644 --- a/src/mame/drivers/odyssey2.cpp +++ b/src/mame/drivers/odyssey2.cpp @@ -35,10 +35,10 @@ public: required_device m_i8244; required_device m_cart; - UINT8 m_ram[256]; - UINT8 m_p1; - UINT8 m_p2; - UINT8 m_lum; + uint8_t m_ram[256]; + uint8_t m_p1; + uint8_t m_p2; + uint8_t m_lum; DECLARE_READ8_MEMBER(io_read); DECLARE_WRITE8_MEMBER(io_write); DECLARE_READ8_MEMBER(bus_read); @@ -52,20 +52,20 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(odyssey2); - UINT32 screen_update_odyssey2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_odyssey2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE16_MEMBER(scanline_postprocess); protected: /* constants */ - static const UINT8 P1_BANK_LO_BIT = 0x01; - static const UINT8 P1_BANK_HI_BIT = 0x02; - static const UINT8 P1_KEYBOARD_SCAN_ENABLE = 0x04; /* active low */ - static const UINT8 P1_VDC_ENABLE = 0x08; /* active low */ - static const UINT8 P1_EXT_RAM_ENABLE = 0x10; /* active low */ - static const UINT8 P1_VPP_ENABLE = 0x20; /* active low */ - static const UINT8 P1_VDC_COPY_MODE_ENABLE = 0x40; - static const UINT8 P2_KEYBOARD_SELECT_MASK = 0x07; /* select row to scan */ + static const uint8_t P1_BANK_LO_BIT = 0x01; + static const uint8_t P1_BANK_HI_BIT = 0x02; + static const uint8_t P1_KEYBOARD_SCAN_ENABLE = 0x04; /* active low */ + static const uint8_t P1_VDC_ENABLE = 0x08; /* active low */ + static const uint8_t P1_EXT_RAM_ENABLE = 0x10; /* active low */ + static const uint8_t P1_VPP_ENABLE = 0x20; /* active low */ + static const uint8_t P1_VDC_COPY_MODE_ENABLE = 0x40; + static const uint8_t P2_KEYBOARD_SELECT_MASK = 0x07; /* select row to scan */ required_ioport_array<6> m_keyboard; required_ioport_array<2> m_joysticks; @@ -93,8 +93,8 @@ public: DECLARE_WRITE16_MEMBER(scanline_postprocess); protected: - UINT8 m_ic674_decode[8]; - UINT8 m_ic678_decode[8]; + uint8_t m_ic674_decode[8]; + uint8_t m_ic678_decode[8]; }; @@ -212,7 +212,7 @@ INPUT_PORTS_END light back / grid colors black, blue, green, light green, red, violet, yellow, light grey */ -const UINT8 odyssey2_colors[] = +const uint8_t odyssey2_colors[] = { /* Background,Grid Dim */ 0x00,0x00,0x00, /* Black */ // i r g b @@ -247,7 +247,7 @@ PALETTE_INIT_MEMBER(odyssey2_state, odyssey2) PALETTE_INIT_MEMBER(g7400_state, g7400) { - const UINT8 g7400_colors[] = + const uint8_t g7400_colors[] = { 0x00,0x00,0x00, // Black 0x1A,0x37,0xBE, // Blue @@ -277,7 +277,7 @@ PALETTE_INIT_MEMBER(g7400_state, g7400) DRIVER_INIT_MEMBER(odyssey2_state,odyssey2) { - UINT8 *gfx = memregion("gfx1")->base(); + uint8_t *gfx = memregion("gfx1")->base(); for (int i = 0; i < 256; i++) { @@ -438,7 +438,7 @@ WRITE16_MEMBER(g7400_state::scanline_postprocess) int x_real_end = i8244_device::END_ACTIVE_SCAN - i8244_device::BORDER_SIZE + 5; for ( int x = i8244_device::START_ACTIVE_SCAN; x < i8244_device::END_ACTIVE_SCAN; x++ ) { - UINT16 d = bitmap->pix16( vpos, x ); + uint16_t d = bitmap->pix16( vpos, x ); if ( ( ! m_ic678_decode[ d & 0x07 ] ) && x >= x_real_start && x < x_real_end && y >= 0 && y < 240 ) { @@ -460,7 +460,7 @@ WRITE16_MEMBER(g7400_state::scanline_postprocess) } -UINT32 odyssey2_state::screen_update_odyssey2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t odyssey2_state::screen_update_odyssey2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return m_i8244->screen_update(screen, bitmap, cliprect); } @@ -478,7 +478,7 @@ READ8_MEMBER(odyssey2_state::t1_read) READ8_MEMBER(odyssey2_state::p1_read) { - UINT8 data = m_p1; + uint8_t data = m_p1; return data; } @@ -494,7 +494,7 @@ WRITE8_MEMBER(odyssey2_state::p1_write) READ8_MEMBER(odyssey2_state::p2_read) { - UINT8 h = 0xFF; + uint8_t h = 0xFF; int i, j; if (!(m_p1 & P1_KEYBOARD_SCAN_ENABLE)) @@ -544,7 +544,7 @@ WRITE8_MEMBER(g7400_state::p2_write) READ8_MEMBER(odyssey2_state::bus_read) { - UINT8 data = 0xff; + uint8_t data = 0xff; if ((m_p2 & P2_KEYBOARD_SELECT_MASK) == 1) { diff --git a/src/mame/drivers/offtwall.cpp b/src/mame/drivers/offtwall.cpp index ab1def6cb47..1a052608e7e 100644 --- a/src/mame/drivers/offtwall.cpp +++ b/src/mame/drivers/offtwall.cpp @@ -130,8 +130,8 @@ READ16_MEMBER(offtwall_state::bankrom_r) ROM bank area, we need to return the correct value to give the proper checksum */ if ((offset == 0x3000 || offset == 0x3001) && space.device().safe_pcbase() > 0x37000) { - UINT32 checksum = (space.read_word(0x3fd210) << 16) | space.read_word(0x3fd212); - UINT32 us = 0xaaaa5555 - checksum; + uint32_t checksum = (space.read_word(0x3fd210) << 16) | space.read_word(0x3fd212); + uint32_t us = 0xaaaa5555 - checksum; if (offset == 0x3001) return us & 0xffff; else @@ -168,7 +168,7 @@ READ16_MEMBER(offtwall_state::spritecache_count_r) /* if this read is coming from $99f8 or $9992, it's in the sprite copy loop */ if (prevpc == 0x99f8 || prevpc == 0x9992) { - UINT16 *data = &m_spritecache_count[-0x100]; + uint16_t *data = &m_spritecache_count[-0x100]; int oldword = m_spritecache_count[0]; int count = oldword >> 8; int i, width = 0; @@ -474,7 +474,7 @@ DRIVER_INIT_MEMBER(offtwall_state,offtwall) m_maincpu->space(AS_PROGRAM).install_read_handler(0x037ec2, 0x037f39, read16_delegate(FUNC(offtwall_state::bankswitch_r),this)); m_maincpu->space(AS_PROGRAM).install_read_handler(0x3fdf1e, 0x3fdf1f, read16_delegate(FUNC(offtwall_state::unknown_verify_r),this)); m_spritecache_count = m_mainram + (0x3fde42 - 0x3fd800)/2; - m_bankswitch_base = (UINT16 *)(memregion("maincpu")->base() + 0x37ec2); + m_bankswitch_base = (uint16_t *)(memregion("maincpu")->base() + 0x37ec2); m_unknown_verify_base = m_mainram + (0x3fdf1e - 0x3fd800)/2; } @@ -486,7 +486,7 @@ DRIVER_INIT_MEMBER(offtwall_state,offtwalc) m_maincpu->space(AS_PROGRAM).install_read_handler(0x037eca, 0x037f43, read16_delegate(FUNC(offtwall_state::bankswitch_r),this)); m_maincpu->space(AS_PROGRAM).install_read_handler(0x3fdf24, 0x3fdf25, read16_delegate(FUNC(offtwall_state::unknown_verify_r),this)); m_spritecache_count = m_mainram + (0x3fde42 - 0x3fd800)/2; - m_bankswitch_base = (UINT16 *)(memregion("maincpu")->base() + 0x37eca); + m_bankswitch_base = (uint16_t *)(memregion("maincpu")->base() + 0x37eca); m_unknown_verify_base = m_mainram + (0x3fdf24 - 0x3fd800)/2; } diff --git a/src/mame/drivers/ojankohs.cpp b/src/mame/drivers/ojankohs.cpp index d1f5c1732b2..843b73b91d7 100644 --- a/src/mame/drivers/ojankohs.cpp +++ b/src/mame/drivers/ojankohs.cpp @@ -768,7 +768,7 @@ MACHINE_START_MEMBER(ojankohs_state,common) MACHINE_START_MEMBER(ojankohs_state,ojankohs) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0x40, &ROM[0x10000], 0x4000); @@ -777,7 +777,7 @@ MACHINE_START_MEMBER(ojankohs_state,ojankohs) MACHINE_START_MEMBER(ojankohs_state,ojankoy) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 0x20, &ROM[0x10000], 0x4000); @@ -786,7 +786,7 @@ MACHINE_START_MEMBER(ojankohs_state,ojankoy) MACHINE_START_MEMBER(ojankohs_state,ojankoc) { - UINT8 *ROM = memregion("user1")->base(); + uint8_t *ROM = memregion("user1")->base(); membank("bank1")->configure_entries(0, 0x10, &ROM[0x0000], 0x8000); diff --git a/src/mame/drivers/okean240.cpp b/src/mame/drivers/okean240.cpp index 8c66709e4d4..501bce4769f 100644 --- a/src/mame/drivers/okean240.cpp +++ b/src/mame/drivers/okean240.cpp @@ -85,15 +85,15 @@ public: DECLARE_READ8_MEMBER(okean240a_keyboard_r); DECLARE_WRITE8_MEMBER(kbd_put); DECLARE_WRITE8_MEMBER(scroll_w); - UINT8 m_term_data; - UINT8 m_j; - UINT8 m_scroll; - required_shared_ptr m_p_videoram; + uint8_t m_term_data; + uint8_t m_j; + uint8_t m_scroll; + required_shared_ptr m_p_videoram; virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; DECLARE_DRIVER_INIT(okean240); - UINT32 screen_update_okean240(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_okean240(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: optional_ioport m_io_modifiers; @@ -115,7 +115,7 @@ READ8_MEMBER( okean240_state::okean240_kbd_status_r ) // see if a key is pressed and indicate status READ8_MEMBER( okean240_state::okean240a_kbd_status_r ) { - UINT8 i,j; + uint8_t i,j; for (i = 0; i < 11; i++) { @@ -148,7 +148,7 @@ READ8_MEMBER( okean240_state::okean240_keyboard_r ) READ8_MEMBER( okean240_state::okean240a_keyboard_r ) { - UINT8 i,j; + uint8_t i,j; if (offset == 0) // port 40 (get a column) { @@ -192,7 +192,7 @@ WRITE8_MEMBER( okean240_state::okean240_keyboard_w ) // for test rom READ8_MEMBER( okean240_state::term_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -413,7 +413,7 @@ WRITE8_MEMBER( okean240_state::kbd_put ) DRIVER_INIT_MEMBER(okean240_state,okean240) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xe000); } @@ -421,15 +421,15 @@ void okean240_state::video_start() { } -UINT32 okean240_state::screen_update_okean240(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t okean240_state::screen_update_okean240(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 gfx,ma; // ma must be 8bit - UINT16 x,y; + uint8_t gfx,ma; // ma must be 8bit + uint16_t x,y; for (y = 0; y < 256; y++) { ma = y + m_scroll; - UINT16 *p = &bitmap.pix16(y); + uint16_t *p = &bitmap.pix16(y); for (x = 0; x < 0x4000; x+=0x200) { diff --git a/src/mame/drivers/olibochu.cpp b/src/mame/drivers/olibochu.cpp index 9f1a6242971..cce3d18d002 100644 --- a/src/mame/drivers/olibochu.cpp +++ b/src/mame/drivers/olibochu.cpp @@ -73,10 +73,10 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; /* devices */ required_device m_maincpu; @@ -98,7 +98,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(olibochu); - UINT32 screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(olibochu_scanline); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; @@ -107,12 +107,12 @@ public: PALETTE_INIT_MEMBER(olibochu_state, olibochu) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < palette.entries(); i++) { - UINT8 pen; + uint8_t pen; int bit0, bit1, bit2, r, g, b; if (i < 0x100) @@ -183,8 +183,8 @@ void olibochu_state::video_start() void olibochu_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) { - UINT8 *spriteram = m_spriteram; - UINT8 *spriteram_2 = m_spriteram2; + uint8_t *spriteram = m_spriteram; + uint8_t *spriteram_2 = m_spriteram2; int offs; /* 16x16 sprites */ @@ -240,7 +240,7 @@ void olibochu_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre } } -UINT32 olibochu_state::screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t olibochu_state::screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); diff --git a/src/mame/drivers/omegrace.cpp b/src/mame/drivers/omegrace.cpp index b8e34a87292..296acf8c32a 100644 --- a/src/mame/drivers/omegrace.cpp +++ b/src/mame/drivers/omegrace.cpp @@ -297,7 +297,7 @@ READ8_MEMBER(omegrace_state::omegrace_vg_go_r) * 5 4 3 2 1 0 for encoder 2 (not shifted..) */ -static const UINT8 spinnerTable[64] = +static const uint8_t spinnerTable[64] = { 0x00, 0x04, 0x14, 0x10, 0x18, 0x1c, 0x5c, 0x58, 0x50, 0x54, 0x44, 0x40, 0x48, 0x4c, 0x6c, 0x68, @@ -610,7 +610,7 @@ ROM_END DRIVER_INIT_MEMBER(omegrace_state,omegrace) { int i, len = memregion("user1")->bytes(); - UINT8 *prom = memregion("user1")->base(); + uint8_t *prom = memregion("user1")->base(); /* Omega Race has two pairs of the state PROM output * lines swapped before going into the decoder. diff --git a/src/mame/drivers/onetwo.cpp b/src/mame/drivers/onetwo.cpp index a6b480c38ce..4087d0a435a 100644 --- a/src/mame/drivers/onetwo.cpp +++ b/src/mame/drivers/onetwo.cpp @@ -66,9 +66,9 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_paletteram; - required_shared_ptr m_paletteram2; - required_shared_ptr m_fgram; + required_shared_ptr m_paletteram; + required_shared_ptr m_paletteram2; + required_shared_ptr m_fgram; /* video-related */ tilemap_t *m_fg_tilemap; @@ -90,7 +90,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_onetwo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_onetwo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void set_color(int offset); }; @@ -117,7 +117,7 @@ void onetwo_state::video_start() m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(onetwo_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); } -UINT32 onetwo_state::screen_update_onetwo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t onetwo_state::screen_update_onetwo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -347,7 +347,7 @@ GFXDECODE_END void onetwo_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/onyx.cpp b/src/mame/drivers/onyx.cpp index 182c912be03..d77d5f392eb 100644 --- a/src/mame/drivers/onyx.cpp +++ b/src/mame/drivers/onyx.cpp @@ -50,7 +50,7 @@ public: DECLARE_READ8_MEMBER(portff05_r); private: - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; required_device m_terminal; }; diff --git a/src/mame/drivers/opwolf.cpp b/src/mame/drivers/opwolf.cpp index 051439dd5a8..72853c009a0 100644 --- a/src/mame/drivers/opwolf.cpp +++ b/src/mame/drivers/opwolf.cpp @@ -423,7 +423,7 @@ ADDRESS_MAP_END /***************************************************************************/ -//static UINT8 adpcm_d[0x08]; +//static uint8_t adpcm_d[0x08]; //0 - start ROM offset LSB //1 - start ROM offset MSB //2 - end ROM offset LSB @@ -1067,7 +1067,7 @@ ROM_END DRIVER_INIT_MEMBER(opwolf_state,opwolf) { - UINT16* rom = (UINT16*)memregion("maincpu")->base(); + uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); m_opwolf_region = rom[0x03fffe / 2] & 0xff; @@ -1083,7 +1083,7 @@ DRIVER_INIT_MEMBER(opwolf_state,opwolf) DRIVER_INIT_MEMBER(opwolf_state,opwolfb) { - UINT16* rom = (UINT16*)memregion("maincpu")->base(); + uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); m_opwolf_region = rom[0x03fffe / 2] & 0xff; @@ -1096,7 +1096,7 @@ DRIVER_INIT_MEMBER(opwolf_state,opwolfb) DRIVER_INIT_MEMBER(opwolf_state,opwolfp) { - UINT16* rom = (UINT16*)memregion("maincpu")->base(); + uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); m_opwolf_region = rom[0x03fffe / 2] & 0xff; diff --git a/src/mame/drivers/orbit.cpp b/src/mame/drivers/orbit.cpp index e21c7c9b8b8..a2e1370fbaf 100644 --- a/src/mame/drivers/orbit.cpp +++ b/src/mame/drivers/orbit.cpp @@ -62,7 +62,7 @@ INTERRUPT_GEN_MEMBER(orbit_state::orbit_interrupt) * *************************************/ -void orbit_state::update_misc_flags(address_space &space, UINT8 val) +void orbit_state::update_misc_flags(address_space &space, uint8_t val) { m_misc_flags = val; @@ -87,7 +87,7 @@ void orbit_state::update_misc_flags(address_space &space, UINT8 val) WRITE8_MEMBER(orbit_state::orbit_misc_w) { - UINT8 bit = offset >> 1; + uint8_t bit = offset >> 1; if (offset & 1) update_misc_flags(space, m_misc_flags | (1 << bit)); diff --git a/src/mame/drivers/oric.cpp b/src/mame/drivers/oric.cpp index 49b3cc59874..dc2fb6b5ad3 100644 --- a/src/mame/drivers/oric.cpp +++ b/src/mame/drivers/oric.cpp @@ -77,7 +77,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_oric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_oric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void vblank_w(screen_device &screen, bool state); protected: @@ -88,7 +88,7 @@ protected: required_device m_cent_data_out; required_device m_cassette; required_device m_via; - required_shared_ptr m_ram; + required_shared_ptr m_ram; optional_memory_region m_rom; required_memory_bank m_bank_c000_r; optional_memory_bank m_bank_e000_r; @@ -100,8 +100,8 @@ protected: ioport_port *m_kbd_row[8]; int m_blink_counter; - UINT8 m_pattr; - UINT8 m_via_a, m_via_b, m_psg_a; + uint8_t m_pattr; + uint8_t m_via_a, m_via_b, m_psg_a; bool m_via_ca2, m_via_cb2, m_via_irq; bool m_ext_irq; @@ -165,13 +165,13 @@ protected: required_ioport m_joy2; floppy_image_device *m_floppies[4]; - UINT8 m_port_314; - UINT8 m_via2_a, m_via2_b; + uint8_t m_port_314; + uint8_t m_via2_a, m_via2_b; bool m_via2_ca2, m_via2_cb2, m_via2_irq; bool m_acia_irq; bool m_fdc_irq, m_fdc_drq, m_fdc_hld; - UINT8 m_junk_read[0x4000], m_junk_write[0x4000]; + uint8_t m_junk_read[0x4000], m_junk_write[0x4000]; virtual void update_irq() override; void remap(); @@ -200,31 +200,31 @@ static ADDRESS_MAP_START(telestrat_mem, AS_PROGRAM, 8, telestrat_state ) AM_RANGE( 0x0000, 0xffff) AM_RAM AM_SHARE("ram") ADDRESS_MAP_END -UINT32 oric_state::screen_update_oric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t oric_state::screen_update_oric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bool blink_state = m_blink_counter & 0x20; m_blink_counter = (m_blink_counter + 1) & 0x3f; - UINT8 pattr = m_pattr; + uint8_t pattr = m_pattr; for(int y=0; y<224; y++) { // Line attributes and current colors - UINT8 lattr = 0; - UINT32 fgcol = m_palette->pen_color(7); - UINT32 bgcol = m_palette->pen_color(0); + uint8_t lattr = 0; + uint32_t fgcol = m_palette->pen_color(7); + uint32_t bgcol = m_palette->pen_color(0); - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); for(int x=0; x<40; x++) { // Lookup the byte and, if needed, the pattern data - UINT8 ch, pat; + uint8_t ch, pat; if((pattr & PATTR_HIRES) && y < 200) ch = pat = m_ram[0xa000 + y*40 + x]; else { ch = m_ram[0xbb80 + (y>>3)*40 + x]; int off = (lattr & LATTR_DSIZE ? y >> 1 : y ) & 7; - const UINT8 *base; + const uint8_t *base; if(pattr & PATTR_HIRES) if(lattr & LATTR_ALT) base = m_ram + 0x9c00; @@ -250,8 +250,8 @@ UINT32 oric_state::screen_update_oric(screen_device &screen, bitmap_rgb32 &bitma } // Pick up the colors for the pattern - UINT32 c_fgcol = fgcol; - UINT32 c_bgcol = bgcol; + uint32_t c_fgcol = fgcol; + uint32_t c_bgcol = bgcol; // inverse video if(ch & 0x80) { @@ -435,7 +435,7 @@ WRITE8_MEMBER(telestrat_state::via2_a_w) WRITE8_MEMBER(telestrat_state::via2_b_w) { m_via2_b = data; - UINT8 port = 0xff; + uint8_t port = 0xff; if(!(m_via2_b & 0x40)) port &= m_joy1->read(); if(!(m_via2_b & 0x80)) diff --git a/src/mame/drivers/osbexec.cpp b/src/mame/drivers/osbexec.cpp index b2c73cf2462..9bd2e761bff 100644 --- a/src/mame/drivers/osbexec.cpp +++ b/src/mame/drivers/osbexec.cpp @@ -48,22 +48,22 @@ public: virtual void video_start() override; - 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); bitmap_ind16 m_bitmap; memory_region *m_fontram_region; memory_region *m_vram_region; - UINT8 *m_fontram; - UINT8 *m_vram; - UINT8 *m_ram_0000; - UINT8 *m_ram_c000; - UINT8 m_temp_attr; + uint8_t *m_fontram; + uint8_t *m_vram; + uint8_t *m_ram_0000; + uint8_t *m_ram_c000; + uint8_t m_temp_attr; emu_timer *m_video_timer; /* PIA 0 (UD12) */ - UINT8 m_pia0_porta; - UINT8 m_pia0_portb; + uint8_t m_pia0_porta; + uint8_t m_pia0_portb; int m_pia0_irq_state; int m_pia0_cb2; /* 60/50 */ @@ -71,11 +71,11 @@ public: int m_pia1_irq_state; /* Vblank counter ("RTC") */ - UINT8 m_rtc; + uint8_t m_rtc; void set_banks() { - UINT8 *ram_ptr = m_messram->pointer(); + uint8_t *ram_ptr = m_messram->pointer(); m_ram_0000 = ram_ptr; @@ -142,7 +142,7 @@ WRITE8_MEMBER(osbexec_state::osbexec_0000_w) READ8_MEMBER(osbexec_state::osbexec_c000_r) { - UINT8 data = m_ram_c000[offset]; + uint8_t data = m_ram_c000[offset]; if ( ( m_pia0_porta & 0x40 ) && offset < 0x1000 ) { @@ -166,7 +166,7 @@ WRITE8_MEMBER(osbexec_state::osbexec_c000_w) READ8_MEMBER(osbexec_state::osbexec_kbd_r) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; if ( offset & 0x0100 ) data &= ioport( "ROW0" )->read(); @@ -315,7 +315,7 @@ void osbexec_state::video_start() machine().first_screen()->register_screen_bitmap(m_bitmap); } -UINT32 osbexec_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t osbexec_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; @@ -455,16 +455,16 @@ TIMER_CALLBACK_MEMBER(osbexec_state::osbexec_video_callback) } if ( y < 240 ) { - UINT16 row_addr = ( y / 10 ) * 128; - UINT16 *p = &m_bitmap.pix16(y); - UINT8 char_line = y % 10; + uint16_t row_addr = ( y / 10 ) * 128; + uint16_t *p = &m_bitmap.pix16(y); + uint8_t char_line = y % 10; for ( int x = 0; x < 80; x++ ) { - UINT8 ch = m_vram[ row_addr + x ]; - UINT8 attr = m_vram[ 0x1000 + row_addr + x ]; - UINT8 fg_col = ( attr & 0x80 ) ? 2 : 1; - UINT8 font_bits = m_fontram[ ( ( attr & 0x10 ) ? 0x800 : 0 ) + ( ch & 0x7f ) * 16 + char_line ]; + uint8_t ch = m_vram[ row_addr + x ]; + uint8_t attr = m_vram[ 0x1000 + row_addr + x ]; + uint8_t fg_col = ( attr & 0x80 ) ? 2 : 1; + uint8_t font_bits = m_fontram[ ( ( attr & 0x10 ) ? 0x800 : 0 ) + ( ch & 0x7f ) * 16 + char_line ]; /* Check for underline */ if ( ( attr & 0x40 ) && char_line == 9 ) diff --git a/src/mame/drivers/osi.cpp b/src/mame/drivers/osi.cpp index 4a9a46f1466..cc84900606c 100644 --- a/src/mame/drivers/osi.cpp +++ b/src/mame/drivers/osi.cpp @@ -269,7 +269,7 @@ READ8_MEMBER( sb2m600_state::keyboard_r ) if (m_io_reset->read()) m_maincpu->reset(); - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(m_keylatch, 0)) data &= m_io_row0->read(); diff --git a/src/mame/drivers/othello.cpp b/src/mame/drivers/othello.cpp index e438d905725..3a244df8aa9 100644 --- a/src/mame/drivers/othello.cpp +++ b/src/mame/drivers/othello.cpp @@ -66,7 +66,7 @@ public: } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* video-related */ int m_tile_bank; @@ -74,8 +74,8 @@ public: /* misc */ int m_ay_select; int m_ack_data; - UINT8 m_n7751_command; -// UINT32 m_n7751_rom_address; + uint8_t m_n7751_command; +// uint32_t m_n7751_rom_address; int m_sound_addr; int m_n7751_busy; @@ -116,10 +116,10 @@ MC6845_UPDATE_ROW( othello_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); int cx, x; - UINT32 data_address; - UINT32 tmp; + uint32_t data_address; + uint32_t tmp; - const UINT8 *gfx = memregion("gfx")->base(); + const uint8_t *gfx = memregion("gfx")->base(); for(cx = 0; cx < x_count; ++cx) { diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp index d826646d42c..3daa286fcd4 100644 --- a/src/mame/drivers/overdriv.cpp +++ b/src/mame/drivers/overdriv.cpp @@ -43,7 +43,7 @@ ***************************************************************************/ -static const UINT16 overdriv_default_eeprom[64] = +static const uint16_t overdriv_default_eeprom[64] = { 0x7758,0xFFFF,0x0078,0x9000,0x0078,0x7000,0x0078,0x5000, 0x5441,0x4B51,0x3136,0x4655,0x4AFF,0x0300,0x0270,0x0250, @@ -186,7 +186,7 @@ WRITE16_MEMBER( overdriv_state::overdriv_k053246_word_w ) { m_k053246->k053246_word_w(space,offset,data,mem_mask); - UINT16 *src, *dst; + uint16_t *src, *dst; m_k053246->k053247_get_ram(&dst); diff --git a/src/mame/drivers/p112.cpp b/src/mame/drivers/p112.cpp index cfd312e85ec..f6f6cee8262 100644 --- a/src/mame/drivers/p112.cpp +++ b/src/mame/drivers/p112.cpp @@ -46,7 +46,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_p112(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_p112(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -75,7 +75,7 @@ void p112_state::video_start() { } -UINT32 p112_state::screen_update_p112(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t p112_state::screen_update_p112(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/p8k.cpp b/src/mame/drivers/p8k.cpp index 5ceaa9c698f..3335a839372 100644 --- a/src/mame/drivers/p8k.cpp +++ b/src/mame/drivers/p8k.cpp @@ -79,7 +79,7 @@ public: DECLARE_WRITE16_MEMBER(portff82_w); DECLARE_WRITE8_MEMBER(kbd_put); DECLARE_WRITE8_MEMBER(kbd_put_16); - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; required_device m_terminal; DECLARE_DRIVER_INIT(p8k); @@ -149,7 +149,7 @@ READ8_MEMBER( p8k_state::p8k_port0_r ) // see memory explanation above WRITE8_MEMBER( p8k_state::p8k_port0_w ) { - UINT8 breg = m_maincpu->state_int(Z80_B) >> 4; + uint8_t breg = m_maincpu->state_int(Z80_B) >> 4; if ((data==1) || (data==2) || (data==4)) { char banknum[8]; @@ -194,8 +194,8 @@ WRITE8_MEMBER( p8k_state::kbd_put ) // This is a dreadful hack.. // simulate interrupt by saving current pc on // the stack and jumping to interrupt handler. - UINT16 spreg = m_maincpu->state_int(Z80_SP); - UINT16 pcreg = m_maincpu->state_int(Z80_PC); + uint16_t spreg = m_maincpu->state_int(Z80_SP); + uint16_t pcreg = m_maincpu->state_int(Z80_PC); spreg--; mem.write_byte(spreg, pcreg >> 8); spreg--; @@ -314,7 +314,7 @@ MACHINE_RESET_MEMBER(p8k_state,p8k) DRIVER_INIT_MEMBER(p8k_state,p8k) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("bank0")->configure_entries(0, 48, &RAM[0x0000], 0x1000); membank("bank1")->configure_entries(0, 48, &RAM[0x0000], 0x1000); membank("bank2")->configure_entries(0, 48, &RAM[0x0000], 0x1000); @@ -346,8 +346,8 @@ WRITE8_MEMBER( p8k_state::kbd_put_16 ) // keyboard int handler is at 0x0700 m_term_data = data; // This is another dire hack.. - UINT8 offs = mem.read_byte(0x43a5); - UINT16 addr = 0x41b0 + (UINT16) offs; + uint8_t offs = mem.read_byte(0x43a5); + uint16_t addr = 0x41b0 + (uint16_t) offs; mem.write_byte(addr, data); mem.write_byte(0x43a0, 1); } diff --git a/src/mame/drivers/pachifev.cpp b/src/mame/drivers/pachifev.cpp index e675c180eac..1dbf4313dfe 100644 --- a/src/mame/drivers/pachifev.cpp +++ b/src/mame/drivers/pachifev.cpp @@ -102,10 +102,10 @@ public: int m_previous_power; int m_cnt; - UINT32 m_adpcm_pos; - UINT8 m_adpcm_idle; - UINT8 m_trigger; - UINT8 m_adpcm_data; + uint32_t m_adpcm_pos; + uint8_t m_adpcm_idle; + uint8_t m_trigger; + uint8_t m_adpcm_data; DECLARE_WRITE8_MEMBER(controls_w); DECLARE_READ8_MEMBER(controls_r); virtual void machine_start() override; @@ -264,7 +264,7 @@ WRITE_LINE_MEMBER(pachifev_state::pf_adpcm_int) } else { - UINT8 *ROM = memregion("adpcm")->base(); + uint8_t *ROM = memregion("adpcm")->base(); m_adpcm_data = ((m_trigger ? (ROM[m_adpcm_pos] & 0x0f) : (ROM[m_adpcm_pos] & 0xf0)>>4) ); m_msm->data_w(m_adpcm_data & 0xf); @@ -307,7 +307,7 @@ INTERRUPT_GEN_MEMBER(pachifev_state::pachifev_vblank_irq) /* (bit 5 of 0xf0aa : 0 = player 1 and 1 = player 2 - bit 6 of 0xf0aa : 0 = upright and 1 = cocktail). */ /* All I found is that in main RAM, 0xe00f.b determines the player : 0x00 = player 1 and 0x01 = player 2. */ address_space &ramspace = device.memory().space(AS_PROGRAM); - UINT8 player = 0; + uint8_t player = 0; if ((ramspace.read_byte(0xe00f) == 0x01) && ((ioport("DSW1")->read() & 0x08) == 0x00)) player = 1; diff --git a/src/mame/drivers/pacman.cpp b/src/mame/drivers/pacman.cpp index 99cc3682426..f6ee3deadd4 100644 --- a/src/mame/drivers/pacman.cpp +++ b/src/mame/drivers/pacman.cpp @@ -379,7 +379,7 @@ Boards: MACHINE_RESET_MEMBER(pacman_state,mschamp) { - UINT8 *rom = memregion("maincpu")->base() + 0x10000; + uint8_t *rom = memregion("maincpu")->base() + 0x10000; int whichbank = ioport("GAME")->read() & 1; membank("bank1")->configure_entries(0, 2, &rom[0x0000], 0x8000); @@ -677,8 +677,8 @@ WRITE8_MEMBER(pacman_state::bigbucks_bank_w) READ8_MEMBER(pacman_state::bigbucks_question_r) { - UINT8 *question = memregion("user1")->base(); - UINT8 ret; + uint8_t *question = memregion("user1")->base(); + uint8_t ret; ret = question[(m_bigbucks_bank << 16) | (offset ^ 0xffff)]; @@ -781,7 +781,7 @@ WRITE8_MEMBER(pacman_state::rocktrv2_question_bank_w) READ8_MEMBER(pacman_state::rocktrv2_question_r) { - UINT8 *question = memregion("user1")->base(); + uint8_t *question = memregion("user1")->base(); return question[offset | (m_rocktrv2_question_bank * 0x8000)]; } @@ -6799,7 +6799,7 @@ ROM_END void pacman_state::maketrax_rom_decode() { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* patch protection using a copy of the opcodes so ROM checksum */ /* tests will not fail */ @@ -6828,7 +6828,7 @@ DRIVER_INIT_MEMBER(pacman_state,maketrax) void pacman_state::korosuke_rom_decode() { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* patch protection using a copy of the opcodes so ROM checksum */ /* tests will not fail */ @@ -6861,7 +6861,7 @@ DRIVER_INIT_MEMBER(pacman_state,ponpoko) /* Here we revert it to the usual format. */ int i, j; - UINT8 *RAM, temp; + uint8_t *RAM, temp; int length = memregion("gfx1")->bytes()/2; /* Characters */ @@ -6891,10 +6891,10 @@ DRIVER_INIT_MEMBER(pacman_state,ponpoko) } } -void pacman_state::eyes_decode(UINT8 *data) +void pacman_state::eyes_decode(uint8_t *data) { int j; - UINT8 swapbuffer[8]; + uint8_t swapbuffer[8]; for (j = 0; j < 8; j++) { @@ -6910,7 +6910,7 @@ void pacman_state::eyes_decode(UINT8 *data) DRIVER_INIT_MEMBER(pacman_state,eyes) { int i, len; - UINT8 *RAM; + uint8_t *RAM; /* CPU ROMs */ @@ -6938,7 +6938,7 @@ DRIVER_INIT_MEMBER(pacman_state,eyes) #define BITSWAP11(val,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) \ BITSWAP16(val,15,14,13,12,11,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) -void pacman_state::mspacman_install_patches(UINT8 *ROM) +void pacman_state::mspacman_install_patches(uint8_t *ROM) { int i; @@ -6993,7 +6993,7 @@ void pacman_state::mspacman_install_patches(UINT8 *ROM) DRIVER_INIT_MEMBER(pacman_state,mspacman) { int i; - UINT8 *ROM, *DROM; + uint8_t *ROM, *DROM; /* CPU ROMs */ @@ -7048,7 +7048,7 @@ DRIVER_INIT_MEMBER(pacman_state, mschamp) DRIVER_INIT_MEMBER(pacman_state,woodpek) { int i, len; - UINT8 *RAM; + uint8_t *RAM; /* Graphics ROMs */ @@ -7071,7 +7071,7 @@ DRIVER_INIT_MEMBER(pacman_state,jumpshot) DRIVER_INIT_MEMBER(pacman_state,drivfrcp) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->set_base(&ROM[0 * 0x2000]); membank("bank2")->set_base(&ROM[1 * 0x2000]); membank("bank3")->set_base(&ROM[2 * 0x2000]); @@ -7080,7 +7080,7 @@ DRIVER_INIT_MEMBER(pacman_state,drivfrcp) DRIVER_INIT_MEMBER(pacman_state,8bpm) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; /* Data lines D0 and D6 swapped */ @@ -7097,7 +7097,7 @@ DRIVER_INIT_MEMBER(pacman_state,8bpm) DRIVER_INIT_MEMBER(pacman_state,porky) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; /* Data lines D0 and D4 swapped */ @@ -7120,7 +7120,7 @@ DRIVER_INIT_MEMBER(pacman_state,porky) DRIVER_INIT_MEMBER(pacman_state,rocktrv2) { /* hack to pass the rom check for the bad rom */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x7ffe] = 0xa7; ROM[0x7fee] = 0x6d; @@ -7133,8 +7133,8 @@ The select line is tied to a2; a0 and a1 of the eprom are are left out of socket and run through the 74298. Clock is tied to system clock. */ DRIVER_INIT_MEMBER(pacman_state,mspacmbe) { - UINT8 temp; - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t temp; + uint8_t *RAM = memregion("maincpu")->base(); int i; /* Address lines A1 and A0 swapped if A2=0 */ @@ -7152,7 +7152,7 @@ DRIVER_INIT_MEMBER(pacman_state,mspacmbe) READ8_MEMBER(pacman_state::mspacii_protection_r) { /* used by extra routine at $3FE, bit 4 of 504d needs to be low, and of 504e to be high */ - UINT8 data = ioport("IN1")->read(); + uint8_t data = ioport("IN1")->read(); return (data & 0xef) | (offset << 4 & 0x10); } @@ -7164,8 +7164,8 @@ DRIVER_INIT_MEMBER(pacman_state,mspacii) DRIVER_INIT_MEMBER(pacman_state,superabc) { - UINT8 *src = memregion("user1")->base(); - UINT8 *dest = memregion("gfx1")->base(); + uint8_t *src = memregion("user1")->base(); + uint8_t *dest = memregion("gfx1")->base(); // descramble gfx for (int i = 0; i < 0x10000; i++) diff --git a/src/mame/drivers/palm.cpp b/src/mame/drivers/palm.cpp index eeff23b6fbe..e7f14ee2348 100644 --- a/src/mame/drivers/palm.cpp +++ b/src/mame/drivers/palm.cpp @@ -37,8 +37,8 @@ public: required_device m_maincpu; required_device m_lsi; required_device m_ram; - UINT8 m_port_f_latch; - UINT16 m_spim_data; + uint8_t m_port_f_latch; + uint16_t m_spim_data; virtual void machine_start() override; virtual void machine_reset() override; DECLARE_INPUT_CHANGED_MEMBER(pen_check); @@ -56,7 +56,7 @@ public: required_ioport m_io_penb; required_ioport m_io_portd; - offs_t palm_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); + offs_t palm_dasm_override(device_t &device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options); }; @@ -66,7 +66,7 @@ public: INPUT_CHANGED_MEMBER(palm_state::pen_check) { - UINT8 button = m_io_penb->read(); + uint8_t button = m_io_penb->read(); if(button) m_lsi->set_penirq_line(1); @@ -76,7 +76,7 @@ INPUT_CHANGED_MEMBER(palm_state::pen_check) INPUT_CHANGED_MEMBER(palm_state::button_check) { - UINT8 button_state = m_io_portd->read(); + uint8_t button_state = m_io_portd->read(); m_lsi->set_port_d_lines(button_state, (int)(uintptr_t)param); } @@ -107,8 +107,8 @@ READ16_MEMBER(palm_state::palm_spim_in) WRITE_LINE_MEMBER(palm_state::palm_spim_exchange) { - UINT8 x = m_io_penx->read(); - UINT8 y = m_io_peny->read(); + uint8_t x = m_io_penx->read(); + uint8_t y = m_io_peny->read(); switch (m_port_f_latch & 0x0f) { @@ -136,7 +136,7 @@ void palm_state::machine_start() void palm_state::machine_reset() { // Copy boot ROM - UINT8* bios = memregion("bios")->base(); + uint8_t* bios = memregion("bios")->base(); memset(m_ram->pointer(), 0, m_ram->size()); memcpy(m_ram->pointer(), bios, 0x20000); diff --git a/src/mame/drivers/palm_dbg.hxx b/src/mame/drivers/palm_dbg.hxx index c964d96b291..05301510a79 100644 --- a/src/mame/drivers/palm_dbg.hxx +++ b/src/mame/drivers/palm_dbg.hxx @@ -1,11 +1,11 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, R. Belmont -static const char *lookup_trap(UINT16 opcode) +static const char *lookup_trap(uint16_t opcode) { static const struct { const char *name; - UINT16 trap; + uint16_t trap; } traps[] = { { "sysTrapMemInit", 0xA000 }, @@ -1162,17 +1162,17 @@ static const char *lookup_trap(UINT16 opcode) return nullptr; } -offs_t palm_state::palm_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) +offs_t palm_state::palm_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; - opcode = *((UINT16 *) oprom); + opcode = *((uint16_t *) oprom); opcode = ((opcode >> 8) & 0x00ff) | ((opcode << 8) & 0xff00); if (opcode == 0x4E4F) { - UINT16 callnum = *((UINT16 *) (oprom + 2)); + uint16_t callnum = *((uint16_t *) (oprom + 2)); callnum = ((callnum >> 8) & 0x00ff) | ((callnum << 8) & 0xff00); trap = lookup_trap(callnum); result = 2; diff --git a/src/mame/drivers/palmz22.cpp b/src/mame/drivers/palmz22.cpp index 9d3af49b602..596411c90fe 100644 --- a/src/mame/drivers/palmz22.cpp +++ b/src/mame/drivers/palmz22.cpp @@ -87,7 +87,7 @@ public: required_device m_s3c2410; nand_device *m_nand; - UINT32 m_port[8]; + uint32_t m_port[8]; DECLARE_DRIVER_INIT(palmz22); virtual void machine_start() override; virtual void machine_reset() override; @@ -138,7 +138,7 @@ WRITE8_MEMBER( palmz22_state::s3c2410_nand_address_w ) READ8_MEMBER( palmz22_state::s3c2410_nand_data_r ) { - UINT8 data = m_nand->data_r(); + uint8_t data = m_nand->data_r(); verboselog(9, "s3c2410_nand_data_r %02X\n", data); return data; } @@ -152,7 +152,7 @@ WRITE8_MEMBER( palmz22_state::s3c2410_nand_data_w ) /* READ8_MEMBER( palmz22_state::s3c2410_nand_busy_r ) { - UINT8 data = m_nand->is_busy(); + uint8_t data = m_nand->is_busy(); verboselog(9, "s3c2410_nand_busy_r %02X\n", data); return data; } @@ -162,7 +162,7 @@ READ8_MEMBER( palmz22_state::s3c2410_nand_busy_r ) READ32_MEMBER(palmz22_state::s3c2410_gpio_port_r) { - UINT32 data = m_port[offset]; + uint32_t data = m_port[offset]; switch (offset) { case S3C2410_GPIO_PORT_E : @@ -221,7 +221,7 @@ READ32_MEMBER(palmz22_state::s3c2410_core_pin_r) READ32_MEMBER(palmz22_state::s3c2410_adc_data_r ) { - UINT32 data = 0; + uint32_t data = 0; switch (offset) { case 0 + 0 : data = 0x2EE + (PALM_Z22_BATTERY_LEVEL * 0xFF / 100); break; diff --git a/src/mame/drivers/panicr.cpp b/src/mame/drivers/panicr.cpp index 8da2c984c08..4396f3b3830 100644 --- a/src/mame/drivers/panicr.cpp +++ b/src/mame/drivers/panicr.cpp @@ -87,10 +87,10 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_mainram; - required_shared_ptr m_spriteram; - required_shared_ptr m_textram; - required_shared_ptr m_spritebank; + required_shared_ptr m_mainram; + required_shared_ptr m_spriteram; + required_shared_ptr m_textram; + required_shared_ptr m_spritebank; tilemap_t *m_bgtilemap; tilemap_t *m_infotilemap_2; @@ -116,7 +116,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(panicr); - 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); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect ); TIMER_DEVICE_CALLBACK_MEMBER(scanline); @@ -136,7 +136,7 @@ public: PALETTE_INIT_MEMBER(panicr_state, panicr) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; /* create a lookup table for the palette */ @@ -155,7 +155,7 @@ PALETTE_INIT_MEMBER(panicr_state, panicr) // txt lookup table for (i = 0; i < 0x100; i++) { - UINT8 ctabentry; + uint8_t ctabentry; if (color_prom[i] & 0x40) ctabentry = 0; @@ -168,7 +168,7 @@ PALETTE_INIT_MEMBER(panicr_state, panicr) // tile lookup table for (i = 0x000; i < 0x100; i++) { - UINT8 ctabentry = (color_prom[i+0x100] & 0x3f) | 0x00; + uint8_t ctabentry = (color_prom[i+0x100] & 0x3f) | 0x00; palette.set_pen_indirect(((i&0x0f) + ((i&0xf0)<<1)) +0x200, ctabentry); palette.set_pen_indirect(((i&0x0f) + ((i&0xf0)<<1)) +0x210, ctabentry); @@ -177,7 +177,7 @@ PALETTE_INIT_MEMBER(panicr_state, panicr) // sprite lookup table for (i = 0x000; i < 0x100; i++) { - UINT8 ctabentry; + uint8_t ctabentry; if (color_prom[i+0x200] & 0x40) ctabentry = 0; @@ -282,7 +282,7 @@ void panicr_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect ) } } -UINT32 panicr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t panicr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bgtilemap->set_scrollx(0, m_scrollx); m_bgtilemap->draw(screen, *m_temprender, m_tempbitmap_clip, 0,0); @@ -298,12 +298,12 @@ UINT32 panicr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, for (int y=0;y<256;y++) { - UINT16* srcline = &m_temprender->pix16(y); - UINT16* dstline = &bitmap.pix16(y); + uint16_t* srcline = &m_temprender->pix16(y); + uint16_t* dstline = &bitmap.pix16(y); for (int x=0;x<256;x++) { - UINT16 dat = srcline[x]; + uint16_t dat = srcline[x]; dstline[x] = ((dat & 0x00f) | ((dat & 0x1e0)>>0)) + 0x200; @@ -315,12 +315,12 @@ UINT32 panicr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, for (int y=0;y<256;y++) { - UINT16* srcline = &m_temprender->pix16(y); - UINT16* dstline = &bitmap.pix16(y); + uint16_t* srcline = &m_temprender->pix16(y); + uint16_t* dstline = &bitmap.pix16(y); for (int x=0;x<256;x++) { - UINT16 dat = srcline[x]; + uint16_t dat = srcline[x]; if (dat & 0x10) dstline[x] = ((dat & 0x00f) | ((dat & 0x1e0)>>0)) + 0x200; @@ -366,8 +366,8 @@ READ8_MEMBER(panicr_state::collision_r) actual_column &= 0xff; - UINT8 ret = 0; - UINT16* srcline = &m_tempbitmap_1->pix16(actual_line); + uint8_t ret = 0; + uint16_t* srcline = &m_tempbitmap_1->pix16(actual_line); ret |= (srcline[(actual_column+0)&0xff]&3) << 6; @@ -714,8 +714,8 @@ ROM_END DRIVER_INIT_MEMBER(panicr_state,panicr) { - std::vector buf(0x80000); - UINT8 *rom; + std::vector buf(0x80000); + uint8_t *rom; int size; int i,j; diff --git a/src/mame/drivers/pasha2.cpp b/src/mame/drivers/pasha2.cpp index ad457527f55..1cb7718de67 100644 --- a/src/mame/drivers/pasha2.cpp +++ b/src/mame/drivers/pasha2.cpp @@ -91,15 +91,15 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_wram; - required_shared_ptr m_paletteram; + required_shared_ptr m_wram; + required_shared_ptr m_paletteram; /* video-related */ int m_vbuffer; /* memory */ - UINT16 m_bitmap0[0x40000/2]; - UINT16 m_bitmap1[0x40000/2]; + uint16_t m_bitmap0[0x40000/2]; + uint16_t m_bitmap1[0x40000/2]; DECLARE_WRITE16_MEMBER(pasha2_misc_w); DECLARE_WRITE16_MEMBER(pasha2_palette_w); DECLARE_WRITE16_MEMBER(vbuffer_set_w); @@ -114,7 +114,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_pasha2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pasha2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_oki1; required_device m_oki2; @@ -351,7 +351,7 @@ void pasha2_state::video_start() save_item(NAME(m_bitmap1)); } -UINT32 pasha2_state::screen_update_pasha2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pasha2_state::screen_update_pasha2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, count; int color; diff --git a/src/mame/drivers/paso1600.cpp b/src/mame/drivers/paso1600.cpp index 2418d79456f..3c5c10bb89e 100644 --- a/src/mame/drivers/paso1600.cpp +++ b/src/mame/drivers/paso1600.cpp @@ -44,22 +44,22 @@ public: DECLARE_READ8_MEMBER(key_r); DECLARE_WRITE8_MEMBER(key_w); DECLARE_READ16_MEMBER(test_hi_r); - UINT8 m_crtc_vreg[0x100],m_crtc_index; - UINT8 *m_p_chargen; - UINT8 *m_p_pcg; - required_shared_ptr m_p_vram; - required_shared_ptr m_p_gvram; + uint8_t m_crtc_vreg[0x100],m_crtc_index; + uint8_t *m_p_chargen; + uint8_t *m_p_pcg; + required_shared_ptr m_p_vram; + required_shared_ptr m_p_gvram; required_device m_gfxdecode; required_device m_palette; struct{ - UINT8 portb; + uint8_t portb; }m_keyb; DECLARE_READ8_MEMBER(pc_dma_read_byte); DECLARE_WRITE8_MEMBER(pc_dma_write_byte); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_paso1600(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_paso1600(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; #define mc6845_h_char_total (m_crtc_vreg[0]) @@ -86,12 +86,12 @@ void paso1600_state::video_start() m_p_pcg = memregion("pcg")->base(); } -UINT32 paso1600_state::screen_update_paso1600(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t paso1600_state::screen_update_paso1600(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int xi,yi; #if 0 - UINT32 count; + uint32_t count; static int test_x; if(machine().input().code_pressed(KEYCODE_Z)) diff --git a/src/mame/drivers/pasogo.cpp b/src/mame/drivers/pasogo.cpp index 463e2de34d2..39568522111 100644 --- a/src/mame/drivers/pasogo.cpp +++ b/src/mame/drivers/pasogo.cpp @@ -130,7 +130,7 @@ public: required_device m_maincpu; required_device m_cart; required_device m_ems; - required_shared_ptr m_vram; + required_shared_ptr m_vram; required_device m_palette; DECLARE_READ16_MEMBER(ems_r); @@ -142,10 +142,10 @@ public: struct { - UINT8 index; - UINT8 data[0x100]; + uint8_t index; + uint8_t data[0x100]; struct { - UINT16 data; + uint16_t data; } bios_timer; // 1.19 MHz tclk signal struct { int seconds, minutes, hours, days; @@ -164,14 +164,14 @@ public: void machine_reset() override; void machine_start() override; - UINT32 screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pasogo_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(vg230_timer); DECLARE_INPUT_CHANGED_MEMBER(contrast); memory_region *m_cart_rom; - UINT8 m_ems_index; - UINT16 m_ems_bank[28]; + uint8_t m_ems_index; + uint16_t m_ems_bank[28]; }; @@ -222,7 +222,7 @@ void pasogo_state::machine_start() READ8_MEMBER( pasogo_state::vg230_io_r ) { int log = TRUE; - UINT8 data = 0; + uint8_t data = 0; m_vg230.bios_timer.data += 0x100; //HACK if (offset&1) @@ -379,8 +379,8 @@ WRITE8_MEMBER( pasogo_state::vg230_io_w ) READ16_MEMBER( pasogo_state::ems_r ) { - UINT8 data = 0; - UINT8 index; + uint8_t data = 0; + uint8_t index; switch (offset) { @@ -399,7 +399,7 @@ READ16_MEMBER( pasogo_state::ems_r ) WRITE16_MEMBER( pasogo_state::ems_w ) { - UINT8 index; + uint8_t index; switch (offset) { @@ -488,17 +488,17 @@ INPUT_CHANGED_MEMBER(pasogo_state::contrast) } } -UINT32 pasogo_state::screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pasogo_state::screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *vram = (UINT8 *)m_vram.target(); + uint8_t *vram = (uint8_t *)m_vram.target(); int x, y; for (y=0; y<240; y++) { for (x=0; x<(320/8); x++) { int a = (y & 3) * 0x2000; - UINT8 d1 = vram[a + (y >> 2) * 80 + x]; - UINT16 *line = &bitmap.pix16(y, x << 3); + uint8_t d1 = vram[a + (y >> 2) * 80 + x]; + uint16_t *line = &bitmap.pix16(y, x << 3); *line++ = ((d1 >> 7) & 1); *line++ = ((d1 >> 6) & 1); *line++ = ((d1 >> 5) & 1); diff --git a/src/mame/drivers/pasopia.cpp b/src/mame/drivers/pasopia.cpp index c7ed456691b..95594f2387a 100644 --- a/src/mame/drivers/pasopia.cpp +++ b/src/mame/drivers/pasopia.cpp @@ -49,15 +49,15 @@ public: TIMER_CALLBACK_MEMBER(pio_timer); private: - UINT8 m_hblank; - UINT16 m_vram_addr; - UINT8 m_vram_latch; - UINT8 m_attr_latch; -// UINT8 m_gfx_mode; - UINT8 m_mux_data; + uint8_t m_hblank; + uint16_t m_vram_addr; + uint8_t m_vram_latch; + uint8_t m_attr_latch; +// uint8_t m_gfx_mode; + uint8_t m_mux_data; bool m_video_wl; bool m_ram_bank; - UINT8 *m_p_vram; + uint8_t *m_p_vram; virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; @@ -86,14 +86,14 @@ void pasopia_state::video_start() MC6845_UPDATE_ROW( pasopia_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *m_p_chargen = memregion("chargen")->base(); - UINT8 chr,gfx,fg=7,bg=0; // colours need to be determined - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t *m_p_chargen = memregion("chargen")->base(); + uint8_t chr,gfx,fg=7,bg=0; // colours need to be determined + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { - UINT8 inv=0; + uint8_t inv=0; if (x == cursor_x) inv=0xff; mem = ma + x; chr = m_p_vram[mem & 0x7ff]; @@ -181,7 +181,7 @@ READ8_MEMBER( pasopia_state::portb_1_r ) --x- ---- vblank ---x ---- LCD system mode, active low */ - UINT8 grph_latch,lcd_mode; + uint8_t grph_latch,lcd_mode; m_hblank ^= 0x40; //TODO grph_latch = (m_p_vram[m_vram_addr | 0x4000] & 0x80); @@ -218,7 +218,7 @@ READ8_MEMBER( pasopia_state::rombank_r ) READ8_MEMBER( pasopia_state::keyb_r ) { - UINT8 i,j,res = 0; + uint8_t i,j,res = 0; for (j=0; j<3; j++) { if (BIT(m_mux_data, 4+j)) @@ -270,7 +270,7 @@ DRIVER_INIT_MEMBER(pasopia_state,pasopia) We preset all banks here, so that bankswitching will incur no speed penalty. 0000 indicates ROMs, 10000 indicates RAM. */ - UINT8 *ram = memregion("maincpu")->base(); + uint8_t *ram = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ram[0x00000], 0x10000); membank("bank2")->configure_entry(0, &ram[0x10000]); diff --git a/src/mame/drivers/pasopia7.cpp b/src/mame/drivers/pasopia7.cpp index 2bb9a3ae3ea..fe8bc8fda12 100644 --- a/src/mame/drivers/pasopia7.cpp +++ b/src/mame/drivers/pasopia7.cpp @@ -81,34 +81,34 @@ public: DECLARE_DRIVER_INIT(p7_raster); DECLARE_VIDEO_START(pasopia7); DECLARE_PALETTE_INIT(p7_lcd); - UINT32 screen_update_pasopia7(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pasopia7(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: - UINT8 m_vram_sel; - UINT8 m_mio_sel; - std::unique_ptr m_p7_pal; - UINT8 m_bank_reg; - UINT16 m_cursor_addr; - UINT8 m_cursor_blink; - UINT8 m_cursor_raster; - UINT8 m_plane_reg; - UINT8 m_attr_data; - UINT8 m_attr_wrap; - UINT8 m_attr_latch; - UINT8 m_pal_sel; - UINT8 m_x_width; - UINT8 m_gfx_mode; - UINT8 m_nmi_mask; - UINT8 m_nmi_enable_reg; - UINT8 m_nmi_trap; - UINT8 m_nmi_reset; - UINT16 m_pac2_index[2]; - UINT32 m_kanji_index; - UINT8 m_pac2_bank_select; - UINT8 m_screen_type; + uint8_t m_vram_sel; + uint8_t m_mio_sel; + std::unique_ptr m_p7_pal; + uint8_t m_bank_reg; + uint16_t m_cursor_addr; + uint8_t m_cursor_blink; + uint8_t m_cursor_raster; + uint8_t m_plane_reg; + uint8_t m_attr_data; + uint8_t m_attr_wrap; + uint8_t m_attr_latch; + uint8_t m_pal_sel; + uint8_t m_x_width; + uint8_t m_gfx_mode; + uint8_t m_nmi_mask; + uint8_t m_nmi_enable_reg; + uint8_t m_nmi_trap; + uint8_t m_nmi_reset; + uint16_t m_pac2_index[2]; + uint32_t m_kanji_index; + uint8_t m_pac2_bank_select; + uint8_t m_screen_type; int m_addr_latch; void pasopia_nmi_trap(); - UINT8 m_mux_data; + uint8_t m_mux_data; virtual void machine_reset() override; void fdc_irq(bool state); void draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int width); @@ -141,12 +141,12 @@ TIMER_CALLBACK_MEMBER( pasopia7_state::pio_timer ) VIDEO_START_MEMBER(pasopia7_state,pasopia7) { - m_p7_pal = std::make_unique(0x10); + m_p7_pal = std::make_unique(0x10); } void pasopia7_state::draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int width) { - UINT8 *vram = memregion("vram")->base(); + uint8_t *vram = memregion("vram")->base(); int x,y,xi,yi; int count; @@ -177,8 +177,8 @@ void pasopia7_state::draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &clipr void pasopia7_state::draw_tv_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int width) { - UINT8 *vram = memregion("vram")->base(); - UINT8 *gfx_data = memregion("font")->base(); + uint8_t *vram = memregion("vram")->base(); + uint8_t *gfx_data = memregion("font")->base(); int x,y,xi,yi; int count; @@ -235,8 +235,8 @@ void pasopia7_state::draw_tv_screen(bitmap_ind16 &bitmap,const rectangle &clipre void pasopia7_state::draw_mixed_screen(bitmap_ind16 &bitmap,const rectangle &cliprect,int width) { - UINT8 *vram = memregion("vram")->base(); - UINT8 *gfx_data = memregion("font")->base(); + uint8_t *vram = memregion("vram")->base(); + uint8_t *gfx_data = memregion("font")->base(); int x,y,xi,yi; int count; @@ -312,7 +312,7 @@ void pasopia7_state::draw_mixed_screen(bitmap_ind16 &bitmap,const rectangle &cli } } -UINT32 pasopia7_state::screen_update_pasopia7(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pasopia7_state::screen_update_pasopia7(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int width; @@ -333,12 +333,12 @@ UINT32 pasopia7_state::screen_update_pasopia7(screen_device &screen, bitmap_ind1 READ8_MEMBER( pasopia7_state::vram_r ) { - UINT8 *vram = memregion("vram")->base(); - UINT8 res; + uint8_t *vram = memregion("vram")->base(); + uint8_t res; if (m_vram_sel == 0) { - UINT8 *work_ram = memregion("maincpu")->base(); + uint8_t *work_ram = memregion("maincpu")->base(); return work_ram[offset+0x8000]; } @@ -363,7 +363,7 @@ READ8_MEMBER( pasopia7_state::vram_r ) WRITE8_MEMBER( pasopia7_state::vram_w ) { - UINT8 *vram = memregion("vram")->base(); + uint8_t *vram = memregion("vram")->base(); if (m_vram_sel) { @@ -386,7 +386,7 @@ WRITE8_MEMBER( pasopia7_state::vram_w ) } else { - UINT8 *work_ram = memregion("maincpu")->base(); + uint8_t *work_ram = memregion("maincpu")->base(); work_ram[offset+0x8000] = data; } @@ -394,8 +394,8 @@ WRITE8_MEMBER( pasopia7_state::vram_w ) WRITE8_MEMBER( pasopia7_state::pasopia7_memory_ctrl_w ) { - UINT8 *work_ram = memregion("maincpu")->base(); - UINT8 *basic = memregion("basic")->base(); + uint8_t *work_ram = memregion("maincpu")->base(); + uint8_t *basic = memregion("basic")->base(); switch(data & 3) { @@ -450,7 +450,7 @@ WRITE8_MEMBER( pasopia7_state::pac2_w ) case 1: m_pac2_index[(m_pac2_bank_select-3) & 1] = (m_pac2_index[(m_pac2_bank_select-3) & 1] & 0xff) | ((data & 0x7f) << 8); break; case 2: // PAC2 RAM write { - UINT8 *pac2_ram; + uint8_t *pac2_ram; pac2_ram = memregion(((m_pac2_bank_select-3) & 1) ? "rampac2" : "rampac1")->base(); @@ -485,7 +485,7 @@ READ8_MEMBER( pasopia7_state::pac2_r ) { if(m_pac2_bank_select == 3 || m_pac2_bank_select == 4) { - UINT8 *pac2_ram; + uint8_t *pac2_ram; pac2_ram = memregion(((m_pac2_bank_select-3) & 1) ? "rampac2" : "rampac1")->base(); @@ -493,7 +493,7 @@ READ8_MEMBER( pasopia7_state::pac2_r ) } else if(m_pac2_bank_select == 2) { - UINT8 *kanji_rom = memregion("kanji")->base(); + uint8_t *kanji_rom = memregion("kanji")->base(); return kanji_rom[m_kanji_index]; } @@ -509,7 +509,7 @@ READ8_MEMBER( pasopia7_state::pac2_r ) /* writes always occurs to the RAM banks, even if the ROMs are selected. */ WRITE8_MEMBER( pasopia7_state::ram_bank_w ) { - UINT8 *work_ram = memregion("maincpu")->base(); + uint8_t *work_ram = memregion("maincpu")->base(); work_ram[offset] = data; } @@ -583,7 +583,7 @@ WRITE8_MEMBER( pasopia7_state::pasopia7_fdc_w ) READ8_MEMBER( pasopia7_state::pasopia7_io_r ) { - UINT16 io_port; + uint16_t io_port; if(m_mio_sel) { @@ -634,7 +634,7 @@ READ8_MEMBER( pasopia7_state::pasopia7_io_r ) WRITE8_MEMBER( pasopia7_state::pasopia7_io_w ) { - UINT16 io_port; + uint16_t io_port; if(m_mio_sel) { @@ -735,7 +735,7 @@ GFXDECODE_END READ8_MEMBER( pasopia7_state::keyb_r ) { - UINT8 i,j,res = 0; + uint8_t i,j,res = 0; for (j=0; j<3; j++) { if (BIT(m_mux_data, 4+j)) @@ -769,8 +769,8 @@ READ8_MEMBER( pasopia7_state::crtc_portb_r ) // --x- ---- vsync bit // ---x ---- hardcoded bit, defines if the system screen is raster (1) or LCD (0) // ---- x--- disp bit - UINT8 vdisp = (machine().first_screen()->vpos() < (m_screen_type ? 200 : 28)) ? 0x08 : 0x00; //TODO: check LCD vpos trigger - UINT8 vsync = vdisp ? 0x00 : 0x20; + uint8_t vdisp = (machine().first_screen()->vpos() < (m_screen_type ? 200 : 28)) ? 0x08 : 0x00; //TODO: check LCD vpos trigger + uint8_t vsync = vdisp ? 0x00 : 0x20; return 0x40 | (m_attr_latch & 0x87) | vsync | vdisp | (m_screen_type << 4); } @@ -872,7 +872,7 @@ READ8_MEMBER( pasopia7_state::nmi_portb_r ) void pasopia7_state::machine_reset() { - UINT8 *bios = memregion("maincpu")->base(); + uint8_t *bios = memregion("maincpu")->base(); membank("bank1")->set_base(bios + 0x10000); membank("bank2")->set_base(bios + 0x10000); diff --git a/src/mame/drivers/pastelg.cpp b/src/mame/drivers/pastelg.cpp index 63c9261496a..8f6650bb425 100644 --- a/src/mame/drivers/pastelg.cpp +++ b/src/mame/drivers/pastelg.cpp @@ -38,7 +38,7 @@ void pastelg_state::machine_start() READ8_MEMBER(pastelg_state::pastelg_sndrom_r) { - UINT8 *ROM = memregion("voice")->base(); + uint8_t *ROM = memregion("voice")->base(); return ROM[pastelg_blitter_src_addr_r() & 0x7fff]; } diff --git a/src/mame/drivers/patinho_feio.cpp b/src/mame/drivers/patinho_feio.cpp index 2facdc1194b..446057398ac 100644 --- a/src/mame/drivers/patinho_feio.cpp +++ b/src/mame/drivers/patinho_feio.cpp @@ -37,7 +37,7 @@ READ16_MEMBER(patinho_feio_state::buttons_r) return ioport("BUTTONS")->read(); } -void patinho_feio_state::update_panel(UINT8 ACC, UINT8 opcode, UINT8 mem_data, UINT16 mem_addr, UINT16 PC, UINT8 FLAGS, UINT16 RC, UINT8 mode){ +void patinho_feio_state::update_panel(uint8_t ACC, uint8_t opcode, uint8_t mem_data, uint16_t mem_addr, uint16_t PC, uint8_t FLAGS, uint16_t RC, uint8_t mode){ char lamp_id[11]; const char* button_names[] = { "NORMAL", @@ -157,15 +157,15 @@ WRITE8_MEMBER(patinho_feio_state::teletype_kbd_input) not use this function at all. */ void patinho_feio_state::load_tape(const char* name){ - UINT8 *RAM = (UINT8 *) memshare("maincpu:internalram")->ptr(); - UINT8 *data = memregion(name)->base(); + uint8_t *RAM = (uint8_t *) memshare("maincpu:internalram")->ptr(); + uint8_t *data = memregion(name)->base(); unsigned int data_length = data[0]; unsigned int start_address = data[1]*256 + data[2]; - INT8 expected_checksum = data[data_length + 3]; - INT8 checksum = 0; + int8_t expected_checksum = data[data_length + 3]; + int8_t checksum = 0; for (int i = 0; i < data_length + 3; i++){ - checksum -= (INT8) data[i]; + checksum -= (int8_t) data[i]; } if (checksum != expected_checksum){ @@ -177,8 +177,8 @@ void patinho_feio_state::load_tape(const char* name){ } void patinho_feio_state::load_raw_data(const char* name, unsigned int start_address, unsigned int data_length){ - UINT8 *RAM = (UINT8 *) memshare("maincpu:internalram")->ptr(); - UINT8 *data = memregion(name)->base(); + uint8_t *RAM = (uint8_t *) memshare("maincpu:internalram")->ptr(); + uint8_t *data = memregion(name)->base(); memcpy(&RAM[start_address], data, data_length); } diff --git a/src/mame/drivers/pb1000.cpp b/src/mame/drivers/pb1000.cpp index f2f2151fe07..c289c38731f 100644 --- a/src/mame/drivers/pb1000.cpp +++ b/src/mame/drivers/pb1000.cpp @@ -49,8 +49,8 @@ public: optional_device m_card2; emu_timer *m_kb_timer; - UINT8 m_kb_matrix; - UINT8 m_gatearray[2]; + uint8_t m_kb_matrix; + uint8_t m_gatearray[2]; memory_region *m_rom_reg; memory_region *m_card1_reg; @@ -67,7 +67,7 @@ public: DECLARE_READ8_MEMBER( pb1000_port_r ); DECLARE_READ8_MEMBER( pb2000c_port_r ); DECLARE_WRITE8_MEMBER( port_w ); - UINT16 read_touchscreen(UINT8 line); + uint16_t read_touchscreen(uint8_t line); DECLARE_PALETTE_INIT(pb1000); TIMER_CALLBACK_MEMBER(keyboard_timer); }; @@ -348,10 +348,10 @@ WRITE8_MEMBER( pb1000_state::lcd_data_w ) } -UINT16 pb1000_state::read_touchscreen(UINT8 line) +uint16_t pb1000_state::read_touchscreen(uint8_t line) { - UINT8 x = ioport("POSX")->read()/0x40; - UINT8 y = ioport("POSY")->read()/0x40; + uint8_t x = ioport("POSX")->read()/0x40; + uint8_t y = ioport("POSY")->read()/0x40; if (ioport("TOUCH")->read()) { @@ -366,7 +366,7 @@ UINT16 pb1000_state::read_touchscreen(UINT8 line) READ16_MEMBER( pb1000_state::pb1000_kb_r ) { static const char *const bitnames[] = {"NULL", "KO1", "KO2", "KO3", "KO4", "KO5", "KO6", "KO7", "KO8", "KO9", "KO10", "KO11", "KO12", "NULL", "NULL", "NULL"}; - UINT16 data = 0; + uint16_t data = 0; if ((m_kb_matrix & 0x0f) == 0x0d) { @@ -390,7 +390,7 @@ READ16_MEMBER( pb1000_state::pb1000_kb_r ) READ16_MEMBER( pb1000_state::pb2000c_kb_r ) { static const char *const bitnames[] = {"NULL", "KO1", "KO2", "KO3", "KO4", "KO5", "KO6", "KO7", "KO8", "KO9", "KO10", "KO11", "KO12", "NULL", "NULL", "NULL"}; - UINT16 data = 0; + uint16_t data = 0; if ((m_kb_matrix & 0x0f) == 0x0d) { diff --git a/src/mame/drivers/pbaction.cpp b/src/mame/drivers/pbaction.cpp index 824a7c8f698..0bf9eca3ce1 100644 --- a/src/mame/drivers/pbaction.cpp +++ b/src/mame/drivers/pbaction.cpp @@ -486,7 +486,7 @@ READ8_MEMBER(pbaction_state::pbactio3_prot_kludge_r) DRIVER_INIT_MEMBER(pbaction_state,pbactio3) { int i; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* first of all, do a simple bitswap */ for (i = 0; i < 0xc000; i++) diff --git a/src/mame/drivers/pc100.cpp b/src/mame/drivers/pc100.cpp index 0df23d17ee1..acd2b838c32 100644 --- a/src/mame/drivers/pc100.cpp +++ b/src/mame/drivers/pc100.cpp @@ -82,8 +82,8 @@ public: required_device m_beeper; required_device m_rtc; required_device m_palette; - required_region_ptr m_kanji_rom; - required_region_ptr m_vram; + required_region_ptr m_kanji_rom; + required_region_ptr m_vram; DECLARE_READ16_MEMBER(pc100_vram_r); DECLARE_WRITE16_MEMBER(pc100_vram_w); @@ -104,22 +104,22 @@ public: DECLARE_WRITE8_MEMBER(rtc_porta_w); DECLARE_READ8_MEMBER(rtc_portc_r); DECLARE_WRITE8_MEMBER(rtc_portc_w); - UINT16 m_kanji_addr; - UINT8 m_timer_mode; + uint16_t m_kanji_addr; + uint8_t m_timer_mode; - UINT8 m_bank_r,m_bank_w; + uint8_t m_bank_r,m_bank_w; struct{ - UINT8 shift; - UINT16 mask; - UINT16 vstart; - UINT8 addr; - UINT8 reg[8]; + uint8_t shift; + uint16_t mask; + uint16_t vstart; + uint8_t addr; + uint8_t reg[8]; }m_crtc; virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_pc100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pc100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pc100_vblank_irq); TIMER_DEVICE_CALLBACK_MEMBER(pc100_600hz_irq); TIMER_DEVICE_CALLBACK_MEMBER(pc100_100hz_irq); @@ -131,14 +131,14 @@ public: WRITE_LINE_MEMBER(rtc_portc_1_w) { m_rtc_portc = (m_rtc_portc & ~(1 << 1)) | ((state & 1) << 1); } WRITE_LINE_MEMBER(rtc_portc_2_w) { m_rtc_portc = (m_rtc_portc & ~(1 << 2)) | ((state & 1) << 2); } WRITE_LINE_MEMBER(rtc_portc_3_w) { m_rtc_portc = (m_rtc_portc & ~(1 << 3)) | ((state & 1) << 3); } - UINT8 m_rtc_portc; + uint8_t m_rtc_portc; }; void pc100_state::video_start() { } -UINT32 pc100_state::screen_update_pc100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pc100_state::screen_update_pc100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int count; @@ -181,7 +181,7 @@ READ16_MEMBER( pc100_state::pc100_vram_r ) WRITE16_MEMBER( pc100_state::pc100_vram_w ) { - UINT16 old_vram; + uint16_t old_vram; int i; for(i=0;i<4;i++) diff --git a/src/mame/drivers/pc1500.cpp b/src/mame/drivers/pc1500.cpp index 67dfa6f1e5e..170ba554176 100644 --- a/src/mame/drivers/pc1500.cpp +++ b/src/mame/drivers/pc1500.cpp @@ -35,13 +35,13 @@ public: required_device m_maincpu; required_device m_rtc; - required_shared_ptr m_lcd_data; + required_shared_ptr m_lcd_data; required_ioport_array<8> m_keyboard; required_ioport m_io_on; - UINT8 m_kb_matrix; + uint8_t m_kb_matrix; - 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); virtual void machine_reset() override; DECLARE_WRITE8_MEMBER( kb_matrix_w ); @@ -71,7 +71,7 @@ ADDRESS_MAP_END READ8_MEMBER( pc1500_state::pc1500_kb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!started()) return 0; @@ -84,14 +84,14 @@ READ8_MEMBER( pc1500_state::pc1500_kb_r ) return data; } -UINT32 pc1500_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pc1500_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); for (int p=0; p<=1; p++) for (int a=0; a<0x4e; a++) { - UINT8 data = m_lcd_data[a + (p<<8)]; + uint8_t data = m_lcd_data[a + (p<<8)]; for (int b=0; b<8; b++) { if(b<4) @@ -238,7 +238,7 @@ READ8_MEMBER( pc1500_state::port_b_r ) ---- -x-- cassette in ---- --xx connector */ - UINT8 data = 0; + uint8_t data = 0; data |= 0x08; diff --git a/src/mame/drivers/pc1512.cpp b/src/mame/drivers/pc1512.cpp index 499989b43b7..758ac61d1f1 100644 --- a/src/mame/drivers/pc1512.cpp +++ b/src/mame/drivers/pc1512.cpp @@ -108,7 +108,7 @@ PC1640-HD30: Western Digital 95038 [-chs 615,6,17 -ss 512] READ8_MEMBER( pc1512_state::system_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -274,7 +274,7 @@ WRITE8_MEMBER( pc1512_state::system_w ) READ8_MEMBER( pc1512_state::mouse_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -379,7 +379,7 @@ WRITE8_MEMBER( pc1512_state::nmi_mask_w ) READ8_MEMBER( pc1512_state::printer_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -442,7 +442,7 @@ READ8_MEMBER( pc1512_state::printer_r ) READ8_MEMBER( pc1640_state::printer_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -552,7 +552,7 @@ WRITE8_MEMBER( pc1512_state::printer_w ) READ8_MEMBER( pc1640_state::io_r ) { - UINT8 data = 0; + uint8_t data = 0; offs_t addr = offset & 0x3ff; bool decoded = false; @@ -578,7 +578,7 @@ READ8_MEMBER( pc1640_state::io_r ) } else if (!BIT(offset, 7)) { - UINT16 sw = m_sw->read(); + uint16_t sw = m_sw->read(); if (!BIT(offset, 14)) { diff --git a/src/mame/drivers/pc2000.cpp b/src/mame/drivers/pc2000.cpp index 773b60f3c6d..eb570a109c1 100644 --- a/src/mame/drivers/pc2000.cpp +++ b/src/mame/drivers/pc2000.cpp @@ -49,8 +49,8 @@ public: required_memory_bank m_bank1; optional_memory_bank m_bank2; - UINT8 m_mux_data; - UINT8 m_beep_state; + uint8_t m_mux_data; + uint8_t m_beep_state; virtual void machine_start() override; virtual void machine_reset() override; @@ -78,7 +78,7 @@ public: required_device m_lcdc_r; required_device m_lcdc_l; - 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); }; class gl4004_state : public pc2000_state @@ -121,7 +121,7 @@ READ8_MEMBER( pc2000_state::key_matrix_r ) {"IN8", "IN9", "INA", "INB", "INC", "IND", "INE", "INF"} }; - UINT8 data = 0xff; + uint8_t data = 0xff; for (int line=0; line<8; line++) if (m_mux_data & (1<screen_update(screen, bitmap, cliprect); @@ -192,7 +192,7 @@ UINT32 gl3000s_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, return 0; } -int gl3000s_sed1520_screen_update(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *vram, int start_line, int adc, int start_x) +int gl3000s_sed1520_screen_update(device_t &device, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *vram, int start_line, int adc, int start_x) { for (int y=0; y<2; y++) { @@ -222,16 +222,16 @@ SED1520_UPDATE_CB(gl3000s_screen_update_right) SED1520_UPDATE_CB(gl3000s_screen_update_left) { - UINT8 sec[5]; - UINT8 points[2][5]; + uint8_t sec[5]; + uint8_t points[2][5]; memset(sec, 0, sizeof(sec)); memset(points, 0, sizeof(points)); for (int y=0; y<2; y++) for (int x=59; x<85; x++) { - UINT8 data = vram[(y*0x50 + x) % 0x140]; - INT32 dpos = (x - 74) / 2; + uint8_t data = vram[(y*0x50 + x) % 0x140]; + int32_t dpos = (x - 74) / 2; if (dpos < 0) { dpos = 0; @@ -298,7 +298,7 @@ READ8_MEMBER( pc1000_state::kb_r ) "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8" }; - UINT8 data = 0xff; + uint8_t data = 0xff; for (int line=0; line<9; line++) if (!(offset & (1<base(); + uint8_t *bios = memregion("bios")->base(); memory_region *cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - UINT8 *cart = (cart_region != nullptr) ? cart_region->base() : memregion("bios")->base(); + uint8_t *cart = (cart_region != nullptr) ? cart_region->base() : memregion("bios")->base(); m_bank0->configure_entries(0, 0x10, bios, 0x4000); m_bank1->configure_entries(0, 0x10, bios, 0x4000); @@ -761,9 +761,9 @@ void pc2000_state::machine_start() void gl4004_state::machine_start() { std::string region_tag; - UINT8 *bios = memregion("bios")->base(); + uint8_t *bios = memregion("bios")->base(); memory_region *cart_region = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - UINT8 *cart = (cart_region != nullptr) ? cart_region->base() : memregion("bios")->base(); + uint8_t *cart = (cart_region != nullptr) ? cart_region->base() : memregion("bios")->base(); m_bank0->configure_entries(0, 0x20, bios, 0x4000); m_bank1->configure_entries(0, 0x20, bios, 0x4000); @@ -781,7 +781,7 @@ void pc2000_state::machine_reset() void pc1000_state::machine_start() { - UINT8 *bios = memregion("bios")->base(); + uint8_t *bios = memregion("bios")->base(); m_bank1->configure_entries(0, 0x08, bios, 0x4000); } @@ -814,7 +814,7 @@ GFXDECODE_END DEVICE_IMAGE_LOAD_MEMBER( pc2000_state, pc2000_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); // we always allocate a 0x40000 region, even if most carts span only 0x20000, // because the bankswitch code accesses up to 16 x 16K banks... @@ -868,7 +868,7 @@ HD44780_PIXEL_UPDATE(gl4004_state::gl4000_pixel_update) { if (pos < 40) { - static const UINT8 gl4000_display_layout[] = + static const uint8_t gl4000_display_layout[] = { 0x00, 0x01, 0x02, 0x03, 0x28, 0x29, 0x2a, 0x2b, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, @@ -876,7 +876,7 @@ HD44780_PIXEL_UPDATE(gl4004_state::gl4000_pixel_update) 0x44, 0x45, 0x46, 0x47, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f }; - UINT8 char_pos = gl4000_display_layout[line*40 + pos]; + uint8_t char_pos = gl4000_display_layout[line*40 + pos]; bitmap.pix16((char_pos / 20) * 9 + y, (char_pos % 20) * 6 + x) = state; } } diff --git a/src/mame/drivers/pc4.cpp b/src/mame/drivers/pc4.cpp index d68bc2c6170..7cd3cdab7e1 100644 --- a/src/mame/drivers/pc4.cpp +++ b/src/mame/drivers/pc4.cpp @@ -33,7 +33,7 @@ READ8_MEMBER( pc4_state::kb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int line=0; line<8; line++) { @@ -185,7 +185,7 @@ GFXDECODE_END void pc4_state::machine_start() { static const char *const bitnames[] = {"LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7"}; - UINT8* rom_base = (UINT8 *)memregion("maincpu")->base(); + uint8_t* rom_base = (uint8_t *)memregion("maincpu")->base(); m_rombank->configure_entries(0, 8, rom_base, 0x4000); m_rombank->set_entry(0); diff --git a/src/mame/drivers/pc6001.cpp b/src/mame/drivers/pc6001.cpp index 0b8aa5e782c..3578c99c9d6 100644 --- a/src/mame/drivers/pc6001.cpp +++ b/src/mame/drivers/pc6001.cpp @@ -169,38 +169,38 @@ public: required_device m_ppi; - optional_shared_ptr m_ram; - UINT8 *m_video_ram; - UINT8 m_irq_vector; - UINT8 m_cas_switch; - UINT8 m_sys_latch; - UINT8 m_timer_irq_mask; - UINT32 m_cas_offset; - UINT32 m_cas_maxsize; + optional_shared_ptr m_ram; + uint8_t *m_video_ram; + uint8_t m_irq_vector; + uint8_t m_cas_switch; + uint8_t m_sys_latch; + uint8_t m_timer_irq_mask; + uint32_t m_cas_offset; + uint32_t m_cas_maxsize; emu_timer *m_timer_irq_timer; - UINT16 m_timer_hz_div; - UINT8 m_ex_vram_bank; - UINT8 m_bgcol_bank; - UINT8 m_exgfx_text_mode; - UINT8 m_exgfx_bitmap_mode; - UINT8 m_exgfx_2bpp_mode; - UINT8 m_bank_r0; - UINT8 m_bank_r1; - UINT8 m_gfx_bank_on; - UINT8 m_bank_w; - UINT8 m_bank_opt; - UINT8 m_timer_irq_mask2; - UINT8 m_timer_irq_vector; - UINT32 m_cgrom_bank_addr; - UINT8 m_sr_video_mode; - UINT8 m_port_c_8255; - UINT8 m_cur_keycode; - UINT8 m_sr_bank_r[8]; - UINT8 m_sr_bank_w[8]; - UINT8 m_kludge; - UINT32 m_old_key1; - UINT32 m_old_key2; - UINT32 m_old_key3; + uint16_t m_timer_hz_div; + uint8_t m_ex_vram_bank; + uint8_t m_bgcol_bank; + uint8_t m_exgfx_text_mode; + uint8_t m_exgfx_bitmap_mode; + uint8_t m_exgfx_2bpp_mode; + uint8_t m_bank_r0; + uint8_t m_bank_r1; + uint8_t m_gfx_bank_on; + uint8_t m_bank_w; + uint8_t m_bank_opt; + uint8_t m_timer_irq_mask2; + uint8_t m_timer_irq_vector; + uint32_t m_cgrom_bank_addr; + uint8_t m_sr_video_mode; + uint8_t m_port_c_8255; + uint8_t m_cur_keycode; + uint8_t m_sr_bank_r[8]; + uint8_t m_sr_bank_w[8]; + uint8_t m_kludge; + uint32_t m_old_key1; + uint32_t m_old_key2; + uint32_t m_old_key3; DECLARE_WRITE8_MEMBER(pc6001_system_latch_w); DECLARE_READ8_MEMBER(nec_ppi8255_r); DECLARE_WRITE8_MEMBER(nec_ppi8255_w); @@ -251,9 +251,9 @@ public: DECLARE_MACHINE_RESET(pc6001m2); DECLARE_PALETTE_INIT(pc6001m2); DECLARE_MACHINE_RESET(pc6001sr); - UINT32 screen_update_pc6001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pc6001m2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pc6001sr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pc6001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pc6001m2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pc6001sr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pc6001_interrupt); INTERRUPT_GEN_MEMBER(pc6001sr_interrupt); TIMER_CALLBACK_MEMBER(audio_callback); @@ -296,9 +296,9 @@ protected: void draw_tile_text(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int tile,int attr,int has_mc6847); void draw_border(bitmap_ind16 &bitmap,const rectangle &cliprect,int attr,int has_mc6847); void pc6001_screen_draw(bitmap_ind16 &bitmap,const rectangle &cliprect, int has_mc6847); - UINT8 check_joy_press(); - UINT8 check_keyboard_press(); - void vram_bank_change(UINT8 vram_bank); + uint8_t check_joy_press(); + uint8_t check_keyboard_press(); + void vram_bank_change(uint8_t vram_bank); }; @@ -319,7 +319,7 @@ void pc6001_state::video_start() cfg.get_char_rom = pc6001_get_char_rom; m6847_init(machine(), &cfg); #endif - m_video_ram = auto_alloc_array(machine(), UINT8, 0x4000); + m_video_ram = auto_alloc_array(machine(), uint8_t, 0x4000); } /* this is known as gfx mode 4 */ @@ -328,13 +328,13 @@ void pc6001_state::draw_gfx_mode4(bitmap_ind16 &bitmap,const rectangle &cliprect int x,y,xi; int fgcol,color; int col_setting; - static const UINT8 pen_gattr[4][4] = { + static const uint8_t pen_gattr[4][4] = { { 0, 1, 6, 2 }, //Red / Blue { 0, 6, 1, 2 }, //Blue / Red { 0, 5, 2, 2 }, //Pink / Green { 0, 2, 5, 2 }, //Green / Pink }; - static const UINT8 pen_wattr[4][4] = { + static const uint8_t pen_wattr[4][4] = { { 0, 1, 6, 7 }, //Red / Blue { 0, 6, 1, 7 }, //Blue / Red { 0, 5, 2, 7 }, //Pink / Green @@ -472,7 +472,7 @@ void pc6001_state::draw_tile_3bpp(bitmap_ind16 &bitmap,const rectangle &cliprect void pc6001_state::draw_tile_text(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int tile,int attr,int has_mc6847) { int xi,yi,pen,fgcol,color; - UINT8 *gfx_data = m_region_gfx1->base(); + uint8_t *gfx_data = m_region_gfx1->base(); for(yi=0;yi<12;yi++) { @@ -569,14 +569,14 @@ void pc6001_state::pc6001_screen_draw(bitmap_ind16 &bitmap,const rectangle &clip } } -UINT32 pc6001_state::screen_update_pc6001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pc6001_state::screen_update_pc6001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { pc6001_screen_draw(bitmap,cliprect,1); return 0; } -UINT32 pc6001_state::screen_update_pc6001m2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pc6001_state::screen_update_pc6001m2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,tile,attr; @@ -596,7 +596,7 @@ UINT32 pc6001_state::screen_update_pc6001m2(screen_device &screen, bitmap_ind16 int pen[2]; #if 0 /* palette reference: */ - static const UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05, + static const uint8_t pal_num[] = { 0x00, 0x04, 0x01, 0x05, 0x02, 0x06, 0x03, 0x07, 0x08, 0x0c, 0x09, 0x0d, 0x0a, 0x0e, 0x0b, 0x0f }; @@ -638,7 +638,7 @@ UINT32 pc6001_state::screen_update_pc6001m2(screen_device &screen, bitmap_ind16 int pen[2]; #if 0 /* palette reference: */ - static const UINT8 pal_num[] = { 0x00, 0x04, 0x01, 0x05 }; + static const uint8_t pal_num[] = { 0x00, 0x04, 0x01, 0x05 }; color |= pal_num[(pen[0] & 1) | ((pen[1] & 1) << 1)]; #endif @@ -673,7 +673,7 @@ UINT32 pc6001_state::screen_update_pc6001m2(screen_device &screen, bitmap_ind16 else if(m_exgfx_text_mode) { int xi,yi,pen,fgcol,bgcol,color; - UINT8 *gfx_data = m_region_gfx1->base(); + uint8_t *gfx_data = m_region_gfx1->base(); for(y=0;y<20;y++) { @@ -717,11 +717,11 @@ UINT32 pc6001_state::screen_update_pc6001m2(screen_device &screen, bitmap_ind16 return 0; } -UINT32 pc6001_state::screen_update_pc6001sr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pc6001_state::screen_update_pc6001sr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,tile,attr; int xi,yi,pen,fgcol,bgcol,color; - UINT8 *gfx_data = m_region_gfx1->base(); + uint8_t *gfx_data = m_region_gfx1->base(); if(m_sr_video_mode & 8) // text mode @@ -813,7 +813,7 @@ UINT32 pc6001_state::screen_update_pc6001sr(screen_device &screen, bitmap_ind16 WRITE8_MEMBER(pc6001_state::pc6001_system_latch_w) { - static const UINT16 startaddr[] = {0xC000, 0xE000, 0x8000, 0xA000 }; + static const uint16_t startaddr[] = {0xC000, 0xE000, 0x8000, 0xA000 }; m_video_ram = m_ram + startaddr[(data >> 1) & 0x03] - 0x8000; @@ -838,10 +838,10 @@ WRITE8_MEMBER(pc6001_state::pc6001_system_latch_w) } #if 0 -ATTR_CONST pc6001_state::UINT8 pc6001_get_attributes(UINT8 c,int scanline, int pos) +ATTR_CONST pc6001_state::uint8_t pc6001_get_attributes(uint8_t c,int scanline, int pos) { - UINT8 result = 0x00; - UINT8 val = m_video_ram [(scanline / 12) * 0x20 + pos]; + uint8_t result = 0x00; + uint8_t val = m_video_ram [(scanline / 12) * 0x20 + pos]; if (val & 0x01) { result |= M6847_INV; @@ -853,14 +853,14 @@ ATTR_CONST pc6001_state::UINT8 pc6001_get_attributes(UINT8 c,int scanline, int p return result; } -const pc6001_state::UINT8 *pc6001_get_video_ram(int scanline) +const pc6001_state::uint8_t *pc6001_get_video_ram(int scanline) { return m_video_ram +0x0200+ (scanline / 12) * 0x20; } -UINT8 pc6001_state::pc6001_get_char_rom(UINT8 ch, int line) +uint8_t pc6001_state::pc6001_get_char_rom(uint8_t ch, int line) { - UINT8 *gfx = m_region_gfx1->base(); + uint8_t *gfx = m_region_gfx1->base(); return gfx[ch*16+line]; } #endif @@ -872,7 +872,7 @@ READ8_MEMBER(pc6001_state::nec_ppi8255_r) return m_port_c_8255; else if(offset==0) { - UINT8 res; + uint8_t res; res = m_cur_keycode; //m_cur_keycode = 0; return res; @@ -960,7 +960,7 @@ ADDRESS_MAP_END #define INVALID(_v_) \ 0x4c000+0x2000*_v_ /* FIXME: some comments aren't right */ -static const UINT32 banksw_table_r0[0x10*4][4] = { +static const uint32_t banksw_table_r0[0x10*4][4] = { /* 0 */ { INVALID(0), INVALID(0), INVALID(0), INVALID(0) }, //0x00: { BASICROM(0), BASICROM(1), BASICROM(2), BASICROM(3) }, //0x01: basic rom 0 & 1 / basic rom 2 & 3 @@ -1031,7 +1031,7 @@ static const UINT32 banksw_table_r0[0x10*4][4] = { { INVALID(0), INVALID(0), INVALID(0), INVALID(0) } //0x0f: }; -static const UINT32 banksw_table_r1[0x10*4][4] = { +static const uint32_t banksw_table_r1[0x10*4][4] = { /* 0 */ { INVALID(0), INVALID(0), INVALID(0), INVALID(0) }, //0x00: { BASICROM(0), BASICROM(1), BASICROM(2), BASICROM(3) }, //0x01: basic rom 0 & 1 / basic rom 2 & 3 @@ -1104,8 +1104,8 @@ static const UINT32 banksw_table_r1[0x10*4][4] = { WRITE8_MEMBER(pc6001_state::pc6001m2_bank_r0_w) { - UINT8 *ROM = m_region_maincpu->base(); - UINT8 *gfx_data = m_region_gfx1->base(); + uint8_t *ROM = m_region_maincpu->base(); + uint8_t *gfx_data = m_region_gfx1->base(); // bankaddress = 0x10000 + (0x4000 * ((data & 0x40)>>6)); // membank(1)->set_base(&ROM[bankaddress]); @@ -1124,7 +1124,7 @@ WRITE8_MEMBER(pc6001_state::pc6001m2_bank_r0_w) WRITE8_MEMBER(pc6001_state::pc6001m2_bank_r1_w) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); // bankaddress = 0x10000 + (0x4000 * ((data & 0x40)>>6)); // membank(1)->set_base(&ROM[bankaddress]); @@ -1145,8 +1145,8 @@ WRITE8_MEMBER(pc6001_state::pc6001m2_bank_w0_w) WRITE8_MEMBER(pc6001_state::pc6001m2_opt_bank_w) { - UINT8 *ROM = m_region_maincpu->base(); - UINT8 *gfx_data = m_region_gfx1->base(); + uint8_t *ROM = m_region_maincpu->base(); + uint8_t *gfx_data = m_region_gfx1->base(); /* 0 - TVROM / VOICE ROM @@ -1173,49 +1173,49 @@ WRITE8_MEMBER(pc6001_state::pc6001m2_opt_bank_w) WRITE8_MEMBER(pc6001_state::work_ram0_w) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); ROM[offset+((m_bank_w & 0x01) ? WRAM(0) : EXWRAM(0))] = data; } WRITE8_MEMBER(pc6001_state::work_ram1_w) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); ROM[offset+((m_bank_w & 0x01) ? WRAM(1) : EXWRAM(1))] = data; } WRITE8_MEMBER(pc6001_state::work_ram2_w) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); ROM[offset+((m_bank_w & 0x04) ? WRAM(2) : EXWRAM(2))] = data; } WRITE8_MEMBER(pc6001_state::work_ram3_w) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); ROM[offset+((m_bank_w & 0x04) ? WRAM(3) : EXWRAM(3))] = data; } WRITE8_MEMBER(pc6001_state::work_ram4_w) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); ROM[offset+((m_bank_w & 0x10) ? WRAM(4) : EXWRAM(4))] = data; } WRITE8_MEMBER(pc6001_state::work_ram5_w) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); ROM[offset+((m_bank_w & 0x10) ? WRAM(5) : EXWRAM(5))] = data; } WRITE8_MEMBER(pc6001_state::work_ram6_w) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); ROM[offset+((m_bank_w & 0x40) ? WRAM(6) : EXWRAM(6))] = data; } WRITE8_MEMBER(pc6001_state::work_ram7_w) { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); ROM[offset+((m_bank_w & 0x40) ? WRAM(7) : EXWRAM(7))] = data; } @@ -1240,8 +1240,8 @@ WRITE8_MEMBER(pc6001_state::necmk2_ppi8255_w) m_port_c_8255 |= 0xa8; { - UINT8 *ROM = m_region_maincpu->base(); - UINT8 *gfx_data = m_region_gfx1->base(); + uint8_t *ROM = m_region_maincpu->base(); + uint8_t *gfx_data = m_region_gfx1->base(); //printf("%02x\n",data); @@ -1260,9 +1260,9 @@ WRITE8_MEMBER(pc6001_state::necmk2_ppi8255_w) m_ppi->write(space,offset,data); } -void pc6001_state::vram_bank_change(UINT8 vram_bank) +void pc6001_state::vram_bank_change(uint8_t vram_bank) { - UINT8 *work_ram = m_region_maincpu->base(); + uint8_t *work_ram = m_region_maincpu->base(); // popmessage("%02x",vram_bank); @@ -1315,7 +1315,7 @@ WRITE8_MEMBER(pc6001_state::pc6001m2_system_latch_w) WRITE8_MEMBER(pc6001_state::pc6001m2_vram_bank_w) { - //static const UINT32 startaddr[] = {WRAM(6), WRAM(6), WRAM(0), WRAM(4) }; + //static const uint32_t startaddr[] = {WRAM(6), WRAM(6), WRAM(0), WRAM(4) }; m_ex_vram_bank = data; vram_bank_change((m_ex_vram_bank & 0x06) | ((m_sys_latch & 0x06) << 4)); @@ -1522,8 +1522,8 @@ READ8_MEMBER(pc6001_state::pc6001sr_bank_rn_r) WRITE8_MEMBER(pc6001_state::pc6001sr_bank_rn_w) { memory_bank *bank[8] = { m_bank1, m_bank2, m_bank3, m_bank4, m_bank5, m_bank6, m_bank7, m_bank8 }; - UINT8 *ROM = m_region_maincpu->base(); - UINT8 bank_num; + uint8_t *ROM = m_region_maincpu->base(); + uint8_t bank_num; m_sr_bank_r[offset] = data; bank_num = data & 0x0f; @@ -1553,8 +1553,8 @@ WRITE8_MEMBER(pc6001_state::pc6001sr_bank_wn_w) #define SR_WRAM_BANK_W(_v_) \ { \ - UINT8 *ROM = m_region_maincpu->base(); \ - UINT8 bank_num; \ + uint8_t *ROM = m_region_maincpu->base(); \ + uint8_t bank_num; \ bank_num = m_sr_bank_w[_v_] & 0x0f; \ if((m_sr_bank_w[_v_] & 0xf0) != 0x20) \ ROM[offset+(SR_WRAM0(bank_num))] = data; \ @@ -1580,7 +1580,7 @@ WRITE8_MEMBER(pc6001_state::pc6001sr_mode_w) WRITE8_MEMBER(pc6001_state::pc6001sr_vram_bank_w) { - UINT8 *work_ram = m_region_maincpu->base(); + uint8_t *work_ram = m_region_maincpu->base(); m_video_ram = work_ram + 0x70000 + ((data & 0x0f)*0x1000); } @@ -1897,10 +1897,10 @@ READ8_MEMBER(pc6001_state::pc6001_8255_portc_r) return 0x88; } -UINT8 pc6001_state::check_keyboard_press() +uint8_t pc6001_state::check_keyboard_press() { int i,port_i,scancode; - UINT8 shift_pressed,caps_lock; + uint8_t shift_pressed,caps_lock; scancode = 0; shift_pressed = (m_io_key_modifiers->read() & 2)>>1; @@ -1939,12 +1939,12 @@ UINT8 pc6001_state::check_keyboard_press() return 0; } -UINT8 pc6001_state::check_joy_press() +uint8_t pc6001_state::check_joy_press() { - UINT8 p1_key = m_io_p1->read() ^ 0xff; - UINT8 shift_key = m_io_key_modifiers->read() & 0x02; - UINT8 space_key = m_io_keys[1]->read() & 0x01; - UINT8 joy_press; + uint8_t p1_key = m_io_p1->read() ^ 0xff; + uint8_t shift_key = m_io_key_modifiers->read() & 0x02; + uint8_t space_key = m_io_keys[1]->read() & 0x01; + uint8_t joy_press; /* PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY @@ -1982,7 +1982,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(pc6001_state::cassette_callback) if(m_cas_switch == 1) { #if 0 - static UINT8 cas_data_i = 0x80,cas_data_poll; + static uint8_t cas_data_i = 0x80,cas_data_poll; //m_cur_keycode = gfx_data[m_cas_offset++]; if(m_cassette->input() > 0.03) cas_data_poll|= cas_data_i; @@ -2022,10 +2022,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(pc6001_state::cassette_callback) TIMER_DEVICE_CALLBACK_MEMBER(pc6001_state::keyboard_callback) { - UINT32 key1 = m_io_keys[0]->read(); - UINT32 key2 = m_io_keys[1]->read(); - UINT32 key3 = m_io_keys[2]->read(); -// UINT8 p1_key = m_io_p1->read(); + uint32_t key1 = m_io_keys[0]->read(); + uint32_t key2 = m_io_keys[1]->read(); + uint32_t key3 = m_io_keys[2]->read(); +// uint8_t p1_key = m_io_p1->read(); if(m_cas_switch == 0) { @@ -2102,7 +2102,7 @@ MACHINE_RESET_MEMBER(pc6001_state,pc6001m2) /* set default bankswitch */ { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); m_bank_r0 = 0x71; m_bank1->set_base(&ROM[BASICROM(0)]); m_bank2->set_base(&ROM[BASICROM(1)]); @@ -2139,7 +2139,7 @@ MACHINE_RESET_MEMBER(pc6001_state,pc6001sr) /* set default bankswitch */ { - UINT8 *ROM = m_region_maincpu->base(); + uint8_t *ROM = m_region_maincpu->base(); m_sr_bank_r[0] = 0xf8; m_bank1->set_base(&ROM[SR_SYSROM_1(0x08)]); m_sr_bank_r[1] = 0xfa; m_bank2->set_base(&ROM[SR_SYSROM_1(0x0a)]); m_sr_bank_r[2] = 0xb0; m_bank3->set_base(&ROM[SR_EXROM1(0x00)]); diff --git a/src/mame/drivers/pc8001.cpp b/src/mame/drivers/pc8001.cpp index 031bbf388b4..1394270f1af 100644 --- a/src/mame/drivers/pc8001.cpp +++ b/src/mame/drivers/pc8001.cpp @@ -126,7 +126,7 @@ READ8_MEMBER( pc8001_state::port40_r ) */ - UINT8 data = 0x08; + uint8_t data = 0x08; data |= m_centronics_busy; data |= m_centronics_ack << 1; @@ -366,7 +366,7 @@ static const rgb_t PALETTE_PC8001[] = UPD3301_DRAW_CHARACTER_MEMBER( pc8001_state::pc8001_display_pixels ) { - UINT8 data = m_char_rom->base()[(cc << 3) | lc]; + uint8_t data = m_char_rom->base()[(cc << 3) | lc]; int i; if (lc >= 8) return; @@ -431,7 +431,7 @@ void pc8001_state::machine_start() m_dma->ready_w(1); /* setup memory banking */ - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); membank("bank1")->configure_entry(1, m_rom->base()); program.install_read_bank(0x0000, 0x5fff, "bank1"); diff --git a/src/mame/drivers/pc8401a.cpp b/src/mame/drivers/pc8401a.cpp index c2c6c179151..bfc0dfcb7b4 100644 --- a/src/mame/drivers/pc8401a.cpp +++ b/src/mame/drivers/pc8401a.cpp @@ -44,7 +44,7 @@ void pc8401a_state::scan_keyboard() /* scan keyboard */ for (int row = 0; row < 10; row++) { - UINT8 data = m_io_y[row]->read(); + uint8_t data = m_io_y[row]->read(); if (data != 0xff) { @@ -70,7 +70,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(pc8401a_state::pc8401a_keyboard_tick) /* Read/Write Handlers */ -void pc8401a_state::bankswitch(UINT8 data) +void pc8401a_state::bankswitch(uint8_t data) { address_space &program = m_maincpu->space(AS_PROGRAM); @@ -497,7 +497,7 @@ void pc8401a_state::machine_start() /* allocate CRT video RAM */ m_crt_ram.allocate(PC8401A_CRT_VIDEORAM_SIZE); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); /* set up A0/A1 memory banking */ membank("bank1")->configure_entries(0, 4, m_rom->base(), 0x8000); diff --git a/src/mame/drivers/pc8801.cpp b/src/mame/drivers/pc8801.cpp index 1ac5739743d..3cc9201134d 100644 --- a/src/mame/drivers/pc8801.cpp +++ b/src/mame/drivers/pc8801.cpp @@ -286,15 +286,15 @@ struct crtc_t { - UINT8 cmd,param_count,cursor_on,status,irq_mask; - UINT8 param[8][5]; - UINT8 inverse; + uint8_t cmd,param_count,cursor_on,status,irq_mask; + uint8_t param[8][5]; + uint8_t inverse; }; struct mouse_t { - UINT8 phase; - UINT8 x,y; + uint8_t phase; + uint8_t x,y; attotime time; }; @@ -324,65 +324,65 @@ public: required_device m_opn; required_device m_palette; - std::unique_ptr m_work_ram; - std::unique_ptr m_hi_work_ram; - std::unique_ptr m_ext_work_ram; - std::unique_ptr m_gvram; - UINT8 *m_n80rom; - UINT8 *m_n88rom; - UINT8 *m_kanji_rom; - UINT8 *m_cg_rom; - - UINT8 m_i8255_0_pc; - UINT8 m_i8255_1_pc; - UINT8 m_fdc_irq_opcode; - UINT8 m_ext_rom_bank; - UINT8 m_gfx_ctrl; - UINT8 m_vram_sel; - UINT8 m_misc_ctrl; - UINT8 m_device_ctrl_data; - UINT8 m_window_offset_bank; - UINT8 m_layer_mask; - UINT16 m_dma_counter[4]; - UINT16 m_dma_address[4]; - UINT8 m_alu_reg[3]; - UINT8 m_dmac_mode; - UINT8 m_alu_ctrl1; - UINT8 m_alu_ctrl2; - UINT8 m_extram_mode; - UINT8 m_extram_bank; - UINT8 m_txt_width; - UINT8 m_txt_color; + std::unique_ptr m_work_ram; + std::unique_ptr m_hi_work_ram; + std::unique_ptr m_ext_work_ram; + std::unique_ptr m_gvram; + uint8_t *m_n80rom; + uint8_t *m_n88rom; + uint8_t *m_kanji_rom; + uint8_t *m_cg_rom; + + uint8_t m_i8255_0_pc; + uint8_t m_i8255_1_pc; + uint8_t m_fdc_irq_opcode; + uint8_t m_ext_rom_bank; + uint8_t m_gfx_ctrl; + uint8_t m_vram_sel; + uint8_t m_misc_ctrl; + uint8_t m_device_ctrl_data; + uint8_t m_window_offset_bank; + uint8_t m_layer_mask; + uint16_t m_dma_counter[4]; + uint16_t m_dma_address[4]; + uint8_t m_alu_reg[3]; + uint8_t m_dmac_mode; + uint8_t m_alu_ctrl1; + uint8_t m_alu_ctrl2; + uint8_t m_extram_mode; + uint8_t m_extram_bank; + uint8_t m_txt_width; + uint8_t m_txt_color; #ifdef USE_PROPER_I8214 - UINT8 m_timer_irq_mask; - UINT8 m_vblank_irq_mask; - UINT8 m_sound_irq_mask; - UINT8 m_int_state; + uint8_t m_timer_irq_mask; + uint8_t m_vblank_irq_mask; + uint8_t m_sound_irq_mask; + uint8_t m_int_state; #else - UINT8 m_i8214_irq_level; - UINT8 m_vrtc_irq_mask; - UINT8 m_vrtc_irq_latch; - UINT8 m_timer_irq_mask; - UINT8 m_timer_irq_latch; - UINT8 m_sound_irq_mask; - UINT8 m_sound_irq_latch; - UINT8 m_sound_irq_pending; + uint8_t m_i8214_irq_level; + uint8_t m_vrtc_irq_mask; + uint8_t m_vrtc_irq_latch; + uint8_t m_timer_irq_mask; + uint8_t m_timer_irq_latch; + uint8_t m_sound_irq_mask; + uint8_t m_sound_irq_latch; + uint8_t m_sound_irq_pending; #endif - UINT8 m_has_clock_speed; - UINT8 m_clock_setting; - UINT8 m_baudrate_val; - UINT8 m_has_dictionary; - UINT8 m_dic_ctrl; - UINT8 m_dic_bank; - UINT8 m_has_cdrom; - UINT8 m_cdrom_reg[0x10]; + uint8_t m_has_clock_speed; + uint8_t m_clock_setting; + uint8_t m_baudrate_val; + uint8_t m_has_dictionary; + uint8_t m_dic_ctrl; + uint8_t m_dic_bank; + uint8_t m_has_cdrom; + uint8_t m_cdrom_reg[0x10]; crtc_t m_crtc; mouse_t m_mouse; - struct { UINT8 r, g, b; } m_palram[8]; - UINT8 m_dmac_ff; - UINT32 m_knj_addr[2]; - UINT32 m_extram_size; - UINT8 m_has_opna; + struct { uint8_t r, g, b; } m_palram[8]; + uint8_t m_dmac_ff; + uint32_t m_knj_addr[2]; + uint32_t m_extram_size; + uint8_t m_has_opna; DECLARE_READ8_MEMBER(pc8801_alu_r); DECLARE_WRITE8_MEMBER(pc8801_alu_w); @@ -458,17 +458,17 @@ public: DECLARE_READ8_MEMBER(pc8801_unk_r); DECLARE_WRITE8_MEMBER(pc8801_unk_w); - UINT8 pc8801_pixel_clock(void); + uint8_t pc8801_pixel_clock(void); void pc8801_dynamic_res_change(void); void draw_bitmap_3bpp(bitmap_ind16 &bitmap,const rectangle &cliprect); void draw_bitmap_1bpp(bitmap_ind16 &bitmap,const rectangle &cliprect); - UINT8 calc_cursor_pos(int x,int y,int yi); - UINT8 extract_text_attribute(UINT32 address,int x, UINT8 width, UINT8 &non_special); - void pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UINT8 gfx_mode,UINT8 reverse,UINT8 secret, - UINT8 blink,UINT8 upper,UINT8 lower,int y_size,int width, UINT8 non_special); - void draw_text(bitmap_ind16 &bitmap,int y_size, UINT8 width); + uint8_t calc_cursor_pos(int x,int y,int yi); + uint8_t extract_text_attribute(uint32_t address,int x, uint8_t width, uint8_t &non_special); + void pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,uint8_t gfx_mode,uint8_t reverse,uint8_t secret, + uint8_t blink,uint8_t upper,uint8_t lower,int y_size,int width, uint8_t non_special); + void draw_text(bitmap_ind16 &bitmap,int y_size, uint8_t width); - 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); DECLARE_PALETTE_INIT(pc8801); protected: @@ -537,9 +537,9 @@ void pc8801_state::video_start() void pc8801_state::draw_bitmap_3bpp(bitmap_ind16 &bitmap,const rectangle &cliprect) { int x,y,xi; - UINT32 count; - UINT16 y_size; - UINT16 y_double; + uint32_t count; + uint16_t y_size; + uint16_t y_double; count = 0; @@ -584,9 +584,9 @@ void pc8801_state::draw_bitmap_3bpp(bitmap_ind16 &bitmap,const rectangle &clipre void pc8801_state::draw_bitmap_1bpp(bitmap_ind16 &bitmap,const rectangle &cliprect) { int x,y,xi; - UINT32 count; - UINT8 color; - UINT8 is_cursor; + uint32_t count; + uint8_t color; + uint8_t is_cursor; count = 0; color = (m_gfx_ctrl & 1) ? 7 & ((m_layer_mask ^ 0xe) >> 1) : 7; @@ -655,7 +655,7 @@ void pc8801_state::draw_bitmap_1bpp(bitmap_ind16 &bitmap,const rectangle &clipre } } -UINT8 pc8801_state::calc_cursor_pos(int x,int y,int yi) +uint8_t pc8801_state::calc_cursor_pos(int x,int y,int yi) { if(!(m_crtc.cursor_on)) // don't bother if cursor is off return 0; @@ -681,9 +681,9 @@ UINT8 pc8801_state::calc_cursor_pos(int x,int y,int yi) -UINT8 pc8801_state::extract_text_attribute(UINT32 address,int x, UINT8 width, UINT8 &non_special) +uint8_t pc8801_state::extract_text_attribute(uint32_t address,int x, uint8_t width, uint8_t &non_special) { - UINT8 *vram = m_work_ram.get(); + uint8_t *vram = m_work_ram.get(); int i; int fifo_size; int offset; @@ -719,13 +719,13 @@ UINT8 pc8801_state::extract_text_attribute(UINT32 address,int x, UINT8 width, UI return vram[address-3+offset]; } -void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UINT8 gfx_mode,UINT8 reverse,UINT8 secret,UINT8 blink,UINT8 upper,UINT8 lower,int y_size,int width, UINT8 non_special) +void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,uint8_t gfx_mode,uint8_t reverse,uint8_t secret,uint8_t blink,uint8_t upper,uint8_t lower,int y_size,int width, uint8_t non_special) { int xi,yi; - UINT8 *vram = m_work_ram.get(); - UINT8 is_cursor; - UINT8 y_height, y_double; - UINT8 y_step; + uint8_t *vram = m_work_ram.get(); + uint8_t is_cursor; + uint8_t y_height, y_double; + uint8_t y_step; y_height = lines_per_char; y_double = (pc8801_pixel_clock()); @@ -754,7 +754,7 @@ void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UIN if(gfx_mode) { - UINT8 mask; + uint8_t mask; mask = (xi & 4) ? 0x10 : 0x01; mask <<= ((yi & (0x6 << y_double)) >> (1+y_double)); @@ -762,8 +762,8 @@ void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UIN } else { - UINT8 char_data; - UINT8 blink_mask; + uint8_t char_data; + uint8_t blink_mask; blink_mask = 0; if(blink && ((machine().first_screen()->frame_number() / blink_speed) & 3) == 1) @@ -805,18 +805,18 @@ void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UIN } } -void pc8801_state::draw_text(bitmap_ind16 &bitmap,int y_size, UINT8 width) +void pc8801_state::draw_text(bitmap_ind16 &bitmap,int y_size, uint8_t width) { int x,y; - UINT8 attr; - UINT8 reverse; - UINT8 gfx_mode; - UINT8 secret; - UINT8 upper; - UINT8 lower; - UINT8 blink; + uint8_t attr; + uint8_t reverse; + uint8_t gfx_mode; + uint8_t secret; + uint8_t upper; + uint8_t lower; + uint8_t blink; int pal; - UINT8 non_special; + uint8_t non_special; for(y=0;ypen(0), cliprect); @@ -889,7 +889,7 @@ UINT32 pc8801_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, READ8_MEMBER(pc8801_state::pc8801_alu_r) { int i; - UINT8 b,r,g; + uint8_t b,r,g; /* store data to ALU regs */ for(i=0;i<3;i++) @@ -913,7 +913,7 @@ WRITE8_MEMBER(pc8801_state::pc8801_alu_w) { case 0x00: //logic operation { - UINT8 logic_op; + uint8_t logic_op; for(i=0;i<3;i++) { @@ -1004,14 +1004,14 @@ WRITE8_MEMBER(pc8801_state::pc8801_high_wram_w) READ8_MEMBER(pc8801_state::pc8801ma_dic_r) { - UINT8 *dic_rom = memregion("dictionary")->base(); + uint8_t *dic_rom = memregion("dictionary")->base(); return dic_rom[offset]; } READ8_MEMBER(pc8801_state::pc8801_cdbios_rom_r) { - UINT8 *cdrom_bios = memregion("cdrom")->base(); + uint8_t *cdrom_bios = memregion("cdrom")->base(); return cdrom_bios[offset]; } @@ -1039,7 +1039,7 @@ READ8_MEMBER(pc8801_state::pc8801_mem_r) } else if(offset >= 0x8000 && offset <= 0x83ff) // work RAM window { - UINT32 window_offset; + uint32_t window_offset; if(m_gfx_ctrl & 6) //wram read select or n basic select banks this as normal wram return pc8801_wram_r(space,offset); @@ -1103,7 +1103,7 @@ WRITE8_MEMBER(pc8801_state::pc8801_mem_w) pc8801_wram_w(space,offset,data); else { - UINT32 window_offset; + uint32_t window_offset; window_offset = (offset & 0x3ff) + (m_window_offset_bank << 8); @@ -1234,7 +1234,7 @@ WRITE8_MEMBER(pc8801_state::pc8801_ext_rom_bank_w) m_ext_rom_bank = data; } -UINT8 pc8801_state::pc8801_pixel_clock(void) +uint8_t pc8801_state::pc8801_pixel_clock(void) { int ysize = machine().first_screen()->height(); /* TODO: correct condition*/ @@ -2248,7 +2248,7 @@ static const cassette_interface pc88_cassette_interface = #endif #ifdef USE_PROPER_I8214 -void pc8801_state::pc8801_raise_irq(UINT8 irq,UINT8 state) +void pc8801_state::pc8801_raise_irq(uint8_t irq,uint8_t state) { if(state) { @@ -2290,7 +2290,7 @@ static I8214_INTERFACE( pic_intf ) IRQ_CALLBACK_MEMBER(pc8801_state::pc8801_irq_callback) { - UINT8 vector = (7 - m_pic->a_r()); + uint8_t vector = (7 - m_pic->a_r()); m_int_state &= ~(1<set_input_line(0,CLEAR_LINE); @@ -2394,10 +2394,10 @@ void pc8801_state::machine_start() m_rtc->cs_w(1); m_rtc->oe_w(1); - m_work_ram = make_unique_clear(0x10000); - m_hi_work_ram = make_unique_clear(0x1000); - m_ext_work_ram = make_unique_clear(0x8000*0x100); - m_gvram = make_unique_clear(0xc000); + m_work_ram = make_unique_clear(0x10000); + m_hi_work_ram = make_unique_clear(0x1000); + m_ext_work_ram = make_unique_clear(0x8000*0x100); + m_gvram = make_unique_clear(0xc000); m_n80rom = memregion("n80rom")->base(); m_n88rom = memregion("n88rom")->base(); m_kanji_rom = memregion("kanji")->base(); @@ -2413,7 +2413,7 @@ void pc8801_state::machine_reset() { #define kB 1024 #define MB 1024*1024 - const UINT32 extram_type[] = { 0*kB, 32*kB,64*kB,128*kB,128*kB,256*kB,512*kB,1*MB,2*MB,4*MB,8*MB,1*MB+128*kB,2*MB+128*kB,4*MB+128*kB, 0*kB, 0*kB }; + const uint32_t extram_type[] = { 0*kB, 32*kB,64*kB,128*kB,128*kB,256*kB,512*kB,1*MB,2*MB,4*MB,8*MB,1*MB+128*kB,2*MB+128*kB,4*MB+128*kB, 0*kB, 0*kB }; #undef kB #undef MB @@ -2539,7 +2539,7 @@ READ8_MEMBER(pc8801_state::opn_porta_r) { if(ioport("BOARD_CONFIG")->read() & 2) { - UINT8 shift,res; + uint8_t shift,res; shift = (m_mouse.phase & 1) ? 0 : 4; res = (m_mouse.phase & 2) ? m_mouse.y : m_mouse.x; diff --git a/src/mame/drivers/pc88va.cpp b/src/mame/drivers/pc88va.cpp index e27944a5040..00a4273e0d1 100644 --- a/src/mame/drivers/pc88va.cpp +++ b/src/mame/drivers/pc88va.cpp @@ -42,18 +42,18 @@ struct tsp_t { - UINT16 tvram_vreg_offset; - UINT16 attr_offset; - UINT16 spr_offset; - UINT8 disp_on; - UINT8 spr_on; - UINT8 pitch; - UINT8 line_height; - UINT8 h_line_pos; - UINT8 blink; - UINT16 cur_pos_x,cur_pos_y; - UINT8 curn; - UINT8 curn_blink; + uint16_t tvram_vreg_offset; + uint16_t attr_offset; + uint16_t spr_offset; + uint8_t disp_on; + uint8_t spr_on; + uint8_t pitch; + uint8_t line_height; + uint8_t h_line_pos; + uint8_t blink; + uint16_t cur_pos_x,cur_pos_y; + uint8_t curn; + uint8_t curn_blink; }; @@ -81,26 +81,26 @@ public: required_device m_maincpu; required_device m_fdc; required_device m_dmac; - required_shared_ptr m_palram; - UINT16 m_bank_reg; - UINT16 m_screen_ctrl_reg; - UINT8 m_timer3_io_reg; + required_shared_ptr m_palram; + uint16_t m_bank_reg; + uint16_t m_screen_ctrl_reg; + uint8_t m_timer3_io_reg; emu_timer *m_t3_mouse_timer; tsp_t m_tsp; - UINT16 m_video_pri_reg[2]; - UINT8 m_backupram_wp; - UINT8 m_cmd; - UINT8 m_buf_size; - UINT8 m_buf_index; - UINT8 m_buf_ram[16]; - UINT8 m_portc_test; - UINT8 m_fdc_motor_status[2]; + uint16_t m_video_pri_reg[2]; + uint8_t m_backupram_wp; + uint8_t m_cmd; + uint8_t m_buf_size; + uint8_t m_buf_index; + uint8_t m_buf_ram[16]; + uint8_t m_portc_test; + uint8_t m_fdc_motor_status[2]; /* floppy state */ - UINT8 m_i8255_0_pc; - UINT8 m_i8255_1_pc; - UINT8 m_fdc_mode; - UINT8 m_fdc_irq_opcode; + uint8_t m_i8255_0_pc; + uint8_t m_i8255_1_pc; + uint8_t m_fdc_mode; + uint8_t m_fdc_irq_opcode; DECLARE_READ16_MEMBER(sys_mem_r); DECLARE_WRITE16_MEMBER(sys_mem_w); DECLARE_READ8_MEMBER(idp_status_r); @@ -133,7 +133,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_pc88va(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pc88va(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pc88va_vrtc_irq); DECLARE_READ8_MEMBER(cpu_8255_c_r); DECLARE_WRITE8_MEMBER(cpu_8255_c_w); @@ -148,14 +148,14 @@ public: DECLARE_READ8_MEMBER(get_slave_ack); DECLARE_WRITE_LINE_MEMBER(pc88va_pit_out0_changed); // DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt); - UINT8 m_fdc_ctrl_2; + uint8_t m_fdc_ctrl_2; TIMER_CALLBACK_MEMBER(pc8801fd_upd765_tc_to_zero); TIMER_CALLBACK_MEMBER(t3_mouse_callback); TIMER_CALLBACK_MEMBER(pc88va_fdc_timer); TIMER_CALLBACK_MEMBER(pc88va_fdc_motor_start_0); TIMER_CALLBACK_MEMBER(pc88va_fdc_motor_start_1); -// UINT16 m_fdc_dma_r(); -// void m_fdc_dma_w(UINT16 data); +// uint16_t m_fdc_dma_r(); +// void m_fdc_dma_w(uint16_t data); DECLARE_WRITE_LINE_MEMBER(pc88va_hlda_w); DECLARE_WRITE_LINE_MEMBER(pc88va_tc_w); DECLARE_READ8_MEMBER(fdc_dma_r); @@ -168,9 +168,9 @@ DECLARE_WRITE8_MEMBER(dma_memw_cb); DECLARE_FLOPPY_FORMATS( floppy_formats ); void pc88va_fdc_update_ready(floppy_image_device *, int); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 calc_kanji_rom_addr(UINT8 jis1,UINT8 jis2,int x,int y); + uint32_t calc_kanji_rom_addr(uint8_t jis1,uint8_t jis2,int x,int y); void draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void tsp_sprite_enable(UINT32 spr_offset, UINT8 sw_bit); + void tsp_sprite_enable(uint32_t spr_offset, uint8_t sw_bit); void execute_sync_cmd(); void execute_dspon_cmd(); void execute_dspdef_cmd(); @@ -195,7 +195,7 @@ void pc88va_state::video_start() void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT16 *tvram = (UINT16 *)(memregion("tvram")->base()); + uint16_t *tvram = (uint16_t *)(memregion("tvram")->base()); int offs,i; offs = m_tsp.spr_offset; @@ -288,7 +288,7 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) } /* TODO: this is either a result of an hand-crafted ROM or the JIS stuff is really attribute related ... */ -UINT32 pc88va_state::calc_kanji_rom_addr(UINT8 jis1,UINT8 jis2,int x,int y) +uint32_t pc88va_state::calc_kanji_rom_addr(uint8_t jis1,uint8_t jis2,int x,int y) { if(jis1 < 0x30) return ((jis2 & 0x60) << 8) + ((jis1 & 0x07) << 10) + ((jis2 & 0x1f) << 5); @@ -304,20 +304,20 @@ UINT32 pc88va_state::calc_kanji_rom_addr(UINT8 jis1,UINT8 jis2,int x,int y) void pc88va_state::draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 *tvram = memregion("tvram")->base(); - UINT8 *kanji = memregion("kanji")->base(); + uint8_t *tvram = memregion("tvram")->base(); + uint8_t *kanji = memregion("kanji")->base(); int xi,yi; int x,y; int res_x,res_y; - UINT16 lr_half_gfx; - UINT8 jis1,jis2; - UINT32 count; - UINT32 tile_num; - UINT16 attr; - UINT8 attr_mode; - UINT8 fg_col,bg_col,secret,reverse; - //UINT8 blink,dwidc,dwid,uline,hline; - UINT8 screen_fg_col,screen_bg_col; + uint16_t lr_half_gfx; + uint8_t jis1,jis2; + uint32_t count; + uint32_t tile_num; + uint16_t attr; + uint8_t attr_mode; + uint8_t fg_col,bg_col,secret,reverse; + //uint8_t blink,dwidc,dwid,uline,hline; + uint8_t screen_fg_col,screen_bg_col; count = (tvram[m_tsp.tvram_vreg_offset+0] | tvram[m_tsp.tvram_vreg_offset+1] << 8); @@ -483,10 +483,10 @@ void pc88va_state::draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) } } -UINT32 pc88va_state::screen_update_pc88va(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t pc88va_state::screen_update_pc88va(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 pri,cur_pri_lv; - UINT32 screen_pri; + uint8_t pri,cur_pri_lv; + uint32_t screen_pri; bitmap.fill(0, cliprect); if(m_tsp.disp_on == 0) // don't bother if we are under DSPOFF command @@ -571,7 +571,7 @@ READ16_MEMBER(pc88va_state::sys_mem_r) return 0xffff; case 1: // TVRAM { - UINT16 *tvram = (UINT16 *)(memregion("tvram")->base()); + uint16_t *tvram = (uint16_t *)(memregion("tvram")->base()); if(((offset*2) & 0x30000) == 0) return tvram[offset]; @@ -580,15 +580,15 @@ READ16_MEMBER(pc88va_state::sys_mem_r) } case 4: { - UINT16 *gvram = (UINT16 *)(memregion("gvram")->base()); + uint16_t *gvram = (uint16_t *)(memregion("gvram")->base()); return gvram[offset]; } case 8: // kanji ROM case 9: { - UINT16 *knj_ram = (UINT16 *)(memregion("kanji")->base()); - UINT32 knj_offset; + uint16_t *knj_ram = (uint16_t *)(memregion("kanji")->base()); + uint32_t knj_offset; knj_offset = (offset + (((m_bank_reg & 0x100) >> 8)*0x20000)); @@ -602,8 +602,8 @@ READ16_MEMBER(pc88va_state::sys_mem_r) case 0xc: // Dictionary ROM case 0xd: { - UINT16 *dic_rom = (UINT16 *)(memregion("dictionary")->base()); - UINT32 dic_offset; + uint16_t *dic_rom = (uint16_t *)(memregion("dictionary")->base()); + uint32_t dic_offset; dic_offset = (offset + (((m_bank_reg & 0x100) >> 8)*0x20000)); @@ -622,7 +622,7 @@ WRITE16_MEMBER(pc88va_state::sys_mem_w) break; case 1: // TVRAM { - UINT16 *tvram = (UINT16 *)(memregion("tvram")->base()); + uint16_t *tvram = (uint16_t *)(memregion("tvram")->base()); if(((offset*2) & 0x30000) == 0) COMBINE_DATA(&tvram[offset]); @@ -630,7 +630,7 @@ WRITE16_MEMBER(pc88va_state::sys_mem_w) break; case 4: // TVRAM { - UINT16 *gvram = (UINT16 *)(memregion("gvram")->base()); + uint16_t *gvram = (uint16_t *)(memregion("gvram")->base()); COMBINE_DATA(&gvram[offset]); } @@ -638,8 +638,8 @@ WRITE16_MEMBER(pc88va_state::sys_mem_w) case 8: // kanji ROM, backup RAM at 0xb0000 - 0xb3fff case 9: { - UINT16 *knj_ram = (UINT16 *)(memregion("kanji")->base()); - UINT32 knj_offset; + uint16_t *knj_ram = (uint16_t *)(memregion("kanji")->base()); + uint32_t knj_offset; knj_offset = ((offset) + (((m_bank_reg & 0x100) >> 8)*0x20000)); @@ -753,7 +753,7 @@ WRITE8_MEMBER(pc88va_state::idp_command_w) } } -void pc88va_state::tsp_sprite_enable(UINT32 spr_offset, UINT8 sw_bit) +void pc88va_state::tsp_sprite_enable(uint32_t spr_offset, uint8_t sw_bit) { address_space &space = m_maincpu->space(AS_PROGRAM); @@ -783,7 +783,7 @@ void pc88va_state::execute_sync_cmd() */ rectangle visarea; attoseconds_t refresh; - UINT16 x_vis_area,y_vis_area; + uint16_t x_vis_area,y_vis_area; //printf("V blank start: %d\n",(sync_cmd[0x8])); //printf("V border start: %d\n",(sync_cmd[0x9])); @@ -955,7 +955,7 @@ WRITE16_MEMBER(pc88va_state::palette_ram_w) READ16_MEMBER(pc88va_state::sys_port4_r) { - UINT8 vrtc,sw1; + uint8_t vrtc,sw1; vrtc = (machine().first_screen()->vpos() < 200) ? 0x20 : 0x00; // vblank sw1 = (ioport("DSW")->read() & 1) ? 2 : 0; @@ -987,7 +987,7 @@ WRITE16_MEMBER(pc88va_state::bios_bank_w) /* RBC1 */ { - UINT8 *ROM10 = memregion("rom10")->base(); + uint8_t *ROM10 = memregion("rom10")->base(); if((m_bank_reg & 0xe0) == 0x00) membank("rom10_bank")->set_base(&ROM10[(m_bank_reg & 0x10) ? 0x10000 : 0x00000]); @@ -995,7 +995,7 @@ WRITE16_MEMBER(pc88va_state::bios_bank_w) /* RBC0 */ { - UINT8 *ROM00 = memregion("rom00")->base(); + uint8_t *ROM00 = memregion("rom00")->base(); membank("rom00_bank")->set_base(&ROM00[(m_bank_reg & 0xf)*0x10000]); // TODO: docs says that only 0 - 5 are used, dunno why ... } @@ -1164,7 +1164,7 @@ WRITE8_MEMBER(pc88va_state::pc88va_fdc_w) READ16_MEMBER(pc88va_state::sysop_r) { - UINT8 sys_op; + uint8_t sys_op; sys_op = ioport("SYSOP_SW")->read() & 3; @@ -1215,7 +1215,7 @@ WRITE16_MEMBER(pc88va_state::video_pri_w) READ8_MEMBER(pc88va_state::backupram_dsw_r) { - UINT16 *knj_ram = (UINT16 *)(memregion("kanji")->base()); + uint16_t *knj_ram = (uint16_t *)(memregion("kanji")->base()); if(offset == 0) return knj_ram[(0x50000 + 0x1fc2) / 2] & 0xff; @@ -1591,7 +1591,7 @@ WRITE8_MEMBER(pc88va_state::fdc_8255_c_w) READ8_MEMBER(pc88va_state::r232_ctrl_porta_r) { - UINT8 sw5, sw4, sw3, sw2,speed_sw; + uint8_t sw5, sw4, sw3, sw2,speed_sw; speed_sw = (ioport("SPEED_SW")->read() & 1) ? 0x20 : 0x00; sw5 = (ioport("DSW")->read() & 0x10); @@ -1604,7 +1604,7 @@ READ8_MEMBER(pc88va_state::r232_ctrl_porta_r) READ8_MEMBER(pc88va_state::r232_ctrl_portb_r) { - UINT8 xsw1; + uint8_t xsw1; xsw1 = (ioport("DSW")->read() & 1) ? 0 : 8; @@ -1659,8 +1659,8 @@ void pc88va_state::machine_start() void pc88va_state::machine_reset() { - UINT8 *ROM00 = memregion("rom00")->base(); - UINT8 *ROM10 = memregion("rom10")->base(); + uint8_t *ROM00 = memregion("rom00")->base(); + uint8_t *ROM10 = memregion("rom10")->base(); membank("rom10_bank")->set_base(&ROM10[0x00000]); membank("rom00_bank")->set_base(&ROM00[0x00000]); @@ -1670,7 +1670,7 @@ void pc88va_state::machine_reset() /* default palette */ { - UINT8 i; + uint8_t i; for(i=0;i<32;i++) m_palette->set_pen_color(i,pal1bit((i & 2) >> 1),pal1bit((i & 4) >> 2),pal1bit(i & 1)); } diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp index 78bc42e05de..ccedaeac890 100644 --- a/src/mame/drivers/pc9801.cpp +++ b/src/mame/drivers/pc9801.cpp @@ -490,9 +490,9 @@ public: optional_device m_sasi_ctrl_in; optional_device m_ide1; optional_device m_ide2; - required_shared_ptr m_video_ram_1; - required_shared_ptr m_video_ram_2; - optional_shared_ptr m_ext_gvram; + required_shared_ptr m_video_ram_1; + required_shared_ptr m_video_ram_2; + optional_shared_ptr m_ext_gvram; required_device m_beeper; optional_device m_ram; optional_device m_ipl; @@ -501,7 +501,7 @@ public: required_device m_screen; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; enum @@ -510,62 +510,62 @@ public: }; emu_timer *m_vbirq; - UINT8 *m_char_rom; - UINT8 *m_kanji_rom; + uint8_t *m_char_rom; + uint8_t *m_kanji_rom; - UINT8 m_dma_offset[4]; - UINT8 m_dma_autoinc[4]; + uint8_t m_dma_offset[4]; + uint8_t m_dma_autoinc[4]; int m_dack; - UINT8 m_video_ff[8],m_gfx_ff; - UINT8 m_txt_scroll_reg[8]; - UINT8 m_pal_clut[4]; + uint8_t m_video_ff[8],m_gfx_ff; + uint8_t m_txt_scroll_reg[8]; + uint8_t m_pal_clut[4]; - std::unique_ptr m_tvram; + std::unique_ptr m_tvram; - UINT16 m_font_addr; - UINT8 m_font_line; - UINT16 m_font_lr; + uint16_t m_font_addr; + uint8_t m_font_line; + uint16_t m_font_lr; - UINT8 m_fdc_2dd_ctrl,m_fdc_2hd_ctrl; - UINT8 m_nmi_ff; + uint8_t m_fdc_2dd_ctrl,m_fdc_2hd_ctrl; + uint8_t m_nmi_ff; - UINT8 m_vram_bank; - UINT8 m_vram_disp; + uint8_t m_vram_bank; + uint8_t m_vram_disp; /* PC9801RS specific */ - UINT8 m_gate_a20; //A20 line - UINT8 m_access_ctrl; // DMA related - UINT8 m_fdc_ctrl; - UINT8 m_ex_video_ff[128]; + uint8_t m_gate_a20; //A20 line + uint8_t m_access_ctrl; // DMA related + uint8_t m_fdc_ctrl; + uint8_t m_ex_video_ff[128]; struct { - UINT8 pal_entry; - UINT8 r[16],g[16],b[16]; + uint8_t pal_entry; + uint8_t r[16],g[16],b[16]; }m_analog16; struct { - UINT8 pal_entry; - UINT8 r[0x100],g[0x100],b[0x100]; + uint8_t pal_entry; + uint8_t r[0x100],g[0x100],b[0x100]; }m_analog256; struct { - UINT8 mode; - UINT8 tile[4], tile_index; + uint8_t mode; + uint8_t tile[4], tile_index; }m_grcg; struct { - UINT16 regs[8]; - UINT16 pat[4]; - UINT16 src[4]; - INT16 count; - UINT16 leftover[4]; + uint16_t regs[8]; + uint16_t pat[4]; + uint16_t src[4]; + int16_t count; + uint16_t leftover[4]; bool first; bool init; } m_egc; /* PC9821 specific */ - UINT8 m_sdip[24], m_sdip_bank; - UINT8 m_pc9821_window_bank; - UINT8 m_ext2_ff; - UINT8 m_sys_type; + uint8_t m_sdip[24], m_sdip_bank; + uint8_t m_pc9821_window_bank; + uint8_t m_ext2_ff; + uint8_t m_sys_type; DECLARE_WRITE_LINE_MEMBER( write_uart_clock ); DECLARE_WRITE8_MEMBER(rtc_w); @@ -597,9 +597,9 @@ public: DECLARE_WRITE16_MEMBER(grcg_gvram0_w); DECLARE_READ16_MEMBER(upd7220_grcg_r); DECLARE_WRITE16_MEMBER(upd7220_grcg_w); - void egc_blit_w(UINT32 offset, UINT16 data, UINT16 mem_mask); - UINT16 egc_blit_r(UINT32 offset, UINT16 mem_mask); - UINT32 a20_286(bool state); + void egc_blit_w(uint32_t offset, uint16_t data, uint16_t mem_mask); + uint16_t egc_blit_r(uint32_t offset, uint16_t mem_mask); + uint32_t a20_286(bool state); DECLARE_READ8_MEMBER(ide_ctrl_r); DECLARE_WRITE8_MEMBER(ide_ctrl_w); @@ -610,7 +610,7 @@ public: DECLARE_WRITE_LINE_MEMBER(ide1_irq_w); DECLARE_WRITE_LINE_MEMBER(ide2_irq_w); - UINT8 m_ide_sel; + uint8_t m_ide_sel; bool m_ide1_irq, m_ide2_irq; DECLARE_WRITE8_MEMBER(sasi_data_w); @@ -620,9 +620,9 @@ public: DECLARE_READ8_MEMBER(sasi_status_r); DECLARE_WRITE8_MEMBER(sasi_ctrl_w); - UINT8 m_sasi_data; + uint8_t m_sasi_data; int m_sasi_data_enable; - UINT8 m_sasi_ctrl; + uint8_t m_sasi_ctrl; DECLARE_READ8_MEMBER(pc9801rs_knjram_r); DECLARE_WRITE8_MEMBER(pc9801rs_knjram_w); @@ -683,10 +683,10 @@ public: UPD7220_DRAW_TEXT_LINE_MEMBER( hgdc_draw_text ); private: - UINT8 m_sdip_read(UINT16 port, UINT8 sdip_offset); - void m_sdip_write(UINT16 port, UINT8 sdip_offset,UINT8 data); - UINT16 egc_do_partial_op(int plane, UINT16 src, UINT16 pat, UINT16 dst); - UINT16 egc_shift(int plane, UINT16 val); + uint8_t m_sdip_read(uint16_t port, uint8_t sdip_offset); + void m_sdip_write(uint16_t port, uint8_t sdip_offset,uint8_t data); + uint16_t egc_do_partial_op(int plane, uint16_t src, uint16_t pat, uint16_t dst); + uint16_t egc_shift(int plane, uint16_t val); public: DECLARE_MACHINE_START(pc9801_common); DECLARE_MACHINE_START(pc9801f); @@ -721,11 +721,11 @@ public: DECLARE_WRITE8_MEMBER(ppi_mouse_portb_w); DECLARE_WRITE8_MEMBER(ppi_mouse_portc_w); struct{ - UINT8 control; - UINT8 lx; - UINT8 ly; - UINT8 freq_reg; - UINT8 freq_index; + uint8_t control; + uint8_t lx; + uint8_t ly; + uint8_t freq_reg; + uint8_t freq_index; }m_mouse; TIMER_DEVICE_CALLBACK_MEMBER( mouse_irq_cb ); DECLARE_READ8_MEMBER(unk_r); @@ -758,14 +758,14 @@ void pc9801_state::device_timer(emu_timer &timer, device_timer_id id, int param, void pc9801_state::video_start() { - m_tvram = std::make_unique(0x2000); + m_tvram = std::make_unique(0x2000); // find memory regions m_char_rom = memregion("chargen")->base(); m_kanji_rom = memregion("kanji")->base(); } -UINT32 pc9801_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t pc9801_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -780,8 +780,8 @@ UPD7220_DISPLAY_PIXELS_MEMBER( pc9801_state::hgdc_display_pixels ) const rgb_t *palette = m_palette->palette()->entry_list_raw(); int xi; int res_x,res_y; - UINT8 pen; - UINT8 colors16_mode; + uint8_t pen; + uint8_t colors16_mode; if(m_video_ff[DISPLAY_REG] == 0) //screen is off return; @@ -790,7 +790,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( pc9801_state::hgdc_display_pixels ) if(m_ex_video_ff[ANALOG_256_MODE]) { - UINT8 *ext_gvram = (UINT8 *)m_ext_gvram.target(); + uint8_t *ext_gvram = (uint8_t *)m_ext_gvram.target(); for(xi=0;xi<16;xi++) { res_x = x + xi; @@ -823,12 +823,12 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( pc9801_state::hgdc_draw_text ) const rgb_t *palette = m_palette->palette()->entry_list_raw(); int xi,yi; int x; - UINT8 char_size; -// UINT8 interlace_on; - UINT16 tile; - UINT8 kanji_lr; - UINT8 kanji_sel; - UINT8 x_step; + uint8_t char_size; +// uint8_t interlace_on; + uint16_t tile; + uint8_t kanji_lr; + uint8_t kanji_sel; + uint8_t x_step; if(m_video_ff[DISPLAY_REG] == 0) //screen is off return; @@ -839,13 +839,13 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( pc9801_state::hgdc_draw_text ) for(x=0;x> 1] = data; @@ -1170,7 +1170,7 @@ WRITE8_MEMBER(pc9801_state::pc9801_a0_w) return; case 0x09: //cg window font write { - UINT32 pcg_offset; + uint32_t pcg_offset; pcg_offset = m_font_addr << 5; pcg_offset|= m_font_line; @@ -1251,7 +1251,7 @@ WRITE8_MEMBER(pc9801_state::fdc_2dd_ctrl_w) /* TODO: banking? */ READ16_MEMBER(pc9801_state::tvram_r) { - UINT16 res; + uint16_t res; if((offset & 0x1000) && (mem_mask == 0xff00)) return 0xffff; @@ -1277,17 +1277,17 @@ READ8_MEMBER(pc9801_state::gvram_r) WRITE8_MEMBER(pc9801_state::gvram_w) { - UINT16 ram = m_video_ram_2[(offset>>1)+0x04000+m_vram_bank*0x10000]; + uint16_t ram = m_video_ram_2[(offset>>1)+0x04000+m_vram_bank*0x10000]; int mask = (offset & 1) << 3; data = BITSWAP8(data,0,1,2,3,4,5,6,7); m_video_ram_2[(offset>>1)+0x04000+m_vram_bank*0x10000] = (ram & (0xff00 >> mask)) | (data << mask); } -UINT16 pc9801_state::egc_shift(int plane, UINT16 val) +uint16_t pc9801_state::egc_shift(int plane, uint16_t val) { int src_off = m_egc.regs[6] & 0xf, dst_off = (m_egc.regs[6] >> 4) & 0xf; int left = src_off - dst_off, right = dst_off - src_off; - UINT16 out; + uint16_t out; if(m_egc.regs[6] & 0x1000) { if(right >= 0) @@ -1317,9 +1317,9 @@ UINT16 pc9801_state::egc_shift(int plane, UINT16 val) return out; } -UINT16 pc9801_state::egc_do_partial_op(int plane, UINT16 src, UINT16 pat, UINT16 dst) +uint16_t pc9801_state::egc_do_partial_op(int plane, uint16_t src, uint16_t pat, uint16_t dst) { - UINT16 out = 0; + uint16_t out = 0; for(int i = 7; i >= 0; i--) { @@ -1332,9 +1332,9 @@ UINT16 pc9801_state::egc_do_partial_op(int plane, UINT16 src, UINT16 pat, UINT16 return out; } -void pc9801_state::egc_blit_w(UINT32 offset, UINT16 data, UINT16 mem_mask) +void pc9801_state::egc_blit_w(uint32_t offset, uint16_t data, uint16_t mem_mask) { - UINT16 mask = m_egc.regs[4] & mem_mask, out = 0; + uint16_t mask = m_egc.regs[4] & mem_mask, out = 0; bool dir = !(m_egc.regs[6] & 0x1000); int dst_off = (m_egc.regs[6] >> 4) & 0xf, src_off = m_egc.regs[6] & 0xf; offset &= 0x13fff; @@ -1363,7 +1363,7 @@ void pc9801_state::egc_blit_w(UINT32 offset, UINT16 data, UINT16 mem_mask) // mask off the bits past the end of the blit if(((m_egc.count < 8) && (mem_mask != 0xffff)) || ((m_egc.count < 16) && (mem_mask == 0xffff))) { - UINT16 end_mask = dir ? ((1 << m_egc.count) - 1) : ~((1 << (16 - m_egc.count)) - 1); + uint16_t end_mask = dir ? ((1 << m_egc.count) - 1) : ~((1 << (16 - m_egc.count)) - 1); // if the blit is less than the write size, adjust the masks if(m_egc.first) { @@ -1379,7 +1379,7 @@ void pc9801_state::egc_blit_w(UINT32 offset, UINT16 data, UINT16 mem_mask) { if(!BIT(m_egc.regs[0], i)) { - UINT16 src = m_egc.src[i], pat = m_egc.pat[i]; + uint16_t src = m_egc.src[i], pat = m_egc.pat[i]; if(BIT(m_egc.regs[2], 10)) src = egc_shift(i, data); @@ -1431,9 +1431,9 @@ void pc9801_state::egc_blit_w(UINT32 offset, UINT16 data, UINT16 mem_mask) } } -UINT16 pc9801_state::egc_blit_r(UINT32 offset, UINT16 mem_mask) +uint16_t pc9801_state::egc_blit_r(uint32_t offset, uint16_t mem_mask) { - UINT32 plane_off = offset & 0x13fff; + uint32_t plane_off = offset & 0x13fff; if((m_egc.regs[2] & 0x300) == 0x100) { m_egc.pat[0] = m_video_ram_2[plane_off + 0x4000]; @@ -1457,7 +1457,7 @@ UINT16 pc9801_state::egc_blit_r(UINT32 offset, UINT16 mem_mask) READ16_MEMBER(pc9801_state::upd7220_grcg_r) { - UINT16 res = 0; + uint16_t res = 0; if(!(m_grcg.mode & 0x80) || space.debugger_access()) res = m_video_ram_2[offset]; @@ -1492,7 +1492,7 @@ WRITE16_MEMBER(pc9801_state::upd7220_grcg_w) else { int i; - UINT8 *vram = (UINT8 *)m_video_ram_2.target(); + uint8_t *vram = (uint8_t *)m_video_ram_2.target(); offset = (offset << 1) & 0x27fff; if(m_grcg.mode & 0x40) // RMW @@ -1578,7 +1578,7 @@ WRITE_LINE_MEMBER(pc9801_state::ide2_irq_w) READ8_MEMBER( pc9801_state::sasi_data_r ) { - UINT8 data = m_sasi_data_in->read(); + uint8_t data = m_sasi_data_in->read(); if(m_sasi_ctrl_in->read() & 0x80) m_sasibus->write_ack(1); @@ -1635,7 +1635,7 @@ WRITE_LINE_MEMBER( pc9801_state::write_sasi_req ) READ8_MEMBER( pc9801_state::sasi_status_r ) { - UINT8 res = 0; + uint8_t res = 0; if(m_sasi_ctrl & 0x40) // read status { @@ -1743,7 +1743,7 @@ ADDRESS_MAP_END /* TODO: having this non-linear makes the system to boot in BASIC for PC-9821. Perhaps it stores settings? How to change these? */ READ8_MEMBER(pc9801_state::pc9801rs_knjram_r) { - UINT32 pcg_offset; + uint32_t pcg_offset; pcg_offset = m_font_addr << 5; pcg_offset|= offset & 0x1e; @@ -1768,7 +1768,7 @@ READ8_MEMBER(pc9801_state::pc9801rs_knjram_r) WRITE8_MEMBER(pc9801_state::pc9801rs_knjram_w) { - UINT32 pcg_offset; + uint32_t pcg_offset; pcg_offset = m_font_addr << 5; pcg_offset|= offset & 0x1e; @@ -1822,7 +1822,7 @@ WRITE8_MEMBER(pc9801_state::a20_ctrl_w) { if(offset == 0x00) { - UINT8 por; + uint8_t por; /* reset POR bit, TODO: is there any other way? */ por = machine().device("ppi8255_sys")->read(space, 2) & ~0x20; machine().device("ppi8255_sys")->write(space, 2,por); @@ -1893,7 +1893,7 @@ WRITE16_MEMBER(pc9801_state::egc_w) case 3: case 5: { - UINT8 color = 0; + uint8_t color = 0; switch((m_egc.regs[1] >> 13) & 3) { case 1: @@ -2076,7 +2076,7 @@ WRITE8_MEMBER(pc9801_state::pic_w) READ16_MEMBER(pc9801_state::grcg_gvram_r) { - UINT16 ret = upd7220_grcg_r(space, (offset + 0x4000) | (m_vram_bank << 16), mem_mask); + uint16_t ret = upd7220_grcg_r(space, (offset + 0x4000) | (m_vram_bank << 16), mem_mask); return BITSWAP16(ret,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7); } @@ -2088,7 +2088,7 @@ WRITE16_MEMBER(pc9801_state::grcg_gvram_w) READ16_MEMBER(pc9801_state::grcg_gvram0_r) { - UINT16 ret = upd7220_grcg_r(space, offset | (m_vram_bank << 16), mem_mask); + uint16_t ret = upd7220_grcg_r(space, offset | (m_vram_bank << 16), mem_mask); return BITSWAP16(ret,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7); } @@ -2181,7 +2181,7 @@ READ8_MEMBER(pc9801_state::pc9821_a0_r) } else if(m_ex_video_ff[ANALOG_16_MODE]) //16 color mode, readback possible there { - UINT8 res = 0; + uint8_t res = 0; switch(offset) { @@ -2236,7 +2236,7 @@ WRITE8_MEMBER(pc9801_state::window_bank_w) logerror("PC-9821 $f0000 window bank %02x\n",data); } -UINT8 pc9801_state::m_sdip_read(UINT16 port, UINT8 sdip_offset) +uint8_t pc9801_state::m_sdip_read(uint16_t port, uint8_t sdip_offset) { if(port == 2) return m_sdip[sdip_offset]; @@ -2245,7 +2245,7 @@ UINT8 pc9801_state::m_sdip_read(UINT16 port, UINT8 sdip_offset) return 0xff; } -void pc9801_state::m_sdip_write(UINT16 port, UINT8 sdip_offset,UINT8 data) +void pc9801_state::m_sdip_write(uint16_t port, uint8_t sdip_offset,uint8_t data) { if(port == 2) { @@ -2300,7 +2300,7 @@ READ16_MEMBER(pc9801_state::timestamp_r) /* basically a read-back of various registers */ READ8_MEMBER(pc9801_state::ext2_video_ff_r) { - UINT8 res; + uint8_t res; res = 0; @@ -2762,7 +2762,7 @@ READ8_MEMBER(pc9801_state::dma_read_byte) { case 1: { - UINT8 page = m_dma_offset[m_dack]; + uint8_t page = m_dma_offset[m_dack]; m_dma_offset[m_dack] = ((page + 1) & 0xf) | (page & 0xf0); break; } @@ -2788,7 +2788,7 @@ WRITE8_MEMBER(pc9801_state::dma_write_byte) { case 1: { - UINT8 page = m_dma_offset[m_dack]; + uint8_t page = m_dma_offset[m_dack]; m_dma_offset[m_dack] = ((page + 1) & 0xf) | (page & 0xf0); break; } @@ -2831,8 +2831,8 @@ WRITE8_MEMBER(pc9801_state::ppi_sys_portc_w) READ8_MEMBER(pc9801_state::ppi_mouse_porta_r) { - UINT8 res; - UINT8 isporthi; + uint8_t res; + uint8_t isporthi; const char *const mousenames[] = { "MOUSE_X", "MOUSE_Y" }; res = ioport("MOUSE_B")->read() & 0xf0; @@ -2935,7 +2935,7 @@ WRITE_LINE_MEMBER( pc9801_state::pc9801rs_fdc_drq ) m_dmac->dreq3_w(state ^ 1); } -UINT32 pc9801_state::a20_286(bool state) +uint32_t pc9801_state::a20_286(bool state) { return (state ? 0xffffff : 0x0fffff); } @@ -3017,11 +3017,11 @@ MACHINE_START_MEMBER(pc9801_state,pc9821ap2) MACHINE_RESET_MEMBER(pc9801_state,pc9801_common) { - memset(m_tvram.get(), 0, sizeof(UINT16) * 0x2000); + memset(m_tvram.get(), 0, sizeof(uint16_t) * 0x2000); /* this looks like to be some kind of backup ram, system will boot with green colors otherwise */ { int i; - static const UINT8 default_memsw_data[0x10] = + static const uint8_t default_memsw_data[0x10] = { 0xe1, 0x48, 0xe1, 0x05, 0xe1, 0x04, 0xe1, 0x00, 0xe1, 0x01, 0xe1, 0x00, 0xe1, 0x00, 0xe1, 0x6e // 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff, 0xe1, 0xff @@ -3045,9 +3045,9 @@ MACHINE_RESET_MEMBER(pc9801_state,pc9801f) { MACHINE_RESET_CALL_MEMBER(pc9801_common); - UINT8 op_mode; - UINT8 *ROM; - UINT8 *PRG = memregion("fdc_data")->base(); + uint8_t op_mode; + uint8_t *ROM; + uint8_t *PRG = memregion("fdc_data")->base(); int i; ROM = memregion("fdc_bios_2dd")->base(); @@ -3791,12 +3791,12 @@ DRIVER_INIT_MEMBER(pc9801_state,pc9801_kanji) for(j=0;j<0x20;j++) \ kanji[j+(i << 5)] = _fill_type ? new_chargen[j+(k << 5)] : 0; \ } - UINT32 i,j,k; - UINT32 pcg_tile; - UINT8 *kanji = memregion("kanji")->base(); - UINT8 *raw_kanji = memregion("raw_kanji")->base(); - UINT8 *new_chargen = memregion("new_chargen")->base(); - UINT8 *chargen = memregion("chargen")->base(); + uint32_t i,j,k; + uint32_t pcg_tile; + uint8_t *kanji = memregion("kanji")->base(); + uint8_t *raw_kanji = memregion("raw_kanji")->base(); + uint8_t *new_chargen = memregion("new_chargen")->base(); + uint8_t *chargen = memregion("chargen")->base(); /* Convert the ROM bitswap here from the original structure */ /* TODO: kanji bitswap should be completely wrong, will check it out once that a dump is remade. */ diff --git a/src/mame/drivers/pcat_dyn.cpp b/src/mame/drivers/pcat_dyn.cpp index 700c817cc43..8b3dc32570d 100644 --- a/src/mame/drivers/pcat_dyn.cpp +++ b/src/mame/drivers/pcat_dyn.cpp @@ -47,7 +47,7 @@ public: required_device m_isabus; required_memory_bank m_prgbank; required_memory_bank m_nvram_bank; - std::vector m_nvram_mem; + std::vector m_nvram_mem; DECLARE_WRITE8_MEMBER(bank1_w); DECLARE_WRITE8_MEMBER(bank2_w); DECLARE_READ8_MEMBER(audio_r); diff --git a/src/mame/drivers/pcat_nit.cpp b/src/mame/drivers/pcat_nit.cpp index 25b02276175..37948b8817b 100644 --- a/src/mame/drivers/pcat_nit.cpp +++ b/src/mame/drivers/pcat_nit.cpp @@ -99,7 +99,7 @@ public: m_uart(*this, "ns16450_0"), m_microtouch(*this, "microtouch") { } - std::unique_ptr m_banked_nvram; + std::unique_ptr m_banked_nvram; required_device m_uart; required_device m_microtouch; @@ -413,7 +413,7 @@ ROM_END DRIVER_INIT_MEMBER(pcat_nit_state,pcat_nit) { - m_banked_nvram = std::make_unique(0x2000); + m_banked_nvram = std::make_unique(0x2000); machine().device("nvram")->set_base(m_banked_nvram.get(), 0x2000); } diff --git a/src/mame/drivers/pcd.cpp b/src/mame/drivers/pcd.cpp index 1077358b1c8..ab8e25c8eb1 100644 --- a/src/mame/drivers/pcd.cpp +++ b/src/mame/drivers/pcd.cpp @@ -91,13 +91,13 @@ private: required_device m_scsi_data_out; required_device m_scsi_data_in; required_device m_ram; - UINT8 m_stat, m_led; + uint8_t m_stat, m_led; int m_msg, m_bsy, m_io, m_cd, m_req, m_rst; emu_timer *m_req_hack; - UINT16 m_dskctl; + uint16_t m_dskctl; struct { - UINT16 ctl; - UINT16 regs[1024]; + uint16_t ctl; + uint16_t regs[1024]; int type; bool sc; } m_mmu; @@ -245,7 +245,7 @@ WRITE8_MEMBER( pcd_state::led_w ) READ16_MEMBER( pcd_state::mmu_r ) { - UINT16 data = m_mmu.regs[((m_mmu.ctl & 0x1f) << 5) | ((offset >> 2) & 0x1f)]; + uint16_t data = m_mmu.regs[((m_mmu.ctl & 0x1f) << 5) | ((offset >> 2) & 0x1f)]; //logerror("%s: mmu read %04x %04x\n", machine().describe_context(), (offset << 1) + 0x8000, data); if(!offset) return m_mmu.ctl; @@ -275,7 +275,7 @@ WRITE16_MEMBER( pcd_state::mmu_w ) READ8_MEMBER(pcd_state::scsi_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch(offset) { @@ -381,10 +381,10 @@ WRITE_LINE_MEMBER(pcd_state::write_scsi_req) WRITE16_MEMBER(pcd_state::mem_w) { - UINT16 *ram = (UINT16 *)m_ram->pointer(); + uint16_t *ram = (uint16_t *)m_ram->pointer(); if((m_mmu.ctl & 0x20) && m_mmu.type) { - UINT16 reg; + uint16_t reg; if(m_mmu.type == 2) reg = m_mmu.regs[((offset >> 10) & 0xff) | ((m_mmu.ctl & 0x18) << 5)]; else @@ -403,10 +403,10 @@ WRITE16_MEMBER(pcd_state::mem_w) READ16_MEMBER(pcd_state::mem_r) { - UINT16 *ram = (UINT16 *)m_ram->pointer(); + uint16_t *ram = (uint16_t *)m_ram->pointer(); if((m_mmu.ctl & 0x20) && m_mmu.type) { - UINT16 reg; + uint16_t reg; if(m_mmu.type == 2) reg = m_mmu.regs[((offset >> 10) & 0xff) | ((m_mmu.ctl & 0x18) << 5)]; else diff --git a/src/mame/drivers/pce.cpp b/src/mame/drivers/pce.cpp index 95320c6ab96..88cad831327 100644 --- a/src/mame/drivers/pce.cpp +++ b/src/mame/drivers/pce.cpp @@ -285,7 +285,7 @@ static ADDRESS_MAP_START( sgx_io , AS_IO, 8, pce_state ) ADDRESS_MAP_END -UINT32 pce_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pce_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/drivers/pce220.cpp b/src/mame/drivers/pce220.cpp index 9175a6b4ca0..8c2add74f39 100644 --- a/src/mame/drivers/pce220.cpp +++ b/src/mame/drivers/pce220.cpp @@ -57,25 +57,25 @@ public: required_device m_serial; // HD61202 LCD controller - UINT8 m_lcd_index_row; - UINT8 m_lcd_index_col; - UINT8 m_lcd_start_line; - UINT8 m_lcd_on; + uint8_t m_lcd_index_row; + uint8_t m_lcd_index_col; + uint8_t m_lcd_start_line; + uint8_t m_lcd_on; //basic machine - UINT8 m_bank_num; - UINT8 m_irq_mask; - UINT8 m_irq_flag; - UINT8 m_timer_status; - UINT16 m_kb_matrix; - UINT8 *m_vram; + uint8_t m_bank_num; + uint8_t m_irq_mask; + uint8_t m_irq_flag; + uint8_t m_timer_status; + uint16_t m_kb_matrix; + uint8_t *m_vram; - UINT8 m_port15; - UINT8 m_port18; + uint8_t m_port15; + uint8_t m_port18; virtual void machine_start() override; virtual void machine_reset() override; - 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); DECLARE_READ8_MEMBER( lcd_status_r ); DECLARE_WRITE8_MEMBER( lcd_control_w ); DECLARE_READ8_MEMBER( lcd_data_r ); @@ -109,14 +109,14 @@ public: : pce220_state(mconfig, type, tag) { } - UINT8 m_g850v_bank_num; - UINT8 m_lcd_effects; - UINT8 m_lcd_contrast; - UINT8 m_lcd_read_mode; + uint8_t m_g850v_bank_num; + uint8_t m_lcd_effects; + uint8_t m_lcd_contrast; + uint8_t m_lcd_read_mode; virtual void machine_start() override; virtual void machine_reset() override; - 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); DECLARE_READ8_MEMBER( g850v_bank_r ); DECLARE_WRITE8_MEMBER( g850v_bank_w ); DECLARE_READ8_MEMBER( g850v_lcd_status_r ); @@ -125,9 +125,9 @@ public: DECLARE_WRITE8_MEMBER( g850v_lcd_data_w ); }; -UINT32 pce220_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pce220_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 lcd_symbols[4]; + uint8_t lcd_symbols[4]; if (m_lcd_on) { @@ -188,9 +188,9 @@ UINT32 pce220_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, return 0; } -UINT32 pcg850v_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pcg850v_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 lcd_symbols[6]; + uint8_t lcd_symbols[6]; int color0 = 0; int color1 = 1; @@ -276,7 +276,7 @@ READ8_MEMBER( pce220_state::lcd_status_r ) --x- ---- LCD on/off ---x ---- Reset */ - UINT8 data = 0; + uint8_t data = 0; data &= (m_lcd_on<<5); @@ -314,8 +314,8 @@ READ8_MEMBER( pce220_state::rom_bank_r ) WRITE8_MEMBER( pce220_state::rom_bank_w ) { - UINT8 bank4 = data & 0x07; // bits 0,1,2 - UINT8 bank3 = (data & 0x70) >> 4; // bits 4,5,6 + uint8_t bank4 = data & 0x07; // bits 0,1,2 + uint8_t bank3 = (data & 0x70) >> 4; // bits 4,5,6 m_bank_num = data; @@ -325,7 +325,7 @@ WRITE8_MEMBER( pce220_state::rom_bank_w ) WRITE8_MEMBER( pce220_state::ram_bank_w ) { - UINT8 bank = BIT(data,2); + uint8_t bank = BIT(data,2); membank("bank1")->set_entry(bank); membank("bank2")->set_entry(bank); @@ -399,7 +399,7 @@ READ8_MEMBER( pce220_state::port1f_r ) ---- ---x DIN */ - UINT8 data = 0; + uint8_t data = 0; data |= m_serial->in_din()<<0; data |= m_serial->in_ack()<<1; @@ -425,7 +425,7 @@ WRITE8_MEMBER( pce220_state::kb_matrix_w ) READ8_MEMBER( pce220_state::kb_r ) { - UINT8 data = 0x00; + uint8_t data = 0x00; if (m_kb_matrix & 0x01) data |= ioport("LINE0")->read(); @@ -499,7 +499,7 @@ READ8_MEMBER( pcg850v_state::g850v_lcd_status_r ) x--- ---- Busy (not emulated) --x- ---- LCD on/off */ - UINT8 data = 0; + uint8_t data = 0; data &= (m_lcd_on<<5); @@ -551,7 +551,7 @@ WRITE8_MEMBER( pcg850v_state::g850v_lcd_control_w ) READ8_MEMBER( pcg850v_state::g850v_lcd_data_r ) { - UINT8 data = m_vram[(m_lcd_index_row*0x100 + m_lcd_index_col - 1) & 0x7ff]; + uint8_t data = m_vram[(m_lcd_index_row*0x100 + m_lcd_index_col - 1) & 0x7ff]; if (m_lcd_read_mode == 1) m_lcd_index_col++; @@ -848,30 +848,30 @@ INPUT_PORTS_END void pce220_state::machine_start() { - UINT8 *rom = memregion("user1")->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t *rom = memregion("user1")->base(); + uint8_t *ram = m_ram->pointer(); membank("bank1")->configure_entries(0, 2, ram + 0x0000, 0x8000); membank("bank2")->configure_entries(0, 2, ram + 0x4000, 0x8000); membank("bank3")->configure_entries(0, 8, rom, 0x4000); membank("bank4")->configure_entries(0, 8, rom, 0x4000); - m_vram = (UINT8*)memregion("lcd_vram")->base(); + m_vram = (uint8_t*)memregion("lcd_vram")->base(); machine().device("nvram")->set_base(ram, m_ram->size()); } void pcg850v_state::machine_start() { - UINT8 *rom = memregion("user1")->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t *rom = memregion("user1")->base(); + uint8_t *ram = m_ram->pointer(); membank("bank1")->configure_entries(0, 2, ram + 0x0000, 0x8000); membank("bank2")->configure_entries(0, 2, ram + 0x4000, 0x8000); membank("bank3")->configure_entries(0, 22, rom, 0x4000); membank("bank4")->configure_entries(0, 22, rom, 0x4000); - m_vram = (UINT8*)memregion("lcd_vram")->base(); + m_vram = (uint8_t*)memregion("lcd_vram")->base(); machine().device("nvram")->set_base(ram, m_ram->size()); } diff --git a/src/mame/drivers/pcfx.cpp b/src/mame/drivers/pcfx.cpp index a4ecee9b880..692466e72c4 100644 --- a/src/mame/drivers/pcfx.cpp +++ b/src/mame/drivers/pcfx.cpp @@ -17,9 +17,9 @@ struct pcfx_pad_t { - UINT8 ctrl[2]; - UINT8 status[2]; - UINT32 latch[2]; + uint8_t ctrl[2]; + uint8_t status[2]; + uint32_t latch[2]; }; class pcfx_state : public driver_device @@ -40,12 +40,12 @@ public: virtual void machine_reset() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // Interrupt controller (component unknown) - UINT16 m_irq_mask; - UINT16 m_irq_pending; - UINT8 m_irq_priority[8]; + uint16_t m_irq_mask; + uint16_t m_irq_pending; + uint8_t m_irq_priority[8]; pcfx_pad_t m_pad; @@ -98,8 +98,8 @@ ADDRESS_MAP_END READ16_MEMBER( pcfx_state::pad_r ) { - UINT16 res; - UINT8 port_type = ((offset<<1) & 0x80) >> 7; + uint16_t res; + uint8_t port_type = ((offset<<1) & 0x80) >> 7; if(((offset<<1) & 0x40) == 0) { @@ -152,7 +152,7 @@ TIMER_CALLBACK_MEMBER(pcfx_state::pad_func) WRITE16_MEMBER( pcfx_state::pad_w ) { - UINT8 port_type = ((offset<<1) & 0x80) >> 7; + uint8_t port_type = ((offset<<1) & 0x80) >> 7; if(((offset<<1) & 0x40) == 0) { @@ -292,7 +292,7 @@ INPUT_PORTS_END READ16_MEMBER( pcfx_state::irq_read ) { - UINT16 data = 0; + uint16_t data = 0; switch( offset ) { @@ -377,7 +377,7 @@ WRITE16_MEMBER( pcfx_state::irq_write ) inline void pcfx_state::check_irqs() { - UINT16 active_irqs = m_irq_pending & ~m_irq_mask; + uint16_t active_irqs = m_irq_pending & ~m_irq_mask; int highest_prio = -1; for (auto & elem : m_irq_priority) @@ -468,7 +468,7 @@ void pcfx_state::machine_reset() } -UINT32 pcfx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t pcfx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_huc6261->video_update( bitmap, cliprect ); return 0; diff --git a/src/mame/drivers/pcipc.cpp b/src/mame/drivers/pcipc.cpp index 591fb072b62..d9a751af7fe 100644 --- a/src/mame/drivers/pcipc.cpp +++ b/src/mame/drivers/pcipc.cpp @@ -30,7 +30,7 @@ class pcipc_state : public driver_device { public: struct boot_state_info { - UINT8 val; + uint8_t val; const char *const message; }; diff --git a/src/mame/drivers/pcktgal.cpp b/src/mame/drivers/pcktgal.cpp index 49b5c8d4b41..27d8562897a 100644 --- a/src/mame/drivers/pcktgal.cpp +++ b/src/mame/drivers/pcktgal.cpp @@ -424,7 +424,7 @@ ROM_END DRIVER_INIT_MEMBER(pcktgal_state,pcktgal) { - UINT8 *rom = memregion("gfx1")->base(); + uint8_t *rom = memregion("gfx1")->base(); int len = memregion("gfx1")->bytes(); int i,j,temp[16]; diff --git a/src/mame/drivers/pcm.cpp b/src/mame/drivers/pcm.cpp index 6a0a817c0c5..24b5ad9308d 100644 --- a/src/mame/drivers/pcm.cpp +++ b/src/mame/drivers/pcm.cpp @@ -90,14 +90,14 @@ public: DECLARE_READ8_MEMBER( pcm_85_r ); DECLARE_WRITE_LINE_MEMBER( pcm_82_w ); DECLARE_WRITE8_MEMBER( pcm_85_w ); - UINT8 *m_p_chargen; + uint8_t *m_p_chargen; bool m_cone; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; virtual void machine_reset() override; virtual void video_start() override; - 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); private: - UINT8 m_85; + uint8_t m_85; }; @@ -133,7 +133,7 @@ There is also a HALT LED, connected directly to the processor. READ8_MEMBER( pcm_state::pcm_85_r ) { - UINT8 data = m_85 & 0x7f; + uint8_t data = m_85 & 0x7f; if ((m_cass)->input() > 0.03) data |= 0x80; @@ -188,16 +188,16 @@ void pcm_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 pcm_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pcm_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0x400,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0x400,x; for (y = 0; y < 16; y++) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 64; x++) { diff --git a/src/mame/drivers/pcw.cpp b/src/mame/drivers/pcw.cpp index 8b9a302c1a5..5a274bf4c0c 100644 --- a/src/mame/drivers/pcw.cpp +++ b/src/mame/drivers/pcw.cpp @@ -112,8 +112,8 @@ #define VERBOSE 1 #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -static const UINT8 half_step_table[4] = { 0x01, 0x02, 0x04, 0x08 }; -static const UINT8 full_step_table[4] = { 0x03, 0x06, 0x0c, 0x09 }; +static const uint8_t half_step_table[4] = { 0x01, 0x02, 0x04, 0x08 }; +static const uint8_t full_step_table[4] = { 0x03, 0x06, 0x0c, 0x09 }; void pcw_state::pcw_update_interrupt_counter() { @@ -562,7 +562,7 @@ WRITE8_MEMBER(pcw_state::pcw_system_control_w) READ8_MEMBER(pcw_state::pcw_system_status_r) { /* from Jacob Nevins docs */ - UINT8 ret = pcw_get_sys_status(); + uint8_t ret = pcw_get_sys_status(); return ret; } @@ -623,16 +623,16 @@ WRITE8_MEMBER(pcw_state::pcw_expansion_w) logerror("pcw expansion w: %04x %02x\n",offset+0x080, data); } -void pcw_state::pcw_printer_fire_pins(UINT16 pins) +void pcw_state::pcw_printer_fire_pins(uint16_t pins) { int x,line; - INT32 feed = (m_paper_feed / 2); + int32_t feed = (m_paper_feed / 2); for(x=feed+PCW_PRINTER_HEIGHT-16;xpix16(line, m_printer_headpos) = (UINT16)(pins & 0x01); + m_prn_output->pix16(line, m_printer_headpos) = (uint16_t)(pins & 0x01); pins >>= 1; } // if(m_printer_headpos < PCW_PRINTER_WIDTH) @@ -701,7 +701,7 @@ TIMER_CALLBACK_MEMBER(pcw_state::pcw_stepper_callback) //popmessage("PRN: P2 bits %s %s %s\nSerial: %02x\nHeadpos: %i",m_printer_p2 & 0x40 ? " " : "6",m_printer_p2 & 0x20 ? " " : "5",m_printer_p2 & 0x10 ? " " : "4",m_printer_shift_output,m_printer_headpos); if((m_printer_p2 & 0x10) == 0) // print head motor active { - UINT8 stepper_state = (m_printer_shift_output >> 4) & 0x0f; + uint8_t stepper_state = (m_printer_shift_output >> 4) & 0x0f; if(stepper_state == full_step_table[(m_head_motor_state + 1) & 0x03]) { m_printer_headpos += 2; @@ -735,7 +735,7 @@ TIMER_CALLBACK_MEMBER(pcw_state::pcw_stepper_callback) } if((m_printer_p2 & 0x20) == 0) // line feed motor active { - UINT8 stepper_state = m_printer_shift_output & 0x0f; + uint8_t stepper_state = m_printer_shift_output & 0x0f; if(stepper_state == full_step_table[(m_linefeed_motor_state + 1) & 0x03]) { m_paper_feed++; @@ -776,7 +776,7 @@ WRITE8_MEMBER(pcw_state::mcu_printer_p1_w) READ8_MEMBER(pcw_state::mcu_printer_p2_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; // logerror("PRN: MCU reading data from P2\n"); ret |= 0x80; // make sure bail bar is in ret |= (m_printer_p2 & 0x70); @@ -839,7 +839,7 @@ READ8_MEMBER(pcw_state::mcu_printer_t0_r) * bit 1: keyboard serial clock * bit 0: keyboard serial data */ -void pcw_state::mcu_transmit_serial(UINT8 bit) +void pcw_state::mcu_transmit_serial(uint8_t bit) { int seq; @@ -906,7 +906,7 @@ WRITE8_MEMBER(pcw_state::mcu_kb_scan_high_w) READ8_MEMBER(pcw_state::mcu_kb_data_r) { - UINT16 scan_bits = ((m_kb_scan_row & 0xf000) >> 4) | (m_kb_scan_row & 0xff); + uint16_t scan_bits = ((m_kb_scan_row & 0xf000) >> 4) | (m_kb_scan_row & 0xff); int x; for(x=0;x<12;x++) @@ -1006,7 +1006,7 @@ void pcw_state::machine_start() void pcw_state::machine_reset() { - UINT8* code = memregion("printer_mcu")->base(); + uint8_t* code = memregion("printer_mcu")->base(); int x; /* ram paging is actually undefined at power-on */ diff --git a/src/mame/drivers/pcw16.cpp b/src/mame/drivers/pcw16.cpp index 2ec10e086a6..a67756fe547 100644 --- a/src/mame/drivers/pcw16.cpp +++ b/src/mame/drivers/pcw16.cpp @@ -149,7 +149,7 @@ WRITE8_MEMBER(pcw16_state::pcw16_palette_w) m_colour_palette[offset & 0x0f] = data & 31; } -UINT8 pcw16_state::read_bank_data(UINT8 type, UINT16 offset) +uint8_t pcw16_state::read_bank_data(uint8_t type, uint16_t offset) { if(type & 0x80) // DRAM { @@ -172,7 +172,7 @@ UINT8 pcw16_state::read_bank_data(UINT8 type, UINT16 offset) } } -void pcw16_state::write_bank_data(UINT8 type, UINT16 offset, UINT8 data) +void pcw16_state::write_bank_data(uint8_t type, uint16_t offset, uint8_t data) { if(type & 0x80) // DRAM { @@ -193,7 +193,7 @@ void pcw16_state::write_bank_data(UINT8 type, UINT16 offset, UINT8 data) } } -UINT8 pcw16_state::pcw16_read_mem(UINT8 bank, UINT16 offset) +uint8_t pcw16_state::pcw16_read_mem(uint8_t bank, uint16_t offset) { switch(bank) { @@ -209,7 +209,7 @@ UINT8 pcw16_state::pcw16_read_mem(UINT8 bank, UINT16 offset) return 0xff; } -void pcw16_state::pcw16_write_mem(UINT8 bank, UINT16 offset, UINT8 data) +void pcw16_state::pcw16_write_mem(uint8_t bank, uint16_t offset, uint8_t data) { switch(bank) { diff --git a/src/mame/drivers/pcxt.cpp b/src/mame/drivers/pcxt.cpp index 92b1dcf8ea9..59167132565 100644 --- a/src/mame/drivers/pcxt.cpp +++ b/src/mame/drivers/pcxt.cpp @@ -72,10 +72,10 @@ public: m_bank(*this, "bank"){ } int m_lastvalue; - UINT8 m_disk_data[2]; - UINT8 m_port_b_data; - UINT8 m_status; - UINT8 m_clr_status; + uint8_t m_disk_data[2]; + uint8_t m_port_b_data; + uint8_t m_status; + uint8_t m_clr_status; DECLARE_READ8_MEMBER(disk_iobank_r); DECLARE_WRITE8_MEMBER(disk_iobank_w); @@ -99,7 +99,7 @@ class isa8_cga_filetto_device : public isa8_cga_device { public: // construction/destruction - isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual const tiny_rom_entry *device_rom_region() const override; }; @@ -110,7 +110,7 @@ const device_type ISA8_CGA_FILETTO = &device_creator; // isa8_cga_filetto_device - constructor //------------------------------------------------- -isa8_cga_filetto_device::isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_cga_filetto_device::isa8_cga_filetto_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_cga_device( mconfig, ISA8_CGA_FILETTO, "ISA8_CGA_FILETTO", tag, owner, clock, "filetto_cga", __FILE__) { } @@ -131,16 +131,16 @@ class isa8_cga_tetriskr_device : public isa8_cga_superimpose_device { public: // construction/destruction - isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) override; virtual void device_start() override; virtual const tiny_rom_entry *device_rom_region() const override; DECLARE_READ8_MEMBER(bg_bank_r); DECLARE_WRITE8_MEMBER(bg_bank_w); private: - UINT8 m_bg_bank; + uint8_t m_bg_bank; }; @@ -151,7 +151,7 @@ const device_type ISA8_CGA_TETRISKR = &device_creator; // isa8_cga_tetriskr_device - constructor //------------------------------------------------- -isa8_cga_tetriskr_device::isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +isa8_cga_tetriskr_device::isa8_cga_tetriskr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : isa8_cga_superimpose_device( mconfig, ISA8_CGA_TETRISKR, "ISA8_CGA_TETRISKR", tag, owner, clock, "tetriskr_cga", __FILE__) { } @@ -175,11 +175,11 @@ READ8_MEMBER(isa8_cga_tetriskr_device::bg_bank_r) } -UINT32 isa8_cga_tetriskr_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t isa8_cga_tetriskr_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y; int yi; - const UINT8 *bg_rom = memregion("gfx2")->base(); + const uint8_t *bg_rom = memregion("gfx2")->base(); //popmessage("%04x",m_start_offs); @@ -191,7 +191,7 @@ UINT32 isa8_cga_tetriskr_device::screen_update(screen_device &screen, bitmap_rgb { for(x=0;x<320/8;x++) { - UINT8 color; + uint8_t color; int xi,pen_i; for(xi=0;xi<8;xi++) @@ -327,7 +327,7 @@ WRITE8_MEMBER(pcxt_state::port_b_w) READ8_MEMBER(pcxt_state::fdc765_status_r) { - UINT8 tmp; + uint8_t tmp; tmp = m_status | 0x80; m_clr_status++; if(m_clr_status == 0x10) diff --git a/src/mame/drivers/pda600.cpp b/src/mame/drivers/pda600.cpp index 5fe546c4e7b..a9aa4589742 100644 --- a/src/mame/drivers/pda600.cpp +++ b/src/mame/drivers/pda600.cpp @@ -74,9 +74,9 @@ public: virtual void video_start() override; virtual void machine_reset() override; - 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); - UINT8 * m_video_ram; + uint8_t * m_video_ram; }; @@ -114,12 +114,12 @@ void pda600_state::video_start() m_video_ram = memregion("videoram")->base(); } -UINT32 pda600_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pda600_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y=0; y<320; y++) for (int x=0; x<30; x++) { - UINT8 data = m_video_ram[y*30 + x]; + uint8_t data = m_video_ram[y*30 + x]; for (int px=0; px<8; px++) { diff --git a/src/mame/drivers/pdp1.cpp b/src/mame/drivers/pdp1.cpp index 97a642cdebd..859b5d3e4b8 100644 --- a/src/mame/drivers/pdp1.cpp +++ b/src/mame/drivers/pdp1.cpp @@ -277,7 +277,7 @@ static const gfx_layout fontlayout = black. Grey levels follow an exponential law, so that decrementing the color index periodically will simulate the remanence of a cathode ray tube. */ -static const UINT8 pdp1_colors[] = +static const uint8_t pdp1_colors[] = { 0x00,0x00,0x00, /* black */ 0xFF,0xFF,0xFF, /* white */ @@ -287,14 +287,14 @@ static const UINT8 pdp1_colors[] = 0x80,0x80,0x80 /* light gray */ }; -static const UINT8 pdp1_palette[] = +static const uint8_t pdp1_palette[] = { pen_panel_bg, pen_panel_caption, pen_typewriter_bg, pen_black, pen_typewriter_bg, pen_red }; -static const UINT8 total_colors_needed = pen_crt_num_levels + sizeof(pdp1_colors) / 3; +static const uint8_t total_colors_needed = pen_crt_num_levels + sizeof(pdp1_colors) / 3; static GFXDECODE_START( pdp1 ) GFXDECODE_ENTRY( "gfx1", 0, fontlayout, pen_crt_num_levels + sizeof(pdp1_colors) / 3, 3 ) @@ -311,7 +311,7 @@ PALETTE_INIT_MEMBER(pdp1_state, pdp1) const double update_period = 1./refresh_rate; double decay_1, decay_2; double cur_level_1, cur_level_2; - UINT8 i, r, g, b; + uint8_t i, r, g, b; /* initialize CRT palette */ @@ -516,7 +516,7 @@ void pdp1_state::pdp1_machine_stop() */ void pdp1_state::machine_start() { - UINT8 *dst; + uint8_t *dst; static const unsigned char fontdata6x8[pdp1_fontdata_size] = { /* ASCII characters */ @@ -667,7 +667,7 @@ class pdp1_readtape_image_device : public device_t, { public: // construction/destruction - pdp1_readtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pdp1_readtape_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_PUNCHTAPE; } @@ -689,7 +689,7 @@ protected: const device_type PDP1_READTAPE = &device_creator; -pdp1_readtape_image_device::pdp1_readtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pdp1_readtape_image_device::pdp1_readtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDP1_READTAPE, "PDP1 Tape Reader", tag, owner, clock, "pdp1_readtape_image", __FILE__), device_image_interface(mconfig, *this) { @@ -700,7 +700,7 @@ class pdp1_punchtape_image_device : public device_t, { public: // construction/destruction - pdp1_punchtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pdp1_punchtape_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_PUNCHTAPE; } @@ -722,7 +722,7 @@ protected: const device_type PDP1_PUNCHTAPE = &device_creator; -pdp1_punchtape_image_device::pdp1_punchtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pdp1_punchtape_image_device::pdp1_punchtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDP1_PUNCHTAPE, "PDP1 Tape Puncher", tag, owner, clock, "pdp1_punchtape_image", __FILE__), device_image_interface(mconfig, *this) { @@ -734,7 +734,7 @@ class pdp1_printer_image_device : public device_t, { public: // construction/destruction - pdp1_printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pdp1_printer_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_PRINTER; } @@ -756,7 +756,7 @@ protected: const device_type PDP1_PRINTER = &device_creator; -pdp1_printer_image_device::pdp1_printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pdp1_printer_image_device::pdp1_printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDP1_PRINTER, "PDP1 Typewriter", tag, owner, clock, "pdp1_printer_image", __FILE__), device_image_interface(mconfig, *this) { @@ -767,7 +767,7 @@ class pdp1_cylinder_image_device : public device_t, { public: // construction/destruction - pdp1_cylinder_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pdp1_cylinder_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_CYLINDER; } @@ -789,7 +789,7 @@ protected: const device_type PDP1_CYLINDER = &device_creator; -pdp1_cylinder_image_device::pdp1_cylinder_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pdp1_cylinder_image_device::pdp1_cylinder_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PDP1_CYLINDER, "PDP1 Cylinder", tag, owner, clock, "pdp1_cylinder_image", __FILE__), device_image_interface(mconfig, *this) { @@ -845,7 +845,7 @@ void pdp1_readtape_image_device::call_unload() /* Read a byte from perforated tape */ -int pdp1_state::tape_read(UINT8 *reply) +int pdp1_state::tape_read(uint8_t *reply) { if (m_tape_reader.fd && (m_tape_reader.fd->fread(reply, 1) == 1)) return 0; /* unit OK */ @@ -888,7 +888,7 @@ void pdp1_state::begin_tape_read( int binary, int nac) TIMER_CALLBACK_MEMBER(pdp1_state::reader_callback) { int not_ready; - UINT8 data; + uint8_t data; if (m_tape_reader.rc) { @@ -1053,7 +1053,7 @@ void pdp1_punchtape_image_device::call_unload() /* Write a byte to perforated tape */ -void pdp1_state::tape_write(UINT8 data) +void pdp1_state::tape_write(uint8_t data) { if (m_tape_puncher.fd) m_tape_puncher.fd->fwrite(& data, 1); @@ -1163,7 +1163,7 @@ void pdp1_printer_image_device::call_unload() /* Write a character to typewriter */ -void pdp1_state::typewriter_out(UINT8 data) +void pdp1_state::typewriter_out(uint8_t data) { if (LOG_IOT_EXTRA) logerror("typewriter output %o\n", data); @@ -1515,10 +1515,10 @@ static void iot_dba(device_t *device, int op2, int nac, int mb, int *io, int ac) /* Read a word from drum */ -UINT32 pdp1_state::drum_read(int field, int position) +uint32_t pdp1_state::drum_read(int field, int position) { int offset = (field*4096+position)*3; - UINT8 buf[3]; + uint8_t buf[3]; if (m_parallel_drum.fd && (!m_parallel_drum.fd->fseek(offset, SEEK_SET)) && (m_parallel_drum.fd->fread( buf, 3) == 3)) return ((buf[0] << 16) | (buf[1] << 8) | buf[2]) & 0777777; @@ -1529,10 +1529,10 @@ UINT32 pdp1_state::drum_read(int field, int position) /* Write a word to drum */ -void pdp1_state::drum_write(int field, int position, UINT32 data) +void pdp1_state::drum_write(int field, int position, uint32_t data) { int offset = (field*4096+position)*3; - UINT8 buf[3]; + uint8_t buf[3]; if (m_parallel_drum.fd) { @@ -1803,8 +1803,8 @@ INTERRUPT_GEN_MEMBER(pdp1_state::pdp1_interrupt) { m_maincpu->pulse_start_clear(); /* pulse Start Clear line */ m_maincpu->set_state_int(PDP1_EXD, m_maincpu->state_int(PDP1_EXTEND_SW)); - m_maincpu->set_state_int(PDP1_SBM, (UINT64)0); - m_maincpu->set_state_int(PDP1_OV, (UINT64)0); + m_maincpu->set_state_int(PDP1_SBM, (uint64_t)0); + m_maincpu->set_state_int(PDP1_OV, (uint64_t)0); m_maincpu->set_state_int(PDP1_PC, m_maincpu->state_int(PDP1_TA)); m_maincpu->set_state_int(PDP1_RUN, 1); } @@ -1813,14 +1813,14 @@ INTERRUPT_GEN_MEMBER(pdp1_state::pdp1_interrupt) m_maincpu->pulse_start_clear(); /* pulse Start Clear line */ m_maincpu->set_state_int(PDP1_EXD, m_maincpu->state_int(PDP1_EXTEND_SW)); m_maincpu->set_state_int(PDP1_SBM, 1); - m_maincpu->set_state_int(PDP1_OV, (UINT64)0); + m_maincpu->set_state_int(PDP1_OV, (uint64_t)0); m_maincpu->set_state_int(PDP1_PC, m_maincpu->state_int(PDP1_TA)); m_maincpu->set_state_int(PDP1_RUN, 1); } if (control_transitions & pdp1_stop) { - m_maincpu->set_state_int(PDP1_RUN, (UINT64)0); - m_maincpu->set_state_int(PDP1_RIM, (UINT64)0); /* bug : we stop after reading an even-numbered word + m_maincpu->set_state_int(PDP1_RUN, (uint64_t)0); + m_maincpu->set_state_int(PDP1_RIM, (uint64_t)0); /* bug : we stop after reading an even-numbered word (i.e. data), whereas a real pdp-1 stops after reading an odd-numbered word (i.e. dio instruciton) */ } @@ -1856,8 +1856,8 @@ INTERRUPT_GEN_MEMBER(pdp1_state::pdp1_interrupt) | (m_maincpu->state_int(PDP1_PC) & 0007777)); /* transfer ETA to EPC */ /*m_maincpu->set_state_int(PDP1_MA, m_maincpu->state_int(PDP1_PC));*/ m_maincpu->set_state_int(PDP1_EXD, m_maincpu->state_int(PDP1_EXTEND_SW)); - m_maincpu->set_state_int(PDP1_OV, (UINT64)0); /* right??? */ - m_maincpu->set_state_int(PDP1_RUN, (UINT64)0); + m_maincpu->set_state_int(PDP1_OV, (uint64_t)0); /* right??? */ + m_maincpu->set_state_int(PDP1_RUN, (uint64_t)0); m_maincpu->set_state_int(PDP1_RIM, 1); } if (control_transitions & pdp1_reader) diff --git a/src/mame/drivers/pdp11.cpp b/src/mame/drivers/pdp11.cpp index 139386dfe37..16c202a1749 100644 --- a/src/mame/drivers/pdp11.cpp +++ b/src/mame/drivers/pdp11.cpp @@ -110,17 +110,17 @@ public: DECLARE_READ16_MEMBER( teletype_ctrl_r ); DECLARE_WRITE16_MEMBER( teletype_ctrl_w ); DECLARE_WRITE8_MEMBER( kbd_put ); - UINT8 m_teletype_data; - UINT16 m_teletype_status; + uint8_t m_teletype_data; + uint16_t m_teletype_status; virtual void machine_reset() override; DECLARE_MACHINE_RESET(pdp11ub2); DECLARE_MACHINE_RESET(pdp11qb); - void load9312prom(UINT8 *desc, UINT8 *src, int size); + void load9312prom(uint8_t *desc, uint8_t *src, int size); }; READ16_MEMBER(pdp11_state::teletype_ctrl_r) { - UINT16 res = 0; + uint16_t res = 0; switch(offset) { @@ -262,41 +262,41 @@ INPUT_PORTS_END void pdp11_state::machine_reset() { // Load M9301-YA - UINT8* user1 = memregion("user1")->base(); - UINT8* maincpu = memregion("maincpu")->base(); + uint8_t* user1 = memregion("user1")->base(); + uint8_t* maincpu = memregion("maincpu")->base(); int i; for(i=0;i<0x100;i++) { - UINT8 nib1 = user1[i+0x000] ^ 0x00; - UINT8 nib2 = user1[i+0x200] ^ 0x01; - UINT8 nib3 = user1[i+0x400] ^ 0x0f; - UINT8 nib4 = user1[i+0x600] ^ 0x0e; + uint8_t nib1 = user1[i+0x000] ^ 0x00; + uint8_t nib2 = user1[i+0x200] ^ 0x01; + uint8_t nib3 = user1[i+0x400] ^ 0x0f; + uint8_t nib4 = user1[i+0x600] ^ 0x0e; maincpu[0xea00 + i*2 + 1] = (nib1 << 4) + nib2; maincpu[0xea00 + i*2 + 0] = (nib3 << 4) + nib4; } for(i=0x100;i<0x200;i++) { - UINT8 nib1 = user1[i+0x000] ^ 0x00; - UINT8 nib2 = user1[i+0x200] ^ 0x01; - UINT8 nib3 = user1[i+0x400] ^ 0x0f; - UINT8 nib4 = user1[i+0x600] ^ 0x0e; + uint8_t nib1 = user1[i+0x000] ^ 0x00; + uint8_t nib2 = user1[i+0x200] ^ 0x01; + uint8_t nib3 = user1[i+0x400] ^ 0x0f; + uint8_t nib4 = user1[i+0x600] ^ 0x0e; maincpu[0xf600 + (i-0x100)*2 + 1] = (nib1 << 4) + nib2; maincpu[0xf600 + (i-0x100)*2 + 0] = (nib3 << 4) + nib4; } } -void pdp11_state::load9312prom(UINT8 *desc, UINT8 *src, int size) +void pdp11_state::load9312prom(uint8_t *desc, uint8_t *src, int size) { // 3 2 1 8 // 7 6 5 4 // ~11 ~10 9 0 // 15 14 13 ~12 for(int i=0;ibase() + ioport("CONSPROM")->read() * 0x0400; - UINT8* maincpu = memregion("maincpu")->base(); + uint8_t* user1 = memregion("consproms")->base() + ioport("CONSPROM")->read() * 0x0400; + uint8_t* maincpu = memregion("maincpu")->base(); //0165000 load9312prom(maincpu + 0165000,user1,0x100); - UINT8 s1 = ioport("S1")->read(); + uint8_t s1 = ioport("S1")->read(); if (s1 & 0x02) { // if boot enabled - UINT16 addr = 0173000; + uint16_t addr = 0173000; if (s1 & 1) { addr = 0165000; } diff --git a/src/mame/drivers/pegasus.cpp b/src/mame/drivers/pegasus.cpp index fe4f163d20f..9242aa05ffd 100644 --- a/src/mame/drivers/pegasus.cpp +++ b/src/mame/drivers/pegasus.cpp @@ -75,7 +75,7 @@ public: DECLARE_READ_LINE_MEMBER(pegasus_cassette_r); DECLARE_WRITE_LINE_MEMBER(pegasus_cassette_w); DECLARE_WRITE_LINE_MEMBER(pegasus_firq_clr); - 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); DECLARE_DRIVER_INIT(pegasus); TIMER_DEVICE_CALLBACK_MEMBER(pegasus_firq); image_init_result load_cart(device_image_interface &image, generic_slot_device *slot, const char *reg_tag); @@ -85,15 +85,15 @@ public: DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp0c_load) { return load_cart(image, m_exp_0c, "c000"); } DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp0d_load) { return load_cart(image, m_exp_0d, "d000"); } private: - UINT8 m_kbd_row; + uint8_t m_kbd_row; bool m_kbd_irq; - UINT8 *m_p_pcgram; - const UINT8 *m_p_chargen; - UINT8 m_control_bits; + uint8_t *m_p_pcgram; + const uint8_t *m_p_chargen; + uint8_t m_control_bits; virtual void machine_reset() override; virtual void machine_start() override; virtual void video_start() override; - void pegasus_decrypt_rom(UINT8 *ROM); + void pegasus_decrypt_rom(uint8_t *ROM); required_device m_maincpu; required_device m_cass; required_device m_pia_s; @@ -103,7 +103,7 @@ private: required_device m_exp_02; required_device m_exp_0c; required_device m_exp_0d; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_ioport_array<8> m_io_keyboard; }; @@ -119,7 +119,7 @@ WRITE_LINE_MEMBER( pegasus_state::pegasus_firq_clr ) READ8_MEMBER( pegasus_state::pegasus_keyboard_r ) { - UINT8 i,data = 0xff; + uint8_t i,data = 0xff; for (i = 0; i < 8; i++) if (!BIT(m_kbd_row, i)) data &= m_io_keyboard[i]->read(); @@ -163,7 +163,7 @@ WRITE_LINE_MEMBER( pegasus_state::pegasus_cassette_w ) READ8_MEMBER( pegasus_state::pegasus_pcg_r ) { - UINT8 code = m_p_videoram[offset] & 0x7f; + uint8_t code = m_p_videoram[offset] & 0x7f; return m_p_pcgram[(code << 4) | (~m_kbd_row & 15)]; } @@ -171,7 +171,7 @@ WRITE8_MEMBER( pegasus_state::pegasus_pcg_w ) { // if (BIT(m_control_bits, 1)) { - UINT8 code = m_p_videoram[offset] & 0x7f; + uint8_t code = m_p_videoram[offset] & 0x7f; m_p_pcgram[(code << 4) | (~m_kbd_row & 15)] = data; } } @@ -179,7 +179,7 @@ WRITE8_MEMBER( pegasus_state::pegasus_pcg_w ) /* Must return the A register except when it is doing a rom search */ READ8_MEMBER( pegasus_state::pegasus_protection_r ) { - UINT8 data = m_maincpu->state_int(M6809_A); + uint8_t data = m_maincpu->state_int(M6809_A); if (data == 0x20) data = 0xff; return data; } @@ -291,7 +291,7 @@ void pegasus_state::video_start() m_p_chargen = memregion("chargen")->base(); } -static const UINT8 mcm6571a_shift[] = +static const uint8_t mcm6571a_shift[] = { 0,1,1,0,0,0,1,0,0,0,0,1,0,0,0,0, 1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, @@ -304,17 +304,17 @@ static const UINT8 mcm6571a_shift[] = }; -UINT32 pegasus_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pegasus_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx,inv; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx,inv; + uint16_t sy=0,ma=0,x; bool pcg_mode = BIT(m_control_bits, 1); for(y = 0; y < 16; y++ ) { for(ra = 0; ra < 16; ra++ ) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for(x = ma; x < ma + 32; x++ ) { @@ -386,12 +386,12 @@ GFXDECODE_END // An encrypted single rom starts with 02, decrypted with 20. // The 2nd and 3rd part of a multi-rom set will have no obvious byte, // so we check the first 4 bytes for a signature, and decrypt if found. -void pegasus_state::pegasus_decrypt_rom(UINT8 *ROM) +void pegasus_state::pegasus_decrypt_rom(uint8_t *ROM) { bool doit = FALSE; - UINT8 b; - UINT16 j; - std::vector temp_copy; + uint8_t b; + uint16_t j; + std::vector temp_copy; temp_copy.resize(0x1000); if (ROM[0] == 0x02) doit = TRUE; @@ -415,7 +415,7 @@ void pegasus_state::pegasus_decrypt_rom(UINT8 *ROM) image_init_result pegasus_state::load_cart(device_image_interface &image, generic_slot_device *slot, const char *reg_tag) { - UINT32 size = slot->common_get_size(reg_tag); + uint32_t size = slot->common_get_size(reg_tag); bool any_socket = false; if (size > 0x1000) @@ -476,7 +476,7 @@ void pegasus_state::machine_reset() DRIVER_INIT_MEMBER(pegasus_state, pegasus) { // decrypt monitor - UINT8 *base = memregion("maincpu")->base() + 0xf000; + uint8_t *base = memregion("maincpu")->base() + 0xf000; pegasus_decrypt_rom(base); } diff --git a/src/mame/drivers/pengadvb.cpp b/src/mame/drivers/pengadvb.cpp index 647754bff02..21c71645e8e 100644 --- a/src/mame/drivers/pengadvb.cpp +++ b/src/mame/drivers/pengadvb.cpp @@ -44,8 +44,8 @@ public: address_map_bank_device *m_page[4]; memory_bank *m_bank[4]; - UINT8 m_primary_slot_reg; - UINT8 m_kb_matrix_row; + uint8_t m_primary_slot_reg; + uint8_t m_kb_matrix_row; DECLARE_READ8_MEMBER(mem_r); DECLARE_WRITE8_MEMBER(mem_w); @@ -278,7 +278,7 @@ void pengadvb_state::machine_reset() void pengadvb_state::pengadvb_decrypt(const char* region) { - UINT8 *mem = memregion(region)->base(); + uint8_t *mem = memregion(region)->base(); int memsize = memregion(region)->bytes(); // data lines swap @@ -288,7 +288,7 @@ void pengadvb_state::pengadvb_decrypt(const char* region) } // address line swap - std::vector buf(memsize); + std::vector buf(memsize); memcpy(&buf[0], mem, memsize); for (int i = 0; i < memsize; i++) { diff --git a/src/mame/drivers/pengo.cpp b/src/mame/drivers/pengo.cpp index 0d4f12b4139..1e9f04fe512 100644 --- a/src/mame/drivers/pengo.cpp +++ b/src/mame/drivers/pengo.cpp @@ -79,7 +79,7 @@ public: DECLARE_DRIVER_INIT(penta); INTERRUPT_GEN_MEMBER(vblank_irq); - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; }; @@ -678,12 +678,12 @@ DRIVER_INIT_MEMBER(pengo_state,penta) (e.g. 0xc0 is XORed with H) therefore in the following tables we only keep track of A, B, C, D, E, F, G and H. */ - static const UINT8 data_xortable[2][8] = + static const uint8_t data_xortable[2][8] = { { 0xa0,0x82,0x28,0x0a,0x82,0xa0,0x0a,0x28 }, /* ...............0 */ { 0x88,0x0a,0x82,0x00,0x88,0x0a,0x82,0x00 } /* ...............1 */ }; - static const UINT8 opcode_xortable[8][8] = + static const uint8_t opcode_xortable[8][8] = { { 0x02,0x08,0x2a,0x20,0x20,0x2a,0x08,0x02 }, /* ...0...0...0.... */ { 0x88,0x88,0x00,0x00,0x88,0x88,0x00,0x00 }, /* ...0...0...1.... */ @@ -695,12 +695,12 @@ DRIVER_INIT_MEMBER(pengo_state,penta) { 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 } /* ...1...1...1.... */ }; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (int A = 0x0000;A < 0x8000;A++) { int i,j; - UINT8 src; + uint8_t src; src = rom[A]; diff --git a/src/mame/drivers/pentagon.cpp b/src/mame/drivers/pentagon.cpp index 454fb5b7380..b19cee86183 100644 --- a/src/mame/drivers/pentagon.cpp +++ b/src/mame/drivers/pentagon.cpp @@ -46,13 +46,13 @@ protected: required_device m_beta; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT8 *m_p_ram; + uint8_t *m_p_ram; void pentagon_update_memory(); }; DIRECT_UPDATE_MEMBER(pentagon_state::pentagon_direct) { - UINT16 pc = m_maincpu->pcbase(); + uint16_t pc = m_maincpu->pcbase(); if (m_beta->started() && m_beta->is_active() && (pc >= 0x4000)) { @@ -91,7 +91,7 @@ DIRECT_UPDATE_MEMBER(pentagon_state::pentagon_direct) void pentagon_state::pentagon_update_memory() { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); m_screen_location = messram + ((m_port_7ffd_data & 8) ? (7<<14) : (5<<14)); @@ -141,7 +141,7 @@ WRITE8_MEMBER(pentagon_state::pentagon_scr_w) { spectrum_UpdateScreenBitmap(); - *((UINT8*)m_bank2->base() + offset) = data; + *((uint8_t*)m_bank2->base() + offset) = data; } WRITE8_MEMBER(pentagon_state::pentagon_scr2_w) @@ -149,7 +149,7 @@ WRITE8_MEMBER(pentagon_state::pentagon_scr2_w) if ((m_port_7ffd_data & 0x0f) == 0x0f || (m_port_7ffd_data & 0x0f) == 5) spectrum_UpdateScreenBitmap(); - *((UINT8*)m_bank4->base() + offset) = data; + *((uint8_t*)m_bank4->base() + offset) = data; } void pentagon_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) @@ -197,7 +197,7 @@ ADDRESS_MAP_END MACHINE_RESET_MEMBER(pentagon_state,pentagon) { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); address_space &space = m_maincpu->space(AS_PROGRAM); m_p_ram = memregion("maincpu")->base(); diff --git a/src/mame/drivers/peoplepc.cpp b/src/mame/drivers/peoplepc.cpp index b3da96d75d6..d7b5603b1eb 100644 --- a/src/mame/drivers/peoplepc.cpp +++ b/src/mame/drivers/peoplepc.cpp @@ -42,9 +42,9 @@ public: required_device m_flop1; required_device m_dmac; required_device m_gfxdecode; - required_shared_ptr m_gvram; - required_shared_ptr m_cvram; - std::vector m_charram; + required_shared_ptr m_gvram; + required_shared_ptr m_cvram; + std::vector m_charram; MC6845_UPDATE_ROW(update_row); DECLARE_READ8_MEMBER(get_slave_ack); @@ -60,7 +60,7 @@ public: image_init_result floppy_load(floppy_image_device *dev); void floppy_unload(floppy_image_device *dev); - UINT8 m_dma0pg; + uint8_t m_dma0pg; protected: virtual void machine_start() override; virtual void machine_reset() override; @@ -88,15 +88,15 @@ MC6845_UPDATE_ROW(peoplepc_state::update_row) { if(0) { - UINT16 offset = ((ma | (ra << 1)) << 4) + i; - UINT8 data = m_gvram[offset] >> (offset & 1 ? 8 : 0); + uint16_t offset = ((ma | (ra << 1)) << 4) + i; + uint8_t data = m_gvram[offset] >> (offset & 1 ? 8 : 0); for(j = 8; j >= 0; j--) bitmap.pix32(y, (i * 8) + j) = palette[( data & 1 << j ) ? 1 : 0]; } else { - UINT8 data = m_charram[(m_cvram[(ma + i) & 0x3fff] & 0x7f) * 32 + ra]; + uint8_t data = m_charram[(m_cvram[(ma + i) & 0x3fff] & 0x7f) * 32 + ra]; for(j = 0; j < 8; j++) bitmap.pix32(y, (i * 8) + j) = palette[(data & (1 << j)) ? 1 : 0]; } diff --git a/src/mame/drivers/peplus.cpp b/src/mame/drivers/peplus.cpp index 13afaf893d6..79893b003f4 100644 --- a/src/mame/drivers/peplus.cpp +++ b/src/mame/drivers/peplus.cpp @@ -264,44 +264,44 @@ public: optional_ioport m_touch_x; optional_ioport m_touch_y; - required_shared_ptr m_cmos_ram; - required_shared_ptr m_program_ram; - required_shared_ptr m_s3000_ram; - required_shared_ptr m_s5000_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_s7000_ram; - required_shared_ptr m_sb000_ram; - required_shared_ptr m_sd000_ram; - required_shared_ptr m_sf000_ram; - required_shared_ptr m_io_port; + required_shared_ptr m_cmos_ram; + required_shared_ptr m_program_ram; + required_shared_ptr m_s3000_ram; + required_shared_ptr m_s5000_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_s7000_ram; + required_shared_ptr m_sb000_ram; + required_shared_ptr m_sd000_ram; + required_shared_ptr m_sf000_ram; + required_shared_ptr m_io_port; tilemap_t *m_bg_tilemap; - UINT8 m_wingboard; - UINT8 m_doorcycle; - UINT16 door_wait; - UINT8 m_jumper_e16_e17; - UINT16 m_vid_address; - std::unique_ptr m_palette_ram; - std::unique_ptr m_palette_ram2; - UINT64 m_last_cycles; - UINT8 m_coin_state; - UINT64 m_last_door; - UINT8 m_door_open; - UINT64 m_last_coin_out; - UINT8 m_coin_out_state; + uint8_t m_wingboard; + uint8_t m_doorcycle; + uint16_t door_wait; + uint8_t m_jumper_e16_e17; + uint16_t m_vid_address; + std::unique_ptr m_palette_ram; + std::unique_ptr m_palette_ram2; + uint64_t m_last_cycles; + uint8_t m_coin_state; + uint64_t m_last_door; + uint8_t m_door_open; + uint64_t m_last_coin_out; + uint8_t m_coin_out_state; int m_sda_dir; - UINT8 m_bv_state; - UINT8 m_bv_busy; - UINT8 m_bv_pulse; - UINT8 m_bv_denomination; - UINT8 m_bv_protocol; - UINT64 m_bv_cycles; - UINT8 m_bv_last_enable_state; - UINT8 m_bv_enable_state; - UINT8 m_bv_enable_count; - UINT8 m_bv_data_bit; - UINT8 m_bv_loop_count; - UINT16 id023_data; + uint8_t m_bv_state; + uint8_t m_bv_busy; + uint8_t m_bv_pulse; + uint8_t m_bv_denomination; + uint8_t m_bv_protocol; + uint64_t m_bv_cycles; + uint8_t m_bv_last_enable_state; + uint8_t m_bv_enable_state; + uint8_t m_bv_enable_count; + uint8_t m_bv_data_bit; + uint8_t m_bv_loop_count; + uint16_t id023_data; DECLARE_WRITE8_MEMBER(peplus_bgcolor_w); DECLARE_WRITE8_MEMBER(peplus_crtc_display_w); @@ -329,7 +329,7 @@ public: MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_peplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_peplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void peplus_load_superdata(const char *bank_name); DECLARE_PALETTE_INIT(peplus); void handle_lightpen(); @@ -338,8 +338,8 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; -static const UINT8 id_022[8] = { 0x00, 0x01, 0x04, 0x09, 0x13, 0x16, 0x18, 0x00 }; -static const UINT16 id_023[8] = { 0x4a6c, 0x4a7b, 0x4a4b, 0x4a5a, 0x4a2b, 0x4a0a, 0x4a19, 0x4a3a }; +static const uint8_t id_022[8] = { 0x00, 0x01, 0x04, 0x09, 0x13, 0x16, 0x18, 0x00 }; +static const uint16_t id_023[8] = { 0x4a6c, 0x4a7b, 0x4a4b, 0x4a5a, 0x4a2b, 0x4a0a, 0x4a19, 0x4a3a }; /************** @@ -348,7 +348,7 @@ static const UINT16 id_023[8] = { 0x4a6c, 0x4a7b, 0x4a4b, 0x4a5a, 0x4a2b, 0x4a0a void peplus_state::peplus_load_superdata(const char *bank_name) { - UINT8 *super_data = memregion(bank_name)->base(); + uint8_t *super_data = memregion(bank_name)->base(); /* Distribute Superboard Data */ memcpy(m_s3000_ram, &super_data[0x3000], 0x1000); @@ -595,7 +595,7 @@ READ8_MEMBER(peplus_state::peplus_input0_r) 833.3 cycles per millisecond 10 ms = 8333 cycles */ - UINT64 curr_cycles = m_maincpu->total_cycles(); + uint64_t curr_cycles = m_maincpu->total_cycles(); // Allow Bill Insert if DBV Enabled if (m_bv_enable_state == 0x01 && ((m_dbv.read_safe(0xff) & 0x01) == 0x00)) { @@ -810,12 +810,12 @@ READ8_MEMBER(peplus_state::peplus_input_bank_a_r) Bit 6 = LOW BATTERY Bit 7 = I2C EEPROM SDA */ - UINT8 bank_a = 0x50; // Turn Off Low Battery and Hopper Full Statuses - UINT8 coin_optics = 0x00; - UINT8 coin_out = 0x00; - UINT64 curr_cycles = m_maincpu->total_cycles(); + uint8_t bank_a = 0x50; // Turn Off Low Battery and Hopper Full Statuses + uint8_t coin_optics = 0x00; + uint8_t coin_out = 0x00; + uint64_t curr_cycles = m_maincpu->total_cycles(); - UINT8 sda = 0; + uint8_t sda = 0; if(!m_sda_dir) { sda = m_i2cmem->read_sda(); @@ -907,7 +907,7 @@ READ8_MEMBER(peplus_state::peplus_input_bank_a_r) TILE_GET_INFO_MEMBER(peplus_state::get_bg_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int pr = m_palette_ram[tile_index]; int pr2 = m_palette_ram2[tile_index]; int vr = videoram[tile_index]; @@ -928,13 +928,13 @@ TILE_GET_INFO_MEMBER(peplus_state::get_bg_tile_info) void peplus_state::video_start() { m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(peplus_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 40, 25); - m_palette_ram = std::make_unique(0x3000); + m_palette_ram = std::make_unique(0x3000); memset(m_palette_ram.get(), 0, 0x3000); - m_palette_ram2 = std::make_unique(0x3000); + m_palette_ram2 = std::make_unique(0x3000); memset(m_palette_ram2.get(), 0, 0x3000); } -UINT32 peplus_state::screen_update_peplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t peplus_state::screen_update_peplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -943,8 +943,8 @@ UINT32 peplus_state::screen_update_peplus(screen_device &screen, bitmap_ind16 &b PALETTE_INIT_MEMBER(peplus_state, peplus) { - const UINT8 *color_prom = memregion("proms")->base(); - UINT32 proms_size = memregion("proms")->bytes(); + const uint8_t *color_prom = memregion("proms")->base(); + uint32_t proms_size = memregion("proms")->bytes(); /* prom bits 7654 3210 ---- -xxx red component. @@ -1061,8 +1061,8 @@ ADDRESS_MAP_END CUSTOM_INPUT_MEMBER(peplus_state::peplus_input_r) { - UINT8 inp_ret = 0x00; - UINT8 inp_read = ioport((const char *)param)->read(); + uint8_t inp_ret = 0x00; + uint8_t inp_read = ioport((const char *)param)->read(); if (inp_read & 0x01) inp_ret = 0x01; if (inp_read & 0x02) inp_ret = 0x02; diff --git a/src/mame/drivers/pes.cpp b/src/mame/drivers/pes.cpp index ad72b963891..5016cc07b28 100644 --- a/src/mame/drivers/pes.cpp +++ b/src/mame/drivers/pes.cpp @@ -94,7 +94,7 @@ WRITE8_MEMBER(pes_state::pes_kbd_input) /* Helper Functions */ READ8_MEMBER( pes_state::data_to_i8031) { - UINT8 data; + uint8_t data; data = m_infifo[m_infifo_tail_ptr]; // if fifo is empty (tail ptr == head ptr), do not increment the tail ptr, otherwise do. if (m_infifo_tail_ptr != m_infifo_head_ptr) m_infifo_tail_ptr++; @@ -136,7 +136,7 @@ WRITE8_MEMBER( pes_state::port1_w ) READ8_MEMBER( pes_state::port1_r ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; data = m_speech->status_r(space, 0); #ifdef DEBUG_PORTS logerror("port1 read: tms5220 data read: 0x%02X\n", data); @@ -172,7 +172,7 @@ WRITE8_MEMBER( pes_state::port3_w ) READ8_MEMBER( pes_state::port3_r ) { - UINT8 data = m_port3_state & 0xE3; // return last written state with rts, /rdy and /int masked out + uint8_t data = m_port3_state & 0xE3; // return last written state with rts, /rdy and /int masked out // check rts state; if virtual fifo is nonzero, rts is set, otherwise it is cleared if (m_infifo_tail_ptr != m_infifo_head_ptr) { diff --git a/src/mame/drivers/pet.cpp b/src/mame/drivers/pet.cpp index 9e967e41d4b..e138218cc69 100644 --- a/src/mame/drivers/pet.cpp +++ b/src/mame/drivers/pet.cpp @@ -236,7 +236,7 @@ public: required_device m_ram; required_memory_region m_rom; required_memory_region m_char_rom; - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; required_ioport_array<10> m_row; required_ioport m_lock; @@ -249,7 +249,7 @@ public: MC6845_BEGIN_UPDATE( pet_begin_update ); MC6845_UPDATE_ROW( pet40_update_row ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void check_interrupts(); void update_speaker(); @@ -301,7 +301,7 @@ public: }; // keyboard state - UINT8 m_key; + uint8_t m_key; // video state int m_sync; @@ -313,7 +313,7 @@ public: int m_via_cb2; int m_pia1_pa7; - UINT8 m_via_pa; + uint8_t m_via_pa; // interrupt state int m_via_irq; @@ -404,11 +404,11 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - UINT8 m_cr; + uint8_t m_cr; }; -static void cbm_pet_quick_sethiaddress( address_space &space, UINT16 hiaddress ) +static void cbm_pet_quick_sethiaddress( address_space &space, uint16_t hiaddress ) { space.write_byte(0x2e, hiaddress & 0xff); space.write_byte(0x2c, hiaddress & 0xff); @@ -465,7 +465,7 @@ READ8_MEMBER( pet_state::read ) { int sel = offset >> 12; int norom = m_exp->norom_r(space, offset, sel); - UINT8 data = 0; + uint8_t data = 0; data = m_exp->read(space, offset, data, sel); @@ -613,8 +613,8 @@ WRITE8_MEMBER( pet_state::write ) void cbm8296_state::read_pla1(offs_t offset, int phi2, int brw, int noscreen, int noio, int ramsela, int ramsel9, int ramon, int norom, int &cswff, int &cs9, int &csa, int &csio, int &cse, int &cskb, int &fa12, int &casena1) { - UINT32 input = (offset & 0xff00) | phi2 << 7 | brw << 6 | noscreen << 5 | noio << 4 | ramsela << 3 | ramsel9 << 2 | ramon << 1 | norom; - UINT32 data = m_pla1->read(input); + uint32_t input = (offset & 0xff00) | phi2 << 7 | brw << 6 | noscreen << 5 | noio << 4 | ramsela << 3 | ramsel9 << 2 | ramon << 1 | norom; + uint32_t data = m_pla1->read(input); cswff = BIT(data, 0); cs9 = BIT(data, 1); @@ -631,10 +631,10 @@ void cbm8296_state::read_pla1_eprom(offs_t offset, int phi2, int brw, int noscre { // PLA-EPROM adapter by Joachim Nemetz (Jogi) - UINT32 input = (offset & 0xff00) | phi2 << 7 | brw << 6 | noscreen << 5 | noio << 4 | ramsela << 3 | ramsel9 << 2 | ramon << 1 | norom; + uint32_t input = (offset & 0xff00) | phi2 << 7 | brw << 6 | noscreen << 5 | noio << 4 | ramsela << 3 | ramsel9 << 2 | ramon << 1 | norom; input = BITSWAP16(input,13,8,9,7,12,14,11,10,6,5,4,3,2,1,0,15); - UINT8 data = m_ue6_rom->base()[input]; + uint8_t data = m_ue6_rom->base()[input]; data = BITSWAP8(data,7,0,1,2,3,4,5,6); cswff = BIT(data, 0); @@ -654,8 +654,8 @@ void cbm8296_state::read_pla1_eprom(offs_t offset, int phi2, int brw, int noscre void cbm8296_state::read_pla2(offs_t offset, int phi2, int brw, int casena1, int &endra, int &noscreen, int &casena2, int &fa15) { - UINT32 input = BITSWAP8(m_cr, 0,1,2,3,4,5,6,7) << 8 | ((offset >> 8) & 0xf8) | brw << 2 | phi2 << 1 | casena1; - UINT32 data = m_pla2->read(input); + uint32_t input = BITSWAP8(m_cr, 0,1,2,3,4,5,6,7) << 8 | ((offset >> 8) & 0xf8) | brw << 2 | phi2 << 1 | casena1; + uint32_t data = m_pla2->read(input); endra = BIT(data, 4); noscreen = BIT(data, 5); @@ -667,10 +667,10 @@ void cbm8296_state::read_pla2_eprom(offs_t offset, int phi2, int brw, int casena { // PLA-EPROM adapter by Joachim Nemetz (Jogi) - UINT32 input = BITSWAP8(m_cr, 0,1,2,3,4,5,6,7) << 8 | ((offset >> 8) & 0xf8) | brw << 2 | phi2 << 1 | casena1; + uint32_t input = BITSWAP8(m_cr, 0,1,2,3,4,5,6,7) << 8 | ((offset >> 8) & 0xf8) | brw << 2 | phi2 << 1 | casena1; input = BITSWAP16(input,13,8,9,7,12,14,11,10,6,5,4,3,2,1,0,15); - UINT8 data = m_ue5_rom->base()[input]; + uint8_t data = m_ue5_rom->base()[input]; data = BITSWAP8(data,7,0,1,2,3,4,5,6); endra = BIT(data, 4); @@ -701,7 +701,7 @@ READ8_MEMBER( cbm8296_state::read ) //logerror("%s read %04x : norom %u noio %u ramsela %u ramsel9 %u ramon %u / cswff %u cs9 %u csa %u csio %u cse %u cskb %u fa12 %u casena1 %u endra %u noscreen %u casena2 %u fa15 %u\n",machine().describe_context(),offset,norom,noio,ramsela,ramsel9,ramon,cswff,cs9,csa,csio,cse,cskb,fa12,casena1,endra,noscreen,casena2,fa15); - UINT8 data = 0; + uint8_t data = 0; offs_t drma = fa15 << 15 | (offset & 0x7e00) | BIT(offset, 0) << 8 | (offset & 0x1fe) >> 1; @@ -1146,7 +1146,7 @@ READ8_MEMBER( pet_state::via_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // video sync data |= (m_crtc ? m_crtc->vsync_r() : m_sync) << 5; @@ -1231,7 +1231,7 @@ READ8_MEMBER( pet_state::pia1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // keyboard data |= m_key; @@ -1276,7 +1276,7 @@ WRITE8_MEMBER( pet_state::pia1_pa_w ) READ8_MEMBER( pet_state::pia1_pb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_key) { @@ -1297,7 +1297,7 @@ READ8_MEMBER( pet_state::pia1_pb_r ) READ8_MEMBER( pet2001b_state::pia1_pb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_key) { @@ -1365,7 +1365,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( pet_state::sync_tick ) // SCREEN_UPDATE( pet2001 ) //------------------------------------------------- -UINT32 pet_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t pet_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const pen_t *pen = m_palette->pens(); @@ -1375,11 +1375,11 @@ UINT32 pet_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, con { int sy = y / 8; offs_t video_addr = (sy * 40) + sx; - UINT8 lsd = m_video_ram[video_addr]; + uint8_t lsd = m_video_ram[video_addr]; int ra = y & 0x07; offs_t char_addr = (m_graphic << 10) | ((lsd & 0x7f) << 3) | ra; - UINT8 data = m_char_rom->base()[char_addr]; + uint8_t data = m_char_rom->base()[char_addr]; for (int x = 0; x < 8; x++, data <<= 1) { @@ -1411,8 +1411,8 @@ MC6845_UPDATE_ROW( pet80_state::pet80_update_row ) for (int column = 0; column < x_count; column++) { - UINT8 lsd = 0, data = 0; - UINT8 rra = ra & 0x07; + uint8_t lsd = 0, data = 0; + uint8_t rra = ra & 0x07; int no_row = !(BIT(ra, 3) || BIT(ra, 4)); int invert = BIT(ma, 12); int chr_option = BIT(ma, 13); @@ -1459,8 +1459,8 @@ MC6845_UPDATE_ROW( pet_state::pet40_update_row ) for (int column = 0; column < x_count; column++) { - UINT8 lsd = 0, data = 0; - UINT8 rra = ra & 0x07; + uint8_t lsd = 0, data = 0; + uint8_t rra = ra & 0x07; int no_row = !(BIT(ra, 3) || BIT(ra, 4)); int invert = BIT(ma, 12); int chr_option = BIT(ma, 13); @@ -1491,8 +1491,8 @@ MC6845_UPDATE_ROW( pet80_state::cbm8296_update_row ) for (int column = 0; column < x_count; column++) { - UINT8 lsd = 0, data = 0; - UINT8 rra = ra & 0x07; + uint8_t lsd = 0, data = 0; + uint8_t rra = ra & 0x07; int no_row = !BIT(ra, 3); int ra4 = BIT(ra, 4); int chr_option = BIT(ma, 13); @@ -1552,7 +1552,7 @@ MACHINE_START_MEMBER( pet_state, pet ) m_video_ram.allocate(m_video_ram_size); // initialize memory - UINT8 data = 0xff; + uint8_t data = 0xff; for (offs_t offset = 0; offset < m_ram->size(); offset++) { diff --git a/src/mame/drivers/peyper.cpp b/src/mame/drivers/peyper.cpp index 19b9e947b03..b5019533721 100644 --- a/src/mame/drivers/peyper.cpp +++ b/src/mame/drivers/peyper.cpp @@ -62,8 +62,8 @@ public: DECLARE_DRIVER_INIT(odin); DECLARE_DRIVER_INIT(wolfman); private: - UINT8 m_digit; - UINT8 m_disp_layout[36]; + uint8_t m_digit; + uint8_t m_disp_layout[36]; virtual void machine_reset() override; required_device m_maincpu; required_ioport_array<4> m_switch; @@ -84,7 +84,7 @@ READ8_MEMBER( peyper_state::sw_r ) WRITE8_MEMBER( peyper_state::disp_w ) { - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448 /* 0 -> XA0 DPL25,DPL27 1 -> XA1 DPL26,DPL28 @@ -104,8 +104,8 @@ WRITE8_MEMBER( peyper_state::disp_w ) 15 -> DPL31,DPL32 */ - UINT8 i,q,hex_a,a; - UINT8 p = m_digit << 1; + uint8_t i,q,hex_a,a; + uint8_t p = m_digit << 1; for (i = 0; i < 2; i++) { diff --git a/src/mame/drivers/pg685.cpp b/src/mame/drivers/pg685.cpp index 9be95720dc4..9d9776d0d82 100644 --- a/src/mame/drivers/pg685.cpp +++ b/src/mame/drivers/pg685.cpp @@ -108,7 +108,7 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") { } - UINT32 screen_update_pg685(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pg685(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: virtual void machine_reset() override; virtual void video_start() override; @@ -167,7 +167,7 @@ void pg685_state::video_start() -UINT32 pg685_state::screen_update_pg685(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pg685_state::screen_update_pg685(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/pgm.cpp b/src/mame/drivers/pgm.cpp index dbab335f451..ff30d11ee7a 100644 --- a/src/mame/drivers/pgm.cpp +++ b/src/mame/drivers/pgm.cpp @@ -4472,7 +4472,7 @@ ROM_END void pgm_state::expand_colourdata() { - UINT8 *src = memregion( "sprcol" )->base(); + uint8_t *src = memregion( "sprcol" )->base(); size_t srcsize = memregion( "sprcol" )->bytes(); int cnt; size_t needed = srcsize / 2 * 3; @@ -4483,11 +4483,11 @@ void pgm_state::expand_colourdata() while (m_sprite_a_region_size < needed) m_sprite_a_region_size <<= 1; - m_sprite_a_region = std::make_unique(m_sprite_a_region_size); + m_sprite_a_region = std::make_unique(m_sprite_a_region_size); for (cnt = 0 ; cnt < srcsize / 2 ; cnt++) { - UINT16 colpack; + uint16_t colpack; colpack = ((src[cnt * 2]) | (src[cnt * 2 + 1] << 8)); m_sprite_a_region[cnt * 3 + 0] = (colpack >> 0 ) & 0x1f; @@ -4498,7 +4498,7 @@ void pgm_state::expand_colourdata() void pgm_state::pgm_basic_init( bool set_bank) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); if (set_bank) membank("bank1")->set_base(&ROM[0x100000]); expand_colourdata(); diff --git a/src/mame/drivers/pgm2.cpp b/src/mame/drivers/pgm2.cpp index eef0fd51995..813d01a1ee4 100644 --- a/src/mame/drivers/pgm2.cpp +++ b/src/mame/drivers/pgm2.cpp @@ -76,7 +76,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_pgm2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pgm2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_pgm2(screen_device &screen, bool state); required_device m_maincpu; @@ -93,7 +93,7 @@ ADDRESS_MAP_END static INPUT_PORTS_START( pgm2 ) INPUT_PORTS_END -UINT32 pgm2_state::screen_update_pgm2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pgm2_state::screen_update_pgm2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } @@ -171,7 +171,7 @@ GFXDECODE_END void pgm2_state::pgm_create_dummy_internal_arm_region(int addr) { - UINT16 *temp16 = (UINT16 *)memregion("maincpu")->base(); + uint16_t *temp16 = (uint16_t *)memregion("maincpu")->base(); int i; for (i=0;i<0x4000/2;i+=2) { @@ -443,13 +443,13 @@ ROM_START( kov3 ) ROM_END -static void iga_u16_decode(UINT16 *rom, int len, int ixor) +static void iga_u16_decode(uint16_t *rom, int len, int ixor) { int i; for (i = 1; i < len / 2; i+=2) { - UINT16 x = ixor; + uint16_t x = ixor; if ( (i>>1) & 0x000001) x ^= 0x0010; if ( (i>>1) & 0x000002) x ^= 0x2004; @@ -468,13 +468,13 @@ static void iga_u16_decode(UINT16 *rom, int len, int ixor) } } -static void iga_u12_decode(UINT16* rom, int len, int ixor) +static void iga_u12_decode(uint16_t* rom, int len, int ixor) { int i; for (i = 0; i < len / 2; i+=2) { - UINT16 x = ixor; + uint16_t x = ixor; if ( (i>>1) & 0x000001) x ^= 0x9004; if ( (i>>1) & 0x000002) x ^= 0x0028; @@ -495,7 +495,7 @@ static void iga_u12_decode(UINT16* rom, int len, int ixor) DRIVER_INIT_MEMBER(pgm2_state,orleg2) { - UINT16 *src = (UINT16 *)memregion("spritesa")->base(); + uint16_t *src = (uint16_t *)memregion("spritesa")->base(); iga_u12_decode(src, 0x2000000, 0x4761); iga_u16_decode(src, 0x2000000, 0xc79f); @@ -508,7 +508,7 @@ DRIVER_INIT_MEMBER(pgm2_state,orleg2) DRIVER_INIT_MEMBER(pgm2_state,kov2nl) { - UINT16 *src = (UINT16 *)memregion("spritesa")->base(); + uint16_t *src = (uint16_t *)memregion("spritesa")->base(); iga_u12_decode(src, 0x2000000, 0xa193); iga_u16_decode(src, 0x2000000, 0xb780); @@ -521,7 +521,7 @@ DRIVER_INIT_MEMBER(pgm2_state,kov2nl) DRIVER_INIT_MEMBER(pgm2_state,ddpdojh) { - UINT16 *src = (UINT16 *)memregion("spritesa")->base(); + uint16_t *src = (uint16_t *)memregion("spritesa")->base(); iga_u12_decode(src, 0x800000, 0x1e96); iga_u16_decode(src, 0x800000, 0x869c); @@ -534,7 +534,7 @@ DRIVER_INIT_MEMBER(pgm2_state,ddpdojh) DRIVER_INIT_MEMBER(pgm2_state,kov3) { - UINT16 *src = (UINT16 *)memregion("spritesa")->base(); + uint16_t *src = (uint16_t *)memregion("spritesa")->base(); iga_u12_decode(src, 0x2000000, 0x956d); iga_u16_decode(src, 0x2000000, 0x3d17); diff --git a/src/mame/drivers/phantom.cpp b/src/mame/drivers/phantom.cpp index 78ef541403f..ab9f9923319 100644 --- a/src/mame/drivers/phantom.cpp +++ b/src/mame/drivers/phantom.cpp @@ -75,7 +75,7 @@ protected: DRIVER_INIT_MEMBER(phantom_state, fphantom) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0], 0x4000); } diff --git a/src/mame/drivers/phc25.cpp b/src/mame/drivers/phc25.cpp index 9c4462062f0..e1bbc6ccb83 100644 --- a/src/mame/drivers/phc25.cpp +++ b/src/mame/drivers/phc25.cpp @@ -58,7 +58,7 @@ READ8_MEMBER( phc25_state::port40_r ) */ - UINT8 data = 0; + uint8_t data = 0; /* vertical sync */ data |= !m_vdg->fs_r() << 4; diff --git a/src/mame/drivers/phoenix.cpp b/src/mame/drivers/phoenix.cpp index 44f23073adb..395ce097887 100644 --- a/src/mame/drivers/phoenix.cpp +++ b/src/mame/drivers/phoenix.cpp @@ -1420,7 +1420,7 @@ DRIVER_INIT_MEMBER(phoenix_state,condor) DRIVER_INIT_MEMBER(phoenix_state,vautourza) { - UINT8 *rgn = memregion("proms")->base(); + uint8_t *rgn = memregion("proms")->base(); // expand the 8-bit PROM into the same layout as the 4-bit PROMs used by most versions of the game for (int i = 0; i < 0x100; i++) diff --git a/src/mame/drivers/photon.cpp b/src/mame/drivers/photon.cpp index 339986851b4..bf33abedcef 100644 --- a/src/mame/drivers/photon.cpp +++ b/src/mame/drivers/photon.cpp @@ -36,22 +36,22 @@ public: DECLARE_WRITE8_MEMBER(pk8000_80_portc_w); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_photon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_photon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pk8000_interrupt); IRQ_CALLBACK_MEMBER(pk8000_irq_callback); - void pk8000_set_bank(UINT8 data); + void pk8000_set_bank(uint8_t data); required_device m_speaker; }; -void photon_state::pk8000_set_bank(UINT8 data) +void photon_state::pk8000_set_bank(uint8_t data) { - UINT8 *rom = memregion("maincpu")->base(); - UINT8 *ram = memregion("maincpu")->base(); - UINT8 block1 = data & 3; - UINT8 block2 = (data >> 2) & 3; - UINT8 block3 = (data >> 4) & 3; - UINT8 block4 = (data >> 6) & 3; + uint8_t *rom = memregion("maincpu")->base(); + uint8_t *ram = memregion("maincpu")->base(); + uint8_t block1 = data & 3; + uint8_t block2 = (data >> 2) & 3; + uint8_t block3 = (data >> 4) & 3; + uint8_t block4 = (data >> 6) & 3; switch(block1) { case 0: @@ -175,7 +175,7 @@ void photon_state::video_start() { } -UINT32 photon_state::screen_update_photon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t photon_state::screen_update_photon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return pk8000_video_update(screen, bitmap, cliprect, memregion("maincpu")->base()); } diff --git a/src/mame/drivers/photon2.cpp b/src/mame/drivers/photon2.cpp index 4377068b3fa..af17cb91d56 100644 --- a/src/mame/drivers/photon2.cpp +++ b/src/mame/drivers/photon2.cpp @@ -38,12 +38,12 @@ public: required_device m_maincpu; required_device m_speaker; - required_shared_ptr m_spectrum_video_ram; + required_shared_ptr m_spectrum_video_ram; int m_spectrum_frame_number; int m_spectrum_flash_invert; - UINT8 m_spectrum_port_fe; - UINT8 m_nmi_enable; + uint8_t m_spectrum_port_fe; + uint8_t m_nmi_enable; DECLARE_WRITE8_MEMBER(membank_w); DECLARE_READ8_MEMBER(fe_r); @@ -54,7 +54,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(photon2); - UINT32 screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_spectrum(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(spec_interrupt_hack); @@ -149,12 +149,12 @@ void photon2_state::screen_eof_spectrum(screen_device &screen, bool state) } } -static inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color) +static inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color) { - bitmap.pix16(y, x) = (UINT16)color; + bitmap.pix16(y, x) = (uint16_t)color; } -UINT32 photon2_state::screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t photon2_state::screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* for now do a full-refresh */ int x, y, b, scrx, scry; diff --git a/src/mame/drivers/photoply.cpp b/src/mame/drivers/photoply.cpp index bd4c1ff5e1f..18e389e6d90 100644 --- a/src/mame/drivers/photoply.cpp +++ b/src/mame/drivers/photoply.cpp @@ -27,7 +27,7 @@ public: { } - UINT8 m_vga_address; + uint8_t m_vga_address; DECLARE_DRIVER_INIT(photoply); virtual void machine_start() override; diff --git a/src/mame/drivers/phunsy.cpp b/src/mame/drivers/phunsy.cpp index 753c15ac08e..2221597d4b5 100644 --- a/src/mame/drivers/phunsy.cpp +++ b/src/mame/drivers/phunsy.cpp @@ -60,17 +60,17 @@ public: DECLARE_WRITE_LINE_MEMBER(cass_w); DECLARE_QUICKLOAD_LOAD_MEMBER(phunsy); DECLARE_PALETTE_INIT(phunsy); - 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); private: - const UINT8 *m_p_chargen; - UINT8 m_data_out; - UINT8 m_keyboard_input; + const uint8_t *m_p_chargen; + uint8_t m_data_out; + uint8_t m_keyboard_input; virtual void machine_reset() override; virtual void video_start() override; required_device m_maincpu; required_device m_speaker; required_device m_cass; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; }; @@ -144,7 +144,7 @@ WRITE8_MEMBER( phunsy_state::phunsy_data_w ) READ8_MEMBER( phunsy_state::phunsy_data_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; //if (LOG) //logerror("%s: phunsy_data_r\n", machine().describe_context()); @@ -212,16 +212,16 @@ void phunsy_state::video_start() } -UINT32 phunsy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t phunsy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx,col; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx,col; + uint16_t sy=0,ma=0,x; for (y = 0; y < 32; y++) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma+64; x++) { @@ -280,9 +280,9 @@ GFXDECODE_END QUICKLOAD_LOAD_MEMBER( phunsy_state, phunsy ) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT16 i; - UINT16 quick_addr = 0x1800; - std::vector quick_data; + uint16_t i; + uint16_t quick_addr = 0x1800; + std::vector quick_data; image_init_result result = image_init_result::FAIL; int quick_length = image.length(); if (quick_length > 0x4000) @@ -295,7 +295,7 @@ QUICKLOAD_LOAD_MEMBER( phunsy_state, phunsy ) quick_data.resize(quick_length); membank("bankru")->set_entry(0); // point at ram - UINT16 exec_addr = quick_addr + 2; + uint16_t exec_addr = quick_addr + 2; for (i = 0; i < quick_length; i++) space.write_byte(i+quick_addr, quick_data[i]); @@ -318,9 +318,9 @@ QUICKLOAD_LOAD_MEMBER( phunsy_state, phunsy ) DRIVER_INIT_MEMBER( phunsy_state, phunsy ) { - UINT8 *main = memregion("maincpu")->base(); - UINT8 *roms = memregion("roms")->base(); - UINT8 *ram = memregion("ram_4000")->base(); + uint8_t *main = memregion("maincpu")->base(); + uint8_t *roms = memregion("roms")->base(); + uint8_t *ram = memregion("ram_4000")->base(); membank("bankru")->configure_entry(0, &main[0x1800]); membank("bankwu")->configure_entry(0, &main[0x1800]); diff --git a/src/mame/drivers/piggypas.cpp b/src/mame/drivers/piggypas.cpp index b5b028412fc..e1a0d8e16d1 100644 --- a/src/mame/drivers/piggypas.cpp +++ b/src/mame/drivers/piggypas.cpp @@ -35,8 +35,8 @@ public: required_device m_maincpu; required_device m_ticket; - UINT8 m_ctrl; - UINT8 m_digit_idx; + uint8_t m_ctrl; + uint8_t m_digit_idx; }; diff --git a/src/mame/drivers/pimps.cpp b/src/mame/drivers/pimps.cpp index 331880384aa..3f292a47949 100644 --- a/src/mame/drivers/pimps.cpp +++ b/src/mame/drivers/pimps.cpp @@ -41,7 +41,7 @@ public: DECLARE_READ8_MEMBER(term_status_r); DECLARE_READ8_MEMBER(term_r); DECLARE_WRITE8_MEMBER(kbd_put); - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; required_device m_terminal; @@ -59,7 +59,7 @@ READ8_MEMBER( pimps_state::term_status_r ) READ8_MEMBER( pimps_state::term_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/pinball2k.cpp b/src/mame/drivers/pinball2k.cpp index 9dd759a082d..b79dbea3fca 100644 --- a/src/mame/drivers/pinball2k.cpp +++ b/src/mame/drivers/pinball2k.cpp @@ -39,37 +39,37 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_main_ram; - required_shared_ptr m_cga_ram; - required_shared_ptr m_bios_ram; - required_shared_ptr m_vram; + required_shared_ptr m_main_ram; + required_shared_ptr m_cga_ram; + required_shared_ptr m_bios_ram; + required_shared_ptr m_vram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - UINT8 m_pal[768]; + uint8_t m_pal[768]; - UINT32 m_disp_ctrl_reg[256/4]; + uint32_t m_disp_ctrl_reg[256/4]; int m_frame_width; int m_frame_height; - UINT32 m_memory_ctrl_reg[256/4]; + uint32_t m_memory_ctrl_reg[256/4]; int m_pal_index; - UINT32 m_biu_ctrl_reg[256/4]; + uint32_t m_biu_ctrl_reg[256/4]; - UINT8 m_mediagx_config_reg_sel; - UINT8 m_mediagx_config_regs[256]; + uint8_t m_mediagx_config_reg_sel; + uint8_t m_mediagx_config_regs[256]; - //UINT8 m_controls_data; - UINT8 m_parallel_pointer; - UINT8 m_parallel_latched; - UINT32 m_parport; + //uint8_t m_controls_data; + uint8_t m_parallel_pointer; + uint8_t m_parallel_latched; + uint32_t m_parport; //int m_control_num; //int m_control_num2; //int m_control_read; - UINT32 m_cx5510_regs[256/4]; + uint32_t m_cx5510_regs[256/4]; DECLARE_READ32_MEMBER(disp_ctrl_r); DECLARE_WRITE32_MEMBER(disp_ctrl_w); @@ -89,7 +89,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y); void draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -149,7 +149,7 @@ void pinball2k_state::video_start() void pinball2k_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y) { int i,j; - const UINT8 *dp; + const uint8_t *dp; int index = 0; const pen_t *pens = m_palette->pens(); @@ -157,10 +157,10 @@ void pinball2k_state::draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, for (j=y; j < y+8; j++) { - UINT32 *p = &bitmap.pix32(j); + uint32_t *p = &bitmap.pix32(j); for (i=x; i < x+8; i++) { - UINT8 pen = dp[index++]; + uint8_t pen = dp[index++]; if (pen) p[i] = pens[gfx->colorbase() + (att & 0xf)]; else @@ -201,13 +201,13 @@ void pinball2k_state::draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &cl if (m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1) // 8-bit mode { - UINT8 *framebuf = (UINT8*)&m_vram[m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; - UINT8 *pal = m_pal; + uint8_t *framebuf = (uint8_t*)&m_vram[m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; + uint8_t *pal = m_pal; for (j=0; j < m_frame_height; j++) { - UINT32 *p = &bitmap.pix32(j); - UINT8 *si = &framebuf[j * line_delta]; + uint32_t *p = &bitmap.pix32(j); + uint8_t *si = &framebuf[j * line_delta]; for (i=0; i < m_frame_width; i++) { int c = *si++; @@ -221,18 +221,18 @@ void pinball2k_state::draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &cl } else // 16-bit { - UINT16 *framebuf = (UINT16*)&m_vram[m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; + uint16_t *framebuf = (uint16_t*)&m_vram[m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4]; // RGB 5-6-5 mode if ((m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x2) == 0) { for (j=0; j < m_frame_height; j++) { - UINT32 *p = &bitmap.pix32(j); - UINT16 *si = &framebuf[j * (line_delta/2)]; + uint32_t *p = &bitmap.pix32(j); + uint16_t *si = &framebuf[j * (line_delta/2)]; for (i=0; i < m_frame_width; i++) { - UINT16 c = *si++; + uint16_t c = *si++; int r = ((c >> 11) & 0x1f) << 3; int g = ((c >> 5) & 0x3f) << 2; int b = (c & 0x1f) << 3; @@ -246,11 +246,11 @@ void pinball2k_state::draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &cl { for (j=0; j < m_frame_height; j++) { - UINT32 *p = &bitmap.pix32(j); - UINT16 *si = &framebuf[j * (line_delta/2)]; + uint32_t *p = &bitmap.pix32(j); + uint16_t *si = &framebuf[j * (line_delta/2)]; for (i=0; i < m_frame_width; i++) { - UINT16 c = *si++; + uint16_t c = *si++; int r = ((c >> 10) & 0x1f) << 3; int g = ((c >> 5) & 0x1f) << 3; int b = (c & 0x1f) << 3; @@ -266,7 +266,7 @@ void pinball2k_state::draw_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect) { int i, j; gfx_element *gfx = m_gfxdecode->gfx(0); - UINT32 *cga = m_cga_ram; + uint32_t *cga = m_cga_ram; int index = 0; for (j=0; j < 25; j++) @@ -285,7 +285,7 @@ void pinball2k_state::draw_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect) } } -UINT32 pinball2k_state::screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t pinball2k_state::screen_update_mediagx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); @@ -300,7 +300,7 @@ UINT32 pinball2k_state::screen_update_mediagx(screen_device &screen, bitmap_rgb3 READ32_MEMBER(pinball2k_state::disp_ctrl_r) { - UINT32 r = m_disp_ctrl_reg[offset]; + uint32_t r = m_disp_ctrl_reg[offset]; switch (offset) { @@ -391,7 +391,7 @@ WRITE32_MEMBER(pinball2k_state::bios_ram_w) READ8_MEMBER(pinball2k_state::io20_r) { - UINT8 r = 0; + uint8_t r = 0; // 0x22, 0x23, Cyrix configuration registers if (offset == 0x00) @@ -437,7 +437,7 @@ WRITE32_MEMBER(pinball2k_state::port800_w) READ32_MEMBER(pinball2k_state::parallel_port_r) { - UINT32 r = 0; + uint32_t r = 0; return r; } @@ -446,7 +446,7 @@ WRITE32_MEMBER(pinball2k_state::parallel_port_w) { } -static UINT32 cx5510_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t cx5510_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { pinball2k_state *state = busdevice->machine().driver_data(); @@ -459,7 +459,7 @@ static UINT32 cx5510_pci_r(device_t *busdevice, device_t *device, int function, return state->m_cx5510_regs[reg/4]; } -static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void cx5510_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { pinball2k_state *state = busdevice->machine().driver_data(); @@ -578,7 +578,7 @@ void pinball2k_state::machine_start() void pinball2k_state::machine_reset() { - UINT8 *rom = memregion("bios")->base(); + uint8_t *rom = memregion("bios")->base(); memcpy(m_bios_ram, rom, 0x40000); m_maincpu->reset(); diff --git a/src/mame/drivers/pingpong.cpp b/src/mame/drivers/pingpong.cpp index 7af2d70aa73..4b1210999ca 100644 --- a/src/mame/drivers/pingpong.cpp +++ b/src/mame/drivers/pingpong.cpp @@ -39,7 +39,7 @@ WRITE8_MEMBER(pingpong_state::cashquiz_question_bank_low_w) static const char * const bankname[] = { "bank1", "bank2", "bank3", "bank4", "bank5", "bank6", "bank7", "bank8" }; const char *bank = bankname[data & 7]; int bankaddr = m_question_addr_high | ((data - 0x60) * 0x100); - UINT8 *questions = memregion("user1")->base() + bankaddr; + uint8_t *questions = memregion("user1")->base() + bankaddr; membank(bank)->set_base(questions); } @@ -560,7 +560,7 @@ ROM_END DRIVER_INIT_MEMBER(pingpong_state,merlinmm) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; /* decrypt program code */ @@ -570,7 +570,7 @@ DRIVER_INIT_MEMBER(pingpong_state,merlinmm) DRIVER_INIT_MEMBER(pingpong_state,cashquiz) { - UINT8 *ROM; + uint8_t *ROM; int i; /* decrypt program code */ diff --git a/src/mame/drivers/pinkiri8.cpp b/src/mame/drivers/pinkiri8.cpp index 0fd9b480e22..2dfb990dd41 100644 --- a/src/mame/drivers/pinkiri8.cpp +++ b/src/mame/drivers/pinkiri8.cpp @@ -61,21 +61,21 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_janshi_back_vram; - required_shared_ptr m_janshi_vram1; - required_shared_ptr m_janshi_unk1; - required_shared_ptr m_janshi_widthflags; - required_shared_ptr m_janshi_unk2; - required_shared_ptr m_janshi_vram2; - required_shared_ptr m_janshi_paletteram; - required_shared_ptr m_janshi_paletteram2; - required_shared_ptr m_janshi_crtc_regs; - UINT32 m_vram_addr; + required_shared_ptr m_janshi_back_vram; + required_shared_ptr m_janshi_vram1; + required_shared_ptr m_janshi_unk1; + required_shared_ptr m_janshi_widthflags; + required_shared_ptr m_janshi_unk2; + required_shared_ptr m_janshi_vram2; + required_shared_ptr m_janshi_paletteram; + required_shared_ptr m_janshi_paletteram2; + required_shared_ptr m_janshi_crtc_regs; + uint32_t m_vram_addr; int m_prev_writes; - UINT8 m_mux_data; - UINT8 m_prot_read_index; - UINT8 m_prot_char[5]; - UINT8 m_prot_index; + uint8_t m_mux_data; + uint8_t m_prot_read_index; + uint8_t m_prot_char[5]; + uint8_t m_prot_index; DECLARE_WRITE8_MEMBER(output_regs_w); DECLARE_WRITE8_MEMBER(pinkiri8_vram_w); DECLARE_WRITE8_MEMBER(mux_w); @@ -87,7 +87,7 @@ public: DECLARE_READ8_MEMBER(ronjan_patched_prot_r); DECLARE_DRIVER_INIT(ronjan); virtual void video_start() override; - UINT32 screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -103,7 +103,7 @@ class janshi_vdp_device : public device_t, public device_memory_interface { public: - janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_ADDRESS_MAP(map, 8); protected: virtual void device_config_complete() override; @@ -133,7 +133,7 @@ ADDRESS_MAP_END const device_type JANSHIVDP = &device_creator; -janshi_vdp_device::janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +janshi_vdp_device::janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JANSHIVDP, "Janshi VDP", tag, owner, clock, "janshi_vdp", __FILE__), device_memory_interface(mconfig, *this), m_space_config("janshi_vdp", ENDIANNESS_LITTLE, 8,24, 0, address_map_delegate(FUNC(janshi_vdp_device::map), this)) @@ -325,12 +325,12 @@ void pinkiri8_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } } -UINT32 pinkiri8_state::screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pinkiri8_state::screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* update palette */ for (int pen = 0; pen < 0x800 ; pen++) { - UINT16 val = (m_janshi_paletteram[pen]) | (m_janshi_paletteram2[pen]<<8); + uint16_t val = (m_janshi_paletteram[pen]) | (m_janshi_paletteram2[pen]<<8); int r = (val & 0x001f) >> 0; int g = (val & 0x03e0) >> 5; int b = (val & 0x7c00) >> 10; diff --git a/src/mame/drivers/pipbug.cpp b/src/mame/drivers/pipbug.cpp index 9088b21663f..8b754ccc075 100644 --- a/src/mame/drivers/pipbug.cpp +++ b/src/mame/drivers/pipbug.cpp @@ -96,7 +96,7 @@ QUICKLOAD_LOAD_MEMBER( pipbug_state, pipbug ) int quick_addr = 0x440; int exec_addr; int quick_length; - std::vector quick_data; + std::vector quick_data; int read_; image_init_result result = image_init_result::FAIL; diff --git a/src/mame/drivers/pipedrm.cpp b/src/mame/drivers/pipedrm.cpp index 9fc4984a3a2..6f8764ac51f 100644 --- a/src/mame/drivers/pipedrm.cpp +++ b/src/mame/drivers/pipedrm.cpp @@ -905,7 +905,7 @@ DRIVER_INIT_MEMBER(pipedrm_state,pipedrm) { const memory_share *share = memshare("palette"); /* sprite RAM lives at the end of palette RAM */ - m_spriteram.set_target((UINT8*)share->ptr() + 0xc00, 0x400); + m_spriteram.set_target((uint8_t*)share->ptr() + 0xc00, 0x400); m_maincpu->space(AS_PROGRAM).install_ram(0xcc00, 0xcfff, m_spriteram); } diff --git a/src/mame/drivers/pipeline.cpp b/src/mame/drivers/pipeline.cpp index bd0bb6c0915..ac50b77c0a0 100644 --- a/src/mame/drivers/pipeline.cpp +++ b/src/mame/drivers/pipeline.cpp @@ -89,17 +89,17 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_vram1; - required_shared_ptr m_vram2; + required_shared_ptr m_vram1; + required_shared_ptr m_vram2; tilemap_t *m_tilemap1; tilemap_t *m_tilemap2; - UINT8 m_vidctrl; - std::unique_ptr m_palram; - UINT8 m_toMCU; - UINT8 m_fromMCU; - UINT8 m_ddrA; + uint8_t m_vidctrl; + std::unique_ptr m_palram; + uint8_t m_toMCU; + uint8_t m_fromMCU; + uint8_t m_ddrA; DECLARE_WRITE8_MEMBER(vram2_w); DECLARE_WRITE8_MEMBER(vram1_w); @@ -117,7 +117,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(pipeline); - 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); TIMER_CALLBACK_MEMBER(protection_deferred_w); }; @@ -151,7 +151,7 @@ TILE_GET_INFO_MEMBER(pipeline_state::get_tile_info2) void pipeline_state::video_start() { - m_palram=std::make_unique(0x1000); + m_palram=std::make_unique(0x1000); m_tilemap1 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(pipeline_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32 ); m_tilemap2 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(pipeline_state::get_tile_info2),this),TILEMAP_SCAN_ROWS,8,8,64,32 ); m_tilemap2->set_transparent_pen(0); @@ -160,7 +160,7 @@ void pipeline_state::video_start() save_pointer(NAME(m_palram.get()), 0x1000); } -UINT32 pipeline_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pipeline_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap1->draw(screen, bitmap, cliprect, 0,0); m_tilemap2->draw(screen, bitmap, cliprect, 0,0); @@ -345,8 +345,8 @@ static const z80_daisy_config daisy_chain_sound[] = PALETTE_INIT_MEMBER(pipeline_state, pipeline) { int r,g,b,i,c; - UINT8 *prom1 = &memregion("proms")->base()[0x000]; - UINT8 *prom2 = &memregion("proms")->base()[0x100]; + uint8_t *prom1 = &memregion("proms")->base()[0x000]; + uint8_t *prom2 = &memregion("proms")->base()[0x100]; for(i=0;i<0x100;i++) { diff --git a/src/mame/drivers/pirates.cpp b/src/mame/drivers/pirates.cpp index 99732d01edc..c315a705688 100644 --- a/src/mame/drivers/pirates.cpp +++ b/src/mame/drivers/pirates.cpp @@ -351,16 +351,16 @@ ROM_END void pirates_state::decrypt_68k() { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); size_t rom_size = memregion("maincpu")->bytes(); - std::vector buf(rom_size/2); + std::vector buf(rom_size/2); memcpy (&buf[0], rom, rom_size); for (int i=0; ibytes(); - std::vector buf(rom_size); + std::vector buf(rom_size); rom = memregion("gfx1")->base(); memcpy (&buf[0], rom, rom_size); @@ -398,12 +398,12 @@ void pirates_state::decrypt_p() void pirates_state::decrypt_s() { int rom_size; - UINT8 *rom; + uint8_t *rom; int i; rom_size = memregion("gfx2")->bytes(); - std::vector buf(rom_size); + std::vector buf(rom_size); rom = memregion("gfx2")->base(); memcpy (&buf[0], rom, rom_size); @@ -422,12 +422,12 @@ void pirates_state::decrypt_s() void pirates_state::decrypt_oki() { int rom_size; - UINT8 *rom; + uint8_t *rom; int i; rom_size = memregion("oki")->bytes(); - std::vector buf(rom_size); + std::vector buf(rom_size); rom = memregion("oki")->base(); memcpy (&buf[0], rom, rom_size); @@ -442,7 +442,7 @@ void pirates_state::decrypt_oki() DRIVER_INIT_MEMBER(pirates_state,pirates) { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); decrypt_68k(); decrypt_p(); diff --git a/src/mame/drivers/pitagjr.cpp b/src/mame/drivers/pitagjr.cpp index 4049583fe15..81dd4b007d6 100644 --- a/src/mame/drivers/pitagjr.cpp +++ b/src/mame/drivers/pitagjr.cpp @@ -168,7 +168,7 @@ public: virtual void machine_start() override; DECLARE_PALETTE_INIT(pitagjr); - 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); }; @@ -194,7 +194,7 @@ PALETTE_INIT_MEMBER(pitagjr_state, pitagjr) palette.set_pen_color(1, rgb_t(92, 83, 88)); } -UINT32 pitagjr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pitagjr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/pk8000.cpp b/src/mame/drivers/pk8000.cpp index 5afeecdfe21..7560ab6fb0f 100644 --- a/src/mame/drivers/pk8000.cpp +++ b/src/mame/drivers/pk8000.cpp @@ -42,13 +42,13 @@ public: , m_io_joy2(*this, "JOY2") { } - UINT8 m_keyboard_line; + uint8_t m_keyboard_line; DECLARE_READ8_MEMBER(pk8000_joy_1_r); DECLARE_READ8_MEMBER(pk8000_joy_2_r); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_pk8000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pk8000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pk8000_interrupt); DECLARE_WRITE8_MEMBER(pk8000_80_porta_w); DECLARE_READ8_MEMBER(pk8000_80_portb_r); @@ -74,19 +74,19 @@ protected: required_ioport m_io_joy2; ioport_port *m_io_port[10]; - void pk8000_set_bank(UINT8 data); + void pk8000_set_bank(uint8_t data); }; -void pk8000_state::pk8000_set_bank(UINT8 data) +void pk8000_state::pk8000_set_bank(uint8_t data) { - UINT8 *rom = m_region_maincpu->base(); - UINT8 *ram = m_ram->pointer(); - UINT8 block1 = data & 3; - UINT8 block2 = (data >> 2) & 3; - UINT8 block3 = (data >> 4) & 3; - UINT8 block4 = (data >> 6) & 3; + uint8_t *rom = m_region_maincpu->base(); + uint8_t *ram = m_ram->pointer(); + uint8_t block1 = data & 3; + uint8_t block2 = (data >> 2) & 3; + uint8_t block3 = (data >> 4) & 3; + uint8_t block4 = (data >> 6) & 3; switch(block1) { case 0: @@ -163,13 +163,13 @@ WRITE8_MEMBER(pk8000_state::pk8000_80_portc_w) READ8_MEMBER(pk8000_state::pk8000_joy_1_r) { - UINT8 retVal = (m_cassette->input() > 0.0038 ? 0x80 : 0); + uint8_t retVal = (m_cassette->input() > 0.0038 ? 0x80 : 0); retVal |= m_io_joy1->read() & 0x7f; return retVal; } READ8_MEMBER(pk8000_state::pk8000_joy_2_r) { - UINT8 retVal = (m_cassette->input() > 0.0038 ? 0x80 : 0); + uint8_t retVal = (m_cassette->input() > 0.0038 ? 0x80 : 0); retVal |= m_io_joy2->read() & 0x7f; return retVal; } @@ -338,7 +338,7 @@ void pk8000_state::video_start() { } -UINT32 pk8000_state::screen_update_pk8000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pk8000_state::screen_update_pk8000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return pk8000_video_update(screen, bitmap, cliprect, m_ram->pointer()); } diff --git a/src/mame/drivers/pkscram.cpp b/src/mame/drivers/pkscram.cpp index cb2ddb817a2..cf431d9c6cd 100644 --- a/src/mame/drivers/pkscram.cpp +++ b/src/mame/drivers/pkscram.cpp @@ -31,11 +31,11 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen") { } - UINT16 m_out; - UINT8 m_interrupt_line_active; - required_shared_ptr m_pkscramble_fgtilemap_ram; - required_shared_ptr m_pkscramble_mdtilemap_ram; - required_shared_ptr m_pkscramble_bgtilemap_ram; + uint16_t m_out; + uint8_t m_interrupt_line_active; + required_shared_ptr m_pkscramble_fgtilemap_ram; + required_shared_ptr m_pkscramble_mdtilemap_ram; + required_shared_ptr m_pkscramble_bgtilemap_ram; tilemap_t *m_fg_tilemap; tilemap_t *m_md_tilemap; tilemap_t *m_bg_tilemap; @@ -49,7 +49,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_pkscramble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pkscramble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback); DECLARE_WRITE_LINE_MEMBER(irqhandler); required_device m_maincpu; @@ -253,7 +253,7 @@ void pkscram_state::video_start() m_fg_tilemap->set_transparent_pen(15); } -UINT32 pkscram_state::screen_update_pkscramble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pkscram_state::screen_update_pkscramble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); m_md_tilemap->draw(screen, bitmap, cliprect, 0,0); diff --git a/src/mame/drivers/pktgaldx.cpp b/src/mame/drivers/pktgaldx.cpp index f4e3635a2dc..b22a56bf92f 100644 --- a/src/mame/drivers/pktgaldx.cpp +++ b/src/mame/drivers/pktgaldx.cpp @@ -73,15 +73,15 @@ WRITE16_MEMBER(pktgaldx_state::pktgaldx_oki_bank_w) READ16_MEMBER( pktgaldx_state::pktgaldx_protection_region_f_104_r ) { int real_address = 0 + (offset *2); - UINT8 cs = 0; - UINT16 data = m_deco104->read_data( real_address&0x7fff, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco104->read_data( real_address&0x7fff, mem_mask, cs ); return data; } WRITE16_MEMBER( pktgaldx_state::pktgaldx_protection_region_f_104_w ) { int real_address = 0 + (offset *2); - UINT8 cs = 0; + uint8_t cs = 0; m_deco104->write_data( space, real_address&0x7fff, data, mem_mask, cs ); } @@ -478,7 +478,7 @@ ROM_END DRIVER_INIT_MEMBER(pktgaldx_state,pktgaldx) { deco56_decrypt_gfx(machine(), "gfx1"); - deco102_decrypt_cpu((UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0x42ba, 0x00, 0x00); + deco102_decrypt_cpu((uint16_t *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0x42ba, 0x00, 0x00); } GAME( 1992, pktgaldx, 0, pktgaldx, pktgaldx, pktgaldx_state, pktgaldx, ROT0, "Data East Corporation", "Pocket Gal Deluxe (Euro v3.00)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/plan80.cpp b/src/mame/drivers/plan80.cpp index 8ab84821f91..c7f48a1e59b 100644 --- a/src/mame/drivers/plan80.cpp +++ b/src/mame/drivers/plan80.cpp @@ -44,12 +44,12 @@ public: required_device m_maincpu; DECLARE_READ8_MEMBER(plan80_04_r); DECLARE_WRITE8_MEMBER(plan80_09_w); - required_shared_ptr m_p_videoram; - const UINT8* m_p_chargen; - UINT8 m_kbd_row; + required_shared_ptr m_p_videoram; + const uint8_t* m_p_chargen; + uint8_t m_kbd_row; virtual void machine_reset() override; virtual void video_start() override; - 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); DECLARE_DRIVER_INIT(plan80); protected: @@ -58,7 +58,7 @@ protected: READ8_MEMBER( plan80_state::plan80_04_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_kbd_row == 0xfe) data = ioport("LINE0")->read(); @@ -170,7 +170,7 @@ void plan80_state::machine_reset() DRIVER_INIT_MEMBER(plan80_state,plan80) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xf800); } @@ -179,16 +179,16 @@ void plan80_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 plan80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t plan80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for (y = 0; y < 32; y++) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma+48; x++) { diff --git a/src/mame/drivers/play_1.cpp b/src/mame/drivers/play_1.cpp index 574acabac28..1f8638cfb99 100644 --- a/src/mame/drivers/play_1.cpp +++ b/src/mame/drivers/play_1.cpp @@ -51,12 +51,12 @@ public: DECLARE_WRITE_LINE_MEMBER(clock_w); private: - UINT16 m_resetcnt; - UINT16 m_clockcnt; - UINT16 m_waitcnt; - UINT8 m_segment; - UINT8 m_match; - UINT8 m_ball; + uint16_t m_resetcnt; + uint16_t m_clockcnt; + uint16_t m_waitcnt; + uint8_t m_segment; + uint8_t m_match; + uint8_t m_ball; virtual void machine_reset() override; required_device m_maincpu; required_ioport_array<4> m_dips; @@ -249,7 +249,7 @@ void play_1_state::machine_reset() READ8_MEMBER( play_1_state::port07_r ) { - UINT8 data = m_dips[3]->read() & 0x3f; + uint8_t data = m_dips[3]->read() & 0x3f; data |= (m_segment & m_dips[1]->read()) ? 0x40 : 0; data |= (m_segment & m_dips[2]->read()) ? 0x80 : 0; return data; @@ -257,7 +257,7 @@ READ8_MEMBER( play_1_state::port07_r ) WRITE8_MEMBER( play_1_state::port01_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 // d0-1 via 4013 to match-game board // d4-7 via 4511 to match-game board if (BIT(data, 0)) @@ -289,7 +289,7 @@ WRITE8_MEMBER( play_1_state::port02_w ) WRITE8_MEMBER( play_1_state::port03_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 // D1-4, digit select switch (~data & 15) { @@ -321,8 +321,8 @@ WRITE8_MEMBER( play_1_state::port03_w ) // display player number { char wordnum[8]; - UINT8 player = m_segment >> 5; - for (UINT8 i = 1; i < 5; i++) + uint8_t player = m_segment >> 5; + for (uint8_t i = 1; i < 5; i++) { sprintf(wordnum,"text%d", i); output().set_value(wordnum, (player == i) ? 0:1); diff --git a/src/mame/drivers/play_2.cpp b/src/mame/drivers/play_2.cpp index 73c4dea293a..b62b562d8d1 100644 --- a/src/mame/drivers/play_2.cpp +++ b/src/mame/drivers/play_2.cpp @@ -70,14 +70,14 @@ public: DECLARE_DRIVER_INIT(zira); private: - UINT16 m_clockcnt; - UINT16 m_resetcnt; - UINT8 m_kbdrow; - UINT8 m_segment[5]; + uint16_t m_clockcnt; + uint16_t m_resetcnt; + uint8_t m_kbdrow; + uint8_t m_segment[5]; bool m_disp_sw; - UINT8 m_soundlatch; - UINT8 m_psg_latch; - UINT8 m_port06; + uint8_t m_soundlatch; + uint8_t m_psg_latch; + uint8_t m_port06; virtual void machine_reset() override; required_device m_maincpu; required_device m_4013a; @@ -191,7 +191,7 @@ void play_2_state::machine_reset() m_kbdrow = 0; m_disp_sw = 0; m_port06 = 0; - for (UINT8 i = 0; i < 5; i++) + for (uint8_t i = 0; i < 5; i++) m_segment[i] = 0; m_1863->oe_w(1); } @@ -202,9 +202,9 @@ WRITE8_MEMBER( play_2_state::port01_w ) if (m_kbdrow && m_disp_sw) { m_disp_sw = 0; - for (UINT8 j = 0; j < 6; j++) + for (uint8_t j = 0; j < 6; j++) if (BIT(m_kbdrow, j)) - for (UINT8 i = 0; i < 5; i++) + for (uint8_t i = 0; i < 5; i++) output().set_digit_value(j*10 + i, m_segment[i] & 0x7f); } m_1863->set_output_gain(0, BIT(data, 7) ? 1.00 : 0.00); @@ -227,7 +227,7 @@ WRITE8_MEMBER( play_2_state::port03_w ) READ8_MEMBER( play_2_state::port04_r ) { if (m_kbdrow & 0x3f) - for (UINT8 i = 0; i < 6; i++) + for (uint8_t i = 0; i < 6; i++) if (BIT(m_kbdrow, i)) return m_keyboard[i]->read(); diff --git a/src/mame/drivers/play_3.cpp b/src/mame/drivers/play_3.cpp index 4295b8a60bb..f92e7f4563b 100644 --- a/src/mame/drivers/play_3.cpp +++ b/src/mame/drivers/play_3.cpp @@ -87,14 +87,14 @@ public: DECLARE_READ_LINE_MEMBER(clear_a_r); private: - UINT16 m_clockcnt; - UINT16 m_resetcnt; - UINT16 m_resetcnt_a; - UINT8 m_soundlatch; - UINT8 m_a_irqset; - UINT16 m_a_irqcnt; - UINT8 m_kbdrow; - UINT8 m_segment[5]; + uint16_t m_clockcnt; + uint16_t m_resetcnt; + uint16_t m_resetcnt_a; + uint8_t m_soundlatch; + uint8_t m_a_irqset; + uint16_t m_a_irqcnt; + uint8_t m_kbdrow; + uint8_t m_segment[5]; bool m_disp_sw; virtual void machine_reset() override; required_device m_maincpu; @@ -256,7 +256,7 @@ void play_3_state::machine_reset() m_soundlatch = 0; m_kbdrow = 0; m_disp_sw = 0; - for (UINT8 i = 0; i < 5; i++) + for (uint8_t i = 0; i < 5; i++) m_segment[i] = 0; } @@ -266,9 +266,9 @@ WRITE8_MEMBER( play_3_state::port01_w ) if (m_kbdrow && m_disp_sw) { m_disp_sw = 0; - for (UINT8 j = 0; j < 6; j++) + for (uint8_t j = 0; j < 6; j++) if (BIT(m_kbdrow, j)) - for (UINT8 i = 0; i < 5; i++) + for (uint8_t i = 0; i < 5; i++) { output().set_digit_value(j*10 + i, m_segment[i] & 0x7f); // decimal dot on tens controls if last 0 shows or not @@ -281,7 +281,7 @@ WRITE8_MEMBER( play_3_state::port01_w ) // megaaton status digits are rearranged slightly WRITE8_MEMBER( play_3_state::megaaton_port01_w ) { - UINT8 i,j,digit; + uint8_t i,j,digit; m_kbdrow = data; if (m_kbdrow && m_disp_sw) { @@ -323,7 +323,7 @@ WRITE8_MEMBER( play_3_state::port03_w ) READ8_MEMBER( play_3_state::port04_r ) { if (m_kbdrow & 0x3f) - for (UINT8 i = 0; i < 6; i++) + for (uint8_t i = 0; i < 6; i++) if (BIT(m_kbdrow, i)) return m_keyboard[i]->read(); @@ -332,7 +332,7 @@ READ8_MEMBER( play_3_state::port04_r ) READ8_MEMBER( play_3_state::port05_r ) { - UINT8 data = 0, key8 = m_keyboard[8]->read() & 0x0f; + uint8_t data = 0, key8 = m_keyboard[8]->read() & 0x0f; if (BIT(m_kbdrow, 0)) data |= m_keyboard[6]->read(); if (BIT(m_kbdrow, 1)) diff --git a/src/mame/drivers/playch10.cpp b/src/mame/drivers/playch10.cpp index 56b4e4f0be6..3e36bd64fde 100644 --- a/src/mame/drivers/playch10.cpp +++ b/src/mame/drivers/playch10.cpp @@ -1663,8 +1663,8 @@ GAME( 1986, playch10, 0, playch10, playch10, playch10_state, playch10, ROT0, "Ni DRIVER_INIT_MEMBER(playch10_state,virus) { - UINT8 *ROM = memregion("rp5h01")->base(); - UINT32 len = memregion("rp5h01")->bytes(); + uint8_t *ROM = memregion("rp5h01")->base(); + uint32_t len = memregion("rp5h01")->bytes(); for (int i = 0; i < len; i++) { ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7); @@ -1677,8 +1677,8 @@ DRIVER_INIT_MEMBER(playch10_state,virus) DRIVER_INIT_MEMBER(playch10_state,ttoon) { - UINT8 *ROM = memregion("rp5h01")->base(); - UINT32 len = memregion("rp5h01")->bytes(); + uint8_t *ROM = memregion("rp5h01")->base(); + uint32_t len = memregion("rp5h01")->bytes(); for (int i = 0; i < len; i++) { ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7); diff --git a/src/mame/drivers/playmark.cpp b/src/mame/drivers/playmark.cpp index 519a4a08859..114a667d6ef 100644 --- a/src/mame/drivers/playmark.cpp +++ b/src/mame/drivers/playmark.cpp @@ -1977,7 +1977,7 @@ ROM_START( luckboomh ) ROM_END -UINT8 playmark_state::playmark_asciitohex(UINT8 data) +uint8_t playmark_state::playmark_asciitohex(uint8_t data) { /* Convert ASCII data to HEX */ @@ -1990,12 +1990,12 @@ UINT8 playmark_state::playmark_asciitohex(UINT8 data) void playmark_state::playmark_decode_pic_hex_dump(void) { - UINT8 *playmark_PICROM_HEX = memregion("user1")->base(); - UINT16 *playmark_PICROM = (UINT16 *)memregion("audiocpu")->base(); - INT32 offs, data; - UINT16 src_pos = 0; - UINT16 dst_pos = 0; - UINT8 data_hi, data_lo; + uint8_t *playmark_PICROM_HEX = memregion("user1")->base(); + uint16_t *playmark_PICROM = (uint16_t *)memregion("audiocpu")->base(); + int32_t offs, data; + uint16_t src_pos = 0; + uint16_t dst_pos = 0; + uint8_t data_hi, data_lo; /**** Convert the PIC16C57 ASCII HEX dumps to pure HEX ****/ do diff --git a/src/mame/drivers/plus4.cpp b/src/mame/drivers/plus4.cpp index 321233c9582..ab96baf6bb8 100644 --- a/src/mame/drivers/plus4.cpp +++ b/src/mame/drivers/plus4.cpp @@ -97,7 +97,7 @@ public: void check_interrupts(); void bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs, int *phi2, int *user, int *_6551, int *addr_clk, int *keyport, int *kernal); - UINT8 read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal); + uint8_t read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -141,7 +141,7 @@ public: }; // memory state - UINT8 m_addr; + uint8_t m_addr; // interrupt state int m_ted_irq; @@ -149,7 +149,7 @@ public: int m_exp_irq; // keyboard state - UINT8 m_kb; + uint8_t m_kb; }; @@ -210,8 +210,8 @@ void plus4_state::check_interrupts() void plus4_state::bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs, int *phi2, int *user, int *_6551, int *addr_clk, int *keyport, int *kernal) { - UINT16 i = ras << 15 | BA10 << 14 | BA11 << 13 | BA13 << 12 | BA9 << 11 | BA8 << 10 | BA14 << 9 | mux << 8 | BA12 << 7 | BA7 << 6 | BA6 << 5 | BA5 << 4 | BA4 << 3 | BA15 << 2 | phi0 << 1 | 1; -/* UINT8 data = m_pla->read(i); + uint16_t i = ras << 15 | BA10 << 14 | BA11 << 13 | BA13 << 12 | BA9 << 11 | BA8 << 10 | BA14 << 9 | mux << 8 | BA12 << 7 | BA7 << 6 | BA6 << 5 | BA5 << 4 | BA4 << 3 | BA15 << 2 | phi0 << 1 | 1; +/* uint8_t data = m_pla->read(i); *scs = BIT(data, 0); *phi2 = BIT(data, 1); @@ -281,10 +281,10 @@ void plus4_state::bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs // read_memory - //------------------------------------------------- -UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal) +uint8_t plus4_state::read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal) { int cs0 = 1, cs1 = 1, c1l = 1, c1h = 1, c2l = 1, c2h = 1; - UINT8 data = m_ted->read(space, offset, cs0, cs1); + uint8_t data = m_ted->read(space, offset, cs0, cs1); //logerror("offset %04x user %u 6551 %u addr_clk %u keyport %u kernal %u cs0 %u cs1 %u\n", offset,user,_6551,addr_clk,keyport,kernal,cs0,cs1); @@ -628,7 +628,7 @@ READ8_MEMBER( plus4_state::cpu_r ) */ - UINT8 data = 0x2f; + uint8_t data = 0x2f; // cassette read data |= m_cassette->read() << 4; @@ -659,7 +659,7 @@ READ8_MEMBER( c16_state::cpu_r ) */ - UINT8 data = 0; + uint8_t data = 0; // cassette read data |= m_cassette->read() << 4; @@ -737,12 +737,12 @@ READ8_MEMBER( plus4_state::ted_k_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick if (!BIT(offset, 2)) { - UINT8 joy_a = m_joy1->joy_r(); + uint8_t joy_a = m_joy1->joy_r(); data &= (0xf0 | (joy_a & 0x0f)); data &= ~(!BIT(joy_a, 5) << 6); @@ -750,7 +750,7 @@ READ8_MEMBER( plus4_state::ted_k_r ) if (!BIT(offset, 1)) { - UINT8 joy_b = m_joy2->joy_r(); + uint8_t joy_b = m_joy2->joy_r(); data &= (0xf0 | (joy_b & 0x0f)); data &= ~(!BIT(joy_b, 5) << 7); @@ -817,7 +817,7 @@ SLOT_INTERFACE_END void plus4_state::machine_start() { // initialize memory - UINT8 data = 0xff; + uint8_t data = 0xff; for (offs_t offset = 0; offset < m_ram->size(); offset++) { diff --git a/src/mame/drivers/pluto5.cpp b/src/mame/drivers/pluto5.cpp index 8cc68881e40..6a9fe99efa1 100644 --- a/src/mame/drivers/pluto5.cpp +++ b/src/mame/drivers/pluto5.cpp @@ -188,8 +188,8 @@ public: m_maincpu(*this, "maincpu") { } - UINT32* m_cpuregion; - std::unique_ptr m_mainram; + uint32_t* m_cpuregion; + std::unique_ptr m_mainram; DECLARE_READ32_MEMBER(pluto5_mem_r); DECLARE_WRITE32_MEMBER(pluto5_mem_w); @@ -245,8 +245,8 @@ INPUT_PORTS_END void pluto5_state::machine_start() { - m_cpuregion = (UINT32*)memregion( "maincpu" )->base(); - m_mainram = make_unique_clear(0x10000); + m_cpuregion = (uint32_t*)memregion( "maincpu" )->base(); + m_mainram = make_unique_clear(0x10000); } @@ -831,9 +831,9 @@ ROM_END -static void astra_addresslines( UINT16* src, size_t srcsize, int small ) +static void astra_addresslines( uint16_t* src, size_t srcsize, int small ) { - std::vector dst(srcsize/2); + std::vector dst(srcsize/2); int blocksize; @@ -855,11 +855,11 @@ static void astra_addresslines( UINT16* src, size_t srcsize, int small ) DRIVER_INIT_MEMBER(pluto5_state,hb) { - astra_addresslines( (UINT16*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 0 ); + astra_addresslines( (uint16_t*)memregion( "maincpu" )->base(), memregion( "maincpu" )->bytes(), 0 ); #if 0 { - UINT8* ROM = memregion( "maincpu" )->base(); + uint8_t* ROM = memregion( "maincpu" )->base(); FILE *fp; char filename[256]; sprintf(filename,"%s", machine().system().name); diff --git a/src/mame/drivers/plygonet.cpp b/src/mame/drivers/plygonet.cpp index 2082fbb9811..18c48c18925 100644 --- a/src/mame/drivers/plygonet.cpp +++ b/src/mame/drivers/plygonet.cpp @@ -193,8 +193,8 @@ WRITE32_MEMBER(polygonet_state::sound_irq_w) /* DSP communications */ READ32_MEMBER(polygonet_state::dsp_host_interface_r) { - UINT32 value; - UINT8 hi_addr = offset << 1; + uint32_t value; + uint8_t hi_addr = offset << 1; if (mem_mask == 0x0000ff00) { hi_addr++; } /* Low byte */ if (mem_mask == 0xff000000) {} /* High byte */ @@ -269,8 +269,8 @@ WRITE32_MEMBER(polygonet_state::dsp_w_lines) WRITE32_MEMBER(polygonet_state::dsp_host_interface_w) { - UINT8 hi_data = 0x00; - UINT8 hi_addr = offset << 1; + uint8_t hi_data = 0x00; + uint8_t hi_addr = offset << 1; if (mem_mask == 0x0000ff00) { hi_addr++; } /* Low byte */ if (mem_mask == 0xff000000) {} /* High byte */ @@ -314,9 +314,9 @@ READ16_MEMBER(polygonet_state::dsp56k_bootload_r) bit 0002 turns on *just* before this happens. */ -static UINT8 dsp56k_bank_group(device_t* cpu) +static uint8_t dsp56k_bank_group(device_t* cpu) { - UINT16 portC = ((dsp56k_device *)cpu)->get_peripheral_memory(0xffe3); + uint16_t portC = ((dsp56k_device *)cpu)->get_peripheral_memory(0xffe3); /* If bank group B is on, it overrides bank group A */ if (portC & 0x0002) @@ -327,20 +327,20 @@ static UINT8 dsp56k_bank_group(device_t* cpu) return INVALID_BANK_GROUP; } -static UINT8 dsp56k_bank_num(device_t* cpu, UINT8 bank_group) +static uint8_t dsp56k_bank_num(device_t* cpu, uint8_t bank_group) { - UINT16 portC = ((dsp56k_device *)cpu)->get_peripheral_memory(0xffe3); + uint16_t portC = ((dsp56k_device *)cpu)->get_peripheral_memory(0xffe3); if (bank_group == BANK_GROUP_A) { - const UINT16 bit3 = (portC & 0x0010) >> 2; - const UINT16 bits21 = (portC & 0x000c) >> 2; + const uint16_t bit3 = (portC & 0x0010) >> 2; + const uint16_t bits21 = (portC & 0x000c) >> 2; return (bit3 | bits21); } else if (bank_group == BANK_GROUP_B) { - const UINT16 bits32 = (portC & 0x0180) >> 6; - const UINT16 bit1 = (portC & 0x0001) >> 0; + const uint16_t bits32 = (portC & 0x0180) >> 6; + const uint16_t bit1 = (portC & 0x0001) >> 0; return (bits32 | bit1); } else if (bank_group == INVALID_BANK_GROUP) @@ -355,18 +355,18 @@ static UINT8 dsp56k_bank_num(device_t* cpu, UINT8 bank_group) /* BANK HANDLERS */ READ16_MEMBER(polygonet_state::dsp56k_ram_bank00_read) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_bank00_size * 8) + (bank_num * dsp56k_bank00_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_bank00_size * 8) + (bank_num * dsp56k_bank00_size); return m_dsp56k_bank00_ram[driver_bank_offset + offset]; } WRITE16_MEMBER(polygonet_state::dsp56k_ram_bank00_write) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_bank00_size * 8) + (bank_num * dsp56k_bank00_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_bank00_size * 8) + (bank_num * dsp56k_bank00_size); COMBINE_DATA(&m_dsp56k_bank00_ram[driver_bank_offset + offset]); } @@ -374,18 +374,18 @@ WRITE16_MEMBER(polygonet_state::dsp56k_ram_bank00_write) READ16_MEMBER(polygonet_state::dsp56k_ram_bank01_read) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_bank01_size * 8) + (bank_num * dsp56k_bank01_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_bank01_size * 8) + (bank_num * dsp56k_bank01_size); return m_dsp56k_bank01_ram[driver_bank_offset + offset]; } WRITE16_MEMBER(polygonet_state::dsp56k_ram_bank01_write) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_bank01_size * 8) + (bank_num * dsp56k_bank01_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_bank01_size * 8) + (bank_num * dsp56k_bank01_size); COMBINE_DATA(&m_dsp56k_bank01_ram[driver_bank_offset + offset]); @@ -396,18 +396,18 @@ WRITE16_MEMBER(polygonet_state::dsp56k_ram_bank01_write) READ16_MEMBER(polygonet_state::dsp56k_ram_bank02_read) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_bank02_size * 8) + (bank_num * dsp56k_bank02_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_bank02_size * 8) + (bank_num * dsp56k_bank02_size); return m_dsp56k_bank02_ram[driver_bank_offset + offset]; } WRITE16_MEMBER(polygonet_state::dsp56k_ram_bank02_write) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_bank02_size * 8) + (bank_num * dsp56k_bank02_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_bank02_size * 8) + (bank_num * dsp56k_bank02_size); COMBINE_DATA(&m_dsp56k_bank02_ram[driver_bank_offset + offset]); } @@ -415,18 +415,18 @@ WRITE16_MEMBER(polygonet_state::dsp56k_ram_bank02_write) READ16_MEMBER(polygonet_state::dsp56k_shared_ram_read) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_shared_ram_16_size * 8) + (bank_num * dsp56k_shared_ram_16_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_shared_ram_16_size * 8) + (bank_num * dsp56k_shared_ram_16_size); return m_dsp56k_shared_ram_16[driver_bank_offset + offset]; } WRITE16_MEMBER(polygonet_state::dsp56k_shared_ram_write) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_shared_ram_16_size * 8) + (bank_num * dsp56k_shared_ram_16_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_shared_ram_16_size * 8) + (bank_num * dsp56k_shared_ram_16_size); COMBINE_DATA(&m_dsp56k_shared_ram_16[driver_bank_offset + offset]); @@ -443,18 +443,18 @@ WRITE16_MEMBER(polygonet_state::dsp56k_shared_ram_write) READ16_MEMBER(polygonet_state::dsp56k_ram_bank04_read) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_bank04_size * 8) + (bank_num * dsp56k_bank04_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_bank04_size * 8) + (bank_num * dsp56k_bank04_size); return m_dsp56k_bank04_ram[driver_bank_offset + offset]; } WRITE16_MEMBER(polygonet_state::dsp56k_ram_bank04_write) { - UINT8 en_group = dsp56k_bank_group(&space.device()); - UINT8 bank_num = dsp56k_bank_num(&space.device(), en_group); - UINT32 driver_bank_offset = (en_group * dsp56k_bank04_size * 8) + (bank_num * dsp56k_bank04_size); + uint8_t en_group = dsp56k_bank_group(&space.device()); + uint8_t bank_num = dsp56k_bank_num(&space.device(), en_group); + uint32_t driver_bank_offset = (en_group * dsp56k_bank04_size * 8) + (bank_num * dsp56k_bank04_size); COMBINE_DATA(&m_dsp56k_bank04_ram[driver_bank_offset + offset]); } diff --git a/src/mame/drivers/pm68k.cpp b/src/mame/drivers/pm68k.cpp index d35fa742d8d..cd4085ba6c3 100644 --- a/src/mame/drivers/pm68k.cpp +++ b/src/mame/drivers/pm68k.cpp @@ -31,16 +31,16 @@ public: DECLARE_READ16_MEMBER(keyin_r); DECLARE_READ16_MEMBER(status_r); private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; - required_shared_ptr m_p_base; + required_shared_ptr m_p_base; required_device m_maincpu; required_device m_terminal; }; READ16_MEMBER( pm68k_state::keyin_r ) { - UINT16 ret = m_term_data; + uint16_t ret = m_term_data; m_term_data = 0; return ret << 8; } @@ -68,7 +68,7 @@ INPUT_PORTS_END void pm68k_state::machine_reset() { - UINT8* ROM = memregion("maincpu")->base(); + uint8_t* ROM = memregion("maincpu")->base(); memcpy(m_p_base, ROM, 8); m_maincpu->reset(); } diff --git a/src/mame/drivers/pmd85.cpp b/src/mame/drivers/pmd85.cpp index 5e5b091cb9f..aa2897dc9b7 100644 --- a/src/mame/drivers/pmd85.cpp +++ b/src/mame/drivers/pmd85.cpp @@ -187,12 +187,12 @@ I/O ports // VIDEO EMULATION //************************************************************************** -UINT32 pmd85_state::screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pmd85_state::screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y = 0; y < 256; y++) { // address of current line in PMD-85 video memory - UINT8 *line = m_ram->pointer() + 0xc000 + 0x40 * y; + uint8_t *line = m_ram->pointer() + 0xc000 + 0x40 * y; for (int x = 0; x < 288/6; x++) { diff --git a/src/mame/drivers/pmi80.cpp b/src/mame/drivers/pmi80.cpp index d58f538892a..f890ba63aa0 100644 --- a/src/mame/drivers/pmi80.cpp +++ b/src/mame/drivers/pmi80.cpp @@ -50,7 +50,7 @@ public: DECLARE_WRITE8_MEMBER(keyboard_w); DECLARE_WRITE8_MEMBER(leds_w); private: - UINT8 m_keyrow; + uint8_t m_keyrow; bool m_ledready; virtual void machine_reset() override; required_device m_maincpu; diff --git a/src/mame/drivers/pntnpuzl.cpp b/src/mame/drivers/pntnpuzl.cpp index 9fed245dda1..724e662f24a 100644 --- a/src/mame/drivers/pntnpuzl.cpp +++ b/src/mame/drivers/pntnpuzl.cpp @@ -137,11 +137,11 @@ public: m_eeprom(*this, "eeprom") { } - UINT16 m_eeprom_data; - UINT16 m_pntpzl_200000; - UINT16 m_serial; - UINT16 m_serial_out; - UINT16 m_read_count; + uint16_t m_eeprom_data; + uint16_t m_pntpzl_200000; + uint16_t m_serial; + uint16_t m_serial_out; + uint16_t m_read_count; int m_touchscr[5]; required_device m_maincpu; @@ -312,7 +312,7 @@ INPUT_CHANGED_MEMBER(pntnpuzl_state::coin_inserted) { /* TODO: change this! */ if(newval) - generic_pulse_irq_line(*m_maincpu, (UINT8)(uintptr_t)param, 1); + generic_pulse_irq_line(*m_maincpu, (uint8_t)(uintptr_t)param, 1); } static INPUT_PORTS_START( pntnpuzl ) @@ -368,7 +368,7 @@ ROM_END DRIVER_INIT_MEMBER(pntnpuzl_state,pip) { -// UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); +// uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); // rom[0x2696/2] = 0x4e71; // rom[0x26a0/2] = 0x4e71; diff --git a/src/mame/drivers/pockchal.cpp b/src/mame/drivers/pockchal.cpp index 2dfc476046e..1b2206bf2a8 100644 --- a/src/mame/drivers/pockchal.cpp +++ b/src/mame/drivers/pockchal.cpp @@ -39,10 +39,10 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_pockchalv1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pockchalv1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_cart; - UINT32 m_rom_size; + uint32_t m_rom_size; DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pockchalv1_cart); }; @@ -59,7 +59,7 @@ void pockchalv1_state::video_start() { } -UINT32 pockchalv1_state::screen_update_pockchalv1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pockchalv1_state::screen_update_pockchalv1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/pockstat.cpp b/src/mame/drivers/pockstat.cpp index f7822a8d8fe..f373c53256a 100644 --- a/src/mame/drivers/pockstat.cpp +++ b/src/mame/drivers/pockstat.cpp @@ -52,28 +52,28 @@ If you do nothing for about 20 secs, it turns itself off (screen goes white). struct ps_ftlb_regs_t { - UINT32 control; - UINT32 stat; - UINT32 valid; - UINT32 wait1; - UINT32 wait2; - UINT32 entry[16]; - UINT32 serial; + uint32_t control; + uint32_t stat; + uint32_t valid; + uint32_t wait1; + uint32_t wait2; + uint32_t entry[16]; + uint32_t serial; }; struct ps_intc_regs_t { - UINT32 hold; - UINT32 status; - UINT32 enable; - UINT32 mask; + uint32_t hold; + uint32_t status; + uint32_t enable; + uint32_t mask; }; struct ps_timer_t { - UINT32 period; - UINT32 count; - UINT32 control; + uint32_t period; + uint32_t count; + uint32_t control; emu_timer *timer; }; @@ -84,18 +84,18 @@ struct ps_timer_regs_t struct ps_clock_regs_t { - UINT32 mode; - UINT32 control; + uint32_t mode; + uint32_t control; }; #define PS_CLOCK_STEADY 0x10 struct ps_rtc_regs_t { - UINT32 mode; - UINT32 control; - UINT32 time; - UINT32 date; + uint32_t mode; + uint32_t control; + uint32_t time; + uint32_t date; emu_timer *timer; }; @@ -111,7 +111,7 @@ public: m_cart(*this, "cartslot") { } - required_shared_ptr m_lcd_buffer; + required_shared_ptr m_lcd_buffer; required_device m_maincpu; required_device m_cart; memory_region *m_cart_rom; @@ -121,9 +121,9 @@ public: ps_timer_regs_t m_timer_regs; ps_clock_regs_t m_clock_regs; ps_rtc_regs_t m_rtc_regs; - UINT32 m_lcd_control; - INT32 m_ps_flash_write_enable_count; - INT32 m_ps_flash_write_count; + uint32_t m_lcd_control; + int32_t m_ps_flash_write_enable_count; + int32_t m_ps_flash_write_count; DECLARE_READ32_MEMBER(ps_ftlb_r); DECLARE_WRITE32_MEMBER(ps_ftlb_w); DECLARE_READ32_MEMBER(ps_intc_r); @@ -143,14 +143,14 @@ public: DECLARE_WRITE32_MEMBER(ps_audio_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_pockstat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pockstat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_INPUT_CHANGED_MEMBER(input_update); TIMER_CALLBACK_MEMBER(timer_tick); TIMER_CALLBACK_MEMBER(rtc_tick); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pockstat_flash ); inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); - UINT32 ps_intc_get_interrupt_line(UINT32 line); - void ps_intc_set_interrupt_line(UINT32 line, int state); + uint32_t ps_intc_get_interrupt_line(uint32_t line); + void ps_intc_set_interrupt_line(uint32_t line, int state); void ps_timer_start(int index); }; @@ -314,12 +314,12 @@ WRITE32_MEMBER(pockstat_state::ps_ftlb_w) } } -UINT32 pockstat_state::ps_intc_get_interrupt_line(UINT32 line) +uint32_t pockstat_state::ps_intc_get_interrupt_line(uint32_t line) { return m_intc_regs.status & line; } -void pockstat_state::ps_intc_set_interrupt_line(UINT32 line, int state) +void pockstat_state::ps_intc_set_interrupt_line(uint32_t line, int state) { //printf( "%08x %d %08x %08x %08x\n", line, state, drvm_intc_regs.hold, drvm_intc_regs.status, drvm_intc_regs.enable ); if(line) @@ -768,7 +768,7 @@ WRITE32_MEMBER(pockstat_state::ps_lcd_w) INPUT_CHANGED_MEMBER(pockstat_state::input_update) { - UINT32 buttons = ioport("BUTTONS")->read(); + uint32_t buttons = ioport("BUTTONS")->read(); ps_intc_set_interrupt_line(PS_INT_BTN_ACTION, (buttons & 1) ? 1 : 0); ps_intc_set_interrupt_line(PS_INT_BTN_RIGHT, (buttons & 2) ? 1 : 0); @@ -779,7 +779,7 @@ INPUT_CHANGED_MEMBER(pockstat_state::input_update) READ32_MEMBER(pockstat_state::ps_rombank_r) { - INT32 bank = (offset >> 11) & 0x0f; + int32_t bank = (offset >> 11) & 0x0f; for (int index = 0; index < 32; index++) { if (m_ftlb_regs.valid & (1 << index)) @@ -817,7 +817,7 @@ WRITE32_MEMBER(pockstat_state::ps_flash_w) if(m_ps_flash_write_count) { m_ps_flash_write_count--; - COMBINE_DATA(&((UINT32*)(m_cart_rom->base()))[offset]); + COMBINE_DATA(&((uint32_t*)(m_cart_rom->base()))[offset]); } } @@ -926,11 +926,11 @@ void pockstat_state::machine_reset() m_ps_flash_write_count = 0; } -UINT32 pockstat_state::screen_update_pockstat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t pockstat_state::screen_update_pockstat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (int y = 0; y < 32; y++) { - UINT32 *scanline = &bitmap.pix32(y); + uint32_t *scanline = &bitmap.pix32(y); for (int x = 0; x < 32; x++) { if (m_lcd_control != 0) // Hack @@ -951,7 +951,7 @@ DEVICE_IMAGE_LOAD_MEMBER( pockstat_state, pockstat_flash ) { static const char *gme_id = "123-456-STD"; char cart_id[0xf40]; - UINT32 size = image.length(); + uint32_t size = image.length(); if (size != 0x20f40) return image_init_result::FAIL; diff --git a/src/mame/drivers/pofo.cpp b/src/mame/drivers/pofo.cpp index da1e3f2f4f4..d4b37fea28e 100644 --- a/src/mame/drivers/pofo.cpp +++ b/src/mame/drivers/pofo.cpp @@ -57,7 +57,7 @@ #define TIMER_TICK_TAG "tick" #define SCREEN_TAG "screen" -static const UINT8 INTERRUPT_VECTOR[] = { 0x08, 0x09, 0x00 }; +static const uint8_t INTERRUPT_VECTOR[] = { 0x08, 0x09, 0x00 }; @@ -93,8 +93,8 @@ public: required_device m_timer_tick; required_device m_nvram; required_device m_ram; - required_region_ptr m_rom; - required_region_ptr m_char_rom; + required_region_ptr m_rom; + required_region_ptr m_char_rom; required_ioport_array<8> m_y; required_ioport m_battery; @@ -142,10 +142,10 @@ public: DECLARE_WRITE_LINE_MEMBER( iint_w ); DECLARE_WRITE_LINE_MEMBER( eint_w ); - UINT8 m_ip; - UINT8 m_ie; - UINT16 m_counter; - UINT8 m_keylatch; + uint8_t m_ip; + uint8_t m_ie; + uint16_t m_counter; + uint8_t m_keylatch; int m_rom_b; DECLARE_PALETTE_INIT(portfolio); @@ -240,7 +240,7 @@ WRITE8_MEMBER( portfolio_state::irq_mask_w ) IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack) { - UINT8 vector = 0; + uint8_t vector = 0; for (int i = 0; i < 4; i++) { @@ -277,11 +277,11 @@ IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack) void portfolio_state::scan_keyboard() { - UINT8 keycode = 0xff; + uint8_t keycode = 0xff; for (int row = 0; row < 8; row++) { - UINT8 data = static_cast(m_y[row]->read()); + uint8_t data = static_cast(m_y[row]->read()); if (data != 0xff) { @@ -429,7 +429,7 @@ READ8_MEMBER( portfolio_state::battery_r ) */ - UINT8 data = 0; + uint8_t data = 0; // peripheral detect data |= m_exp->pdet_r() << 5; @@ -505,7 +505,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::counter_tick) READ8_MEMBER( portfolio_state::counter_r ) { - UINT8 data = 0; + uint8_t data = 0; switch (offset) { @@ -552,7 +552,7 @@ WRITE8_MEMBER( portfolio_state::counter_w ) READ8_MEMBER( portfolio_state::mem_r ) { - UINT8 data = 0; + uint8_t data = 0; int iom = 0; int bcom = 1; @@ -644,7 +644,7 @@ WRITE8_MEMBER( portfolio_state::mem_w ) READ8_MEMBER( portfolio_state::io_r ) { - UINT8 data = 0; + uint8_t data = 0; int iom = 1; int bcom = 1; @@ -924,8 +924,8 @@ PALETTE_INIT_MEMBER(portfolio_state, portfolio) READ8_MEMBER( portfolio_state::hd61830_rd_r ) { // TODO with real ROM: offs_t address = ((offset & 0xff) << 4) | ((offset >> 12) & 0x0f); - UINT16 address = ((offset & 0xff) << 3) | ((offset >> 12) & 0x07); - UINT8 data = m_char_rom[address]; + uint16_t address = ((offset & 0xff) << 3) | ((offset >> 12) & 0x07); + uint8_t data = m_char_rom[address]; return data; } diff --git a/src/mame/drivers/poisk1.cpp b/src/mame/drivers/poisk1.cpp index a152e1ff78f..c42205446e3 100644 --- a/src/mame/drivers/poisk1.cpp +++ b/src/mame/drivers/poisk1.cpp @@ -43,7 +43,7 @@ } while (0) #define POISK1_UPDATE_ROW(name) \ - void name(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 *videoram, UINT16 ma, UINT8 ra, UINT8 stride) + void name(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t *videoram, uint16_t ma, uint8_t ra, uint8_t stride) class p1_state : public driver_device { @@ -78,7 +78,7 @@ public: DECLARE_PALETTE_INIT(p1); virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void set_palette_luts(); POISK1_UPDATE_ROW(cga_gfx_2bpp_update_row); POISK1_UPDATE_ROW(cga_gfx_1bpp_update_row); @@ -86,21 +86,21 @@ public: DECLARE_WRITE_LINE_MEMBER(p1_pit8253_out2_changed); DECLARE_WRITE_LINE_MEMBER(p1_speaker_set_spkrdata); - UINT8 m_p1_spkrdata; - UINT8 m_p1_input; + uint8_t m_p1_spkrdata; + uint8_t m_p1_input; - UINT8 m_kbpoll_mask; + uint8_t m_kbpoll_mask; struct { - UINT8 trap[4]; - std::unique_ptr videoram_base; - UINT8 *videoram; - UINT8 mode_control_6a; - UINT8 color_select_68; - UINT8 palette_lut_2bpp[4]; + uint8_t trap[4]; + std::unique_ptr videoram_base; + uint8_t *videoram; + uint8_t mode_control_6a; + uint8_t color_select_68; + uint8_t palette_lut_2bpp[4]; int stride; - void *update_row(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 *videoram, UINT16 ma, UINT8 ra, UINT8 stride); + void *update_row(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t *videoram, uint16_t ma, uint8_t ra, uint8_t stride); } m_video; DECLARE_READ8_MEMBER(p1_trap_r); @@ -137,7 +137,7 @@ public: READ8_MEMBER(p1_state::p1_trap_r) { - UINT8 data = m_video.trap[offset]; + uint8_t data = m_video.trap[offset]; DBG_LOG(1,"trap",("R %.2x $%02x\n", 0x28+offset, data)); if (offset == 0) m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); @@ -151,7 +151,7 @@ WRITE8_MEMBER(p1_state::p1_trap_w) READ8_MEMBER(p1_state::p1_cga_r) { - UINT16 port = offset + 0x3d0; + uint16_t port = offset + 0x3d0; DBG_LOG(1,"cga",("R %.4x\n", port)); m_video.trap[1] = 0x40 | ((port >> 8) & 0x3f); @@ -162,7 +162,7 @@ READ8_MEMBER(p1_state::p1_cga_r) WRITE8_MEMBER(p1_state::p1_cga_w) { - UINT16 port = offset + 0x3d0; + uint16_t port = offset + 0x3d0; DBG_LOG(1,"cga",("W %.4x $%02x\n", port, data)); m_video.trap[2] = data; @@ -287,8 +287,8 @@ void p1_state::set_palette_luts(void) POISK1_UPDATE_ROW( p1_state::cga_gfx_2bpp_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(ra); - UINT16 odd, offset; + uint32_t *p = &bitmap.pix32(ra); + uint16_t odd, offset; int i; if ( ra == 0 ) DBG_LOG(1,"cga_gfx_2bpp_update_row",("\n")); @@ -296,7 +296,7 @@ POISK1_UPDATE_ROW( p1_state::cga_gfx_2bpp_update_row ) offset = ( ma & 0x1fff ) | odd; for ( i = 0; i < stride; i++ ) { - UINT8 data = videoram[ offset++ ]; + uint8_t data = videoram[ offset++ ]; *p = palette[m_video.palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++; *p = palette[m_video.palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++; @@ -314,9 +314,9 @@ POISK1_UPDATE_ROW( p1_state::cga_gfx_2bpp_update_row ) POISK1_UPDATE_ROW( p1_state::cga_gfx_1bpp_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(ra); - UINT8 fg = 15, bg = BG_COLOR(m_video.color_select_68); - UINT16 odd, offset; + uint32_t *p = &bitmap.pix32(ra); + uint8_t fg = 15, bg = BG_COLOR(m_video.color_select_68); + uint16_t odd, offset; int i; if ( ra == 0 ) DBG_LOG(1,"cga_gfx_1bpp_update_row",("bg %d\n", bg)); @@ -324,7 +324,7 @@ POISK1_UPDATE_ROW( p1_state::cga_gfx_1bpp_update_row ) offset = ( ma & 0x1fff ) | odd; for ( i = 0; i < stride; i++ ) { - UINT8 data = videoram[ offset++ ]; + uint8_t data = videoram[ offset++ ]; *p = palette[( data & 0x80 ) ? fg : bg ]; p++; *p = palette[( data & 0x40 ) ? fg : bg ]; p++; @@ -346,9 +346,9 @@ POISK1_UPDATE_ROW( p1_state::cga_gfx_1bpp_update_row ) POISK1_UPDATE_ROW( p1_state::poisk1_gfx_1bpp_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(ra); - UINT8 fg, bg = BG_COLOR(m_video.color_select_68); - UINT16 odd, offset; + uint32_t *p = &bitmap.pix32(ra); + uint8_t fg, bg = BG_COLOR(m_video.color_select_68); + uint16_t odd, offset; int i; if ( ra == 0 ) DBG_LOG(1,"poisk1_gfx_1bpp_update_row",("bg %d\n", bg)); @@ -356,7 +356,7 @@ POISK1_UPDATE_ROW( p1_state::poisk1_gfx_1bpp_update_row ) offset = ( ma & 0x1fff ) | odd; for ( i = 0; i < stride; i++ ) { - UINT8 data = videoram[ offset++ ]; + uint8_t data = videoram[ offset++ ]; fg = (data & 0x80) ? ( (m_video.color_select_68 & 0x20) ? 10 : 11 ) : 15; // XXX *p = palette[bg]; p++; @@ -390,7 +390,7 @@ void p1_state::video_start() DBG_LOG(0,"init",("video_start()\n")); memset(&m_video, 0, sizeof(m_video)); - m_video.videoram_base = std::make_unique(0x8000); + m_video.videoram_base = std::make_unique(0x8000); m_video.videoram = m_video.videoram_base.get(); m_video.stride = 80; @@ -400,9 +400,9 @@ void p1_state::video_start() machine().root_device().membank("bank12")->set_base(m_video.videoram + 0x4000); } -UINT32 p1_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t p1_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT16 ra, ma = 0; + uint16_t ra, ma = 0; if (!m_video.stride || !m_video.videoram) return 0; @@ -448,7 +448,7 @@ WRITE8_MEMBER(p1_state::p1_ppi_porta_w) READ8_MEMBER(p1_state::p1_ppi_porta_r) { - UINT8 ret; + uint8_t ret; ret = m_kbpoll_mask; DBG_LOG(1,"p1_ppi_porta_r",("= %02X\n", ret)); @@ -457,8 +457,8 @@ READ8_MEMBER(p1_state::p1_ppi_porta_r) READ8_MEMBER(p1_state::p1_ppi_portb_r) { - UINT16 key = 0xffff; - UINT8 ret = 0; + uint16_t key = 0xffff; + uint8_t ret = 0; if (m_kbpoll_mask & 0x01) { key &= ioport("Y1")->read(); } if (m_kbpoll_mask & 0x02) { key &= ioport("Y2")->read(); } @@ -475,8 +475,8 @@ READ8_MEMBER(p1_state::p1_ppi_portb_r) READ8_MEMBER(p1_state::p1_ppi_portc_r) { - UINT16 key = 0xffff; - UINT8 ret = 0; + uint16_t key = 0xffff; + uint8_t ret = 0; if (m_kbpoll_mask & 0x01) { key &= ioport("Y1")->read(); } if (m_kbpoll_mask & 0x02) { key &= ioport("Y2")->read(); } diff --git a/src/mame/drivers/pokechmp.cpp b/src/mame/drivers/pokechmp.cpp index a02d4ba615e..58767d749b7 100644 --- a/src/mame/drivers/pokechmp.cpp +++ b/src/mame/drivers/pokechmp.cpp @@ -49,7 +49,7 @@ ClawGrip, Jul 2006 WRITE8_MEMBER(pokechmp_state::pokechmp_bank_w) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int bank; @@ -62,7 +62,7 @@ WRITE8_MEMBER(pokechmp_state::pokechmp_bank_w) WRITE8_MEMBER(pokechmp_state::pokechmp_sound_bank_w) { - UINT8 *ROM = memregion("oki")->base(); + uint8_t *ROM = memregion("oki")->base(); membank("okibank")->set_base(&ROM[data*0x8000]); } diff --git a/src/mame/drivers/pokemini.cpp b/src/mame/drivers/pokemini.cpp index baa96878702..0287115cdd1 100644 --- a/src/mame/drivers/pokemini.cpp +++ b/src/mame/drivers/pokemini.cpp @@ -20,17 +20,17 @@ The LCD is likely to be a SSD1828 LCD. struct PRC { - UINT8 colors_inverted; - UINT8 background_enabled; - UINT8 sprites_enabled; - UINT8 copy_enabled; - UINT8 map_size; - UINT8 map_size_x; - UINT8 frame_count; - UINT8 max_frame_count; - UINT32 bg_tiles; - UINT32 spr_tiles; - UINT8 count; + uint8_t colors_inverted; + uint8_t background_enabled; + uint8_t sprites_enabled; + uint8_t copy_enabled; + uint8_t map_size; + uint8_t map_size_x; + uint8_t frame_count; + uint8_t max_frame_count; + uint32_t bg_tiles; + uint32_t spr_tiles; + uint8_t count; emu_timer *count_timer; }; @@ -61,14 +61,14 @@ public: m_inputs(*this, "INPUTS") { } - UINT8 m_pm_reg[0x100]; + uint8_t m_pm_reg[0x100]; PRC m_prc; TIMERS m_timers; bitmap_ind16 m_bitmap; virtual void video_start() override; virtual void machine_start() override; - 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); DECLARE_PALETTE_INIT(pokemini); DECLARE_WRITE8_MEMBER(hwreg_w); DECLARE_READ8_MEMBER(hwreg_r); @@ -92,7 +92,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; required_device m_maincpu; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; required_device m_speaker; required_device m_i2cmem; required_device m_cart; @@ -1476,7 +1476,7 @@ WRITE8_MEMBER(pokemini_state::hwreg_w) READ8_MEMBER(pokemini_state::hwreg_r) { - UINT8 data = m_pm_reg[offset]; + uint8_t data = m_pm_reg[offset]; switch( offset ) { @@ -1500,7 +1500,7 @@ READ8_MEMBER(pokemini_state::hwreg_r) DEVICE_IMAGE_LOAD_MEMBER( pokemini_state, pokemini_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); /* Verify that the image is big enough */ if (size <= 0x2100) @@ -1546,7 +1546,7 @@ void pokemini_state::prc_counter_callback() int x, y; for ( y = 0; y < 8; y++ ) { for ( x = 0; x < 12; x++ ) { - UINT8 tile = m_p_ram[ 0x360 + ( y * m_prc.map_size_x ) + x ]; + uint8_t tile = m_p_ram[ 0x360 + ( y * m_prc.map_size_x ) + x ]; int i; for( i = 0; i < 8; i++ ) { m_p_ram[ ( y * 96 ) + ( x * 8 ) + i ] = space.read_byte( m_prc.bg_tiles + ( tile * 8 ) + i ); @@ -1558,19 +1558,19 @@ void pokemini_state::prc_counter_callback() /* Check if the sprites should be drawn */ if ( m_prc.sprites_enabled ) { - UINT16 spr; + uint16_t spr; for ( spr = 0x35C; spr >= 0x300; spr -= 4 ) { int spr_x = ( m_p_ram[ spr + 0 ] & 0x7F ) - 16; int spr_y = ( m_p_ram[ spr + 1 ] & 0x7F ) - 16; - UINT8 spr_tile = m_p_ram[ spr + 2 ]; - UINT8 spr_flag = m_p_ram[ spr + 3 ]; + uint8_t spr_tile = m_p_ram[ spr + 2 ]; + uint8_t spr_flag = m_p_ram[ spr + 3 ]; if ( spr_flag & 0x08 ) { - UINT16 gfx, mask; - UINT32 spr_base = m_prc.spr_tiles + spr_tile * 64; + uint16_t gfx, mask; + uint32_t spr_base = m_prc.spr_tiles + spr_tile * 64; int i, j; for ( i = 0; i < 16; i++ ) @@ -1578,7 +1578,7 @@ void pokemini_state::prc_counter_callback() if ( spr_x + i >= 0 && spr_x + i < 96 ) { int rel_x = ( spr_flag & 0x01 ) ? 15 - i : i; - UINT32 s = spr_base + ( ( rel_x & 0x08 ) << 2 ) + ( rel_x & 0x07 ); + uint32_t s = spr_base + ( ( rel_x & 0x08 ) << 2 ) + ( rel_x & 0x07 ); mask = ~ ( space.read_byte( s ) | ( space.read_byte( s + 8 ) << 8 ) ); gfx = space.read_byte( s + 16 ) | ( space.read_byte( s + 24 ) << 8 ); @@ -1593,7 +1593,7 @@ void pokemini_state::prc_counter_callback() { if ( spr_y + j >= 0 && spr_y + j < 64 ) { - UINT16 ram_addr = ( ( ( spr_y + j ) >> 3 ) * 96 ) + spr_x + i; + uint16_t ram_addr = ( ( ( spr_y + j ) >> 3 ) * 96 ) + spr_x + i; if ( spr_flag & 0x02 ) { @@ -1640,7 +1640,7 @@ void pokemini_state::prc_counter_callback() for( y = 0; y < 64; y += 8 ) { for( x = 0; x < 96; x++ ) { - UINT8 data = m_p_ram[ ( y * 12 ) + x ]; + uint8_t data = m_p_ram[ ( y * 12 ) + x ]; m_bitmap.pix16(y + 0, x) = ( data & 0x01 ) ? 3 : 0; m_bitmap.pix16(y + 1, x) = ( data & 0x02 ) ? 3 : 0; @@ -1736,7 +1736,7 @@ void pokemini_state::device_timer(emu_timer &timer, device_timer_id id, int para } -static const INT16 speaker_levels[] = {-32768, 0, 32767}; +static const int16_t speaker_levels[] = {-32768, 0, 32767}; void pokemini_state::video_start() { @@ -1744,7 +1744,7 @@ void pokemini_state::video_start() } -UINT32 pokemini_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pokemini_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; diff --git a/src/mame/drivers/poker72.cpp b/src/mame/drivers/poker72.cpp index 2d88b84b5b4..9ecc000c37f 100644 --- a/src/mame/drivers/poker72.cpp +++ b/src/mame/drivers/poker72.cpp @@ -34,9 +34,9 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_vram; - required_shared_ptr m_pal; - UINT8 m_tile_bank; + required_shared_ptr m_vram; + required_shared_ptr m_pal; + uint8_t m_tile_bank; DECLARE_WRITE8_MEMBER(poker72_paletteram_w); DECLARE_WRITE8_MEMBER(output_w); DECLARE_WRITE8_MEMBER(tile_bank_w); @@ -44,7 +44,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(poker72); - UINT32 screen_update_poker72(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_poker72(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -55,7 +55,7 @@ void poker72_state::video_start() { } -UINT32 poker72_state::screen_update_poker72(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t poker72_state::screen_update_poker72(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count; @@ -409,7 +409,7 @@ ROM_END DRIVER_INIT_MEMBER(poker72_state,poker72) { - UINT8 *rom = memregion("roms")->base(); + uint8_t *rom = memregion("roms")->base(); // configure and intialize bank 1 membank("bank1")->configure_entries(0, 4, memregion("roms")->base(), 0x8000); diff --git a/src/mame/drivers/polepos.cpp b/src/mame/drivers/polepos.cpp index a56d51b4d34..757774fb1b3 100644 --- a/src/mame/drivers/polepos.cpp +++ b/src/mame/drivers/polepos.cpp @@ -258,7 +258,7 @@ READ16_MEMBER(polepos_state::polepos2_ic25_r) { m_last_unsigned = offset & 0xff; result = (m_last_result >> 8) & 0xff; - m_last_result = (INT8)m_last_signed * (UINT8)m_last_unsigned; + m_last_result = (int8_t)m_last_signed * (uint8_t)m_last_unsigned; } // logerror("%04X: read IC25 @ %04X = %02X\n", space.device().safe_pc(), offset, result); @@ -365,7 +365,7 @@ WRITE8_MEMBER(polepos_state::out_1) READ8_MEMBER(polepos_state::namco_52xx_rom_r) { - UINT32 length = memregion("52xx")->bytes(); + uint32_t length = memregion("52xx")->bytes(); logerror("ROM @ %04X\n", offset); return (offset < length) ? memregion("52xx")->base()[offset] : 0xff; } @@ -385,8 +385,8 @@ READ8_MEMBER(polepos_state::namco_53xx_k_r) READ8_MEMBER(polepos_state::steering_changed_r) { /* read the current steering value and update our delta */ - UINT8 steer_new = ioport("STEER")->read(); - m_steer_accum += (INT8)(steer_new - m_steer_last) * 2; + uint8_t steer_new = ioport("STEER")->read(); + m_steer_accum += (int8_t)(steer_new - m_steer_last) * 2; m_steer_last = steer_new; /* if we have delta, clock things */ diff --git a/src/mame/drivers/policetr.cpp b/src/mame/drivers/policetr.cpp index 38de22c781d..49731bd7d4e 100644 --- a/src/mame/drivers/policetr.cpp +++ b/src/mame/drivers/policetr.cpp @@ -132,7 +132,7 @@ INTERRUPT_GEN_MEMBER(policetr_state::irq4_gen) WRITE32_MEMBER(policetr_state::control_w) { - UINT32 old = m_control_data; + uint32_t old = m_control_data; // bit $80000000 = BSMT access/ROM read // bit $20000000 = toggled every 64 IRQ4's @@ -213,7 +213,7 @@ WRITE32_MEMBER(policetr_state::speedup_w) /* see if the PC matches */ if ((space.device().safe_pcbase() & 0x1fffffff) == m_speedup_pc) { - UINT64 curr_cycles = m_maincpu->total_cycles(); + uint64_t curr_cycles = m_maincpu->total_cycles(); /* if less than 50 cycles from the last time, count it */ if (curr_cycles - m_last_cycles < 50) diff --git a/src/mame/drivers/poly.cpp b/src/mame/drivers/poly.cpp index de700ab148f..9561fa4164a 100644 --- a/src/mame/drivers/poly.cpp +++ b/src/mame/drivers/poly.cpp @@ -75,8 +75,8 @@ private: required_device m_acia; required_device m_ptm; required_device m_speaker; - required_shared_ptr m_videoram; - UINT8 m_term_data; + required_shared_ptr m_videoram; + uint8_t m_term_data; }; @@ -116,7 +116,7 @@ void poly_state::machine_reset() READ8_MEMBER( poly_state::pia1_b_in ) { // return ascii key value, bit 7 is the strobe value - UINT8 data = m_term_data; + uint8_t data = m_term_data; m_term_data &= 0x7f; return data; } diff --git a/src/mame/drivers/poly880.cpp b/src/mame/drivers/poly880.cpp index 679d220fa00..0e2cb9b50b5 100644 --- a/src/mame/drivers/poly880.cpp +++ b/src/mame/drivers/poly880.cpp @@ -181,7 +181,7 @@ READ8_MEMBER( poly880_state::pio1_pb_r ) */ - UINT8 data = 0xf0 | ((m_cassette->input() < +0.0) << 1); + uint8_t data = 0xf0 | ((m_cassette->input() < +0.0) << 1); int i; for (i = 0; i < 8; i++) diff --git a/src/mame/drivers/poolshrk.cpp b/src/mame/drivers/poolshrk.cpp index 5e68c623bb4..7a26d97eed7 100644 --- a/src/mame/drivers/poolshrk.cpp +++ b/src/mame/drivers/poolshrk.cpp @@ -16,8 +16,8 @@ Atari Poolshark Driver DRIVER_INIT_MEMBER(poolshrk_state,poolshrk) { - UINT8* pSprite = memregion("gfx1")->base(); - UINT8* pOffset = memregion("proms")->base(); + uint8_t* pSprite = memregion("gfx1")->base(); + uint8_t* pOffset = memregion("proms")->base(); /* re-arrange sprite data using the PROM */ @@ -25,7 +25,7 @@ DRIVER_INIT_MEMBER(poolshrk_state,poolshrk) { for (int j = 0; j < 16; j++) { - UINT16 v = + uint16_t v = (pSprite[0] << 0xC) | (pSprite[1] << 0x8) | (pSprite[2] << 0x4) | @@ -73,7 +73,7 @@ WRITE8_MEMBER(poolshrk_state::watchdog_w) READ8_MEMBER(poolshrk_state::input_r) { static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; - UINT8 val = ioport(portnames[offset & 3])->read(); + uint8_t val = ioport(portnames[offset & 3])->read(); int x = ioport((offset & 1) ? "AN1" : "AN0")->read(); int y = ioport((offset & 1) ? "AN3" : "AN2")->read(); diff --git a/src/mame/drivers/popeye.cpp b/src/mame/drivers/popeye.cpp index 09c70226e16..794ae326bb8 100644 --- a/src/mame/drivers/popeye.cpp +++ b/src/mame/drivers/popeye.cpp @@ -720,12 +720,12 @@ ROM_END DRIVER_INIT_MEMBER(popeye_state,skyskipr) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int len = memregion("maincpu")->bytes(); /* decrypt the program ROMs */ { - std::vector buffer(len); + std::vector buffer(len); int i; for (i = 0;i < len; i++) buffer[i] = BITSWAP8(rom[BITSWAP16(i,15,14,13,12,11,10,8,7,0,1,2,4,5,9,3,6) ^ 0xfc],3,4,2,5,1,6,0,7); @@ -739,12 +739,12 @@ DRIVER_INIT_MEMBER(popeye_state,skyskipr) DRIVER_INIT_MEMBER(popeye_state,popeye) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int len = memregion("maincpu")->bytes(); /* decrypt the program ROMs */ { - std::vector buffer(len); + std::vector buffer(len); int i; for (i = 0;i < len; i++) buffer[i] = BITSWAP8(rom[BITSWAP16(i,15,14,13,12,11,10,8,7,6,3,9,5,4,2,1,0) ^ 0x3f],3,4,2,5,1,6,0,7); diff --git a/src/mame/drivers/popobear.cpp b/src/mame/drivers/popobear.cpp index f99a29a1e3d..ceddfcd3847 100644 --- a/src/mame/drivers/popobear.cpp +++ b/src/mame/drivers/popobear.cpp @@ -104,11 +104,11 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spr; - required_shared_ptr m_vram; - required_shared_ptr m_vregs; + required_shared_ptr m_spr; + required_shared_ptr m_vram; + required_shared_ptr m_vregs; - std::vector m_vram_rearranged; + std::vector m_vram_rearranged; int m_tilemap_base[4]; tilemap_t *m_bg_tilemap[4]; @@ -122,7 +122,7 @@ public: DECLARE_WRITE16_MEMBER(vram_w); virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(irq); @@ -215,7 +215,7 @@ void popobear_state::video_start() { m_vram_rearranged.resize(0x100000 / 2); - m_gfxdecode->gfx(0)->set_source(reinterpret_cast(&m_vram_rearranged[0])); + m_gfxdecode->gfx(0)->set_source(reinterpret_cast(&m_vram_rearranged[0])); m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(popobear_state::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(popobear_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); @@ -236,7 +236,7 @@ void popobear_state::video_start() void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) { - UINT8* vram = reinterpret_cast(m_spr.target()); + uint8_t* vram = reinterpret_cast(m_spr.target()); int i; /* @@ -256,7 +256,7 @@ void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect /* 0x*29 = 32 x 32 */ for(i = 0x800-8;i >= 0; i-=8) { - UINT16 *sprdata = &m_spr[(0x7f800 + i) / 2]; + uint16_t *sprdata = &m_spr[(0x7f800 + i) / 2]; int param = sprdata[0]; int pri = (param & 0x0f00)>>8; @@ -321,7 +321,7 @@ void popobear_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect for(int xi=0;xi>8; + uint16_t val = m_vram[scrollbase/2 + line]; + uint16_t upper = (m_vram[scrollbase2/2 + line]&0xff00)>>8; clip.min_y = clip.max_y = line; @@ -428,8 +428,8 @@ UINT32 popobear_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap for (line = 0; line < 240;line++) { - UINT16 val = m_vram[scrollbase/2 + line]; - UINT16 upper = (m_vram[scrollbase2/2 + line]&0x00ff)>>0; + uint16_t val = m_vram[scrollbase/2 + line]; + uint16_t upper = (m_vram[scrollbase2/2 + line]&0x00ff)>>0; clip.min_y = clip.max_y = line; diff --git a/src/mame/drivers/powerbal.cpp b/src/mame/drivers/powerbal.cpp index 4f216334ce1..675a0a88ef4 100644 --- a/src/mame/drivers/powerbal.cpp +++ b/src/mame/drivers/powerbal.cpp @@ -40,7 +40,7 @@ public: DECLARE_MACHINE_START(powerbal); DECLARE_MACHINE_RESET(powerbal); DECLARE_VIDEO_START(powerbal); - UINT32 screen_update_powerbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_powerbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites_powerbal( bitmap_ind16 &bitmap, const rectangle &cliprect ); DECLARE_WRITE16_MEMBER(magicstk_coin_eeprom_w); DECLARE_WRITE16_MEMBER(magicstk_bgvideoram_w); @@ -401,7 +401,7 @@ TILE_GET_INFO_MEMBER(powerbal_state::powerbal_get_bg_tile_info) void powerbal_state::draw_sprites_powerbal(bitmap_ind16 &bitmap, const rectangle &cliprect ) { - UINT16 *spriteram = m_spriteram; + uint16_t *spriteram = m_spriteram; int offs; int height = m_gfxdecode->gfx(0)->height(); @@ -436,7 +436,7 @@ VIDEO_START_MEMBER(powerbal_state,powerbal) m_bg_tilemap->set_scrolly(0, m_bg_yoffset); } -UINT32 powerbal_state::screen_update_powerbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t powerbal_state::screen_update_powerbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites_powerbal(bitmap, cliprect); diff --git a/src/mame/drivers/ppmast93.cpp b/src/mame/drivers/ppmast93.cpp index 2cb57231ceb..60422c41e82 100644 --- a/src/mame/drivers/ppmast93.cpp +++ b/src/mame/drivers/ppmast93.cpp @@ -152,8 +152,8 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_bgram; - required_shared_ptr m_fgram; + required_shared_ptr m_bgram; + required_shared_ptr m_fgram; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; @@ -168,7 +168,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); }; @@ -351,7 +351,7 @@ void ppmast93_state::video_start() m_fg_tilemap->set_transparent_pen(0); } -UINT32 ppmast93_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ppmast93_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0); diff --git a/src/mame/drivers/prestige.cpp b/src/mame/drivers/prestige.cpp index a47d5335187..6bbfd020ef1 100644 --- a/src/mame/drivers/prestige.cpp +++ b/src/mame/drivers/prestige.cpp @@ -114,26 +114,26 @@ public: required_memory_bank m_bank4; required_memory_bank m_bank5; - UINT8 m_bank[7]; - UINT8 m_kb_matrix; - UINT8 m_irq_counter; - UINT8 m_mousex; - UINT8 m_mousey; - UINT8 *m_vram; + uint8_t m_bank[7]; + uint8_t m_kb_matrix; + uint8_t m_irq_counter; + uint8_t m_mousex; + uint8_t m_mousey; + uint8_t *m_vram; struct { - UINT16 addr1; - UINT16 addr2; - UINT8 lcd_w; - UINT8 lcd_h; - UINT8 fb_width; - UINT8 split_pos; + uint16_t addr1; + uint16_t addr2; + uint8_t lcd_w; + uint8_t lcd_h; + uint8_t fb_width; + uint8_t split_pos; } m_lcdc; virtual void machine_start() override; - UINT32 screen_update(int bpp, screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_1bpp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_2bpp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(int bpp, screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_1bpp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_2bpp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); memory_region *m_cart_rom; @@ -225,7 +225,7 @@ WRITE8_MEMBER( prestige_state::bankswitch_w ) READ8_MEMBER( prestige_state::kb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int line=0; line<8; line++) if (!(m_kb_matrix & (1<set_input_line(0, CLEAR_LINE); @@ -624,8 +624,8 @@ void prestige_state::machine_start() std::string region_tag; m_cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - UINT8 *rom = memregion("maincpu")->base(); - UINT8 *cart = nullptr; + uint8_t *rom = memregion("maincpu")->base(); + uint8_t *cart = nullptr; if (m_cart_rom != nullptr) { cart = m_cart_rom->base(); @@ -634,7 +634,7 @@ void prestige_state::machine_start() { cart = rom + 0x40000; // internal ROM also includes extra contents that are activated by a cartridge that works as a jumper } - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); memset(ram, 0x00, m_ram->size()); m_bank1->configure_entries(0, 64, rom, 0x4000); @@ -670,7 +670,7 @@ PALETTE_INIT_MEMBER(prestige_state, glcolor) palette.set_pen_color(3, rgb_t(0xff,0xdf,0x1f)); } -UINT32 prestige_state::screen_update(int bpp, screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t prestige_state::screen_update(int bpp, screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int width = m_lcdc.fb_width + m_lcdc.lcd_w + 1; @@ -684,7 +684,7 @@ UINT32 prestige_state::screen_update(int bpp, screen_device &screen, bitmap_ind1 for (int sx = 0; sx <= m_lcdc.lcd_w; sx++) { - UINT8 data = m_vram[(line_start + sx) & 0x1fff]; + uint8_t data = m_vram[(line_start + sx) & 0x1fff]; for (int x = 0; x < 8 / bpp; x++) { @@ -703,12 +703,12 @@ UINT32 prestige_state::screen_update(int bpp, screen_device &screen, bitmap_ind1 return 0; } -UINT32 prestige_state::screen_update_1bpp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t prestige_state::screen_update_1bpp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update(1, screen, bitmap, cliprect); } -UINT32 prestige_state::screen_update_2bpp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t prestige_state::screen_update_2bpp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return screen_update(2, screen, bitmap, cliprect); } diff --git a/src/mame/drivers/pro80.cpp b/src/mame/drivers/pro80.cpp index d3ca03b873f..f2fb3385f80 100644 --- a/src/mame/drivers/pro80.cpp +++ b/src/mame/drivers/pro80.cpp @@ -40,9 +40,9 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_p); private: - UINT8 m_digit_sel; - UINT8 m_cass_in; - UINT16 m_cass_data[4]; + uint8_t m_digit_sel; + uint8_t m_cass_in; + uint16_t m_cass_data[4]; void machine_reset() override; required_device m_maincpu; required_device m_cass; @@ -53,7 +53,7 @@ private: TIMER_DEVICE_CALLBACK_MEMBER( pro80_state::timer_p ) { m_cass_data[1]++; - UINT8 cass_ws = ((m_cass)->input() > +0.03) ? 1 : 0; + uint8_t cass_ws = ((m_cass)->input() > +0.03) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -91,7 +91,7 @@ WRITE8_MEMBER( pro80_state::segment_w ) READ8_MEMBER( pro80_state::kp_r ) { - UINT8 data = 0x0f; + uint8_t data = 0x0f; if (!BIT(m_digit_sel, 0)) data &= ioport("LINE0")->read(); if (!BIT(m_digit_sel, 1)) data &= ioport("LINE1")->read(); diff --git a/src/mame/drivers/prof180x.cpp b/src/mame/drivers/prof180x.cpp index 6b4cd7733bd..0039a148067 100644 --- a/src/mame/drivers/prof180x.cpp +++ b/src/mame/drivers/prof180x.cpp @@ -31,7 +31,7 @@ #include "includes/prof180x.h" #include "softlist.h" -UINT32 prof180x_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t prof180x_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } @@ -39,7 +39,7 @@ UINT32 prof180x_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap READ8_MEMBER( prof180x_state::read ) { - UINT8 data = 0; + uint8_t data = 0; if (offset < 0x40000) { diff --git a/src/mame/drivers/prof80.cpp b/src/mame/drivers/prof80.cpp index 7dea1756b37..22efc3db53f 100644 --- a/src/mame/drivers/prof80.cpp +++ b/src/mame/drivers/prof80.cpp @@ -209,7 +209,7 @@ READ8_MEMBER( prof80_state::status_r ) */ - UINT8 data = 0; + uint8_t data = 0; // serial receive data |= !m_rs232a->rxd_r(); @@ -246,7 +246,7 @@ READ8_MEMBER( prof80_state::status2_r ) */ - UINT8 data = 0; + uint8_t data = 0; int js4 = 0, js5 = 0; // floppy motor diff --git a/src/mame/drivers/progolf.cpp b/src/mame/drivers/progolf.cpp index 213be37d7aa..3db5b9fb7ea 100644 --- a/src/mame/drivers/progolf.cpp +++ b/src/mame/drivers/progolf.cpp @@ -76,16 +76,16 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_fbram; + required_shared_ptr m_videoram; + required_shared_ptr m_fbram; - UINT8 m_char_pen; - UINT8 m_char_pen_vreg; - std::unique_ptr m_fg_fb; - UINT8 m_scrollx_hi; - UINT8 m_scrollx_lo; - UINT8 m_gfx_switch; - UINT8 m_sound_cmd; + uint8_t m_char_pen; + uint8_t m_char_pen_vreg; + std::unique_ptr m_fg_fb; + uint8_t m_scrollx_hi; + uint8_t m_scrollx_lo; + uint8_t m_gfx_switch; + uint8_t m_sound_cmd; DECLARE_WRITE8_MEMBER(charram_w); DECLARE_WRITE8_MEMBER(char_vregs_w); @@ -103,7 +103,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(progolf); - 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); }; @@ -117,7 +117,7 @@ void progolf_state::video_start() m_scrollx_hi = 0; m_scrollx_lo = 0; - m_fg_fb = std::make_unique(0x2000*8); + m_fg_fb = std::make_unique(0x2000*8); save_item(NAME(m_char_pen)); save_item(NAME(m_char_pen_vreg)); @@ -128,7 +128,7 @@ void progolf_state::video_start() } -UINT32 progolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t progolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int count,color,x,y,xi,yi; @@ -239,7 +239,7 @@ READ8_MEMBER(progolf_state::audio_command_r) READ8_MEMBER(progolf_state::videoram_r) { - UINT8 *gfx_rom = memregion("gfx1")->base(); + uint8_t *gfx_rom = memregion("gfx1")->base(); if (offset >= 0x0800) { @@ -394,7 +394,7 @@ GFXDECODE_END PALETTE_INIT_MEMBER(progolf_state, progolf) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0;i < m_palette->entries();i++) diff --git a/src/mame/drivers/prophet600.cpp b/src/mame/drivers/prophet600.cpp index b422edc2dd0..5d4d01c3bf6 100644 --- a/src/mame/drivers/prophet600.cpp +++ b/src/mame/drivers/prophet600.cpp @@ -106,9 +106,9 @@ public: DECLARE_WRITE8_MEMBER(gate_w); private: - UINT16 m_dac; - UINT8 m_scanrow; - UINT8 m_comparitor; + uint16_t m_dac; + uint8_t m_scanrow; + uint8_t m_comparitor; bool m_nmi_gate; @@ -116,7 +116,7 @@ private: bool m_ASaw, m_ATri, m_Sync, m_BSaw, m_BTri, m_PModFA, m_PModFil; // control voltages - UINT16 m_CVs[CV_MAX]; + uint16_t m_CVs[CV_MAX]; }; WRITE_LINE_MEMBER( prophet600_state::pit_ch0_tick_w ) diff --git a/src/mame/drivers/proteus3.cpp b/src/mame/drivers/proteus3.cpp index 04e28c82c63..b0c55b5392b 100644 --- a/src/mame/drivers/proteus3.cpp +++ b/src/mame/drivers/proteus3.cpp @@ -75,18 +75,18 @@ public: DECLARE_WRITE_LINE_MEMBER(acia2_clock_w); TIMER_DEVICE_CALLBACK_MEMBER(timer_c); TIMER_DEVICE_CALLBACK_MEMBER(timer_p); - UINT32 screen_update_proteus3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_proteus3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: - UINT8 m_video_data; - UINT8 m_flashcnt; - UINT16 m_curs_pos; - UINT8 *m_p_chargen; - UINT8 *m_p_videoram; - UINT8 m_cass_data[4]; + uint8_t m_video_data; + uint8_t m_flashcnt; + uint16_t m_curs_pos; + uint8_t *m_p_chargen; + uint8_t *m_p_videoram; + uint8_t m_cass_data[4]; bool m_cass_state; bool m_cassold; - UINT8 m_clockcnt; + uint8_t m_clockcnt; virtual void machine_reset() override; required_device m_maincpu; required_device m_pia; @@ -159,7 +159,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( proteus3_state::timer_p ) { /* cassette - turn 1200/2400Hz to a bit */ m_cass_data[1]++; - UINT8 cass_ws = (m_cass->input() > +0.01) ? 1 : 0; + uint8_t cass_ws = (m_cass->input() > +0.01) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -236,17 +236,17 @@ WRITE_LINE_MEMBER( proteus3_state::ca2_w ) } } -UINT32 proteus3_state::screen_update_proteus3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t proteus3_state::screen_update_proteus3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; m_flashcnt++; for(y = 0; y < 16; y++ ) { for (ra = 0; ra < 12; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 64; x++) { diff --git a/src/mame/drivers/psikyo.cpp b/src/mame/drivers/psikyo.cpp index 6ddfd257f22..ebf33ed19d1 100644 --- a/src/mame/drivers/psikyo.cpp +++ b/src/mame/drivers/psikyo.cpp @@ -172,19 +172,19 @@ WRITE32_MEMBER(psikyo_state::s1945_soundlatch_w) machine().scheduler().synchronize(timer_expired_delegate(FUNC(psikyo_state::psikyo_soundlatch_callback),this), (data >> 16) & 0xff); } -static const UINT8 s1945_table[256] = { +static const uint8_t s1945_table[256] = { 0x00, 0x00, 0x64, 0xae, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc, 0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc5, 0x1e, 0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xac, 0x5c, 0x00, 0x00, 0x2b, 0xc0 }; -static const UINT8 s1945a_table[256] = { +static const uint8_t s1945a_table[256] = { 0x00, 0x00, 0x64, 0xbe, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc, 0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc7, 0x2a, 0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xad, 0x4c, 0x00, 0x00, 0x2b, 0xc0 }; -static const UINT8 s1945j_table[256] = { +static const uint8_t s1945j_table[256] = { 0x00, 0x00, 0x64, 0xb6, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc, 0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc5, 0x92, 0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xac, 0x64, 0x00, 0x00, 0x2b, 0xc0 @@ -266,7 +266,7 @@ READ32_MEMBER(psikyo_state::s1945_mcu_r) { case 0: { - UINT32 res; + uint32_t res; if (m_s1945_mcu_control & 16) { res = m_s1945_mcu_latching & 4 ? 0x0000ff00 : m_s1945_mcu_latch1 << 8; @@ -322,7 +322,7 @@ ADDRESS_MAP_END READ32_MEMBER(psikyo_state::s1945bl_oki_r) { - UINT8 dat = m_oki->read(space, 0); + uint8_t dat = m_oki->read(space, 0); return dat << 24; } @@ -336,7 +336,7 @@ WRITE32_MEMBER(psikyo_state::s1945bl_oki_w) if (ACCESSING_BITS_16_23) { // not at all sure about this, it seems to write 0 too often - UINT8 bank = (data & 0x00ff0000) >> 16; + uint8_t bank = (data & 0x00ff0000) >> 16; if (bank < 4) membank("okibank")->set_entry(bank); } @@ -1808,7 +1808,7 @@ ROM_END DRIVER_INIT_MEMBER(psikyo_state,sngkace) { { - UINT8 *RAM = memregion("ymsnd")->base(); + uint8_t *RAM = memregion("ymsnd")->base(); int len = memregion("ymsnd")->bytes(); int i; @@ -1835,7 +1835,7 @@ DRIVER_INIT_MEMBER(psikyo_state,sngkace) #if 0 if (!strcmp(machine().system().name,"sngkace")) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x995] = 0x4e; ROM[0x994] = 0x71; ROM[0x997] = 0x4e; diff --git a/src/mame/drivers/psikyo4.cpp b/src/mame/drivers/psikyo4.cpp index 4b832442e0d..afa12781d97 100644 --- a/src/mame/drivers/psikyo4.cpp +++ b/src/mame/drivers/psikyo4.cpp @@ -294,8 +294,8 @@ WRITE32_MEMBER(psikyo4_state::io_select_w) // YMF banking if (ACCESSING_BITS_16_31) { - UINT32 bankdata = data >> 16; - UINT32 bankmask = mem_mask >> 16; + uint32_t bankdata = data >> 16; + uint32_t bankmask = mem_mask >> 16; for (auto & elem : m_ymf_bank) { if (bankmask & 0x0f) diff --git a/src/mame/drivers/psikyosh.cpp b/src/mame/drivers/psikyosh.cpp index a1cb2882935..34f67dec54d 100644 --- a/src/mame/drivers/psikyosh.cpp +++ b/src/mame/drivers/psikyosh.cpp @@ -415,8 +415,8 @@ P1KEY11 29|30 P2KEY11 GND 55|56 GND */ - UINT32 controls = ioport("CONTROLLER")->read(); - UINT32 value = ioport("INPUTS")->read(); + uint32_t controls = ioport("CONTROLLER")->read(); + uint32_t value = ioport("INPUTS")->read(); if(controls) { // Clearly has ghosting, game will only recognise one key depressed at once, and keyboard can only represent keys with distinct rows and columns @@ -438,7 +438,7 @@ P1KEY11 29|30 P2KEY11 KEY11 = 0x0800 // JAMMA P1 Button 1 }; // Mahjong->JAMMA mapping specific to this game pcb - UINT16 key_codes[] = { // treated as IP_ACTIVE_LOW, game inverts them upon reading + uint16_t key_codes[] = { // treated as IP_ACTIVE_LOW, game inverts them upon reading // ROW (distinct pins for P1 or P2) | COLUMN (shared for P1+P2) KEY4 | KEY3, // A KEY4 | KEY2, // B @@ -461,8 +461,8 @@ P1KEY11 29|30 P2KEY11 KEY11 | KEY6, // Ron KEY1 | KEY3 // Start }; // generic Mahjong keyboard encoder, corresponds to ordering in input port - UINT32 keys = ioport("MAHJONG")->read(); - UINT32 which_key = 0x1; + uint32_t keys = ioport("MAHJONG")->read(); + uint32_t which_key = 0x1; int count = 0; // HACK: read IPT_START1 from "INPUTS" to avoid listing it twice or having two independent STARTs listed @@ -473,7 +473,7 @@ P1KEY11 29|30 P2KEY11 do { // since we can't handle multiple keys, just return the first one depressed if((keys & which_key) && (count < ARRAY_LENGTH(key_codes))) { - value &= ~((UINT32)(key_codes[count]) << 16); // mask in selected word as IP_ACTIVE_LOW + value &= ~((uint32_t)(key_codes[count]) << 16); // mask in selected word as IP_ACTIVE_LOW break; } which_key <<= 1; diff --git a/src/mame/drivers/psion.cpp b/src/mame/drivers/psion.cpp index 39f7c7d9dce..32cb938fb87 100644 --- a/src/mame/drivers/psion.cpp +++ b/src/mame/drivers/psion.cpp @@ -31,10 +31,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(psion_state::nmi_timer) m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); } -UINT8 psion_state::kb_read() +uint8_t psion_state::kb_read() { static const char *const bitnames[] = {"K1", "K2", "K3", "K4", "K5", "K6", "K7"}; - UINT8 line, data = 0x7c; + uint8_t line, data = 0x7c; if (m_kb_counter) { @@ -132,7 +132,7 @@ READ8_MEMBER( psion_state::hd63701_int_reg_r ) } /* Read/Write common */ -void psion_state::io_rw(address_space &space, UINT16 offset) +void psion_state::io_rw(address_space &space, uint16_t offset) { if (space.debugger_access()) return; @@ -463,7 +463,7 @@ void psion_state::machine_start() if (m_rom_bank_count) { - UINT8* rom_base = (UINT8 *)memregion("maincpu")->base(); + uint8_t* rom_base = (uint8_t *)memregion("maincpu")->base(); membank("rombank")->configure_entry(0, rom_base + 0x8000); membank("rombank")->configure_entries(1, m_rom_bank_count-1, rom_base + 0x10000, 0x4000); @@ -472,8 +472,8 @@ void psion_state::machine_start() if (m_ram_bank_count) { - m_paged_ram = std::make_unique(m_ram_bank_count * 0x4000); - memset(m_paged_ram.get(), 0, sizeof(UINT8) * (m_ram_bank_count * 0x4000)); + m_paged_ram = std::make_unique(m_ram_bank_count * 0x4000); + memset(m_paged_ram.get(), 0, sizeof(uint8_t) * (m_ram_bank_count * 0x4000)); membank("rambank")->configure_entries(0, m_ram_bank_count, m_paged_ram.get(), 0x4000); membank("rambank")->set_entry(0); } @@ -519,7 +519,7 @@ HD44780_PIXEL_UPDATE(psion_state::lz_pixel_update) { if (pos < 40) { - static const UINT8 psion_display_layout[] = + static const uint8_t psion_display_layout[] = { 0x00, 0x01, 0x02, 0x03, 0x28, 0x29, 0x2a, 0x2b, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, @@ -527,7 +527,7 @@ HD44780_PIXEL_UPDATE(psion_state::lz_pixel_update) 0x44, 0x45, 0x46, 0x47, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f }; - UINT8 char_pos = psion_display_layout[line*40 + pos]; + uint8_t char_pos = psion_display_layout[line*40 + pos]; bitmap.pix16((char_pos / 20) * 9 + y, (char_pos % 20) * 6 + x) = state; } } diff --git a/src/mame/drivers/psx.cpp b/src/mame/drivers/psx.cpp index ab768f2c431..10ead0cdd54 100644 --- a/src/mame/drivers/psx.cpp +++ b/src/mame/drivers/psx.cpp @@ -33,21 +33,21 @@ public: { } - UINT8 *m_exe_buffer; + uint8_t *m_exe_buffer; int m_exe_size; int m_cd_param_p; int m_cd_result_p; int m_cd_result_c; int m_cd_result_ready; int m_cd_reset; - UINT8 m_cd_stat; - UINT8 m_cd_io_status; - UINT8 m_cd_param[8]; - UINT8 m_cd_result[8]; + uint8_t m_cd_stat; + uint8_t m_cd_io_status; + uint8_t m_cd_param[8]; + uint8_t m_cd_result[8]; DECLARE_MACHINE_RESET(psx); inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); - void cd_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ); - void cd_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ); + void cd_dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); + void cd_dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); required_device m_maincpu; required_device m_ram; }; @@ -69,14 +69,14 @@ inline void ATTR_PRINTF(3,4) psx1_state::verboselog( int n_level, const char *s } -void psx1_state::cd_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void psx1_state::cd_dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { - UINT8 *psxram = (UINT8 *) p_n_psxram; + uint8_t *psxram = (uint8_t *) p_n_psxram; psxcd_device *psxcd = machine().device(PSXCD_TAG); psxcd->start_dma(psxram + n_address, n_size*4); } -void psx1_state::cd_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void psx1_state::cd_dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { printf("cd_dma_write?!: addr %x, size %x\n", n_address, n_size); } diff --git a/src/mame/drivers/pt68k4.cpp b/src/mame/drivers/pt68k4.cpp index 24a15248436..86f5203f4a2 100644 --- a/src/mame/drivers/pt68k4.cpp +++ b/src/mame/drivers/pt68k4.cpp @@ -113,7 +113,7 @@ public: private: virtual void machine_start() override; virtual void machine_reset() override; - required_shared_ptr m_p_base; + required_shared_ptr m_p_base; required_device m_maincpu; required_device m_duart1; required_device m_duart2; @@ -123,12 +123,12 @@ private: void irq5_update(); - UINT8 m_hiram[0x800]; + uint8_t m_hiram[0x800]; bool m_kclk; - UINT8 m_kdata; - UINT8 m_scancode; - UINT8 m_kbdflag; + uint8_t m_kdata; + uint8_t m_scancode; + uint8_t m_kbdflag; int m_kbit; int m_lastdrive; bool m_irq5_duart1, m_irq5_isa; @@ -270,7 +270,7 @@ READ8_MEMBER(pt68k4_state::keyboard_r) { if (offset == 0) { - UINT8 rv = m_kbdflag; + uint8_t rv = m_kbdflag; m_kbdflag = 0; m_duart1->ip2_w(ASSERT_LINE); @@ -312,8 +312,8 @@ void pt68k4_state::machine_start() void pt68k4_state::machine_reset() { - UINT8* user1 = memregion("roms")->base(); - memcpy((UINT8*)m_p_base.target(), user1, 8); + uint8_t* user1 = memregion("roms")->base(); + memcpy((uint8_t*)m_p_base.target(), user1, 8); m_maincpu->reset(); diff --git a/src/mame/drivers/ptcsol.cpp b/src/mame/drivers/ptcsol.cpp index c7515dfb4b7..48b49da109e 100644 --- a/src/mame/drivers/ptcsol.cpp +++ b/src/mame/drivers/ptcsol.cpp @@ -167,18 +167,18 @@ public: DECLARE_DRIVER_INIT(sol20); TIMER_CALLBACK_MEMBER(sol20_cassette_tc); TIMER_CALLBACK_MEMBER(sol20_boot); - 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); private: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - UINT8 m_sol20_fa; + uint8_t m_sol20_fa; virtual void machine_reset() override; virtual void machine_start() override; virtual void video_start() override; - UINT8 m_sol20_fc; - UINT8 m_sol20_fe; - const UINT8 *m_p_chargen; - UINT8 m_framecnt; + uint8_t m_sol20_fc; + uint8_t m_sol20_fe; + const uint8_t *m_p_chargen; + uint8_t m_framecnt; cass_data_t m_cass_data; emu_timer *m_cassette_timer; cassette_image_device *cassette_device_image(); @@ -187,7 +187,7 @@ private: required_device m_cass2; required_device m_uart; required_device m_uart_s; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_ioport m_iop_arrows; required_ioport m_iop_config; required_ioport m_iop_s1; @@ -230,7 +230,7 @@ void sol20_state::device_timer(emu_timer &timer, device_timer_id id, int param, // identical to sorcerer TIMER_CALLBACK_MEMBER(sol20_state::sol20_cassette_tc) { - UINT8 cass_ws = 0; + uint8_t cass_ws = 0; switch (m_sol20_fa & 0x20) { case 0x20: /* Cassette 300 baud */ @@ -320,7 +320,7 @@ READ8_MEMBER( sol20_state::sol20_f8_r ) { // d7 - TMBT; d6 - DAV; d5 - CTS; d4 - OE; d3 - PE; d2 - FE; d1 - DSR; d0 - CD /* set unemulated bits (CTS/DSR/CD) high */ - UINT8 data = 0x23; + uint8_t data = 0x23; m_uart_s->set_input_pin(AY31015_SWE, 0); data |= m_uart_s->get_output_pin(AY31015_TBMT) ? 0x80 : 0; @@ -335,7 +335,7 @@ READ8_MEMBER( sol20_state::sol20_f8_r ) READ8_MEMBER( sol20_state::sol20_f9_r) { - UINT8 data = m_uart_s->get_received_data(); + uint8_t data = m_uart_s->get_received_data(); m_uart_s->set_input_pin(AY31015_RDAV, 0); m_uart_s->set_input_pin(AY31015_RDAV, 1); return data; @@ -344,7 +344,7 @@ READ8_MEMBER( sol20_state::sol20_f9_r) READ8_MEMBER( sol20_state::sol20_fa_r ) { /* set unused bits high */ - UINT8 data = 0x26; + uint8_t data = 0x26; m_uart->set_input_pin(AY31015_SWE, 0); data |= m_uart->get_output_pin(AY31015_TBMT) ? 0x80 : 0; @@ -361,7 +361,7 @@ READ8_MEMBER( sol20_state::sol20_fa_r ) READ8_MEMBER( sol20_state::sol20_fb_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; @@ -369,7 +369,7 @@ READ8_MEMBER( sol20_state::sol20_fb_r) READ8_MEMBER( sol20_state::sol20_fc_r ) { - UINT8 data = m_iop_arrows->read(); + uint8_t data = m_iop_arrows->read(); if (BIT(data, 0)) return 0x32; if (BIT(data, 1)) return 0x34; if (BIT(data, 2)) return 0x36; @@ -561,9 +561,9 @@ void sol20_state::machine_start() void sol20_state::machine_reset() { - UINT8 data = 0, s_count = 0; + uint8_t data = 0, s_count = 0; int s_clock; - const UINT16 s_bauds[8]={ 75, 110, 180, 300, 600, 1200, 2400, 4800 }; + const uint16_t s_bauds[8]={ 75, 110, 180, 300, 600, 1200, 2400, 4800 }; m_sol20_fe=0; m_sol20_fa=1; @@ -613,7 +613,7 @@ void sol20_state::machine_reset() DRIVER_INIT_MEMBER(sol20_state,sol20) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xc000); } @@ -622,17 +622,17 @@ void sol20_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 sol20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sol20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // Visible screen is 64 x 16, with start position controlled by scroll register. // Each character is 9 pixels wide (blank ones at the right) and 13 lines deep. // Note on blinking characters: // any character with bit 7 set will blink. With DPMON, do DA C000 C2FF to see what happens - UINT16 which = (m_iop_config->read() & 2) << 10; - UINT8 s1 = m_iop_s1->read(); - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma,x,inv; - UINT8 polarity = (s1 & 8) ? 0xff : 0; + uint16_t which = (m_iop_config->read() & 2) << 10; + uint8_t s1 = m_iop_s1->read(); + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma,x,inv; + uint8_t polarity = (s1 & 8) ? 0xff : 0; bool cursor_inv = false; if (((s1 & 0x30) == 0x20) || (((s1 & 0x30) == 0x10) && (m_framecnt & 0x08))) @@ -646,7 +646,7 @@ UINT32 sol20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c { for (ra = 0; ra < 13; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 64; x++) { diff --git a/src/mame/drivers/pturn.cpp b/src/mame/drivers/pturn.cpp index a8941d0b168..09978a2489e 100644 --- a/src/mame/drivers/pturn.cpp +++ b/src/mame/drivers/pturn.cpp @@ -99,8 +99,8 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; tilemap_t *m_fgmap; tilemap_t *m_bgmap; @@ -132,7 +132,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); INTERRUPT_GEN_MEMBER(sub_intgen); INTERRUPT_GEN_MEMBER(main_intgen); @@ -141,7 +141,7 @@ public: -static const UINT8 tile_lookup[0x10]= +static const uint8_t tile_lookup[0x10]= { 0x00, 0x10, 0x40, 0x50, 0x20, 0x30, 0x60, 0x70, @@ -185,7 +185,7 @@ void pturn_state::video_start() save_item(NAME(m_bgcolor)); } -UINT32 pturn_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pturn_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_bgcolor, cliprect); m_bgmap->draw(screen, bitmap, cliprect, 0,0); diff --git a/src/mame/drivers/puckpkmn.cpp b/src/mame/drivers/puckpkmn.cpp index 4206a023a85..ab276011ddc 100644 --- a/src/mame/drivers/puckpkmn.cpp +++ b/src/mame/drivers/puckpkmn.cpp @@ -377,7 +377,7 @@ ROM sockets U63 & U64 empty DRIVER_INIT_MEMBER(md_boot_state,puckpkmn) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); size_t len = memregion("maincpu")->bytes(); int i; diff --git a/src/mame/drivers/pulsar.cpp b/src/mame/drivers/pulsar.cpp index 9cad86a4f56..9a012508c90 100644 --- a/src/mame/drivers/pulsar.cpp +++ b/src/mame/drivers/pulsar.cpp @@ -204,7 +204,7 @@ MACHINE_RESET_MEMBER( pulsar_state, pulsar ) DRIVER_INIT_MEMBER( pulsar_state, pulsar ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x10000]); diff --git a/src/mame/drivers/punchout.cpp b/src/mame/drivers/punchout.cpp index baf9a21a0a5..fd630c64908 100644 --- a/src/mame/drivers/punchout.cpp +++ b/src/mame/drivers/punchout.cpp @@ -225,7 +225,7 @@ READ8_MEMBER(punchout_state::spunchout_exp_r) // d5: _ALARM from RP5C01 // d6: COUNTER OUT from RP5H01 // d7: DATA OUT from RP5H01 - always 0? - UINT8 ret = m_rtc->read(space, offset >> 4 & 0xf) & 0xf; + uint8_t ret = m_rtc->read(space, offset >> 4 & 0xf) & 0xf; ret |= 0x10; ret |= m_rtc->alarm_r() ? 0x00 : 0x20; ret |= m_rp5h01->counter_r() ? 0x00 : 0x40; diff --git a/src/mame/drivers/pv1000.cpp b/src/mame/drivers/pv1000.cpp index 92cfe103fd8..1b7bf3402bd 100644 --- a/src/mame/drivers/pv1000.cpp +++ b/src/mame/drivers/pv1000.cpp @@ -17,7 +17,7 @@ class pv1000_sound_device : public device_t, public device_sound_interface { public: - pv1000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + pv1000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER(voice_w); @@ -34,9 +34,9 @@ private: // internal state struct { - UINT32 count; - UINT16 period; - UINT8 val; + uint32_t count; + uint16_t period; + uint8_t val; } m_voice[4]; sound_stream *m_sh_channel; @@ -46,7 +46,7 @@ extern const device_type PV1000; const device_type PV1000 = &device_creator; -pv1000_sound_device::pv1000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +pv1000_sound_device::pv1000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PV1000, "NEC D65010G031", tag, owner, clock, "pv1000_sound", __FILE__), device_sound_interface(mconfig, *this) { @@ -116,7 +116,7 @@ void pv1000_sound_device::sound_stream_update(sound_stream &stream, stream_sampl for (int i = 0; i < 3; i++) { - UINT32 per = (0x3f - (m_voice[i].period & 0x3f)); + uint32_t per = (0x3f - (m_voice[i].period & 0x3f)); if (per != 0) //OFF! *buffer += m_voice[i].val * 8192; @@ -156,26 +156,26 @@ public: DECLARE_WRITE8_MEMBER(io_w); DECLARE_READ8_MEMBER(io_r); DECLARE_WRITE8_MEMBER(gfxram_w); - UINT8 m_io_regs[8]; - UINT8 m_fd_data; + uint8_t m_io_regs[8]; + uint8_t m_fd_data; emu_timer *m_irq_on_timer; emu_timer *m_irq_off_timer; - UINT8 m_pcg_bank; - UINT8 m_force_pattern; - UINT8 m_fd_buffer_flag; - UINT8 m_border_col; + uint8_t m_pcg_bank; + uint8_t m_force_pattern; + uint8_t m_fd_buffer_flag; + uint8_t m_border_col; - UINT8 * m_gfxram; + uint8_t * m_gfxram; void pv1000_postload(); required_device m_maincpu; required_device m_sound; required_device m_cart; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_pv1000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pv1000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(d65010_irq_on_cb); TIMER_CALLBACK_MEMBER(d65010_irq_off_cb); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( pv1000_cart ); @@ -200,7 +200,7 @@ ADDRESS_MAP_END WRITE8_MEMBER( pv1000_state::gfxram_w ) { - UINT8 *gfxram = memregion( "gfxram" )->base(); + uint8_t *gfxram = memregion( "gfxram" )->base(); gfxram[ offset ] = data; m_gfxdecode->gfx(1)->mark_dirty(offset/32); @@ -240,7 +240,7 @@ WRITE8_MEMBER( pv1000_state::io_w ) READ8_MEMBER( pv1000_state::io_r ) { - UINT8 data = m_io_regs[offset]; + uint8_t data = m_io_regs[offset]; // logerror("io_r offset=%02x\n", offset ); @@ -305,7 +305,7 @@ INPUT_PORTS_END DEVICE_IMAGE_LOAD_MEMBER( pv1000_state, pv1000_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size != 0x2000 && size != 0x4000) { @@ -320,7 +320,7 @@ DEVICE_IMAGE_LOAD_MEMBER( pv1000_state, pv1000_cart ) } -UINT32 pv1000_state::screen_update_pv1000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pv1000_state::screen_update_pv1000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; @@ -330,7 +330,7 @@ UINT32 pv1000_state::screen_update_pv1000(screen_device &screen, bitmap_ind16 &b { for ( x = 2; x < 30; x++ ) // left-right most columns are definitely masked by the border color { - UINT16 tile = m_p_videoram[ y * 32 + x ]; + uint16_t tile = m_p_videoram[ y * 32 + x ]; if ( tile < 0xe0 || m_force_pattern ) { diff --git a/src/mame/drivers/pv2000.cpp b/src/mame/drivers/pv2000.cpp index d58ece15780..5e549743719 100644 --- a/src/mame/drivers/pv2000.cpp +++ b/src/mame/drivers/pv2000.cpp @@ -62,9 +62,9 @@ public: DECLARE_READ8_MEMBER(cass_in); DECLARE_WRITE8_MEMBER(cass_out); bool m_last_state; - UINT8 m_key_pressed; - UINT8 m_keyb_column; - UINT8 m_cass_conf; + uint8_t m_key_pressed; + uint8_t m_keyb_column; + uint8_t m_cass_conf; virtual void machine_start() override; virtual void machine_reset() override; DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pv2000_cart); @@ -96,7 +96,7 @@ WRITE8_MEMBER( pv2000_state::keys_w ) READ8_MEMBER( pv2000_state::keys_hi_r ) { - UINT8 data = 0; + uint8_t data = 0; char kbdrow[6]; switch ( m_keyb_column ) @@ -120,7 +120,7 @@ READ8_MEMBER( pv2000_state::keys_hi_r ) READ8_MEMBER( pv2000_state::keys_lo_r ) { - UINT8 data = 0; + uint8_t data = 0; char kbdrow[6]; logerror("%s: pv2000_keys_r\n", machine().describe_context() ); @@ -321,7 +321,7 @@ WRITE_LINE_MEMBER( pv2000_state::pv2000_vdp_interrupt ) if ( m_keyb_column == 0x0f ) { /* Check if a key is pressed */ - UINT8 key_pressed; + uint8_t key_pressed; key_pressed = ioport( "IN0" )->read() | ioport( "IN1" )->read() @@ -362,7 +362,7 @@ void pv2000_state::machine_reset() DEVICE_IMAGE_LOAD_MEMBER( pv2000_state, pv2000_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size != 0x2000 && size != 0x4000) { diff --git a/src/mame/drivers/pv9234.cpp b/src/mame/drivers/pv9234.cpp index 026ac632927..233b7b5c177 100644 --- a/src/mame/drivers/pv9234.cpp +++ b/src/mame/drivers/pv9234.cpp @@ -35,10 +35,10 @@ public: DECLARE_WRITE32_MEMBER(debug_w); DECLARE_WRITE32_MEMBER(debug1_w); DECLARE_WRITE32_MEMBER(debug2_w); - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_pv9234(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pv9234(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -76,7 +76,7 @@ WRITE32_MEMBER( pv9234_state::debug_w ) WRITE32_MEMBER( pv9234_state::debug1_w ) { - UINT8 i,j; + uint8_t i,j; if (data) { for (i = 0; i < 4; i++) @@ -131,7 +131,7 @@ void pv9234_state::video_start() { } -UINT32 pv9234_state::screen_update_pv9234(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pv9234_state::screen_update_pv9234(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/pve500.cpp b/src/mame/drivers/pve500.cpp index f1f344a38ba..168f142a3ce 100644 --- a/src/mame/drivers/pve500.cpp +++ b/src/mame/drivers/pve500.cpp @@ -87,7 +87,7 @@ private: required_device m_subcpu; required_device m_eeprom; required_device m_buzzer; - UINT8 io_SEL, io_LD, io_LE, io_SC, io_KY; + uint8_t io_SEL, io_LD, io_LE, io_SC, io_KY; }; WRITE_LINE_MEMBER( pve500_state::GPI_w ) diff --git a/src/mame/drivers/px4.cpp b/src/mame/drivers/px4.cpp index 9cca2aab819..c411c30298b 100644 --- a/src/mame/drivers/px4.cpp +++ b/src/mame/drivers/px4.cpp @@ -78,7 +78,7 @@ public: DECLARE_DRIVER_INIT( px4 ); DECLARE_PALETTE_INIT( px4 ); - UINT32 screen_update_px4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_px4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( icrlc_r ); DECLARE_WRITE8_MEMBER( ctrl1_w ); @@ -195,34 +195,34 @@ private: memory_region *m_caps2_rom; // gapnit register - UINT8 m_ctrl1; - UINT16 m_icrb; - UINT8 m_bankr; - UINT8 m_isr; - UINT8 m_ier; - UINT8 m_sior; + uint8_t m_ctrl1; + uint16_t m_icrb; + uint8_t m_bankr; + uint8_t m_isr; + uint8_t m_ier; + uint8_t m_sior; // gapnit internal - UINT16 m_frc_value; - UINT16 m_frc_latch; + uint16_t m_frc_value; + uint16_t m_frc_latch; // gapndi register - UINT8 m_vadr; - UINT8 m_yoff; + uint8_t m_vadr; + uint8_t m_yoff; // gapnio - UINT8 m_artdir; - UINT8 m_artdor; - UINT8 m_artsr; - UINT8 m_artcr; - UINT8 m_swr; + uint8_t m_artdir; + uint8_t m_artdor; + uint8_t m_artsr; + uint8_t m_artcr; + uint8_t m_swr; // 7508 internal bool m_one_sec_int_enabled; bool m_key_int_enabled; - UINT8 m_key_status; - UINT8 m_interrupt_status; + uint8_t m_key_status; + uint8_t m_interrupt_status; system_time m_time; int m_clock_state; @@ -270,7 +270,7 @@ private: required_device m_rdsocket; offs_t m_ramdisk_address; - std::unique_ptr m_ramdisk; + std::unique_ptr m_ramdisk; }; @@ -302,7 +302,7 @@ void px4_state::gapnit_interrupt() // external cassette or barcode reader input TIMER_DEVICE_CALLBACK_MEMBER( px4_state::ext_cassette_read ) { - UINT8 result; + uint8_t result; int trigger = 0; // sample input state @@ -474,7 +474,7 @@ WRITE8_MEMBER( px4_state::ier_w ) // status register READ8_MEMBER( px4_state::str_r ) { - UINT8 data = 0; + uint8_t data = 0; if (0) logerror("%s: str_r\n", machine().describe_context()); @@ -967,7 +967,7 @@ WRITE8_MEMBER( px4_state::artmr_w ) // io status register READ8_MEMBER( px4_state::iostr_r ) { - UINT8 data = 0; + uint8_t data = 0; // centronics status data |= m_centronics_busy << 0; @@ -1066,8 +1066,8 @@ TIMER_DEVICE_CALLBACK_MEMBER( px4_state::upd7508_1sec_callback ) INPUT_CHANGED_MEMBER( px4_state::key_callback ) { - UINT32 oldvalue = oldval * field.mask(), newvalue = newval * field.mask(); - UINT32 delta = oldvalue ^ newvalue; + uint32_t oldvalue = oldval * field.mask(), newvalue = newval * field.mask(); + uint32_t delta = oldvalue ^ newvalue; int i, scancode = 0xff, down = 0; for (i = 0; i < 32; i++) @@ -1120,7 +1120,7 @@ WRITE8_MEMBER( px4p_state::ramdisk_address_w ) READ8_MEMBER( px4p_state::ramdisk_data_r ) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; if (m_ramdisk_address < 0x20000) { @@ -1156,7 +1156,7 @@ READ8_MEMBER( px4p_state::ramdisk_control_r ) // VIDEO EMULATION //************************************************************************** -UINT32 px4_state::screen_update_px4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t px4_state::screen_update_px4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // display enabled? if (BIT(m_yoff, 7)) @@ -1164,12 +1164,12 @@ UINT32 px4_state::screen_update_px4(screen_device &screen, bitmap_ind16 &bitmap, int y, x; // get vram start address - UINT8 *vram = &m_ram->pointer()[(m_vadr & 0xf8) << 8]; + uint8_t *vram = &m_ram->pointer()[(m_vadr & 0xf8) << 8]; for (y = 0; y < 64; y++) { // adjust against y-offset - UINT8 row = (y - (m_yoff & 0x3f)) & 0x3f; + uint8_t row = (y - (m_yoff & 0x3f)) & 0x3f; for (x = 0; x < 240/8; x++) { @@ -1215,7 +1215,7 @@ DRIVER_INIT_MEMBER( px4p_state, px4p ) DRIVER_INIT_CALL(px4); // reserve memory for external ram-disk - m_ramdisk = std::make_unique(0x20000); + m_ramdisk = std::make_unique(0x20000); } void px4_state::machine_start() diff --git a/src/mame/drivers/px8.cpp b/src/mame/drivers/px8.cpp index 79378330c4f..d698c77818b 100644 --- a/src/mame/drivers/px8.cpp +++ b/src/mame/drivers/px8.cpp @@ -79,8 +79,8 @@ enum void px8_state::bankswitch() { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); - UINT8 *ipl_rom = memregion(UPD70008_TAG)->base(); + uint8_t *ram = m_ram->pointer(); + uint8_t *ipl_rom = memregion(UPD70008_TAG)->base(); if (!m_bank0) { @@ -373,7 +373,7 @@ WRITE8_MEMBER( px8_state::gah40m_w ) READ8_MEMBER( px8_state::gah40s_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (offset) { @@ -449,9 +449,9 @@ WRITE8_MEMBER( px8_state::gah40s_ier_w ) krtn_read - read keyboard return -------------------------------------------------*/ -UINT8 px8_state::krtn_read() +uint8_t px8_state::krtn_read() { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_ksc) { @@ -691,7 +691,7 @@ PALETTE_INIT_MEMBER(px8_state, px8) palette.set_pen_color(1, 0x31, 0x39, 0x10); } -UINT32 px8_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t px8_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/pyl601.cpp b/src/mame/drivers/pyl601.cpp index 806c131c624..138b6be9479 100644 --- a/src/mame/drivers/pyl601.cpp +++ b/src/mame/drivers/pyl601.cpp @@ -54,13 +54,13 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - UINT8 m_rom_page; - UINT32 m_vdisk_addr; - UINT8 m_key_code; - UINT8 m_keyboard_clk; - UINT8 m_video_mode; - UINT8 m_tick50_mark; - UINT8 m_floppy_ctrl; + uint8_t m_rom_page; + uint32_t m_vdisk_addr; + uint8_t m_key_code; + uint8_t m_keyboard_clk; + uint8_t m_video_mode; + uint8_t m_tick50_mark; + uint8_t m_floppy_ctrl; DECLARE_READ8_MEMBER(rom_page_r); DECLARE_WRITE8_MEMBER(rom_page_w); DECLARE_WRITE8_MEMBER(vdisk_page_w); @@ -79,7 +79,7 @@ public: DECLARE_READ8_MEMBER(floppy_r); MC6845_UPDATE_ROW(pyl601_update_row); MC6845_UPDATE_ROW(pyl601a_update_row); - UINT8 selectedline(UINT16 data); + uint8_t selectedline(uint16_t data); required_device m_speaker; required_device m_fdc; required_device m_ram; @@ -139,15 +139,15 @@ WRITE8_MEMBER(pyl601_state::vdisk_data_w) READ8_MEMBER(pyl601_state::vdisk_data_r) { - UINT8 retVal = m_ram->pointer()[0x10000 + (m_vdisk_addr & 0x7ffff)]; + uint8_t retVal = m_ram->pointer()[0x10000 + (m_vdisk_addr & 0x7ffff)]; m_vdisk_addr++; m_vdisk_addr &= 0x7ffff; return retVal; } -UINT8 pyl601_state::selectedline(UINT16 data) +uint8_t pyl601_state::selectedline(uint16_t data) { - UINT8 i; + uint8_t i; for(i = 0; i < 16; i++) if (BIT(data, i)) return i; @@ -157,22 +157,22 @@ UINT8 pyl601_state::selectedline(UINT16 data) READ8_MEMBER(pyl601_state::keyboard_r) { - UINT8 ret = m_key_code; + uint8_t ret = m_key_code; m_key_code = 0xff; return ret; } READ8_MEMBER(pyl601_state::keycheck_r) { - UINT8 retVal = 0x3f; - UINT8 *keyboard = memregion("keyboard")->base(); - UINT16 row1 = ioport("ROW1")->read(); - UINT16 row2 = ioport("ROW2")->read(); - UINT16 row3 = ioport("ROW3")->read(); - UINT16 row4 = ioport("ROW4")->read(); - UINT16 row5 = ioport("ROW5")->read(); - UINT16 all = row1 | row2 | row3 | row4 | row5; - UINT16 addr = ioport("MODIFIERS")->read(); + uint8_t retVal = 0x3f; + uint8_t *keyboard = memregion("keyboard")->base(); + uint16_t row1 = ioport("ROW1")->read(); + uint16_t row2 = ioport("ROW2")->read(); + uint16_t row3 = ioport("ROW3")->read(); + uint16_t row4 = ioport("ROW4")->read(); + uint16_t row5 = ioport("ROW5")->read(); + uint16_t all = row1 | row2 | row3 | row4 | row5; + uint16_t addr = ioport("MODIFIERS")->read(); if (all) { addr |= selectedline(all) << 2; @@ -205,7 +205,7 @@ READ8_MEMBER(pyl601_state::video_mode_r) READ8_MEMBER(pyl601_state::timer_r) { - UINT8 retVal= m_tick50_mark | 0x37; + uint8_t retVal= m_tick50_mark | 0x37; m_tick50_mark = 0; return retVal; } @@ -217,7 +217,7 @@ WRITE8_MEMBER(pyl601_state::speaker_w) WRITE8_MEMBER(pyl601_state::led_w) { -// UINT8 caps_led = BIT(data,4); +// uint8_t caps_led = BIT(data,4); } WRITE8_MEMBER(pyl601_state::floppy_w) @@ -369,7 +369,7 @@ INPUT_PORTS_END void pyl601_state::machine_reset() { - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); m_key_code = 0xff; membank("bank1")->set_base(ram + 0x0000); membank("bank2")->set_base(ram + 0xc000); @@ -388,15 +388,15 @@ void pyl601_state::video_start() MC6845_UPDATE_ROW( pyl601_state::pyl601_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *charrom = memregion("chargen")->base(); + uint8_t *charrom = memregion("chargen")->base(); int column, bit, i; - UINT8 data; + uint8_t data; if (BIT(m_video_mode, 5) == 0) { for (column = 0; column < x_count; column++) { - UINT8 code = m_ram->pointer()[(((ma + column) & 0x0fff) + 0xf000)]; + uint8_t code = m_ram->pointer()[(((ma + column) & 0x0fff) + 0xf000)]; code = ((code << 1) | (code >> 7)) & 0xff; if (column == cursor_x-2) data = 0xff; @@ -430,15 +430,15 @@ MC6845_UPDATE_ROW( pyl601_state::pyl601_update_row ) MC6845_UPDATE_ROW( pyl601_state::pyl601a_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *charrom = memregion("chargen")->base(); + uint8_t *charrom = memregion("chargen")->base(); int column, bit, i; - UINT8 data; + uint8_t data; if (BIT(m_video_mode, 5) == 0) { for (column = 0; column < x_count; column++) { - UINT8 code = m_ram->pointer()[(((ma + column) & 0x0fff) + 0xf000)]; + uint8_t code = m_ram->pointer()[(((ma + column) & 0x0fff) + 0xf000)]; data = charrom[((code << 4) | (ra & 0x07)) & 0xfff]; if (column == cursor_x) data = 0xff; diff --git a/src/mame/drivers/pyson.cpp b/src/mame/drivers/pyson.cpp index 97dddf6b07b..77b705974a8 100644 --- a/src/mame/drivers/pyson.cpp +++ b/src/mame/drivers/pyson.cpp @@ -163,7 +163,7 @@ public: m_maincpu(*this, "maincpu") { } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: @@ -179,7 +179,7 @@ void pyson_state::video_start() { } -UINT32 pyson_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t pyson_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/pzletime.cpp b/src/mame/drivers/pzletime.cpp index 660bc3cca78..74d4bf61664 100644 --- a/src/mame/drivers/pzletime.cpp +++ b/src/mame/drivers/pzletime.cpp @@ -40,12 +40,12 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_video_regs; - required_shared_ptr m_tilemap_regs; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_mid_videoram; - required_shared_ptr m_txt_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_video_regs; + required_shared_ptr m_tilemap_regs; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_mid_videoram; + required_shared_ptr m_txt_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_mid_tilemap; @@ -66,7 +66,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(pzletime); - UINT32 screen_update_pzletime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pzletime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_oki; required_device m_eeprom; @@ -104,7 +104,7 @@ void pzletime_state::video_start() m_txt_tilemap->set_transparent_pen(0); } -UINT32 pzletime_state::screen_update_pzletime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t pzletime_state::screen_update_pzletime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int count; int y, x; @@ -136,7 +136,7 @@ UINT32 pzletime_state::screen_update_pzletime(screen_device &screen, bitmap_ind1 m_mid_tilemap->draw(screen, bitmap, cliprect, 0, 0); { - UINT16 *spriteram = m_spriteram; + uint16_t *spriteram = m_spriteram; int offs, spr_offs, colour, sx, sy; for(offs = 0; offs < 0x2000 / 2; offs += 4) diff --git a/src/mame/drivers/qdrmfgp.cpp b/src/mame/drivers/qdrmfgp.cpp index a5f12085015..a13681e1c3c 100644 --- a/src/mame/drivers/qdrmfgp.cpp +++ b/src/mame/drivers/qdrmfgp.cpp @@ -137,7 +137,7 @@ WRITE16_MEMBER(qdrmfgp_state::gp2_control_w) READ16_MEMBER(qdrmfgp_state::v_rom_r) { - UINT8 *mem8 = memregion("gfx1")->base(); + uint8_t *mem8 = memregion("gfx1")->base(); int bank = m_k056832->word_r(space, 0x34/2, 0xffff); offset += bank * 0x800 * 4; diff --git a/src/mame/drivers/qix.cpp b/src/mame/drivers/qix.cpp index 9f4e60bdb96..4d2eb41b208 100644 --- a/src/mame/drivers/qix.cpp +++ b/src/mame/drivers/qix.cpp @@ -1167,7 +1167,7 @@ ROM_END *************************************/ // 99 means the value is unknown -static const UINT8 xor1_table[] = +static const uint8_t xor1_table[] = { 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, @@ -1235,7 +1235,7 @@ static const UINT8 xor1_table[] = 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, }; -static const UINT8 xor2_table[] = +static const uint8_t xor2_table[] = { 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, @@ -1315,7 +1315,7 @@ int qix_state::kram3_permut1(int idx, int value) } } -int qix_state::kram3_permut2(int tbl_index, int idx, const UINT8 *xor_table) +int qix_state::kram3_permut2(int tbl_index, int idx, const uint8_t *xor_table) { int xorval = 0; @@ -1364,8 +1364,8 @@ int qix_state::kram3_decrypt(int address, int value) DRIVER_INIT_MEMBER(qix_state,kram3) { - //const UINT8 *patch; - UINT8 *rom, *decrypted; + //const uint8_t *patch; + uint8_t *rom, *decrypted; int i; assert(m_bank0); @@ -1388,7 +1388,7 @@ DRIVER_INIT_MEMBER(qix_state,kram3) i = 0; //patch = memregion("user1")->base(); rom = memregion("maincpu")->base(); - decrypted = auto_alloc_array(machine(), UINT8, 0x6000); + decrypted = auto_alloc_array(machine(), uint8_t, 0x6000); memcpy(decrypted,&rom[0xa000],0x6000); for (i = 0xa000; i < 0x10000; ++i) @@ -1403,7 +1403,7 @@ DRIVER_INIT_MEMBER(qix_state,kram3) i = 0; //patch = memregion("user2")->base(); rom = memregion("videocpu")->base(); - decrypted = auto_alloc_array(machine(), UINT8, 0x6000); + decrypted = auto_alloc_array(machine(), uint8_t, 0x6000); memcpy(decrypted,&rom[0xa000],0x6000); for (i = 0xa000; i < 0x10000; ++i) diff --git a/src/mame/drivers/ql.cpp b/src/mame/drivers/ql.cpp index e359395d530..00a6e144564 100644 --- a/src/mame/drivers/ql.cpp +++ b/src/mame/drivers/ql.cpp @@ -181,7 +181,7 @@ public: int m_extintl; // IPC - UINT8 m_keylatch; + uint8_t m_keylatch; int m_ipl; int m_comdata_to_ipc; int m_baudx4; @@ -203,7 +203,7 @@ public: READ8_MEMBER( ql_state::read ) { - UINT8 data = 0; + uint8_t data = 0; int cart_romoeh = 0; int exp_romoeh = 0; @@ -369,7 +369,7 @@ READ8_MEMBER( ql_state::ipc_port2_r ) */ - UINT8 data = 0; + uint8_t data = 0; // SER2 serial data input data |= m_ser2->rxd_r(); @@ -462,7 +462,7 @@ READ8_MEMBER( ql_state::ipc_bus_r ) */ - UINT8 data = 0; + uint8_t data = 0; if (BIT(m_keylatch, 0)) data |= m_y[0]->read() | m_joy[0]->read(); if (BIT(m_keylatch, 1)) data |= m_y[1]->read() | m_joy[1]->read(); diff --git a/src/mame/drivers/qtsbc.cpp b/src/mame/drivers/qtsbc.cpp index aa14373aad9..124baacaa47 100644 --- a/src/mame/drivers/qtsbc.cpp +++ b/src/mame/drivers/qtsbc.cpp @@ -32,15 +32,15 @@ public: DECLARE_READ8_MEMBER( qtsbc_06_r ); DECLARE_READ8_MEMBER( qtsbc_43_r ); DECLARE_WRITE8_MEMBER( kbd_put ); - required_shared_ptr m_p_ram; - UINT8 m_term_data; + required_shared_ptr m_p_ram; + uint8_t m_term_data; virtual void machine_reset() override; }; READ8_MEMBER( qtsbc_state::qtsbc_06_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -69,7 +69,7 @@ INPUT_PORTS_END void qtsbc_state::machine_reset() { - UINT8* bios = memregion("maincpu")->base()+0x10000; + uint8_t* bios = memregion("maincpu")->base()+0x10000; memcpy(m_p_ram, bios, 0x800); } diff --git a/src/mame/drivers/quakeat.cpp b/src/mame/drivers/quakeat.cpp index 49c8ea6ab42..b8878f28b92 100644 --- a/src/mame/drivers/quakeat.cpp +++ b/src/mame/drivers/quakeat.cpp @@ -74,7 +74,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_quake(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_quake(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -82,7 +82,7 @@ void quakeat_state::video_start() { } -UINT32 quakeat_state::screen_update_quake(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t quakeat_state::screen_update_quake(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/quasar.cpp b/src/mame/drivers/quasar.cpp index 89a5aef0983..be86a5230c2 100644 --- a/src/mame/drivers/quasar.cpp +++ b/src/mame/drivers/quasar.cpp @@ -68,7 +68,7 @@ WRITE8_MEMBER(quasar_state::quasar_video_w) READ8_MEMBER(quasar_state::quasar_IO_r) { - UINT8 ans = 0; + uint8_t ans = 0; switch (m_io_page) { diff --git a/src/mame/drivers/queen.cpp b/src/mame/drivers/queen.cpp index 21b69043b7a..161ba40f197 100644 --- a/src/mame/drivers/queen.cpp +++ b/src/mame/drivers/queen.cpp @@ -43,10 +43,10 @@ public: { } - std::unique_ptr m_bios_ram; - std::unique_ptr m_bios_ext_ram; - UINT8 m_mtxc_config_reg[256]; - UINT8 m_piix4_config_reg[4][256]; + std::unique_ptr m_bios_ram; + std::unique_ptr m_bios_ext_ram; + uint8_t m_mtxc_config_reg[256]; + uint8_t m_piix4_config_reg[4][256]; DECLARE_WRITE32_MEMBER( bios_ext_ram_w ); @@ -59,7 +59,7 @@ public: // Intel 82439TX System Controller (MTXC) -static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) { queen_state *state = busdevice->machine().driver_data(); // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); @@ -67,7 +67,7 @@ static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, return state->m_mtxc_config_reg[reg]; } -static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { queen_state *state = busdevice->machine().driver_data(); printf("MTXC: write %d, %02X, %02X\n", function, reg, data); @@ -107,9 +107,9 @@ void queen_state::intel82439tx_init() m_mtxc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; @@ -129,7 +129,7 @@ static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -151,7 +151,7 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) -static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { if ((function >= 4) && (function <= 7)) { @@ -163,16 +163,16 @@ static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, return state->m_piix4_config_reg[function][reg]; } -static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { queen_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); state->m_piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= piix4_config_r(busdevice, device, function, reg + 3) << 24; @@ -192,7 +192,7 @@ static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -256,8 +256,8 @@ ADDRESS_MAP_END void queen_state::machine_start() { - m_bios_ram = std::make_unique(0x10000/4); - m_bios_ext_ram = std::make_unique(0x10000/4); + m_bios_ram = std::make_unique(0x10000/4); + m_bios_ext_ram = std::make_unique(0x10000/4); intel82439tx_init(); } diff --git a/src/mame/drivers/quizo.cpp b/src/mame/drivers/quizo.cpp index 6279c372cc2..bbac089f157 100644 --- a/src/mame/drivers/quizo.cpp +++ b/src/mame/drivers/quizo.cpp @@ -39,9 +39,9 @@ public: required_device m_maincpu; - std::unique_ptr m_videoram; - UINT8 m_port60; - UINT8 m_port70; + std::unique_ptr m_videoram; + uint8_t m_port60; + uint8_t m_port70; DECLARE_WRITE8_MEMBER(vram_w); DECLARE_WRITE8_MEMBER(port70_w); @@ -50,7 +50,7 @@ public: DECLARE_DRIVER_INIT(quizo); DECLARE_PALETTE_INIT(quizo); - 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); }; @@ -58,11 +58,11 @@ public: #define XTAL2 21477270 -static const UINT8 rombankLookup[]={ 2, 3, 4, 4, 4, 4, 4, 5, 0, 1}; +static const uint8_t rombankLookup[]={ 2, 3, 4, 4, 4, 4, 4, 5, 0, 1}; PALETTE_INIT_MEMBER(quizo_state, quizo) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0;i < 16;i++) { @@ -88,7 +88,7 @@ PALETTE_INIT_MEMBER(quizo_state, quizo) } } -UINT32 quizo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t quizo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; for(y=0;y<200;y++) @@ -268,7 +268,7 @@ ROM_END DRIVER_INIT_MEMBER(quizo_state,quizo) { - m_videoram=std::make_unique(0x4000*2); + m_videoram=std::make_unique(0x4000*2); membank("bank1")->configure_entries(0, 6, memregion("user1")->base(), 0x4000); save_pointer(NAME(m_videoram.get()), 0x4000*2); diff --git a/src/mame/drivers/quizpun2.cpp b/src/mame/drivers/quizpun2.cpp index b6070f902ef..8d1f8b0aa94 100644 --- a/src/mame/drivers/quizpun2.cpp +++ b/src/mame/drivers/quizpun2.cpp @@ -105,8 +105,8 @@ public: m_soundlatch(*this, "soundlatch") { } struct prot_t m_prot; - required_shared_ptr m_fg_ram; - required_shared_ptr m_bg_ram; + required_shared_ptr m_fg_ram; + required_shared_ptr m_bg_ram; tilemap_t *m_bg_tmap; tilemap_t *m_fg_tmap; DECLARE_WRITE8_MEMBER(bg_ram_w); @@ -120,7 +120,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_quizpun2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_quizpun2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_audiocpu; required_device m_gfxdecode; @@ -137,14 +137,14 @@ public: TILE_GET_INFO_MEMBER(quizpun2_state::get_bg_tile_info) { - UINT16 code = m_bg_ram[ tile_index * 2 ] + m_bg_ram[ tile_index * 2 + 1 ] * 256; + uint16_t code = m_bg_ram[ tile_index * 2 ] + m_bg_ram[ tile_index * 2 + 1 ] * 256; SET_TILE_INFO_MEMBER(0, code, 0, 0); } TILE_GET_INFO_MEMBER(quizpun2_state::get_fg_tile_info) { - UINT16 code = m_fg_ram[ tile_index * 4 ] + m_fg_ram[ tile_index * 4 + 1 ] * 256; - UINT8 color = m_fg_ram[ tile_index * 4 + 2 ]; + uint16_t code = m_fg_ram[ tile_index * 4 ] + m_fg_ram[ tile_index * 4 + 1 ] * 256; + uint8_t color = m_fg_ram[ tile_index * 4 + 2 ]; SET_TILE_INFO_MEMBER(1, code, color & 0x0f, 0); } @@ -169,7 +169,7 @@ void quizpun2_state::video_start() m_fg_tmap->set_transparent_pen(0); } -UINT32 quizpun2_state::screen_update_quizpun2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t quizpun2_state::screen_update_quizpun2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; @@ -229,7 +229,7 @@ static void log_protection( address_space &space, const char *warning ) READ8_MEMBER(quizpun2_state::quizpun2_protection_r) { struct prot_t &prot = m_prot; - UINT8 ret; + uint8_t ret; switch ( prot.state ) { @@ -262,7 +262,7 @@ READ8_MEMBER(quizpun2_state::quizpun2_protection_r) case STATE_EEPROM_R: // EEPROM read { - UINT8 *eeprom = memregion("eeprom")->base(); + uint8_t *eeprom = memregion("eeprom")->base(); ret = eeprom[prot.addr]; break; } @@ -289,7 +289,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_protection_w) { case STATE_EEPROM_W: { - UINT8 *eeprom = memregion("eeprom")->base(); + uint8_t *eeprom = memregion("eeprom")->base(); eeprom[prot.addr] = data; prot.addr++; if ((prot.addr % 8) == 0) @@ -356,7 +356,7 @@ WRITE8_MEMBER(quizpun2_state::quizpun2_protection_w) WRITE8_MEMBER(quizpun2_state::quizpun2_rombank_w) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->set_base(&ROM[ 0x10000 + 0x2000 * (data & 0x1f) ] ); } diff --git a/src/mame/drivers/quizshow.cpp b/src/mame/drivers/quizshow.cpp index e58593491b8..72e72ce175c 100644 --- a/src/mame/drivers/quizshow.cpp +++ b/src/mame/drivers/quizshow.cpp @@ -47,12 +47,12 @@ public: required_device m_maincpu; required_device m_dac; - required_shared_ptr m_main_ram; + required_shared_ptr m_main_ram; required_device m_gfxdecode; required_device m_screen; tilemap_t *m_tilemap; - UINT32 m_clocks; + uint32_t m_clocks; int m_blink_state; int m_category_enable; int m_tape_head_pos; @@ -73,7 +73,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(quizshow); - UINT32 screen_update_quizshow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_quizshow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(quizshow_clock_timer_cb); }; @@ -103,10 +103,10 @@ PALETTE_INIT_MEMBER(quizshow_state, quizshow) TILE_GET_INFO_MEMBER(quizshow_state::get_tile_info) { - UINT8 code = m_main_ram[tile_index]; + uint8_t code = m_main_ram[tile_index]; // d6: blink, d7: invert - UINT8 color = (code & (m_blink_state | 0x80)) >> 6; + uint8_t color = (code & (m_blink_state | 0x80)) >> 6; SET_TILE_INFO_MEMBER(0, code & 0x3f, color, 0); } @@ -116,7 +116,7 @@ void quizshow_state::video_start() m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(quizshow_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 16, 32, 16); } -UINT32 quizshow_state::screen_update_quizshow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t quizshow_state::screen_update_quizshow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); return 0; @@ -186,7 +186,7 @@ WRITE8_MEMBER(quizshow_state::quizshow_video_disable_w) READ8_MEMBER(quizshow_state::quizshow_timing_r) { - UINT8 ret = 0x80; + uint8_t ret = 0x80; // d0-d3: 1R-8R (16-line counter) ret |= m_clocks >> 1 & 0xf; @@ -433,8 +433,8 @@ ROM_END DRIVER_INIT_MEMBER(quizshow_state,quizshow) { - UINT8 *gfxdata = memregion("user1")->base(); - UINT8 *dest = memregion("gfx1")->base(); + uint8_t *gfxdata = memregion("user1")->base(); + uint8_t *dest = memregion("gfx1")->base(); int tile, line; diff --git a/src/mame/drivers/qx10.cpp b/src/mame/drivers/qx10.cpp index 19851555a03..775889cefe8 100644 --- a/src/mame/drivers/qx10.cpp +++ b/src/mame/drivers/qx10.cpp @@ -89,11 +89,11 @@ public: required_device m_hgdc; required_device m_rtc; required_device m_kbd; - UINT8 m_vram_bank; - //required_shared_ptr m_video_ram; - std::unique_ptr m_video_ram; + uint8_t m_vram_bank; + //required_shared_ptr m_video_ram; + std::unique_ptr m_video_ram; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void machine_start() override; virtual void machine_reset() override; @@ -125,7 +125,7 @@ public: DECLARE_WRITE_LINE_MEMBER(keyboard_clk); DECLARE_WRITE_LINE_MEMBER(keyboard_irq); - UINT8 *m_char_rom; + uint8_t *m_char_rom; /* FDD */ int m_fdcint; @@ -136,12 +136,12 @@ public: int m_membank; int m_memprom; int m_memcmos; - UINT8 m_cmosram[0x800]; + uint8_t m_cmosram[0x800]; - UINT8 m_color_mode; + uint8_t m_color_mode; struct{ - UINT8 rx; + uint8_t rx; }m_rs232c; DECLARE_PALETTE_INIT(qx10); @@ -157,7 +157,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( qx10_state::hgdc_display_pixels ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); int xi,gfx[3]; - UINT8 pen; + uint8_t pen; if(m_color_mode) { @@ -189,9 +189,9 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( qx10_state::hgdc_draw_text ) int xi,yi; int tile; int attr; - UINT8 color; - UINT8 tile_data; - UINT8 pen; + uint8_t color; + uint8_t tile_data; + uint8_t pen; for( x = 0; x < pitch; x++ ) { @@ -235,7 +235,7 @@ UPD7220_DRAW_TEXT_LINE_MEMBER( qx10_state::hgdc_draw_text ) } } -UINT32 qx10_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t qx10_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -518,7 +518,7 @@ ADDRESS_MAP_END { if(newval && !oldval) { - m_keyb.rx = (UINT8)(uintptr_t)(param) & 0x7f; + m_keyb.rx = (uint8_t)(uintptr_t)(param) & 0x7f; m_pic_m->ir4_w(1); } @@ -619,7 +619,7 @@ GFXDECODE_END void qx10_state::video_start() { // allocate memory - m_video_ram = make_unique_clear(0x30000); + m_video_ram = make_unique_clear(0x30000); // find memory regions m_char_rom = memregion("chargen")->base(); diff --git a/src/mame/drivers/r2dtank.cpp b/src/mame/drivers/r2dtank.cpp index 146f416a294..d789df975f3 100644 --- a/src/mame/drivers/r2dtank.cpp +++ b/src/mame/drivers/r2dtank.cpp @@ -63,11 +63,11 @@ public: m_soundlatch(*this, "soundlatch"), m_soundlatch2(*this, "soundlatch2") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - UINT8 m_flipscreen; - UINT32 m_ttl74123_output; - UINT8 m_AY8910_selected; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + uint8_t m_flipscreen; + uint32_t m_ttl74123_output; + uint8_t m_AY8910_selected; DECLARE_READ8_MEMBER(audio_command_r); DECLARE_WRITE8_MEMBER(audio_command_w); @@ -131,7 +131,7 @@ WRITE_LINE_MEMBER(r2dtank_state::main_cpu_irq) READ8_MEMBER(r2dtank_state::audio_command_r) { - UINT8 ret = m_soundlatch->read(space, 0); + uint8_t ret = m_soundlatch->read(space, 0); if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Command Read: %x\n", space.device().safe_pc(), ret); @@ -150,7 +150,7 @@ if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", space.de READ8_MEMBER(r2dtank_state::audio_answer_r) { - UINT8 ret = m_soundlatch2->read(space, 0); + uint8_t ret = m_soundlatch2->read(space, 0); if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Answer Read: %x\n", space.device().safe_pc(), ret); return ret; @@ -187,7 +187,7 @@ if (LOG_AUDIO_COMM) logerror("%s: CPU#1 AY8910_select_w: %x\n", machine().desc READ8_MEMBER(r2dtank_state::AY8910_port_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (m_AY8910_selected & 0x08) ret = machine().device("ay1")->data_r(space, 0); @@ -265,11 +265,11 @@ WRITE_LINE_MEMBER(r2dtank_state::flipscreen_w) MC6845_UPDATE_ROW( r2dtank_state::crtc_update_row ) { - UINT8 x = 0; + uint8_t x = 0; - for (UINT8 cx = 0; cx < x_count; cx++) + for (uint8_t cx = 0; cx < x_count; cx++) { - UINT8 data, fore_color; + uint8_t data, fore_color; /* the memory is hooked up to the MA, RA lines this way */ offs_t offs = ((ma << 3) & 0x1f00) | @@ -284,7 +284,7 @@ MC6845_UPDATE_ROW( r2dtank_state::crtc_update_row ) for (int i = 0; i < 8; i++) { - UINT8 bit, color; + uint8_t bit, color; if (m_flipscreen) { diff --git a/src/mame/drivers/r2dx_v33.cpp b/src/mame/drivers/r2dx_v33.cpp index 934a024d0d7..8fabce316aa 100644 --- a/src/mame/drivers/r2dx_v33.cpp +++ b/src/mame/drivers/r2dx_v33.cpp @@ -83,7 +83,7 @@ public: { } optional_device m_eeprom; - required_region_ptr m_math; + required_region_ptr m_math; DECLARE_WRITE16_MEMBER(r2dx_angle_w); DECLARE_WRITE16_MEMBER(r2dx_dx_w); @@ -122,10 +122,10 @@ public: int m_r2dxbank; int m_r2dxgameselect; - INT16 m_r2dx_angle; + int16_t m_r2dx_angle; - UINT16 r2dx_i_dx, r2dx_i_dy, r2dx_i_angle; - UINT32 r2dx_i_sdist; + uint16_t r2dx_i_dx, r2dx_i_dy, r2dx_i_angle; + uint32_t r2dx_i_sdist; INTERRUPT_GEN_MEMBER(rdx_v33_interrupt); @@ -208,7 +208,7 @@ WRITE16_MEMBER(r2dx_v33_state::rdx_v33_eeprom_w) /* new zero team uses the copd3 protection... and uploads a 0x400 byte table, probably the mcu code, encrypted */ -static UINT16 mcu_prog[0x800]; +static uint16_t mcu_prog[0x800]; static int mcu_prog_offs = 0; WRITE16_MEMBER(r2dx_v33_state::mcu_prog_w) @@ -248,7 +248,7 @@ READ16_MEMBER(r2dx_v33_state::rdx_v33_unknown_r) } -static UINT16 mcu_xval,mcu_yval; +static uint16_t mcu_xval,mcu_yval; /* something sent to the MCU for X/Y global screen calculating ... */ WRITE16_MEMBER(r2dx_v33_state::mcu_xval_w) @@ -263,7 +263,7 @@ WRITE16_MEMBER(r2dx_v33_state::mcu_yval_w) //popmessage("%04x %04x",mcu_xval,mcu_yval); } -static UINT16 mcu_data[9]; +static uint16_t mcu_data[9]; /* 0x400-0x407 seems some DMA hook-up, 0x420-0x427 looks like some x/y sprite calculation routine */ WRITE16_MEMBER(r2dx_v33_state::mcu_table_w) @@ -329,12 +329,12 @@ READ16_MEMBER(r2dx_v33_state::r2dx_cos_r) WRITE16_MEMBER(r2dx_v33_state::r2dx_sdistl_w) { - r2dx_i_sdist = (r2dx_i_sdist & (0xffff0000 | UINT16(~mem_mask))) | (data & mem_mask); + r2dx_i_sdist = (r2dx_i_sdist & (0xffff0000 | uint16_t(~mem_mask))) | (data & mem_mask); } WRITE16_MEMBER(r2dx_v33_state::r2dx_sdisth_w) { - r2dx_i_sdist = (r2dx_i_sdist & (0x0000ffff | (UINT16(~mem_mask)) << 16)) | ((data & mem_mask) << 16); + r2dx_i_sdist = (r2dx_i_sdist & (0x0000ffff | (uint16_t(~mem_mask)) << 16)) | ((data & mem_mask) << 16); } // these DMA operations seem to use hardcoded addresses on this hardware @@ -344,7 +344,7 @@ WRITE16_MEMBER(r2dx_v33_state::r2dx_tilemapdma_w) for (int i = 0; i < 0x2800 / 2; i++) { - UINT16 tileval = space.read_word(src); + uint16_t tileval = space.read_word(src); src += 2; m_videoram_private_w(space, i, tileval, 0xffff); } @@ -356,7 +356,7 @@ WRITE16_MEMBER(r2dx_v33_state::r2dx_paldma_w) for (int i = 0; i < 0x1000 / 2; i++) { - UINT16 palval = space.read_word(src); + uint16_t palval = space.read_word(src); src += 2; m_palette->set_pen_color(i, pal5bit(palval >> 0), pal5bit(palval >> 5), pal5bit(palval >> 10)); } @@ -881,10 +881,10 @@ DRIVER_INIT_MEMBER(r2dx_v33_state,zerotm2k) // no sprite encryption(!) // BG tile rom has 2 lines swapped - UINT8 *src = memregion("gfx2")->base()+0x100000; + uint8_t *src = memregion("gfx2")->base()+0x100000; int len = 0x080000; - std::vector buffer(len); + std::vector buffer(len); int i; for (i = 0; i < len; i ++) buffer[i] = src[BITSWAP32(i,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,5,6,4,3,2,1,0)]; diff --git a/src/mame/drivers/r9751.cpp b/src/mame/drivers/r9751.cpp index dbb2efa2bb6..1133dc90ca5 100644 --- a/src/mame/drivers/r9751.cpp +++ b/src/mame/drivers/r9751.cpp @@ -100,50 +100,50 @@ private: required_device m_pdc; required_device m_wd33c93; required_device m_terminal; - required_shared_ptr m_main_ram; + required_shared_ptr m_main_ram; m68000_base_device* ptr_m68000; // Begin registers - UINT32 reg_ff050004; - UINT32 reg_fff80040; - UINT32 fdd_dest_address; // 5FF080B0 - UINT32 fdd_cmd_complete; - UINT32 smioc_out_addr; - UINT32 smioc_dma_bank; - UINT32 fdd_dma_bank; + uint32_t reg_ff050004; + uint32_t reg_fff80040; + uint32_t fdd_dest_address; // 5FF080B0 + uint32_t fdd_cmd_complete; + uint32_t smioc_out_addr; + uint32_t smioc_dma_bank; + uint32_t fdd_dma_bank; attotime timer_32khz_last; // End registers address_space *m_mem; // functions - UINT32 swap_uint32( UINT32 val ); - UINT32 debug_a6(); - UINT32 debug_a5(); - UINT32 debug_a5_20(); + uint32_t swap_uint32( uint32_t val ); + uint32_t debug_a6(); + uint32_t debug_a5(); + uint32_t debug_a5_20(); virtual void machine_reset() override; }; -UINT32 r9751_state::swap_uint32( UINT32 val ) +uint32_t r9751_state::swap_uint32( uint32_t val ) { val = ((val << 8) & 0xFF00FF00 ) | ((val >> 8) & 0xFF00FF ); return (val << 16) | (val >> 16); } -UINT32 r9751_state::debug_a6() +uint32_t r9751_state::debug_a6() { return m_maincpu->space(AS_PROGRAM).read_dword(ptr_m68000->dar[14] + 4); } -UINT32 r9751_state::debug_a5() +uint32_t r9751_state::debug_a5() { return m_maincpu->space(AS_PROGRAM).read_dword(ptr_m68000->dar[13]); } -UINT32 r9751_state::debug_a5_20() +uint32_t r9751_state::debug_a5_20() { return m_maincpu->space(AS_PROGRAM).read_dword(ptr_m68000->dar[13] + 0x20); } @@ -151,7 +151,7 @@ UINT32 r9751_state::debug_a5_20() READ8_MEMBER(r9751_state::pdc_dma_r) { /* This callback function takes the value written to 0xFF01000C as the bank offset */ - UINT32 address = (fdd_dma_bank & 0x7FFFF800) + (offset&0x3FFFF); + uint32_t address = (fdd_dma_bank & 0x7FFFF800) + (offset&0x3FFFF); if(TRACE_DMA) logerror("DMA READ: %08X DATA: %08X\n", address, m_maincpu->space(AS_PROGRAM).read_byte(address)); return m_maincpu->space(AS_PROGRAM).read_byte(address); } @@ -159,7 +159,7 @@ READ8_MEMBER(r9751_state::pdc_dma_r) WRITE8_MEMBER(r9751_state::pdc_dma_w) { /* This callback function takes the value written to 0xFF01000C as the bank offset */ - UINT32 address = (fdd_dma_bank & 0x7FFFF800) + (m_pdc->fdd_68k_dma_address&0x3FFFF); + uint32_t address = (fdd_dma_bank & 0x7FFFF800) + (m_pdc->fdd_68k_dma_address&0x3FFFF); m_maincpu->space(AS_PROGRAM).write_byte(address,data); if(TRACE_DMA) logerror("DMA WRITE: %08X DATA: %08X\n", address,data); } @@ -191,8 +191,8 @@ DRIVER_INIT_MEMBER(r9751_state,r9751) void r9751_state::machine_reset() { - UINT8 *rom = memregion("prom")->base(); - UINT32 *ram = m_main_ram; + uint8_t *rom = memregion("prom")->base(); + uint32_t *ram = m_main_ram; memcpy(ram, rom, 8); @@ -205,7 +205,7 @@ void r9751_state::machine_reset() ******************************************************************************/ READ32_MEMBER( r9751_state::r9751_mmio_5ff_r ) { - UINT32 data; + uint32_t data; switch(offset << 2) { @@ -237,7 +237,7 @@ READ32_MEMBER( r9751_state::r9751_mmio_5ff_r ) WRITE32_MEMBER( r9751_state::r9751_mmio_5ff_w ) { - UINT8 data_b0, data_b1; + uint8_t data_b0, data_b1; /* Unknown mask */ if (mem_mask != 0xFFFFFFFF) logerror("Mask found: %08X Register: %08X PC: %08X\n", mem_mask, offset << 2 | 0x5FF00000, space.machine().firstcpu->pc()); @@ -311,8 +311,8 @@ WRITE32_MEMBER( r9751_state::r9751_mmio_5ff_w ) if(TRACE_FDC)logerror("--- FDD SET PDC Port 38: %X\n",m_pdc->reg_p38); break; case 0x80B0: /* FDD command address register */ - UINT32 fdd_scsi_command; - UINT32 fdd_scsi_command2; + uint32_t fdd_scsi_command; + uint32_t fdd_scsi_command2; unsigned char c_fdd_scsi_command[8]; // Array for SCSI command int scsi_lba; // FDD LBA location here, extracted from command @@ -356,7 +356,7 @@ WRITE32_MEMBER( r9751_state::r9751_mmio_5ff_w ) ******************************************************************************/ READ32_MEMBER( r9751_state::r9751_mmio_ff01_r ) { - //UINT32 data; + //uint32_t data; switch(offset << 2) { @@ -390,7 +390,7 @@ WRITE32_MEMBER( r9751_state::r9751_mmio_ff01_w ) READ32_MEMBER( r9751_state::r9751_mmio_ff05_r ) { - UINT32 data; + uint32_t data; switch(offset << 2) { @@ -438,7 +438,7 @@ WRITE32_MEMBER( r9751_state::r9751_mmio_ff05_w ) READ32_MEMBER( r9751_state::r9751_mmio_fff8_r ) { - UINT32 data; + uint32_t data; switch(offset << 2) { diff --git a/src/mame/drivers/rabbit.cpp b/src/mame/drivers/rabbit.cpp index 35e34d7340a..2e88263458f 100644 --- a/src/mame/drivers/rabbit.cpp +++ b/src/mame/drivers/rabbit.cpp @@ -116,22 +116,22 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_viewregs0; - required_shared_ptr m_viewregs6; - required_shared_ptr m_viewregs7; - required_shared_ptr m_viewregs9; - required_shared_ptr m_viewregs10; - required_shared_ptr_array m_tilemap_regs; - required_shared_ptr m_spriteregs; - required_shared_ptr m_blitterregs; - required_shared_ptr m_spriteram; + required_shared_ptr m_viewregs0; + required_shared_ptr m_viewregs6; + required_shared_ptr m_viewregs7; + required_shared_ptr m_viewregs9; + required_shared_ptr m_viewregs10; + required_shared_ptr_array m_tilemap_regs; + required_shared_ptr m_spriteregs; + required_shared_ptr m_blitterregs; + required_shared_ptr m_spriteram; std::unique_ptr m_sprite_bitmap; rectangle m_sprite_clip; int m_vblirqlevel; int m_bltirqlevel; int m_banking; - std::unique_ptr m_tilemap_ram[4]; + std::unique_ptr m_tilemap_ram[4]; tilemap_t *m_tilemap[4]; DECLARE_WRITE32_MEMBER(tilemap0_w); @@ -158,7 +158,7 @@ public: virtual void video_start() override; - 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); inline void get_tilemap_info(tile_data &tileinfo, int tile_index, int whichtilemap, int tilesize); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); void clearspritebitmap( bitmap_ind16 &bitmap, const rectangle &cliprect ); @@ -302,8 +302,8 @@ void rabbit_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect gfx_element *gfx = m_gfxdecode->gfx(1); int todraw = (m_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half? - UINT32 *source = (m_spriteram+ (todraw*2))-2; - UINT32 *finish = m_spriteram; + uint32_t *source = (m_spriteram+ (todraw*2))-2; + uint32_t *finish = m_spriteram; // m_sprite_bitmap->fill(0x0, m_sprite_clip); // sloooow @@ -336,7 +336,7 @@ void rabbit_state::clearspritebitmap( bitmap_ind16 &bitmap, const rectangle &cli int startx, starty; int y; int amountx,amounty; - UINT16 *dstline; + uint16_t *dstline; /* clears a *sensible* amount of the sprite bitmap */ startx = (m_spriteregs[0]&0x00000fff); @@ -360,13 +360,13 @@ void rabbit_state::clearspritebitmap( bitmap_ind16 &bitmap, const rectangle &cli /* todo: fix zoom, its inaccurate and this code is ugly */ void rabbit_state::draw_sprite_bitmap( bitmap_ind16 &bitmap, const rectangle &cliprect ) { - UINT32 x,y; - UINT16 *srcline; - UINT16 *dstline; - UINT16 pixdata; - UINT32 xsize, ysize; - UINT32 xdrawpos, ydrawpos; - UINT32 xstep,ystep; + uint32_t x,y; + uint16_t *srcline; + uint16_t *dstline; + uint16_t pixdata; + uint32_t xsize, ysize; + uint32_t xdrawpos, ydrawpos; + uint32_t xstep,ystep; int startx, starty; startx = ((m_spriteregs[0]&0x00000fff)); @@ -414,10 +414,10 @@ void rabbit_state::video_start() { /* the tilemaps are bigger than the regions the cpu can see, need to allocate the ram here */ /* or maybe not for this game/hw .... */ - m_tilemap_ram[0] = make_unique_clear(0x20000/4); - m_tilemap_ram[1] = make_unique_clear(0x20000/4); - m_tilemap_ram[2] = make_unique_clear(0x20000/4); - m_tilemap_ram[3] = make_unique_clear(0x20000/4); + m_tilemap_ram[0] = make_unique_clear(0x20000/4); + m_tilemap_ram[1] = make_unique_clear(0x20000/4); + m_tilemap_ram[2] = make_unique_clear(0x20000/4); + m_tilemap_ram[3] = make_unique_clear(0x20000/4); m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(rabbit_state::get_tilemap0_tile_info),this),TILEMAP_SCAN_ROWS,16, 16, 128,32); m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(rabbit_state::get_tilemap1_tile_info),this),TILEMAP_SCAN_ROWS,16, 16, 128,32); @@ -467,7 +467,7 @@ each line represents the differences on each tilemap for unknown variables void rabbit_state::drawtilemap( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int whichtilemap ) { - INT32 startx, starty, incxx, incxy, incyx, incyy, tran; + int32_t startx, starty, incxx, incxy, incyx, incyy, tran; startx=((m_tilemap_regs[whichtilemap][1]&0x0000ffff)); // >>4 for nonzoomed pixel scroll value starty=((m_tilemap_regs[whichtilemap][1]&0xffff0000)>>16); // >> 20 for nonzoomed pixel scroll value @@ -488,7 +488,7 @@ void rabbit_state::drawtilemap( screen_device &screen, bitmap_ind16 &bitmap, con tran ? 0 : TILEMAP_DRAW_OPAQUE,0); } -UINT32 rabbit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rabbit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int prilevel; @@ -556,7 +556,7 @@ READ32_MEMBER(rabbit_state::randomrabbits) /* rom bank is used when testing roms, not currently hooked up */ WRITE32_MEMBER(rabbit_state::rombank_w) { - UINT8 *dataroms = memregion("gfx1")->base(); + uint8_t *dataroms = memregion("gfx1")->base(); #if 0 int bank; printf("rabbit rombank %08x\n",data); @@ -587,7 +587,7 @@ void rabbit_state::device_timer(emu_timer &timer, device_timer_id id, int param, void rabbit_state::do_blit() { - UINT8 *blt_data = memregion("gfx1")->base(); + uint8_t *blt_data = memregion("gfx1")->base(); int blt_source = (m_blitterregs[0]&0x000fffff)>>0; int blt_column = (m_blitterregs[1]&0x00ff0000)>>16; int blt_line = (m_blitterregs[1]&0x000000ff); diff --git a/src/mame/drivers/raiden.cpp b/src/mame/drivers/raiden.cpp index bb8e00dcaa9..b98ac455aae 100644 --- a/src/mame/drivers/raiden.cpp +++ b/src/mame/drivers/raiden.cpp @@ -591,24 +591,24 @@ encryption method! The technique is a combination of a XOR table plus bit-swapping */ void raiden_state::common_decrypt() { - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); int i; for (i = 0; i < 0x20000; i++) { - static const UINT16 xor_table[] = { 0x200e,0x0006,0x000a,0x0002,0x240e,0x000e,0x04c2,0x00c2,0x008c,0x0004,0x0088,0x0000,0x048c,0x000c,0x04c0,0x00c0 }; - UINT16 data = RAM[0xc0000/2 + i]; + static const uint16_t xor_table[] = { 0x200e,0x0006,0x000a,0x0002,0x240e,0x000e,0x04c2,0x00c2,0x008c,0x0004,0x0088,0x0000,0x048c,0x000c,0x04c0,0x00c0 }; + uint16_t data = RAM[0xc0000/2 + i]; data ^= xor_table[i & 0x0f]; data = BITSWAP16(data, 15,14,10,12,11,13,9,8,3,2,5,4,7,1,6,0); RAM[0xc0000/2 + i] = data; } - RAM = (UINT16 *)memregion("sub")->base(); + RAM = (uint16_t *)memregion("sub")->base(); for (i = 0; i < 0x20000; i++) { - static const UINT16 xor_table[] = { 0x0080,0x0080,0x0244,0x0288,0x0288,0x0288,0x1041,0x1009 }; - UINT16 data = RAM[0xc0000/2 + i]; + static const uint16_t xor_table[] = { 0x0080,0x0080,0x0244,0x0288,0x0288,0x0288,0x1041,0x1009 }; + uint16_t data = RAM[0xc0000/2 + i]; data ^= xor_table[i & 0x07]; data = BITSWAP16(data, 15,14,13,9,11,10,12,8,2,0,5,4,7,3,1,6); RAM[0xc0000/2 + i] = data; diff --git a/src/mame/drivers/raiden2.cpp b/src/mame/drivers/raiden2.cpp index c31098312fd..d17e3143b7c 100644 --- a/src/mame/drivers/raiden2.cpp +++ b/src/mame/drivers/raiden2.cpp @@ -201,12 +201,12 @@ void raiden2_state::machine_start() } /* -UINT16 raiden2_state::rps() +uint16_t raiden2_state::rps() { return m_maincpu->state_int(NEC_CS); } -UINT16 raiden2_state::rpc() +uint16_t raiden2_state::rpc() { return m_maincpu->state_int(NEC_IP); } @@ -245,9 +245,9 @@ WRITE16_MEMBER(raiden2_state::m_videoram_private_w) -void raiden2_state::combine32(UINT32 *val, int offset, UINT16 data, UINT16 mem_mask) +void raiden2_state::combine32(uint32_t *val, int offset, uint16_t data, uint16_t mem_mask) { - UINT16 *dest = (UINT16 *)val + BYTE_XOR_LE(offset); + uint16_t *dest = (uint16_t *)val + BYTE_XOR_LE(offset); COMBINE_DATA(dest); } @@ -257,7 +257,7 @@ void raiden2_state::combine32(UINT32 *val, int offset, UINT16 data, UINT16 mem_m void raiden2_state::draw_sprites(const rectangle &cliprect) { - UINT16 *source = sprites + (0x1000/2)-4; + uint16_t *source = sprites + (0x1000/2)-4; sprite_buffer.fill(0xf, cliprect); gfx_element *gfx = m_gfxdecode->gfx(2); @@ -515,10 +515,10 @@ TILE_GET_INFO_MEMBER(raiden2_state::get_text_tile_info) VIDEO_START_MEMBER(raiden2_state,raiden2) { - back_data = make_unique_clear(0x800/2); - fore_data = make_unique_clear(0x800/2); - mid_data = make_unique_clear(0x800/2); - text_data = make_unique_clear(0x1000/2); + back_data = make_unique_clear(0x800/2); + fore_data = make_unique_clear(0x800/2); + mid_data = make_unique_clear(0x800/2); + text_data = make_unique_clear(0x1000/2); save_pointer(NAME(back_data.get()), 0x800/2); save_pointer(NAME(fore_data.get()), 0x800/2); @@ -541,10 +541,10 @@ void raiden2_state::blend_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, const pen_t *pens = &m_palette->pen(0); layer <<= 14; for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - const UINT16 *src = &source.pix16(y, cliprect.min_x); - UINT32 *dst = &bitmap.pix32(y, cliprect.min_x); + const uint16_t *src = &source.pix16(y, cliprect.min_x); + uint32_t *dst = &bitmap.pix32(y, cliprect.min_x); for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { - UINT16 val = *src++; + uint16_t val = *src++; if((val & 0xc000) == layer && (val & 0x000f) != 0x000f) { val &= 0x07ff; @@ -564,7 +564,7 @@ void raiden2_state::tilemap_draw_and_blend(screen_device &screen, bitmap_rgb32 & blend_layer(bitmap, cliprect, tile_buffer, 0); } -UINT32 raiden2_state::screen_update_raiden2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t raiden2_state::screen_update_raiden2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); if (!(raiden2_tilemap_enable & 16)) { @@ -622,11 +622,11 @@ INTERRUPT_GEN_MEMBER(raiden2_state::raiden2_interrupt) // Sprite encryption key upload -static UINT32 sprcpt_adr, sprcpt_idx; +static uint32_t sprcpt_adr, sprcpt_idx; -static UINT16 sprcpt_flags2; -static UINT32 sprcpt_val[2], sprcpt_flags1; -static UINT32 sprcpt_data_1[0x100], sprcpt_data_2[0x40], sprcpt_data_3[6], sprcpt_data_4[4]; +static uint16_t sprcpt_flags2; +static uint32_t sprcpt_val[2], sprcpt_flags1; +static uint32_t sprcpt_data_1[0x100], sprcpt_data_2[0x40], sprcpt_data_3[6], sprcpt_data_4[4]; void raiden2_state::sprcpt_init(void) { @@ -830,18 +830,18 @@ READ16_MEMBER(raiden2_state::sprite_prot_src_seg_r) WRITE16_MEMBER(raiden2_state::sprite_prot_src_w) { sprite_prot_src_addr[1] = data; - UINT32 src = (sprite_prot_src_addr[0]<<4)+sprite_prot_src_addr[1]; + uint32_t src = (sprite_prot_src_addr[0]<<4)+sprite_prot_src_addr[1]; - int x = INT16((space.read_dword(src+0x08) >> 16) - (sprite_prot_x)); - int y = INT16((space.read_dword(src+0x04) >> 16) - (sprite_prot_y)); + int x = int16_t((space.read_dword(src+0x08) >> 16) - (sprite_prot_x)); + int y = int16_t((space.read_dword(src+0x04) >> 16) - (sprite_prot_y)); - UINT16 head1 = space.read_word(src+cop_spr_off); - UINT16 head2 = space.read_word(src+cop_spr_off+2); + uint16_t head1 = space.read_word(src+cop_spr_off); + uint16_t head2 = space.read_word(src+cop_spr_off+2); int w = (((head1 >> 8 ) & 7) + 1) << 4; int h = (((head1 >> 12) & 7) + 1) << 4; - UINT16 flag = x-w/2 > -w && x-w/2 < cop_spr_maxx+w && y-h/2 > -h && y-h/2 < 256+h ? 1 : 0; + uint16_t flag = x-w/2 > -w && x-w/2 < cop_spr_maxx+w && y-h/2 > -h && y-h/2 < 256+h ? 1 : 0; flag = (space.read_word(src) & 0xfffe) | flag; space.write_word(src, flag); @@ -3007,7 +3007,7 @@ ROM_START( xsedae ) ROM_REGION( 0x100000, "oki2", ROMREGION_ERASEFF ) /* ADPCM samples */ ROM_END -const UINT16 raiden2_state::raiden_blended_colors[] = { +const uint16_t raiden2_state::raiden_blended_colors[] = { // bridge tunnel entrance shadow 0x380, @@ -3055,7 +3055,7 @@ const UINT16 raiden2_state::raiden_blended_colors[] = { 0xffff, }; -void raiden2_state::init_blending(const UINT16 *table) +void raiden2_state::init_blending(const uint16_t *table) { for(auto & elem : blend_active) elem = false; @@ -3083,7 +3083,7 @@ DRIVER_INIT_MEMBER(raiden2_state,raidendx) raiden2_decrypt_sprites(machine()); } -const UINT16 raiden2_state::xsedae_blended_colors[] = { +const uint16_t raiden2_state::xsedae_blended_colors[] = { 0xffff, }; @@ -3095,7 +3095,7 @@ DRIVER_INIT_MEMBER(raiden2_state,xsedae) /* doesn't have banking */ } -const UINT16 raiden2_state::zeroteam_blended_colors[] = { +const uint16_t raiden2_state::zeroteam_blended_colors[] = { // Player selection 0x37e, // Boss spear shadow diff --git a/src/mame/drivers/rainbow.cpp b/src/mame/drivers/rainbow.cpp index 9da37b7d252..68fb0017f75 100644 --- a/src/mame/drivers/rainbow.cpp +++ b/src/mame/drivers/rainbow.cpp @@ -539,7 +539,7 @@ public: DECLARE_WRITE8_MEMBER(GDC_EXTRA_REGISTER_w); - UINT32 screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); IRQ_CALLBACK_MEMBER(irq_callback); @@ -597,17 +597,17 @@ private: required_device m_dbrg; required_device m_kbd8251; required_device m_lk201; - required_shared_ptr m_p_ram; - required_shared_ptr m_p_vol_ram; - required_shared_ptr m_p_nvram; - required_shared_ptr m_shared; + required_shared_ptr m_p_ram; + required_shared_ptr m_p_vol_ram; + required_shared_ptr m_p_nvram; + required_shared_ptr m_shared; optional_device m_rtc; required_device m_hgdc; // GDC-NEW required_device m_screen2; required_device m_palette2; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; void raise_8088_irq(int ref); void lower_8088_irq(int ref); @@ -623,16 +623,16 @@ private: hard_disk_file *rainbow_hdc_file(int ref); - UINT8 m_GDC_WRITE_BUFFER[16]; // 16 x 8 bits for CPU, 8 x 16 for GDC - UINT8 m_GDC_COLOR_MAP[32]; - UINT8 m_GDC_SCROLL_BUFFER_PRELOAD[256]; - UINT8 m_GDC_SCROLL_BUFFER[256]; + uint8_t m_GDC_WRITE_BUFFER[16]; // 16 x 8 bits for CPU, 8 x 16 for GDC + uint8_t m_GDC_COLOR_MAP[32]; + uint8_t m_GDC_SCROLL_BUFFER_PRELOAD[256]; + uint8_t m_GDC_SCROLL_BUFFER[256]; - UINT8 m_GDC_INDIRECT_REGISTER, m_GDC_MODE_REGISTER, m_GDC_scroll_index, m_GDC_color_map_index, m_GDC_write_buffer_index; - UINT8 m_GDC_ALU_PS_REGISTER, m_GDC_FG_BG; - UINT8 m_vpat, m_patmult, m_patcnt, m_patidx; + uint8_t m_GDC_INDIRECT_REGISTER, m_GDC_MODE_REGISTER, m_GDC_scroll_index, m_GDC_color_map_index, m_GDC_write_buffer_index; + uint8_t m_GDC_ALU_PS_REGISTER, m_GDC_FG_BG; + uint8_t m_vpat, m_patmult, m_patcnt, m_patidx; - UINT16 m_GDC_WRITE_MASK; + uint16_t m_GDC_WRITE_MASK; bool m_scroll_buffer_changed, m_color_map_changed; bool m_ONBOARD_GRAPHICS_SELECTED; // (internal switch, on board video to mono out) @@ -649,10 +649,10 @@ private: int MOTOR_DISABLE_counter; - UINT8 m_diagnostic; + uint8_t m_diagnostic; - UINT8 m_z80_private[0x800]; // Z80 private 2K - UINT8 m_z80_mailbox, m_8088_mailbox; + uint8_t m_z80_private[0x800]; // Z80 private 2K + uint8_t m_z80_mailbox, m_8088_mailbox; void update_kbd_irq(); virtual void machine_reset() override; @@ -661,7 +661,7 @@ private: floppy_image_device *m_floppy; int m_irq_high; - UINT32 m_irq_mask; + uint32_t m_irq_mask; int m_bdl_irq; int m_hdc_buf_offset; @@ -674,7 +674,7 @@ private: bool m_hdc_drive_ready; bool m_hdc_write_fault; - UINT8 m_hdc_buffer[2048]; + uint8_t m_hdc_buffer[2048]; bool m_POWER_GOOD; emu_timer *cmd_timer; @@ -705,7 +705,7 @@ printf("\n** NEC 7220 GDC RESET **\n"); UPD7220_DISPLAY_PIXELS_MEMBER( rainbow_state::hgdc_display_pixels ) { #ifdef BOOST_DEBUG_PERFORMANCE - UINT8 *ram = memregion("maincpu")->base(); + uint8_t *ram = memregion("maincpu")->base(); if( !(m_p_vol_ram[0x84] == 0x00) ) { if( (MOTOR_DISABLE_counter) || (ram[0xEFFFE] & 16) ) // if HDD/FDD ACTIVITY -OR- SMOOTH SCROLL IN PROGRESS @@ -716,8 +716,8 @@ UPD7220_DISPLAY_PIXELS_MEMBER( rainbow_state::hgdc_display_pixels ) const rgb_t *paletteX = m_palette2->palette()->entry_list_raw(); int xi; - UINT16 plane0, plane1, plane2, plane3; - UINT8 pen; + uint16_t plane0, plane1, plane2, plane3; + uint8_t pen; if(!(m_GDC_MODE_REGISTER & GDC_MODE_ENABLE_VIDEO)) return; // no output from graphics option @@ -729,7 +729,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( rainbow_state::hgdc_display_pixels ) // HIGH RES (2 planes, 2 color bits, 4 color map entries / 4 MONOCHROME SHADES) // MANUAL: (GDC "sees" 2 planes X 16 bits X 16K words)! - // !!! m_video_ram is defined as UINT16 !!! + // !!! m_video_ram is defined as uint16_t !!! plane0 = m_video_ram[ ((address & 0x7fff) + 0x00000) >> 1 ]; // Video Ram is defined as LITTLE_ENDIAN, 16 (?): plane1 = m_video_ram[ ((address & 0x7fff) + 0x20000) >> 1 ]; // 8 x 32 K is 0x40000, see page 16 plane2 = 0; @@ -798,7 +798,7 @@ void rainbow_state::machine_start() save_item(NAME(m_irq_mask)); #ifdef WORKAROUND_RAINBOW_B - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); if (rom[0xf4000 + 0x3ffc] == 0x31) // 100-B (5.01) 0x35 would test for V5.05 { rom[0xf4000 + 0x0303] = 0x00; // disable CRC check @@ -1040,12 +1040,12 @@ void rainbow_state::machine_reset() { // Configure RAM address_space &program = machine().device("maincpu")->space(AS_PROGRAM); - UINT32 unmap_start = m_inp8->read(); + uint32_t unmap_start = m_inp8->read(); // Verify RAM size matches hardware (DIP switches) - UINT8 *nv = memregion("maincpu")->base(); - UINT8 NVRAM_LOCATION; - UINT32 check; + uint8_t *nv = memregion("maincpu")->base(); + uint8_t NVRAM_LOCATION; + uint32_t check; #ifdef ASSUME_RAINBOW_A_HARDWARE printf("\n*** RAINBOW A MODEL ASSUMED (64 - 832 K RAM).\n"); @@ -1110,7 +1110,7 @@ void rainbow_state::machine_reset() { output().set_value("led1", 1); - UINT32 max_sector = (info->cylinders) * (info->heads) * (info->sectors); + uint32_t max_sector = (info->cylinders) * (info->heads) * (info->sectors); printf("\n%u MB HARD DISK MOUNTED. GEOMETRY: %d HEADS (1..8 ARE OK). %d CYLINDERS (151..1024 ARE OK). %d SECTORS / TRACK (16 ARE OK). %d BYTES / SECTOR (128 1024 ARE OK).\n", max_sector * 512 / 1000000, info->heads, info->cylinders, info->sectors, info->sectorbytes); } @@ -1190,12 +1190,12 @@ void rainbow_state::device_timer(emu_timer &timer, device_timer_id tid, int para } // switch } -UINT32 rainbow_state::screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rainbow_state::screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { static int old_palette, old_monitor; #ifdef BOOST_DEBUG_PERFORMANCE - UINT8 *ram = memregion("maincpu")->base(); + uint8_t *ram = memregion("maincpu")->base(); if( !(m_p_vol_ram[0x84] == 0x00) ) { if( (MOTOR_DISABLE_counter) || (ram[0xEFFFE] & 16) ) // if HDD/FDD ACTIVITY -OR- SMOOTH SCROLL IN PROGRESS @@ -1423,7 +1423,7 @@ READ8_MEMBER(rainbow_state::rtc_r) } } - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); return rom[RTC_BASE + offset]; // Return ROM to prevent crashes } // ------------------------/ ClikClok (for model B; DS1315) --------------------------------- @@ -1490,7 +1490,7 @@ hard_disk_file *(rainbow_state::rainbow_hdc_file(int drv)) } else { - UINT32 max_sector = info->cylinders * info->heads * info->sectors; + uint32_t max_sector = info->cylinders * info->heads * info->sectors; printf("%u MB HARD DISK: HEADS (1..8 OK) = %d / CYL. (151..1024 OK) = %d / SPT. (16 OK) = %d / SECTOR_BYTES (128..1024 OK) = %d\n", max_sector * 512 / 1000000, info->heads, info->cylinders, info->sectors, info->sectorbytes); @@ -1500,13 +1500,13 @@ hard_disk_file *(rainbow_state::rainbow_hdc_file(int drv)) } // LBA sector from CHS -static UINT32 get_and_print_lbasector(device_t *device, hard_disk_info *info, UINT16 cylinder, UINT8 head, UINT8 sector_number) +static uint32_t get_and_print_lbasector(device_t *device, hard_disk_info *info, uint16_t cylinder, uint8_t head, uint8_t sector_number) { if (info == nullptr) return 0; // LBA_ADDRESS = (C * HEADS + H) * NUMBER_SECTORS + (S - 1) - UINT32 lbasector = (double)cylinder * info->heads; // LBA : ( x 4 ) + uint32_t lbasector = (double)cylinder * info->heads; // LBA : ( x 4 ) lbasector += head; lbasector *= info->sectors; // LBA : ( x 16 ) lbasector += (sector_number - 1); // + (sector number - 1) @@ -1523,7 +1523,7 @@ WRITE_LINE_MEMBER(rainbow_state::hdc_read_sector) if (!m_hdc_write_gate) // do not read when WRITE GATE is on { - UINT8 SDH = (m_hdc->read(generic_space(), 0x06)); + uint8_t SDH = (m_hdc->read(generic_space(), 0x06)); int drv = (SDH & (8 + 16)) >> 3; // get DRIVE from SDH register if ((state == 0) && (last_state == 1) && (drv == 0)) @@ -1532,8 +1532,8 @@ WRITE_LINE_MEMBER(rainbow_state::hdc_read_sector) output().set_value("led1", 0); int hi = (m_hdc->read(generic_space(), 0x05)) & 0x07; - UINT16 cylinder = (m_hdc->read(generic_space(), 0x04)) | (hi << 8); - UINT8 sector_number = m_hdc->read(generic_space(), 0x03); + uint16_t cylinder = (m_hdc->read(generic_space(), 0x04)) | (hi << 8); + uint8_t sector_number = m_hdc->read(generic_space(), 0x03); hard_disk_file *local_hard_disk; local_hard_disk = rainbow_hdc_file(0); // one hard disk for now. @@ -1549,14 +1549,14 @@ WRITE_LINE_MEMBER(rainbow_state::hdc_read_sector) output().set_value("led1", 1); // Pointer to info + C + H + S - UINT32 lbasector = get_and_print_lbasector(this, info, cylinder, SDH & 0x07, sector_number); + uint32_t lbasector = get_and_print_lbasector(this, info, cylinder, SDH & 0x07, sector_number); if ((cylinder <= info->cylinders) && // filter invalid ranges (SECTOR_SIZES[(SDH >> 5) & 0x03] == info->sectorbytes) // may not vary in image! ) { read_status = 5; - if (hard_disk_read(local_hard_disk, lbasector, m_hdc_buffer)) // accepts LBA sector (UINT32) ! + if (hard_disk_read(local_hard_disk, lbasector, m_hdc_buffer)) // accepts LBA sector (uint32_t) ! read_status = 0; // logerror("...success!\n"); } } @@ -1649,10 +1649,10 @@ int rainbow_state::do_write_sector() feedback = 10; output().set_value("led1", 1); // OFF - UINT8 SDH = (m_hdc->read(generic_space(), 0x06)); + uint8_t SDH = (m_hdc->read(generic_space(), 0x06)); int hi = (m_hdc->read(generic_space(), 0x05)) & 0x07; - UINT16 cylinder = (m_hdc->read(generic_space(), 0x04)) | (hi << 8); + uint16_t cylinder = (m_hdc->read(generic_space(), 0x04)) | (hi << 8); int sector_number = m_hdc->read(generic_space(), 0x03); int sector_count = m_hdc->read(generic_space(), 0x02); // (1 = single sector) @@ -1667,12 +1667,12 @@ int rainbow_state::do_write_sector() return 50; } // Pointer to info + C + H + S - UINT32 lbasector = get_and_print_lbasector(this, info, cylinder, SDH & 0x07, sector_number); + uint32_t lbasector = get_and_print_lbasector(this, info, cylinder, SDH & 0x07, sector_number); if (sector_count != 1) // ignore all SECTOR_COUNTS != 1 return 88; // logerror(" - ** IGNORED (SECTOR_COUNT !=1) **\n"); - if (hard_disk_write(local_hard_disk, lbasector, m_hdc_buffer)) // accepts LBA sector (UINT32) ! + if (hard_disk_write(local_hard_disk, lbasector, m_hdc_buffer)) // accepts LBA sector (uint32_t) ! feedback = 99; // success else logerror("...FAILURE **** \n"); @@ -1830,7 +1830,7 @@ READ8_MEMBER(rainbow_state::hd_status_69_r) int HS = m_hdc->read(space, 0x06) & (1 + 2 + 4); // SDH bits 0-2 = HEAD # // logerror("(x69 READ) %i = HEAD SELECT WD1010\n", HS); - UINT8 data = (HS << 1); + uint8_t data = (HS << 1); // DRIVE SELECT: 2 bits in SDH register of WDx010 could address 4 drives. // External circuit supports 1 drive here (DRIVE 0 selected or deselected) @@ -2179,7 +2179,7 @@ READ8_MEMBER(rainbow_state::z80_diskstatus_r) track = m_fdc->track_r(space, 0); // Print HEX track number - static UINT8 bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 }; + static uint8_t bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 }; // 0...9 ,A (0x77), b (0x7c), C (0x39) , d (0x5e), E (0x79), F (0x71) output().set_digit_value(0, bcd2hex[(track >> 4) & 0x0f]); output().set_digit_value(1, bcd2hex[(track - ((track >> 4) << 4)) & 0x0f]); @@ -2344,12 +2344,12 @@ IRQ_CALLBACK_MEMBER(rainbow_state::irq_callback) // VERIFY: SCROLL_MAP & COLOR_MAP are updated at the next VSYNC (not immediately)... Are there more registers? WRITE_LINE_MEMBER(rainbow_state::GDC_vblank_irq) { - UINT8 red, green, blue, mono; + uint8_t red, green, blue, mono; int xi; // VIDEO LEVELS: 0 is 100 % output; F is 0 % output // Levels for 100-B model, taken from page 46 of PDF, multiplied by 2.55 to obtain a range of 0...255 - const UINT8 v_levels[16] = { 255, 217, 201,186, 171, 156, 140, 125, 110, 97, 79, 66, 54, 31, 18, 0 }; + const uint8_t v_levels[16] = { 255, 217, 201,186, 171, 156, 140, 125, 110, 97, 79, 66, 54, 31, 18, 0 }; if(m_scroll_buffer_changed) { @@ -2365,8 +2365,8 @@ WRITE_LINE_MEMBER(rainbow_state::GDC_vblank_irq) for(xi=0;xi<16;xi++) // DELAYED LOAD OF PALETTE ... { - UINT8 colordata1 = m_GDC_COLOR_MAP[xi]; - UINT8 colordata2 = m_GDC_COLOR_MAP[xi + 16]; // Does it matter if the palette is incomplete...? + uint8_t colordata1 = m_GDC_COLOR_MAP[xi]; + uint8_t colordata2 = m_GDC_COLOR_MAP[xi + 16]; // Does it matter if the palette is incomplete...? // Color map: 32 x 8 // 2nd 16 Byte 1st 16 Bytes (colordata1) @@ -2392,16 +2392,16 @@ WRITE_LINE_MEMBER(rainbow_state::GDC_vblank_irq) case 2: // SHADES OF GREEN // For now, a hand picked value from VTVIDEO * is coarsly transformed into a RGB value. - red = UINT8( ( 35.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); // 80 % = NORMAL * - green = UINT8( (145.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); - blue = UINT8( ( 75.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); + red = uint8_t( ( 35.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); // 80 % = NORMAL * + green = uint8_t( (145.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); + blue = uint8_t( ( 75.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); m_palette2->set_pen_color(xi + 16, rgb_t( red, green, blue) ); break; case 3: // AMBER. Assumption: "normal" value at 80 % is 213, 146, 82 (decimal) - red = UINT8( (213.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); // 80 % = NORMAL * is 3.19f (100 % would be 2.55f) - green = UINT8( (146.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); - blue = UINT8( ( 82.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); + red = uint8_t( (213.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); // 80 % = NORMAL * is 3.19f (100 % would be 2.55f) + green = uint8_t( (146.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); + blue = uint8_t( ( 82.0f / 80.0f) * ( v_levels[ mono ] / 3.19f) ); m_palette2->set_pen_color(xi + 16, rgb_t( red, green, blue) ); break; } @@ -2681,7 +2681,7 @@ READ16_MEMBER(rainbow_state::vram_r) // Rainbow has separate registers for fore and background. WRITE16_MEMBER(rainbow_state::vram_w) { - //UINT8 *video_ram8 = (UINT8 *)(&m_video_ram[0]); + //uint8_t *video_ram8 = (uint8_t *)(&m_video_ram[0]); if(!(m_GDC_MODE_REGISTER & GDC_MODE_VECTOR)) // NOT VECTOR MODE { @@ -2706,7 +2706,7 @@ WRITE16_MEMBER(rainbow_state::vram_w) } offset &= 0xffff; // same as in VT240? - UINT16 chr = data; // VT240 : UINT8 + uint16_t chr = data; // VT240 : uint8_t if(m_GDC_MODE_REGISTER & GDC_MODE_VECTOR) // VT240 : if(SELECT_VECTOR_PATTERN_REGISTER) { @@ -2733,16 +2733,16 @@ WRITE16_MEMBER(rainbow_state::vram_w) // ALU_PS register: controls logic used in writing to the bitmap / inhibiting of writing to specified planes. // plane select and logic operations on write buffer... (and more) **** SEE PAGE 36 **** int ps = m_GDC_ALU_PS_REGISTER & 0x0F; // PLANE SELECT 0..3 // VT 240 : ~m_GDC_ALU_PS_REGISTER & 3; - UINT8 fore = ( (m_GDC_FG_BG & 0xf0) ) >> 4; - UINT8 back = (m_GDC_FG_BG & 0x0f); // background : 0..3 confirmed, see p.39 AA-AE36A (PDF) + uint8_t fore = ( (m_GDC_FG_BG & 0xf0) ) >> 4; + uint8_t back = (m_GDC_FG_BG & 0x0f); // background : 0..3 confirmed, see p.39 AA-AE36A (PDF) for(int i = 0; i <= 3; i++) { if( BIT(ps,i ) ) { - UINT16 mem = m_video_ram[(offset & 0xffff) + (0x8000 * i)]; // VT240 + uint16_t mem = m_video_ram[(offset & 0xffff) + (0x8000 * i)]; // VT240 - UINT16 out = 0; // VT240 : UINT8 + uint16_t out = 0; // VT240 : uint8_t for(int j = 0; j <= 15; j++) // REPLACE MODE : one replaced by FG, zero by BG ( 16 instead of 8 bit on VT240 ) out |= BIT(chr, j) ? ((fore & 1) << j) : ((back & 1) << j); diff --git a/src/mame/drivers/rambo.cpp b/src/mame/drivers/rambo.cpp index afe528c6b49..34dc5356d07 100644 --- a/src/mame/drivers/rambo.cpp +++ b/src/mame/drivers/rambo.cpp @@ -37,17 +37,17 @@ public: { } - UINT8 m_port_a; - UINT8 m_port_b; - UINT8 m_port_c; - UINT8 m_port_d; - UINT8 m_port_e; - UINT8 m_port_f; - UINT8 m_port_g; - UINT8 m_port_h; - UINT8 m_port_j; - UINT8 m_port_k; - UINT8 m_port_l; + uint8_t m_port_a; + uint8_t m_port_b; + uint8_t m_port_c; + uint8_t m_port_d; + uint8_t m_port_e; + uint8_t m_port_f; + uint8_t m_port_g; + uint8_t m_port_h; + uint8_t m_port_j; + uint8_t m_port_k; + uint8_t m_port_l; required_device m_maincpu; DECLARE_READ8_MEMBER(port_r); @@ -88,8 +88,8 @@ WRITE8_MEMBER(rambo_state::port_w) if (data == m_port_a) break; #if LOG_PORTS - UINT8 old_port_a = m_port_a; - UINT8 changed = data ^ old_port_a; + uint8_t old_port_a = m_port_a; + uint8_t changed = data ^ old_port_a; #endif m_port_a = data; break; diff --git a/src/mame/drivers/rampart.cpp b/src/mame/drivers/rampart.cpp index 94103a23a6e..c11fab13496 100644 --- a/src/mame/drivers/rampart.cpp +++ b/src/mame/drivers/rampart.cpp @@ -480,7 +480,7 @@ ROM_END DRIVER_INIT_MEMBER(rampart_state,rampart) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); memcpy(&rom[0x140000], &rom[0x40000], 0x8000); slapstic_configure(*m_maincpu, 0x140000, 0x438000, memregion("maincpu")->base() + 0x140000); diff --git a/src/mame/drivers/rastersp.cpp b/src/mame/drivers/rastersp.cpp index c1d261e2881..9064893edd5 100644 --- a/src/mame/drivers/rastersp.cpp +++ b/src/mame/drivers/rastersp.cpp @@ -98,7 +98,7 @@ public: required_device m_maincpu; required_device m_dsp; - required_shared_ptr m_dram; + required_shared_ptr m_dram; required_device m_ldac; required_device m_rdac; required_device m_tms_timer1; @@ -128,18 +128,18 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(tms_tx_timer); INTERRUPT_GEN_MEMBER(vblank_irq); - std::unique_ptr m_nvram8; - UINT8 m_io_reg; - UINT8 m_irq_status; - UINT32 m_dpyaddr; - std::unique_ptr m_paletteram; - UINT32 m_speedup_count; - UINT32 m_tms_io_regs[0x80]; + std::unique_ptr m_nvram8; + uint8_t m_io_reg; + uint8_t m_irq_status; + uint32_t m_dpyaddr; + std::unique_ptr m_paletteram; + uint32_t m_speedup_count; + uint32_t m_tms_io_regs[0x80]; bitmap_ind16 m_update_bitmap; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void update_irq(UINT32 which, UINT32 state); - void upload_palette(UINT32 word1, UINT32 word2); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void update_irq(uint32_t which, uint32_t state); + void upload_palette(uint32_t word1, uint32_t word2); IRQ_CALLBACK_MEMBER(irq_callback); protected: // driver_device overrides @@ -158,9 +158,9 @@ protected: void rastersp_state::machine_start() { - m_nvram8 = std::make_unique(NVRAM_SIZE); + m_nvram8 = std::make_unique(NVRAM_SIZE); m_nvram->set_base(m_nvram8.get(),NVRAM_SIZE); - m_paletteram = std::make_unique(0x8000); + m_paletteram = std::make_unique(0x8000); membank("bank1")->set_base(m_dram); membank("bank2")->set_base(&m_dram[0x10000/4]); @@ -215,18 +215,18 @@ WRITE32_MEMBER( rastersp_state::dpylist_w ) return; } - UINT32 dpladdr = (m_dpyaddr & ~0xff) >> 6; + uint32_t dpladdr = (m_dpyaddr & ~0xff) >> 6; if ((m_dpyaddr & 0xff) != 0xb2 && (m_dpyaddr & 0xff) != 0xf2) logerror("Unusual display list data: %x\n", m_dpyaddr); int y = 0; int x = 0; - UINT16 *bmpptr = &m_update_bitmap.pix16(0, 0); + uint16_t *bmpptr = &m_update_bitmap.pix16(0, 0); while (y < 240) { - UINT32 word1 = m_dram[dpladdr/4]; + uint32_t word1 = m_dram[dpladdr/4]; if (word1 & 0x80000000) { @@ -235,7 +235,7 @@ WRITE32_MEMBER( rastersp_state::dpylist_w ) } else { - UINT32 word2 = m_dram[(dpladdr + 4)/4]; + uint32_t word2 = m_dram[(dpladdr + 4)/4]; dpladdr += 8; @@ -244,16 +244,16 @@ WRITE32_MEMBER( rastersp_state::dpylist_w ) if ((word2 & 0xfe000000) != 0x94000000) logerror("Unusual display list entry: %x %x\n", word1, word2); - UINT32 srcaddr = word1 >> 8; - UINT32 pixels = (word2 >> 16) & 0x1ff; - UINT32 palbase = (word2 >> 4) & 0xf00; + uint32_t srcaddr = word1 >> 8; + uint32_t pixels = (word2 >> 16) & 0x1ff; + uint32_t palbase = (word2 >> 4) & 0xf00; - UINT16* palptr = &m_paletteram[palbase]; - UINT8* srcptr = reinterpret_cast(&m_dram[0]); + uint16_t* palptr = &m_paletteram[palbase]; + uint8_t* srcptr = reinterpret_cast(&m_dram[0]); - UINT32 acc = srcaddr << 8; + uint32_t acc = srcaddr << 8; - INT32 incr = word2 & 0xfff; + int32_t incr = word2 & 0xfff; // Sign extend for our convenience incr |= ~((incr & 0x800) - 1) & ~0xff; @@ -290,20 +290,20 @@ WRITE32_MEMBER( rastersp_state::dpylist_w ) } -void rastersp_state::upload_palette(UINT32 word1, UINT32 word2) +void rastersp_state::upload_palette(uint32_t word1, uint32_t word2) { if (word1 & 3) fatalerror("Unalligned palette address! (%x, %x)\n", word1, word2); - UINT32 addr = word1 >> 8; - UINT32 entries = (word2 >> 16) & 0x1ff; - UINT32 index = ((word2 >> 12) & 0x1f) * 256; + uint32_t addr = word1 >> 8; + uint32_t entries = (word2 >> 16) & 0x1ff; + uint32_t index = ((word2 >> 12) & 0x1f) * 256; // The third byte of each entry in RAM appears to contain an index // but appears to be discared when written to palette RAM while (entries--) { - UINT32 data = m_dram[addr / 4]; + uint32_t data = m_dram[addr / 4]; m_paletteram[index++] = data & 0xffff; addr += 4; } @@ -349,7 +349,7 @@ Unknown: (D4000100) - Present at start of a list *******************************************************************************/ -UINT32 rastersp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rastersp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_update_bitmap, 0, 0, 0, 0, cliprect); return 0; @@ -365,7 +365,7 @@ UINT32 rastersp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap IRQ_CALLBACK_MEMBER(rastersp_state::irq_callback) { - UINT8 vector = 0; + uint8_t vector = 0; if (m_irq_status & (1 << IRQ_SCSI)) { @@ -390,9 +390,9 @@ IRQ_CALLBACK_MEMBER(rastersp_state::irq_callback) } -void rastersp_state::update_irq(UINT32 which, UINT32 state) +void rastersp_state::update_irq(uint32_t which, uint32_t state) { - UINT32 mask = 1 << which; + uint32_t mask = 1 << which; if (state) m_irq_status |= mask; @@ -467,7 +467,7 @@ WRITE8_MEMBER( rastersp_state::nvram_w ) offset &= ~0x2000; - UINT32 addr = ((offset & 0x00f0000) >> 5) | ((offset & 0x1fff) / 4); + uint32_t addr = ((offset & 0x00f0000) >> 5) | ((offset & 0x1fff) / 4); m_nvram8[addr] = data & 0xff; } @@ -484,7 +484,7 @@ READ8_MEMBER( rastersp_state::nvram_r ) offset &= ~0x2000; - UINT32 addr = ((offset & 0x00f0000) >> 5) | ((offset & 0x1fff) / 4); + uint32_t addr = ((offset & 0x00f0000) >> 5) | ((offset & 0x1fff) / 4); return m_nvram8[addr]; } @@ -508,7 +508,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( rastersp_state::tms_tx_timer ) // Is the transmit shifter full? if (m_tms_io_regs[SPORT_GLOBAL_CTL] & (1 << 3)) { - UINT32 data = m_tms_io_regs[SPORT_DATA_TX]; + uint32_t data = m_tms_io_regs[SPORT_DATA_TX]; m_ldac->write(data & 0xffff); m_rdac->write(data >> 16); @@ -536,7 +536,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( rastersp_state::tms_timer1 ) READ32_MEMBER( rastersp_state::tms32031_control_r ) { - UINT32 val = m_tms_io_regs[offset]; + uint32_t val = m_tms_io_regs[offset]; switch (offset) { @@ -559,7 +559,7 @@ READ32_MEMBER( rastersp_state::tms32031_control_r ) WRITE32_MEMBER( rastersp_state::tms32031_control_w ) { - UINT32 old = m_tms_io_regs[offset]; + uint32_t old = m_tms_io_regs[offset]; m_tms_io_regs[offset] = data; @@ -644,7 +644,7 @@ WRITE32_MEMBER( rastersp_state::dsp_speedup_w ) // 809e90 48fd, 48d5 if (space.device().safe_pc() == 0x809c23) { - INT32 cycles_left = space.device().execute().cycles_remaining(); + int32_t cycles_left = space.device().execute().cycles_remaining(); data += cycles_left / 6; space.device().execute().spin(); } diff --git a/src/mame/drivers/ravens.cpp b/src/mame/drivers/ravens.cpp index fba58a10221..818f99665f5 100644 --- a/src/mame/drivers/ravens.cpp +++ b/src/mame/drivers/ravens.cpp @@ -101,8 +101,8 @@ public: DECLARE_READ8_MEMBER(cass_r); DECLARE_WRITE_LINE_MEMBER(cass_w); DECLARE_QUICKLOAD_LOAD_MEMBER( ravens ); - UINT8 m_term_char; - UINT8 m_term_data; + uint8_t m_term_char; + uint8_t m_term_data; required_device m_maincpu; optional_device m_terminal; required_device m_cass; @@ -135,14 +135,14 @@ WRITE8_MEMBER( ravens_state::leds_w ) READ8_MEMBER( ravens_state::port07_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0x80; return ret; } READ8_MEMBER( ravens_state::port17_r ) { - UINT8 keyin, i; + uint8_t keyin, i; keyin = ioport("X0")->read(); if (keyin != 0xff) @@ -267,7 +267,7 @@ QUICKLOAD_LOAD_MEMBER( ravens_state, ravens ) int quick_addr = 0x900; int exec_addr; int quick_length; - std::vector quick_data; + std::vector quick_data; int read_; image_init_result result = image_init_result::FAIL; diff --git a/src/mame/drivers/rbisland.cpp b/src/mame/drivers/rbisland.cpp index 30eca45adb7..2631795c844 100644 --- a/src/mame/drivers/rbisland.cpp +++ b/src/mame/drivers/rbisland.cpp @@ -944,7 +944,7 @@ ROM_END DRIVER_INIT_MEMBER(rbisland_state,rbisland) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000); @@ -953,7 +953,7 @@ DRIVER_INIT_MEMBER(rbisland_state,rbisland) DRIVER_INIT_MEMBER(rbisland_state,rbislande) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 4, &ROM[0xc000], 0x4000); diff --git a/src/mame/drivers/rbmk.cpp b/src/mame/drivers/rbmk.cpp index 127967fa23a..2fdbe11ca1b 100644 --- a/src/mame/drivers/rbmk.cpp +++ b/src/mame/drivers/rbmk.cpp @@ -72,10 +72,10 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_gms_vidram2; - required_shared_ptr m_gms_vidram; - UINT16 m_tilebank; - UINT8 m_mux_data; + required_shared_ptr m_gms_vidram2; + required_shared_ptr m_gms_vidram; + uint16_t m_tilebank; + uint8_t m_mux_data; DECLARE_READ16_MEMBER(gms_read); DECLARE_WRITE16_MEMBER(gms_write1); DECLARE_WRITE16_MEMBER(gms_write2); @@ -85,7 +85,7 @@ public: DECLARE_WRITE8_MEMBER(mcu_io_mux_w); DECLARE_WRITE16_MEMBER(eeprom_w); virtual void video_start() override; - UINT32 screen_update_rbmk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rbmk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mcu_irq); required_device m_maincpu; required_device m_mcu; @@ -509,7 +509,7 @@ void rbmk_state::video_start() { } -UINT32 rbmk_state::screen_update_rbmk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rbmk_state::screen_update_rbmk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int count = 0; diff --git a/src/mame/drivers/rc702.cpp b/src/mame/drivers/rc702.cpp index 4a93c5bac4b..8812d491702 100644 --- a/src/mame/drivers/rc702.cpp +++ b/src/mame/drivers/rc702.cpp @@ -73,12 +73,12 @@ public: DECLARE_WRITE8_MEMBER(kbd_put); private: - UINT8 *m_p_chargen; + uint8_t *m_p_chargen; bool m_q_state; bool m_qbar_state; bool m_drq_state; - UINT16 m_beepcnt; - UINT8 m_dack; + uint16_t m_beepcnt; + uint8_t m_dack; bool m_tc; required_device m_palette; required_device m_maincpu; @@ -239,7 +239,7 @@ static const rgb_t our_palette[3] = { DRIVER_INIT_MEMBER( rc702_state, rc702 ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x10000]); @@ -251,7 +251,7 @@ DRIVER_INIT_MEMBER( rc702_state, rc702 ) I8275_DRAW_CHARACTER_MEMBER( rc702_state::display_pixels ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 gfx = 0; + uint8_t gfx = 0; if (!vsp) gfx = m_p_chargen[(linecount & 15) | (charcode << 4)]; diff --git a/src/mame/drivers/rc759.cpp b/src/mame/drivers/rc759.cpp index 68c18116b75..a21b239b960 100644 --- a/src/mame/drivers/rc759.cpp +++ b/src/mame/drivers/rc759.cpp @@ -119,10 +119,10 @@ private: required_device m_fdc; required_device m_floppy0; required_device m_floppy1; - required_shared_ptr m_vram; + required_shared_ptr m_vram; required_ioport m_config; - std::vector m_nvram_mem; + std::vector m_nvram_mem; int m_cas_enabled; int m_cas_data; @@ -130,7 +130,7 @@ private: int m_nvram_bank; int m_gfx_mode; int m_keyboard_enable; - UINT8 m_keyboard_key; + uint8_t m_keyboard_key; int m_centronics_strobe; int m_centronics_init; @@ -140,7 +140,7 @@ private: int m_centronics_fault; int m_centronics_perror; int m_centronics_select; - UINT8 m_centronics_data; + uint8_t m_centronics_data; }; @@ -168,7 +168,7 @@ READ8_MEMBER( rc759_state::keyboard_r ) READ8_MEMBER( rc759_state::ppi_porta_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= m_cas_enabled ? m_cas_data : (m_cas->input() > 0 ? 1 : 0); data |= m_isbx->mpst_r() << 1; @@ -184,7 +184,7 @@ READ8_MEMBER( rc759_state::ppi_porta_r ) READ8_MEMBER( rc759_state::ppi_portb_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= 1 << 0; // 0 = micronet controller installed data |= 1 << 1; // rtc type, mm58167/cdp1879 @@ -257,7 +257,7 @@ WRITE8_MEMBER( rc759_state::centronics_data_w ) READ8_MEMBER( rc759_state::centronics_control_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= m_centronics_busy << 0; data |= m_centronics_ack << 1; @@ -331,7 +331,7 @@ I82730_UPDATE_ROW( rc759_state::txt_update_row ) { for (int i = 0; i < x_count; i++) { - UINT16 gfx = m_vram[(data[i] & 0x3ff) << 4 | lc]; + uint16_t gfx = m_vram[(data[i] & 0x3ff) << 4 | lc]; // pretty crude detection if char sizes have been initialized, need something better if ((gfx & 0xff) == 0) diff --git a/src/mame/drivers/rcorsair.cpp b/src/mame/drivers/rcorsair.cpp index e015ce6ce3a..acf53d6a4df 100644 --- a/src/mame/drivers/rcorsair.cpp +++ b/src/mame/drivers/rcorsair.cpp @@ -67,7 +67,7 @@ public: m_maincpu(*this, "maincpu") { } - 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: @@ -130,7 +130,7 @@ void rcorsair_state::video_start() { } -UINT32 rcorsair_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rcorsair_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/rd100.cpp b/src/mame/drivers/rd100.cpp index c89951d57db..d7394194231 100644 --- a/src/mame/drivers/rd100.cpp +++ b/src/mame/drivers/rd100.cpp @@ -26,7 +26,7 @@ public: DECLARE_DRIVER_INIT(rd100); DECLARE_MACHINE_RESET(rd100); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: required_device m_maincpu; @@ -46,7 +46,7 @@ ADDRESS_MAP_END static INPUT_PORTS_START( rd100 ) INPUT_PORTS_END -UINT32 rd100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t rd100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // for (int y = 0; y < 32*8; y++) // { @@ -54,13 +54,13 @@ UINT32 rd100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c // for (int sx = 0; sx < 64; sx++) // { -// UINT8 code = m_video_ram[offset++]; -// UINT8 attr = m_video_ram[offset++]; +// uint8_t code = m_video_ram[offset++]; +// uint8_t attr = m_video_ram[offset++]; // offs_t char_offs = ((code & 0x7f) << 3) | (y & 0x07); // if (BIT(code, 7)) char_offs = ((code & 0x7f) << 3) | ((y >> 1) & 0x07); -// UINT8 data = m_char_rom->base()[char_offs]; +// uint8_t data = m_char_rom->base()[char_offs]; // rgb_t fg = m_palette->pen_color(attr & 0x07); // rgb_t bg = m_palette->pen_color((attr >> 3) & 0x07); diff --git a/src/mame/drivers/rd110.cpp b/src/mame/drivers/rd110.cpp index 02da5ac1f4f..e19c0baf88b 100644 --- a/src/mame/drivers/rd110.cpp +++ b/src/mame/drivers/rd110.cpp @@ -62,7 +62,7 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(d110); - 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); DECLARE_WRITE8_MEMBER(bank_w); DECLARE_WRITE8_MEMBER(so_w); @@ -77,11 +77,11 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(samples_timer_cb); private: - UINT8 lcd_data_buffer[256]; + uint8_t lcd_data_buffer[256]; int lcd_data_buffer_pos; - UINT8 midi; + uint8_t midi; int midi_pos; - UINT8 port0; + uint8_t port0; required_device m_maincpu; }; @@ -99,14 +99,14 @@ d110_state::d110_state(const machine_config &mconfig, device_type type, const ch } -UINT32 d110_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t d110_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0); - const UINT8 *data = lcd->render(); + const uint8_t *data = lcd->render(); for(int l=0; l<2; l++) for(int c=0; c<20; c++) for(int y=0; y<8; y++) { - UINT8 v = data[c*16 + l*40*16 + y]; + uint8_t v = data[c*16 + l*40*16 + y]; for(int x=0; x<5; x++) bitmap.pix16(y+9*l, c*6+x) = v & (0x10 >> x) ? 1 : 0; } @@ -170,7 +170,7 @@ WRITE16_MEMBER(d110_state::midi_w) TIMER_DEVICE_CALLBACK_MEMBER(d110_state::midi_timer_cb) { - const static UINT8 midi_data[3] = { 0x91, 0x40, 0x7f }; + const static uint8_t midi_data[3] = { 0x91, 0x40, 0x7f }; midi = midi_data[midi_pos++]; logerror("midi_in %02x\n", midi); cpu->serial_w(midi); diff --git a/src/mame/drivers/re900.cpp b/src/mame/drivers/re900.cpp index 93f59ea1f4c..46812d9df5f 100644 --- a/src/mame/drivers/re900.cpp +++ b/src/mame/drivers/re900.cpp @@ -94,15 +94,15 @@ public: required_device m_maincpu; - required_shared_ptr m_rom; + required_shared_ptr m_rom; // re900 specific - UINT8 m_psg_pa; - UINT8 m_psg_pb; - UINT8 m_mux_data; - UINT8 m_ledant; - UINT8 m_player; - UINT8 m_stat_a; + uint8_t m_psg_pa; + uint8_t m_psg_pb; + uint8_t m_mux_data; + uint8_t m_ledant; + uint8_t m_player; + uint8_t m_stat_a; // common DECLARE_READ8_MEMBER(rom_r); @@ -140,7 +140,7 @@ READ8_MEMBER(re900_state::re_psg_portA_r) READ8_MEMBER(re900_state::re_psg_portB_r) { - UINT8 retval = 0xff; + uint8_t retval = 0xff; logerror("llamada a re_psg_portB_r\n"); /* This is a hack to select the active player due to Keyboard size restrictions */ @@ -206,7 +206,7 @@ WRITE8_MEMBER(re900_state::re_mux_port_A_w) WRITE8_MEMBER(re900_state::re_mux_port_B_w) { - UINT8 led; + uint8_t led; m_psg_pb = data; led = (m_psg_pa >> 2) & 0x3f; diff --git a/src/mame/drivers/realbrk.cpp b/src/mame/drivers/realbrk.cpp index 2b5cb3826c2..414c69389c4 100644 --- a/src/mame/drivers/realbrk.cpp +++ b/src/mame/drivers/realbrk.cpp @@ -53,7 +53,7 @@ To Do: /* Read 4 ten bit dip switches */ READ16_MEMBER(realbrk_state::realbrk_dsw_r) { - UINT16 sel = ~m_dsw_select[0]; + uint16_t sel = ~m_dsw_select[0]; if (sel & 0x01) return (ioport("SW1")->read() & 0x00ff) << 8; // DSW1 low bits if (sel & 0x02) return (ioport("SW2")->read() & 0x00ff) << 8; // DSW2 low bits if (sel & 0x04) return (ioport("SW3")->read() & 0x00ff) << 8; // DSW3 low bits @@ -88,7 +88,7 @@ READ16_MEMBER(realbrk_state::pkgnsh_input_r) READ16_MEMBER(realbrk_state::pkgnshdx_input_r) { - UINT16 sel = ~m_dsw_select[0]; + uint16_t sel = ~m_dsw_select[0]; switch(offset) { diff --git a/src/mame/drivers/redclash.cpp b/src/mame/drivers/redclash.cpp index ee8eebe9197..6cd3042d8be 100644 --- a/src/mame/drivers/redclash.cpp +++ b/src/mame/drivers/redclash.cpp @@ -929,8 +929,8 @@ ROM_END DRIVER_INIT_MEMBER(redclash_state,redclash) { int i,j; - const UINT8 *src = memregion("gfx2")->base(); - UINT8 *dst = memregion("gfx3")->base(); + const uint8_t *src = memregion("gfx2")->base(); + uint8_t *dst = memregion("gfx3")->base(); int len = memregion("gfx3")->bytes(); /* rearrange the sprite graphics */ diff --git a/src/mame/drivers/renegade.cpp b/src/mame/drivers/renegade.cpp index b1cca745881..42af90ff0c8 100644 --- a/src/mame/drivers/renegade.cpp +++ b/src/mame/drivers/renegade.cpp @@ -162,7 +162,7 @@ WRITE_LINE_MEMBER(renegade_state::adpcm_int) } else { - UINT8 const data = m_adpcmrom[m_adpcm_pos / 2]; + uint8_t const data = m_adpcmrom[m_adpcm_pos / 2]; m_msm->data_w(m_adpcm_pos & 1 ? data & 0xf : data >> 4); m_adpcm_pos++; } @@ -183,7 +183,7 @@ WRITE8_MEMBER(renegade_state::sound_w) */ -static const UINT8 kuniokun_xor_table[0x2a] = +static const uint8_t kuniokun_xor_table[0x2a] = { 0x48, 0x8a, 0x48, 0xa5, 0x01, 0x48, 0xa9, 0x00, 0x85, 0x01, 0xa2, 0x10, 0x26, 0x10, 0x26, 0x11, @@ -386,7 +386,7 @@ void renegade_state::mcu_process_command() case 0x26: /* sound code -> sound command */ { int sound_code = m_mcu_buffer[1]; - static const UINT8 sound_command_table[256] = + static const uint8_t sound_command_table[256] = { 0xa0, 0xa1, 0xa2, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, @@ -429,7 +429,7 @@ void renegade_state::mcu_process_command() case 0x33: /* joy bits -> joy dir */ { int joy_bits = m_mcu_buffer[2]; - static const UINT8 joy_table[0x10] = + static const uint8_t joy_table[0x10] = { 0, 3, 7, 0, 1, 2, 8, 0, 5, 4, 6, 0, 0, 0, 0, 0 }; @@ -442,7 +442,7 @@ void renegade_state::mcu_process_command() { int difficulty = m_mcu_buffer[2] & 0x3; int stage = m_mcu_buffer[3]; - static const UINT8 difficulty_table[4] = { 5, 3, 1, 2 }; + static const uint8_t difficulty_table[4] = { 5, 3, 1, 2 }; int result = difficulty_table[difficulty]; if (stage == 0) @@ -459,7 +459,7 @@ void renegade_state::mcu_process_command() case 0x55: /* 0x55, 0x00, 0x00, 0x00, DSW2 -> timer */ { int difficulty = m_mcu_buffer[4] & 0x3; - static const UINT16 table[4] = + static const uint16_t table[4] = { 0x4001, 0x5001, 0x1502, 0x0002 }; @@ -558,7 +558,7 @@ READ8_MEMBER(renegade_state::mcu_r) CUSTOM_INPUT_MEMBER(renegade_state::mcu_status_r) { - UINT8 res = 0; + uint8_t res = 0; if (m_mcu_sim == TRUE) { diff --git a/src/mame/drivers/replicator.cpp b/src/mame/drivers/replicator.cpp index 52e95585abd..66c6ae1bad6 100644 --- a/src/mame/drivers/replicator.cpp +++ b/src/mame/drivers/replicator.cpp @@ -161,19 +161,19 @@ public: virtual void machine_start() override; - UINT8 m_port_a; - UINT8 m_port_b; - UINT8 m_port_c; - UINT8 m_port_d; - UINT8 m_port_e; - UINT8 m_port_f; - UINT8 m_port_g; - UINT8 m_port_h; - UINT8 m_port_j; - UINT8 m_port_k; - UINT8 m_port_l; - - UINT8 shift_register_value; + uint8_t m_port_a; + uint8_t m_port_b; + uint8_t m_port_c; + uint8_t m_port_d; + uint8_t m_port_e; + uint8_t m_port_f; + uint8_t m_port_g; + uint8_t m_port_h; + uint8_t m_port_j; + uint8_t m_port_k; + uint8_t m_port_l; + + uint8_t shift_register_value; required_device m_maincpu; required_device m_lcdc; @@ -283,8 +283,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_a) break; #if LOG_PORTS - UINT8 old_port_a = m_port_a; - UINT8 changed = data ^ old_port_a; + uint8_t old_port_a = m_port_a; + uint8_t changed = data ^ old_port_a; printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & A_AXIS_DIR) printf("[A] A_AXIS_DIR: %s\n", data & A_AXIS_DIR ? "HIGH" : "LOW"); @@ -301,8 +301,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_b) break; #if LOG_PORTS - UINT8 old_port_b = m_port_b; - UINT8 changed = data ^ old_port_b; + uint8_t old_port_b = m_port_b; + uint8_t changed = data ^ old_port_b; printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & SD_CS) printf("[B] SD Card Chip Select: %s\n", data & SD_CS ? "HIGH" : "LOW"); @@ -321,8 +321,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_c) break; - UINT8 old_port_c = m_port_c; - UINT8 changed = data ^ old_port_c; + uint8_t old_port_c = m_port_c; + uint8_t changed = data ^ old_port_c; #if LOG_PORTS printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & EX2_1280) printf("[C] EX2_1280: %s\n", data & EX2_1280 ? "HIGH" : "LOW"); @@ -348,7 +348,7 @@ WRITE8_MEMBER(replicator_state::port_w) bool RS = (shift_register_value >> 1) & 1; bool RW = (shift_register_value >> 2) & 1; bool enable = (shift_register_value >> 3) & 1; - UINT8 lcd_data = shift_register_value & 0xF0; + uint8_t lcd_data = shift_register_value & 0xF0; if (enable && RW==0){ if (RS==0){ @@ -367,8 +367,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_d) break; #if LOG_PORTS - UINT8 old_port_d = m_port_d; - UINT8 changed = data ^ old_port_d; + uint8_t old_port_d = m_port_d; + uint8_t changed = data ^ old_port_d; printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & PORTD_SCL) printf("[D] PORTD_SCL: %s\n", data & PORTD_SCL ? "HIGH" : "LOW"); @@ -383,8 +383,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_e) break; #if LOG_PORTS - UINT8 old_port_e = m_port_e; - UINT8 changed = data ^ old_port_e; + uint8_t old_port_e = m_port_e; + uint8_t changed = data ^ old_port_e; printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & RX_1280) printf("[E] 1280-RX: %s\n", data & RX_1280 ? "HIGH" : "LOW"); @@ -401,8 +401,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_f) break; #if LOG_PORTS - UINT8 old_port_f = m_port_f; - UINT8 changed = data ^ old_port_f; + uint8_t old_port_f = m_port_f; + uint8_t changed = data ^ old_port_f; printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & X_AXIS_DIR) printf("[F] X_AXIS_DIR: %s\n", data & X_AXIS_DIR ? "HIGH" : "LOW"); @@ -421,8 +421,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_g) break; - UINT8 old_port_g = m_port_g; - UINT8 changed = data ^ old_port_g; + uint8_t old_port_g = m_port_g; + uint8_t changed = data ^ old_port_g; #if LOG_PORTS printf("[%08X] ", m_maincpu->m_shifted_pc); @@ -445,8 +445,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_h) break; #if LOG_PORTS - UINT8 old_port_h = m_port_h; - UINT8 changed = data ^ old_port_h; + uint8_t old_port_h = m_port_h; + uint8_t changed = data ^ old_port_h; printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & CUTOFF_TEST) printf("[H] CUTOFF_TEST: %s\n", data & CUTOFF_TEST ? "HIGH" : "LOW"); @@ -464,8 +464,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_j) break; #if LOG_PORTS - UINT8 old_port_j = m_port_j; - UINT8 changed = data ^ old_port_j; + uint8_t old_port_j = m_port_j; + uint8_t changed = data ^ old_port_j; printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & BUTTON_CENTER) printf("[J] BUTTON_CENTER: %s\n", data & BUTTON_CENTER ? "HIGH" : "LOW"); @@ -483,8 +483,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_k) break; #if LOG_PORTS - UINT8 old_port_k = m_port_k; - UINT8 changed = data ^ old_port_k; + uint8_t old_port_k = m_port_k; + uint8_t changed = data ^ old_port_k; printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & Z_AXIS_DIR) printf("[K] Z_AXIS_DIR: %s\n", data & Z_AXIS_DIR ? "HIGH" : "LOW"); @@ -503,8 +503,8 @@ WRITE8_MEMBER(replicator_state::port_w) { if (data == m_port_l) break; #if LOG_PORTS - UINT8 old_port_l = m_port_l; - UINT8 changed = data ^ old_port_l; + uint8_t old_port_l = m_port_l; + uint8_t changed = data ^ old_port_l; printf("[%08X] ", m_maincpu->m_shifted_pc); if(changed & X_MIN) printf("[L] X_MIN: %s\n", data & X_MIN ? "HIGH" : "LOW"); diff --git a/src/mame/drivers/rex6000.cpp b/src/mame/drivers/rex6000.cpp index 509a6d69449..3de5b113e7d 100644 --- a/src/mame/drivers/rex6000.cpp +++ b/src/mame/drivers/rex6000.cpp @@ -76,27 +76,27 @@ public: required_device m_bankdev0; required_device m_bankdev1; optional_device m_flash0b; - required_shared_ptr m_nvram; + required_shared_ptr m_nvram; required_ioport m_battery; optional_ioport m_pen_x; optional_ioport m_pen_y; - UINT8 m_bank[4]; - UINT8 m_beep_io[5]; - UINT8 m_lcd_base[2]; - UINT8 m_touchscreen[0x10]; - UINT8 m_lcd_enabled; - UINT8 m_lcd_cmd; + uint8_t m_bank[4]; + uint8_t m_beep_io[5]; + uint8_t m_lcd_base[2]; + uint8_t m_touchscreen[0x10]; + uint8_t m_lcd_enabled; + uint8_t m_lcd_cmd; - UINT8 m_irq_mask; - UINT8 m_irq_flag; - UINT8 m_port6; - UINT8 m_beep_mode; - UINT8 m_power_on; + uint8_t m_irq_mask; + uint8_t m_irq_flag; + uint8_t m_port6; + uint8_t m_beep_mode; + uint8_t m_power_on; virtual void machine_start() override; virtual void machine_reset() override; - 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); DECLARE_READ8_MEMBER( bankswitch_r ); DECLARE_WRITE8_MEMBER( bankswitch_w ); @@ -140,12 +140,12 @@ public: DECLARE_QUICKLOAD_LOAD_MEMBER(oz750); virtual void machine_reset() override; - UINT32 screen_update_oz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_oz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: - int oz_wzd_extract_tag(const std::vector &data, const char *tag, char *dest_buf); + int oz_wzd_extract_tag(const std::vector &data, const char *tag, char *dest_buf); - UINT16 m_kb_mask; + uint16_t m_kb_mask; }; @@ -208,7 +208,7 @@ WRITE8_MEMBER( rex6000_state::beep_w ) // the beeper frequency is update only if the bit 1 is set if (BIT(data, 1)) { - UINT16 div = ((m_beep_io[2] | m_beep_io[3]<<8) & 0x0fff) + 2; + uint16_t div = ((m_beep_io[2] | m_beep_io[3]<<8) & 0x0fff) + 2; m_beep->set_clock(16384 / div); } } @@ -300,9 +300,9 @@ WRITE8_MEMBER( rex6000_state::irq_w ) READ8_MEMBER( rex6000_state::touchscreen_r ) { - UINT16 x = m_pen_x->read(); - UINT16 y = m_pen_y->read(); - UINT16 battery = m_battery->read(); + uint16_t x = m_pen_x->read(); + uint16_t y = m_pen_y->read(); + uint16_t battery = m_battery->read(); switch (offset) { @@ -334,7 +334,7 @@ WRITE8_MEMBER( rex6000_state::touchscreen_w ) READ8_MEMBER( oz750_state::kb_status_r ) { - UINT8 data = 0x6b; + uint8_t data = 0x6b; if (m_battery->read() & 0x01) data |= 0x80; return data; @@ -342,7 +342,7 @@ READ8_MEMBER( oz750_state::kb_status_r ) READ8_MEMBER( oz750_state::kb_data_r ) { - UINT8 data = 0; + uint8_t data = 0; for(int i=0; i<10; i++) { if (m_kb_mask & (1<set_base((UINT8*)m_nvram + 0x4000); + membank("ram")->set_base((uint8_t*)m_nvram + 0x4000); } void rex6000_state::machine_reset() @@ -593,16 +593,16 @@ void oz750_state::machine_reset() m_kb_mask = 0; } -UINT32 rex6000_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rex6000_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 lcd_bank = MAKE_BANK(m_lcd_base[0], m_lcd_base[1]); + uint16_t lcd_bank = MAKE_BANK(m_lcd_base[0], m_lcd_base[1]); if (m_lcd_enabled) { for (int y=0; y<120; y++) for (int x=0; x<30; x++) { - UINT8 data = m_bankdev0->space(AS_PROGRAM).read_byte((lcd_bank << 13) + y*30 + x); + uint8_t data = m_bankdev0->space(AS_PROGRAM).read_byte((lcd_bank << 13) + y*30 + x); for (int b=0; b<8; b++) { @@ -619,16 +619,16 @@ UINT32 rex6000_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, return 0; } -UINT32 oz750_state::screen_update_oz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t oz750_state::screen_update_oz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 lcd_bank = MAKE_BANK(m_lcd_base[0], m_lcd_base[1]); + uint16_t lcd_bank = MAKE_BANK(m_lcd_base[0], m_lcd_base[1]); if (m_lcd_enabled && m_power_on) { for (int y=0; y<=cliprect.max_y; y++) for (int x=0; x<30; x++) { - UINT8 data = m_bankdev0->space(AS_PROGRAM).read_byte((lcd_bank << 13) + y*30 + x); + uint8_t data = m_bankdev0->space(AS_PROGRAM).read_byte((lcd_bank << 13) + y*30 + x); for (int b=0; b<8; b++) { @@ -703,9 +703,9 @@ PALETTE_INIT_MEMBER(rex6000_state, rex6000) QUICKLOAD_LOAD_MEMBER( rex6000_state,rex6000) { static const char magic[] = "ApplicationName:Addin"; - UINT32 img_start = 0; + uint32_t img_start = 0; - std::vector data(image.length()); + std::vector data(image.length()); image.fread(&data[0], image.length()); if(strncmp((const char*)&data[0], magic, 21)) @@ -714,16 +714,16 @@ QUICKLOAD_LOAD_MEMBER( rex6000_state,rex6000) img_start = strlen((const char*)&data[0]) + 5; img_start += 0xa0; //skip the icon (40x32 pixel) - for (UINT32 i=0; iwrite_raw(i, data[img_start + i]); return image_init_result::PASS; } -int oz750_state::oz_wzd_extract_tag(const std::vector &data, const char *tag, char *dest_buf) +int oz750_state::oz_wzd_extract_tag(const std::vector &data, const char *tag, char *dest_buf) { int tag_len = strlen(tag); - UINT32 img_start = 0; + uint32_t img_start = 0; for (img_start=0; img_start < data.size() - tag_len; img_start++) if (data[img_start] && !memcmp(&data[img_start], tag, tag_len)) break; @@ -742,7 +742,7 @@ int oz750_state::oz_wzd_extract_tag(const std::vector &data, const char * if (dest_buf) { - UINT32 i; + uint32_t i; for (i=0; data[img_start + i] != 0 && data[img_start + i] != '\n' && data[img_start + i] != '\r'; i++) dest_buf[i] = data[img_start + i]; @@ -755,7 +755,7 @@ int oz750_state::oz_wzd_extract_tag(const std::vector &data, const char * QUICKLOAD_LOAD_MEMBER(oz750_state,oz750) { address_space* flash = &machine().device("flash0a")->memory().space(0); - std::vector data(image.length()); + std::vector data(image.length()); image.fread(&data[0], image.length()); const char *fs_type = "BSIC"; @@ -772,14 +772,14 @@ QUICKLOAD_LOAD_MEMBER(oz750_state,oz750) if (!strncmp(file_name, "PFILE:", 6)) strcpy(file_name, file_name + 6); - UINT32 img_start = oz_wzd_extract_tag(data, "", nullptr); + uint32_t img_start = oz_wzd_extract_tag(data, "", nullptr); if (img_start == 0) return image_init_result::FAIL; - UINT16 icon_size = data[img_start++]; + uint16_t icon_size = data[img_start++]; - UINT32 pos = 0xc0000; + uint32_t pos = 0xc0000; flash->write_byte(pos++, 0x4f); for (int i=0; fs_type[i]; i++) @@ -808,7 +808,7 @@ QUICKLOAD_LOAD_MEMBER(oz750_state,oz750) for (int i=0, slen = strlen(app_name); i <= slen; i++) flash->write_byte(pos++, app_name[i]); // title - UINT16 size = (UINT16)image.length() - img_start; + uint16_t size = (uint16_t)image.length() - img_start; flash->write_byte(pos++, size); // data size LSB flash->write_byte(pos++, size >> 8); // data size MSB diff --git a/src/mame/drivers/rgum.cpp b/src/mame/drivers/rgum.cpp index 17033354017..145b5c64fc5 100644 --- a/src/mame/drivers/rgum.cpp +++ b/src/mame/drivers/rgum.cpp @@ -32,12 +32,12 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_vram; - required_shared_ptr m_cram; - UINT8 m_hbeat; + required_shared_ptr m_vram; + required_shared_ptr m_cram; + uint8_t m_hbeat; DECLARE_CUSTOM_INPUT_MEMBER(rgum_heartbeat_r); virtual void video_start() override; - UINT32 screen_update_royalgum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_royalgum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -48,7 +48,7 @@ void rgum_state::video_start() { } -UINT32 rgum_state::screen_update_royalgum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rgum_state::screen_update_royalgum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count; gfx_element *gfx = m_gfxdecode->gfx(0); diff --git a/src/mame/drivers/riscpc.cpp b/src/mame/drivers/riscpc.cpp index 8f04daeec3f..fa0d0771a90 100644 --- a/src/mame/drivers/riscpc.cpp +++ b/src/mame/drivers/riscpc.cpp @@ -36,32 +36,32 @@ public: DECLARE_WRITE32_MEMBER(a7000_iomd_w); DECLARE_WRITE32_MEMBER(a7000_vidc20_w); - UINT8 m_vidc20_pal_index; - UINT16 m_vidc20_horz_reg[0x10]; - UINT16 m_vidc20_vert_reg[0x10]; - UINT8 m_vidc20_bpp_mode; + uint8_t m_vidc20_pal_index; + uint16_t m_vidc20_horz_reg[0x10]; + uint16_t m_vidc20_vert_reg[0x10]; + uint8_t m_vidc20_bpp_mode; emu_timer *m_flyback_timer; - UINT16 m_timer_in[2]; - UINT16 m_timer_out[2]; + uint16_t m_timer_in[2]; + uint16_t m_timer_out[2]; int m_timer_counter[2]; emu_timer *m_IOMD_timer[2]; - UINT8 m_IRQ_status_A; - UINT8 m_IRQ_mask_A; - UINT8 m_IOMD_IO_ctrl; - UINT8 m_IOMD_keyb_ctrl; - UINT16 m_io_id; - UINT8 m_viddma_status; - UINT32 m_viddma_addr_start; - UINT32 m_viddma_addr_end; - UINT8 m_t0readinc; - UINT8 m_t1readinc; + uint8_t m_IRQ_status_A; + uint8_t m_IRQ_mask_A; + uint8_t m_IOMD_IO_ctrl; + uint8_t m_IOMD_keyb_ctrl; + uint16_t m_io_id; + uint8_t m_viddma_status; + uint32_t m_viddma_addr_start; + uint32_t m_viddma_addr_end; + uint8_t m_t0readinc; + uint8_t m_t1readinc; void fire_iomd_timer(int timer); void viddma_transfer_start(); void vidc20_dynamic_screen_change(); virtual void machine_reset() override; virtual void machine_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(IOMD_timer0_callback); TIMER_CALLBACK_MEMBER(IOMD_timer1_callback); TIMER_CALLBACK_MEMBER(flyback_timer_callback); @@ -272,12 +272,12 @@ WRITE32_MEMBER( riscpc_state::a7000_vidc20_w ) } } -UINT32 riscpc_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t riscpc_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x_size,y_size,x_start,y_start; int x,y,xi; - UINT32 count; - UINT8 *vram = memregion("vram")->base(); + uint32_t count; + uint8_t *vram = memregion("vram")->base(); bitmap.fill(m_palette->pen(0x100), cliprect); @@ -614,11 +614,11 @@ TIMER_CALLBACK_MEMBER(riscpc_state::flyback_timer_callback) void riscpc_state::viddma_transfer_start() { address_space &mem = m_maincpu->space(AS_PROGRAM); - UINT32 src = m_viddma_addr_start; - UINT32 dst = 0; - UINT32 size = m_viddma_addr_end; - UINT32 dma_index; - UINT8 *vram = memregion("vram")->base(); + uint32_t src = m_viddma_addr_start; + uint32_t dst = 0; + uint32_t size = m_viddma_addr_end; + uint32_t dma_index; + uint8_t *vram = memregion("vram")->base(); /* TODO: this should actually be a qword transfer */ for(dma_index = 0;dma_index < size;dma_index++) @@ -640,7 +640,7 @@ READ32_MEMBER( riscpc_state::a7000_iomd_r ) { case IOMD_IOCR: { - UINT8 flyback; + uint8_t flyback; int vert_pos; vert_pos = machine().first_screen()->vpos(); diff --git a/src/mame/drivers/rm380z.cpp b/src/mame/drivers/rm380z.cpp index cb08fd5017a..0604b07cde0 100644 --- a/src/mame/drivers/rm380z.cpp +++ b/src/mame/drivers/rm380z.cpp @@ -121,7 +121,7 @@ static SLOT_INTERFACE_START( rm380z_floppies ) SLOT_INTERFACE("sssd", FLOPPY_525_SSSD) SLOT_INTERFACE_END -UINT32 rm380z_state::screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rm380z_state::screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { update_screen(bitmap); return 0; diff --git a/src/mame/drivers/rmhaihai.cpp b/src/mame/drivers/rmhaihai.cpp index afdee1c615f..d55d122d7c5 100644 --- a/src/mame/drivers/rmhaihai.cpp +++ b/src/mame/drivers/rmhaihai.cpp @@ -51,8 +51,8 @@ public: required_device m_msm; required_device m_gfxdecode; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; int m_keyboard_cmd; @@ -72,7 +72,7 @@ public: DECLARE_MACHINE_START(themj); DECLARE_MACHINE_RESET(themj); - 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); TILE_GET_INFO_MEMBER(get_bg_tile_info); }; @@ -109,7 +109,7 @@ void rmhaihai_state::video_start() save_item(NAME(m_gfxbank)); } -UINT32 rmhaihai_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rmhaihai_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -676,7 +676,7 @@ ROM_END DRIVER_INIT_MEMBER(rmhaihai_state,rmhaihai) { - UINT8 *rom = memregion("gfx1")->base(); + uint8_t *rom = memregion("gfx1")->base(); int size = memregion("gfx1")->bytes(); int a,b; diff --git a/src/mame/drivers/rmnimbus.cpp b/src/mame/drivers/rmnimbus.cpp index 902655ac9ab..18c5ce61947 100644 --- a/src/mame/drivers/rmnimbus.cpp +++ b/src/mame/drivers/rmnimbus.cpp @@ -93,7 +93,7 @@ static ADDRESS_MAP_START( nimbus_iocpu_io , AS_IO, 8, rmnimbus_state ) AM_RANGE(0x20000, 0x20004) AM_READWRITE(nimbus_pc8031_port_r, nimbus_pc8031_port_w) ADDRESS_MAP_END -static const UINT16 def_config[16] = +static const uint16_t def_config[16] = { 0x0280, 0x017F, 0xE824, 0x8129, 0x0329, 0x0000, 0x0000, 0x0000, diff --git a/src/mame/drivers/rmt32.cpp b/src/mame/drivers/rmt32.cpp index 60116d4324e..192d4f32fa4 100644 --- a/src/mame/drivers/rmt32.cpp +++ b/src/mame/drivers/rmt32.cpp @@ -200,7 +200,7 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(mt32); - 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); DECLARE_WRITE8_MEMBER(bank_w); DECLARE_WRITE8_MEMBER(so_w); @@ -215,11 +215,11 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(samples_timer_cb); private: - UINT8 lcd_data_buffer[256]; + uint8_t lcd_data_buffer[256]; int lcd_data_buffer_pos; - UINT8 midi; + uint8_t midi; int midi_pos; - UINT8 port0; + uint8_t port0; required_device m_maincpu; }; @@ -234,13 +234,13 @@ mt32_state::mt32_state(const machine_config &mconfig, device_type type, const ch } -UINT32 mt32_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mt32_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0); - const UINT8 *data = lcd->render(); + const uint8_t *data = lcd->render(); for(int c=0; c<20; c++) for(int y=0; y<8; y++) { - UINT8 v = data[c*8+y]; + uint8_t v = data[c*8+y]; for(int x=0; x<5; x++) bitmap.pix16(y == 7 ? 8 : y, c*6+x) = v & (0x10 >> x) ? 1 : 0; } @@ -294,7 +294,7 @@ WRITE16_MEMBER(mt32_state::midi_w) TIMER_DEVICE_CALLBACK_MEMBER(mt32_state::midi_timer_cb) { - const static UINT8 midi_data[3] = { 0x91, 0x40, 0x7f }; + const static uint8_t midi_data[3] = { 0x91, 0x40, 0x7f }; midi = midi_data[midi_pos++]; logerror("midi_in %02x\n", midi); cpu->serial_w(midi); diff --git a/src/mame/drivers/rockrage.cpp b/src/mame/drivers/rockrage.cpp index 182c849eec8..481a38c7942 100644 --- a/src/mame/drivers/rockrage.cpp +++ b/src/mame/drivers/rockrage.cpp @@ -230,7 +230,7 @@ GFXDECODE_END void rockrage_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); m_rombank->configure_entries(0, 8, &ROM[0x10000], 0x2000); diff --git a/src/mame/drivers/rocnrope.cpp b/src/mame/drivers/rocnrope.cpp index 5393f2e656b..15fbc197f78 100644 --- a/src/mame/drivers/rocnrope.cpp +++ b/src/mame/drivers/rocnrope.cpp @@ -29,7 +29,7 @@ /* Roc'n'Rope has the IRQ vectors in RAM. The rom contains $FFFF at this address! */ WRITE8_MEMBER(rocnrope_state::rocnrope_interrupt_vector_w) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); RAM[0xfff2 + offset] = data; } diff --git a/src/mame/drivers/rohga.cpp b/src/mame/drivers/rohga.cpp index 9700e76d627..a310456c385 100644 --- a/src/mame/drivers/rohga.cpp +++ b/src/mame/drivers/rohga.cpp @@ -167,8 +167,8 @@ READ16_MEMBER( rohga_state::wf_protection_region_0_104_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco104->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco104->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -176,7 +176,7 @@ WRITE16_MEMBER( rohga_state::wf_protection_region_0_104_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco104->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -217,8 +217,8 @@ READ16_MEMBER( rohga_state::nb_protection_region_0_146_r ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -226,7 +226,7 @@ WRITE16_MEMBER( rohga_state::nb_protection_region_0_146_w ) { int real_address = 0 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -787,7 +787,7 @@ DECOSPR_COLOUR_CB_MEMBER(rohga_state::rohga_col_callback) DECOSPR_COLOUR_CB_MEMBER(rohga_state::schmeisr_col_callback) { - UINT16 colour = ((col >> 9) & 0xf) << 2; + uint16_t colour = ((col >> 9) & 0xf) << 2; if (col & 0x8000) colour++; @@ -1745,8 +1745,8 @@ DRIVER_INIT_MEMBER(rohga_state,nitrobal) DRIVER_INIT_MEMBER(rohga_state,schmeisr) { - const UINT8 *src = memregion("gfx2")->base(); - UINT8 *dst = memregion("gfx1")->base(); + const uint8_t *src = memregion("gfx2")->base(); + uint8_t *dst = memregion("gfx1")->base(); memcpy(dst, src, 0x20000); memcpy(dst + 0x20000, src + 0x80000, 0x20000); diff --git a/src/mame/drivers/rollerg.cpp b/src/mame/drivers/rollerg.cpp index 45aa58ec0dd..d146257fd32 100644 --- a/src/mame/drivers/rollerg.cpp +++ b/src/mame/drivers/rollerg.cpp @@ -216,7 +216,7 @@ WRITE_LINE_MEMBER(rollerg_state::rollerg_irq_ack_w) void rollerg_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 6, &ROM[0x10000], 0x4000); membank("bank1")->configure_entries(6, 2, &ROM[0x10000], 0x4000); diff --git a/src/mame/drivers/rollext.cpp b/src/mame/drivers/rollext.cpp index 0a01fc4e26e..e77fa721a9f 100644 --- a/src/mame/drivers/rollext.cpp +++ b/src/mame/drivers/rollext.cpp @@ -77,9 +77,9 @@ struct rollext_polydata { - UINT32 tex_bottom; - UINT32 tex_left; - UINT32 pal; + uint32_t tex_bottom; + uint32_t tex_left; + uint32_t pal; }; class rollext_renderer : public poly_manager @@ -91,42 +91,42 @@ public: m_fb = std::make_unique(1024, 1024); } - void render_texture_scan(INT32 scanline, const extent_t &extent, const rollext_polydata &extradata, int threadid); + void render_texture_scan(int32_t scanline, const extent_t &extent, const rollext_polydata &extradata, int threadid); - void set_texture_ram(UINT8* texture_ram); - void set_palette_ram(UINT16* palette_ram); - void process_display_list(UINT32* dispram); + void set_texture_ram(uint8_t* texture_ram); + void set_palette_ram(uint16_t* palette_ram); + void process_display_list(uint32_t* dispram); void clear_fb(); void display(bitmap_rgb32 *bitmap, const rectangle &cliprect); private: std::unique_ptr m_fb; - UINT8 *m_texture_ram; - UINT16 *m_palette_ram; + uint8_t *m_texture_ram; + uint16_t *m_palette_ram; }; -void rollext_renderer::set_texture_ram(UINT8* texture_ram) +void rollext_renderer::set_texture_ram(uint8_t* texture_ram) { m_texture_ram = texture_ram; } -void rollext_renderer::set_palette_ram(UINT16* palette_ram) +void rollext_renderer::set_palette_ram(uint16_t* palette_ram) { m_palette_ram = palette_ram; } -void rollext_renderer::render_texture_scan(INT32 scanline, const extent_t &extent, const rollext_polydata &extradata, int threadid) +void rollext_renderer::render_texture_scan(int32_t scanline, const extent_t &extent, const rollext_polydata &extradata, int threadid) { float u = extent.param[0].start; float v = extent.param[1].start; float du = extent.param[0].dpdx; float dv = extent.param[1].dpdx; - UINT32 *fb = &m_fb->pix32(scanline); + uint32_t *fb = &m_fb->pix32(scanline); - UINT32 texbot = extradata.tex_bottom; - UINT32 texleft = extradata.tex_left; + uint32_t texbot = extradata.tex_bottom; + uint32_t texleft = extradata.tex_left; int palnum = extradata.pal; @@ -135,9 +135,9 @@ void rollext_renderer::render_texture_scan(INT32 scanline, const extent_t &exten int iu = (int)(u * 29.0f); int iv = (int)(v * 29.0f); - UINT8 p = m_texture_ram[((texbot - iv) * 2048) + texleft + iu]; + uint8_t p = m_texture_ram[((texbot - iv) * 2048) + texleft + iu]; - UINT16 texel = m_palette_ram[(palnum * 256) + BYTE_XOR_BE(p)]; + uint16_t texel = m_palette_ram[(palnum * 256) + BYTE_XOR_BE(p)]; int r = ((texel >> 10) & 0x1f) << 3; int g = ((texel >> 5) & 0x1f) << 3; int b = (texel & 0x1f) << 3; @@ -149,7 +149,7 @@ void rollext_renderer::render_texture_scan(INT32 scanline, const extent_t &exten } } -void rollext_renderer::process_display_list(UINT32* disp_ram) +void rollext_renderer::process_display_list(uint32_t* disp_ram) { const rectangle& visarea = screen().visible_area(); @@ -220,8 +220,8 @@ void rollext_renderer::process_display_list(UINT32* disp_ram) for (int j=0; j < 4; j++) { - UINT32 ix = disp_ram[(ii + (j*0x10) + 0x4) / 4]; - UINT32 iy = disp_ram[(ii + (j*0x10) + 0xc) / 4]; + uint32_t ix = disp_ram[(ii + (j*0x10) + 0x4) / 4]; + uint32_t iy = disp_ram[(ii + (j*0x10) + 0xc) / 4]; vert[j].x = (int)((u2f(ix) / 2.0f) + 256.0f); vert[j].y = (int)((u2f(iy) / 2.0f) + 192.0f); @@ -290,9 +290,9 @@ public: } required_device m_maincpu; - required_shared_ptr m_palette_ram; - required_shared_ptr m_texture_mask; - required_shared_ptr m_disp_ram; + required_shared_ptr m_palette_ram; + required_shared_ptr m_texture_mask; + required_shared_ptr m_disp_ram; required_device m_screen; DECLARE_READ32_MEMBER(a0000000_r); @@ -301,7 +301,7 @@ public: DECLARE_WRITE32_MEMBER(cmd_callback); - std::unique_ptr m_texture; + std::unique_ptr m_texture; std::unique_ptr m_renderer; INTERRUPT_GEN_MEMBER(vblank_interrupt); @@ -310,12 +310,12 @@ public: virtual void machine_reset() override; virtual void video_start() override; void preprocess_texture_data(); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; void rollext_state::preprocess_texture_data() { - UINT8 *rom = (UINT8*)memregion("texture")->base(); + uint8_t *rom = (uint8_t*)memregion("texture")->base(); for (int j=0; j < 16384; j+=2) { @@ -335,19 +335,19 @@ void rollext_state::preprocess_texture_data() void rollext_state::video_start() { - m_texture = std::make_unique(0x2000000); + m_texture = std::make_unique(0x2000000); preprocess_texture_data(); m_renderer = std::make_unique(*m_screen); m_renderer->set_texture_ram(m_texture.get()); - m_renderer->set_palette_ram((UINT16*)&m_palette_ram[0]); + m_renderer->set_palette_ram((uint16_t*)&m_palette_ram[0]); } -UINT32 rollext_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t rollext_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { #if 0 - UINT16 *pal = (UINT16*)&m_palette_ram[0]; + uint16_t *pal = (uint16_t*)&m_palette_ram[0]; int palnum = 31; // 24,25,31 for basic font @@ -356,12 +356,12 @@ UINT32 rollext_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, int ii=0; for (int j=0; j < 384; j++) { - UINT32 *fb = &bitmap.pix32(j); + uint32_t *fb = &bitmap.pix32(j); for (int i=0; i < 512; i++) { - UINT8 p = m_texture[ii++]; + uint8_t p = m_texture[ii++]; - UINT16 rgb = pal[(palnum * 256) + BYTE_XOR_BE(p)]; + uint16_t rgb = pal[(palnum * 256) + BYTE_XOR_BE(p)]; int r = ((rgb >> 10) & 0x1f) << 3; int g = ((rgb >> 5) & 0x1f) << 3; int b = (rgb & 0x1f) << 3; @@ -389,7 +389,7 @@ READ32_MEMBER(rollext_state::a0000000_r) { case 0: // ?? { - UINT32 data = 0x20200; + uint32_t data = 0x20200; //data |= ioport("INPUTS1")->read(); //data |= 0xfff7fff7; @@ -424,7 +424,7 @@ READ32_MEMBER(rollext_state::b0000000_r) WRITE32_MEMBER(rollext_state::cmd_callback) { - UINT32 command = data; + uint32_t command = data; // PP0 if (command & 1) @@ -434,7 +434,7 @@ WRITE32_MEMBER(rollext_state::cmd_callback) // simulate PP behavior for now... space.write_dword(0x00000084, 3); - UINT32 num = space.read_dword(0x90); + uint32_t num = space.read_dword(0x90); int consume_num = num; if (consume_num > 32) @@ -444,7 +444,7 @@ WRITE32_MEMBER(rollext_state::cmd_callback) printf("0x00000084 = %08X\n", space.read_dword(0x84)); - UINT32 ra = 0x1000280; + uint32_t ra = 0x1000280; /* printf("FIFO push:\n"); @@ -456,7 +456,7 @@ WRITE32_MEMBER(rollext_state::cmd_callback) { for (int l=0; l < 4; l++) { - UINT32 dd = m_program->read_dword(ra); + uint32_t dd = m_program->read_dword(ra); ra += 4; printf("%08X(%f) ", dd, u2f(dd)); @@ -470,13 +470,13 @@ WRITE32_MEMBER(rollext_state::cmd_callback) ra = 0x1000280; int oldnum = space.read_dword(0x600ffffc); - UINT32 rb = 0x60000000 + (oldnum * 0x60); + uint32_t rb = 0x60000000 + (oldnum * 0x60); for (int i=0; i < consume_num; i++) { for (int k=0; k < 24; k++) { - UINT32 dd = space.read_dword(ra); + uint32_t dd = space.read_dword(ra); ra += 4; space.write_dword(rb, dd); diff --git a/src/mame/drivers/rotaryf.cpp b/src/mame/drivers/rotaryf.cpp index 98dcdd7810f..848fef29e59 100644 --- a/src/mame/drivers/rotaryf.cpp +++ b/src/mame/drivers/rotaryf.cpp @@ -34,18 +34,18 @@ public: required_device m_samples; required_device m_sn; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; DECLARE_READ8_MEMBER(port29_r); DECLARE_WRITE8_MEMBER(port28_w); DECLARE_WRITE8_MEMBER(port30_w); bool m_flipscreen; - UINT8 m_last; + uint8_t m_last; virtual void machine_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(rotaryf_interrupt); }; @@ -75,7 +75,7 @@ void rotaryf_state::machine_start() READ8_MEMBER( rotaryf_state::port29_r ) { - UINT8 data = ioport("INPUTS")->read(); + uint8_t data = ioport("INPUTS")->read(); if (m_flipscreen) return data; @@ -84,7 +84,7 @@ READ8_MEMBER( rotaryf_state::port29_r ) WRITE8_MEMBER( rotaryf_state::port28_w ) { - UINT8 rising_bits = data & ~m_last; + uint8_t rising_bits = data & ~m_last; if (BIT(rising_bits, 0)) m_samples->start (3, 7); /* Hit Saucer */ if (BIT(rising_bits, 2)) m_samples->start (5, 8); /* Bonus */ @@ -141,13 +141,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(rotaryf_state::rotaryf_interrupt) * *************************************/ -UINT32 rotaryf_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t rotaryf_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; pen_t pens[2]; pens[0] = rgb_t::black; pens[1] = rgb_t::white; - UINT8 i,x,y,data; + uint8_t i,x,y,data; for (offs = 0; offs < m_videoram.bytes(); offs++) { diff --git a/src/mame/drivers/roul.cpp b/src/mame/drivers/roul.cpp index 2e6814b95cc..3feedd95e9b 100644 --- a/src/mame/drivers/roul.cpp +++ b/src/mame/drivers/roul.cpp @@ -83,9 +83,9 @@ public: required_device m_soundcpu; required_device m_soundlatch; - UINT8 m_reg[0x10]; - std::unique_ptr m_videobuf; - UINT8 m_lamp_old; + uint8_t m_reg[0x10]; + std::unique_ptr m_videobuf; + uint8_t m_lamp_old; DECLARE_READ8_MEMBER(blitter_status_r); DECLARE_WRITE8_MEMBER(blitter_cmd_w); @@ -95,7 +95,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(roul); - 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); }; @@ -104,7 +104,7 @@ public: PALETTE_INIT_MEMBER(roul_state, roul) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit6, bit7, bit0, bit1, r, g, b; int i; @@ -225,14 +225,14 @@ ADDRESS_MAP_END void roul_state::video_start() { - m_videobuf = make_unique_clear(VIDEOBUF_SIZE); + m_videobuf = make_unique_clear(VIDEOBUF_SIZE); save_item(NAME(m_reg)); save_pointer(NAME(m_videobuf.get()), VIDEOBUF_SIZE); save_item(NAME(m_lamp_old)); } -UINT32 roul_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t roul_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i,j; for (i = 0; i < 256; i++) diff --git a/src/mame/drivers/route16.cpp b/src/mame/drivers/route16.cpp index 0c1dafe967b..57666b43422 100644 --- a/src/mame/drivers/route16.cpp +++ b/src/mame/drivers/route16.cpp @@ -149,7 +149,7 @@ WRITE8_MEMBER(route16_state::ttmahjng_input_port_matrix_w) READ8_MEMBER(route16_state::ttmahjng_input_port_matrix_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch (m_ttmahjng_port_select) { @@ -981,7 +981,7 @@ READ8_MEMBER(route16_state::routex_prot_read) DRIVER_INIT_MEMBER(route16_state,route16) { - UINT8 *ROM = memregion("cpu1")->base(); + uint8_t *ROM = memregion("cpu1")->base(); /* TO DO : Replace these patches with simulation of the protection device */ /* patch the protection */ @@ -998,7 +998,7 @@ DRIVER_INIT_MEMBER(route16_state,route16) DRIVER_INIT_MEMBER(route16_state,route16c) { - UINT8 *ROM = memregion("cpu1")->base(); + uint8_t *ROM = memregion("cpu1")->base(); /* Is this actually a bootleg? some of the protection has been removed */ @@ -1013,7 +1013,7 @@ DRIVER_INIT_MEMBER(route16_state,route16c) DRIVER_INIT_MEMBER(route16_state,route16a) { - UINT8 *ROM = memregion("cpu1")->base(); + uint8_t *ROM = memregion("cpu1")->base(); /* TO DO : Replace these patches with simulation of the protection device */ /* patch the protection */ diff --git a/src/mame/drivers/rowamet.cpp b/src/mame/drivers/rowamet.cpp index 5b850491fdc..8520da0c303 100644 --- a/src/mame/drivers/rowamet.cpp +++ b/src/mame/drivers/rowamet.cpp @@ -45,13 +45,13 @@ public: DECLARE_WRITE8_MEMBER(io_w); TIMER_DEVICE_CALLBACK_MEMBER(timer_a); private: - UINT8 m_out_offs; - UINT8 m_sndcmd; - UINT8 m_io[16]; + uint8_t m_out_offs; + uint8_t m_sndcmd; + uint8_t m_io[16]; virtual void machine_reset() override; required_device m_maincpu; required_device m_cpu2; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; }; @@ -177,7 +177,7 @@ WRITE8_MEMBER( rowamet_state::io_w ) if (offset == 2) { - UINT8 cmd = (m_io[2]>>4) | (m_io[3] & 0xf0); + uint8_t cmd = (m_io[2]>>4) | (m_io[3] & 0xf0); if (cmd != m_sndcmd) { m_sndcmd = cmd; @@ -188,7 +188,7 @@ WRITE8_MEMBER( rowamet_state::io_w ) void rowamet_state::machine_reset() { - UINT8 i; + uint8_t i; m_out_offs = 0; m_sndcmd = 0; for (i = 0; i < 16; i++) @@ -197,10 +197,10 @@ void rowamet_state::machine_reset() TIMER_DEVICE_CALLBACK_MEMBER( rowamet_state::timer_a ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7446 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7446 m_out_offs &= 15; - UINT8 digit = m_out_offs << 1; + uint8_t digit = m_out_offs << 1; output().set_digit_value(digit, patterns[m_p_ram[m_out_offs]>>4]); output().set_digit_value(++digit, patterns[m_p_ram[m_out_offs++]&15]); } diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp index 3b287790e55..9d72c8b8754 100644 --- a/src/mame/drivers/royalmah.cpp +++ b/src/mame/drivers/royalmah.cpp @@ -115,26 +115,26 @@ public: m_soundlatch(*this, "soundlatch") { } required_device m_maincpu; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; optional_device m_audiocpu; optional_device m_rtc; optional_device m_soundlatch; - UINT8 m_input_port_select; - UINT8 m_dsw_select; - UINT8 m_rombank; + uint8_t m_input_port_select; + uint8_t m_dsw_select; + uint8_t m_rombank; int m_palette_base; - std::unique_ptr m_janptr96_nvram; - UINT8 m_suzume_bank; - UINT8 m_gfx_adr_l; - UINT8 m_gfx_adr_m; - UINT8 m_gfx_adr_h; - UINT32 m_gfx_adr; - UINT8 m_gfxdata0; - UINT8 m_gfxdata1; - UINT8 m_jansou_colortable[16]; - UINT8 m_mjifb_rom_enable; - UINT8 m_flip_screen; + std::unique_ptr m_janptr96_nvram; + uint8_t m_suzume_bank; + uint8_t m_gfx_adr_l; + uint8_t m_gfx_adr_m; + uint8_t m_gfx_adr_h; + uint32_t m_gfx_adr; + uint8_t m_gfxdata0; + uint8_t m_gfxdata1; + uint8_t m_jansou_colortable[16]; + uint8_t m_mjifb_rom_enable; + uint8_t m_flip_screen; DECLARE_WRITE8_MEMBER(royalmah_palbank_w); DECLARE_WRITE8_MEMBER(royalmah_rom_w); @@ -210,7 +210,7 @@ public: DECLARE_DRIVER_INIT(ippatsu); DECLARE_PALETTE_INIT(royalmah); DECLARE_PALETTE_INIT(mjderngr); - UINT32 screen_update_royalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_royalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(suzume_irq); INTERRUPT_GEN_MEMBER(mjtensin_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(janptr96_interrupt); @@ -224,14 +224,14 @@ public: PALETTE_INIT_MEMBER(royalmah_state, royalmah) { offs_t i; - const UINT8 *prom = memregion("proms")->base(); + const uint8_t *prom = memregion("proms")->base(); int len = memregion("proms")->bytes(); for (i = 0; i < len; i++) { - UINT8 bit0, bit1, bit2, r, g, b; + uint8_t bit0, bit1, bit2, r, g, b; - UINT8 data = prom[i]; + uint8_t data = prom[i]; /* red component */ bit0 = (data >> 0) & 0x01; @@ -258,17 +258,17 @@ PALETTE_INIT_MEMBER(royalmah_state, royalmah) PALETTE_INIT_MEMBER(royalmah_state,mjderngr) { offs_t i; - const UINT8 *prom = memregion("proms")->base(); + const uint8_t *prom = memregion("proms")->base(); int len = memregion("proms")->bytes(); for (i = 0; i < len / 2; i++) { - UINT16 data = (prom[i] << 8) | prom[i + 0x200]; + uint16_t data = (prom[i] << 8) | prom[i + 0x200]; /* the bits are in reverse order */ - UINT8 r = BITSWAP8((data >> 0) & 0x1f,7,6,5,0,1,2,3,4 ); - UINT8 g = BITSWAP8((data >> 5) & 0x1f,7,6,5,0,1,2,3,4 ); - UINT8 b = BITSWAP8((data >> 10) & 0x1f,7,6,5,0,1,2,3,4 ); + uint8_t r = BITSWAP8((data >> 0) & 0x1f,7,6,5,0,1,2,3,4 ); + uint8_t g = BITSWAP8((data >> 5) & 0x1f,7,6,5,0,1,2,3,4 ); + uint8_t b = BITSWAP8((data >> 10) & 0x1f,7,6,5,0,1,2,3,4 ); palette.set_pen_color(i, pal5bit(r), pal5bit(g), pal5bit(b)); } @@ -304,9 +304,9 @@ WRITE8_MEMBER(royalmah_state::mjderngr_palbank_w) } -UINT32 royalmah_state::screen_update_royalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t royalmah_state::screen_update_royalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; offs_t offs; @@ -314,15 +314,15 @@ UINT32 royalmah_state::screen_update_royalmah(screen_device &screen, bitmap_ind1 { int i; - UINT8 data1 = videoram[offs + 0x0000]; - UINT8 data2 = videoram[offs + 0x4000]; + uint8_t data1 = videoram[offs + 0x0000]; + uint8_t data2 = videoram[offs + 0x4000]; - UINT8 y = (m_flip_screen) ? 255 - (offs >> 6) : (offs >> 6); - UINT8 x = (m_flip_screen) ? 255 - (offs << 2) : (offs << 2); + uint8_t y = (m_flip_screen) ? 255 - (offs >> 6) : (offs >> 6); + uint8_t x = (m_flip_screen) ? 255 - (offs << 2) : (offs << 2); for (i = 0; i < 4; i++) { - UINT8 pen = ((data2 >> 1) & 0x08) | ((data2 << 2) & 0x04) | ((data1 >> 3) & 0x02) | ((data1 >> 0) & 0x01); + uint8_t pen = ((data2 >> 1) & 0x08) | ((data2 << 2) & 0x04) | ((data1 >> 3) & 0x02) | ((data1 >> 0) & 0x01); bitmap.pix16(y, x) = (m_palette_base << 4) | pen; @@ -412,7 +412,7 @@ READ8_MEMBER(royalmah_state::suzume_dsw_r) WRITE8_MEMBER(royalmah_state::tahjong_bank_w) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int address; logerror("%04x: bank %02x\n",space.device().safe_pc(),data); @@ -427,7 +427,7 @@ logerror("%04x: bank %02x\n",space.device().safe_pc(),data); WRITE8_MEMBER(royalmah_state::suzume_bank_w) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int address; m_suzume_bank = data; @@ -443,7 +443,7 @@ logerror("%04x: bank %02x\n",space.device().safe_pc(),data); WRITE8_MEMBER(royalmah_state::mjapinky_bank_w) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); m_rombank = data; membank("bank1")->set_base(ROM + 0x10000 + 0x8000 * data); } @@ -464,7 +464,7 @@ READ8_MEMBER(royalmah_state::mjapinky_dsw_r) WRITE8_MEMBER(royalmah_state::tontonb_bank_w) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int address; logerror("%04x: bank %02x\n",space.device().safe_pc(),data); @@ -482,7 +482,7 @@ logerror("%04x: bank %02x\n",space.device().safe_pc(),data); /* bits 5 and 6 seem to affect which Dip Switch to read in 'majs101b' */ WRITE8_MEMBER(royalmah_state::dynax_bank_w) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int address; //logerror("%04x: bank %02x\n",space.device().safe_pc(),data); @@ -511,7 +511,7 @@ READ8_MEMBER(royalmah_state::daisyari_dsw_r) WRITE8_MEMBER(royalmah_state::daisyari_bank_w) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int address; m_dsw_select = (data & 0xc); @@ -539,7 +539,7 @@ READ8_MEMBER(royalmah_state::mjclub_dsw_r) WRITE8_MEMBER(royalmah_state::mjclub_bank_w) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int address; m_dsw_select = data & 0xc0; @@ -783,7 +783,7 @@ WRITE8_MEMBER(royalmah_state::jansou_6402_w) READ8_MEMBER(royalmah_state::jansou_6403_r) { - UINT8 *GFXROM = memregion("gfx1")->base(); + uint8_t *GFXROM = memregion("gfx1")->base(); int d0 = GFXROM[m_gfx_adr]; int d1 = GFXROM[m_gfx_adr+1]; int c0 = m_jansou_colortable[d1 & 0x0f] & 0x0f; @@ -882,7 +882,7 @@ READ8_MEMBER(royalmah_state::janptr96_dsw_r) WRITE8_MEMBER(royalmah_state::janptr96_rombank_w) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->set_base(ROM + 0x10000 + 0x8000 * data); } @@ -934,7 +934,7 @@ WRITE8_MEMBER(royalmah_state::mjifb_coin_counter_w) READ8_MEMBER(royalmah_state::mjifb_rom_io_r) { if (m_mjifb_rom_enable) - return ((UINT8*)(memregion("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset]; + return ((uint8_t*)(memregion("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset]; offset += 0x8000; @@ -952,7 +952,7 @@ READ8_MEMBER(royalmah_state::mjifb_rom_io_r) WRITE8_MEMBER(royalmah_state::mjifb_rom_io_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; if (m_mjifb_rom_enable) { videoram[offset] = data; @@ -980,7 +980,7 @@ WRITE8_MEMBER(royalmah_state::mjifb_rom_io_w) WRITE8_MEMBER(royalmah_state::mjifb_videoram_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; videoram[offset + 0x4000] = data; } @@ -1043,7 +1043,7 @@ ADDRESS_MAP_END READ8_MEMBER(royalmah_state::mjdejavu_rom_io_r) { if (m_mjifb_rom_enable) - return ((UINT8*)(memregion("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset]; + return ((uint8_t*)(memregion("maincpu")->base() + 0x10000 + m_rombank * 0x4000))[offset]; offset += 0x8000; @@ -1061,7 +1061,7 @@ READ8_MEMBER(royalmah_state::mjdejavu_rom_io_r) WRITE8_MEMBER(royalmah_state::mjdejavu_rom_io_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; if (m_mjifb_rom_enable) { videoram[offset] = data; @@ -1244,7 +1244,7 @@ READ8_MEMBER(royalmah_state::mjvegasa_rom_io_r) WRITE8_MEMBER(royalmah_state::mjvegasa_rom_io_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; if ((m_rombank & 0x70) != 0x70) { videoram[offset] = data; @@ -4909,7 +4909,7 @@ DRIVER_INIT_MEMBER(royalmah_state,ippatsu) DRIVER_INIT_MEMBER(royalmah_state,janptr96) { - m_janptr96_nvram = std::make_unique(0x1000 * 9); + m_janptr96_nvram = std::make_unique(0x1000 * 9); membank("bank3")->set_base(m_janptr96_nvram.get()); machine().device("nvram")->set_base(m_janptr96_nvram.get(), 0x1000 * 9); } diff --git a/src/mame/drivers/rpunch.cpp b/src/mame/drivers/rpunch.cpp index 112c0f38874..c709755b7cf 100644 --- a/src/mame/drivers/rpunch.cpp +++ b/src/mame/drivers/rpunch.cpp @@ -151,7 +151,7 @@ WRITE_LINE_MEMBER(rpunch_state::ym2151_irq_gen) void rpunch_state::machine_reset() { - UINT8 *snd = memregion("upd")->base(); + uint8_t *snd = memregion("upd")->base(); memcpy(snd, snd + 0x20000, 0x20000); } @@ -215,7 +215,7 @@ WRITE8_MEMBER(rpunch_state::upd_control_w) { if ((data & 1) != m_upd_rom_bank) { - UINT8 *snd = memregion("upd")->base(); + uint8_t *snd = memregion("upd")->base(); m_upd_rom_bank = data & 1; memcpy(snd, snd + 0x20000 * (m_upd_rom_bank + 1), 0x20000); } diff --git a/src/mame/drivers/rt1715.cpp b/src/mame/drivers/rt1715.cpp index 680487f7344..f3c1ac92e6d 100644 --- a/src/mame/drivers/rt1715.cpp +++ b/src/mame/drivers/rt1715.cpp @@ -82,7 +82,7 @@ READ8_MEMBER(rt1715_state::k7658_led2_r) /* read key state */ READ8_MEMBER(rt1715_state::k7658_data_r) { - UINT8 result = 0xff; + uint8_t result = 0xff; if (BIT(offset, 0)) result &= ioport("row_00")->read(); if (BIT(offset, 1)) result &= ioport("row_10")->read(); diff --git a/src/mame/drivers/runaway.cpp b/src/mame/drivers/runaway.cpp index aabcf2c7a51..56169afc1cf 100644 --- a/src/mame/drivers/runaway.cpp +++ b/src/mame/drivers/runaway.cpp @@ -47,7 +47,7 @@ void runaway_state::machine_reset() READ8_MEMBER(runaway_state::runaway_input_r) { - UINT8 val = 0; + uint8_t val = 0; if (ioport("3000D7")->read() & (1 << offset)) { diff --git a/src/mame/drivers/rungun.cpp b/src/mame/drivers/rungun.cpp index 7cddd63714e..9be2143f413 100644 --- a/src/mame/drivers/rungun.cpp +++ b/src/mame/drivers/rungun.cpp @@ -50,7 +50,7 @@ READ16_MEMBER(rungun_state::rng_sysregs_r) { - UINT16 data = 0; + uint16_t data = 0; switch (offset) { @@ -68,7 +68,7 @@ READ16_MEMBER(rungun_state::rng_sysregs_r) bit9 : screen output select */ { - UINT8 field_bit = machine().first_screen()->frame_number() & 1; + uint8_t field_bit = machine().first_screen()->frame_number() & 1; if(m_single_screen_mode == true) field_bit = 1; return (ioport("SYSTEM")->read() & 0xfdff) | (field_bit << 9); @@ -170,7 +170,7 @@ INTERRUPT_GEN_MEMBER(rungun_state::rng_interrupt) READ8_MEMBER(rungun_state::rng_53936_rom_r) { // TODO: odd addresses returns ...? - UINT32 rom_addr = offset; + uint32_t rom_addr = offset; rom_addr+= (m_roz_rombase)*0x20000; return m_roz_rom[rom_addr]; } @@ -183,10 +183,10 @@ READ16_MEMBER(rungun_state::palette_read) WRITE16_MEMBER(rungun_state::palette_write) { palette_device &cur_paldevice = m_video_mux_bank == 0 ? *m_palette : *m_palette2; - UINT32 addr = offset + m_video_mux_bank*0x800/2; + uint32_t addr = offset + m_video_mux_bank*0x800/2; COMBINE_DATA(&m_pal_ram[addr]); - UINT8 r,g,b; + uint8_t r,g,b; r = m_pal_ram[addr] & 0x1f; g = (m_pal_ram[addr] & 0x3e0) >> 5; @@ -383,13 +383,13 @@ GFXDECODE_END void rungun_state::machine_start() { - UINT8 *ROM = memregion("soundcpu")->base(); + uint8_t *ROM = memregion("soundcpu")->base(); m_roz_rom = memregion("gfx1")->base(); membank("bank2")->configure_entries(0, 8, &ROM[0x10000], 0x4000); - m_banked_ram = make_unique_clear(0x2000); - m_pal_ram = make_unique_clear(0x800*2); + m_banked_ram = make_unique_clear(0x2000); + m_pal_ram = make_unique_clear(0x800*2); membank("spriteram_bank")->configure_entries(0,2,&m_banked_ram[0],0x2000); @@ -404,7 +404,7 @@ void rungun_state::machine_reset() m_k054539_1->init_flags(k054539_device::REVERSE_STEREO); memset(m_sysreg, 0, 0x20); - //memset(m_ttl_vram, 0, 0x1000 * sizeof(UINT16)); + //memset(m_ttl_vram, 0, 0x1000 * sizeof(uint16_t)); m_sound_ctrl = 0; m_sound_status = 0; diff --git a/src/mame/drivers/rvoice.cpp b/src/mame/drivers/rvoice.cpp index 5fc455da10e..2b3b3ffb79b 100644 --- a/src/mame/drivers/rvoice.cpp +++ b/src/mame/drivers/rvoice.cpp @@ -24,53 +24,53 @@ struct hd63701y0_t { - UINT8 data[8]; - UINT8 P1DDR; - UINT8 P2DDR; - UINT8 PORT1; - UINT8 PORT2; - UINT8 P3DDR; - UINT8 P4DDR; - UINT8 PORT3; - UINT8 PORT4; - UINT8 TCSR1; - UINT8 FRCH; - UINT8 FRCL; - UINT8 OCR1H; - UINT8 OCR1L; - UINT8 ICRH; - UINT8 ICRL; - UINT8 TCSR2; - UINT8 RMCR; - UINT8 TRCSR1; - UINT8 RDR; - UINT8 TDR; - UINT8 RP5CR; - UINT8 PORT5; - UINT8 P6DDR; - UINT8 PORT6; - UINT8 PORT7; - UINT8 OCR2H; - UINT8 OCR2L; - UINT8 TCSR3; - UINT8 TCONR; - UINT8 T2CNT; - UINT8 TRCSR2; - UINT8 TSTREG; - UINT8 P5DDR; - UINT8 P6CSR; + uint8_t data[8]; + uint8_t P1DDR; + uint8_t P2DDR; + uint8_t PORT1; + uint8_t PORT2; + uint8_t P3DDR; + uint8_t P4DDR; + uint8_t PORT3; + uint8_t PORT4; + uint8_t TCSR1; + uint8_t FRCH; + uint8_t FRCL; + uint8_t OCR1H; + uint8_t OCR1L; + uint8_t ICRH; + uint8_t ICRL; + uint8_t TCSR2; + uint8_t RMCR; + uint8_t TRCSR1; + uint8_t RDR; + uint8_t TDR; + uint8_t RP5CR; + uint8_t PORT5; + uint8_t P6DDR; + uint8_t PORT6; + uint8_t PORT7; + uint8_t OCR2H; + uint8_t OCR2L; + uint8_t TCSR3; + uint8_t TCONR; + uint8_t T2CNT; + uint8_t TRCSR2; + uint8_t TSTREG; + uint8_t P5DDR; + uint8_t P6CSR; }; struct rvoicepc_t { - UINT8 data[8]; - UINT8 port1; - UINT8 port2; - UINT8 port3; - UINT8 port4; - UINT8 port5; - UINT8 port6; - UINT8 port7; + uint8_t data[8]; + uint8_t port1; + uint8_t port2; + uint8_t port3; + uint8_t port4; + uint8_t port5; + uint8_t port6; + uint8_t port7; }; class rvoice_state : public driver_device @@ -138,7 +138,7 @@ void rvoice_state::machine_reset() READ8_MEMBER(rvoice_state::main_hd63701_internal_registers_r) { - UINT8 data = 0; + uint8_t data = 0; logerror("main hd637B01Y0: %04x: read from 0x%02X: ", space.device().safe_pc(), offset); switch(offset) { diff --git a/src/mame/drivers/rx78.cpp b/src/mame/drivers/rx78.cpp index cabc14f649c..7a94d61b1bc 100644 --- a/src/mame/drivers/rx78.cpp +++ b/src/mame/drivers/rx78.cpp @@ -73,14 +73,14 @@ public: DECLARE_WRITE8_MEMBER( vdp_reg_w ); DECLARE_WRITE8_MEMBER( vdp_bg_reg_w ); DECLARE_WRITE8_MEMBER( vdp_pri_mask_w ); - UINT8 m_vram_read_bank; - UINT8 m_vram_write_bank; - UINT8 m_pal_reg[7]; - UINT8 m_pri_mask; - UINT8 m_key_mux; + uint8_t m_vram_read_bank; + uint8_t m_vram_write_bank; + uint8_t m_pal_reg[7]; + uint8_t m_pri_mask; + uint8_t m_key_mux; virtual void machine_reset() override; virtual void video_start() override; - 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); DECLARE_DRIVER_INIT(rx78); required_device m_maincpu; required_device m_cass; @@ -109,9 +109,9 @@ void rx78_state::video_start() { } -UINT32 rx78_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t rx78_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *vram = memregion("vram")->base(); + uint8_t *vram = memregion("vram")->base(); int x,y,count; bitmap.fill(16, cliprect); @@ -189,7 +189,7 @@ WRITE8_MEMBER( rx78_state::key_w ) READ8_MEMBER( rx78_state::rx78_vram_r ) { - UINT8 *vram = memregion("vram")->base(); + uint8_t *vram = memregion("vram")->base(); if(m_vram_read_bank == 0 || m_vram_read_bank > 6) return 0xff; @@ -199,7 +199,7 @@ READ8_MEMBER( rx78_state::rx78_vram_r ) WRITE8_MEMBER( rx78_state::rx78_vram_w ) { - UINT8 *vram = memregion("vram")->base(); + uint8_t *vram = memregion("vram")->base(); if(m_vram_write_bank & 0x01) { vram[offset + 0 * 0x2000] = data; } if(m_vram_write_bank & 0x02) { vram[offset + 1 * 0x2000] = data; } @@ -221,7 +221,7 @@ WRITE8_MEMBER( rx78_state::vram_write_bank_w ) WRITE8_MEMBER( rx78_state::vdp_reg_w ) { - UINT8 r,g,b,res,i; + uint8_t r,g,b,res,i; m_pal_reg[offset] = data; @@ -416,7 +416,7 @@ void rx78_state::machine_reset() DEVICE_IMAGE_LOAD_MEMBER( rx78_state, rx78_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size != 0x2000 && size != 0x4000) { @@ -500,7 +500,7 @@ ROM_END DRIVER_INIT_MEMBER(rx78_state,rx78) { - UINT32 ram_size = m_ram->size(); + uint32_t ram_size = m_ram->size(); address_space &prg = m_maincpu->space(AS_PROGRAM); if (ram_size == 0x4000) diff --git a/src/mame/drivers/s11.cpp b/src/mame/drivers/s11.cpp index 4ee8972f1a8..dea9973c703 100644 --- a/src/mame/drivers/s11.cpp +++ b/src/mame/drivers/s11.cpp @@ -222,7 +222,7 @@ WRITE8_MEMBER( s11_state::lamp0_w ) WRITE8_MEMBER( s11_state::dig0_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 data &= 0x7f; m_strobe = data & 15; m_diag = (data & 0x70) >> 4; @@ -244,7 +244,7 @@ WRITE8_MEMBER( s11_state::dig1_w ) READ8_MEMBER( s11_state::pia28_w7_r ) { - UINT8 ret = 0x80; + uint8_t ret = 0x80; ret |= m_strobe; ret |= m_diag << 4; @@ -364,7 +364,7 @@ WRITE8_MEMBER( s11_state::pia40_pb_w ) DRIVER_INIT_MEMBER( s11_state, s11 ) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank0")->configure_entries(0, 2, &ROM[0x10000], 0x4000); membank("bank1")->configure_entries(0, 2, &ROM[0x18000], 0x4000); membank("bank0")->set_entry(0); diff --git a/src/mame/drivers/s11a.cpp b/src/mame/drivers/s11a.cpp index e53d0b28a0b..deace020d64 100644 --- a/src/mame/drivers/s11a.cpp +++ b/src/mame/drivers/s11a.cpp @@ -160,7 +160,7 @@ WRITE8_MEMBER( s11a_state::bgbank_w ) DRIVER_INIT_MEMBER( s11a_state, s11a ) { - UINT8 *BGROM = memregion("bgcpu")->base(); + uint8_t *BGROM = memregion("bgcpu")->base(); membank("bgbank")->configure_entries(0, 4, &BGROM[0x10000], 0x8000); membank("bgbank")->set_entry(0); s11_state::init_s11(); diff --git a/src/mame/drivers/s11b.cpp b/src/mame/drivers/s11b.cpp index b7f2b29aa9a..8b42d53a30d 100644 --- a/src/mame/drivers/s11b.cpp +++ b/src/mame/drivers/s11b.cpp @@ -165,7 +165,7 @@ WRITE8_MEMBER( s11b_state::bg_speech_digit_w ) WRITE8_MEMBER( s11b_state::dig1_w ) { - UINT32 seg = get_segment2(); + uint32_t seg = get_segment2(); seg |= data; seg |= 0x20000; if((seg & 0x70000) == 0x30000) @@ -181,7 +181,7 @@ WRITE8_MEMBER( s11b_state::dig1_w ) WRITE8_MEMBER( s11b_state::pia2c_pa_w ) { - UINT32 seg = get_segment1(); + uint32_t seg = get_segment1(); seg |= (data<<8); seg |= 0x10000; if((seg & 0x70000) == 0x30000) @@ -197,7 +197,7 @@ WRITE8_MEMBER( s11b_state::pia2c_pa_w ) WRITE8_MEMBER( s11b_state::pia2c_pb_w ) { - UINT32 seg = get_segment1(); + uint32_t seg = get_segment1(); seg |= data; seg |= 0x20000; if((seg & 0x70000) == 0x30000) @@ -213,7 +213,7 @@ WRITE8_MEMBER( s11b_state::pia2c_pb_w ) WRITE8_MEMBER( s11b_state::pia34_pa_w ) { - UINT32 seg = get_segment2(); + uint32_t seg = get_segment2(); seg |= (data<<8); seg |= 0x10000; if((seg & 0x70000) == 0x30000) diff --git a/src/mame/drivers/s11c.cpp b/src/mame/drivers/s11c.cpp index 7e8b231cafc..8a60990ca51 100644 --- a/src/mame/drivers/s11c.cpp +++ b/src/mame/drivers/s11c.cpp @@ -123,7 +123,7 @@ INPUT_PORTS_END /* WRITE8_MEMBER( s11c_state::bgbank_w ) { - UINT8 bank = ((data & 0x04) >> 2) | ((data & 0x03) << 1); + uint8_t bank = ((data & 0x04) >> 2) | ((data & 0x03) << 1); membank("bgbank")->set_entry(bank); // popmessage("BG bank set to %02x (%i)",data,bank); } @@ -138,7 +138,7 @@ MACHINE_RESET_MEMBER( s11c_state, s11c ) DRIVER_INIT_MEMBER(s11c_state,s11c) { emu_timer* timer = timer_alloc(TIMER_IRQ); -// UINT8 *BGROM = memregion("bgcpu")->base(); +// uint8_t *BGROM = memregion("bgcpu")->base(); // membank("bgbank")->configure_entries(0, 8, &BGROM[0x10000], 0x8000); // membank("bgbank")->set_entry(0); set_invert(true); diff --git a/src/mame/drivers/s3.cpp b/src/mame/drivers/s3.cpp index 84917d56cce..6de95947d94 100644 --- a/src/mame/drivers/s3.cpp +++ b/src/mame/drivers/s3.cpp @@ -85,10 +85,10 @@ public: DECLARE_MACHINE_RESET(s3); DECLARE_MACHINE_RESET(s3a); private: - UINT8 m_t_c; - UINT8 m_sound_data; - UINT8 m_strobe; - UINT8 m_kbdrow; + uint8_t m_t_c; + uint8_t m_sound_data; + uint8_t m_strobe; + uint8_t m_kbdrow; bool m_data_ok; bool m_chimes; required_device m_maincpu; @@ -309,7 +309,7 @@ WRITE8_MEMBER( s3_state::sol1_w ) } else { - UINT8 sound_data = ioport("SND")->read(); // 0xff or 0xbf + uint8_t sound_data = ioport("SND")->read(); // 0xff or 0xbf if (BIT(data, 0)) sound_data &= 0xfe; @@ -385,7 +385,7 @@ WRITE8_MEMBER( s3_state::dig0_w ) WRITE8_MEMBER( s3_state::dig1_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 if (m_data_ok) { output().set_digit_value(m_strobe+16, patterns[data&15]); diff --git a/src/mame/drivers/s4.cpp b/src/mame/drivers/s4.cpp index c40ee218900..815658df96c 100644 --- a/src/mame/drivers/s4.cpp +++ b/src/mame/drivers/s4.cpp @@ -80,10 +80,10 @@ public: DECLARE_MACHINE_RESET(s4); DECLARE_MACHINE_RESET(s4a); private: - UINT8 m_t_c; - UINT8 m_sound_data; - UINT8 m_strobe; - UINT8 m_kbdrow; + uint8_t m_t_c; + uint8_t m_sound_data; + uint8_t m_strobe; + uint8_t m_kbdrow; bool m_data_ok; bool m_chimes; required_device m_maincpu; @@ -304,7 +304,7 @@ WRITE8_MEMBER( s4_state::sol1_w ) } else { - UINT8 sound_data = ioport("SND")->read(); + uint8_t sound_data = ioport("SND")->read(); if (BIT(data, 0)) sound_data &= 0xfe; @@ -380,7 +380,7 @@ WRITE8_MEMBER( s4_state::dig0_w ) WRITE8_MEMBER( s4_state::dig1_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 if (m_data_ok) { output().set_digit_value(m_strobe+16, patterns[data&15]); diff --git a/src/mame/drivers/s6.cpp b/src/mame/drivers/s6.cpp index ec30173edaf..56b97ca0700 100644 --- a/src/mame/drivers/s6.cpp +++ b/src/mame/drivers/s6.cpp @@ -95,9 +95,9 @@ public: DECLARE_MACHINE_RESET(s6); DECLARE_DRIVER_INIT(s6); private: - UINT8 m_sound_data; - UINT8 m_strobe; - UINT8 m_kbdrow; + uint8_t m_sound_data; + uint8_t m_strobe; + uint8_t m_kbdrow; bool m_data_ok; emu_timer* m_irq_timer; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -255,7 +255,7 @@ WRITE8_MEMBER( s6_state::sol0_w ) WRITE8_MEMBER( s6_state::sol1_w ) { - UINT8 sound_data = ioport("SND")->read(); + uint8_t sound_data = ioport("SND")->read(); if (BIT(data, 0)) sound_data &= 0xfe; @@ -319,7 +319,7 @@ WRITE8_MEMBER( s6_state::dig0_w ) WRITE8_MEMBER( s6_state::dig1_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 if (m_data_ok) { output().set_digit_value(m_strobe+20, patterns[data&15]); diff --git a/src/mame/drivers/s6a.cpp b/src/mame/drivers/s6a.cpp index ba773a02cc2..6dbf99ef3db 100644 --- a/src/mame/drivers/s6a.cpp +++ b/src/mame/drivers/s6a.cpp @@ -88,9 +88,9 @@ public: DECLARE_MACHINE_RESET(s6a); DECLARE_DRIVER_INIT(s6a); private: - UINT8 m_sound_data; - UINT8 m_strobe; - UINT8 m_kbdrow; + uint8_t m_sound_data; + uint8_t m_strobe; + uint8_t m_kbdrow; bool m_data_ok; emu_timer* m_irq_timer; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -238,7 +238,7 @@ WRITE8_MEMBER( s6a_state::sol0_w ) WRITE8_MEMBER( s6a_state::sol1_w ) { - UINT8 sound_data = ioport("SND")->read(); + uint8_t sound_data = ioport("SND")->read(); if (BIT(data, 0)) sound_data &= 0xfe; @@ -302,7 +302,7 @@ WRITE8_MEMBER( s6a_state::dig0_w ) WRITE8_MEMBER( s6a_state::dig1_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 if (m_data_ok) { output().set_digit_value(m_strobe+16, patterns[data&15]); diff --git a/src/mame/drivers/s7.cpp b/src/mame/drivers/s7.cpp index 0af41fade45..3f981999d7b 100644 --- a/src/mame/drivers/s7.cpp +++ b/src/mame/drivers/s7.cpp @@ -113,10 +113,10 @@ public: DECLARE_MACHINE_RESET(s7); DECLARE_DRIVER_INIT(s7); private: - UINT8 m_sound_data; - UINT8 m_strobe; - UINT8 m_kbdrow; - UINT8 m_nvram[0x100]; + uint8_t m_sound_data; + uint8_t m_strobe; + uint8_t m_kbdrow; + uint8_t m_nvram[0x100]; bool m_data_ok; bool m_memprotect; emu_timer* m_irq_timer; @@ -280,7 +280,7 @@ WRITE8_MEMBER( s7_state::sol3_w ) WRITE8_MEMBER( s7_state::sound_w ) { - UINT8 sound_data = (ioport("SND")->read() & 0xe0) | (data & 0x1f); + uint8_t sound_data = (ioport("SND")->read() & 0xe0) | (data & 0x1f); bool cb1 = ((sound_data & 0x9f) != 0x9f); @@ -296,7 +296,7 @@ WRITE8_MEMBER( s7_state::lamp0_w ) WRITE8_MEMBER( s7_state::dig0_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 m_strobe = data & 15; data ^= 0xf0; // inverted by ic33 m_data_ok = true; @@ -305,7 +305,7 @@ WRITE8_MEMBER( s7_state::dig0_w ) WRITE8_MEMBER( s7_state::dig1_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 if (m_data_ok) { output().set_digit_value(m_strobe+16, patterns[data&15]); diff --git a/src/mame/drivers/s8.cpp b/src/mame/drivers/s8.cpp index 8e1328b2310..c6dbc08c966 100644 --- a/src/mame/drivers/s8.cpp +++ b/src/mame/drivers/s8.cpp @@ -88,9 +88,9 @@ public: DECLARE_MACHINE_RESET(s8); DECLARE_DRIVER_INIT(s8); private: - UINT8 m_sound_data; - UINT8 m_strobe; - UINT8 m_kbdrow; + uint8_t m_sound_data; + uint8_t m_strobe; + uint8_t m_kbdrow; bool m_data_ok; emu_timer* m_irq_timer; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -217,7 +217,7 @@ WRITE8_MEMBER( s8_state::lamp0_w ) WRITE8_MEMBER( s8_state::dig0_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 data &= 0x7f; m_strobe = data & 15; m_data_ok = true; @@ -226,7 +226,7 @@ WRITE8_MEMBER( s8_state::dig0_w ) WRITE8_MEMBER( s8_state::dig1_w ) { - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 if (m_data_ok) { output().set_digit_value(m_strobe+16, patterns[data&15]); diff --git a/src/mame/drivers/s8a.cpp b/src/mame/drivers/s8a.cpp index 3645cdbaa02..0ff9c40f1f3 100644 --- a/src/mame/drivers/s8a.cpp +++ b/src/mame/drivers/s8a.cpp @@ -64,9 +64,9 @@ public: DECLARE_MACHINE_RESET(s8a); DECLARE_DRIVER_INIT(s8a); private: - UINT8 m_sound_data; - UINT8 m_strobe; - UINT8 m_kbdrow; + uint8_t m_sound_data; + uint8_t m_strobe; + uint8_t m_kbdrow; bool m_data_ok; emu_timer* m_irq_timer; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -189,7 +189,7 @@ WRITE8_MEMBER( s8a_state::lamp0_w ) WRITE8_MEMBER( s8a_state::dig0_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 data &= 0x7f; m_strobe = data & 15; m_data_ok = true; @@ -198,7 +198,7 @@ WRITE8_MEMBER( s8a_state::dig0_w ) WRITE8_MEMBER( s8a_state::dig1_w ) { - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 if (m_data_ok) { output().set_digit_value(m_strobe+16, patterns[data&15]); diff --git a/src/mame/drivers/s9.cpp b/src/mame/drivers/s9.cpp index 3e9a3d4e42d..f3a345fada5 100644 --- a/src/mame/drivers/s9.cpp +++ b/src/mame/drivers/s9.cpp @@ -77,9 +77,9 @@ public: DECLARE_MACHINE_RESET(s9); DECLARE_DRIVER_INIT(s9); private: - UINT8 m_sound_data; - UINT8 m_strobe; - UINT8 m_kbdrow; + uint8_t m_sound_data; + uint8_t m_strobe; + uint8_t m_kbdrow; bool m_data_ok; emu_timer* m_irq_timer; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -225,7 +225,7 @@ WRITE_LINE_MEMBER( s9_state::pia21_ca2_w ) WRITE8_MEMBER( s9_state::dig0_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // 7447 data &= 0x7f; m_strobe = data & 15; m_data_ok = true; @@ -234,7 +234,7 @@ WRITE8_MEMBER( s9_state::dig0_w ) WRITE8_MEMBER( s9_state::dig1_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558 if (m_data_ok) { output().set_digit_value(m_strobe+16, patterns[data&15]); diff --git a/src/mame/drivers/sacstate.cpp b/src/mame/drivers/sacstate.cpp index d7891cfe4e3..d10e813daca 100644 --- a/src/mame/drivers/sacstate.cpp +++ b/src/mame/drivers/sacstate.cpp @@ -57,14 +57,14 @@ public: DECLARE_READ8_MEMBER(port04_r); DECLARE_WRITE8_MEMBER(port08_w); DECLARE_WRITE8_MEMBER(kbd_put); - UINT8 m_term_data; - UINT8 m_val; + uint8_t m_term_data; + uint8_t m_val; virtual void machine_reset() override; }; READ8_MEMBER( sacstate_state::port01_r ) { - UINT8 ret = m_val; + uint8_t ret = m_val; if (m_term_data) ret |= 0x04; // data in return ret; @@ -72,7 +72,7 @@ READ8_MEMBER( sacstate_state::port01_r ) READ8_MEMBER( sacstate_state::port00_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/safarir.cpp b/src/mame/drivers/safarir.cpp index 0da98a56b71..c61cdab8199 100644 --- a/src/mame/drivers/safarir.cpp +++ b/src/mame/drivers/safarir.cpp @@ -67,17 +67,17 @@ public: required_device m_maincpu; required_device m_samples; - required_shared_ptr m_ram; - required_shared_ptr m_bg_scroll; + required_shared_ptr m_ram; + required_shared_ptr m_bg_scroll; required_device m_gfxdecode; - std::unique_ptr m_ram_1; - std::unique_ptr m_ram_2; - UINT8 m_ram_bank; + std::unique_ptr m_ram_1; + std::unique_ptr m_ram_2; + uint8_t m_ram_bank; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_port_last; - UINT8 m_port_last2; + uint8_t m_port_last; + uint8_t m_port_last2; DECLARE_WRITE8_MEMBER(ram_w); DECLARE_READ8_MEMBER(ram_r); @@ -88,7 +88,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(safarir); - UINT32 screen_update_safarir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_safarir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -163,7 +163,7 @@ TILE_GET_INFO_MEMBER(safarir_state::get_bg_tile_info) { int color; address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 code = ram_r(space,tile_index | 0x400); + uint8_t code = ram_r(space,tile_index | 0x400); if (code & 0x80) color = 6; /* yellow */ @@ -185,7 +185,7 @@ TILE_GET_INFO_MEMBER(safarir_state::get_fg_tile_info) { int color, flags; address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 code = ram_r(space,tile_index); + uint8_t code = ram_r(space,tile_index); if (code & 0x80) color = 7; /* white */ @@ -207,7 +207,7 @@ void safarir_state::video_start() } -UINT32 safarir_state::screen_update_safarir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t safarir_state::screen_update_safarir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, *m_bg_scroll); @@ -245,7 +245,7 @@ UINT32 safarir_state::screen_update_safarir(screen_device &screen, bitmap_ind16 WRITE8_MEMBER(safarir_state::safarir_audio_w) { - UINT8 rising_bits = data & ~m_port_last; + uint8_t rising_bits = data & ~m_port_last; if (rising_bits == 0x12) m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1_1); if (rising_bits == 0x02) m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1_2); @@ -316,8 +316,8 @@ MACHINE_CONFIG_END void safarir_state::machine_start() { - m_ram_1 = std::make_unique(m_ram.bytes()); - m_ram_2 = std::make_unique(m_ram.bytes()); + m_ram_1 = std::make_unique(m_ram.bytes()); + m_ram_2 = std::make_unique(m_ram.bytes()); m_port_last = 0; m_port_last2 = 0; diff --git a/src/mame/drivers/sage2.cpp b/src/mame/drivers/sage2.cpp index 68e714fa708..3276c2d0fc4 100644 --- a/src/mame/drivers/sage2.cpp +++ b/src/mame/drivers/sage2.cpp @@ -37,7 +37,7 @@ READ8_MEMBER( sage2_state::read ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_reset || (offset >= 0xfe0000 && offset < 0xff4000)) { @@ -296,7 +296,7 @@ READ8_MEMBER( sage2_state::ppi1_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // floppy interrupt data = m_fdc->get_irq(); diff --git a/src/mame/drivers/samcoupe.cpp b/src/mame/drivers/samcoupe.cpp index 945d02e64f1..8ade082cadb 100644 --- a/src/mame/drivers/samcoupe.cpp +++ b/src/mame/drivers/samcoupe.cpp @@ -117,7 +117,7 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_disk_w) READ8_MEMBER(samcoupe_state::samcoupe_pen_r) { screen_device *scr = machine().first_screen(); - UINT8 data; + uint8_t data; if (offset & 0x100) { @@ -145,7 +145,7 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_clut_w) READ8_MEMBER(samcoupe_state::samcoupe_status_r) { - UINT8 data = 0xe0; + uint8_t data = 0xe0; /* bit 5-7, keyboard input */ if (!BIT(offset, 8)) data &= m_keyboard_row_fe->read() & 0xe0; @@ -220,7 +220,7 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_midi_w) READ8_MEMBER(samcoupe_state::samcoupe_keyboard_r) { - UINT8 data = 0x1f; + uint8_t data = 0x1f; /* bit 0-4, keyboard input */ if (!BIT(offset, 8)) data &= m_keyboard_row_fe->read() & 0x1f; @@ -345,7 +345,7 @@ TIMER_CALLBACK_MEMBER(samcoupe_state::irq_off) } -void samcoupe_state::samcoupe_irq(UINT8 src) +void samcoupe_state::samcoupe_irq(uint8_t src) { /* assert irq and a timer to set it off again */ m_maincpu->set_input_line(0, ASSERT_LINE); @@ -488,9 +488,9 @@ PALETTE_INIT_MEMBER(samcoupe_state, samcoupe) { for (int i = 0; i < 128; i++) { - UINT8 b = BIT(i, 0) * 2 + BIT(i, 4) * 4 + BIT(i, 3); - UINT8 r = BIT(i, 1) * 2 + BIT(i, 5) * 4 + BIT(i, 3); - UINT8 g = BIT(i, 2) * 2 + BIT(i, 6) * 4 + BIT(i, 3); + uint8_t b = BIT(i, 0) * 2 + BIT(i, 4) * 4 + BIT(i, 3); + uint8_t r = BIT(i, 1) * 2 + BIT(i, 5) * 4 + BIT(i, 3); + uint8_t g = BIT(i, 2) * 2 + BIT(i, 6) * 4 + BIT(i, 3); r <<= 5; g <<= 5; diff --git a/src/mame/drivers/sandscrp.cpp b/src/mame/drivers/sandscrp.cpp index 16da2fd9722..6ada148276e 100644 --- a/src/mame/drivers/sandscrp.cpp +++ b/src/mame/drivers/sandscrp.cpp @@ -105,11 +105,11 @@ public: required_device m_soundlatch; required_device m_soundlatch2; - UINT8 m_sprite_irq; - UINT8 m_unknown_irq; - UINT8 m_vblank_irq; - UINT8 m_latch1_full; - UINT8 m_latch2_full; + uint8_t m_sprite_irq; + uint8_t m_unknown_irq; + uint8_t m_vblank_irq; + uint8_t m_latch1_full; + uint8_t m_latch2_full; DECLARE_READ16_MEMBER(irq_cause_r); DECLARE_WRITE16_MEMBER(irq_cause_w); @@ -125,7 +125,7 @@ public: virtual void machine_start() override; - 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); void screen_eof(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(interrupt); @@ -134,7 +134,7 @@ public: -UINT32 sandscrp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sandscrp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); diff --git a/src/mame/drivers/sangho.cpp b/src/mame/drivers/sangho.cpp index d43984fd84d..5acaf1e6400 100644 --- a/src/mame/drivers/sangho.cpp +++ b/src/mame/drivers/sangho.cpp @@ -69,10 +69,10 @@ public: , m_bank8(*this, "bank8") { } - std::unique_ptr m_ram; - UINT8 m_sexyboom_bank[8]; - UINT8 m_pzlestar_mem_bank; - UINT8 m_pzlestar_rom_bank; + std::unique_ptr m_ram; + uint8_t m_sexyboom_bank[8]; + uint8_t m_pzlestar_mem_bank; + uint8_t m_pzlestar_rom_bank; required_device m_v9958; required_device m_maincpu; required_memory_region m_region_user1; @@ -84,7 +84,7 @@ public: required_memory_bank m_bank6; required_memory_bank m_bank7; required_memory_bank m_bank8; - UINT8 m_sec_slot[4]; + uint8_t m_sec_slot[4]; DECLARE_WRITE8_MEMBER(pzlestar_bank_w); DECLARE_WRITE8_MEMBER(pzlestar_mem_bank_w); @@ -225,8 +225,8 @@ void sangho_state::sexyboom_map_bank(int bank) memory_bank *read_bank[4] = { m_bank1, m_bank2, m_bank3, m_bank4 }; memory_bank *write_bank[4] = { m_bank5, m_bank6, m_bank7, m_bank8 }; - UINT8 banknum = m_sexyboom_bank[bank*2]; - UINT8 banktype = m_sexyboom_bank[bank*2 + 1]; + uint8_t banknum = m_sexyboom_bank[bank*2]; + uint8_t banktype = m_sexyboom_bank[bank*2 + 1]; if (banktype == 0) { @@ -424,7 +424,7 @@ INPUT_PORTS_END void sangho_state::machine_start() { - m_ram = std::make_unique(0x20000); // TODO: define how much RAM these ones have (MSX2+ can potentially go up to 4MB) + m_ram = std::make_unique(0x20000); // TODO: define how much RAM these ones have (MSX2+ can potentially go up to 4MB) } MACHINE_RESET_MEMBER(sangho_state,pzlestar) @@ -529,7 +529,7 @@ ROM_END DRIVER_INIT_MEMBER(sangho_state,pzlestar) { - UINT8 *ROM = m_region_user1->base(); + uint8_t *ROM = m_region_user1->base(); /* patch nasty looping check, related to sound? */ ROM[0x12ca7] = 0x00; diff --git a/src/mame/drivers/sanremmg.cpp b/src/mame/drivers/sanremmg.cpp index baa88cbd757..d16bbd61ca4 100644 --- a/src/mame/drivers/sanremmg.cpp +++ b/src/mame/drivers/sanremmg.cpp @@ -23,7 +23,7 @@ public: required_device m_maincpu; virtual void video_start() override; - UINT32 screen_update_sanremmg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sanremmg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -32,7 +32,7 @@ void sanremmg_state::video_start() { } -UINT32 sanremmg_state::screen_update_sanremmg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sanremmg_state::screen_update_sanremmg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/sanremo.cpp b/src/mame/drivers/sanremo.cpp index 06bd4c0e5a9..ed4706e0571 100644 --- a/src/mame/drivers/sanremo.cpp +++ b/src/mame/drivers/sanremo.cpp @@ -114,9 +114,9 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; - UINT8 m_attrram[0x800]; + uint8_t m_attrram[0x800]; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(sanremo_videoram_w); TILE_GET_INFO_MEMBER(get_sanremo_tile_info); @@ -125,7 +125,7 @@ public: int banksel; virtual void video_start() override; DECLARE_PALETTE_INIT(sanremo); - UINT32 screen_update_sanremo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sanremo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -157,7 +157,7 @@ void sanremo_state::video_start() } -UINT32 sanremo_state::screen_update_sanremo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sanremo_state::screen_update_sanremo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/sapi1.cpp b/src/mame/drivers/sapi1.cpp index a389456c315..bd4a9591b7e 100644 --- a/src/mame/drivers/sapi1.cpp +++ b/src/mame/drivers/sapi1.cpp @@ -58,7 +58,7 @@ public: { } - optional_shared_ptr m_p_videoram; + optional_shared_ptr m_p_videoram; DECLARE_READ8_MEMBER(sapi1_keyboard_r); DECLARE_WRITE8_MEMBER(sapi1_keyboard_w); DECLARE_READ8_MEMBER(sapi2_keyboard_status_r); @@ -74,13 +74,13 @@ public: DECLARE_MACHINE_RESET(sapi1); DECLARE_MACHINE_RESET(sapizps3); MC6845_UPDATE_ROW(crtc_update_row); - UINT32 screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sapi3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sapi3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: - UINT8 m_term_data; - UINT8 m_keyboard_mask; - UINT8 m_refresh_counter; - UINT8 m_zps3_25; + uint8_t m_term_data; + uint8_t m_keyboard_mask; + uint8_t m_refresh_counter; + uint8_t m_zps3_25; optional_memory_bank m_bank1; // Only for sapi3 required_ioport m_line0; required_ioport m_line1; @@ -92,7 +92,7 @@ public: optional_device m_palette; }; -static const UINT8 MHB2501[] = { +static const uint8_t MHB2501[] = { 0x0c,0x11,0x13,0x15,0x17,0x10,0x0e,0x00, // @ 0x04,0x0a,0x11,0x11,0x1f,0x11,0x11,0x00, // A 0x1e,0x11,0x11,0x1e,0x11,0x11,0x1e,0x00, // B @@ -301,11 +301,11 @@ INPUT_PORTS_END **************************************/ -UINT32 sapi1_state::screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sapi1_state::screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bool val; - UINT16 addr,xpos; - UINT8 chr,attr,ra,x,y,b; + uint16_t addr,xpos; + uint8_t chr,attr,ra,x,y,b; for(y = 0; y < 24; y++ ) { @@ -354,11 +354,11 @@ UINT32 sapi1_state::screen_update_sapi1(screen_device &screen, bitmap_ind16 &bit } // The attributes seem to be different on this one, they need to be understood, so disabled for now -UINT32 sapi1_state::screen_update_sapi3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sapi1_state::screen_update_sapi3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bool val; - UINT16 addr,xpos; - UINT8 chr,attr,ra,x,y,b; + uint16_t addr,xpos; + uint8_t chr,attr,ra,x,y,b; for(y = 0; y < 20; y++ ) { @@ -411,9 +411,9 @@ UINT32 sapi1_state::screen_update_sapi3(screen_device &screen, bitmap_ind16 &bit MC6845_UPDATE_ROW( sapi1_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx,inv; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx,inv; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { @@ -443,7 +443,7 @@ MC6845_UPDATE_ROW( sapi1_state::crtc_update_row ) READ8_MEMBER( sapi1_state::sapi1_keyboard_r ) { - UINT8 key = 0xff; + uint8_t key = 0xff; if (BIT(m_keyboard_mask, 0)) { key &= m_line0->read(); } if (BIT(m_keyboard_mask, 1)) { key &= m_line1->read(); } if (BIT(m_keyboard_mask, 2)) { key &= m_line2->read(); } @@ -464,7 +464,7 @@ READ8_MEMBER( sapi1_state::sapi2_keyboard_status_r) READ8_MEMBER( sapi1_state::sapi2_keyboard_data_r) { - UINT8 ret = ~m_term_data; + uint8_t ret = ~m_term_data; m_term_data = 0; return ret; } @@ -516,19 +516,19 @@ MACHINE_RESET_MEMBER( sapi1_state, sapizps3 ) DRIVER_INIT_MEMBER( sapi1_state, sapizps3 ) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); m_bank1->configure_entries(0, 2, &RAM[0x0000], 0x10000); } DRIVER_INIT_MEMBER( sapi1_state, sapizps3a ) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); m_bank1->configure_entries(0, 2, &RAM[0x0000], 0xf800); } DRIVER_INIT_MEMBER( sapi1_state, sapizps3b ) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); m_bank1->configure_entries(0, 2, &RAM[0x0000], 0x10000); } diff --git a/src/mame/drivers/saturn.cpp b/src/mame/drivers/saturn.cpp index 43d4f6193ea..0ff04737435 100644 --- a/src/mame/drivers/saturn.cpp +++ b/src/mame/drivers/saturn.cpp @@ -581,7 +581,7 @@ INPUT_PORTS_END /* TODO: if you change the driver configuration then NVRAM contents gets screwed, needs mods in MAME framework */ void sat_console_state::nvram_init(nvram_device &nvram, void *data, size_t size) { - static const UINT8 init[64] = { + static const uint8_t init[64] = { 'B', 'a', 'c', 'k', 'U', 'p', 'R', 'a', 'm', ' ', 'F', 'o', 'r', 'm', 'a', 't', 'B', 'a', 'c', 'k', 'U', 'p', 'R', 'a', 'm', ' ', 'F', 'o', 'r', 'm', 'a', 't', 'B', 'a', 'c', 'k', 'U', 'p', 'R', 'a', 'm', ' ', 'F', 'o', 'r', 'm', 'a', 't', @@ -913,9 +913,9 @@ void sat_console_state::saturn_init_driver(int rgn) m_minit_boost_timeslice = attotime::zero; m_sinit_boost_timeslice = attotime::zero; - m_scu_regs = make_unique_clear(0x100/4); - m_scsp_regs = make_unique_clear(0x1000/2); - m_backupram = make_unique_clear(0x8000); + m_scu_regs = make_unique_clear(0x100/4); + m_scsp_regs = make_unique_clear(0x1000/2); + m_backupram = make_unique_clear(0x8000); } DRIVER_INIT_MEMBER(sat_console_state,saturnus) diff --git a/src/mame/drivers/sauro.cpp b/src/mame/drivers/sauro.cpp index 6e10a1718fa..0a16a00dcf9 100644 --- a/src/mame/drivers/sauro.cpp +++ b/src/mame/drivers/sauro.cpp @@ -716,7 +716,7 @@ DRIVER_INIT_MEMBER(sauro_state,tecfri) /* This game doesn't like all memory to be initialized to zero, it won't initialize the high scores */ - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); memset(&RAM[0xe000], 0, 0x100); RAM[0xe000] = 1; diff --git a/src/mame/drivers/savia84.cpp b/src/mame/drivers/savia84.cpp index b094410cd95..d13777b51ec 100644 --- a/src/mame/drivers/savia84.cpp +++ b/src/mame/drivers/savia84.cpp @@ -49,10 +49,10 @@ public: DECLARE_WRITE8_MEMBER(savia84_8255_porta_w); DECLARE_WRITE8_MEMBER(savia84_8255_portb_w); DECLARE_WRITE8_MEMBER(savia84_8255_portc_w); - UINT8 m_kbd; - UINT8 m_segment; - UINT8 m_digit; - UINT8 m_digit_last; + uint8_t m_kbd; + uint8_t m_segment; + uint8_t m_digit; + uint8_t m_digit_last; virtual void machine_reset() override; }; diff --git a/src/mame/drivers/savquest.cpp b/src/mame/drivers/savquest.cpp index 77cb34fcc37..69f4a5d8601 100644 --- a/src/mame/drivers/savquest.cpp +++ b/src/mame/drivers/savquest.cpp @@ -64,13 +64,13 @@ public: { } - std::unique_ptr m_bios_f0000_ram; - std::unique_ptr m_bios_e0000_ram; - std::unique_ptr m_bios_e4000_ram; - std::unique_ptr m_bios_e8000_ram; - std::unique_ptr m_bios_ec000_ram; + std::unique_ptr m_bios_f0000_ram; + std::unique_ptr m_bios_e0000_ram; + std::unique_ptr m_bios_e4000_ram; + std::unique_ptr m_bios_e8000_ram; + std::unique_ptr m_bios_ec000_ram; - std::unique_ptr m_smram; + std::unique_ptr m_smram; required_device m_vga; required_device m_voodoo; @@ -85,14 +85,14 @@ public: HASPSTATE_READ }; int m_hasp_passind; - UINT8 m_hasp_tmppass[0x29]; - UINT8 m_port379; + uint8_t m_hasp_tmppass[0x29]; + uint8_t m_port379; int m_hasp_passmode; int m_hasp_prodind; - UINT8 m_mtxc_config_reg[256]; - UINT8 m_piix4_config_reg[8][256]; - UINT32 m_pci_3dfx_regs[0x40]; + uint8_t m_mtxc_config_reg[256]; + uint8_t m_piix4_config_reg[8][256]; + uint32_t m_pci_3dfx_regs[0x40]; DECLARE_WRITE32_MEMBER( bios_f0000_ram_w ); DECLARE_WRITE32_MEMBER( bios_e0000_ram_w ); @@ -122,7 +122,7 @@ public: // Intel 82439TX System Controller (MTXC) -static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) { savquest_state *state = busdevice->machine().driver_data(); // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); @@ -136,7 +136,7 @@ static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, return state->m_mtxc_config_reg[reg]; } -static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { savquest_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); @@ -214,12 +214,12 @@ void savquest_state::intel82439tx_init() m_mtxc_config_reg[0x63] = 0x02; m_mtxc_config_reg[0x64] = 0x02; m_mtxc_config_reg[0x65] = 0x02; - m_smram = std::make_unique(0x20000); + m_smram = std::make_unique(0x20000); } -static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; @@ -239,7 +239,7 @@ static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -261,7 +261,7 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) -static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { savquest_state *state = busdevice->machine().driver_data(); // osd_printf_debug("PIIX4: read %d, %02X\n", function, reg); @@ -281,16 +281,16 @@ static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, return state->m_piix4_config_reg[function][reg]; } -static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { savquest_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); state->m_piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= piix4_config_r(busdevice, device, function, reg + 3) << 24; @@ -310,7 +310,7 @@ static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -339,14 +339,14 @@ void savquest_state::vid_3dfx_init() m_voodoo->voodoo_set_init_enable(0x4000); //INITEN_SECONDARY_REV_ID } -static UINT32 pci_3dfx_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t pci_3dfx_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { //osd_printf_warning("PCI read: %x\n", reg); savquest_state *state = busdevice->machine().driver_data(); return state->m_pci_3dfx_regs[reg / 4]; } -static void pci_3dfx_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void pci_3dfx_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { osd_printf_warning("PCI write: %x %x\n", reg, data); @@ -423,8 +423,8 @@ WRITE32_MEMBER(savquest_state::bios_ec000_ram_w) #endif } -static const UINT8 m_hasp_cmppass[] = {0xc3, 0xd9, 0xd3, 0xfb, 0x9d, 0x89, 0xb9, 0xa1, 0xb3, 0xc1, 0xf1, 0xcd, 0xdf, 0x9d}; /* 0x9d or 0x9e */ -static const UINT8 m_hasp_prodinfo[] = {0x51, 0x4c, 0x52, 0x4d, 0x53, 0x4e, 0x53, 0x4e, 0x53, 0x49, 0x53, 0x48, 0x53, 0x4b, 0x53, 0x4a, +static const uint8_t m_hasp_cmppass[] = {0xc3, 0xd9, 0xd3, 0xfb, 0x9d, 0x89, 0xb9, 0xa1, 0xb3, 0xc1, 0xf1, 0xcd, 0xdf, 0x9d}; /* 0x9d or 0x9e */ +static const uint8_t m_hasp_prodinfo[] = {0x51, 0x4c, 0x52, 0x4d, 0x53, 0x4e, 0x53, 0x4e, 0x53, 0x49, 0x53, 0x48, 0x53, 0x4b, 0x53, 0x4a, 0x53, 0x43, 0x53, 0x45, 0x52, 0x46, 0x53, 0x43, 0x53, 0x41, 0xac, 0x40, 0x53, 0xbc, 0x53, 0x42, 0x53, 0x57, 0x53, 0x5d, 0x52, 0x5e, 0x53, 0x5b, 0x53, 0x59, 0xac, 0x58, 0x53, 0xa4 }; @@ -489,7 +489,7 @@ WRITE8_MEMBER(savquest_state::parallel_port_w) { if (!offset) { - UINT8 data8 = (UINT8) (data & 0xff); + uint8_t data8 = (uint8_t) (data & 0xff); /* state machine to determine when password is about to be entered */ @@ -769,11 +769,11 @@ INPUT_PORTS_END void savquest_state::machine_start() { - m_bios_f0000_ram = std::make_unique(0x10000/4); - m_bios_e0000_ram = std::make_unique(0x4000/4); - m_bios_e4000_ram = std::make_unique(0x4000/4); - m_bios_e8000_ram = std::make_unique(0x4000/4); - m_bios_ec000_ram = std::make_unique(0x4000/4); + m_bios_f0000_ram = std::make_unique(0x10000/4); + m_bios_e0000_ram = std::make_unique(0x4000/4); + m_bios_e4000_ram = std::make_unique(0x4000/4); + m_bios_e8000_ram = std::make_unique(0x4000/4); + m_bios_ec000_ram = std::make_unique(0x4000/4); intel82439tx_init(); vid_3dfx_init(); diff --git a/src/mame/drivers/sbc6510.cpp b/src/mame/drivers/sbc6510.cpp index 9d78fe0ed0d..725c0aa0ac6 100644 --- a/src/mame/drivers/sbc6510.cpp +++ b/src/mame/drivers/sbc6510.cpp @@ -76,9 +76,9 @@ public: DECLARE_READ8_MEMBER(psg_b_r); DECLARE_WRITE8_MEMBER(key_w); DECLARE_READ8_MEMBER(key_r); - UINT8 m_term_data; - UINT8 m_key_row; - UINT8 m_2; + uint8_t m_term_data; + uint8_t m_key_row; + uint8_t m_2; virtual void machine_start() override; virtual void machine_reset() override; @@ -243,7 +243,7 @@ READ8_MEMBER( sbc6510_state::psg_b_r ) READ8_MEMBER( sbc6510_state::key_r ) { - UINT8 data=0; + uint8_t data=0; for (int i = 0; i < 8; i++) { diff --git a/src/mame/drivers/sbowling.cpp b/src/mame/drivers/sbowling.cpp index cae22968ecf..2d0ad09d251 100644 --- a/src/mame/drivers/sbowling.cpp +++ b/src/mame/drivers/sbowling.cpp @@ -57,16 +57,16 @@ public: m_gfxdecode(*this, "gfxdecode") { } required_device m_maincpu; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_gfxdecode; int m_bgmap; int m_system; tilemap_t *m_tilemap; std::unique_ptr m_tmpbitmap; - UINT32 m_color_prom_address; - UINT8 m_pix_sh; - UINT8 m_pix[2]; + uint32_t m_color_prom_address; + uint8_t m_pix_sh; + uint8_t m_pix[2]; DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_WRITE8_MEMBER(pix_shift_w); @@ -82,13 +82,13 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(sbowling); - 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); void postload(); }; TILE_GET_INFO_MEMBER(sbowling_state::get_tile_info) { - UINT8 *rom = memregion("user1")->base(); + uint8_t *rom = memregion("user1")->base(); int tileno = rom[tile_index + m_bgmap * 1024]; SET_TILE_INFO_MEMBER(0, tileno, 0, 0); @@ -128,7 +128,7 @@ WRITE8_MEMBER(sbowling_state::videoram_w) } } -UINT32 sbowling_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sbowling_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0x18, cliprect); m_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -167,7 +167,7 @@ WRITE8_MEMBER(sbowling_state::pix_data_w) } READ8_MEMBER(sbowling_state::pix_data_r) { - UINT32 p1, p0; + uint32_t p1, p0; int res; int sh = m_pix_sh & 7; @@ -362,7 +362,7 @@ GFXDECODE_END PALETTE_INIT_MEMBER(sbowling_state, sbowling) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); static const int resistances_rg[3] = { 470, 270, 100 }; static const int resistances_b[2] = { 270, 100 }; diff --git a/src/mame/drivers/sbrain.cpp b/src/mame/drivers/sbrain.cpp index 9bc9709113c..41800fd1249 100644 --- a/src/mame/drivers/sbrain.cpp +++ b/src/mame/drivers/sbrain.cpp @@ -66,9 +66,9 @@ public: m_bank2(*this, "bank2") {} public: - const UINT8 *m_p_chargen; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; DECLARE_DRIVER_INIT(sbrain); DECLARE_MACHINE_RESET(sbrain); DECLARE_READ8_MEMBER(ppi_pa_r); @@ -83,10 +83,10 @@ public: DECLARE_WRITE_LINE_MEMBER(fr_w); DECLARE_WRITE_LINE_MEMBER(ft_w); private: - UINT8 m_porta; - UINT8 m_portb; - UINT8 m_portc; - UINT8 m_port08; + uint8_t m_porta; + uint8_t m_portb; + uint8_t m_portc; + uint8_t m_port08; required_device m_maincpu; required_device m_subcpu; required_device m_beep; @@ -213,7 +213,7 @@ d7 : cpu2 /busak line */ READ8_MEMBER( sbrain_state::ppi_pb_r ) { - return m_portb | 0x50 | m_vs->read() | (BIT(m_port08, 0) << 5) | ((UINT8)BIT(m_portc, 5) << 7); + return m_portb | 0x50 | m_vs->read() | (BIT(m_port08, 0) << 5) | ((uint8_t)BIT(m_portc, 5) << 7); } WRITE8_MEMBER( sbrain_state::ppi_pb_w ) @@ -254,8 +254,8 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER( sbrain_state, sbrain ) { - UINT8 *main = memregion("maincpu")->base(); - UINT8 *sub = memregion("subcpu")->base(); + uint8_t *main = memregion("maincpu")->base(); + uint8_t *sub = memregion("subcpu")->base(); m_bankr0->configure_entry(0, &main[0x0000]); m_bankr0->configure_entry(1, &sub[0x0000]); @@ -277,16 +277,16 @@ MACHINE_RESET_MEMBER( sbrain_state, sbrain ) m_subcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // hold subcpu in reset } -UINT32 sbrain_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sbrain_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for (y = 0; y < 24; y++) { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = 0; x < 80; x++) { diff --git a/src/mame/drivers/sbrkout.cpp b/src/mame/drivers/sbrkout.cpp index d27c48cabbd..839200e4f14 100644 --- a/src/mame/drivers/sbrkout.cpp +++ b/src/mame/drivers/sbrkout.cpp @@ -53,13 +53,13 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; emu_timer *m_scanline_timer; emu_timer *m_pot_timer; tilemap_t *m_bg_tilemap; - UINT8 m_sync2_value; - UINT8 m_pot_mask[2]; - UINT8 m_pot_trigger[2]; + uint8_t m_sync2_value; + uint8_t m_pot_mask[2]; + uint8_t m_pot_trigger[2]; DECLARE_WRITE8_MEMBER(irq_ack_w); DECLARE_READ8_MEMBER(switches_r); DECLARE_READ8_MEMBER(sbrkoutct_switches_r); @@ -77,7 +77,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_sbrkout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sbrkout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(scanline_callback); TIMER_CALLBACK_MEMBER(pot_trigger_callback); void update_nmi_state(); @@ -121,7 +121,7 @@ public: void sbrkout_state::machine_start() { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; membank("bank1")->set_base(&videoram[0x380]); m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sbrkout_state::scanline_callback),this)); m_pot_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sbrkout_state::pot_trigger_callback),this)); @@ -147,7 +147,7 @@ void sbrkout_state::machine_reset() TIMER_CALLBACK_MEMBER(sbrkout_state::scanline_callback) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int scanline = param; /* force a partial update before anything happens */ @@ -163,7 +163,7 @@ TIMER_CALLBACK_MEMBER(sbrkout_state::scanline_callback) /* on the VBLANK, read the pot and schedule an interrupt time for it */ if (scanline == m_screen->visible_area().max_y + 1) { - UINT8 potvalue = ioport("PADDLE")->read(); + uint8_t potvalue = ioport("PADDLE")->read(); m_pot_timer->adjust(m_screen->time_until_pos(56 + (potvalue / 2), (potvalue % 2) * 128)); } @@ -190,7 +190,7 @@ WRITE8_MEMBER(sbrkout_state::irq_ack_w) READ8_MEMBER(sbrkout_state::switches_r) { - UINT8 result = 0xff; + uint8_t result = 0xff; /* DIP switches are selected by ADR0+ADR1 if ADR3 == 0 */ if ((offset & 0x0b) == 0x00) @@ -219,7 +219,7 @@ READ8_MEMBER(sbrkout_state::switches_r) READ8_MEMBER(sbrkout_state::sbrkoutct_switches_r) { - UINT8 result = 0xff; + uint8_t result = 0xff; switch( offset ) { @@ -338,7 +338,7 @@ READ8_MEMBER(sbrkout_state::sync2_r) TILE_GET_INFO_MEMBER(sbrkout_state::get_bg_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int code = (videoram[tile_index] & 0x80) ? videoram[tile_index] : 0; SET_TILE_INFO_MEMBER(0, code, 0, 0); } @@ -352,7 +352,7 @@ void sbrkout_state::video_start() WRITE8_MEMBER(sbrkout_state::sbrkout_videoram_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); } @@ -365,9 +365,9 @@ WRITE8_MEMBER(sbrkout_state::sbrkout_videoram_w) * *************************************/ -UINT32 sbrkout_state::screen_update_sbrkout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sbrkout_state::screen_update_sbrkout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int ball; m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/drivers/sc1.cpp b/src/mame/drivers/sc1.cpp index b7270b468fc..66db53c118d 100644 --- a/src/mame/drivers/sc1.cpp +++ b/src/mame/drivers/sc1.cpp @@ -59,7 +59,7 @@ public: DECLARE_WRITE8_MEMBER( pio_port_a_w ); DECLARE_READ8_MEMBER( pio_port_b_r ); - UINT8 m_matrix; + uint8_t m_matrix; }; /*************************************************************************** @@ -70,7 +70,7 @@ public: WRITE8_MEMBER( sc1_state::pio_port_a_w ) { - UINT8 digit = BITSWAP8( data,3,4,6,0,1,2,7,5 ); + uint8_t digit = BITSWAP8( data,3,4,6,0,1,2,7,5 ); if (m_matrix & 0x04) output().set_digit_value(3, digit & 0x7f); @@ -96,7 +96,7 @@ WRITE8_MEMBER( sc1_state::matrix_w ) READ8_MEMBER( sc1_state::pio_port_b_r ) { - UINT8 data = 0; + uint8_t data = 0; if (m_matrix & 0x01) data |= ioport("LINE1")->read(); diff --git a/src/mame/drivers/sc2.cpp b/src/mame/drivers/sc2.cpp index 401630b307a..c91c070f141 100644 --- a/src/mame/drivers/sc2.cpp +++ b/src/mame/drivers/sc2.cpp @@ -32,11 +32,11 @@ public: DECLARE_WRITE8_MEMBER(pio_port_a_w); DECLARE_WRITE8_MEMBER(pio_port_b_w); DECLARE_READ8_MEMBER(sc2_beep); - UINT8 m_kp_matrix; - UINT8 m_led_7seg_data[4]; - UINT8 m_led_selected; - UINT8 m_digit_data; - UINT8 m_beep_state; + uint8_t m_kp_matrix; + uint8_t m_led_7seg_data[4]; + uint8_t m_led_selected; + uint8_t m_digit_data; + uint8_t m_beep_state; void sc2_update_display(); virtual void machine_start() override; virtual void machine_reset() override; @@ -116,7 +116,7 @@ void sc2_state::machine_reset() void sc2_state::sc2_update_display() { - UINT8 digit_data = BITSWAP8( m_digit_data,7,0,1,2,3,4,5,6 ) & 0x7f; + uint8_t digit_data = BITSWAP8( m_digit_data,7,0,1,2,3,4,5,6 ) & 0x7f; if (!BIT(m_led_selected, 0)) { @@ -154,7 +154,7 @@ READ8_MEMBER( sc2_state::pio_port_a_r ) READ8_MEMBER( sc2_state::pio_port_b_r ) { - UINT8 data = m_led_selected & 0x0f; + uint8_t data = m_led_selected & 0x0f; if (BIT(m_kp_matrix, 0)) { diff --git a/src/mame/drivers/scobra.cpp b/src/mame/drivers/scobra.cpp index 7adc4fb4f4c..b3b23842dea 100644 --- a/src/mame/drivers/scobra.cpp +++ b/src/mame/drivers/scobra.cpp @@ -50,7 +50,7 @@ public: : scramble_state(mconfig, type, tag), m_soundram(*this, "soundram") { } - optional_shared_ptr m_soundram; + optional_shared_ptr m_soundram; DECLARE_READ8_MEMBER(scobra_soundram_r); DECLARE_WRITE8_MEMBER(scobra_soundram_w); DECLARE_READ8_MEMBER(scobra_type2_ppi8255_0_r); diff --git a/src/mame/drivers/scorpion.cpp b/src/mame/drivers/scorpion.cpp index 0eda0e24da8..02aedba513f 100644 --- a/src/mame/drivers/scorpion.cpp +++ b/src/mame/drivers/scorpion.cpp @@ -40,7 +40,7 @@ protected: required_memory_bank m_bank4; required_device m_beta; private: - UINT8 *m_p_ram; + uint8_t *m_p_ram; void scorpion_update_memory(); }; @@ -75,7 +75,7 @@ D6-D7 - not used. ( yet ? ) void scorpion_state::scorpion_update_memory() { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); m_screen_location = messram + ((m_port_7ffd_data & 8) ? (7<<14) : (5<<14)); @@ -113,7 +113,7 @@ WRITE8_MEMBER(scorpion_state::scorpion_0000_w) DIRECT_UPDATE_MEMBER(scorpion_state::scorpion_direct) { - UINT16 pc = m_maincpu->device_t::safe_pcbase(); // works, but... + uint16_t pc = m_maincpu->device_t::safe_pcbase(); // works, but... m_ram_disabled_by_beta = 0; if (m_beta->is_active() && (pc >= 0x4000)) @@ -187,7 +187,7 @@ ADDRESS_MAP_END MACHINE_RESET_MEMBER(scorpion_state,scorpion) { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); address_space &space = m_maincpu->space(AS_PROGRAM); m_p_ram = memregion("maincpu")->base(); diff --git a/src/mame/drivers/scregg.cpp b/src/mame/drivers/scregg.cpp index 652ebcbfacc..b151ee3cfc0 100644 --- a/src/mame/drivers/scregg.cpp +++ b/src/mame/drivers/scregg.cpp @@ -411,7 +411,7 @@ DRIVER_INIT_MEMBER(scregg_state,rockduck) { // rd2.rdh and rd1.rdj are bitswapped, but not rd3.rdg .. are they really from the same board? int x; - UINT8 *src = memregion( "gfx1" )->base(); + uint8_t *src = memregion( "gfx1" )->base(); for (x = 0x2000; x < 0x6000; x++) { diff --git a/src/mame/drivers/scv.cpp b/src/mame/drivers/scv.cpp index 535cb1caf10..feefce2ea4b 100644 --- a/src/mame/drivers/scv.cpp +++ b/src/mame/drivers/scv.cpp @@ -32,14 +32,14 @@ public: DECLARE_READ8_MEMBER(portc_r); DECLARE_WRITE8_MEMBER(portc_w); DECLARE_WRITE_LINE_MEMBER(upd1771_ack_w); - required_shared_ptr m_videoram; - UINT8 m_porta; - UINT8 m_portc; + required_shared_ptr m_videoram; + uint8_t m_porta; + uint8_t m_portc; emu_timer *m_vb_timer; virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(scv); - UINT32 screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: enum @@ -57,11 +57,11 @@ protected: ioport_port *m_key[8]; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - inline void plot_sprite_part( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 pat, UINT8 col, UINT8 screen_sprite_start_line ); - inline void draw_sprite( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 tile_idx, UINT8 col, UINT8 left, UINT8 right, UINT8 top, UINT8 bottom, UINT8 clip_y, UINT8 screen_sprite_start_line ); - inline void draw_text( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 *char_data, UINT8 fg, UINT8 bg ); - inline void draw_semi_graph( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 data, UINT8 fg ); - inline void draw_block_graph( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 col ); + inline void plot_sprite_part( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t pat, uint8_t col, uint8_t screen_sprite_start_line ); + inline void draw_sprite( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t tile_idx, uint8_t col, uint8_t left, uint8_t right, uint8_t top, uint8_t bottom, uint8_t clip_y, uint8_t screen_sprite_start_line ); + inline void draw_text( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t *char_data, uint8_t fg, uint8_t bg ); + inline void draw_semi_graph( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t data, uint8_t fg ); + inline void draw_block_graph( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t col ); }; @@ -177,7 +177,7 @@ WRITE8_MEMBER( scv_state::porta_w ) READ8_MEMBER( scv_state::portb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 8; i++) { @@ -191,7 +191,7 @@ READ8_MEMBER( scv_state::portb_r ) READ8_MEMBER( scv_state::portc_r ) { - UINT8 data = m_portc; + uint8_t data = m_portc; data = (data & 0xfe) | (m_pc0->read() & 0x01); @@ -288,7 +288,7 @@ void scv_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo } -inline void scv_state::plot_sprite_part( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 pat, UINT8 col, UINT8 screen_sprite_start_line ) +inline void scv_state::plot_sprite_part( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t pat, uint8_t col, uint8_t screen_sprite_start_line ) { if ( x < 4 ) { @@ -319,17 +319,17 @@ inline void scv_state::plot_sprite_part( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, } -inline void scv_state::draw_sprite( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 tile_idx, UINT8 col, UINT8 left, UINT8 right, UINT8 top, UINT8 bottom, UINT8 clip_y, UINT8 screen_sprite_start_line ) +inline void scv_state::draw_sprite( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t tile_idx, uint8_t col, uint8_t left, uint8_t right, uint8_t top, uint8_t bottom, uint8_t clip_y, uint8_t screen_sprite_start_line ) { int j; y += clip_y * 2; for ( j = clip_y * 4; j < 32; j += 4 ) { - UINT8 pat0 = m_videoram[ tile_idx * 32 + j + 0 ]; - UINT8 pat1 = m_videoram[ tile_idx * 32 + j + 1 ]; - UINT8 pat2 = m_videoram[ tile_idx * 32 + j + 2 ]; - UINT8 pat3 = m_videoram[ tile_idx * 32 + j + 3 ]; + uint8_t pat0 = m_videoram[ tile_idx * 32 + j + 0 ]; + uint8_t pat1 = m_videoram[ tile_idx * 32 + j + 1 ]; + uint8_t pat2 = m_videoram[ tile_idx * 32 + j + 2 ]; + uint8_t pat3 = m_videoram[ tile_idx * 32 + j + 3 ]; if ( ( top && j < 16 ) || ( bottom && j >= 16 ) ) { @@ -361,13 +361,13 @@ inline void scv_state::draw_sprite( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT } -inline void scv_state::draw_text( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 *char_data, UINT8 fg, UINT8 bg ) +inline void scv_state::draw_text( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t *char_data, uint8_t fg, uint8_t bg ) { int i; for ( i = 0; i < 8; i++ ) { - UINT8 d = char_data[i]; + uint8_t d = char_data[i]; bitmap.pix16(y + i, x + 0 ) = ( d & 0x80 ) ? fg : bg; bitmap.pix16(y + i, x + 1 ) = ( d & 0x40 ) ? fg : bg; @@ -394,7 +394,7 @@ inline void scv_state::draw_text( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 } -inline void scv_state::draw_semi_graph( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 data, UINT8 fg ) +inline void scv_state::draw_semi_graph( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t data, uint8_t fg ) { int i; @@ -411,7 +411,7 @@ inline void scv_state::draw_semi_graph( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, } -inline void scv_state::draw_block_graph( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 col ) +inline void scv_state::draw_block_graph( bitmap_ind16 &bitmap, uint8_t x, uint8_t y, uint8_t col ) { int i; @@ -429,13 +429,13 @@ inline void scv_state::draw_block_graph( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, } -UINT32 scv_state::screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t scv_state::screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; - UINT8 fg = m_videoram[0x1403] >> 4; - UINT8 bg = m_videoram[0x1403] & 0x0f; - UINT8 gr_fg = m_videoram[0x1401] >> 4; - UINT8 gr_bg = m_videoram[0x1401] & 0x0f; + uint8_t fg = m_videoram[0x1403] >> 4; + uint8_t bg = m_videoram[0x1403] & 0x0f; + uint8_t gr_fg = m_videoram[0x1401] >> 4; + uint8_t gr_bg = m_videoram[0x1401] & 0x0f; int clip_x = ( m_videoram[0x1402] & 0x0f ) * 2; int clip_y = m_videoram[0x1402] >> 4; @@ -459,7 +459,7 @@ UINT32 scv_state::screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, for ( x = 0; x < 32; x++ ) { int text_x = 0; - UINT8 d = m_videoram[ 0x1000 + y * 32 + x ]; + uint8_t d = m_videoram[ 0x1000 + y * 32 + x ]; if ( x < clip_x ) { @@ -473,7 +473,7 @@ UINT32 scv_state::screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, if ( text_x && text_y ) { /* Text mode */ - UINT8 *char_data = m_charrom->base() + ( d & 0x7f ) * 8; + uint8_t *char_data = m_charrom->base() + ( d & 0x7f ) * 8; draw_text( bitmap, x * 8, y * 16, char_data, fg, bg ); } else @@ -506,23 +506,23 @@ UINT32 scv_state::screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, /* Draw sprites if enabled */ if ( m_videoram[0x1400] & 0x10 ) { - UINT8 screen_start_sprite_line = ( ( ( m_videoram[0x1400] & 0xf7 ) == 0x17 ) && ( ( m_videoram[0x1402] & 0xef ) == 0x4f ) ) ? 21 + 32 : 0 ; + uint8_t screen_start_sprite_line = ( ( ( m_videoram[0x1400] & 0xf7 ) == 0x17 ) && ( ( m_videoram[0x1402] & 0xef ) == 0x4f ) ) ? 21 + 32 : 0 ; int i; for ( i = 0; i < 128; i++ ) { - UINT8 spr_y = m_videoram[ 0x1200 + i * 4 ] & 0xfe; - UINT8 y_32 = m_videoram[ 0x1200 + i * 4 ] & 0x01; /* Xx32 sprite */ - UINT8 clip = m_videoram[ 0x1201 + i * 4 ] >> 4; - UINT8 col = m_videoram[ 0x1201 + i * 4 ] & 0x0f; - UINT8 spr_x = m_videoram[ 0x1202 + i * 4 ] & 0xfe; - UINT8 x_32 = m_videoram[ 0x1202 + i * 4 ] & 0x01; /* 32xX sprite */ - UINT8 tile_idx = m_videoram[ 0x1203 + i * 4 ] & 0x7f; - UINT8 half = m_videoram[ 0x1203 + i * 4] & 0x80; - UINT8 left = 1; - UINT8 right = 1; - UINT8 top = 1; - UINT8 bottom = 1; + uint8_t spr_y = m_videoram[ 0x1200 + i * 4 ] & 0xfe; + uint8_t y_32 = m_videoram[ 0x1200 + i * 4 ] & 0x01; /* Xx32 sprite */ + uint8_t clip = m_videoram[ 0x1201 + i * 4 ] >> 4; + uint8_t col = m_videoram[ 0x1201 + i * 4 ] & 0x0f; + uint8_t spr_x = m_videoram[ 0x1202 + i * 4 ] & 0xfe; + uint8_t x_32 = m_videoram[ 0x1202 + i * 4 ] & 0x01; /* 32xX sprite */ + uint8_t tile_idx = m_videoram[ 0x1203 + i * 4 ] & 0x7f; + uint8_t half = m_videoram[ 0x1203 + i * 4] & 0x80; + uint8_t left = 1; + uint8_t right = 1; + uint8_t top = 1; + uint8_t bottom = 1; if ( !col ) { @@ -572,8 +572,8 @@ UINT32 scv_state::screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, draw_sprite( bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip, screen_start_sprite_line ); if ( x_32 || y_32 ) { - static const UINT8 spr_2col_lut0[16] = { 0, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 1, 1 }; - static const UINT8 spr_2col_lut1[16] = { 0, 1, 8, 11, 2, 3, 10, 9, 4, 5, 12, 13, 6, 7, 14, 15 }; + static const uint8_t spr_2col_lut0[16] = { 0, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 1, 1 }; + static const uint8_t spr_2col_lut1[16] = { 0, 1, 8, 11, 2, 3, 10, 9, 4, 5, 12, 13, 6, 7, 14, 15 }; draw_sprite( bitmap, spr_x, spr_y, tile_idx ^ ( 8 * x_32 + y_32 ), ( i & 0x40 ) ? spr_2col_lut1[col] : spr_2col_lut0[col], left, right, top, bottom, clip, screen_start_sprite_line ); } diff --git a/src/mame/drivers/sdk80.cpp b/src/mame/drivers/sdk80.cpp index 6b0038f508b..c5d2f45dd5e 100644 --- a/src/mame/drivers/sdk80.cpp +++ b/src/mame/drivers/sdk80.cpp @@ -61,8 +61,8 @@ private: required_device m_rs232; required_ioport m_usart_baud_rate; - UINT8 m_usart_divide_counter; - UINT8 m_usart_clock_state; + uint8_t m_usart_divide_counter; + uint8_t m_usart_clock_state; }; static ADDRESS_MAP_START(sdk80_mem, AS_PROGRAM, 8, sdk80_state) @@ -94,10 +94,10 @@ INPUT_PORTS_END WRITE_LINE_MEMBER( sdk80_state::usart_clock_tick ) { - UINT8 old_counter = m_usart_divide_counter; + uint8_t old_counter = m_usart_divide_counter; m_usart_divide_counter++; - UINT8 transition = (old_counter ^ m_usart_divide_counter) & m_usart_baud_rate->read(); + uint8_t transition = (old_counter ^ m_usart_divide_counter) & m_usart_baud_rate->read(); if (transition) { m_usart->write_txc(m_usart_clock_state); diff --git a/src/mame/drivers/sdk85.cpp b/src/mame/drivers/sdk85.cpp index 424a921a1ae..aa64dbb4e42 100644 --- a/src/mame/drivers/sdk85.cpp +++ b/src/mame/drivers/sdk85.cpp @@ -38,7 +38,7 @@ public: DECLARE_WRITE8_MEMBER(scanlines_w); DECLARE_WRITE8_MEMBER(digit_w); DECLARE_READ8_MEMBER(kbd_r); - UINT8 m_digit; + uint8_t m_digit; required_device m_maincpu; }; @@ -103,7 +103,7 @@ WRITE8_MEMBER( sdk85_state::digit_w ) READ8_MEMBER( sdk85_state::kbd_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_digit < 3) { diff --git a/src/mame/drivers/sdk86.cpp b/src/mame/drivers/sdk86.cpp index c655c0cd23e..51cd3faed24 100644 --- a/src/mame/drivers/sdk86.cpp +++ b/src/mame/drivers/sdk86.cpp @@ -56,7 +56,7 @@ public: DECLARE_WRITE_LINE_MEMBER( write_usart_clock ); - UINT8 m_digit; + uint8_t m_digit; }; static ADDRESS_MAP_START(sdk86_mem, AS_PROGRAM, 16, sdk86_state) @@ -120,7 +120,7 @@ WRITE8_MEMBER( sdk86_state::digit_w ) READ8_MEMBER( sdk86_state::kbd_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_digit < 3) { diff --git a/src/mame/drivers/seabattl.cpp b/src/mame/drivers/seabattl.cpp index 2c9f1be6772..f1d9bb4d89a 100644 --- a/src/mame/drivers/seabattl.cpp +++ b/src/mame/drivers/seabattl.cpp @@ -63,9 +63,9 @@ public: } required_device m_maincpu; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_objram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_objram; required_device m_digit0; required_device m_digit1; required_device m_digit2; @@ -96,9 +96,9 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(seabattl); - UINT32 screen_update_seabattl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_seabattl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); bool m_waveenable; - UINT8 m_collision; + uint8_t m_collision; required_device m_gfxdecode; required_device m_screen; required_device m_palette; @@ -151,7 +151,7 @@ WRITE8_MEMBER(seabattl_state::seabattl_colorram_w) m_bg_tilemap->mark_tile_dirty(offset); } -UINT32 seabattl_state::screen_update_seabattl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t seabattl_state::screen_update_seabattl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y, offset; diff --git a/src/mame/drivers/sealy.cpp b/src/mame/drivers/sealy.cpp index fbdc2ed03cd..85bd14c25af 100644 --- a/src/mame/drivers/sealy.cpp +++ b/src/mame/drivers/sealy.cpp @@ -49,7 +49,7 @@ public: // screen updates DECLARE_PALETTE_INIT(sealy); - UINT32 screen_update_sealy(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sealy(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -59,7 +59,7 @@ PALETTE_INIT_MEMBER(sealy_state,sealy) // palette.set_pen_color(i,pal5bit(i >> 5),pal5bit(i >> 10),pal5bit(i >> 0)); } -UINT32 sealy_state::screen_update_sealy(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sealy_state::screen_update_sealy(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); return 0; diff --git a/src/mame/drivers/seattle.cpp b/src/mame/drivers/seattle.cpp index 07b634f4464..52f021f6728 100644 --- a/src/mame/drivers/seattle.cpp +++ b/src/mame/drivers/seattle.cpp @@ -390,38 +390,38 @@ struct galileo_timer { emu_timer * timer; - UINT32 count; - UINT8 active; + uint32_t count; + uint8_t active; }; struct galileo_data { /* raw register data */ - UINT32 reg[0x1000/4]; + uint32_t reg[0x1000/4]; /* timer info */ galileo_timer timer[4]; /* DMA info */ - INT8 dma_active; - UINT8 dma_stalled_on_voodoo[4]; + int8_t dma_active; + uint8_t dma_stalled_on_voodoo[4]; /* PCI info */ - UINT32 pci_bridge_regs[0x40]; - UINT32 pci_3dfx_regs[0x40]; - UINT32 pci_ide_regs[0x40]; + uint32_t pci_bridge_regs[0x40]; + uint32_t pci_3dfx_regs[0x40]; + uint32_t pci_ide_regs[0x40]; }; struct widget_data { /* ethernet register address */ - UINT8 ethernet_addr; + uint8_t ethernet_addr; /* IRQ information */ - UINT8 irq_num; - UINT8 irq_mask; + uint8_t irq_num; + uint8_t irq_mask; }; @@ -445,12 +445,12 @@ public: { } - required_shared_ptr m_nvram; - required_shared_ptr m_rambase; - required_shared_ptr m_interrupt_enable; - required_shared_ptr m_interrupt_config; - required_shared_ptr m_asic_reset; - required_shared_ptr m_rombase; + required_shared_ptr m_nvram; + required_shared_ptr m_rambase; + required_shared_ptr m_interrupt_enable; + required_shared_ptr m_interrupt_config; + required_shared_ptr m_asic_reset; + required_shared_ptr m_rombase; required_device m_maincpu; required_device m_ide; optional_device m_ethernet; @@ -460,22 +460,22 @@ public: galileo_data m_galileo; widget_data m_widget; voodoo_device *m_voodoo; - UINT8 m_voodoo_stalled; - UINT8 m_cpu_stalled_on_voodoo; - UINT32 m_cpu_stalled_offset; - UINT32 m_cpu_stalled_data; - UINT32 m_cpu_stalled_mem_mask; - UINT8 m_board_config; - UINT8 m_ethernet_irq_num; - UINT8 m_ethernet_irq_state; - UINT8 m_vblank_irq_num; - UINT8 m_vblank_latch; - UINT8 m_vblank_state; - UINT8 m_pending_analog_read; - UINT8 m_status_leds; - UINT32 m_cmos_write_enabled; - UINT32 m_output; - UINT8 m_output_mode; + uint8_t m_voodoo_stalled; + uint8_t m_cpu_stalled_on_voodoo; + uint32_t m_cpu_stalled_offset; + uint32_t m_cpu_stalled_data; + uint32_t m_cpu_stalled_mem_mask; + uint8_t m_board_config; + uint8_t m_ethernet_irq_num; + uint8_t m_ethernet_irq_state; + uint8_t m_vblank_irq_num; + uint8_t m_vblank_latch; + uint8_t m_vblank_state; + uint8_t m_pending_analog_read; + uint8_t m_status_leds; + uint32_t m_cmos_write_enabled; + uint32_t m_output; + uint8_t m_output_mode; DECLARE_READ32_MEMBER(interrupt_state_r); DECLARE_READ32_MEMBER(interrupt_state2_r); DECLARE_WRITE32_MEMBER(interrupt_config_w); @@ -521,17 +521,17 @@ public: DECLARE_DRIVER_INIT(blitz99); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_seattle(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_seattle(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(galileo_timer_callback); DECLARE_WRITE_LINE_MEMBER(ethernet_interrupt); DECLARE_WRITE_LINE_MEMBER(ioasic_irq); void update_vblank_irq(); - UINT32 pci_bridge_r(address_space &space, UINT8 reg, UINT8 type); - void pci_bridge_w(address_space &space, UINT8 reg, UINT8 type, UINT32 data); - UINT32 pci_3dfx_r(address_space &space, UINT8 reg, UINT8 type); - void pci_3dfx_w(address_space &space, UINT8 reg, UINT8 type, UINT32 data); - UINT32 pci_ide_r(address_space &space, UINT8 reg, UINT8 type); - void pci_ide_w(address_space &space, UINT8 reg, UINT8 type, UINT32 data); + uint32_t pci_bridge_r(address_space &space, uint8_t reg, uint8_t type); + void pci_bridge_w(address_space &space, uint8_t reg, uint8_t type, uint32_t data); + uint32_t pci_3dfx_r(address_space &space, uint8_t reg, uint8_t type); + void pci_3dfx_w(address_space &space, uint8_t reg, uint8_t type, uint32_t data); + uint32_t pci_ide_r(address_space &space, uint8_t reg, uint8_t type); + void pci_ide_w(address_space &space, uint8_t reg, uint8_t type, uint32_t data); void update_galileo_irqs(); int galileo_dma_fetch_next(address_space &space, int which); void galileo_perform_dma(address_space &space, int which); @@ -547,7 +547,7 @@ public: * *************************************/ -UINT32 seattle_state::screen_update_seattle(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t seattle_state::screen_update_seattle(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return m_voodoo->voodoo_update(bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } @@ -665,7 +665,7 @@ WRITE_LINE_MEMBER(seattle_state::ethernet_interrupt) m_ethernet_irq_state = state; if (m_board_config == FLAGSTAFF_CONFIG) { - UINT8 assert = m_ethernet_irq_state && (*m_interrupt_enable & (1 << ETHERNET_IRQ_SHIFT)); + uint8_t assert = m_ethernet_irq_state && (*m_interrupt_enable & (1 << ETHERNET_IRQ_SHIFT)); if (m_ethernet_irq_num != 0) m_maincpu->set_input_line(m_ethernet_irq_num, assert ? ASSERT_LINE : CLEAR_LINE); } @@ -694,7 +694,7 @@ WRITE_LINE_MEMBER(seattle_state::ioasic_irq) READ32_MEMBER(seattle_state::interrupt_state_r) { - UINT32 result = 0; + uint32_t result = 0; result |= m_ethernet_irq_state << ETHERNET_IRQ_SHIFT; result |= m_vblank_latch << VBLANK_IRQ_SHIFT; return result; @@ -703,7 +703,7 @@ READ32_MEMBER(seattle_state::interrupt_state_r) READ32_MEMBER(seattle_state::interrupt_state2_r) { - UINT32 result = interrupt_state_r(space, offset, mem_mask); + uint32_t result = interrupt_state_r(space, offset, mem_mask); result |= m_vblank_state << 8; return result; } @@ -754,7 +754,7 @@ WRITE32_MEMBER(seattle_state::interrupt_config_w) WRITE32_MEMBER(seattle_state::seattle_interrupt_enable_w) { - UINT32 old = *m_interrupt_enable; + uint32_t old = *m_interrupt_enable; COMBINE_DATA(m_interrupt_enable); if (old != *m_interrupt_enable) { @@ -817,9 +817,9 @@ WRITE_LINE_MEMBER(seattle_state::vblank_assert) * *************************************/ -UINT32 seattle_state::pci_bridge_r(address_space &space, UINT8 reg, UINT8 type) +uint32_t seattle_state::pci_bridge_r(address_space &space, uint8_t reg, uint8_t type) { - UINT32 result = m_galileo.pci_bridge_regs[reg]; + uint32_t result = m_galileo.pci_bridge_regs[reg]; switch (reg) { @@ -838,7 +838,7 @@ UINT32 seattle_state::pci_bridge_r(address_space &space, UINT8 reg, UINT8 type) } -void seattle_state::pci_bridge_w(address_space &space, UINT8 reg, UINT8 type, UINT32 data) +void seattle_state::pci_bridge_w(address_space &space, uint8_t reg, uint8_t type, uint32_t data) { m_galileo.pci_bridge_regs[reg] = data; if (LOG_PCI) @@ -853,9 +853,9 @@ void seattle_state::pci_bridge_w(address_space &space, UINT8 reg, UINT8 type, UI * *************************************/ -UINT32 seattle_state::pci_3dfx_r(address_space &space, UINT8 reg, UINT8 type) +uint32_t seattle_state::pci_3dfx_r(address_space &space, uint8_t reg, uint8_t type) { - UINT32 result = m_galileo.pci_3dfx_regs[reg]; + uint32_t result = m_galileo.pci_3dfx_regs[reg]; switch (reg) { @@ -874,7 +874,7 @@ UINT32 seattle_state::pci_3dfx_r(address_space &space, UINT8 reg, UINT8 type) } -void seattle_state::pci_3dfx_w(address_space &space, UINT8 reg, UINT8 type, UINT32 data) +void seattle_state::pci_3dfx_w(address_space &space, uint8_t reg, uint8_t type, uint32_t data) { m_galileo.pci_3dfx_regs[reg] = data; @@ -902,9 +902,9 @@ void seattle_state::pci_3dfx_w(address_space &space, UINT8 reg, UINT8 type, UINT * *************************************/ -UINT32 seattle_state::pci_ide_r(address_space &space, UINT8 reg, UINT8 type) +uint32_t seattle_state::pci_ide_r(address_space &space, uint8_t reg, uint8_t type) { - UINT32 result = m_galileo.pci_ide_regs[reg]; + uint32_t result = m_galileo.pci_ide_regs[reg]; switch (reg) { @@ -923,7 +923,7 @@ UINT32 seattle_state::pci_ide_r(address_space &space, UINT8 reg, UINT8 type) } -void seattle_state::pci_ide_w(address_space &space, UINT8 reg, UINT8 type, UINT32 data) +void seattle_state::pci_ide_w(address_space &space, uint8_t reg, uint8_t type, uint32_t data) { m_galileo.pci_ide_regs[reg] = data; if (LOG_PCI) @@ -988,7 +988,7 @@ int seattle_state::galileo_dma_fetch_next(address_space &space, int which) { galileo_data &galileo = m_galileo; offs_t address = 0; - UINT32 data; + uint32_t data; /* no-op for unchained mode */ if (!(galileo.reg[GREG_DMA0_CONTROL + which] & 0x200)) @@ -1032,7 +1032,7 @@ void seattle_state::galileo_perform_dma(address_space &space, int which) { offs_t srcaddr = galileo.reg[GREG_DMA0_SOURCE + which]; offs_t dstaddr = galileo.reg[GREG_DMA0_DEST + which]; - UINT32 bytesleft = galileo.reg[GREG_DMA0_COUNT + which] & 0xffff; + uint32_t bytesleft = galileo.reg[GREG_DMA0_COUNT + which] & 0xffff; int srcinc, dstinc; galileo.dma_active = which; @@ -1134,7 +1134,7 @@ void seattle_state::galileo_reset() READ32_MEMBER(seattle_state::galileo_r) { galileo_data &galileo = m_galileo; - UINT32 result = galileo.reg[offset]; + uint32_t result = galileo.reg[offset]; /* switch off the offset for special cases */ switch (offset) @@ -1150,7 +1150,7 @@ READ32_MEMBER(seattle_state::galileo_r) result = timer->count; if (timer->active) { - UINT32 elapsed = (timer->timer->elapsed() * SYSTEM_CLOCK).as_double(); + uint32_t elapsed = (timer->timer->elapsed() * SYSTEM_CLOCK).as_double(); result = (result > elapsed) ? (result - elapsed) : 0; } @@ -1216,7 +1216,7 @@ READ32_MEMBER(seattle_state::galileo_r) WRITE32_MEMBER(seattle_state::galileo_w) { galileo_data &galileo = m_galileo; - UINT32 oldata = galileo.reg[offset]; + uint32_t oldata = galileo.reg[offset]; COMBINE_DATA(&galileo.reg[offset]); /* switch off the offset for special cases */ @@ -1288,7 +1288,7 @@ WRITE32_MEMBER(seattle_state::galileo_w) } else if (timer->active && !(data & mask)) { - UINT32 elapsed = (timer->timer->elapsed() * SYSTEM_CLOCK).as_double(); + uint32_t elapsed = (timer->timer->elapsed() * SYSTEM_CLOCK).as_double(); timer->active = 0; timer->count = (timer->count > elapsed) ? (timer->count - elapsed) : 0; timer->timer->adjust(attotime::never, which); @@ -1472,7 +1472,7 @@ WRITE32_MEMBER(seattle_state::analog_port_w) READ32_MEMBER(seattle_state::carnevil_gun_r) { - UINT32 result = 0; + uint32_t result = 0; switch (offset) { @@ -1556,7 +1556,7 @@ WRITE32_MEMBER(seattle_state::ethernet_w) void seattle_state::widget_reset() { - UINT8 saved_irq = m_widget.irq_num; + uint8_t saved_irq = m_widget.irq_num; memset(&m_widget, 0, sizeof(m_widget)); m_widget.irq_num = saved_irq; } @@ -1564,9 +1564,9 @@ void seattle_state::widget_reset() void seattle_state::update_widget_irq() { - UINT8 state = m_ethernet_irq_state << WINT_ETHERNET_SHIFT; - UINT8 mask = m_widget.irq_mask; - UINT8 assert = ((mask & state) != 0) && (*m_interrupt_enable & (1 << WIDGET_IRQ_SHIFT)); + uint8_t state = m_ethernet_irq_state << WINT_ETHERNET_SHIFT; + uint8_t mask = m_widget.irq_mask; + uint8_t assert = ((mask & state) != 0) && (*m_interrupt_enable & (1 << WIDGET_IRQ_SHIFT)); /* update the IRQ state */ if (m_widget.irq_num != 0) @@ -1582,8 +1582,8 @@ READ32_MEMBER(seattle_state::output_r) WRITE32_MEMBER(seattle_state::output_w) { - UINT8 op = (data >> 8) & 0xF; - UINT8 arg = data & 0xFF; + uint8_t op = (data >> 8) & 0xF; + uint8_t arg = data & 0xFF; switch (op) { @@ -1609,22 +1609,22 @@ WRITE32_MEMBER(seattle_state::output_w) break; case 0x05: - for (UINT8 bit = 0; bit < 8; bit++) + for (uint8_t bit = 0; bit < 8; bit++) output().set_lamp_value(bit, (arg >> bit) & 0x1); break; case 0x06: // Hyperdrive LEDs 0-7 - for (UINT8 bit = 0; bit < 8; bit++) + for (uint8_t bit = 0; bit < 8; bit++) output().set_led_value(bit, (arg >> bit) & 0x1); break; case 0x07: // Hyperdrive LEDs 8-15 - for (UINT8 bit = 0; bit < 8; bit++) + for (uint8_t bit = 0; bit < 8; bit++) output().set_led_value(8 + bit, (arg >> bit) & 0x1); break; case 0x08: // Hyperdrive LEDs 16-23 (Only uses up to 19) - for (UINT8 bit = 0; bit < 8; bit++) + for (uint8_t bit = 0; bit < 8; bit++) output().set_led_value(16 + bit, (arg >> bit) & 0x1); break; } @@ -1635,7 +1635,7 @@ WRITE32_MEMBER(seattle_state::output_w) READ32_MEMBER(seattle_state::widget_r) { - UINT32 result = ~0; + uint32_t result = ~0; switch (offset) { diff --git a/src/mame/drivers/seattlecmp.cpp b/src/mame/drivers/seattlecmp.cpp index b6b06914492..baa49c6101a 100644 --- a/src/mame/drivers/seattlecmp.cpp +++ b/src/mame/drivers/seattlecmp.cpp @@ -52,7 +52,7 @@ private: virtual void machine_reset() override; required_device m_maincpu; required_device m_terminal; - UINT8 m_term_data; + uint8_t m_term_data; bool m_key_available; }; @@ -77,7 +77,7 @@ ADDRESS_MAP_END READ16_MEMBER( seattle_comp_state::read ) { - UINT16 status = (m_key_available) ? 0x300 : 0x100; + uint16_t status = (m_key_available) ? 0x300 : 0x100; m_key_available = 0; return m_term_data | status; } diff --git a/src/mame/drivers/segac2.cpp b/src/mame/drivers/segac2.cpp index 425c6da0599..bc9e88bfdc8 100644 --- a/src/mame/drivers/segac2.cpp +++ b/src/mame/drivers/segac2.cpp @@ -113,22 +113,22 @@ public: int m_segac2_enable_display; - required_shared_ptr m_paletteram; + required_shared_ptr m_paletteram; optional_memory_region m_upd_region; /* protection-related tracking */ segac2_prot_delegate m_prot_func; /* emulation of protection chip */ - UINT8 m_prot_write_buf; /* remembers what was written */ - UINT8 m_prot_read_buf; /* remembers what was returned */ + uint8_t m_prot_write_buf; /* remembers what was written */ + uint8_t m_prot_read_buf; /* remembers what was returned */ /* palette-related variables */ - UINT8 m_segac2_alt_palette_mode; - UINT8 m_palbank; - UINT8 m_bg_palbase; - UINT8 m_sp_palbase; + uint8_t m_segac2_alt_palette_mode; + uint8_t m_palbank; + uint8_t m_bg_palbase; + uint8_t m_sp_palbase; /* sound-related variables */ - UINT8 m_sound_banks; /* number of sound banks */ + uint8_t m_sound_banks; /* number of sound banks */ DECLARE_DRIVER_INIT(c2boot); DECLARE_DRIVER_INIT(bloxeedc); @@ -160,7 +160,7 @@ public: DECLARE_MACHINE_START(segac2); DECLARE_MACHINE_RESET(segac2); - UINT32 screen_update_segac2_new(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_segac2_new(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); int m_segac2_bg_pal_lookup[4]; int m_segac2_sp_pal_lookup[4]; void recompute_palette_tables(); @@ -1421,7 +1421,7 @@ VIDEO_START_MEMBER(segac2_state,segac2_new) // C2 doesn't use the internal VDP CRAM, instead it uses the digital output of the chip // and applies it's own external colour circuity -UINT32 segac2_state::screen_update_segac2_new(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t segac2_state::screen_update_segac2_new(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const pen_t *paldata = m_palette->pens(); if (!m_segac2_enable_display) @@ -1433,14 +1433,14 @@ UINT32 segac2_state::screen_update_segac2_new(screen_device &screen, bitmap_rgb3 /* 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; srcy = m_vdp->m_render_line_raw.get(); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - UINT16 src = srcy[x]; + uint16_t src = srcy[x]; switch (src & 0x1c0) { case 0x000: diff --git a/src/mame/drivers/segae.cpp b/src/mame/drivers/segae.cpp index 7751253ff45..1fe88f41c31 100644 --- a/src/mame/drivers/segae.cpp +++ b/src/mame/drivers/segae.cpp @@ -336,23 +336,23 @@ public: required_device m_vdp1; required_device m_vdp2; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; required_memory_region m_maincpu_region; required_memory_bank m_bank1; optional_memory_bank m_bank0d; optional_memory_bank m_bank1d; // Analog input related - UINT8 m_port_select; - UINT16 m_last1; - UINT16 m_last2; - UINT16 m_diff1; - UINT16 m_diff2; + uint8_t m_port_select; + uint16_t m_last1; + uint16_t m_last2; + uint16_t m_diff1; + uint16_t m_diff2; // Video RAM - UINT8 m_vram[2][0x4000 * 2]; + uint8_t m_vram[2][0x4000 * 2]; - UINT32 screen_update_systeme(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_systeme(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -458,7 +458,7 @@ void systeme_state::machine_start() /*- Hang On Jr. Specific -*/ READ8_MEMBER( systeme_state::hangonjr_port_f8_read ) { - UINT8 temp; + uint8_t temp; temp = 0; @@ -971,7 +971,7 @@ ROM_START( opaopa ) ROM_END -UINT32 systeme_state::screen_update_systeme(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t systeme_state::screen_update_systeme(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap_rgb32 &vdp1_bitmap = m_vdp1->get_bitmap(); bitmap_rgb32 &vdp2_bitmap = m_vdp2->get_bitmap(); @@ -979,10 +979,10 @@ UINT32 systeme_state::screen_update_systeme(screen_device &screen, bitmap_rgb32 for( int y = cliprect.min_y; y <= cliprect.max_y; y++ ) { - UINT32 *dest_ptr = &bitmap.pix32(y); - UINT32 *vdp1_ptr = &vdp1_bitmap.pix32(y); - UINT32 *vdp2_ptr = &vdp2_bitmap.pix32(y); - UINT8 *y1_ptr = &vdp2_y1.pix8(y); + uint32_t *dest_ptr = &bitmap.pix32(y); + uint32_t *vdp1_ptr = &vdp1_bitmap.pix32(y); + uint32_t *vdp2_ptr = &vdp2_bitmap.pix32(y); + uint8_t *y1_ptr = &vdp2_y1.pix8(y); for ( int x = cliprect.min_x; x <= cliprect.max_x; x++ ) { @@ -1061,7 +1061,7 @@ DRIVER_INIT_MEMBER(systeme_state, ridleofp) DRIVER_INIT_MEMBER(systeme_state, opaopa) { - UINT8 *banked_decrypted_opcodes = auto_alloc_array(machine(), UINT8, m_maincpu_region->bytes()); + uint8_t *banked_decrypted_opcodes = auto_alloc_array(machine(), uint8_t, m_maincpu_region->bytes()); mc8123_decode(m_maincpu_region->base(), banked_decrypted_opcodes, memregion("key")->base(), m_maincpu_region->bytes()); m_bank0d->set_base(banked_decrypted_opcodes); diff --git a/src/mame/drivers/segag80r.cpp b/src/mame/drivers/segag80r.cpp index 1ec19493e82..f278a775a67 100644 --- a/src/mame/drivers/segag80r.cpp +++ b/src/mame/drivers/segag80r.cpp @@ -169,7 +169,7 @@ offs_t segag80r_state::decrypt_offset(address_space &space, offs_t offset) { /* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */ offs_t pc = space.device().safe_pcbase(); - if ((UINT16)pc == 0xffff || space.read_byte(pc) != 0x32) + if ((uint16_t)pc == 0xffff || space.read_byte(pc) != 0x32) return offset; /* fetch the low byte of the address and munge it */ @@ -195,7 +195,7 @@ WRITE8_MEMBER(segag80r_state::usb_ram_w){ m_usbsnd->ram_w(space, decrypt_offset( * *************************************/ -inline UINT8 segag80r_state::demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0) +inline uint8_t segag80r_state::demangle(uint8_t d7d6, uint8_t d5d4, uint8_t d3d2, uint8_t d1d0) { return ((d7d6 << 7) & 0x80) | ((d7d6 << 2) & 0x40) | ((d5d4 << 5) & 0x20) | ((d5d4 << 0) & 0x10) | @@ -211,10 +211,10 @@ READ8_MEMBER(segag80r_state::mangled_ports_r) /* read as two bits from each of 4 ports. For this reason, the input */ /* ports have been organized logically, and are demangled at runtime. */ /* 4 input ports each provide 8 bits of information. */ - UINT8 d7d6 = ioport("D7D6")->read(); - UINT8 d5d4 = ioport("D5D4")->read(); - UINT8 d3d2 = ioport("D3D2")->read(); - UINT8 d1d0 = ioport("D1D0")->read(); + uint8_t d7d6 = ioport("D7D6")->read(); + uint8_t d5d4 = ioport("D5D4")->read(); + uint8_t d3d2 = ioport("D3D2")->read(); + uint8_t d1d0 = ioport("D1D0")->read(); int shift = offset & 3; return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift); } @@ -226,17 +226,17 @@ READ8_MEMBER(segag80r_state::spaceod_mangled_ports_r) /* versus cocktail cabinets; we fix this here. The input ports are */ /* coded for cocktail mode; for upright mode, we manually shuffle the */ /* bits around. */ - UINT8 d7d6 = ioport("D7D6")->read(); - UINT8 d5d4 = ioport("D5D4")->read(); - UINT8 d3d2 = ioport("D3D2")->read(); - UINT8 d1d0 = ioport("D1D0")->read(); + uint8_t d7d6 = ioport("D7D6")->read(); + uint8_t d5d4 = ioport("D5D4")->read(); + uint8_t d3d2 = ioport("D3D2")->read(); + uint8_t d1d0 = ioport("D1D0")->read(); int shift = offset & 3; /* tweak bits for the upright case */ - UINT8 upright = d3d2 & 0x04; + uint8_t upright = d3d2 & 0x04; if (upright) { - UINT8 fc = ioport("FC")->read(); + uint8_t fc = ioport("FC")->read(); d7d6 |= 0x60; d5d4 = (d5d4 & ~0x1c) | ((~fc & 0x20) >> 3) | /* IPT_BUTTON2 */ @@ -250,8 +250,8 @@ READ8_MEMBER(segag80r_state::spaceod_mangled_ports_r) READ8_MEMBER(segag80r_state::spaceod_port_fc_r) { - UINT8 upright = ioport("D3D2")->read() & 0x04; - UINT8 fc = ioport("FC")->read(); + uint8_t upright = ioport("D3D2")->read() & 0x04; + uint8_t fc = ioport("FC")->read(); /* tweak bits for the upright case */ if (upright) @@ -1404,13 +1404,13 @@ ROM_END void segag80r_state::monsterb_expand_gfx(const char *region) { - UINT8 *dest; + uint8_t *dest; int i; /* expand the background ROMs; A11/A12 of each ROM is independently controlled via */ /* banking */ dest = memregion(region)->base(); - std::vector temp(0x4000); + std::vector temp(0x4000); memcpy(&temp[0], dest, 0x4000); /* 16 effective total banks */ diff --git a/src/mame/drivers/segag80v.cpp b/src/mame/drivers/segag80v.cpp index f83b59aba7c..2747a89402e 100644 --- a/src/mame/drivers/segag80v.cpp +++ b/src/mame/drivers/segag80v.cpp @@ -189,7 +189,7 @@ offs_t segag80v_state::decrypt_offset(address_space &space, offs_t offset) { /* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */ offs_t pc = space.device().safe_pcbase(); - if ((UINT16)pc == 0xffff || space.read_byte(pc) != 0x32) + if ((uint16_t)pc == 0xffff || space.read_byte(pc) != 0x32) return offset; /* fetch the low byte of the address and munge it */ @@ -215,7 +215,7 @@ WRITE8_MEMBER(segag80v_state::vectorram_w) * *************************************/ -inline UINT8 segag80v_state::demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0) +inline uint8_t segag80v_state::demangle(uint8_t d7d6, uint8_t d5d4, uint8_t d3d2, uint8_t d1d0) { return ((d7d6 << 7) & 0x80) | ((d7d6 << 2) & 0x40) | ((d5d4 << 5) & 0x20) | ((d5d4 << 0) & 0x10) | @@ -231,10 +231,10 @@ READ8_MEMBER(segag80v_state::mangled_ports_r) /* read as two bits from each of 4 ports. For this reason, the input */ /* ports have been organized logically, and are demangled at runtime. */ /* 4 input ports each provide 8 bits of information. */ - UINT8 d7d6 = ioport("D7D6")->read(); - UINT8 d5d4 = ioport("D5D4")->read(); - UINT8 d3d2 = ioport("D3D2")->read(); - UINT8 d1d0 = ioport("D1D0")->read(); + uint8_t d7d6 = ioport("D7D6")->read(); + uint8_t d5d4 = ioport("D5D4")->read(); + uint8_t d3d2 = ioport("D3D2")->read(); + uint8_t d1d0 = ioport("D1D0")->read(); int shift = offset & 3; return demangle(d7d6 >> shift, d5d4 >> shift, d3d2 >> shift, d1d0 >> shift); } @@ -255,7 +255,7 @@ WRITE8_MEMBER(segag80v_state::spinner_select_w) READ8_MEMBER(segag80v_state::spinner_input_r) { - INT8 delta; + int8_t delta; if (m_spinner_select & 1) return ioport("FC")->read(); @@ -293,7 +293,7 @@ CUSTOM_INPUT_MEMBER(segag80v_state::elim4_joint_coin_r) READ8_MEMBER(segag80v_state::elim4_input_r) { - UINT8 result = 0; + uint8_t result = 0; /* bit 3 enables demux */ if (m_spinner_select & 8) @@ -334,7 +334,7 @@ WRITE8_MEMBER(segag80v_state::multiply_w) READ8_MEMBER(segag80v_state::multiply_r) { - UINT8 result = m_mult_result; + uint8_t result = m_mult_result; m_mult_result >>= 8; return result; } diff --git a/src/mame/drivers/segahang.cpp b/src/mame/drivers/segahang.cpp index 9a729eb7c7d..33b13b57b82 100644 --- a/src/mame/drivers/segahang.cpp +++ b/src/mame/drivers/segahang.cpp @@ -30,9 +30,9 @@ // CONSTANTS //************************************************************************** -const UINT32 MASTER_CLOCK_25MHz = 25174800; -const UINT32 MASTER_CLOCK_10MHz = 10000000; -const UINT32 MASTER_CLOCK_8MHz = 8000000; +const uint32_t MASTER_CLOCK_25MHz = 25174800; +const uint32_t MASTER_CLOCK_10MHz = 10000000; +const uint32_t MASTER_CLOCK_8MHz = 8000000; //************************************************************************** // PPI READ/WRITE CALLBACKS @@ -1949,7 +1949,7 @@ ROM_END DRIVER_INIT_MEMBER(segahang_state,generic) { // point globals to allocated memory regions - m_segaic16road->segaic16_roadram_0 = reinterpret_cast(memshare("roadram")->ptr()); + m_segaic16road->segaic16_roadram_0 = reinterpret_cast(memshare("roadram")->ptr()); // save states save_item(NAME(m_adc_select)); @@ -1978,7 +1978,7 @@ DRIVER_INIT_MEMBER(segahang_state,endurobl) { DRIVER_INIT_CALL(enduror); // assemble decrypted half of ROM and register it - UINT16 *rom = reinterpret_cast(memregion("maincpu")->base()); + uint16_t *rom = reinterpret_cast(memregion("maincpu")->base()); memcpy(m_decrypted_opcodes + 0x00000/2, rom + 0x30000/2, 0x10000); memcpy(m_decrypted_opcodes + 0x10000/2, rom + 0x10000/2, 0x20000); } @@ -1988,7 +1988,7 @@ DRIVER_INIT_MEMBER(segahang_state,endurob2) DRIVER_INIT_CALL(enduror); // assemble decrypted half of ROM and register it - UINT16 *rom = reinterpret_cast(memregion("maincpu")->base()); + uint16_t *rom = reinterpret_cast(memregion("maincpu")->base()); memcpy(m_decrypted_opcodes, rom, 0x30000); } diff --git a/src/mame/drivers/segajw.cpp b/src/mame/drivers/segajw.cpp index fa372b4ea55..5be8ec1a10d 100644 --- a/src/mame/drivers/segajw.cpp +++ b/src/mame/drivers/segajw.cpp @@ -71,12 +71,12 @@ protected: // driver_device overrides virtual void machine_start() override; virtual void machine_reset() override; - UINT64 m_coin_start_cycles; - UINT64 m_hopper_start_cycles; - UINT8 m_coin_counter; - UINT8 m_coin_lockout; - UINT8 m_hopper_ctrl; - UINT8 m_lamps[2]; + uint64_t m_coin_start_cycles; + uint64_t m_hopper_start_cycles; + uint8_t m_coin_counter; + uint8_t m_coin_lockout; + uint8_t m_hopper_ctrl; + uint8_t m_lamps[2]; }; @@ -146,7 +146,7 @@ INPUT_CHANGED_MEMBER( segajw_state::coin_drop_start ) CUSTOM_INPUT_MEMBER( segajw_state::hopper_sensors_r ) { - UINT8 data = 0; + uint8_t data = 0; // if the hopper is active simulate the coin-out sensor if (m_hopper_start_cycles) @@ -165,7 +165,7 @@ CUSTOM_INPUT_MEMBER( segajw_state::hopper_sensors_r ) CUSTOM_INPUT_MEMBER( segajw_state::coin_sensors_r ) { - UINT8 data = 0; + uint8_t data = 0; // simulates the passage of coins through multiple sensors if (m_coin_start_cycles) diff --git a/src/mame/drivers/segald.cpp b/src/mame/drivers/segald.cpp index 08ab3f8ae9d..baccda5a7e4 100644 --- a/src/mame/drivers/segald.cpp +++ b/src/mame/drivers/segald.cpp @@ -39,16 +39,16 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_nmi_enable; + uint8_t m_nmi_enable; required_device m_laserdisc; - required_shared_ptr m_obj_ram; - required_shared_ptr m_out_ram; - required_shared_ptr m_color_ram; - required_shared_ptr m_fix_ram; + required_shared_ptr m_obj_ram; + required_shared_ptr m_out_ram; + required_shared_ptr m_color_ram; + required_shared_ptr m_fix_ram; - UINT8 m_ldv1000_input_latch; - UINT8 m_ldv1000_output_latch; + uint8_t m_ldv1000_input_latch; + uint8_t m_ldv1000_output_latch; DECLARE_READ8_MEMBER(astron_DISC_read); DECLARE_READ8_MEMBER(astron_OUT_read); @@ -62,7 +62,7 @@ public: DECLARE_WRITE8_MEMBER(astron_io_bankswitch_w); DECLARE_DRIVER_INIT(astron); virtual void machine_start() override; - UINT32 screen_update_astron(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_astron(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void astron_draw_characters(bitmap_rgb32 &bitmap,const rectangle &cliprect); void astron_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; @@ -73,7 +73,7 @@ public: /* VIDEO GOODS */ void segald_state::astron_draw_characters(bitmap_rgb32 &bitmap,const rectangle &cliprect) { - UINT8 characterX, characterY; + uint8_t characterX, characterY; for (characterX = 0; characterX < 32; characterX++) { @@ -89,14 +89,14 @@ void segald_state::astron_draw_characters(bitmap_rgb32 &bitmap,const rectangle & void segald_state::astron_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) { /* Heisted from Daphne */ - const UINT8 SPR_Y_TOP = 0; -/* const UINT8 SPR_Y_BOTTOM = 1;*/ - const UINT8 SPR_X_LO = 2; -/* const UINT8 SPR_X_HI = 3;*/ -/* const UINT8 SPR_SKIP_LO = 4;*/ -/* const UINT8 SPR_SKIP_HI = 5;*/ -/* const UINT8 SPR_GFXOFS_LO = 6;*/ -/* const UINT8 SPR_GFXOFS_HI = 7;*/ + const uint8_t SPR_Y_TOP = 0; +/* const uint8_t SPR_Y_BOTTOM = 1;*/ + const uint8_t SPR_X_LO = 2; +/* const uint8_t SPR_X_HI = 3;*/ +/* const uint8_t SPR_SKIP_LO = 4;*/ +/* const uint8_t SPR_SKIP_HI = 5;*/ +/* const uint8_t SPR_GFXOFS_LO = 6;*/ +/* const uint8_t SPR_GFXOFS_HI = 7;*/ int sx,sy; int spr_number; @@ -114,7 +114,7 @@ void segald_state::astron_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cl } -UINT32 segald_state::screen_update_astron(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t segald_state::screen_update_astron(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); @@ -212,9 +212,9 @@ WRITE8_MEMBER(segald_state::astron_OBJ_write) WRITE8_MEMBER(segald_state::astron_COLOR_write) { - UINT8 r, g, b, a; - UINT8 highBits, lowBits; - const UINT8 palIndex = offset >> 1; + uint8_t r, g, b, a; + uint8_t highBits, lowBits; + const uint8_t palIndex = offset >> 1; /* Combine */ m_color_ram[offset] = data; @@ -599,7 +599,7 @@ ROM_END DRIVER_INIT_MEMBER(segald_state,astron) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x8000], 0x4000); } diff --git a/src/mame/drivers/segam1.cpp b/src/mame/drivers/segam1.cpp index b31dbbf56fb..2b492439475 100644 --- a/src/mame/drivers/segam1.cpp +++ b/src/mame/drivers/segam1.cpp @@ -46,7 +46,7 @@ public: { } virtual void video_start() override; - UINT32 screen_update_segam1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_segam1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -54,7 +54,7 @@ void segam1_state::video_start() { } -UINT32 segam1_state::screen_update_segam1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t segam1_state::screen_update_segam1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/segaorun.cpp b/src/mame/drivers/segaorun.cpp index 6e8233bdd21..b83934e5e39 100644 --- a/src/mame/drivers/segaorun.cpp +++ b/src/mame/drivers/segaorun.cpp @@ -285,9 +285,9 @@ Notes: // CONSTANTS //************************************************************************** -const UINT32 MASTER_CLOCK = XTAL_40MHz; -const UINT32 SOUND_CLOCK = XTAL_16MHz; -const UINT32 MASTER_CLOCK_25MHz = XTAL_25_1748MHz; +const uint32_t MASTER_CLOCK = XTAL_40MHz; +const uint32_t SOUND_CLOCK = XTAL_16MHz; +const uint32_t MASTER_CLOCK_25MHz = XTAL_25_1748MHz; //************************************************************************** // PPI READ/WRITE CALLBACKS @@ -361,14 +361,14 @@ WRITE8_MEMBER( segaorun_state::video_control_w ) READ8_MEMBER( segaorun_state::bankmotor_limit_r ) { - UINT8 ret = 0xff; + uint8_t ret = 0xff; // PPI Input port A: // D5: left limit // D4: center // D3: right limit // other bits: ? - UINT8 pos = m_bankmotor_pos >> 8 & 0xff; + uint8_t pos = m_bankmotor_pos >> 8 & 0xff; // these values may need to be tweaked when hooking up real motors to MAME const int left_limit = 0x20; @@ -434,7 +434,7 @@ WRITE8_MEMBER( segaorun_state::bankmotor_control_w ) // mapping for a given index //------------------------------------------------- -void segaorun_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index) +void segaorun_state::memory_mapper(sega_315_5195_mapper_device &mapper, uint8_t index) { switch (index) { @@ -475,7 +475,7 @@ void segaorun_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 in // port on the memory mapper is read //------------------------------------------------- -UINT8 segaorun_state::mapper_sound_r() +uint8_t segaorun_state::mapper_sound_r() { return 0; } @@ -486,7 +486,7 @@ UINT8 segaorun_state::mapper_sound_r() // port on the memory mapper is written //------------------------------------------------- -void segaorun_state::mapper_sound_w(UINT8 data) +void segaorun_state::mapper_sound_w(uint8_t data) { synchronize(TID_SOUND_WRITE, data); } @@ -2898,7 +2898,7 @@ DRIVER_INIT_MEMBER(segaorun_state,generic) m_nvram->set_base(m_workram, m_workram.bytes()); // point globals to allocated memory regions - m_segaic16road->segaic16_roadram_0 = reinterpret_cast(memshare("roadram")->ptr()); + m_segaic16road->segaic16_roadram_0 = reinterpret_cast(memshare("roadram")->ptr()); // save state save_item(NAME(m_adc_select)); @@ -2923,27 +2923,27 @@ DRIVER_INIT_MEMBER(segaorun_state,outrunb) DRIVER_INIT_CALL(outrun); // hard code a memory map - static const UINT8 memory_map[] = { 0x02,0x00,0x0d,0x10,0x00,0x12,0x0c,0x13,0x08,0x14,0x0f,0x20,0x00,0x00,0x00,0x00 }; + static const uint8_t memory_map[] = { 0x02,0x00,0x0d,0x10,0x00,0x12,0x0c,0x13,0x08,0x14,0x0f,0x20,0x00,0x00,0x00,0x00 }; m_custom_map = memory_map; // main CPU: swap bits 11,12 and 6,7 - UINT16 *word = (UINT16 *)memregion("maincpu")->base(); - UINT32 length = memregion("maincpu")->bytes() / 2; - for (UINT32 i = 0; i < length; i++) + uint16_t *word = (uint16_t *)memregion("maincpu")->base(); + uint32_t length = memregion("maincpu")->bytes() / 2; + for (uint32_t i = 0; i < length; i++) word[i] = BITSWAP16(word[i], 15,14,11,12,13,10,9,8,6,7,5,4,3,2,1,0); // sub CPU: swap bits 14,15 and 2,3 - word = (UINT16 *)memregion("subcpu")->base(); + word = (uint16_t *)memregion("subcpu")->base(); length = memregion("subcpu")->bytes() / 2; - for (UINT32 i = 0; i < length; i++) + for (uint32_t i = 0; i < length; i++) word[i] = BITSWAP16(word[i], 14,15,13,12,11,10,9,8,7,6,5,4,2,3,1,0); // road gfx // rom a-2.bin: swap bits 6,7 // rom a-3.bin: swap bits 5,6 - UINT8 *byte = memregion("gfx3")->base(); + uint8_t *byte = memregion("gfx3")->base(); length = memregion("gfx3")->bytes() / 2; - for (UINT32 i = 0; i < length; i++) + for (uint32_t i = 0; i < length; i++) { byte[i] = BITSWAP8(byte[i], 6,7,5,4,3,2,1,0); byte[i+length] = BITSWAP8(byte[i+length], 7,5,6,4,3,2,1,0); @@ -2952,7 +2952,7 @@ DRIVER_INIT_MEMBER(segaorun_state,outrunb) // Z80 code: swap bits 5,6 byte = memregion("soundcpu")->base(); length = memregion("soundcpu")->bytes(); - for (UINT32 i = 0; i < length; i++) + for (uint32_t i = 0; i < length; i++) byte[i] = BITSWAP8(byte[i], 7,5,6,4,3,2,1,0); } diff --git a/src/mame/drivers/segapico.cpp b/src/mame/drivers/segapico.cpp index fa953d8a9cf..686a69e889f 100644 --- a/src/mame/drivers/segapico.cpp +++ b/src/mame/drivers/segapico.cpp @@ -145,9 +145,9 @@ public: required_ioport m_io_penx; required_ioport m_io_peny; - UINT8 m_page_register; + uint8_t m_page_register; - UINT16 pico_read_penpos(int pen); + uint16_t pico_read_penpos(int pen); DECLARE_READ16_MEMBER(pico_68k_io_read); DECLARE_WRITE16_MEMBER(pico_68k_io_write); DECLARE_WRITE_LINE_MEMBER(sound_cause_irq); @@ -170,9 +170,9 @@ public: -UINT16 pico_base_state::pico_read_penpos(int pen) +uint16_t pico_base_state::pico_read_penpos(int pen) { - UINT16 penpos = 0; + uint16_t penpos = 0; switch (pen) { @@ -195,7 +195,7 @@ UINT16 pico_base_state::pico_read_penpos(int pen) READ16_MEMBER(pico_base_state::pico_68k_io_read ) { - UINT8 retdata = 0; + uint8_t retdata = 0; switch (offset) { @@ -236,7 +236,7 @@ READ16_MEMBER(pico_base_state::pico_68k_io_read ) either page 5 or page 6 is often unused. */ { - UINT8 tmp = m_io_page->read(); + uint8_t tmp = m_io_page->read(); if (tmp == 2 && m_page_register != 0x3f) { m_page_register <<= 1; diff --git a/src/mame/drivers/segapm.cpp b/src/mame/drivers/segapm.cpp index d6b61f757eb..5ccbe62838e 100644 --- a/src/mame/drivers/segapm.cpp +++ b/src/mame/drivers/segapm.cpp @@ -20,7 +20,7 @@ public: { } virtual void video_start() override; - UINT32 screen_update_segapm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_segapm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -29,7 +29,7 @@ void segapm_state::video_start() { } -UINT32 segapm_state::screen_update_segapm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t segapm_state::screen_update_segapm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/segas16a.cpp b/src/mame/drivers/segas16a.cpp index 4df3505e6c9..88378af9992 100644 --- a/src/mame/drivers/segas16a.cpp +++ b/src/mame/drivers/segas16a.cpp @@ -660,10 +660,10 @@ void segas16a_state::device_timer(emu_timer &timer, device_timer_id id, int para void segas16a_state::dumpmtmt_i8751_sim() { - UINT8 flag = m_workram[0x200/2] >> 8; - UINT8 tick = m_workram[0x200/2] & 0xff; - UINT8 sec = m_workram[0x202/2] >> 8; - UINT8 min = m_workram[0x202/2] & 0xff; + uint8_t flag = m_workram[0x200/2] >> 8; + uint8_t tick = m_workram[0x200/2] & 0xff; + uint8_t sec = m_workram[0x202/2] >> 8; + uint8_t min = m_workram[0x202/2] & 0xff; // signal a VBLANK to the main CPU m_maincpu->set_input_line(4, HOLD_LINE); @@ -792,9 +792,9 @@ READ16_MEMBER( segas16a_state::mjleague_custom_io_r ) // upper bit of the trackball controls case 0: { - UINT8 buttons = ioport("SERVICE")->read(); - UINT8 analog1 = ioport((m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read(); - UINT8 analog2 = ioport((m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read(); + uint8_t buttons = ioport("SERVICE")->read(); + uint8_t analog1 = ioport((m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read(); + uint8_t analog2 = ioport((m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read(); buttons |= (analog1 & 0x80) >> 1; buttons |= (analog2 & 0x80); return buttons; @@ -804,8 +804,8 @@ READ16_MEMBER( segas16a_state::mjleague_custom_io_r ) // player 1 select switch mapped to bit 7 case 1: { - UINT8 buttons = ioport("BUTTONS1")->read(); - UINT8 analog = ioport((m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read(); + uint8_t buttons = ioport("BUTTONS1")->read(); + uint8_t analog = ioport((m_video_control & 4) ? "ANALOGY1" : "ANALOGX1")->read(); return (buttons & 0x80) | (analog & 0x7f); } @@ -816,8 +816,8 @@ READ16_MEMBER( segas16a_state::mjleague_custom_io_r ) return (ioport("ANALOGZ1")->read() >> 4) | (ioport("ANALOGZ2")->read() & 0xf0); else { - UINT8 buttons1 = ioport("BUTTONS1")->read(); - UINT8 buttons2 = ioport("BUTTONS2")->read(); + uint8_t buttons1 = ioport("BUTTONS1")->read(); + uint8_t buttons2 = ioport("BUTTONS2")->read(); if (!(buttons1 & 0x01)) m_last_buttons1 = 0; @@ -845,8 +845,8 @@ READ16_MEMBER( segas16a_state::mjleague_custom_io_r ) // player 2 select switch mapped to bit 7 case 3: { - UINT8 buttons = ioport("BUTTONS2")->read(); - UINT8 analog = ioport((m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read(); + uint8_t buttons = ioport("BUTTONS2")->read(); + uint8_t analog = ioport((m_video_control & 4) ? "ANALOGY2" : "ANALOGX2")->read(); return (buttons & 0x80) | (analog & 0x7f); } } @@ -936,7 +936,7 @@ READ16_MEMBER( segas16a_state::sjryuko_custom_io_r ) } -void segas16a_state::sjryuko_lamp_changed_w(UINT8 changed, UINT8 newval) +void segas16a_state::sjryuko_lamp_changed_w(uint8_t changed, uint8_t newval) { if ((changed & 4) && (newval & 4)) m_mj_input_num = (m_mj_input_num + 1) % 6; diff --git a/src/mame/drivers/segas16b.cpp b/src/mame/drivers/segas16b.cpp index 8f3d43a25bb..995cefe3be1 100644 --- a/src/mame/drivers/segas16b.cpp +++ b/src/mame/drivers/segas16b.cpp @@ -897,7 +897,7 @@ S11 S13 S15 S17 |EPR12194 - - - EPR12195 - - -void segas16b_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index) +void segas16b_state::memory_mapper(sega_315_5195_mapper_device &mapper, uint8_t index) { switch (index) { @@ -969,7 +969,7 @@ void segas16b_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 in // memory mapper chip //------------------------------------------------- -UINT8 segas16b_state::mapper_sound_r() +uint8_t segas16b_state::mapper_sound_r() { return 0; } @@ -980,7 +980,7 @@ UINT8 segas16b_state::mapper_sound_r() // memory mapper chip //------------------------------------------------- -void segas16b_state::mapper_sound_w(UINT8 data) +void segas16b_state::mapper_sound_w(uint8_t data) { if (m_soundlatch != nullptr) m_soundlatch->write(m_soundcpu->space(AS_PROGRAM), 0, data & 0xff); @@ -1296,9 +1296,9 @@ void segas16b_state::machine_reset() // configure sprite banks if (m_sprites.found()) { - static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; - static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 }; - const UINT8 *banklist = (m_romboard == ROM_BOARD_171_5358 || m_romboard == ROM_BOARD_171_5358_SMALL) ? alternate_banklist : default_banklist; + static const uint8_t default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; + static const uint8_t alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 }; + const uint8_t *banklist = (m_romboard == ROM_BOARD_171_5358 || m_romboard == ROM_BOARD_171_5358_SMALL) ? alternate_banklist : default_banklist; for (int banknum = 0; banknum < 16; banknum++) m_sprites->set_bank(banknum, banklist[banknum]); } @@ -1353,7 +1353,7 @@ void segas16b_state::altbeast_common_i8751_sim(offs_t soundoffs, offs_t inputoff rom_5704_bank_w(space, 1, m_workram[0x3094/2] & 0x00ff, 0x00ff); // process any new sound data - UINT16 temp = m_workram[soundoffs]; + uint16_t temp = m_workram[soundoffs]; if ((temp & 0xff00) != 0x0000) { m_mapper->write(space, 0x03, temp >> 8); @@ -1391,7 +1391,7 @@ void segas16b_state::ddux_i8751_sim() m_maincpu->set_input_line(4, HOLD_LINE); // process any new sound data - UINT16 temp = m_workram[0x0bd0/2]; + uint16_t temp = m_workram[0x0bd0/2]; if ((temp & 0xff00) != 0x0000) { address_space &space = m_maincpu->space(AS_PROGRAM); @@ -1421,7 +1421,7 @@ void segas16b_state::goldnaxe_i8751_sim() } // process any new sound data - UINT16 temp = m_workram[0x2cfc/2]; + uint16_t temp = m_workram[0x2cfc/2]; if ((temp & 0xff00) != 0x0000) { address_space &space = m_maincpu->space(AS_PROGRAM); @@ -1442,7 +1442,7 @@ void segas16b_state::goldnaxe_i8751_sim() void segas16b_state::tturf_i8751_sim() { - UINT16 temp; + uint16_t temp; // signal a VBLANK to the main CPU m_maincpu->set_input_line(4, HOLD_LINE); @@ -1474,7 +1474,7 @@ void segas16b_state::wb3_i8751_sim() m_maincpu->set_input_line(4, HOLD_LINE); // process any new sound data - UINT16 temp = m_workram[0x0008/2]; + uint16_t temp = m_workram[0x0008/2]; if ((temp & 0x00ff) != 0x0000) { address_space &space = m_maincpu->space(AS_PROGRAM); @@ -1571,7 +1571,7 @@ READ16_MEMBER( segas16b_state::dunkshot_custom_io_r ) READ16_MEMBER( segas16b_state::hwchamp_custom_io_r ) { - UINT16 result; + uint16_t result; switch (offset & (0x3000/2)) { @@ -3692,7 +3692,7 @@ static MACHINE_CONFIG_DERIVED( system16b_split, system16b ) MCFG_DEVICE_REMOVE("mapper") MACHINE_CONFIG_END -void segas16b_state::tilemap_16b_fpointbl_fill_latch(int i, UINT16* latched_pageselect, UINT16* latched_yscroll, UINT16* latched_xscroll, UINT16* textram) +void segas16b_state::tilemap_16b_fpointbl_fill_latch(int i, uint16_t* latched_pageselect, uint16_t* latched_yscroll, uint16_t* latched_xscroll, uint16_t* textram) { // grab the page regsisters from where the bootleg stores them instead, then convert them to the format the original video emulation code expects if (i == 0) @@ -8667,7 +8667,7 @@ DRIVER_INIT_MEMBER(segas16b_state,goldnaxe_5704) DRIVER_INIT_CALL(generic_5704); m_i8751_vblank_hook = i8751_sim_delegate(FUNC(segas16b_state::goldnaxe_i8751_sim), this); - static const UINT8 memory_control_5704[0x10] = + static const uint8_t memory_control_5704[0x10] = { 0x02,0x00, 0x02,0x08, 0x00,0x1f, 0x00,0xff, 0x00,0x20, 0x01,0x10, 0x00,0x14, 0x00,0xc4 }; m_i8751_initial_config = memory_control_5704; } @@ -8677,7 +8677,7 @@ DRIVER_INIT_MEMBER(segas16b_state,goldnaxe_5797) DRIVER_INIT_CALL(generic_5797); m_i8751_vblank_hook = i8751_sim_delegate(FUNC(segas16b_state::goldnaxe_i8751_sim), this); - static const UINT8 memory_control_5797[0x10] = + static const uint8_t memory_control_5797[0x10] = { 0x02,0x00, 0x00,0x1f, 0x00,0x1e, 0x00,0xff, 0x00,0x20, 0x01,0x10, 0x00,0x14, 0x00,0xc4 }; m_i8751_initial_config = memory_control_5797; } @@ -8708,7 +8708,7 @@ DRIVER_INIT_MEMBER(segas16b_state,sdi_5358_small) if (memregion("maincpux") != nullptr) { - UINT8 *rom = memregion("maincpux")->base(); + uint8_t *rom = memregion("maincpux")->base(); memcpy(m_decrypted_opcodes, rom, 0x30000); } } @@ -9012,13 +9012,13 @@ WRITE16_MEMBER( isgsm_state::cart_addr_low_w ) READ16_MEMBER( isgsm_state::cart_data_r ) { int size = memregion("gamecart_rgn")->bytes(); - UINT8 *rgn = memregion("gamecart_rgn")->base(); + uint8_t *rgn = memregion("gamecart_rgn")->base(); return rgn[(++m_cart_addr & (size - 1)) ^ 1] ^ m_read_xor; } WRITE16_MEMBER( isgsm_state::data_w ) { - UINT8 *dest = nullptr; + uint8_t *dest = nullptr; // m_data_type // rrrp o?dd @@ -9109,7 +9109,7 @@ WRITE16_MEMBER( isgsm_state::data_w ) for (int i = 0; i < bytes_to_write; i++) { - UINT8 byte = 0; + uint8_t byte = 0; if (m_data_mode & 0x8) { @@ -9189,12 +9189,12 @@ WRITE16_MEMBER( isgsm_state::cart_security_high_w ) m_security_latch = data; } -UINT32 isgsm_state::shinfz_security(UINT32 input) +uint32_t isgsm_state::shinfz_security(uint32_t input) { return BITSWAP32(input, 19, 20, 25, 26, 15, 0, 16, 2, 8, 9, 13, 14, 31, 21, 7, 18, 11, 30, 22, 17, 3, 4, 12, 28, 29, 5, 27, 10, 23, 24, 1, 6); } -UINT32 isgsm_state::tetrbx_security(UINT32 input) +uint32_t isgsm_state::tetrbx_security(uint32_t input) { // no bitswap on this cart? just returns what was written return input; @@ -9412,8 +9412,8 @@ DRIVER_INIT_MEMBER(isgsm_state,isgsm) DRIVER_INIT_CALL(generic_5521); // decrypt the bios... - std::vector temp(0x20000/2); - UINT16 *rom = (UINT16 *)memregion("bios")->base(); + std::vector temp(0x20000/2); + uint16_t *rom = (uint16_t *)memregion("bios")->base(); for (int addr = 0; addr < 0x20000/2; addr++) temp[addr ^ 0x4127] = BITSWAP16(rom[addr], 6, 14, 4, 2, 12, 10, 8, 0, 1, 9, 11, 13, 3, 5, 7, 15); memcpy(rom, &temp[0], 0x20000); @@ -9423,8 +9423,8 @@ DRIVER_INIT_MEMBER(isgsm_state,shinfz) { init_isgsm(); - std::vector temp(0x200000/2); - UINT16 *rom = (UINT16 *)memregion("gamecart_rgn")->base(); + std::vector temp(0x200000/2); + uint16_t *rom = (uint16_t *)memregion("gamecart_rgn")->base(); for (int addr = 0; addr < 0x200000/2; addr++) temp[addr ^ 0x68956] = BITSWAP16(rom[addr], 8, 4, 12, 3, 6, 7, 1, 0, 15, 11, 5, 14, 10, 2, 9, 13); memcpy(rom, &temp[0], 0x200000); @@ -9437,8 +9437,8 @@ DRIVER_INIT_MEMBER(isgsm_state,tetrbx) { init_isgsm(); - std::vector temp(0x80000/2); - UINT16 *rom = (UINT16 *)memregion("gamecart_rgn")->base(); + std::vector temp(0x80000/2); + uint16_t *rom = (uint16_t *)memregion("gamecart_rgn")->base(); for (int addr = 0; addr < 0x80000/2; addr++) temp[addr ^ 0x2A6E6] = BITSWAP16(rom[addr], 4, 0, 12, 5, 7, 3, 1, 14, 10, 11, 9, 6, 15, 2, 13, 8); memcpy(rom, &temp[0], 0x80000); diff --git a/src/mame/drivers/segas18.cpp b/src/mame/drivers/segas18.cpp index f6cafdb456c..b9a012bc170 100644 --- a/src/mame/drivers/segas18.cpp +++ b/src/mame/drivers/segas18.cpp @@ -44,9 +44,9 @@ * *************************************/ -void segas18_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index) +void segas18_state::memory_mapper(sega_315_5195_mapper_device &mapper, uint8_t index) { - UINT32 romsize = m_maincpu_region->bytes(); + uint32_t romsize = m_maincpu_region->bytes(); switch (index) { case 7: @@ -123,12 +123,12 @@ void segas18_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 ind * *************************************/ -UINT8 segas18_state::mapper_sound_r() +uint8_t segas18_state::mapper_sound_r() { return m_mcu_data; } -void segas18_state::mapper_sound_w(UINT8 data) +void segas18_state::mapper_sound_w(uint8_t data) { m_soundlatch->write(m_soundcpu->space(AS_PROGRAM), 0, data & 0xff); m_soundcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); @@ -380,7 +380,7 @@ READ16_MEMBER( segas18_state::ddcrew_custom_io_r ) READ16_MEMBER( segas18_state::lghost_custom_io_r ) { - UINT16 result; + uint16_t result; switch (offset) { case 0x3010/2: @@ -396,7 +396,7 @@ READ16_MEMBER( segas18_state::lghost_custom_io_r ) WRITE16_MEMBER( segas18_state::lghost_custom_io_w ) { - UINT8 pos_value_x, pos_value_y; + uint8_t pos_value_x, pos_value_y; switch (offset) { diff --git a/src/mame/drivers/segas24.cpp b/src/mame/drivers/segas24.cpp index 92058189954..75e27d04679 100644 --- a/src/mame/drivers/segas24.cpp +++ b/src/mame/drivers/segas24.cpp @@ -515,7 +515,7 @@ WRITE16_MEMBER( segas24_state::fdc_ctrl_w ) // I/O Mappers -UINT8 segas24_state::hotrod_io_r(UINT8 port) +uint8_t segas24_state::hotrod_io_r(uint8_t port) { switch(port) { @@ -539,20 +539,20 @@ UINT8 segas24_state::hotrod_io_r(UINT8 port) return 0x00; } -UINT8 segas24_state::dcclub_io_r(UINT8 port) +uint8_t segas24_state::dcclub_io_r(uint8_t port) { switch(port) { case 0: { - static const UINT8 pos[16] = { 0, 1, 3, 2, 6, 4, 12, 8, 9, 0, 0, 0 }; + static const uint8_t pos[16] = { 0, 1, 3, 2, 6, 4, 12, 8, 9, 0, 0, 0 }; return (m_p1->read() & 0xf) | ((~pos[m_paddle->read()>>4]<<4) & 0xf0); } case 1: return m_p2->read(); case 2: { - static const UINT8 pos[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2 }; + static const uint8_t pos[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2 }; return(~pos[m_paddle->read()>>4] & 0x03) | 0xfc; } case 3: @@ -570,7 +570,7 @@ UINT8 segas24_state::dcclub_io_r(UINT8 port) } -UINT8 segas24_state::mahmajn_io_r(UINT8 port) +uint8_t segas24_state::mahmajn_io_r(uint8_t port) { switch(port) { @@ -594,7 +594,7 @@ UINT8 segas24_state::mahmajn_io_r(UINT8 port) return 0x00; } -void segas24_state::mahmajn_io_w(UINT8 port, UINT8 data) +void segas24_state::mahmajn_io_w(uint8_t port, uint8_t data) { switch(port) { @@ -610,7 +610,7 @@ void segas24_state::mahmajn_io_w(UINT8 port, UINT8 data) } } -void segas24_state::hotrod_io_w(UINT8 port, UINT8 data) +void segas24_state::hotrod_io_w(uint8_t port, uint8_t data) { switch(port) { @@ -766,7 +766,7 @@ void segas24_state::reset_reset() prev_resetcontrol = resetcontrol; } -void segas24_state::reset_control_w(UINT8 data) +void segas24_state::reset_control_w(uint8_t data) { resetcontrol = data; reset_reset(); @@ -812,7 +812,7 @@ WRITE8_MEMBER( segas24_state::frc_mode_w ) READ8_MEMBER( segas24_state::frc_r ) { - INT32 result = (frc_cnt_timer->time_elapsed() * (frc_mode ? FRC_CLOCK_MODE1 : FRC_CLOCK_MODE0)).as_double(); + int32_t result = (frc_cnt_timer->time_elapsed() * (frc_mode ? FRC_CLOCK_MODE1 : FRC_CLOCK_MODE0)).as_double(); result %= ((frc_mode) ? 0x67 : 0x100); @@ -829,13 +829,13 @@ WRITE8_MEMBER( segas24_state::frc_w ) // Protection magic latch -const UINT8 segas24_state::mahmajn_mlt[8] = { 5, 1, 6, 2, 3, 7, 4, 0 }; -const UINT8 segas24_state::mahmajn2_mlt[8] = { 6, 0, 5, 3, 1, 4, 2, 7 }; -const UINT8 segas24_state::qgh_mlt[8] = { 3, 7, 4, 0, 2, 6, 5, 1 }; -const UINT8 segas24_state::bnzabros_mlt[8] = { 2, 4, 0, 5, 7, 3, 1, 6 }; -const UINT8 segas24_state::qrouka_mlt[8] = { 1, 6, 4, 7, 0, 5, 3, 2 }; -const UINT8 segas24_state::quizmeku_mlt[8] = { 0, 3, 2, 4, 6, 1, 7, 5 }; -const UINT8 segas24_state::dcclub_mlt[8] = { 4, 7, 3, 0, 2, 6, 5, 1 }; +const uint8_t segas24_state::mahmajn_mlt[8] = { 5, 1, 6, 2, 3, 7, 4, 0 }; +const uint8_t segas24_state::mahmajn2_mlt[8] = { 6, 0, 5, 3, 1, 4, 2, 7 }; +const uint8_t segas24_state::qgh_mlt[8] = { 3, 7, 4, 0, 2, 6, 5, 1 }; +const uint8_t segas24_state::bnzabros_mlt[8] = { 2, 4, 0, 5, 7, 3, 1, 6 }; +const uint8_t segas24_state::qrouka_mlt[8] = { 1, 6, 4, 7, 0, 5, 3, 2 }; +const uint8_t segas24_state::quizmeku_mlt[8] = { 0, 3, 2, 4, 6, 1, 7, 5 }; +const uint8_t segas24_state::dcclub_mlt[8] = { 4, 7, 3, 0, 2, 6, 5, 1 }; READ16_MEMBER( segas24_state::mlatch_r ) @@ -847,7 +847,7 @@ WRITE16_MEMBER( segas24_state::mlatch_w ) { if(ACCESSING_BITS_0_7) { int i; - UINT8 mxor = 0; + uint8_t mxor = 0; if(!mlatch_table) { logerror("Protection: magic latch accessed but no table loaded (%s:%x)\n", space.device().tag(), space.device().safe_pc()); return; @@ -996,7 +996,7 @@ WRITE16_MEMBER(segas24_state::irq_w) } case 1: if(ACCESSING_BITS_0_7) { - UINT8 old_tmode = irq_tmode; + uint8_t old_tmode = irq_tmode; irq_timer_sync(); irq_tmode = data & 3; irq_timer_start(old_tmode); @@ -1329,7 +1329,7 @@ void segas24_state::machine_start() if (m_romboard != nullptr) { - UINT8 *usr1 = m_romboard->base(); + uint8_t *usr1 = m_romboard->base(); membank("bank1")->configure_entries(0, 16, usr1, 0x40000); membank("bank2")->configure_entries(0, 16, usr1, 0x40000); } diff --git a/src/mame/drivers/segas32.cpp b/src/mame/drivers/segas32.cpp index cea37c8e02a..6129433f7ac 100644 --- a/src/mame/drivers/segas32.cpp +++ b/src/mame/drivers/segas32.cpp @@ -537,14 +537,14 @@ orunners: Interleaved with the dj and << >> buttons is the data the drives the const device_type SEGA_S32_PCB = &device_creator; -segas32_state::segas32_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segas32_state::segas32_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_S32_PCB, "Sega System 32 PCB", tag, owner, clock, "segas32_pcb", __FILE__), m_z80_shared_ram(*this,"z80_shared_ram"), m_ga2_dpram(*this,"ga2_dpram"), m_system32_workram(*this,"workram"), m_system32_videoram(*this,"videoram", 0), m_system32_spriteram(*this,"spriteram", 0), - m_system32_paletteram(*this,"paletteram.%u", 0, UINT8(0)), + m_system32_paletteram(*this,"paletteram.%u", 0, uint8_t(0)), m_ports_a(*this, {"P1_A", "P2_A", "PORTC_A", "PORTD_A", "SERVICE12_A", "SERVICE34_A", "PORTG_A", "PORTH_A"}), m_ports_b(*this, {"P1_B", "P2_B", "PORTC_B", "PORTD_B", "SERVICE12_B", "SERVICE34_B", "PORTG_B", "PORTH_B"}), m_analog_ports(*this, {"ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4", "ANALOG5", "ANALOG6", "ANALOG7", "ANALOG8"}), @@ -631,7 +631,7 @@ void segas32_state::device_reset() void segas32_state::update_irq_state() { - UINT8 effirq = m_v60_irq_control[7] & ~m_v60_irq_control[6] & 0x1f; + uint8_t effirq = m_v60_irq_control[7] & ~m_v60_irq_control[6] & 0x1f; int vector; /* loop over interrupt vectors, finding the highest priority one with */ @@ -667,7 +667,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(segas32_state::signal_v60_irq_callback) } -void segas32_state::int_control_w(address_space &space, int offset, UINT8 data) +void segas32_state::int_control_w(address_space &space, int offset, uint8_t data) { int duration; @@ -808,7 +808,7 @@ INTERRUPT_GEN_MEMBER(segas32_state::start_of_vblank_int) * *************************************/ -UINT16 segas32_state::common_io_chip_r(address_space &space, int which, offs_t offset, UINT16 mem_mask) +uint16_t segas32_state::common_io_chip_r(address_space &space, int which, offs_t offset, uint16_t mem_mask) { offset &= 0x1f/2; @@ -854,9 +854,9 @@ UINT16 segas32_state::common_io_chip_r(address_space &space, int which, offs_t o } -void segas32_state::common_io_chip_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask) +void segas32_state::common_io_chip_w(address_space &space, int which, offs_t offset, uint16_t data, uint16_t mem_mask) { -// UINT8 old; +// uint8_t old; /* only LSB matters */ if (!ACCESSING_BITS_0_7) @@ -1072,7 +1072,7 @@ WRITE32_MEMBER(segas32_state::io_expansion_1_w) READ16_MEMBER(segas32_state::analog_custom_io_r) { - UINT16 result; + uint16_t result; switch (offset) { case 0x10/2: @@ -1148,7 +1148,7 @@ READ16_MEMBER(segas32_state::sonic_custom_io_r) case 0x0c/2: case 0x10/2: case 0x14/2: - return (UINT8)(m_track_ports[offset/2]->read() - m_sonic_last[offset/2]); + return (uint8_t)(m_track_ports[offset/2]->read() - m_sonic_last[offset/2]); } logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", space.device().safe_pc(), offset*2, mem_mask); @@ -1251,7 +1251,7 @@ WRITE32_MEMBER(segas32_state::shared_ram_32_w) void segas32_state::update_sound_irq_state() { - UINT8 effirq = m_sound_irq_input & ~m_sound_irq_control[3] & 0x07; + uint8_t effirq = m_sound_irq_input & ~m_sound_irq_control[3] & 0x07; int vector; /* loop over interrupt vectors, finding the highest priority one with */ @@ -2514,7 +2514,7 @@ MACHINE_CONFIG_END const device_type SEGA_S32_REGULAR_DEVICE = &device_creator; -segas32_regular_state::segas32_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segas32_regular_state::segas32_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segas32_state(mconfig, tag, owner, clock) { } @@ -2538,7 +2538,7 @@ MACHINE_CONFIG_END const device_type SEGA_S32_V25_DEVICE = &device_creator; -segas32_v25_state::segas32_v25_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segas32_v25_state::segas32_v25_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segas32_state(mconfig, tag, owner, clock) { } @@ -2601,7 +2601,7 @@ MACHINE_CONFIG_END const device_type SEGA_MULTI32_DEVICE = &device_creator; -sega_multi32_state::sega_multi32_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +sega_multi32_state::sega_multi32_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segas32_state(mconfig, tag, owner, clock) { } @@ -2648,7 +2648,7 @@ public: DECLARE_DRIVER_INIT(f1lap); DECLARE_DRIVER_INIT(orunners); - std::unique_ptr m_dual_pcb_comms; + std::unique_ptr m_dual_pcb_comms; DECLARE_WRITE16_MEMBER(dual_pcb_comms_w); DECLARE_READ16_MEMBER(dual_pcb_comms_r); DECLARE_READ16_MEMBER(dual_pcb_masterslave); @@ -4969,13 +4969,13 @@ void segas32_state::segas32_common_init(read16_delegate custom_r, write16_delega * switches we need to fix *************************************/ -void segas32_state::radm_sw1_output( int which, UINT16 data ) +void segas32_state::radm_sw1_output( int which, uint16_t data ) { if (which == 0) machine().output().set_value("Start_lamp", BIT(data, 2)); } -void segas32_state::radm_sw2_output( int which, UINT16 data ) +void segas32_state::radm_sw2_output( int which, uint16_t data ) { if (which == 0) { @@ -4984,7 +4984,7 @@ void segas32_state::radm_sw2_output( int which, UINT16 data ) } } -void segas32_state::radr_sw2_output( int which, UINT16 data ) +void segas32_state::radr_sw2_output( int which, uint16_t data ) { if (which == 0) { @@ -4993,7 +4993,7 @@ void segas32_state::radr_sw2_output( int which, UINT16 data ) } } -void segas32_state::alien3_sw1_output( int which, UINT16 data ) +void segas32_state::alien3_sw1_output( int which, uint16_t data ) { if (which == 0) { @@ -5002,7 +5002,7 @@ void segas32_state::alien3_sw1_output( int which, UINT16 data ) } } -void segas32_state::arescue_sw1_output( int which, UINT16 data ) +void segas32_state::arescue_sw1_output( int which, uint16_t data ) { if (which == 0) { @@ -5011,7 +5011,7 @@ void segas32_state::arescue_sw1_output( int which, UINT16 data ) } } -void segas32_state::f1lap_sw1_output( int which, UINT16 data ) +void segas32_state::f1lap_sw1_output( int which, uint16_t data ) { if (which == 0) { @@ -5020,7 +5020,7 @@ void segas32_state::f1lap_sw1_output( int which, UINT16 data ) } } -void segas32_state::jpark_sw1_output( int which, UINT16 data ) +void segas32_state::jpark_sw1_output( int which, uint16_t data ) { if (which == 0) { @@ -5029,7 +5029,7 @@ void segas32_state::jpark_sw1_output( int which, UINT16 data ) } } -void segas32_state::orunners_sw1_output( int which, UINT16 data ) +void segas32_state::orunners_sw1_output( int which, uint16_t data ) { /* note ma = monitor A and mb = Monitor B */ if (which == 0) @@ -5046,7 +5046,7 @@ void segas32_state::orunners_sw1_output( int which, UINT16 data ) } } -void segas32_state::orunners_sw2_output( int which, UINT16 data ) +void segas32_state::orunners_sw2_output( int which, uint16_t data ) { /* note ma = monitor A and mb = Monitor B */ /* also note that the remaining bits are for the game's lcd display */ @@ -5063,7 +5063,7 @@ void segas32_state::orunners_sw2_output( int which, UINT16 data ) } } -void segas32_state::harddunk_sw1_output( int which, UINT16 data ) +void segas32_state::harddunk_sw1_output( int which, uint16_t data ) { if (which == 0) { @@ -5077,7 +5077,7 @@ void segas32_state::harddunk_sw1_output( int which, UINT16 data ) } } -void segas32_state::harddunk_sw2_output( int which, UINT16 data ) +void segas32_state::harddunk_sw2_output( int which, uint16_t data ) { if (which == 0) machine().output().set_value("Left_Winner_lamp", BIT(data, 0)); @@ -5085,13 +5085,13 @@ void segas32_state::harddunk_sw2_output( int which, UINT16 data ) machine().output().set_value("Right_Winner_lamp", BIT(data, 0)); } -void segas32_state::harddunk_sw3_output( int which, UINT16 data ) +void segas32_state::harddunk_sw3_output( int which, uint16_t data ) { machine().output().set_value("3P_Start_lamp", BIT(data, 4)); machine().output().set_value("6P_Start_lamp", BIT(data, 5)); } -void segas32_state::titlef_sw1_output( int which, UINT16 data ) +void segas32_state::titlef_sw1_output( int which, uint16_t data ) { if (which == 0) { @@ -5105,7 +5105,7 @@ void segas32_state::titlef_sw1_output( int which, UINT16 data ) } } -void segas32_state::titlef_sw2_output( int which, UINT16 data ) +void segas32_state::titlef_sw2_output( int which, uint16_t data ) { if (which == 0) machine().output().set_value("Blue_Corner_lamp", BIT(data, 0)); @@ -5113,7 +5113,7 @@ void segas32_state::titlef_sw2_output( int which, UINT16 data ) machine().output().set_value("Red_Corner_lamp", BIT(data, 0)); } -void segas32_state::scross_sw1_output( int which, UINT16 data ) +void segas32_state::scross_sw1_output( int which, uint16_t data ) { /* note ma = monitor A and mb = Monitor B */ if (which == 0) @@ -5122,7 +5122,7 @@ void segas32_state::scross_sw1_output( int which, UINT16 data ) machine().output().set_value("MB_Start_lamp", BIT(data, 2)); } -void segas32_state::scross_sw2_output( int which, UINT16 data ) +void segas32_state::scross_sw2_output( int which, uint16_t data ) { /* Note: I'm not an expert on digits, so I didn't know the right map to use, I just added it manually and it seems to work fine. */ if (which == 0) @@ -5191,7 +5191,7 @@ DRIVER_INIT_MEMBER(segas32_new_state, arescue) m_mainpcb->init_arescue(1); m_slavepcb->init_arescue(0); - m_dual_pcb_comms = std::make_unique(0x1000/2); + m_dual_pcb_comms = std::make_unique(0x1000/2); m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_new_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_new_state::dual_pcb_comms_w),this)); m_mainpcb->m_maincpu->space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_new_state::dual_pcb_masterslave),this)); @@ -5203,7 +5203,7 @@ DRIVER_INIT_MEMBER(segas32_new_state,f1en) { m_mainpcb->init_f1en(); m_slavepcb->init_f1en(); - m_dual_pcb_comms = std::make_unique(0x1000/2); + m_dual_pcb_comms = std::make_unique(0x1000/2); memset(m_dual_pcb_comms.get(), 0xff, 0x1000 / 2); m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_new_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_new_state::dual_pcb_comms_w),this)); @@ -5252,7 +5252,7 @@ void segas32_state::init_brival(void) segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate()); /* install protection handlers */ - m_system32_protram = std::make_unique(0x1000/2); + m_system32_protram = std::make_unique(0x1000/2); m_maincpu->space(AS_PROGRAM).install_read_handler(0x20ba00, 0x20ba07, read16_delegate(FUNC(segas32_state::brival_protection_r),this)); m_maincpu->space(AS_PROGRAM).install_write_handler(0xa00000, 0xa00fff, write16_delegate(FUNC(segas32_state::brival_protection_w),this)); } @@ -5325,7 +5325,7 @@ void segas32_state::init_holo(void) void segas32_state::init_jpark(void) { /* Temp. Patch until we emulate the 'Drive Board', thanks to Malice */ - UINT16 *pROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *pROM = (uint16_t *)memregion("maincpu")->base(); segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this)); diff --git a/src/mame/drivers/segasp.cpp b/src/mame/drivers/segasp.cpp index 6f51857d51b..a5f4fb905c2 100644 --- a/src/mame/drivers/segasp.cpp +++ b/src/mame/drivers/segasp.cpp @@ -88,7 +88,7 @@ WRITE64_MEMBER(segasp_state::sp_bank_w) { if (ACCESSING_BITS_32_63) return; - UINT16 bank = data & 0xffff; + uint16_t bank = data & 0xffff; if (bank != m_sp_bank) logerror("SystemSP: G2 Bank set to %08X%s\n", (bank & 0x3fff) << 16, (bank & 0x4000) ? " decrypt ON" :"" ); m_sp_bank = bank; @@ -139,7 +139,7 @@ READ64_MEMBER(segasp_state::sp_rombdflg_r) READ64_MEMBER(segasp_state::sp_io_r) { - UINT64 retval; + uint64_t retval; int reg = offset * 2; int shift = 0; diff --git a/src/mame/drivers/segaufo.cpp b/src/mame/drivers/segaufo.cpp index c40aa777e08..08ac876661e 100644 --- a/src/mame/drivers/segaufo.cpp +++ b/src/mame/drivers/segaufo.cpp @@ -90,14 +90,14 @@ public: { struct Motor { - UINT8 running; - UINT8 direction; + uint8_t running; + uint8_t direction; float position; float speed; } motor[4]; } m_player[2]; - UINT8 m_stepper; + uint8_t m_stepper; void motor_tick(int p, int m); @@ -161,7 +161,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ufo_state::update_info) // 3 C: 000 = closed, 100 = open for (int p = 0; p < 2; p++) for (int m = 0; m < 4; m++) - output().set_indexed_value("counter", p*4 + m, (UINT8)(m_player[p].motor[m].position * 100)); + output().set_indexed_value("counter", p*4 + m, (uint8_t)(m_player[p].motor[m].position * 100)); #if 0 char msg1[0x100] = {0}; @@ -208,7 +208,7 @@ WRITE_LINE_MEMBER(ufo_state::pit_out2) READ8_MEMBER(ufo_state::crane_limits_r) { int p = offset & 1; - UINT8 ret = 0x7f; + uint8_t ret = 0x7f; // d0: left limit sw (right for p2) // d1: right limit sw (left for p2) @@ -242,12 +242,12 @@ WRITE8_MEMBER(ufo_state::stepper_w) // controlled with 4 output bits connected to a Toshiba TB6560AHQ motor driver. // I don't know which bits connect to which pins specifically. // To run it, the game writes a continuous sequence of $5, $9, $a, $6, .. - static const UINT8 sequence[4] = + static const uint8_t sequence[4] = { 0x5, 0x9, 0xa, 0x6 }; // d0-d3: p1, d4-d7: p2 - UINT8 cur = data >> (p*4) & 0xf; - UINT8 prev = m_stepper >> (p*4) & 0xf; + uint8_t cur = data >> (p*4) & 0xf; + uint8_t prev = m_stepper >> (p*4) & 0xf; for (int i = 0; i < 4; i++) { @@ -278,7 +278,7 @@ WRITE8_MEMBER(ufo_state::cp_lamps_w) WRITE8_MEMBER(ufo_state::cp_digits_w) { - static const UINT8 lut_7448[0x10] = + static const uint8_t lut_7448[0x10] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; // d0-d3: cpanel digit @@ -329,7 +329,7 @@ WRITE8_MEMBER(ufo_state::ufo_lamps_w) READ8_MEMBER(ufo_state::ex_crane_limits_r) { int p = offset & 1; - UINT8 ret = 0xf0; + uint8_t ret = 0xf0; // d0: left limit sw (invert) // d1: right limit sw (invert) @@ -352,7 +352,7 @@ READ8_MEMBER(ufo_state::ex_crane_limits_r) READ8_MEMBER(ufo_state::ex_crane_open_r) { // d0-d3: p1, d4-d7: p2 - UINT8 ret = 0xff; + uint8_t ret = 0xff; for (int p = 0; p < 2; p++) { diff --git a/src/mame/drivers/segaxbd.cpp b/src/mame/drivers/segaxbd.cpp index 43219edf6a7..2ab905b232b 100644 --- a/src/mame/drivers/segaxbd.cpp +++ b/src/mame/drivers/segaxbd.cpp @@ -269,7 +269,7 @@ ROMs: const device_type SEGA_XBD_PCB = &device_creator; -segaxbd_state::segaxbd_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segaxbd_state::segaxbd_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SEGA_XBD_PCB, "Sega X-Board PCB", tag, owner, clock, "segaxbd_pcb", __FILE__), m_maincpu(*this, "maincpu"), m_subcpu(*this, "subcpu"), @@ -309,7 +309,7 @@ void segaxbd_state::device_start() throw device_missing_dependencies(); // point globals to allocated memory regions - m_segaic16road->segaic16_roadram_0 = reinterpret_cast(memshare("roadram")->ptr()); + m_segaic16road->segaic16_roadram_0 = reinterpret_cast(memshare("roadram")->ptr()); video_start(); @@ -412,17 +412,17 @@ public: DECLARE_DRIVER_INIT(gprider_double); - UINT16 shareram[0x800]; - UINT16 rampage1; - UINT16 rampage2; + uint16_t shareram[0x800]; + uint16_t rampage1; + uint16_t rampage2; }; //************************************************************************** // CONSTANTS //************************************************************************** -const UINT32 MASTER_CLOCK = XTAL_50MHz; -const UINT32 SOUND_CLOCK = XTAL_16MHz; +const uint32_t MASTER_CLOCK = XTAL_50MHz; +const uint32_t SOUND_CLOCK = XTAL_16MHz; @@ -447,7 +447,7 @@ void segaxbd_state::timer_ack_callback() // sound_data_w - write data to the sound CPU //------------------------------------------------- -void segaxbd_state::sound_data_w(UINT8 data) +void segaxbd_state::sound_data_w(uint8_t data) { synchronize(TID_SOUND_WRITE, data); } @@ -490,9 +490,9 @@ WRITE16_MEMBER( segaxbd_state::adc_w ) // iochip_r - helper to handle I/O chip reads //------------------------------------------------- -inline UINT16 segaxbd_state::iochip_r(int which, int port, int inputval) +inline uint16_t segaxbd_state::iochip_r(int which, int port, int inputval) { - UINT16 result = m_iochip_regs[which][port]; + uint16_t result = m_iochip_regs[which][port]; // if there's custom I/O, do that to get the input value if (!m_iochip_custom_io_r[which][port].isnull()) @@ -576,7 +576,7 @@ WRITE16_MEMBER( segaxbd_state::iochip_0_w ) data &= 0xff; // swap in the new value and remember the previous value - UINT8 oldval = m_iochip_regs[0][offset]; + uint8_t oldval = m_iochip_regs[0][offset]; m_iochip_regs[0][offset] = data; // certain offsets have common effects @@ -845,7 +845,7 @@ void segaxbd_state::device_timer(emu_timer &timer, device_timer_id id, int param // coin counters and lamps //------------------------------------------------- -void segaxbd_state::generic_iochip0_lamps_w(UINT8 data) +void segaxbd_state::generic_iochip0_lamps_w(uint8_t data) { // d0: ? // d3: always 0? @@ -874,7 +874,7 @@ void segaxbd_state::generic_iochip0_lamps_w(UINT8 data) // for Afterburner II //------------------------------------------------- -UINT8 segaxbd_state::aburner2_iochip0_motor_r(UINT8 data) +uint8_t segaxbd_state::aburner2_iochip0_motor_r(uint8_t data) { data &= 0xc0; @@ -888,7 +888,7 @@ UINT8 segaxbd_state::aburner2_iochip0_motor_r(UINT8 data) // for Afterburner II //------------------------------------------------- -void segaxbd_state::aburner2_iochip0_motor_w(UINT8 data) +void segaxbd_state::aburner2_iochip0_motor_w(uint8_t data) { // TODO } @@ -899,7 +899,7 @@ void segaxbd_state::aburner2_iochip0_motor_w(UINT8 data) // for Super Monaco GP //------------------------------------------------- -UINT8 segaxbd_state::smgp_iochip0_motor_r(UINT8 data) +uint8_t segaxbd_state::smgp_iochip0_motor_r(uint8_t data) { data &= 0xc0; @@ -913,7 +913,7 @@ UINT8 segaxbd_state::smgp_iochip0_motor_r(UINT8 data) // for Super Monaco GP //------------------------------------------------- -void segaxbd_state::smgp_iochip0_motor_w(UINT8 data) +void segaxbd_state::smgp_iochip0_motor_w(uint8_t data) { // TODO } @@ -924,7 +924,7 @@ void segaxbd_state::smgp_iochip0_motor_w(UINT8 data) // for Last Survivor //------------------------------------------------- -UINT8 segaxbd_state::lastsurv_iochip1_port_r(UINT8 data) +uint8_t segaxbd_state::lastsurv_iochip1_port_r(uint8_t data) { return m_mux_ports[m_lastsurv_mux].read_safe(0xff); } @@ -935,7 +935,7 @@ UINT8 segaxbd_state::lastsurv_iochip1_port_r(UINT8 data) // for Last Survivor //------------------------------------------------- -void segaxbd_state::lastsurv_iochip0_muxer_w(UINT8 data) +void segaxbd_state::lastsurv_iochip0_muxer_w(uint8_t data) { m_lastsurv_mux = (data >> 5) & 3; generic_iochip0_lamps_w(data & 0x9f); @@ -954,7 +954,7 @@ void segaxbd_state::lastsurv_iochip0_muxer_w(UINT8 data) void segaxbd_state::update_main_irqs() { - UINT8 irq = 0; + uint8_t irq = 0; if (m_timer_irq_state) irq |= 2; @@ -1058,7 +1058,7 @@ WRITE16_MEMBER( segaxbd_state::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; @@ -1868,7 +1868,7 @@ MACHINE_CONFIG_END const device_type SEGA_XBD_REGULAR_DEVICE = &device_creator; -segaxbd_regular_state::segaxbd_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segaxbd_regular_state::segaxbd_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segaxbd_state(mconfig, tag, owner, clock) { } @@ -1894,7 +1894,7 @@ MACHINE_CONFIG_END const device_type SEGA_XBD_FD1094_DEVICE = &device_creator; -segaxbd_fd1094_state::segaxbd_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segaxbd_fd1094_state::segaxbd_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segaxbd_state(mconfig, tag, owner, clock) { } @@ -1936,7 +1936,7 @@ MACHINE_CONFIG_END const device_type SEGA_XBD_LASTSURV_FD1094_DEVICE = &device_creator; -segaxbd_lastsurv_fd1094_state::segaxbd_lastsurv_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segaxbd_lastsurv_fd1094_state::segaxbd_lastsurv_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segaxbd_state(mconfig, tag, owner, clock) { } @@ -1966,7 +1966,7 @@ MACHINE_CONFIG_END const device_type SEGA_XBD_LASTSURV_DEVICE = &device_creator; -segaxbd_lastsurv_state::segaxbd_lastsurv_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segaxbd_lastsurv_state::segaxbd_lastsurv_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segaxbd_state(mconfig, tag, owner, clock) { } @@ -2009,7 +2009,7 @@ MACHINE_CONFIG_END const device_type SEGA_XBD_SMGP_FD1094_DEVICE = &device_creator; -segaxbd_smgp_fd1094_state::segaxbd_smgp_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segaxbd_smgp_fd1094_state::segaxbd_smgp_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segaxbd_state(mconfig, tag, owner, clock) { } @@ -2052,7 +2052,7 @@ MACHINE_CONFIG_END const device_type SEGA_XBD_SMGP_DEVICE = &device_creator; -segaxbd_smgp_state::segaxbd_smgp_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segaxbd_smgp_state::segaxbd_smgp_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segaxbd_state(mconfig, tag, owner, clock) { } @@ -2078,7 +2078,7 @@ MACHINE_CONFIG_END const device_type SEGA_XBD_RASCOT_DEVICE = &device_creator; -segaxbd_rascot_state::segaxbd_rascot_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +segaxbd_rascot_state::segaxbd_rascot_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segaxbd_state(mconfig, tag, owner, clock) { } @@ -4788,7 +4788,7 @@ DRIVER_INIT_MEMBER(segaxbd_new_state,smgp) DRIVER_INIT_MEMBER(segaxbd_new_state,rascot) { // patch out bootup link test - UINT16 *rom = reinterpret_cast(memregion("mainpcb:subcpu")->base()); + uint16_t *rom = reinterpret_cast(memregion("mainpcb:subcpu")->base()); rom[0xb78/2] = 0x601e; // subrom checksum test rom[0x57e/2] = 0x4e71; rom[0x5d0/2] = 0x6008; diff --git a/src/mame/drivers/segaybd.cpp b/src/mame/drivers/segaybd.cpp index 2c0d76e4a45..3ada97f27f9 100644 --- a/src/mame/drivers/segaybd.cpp +++ b/src/mame/drivers/segaybd.cpp @@ -71,8 +71,8 @@ MB89372 - Uses 3 serial data transfer protocols: ASYNC, COP & BOP. Has a built // CONSTANTS //************************************************************************** -const UINT32 MASTER_CLOCK = 50000000; -const UINT32 SOUND_CLOCK = 32215900; +const uint32_t MASTER_CLOCK = 50000000; +const uint32_t SOUND_CLOCK = 32215900; // use this to fiddle with the IRQ2 timing #define TWEAK_IRQ2_SCANLINE (0) @@ -166,7 +166,7 @@ READ16_MEMBER( segaybd_state::io_chip_r ) WRITE16_MEMBER( segaybd_state::io_chip_w ) { - UINT8 old; + uint8_t old; // generic implementation offset &= 0x1f/2; @@ -394,7 +394,7 @@ void segaybd_state::device_timer(emu_timer &timer, device_timer_id id, int param // Galaxy Force //------------------------------------------------- -void segaybd_state::gforce2_output_cb1(UINT16 data) +void segaybd_state::gforce2_output_cb1(uint16_t data) { logerror("gforce2_output_cb1: '%02X'\n", data & 0xFF); //bits 4, 5, and 7 seem to be used to multiplex the "LIMITSW" port signals @@ -408,7 +408,7 @@ void segaybd_state::gforce2_output_cb1(UINT16 data) // Galaxy Force //------------------------------------------------- -void segaybd_state::gforce2_output_cb2(UINT16 data) +void segaybd_state::gforce2_output_cb2(uint16_t data) { output().set_value("start_lamp", BIT(data, 2)); } @@ -419,7 +419,7 @@ void segaybd_state::gforce2_output_cb2(UINT16 data) // G-Loc //------------------------------------------------- -void segaybd_state::gloc_output_cb1(UINT16 data) +void segaybd_state::gloc_output_cb1(uint16_t data) { if (data < 32) { @@ -453,7 +453,7 @@ void segaybd_state::gloc_output_cb1(UINT16 data) // G-Loc //------------------------------------------------- -void segaybd_state::gloc_output_cb2(UINT16 data) +void segaybd_state::gloc_output_cb2(uint16_t data) { output().set_value("start_lamp", BIT(data, 2)); output().set_value("danger_lamp", BIT(data, 5)); @@ -466,7 +466,7 @@ void segaybd_state::gloc_output_cb2(UINT16 data) // G-Loc R360 //------------------------------------------------- -void segaybd_state::r360_output_cb2(UINT16 data) +void segaybd_state::r360_output_cb2(uint16_t data) { // r360 cabinet output().set_value("start_lamp", BIT(data, 2)); @@ -480,7 +480,7 @@ void segaybd_state::r360_output_cb2(UINT16 data) // Power Drift //------------------------------------------------- -void segaybd_state::pdrift_output_cb1(UINT16 data) +void segaybd_state::pdrift_output_cb1(uint16_t data) { // Note: this is an approximation to get a relatively accurate bank value. It is obviously not 100% @@ -639,7 +639,7 @@ void segaybd_state::pdrift_output_cb1(UINT16 data) // Power Drift //------------------------------------------------- -void segaybd_state::pdrift_output_cb2(UINT16 data) +void segaybd_state::pdrift_output_cb2(uint16_t data) { output().set_value("start_lamp", BIT(data, 2)); output().set_value("upright_wheel_motor", BIT(data, 1)); @@ -651,7 +651,7 @@ void segaybd_state::pdrift_output_cb2(UINT16 data) // Rail Chase //------------------------------------------------- -void segaybd_state::rchase_output_cb2(UINT16 data) +void segaybd_state::rchase_output_cb2(uint16_t data) { output().set_value("left_start_lamp", BIT(data, 2)); output().set_value("right_start_lamp", BIT(data, 1)); diff --git a/src/mame/drivers/seibuspi.cpp b/src/mame/drivers/seibuspi.cpp index 2c13b3cd65e..38d2c6c6135 100644 --- a/src/mame/drivers/seibuspi.cpp +++ b/src/mame/drivers/seibuspi.cpp @@ -938,7 +938,7 @@ WRITE8_MEMBER(seibuspi_state::z80_enable_w) READ8_MEMBER(seibuspi_state::sb_coin_r) { - UINT8 ret = m_sb_coin_latch; + uint8_t ret = m_sb_coin_latch; m_sb_coin_latch = 0; return ret; @@ -947,7 +947,7 @@ READ8_MEMBER(seibuspi_state::sb_coin_r) READ32_MEMBER(seibuspi_state::ejsakura_keyboard_r) { // coins/eeprom data - UINT32 ret = m_special->read(); + uint32_t ret = m_special->read(); // multiplexed inputs for (int i = 0; i < 5; i++) @@ -1197,7 +1197,7 @@ CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode) RON - 110 port C Start - 111 port A */ - static const UINT8 encoding[] = { 6, 5, 4, 3, 2, 7 }; + static const uint8_t encoding[] = { 6, 5, 4, 3, 2, 7 }; ioport_value state = ~m_key[(uintptr_t)param]->read(); for (int bit = 0; bit < ARRAY_LENGTH(encoding); bit++) @@ -2000,8 +2000,8 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(seibuspi_state,sys386f) { int i, j; - UINT16 *src = (UINT16 *)memregion("gfx3")->base(); - UINT16 tmp[0x40 / 2], offset; + uint16_t *src = (uint16_t *)memregion("gfx3")->base(); + uint16_t tmp[0x40 / 2], offset; // sprite_reorder() only for (i = 0; i < memregion("gfx3")->bytes() / 0x40; i++) @@ -2231,7 +2231,7 @@ READ32_MEMBER(seibuspi_state::rfjet_speedup_r) /* rfjetus */ if (space.device().safe_pc()==0x0205b39) { - UINT32 r; + uint32_t r; space.device().execute().spin_until_interrupt(); // idle // Hack to enter test mode r = m_mainram[0x002894c/4] & (~0x400); diff --git a/src/mame/drivers/seicross.cpp b/src/mame/drivers/seicross.cpp index 591b6c10760..e29c2260692 100644 --- a/src/mame/drivers/seicross.cpp +++ b/src/mame/drivers/seicross.cpp @@ -54,7 +54,7 @@ This info came from http://www.ne.jp/asahi/cc-sakura/akkun/old/fryski.html void seicross_state::nvram_init(nvram_device &nvram, void *data, size_t size) { - static const UINT8 init[32] = { + static const uint8_t init[32] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, }; @@ -594,7 +594,7 @@ ROM_END DRIVER_INIT_MEMBER(seicross_state,friskytb) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // this code is in ROM 6.3h, maps to MCU at dxxx for (int i = 0; i < 0x7800; i++) { diff --git a/src/mame/drivers/seicupbl.cpp b/src/mame/drivers/seicupbl.cpp index c257a0594ed..aa22ca69c77 100644 --- a/src/mame/drivers/seicupbl.cpp +++ b/src/mame/drivers/seicupbl.cpp @@ -45,12 +45,12 @@ public: // devices required_device m_maincpu; required_device m_audiocpu; - required_shared_ptr m_back_data; - required_shared_ptr m_fore_data; - required_shared_ptr m_mid_data; - required_shared_ptr m_textram; - required_shared_ptr m_spriteram; - required_shared_ptr m_vregs; + required_shared_ptr m_back_data; + required_shared_ptr m_fore_data; + required_shared_ptr m_mid_data; + required_shared_ptr m_textram; + required_shared_ptr m_spriteram; + required_shared_ptr m_vregs; required_device m_oki; required_device m_soundlatch; required_device m_gfxdecode; @@ -59,7 +59,7 @@ public: tilemap_t *m_sc_layer[4]; // screen updates - 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); DECLARE_WRITE8_MEMBER(okim_rombank_w); DECLARE_WRITE8_MEMBER(sound_cmd_w); DECLARE_WRITE16_MEMBER(vram_sc0_w); @@ -128,14 +128,14 @@ TILE_GET_INFO_MEMBER(seicupbl_state::get_sc3_tileinfo) void seicupbl_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect) { - UINT16 *spriteram16 = m_spriteram; + uint16_t *spriteram16 = m_spriteram; int offs,fx,fy,x,y,color,sprite,cur_pri; int dx,dy,ax,ay; int pri_mask; for (offs = 0;offs < 0x400;offs += 4) { - UINT16 data = spriteram16[offs]; + uint16_t data = spriteram16[offs]; if (!(data &0x8000)) continue; pri_mask = 0; @@ -269,7 +269,7 @@ void seicupbl_state::video_start() m_sc_layer[i]->set_transparent_pen(15); } -UINT32 seicupbl_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t seicupbl_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { /* Setup the tilemaps */ screen.priority().fill(0, cliprect); diff --git a/src/mame/drivers/selz80.cpp b/src/mame/drivers/selz80.cpp index 2666bf7d59c..6501a51e1c9 100644 --- a/src/mame/drivers/selz80.cpp +++ b/src/mame/drivers/selz80.cpp @@ -47,9 +47,9 @@ public: DECLARE_WRITE8_MEMBER(digit_w); DECLARE_READ8_MEMBER(kbd_r); DECLARE_MACHINE_RESET(dagz80); - UINT8 m_digit; + uint8_t m_digit; required_device m_maincpu; - optional_shared_ptr m_p_ram; + optional_shared_ptr m_p_ram; }; static ADDRESS_MAP_START(dagz80_mem, AS_PROGRAM, 8, selz80_state) @@ -124,8 +124,8 @@ INPUT_PORTS_END MACHINE_RESET_MEMBER(selz80_state, dagz80) { - UINT8* rom = memregion("user1")->base(); - UINT16 size = memregion("user1")->bytes(); + uint8_t* rom = memregion("user1")->base(); + uint16_t size = memregion("user1")->bytes(); memcpy(m_p_ram, rom, size); m_maincpu->reset(); } @@ -142,7 +142,7 @@ WRITE8_MEMBER( selz80_state::digit_w ) READ8_MEMBER( selz80_state::kbd_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_digit < 4) { diff --git a/src/mame/drivers/sengokmj.cpp b/src/mame/drivers/sengokmj.cpp index 27c82c68996..a3116ec5126 100644 --- a/src/mame/drivers/sengokmj.cpp +++ b/src/mame/drivers/sengokmj.cpp @@ -79,21 +79,21 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_sc0_vram; - required_shared_ptr m_sc1_vram; - required_shared_ptr m_sc2_vram; - required_shared_ptr m_sc3_vram; - required_shared_ptr m_spriteram16; + required_shared_ptr m_sc0_vram; + required_shared_ptr m_sc1_vram; + required_shared_ptr m_sc2_vram; + required_shared_ptr m_sc3_vram; + required_shared_ptr m_spriteram16; tilemap_t *m_sc0_tilemap; tilemap_t *m_sc1_tilemap; tilemap_t *m_sc2_tilemap; tilemap_t *m_sc3_tilemap; - UINT16 m_mux_data; - UINT8 m_hopper_io; - UINT16 m_layer_en; - UINT16 m_scrollram[6]; + uint16_t m_mux_data; + uint8_t m_hopper_io; + uint16_t m_layer_en; + uint16_t m_scrollram[6]; DECLARE_READ16_MEMBER(mahjong_panel_r); DECLARE_WRITE16_MEMBER(mahjong_panel_w); @@ -117,7 +117,7 @@ public: virtual void video_start() override; void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); - 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); }; @@ -307,7 +307,7 @@ void sengokmj_state::video_start() save_item(NAME(m_scrollram)); } -UINT32 sengokmj_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sengokmj_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->pen(0x7ff), cliprect); //black pen @@ -346,7 +346,7 @@ READ16_MEMBER(sengokmj_state::mahjong_panel_r) { const char *const mpnames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" }; int i; - UINT16 res = 0xffff; + uint16_t res = 0xffff; for(i=0;i<5;i++) { diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp index 170c3abbce1..d44f01199d4 100644 --- a/src/mame/drivers/seta.cpp +++ b/src/mame/drivers/seta.cpp @@ -1390,7 +1390,7 @@ static void uPD71054_update_timer( running_machine &machine, device_t *cpu, int { seta_state *state = machine.driver_data(); uPD71054_state *uPD71054 = &state->m_uPD71054; - UINT16 max = uPD71054->max[no]&0xffff; + uint16_t max = uPD71054->max[no]&0xffff; if( max != 0 ) { attotime period = attotime::from_hz(machine.device("maincpu")->unscaled_clock()) * (16 * max); @@ -1522,7 +1522,7 @@ WRITE_LINE_MEMBER(seta_state::pit_out0) READ16_MEMBER(seta_state::sharedram_68000_r) { - return ((UINT16)m_sharedram[offset]) & 0xff; + return ((uint16_t)m_sharedram[offset]) & 0xff; } WRITE16_MEMBER(seta_state::sharedram_68000_w) @@ -1573,7 +1573,7 @@ WRITE16_MEMBER(seta_state::sub_ctrl_w) /* DSW reading for 16 bit CPUs */ READ16_MEMBER(seta_state::seta_dsw_r) { - UINT16 dsw = ioport("DSW")->read(); + uint16_t dsw = ioport("DSW")->read(); if (offset == 0) return (dsw >> 8) & 0xff; else return (dsw >> 0) & 0xff; } @@ -2107,7 +2107,7 @@ ADDRESS_MAP_END Kero Kero Keroppi no Issyoni Asobou ***************************************************************************/ -static const UINT16 keroppi_protection_word[] = { +static const uint16_t keroppi_protection_word[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x2000, 0x2000, 0x2000, @@ -2119,7 +2119,7 @@ static const UINT16 keroppi_protection_word[] = { READ16_MEMBER(seta_state::keroppi_protection_r) { - UINT16 result = keroppi_protection_word[m_keroppi_protection_count]; + uint16_t result = keroppi_protection_word[m_keroppi_protection_count]; m_keroppi_protection_count++; if (m_keroppi_protection_count > 15) @@ -2137,7 +2137,7 @@ READ16_MEMBER(seta_state::keroppi_protection_init_r) READ16_MEMBER(seta_state::keroppi_coin_r) { - UINT16 result = m_coins->read(); + uint16_t result = m_coins->read(); if (m_keroppi_prize_hop == 2) { @@ -2358,7 +2358,7 @@ WRITE16_MEMBER(seta_state::setaroul_spritecode_w) READ16_MEMBER(seta_state::setaroul_spritecode_r) { - UINT16 ret; + uint16_t ret; if ((offset&1)==1) ret = m_seta001->spritecodelow_r8(space, offset>>1); else @@ -3124,7 +3124,7 @@ ADDRESS_MAP_END WRITE8_MEMBER(seta_state::sub_bankswitch_w) { - UINT8 *rom = memregion("sub")->base(); + uint8_t *rom = memregion("sub")->base(); int bank = data >> 4; membank("bank1")->set_base(&rom[bank * 0x4000 + 0xc000]); @@ -11411,7 +11411,7 @@ READ16_MEMBER(seta_state::downtown_protection_r) { case 0xa3: { - static const UINT8 word[] = "WALTZ0"; + static const uint8_t word[] = "WALTZ0"; if (offset >= 0x100/2 && offset <= 0x10a/2) return word[offset-0x100/2]; else return 0; } @@ -11453,7 +11453,7 @@ DRIVER_INIT_MEMBER(seta_state,arbalest) DRIVER_INIT_MEMBER(seta_state,metafox) { - UINT16 *RAM = (UINT16 *) memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *) memregion("maincpu")->base(); /* This game uses the 21c000-21ffff area for protection? */ // m_maincpu->space(AS_PROGRAM).nop_readwrite(0x21c000, 0x21ffff); @@ -11469,11 +11469,11 @@ DRIVER_INIT_MEMBER(seta_state,blandia) /* rearrange the gfx data so it can be decoded in the same way as the other set */ int rom_size; - UINT8 *rom; + uint8_t *rom; int rpos; rom_size = 0x80000; - std::vector buf(rom_size); + std::vector buf(rom_size); rom = memregion("gfx2")->base() + 0x40000; @@ -11510,7 +11510,7 @@ DRIVER_INIT_MEMBER(seta_state,zombraid) DRIVER_INIT_MEMBER(seta_state,kiwame) { - UINT16 *RAM = (UINT16 *) memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *) memregion("maincpu")->base(); /* WARNING: This game writes to the interrupt vector table. Lev 1 routine address is stored at $100 */ @@ -11527,9 +11527,9 @@ DRIVER_INIT_MEMBER(seta_state,rezon) DRIVER_INIT_MEMBER(seta_state,wiggie) { - UINT8 *src; + uint8_t *src; int len; - UINT8 temp[16]; + uint8_t temp[16]; int i,j; src = memregion("maincpu")->base(); @@ -11561,7 +11561,7 @@ DRIVER_INIT_MEMBER(seta_state,wiggie) DRIVER_INIT_MEMBER(seta_state,crazyfgt) { - UINT16 *RAM = (UINT16 *) memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *) memregion("maincpu")->base(); // protection check at boot RAM[0x1078/2] = 0x4e71; @@ -11578,7 +11578,7 @@ DRIVER_INIT_MEMBER(seta_state,crazyfgt) DRIVER_INIT_MEMBER(seta_state,inttoote) { - UINT16 *ROM = (UINT16 *)memregion( "maincpu" )->base(); + uint16_t *ROM = (uint16_t *)memregion( "maincpu" )->base(); // missing / unused video regs m_vregs.allocate(3); @@ -11592,7 +11592,7 @@ DRIVER_INIT_MEMBER(seta_state,inttoote) DRIVER_INIT_MEMBER(seta_state,inttootea) { - //UINT16 *ROM = (UINT16 *)memregion( "maincpu" )->base(); + //uint16_t *ROM = (uint16_t *)memregion( "maincpu" )->base(); // missing / unused video regs m_vregs.allocate(3); diff --git a/src/mame/drivers/seta2.cpp b/src/mame/drivers/seta2.cpp index caa44a63c32..a35bcc51ff6 100644 --- a/src/mame/drivers/seta2.cpp +++ b/src/mame/drivers/seta2.cpp @@ -128,7 +128,7 @@ WRITE16_MEMBER(seta2_state::sound_bank_w) { if (ACCESSING_BITS_0_7) { - UINT8 *ROM = memregion( "x1snd" )->base(); + uint8_t *ROM = memregion( "x1snd" )->base(); int banks = (memregion( "x1snd" )->bytes() - 0x100000) / 0x20000; if (data >= banks) { @@ -329,7 +329,7 @@ ADDRESS_MAP_END The offset to use is stored in RAM at address 0x20BA16 */ READ16_MEMBER(seta2_state::pzlbowl_protection_r) { - UINT32 address = (space.read_word(0x20ba16) << 16) | space.read_word(0x20ba18); + uint32_t address = (space.read_word(0x20ba16) << 16) | space.read_word(0x20ba18); return memregion("maincpu")->base()[address - 2]; } @@ -561,7 +561,7 @@ WRITE16_MEMBER(seta2_state::staraudi_camera_w) // Tile RAM #define TILE0 (0x7c000) -#define TILERAM(offset) ((UINT16*)(memregion("sprites")->base() + TILE0 * 8*8 + (offset * 2 / 0x20000) * 2 + ((offset * 2) % 0x20000) / 2 * 8)) +#define TILERAM(offset) ((uint16_t*)(memregion("sprites")->base() + TILE0 * 8*8 + (offset * 2 / 0x20000) * 2 + ((offset * 2) % 0x20000) / 2 * 8)) READ16_MEMBER(seta2_state::staraudi_tileram_r) { @@ -627,7 +627,7 @@ class funcube_touchscreen_device : public device_t, public device_serial_interface { public: - funcube_touchscreen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + funcube_touchscreen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ioport_constructor device_input_ports() const override; template static devcb_base &set_tx_cb(device_t &device, _Object object) { return downcast(device).m_tx_cb.set_callback(object); } @@ -646,9 +646,9 @@ private: required_ioport m_y; required_ioport m_btn; - UINT8 m_button_state; + uint8_t m_button_state; int m_serial_pos; - UINT8 m_serial[4]; + uint8_t m_serial[4]; }; const device_type FUNCUBE_TOUCHSCREEN = &device_creator; @@ -664,7 +664,7 @@ static INPUT_PORTS_START( funcube_touchscreen ) PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_Y ) PORT_MINMAX(0,0x46+1) PORT_CROSSHAIR(Y, -(0xf0-8.0)/0xf0*0x047/0x46, -1.0/0x46, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(5) PORT_REVERSE INPUT_PORTS_END -funcube_touchscreen_device::funcube_touchscreen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +funcube_touchscreen_device::funcube_touchscreen_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, FUNCUBE_TOUCHSCREEN, "Funcube Touchscreen", tag, owner, clock, "funcube_touchscrene", __FILE__), device_serial_interface(mconfig, *this), m_tx_cb(*this), @@ -708,7 +708,7 @@ void funcube_touchscreen_device::device_timer(emu_timer &timer, device_timer_id return; } - UINT8 button_state = m_btn->read(); + uint8_t button_state = m_btn->read(); if(m_button_state != button_state) { m_button_state = button_state; m_serial[0] = button_state ? 0xfe : 0xfd; @@ -737,7 +737,7 @@ void funcube_touchscreen_device::tra_callback() // RAM shared with the sub CPU READ32_MEMBER(seta2_state::funcube_nvram_dword_r) { - UINT16 val = m_nvram[offset]; + uint16_t val = m_nvram[offset]; return ((val & 0xff00) << 8) | (val & 0x00ff); } @@ -768,7 +768,7 @@ READ16_MEMBER(seta2_state::spriteram16_word_r) READ32_MEMBER(seta2_state::funcube_debug_r) { - UINT32 ret = ioport("DEBUG")->read(); + uint32_t ret = ioport("DEBUG")->read(); // This bits let you move the crosshair in the inputs / touch panel test with a joystick if (!(m_screen->frame_number() % 3)) @@ -785,12 +785,12 @@ WRITE32_MEMBER(seta2_state::oki_write) { if (ACCESSING_BITS_0_7) { - const UINT8 tmp = (data & 0x000000ff); + const uint8_t tmp = (data & 0x000000ff); m_oki->write_TMP_register(tmp); } else if (ACCESSING_BITS_16_23) { - const UINT8 cmd = (data & 0x00ff0000) >> 16; + const uint8_t cmd = (data & 0x00ff0000) >> 16; m_oki->write_command(cmd); } } @@ -849,17 +849,17 @@ ADDRESS_MAP_END READ16_MEMBER(seta2_state::funcube_coins_r) { - UINT8 ret = ioport("SWITCH")->read(); - UINT8 coin_bit0 = 1; // active low - UINT8 coin_bit1 = 1; + uint8_t ret = ioport("SWITCH")->read(); + uint8_t coin_bit0 = 1; // active low + uint8_t coin_bit1 = 1; - UINT8 hopper_bit = (m_funcube_hopper_motor && !(m_screen->frame_number()%20)) ? 1 : 0; + uint8_t hopper_bit = (m_funcube_hopper_motor && !(m_screen->frame_number()%20)) ? 1 : 0; - const UINT64 coin_total_cycles = FUNCUBE_SUB_CPU_CLOCK / (1000/20); + const uint64_t coin_total_cycles = FUNCUBE_SUB_CPU_CLOCK / (1000/20); if ( m_funcube_coin_start_cycles ) { - UINT64 elapsed = downcast(&space.device())->total_cycles() - m_funcube_coin_start_cycles; + uint64_t elapsed = downcast(&space.device())->total_cycles() - m_funcube_coin_start_cycles; if ( elapsed < coin_total_cycles/2 ) coin_bit0 = 0; @@ -2793,8 +2793,8 @@ ROM_END DRIVER_INIT_MEMBER(seta2_state,funcube) { - UINT32 *main_cpu = (UINT32 *) memregion("maincpu")->base(); - UINT16 *sub_cpu = (UINT16 *) memregion("sub")->base(); + uint32_t *main_cpu = (uint32_t *) memregion("maincpu")->base(); + uint16_t *sub_cpu = (uint16_t *) memregion("sub")->base(); main_cpu[0x064/4] = 0x0000042a; // PIC protection? @@ -2804,8 +2804,8 @@ DRIVER_INIT_MEMBER(seta2_state,funcube) DRIVER_INIT_MEMBER(seta2_state,funcube2) { - UINT32 *main_cpu = (UINT32 *) memregion("maincpu")->base(); - UINT16 *sub_cpu = (UINT16 *) memregion("sub")->base(); + uint32_t *main_cpu = (uint32_t *) memregion("maincpu")->base(); + uint16_t *sub_cpu = (uint16_t *) memregion("sub")->base(); main_cpu[0xa5c/4] = 0x4e713e3c; // PIC protection? main_cpu[0xa74/4] = 0x4e713e3c; @@ -2817,8 +2817,8 @@ DRIVER_INIT_MEMBER(seta2_state,funcube2) DRIVER_INIT_MEMBER(seta2_state,funcube3) { - UINT32 *main_cpu = (UINT32 *) memregion("maincpu")->base(); - UINT16 *sub_cpu = (UINT16 *) memregion("sub")->base(); + uint32_t *main_cpu = (uint32_t *) memregion("maincpu")->base(); + uint16_t *sub_cpu = (uint16_t *) memregion("sub")->base(); main_cpu[0x008bc/4] = 0x4a804e71; main_cpu[0x19f0c/4] = 0x4e714e71; @@ -3527,7 +3527,7 @@ ROM_END DRIVER_INIT_MEMBER(seta2_state,staraudi) { // bad sound rom: replace the missing (zero) sample with the previous one - UINT8 *samples = memregion("x1snd")->base() + 0x100000; + uint8_t *samples = memregion("x1snd")->base() + 0x100000; for (int i = 0; i < 0x400000; i += 2) samples[i + 1] = samples[i]; } diff --git a/src/mame/drivers/sf.cpp b/src/mame/drivers/sf.cpp index f3906cae498..3efa952ebd6 100644 --- a/src/mame/drivers/sf.cpp +++ b/src/mame/drivers/sf.cpp @@ -21,7 +21,7 @@ /* The protection of the Japanese (and alt US) version */ /* I'd love to see someone dump the i8751 rom */ -void sf_state::write_dword( address_space &space, offs_t offset, UINT32 data ) +void sf_state::write_dword( address_space &space, offs_t offset, uint32_t data ) { space.write_word(offset, data >> 16); space.write_word(offset + 2, data); diff --git a/src/mame/drivers/sfbonus.cpp b/src/mame/drivers/sfbonus.cpp index 1eb8115f3cd..426126dcb84 100644 --- a/src/mame/drivers/sfbonus.cpp +++ b/src/mame/drivers/sfbonus.cpp @@ -302,13 +302,13 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_nvram; - required_shared_ptr m_1800_regs; - required_shared_ptr m_vregs; - required_shared_ptr m_2801_regs; - required_shared_ptr m_2c01_regs; - required_shared_ptr m_3000_regs; - required_shared_ptr m_3800_regs; + required_shared_ptr m_nvram; + required_shared_ptr m_1800_regs; + required_shared_ptr m_vregs; + required_shared_ptr m_2801_regs; + required_shared_ptr m_2c01_regs; + required_shared_ptr m_3000_regs; + required_shared_ptr m_3800_regs; std::unique_ptr m_temp_reel_bitmap; tilemap_t *m_tilemap; @@ -316,12 +316,12 @@ public: tilemap_t *m_reel2_tilemap; tilemap_t *m_reel3_tilemap; tilemap_t *m_reel4_tilemap; - std::unique_ptr m_tilemap_ram; - std::unique_ptr m_reel_ram; - std::unique_ptr m_reel2_ram; - std::unique_ptr m_reel3_ram; - std::unique_ptr m_reel4_ram; - std::unique_ptr m_videoram; + std::unique_ptr m_tilemap_ram; + std::unique_ptr m_reel_ram; + std::unique_ptr m_reel2_ram; + std::unique_ptr m_reel3_ram; + std::unique_ptr m_reel4_ram; + std::unique_ptr m_videoram; DECLARE_WRITE8_MEMBER(sfbonus_videoram_w); DECLARE_WRITE8_MEMBER(sfbonus_bank_w); @@ -451,14 +451,14 @@ public: DECLARE_DRIVER_INIT(tighookv); DECLARE_DRIVER_INIT(robadv); DECLARE_DRIVER_INIT(pirpok2d); - void sfbonus_bitswap(UINT8 xor0, UINT8 b00, UINT8 b01, UINT8 b02, UINT8 b03, UINT8 b04, UINT8 b05, UINT8 b06,UINT8 b07, - UINT8 xor1, UINT8 b10, UINT8 b11, UINT8 b12, UINT8 b13, UINT8 b14, UINT8 b15, UINT8 b16,UINT8 b17, - UINT8 xor2, UINT8 b20, UINT8 b21, UINT8 b22, UINT8 b23, UINT8 b24, UINT8 b25, UINT8 b26,UINT8 b27, - UINT8 xor3, UINT8 b30, UINT8 b31, UINT8 b32, UINT8 b33, UINT8 b34, UINT8 b35, UINT8 b36,UINT8 b37, - UINT8 xor4, UINT8 b40, UINT8 b41, UINT8 b42, UINT8 b43, UINT8 b44, UINT8 b45, UINT8 b46,UINT8 b47, - UINT8 xor5, UINT8 b50, UINT8 b51, UINT8 b52, UINT8 b53, UINT8 b54, UINT8 b55, UINT8 b56,UINT8 b57, - UINT8 xor6, UINT8 b60, UINT8 b61, UINT8 b62, UINT8 b63, UINT8 b64, UINT8 b65, UINT8 b66,UINT8 b67, - UINT8 xor7, UINT8 b70, UINT8 b71, UINT8 b72, UINT8 b73, UINT8 b74, UINT8 b75, UINT8 b76,UINT8 b77 ); + void sfbonus_bitswap(uint8_t xor0, uint8_t b00, uint8_t b01, uint8_t b02, uint8_t b03, uint8_t b04, uint8_t b05, uint8_t b06,uint8_t b07, + uint8_t xor1, uint8_t b10, uint8_t b11, uint8_t b12, uint8_t b13, uint8_t b14, uint8_t b15, uint8_t b16,uint8_t b17, + uint8_t xor2, uint8_t b20, uint8_t b21, uint8_t b22, uint8_t b23, uint8_t b24, uint8_t b25, uint8_t b26,uint8_t b27, + uint8_t xor3, uint8_t b30, uint8_t b31, uint8_t b32, uint8_t b33, uint8_t b34, uint8_t b35, uint8_t b36,uint8_t b37, + uint8_t xor4, uint8_t b40, uint8_t b41, uint8_t b42, uint8_t b43, uint8_t b44, uint8_t b45, uint8_t b46,uint8_t b47, + uint8_t xor5, uint8_t b50, uint8_t b51, uint8_t b52, uint8_t b53, uint8_t b54, uint8_t b55, uint8_t b56,uint8_t b57, + uint8_t xor6, uint8_t b60, uint8_t b61, uint8_t b62, uint8_t b63, uint8_t b64, uint8_t b65, uint8_t b66,uint8_t b67, + uint8_t xor7, uint8_t b70, uint8_t b71, uint8_t b72, uint8_t b73, uint8_t b74, uint8_t b75, uint8_t b76,uint8_t b77 ); TILE_GET_INFO_MEMBER(get_sfbonus_tile_info); TILE_GET_INFO_MEMBER(get_sfbonus_reel_tile_info); TILE_GET_INFO_MEMBER(get_sfbonus_reel2_tile_info); @@ -467,7 +467,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; void draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int category); - UINT32 screen_update_sfbonus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sfbonus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -939,9 +939,9 @@ void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, int i; int startclipmin; const rectangle &visarea = screen.visible_area(); - UINT8* selectbase = &m_videoram[0x600]; - UINT8* bg_scroll = &m_videoram[0x000]; - UINT8* reels_rowscroll = &m_videoram[0x400]; + uint8_t* selectbase = &m_videoram[0x600]; + uint8_t* bg_scroll = &m_videoram[0x000]; + uint8_t* reels_rowscroll = &m_videoram[0x400]; int globalyscrollreels = (m_vregs[6] | m_vregs[7]<<8); int globalxscrollreels = (m_vregs[4] | m_vregs[5]<<8); globalyscrollreels += 8; @@ -1068,11 +1068,11 @@ void sfbonus_state::draw_reel_layer(screen_device &screen, bitmap_ind16 &bitmap, } -UINT32 sfbonus_state::screen_update_sfbonus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sfbonus_state::screen_update_sfbonus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int globalyscroll = (m_vregs[2] | m_vregs[3]<<8); int globalxscroll = (m_vregs[0] | m_vregs[1]<<8); - UINT8* front_rowscroll = &m_videoram[0x200]; + uint8_t* front_rowscroll = &m_videoram[0x200]; ioport_constructor ipt; int i; @@ -1093,8 +1093,8 @@ UINT32 sfbonus_state::screen_update_sfbonus(screen_device &screen, bitmap_ind16 { for (x=0;x<512;x++) { - UINT16* src = &m_temp_reel_bitmap->pix16(y, x); - UINT16* dst = &bitmap.pix16(y, x); + uint16_t* src = &m_temp_reel_bitmap->pix16(y, x); + uint16_t* dst = &bitmap.pix16(y, x); if ((src[0]&0x100)==0x000) dst[0] = src[0]; @@ -1119,8 +1119,8 @@ UINT32 sfbonus_state::screen_update_sfbonus(screen_device &screen, bitmap_ind16 { for (x=0;x<512;x++) { - UINT16* src = &m_temp_reel_bitmap->pix16(y, x); - UINT16* dst = &bitmap.pix16(y, x); + uint16_t* src = &m_temp_reel_bitmap->pix16(y, x); + uint16_t* dst = &bitmap.pix16(y, x); if ((src[0]&0x100)==0x100) dst[0] = src[0]-0x100; @@ -1212,8 +1212,8 @@ ADDRESS_MAP_END WRITE8_MEMBER(sfbonus_state::sfbonus_bank_w) { - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 bank; + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t bank; bank = data & 7; @@ -1346,7 +1346,7 @@ GFXDECODE_END void sfbonus_state::machine_reset() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->set_base(&ROM[0]); } @@ -5847,27 +5847,27 @@ ROM_END DRIVER_INIT_MEMBER(sfbonus_state,sfbonus_common) { - m_tilemap_ram = std::make_unique(0x4000); + m_tilemap_ram = std::make_unique(0x4000); memset(m_tilemap_ram.get(), 0xff, 0x4000); save_pointer(NAME(m_tilemap_ram.get()), 0x4000); - m_reel_ram = std::make_unique(0x0800); + m_reel_ram = std::make_unique(0x0800); memset(m_reel_ram.get(), 0xff ,0x0800); save_pointer(NAME(m_reel_ram.get()), 0x0800); - m_reel2_ram = std::make_unique(0x0800); + m_reel2_ram = std::make_unique(0x0800); memset(m_reel2_ram.get(), 0xff, 0x0800); save_pointer(NAME(m_reel2_ram.get()), 0x0800); - m_reel3_ram = std::make_unique(0x0800); + m_reel3_ram = std::make_unique(0x0800); memset(m_reel3_ram.get(), 0xff, 0x0800); save_pointer(NAME(m_reel3_ram.get()), 0x0800); - m_reel4_ram = std::make_unique(0x0800); + m_reel4_ram = std::make_unique(0x0800); memset(m_reel4_ram.get(), 0xff, 0x0800); save_pointer(NAME(m_reel4_ram.get()), 0x0800); - m_videoram = std::make_unique(0x10000); + m_videoram = std::make_unique(0x10000); memset(m_videoram.get(), 0xff, 0x10000); @@ -5875,21 +5875,21 @@ DRIVER_INIT_MEMBER(sfbonus_state,sfbonus_common) } void sfbonus_state::sfbonus_bitswap( - UINT8 xor0, UINT8 b00, UINT8 b01, UINT8 b02, UINT8 b03, UINT8 b04, UINT8 b05, UINT8 b06,UINT8 b07, - UINT8 xor1, UINT8 b10, UINT8 b11, UINT8 b12, UINT8 b13, UINT8 b14, UINT8 b15, UINT8 b16,UINT8 b17, - UINT8 xor2, UINT8 b20, UINT8 b21, UINT8 b22, UINT8 b23, UINT8 b24, UINT8 b25, UINT8 b26,UINT8 b27, - UINT8 xor3, UINT8 b30, UINT8 b31, UINT8 b32, UINT8 b33, UINT8 b34, UINT8 b35, UINT8 b36,UINT8 b37, - UINT8 xor4, UINT8 b40, UINT8 b41, UINT8 b42, UINT8 b43, UINT8 b44, UINT8 b45, UINT8 b46,UINT8 b47, - UINT8 xor5, UINT8 b50, UINT8 b51, UINT8 b52, UINT8 b53, UINT8 b54, UINT8 b55, UINT8 b56,UINT8 b57, - UINT8 xor6, UINT8 b60, UINT8 b61, UINT8 b62, UINT8 b63, UINT8 b64, UINT8 b65, UINT8 b66,UINT8 b67, - UINT8 xor7, UINT8 b70, UINT8 b71, UINT8 b72, UINT8 b73, UINT8 b74, UINT8 b75, UINT8 b76,UINT8 b77 ) + uint8_t xor0, uint8_t b00, uint8_t b01, uint8_t b02, uint8_t b03, uint8_t b04, uint8_t b05, uint8_t b06,uint8_t b07, + uint8_t xor1, uint8_t b10, uint8_t b11, uint8_t b12, uint8_t b13, uint8_t b14, uint8_t b15, uint8_t b16,uint8_t b17, + uint8_t xor2, uint8_t b20, uint8_t b21, uint8_t b22, uint8_t b23, uint8_t b24, uint8_t b25, uint8_t b26,uint8_t b27, + uint8_t xor3, uint8_t b30, uint8_t b31, uint8_t b32, uint8_t b33, uint8_t b34, uint8_t b35, uint8_t b36,uint8_t b37, + uint8_t xor4, uint8_t b40, uint8_t b41, uint8_t b42, uint8_t b43, uint8_t b44, uint8_t b45, uint8_t b46,uint8_t b47, + uint8_t xor5, uint8_t b50, uint8_t b51, uint8_t b52, uint8_t b53, uint8_t b54, uint8_t b55, uint8_t b56,uint8_t b57, + uint8_t xor6, uint8_t b60, uint8_t b61, uint8_t b62, uint8_t b63, uint8_t b64, uint8_t b65, uint8_t b66,uint8_t b67, + uint8_t xor7, uint8_t b70, uint8_t b71, uint8_t b72, uint8_t b73, uint8_t b74, uint8_t b75, uint8_t b76,uint8_t b77 ) { int i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for(i = 0; i < memregion("maincpu")->bytes(); i++) { - UINT8 x = ROM[i]; + uint8_t x = ROM[i]; switch(i & 7) { diff --git a/src/mame/drivers/sfcbox.cpp b/src/mame/drivers/sfcbox.cpp index d8c8534e5ae..8934f40c330 100644 --- a/src/mame/drivers/sfcbox.cpp +++ b/src/mame/drivers/sfcbox.cpp @@ -138,7 +138,7 @@ public: required_device m_mb90082; required_device m_s3520cf; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( port_81_r ); DECLARE_READ8_MEMBER( port_83_r ); @@ -153,7 +153,7 @@ public: DECLARE_WRITE8_MEMBER(spc_ram_100_w); }; -UINT32 sfcbox_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t sfcbox_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { m_mb90082->screen_update(screen,bitmap,cliprect); return 0; @@ -219,7 +219,7 @@ READ8_MEMBER( sfcbox_state::port_81_r ) ---- --x- SNES Transfer ACK from SNES (Bit3 of WRIO/RDIO on SNES side) ---- ---x Int0 Request (Coin-Input, Low for 44ms..80ms) (0=IRQ, 1=No) */ - UINT8 res; + uint8_t res; res = (m_screen->vblank() & 1) << 7; res = 1 << 6; diff --git a/src/mame/drivers/sfkick.cpp b/src/mame/drivers/sfkick.cpp index 57da05b35fd..291f60b074e 100644 --- a/src/mame/drivers/sfkick.cpp +++ b/src/mame/drivers/sfkick.cpp @@ -187,7 +187,7 @@ public: m_dsw2(*this, "DSW2") { } - std::unique_ptr m_main_mem; + std::unique_ptr m_main_mem; int m_bank_cfg; int m_bank[8]; int m_input_mux; @@ -249,7 +249,7 @@ void sfkick_state::sfkick_remap_banks() { case 0: /* bios */ { - UINT8 *mem = m_region_bios->base(); + uint8_t *mem = m_region_bios->base(); m_bank1->set_base(mem); m_bank2->set_base(mem+0x2000); } @@ -257,7 +257,7 @@ void sfkick_state::sfkick_remap_banks() case 1: /* ext rom */ { - UINT8 *mem = m_region_extrom->base(); + uint8_t *mem = m_region_extrom->base(); m_bank1->set_base(mem+0x4000); m_bank2->set_base(mem+0x6000); } @@ -265,7 +265,7 @@ void sfkick_state::sfkick_remap_banks() case 2: /* banked */ { - UINT8 *mem = m_region_banked->base(); + uint8_t *mem = m_region_banked->base(); m_bank1->set_base(mem+0x2000*m_bank[0]); m_bank2->set_base(mem+0x2000*m_bank[1]); } @@ -273,7 +273,7 @@ void sfkick_state::sfkick_remap_banks() case 3: /* unknown */ { - UINT8 *mem = m_region_banked->base(); + uint8_t *mem = m_region_banked->base(); m_bank1->set_base(mem+0x18000); m_bank2->set_base(mem+0x18000); } @@ -285,7 +285,7 @@ void sfkick_state::sfkick_remap_banks() { case 0: /* bios - upper part */ { - UINT8 *mem = m_region_bios->base(); + uint8_t *mem = m_region_bios->base(); m_bank3->set_base(mem+0x4000); m_bank4->set_base(mem+0x6000); } @@ -294,7 +294,7 @@ void sfkick_state::sfkick_remap_banks() case 1: /* unknown */ case 3: { - UINT8 *mem = m_region_banked->base(); + uint8_t *mem = m_region_banked->base(); m_bank3->set_base(mem+0x18000); m_bank4->set_base(mem+0x18000); } @@ -302,7 +302,7 @@ void sfkick_state::sfkick_remap_banks() case 2: /* banked */ { - UINT8 *mem = m_region_banked->base(); + uint8_t *mem = m_region_banked->base(); m_bank3->set_base(mem+0x2000*m_bank[2]); m_bank4->set_base(mem+0x2000*m_bank[3]); } @@ -314,7 +314,7 @@ void sfkick_state::sfkick_remap_banks() { case 0: /* cartridge */ { - UINT8 *mem = m_region_cartridge->base(); + uint8_t *mem = m_region_cartridge->base(); m_bank5->set_base(mem+0x4000); m_bank6->set_base(mem+0x6000); } @@ -323,7 +323,7 @@ void sfkick_state::sfkick_remap_banks() case 1: /* unknown */ case 3: { - UINT8 *mem = m_region_banked->base(); + uint8_t *mem = m_region_banked->base(); m_bank5->set_base(mem+0x18000); m_bank6->set_base(mem+0x18000); } @@ -331,7 +331,7 @@ void sfkick_state::sfkick_remap_banks() case 2: /* banked */ { - UINT8 *mem = m_region_banked->base(); + uint8_t *mem = m_region_banked->base(); m_bank5->set_base(mem+0x2000*m_bank[4]); m_bank6->set_base(mem+0x2000*m_bank[5]); } @@ -344,7 +344,7 @@ void sfkick_state::sfkick_remap_banks() case 0: /* unknown */ case 1: { - UINT8 *mem = m_region_banked->base(); + uint8_t *mem = m_region_banked->base(); m_bank7->set_base(mem+0x18000); m_bank8->set_base(mem+0x18000); } @@ -352,7 +352,7 @@ void sfkick_state::sfkick_remap_banks() case 2: /* banked */ { - UINT8 *mem = m_region_banked->base(); + uint8_t *mem = m_region_banked->base(); m_bank7->set_base(mem+0x2000*m_bank[6]); m_bank8->set_base(mem+0x2000*m_bank[7]); } @@ -614,7 +614,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(sfkick_state,sfkick) { - m_main_mem=std::make_unique(0x4000); + m_main_mem=std::make_unique(0x4000); } diff --git a/src/mame/drivers/sg1000.cpp b/src/mame/drivers/sg1000.cpp index d715508992e..0b055c86a8b 100644 --- a/src/mame/drivers/sg1000.cpp +++ b/src/mame/drivers/sg1000.cpp @@ -384,7 +384,7 @@ READ8_MEMBER( sf7000_state::ppi_pa_r ) PA7 */ - UINT8 data = 0; + uint8_t data = 0; data |= m_fdc->get_irq() ? 0x01 : 0x00; data |= m_centronics_busy << 1; diff --git a/src/mame/drivers/sg1000a.cpp b/src/mame/drivers/sg1000a.cpp index f3909fc8205..bd75fd404b9 100644 --- a/src/mame/drivers/sg1000a.cpp +++ b/src/mame/drivers/sg1000a.cpp @@ -132,7 +132,7 @@ public: DECLARE_WRITE8_MEMBER(sg1000a_coin_counter_w); DECLARE_DRIVER_INIT(sg1000a); required_device m_maincpu; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; }; diff --git a/src/mame/drivers/shadfrce.cpp b/src/mame/drivers/shadfrce.cpp index f364e6a1995..5805a88c2e0 100644 --- a/src/mame/drivers/shadfrce.cpp +++ b/src/mame/drivers/shadfrce.cpp @@ -234,7 +234,7 @@ WRITE16_MEMBER(shadfrce_state::flip_screen) READ16_MEMBER(shadfrce_state::input_ports_r) { - UINT16 data = 0xffff; + uint16_t data = 0xffff; switch (offset) { diff --git a/src/mame/drivers/shougi.cpp b/src/mame/drivers/shougi.cpp index 41f9c547922..05a90de94ed 100644 --- a/src/mame/drivers/shougi.cpp +++ b/src/mame/drivers/shougi.cpp @@ -101,10 +101,10 @@ public: required_device m_subcpu; required_device m_alpha_8201; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; - UINT8 m_control[8]; - UINT8 m_nmi_enabled; + uint8_t m_control[8]; + uint8_t m_nmi_enabled; int m_r; DECLARE_WRITE8_MEMBER(control_w); @@ -112,7 +112,7 @@ public: DECLARE_PALETTE_INIT(shougi); - 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); INTERRUPT_GEN_MEMBER(vblank_nmi); virtual void machine_start() override; @@ -165,7 +165,7 @@ void shougi_state::machine_reset() PALETTE_INIT_MEMBER(shougi_state, shougi) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); static const int resistances_b[2] = { 470, 220 }; static const int resistances_rg[3] = { 1000, 470, 220 }; double weights_r[3], weights_g[3], weights_b[2]; @@ -201,7 +201,7 @@ PALETTE_INIT_MEMBER(shougi_state, shougi) } -UINT32 shougi_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t shougi_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int offs = 0; offs < 0x4000; offs++) { diff --git a/src/mame/drivers/shtzone.cpp b/src/mame/drivers/shtzone.cpp index 59307b24c42..0ae2cd0b470 100644 --- a/src/mame/drivers/shtzone.cpp +++ b/src/mame/drivers/shtzone.cpp @@ -60,7 +60,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_shtzone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_shtzone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; static ADDRESS_MAP_START( shtzone_map, AS_PROGRAM, 8, shtzone_state ) @@ -86,7 +86,7 @@ void shtzone_state::video_start() } -UINT32 shtzone_state::screen_update_shtzone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t shtzone_state::screen_update_shtzone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/shuuz.cpp b/src/mame/drivers/shuuz.cpp index 27ca1d95ac1..d79c5362997 100644 --- a/src/mame/drivers/shuuz.cpp +++ b/src/mame/drivers/shuuz.cpp @@ -70,8 +70,8 @@ READ16_MEMBER(shuuz_state::leta_r) /* when reading the even ports, do a real analog port update */ if (which == 0) { - int dx = (INT8)ioport("TRACKX")->read(); - int dy = (INT8)ioport("TRACKY")->read(); + int dx = (int8_t)ioport("TRACKX")->read(); + int dy = (int8_t)ioport("TRACKY")->read(); m_cur[0] = dx + dy; m_cur[1] = dx - dy; diff --git a/src/mame/drivers/sidepckt.cpp b/src/mame/drivers/sidepckt.cpp index 9538a974116..03d362faae9 100644 --- a/src/mame/drivers/sidepckt.cpp +++ b/src/mame/drivers/sidepckt.cpp @@ -133,13 +133,13 @@ Stephh's notes (based on the games M6809 code and some tests) : #include "includes/sidepckt.h" // protection tables -static const UINT8 sidepckt_prot_table_1[0x10]={0x05,0x03,0x02,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; -static const UINT8 sidepckt_prot_table_2[0x10]={0x8e,0x42,0xad,0x58,0xec,0x85,0xdd,0x4c,0xad,0x9f,0x00,0x4c,0x7e,0x42,0xa2,0xff}; -static const UINT8 sidepckt_prot_table_3[0x10]={0xbd,0x73,0x80,0xbd,0x73,0xa7,0xbd,0x73,0xe0,0x7e,0x72,0x56,0xff,0xff,0xff,0xff}; +static const uint8_t sidepckt_prot_table_1[0x10]={0x05,0x03,0x02,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; +static const uint8_t sidepckt_prot_table_2[0x10]={0x8e,0x42,0xad,0x58,0xec,0x85,0xdd,0x4c,0xad,0x9f,0x00,0x4c,0x7e,0x42,0xa2,0xff}; +static const uint8_t sidepckt_prot_table_3[0x10]={0xbd,0x73,0x80,0xbd,0x73,0xa7,0xbd,0x73,0xe0,0x7e,0x72,0x56,0xff,0xff,0xff,0xff}; -static const UINT8 sidepcktj_prot_table_1[0x10]={0x05,0x03,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; -static const UINT8 sidepcktj_prot_table_2[0x10]={0x8e,0x42,0xb2,0x58,0xec,0x85,0xdd,0x4c,0xad,0x9f,0x00,0x4c,0x7e,0x42,0xa7,0xff}; -static const UINT8 sidepcktj_prot_table_3[0x10]={0xbd,0x71,0xc8,0xbd,0x71,0xef,0xbd,0x72,0x28,0x7e,0x70,0x9e,0xff,0xff,0xff,0xff}; +static const uint8_t sidepcktj_prot_table_1[0x10]={0x05,0x03,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; +static const uint8_t sidepcktj_prot_table_2[0x10]={0x8e,0x42,0xb2,0x58,0xec,0x85,0xdd,0x4c,0xad,0x9f,0x00,0x4c,0x7e,0x42,0xa7,0xff}; +static const uint8_t sidepcktj_prot_table_3[0x10]={0xbd,0x71,0xc8,0xbd,0x71,0xef,0xbd,0x72,0x28,0x7e,0x70,0x9e,0xff,0xff,0xff,0xff}; WRITE8_MEMBER(sidepckt_state::sound_cpu_command_w) diff --git a/src/mame/drivers/sigmab52.cpp b/src/mame/drivers/sigmab52.cpp index 586f52e533e..561e4673305 100644 --- a/src/mame/drivers/sigmab52.cpp +++ b/src/mame/drivers/sigmab52.cpp @@ -172,11 +172,11 @@ public: required_device m_6840ptm_2; required_device m_palette; required_memory_bank m_bank1; - required_region_ptr m_prom; + required_region_ptr m_prom; required_ioport m_in0; - UINT64 m_coin_start_cycles; - UINT64 m_hopper_start_cycles; + uint64_t m_coin_start_cycles; + uint64_t m_hopper_start_cycles; int m_audiocpu_cmd_irq; }; @@ -207,7 +207,7 @@ READ8_MEMBER(sigmab52_state::unk_f760_r) READ8_MEMBER(sigmab52_state::in0_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; // if the hopper is active simulate the coin-out sensor if (m_hopper_start_cycles) @@ -235,7 +235,7 @@ READ8_MEMBER(sigmab52_state::in0_r) m_coin_start_cycles = 0; } - UINT16 in0 = m_in0->read(); + uint16_t in0 = m_in0->read(); for(int i=0; i<16; i++) if (!BIT(in0, i)) { @@ -297,7 +297,7 @@ WRITE8_MEMBER(sigmab52_state::palette_bank_w) for (int i = 0; ientries(); i++) { - UINT8 d = m_prom[(bank << 4) | i]; + uint8_t d = m_prom[(bank << 4) | i]; m_palette->set_pen_color(i, pal3bit(d >> 5), pal3bit(d >> 2), pal2bit(d >> 0)); } } diff --git a/src/mame/drivers/sigmab98.cpp b/src/mame/drivers/sigmab98.cpp index 6449a12804c..e5f4e796a1a 100644 --- a/src/mame/drivers/sigmab98.cpp +++ b/src/mame/drivers/sigmab98.cpp @@ -138,32 +138,32 @@ public: required_device m_maincpu; optional_device m_buffered_spriteram; // not on sammymdl? - optional_shared_ptr m_spriteram; // optional as some games allocate it themselves (due to banking) - optional_shared_ptr m_vregs; // optional as some games allocate it themselves (due to banking) - optional_shared_ptr m_vtable; // optional as some games allocate it themselves (due to banking) - required_shared_ptr m_nvram; + optional_shared_ptr m_spriteram; // optional as some games allocate it themselves (due to banking) + optional_shared_ptr m_vregs; // optional as some games allocate it themselves (due to banking) + optional_shared_ptr m_vtable; // optional as some games allocate it themselves (due to banking) + required_shared_ptr m_nvram; required_device m_eeprom; required_device m_gfxdecode; - std::vector m_paletteram; + std::vector m_paletteram; required_device m_screen; required_device m_palette; std::unique_ptr m_sprite_bitmap; - UINT8 m_reg; - UINT8 m_rombank; - UINT8 m_reg2; - UINT8 m_rambank; - UINT8 m_c0; - UINT8 m_c4; - UINT8 m_c6; - UINT8 m_c8; - UINT8 m_vblank; - UINT8 m_out[3]; - - UINT8 m_vblank_vector; - UINT8 m_timer0_vector; - UINT8 m_timer1_vector; + uint8_t m_reg; + uint8_t m_rombank; + uint8_t m_reg2; + uint8_t m_rambank; + uint8_t m_c0; + uint8_t m_c4; + uint8_t m_c6; + uint8_t m_c8; + uint8_t m_vblank; + uint8_t m_out[3]; + + uint8_t m_vblank_vector; + uint8_t m_timer0_vector; + uint8_t m_timer1_vector; DECLARE_WRITE8_MEMBER(gegege_regs_w); DECLARE_READ8_MEMBER(gegege_regs_r); @@ -246,7 +246,7 @@ public: DECLARE_MACHINE_RESET(sammymdl); virtual void video_start() override; - UINT32 screen_update_sigmab98(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sigmab98(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_sammymdl(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(sigmab98_vblank_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(sammymdl_irq); @@ -312,8 +312,8 @@ inline int integer_part(int x) void sigmab98_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri_mask) { - UINT8 *end = (m_buffered_spriteram ? m_buffered_spriteram->buffer() : m_spriteram) - 0x10; - UINT8 *s = end + 0x1000; + uint8_t *end = (m_buffered_spriteram ? m_buffered_spriteram->buffer() : m_spriteram) - 0x10; + uint8_t *s = end + 0x1000; for ( ; s != end; s -= 0x10 ) { @@ -426,13 +426,13 @@ void sigmab98_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec dstdyy /= 2; // Transform the source image while drawing to the screen - UINT16 *src = &m_sprite_bitmap->pix16(0); - UINT16 *dst = &bitmap.pix16(0); + uint16_t *src = &m_sprite_bitmap->pix16(0); + uint16_t *dst = &bitmap.pix16(0); int src_rowpixels = m_sprite_bitmap->rowpixels(); int dst_rowpixels = bitmap.rowpixels(); - UINT16 penmask = gfx ? 0xff : 0x0f; + uint16_t penmask = gfx ? 0xff : 0x0f; // Scan source image top to bottom srcy = 0; @@ -460,7 +460,7 @@ void sigmab98_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec if (px >= cliprect.min_x && px <= cliprect.max_x && py >= cliprect.min_y && py <= cliprect.max_y) { - UINT16 pen = src[fy * src_rowpixels + fx]; + uint16_t pen = src[fy * src_rowpixels + fx]; if (pen & penmask) dst[py * dst_rowpixels + px] = pen; } @@ -485,7 +485,7 @@ void sigmab98_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } } -UINT32 sigmab98_state::screen_update_sigmab98(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sigmab98_state::screen_update_sigmab98(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; @@ -1018,7 +1018,7 @@ WRITE8_MEMBER(sigmab98_state::animalc_rombank_w) return; } - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); switch ( m_reg ) { case 0x0f: @@ -1194,7 +1194,7 @@ WRITE8_MEMBER(sigmab98_state::sammymdl_hopper_w) READ8_MEMBER(sigmab98_state::sammymdl_coin_hopper_r) { - UINT8 ret = ioport("COIN")->read(); + uint8_t ret = ioport("COIN")->read(); // if ( !machine().device("hopper")->read(0) ) // ret &= ~0x01; @@ -1496,7 +1496,7 @@ WRITE8_MEMBER(sigmab98_state::itazuram_rombank_w) return; } - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); switch ( m_reg ) { case 0x0d: @@ -2332,11 +2332,11 @@ ROM_END DRIVER_INIT_MEMBER(sigmab98_state,dodghero) { // ROM banks - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); membank("rombank")->configure_entries(0, 0x18*2, rom + 0x8000, 0x800); // RAM banks - UINT8 *bankedram = auto_alloc_array(machine(), UINT8, 0x800 * 2); + uint8_t *bankedram = auto_alloc_array(machine(), uint8_t, 0x800 * 2); membank("rambank")->configure_entries(0, 2, bankedram, 0x800); } @@ -2408,7 +2408,7 @@ ROM_END DRIVER_INIT_MEMBER(sigmab98_state,gegege) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // Related to d013 // rom[0x0bdd] = 0xc9; @@ -2430,7 +2430,7 @@ DRIVER_INIT_MEMBER(sigmab98_state,gegege) membank("rombank")->set_entry(0); // RAM banks - UINT8 *bankedram = auto_alloc_array(machine(), UINT8, 0x800 * 2); + uint8_t *bankedram = auto_alloc_array(machine(), uint8_t, 0x800 * 2); membank("rambank")->configure_entries(0, 2, bankedram, 0x800); membank("rambank")->set_entry(0); @@ -2456,7 +2456,7 @@ ROM_END DRIVER_INIT_MEMBER(sigmab98_state,b3rinsya) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // EEPROM timing checks rom[0x8138] = 0x00; @@ -2470,7 +2470,7 @@ DRIVER_INIT_MEMBER(sigmab98_state,b3rinsya) membank("rombank")->set_entry(0); // RAM banks - UINT8 *bankedram = auto_alloc_array(machine(), UINT8, 0x800 * 2); + uint8_t *bankedram = auto_alloc_array(machine(), uint8_t, 0x800 * 2); membank("rambank")->configure_entries(0, 2, bankedram, 0x800); membank("rambank")->set_entry(0); } @@ -2495,7 +2495,7 @@ ROM_END DRIVER_INIT_MEMBER(sigmab98_state,pepsiman) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // Related to d013 // rom[0x058a] = 0xc9; @@ -2517,7 +2517,7 @@ DRIVER_INIT_MEMBER(sigmab98_state,pepsiman) membank("rombank")->set_entry(0); // RAM banks - UINT8 *bankedram = auto_alloc_array(machine(), UINT8, 0x800 * 2); + uint8_t *bankedram = auto_alloc_array(machine(), uint8_t, 0x800 * 2); membank("rambank")->configure_entries(0, 2, bankedram, 0x800); membank("rambank")->set_entry(0); @@ -2545,7 +2545,7 @@ ROM_END DRIVER_INIT_MEMBER(sigmab98_state,tbeastw2) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // EEPROM timing checks rom[0x8138] = 0x00; @@ -2559,7 +2559,7 @@ DRIVER_INIT_MEMBER(sigmab98_state,tbeastw2) membank("rombank")->set_entry(0); // RAM banks - UINT8 *bankedram = auto_alloc_array(machine(), UINT8, 0x800 * 2); + uint8_t *bankedram = auto_alloc_array(machine(), uint8_t, 0x800 * 2); membank("rambank")->configure_entries(0, 2, bankedram, 0x800); membank("rambank")->set_entry(0); } @@ -2586,7 +2586,7 @@ ROM_END DRIVER_INIT_MEMBER(sigmab98_state,ucytokyu) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // Related to d013 // rom[0x0bfa] = 0xc9; @@ -2608,7 +2608,7 @@ DRIVER_INIT_MEMBER(sigmab98_state,ucytokyu) membank("rombank")->set_entry(0); // RAM banks - UINT8 *bankedram = auto_alloc_array(machine(), UINT8, 0x800 * 2); + uint8_t *bankedram = auto_alloc_array(machine(), uint8_t, 0x800 * 2); membank("rambank")->configure_entries(0, 2, bankedram, 0x800); membank("rambank")->set_entry(0); @@ -2635,7 +2635,7 @@ ROM_END DRIVER_INIT_MEMBER(sigmab98_state,dashhero) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // EEPROM timing checks rom[0x8138] = 0x00; @@ -2649,7 +2649,7 @@ DRIVER_INIT_MEMBER(sigmab98_state,dashhero) membank("rombank")->set_entry(0); // RAM banks - UINT8 *bankedram = auto_alloc_array(machine(), UINT8, 0x800 * 4); + uint8_t *bankedram = auto_alloc_array(machine(), uint8_t, 0x800 * 4); membank("rambank")->configure_entries(0, 4, bankedram, 0x800); membank("rambank")->set_entry(0); } @@ -2738,7 +2738,7 @@ ROM_END DRIVER_INIT_MEMBER(sigmab98_state,animalc) { // RAM banks - UINT8 *bankedram = auto_alloc_array(machine(), UINT8, 0x1000 * 5); + uint8_t *bankedram = auto_alloc_array(machine(), uint8_t, 0x1000 * 5); membank("rambank")->configure_entry(0, m_nvram); membank("rambank")->configure_entries(1, 4, bankedram, 0x1000); membank("rambank")->set_entry(0); @@ -2778,7 +2778,7 @@ ROM_END DRIVER_INIT_MEMBER(sigmab98_state,itazuram) { // ROM banks - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); membank("rombank0")->set_base(rom + 0x3400); membank("rombank1")->set_base(rom + 0x4400); m_rombank = 0x0f; diff --git a/src/mame/drivers/silvmil.cpp b/src/mame/drivers/silvmil.cpp index 44821689ff2..d504a4932e6 100644 --- a/src/mame/drivers/silvmil.cpp +++ b/src/mame/drivers/silvmil.cpp @@ -53,9 +53,9 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_layer; @@ -128,7 +128,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_silvmil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_silvmil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void tumblepb_gfx1_rearrange(); }; @@ -167,7 +167,7 @@ void silvmil_state::video_start() m_fg_layer->set_transparent_pen(0); } -UINT32 silvmil_state::screen_update_silvmil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t silvmil_state::screen_update_silvmil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_layer->draw(screen, bitmap, cliprect, 0, 0); m_fg_layer->draw(screen, bitmap, cliprect, 0, 0); @@ -567,7 +567,7 @@ ROM_END void silvmil_state::tumblepb_gfx1_rearrange() { - UINT8 *rom = memregion("gfx1")->base(); + uint8_t *rom = memregion("gfx1")->base(); int len = memregion("gfx1")->bytes(); int i; diff --git a/src/mame/drivers/simpl156.cpp b/src/mame/drivers/simpl156.cpp index e1738fa3468..ef947234d02 100644 --- a/src/mame/drivers/simpl156.cpp +++ b/src/mame/drivers/simpl156.cpp @@ -1017,16 +1017,16 @@ ROM_END DRIVER_INIT_MEMBER(simpl156_state,simpl156) { - UINT8 *rom = memregion("okimusic")->base(); + uint8_t *rom = memregion("okimusic")->base(); int length = memregion("okimusic")->bytes(); - std::vector buf1(length); + std::vector buf1(length); - UINT32 x; + uint32_t x; /* hmm low address line goes to banking chip instead? */ for (x = 0; x < length; x++) { - UINT32 addr; + uint32_t addr; addr = BITSWAP24 (x,23,22,21,0, 20, 19,18,17,16, diff --git a/src/mame/drivers/simple_st0016.cpp b/src/mame/drivers/simple_st0016.cpp index 1a2024c85ad..87ec5f3e308 100644 --- a/src/mame/drivers/simple_st0016.cpp +++ b/src/mame/drivers/simple_st0016.cpp @@ -106,7 +106,7 @@ ADDRESS_MAP_END * *************************************/ -static UINT32 latches[8]; +static uint32_t latches[8]; READ32_MEMBER(st0016_state::latch32_r) { @@ -456,7 +456,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(st0016_state::st0016_int) * *************************************/ -UINT32 st0016_state::screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t st0016_state::screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return m_maincpu->update(screen,bitmap,cliprect); } diff --git a/src/mame/drivers/simpsons.cpp b/src/mame/drivers/simpsons.cpp index 0d4b65eb120..ebeee4e30e2 100644 --- a/src/mame/drivers/simpsons.cpp +++ b/src/mame/drivers/simpsons.cpp @@ -282,7 +282,7 @@ INPUT_PORTS_END void simpsons_state::simpsons_objdma( ) { int counter, num_inactive; - UINT16 *src, *dst; + uint16_t *src, *dst; m_k053246->k053247_get_ram(&dst); diff --git a/src/mame/drivers/skeetsht.cpp b/src/mame/drivers/skeetsht.cpp index cb1b7a054c5..b08b1738b4c 100644 --- a/src/mame/drivers/skeetsht.cpp +++ b/src/mame/drivers/skeetsht.cpp @@ -39,11 +39,11 @@ public: } required_device m_tlc34076; - required_shared_ptr m_tms_vram; - UINT8 m_porta_latch; - UINT8 m_ay_sel; - UINT8 m_lastdataw; - UINT16 m_lastdatar; + required_shared_ptr m_tms_vram; + uint8_t m_porta_latch; + uint8_t m_ay_sel; + uint8_t m_lastdataw; + uint16_t m_lastdatar; DECLARE_READ16_MEMBER(ramdac_r); DECLARE_WRITE16_MEMBER(ramdac_w); DECLARE_WRITE8_MEMBER(tms_w); @@ -85,14 +85,14 @@ void skeetsht_state::video_start() TMS340X0_SCANLINE_RGB32_CB_MEMBER(skeetsht_state::scanline_update) { const rgb_t *const pens = m_tlc34076->get_pens(); - UINT16 *vram = &m_tms_vram[(params->rowaddr << 8) & 0x3ff00]; - UINT32 *dest = &bitmap.pix32(scanline); + uint16_t *vram = &m_tms_vram[(params->rowaddr << 8) & 0x3ff00]; + uint32_t *dest = &bitmap.pix32(scanline); int coladdr = params->coladdr; int x; for (x = params->heblnk; x < params->hsblnk; x += 2) { - UINT16 pixels = vram[coladdr++ & 0xff]; + uint16_t pixels = vram[coladdr++ & 0xff]; dest[x + 0] = pens[pixels & 0xff]; dest[x + 1] = pens[pixels >> 8]; } diff --git a/src/mame/drivers/skimaxx.cpp b/src/mame/drivers/skimaxx.cpp index a4076589024..02998de3ad2 100644 --- a/src/mame/drivers/skimaxx.cpp +++ b/src/mame/drivers/skimaxx.cpp @@ -58,19 +58,19 @@ public: required_device m_subcpu; required_device m_tms; - required_shared_ptr m_blitter_regs; - required_shared_ptr m_fpga_ctrl; - required_shared_ptr m_fg_buffer; - - std::unique_ptr m_bg_buffer; - UINT32 *m_bg_buffer_front; - UINT32 *m_bg_buffer_back; - UINT16 *m_blitter_gfx; - UINT32 m_blitter_gfx_len; - UINT32 m_blitter_src_x; - UINT32 m_blitter_src_dx; - UINT32 m_blitter_src_y; - UINT32 m_blitter_src_dy; + required_shared_ptr m_blitter_regs; + required_shared_ptr m_fpga_ctrl; + required_shared_ptr m_fg_buffer; + + std::unique_ptr m_bg_buffer; + uint32_t *m_bg_buffer_front; + uint32_t *m_bg_buffer_back; + uint16_t *m_blitter_gfx; + uint32_t m_blitter_gfx_len; + uint32_t m_blitter_src_x; + uint32_t m_blitter_src_dx; + uint32_t m_blitter_src_y; + uint32_t m_blitter_src_dy; DECLARE_WRITE32_MEMBER(skimaxx_blitter_w); DECLARE_READ32_MEMBER(skimaxx_blitter_r); @@ -100,7 +100,7 @@ public: // Set up blit parameters WRITE32_MEMBER(skimaxx_state::skimaxx_blitter_w) { - UINT32 newdata = COMBINE_DATA( &m_blitter_regs[offset] ); + uint32_t newdata = COMBINE_DATA( &m_blitter_regs[offset] ); switch (offset) { @@ -131,11 +131,11 @@ WRITE32_MEMBER(skimaxx_state::skimaxx_blitter_w) // A read by the 68030 from this area blits one pixel to the back buffer (at the same offset) READ32_MEMBER(skimaxx_state::skimaxx_blitter_r) { - UINT32 penaddr = ((m_blitter_src_x >> 8) & 0x1ff) + ((m_blitter_src_y >> 8) << 9); - UINT16 *src = m_blitter_gfx + (penaddr % m_blitter_gfx_len); - UINT32 *dst = m_bg_buffer_back + offset; + uint32_t penaddr = ((m_blitter_src_x >> 8) & 0x1ff) + ((m_blitter_src_y >> 8) << 9); + uint16_t *src = m_blitter_gfx + (penaddr % m_blitter_gfx_len); + uint32_t *dst = m_bg_buffer_back + offset; - UINT16 pen = (*src) & 0x7fff; + uint16_t pen = (*src) & 0x7fff; if (pen) { @@ -154,12 +154,12 @@ READ32_MEMBER(skimaxx_state::skimaxx_blitter_r) void skimaxx_state::video_start() { - m_blitter_gfx = (UINT16 *) memregion( "blitter" )->base(); + m_blitter_gfx = (uint16_t *) memregion( "blitter" )->base(); m_blitter_gfx_len = memregion( "blitter" )->bytes() / 2; - m_bg_buffer = std::make_unique(0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 2); // 2 buffers - m_bg_buffer_back = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 0; - m_bg_buffer_front = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * 1; + m_bg_buffer = std::make_unique(0x400 * 0x100 * sizeof(uint16_t) / sizeof(uint32_t) * 2); // 2 buffers + m_bg_buffer_back = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(uint16_t) / sizeof(uint32_t) * 0; + m_bg_buffer_front = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(uint16_t) / sizeof(uint32_t) * 1; membank("bank1")->configure_entry(0, m_bg_buffer_back); membank("bank1")->configure_entry(1, m_bg_buffer_front); } @@ -173,12 +173,12 @@ void skimaxx_state::video_start() // TODO: Might not be used TMS340X0_TO_SHIFTREG_CB_MEMBER(skimaxx_state::to_shiftreg) { - memcpy(shiftreg, &m_fg_buffer[TOWORD(address)], 512 * sizeof(UINT16)); + memcpy(shiftreg, &m_fg_buffer[TOWORD(address)], 512 * sizeof(uint16_t)); } TMS340X0_FROM_SHIFTREG_CB_MEMBER(skimaxx_state::from_shiftreg) { - memcpy(&m_fg_buffer[TOWORD(address)], shiftreg, 512 * sizeof(UINT16)); + memcpy(&m_fg_buffer[TOWORD(address)], shiftreg, 512 * sizeof(uint16_t)); } @@ -194,10 +194,10 @@ TMS340X0_SCANLINE_IND16_CB_MEMBER(skimaxx_state::scanline_update) if (params->rowaddr >= 0x220) { - UINT32 rowaddr = (params->rowaddr - 0x220); - UINT16 *fg = &m_fg_buffer[rowaddr << 8]; - UINT32 *bg = &m_bg_buffer_front[rowaddr/2 * 1024/2]; - UINT16 *dest = &bitmap.pix16(scanline); + uint32_t rowaddr = (params->rowaddr - 0x220); + uint16_t *fg = &m_fg_buffer[rowaddr << 8]; + uint32_t *bg = &m_bg_buffer_front[rowaddr/2 * 1024/2]; + uint16_t *dest = &bitmap.pix16(scanline); //int coladdr = params->coladdr; int x; //coladdr = 0; @@ -205,7 +205,7 @@ TMS340X0_SCANLINE_IND16_CB_MEMBER(skimaxx_state::scanline_update) dest += params->heblnk; for (x = params->heblnk; x < params->hsblnk; x+=2) { - UINT16 tmspix; + uint16_t tmspix; tmspix = *fg & 0x7fff; if (tmspix) { @@ -214,7 +214,7 @@ TMS340X0_SCANLINE_IND16_CB_MEMBER(skimaxx_state::scanline_update) } else { - UINT32 data = *bg & 0x7fff7fff; + uint32_t data = *bg & 0x7fff7fff; *dest++ = data >> 16; *dest++ = data; } @@ -243,15 +243,15 @@ TMS340X0_SCANLINE_IND16_CB_MEMBER(skimaxx_state::scanline_update) WRITE32_MEMBER(skimaxx_state::skimaxx_fpga_ctrl_w) { - UINT32 newdata = COMBINE_DATA( m_fpga_ctrl ); + uint32_t newdata = COMBINE_DATA( m_fpga_ctrl ); if (ACCESSING_BITS_0_7) { // double buffering - UINT8 bank_bg_buffer = (newdata & 0x40) ? 1 : 0; + uint8_t bank_bg_buffer = (newdata & 0x40) ? 1 : 0; - m_bg_buffer_back = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * bank_bg_buffer; - m_bg_buffer_front = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(UINT16) / sizeof(UINT32) * (1 - bank_bg_buffer); + m_bg_buffer_back = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(uint16_t) / sizeof(uint32_t) * bank_bg_buffer; + m_bg_buffer_front = m_bg_buffer.get() + 0x400 * 0x100 * sizeof(uint16_t) / sizeof(uint32_t) * (1 - bank_bg_buffer); membank("bank1")->set_entry(bank_bg_buffer); } @@ -381,12 +381,12 @@ ADDRESS_MAP_END #if 0 -static const UINT32 texlayout_xoffset[512] = +static const uint32_t texlayout_xoffset[512] = { STEP512(0,16) }; -static const UINT32 texlayout_yoffset[128] = +static const uint32_t texlayout_yoffset[128] = { STEP128(0,512*16) }; diff --git a/src/mame/drivers/skyarmy.cpp b/src/mame/drivers/skyarmy.cpp index 1a56efd4823..79d57ebafac 100644 --- a/src/mame/drivers/skyarmy.cpp +++ b/src/mame/drivers/skyarmy.cpp @@ -48,10 +48,10 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scrollram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scrollram; tilemap_t* m_tilemap; int m_nmi; @@ -68,7 +68,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(skyarmy); - 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); INTERRUPT_GEN_MEMBER(nmi_source); }; @@ -110,7 +110,7 @@ WRITE8_MEMBER(skyarmy_state::colorram_w) PALETTE_INIT_MEMBER(skyarmy_state, skyarmy) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0;i < 32;i++) @@ -144,7 +144,7 @@ void skyarmy_state::video_start() } -UINT32 skyarmy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t skyarmy_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int sx, sy, flipx, flipy, offs,pal; int i; diff --git a/src/mame/drivers/skyfox.cpp b/src/mame/drivers/skyfox.cpp index 199025b4768..7542ed58c7c 100644 --- a/src/mame/drivers/skyfox.cpp +++ b/src/mame/drivers/skyfox.cpp @@ -399,9 +399,9 @@ ROM_END /* Untangle the graphics: cut each 32x32x8 tile in 16 8x8x8 tiles */ DRIVER_INIT_MEMBER(skyfox_state,skyfox) { - UINT8 *rom = memregion("gfx1")->base(); - UINT8 *end = rom + memregion("gfx1")->bytes(); - UINT8 buf[32 * 32]; + uint8_t *rom = memregion("gfx1")->base(); + uint8_t *end = rom + memregion("gfx1")->bytes(); + uint8_t buf[32 * 32]; while (rom < end) { diff --git a/src/mame/drivers/skykid.cpp b/src/mame/drivers/skykid.cpp index 75fe1fa2e49..ab61672e02e 100644 --- a/src/mame/drivers/skykid.cpp +++ b/src/mame/drivers/skykid.cpp @@ -625,7 +625,7 @@ ROM_END DRIVER_INIT_MEMBER(skykid_state,skykid) { - UINT8 *rom; + uint8_t *rom; int i; /* unpack the third sprite ROM */ diff --git a/src/mame/drivers/skylncr.cpp b/src/mame/drivers/skylncr.cpp index b5b78b3c761..08d30c5e493 100644 --- a/src/mame/drivers/skylncr.cpp +++ b/src/mame/drivers/skylncr.cpp @@ -157,25 +157,25 @@ public: m_hopper(*this, "hopper") { } tilemap_t *m_tmap; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_reeltiles_1_ram; - required_shared_ptr m_reeltiles_2_ram; - required_shared_ptr m_reeltiles_3_ram; - required_shared_ptr m_reeltiles_4_ram; - required_shared_ptr m_reeltileshigh_1_ram; - required_shared_ptr m_reeltileshigh_2_ram; - required_shared_ptr m_reeltileshigh_3_ram; - required_shared_ptr m_reeltileshigh_4_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_reeltiles_1_ram; + required_shared_ptr m_reeltiles_2_ram; + required_shared_ptr m_reeltiles_3_ram; + required_shared_ptr m_reeltiles_4_ram; + required_shared_ptr m_reeltileshigh_1_ram; + required_shared_ptr m_reeltileshigh_2_ram; + required_shared_ptr m_reeltileshigh_3_ram; + required_shared_ptr m_reeltileshigh_4_ram; tilemap_t *m_reel_1_tilemap; tilemap_t *m_reel_2_tilemap; tilemap_t *m_reel_3_tilemap; tilemap_t *m_reel_4_tilemap; - required_shared_ptr m_reelscroll1; - required_shared_ptr m_reelscroll2; - required_shared_ptr m_reelscroll3; - required_shared_ptr m_reelscroll4; - UINT8 m_nmi_enable; + required_shared_ptr m_reelscroll1; + required_shared_ptr m_reelscroll2; + required_shared_ptr m_reelscroll3; + required_shared_ptr m_reelscroll4; + uint8_t m_nmi_enable; int m_color; int m_color2; DECLARE_WRITE8_MEMBER(skylncr_videoram_w); @@ -205,7 +205,7 @@ public: TILE_GET_INFO_MEMBER(get_reel_3_tile_info); TILE_GET_INFO_MEMBER(get_reel_4_tile_info); virtual void video_start() override; - UINT32 screen_update_skylncr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_skylncr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(skylncr_vblank_interrupt); required_device m_maincpu; required_device m_gfxdecode; @@ -234,35 +234,35 @@ WRITE8_MEMBER(skylncr_state::skylncr_colorram_w) TILE_GET_INFO_MEMBER(skylncr_state::get_tile_info) { - UINT16 code = m_videoram[ tile_index ] + (m_colorram[ tile_index ] << 8); + uint16_t code = m_videoram[ tile_index ] + (m_colorram[ tile_index ] << 8); int pal = (code & 0x8000) >> 15; SET_TILE_INFO_MEMBER(0, code, pal^1, TILE_FLIPYX( 0 )); } TILE_GET_INFO_MEMBER(skylncr_state::get_reel_1_tile_info) { - UINT16 code = m_reeltiles_1_ram[ tile_index ] + (m_reeltileshigh_1_ram[ tile_index ] << 8); + uint16_t code = m_reeltiles_1_ram[ tile_index ] + (m_reeltileshigh_1_ram[ tile_index ] << 8); int pal = (code & 0x8000) >> 15; SET_TILE_INFO_MEMBER(1, code&0x7fff, pal^1, TILE_FLIPYX( 0 )); } TILE_GET_INFO_MEMBER(skylncr_state::get_reel_2_tile_info) { - UINT16 code = m_reeltiles_2_ram[ tile_index ] + (m_reeltileshigh_2_ram[ tile_index ] << 8); + uint16_t code = m_reeltiles_2_ram[ tile_index ] + (m_reeltileshigh_2_ram[ tile_index ] << 8); int pal = (code & 0x8000) >> 15; SET_TILE_INFO_MEMBER(1, code, pal^1, TILE_FLIPYX( 0 )); } TILE_GET_INFO_MEMBER(skylncr_state::get_reel_3_tile_info) { - UINT16 code = m_reeltiles_3_ram[ tile_index ] + (m_reeltileshigh_3_ram[ tile_index ] << 8); + uint16_t code = m_reeltiles_3_ram[ tile_index ] + (m_reeltileshigh_3_ram[ tile_index ] << 8); int pal = (code & 0x8000) >> 15; SET_TILE_INFO_MEMBER(1, code, pal^1, TILE_FLIPYX( 0 )); } TILE_GET_INFO_MEMBER(skylncr_state::get_reel_4_tile_info) { - UINT16 code = m_reeltiles_4_ram[ tile_index ] + (m_reeltileshigh_4_ram[ tile_index ] << 8); + uint16_t code = m_reeltiles_4_ram[ tile_index ] + (m_reeltileshigh_4_ram[ tile_index ] << 8); int pal = (code & 0x8000) >> 15; SET_TILE_INFO_MEMBER(1, code, pal^1, TILE_FLIPYX( 0 )); } @@ -290,7 +290,7 @@ void skylncr_state::video_start() } -UINT32 skylncr_state::screen_update_skylncr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t skylncr_state::screen_update_skylncr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i; @@ -1998,7 +1998,7 @@ DRIVER_INIT_MEMBER(skylncr_state, sonikfig) 00 04 02 06 01 05 03 07 */ { - UINT8 *const ROM = memregion("maincpu")->base(); + uint8_t *const ROM = memregion("maincpu")->base(); for (unsigned x = 0; x < 0x10000; x += 8) { std::swap(ROM[x + 1], ROM[x + 4]); diff --git a/src/mame/drivers/skyraid.cpp b/src/mame/drivers/skyraid.cpp index ad5d255ce13..a21ee106272 100644 --- a/src/mame/drivers/skyraid.cpp +++ b/src/mame/drivers/skyraid.cpp @@ -39,7 +39,7 @@ PALETTE_INIT_MEMBER(skyraid_state, skyraid) READ8_MEMBER(skyraid_state::skyraid_port_0_r) { - UINT8 val = ioport("LANGUAGE")->read(); + uint8_t val = ioport("LANGUAGE")->read(); if (ioport("STICKY")->read() > m_analog_range) val |= 0x40; diff --git a/src/mame/drivers/slapfght.cpp b/src/mame/drivers/slapfght.cpp index 4a7be1ddf08..633fa0dfc88 100644 --- a/src/mame/drivers/slapfght.cpp +++ b/src/mame/drivers/slapfght.cpp @@ -844,7 +844,7 @@ MACHINE_RESET_MEMBER(slapfght_state,getstar) void slapfght_state::init_banks() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000); membank("bank1")->set_entry(0); @@ -876,7 +876,7 @@ DRIVER_INIT_MEMBER(slapfght_state,getstarb1) /* it is possible the program roms are slighly corrupt like the gfx roms, or that the bootleg simply shouldn't execute the code due to the modified roms */ /* TODO: find & fix the cause of the following happening. */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x6d56] = 0xc3; // jp instead of jp z } diff --git a/src/mame/drivers/slapshot.cpp b/src/mame/drivers/slapshot.cpp index 417b4d4b335..51c15d8c17d 100644 --- a/src/mame/drivers/slapshot.cpp +++ b/src/mame/drivers/slapshot.cpp @@ -669,8 +669,8 @@ ROM_END DRIVER_INIT_MEMBER(slapshot_state,slapshot) { - UINT32 offset,i; - UINT8 *gfx = memregion("gfx2")->base(); + uint32_t offset,i; + uint8_t *gfx = memregion("gfx2")->base(); int size = memregion("gfx2")->bytes(); int data; diff --git a/src/mame/drivers/slc1.cpp b/src/mame/drivers/slc1.cpp index a2eec395f04..36975858218 100644 --- a/src/mame/drivers/slc1.cpp +++ b/src/mame/drivers/slc1.cpp @@ -67,7 +67,7 @@ public: required_device m_speaker; DECLARE_READ8_MEMBER( io_r ); DECLARE_WRITE8_MEMBER( io_w ); - UINT8 m_digit; + uint8_t m_digit; bool m_kbd_type; virtual void machine_reset() override; virtual void machine_start() override; @@ -100,9 +100,9 @@ WRITE8_MEMBER( slc1_state::io_w ) if (offset == 0x2f07) return; - UINT8 segdata = output().get_digit_value(m_digit); - UINT8 segnum = offset & 7; - UINT8 segmask = 1 << segnum; + uint8_t segdata = output().get_digit_value(m_digit); + uint8_t segnum = offset & 7; + uint8_t segmask = 1 << segnum; if (segonoff) segdata |= segmask; @@ -126,7 +126,7 @@ WRITE8_MEMBER( slc1_state::io_w ) READ8_MEMBER( slc1_state::io_r ) { - UINT8 data = 0xff, upper = (offset >> 8) & 7; + uint8_t data = 0xff, upper = (offset >> 8) & 7; if (m_kbd_type) { // Trainer diff --git a/src/mame/drivers/sliver.cpp b/src/mame/drivers/sliver.cpp index 0762736ac24..981a388e991 100644 --- a/src/mame/drivers/sliver.cpp +++ b/src/mame/drivers/sliver.cpp @@ -90,13 +90,13 @@ public: m_soundlatch(*this, "soundlatch"), m_colorram(*this, "colorram") { } - UINT16 m_io_offset; - UINT16 m_io_reg[IO_SIZE]; - UINT16 m_fifo[FIFO_SIZE]; - UINT16 m_fptr; + uint16_t m_io_offset; + uint16_t m_io_reg[IO_SIZE]; + uint16_t m_fifo[FIFO_SIZE]; + uint16_t m_fptr; - UINT16 m_jpeg1; - UINT16 m_jpeg2; + uint16_t m_jpeg1; + uint16_t m_jpeg2; int m_jpeg_x; int m_jpeg_y; int m_tmp_counter; @@ -105,11 +105,11 @@ public: required_device m_audiocpu; required_device m_screen; required_device m_soundlatch; - required_shared_ptr m_colorram; + required_shared_ptr m_colorram; bitmap_rgb32 m_bitmap_fg; bitmap_rgb32 m_bitmap_bg; - UINT16 m_tempbuf[8]; + uint16_t m_tempbuf[8]; DECLARE_WRITE16_MEMBER(fifo_data_w); DECLARE_WRITE16_MEMBER(fifo_clear_w); @@ -126,8 +126,8 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void plot_pixel_rgb(int x, int y, UINT32 r, UINT32 g, UINT32 b); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void plot_pixel_rgb(int x, int y, uint32_t r, uint32_t g, uint32_t b); void plot_pixel_pal(int x, int y, int addr); void blit_gfx(); void render_jpeg(); @@ -147,7 +147,7 @@ void sliver_state::machine_start() save_item(NAME(m_tmp_counter)); } -void sliver_state::plot_pixel_rgb(int x, int y, UINT32 r, UINT32 g, UINT32 b) +void sliver_state::plot_pixel_rgb(int x, int y, uint32_t r, uint32_t g, uint32_t b) { // printf("plot %d %d %d\n", r,g,b); @@ -159,7 +159,7 @@ void sliver_state::plot_pixel_rgb(int x, int y, UINT32 r, UINT32 g, UINT32 b) void sliver_state::plot_pixel_pal(int x, int y, int addr) { - UINT32 r,g,b; + uint32_t r,g,b; if (y < 0 || x < 0 || x > 383 || y > 255) return; @@ -195,7 +195,7 @@ WRITE16_MEMBER(sliver_state::fifo_data_w) void sliver_state::blit_gfx() { int tmpptr=0; - const UINT8 *rom = memregion("user1")->base(); + const uint8_t *rom = memregion("user1")->base(); while (tmpptr < m_fptr) { @@ -281,9 +281,9 @@ void sliver_state::render_jpeg() for (x = 0; x < row_stride/3; x++) { - UINT8 b = buffer[0][(x*3)]; - UINT8 g = buffer[0][(x*3)+1]; - UINT8 r = buffer[0][(x*3)+2]; + uint8_t b = buffer[0][(x*3)]; + uint8_t g = buffer[0][(x*3)+1]; + uint8_t r = buffer[0][(x*3)+2]; plot_pixel_rgb(x - x_offset + m_jpeg_x, y - y_offset - m_jpeg_y, r, g, b); } @@ -410,7 +410,7 @@ void sliver_state::postload() render_jpeg(); } -UINT32 sliver_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sliver_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap (bitmap, m_bitmap_bg, 0, 0, 0, 0, cliprect); copybitmap_trans(bitmap, m_bitmap_fg, 0, 0, 0, 0, cliprect, 0); diff --git a/src/mame/drivers/slotcarn.cpp b/src/mame/drivers/slotcarn.cpp index b3beb20042a..00117e54269 100644 --- a/src/mame/drivers/slotcarn.cpp +++ b/src/mame/drivers/slotcarn.cpp @@ -44,10 +44,10 @@ public: m_screen(*this, "screen") { } pen_t m_pens[NUM_PENS]; - required_shared_ptr m_backup_ram; - required_shared_ptr m_ram_attr; - required_shared_ptr m_ram_video; - std::unique_ptr m_ram_palette; + required_shared_ptr m_backup_ram; + required_shared_ptr m_ram_attr; + required_shared_ptr m_ram_video; + std::unique_ptr m_ram_palette; DECLARE_READ8_MEMBER(palette_r); DECLARE_WRITE8_MEMBER(palette_w); DECLARE_WRITE_LINE_MEMBER(hsync_changed); @@ -110,8 +110,8 @@ MC6845_UPDATE_ROW( slotcarn_state::crtc_update_row ) int extra_video_bank_bit = 0; // not used? int lscnblk = 0; // not used? - UINT8 *gfx[2]; - UINT16 x = 0; + uint8_t *gfx[2]; + uint16_t x = 0; int rlen; gfx[0] = memregion("gfx1")->base(); @@ -119,14 +119,14 @@ MC6845_UPDATE_ROW( slotcarn_state::crtc_update_row ) rlen = memregion("gfx2")->bytes(); //ma = ma ^ 0x7ff; - for (UINT8 cx = 0; cx < x_count; cx++) + for (uint8_t cx = 0; cx < x_count; cx++) { int i; int attr = m_ram_attr[ma & 0x7ff]; int region = (attr & 0x40) >> 6; int addr = ((m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (extra_video_bank_bit)) << 4) | (ra & 0x0f); int colour = (attr & 0x7f) << 3; - UINT8 *data; + uint8_t *data; addr &= (rlen-1); data = gfx[region]; @@ -524,7 +524,7 @@ GFXDECODE_END void slotcarn_state::machine_start() { - m_ram_palette = std::make_unique(RAM_PALETTE_SIZE); + m_ram_palette = std::make_unique(RAM_PALETTE_SIZE); save_pointer(NAME(m_ram_palette.get()), RAM_PALETTE_SIZE); } diff --git a/src/mame/drivers/sm1800.cpp b/src/mame/drivers/sm1800.cpp index f4baab35368..42031a5d19e 100644 --- a/src/mame/drivers/sm1800.cpp +++ b/src/mame/drivers/sm1800.cpp @@ -43,7 +43,7 @@ public: DECLARE_WRITE8_MEMBER(sm1800_8255_portc_w); DECLARE_READ8_MEMBER(sm1800_8255_porta_r); DECLARE_READ8_MEMBER(sm1800_8255_portc_r); - UINT8 m_irq_state; + uint8_t m_irq_state; virtual void machine_reset() override; DECLARE_PALETTE_INIT(sm1800); INTERRUPT_GEN_MEMBER(sm1800_vblank_interrupt); @@ -92,8 +92,8 @@ I8275_DRAW_CHARACTER_MEMBER( sm1800_state::crtc_display_pixels ) { int i; const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 *charmap = memregion("chargen")->base(); - UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; + uint8_t *charmap = memregion("chargen")->base(); + uint8_t pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; if (vsp) pixels = 0; diff --git a/src/mame/drivers/sm7238.cpp b/src/mame/drivers/sm7238.cpp index 912a521d3ea..bed8b5fe679 100644 --- a/src/mame/drivers/sm7238.cpp +++ b/src/mame/drivers/sm7238.cpp @@ -76,7 +76,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); void screen_eof(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER( scanline_callback ); DECLARE_PALETTE_INIT(sm7238); @@ -88,22 +88,22 @@ public: DECLARE_WRITE8_MEMBER(text_control_w); private: - UINT32 draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline); + uint32_t draw_scanline(uint16_t *p, uint16_t offset, uint8_t scanline); rectangle m_tmpclip; bitmap_ind16 m_tmpbmp; void text_memory_clear(); void recompute_parameters(); - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; struct { - UINT8 control; - UINT8 stride; - UINT16 ptr; + uint8_t control; + uint8_t stride; + uint16_t ptr; } m_video; protected: - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_device m_maincpu; required_device m_nvram; required_device m_pic8259; @@ -195,10 +195,10 @@ WRITE_LINE_MEMBER(sm7238_state::write_printer_clock) m_i8251prn->write_rxc(state); } -UINT32 sm7238_state::draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline) +uint32_t sm7238_state::draw_scanline(uint16_t *p, uint16_t offset, uint8_t scanline) { - UINT8 attr, fg, bg, ra, gfx; - UINT16 x, chr; + uint8_t attr, fg, bg, ra, gfx; + uint16_t x, chr; int dw; ra = scanline % 10; @@ -257,8 +257,8 @@ UINT32 sm7238_state::draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline) TIMER_DEVICE_CALLBACK_MEMBER(sm7238_state::scanline_callback) { - UINT16 y = m_screen->vpos(); - UINT16 o = m_video.ptr; + uint16_t y = m_screen->vpos(); + uint16_t o = m_video.ptr; if (y < KSM_VERT_START) return; y -= KSM_VERT_START; @@ -299,7 +299,7 @@ void sm7238_state::recompute_parameters() HZ_TO_ATTOSECONDS((m_video.stride == 80) ? 60 : 57.1 )); } -UINT32 sm7238_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sm7238_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (BIT(m_video.control, 3)) copybitmap(bitmap, m_tmpbmp, 0, 0, KSM_HORZ_START, KSM_VERT_START, cliprect); diff --git a/src/mame/drivers/smc777.cpp b/src/mame/drivers/smc777.cpp index 366c0eb32e6..3d1776728b2 100644 --- a/src/mame/drivers/smc777.cpp +++ b/src/mame/drivers/smc777.cpp @@ -85,7 +85,7 @@ public: DECLARE_READ8_MEMBER(irq_mask_r); DECLARE_WRITE8_MEMBER(irq_mask_w); DECLARE_PALETTE_INIT(smc777); - UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); @@ -111,29 +111,29 @@ private: required_device m_gfxdecode; required_device m_palette; - UINT8 *m_ipl_rom; - std::unique_ptr m_work_ram; - std::unique_ptr m_vram; - std::unique_ptr m_attr; - std::unique_ptr m_gvram; - std::unique_ptr m_pcg; - - UINT8 m_keyb_press; - UINT8 m_keyb_press_flag; - UINT8 m_shift_press_flag; - UINT8 m_backdrop_pen; - UINT8 m_display_reg; - UINT8 m_fdc_irq_flag; - UINT8 m_fdc_drq_flag; - UINT8 m_system_data; - struct { UINT8 r,g,b; } m_pal; - UINT8 m_raminh,m_raminh_pending_change; //bankswitch - UINT8 m_raminh_prefetch; - UINT8 m_irq_mask; - UINT8 m_pal_mode; - UINT8 m_keyb_cmd; - UINT8 m_crtc_vreg[0x20]; - UINT8 m_crtc_addr; + uint8_t *m_ipl_rom; + std::unique_ptr m_work_ram; + std::unique_ptr m_vram; + std::unique_ptr m_attr; + std::unique_ptr m_gvram; + std::unique_ptr m_pcg; + + uint8_t m_keyb_press; + uint8_t m_keyb_press_flag; + uint8_t m_shift_press_flag; + uint8_t m_backdrop_pen; + uint8_t m_display_reg; + uint8_t m_fdc_irq_flag; + uint8_t m_fdc_drq_flag; + uint8_t m_system_data; + struct { uint8_t r,g,b; } m_pal; + uint8_t m_raminh,m_raminh_pending_change; //bankswitch + uint8_t m_raminh_prefetch; + uint8_t m_irq_mask; + uint8_t m_pal_mode; + uint8_t m_keyb_cmd; + uint8_t m_crtc_vreg[0x20]; + uint8_t m_crtc_addr; }; @@ -145,10 +145,10 @@ void smc777_state::video_start() { } -UINT32 smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,yi; - UINT16 count; + uint16_t count; int x_width; // popmessage("%d %d %d %d",mc6845_v_char_total,mc6845_v_total_adj,mc6845_v_display,mc6845_v_sync_pos); @@ -165,7 +165,7 @@ UINT32 smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &b { for(x=0;x<160;x++) { - UINT16 color; + uint16_t color; color = (m_gvram[count] & 0xf0) >> 4; /* todo: clean this up! */ @@ -304,7 +304,7 @@ WRITE8_MEMBER(smc777_state::mc6845_w) READ8_MEMBER(smc777_state::vram_r) { - UINT16 vram_index; + uint16_t vram_index; vram_index = ((offset & 0x0007) << 8); vram_index |= ((offset & 0xff00) >> 8); @@ -314,7 +314,7 @@ READ8_MEMBER(smc777_state::vram_r) READ8_MEMBER(smc777_state::attr_r) { - UINT16 vram_index; + uint16_t vram_index; vram_index = ((offset & 0x0007) << 8); vram_index |= ((offset & 0xff00) >> 8); @@ -324,7 +324,7 @@ READ8_MEMBER(smc777_state::attr_r) READ8_MEMBER(smc777_state::pcg_r) { - UINT16 vram_index; + uint16_t vram_index; vram_index = ((offset & 0x0007) << 8); vram_index |= ((offset & 0xff00) >> 8); @@ -334,7 +334,7 @@ READ8_MEMBER(smc777_state::pcg_r) WRITE8_MEMBER(smc777_state::vram_w) { - UINT16 vram_index; + uint16_t vram_index; vram_index = ((offset & 0x0007) << 8); vram_index |= ((offset & 0xff00) >> 8); @@ -344,7 +344,7 @@ WRITE8_MEMBER(smc777_state::vram_w) WRITE8_MEMBER(smc777_state::attr_w) { - UINT16 vram_index; + uint16_t vram_index; vram_index = ((offset & 0x0007) << 8); vram_index |= ((offset & 0xff00) >> 8); @@ -354,7 +354,7 @@ WRITE8_MEMBER(smc777_state::attr_w) WRITE8_MEMBER(smc777_state::pcg_w) { - UINT16 vram_index; + uint16_t vram_index; vram_index = ((offset & 0x0007) << 8); vram_index |= ((offset & 0xff00) >> 8); @@ -366,7 +366,7 @@ WRITE8_MEMBER(smc777_state::pcg_w) READ8_MEMBER(smc777_state::fbuf_r) { - UINT16 vram_index; + uint16_t vram_index; vram_index = ((offset & 0x007f) << 8); vram_index |= ((offset & 0xff00) >> 8); @@ -376,7 +376,7 @@ READ8_MEMBER(smc777_state::fbuf_r) WRITE8_MEMBER(smc777_state::fbuf_w) { - UINT16 vram_index; + uint16_t vram_index; vram_index = ((offset & 0x00ff) << 8); vram_index |= ((offset & 0xff00) >> 8); @@ -396,7 +396,7 @@ WRITE8_MEMBER( smc777_state::fdc_w ) READ8_MEMBER( smc777_state::fdc_request_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= !m_fdc_drq_flag << 6; data |= m_fdc_irq_flag << 7; @@ -512,7 +512,7 @@ WRITE8_MEMBER(smc777_state::system_output_w) { case 0x00: m_raminh_pending_change = ((data & 0x10) >> 4) ^ 1; - m_raminh_prefetch = (UINT8)(space.device().state().state_int(Z80_R)) & 0x7f; + m_raminh_prefetch = (uint8_t)(space.device().state().state_int(Z80_R)) & 0x7f; break; case 0x02: printf("Interlace %s\n",data & 0x10 ? "on" : "off"); break; case 0x05: m_beeper->set_state(data & 0x10); break; @@ -531,7 +531,7 @@ WRITE8_MEMBER(smc777_state::color_mode_w) WRITE8_MEMBER(smc777_state::ramdac_w) { - UINT8 pal_index; + uint8_t pal_index; pal_index = (offset & 0xf00) >> 8; if(data & 0x0f) @@ -564,11 +564,11 @@ WRITE8_MEMBER(smc777_state::display_reg_w) READ8_MEMBER(smc777_state::smc777_mem_r) { - UINT8 z80_r; + uint8_t z80_r; if(m_raminh_prefetch != 0xff) //do the bankswitch AFTER that the prefetch instruction is executed (FIXME: this is an hackish implementation) { - z80_r = (UINT8)space.device().state().state_int(Z80_R); + z80_r = (uint8_t)space.device().state().state_int(Z80_R); if(z80_r == ((m_raminh_prefetch+2) & 0x7f)) { @@ -831,7 +831,7 @@ INPUT_PORTS_END "M" row 3 / / ? = 0x2f / 0x3f */ -static const UINT8 smc777_keytable[2][0xa0] = +static const uint8_t smc777_keytable[2][0xa0] = { /* normal*/ { @@ -868,8 +868,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(smc777_state::keyboard_callback) { static const char *const portnames[11] = { "key0","key1","key2","key3","key4","key5","key6","key7", "key8", "key9", "keya" }; int i,port_i,scancode; - UINT8 shift_mod = ioport("key_mod")->read() & 1; - UINT8 kana_mod = ioport("key_mod")->read() & 0x10; + uint8_t shift_mod = ioport("key_mod")->read() & 1; + uint8_t kana_mod = ioport("key_mod")->read() & 0x10; scancode = 0; for(port_i=0;port_i<11;port_i++) @@ -903,11 +903,11 @@ static const gfx_layout smc777_charlayout = void smc777_state::machine_start() { m_ipl_rom = memregion("ipl")->base(); - m_work_ram = make_unique_clear(0x10000); - m_vram = make_unique_clear(0x800); - m_attr = make_unique_clear(0x800); - m_gvram = make_unique_clear(0x8000); - m_pcg = make_unique_clear(0x800); + m_work_ram = make_unique_clear(0x10000); + m_vram = make_unique_clear(0x800); + m_attr = make_unique_clear(0x800); + m_gvram = make_unique_clear(0x8000); + m_pcg = make_unique_clear(0x800); save_pointer(NAME(m_work_ram.get()), 0x10000); save_pointer(NAME(m_vram.get()), 0x800); @@ -936,7 +936,7 @@ PALETTE_INIT_MEMBER(smc777_state, smc777) for(i=0x10;i<0x18;i++) { - UINT8 r,g,b; + uint8_t r,g,b; r = (i & 4) >> 2; g = (i & 2) >> 1; diff --git a/src/mame/drivers/sms_bootleg.cpp b/src/mame/drivers/sms_bootleg.cpp index 68aaa7c364a..7b1b78f6f98 100644 --- a/src/mame/drivers/sms_bootleg.cpp +++ b/src/mame/drivers/sms_bootleg.cpp @@ -271,7 +271,7 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER(smsbootleg_state,sms_supergame) { - UINT8* rom = memregion("maincpu")->base(); + uint8_t* rom = memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); for (int i = 0;i < size;i++) diff --git a/src/mame/drivers/smsmcorp.cpp b/src/mame/drivers/smsmcorp.cpp index 50f15e55cc1..4bfcaecae2b 100644 --- a/src/mame/drivers/smsmcorp.cpp +++ b/src/mame/drivers/smsmcorp.cpp @@ -230,10 +230,10 @@ public: m_maincpu(*this, "maincpu"), m_screen(*this, "screen") { } - UINT8 m_communication_port[4]; - UINT8 m_communication_port_status; + uint8_t m_communication_port[4]; + uint8_t m_communication_port_status; bitmap_ind16 m_bitmap; - UINT8 m_vid_regs[7]; + uint8_t m_vid_regs[7]; DECLARE_WRITE8_MEMBER(bankswitch_w); DECLARE_READ8_MEMBER(link_r); DECLARE_WRITE8_MEMBER(link_w); @@ -248,7 +248,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_MACHINE_START(sureshot); - UINT32 screen_update_sms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_screen; }; @@ -465,7 +465,7 @@ void smsmfg_state::video_start() save_item(NAME(m_bitmap)); } -UINT32 smsmfg_state::screen_update_sms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t smsmfg_state::screen_update_sms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; diff --git a/src/mame/drivers/snes.cpp b/src/mame/drivers/snes.cpp index 4309c594e36..52425957519 100644 --- a/src/mame/drivers/snes.cpp +++ b/src/mame/drivers/snes.cpp @@ -91,10 +91,10 @@ public: SNESCTRL_ONSCREEN_CB(onscreen_cb); SNESCTRL_GUNLATCH_CB(gun_latch_cb); virtual DECLARE_WRITE8_MEMBER(io_read) override; - virtual UINT8 oldjoy1_read(int latched) override; - virtual UINT8 oldjoy2_read(int latched) override; - virtual void write_joy_latch(UINT8 data) override; - virtual void wrio_write(UINT8 data) override; + virtual uint8_t oldjoy1_read(int latched) override; + virtual uint8_t oldjoy2_read(int latched) override; + virtual void write_joy_latch(uint8_t data) override; + virtual void wrio_write(uint8_t data) override; virtual void machine_start() override; virtual void machine_reset() override; @@ -138,7 +138,7 @@ WRITE8_MEMBER(snes_console_state::spc_ram_100_w ) READ8_MEMBER( snes_console_state::snes20_hi_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; // take care of add-on IO if ((m_cartslot->get_type() == SNES_ST010 || m_cartslot->get_type() == SNES_ST011) @@ -195,7 +195,7 @@ READ8_MEMBER( snes_console_state::snes20_hi_r ) WRITE8_MEMBER( snes_console_state::snes20_hi_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; // take care of add-on IO if ((m_cartslot->get_type() == SNES_ST010 || m_cartslot->get_type() == SNES_ST011) @@ -233,7 +233,7 @@ WRITE8_MEMBER( snes_console_state::snes20_hi_w ) READ8_MEMBER( snes_console_state::snes20_lo_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; // take care of add-on IO if ((m_cartslot->get_type() == SNES_ST010 /*|| m_cartslot->get_type() == SNES_ST011*/) // why does this break moritash? @@ -305,7 +305,7 @@ WRITE8_MEMBER( snes_console_state::snes20_lo_w ) READ8_MEMBER( snes_console_state::snes21_lo_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000 && address < 0x8000) { @@ -339,7 +339,7 @@ READ8_MEMBER( snes_console_state::snes21_lo_r ) WRITE8_MEMBER( snes_console_state::snes21_lo_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000 && address < 0x8000) { if (address < 0x2000) @@ -367,7 +367,7 @@ WRITE8_MEMBER( snes_console_state::snes21_lo_w ) READ8_MEMBER( snes_console_state::snes21_hi_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000 && address < 0x8000) { @@ -401,7 +401,7 @@ READ8_MEMBER( snes_console_state::snes21_hi_r ) WRITE8_MEMBER( snes_console_state::snes21_hi_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000 && address < 0x8000) { if (address < 0x2000) @@ -433,7 +433,7 @@ WRITE8_MEMBER( snes_console_state::snes21_hi_w ) READ8_MEMBER( snes_console_state::snessfx_hi_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -459,7 +459,7 @@ READ8_MEMBER( snes_console_state::snessfx_hi_r ) READ8_MEMBER( snes_console_state::snessfx_lo_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -485,7 +485,7 @@ READ8_MEMBER( snes_console_state::snessfx_lo_r ) WRITE8_MEMBER( snes_console_state::snessfx_hi_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { if (address < 0x2000) @@ -515,7 +515,7 @@ WRITE8_MEMBER( snes_console_state::snessfx_lo_w ) READ8_MEMBER( snes_console_state::snessa1_hi_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -541,7 +541,7 @@ READ8_MEMBER( snes_console_state::snessa1_hi_r ) READ8_MEMBER( snes_console_state::snessa1_lo_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -569,7 +569,7 @@ READ8_MEMBER( snes_console_state::snessa1_lo_r ) WRITE8_MEMBER( snes_console_state::snessa1_hi_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { if (address < 0x2000) @@ -602,7 +602,7 @@ WRITE8_MEMBER( snes_console_state::snessa1_lo_w ) READ8_MEMBER( snes_console_state::snes7110_hi_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -610,7 +610,7 @@ READ8_MEMBER( snes_console_state::snes7110_hi_r ) return space.read_byte(0x7e0000 + address); else if (address < 0x6000) { - UINT16 limit = (m_cartslot->get_type() == SNES_SPC7110_RTC) ? 0x4843 : 0x4840; + uint16_t limit = (m_cartslot->get_type() == SNES_SPC7110_RTC) ? 0x4843 : 0x4840; if (address >= 0x4800 && address < limit) return m_cartslot->chip_read(space, address); @@ -631,7 +631,7 @@ READ8_MEMBER( snes_console_state::snes7110_hi_r ) READ8_MEMBER( snes_console_state::snes7110_lo_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -639,7 +639,7 @@ READ8_MEMBER( snes_console_state::snes7110_lo_r ) return space.read_byte(0x7e0000 + address); else if (address < 0x6000) { - UINT16 limit = (m_cartslot->get_type() == SNES_SPC7110_RTC) ? 0x4843 : 0x4840; + uint16_t limit = (m_cartslot->get_type() == SNES_SPC7110_RTC) ? 0x4843 : 0x4840; if (address >= 0x4800 && address < limit) return m_cartslot->chip_read(space, address); @@ -668,14 +668,14 @@ WRITE8_MEMBER( snes_console_state::snes7110_hi_w ) WRITE8_MEMBER( snes_console_state::snes7110_lo_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { if (address < 0x2000) space.write_byte(0x7e0000 + address, data); else if (address < 0x6000) { - UINT16 limit = (m_cartslot->get_type() == SNES_SPC7110_RTC) ? 0x4843 : 0x4840; + uint16_t limit = (m_cartslot->get_type() == SNES_SPC7110_RTC) ? 0x4843 : 0x4840; if (address >= 0x4800 && address < limit) { m_cartslot->chip_write(space, address, data); @@ -700,7 +700,7 @@ WRITE8_MEMBER( snes_console_state::snes7110_lo_w ) READ8_MEMBER( snes_console_state::snessdd1_lo_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -739,7 +739,7 @@ WRITE8_MEMBER( snes_console_state::snessdd1_lo_w ) WRITE8_MEMBER( snes_console_state::snessdd1_hi_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { if (address < 0x2000) @@ -770,7 +770,7 @@ WRITE8_MEMBER( snes_console_state::snessdd1_hi_w ) READ8_MEMBER( snes_console_state::snesbsx_hi_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -799,7 +799,7 @@ READ8_MEMBER( snes_console_state::snesbsx_hi_r ) WRITE8_MEMBER( snes_console_state::snesbsx_hi_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { if (address < 0x2000) @@ -831,7 +831,7 @@ WRITE8_MEMBER( snes_console_state::snesbsx_hi_w ) READ8_MEMBER( snes_console_state::snesbsx_lo_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -870,7 +870,7 @@ WRITE8_MEMBER( snes_console_state::snesbsx_lo_w ) READ8_MEMBER( snes_console_state::snessgb_hi_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -896,7 +896,7 @@ READ8_MEMBER( snes_console_state::snessgb_lo_r ) WRITE8_MEMBER( snes_console_state::snessgb_hi_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { if (address < 0x2000) @@ -919,7 +919,7 @@ WRITE8_MEMBER( snes_console_state::snessgb_lo_w ) READ8_MEMBER( snes_console_state::pfest94_hi_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -946,7 +946,7 @@ READ8_MEMBER( snes_console_state::pfest94_hi_r ) WRITE8_MEMBER( snes_console_state::pfest94_hi_w ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { if (address < 0x2000) @@ -967,7 +967,7 @@ WRITE8_MEMBER( snes_console_state::pfest94_hi_w ) READ8_MEMBER( snes_console_state::pfest94_lo_r ) { - UINT16 address = offset & 0xffff; + uint16_t address = offset & 0xffff; if (offset < 0x400000) { @@ -1095,7 +1095,7 @@ WRITE8_MEMBER(snes_console_state::io_read) // is automatic reading on? if so, read 16bits from oldjoy1/2 if (SNES_CPU_REG(NMITIMEN) & 1) { - UINT16 joy1 = 0, joy2 = 0, joy3 = 0, joy4 = 0; + uint16_t joy1 = 0, joy2 = 0, joy3 = 0, joy4 = 0; m_ctrl1->port_poll(); m_ctrl2->port_poll(); @@ -1118,29 +1118,29 @@ WRITE8_MEMBER(snes_console_state::io_read) } } -UINT8 snes_console_state::oldjoy1_read(int latched) +uint8_t snes_console_state::oldjoy1_read(int latched) { - UINT8 ret = 0; + uint8_t ret = 0; ret |= m_ctrl1->read_pin4(); ret |= (m_ctrl1->read_pin5() << 1); return ret; } -UINT8 snes_console_state::oldjoy2_read(int latched) +uint8_t snes_console_state::oldjoy2_read(int latched) { - UINT8 ret = 0; + uint8_t ret = 0; ret |= m_ctrl2->read_pin4(); ret |= (m_ctrl2->read_pin5() << 1); return ret; } -void snes_console_state::write_joy_latch(UINT8 data) +void snes_console_state::write_joy_latch(uint8_t data) { m_ctrl1->write_strobe(data); m_ctrl2->write_strobe(data); } -void snes_console_state::wrio_write(UINT8 data) +void snes_console_state::wrio_write(uint8_t data) { if (!(SNES_CPU_REG(WRIO) & 0x80) && (data & 0x80)) { diff --git a/src/mame/drivers/snesb.cpp b/src/mame/drivers/snesb.cpp index 91e82023b62..acdd7226776 100644 --- a/src/mame/drivers/snesb.cpp +++ b/src/mame/drivers/snesb.cpp @@ -155,9 +155,9 @@ public: snesb_state(const machine_config &mconfig, device_type type, const char *tag) : snes_state(mconfig, type, tag) { } - std::unique_ptr m_shared_ram; - UINT8 m_cnt; - std::unique_ptr m_shared_ram2; + std::unique_ptr m_shared_ram; + uint8_t m_cnt; + std::unique_ptr m_shared_ram2; DECLARE_READ8_MEMBER(sharedram_r); DECLARE_WRITE8_MEMBER(sharedram_w); DECLARE_READ8_MEMBER(sb2b_75bd37_r); @@ -736,15 +736,15 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(snesb_state,kinstb) { - INT32 i; - UINT8 *rom = memregion("user3")->base(); + int32_t i; + uint8_t *rom = memregion("user3")->base(); for (i = 0; i < 0x400000; i++) { rom[i] = BITSWAP8(rom[i], 5, 0, 6, 1, 7, 4, 3, 2); } - m_shared_ram = std::make_unique(0x100); + m_shared_ram = std::make_unique(0x100); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x781000, 0x7810ff, read8_delegate(FUNC(snesb_state::sharedram_r),this), write8_delegate(FUNC(snesb_state::sharedram_w),this)); /* extra inputs */ @@ -762,8 +762,8 @@ DRIVER_INIT_MEMBER(snesb_state,mk3snes) DRIVER_INIT_MEMBER(snesb_state,ffight2b) { - INT32 i; - UINT8 *rom = memregion("user3")->base(); + int32_t i; + uint8_t *rom = memregion("user3")->base(); for(i = 0; i < 0x200000; i++) { @@ -805,8 +805,8 @@ DRIVER_INIT_MEMBER(snesb_state,ffight2b) DRIVER_INIT_MEMBER(snesb_state,iron) { - INT32 i; - UINT8 *rom = memregion("user3")->base(); + int32_t i; + uint8_t *rom = memregion("user3")->base(); for (i = 0; i < 0x140000; i++) { @@ -830,8 +830,8 @@ DRIVER_INIT_MEMBER(snesb_state,iron) DRIVER_INIT_MEMBER(snesb_state,denseib) { - UINT8 *rom = memregion("user3")->base(); - INT32 i; + uint8_t *rom = memregion("user3")->base(); + int32_t i; for (i = 0; i < 0x200000; i++) { @@ -859,9 +859,9 @@ DRIVER_INIT_MEMBER(snesb_state,denseib) DRIVER_INIT_CALL(snes_hirom); } -static const UINT8 data_substitution0[] = {0x88,0x02,0x2a,0x08,0x28,0xaa,0x8a,0x0a,0xa2,0x00,0x80,0xa0,0x22,0xa8,0x82,0x20,}; -static const UINT8 data_substitution1[] = {0x44,0x01,0x51,0x40,0x50,0x55,0x45,0x41,0x15,0x00,0x04,0x14,0x11,0x54,0x05,0x10,}; -static const UINT8 address_substitution_low[] = +static const uint8_t data_substitution0[] = {0x88,0x02,0x2a,0x08,0x28,0xaa,0x8a,0x0a,0xa2,0x00,0x80,0xa0,0x22,0xa8,0x82,0x20,}; +static const uint8_t data_substitution1[] = {0x44,0x01,0x51,0x40,0x50,0x55,0x45,0x41,0x15,0x00,0x04,0x14,0x11,0x54,0x05,0x10,}; +static const uint8_t address_substitution_low[] = { 0x32,0x35,0x3a,0x28,0x2a,0x0c,0x36,0x38,0x29,0x39,0x04,0x2c,0x21,0x23,0x3d,0x2d, 0x3c,0x02,0x17,0x31,0x00,0x2e,0x0a,0x2f,0x25,0x26,0x27,0x30,0x33,0x01,0x18,0x19, @@ -869,7 +869,7 @@ static const UINT8 address_substitution_low[] = 0x08,0x3b,0x09,0x14,0x15,0x1d,0x0b,0x0f,0x1e,0x1f,0x2b,0x1a,0x03,0x20,0x3f,0x3e, }; -static const UINT8 address_substitution_high[] = +static const uint8_t address_substitution_high[] = { 0x1b,0x15,0x08,0x1f,0x06,0x02,0x13,0x0a,0x1d,0x04,0x0e,0x00,0x17,0x0c,0x11,0x19, 0x16,0x0d,0x1c,0x07,0x10,0x03,0x1a,0x0b,0x12,0x05,0x0f,0x18,0x1e,0x01,0x14,0x09, @@ -879,8 +879,8 @@ static const UINT8 address_substitution_high[] = DRIVER_INIT_MEMBER(snesb_state,sblast2b) { int i, cipherText, plainText, newAddress; - UINT8 *src = memregion("user7")->base(); - UINT8 *dst = memregion("user3")->base(); + uint8_t *src = memregion("user7")->base(); + uint8_t *dst = memregion("user3")->base(); for (i =0; i < 0x80000 * 3; i++) { @@ -929,28 +929,28 @@ DRIVER_INIT_MEMBER(snesb_state,sblast2b) DRIVER_INIT_MEMBER(snesb_state,endless) { int i; - UINT8 *src = memregion("user7")->base(); - UINT8 *dst = memregion("user3")->base(); + uint8_t *src = memregion("user7")->base(); + uint8_t *dst = memregion("user3")->base(); - static const UINT8 address_tab_high[0x40] = { + static const uint8_t address_tab_high[0x40] = { 0x3b, 0x1d, 0x35, 0x15, 0x39, 0x19, 0x34, 0x13, 0x32, 0x1f, 0x37, 0x17, 0x3d, 0x11, 0x3a, 0x1a, 0x14, 0x3e, 0x18, 0x36, 0x1e, 0x31, 0x10, 0x3c, 0x1b, 0x3f, 0x16, 0x30, 0x12, 0x38, 0x1c, 0x33, 0x2b, 0x0d, 0x25, 0x05, 0x29, 0x09, 0x24, 0x03, 0x22, 0x0f, 0x27, 0x07, 0x2d, 0x01, 0x2a, 0x0a, 0x04, 0x2e, 0x08, 0x26, 0x0e, 0x21, 0x00, 0x2c, 0x0b, 0x2f, 0x06, 0x20, 0x02, 0x28, 0x0c, 0x23 }; - static const UINT8 address_tab_low[0x40] = { + static const uint8_t address_tab_low[0x40] = { 0x14, 0x1d, 0x11, 0x3c, 0x0a, 0x29, 0x2d, 0x2e, 0x30, 0x32, 0x16, 0x36, 0x05, 0x25, 0x26, 0x37, 0x20, 0x21, 0x27, 0x28, 0x33, 0x34, 0x23, 0x12, 0x1e, 0x1f, 0x3b, 0x24, 0x2c, 0x35, 0x38, 0x39, 0x3d, 0x0c, 0x2a, 0x0d, 0x22, 0x18, 0x19, 0x1a, 0x03, 0x08, 0x04, 0x3a, 0x0b, 0x0f, 0x15, 0x17, 0x1b, 0x13, 0x00, 0x1c, 0x2b, 0x01, 0x06, 0x2f, 0x07, 0x09, 0x02, 0x31, 0x10, 0x0e, 0x3f, 0x3e }; - static const UINT8 data_high[16] = { + static const uint8_t data_high[16] = { 0x88, 0x38, 0x10, 0x98, 0x90, 0x00, 0x08, 0x18, 0x20, 0xb8, 0xa8, 0xa0, 0x30, 0x80, 0x28, 0xb0 }; - static const UINT8 data_low[16] = { + static const uint8_t data_low[16] = { 0x41, 0x46, 0x02, 0x43, 0x03, 0x00, 0x40, 0x42, 0x04, 0x47, 0x45, 0x05, 0x06, 0x01, 0x44, 0x07 }; @@ -987,8 +987,8 @@ DRIVER_INIT_MEMBER(snesb_state,endless) /* work around missing content */ m_maincpu->space(AS_PROGRAM).install_read_handler(0x800b, 0x800c, read8_delegate(FUNC(snesb_state::endless_800b_r),this)); - m_shared_ram = std::make_unique(0x22); - m_shared_ram2 = std::make_unique(0x22); + m_shared_ram = std::make_unique(0x22); + m_shared_ram2 = std::make_unique(0x22); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x781000, 0x781021, read8_delegate(FUNC(snesb_state::sharedram_r),this), write8_delegate(FUNC(snesb_state::sharedram_w),this)); m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x781200, 0x781221, read8_delegate(FUNC(snesb_state::sharedram2_r),this), write8_delegate(FUNC(snesb_state::sharedram2_w),this)); diff --git a/src/mame/drivers/snk.cpp b/src/mame/drivers/snk.cpp index 54de1dc057f..9402949c0ae 100644 --- a/src/mame/drivers/snk.cpp +++ b/src/mame/drivers/snk.cpp @@ -92,7 +92,7 @@ Notes: a bug. The service mode functionality is very limited anyway. To get past the failed ROM test and see the service mode, use this ROM patch: - UINT8 *mem = machine.root_device().memregion("maincpu")->base(); + uint8_t *mem = machine.root_device().memregion("maincpu")->base(); mem[0x3a5d] = mem[0x3a5e] = mem[0x3a5f] = 0; - The "SNK Wave" custom sound circuitry is only actually used by marvins and @@ -567,7 +567,7 @@ WRITE8_MEMBER(snk_state::hardflags_scroll_msb_w) int snk_state::hardflags_check(int num) { - const UINT8 *sr = &m_spriteram[0x800 + 4*num]; + const uint8_t *sr = &m_spriteram[0x800 + 4*num]; int x = sr[2] + ((sr[3] & 0x80) << 1); int y = sr[0] + ((sr[3] & 0x10) << 4); @@ -659,7 +659,7 @@ WRITE8_MEMBER(snk_state::turbocheck_msb_w) int snk_state::turbofront_check(int small, int num) { - const UINT8 *sr = &m_spriteram[0x800*small + 4*num]; + const uint8_t *sr = &m_spriteram[0x800*small + 4*num]; int x = sr[2] + ((sr[3] & 0x80) << 1); int y = sr[0] + ((sr[3] & 0x10) << 4); diff --git a/src/mame/drivers/snowbros.cpp b/src/mame/drivers/snowbros.cpp index 8b87ba5efb4..c91f945b213 100644 --- a/src/mame/drivers/snowbros.cpp +++ b/src/mame/drivers/snowbros.cpp @@ -91,7 +91,7 @@ WRITE16_MEMBER(snowbros_state::snowbros_flipscreen_w) } -UINT32 snowbros_state::screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t snowbros_state::screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* This clears & redraws the entire screen each pass */ bitmap.fill(0xf0, cliprect); @@ -248,7 +248,7 @@ WRITE8_MEMBER(snowbros_state::prot_io_w) { case 0x00: { - UINT16 word = m_hyperpac_ram[(0xe000/2)+m_semicom_prot_offset]; + uint16_t word = m_hyperpac_ram[(0xe000/2)+m_semicom_prot_offset]; word = (word & 0xff00) | (data << 0); m_hyperpac_ram[(0xe000/2)+m_semicom_prot_offset] = word; break; @@ -256,7 +256,7 @@ WRITE8_MEMBER(snowbros_state::prot_io_w) case 0x01: { - UINT16 word = m_hyperpac_ram[(0xe000/2)+m_semicom_prot_offset]; + uint16_t word = m_hyperpac_ram[(0xe000/2)+m_semicom_prot_offset]; word = (word & 0x00ff) | (data << 8); m_hyperpac_ram[(0xe000/2)+m_semicom_prot_offset] = word; break; @@ -422,7 +422,7 @@ READ16_MEMBER(snowbros_state::sb3_sound_r) void snowbros_state::sb3_play_music(int data) { - UINT8 *snd; + uint8_t *snd; /* sample is actually played in interrupt function so it loops */ m_sb3_music = data; @@ -1743,7 +1743,7 @@ GFXDECODE_END MACHINE_RESET_MEMBER(snowbros_state,semiprot) { - UINT16 *PROTDATA = (UINT16*)memregion("user1")->base(); + uint16_t *PROTDATA = (uint16_t*)memregion("user1")->base(); int i; for (i = 0;i < 0x200/2;i++) @@ -1752,7 +1752,7 @@ MACHINE_RESET_MEMBER(snowbros_state,semiprot) MACHINE_RESET_MEMBER(snowbros_state,finalttr) { - UINT16 *PROTDATA = (UINT16*)memregion("user1")->base(); + uint16_t *PROTDATA = (uint16_t*)memregion("user1")->base(); int i; for (i = 0;i < 0x200/2;i++) @@ -2783,12 +2783,12 @@ READ16_MEMBER(snowbros_state::_4in1_02_read) DRIVER_INIT_MEMBER(snowbros_state,4in1boot) { - UINT8 *src = memregion("maincpu")->base(); + uint8_t *src = memregion("maincpu")->base(); int len = memregion("maincpu")->bytes(); /* strange order */ { - std::vector buffer(len); + std::vector buffer(len); int i; for (i = 0;i < len; i++) if (i&1) buffer[i] = BITSWAP8(src[i],6,7,5,4,3,2,1,0); @@ -2802,7 +2802,7 @@ DRIVER_INIT_MEMBER(snowbros_state,4in1boot) /* strange order */ { - std::vector buffer(len); + std::vector buffer(len); int i; for (i = 0;i < len; i++) buffer[i] = src[i^0x4000]; @@ -2813,12 +2813,12 @@ DRIVER_INIT_MEMBER(snowbros_state,4in1boot) DRIVER_INIT_MEMBER(snowbros_state,snowbro3) { - UINT8 *src = memregion("maincpu")->base(); + uint8_t *src = memregion("maincpu")->base(); int len = memregion("maincpu")->bytes(); /* strange order */ { - std::vector buffer(len); + std::vector buffer(len); int i; for (i = 0;i < len; i++) buffer[i] = src[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,3,4,1,2,0)]; @@ -2860,7 +2860,7 @@ DRIVER_INIT_MEMBER(snowbros_state,pzlbreak) DRIVER_INIT_MEMBER(snowbros_state,toto) { // every single rom has bits 0x10 and 0x08 swapped - UINT8 *src = memregion("maincpu")->base(); + uint8_t *src = memregion("maincpu")->base(); int len = memregion("maincpu")->bytes(); for (int i = 0; i < len; i++) @@ -2897,7 +2897,7 @@ DRIVER_INIT_MEMBER(snowbros_state, hyperpac) DRIVER_INIT_MEMBER(snowbros_state, yutnori) { // presumably related to the PIC protection - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); rom[0x4878 / 2] = 0x4e71; rom[0xd820 / 2] = 0x4e71; rom[0xc3b6 / 2] = 0x4e71; diff --git a/src/mame/drivers/socrates.cpp b/src/mame/drivers/socrates.cpp index 3f660d21dc4..01a59389811 100644 --- a/src/mame/drivers/socrates.cpp +++ b/src/mame/drivers/socrates.cpp @@ -118,23 +118,23 @@ public: required_memory_region m_vram_reg; memory_region *m_cart_reg; - UINT8 m_data[8]; - UINT8 m_rom_bank; - UINT8 m_ram_bank; - UINT16 m_scroll_offset; - UINT8 m_kb_latch_low[2]; - UINT8 m_kb_latch_high[2]; - UINT8 m_kb_latch_mouse; - UINT8 m_kbmcu_rscount; // how many pokes the kbmcu has taken in the last frame - UINT8 m_io40_latch; // what was last written to speech reg (for open bus)? - UINT8 m_hblankstate; // are we in hblank? - UINT8 m_vblankstate; // are we in vblank? - UINT8 m_speech_running; // is speech synth talking? - UINT32 m_speech_address; // address in speech space - UINT8 m_speech_settings; // speech settings (nybble 0: ? externrom ? ?; nybble 1: ? ? ? ?) - UINT8 m_speech_dummy_read; // have we done a dummy read yet? - UINT8 m_speech_load_address_count; // number of times load address has happened - UINT8 m_speech_load_settings_count; // number of times load settings has happened + uint8_t m_data[8]; + uint8_t m_rom_bank; + uint8_t m_ram_bank; + uint16_t m_scroll_offset; + uint8_t m_kb_latch_low[2]; + uint8_t m_kb_latch_high[2]; + uint8_t m_kb_latch_mouse; + uint8_t m_kbmcu_rscount; // how many pokes the kbmcu has taken in the last frame + uint8_t m_io40_latch; // what was last written to speech reg (for open bus)? + uint8_t m_hblankstate; // are we in hblank? + uint8_t m_vblankstate; // are we in vblank? + uint8_t m_speech_running; // is speech synth talking? + uint32_t m_speech_address; // address in speech space + uint8_t m_speech_settings; // speech settings (nybble 0: ? externrom ? ?; nybble 1: ? ? ? ?) + uint8_t m_speech_dummy_read; // have we done a dummy read yet? + uint8_t m_speech_load_address_count; // number of times load address has happened + uint8_t m_speech_load_settings_count; // number of times load settings has happened DECLARE_READ8_MEMBER(socrates_rom_bank_r); DECLARE_WRITE8_MEMBER(socrates_rom_bank_w); DECLARE_READ8_MEMBER(socrates_ram_bank_r); @@ -153,7 +153,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(socrates); - UINT32 screen_update_socrates(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_socrates(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(assert_irq); TIMER_CALLBACK_MEMBER(clear_speech_cb); TIMER_CALLBACK_MEMBER(clear_irq_cb); @@ -161,7 +161,7 @@ public: void socrates_set_ram_bank(); void socrates_update_kb(); void socrates_check_kb_latch(); - rgb_t socrates_create_color(UINT8 color); + rgb_t socrates_create_color(uint8_t color); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -184,7 +184,7 @@ public: required_memory_bank m_bank3; required_memory_bank m_bank4; - 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); DECLARE_WRITE8_MEMBER( colors_w ); DECLARE_READ8_MEMBER( rombank_r ); DECLARE_WRITE8_MEMBER( rombank_w ); @@ -203,14 +203,14 @@ protected: int get_color(int index, int y); private: - UINT8 m_rombank[2]; - UINT8 m_rambank; - UINT8 m_colors[8]; - UINT8 m_video_regs[4]; + uint8_t m_rombank[2]; + uint8_t m_rambank; + uint8_t m_colors[8]; + uint8_t m_video_regs[4]; struct { - UINT8 buffer[8]; + uint8_t buffer[8]; int head; int tail; } m_kb_queue; @@ -338,7 +338,7 @@ void socrates_state::device_timer(emu_timer &timer, device_timer_id id, int para DRIVER_INIT_MEMBER(socrates_state,socrates) { - UINT8 *gfx = memregion("vram")->base(); + uint8_t *gfx = memregion("vram")->base(); /* fill vram with its init powerup bit pattern, so startup has the checkerboard screen */ for (int i = 0; i < 0x10000; i++) @@ -399,8 +399,8 @@ READ8_MEMBER(socrates_state::status_and_speech)// read 0x4x, some sort of status // bit 2 - speech chip bit 2 // bit 1 - speech chip bit 1 // bit 0 - speech chip bit 0 -UINT8 *speechromint = memregion("speechint")->base(); -UINT8 *speechromext = memregion("speechext")->base(); +uint8_t *speechromint = memregion("speechint")->base(); +uint8_t *speechromext = memregion("speechext")->base(); int temp = 0; temp |= (m_speech_running)?0x80:0; temp |= 0x40; // unknown, possibly IR mcu busy @@ -613,7 +613,7 @@ WRITE8_MEMBER(socrates_state::socrates_scroll_w) // gamma: this needs to be messed with... may differ on different systems... attach to slider somehow? #define GAMMA 1.5 -rgb_t socrates_state::socrates_create_color(UINT8 color) +rgb_t socrates_state::socrates_create_color(uint8_t color) { rgb_t composedcolor; static const double lumatable[256] = { @@ -713,13 +713,13 @@ void socrates_state::video_start() m_scroll_offset = 0; } -UINT32 socrates_state::screen_update_socrates(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t socrates_state::screen_update_socrates(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - static const UINT8 fixedcolors[8] = + static const uint8_t fixedcolors[8] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0xF7 }; - UINT8 *videoram = m_vram_reg->base(); + uint8_t *videoram = m_vram_reg->base(); int x, y, colidx, color; int lineoffset = 0; // if display ever tries to display data at 0xfxxx, offset line displayed by 0x1000 for (y = 0; y < 228; y++) @@ -790,9 +790,9 @@ int iqunlim_state::get_color(int index, int y) return m_vram_reg->u8(0xf000 + ((index & 0x0f) << 8) + ((m_scroll_offset + y + 1) & 0xff)); } -UINT32 iqunlim_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t iqunlim_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_vram_reg->base(); + uint8_t *videoram = m_vram_reg->base(); // bitmap layer for (int y=0; y<224; y++) @@ -800,7 +800,7 @@ UINT32 iqunlim_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, if (y >= m_video_regs[0x03]) break; for (int x=0; x<128; x++) { - UINT8 data = videoram[(m_scroll_offset + y) * 0x80 + x]; + uint8_t data = videoram[(m_scroll_offset + y) * 0x80 + x]; for(int b=0; b<2; b++) { @@ -817,17 +817,17 @@ UINT32 iqunlim_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, { for (int x=0; x= m_video_regs[0x03]) { - UINT8 col0 = get_color(0x0e, py); - UINT8 col1 = get_color(0x0f, py); - UINT8 data = 0; + uint8_t col0 = get_color(0x0e, py); + uint8_t col1 = get_color(0x0f, py); + uint8_t data = 0; if (BIT(m_video_regs[0x02],4) && m_video_regs[0x00] == x && m_video_regs[0x01] == ((y - 1) + (0x400 / (mode_80 ? 0x80 : 0x40)))) // cursor position start at 0x8000 data = 0xff; @@ -879,9 +879,9 @@ void iqunlim_state::machine_start() std::string region_tag; m_cart_reg = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str()); - UINT8 *bios = m_bios_reg->base(); - UINT8 *cart = m_cart_reg ? m_cart_reg->base() : m_bios_reg->base(); - UINT8 *ram = m_vram_reg->base(); + uint8_t *bios = m_bios_reg->base(); + uint8_t *cart = m_cart_reg ? m_cart_reg->base() : m_bios_reg->base(); + uint8_t *ram = m_vram_reg->base(); m_bank1->configure_entries(0x00, 0x10, bios, 0x4000); m_bank1->configure_entries(0x10, 0x10, cart , 0x4000); @@ -947,7 +947,7 @@ WRITE8_MEMBER( iqunlim_state::colors_w ) INPUT_CHANGED_MEMBER( iqunlim_state::send_input ) { - UINT8 data = (UINT8)(uintptr_t)param; + uint8_t data = (uint8_t)(uintptr_t)param; if (newval) { @@ -964,7 +964,7 @@ WRITE8_MEMBER( iqunlim_state::keyboard_clear ) READ8_MEMBER( iqunlim_state::keyboard_r ) { - UINT8 data = 0; + uint8_t data = 0; switch(offset) { diff --git a/src/mame/drivers/softbox.cpp b/src/mame/drivers/softbox.cpp index df38d930eb5..ac3fe9256d0 100644 --- a/src/mame/drivers/softbox.cpp +++ b/src/mame/drivers/softbox.cpp @@ -208,7 +208,7 @@ READ8_MEMBER( softbox_state::ppi1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; data |= !m_ieee->atn_r(); data |= !m_ieee->dav_r() << 1; @@ -266,8 +266,8 @@ READ8_MEMBER( softbox_state::ppi1_pc_r ) */ - UINT8 status = m_hdc->status_r(space, 0); - UINT8 data = 0; + uint8_t status = m_hdc->status_r(space, 0); + uint8_t data = 0; data |= (status & CONTROLLER_BUSY) ? 0 : 0x10; data |= (status & CONTROLLER_DIRECTION) ? 0 : 0x20; diff --git a/src/mame/drivers/sorcerer.cpp b/src/mame/drivers/sorcerer.cpp index 8b090c49a43..864db24d264 100644 --- a/src/mame/drivers/sorcerer.cpp +++ b/src/mame/drivers/sorcerer.cpp @@ -355,11 +355,11 @@ void sorcerer_state::video_start() m_p_videoram = memregion("maincpu")->base()+0xf000; } -UINT32 sorcerer_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sorcerer_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0x80,x; - UINT16 *p; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0x80,x; + uint16_t *p; for (y = 0; y < 30; y++) { @@ -493,7 +493,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(sorcerer_state, sorcerer) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xe000); } diff --git a/src/mame/drivers/spacefb.cpp b/src/mame/drivers/spacefb.cpp index e34bd2b1b7e..6ac2bbcbf81 100644 --- a/src/mame/drivers/spacefb.cpp +++ b/src/mame/drivers/spacefb.cpp @@ -147,7 +147,7 @@ TIMER_CALLBACK_MEMBER(spacefb_state::interrupt_callback) /* compute vector and set the interrupt line */ int vpos = m_screen->vpos(); - UINT8 vector = 0xc7 | ((vpos & 0x40) >> 2) | ((~vpos & 0x40) >> 3); + uint8_t vector = 0xc7 | ((vpos & 0x40) >> 2) | ((~vpos & 0x40) >> 3); m_maincpu->set_input_line_and_vector(0, HOLD_LINE, vector); /* set up for next interrupt */ diff --git a/src/mame/drivers/spaceg.cpp b/src/mame/drivers/spaceg.cpp index 42c033cde7b..e52dcf0edac 100644 --- a/src/mame/drivers/spaceg.cpp +++ b/src/mame/drivers/spaceg.cpp @@ -192,14 +192,14 @@ public: m_sound3(0) { } - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_io9400; - required_shared_ptr m_io9401; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_io9400; + required_shared_ptr m_io9401; DECLARE_WRITE8_MEMBER(zvideoram_w); DECLARE_READ8_MEMBER(spaceg_colorram_r); DECLARE_PALETTE_INIT(spaceg); - UINT32 screen_update_spaceg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spaceg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_palette; required_device m_samples; @@ -260,9 +260,9 @@ WRITE8_MEMBER(spaceg_state::zvideoram_w) { int col = m_colorram[0x400]; int xoff = *m_io9400 >> 5 & 7; - UINT16 offset2 = (offset + 0x100) & 0x1fff; - UINT16 sdata = data << (8 - xoff); - UINT16 vram_data = m_videoram[offset] << 8 | (m_videoram[offset2]); + uint16_t offset2 = (offset + 0x100) & 0x1fff; + uint16_t sdata = data << (8 - xoff); + uint16_t vram_data = m_videoram[offset] << 8 | (m_videoram[offset2]); if (col > 0x0f) popmessage("color > 0x0f = %2d", col); col &= 0x0f; @@ -328,14 +328,14 @@ READ8_MEMBER(spaceg_state::spaceg_colorram_r) } -UINT32 spaceg_state::screen_update_spaceg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t spaceg_state::screen_update_spaceg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { offs_t offs; for (offs = 0; offs < 0x2000; offs++) { int i; - UINT8 data = m_videoram[offs]; + uint8_t data = m_videoram[offs]; int y = offs & 0xff; int x = (offs >> 8) << 3; diff --git a/src/mame/drivers/spartanxtec.cpp b/src/mame/drivers/spartanxtec.cpp index bc4ec0b93fd..c7e1bc4ea1d 100644 --- a/src/mame/drivers/spartanxtec.cpp +++ b/src/mame/drivers/spartanxtec.cpp @@ -41,10 +41,10 @@ public: m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_m62_tileram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll_lo; - required_shared_ptr m_scroll_hi; + required_shared_ptr m_m62_tileram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll_lo; + required_shared_ptr m_scroll_hi; required_device m_maincpu; required_device m_audiocpu; required_device m_palette; @@ -55,7 +55,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spartanxtec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spartanxtec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_PALETTE_INIT(spartanxtec); tilemap_t* m_bg_tilemap; @@ -129,7 +129,7 @@ void spartanxtec_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip } -UINT32 spartanxtec_state::screen_update_spartanxtec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t spartanxtec_state::screen_update_spartanxtec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // there are 4 sets of scroll registers // how to split them isn't clear, 4 groups of 8 rows would be logical @@ -337,7 +337,7 @@ void spartanxtec_state::machine_reset() PALETTE_INIT_MEMBER(spartanxtec_state, spartanxtec) { // todo, proper weights for this bootleg PCB - const UINT8 *color_prom = memregion("cprom")->base(); + const uint8_t *color_prom = memregion("cprom")->base(); for (int i = 0; i < 0x200; i++) { int r, g, b; diff --git a/src/mame/drivers/spc1000.cpp b/src/mame/drivers/spc1000.cpp index fb459f55955..8a50e490ffc 100644 --- a/src/mame/drivers/spc1000.cpp +++ b/src/mame/drivers/spc1000.cpp @@ -175,10 +175,10 @@ public: } private: - UINT8 m_IPLK; - UINT8 m_GMODE; - UINT16 m_page; - std::unique_ptr m_work_ram; + uint8_t m_IPLK; + uint8_t m_GMODE; + uint16_t m_page; + std::unique_ptr m_work_ram; attotime m_time; bool m_centronics_busy; virtual void machine_start() override; @@ -187,7 +187,7 @@ private: required_device m_vdg; required_device m_cass; required_device m_ram; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_ioport_array<10> m_io_kb; required_ioport m_io_joy; required_device m_centronics; @@ -384,8 +384,8 @@ INPUT_PORTS_END void spc1000_state::machine_start() { - UINT8 *mem = memregion("maincpu")->base(); - UINT8 *ram = m_ram->pointer(); + uint8_t *mem = memregion("maincpu")->base(); + uint8_t *ram = m_ram->pointer(); // configure and intialize banks 1 & 3 (read banks) membank("bank1")->configure_entry(0, ram); @@ -404,7 +404,7 @@ void spc1000_state::machine_start() void spc1000_state::machine_reset() { - m_work_ram = make_unique_clear(0x10000); + m_work_ram = make_unique_clear(0x10000); m_IPLK = 1; } @@ -416,7 +416,7 @@ READ8_MEMBER(spc1000_state::mc6847_videoram_r) // m_GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA if (!BIT(m_GMODE, 3)) { // text mode (~A/G set to A) - UINT8 data = m_p_videoram[offset + m_page + 0x800]; + uint8_t data = m_p_videoram[offset + m_page + 0x800]; m_vdg->inv_w(BIT(data, 0)); m_vdg->css_w(BIT(data, 1)); m_vdg->as_w (BIT(data, 2)); @@ -431,7 +431,7 @@ READ8_MEMBER(spc1000_state::mc6847_videoram_r) READ8_MEMBER( spc1000_state::porta_r ) { - UINT8 data = 0x3f; + uint8_t data = 0x3f; data |= (m_cass->input() > 0.0038) ? 0x80 : 0; data |= ((m_cass->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED || ((m_cass->get_state() & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED)) ? 0x40 : 0; data &= ~(m_io_joy->read() & 0x3f); diff --git a/src/mame/drivers/spc1500.cpp b/src/mame/drivers/spc1500.cpp index 40e6a8218e7..ae1a51b3bc1 100644 --- a/src/mame/drivers/spc1500.cpp +++ b/src/mame/drivers/spc1500.cpp @@ -285,13 +285,13 @@ public: MC6845_RECONFIGURE(crtc_reconfig); TIMER_DEVICE_CALLBACK_MEMBER(timer); private: - UINT8 *m_p_ram; - UINT8 m_ipl; - UINT8 m_palet[3]; - UINT8 m_paltbl[8]; - UINT16 m_page; - UINT8 m_pcg_char, m_pcg_attr, m_char_change, m_pcg_char0; - UINT16 m_pcg_offset[3]; + uint8_t *m_p_ram; + uint8_t m_ipl; + uint8_t m_palet[3]; + uint8_t m_paltbl[8]; + uint16_t m_page; + uint8_t m_pcg_char, m_pcg_attr, m_char_change, m_pcg_char0; + uint16_t m_pcg_offset[3]; int m_char_count; attotime m_time; bool m_romsel; @@ -299,7 +299,7 @@ private: bool m_p5bit; bool m_motor; bool m_motor_toggle; - UINT8 m_crtc_vreg[0x100]; + uint8_t m_crtc_vreg[0x100]; bool m_centronics_busy; virtual void machine_start() override; virtual void machine_reset() override; @@ -307,8 +307,8 @@ private: required_device m_vdg; required_device m_cass; required_device m_ram; - required_shared_ptr m_p_videoram; - required_shared_ptr m_pcgram; + required_shared_ptr m_p_videoram; + required_shared_ptr m_pcgram; required_ioport_array<10> m_io_kb; required_ioport m_io_joy; required_ioport m_dipsw; @@ -316,8 +316,8 @@ private: required_device m_pio; required_device m_sound; required_device m_palette; - UINT8 *m_font; - UINT8 m_priority; + uint8_t *m_font; + uint8_t m_priority; emu_timer *m_timer; void get_pcg_addr(); }; @@ -380,7 +380,7 @@ WRITE8_MEMBER( spc1500_state::portc_w) READ8_MEMBER( spc1500_state::portb_r) { - UINT8 data = 0; + uint8_t data = 0; data |= ((m_cass->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED || ((m_cass->get_state() & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED)); data |= (m_dipsw->read() & 1) << 4; data |= (m_cass->input() > 0.0038)<<1; @@ -424,7 +424,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(spc1500_state::timer) void spc1500_state::get_pcg_addr() { - UINT16 vaddr = 0; + uint16_t vaddr = 0; if(m_p_videoram[0x7ff] & 0x20) { vaddr = 0x7ff; } else if(m_p_videoram[0x3ff] & 0x20) { @@ -462,7 +462,7 @@ WRITE8_MEMBER( spc1500_state::pcg_w) READ8_MEMBER( spc1500_state::pcg_r) { int reg = (offset>>8)-0x15; - UINT8 data = 0; + uint8_t data = 0; get_pcg_addr(); if (reg < 0) reg = 2; if (BIT(m_pcg_attr,5)) // PCG font @@ -516,13 +516,13 @@ MC6845_RECONFIGURE(spc1500_state::crtc_reconfig) MC6845_UPDATE_ROW(spc1500_state::crtc_update_row) { - UINT8 han2; - UINT8 *pf; - UINT16 hfnt; + uint8_t han2; + uint8_t *pf; + uint16_t hfnt; int i; int j; int h1, h2, h3; - UINT32 *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix32(y); unsigned char cho[] ={1,1,1,1,1,1,1,1,0,0,1,1,1,3,5,5,0,0,5,3,3,5,5,5,0,0,3,3,5,1}; unsigned char jong[]={0,0,0,1,1,1,1,1,0,0,1,1,1,2,2,2,0,0,2,2,2,2,2,2,0,0,2,2,1,1}; @@ -530,27 +530,27 @@ MC6845_UPDATE_ROW(spc1500_state::crtc_update_row) char hs = (m_crtc_vreg[0x9] < 15 ? 3 : 4); int n = y & (m_crtc_vreg[0x9]); bool ln400 = (hs == 4 && m_crtc_vreg[0x4] > 20); - UINT8 *vram = &m_p_videoram[0] + (m_crtc_vreg[12] << 8) + m_crtc_vreg[13]; + uint8_t *vram = &m_p_videoram[0] + (m_crtc_vreg[12] << 8) + m_crtc_vreg[13]; for (i = 0; i < x_count; i++) { - UINT8 *pp = &vram[0x2000+((y>>hs)*x_count+(((y)&7)<<11))+i+(((hs==4)&&(y&8))?0x400:0)]; - UINT8 *pv = &vram[(y>>hs)*x_count + i]; - UINT8 ascii = *(pv+0x1000); - UINT8 attr = *pv; + uint8_t *pp = &vram[0x2000+((y>>hs)*x_count+(((y)&7)<<11))+i+(((hs==4)&&(y&8))?0x400:0)]; + uint8_t *pv = &vram[(y>>hs)*x_count + i]; + uint8_t ascii = *(pv+0x1000); + uint8_t attr = *pv; inv = (attr & 0x8 ? true : false); - UINT8 color = attr & 0x7; - UINT8 pixelb = *(pp+0); - UINT8 pixelr = *(pp+0x4000); - UINT8 pixelg = *(pp+0x8000); + uint8_t color = attr & 0x7; + uint8_t pixelb = *(pp+0); + uint8_t pixelr = *(pp+0x4000); + uint8_t pixelg = *(pp+0x8000); bool nopalet = ((m_palet[0] | m_palet[1] | m_palet[2])==0 || ln400); - UINT8 pen = (nopalet ? color : m_paltbl[color]); - UINT8 pixelpen = 0; - UINT8 pixel = 0; + uint8_t pen = (nopalet ? color : m_paltbl[color]); + uint8_t pixelpen = 0; + uint8_t pixel = 0; if (hs == 4 && (ascii & 0x80)) { - UINT16 wpixelb = (pixelb << 8) + (*(pp+1)); - UINT16 wpixelr = (pixelr << 8) + (*(pp+0x4001)); - UINT16 wpixelg = (pixelg << 8) + (*(pp+0x8001)); + uint16_t wpixelb = (pixelb << 8) + (*(pp+1)); + uint16_t wpixelr = (pixelr << 8) + (*(pp+0x4001)); + uint16_t wpixelg = (pixelg << 8) + (*(pp+0x8001)); if (ascii != 0xfa) { han2 = *(pv+0x1001); @@ -581,10 +581,10 @@ MC6845_UPDATE_ROW(spc1500_state::crtc_update_row) } else if (attr & 0x20) { - UINT8 *pa = &m_pcgram[(ascii*(m_crtc_vreg[0x9]+1))+n]; - UINT8 b = *pa; - UINT8 r = *(pa+0x800); - UINT8 g = *(pa+0x1000); + uint8_t *pa = &m_pcgram[(ascii*(m_crtc_vreg[0x9]+1))+n]; + uint8_t b = *pa; + uint8_t r = *(pa+0x800); + uint8_t g = *(pa+0x1000); for (j = 0x80; j > 0; j>>=1) { pixel = ((g & j)?4:0)|((r & j)?2:0)|((b & j)?1:0); @@ -596,7 +596,7 @@ MC6845_UPDATE_ROW(spc1500_state::crtc_update_row) } else { - UINT8 fnt = m_font[(hs == 4 ? 0x1000 : (attr & (1<<6) ? 0x80<<4 : 0)) + (ascii<<4) + n]; + uint8_t fnt = m_font[(hs == 4 ? 0x1000 : (attr & (1<<6) ? 0x80<<4 : 0)) + (ascii<<4) + n]; if (ascii == 0 && (attr & 0x08) && inv) { fnt = 0xff; @@ -844,8 +844,8 @@ ADDRESS_MAP_END void spc1500_state::machine_start() { - UINT8 *mem_basic = memregion("basic")->base(); - UINT8 *mem_ipl = memregion("ipl")->base(); + uint8_t *mem_basic = memregion("basic")->base(); + uint8_t *mem_ipl = memregion("ipl")->base(); m_p_ram = m_ram->pointer(); m_font = memregion("font1")->base(); // configure and intialize banks 1 (read banks) @@ -879,7 +879,7 @@ READ8_MEMBER(spc1500_state::mc6845_videoram_r) READ8_MEMBER( spc1500_state::psga_r ) { - UINT8 data = 0; + uint8_t data = 0; data |= (BIT(m_dipsw->read(),1)<<4) | (BIT(m_dipsw->read(),2)<<7); data |= (m_io_joy->read() & 0x6f); return data; @@ -887,7 +887,7 @@ READ8_MEMBER( spc1500_state::psga_r ) READ8_MEMBER( spc1500_state::porta_r ) { - UINT8 data = 0x3f; + uint8_t data = 0x3f; data |= (m_cass->input() > 0.0038) ? 0x80 : 0; data |= ((m_cass->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED) && ((m_cass->get_state() & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED) ? 0x00 : 0x40; data &= ~((m_centronics_busy == 0)<< 5); diff --git a/src/mame/drivers/spdodgeb.cpp b/src/mame/drivers/spdodgeb.cpp index ca263f17eab..487f6985823 100644 --- a/src/mame/drivers/spdodgeb.cpp +++ b/src/mame/drivers/spdodgeb.cpp @@ -77,7 +77,7 @@ void spdodgeb_state::spd_adpcm_int( msm5205_device *device, int chip ) } else { - UINT8 *ROM = memregion("adpcm")->base() + 0x10000 * chip; + uint8_t *ROM = memregion("adpcm")->base() + 0x10000 * chip; m_adpcm_data[chip] = ROM[m_adpcm_pos[chip]++]; device->data_w(m_adpcm_data[chip] >> 4); @@ -166,8 +166,8 @@ void spdodgeb_state::mcu63705_update_inputs() #define A 0x10 #define D 0x20 - UINT8 curr_port[2]; - UINT8 curr_dash[2]; + uint8_t curr_port[2]; + uint8_t curr_dash[2]; int p; for (p=0; p<=1; p++) diff --git a/src/mame/drivers/spec128.cpp b/src/mame/drivers/spec128.cpp index 5d86a379929..7558332bc2d 100644 --- a/src/mame/drivers/spec128.cpp +++ b/src/mame/drivers/spec128.cpp @@ -187,7 +187,7 @@ WRITE8_MEMBER(spectrum_state::spectrum_128_port_7ffd_w) void spectrum_state::spectrum_128_update_memory() { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); /* select ram at 0x0c000-0x0ffff */ int ram_page = m_port_7ffd_data & 0x07; @@ -238,7 +238,7 @@ ADDRESS_MAP_END MACHINE_RESET_MEMBER(spectrum_state,spectrum_128) { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); memset(messram,0,128*1024); /* 0x0000-0x3fff always holds ROM */ diff --git a/src/mame/drivers/specpls3.cpp b/src/mame/drivers/specpls3.cpp index de3d15072ed..2564a2aeda3 100644 --- a/src/mame/drivers/specpls3.cpp +++ b/src/mame/drivers/specpls3.cpp @@ -201,7 +201,7 @@ READ8_MEMBER( spectrum_state::spectrum_plus3_port_2ffd_r ) void spectrum_state::spectrum_plus3_update_memory() { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); if (m_port_7ffd_data & 8) { @@ -324,7 +324,7 @@ ADDRESS_MAP_END MACHINE_RESET_MEMBER(spectrum_state,spectrum_plus3) { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); memset(messram,0,128*1024); MACHINE_RESET_CALL_MEMBER(spectrum); diff --git a/src/mame/drivers/spectra.cpp b/src/mame/drivers/spectra.cpp index eaa344fa575..ffdd4b932cc 100644 --- a/src/mame/drivers/spectra.cpp +++ b/src/mame/drivers/spectra.cpp @@ -58,15 +58,15 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(nmitimer); TIMER_DEVICE_CALLBACK_MEMBER(outtimer); private: - UINT8 m_porta; - UINT8 m_portb; - UINT8 m_t_c; - UINT8 m_out_offs; + uint8_t m_porta; + uint8_t m_portb; + uint8_t m_t_c; + uint8_t m_out_offs; virtual void machine_reset() override; required_device m_maincpu; required_device m_snsnd; required_ioport_array<4> m_switch; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; }; @@ -127,9 +127,9 @@ void spectra_state::machine_reset() READ8_MEMBER( spectra_state::porta_r ) { - UINT8 row = (m_porta & 0x18) >> 3; - UINT8 key = m_switch[row]->read(); - UINT8 ret = ((BIT(key, m_porta & 7)) ? 0x40 : 0) | (m_porta & 0xbf); + uint8_t row = (m_porta & 0x18) >> 3; + uint8_t key = m_switch[row]->read(); + uint8_t ret = ((BIT(key, m_porta & 7)) ? 0x40 : 0) | (m_porta & 0xbf); if (ret == 0x1b && m_p_ram[0x7b] < 0x1E) m_samples->start(3, 8); // coin @@ -181,13 +181,13 @@ TIMER_DEVICE_CALLBACK_MEMBER( spectra_state::nmitimer) // 70-7F solenoids - no knocker TIMER_DEVICE_CALLBACK_MEMBER( spectra_state::outtimer) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x5c, 0x63, 0x01, 0x40, 0x08, 0 }; // 74C912 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x5c, 0x63, 0x01, 0x40, 0x08, 0 }; // 74C912 m_out_offs++; if (m_out_offs < 0x28) { - UINT8 data = m_p_ram[m_out_offs]; - UINT8 segments = patterns[data&15] | (BIT(data, 4) ? 0x80 : 0); + uint8_t data = m_p_ram[m_out_offs]; + uint8_t segments = patterns[data&15] | (BIT(data, 4) ? 0x80 : 0); output().set_digit_value(m_out_offs, segments); } else diff --git a/src/mame/drivers/spectrum.cpp b/src/mame/drivers/spectrum.cpp index e5ee94a4f95..e0d8d945abf 100644 --- a/src/mame/drivers/spectrum.cpp +++ b/src/mame/drivers/spectrum.cpp @@ -660,7 +660,7 @@ INTERRUPT_GEN_MEMBER(spectrum_state::spec_interrupt) DEVICE_IMAGE_LOAD_MEMBER(spectrum_state, spectrum_cart) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size != 0x4000) { diff --git a/src/mame/drivers/speedatk.cpp b/src/mame/drivers/speedatk.cpp index 0bf07e6cb04..18205a0c5d4 100644 --- a/src/mame/drivers/speedatk.cpp +++ b/src/mame/drivers/speedatk.cpp @@ -91,7 +91,7 @@ void speedatk_state::machine_start() save_item(NAME(m_coin_impulse)); } -UINT8 speedatk_state::iox_key_matrix_calc(UINT8 p_side) +uint8_t speedatk_state::iox_key_matrix_calc(uint8_t p_side) { static const char *const keynames[] = { "P1_ROW0", "P1_ROW1", "P2_ROW0", "P2_ROW1" }; @@ -134,8 +134,8 @@ READ8_MEMBER(speedatk_state::key_matrix_r) /* both side checks */ if(m_mux_data == 1) { - UINT8 p1_side = iox_key_matrix_calc(0); - UINT8 p2_side = iox_key_matrix_calc(2); + uint8_t p1_side = iox_key_matrix_calc(0); + uint8_t p2_side = iox_key_matrix_calc(2); if(p1_side != 0) return p1_side; diff --git a/src/mame/drivers/speedbal.cpp b/src/mame/drivers/speedbal.cpp index 0f92ffc75a1..a4777576d2b 100644 --- a/src/mame/drivers/speedbal.cpp +++ b/src/mame/drivers/speedbal.cpp @@ -292,8 +292,8 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(speedbal_state,speedbal) { // sprite tiles are in an odd order, rearrange to simplify video drawing function - UINT8* rom = memregion("sprites")->base(); - std::vector temp(0x200*128); + uint8_t* rom = memregion("sprites")->base(); + std::vector temp(0x200*128); for (int i=0;i<0x200;i++) { @@ -359,9 +359,9 @@ ROM_END DRIVER_INIT_MEMBER(speedbal_state,musicbal) { - UINT8* rom = memregion("maincpu")->base(); + uint8_t* rom = memregion("maincpu")->base(); - const UINT8 xorTable[8] = {0x05, 0x06, 0x84, 0x84, 0x00, 0x87, 0x84, 0x84}; // XORs affecting bits #0, #1, #2 & #7 + const uint8_t xorTable[8] = {0x05, 0x06, 0x84, 0x84, 0x00, 0x87, 0x84, 0x84}; // XORs affecting bits #0, #1, #2 & #7 const int swapTable[4][4] = { // 4 possible swaps affecting bits #0, #1, #2 & #7 {1,0,7,2}, {2,7,0,1}, diff --git a/src/mame/drivers/speedspn.cpp b/src/mame/drivers/speedspn.cpp index 7fe4e785821..24fc6a2ccb9 100644 --- a/src/mame/drivers/speedspn.cpp +++ b/src/mame/drivers/speedspn.cpp @@ -256,7 +256,7 @@ GFXDECODE_END void speedspn_state::machine_start() { /* is this weird banking some form of protection? */ - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); m_prgbank->configure_entry(0, &rom[0x28000]); m_prgbank->configure_entry(1, &rom[0x14000]); m_prgbank->configure_entry(2, &rom[0x1c000]); diff --git a/src/mame/drivers/speglsht.cpp b/src/mame/drivers/speglsht.cpp index 2c681d9d34e..91c1a3e31f0 100644 --- a/src/mame/drivers/speglsht.cpp +++ b/src/mame/drivers/speglsht.cpp @@ -123,11 +123,11 @@ public: m_subcpu(*this, "sub") { } - required_shared_ptr m_shared; - required_shared_ptr m_framebuffer; - UINT32 m_videoreg; + required_shared_ptr m_shared; + required_shared_ptr m_framebuffer; + uint32_t m_videoreg; std::unique_ptr m_bitmap; - required_shared_ptr m_cop_ram; + required_shared_ptr m_cop_ram; DECLARE_READ32_MEMBER(shared_r); DECLARE_WRITE32_MEMBER(shared_w); DECLARE_WRITE32_MEMBER(videoreg_w); @@ -138,7 +138,7 @@ public: DECLARE_MACHINE_RESET(speglsht); virtual void machine_start() override; DECLARE_VIDEO_START(speglsht); - UINT32 screen_update_speglsht(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_speglsht(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_palette; required_device m_maincpu; required_device m_subcpu; @@ -213,12 +213,12 @@ WRITE32_MEMBER(speglsht_state::cop_w) //matrix * vector READ32_MEMBER(speglsht_state::cop_r) { - INT32 *cop=(INT32*)&m_cop_ram[0]; + int32_t *cop=(int32_t*)&m_cop_ram[0]; union { - INT32 a; - UINT32 b; + int32_t a; + uint32_t b; }temp; switch (offset) @@ -359,7 +359,7 @@ VIDEO_START_MEMBER(speglsht_state,speglsht) bitmap.pix32(y, x) = (b) | ((g)<<8) | ((r)<<16); \ } -UINT32 speglsht_state::screen_update_speglsht(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t speglsht_state::screen_update_speglsht(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,dy; @@ -381,7 +381,7 @@ UINT32 speglsht_state::screen_update_speglsht(screen_device &screen, bitmap_rgb3 //copy temporary bitmap to rgb 32 bit bitmap for(y=cliprect.min_y; ypix16(y); + uint16_t *srcline = &m_bitmap->pix16(y); for(x=cliprect.min_x; xbase(); + uint8_t *rom = memregion("gfx1")->base(); ret = rom[m_gfx_rom_address]; @@ -401,7 +401,7 @@ READ8_MEMBER(spiders_state::gfx_rom_r) } else { - UINT8 shift_count = m_gfx_rom_ctrl_latch << 2; + uint8_t shift_count = m_gfx_rom_ctrl_latch << 2; m_gfx_rom_address = (m_gfx_rom_address & ~(0x0f << shift_count)) | (m_gfx_rom_ctrl_data << shift_count); ret = 0; diff --git a/src/mame/drivers/spinb.cpp b/src/mame/drivers/spinb.cpp index 4f1fca84c02..569c10e8287 100644 --- a/src/mame/drivers/spinb.cpp +++ b/src/mame/drivers/spinb.cpp @@ -86,28 +86,28 @@ public: DECLARE_DRIVER_INIT(game1); DECLARE_DRIVER_INIT(game2); DECLARE_PALETTE_INIT(spinb); - 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); private: bool m_pc0a; bool m_pc0m; - UINT8 m_game; - UINT8 m_portc_a; - UINT8 m_portc_m; - UINT8 m_row; - UINT8 m_p3; - UINT8 m_p32; - UINT8 m_dmdcmd; - UINT8 m_dmdbank; - UINT8 m_dmdextaddr; - UINT8 m_dmdram[0x2000]; - UINT8 m_sndcmd; - UINT8 m_sndbank_a; - UINT8 m_sndbank_m; - UINT32 m_sound_addr_a; - UINT32 m_sound_addr_m; - UINT8 *m_p_audio; - UINT8 *m_p_music; - UINT8 *m_p_dmdcpu; + uint8_t m_game; + uint8_t m_portc_a; + uint8_t m_portc_m; + uint8_t m_row; + uint8_t m_p3; + uint8_t m_p32; + uint8_t m_dmdcmd; + uint8_t m_dmdbank; + uint8_t m_dmdextaddr; + uint8_t m_dmdram[0x2000]; + uint8_t m_sndcmd; + uint8_t m_sndbank_a; + uint8_t m_sndbank_m; + uint32_t m_sound_addr_a; + uint32_t m_sound_addr_m; + uint8_t *m_p_audio; + uint8_t *m_p_music; + uint8_t *m_p_dmdcpu; virtual void machine_reset() override; virtual void machine_start() override; required_device m_maincpu; @@ -378,7 +378,7 @@ WRITE8_MEMBER( spinb_state::disp_w ) WRITE8_MEMBER( spinb_state::ppi60a_w ) { if (data) - for (UINT8 i = 0; i < 8; i++) + for (uint8_t i = 0; i < 8; i++) if (BIT(data, i)) m_row = i; } @@ -387,7 +387,7 @@ WRITE8_MEMBER( spinb_state::ppi60a_w ) WRITE8_MEMBER( spinb_state::ppi60b_w ) { if (data & 7) - for (UINT8 i = 0; i < 3; i++) + for (uint8_t i = 0; i < 3; i++) if (BIT(data, i)) m_row = i+8; } @@ -560,10 +560,10 @@ PALETTE_INIT_MEMBER( spinb_state, spinb ) palette.set_pen_color(2, rgb_t(0x7c, 0x55, 0x00)); } -UINT32 spinb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t spinb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,gfx,gfx1; - UINT16 sy=0,ma,x; + uint8_t y,gfx,gfx1; + uint16_t sy=0,ma,x; address_space &internal = m_dmdcpu->space(AS_DATA); ma = internal.read_byte(0x05) << 8; // find where display memory is @@ -574,7 +574,7 @@ UINT32 spinb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c for(y=0; y<32; y++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for(x = 0; x < 16; x++) { gfx = m_dmdram[ma+0x200]; @@ -597,7 +597,7 @@ UINT32 spinb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c for(y=0; y<32; y++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for(x = 0; x < 16; x++) { gfx = m_dmdram[ma++]; diff --git a/src/mame/drivers/splash.cpp b/src/mame/drivers/splash.cpp index 1bc6b4c8b71..8178529d159 100644 --- a/src/mame/drivers/splash.cpp +++ b/src/mame/drivers/splash.cpp @@ -1044,7 +1044,7 @@ DRIVER_INIT_MEMBER(splash_state,splash10) DRIVER_INIT_MEMBER(splash_state,roldfrog) { - UINT8 * ROM = (UINT8 *)memregion("audiocpu")->base(); + uint8_t * ROM = (uint8_t *)memregion("audiocpu")->base(); membank("sound_bank")->configure_entries(0, 16, &ROM[0x10000], 0x8000); m_bitmap_type = 1; @@ -1053,7 +1053,7 @@ DRIVER_INIT_MEMBER(splash_state,roldfrog) DRIVER_INIT_MEMBER(splash_state,rebus) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); m_bitmap_type = 1; m_sprite_attr2_shift = 0; @@ -1397,7 +1397,7 @@ DRIVER_INIT_MEMBER(splash_state,funystrp) m_bitmap_type = 0; m_sprite_attr2_shift = 0; - UINT16 *ROM = (UINT16 *)memregion("audiocpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("audiocpu")->base(); membank("sound_bank")->configure_entries(0, 16, &ROM[0x00000], 0x8000); diff --git a/src/mame/drivers/splus.cpp b/src/mame/drivers/splus.cpp index 195303ac413..03409649a3c 100644 --- a/src/mame/drivers/splus.cpp +++ b/src/mame/drivers/splus.cpp @@ -60,21 +60,21 @@ public: m_p1_unknown = 0x00; } - 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) { return 0; } // Pointers to External RAM - required_shared_ptr m_cmosl_ram; - required_shared_ptr m_cmosh_ram; + required_shared_ptr m_cmosl_ram; + required_shared_ptr m_cmosh_ram; // Program and Reel Data - optional_shared_ptr m_program_ram; - required_shared_ptr m_reel_ram; + optional_shared_ptr m_program_ram; + required_shared_ptr m_reel_ram; // IO Ports - required_shared_ptr m_io_port; + required_shared_ptr m_io_port; required_ioport m_i10; required_ioport m_i20; required_ioport m_i30; @@ -84,21 +84,21 @@ public: int m_sda_dir; // Coin-In States - UINT8 m_coin_state; - UINT64 m_last_cycles; - UINT64 m_last_coin_out; - UINT8 m_coin_out_state; + uint8_t m_coin_state; + uint64_t m_last_cycles; + uint64_t m_last_coin_out; + uint8_t m_coin_out_state; - UINT8 m_bank10; - UINT8 m_bank20; - UINT8 m_bank30; - UINT8 m_bank40; + uint8_t m_bank10; + uint8_t m_bank20; + uint8_t m_bank30; + uint8_t m_bank40; - UINT8 m_p1_reels; - UINT8 m_p1_unknown; + uint8_t m_p1_reels; + uint8_t m_p1_unknown; - INT16 m_stepper_pos[5]; - UINT8 m_stop_pos[5]; + int16_t m_stepper_pos[5]; + uint8_t m_stop_pos[5]; DECLARE_WRITE8_MEMBER(splus_io_w); DECLARE_WRITE8_MEMBER(splus_load_pulse_w); @@ -122,7 +122,7 @@ public: #define MAX_STEPPER 200 // 1.8 Degree Stepper Motor = 200 full-steps per revolution, but 400 when in half-step mode #define STEPPER_DIVISOR 9.09 //18.18 // To allow for 22 stop positions -static const UINT8 optics[200] = { +static const uint8_t optics[200] = { 0x07, 0x07, 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -195,13 +195,13 @@ WRITE8_MEMBER(splus_state::splus_io_w) WRITE8_MEMBER(splus_state::splus_load_pulse_w) { -// UINT8 out = 0; +// uint8_t out = 0; // out = ((~m_io_port[1] & 0xf0)>>4); // Output Bank } WRITE8_MEMBER(splus_state::splus_serial_w) { - UINT8 out = 0; + uint8_t out = 0; out = ((~m_io_port[1] & 0xe0)>>5); // Output Bank switch (out) @@ -342,10 +342,10 @@ WRITE8_MEMBER(splus_state::splus_serial_w) WRITE8_MEMBER(splus_state::splus_7seg_w) { - static const UINT8 ls48_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; + static const uint8_t ls48_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; - UINT8 seg; - UINT8 val; + uint8_t seg; + uint8_t val; seg = ((~data & 0xf0)>>4); // Segment Number val = (~data & 0x0f); // Digit Value @@ -373,13 +373,13 @@ WRITE8_MEMBER(splus_state::i2c_nvram_w) READ8_MEMBER(splus_state::splus_serial_r) { - UINT8 coin_out = 0x00; - UINT8 coin_optics = 0x00; - UINT8 door_optics = 0x00; - UINT32 curr_cycles = m_maincpu->total_cycles(); + uint8_t coin_out = 0x00; + uint8_t coin_optics = 0x00; + uint8_t door_optics = 0x00; + uint32_t curr_cycles = m_maincpu->total_cycles(); - UINT8 in = 0x00; - UINT8 val = 0x00; + uint8_t in = 0x00; + uint8_t val = 0x00; in = ((~m_io_port[1] & 0xe0)>>5); // Input Bank switch (in) @@ -553,8 +553,8 @@ READ8_MEMBER(splus_state::splus_reel_optics_r) Bit 6 = ??? Bit 7 = I2C EEPROM SDA */ - UINT8 reel_optics = 0x00; - UINT8 sda = 0; + uint8_t reel_optics = 0x00; + uint8_t sda = 0; // Return Reel Positions reel_optics = (optics[199-(m_stepper_pos[4])] & 0x10) | (optics[199-(m_stepper_pos[3])] & 0x08) | (optics[199-(m_stepper_pos[2])] & 0x04) | (optics[199-(m_stepper_pos[1])] & 0x02) | (optics[199-(m_stepper_pos[0])] & 0x01); @@ -575,7 +575,7 @@ READ8_MEMBER(splus_state::splus_reel_optics_r) DRIVER_INIT_MEMBER(splus_state,splus) { - UINT8 *reel_data = memregion( "reeldata" )->base(); + uint8_t *reel_data = memregion( "reeldata" )->base(); // Load Reel Data memcpy(m_reel_ram, &reel_data[0x0000], 0x2000); diff --git a/src/mame/drivers/spoker.cpp b/src/mame/drivers/spoker.cpp index 65cdb6aa9bd..969faca2280 100644 --- a/src/mame/drivers/spoker.cpp +++ b/src/mame/drivers/spoker.cpp @@ -54,21 +54,21 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_bg_tile_ram; + required_shared_ptr m_bg_tile_ram; tilemap_t *m_bg_tilemap; - required_shared_ptr m_fg_tile_ram; - required_shared_ptr m_fg_color_ram; + required_shared_ptr m_fg_tile_ram; + required_shared_ptr m_fg_color_ram; tilemap_t *m_fg_tilemap; // common int m_nmi_ack; - UINT8 m_out[3]; + uint8_t m_out[3]; // spk116it and spk115it specific int m_video_enable; int m_hopper; - UINT8 m_igs_magic[2]; + uint8_t m_igs_magic[2]; // common DECLARE_WRITE8_MEMBER(bg_tile_w); @@ -94,7 +94,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); - 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); }; @@ -139,7 +139,7 @@ void spoker_state::video_start() m_fg_tilemap->set_transparent_pen(0); } -UINT32 spoker_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t spoker_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -158,7 +158,7 @@ CUSTOM_INPUT_MEMBER(spoker_state::hopper_r) return machine().input().code_pressed(KEYCODE_H); } -static void show_out(running_machine &machine, UINT8 *out) +static void show_out(running_machine &machine, uint8_t *out) { #ifdef MAME_DEBUG machine.popmessage("%02x %02x %02x", out[0], out[1], out[2]); @@ -852,7 +852,7 @@ DRIVER_INIT_MEMBER(spoker_state, spkleftover) Maybe a leftover... */ int A, B; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0; A < 0x10000; A++) { @@ -864,7 +864,7 @@ DRIVER_INIT_MEMBER(spoker_state, spkleftover) DRIVER_INIT_MEMBER(spoker_state, spk116it) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (A = 0; A < 0x10000; A++) { @@ -878,7 +878,7 @@ DRIVER_INIT_MEMBER(spoker_state, spk116it) DRIVER_INIT_MEMBER(spoker_state, 3super8) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; /* Decryption is probably done using one macrocell/output on an address decoding pal which we do not have a dump of */ @@ -888,7 +888,7 @@ DRIVER_INIT_MEMBER(spoker_state, 3super8) /* nor-reduced: !(!(!(!A6|!A8))|!(!(A7|!A11)|!(!A9|A11))); */ for(i=0;i<0x20000;i++) { - UINT8 a6, a7, a8, a9, a11, d5 = 0; + uint8_t a6, a7, a8, a9, a11, d5 = 0; a6 = BIT(i,6); a7 = BIT(i,7); a8 = BIT(i,8); a9 = BIT(i,9); a11 = BIT(i,11); d5 = (a6 & a8) & ((~a7 & a11) | (a9 & ~a11)); ROM[i] ^= d5*0x20; @@ -896,9 +896,9 @@ DRIVER_INIT_MEMBER(spoker_state, 3super8) /* cheesy hack: take gfx roms from spk116it and rearrange them for this game needs */ { - UINT8 *src = memregion("rep_gfx")->base(); - UINT8 *dst = memregion("gfx1")->base(); - UINT8 x; + uint8_t *src = memregion("rep_gfx")->base(); + uint8_t *dst = memregion("gfx1")->base(); + uint8_t x; for(x=0;x<3;x++) { diff --git a/src/mame/drivers/spool99.cpp b/src/mame/drivers/spool99.cpp index 392b32bc1ae..7418d0f7939 100644 --- a/src/mame/drivers/spool99.cpp +++ b/src/mame/drivers/spool99.cpp @@ -114,9 +114,9 @@ public: required_device m_oki; required_device m_gfxdecode; - required_shared_ptr m_main; - required_shared_ptr m_vram; - required_shared_ptr m_cram; + required_shared_ptr m_main; + required_shared_ptr m_vram; + required_shared_ptr m_cram; tilemap_t *m_sc0_tilemap; @@ -131,7 +131,7 @@ public: DECLARE_DRIVER_INIT(spool99); virtual void video_start() override; - 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); TILE_GET_INFO_MEMBER(get_tile_info); }; @@ -151,7 +151,7 @@ void spool99_state::video_start() m_sc0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(spool99_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); } -UINT32 spool99_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t spool99_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0); return 0; @@ -173,7 +173,7 @@ WRITE8_MEMBER(spool99_state::cram_w) READ8_MEMBER(spool99_state::spool99_io_r) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // if(!(io_switch)) { @@ -240,7 +240,7 @@ ADDRESS_MAP_END READ8_MEMBER(spool99_state::vcarn_io_r) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); // if(!(io_switch)) { @@ -453,8 +453,8 @@ ROM_END DRIVER_INIT_MEMBER(spool99_state,spool99) { - UINT8 *ROM = memregion("maincpu")->base(); -// vram = std::make_unique(0x2000); + uint8_t *ROM = memregion("maincpu")->base(); +// vram = std::make_unique(0x2000); memcpy(m_main, ROM, 0x100); } diff --git a/src/mame/drivers/sprcros2.cpp b/src/mame/drivers/sprcros2.cpp index eb137827c2f..8acd06cca06 100644 --- a/src/mame/drivers/sprcros2.cpp +++ b/src/mame/drivers/sprcros2.cpp @@ -78,15 +78,15 @@ public: required_device m_slave_cpu; required_device m_gfxdecode; - required_shared_ptr m_fgvram; - required_shared_ptr m_fgattr; - required_shared_ptr m_bgvram; - required_shared_ptr m_bgattr; - required_shared_ptr m_sprram; + required_shared_ptr m_fgvram; + required_shared_ptr m_fgattr; + required_shared_ptr m_bgvram; + required_shared_ptr m_bgattr; + required_shared_ptr m_sprram; // screen updates - 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); DECLARE_PALETTE_INIT(sprcros2); DECLARE_WRITE8_MEMBER(master_output_w); DECLARE_WRITE8_MEMBER(slave_output_w); @@ -100,7 +100,7 @@ public: bool m_master_irq_enable; bool m_slave_nmi_enable; bool m_screen_enable; - UINT8 m_bg_scrollx, m_bg_scrolly; + uint8_t m_bg_scrollx, m_bg_scrolly; protected: // driver_device overrides virtual void machine_start() override; @@ -127,10 +127,10 @@ void sprcros2_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &clipre { for (int x=0;x<32;x++) { - UINT16 tile = m_bgvram[count]; + uint16_t tile = m_bgvram[count]; tile |= (m_bgattr[count] & 7) << 8; bool flipx = bool(m_bgattr[count] & 0x08); - UINT8 color = (m_bgattr[count] & 0xf0) >> 4; + uint8_t color = (m_bgattr[count] & 0xf0) >> 4; gfx_0->opaque(bitmap,cliprect,tile,color,flipx,0,x*8-m_bg_scrollx,y*8-m_bg_scrolly); gfx_0->opaque(bitmap,cliprect,tile,color,flipx,0,x*8+256-m_bg_scrollx,y*8-m_bg_scrolly); @@ -149,7 +149,7 @@ void sprcros2_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr for(int count=0x40-4;count>-1;count-=4) { - UINT8 x,y,tile,color; + uint8_t x,y,tile,color; bool flipx; y = 224-m_sprram[count+2]; @@ -170,9 +170,9 @@ void sprcros2_state::legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &clipre { for (int x=0;x<32;x++) { - UINT16 tile = m_fgvram[count]; + uint16_t tile = m_fgvram[count]; tile |= (m_fgattr[count] & 3) << 8; - UINT8 color = (m_fgattr[count] & 0xfc) >> 2; + uint8_t color = (m_fgattr[count] & 0xfc) >> 2; // TODO: was using tileinfo.group, which I don't know what's for at all. // This guess seems as good as the original one for all I know. @@ -189,7 +189,7 @@ void sprcros2_state::legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &clipre -UINT32 sprcros2_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t sprcros2_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { if(m_screen_enable == false) { @@ -370,7 +370,7 @@ void sprcros2_state::machine_reset() PALETTE_INIT_MEMBER(sprcros2_state, sprcros2) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; /* create a lookup table for the palette */ @@ -406,14 +406,14 @@ PALETTE_INIT_MEMBER(sprcros2_state, sprcros2) /* bg */ for (i = 0; i < 0x100; i++) { - UINT8 ctabentry = (color_prom[i] & 0x0f) | ((color_prom[i + 0x100] & 0x0f) << 4); + uint8_t ctabentry = (color_prom[i] & 0x0f) | ((color_prom[i + 0x100] & 0x0f) << 4); palette.set_pen_indirect(i, ctabentry); } /* sprites & fg */ for (i = 0x100; i < 0x300; i++) { - UINT8 ctabentry = color_prom[i + 0x100]; + uint8_t ctabentry = color_prom[i + 0x100]; palette.set_pen_indirect(i, ctabentry); } } diff --git a/src/mame/drivers/sprint2.cpp b/src/mame/drivers/sprint2.cpp index ea26f6f0e5d..f57d3d54c84 100644 --- a/src/mame/drivers/sprint2.cpp +++ b/src/mame/drivers/sprint2.cpp @@ -51,7 +51,7 @@ DRIVER_INIT_MEMBER(sprint2_state,dominos4) int sprint2_state::service_mode() { - UINT8 v = ioport("INB")->read(); + uint8_t v = ioport("INB")->read(); if (MACHINE_IS_SPRINT1) { @@ -133,7 +133,7 @@ READ8_MEMBER(sprint2_state::sprint2_dip_r) READ8_MEMBER(sprint2_state::sprint2_input_A_r) { - UINT8 val = ioport("INA")->read(); + uint8_t val = ioport("INA")->read(); if (m_game == 2)// (MACHINE_IS_SPRINT2) { @@ -151,7 +151,7 @@ READ8_MEMBER(sprint2_state::sprint2_input_A_r) READ8_MEMBER(sprint2_state::sprint2_input_B_r) { - UINT8 val = ioport("INB")->read(); + uint8_t val = ioport("INB")->read(); if (m_game == 1) // (MACHINE_IS_SPRINT1) { @@ -166,7 +166,7 @@ READ8_MEMBER(sprint2_state::sprint2_input_B_r) READ8_MEMBER(sprint2_state::sprint2_sync_r) { - UINT8 val = 0; + uint8_t val = 0; if (m_attract != 0) val |= 0x10; diff --git a/src/mame/drivers/sprint4.cpp b/src/mame/drivers/sprint4.cpp index 5b250ae5c65..2000e13a6b4 100644 --- a/src/mame/drivers/sprint4.cpp +++ b/src/mame/drivers/sprint4.cpp @@ -62,19 +62,19 @@ TIMER_CALLBACK_MEMBER(sprint4_state::nmi_callback) /* MAME updates controls only once per frame but the game checks them on every NMI */ - UINT8 wheel[4] = + uint8_t wheel[4] = { - static_cast(ioport("WHEEL1")->read()), - static_cast(ioport("WHEEL2")->read()), - static_cast(ioport("WHEEL3")->read()), - static_cast(ioport("WHEEL4")->read()) + static_cast(ioport("WHEEL1")->read()), + static_cast(ioport("WHEEL2")->read()), + static_cast(ioport("WHEEL3")->read()), + static_cast(ioport("WHEEL4")->read()) }; - UINT8 lever[4] = + uint8_t lever[4] = { - static_cast(ioport("LEVER1")->read()), - static_cast(ioport("LEVER2")->read()), - static_cast(ioport("LEVER3")->read()), - static_cast(ioport("LEVER4")->read()) + static_cast(ioport("LEVER1")->read()), + static_cast(ioport("LEVER2")->read()), + static_cast(ioport("LEVER3")->read()), + static_cast(ioport("LEVER4")->read()) }; int i; @@ -140,7 +140,7 @@ void sprint4_state::machine_reset() READ8_MEMBER(sprint4_state::sprint4_wram_r) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; return videoram[0x380 + offset]; } @@ -167,7 +167,7 @@ READ8_MEMBER(sprint4_state::sprint4_options_r) WRITE8_MEMBER(sprint4_state::sprint4_wram_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; videoram[0x380 + offset] = data; } diff --git a/src/mame/drivers/sprint8.cpp b/src/mame/drivers/sprint8.cpp index 0ad68f05dc2..9a39559cf50 100644 --- a/src/mame/drivers/sprint8.cpp +++ b/src/mame/drivers/sprint8.cpp @@ -32,7 +32,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(sprint8_state::input_callback) for (i = 0; i < 8; i++) { - UINT8 val = ioport(dialnames[i])->read() >> 4; + uint8_t val = ioport(dialnames[i])->read() >> 4; signed char delta = (val - m_dial[i]) & 15; @@ -68,7 +68,7 @@ READ8_MEMBER(sprint8_state::sprint8_collision_r) READ8_MEMBER(sprint8_state::sprint8_input_r) { static const char *const portnames[] = { "P1", "P2", "P3", "P4", "P5", "P6", "P7", "P8" }; - UINT8 val = ioport(portnames[offset])->read(); + uint8_t val = ioport(portnames[offset])->read(); if (m_steer_dir[offset]) { diff --git a/src/mame/drivers/spy.cpp b/src/mame/drivers/spy.cpp index ea0ab417e67..1396d404b8c 100644 --- a/src/mame/drivers/spy.cpp +++ b/src/mame/drivers/spy.cpp @@ -464,7 +464,7 @@ WRITE8_MEMBER(spy_state::volume_callback1) void spy_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 12, &ROM[0x10000], 0x2000); diff --git a/src/mame/drivers/spyhuntertec.cpp b/src/mame/drivers/spyhuntertec.cpp index 9e67f43338f..377f858786d 100644 --- a/src/mame/drivers/spyhuntertec.cpp +++ b/src/mame/drivers/spyhuntertec.cpp @@ -48,11 +48,11 @@ public: required_device m_audiocpu; required_device m_analog_timer; required_ioport_array<2> m_analog_input; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; - required_shared_ptr m_paletteram; - required_shared_ptr m_spyhunt_alpharam; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_paletteram; + required_shared_ptr m_spyhunt_alpharam; required_device m_palette; required_device m_gfxdecode; required_device m_screen; @@ -62,14 +62,14 @@ public: virtual void machine_reset() override; virtual void video_start() override; void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spyhuntertec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spyhuntertec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT8 m_spyhunt_sprite_color_mask; - INT16 m_spyhunt_scroll_offset; - INT16 m_spyhunt_scrollx; - INT16 m_spyhunt_scrolly; + uint8_t m_spyhunt_sprite_color_mask; + int16_t m_spyhunt_scroll_offset; + int16_t m_spyhunt_scrollx; + int16_t m_spyhunt_scrolly; int mcr_cocktail_flip; @@ -78,7 +78,7 @@ public: DECLARE_WRITE8_MEMBER(spyhuntertec_paletteram_w); DECLARE_DRIVER_INIT(spyhuntertec); // DECLARE_VIDEO_START(spyhuntertec); -// UINT32 screen_update_spyhuntertec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); +// uint32_t screen_update_spyhuntertec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(spyhuntertec_port04_w); DECLARE_WRITE8_MEMBER(spyhuntertec_fd00_w); DECLARE_WRITE8_MEMBER(spyhuntertec_portf0_w); @@ -106,8 +106,8 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(analog_count_callback); void reset_analog_timer(); - UINT8 m_analog_select; - UINT8 m_analog_count; + uint8_t m_analog_select; + uint8_t m_analog_count; }; WRITE8_MEMBER(spyhuntertec_state::ay1_porta_w) @@ -156,7 +156,7 @@ READ8_MEMBER(spyhuntertec_state::ay2_porta_r) WRITE8_MEMBER(spyhuntertec_state::spyhunt_videoram_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); } @@ -214,7 +214,7 @@ TILEMAP_MAPPER_MEMBER(spyhuntertec_state::spyhunt_bg_scan) TILE_GET_INFO_MEMBER(spyhuntertec_state::spyhunt_get_bg_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int data = videoram[tile_index]; int code = (data & 0x3f) | ((data >> 1) & 0x40); SET_TILE_INFO_MEMBER(0, code, 0, (data & 0x40) ? TILE_FLIPY : 0); @@ -249,7 +249,7 @@ void spyhuntertec_state::video_start() void spyhuntertec_state::mcr3_update_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int color_mask, int code_xor, int dx, int dy, int interlaced) { - UINT8 *spriteram = m_spriteram; + uint8_t *spriteram = m_spriteram; int offs; m_screen->priority().fill(1, cliprect); @@ -316,7 +316,7 @@ void spyhuntertec_state::mcr3_update_sprites(screen_device &screen, bitmap_ind16 } -UINT32 spyhuntertec_state::screen_update_spyhuntertec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t spyhuntertec_state::screen_update_spyhuntertec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ @@ -418,7 +418,7 @@ READ8_MEMBER(spyhuntertec_state::spyhuntertec_in2_r) READ8_MEMBER(spyhuntertec_state::spyhuntertec_in3_r) { - UINT8 ret = ioport("IN3")->read(); + uint8_t ret = ioport("IN3")->read(); // printf("%04x spyhuntertec_in3_r\n", space.device().safe_pc()); return ret; } @@ -619,7 +619,7 @@ const gfx_layout spyhuntertec_sprite_layout = }; -static const UINT32 spyhuntp_charlayout_xoffset[64] = +static const uint32_t spyhuntp_charlayout_xoffset[64] = { 0x0000*8,0x0000*8, 0x0000*8+1,0x0000*8+1, 0x0000*8+2,0x0000*8+2, 0x0000*8+3,0x0000*8+3, 0x0000*8+4,0x0000*8+4, 0x0000*8+5,0x0000*8+5, 0x0000*8+6,0x0000*8+6, 0x0000*8+7,0x0000*8+7, 0x1000*8,0x1000*8, 0x1000*8+1,0x1000*8+1, 0x1000*8+2,0x1000*8+2, 0x1000*8+3,0x1000*8+3, 0x1000*8+4,0x1000*8+4, 0x1000*8+5,0x1000*8+5, 0x1000*8+6,0x1000*8+6, 0x1000*8+7,0x1000*8+7, diff --git a/src/mame/drivers/squale.cpp b/src/mame/drivers/squale.cpp index fa1cd13ee8e..9ca3a7215fe 100644 --- a/src/mame/drivers/squale.cpp +++ b/src/mame/drivers/squale.cpp @@ -118,13 +118,13 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT8 keyboard_line; - UINT8 fdc_sel0; - UINT8 fdc_sel1; + uint8_t keyboard_line; + uint8_t fdc_sel0; + uint8_t fdc_sel1; - UINT8 cart_addr_counter_inc_ck; - UINT8 cart_addr_counter_reset; - UINT16 cart_addr_counter; + uint8_t cart_addr_counter_inc_ck; + uint8_t cart_addr_counter_reset; + uint16_t cart_addr_counter; TIMER_DEVICE_CALLBACK_MEMBER(squale_scanline); @@ -161,7 +161,7 @@ WRITE8_MEMBER( squale_state::ctrl_w ) READ8_MEMBER( squale_state::video_ram_read_reg1 ) { - UINT8 data; + uint8_t data; int p; //D7 D0 @@ -196,7 +196,7 @@ READ8_MEMBER( squale_state::video_ram_read_reg1 ) READ8_MEMBER( squale_state::video_ram_read_reg2 ) { - UINT8 data; + uint8_t data; int p; //D7 D0 @@ -292,7 +292,7 @@ WRITE8_MEMBER( squale_state::fdc_sel1_w ) READ8_MEMBER( squale_state::fdc_sel0_r ) { - UINT8 data; + uint8_t data; data = fdc_sel0; @@ -305,7 +305,7 @@ READ8_MEMBER( squale_state::fdc_sel0_r ) READ8_MEMBER( squale_state::fdc_sel1_r ) { - UINT8 data; + uint8_t data; data = fdc_sel1; @@ -333,7 +333,7 @@ WRITE8_MEMBER( squale_state::pia_u75_porta_w ) READ8_MEMBER( squale_state::pia_u75_porta_r ) { // U75 PIA Port A : Keyboard rows output - UINT8 data; + uint8_t data; #ifdef DBGMODE printf("%s: read pia_u75_porta_r\n",machine().describe_context()); @@ -348,7 +348,7 @@ READ8_MEMBER( squale_state::pia_u75_portb_r ) // U75 PIA Port B : Keyboard column input char kbdrow[3]; unsigned char kbdrow_state; - UINT8 data = 0xFF; + uint8_t data = 0xFF; kbdrow[0] = 'X'; kbdrow[1] = '0'; @@ -404,7 +404,7 @@ READ8_MEMBER( squale_state::ay_portb_r ) // B1 : Joystick 2 - Left // B0 : Joystick 2 - Right - UINT8 data; + uint8_t data; data = ( ioport("ay_keys")->read() ) & 0x70; data |= ( ioport("ay_joy_2")->read() ) & 0x8F; @@ -428,7 +428,7 @@ READ8_MEMBER( squale_state::ay_porta_r ) // B1 : Joystick 1 - Left // B0 : Joystick 1 - Right - UINT8 data; + uint8_t data; #ifdef DBGMODE printf("%s: read ay_porta_r\n",machine().describe_context()); @@ -482,7 +482,7 @@ WRITE8_MEMBER( squale_state::ay_portb_w ) READ8_MEMBER( squale_state::pia_u72_porta_r ) { // U72 PIA Port A : Cartridge data bus - UINT8 data; + uint8_t data; #ifdef DBGMODE printf("%s: read pia_u72_porta_r\n",machine().describe_context()); @@ -559,7 +559,7 @@ READ8_MEMBER( squale_state::pia_u72_portb_r ) { // U72 PIA Port B : Printer data bus - UINT8 data = 0xFF; + uint8_t data = 0xFF; #ifdef DBGMODE printf("%s: read pia_u72_portb_r\n",machine().describe_context()); @@ -590,7 +590,7 @@ WRITE_LINE_MEMBER( squale_state::pia_u72_cb2_w ) DEVICE_IMAGE_LOAD_MEMBER( squale_state, squale_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if ( ! size || size > 0x10000) { @@ -606,7 +606,7 @@ DEVICE_IMAGE_LOAD_MEMBER( squale_state, squale_cart ) TIMER_DEVICE_CALLBACK_MEMBER( squale_state::squale_scanline ) { - m_ef9365->update_scanline((UINT16)param); + m_ef9365->update_scanline((uint16_t)param); } static ADDRESS_MAP_START(squale_mem, AS_PROGRAM, 8, squale_state) diff --git a/src/mame/drivers/srmp2.cpp b/src/mame/drivers/srmp2.cpp index 9b0c5bf1e62..dc6e15cada5 100644 --- a/src/mame/drivers/srmp2.cpp +++ b/src/mame/drivers/srmp2.cpp @@ -205,7 +205,7 @@ WRITE16_MEMBER(srmp2_state::srmp2_adpcm_code_w) table and plays the ADPCM for itself. */ - UINT8 *ROM = memregion("adpcm")->base(); + uint8_t *ROM = memregion("adpcm")->base(); m_adpcm_sptr = (ROM[((m_adpcm_bank * 0x10000) + (data << 2) + 0)] << 8); m_adpcm_eptr = (ROM[((m_adpcm_bank * 0x10000) + (data << 2) + 1)] << 8); @@ -228,7 +228,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_adpcm_code_w) table and plays the ADPCM for itself. */ - UINT8 *ROM = memregion("adpcm")->base(); + uint8_t *ROM = memregion("adpcm")->base(); m_adpcm_sptr = (ROM[((m_adpcm_bank * 0x10000) + (data << 2) + 0)] << 8); m_adpcm_eptr = (ROM[((m_adpcm_bank * 0x10000) + (data << 2) + 1)] << 8); @@ -244,7 +244,7 @@ WRITE8_MEMBER(srmp2_state::srmp3_adpcm_code_w) WRITE_LINE_MEMBER(srmp2_state::adpcm_int) { - UINT8 *ROM = memregion("adpcm")->base(); + uint8_t *ROM = memregion("adpcm")->base(); if (m_adpcm_sptr) { @@ -282,7 +282,7 @@ READ8_MEMBER(srmp2_state::vox_status_r) } -UINT8 srmp2_state::iox_key_matrix_calc(UINT8 p_side) +uint8_t srmp2_state::iox_key_matrix_calc(uint8_t p_side) { static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" }; int i, j, t; @@ -330,8 +330,8 @@ READ8_MEMBER(srmp2_state::iox_mux_r) /* both side checks */ if(m_iox.mux == 1) { - UINT8 p1_side = iox_key_matrix_calc(0); - UINT8 p2_side = iox_key_matrix_calc(4); + uint8_t p1_side = iox_key_matrix_calc(0); + uint8_t p2_side = iox_key_matrix_calc(4); if(p1_side != 0) return p1_side; diff --git a/src/mame/drivers/srmp5.cpp b/src/mame/drivers/srmp5.cpp index 4428d46f1a3..e9bb605cc9b 100644 --- a/src/mame/drivers/srmp5.cpp +++ b/src/mame/drivers/srmp5.cpp @@ -82,23 +82,23 @@ public: required_device m_maincpu; required_device m_subcpu; - required_region_ptr m_chrrom; + required_region_ptr m_chrrom; required_ioport_array<4> m_keys; - UINT32 m_chrbank; - std::unique_ptr m_tileram; - std::unique_ptr m_sprram; + uint32_t m_chrbank; + std::unique_ptr m_tileram; + std::unique_ptr m_sprram; - UINT8 m_input_select; + uint8_t m_input_select; - UINT8 m_cmd1; - UINT8 m_cmd2; - UINT8 m_cmd_stat; + uint8_t m_cmd1; + uint8_t m_cmd2; + uint8_t m_cmd_stat; - UINT32 m_vidregs[0x120 / 4]; + uint32_t m_vidregs[0x120 / 4]; #ifdef DEBUG_CHAR - UINT8 m_tileduty[0x2000]; + uint8_t m_tileduty[0x2000]; #endif DECLARE_WRITE32_MEMBER(bank_w); DECLARE_READ32_MEMBER(tileram_r); @@ -119,35 +119,35 @@ public: DECLARE_READ8_MEMBER(cmd_stat8_r); virtual void machine_start() override; DECLARE_DRIVER_INIT(srmp5); - UINT32 screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(st0016_rom_bank_w); }; -UINT32 srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,address,xs,xs2,ys,ys2,height,width,xw,yw,xb,yb,sizex,sizey; - UINT16 *sprite_list=m_sprram.get(); - UINT16 *sprite_list_end=&m_sprram[0x4000]; //guess - UINT8 *pixels=(UINT8 *)m_tileram.get(); + uint16_t *sprite_list=m_sprram.get(); + uint16_t *sprite_list_end=&m_sprram[0x4000]; //guess + uint8_t *pixels=(uint8_t *)m_tileram.get(); const pen_t * const pens = m_palette->pens(); //Table surface seems to be tiles, but display corrupts when switching the scene if always ON. //Currently the tiles are OFF. #ifdef BG_ENABLE - UINT8 tile_width = (m_vidregs[2] >> 0) & 0xFF; - UINT8 tile_height = (m_vidregs[2] >> 8) & 0xFF; + uint8_t tile_width = (m_vidregs[2] >> 0) & 0xFF; + uint8_t tile_height = (m_vidregs[2] >> 8) & 0xFF; if(tile_width && tile_height) { // 16x16 tile - UINT16 *map = &sprram[0x2000]; + uint16_t *map = &sprram[0x2000]; for(yw = 0; yw < tile_height; yw++) { for(xw = 0; xw < tile_width; xw++) { - UINT16 tile = map[yw * 128 + xw * 2]; + uint16_t tile = map[yw * 128 + xw * 2]; if(tile >= 0x2000) continue; address = tile * SPRITE_DATA_GRANULARITY; @@ -155,7 +155,7 @@ UINT32 srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bit { for(x = 0; x < 16; x++) { - UINT8 pen = pixels[BYTE_XOR_LE(address)]; + uint8_t pen = pixels[BYTE_XOR_LE(address)]; if(pen) { bitmap.pix32(yw * 16 + y, xw * 16 + x) = pens[pen]; @@ -172,18 +172,18 @@ UINT32 srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bit while((sprite_list[SUBLIST_OFFSET]&SPRITE_LIST_END_MARKER)==0 && sprite_list> 4)&0xf; height=(sprite_sublist[SPRITE_SIZE]>>12)&0xf; @@ -203,7 +203,7 @@ UINT32 srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bit ys2 = (sprite_sublist[SPRITE_PALETTE] & 0x4000) ? ys : (sizey - ys); for(xs=0;xs<=sizex;xs++) { - UINT8 pen=pixels[BYTE_XOR_LE(address)&(0x100000-1)]; + uint8_t pen=pixels[BYTE_XOR_LE(address)&(0x100000-1)]; xs2 = (sprite_sublist[SPRITE_PALETTE] & 0x8000) ? (sizex - xs) : xs; if(pen) { @@ -257,7 +257,7 @@ void srmp5_state::machine_start() WRITE32_MEMBER(srmp5_state::bank_w) { - m_chrbank = ((data & 0xf0) >> 4) * (0x100000 / sizeof(UINT16)); + m_chrbank = ((data & 0xf0) >> 4) * (0x100000 / sizeof(uint16_t)); } READ32_MEMBER(srmp5_state::tileram_r) @@ -295,7 +295,7 @@ WRITE32_MEMBER(srmp5_state::input_select_w) READ32_MEMBER(srmp5_state::srmp5_inputs_r) { - UINT32 ret = 0; + uint32_t ret = 0; switch (m_input_select) { @@ -612,8 +612,8 @@ DRIVER_INIT_MEMBER(srmp5_state,srmp5) { m_maincpu->set_st0016_game_flag(9); - m_tileram = std::make_unique(0x100000/2); - m_sprram = std::make_unique(0x080000/2); + m_tileram = std::make_unique(0x100000/2); + m_sprram = std::make_unique(0x080000/2); #ifdef DEBUG_CHAR memset(m_tileduty, 1, 0x2000); #endif diff --git a/src/mame/drivers/srmp6.cpp b/src/mame/drivers/srmp6.cpp index e09dfd951fe..901bc10c095 100644 --- a/src/mame/drivers/srmp6.cpp +++ b/src/mame/drivers/srmp6.cpp @@ -85,16 +85,16 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - std::unique_ptr m_tileram; - required_shared_ptr m_sprram; - required_shared_ptr m_chrram; - optional_shared_ptr m_dmaram; - required_shared_ptr m_video_regs; + std::unique_ptr m_tileram; + required_shared_ptr m_sprram; + required_shared_ptr m_chrram; + optional_shared_ptr m_dmaram; + required_shared_ptr m_video_regs; - std::unique_ptr m_sprram_old; + std::unique_ptr m_sprram_old; int m_brightness; - UINT16 m_input_select; + uint16_t m_input_select; unsigned short m_lastb; unsigned short m_lastb2; @@ -111,9 +111,9 @@ public: DECLARE_DRIVER_INIT(INIT); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void update_palette(); - UINT32 process(UINT8 b,UINT32 dst_offset); + uint32_t process(uint8_t b,uint32_t dst_offset); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -135,7 +135,7 @@ static const gfx_layout tiles8x8_layout = void srmp6_state::update_palette() { - INT8 r, g ,b; + int8_t r, g ,b; int brg = m_brightness - 0x60; int i; @@ -167,12 +167,12 @@ void srmp6_state::update_palette() void srmp6_state::video_start() { - m_tileram = make_unique_clear(0x100000*16/2); + m_tileram = make_unique_clear(0x100000*16/2); m_dmaram.allocate(0x100/2); - m_sprram_old = make_unique_clear(0x80000/2); + m_sprram_old = make_unique_clear(0x80000/2); /* create the char set (gfx will then be updated dynamically from RAM) */ - m_gfxdecode->set_gfx(0, std::make_unique(*m_palette, tiles8x8_layout, (UINT8*)m_tileram.get(), 0, m_palette->entries() / 256, 0)); + m_gfxdecode->set_gfx(0, std::make_unique(*m_palette, tiles8x8_layout, (uint8_t*)m_tileram.get(), 0, m_palette->entries() / 256, 0)); m_gfxdecode->gfx(0)->set_granularity(256); m_brightness = 0x60; @@ -182,17 +182,17 @@ void srmp6_state::video_start() static int xixi=0; #endif -UINT32 srmp6_state::screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t srmp6_state::screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int alpha; int x,y,tileno,height,width,xw,yw,sprite,xb,yb; - UINT16 *sprite_list = m_sprram_old.get(); - UINT16 mainlist_offset = 0; + uint16_t *sprite_list = m_sprram_old.get(); + uint16_t mainlist_offset = 0; union { - INT16 a; - UINT16 b; + int16_t a; + uint16_t b; } temp; bitmap.fill(0, cliprect); @@ -215,10 +215,10 @@ UINT32 srmp6_state::screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bit /* Main spritelist is 0x0000 - 0x1fff in spriteram, sublists follow */ while (mainlist_offset<0x2000/2) { - UINT16 *sprite_sublist = &m_sprram_old[sprite_list[mainlist_offset+1]<<3]; - UINT16 sublist_length=sprite_list[mainlist_offset+0]&0x7fff; //+1 ? - INT16 global_x,global_y, flip_x, flip_y; - UINT16 global_pal; + uint16_t *sprite_sublist = &m_sprram_old[sprite_list[mainlist_offset+1]<<3]; + uint16_t sublist_length=sprite_list[mainlist_offset+0]&0x7fff; //+1 ? + int16_t global_x,global_y, flip_x, flip_y; + uint16_t global_pal; /* end of list marker */ if (sprite_list[mainlist_offset+0] == 0x8000) @@ -382,11 +382,11 @@ READ16_MEMBER(srmp6_state::video_regs_r) /* DMA RLE stuff - the same as CPS3 */ -UINT32 srmp6_state::process(UINT8 b,UINT32 dst_offset) +uint32_t srmp6_state::process(uint8_t b,uint32_t dst_offset) { int l=0; - UINT8 *tram=(UINT8*)m_tileram.get(); + uint8_t *tram=(uint8_t*)m_tileram.get(); if (m_lastb == m_lastb2) //rle { @@ -419,15 +419,15 @@ UINT32 srmp6_state::process(UINT8 b,UINT32 dst_offset) WRITE16_MEMBER(srmp6_state::srmp6_dma_w) { - UINT16* dmaram = m_dmaram; + uint16_t* dmaram = m_dmaram; COMBINE_DATA(&dmaram[offset]); if (offset==13 && dmaram[offset]==0x40) { - const UINT8 *rom = memregion("nile")->base(); - UINT32 srctab=2*((((UINT32)dmaram[5])<<16)|dmaram[4]); - UINT32 srcdata=2*((((UINT32)dmaram[11])<<16)|dmaram[10]); - UINT32 len=4*(((((UINT32)dmaram[7]&3)<<16)|dmaram[6])+1); //??? WRONG! + const uint8_t *rom = memregion("nile")->base(); + uint32_t srctab=2*((((uint32_t)dmaram[5])<<16)|dmaram[4]); + uint32_t srcdata=2*((((uint32_t)dmaram[11])<<16)|dmaram[10]); + uint32_t len=4*(((((uint32_t)dmaram[7]&3)<<16)|dmaram[6])+1); //??? WRONG! int tempidx=0; /* show params */ @@ -455,16 +455,16 @@ WRITE16_MEMBER(srmp6_state::srmp6_dma_w) while(1) { int i; - UINT8 ctrl=rom[srcdata]; + uint8_t ctrl=rom[srcdata]; ++srcdata; for(i=0;i<8;++i) { - UINT8 p=rom[srcdata]; + uint8_t p=rom[srcdata]; if(ctrl&0x80) { - UINT8 real_byte; + uint8_t real_byte; real_byte = rom[srctab+p*2]; tempidx+=process(real_byte,tempidx); real_byte = rom[srctab+p*2+1];//px[DMA_XOR((current_table_address+p*2+1))]; @@ -497,7 +497,7 @@ READ16_MEMBER(srmp6_state::tileram_r) WRITE16_MEMBER(srmp6_state::tileram_w) { - //UINT16 tmp; + //uint16_t tmp; COMBINE_DATA(&m_chrram[offset]); /* are the DMA registers enabled some other way, or always mapped here, over RAM? */ @@ -510,7 +510,7 @@ WRITE16_MEMBER(srmp6_state::tileram_w) WRITE16_MEMBER(srmp6_state::paletteram_w) { - INT8 r, g, b; + int8_t r, g, b; int brg = m_brightness - 0x60; m_palette->write(space, offset, data, mem_mask); diff --git a/src/mame/drivers/srumbler.cpp b/src/mame/drivers/srumbler.cpp index 7db0953d14b..67f4ba16fea 100644 --- a/src/mame/drivers/srumbler.cpp +++ b/src/mame/drivers/srumbler.cpp @@ -30,8 +30,8 @@ WRITE8_MEMBER(srumbler_state::bankswitch_w) Note that 5000-8fff can be either ROM or RAM, so we should handle that as well to be 100% accurate. */ - UINT8 *prom1 = memregion("proms")->base() + (data & 0xf0); - UINT8 *prom2 = memregion("proms")->base() + 0x100 + ((data & 0x0f) << 4); + uint8_t *prom1 = memregion("proms")->base() + (data & 0xf0); + uint8_t *prom2 = memregion("proms")->base() + 0x100 + ((data & 0x0f) << 4); for (int i = 0x05;i < 0x10;i++) { diff --git a/src/mame/drivers/ssem.cpp b/src/mame/drivers/ssem.cpp index a36d8d09916..b108c9cfee3 100644 --- a/src/mame/drivers/ssem.cpp +++ b/src/mame/drivers/ssem.cpp @@ -24,21 +24,21 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_INPUT_CHANGED_MEMBER(panel_check); DECLARE_QUICKLOAD_LOAD_MEMBER(ssem_store); - inline UINT32 reverse(UINT32 v); + inline uint32_t reverse(uint32_t v); void strlower(char *buf); private: template - void glyph_print(bitmap_rgb32 &bitmap, INT32 x, INT32 y, Format &&fmt, Params &&...args); + void glyph_print(bitmap_rgb32 &bitmap, int32_t x, int32_t y, Format &&fmt, Params &&...args); required_device m_maincpu; - required_shared_ptr m_store; + required_shared_ptr m_store; required_device m_screen; - UINT8 m_store_line; + uint8_t m_store_line; util::ovectorstream m_glyph_print_buf; }; @@ -53,7 +53,7 @@ private: // The de facto snapshot format for other SSEM simulators stores the data physically in that format as well. // Therefore, in MESS, every 32-bit word has its bits reversed, too, and as a result the values must be // un-reversed before being used. -inline UINT32 ssem_state::reverse(UINT32 v) +inline uint32_t ssem_state::reverse(uint32_t v) { // Taken from http://www.graphics.stanford.edu/~seander/bithacks.html#ReverseParallel // swap odd and even bits @@ -102,11 +102,11 @@ enum INPUT_CHANGED_MEMBER(ssem_state::panel_check) { - UINT8 edit0_state = ioport("EDIT0")->read(); - UINT8 edit1_state = ioport("EDIT1")->read(); - UINT8 edit2_state = ioport("EDIT2")->read(); - UINT8 edit3_state = ioport("EDIT3")->read(); - UINT8 misc_state = ioport("MISC")->read(); + uint8_t edit0_state = ioport("EDIT0")->read(); + uint8_t edit1_state = ioport("EDIT1")->read(); + uint8_t edit2_state = ioport("EDIT2")->read(); + uint8_t edit3_state = ioport("EDIT3")->read(); + uint8_t misc_state = ioport("MISC")->read(); switch( (int)(uintptr_t)param ) { @@ -279,7 +279,7 @@ INPUT_PORTS_END * Video hardware * \****************************************************/ -static const UINT8 char_glyphs[0x80][8] = +static const uint8_t char_glyphs[0x80][8] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x10, 0x38, 0x10, 0x00, 0x00, 0x00 }, @@ -412,7 +412,7 @@ static const UINT8 char_glyphs[0x80][8] = }; template -void ssem_state::glyph_print(bitmap_rgb32 &bitmap, INT32 x, INT32 y, Format &&fmt, Params &&...args) +void ssem_state::glyph_print(bitmap_rgb32 &bitmap, int32_t x, int32_t y, Format &&fmt, Params &&...args) { const rectangle &visarea = m_screen->visible_area(); @@ -423,14 +423,14 @@ void ssem_state::glyph_print(bitmap_rgb32 &bitmap, INT32 x, INT32 y, Format &&fm for(char const *buf = &m_glyph_print_buf.vec()[0]; *buf; buf++) { - UINT8 cur = UINT8(*buf); + uint8_t cur = uint8_t(*buf); if(cur < 0x80) { - INT32 line = 0; + int32_t line = 0; for(line = 0; line < 8; line++) { - UINT32 *d = &bitmap.pix32(y + line); - INT32 bit = 0; + uint32_t *d = &bitmap.pix32(y + line); + int32_t bit = 0; for(bit = 0; bit < 8; bit++) { if(char_glyphs[cur][line] & (1 << (7 - bit))) @@ -458,12 +458,12 @@ void ssem_state::glyph_print(bitmap_rgb32 &bitmap, INT32 x, INT32 y, Format &&fm } } -UINT32 ssem_state::screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t ssem_state::screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 line = 0; - UINT32 accum = m_maincpu->state_int(SSEM_A); - UINT32 bit = 0; - UINT32 word = 0; + uint32_t line = 0; + uint32_t accum = m_maincpu->state_int(SSEM_A); + uint32_t bit = 0; + uint32_t word = 0; for(line = 0; line < 32; line++) { @@ -541,7 +541,7 @@ QUICKLOAD_LOAD_MEMBER(ssem_state, ssem_store) { for (int i = 0; i < num_lines; i++) { - UINT32 line = 0; + uint32_t line = 0; image.fgets(image_line, 99); // Isolate and convert 4-digit decimal address @@ -551,7 +551,7 @@ QUICKLOAD_LOAD_MEMBER(ssem_state, ssem_store) if (image.is_filetype("snp")) { - UINT32 word = 0; + uint32_t word = 0; // Parse a line such as: 0000:00000110101001000100000100000100 for (int b = 0; b < 32; b++) @@ -568,9 +568,9 @@ QUICKLOAD_LOAD_MEMBER(ssem_state, ssem_store) else if (image.is_filetype("asm")) { char op_buf[4] = { 0 }; - INT32 value = 0; - UINT32 unsigned_value = 0; - UINT32 word = 0; + int32_t value = 0; + uint32_t unsigned_value = 0; + uint32_t word = 0; // Isolate the opcode and convert to lower-case memcpy(op_buf, image_line + 5, 3); @@ -579,7 +579,7 @@ QUICKLOAD_LOAD_MEMBER(ssem_state, ssem_store) // Isolate the value sscanf(image_line + 9, "%d", &value); - unsigned_value = reverse((UINT32)value); + unsigned_value = reverse((uint32_t)value); if (!core_stricmp(op_buf, "num")) word = unsigned_value; diff --git a/src/mame/drivers/ssfindo.cpp b/src/mame/drivers/ssfindo.cpp index 9d902c43185..2a94dfef114 100644 --- a/src/mame/drivers/ssfindo.cpp +++ b/src/mame/drivers/ssfindo.cpp @@ -228,27 +228,27 @@ public: required_device m_maincpu; required_device m_palette; - required_shared_ptr m_vram; + required_shared_ptr m_vram; - required_region_ptr m_flashrom; + required_region_ptr m_flashrom; required_ioport m_io_ps7500; // driver init configuration - UINT32 m_flashType; + uint32_t m_flashType; int m_iocr_hack; // common - UINT32 m_PS7500_IO[MAXIO]; - UINT32 m_PS7500_FIFO[256]; + uint32_t m_PS7500_IO[MAXIO]; + uint32_t m_PS7500_FIFO[256]; emu_timer *m_PS7500timer0; emu_timer *m_PS7500timer1; // ssfindo and ppcar - UINT32 m_flashAdr; - UINT32 m_flashOffset; - UINT32 m_adrLatch; - UINT32 m_flashN; + uint32_t m_flashAdr; + uint32_t m_flashOffset; + uint32_t m_adrLatch; + uint32_t m_flashN; // common DECLARE_WRITE32_MEMBER(FIFO_w); @@ -277,7 +277,7 @@ public: DECLARE_DRIVER_INIT(tetfight); virtual void machine_reset() override; - 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); INTERRUPT_GEN_MEMBER(interrupt); TIMER_CALLBACK_MEMBER(PS7500_Timer0_callback); @@ -294,7 +294,7 @@ public: }; -UINT32 ssfindo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ssfindo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int s,x,y; @@ -456,7 +456,7 @@ READ32_MEMBER(ssfindo_state::PS7500_IO_r) WRITE32_MEMBER(ssfindo_state::PS7500_IO_w) { - UINT32 temp=m_PS7500_IO[offset]; + uint32_t temp=m_PS7500_IO[offset]; COMBINE_DATA(&temp); @@ -547,7 +547,7 @@ READ32_MEMBER(ssfindo_state::io_r) WRITE32_MEMBER(ssfindo_state::io_w) { - UINT32 temp = 0; + uint32_t temp = 0; COMBINE_DATA(&temp); #if 0 diff --git a/src/mame/drivers/sshangha.cpp b/src/mame/drivers/sshangha.cpp index 5af87ac15bd..c17263953fc 100644 --- a/src/mame/drivers/sshangha.cpp +++ b/src/mame/drivers/sshangha.cpp @@ -92,7 +92,7 @@ void sshangha_state::machine_reset() /******************************************************************************/ -inline void sshangha_state::sshangha_set_color_888(pen_t color, int rshift, int gshift, int bshift, UINT32 data) +inline void sshangha_state::sshangha_set_color_888(pen_t color, int rshift, int gshift, int bshift, uint32_t data) { m_palette->set_pen_color(color, (data >> rshift) & 0xff, (data >> gshift) & 0xff, (data >> bshift) & 0xff); } @@ -133,8 +133,8 @@ READ16_MEMBER( sshangha_state::sshangha_protection_region_d_146_r ) { int real_address = 0x3f4000 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -142,7 +142,7 @@ WRITE16_MEMBER( sshangha_state::sshangha_protection_region_d_146_w ) { int real_address = 0x3f4000 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -150,8 +150,8 @@ READ16_MEMBER( sshangha_state::sshangha_protection_region_8_146_r ) { int real_address = 0x3e0000 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; - UINT16 data = m_deco146->read_data( deco146_addr, mem_mask, cs ); + uint8_t cs = 0; + uint16_t data = m_deco146->read_data( deco146_addr, mem_mask, cs ); return data; } @@ -159,7 +159,7 @@ WRITE16_MEMBER( sshangha_state::sshangha_protection_region_8_146_w ) { int real_address = 0x3e0000 + (offset *2); int deco146_addr = BITSWAP32(real_address, /* NC */31,30,29,28,27,26,25,24,23,22,21,20,19,18, 13,12,11,/**/ 17,16,15,14, 10,9,8, 7,6,5,4, 3,2,1,0) & 0x7fff; - UINT8 cs = 0; + uint8_t cs = 0; m_deco146->write_data( space, deco146_addr, data, mem_mask, cs ); } @@ -489,7 +489,7 @@ DRIVER_INIT_MEMBER(sshangha_state,sshangha) #if SSHANGHA_HACK /* This is a hack to allow you to use the extra features of the first "Unused" Dip Switch (see notes above). */ - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); RAM[0x000384/2] = 0x4e71; RAM[0x000386/2] = 0x4e71; RAM[0x000388/2] = 0x4e71; diff --git a/src/mame/drivers/sshot.cpp b/src/mame/drivers/sshot.cpp index 67132d5215e..7eb2c4eba6e 100644 --- a/src/mame/drivers/sshot.cpp +++ b/src/mame/drivers/sshot.cpp @@ -177,14 +177,14 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_tilemap; DECLARE_WRITE8_MEMBER(supershot_vidram_w); DECLARE_WRITE8_MEMBER(supershot_output0_w); DECLARE_WRITE8_MEMBER(supershot_output1_w); TILE_GET_INFO_MEMBER(get_supershot_text_tile_info); virtual void video_start() override; - UINT32 screen_update_supershot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_supershot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -198,7 +198,7 @@ public: TILE_GET_INFO_MEMBER(supershot_state::get_supershot_text_tile_info) { - UINT8 code = m_videoram[tile_index]; + uint8_t code = m_videoram[tile_index]; SET_TILE_INFO_MEMBER(0, code, 0, 0); } @@ -207,7 +207,7 @@ void supershot_state::video_start() m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(supershot_state::get_supershot_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 supershot_state::screen_update_supershot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t supershot_state::screen_update_supershot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/ssingles.cpp b/src/mame/drivers/ssingles.cpp index b1906e966bf..7185169f784 100644 --- a/src/mame/drivers/ssingles.cpp +++ b/src/mame/drivers/ssingles.cpp @@ -161,12 +161,12 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - UINT8 m_videoram[VMEM_SIZE]; - UINT8 m_colorram[VMEM_SIZE]; - UINT8 m_prot_data; + uint8_t m_videoram[VMEM_SIZE]; + uint8_t m_colorram[VMEM_SIZE]; + uint8_t m_prot_data; pen_t m_pens[NUM_PENS]; - UINT8 m_atamanot_prot_state; + uint8_t m_atamanot_prot_state; DECLARE_WRITE8_MEMBER(ssingles_videoram_w); DECLARE_WRITE8_MEMBER(ssingles_colorram_w); DECLARE_READ8_MEMBER(c000_r); @@ -184,7 +184,7 @@ public: }; //fake palette -static const UINT8 ssingles_colors[NUM_PENS*3]= +static const uint8_t ssingles_colors[NUM_PENS*3]= { 0x00,0x00,0x00, 0xff,0xff,0xff, 0xff,0x00,0x00, 0x80,0x00,0x00, 0x00,0x00,0x00, 0xf0,0xf0,0xf0, 0xff,0xff,0x00, 0x40,0x40,0x40, @@ -198,10 +198,10 @@ static const UINT8 ssingles_colors[NUM_PENS*3]= MC6845_UPDATE_ROW( ssingles_state::ssingles_update_row ) { - UINT32 tile_address; - UINT16 cell, palette; - UINT8 b0, b1; - const UINT8 *gfx = memregion("gfx1")->base(); + uint32_t tile_address; + uint16_t cell, palette; + uint8_t b0, b1; + const uint8_t *gfx = memregion("gfx1")->base(); for (int cx = 0; cx < x_count; ++cx) { @@ -234,10 +234,10 @@ MC6845_UPDATE_ROW( ssingles_state::ssingles_update_row ) MC6845_UPDATE_ROW( ssingles_state::atamanot_update_row ) { - UINT32 tile_address; - UINT16 cell, palette; - UINT8 b0, b1; - const UINT8 *gfx = memregion("gfx1")->base(); + uint32_t tile_address; + uint16_t cell, palette; + uint8_t b0, b1; + const uint8_t *gfx = memregion("gfx1")->base(); for (int cx = 0; cx < x_count; ++cx) { @@ -271,14 +271,14 @@ MC6845_UPDATE_ROW( ssingles_state::atamanot_update_row ) WRITE8_MEMBER(ssingles_state::ssingles_videoram_w) { - UINT8 *vram = memregion("vram")->base(); + uint8_t *vram = memregion("vram")->base(); vram[offset] = data; m_videoram[offset]=data; } WRITE8_MEMBER(ssingles_state::ssingles_colorram_w) { - UINT8 *cram = memregion("cram")->base(); + uint8_t *cram = memregion("cram")->base(); cram[offset] = data; m_colorram[offset]=data; } diff --git a/src/mame/drivers/sslam.cpp b/src/mame/drivers/sslam.cpp index 0a088944b43..2c7cd1ff4c8 100644 --- a/src/mame/drivers/sslam.cpp +++ b/src/mame/drivers/sslam.cpp @@ -102,7 +102,7 @@ Notes: The sequencing of the music tracks are handled in the second table below. */ -static const UINT8 sslam_snd_cmd[64] = +static const uint8_t sslam_snd_cmd[64] = { /*00*/ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /*08*/ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x70, 0x71, @@ -125,7 +125,7 @@ static const UINT8 sslam_snd_cmd[64] = If the last byte is 0xff, the track should loop by restarting at the first column sample */ -static const UINT8 sslam_snd_loop[8][19] = +static const uint8_t sslam_snd_loop[8][19] = { /*NA*/ { 0x00, 0x00 }, /* Not a loop - just a parking position for stopping track playback */ /*60*/ { 0x60, 0x60, 0x61, 0x61, 0x60, 0x60, 0x61, 0x62, 0xff }, @@ -420,7 +420,7 @@ ADDRESS_MAP_END READ8_MEMBER(sslam_state::playmark_snd_command_r) { - UINT8 data = 0; + uint8_t data = 0; if ((m_oki_control & 0x38) == 0x30) { data = m_soundlatch->read(space,0); diff --git a/src/mame/drivers/sspeedr.cpp b/src/mame/drivers/sspeedr.cpp index c4aa2e021cb..204e9f66eb7 100644 --- a/src/mame/drivers/sspeedr.cpp +++ b/src/mame/drivers/sspeedr.cpp @@ -51,7 +51,7 @@ WRITE8_MEMBER(sspeedr_state::sspeedr_lamp_w) /* uses a 7447A, which is equivalent to an LS47/48 */ -static const UINT8 ls48_map[16] = +static const uint8_t ls48_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; WRITE8_MEMBER(sspeedr_state::sspeedr_time_w) diff --git a/src/mame/drivers/ssrj.cpp b/src/mame/drivers/ssrj.cpp index 202ce3aaddc..8857342d8e3 100644 --- a/src/mame/drivers/ssrj.cpp +++ b/src/mame/drivers/ssrj.cpp @@ -43,7 +43,7 @@ void ssrj_state::machine_start() void ssrj_state::machine_reset() { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); memset(&rom[0xc000], 0 ,0x3fff); /* req for some control types */ m_oldport = 0x80; diff --git a/src/mame/drivers/sstrangr.cpp b/src/mame/drivers/sstrangr.cpp index c0d114c0abf..a6161fd3baf 100644 --- a/src/mame/drivers/sstrangr.cpp +++ b/src/mame/drivers/sstrangr.cpp @@ -24,16 +24,16 @@ public: required_device m_maincpu; optional_device m_palette; - required_shared_ptr m_ram; + required_shared_ptr m_ram; - UINT8 m_flip_screen; + uint8_t m_flip_screen; DECLARE_WRITE8_MEMBER(port_w); virtual void video_start() override; - UINT32 screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sstrngr2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sstrngr2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -49,7 +49,7 @@ void sstrangr_state::video_start() save_item(NAME(m_flip_screen)); } -UINT32 sstrangr_state::screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sstrangr_state::screen_update_sstrangr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -57,9 +57,9 @@ UINT32 sstrangr_state::screen_update_sstrangr(screen_device &screen, bitmap_rgb3 { int i; - UINT8 x = offs << 3; + uint8_t x = offs << 3; int y = offs >> 5; - UINT8 data = m_ram[offs]; + uint8_t data = m_ram[offs]; for (i = 0; i < 8; i++) { @@ -85,23 +85,23 @@ UINT32 sstrangr_state::screen_update_sstrangr(screen_device &screen, bitmap_rgb3 return 0; } -UINT32 sstrangr_state::screen_update_sstrngr2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sstrangr_state::screen_update_sstrngr2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 *color_map_base = &memregion("proms")->base()[m_flip_screen ? 0x0000 : 0x0200]; + uint8_t *color_map_base = &memregion("proms")->base()[m_flip_screen ? 0x0000 : 0x0200]; for (offs_t offs = 0; offs < 0x2000; offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; offs_t color_address = (offs >> 9 << 5) | (offs & 0x1f); - UINT8 data = m_ram[offs]; - UINT8 fore_color = color_map_base[color_address] & 0x07; + uint8_t data = m_ram[offs]; + uint8_t fore_color = color_map_base[color_address] & 0x07; for (int i = 0; i < 8; i++) { - UINT8 color; + uint8_t color; if (m_flip_screen) { diff --git a/src/mame/drivers/ssv.cpp b/src/mame/drivers/ssv.cpp index 4a0f2ee0caa..b58cede8b8d 100644 --- a/src/mame/drivers/ssv.cpp +++ b/src/mame/drivers/ssv.cpp @@ -189,7 +189,7 @@ IRQ_CALLBACK_MEMBER(ssv_state::irq_callback) { if (m_requested_int & (1 << i)) { - UINT16 vector = m_irq_vectors[i * (16/2)] & 7; + uint16_t vector = m_irq_vectors[i * (16/2)] & 7; return vector; } } @@ -349,8 +349,8 @@ WRITE16_MEMBER(ssv_state::dsp_dr_w) READ16_MEMBER(ssv_state::dsp_r) { - UINT16 temp = m_dsp->dataram_r(offset/2); - UINT16 res; + uint16_t temp = m_dsp->dataram_r(offset/2); + uint16_t res; if (offset & 1) { @@ -366,7 +366,7 @@ READ16_MEMBER(ssv_state::dsp_r) WRITE16_MEMBER(ssv_state::dsp_w) { - UINT16 temp = m_dsp->dataram_r(offset/2); + uint16_t temp = m_dsp->dataram_r(offset/2); if (offset & 1) { @@ -502,7 +502,7 @@ ADDRESS_MAP_END READ16_MEMBER(ssv_state::hypreact_input_r) { - UINT16 input_sel = *m_input_sel; + uint16_t input_sel = *m_input_sel; if (input_sel & 0x0001) return m_io_key0->read(); if (input_sel & 0x0002) return m_io_key1->read(); @@ -625,7 +625,7 @@ ADDRESS_MAP_END READ16_MEMBER(ssv_state::srmp4_input_r) { - UINT16 input_sel = *m_input_sel; + uint16_t input_sel = *m_input_sel; if (input_sel & 0x0002) return m_io_key0->read(); if (input_sel & 0x0004) return m_io_key1->read(); @@ -662,7 +662,7 @@ WRITE16_MEMBER(ssv_state::srmp7_sound_bank_w) { if (ACCESSING_BITS_0_7) { - int bank = 0x400000/2 * (data & 1); // UINT16 address + int bank = 0x400000/2 * (data & 1); // uint16_t address int voice; for (voice = 0; voice < 32; voice++) m_ensoniq->voice_bank_w(voice, bank); @@ -672,7 +672,7 @@ WRITE16_MEMBER(ssv_state::srmp7_sound_bank_w) READ16_MEMBER(ssv_state::srmp7_input_r) { - UINT16 input_sel = *m_input_sel; + uint16_t input_sel = *m_input_sel; if (input_sel & 0x0002) return m_io_key0->read(); if (input_sel & 0x0004) return m_io_key1->read(); @@ -2511,9 +2511,9 @@ void ssv_state::init_eaglshot_banking() // massages the data from the BPMicro-compatible dump to runnable form void ssv_state::init_st010() { - UINT8 *dspsrc = (UINT8 *)memregion("st010")->base(); - UINT32 *dspprg = (UINT32 *)memregion("dspprg")->base(); - UINT16 *dspdata = (UINT16 *)memregion("dspdata")->base(); + uint8_t *dspsrc = (uint8_t *)memregion("st010")->base(); + uint32_t *dspprg = (uint32_t *)memregion("dspprg")->base(); + uint16_t *dspdata = (uint16_t *)memregion("dspdata")->base(); // copy DSP program for (int i = 0; i < 0x10000; i+= 4) @@ -2540,7 +2540,7 @@ DRIVER_INIT_MEMBER(ssv_state,meosism) { init(0); } DRIVER_INIT_MEMBER(ssv_state,mslider) { init(0); } DRIVER_INIT_MEMBER(ssv_state,ryorioh) { init(0); } DRIVER_INIT_MEMBER(ssv_state,srmp4) { init(0); -// ((UINT16 *)memregion("maincpu")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */ +// ((uint16_t *)memregion("maincpu")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */ } DRIVER_INIT_MEMBER(ssv_state,srmp7) { init(0); } DRIVER_INIT_MEMBER(ssv_state,stmblade) { init(0); init_st010(); } diff --git a/src/mame/drivers/ssystem3.cpp b/src/mame/drivers/ssystem3.cpp index 96a26c41cce..9779cfb1fce 100644 --- a/src/mame/drivers/ssystem3.cpp +++ b/src/mame/drivers/ssystem3.cpp @@ -121,7 +121,7 @@ WRITE8_MEMBER(ssystem3_state::ssystem3_via_write_a) READ8_MEMBER(ssystem3_state::ssystem3_via_read_a) { - UINT8 data=0xff; + uint8_t data=0xff; #if 1 // time switch if (!(m_porta&0x10)) data&=m_matrix[0]->read()|0xf1; if (!(m_porta&0x20)) data&=m_matrix[1]->read()|0xf1; @@ -185,7 +185,7 @@ READ8_MEMBER(ssystem3_state::ssystem3_via_read_a) */ READ8_MEMBER(ssystem3_state::ssystem3_via_read_b) { - UINT8 data=0xff; + uint8_t data=0xff; int on, ready; ssystem3_playfield_read(&on, &ready); if (!on) data&=~0x20; @@ -199,7 +199,7 @@ WRITE8_MEMBER(ssystem3_state::ssystem3_via_write_b) ssystem3_lcd_write(data & 4, data & 2); // TODO: figure out what this is trying to achieve - UINT8 d = ssystem3_via_read_b(space, 0, mem_mask) & ~0x40; + uint8_t d = ssystem3_via_read_b(space, 0, mem_mask) & ~0x40; if (data & 0x80) d |= 0x40; // d&=~0x8f; m_via6522_0->write_pb0((d >> 0) & 1); diff --git a/src/mame/drivers/st17xx.cpp b/src/mame/drivers/st17xx.cpp index f3ba9428aea..57892ae33ad 100644 --- a/src/mame/drivers/st17xx.cpp +++ b/src/mame/drivers/st17xx.cpp @@ -51,7 +51,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; /* Memory Maps */ @@ -71,7 +71,7 @@ void st17xx_state::video_start() { } -UINT32 st17xx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t st17xx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/st_mp100.cpp b/src/mame/drivers/st_mp100.cpp index d58d5bf4a86..df8da4447e4 100644 --- a/src/mame/drivers/st_mp100.cpp +++ b/src/mame/drivers/st_mp100.cpp @@ -57,18 +57,18 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_x); TIMER_DEVICE_CALLBACK_MEMBER(u11_timer); private: - UINT8 m_u10a; - UINT8 m_u10b; - UINT8 m_u11a; - UINT8 m_u11b; + uint8_t m_u10a; + uint8_t m_u10b; + uint8_t m_u11a; + uint8_t m_u11b; bool m_u10_ca2; bool m_u10_cb2; bool m_u11_cb2; bool m_timer_x; bool m_u11_timer; - UINT8 m_digit; - UINT8 m_counter; - UINT8 m_segment[5]; + uint8_t m_digit; + uint8_t m_counter; + uint8_t m_segment[5]; virtual void machine_reset() override; required_device m_maincpu; required_device m_pia_u10; @@ -547,7 +547,7 @@ WRITE8_MEMBER( st_mp100_state::u10_a_w ) READ8_MEMBER( st_mp100_state::u10_b_r ) { - UINT8 data = 0; + uint8_t data = 0; if (BIT(m_u10a, 0)) data |= m_io_x0->read(); @@ -610,7 +610,7 @@ WRITE8_MEMBER( st_mp100_state::u11_a_w ) if (BIT(data, 0) && (m_counter > 8)) { - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 output().set_digit_value(m_digit, patterns[m_segment[0]]); output().set_digit_value(10+m_digit, patterns[m_segment[1]]); output().set_digit_value(20+m_digit, patterns[m_segment[2]]); diff --git a/src/mame/drivers/st_mp200.cpp b/src/mame/drivers/st_mp200.cpp index 0410ad8b82c..7d286d4b755 100644 --- a/src/mame/drivers/st_mp200.cpp +++ b/src/mame/drivers/st_mp200.cpp @@ -64,19 +64,19 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(timer_x); TIMER_DEVICE_CALLBACK_MEMBER(u11_timer); private: - UINT8 m_u10a; - UINT8 m_u10b; - UINT8 m_u11a; - UINT8 m_u11b; + uint8_t m_u10a; + uint8_t m_u10b; + uint8_t m_u11a; + uint8_t m_u11b; bool m_u10_ca2; bool m_u10_cb2; bool m_u11_cb2; bool m_timer_x; bool m_u11_timer; bool m_7d; // 7-digit display yes/no - UINT8 m_digit; - UINT8 m_counter; - UINT8 m_segment[5]; + uint8_t m_digit; + uint8_t m_counter; + uint8_t m_segment[5]; virtual void machine_start() override; virtual void machine_reset() override; required_device m_maincpu; @@ -346,7 +346,7 @@ WRITE_LINE_MEMBER( st_mp200_state::u11_ca2_w ) m_s14001a->force_update(); m_s14001a->set_output_gain(0, ((m_u10a >> 3 & 0xf) + 1) / 16.0); - UINT8 clock_divisor = 16 - (m_u10a & 0x07); + uint8_t clock_divisor = 16 - (m_u10a & 0x07); m_s14001a->set_clock(S14001_CLOCK / clock_divisor / 8); } @@ -390,7 +390,7 @@ WRITE8_MEMBER( st_mp200_state::u10_a_w ) READ8_MEMBER( st_mp200_state::u10_b_r ) { - UINT8 data = 0; + uint8_t data = 0; if (BIT(m_u10a, 0)) data |= m_io_x0->read(); @@ -455,7 +455,7 @@ WRITE8_MEMBER( st_mp200_state::u11_a_w ) if (BIT(data, 0) && (m_counter > 8)) { - static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 + static const uint8_t patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 output().set_digit_value(m_digit, patterns[m_segment[0]]); output().set_digit_value(10+m_digit, patterns[m_segment[1]]); output().set_digit_value(20+m_digit, patterns[m_segment[2]]); diff --git a/src/mame/drivers/starfire.cpp b/src/mame/drivers/starfire.cpp index 94a36925297..70bdce04ba0 100644 --- a/src/mame/drivers/starfire.cpp +++ b/src/mame/drivers/starfire.cpp @@ -100,7 +100,7 @@ READ8_MEMBER(starfire_state::starfire_scratch_r) WRITE8_MEMBER(starfire_state::starfire_sound_w) { // starfire sound samples (preliminary) - UINT8 rise = data & ~m_prev_sound; + uint8_t rise = data & ~m_prev_sound; m_prev_sound = data; // d0: rumble @@ -141,9 +141,9 @@ READ8_MEMBER(starfire_state::starfire_input_r) { // d3 and d4 come from the audio circuit, how does it work exactly? // tie_on sounds ok, but laser_on sounds buggy - UINT8 tie_on = m_samples->playing(2) ? 0x00 : 0x08; - UINT8 laser_on = m_samples->playing(3) ? 0x00 : 0x10; - UINT8 input = ioport("SYSTEM")->read() & 0xe7; + uint8_t tie_on = m_samples->playing(2) ? 0x00 : 0x08; + uint8_t laser_on = m_samples->playing(3) ? 0x00 : 0x10; + uint8_t input = ioport("SYSTEM")->read() & 0xe7; return input | tie_on | laser_on | 0x10; // disable laser_on for now } case 5: return ioport("STICKZ")->read(); @@ -155,7 +155,7 @@ READ8_MEMBER(starfire_state::starfire_input_r) READ8_MEMBER(starfire_state::fireone_input_r) { - static const UINT8 fireone_paddle_map[64] = + static const uint8_t fireone_paddle_map[64] = { 0x00,0x01,0x03,0x02,0x06,0x07,0x05,0x04, 0x0c,0x0d,0x0f,0x0e,0x0a,0x0b,0x09,0x08, @@ -173,7 +173,7 @@ READ8_MEMBER(starfire_state::fireone_input_r) case 1: return ioport("SYSTEM")->read(); case 2: { - UINT8 input = m_fireone_select ? ioport("P1")->read() : ioport("P2")->read(); + uint8_t input = m_fireone_select ? ioport("P1")->read() : ioport("P2")->read(); return (input & 0xc0) | fireone_paddle_map[input & 0x3f]; } default: return 0xff; diff --git a/src/mame/drivers/starshp1.cpp b/src/mame/drivers/starshp1.cpp index 021d2ac36b3..c98d491a4e8 100644 --- a/src/mame/drivers/starshp1.cpp +++ b/src/mame/drivers/starshp1.cpp @@ -260,7 +260,7 @@ static const gfx_layout spritelayout = 0x100 /* step */ }; -static const UINT32 shiplayout_xoffset[64] = +static const uint32_t shiplayout_xoffset[64] = { 0x04, 0x05, 0x06, 0x07, 0x0c, 0x0d, 0x0e, 0x0f, 0x14, 0x15, 0x16, 0x17, 0x1c, 0x1d, 0x1e, 0x1f, diff --git a/src/mame/drivers/starwars.cpp b/src/mame/drivers/starwars.cpp index 536c138c0c4..d3efae464cc 100644 --- a/src/mame/drivers/starwars.cpp +++ b/src/mame/drivers/starwars.cpp @@ -529,7 +529,7 @@ DRIVER_INIT_MEMBER(starwars_state,starwars) DRIVER_INIT_MEMBER(starwars_state,esb) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* init the slapstic */ m_slapstic_device->slapstic_init(); diff --git a/src/mame/drivers/statriv2.cpp b/src/mame/drivers/statriv2.cpp index 0598f1abf34..be0e0766668 100644 --- a/src/mame/drivers/statriv2.cpp +++ b/src/mame/drivers/statriv2.cpp @@ -93,16 +93,16 @@ public: required_device m_maincpu; required_device m_tms; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_tilemap; - required_shared_ptr m_question_offset; + required_shared_ptr m_question_offset; required_device m_gfxdecode; required_device m_palette; - UINT8 m_question_offset_low; - UINT8 m_question_offset_mid; - UINT8 m_question_offset_high; - UINT8 m_latched_coin; - UINT8 m_last_coin; + uint8_t m_question_offset_low; + uint8_t m_question_offset_mid; + uint8_t m_question_offset_high; + uint8_t m_latched_coin; + uint8_t m_last_coin; DECLARE_WRITE8_MEMBER(statriv2_videoram_w); DECLARE_READ8_MEMBER(question_data_r); DECLARE_READ8_MEMBER(laserdisc_io_r); @@ -120,7 +120,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(statriv2); DECLARE_VIDEO_START(vertical); - UINT32 screen_update_statriv2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_statriv2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(statriv2_interrupt); }; @@ -136,7 +136,7 @@ public: TILE_GET_INFO_MEMBER(statriv2_state::horizontal_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int code = videoram[0x400+tile_index]; int attr = videoram[tile_index] & 0x3f; @@ -145,7 +145,7 @@ TILE_GET_INFO_MEMBER(statriv2_state::horizontal_tile_info) TILE_GET_INFO_MEMBER(statriv2_state::vertical_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int code = videoram[0x400+tile_index]; int attr = videoram[tile_index] & 0x3f; @@ -191,7 +191,7 @@ VIDEO_START_MEMBER(statriv2_state,vertical) WRITE8_MEMBER(statriv2_state::statriv2_videoram_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; videoram[offset] = data; m_tilemap->mark_tile_dirty(offset & 0x3ff); } @@ -204,7 +204,7 @@ WRITE8_MEMBER(statriv2_state::statriv2_videoram_w) * *************************************/ -UINT32 statriv2_state::screen_update_statriv2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t statriv2_state::screen_update_statriv2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_tms->screen_reset()) bitmap.fill(m_palette->black_pen(), cliprect); @@ -223,7 +223,7 @@ UINT32 statriv2_state::screen_update_statriv2(screen_device &screen, bitmap_ind1 INTERRUPT_GEN_MEMBER(statriv2_state::statriv2_interrupt) { - UINT8 new_coin = ioport("COIN")->read(); + uint8_t new_coin = ioport("COIN")->read(); /* check the coin inputs once per frame */ m_latched_coin |= new_coin & (new_coin ^ m_last_coin); @@ -243,9 +243,9 @@ INTERRUPT_GEN_MEMBER(statriv2_state::statriv2_interrupt) READ8_MEMBER(statriv2_state::question_data_r) { - const UINT8 *qrom = memregion("questions")->base(); - UINT32 qromsize = memregion("questions")->bytes(); - UINT32 address; + const uint8_t *qrom = memregion("questions")->base(); + uint32_t qromsize = memregion("questions")->bytes(); + uint32_t address; if (m_question_offset_high == 0xff) m_question_offset[m_question_offset_low]++; @@ -1131,9 +1131,9 @@ DRIVER_INIT_MEMBER(statriv2_state,addr_lmhe) * * \***************************************************/ - UINT8 *qrom = memregion("questions")->base(); - UINT32 length = memregion("questions")->bytes(); - UINT32 address; + uint8_t *qrom = memregion("questions")->base(); + uint32_t length = memregion("questions")->bytes(); + uint32_t address; for (address = 0; address < length; address++) qrom[address] ^= BITSWAP8(address, 4,3,3,2,2,1,1,0); @@ -1144,7 +1144,7 @@ DRIVER_INIT_MEMBER(statriv2_state,addr_lmhe) READ8_MEMBER(statriv2_state::laserdisc_io_r) { - UINT8 result = 0x00; + uint8_t result = 0x00; if (offset == 1) result = 0x18; osd_printf_debug("%s:ld read ($%02X) = %02X\n", machine().describe_context(), 0x28 + offset, result); diff --git a/src/mame/drivers/stratos.cpp b/src/mame/drivers/stratos.cpp index 62de51b640c..16a18ecdd2c 100644 --- a/src/mame/drivers/stratos.cpp +++ b/src/mame/drivers/stratos.cpp @@ -28,10 +28,10 @@ public: required_memory_bank bank_4000; required_memory_bank nvram_bank; - std::unique_ptr nvram_data; - UINT8 control, led_latch_control; - UINT32 individual_leds; - UINT8 latch_AH_red, latch_AH_green, latch_18_red, latch_18_green; + std::unique_ptr nvram_data; + uint8_t control, led_latch_control; + uint32_t individual_leds; + uint8_t latch_AH_red, latch_AH_green, latch_18_red, latch_18_green; DECLARE_DRIVER_INIT(stratos); DECLARE_WRITE8_MEMBER(p2000_w); @@ -46,13 +46,13 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(irq_timer); void show_leds(); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void machine_reset() override; }; DRIVER_INIT_MEMBER( stratos_state, stratos ) { - nvram_data = std::make_unique(0x2000); + nvram_data = std::make_unique(0x2000); nvram->set_base(nvram_data.get(), 0x2000); bank_8000 ->configure_entries(0, 4, memregion("roms_8000")->base(), 0x8000); @@ -112,7 +112,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(stratos_state::irq_timer) maincpu->set_input_line(M65C02_IRQ_LINE, HOLD_LINE); } -UINT32 stratos_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t stratos_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { static bool nmi=false; @@ -306,7 +306,7 @@ WRITE8_MEMBER(stratos_state::lcd_w) // 02 0d - 07 // 01 00 - 05 - static UINT8 vals[18]; + static uint8_t vals[18]; static int idx = 0; if(data == 0) idx = 0; diff --git a/src/mame/drivers/studio2.cpp b/src/mame/drivers/studio2.cpp index fac2de99592..054ab581824 100644 --- a/src/mame/drivers/studio2.cpp +++ b/src/mame/drivers/studio2.cpp @@ -241,7 +241,7 @@ public: DECLARE_DEVICE_IMAGE_LOAD_MEMBER( studio2_cart_load ); /* keyboard state */ - UINT8 m_keylatch; + uint8_t m_keylatch; }; class visicom_state : public studio2_state @@ -253,10 +253,10 @@ public: m_color1_ram(*this, "color1_ram") { } - virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + virtual uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - required_shared_ptr m_color0_ram; - required_shared_ptr m_color1_ram; + required_shared_ptr m_color0_ram; + required_shared_ptr m_color1_ram; DECLARE_WRITE8_MEMBER( dma_w ); }; @@ -282,8 +282,8 @@ public: DECLARE_READ_LINE_MEMBER( gdata_r ); /* video state */ - required_shared_ptr m_color_ram; - UINT8 m_color; + required_shared_ptr m_color_ram; + uint8_t m_color; }; @@ -407,7 +407,7 @@ static const rgb_t VISICOM_PALETTE[] = rgb_t(0xef, 0x45, 0x4a) }; -UINT32 visicom_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t visicom_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_vdc->screen_update(screen, bitmap, cliprect); @@ -458,9 +458,9 @@ WRITE8_MEMBER( visicom_state::dma_w ) int sx = m_screen->hpos() + 4; int y = m_screen->vpos(); - UINT8 addr = offset & 0xff; - UINT8 color0 = m_color0_ram[addr]; - UINT8 color1 = m_color1_ram[addr]; + uint8_t addr = offset & 0xff; + uint8_t color0 = m_color0_ram[addr]; + uint8_t color1 = m_color1_ram[addr]; for (int x = 0; x < 8; x++) { @@ -473,7 +473,7 @@ WRITE8_MEMBER( visicom_state::dma_w ) WRITE8_MEMBER( mpt02_state::dma_w ) { - UINT8 addr = ((offset & 0xe0) >> 2) | (offset & 0x07); + uint8_t addr = ((offset & 0xe0) >> 2) | (offset & 0x07); m_color = m_color_ram[addr]; @@ -528,7 +528,7 @@ void mpt02_state::machine_reset() DEVICE_IMAGE_LOAD_MEMBER( studio2_state, studio2_cart_load ) { - UINT32 size; + uint32_t size; // always alloc 3K, even if range $400-$600 is not read by the system (RAM is present there) m_cart->rom_alloc(0xc00, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); @@ -537,9 +537,9 @@ DEVICE_IMAGE_LOAD_MEMBER( studio2_state, studio2_cart_load ) { if (image.is_filetype("st2")) { - UINT8 header[0x100]; - UINT8 catalogue[10], title[32], pages[64]; - UINT8 blocks; + uint8_t header[0x100]; + uint8_t catalogue[10], title[32], pages[64]; + uint8_t blocks; if (image.length() <= 0x100) { @@ -568,7 +568,7 @@ DEVICE_IMAGE_LOAD_MEMBER( studio2_state, studio2_cart_load ) logerror("ST2 invalid block %u to %04x\n", block, pages[block] << 8); else { - UINT16 offset = (pages[block] << 8) - 0x400; + uint16_t offset = (pages[block] << 8) - 0x400; logerror("ST2 Reading block %u to %04x\n", block, offset); image.fread(m_cart->get_rom_base() + offset, 0x100); } diff --git a/src/mame/drivers/stuntair.cpp b/src/mame/drivers/stuntair.cpp index ec166ddd111..a3767fdb07e 100644 --- a/src/mame/drivers/stuntair.cpp +++ b/src/mame/drivers/stuntair.cpp @@ -102,10 +102,10 @@ public: required_device m_maincpu; required_device m_audiocpu; - required_shared_ptr m_fgram; - required_shared_ptr m_bgram; - required_shared_ptr m_bgattrram; - required_shared_ptr m_sprram; + required_shared_ptr m_fgram; + required_shared_ptr m_bgram; + required_shared_ptr m_bgattrram; + required_shared_ptr m_sprram; required_device m_gfxdecode; required_device m_palette; required_device m_soundlatch; @@ -113,10 +113,10 @@ public: tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT8 m_bg_xscroll; - UINT8 m_nmi_enable; - UINT8 m_spritebank0; - UINT8 m_spritebank1; + uint8_t m_bg_xscroll; + uint8_t m_nmi_enable; + uint8_t m_spritebank0; + uint8_t m_spritebank1; TILE_GET_INFO_MEMBER(get_stuntair_fg_tile_info); TILE_GET_INFO_MEMBER(get_stuntair_bg_tile_info); @@ -135,7 +135,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_stuntair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_stuntair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_PALETTE_INIT(stuntair); }; @@ -150,11 +150,11 @@ public: PALETTE_INIT_MEMBER(stuntair_state, stuntair) { /* need resistor weights etc. */ - const UINT8 *color_prom = machine().root_device().memregion("proms")->base(); + const uint8_t *color_prom = machine().root_device().memregion("proms")->base(); for (int i = 0; i < 0x100; i++) { - UINT8 data = color_prom[i]; + uint8_t data = color_prom[i]; int b = (data&0xc0)>>6; int g = (data&0x38)>>3; @@ -224,7 +224,7 @@ void stuntair_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } } -UINT32 stuntair_state::screen_update_stuntair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t stuntair_state::screen_update_stuntair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_xscroll); diff --git a/src/mame/drivers/stv.cpp b/src/mame/drivers/stv.cpp index efaa4fbbeae..1fb6df8857a 100644 --- a/src/mame/drivers/stv.cpp +++ b/src/mame/drivers/stv.cpp @@ -94,7 +94,7 @@ offsets: READ8_MEMBER(stv_state::stv_ioga_r) { - UINT8 res; + uint8_t res; res = 0xff; if(offset & 0x20 && !space.debugger_access()) @@ -138,7 +138,7 @@ WRITE8_MEMBER(stv_state::stv_ioga_w) READ8_MEMBER(stv_state::critcrsh_ioga_r) { - UINT8 res; + uint8_t res; const char *const lgnames[] = { "LIGHTX", "LIGHTY" }; res = 0xff; @@ -159,7 +159,7 @@ READ8_MEMBER(stv_state::critcrsh_ioga_r) READ8_MEMBER(stv_state::magzun_ioga_r) { - UINT8 res; + uint8_t res; res = 0xff; @@ -197,7 +197,7 @@ READ8_MEMBER(stv_state::stvmp_ioga_r) const char *const mpnames[2][5] = { {"P1_KEY0", "P1_KEY1", "P1_KEY2", "P1_KEY3", "P1_KEY4"}, {"P2_KEY0", "P2_KEY1", "P2_KEY2", "P2_KEY3", "P2_KEY4"} }; - UINT8 res; + uint8_t res; res = 0xff; @@ -237,7 +237,7 @@ WRITE8_MEMBER(stv_state::stvmp_ioga_w) /* remaps with a 8-bit handler because MAME can't install r/w handlers with a different bus parallelism than the CPU native one, shrug ... */ READ32_MEMBER(stv_state::stv_ioga_r32) { - UINT32 res; + uint32_t res; res = 0; if(ACCESSING_BITS_16_23) @@ -266,7 +266,7 @@ WRITE32_MEMBER(stv_state::stv_ioga_w32) READ32_MEMBER(stv_state::critcrsh_ioga_r32) { - UINT32 res; + uint32_t res; res = 0; if(ACCESSING_BITS_16_23) @@ -283,7 +283,7 @@ READ32_MEMBER(stv_state::critcrsh_ioga_r32) READ32_MEMBER(stv_state::stvmp_ioga_r32) { - UINT32 res; + uint32_t res; res = 0; if(ACCESSING_BITS_16_23) @@ -312,7 +312,7 @@ WRITE32_MEMBER(stv_state::stvmp_ioga_w32) READ32_MEMBER(stv_state::magzun_ioga_r32) { - UINT32 res; + uint32_t res; res = 0; if(ACCESSING_BITS_16_23) @@ -381,10 +381,10 @@ DRIVER_INIT_MEMBER(stv_state,stv) m_minit_boost_timeslice = attotime::zero; m_sinit_boost_timeslice = attotime::zero; - m_scu_regs = std::make_unique(0x100/4); - m_scsp_regs = std::make_unique(0x1000/2); - m_backupram = std::make_unique(0x8000); - memset(m_backupram.get(), 0, sizeof(UINT8) * 0x8000); + m_scu_regs = std::make_unique(0x100/4); + m_scsp_regs = std::make_unique(0x1000/2); + m_backupram = std::make_unique(0x8000); + memset(m_backupram.get(), 0, sizeof(uint8_t) * 0x8000); install_stvbios_speedups(); @@ -454,7 +454,7 @@ DRIVER_INIT_MEMBER(stv_state,magzun) /* Program ROM patches, don't understand how to avoid these two checks ... */ { - UINT32 *ROM = (UINT32 *)memregion("cart")->base(); + uint32_t *ROM = (uint32_t *)memregion("cart")->base(); ROM[0x90054/4] = 0x00e00001; // END error @@ -1032,12 +1032,12 @@ static MACHINE_CONFIG_DERIVED( stv_5881, stv ) MACHINE_CONFIG_END -UINT16 stv_state::crypt_read_callback_ch1(UINT32 addr) +uint16_t stv_state::crypt_read_callback_ch1(uint32_t addr) { return m_maincpu->space().read_word(0x02000000 + 0x1000000 + (addr * 2)); } -UINT16 stv_state::crypt_read_callback_ch2(UINT32 addr) +uint16_t stv_state::crypt_read_callback_ch2(uint32_t addr) { return m_maincpu->space().read_word(0x02000000 + 0x0000000 + (addr * 2)); } @@ -1064,7 +1064,7 @@ WRITE32_MEMBER( stv_state::batmanfr_sound_comms_w ) READ16_MEMBER( stv_state::adsp_control_r ) { - UINT16 res = 0; + uint16_t res = 0; switch (offset) { @@ -1100,13 +1100,13 @@ WRITE16_MEMBER( stv_state::adsp_control_w ) if (data > 0) { - UINT8* adsp_rom = (UINT8*)memregion("adsp")->base(); + uint8_t* adsp_rom = (uint8_t*)memregion("adsp")->base(); - UINT32 page = (m_adsp_regs.bdma_control >> 8) & 0xff; - UINT32 dir = (m_adsp_regs.bdma_control >> 2) & 1; - UINT32 type = m_adsp_regs.bdma_control & 3; + uint32_t page = (m_adsp_regs.bdma_control >> 8) & 0xff; + uint32_t dir = (m_adsp_regs.bdma_control >> 2) & 1; + uint32_t type = m_adsp_regs.bdma_control & 3; - UINT32 src_addr = (page << 14) | m_adsp_regs.bdma_external_addr; + uint32_t src_addr = (page << 14) | m_adsp_regs.bdma_external_addr; address_space &addr_space = m_adsp->space((type == 0) ? AS_PROGRAM : AS_DATA); @@ -1116,7 +1116,7 @@ WRITE16_MEMBER( stv_state::adsp_control_w ) { if (type == 0) { - UINT32 src_word =(adsp_rom[src_addr + 0] << 16) | + uint32_t src_word =(adsp_rom[src_addr + 0] << 16) | (adsp_rom[src_addr + 1] << 8) | (adsp_rom[src_addr + 2]); @@ -1127,7 +1127,7 @@ WRITE16_MEMBER( stv_state::adsp_control_w ) } else if (type == 1) { - UINT32 src_word =(adsp_rom[src_addr + 0] << 8) | adsp_rom[src_addr + 1]; + uint32_t src_word =(adsp_rom[src_addr + 0] << 8) | adsp_rom[src_addr + 1]; addr_space.write_dword(m_adsp_regs.bdma_internal_addr * 2, src_word); @@ -1183,12 +1183,12 @@ MACHINE_RESET_MEMBER(stv_state,batmanfr) { MACHINE_RESET_CALL_MEMBER(stv); - UINT8 *adsp_boot = (UINT8*)memregion("adsp")->base(); + uint8_t *adsp_boot = (uint8_t*)memregion("adsp")->base(); /* Load 32 program words (96 bytes) via BDMA */ for (int i = 0; i < 32; i ++) { - UINT32 word; + uint32_t word; word = adsp_boot[i*3 + 0] << 16; word |= adsp_boot[i*3 + 1] << 8; @@ -1277,8 +1277,8 @@ MACHINE_RESET_MEMBER(stv_state,stv) image_init_result stv_state::load_cart(device_image_interface &image, generic_slot_device *slot) { - UINT8 *ROM; - UINT32 size = slot->common_get_size("rom"); + uint8_t *ROM; + uint32_t size = slot->common_get_size("rom"); if (image.software_entry() == nullptr) return image_init_result::FAIL; @@ -1289,7 +1289,7 @@ image_init_result stv_state::load_cart(device_image_interface &image, generic_sl /* fix endianess */ { - UINT8 j[4]; + uint8_t j[4]; for (int i = 0; i < size; i += 4) { @@ -1898,7 +1898,7 @@ by Sega titles,and this is a Sunsoft game)It's likely to be a left-over... DRIVER_INIT_MEMBER(stv_state,sanjeon) { - UINT8 *src = memregion("cart")->base(); + uint8_t *src = memregion("cart")->base(); int x; for (x=0;x<0x3000000;x++) diff --git a/src/mame/drivers/sub.cpp b/src/mame/drivers/sub.cpp index 39fe1b8d072..e2a4b7178e9 100644 --- a/src/mame/drivers/sub.cpp +++ b/src/mame/drivers/sub.cpp @@ -137,13 +137,13 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_attr; - required_shared_ptr m_vid; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; - required_shared_ptr m_scrolly; + required_shared_ptr m_attr; + required_shared_ptr m_vid; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_scrolly; - UINT8 m_nmi_en; + uint8_t m_nmi_en; DECLARE_WRITE8_MEMBER(to_sound_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); @@ -151,7 +151,7 @@ public: virtual void machine_start() override; DECLARE_PALETTE_INIT(sub); - 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); INTERRUPT_GEN_MEMBER(sound_irq); }; @@ -160,7 +160,7 @@ void sub_state::machine_start() save_item(NAME(m_nmi_en)); } -UINT32 sub_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sub_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); gfx_element *gfx_1 = m_gfxdecode->gfx(1); @@ -171,9 +171,9 @@ UINT32 sub_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con { for (x=0;x<32;x++) { - UINT16 tile = m_vid[count]; - UINT8 col; - UINT8 y_offs = m_scrolly[x]; + uint16_t tile = m_vid[count]; + uint8_t col; + uint8_t y_offs = m_scrolly[x]; tile += (m_attr[count]&0xe0)<<3; col = (m_attr[count]&0x1f); @@ -197,9 +197,9 @@ UINT32 sub_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con 1 --cc cccc color */ { - UINT8 *spriteram = m_spriteram; - UINT8 *spriteram_2 = m_spriteram2; - UINT8 x,y,spr_offs,i,col,fx,fy; + uint8_t *spriteram = m_spriteram; + uint8_t *spriteram_2 = m_spriteram2; + uint8_t x,y,spr_offs,i,col,fx,fy; for(i=0;i<0x40;i+=2) { @@ -222,9 +222,9 @@ UINT32 sub_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con { for (x=0;x<32;x++) { - UINT16 tile = m_vid[count]; - UINT8 col; - UINT8 y_offs = m_scrolly[x]; + uint16_t tile = m_vid[count]; + uint8_t col; + uint8_t y_offs = m_scrolly[x]; tile += (m_attr[count]&0xe0)<<3; col = (m_attr[count]&0x1f); @@ -407,9 +407,9 @@ GFXDECODE_END PALETTE_INIT_MEMBER(sub_state, sub) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; - UINT8* lookup = memregion("proms2")->base(); + uint8_t* lookup = memregion("proms2")->base(); for (i = 0;i < 0x100;i++) { @@ -427,7 +427,7 @@ PALETTE_INIT_MEMBER(sub_state, sub) for (i = 0;i < 0x400;i++) { - UINT8 ctabentry = lookup[i+0x400] | (lookup[i+0x000] << 4); + uint8_t ctabentry = lookup[i+0x400] | (lookup[i+0x000] << 4); palette.set_pen_indirect(i, ctabentry); } diff --git a/src/mame/drivers/subhuntr.cpp b/src/mame/drivers/subhuntr.cpp index aaa95c647d5..db541799019 100644 --- a/src/mame/drivers/subhuntr.cpp +++ b/src/mame/drivers/subhuntr.cpp @@ -40,7 +40,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(subhuntr); - UINT32 screen_update_subhuntr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_subhuntr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -54,7 +54,7 @@ PALETTE_INIT_MEMBER(subhuntr_state, subhuntr) { } -UINT32 subhuntr_state::screen_update_subhuntr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t subhuntr_state::screen_update_subhuntr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/subsino.cpp b/src/mame/drivers/subsino.cpp index d05481c050f..9dfe27bb789 100644 --- a/src/mame/drivers/subsino.cpp +++ b/src/mame/drivers/subsino.cpp @@ -253,30 +253,30 @@ public: m_palette(*this, "palette") { } - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - optional_shared_ptr m_reel3_scroll; - optional_shared_ptr m_reel2_scroll; - optional_shared_ptr m_reel1_scroll; - optional_shared_ptr m_reel1_ram; - optional_shared_ptr m_reel2_ram; - optional_shared_ptr m_reel3_ram; - optional_shared_ptr m_stbsub_out_c; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + optional_shared_ptr m_reel3_scroll; + optional_shared_ptr m_reel2_scroll; + optional_shared_ptr m_reel1_scroll; + optional_shared_ptr m_reel1_ram; + optional_shared_ptr m_reel2_ram; + optional_shared_ptr m_reel3_ram; + optional_shared_ptr m_stbsub_out_c; tilemap_t *m_tmap; tilemap_t *m_reel1_tilemap; tilemap_t *m_reel2_tilemap; tilemap_t *m_reel3_tilemap; int m_tiles_offset; - UINT8 m_out_c; - std::unique_ptr m_reel1_attr; - std::unique_ptr m_reel2_attr; - std::unique_ptr m_reel3_attr; - UINT8 m_flash_val; - UINT8 m_flash_packet; - UINT8 m_flash_packet_start; + uint8_t m_out_c; + std::unique_ptr m_reel1_attr; + std::unique_ptr m_reel2_attr; + std::unique_ptr m_reel3_attr; + uint8_t m_flash_val; + uint8_t m_flash_packet; + uint8_t m_flash_packet_start; int m_colordac_offs; - std::unique_ptr m_stbsub_colorram; + std::unique_ptr m_stbsub_colorram; ticket_dispenser_device *m_hopper; @@ -322,9 +322,9 @@ public: DECLARE_PALETTE_INIT(subsino_3proms); DECLARE_VIDEO_START(subsino_reels); DECLARE_VIDEO_START(stbsub); - UINT32 screen_update_subsino(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_subsino_reels(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_stbsub_reels(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_subsino(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_subsino_reels(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_stbsub_reels(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void machine_start() override; required_device m_maincpu; required_device m_gfxdecode; @@ -362,8 +362,8 @@ WRITE8_MEMBER(subsino_state::subsino_colorram_w) TILE_GET_INFO_MEMBER(subsino_state::get_tile_info) { - UINT16 code = m_videoram[ tile_index ] + (m_colorram[ tile_index ] << 8); - UINT16 color = (code >> 8) & 0x0f; + uint16_t code = m_videoram[ tile_index ] + (m_colorram[ tile_index ] << 8); + uint16_t color = (code >> 8) & 0x0f; code = ((code & 0xf000) >> 4) + ((code & 0xff) >> 0); code += m_tiles_offset; SET_TILE_INFO_MEMBER(0, code, color, 0); @@ -371,7 +371,7 @@ TILE_GET_INFO_MEMBER(subsino_state::get_tile_info) TILE_GET_INFO_MEMBER(subsino_state::get_stbsub_tile_info) { - UINT16 code = m_videoram[ tile_index ] + (m_colorram[ tile_index ] << 8); + uint16_t code = m_videoram[ tile_index ] + (m_colorram[ tile_index ] << 8); code&= 0x3fff; SET_TILE_INFO_MEMBER(0, code, 0, 0); } @@ -503,14 +503,14 @@ VIDEO_START_MEMBER(subsino_state,stbsub) } -UINT32 subsino_state::screen_update_subsino(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t subsino_state::screen_update_subsino(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); m_tmap->draw(screen, bitmap, cliprect, 0, 0); return 0; } -UINT32 subsino_state::screen_update_subsino_reels(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t subsino_state::screen_update_subsino_reels(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i; bitmap.fill(0, cliprect); @@ -539,7 +539,7 @@ UINT32 subsino_state::screen_update_subsino_reels(screen_device &screen, bitmap_ } -UINT32 subsino_state::screen_update_stbsub_reels(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t subsino_state::screen_update_stbsub_reels(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i; bitmap.fill(0, cliprect); @@ -578,7 +578,7 @@ UINT32 subsino_state::screen_update_stbsub_reels(screen_device &screen, bitmap_i PALETTE_INIT_MEMBER(subsino_state,subsino_2proms) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i,r,g,b,val; int bit0,bit1,bit2; @@ -605,7 +605,7 @@ PALETTE_INIT_MEMBER(subsino_state,subsino_2proms) PALETTE_INIT_MEMBER(subsino_state,subsino_3proms) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i,r,g,b,val; int bit0,bit1,bit2; @@ -3537,7 +3537,7 @@ ROM_END DRIVER_INIT_MEMBER(subsino_state,smoto16) { - UINT8 *rom = memregion( "maincpu" )->base(); + uint8_t *rom = memregion( "maincpu" )->base(); rom[0x12d0] = 0x20; // "ERROR 951010" } @@ -3798,13 +3798,13 @@ DRIVER_INIT_MEMBER(subsino_state,sharkpye) DRIVER_INIT_MEMBER(subsino_state,smoto20) { - UINT8 *rom = memregion( "maincpu" )->base(); + uint8_t *rom = memregion( "maincpu" )->base(); rom[0x12e1] = 0x20; // "ERROR 951010" } DRIVER_INIT_MEMBER(subsino_state,tisub) { - UINT8 *rom = memregion( "maincpu" )->base(); + uint8_t *rom = memregion( "maincpu" )->base(); DRIVER_INIT_CALL(victor5); @@ -3819,7 +3819,7 @@ DRIVER_INIT_MEMBER(subsino_state,tisub) DRIVER_INIT_MEMBER(subsino_state,tisuba) { - UINT8 *rom = memregion( "maincpu" )->base(); + uint8_t *rom = memregion( "maincpu" )->base(); DRIVER_INIT_CALL(victor5); @@ -3835,94 +3835,94 @@ DRIVER_INIT_MEMBER(subsino_state,tisuba) DRIVER_INIT_MEMBER(subsino_state,stbsub) { #if 1 - UINT8 *rom = memregion( "maincpu" )->base(); + uint8_t *rom = memregion( "maincpu" )->base(); rom[0x1005] = 0x1d; //patch protection check rom[0x7ab] = 0x18; //patch "winning protection" check rom[0x957] = 0x18; //patch "losing protection" check #endif - m_stbsub_colorram = std::make_unique(256*3); + m_stbsub_colorram = std::make_unique(256*3); m_reel1_scroll.allocate(0x40); m_reel2_scroll.allocate(0x40); m_reel3_scroll.allocate(0x40); - m_reel1_attr = std::make_unique(0x200); - m_reel2_attr = std::make_unique(0x200); - m_reel3_attr = std::make_unique(0x200); + m_reel1_attr = std::make_unique(0x200); + m_reel2_attr = std::make_unique(0x200); + m_reel3_attr = std::make_unique(0x200); } DRIVER_INIT_MEMBER(subsino_state, stisub) { - UINT8 *rom = memregion( "maincpu" )->base(); + uint8_t *rom = memregion( "maincpu" )->base(); rom[0x0FA0] = 0x28; rom[0x0FA1] = 0x1d; //patch protection check - m_stbsub_colorram = std::make_unique(256*3); + m_stbsub_colorram = std::make_unique(256*3); m_reel1_scroll.allocate(0x40); m_reel2_scroll.allocate(0x40); m_reel3_scroll.allocate(0x40); - m_reel1_attr = std::make_unique(0x200); - m_reel2_attr = std::make_unique(0x200); - m_reel3_attr = std::make_unique(0x200); + m_reel1_attr = std::make_unique(0x200); + m_reel2_attr = std::make_unique(0x200); + m_reel3_attr = std::make_unique(0x200); } DRIVER_INIT_MEMBER(subsino_state,tesorone) { #if 1 - UINT8 *rom = memregion( "maincpu" )->base(); + uint8_t *rom = memregion( "maincpu" )->base(); rom[0x10a4] = 0x18; //patch protection check ("ERROR 08073"): rom[0x10a5] = 0x11; rom[0x8b6] = 0x18; //patch "winning protection" check rom[0xa84] = 0x18; //patch "losing protection" check #endif - m_stbsub_colorram = std::make_unique(256*3); + m_stbsub_colorram = std::make_unique(256*3); m_reel1_scroll.allocate(0x40); m_reel2_scroll.allocate(0x40); m_reel3_scroll.allocate(0x40); - m_reel1_attr = std::make_unique(0x200); - m_reel2_attr = std::make_unique(0x200); - m_reel3_attr = std::make_unique(0x200); + m_reel1_attr = std::make_unique(0x200); + m_reel2_attr = std::make_unique(0x200); + m_reel3_attr = std::make_unique(0x200); } DRIVER_INIT_MEMBER(subsino_state,tesorone230) { #if 1 - UINT8 *rom = memregion( "maincpu" )->base(); //check this patch!!!! + uint8_t *rom = memregion( "maincpu" )->base(); //check this patch!!!! rom[0x10a8] = 0x18; //patch protection check ("ERROR 08073"): rom[0x10a9] = 0x11; rom[0x8ba] = 0x18; //patch "winning protection" check rom[0xa88] = 0x18; //patch "losing protection" check #endif - m_stbsub_colorram = std::make_unique(256*3); + m_stbsub_colorram = std::make_unique(256*3); m_reel1_scroll.allocate(0x40); m_reel2_scroll.allocate(0x40); m_reel3_scroll.allocate(0x40); - m_reel1_attr = std::make_unique(0x200); - m_reel2_attr = std::make_unique(0x200); - m_reel3_attr = std::make_unique(0x200); + m_reel1_attr = std::make_unique(0x200); + m_reel2_attr = std::make_unique(0x200); + m_reel3_attr = std::make_unique(0x200); } DRIVER_INIT_MEMBER(subsino_state,mtrainnv) { - m_stbsub_colorram = std::make_unique(256*3); + m_stbsub_colorram = std::make_unique(256*3); m_reel1_scroll.allocate(0x40); m_reel2_scroll.allocate(0x40); m_reel3_scroll.allocate(0x40); - m_reel1_attr = std::make_unique(0x200); - m_reel2_attr = std::make_unique(0x200); - m_reel3_attr = std::make_unique(0x200); + m_reel1_attr = std::make_unique(0x200); + m_reel2_attr = std::make_unique(0x200); + m_reel3_attr = std::make_unique(0x200); } /*************************************************************************** diff --git a/src/mame/drivers/subsino2.cpp b/src/mame/drivers/subsino2.cpp index 734cd3b0167..4411e0c1722 100644 --- a/src/mame/drivers/subsino2.cpp +++ b/src/mame/drivers/subsino2.cpp @@ -68,9 +68,9 @@ enum vram_t // Layers struct layer_t { - std::unique_ptr videorams[2]; + std::unique_ptr videorams[2]; - std::unique_ptr scrollrams[2]; + std::unique_ptr scrollrams[2]; int scroll_x; int scroll_y; @@ -92,21 +92,21 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - std::unique_ptr m_hm86171_colorram; + std::unique_ptr m_hm86171_colorram; layer_t m_layers[2]; - UINT8 m_ss9601_byte_lo; - UINT8 m_ss9601_byte_lo2; - std::unique_ptr m_ss9601_reelrams[2]; + uint8_t m_ss9601_byte_lo; + uint8_t m_ss9601_byte_lo2; + std::unique_ptr m_ss9601_reelrams[2]; std::unique_ptr m_reelbitmap; - UINT8 m_ss9601_scrollctrl; - UINT8 m_ss9601_tilesize; - UINT8 m_ss9601_disable; + uint8_t m_ss9601_scrollctrl; + uint8_t m_ss9601_tilesize; + uint8_t m_ss9601_disable; int m_hm86171_offs; - UINT8 m_dsw_mask; - optional_shared_ptr m_outputs16; - optional_shared_ptr m_outputs; - UINT16 m_bishjan_sound; - UINT16 m_bishjan_input; + uint8_t m_dsw_mask; + optional_shared_ptr m_outputs16; + optional_shared_ptr m_outputs; + uint16_t m_bishjan_sound; + uint16_t m_bishjan_input; DECLARE_WRITE8_MEMBER(ss9601_byte_lo_w); DECLARE_WRITE8_MEMBER(ss9601_byte_lo2_w); DECLARE_WRITE8_MEMBER(ss9601_videoram_0_hi_w); @@ -173,7 +173,7 @@ public: TILE_GET_INFO_MEMBER(ss9601_get_tile_info_0); TILE_GET_INFO_MEMBER(ss9601_get_tile_info_1); DECLARE_VIDEO_START(subsino2); - UINT32 screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(am188em_int0_irq); required_device m_maincpu; optional_device m_oki; @@ -194,7 +194,7 @@ private: inline void subsino2_state::ss9601_get_tile_info(layer_t *l, tile_data &tileinfo, tilemap_memory_index tile_index) { int addr; - UINT16 offs; + uint16_t offs; switch (l->tilesize) { default: @@ -228,7 +228,7 @@ WRITE8_MEMBER(subsino2_state::ss9601_byte_lo2_w) } -static inline void ss9601_videoram_w(layer_t *l, vram_t vram, address_space &space, offs_t offset, UINT8 data) +static inline void ss9601_videoram_w(layer_t *l, vram_t vram, address_space &space, offs_t offset, uint8_t data) { l->videorams[vram][offset] = data; @@ -603,7 +603,7 @@ WRITE8_MEMBER(subsino2_state::ss9601_disable_w) VIDEO_START_MEMBER(subsino2_state,subsino2) { - m_hm86171_colorram = std::make_unique(256*3); + m_hm86171_colorram = std::make_unique(256*3); // SS9601 Regs: @@ -627,19 +627,19 @@ VIDEO_START_MEMBER(subsino2_state,subsino2) // line scroll l->tmap->set_scroll_rows(0x200); - l->videorams[VRAM_HI] = std::make_unique(0x80 * 0x40); - l->videorams[VRAM_LO] = std::make_unique(0x80 * 0x40); + l->videorams[VRAM_HI] = std::make_unique(0x80 * 0x40); + l->videorams[VRAM_LO] = std::make_unique(0x80 * 0x40); - l->scrollrams[VRAM_HI] = std::make_unique(0x200); - l->scrollrams[VRAM_LO] = std::make_unique(0x200); + l->scrollrams[VRAM_HI] = std::make_unique(0x200); + l->scrollrams[VRAM_LO] = std::make_unique(0x200); memset(l->scrollrams[VRAM_HI].get(), 0, 0x200); memset(l->scrollrams[VRAM_LO].get(), 0, 0x200); } // SS9601 Reels: - m_ss9601_reelrams[VRAM_HI] = std::make_unique(0x2000); - m_ss9601_reelrams[VRAM_LO] = std::make_unique(0x2000); + m_ss9601_reelrams[VRAM_HI] = std::make_unique(0x2000); + m_ss9601_reelrams[VRAM_LO] = std::make_unique(0x2000); memset(m_ss9601_reelrams[VRAM_HI].get(), 0, 0x2000); memset(m_ss9601_reelrams[VRAM_LO].get(), 0, 0x2000); m_reelbitmap = std::make_unique(0x80*8, 0x40*8); @@ -655,7 +655,7 @@ VIDEO_START_MEMBER(subsino2_state,subsino2) */ } -UINT32 subsino2_state::screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t subsino2_state::screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = ~m_ss9601_disable; int y; @@ -702,7 +702,7 @@ UINT32 subsino2_state::screen_update_subsino2(screen_device &screen, bitmap_ind1 // line scroll - UINT16 scroll_dx = 0; + uint16_t scroll_dx = 0; for (y = 0; y < 0x200; y++) { if (mask_y[i]) @@ -734,7 +734,7 @@ UINT32 subsino2_state::screen_update_subsino2(screen_device &screen, bitmap_ind1 visible.max_y = 4 * 0x10 * (y+1) - 1; int reeladdr = y * 0x80 * 4 + x; - UINT16 reelscroll = (m_ss9601_reelrams[VRAM_HI][reeladdr] << 8) + m_ss9601_reelrams[VRAM_LO][reeladdr]; + uint16_t reelscroll = (m_ss9601_reelrams[VRAM_HI][reeladdr] << 8) + m_ss9601_reelrams[VRAM_LO][reeladdr]; l->tmap->set_scrollx(0, (reelscroll >> 9) * 8 - visible.min_x); @@ -766,8 +766,8 @@ UINT32 subsino2_state::screen_update_subsino2(screen_device &screen, bitmap_ind1 } } - INT32 sx = -l->scroll_x; - INT32 sy = -(l->scroll_y + 1); + int32_t sx = -l->scroll_x; + int32_t sy = -(l->scroll_y + 1); copyscrollbitmap(bitmap, *m_reelbitmap, 1, &sx, 1, &sy, cliprect); } else @@ -899,7 +899,7 @@ WRITE16_MEMBER(subsino2_state::bishjan_input_w) READ16_MEMBER(subsino2_state::bishjan_input_r) { int i; - UINT16 res = 0xff; + uint16_t res = 0xff; static const char *const port[] = { "KEYB_0", "KEYB_1", "KEYB_2", "KEYB_3", "KEYB_4" }; for (i = 0; i < 5; i++) @@ -2570,7 +2570,7 @@ ROM_END DRIVER_INIT_MEMBER(subsino2_state,bishjan) { - UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t*)memregion("maincpu")->base(); // patch serial protection test (it always enters test mode on boot otherwise) rom[0x042EA/2] = 0x4008; @@ -2640,7 +2640,7 @@ ROM_END DRIVER_INIT_MEMBER(subsino2_state,new2001) { - UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t*)memregion("maincpu")->base(); // patch serial protection test (ERROR 041920 otherwise) rom[0x19A2/2] = 0x4066; @@ -2680,7 +2680,7 @@ ROM_END DRIVER_INIT_MEMBER(subsino2_state,humlan) { - UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t*)memregion("maincpu")->base(); // patch serial protection test (ERROR 093099 otherwise) rom[0x170A/2] = 0x4066; @@ -2744,7 +2744,7 @@ ROM_END DRIVER_INIT_MEMBER(subsino2_state,expcard) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // patch protection test (it always enters test mode on boot otherwise) rom[0xed4dc-0xc0000] = 0xeb; @@ -2842,7 +2842,7 @@ DRIVER_INIT_MEMBER(subsino2_state,mtrain) subsino_decrypt(machine(), crsbingo_bitswaps, crsbingo_xors, 0x8000); // patch serial protection test (it always enters test mode on boot otherwise) - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); rom[0x0cec] = 0x18; rom[0xb037] = 0x18; @@ -2896,7 +2896,7 @@ ROM_END DRIVER_INIT_MEMBER(subsino2_state,saklove) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // patch serial protection test (it always enters test mode on boot otherwise) rom[0x0e029] = 0xeb; @@ -2956,7 +2956,7 @@ ROM_END DRIVER_INIT_MEMBER(subsino2_state,xplan) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // patch protection test (it always enters test mode on boot otherwise) rom[0xeded9-0xc0000] = 0xeb; @@ -3016,7 +3016,7 @@ ROM_END DRIVER_INIT_MEMBER(subsino2_state,xtrain) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // patch protection test (it always enters test mode on boot otherwise) rom[0xe190f-0xc0000] = 0xeb; @@ -3079,7 +3079,7 @@ ROM_END DRIVER_INIT_MEMBER(subsino2_state,ptrain) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); // patch protection test (it always enters test mode on boot otherwise) rom[0xe1b08-0xc0000] = 0xeb; @@ -3124,7 +3124,7 @@ DRIVER_INIT_MEMBER(subsino2_state,wtrnymph) subsino_decrypt(machine(), victor5_bitswaps, victor5_xors, 0x8000); // patch serial protection test (it always enters test mode on boot otherwise) - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); rom[0x0d79] = 0x18; rom[0xc1cf] = 0x18; rom[0xc2a9] = 0x18; diff --git a/src/mame/drivers/summit.cpp b/src/mame/drivers/summit.cpp index 9058af8401e..4556bc83e5c 100644 --- a/src/mame/drivers/summit.cpp +++ b/src/mame/drivers/summit.cpp @@ -32,12 +32,12 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_attr; - required_shared_ptr m_vram; + required_shared_ptr m_attr; + required_shared_ptr m_vram; DECLARE_WRITE8_MEMBER(out_w); virtual void video_start() override; DECLARE_PALETTE_INIT(summit); - UINT32 screen_update_summit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_summit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -48,7 +48,7 @@ void summit_state::video_start() { } -UINT32 summit_state::screen_update_summit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t summit_state::screen_update_summit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int count = 0x0000; diff --git a/src/mame/drivers/sun1.cpp b/src/mame/drivers/sun1.cpp index 7f8b109f207..be74d757311 100644 --- a/src/mame/drivers/sun1.cpp +++ b/src/mame/drivers/sun1.cpp @@ -73,8 +73,8 @@ public: DECLARE_WRITE16_MEMBER(sun1_upd7201_w); DECLARE_WRITE8_MEMBER(kbd_put); virtual void machine_reset() override; - required_shared_ptr m_p_ram; - UINT8 m_term_data; + required_shared_ptr m_p_ram; + uint8_t m_term_data; }; @@ -83,7 +83,7 @@ public: READ16_MEMBER( sun1_state::sun1_upd7201_r ) { - UINT16 ret; + uint16_t ret; if (offset == 0) { ret = m_term_data << 8; @@ -115,9 +115,9 @@ INPUT_PORTS_END void sun1_state::machine_reset() { - UINT8* user1 = memregion("user1")->base(); + uint8_t* user1 = memregion("user1")->base(); - memcpy((UINT8*)m_p_ram.target(),user1,0x4000); + memcpy((uint8_t*)m_p_ram.target(),user1,0x4000); m_maincpu->reset(); m_term_data = 0; diff --git a/src/mame/drivers/sun2.cpp b/src/mame/drivers/sun2.cpp index 1fbc83e99e8..e438a07a01f 100644 --- a/src/mame/drivers/sun2.cpp +++ b/src/mame/drivers/sun2.cpp @@ -154,7 +154,7 @@ public: required_memory_region m_rom, m_idprom; required_device m_ram; required_device m_type0space, m_type1space, m_type2space, m_type3space; - required_shared_ptr m_bw2_vram; + required_shared_ptr m_bw2_vram; virtual void machine_start() override; virtual void machine_reset() override; @@ -166,17 +166,17 @@ public: DECLARE_READ16_MEMBER( ram_r ); DECLARE_WRITE16_MEMBER( ram_w ); - UINT32 bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: - UINT16 *m_rom_ptr, *m_ram_ptr; - UINT8 *m_idprom_ptr; - UINT16 m_diagreg, m_sysenable, m_buserror; - UINT16 m_context; - UINT8 m_segmap[8][512]; - UINT32 m_pagemap[4097]; - UINT32 m_ram_size, m_ram_size_words; - UINT16 m_bw2_ctrl; + uint16_t *m_rom_ptr, *m_ram_ptr; + uint8_t *m_idprom_ptr; + uint16_t m_diagreg, m_sysenable, m_buserror; + uint16_t m_context; + uint8_t m_segmap[8][512]; + uint32_t m_pagemap[4097]; + uint32_t m_ram_size, m_ram_size_words; + uint16_t m_bw2_ctrl; }; READ16_MEMBER( sun2_state::ram_r ) @@ -192,7 +192,7 @@ WRITE16_MEMBER( sun2_state::ram_w ) READ16_MEMBER( sun2_state::tl_mmu_r ) { - UINT8 fc = m_maincpu->get_fc(); + uint8_t fc = m_maincpu->get_fc(); if ((fc == 3) && !space.debugger_access()) { @@ -259,9 +259,9 @@ READ16_MEMBER( sun2_state::tl_mmu_r ) } // it's translation time - UINT8 context = (fc & 4) ? ((m_context >> 8) & 7) : (m_context & 7); - UINT8 pmeg = m_segmap[context][offset >> 14]; - UINT32 entry = (pmeg << 4) + ((offset >> 10) & 0xf); + uint8_t context = (fc & 4) ? ((m_context >> 8) & 7) : (m_context & 7); + uint8_t pmeg = m_segmap[context][offset >> 14]; + uint32_t entry = (pmeg << 4) + ((offset >> 10) & 0xf); // printf("sun2: Context = %d, pmeg = %d, offset >> 14 = %x, entry = %d, page = %d\n", context, pmeg, offset >> 14, entry, (offset >> 10) & 0xf); @@ -270,7 +270,7 @@ READ16_MEMBER( sun2_state::tl_mmu_r ) m_pagemap[entry] |= PM_ACCESSED; // Sun2 implementations only use 12 bits from the page entry - UINT32 tmp = (m_pagemap[entry] & 0xfff) << 10; + uint32_t tmp = (m_pagemap[entry] & 0xfff) << 10; tmp |= (offset & 0x3ff); // if (!space.debugger_access()) @@ -326,7 +326,7 @@ READ16_MEMBER( sun2_state::tl_mmu_r ) WRITE16_MEMBER( sun2_state::tl_mmu_w ) { - UINT8 fc = m_maincpu->get_fc(); + uint8_t fc = m_maincpu->get_fc(); //printf("sun2: Write %04x (FC %d, mask %04x, PC=%x) to %08x\n", data, fc, mem_mask, m_maincpu->pc, offset<<1); @@ -407,16 +407,16 @@ WRITE16_MEMBER( sun2_state::tl_mmu_w ) } // it's translation time - UINT8 context = (fc & 4) ? ((m_context >> 8) & 7) : (m_context & 7); - UINT8 pmeg = m_segmap[context][offset >> 14]; - UINT32 entry = (pmeg << 4) + ((offset >> 10) & 0xf); + uint8_t context = (fc & 4) ? ((m_context >> 8) & 7) : (m_context & 7); + uint8_t pmeg = m_segmap[context][offset >> 14]; + uint32_t entry = (pmeg << 4) + ((offset >> 10) & 0xf); if (m_pagemap[entry] & PM_VALID) { m_pagemap[entry] |= (PM_ACCESSED | PM_MODIFIED); // only 12 of the 20 bits in the page table entry are used on either Sun2 implementation - UINT32 tmp = (m_pagemap[entry] & 0xfff) << 10; + uint32_t tmp = (m_pagemap[entry] & 0xfff) << 10; tmp |= (offset & 0x3ff); //if (!space.debugger_access()) printf("sun2: Translated addr: %08x, type %d (page entry %08x, orig virt %08x)\n", tmp << 1, (m_pagemap[entry] >> 22) & 7, m_pagemap[entry], offset<<1); @@ -525,13 +525,13 @@ ADDRESS_MAP_END static ADDRESS_MAP_START(mbustype3space_map, AS_PROGRAM, 16, sun2_state) ADDRESS_MAP_END -UINT32 sun2_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sun2_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels; - static const UINT32 palette[2] = { 0, 0xffffff }; - UINT8 *m_vram = (UINT8 *)m_bw2_vram.target(); + uint8_t pixels; + static const uint32_t palette[2] = { 0, 0xffffff }; + uint8_t *m_vram = (uint8_t *)m_bw2_vram.target(); if (!(m_bw2_ctrl & 0x8000)) return 0; @@ -562,9 +562,9 @@ INPUT_PORTS_END void sun2_state::machine_start() { - m_rom_ptr = (UINT16 *)m_rom->base(); - m_idprom_ptr = (UINT8 *)m_idprom->base(); - m_ram_ptr = (UINT16 *)m_ram->pointer(); + m_rom_ptr = (uint16_t *)m_rom->base(); + m_idprom_ptr = (uint8_t *)m_idprom->base(); + m_ram_ptr = (uint16_t *)m_ram->pointer(); m_ram_size = m_ram->size(); m_ram_size_words = m_ram_size >> 1; } diff --git a/src/mame/drivers/sun3.cpp b/src/mame/drivers/sun3.cpp index e5c4bf5437b..acd6a799872 100644 --- a/src/mame/drivers/sun3.cpp +++ b/src/mame/drivers/sun3.cpp @@ -236,8 +236,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - optional_shared_ptr m_p_ram; - optional_shared_ptr m_bw2_vram; + optional_shared_ptr m_p_ram; + optional_shared_ptr m_bw2_vram; optional_device m_type0space, m_type1space, m_type2space, m_type3space; required_memory_region m_rom, m_idprom; required_device m_ram; @@ -255,25 +255,25 @@ public: DECLARE_READ8_MEMBER( rtc7170_r ); DECLARE_WRITE8_MEMBER( rtc7170_w ); - UINT32 bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 bw2_16x11_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 bw2_350_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t bw2_16x11_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t bw2_350_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(sun3_timer); private: - UINT32 *m_rom_ptr, *m_ram_ptr; - UINT8 *m_idprom_ptr; - UINT32 m_enable, m_diag, m_dvma_enable, m_parregs[8], m_irqctrl, m_ecc[4]; - UINT8 m_buserr; - - UINT32 m_context; - UINT8 m_segmap[8][2048]; - UINT32 m_pagemap[4096]; - UINT32 m_ram_size, m_ram_size_words; + uint32_t *m_rom_ptr, *m_ram_ptr; + uint8_t *m_idprom_ptr; + uint32_t m_enable, m_diag, m_dvma_enable, m_parregs[8], m_irqctrl, m_ecc[4]; + uint8_t m_buserr; + + uint32_t m_context; + uint8_t m_segmap[8][2048]; + uint32_t m_pagemap[4096]; + uint32_t m_ram_size, m_ram_size_words; bool m_bInBusErr; - UINT32 m_cache_tags[0x4000], m_cache_data[0x4000]; + uint32_t m_cache_tags[0x4000], m_cache_data[0x4000]; }; READ32_MEMBER( sun3_state::ram_r ) @@ -385,7 +385,7 @@ WRITE32_MEMBER( sun3_state::ram_w ) READ32_MEMBER( sun3_state::tl_mmu_r ) { - UINT8 fc = m_maincpu->get_fc(); + uint8_t fc = m_maincpu->get_fc(); if ((fc == 3) && !space.debugger_access()) { @@ -459,8 +459,8 @@ READ32_MEMBER( sun3_state::tl_mmu_r ) } // it's translation time - UINT8 pmeg = m_segmap[m_context & 7][(offset >> 15) & 0x7ff]; - UINT32 entry = (pmeg << 4) + ((offset >> 11) & 0xf); + uint8_t pmeg = m_segmap[m_context & 7][(offset >> 15) & 0x7ff]; + uint32_t entry = (pmeg << 4) + ((offset >> 11) & 0xf); //printf("sun3: Context = %d, pmeg = %d, offset >> 15 = %x, entry = %d, page = %d\n", m_context&7, pmeg, (offset >> 15) & 0x7ff, entry, (offset >> 11) & 0xf); @@ -477,7 +477,7 @@ READ32_MEMBER( sun3_state::tl_mmu_r ) m_pagemap[entry] |= PM_ACCESSED; - UINT32 tmp = (m_pagemap[entry] & 0x7ffff) << 11; + uint32_t tmp = (m_pagemap[entry] & 0x7ffff) << 11; tmp |= (offset & 0x7ff); //printf("pmeg %d, entry %d = %08x, virt %08x => tmp %08x\n", pmeg, entry, m_pagemap[entry], offset << 2, tmp); @@ -522,7 +522,7 @@ READ32_MEMBER( sun3_state::tl_mmu_r ) WRITE32_MEMBER( sun3_state::tl_mmu_w ) { - UINT8 fc = m_maincpu->get_fc(); + uint8_t fc = m_maincpu->get_fc(); //printf("sun3: Write %08x (FC %d, mask %08x, PC=%x) to %08x\n", data, fc, mem_mask, m_maincpu->pc, offset<<1); @@ -612,8 +612,8 @@ WRITE32_MEMBER( sun3_state::tl_mmu_w ) } // it's translation time - UINT8 pmeg = m_segmap[m_context & 7][(offset >> 15) & 0x7ff]; - UINT32 entry = (pmeg << 4) + ((offset >> 11) & 0xf); + uint8_t pmeg = m_segmap[m_context & 7][(offset >> 15) & 0x7ff]; + uint32_t entry = (pmeg << 4) + ((offset >> 11) & 0xf); if (m_pagemap[entry] & PM_VALID) { @@ -630,7 +630,7 @@ WRITE32_MEMBER( sun3_state::tl_mmu_w ) m_pagemap[entry] |= (PM_ACCESSED | PM_MODIFIED); - UINT32 tmp = (m_pagemap[entry] & 0x7ffff) << 11; + uint32_t tmp = (m_pagemap[entry] & 0x7ffff) << 11; tmp |= (offset & 0x7ff); //if (!space.debugger_access()) printf("sun3: Translated addr: %08x, type %d (page entry %08x, orig virt %08x)\n", tmp << 2, (m_pagemap[entry] >> 26) & 3, m_pagemap[entry], offset<<2); @@ -670,7 +670,7 @@ WRITE32_MEMBER( sun3_state::tl_mmu_w ) READ32_MEMBER(sun3_state::parity_r) { - UINT32 rv = m_parregs[offset]; + uint32_t rv = m_parregs[offset]; if (offset == 0) // clear interrupt if any { @@ -811,7 +811,7 @@ READ32_MEMBER(sun3_state::ecc_r) m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE); } - UINT32 rv = m_ecc[offset & 0xf]; + uint32_t rv = m_ecc[offset & 0xf]; if ((offset & 0xf) == 0) rv |= 0x06000000; // indicate each ECC board is 32MB, for 128MB total @@ -836,13 +836,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(sun3_state::sun3_timer) } } -UINT32 sun3_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sun3_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels; - static const UINT32 palette[2] = { 0, 0xffffff }; - UINT8 *m_vram = (UINT8 *)m_bw2_vram.target(); + uint8_t pixels; + static const uint32_t palette[2] = { 0, 0xffffff }; + uint8_t *m_vram = (uint8_t *)m_bw2_vram.target(); for (y = 0; y < 900; y++) { @@ -864,13 +864,13 @@ UINT32 sun3_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const return 0; } -UINT32 sun3_state::bw2_16x11_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sun3_state::bw2_16x11_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels; - static const UINT32 palette[2] = { 0, 0xffffff }; - UINT8 *m_vram = (UINT8 *)m_bw2_vram.target(); + uint8_t pixels; + static const uint32_t palette[2] = { 0, 0xffffff }; + uint8_t *m_vram = (uint8_t *)m_bw2_vram.target(); for (y = 0; y < 1100; y++) { @@ -892,13 +892,13 @@ UINT32 sun3_state::bw2_16x11_update(screen_device &screen, bitmap_rgb32 &bitmap, return 0; } -UINT32 sun3_state::bw2_350_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sun3_state::bw2_350_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels; - static const UINT32 palette[2] = { 0, 0xffffff }; - UINT8 *m_vram = (UINT8 *)&m_ram_ptr[(0x100000>>2)]; + uint8_t pixels; + static const uint32_t palette[2] = { 0, 0xffffff }; + uint8_t *m_vram = (uint8_t *)&m_ram_ptr[(0x100000>>2)]; for (y = 0; y < 900; y++) { @@ -926,9 +926,9 @@ INPUT_PORTS_END void sun3_state::machine_start() { - m_rom_ptr = (UINT32 *)m_rom->base(); - m_ram_ptr = (UINT32 *)m_ram->pointer(); - m_idprom_ptr = (UINT8 *)m_idprom->base(); + m_rom_ptr = (uint32_t *)m_rom->base(); + m_ram_ptr = (uint32_t *)m_ram->pointer(); + m_idprom_ptr = (uint8_t *)m_idprom->base(); m_ram_size = m_ram->size(); m_ram_size_words = m_ram_size >> 2; } diff --git a/src/mame/drivers/sun3x.cpp b/src/mame/drivers/sun3x.cpp index d81688727d2..15a7303e212 100644 --- a/src/mame/drivers/sun3x.cpp +++ b/src/mame/drivers/sun3x.cpp @@ -168,8 +168,8 @@ public: optional_device m_fdc; virtual void machine_reset() override; - required_shared_ptr m_p_ram; - optional_shared_ptr m_bw2_vram; + required_shared_ptr m_p_ram; + optional_shared_ptr m_bw2_vram; DECLARE_READ32_MEMBER(enable_r); DECLARE_WRITE32_MEMBER(enable_w); @@ -199,11 +199,11 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(sun380_timer); - UINT32 bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: - UINT32 m_enable, m_buserr, m_diag, m_printer, m_irqctrl, m_memreg, m_memerraddr; - UINT32 m_iommu[0x800]; + uint32_t m_enable, m_buserr, m_diag, m_printer, m_irqctrl, m_memreg, m_memerraddr; + uint32_t m_iommu[0x800]; bool m_bInBusErr; }; @@ -272,7 +272,7 @@ READ32_MEMBER( sun3x_state::fdc_control_r ) if(m_fdc) { floppy_image_device *fdev = machine().device(":fdc:0")->get_device(); if(fdev->exists()) { - UINT32 variant = fdev->get_variant(); + uint32_t variant = fdev->get_variant(); switch(variant) { case floppy_image::SSSD: case floppy_image::SSDD: @@ -293,7 +293,7 @@ READ32_MEMBER( sun3x_state::fdc_control_r ) WRITE32_MEMBER(sun3x_state::ramwrite_w) { - UINT32 *pRAM = (UINT32 *)m_p_ram.target(); + uint32_t *pRAM = (uint32_t *)m_p_ram.target(); if (((m_memreg & 0xf0000000) == 0x70000000) && (m_irqctrl & 0x01000000) && @@ -357,7 +357,7 @@ WRITE32_MEMBER(sun3x_state::enable_w) READ32_MEMBER(sun3x_state::buserr_r) { - UINT32 rv = m_buserr; + uint32_t rv = m_buserr; m_buserr = 0; return rv; } @@ -506,13 +506,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(sun3x_state::sun380_timer) } } -UINT32 sun3x_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sun3x_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels; - static const UINT32 palette[2] = { 0, 0xffffff }; - UINT8 *m_vram = (UINT8 *)m_bw2_vram.target(); + uint8_t pixels; + static const uint32_t palette[2] = { 0, 0xffffff }; + uint8_t *m_vram = (uint8_t *)m_bw2_vram.target(); for (y = 0; y < 900; y++) { @@ -542,9 +542,9 @@ INPUT_PORTS_END void sun3x_state::machine_reset() { - UINT8* user1 = memregion("user1")->base(); + uint8_t* user1 = memregion("user1")->base(); - memcpy((UINT8*)m_p_ram.target(),user1,0x10000); + memcpy((uint8_t*)m_p_ram.target(),user1,0x10000); m_maincpu->reset(); diff --git a/src/mame/drivers/sun4.cpp b/src/mame/drivers/sun4.cpp index 2fe04e67b6e..7000c954ee3 100644 --- a/src/mame/drivers/sun4.cpp +++ b/src/mame/drivers/sun4.cpp @@ -586,7 +586,7 @@ public: DECLARE_FLOPPY_FORMATS( floppy_formats ); - UINT32 bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: required_device m_maincpu; @@ -603,39 +603,39 @@ protected: optional_device m_type0space, m_type1space; required_device m_ram; required_memory_region m_rom; - optional_shared_ptr m_bw2_vram; - - UINT32 *m_rom_ptr; - UINT32 m_context; - UINT8 m_system_enable; - UINT32 m_buserr[4]; - UINT32 m_counter[4]; - UINT32 m_dma[4]; + optional_shared_ptr m_bw2_vram; + + uint32_t *m_rom_ptr; + uint32_t m_context; + uint8_t m_system_enable; + uint32_t m_buserr[4]; + uint32_t m_counter[4]; + uint32_t m_dma[4]; int m_scsi_irq; int m_scsi_drq; private: - UINT32 *m_ram_ptr; - UINT8 m_segmap[16][4096]; - UINT32 m_pagemap[16384]; - UINT32 m_cachetags[0x4000]; - UINT32 m_cachedata[0x4000]; - UINT32 m_ram_size, m_ram_size_words; - UINT8 m_ctx_mask; // SS2 is sun4c but has 16 contexts; most have 8 - UINT8 m_pmeg_mask; // SS2 is sun4c but has 16384 PTEs; most have 8192 - UINT8 m_irq_reg; // IRQ control - UINT8 m_scc1_int, m_scc2_int; - UINT8 m_diag; + uint32_t *m_ram_ptr; + uint8_t m_segmap[16][4096]; + uint32_t m_pagemap[16384]; + uint32_t m_cachetags[0x4000]; + uint32_t m_cachedata[0x4000]; + uint32_t m_ram_size, m_ram_size_words; + uint8_t m_ctx_mask; // SS2 is sun4c but has 16 contexts; most have 8 + uint8_t m_pmeg_mask; // SS2 is sun4c but has 16384 PTEs; most have 8192 + uint8_t m_irq_reg; // IRQ control + uint8_t m_scc1_int, m_scc2_int; + uint8_t m_diag; int m_arch; emu_timer *m_c0_timer, *m_c1_timer; emu_timer *m_dma_timer; emu_timer *m_reset_timer; - UINT32 read_insn_data(UINT8 asi, address_space &space, UINT32 offset, UINT32 mem_mask); - void write_insn_data(UINT8 asi, address_space &space, UINT32 offset, UINT32 data, UINT32 mem_mask); - UINT32 read_insn_data_4c(UINT8 asi, address_space &space, UINT32 offset, UINT32 mem_mask); - void write_insn_data_4c(UINT8 asi, address_space &space, UINT32 offset, UINT32 data, UINT32 mem_mask); + uint32_t read_insn_data(uint8_t asi, address_space &space, uint32_t offset, uint32_t mem_mask); + void write_insn_data(uint8_t asi, address_space &space, uint32_t offset, uint32_t data, uint32_t mem_mask); + uint32_t read_insn_data_4c(uint8_t asi, address_space &space, uint32_t offset, uint32_t mem_mask); + void write_insn_data_4c(uint8_t asi, address_space &space, uint32_t offset, uint32_t data, uint32_t mem_mask); void dma_set_int_pend(int state); void dma_update_irq(); @@ -648,13 +648,13 @@ private: void fcodes_command(int ref, int params, const char **param); }; -UINT32 sun4_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sun4_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels; - static const UINT32 palette[2] = { 0xffffff, 0 }; - UINT8 *m_vram = (UINT8 *)m_bw2_vram.target(); + uint8_t pixels; + static const uint32_t palette[2] = { 0xffffff, 0 }; + uint8_t *m_vram = (uint8_t *)m_bw2_vram.target(); for (y = 0; y < 900; y++) { @@ -677,17 +677,17 @@ UINT32 sun4_state::bw2_update(screen_device &screen, bitmap_rgb32 &bitmap, const return 0; } -UINT32 sun4_state::read_insn_data_4c(UINT8 asi, address_space &space, UINT32 offset, UINT32 mem_mask) +uint32_t sun4_state::read_insn_data_4c(uint8_t asi, address_space &space, uint32_t offset, uint32_t mem_mask) { // it's translation time - UINT8 pmeg = m_segmap[m_context & m_ctx_mask][(offset >> 16) & 0xfff] & m_pmeg_mask; - UINT32 entry = (pmeg << 6) + ((offset >> 10) & 0x3f); + uint8_t pmeg = m_segmap[m_context & m_ctx_mask][(offset >> 16) & 0xfff] & m_pmeg_mask; + uint32_t entry = (pmeg << 6) + ((offset >> 10) & 0x3f); if (m_pagemap[entry] & PM_VALID) { m_pagemap[entry] |= PM_ACCESSED; - UINT32 tmp = (m_pagemap[entry] & 0xffff) << 10; + uint32_t tmp = (m_pagemap[entry] & 0xffff) << 10; tmp |= (offset & 0x3ff); //printf("sun4: read translated vaddr %08x to phys %08x type %d, PTE %08x, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], m_maincpu->pc()); @@ -724,11 +724,11 @@ UINT32 sun4_state::read_insn_data_4c(UINT8 asi, address_space &space, UINT32 off } } -void sun4_state::write_insn_data_4c(UINT8 asi, address_space &space, UINT32 offset, UINT32 data, UINT32 mem_mask) +void sun4_state::write_insn_data_4c(uint8_t asi, address_space &space, uint32_t offset, uint32_t data, uint32_t mem_mask) { // it's translation time - UINT8 pmeg = m_segmap[m_context & m_ctx_mask][(offset >> 16) & 0xfff] & m_pmeg_mask; - UINT32 entry = (pmeg << 6) + ((offset >> 10) & 0x3f); + uint8_t pmeg = m_segmap[m_context & m_ctx_mask][(offset >> 16) & 0xfff] & m_pmeg_mask; + uint32_t entry = (pmeg << 6) + ((offset >> 10) & 0x3f); if (m_pagemap[entry] & PM_VALID) { @@ -743,7 +743,7 @@ void sun4_state::write_insn_data_4c(UINT8 asi, address_space &space, UINT32 offs m_pagemap[entry] |= (PM_ACCESSED | PM_MODIFIED); - UINT32 tmp = (m_pagemap[entry] & 0xffff) << 10; + uint32_t tmp = (m_pagemap[entry] & 0xffff) << 10; tmp |= (offset & 0x3ff); //printf("sun4: write translated vaddr %08x to phys %08x type %d, PTE %08x, ASI %d, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], asi, m_maincpu->pc()); @@ -775,9 +775,9 @@ void sun4_state::write_insn_data_4c(UINT8 asi, address_space &space, UINT32 offs READ32_MEMBER( sun4_state::sun4c_mmu_r ) { - UINT8 asi = m_maincpu->get_asi(); + uint8_t asi = m_maincpu->get_asi(); int page; - UINT32 retval = 0; + uint32_t retval = 0; // make debugger fetches emulate supervisor program for best compatibility with boot PROM execution if (space.debugger_access()) asi = 9; @@ -870,7 +870,7 @@ READ32_MEMBER( sun4_state::sun4c_mmu_r ) WRITE32_MEMBER( sun4_state::sun4c_mmu_w ) { - UINT8 asi = m_maincpu->get_asi(); + uint8_t asi = m_maincpu->get_asi(); int page; //printf("sun4: write %08x to %08x (ASI %d, mem_mask %08x, PC %x)\n", data, offset, asi, mem_mask, m_maincpu->pc()); @@ -935,7 +935,7 @@ WRITE32_MEMBER( sun4_state::sun4c_mmu_w ) break; case 3: // segment map { - UINT8 segdata = 0; + uint8_t segdata = 0; //printf("segment write, mask %08x, PC=%x\n", mem_mask, m_maincpu->pc()); if (mem_mask == 0xffff0000) segdata = (data >> 16) & 0xff; else if (mem_mask == 0xff000000) segdata = (data >> 24) & 0xff; @@ -968,17 +968,17 @@ WRITE32_MEMBER( sun4_state::sun4c_mmu_w ) // ----------------------------------------------------------------- -UINT32 sun4_state::read_insn_data(UINT8 asi, address_space &space, UINT32 offset, UINT32 mem_mask) +uint32_t sun4_state::read_insn_data(uint8_t asi, address_space &space, uint32_t offset, uint32_t mem_mask) { // it's translation time - UINT8 pmeg = m_segmap[m_context][(offset >> 16) & 0xfff]; - UINT32 entry = (pmeg << 5) + ((offset >> 11) & 0x1f); + uint8_t pmeg = m_segmap[m_context][(offset >> 16) & 0xfff]; + uint32_t entry = (pmeg << 5) + ((offset >> 11) & 0x1f); if (m_pagemap[entry] & PM_VALID) { m_pagemap[entry] |= PM_ACCESSED; - UINT32 tmp = (m_pagemap[entry] & 0x7ffff) << 11; + uint32_t tmp = (m_pagemap[entry] & 0x7ffff) << 11; tmp |= (offset & 0x7ff); //printf("sun4: read translated vaddr %08x to phys %08x type %d, PTE %08x, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], m_maincpu->pc()); @@ -1015,17 +1015,17 @@ UINT32 sun4_state::read_insn_data(UINT8 asi, address_space &space, UINT32 offset } } -void sun4_state::write_insn_data(UINT8 asi, address_space &space, UINT32 offset, UINT32 data, UINT32 mem_mask) +void sun4_state::write_insn_data(uint8_t asi, address_space &space, uint32_t offset, uint32_t data, uint32_t mem_mask) { // it's translation time - UINT8 pmeg = m_segmap[m_context][(offset >> 16) & 0xfff]; - UINT32 entry = (pmeg << 5) + ((offset >> 11) & 0x1f); + uint8_t pmeg = m_segmap[m_context][(offset >> 16) & 0xfff]; + uint32_t entry = (pmeg << 5) + ((offset >> 11) & 0x1f); if (m_pagemap[entry] & PM_VALID) { m_pagemap[entry] |= PM_ACCESSED; - UINT32 tmp = (m_pagemap[entry] & 0x7ffff) << 11; + uint32_t tmp = (m_pagemap[entry] & 0x7ffff) << 11; tmp |= (offset & 0x7ff); //printf("sun4: write translated vaddr %08x to phys %08x type %d, PTE %08x, PC=%x\n", offset<<2, tmp<<2, (m_pagemap[entry]>>26) & 3, m_pagemap[entry], m_maincpu->pc()); @@ -1057,7 +1057,7 @@ void sun4_state::write_insn_data(UINT8 asi, address_space &space, UINT32 offset, READ32_MEMBER( sun4_state::sun4_mmu_r ) { - UINT8 asi = m_maincpu->get_asi(); + uint8_t asi = m_maincpu->get_asi(); int page; // make debugger fetches emulate supervisor program for best compatibility with boot PROM execution @@ -1151,7 +1151,7 @@ READ32_MEMBER( sun4_state::sun4_mmu_r ) WRITE32_MEMBER( sun4_state::sun4_mmu_w ) { - UINT8 asi = m_maincpu->get_asi(); + uint8_t asi = m_maincpu->get_asi(); int page; //printf("sun4: write %08x to %08x (ASI %d, mem_mask %08x, PC %x)\n", data, offset, asi, mem_mask, m_maincpu->pc()); @@ -1228,7 +1228,7 @@ WRITE32_MEMBER( sun4_state::sun4_mmu_w ) break; case 3: // segment map { - UINT8 segdata = 0; + uint8_t segdata = 0; //printf("segment write, mask %08x, PC=%x\n", mem_mask, m_maincpu->pc()); if (mem_mask == 0xffff0000) segdata = (data >> 16) & 0xff; else if (mem_mask == 0xff000000) segdata = (data >> 24) & 0xff; @@ -1264,15 +1264,15 @@ WRITE32_MEMBER( sun4_state::sun4_mmu_w ) void sun4_state::l2p_command(int ref, int params, const char **param) { - UINT64 addr, offset; + uint64_t addr, offset; if (!machine().debugger().commands().validate_number_parameter(param[0], &addr)) return; addr &= 0xffffffff; offset = addr >> 2; - UINT8 pmeg = 0; - UINT32 entry = 0, tmp = 0; + uint8_t pmeg = 0; + uint32_t entry = 0, tmp = 0; if (m_arch == ARCH_SUN4) { @@ -1348,8 +1348,8 @@ void sun4_state::machine_reset() void sun4_state::machine_start() { - m_rom_ptr = (UINT32 *)m_rom->base(); - m_ram_ptr = (UINT32 *)m_ram->pointer(); + m_rom_ptr = (uint32_t *)m_rom->base(); + m_ram_ptr = (uint32_t *)m_ram->pointer(); m_ram_size = m_ram->size(); m_ram_size_words = m_ram_size >> 2; @@ -1589,7 +1589,7 @@ void sun4_state::device_timer(emu_timer &timer, device_timer_id id, int param, v READ32_MEMBER( sun4_state::timer_r ) { - UINT32 ret = m_counter[offset]; + uint32_t ret = m_counter[offset]; // reading limt 0 if (offset == 0) @@ -1695,17 +1695,17 @@ void sun4_state:: dma_update_irq() void sun4_state::dma_tick() { - UINT32 transfer_size = (m_dma[DMA_BYTE_COUNT] > PAGE_SIZE ? PAGE_SIZE : m_dma[DMA_BYTE_COUNT]); + uint32_t transfer_size = (m_dma[DMA_BYTE_COUNT] > PAGE_SIZE ? PAGE_SIZE : m_dma[DMA_BYTE_COUNT]); address_space &space = m_maincpu->space(AS_PROGRAM); if (m_dma[DMA_CTRL] & DMA_WRITE) { - UINT32 data = 0; - UINT32 byte_cnt = 3; - UINT32 mem_mask = 0; + uint32_t data = 0; + uint32_t byte_cnt = 3; + uint32_t mem_mask = 0; while (transfer_size > 0) { - UINT8 value = m_scsi->dma_r(); + uint8_t value = m_scsi->dma_r(); data |= value << (byte_cnt * 8); mem_mask |= 0xff << (byte_cnt * 8); transfer_size--; @@ -1750,8 +1750,8 @@ void sun4_state::dma_tick() } else { - UINT32 byte_cnt = 3; - UINT32 mem_mask = 0; + uint32_t byte_cnt = 3; + uint32_t mem_mask = 0; while (transfer_size > 0) { mem_mask |= 0xff << (byte_cnt * 8); @@ -1759,7 +1759,7 @@ void sun4_state::dma_tick() if (byte_cnt == 0) { - UINT32 data = 0; + uint32_t data = 0; if (m_arch == ARCH_SUN4C) { data = read_insn_data_4c(11, space, m_dma[DMA_ADDR] >> 2, mem_mask); @@ -1787,7 +1787,7 @@ void sun4_state::dma_tick() if (byte_cnt != 0) { byte_cnt++; - UINT32 data = 0; + uint32_t data = 0; if (m_arch == ARCH_SUN4C) { data = read_insn_data_4c(11, space, m_dma[DMA_ADDR] >> 2, mem_mask); @@ -1797,10 +1797,10 @@ void sun4_state::dma_tick() data = read_insn_data(11, space, m_dma[DMA_ADDR] >> 2, mem_mask); } - UINT32 initial_cnt = byte_cnt; + uint32_t initial_cnt = byte_cnt; for (int i = 0; i < 4 - initial_cnt; i++) { - UINT8 byte_val = (data >> (byte_cnt * 8)) & 0xff; + uint8_t byte_val = (data >> (byte_cnt * 8)) & 0xff; m_scsi->dma_w(byte_val); m_dma[DMA_BYTE_COUNT]--; @@ -1823,11 +1823,11 @@ void sun4_state::dma_tick() void sun4_state::dma_setup_timer(bool continuing) { - const UINT32 remaining_bytes = m_dma[DMA_BYTE_COUNT]; - const UINT64 latency = (continuing ? 0 : 40); - const UINT64 transfer_size = (remaining_bytes < PAGE_SIZE ? remaining_bytes : PAGE_SIZE); - const UINT64 transfer_duration = ((transfer_size + 15) / 16) * 8; // 16 byte groupings, 8 clock cycles per group - const UINT64 total_ticks = latency + transfer_duration; + const uint32_t remaining_bytes = m_dma[DMA_BYTE_COUNT]; + const uint64_t latency = (continuing ? 0 : 40); + const uint64_t transfer_size = (remaining_bytes < PAGE_SIZE ? remaining_bytes : PAGE_SIZE); + const uint64_t transfer_duration = ((transfer_size + 15) / 16) * 8; // 16 byte groupings, 8 clock cycles per group + const uint64_t total_ticks = latency + transfer_duration; m_dma_timer->adjust(attotime::from_ticks(total_ticks, DMA_XTAL)); @@ -1849,7 +1849,7 @@ WRITE32_MEMBER( sun4_state::dma_w ) case DMA_CTRL: { // clear write-only bits - UINT32 old_ctrl = m_dma[DMA_CTRL]; + uint32_t old_ctrl = m_dma[DMA_CTRL]; m_dma[DMA_CTRL] &= (DMA_READ_ONLY | DMA_READ_WRITE); diff --git a/src/mame/drivers/suna16.cpp b/src/mame/drivers/suna16.cpp index b690876c05c..6d8b54d0bae 100644 --- a/src/mame/drivers/suna16.cpp +++ b/src/mame/drivers/suna16.cpp @@ -113,7 +113,7 @@ ADDRESS_MAP_END READ8_MEMBER(suna16_state::uballoon_prot_r) { - UINT8 ret = 0; + uint8_t ret = 0; switch (offset) { diff --git a/src/mame/drivers/suna8.cpp b/src/mame/drivers/suna8.cpp index 114ab90e917..d63735cf2e5 100644 --- a/src/mame/drivers/suna8.cpp +++ b/src/mame/drivers/suna8.cpp @@ -61,12 +61,12 @@ Notes: DRIVER_INIT_MEMBER(suna8_state,hardhead) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; for (i = 0; i < 0x8000; i++) { - static const UINT8 swaptable[8] = + static const uint8_t swaptable[8] = { 1,1,0,1,1,1,1,0 }; @@ -91,27 +91,27 @@ DRIVER_INIT_MEMBER(suna8_state,hardhedb) Brick Zone ***************************************************************************/ -UINT8 *suna8_state::brickzn_decrypt() +uint8_t *suna8_state::brickzn_decrypt() { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); - UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size); + uint8_t *decrypt = auto_alloc_array(machine(), uint8_t, size); int i; /* Opcodes and data */ for (i = 0; i < 0x50000; i++) { - static const UINT8 opcode_swaptable[8] = + static const uint8_t opcode_swaptable[8] = { 1,1,1,0,0,1,1,0 }; - static const UINT8 data_swaptable[16] = + static const uint8_t data_swaptable[16] = { 1,1,1,0,0,1,1,1,1,0,1,1,1,1,1,1 }; int opcode_swap = opcode_swaptable[((i & 0x00c) >> 2) | ((i & 0x040) >> 4)]; int data_swap = (i >= 0x8000) ? 0 : data_swaptable[(i & 0x003) | ((i & 0x008) >> 1) | ((i & 0x400) >> 7)]; - UINT8 x = RAM[i]; + uint8_t x = RAM[i]; if (data_swap) { @@ -215,10 +215,10 @@ DRIVER_INIT_MEMBER(suna8_state,brickzn11) DRIVER_INIT_MEMBER(suna8_state,hardhea2) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); - UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size); - UINT8 x; + uint8_t *decrypt = auto_alloc_array(machine(), uint8_t, size); + uint8_t x; int i; m_bank0d->set_base(decrypt); @@ -241,7 +241,7 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes) 8?, 9n?,an, bn y,y,?,? (player anims) cn, dy, en, fn y,y,n,n */ - static const UINT8 swaptable[0x50] = + static const uint8_t swaptable[0x50] = { 1,1,1,1,0,0,1,1, 0,0,0,0,0,0,0,0, // 8000-ffff not used 1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0, @@ -260,12 +260,12 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes) /* Opcodes */ for (i = 0; i < 0x8000; i++) { - static const UINT8 swaptable[32] = + static const uint8_t swaptable[32] = { 1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1, 1,1,0,1,1,1,1,1,1,1,1,1,0,1,0,0 }; - static const UINT8 xortable[32] = + static const uint8_t xortable[32] = { 0x04,0x04,0x00,0x04,0x00,0x04,0x00,0x00,0x04,0x45,0x00,0x04,0x00,0x04,0x00,0x00, 0x04,0x45,0x00,0x04,0x00,0x04,0x00,0x00,0x04,0x04,0x00,0x04,0x00,0x04,0x00,0x00 @@ -284,14 +284,14 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes) /* Data */ for (i = 0; i < 0x8000; i++) { - static const UINT8 swaptable[8] = { 1,1,0,1,0,1,1,0 }; + static const uint8_t swaptable[8] = { 1,1,0,1,0,1,1,0 }; if (swaptable[(i & 0x7000) >> 12]) RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x41; } m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000); - membank("bank2")->configure_entries(0, 2, auto_alloc_array(machine(), UINT8, 0x2000 * 2), 0x2000); + membank("bank2")->configure_entries(0, 2, auto_alloc_array(machine(), uint8_t, 0x2000 * 2), 0x2000); } DRIVER_INIT_MEMBER(suna8_state, hardhea2b) @@ -300,7 +300,7 @@ DRIVER_INIT_MEMBER(suna8_state, hardhea2b) // code/data split in first ROM? m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000); - membank("bank2")->configure_entries(0, 2, auto_alloc_array(machine(), UINT8, 0x2000 * 2), 0x2000); + membank("bank2")->configure_entries(0, 2, auto_alloc_array(machine(), uint8_t, 0x2000 * 2), 0x2000); } /*************************************************************************** @@ -309,10 +309,10 @@ DRIVER_INIT_MEMBER(suna8_state, hardhea2b) DRIVER_INIT_MEMBER(suna8_state,starfigh) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); - UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size); - UINT8 x; + uint8_t *decrypt = auto_alloc_array(machine(), uint8_t, size); + uint8_t x; int i; m_bank0d->set_base(decrypt); @@ -321,7 +321,7 @@ DRIVER_INIT_MEMBER(suna8_state,starfigh) memcpy(decrypt, RAM, size); for (i = 0; i < 0x50000; i++) { - static const UINT8 swaptable[0x50] = + static const uint8_t swaptable[0x50] = { 1,1,1,1, 1,1,0,0, 0,0,0,0, 0,0,0,0, // 8000-ffff not used 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -340,12 +340,12 @@ DRIVER_INIT_MEMBER(suna8_state,starfigh) /* Opcodes */ for (i = 0; i < 0x8000; i++) { - static const UINT8 swaptable[32] = + static const uint8_t swaptable[32] = { 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; - static const UINT8 xortable[32] = + static const uint8_t xortable[32] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x41,0x01,0x00,0x00,0x00,0x00, 0x01,0x01,0x41,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 @@ -364,7 +364,7 @@ DRIVER_INIT_MEMBER(suna8_state,starfigh) /* Data */ for (i = 0; i < 0x8000; i++) { - static const UINT8 swaptable[8] = { 1,1,0,1,0,1,1,0 }; + static const uint8_t swaptable[8] = { 1,1,0,1,0,1,1,0 }; if (swaptable[(i & 0x7000) >> 12]) RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x45; @@ -394,10 +394,10 @@ DRIVER_INIT_MEMBER(suna8_state,starfigh) DRIVER_INIT_MEMBER(suna8_state,sparkman) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); size_t size = memregion("maincpu")->bytes(); - UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size); - UINT8 x; + uint8_t *decrypt = auto_alloc_array(machine(), uint8_t, size); + uint8_t x; int i; m_bank0d->set_base(decrypt); @@ -406,7 +406,7 @@ DRIVER_INIT_MEMBER(suna8_state,sparkman) memcpy(decrypt, RAM, size); for (i = 0; i < 0x50000; i++) { - static const UINT8 swaptable[0x50] = + static const uint8_t swaptable[0x50] = { 1,1,1,1, 0,0,1,1, 0,0,0,0, 0,0,0,0, // 8000-ffff not used 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, @@ -425,12 +425,12 @@ DRIVER_INIT_MEMBER(suna8_state,sparkman) /* Opcodes */ for (i = 0; i < 0x8000; i++) { - static const UINT8 swaptable[32] = + static const uint8_t swaptable[32] = { 0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1, 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0 }; - static const UINT8 xortable[32] = + static const uint8_t xortable[32] = { 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,0x40,0x00,0x00,0x00,0x00,0x00 @@ -449,7 +449,7 @@ DRIVER_INIT_MEMBER(suna8_state,sparkman) /* Data */ for (i = 0; i < 0x8000; i++) { - static const UINT8 swaptable[8] = { 1,1,1,0,1,1,0,1 }; + static const uint8_t swaptable[8] = { 1,1,1,0,1,1,0,1 }; if (swaptable[(i & 0x7000) >> 12]) RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x44; @@ -484,7 +484,7 @@ DRIVER_INIT_MEMBER(suna8_state,sparkman) READ8_MEMBER(suna8_state::hardhead_protection_r) { - UINT8 protection_val = m_protection_val; + uint8_t protection_val = m_protection_val; if (protection_val & 0x80) return ((~offset & 0x20) ? 0x20 : 0) | @@ -658,7 +658,7 @@ ADDRESS_MAP_END */ READ8_MEMBER(suna8_state::brickzn_cheats_r) { - static UINT8 bit2 = 0; + static uint8_t bit2 = 0; bit2 = 1 - bit2; // see code at 2b48 return (ioport("CHEATS")->read() & (~(1 << 2))) | @@ -782,7 +782,7 @@ WRITE8_MEMBER(suna8_state::brickzn_multi_w) 56 coin in OK? 70 monster hit NO? 58? */ - UINT8 remap = (m_remap_sound ? BITSWAP8(data, 7,6,3,4,5,2,1,0) : data); + uint8_t remap = (m_remap_sound ? BITSWAP8(data, 7,6,3,4,5,2,1,0) : data); m_soundlatch->write(space, 0, remap); diff --git a/src/mame/drivers/supdrapo.cpp b/src/mame/drivers/supdrapo.cpp index 63d95aead34..7db30ec1645 100644 --- a/src/mame/drivers/supdrapo.cpp +++ b/src/mame/drivers/supdrapo.cpp @@ -86,11 +86,11 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_col_line; - required_shared_ptr m_videoram; - required_shared_ptr m_char_bank; + required_shared_ptr m_col_line; + required_shared_ptr m_videoram; + required_shared_ptr m_char_bank; - UINT8 m_wdog; + uint8_t m_wdog; DECLARE_READ8_MEMBER(rng_r); DECLARE_WRITE8_MEMBER(wdog8000_w); @@ -106,7 +106,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(supdrapo); - 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); }; @@ -119,7 +119,7 @@ void supdrapo_state::video_start() } -UINT32 supdrapo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t supdrapo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y; int count; @@ -148,7 +148,7 @@ UINT32 supdrapo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap /*Maybe bit 2 & 3 of the second color prom are intensity bits? */ PALETTE_INIT_MEMBER(supdrapo_state, supdrapo) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit0, bit1, bit2 , r, g, b; int i; diff --git a/src/mame/drivers/supduck.cpp b/src/mame/drivers/supduck.cpp index d08d52319fa..a32ea281822 100644 --- a/src/mame/drivers/supduck.cpp +++ b/src/mame/drivers/supduck.cpp @@ -52,9 +52,9 @@ public: // shared pointers required_device m_spriteram; - required_shared_ptr m_text_videoram; - required_shared_ptr m_fore_videoram; - required_shared_ptr m_back_videoram; + required_shared_ptr m_text_videoram; + required_shared_ptr m_fore_videoram; + required_shared_ptr m_back_videoram; required_device m_gfxdecode; required_device m_palette; @@ -65,7 +65,7 @@ public: tilemap_t *m_fore_tilemap; tilemap_t *m_back_tilemap; - 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); DECLARE_WRITE16_MEMBER(text_videoram_w); DECLARE_WRITE16_MEMBER(fore_videoram_w); @@ -124,7 +124,7 @@ void supduck_state::video_start() } -UINT32 supduck_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t supduck_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->black_pen(), cliprect); @@ -159,7 +159,7 @@ WRITE16_MEMBER(supduck_state::back_videoram_w) TILE_GET_INFO_MEMBER(supduck_state::get_text_tile_info) // same as tigeroad.c { - UINT16 *videoram = m_text_videoram; + uint16_t *videoram = m_text_videoram; int data = videoram[tile_index]; int attr = data >> 8; int code = (data & 0xff) + ((attr & 0xc0) << 2) + ((attr & 0x20) << 5); @@ -171,7 +171,7 @@ TILE_GET_INFO_MEMBER(supduck_state::get_text_tile_info) // same as tigeroad.c TILE_GET_INFO_MEMBER(supduck_state::get_fore_tile_info) { - UINT16 *videoram = m_fore_videoram; + uint16_t *videoram = m_fore_videoram; int data = videoram[tile_index]; int code = data & 0xff; if (data & 0x4000) code |= 0x100; @@ -187,7 +187,7 @@ TILE_GET_INFO_MEMBER(supduck_state::get_fore_tile_info) TILE_GET_INFO_MEMBER(supduck_state::get_back_tile_info) { - UINT16 *videoram = m_back_videoram; + uint16_t *videoram = m_back_videoram; int data = videoram[tile_index]; int code = data & 0xff; diff --git a/src/mame/drivers/super6.cpp b/src/mame/drivers/super6.cpp index 0fd20f534ad..b76e3dc3d97 100644 --- a/src/mame/drivers/super6.cpp +++ b/src/mame/drivers/super6.cpp @@ -26,7 +26,7 @@ void super6_state::bankswitch() { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); // power on jump if (!BIT(m_bank0, 6)) { program.install_rom(0x0000, 0x07ff, 0xf800, m_rom); return; } @@ -469,7 +469,7 @@ void super6_state::machine_reset() bankswitch(); - UINT8 baud = m_j7->read(); + uint8_t baud = m_j7->read(); m_brg->str_w(baud & 0x0f); m_brg->stt_w((baud >> 4) & 0x07); diff --git a/src/mame/drivers/superchs.cpp b/src/mame/drivers/superchs.cpp index dc66a92d9ae..f0b49df03dc 100644 --- a/src/mame/drivers/superchs.cpp +++ b/src/mame/drivers/superchs.cpp @@ -159,10 +159,10 @@ WRITE32_MEMBER(superchs_state::superchs_input_w) READ32_MEMBER(superchs_state::superchs_stick_r) { - UINT8 b0 = ioport("UNKNOWN")->read(); - UINT8 b1 = ((ioport("SOUND")->read() * 255) / 100) ^ 0xff; // 00 = full, ff = silent - UINT8 b2 = ioport("ACCEL")->read() ^ 0xff; - UINT8 b3 = ioport("WHEEL")->read(); + uint8_t b0 = ioport("UNKNOWN")->read(); + uint8_t b1 = ((ioport("SOUND")->read() * 255) / 100) ^ 0xff; // 00 = full, ff = silent + uint8_t b2 = ioport("ACCEL")->read() ^ 0xff; + uint8_t b3 = ioport("WHEEL")->read(); return b3 << 24 | b2 << 16 | b1 << 8 | b0; } diff --git a/src/mame/drivers/supercrd.cpp b/src/mame/drivers/supercrd.cpp index 512c308b1a0..044661c4805 100644 --- a/src/mame/drivers/supercrd.cpp +++ b/src/mame/drivers/supercrd.cpp @@ -181,15 +181,15 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(supercrd_videoram_w); DECLARE_WRITE8_MEMBER(supercrd_colorram_w); TILE_GET_INFO_MEMBER(get_bg_tile_info); DECLARE_PALETTE_INIT(supercrd); DECLARE_VIDEO_START(supercrd); - UINT32 screen_update_supercrd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_supercrd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -201,7 +201,7 @@ public: PALETTE_INIT_MEMBER(supercrd_state, supercrd) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; static const int resistances_rb[3] = { 1000, 470, 220 }; static const int resistances_g [2] = { 470, 220 }; @@ -272,7 +272,7 @@ VIDEO_START_MEMBER(supercrd_state, supercrd) } -UINT32 supercrd_state::screen_update_supercrd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t supercrd_state::screen_update_supercrd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/drivers/superdq.cpp b/src/mame/drivers/superdq.cpp index c86d634da62..2b3dbb856ef 100644 --- a/src/mame/drivers/superdq.cpp +++ b/src/mame/drivers/superdq.cpp @@ -40,10 +40,10 @@ public: m_palette(*this, "palette") { } required_device m_laserdisc; - UINT8 m_ld_in_latch; - UINT8 m_ld_out_latch; + uint8_t m_ld_in_latch; + uint8_t m_ld_out_latch; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_tilemap; int m_color_bank; DECLARE_WRITE8_MEMBER(superdq_videoram_w); @@ -55,7 +55,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(superdq); - UINT32 screen_update_superdq(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_superdq(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(superdq_vblank); required_device m_maincpu; required_device m_gfxdecode; @@ -74,7 +74,7 @@ void superdq_state::video_start() m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(superdq_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 superdq_state::screen_update_superdq(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t superdq_state::screen_update_superdq(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -91,7 +91,7 @@ UINT32 superdq_state::screen_update_superdq(screen_device &screen, bitmap_rgb32 PALETTE_INIT_MEMBER(superdq_state, superdq) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; static const int resistances[3] = { 820, 390, 200 }; double rweights[3], gweights[3], bweights[2]; @@ -159,7 +159,7 @@ WRITE8_MEMBER(superdq_state::superdq_videoram_w) WRITE8_MEMBER(superdq_state::superdq_io_w) { int i; - static const UINT8 black_color_entries[] = {7,15,16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; + static const uint8_t black_color_entries[] = {7,15,16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; if ( data & 0x40 ) /* bit 6 = irqack */ m_maincpu->set_input_line(0, CLEAR_LINE); diff --git a/src/mame/drivers/superqix.cpp b/src/mame/drivers/superqix.cpp index bc5f6525b3b..8c0092da733 100644 --- a/src/mame/drivers/superqix.cpp +++ b/src/mame/drivers/superqix.cpp @@ -175,19 +175,19 @@ code at z80:0093: SAMPLES_START_CB_MEMBER(superqix_state::pbillian_sh_start) { - UINT8 *src = memregion("samples")->base(); + uint8_t *src = memregion("samples")->base(); int i, len = memregion("samples")->bytes(); /* convert 8-bit unsigned samples to 8-bit signed */ - m_samplebuf = std::make_unique(len); + m_samplebuf = std::make_unique(len); for (i = 0;i < len;i++) - m_samplebuf[i] = (INT8)(src[i] ^ 0x80) * 256; + m_samplebuf[i] = (int8_t)(src[i] ^ 0x80) * 256; } WRITE8_MEMBER(superqix_state::pbillian_sample_trigger_w) { //logerror("sample trigger write of %02x\n", data); - UINT8 *src = memregion("samples")->base(); + uint8_t *src = memregion("samples")->base(); int len = memregion("samples")->bytes(); int start,end; @@ -268,7 +268,7 @@ READ8_MEMBER(superqix_state::in4_mcu_r) { // logerror("%04x: in4_mcu_r\n",space.device().safe_pc()); //logerror("%04x: ay_port_b_r and MCUHasWritten is %d and Z80HasWritten is %d: ",static_cast(*m_maincpu).safe_pc(),m_MCUHasWritten, m_Z80HasWritten); - UINT8 temp = ioport("P2")->read(); + uint8_t temp = ioport("P2")->read(); //logerror("returning %02X\n", temp); return temp; } @@ -805,7 +805,7 @@ READ8_MEMBER(superqix_state::hotsmash_68705_portC_r) WRITE8_MEMBER(superqix_state::hotsmash_68705_portC_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)); if ((changed_m_portC_out&0x08) && !(m_portC_out&0x08)) // on the falling edge of the latch bit, update m_portA_in and (if applicable) m_portB_out latches @@ -893,7 +893,7 @@ CUSTOM_INPUT_MEMBER(superqix_state::pbillian_semaphore_input_r) READ8_MEMBER(superqix_state::pbillian_ay_port_a_r) { //logerror("%04x: ay_port_a_r and MCUHasWritten is %d and Z80HasWritten is %d: ",static_cast(*m_maincpu).safe_pc(),m_MCUHasWritten, m_Z80HasWritten); - UINT8 temp = ioport("BUTTONS")->read(); + uint8_t temp = ioport("BUTTONS")->read(); //logerror("returning %02X\n", temp); return temp; } @@ -901,7 +901,7 @@ READ8_MEMBER(superqix_state::pbillian_ay_port_a_r) READ8_MEMBER(superqix_state::pbillian_ay_port_b_r) { //logerror("%04x: ay_port_b_r and MCUHasWritten is %d and Z80HasWritten is %d: ",static_cast(*m_maincpu).safe_pc(),m_MCUHasWritten, m_Z80HasWritten); - UINT8 temp = ioport("SYSTEM")->read(); + uint8_t temp = ioport("SYSTEM")->read(); //logerror("returning %02X\n", temp); return temp; } @@ -932,7 +932,7 @@ TIMER_CALLBACK_MEMBER(superqix_state::hle_68705_w_cb) case 0x00: m_curr_player = 0; break; // this command should fully reset the mcu and quadrature counters by jumping to its reset vector, as in hotsmash. it does not return a response value. case 0x01: { - UINT8 p = ioport(m_curr_player ? "PLUNGER2" : "PLUNGER1")->read() & 0xbf; + uint8_t p = ioport(m_curr_player ? "PLUNGER2" : "PLUNGER1")->read() & 0xbf; if ((p & 0x3f) == 0) p |= 0x40; m_fromMCU = p; break; @@ -1730,9 +1730,9 @@ DRIVER_INIT_MEMBER(superqix_state,sqixr0) DRIVER_INIT_MEMBER(superqix_state,perestro) { - UINT8 *src; + uint8_t *src; int len; - UINT8 temp[16]; + uint8_t temp[16]; int i,j; /* decrypt program code; the address lines are shuffled around in a non-trivial way */ diff --git a/src/mame/drivers/superslave.cpp b/src/mame/drivers/superslave.cpp index 879c841b463..14bb97e1252 100644 --- a/src/mame/drivers/superslave.cpp +++ b/src/mame/drivers/superslave.cpp @@ -34,7 +34,7 @@ Oxx,yy = Out port READ8_MEMBER( superslave_state::read ) { - UINT8 data = 0; + uint8_t data = 0; offs_t boundry = 0xc000 | ((m_memctrl & 0xf0) << 6); @@ -145,7 +145,7 @@ READ8_MEMBER( superslave_state::status_r) */ - UINT8 data = 1; + uint8_t data = 1; // RS-232 data |= m_rs232d->dsr_r() << 4; diff --git a/src/mame/drivers/supertnk.cpp b/src/mame/drivers/supertnk.cpp index c399e38dccd..c2b53c2c369 100644 --- a/src/mame/drivers/supertnk.cpp +++ b/src/mame/drivers/supertnk.cpp @@ -115,9 +115,9 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - std::unique_ptr m_videoram[3]; - UINT8 m_rom_bank; - UINT8 m_bitplane_select; + std::unique_ptr m_videoram[3]; + uint8_t m_rom_bank; + uint8_t m_bitplane_select; pen_t m_pens[NUM_PENS]; DECLARE_WRITE8_MEMBER(supertnk_bankswitch_0_w); DECLARE_WRITE8_MEMBER(supertnk_bankswitch_1_w); @@ -130,7 +130,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_supertnk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_supertnk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(supertnk_interrupt); required_device m_maincpu; }; @@ -191,18 +191,18 @@ WRITE8_MEMBER(supertnk_state::supertnk_interrupt_ack_w) void supertnk_state::video_start() { offs_t i; - const UINT8 *prom = memregion("proms")->base(); + const uint8_t *prom = memregion("proms")->base(); for (i = 0; i < NUM_PENS; i++) { - UINT8 data = prom[i]; + uint8_t data = prom[i]; m_pens[i] = rgb_t(pal1bit(data >> 2), pal1bit(data >> 5), pal1bit(data >> 6)); } - m_videoram[0] = std::make_unique(0x2000); - m_videoram[1] = std::make_unique(0x2000); - m_videoram[2] = std::make_unique(0x2000); + m_videoram[0] = std::make_unique(0x2000); + m_videoram[1] = std::make_unique(0x2000); + m_videoram[2] = std::make_unique(0x2000); } @@ -223,7 +223,7 @@ WRITE8_MEMBER(supertnk_state::supertnk_videoram_w) READ8_MEMBER(supertnk_state::supertnk_videoram_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; if (m_bitplane_select < 3) ret = m_videoram[m_bitplane_select][offset]; @@ -244,7 +244,7 @@ WRITE8_MEMBER(supertnk_state::supertnk_bitplane_select_1_w) } -UINT32 supertnk_state::screen_update_supertnk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t supertnk_state::screen_update_supertnk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -252,16 +252,16 @@ UINT32 supertnk_state::screen_update_supertnk(screen_device &screen, bitmap_rgb3 { int i; - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; - UINT8 data0 = m_videoram[0][offs]; - UINT8 data1 = m_videoram[1][offs]; - UINT8 data2 = m_videoram[2][offs]; + uint8_t data0 = m_videoram[0][offs]; + uint8_t data1 = m_videoram[1][offs]; + uint8_t data2 = m_videoram[2][offs]; for (i = 0; i < 8; i++) { - UINT8 color = ((data0 & 0x80) >> 5) | ((data1 & 0x80) >> 6) | ((data2 & 0x80) >> 7); + uint8_t color = ((data0 & 0x80) >> 5) | ((data1 & 0x80) >> 6) | ((data2 & 0x80) >> 7); bitmap.pix32(y, x) = m_pens[color]; data0 = data0 << 1; @@ -482,7 +482,7 @@ DRIVER_INIT_MEMBER(supertnk_state,supertnk) { /* decode the TMS9980 ROMs */ offs_t offs; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); size_t len = memregion("maincpu")->bytes(); for (offs = 0; offs < len; offs++) diff --git a/src/mame/drivers/superwng.cpp b/src/mame/drivers/superwng.cpp index ff98d582a50..5445aab4b28 100644 --- a/src/mame/drivers/superwng.cpp +++ b/src/mame/drivers/superwng.cpp @@ -55,16 +55,16 @@ public: required_device m_maincpu; required_device m_audiocpu; - required_shared_ptr m_videoram_bg; - required_shared_ptr m_videoram_fg; - required_shared_ptr m_colorram_bg; - required_shared_ptr m_colorram_fg; + required_shared_ptr m_videoram_bg; + required_shared_ptr m_videoram_fg; + required_shared_ptr m_colorram_bg; + required_shared_ptr m_colorram_fg; required_device m_gfxdecode; required_device m_palette; - UINT8 m_tile_bank; - UINT8 m_sound_byte; - UINT8 m_nmi_enable; + uint8_t m_tile_bank; + uint8_t m_sound_byte; + uint8_t m_nmi_enable; tilemap_t * m_bg_tilemap; tilemap_t * m_fg_tilemap; @@ -91,7 +91,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(superwng); - UINT32 screen_update_superwng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_superwng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(superwng_nmi_interrupt); INTERRUPT_GEN_MEMBER(superwng_sound_nmi_assert); }; @@ -143,7 +143,7 @@ void superwng_state::video_start() m_bg_tilemap->set_scrollx(0, 64); } -UINT32 superwng_state::screen_update_superwng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t superwng_state::screen_update_superwng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); rectangle tmp = cliprect; @@ -192,7 +192,7 @@ UINT32 superwng_state::screen_update_superwng(screen_device &screen, bitmap_ind1 } -static const UINT8 superwng_colors[]= /* temporary */ +static const uint8_t superwng_colors[]= /* temporary */ { 0x00, 0xc4, 0xff, 0x87, 0x00, 0xb0, 0xff, 0x2f, 0x00, 0x07, 0xff, 0xe0, 0x00, 0x86, 0xff, 0xc6, 0x00, 0x07, 0x3f, 0xff, 0x00, 0xb0, 0x38, 0x27, 0x00, 0x20, 0xff, 0x27, 0x00, 0xa4, 0xff, 0x87, @@ -203,7 +203,7 @@ static const UINT8 superwng_colors[]= /* temporary */ PALETTE_INIT_MEMBER(superwng_state, superwng) { int i; - const UINT8 * ptr=superwng_colors; + const uint8_t * ptr=superwng_colors; for (i = 0; i < palette.entries(); i++) { diff --git a/src/mame/drivers/supracan.cpp b/src/mame/drivers/supracan.cpp index bff1ed72fd6..2459e7229aa 100644 --- a/src/mame/drivers/supracan.cpp +++ b/src/mame/drivers/supracan.cpp @@ -97,20 +97,20 @@ DEBUG TRICKS: struct acan_dma_regs_t { - UINT32 source[2]; - UINT32 dest[2]; - UINT16 count[2]; - UINT16 control[2]; + uint32_t source[2]; + uint32_t dest[2]; + uint16_t count[2]; + uint16_t control[2]; }; struct acan_sprdma_regs_t { - UINT32 src; - UINT16 src_inc; - UINT32 dst; - UINT16 dst_inc; - UINT16 count; - UINT16 control; + uint32_t src; + uint16_t src_inc; + uint32_t dst; + uint16_t dst_inc; + uint16_t count; + uint16_t control; }; class supracan_state : public driver_device @@ -133,15 +133,15 @@ public: required_device m_soundcpu; required_device m_cart; - required_shared_ptr m_vram; - required_shared_ptr m_soundram; + required_shared_ptr m_vram; + required_shared_ptr m_soundram; DECLARE_READ16_MEMBER(_68k_soundram_r); DECLARE_WRITE16_MEMBER(_68k_soundram_w); DECLARE_READ8_MEMBER(_6502_soundmem_r); DECLARE_WRITE8_MEMBER(_6502_soundmem_w); - void dma_w(address_space &space, int offset, UINT16 data, UINT16 mem_mask, int ch); + void dma_w(address_space &space, int offset, uint16_t data, uint16_t mem_mask, int ch); DECLARE_WRITE16_MEMBER(dma_channel0_w); DECLARE_WRITE16_MEMBER(dma_channel1_w); @@ -153,59 +153,59 @@ public: acan_dma_regs_t m_acan_dma_regs; acan_sprdma_regs_t m_acan_sprdma_regs; - UINT16 m_m6502_reset; - UINT8 m_soundlatch; - UINT8 m_soundcpu_irq_src; - UINT8 m_sound_irq_enable_reg; - UINT8 m_sound_irq_source_reg; - UINT8 m_sound_cpu_68k_irq_reg; + uint16_t m_m6502_reset; + uint8_t m_soundlatch; + uint8_t m_soundcpu_irq_src; + uint8_t m_sound_irq_enable_reg; + uint8_t m_sound_irq_source_reg; + uint8_t m_sound_cpu_68k_irq_reg; emu_timer *m_video_timer; emu_timer *m_hbl_timer; emu_timer *m_line_on_timer; emu_timer *m_line_off_timer; - std::vector m_vram_addr_swapped; + std::vector m_vram_addr_swapped; - UINT16 *m_pram; + uint16_t *m_pram; - UINT16 m_sprite_count; - UINT32 m_sprite_base_addr; - UINT8 m_sprite_flags; + uint16_t m_sprite_count; + uint32_t m_sprite_base_addr; + uint8_t m_sprite_flags; - UINT32 m_tilemap_base_addr[3]; + uint32_t m_tilemap_base_addr[3]; int m_tilemap_scrollx[3]; int m_tilemap_scrolly[3]; - UINT16 m_video_flags; - UINT16 m_tilemap_flags[3]; - UINT16 m_tilemap_mode[3]; - UINT16 m_irq_mask; - UINT16 m_hbl_mask; - - UINT32 m_roz_base_addr; - UINT16 m_roz_mode; - UINT32 m_roz_scrollx; - UINT32 m_roz_scrolly; - UINT16 m_roz_tile_bank; - UINT32 m_roz_unk_base0; - UINT32 m_roz_unk_base1; - UINT32 m_roz_unk_base2; - UINT16 m_roz_coeffa; - UINT16 m_roz_coeffb; - UINT16 m_roz_coeffc; - UINT16 m_roz_coeffd; - INT32 m_roz_changed; - INT32 m_roz_cx; - INT32 m_roz_cy; - UINT16 m_unk_1d0; - - UINT16 m_video_regs[256]; + uint16_t m_video_flags; + uint16_t m_tilemap_flags[3]; + uint16_t m_tilemap_mode[3]; + uint16_t m_irq_mask; + uint16_t m_hbl_mask; + + uint32_t m_roz_base_addr; + uint16_t m_roz_mode; + uint32_t m_roz_scrollx; + uint32_t m_roz_scrolly; + uint16_t m_roz_tile_bank; + uint32_t m_roz_unk_base0; + uint32_t m_roz_unk_base1; + uint32_t m_roz_unk_base2; + uint16_t m_roz_coeffa; + uint16_t m_roz_coeffb; + uint16_t m_roz_coeffc; + uint16_t m_roz_coeffd; + int32_t m_roz_changed; + int32_t m_roz_cx; + int32_t m_roz_cy; + uint16_t m_unk_1d0; + + uint16_t m_video_regs[256]; bool m_hack_68k_to_6502_access; tilemap_t *m_tilemap_sizes[4][4]; bitmap_ind16 m_sprite_final_bitmap; - void write_swapped_byte(int offset, UINT8 byte); + void write_swapped_byte(int offset, uint8_t byte); TILE_GET_INFO_MEMBER(get_supracan_tilemap0_tile_info); TILE_GET_INFO_MEMBER(get_supracan_tilemap1_tile_info); TILE_GET_INFO_MEMBER(get_supracan_tilemap2_tile_info); @@ -214,7 +214,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(supracan); - UINT32 screen_update_supracan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_supracan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(supracan_irq); INTERRUPT_GEN_MEMBER(supracan_sound_irq); TIMER_CALLBACK_MEMBER(supracan_hbl_callback); @@ -229,7 +229,7 @@ public: int get_tilemap_dimensions(int &xsize, int &ysize, int layer); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void mark_active_tilemap_all_dirty(int layer); - void supracan_suprnova_draw_roz(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, UINT32* scrollram*/, int transmask); + void supracan_suprnova_draw_roz(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tmap, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, uint32_t* scrollram*/, int transmask); required_device m_gfxdecode; required_device m_palette; }; @@ -295,16 +295,16 @@ int supracan_state::supracan_tilemap_get_region(int layer) void supracan_state::supracan_tilemap_get_info_common(int layer, tile_data &tileinfo, int count) { - UINT16* supracan_vram = m_vram; + uint16_t* supracan_vram = m_vram; - UINT32 base = (m_tilemap_base_addr[layer]); + uint32_t base = (m_tilemap_base_addr[layer]); int gfx_mode = (m_tilemap_mode[layer] & 0x7000) >> 12; int region = supracan_tilemap_get_region(layer); count += base; - UINT16 tile_bank = 0; - UINT16 palette_bank = 0; + uint16_t tile_bank = 0; + uint16_t palette_bank = 0; switch(gfx_mode) { case 7: @@ -353,14 +353,14 @@ void supracan_state::supracan_tilemap_get_info_common(int layer, tile_data &tile // I wonder how different this really is.. my guess, not at all. void supracan_state::supracan_tilemap_get_info_roz(int layer, tile_data &tileinfo, int count) { - UINT16* supracan_vram = m_vram; + uint16_t* supracan_vram = m_vram; - UINT32 base = m_roz_base_addr; + uint32_t base = m_roz_base_addr; int region = 1; - UINT16 tile_bank = 0; - UINT16 palette_bank = 0; + uint16_t tile_bank = 0; + uint16_t palette_bank = 0; region = supracan_tilemap_get_region(layer); @@ -493,7 +493,7 @@ int supracan_state::get_tilemap_dimensions(int &xsize, int &ysize, int layer) void supracan_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 *supracan_vram = m_vram; + uint16_t *supracan_vram = m_vram; // [0] // -e-- ---- ---- ---- sprite enable? @@ -512,9 +512,9 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec // d--- ---- ---- ---- Direct Sprite (use details from here, not looked up in vram) // -ooo oooo oooo oooo Sprite address - UINT32 skip_count = 0; - UINT32 start_word = (m_sprite_base_addr >> 1) + skip_count * 4; - UINT32 end_word = start_word + (m_sprite_count - skip_count) * 4; + uint32_t skip_count = 0; + uint32_t start_word = (m_sprite_base_addr >> 1) + skip_count * 4; + uint32_t end_word = start_word + (m_sprite_count - skip_count) * 4; int region = (m_sprite_flags & 1) ? 0 : 1; //8bpp : 4bpp // printf("frame\n"); @@ -563,7 +563,7 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec if (supracan_vram[i+3] &0x8000) { - UINT16 data = supracan_vram[i+3]; + uint16_t data = supracan_vram[i+3]; int tile = (bank * 0x200) + (data & 0x03ff); int palette = (data & 0xf000) >> 12; // this might not be correct, due to the &0x8000 condition above this would force all single tile sprites to be using palette >=0x8 only @@ -588,7 +588,7 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec { for(int xtile = 0; xtile< xsize; xtile++) { - UINT16 data = supracan_vram[(sprite_offset+ytile*xsize+xtile)&VRAM_MASK]; + uint16_t data = supracan_vram[(sprite_offset+ytile*xsize+xtile)&VRAM_MASK]; int tile = (bank * 0x200) + (data & 0x03ff); int palette = (data & 0xf000) >> 12; @@ -624,12 +624,12 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec #if 0 if(xscale == 0) continue; - UINT32 delta = (1 << 17) / xscale; + uint32_t delta = (1 << 17) / xscale; for(int sy = 0; sy < ysize*8; sy++) { - UINT16 *src = &sprite_bitmap->pix16(sy); - UINT16 *dst = &bitmap.pix16(y + sy); - UINT32 dx = x << 16; + uint16_t *src = &sprite_bitmap->pix16(sy); + uint16_t *dst = &bitmap.pix16(y + sy); + uint32_t dx = x << 16; for(int sx = 0; sx < xsize*8; sx++) { dst[dx >> 16] = src[sx]; @@ -660,7 +660,7 @@ void supracan_state::mark_active_tilemap_all_dirty(int layer) /* draws ROZ with linescroll OR columnscroll to 16-bit indexed bitmap */ -void supracan_state::supracan_suprnova_draw_roz(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, UINT32* scrollram*/, int transmask) +void supracan_state::supracan_suprnova_draw_roz(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tmap, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, uint32_t* scrollram*/, int transmask) { //bitmap_ind16 *destbitmap = bitmap; bitmap_ind16 &srcbitmap = tmap->pixmap(); @@ -669,18 +669,18 @@ void supracan_state::supracan_suprnova_draw_roz(bitmap_ind16 &bitmap, const rect const int ymask = srcbitmap.height()-1; const int widthshifted = srcbitmap.width() << 16; const int heightshifted = srcbitmap.height() << 16; - UINT32 cx; - UINT32 cy; + uint32_t cx; + uint32_t cy; int x; int sx; int sy; int ex; int ey; - UINT16 *dest; -// UINT8* destflags; -// UINT8 *pri; - //const UINT16 *src; - //const UINT8 *maskptr; + uint16_t *dest; +// uint8_t* destflags; +// uint8_t *pri; + //const uint16_t *src; + //const uint8_t *maskptr; //int destadvance = destbitmap->bpp / 8; /* pre-advance based on the cliprect */ @@ -717,7 +717,7 @@ void supracan_state::supracan_suprnova_draw_roz(bitmap_ind16 &bitmap, const rect int scroll = 0;//scrollram[(cx>>16)&0x3ff]); - UINT16 data = &srcbitmap.pix16( + uint16_t data = &srcbitmap.pix16( ((cy >> 16) - scroll) & ymask, (cx >> 16) & xmask)[0]; @@ -730,7 +730,7 @@ void supracan_state::supracan_suprnova_draw_roz(bitmap_ind16 &bitmap, const rect #endif { int scroll = 0;//scrollram[(cy>>16)&0x3ff]); - UINT16 data = srcbitmap.pix16( + uint16_t data = srcbitmap.pix16( (cy >> 16) & ymask, ((cx >> 16) - scroll) & xmask); @@ -783,7 +783,7 @@ void supracan_state::supracan_suprnova_draw_roz(bitmap_ind16 &bitmap, const rect // Sango Fighter Intro: 03c8: 0000 0011 1100 1000 ----: ---- ---- ---- ---- 6c20 4620 ---- 0x01 // Sango Fighter Game: 03ce: 0000 0011 1100 1110 0622: 0000 0110 0010 0010 2620 4620 ---- 0x01 -UINT32 supracan_state::screen_update_supracan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t supracan_state::screen_update_supracan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // treat the sprites as frame-buffered and only update the buffer when drawing scanline 0 - this might not be true! @@ -878,7 +878,7 @@ UINT32 supracan_state::screen_update_supracan(screen_device &screen, bitmap_ind1 for (y=cliprect.min_y;y<=cliprect.max_y;y++) { // these will have to change to ADDR32 etc. once alpha blending is supported - UINT16* screen = &bitmap.pix16(y); + uint16_t* screen = &bitmap.pix16(y); int actualy = y&mosaic_mask; @@ -889,7 +889,7 @@ UINT32 supracan_state::screen_update_supracan(screen_device &screen, bitmap_ind1 continue; - UINT16* src = &src_bitmap.pix16((realy)&((ysize*8)-1)); + uint16_t* src = &src_bitmap.pix16((realy)&((ysize*8)-1)); for (x=cliprect.min_x;x<=cliprect.max_x;x++) { @@ -900,7 +900,7 @@ UINT32 supracan_state::screen_update_supracan(screen_device &screen, bitmap_ind1 if (scrollx+x < 0 || scrollx+x > ((xsize*8)-1)) continue; - UINT16 srcpix = src[(realx)&((xsize*8)-1)]; + uint16_t srcpix = src[(realx)&((xsize*8)-1)]; if ((srcpix & transmask) != 0) screen[x] = srcpix; @@ -985,12 +985,12 @@ UINT32 supracan_state::screen_update_supracan(screen_device &screen, bitmap_ind1 { for (int y=cliprect.min_y;y<=cliprect.max_y;y++) { - UINT16* src = &m_sprite_final_bitmap.pix16(y); - UINT16* dst = &bitmap.pix16(y); + uint16_t* src = &m_sprite_final_bitmap.pix16(y); + uint16_t* dst = &bitmap.pix16(y); for (int x=cliprect.min_x;x<=cliprect.max_x;x++) { - UINT16 dat = src[x]; + uint16_t dat = src[x]; if (dat) dst[x] = dat; } } @@ -1000,7 +1000,7 @@ UINT32 supracan_state::screen_update_supracan(screen_device &screen, bitmap_ind1 } -void supracan_state::dma_w(address_space &space, int offset, UINT16 data, UINT16 mem_mask, int ch) +void supracan_state::dma_w(address_space &space, int offset, uint16_t data, uint16_t mem_mask, int ch) { acan_dma_regs_t *acan_dma_regs = &m_acan_dma_regs; address_space &mem = m_maincpu->space(AS_PROGRAM); @@ -1090,7 +1090,7 @@ WRITE16_MEMBER( supracan_state::supracan_pram_w ) #endif // swap address around so that 64x64 tile can be decoded as 8x8 tiles.. -void supracan_state::write_swapped_byte( int offset, UINT8 byte ) +void supracan_state::write_swapped_byte( int offset, uint8_t byte ) { int swapped_offset = BITSWAP32(offset, 31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,2,1,0,6,5,4,3); @@ -1134,7 +1134,7 @@ ADDRESS_MAP_END READ8_MEMBER( supracan_state::_6502_soundmem_r ) { address_space &mem = m_maincpu->space(AS_PROGRAM); - UINT8 data = m_soundram[offset]; + uint8_t data = m_soundram[offset]; switch(offset) { @@ -1386,7 +1386,7 @@ WRITE16_MEMBER( supracan_state::_68k_soundram_w ) READ16_MEMBER( supracan_state::_68k_soundram_r ) { address_space &mem = m_maincpu->space(AS_PROGRAM); - UINT16 val = m_soundram[offset*2 + 0] << 8; + uint16_t val = m_soundram[offset*2 + 0] << 8; val |= m_soundram[offset*2 + 1]; if(offset*2 >= 0x300 && offset*2 < 0x500) @@ -1411,7 +1411,7 @@ READ16_MEMBER( supracan_state::_68k_soundram_r ) READ16_MEMBER( supracan_state::sound_r ) { - UINT16 data = 0; + uint16_t data = 0; switch( offset ) { @@ -1460,7 +1460,7 @@ WRITE16_MEMBER( supracan_state::sound_w ) READ16_MEMBER( supracan_state::video_r ) { address_space &mem = m_maincpu->space(AS_PROGRAM); - UINT16 data = m_video_regs[offset]; + uint16_t data = m_video_regs[offset]; switch(offset) { @@ -1743,7 +1743,7 @@ WRITE16_MEMBER( supracan_state::video_w ) DEVICE_IMAGE_LOAD_MEMBER( supracan_state, supracan_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size > 0x400000) { @@ -1815,11 +1815,11 @@ static const gfx_layout supracan_gfx2bpp = }; -static const UINT32 xtexlayout_xoffset[64] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23, +static const uint32_t xtexlayout_xoffset[64] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23, 24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44, 45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63 }; -static const UINT32 xtexlayout_yoffset[64] = { 0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64,8*64, +static const uint32_t xtexlayout_yoffset[64] = { 0*64,1*64,2*64,3*64,4*64,5*64,6*64,7*64,8*64, 9*64,10*64,11*64,12*64,13*64,14*64,15*64, 16*64,17*64,18*64,19*64,20*64,21*64,22*64,23*64, 24*64,25*64,26*64,27*64,28*64,29*64,30*64,31*64, diff --git a/src/mame/drivers/suprgolf.cpp b/src/mame/drivers/suprgolf.cpp index e6a16f58ae7..eb9d885f285 100644 --- a/src/mame/drivers/suprgolf.cpp +++ b/src/mame/drivers/suprgolf.cpp @@ -44,22 +44,22 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_tilemap; - std::unique_ptr m_paletteram; - std::unique_ptr m_bg_vram; - std::unique_ptr m_bg_fb; - std::unique_ptr m_fg_fb; - UINT8 m_rom_bank; - UINT8 m_bg_bank; - UINT8 m_vreg_bank; - UINT8 m_msm5205next; - UINT8 m_msm_nmi_mask; - UINT8 m_vreg_pen; - UINT8 m_palette_switch; - UINT8 m_bg_vreg_test; - UINT8 m_toggle; + std::unique_ptr m_paletteram; + std::unique_ptr m_bg_vram; + std::unique_ptr m_bg_fb; + std::unique_ptr m_fg_fb; + uint8_t m_rom_bank; + uint8_t m_bg_bank; + uint8_t m_vreg_bank; + uint8_t m_msm5205next; + uint8_t m_msm_nmi_mask; + uint8_t m_vreg_pen; + uint8_t m_palette_switch; + uint8_t m_bg_vreg_test; + uint8_t m_toggle; DECLARE_READ8_MEMBER(videoram_r); DECLARE_WRITE8_MEMBER(videoram_w); @@ -86,7 +86,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); }; TILE_GET_INFO_MEMBER(suprgolf_state::get_tile_info) @@ -103,10 +103,10 @@ TILE_GET_INFO_MEMBER(suprgolf_state::get_tile_info) void suprgolf_state::video_start() { m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(suprgolf_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,32,32 ); - m_paletteram = std::make_unique(0x1000); - m_bg_vram = std::make_unique(0x2000*0x20); - m_bg_fb = std::make_unique(0x2000*0x20); - m_fg_fb = std::make_unique(0x2000*0x20); + m_paletteram = std::make_unique(0x1000); + m_bg_vram = std::make_unique(0x2000*0x20); + m_bg_fb = std::make_unique(0x2000*0x20); + m_fg_fb = std::make_unique(0x2000*0x20); m_tilemap->set_transparent_pen(15); @@ -121,7 +121,7 @@ void suprgolf_state::video_start() save_pointer(NAME(m_fg_fb.get()), 0x2000*0x20); } -UINT32 suprgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t suprgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count,color; bitmap.fill(m_palette->black_pen(), cliprect); @@ -222,8 +222,8 @@ READ8_MEMBER(suprgolf_state::bg_vram_r) WRITE8_MEMBER(suprgolf_state::bg_vram_w) { - UINT8 hi_nibble,lo_nibble; - UINT8 hi_dirty_dot,lo_dirty_dot; // helpers + uint8_t hi_nibble,lo_nibble; + uint8_t hi_dirty_dot,lo_dirty_dot; // helpers hi_nibble = data & 0xf0; lo_nibble = data & 0x0f; @@ -314,7 +314,7 @@ WRITE8_MEMBER(suprgolf_state::rom2_bank_select_w) READ8_MEMBER(suprgolf_state::pedal_extra_bits_r) { - UINT8 p1_sht_sw,p2_sht_sw; + uint8_t p1_sht_sw,p2_sht_sw; p1_sht_sw = (ioport("P1_RELEASE")->read() & 0x80)>>7; p2_sht_sw = (ioport("P2_RELEASE")->read() & 0x80)>>6; @@ -629,7 +629,7 @@ ROM_END DRIVER_INIT_MEMBER(suprgolf_state,suprgolf) { - UINT8 *ROM = memregion("user2")->base(); + uint8_t *ROM = memregion("user2")->base(); ROM[0x74f4-0x4000] = 0x00; ROM[0x74f5-0x4000] = 0x00; diff --git a/src/mame/drivers/suprloco.cpp b/src/mame/drivers/suprloco.cpp index a6c4b414340..89c53cda56c 100644 --- a/src/mame/drivers/suprloco.cpp +++ b/src/mame/drivers/suprloco.cpp @@ -272,7 +272,7 @@ DRIVER_INIT_MEMBER(suprloco_state,suprloco) /* convert graphics to 4bpp from 3bpp */ int i, j, k, color_source, color_dest; - UINT8 *source, *dest, *lookup; + uint8_t *source, *dest, *lookup; source = memregion("gfx1")->base(); dest = source + 0x6000; diff --git a/src/mame/drivers/suprnova.cpp b/src/mame/drivers/suprnova.cpp index 326b3ae3bb9..ba70e1ef641 100644 --- a/src/mame/drivers/suprnova.cpp +++ b/src/mame/drivers/suprnova.cpp @@ -154,7 +154,7 @@ NEP-16 #include "includes/suprnova.h" #include "machine/msm6242.h" -static void hit_calc_orig(UINT16 p, UINT16 s, UINT16 org, UINT16 *l, UINT16 *r) +static void hit_calc_orig(uint16_t p, uint16_t s, uint16_t org, uint16_t *l, uint16_t *r) { switch(org & 3) { case 0: @@ -176,11 +176,11 @@ static void hit_calc_orig(UINT16 p, UINT16 s, UINT16 org, UINT16 *l, UINT16 *r) } } -static void hit_calc_axis(UINT16 x1p, UINT16 x1s, UINT16 x2p, UINT16 x2s, UINT16 org, - UINT16 *x1_p1, UINT16 *x1_p2, UINT16 *x2_p1, UINT16 *x2_p2, - INT16 *x_in, UINT16 *x1tox2) +static void hit_calc_axis(uint16_t x1p, uint16_t x1s, uint16_t x2p, uint16_t x2s, uint16_t org, + uint16_t *x1_p1, uint16_t *x1_p2, uint16_t *x2_p1, uint16_t *x2_p2, + int16_t *x_in, uint16_t *x1tox2) { - UINT16 x1l=0, x1r=0, x2l=0, x2r=0; + uint16_t x1l=0, x1r=0, x2l=0, x2r=0; hit_calc_orig(x1p, x1s, org, &x1l, &x1r); hit_calc_orig(x2p, x2s, org >> 8, &x2l, &x2r); @@ -227,7 +227,7 @@ void skns_state::hit_recalc() } WRITE32_MEMBER(skns_state::hit_w) -//void hit_w(UINT32 adr, UINT32 data, int type) +//void hit_w(uint32_t adr, uint32_t data, int type) { hit_t &hit = m_hit; int adr = offset * 4; @@ -325,7 +325,7 @@ WRITE32_MEMBER(skns_state::hit2_w) READ32_MEMBER(skns_state::hit_r) -//UINT32 hit_r(UINT32 adr, int type) +//uint32_t hit_r(uint32_t adr, int type) { hit_t &hit = m_hit; int adr = offset *4; @@ -337,15 +337,15 @@ READ32_MEMBER(skns_state::hit_r) switch(adr) { case 0x28: case 0x2a: - return (UINT16)machine().rand(); + return (uint16_t)machine().rand(); case 0x00: case 0x10: - return (UINT16)hit.x_in; + return (uint16_t)hit.x_in; case 0x04: case 0x14: - return (UINT16)hit.y_in; + return (uint16_t)hit.y_in; case 0x18: - return (UINT16)hit.z_in; + return (uint16_t)hit.z_in; case 0x08: case 0x1c: return hit.flag; @@ -991,7 +991,7 @@ void skns_state::init_drc() m_maincpu->sh2drc_add_fastram(0x02600000, 0x02607fff, 0, &m_v3slc_ram[0]); } -void skns_state::set_drc_pcflush(UINT32 addr) +void skns_state::set_drc_pcflush(uint32_t addr) { m_maincpu->sh2drc_add_pcflush(addr); } diff --git a/src/mame/drivers/suprridr.cpp b/src/mame/drivers/suprridr.cpp index 6940aae0ff6..c6693b017c4 100644 --- a/src/mame/drivers/suprridr.cpp +++ b/src/mame/drivers/suprridr.cpp @@ -232,7 +232,7 @@ ADDRESS_MAP_END CUSTOM_INPUT_MEMBER(suprridr_state::control_r) { - UINT32 ret; + uint32_t ret; /* screen flip multiplexes controls */ if (is_screen_flipped()) diff --git a/src/mame/drivers/sv8000.cpp b/src/mame/drivers/sv8000.cpp index 6baf78e2896..4c45c6aed9e 100644 --- a/src/mame/drivers/sv8000.cpp +++ b/src/mame/drivers/sv8000.cpp @@ -72,23 +72,23 @@ private: required_device m_maincpu; required_device m_s68047p; required_device m_cart; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_ioport m_io_row0; required_ioport m_io_row1; required_ioport m_io_row2; required_ioport m_io_joy; - UINT8 m_column; + uint8_t m_column; // graphics signals - UINT8 m_ag; - UINT8 m_gm2; - UINT8 m_gm1; - UINT8 m_gm0; - UINT8 m_as; - UINT8 m_css; - UINT8 m_intext; - UINT8 m_inv; + uint8_t m_ag; + uint8_t m_gm2; + uint8_t m_gm1; + uint8_t m_gm0; + uint8_t m_as; + uint8_t m_css; + uint8_t m_intext; + uint8_t m_inv; }; @@ -196,7 +196,7 @@ void sv8000_state::machine_reset() DEVICE_IMAGE_LOAD_MEMBER( sv8000_state, cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size != 0x1000) { @@ -226,7 +226,7 @@ WRITE8_MEMBER( sv8000_state::i8255_porta_w ) READ8_MEMBER( sv8000_state::i8255_portb_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; //logerror("i8255_portb_r\n"); @@ -268,7 +268,7 @@ WRITE8_MEMBER( sv8000_state::i8255_portc_w ) READ8_MEMBER( sv8000_state::ay_port_a_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; //logerror("ay_port_a_r\n"); return data; @@ -277,7 +277,7 @@ READ8_MEMBER( sv8000_state::ay_port_a_r ) READ8_MEMBER( sv8000_state::ay_port_b_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; //logerror("ay_port_b_r\n"); return data; @@ -358,7 +358,7 @@ READ8_MEMBER( sv8000_state::mc6847_videoram_r ) } // Standard text - UINT8 data = m_videoram[offset % 0xc00]; + uint8_t data = m_videoram[offset % 0xc00]; if (!data) data = 0x20; //bodge m_s68047p->inv_w((data & 0x80) ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/svi318.cpp b/src/mame/drivers/svi318.cpp index e3085d278d2..c50e17c618b 100644 --- a/src/mame/drivers/svi318.cpp +++ b/src/mame/drivers/svi318.cpp @@ -113,7 +113,7 @@ private: int m_rom3; int m_ctrl1; - UINT8 m_keyboard_row; + uint8_t m_keyboard_row; }; @@ -363,7 +363,7 @@ READ8_MEMBER( svi3x8_state::mreq_r ) if (CCS1 || CCS2 || CCS3 || CCS4) return m_cart_rom->read_rom(space, offset); - UINT8 data = m_expander->mreq_r(space, offset); + uint8_t data = m_expander->mreq_r(space, offset); if (ROMCS) data = m_basic->u8(offset); @@ -415,7 +415,7 @@ WRITE8_MEMBER( svi3x8_state::bank_w ) READ8_MEMBER( svi3x8_state::ppi_port_a_r ) { - UINT8 data = 0x3f; + uint8_t data = 0x3f; // bit 0-3, paddle or tablet input @@ -500,7 +500,7 @@ WRITE8_MEMBER( svi3x8_state::excs_w ) DEVICE_IMAGE_LOAD_MEMBER( svi3x8_state, cartridge ) { - UINT32 size = m_cart_rom->common_get_size("rom"); + uint32_t size = m_cart_rom->common_get_size("rom"); m_cart_rom->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); m_cart_rom->common_load_rom(m_cart_rom->get_rom_base(), size, "rom"); diff --git a/src/mame/drivers/svision.cpp b/src/mame/drivers/svision.cpp index 8be1e6ad019..422b620c286 100644 --- a/src/mame/drivers/svision.cpp +++ b/src/mame/drivers/svision.cpp @@ -232,7 +232,7 @@ WRITE8_MEMBER(svision_state::tvlink_w) svision_w(space, offset,data); if (offset >= 0x800 && offset < 0x840) { - UINT16 c; + uint16_t c; if (offset == 0x803 && data == 0x07) { /* tron hack */ @@ -367,19 +367,19 @@ PALETTE_INIT_MEMBER(svision_state,svisionp) palette.set_pen_color(i, svisionp_palette[i*3], svisionp_palette[i*3+1], svisionp_palette[i*3+2]); } -UINT32 svision_state::screen_update_svision(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t svision_state::screen_update_svision(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, i, j=XPOS/4+YPOS*0x30; - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; if (BANK&8) { for (y=0; y<160; y++) { - UINT16 *line = &bitmap.pix16(y, 3 - (XPOS & 3)); + uint16_t *line = &bitmap.pix16(y, 3 - (XPOS & 3)); for (x=3-(XPOS&3),i=0; x<160+3 && x>6)&3)+PALETTE_START; line[2]=((b>>4)&3)+PALETTE_START; line[1]=((b>>2)&3)+PALETTE_START; @@ -398,19 +398,19 @@ UINT32 svision_state::screen_update_svision(screen_device &screen, bitmap_ind16 return 0; } -UINT32 svision_state::screen_update_tvlink(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t svision_state::screen_update_tvlink(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x, y, i, j = XPOS/4+YPOS*0x30; - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; if (BANK & 8) { for (y = 0; y < 160; y++) { - UINT32 *line = &bitmap.pix32(y, 3 - (XPOS & 3)); + uint32_t *line = &bitmap.pix32(y, 3 - (XPOS & 3)); for (x = 3 - (XPOS & 3), i = 0; x < 160 + 3 && x < XSIZE + 3; x += 4, i++) { - UINT8 b=videoram[j+i]; + uint8_t b=videoram[j+i]; line[3]=m_tvlink.palette[(b>>6)&3]; line[2]=m_tvlink.palette[(b>>4)&3]; line[1]=m_tvlink.palette[(b>>2)&3]; @@ -454,7 +454,7 @@ DRIVER_INIT_MEMBER(svision_state, svisions) DEVICE_IMAGE_LOAD_MEMBER( svision_state, svision_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size > 0x80000) { diff --git a/src/mame/drivers/svmu.cpp b/src/mame/drivers/svmu.cpp index aa0acb2c533..adb16ad8f1a 100644 --- a/src/mame/drivers/svmu.cpp +++ b/src/mame/drivers/svmu.cpp @@ -37,7 +37,7 @@ public: required_device m_maincpu; required_device m_flash; required_device m_speaker; - required_region_ptr m_bios; + required_region_ptr m_bios; DECLARE_PALETTE_INIT(svmu); virtual void machine_reset() override; @@ -51,7 +51,7 @@ public: DECLARE_QUICKLOAD_LOAD_MEMBER( svmu ); private: - UINT8 m_page; + uint8_t m_page; }; @@ -183,12 +183,12 @@ static LC8670_LCD_UPDATE( svmu_lcd_update ) } -inline void vmufat_write_byte(UINT8* flash, UINT8 block, offs_t offset, UINT8 data) +inline void vmufat_write_byte(uint8_t* flash, uint8_t block, offs_t offset, uint8_t data) { flash[(block * 512) + offset] = data; } -inline void vmufat_write_word(UINT8* flash, UINT8 block, offs_t offset, UINT16 data) +inline void vmufat_write_word(uint8_t* flash, uint8_t block, offs_t offset, uint16_t data) { // 16-bit data are stored in little endian flash[(block * 512) + offset + 0] = data & 0xff; @@ -197,8 +197,8 @@ inline void vmufat_write_word(UINT8* flash, UINT8 block, offs_t offset, UINT16 d QUICKLOAD_LOAD_MEMBER( svmu_state, svmu ) { - UINT32 size = image.length(); - UINT8 *flash = m_flash->base(); + uint32_t size = image.length(); + uint8_t *flash = m_flash->base(); image.fread(flash, size); diff --git a/src/mame/drivers/swtpc.cpp b/src/mame/drivers/swtpc.cpp index f36476d6a62..43a6743ea61 100644 --- a/src/mame/drivers/swtpc.cpp +++ b/src/mame/drivers/swtpc.cpp @@ -62,7 +62,7 @@ public: DECLARE_READ8_MEMBER(swtpc_terminal_r); DECLARE_READ8_MEMBER(swtpc_tricky_r); DECLARE_WRITE8_MEMBER(kbd_put); - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; }; @@ -74,14 +74,14 @@ READ8_MEMBER( swtpc_state::swtpc_status_r ) READ8_MEMBER( swtpc_state::swtpc_terminal_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } READ8_MEMBER( swtpc_state::swtpc_tricky_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; return ret; } diff --git a/src/mame/drivers/swyft.cpp b/src/mame/drivers/swyft.cpp index 4def11ebd27..a1da07c95e8 100644 --- a/src/mame/drivers/swyft.cpp +++ b/src/mame/drivers/swyft.cpp @@ -323,7 +323,7 @@ public: required_device m_via0; // only swyft uses this required_device m_via1; // only swyft uses this optional_device m_speaker; - required_shared_ptr m_p_swyft_videoram; + required_shared_ptr m_p_swyft_videoram; /*optional_ioport m_y0; optional_ioport m_y1; optional_ioport m_y2; @@ -337,7 +337,7 @@ public: DECLARE_MACHINE_RESET(swyft); DECLARE_VIDEO_START(swyft); - UINT32 screen_update_swyft(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_swyft(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(swyft_d0000); @@ -374,8 +374,8 @@ public: The watchdog counter and the 6ms counter are both incremented every time the KTOBF pulses. */ - UINT8 m_keyboard_line; - UINT8 m_floppy_control; + uint8_t m_keyboard_line; + uint8_t m_floppy_control; //protected: //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); @@ -598,9 +598,9 @@ VIDEO_START_MEMBER(swyft_state,swyft) { } -UINT32 swyft_state::screen_update_swyft(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t swyft_state::screen_update_swyft(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 code; + uint16_t code; int y, x, b; int addr = 0; @@ -622,7 +622,7 @@ UINT32 swyft_state::screen_update_swyft(screen_device &screen, bitmap_ind16 &bit READ8_MEMBER( swyft_state::swyft_d0000 ) { // wtf is this supposed to be? - UINT8 byte = 0xFF; // ? + uint8_t byte = 0xFF; // ? logerror("mystery device: read from 0x%5X, returning %02X\n", offset+0xD0000, byte); return byte; } @@ -639,7 +639,7 @@ static const char *const swyft_via_regnames[] = { "0: ORB/IRB", "1: ORA/IRA", "2 READ8_MEMBER( swyft_state::swyft_via0_r ) { if (offset&0x000C3F) fprintf(stderr,"VIA0: read from invalid offset in 68k space: %06X!\n", offset); - UINT8 data = m_via0->read(space, (offset>>6)&0xF); + uint8_t data = m_via0->read(space, (offset>>6)&0xF); #ifdef DEBUG_SWYFT_VIA0 logerror("VIA0 register %s read by cpu: returning %02x\n", swyft_via_regnames[(offset>>5)&0xF], data); #endif @@ -658,7 +658,7 @@ WRITE8_MEMBER( swyft_state::swyft_via0_w ) READ8_MEMBER( swyft_state::swyft_via1_r ) { if (offset&0x000C3F) fprintf(stderr," VIA1: read from invalid offset in 68k space: %06X!\n", offset); - UINT8 data = m_via1->read(space, (offset>>6)&0xF); + uint8_t data = m_via1->read(space, (offset>>6)&0xF); #ifdef DEBUG_SWYFT_VIA1 logerror(" VIA1 register %s read by cpu: returning %02x\n", swyft_via_regnames[(offset>>5)&0xF], data); #endif diff --git a/src/mame/drivers/sym1.cpp b/src/mame/drivers/sym1.cpp index ab69b9733dc..e2fffd8ee1c 100644 --- a/src/mame/drivers/sym1.cpp +++ b/src/mame/drivers/sym1.cpp @@ -49,13 +49,13 @@ public: m_row3(*this, "ROW-3"), m_wp(*this, "WP") { } - required_shared_ptr m_ram_1k; - required_shared_ptr m_ram_2k; - required_shared_ptr m_ram_3k; - required_shared_ptr m_monitor; - required_shared_ptr m_riot_ram; - UINT8 m_riot_port_a; - UINT8 m_riot_port_b; + required_shared_ptr m_ram_1k; + required_shared_ptr m_ram_2k; + required_shared_ptr m_ram_3k; + required_shared_ptr m_monitor; + required_shared_ptr m_riot_ram; + uint8_t m_riot_port_a; + uint8_t m_riot_port_b; emu_timer *m_led_update; DECLARE_DRIVER_INIT(sym1); virtual void machine_reset() override; diff --git a/src/mame/drivers/symbolics.cpp b/src/mame/drivers/symbolics.cpp index 3071f36f1f4..717969f81f9 100644 --- a/src/mame/drivers/symbolics.cpp +++ b/src/mame/drivers/symbolics.cpp @@ -105,7 +105,7 @@ READ16_MEMBER(symbolics_state::fep_paddle_id_prom_r) // bits 8 and 9 do somethin /* READ16_MEMBER(symbolics_state::ram_parity_hack_r) { - UINT16 *ram = (UINT16 *)(memregion("fepdram")->base()); + uint16_t *ram = (uint16_t *)(memregion("fepdram")->base()); //m_maincpu->set_input_line(M68K_IRQ_7, CLEAR_LINE); m_maincpu->set_input_line_and_vector(M68K_IRQ_7, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); if (!(m_parity_error_has_occurred[offset])) @@ -120,7 +120,7 @@ READ16_MEMBER(symbolics_state::ram_parity_hack_r) WRITE16_MEMBER(symbolics_state::ram_parity_hack_w) { - UINT16 *ram = (UINT16 *)(memregion("fepdram")->base()); + uint16_t *ram = (uint16_t *)(memregion("fepdram")->base()); m_maincpu->set_input_line_and_vector(M68K_IRQ_7, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR); if (!(m_parity_error_has_occurred[offset])) { @@ -270,7 +270,7 @@ INPUT_PORTS_END TIMER_CALLBACK_MEMBER(symbolics_state::outfifo_read_cb) { - UINT16 data; + uint16_t data; } */ diff --git a/src/mame/drivers/sys2900.cpp b/src/mame/drivers/sys2900.cpp index 01192b40379..c5a5c8ec001 100644 --- a/src/mame/drivers/sys2900.cpp +++ b/src/mame/drivers/sys2900.cpp @@ -54,7 +54,7 @@ public: DECLARE_DRIVER_INIT(sys2900); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_sys2900(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sys2900(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; protected: @@ -101,7 +101,7 @@ void sys2900_state::machine_reset() DRIVER_INIT_MEMBER(sys2900_state,sys2900) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xf000); } @@ -109,7 +109,7 @@ void sys2900_state::video_start() { } -UINT32 sys2900_state::screen_update_sys2900(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sys2900_state::screen_update_sys2900(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/systec.cpp b/src/mame/drivers/systec.cpp index de504cfa90e..502ad4296e7 100644 --- a/src/mame/drivers/systec.cpp +++ b/src/mame/drivers/systec.cpp @@ -54,13 +54,13 @@ public: DECLARE_READ8_MEMBER(systec_c4_r); DECLARE_READ8_MEMBER(systec_c6_r); DECLARE_WRITE8_MEMBER( kbd_put ); - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; }; READ8_MEMBER( systec_state::systec_c4_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -92,8 +92,8 @@ INPUT_PORTS_END void systec_state::machine_reset() { - UINT8 *m_p_maincpu = memregion("maincpu")->base(); - UINT8 *m_p_roms = memregion("roms")->base(); + uint8_t *m_p_maincpu = memregion("maincpu")->base(); + uint8_t *m_p_roms = memregion("roms")->base(); memcpy(m_p_maincpu, m_p_roms, 0x2000); } diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp index 5eebb7b7c59..18724cfffb0 100644 --- a/src/mame/drivers/system1.cpp +++ b/src/mame/drivers/system1.cpp @@ -250,7 +250,7 @@ seem to have access to. each opcode fetch (since the M1 line is low for 2 cycles per byte). */ -static const UINT8 cc_op[0x100] = { +static const uint8_t cc_op[0x100] = { 4*5+1*2,10*5+3*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 8*5+2*2,10*5+3*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2,12*5+2*2,11*5+1*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 7*5+2*2,10*5+3*2,16*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 7*5+2*2,11*5+1*2,16*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, @@ -269,7 +269,7 @@ static const UINT8 cc_op[0x100] = { 5*5+1*2,10*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 6*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 0*5 , 7*5+2*2,11*5+1*2 }; -static const UINT8 cc_cb[0x100] = { +static const uint8_t cc_cb[0x100] = { 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, @@ -288,7 +288,7 @@ static const UINT8 cc_cb[0x100] = { 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2 }; -static const UINT8 cc_ed[0x100] = { +static const uint8_t cc_ed[0x100] = { 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, @@ -307,7 +307,7 @@ static const UINT8 cc_ed[0x100] = { 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2 }; -static const UINT8 cc_xy[0x100] = { +static const uint8_t cc_xy[0x100] = { ( 4+4)*5+2*2,(10+4)*5+4*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(11+4)*5+2*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, ( 8+4)*5+3*2,(10+4)*5+4*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2,(12+4)*5+3*2,(11+4)*5+2*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, ( 7+4)*5+3*2,(10+4)*5+4*2,(16+4)*5+4*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,(16+4)*5+4*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, @@ -326,7 +326,7 @@ static const UINT8 cc_xy[0x100] = { ( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,( 5+4)*5+2*2,( 6+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,( 4 )*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2 }; -static const UINT8 cc_xycb[0x100] = { +static const uint8_t cc_xycb[0x100] = { 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, @@ -346,7 +346,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*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 5*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, /* DJNZ */ 5*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 5*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, 0*5, /* JR NZ/JR Z */ @@ -368,7 +368,7 @@ static const UINT8 cc_ex[0x100] = { void system1_state::machine_start() { - UINT32 numbanks = (m_maincpu_region->bytes() - 0x10000) / 0x4000; + uint32_t numbanks = (m_maincpu_region->bytes() - 0x10000) / 0x4000; if (numbanks > 0) m_bank1->configure_entries(0, numbanks, m_maincpu_region->base() + 0x10000, 0x4000); @@ -414,14 +414,14 @@ void system1_state::machine_reset() * *************************************/ -void system1_state::bank44_custom_w(UINT8 data, UINT8 prevdata) +void system1_state::bank44_custom_w(uint8_t data, uint8_t prevdata) { /* bank bits are bits 6 and 2 */ m_bank1->set_entry(((data & 0x40) >> 5) | ((data & 0x04) >> 2)); } -void system1_state::bank0c_custom_w(UINT8 data, UINT8 prevdata) +void system1_state::bank0c_custom_w(uint8_t data, uint8_t prevdata) { /* bank bits are bits 3 and 2 */ m_bank1->set_entry((data & 0x0c) >> 2); @@ -470,7 +470,7 @@ CUSTOM_INPUT_MEMBER(system1_state::dakkochn_mux_status_r) } -void system1_state::dakkochn_custom_w(UINT8 data, UINT8 prevdata) +void system1_state::dakkochn_custom_w(uint8_t data, uint8_t prevdata) { /* bit 1 toggling on clocks the mux; we store the previous state in the high bit of dakkochn_mux_data */ if ((data & 0x02) && !(prevdata & 0x02)) @@ -491,7 +491,7 @@ void system1_state::dakkochn_custom_w(UINT8 data, UINT8 prevdata) READ8_MEMBER(system1_state::shtngmst_gunx_r) { // x is slightly offset, and has a range of 00-fe - UINT8 x = ioport("GUNX")->read() - 0x12; + uint8_t x = ioport("GUNX")->read() - 0x12; return (x == 0xff) ? 0xfe : x; } @@ -533,7 +533,7 @@ READ8_MEMBER(system1_state::sound_data_r) /* if we have a Z80 PIO, get the data from the port and toggle the strobe */ else if (pio != nullptr) { - UINT8 data = pio->port_read(z80pio_device::PORT_A); + uint8_t data = pio->port_read(z80pio_device::PORT_A); pio->strobe(z80pio_device::PORT_A, false); pio->strobe(z80pio_device::PORT_A, true); return data; @@ -5159,7 +5159,7 @@ DRIVER_INIT_MEMBER(system1_state,myherok) // probably bootleg? int A; - UINT8 *rom; + uint8_t *rom; /* additionally to the usual protection, all the program ROMs have data lines */ /* D0 and D1 swapped. */ @@ -5186,7 +5186,7 @@ DRIVER_INIT_MEMBER(system1_state,myherok) for (A = 0;A < 0xc000;A++) { int A1; - UINT8 temp; + uint8_t temp; A1 = (A & 0xffcf) | ((A & 0x0010) << 1) | ((A & 0x0020) >> 1); if (A < A1) @@ -5220,14 +5220,14 @@ DRIVER_INIT_MEMBER(system1_state,blockgal) DRIVER_INIT_MEMBER(system1_state,wbml) { DRIVER_INIT_CALL(bank0c); - m_banked_decrypted_opcodes = std::make_unique(m_maincpu_region->bytes()); + m_banked_decrypted_opcodes = std::make_unique(m_maincpu_region->bytes()); mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes.get(), memregion("key")->base(), m_maincpu_region->bytes()); } DRIVER_INIT_MEMBER(system1_state,ufosensi) { DRIVER_INIT_CALL(bank0c); - m_banked_decrypted_opcodes = std::make_unique(m_maincpu_region->bytes()); + m_banked_decrypted_opcodes = std::make_unique(m_maincpu_region->bytes()); mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes.get(), memregion("key")->base(), m_maincpu_region->bytes()); } @@ -5236,7 +5236,7 @@ DRIVER_INIT_MEMBER(system1_state,ufosensi) DRIVER_INIT_MEMBER(system1_state,dakkochn) { m_videomode_custom = &system1_state::dakkochn_custom_w; - m_banked_decrypted_opcodes = std::make_unique(m_maincpu_region->bytes()); + m_banked_decrypted_opcodes = std::make_unique(m_maincpu_region->bytes()); mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes.get(), memregion("key")->base(), m_maincpu_region->bytes()); } @@ -5270,7 +5270,7 @@ DRIVER_INIT_MEMBER(system1_state,nobb) /* Patch to get PRG ROMS ('T', 'R' and 'S) status as "GOOD" in the "test mode" */ /* not really needed */ -// UINT8 *ROM = m_maincpu_region->base(); +// uint8_t *ROM = m_maincpu_region->base(); // ROM[0x3296] = 0x18; // 'jr' instead of 'jr z' - 'T' (PRG Main ROM) // ROM[0x32be] = 0x18; // 'jr' instead of 'jr z' - 'R' (Banked ROM 1) @@ -5283,7 +5283,7 @@ DRIVER_INIT_MEMBER(system1_state,nobb) /* Patch to get sound in later levels(the program enters into a tight loop)*/ address_space &iospace = m_maincpu->space(AS_IO); - UINT8 *ROM2 = memregion("soundcpu")->base(); + uint8_t *ROM2 = memregion("soundcpu")->base(); ROM2[0x02f9] = 0x28;//'jr z' instead of 'jr' @@ -5320,7 +5320,7 @@ DRIVER_INIT_MEMBER(system1_state,bootsys2d) DRIVER_INIT_MEMBER(system1_state,choplift) { - UINT8 *mcurom = memregion("mcu")->base(); + uint8_t *mcurom = memregion("mcu")->base(); /* the ROM dump we have is bad; the following patches make it work */ mcurom[0x100] = 0x55; /* D5 in current dump */ diff --git a/src/mame/drivers/system16.cpp b/src/mame/drivers/system16.cpp index ad71ec611a3..fb4bb0c516a 100644 --- a/src/mame/drivers/system16.cpp +++ b/src/mame/drivers/system16.cpp @@ -199,7 +199,7 @@ ADDRESS_MAP_END READ16_MEMBER(segas1x_bootleg_state::passht4b_service_r) { - UINT16 val = ioport("SERVICE")->read(); + uint16_t val = ioport("SERVICE")->read(); if(!(ioport("P1")->read() & 0x40)) val &= 0xef; if(!(ioport("P2")->read() & 0x40)) val &= 0xdf; @@ -375,7 +375,7 @@ READ8_MEMBER(segas1x_bootleg_state::tturfbl_soundbank_r) WRITE8_MEMBER(segas1x_bootleg_state::tturfbl_soundbank_w) { - UINT8 *mem = memregion("soundcpu")->base(); + uint8_t *mem = memregion("soundcpu")->base(); switch(data) { @@ -638,7 +638,7 @@ ADDRESS_MAP_END void segas1x_bootleg_state::datsu_set_pages( ) { - UINT16 page; + uint16_t page; page = ((m_datsu_page[0] & 0x00f0) >>0) | ((m_datsu_page[1] & 0x00f0) >>4) | @@ -770,7 +770,7 @@ WRITE16_MEMBER(segas1x_bootleg_state::goldnaxeb2_bgscrolly_w) WRITE16_MEMBER(segas1x_bootleg_state::goldnaxeb2_fgpage_w) { - UINT16 page; + uint16_t page; COMBINE_DATA(&m_goldnaxeb2_fgpage[offset]); @@ -785,7 +785,7 @@ WRITE16_MEMBER(segas1x_bootleg_state::goldnaxeb2_fgpage_w) WRITE16_MEMBER(segas1x_bootleg_state::goldnaxeb2_bgpage_w) { - UINT16 page; + uint16_t page; COMBINE_DATA(&m_goldnaxeb2_bgpage[offset]); @@ -996,7 +996,7 @@ ADDRESS_MAP_END WRITE8_MEMBER(segas1x_bootleg_state::sys18_soundbank_w) { - UINT8 *mem = memregion("soundcpu")->base(); + uint8_t *mem = memregion("soundcpu")->base(); int rom = (data >> 6) & 3; int bank = (data & 0x3f); int mask = m_sound_info[rom * 2 + 0]; @@ -1160,7 +1160,7 @@ READ8_MEMBER(segas1x_bootleg_state::shdancbl_soundbank_r) WRITE8_MEMBER(segas1x_bootleg_state::shdancbl_bankctrl_w) { - UINT8 *mem = memregion("soundcpu")->base(); + uint8_t *mem = memregion("soundcpu")->base(); switch (data) { @@ -3614,14 +3614,14 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,wb3bbl) DRIVER_INIT_MEMBER(segas1x_bootleg_state,goldnaxeb1) { int i; - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); - UINT8 *KEY = memregion("decryption")->base(); - UINT16 data[0x800]; + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); + uint8_t *KEY = memregion("decryption")->base(); + uint16_t data[0x800]; // the decryption key is in a rom (part of an MSDOS executable...) for (i = 0; i < 0x800; i++) { - UINT8 k = KEY[i] ^ 0xff; + uint8_t k = KEY[i] ^ 0xff; data[i] = ((k & 0x80) << 7) | ((k & 0x40) << 6) | ((k & 0x20) << 5) | ((k & 0x10) << 4) | ((k & 0x08) << 3) | ((k & 0x04) << 2) | ((k & 0x02) << 1) | ((k & 0x01) << 0); } @@ -3650,7 +3650,7 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,bayrouteb1) // decrypt DRIVER_INIT_CALL(goldnaxeb1); - UINT16 *ROM = (UINT16*)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t*)memregion("maincpu")->base(); // patch interrupt vector ROM[0x0070/2] = 0x000b; @@ -3664,7 +3664,7 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,bayrouteb1) DRIVER_INIT_MEMBER(segas1x_bootleg_state,bayrouteb2) { - UINT8 *mem = memregion("soundcpu")->base(); + uint8_t *mem = memregion("soundcpu")->base(); memcpy(mem, mem + 0x10000, 0x8000); @@ -3680,7 +3680,7 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,goldnaxeb2) DRIVER_INIT_MEMBER(segas1x_bootleg_state,tturfbl) { - UINT8 *mem = memregion("soundcpu")->base(); + uint8_t *mem = memregion("soundcpu")->base(); memcpy(mem, mem + 0x10000, 0x8000); @@ -3767,7 +3767,7 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,altbeastbl) /* Tetris-based */ DRIVER_INIT_MEMBER(segas1x_bootleg_state,beautyb) { - UINT16*rom = (UINT16*)memregion( "maincpu" )->base(); + uint16_t*rom = (uint16_t*)memregion( "maincpu" )->base(); int x; for (x = 0; x < 0x8000; x++) @@ -3785,7 +3785,7 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,beautyb) /* Sys18 */ DRIVER_INIT_MEMBER(segas1x_bootleg_state,shdancbl) { - UINT8 *mem = memregion("soundcpu")->base();; + uint8_t *mem = memregion("soundcpu")->base();; /* Copy first 32K of IC45 to Z80 address space */ memcpy(mem, mem + 0x10000, 0x8000); @@ -3799,7 +3799,7 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,shdancbl) DRIVER_INIT_MEMBER(segas1x_bootleg_state,mwalkbl) { - UINT8 *RAM = memregion("soundcpu")->base(); + uint8_t *RAM = memregion("soundcpu")->base(); static const int mwalk_sound_info[] = { 0x0f, 0x00000, // ROM #1 = 128K @@ -3820,7 +3820,7 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,mwalkbl) DRIVER_INIT_MEMBER(segas1x_bootleg_state,astormbl) { - UINT8 *RAM = memregion("soundcpu")->base(); + uint8_t *RAM = memregion("soundcpu")->base(); static const int astormbl_sound_info[] = { 0x0f, 0x00000, // ROM #1 = 128K diff --git a/src/mame/drivers/tail2nos.cpp b/src/mame/drivers/tail2nos.cpp index 8d90d04974e..b86fac04e8e 100644 --- a/src/mame/drivers/tail2nos.cpp +++ b/src/mame/drivers/tail2nos.cpp @@ -178,7 +178,7 @@ GFXDECODE_END void tail2nos_state::machine_start() { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank3")->configure_entries(0, 2, &ROM[0x10000], 0x8000); membank("bank3")->set_entry(0); diff --git a/src/mame/drivers/taito.cpp b/src/mame/drivers/taito.cpp index 80149f34436..1bd08268b01 100644 --- a/src/mame/drivers/taito.cpp +++ b/src/mame/drivers/taito.cpp @@ -73,16 +73,16 @@ public: DECLARE_WRITE_LINE_MEMBER(votrax_request); TIMER_DEVICE_CALLBACK_MEMBER(timer_a); private: - UINT8 m_out_offs; - UINT8 m_sndcmd; - UINT8 m_votrax_cmd; - UINT8 m_io[16]; + uint8_t m_out_offs; + uint8_t m_sndcmd; + uint8_t m_votrax_cmd; + uint8_t m_io[16]; virtual void machine_reset() override; required_device m_maincpu; required_device m_cpu2; required_device m_pia; optional_device m_votrax; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; }; @@ -272,7 +272,7 @@ WRITE8_MEMBER( taito_state::io_w ) if (offset == 2) { - UINT8 cmd = (m_io[2]>>4) | (m_io[3] & 0xf0); + uint8_t cmd = (m_io[2]>>4) | (m_io[3] & 0xf0); if (cmd != m_sndcmd) { m_sndcmd = cmd; @@ -312,10 +312,10 @@ DRIVER_INIT_MEMBER( taito_state, taito ) TIMER_DEVICE_CALLBACK_MEMBER( taito_state::timer_a ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // don't know, 7446 assumed + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0 }; // don't know, 7446 assumed m_out_offs &= 15; - UINT8 digit = m_out_offs << 1; + uint8_t digit = m_out_offs << 1; output().set_digit_value(digit, patterns[m_p_ram[m_out_offs]>>4]); output().set_digit_value(++digit, patterns[m_p_ram[m_out_offs++]&15]); } diff --git a/src/mame/drivers/taito_b.cpp b/src/mame/drivers/taito_b.cpp index 43519a63e72..af00f46deea 100644 --- a/src/mame/drivers/taito_b.cpp +++ b/src/mame/drivers/taito_b.cpp @@ -2747,7 +2747,7 @@ MACHINE_CONFIG_END #if 0 void taitob_state::ryujin_patch(void) { - UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t*)memregion("maincpu")->base(); rom[ 0x62/2 ] = 1; //0 (already in rom) - Taito Corporation 1993 //1 - Taito America corp with blue FBI logo @@ -2812,7 +2812,7 @@ MACHINE_CONFIG_END #if 0 void taitob_state::sbm_patch(void) { - UINT16 *rom = (UINT16*)memregion("maincpu")->base(); + uint16_t *rom = (uint16_t*)memregion("maincpu")->base(); rom[ 0x7ffff/2 ] = 2; //US version } #endif diff --git a/src/mame/drivers/taito_f2.cpp b/src/mame/drivers/taito_f2.cpp index 54dec410de0..aabd6d7326a 100644 --- a/src/mame/drivers/taito_f2.cpp +++ b/src/mame/drivers/taito_f2.cpp @@ -5504,9 +5504,9 @@ ROM_END DRIVER_INIT_MEMBER(taitof2_state,finalb) { int i; - UINT8 data; - UINT32 offset; - UINT8 *gfx = memregion("gfx2")->base(); + uint8_t data; + uint32_t offset; + uint8_t *gfx = memregion("gfx2")->base(); offset = 0x100000; for (i = 0x180000; i < 0x200000; i++) @@ -5540,7 +5540,7 @@ DRIVER_INIT_MEMBER(taitof2_state,cameltry) DRIVER_INIT_MEMBER(taitof2_state,mjnquest) { int i, len = memregion("gfx2")->bytes(); - UINT8 *gfx = memregion("gfx2")->base(); + uint8_t *gfx = memregion("gfx2")->base(); /* the bytes in each longword are in reversed order, put them in the order used by the other games. */ diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp index 72eec9fcdbd..b4f572f28df 100644 --- a/src/mame/drivers/taito_f3.cpp +++ b/src/mame/drivers/taito_f3.cpp @@ -119,8 +119,8 @@ WRITE32_MEMBER(taito_f3_state::f3_sound_reset_1_w) WRITE32_MEMBER(taito_f3_state::f3_sound_bankswitch_w) { if (m_f3_game==KIRAMEKI) { - UINT16 *rom = (UINT16 *)memregion("taito_en:audiocpu")->base(); - UINT32 idx; + uint16_t *rom = (uint16_t *)memregion("taito_en:audiocpu")->base(); + uint32_t idx; idx = (offset << 1) & 0x1e; if (ACCESSING_BITS_0_15) @@ -412,7 +412,7 @@ INTERRUPT_GEN_MEMBER(taito_f3_state::f3_interrupt2) timer_set(downcast(&device)->cycles_to_attotime(10000), TIMER_F3_INTERRUPT3); } -static const UINT16 recalh_eeprom[64] = { +static const uint16_t recalh_eeprom[64] = { 0x8554,0x0000,0x3000,0x0000,0x0000,0x0000,0x0000,0xf335, 0x0001,0x86a0,0x0013,0x0413,0x0000,0xc350,0x0019,0x000a, 0x0000,0x4e20,0x0003,0x180d,0x0000,0x2710,0x0005,0x1418, @@ -3815,9 +3815,9 @@ ROM_END static void tile_decode(running_machine &machine) { - UINT8 lsb,msb; - UINT32 offset,i; - UINT8 *gfx = machine.root_device().memregion("gfx2")->base(); + uint8_t lsb,msb; + uint32_t offset,i; + uint8_t *gfx = machine.root_device().memregion("gfx2")->base(); int size=machine.root_device().memregion("gfx2")->bytes(); int data; @@ -3993,7 +3993,7 @@ WRITE32_MEMBER(taito_f3_state::bubsympb_oki_w) //if (mem_mask==0x000000ff) downcast(device)->write(0,data&0xff); if (ACCESSING_BITS_16_23) { - UINT8 *snd = memregion("oki")->base(); + uint8_t *snd = memregion("oki")->base(); int bank = (data & 0x000f0000) >> 16; // almost certainly wrong memcpy(snd+0x30000, snd+0x80000+0x30000+bank*0x10000, 0x10000); @@ -4013,11 +4013,11 @@ DRIVER_INIT_MEMBER(taito_f3_state,bubsympb) /* expand gfx rom */ { int i; - UINT8 *gfx = memregion("gfx2")->base(); + uint8_t *gfx = memregion("gfx2")->base(); for (i=0x200000;i<0x400000; i+=4) { - UINT8 byte = gfx[i]; + uint8_t byte = gfx[i]; gfx[i+0] = (byte & 0x80)? 1<<4 : 0<<4; gfx[i+0]|= (byte & 0x40)? 1<<0 : 0<<0; gfx[i+1] = (byte & 0x20)? 1<<4 : 0<<4; @@ -4060,7 +4060,7 @@ DRIVER_INIT_MEMBER(taito_f3_state,landmakr) DRIVER_INIT_MEMBER(taito_f3_state,landmkrp) { - UINT32 *RAM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *RAM = (uint32_t *)memregion("maincpu")->base(); /* For some reason the least significant byte in the last 2 long words of ROM is swapped. As the roms have been verified ok, I assume this is some @@ -4103,7 +4103,7 @@ DRIVER_INIT_MEMBER(taito_f3_state,pbobbl2p) // which eventually causes the game to crash // -- protection check?? or some kind of checksum fail? - UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); + uint32_t *ROM = (uint32_t *)memregion("maincpu")->base(); /* protection? */ ROM[0x40090/4]=0x00004e71|(ROM[0x40090/4]&0xffff0000); diff --git a/src/mame/drivers/taito_h.cpp b/src/mame/drivers/taito_h.cpp index 90d59515896..9a2c1932e7e 100644 --- a/src/mame/drivers/taito_h.cpp +++ b/src/mame/drivers/taito_h.cpp @@ -166,7 +166,7 @@ READ8_MEMBER(taitoh_state::syvalion_input_bypass_r) { /* Bypass TC0220IOC controller for analog input */ - UINT8 port = m_tc0220ioc->port_r(space, 0); /* read port number */ + uint8_t port = m_tc0220ioc->port_r(space, 0); /* read port number */ switch( port ) { diff --git a/src/mame/drivers/taito_l.cpp b/src/mame/drivers/taito_l.cpp index a3feb5c5e8f..b349d853679 100644 --- a/src/mame/drivers/taito_l.cpp +++ b/src/mame/drivers/taito_l.cpp @@ -68,7 +68,7 @@ static const char * const bankname[] = { "bank2", "bank3", "bank4", "bank5" }; static const struct { void (taitol_state::*notifier)(int); - UINT32 offset; + uint32_t offset; } rambank_modify_notifiers[12] = { { &taitol_state::taitol_chardef14_m, 0x0000 }, // 14 @@ -90,9 +90,9 @@ static const struct void taitol_state::palette_notifier(int addr) { - UINT8 *p = m_palette_ram + (addr & ~1); - UINT8 byte0 = *p++; - UINT8 byte1 = *p; + uint8_t *p = m_palette_ram + (addr & ~1); + uint8_t byte0 = *p++; + uint8_t byte1 = *p; // addr &= 0x1ff; @@ -107,7 +107,7 @@ void taitol_state::palette_notifier(int addr) } } -static const UINT8 puzznic_mcu_reply[] = { 0x50, 0x1f, 0xb6, 0xba, 0x06, 0x03, 0x47, 0x05, 0x00 }; +static const uint8_t puzznic_mcu_reply[] = { 0x50, 0x1f, 0xb6, 0xba, 0x06, 0x03, 0x47, 0x05, 0x00 }; void taitol_state::state_register( ) { @@ -421,7 +421,7 @@ READ8_MEMBER(taitol_state::rambankswitch_r) return m_cur_rambank[offset]; } -void taitol_state::bank_w(address_space &space, offs_t offset, UINT8 data, int banknum ) +void taitol_state::bank_w(address_space &space, offs_t offset, uint8_t data, int banknum ) { if (m_current_base[banknum][offset] != data) { @@ -702,7 +702,7 @@ ADDRESS_MAP_END WRITE8_MEMBER(taitol_state::sound_bankswitch_w) { - UINT8 *RAM = memregion("audiocpu")->base(); + uint8_t *RAM = memregion("audiocpu")->base(); int banknum = data & 0x03; membank ("bank7")->set_base (&RAM [(banknum * 0x4000)]); @@ -1715,7 +1715,7 @@ WRITE8_MEMBER(taitol_state::portA_w) if (m_cur_bank != (data & 0x03)) { int bankaddress; - UINT8 *RAM = memregion("audiocpu")->base(); + uint8_t *RAM = memregion("audiocpu")->base(); m_cur_bank = data & 0x03; bankaddress = m_cur_bank * 0x4000; @@ -2561,8 +2561,8 @@ ROM_END // bits 7..0 => bits 0..7 DRIVER_INIT_MEMBER(taitol_state,plottinga) { - UINT8 tab[256]; - UINT8 *p; + uint8_t tab[256]; + uint8_t *p; int i; for (i = 0; i < 256; i++) diff --git a/src/mame/drivers/taito_z.cpp b/src/mame/drivers/taito_z.cpp index 9ac3352f681..85ac739a5a0 100644 --- a/src/mame/drivers/taito_z.cpp +++ b/src/mame/drivers/taito_z.cpp @@ -1055,7 +1055,7 @@ INTERRUPT_GEN_MEMBER(taitoz_state::sci_interrupt) EEPROM ******************************************************************/ -static const UINT16 spacegun_default_eeprom[64]= +static const uint16_t spacegun_default_eeprom[64]= { 0x0000,0x00ff,0x0001,0x4141,0x0000,0x00ff,0x0000,0xf0f0, 0x0000,0x00ff,0x0001,0x4141,0x0000,0x00ff,0x0000,0xf0f0, @@ -1103,7 +1103,7 @@ WRITE16_MEMBER(taitoz_state::spacegun_output_bypass_w) CUSTOM_INPUT_MEMBER(taitoz_state::taitoz_pedal_r) { - static const UINT8 retval[8] = { 0,1,3,2,6,7,5,4 }; + static const uint8_t retval[8] = { 0,1,3,2,6,7,5,4 }; ioport_port *port = ioport((const char *)param); return retval[port != nullptr ? port->read() & 7 : 0]; } @@ -1113,8 +1113,8 @@ READ8_MEMBER(taitoz_state::contcirc_input_bypass_r) { /* Bypass TC0220IOC controller for analog input */ - UINT8 port = m_tc0220ioc->port_r(space, 0); /* read port number */ - UINT16 steer = 0xff80 + m_steer.read_safe(0x80); + uint8_t port = m_tc0220ioc->port_r(space, 0); /* read port number */ + uint16_t steer = 0xff80 + m_steer.read_safe(0x80); switch (port) { @@ -1134,8 +1134,8 @@ READ8_MEMBER(taitoz_state::chasehq_input_bypass_r) { /* Bypass TC0220IOC controller for extra inputs */ - UINT8 port = m_tc0220ioc->port_r(space, 0); /* read port number */ - UINT16 steer = 0xff80 + m_steer.read_safe(0x80); + uint8_t port = m_tc0220ioc->port_r(space, 0); /* read port number */ + uint16_t steer = 0xff80 + m_steer.read_safe(0x80); switch (port) { @@ -1222,7 +1222,7 @@ WRITE16_MEMBER(taitoz_state::bshark_stick_w) READ16_MEMBER(taitoz_state::sci_steer_input_r) { - UINT16 steer = 0xff80 + m_steer.read_safe(0x80); + uint16_t steer = 0xff80 + m_steer.read_safe(0x80); switch (offset) { @@ -1293,7 +1293,7 @@ WRITE16_MEMBER(taitoz_state::spacegun_gun_output_w) READ16_MEMBER(taitoz_state::dblaxle_steer_input_r) { - UINT16 steer = 0xff80 + m_steer.read_safe(0x80); + uint16_t steer = 0xff80 + m_steer.read_safe(0x80); switch (offset) { diff --git a/src/mame/drivers/taitoair.cpp b/src/mame/drivers/taitoair.cpp index 74b6eef6ef9..98d84752749 100644 --- a/src/mame/drivers/taitoair.cpp +++ b/src/mame/drivers/taitoair.cpp @@ -272,7 +272,7 @@ WRITE16_MEMBER(taitoair_state::airsys_paletteram16_w)/* xxBBBBxRRRRxGGGG */ WRITE16_MEMBER(taitoair_state::airsys_gradram_w) { - UINT32 pen; + uint32_t pen; int r,g,b; //int pal_r,pal_g,pal_b; @@ -436,7 +436,7 @@ WRITE16_MEMBER(taitoair_state::dsp_test_z_w) READ16_MEMBER(taitoair_state::dsp_test_point_r) { - UINT16 r = 0; + uint16_t r = 0; if(m_dsp_test_x < -m_dsp_test_z) r |= 1; if(m_dsp_test_x > m_dsp_test_z) diff --git a/src/mame/drivers/taitogn.cpp b/src/mame/drivers/taitogn.cpp index 7683377424f..202f3badb16 100644 --- a/src/mame/drivers/taitogn.cpp +++ b/src/mame/drivers/taitogn.cpp @@ -410,14 +410,14 @@ private: required_device m_sndflash2; bool m_has_zoom; - UINT8 m_control; - UINT16 m_control2; - UINT8 m_control3; + uint8_t m_control; + uint16_t m_control2; + uint8_t m_control3; int m_v; - UINT8 m_n_znsecsel; + uint8_t m_n_znsecsel; - UINT8 m_coin_info; + uint8_t m_coin_info; int m_cat702_1_dataout; int m_cat702_2_dataout; diff --git a/src/mame/drivers/taitojc.cpp b/src/mame/drivers/taitojc.cpp index 66c931cf112..8a0187f3935 100644 --- a/src/mame/drivers/taitojc.cpp +++ b/src/mame/drivers/taitojc.cpp @@ -843,7 +843,7 @@ READ16_MEMBER(taitojc_state::dsp_math_unk_r) READ16_MEMBER(taitojc_state::dsp_rom_r) { assert (m_dsp_rom_pos < 0x800000); // never happens - return ((UINT16*)m_gfx2->base())[m_dsp_rom_pos++]; + return ((uint16_t*)m_gfx2->base())[m_dsp_rom_pos++]; } WRITE16_MEMBER(taitojc_state::dsp_rom_w) diff --git a/src/mame/drivers/taitopjc.cpp b/src/mame/drivers/taitopjc.cpp index 5eb1eb2d94e..022d5a1fee5 100644 --- a/src/mame/drivers/taitopjc.cpp +++ b/src/mame/drivers/taitopjc.cpp @@ -137,10 +137,10 @@ public: DECLARE_WRITE16_MEMBER(dsp_romh_w); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_taitopjc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitopjc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(taitopjc_vbi); - UINT32 videochip_r(offs_t address); - void videochip_w(offs_t address, UINT32 data); + uint32_t videochip_r(offs_t address); + void videochip_w(offs_t address, uint32_t data); void video_exit(); void print_display_list(); TILE_GET_INFO_MEMBER(tile_get_info); @@ -149,17 +149,17 @@ public: DECLARE_DRIVER_INIT(optiger); - UINT16 m_dsp_ram[0x1000]; - UINT16 m_io_share_ram[0x2000]; + uint16_t m_dsp_ram[0x1000]; + uint16_t m_io_share_ram[0x2000]; - std::unique_ptr m_screen_ram; - std::unique_ptr m_pal_ram; + std::unique_ptr m_screen_ram; + std::unique_ptr m_pal_ram; tilemap_t *m_tilemap[2]; - UINT32 m_video_address; + uint32_t m_video_address; - UINT32 m_dsp_rom_address; + uint32_t m_dsp_rom_address; }; void taitopjc_state::video_exit() @@ -171,20 +171,20 @@ void taitopjc_state::video_exit() file = fopen("pjc_screen_ram.bin","wb"); for (i=0; i < 0x40000; i++) { - fputc((UINT8)(m_screen_ram[i] >> 24), file); - fputc((UINT8)(m_screen_ram[i] >> 16), file); - fputc((UINT8)(m_screen_ram[i] >> 8), file); - fputc((UINT8)(m_screen_ram[i] >> 0), file); + fputc((uint8_t)(m_screen_ram[i] >> 24), file); + fputc((uint8_t)(m_screen_ram[i] >> 16), file); + fputc((uint8_t)(m_screen_ram[i] >> 8), file); + fputc((uint8_t)(m_screen_ram[i] >> 0), file); } fclose(file); file = fopen("pjc_pal_ram.bin","wb"); for (i=0; i < 0x8000; i++) { - fputc((UINT8)(m_pal_ram[i] >> 24), file); - fputc((UINT8)(m_pal_ram[i] >> 16), file); - fputc((UINT8)(m_pal_ram[i] >> 8), file); - fputc((UINT8)(m_pal_ram[i] >> 0), file); + fputc((uint8_t)(m_pal_ram[i] >> 24), file); + fputc((uint8_t)(m_pal_ram[i] >> 16), file); + fputc((uint8_t)(m_pal_ram[i] >> 8), file); + fputc((uint8_t)(m_pal_ram[i] >> 0), file); } fclose(file); #endif @@ -192,7 +192,7 @@ void taitopjc_state::video_exit() TILE_GET_INFO_MEMBER(taitopjc_state::tile_get_info) { - UINT32 val = m_screen_ram[0x3f000 + (tile_index/2)]; + uint32_t val = m_screen_ram[0x3f000 + (tile_index/2)]; if (!(tile_index & 1)) val >>= 16; @@ -229,20 +229,20 @@ void taitopjc_state::video_start() 8*256 }; - m_screen_ram = std::make_unique(0x40000); - m_pal_ram = std::make_unique(0x8000); + m_screen_ram = std::make_unique(0x40000); + m_pal_ram = std::make_unique(0x8000); m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(taitopjc_state::tile_get_info),this), tilemap_mapper_delegate(FUNC(taitopjc_state::tile_scan_layer0),this), 16, 16, 32, 32); m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(taitopjc_state::tile_get_info),this), tilemap_mapper_delegate(FUNC(taitopjc_state::tile_scan_layer1),this), 16, 16, 32, 32); m_tilemap[0]->set_transparent_pen(0); m_tilemap[1]->set_transparent_pen(1); - m_gfxdecode->set_gfx(0, std::make_unique(*m_palette, char_layout, (UINT8*)m_screen_ram.get(), 0, m_palette->entries() / 256, 0)); + m_gfxdecode->set_gfx(0, std::make_unique(*m_palette, char_layout, (uint8_t*)m_screen_ram.get(), 0, m_palette->entries() / 256, 0)); machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(taitopjc_state::video_exit), this)); } -UINT32 taitopjc_state::screen_update_taitopjc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t taitopjc_state::screen_update_taitopjc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0x000000, cliprect); @@ -253,9 +253,9 @@ UINT32 taitopjc_state::screen_update_taitopjc(screen_device &screen, bitmap_ind1 return 0; } -UINT32 taitopjc_state::videochip_r( offs_t address) +uint32_t taitopjc_state::videochip_r( offs_t address) { - UINT32 r = 0; + uint32_t r = 0; if (address >= 0x10000000 && address < 0x10040000) { @@ -265,7 +265,7 @@ UINT32 taitopjc_state::videochip_r( offs_t address) return r; } -void taitopjc_state::videochip_w(offs_t address, UINT32 data) +void taitopjc_state::videochip_w(offs_t address, uint32_t data) { if (address >= 0x20000000 && address < 0x20008000) { @@ -278,12 +278,12 @@ void taitopjc_state::videochip_w(offs_t address, UINT32 data) } else if (address >= 0x10000000 && address < 0x10040000) { - UINT32 addr = address - 0x10000000; + uint32_t addr = address - 0x10000000; m_screen_ram[addr] = data; if (address >= 0x1003f000) { - UINT32 a = address - 0x1003f000; + uint32_t a = address - 0x1003f000; m_tilemap[0]->mark_tile_dirty((a*2)); m_tilemap[0]->mark_tile_dirty((a*2)+1); } @@ -300,13 +300,13 @@ void taitopjc_state::videochip_w(offs_t address, UINT32 data) READ64_MEMBER(taitopjc_state::video_r) { - UINT64 r = 0; + uint64_t r = 0; if (offset == 0) { if (ACCESSING_BITS_32_63) { - r |= (UINT64)(videochip_r(m_video_address)) << 32; + r |= (uint64_t)(videochip_r(m_video_address)) << 32; } } @@ -319,35 +319,35 @@ WRITE64_MEMBER(taitopjc_state::video_w) { if (ACCESSING_BITS_32_63) { - //printf("Address %08X = %08X\n", video_address, (UINT32)(data >> 32)); - videochip_w(m_video_address, (UINT32)(data >> 32)); + //printf("Address %08X = %08X\n", video_address, (uint32_t)(data >> 32)); + videochip_w(m_video_address, (uint32_t)(data >> 32)); } } if (offset == 1) { if (ACCESSING_BITS_32_63) { - m_video_address = (UINT32)(data >> 32); + m_video_address = (uint32_t)(data >> 32); } } } READ64_MEMBER(taitopjc_state::ppc_common_r) { - UINT64 r = 0; - UINT32 address; + uint64_t r = 0; + uint32_t address; - //logerror("ppc_common_r: %08X, %08X%08X\n", offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); + //logerror("ppc_common_r: %08X, %08X%08X\n", offset, (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); address = offset * 2; if (ACCESSING_BITS_48_63) { - r |= (UINT64)(m_io_share_ram[address]) << 48; + r |= (uint64_t)(m_io_share_ram[address]) << 48; } if (ACCESSING_BITS_16_31) { - r |= (UINT64)(m_io_share_ram[address+1]) << 16; + r |= (uint64_t)(m_io_share_ram[address+1]) << 16; } return r; @@ -355,17 +355,17 @@ READ64_MEMBER(taitopjc_state::ppc_common_r) WRITE64_MEMBER(taitopjc_state::ppc_common_w) { - UINT32 address = offset * 2; + uint32_t address = offset * 2; // logerror("ppc_common_w: %08X, %I64X, %I64X\n", offset, data, mem_mask); if (ACCESSING_BITS_48_63) { - m_io_share_ram[address] = (UINT16)(data >> 48); + m_io_share_ram[address] = (uint16_t)(data >> 48); } if (ACCESSING_BITS_16_31) { - m_io_share_ram[address+1] = (UINT16)(data >> 16); + m_io_share_ram[address+1] = (uint16_t)(data >> 16); } if (offset == 0x7ff && ACCESSING_BITS_48_63) @@ -384,17 +384,17 @@ WRITE64_MEMBER(taitopjc_state::ppc_common_w) READ64_MEMBER(taitopjc_state::dsp_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_48_63) { int addr = offset * 2; - r |= (UINT64)(m_dsp_ram[addr+0]) << 48; + r |= (uint64_t)(m_dsp_ram[addr+0]) << 48; } if (ACCESSING_BITS_16_31) { int addr = offset * 2; - r |= (UINT64)(m_dsp_ram[addr+1]) << 16; + r |= (uint64_t)(m_dsp_ram[addr+1]) << 16; } return r; @@ -404,21 +404,21 @@ void taitopjc_state::print_display_list() { int ptr = 0; - UINT16 cmd = m_dsp_ram[0xffe]; + uint16_t cmd = m_dsp_ram[0xffe]; if (cmd == 0x5245) { printf("DSP command RE\n"); bool end = false; do { - UINT16 w = m_dsp_ram[ptr++]; + uint16_t w = m_dsp_ram[ptr++]; if (w & 0x8000) { int count = (w & 0x7fff) + 1; - UINT16 d = m_dsp_ram[ptr++]; + uint16_t d = m_dsp_ram[ptr++]; for (int i=0; i < count; i++) { - UINT16 s = m_dsp_ram[ptr++]; + uint16_t s = m_dsp_ram[ptr++]; printf(" %04X -> [%04X]\n", s, d); d++; } @@ -475,7 +475,7 @@ void taitopjc_state::print_display_list() WRITE64_MEMBER(taitopjc_state::dsp_w) { - //logerror("dsp_w: %08X, %08X%08X, %08X%08X at %08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask), space.device().safe_pc()); + //logerror("dsp_w: %08X, %08X%08X, %08X%08X at %08X\n", offset, (uint32_t)(data >> 32), (uint32_t)(data), (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask), space.device().safe_pc()); if (offset == 0x7fe) { @@ -535,11 +535,11 @@ READ8_MEMBER(taitopjc_state::tlcs_common_r) { if (offset & 1) { - return (UINT8)(m_io_share_ram[offset / 2] >> 8); + return (uint8_t)(m_io_share_ram[offset / 2] >> 8); } else { - return (UINT8)(m_io_share_ram[offset / 2]); + return (uint8_t)(m_io_share_ram[offset / 2]); } } @@ -548,7 +548,7 @@ WRITE8_MEMBER(taitopjc_state::tlcs_common_w) if (offset & 1) { m_io_share_ram[offset / 2] &= 0x00ff; - m_io_share_ram[offset / 2] |= (UINT16)(data) << 8; + m_io_share_ram[offset / 2] |= (uint16_t)(data) << 8; } else { @@ -611,7 +611,7 @@ WRITE16_MEMBER(taitopjc_state::tlcs_unk_w) // 0xfc00f7: INT5 (dummy) // 0xfc00f8: INT6 PPC command // 0xfc00fd: INT7 (dummy) -// 0xfc00fe: INT8 (dummy) +// 0xfc00fe: int8_t (dummy) // 0xfc0663: INTT1 // 0xfc0f7d: INTRX0 // 0xfc0f05: INTTX0 @@ -651,7 +651,7 @@ READ16_MEMBER(taitopjc_state::dsp_rom_r) { assert(m_dsp_rom_address < 0x800000); - UINT16 data = ((UINT16*)m_polyrom->base())[m_dsp_rom_address]; + uint16_t data = ((uint16_t*)m_polyrom->base())[m_dsp_rom_address]; m_dsp_rom_address++; return data; } @@ -665,7 +665,7 @@ WRITE16_MEMBER(taitopjc_state::dsp_roml_w) WRITE16_MEMBER(taitopjc_state::dsp_romh_w) { m_dsp_rom_address &= 0xffff; - m_dsp_rom_address |= (UINT32)(data) << 16; + m_dsp_rom_address |= (uint32_t)(data) << 16; } @@ -801,14 +801,14 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(taitopjc_state, optiger) { - UINT8 *rom = (UINT8*)memregion("io_cpu")->base(); + uint8_t *rom = (uint8_t*)memregion("io_cpu")->base(); // skip sound check rom[0x217] = 0x00; rom[0x218] = 0x00; #if 0 - UINT32 *mr = (UINT32*)memregion("user1")->base(); + uint32_t *mr = (uint32_t*)memregion("user1")->base(); //mr[(0x23a5c^4)/4] = 0x60000000; mr[((0x513b0-0x40000)^4)/4] = 0x38600001; #endif diff --git a/src/mame/drivers/taitotx.cpp b/src/mame/drivers/taitotx.cpp index 1e45b8e9422..8e7ffab85e5 100644 --- a/src/mame/drivers/taitotx.cpp +++ b/src/mame/drivers/taitotx.cpp @@ -132,7 +132,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_taito_type_x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taito_type_x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -143,7 +143,7 @@ void taito_type_x_state::video_start() } -UINT32 taito_type_x_state::screen_update_taito_type_x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t taito_type_x_state::screen_update_taito_type_x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/taitotz.cpp b/src/mame/drivers/taitotz.cpp index f0db0bbaeb8..4b39476a343 100644 --- a/src/mame/drivers/taitotz.cpp +++ b/src/mame/drivers/taitotz.cpp @@ -524,9 +524,9 @@ typedef float VECTOR3[3]; struct taitotz_polydata { - UINT32 texture; - UINT32 alpha; - UINT32 flags; + uint32_t texture; + uint32_t alpha; + uint32_t flags; int diffuse_r, diffuse_g, diffuse_b; int ambient_r, ambient_g, ambient_b; int specular_r, specular_g, specular_b; @@ -551,8 +551,8 @@ public: required_device m_maincpu; required_device m_iocpu; - required_shared_ptr m_work_ram; - required_shared_ptr m_mbox_ram; + required_shared_ptr m_work_ram; + required_shared_ptr m_mbox_ram; required_device m_ata; required_device m_screen; @@ -565,19 +565,19 @@ public: DECLARE_READ64_MEMBER(video_fifo_r); DECLARE_WRITE64_MEMBER(video_fifo_w); - std::unique_ptr m_screen_ram; - std::unique_ptr m_frame_ram; - std::unique_ptr m_texture_ram; - UINT32 m_video_unk_reg[0x10]; + std::unique_ptr m_screen_ram; + std::unique_ptr m_frame_ram; + std::unique_ptr m_texture_ram; + uint32_t m_video_unk_reg[0x10]; - UINT32 m_video_fifo_ptr; - UINT32 m_video_ram_ptr; - UINT32 m_video_reg; - UINT32 m_scr_base; + uint32_t m_video_fifo_ptr; + uint32_t m_video_ram_ptr; + uint32_t m_video_reg; + uint32_t m_scr_base; - UINT64 m_video_fifo_mem[4]; + uint64_t m_video_fifo_mem[4]; - UINT16 m_io_share_ram[0x2000]; + uint16_t m_io_share_ram[0x2000]; const char *m_hdd_serial_number; @@ -586,10 +586,10 @@ public: DECLARE_READ8_MEMBER(tlcs_rtc_r); DECLARE_WRITE8_MEMBER(tlcs_rtc_w); - UINT8 m_rtcdata[8]; + uint8_t m_rtcdata[8]; - UINT32 m_reg105; + uint32_t m_reg105; int m_count; std::unique_ptr m_renderer; @@ -604,16 +604,16 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_taitotz(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitotz(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(taitotz_vbi); DECLARE_READ16_MEMBER(tlcs_ide0_r); DECLARE_READ16_MEMBER(tlcs_ide1_r); DECLARE_WRITE_LINE_MEMBER(ide_interrupt); - void draw_tile(UINT32 pos, UINT32 tile); - UINT32 video_mem_r(UINT32 address); - void video_mem_w(UINT32 address, UINT32 data); - UINT32 video_reg_r(UINT32 reg); - void video_reg_w(UINT32 reg, UINT32 data); + void draw_tile(uint32_t pos, uint32_t tile); + uint32_t video_mem_r(uint32_t address); + void video_mem_w(uint32_t address, uint32_t data); + uint32_t video_reg_r(uint32_t reg); + void video_reg_w(uint32_t reg, uint32_t data); void init_taitotz_152(); void init_taitotz_111a(); }; @@ -621,7 +621,7 @@ public: class taitotz_renderer : public poly_manager { public: - taitotz_renderer(taitotz_state &state, int width, int height, UINT32 *scrram, UINT32 *texram) + taitotz_renderer(taitotz_state &state, int width, int height, uint32_t *scrram, uint32_t *texram) : poly_manager(state.machine()), m_state(state) { @@ -641,17 +641,17 @@ public: } void render_displaylist(const rectangle &cliprect); - void draw_object(UINT32 address, float scale, UINT8 alpha); + void draw_object(uint32_t address, float scale, uint8_t alpha); float line_plane_intersection(const vertex_t *v1, const vertex_t *v2, PLANE cp); int clip_polygon(const vertex_t *v, int num_vertices, PLANE cp, vertex_t *vout); void setup_viewport(int x, int y, int width, int height, int center_x, int center_y); - void draw_scanline_noz(INT32 scanline, const extent_t &extent, const taitotz_polydata &extradata, int threadid); - void draw_scanline(INT32 scanline, const extent_t &extent, const taitotz_polydata &extradata, int threadid); + void draw_scanline_noz(int32_t scanline, const extent_t &extent, const taitotz_polydata &extradata, int threadid); + void draw_scanline(int32_t scanline, const extent_t &extent, const taitotz_polydata &extradata, int threadid); - void push_tnl_fifo(UINT32 data); - void push_direct_poly_fifo(UINT32 data); + void push_tnl_fifo(uint32_t data); + void push_direct_poly_fifo(uint32_t data); - void render_tnl_object(UINT32 address, float scale, UINT8 alpha); + void render_tnl_object(uint32_t address, float scale, uint8_t alpha); void draw(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -671,8 +671,8 @@ private: taitotz_state &m_state; std::unique_ptr m_fb; std::unique_ptr m_zbuffer; - UINT32 *m_texture; - UINT32 *m_screen_ram; + uint32_t *m_texture; + uint32_t *m_screen_ram; rectangle m_cliprect; @@ -701,15 +701,15 @@ private: float m_vp_y; float m_vp_mul; - UINT32 m_reg_100; - UINT32 m_reg_101; - UINT32 m_reg_102; + uint32_t m_reg_100; + uint32_t m_reg_101; + uint32_t m_reg_102; - UINT32 m_reg_10000100; - UINT32 m_reg_10000101; + uint32_t m_reg_10000100; + uint32_t m_reg_10000101; - UINT32 m_tnl_fifo[64]; - UINT32 m_direct_fifo[64]; + uint32_t m_tnl_fifo[64]; + uint32_t m_direct_fifo[64]; int m_tnl_fifo_ptr; int m_direct_fifo_ptr; }; @@ -727,30 +727,30 @@ void taitotz_state::taitotz_exit() file = fopen("screen_ram.bin","wb"); for (i=0; i < 0x200000; i++) { - fputc((UINT8)(m_screen_ram[i] >> 24), file); - fputc((UINT8)(m_screen_ram[i] >> 16), file); - fputc((UINT8)(m_screen_ram[i] >> 8), file); - fputc((UINT8)(m_screen_ram[i] >> 0), file); + fputc((uint8_t)(m_screen_ram[i] >> 24), file); + fputc((uint8_t)(m_screen_ram[i] >> 16), file); + fputc((uint8_t)(m_screen_ram[i] >> 8), file); + fputc((uint8_t)(m_screen_ram[i] >> 0), file); } fclose(file); file = fopen("frame_ram.bin","wb"); for (i=0; i < 0x80000; i++) { - fputc((UINT8)(m_frame_ram[i] >> 24), file); - fputc((UINT8)(m_frame_ram[i] >> 16), file); - fputc((UINT8)(m_frame_ram[i] >> 8), file); - fputc((UINT8)(m_frame_ram[i] >> 0), file); + fputc((uint8_t)(m_frame_ram[i] >> 24), file); + fputc((uint8_t)(m_frame_ram[i] >> 16), file); + fputc((uint8_t)(m_frame_ram[i] >> 8), file); + fputc((uint8_t)(m_frame_ram[i] >> 0), file); } fclose(file); file = fopen("texture_ram.bin","wb"); for (i=0; i < 0x800000; i++) { - fputc((UINT8)(m_texture_ram[i] >> 24), file); - fputc((UINT8)(m_texture_ram[i] >> 16), file); - fputc((UINT8)(m_texture_ram[i] >> 8), file); - fputc((UINT8)(m_texture_ram[i] >> 0), file); + fputc((uint8_t)(m_texture_ram[i] >> 24), file); + fputc((uint8_t)(m_texture_ram[i] >> 16), file); + fputc((uint8_t)(m_texture_ram[i] >> 8), file); + fputc((uint8_t)(m_texture_ram[i] >> 0), file); } fclose(file); @@ -761,9 +761,9 @@ void taitotz_state::video_start() int width = m_screen->width(); int height = m_screen->height(); - m_screen_ram = std::make_unique(0x200000); - m_frame_ram = std::make_unique(0x80000); - m_texture_ram = std::make_unique(0x800000); + m_screen_ram = std::make_unique(0x200000); + m_frame_ram = std::make_unique(0x80000); + m_texture_ram = std::make_unique(0x800000); /* create renderer */ m_renderer = std::make_unique(*this, width, height, m_screen_ram.get(), m_texture_ram.get()); @@ -788,13 +788,13 @@ static inline float dot_product_vec3(VECTOR3 a, VECTOR3 b) // Adapted from http://en.wikipedia.org/wiki/Fast_inverse_square_root static inline float finvsqrt(float number) { - UINT32 i; + uint32_t i; float x2, y; const float threehalfs = 1.5f; x2 = number * 0.5f; y = number; - i = *(UINT32*)&y; + i = *(uint32_t*)&y; i = 0x5f3759df - ( i >> 1 ); y = *(float*)&i; y = y * ( threehalfs - ( x2 * y * y ) ); @@ -819,10 +819,10 @@ static inline float clamp_pos(float v) return v; } -static inline UINT32 generate_texel_address(int iu, int iv) +static inline uint32_t generate_texel_address(int iu, int iv) { // generate texel address from U and V - UINT32 addr = 0; + uint32_t addr = 0; addr += (iu & 0x01) ? 1 : 0; addr += (iu >> 1) * 4; addr += (iv & 0x01) ? 2 : 0; @@ -831,16 +831,16 @@ static inline UINT32 generate_texel_address(int iu, int iv) return addr; } -void taitotz_renderer::draw_scanline_noz(INT32 scanline, const extent_t &extent, const taitotz_polydata &extradata, int threadid) +void taitotz_renderer::draw_scanline_noz(int32_t scanline, const extent_t &extent, const taitotz_polydata &extradata, int threadid) { - UINT32 *fb = &m_fb->pix32(scanline); + uint32_t *fb = &m_fb->pix32(scanline); float u = extent.param[POLY_U].start; float v = extent.param[POLY_V].start; float du = extent.param[POLY_U].dpdx; float dv = extent.param[POLY_V].dpdx; - UINT32 *texram = &m_texture[extradata.texture * 0x1000]; + uint32_t *texram = &m_texture[extradata.texture * 0x1000]; int shift = 16; // TODO: subtexture @@ -849,9 +849,9 @@ void taitotz_renderer::draw_scanline_noz(INT32 scanline, const extent_t &extent, int iu = (int)(u) & 0x3f; int iv = (int)(v) & 0x3f; - UINT32 addr = generate_texel_address(iu, iv); + uint32_t addr = generate_texel_address(iu, iv); - UINT32 texel = (texram[addr] >> shift) & 0xffff; + uint32_t texel = (texram[addr] >> shift) & 0xffff; if (!(texel & 0x8000)) { int r = (texel & 0x7c00) << 9; @@ -865,9 +865,9 @@ void taitotz_renderer::draw_scanline_noz(INT32 scanline, const extent_t &extent, } } -void taitotz_renderer::draw_scanline(INT32 scanline, const extent_t &extent, const taitotz_polydata &extradata, int threadid) +void taitotz_renderer::draw_scanline(int32_t scanline, const extent_t &extent, const taitotz_polydata &extradata, int threadid) { - UINT32 *fb = &m_fb->pix32(scanline); + uint32_t *fb = &m_fb->pix32(scanline); float *zb = (float*)&m_zbuffer->pix32(scanline); float ooz = extent.param[POLY_Z].start; @@ -884,9 +884,9 @@ void taitotz_renderer::draw_scanline(INT32 scanline, const extent_t &extent, con float nz = extent.param[POLY_NZ].start; float dnz = extent.param[POLY_NZ].dpdx; - UINT32 *texram = &m_texture[extradata.texture * 0x1000]; - UINT32 alpha = extradata.alpha & 0x1f; - UINT32 alpha_enable = extradata.alpha & 0x80; + uint32_t *texram = &m_texture[extradata.texture * 0x1000]; + uint32_t alpha = extradata.alpha & 0x1f; + uint32_t alpha_enable = extradata.alpha & 0x80; int texmode = extradata.flags & 0x3; @@ -930,10 +930,10 @@ void taitotz_renderer::draw_scanline(INT32 scanline, const extent_t &extent, con int iu = (int)(u) & 0x3f; int iv = (int)(v) & 0x3f; - UINT32 addr = generate_texel_address(iu, iv); + uint32_t addr = generate_texel_address(iu, iv); - UINT32 texel = texram[addr]; - UINT32 texel0 = (texel >> tex0_shift) & 0xffff; + uint32_t texel = texram[addr]; + uint32_t texel0 = (texel >> tex0_shift) & 0xffff; if (!(texel0 & 0x8000)) { // extract texel0 RGB @@ -943,7 +943,7 @@ void taitotz_renderer::draw_scanline(INT32 scanline, const extent_t &extent, con #if ENABLE_LIGHTING // fetch texture1 and apply normal map - UINT32 texel1 = (texel >> tex1_shift) & 0xffff; + uint32_t texel1 = (texel >> tex1_shift) & 0xffff; VECTOR3 normal; VECTOR3 half; @@ -1003,7 +1003,7 @@ void taitotz_renderer::draw_scanline(INT32 scanline, const extent_t &extent, con int b0 = (texel0 & 0x001f) << 3; // fetch texture1 - UINT32 texel1 = (texel >> tex1_shift) & 0xffff; + uint32_t texel1 = (texel >> tex1_shift) & 0xffff; if (!(texel1 & 0x8000)) { @@ -1033,7 +1033,7 @@ void taitotz_renderer::draw_scanline(INT32 scanline, const extent_t &extent, con int b0 = texel0 & 0x1f; // fetch texture1 - UINT32 texel1 = (texel >> tex1_shift) & 0xffff; + uint32_t texel1 = (texel >> tex1_shift) & 0xffff; int r1 = (texel1 & 0x7c00) >> 7; int g1 = (texel1 & 0x03e0) >> 2; @@ -1224,9 +1224,9 @@ void taitotz_renderer::setup_viewport(int x, int y, int width, int height, int c m_clip_plane[4].d = 0.1f; } -void taitotz_renderer::render_tnl_object(UINT32 address, float scale, UINT8 alpha) +void taitotz_renderer::render_tnl_object(uint32_t address, float scale, uint8_t alpha) { - UINT32 *src = &m_screen_ram[address]; + uint32_t *src = &m_screen_ram[address]; vertex_t v[10]; bool end = false; @@ -1253,23 +1253,23 @@ void taitotz_renderer::render_tnl_object(UINT32 address, float scale, UINT8 alph for (int i=0; i < num_verts; i++) { // texture coords - UINT8 tu = src[index] >> 8; - UINT8 tv = src[index] & 0xff; + uint8_t tu = src[index] >> 8; + uint8_t tv = src[index] & 0xff; v[i].p[POLY_U] = (float)(tu); v[i].p[POLY_V] = (float)(tv); // coords - INT16 x = src[index + 1] & 0xffff; - INT16 y = src[index + 2] & 0xffff; - INT16 z = src[index + 3] & 0xffff; + int16_t x = src[index + 1] & 0xffff; + int16_t y = src[index + 2] & 0xffff; + int16_t z = src[index + 3] & 0xffff; float px = ((float)(x) / 256.0f) * scale; float py = ((float)(y) / 256.0f) * scale; float pz = ((float)(z) / 256.0f) * scale; // normals - INT8 inx = (src[index + 1] >> 16) & 0xff; - INT8 iny = (src[index + 2] >> 16) & 0xff; - INT8 inz = (src[index + 3] >> 16) & 0xff; + int8_t inx = (src[index + 1] >> 16) & 0xff; + int8_t iny = (src[index + 2] >> 16) & 0xff; + int8_t inz = (src[index + 3] >> 16) & 0xff; float nx = (float)(inx) / 128.0f; float ny = (float)(iny) / 128.0f; float nz = (float)(inz) / 128.0f; @@ -1339,7 +1339,7 @@ void taitotz_renderer::draw(bitmap_rgb32 &bitmap, const rectangle &cliprect) m_zbuffer->fill(*(int*)&zvalue, cliprect); } -void taitotz_renderer::push_tnl_fifo(UINT32 data) +void taitotz_renderer::push_tnl_fifo(uint32_t data) { m_tnl_fifo[m_tnl_fifo_ptr] = data; m_tnl_fifo_ptr++; @@ -1365,7 +1365,7 @@ void taitotz_renderer::push_tnl_fifo(UINT32 data) if (scale < 1.0f) scale *= 2.0f; - UINT32 alpha = m_tnl_fifo[2]; + uint32_t alpha = m_tnl_fifo[2]; render_tnl_object(m_tnl_fifo[0] & 0x1fffff, scale, alpha); // printf("TNL FIFO: %08X, %f, %08X, %08X\n", m_tnl_fifo[0], u2f(m_tnl_fifo[1]), m_tnl_fifo[2], m_tnl_fifo[3]); @@ -1373,7 +1373,7 @@ void taitotz_renderer::push_tnl_fifo(UINT32 data) } } -void taitotz_renderer::push_direct_poly_fifo(UINT32 data) +void taitotz_renderer::push_direct_poly_fifo(uint32_t data) { m_direct_fifo[m_direct_fifo_ptr] = data; m_direct_fifo_ptr++; @@ -1403,7 +1403,7 @@ void taitotz_renderer::push_direct_poly_fifo(UINT32 data) v[i].y = m_direct_fifo[index+0] & 0xffff; v[i].p[POLY_U] = (m_direct_fifo[index+2] >> 20) & 0xfff; v[i].p[POLY_V] = (m_direct_fifo[index+2] >> 4) & 0xfff; - //UINT16 z = m_direct_fifo[index+1] & 0xffff; + //uint16_t z = m_direct_fifo[index+1] & 0xffff; index += 4; } @@ -1419,18 +1419,18 @@ void taitotz_renderer::push_direct_poly_fifo(UINT32 data) } } -UINT32 taitotz_state::screen_update_taitotz(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t taitotz_state::screen_update_taitotz(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_renderer->draw(bitmap, cliprect); - UINT16 *screen_src = (UINT16*)&m_screen_ram[m_scr_base]; + uint16_t *screen_src = (uint16_t*)&m_screen_ram[m_scr_base]; for (int j=0; j < 384; j++) { - UINT32 *fb = &bitmap.pix32(j); + uint32_t *fb = &bitmap.pix32(j); for (int i=0; i < 512; i++) { - UINT16 p = *screen_src++; + uint16_t p = *screen_src++; if (p & 0x8000) // draw 2D framebuffer if there's an opaque pixel { int r = ((p >> 10) & 0x1f) << (3+16); @@ -1444,7 +1444,7 @@ UINT32 taitotz_state::screen_update_taitotz(screen_device &screen, bitmap_rgb32 return 0; } -void taitotz_state::draw_tile(UINT32 pos, UINT32 tile) +void taitotz_state::draw_tile(uint32_t pos, uint32_t tile) { int tileu = (tile & 0x1f) * 16; int tilev = ((tile >> 5)) * 16; @@ -1452,8 +1452,8 @@ void taitotz_state::draw_tile(UINT32 pos, UINT32 tile) int tilex = (pos & 0x1f) * 16; int tiley = ((pos >> 5) & 0x1f) * 16; - UINT16 *src_tile = (UINT16*)&m_screen_ram[0x180000]; - UINT16 *dst = (UINT16*)&m_screen_ram[m_scr_base]; + uint16_t *src_tile = (uint16_t*)&m_screen_ram[0x180000]; + uint16_t *dst = (uint16_t*)&m_screen_ram[m_scr_base]; int v = tilev; @@ -1462,7 +1462,7 @@ void taitotz_state::draw_tile(UINT32 pos, UINT32 tile) int u = tileu; for (int i=tilex; i < (tilex+16); i++) { - UINT16 p = src_tile[((v*512) + u)]; + uint16_t p = src_tile[((v*512) + u)]; dst[(j*512) + i] = p; u++; } @@ -1486,7 +1486,7 @@ void taitotz_state::draw_tile(UINT32 pos, UINT32 tile) batlgr2 into 0x9e0000 */ -UINT32 taitotz_state::video_mem_r(UINT32 address) +uint32_t taitotz_state::video_mem_r(uint32_t address) { if (address >= 0x800000 && address < 0x1000000) { @@ -1507,7 +1507,7 @@ UINT32 taitotz_state::video_mem_r(UINT32 address) } } -void taitotz_state::video_mem_w(UINT32 address, UINT32 data) +void taitotz_state::video_mem_w(uint32_t address, uint32_t data) { if (address >= 0x800000 && address < 0x1000000) { @@ -1527,7 +1527,7 @@ void taitotz_state::video_mem_w(UINT32 address, UINT32 data) } } -UINT32 taitotz_state::video_reg_r(UINT32 reg) +uint32_t taitotz_state::video_reg_r(uint32_t reg) { switch ((reg >> 28) & 0xf) { @@ -1590,7 +1590,7 @@ video_reg_w: r: 20000003 d: 019501AA video_reg_w: r: 20000004 d: 00000000 */ -void taitotz_state::video_reg_w(UINT32 reg, UINT32 data) +void taitotz_state::video_reg_w(uint32_t reg, uint32_t data) { switch ((reg >> 28) & 0xf) { @@ -1618,8 +1618,8 @@ void taitotz_state::video_reg_w(UINT32 reg, UINT32 data) } case 0x3: // Draw 16x16 tile { - UINT32 pos = (data >> 12) & 0xfff; - UINT32 tile = data & 0xfff; + uint32_t pos = (data >> 12) & 0xfff; + uint32_t tile = data & 0xfff; draw_tile(pos, tile); break; } @@ -1639,8 +1639,8 @@ void taitotz_state::video_reg_w(UINT32 reg, UINT32 data) READ64_MEMBER(taitotz_state::video_chip_r) { - UINT64 r = 0; - UINT32 reg = offset * 8; + uint64_t r = 0; + uint32_t reg = offset * 8; if (ACCESSING_BITS_0_31) { @@ -1665,13 +1665,13 @@ READ64_MEMBER(taitotz_state::video_chip_r) { case 0x0: { - r |= (UINT64)(video_reg_r(m_video_reg)) << 32; + r |= (uint64_t)(video_reg_r(m_video_reg)) << 32; break; } case 0x10: { - r |= (UINT64)(0xff) << 32; // busy flags? landhigh expects this + r |= (uint64_t)(0xff) << 32; // busy flags? landhigh expects this break; } @@ -1688,13 +1688,13 @@ READ64_MEMBER(taitotz_state::video_chip_r) WRITE64_MEMBER(taitotz_state::video_chip_w) { - UINT32 reg = offset * 8; - UINT32 regdata; + uint32_t reg = offset * 8; + uint32_t regdata; if (ACCESSING_BITS_0_31) { reg += 4; - regdata = (UINT32)(data); + regdata = (uint32_t)(data); switch (reg) { default: @@ -1706,7 +1706,7 @@ WRITE64_MEMBER(taitotz_state::video_chip_w) } if (ACCESSING_BITS_32_63) { - regdata = (UINT32)(data >> 32); + regdata = (uint32_t)(data >> 32); switch (reg) { case 0: @@ -1763,15 +1763,15 @@ WRITE64_MEMBER(taitotz_state::video_chip_w) READ64_MEMBER(taitotz_state::video_fifo_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_32_63) { - r |= (UINT64)(video_mem_r(m_video_ram_ptr)) << 32; + r |= (uint64_t)(video_mem_r(m_video_ram_ptr)) << 32; m_video_ram_ptr++; } if (ACCESSING_BITS_0_31) { - r |= (UINT64)(video_mem_r(m_video_ram_ptr)); + r |= (uint64_t)(video_mem_r(m_video_ram_ptr)); m_video_ram_ptr++; } @@ -1789,7 +1789,7 @@ WRITE64_MEMBER(taitotz_state::video_fifo_w) { if (m_video_fifo_ptr >= 8) { - video_mem_w(m_video_ram_ptr, (UINT32)(data >> 32)); + video_mem_w(m_video_ram_ptr, (uint32_t)(data >> 32)); m_video_ram_ptr++; } m_video_fifo_ptr++; @@ -1798,7 +1798,7 @@ WRITE64_MEMBER(taitotz_state::video_fifo_w) { if (m_video_fifo_ptr >= 8) { - video_mem_w(m_video_ram_ptr, (UINT32)(data)); + video_mem_w(m_video_ram_ptr, (uint32_t)(data)); m_video_ram_ptr++; } m_video_fifo_ptr++; @@ -1812,8 +1812,8 @@ WRITE64_MEMBER(taitotz_state::video_fifo_w) { if (m_video_fifo_ptr >= 8) { - m_renderer->push_direct_poly_fifo((UINT32)(data >> 32)); - //logerror("FIFO packet w: %08X at %08X\n", (UINT32)(data >> 32), space.device().safe_pc()); + m_renderer->push_direct_poly_fifo((uint32_t)(data >> 32)); + //logerror("FIFO packet w: %08X at %08X\n", (uint32_t)(data >> 32), space.device().safe_pc()); } m_video_fifo_ptr++; } @@ -1821,8 +1821,8 @@ WRITE64_MEMBER(taitotz_state::video_fifo_w) { if (m_video_fifo_ptr >= 8) { - m_renderer->push_direct_poly_fifo((UINT32)(data)); - //logerror("FIFO packet w: %08X at %08X\n", (UINT32)(data), space.device().safe_pc()); + m_renderer->push_direct_poly_fifo((uint32_t)(data)); + //logerror("FIFO packet w: %08X at %08X\n", (uint32_t)(data), space.device().safe_pc()); } m_video_fifo_ptr++; } @@ -1835,7 +1835,7 @@ WRITE64_MEMBER(taitotz_state::video_fifo_w) { if (m_video_fifo_ptr >= 8) { - m_renderer->push_tnl_fifo((UINT32)(data >> 32)); + m_renderer->push_tnl_fifo((uint32_t)(data >> 32)); } m_video_fifo_ptr++; } @@ -1843,7 +1843,7 @@ WRITE64_MEMBER(taitotz_state::video_fifo_w) { if (m_video_fifo_ptr >= 8) { - m_renderer->push_tnl_fifo((UINT32)(data)); + m_renderer->push_tnl_fifo((uint32_t)(data)); } m_video_fifo_ptr++; } @@ -1854,7 +1854,7 @@ WRITE64_MEMBER(taitotz_state::video_fifo_w) { if (m_video_fifo_ptr >= 8) { - printf("FIFO write with cmd %02X: %08X\n", command, (UINT32)(data >> 32)); + printf("FIFO write with cmd %02X: %08X\n", command, (uint32_t)(data >> 32)); } m_video_fifo_ptr++; } @@ -1862,7 +1862,7 @@ WRITE64_MEMBER(taitotz_state::video_fifo_w) { if (m_video_fifo_ptr >= 8) { - printf("FIFO write with cmd %02X: %08X\n", command, (UINT32)(data)); + printf("FIFO write with cmd %02X: %08X\n", command, (uint32_t)(data)); } m_video_fifo_ptr++; } @@ -1878,13 +1878,13 @@ READ64_MEMBER(taitotz_state::ieee1394_r) return U64(0xffffffffffffffff); } - //logerror("ieee1394_r: %08X, %08X%08X\n", offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); + //logerror("ieee1394_r: %08X, %08X%08X\n", offset, (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); return 0; } WRITE64_MEMBER(taitotz_state::ieee1394_w) { - //logerror("ieee1394_w: %08X, %08X%08X, %08X%08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); + //logerror("ieee1394_w: %08X, %08X%08X, %08X%08X\n", offset, (uint32_t)(data >> 32), (uint32_t)(data), (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); if (ACCESSING_BITS_32_63) { } @@ -1895,7 +1895,7 @@ WRITE64_MEMBER(taitotz_state::ieee1394_w) READ64_MEMBER(taitotz_state::ppc_common_r) { - UINT64 res = 0; + uint64_t res = 0; if (ACCESSING_BITS_0_15) { @@ -1903,7 +1903,7 @@ READ64_MEMBER(taitotz_state::ppc_common_r) } if (ACCESSING_BITS_32_47) { - res |= (UINT64)(m_io_share_ram[(offset * 2) + 0]) << 32; + res |= (uint64_t)(m_io_share_ram[(offset * 2) + 0]) << 32; } return res; @@ -1913,11 +1913,11 @@ WRITE64_MEMBER(taitotz_state::ppc_common_w) { if (ACCESSING_BITS_0_15) { - m_io_share_ram[(offset * 2) + 1] = (UINT16)(data); + m_io_share_ram[(offset * 2) + 1] = (uint16_t)(data); } if (ACCESSING_BITS_32_47) { - m_io_share_ram[(offset * 2) + 0] = (UINT16)(data >> 32); + m_io_share_ram[(offset * 2) + 0] = (uint16_t)(data >> 32); } if (offset == 0x7ff) @@ -2023,7 +2023,7 @@ WRITE64_MEMBER(taitotz_state::ppc_common_w) { for (int i=0; i < 0x80; i++) { - UINT16 w = m_io_share_ram[0x900+i]; + uint16_t w = m_io_share_ram[0x900+i]; printf("%c%c", w & 0xff, (w >> 8) & 0xff); } printf("\n"); @@ -2033,7 +2033,7 @@ WRITE64_MEMBER(taitotz_state::ppc_common_w) { for (int i=0; i < 0x80; i++) { - UINT16 w = m_io_share_ram[0xb00+i]; + uint16_t w = m_io_share_ram[0xb00+i]; printf("%c%c", w & 0xff, (w >> 8) & 0xff); } printf("\n"); @@ -2072,11 +2072,11 @@ READ8_MEMBER(taitotz_state::tlcs_common_r) { if (offset & 1) { - return (UINT8)(m_io_share_ram[offset / 2] >> 8); + return (uint8_t)(m_io_share_ram[offset / 2] >> 8); } else { - return (UINT8)(m_io_share_ram[offset / 2]); + return (uint8_t)(m_io_share_ram[offset / 2]); } } @@ -2085,7 +2085,7 @@ WRITE8_MEMBER(taitotz_state::tlcs_common_w) if (offset & 1) { m_io_share_ram[offset / 2] &= 0x00ff; - m_io_share_ram[offset / 2] |= (UINT16)(data) << 8; + m_io_share_ram[offset / 2] |= (uint16_t)(data) << 8; } else { @@ -2102,7 +2102,7 @@ WRITE8_MEMBER(taitotz_state::tlcs_common_w) m_io_share_ram[0xffe] != 0x1022) { printf("TLCS -> PPC cmd %04X\n", m_io_share_ram[0xffe]); - //printf("0x40080104 = %08X\n", (UINT32)(m_work_ram[0x80104/8])); + //printf("0x40080104 = %08X\n", (uint32_t)(m_work_ram[0x80104/8])); } #endif @@ -2175,7 +2175,7 @@ WRITE8_MEMBER(taitotz_state::tlcs_rtc_w) READ16_MEMBER(taitotz_state::tlcs_ide0_r) { - UINT16 d = m_ata->read_cs0(space, offset, mem_mask); + uint16_t d = m_ata->read_cs0(space, offset, mem_mask); if (offset == 7) d &= ~0x2; // Type Zero doesn't like the index bit. It's defined as vendor-specific, so it probably shouldn't be up... // The status check explicitly checks for 0x50 (drive ready, seek complete). @@ -2184,7 +2184,7 @@ READ16_MEMBER(taitotz_state::tlcs_ide0_r) READ16_MEMBER(taitotz_state::tlcs_ide1_r) { - UINT16 d = m_ata->read_cs1(space, offset, mem_mask); + uint16_t d = m_ata->read_cs1(space, offset, mem_mask); if (offset == 6) d &= ~0x2; // Type Zero doesn't like the index bit. It's defined as vendor-specific, so it probably shouldn't be up... // The status check explicitly checks for 0x50 (drive ready, seek complete). @@ -2204,7 +2204,7 @@ READ16_MEMBER(taitotz_state::tlcs_ide1_r) // 0xfc0147: INT5 - // 0xfc0148: INT6 - // 0xfc0149: INT7 - -// 0xfc014a: INT8 Sound chip interrupt? +// 0xfc014a: int8_t Sound chip interrupt? // 0xfc0120: INTAD - // 0xfc0120: INTTR8-A - // 0xfc0120: INTT0 - @@ -2527,7 +2527,7 @@ void taitotz_state::machine_reset() if (m_hdd_serial_number != nullptr) { ide_hdd_device *hdd = m_ata->subdevice("0")->subdevice("hdd"); - UINT16 *identify_device = hdd->identify_device_buffer(); + uint16_t *identify_device = hdd->identify_device_buffer(); for (int i=0; i < 10; i++) { @@ -2607,7 +2607,7 @@ MACHINE_CONFIG_END // Init for BIOS v1.52 void taitotz_state::init_taitotz_152() { - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); rom[(0x2c87c^4)/4] = 0x38600000; // skip sound load timeout... // rom[(0x2c620^4)/4] = 0x48000014; // ID check skip (not needed with correct serial number) @@ -2621,7 +2621,7 @@ void taitotz_state::init_taitotz_152() // Init for BIOS 1.11a void taitotz_state::init_taitotz_111a() { - UINT32 *rom = (UINT32*)memregion("user1")->base(); + uint32_t *rom = (uint32_t*)memregion("user1")->base(); rom[(0x2b748^4)/4] = 0x480000b8; // skip sound load timeout } diff --git a/src/mame/drivers/taitowlf.cpp b/src/mame/drivers/taitowlf.cpp index eba6d93fed2..0e9268ee8ad 100644 --- a/src/mame/drivers/taitowlf.cpp +++ b/src/mame/drivers/taitowlf.cpp @@ -45,11 +45,11 @@ public: m_bank1(*this, "bank1"), m_palette(*this, "palette") { } - std::unique_ptr m_bios_ram; - UINT8 m_mtxc_config_reg[256]; - UINT8 m_piix4_config_reg[4][256]; + std::unique_ptr m_bios_ram; + uint8_t m_mtxc_config_reg[256]; + uint8_t m_piix4_config_reg[4][256]; - required_region_ptr m_bootscreen_rom; + required_region_ptr m_bootscreen_rom; required_memory_bank m_bank1; required_device m_palette; DECLARE_WRITE32_MEMBER(pnp_config_w); @@ -61,12 +61,12 @@ public: #if !ENABLE_VGA DECLARE_PALETTE_INIT(taitowlf); #endif - UINT32 screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void intel82439tx_init(); }; #if !ENABLE_VGA -UINT32 taitowlf_state::screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t taitowlf_state::screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; @@ -78,7 +78,7 @@ UINT32 taitowlf_state::screen_update_taitowlf(screen_device &screen, bitmap_rgb3 { for(x=0;x<512;x++) { - UINT32 color; + uint32_t color; color = (m_bootscreen_rom[count] & 0xff); @@ -96,7 +96,7 @@ UINT32 taitowlf_state::screen_update_taitowlf(screen_device &screen, bitmap_rgb3 // Intel 82439TX System Controller (MTXC) -static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) { taitowlf_state *state = busdevice->machine().driver_data(); // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); @@ -104,7 +104,7 @@ static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, return state->m_mtxc_config_reg[reg]; } -static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { taitowlf_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); @@ -138,9 +138,9 @@ void taitowlf_state::intel82439tx_init() m_mtxc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; @@ -160,7 +160,7 @@ static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -182,23 +182,23 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) -static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { taitowlf_state *state = busdevice->machine().driver_data(); // osd_printf_debug("PIIX4: read %d, %02X\n", function, reg); return state->m_piix4_config_reg[function][reg]; } -static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { taitowlf_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); state->m_piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= piix4_config_r(busdevice, device, function, reg + 3) << 24; @@ -218,7 +218,7 @@ static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -396,7 +396,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(taitowlf_state,taitowlf) { - m_bios_ram = std::make_unique(0x10000/4); + m_bios_ram = std::make_unique(0x10000/4); m_bank1->configure_entry(1, m_bios_ram.get()); m_bank1->configure_entry(0, memregion("bios")->base() + 0x30000); diff --git a/src/mame/drivers/tandy1t.cpp b/src/mame/drivers/tandy1t.cpp index ea8b01bb982..6fc98b36c76 100644 --- a/src/mame/drivers/tandy1t.cpp +++ b/src/mame/drivers/tandy1t.cpp @@ -47,7 +47,7 @@ class t1000_mb_device : public pc_noppi_mb_device { public: // construction/destruction - t1000_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + t1000_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : pc_noppi_mb_device(mconfig, tag, owner, clock) { } protected: virtual void device_start() override; @@ -97,7 +97,7 @@ public: DECLARE_READ8_MEMBER( unk_r ); int tandy1000_read_eeprom(); - void tandy1000_write_eeprom(UINT8 data); + void tandy1000_write_eeprom(uint8_t data); void tandy1000_set_bios_bank(); void machine_start() override; @@ -106,19 +106,19 @@ public: struct { - UINT8 low, high; + uint8_t low, high; } m_eeprom_ee[0x40]; /* only 0 to 4 used in hx, addressing seems to allow this */ int m_eeprom_state; int m_eeprom_clock; - UINT8 m_eeprom_oper; - UINT16 m_eeprom_data; + uint8_t m_eeprom_oper; + uint16_t m_eeprom_data; - UINT8 m_tandy_data[8]; + uint8_t m_tandy_data[8]; - UINT8 m_tandy_bios_bank; /* I/O port FFEAh */ - UINT8 m_tandy_ppi_portb, m_tandy_ppi_portc; - UINT8 m_vram_bank; + uint8_t m_tandy_bios_bank; /* I/O port FFEAh */ + uint8_t m_tandy_ppi_portb, m_tandy_ppi_portc; + uint8_t m_vram_bank; }; /* tandy 1000 eeprom @@ -137,7 +137,7 @@ int tandy1000_state::tandy1000_read_eeprom() return 1; } -void tandy1000_state::tandy1000_write_eeprom(UINT8 data) +void tandy1000_state::tandy1000_write_eeprom(uint8_t data) { if (!m_eeprom_clock && (data&4) ) { @@ -340,7 +340,7 @@ READ8_MEMBER( tandy1000_state::unk_r ) READ8_MEMBER( tandy1000_state::vram_r ) { - UINT8 vram_base = (m_ram->size() >> 17) - 1; + uint8_t vram_base = (m_ram->size() >> 17) - 1; if((m_vram_bank - vram_base) == (offset >> 17)) return m_ram->pointer()[offset & 0x1ffff]; return 0xff; @@ -348,7 +348,7 @@ READ8_MEMBER( tandy1000_state::vram_r ) WRITE8_MEMBER( tandy1000_state::vram_w ) { - UINT8 vram_base = (m_ram->size() >> 17) - 1; + uint8_t vram_base = (m_ram->size() >> 17) - 1; if((m_vram_bank - vram_base) == (offset >> 17)) m_ram->pointer()[offset & 0x1ffff] = data; } @@ -396,7 +396,7 @@ void tandy1000_state::machine_start() READ8_MEMBER( tandy1000_state::tandy1000_bank_r ) { - UINT8 data = 0xFF; + uint8_t data = 0xFF; logerror( "%s: tandy1000_bank_r: offset = %x\n", space.machine().describe_context(), offset ); diff --git a/src/mame/drivers/tandy2k.cpp b/src/mame/drivers/tandy2k.cpp index 033b6fcf11e..23ba93129ac 100644 --- a/src/mame/drivers/tandy2k.cpp +++ b/src/mame/drivers/tandy2k.cpp @@ -79,7 +79,7 @@ READ8_MEMBER( tandy2k_state::videoram_r ) address_space &program = m_maincpu->space(AS_PROGRAM); offs_t addr = (m_vram_base << 15) | (offset << 1); - UINT16 data = program.read_word(addr); + uint16_t data = program.read_word(addr); // character m_drb0->write(space, 0, data & 0xff); @@ -107,7 +107,7 @@ READ8_MEMBER( tandy2k_state::enable_r ) */ - UINT8 data = 0x80; + uint8_t data = 0x80; data |= m_rs232->ri_r(); data |= m_rs232->dcd_r() << 1; @@ -351,21 +351,21 @@ INPUT_PORTS_END // Video -UINT32 tandy2k_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t tandy2k_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const pen_t *pen = m_palette->pens(); address_space &program = m_maincpu->space(AS_PROGRAM); for (int y = 0; y < 400; y++) { - UINT8 cgra = y % 16; + uint8_t cgra = y % 16; for (int sx = 0; sx < 80; sx++) { offs_t addr = m_ram->size() - 0x1400 + (((y / 16) * 80) + sx) * 2; - UINT16 vidla = program.read_word(addr); - UINT8 attr = vidla >> 8; - UINT8 data = m_char_ram[((vidla & 0xff) << 4) | cgra]; + uint16_t vidla = program.read_word(addr); + uint8_t attr = vidla >> 8; + uint8_t data = m_char_ram[((vidla & 0xff) << 4) | cgra]; if(attr & 0x80) data = ~data; @@ -492,7 +492,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( tandy2k_state::vidldsh_tick ) m_cgra |= m_sld << 3; } - UINT8 vidd = m_char_ram[(m_vidla << 4) | m_cgra]; + uint8_t vidd = m_char_ram[(m_vidla << 4) | m_cgra]; m_vac->write(vidd); m_drb0->rclk_w(1); @@ -583,7 +583,7 @@ READ8_MEMBER( tandy2k_state::ppi_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; switch (m_pb_sel) { @@ -729,7 +729,7 @@ READ8_MEMBER( tandy2k_state::irq_callback ) void tandy2k_state::machine_start() { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); int ram_size = m_ram->size(); program.install_ram(0x00000, ram_size - 1, ram); diff --git a/src/mame/drivers/tank8.cpp b/src/mame/drivers/tank8.cpp index 19989e0c21f..bd1f7938c70 100644 --- a/src/mame/drivers/tank8.cpp +++ b/src/mame/drivers/tank8.cpp @@ -462,10 +462,10 @@ ROM_END DRIVER_INIT_MEMBER(tank8_state,decode) { - const UINT8* DECODE = memregion("user1")->base(); + const uint8_t* DECODE = memregion("user1")->base(); - UINT8* p1 = memregion("maincpu")->base() + 0x00000; - UINT8* p2 = memregion("maincpu")->base() + 0x10000; + uint8_t* p1 = memregion("maincpu")->base() + 0x00000; + uint8_t* p2 = memregion("maincpu")->base() + 0x10000; int i; diff --git a/src/mame/drivers/tankbust.cpp b/src/mame/drivers/tankbust.cpp index 87d363612b7..3624a255485 100644 --- a/src/mame/drivers/tankbust.cpp +++ b/src/mame/drivers/tankbust.cpp @@ -127,7 +127,7 @@ READ8_MEMBER(tankbust_state::debug_output_area_r) PALETTE_INIT_MEMBER(tankbust_state, tankbust) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < 128; i++) diff --git a/src/mame/drivers/tapatune.cpp b/src/mame/drivers/tapatune.cpp index e02844b555f..b09c1bd95be 100644 --- a/src/mame/drivers/tapatune.cpp +++ b/src/mame/drivers/tapatune.cpp @@ -63,20 +63,20 @@ public: optional_device m_videocpu; required_device m_bsmt; - optional_shared_ptr m_videoram; + optional_shared_ptr m_videoram; - UINT8 m_paletteram[0x300]; - UINT16 m_palette_write_addr; + uint8_t m_paletteram[0x300]; + uint16_t m_palette_write_addr; rgb_t m_pens[0x100]; - UINT8 m_controls_mux; - UINT8 m_z80_to_68k_index; - UINT8 m_z80_to_68k_data; - UINT8 m_68k_to_z80_index; - UINT8 m_68k_to_z80_data; - UINT8 m_z80_data_available; - UINT8 m_68k_data_available; - UINT8 m_bsmt_data_l; - UINT8 m_bsmt_data_h; + uint8_t m_controls_mux; + uint8_t m_z80_to_68k_index; + uint8_t m_z80_to_68k_data; + uint8_t m_68k_to_z80_index; + uint8_t m_68k_to_z80_data; + uint8_t m_z80_data_available; + uint8_t m_68k_data_available; + uint8_t m_bsmt_data_l; + uint8_t m_bsmt_data_h; bool m_bsmt_reset; virtual void machine_start() override; @@ -149,7 +149,7 @@ void tapatune_state::machine_reset() MC6845_BEGIN_UPDATE( tapatune_state::crtc_begin_update ) { // Create the pens - for (UINT32 i = 0; i < 0x100; i++) + for (uint32_t i = 0; i < 0x100; i++) { int r = m_paletteram[3 * i + 0]; int g = m_paletteram[3 * i + 1]; @@ -166,14 +166,14 @@ MC6845_BEGIN_UPDATE( tapatune_state::crtc_begin_update ) MC6845_UPDATE_ROW( tapatune_state::crtc_update_row ) { - UINT32 *dest = &bitmap.pix32(y); + uint32_t *dest = &bitmap.pix32(y); offs_t offs = (ma*2 + ra*0x40)*4; - UINT8 *videoram = reinterpret_cast(m_videoram.target()); + uint8_t *videoram = reinterpret_cast(m_videoram.target()); - for (UINT32 x = 0; x < x_count*4; x++) + for (uint32_t x = 0; x < x_count*4; x++) { - UINT8 pix = videoram[BYTE_XOR_BE(offs + x)]; + uint8_t pix = videoram[BYTE_XOR_BE(offs + x)]; dest[2*x] = m_pens[((pix >> 4) & 0x0f)]; dest[2*x + 1] = m_pens[(pix & 0x0f)]; } @@ -212,7 +212,7 @@ WRITE_LINE_MEMBER(tapatune_state::crtc_vsync) READ16_MEMBER(tapatune_state::read_from_z80) { m_z80_data_available = 0; - return ((UINT16)m_z80_to_68k_data << 8) | (m_z80_to_68k_index); + return ((uint16_t)m_z80_to_68k_data << 8) | (m_z80_to_68k_index); } diff --git a/src/mame/drivers/tasman.cpp b/src/mame/drivers/tasman.cpp index 91159716ee7..cdaf9f6ed0d 100644 --- a/src/mame/drivers/tasman.cpp +++ b/src/mame/drivers/tasman.cpp @@ -60,7 +60,7 @@ public: required_device m_screen; required_device m_palette; - optional_shared_ptr m_vram; + optional_shared_ptr m_vram; DECLARE_READ32_MEMBER(eeprom_r); DECLARE_WRITE8_MEMBER(eeprom_w); DECLARE_WRITE8_MEMBER(kongambl_ff_w); @@ -68,10 +68,10 @@ public: // DECLARE_READ32_MEMBER(rng_r); DECLARE_DRIVER_INIT(kingtut); DECLARE_VIDEO_START(kongambl); - UINT8 m_irq_mask; + uint8_t m_irq_mask; virtual void machine_reset() override { m_irq_mask = 0; }; - UINT32 screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); WRITE_LINE_MEMBER(vblank_irq_ack_w); WRITE_LINE_MEMBER(hblank_irq_ack_w); TIMER_DEVICE_CALLBACK_MEMBER(kongambl_vblank); @@ -93,11 +93,11 @@ VIDEO_START_MEMBER(kongambl_state,kongambl) #endif } -UINT32 kongambl_state::screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t kongambl_state::screen_update_kongambl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { #if CUSTOM_DRAW gfx_element *gfx = m_gfxdecode->gfx(0); - UINT32 count; + uint32_t count; count = 0; @@ -105,7 +105,7 @@ UINT32 kongambl_state::screen_update_kongambl(screen_device &screen, bitmap_ind1 { for (int x=0;x<128;x++) { - UINT32 tile = m_vram[count] & 0xffff; + uint32_t tile = m_vram[count] & 0xffff; if(m_screen->visible_area().contains(x*8, y*8)) gfx->opaque(bitmap,cliprect,tile,0,0,0,x*8,y*8); @@ -120,7 +120,7 @@ UINT32 kongambl_state::screen_update_kongambl(screen_device &screen, bitmap_ind1 { for (int x=0;x<128;x++) { - UINT32 tile = m_vram[count] & 0xffff; + uint32_t tile = m_vram[count] & 0xffff; if(m_screen->visible_area().contains(x*8, y*8)) gfx->transpen(bitmap,cliprect,tile,0,0,0,x*8,y*8,0); @@ -145,7 +145,7 @@ UINT32 kongambl_state::screen_update_kongambl(screen_device &screen, bitmap_ind1 READ32_MEMBER(kongambl_state::eeprom_r) { //return machine().rand(); - UINT32 retval = 0; + uint32_t retval = 0; if (ACCESSING_BITS_24_31) retval |= ioport("IN0")->read() << 24; // bit 0 freezes the system if 1 @@ -806,7 +806,7 @@ ROM_END DRIVER_INIT_MEMBER(kongambl_state,kingtut) { - //UINT32 *rom = (UINT32*)memregion("maincpu")->base(); + //uint32_t *rom = (uint32_t*)memregion("maincpu")->base(); //rom[0x3986c/4] = (rom[0x3986c/4] & 0xffff0000) | 0x600e; // patch ROM check //rom[0x2bfc8/4] = (rom[0x2bfc8/4] & 0xffff0000) | 0x6612; // patch VRAM ROM checks diff --git a/src/mame/drivers/tatsumi.cpp b/src/mame/drivers/tatsumi.cpp index a2717528521..7d500174c79 100644 --- a/src/mame/drivers/tatsumi.cpp +++ b/src/mame/drivers/tatsumi.cpp @@ -1344,9 +1344,9 @@ ROM_END DRIVER_INIT_MEMBER(tatsumi_state,apache3) { - UINT8 *dst = memregion("gfx1")->base(); - UINT8 *src1 = memregion("gfx2")->base(); - UINT8 *src2 = memregion("gfx3")->base(); + uint8_t *dst = memregion("gfx1")->base(); + uint8_t *src1 = memregion("gfx2")->base(); + uint8_t *src2 = memregion("gfx3")->base(); for (int i=0; i<0x100000; i+=32) { @@ -1371,9 +1371,9 @@ DRIVER_INIT_MEMBER(tatsumi_state,apache3) DRIVER_INIT_MEMBER(tatsumi_state,roundup5) { - UINT8 *dst = memregion("gfx1")->base(); - UINT8 *src1 = memregion("gfx2")->base(); - UINT8 *src2 = memregion("gfx3")->base(); + uint8_t *dst = memregion("gfx1")->base(); + uint8_t *src1 = memregion("gfx2")->base(); + uint8_t *src2 = memregion("gfx3")->base(); for (int i=0; i<0xc0000; i+=32) { @@ -1396,10 +1396,10 @@ DRIVER_INIT_MEMBER(tatsumi_state,roundup5) DRIVER_INIT_MEMBER(tatsumi_state,cyclwarr) { - UINT8 *dst = memregion("gfx1")->base(); - UINT8 *src1 = memregion("gfx2")->base(); + uint8_t *dst = memregion("gfx1")->base(); + uint8_t *src1 = memregion("gfx2")->base(); int len1 = memregion("gfx2")->bytes(); - UINT8 *src2 = memregion("gfx3")->base(); + uint8_t *src2 = memregion("gfx3")->base(); int len2 = memregion("gfx3")->bytes(); for (int i=0; i m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_tmap; DECLARE_DRIVER_INIT(tattack); TILE_GET_INFO_MEMBER(get_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(tattack); - UINT32 screen_update_tattack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tattack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; @@ -64,7 +64,7 @@ TILE_GET_INFO_MEMBER(tattack_state::get_tile_info) 0); } -UINT32 tattack_state::screen_update_tattack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tattack_state::screen_update_tattack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tmap->mark_all_dirty(); m_tmap->draw(screen, bitmap, cliprect, 0,0); @@ -243,7 +243,7 @@ ROM_END DRIVER_INIT_MEMBER(tattack_state,tattack) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); rom[0x1b4]=0; rom[0x1b5]=0; diff --git a/src/mame/drivers/tavernie.cpp b/src/mame/drivers/tavernie.cpp index 13646865916..cbd201ec620 100644 --- a/src/mame/drivers/tavernie.cpp +++ b/src/mame/drivers/tavernie.cpp @@ -94,12 +94,12 @@ public: DECLARE_WRITE_LINE_MEMBER(write_acia_clock); MC6845_UPDATE_ROW(crtc_update_row); - const UINT8 *m_p_chargen; - optional_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + optional_shared_ptr m_p_videoram; private: - UINT8 m_term_data; - UINT8 m_pa; + uint8_t m_term_data; + uint8_t m_pa; required_device m_cass; optional_device m_pia_ivg; optional_device m_fdc; @@ -209,13 +209,13 @@ WRITE8_MEMBER( tavernie_state::ds_w ) MC6845_UPDATE_ROW( tavernie_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx=0; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx=0; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { - UINT8 inv=0; + uint8_t inv=0; if (x == cursor_x) inv=0xff; mem = (ma + x) & 0xfff; if (ra > 7) @@ -272,7 +272,7 @@ READ_LINE_MEMBER( tavernie_state::ca1_r ) READ8_MEMBER( tavernie_state::pb_ivg_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/taxidriv.cpp b/src/mame/drivers/taxidriv.cpp index eca1c1200df..b811df8009c 100644 --- a/src/mame/drivers/taxidriv.cpp +++ b/src/mame/drivers/taxidriv.cpp @@ -304,7 +304,7 @@ GFXDECODE_END PALETTE_INIT_MEMBER(taxidriv_state, taxidriv) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int bit0, bit1, r, g, b; int i; diff --git a/src/mame/drivers/tb303.cpp b/src/mame/drivers/tb303.cpp index 41b5f648a02..f76c39e5dc0 100644 --- a/src/mame/drivers/tb303.cpp +++ b/src/mame/drivers/tb303.cpp @@ -26,8 +26,8 @@ public: : hh_ucom4_state(mconfig, type, tag) { } - UINT8 m_ram[0xc00]; - UINT16 m_ram_address; + uint8_t m_ram[0xc00]; + uint16_t m_ram_address; bool m_ram_ce; bool m_ram_we; @@ -67,7 +67,7 @@ void tb303_state::refresh_ram() // MCU E2,E3 goes through a 4556 IC(pin 14,13) to one of uPD444 _CE: // _Q0: N/C, _Q1: IC-5, _Q2: IC-3, _Q3: IC-4 m_ram_ce = true; - UINT8 hi = 0; + uint8_t hi = 0; switch (m_port[NEC_UCOM4_PORTE] >> 2 & 3) { case 0: m_ram_ce = false; break; diff --git a/src/mame/drivers/tbowl.cpp b/src/mame/drivers/tbowl.cpp index badd259b005..6a40aac2228 100644 --- a/src/mame/drivers/tbowl.cpp +++ b/src/mame/drivers/tbowl.cpp @@ -152,7 +152,7 @@ void tbowl_state::adpcm_int( msm5205_device *device, int num ) } else { - UINT8 *ROM = memregion("adpcm")->base() + 0x10000 * num; + uint8_t *ROM = memregion("adpcm")->base() + 0x10000 * num; m_adpcm_data[num] = ROM[m_adpcm_pos[num]++]; device->data_w(m_adpcm_data[num] >> 4); diff --git a/src/mame/drivers/tceptor.cpp b/src/mame/drivers/tceptor.cpp index f2100692abc..6530eb6bd51 100644 --- a/src/mame/drivers/tceptor.cpp +++ b/src/mame/drivers/tceptor.cpp @@ -88,9 +88,9 @@ WRITE8_MEMBER(tceptor_state::mcu_irq_disable_w) /* fix dsw/input data to memory mapped data */ -UINT8 tceptor_state::fix_input0(UINT8 in1, UINT8 in2) +uint8_t tceptor_state::fix_input0(uint8_t in1, uint8_t in2) { - UINT8 r = 0; + uint8_t r = 0; r |= (in1 & 0x80) >> 7; r |= (in1 & 0x20) >> 4; @@ -104,9 +104,9 @@ UINT8 tceptor_state::fix_input0(UINT8 in1, UINT8 in2) return r; } -UINT8 tceptor_state::fix_input1(UINT8 in1, UINT8 in2) +uint8_t tceptor_state::fix_input1(uint8_t in1, uint8_t in2) { - UINT8 r = 0; + uint8_t r = 0; r |= (in1 & 0x40) >> 6; r |= (in1 & 0x10) >> 3; diff --git a/src/mame/drivers/tcl.cpp b/src/mame/drivers/tcl.cpp index a951a646e47..0cbc2e6d8d4 100644 --- a/src/mame/drivers/tcl.cpp +++ b/src/mame/drivers/tcl.cpp @@ -55,7 +55,7 @@ public: DECLARE_DRIVER_INIT(tcl); virtual void video_start() override; - UINT32 screen_update_tcl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tcl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -63,7 +63,7 @@ public: void tcl_state::video_start() { } -UINT32 tcl_state::screen_update_tcl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tcl_state::screen_update_tcl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } @@ -171,9 +171,9 @@ DRIVER_INIT_MEMBER(tcl_state,tcl) { /* only the first part is decrypted (and verified)*/ - UINT8 *dest = memregion("maincpu")->base(); + uint8_t *dest = memregion("maincpu")->base(); int len = memregion("maincpu")->bytes(); - std::vector src(len); + std::vector src(len); int i,idx=0; memcpy(&src[0], dest, len); diff --git a/src/mame/drivers/tdv2324.cpp b/src/mame/drivers/tdv2324.cpp index ac7a8e7c004..b2797de10de 100644 --- a/src/mame/drivers/tdv2324.cpp +++ b/src/mame/drivers/tdv2324.cpp @@ -224,7 +224,7 @@ void tdv2324_state::video_start() } -UINT32 tdv2324_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t tdv2324_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/tec1.cpp b/src/mame/drivers/tec1.cpp index f07ec5e7662..7172185f140 100644 --- a/src/mame/drivers/tec1.cpp +++ b/src/mame/drivers/tec1.cpp @@ -112,12 +112,12 @@ public: DECLARE_WRITE8_MEMBER( tec1_digit_w ); DECLARE_WRITE8_MEMBER( tecjmon_digit_w ); DECLARE_WRITE8_MEMBER( tec1_segment_w ); - UINT8 m_kbd; - UINT8 m_segment; - UINT8 m_digit; - UINT8 m_kbd_row; - UINT8 m_refresh[6]; - UINT8 tec1_convert_col_to_bin( UINT8 col, UINT8 row ); + uint8_t m_kbd; + uint8_t m_segment; + uint8_t m_digit; + uint8_t m_kbd_row; + uint8_t m_refresh[6]; + uint8_t tec1_convert_col_to_bin( uint8_t col, uint8_t row ); virtual void machine_reset() override; virtual void machine_start() override; TIMER_CALLBACK_MEMBER(tec1_kbd_callback); @@ -188,7 +188,7 @@ WRITE8_MEMBER( tec1_state::tecjmon_digit_w ) READ8_MEMBER( tec1_state::latch_r ) { // bit 7 - cass in ; bit 6 low = key pressed - UINT8 data = (m_key_pressed) ? 0 : 0x40; + uint8_t data = (m_key_pressed) ? 0 : 0x40; if (m_cass->input() > 0.03) data |= 0x80; @@ -203,9 +203,9 @@ READ8_MEMBER( tec1_state::tec1_kbd_r ) return m_kbd | m_io_shift->read(); } -UINT8 tec1_state::tec1_convert_col_to_bin( UINT8 col, UINT8 row ) +uint8_t tec1_state::tec1_convert_col_to_bin( uint8_t col, uint8_t row ) { - UINT8 data = row; + uint8_t data = row; if (BIT(col, 1)) data |= 4; @@ -224,7 +224,7 @@ UINT8 tec1_state::tec1_convert_col_to_bin( UINT8 col, UINT8 row ) TIMER_CALLBACK_MEMBER(tec1_state::tec1_kbd_callback) { - UINT8 i; + uint8_t i; // Display the digits. Blank any digits that haven't been refreshed for a while. // This will fix the problem reported by a user. diff --git a/src/mame/drivers/techno.cpp b/src/mame/drivers/techno.cpp index a5722c273d0..cf1c13c24e5 100644 --- a/src/mame/drivers/techno.cpp +++ b/src/mame/drivers/techno.cpp @@ -42,9 +42,9 @@ public: INTERRUPT_GEN_MEMBER(techno_intgen); private: bool m_digwait; - UINT8 m_keyrow; - UINT16 m_digit; - UINT8 m_vector; + uint8_t m_keyrow; + uint16_t m_digit; + uint8_t m_vector; virtual void machine_reset() override; required_device m_maincpu; required_ioport_array<8> m_switch; diff --git a/src/mame/drivers/tecmo.cpp b/src/mame/drivers/tecmo.cpp index bc286b25e47..7474c13373e 100644 --- a/src/mame/drivers/tecmo.cpp +++ b/src/mame/drivers/tecmo.cpp @@ -105,7 +105,7 @@ WRITE_LINE_MEMBER(tecmo_state::adpcm_int) } else { - UINT8 *ROM = memregion("adpcm")->base(); + uint8_t *ROM = memregion("adpcm")->base(); m_adpcm_data = ROM[m_adpcm_pos++]; m_msm->data_w(m_adpcm_data >> 4); @@ -115,28 +115,28 @@ WRITE_LINE_MEMBER(tecmo_state::adpcm_int) /* the 8-bit dipswitches are split across addresses */ READ8_MEMBER(tecmo_state::dswa_l_r) { - UINT8 port = ioport("DSWA")->read(); + uint8_t port = ioport("DSWA")->read(); port &= 0x0f; return port; } READ8_MEMBER(tecmo_state::dswa_h_r) { - UINT8 port = ioport("DSWA")->read(); + uint8_t port = ioport("DSWA")->read(); port &= 0xf0; return port>>4; } READ8_MEMBER(tecmo_state::dswb_l_r) { - UINT8 port = ioport("DSWB")->read(); + uint8_t port = ioport("DSWB")->read(); port &= 0x0f; return port; } READ8_MEMBER(tecmo_state::dswb_h_r) { - UINT8 port = ioport("DSWB")->read(); + uint8_t port = ioport("DSWB")->read(); port &= 0xf0; return port>>4; } diff --git a/src/mame/drivers/tecmosys.cpp b/src/mame/drivers/tecmosys.cpp index 8b5a86de0a4..7dbac955c3d 100644 --- a/src/mame/drivers/tecmosys.cpp +++ b/src/mame/drivers/tecmosys.cpp @@ -251,7 +251,7 @@ WRITE16_MEMBER(tecmosys_state::unk880000_w) READ16_MEMBER(tecmosys_state::unk880000_r) { - //UINT16 ret = m_880000regs[offset]; + //uint16_t ret = m_880000regs[offset]; logerror( "unk880000_r( %06x ) @ %06x = %04x\n", (offset * 2 ) +0x880000, space.device().safe_pc(), m_880000regs[offset] ); @@ -330,9 +330,9 @@ WRITE8_MEMBER(tecmosys_state::z80_bank_w) WRITE8_MEMBER(tecmosys_state::oki_bank_w) { - UINT8 upperbank = (data & 0x30) >> 4; - UINT8 lowerbank = (data & 0x03) >> 0; - UINT8* region = memregion("oki")->base(); + uint8_t upperbank = (data & 0x30) >> 4; + uint8_t lowerbank = (data & 0x03) >> 0; + uint8_t* region = memregion("oki")->base(); memcpy( region+0x00000, region+0x80000 + lowerbank * 0x20000, 0x20000 ); memcpy( region+0x20000, region+0x80000 + upperbank * 0x20000, 0x20000 ); @@ -625,13 +625,13 @@ ROM_END void tecmosys_state::descramble() { - UINT8 *gfxsrc = memregion( "gfx1" )->base(); + uint8_t *gfxsrc = memregion( "gfx1" )->base(); size_t srcsize = memregion( "gfx1" )->bytes(); int i; for (i=0; i < srcsize; i+=4) { - UINT8 tmp[4]; + uint8_t tmp[4]; tmp[2] = ((gfxsrc[i+0]&0xf0)>>0) | ((gfxsrc[i+1]&0xf0)>>4); // 0, 1, 2, 3 8, 9,10,11 tmp[3] = ((gfxsrc[i+0]&0x0f)<<4) | ((gfxsrc[i+1]&0x0f)<<0); // 4, 5, 6, 7, 12,13,14,15 diff --git a/src/mame/drivers/tehkanwc.cpp b/src/mame/drivers/tehkanwc.cpp index 21e69a3c6a5..e765e81c02f 100644 --- a/src/mame/drivers/tehkanwc.cpp +++ b/src/mame/drivers/tehkanwc.cpp @@ -205,7 +205,7 @@ WRITE8_MEMBER(tehkanwc_state::msm_reset_w) WRITE_LINE_MEMBER(tehkanwc_state::adpcm_int) { - UINT8 *SAMPLES = memregion("adpcm")->base(); + uint8_t *SAMPLES = memregion("adpcm")->base(); int msm_data = SAMPLES[m_msm_data_offs & 0x7fff]; if (m_toggle == 0) @@ -699,7 +699,7 @@ DRIVER_INIT_MEMBER(tehkanwc_state,teedoff) 023A: 00 nop */ - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); ROM[0x0238] = 0x00; ROM[0x0239] = 0x00; diff --git a/src/mame/drivers/tek405x.cpp b/src/mame/drivers/tek405x.cpp index acec32694cd..c9752b14bc1 100644 --- a/src/mame/drivers/tek405x.cpp +++ b/src/mame/drivers/tek405x.cpp @@ -106,7 +106,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(tek4051_state::keyboard_tick) // bankswitch - //------------------------------------------------- -void tek4051_state::bankswitch(UINT8 data) +void tek4051_state::bankswitch(uint8_t data) { address_space &program = m_maincpu->space(AS_PROGRAM); @@ -558,8 +558,8 @@ READ8_MEMBER( tek4051_state::kb_pia_pa_r ) */ - UINT8 data = 0; - UINT8 special = m_special->read(); + uint8_t data = 0; + uint8_t special = m_special->read(); // keyboard column data = m_kc; @@ -587,8 +587,8 @@ READ8_MEMBER( tek4051_state::kb_pia_pb_r ) */ - UINT8 data = 0; - UINT8 special = m_special->read(); + uint8_t data = 0; + uint8_t special = m_special->read(); // shift data |= (BIT(special, 0) & BIT(special, 1)); @@ -757,7 +757,7 @@ READ8_MEMBER( tek4051_state::gpib_pia_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // service request data |= m_gpib->srq_r() << 5; @@ -875,7 +875,7 @@ READ8_MEMBER( tek4051_state::com_pia_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // data terminal ready diff --git a/src/mame/drivers/tek410x.cpp b/src/mame/drivers/tek410x.cpp index b4677554dff..407658e0280 100644 --- a/src/mame/drivers/tek410x.cpp +++ b/src/mame/drivers/tek410x.cpp @@ -32,7 +32,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; /* Memory Maps */ @@ -56,7 +56,7 @@ void tek4107a_state::video_start() { } -UINT32 tek4107a_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t tek4107a_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/tek440x.cpp b/src/mame/drivers/tek440x.cpp index 8072e4f2cf9..baa1b57970e 100644 --- a/src/mame/drivers/tek440x.cpp +++ b/src/mame/drivers/tek440x.cpp @@ -61,11 +61,11 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - 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); required_device m_maincpu; required_device m_fdccpu; - required_shared_ptr m_mainram; - required_shared_ptr m_vram; + required_shared_ptr m_mainram; + required_shared_ptr m_vram; }; /************************************* @@ -88,8 +88,8 @@ void tek440x_state::machine_start() void tek440x_state::machine_reset() { - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 *RAM = (UINT8 *)m_mainram.target(); + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *RAM = (uint8_t *)m_mainram.target(); memcpy(RAM, ROM, 256); @@ -104,11 +104,11 @@ void tek440x_state::machine_reset() * *************************************/ -UINT32 tek440x_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tek440x_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - const UINT16 *video_ram; - UINT16 word; - UINT16 *line; + const uint16_t *video_ram; + uint16_t word; + uint16_t *line; int y, x, b; for (y = 0; y < 480; y++) diff --git a/src/mame/drivers/tekxp33x.cpp b/src/mame/drivers/tekxp33x.cpp index 5e90c391c22..f6216f97b05 100644 --- a/src/mame/drivers/tekxp33x.cpp +++ b/src/mame/drivers/tekxp33x.cpp @@ -50,7 +50,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; /* Memory Maps */ @@ -74,7 +74,7 @@ void tekxp330_state::video_start() { } -UINT32 tekxp330_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t tekxp330_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/tempest.cpp b/src/mame/drivers/tempest.cpp index f7f8d416b6f..ed90b761427 100644 --- a/src/mame/drivers/tempest.cpp +++ b/src/mame/drivers/tempest.cpp @@ -315,7 +315,7 @@ public: required_device m_mathbox; required_device m_watchdog; required_device m_avg; - required_region_ptr m_rom; + required_region_ptr m_rom; required_ioport m_knob_p1; required_ioport m_knob_p2; @@ -324,7 +324,7 @@ public: required_ioport m_in1; required_ioport m_in2; - UINT8 m_player_select; + uint8_t m_player_select; DECLARE_WRITE8_MEMBER(wdclr_w); DECLARE_WRITE8_MEMBER(tempest_led_w); DECLARE_WRITE8_MEMBER(tempest_coin_w); diff --git a/src/mame/drivers/terak.cpp b/src/mame/drivers/terak.cpp index 7b747489cdd..d16ac63cb67 100644 --- a/src/mame/drivers/terak.cpp +++ b/src/mame/drivers/terak.cpp @@ -22,12 +22,12 @@ public: DECLARE_WRITE16_MEMBER(terak_fdc_command_w); DECLARE_READ16_MEMBER(terak_fdc_data_r); DECLARE_WRITE16_MEMBER(terak_fdc_data_w); - UINT8 m_unit; - UINT8 m_cmd; - UINT16 m_data; + uint8_t m_unit; + uint8_t m_cmd; + uint16_t m_data; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_terak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_terak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -82,7 +82,7 @@ void terak_state::video_start() { } -UINT32 terak_state::screen_update_terak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t terak_state::screen_update_terak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/terracre.cpp b/src/mame/drivers/terracre.cpp index ef7874db697..c9e2b6bd0dc 100644 --- a/src/mame/drivers/terracre.cpp +++ b/src/mame/drivers/terracre.cpp @@ -90,7 +90,7 @@ AT-2 #include "sound/volt_reg.h" -static const UINT16 mAmazonProtData[] = +static const uint16_t mAmazonProtData[] = { /* default high scores (0x40db4) - wrong data ? */ 0x0000,0x5000,0x5341,0x4b45,0x5349,0x4755,0x5245, @@ -104,7 +104,7 @@ static const UINT16 mAmazonProtData[] = 0xc800 /* checksum */ }; -static const UINT16 mAmatelasProtData[] = +static const uint16_t mAmatelasProtData[] = { /* default high scores (0x40db4) */ 0x0000,0x5000,0x5341,0x4b45,0x5349,0x4755,0x5245, @@ -118,7 +118,7 @@ static const UINT16 mAmatelasProtData[] = 0x6100 /* checksum */ }; -static const UINT16 mHoreKidProtData[] = +static const uint16_t mHoreKidProtData[] = { /* N/A */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, @@ -148,7 +148,7 @@ READ16_MEMBER(terracre_state::amazon_protection_r) offset = m_mAmazonProtReg[2]; if( offset<=0x56 ) { - UINT16 data; + uint16_t data; data = m_mpProtData[offset/2]; if( offset&1 ) return data&0xff; return data>>8; diff --git a/src/mame/drivers/tetrisp2.cpp b/src/mame/drivers/tetrisp2.cpp index 5e8726e5e5e..379f92d38d9 100644 --- a/src/mame/drivers/tetrisp2.cpp +++ b/src/mame/drivers/tetrisp2.cpp @@ -120,7 +120,7 @@ READ16_MEMBER(tetrisp2_state::rockn_adpcmbank_r) WRITE16_MEMBER(tetrisp2_state::rockn_adpcmbank_w) { - UINT8 *SNDROM = memregion("ymz")->base(); + uint8_t *SNDROM = memregion("ymz")->base(); int bank; m_rockn_adpcmbank = data; @@ -137,7 +137,7 @@ WRITE16_MEMBER(tetrisp2_state::rockn_adpcmbank_w) WRITE16_MEMBER(tetrisp2_state::rockn2_adpcmbank_w) { - UINT8 *SNDROM = memregion("ymz")->base(); + uint8_t *SNDROM = memregion("ymz")->base(); int bank; char banktable[9][3]= @@ -183,7 +183,7 @@ WRITE16_MEMBER(tetrisp2_state::nndmseal_sound_bank_w) { if (ACCESSING_BITS_0_7) { - UINT8 *rom = memregion("okisource")->base(); + uint8_t *rom = memregion("okisource")->base(); if (data & 0x04) { diff --git a/src/mame/drivers/tgtpanic.cpp b/src/mame/drivers/tgtpanic.cpp index da033c37e05..9aeefbe5e37 100644 --- a/src/mame/drivers/tgtpanic.cpp +++ b/src/mame/drivers/tgtpanic.cpp @@ -27,15 +27,15 @@ public: required_device m_maincpu; required_device m_screen; - required_shared_ptr m_ram; + required_shared_ptr m_ram; - UINT8 m_color; + uint8_t m_color; DECLARE_WRITE8_MEMBER(color_w); virtual void machine_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -50,11 +50,11 @@ void tgtpanic_state::machine_start() * *************************************/ -UINT32 tgtpanic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t tgtpanic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 colors[4]; - UINT32 offs; - UINT32 x, y; + uint32_t colors[4]; + uint32_t offs; + uint32_t x, y; colors[0] = 0; colors[1] = 0xffffffff; @@ -63,7 +63,7 @@ UINT32 tgtpanic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap for (offs = 0; offs < 0x2000; ++offs) { - UINT8 val = m_ram[offs]; + uint8_t val = m_ram[offs]; y = (offs & 0x7f) << 1; x = (offs >> 7) << 2; diff --git a/src/mame/drivers/thayers.cpp b/src/mame/drivers/thayers.cpp index 24af4bd9c50..69bb19a5f44 100644 --- a/src/mame/drivers/thayers.cpp +++ b/src/mame/drivers/thayers.cpp @@ -22,15 +22,15 @@ struct ssi263_t { - UINT8 dr; - UINT8 p; - UINT16 i; - UINT8 r; - UINT8 t; - UINT8 c; - UINT8 a; - UINT8 f; - UINT8 mode; + uint8_t dr; + uint8_t p; + uint16_t i; + uint8_t r; + uint8_t t; + uint8_t c; + uint8_t a; + uint8_t f; + uint8_t mode; }; class thayers_state : public driver_device @@ -53,13 +53,13 @@ public: optional_device m_pr7820; optional_device m_ldv1000; - UINT8 m_laserdisc_data; + uint8_t m_laserdisc_data; int m_rx_bit; int m_keylatch; - UINT8 m_cop_data_latch; + uint8_t m_cop_data_latch; int m_cop_data_latch_enable; - UINT8 m_cop_l; - UINT8 m_cop_cmd_latch; + uint8_t m_cop_l; + uint8_t m_cop_cmd_latch; int m_timer_int; int m_data_rdy_int; int m_ssi_data_request; @@ -101,7 +101,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; -static const UINT8 led_map[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x00 }; +static const uint8_t led_map[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x00 }; /* Interrupts */ diff --git a/src/mame/drivers/thedealr.cpp b/src/mame/drivers/thedealr.cpp index 9649c0b27b9..02273c20b22 100644 --- a/src/mame/drivers/thedealr.cpp +++ b/src/mame/drivers/thedealr.cpp @@ -56,7 +56,7 @@ public: DECLARE_READ8_MEMBER(iox_r); DECLARE_WRITE8_MEMBER(iox_w); DECLARE_READ8_MEMBER(iox_status_r); - UINT8 m_iox_cmd, m_iox_ret, m_iox_status, m_iox_leds, m_iox_coins; + uint8_t m_iox_cmd, m_iox_ret, m_iox_status, m_iox_leds, m_iox_coins; void iox_reset(); // memory map @@ -70,7 +70,7 @@ public: // video DECLARE_PALETTE_INIT(thedealr); - 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); void screen_eof(screen_device &screen, bool state); }; @@ -82,7 +82,7 @@ public: PALETTE_INIT_MEMBER(thedealr_state,thedealr) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); for (int i = 0; i < palette.entries(); i++) { @@ -91,7 +91,7 @@ PALETTE_INIT_MEMBER(thedealr_state,thedealr) } } -UINT32 thedealr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t thedealr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0x1f0, cliprect); @@ -136,7 +136,7 @@ MACHINE_RESET_MEMBER(thedealr_state,thedealr) // 3400 READ8_MEMBER(thedealr_state::iox_r) { - UINT8 ret = m_iox_ret; + uint8_t ret = m_iox_ret; m_iox_status &= ~IOX_OUT_FULL; logerror("%s: IOX read %02X\n", machine().describe_context(), ret); @@ -189,7 +189,7 @@ WRITE8_MEMBER(thedealr_state::iox_w) { case 0x01: // inputs? { - UINT16 buttons = ioport("IOX")->read(); + uint16_t buttons = ioport("IOX")->read(); m_iox_ret = 0; for (int i = 0; i < 16; ++i) { diff --git a/src/mame/drivers/thedeep.cpp b/src/mame/drivers/thedeep.cpp index 127898f370d..4917798bcc6 100644 --- a/src/mame/drivers/thedeep.cpp +++ b/src/mame/drivers/thedeep.cpp @@ -197,7 +197,7 @@ WRITE8_MEMBER(thedeep_state::p1_w) READ8_MEMBER(thedeep_state::from_main_r) { - static UINT8 res; + static uint8_t res; res = 0x11; @@ -230,7 +230,7 @@ WRITE8_MEMBER(thedeep_state::p3_w) READ8_MEMBER(thedeep_state::p0_r) { - UINT8 coin_mux; + uint8_t coin_mux; coin_mux = ((ioport("COINS")->read() & 0x0e) == 0x0e); // bit 0 is hard-wired to ALL three coin latches diff --git a/src/mame/drivers/thepit.cpp b/src/mame/drivers/thepit.cpp index 44155688cb5..28ebfb31d38 100644 --- a/src/mame/drivers/thepit.cpp +++ b/src/mame/drivers/thepit.cpp @@ -1243,7 +1243,7 @@ READ8_MEMBER(thepit_state::rtriv_question_r) // Read the actual byte from question roms else if((offset & 0xc00) == 0xc00) { - UINT8 *ROM = memregion("user1")->base(); + uint8_t *ROM = memregion("user1")->base(); int real_address; real_address = (0x8000 * m_question_rom) | m_question_address | (offset & 0x3f0) | m_remap_address[offset & 0x0f]; diff --git a/src/mame/drivers/thief.cpp b/src/mame/drivers/thief.cpp index 86ba9f5eae9..071e348f26a 100644 --- a/src/mame/drivers/thief.cpp +++ b/src/mame/drivers/thief.cpp @@ -619,8 +619,8 @@ ROM_END DRIVER_INIT_MEMBER(thief_state,thief) { - UINT8 *dest = memregion( "maincpu" )->base(); - const UINT8 *source = memregion( "cpu1" )->base(); + uint8_t *dest = memregion( "maincpu" )->base(); + const uint8_t *source = memregion( "cpu1" )->base(); /* C8 is mapped (banked) in CPU1's address space; it contains Z80 code */ memcpy( &dest[0xe010], &source[0x290], 0x20 ); diff --git a/src/mame/drivers/thunderx.cpp b/src/mame/drivers/thunderx.cpp index fca3af14cb5..cb9802ea382 100644 --- a/src/mame/drivers/thunderx.cpp +++ b/src/mame/drivers/thunderx.cpp @@ -180,8 +180,8 @@ this is the data written to internal ram on startup: void thunderx_state::run_collisions( int s0, int e0, int s1, int e1, int cm, int hm ) { - UINT8* p0; - UINT8* p1; + uint8_t* p0; + uint8_t* p1; int ii, jj; p0 = &m_pmcram[16 + 5 * s0]; @@ -614,7 +614,7 @@ void thunderx_state::machine_start() // verified from both scontra and thunderx/gbusters schematics // banks 4-7 must mirror banks 0-3 for gbusters rom test to pass - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); m_rombank->configure_entries(0, 4, &ROM[0], 0x2000); m_rombank->configure_entries(4, 4, &ROM[0], 0x2000); m_rombank->configure_entries(8, 8, &ROM[0x10000], 0x2000); diff --git a/src/mame/drivers/ti630.cpp b/src/mame/drivers/ti630.cpp index 910fecc3aae..37dfbd6007d 100644 --- a/src/mame/drivers/ti630.cpp +++ b/src/mame/drivers/ti630.cpp @@ -92,7 +92,7 @@ READ8_MEMBER(ti630_state::ti630_io_r) { case 0x01: { - UINT8 value = 0; + uint8_t value = 0; #if LOG_IO_PORTS printf("P1 read value:%02X\n", value); #endif @@ -108,7 +108,7 @@ READ8_MEMBER(ti630_state::ti630_io_r) WRITE8_MEMBER(ti630_state::ti630_io_w) { - static UINT8 p0=0, p1=0, p2=0, p3=0; + static uint8_t p0=0, p1=0, p2=0, p3=0; switch (offset) { case 0x00: diff --git a/src/mame/drivers/ti74.cpp b/src/mame/drivers/ti74.cpp index 1594b129afe..3307a0d3473 100644 --- a/src/mame/drivers/ti74.cpp +++ b/src/mame/drivers/ti74.cpp @@ -97,10 +97,10 @@ public: required_ioport_array<8> m_key_matrix; required_ioport m_battery_inp; - UINT8 m_key_select; - UINT8 m_power; + uint8_t m_key_select; + uint8_t m_power; - void update_lcd_indicator(UINT8 y, UINT8 x, int state); + void update_lcd_indicator(uint8_t y, uint8_t x, int state); void update_battery_status(int state); DECLARE_READ8_MEMBER(keyboard_r); @@ -126,7 +126,7 @@ public: DEVICE_IMAGE_LOAD_MEMBER(ti74_state, ti74_cartridge) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); // max size is 32KB if (size > 0x8000) @@ -156,7 +156,7 @@ PALETTE_INIT_MEMBER(ti74_state, ti74) palette.set_pen_color(2, rgb_t(131, 136, 139)); // lcd pixel off } -void ti74_state::update_lcd_indicator(UINT8 y, UINT8 x, int state) +void ti74_state::update_lcd_indicator(uint8_t y, uint8_t x, int state) { // TI-74 ref._________________... // output# |10 11 12 13 14 2 3 4 @@ -229,7 +229,7 @@ HD44780_PIXEL_UPDATE(ti74_state::ti95_pixel_update) READ8_MEMBER(ti74_state::keyboard_r) { - UINT8 ret = 0; + uint8_t ret = 0; // read selected keyboard rows for (int i = 0; i < 8; i++) diff --git a/src/mame/drivers/ti89.cpp b/src/mame/drivers/ti89.cpp index a2241e363b8..34eabdebae4 100644 --- a/src/mame/drivers/ti89.cpp +++ b/src/mame/drivers/ti89.cpp @@ -25,9 +25,9 @@ #include "machine/intelfsh.h" #include "rendlay.h" -UINT8 ti68k_state::keypad_r() +uint8_t ti68k_state::keypad_r() { - UINT8 bit, data = 0xff; + uint8_t bit, data = 0xff; for (bit = 0; bit < 10; bit++) { @@ -93,7 +93,7 @@ WRITE16_MEMBER ( ti68k_state::ti68k_io_w ) READ16_MEMBER ( ti68k_state::ti68k_io_r ) { - UINT16 data; + uint16_t data; switch (offset & 0x0f) { @@ -131,7 +131,7 @@ WRITE16_MEMBER ( ti68k_state::ti68k_io2_w ) READ16_MEMBER ( ti68k_state::ti68k_io2_r ) { - UINT16 data; + uint16_t data; switch (offset & 0x7f) { @@ -432,7 +432,7 @@ void ti68k_state::machine_start() if (m_flash_mem) { - UINT32 base = ((((m_rom_base[0x82]) << 16) | m_rom_base[0x83]) & 0xffff)>>1; + uint32_t base = ((((m_rom_base[0x82]) << 16) | m_rom_base[0x83]) & 0xffff)>>1; if (m_rom_base[base] >= 8) m_hw_version = ((m_rom_base[base + 0x0b]) << 16) | m_rom_base[base + 0x0c]; @@ -478,20 +478,20 @@ void ti68k_state::machine_reset() m_lcd_height = 0; m_lcd_on = 0; m_lcd_contrast = 0; - memset(m_io_hw1, 0, ARRAY_LENGTH(m_io_hw1) * sizeof(UINT16)); - memset(m_io_hw2, 0, ARRAY_LENGTH(m_io_hw2) * sizeof(UINT16)); + memset(m_io_hw1, 0, ARRAY_LENGTH(m_io_hw1) * sizeof(uint16_t)); + memset(m_io_hw2, 0, ARRAY_LENGTH(m_io_hw2) * sizeof(uint16_t)); m_timer_on = 0; m_timer_mask = 0xf; m_timer_val = 0; } /* video */ -UINT32 ti68k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ti68k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* preliminary implementation, doesn't use the contrast value */ - UINT8 width = screen.width(); - UINT8 height = screen.height(); - UINT8 x, y, b; + uint8_t width = screen.width(); + uint8_t height = screen.height(); + uint8_t x, y, b; if (!m_lcd_on || !m_lcd_base) bitmap.fill(0); @@ -499,7 +499,7 @@ UINT32 ti68k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c for (y = 0; y < height; y++) for (x = 0; x < width / 8; x++) { - UINT8 s_byte= m_maincpu->space(AS_PROGRAM).read_byte(m_lcd_base + y * (width/8) + x); + uint8_t s_byte= m_maincpu->space(AS_PROGRAM).read_byte(m_lcd_base + y * (width/8) + x); for (b = 0; b<8; b++) bitmap.pix16(y, x * 8 + (7 - b)) = BIT(s_byte, b); } diff --git a/src/mame/drivers/ti990_10.cpp b/src/mame/drivers/ti990_10.cpp index 58264bae51f..cdf3422e71e 100644 --- a/src/mame/drivers/ti990_10.cpp +++ b/src/mame/drivers/ti990_10.cpp @@ -104,7 +104,7 @@ public: WRITE8_MEMBER( ti990_panel_write ); required_device m_maincpu; - UINT16 m_intlines; + uint16_t m_intlines; int m_ckon_state; }; diff --git a/src/mame/drivers/ti99_2.cpp b/src/mame/drivers/ti99_2.cpp index 0b548ced428..c9be0ff4ab5 100644 --- a/src/mame/drivers/ti99_2.cpp +++ b/src/mame/drivers/ti99_2.cpp @@ -93,7 +93,7 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; int m_ROM_paged; int m_irq_state; int m_KeyRow; @@ -104,7 +104,7 @@ public: DECLARE_DRIVER_INIT(ti99_2_24); DECLARE_DRIVER_INIT(ti99_2_32); virtual void machine_reset() override; - UINT32 screen_update_ti99_2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ti99_2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ti99_2_vblank_interrupt); required_device m_maincpu; required_device m_gfxdecode; @@ -163,9 +163,9 @@ INTERRUPT_GEN_MEMBER(ti99_2_state::ti99_2_vblank_interrupt) -UINT32 ti99_2_state::screen_update_ti99_2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ti99_2_state::screen_update_ti99_2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int i, sx, sy; diff --git a/src/mame/drivers/ti99_4p.cpp b/src/mame/drivers/ti99_4p.cpp index ac3db386062..5a3ff0cf9b1 100644 --- a/src/mame/drivers/ti99_4p.cpp +++ b/src/mame/drivers/ti99_4p.cpp @@ -203,7 +203,7 @@ private: void set_keyboard_column(int number, int data); // Pointer to EPROM - UINT16 *m_rom; + uint16_t *m_rom; // First joystick. 6 for TI-99/4A int m_firstjoy; @@ -259,12 +259,12 @@ private: // State of the DBIN line int m_dbin; - UINT8 m_lowbyte; - UINT8 m_highbyte; - UINT8 m_latch; + uint8_t m_lowbyte; + uint8_t m_highbyte; + uint8_t m_latch; // Mapper registers - UINT8 m_mapper[16]; + uint8_t m_mapper[16]; // Latch for 9901 INT2, INT1 lines int m_9901_int; @@ -448,9 +448,9 @@ SETOFFSET_MEMBER( ti99_4p_state::setoffset ) READ16_MEMBER( ti99_4p_state::memread ) { int address = 0; - UINT8 hbyte = 0; + uint8_t hbyte = 0; - UINT16 value = 0; + uint16_t value = 0; int addr_off8k = m_addr_buf & 0x1fff; @@ -578,9 +578,9 @@ WRITE16_MEMBER( ti99_4p_state::memwrite ) */ READ16_MEMBER( ti99_4p_state::debugger_read ) { - UINT8 lval = 0; - UINT8 hval = 0; - UINT16 addrb = offset << 1; + uint8_t lval = 0; + uint8_t hval = 0; + uint16_t addrb = offset << 1; m_peribox->memen_in(ASSERT_LINE); m_peribox->readz(space, addrb+1, &lval); m_peribox->readz(space, addrb, &hval); @@ -712,7 +712,7 @@ WRITE8_MEMBER( ti99_4p_state::cruwrite ) READ8_MEMBER( ti99_4p_state::cruread ) { - UINT8 value = 0; + uint8_t value = 0; m_peribox->crureadz(space, offset<<4, &value); return value; } @@ -752,7 +752,7 @@ READ8_MEMBER( ti99_4p_state::read_by_9901 ) break; case TMS9901_INT8_INT15: - // Read pins INT8*-INT15* of TI99's 9901. + // Read pins int8_t*-INT15* of TI99's 9901. // bit 0-2: keyboard status bits 5 to 7 // bit 3: tape input mirror // bit 5-7: weird, not emulated @@ -938,7 +938,7 @@ void ti99_4p_state::machine_start() m_sysready = ASSERT_LINE; m_muxready = true; - m_rom = (UINT16*)(memregion("maincpu")->base()); + m_rom = (uint16_t*)(memregion("maincpu")->base()); save_item(NAME(m_firstjoy)); save_item(NAME(m_keyboard_column)); diff --git a/src/mame/drivers/ti99_4x.cpp b/src/mame/drivers/ti99_4x.cpp index 1d744f8d580..aae0849ec61 100644 --- a/src/mame/drivers/ti99_4x.cpp +++ b/src/mame/drivers/ti99_4x.cpp @@ -378,7 +378,7 @@ INPUT_PORTS_END READ8_MEMBER( ti99_4x_state::cruread ) { // if (TRACE_CRU) logerror("read access to CRU address %04x\n", offset << 4); - UINT8 value = 0; + uint8_t value = 0; // Similar to the bus8z_devices, just let the gromport and the p-box // decide whether they want to change the value at the CRU address diff --git a/src/mame/drivers/ti99_8.cpp b/src/mame/drivers/ti99_8.cpp index 3697e70e7fa..0c9f9d7a646 100644 --- a/src/mame/drivers/ti99_8.cpp +++ b/src/mame/drivers/ti99_8.cpp @@ -408,7 +408,7 @@ INPUT_PORTS_END READ8_MEMBER( ti99_8_state::cruread ) { // if (VERBOSE>6) logerror("read access to CRU address %04x\n", offset << 4); - UINT8 value = 0; + uint8_t value = 0; // Similar to the bus8z_devices, just let the mapper, the gromport, and the p-box // decide whether they want to change the value at the CRU address @@ -445,7 +445,7 @@ static const char *const column[] = { READ8_MEMBER( ti99_8_state::read_by_9901 ) { int answer=0; - UINT8 joyst; + uint8_t joyst; switch (offset & 0x03) { case TMS9901_CB_INT7: @@ -475,7 +475,7 @@ READ8_MEMBER( ti99_8_state::read_by_9901 ) break; case TMS9901_INT8_INT15: - // Read pins INT8*-INT15* of TI99's 9901. + // Read pins int8_t*-INT15* of TI99's 9901. // // bit 0-2: keyboard status bits 2 to 4 // bit 3: tape input mirror diff --git a/src/mame/drivers/ticalc1x.cpp b/src/mame/drivers/ticalc1x.cpp index f536ddbb9ea..a2621f28158 100644 --- a/src/mame/drivers/ticalc1x.cpp +++ b/src/mame/drivers/ticalc1x.cpp @@ -76,11 +76,11 @@ void cmulti8_state::prepare_display() set_display_segmask(0xfffff, 0xff); // M-digit is on in memory mode, upper row is off in single mode - UINT32 m = (m_inp_matrix[10]->read() & 0x10) ? 0x100000 : 0; - UINT32 mask = (m_inp_matrix[10]->read() & 0x20) ? 0xfffff : 0xffc00; + uint32_t m = (m_inp_matrix[10]->read() & 0x10) ? 0x100000 : 0; + uint32_t mask = (m_inp_matrix[10]->read() & 0x20) ? 0xfffff : 0xffc00; // R10 selects display row - UINT32 sel = (m_r & 0x400) ? (m_r & 0x3ff) : (m_r << 10 & 0xffc00); + uint32_t sel = (m_r & 0x400) ? (m_r & 0x3ff) : (m_r << 10 & 0xffc00); display_matrix(8, 21, m_o, (sel & mask) | m); } @@ -865,8 +865,8 @@ public: WRITE16_MEMBER(lilprof78_state::write_r) { // update leds state - UINT8 seg = BITSWAP8(m_o,7,4,3,2,1,0,6,5) & 0x7f; - UINT16 r = (data & 7) | (data << 1 & 0x1f0); + uint8_t seg = BITSWAP8(m_o,7,4,3,2,1,0,6,5) & 0x7f; + uint16_t r = (data & 7) | (data << 1 & 0x1f0); set_display_segmask(0x1ff, 0x7f); display_matrix(7, 9, seg, r, false); diff --git a/src/mame/drivers/tickee.cpp b/src/mame/drivers/tickee.cpp index 214f0ef240f..ef49cfa2965 100644 --- a/src/mame/drivers/tickee.cpp +++ b/src/mame/drivers/tickee.cpp @@ -55,14 +55,14 @@ public: required_device m_screen; required_device m_tlc34076; - required_shared_ptr m_vram; - optional_shared_ptr m_control; + required_shared_ptr m_vram; + optional_shared_ptr m_control; emu_timer *m_setup_gun_timer; int m_beamxadd; int m_beamyadd; int m_palette_bank; - UINT8 m_gunx[2]; + uint8_t m_gunx[2]; void get_crosshair_xy(int player, int &x, int &y); DECLARE_WRITE16_MEMBER(rapidfir_transparent_w); @@ -206,8 +206,8 @@ VIDEO_START_MEMBER(tickee_state,tickee) TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::scanline_update) { - UINT16 *src = &m_vram[(params->rowaddr << 8) & 0x3ff00]; - UINT32 *dest = &bitmap.pix32(scanline); + uint16_t *src = &m_vram[(params->rowaddr << 8) & 0x3ff00]; + uint32_t *dest = &bitmap.pix32(scanline); const rgb_t *pens = m_tlc34076->get_pens(); int coladdr = params->coladdr << 1; int x; @@ -222,7 +222,7 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::scanline_update) /* copy the non-blanked portions of this scanline */ for (x = params->heblnk; x < params->hsblnk; x += 2) { - UINT16 pixels = src[coladdr++ & 0xff]; + uint16_t pixels = src[coladdr++ & 0xff]; dest[x + 0] = pens[pixels & 0xff]; dest[x + 1] = pens[pixels >> 8]; } @@ -231,8 +231,8 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::scanline_update) TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::rapidfir_scanline_update) { - UINT16 *src = &m_vram[(params->rowaddr << 8) & 0x3ff00]; - UINT32 *dest = &bitmap.pix32(scanline); + uint16_t *src = &m_vram[(params->rowaddr << 8) & 0x3ff00]; + uint32_t *dest = &bitmap.pix32(scanline); const rgb_t *pens = m_tlc34076->get_pens(); int coladdr = params->coladdr << 1; int x; @@ -251,7 +251,7 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(tickee_state::rapidfir_scanline_update) /* copy the non-blanked portions of this scanline */ for (x = params->heblnk; x < params->hsblnk; x += 2) { - UINT16 pixels = src[coladdr++ & 0xff]; + uint16_t pixels = src[coladdr++ & 0xff]; dest[x + 0] = pens[pixels & 0xff]; dest[x + 1] = pens[pixels >> 8]; } @@ -321,7 +321,7 @@ TMS340X0_FROM_SHIFTREG_CB_MEMBER(tickee_state::rapidfir_from_shiftreg) WRITE16_MEMBER(tickee_state::tickee_control_w) { - UINT16 olddata = m_control[offset]; + uint16_t olddata = m_control[offset]; /* offsets: diff --git a/src/mame/drivers/tiki100.cpp b/src/mame/drivers/tiki100.cpp index 6eeb30a6679..a21e62853bf 100644 --- a/src/mame/drivers/tiki100.cpp +++ b/src/mame/drivers/tiki100.cpp @@ -31,10 +31,10 @@ READ8_MEMBER( tiki100_state::mrq_r ) { bool mdis = 1; - UINT8 data = m_exp->mrq_r(space, offset, 0xff, mdis); + uint8_t data = m_exp->mrq_r(space, offset, 0xff, mdis); offs_t prom_addr = mdis << 5 | m_vire << 4 | m_rome << 3 | (offset >> 13); - UINT8 prom = m_prom->base()[prom_addr] ^ 0xff; + uint8_t prom = m_prom->base()[prom_addr] ^ 0xff; if (prom & ROM0) { @@ -48,7 +48,7 @@ READ8_MEMBER( tiki100_state::mrq_r ) if (prom & VIR) { - UINT16 addr = (offset + (m_scroll << 7)) & TIKI100_VIDEORAM_MASK; + uint16_t addr = (offset + (m_scroll << 7)) & TIKI100_VIDEORAM_MASK; data = m_video_ram[addr]; } @@ -65,11 +65,11 @@ WRITE8_MEMBER( tiki100_state::mrq_w ) { bool mdis = 1; offs_t prom_addr = mdis << 5 | m_vire << 4 | m_rome << 3 | (offset >> 13); - UINT8 prom = m_prom->base()[prom_addr] ^ 0xff; + uint8_t prom = m_prom->base()[prom_addr] ^ 0xff; if (prom & VIR) { - UINT16 addr = (offset + (m_scroll << 7)) & TIKI100_VIDEORAM_MASK; + uint16_t addr = (offset + (m_scroll << 7)) & TIKI100_VIDEORAM_MASK; m_video_ram[addr] = data; } @@ -84,7 +84,7 @@ WRITE8_MEMBER( tiki100_state::mrq_w ) READ8_MEMBER( tiki100_state::iorq_r ) { - UINT8 data = m_exp->iorq_r(space, offset, 0xff); + uint8_t data = m_exp->iorq_r(space, offset, 0xff); switch ((offset & 0xff) >> 2) { @@ -178,7 +178,7 @@ WRITE8_MEMBER( tiki100_state::iorq_w ) READ8_MEMBER( tiki100_state::keyboard_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (m_keylatch < 12) { @@ -218,7 +218,7 @@ WRITE8_MEMBER( tiki100_state::video_mode_w ) if (BIT(data, 7)) { int color = data & 0x0f; - UINT8 colordata = ~m_palette_val; + uint8_t colordata = ~m_palette_val; m_palette->set_pen_color(color, pal3bit(colordata >> 5), pal3bit(colordata >> 2), pal2bit(colordata >> 0)); } @@ -446,17 +446,17 @@ INPUT_PORTS_END /* Video */ -UINT32 tiki100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t tiki100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT16 addr = (m_scroll << 7); + uint16_t addr = (m_scroll << 7); int sx, y, pixel, mode = (m_mode >> 4) & 0x03; for (y = 0; y < 256; y++) { for (sx = 0; sx < 128; sx++) { - UINT8 data = m_video_ram[addr & TIKI100_VIDEORAM_MASK]; + uint8_t data = m_video_ram[addr & TIKI100_VIDEORAM_MASK]; switch (mode) { @@ -551,7 +551,7 @@ READ8_MEMBER( tiki100_state::pio_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // centronics data |= m_centronics_ack << 4; diff --git a/src/mame/drivers/tim011.cpp b/src/mame/drivers/tim011.cpp index df21a50a15c..90b46467809 100644 --- a/src/mame/drivers/tim011.cpp +++ b/src/mame/drivers/tim011.cpp @@ -28,13 +28,13 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_tim011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tim011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(print_w); DECLARE_WRITE8_MEMBER(scroll_w); DECLARE_WRITE8_MEMBER(fdc_dma_w); DECLARE_READ8_MEMBER(print_r); DECLARE_READ8_MEMBER(scroll_r); - UINT8 m_scroll; + uint8_t m_scroll; required_device m_maincpu; required_device m_fdc; @@ -78,7 +78,7 @@ void tim011_state::video_start() { } -UINT32 tim011_state::screen_update_tim011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tim011_state::screen_update_tim011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/tim100.cpp b/src/mame/drivers/tim100.cpp index 26900fef369..382293af94c 100644 --- a/src/mame/drivers/tim100.cpp +++ b/src/mame/drivers/tim100.cpp @@ -43,9 +43,9 @@ public: private: virtual void machine_start() override; - UINT8 *m_charmap; - UINT16 m_dma_adr; - required_shared_ptr m_p_videoram; + uint8_t *m_charmap; + uint16_t m_dma_adr; + required_shared_ptr m_p_videoram; required_device m_maincpu; required_device m_palette; required_device m_crtc; @@ -116,8 +116,8 @@ GFXDECODE_END I8275_DRAW_CHARACTER_MEMBER( tim100_state::crtc_display_pixels ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 pixels; - for (UINT8 i = 0; i < 2; i++) + uint8_t pixels; + for (uint8_t i = 0; i < 2; i++) { pixels = m_charmap[(i * 0x1000) | (linecount & 15) | (charcode << 4)]; if (vsp) diff --git a/src/mame/drivers/timetrv.cpp b/src/mame/drivers/timetrv.cpp index c3677eb3b2d..044392c7e4c 100644 --- a/src/mame/drivers/timetrv.cpp +++ b/src/mame/drivers/timetrv.cpp @@ -38,14 +38,14 @@ public: m_led_vram_hi(*this, "led_vrahi"), m_maincpu(*this, "maincpu") { } - required_shared_ptr m_led_vram_lo; - required_shared_ptr m_led_vram_hi; + required_shared_ptr m_led_vram_lo; + required_shared_ptr m_led_vram_hi; DECLARE_READ8_MEMBER(test1_r); DECLARE_READ8_MEMBER(test2_r); DECLARE_READ8_MEMBER(in_r); DECLARE_READ8_MEMBER(ld_r); virtual void video_start() override; - UINT32 screen_update_timetrv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_timetrv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(ld_irq); required_device m_maincpu; @@ -57,7 +57,7 @@ void timetrv_state::video_start() { } -UINT32 timetrv_state::screen_update_timetrv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t timetrv_state::screen_update_timetrv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { popmessage("%s%s",reinterpret_cast(m_led_vram_lo.target()),reinterpret_cast(m_led_vram_hi.target())); return 0; diff --git a/src/mame/drivers/timex.cpp b/src/mame/drivers/timex.cpp index 8b63f982b80..f1a0cac7890 100644 --- a/src/mame/drivers/timex.cpp +++ b/src/mame/drivers/timex.cpp @@ -215,15 +215,15 @@ WRITE8_MEMBER( spectrum_state::ts2068_port_ff_w ) *******************************************************************/ void spectrum_state::ts2068_update_memory() { - UINT8 *messram = nullptr; + uint8_t *messram = nullptr; if (m_ram) messram = m_ram->pointer(); address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *DOCK = nullptr; + uint8_t *DOCK = nullptr; if (m_dock_crt) DOCK = m_dock_crt->base(); - UINT8 *ExROM = memregion("maincpu")->base() + 0x014000; - UINT8 *ChosenROM; + uint8_t *ExROM = memregion("maincpu")->base() + 0x014000; + uint8_t *ChosenROM; if (m_port_f4_data & 0x01) { @@ -588,7 +588,7 @@ ADDRESS_MAP_END MACHINE_RESET_MEMBER(spectrum_state,tc2048) { - UINT8 *messram = m_ram->pointer(); + uint8_t *messram = m_ram->pointer(); membank("bank1")->set_base(messram); membank("bank2")->set_base(messram); @@ -600,13 +600,13 @@ MACHINE_RESET_MEMBER(spectrum_state,tc2048) DEVICE_IMAGE_LOAD_MEMBER( spectrum_state, timex_cart ) { - UINT32 size = m_dock->common_get_size("rom"); + uint32_t size = m_dock->common_get_size("rom"); if (image.software_entry() == nullptr) { - UINT8 *DOCK; + uint8_t *DOCK; int chunks_in_file = 0; - std::vector header; + std::vector header; header.resize(9); if (size % 0x2000 != 9) diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp index dea10f66d29..d51c44dee0e 100644 --- a/src/mame/drivers/tispeak.cpp +++ b/src/mame/drivers/tispeak.cpp @@ -452,21 +452,21 @@ public: DECLARE_WRITE16_MEMBER(snspellc_write_r); DECLARE_READ8_MEMBER(tntell_read_k); - void k28_prepare_display(UINT8 old, UINT8 data); + void k28_prepare_display(uint8_t old, uint8_t data); DECLARE_READ8_MEMBER(k28_read_k); DECLARE_WRITE16_MEMBER(k28_write_o); DECLARE_WRITE16_MEMBER(k28_write_r); // cartridge - UINT32 m_cart_max_size; - UINT8* m_cart_base; + uint32_t m_cart_max_size; + uint8_t* m_cart_base; void init_cartridge(); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(tispeak_cartridge); DECLARE_DRIVER_INIT(snspell); DECLARE_DRIVER_INIT(tntell); DECLARE_DRIVER_INIT(lantutor); - UINT8 m_overlay; + uint8_t m_overlay; TIMER_DEVICE_CALLBACK_MEMBER(tntell_get_overlay); protected: @@ -504,7 +504,7 @@ void tispeak_state::init_cartridge() DEVICE_IMAGE_LOAD_MEMBER(tispeak_state, tispeak_cartridge) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size > m_cart_max_size) { @@ -549,7 +549,7 @@ DRIVER_INIT_MEMBER(tispeak_state, lantutor) void tispeak_state::prepare_display() { - UINT16 gridmask = vfd_filament_on() ? 0xffff : 0x8000; + uint16_t gridmask = vfd_filament_on() ? 0xffff : 0x8000; set_display_segmask(0x21ff, 0x3fff); display_matrix(16+1, 16, m_plate | 1<<16, m_grid & gridmask); } @@ -640,7 +640,7 @@ WRITE16_MEMBER(tispeak_state::snspellc_write_o) READ8_MEMBER(tispeak_state::snspellc_read_k) { // K4: TMS5100 CTL1 - UINT8 k4 = m_tms5100->ctl_r(space, 0) << 2 & 4; + uint8_t k4 = m_tms5100->ctl_r(space, 0) << 2 & 4; // K: multiplexed inputs (note: the Vss row is always on) return k4 | m_inp_matrix[9]->read() | read_inputs(9); @@ -652,7 +652,7 @@ READ8_MEMBER(tispeak_state::snspellc_read_k) READ8_MEMBER(tispeak_state::tntell_read_k) { // K8: overlay code from R5,O4-O7 - UINT8 k8 = (((m_r >> 1 & 0x10) | (m_o >> 4 & 0xf)) & m_overlay) ? 8 : 0; + uint8_t k8 = (((m_r >> 1 & 0x10) | (m_o >> 4 & 0xf)) & m_overlay) ? 8 : 0; // rest is same as snpellc return k8 | snspellc_read_k(space, offset); @@ -678,7 +678,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(tispeak_state::tntell_get_overlay) // k28 specific -void tispeak_state::k28_prepare_display(UINT8 old, UINT8 data) +void tispeak_state::k28_prepare_display(uint8_t old, uint8_t data) { // ? } diff --git a/src/mame/drivers/tispellb.cpp b/src/mame/drivers/tispellb.cpp index 4d1198f1d93..40936b78e14 100644 --- a/src/mame/drivers/tispellb.cpp +++ b/src/mame/drivers/tispellb.cpp @@ -76,9 +76,9 @@ public: optional_device m_subcpu; optional_device m_tms6100; - UINT8 m_rev1_ctl; - UINT16 m_sub_o; - UINT16 m_sub_r; + uint8_t m_rev1_ctl; + uint16_t m_sub_o; + uint16_t m_sub_r; virtual DECLARE_INPUT_CHANGED_MEMBER(power_button) override; void power_off(); @@ -140,7 +140,7 @@ void tispellb_state::power_off() void tispellb_state::prepare_display() { // almost same as snspell - UINT16 gridmask = vfd_filament_on() ? 0xffff : 0x8000; + uint16_t gridmask = vfd_filament_on() ? 0xffff : 0x8000; set_display_segmask(0xff, 0x3fff); display_matrix(16+1, 16, m_plate | 1<<16, m_grid & gridmask); } diff --git a/src/mame/drivers/tk2000.cpp b/src/mame/drivers/tk2000.cpp index 8af716b28a9..f83f6058186 100644 --- a/src/mame/drivers/tk2000.cpp +++ b/src/mame/drivers/tk2000.cpp @@ -70,7 +70,7 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(tk2000); - 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); DECLARE_READ8_MEMBER(ram_r); DECLARE_WRITE8_MEMBER(ram_w); @@ -85,15 +85,15 @@ private: int m_speaker_state; int m_cassette_state; - UINT8 m_strobe; + uint8_t m_strobe; bool m_page2; - UINT8 *m_ram_ptr; + uint8_t *m_ram_ptr; int m_ram_size; void do_io(address_space &space, int offset); - UINT8 read_floatingbus(); + uint8_t read_floatingbus(); }; /*************************************************************************** @@ -152,7 +152,7 @@ PALETTE_INIT_MEMBER(tk2000_state, tk2000) m_video->palette_init_apple2(palette); } -UINT32 tk2000_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tk2000_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_video->hgr_update(screen, bitmap, cliprect, 0, 191); return 0; @@ -287,7 +287,7 @@ WRITE8_MEMBER(tk2000_state::c100_w) } // floating bus code from old machine/apple2: needs to be reworked based on real beam position to enable e.g. Bob Bishop's screen splitter -UINT8 tk2000_state::read_floatingbus() +uint8_t tk2000_state::read_floatingbus() { enum { diff --git a/src/mame/drivers/tk80.cpp b/src/mame/drivers/tk80.cpp index f5a06825460..d36e449a3fd 100644 --- a/src/mame/drivers/tk80.cpp +++ b/src/mame/drivers/tk80.cpp @@ -69,11 +69,11 @@ public: DECLARE_WRITE8_MEMBER(mikrolab_serial_w); DECLARE_READ8_MEMBER(display_r); DECLARE_WRITE8_MEMBER(display_w); - UINT8 m_term_data; - UINT8 m_keyb_press; - UINT8 m_keyb_press_flag; - UINT8 m_shift_press_flag; - UINT8 m_ppi_portc; + uint8_t m_term_data; + uint8_t m_keyb_press; + uint8_t m_keyb_press_flag; + uint8_t m_shift_press_flag; + uint8_t m_ppi_portc; required_device m_maincpu; }; @@ -195,7 +195,7 @@ READ8_MEMBER( tk80_state::key_matrix_r ) { // PA0-7 keyscan in - UINT8 data = 0xff; + uint8_t data = 0xff; if (BIT(m_ppi_portc, 4)) data &= ioport("X0")->read(); @@ -211,7 +211,7 @@ READ8_MEMBER( tk80_state::nd80z_key_r ) { // PA0-7 keyscan in - UINT8 data = 0xff, row = m_ppi_portc & 7; + uint8_t data = 0xff, row = m_ppi_portc & 7; if (row == 6) data &= ioport("X0")->read(); else diff --git a/src/mame/drivers/tk80bs.cpp b/src/mame/drivers/tk80bs.cpp index 766a371e638..728e6c8401b 100644 --- a/src/mame/drivers/tk80bs.cpp +++ b/src/mame/drivers/tk80bs.cpp @@ -47,10 +47,10 @@ public: DECLARE_WRITE8_MEMBER(kbd_put); DECLARE_READ8_MEMBER(port_a_r); DECLARE_READ8_MEMBER(port_b_r); - UINT32 screen_update_tk80bs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_videoram; + uint32_t screen_update_tk80bs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; private: - UINT8 m_term_data; + uint8_t m_term_data; required_device m_maincpu; required_device m_ppi; required_device m_gfxdecode; @@ -58,7 +58,7 @@ private: }; -UINT32 tk80bs_state::screen_update_tk80bs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tk80bs_state::screen_update_tk80bs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; int count; @@ -126,7 +126,7 @@ INPUT_PORTS_END READ8_MEMBER( tk80bs_state::port_a_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/tm990189.cpp b/src/mame/drivers/tm990189.cpp index c924b89ddf8..47de4b0de97 100644 --- a/src/mame/drivers/tm990189.cpp +++ b/src/mame/drivers/tm990189.cpp @@ -101,17 +101,17 @@ public: int m_digitsel; int m_segment; emu_timer *m_displayena_timer; - UINT8 m_segment_state[10]; - UINT8 m_old_segment_state[10]; - UINT8 m_LED_state; + uint8_t m_segment_state[10]; + uint8_t m_old_segment_state[10]; + uint8_t m_LED_state; emu_timer *m_joy1x_timer; emu_timer *m_joy1y_timer; emu_timer *m_joy2x_timer; emu_timer *m_joy2y_timer; device_image_interface *m_rs232_fp; - UINT8 m_rs232_rts; + uint8_t m_rs232_rts; emu_timer *m_rs232_input_timer; - UINT8 m_bogus_read_save; + uint8_t m_bogus_read_save; DECLARE_WRITE8_MEMBER( external_operation ); @@ -238,7 +238,7 @@ void tm990189_state::draw_digit() TIMER_DEVICE_CALLBACK_MEMBER(tm990189_state::display_callback) { - UINT8 i; + uint8_t i; char ledname[8]; // since the segment data is cleared after being used, the old_segment is there // in case the segment data hasn't been refreshed yet. @@ -309,7 +309,7 @@ WRITE8_MEMBER( tm990189_state::sys9901_interrupt_callback ) READ8_MEMBER( tm990189_state::sys9901_r ) { - UINT8 data = 0; + uint8_t data = 0; if (offset == TMS9901_CB_INT7) { static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8" }; @@ -429,7 +429,7 @@ class tm990_189_rs232_image_device : public device_t, { public: // construction/destruction - tm990_189_rs232_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tm990_189_rs232_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_SERIAL; } @@ -453,7 +453,7 @@ protected: const device_type TM990_189_RS232 = &device_creator; -tm990_189_rs232_image_device::tm990_189_rs232_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tm990_189_rs232_image_device::tm990_189_rs232_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TM990_189_RS232, "TM990/189 RS232 port", tag, owner, clock, "tm990_189_rs232_image", __FILE__), device_image_interface(mconfig, *this) { @@ -471,7 +471,7 @@ void tm990_189_rs232_image_device::device_start() void tm990_189_rs232_image_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { //tm990189_state *state = machine.driver_data(); - UINT8 buf; + uint8_t buf; if (/*state->m_rs232_rts &&*/ /*(mame_ftell(state->m_rs232_fp) < mame_fsize(state->m_rs232_fp))*/1) { tms9902_device* tms9902 = static_cast(machine().device("tms9902")); @@ -513,7 +513,7 @@ void tm990_189_rs232_image_device::call_unload() WRITE8_MEMBER( tm990189_state::xmit_callback ) { - UINT8 buf = data; + uint8_t buf = data; if (m_rs232_fp) m_rs232_fp->fwrite(&buf, 1); } @@ -597,7 +597,7 @@ WRITE8_MEMBER( tm990189_state::video_vdp_w ) READ8_MEMBER( tm990189_state::video_joy_r ) { - UINT8 data = ioport("BUTTONS")->read(); + uint8_t data = ioport("BUTTONS")->read(); if (m_joy1x_timer->remaining() < attotime::zero) data |= 0x01; diff --git a/src/mame/drivers/tmaster.cpp b/src/mame/drivers/tmaster.cpp index cae1ada35fd..5656d23a8e5 100644 --- a/src/mame/drivers/tmaster.cpp +++ b/src/mame/drivers/tmaster.cpp @@ -135,25 +135,25 @@ public: required_device m_maincpu; optional_device m_microtouch; - required_shared_ptr m_regs; - optional_shared_ptr m_galgames_ram; + required_shared_ptr m_regs; + optional_shared_ptr m_galgames_ram; required_device m_oki; optional_device m_duart; required_device m_screen; required_device m_palette; int m_okibank; - UINT8 m_rtc_ram[8]; + uint8_t m_rtc_ram[8]; bitmap_ind16 m_bitmap[2][2]; - UINT16 m_color; - UINT16 m_addr; - UINT32 m_gfx_offs; - UINT32 m_gfx_size; - int (tmaster_state::*m_compute_addr) (UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high); - UINT16 m_galgames_cart; - UINT32 m_palette_offset; - UINT8 m_palette_index; - UINT8 m_palette_data[3]; + uint16_t m_color; + uint16_t m_addr; + uint32_t m_gfx_offs; + uint32_t m_gfx_size; + int (tmaster_state::*m_compute_addr) (uint16_t reg_low, uint16_t reg_mid, uint16_t reg_high); + uint16_t m_galgames_cart; + uint32_t m_palette_offset; + uint8_t m_palette_index; + uint8_t m_palette_data[3]; DECLARE_WRITE_LINE_MEMBER(duart_irq_handler); DECLARE_READ16_MEMBER(rtc_r); @@ -183,13 +183,13 @@ public: DECLARE_VIDEO_START(tmaster); DECLARE_MACHINE_RESET(galgames); DECLARE_VIDEO_START(galgames); - UINT32 screen_update_tmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(tm3k_interrupt); - UINT8 binary_to_BCD(UINT8 data); - int tmaster_compute_addr(UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high); - int galgames_compute_addr(UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high); + uint8_t binary_to_BCD(uint8_t data); + int tmaster_compute_addr(uint16_t reg_low, uint16_t reg_mid, uint16_t reg_high); + int galgames_compute_addr(uint16_t reg_low, uint16_t reg_mid, uint16_t reg_high); void tmaster_draw(); - void galgames_update_rombank(UINT32 cart); + void galgames_update_rombank(uint32_t cart); }; @@ -237,7 +237,7 @@ WRITE_LINE_MEMBER(tmaster_state::duart_irq_handler) ***************************************************************************/ -UINT8 tmaster_state::binary_to_BCD(UINT8 data) +uint8_t tmaster_state::binary_to_BCD(uint8_t data) { data %= 100; @@ -317,12 +317,12 @@ WRITE16_MEMBER(tmaster_state::rtc_w) ***************************************************************************/ -int tmaster_state::tmaster_compute_addr(UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high) +int tmaster_state::tmaster_compute_addr(uint16_t reg_low, uint16_t reg_mid, uint16_t reg_high) { return (reg_low & 0xff) | ((reg_mid & 0x1ff) << 8) | (reg_high << 17); } -int tmaster_state::galgames_compute_addr(UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high) +int tmaster_state::galgames_compute_addr(uint16_t reg_low, uint16_t reg_mid, uint16_t reg_high) { return reg_low | (reg_mid << 16); } @@ -348,7 +348,7 @@ VIDEO_START_MEMBER(tmaster_state,galgames) m_compute_addr = &tmaster_state::galgames_compute_addr; } -UINT32 tmaster_state::screen_update_tmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tmaster_state::screen_update_tmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; @@ -385,9 +385,9 @@ void tmaster_state::tmaster_draw() { int x,y,x0,x1,y0,y1,dx,dy,flipx,flipy,sx,sy,sw,sh, addr, mode, layer,buffer, color; - UINT8 *gfxdata = memregion( "blitter" )->base() + m_gfx_offs; + uint8_t *gfxdata = memregion( "blitter" )->base() + m_gfx_offs; - UINT16 pen; + uint16_t pen; buffer = (m_regs[0x02/2] >> 8) & 3; // 1 bit per layer, selects the currently displayed buffer sw = m_regs[0x04/2]; @@ -440,8 +440,8 @@ void tmaster_state::tmaster_draw() { // copy from ROM, replacing occurrences of src pen with dst pen - UINT8 dst_pen = (m_color >> 8) & 0xff; - UINT8 src_pen = (m_color >> 0) & 0xff; + uint8_t dst_pen = (m_color >> 8) & 0xff; + uint8_t src_pen = (m_color >> 0) & 0xff; for (y = y0; y != y1; y += dy) { @@ -644,7 +644,7 @@ WRITE16_MEMBER(tmaster_state::galgames_okiram_w) // Carts (preliminary, PIC communication is not implemented) -void tmaster_state::galgames_update_rombank(UINT32 cart) +void tmaster_state::galgames_update_rombank(uint32_t cart) { m_galgames_cart = cart; @@ -1787,7 +1787,7 @@ ROM_END DRIVER_INIT_MEMBER(tmaster_state,galgames) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int cart; // RAM bank at 0x000000-0x03ffff and 0x200000-0x23ffff @@ -1809,7 +1809,7 @@ DRIVER_INIT_MEMBER(tmaster_state,galgames) for (cart = 1; cart <= 4; cart++) { - UINT8 *CART = memregion("maincpu")->base(); + uint8_t *CART = memregion("maincpu")->base(); if (0x200000 * (cart+1) <= memregion("maincpu")->bytes()) CART += 0x200000 * cart; @@ -1821,7 +1821,7 @@ DRIVER_INIT_MEMBER(tmaster_state,galgames) DRIVER_INIT_MEMBER(tmaster_state,galgame2) { - UINT16 *ROM = (UINT16 *)memregion( "maincpu" )->base(); + uint16_t *ROM = (uint16_t *)memregion( "maincpu" )->base(); // Patch BIOS to see the game code as first cartridge (until the PIC therein is emulated) ROM[0x118da/2] = 0x4a06; diff --git a/src/mame/drivers/tmc1800.cpp b/src/mame/drivers/tmc1800.cpp index 257c9b876a4..8f29c7c8375 100644 --- a/src/mame/drivers/tmc1800.cpp +++ b/src/mame/drivers/tmc1800.cpp @@ -171,8 +171,8 @@ WRITE8_MEMBER( nano_state::keylatch_w ) void tmc2000_state::bankswitch() { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); - UINT8 *rom = m_rom->base(); + uint8_t *ram = m_ram->pointer(); + uint8_t *rom = m_rom->base(); if (m_roc) { @@ -224,7 +224,7 @@ WRITE8_MEMBER( nano_state::bankswitch_w ) { /* enable RAM */ address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); program.install_ram(0x0000, 0x0fff, 0x7000, ram); /* write to CDP1864 tone latch */ @@ -530,7 +530,7 @@ READ_LINE_MEMBER( tmc2000_state::ef2_r ) READ_LINE_MEMBER( tmc2000_state::ef3_r ) { - UINT8 data = ~m_key_row[m_keylatch / 8]->read(); + uint8_t data = ~m_key_row[m_keylatch / 8]->read(); return BIT(data, m_keylatch % 8); } @@ -572,7 +572,7 @@ READ_LINE_MEMBER( nano_state::ef2_r ) READ_LINE_MEMBER( nano_state::ef3_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!BIT(m_keylatch, 3)) data &= m_ny0->read(); if (!BIT(m_keylatch, 4)) data &= m_ny1->read(); @@ -624,7 +624,7 @@ void osc1000b_state::machine_reset() void tmc2000_state::machine_start() { - UINT16 addr; + uint16_t addr; m_colorram.allocate(TMC2000_COLORRAM_SIZE); @@ -679,7 +679,7 @@ void nano_state::machine_reset() /* enable ROM */ address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *rom = m_rom->base(); + uint8_t *rom = m_rom->base(); program.install_rom(0x0000, 0x01ff, 0x7e00, rom); } @@ -687,7 +687,7 @@ void nano_state::machine_reset() QUICKLOAD_LOAD_MEMBER( tmc1800_base_state, tmc1800 ) { - UINT8 *ptr = m_rom->base(); + uint8_t *ptr = m_rom->base(); int size = image.length(); if (size > m_ram->size()) diff --git a/src/mame/drivers/tmc2000e.cpp b/src/mame/drivers/tmc2000e.cpp index 4586f557996..8291efb580b 100644 --- a/src/mame/drivers/tmc2000e.cpp +++ b/src/mame/drivers/tmc2000e.cpp @@ -226,7 +226,7 @@ READ_LINE_MEMBER( tmc2000e_state::ef2_r ) READ_LINE_MEMBER( tmc2000e_state::ef3_r ) { - UINT8 data = ~(m_key_row[m_keylatch / 8])->read(); + uint8_t data = ~(m_key_row[m_keylatch / 8])->read(); return BIT(data, m_keylatch % 8); } diff --git a/src/mame/drivers/tmc600.cpp b/src/mame/drivers/tmc600.cpp index 4eddb1c7d01..06b1c116118 100644 --- a/src/mame/drivers/tmc600.cpp +++ b/src/mame/drivers/tmc600.cpp @@ -208,7 +208,7 @@ READ_LINE_MEMBER( tmc600_state::ef2_r ) READ_LINE_MEMBER( tmc600_state::ef3_r ) { - UINT8 data = ~m_key_row[m_keylatch / 8]->read(); + uint8_t data = ~m_key_row[m_keylatch / 8]->read(); return BIT(data, m_keylatch % 8); } diff --git a/src/mame/drivers/tmmjprd.cpp b/src/mame/drivers/tmmjprd.cpp index 0043e846fde..3040b47386b 100644 --- a/src/mame/drivers/tmmjprd.cpp +++ b/src/mame/drivers/tmmjprd.cpp @@ -54,13 +54,13 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr_array m_tilemap_regs; - required_shared_ptr m_spriteregs; - required_shared_ptr m_spriteram; + required_shared_ptr_array m_tilemap_regs; + required_shared_ptr m_spriteregs; + required_shared_ptr m_spriteram; - std::unique_ptr m_tilemap_ram[4]; - UINT8 m_mux_data; - UINT8 m_system_in; + std::unique_ptr m_tilemap_ram[4]; + uint8_t m_mux_data; + uint8_t m_system_in; double m_old_brt1; double m_old_brt2; @@ -81,14 +81,14 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int screen); - void draw_tile(bitmap_ind16 &bitmap, const rectangle &cliprect, int x,int y,int sizex,int sizey, UINT32 tiledata, UINT8* rom); - void draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32*tileram, UINT32*tileregs, UINT8*rom ); + void draw_tile(bitmap_ind16 &bitmap, const rectangle &cliprect, int x,int y,int sizex,int sizey, uint32_t tiledata, uint8_t* rom); + void draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t*tileram, uint32_t*tileregs, uint8_t*rom ); }; @@ -121,11 +121,11 @@ void tmmjprd_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect int xoffs; // int todraw = (m_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half? -// UINT32 *source = (m_spriteram+ (todraw*2))-2; -// UINT32 *finish = m_spriteram; +// uint32_t *source = (m_spriteram+ (todraw*2))-2; +// uint32_t *finish = m_spriteram; - UINT32 *source = m_spriteram+(0xc000/4)-2; - UINT32 *finish = m_spriteram; + uint32_t *source = m_spriteram+(0xc000/4)-2; + uint32_t *finish = m_spriteram; xoffs = (screen & 1)*320; for(;source>finish;source-=2) @@ -143,8 +143,8 @@ void tmmjprd_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect } else { - UINT32 *calc_abs; - UINT8 calc_abs_helper; + uint32_t *calc_abs; + uint8_t calc_abs_helper; int abs_x = 0,abs_y = 0; calc_abs = source-2; @@ -190,7 +190,7 @@ void tmmjprd_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect } } -void tmmjprd_state::draw_tile(bitmap_ind16 &bitmap, const rectangle &cliprect, int x,int y,int sizex,int sizey, UINT32 tiledata, UINT8* rom) +void tmmjprd_state::draw_tile(bitmap_ind16 &bitmap, const rectangle &cliprect, int x,int y,int sizex,int sizey, uint32_t tiledata, uint8_t* rom) { /* note, it's tile address _NOT_ tile number, 'sub-tile' access is possible, hence using the custom rendering */ int tileaddr = (tiledata&0x000fffff)>>0; @@ -222,8 +222,8 @@ void tmmjprd_state::draw_tile(bitmap_ind16 &bitmap, const rectangle &cliprect, i { for (drawx=x;drawxbase(); + uint8_t* gfxroms = memregion("gfx2")->base(); bitmap.fill(m_palette->black_pen(), cliprect); @@ -344,9 +344,9 @@ UINT32 tmmjprd_state::screen_update_left(screen_device &screen, bitmap_ind16 &bi return 0; } -UINT32 tmmjprd_state::screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tmmjprd_state::screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8* gfxroms = memregion("gfx2")->base(); + uint8_t* gfxroms = memregion("gfx2")->base(); bitmap.fill(m_palette->black_pen(), cliprect); @@ -361,10 +361,10 @@ void tmmjprd_state::video_start() { /* the tilemaps are bigger than the regions the cpu can see, need to allocate the ram here */ /* or maybe not for this game/hw .... */ - m_tilemap_ram[0] = make_unique_clear(0x8000); - m_tilemap_ram[1] = make_unique_clear(0x8000); - m_tilemap_ram[2] = make_unique_clear(0x8000); - m_tilemap_ram[3] = make_unique_clear(0x8000); + m_tilemap_ram[0] = make_unique_clear(0x8000); + m_tilemap_ram[1] = make_unique_clear(0x8000); + m_tilemap_ram[2] = make_unique_clear(0x8000); + m_tilemap_ram[3] = make_unique_clear(0x8000); save_pointer(NAME(m_tilemap_ram[0].get()), 0x8000); @@ -413,7 +413,7 @@ TIMER_CALLBACK_MEMBER(tmmjprd_state::blit_done) void tmmjprd_state::do_blit() { - UINT8 *blt_data = memregion("gfx1")->base(); + uint8_t *blt_data = memregion("gfx1")->base(); int blt_source = (m_blitterregs[0]&0x000fffff)>>0; int blt_column = (m_blitterregs[1]&0x00ff0000)>>16; int blt_line = (m_blitterregs[1]&0x000000ff); diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp index 9ea30d285a3..9be3468f7b0 100644 --- a/src/mame/drivers/tmnt.cpp +++ b/src/mame/drivers/tmnt.cpp @@ -219,7 +219,7 @@ READ8_MEMBER(tmnt_state::tmnt_upd_busy_r) SAMPLES_START_CB_MEMBER(tmnt_state::tmnt_decode_sample) { int i; - UINT8 *source = memregion("title")->base(); + uint8_t *source = memregion("title")->base(); save_item(NAME(m_sampledata)); @@ -325,7 +325,7 @@ READ16_MEMBER(tmnt_state::ssriders_protection_r) default: popmessage("%06x: unknown protection read",space.device().safe_pc()); - logerror("%06x: read 1c0800 (D7=%02x 1058fc=%02x 105a0a=%02x)\n",space.device().safe_pc(),(UINT32)space.device().state().state_int(M68K_D7),cmd,data); + logerror("%06x: read 1c0800 (D7=%02x 1058fc=%02x 105a0a=%02x)\n",space.device().safe_pc(),(uint32_t)space.device().state().state_int(M68K_D7),cmd,data); return 0xffff; } } @@ -661,7 +661,7 @@ ADDRESS_MAP_END #if 1 -inline UINT32 tmnt_state::tmnt2_get_word( UINT32 addr ) +inline uint32_t tmnt_state::tmnt2_get_word( uint32_t addr ) { if (addr <= 0x07ffff / 2) return(m_tmnt2_rom[addr]); @@ -672,9 +672,9 @@ inline UINT32 tmnt_state::tmnt2_get_word( UINT32 addr ) return 0; } -void tmnt_state::tmnt2_put_word( address_space &space, UINT32 addr, UINT16 data ) +void tmnt_state::tmnt2_put_word( address_space &space, uint32_t addr, uint16_t data ) { - UINT32 offs; + uint32_t offs; if (addr >= 0x180000 / 2 && addr <= 0x183fff / 2) { m_spriteram[addr - 0x180000 / 2] = data; @@ -691,11 +691,11 @@ void tmnt_state::tmnt2_put_word( address_space &space, UINT32 addr, UINT16 data WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w) { - UINT32 src_addr, dst_addr, mod_addr, attr1, code, attr2, cbase, cmod, color; + uint32_t src_addr, dst_addr, mod_addr, attr1, code, attr2, cbase, cmod, color; int xoffs, yoffs, xmod, ymod, zmod, xzoom, yzoom, i; - UINT16 *mcu; - UINT16 src[4], mod[24]; - UINT8 keepaspect, xlock, ylock, zlock; + uint16_t *mcu; + uint16_t src[4], mod[24]; + uint8_t keepaspect, xlock, ylock, zlock; COMBINE_DATA(m_tmnt2_1c0800 + offset); @@ -725,8 +725,8 @@ WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w) cmod = mod[0x2a / 2] >> 8; color = (cbase != 0x0f && cmod <= 0x1f && !zlock) ? cmod : cbase; - xoffs = (INT16)src[2]; // local x - yoffs = (INT16)src[3]; // local y + xoffs = (int16_t)src[2]; // local x + yoffs = (int16_t)src[3]; // local y i = mod[0]; attr2 |= i & 0x0060; // priority @@ -736,9 +736,9 @@ WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w) // if (i & 0x????) { attr1 ^= 0x2000; yoffs = -yoffs; } // flip y (not used?) if (i & 0x4000) { attr1 ^= 0x1000; xoffs = -xoffs; } // flip x - xmod = (INT16)mod[6]; // global x - ymod = (INT16)mod[7]; // global y - zmod = (INT16)mod[8]; // global z + xmod = (int16_t)mod[6]; // global x + ymod = (int16_t)mod[7]; // global y + zmod = (int16_t)mod[8]; // global z xzoom = mod[0x1c / 2]; yzoom = (keepaspect) ? xzoom : mod[0x1e / 2]; @@ -804,8 +804,8 @@ WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w) tmnt2_put_word(space, dst_addr + 0, attr1); tmnt2_put_word(space, dst_addr + 2, code); - tmnt2_put_word(space, dst_addr + 4, (UINT32)yoffs); - tmnt2_put_word(space, dst_addr + 6, (UINT32)xoffs); + tmnt2_put_word(space, dst_addr + 4, (uint32_t)yoffs); + tmnt2_put_word(space, dst_addr + 6, (uint32_t)xoffs); tmnt2_put_word(space, dst_addr + 12, attr2 | color); } #else // for reference; do not remove @@ -814,9 +814,9 @@ WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w) COMBINE_DATA(m_tmnt2_1c0800 + offset); if (offset == 0x0008 && (m_tmnt2_1c0800[0x8] & 0xff00) == 0x8200) { - UINT32 CellSrc; - UINT32 CellVar; - UINT16 *src; + uint32_t CellSrc; + uint32_t CellVar; + uint16_t *src; int dst; int x,y; @@ -825,7 +825,7 @@ WRITE16_MEMBER(tmnt_state::tmnt2_1c0800_w) CellSrc = m_tmnt2_1c0800[0x00] | (m_tmnt2_1c0800[0x01] << 16 ); // if (CellDest >= 0x180000 && CellDest < 0x183fe0) { CellVar -= 0x104000; - src = (UINT16 *)(memregion("maincpu")->base() + CellSrc); + src = (uint16_t *)(memregion("maincpu")->base() + CellSrc); CellVar >>= 1; @@ -2384,7 +2384,7 @@ MACHINE_CONFIG_END MACHINE_START_MEMBER(tmnt_state,prmrsocr) { MACHINE_START_CALL_MEMBER(common); - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000); } @@ -4150,12 +4150,12 @@ ROM_END static void chunky_to_planar(memory_region *rgn) { - UINT32 *ROM = reinterpret_cast(rgn->base()); + uint32_t *ROM = reinterpret_cast(rgn->base()); int len = rgn->bytes() / 4; for (int i = 0; i < len; i++) { - UINT32 data = little_endianize_int32(ROM[i]); + uint32_t data = little_endianize_int32(ROM[i]); data = BITSWAP32(data,31,27,23,19,15,11,7,3,30,26,22,18,14,10,6,2,29,25,21,17,13,9,5,1,28,24,20,16,12,8,4,0); ROM[i] = little_endianize_int32(data); } @@ -4168,9 +4168,9 @@ DRIVER_INIT_MEMBER(tmnt_state, mia) chunky_to_planar(memregion("k051960")); // unscramble the sprite ROM address lines - UINT32 *gfxdata = reinterpret_cast(memregion("k051960")->base()); + uint32_t *gfxdata = reinterpret_cast(memregion("k051960")->base()); int len = memregion("k051960")->bytes() / 4; - std::vector temp(len); + std::vector temp(len); memcpy(&temp[0], gfxdata, len * 4); for (int A = 0; A < len; A++) { @@ -4193,10 +4193,10 @@ DRIVER_INIT_MEMBER(tmnt_state, tmnt) chunky_to_planar(memregion("k051960")); // unscramble the sprite ROM address lines - const UINT8 *code_conv_table = memregion("proms")->base(); - UINT32 *gfxdata = reinterpret_cast(memregion("k051960")->base()); + const uint8_t *code_conv_table = memregion("proms")->base(); + uint32_t *gfxdata = reinterpret_cast(memregion("k051960")->base()); int len = memregion("k051960")->bytes() / 4; - std::vector temp(len); + std::vector temp(len); memcpy(&temp[0], gfxdata, len * 4); for (int A = 0; A < len; A++) @@ -4216,7 +4216,7 @@ DRIVER_INIT_MEMBER(tmnt_state, tmnt) /* 9 low bits of the sprite line address, which bit to pick it from. */ /* For example, when the PROM contains 4, which applies to 4x2 sprites, */ /* bit OA1 comes from CA5, OA2 from CA0, and so on. */ - static const UINT8 bit_pick_table[10][8] = + static const uint8_t bit_pick_table[10][8] = { /*0(1x1) 1(2x1) 2(1x2) 3(2x2) 4(4x2) 5(2x4) 6(4x4) 7(8x8) */ { CA3, CA3, CA3, CA3, CA3, CA3, CA3, CA3 }, /* CA3 */ diff --git a/src/mame/drivers/tmspoker.cpp b/src/mame/drivers/tmspoker.cpp index e41c00147ff..a131ca4444f 100644 --- a/src/mame/drivers/tmspoker.cpp +++ b/src/mame/drivers/tmspoker.cpp @@ -225,7 +225,7 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(tmspoker_videoram_w); //DECLARE_WRITE8_MEMBER(debug_w); @@ -236,7 +236,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(tmspoker); - UINT32 screen_update_tmspoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tmspoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(tmspoker_interrupt); required_device m_maincpu; required_device m_gfxdecode; @@ -272,7 +272,7 @@ void tmspoker_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tmspoker_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 tmspoker_state::screen_update_tmspoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tmspoker_state::screen_update_tmspoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -305,14 +305,14 @@ INTERRUPT_GEN_MEMBER(tmspoker_state::tmspoker_interrupt) void tmspoker_state::machine_start() { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0], 0x1000); } void tmspoker_state::machine_reset() { - UINT8 seldsw = (ioport("SELDSW")->read() ); + uint8_t seldsw = (ioport("SELDSW")->read() ); popmessage("ROM Bank: %02X", seldsw); @@ -609,7 +609,7 @@ DRIVER_INIT_MEMBER(tmspoker_state,bus) // of invalid opcodes, and the RESET vector at 0000 is invalid either. /* offs_t offs; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); const size_t len = memregion("maincpu")->bytes(); for (offs = 0; offs < len; offs++) diff --git a/src/mame/drivers/tnzs.cpp b/src/mame/drivers/tnzs.cpp index a4929cb53e3..c24812c04da 100644 --- a/src/mame/drivers/tnzs.cpp +++ b/src/mame/drivers/tnzs.cpp @@ -630,8 +630,8 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/11/06 SAMPLES_START_CB_MEMBER(tnzs_state::kageki_init_samples) { - UINT8 *scan, *src; - INT16 *dest; + uint8_t *scan, *src; + int16_t *dest; int start, size; int i, n; @@ -652,7 +652,7 @@ SAMPLES_START_CB_MEMBER(tnzs_state::kageki_init_samples) } /* 2009-11 FP: should these be saved? */ - m_sampledata[i] = std::make_unique(size); + m_sampledata[i] = std::make_unique(size); m_samplesize[i] = size; @@ -664,7 +664,7 @@ SAMPLES_START_CB_MEMBER(tnzs_state::kageki_init_samples) scan = &src[start]; for (n = 0; n < size; n++) { - *dest++ = (INT8)((*scan++) ^ 0x80) * 256; + *dest++ = (int8_t)((*scan++) ^ 0x80) * 256; } // logerror("samples num:%02X ofs:%04X lng:%04X\n", i, start, size); } diff --git a/src/mame/drivers/toaplan2.cpp b/src/mame/drivers/toaplan2.cpp index 0d0741c18c9..f72d12138c1 100644 --- a/src/mame/drivers/toaplan2.cpp +++ b/src/mame/drivers/toaplan2.cpp @@ -429,7 +429,7 @@ DRIVER_INIT_MEMBER(toaplan2_state,fixeight) DRIVER_INIT_MEMBER(toaplan2_state,fixeightbl) { - UINT8 *ROM = memregion("oki")->base(); + uint8_t *ROM = memregion("oki")->base(); membank("bank1")->configure_entries(0, 5, &ROM[0x30000], 0x10000); } @@ -443,7 +443,7 @@ DRIVER_INIT_MEMBER(toaplan2_state,vfive) DRIVER_INIT_MEMBER(toaplan2_state,pipibibsbl) { - UINT16 *ROM = (UINT16 *)(memregion("maincpu")->base()); + uint16_t *ROM = (uint16_t *)(memregion("maincpu")->base()); for (int i = 0; i < (0x040000/2); i += 4) { @@ -457,7 +457,7 @@ DRIVER_INIT_MEMBER(toaplan2_state,pipibibsbl) DRIVER_INIT_MEMBER(toaplan2_state,bgaregga) { - UINT8 *Z80 = memregion("audiocpu")->base(); + uint8_t *Z80 = memregion("audiocpu")->base(); // seems to only use banks 0x0a to 0x0f membank("bank1")->configure_entries(8, 8, Z80, 0x4000); @@ -466,7 +466,7 @@ DRIVER_INIT_MEMBER(toaplan2_state,bgaregga) DRIVER_INIT_MEMBER(toaplan2_state,batrider) { - UINT8 *Z80 = memregion("audiocpu")->base(); + uint8_t *Z80 = memregion("audiocpu")->base(); membank("bank1")->configure_entries(0, 16, Z80, 0x4000); m_sndirq_line = 4; @@ -667,7 +667,7 @@ CUSTOM_INPUT_MEMBER(toaplan2_state::c2map_r) READ16_MEMBER(toaplan2_state::ghox_p1_h_analog_r) { - INT8 value, new_value; + int8_t value, new_value; new_value = ioport("PAD1")->read(); if (new_value == m_old_p1_paddle_h) return 0; @@ -679,7 +679,7 @@ READ16_MEMBER(toaplan2_state::ghox_p1_h_analog_r) READ16_MEMBER(toaplan2_state::ghox_p2_h_analog_r) { - INT8 value, new_value; + int8_t value, new_value; new_value = ioport("PAD2")->read(); if (new_value == m_old_p2_paddle_h) return 0; @@ -896,7 +896,7 @@ WRITE16_MEMBER(toaplan2_state::batrider_z80_busreq_w) READ16_MEMBER(toaplan2_state::batrider_z80rom_r) { - UINT8 *Z80 = memregion("audiocpu")->base(); + uint8_t *Z80 = memregion("audiocpu")->base(); return Z80[offset]; } @@ -3097,7 +3097,7 @@ MACHINE_CONFIG_END those 3 games have been seen with the NITRO905 chip, other alias are ts002mach for dogyuun, ts004dash for kbash and ts007spy for vfive */ -static const UINT8 nitro_decryption_table[256] = { +static const uint8_t nitro_decryption_table[256] = { 0x1b,0x56,0x75,0x88,0x8c,0x06,0x58,0x72, 0x83,0x86,0x36,0x1a,0x5f,0xd3,0x8c,0xe9, /* 00 */ /* *//* *//* *//* *//* *//* *//* *//* */ /* *//* *//* *//* *//* *//* *//* *//* */ 0x22,0x0f,0x03,0x2a,0xeb,0x2a,0xf9,0x0f, 0xa4,0xbd,0x75,0xf3,0x4f,0x53,0x8e,0xfe, /* 10 */ @@ -3413,7 +3413,7 @@ MACHINE_CONFIG_END /* x = modified to match batsugun 'unencrypted' code - '?' likewise, but not so sure about them */ /* this one seems more different to the other tables */ -static const UINT8 ts001turbo_decryption_table[256] = { +static const uint8_t ts001turbo_decryption_table[256] = { 0x90,0x05,0x57,0x5f,0xfe,0x4f,0xbd,0x36, 0x80,0x8b,0x8a,0x0a,0x89,0x90,0x47,0x80, /* 00 */ /*r*//*r*//*r*//*r*//*r*//*r*//*r*/ /*r*//*r*//*r*//*r*//*r*/ /*r*//*r*/ 0x22,0x90,0x90,0x5d,0x81,0x3c,0xb5,0x83, 0x68,0xff,0x75,0x75,0x8d,0x5b,0x8a,0x38, /* 10 */ diff --git a/src/mame/drivers/toki.cpp b/src/mame/drivers/toki.cpp index 890280abee3..d4c59f0a4e1 100644 --- a/src/mame/drivers/toki.cpp +++ b/src/mame/drivers/toki.cpp @@ -856,8 +856,8 @@ ROM_END DRIVER_INIT_MEMBER(toki_state,toki) { - UINT8 *ROM = memregion("oki")->base(); - std::vector buffer(0x20000); + uint8_t *ROM = memregion("oki")->base(); + std::vector buffer(0x20000); int i; memcpy(&buffer[0],ROM,0x20000); @@ -870,16 +870,16 @@ DRIVER_INIT_MEMBER(toki_state,toki) DRIVER_INIT_MEMBER(toki_state,tokib) { - std::vector temp(65536 * 2); + std::vector temp(65536 * 2); int i, offs, len; - UINT8 *rom; + uint8_t *rom; /* merge background tile graphics together */ len = memregion("gfx3")->bytes(); rom = memregion("gfx3")->base(); for (offs = 0; offs < len; offs += 0x20000) { - UINT8 *base = &rom[offs]; + uint8_t *base = &rom[offs]; memcpy (&temp[0], base, 65536 * 2); for (i = 0; i < 16; i++) { @@ -893,7 +893,7 @@ DRIVER_INIT_MEMBER(toki_state,tokib) rom = memregion("gfx4")->base(); for (offs = 0; offs < len; offs += 0x20000) { - UINT8 *base = &rom[offs]; + uint8_t *base = &rom[offs]; memcpy (&temp[0], base, 65536 * 2); for (i = 0; i < 16; i++) { @@ -914,7 +914,7 @@ DRIVER_INIT_MEMBER(toki_state,jujuba) /* Program ROMs are bitswapped */ { int i; - UINT16 *prgrom = (UINT16*)memregion("maincpu")->base(); + uint16_t *prgrom = (uint16_t*)memregion("maincpu")->base(); for (i = 0; i < 0x60000/2; i++) { @@ -927,21 +927,21 @@ DRIVER_INIT_MEMBER(toki_state,jujuba) /* Decrypt data for z80 program */ { - UINT8 *decrypt = m_seibu_sound->get_custom_decrypt(); - UINT8 *rom = memregion("audiocpu")->base(); + uint8_t *decrypt = m_seibu_sound->get_custom_decrypt(); + uint8_t *rom = memregion("audiocpu")->base(); memcpy(decrypt,rom,0x20000); for (int i = 0;i < 0x2000;i++) { - UINT8 src = decrypt[i]; + uint8_t src = decrypt[i]; rom[i] = src^0x55; } } { - UINT8 *ROM = memregion("oki")->base(); - std::vector buffer(0x20000); + uint8_t *ROM = memregion("oki")->base(); + std::vector buffer(0x20000); int i; memcpy(&buffer[0],ROM,0x20000); diff --git a/src/mame/drivers/tokyocop.cpp b/src/mame/drivers/tokyocop.cpp index 4f28338400d..79858537a41 100644 --- a/src/mame/drivers/tokyocop.cpp +++ b/src/mame/drivers/tokyocop.cpp @@ -34,7 +34,7 @@ public: m_maincpu(*this, "maincpu") { } - 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: @@ -50,7 +50,7 @@ void tokyocop_state::video_start() { } -UINT32 tokyocop_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tokyocop_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/tomcat.cpp b/src/mame/drivers/tomcat.cpp index 0470acf130b..76dd559079d 100644 --- a/src/mame/drivers/tomcat.cpp +++ b/src/mame/drivers/tomcat.cpp @@ -52,8 +52,8 @@ public: required_device m_tms; int m_control_num; - required_shared_ptr m_shared_ram; - UINT8 m_nvram[0x800]; + required_shared_ptr m_shared_ram; + uint8_t m_nvram[0x800]; int m_dsp_BIO; int m_dsp_idle; DECLARE_WRITE16_MEMBER(tomcat_adcon_w); @@ -106,7 +106,7 @@ READ16_MEMBER(tomcat_state::tomcat_adcread_r) READ16_MEMBER(tomcat_state::tomcat_inputs_r) { - UINT16 result = 0; + uint16_t result = 0; if (ACCESSING_BITS_8_15) result |= ioport("IN0")->read() << 8; @@ -353,10 +353,10 @@ INPUT_PORTS_END void tomcat_state::machine_start() { - ((UINT16*)m_shared_ram)[0x0000] = 0xf600; - ((UINT16*)m_shared_ram)[0x0001] = 0x0000; - ((UINT16*)m_shared_ram)[0x0002] = 0xf600; - ((UINT16*)m_shared_ram)[0x0003] = 0x0000; + ((uint16_t*)m_shared_ram)[0x0000] = 0xf600; + ((uint16_t*)m_shared_ram)[0x0001] = 0x0000; + ((uint16_t*)m_shared_ram)[0x0002] = 0xf600; + ((uint16_t*)m_shared_ram)[0x0003] = 0x0000; machine().device("nvram")->set_base(m_nvram, 0x800); diff --git a/src/mame/drivers/topspeed.cpp b/src/mame/drivers/topspeed.cpp index bbbd8e41c2f..66c587d1aba 100644 --- a/src/mame/drivers/topspeed.cpp +++ b/src/mame/drivers/topspeed.cpp @@ -188,8 +188,8 @@ WRITE16_MEMBER(topspeed_state::cpua_ctrl_w) READ8_MEMBER(topspeed_state::input_bypass_r) { // Read port number - UINT8 port = m_tc0220ioc->port_r(space, 0); - UINT16 steer = 0xff80 + m_steer.read_safe(0); + uint8_t port = m_tc0220ioc->port_r(space, 0); + uint16_t steer = 0xff80 + m_steer.read_safe(0); switch (port) { @@ -206,7 +206,7 @@ READ8_MEMBER(topspeed_state::input_bypass_r) CUSTOM_INPUT_MEMBER(topspeed_state::pedal_r) { - static const UINT8 retval[8] = { 0,1,3,2,6,7,5,4 }; + static const uint8_t retval[8] = { 0,1,3,2,6,7,5,4 }; ioport_port *port = ioport((const char *)param); return retval[port != nullptr ? port->read() & 7 : 0]; } @@ -260,7 +260,7 @@ void topspeed_state::msm5205_update(int chip) if (m_msm_reset[chip]) return; - UINT8 data = m_msm_rom[chip][m_msm_pos[chip]]; + uint8_t data = m_msm_rom[chip][m_msm_pos[chip]]; msm5205_device *msm = chip ? m_msm2 : m_msm1; msm->data_w((m_msm_nibble[chip] ? data : data >> 4) & 0xf); @@ -339,7 +339,7 @@ WRITE_LINE_MEMBER(topspeed_state::z80ctc_to0) else { // Update on falling edge of /VCK - UINT16 oldpos = m_msm_pos[1]; + uint16_t oldpos = m_msm_pos[1]; msm5205_update(1); diff --git a/src/mame/drivers/toratora.cpp b/src/mame/drivers/toratora.cpp index 8bdea76b5ca..b143a3ef69b 100644 --- a/src/mame/drivers/toratora.cpp +++ b/src/mame/drivers/toratora.cpp @@ -62,11 +62,11 @@ public: m_pia_u3(*this, "pia_u3") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* video-related */ int m_timer; - UINT8 m_clear_tv; + uint8_t m_clear_tv; /* devices */ required_device m_maincpu; @@ -89,7 +89,7 @@ public: DECLARE_WRITE_LINE_MEMBER(sn2_ca2_u2_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_toratora(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_toratora(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(toratora_timer); }; @@ -113,7 +113,7 @@ WRITE_LINE_MEMBER(toratora_state::cb2_u2_w) * *************************************/ -UINT32 toratora_state::screen_update_toratora(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t toratora_state::screen_update_toratora(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { offs_t offs; @@ -121,9 +121,9 @@ UINT32 toratora_state::screen_update_toratora(screen_device &screen, bitmap_rgb3 { int i; - UINT8 y = offs >> 5; - UINT8 x = offs << 3; - UINT8 data = m_videoram[offs]; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; + uint8_t data = m_videoram[offs]; for (i = 0; i < 8; i++) { diff --git a/src/mame/drivers/tourvis.cpp b/src/mame/drivers/tourvis.cpp index 3601855de92..3966a61b465 100644 --- a/src/mame/drivers/tourvis.cpp +++ b/src/mame/drivers/tourvis.cpp @@ -310,7 +310,7 @@ public: DECLARE_WRITE_LINE_MEMBER(tourvision_timer_out); required_device m_subcpu; required_device m_cart; - UINT32 m_rom_size; + uint32_t m_rom_size; DECLARE_DEVICE_IMAGE_LOAD_MEMBER(tourvision_cart); }; @@ -321,8 +321,8 @@ DEVICE_IMAGE_LOAD_MEMBER( tourvision_state, tourvision_cart ) m_cart->rom_alloc(m_rom_size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); m_cart->common_load_rom(m_cart->get_rom_base(), m_rom_size, "rom"); - UINT8* rgn = memregion("maincpu")->base(); - UINT8* base = m_cart->get_rom_base(); + uint8_t* rgn = memregion("maincpu")->base(); + uint8_t* base = m_cart->get_rom_base(); if (m_rom_size == 0x0c0000) { diff --git a/src/mame/drivers/toypop.cpp b/src/mame/drivers/toypop.cpp index dc012f260d6..015f3e01dc7 100644 --- a/src/mame/drivers/toypop.cpp +++ b/src/mame/drivers/toypop.cpp @@ -65,13 +65,13 @@ public: required_device m_palette; required_device m_gfxdecode; - required_shared_ptr m_master_workram; - required_shared_ptr m_slave_sharedram; - required_shared_ptr m_bgvram; - required_shared_ptr m_fgvram; - required_shared_ptr m_fgattr; + required_shared_ptr m_master_workram; + required_shared_ptr m_slave_sharedram; + required_shared_ptr m_bgvram; + required_shared_ptr m_fgvram; + required_shared_ptr m_fgattr; - 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); TIMER_DEVICE_CALLBACK_MEMBER(master_scanline); INTERRUPT_GEN_MEMBER(slave_vblank_irq); @@ -104,7 +104,7 @@ protected: private: bool m_master_irq_enable; bool m_slave_irq_enable; - UINT8 m_pal_bank; + uint8_t m_pal_bank; void legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect); void legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect); @@ -113,7 +113,7 @@ private: PALETTE_INIT_MEMBER(namcos16_state, toypop) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); for (int i = 0;i < 256;i++) { @@ -143,7 +143,7 @@ PALETTE_INIT_MEMBER(namcos16_state, toypop) for (int i = 0;i < 256;i++) { - UINT8 entry; + uint8_t entry; // characters palette.set_pen_indirect(i + 0*256, (color_prom[i + 0x300] & 0x0f) | 0x70); @@ -163,18 +163,18 @@ PALETTE_INIT_MEMBER(namcos16_state, toypop) void namcos16_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect) { int x, y; - const UINT16 pal_base = 0x300 + (m_pal_bank << 4); - const UINT32 src_base = 0x200/2; - const UINT16 src_pitch = 288 / 2; + const uint16_t pal_base = 0x300 + (m_pal_bank << 4); + const uint32_t src_base = 0x200/2; + const uint16_t src_pitch = 288 / 2; for (y = cliprect.min_y; y <= cliprect.max_y; ++y) { - UINT16 *src = &m_bgvram[y * src_pitch + cliprect.min_x + src_base]; - UINT16 *dst = &bitmap.pix16(y, cliprect.min_x); + uint16_t *src = &m_bgvram[y * src_pitch + cliprect.min_x + src_base]; + uint16_t *dst = &bitmap.pix16(y, cliprect.min_x); for (x = cliprect.min_x; x <= cliprect.max_x; x += 2) { - UINT32 srcpix = *src++; + uint32_t srcpix = *src++; *dst++ = m_palette->pen(((srcpix >> 8) & 0xf) + pal_base); *dst++ = m_palette->pen((srcpix & 0xf) + pal_base); } @@ -207,8 +207,8 @@ void namcos16_state::legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &clipre y = (count / 32) - 2; } - UINT16 tile = m_fgvram[count]; - UINT8 color = (m_fgattr[count] & 0x3f) + (m_pal_bank<<6); + uint16_t tile = m_fgvram[count]; + uint8_t color = (m_fgattr[count] & 0x3f) + (m_pal_bank<<6); gfx_0->transpen(bitmap,cliprect,tile,color,0,0,x*8,y*8,0); } @@ -219,9 +219,9 @@ void namcos16_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr { gfx_element *gfx_1 = m_gfxdecode->gfx(1); int count; - UINT8 *base_spriteram = m_master_workram; - const UINT16 bank1 = 0x0800; - const UINT16 bank2 = 0x1000; + uint8_t *base_spriteram = m_master_workram; + const uint16_t bank1 = 0x0800; + const uint16_t bank2 = 0x1000; for (count=0x780;count<0x800;count+=2) @@ -231,8 +231,8 @@ void namcos16_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr if(enabled == false) continue; - UINT8 tile = base_spriteram[count]; - UINT8 color = base_spriteram[count+1]; + uint8_t tile = base_spriteram[count]; + uint8_t color = base_spriteram[count+1]; int x = base_spriteram[count+bank1+1] + (base_spriteram[count+bank2+1] << 8); x -= 71; @@ -243,8 +243,8 @@ void namcos16_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr bool fx = (base_spriteram[count+bank2] & 1) == 1; bool fy = (base_spriteram[count+bank2] & 2) == 2; - UINT8 width = ((base_spriteram[count+bank2] & 4) >> 2) + 1; - UINT8 height = ((base_spriteram[count+bank2] & 8) >> 3) + 1; + uint8_t width = ((base_spriteram[count+bank2] & 4) >> 2) + 1; + uint8_t height = ((base_spriteram[count+bank2] & 8) >> 3) + 1; if(height == 2) y -=16; @@ -253,14 +253,14 @@ void namcos16_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr { for(int xi=0;xitransmask(bitmap,cliprect,sprite_offs,color,fx,fy,x + xi*16,y + yi *16,m_palette->transpen_mask(*gfx_1, color, 0xff)); } } } } -UINT32 namcos16_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t namcos16_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { legacy_bg_draw(bitmap,cliprect); legacy_fg_draw(bitmap,cliprect); @@ -312,7 +312,7 @@ WRITE16_MEMBER(namcos16_state::slave_irq_enable_w) READ8_MEMBER(namcos16_state::bg_rmw_r) { - UINT8 res; + uint8_t res; res = 0; // note: following offset is written as offset * 2 diff --git a/src/mame/drivers/trackfld.cpp b/src/mame/drivers/trackfld.cpp index 3771ebf3561..a9220cf428f 100644 --- a/src/mame/drivers/trackfld.cpp +++ b/src/mame/drivers/trackfld.cpp @@ -1546,7 +1546,7 @@ DRIVER_INIT_MEMBER(trackfld_state,trackfld) DRIVER_INIT_MEMBER(trackfld_state, trackfldnz) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int i; /* decrypt program rom */ @@ -1557,7 +1557,7 @@ DRIVER_INIT_MEMBER(trackfld_state, trackfldnz) DRIVER_INIT_MEMBER(trackfld_state,atlantol) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); machine().device("maincpu")->set_encryption_boundary(0x6000); @@ -1577,7 +1577,7 @@ DRIVER_INIT_MEMBER(trackfld_state,atlantol) DRIVER_INIT_MEMBER(trackfld_state,mastkin) { - UINT8 *prom = memregion("proms")->base(); + uint8_t *prom = memregion("proms")->base(); int i; /* build a fake palette so the screen won't be all black */ @@ -1599,7 +1599,7 @@ DRIVER_INIT_MEMBER(trackfld_state,mastkin) DRIVER_INIT_MEMBER(trackfld_state,wizzquiz) { - UINT8 *ROM = memregion("maincpu")->base() + 0xe000; + uint8_t *ROM = memregion("maincpu")->base() + 0xe000; int i; /* decrypt program rom */ diff --git a/src/mame/drivers/tranz330.cpp b/src/mame/drivers/tranz330.cpp index 359af3b042f..497e874a516 100644 --- a/src/mame/drivers/tranz330.cpp +++ b/src/mame/drivers/tranz330.cpp @@ -109,7 +109,7 @@ WRITE8_MEMBER( tranz330_state::pio_a_w ) READ8_MEMBER( tranz330_state::pio_b_r ) { - UINT8 input_mask = 0xf; + uint8_t input_mask = 0xf; for (int i = 0; i < 4; i++) { if (!BIT(m_keypad_col_mask, i)) diff --git a/src/mame/drivers/travrusa.cpp b/src/mame/drivers/travrusa.cpp index 50e099d023c..2ea0f82f416 100644 --- a/src/mame/drivers/travrusa.cpp +++ b/src/mame/drivers/travrusa.cpp @@ -577,8 +577,8 @@ ROM_END DRIVER_INIT_MEMBER(travrusa_state,motorace) { int A, j; - UINT8 *rom = memregion("maincpu")->base(); - std::vector buffer(0x2000); + uint8_t *rom = memregion("maincpu")->base(); + std::vector buffer(0x2000); memcpy(&buffer[0], rom, 0x2000); @@ -593,7 +593,7 @@ DRIVER_INIT_MEMBER(travrusa_state,motorace) DRIVER_INIT_MEMBER(travrusa_state,shtridra) { int A; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); /* D3/D4 and D5/D6 swapped */ for (A = 0; A < 0x2000; A++) diff --git a/src/mame/drivers/tricep.cpp b/src/mame/drivers/tricep.cpp index ecadeb6667d..a3447f5eb02 100644 --- a/src/mame/drivers/tricep.cpp +++ b/src/mame/drivers/tricep.cpp @@ -29,7 +29,7 @@ public: DECLARE_READ16_MEMBER(tricep_terminal_r); DECLARE_WRITE16_MEMBER(tricep_terminal_w); DECLARE_WRITE8_MEMBER(kbd_put); - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; virtual void machine_reset() override; }; @@ -59,9 +59,9 @@ INPUT_PORTS_END void tricep_state::machine_reset() { - UINT8* user1 = memregion("user1")->base(); + uint8_t* user1 = memregion("user1")->base(); - memcpy((UINT8*)m_p_ram.target(),user1,0x2000); + memcpy((uint8_t*)m_p_ram.target(),user1,0x2000); m_maincpu->reset(); } diff --git a/src/mame/drivers/triforce.cpp b/src/mame/drivers/triforce.cpp index a789123f847..58344e8ce15 100644 --- a/src/mame/drivers/triforce.cpp +++ b/src/mame/drivers/triforce.cpp @@ -459,7 +459,7 @@ public: DECLARE_WRITE64_MEMBER(gc_exi_w); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_triforce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_triforce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -493,7 +493,7 @@ void triforce_state::video_start() { } -UINT32 triforce_state::screen_update_triforce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t triforce_state::screen_update_triforce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } @@ -503,18 +503,18 @@ INPUT_PORTS_END // bootrom descrambler reversed by segher // Copyright 2008 Segher Boessenkool -static void descrambler(UINT8* data, UINT32 size) +static void descrambler(uint8_t* data, uint32_t size) { - UINT8 acc = 0; - UINT8 nacc = 0; + uint8_t acc = 0; + uint8_t nacc = 0; - UINT16 t = 0x2953; - UINT16 u = 0xd9c2; - UINT16 v = 0x3ff1; + uint16_t t = 0x2953; + uint16_t u = 0xd9c2; + uint16_t v = 0x3ff1; - UINT8 x = 1; + uint8_t x = 1; - for (UINT32 it = 0; it < size;) + for (uint32_t it = 0; it < size;) { int t0 = t & 1; int t1 = (t >> 1) & 1; @@ -560,7 +560,7 @@ void triforce_state::machine_start() /* set conservative DRC options */ m_maincpu->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS); - UINT8 *rom = (UINT8*)memregion("maincpu")->base(); + uint8_t *rom = (uint8_t*)memregion("maincpu")->base(); descrambler(&rom[0x100], 0x1afe00); } diff --git a/src/mame/drivers/triplhnt.cpp b/src/mame/drivers/triplhnt.cpp index 858542aee23..9f6e1d288c1 100644 --- a/src/mame/drivers/triplhnt.cpp +++ b/src/mame/drivers/triplhnt.cpp @@ -31,8 +31,8 @@ void triplhnt_state::triplhnt_set_collision(int code) void triplhnt_state::triplhnt_update_misc(address_space &space, int offset) { - UINT8 is_witch_hunt; - UINT8 bit = offset >> 1; + uint8_t is_witch_hunt; + uint8_t bit = offset >> 1; /* BIT0 => UNUSED */ /* BIT1 => LAMP */ @@ -225,7 +225,7 @@ static const gfx_layout triplhnt_small_sprite_layout = }; -static const UINT32 triplhnt_large_sprite_layout_xoffset[64] = +static const uint32_t triplhnt_large_sprite_layout_xoffset[64] = { 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, @@ -237,7 +237,7 @@ static const UINT32 triplhnt_large_sprite_layout_xoffset[64] = 0x1C, 0x1C, 0x1D, 0x1D, 0x1E, 0x1E, 0x1F, 0x1F }; -static const UINT32 triplhnt_large_sprite_layout_yoffset[64] = +static const uint32_t triplhnt_large_sprite_layout_yoffset[64] = { 0x000, 0x000, 0x020, 0x020, 0x040, 0x040, 0x060, 0x060, 0x080, 0x080, 0x0A0, 0x0A0, 0x0C0, 0x0C0, 0x0E0, 0x0E0, diff --git a/src/mame/drivers/trs80m2.cpp b/src/mame/drivers/trs80m2.cpp index 9aa8b13d568..db5be64a456 100644 --- a/src/mame/drivers/trs80m2.cpp +++ b/src/mame/drivers/trs80m2.cpp @@ -33,7 +33,7 @@ READ8_MEMBER( trs80m2_state::read ) { - UINT8 data = 0; + uint8_t data = 0; if (offset < 0x800) { @@ -191,7 +191,7 @@ READ8_MEMBER( trs80m2_state::nmi_r ) */ - UINT8 data = 0; + uint8_t data = 0; // 80/40 character mode*/ data |= m_80_40_char_en << 4; @@ -389,9 +389,9 @@ MC6845_UPDATE_ROW( trs80m2_state::crtc_update_row ) for (int column = 0; column < x_count; column++) { - UINT8 code = m_video_ram[(ma + column) & 0x7ff]; + uint8_t code = m_video_ram[(ma + column) & 0x7ff]; offs_t address = ((code & 0x7f) << 4) | (ra & 0x0f); - UINT8 data = m_char_rom->base()[address]; + uint8_t data = m_char_rom->base()[address]; int dcursor = (column == cursor_x); int drevid = BIT(code, 7); @@ -433,7 +433,7 @@ void trs80m2_state::video_start() m_video_ram.allocate(0x800); } -UINT32 trs80m2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t trs80m2_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_blnkvid) { @@ -548,7 +548,7 @@ READ8_MEMBER( trs80m2_state::pio_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // floppy interrupt data |= (m_fdc->intrq_r() ? 0x01 : 0x00); diff --git a/src/mame/drivers/trucocl.cpp b/src/mame/drivers/trucocl.cpp index cfc4c675b8b..0442654d422 100644 --- a/src/mame/drivers/trucocl.cpp +++ b/src/mame/drivers/trucocl.cpp @@ -61,7 +61,7 @@ void trucocl_state::device_timer(emu_timer &timer, device_timer_id id, int param WRITE8_MEMBER(trucocl_state::audio_dac_w) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int dac_address = ( data & 0xf0 ) << 8; int sel = ( ( (~data) >> 1 ) & 2 ) | ( data & 1 ); diff --git a/src/mame/drivers/trvmadns.cpp b/src/mame/drivers/trvmadns.cpp index 485b92621d3..7e630d1717e 100644 --- a/src/mame/drivers/trvmadns.cpp +++ b/src/mame/drivers/trvmadns.cpp @@ -105,8 +105,8 @@ public: m_generic_paletteram_8(*this, "paletteram") { } tilemap_t *m_bg_tilemap; - required_shared_ptr m_gfxram; - required_shared_ptr m_tileram; + required_shared_ptr m_gfxram; + required_shared_ptr m_tileram; int m_old_data; DECLARE_WRITE8_MEMBER(trvmadns_banking_w); DECLARE_WRITE8_MEMBER(trvmadns_gfxram_w); @@ -117,17 +117,17 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_trvmadns(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_trvmadns(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_generic_paletteram_8; }; WRITE8_MEMBER(trvmadns_state::trvmadns_banking_w) { - UINT8 *rom; + uint8_t *rom; int address = 0; if((data & 0xf0) == 0xa0) @@ -326,7 +326,7 @@ void trvmadns_state::video_start() m_gfxdecode->gfx(0)->set_source(m_gfxram); } -UINT32 trvmadns_state::screen_update_trvmadns(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t trvmadns_state::screen_update_trvmadns(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count; gfx_element *gfx = m_gfxdecode->gfx(0); diff --git a/src/mame/drivers/ts802.cpp b/src/mame/drivers/ts802.cpp index 6ea48ff1272..dd8efa0aec2 100644 --- a/src/mame/drivers/ts802.cpp +++ b/src/mame/drivers/ts802.cpp @@ -58,7 +58,7 @@ public: DECLARE_WRITE8_MEMBER(io_write_byte); DECLARE_WRITE8_MEMBER( kbd_put ); private: - UINT8 m_term_data; + uint8_t m_term_data; address_space *m_mem; address_space *m_io; required_device m_maincpu; @@ -148,7 +148,7 @@ MACHINE_RESET_MEMBER( ts802_state, ts802 ) READ8_MEMBER( ts802_state::port0d_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -175,7 +175,7 @@ DRIVER_INIT_MEMBER( ts802_state, ts802 ) m_mem = &m_maincpu->space(AS_PROGRAM); m_io = &m_maincpu->space(AS_IO); - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(1, &main[0x0000]); membank("bankr0")->configure_entry(0, &main[0x10000]); diff --git a/src/mame/drivers/ts803.cpp b/src/mame/drivers/ts803.cpp index 8885ecce299..989d299e94a 100644 --- a/src/mame/drivers/ts803.cpp +++ b/src/mame/drivers/ts803.cpp @@ -89,18 +89,18 @@ public: DECLARE_DRIVER_INIT(ts803); TIMER_DEVICE_CALLBACK_MEMBER(dart_tick); - UINT32 screen_update_ts803(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ts803(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_palette; private: - std::unique_ptr m_videoram; - std::unique_ptr m_56kram; - UINT8 m_sioidxr=0; - UINT8 m_sioarr[256]; + std::unique_ptr m_videoram; + std::unique_ptr m_56kram; + uint8_t m_sioidxr=0; + uint8_t m_sioarr[256]; bool m_graphics_mode; bool m_tick; - UINT8 *m_p_chargen; + uint8_t *m_p_chargen; virtual void machine_reset() override; virtual void machine_start() override; @@ -380,9 +380,9 @@ MC6845_ON_UPDATE_ADDR_CHANGED( ts803_state::crtc_update_addr ) MC6845_UPDATE_ROW( ts803_state::crtc_update_row ) { const rgb_t *pens = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx,inv; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx,inv; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { @@ -459,11 +459,11 @@ void ts803_state::machine_reset() DRIVER_INIT_MEMBER( ts803_state, ts803 ) { - m_videoram = std::make_unique(0x8000); - m_56kram = std::make_unique(0xc000); + m_videoram = std::make_unique(0x8000); + m_56kram = std::make_unique(0xc000); m_p_chargen = memregion("chargen")->base(); - UINT8 *rom = memregion("roms")->base(); + uint8_t *rom = memregion("roms")->base(); membank("bankr0")->configure_entry(0, &rom[0]); // rom membank("bankr0")->configure_entry(1, m_56kram.get()); // ram membank("bankw0")->configure_entry(0, m_56kram.get()); // ram diff --git a/src/mame/drivers/ts816.cpp b/src/mame/drivers/ts816.cpp index 6bf818a2163..59ccce42735 100644 --- a/src/mame/drivers/ts816.cpp +++ b/src/mame/drivers/ts816.cpp @@ -31,8 +31,8 @@ public: DECLARE_READ8_MEMBER(status_r); private: - UINT8 m_term_data; - UINT8 m_status; + uint8_t m_term_data; + uint8_t m_status; virtual void machine_reset() override; required_device m_maincpu; required_device m_terminal; @@ -58,7 +58,7 @@ INPUT_PORTS_END READ8_MEMBER( ts816_state::keyin_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/tsispch.cpp b/src/mame/drivers/tsispch.cpp index 1ba51dcba2e..0d328891f0d 100644 --- a/src/mame/drivers/tsispch.cpp +++ b/src/mame/drivers/tsispch.cpp @@ -190,7 +190,7 @@ READ16_MEMBER( tsispch_state::dsp_data_r ) { upd7725_device *upd7725 = machine().device("dsp"); #ifdef DEBUG_DSP - UINT8 temp; + uint8_t temp; temp = upd7725->snesdsp_read(true); fprintf(stderr, "dsp data read: %02x\n", temp); return temp; @@ -212,7 +212,7 @@ READ16_MEMBER( tsispch_state::dsp_status_r ) { upd7725_device *upd7725 = machine().device("dsp"); #ifdef DEBUG_DSP - UINT8 temp; + uint8_t temp; temp = upd7725->snesdsp_read(false); fprintf(stderr, "dsp status read: %02x\n", temp); return temp; @@ -251,8 +251,8 @@ void tsispch_state::machine_reset() DRIVER_INIT_MEMBER(tsispch_state,prose2k) { - UINT8 *dspsrc = (UINT8 *)(memregion("dspprgload")->base()); - UINT32 *dspprg = (UINT32 *)(memregion("dspprg")->base()); + uint8_t *dspsrc = (uint8_t *)(memregion("dspprgload")->base()); + uint32_t *dspprg = (uint32_t *)(memregion("dspprg")->base()); fprintf(stderr,"driver init\n"); // unpack 24 bit 7720 data into 32 bit space and shuffle it so it can run as 7725 code // data format as-is in dspsrc: (L = always 0, X = doesn't matter) @@ -270,23 +270,23 @@ DRIVER_INIT_MEMBER(tsispch_state,prose2k) // b1 15 16 17 18 19 20 21 22 -> 22 21 20 19 18 17 16 15 // b2 L 8 9 10 11 12 13 14 -> 14 13 12 11 10 9 8 7 // b3 0 1 2 3 4 5 6 7 -> 6 5 X X 3 2 1 0 - UINT8 byte1t; - UINT16 byte23t; + uint8_t byte1t; + uint16_t byte23t; for (int i = 0; i < 0x600; i+= 3) { byte1t = BITSWAP8(dspsrc[0+i], 0, 1, 2, 3, 4, 5, 6, 7); // here's where things get disgusting: if the first byte was an OP or RT, do the following: if ((byte1t&0x80) == 0x00) // op or rt instruction { - byte23t = BITSWAP16( (((UINT16)dspsrc[1+i]<<8)|dspsrc[2+i]), 8, 9, 10, 15, 11, 12, 13, 14, 0, 1, 2, 3, 4, 5, 6, 7); + byte23t = BITSWAP16( (((uint16_t)dspsrc[1+i]<<8)|dspsrc[2+i]), 8, 9, 10, 15, 11, 12, 13, 14, 0, 1, 2, 3, 4, 5, 6, 7); } else if ((byte1t&0xC0) == 0x80) // jp instruction { - byte23t = BITSWAP16( (((UINT16)dspsrc[1+i]<<8)|dspsrc[2+i]), 8, 9, 15, 15, 15, 10, 11, 12, 13, 14, 0, 1, 2, 3, 6, 7); + byte23t = BITSWAP16( (((uint16_t)dspsrc[1+i]<<8)|dspsrc[2+i]), 8, 9, 15, 15, 15, 10, 11, 12, 13, 14, 0, 1, 2, 3, 6, 7); } else // ld instruction { - byte23t = BITSWAP16( (((UINT16)dspsrc[1+i]<<8)|dspsrc[2+i]), 8, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 3, 4, 5, 6, 7); + byte23t = BITSWAP16( (((uint16_t)dspsrc[1+i]<<8)|dspsrc[2+i]), 8, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 3, 4, 5, 6, 7); } *dspprg = byte1t<<24 | byte23t<<8; diff --git a/src/mame/drivers/ttchamp.cpp b/src/mame/drivers/ttchamp.cpp index 8021db87042..89faf78435c 100644 --- a/src/mame/drivers/ttchamp.cpp +++ b/src/mame/drivers/ttchamp.cpp @@ -83,11 +83,11 @@ public: required_device m_maincpu; required_device m_palette; - UINT16 m_paloff; - UINT16 m_port10; - UINT8 m_rombank; - UINT16 m_videoram0[0x10000 / 2]; - UINT16 m_videoram2[0x10000 / 2]; + uint16_t m_paloff; + uint16_t m_port10; + uint8_t m_rombank; + uint16_t m_videoram0[0x10000 / 2]; + uint16_t m_videoram2[0x10000 / 2]; enum picmode { @@ -106,15 +106,15 @@ public: int m_pic_latched; int m_pic_writelatched; - std::unique_ptr m_bakram; + std::unique_ptr m_bakram; - UINT16 m_mainram[0x10000 / 2]; + uint16_t m_mainram[0x10000 / 2]; int m_spritesinit; int m_spriteswidth; int m_spritesaddr; - UINT16* m_rom16; - UINT8* m_rom8; + uint16_t* m_rom16; + uint8_t* m_rom8; DECLARE_WRITE16_MEMBER(paloff_w); DECLARE_WRITE16_MEMBER(paldat_w); @@ -137,7 +137,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); INTERRUPT_GEN_MEMBER(irq); }; @@ -147,12 +147,12 @@ ALLOW_SAVE_TYPE(ttchamp_state::picmode); void ttchamp_state::machine_start() { - m_rom16 = (UINT16*)memregion("maincpu")->base(); + m_rom16 = (uint16_t*)memregion("maincpu")->base(); m_rom8 = memregion("maincpu")->base(); m_picmodex = PIC_IDLE; - m_bakram = std::make_unique(0x100); + m_bakram = std::make_unique(0x100); machine().device("backram")->set_base(m_bakram.get(), 0x100); save_item(NAME(m_paloff)); @@ -176,7 +176,7 @@ void ttchamp_state::video_start() { } -UINT32 ttchamp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ttchamp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { logerror("update\n"); int y,x,count; @@ -184,12 +184,12 @@ UINT32 ttchamp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, static const int xxx=320,yyy=204; bitmap.fill(m_palette->black_pen()); - UINT8 *videoramfg; - UINT8* videorambg; + uint8_t *videoramfg; + uint8_t* videorambg; count=0; - videorambg = (UINT8*)m_videoram0; - videoramfg = (UINT8*)m_videoram2; + videorambg = (uint8_t*)m_videoram0; + videoramfg = (uint8_t*)m_videoram2; for (y=0;y> 8; diff --git a/src/mame/drivers/tugboat.cpp b/src/mame/drivers/tugboat.cpp index 0fd80a9e45d..f966679576a 100644 --- a/src/mame/drivers/tugboat.cpp +++ b/src/mame/drivers/tugboat.cpp @@ -52,10 +52,10 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_ram; + required_shared_ptr m_ram; - UINT8 m_hd46505_0_reg[18]; - UINT8 m_hd46505_1_reg[18]; + uint8_t m_hd46505_0_reg[18]; + uint8_t m_hd46505_1_reg[18]; int m_reg0; int m_reg1; int m_ctrl; @@ -72,7 +72,7 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(tugboat); - 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); void draw_tilemap(bitmap_ind16 &bitmap,const rectangle &cliprect, int addr,int gfx0,int gfx1,int transparency); @@ -102,7 +102,7 @@ void tugboat_state::video_start() just four 1k resistors. */ PALETTE_INIT_MEMBER(tugboat_state, tugboat) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0;i < palette.entries();i++) @@ -178,7 +178,7 @@ void tugboat_state::draw_tilemap(bitmap_ind16 &bitmap,const rectangle &cliprect, } } -UINT32 tugboat_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tugboat_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int startaddr0 = m_hd46505_0_reg[0x0c]*256 + m_hd46505_0_reg[0x0d]; int startaddr1 = m_hd46505_1_reg[0x0c]*256 + m_hd46505_1_reg[0x0d]; diff --git a/src/mame/drivers/tumbleb.cpp b/src/mame/drivers/tumbleb.cpp index 7dff5713178..f1185ba0e0f 100644 --- a/src/mame/drivers/tumbleb.cpp +++ b/src/mame/drivers/tumbleb.cpp @@ -471,7 +471,7 @@ static const int tumbleb_sound_lookup[256] = { /* we use channels 1,2,3 for sound effects, and channel 4 for music */ void tumbleb_state::tumbleb2_set_music_bank( int bank ) { - UINT8 *oki = memregion("oki")->base(); + uint8_t *oki = memregion("oki")->base(); memcpy(&oki[0x38000], &oki[0x80000 + 0x38000 + 0x8000 * bank], 0x8000); } @@ -748,7 +748,7 @@ WRITE16_MEMBER(tumbleb_state::semicom_soundcmd_w) WRITE8_MEMBER(tumbleb_state::oki_sound_bank_w) { - UINT8 *oki = memregion("oki")->base(); + uint8_t *oki = memregion("oki")->base(); memcpy(&oki[0x30000], &oki[(data * 0x10000) + 0x40000], 0x10000); } @@ -794,8 +794,8 @@ ADDRESS_MAP_END WRITE8_MEMBER(tumbleb_state::jumpkids_oki_bank_w) { - UINT8* sound1 = memregion("oki")->base(); - UINT8* sound2 = memregion("oki2")->base(); + uint8_t* sound1 = memregion("oki")->base(); + uint8_t* sound2 = memregion("oki2")->base(); int bank = data & 0x03; memcpy(sound1 + 0x20000, sound2 + bank * 0x20000, 0x20000); @@ -824,7 +824,7 @@ WRITE8_MEMBER(tumbleb_state::prot_io_w) { case 0x00: { - UINT16 word = m_mainram[(m_protbase/2) + m_semicom_prot_offset]; + uint16_t word = m_mainram[(m_protbase/2) + m_semicom_prot_offset]; word = (word & 0xff00) | (data << 0); m_mainram[(m_protbase/2) + m_semicom_prot_offset] = word; @@ -833,7 +833,7 @@ WRITE8_MEMBER(tumbleb_state::prot_io_w) case 0x01: { - UINT16 word = m_mainram[(m_protbase/2) + m_semicom_prot_offset]; + uint16_t word = m_mainram[(m_protbase/2) + m_semicom_prot_offset]; word = (word & 0x00ff) | (data << 8); m_mainram[(m_protbase/2) + m_semicom_prot_offset] = word; @@ -2208,7 +2208,7 @@ MACHINE_RESET_MEMBER(tumbleb_state,htchctch) if (memregion("user1") != nullptr) { /* copy protection data every reset */ - UINT16 *PROTDATA = (UINT16*)memregion("user1")->base(); + uint16_t *PROTDATA = (uint16_t*)memregion("user1")->base(); int i, len = memregion("user1")->bytes(); for (i = 0; i < len / 2; i++) @@ -3414,10 +3414,10 @@ ROM_END /******************************************************************************/ #if TUMBLEP_HACK -void tumbleb_state::tumblepb_patch_code(UINT16 offset) +void tumbleb_state::tumblepb_patch_code(uint16_t offset) { /* A hack which enables all Dip Switches effects */ - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); RAM[(offset + 0)/2] = 0x0240; RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0 } @@ -3426,7 +3426,7 @@ void tumbleb_state::tumblepb_patch_code(UINT16 offset) void tumbleb_state::tumblepb_gfx_rearrange(int rgn) { - UINT8* rom; + uint8_t* rom; int len; if (rgn == 1) @@ -3499,7 +3499,7 @@ DRIVER_INIT_MEMBER(tumbleb_state,fncywld) #if FNCYWLD_HACK /* This is a hack to allow you to use the extra features of the 2 first "Unused" Dip Switch (see notes above). */ - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); RAM[0x0005fa/2] = 0x4e71; RAM[0x00060a/2] = 0x4e71; #endif @@ -3523,7 +3523,7 @@ DRIVER_INIT_MEMBER(tumbleb_state,bcstory) DRIVER_INIT_MEMBER(tumbleb_state,htchctch) { - UINT16 *PROTDATA = (UINT16*)memregion("user1")->base(); + uint16_t *PROTDATA = (uint16_t*)memregion("user1")->base(); int i, len = memregion("user1")->bytes(); /* simulate RAM initialization done by the protection MCU */ @@ -3537,8 +3537,8 @@ DRIVER_INIT_MEMBER(tumbleb_state,htchctch) void tumbleb_state::suprtrio_decrypt_code() { - UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); - std::vector buf(0x80000/2); + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); + std::vector buf(0x80000/2); int i; /* decrypt main ROMs */ @@ -3554,8 +3554,8 @@ void tumbleb_state::suprtrio_decrypt_code() void tumbleb_state::suprtrio_decrypt_gfx() { - UINT16 *rom = (UINT16 *)memregion("tilegfx")->base(); - std::vector buf(0x100000/2); + uint16_t *rom = (uint16_t *)memregion("tilegfx")->base(); + std::vector buf(0x100000/2); int i; /* decrypt tiles */ diff --git a/src/mame/drivers/tumblep.cpp b/src/mame/drivers/tumblep.cpp index 4beb483767d..35b9fd46b66 100644 --- a/src/mame/drivers/tumblep.cpp +++ b/src/mame/drivers/tumblep.cpp @@ -376,10 +376,10 @@ ROM_END /******************************************************************************/ #if TUMBLEP_HACK -void ::tumblep_patch_code(UINT16 offset) +void ::tumblep_patch_code(uint16_t offset) { /* A hack which enables all Dip Switches effects */ - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); RAM[(offset + 0)/2] = 0x0240; RAM[(offset + 2)/2] = 0xffff; // andi.w #$f3ff, D0 } diff --git a/src/mame/drivers/turbo.cpp b/src/mame/drivers/turbo.cpp index bf9dee7c4d9..0bd3e580017 100644 --- a/src/mame/drivers/turbo.cpp +++ b/src/mame/drivers/turbo.cpp @@ -362,7 +362,7 @@ WRITE8_MEMBER( turbo_state::scanlines_w ) WRITE8_MEMBER( turbo_state::digit_w ) { - static const UINT8 ls48_map[16] = + static const uint8_t ls48_map[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; output().set_digit_value(m_i8279_scanlines * 2 + 0, ls48_map[data & 0x0f]); @@ -1685,7 +1685,7 @@ void turbo_state::turbo_rom_decode() * F 03 03 03 03 02 02 02 02 01 01 01 01 00 00 00 00 * */ - static const UINT8 xortable[][32]= + static const uint8_t xortable[][32]= { /* Table 0 */ /* 0x0000-0x3ff */ @@ -1746,9 +1746,9 @@ void turbo_state::turbo_rom_decode() 2,1,2,1 /* 0x5000-0x5fff */ }; - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); int offs, i, j; - UINT8 src; + uint8_t src; for (offs = 0x0000; offs < 0x6000; offs++) { diff --git a/src/mame/drivers/turrett.cpp b/src/mame/drivers/turrett.cpp index fcb637a4525..8002946d82d 100644 --- a/src/mame/drivers/turrett.cpp +++ b/src/mame/drivers/turrett.cpp @@ -34,8 +34,8 @@ void turrett_state::machine_start() { // Allocate memory for the two 256kx16 banks of video RAM - m_video_ram[0] = std::make_unique(VRAM_BANK_WORDS); - m_video_ram[1] = std::make_unique(VRAM_BANK_WORDS); + m_video_ram[0] = std::make_unique(VRAM_BANK_WORDS); + m_video_ram[1] = std::make_unique(VRAM_BANK_WORDS); // Register our state for saving save_pointer(NAME(m_video_ram[0].get()), VRAM_BANK_WORDS); @@ -181,9 +181,9 @@ WRITE32_MEMBER( turrett_state::int_w ) } -UINT32 turrett_state::update_inputs(void) +uint32_t turrett_state::update_inputs(void) { - UINT32 val = 0; + uint32_t val = 0; // TODO: Prioritise? if (m_inputs_active) @@ -200,8 +200,8 @@ UINT32 turrett_state::update_inputs(void) } else if (m_inputs_active & 0x0000ff00) { - UINT32 data = ioport("PORT CX")->read(); - UINT32 bits = m_inputs_active >> 8; + uint32_t data = ioport("PORT CX")->read(); + uint32_t bits = m_inputs_active >> 8; val = 0xc0; @@ -218,8 +218,8 @@ UINT32 turrett_state::update_inputs(void) } else if (m_inputs_active & 0x00ff0000) { - UINT32 data = ioport("PORT DX")->read(); - UINT32 bits = m_inputs_active >> 16; + uint32_t data = ioport("PORT DX")->read(); + uint32_t bits = m_inputs_active >> 16; val = 0xd0; @@ -322,12 +322,12 @@ extern const device_type TURRETT_HARDDISK; class turrett_hdd : public ide_hdd_device { public: - turrett_hdd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + turrett_hdd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ide_hdd_device(mconfig, TURRETT_HARDDISK, "HDD Turrett Tower", tag, owner, clock, "turrett_hdd", __FILE__) { } - virtual UINT32 lba_address() override + virtual uint32_t lba_address() override { if (m_device_head & IDE_DEVICE_HEAD_L) return (((m_device_head & IDE_DEVICE_HEAD_HS) << 24) | (m_cylinder_high << 16) | (m_cylinder_low << 8) | m_sector_number) - 63; diff --git a/src/mame/drivers/tutor.cpp b/src/mame/drivers/tutor.cpp index 725b8208f65..8a87122cd32 100644 --- a/src/mame/drivers/tutor.cpp +++ b/src/mame/drivers/tutor.cpp @@ -281,7 +281,7 @@ void tutor_state::machine_reset() READ8_MEMBER( tutor_state::key_r ) { char port[12]; - UINT8 value; + uint8_t value; snprintf(port, ARRAY_LENGTH(port), "LINE%d", offset); value = ioport(port)->read(); diff --git a/src/mame/drivers/tv950.cpp b/src/mame/drivers/tv950.cpp index 815b02f3916..81ea9d864a0 100644 --- a/src/mame/drivers/tv950.cpp +++ b/src/mame/drivers/tv950.cpp @@ -73,7 +73,7 @@ private: required_device m_maincpu; required_device m_via; required_device m_crtc; - required_shared_ptr m_vram; + required_shared_ptr m_vram; int m_row_addr; }; diff --git a/src/mame/drivers/tv990.cpp b/src/mame/drivers/tv990.cpp index 2538afc1cfb..ea4e8aa50e7 100644 --- a/src/mame/drivers/tv990.cpp +++ b/src/mame/drivers/tv990.cpp @@ -62,8 +62,8 @@ public: } required_device m_maincpu; - required_shared_ptr m_vram; - required_shared_ptr m_fontram; + required_shared_ptr m_vram; + required_shared_ptr m_fontram; required_device m_uart0, m_uart1; required_device m_screen; required_device m_kbdc; @@ -75,7 +75,7 @@ public: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; virtual void device_post_load() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER(tvi1111_r); DECLARE_WRITE16_MEMBER(tvi1111_w); @@ -89,7 +89,7 @@ public: INTERRUPT_GEN_MEMBER(vblank); DECLARE_INPUT_CHANGED_MEMBER(color); private: - UINT16 tvi1111_regs[(0x100/2)+2]; + uint16_t tvi1111_regs[(0x100/2)+2]; emu_timer *m_rowtimer; int m_rowh, m_width, m_height; }; @@ -180,15 +180,15 @@ WRITE16_MEMBER(tv990_state::tvi1111_w) m_beep->set_state(tvi1111_regs[0x17] & 4 ? ASSERT_LINE : CLEAR_LINE); } -UINT32 tv990_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t tv990_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT32 *scanline; + uint32_t *scanline; int x, y; - UINT8 pixels, pixels2; - UINT16 *vram = (UINT16 *)m_vram.target(); - UINT8 *fontram = (UINT8 *)m_fontram.target(); - UINT16 *curchar; - UINT8 *fontptr; + uint8_t pixels, pixels2; + uint16_t *vram = (uint16_t *)m_vram.target(); + uint8_t *fontram = (uint8_t *)m_fontram.target(); + uint16_t *curchar; + uint8_t *fontptr; int miny = cliprect.min_y / m_rowh; int maxy = cliprect.max_y / m_rowh; @@ -216,19 +216,19 @@ UINT32 tv990_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c for (x = minx; x < maxx; x++) { - UINT8 chr = curchar[x - minx] >> 8; - UINT8 attr = curchar[x - minx] & 0xff; + uint8_t chr = curchar[x - minx] >> 8; + uint8_t attr = curchar[x - minx] & 0xff; if((attr & 2) && (m_screen->frame_number() & 32)) // blink rate? continue; - fontptr = (UINT8 *)&fontram[(chr + (attr & 0x40 ? 256 : 0)) * 64]; + fontptr = (uint8_t *)&fontram[(chr + (attr & 0x40 ? 256 : 0)) * 64]; - UINT32 palette[2]; + uint32_t palette[2]; int cursor_pos = tvi1111_regs[0x16] + 133; if(BIT(tvi1111_regs[0x1b], 0) && (x == (cursor_pos % 134)) && (y == (cursor_pos / 134))) { - UINT8 attrchg; + uint8_t attrchg; if(tvi1111_regs[0x15] & 0xff00) // what does this really mean? it looks like a mask but that doesn't work in 8line char mode attrchg = 8; else diff --git a/src/mame/drivers/tvc.cpp b/src/mame/drivers/tvc.cpp index 319923a350c..ad7f22aac7c 100644 --- a/src/mame/drivers/tvc.cpp +++ b/src/mame/drivers/tvc.cpp @@ -68,7 +68,7 @@ public: void machine_start() override; void machine_reset() override; - void set_mem_page(UINT8 data); + void set_mem_page(uint8_t data); DECLARE_WRITE8_MEMBER(bank_w); DECLARE_WRITE8_MEMBER(vram_bank_w); DECLARE_WRITE8_MEMBER(palette_w); @@ -93,16 +93,16 @@ public: MC6845_UPDATE_ROW(crtc_update_row); - UINT8 m_video_mode; - UINT8 m_keyline; - UINT8 m_active_slot; - UINT8 m_int_flipflop; - UINT8 m_col[4]; - UINT8 m_bank_type[4]; - UINT8 m_bank; - UINT8 m_vram_bank; - UINT8 m_cassette_ff; - UINT8 m_centronics_ff; + uint8_t m_video_mode; + uint8_t m_keyline; + uint8_t m_active_slot; + uint8_t m_int_flipflop; + uint8_t m_col[4]; + uint8_t m_bank_type[4]; + uint8_t m_bank; + uint8_t m_vram_bank; + uint8_t m_cassette_ff; + uint8_t m_centronics_ff; DECLARE_PALETTE_INIT(tvc); }; @@ -122,7 +122,7 @@ public: m_bank_type[_bank] = TVC_RAM_BANK; \ } -void tvc_state::set_mem_page(UINT8 data) +void tvc_state::set_mem_page(uint8_t data) { address_space &space = m_maincpu->space(AS_PROGRAM); switch (data & 0x18) @@ -277,7 +277,7 @@ READ8_MEMBER(tvc_state::int_state_r) double level = m_cassette->input(); - UINT8 expint = (m_expansions[0]->int_r()<<0) | (m_expansions[1]->int_r()<<1) | + uint8_t expint = (m_expansions[0]->int_r()<<0) | (m_expansions[1]->int_r()<<1) | (m_expansions[2]->int_r()<<2) | (m_expansions[3]->int_r()<<3); return 0x40 | (m_int_flipflop << 4) | (level > 0.01 ? 0x20 : 0x00) | (m_centronics_ff << 7) | (expint & 0x0f); @@ -632,9 +632,9 @@ void tvc_state::machine_reset() MC6845_UPDATE_ROW( tvc_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT32 *p = &bitmap.pix32(y); - UINT8 *vram = m_vram->base() + ((m_vram_bank & 0x30)<<10); - UINT16 offset = ((ma*4 + ra*0x40) & 0x3fff); + uint32_t *p = &bitmap.pix32(y); + uint8_t *vram = m_vram->base() + ((m_vram_bank & 0x30)<<10); + uint16_t offset = ((ma*4 + ra*0x40) & 0x3fff); int i; switch(m_video_mode) { @@ -642,7 +642,7 @@ MC6845_UPDATE_ROW( tvc_state::crtc_update_row ) // 2 colors mode for ( i = 0; i < x_count; i++ ) { - UINT8 data = vram[offset + i]; + uint8_t data = vram[offset + i]; *p++ = palette[m_col[BIT(data,7)]]; *p++ = palette[m_col[BIT(data,6)]]; *p++ = palette[m_col[BIT(data,5)]]; @@ -658,7 +658,7 @@ MC6845_UPDATE_ROW( tvc_state::crtc_update_row ) // a0 b0 c0 d0 a1 b1 c1 d1 for ( i = 0; i < x_count; i++ ) { - UINT8 data = vram[offset + i]; + uint8_t data = vram[offset + i]; *p++ = palette[m_col[BIT(data,3)*2 + BIT(data,7)]]; *p++ = palette[m_col[BIT(data,3)*2 + BIT(data,7)]]; *p++ = palette[m_col[BIT(data,2)*2 + BIT(data,6)]]; @@ -674,9 +674,9 @@ MC6845_UPDATE_ROW( tvc_state::crtc_update_row ) // IIGG RRBB for ( i = 0; i < x_count; i++ ) { - UINT8 data = vram[offset + i]; - UINT8 col0 = ((data & 0x80)>>4) | ((data & 0x20)>>3) | ((data & 0x08)>>2) | ((data & 0x02)>>1); - UINT8 col1 = ((data & 0x40)>>3) | ((data & 0x10)>>2) | ((data & 0x04)>>1) | (data & 0x01); + uint8_t data = vram[offset + i]; + uint8_t col0 = ((data & 0x80)>>4) | ((data & 0x20)>>3) | ((data & 0x08)>>2) | ((data & 0x02)>>1); + uint8_t col1 = ((data & 0x40)>>3) | ((data & 0x10)>>2) | ((data & 0x04)>>1) | (data & 0x01); *p++ = palette[col0]; *p++ = palette[col0]; *p++ = palette[col0]; @@ -735,7 +735,7 @@ WRITE_LINE_MEMBER(tvc_state::centronics_ack) QUICKLOAD_LOAD_MEMBER( tvc_state, tvc64) { - UINT8 first_byte; + uint8_t first_byte; image.fread(&first_byte, 1); if (first_byte == 0x11) diff --git a/src/mame/drivers/tvcapcom.cpp b/src/mame/drivers/tvcapcom.cpp index 29e5508ce32..587be636c36 100644 --- a/src/mame/drivers/tvcapcom.cpp +++ b/src/mame/drivers/tvcapcom.cpp @@ -22,7 +22,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_tvcapcom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tvcapcom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -39,7 +39,7 @@ void tvcapcom_state::video_start() } -UINT32 tvcapcom_state::screen_update_tvcapcom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t tvcapcom_state::screen_update_tvcapcom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/tvgame.cpp b/src/mame/drivers/tvgame.cpp index c667bce0570..7f27b7e16e4 100644 --- a/src/mame/drivers/tvgame.cpp +++ b/src/mame/drivers/tvgame.cpp @@ -27,11 +27,11 @@ public: { } DECLARE_WRITE8_MEMBER(speaker_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); private: required_device m_maincpu; required_device m_speaker; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; }; static ADDRESS_MAP_START( tvgame_mem, AS_PROGRAM, 8, tvgame_state ) @@ -64,14 +64,14 @@ WRITE8_MEMBER( tvgame_state::speaker_w ) m_speaker->level_w(BIT(data, 0)); } -UINT32 tvgame_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t tvgame_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,gfx; - UINT16 sy=0,ma=241,x; + uint8_t y,gfx; + uint16_t sy=0,ma=241,x; for (y = 0; y < 213; y++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma+27; x++) { gfx = m_p_videoram[x]; diff --git a/src/mame/drivers/twin16.cpp b/src/mame/drivers/twin16.cpp index bb5077ed122..4d6ff2ef0e6 100644 --- a/src/mame/drivers/twin16.cpp +++ b/src/mame/drivers/twin16.cpp @@ -134,7 +134,7 @@ WRITE16_MEMBER(fround_state::fround_CPU_register_w) X 0->1 trigger IRQ on sound CPU x x coin counters */ - UINT16 old = m_CPUA_register; + uint16_t old = m_CPUA_register; COMBINE_DATA(&m_CPUA_register); if (m_CPUA_register != old) { diff --git a/src/mame/drivers/twinkle.cpp b/src/mame/drivers/twinkle.cpp index 9f2223a15f8..01c4286d446 100644 --- a/src/mame/drivers/twinkle.cpp +++ b/src/mame/drivers/twinkle.cpp @@ -261,17 +261,17 @@ public: required_device m_am53cf96; required_device m_ata; - required_region_ptr m_waveram; + required_region_ptr m_waveram; - UINT16 m_spu_ctrl; // SPU board control register - UINT8 m_spu_shared[0x400]; // SPU/PSX shared dual-ported RAM - UINT32 m_spu_ata_dma; + uint16_t m_spu_ctrl; // SPU board control register + uint8_t m_spu_shared[0x400]; // SPU/PSX shared dual-ported RAM + uint32_t m_spu_ata_dma; int m_spu_ata_dmarq; int m_io_offset; int m_output_last[ 0x100 ]; int m_last_io_offset; - UINT8 m_sector_buffer[ 4096 ]; + uint8_t m_sector_buffer[ 4096 ]; DECLARE_WRITE8_MEMBER(twinkle_io_w); DECLARE_READ8_MEMBER(twinkle_io_r); DECLARE_WRITE16_MEMBER(twinkle_output_w); @@ -328,7 +328,7 @@ public: // D2 D1 -static const UINT16 asciicharset[]= +static const uint16_t asciicharset[]= { LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F | LED_J | LED_M, // 0 LED_B | LED_C, // 1 @@ -534,7 +534,7 @@ WRITE8_MEMBER(twinkle_state::twinkle_io_w) READ8_MEMBER(twinkle_state::twinkle_io_r) { - UINT8 data = 0; + uint8_t data = 0; switch( offset ) { @@ -686,7 +686,7 @@ WRITE8_MEMBER(twinkle_state::shared_psx_w) READ8_MEMBER(twinkle_state::shared_psx_r) { - UINT32 result = m_spu_shared[offset]; + uint32_t result = m_spu_shared[offset]; //printf("shared_psx_r: %04x, %04x, %04x\n", offset, result, mem_mask); @@ -777,7 +777,7 @@ WRITE_LINE_MEMBER(twinkle_state::spu_ata_dmarq) while (m_spu_ata_dmarq) { - UINT16 data = m_ata->read_dma(); + uint16_t data = m_ata->read_dma(); //printf("spu_ata_dmarq %08x %04x\n", m_spu_ata_dma * 2, data); //waveram[m_spu_ata_dma++] = (data >> 8) | (data << 8); // bp 4a0e ;bmiidx4 checksum @@ -809,7 +809,7 @@ WRITE16_MEMBER(twinkle_state::twinkle_waveram_w) READ16_MEMBER(twinkle_state::shared_68k_r) { - UINT16 result = m_spu_shared[offset]; + uint16_t result = m_spu_shared[offset]; // printf("shared_68k_r: %04x, %04x, %04x\n", offset, result, mem_mask); @@ -848,7 +848,7 @@ ADDRESS_MAP_END /* SCSI */ -static void scsi_dma_read( twinkle_state *state, UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +static void scsi_dma_read( twinkle_state *state, uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { int i; int n_this; @@ -891,7 +891,7 @@ static void scsi_dma_read( twinkle_state *state, UINT32 *p_n_psxram, UINT32 n_ad } } -static void scsi_dma_write( twinkle_state *state, UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +static void scsi_dma_write( twinkle_state *state, uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { int i; int n_this; diff --git a/src/mame/drivers/twins.cpp b/src/mame/drivers/twins.cpp index bf4468e5dd4..e47f6099980 100644 --- a/src/mame/drivers/twins.cpp +++ b/src/mame/drivers/twins.cpp @@ -80,10 +80,10 @@ public: { } required_device m_maincpu; - optional_shared_ptr m_paletteram; + optional_shared_ptr m_paletteram; required_device m_palette; optional_device m_i2cmem; - UINT16 m_paloff; + uint16_t m_paloff; DECLARE_READ16_MEMBER(twins_port4_r); DECLARE_WRITE16_MEMBER(twins_port4_w); DECLARE_WRITE16_MEMBER(twins_pal_w); @@ -101,25 +101,25 @@ public: int m_spriteswidth; int m_spritesaddr; - UINT16 m_mainram[0x10000 / 2]; - UINT16 m_videoram[0x10000 / 2]; - UINT16 m_videoram2[0x10000 / 2]; - UINT16 m_videorambank; + uint16_t m_mainram[0x10000 / 2]; + uint16_t m_videoram[0x10000 / 2]; + uint16_t m_videoram2[0x10000 / 2]; + uint16_t m_videorambank; - UINT32 screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void machine_start() override; virtual void video_start() override; - UINT16* m_rom16; - UINT8* m_rom8; + uint16_t* m_rom16; + uint8_t* m_rom8; }; void twins_state::machine_start() { - m_rom16 = (UINT16*)memregion("maincpu")->base(); + m_rom16 = (uint16_t*)memregion("maincpu")->base(); m_rom8 = memregion("maincpu")->base(); } @@ -175,7 +175,7 @@ WRITE16_MEMBER(twins_state::porte_paloff0_w) READ16_MEMBER(twins_state::spider_blitter_r) { - UINT16* vram; + uint16_t* vram; if (m_videorambank & 1) vram = m_videoram2; else @@ -191,7 +191,7 @@ READ16_MEMBER(twins_state::spider_blitter_r) } else { - UINT16 *src = m_rom16; + uint16_t *src = m_rom16; return src[offset]; } } @@ -201,7 +201,7 @@ WRITE16_MEMBER(twins_state::spider_blitter_w) { // this is very strange, we use the offset (address bits) not data bits to set values.. // I get the impression this might actually overlay the entire address range, including RAM and regular VRAM? - UINT16* vram; + uint16_t* vram; if (m_videorambank & 1) vram = m_videoram2; else @@ -236,14 +236,14 @@ WRITE16_MEMBER(twins_state::spider_blitter_w) } else if (offset < 0x30000 / 2) { - UINT8 *src = m_rom8; + uint8_t *src = m_rom8; // printf("spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); offset &= 0x7fff; for (int i = 0; i < m_spriteswidth; i++) { - UINT8 data; + uint8_t data; data = (src[(m_spritesaddr * 2) + 1]); @@ -300,7 +300,7 @@ void twins_state::video_start() -UINT32 twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y,x,count; static const int xxx=320,yyy=204; @@ -308,7 +308,7 @@ UINT32 twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bit bitmap.fill(m_palette->black_pen()); count=0; - UINT8 *videoram = (UINT8*)m_videoram; + uint8_t *videoram = (uint8_t*)m_videoram; for (y=0;yblack_pen()); count=0; - UINT8 *videoram = (UINT8*)m_videoram; + uint8_t *videoram = (uint8_t*)m_videoram; for (y=0;y; -tx0_readtape_image_device::tx0_readtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tx0_readtape_image_device::tx0_readtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TX0_READTAPE, "TX0 Tape Reader", tag, owner, clock, "tx0_readtape_image", __FILE__), device_image_interface(mconfig, *this) { @@ -390,7 +390,7 @@ class tx0_punchtape_image_device : public device_t, { public: // construction/destruction - tx0_punchtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tx0_punchtape_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_PUNCHTAPE; } @@ -412,7 +412,7 @@ protected: const device_type TX0_PUNCHTAPE = &device_creator; -tx0_punchtape_image_device::tx0_punchtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tx0_punchtape_image_device::tx0_punchtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TX0_PUNCHTAPE, "TX0 Tape Puncher", tag, owner, clock, "tx0_punchtape_image", __FILE__), device_image_interface(mconfig, *this) { @@ -424,7 +424,7 @@ class tx0_printer_image_device : public device_t, { public: // construction/destruction - tx0_printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tx0_printer_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_PRINTER; } @@ -446,7 +446,7 @@ protected: const device_type TX0_PRINTER = &device_creator; -tx0_printer_image_device::tx0_printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tx0_printer_image_device::tx0_printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TX0_PRINTER, "TX0 Typewriter", tag, owner, clock, "tx0_printer_image", __FILE__), device_image_interface(mconfig, *this) { @@ -457,7 +457,7 @@ class tx0_magtape_image_device : public device_t, { public: // construction/destruction - tx0_magtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tx0_magtape_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_MAGTAPE; } @@ -479,7 +479,7 @@ protected: const device_type TX0_MAGTAPE = &device_creator; -tx0_magtape_image_device::tx0_magtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tx0_magtape_image_device::tx0_magtape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TX0_MAGTAPE, "TX0 Magnetic Tape", tag, owner, clock, "tx0_magtape_image", __FILE__), device_image_interface(mconfig, *this) { @@ -538,7 +538,7 @@ void tx0_readtape_image_device::call_unload() /* Read a byte from perforated tape */ -int tx0_state::tape_read(UINT8 *reply) +int tx0_state::tape_read(uint8_t *reply) { if (m_tape_reader.fd && (m_tape_reader.fd->fread(reply, 1) == 1)) return 0; /* unit OK */ @@ -549,7 +549,7 @@ int tx0_state::tape_read(UINT8 *reply) /* Write a byte to perforated tape */ -void tx0_state::tape_write(UINT8 data) +void tx0_state::tape_write(uint8_t data) { if (m_tape_puncher.fd) m_tape_puncher.fd->fwrite(& data, 1); @@ -582,7 +582,7 @@ void tx0_state::begin_tape_read(int binary) TIMER_CALLBACK_MEMBER(tx0_state::reader_callback) { int not_ready; - UINT8 data; + uint8_t data; int ac; if (m_tape_reader.rc) @@ -724,7 +724,7 @@ void tx0_printer_image_device::call_unload() /* Write a character to typewriter */ -void tx0_state::typewriter_out(UINT8 data) +void tx0_state::typewriter_out(uint8_t data) { tx0_typewriter_drawchar(data); if (m_typewriter.fd) @@ -887,7 +887,7 @@ void tx0_magtape_image_device::call_unload() void tx0_state::magtape_callback() { - UINT8 buf = 0; + uint8_t buf = 0; int lr; switch (m_magtape.state) @@ -1074,7 +1074,7 @@ void tx0_state::magtape_callback() difference... MAME seems to assume that I/O errors never happen, whereas it is really easy to cause one by deconnecting an external drive the image is located on!!! */ - UINT64 offs; + uint64_t offs; offs = m_magtape.img->ftell(); if (m_magtape.img->fseek( 0, SEEK_END) || (offs != m_magtape.img->ftell())) { /* I/O error */ @@ -1463,18 +1463,18 @@ INTERRUPT_GEN_MEMBER(tx0_state::tx0_interrupt) } if (control_transitions & tx0_stop) { - m_maincpu->set_state_int(TX0_RUN, (UINT64)0); - m_maincpu->set_state_int(TX0_RIM, (UINT64)0); + m_maincpu->set_state_int(TX0_RUN, (uint64_t)0); + m_maincpu->set_state_int(TX0_RIM, (uint64_t)0); } if (control_transitions & tx0_restart) { m_maincpu->set_state_int(TX0_RUN, 1); - m_maincpu->set_state_int(TX0_RIM, (UINT64)0); + m_maincpu->set_state_int(TX0_RIM, (uint64_t)0); } if (control_transitions & tx0_read_in) { /* set cpu to read instructions from perforated tape */ m_maincpu->pulse_reset(); - m_maincpu->set_state_int(TX0_RUN, (UINT64)0); + m_maincpu->set_state_int(TX0_RUN, (uint64_t)0); m_maincpu->set_state_int(TX0_RIM, 1); } if (control_transitions & tx0_toggle_dn) @@ -1493,7 +1493,7 @@ INTERRUPT_GEN_MEMBER(tx0_state::tx0_interrupt) { if (m_tsr_index >= 2) { - UINT32 cm_sel = (UINT32) m_maincpu->state_int(TX0_CM_SEL); + uint32_t cm_sel = (uint32_t) m_maincpu->state_int(TX0_CM_SEL); m_maincpu->set_state_int(TX0_CM_SEL, cm_sel ^ (1 << (m_tsr_index - 2))); } } @@ -1501,7 +1501,7 @@ INTERRUPT_GEN_MEMBER(tx0_state::tx0_interrupt) { if (m_tsr_index >= 2) { - UINT32 lr_sel = (UINT32) m_maincpu->state_int(TX0_LR_SEL); + uint32_t lr_sel = (uint32_t) m_maincpu->state_int(TX0_LR_SEL); m_maincpu->set_state_int(TX0_LR_SEL, (lr_sel ^ (1 << (m_tsr_index - 2)))); } } @@ -1590,7 +1590,7 @@ MACHINE_CONFIG_END ROM_START(tx0_64kw) /*CPU memory space*/ - ROM_REGION(0x10000 * sizeof(UINT32),"maincpu",ROMREGION_ERASEFF) + ROM_REGION(0x10000 * sizeof(uint32_t),"maincpu",ROMREGION_ERASEFF) /* Note this computer has no ROM... */ ROM_REGION(tx0_fontdata_size, "gfx1", ROMREGION_ERASEFF) @@ -1599,7 +1599,7 @@ ROM_END ROM_START(tx0_8kw) /*CPU memory space*/ - ROM_REGION(0x2000 * sizeof(UINT32),"maincpu",ROMREGION_ERASEFF) + ROM_REGION(0x2000 * sizeof(uint32_t),"maincpu",ROMREGION_ERASEFF) /* Note this computer has no ROM... */ ROM_REGION(tx0_fontdata_size, "gfx1", ROMREGION_ERASEFF) diff --git a/src/mame/drivers/tx1.cpp b/src/mame/drivers/tx1.cpp index 98260c40b8f..88afc8c75ab 100644 --- a/src/mame/drivers/tx1.cpp +++ b/src/mame/drivers/tx1.cpp @@ -443,7 +443,7 @@ READ8_MEMBER(tx1_state::tx1_ppi_portb_r) } -static UINT8 bit_reverse8(UINT8 val) +static uint8_t bit_reverse8(uint8_t val) { val = ((val & 0xF0) >> 4) | ((val & 0x0F) << 4); val = ((val & 0xCC) >> 2) | ((val & 0x33) << 2); diff --git a/src/mame/drivers/uapce.cpp b/src/mame/drivers/uapce.cpp index 14358a66aa1..88785d74e40 100644 --- a/src/mame/drivers/uapce.cpp +++ b/src/mame/drivers/uapce.cpp @@ -109,11 +109,11 @@ public: : pce_common_state(mconfig, type, tag), m_discrete(*this, "discrete") { } - UINT8 m_jamma_if_control_latch; + uint8_t m_jamma_if_control_latch; DECLARE_WRITE8_MEMBER(jamma_if_control_latch_w); DECLARE_READ8_MEMBER(jamma_if_control_latch_r); DECLARE_READ8_MEMBER(jamma_if_read_dsw); - virtual UINT8 joy_read() override; + virtual uint8_t joy_read() override; virtual void machine_reset() override; required_device m_discrete; }; @@ -130,7 +130,7 @@ DISCRETE_SOUND_END WRITE8_MEMBER(uapce_state::jamma_if_control_latch_w) { - UINT8 diff = data ^ m_jamma_if_control_latch; + uint8_t diff = data ^ m_jamma_if_control_latch; m_jamma_if_control_latch = data; /* D7 : Controls relay which connects the PCE R-AUDIO output to the common audio path. @@ -178,7 +178,7 @@ READ8_MEMBER(uapce_state::jamma_if_control_latch_r) READ8_MEMBER(uapce_state::jamma_if_read_dsw) { - UINT8 dsw_val; + uint8_t dsw_val; dsw_val = ioport("DSW" )->read(); @@ -218,7 +218,7 @@ READ8_MEMBER(uapce_state::jamma_if_read_dsw) return dsw_val & 1; } -UINT8 uapce_state::joy_read() +uint8_t uapce_state::joy_read() { if ( m_jamma_if_control_latch & 0x10 ) { diff --git a/src/mame/drivers/uknc.cpp b/src/mame/drivers/uknc.cpp index b7d97e481d2..db66b91d523 100644 --- a/src/mame/drivers/uknc.cpp +++ b/src/mame/drivers/uknc.cpp @@ -21,7 +21,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_uknc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_uknc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -51,7 +51,7 @@ void uknc_state::video_start() { } -UINT32 uknc_state::screen_update_uknc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t uknc_state::screen_update_uknc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/ultratnk.cpp b/src/mame/drivers/ultratnk.cpp index a3f05dcc257..75ffd7ecca3 100644 --- a/src/mame/drivers/ultratnk.cpp +++ b/src/mame/drivers/ultratnk.cpp @@ -28,7 +28,7 @@ CUSTOM_INPUT_MEMBER(ultratnk_state::get_collision) CUSTOM_INPUT_MEMBER(ultratnk_state::get_joystick) { - UINT8 joy = ioport((const char *)param)->read() & 3; + uint8_t joy = ioport((const char *)param)->read() & 3; if (joy == 1) { @@ -82,7 +82,7 @@ void ultratnk_state::machine_reset() READ8_MEMBER(ultratnk_state::ultratnk_wram_r) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; return videoram[0x380 + offset]; } @@ -109,7 +109,7 @@ READ8_MEMBER(ultratnk_state::ultratnk_options_r) WRITE8_MEMBER(ultratnk_state::ultratnk_wram_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; videoram[0x380 + offset] = data; } diff --git a/src/mame/drivers/ultrsprt.cpp b/src/mame/drivers/ultrsprt.cpp index b79c9784b1d..72a6f532dcb 100644 --- a/src/mame/drivers/ultrsprt.cpp +++ b/src/mame/drivers/ultrsprt.cpp @@ -24,45 +24,45 @@ public: m_workram(*this, "workram"), m_palette(*this, "palette") { } - static const UINT32 VRAM_PAGES = 2; - static const UINT32 VRAM_PAGE_BYTES = 512 * 1024; + static const uint32_t VRAM_PAGES = 2; + static const uint32_t VRAM_PAGE_BYTES = 512 * 1024; required_device m_maincpu; required_device m_audiocpu; required_device m_k056800; - required_shared_ptr m_workram; + required_shared_ptr m_workram; required_device m_palette; DECLARE_READ32_MEMBER(eeprom_r); DECLARE_WRITE32_MEMBER(eeprom_w); DECLARE_WRITE32_MEMBER(int_ack_w); - UINT32 screen_update_ultrsprt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ultrsprt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: virtual void machine_start() override; virtual void machine_reset() override; private: - std::unique_ptr m_vram; - UINT32 m_cpu_vram_page; + std::unique_ptr m_vram; + uint32_t m_cpu_vram_page; }; /*****************************************************************************/ -UINT32 ultrsprt_state::screen_update_ultrsprt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ultrsprt_state::screen_update_ultrsprt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *vram = m_vram.get() + (m_cpu_vram_page ^ 1) * VRAM_PAGE_BYTES; + uint8_t *vram = m_vram.get() + (m_cpu_vram_page ^ 1) * VRAM_PAGE_BYTES; for (int y = cliprect.min_y; y <= cliprect.max_y; ++y) { int fb_index = y * 1024; - UINT16 *dest = &bitmap.pix16(y, cliprect.min_x); + uint16_t *dest = &bitmap.pix16(y, cliprect.min_x); for (int x = cliprect.min_x; x <= cliprect.max_x; ++x) { - UINT8 p1 = vram[BYTE4_XOR_BE(fb_index + x + 512)]; + uint8_t p1 = vram[BYTE4_XOR_BE(fb_index + x + 512)]; if (p1 == 0) *dest++ = vram[BYTE4_XOR_BE(fb_index + x)]; @@ -85,7 +85,7 @@ WRITE32_MEMBER(ultrsprt_state::int_ack_w) READ32_MEMBER(ultrsprt_state::eeprom_r) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) r |= ioport("SERVICE")->read(); @@ -109,7 +109,7 @@ WRITE32_MEMBER(ultrsprt_state::eeprom_w) */ ioport("EEPROMOUT")->write(data, 0xffffffff); - UINT32 vram_page = (data & 0x08000000) >> 27; + uint32_t vram_page = (data & 0x08000000) >> 27; if (vram_page != m_cpu_vram_page) { @@ -188,7 +188,7 @@ void ultrsprt_state::machine_start() /* configure fast RAM regions for DRC */ m_maincpu->ppcdrc_add_fastram(0xff000000, 0xff01ffff, FALSE, m_workram); - m_vram = std::make_unique(VRAM_PAGE_BYTES * VRAM_PAGES); + m_vram = std::make_unique(VRAM_PAGE_BYTES * VRAM_PAGES); membank("vram")->configure_entries(0, VRAM_PAGES, m_vram.get(), VRAM_PAGE_BYTES); diff --git a/src/mame/drivers/umipoker.cpp b/src/mame/drivers/umipoker.cpp index ebfdfd589dc..936af9d7dd6 100644 --- a/src/mame/drivers/umipoker.cpp +++ b/src/mame/drivers/umipoker.cpp @@ -38,15 +38,15 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_vram_2; - required_shared_ptr m_vram_3; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_vram_2; + required_shared_ptr m_vram_3; tilemap_t *m_tilemap_0; tilemap_t *m_tilemap_1; tilemap_t *m_tilemap_2; tilemap_t *m_tilemap_3; - required_shared_ptr m_z80_wram; + required_shared_ptr m_z80_wram; int m_umipoker_scrolly[4]; DECLARE_READ8_MEMBER(z80_rom_readback_r); DECLARE_READ8_MEMBER(z80_shared_ram_r); @@ -72,7 +72,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_umipoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_umipoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -136,7 +136,7 @@ void umipoker_state::video_start() } -UINT32 umipoker_state::screen_update_umipoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t umipoker_state::screen_update_umipoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilemap_0->set_scrolly(0, m_umipoker_scrolly[0]); m_tilemap_1->set_scrolly(0, m_umipoker_scrolly[1]); @@ -155,7 +155,7 @@ UINT32 umipoker_state::screen_update_umipoker(screen_device &screen, bitmap_ind1 READ8_MEMBER(umipoker_state::z80_rom_readback_r) { - UINT8 *ROM = memregion("audiocpu")->base(); + uint8_t *ROM = memregion("audiocpu")->base(); return ROM[offset]; } diff --git a/src/mame/drivers/undrfire.cpp b/src/mame/drivers/undrfire.cpp index 32885d3d16a..f0e86fe6f65 100644 --- a/src/mame/drivers/undrfire.cpp +++ b/src/mame/drivers/undrfire.cpp @@ -1098,8 +1098,8 @@ ROM_END DRIVER_INIT_MEMBER(undrfire_state,undrfire) { - UINT32 offset,i; - UINT8 *gfx = memregion("gfx3")->base(); + uint32_t offset,i; + uint8_t *gfx = memregion("gfx3")->base(); int size=memregion("gfx3")->bytes(); int data; @@ -1127,8 +1127,8 @@ DRIVER_INIT_MEMBER(undrfire_state,undrfire) DRIVER_INIT_MEMBER(undrfire_state,cbombers) { - UINT32 offset,i; - UINT8 *gfx = memregion("gfx3")->base(); + uint32_t offset,i; + uint8_t *gfx = memregion("gfx3")->base(); int size=memregion("gfx3")->bytes(); int data; diff --git a/src/mame/drivers/unichamp.cpp b/src/mame/drivers/unichamp.cpp index 05e99772f72..1a855f83822 100644 --- a/src/mame/drivers/unichamp.cpp +++ b/src/mame/drivers/unichamp.cpp @@ -58,7 +58,7 @@ public: required_device m_gic; required_device m_cart; - UINT8 m_ram[256]; + uint8_t m_ram[256]; DECLARE_DRIVER_INIT(unichamp); virtual void machine_start() override; virtual void machine_reset() override; @@ -72,7 +72,7 @@ public: DECLARE_READ16_MEMBER(unichamp_trapl_r); DECLARE_WRITE16_MEMBER(unichamp_trapl_w); - UINT32 screen_update_unichamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_unichamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: required_ioport m_ctrls; @@ -138,7 +138,7 @@ READ8_MEMBER(unichamp_state::bext_r) //The CPU outputs a MASK of whatever it needs and checks the result. //EG: Any player can choose if one or two players are going to play the game for instance - UINT8 port = ioport("CTRLS")->read() & 0x0F; ////only lower nibble + uint8_t port = ioport("CTRLS")->read() & 0x0F; ////only lower nibble //We need to return logical high or low on the EBCI pin return (port & offset)>0?1:0; @@ -157,10 +157,10 @@ void unichamp_state::machine_start() if (m_cart->exists()){ //flip endians in more "this surely exists in MAME" way? //NOTE The unichamp roms have the same endianness as intv on disk and in memory - UINT8*ptr = m_cart->get_rom_base(); + uint8_t*ptr = m_cart->get_rom_base(); size_t size = m_cart->get_rom_size(); for(size_t i=0;iscreen_update(screen, bitmap, cliprect); } diff --git a/src/mame/drivers/unico.cpp b/src/mame/drivers/unico.cpp index f18dc1261fe..86500eab80a 100644 --- a/src/mame/drivers/unico.cpp +++ b/src/mame/drivers/unico.cpp @@ -87,8 +87,8 @@ WRITE16_MEMBER(unico_state::zeropnt_sound_bank_w) contains garbage. Indeed, only banks 0&1 are used */ int bank = (data >> 8 ) & 1; - UINT8 *dst = memregion("oki")->base(); - UINT8 *src = dst + 0x80000 + 0x20000 + 0x20000 * bank; + uint8_t *dst = memregion("oki")->base(); + uint8_t *src = dst + 0x80000 + 0x20000 + 0x20000 * bank; memcpy(dst + 0x20000, src, 0x20000); machine().bookkeeping().coin_counter_w(0,data & 0x1000); @@ -176,8 +176,8 @@ WRITE32_MEMBER(unico_state::zeropnt2_sound_bank_w) if (ACCESSING_BITS_24_31) { int bank = ((data >> 24) & 3) % 4; - UINT8 *dst = memregion("oki1")->base(); - UINT8 *src = dst + 0x80000 + 0x20000 + 0x20000 * bank; + uint8_t *dst = memregion("oki1")->base(); + uint8_t *src = dst + 0x80000 + 0x20000 + 0x20000 * bank; memcpy(dst + 0x20000, src, 0x20000); } } diff --git a/src/mame/drivers/unior.cpp b/src/mame/drivers/unior.cpp index 64bf30e97d4..51678c193a0 100644 --- a/src/mame/drivers/unior.cpp +++ b/src/mame/drivers/unior.cpp @@ -74,11 +74,11 @@ public: DECLARE_READ8_MEMBER(dma_r); I8275_DRAW_CHARACTER_MEMBER(display_pixels); - UINT8 *m_p_vram; - UINT8 *m_p_chargen; + uint8_t *m_p_vram; + uint8_t *m_p_chargen; private: - UINT8 m_4c; - UINT8 m_4e; + uint8_t m_4c; + uint8_t m_4e; virtual void machine_reset() override; virtual void video_start() override; required_device m_maincpu; @@ -261,7 +261,7 @@ WRITE8_MEMBER( unior_state::scroll_w ) I8275_DRAW_CHARACTER_MEMBER(unior_state::display_pixels) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 gfx = m_p_chargen[(linecount & 7) | (charcode << 3)]; + uint8_t gfx = m_p_chargen[(linecount & 7) | (charcode << 3)]; if(linecount == 8) gfx = 0; @@ -275,7 +275,7 @@ I8275_DRAW_CHARACTER_MEMBER(unior_state::display_pixels) if (rvv) gfx ^= 0xff; - for(UINT8 i=0;i<6;i++) + for(uint8_t i=0;i<6;i++) bitmap.pix32(y, x + i) = palette[BIT(gfx, 5-i) ? (hlgt ? 2 : 1) : 0]; } diff --git a/src/mame/drivers/unistar.cpp b/src/mame/drivers/unistar.cpp index 59537dd11b0..eb46be74a9d 100644 --- a/src/mame/drivers/unistar.cpp +++ b/src/mame/drivers/unistar.cpp @@ -24,8 +24,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(unistar); - UINT32 screen_update_unistar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - const UINT8 *m_p_chargen; + uint32_t screen_update_unistar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + const uint8_t *m_p_chargen; private: required_device m_maincpu; }; @@ -65,7 +65,7 @@ void unistar_state::video_start() { } -UINT32 unistar_state::screen_update_unistar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t unistar_state::screen_update_unistar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/univac.cpp b/src/mame/drivers/univac.cpp index 0a798a8af57..e2146e67586 100644 --- a/src/mame/drivers/univac.cpp +++ b/src/mame/drivers/univac.cpp @@ -44,15 +44,15 @@ public: DECLARE_READ8_MEMBER(vram_r); DECLARE_WRITE8_MEMBER(vram_w); DECLARE_WRITE8_MEMBER(port43_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); private: - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; bool m_screen_num; - UINT8 m_framecnt; + uint8_t m_framecnt; virtual void machine_start() override; virtual void machine_reset() override; required_device m_maincpu; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; required_device m_nvram; required_device m_ctc; required_device m_dart; @@ -111,7 +111,7 @@ void univac_state::machine_reset() m_p_chargen = memregion("chargen")->base(); } -UINT32 univac_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t univac_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // this is used to get the ctc to pass the test bool state = BIT(m_framecnt,0); @@ -120,9 +120,9 @@ UINT32 univac_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, m_ctc->trg2(state); m_ctc->trg3(state); - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; - UINT8 *videoram = m_p_videoram;//+(m_screen_num ? 0x2000 : 0); + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; + uint8_t *videoram = m_p_videoram;//+(m_screen_num ? 0x2000 : 0); m_framecnt++; @@ -130,7 +130,7 @@ UINT32 univac_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, { for (ra = 0; ra < 10; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 80; x++) { diff --git a/src/mame/drivers/unixpc.cpp b/src/mame/drivers/unixpc.cpp index d4a69cf23e4..e1a338113b0 100644 --- a/src/mame/drivers/unixpc.cpp +++ b/src/mame/drivers/unixpc.cpp @@ -47,7 +47,7 @@ public: required_device m_floppy; required_device m_ramrombank; - 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); virtual void machine_start() override; virtual void machine_reset() override; @@ -70,14 +70,14 @@ public: DECLARE_WRITE_LINE_MEMBER( wd2797_intrq_w ); DECLARE_WRITE_LINE_MEMBER( wd2797_drq_w ); - required_shared_ptr m_mapram; - required_shared_ptr m_videoram; + required_shared_ptr m_mapram; + required_shared_ptr m_videoram; private: - UINT16 *m_ramptr; - UINT32 m_ramsize; - UINT16 m_diskdmasize; - UINT32 m_diskdmaptr; + uint16_t *m_ramptr; + uint32_t m_ramsize; + uint16_t m_diskdmasize; + uint32_t m_diskdmaptr; bool m_fdc_intrq; }; @@ -119,7 +119,7 @@ WRITE16_MEMBER( unixpc_state::ram_mmu_w ) void unixpc_state::machine_start() { - m_ramptr = (UINT16 *)m_ram->pointer(); + m_ramptr = (uint16_t *)m_ram->pointer(); m_ramsize = m_ram->size(); } @@ -163,7 +163,7 @@ WRITE16_MEMBER( unixpc_state::rtc_w ) READ16_MEMBER( unixpc_state::line_printer_r ) { - UINT16 data = 0; + uint16_t data = 0; data |= 1; // no dial tone detected data |= 1 << 1; // no parity error @@ -255,7 +255,7 @@ WRITE_LINE_MEMBER( unixpc_state::wd2797_drq_w ) VIDEO ***************************************************************************/ -UINT32 unixpc_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t unixpc_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y = 0; y < 348; y++) for (int x = 0; x < 720/16; x++) diff --git a/src/mame/drivers/unkhorse.cpp b/src/mame/drivers/unkhorse.cpp index af9d234c11a..dcb26296c3e 100644 --- a/src/mame/drivers/unkhorse.cpp +++ b/src/mame/drivers/unkhorse.cpp @@ -38,10 +38,10 @@ public: required_device m_maincpu; required_device m_speaker; required_ioport_array<4> m_inp_matrix; - required_shared_ptr m_vram; + required_shared_ptr m_vram; - std::unique_ptr m_colorram; - UINT8 m_output; + std::unique_ptr m_colorram; + uint8_t m_output; DECLARE_READ8_MEMBER(colorram_r) { return m_colorram[(offset >> 2 & 0x1e0) | (offset & 0x1f)] | 0x0f; } DECLARE_WRITE8_MEMBER(colorram_w) { m_colorram[(offset >> 2 & 0x1e0) | (offset & 0x1f)] = data & 0xf0; } @@ -49,13 +49,13 @@ public: DECLARE_WRITE8_MEMBER(output_w); virtual void machine_start() override; - 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); INTERRUPT_GEN_MEMBER(interrupt); }; void horse_state::machine_start() { - m_colorram = std::make_unique(0x200); + m_colorram = std::make_unique(0x200); save_pointer(NAME(m_colorram.get()), 0x200); save_item(NAME(m_output)); } @@ -68,14 +68,14 @@ void horse_state::machine_start() ***************************************************************************/ -UINT32 horse_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t horse_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { for (int x = 0; x < 32; x++) { - UINT8 data = m_vram[y << 5 | x]; - UINT8 color = m_colorram[(y << 1 & 0x1e0) | x] >> 4; + uint8_t data = m_vram[y << 5 | x]; + uint8_t color = m_colorram[(y << 1 & 0x1e0) | x] >> 4; for (int i = 0; i < 8; i++) bitmap.pix16(y, x << 3 | i) = (data >> i & 1) ? color : 0; diff --git a/src/mame/drivers/upscope.cpp b/src/mame/drivers/upscope.cpp index 8454f0c135e..bee8ac9d886 100644 --- a/src/mame/drivers/upscope.cpp +++ b/src/mame/drivers/upscope.cpp @@ -41,11 +41,11 @@ public: m_parallel_data(0xff) { } - UINT8 m_nvram[0x100]; - UINT8 m_prev_cia1_porta; - UINT8 m_parallel_data; - UINT8 m_nvram_address_latch; - UINT8 m_nvram_data_latch; + uint8_t m_nvram[0x100]; + uint8_t m_prev_cia1_porta; + uint8_t m_parallel_data; + uint8_t m_nvram_address_latch; + uint8_t m_nvram_data_latch; DECLARE_READ8_MEMBER(upscope_cia_0_portb_r); DECLARE_WRITE8_MEMBER(upscope_cia_0_portb_w); diff --git a/src/mame/drivers/uzebox.cpp b/src/mame/drivers/uzebox.cpp index fdfc00d374a..61b63cadd27 100644 --- a/src/mame/drivers/uzebox.cpp +++ b/src/mame/drivers/uzebox.cpp @@ -55,17 +55,17 @@ public: virtual void machine_start() override; virtual void machine_reset() override; void line_update(); - UINT32 screen_update_uzebox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_uzebox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(uzebox_cart); private: int m_vpos; - UINT64 m_line_start_cycles; - UINT32 m_line_pos_cycles; - UINT8 m_port_a; - UINT8 m_port_b; - UINT8 m_port_c; - UINT8 m_port_d; + uint64_t m_line_start_cycles; + uint32_t m_line_pos_cycles; + uint8_t m_port_a; + uint8_t m_port_b; + uint8_t m_port_c; + uint8_t m_port_d; bitmap_rgb32 m_bitmap; }; @@ -100,7 +100,7 @@ WRITE8_MEMBER(uzebox_state::port_a_w) m_ctrl1->write_strobe(BIT(data, 2)); m_ctrl2->write_strobe(BIT(data, 2)); - UINT8 changed = m_port_a ^ data; + uint8_t changed = m_port_a ^ data; if ((changed & data & 0x08) || (changed & (~data) & 0x04)) { m_port_a &= ~0x03; @@ -130,7 +130,7 @@ WRITE8_MEMBER(uzebox_state::port_b_w) { line_update(); - UINT32 cycles = (UINT32)(m_maincpu->get_elapsed_cycles() - m_line_start_cycles); + uint32_t cycles = (uint32_t)(m_maincpu->get_elapsed_cycles() - m_line_start_cycles); if (cycles < 1000 && m_vpos >= 448) m_vpos = INTERLACED ? ((m_vpos ^ 0x01) & 0x01) : 0; else if (cycles > 1000) @@ -220,10 +220,10 @@ INPUT_PORTS_END void uzebox_state::line_update() { - UINT32 cycles = (UINT32)(m_maincpu->get_elapsed_cycles() - m_line_start_cycles) / 2; + uint32_t cycles = (uint32_t)(m_maincpu->get_elapsed_cycles() - m_line_start_cycles) / 2; rgb_t color = rgb_t(pal3bit(m_port_c >> 0), pal3bit(m_port_c >> 3), pal2bit(m_port_c >> 6)); - for (UINT32 x = m_line_pos_cycles; x < cycles; x++) + for (uint32_t x = m_line_pos_cycles; x < cycles; x++) { if (m_bitmap.cliprect().contains(x, m_vpos)) m_bitmap.pix32(m_vpos, x) = color; @@ -235,7 +235,7 @@ void uzebox_state::line_update() m_line_pos_cycles = cycles; } -UINT32 uzebox_state::screen_update_uzebox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t uzebox_state::screen_update_uzebox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); return 0; @@ -243,13 +243,13 @@ UINT32 uzebox_state::screen_update_uzebox(screen_device &screen, bitmap_rgb32 &b DEVICE_IMAGE_LOAD_MEMBER(uzebox_state, uzebox_cart) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); m_cart->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); if (image.software_entry() == nullptr) { - std::vector data(size); + std::vector data(size); image.fread(&data[0], size); if (!strncmp((const char*)&data[0], "UZEBOX", 6)) diff --git a/src/mame/drivers/v1050.cpp b/src/mame/drivers/v1050.cpp index f3aa72c312c..945ea8895c7 100644 --- a/src/mame/drivers/v1050.cpp +++ b/src/mame/drivers/v1050.cpp @@ -204,7 +204,7 @@ void v1050_state::bankswitch() // Keyboard HACK -static const UINT8 V1050_KEYCODES[4][12][8] = +static const uint8_t V1050_KEYCODES[4][12][8] = { { // unshifted { 0xc0, 0xd4, 0xd8, 0xdc, 0xe0, 0xe4, 0xe8, 0xec }, @@ -273,7 +273,7 @@ void v1050_state::scan_keyboard() int table = 0, row, col; int keydata = 0xff; - UINT8 line_mod = ioport("ROW12")->read(); + uint8_t line_mod = ioport("ROW12")->read(); if((line_mod & 0x07) && (line_mod & 0x18)) { @@ -291,7 +291,7 @@ void v1050_state::scan_keyboard() // scan keyboard for (row = 0; row < 12; row++) { - UINT8 data = ioport(keynames[row])->read(); + uint8_t data = ioport(keynames[row])->read(); for (col = 0; col < 8; col++) { @@ -331,7 +331,7 @@ READ8_MEMBER( v1050_state::kb_data_r ) READ8_MEMBER( v1050_state::kb_status_r ) { - UINT8 val = m_uart_kb->status_r(space, 0); + uint8_t val = m_uart_kb->status_r(space, 0); return val | (m_keyavail ? 0x02 : 0x00); } @@ -723,7 +723,7 @@ READ8_MEMBER(v1050_state::misc_ppi_pc_r) */ - UINT8 data = 0; + uint8_t data = 0; data |= m_centronics_busy << 4; data |= m_centronics_perror << 5; @@ -945,7 +945,7 @@ WRITE_LINE_MEMBER( v1050_state::fdc_drq_w ) IRQ_CALLBACK_MEMBER(v1050_state::v1050_int_ack) { - UINT8 vector = 0xf0 | (m_pic->a_r() << 1); + uint8_t vector = 0xf0 | (m_pic->a_r() << 1); //logerror("Interrupt Acknowledge Vector: %02x\n", vector); @@ -966,7 +966,7 @@ void v1050_state::machine_start() m_rtc->cs1_w(1); // setup memory banking - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); membank("bank1")->configure_entries(0, 2, ram, 0x10000); membank("bank1")->configure_entry(2, ram + 0x1c000); diff --git a/src/mame/drivers/v6809.cpp b/src/mame/drivers/v6809.cpp index d7784f2827c..9033a4cdec6 100644 --- a/src/mame/drivers/v6809.cpp +++ b/src/mame/drivers/v6809.cpp @@ -93,15 +93,15 @@ public: MC6845_UPDATE_ROW(crtc_update_row); MC6845_ON_UPDATE_ADDR_CHANGED(crtc_update_addr); - UINT8 *m_p_videoram; - const UINT8 *m_p_chargen; - UINT16 m_video_address; + uint8_t *m_p_videoram; + const uint8_t *m_p_chargen; + uint16_t m_video_address; private: bool m_speaker_en; - UINT8 m_video_index; - UINT8 m_term_data; - UINT8 m_vidbyte; + uint8_t m_video_index; + uint8_t m_term_data; + uint8_t m_vidbyte; required_device m_pia0; required_device m_maincpu; required_device m_crtc; @@ -173,9 +173,9 @@ GFXDECODE_END MC6845_UPDATE_ROW( v6809_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); + uint8_t chr,gfx; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); for (x = 0; x < x_count; x++) { @@ -218,7 +218,7 @@ WRITE8_MEMBER( v6809_state::v6809_address_w ) WRITE8_MEMBER( v6809_state::v6809_register_w ) { - UINT16 temp = m_video_address; + uint16_t temp = m_video_address; m_crtc->register_w( space, 0, data ); @@ -249,7 +249,7 @@ WRITE_LINE_MEMBER( v6809_state::write_acia_clock ) READ8_MEMBER( v6809_state::pb_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/vamphalf.cpp b/src/mame/drivers/vamphalf.cpp index 2b1543ceaa3..ba63cac6f4a 100644 --- a/src/mame/drivers/vamphalf.cpp +++ b/src/mame/drivers/vamphalf.cpp @@ -95,23 +95,23 @@ public: required_device m_gfxdecode; required_device m_palette; - optional_shared_ptr m_tiles; - optional_shared_ptr m_wram; - optional_shared_ptr m_tiles32; - optional_shared_ptr m_wram32; + optional_shared_ptr m_tiles; + optional_shared_ptr m_wram; + optional_shared_ptr m_tiles32; + optional_shared_ptr m_wram32; // driver init configuration int m_flip_bit; int m_palshift; int m_has_extra_gfx; - UINT16 m_semicom_prot_data[2]; + uint16_t m_semicom_prot_data[2]; int m_flipscreen; int m_semicom_prot_idx; int m_semicom_prot_which; - UINT16 m_finalgdr_backupram_bank; - std::unique_ptr m_finalgdr_backupram; - UINT8 m_qs1000_data; + uint16_t m_finalgdr_backupram_bank; + std::unique_ptr m_finalgdr_backupram; + uint8_t m_qs1000_data; DECLARE_WRITE16_MEMBER(flipscreen_w); DECLARE_WRITE32_MEMBER(flipscreen32_w); @@ -189,8 +189,8 @@ public: DECLARE_DRIVER_INIT(yorijori); DECLARE_DRIVER_INIT(mrkicker); - UINT32 screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_aoh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aoh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap); void draw_sprites_aoh(screen_device &screen, bitmap_ind16 &bitmap); void handle_flipped_visible_area(screen_device &screen); @@ -612,7 +612,7 @@ void vamphalf_state::video_start() void vamphalf_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap) { gfx_element *gfx = m_gfxdecode->gfx(0); - UINT32 cnt; + uint32_t cnt; int block, offs; int code,color,x,y,fx,fy; rectangle clip; @@ -697,7 +697,7 @@ void vamphalf_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap) void vamphalf_state::draw_sprites_aoh(screen_device &screen, bitmap_ind16 &bitmap) { gfx_element *gfx = m_gfxdecode->gfx(0); - UINT32 cnt; + uint32_t cnt; int block, offs; int code,color,x,y,fx,fy; rectangle clip; @@ -773,7 +773,7 @@ void vamphalf_state::handle_flipped_visible_area( screen_device &screen ) } -UINT32 vamphalf_state::screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vamphalf_state::screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { handle_flipped_visible_area(screen); bitmap.fill(0, cliprect); @@ -781,7 +781,7 @@ UINT32 vamphalf_state::screen_update_common(screen_device &screen, bitmap_ind16 return 0; } -UINT32 vamphalf_state::screen_update_aoh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vamphalf_state::screen_update_aoh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // handle_flipped_visible_area(screen); // not on this? bitmap.fill(0, cliprect); @@ -791,8 +791,8 @@ UINT32 vamphalf_state::screen_update_aoh(screen_device &screen, bitmap_ind16 &bi CUSTOM_INPUT_MEMBER(vamphalf_state::boonggab_photo_sensors_r) { - static const UINT16 photo_sensors_table[8] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; - UINT8 res = ioport("PHOTO_SENSORS")->read(); + static const uint16_t photo_sensors_table[8] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; + uint8_t res = ioport("PHOTO_SENSORS")->read(); switch(res) { @@ -2465,7 +2465,7 @@ ROM_END static int irq_active(address_space &space) { - UINT32 FCR = space.device().state().state_int(27); + uint32_t FCR = space.device().state().state_int(27); if( !(FCR&(1<<29)) ) // int 2 (irq 4) return 1; else @@ -2657,7 +2657,7 @@ READ32_MEMBER(vamphalf_state::finalgdr_speedup_r) READ32_MEMBER(vamphalf_state::mrkickera_speedup_r) { - UINT32 pc = space.device().safe_pc(); + uint32_t pc = space.device().safe_pc(); if(pc == 0x469de || pc == 0x46a36) { // if(irq_active(space)) @@ -2671,7 +2671,7 @@ READ32_MEMBER(vamphalf_state::mrkickera_speedup_r) READ16_MEMBER(vamphalf_state::mrkicker_speedup_r) { - UINT32 pc = space.device().safe_pc(); + uint32_t pc = space.device().safe_pc(); if(pc == 0x41ec6) { space.device().execute().eat_cycles(50); @@ -2876,7 +2876,7 @@ DRIVER_INIT_MEMBER(vamphalf_state,yorijori) m_semicom_prot_data[0] = 2; m_semicom_prot_data[1] = 1; -// UINT8 *romx = (UINT8 *)memregion("user1")->base(); +// uint8_t *romx = (uint8_t *)memregion("user1")->base(); // prevent code dying after a trap 33 by patching it out, why? // romx[BYTE4_XOR_BE(0x8ff0)] = 3; // romx[BYTE4_XOR_BE(0x8ff1)] = 0; @@ -2891,7 +2891,7 @@ DRIVER_INIT_MEMBER(vamphalf_state,yorijori) DRIVER_INIT_MEMBER(vamphalf_state,finalgdr) { m_finalgdr_backupram_bank = 1; - m_finalgdr_backupram = std::make_unique(0x80*0x100); + m_finalgdr_backupram = std::make_unique(0x80*0x100); m_maincpu->space(AS_PROGRAM).install_read_handler(0x005e874, 0x005e877, read32_delegate(FUNC(vamphalf_state::finalgdr_speedup_r), this)); machine().device("nvram")->set_base(m_finalgdr_backupram.get(), 0x80*0x100); @@ -2912,7 +2912,7 @@ DRIVER_INIT_MEMBER(vamphalf_state,mrkickera) { // backup ram isn't used m_finalgdr_backupram_bank = 1; - m_finalgdr_backupram = std::make_unique(0x80*0x100); + m_finalgdr_backupram = std::make_unique(0x80*0x100); m_maincpu->space(AS_PROGRAM).install_read_handler(0x00701a4, 0x00701a7, read32_delegate(FUNC(vamphalf_state::mrkickera_speedup_r), this)); machine().device("nvram")->set_base(m_finalgdr_backupram.get(), 0x80*0x100); diff --git a/src/mame/drivers/vaportra.cpp b/src/mame/drivers/vaportra.cpp index 9b14ecb9d81..469a51b6c29 100644 --- a/src/mame/drivers/vaportra.cpp +++ b/src/mame/drivers/vaportra.cpp @@ -837,7 +837,7 @@ C3D54* DRIVER_INIT_MEMBER(vaportra_state,vaportra) { - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); int i; for (i = 0x00000; i < 0x80000; i++) diff --git a/src/mame/drivers/vax11.cpp b/src/mame/drivers/vax11.cpp index acf6e607316..6ef07148c04 100644 --- a/src/mame/drivers/vax11.cpp +++ b/src/mame/drivers/vax11.cpp @@ -89,8 +89,8 @@ public: DECLARE_READ16_MEMBER( term_rx_status_r ); DECLARE_WRITE16_MEMBER( term_w ); DECLARE_WRITE8_MEMBER( kbd_put ); - UINT8 m_term_data; - UINT16 m_term_status; + uint8_t m_term_data; + uint16_t m_term_status; }; WRITE16_MEMBER(vax11_state::term_w) diff --git a/src/mame/drivers/vboy.cpp b/src/mame/drivers/vboy.cpp index da565f1de60..020b2d17df2 100644 --- a/src/mame/drivers/vboy.cpp +++ b/src/mame/drivers/vboy.cpp @@ -52,7 +52,7 @@ #define WRITE_FONT(woffs) \ COMBINE_DATA(&m_font[woffs]); /* normal */ \ - UINT16 dat = m_font[woffs]; \ + uint16_t dat = m_font[woffs]; \ m_font[((woffs) + 0x4000)] = dat; /* normal */ \ m_font[((woffs) + 0x8000) ^ 7] = dat; /* flip y */ \ m_font[((woffs) + 0xc000) ^ 7] = dat; /* flip y */ \ @@ -63,40 +63,40 @@ m_font[((woffs) + 0x1c000) ^ 7] = dat; /* flip x+y */ -/* FIXME: most if not all of these must be UINT8 */ +/* FIXME: most if not all of these must be uint8_t */ struct vboy_regs_t { - UINT32 lpc, lpc2, lpt, lpr; - UINT32 khb, klb; - UINT8 thb, tlb; - UINT32 tcr, wcr, kcr; + uint32_t lpc, lpc2, lpt, lpr; + uint32_t khb, klb; + uint8_t thb, tlb; + uint32_t tcr, wcr, kcr; }; struct vip_regs_t { - UINT16 INTPND; - UINT16 INTENB; - UINT16 DPSTTS; - UINT16 DPCTRL; - UINT16 BRTA; - UINT16 BRTB; - UINT16 BRTC; - UINT16 REST; - UINT16 FRMCYC; - UINT16 CTA; - UINT16 XPSTTS; - UINT16 XPCTRL; - UINT16 VER; - UINT16 SPT[4]; - UINT16 GPLT[4]; - UINT16 JPLT[4]; - UINT16 BKCOL; + uint16_t INTPND; + uint16_t INTENB; + uint16_t DPSTTS; + uint16_t DPCTRL; + uint16_t BRTA; + uint16_t BRTB; + uint16_t BRTC; + uint16_t REST; + uint16_t FRMCYC; + uint16_t CTA; + uint16_t XPSTTS; + uint16_t XPCTRL; + uint16_t VER; + uint16_t SPT[4]; + uint16_t GPLT[4]; + uint16_t JPLT[4]; + uint16_t BKCOL; }; struct vboy_timer_t { - UINT16 count; - UINT16 latch; + uint16_t count; + uint16_t latch; }; struct vboy_timer_t; @@ -182,40 +182,40 @@ public: DECLARE_WRITE8_MEMBER(lfb1_w); DECLARE_WRITE8_MEMBER(rfb0_w); DECLARE_WRITE8_MEMBER(rfb1_w); - std::unique_ptr m_font; - std::unique_ptr m_bgmap; - std::unique_ptr m_l_frame_0; - std::unique_ptr m_l_frame_1; - std::unique_ptr m_r_frame_0; - std::unique_ptr m_r_frame_1; + std::unique_ptr m_font; + std::unique_ptr m_bgmap; + std::unique_ptr m_l_frame_0; + std::unique_ptr m_l_frame_1; + std::unique_ptr m_r_frame_0; + std::unique_ptr m_r_frame_1; vboy_regs_t m_vboy_regs; vip_regs_t m_vip_regs; vboy_timer_t m_vboy_timer; - std::unique_ptr m_ovr_tempdraw_map; - UINT16 m_frame_count; - UINT8 m_displayfb; - UINT8 m_drawfb; - UINT8 m_row_num; + std::unique_ptr m_ovr_tempdraw_map; + uint16_t m_frame_count; + uint8_t m_displayfb; + uint8_t m_drawfb; + uint8_t m_row_num; attotime m_input_latch_time; void m_timer_tick(void); - void m_scanline_tick(int scanline, UINT8 screen_type); - void m_set_irq(UINT16 irq_vector); - - void put_obj(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, UINT16 code, UINT8 pal); - void fill_ovr_char(UINT16 code, UINT8 pal); - INT8 get_bg_map_pixel(int num, int xpos, int ypos); - void draw_bg_map(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 param_base, int mode, int gx, int gp, int gy, int mx, int mp, int my,int h, int w, - UINT16 x_mask, UINT16 y_mask, UINT8 ovr, bool right, int bg_map_num); - void draw_affine_map(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 param_base, int gx, int gp, int gy, int h, int w, - UINT16 x_mask, UINT16 y_mask, UINT8 ovr, bool right, int bg_map_num); - UINT8 display_world(int num, bitmap_ind16 &bitmap, const rectangle &cliprect, bool right, int &cur_spt); + void m_scanline_tick(int scanline, uint8_t screen_type); + void m_set_irq(uint16_t irq_vector); + + void put_obj(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, uint16_t code, uint8_t pal); + void fill_ovr_char(uint16_t code, uint8_t pal); + int8_t get_bg_map_pixel(int num, int xpos, int ypos); + void draw_bg_map(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t param_base, int mode, int gx, int gp, int gy, int mx, int mp, int my,int h, int w, + uint16_t x_mask, uint16_t y_mask, uint8_t ovr, bool right, int bg_map_num); + void draw_affine_map(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t param_base, int gx, int gp, int gy, int h, int w, + uint16_t x_mask, uint16_t y_mask, uint8_t ovr, bool right, int bg_map_num); + uint8_t display_world(int num, bitmap_ind16 &bitmap, const rectangle &cliprect, bool right, int &cur_spt); void m_set_brightness(void); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(vboy); - UINT32 screen_update_vboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_vboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(timer_main_tick); TIMER_DEVICE_CALLBACK_MEMBER(timer_pad_tick); TIMER_DEVICE_CALLBACK_MEMBER(vboy_scanlineL); @@ -225,22 +225,22 @@ public: void vboy_state::video_start() { // Allocate memory for temporary screens - m_ovr_tempdraw_map = make_unique_clear(0x40); + m_ovr_tempdraw_map = make_unique_clear(0x40); // Allocate memory for framebuffers - m_l_frame_0 = make_unique_clear(0x6000); - m_l_frame_1 = make_unique_clear(0x6000); - m_r_frame_0 = make_unique_clear(0x6000); - m_r_frame_1 = make_unique_clear(0x6000); + m_l_frame_0 = make_unique_clear(0x6000); + m_l_frame_1 = make_unique_clear(0x6000); + m_r_frame_0 = make_unique_clear(0x6000); + m_r_frame_1 = make_unique_clear(0x6000); - m_font = make_unique_clear((0x8000 >> 1)*4 * 2); - m_bgmap = make_unique_clear(0x20000 >> 1); + m_font = make_unique_clear((0x8000 >> 1)*4 * 2); + m_bgmap = make_unique_clear(0x20000 >> 1); } -void vboy_state::put_obj(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, UINT16 code, UINT8 pal) +void vboy_state::put_obj(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, uint16_t code, uint8_t pal) { - UINT16 data; - UINT8 yi, xi, dat, col; + uint16_t data; + uint8_t yi, xi, dat, col; for (yi = 0; yi < 8; yi++) { @@ -268,10 +268,10 @@ void vboy_state::put_obj(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, -void vboy_state::fill_ovr_char(UINT16 code, UINT8 pal) +void vboy_state::fill_ovr_char(uint16_t code, uint8_t pal) { - UINT16 data; - UINT8 yi, xi, dat; + uint16_t data; + uint8_t yi, xi, dat; int col; for (yi = 0; yi < 8; yi++) @@ -291,23 +291,23 @@ void vboy_state::fill_ovr_char(UINT16 code, UINT8 pal) } } -inline INT8 vboy_state::get_bg_map_pixel(int num, int xpos, int ypos) +inline int8_t vboy_state::get_bg_map_pixel(int num, int xpos, int ypos) { // g_profiler.start(PROFILER_USER1); int x, y; - UINT8 stepx, stepy; + uint8_t stepx, stepy; y = ypos >>3; x = xpos >>3; stepx = (x & 0x1c0) >> 6; stepy = ((y & 0x1c0) >> 6) * (stepx+1); - UINT16 val = READ_BGMAP((x & 0x3f) + (64 * (y & 0x3f)) + ((num + stepx + stepy) * 0x1000)); + uint16_t val = READ_BGMAP((x & 0x3f) + (64 * (y & 0x3f)) + ((num + stepx + stepy) * 0x1000)); int pal = m_vip_regs.GPLT[(val >> 14) & 3]; int code = val & 0x3fff; - UINT16 data; - UINT8 yi, xi, dat; + uint16_t data; + uint8_t yi, xi, dat; yi = ypos & 7; data = READ_FONT(code * 8 + yi); @@ -323,15 +323,15 @@ inline INT8 vboy_state::get_bg_map_pixel(int num, int xpos, int ypos) return (pal >> (dat*2)) & 3; } -void vboy_state::draw_bg_map(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 param_base, int mode, int gx, int gp, int gy, int mx, int mp, int my, int h, int w, - UINT16 x_mask, UINT16 y_mask, UINT8 ovr, bool right, int bg_map_num) +void vboy_state::draw_bg_map(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t param_base, int mode, int gx, int gp, int gy, int mx, int mp, int my, int h, int w, + uint16_t x_mask, uint16_t y_mask, uint8_t ovr, bool right, int bg_map_num) { // g_profiler.start(PROFILER_USER2); int x,y; for(y=0;y<=h;y++) { - INT32 y1 = (y+gy); + int32_t y1 = (y+gy); if ((y1 < cliprect.min_y) || (y1 > cliprect.max_y)) continue; @@ -340,7 +340,7 @@ void vboy_state::draw_bg_map(bitmap_ind16 &bitmap, const rectangle &cliprect, UI for(x=0;x<=w;x++) { - INT32 x1 = (x+gx); + int32_t x1 = (x+gx); x1 += right ? -gp : gp; @@ -350,7 +350,7 @@ void vboy_state::draw_bg_map(bitmap_ind16 &bitmap, const rectangle &cliprect, UI int src_x; src_x = x+mx; if (mode==1) - src_x += (INT16)READ_BGMAP(param_base + (y*2+(right ^ 1))); + src_x += (int16_t)READ_BGMAP(param_base + (y*2+(right ^ 1))); src_x += right ? -mp : mp; @@ -381,33 +381,33 @@ void vboy_state::draw_bg_map(bitmap_ind16 &bitmap, const rectangle &cliprect, UI // g_profiler.stop(); } -void vboy_state::draw_affine_map(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 param_base, int gx, int gp, int gy, int h, int w, - UINT16 x_mask, UINT16 y_mask, UINT8 ovr, bool right, int bg_map_num) +void vboy_state::draw_affine_map(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t param_base, int gx, int gp, int gy, int h, int w, + uint16_t x_mask, uint16_t y_mask, uint8_t ovr, bool right, int bg_map_num) { // g_profiler.start(PROFILER_USER3); int x,y; for(y=0;y<=h;y++) { - float h_skw = (INT16)READ_BGMAP(param_base + (y*8+0)) / 8.0; - float prlx = (INT16)READ_BGMAP(param_base + (y*8+1)) / 8.0; - float v_skw = (INT16)READ_BGMAP(param_base + (y*8+2)) / 8.0; - float h_scl = (INT16)READ_BGMAP(param_base + (y*8+3)) / 512.0; - float v_scl = (INT16)READ_BGMAP(param_base + (y*8+4)) / 512.0; + float h_skw = (int16_t)READ_BGMAP(param_base + (y*8+0)) / 8.0; + float prlx = (int16_t)READ_BGMAP(param_base + (y*8+1)) / 8.0; + float v_skw = (int16_t)READ_BGMAP(param_base + (y*8+2)) / 8.0; + float h_scl = (int16_t)READ_BGMAP(param_base + (y*8+3)) / 512.0; + float v_scl = (int16_t)READ_BGMAP(param_base + (y*8+4)) / 512.0; h_skw += right ? -prlx : prlx; for(x=0;x<=w;x++) { - INT32 src_x,src_y; - INT16 y1 = (y+gy); - INT16 x1 = (x+gx); + int32_t src_x,src_y; + int16_t y1 = (y+gy); + int16_t x1 = (x+gx); int pix = 0; x1 += right ? -gp : gp; - src_x = (INT32)((h_skw) + (h_scl * x)); - src_y = (INT32)((v_skw) + (v_scl * x)); + src_x = (int32_t)((h_skw) + (h_scl * x)); + src_y = (int32_t)((v_skw) + (v_scl * x)); if(ovr && (src_y > y_mask || src_x > x_mask || src_x < 0 || src_y < 0)) { @@ -438,28 +438,28 @@ x--- ---- ---- ---- [0] LON ---- ---- ---- xxxx BGMAP_BASE */ -UINT8 vboy_state::display_world(int num, bitmap_ind16 &bitmap, const rectangle &cliprect, bool right, int &cur_spt) +uint8_t vboy_state::display_world(int num, bitmap_ind16 &bitmap, const rectangle &cliprect, bool right, int &cur_spt) { num <<= 4; - UINT16 def = READ_WORLD(num); - UINT8 lon = (def >> 15) & 1; - UINT8 ron = (def >> 14) & 1; - UINT8 mode = (def >> 12) & 3; - UINT16 scx = 64 << ((def >> 10) & 3); - UINT16 scy = 64 << ((def >> 8) & 3); - UINT8 ovr = (def >> 7) & 1; - UINT8 end = (def >> 6) & 1; - INT16 gx = READ_WORLD(num+1); - INT16 gp = READ_WORLD(num+2); - INT16 gy = READ_WORLD(num+3); - INT16 mx = READ_WORLD(num+4); - INT16 mp = READ_WORLD(num+5); - INT16 my = READ_WORLD(num+6); - UINT16 w = READ_WORLD(num+7); - UINT16 h = READ_WORLD(num+8); - UINT16 param_base = READ_WORLD(num+9) & 0xfff0; - UINT16 ovr_char = READ_BGMAP(READ_WORLD(num+10)); - UINT8 bg_map_num = def & 0x0f; + uint16_t def = READ_WORLD(num); + uint8_t lon = (def >> 15) & 1; + uint8_t ron = (def >> 14) & 1; + uint8_t mode = (def >> 12) & 3; + uint16_t scx = 64 << ((def >> 10) & 3); + uint16_t scy = 64 << ((def >> 8) & 3); + uint8_t ovr = (def >> 7) & 1; + uint8_t end = (def >> 6) & 1; + int16_t gx = READ_WORLD(num+1); + int16_t gp = READ_WORLD(num+2); + int16_t gy = READ_WORLD(num+3); + int16_t mx = READ_WORLD(num+4); + int16_t mp = READ_WORLD(num+5); + int16_t my = READ_WORLD(num+6); + uint16_t w = READ_WORLD(num+7); + uint16_t h = READ_WORLD(num+8); + uint16_t param_base = READ_WORLD(num+9) & 0xfff0; + uint16_t ovr_char = READ_BGMAP(READ_WORLD(num+10)); + uint8_t bg_map_num = def & 0x0f; int i; if(end) @@ -514,13 +514,13 @@ UINT8 vboy_state::display_world(int num, bitmap_ind16 &bitmap, const rectangle & i = start_offs; do { - UINT16 start_ndx = i * 4; - INT16 jx = READ_OBJECTS(start_ndx+0); - INT16 jp = READ_OBJECTS(start_ndx+1) & 0x3fff; - INT16 jy = READ_OBJECTS(start_ndx+2) & 0x1ff; - UINT16 val = READ_OBJECTS(start_ndx+3); - UINT8 jlon = (READ_OBJECTS(start_ndx+1) & 0x8000) >> 15; - UINT8 jron = (READ_OBJECTS(start_ndx+1) & 0x4000) >> 14; + uint16_t start_ndx = i * 4; + int16_t jx = READ_OBJECTS(start_ndx+0); + int16_t jp = READ_OBJECTS(start_ndx+1) & 0x3fff; + int16_t jy = READ_OBJECTS(start_ndx+2) & 0x1ff; + uint16_t val = READ_OBJECTS(start_ndx+3); + uint8_t jlon = (READ_OBJECTS(start_ndx+1) & 0x8000) >> 15; + uint8_t jron = (READ_OBJECTS(start_ndx+1) & 0x4000) >> 14; if (!right && jlon) put_obj(bitmap, cliprect, (jx-jp) & 0x1ff, jy, val & 0x3fff, m_vip_regs.JPLT[(val>>14) & 3]); @@ -539,7 +539,7 @@ UINT8 vboy_state::display_world(int num, bitmap_ind16 &bitmap, const rectangle & return 0; } -UINT32 vboy_state::screen_update_vboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vboy_state::screen_update_vboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->pen(m_vip_regs.BKCOL), cliprect); int cur_spt; @@ -559,8 +559,8 @@ UINT32 vboy_state::screen_update_vboy_left(screen_device &screen, bitmap_ind16 & { for(x=0;x<384;x++) { - UINT8 pen; - UINT8 pix; + uint8_t pen; + uint8_t pix; int yi; pen = m_l_frame_1[(x*0x40)+(y >> 2)]; @@ -575,7 +575,7 @@ UINT32 vboy_state::screen_update_vboy_left(screen_device &screen, bitmap_ind16 & return 0; } -UINT32 vboy_state::screen_update_vboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vboy_state::screen_update_vboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->pen(m_vip_regs.BKCOL), cliprect); int cur_spt; @@ -598,7 +598,7 @@ UINT32 vboy_state::screen_update_vboy_right(screen_device &screen, bitmap_ind16 READ32_MEMBER( vboy_state::io_r ) { - UINT32 value = 0x00; + uint32_t value = 0x00; switch ((offset << 2)) { @@ -783,7 +783,7 @@ READ16_MEMBER( vboy_state::vip_r ) */ case 0x20: //DPSTTS { - UINT16 res; + uint16_t res; res = m_vip_regs.DPCTRL & 0x0702; @@ -828,7 +828,7 @@ READ16_MEMBER( vboy_state::vip_r ) ---- ---- ---- --x- XPEN (starts drawing at beginning of game frame) ---- ---- ---- ---x XPRST (force drawing process to idle) */ - UINT16 res; + uint16_t res; //printf("%d\n",row_num); @@ -1255,7 +1255,7 @@ PALETTE_INIT_MEMBER(vboy_state, vboy) palette.set_pen_color(3, rgb_t::black); } -void vboy_state::m_set_irq(UINT16 irq_vector) +void vboy_state::m_set_irq(uint16_t irq_vector) { m_vip_regs.INTPND |= irq_vector; @@ -1267,7 +1267,7 @@ void vboy_state::m_set_irq(UINT16 irq_vector) } /* TODO: obviously all of this needs clean-ups and better implementation ... */ -void vboy_state::m_scanline_tick(int scanline, UINT8 screen_type) +void vboy_state::m_scanline_tick(int scanline, uint8_t screen_type) { //int frame_num = machine().first_screen()->frame_number(); diff --git a/src/mame/drivers/vc4000.cpp b/src/mame/drivers/vc4000.cpp index b8ae5425103..f188ab231b1 100644 --- a/src/mame/drivers/vc4000.cpp +++ b/src/mame/drivers/vc4000.cpp @@ -136,7 +136,7 @@ Q-0900^76203F0161063005080E492DCD4890597877103F020E75105A0A0C1E89F4101879 READ8_MEMBER( vc4000_state::vc4000_key_r ) { - UINT8 data=0; + uint8_t data=0; switch(offset & 0x0f) { case 0x08: @@ -400,7 +400,7 @@ QUICKLOAD_LOAD_MEMBER( vc4000_state,vc4000) int i; int exec_addr; int quick_length; - std::vector quick_data; + std::vector quick_data; int read_; image_init_result result = image_init_result::FAIL; diff --git a/src/mame/drivers/vcombat.cpp b/src/mame/drivers/vcombat.cpp index aad397a13f6..f0e33d74228 100644 --- a/src/mame/drivers/vcombat.cpp +++ b/src/mame/drivers/vcombat.cpp @@ -106,10 +106,10 @@ public: m_vid_1(*this, "vid_1"), m_dac(*this, "dac") { } - std::unique_ptr m_m68k_framebuffer[2]; - std::unique_ptr m_i860_framebuffer[2][2]; + std::unique_ptr m_m68k_framebuffer[2]; + std::unique_ptr m_i860_framebuffer[2][2]; required_device m_tlc34076; - required_shared_ptr m_framebuffer_ctrl; + required_shared_ptr m_framebuffer_ctrl; int m_crtc_select; DECLARE_WRITE16_MEMBER(main_video_write); DECLARE_READ16_MEMBER(control_1_r); @@ -128,8 +128,8 @@ public: DECLARE_DRIVER_INIT(vcombat); DECLARE_MACHINE_RESET(vcombat); DECLARE_MACHINE_RESET(shadfgtr); - UINT32 screen_update_vcombat_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_vcombat_aux(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vcombat_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vcombat_aux(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_soundcpu; required_device m_vid_0; @@ -137,14 +137,14 @@ public: required_device m_dac; }; -static UINT32 update_screen(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index) +static uint32_t update_screen(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index) { vcombat_state *state = screen.machine().driver_data(); int y; const rgb_t *const pens = state->m_tlc34076->get_pens(); - UINT16 *m68k_buf = state->m_m68k_framebuffer[(*state->m_framebuffer_ctrl & 0x20) ? 1 : 0].get(); - UINT16 *i860_buf = state->m_i860_framebuffer[index][0].get(); + uint16_t *m68k_buf = state->m_m68k_framebuffer[(*state->m_framebuffer_ctrl & 0x20) ? 1 : 0].get(); + uint16_t *i860_buf = state->m_i860_framebuffer[index][0].get(); /* TODO: It looks like the leftmost chunk of the ground should really be on the right side? */ /* But the i860 draws the background correctly, so it may be an original game issue. */ @@ -155,15 +155,15 @@ static UINT32 update_screen(screen_device &screen, bitmap_rgb32 &bitmap, const r { int x; int src_addr = 256/2 * y; - const UINT16 *m68k_src = &m68k_buf[src_addr]; - const UINT16 *i860_src = &i860_buf[src_addr]; - UINT32 *dst = &bitmap.pix32(y, cliprect.min_x); + const uint16_t *m68k_src = &m68k_buf[src_addr]; + const uint16_t *i860_src = &i860_buf[src_addr]; + uint32_t *dst = &bitmap.pix32(y, cliprect.min_x); for (x = cliprect.min_x; x <= cliprect.max_x; x += 2) { int i; - UINT16 m68k_pix = *m68k_src++; - UINT16 i860_pix = *i860_src++; + uint16_t m68k_pix = *m68k_src++; + uint16_t i860_pix = *i860_src++; /* Draw two pixels */ for (i = 0; i < 2; ++i) @@ -186,14 +186,14 @@ static UINT32 update_screen(screen_device &screen, bitmap_rgb32 &bitmap, const r return 0; } -UINT32 vcombat_state::screen_update_vcombat_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 0); } -UINT32 vcombat_state::screen_update_vcombat_aux(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 1); } +uint32_t vcombat_state::screen_update_vcombat_main(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 0); } +uint32_t vcombat_state::screen_update_vcombat_aux(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 1); } WRITE16_MEMBER(vcombat_state::main_video_write) { int fb = (*m_framebuffer_ctrl & 0x20) ? 0 : 1; - UINT16 old_data = m_m68k_framebuffer[fb][offset]; + uint16_t old_data = m_m68k_framebuffer[fb][offset]; /* Transparency mode? */ if (*m_framebuffer_ctrl & 0x40) @@ -229,7 +229,7 @@ READ16_MEMBER(vcombat_state::control_3_r) return (ioport("IN2")->read() << 8); } -static void wiggle_i860_common(i860_cpu_device *device, UINT16 data) +static void wiggle_i860_common(i860_cpu_device *device, uint16_t data) { int bus_hold = (data & 0x03) == 0x03; int reset = data & 0x10; @@ -433,19 +433,19 @@ MACHINE_RESET_MEMBER(vcombat_state,shadfgtr) DRIVER_INIT_MEMBER(vcombat_state,vcombat) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); /* Allocate the 68000 framebuffers */ - m_m68k_framebuffer[0] = std::make_unique(0x8000); - m_m68k_framebuffer[1] = std::make_unique(0x8000); + m_m68k_framebuffer[0] = std::make_unique(0x8000); + m_m68k_framebuffer[1] = std::make_unique(0x8000); /* First i860 */ - m_i860_framebuffer[0][0] = std::make_unique(0x8000); - m_i860_framebuffer[0][1] = std::make_unique(0x8000); + m_i860_framebuffer[0][0] = std::make_unique(0x8000); + m_i860_framebuffer[0][1] = std::make_unique(0x8000); /* Second i860 */ - m_i860_framebuffer[1][0] = std::make_unique(0x8000); - m_i860_framebuffer[1][1] = std::make_unique(0x8000); + m_i860_framebuffer[1][0] = std::make_unique(0x8000); + m_i860_framebuffer[1][1] = std::make_unique(0x8000); /* pc==4016 : jump 4038 ... There's something strange about how it waits at 402e (interrupts all masked out) I think what is happening here is that M0 snags the first time @@ -466,12 +466,12 @@ DRIVER_INIT_MEMBER(vcombat_state,vcombat) DRIVER_INIT_MEMBER(vcombat_state,shadfgtr) { /* Allocate th 68000 frame buffers */ - m_m68k_framebuffer[0] = std::make_unique(0x8000); - m_m68k_framebuffer[1] = std::make_unique(0x8000); + m_m68k_framebuffer[0] = std::make_unique(0x8000); + m_m68k_framebuffer[1] = std::make_unique(0x8000); /* Only one i860 */ - m_i860_framebuffer[0][0] = std::make_unique(0x8000); - m_i860_framebuffer[0][1] = std::make_unique(0x8000); + m_i860_framebuffer[0][0] = std::make_unique(0x8000); + m_i860_framebuffer[0][1] = std::make_unique(0x8000); m_i860_framebuffer[1][0] = nullptr; m_i860_framebuffer[1][1] = nullptr; } diff --git a/src/mame/drivers/vcs80.cpp b/src/mame/drivers/vcs80.cpp index 9ab71cf8c49..bbca57adb3f 100644 --- a/src/mame/drivers/vcs80.cpp +++ b/src/mame/drivers/vcs80.cpp @@ -140,7 +140,7 @@ READ8_MEMBER( vcs80_state::pio_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; /* keyboard and led latch */ data |= m_keylatch; @@ -173,7 +173,7 @@ WRITE8_MEMBER( vcs80_state::pio_pb_w ) */ - UINT8 led_data = BITSWAP8(data & 0x7f, 7, 5, 6, 4, 3, 2, 1, 0); + uint8_t led_data = BITSWAP8(data & 0x7f, 7, 5, 6, 4, 3, 2, 1, 0); int digit = m_keylatch; /* skip middle digit */ diff --git a/src/mame/drivers/vd.cpp b/src/mame/drivers/vd.cpp index f2d17a2d6fa..ee0385c6156 100644 --- a/src/mame/drivers/vd.cpp +++ b/src/mame/drivers/vd.cpp @@ -39,8 +39,8 @@ protected: // driver_device overrides virtual void machine_reset() override; private: - UINT8 m_t_c; - UINT8 segment[5]; + uint8_t m_t_c; + uint8_t segment[5]; }; diff --git a/src/mame/drivers/vector4.cpp b/src/mame/drivers/vector4.cpp index 69275ba90fd..74b7dc3d9d7 100644 --- a/src/mame/drivers/vector4.cpp +++ b/src/mame/drivers/vector4.cpp @@ -30,7 +30,7 @@ public: DECLARE_READ8_MEMBER(vector4_03_r); DECLARE_WRITE8_MEMBER(vector4_02_w); DECLARE_WRITE8_MEMBER(kbd_put); - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; }; @@ -49,7 +49,7 @@ READ8_MEMBER( vector4_state::vector4_03_r ) READ8_MEMBER( vector4_state::vector4_02_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/drivers/vega.cpp b/src/mame/drivers/vega.cpp index 12497b386ab..144625a4c43 100644 --- a/src/mame/drivers/vega.cpp +++ b/src/mame/drivers/vega.cpp @@ -124,8 +124,8 @@ public: int m_tmp; int m_t1; - UINT8 m_ins8154_ram[0x80]; - UINT8 m_txt_ram[0x400]; + uint8_t m_ins8154_ram[0x80]; + uint8_t m_txt_ram[0x400]; vega_obj m_obj[NUM_OBJ]; @@ -163,7 +163,7 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(vega); void draw_tilemap(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect); - UINT32 screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; WRITE8_MEMBER(vega_state::extern_w) @@ -495,7 +495,7 @@ PALETTE_INIT_MEMBER(vega_state, vega) void vega_state::draw_tilemap(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect) { { - UINT8 *map_lookup = memregion("tilemaps")->base(); + uint8_t *map_lookup = memregion("tilemaps")->base(); int offset_y=m_tilemap_offset_y; int offset_x=m_tilemap_offset_x; @@ -547,7 +547,7 @@ void vega_state::draw_tilemap(screen_device& screen, bitmap_ind16& bitmap, const } -UINT32 vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { ++m_frame_counter; @@ -559,7 +559,7 @@ UINT32 vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitma { int x,y; int idx=0; - UINT8 *color_lookup = memregion("proms")->base() + 0x200; + uint8_t *color_lookup = memregion("proms")->base() + 0x200; for(y=0;y<25;++y) for(x=0;x<40;++x) @@ -625,7 +625,7 @@ UINT32 vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitma int x0=m_obj[OBJ_PLAYER].m_x; int y0=255-m_obj[OBJ_PLAYER].m_y-32; - UINT8 *sprite_lookup = memregion("proms")->base(); + uint8_t *sprite_lookup = memregion("proms")->base(); for(int x=0;x<16;++x) @@ -883,7 +883,7 @@ ROM_END DRIVER_INIT_MEMBER(vega_state, vega) { - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); membank("bank1")->configure_entries(0, 2, &ROM[0x1000], 0x800); } diff --git a/src/mame/drivers/vegaeo.cpp b/src/mame/drivers/vegaeo.cpp index 20f671825ce..f0e9e1ade1b 100644 --- a/src/mame/drivers/vegaeo.cpp +++ b/src/mame/drivers/vegaeo.cpp @@ -30,8 +30,8 @@ public: required_device m_soundlatch; - std::unique_ptr m_vega_vram; - UINT8 m_vega_vbuffer; + std::unique_ptr m_vega_vram; + uint8_t m_vega_vbuffer; DECLARE_WRITE32_MEMBER(vega_vram_w); DECLARE_READ32_MEMBER(vega_vram_r); @@ -46,7 +46,7 @@ public: DECLARE_DRIVER_INIT(vegaeo); DECLARE_VIDEO_START(vega); - UINT32 screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; READ8_MEMBER( vegaeo_state::qs1000_p1_r ) @@ -181,12 +181,12 @@ INPUT_PORTS_END VIDEO_START_MEMBER(vegaeo_state,vega) { - m_vega_vram = std::make_unique(0x14000*2/4); + m_vega_vram = std::make_unique(0x14000*2/4); save_pointer(NAME(m_vega_vram.get()), 0x14000*2/4); save_item(NAME(m_vega_vbuffer)); } -UINT32 vegaeo_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vegaeo_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count; int color; diff --git a/src/mame/drivers/vegas.cpp b/src/mame/drivers/vegas.cpp index 36f5054bb44..437eb030350 100644 --- a/src/mame/drivers/vegas.cpp +++ b/src/mame/drivers/vegas.cpp @@ -472,29 +472,29 @@ public: required_device m_timekeeper; required_device m_ide; required_device m_ethernet; - required_shared_ptr m_rambase; - required_shared_ptr m_nile_regs; - required_shared_ptr m_rombase; + required_shared_ptr m_rambase; + required_shared_ptr m_nile_regs; + required_shared_ptr m_rombase; required_device m_dcs; required_device m_ioasic; optional_ioport_array<8> m_io_analog; - UINT16 m_nile_irq_state; - UINT16 m_ide_irq_state; - UINT32 m_pci_bridge_regs[0x40]; - UINT32 m_pci_ide_regs[0x40]; - UINT32 m_pci_3dfx_regs[0x40]; + uint16_t m_nile_irq_state; + uint16_t m_ide_irq_state; + uint32_t m_pci_bridge_regs[0x40]; + uint32_t m_pci_ide_regs[0x40]; + uint32_t m_pci_3dfx_regs[0x40]; emu_timer *m_timer[4]; - UINT8 m_vblank_state; - UINT8 m_sio_data[4]; - UINT8 m_sio_irq_clear; - UINT8 m_sio_irq_enable; - UINT8 m_sio_irq_state; - UINT8 m_sio_led_state; - UINT8 m_pending_analog_read; - UINT8 m_cmos_unlocked; + uint8_t m_vblank_state; + uint8_t m_sio_data[4]; + uint8_t m_sio_irq_clear; + uint8_t m_sio_irq_enable; + uint8_t m_sio_irq_state; + uint8_t m_sio_led_state; + uint8_t m_pending_analog_read; + uint8_t m_cmos_unlocked; voodoo_device *m_voodoo; - UINT8 m_dcs_idma_cs; + uint8_t m_dcs_idma_cs; int m_count; int m_dynamic_count; dynamic_address m_dynamic[MAX_DYNAMIC_ADDRESSES]; @@ -513,7 +513,7 @@ public: DECLARE_DRIVER_INIT(sf2049se); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_vegas(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vegas(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(nile_timer_callback); void remap_dynamic_addresses(); void update_nile_irqs(); @@ -565,7 +565,7 @@ public: * *************************************/ -UINT32 vegas_state::screen_update_vegas(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t vegas_state::screen_update_vegas(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return m_voodoo->voodoo_update(bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } @@ -685,7 +685,7 @@ WRITE32_MEMBER( vegas_state::timekeeper_w ) READ32_MEMBER( vegas_state::timekeeper_r ) { - UINT32 result = 0xffffffff; + uint32_t result = 0xffffffff; if (ACCESSING_BITS_0_7) result = (result & ~0x000000ff) | (m_timekeeper->read(space, offset * 4 + 0, 0xff) << 0); if (ACCESSING_BITS_8_15) @@ -709,7 +709,7 @@ READ32_MEMBER( vegas_state::timekeeper_r ) READ32_MEMBER( vegas_state::pci_bridge_r ) { - UINT32 result = m_pci_bridge_regs[offset]; + uint32_t result = m_pci_bridge_regs[offset]; switch (offset) { @@ -745,7 +745,7 @@ WRITE32_MEMBER( vegas_state::pci_bridge_w ) READ32_MEMBER( vegas_state::pci_ide_r ) { - UINT32 result = m_pci_ide_regs[offset]; + uint32_t result = m_pci_ide_regs[offset]; switch (offset) { @@ -807,7 +807,7 @@ WRITE32_MEMBER( vegas_state::pci_ide_w ) READ32_MEMBER( vegas_state::pci_3dfx_r ) { int voodoo_type = m_voodoo->voodoo_get_type(); - UINT32 result = m_pci_3dfx_regs[offset]; + uint32_t result = m_pci_3dfx_regs[offset]; switch (offset) { @@ -896,9 +896,9 @@ WRITE32_MEMBER( vegas_state::pci_3dfx_w ) void vegas_state::update_nile_irqs() { - UINT32 intctll = m_nile_regs[NREG_INTCTRL+0]; - UINT32 intctlh = m_nile_regs[NREG_INTCTRL+1]; - UINT8 irq[6]; + uint32_t intctll = m_nile_regs[NREG_INTCTRL+0]; + uint32_t intctlh = m_nile_regs[NREG_INTCTRL+1]; + uint8_t irq[6]; int i; /* check for UART transmit IRQ enable and synthsize one */ @@ -961,15 +961,15 @@ void vegas_state::update_nile_irqs() TIMER_CALLBACK_MEMBER(vegas_state::nile_timer_callback) { int which = param; - UINT32 *regs = &m_nile_regs[NREG_T0CTRL + which * 4]; + uint32_t *regs = &m_nile_regs[NREG_T0CTRL + which * 4]; if (LOG_TIMERS) logerror("timer %d fired\n", which); /* adjust the timer to fire again */ { - UINT32 scale = regs[0]; + uint32_t scale = regs[0]; if (regs[1] & 2) { - UINT32 scaleSrc = (regs[1] >> 2) & 0x3; - UINT32 *scaleReg = &m_nile_regs[NREG_T0CTRL + scaleSrc * 4]; + uint32_t scaleSrc = (regs[1] >> 2) & 0x3; + uint32_t *scaleReg = &m_nile_regs[NREG_T0CTRL + scaleSrc * 4]; scale *= scaleReg[0]; //logerror("Unexpected value: timer %d is prescaled\n", which); logerror("Timer Scaling value: timer %d is prescaled from %08X to %08X\n", which, regs[0], scale); @@ -997,7 +997,7 @@ TIMER_CALLBACK_MEMBER(vegas_state::nile_timer_callback) READ32_MEMBER( vegas_state::nile_r ) { - UINT32 result = m_nile_regs[offset]; + uint32_t result = m_nile_regs[offset]; int logit = 1, which; switch (offset) @@ -1058,9 +1058,9 @@ READ32_MEMBER( vegas_state::nile_r ) { //if (m_nile_regs[offset - 1] & 2) // logerror("Unexpected value: timer %d is prescaled\n", which); - UINT32 scale = 1; + uint32_t scale = 1; if (m_nile_regs[offset - 1] & 2) { - UINT32 scaleSrc = (m_nile_regs[offset - 1] >> 2) & 0x3; + uint32_t scaleSrc = (m_nile_regs[offset - 1] >> 2) & 0x3; scale = m_nile_regs[NREG_T0CTRL + scaleSrc * 4]; logerror("Timer value: timer %d is prescaled by \n", which, scale); } @@ -1115,7 +1115,7 @@ READ32_MEMBER( vegas_state::nile_r ) WRITE32_MEMBER( vegas_state::nile_w ) { - UINT32 olddata = m_nile_regs[offset]; + uint32_t olddata = m_nile_regs[offset]; int logit = 1, which; COMBINE_DATA(&m_nile_regs[offset]); @@ -1190,11 +1190,11 @@ WRITE32_MEMBER( vegas_state::nile_w ) /* timer just enabled? */ if (!(olddata & 1) && (m_nile_regs[offset] & 1)) { - UINT32 scale = m_nile_regs[offset - 1]; + uint32_t scale = m_nile_regs[offset - 1]; //if (m_nile_regs[offset] & 2) // logerror("Unexpected value: timer %d is prescaled\n", which); if (m_nile_regs[offset] & 2) { - UINT32 scaleSrc = (m_nile_regs[offset] >> 2) & 0x3; + uint32_t scaleSrc = (m_nile_regs[offset] >> 2) & 0x3; scale *= m_nile_regs[NREG_T0CTRL + scaleSrc * 4]; logerror("Timer scale: timer %d is scaled by %08X\n", which, m_nile_regs[NREG_T0CTRL + which * 4]); } @@ -1208,9 +1208,9 @@ WRITE32_MEMBER( vegas_state::nile_w ) { //if (m_nile_regs[offset] & 2) // logerror("Unexpected value: timer %d is prescaled\n", which); - UINT32 scale = 1; + uint32_t scale = 1; if (m_nile_regs[offset] & 2) { - UINT32 scaleSrc = (m_nile_regs[offset] >> 2) & 0x3; + uint32_t scaleSrc = (m_nile_regs[offset] >> 2) & 0x3; scale = m_nile_regs[NREG_T0CTRL + scaleSrc * 4]; logerror("Timer scale: timer %d is scaled by %08X\n", which, scale); } @@ -1231,9 +1231,9 @@ WRITE32_MEMBER( vegas_state::nile_w ) { //if (m_nile_regs[offset - 1] & 2) // logerror("Unexpected value: timer %d is prescaled\n", which); - UINT32 scale = 1; + uint32_t scale = 1; if (m_nile_regs[offset - 1] & 2) { - UINT32 scaleSrc = (m_nile_regs[offset - 1] >> 2) & 0x3; + uint32_t scaleSrc = (m_nile_regs[offset - 1] >> 2) & 0x3; scale = m_nile_regs[NREG_T0CTRL + scaleSrc * 4]; logerror("Timer scale: timer %d is scaled by %08X\n", which, scale); } @@ -1454,7 +1454,7 @@ WRITE32_MEMBER( vegas_state::sio_w ) READ32_MEMBER( vegas_state::sio_r ) { - UINT32 result = 0; + uint32_t result = 0; if (ACCESSING_BITS_0_7) offset += 0; if (ACCESSING_BITS_8_15) offset += 1; if (ACCESSING_BITS_16_23) offset += 2; @@ -1545,7 +1545,7 @@ WRITE32_MEMBER( vegas_state::ide_bus_master32_w ) READ32_MEMBER( vegas_state::ethernet_r ) { - UINT32 result = 0; + uint32_t result = 0; if (ACCESSING_BITS_0_15) result |= m_ethernet->read(space, offset * 2 + 0, mem_mask); if (ACCESSING_BITS_16_31) diff --git a/src/mame/drivers/vg5k.cpp b/src/mame/drivers/vg5k.cpp index 2360fe3fabd..2f59c2962fc 100644 --- a/src/mame/drivers/vg5k.cpp +++ b/src/mame/drivers/vg5k.cpp @@ -297,7 +297,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(vg5k_state::z80_irq) TIMER_DEVICE_CALLBACK_MEMBER(vg5k_state::vg5k_scanline) { - m_ef9345->update_scanline((UINT16)param); + m_ef9345->update_scanline((uint16_t)param); } @@ -331,8 +331,8 @@ GFXDECODE_END DRIVER_INIT_MEMBER(vg5k_state,vg5k) { - UINT8 *FNT = memregion("ef9345")->base(); - UINT16 a,b,c,d,dest=0x2000; + uint8_t *FNT = memregion("ef9345")->base(); + uint16_t a,b,c,d,dest=0x2000; /* Unscramble the chargen rom as the format is too complex for gfxdecode to handle unaided */ for (a = 0; a < 8192; a+=4096) @@ -344,8 +344,8 @@ DRIVER_INIT_MEMBER(vg5k_state,vg5k) /* install expansion memory*/ address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); - UINT16 ram_size = m_ram->size(); + uint8_t *ram = m_ram->pointer(); + uint16_t ram_size = m_ram->size(); if (ram_size > 0x4000) program.install_ram(0x8000, 0x3fff + ram_size, ram); diff --git a/src/mame/drivers/vgmplay.cpp b/src/mame/drivers/vgmplay.cpp index d06178e826d..022403421dd 100644 --- a/src/mame/drivers/vgmplay.cpp +++ b/src/mame/drivers/vgmplay.cpp @@ -66,14 +66,14 @@ public: A_C352 = 0x00000000 }; - vgmplay_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vgmplay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; - virtual UINT32 execute_min_cycles() const override; - virtual UINT32 execute_max_cycles() const override; - virtual UINT32 execute_input_lines() const override; + virtual uint32_t execute_min_cycles() const override; + virtual uint32_t execute_max_cycles() const override; + virtual uint32_t execute_input_lines() const override; virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -83,9 +83,9 @@ public: virtual void state_export(const device_state_entry &entry) override; virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - virtual UINT32 disasm_min_opcode_bytes() const override; - virtual UINT32 disasm_max_opcode_bytes() const override; - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override; + virtual uint32_t disasm_max_opcode_bytes() const override; + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; READ8_MEMBER(segapcm_rom_r); READ8_MEMBER(multipcma_rom_r); @@ -98,10 +98,10 @@ private: struct rom_block { offs_t start_address; offs_t end_address; - std::unique_ptr data; + std::unique_ptr data; rom_block(rom_block &&) = default; - rom_block(offs_t start, offs_t end, std::unique_ptr &&d) : start_address(start), end_address(end), data(std::move(d)) {} + rom_block(offs_t start, offs_t end, std::unique_ptr &&d) : start_address(start), end_address(end), data(std::move(d)) {} }; enum { RESET, RUN, DONE }; @@ -111,17 +111,17 @@ private: int m_icount, m_state; - UINT32 m_pc; + uint32_t m_pc; std::list m_rom_blocks[2][0x40]; - std::vector m_data_streams[0x40]; - std::vector m_data_stream_starts[0x40]; + std::vector m_data_streams[0x40]; + std::vector m_data_stream_starts[0x40]; - UINT32 m_ym2612_stream_offset; + uint32_t m_ym2612_stream_offset; - UINT8 rom_r(int chip, UINT8 type, offs_t offset); - UINT32 handle_data_block(UINT32 address); + uint8_t rom_r(int chip, uint8_t type, offs_t offset); + uint32_t handle_data_block(uint32_t address); void blocks_clear(); }; @@ -143,7 +143,7 @@ public: DECLARE_WRITE8_MEMBER(multipcm_bank_hi_b_w); private: - std::vector m_file_data; + std::vector m_file_data; required_device m_file; required_device m_ym2612; required_device m_ym2151; @@ -160,7 +160,7 @@ private: required_device m_multipcmb; required_device m_dmg; required_device m_nescpu; - required_shared_ptr m_nesram; + required_shared_ptr m_nesram; required_device m_k053260; required_device m_c6280; required_device m_h6280; @@ -169,16 +169,16 @@ private: required_device m_c352; required_device m_okim6295; - UINT32 m_multipcma_bank_l; - UINT32 m_multipcma_bank_r; - UINT32 m_multipcmb_bank_l; - UINT32 m_multipcmb_bank_r; + uint32_t m_multipcma_bank_l; + uint32_t m_multipcma_bank_r; + uint32_t m_multipcmb_bank_l; + uint32_t m_multipcmb_bank_r; - UINT32 r32(int offset) const; - UINT8 r8(int offset) const; + uint32_t r32(int offset) const; + uint8_t r8(int offset) const; }; -vgmplay_device::vgmplay_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +vgmplay_device::vgmplay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, VGMPLAY, "VGM Player engine", tag, owner, clock, "vgmplay_core", __FILE__), m_file_config("file", ENDIANNESS_LITTLE, 8, 32), m_io_config("io", ENDIANNESS_LITTLE, 8, 32), @@ -208,17 +208,17 @@ void vgmplay_device::device_reset() blocks_clear(); } -UINT32 vgmplay_device::execute_min_cycles() const +uint32_t vgmplay_device::execute_min_cycles() const { return 0; } -UINT32 vgmplay_device::execute_max_cycles() const +uint32_t vgmplay_device::execute_max_cycles() const { return 65536; } -UINT32 vgmplay_device::execute_input_lines() const +uint32_t vgmplay_device::execute_input_lines() const { return 0; } @@ -233,18 +233,18 @@ void vgmplay_device::blocks_clear() } } -UINT32 vgmplay_device::handle_data_block(UINT32 address) +uint32_t vgmplay_device::handle_data_block(uint32_t address) { - UINT32 size = m_file->read_dword(m_pc+3); + uint32_t size = m_file->read_dword(m_pc+3); int second = (size & 0x80000000) ? 1 : 0; size &= 0x7fffffff; - UINT8 type = m_file->read_byte(m_pc+2); + uint8_t type = m_file->read_byte(m_pc+2); if(type < 0x40) { - UINT32 start = m_data_streams[type].size(); + uint32_t start = m_data_streams[type].size(); m_data_stream_starts[type].push_back(start); m_data_streams[type].resize(start + size); - for(UINT32 i=0; iread_byte(m_pc+7+i); } else if(type < 0x7f) @@ -254,15 +254,15 @@ UINT32 vgmplay_device::handle_data_block(UINT32 address) logerror("ignored compression table size %x\n", size); else if(type < 0xc0) { - //UINT32 rs = m_file->read_dword(m_pc+7); - UINT32 start = m_file->read_dword(m_pc+11); - std::unique_ptr block = std::make_unique(size - 8); - for(UINT32 i=0; iread_dword(m_pc+7); + uint32_t start = m_file->read_dword(m_pc+11); + std::unique_ptr block = std::make_unique(size - 8); + for(uint32_t i=0; iread_byte(m_pc+15+i); m_rom_blocks[second][type - 0x80].emplace_front(start, start+size-9, std::move(block)); } else if (type == 0xc2) { - UINT16 start = m_file->read_word(m_pc+7); - UINT32 data_size = size - 2; + uint16_t start = m_file->read_word(m_pc+7); + uint32_t data_size = size - 2; for (int i = 0; i < data_size; i++) { m_io->write_byte(A_NESRAM + start + i, m_file->read_byte(m_pc + 9 + i)); @@ -278,13 +278,13 @@ void vgmplay_device::execute_run() while(m_icount > 0) { switch(m_state) { case RESET: { - UINT32 size = m_io->read_dword(REG_SIZE); + uint32_t size = m_io->read_dword(REG_SIZE); if(!size) { m_pc = 0; m_state = DONE; break; } - UINT32 version = m_file->read_dword(8); + uint32_t version = m_file->read_dword(8); m_pc = version < 0x150 ? 0x40 : 0x34 + m_file->read_dword(0x34); m_state = RUN; break; @@ -292,7 +292,7 @@ void vgmplay_device::execute_run() case RUN: { if(machine().debug_flags & DEBUG_FLAG_ENABLED) debugger_instruction_hook(this, m_pc); - UINT8 code = m_file->read_byte(m_pc); + uint8_t code = m_file->read_byte(m_pc); switch(code) { case 0x4f: m_io->write_byte(A_SN76496+0, m_file->read_byte(m_pc+1)); @@ -353,7 +353,7 @@ void vgmplay_device::execute_run() break; case 0x61: { - UINT32 duration = m_file->read_word(m_pc+1); + uint32_t duration = m_file->read_word(m_pc+1); m_icount -= duration; m_pc += 3; break; @@ -371,7 +371,7 @@ void vgmplay_device::execute_run() case 0x66: { - UINT32 loop_offset = m_file->read_dword(0x1c); + uint32_t loop_offset = m_file->read_dword(0x1c); if (!loop_offset) { m_state = DONE; @@ -408,7 +408,7 @@ void vgmplay_device::execute_run() case 0xa0: { - UINT8 reg = m_file->read_byte(m_pc+1); + uint8_t reg = m_file->read_byte(m_pc+1); if (reg & 0x80) { m_io->write_byte(A_AY8910A+1, reg & 0x7f); @@ -440,7 +440,7 @@ void vgmplay_device::execute_run() case 0xb5: { - UINT8 offset = m_file->read_byte(m_pc+1); + uint8_t offset = m_file->read_byte(m_pc+1); if (offset & 0x80) m_io->write_byte(A_MULTIPCMB + (offset & 0x7f), m_file->read_byte(m_pc+2)); else @@ -466,7 +466,7 @@ void vgmplay_device::execute_run() case 0xbb: { - UINT8 offset = m_file->read_byte(m_pc+1); + uint8_t offset = m_file->read_byte(m_pc+1); if (offset & 0x80) m_io->write_byte(A_POKEYA + (offset & 0x7f), m_file->read_byte(m_pc+2)); else @@ -477,7 +477,7 @@ void vgmplay_device::execute_run() case 0xc3: { - UINT8 offset = m_file->read_byte(m_pc+1); + uint8_t offset = m_file->read_byte(m_pc+1); if (offset & 0x80) { m_io->write_byte(A_MULTIPCMB + 4 + (offset & 0x7f), m_file->read_byte(m_pc+3)); @@ -499,8 +499,8 @@ void vgmplay_device::execute_run() case 0xe1: { - UINT32 addr = (m_file->read_byte(m_pc+1) << 8) | m_file->read_byte(m_pc+2); - UINT16 data = (m_file->read_byte(m_pc+3) << 8) | m_file->read_byte(m_pc+4); + uint32_t addr = (m_file->read_byte(m_pc+1) << 8) | m_file->read_byte(m_pc+2); + uint16_t data = (m_file->read_byte(m_pc+3) << 8) | m_file->read_byte(m_pc+4); m_io16->write_word(A_C352 + (addr << 1), data); m_pc += 5; break; @@ -555,17 +555,17 @@ void vgmplay_device::state_string_export(const device_state_entry &entry, std::s { } -UINT32 vgmplay_device::disasm_min_opcode_bytes() const +uint32_t vgmplay_device::disasm_min_opcode_bytes() const { return 1; } -UINT32 vgmplay_device::disasm_max_opcode_bytes() const +uint32_t vgmplay_device::disasm_max_opcode_bytes() const { return 9; } -offs_t vgmplay_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) +offs_t vgmplay_device::disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) { switch(oprom[0]) { case 0x4f: @@ -637,7 +637,7 @@ offs_t vgmplay_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 * return 3 | DASMFLAG_SUPPORTED; case 0x61: { - UINT32 duration = oprom[1] | (oprom[2] << 8); + uint32_t duration = oprom[1] | (oprom[2] << 8); sprintf(buffer, "wait %d", duration); return 3 | DASMFLAG_SUPPORTED; } @@ -700,8 +700,8 @@ offs_t vgmplay_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 * "es5503 ram" }; - UINT8 type = oprom[2]; - UINT32 size = oprom[3] | (oprom[4] << 8) | (oprom[5] << 16) | (oprom[6] << 24); + uint8_t type = oprom[2]; + uint32_t size = oprom[3] | (oprom[4] << 8) | (oprom[5] << 16) | (oprom[6] << 24); if(type < 0x8) sprintf(buffer, "data-block %x, %s", size, basic_types[type]); else if(type < 0x40) @@ -838,14 +838,14 @@ offs_t vgmplay_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 * return 4 | DASMFLAG_SUPPORTED; case 0xe0: { - UINT32 off = oprom[1] | (oprom[2] << 8) | (oprom[3] << 16) | (oprom[4] << 24); + uint32_t off = oprom[1] | (oprom[2] << 8) | (oprom[3] << 16) | (oprom[4] << 24); sprintf(buffer, "ym2612 offset = %x", off); return 5 | DASMFLAG_SUPPORTED; } case 0xe1: { - UINT16 addr = (oprom[1] << 8) | oprom[2]; - UINT16 data = (oprom[3] << 8) | oprom[4]; + uint16_t addr = (oprom[1] << 8) | oprom[2]; + uint16_t data = (oprom[3] << 8) | oprom[4]; sprintf(buffer, "c352 r%04x = %04x", addr, data); return 5 | DASMFLAG_SUPPORTED; } @@ -856,7 +856,7 @@ offs_t vgmplay_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 * } } -UINT8 vgmplay_device::rom_r(int chip, UINT8 type, offs_t offset) +uint8_t vgmplay_device::rom_r(int chip, uint8_t type, offs_t offset) { for(const auto &b : m_rom_blocks[chip][type - 0x80]) { @@ -927,14 +927,14 @@ vgmplay_state::vgmplay_state(const machine_config &mconfig, device_type type, co { } -UINT32 vgmplay_state::r32(int off) const +uint32_t vgmplay_state::r32(int off) const { if(off + 3 < int(m_file_data.size())) return m_file_data[off] | (m_file_data[off+1] << 8) | (m_file_data[off+2] << 16) | (m_file_data[off+3] << 24); return 0; } -UINT8 vgmplay_state::r8(int off) const +uint8_t vgmplay_state::r8(int off) const { if(off < int(m_file_data.size())) return m_file_data[off]; @@ -944,7 +944,7 @@ UINT8 vgmplay_state::r8(int off) const void vgmplay_state::machine_start() { //m_nescpu-> - UINT32 size = 0; + uint32_t size = 0; if(m_file->exists()) { size = m_file->length(); m_file_data.resize(size); @@ -952,7 +952,7 @@ void vgmplay_state::machine_start() // Decompress gzip-compressed files (aka vgz) if(m_file_data[0] == 0x1f && m_file_data[1] == 0x8b) { - std::vector decomp; + std::vector decomp; int bs = m_file_data.size(); decomp.resize(2*bs); z_stream str; @@ -992,10 +992,10 @@ void vgmplay_state::machine_start() return; } - UINT32 version = r32(8); + uint32_t version = r32(8); logerror("File version %x.%02x\n", version >> 8, version & 0xff); - UINT32 header_size = 0; + uint32_t header_size = 0; if(version < 0x151) header_size = 0x40; else if(version < 0x161) @@ -1006,7 +1006,7 @@ void vgmplay_state::machine_start() header_size = 0x100; logerror("Header size according to version is %x, header size according to header is %x\n", header_size, r32(0x34) + 0x34); - UINT32 data_start = header_size; + uint32_t data_start = header_size; if (version >= 0x150 && r32(0x34)) data_start = r32(0x34) + 0x34; @@ -1028,7 +1028,7 @@ void vgmplay_state::machine_start() if(version >= 0x151 && r32(0x40)) logerror("Warning: file requests an unsupported RF5C68\n"); if(version >= 0x151 && r32(0x44)) { - UINT32 clock = r32(0x44); + uint32_t clock = r32(0x44); m_ym2203a->set_unscaled_clock(clock & ~0x40000000); if (clock & 0x40000000) { @@ -1061,7 +1061,7 @@ void vgmplay_state::machine_start() if(version >= 0x151 && r32(0x70)) logerror("Warning: file requests an unsupported PWM\n"); if(version >= 0x151 && r32(0x74)) { - UINT32 clock = r32(0x74); + uint32_t clock = r32(0x74); m_ay8910a->set_unscaled_clock(clock & ~0x40000000); if (clock & 0x40000000) { clock &= ~0x40000000; @@ -1069,7 +1069,7 @@ void vgmplay_state::machine_start() } } if(version >= 0x151 && r8(0x78)) { - UINT8 type = r8(0x78); + uint8_t type = r8(0x78); if (type & 0x10) { ay8910_device::set_psg_type(*m_ay8910a, ay8910_device::PSG_TYPE_YM); @@ -1077,8 +1077,8 @@ void vgmplay_state::machine_start() } } if(version >= 0x151 && r8(0x79)) { - UINT8 flags = r8(0x79); - UINT8 to_set = 0; + uint8_t flags = r8(0x79); + uint8_t to_set = 0; if (flags & 1) to_set |= AY8910_LEGACY_OUTPUT; if (flags & 2) @@ -1089,8 +1089,8 @@ void vgmplay_state::machine_start() ay8910_device::set_flags(*m_ay8910b, to_set); } if(version >= 0x151 && r8(0x7a)) { - UINT8 flags = r8(0x7a); - UINT8 to_set = 0; + uint8_t flags = r8(0x7a); + uint8_t to_set = 0; if (flags & 1) to_set |= AY8910_LEGACY_OUTPUT; if (flags & 2) @@ -1112,7 +1112,7 @@ void vgmplay_state::machine_start() m_nescpu->m_apu->set_unscaled_clock(r32(0x84)); } if(version >= 0x161 && r32(0x88)) { - UINT32 clock = r32(0x88); + uint32_t clock = r32(0x88); m_multipcma->set_unscaled_clock(clock & ~0x40000000); if (clock & 0x40000000) { clock &= ~0x40000000; @@ -1120,8 +1120,8 @@ void vgmplay_state::machine_start() } } if(version >= 0x161 && r32(0x98)) { - UINT32 clock = r32(0x98); - UINT32 pin7 = 0; + uint32_t clock = r32(0x98); + uint32_t pin7 = 0; if (clock & 0x80000000) { clock &= ~0x80000000; pin7 = 1; @@ -1136,7 +1136,7 @@ void vgmplay_state::machine_start() m_c6280->set_unscaled_clock(r32(0xa4)); } if(version >= 0x161 && r32(0xb0)) { - UINT32 clock = r32(0xb0); + uint32_t clock = r32(0xb0); m_pokeya->set_unscaled_clock(clock); if (clock & 0x40000000) { clock &= ~0x40000000; @@ -1166,7 +1166,7 @@ READ8_MEMBER(vgmplay_state::file_r) READ8_MEMBER(vgmplay_state::file_size_r) { - UINT32 size = m_file_data.size(); + uint32_t size = m_file_data.size(); return size >> (8*offset); } diff --git a/src/mame/drivers/vic10.cpp b/src/mame/drivers/vic10.cpp index 1cb9152842c..e2540ebd8e7 100644 --- a/src/mame/drivers/vic10.cpp +++ b/src/mame/drivers/vic10.cpp @@ -61,7 +61,7 @@ public: required_device m_exp; required_device m_ram; optional_device m_cassette; - optional_shared_ptr m_color_ram; + optional_shared_ptr m_color_ram; required_ioport_array<8> m_row; required_ioport m_restore; required_ioport m_lock; @@ -126,7 +126,7 @@ READ8_MEMBER( vic10_state::read ) { // TODO this is really handled by the PLA - UINT8 data = m_vic->bus_r(); + uint8_t data = m_vic->bus_r(); int lorom = 1, uprom = 1, exram = 1; if (offset < 0x800) @@ -384,7 +384,7 @@ WRITE_LINE_MEMBER( vic10_state::vic_irq_w ) READ8_MEMBER( vic10_state::sid_potx_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_cia->pa_r() >> 6) { @@ -411,7 +411,7 @@ READ8_MEMBER( vic10_state::sid_potx_r ) READ8_MEMBER( vic10_state::sid_poty_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch (m_cia->pa_r() >> 6) { @@ -465,17 +465,17 @@ READ8_MEMBER( vic10_state::cia_pa_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick - UINT8 joy_b = m_joy2->joy_r(); + uint8_t joy_b = m_joy2->joy_r(); data &= (0xf0 | (joy_b & 0x0f)); data &= ~(!BIT(joy_b, 5) << 4); // keyboard - UINT8 cia_pb = m_cia->pb_r(); - UINT32 row[8] = { m_row[0]->read(), m_row[1]->read() & m_lock->read(), m_row[2]->read(), m_row[3]->read(), + uint8_t cia_pb = m_cia->pb_r(); + uint32_t row[8] = { m_row[0]->read(), m_row[1]->read() & m_lock->read(), m_row[2]->read(), m_row[3]->read(), m_row[4]->read(), m_row[5]->read(), m_row[6]->read(), m_row[7]->read() }; for (int i = 0; i < 8; i++) @@ -513,16 +513,16 @@ READ8_MEMBER( vic10_state::cia_pb_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick - UINT8 joy_a = m_joy1->joy_r(); + uint8_t joy_a = m_joy1->joy_r(); data &= (0xf0 | (joy_a & 0x0f)); data &= ~(!BIT(joy_a, 5) << 4); // keyboard - UINT8 cia_pa = m_cia->pa_r(); + uint8_t cia_pa = m_cia->pa_r(); if (!BIT(cia_pa, 7)) data &= m_row[7]->read(); if (!BIT(cia_pa, 6)) data &= m_row[6]->read(); @@ -576,7 +576,7 @@ READ8_MEMBER( vic10_state::cpu_r ) */ - UINT8 data = 0; + uint8_t data = 0; // expansion port data |= m_exp->p0_r(); @@ -650,7 +650,7 @@ void vic10_state::machine_start() m_color_ram.allocate(0x400); // initialize memory - UINT8 data = 0xff; + uint8_t data = 0xff; for (offs_t offset = 0; offset < m_ram->size(); offset++) { diff --git a/src/mame/drivers/vic20.cpp b/src/mame/drivers/vic20.cpp index b19c2614325..22e5f0462a1 100644 --- a/src/mame/drivers/vic20.cpp +++ b/src/mame/drivers/vic20.cpp @@ -66,10 +66,10 @@ public: required_device m_user; required_device m_cassette; required_device m_ram; - required_region_ptr m_basic; - required_region_ptr m_kernal; - required_region_ptr m_charom; - required_shared_ptr m_color_ram; + required_region_ptr m_basic; + required_region_ptr m_kernal; + required_region_ptr m_charom; + required_shared_ptr m_color_ram; required_ioport_array<8> m_row; required_ioport m_restore; required_ioport m_lock; @@ -162,7 +162,7 @@ QUICKLOAD_LOAD_MEMBER( vic20_state, cbm_vc20 ) READ8_MEMBER( vic20_state::read ) { - UINT8 data = m_vic->bus_r(); + uint8_t data = m_vic->bus_r(); int ram1 = 1, ram2 = 1, ram3 = 1; int blk1 = 1, blk2 = 1, blk3 = 1, blk5 = 1; @@ -314,7 +314,7 @@ READ8_MEMBER( vic20_state::vic_videoram_r ) int blk1 = 1, blk2 = 1, blk3 = 1, blk5 = 1; int io2 = 1, io3 = 1; - UINT8 data = 0; + uint8_t data = 0; if (BIT(offset, 13)) { @@ -536,7 +536,7 @@ READ8_MEMBER( vic20_state::via1_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // serial clock in data |= m_iec->clk_r(); @@ -545,7 +545,7 @@ READ8_MEMBER( vic20_state::via1_pa_r ) data |= m_iec->data_r() << 1; // joystick / user port - UINT8 joy = m_joy->joy_r(); + uint8_t joy = m_joy->joy_r(); data |= (m_user_joy0 && BIT(joy, 0)) << 2; data |= (m_user_joy1 && BIT(joy, 1)) << 3; @@ -613,7 +613,7 @@ READ8_MEMBER( vic20_state::via2_pa_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 8; i++) { @@ -640,10 +640,10 @@ READ8_MEMBER( vic20_state::via2_pb_r ) */ - UINT8 data = 0xff; + uint8_t data = 0xff; // joystick - UINT8 joy = m_joy->joy_r(); + uint8_t joy = m_joy->joy_r(); data &= BIT(joy, 3) << 7; @@ -711,7 +711,7 @@ WRITE_LINE_MEMBER( vic20_state::exp_reset_w ) void vic20_state::machine_start() { // initialize memory - UINT8 data = 0xff; + uint8_t data = 0xff; for (offs_t offset = 0; offset < m_ram->size(); offset++) { diff --git a/src/mame/drivers/vicdual.cpp b/src/mame/drivers/vicdual.cpp index 3547570b3bd..e4a76ec2f7c 100644 --- a/src/mame/drivers/vicdual.cpp +++ b/src/mame/drivers/vicdual.cpp @@ -273,7 +273,7 @@ MACHINE_CONFIG_END READ8_MEMBER(vicdual_state::depthch_io_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset & 0x01) ret = m_in0->read(); if (offset & 0x08) ret = m_in1->read(); @@ -354,7 +354,7 @@ MACHINE_CONFIG_END READ8_MEMBER(vicdual_state::safari_io_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset & 0x01) ret = m_in0->read(); if (offset & 0x08) ret = m_in1->read(); @@ -437,7 +437,7 @@ MACHINE_CONFIG_END READ8_MEMBER(vicdual_state::frogs_io_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset & 0x01) ret = m_in0->read(); if (offset & 0x08) ret = m_in1->read(); @@ -548,7 +548,7 @@ MACHINE_CONFIG_END READ8_MEMBER(vicdual_state::headon_io_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset & 0x01) ret = m_in0->read(); if (offset & 0x08) ret = m_in1->read(); @@ -559,7 +559,7 @@ READ8_MEMBER(vicdual_state::headon_io_r) READ8_MEMBER(vicdual_state::sspaceat_io_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset & 0x01) ret = m_in0->read(); if (offset & 0x04) ret = m_in1->read(); @@ -807,7 +807,7 @@ MACHINE_CONFIG_END READ8_MEMBER(vicdual_state::headon2_io_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset & 0x01) ret = m_in0->read(); if (offset & 0x02) { /* schematics show this as in input port, but never read from */ } @@ -1299,7 +1299,7 @@ ADDRESS_MAP_END CUSTOM_INPUT_MEMBER(vicdual_state::fake_lives_r) { /* use the low byte for the bitmask */ - UINT8 bit_mask = ((uintptr_t)param) & 0xff; + uint8_t bit_mask = ((uintptr_t)param) & 0xff; /* and use d8 for the port */ int port = ((uintptr_t)param) >> 8 & 1; @@ -2107,7 +2107,7 @@ WRITE8_MEMBER(vicdual_state::samurai_protection_w) CUSTOM_INPUT_MEMBER(vicdual_state::samurai_protection_r) { int offset = (uintptr_t)param; - UINT32 answer = 0; + uint32_t answer = 0; if (m_samurai_protection_data == 0xab) answer = 0x02; @@ -2232,7 +2232,7 @@ MACHINE_CONFIG_END READ8_MEMBER(vicdual_state::nsub_io_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset & 0x01) ret = m_in0->read(); if (offset & 0x08) ret = m_in1->read(); @@ -2413,7 +2413,7 @@ MACHINE_CONFIG_END READ8_MEMBER(vicdual_state::invinco_io_r) { - UINT8 ret = 0; + uint8_t ret = 0; if (offset & 0x01) ret = m_in0->read(); if (offset & 0x02) ret = m_in1->read(); diff --git a/src/mame/drivers/victor9k.cpp b/src/mame/drivers/victor9k.cpp index 04314fb46ab..cea5dcdcb0a 100644 --- a/src/mame/drivers/victor9k.cpp +++ b/src/mame/drivers/victor9k.cpp @@ -113,7 +113,7 @@ public: required_device m_rs232b; required_device m_palette; required_memory_region m_rom; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; virtual void machine_start() override; virtual void machine_reset() override; @@ -257,9 +257,9 @@ MC6845_UPDATE_ROW( victor9k_state::crtc_update_row ) for (int sx = 0; sx < x_count; sx++) { - UINT16 dc = (m_video_ram[aa + 1] << 8) | m_video_ram[aa]; + uint16_t dc = (m_video_ram[aa + 1] << 8) | m_video_ram[aa]; offs_t ab = (dot_addr << 15) | ((dc & 0x7ff) << 4) | (ra & 0x0f); - UINT16 dd = program.read_word(ab << 1); + uint16_t dd = program.read_word(ab << 1); int cursor = (sx == cursor_x) ? 1 : 0; int undln = !((dc & DC_UNDLN) && BIT(dd, 15)) ? 2 : 0; diff --git a/src/mame/drivers/vidbrain.cpp b/src/mame/drivers/vidbrain.cpp index 15be596cddc..fad2c2c40cd 100644 --- a/src/mame/drivers/vidbrain.cpp +++ b/src/mame/drivers/vidbrain.cpp @@ -103,7 +103,7 @@ READ8_MEMBER( vidbrain_state::keyboard_r ) */ - UINT8 data = m_joy_r->read(); + uint8_t data = m_joy_r->read(); for (int i = 0; i < 8; i++) { @@ -387,7 +387,7 @@ WRITE_LINE_MEMBER( vidbrain_state::hblank_w ) { if (state && m_joy_enable && !m_timer_ne555->enabled()) { - UINT8 joydata = 0; + uint8_t joydata = 0; if (!BIT(m_keylatch, 0)) joydata = m_joy1_x->read(); if (!BIT(m_keylatch, 1)) joydata = m_joy1_y->read(); @@ -426,7 +426,7 @@ READ8_MEMBER(vidbrain_state::memory_read_byte) IRQ_CALLBACK_MEMBER(vidbrain_state::vidbrain_int_ack) { - UINT16 vector = m_vector; + uint16_t vector = m_vector; switch (m_int_enable) { diff --git a/src/mame/drivers/videopin.cpp b/src/mame/drivers/videopin.cpp index ac3a1a0717d..8eca7894418 100644 --- a/src/mame/drivers/videopin.cpp +++ b/src/mame/drivers/videopin.cpp @@ -27,7 +27,7 @@ solarwar void videopin_state::update_plunger() { - UINT8 val = ioport("IN2")->read(); + uint8_t val = ioport("IN2")->read(); if (m_prev != val) { @@ -117,7 +117,7 @@ READ8_MEMBER(videopin_state::misc_r) // signals received. This results in the MPU displaying the // ball being shot onto the playfield at a certain speed. - UINT8 val = ioport("IN1")->read(); + uint8_t val = ioport("IN1")->read(); if (plunger >= 0.000 && plunger <= 0.001) { diff --git a/src/mame/drivers/videopkr.cpp b/src/mame/drivers/videopkr.cpp index 969634e91d7..282246b1242 100644 --- a/src/mame/drivers/videopkr.cpp +++ b/src/mame/drivers/videopkr.cpp @@ -304,39 +304,39 @@ public: m_dac(*this, "dac"), m_gfxdecode(*this, "gfxdecode") { } - UINT8 m_data_ram[0x100]; - UINT8 m_video_ram[0x0400]; - UINT8 m_color_ram[0x0400]; - UINT16 m_p1; - UINT16 m_p2; - UINT8 m_t0_latch; - UINT16 m_n_offs; - UINT8 m_vp_sound_p2; - UINT8 m_p24_data; - UINT8 m_sound_latch; - UINT8 m_baby_latch; - UINT8 m_sound_ant; - UINT8 m_dc_4020; - UINT8 m_dc_40103; - UINT8 m_te_40103; - UINT8 m_ld_40103; - UINT8 m_ant_jckp; - UINT8 m_jckp; - UINT8 m_ant_cio; - UINT8 m_c_io; - UINT8 m_hp_1; - UINT8 m_hp_2; - UINT8 m_bell; - UINT8 m_aux3; - UINT8 m_dvrt; + uint8_t m_data_ram[0x100]; + uint8_t m_video_ram[0x0400]; + uint8_t m_color_ram[0x0400]; + uint16_t m_p1; + uint16_t m_p2; + uint8_t m_t0_latch; + uint16_t m_n_offs; + uint8_t m_vp_sound_p2; + uint8_t m_p24_data; + uint8_t m_sound_latch; + uint8_t m_baby_latch; + uint8_t m_sound_ant; + uint8_t m_dc_4020; + uint8_t m_dc_40103; + uint8_t m_te_40103; + uint8_t m_ld_40103; + uint8_t m_ant_jckp; + uint8_t m_jckp; + uint8_t m_ant_cio; + uint8_t m_c_io; + uint8_t m_hp_1; + uint8_t m_hp_2; + uint8_t m_bell; + uint8_t m_aux3; + uint8_t m_dvrt; unsigned long m_count0; unsigned long m_count1; unsigned long m_count2; unsigned long m_count3; unsigned long m_count4; - UINT8 m_sbp0; - UINT8 m_sbp2; - UINT8 m_sbp3; + uint8_t m_sbp0; + uint8_t m_sbp2; + uint8_t m_sbp3; tilemap_t *m_bg_tilemap; DECLARE_READ8_MEMBER(videopkr_io_r); DECLARE_WRITE8_MEMBER(videopkr_io_w); @@ -365,9 +365,9 @@ public: DECLARE_VIDEO_START(vidadcba); DECLARE_PALETTE_INIT(babypkr); DECLARE_PALETTE_INIT(fortune1); - UINT32 screen_update_videopkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_videopkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(sound_t1_callback); - void count_7dig(unsigned long data, UINT8 index); + void count_7dig(unsigned long data, uint8_t index); required_device m_maincpu; required_device m_soundcpu; required_device m_dac; @@ -382,9 +382,9 @@ public: *************************/ /* BCD to Seven Segment Decoder */ -static UINT8 dec_7seg(int data) +static uint8_t dec_7seg(int data) { - UINT8 segment; + uint8_t segment; switch (data) { case 0: segment = 0x3f; break; @@ -404,9 +404,9 @@ static UINT8 dec_7seg(int data) } /* Display a seven digit counter on layout - Index points to less significant digit*/ -void videopkr_state::count_7dig(unsigned long data, UINT8 index) +void videopkr_state::count_7dig(unsigned long data, uint8_t index) { - UINT8 i; + uint8_t i; char strn[8]; sprintf(strn,"%7lu",data); @@ -418,7 +418,7 @@ void videopkr_state::count_7dig(unsigned long data, UINT8 index) PALETTE_INIT_MEMBER(videopkr_state, videopkr) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int j; for (j = 0; j < palette.entries(); j++) @@ -445,7 +445,7 @@ PALETTE_INIT_MEMBER(videopkr_state, videopkr) PALETTE_INIT_MEMBER(videopkr_state,babypkr) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int j; for (j = 0; j < palette.entries(); j++) @@ -476,7 +476,7 @@ PALETTE_INIT_MEMBER(videopkr_state,babypkr) PALETTE_INIT_MEMBER(videopkr_state,fortune1) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int j; for (j = 0; j < palette.entries(); j++) @@ -528,7 +528,7 @@ VIDEO_START_MEMBER(videopkr_state,vidadcba) } -UINT32 videopkr_state::screen_update_videopkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t videopkr_state::screen_update_videopkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->mark_all_dirty(); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -542,9 +542,9 @@ UINT32 videopkr_state::screen_update_videopkr(screen_device &screen, bitmap_ind1 READ8_MEMBER(videopkr_state::videopkr_io_r) { - UINT8 valor = 0, hf, co; + uint8_t valor = 0, hf, co; - UINT16 kbdin; + uint16_t kbdin; switch (m_p2) { @@ -906,7 +906,7 @@ READ8_MEMBER(videopkr_state::baby_sound_p3_r) WRITE8_MEMBER(videopkr_state::baby_sound_p3_w) { ay8910_device *ay8910 = machine().device("aysnd"); - UINT8 lmp_ports, ay_intf; + uint8_t lmp_ports, ay_intf; m_sbp3 = data; lmp_ports = m_sbp3 >> 1 & 0x07; diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp index f62430dbe52..4026b81fa5e 100644 --- a/src/mame/drivers/vii.cpp +++ b/src/mame/drivers/vii.cpp @@ -118,36 +118,36 @@ public: DECLARE_READ16_MEMBER(io_r); DECLARE_WRITE16_MEMBER(io_w); DECLARE_READ16_MEMBER(rom_r); - required_shared_ptr m_p_ram; - required_shared_ptr m_p_rowscroll; - required_shared_ptr m_p_palette; - required_shared_ptr m_p_spriteram; + required_shared_ptr m_p_ram; + required_shared_ptr m_p_rowscroll; + required_shared_ptr m_p_palette; + required_shared_ptr m_p_spriteram; required_memory_bank m_bank; - UINT32 m_current_bank; + uint32_t m_current_bank; - UINT16 m_video_regs[0x100]; - UINT32 m_centered_coordinates; - void test_centered(UINT8 *ROM); + uint16_t m_video_regs[0x100]; + uint32_t m_centered_coordinates; + void test_centered(uint8_t *ROM); struct { - UINT8 r, g, b; + uint8_t r, g, b; } m_screenram[320*240]; - UINT16 m_io_regs[0x200]; - UINT16 m_uart_rx_count; - UINT8 m_controller_input[8]; - UINT32 m_spg243_mode; + uint16_t m_io_regs[0x200]; + uint16_t m_uart_rx_count; + uint8_t m_controller_input[8]; + uint32_t m_spg243_mode; emu_timer *m_tmb1; emu_timer *m_tmb2; - void do_dma(UINT32 len); - void do_gpio(UINT32 offset); - void switch_bank(UINT32 bank); + void do_dma(uint32_t len); + void do_gpio(uint32_t offset); + void switch_bank(uint32_t bank); void do_i2c(); - void spg_do_dma(UINT32 len); + void spg_do_dma(uint32_t len); DECLARE_DRIVER_INIT(vsmile); DECLARE_DRIVER_INIT(walle); DECLARE_DRIVER_INIT(vii); @@ -155,7 +155,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_vii(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vii(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vii_vblank); TIMER_CALLBACK_MEMBER(tmb1_tick); TIMER_CALLBACK_MEMBER(tmb2_tick); @@ -168,15 +168,15 @@ protected: memory_region *m_cart_rom; - void blit(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 xoff, UINT32 yoff, UINT32 attr, UINT32 ctrl, UINT32 bitmap_addr, UINT16 tile); - void blit_page(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, UINT32 bitmap_addr, UINT16 *regs); - void blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, UINT32 base_addr); + void blit(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t xoff, uint32_t yoff, uint32_t attr, uint32_t ctrl, uint32_t bitmap_addr, uint16_t tile); + void blit_page(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, uint32_t bitmap_addr, uint16_t *regs); + void blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, uint32_t base_addr); void blit_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth); inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4); - inline UINT8 expand_rgb5_to_rgb8(UINT8 val); - inline UINT8 mix_channel(UINT8 a, UINT8 b); - void mix_pixel(UINT32 offset, UINT16 rgb); - void set_pixel(UINT32 offset, UINT16 rgb); + inline uint8_t expand_rgb5_to_rgb8(uint8_t val); + inline uint8_t mix_channel(uint8_t a, uint8_t b); + void mix_pixel(uint32_t offset, uint16_t rgb); + void set_pixel(uint32_t offset, uint16_t rgb); }; enum @@ -220,68 +220,68 @@ void vii_state::video_start() { } -inline UINT8 vii_state::expand_rgb5_to_rgb8(UINT8 val) +inline uint8_t vii_state::expand_rgb5_to_rgb8(uint8_t val) { - UINT8 temp = val & 0x1f; + uint8_t temp = val & 0x1f; return (temp << 3) | (temp >> 2); } // Perform a lerp between a and b -inline UINT8 vii_state::mix_channel(UINT8 a, UINT8 b) +inline uint8_t vii_state::mix_channel(uint8_t a, uint8_t b) { - UINT8 alpha = m_video_regs[0x1c] & 0x00ff; + uint8_t alpha = m_video_regs[0x1c] & 0x00ff; return ((64 - alpha) * a + alpha * b) / 64; } -void vii_state::mix_pixel(UINT32 offset, UINT16 rgb) +void vii_state::mix_pixel(uint32_t offset, uint16_t rgb) { m_screenram[offset].r = mix_channel(m_screenram[offset].r, expand_rgb5_to_rgb8(rgb >> 10)); m_screenram[offset].g = mix_channel(m_screenram[offset].g, expand_rgb5_to_rgb8(rgb >> 5)); m_screenram[offset].b = mix_channel(m_screenram[offset].b, expand_rgb5_to_rgb8(rgb)); } -void vii_state::set_pixel(UINT32 offset, UINT16 rgb) +void vii_state::set_pixel(uint32_t offset, uint16_t rgb) { m_screenram[offset].r = expand_rgb5_to_rgb8(rgb >> 10); m_screenram[offset].g = expand_rgb5_to_rgb8(rgb >> 5); m_screenram[offset].b = expand_rgb5_to_rgb8(rgb); } -void vii_state::blit(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 xoff, UINT32 yoff, UINT32 attr, UINT32 ctrl, UINT32 bitmap_addr, UINT16 tile) +void vii_state::blit(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t xoff, uint32_t yoff, uint32_t attr, uint32_t ctrl, uint32_t bitmap_addr, uint16_t tile) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT32 h = 8 << ((attr & PAGE_TILE_HEIGHT_MASK) >> PAGE_TILE_HEIGHT_SHIFT); - UINT32 w = 8 << ((attr & PAGE_TILE_WIDTH_MASK) >> PAGE_TILE_WIDTH_SHIFT); + uint32_t h = 8 << ((attr & PAGE_TILE_HEIGHT_MASK) >> PAGE_TILE_HEIGHT_SHIFT); + uint32_t w = 8 << ((attr & PAGE_TILE_WIDTH_MASK) >> PAGE_TILE_WIDTH_SHIFT); - UINT32 yflipmask = attr & TILE_Y_FLIP ? h - 1 : 0; - UINT32 xflipmask = attr & TILE_X_FLIP ? w - 1 : 0; + uint32_t yflipmask = attr & TILE_Y_FLIP ? h - 1 : 0; + uint32_t xflipmask = attr & TILE_X_FLIP ? w - 1 : 0; - UINT32 nc = ((attr & 0x0003) + 1) << 1; + uint32_t nc = ((attr & 0x0003) + 1) << 1; - UINT32 palette_offset = (attr & 0x0f00) >> 4; + uint32_t palette_offset = (attr & 0x0f00) >> 4; palette_offset >>= nc; palette_offset <<= nc; - UINT32 m = bitmap_addr + nc*w*h/16*tile; - UINT32 bits = 0; - UINT32 nbits = 0; + uint32_t m = bitmap_addr + nc*w*h/16*tile; + uint32_t bits = 0; + uint32_t nbits = 0; - UINT32 x, y; + uint32_t x, y; for(y = 0; y < h; y++) { - UINT32 yy = (yoff + (y ^ yflipmask)) & 0x1ff; + uint32_t yy = (yoff + (y ^ yflipmask)) & 0x1ff; for(x = 0; x < w; x++) { - UINT32 xx = (xoff + (x ^ xflipmask)) & 0x1ff; - UINT32 pal; + uint32_t xx = (xoff + (x ^ xflipmask)) & 0x1ff; + uint32_t pal; bits <<= nc; if(nbits < nc) { - UINT16 b = space.read_word((m++ & 0x3fffff) << 1); + uint16_t b = space.read_word((m++ & 0x3fffff) << 1); b = (b << 8) | (b >> 8); bits |= b << (nc - nbits); nbits += 16; @@ -293,12 +293,12 @@ void vii_state::blit(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 xof if((ctrl & 0x0010) && yy < 240) { - xx = (xx - (INT16)m_p_rowscroll[yy]) & 0x01ff; + xx = (xx - (int16_t)m_p_rowscroll[yy]) & 0x01ff; } if(xx < 320 && yy < 240) { - UINT16 rgb = m_p_palette[pal]; + uint16_t rgb = m_p_palette[pal]; if(!(rgb & 0x8000)) { if (attr & 0x4000) @@ -315,16 +315,16 @@ void vii_state::blit(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 xof } } -void vii_state::blit_page(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, UINT32 bitmap_addr, UINT16 *regs) +void vii_state::blit_page(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, uint32_t bitmap_addr, uint16_t *regs) { - UINT32 x0, y0; - UINT32 xscroll = regs[0]; - UINT32 yscroll = regs[1]; - UINT32 attr = regs[2]; - UINT32 ctrl = regs[3]; - UINT32 tilemap = regs[4]; - UINT32 palette_map = regs[5]; - UINT32 h, w, hn, wn; + uint32_t x0, y0; + uint32_t xscroll = regs[0]; + uint32_t yscroll = regs[1]; + uint32_t attr = regs[2]; + uint32_t ctrl = regs[3]; + uint32_t tilemap = regs[4]; + uint32_t palette_map = regs[5]; + uint32_t h, w, hn, wn; address_space &space = m_maincpu->space(AS_PROGRAM); if(!(ctrl & PAGE_ENABLE_MASK)) @@ -347,9 +347,9 @@ void vii_state::blit_page(bitmap_rgb32 &bitmap, const rectangle &cliprect, int d { for(x0 = 0; x0 < wn; x0++) { - UINT16 tile = space.read_word((tilemap + x0 + wn * y0) << 1); - UINT16 palette = 0; - UINT32 xx, yy; + uint16_t tile = space.read_word((tilemap + x0 + wn * y0) << 1); + uint16_t palette = 0; + uint32_t xx, yy; if(!tile) { @@ -362,8 +362,8 @@ void vii_state::blit_page(bitmap_rgb32 &bitmap, const rectangle &cliprect, int d palette >>= 8; } - UINT32 tileattr = attr; - UINT32 tilectrl = ctrl; + uint32_t tileattr = attr; + uint32_t tilectrl = ctrl; if ((ctrl & 2) == 0) { // -(1) bld(1) flip(2) pal(4) tileattr &= ~0x000c; @@ -384,13 +384,13 @@ void vii_state::blit_page(bitmap_rgb32 &bitmap, const rectangle &cliprect, int d } } -void vii_state::blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, UINT32 base_addr) +void vii_state::blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, uint32_t base_addr) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT16 tile, attr; - INT16 x, y; - UINT32 h, w; - UINT32 bitmap_addr = 0x40 * m_video_regs[0x22]; + uint16_t tile, attr; + int16_t x, y; + uint32_t h, w; + uint32_t bitmap_addr = 0x40 * m_video_regs[0x22]; tile = space.read_word((base_addr + 0) << 1); x = space.read_word((base_addr + 1) << 1); @@ -427,7 +427,7 @@ void vii_state::blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, int void vii_state::blit_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth) { - UINT32 n; + uint32_t n; if (!(m_video_regs[0x42] & 1)) { @@ -443,7 +443,7 @@ void vii_state::blit_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, in } } -UINT32 vii_state::screen_update_vii(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t vii_state::screen_update_vii(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int i, x, y; @@ -473,12 +473,12 @@ UINT32 vii_state::screen_update_vii(screen_device &screen, bitmap_rgb32 &bitmap, * Machine Hardware * *************************/ -void vii_state::do_dma(UINT32 len) +void vii_state::do_dma(uint32_t len) { address_space &mem = m_maincpu->space(AS_PROGRAM); - UINT32 src = m_video_regs[0x70]; - UINT32 dst = m_video_regs[0x71] + 0x2c00; - UINT32 j; + uint32_t src = m_video_regs[0x70]; + uint32_t dst = m_video_regs[0x71] + 0x2c00; + uint32_t j; for(j = 0; j < len; j++) { @@ -583,7 +583,7 @@ WRITE16_MEMBER( vii_state::audio_w ) } } -void vii_state::switch_bank(UINT32 bank) +void vii_state::switch_bank(uint32_t bank) { if (bank != m_current_bank) { @@ -592,17 +592,17 @@ void vii_state::switch_bank(UINT32 bank) } } -void vii_state::do_gpio(UINT32 offset) +void vii_state::do_gpio(uint32_t offset) { - UINT32 index = (offset - 1) / 5; - UINT16 buffer = m_io_regs[5*index + 2]; - UINT16 dir = m_io_regs[5*index + 3]; - UINT16 attr = m_io_regs[5*index + 4]; - UINT16 special= m_io_regs[5*index + 5]; - - UINT16 push = dir; - UINT16 pull = (~dir) & (~attr); - UINT16 what = (buffer & (push | pull)); + uint32_t index = (offset - 1) / 5; + uint16_t buffer = m_io_regs[5*index + 2]; + uint16_t dir = m_io_regs[5*index + 3]; + uint16_t attr = m_io_regs[5*index + 4]; + uint16_t special= m_io_regs[5*index + 5]; + + uint16_t push = dir; + uint16_t pull = (~dir) & (~attr); + uint16_t what = (buffer & (push | pull)); what ^= (dir & ~attr); what &= ~special; @@ -610,7 +610,7 @@ void vii_state::do_gpio(UINT32 offset) { if(index == 1) { - UINT32 bank = ((what & 0x80) >> 7) | ((what & 0x20) >> 4); + uint32_t bank = ((what & 0x80) >> 7) | ((what & 0x20) >> 4); switch_bank(bank); } } @@ -618,7 +618,7 @@ void vii_state::do_gpio(UINT32 offset) { if(index == 0) { - UINT16 temp = m_io_p1->read(); + uint16_t temp = m_io_p1->read(); what |= (temp & 0x0001) ? 0x8000 : 0; what |= (temp & 0x0002) ? 0x4000 : 0; what |= (temp & 0x0004) ? 0x2000 : 0; @@ -645,13 +645,13 @@ void vii_state::do_i2c() { } -void vii_state::spg_do_dma(UINT32 len) +void vii_state::spg_do_dma(uint32_t len) { address_space &mem = m_maincpu->space(AS_PROGRAM); - UINT32 src = ((m_io_regs[0x101] & 0x3f) << 16) | m_io_regs[0x100]; - UINT32 dst = m_io_regs[0x103] & 0x3fff; - UINT32 j; + uint32_t src = ((m_io_regs[0x101] & 0x3f) << 16) | m_io_regs[0x100]; + uint32_t dst = m_io_regs[0x103] & 0x3fff; + uint32_t j; for(j = 0; j < len; j++) mem.write_word((dst+j) << 1, mem.read_word((src+j) << 1)); @@ -664,7 +664,7 @@ READ16_MEMBER( vii_state::io_r ) static const char *const gpioregs[] = { "GPIO Data Port", "GPIO Buffer Port", "GPIO Direction Port", "GPIO Attribute Port", "GPIO IRQ/Latch Port" }; static const char gpioports[] = { 'A', 'B', 'C' }; - UINT16 val = m_io_regs[offset]; + uint16_t val = m_io_regs[offset]; switch(offset) { @@ -735,7 +735,7 @@ WRITE16_MEMBER( vii_state::io_w ) static const char *const gpioregs[] = { "GPIO Data Port", "GPIO Buffer Port", "GPIO Direction Port", "GPIO Attribute Port", "GPIO IRQ/Latch Port" }; static const char gpioports[3] = { 'A', 'B', 'C' }; - UINT16 temp = 0; + uint16_t temp = 0; switch(offset) { @@ -758,12 +758,12 @@ WRITE16_MEMBER( vii_state::io_w ) case 0x10: // timebase control if ((m_io_regs[offset] & 0x0003) != (data & 0x0003)) { - UINT16 hz = 8 << (data & 0x0003); + uint16_t hz = 8 << (data & 0x0003); verboselog(3, "*** TMB1 FREQ set to %dHz\n", hz); m_tmb1->adjust(attotime::zero, 0, attotime::from_hz( hz )); } if ((m_io_regs[offset] & 0x000c) != (data & 0x000c)) { - UINT16 hz = 128 << ((data & 0x000c) >> 2); + uint16_t hz = 128 << ((data & 0x000c) >> 2); verboselog(3, "*** TMB2 FREQ set to %dHz\n", hz); m_tmb2->adjust(attotime::zero, 0, attotime::from_hz( hz )); } @@ -950,7 +950,7 @@ static INPUT_PORTS_START( walle ) INPUT_PORTS_END -void vii_state::test_centered(UINT8 *ROM) +void vii_state::test_centered(uint8_t *ROM) { if (ROM[0x3cd808] == 0x99 && ROM[0x3cd809] == 0x99 && @@ -967,7 +967,7 @@ void vii_state::test_centered(UINT8 *ROM) DEVICE_IMAGE_LOAD_MEMBER( vii_state, vii_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); if (size < 0x800000) { @@ -985,7 +985,7 @@ DEVICE_IMAGE_LOAD_MEMBER( vii_state, vii_cart ) DEVICE_IMAGE_LOAD_MEMBER( vii_state, vsmile_cart ) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); m_cart->rom_alloc(size, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE); m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); @@ -1006,8 +1006,8 @@ TIMER_CALLBACK_MEMBER(vii_state::tmb2_tick) void vii_state::machine_start() { - memset(m_video_regs, 0, 0x100 * sizeof(UINT16)); - memset(m_io_regs, 0, 0x100 * sizeof(UINT16)); + memset(m_video_regs, 0, 0x100 * sizeof(uint16_t)); + memset(m_io_regs, 0, 0x100 * sizeof(uint16_t)); m_current_bank = 0; m_controller_input[0] = 0; @@ -1048,15 +1048,15 @@ void vii_state::machine_reset() INTERRUPT_GEN_MEMBER(vii_state::vii_vblank) { - UINT32 x = machine().rand() & 0x3ff; - UINT32 y = machine().rand() & 0x3ff; - UINT32 z = machine().rand() & 0x3ff; + uint32_t x = machine().rand() & 0x3ff; + uint32_t y = machine().rand() & 0x3ff; + uint32_t z = machine().rand() & 0x3ff; m_controller_input[0] = m_io_p1->read(); - m_controller_input[1] = (UINT8)x; - m_controller_input[2] = (UINT8)y; - m_controller_input[3] = (UINT8)z; + m_controller_input[1] = (uint8_t)x; + m_controller_input[2] = (uint8_t)y; + m_controller_input[3] = (uint8_t)z; m_controller_input[4] = 0; x >>= 8; y >>= 8; diff --git a/src/mame/drivers/vip.cpp b/src/mame/drivers/vip.cpp index 2ccab30464c..77113d34aa1 100644 --- a/src/mame/drivers/vip.cpp +++ b/src/mame/drivers/vip.cpp @@ -266,7 +266,7 @@ READ8_MEMBER( vip_state::read ) int cdef = !((offset >= 0xc00) && (offset < 0x1000)); int minh = 0; - UINT8 data = m_exp->program_r(space, offset, cs, cdef, &minh); + uint8_t data = m_exp->program_r(space, offset, cs, cdef, &minh); if (cs) { @@ -306,7 +306,7 @@ WRITE8_MEMBER( vip_state::write ) READ8_MEMBER( vip_state::io_r ) { - UINT8 data = m_exp->io_r(space, offset); + uint8_t data = m_exp->io_r(space, offset); switch (offset) { @@ -530,7 +530,7 @@ WRITE_LINE_MEMBER( vip_state::vdc_ef1_w ) m_vdc_ef1 = state; } -UINT32 vip_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t vip_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_vdc->screen_update(screen, bitmap, cliprect); @@ -608,10 +608,10 @@ WRITE_LINE_MEMBER( vip_state::exp_dma_in_w ) void vip_state::machine_start() { - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); // randomize RAM contents - for (UINT16 addr = 0; addr < m_ram->size(); addr++) + for (uint16_t addr = 0; addr < m_ram->size(); addr++) { ram[addr] = machine().rand() & 0xff; } @@ -662,8 +662,8 @@ void vip_state::machine_reset() QUICKLOAD_LOAD_MEMBER( vip_state, vip ) { - UINT8 *ram = m_ram->pointer(); - UINT8 *chip8_ptr = nullptr; + uint8_t *ram = m_ram->pointer(); + uint8_t *chip8_ptr = nullptr; int chip8_size = 0; int size = image.length(); diff --git a/src/mame/drivers/viper.cpp b/src/mame/drivers/viper.cpp index 66af4e6d086..d7e8abfeaed 100644 --- a/src/mame/drivers/viper.cpp +++ b/src/mame/drivers/viper.cpp @@ -381,15 +381,15 @@ public: { } - UINT32 m_epic_iack; + uint32_t m_epic_iack; int m_cf_card_ide; int m_unk1_bit; - UINT32 m_voodoo3_pci_reg[0x100]; + uint32_t m_voodoo3_pci_reg[0x100]; int m_unk_serial_bit_w; - UINT16 m_unk_serial_cmd; - UINT16 m_unk_serial_data; - UINT16 m_unk_serial_data_r; - UINT8 m_unk_serial_regs[0x80]; + uint16_t m_unk_serial_cmd; + uint16_t m_unk_serial_data; + uint16_t m_unk_serial_data_r; + uint8_t m_unk_serial_regs[0x80]; DECLARE_READ32_MEMBER(epic_r); DECLARE_WRITE32_MEMBER(epic_w); @@ -426,12 +426,12 @@ public: DECLARE_DRIVER_INIT(viperhd); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_viper(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_viper(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(viper_vblank); TIMER_CALLBACK_MEMBER(epic_global_timer_callback); TIMER_CALLBACK_MEMBER(ds2430_timer_callback); #if VIPER_DEBUG_EPIC_REGS - const char* epic_get_register_name(UINT32 reg); + const char* epic_get_register_name(uint32_t reg); #endif void epic_update_interrupts(); void mpc8240_interrupt(int irq); @@ -442,30 +442,30 @@ public: required_device m_maincpu; required_device m_ata; required_device m_voodoo; - required_shared_ptr m_workram; + required_shared_ptr m_workram; }; -UINT32 viper_state::screen_update_viper(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t viper_state::screen_update_viper(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { voodoo_device *voodoo = (voodoo_device*)machine().device("voodoo"); return voodoo->voodoo_update(bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } -UINT32 m_mpc8240_regs[256/4]; +uint32_t m_mpc8240_regs[256/4]; #ifdef UNUSED_FUNCTION -static inline UINT64 read64le_with_32le_device_handler(read32_delegate handler, address_space &space, offs_t offset, UINT64 mem_mask) +static inline uint64_t read64le_with_32le_device_handler(read32_delegate handler, address_space &space, offs_t offset, uint64_t mem_mask) { - UINT64 result = 0; + uint64_t result = 0; if (ACCESSING_BITS_0_31) - result |= (UINT64)(handler)(space, offset * 2 + 0, mem_mask >> 0) << 0; + result |= (uint64_t)(handler)(space, offset * 2 + 0, mem_mask >> 0) << 0; if (ACCESSING_BITS_32_63) - result |= (UINT64)(handler)(space, offset * 2 + 1, mem_mask >> 32) << 32; + result |= (uint64_t)(handler)(space, offset * 2 + 1, mem_mask >> 32) << 32; return result; } -static inline void write64le_with_32le_device_handler(write32_delegate handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask) +static inline void write64le_with_32le_device_handler(write32_delegate handler, address_space &space, offs_t offset, uint64_t data, uint64_t mem_mask) { if (ACCESSING_BITS_0_31) handler(space, offset * 2 + 0, data >> 0, mem_mask >> 0); @@ -474,19 +474,19 @@ static inline void write64le_with_32le_device_handler(write32_delegate handler, } #endif -static inline UINT64 read64be_with_32le_device_handler(read32_delegate handler, address_space &space, offs_t offset, UINT64 mem_mask) +static inline uint64_t read64be_with_32le_device_handler(read32_delegate handler, address_space &space, offs_t offset, uint64_t mem_mask) { mem_mask = flipendian_int64(mem_mask); - UINT64 result = 0; + uint64_t result = 0; if (ACCESSING_BITS_0_31) - result = (UINT64)(handler)(space, offset * 2, mem_mask & 0xffffffff); + result = (uint64_t)(handler)(space, offset * 2, mem_mask & 0xffffffff); if (ACCESSING_BITS_32_63) - result |= (UINT64)(handler)(space, offset * 2 + 1, mem_mask >> 32) << 32; + result |= (uint64_t)(handler)(space, offset * 2 + 1, mem_mask >> 32) << 32; return flipendian_int64(result); } -static inline void write64be_with_32le_device_handler(write32_delegate handler, address_space &space, offs_t offset, UINT64 data, UINT64 mem_mask) +static inline void write64be_with_32le_device_handler(write32_delegate handler, address_space &space, offs_t offset, uint64_t data, uint64_t mem_mask) { data = flipendian_int64(data); mem_mask = flipendian_int64(mem_mask); @@ -498,7 +498,7 @@ static inline void write64be_with_32le_device_handler(write32_delegate handler, /*****************************************************************************/ -static UINT32 mpc8240_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t mpc8240_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { // device is null? // viper_state *state = device->machine().driver_data(); @@ -513,7 +513,7 @@ static UINT32 mpc8240_pci_r(device_t *busdevice, device_t *device, int function, //return state->m_mpc8240_regs[reg/4]; } -static void mpc8240_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void mpc8240_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { // device is null? // viper_state *state = device->machine().driver_data(); @@ -587,7 +587,7 @@ WRITE64_MEMBER(viper_state::pci_config_data_w) struct MPC8240_IRQ { - UINT32 vector; + uint32_t vector; int priority; int destination; int active; @@ -597,7 +597,7 @@ struct MPC8240_IRQ struct MPC8240_GLOBAL_TIMER { - UINT32 base_count; + uint32_t base_count; int enable; emu_timer *timer; }; @@ -606,18 +606,18 @@ struct MPC8240_GLOBAL_TIMER struct MPC8240_EPIC { - UINT32 iack; - UINT32 eicr; - UINT32 svr; + uint32_t iack; + uint32_t eicr; + uint32_t svr; int active_irq; MPC8240_IRQ irq[MPC8240_NUM_INTERRUPTS]; - UINT8 i2c_adr; + uint8_t i2c_adr; int i2c_freq_div, i2c_freq_sample_rate; - UINT8 i2c_cr; - UINT8 i2c_sr; + uint8_t i2c_cr; + uint8_t i2c_sr; int i2c_state; MPC8240_GLOBAL_TIMER global_timer[4]; @@ -628,7 +628,7 @@ struct MPC8240_EPIC static MPC8240_EPIC epic; #if VIPER_DEBUG_EPIC_REGS -const char* viper_state::epic_get_register_name(UINT32 reg) +const char* viper_state::epic_get_register_name(uint32_t reg) { switch (reg >> 16) { @@ -835,7 +835,7 @@ READ32_MEMBER(viper_state::epic_r) } #endif - UINT32 ret = 0; + uint32_t ret = 0; switch (reg >> 16) { @@ -1336,7 +1336,7 @@ void viper_state::mpc8240_epic_reset(void) /*****************************************************************************/ -static const UINT8 cf_card_tuples[] = +static const uint8_t cf_card_tuples[] = { 0x01, // Device Tuple 0x01, // Tuple size @@ -1351,7 +1351,7 @@ static const UINT8 cf_card_tuples[] = READ64_MEMBER(viper_state::cf_card_data_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_16_31) { @@ -1386,7 +1386,7 @@ WRITE64_MEMBER(viper_state::cf_card_data_w) default: { - fatalerror("%s:cf_card_data_w: IDE reg %02X, %04X\n", machine().describe_context(), offset & 0xf, (UINT16)(data >> 16)); + fatalerror("%s:cf_card_data_w: IDE reg %02X, %04X\n", machine().describe_context(), offset & 0xf, (uint16_t)(data >> 16)); } } } @@ -1394,7 +1394,7 @@ WRITE64_MEMBER(viper_state::cf_card_data_w) READ64_MEMBER(viper_state::cf_card_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_16_31) { @@ -1458,7 +1458,7 @@ READ64_MEMBER(viper_state::cf_card_r) WRITE64_MEMBER(viper_state::cf_card_w) { #ifdef VIPER_DEBUG_LOG - //printf("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", machine().describe_context(), (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask)); + //printf("%s:compact_flash_w: %08X%08X, %08X, %08X%08X\n", machine().describe_context(), (uint32_t)(data>>32), (uint32_t)(data), offset, (uint32_t)(mem_mask >> 32), (uint32_t)(mem_mask)); #endif if (ACCESSING_BITS_16_31) @@ -1497,7 +1497,7 @@ WRITE64_MEMBER(viper_state::cf_card_w) default: { - fatalerror("%s:compact_flash_w: IDE reg %02X, data %04X\n", machine().describe_context(), offset & 0xf, (UINT16)((data >> 16) & 0xffff)); + fatalerror("%s:compact_flash_w: IDE reg %02X, data %04X\n", machine().describe_context(), offset & 0xf, (uint16_t)((data >> 16) & 0xffff)); } } } @@ -1517,7 +1517,7 @@ WRITE64_MEMBER(viper_state::cf_card_w) } default: { - fatalerror("%s:compact_flash_w: reg %02X, data %04X\n", machine().describe_context(), offset, (UINT16)((data >> 16) & 0xffff)); + fatalerror("%s:compact_flash_w: reg %02X, data %04X\n", machine().describe_context(), offset, (uint16_t)((data >> 16) & 0xffff)); } } } @@ -1537,7 +1537,7 @@ WRITE64_MEMBER(viper_state::unk2_w) READ64_MEMBER(viper_state::ata_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_16_31) { @@ -1575,7 +1575,7 @@ WRITE64_MEMBER(viper_state::ata_w) } } -static UINT32 voodoo3_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t voodoo3_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { viper_state *state = device->machine().driver_data(); @@ -1615,7 +1615,7 @@ static UINT32 voodoo3_pci_r(device_t *busdevice, device_t *device, int function, } } -static void voodoo3_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void voodoo3_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { viper_state *state = device->machine().driver_data(); @@ -1690,7 +1690,7 @@ READ64_MEMBER(viper_state::voodoo3_io_r) } WRITE64_MEMBER(viper_state::voodoo3_io_w) { -// printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, space.device().safe_pc()); +// printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (uint32_t)(data >> 32), (uint32_t)(data), offset, space.device().safe_pc()); write64be_with_32le_device_handler(write32_delegate(FUNC(voodoo_3_device::banshee_io_w), &(*m_voodoo)), space, offset, data, mem_mask); } @@ -1701,7 +1701,7 @@ READ64_MEMBER(viper_state::voodoo3_r) } WRITE64_MEMBER(viper_state::voodoo3_w) { -// printf("voodoo3_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, space.device().safe_pc()); +// printf("voodoo3_w: %08X%08X, %08X at %08X\n", (uint32_t)(data >> 32), (uint32_t)(data), offset, space.device().safe_pc()); write64be_with_32le_device_handler(write32_delegate(FUNC(voodoo_3_device::banshee_w), &(*m_voodoo)), space, offset, data, mem_mask); } @@ -1712,7 +1712,7 @@ READ64_MEMBER(viper_state::voodoo3_lfb_r) } WRITE64_MEMBER(viper_state::voodoo3_lfb_w) { -// printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, space.device().safe_pc()); +// printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (uint32_t)(data >> 32), (uint32_t)(data), offset, space.device().safe_pc()); write64be_with_32le_device_handler(write32_delegate(FUNC(voodoo_3_device::banshee_fb_w), &(*m_voodoo)), space, offset, data, mem_mask); } @@ -1727,13 +1727,13 @@ WRITE64_MEMBER(viper_state::voodoo3_lfb_w) #define DS2430_STATE_READ_MEM_ADDRESS 6 static int unk1_bit = 1; -static UINT8 ds2430_data; +static uint8_t ds2430_data; static int ds2430_data_count = 0; static int ds2430_reset = 0; static int ds2430_state; -static UINT8 ds2430_cmd; -static UINT8 *ds2430_rom; -static UINT8 ds2430_addr; +static uint8_t ds2430_cmd; +static uint8_t *ds2430_rom; +static uint8_t ds2430_addr; TIMER_CALLBACK_MEMBER(viper_state::ds2430_timer_callback) @@ -1755,14 +1755,14 @@ TIMER_CALLBACK_MEMBER(viper_state::ds2430_timer_callback) READ64_MEMBER(viper_state::unk1_r) { - UINT64 r = 0; + uint64_t r = 0; //return 0;//U64(0x0000400000000000); r |= U64(0xffff00000000ffff); if (ACCESSING_BITS_40_47) { - UINT64 reg = 0; + uint64_t reg = 0; reg |= (unk1_bit << 5); reg |= 0x40; // if this bit is 0, loads a disk copier instead //r |= 0x04; // screen flip @@ -1770,7 +1770,7 @@ READ64_MEMBER(viper_state::unk1_r) r |= reg << 40; - //r |= (UINT64)(unk1_bit << 5) << 40; + //r |= (uint64_t)(unk1_bit << 5) << 40; //r |= U64(0x0000400000000000); //r |= U64(0x0000040000000000); // screen flip @@ -1778,17 +1778,17 @@ READ64_MEMBER(viper_state::unk1_r) } if (ACCESSING_BITS_32_39) { - UINT64 reg = ioport("IN0")->read(); + uint64_t reg = ioport("IN0")->read(); r |= reg << 32; } if (ACCESSING_BITS_24_31) { - UINT64 reg = ioport("IN1")->read(); + uint64_t reg = ioport("IN1")->read(); r |= reg << 24; } if (ACCESSING_BITS_16_23) { - UINT64 reg = 0; + uint64_t reg = 0; //reg |= 0x80; // memory card check for boxingm //reg |= 0x40; // memory card check for tsurugi reg |= 0x3f; @@ -1908,7 +1908,7 @@ READ64_MEMBER(viper_state::e70000_r) ds2430_bit_timer->reset(); ds2430_bit_timer->start_time(); -// printf("e70000_r: %08X (mask %08X%08X) at %08X\n", offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu->safe_pc()); +// printf("e70000_r: %08X (mask %08X%08X) at %08X\n", offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask, cpu->safe_pc()); } return 0; @@ -1923,7 +1923,7 @@ WRITE64_MEMBER(viper_state::e70000_w) ds2430_timer->adjust(attotime::from_usec(40), 1); // presence pulse for 240 microsecs unk1_bit = 1; -// printf("e70000_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (UINT32)(data >> 32), (UINT32)data, offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, space.device().safe_pc()); +// printf("e70000_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (uint32_t)(data >> 32), (uint32_t)data, offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask, space.device().safe_pc()); } else { @@ -1948,7 +1948,7 @@ WRITE64_MEMBER(viper_state::unk1a_w) { if (ACCESSING_BITS_56_63) { - // printf("unk1a_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (UINT32)(data >> 32), (UINT32)data, offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu->safe_pc()); + // printf("unk1a_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (uint32_t)(data >> 32), (uint32_t)data, offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask, cpu->safe_pc()); } } @@ -1957,15 +1957,15 @@ WRITE64_MEMBER(viper_state::unk1b_w) if (ACCESSING_BITS_56_63) { unk1_bit = 0; - // printf("unk1b_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (UINT32)(data >> 32), (UINT32)data, offset, (UINT32)(mem_mask >> 32), (UINT32)mem_mask, cpu->safe_pc()); + // printf("unk1b_w: %08X%08X, %08X (mask %08X%08X) at %08X\n", (uint32_t)(data >> 32), (uint32_t)data, offset, (uint32_t)(mem_mask >> 32), (uint32_t)mem_mask, cpu->safe_pc()); } } -static UINT64 e00008_data; +static uint64_t e00008_data; READ64_MEMBER(viper_state::e00008_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_0_7) { r |= e00008_data; @@ -1984,13 +1984,13 @@ WRITE64_MEMBER(viper_state::e00008_w) READ64_MEMBER(viper_state::e00000_r) { - UINT64 r = 0;//U64(0xffffffffffffffff); + uint64_t r = 0;//U64(0xffffffffffffffff); return r; } READ64_MEMBER(viper_state::unk_serial_r) { - UINT64 r = 0; + uint64_t r = 0; if (ACCESSING_BITS_16_31) { int bit = m_unk_serial_data_r & 0x1; @@ -2026,7 +2026,7 @@ WRITE64_MEMBER(viper_state::unk_serial_w) if ((m_unk_serial_cmd & 0x80) == 0) // register read { int reg = m_unk_serial_cmd & 0x7f; - UINT8 data = m_unk_serial_regs[reg]; + uint8_t data = m_unk_serial_regs[reg]; m_unk_serial_data_r = ((data & 0x1) << 7) | ((data & 0x2) << 5) | ((data & 0x4) << 3) | ((data & 0x8) << 1) | ((data & 0x10) >> 1) | ((data & 0x20) >> 3) | ((data & 0x40) >> 5) | ((data & 0x80) >> 7); @@ -2156,7 +2156,7 @@ void viper_state::machine_start() /* configure fast RAM regions for DRC */ m_maincpu->ppcdrc_add_fastram(0x00000000, 0x00ffffff, FALSE, m_workram); - ds2430_rom = (UINT8*)memregion("ds2430")->base(); + ds2430_rom = (uint8_t*)memregion("ds2430")->base(); } void viper_state::machine_reset() @@ -2164,7 +2164,7 @@ void viper_state::machine_reset() mpc8240_epic_reset(); ide_hdd_device *hdd = m_ata->subdevice("0")->subdevice("hdd"); - UINT16 *identify_device = hdd->identify_device_buffer(); + uint16_t *identify_device = hdd->identify_device_buffer(); // Viper expects these settings or the BIOS fails identify_device[51] = 0x0200; /* 51: PIO data transfer cycle timing mode */ diff --git a/src/mame/drivers/vis.cpp b/src/mame/drivers/vis.cpp index 1f5c3c77f7b..ae114068b95 100644 --- a/src/mame/drivers/vis.cpp +++ b/src/mame/drivers/vis.cpp @@ -13,24 +13,24 @@ class vis_audio_device : public device_t, public device_isa16_card_interface { public: - vis_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vis_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(pcm_r); DECLARE_WRITE8_MEMBER(pcm_w); 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 dack16_w(int line, UINT16 data) override { if(m_samples < 2) m_sample[m_samples++] = data; else m_isa->drq7_w(CLEAR_LINE); } + virtual void dack16_w(int line, uint16_t data) override { if(m_samples < 2) m_sample[m_samples++] = data; else m_isa->drq7_w(CLEAR_LINE); } virtual machine_config_constructor device_mconfig_additions() const override; private: required_device m_rdac; required_device m_ldac; - UINT16 m_count; - UINT16 m_sample[2]; - UINT8 m_index[2]; // unknown indexed registers, volume? - UINT8 m_data[2][16]; - UINT8 m_mode; - UINT8 m_stat; + uint16_t m_count; + uint16_t m_sample[2]; + uint8_t m_index[2]; // unknown indexed registers, volume? + uint8_t m_data[2][16]; + uint8_t m_mode; + uint8_t m_stat; unsigned int m_sample_byte; unsigned int m_samples; emu_timer *m_pcm; @@ -38,7 +38,7 @@ private: const device_type VIS_AUDIO = &device_creator; -vis_audio_device::vis_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vis_audio_device::vis_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VIS_AUDIO, "vis_pcm", tag, owner, clock, "vis_pcm", __FILE__), device_isa16_card_interface(mconfig, *this), m_rdac(*this, "rdac"), @@ -72,7 +72,7 @@ void vis_audio_device::device_timer(emu_timer &timer, device_timer_id id, int pa { case 0x80: // 8bit mono { - UINT8 sample = m_sample[m_sample_byte >> 1] >> ((m_sample_byte & 1) * 8); + uint8_t sample = m_sample[m_sample_byte >> 1] >> ((m_sample_byte & 1) * 8); m_ldac->write(sample << 8); m_rdac->write(sample << 8); m_sample_byte++; @@ -223,12 +223,12 @@ public: protected: void machine_reset() override; private: - UINT8 m_sysctl; - UINT8 m_unkidx; - UINT8 m_unk[16]; - UINT8 m_pad[4]; - UINT8 m_crtcidx; - UINT8 m_gfxidx; + uint8_t m_sysctl; + uint8_t m_unkidx; + uint8_t m_unk[16]; + uint8_t m_pad[4]; + uint8_t m_crtcidx; + uint8_t m_gfxidx; }; void vis_state::machine_reset() diff --git a/src/mame/drivers/vixen.cpp b/src/mame/drivers/vixen.cpp index d600fa0100b..116ea175f5e 100644 --- a/src/mame/drivers/vixen.cpp +++ b/src/mame/drivers/vixen.cpp @@ -79,7 +79,7 @@ READ8_MEMBER( vixen_state::opram_r ) membank("bank3")->set_entry(0); // read videoram bool const prev_debugger_access(m_program->debugger_access()); m_program->set_debugger_access(space.debugger_access()); - UINT8 const data(m_program->read_byte(offset)); + uint8_t const data(m_program->read_byte(offset)); m_program->set_debugger_access(prev_debugger_access); return data; } @@ -112,7 +112,7 @@ READ8_MEMBER( vixen_state::status_r ) */ - UINT8 data = 0xf8; + uint8_t data = 0xf8; // vertical sync interrupt enable data |= m_cmd_d0; @@ -187,7 +187,7 @@ READ8_MEMBER( vixen_state::ieee488_r ) */ - UINT8 data = 0; + uint8_t data = 0; /* attention */ data |= m_ieee488->atn_r(); @@ -238,7 +238,7 @@ READ8_MEMBER( vixen_state::port3_r ) */ - UINT8 data = 0xfc; + uint8_t data = 0xfc; // ring indicator data |= m_rs232->ri_r(); @@ -420,10 +420,10 @@ void vixen_state::video_start() // SCREEN_UPDATE( vixen ) //------------------------------------------------- -UINT32 vixen_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t vixen_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const pen_t *pen = m_palette->pens(); - UINT8 x, y, chr, gfx, inv, ra; + uint8_t x, y, chr, gfx, inv, ra; for (y = 0; y < 26; y++) { @@ -431,8 +431,8 @@ UINT32 vixen_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c { for (x = 0; x < 128; x++) { - UINT16 sync_addr = ((y+1) << 7) + x + 1; // it's out by a row and a column - UINT8 sync_data = m_sync_rom[sync_addr & 0xfff]; + uint16_t sync_addr = ((y+1) << 7) + x + 1; // it's out by a row and a column + uint8_t sync_data = m_sync_rom[sync_addr & 0xfff]; bool blank = BIT(sync_data, 4); /* int clrchadr = BIT(sync_data, 7); @@ -501,7 +501,7 @@ DISCRETE_SOUND_END READ8_MEMBER( vixen_state::i8155_pa_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; for (int i = 0; i < 8; i++) if (!BIT(m_col, i)) data &= m_key[i]->read(); diff --git a/src/mame/drivers/vk100.cpp b/src/mame/drivers/vk100.cpp index a432e4ea96e..715681f7bba 100644 --- a/src/mame/drivers/vk100.cpp +++ b/src/mame/drivers/vk100.cpp @@ -195,34 +195,34 @@ public: required_ioport m_capsshift; required_ioport m_dipsw; - UINT8* m_vram; - UINT8* m_trans; - UINT8* m_pattern; - UINT8* m_dir; - UINT8* m_sync; - UINT8* m_vector; - UINT8* m_ras_erase; - UINT8 m_dir_a6; // latched a6 of dir rom - UINT8 m_cout; // carry out from vgERR adder - UINT8 m_vsync; // vsync pin of crtc - UINT16 m_vgX; // 12 bit X value for vector draw position - UINT16 m_vgY; // 12 bit Y value for vector draw position - UINT16 m_vgERR; // error register can cause carries which need to be caught - UINT8 m_vgSOPS; - UINT8 m_vgPAT; - UINT16 m_vgPAT_Mask; // current mask for PAT - UINT8 m_vgPMUL; // reload value for PMUL_Count - UINT8 m_vgPMUL_Count; - UINT8 m_vgDownCount; // down counter = number of pixels, loaded from vgDU on execute + uint8_t* m_vram; + uint8_t* m_trans; + uint8_t* m_pattern; + uint8_t* m_dir; + uint8_t* m_sync; + uint8_t* m_vector; + uint8_t* m_ras_erase; + uint8_t m_dir_a6; // latched a6 of dir rom + uint8_t m_cout; // carry out from vgERR adder + uint8_t m_vsync; // vsync pin of crtc + uint16_t m_vgX; // 12 bit X value for vector draw position + uint16_t m_vgY; // 12 bit Y value for vector draw position + uint16_t m_vgERR; // error register can cause carries which need to be caught + uint8_t m_vgSOPS; + uint8_t m_vgPAT; + uint16_t m_vgPAT_Mask; // current mask for PAT + uint8_t m_vgPMUL; // reload value for PMUL_Count + uint8_t m_vgPMUL_Count; + uint8_t m_vgDownCount; // down counter = number of pixels, loaded from vgDU on execute #define VG_DU m_vgRegFile[0] #define VG_DVM m_vgRegFile[1] #define VG_DIR m_vgRegFile[2] #define VG_WOPS m_vgRegFile[3] - UINT8 m_vgRegFile[4]; - UINT8 m_VG_MODE; // 2 bits, latched on EXEC - UINT8 m_vgGO; // activated on next SYNC pulse after EXEC - UINT8 m_ACTS; - UINT8 m_ADSR; + uint8_t m_vgRegFile[4]; + uint8_t m_VG_MODE; // 2 bits, latched on EXEC + uint8_t m_vgGO; // activated on next SYNC pulse after EXEC + uint8_t m_ACTS; + uint8_t m_ADSR; ioport_port* m_col_array[16]; DECLARE_WRITE8_MEMBER(vgLD_X); @@ -246,10 +246,10 @@ public: DECLARE_WRITE_LINE_MEMBER(i8251_rxrdy_int); DECLARE_WRITE_LINE_MEMBER(i8251_txrdy_int); DECLARE_WRITE_LINE_MEMBER(i8251_rts); - UINT8 vram_read(); - UINT8 vram_attr_read(); + uint8_t vram_read(); + uint8_t vram_attr_read(); MC6845_UPDATE_ROW(crtc_update_row); - void vram_write(UINT8 data); + void vram_write(uint8_t data); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -277,49 +277,49 @@ protected: */ // returns one nybble from vram array based on X and Y regs -UINT8 vk100_state::vram_read() +uint8_t vk100_state::vram_read() { // XFinal is (X'&0x3FC)|(X&0x3) - UINT16 XFinal = m_trans[(m_vgX&0x3FC)>>2]<<2|(m_vgX&0x3); // appears correct + uint16_t XFinal = m_trans[(m_vgX&0x3FC)>>2]<<2|(m_vgX&0x3); // appears correct // EA is the effective ram address for a 16-bit block - UINT16 EA = ((m_vgY&0x1FE)<<5)|(XFinal>>4); // appears correct + uint16_t EA = ((m_vgY&0x1FE)<<5)|(XFinal>>4); // appears correct // block is the 16 bit block directly (note EA has to be <<1 to correctly index a byte) - UINT16 block = m_vram[(EA<<1)+1] | (m_vram[(EA<<1)]<<8); + uint16_t block = m_vram[(EA<<1)+1] | (m_vram[(EA<<1)]<<8); // nybbleNum is which of the four nybbles within the block to address. should NEVER be 3! - UINT8 nybbleNum = (XFinal&0xC)>>2; + uint8_t nybbleNum = (XFinal&0xC)>>2; return (block>>(4*nybbleNum))&0xF; } // returns the attribute nybble for the current pixel based on X and Y regs -UINT8 vk100_state::vram_attr_read() +uint8_t vk100_state::vram_attr_read() { // XFinal is (X'&0x3FC)|(X&0x3) - UINT16 XFinal = m_trans[(m_vgX&0x3FC)>>2]<<2|(m_vgX&0x3); // appears correct + uint16_t XFinal = m_trans[(m_vgX&0x3FC)>>2]<<2|(m_vgX&0x3); // appears correct // EA is the effective ram address for a 16-bit block - UINT16 EA = ((m_vgY&0x1FE)<<5)|(XFinal>>4); // appears correct + uint16_t EA = ((m_vgY&0x1FE)<<5)|(XFinal>>4); // appears correct // block is the 16 bit block directly (note EA has to be <<1 to correctly index a byte) - UINT16 block = m_vram[(EA<<1)+1] | (m_vram[(EA<<1)]<<8); + uint16_t block = m_vram[(EA<<1)+1] | (m_vram[(EA<<1)]<<8); // nybbleNum is the attribute nybble, which in this case is always 3 - UINT8 nybbleNum = 3; + uint8_t nybbleNum = 3; return (block>>(4*nybbleNum))&0xF; } // writes one nybble to vram array based on X and Y regs, and updates the attrib ram if needed -void vk100_state::vram_write(UINT8 data) +void vk100_state::vram_write(uint8_t data) { // XFinal is (X'&0x3FC)|(X&0x3) - UINT16 XFinal = m_trans[(m_vgX&0x3FC)>>2]<<2|(m_vgX&0x3); // appears correct + uint16_t XFinal = m_trans[(m_vgX&0x3FC)>>2]<<2|(m_vgX&0x3); // appears correct // EA is the effective ram address for a 16-bit block - UINT16 EA = ((m_vgY&0x1FE)<<5)|(XFinal>>4); // appears correct + uint16_t EA = ((m_vgY&0x1FE)<<5)|(XFinal>>4); // appears correct // block is the 16 bit block directly (note EA has to be <<1 to correctly index a byte) - UINT16 block = m_vram[(EA<<1)+1] | (m_vram[(EA<<1)]<<8); + uint16_t block = m_vram[(EA<<1)+1] | (m_vram[(EA<<1)]<<8); // nybbleNum is which of the four nybbles within the block to address. should NEVER be 3! - UINT8 nybbleNum = (XFinal&0xC)>>2; - block &= ~((UINT16)0xF<<(nybbleNum*4)); // mask out the part we want to replace + uint8_t nybbleNum = (XFinal&0xC)>>2; + block &= ~((uint16_t)0xF<<(nybbleNum*4)); // mask out the part we want to replace block |= data<<(nybbleNum*4); // write the new part // NOTE: this next part may have to be made conditional on VG_MODE // check if the attribute nybble is supposed to be modified, and if so do so - if (VG_WOPS&0x08) block = (block&0x0FFF)|(((UINT16)VG_WOPS&0xF0)<<8); + if (VG_WOPS&0x08) block = (block&0x0FFF)|(((uint16_t)VG_WOPS&0xF0)<<8); m_vram[(EA<<1)+1] = block&0xFF; // write block back to vram m_vram[(EA<<1)] = (block&0xFF00)>>8; // '' } @@ -363,7 +363,7 @@ void vk100_state::device_timer(emu_timer &timer, device_timer_id id, int param, TIMER_CALLBACK_MEMBER(vk100_state::execute_vg) { m_cout = 1; // hack for now - UINT8 dirbyte = m_dir[(m_dir_a6<<6)|((m_vgY&1)<<5)|(m_cout<<4)|VG_DIR]; + uint8_t dirbyte = m_dir[(m_dir_a6<<6)|((m_vgY&1)<<5)|(m_cout<<4)|VG_DIR]; #ifdef DEBUG_VG_STATE static const char *const vg_functions[] = { "Move", "Dot", "Vector", "Erase" }; fprintf(stderr, "VGMODE: %s; DIR: A:%02x; D:%02x; X: %03X; Y: %03X; DownCount: %02X\n", vg_functions[m_VG_MODE], ((m_dir_a6<<6)|((m_vgY&1)<<5)|(m_cout<<4)|VG_DIR), dirbyte, m_vgX, m_vgY, m_vgDownCount); @@ -380,9 +380,9 @@ TIMER_CALLBACK_MEMBER(vk100_state::execute_vg) else m_vgY++; } if (dirbyte&0x10) m_vgDownCount--; // decrement the down counter - UINT8 thisNyb = vram_read(); // read in the nybble + uint8_t thisNyb = vram_read(); // read in the nybble // pattern rom addressing is a complex mess. see the pattern rom def later in this file. - UINT8 newNyb = m_pattern[((m_vgPAT&m_vgPAT_Mask)?0x200:0)|((VG_WOPS&7)<<6)|((m_vgX&3)<<4)|thisNyb]; // calculate new nybble based on pattern rom + uint8_t newNyb = m_pattern[((m_vgPAT&m_vgPAT_Mask)?0x200:0)|((VG_WOPS&7)<<6)|((m_vgX&3)<<4)|thisNyb]; // calculate new nybble based on pattern rom // finally write the block back to ram depending on the VG_MODE (sort of a hack until we get the vector and sync and dir roms all hooked up) // but only do it if the direction rom said so! switch (m_VG_MODE) @@ -423,9 +423,9 @@ TIMER_CALLBACK_MEMBER(vk100_state::execute_vg) WRITE8_MEMBER(vk100_state::vgLD_X) { m_vgX &= 0xFF << ((1-offset)*8); - m_vgX |= ((UINT16)data) << (offset*8); + m_vgX |= ((uint16_t)data) << (offset*8); #ifdef VG40_VERBOSE - logerror("VG: 0x%02X: X Reg loaded with %04X, new X value is %04X\n", 0x40+offset, ((UINT16)data) << (offset*8), m_vgX); + logerror("VG: 0x%02X: X Reg loaded with %04X, new X value is %04X\n", 0x40+offset, ((uint16_t)data) << (offset*8), m_vgX); #endif } @@ -433,9 +433,9 @@ WRITE8_MEMBER(vk100_state::vgLD_X) WRITE8_MEMBER(vk100_state::vgLD_Y) { m_vgY &= 0xFF << ((1-offset)*8); - m_vgY |= ((UINT16)data) << (offset*8); + m_vgY |= ((uint16_t)data) << (offset*8); #ifdef VG40_VERBOSE - logerror("VG: 0x%02X: Y Reg loaded with %04X, new Y value is %04X\n", 0x42+offset, ((UINT16)data) << (offset*8), m_vgY); + logerror("VG: 0x%02X: Y Reg loaded with %04X, new Y value is %04X\n", 0x42+offset, ((uint16_t)data) << (offset*8), m_vgY); #endif } @@ -636,7 +636,7 @@ WRITE8_MEMBER(vk100_state::BAUD) */ READ8_MEMBER(vk100_state::SYSTAT_A) { - UINT8 dipswitchLUT[8] = { 1,3,5,7,6,4,2,0 }; // the dipswitches map in a weird order to offsets + uint8_t dipswitchLUT[8] = { 1,3,5,7,6,4,2,0 }; // the dipswitches map in a weird order to offsets #ifdef SYSTAT_A_VERBOSE if (m_maincpu->pc() != 0x31D) logerror("0x%04X: SYSTAT_A Read!\n", m_maincpu->pc()); #endif @@ -671,7 +671,7 @@ READ8_MEMBER(vk100_state::SYSTAT_B) READ8_MEMBER(vk100_state::vk100_keyboard_column_r) { - UINT8 code = m_col_array[offset&0xF]->read() | m_capsshift->read(); + uint8_t code = m_col_array[offset&0xF]->read() | m_capsshift->read(); #ifdef KBD_VERBOSE logerror("Keyboard column %X read, returning %02X\n", offset&0xF, code); #endif @@ -999,10 +999,10 @@ void vk100_state::video_start() MC6845_UPDATE_ROW( vk100_state::crtc_update_row ) { - static const UINT32 colorTable[16] = { + static const uint32_t colorTable[16] = { 0x000000, 0x0000FF, 0xFF0000, 0xFF00FF, 0x00FF00, 0x00FFFF, 0xFFFF00, 0xFFFFFF, 0x000000, 0x0000FF, 0xFF0000, 0xFF00FF, 0x00FF00, 0x00FFFF, 0xFFFF00, 0xFFFFFF }; - static const UINT32 colorTable2[16] = { + static const uint32_t colorTable2[16] = { 0x000000, 0x0000FF, 0xFF0000, 0xFF00FF, 0x00FF00, 0x00FFFF, 0xFFFF00, 0xFFFFFF, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000 }; //printf("y=%d, ma=%04x, ra=%02x, x_count=%02x ", y, ma, ra, x_count); @@ -1010,13 +1010,13 @@ MC6845_UPDATE_ROW( vk100_state::crtc_update_row ) * real address to 16-bit chunk a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 * crtc input MA11 MA10 MA9 MA8 MA7 MA6 RA1 RA0 MA5 MA4 MA3 MA2 MA1 MA0 */ - UINT16 EA = ((ma&0xfc0)<<2)|((ra&0x3)<<6)|(ma&0x3F); + uint16_t EA = ((ma&0xfc0)<<2)|((ra&0x3)<<6)|(ma&0x3F); // display the 64 different 12-bit-wide chunks for (int i = 0; i < 64; i++) { - UINT16 block = m_vram[(EA<<1)+(2*i)+1] | (m_vram[(EA<<1)+(2*i)]<<8); - UINT32 fgColor = (m_vgSOPS&0x08)?colorTable[(block&0xF000)>>12]:colorTable2[(block&0xF000)>>12]; - UINT32 bgColor = (m_vgSOPS&0x08)?colorTable[(m_vgSOPS&0xF0)>>4]:colorTable2[(m_vgSOPS&0xF0)>>4]; + uint16_t block = m_vram[(EA<<1)+(2*i)+1] | (m_vram[(EA<<1)+(2*i)]<<8); + uint32_t fgColor = (m_vgSOPS&0x08)?colorTable[(block&0xF000)>>12]:colorTable2[(block&0xF000)>>12]; + uint32_t bgColor = (m_vgSOPS&0x08)?colorTable[(m_vgSOPS&0xF0)>>4]:colorTable2[(m_vgSOPS&0xF0)>>4]; // display a 12-bit wide chunk for (int j = 0; j < 12; j++) { diff --git a/src/mame/drivers/vlc.cpp b/src/mame/drivers/vlc.cpp index bb221960019..8fae31892a6 100644 --- a/src/mame/drivers/vlc.cpp +++ b/src/mame/drivers/vlc.cpp @@ -172,20 +172,20 @@ public: optional_device m_microtouch; required_device m_nvram; - required_shared_ptr m_ram62256; - required_shared_ptr m_backup; + required_shared_ptr m_ram62256; + required_shared_ptr m_backup; void nvram_init(nvram_device &nvram, void *data, size_t size); - UINT16 m_datA40000; + uint16_t m_datA40000; - //UINT8* m_videoram; - //UINT8* m_colorram; + //uint8_t* m_videoram; + //uint8_t* m_colorram; - UINT16* m_videoram; + uint16_t* m_videoram; tilemap_t *m_bg_tilemap; virtual void video_start() override; - UINT32 screen_update_nevada(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nevada(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_PALETTE_INIT(nevada); DECLARE_WRITE_LINE_MEMBER(duart18_irq_handler); @@ -214,7 +214,7 @@ there is a 74LS173 on the LOWER byte that used bit D3..D0 funny thing , the DOOR ACCESS Switch is connected on the CLEAR PIN of this 4bits register so when D3..D0 are LOW , DOOR is OPEN */ -static const UINT8 pal35[256] = { +static const uint8_t pal35[256] = { 0x11, 0x42, 0x5B, 0xCA, 0x19, 0x42, 0x5B, 0xCA, 0x38, 0x63, 0x3A, 0x63, 0x3A, 0x63, 0x3A, 0x63, 0xD3, 0x08, 0x5B, 0xCA, 0x19, 0xCA, 0x19, 0xCA, 0x18, 0xEB, 0x18, 0xEB, 0x18, 0xEB, 0x18, 0xEB, 0xD3, 0xCA, 0x5B, 0xCC, 0x5B, 0xCC, 0x5B, 0xCC, 0xBA, 0x63, 0x38, 0x65, 0x38, 0x65, 0x38, 0x65, @@ -293,7 +293,7 @@ void nevada_state::video_start() } /***************************************************************************/ -UINT32 nevada_state::screen_update_nevada(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t nevada_state::screen_update_nevada(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // Todo /* @@ -409,7 +409,7 @@ WRITE16_MEMBER(nevada_state::io_board_x) READ16_MEMBER(nevada_state::nevada_sec_r ) { // D3..D0 = DOOR OPEN or Track STATE of PAL35 - UINT16 res; + uint16_t res; /* UPPER byte is use for input in PAL35 */ // 74LS173 $bits Register used LOWER bits D3..D0 for PAL35 state and DOOR LOGIC SWITCH res = pal35[m_datA40000 >> 8]; @@ -675,7 +675,7 @@ ROM_END *************************/ DRIVER_INIT_MEMBER(nevada_state,nevada) { - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); memset(m_backup,0x00,m_backup.bytes()); // temp diff --git a/src/mame/drivers/votrpss.cpp b/src/mame/drivers/votrpss.cpp index d74006139d3..4dac46de306 100644 --- a/src/mame/drivers/votrpss.cpp +++ b/src/mame/drivers/votrpss.cpp @@ -108,10 +108,10 @@ public: DECLARE_WRITE_LINE_MEMBER(write_uart_clock); IRQ_CALLBACK_MEMBER(irq_ack); private: - UINT8 m_term_data; - UINT8 m_porta; - UINT8 m_portb; - UINT8 m_portc; + uint8_t m_term_data; + uint8_t m_porta; + uint8_t m_portb; + uint8_t m_portc; virtual void machine_start() override; required_device m_maincpu; required_device m_terminal; @@ -194,7 +194,7 @@ IRQ_CALLBACK_MEMBER( votrpss_state::irq_ack ) READ8_MEMBER( votrpss_state::ppi_pa_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } @@ -207,7 +207,7 @@ READ8_MEMBER( votrpss_state::ppi_pb_r ) // Bit 0 controls what happens at interrupt time. See code around 518. READ8_MEMBER( votrpss_state::ppi_pc_r ) { - UINT8 data = 0; + uint8_t data = 0; if (m_term_data) { diff --git a/src/mame/drivers/voyager.cpp b/src/mame/drivers/voyager.cpp index 7afe5159636..1ffb2a7f987 100644 --- a/src/mame/drivers/voyager.cpp +++ b/src/mame/drivers/voyager.cpp @@ -31,11 +31,11 @@ public: { } - std::unique_ptr m_bios_ram; - UINT8 m_mtxc_config_reg[256]; - UINT8 m_piix4_config_reg[4][256]; + std::unique_ptr m_bios_ram; + uint8_t m_mtxc_config_reg[256]; + uint8_t m_piix4_config_reg[4][256]; - UINT32 m_idle_skip_ram; + uint32_t m_idle_skip_ram; DECLARE_WRITE32_MEMBER(bios_ram_w); DECLARE_DRIVER_INIT(voyager); virtual void machine_start() override; @@ -46,7 +46,7 @@ public: // Intel 82439TX System Controller (MTXC) -static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) { voyager_state *state = busdevice->machine().driver_data(); // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); @@ -54,7 +54,7 @@ static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, return state->m_mtxc_config_reg[reg]; } -static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { voyager_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:MTXC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); @@ -100,9 +100,9 @@ void voyager_state::intel82439tx_init() m_mtxc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if(reg == 0) return 0x05851106; // VT82C585VPX, VIA @@ -126,7 +126,7 @@ static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -148,23 +148,23 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) -static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { voyager_state *state = busdevice->machine().driver_data(); // osd_printf_debug("PIIX4: read %d, %02X\n", function, reg); return state->m_piix4_config_reg[function][reg]; } -static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { voyager_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); state->m_piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if(reg == 0) return 0x30401106; // VT82C586B, VIA @@ -188,7 +188,7 @@ static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -499,7 +499,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(voyager_state,voyager) { - m_bios_ram = std::make_unique(0x20000/4); + m_bios_ram = std::make_unique(0x20000/4); intel82439tx_init(); } diff --git a/src/mame/drivers/vp101.cpp b/src/mame/drivers/vp101.cpp index a1b66a5e1b8..67044a2d8f5 100644 --- a/src/mame/drivers/vp101.cpp +++ b/src/mame/drivers/vp101.cpp @@ -31,7 +31,7 @@ public: DECLARE_READ32_MEMBER(tty_ready_r); DECLARE_WRITE32_MEMBER(tty_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: @@ -47,7 +47,7 @@ void vp10x_state::video_start() { } -UINT32 vp10x_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vp10x_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/vpoker.cpp b/src/mame/drivers/vpoker.cpp index 1a23190c002..e11c5179570 100644 --- a/src/mame/drivers/vpoker.cpp +++ b/src/mame/drivers/vpoker.cpp @@ -112,13 +112,13 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - std::unique_ptr m_videoram; - UINT8 m_blit_ram[8]; + std::unique_ptr m_videoram; + uint8_t m_blit_ram[8]; DECLARE_READ8_MEMBER(blitter_r); DECLARE_WRITE8_MEMBER(blitter_w); DECLARE_WRITE_LINE_MEMBER(ptm_irq); virtual void video_start() override; - UINT32 screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -127,12 +127,12 @@ public: void vpoker_state::video_start() { - m_videoram = std::make_unique(0x200); + m_videoram = std::make_unique(0x200); } -UINT32 vpoker_state::screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vpoker_state::screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 *videoram = m_videoram.get(); + uint8_t *videoram = m_videoram.get(); gfx_element *gfx = m_gfxdecode->gfx(0); int count = 0x0000; @@ -163,7 +163,7 @@ READ8_MEMBER(vpoker_state::blitter_r) WRITE8_MEMBER(vpoker_state::blitter_w) { - UINT8 *videoram = m_videoram.get(); + uint8_t *videoram = m_videoram.get(); m_blit_ram[offset] = data; diff --git a/src/mame/drivers/vroulet.cpp b/src/mame/drivers/vroulet.cpp index cb6fd700655..c6d342b9c6b 100644 --- a/src/mame/drivers/vroulet.cpp +++ b/src/mame/drivers/vroulet.cpp @@ -59,11 +59,11 @@ public: required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_generic_paletteram_8; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_ball; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_ball; tilemap_t *m_bg_tilemap; @@ -78,7 +78,7 @@ public: virtual void video_start() override; - 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); }; @@ -135,7 +135,7 @@ void vroulet_state::video_start() 8, 8, 32, 32); } -UINT32 vroulet_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vroulet_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, 0x320, 1, 0, 0, diff --git a/src/mame/drivers/vt100.cpp b/src/mame/drivers/vt100.cpp index 589a8530dc2..0322f74b082 100644 --- a/src/mame/drivers/vt100.cpp +++ b/src/mame/drivers/vt100.cpp @@ -57,19 +57,19 @@ public: DECLARE_WRITE8_MEMBER(vt100_nvr_latch_w); DECLARE_READ8_MEMBER(vt100_read_video_ram_r); DECLARE_WRITE_LINE_MEMBER(vt100_clear_video_interrupt); - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; bool m_keyboard_int; bool m_receiver_int; bool m_vertical_int; bool m_key_scan; - UINT8 m_key_code; + uint8_t m_key_code; virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_vt100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vt100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vt100_vertical_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); IRQ_CALLBACK_MEMBER(vt100_irq_callback); - UINT8 bit_sel(UINT8 data); + uint8_t bit_sel(uint8_t data); }; @@ -108,13 +108,13 @@ ADDRESS_MAP_END // 7 - Keyboard TBMT H READ8_MEMBER( vt100_state::vt100_flags_r ) { - UINT8 ret = 0; + uint8_t ret = 0; ret |= m_crtc->lba7_r(space, 0) << 6; ret |= m_keyboard_int << 7; return ret; } -UINT8 vt100_state::bit_sel(UINT8 data) +uint8_t vt100_state::bit_sel(uint8_t data) { if (!BIT(data,7)) return 0x70; if (!BIT(data,6)) return 0x60; @@ -129,7 +129,7 @@ UINT8 vt100_state::bit_sel(UINT8 data) TIMER_DEVICE_CALLBACK_MEMBER(vt100_state::keyboard_callback) { - UINT8 i, code; + uint8_t i, code; char kbdrow[8]; if (m_key_scan) { @@ -323,7 +323,7 @@ static INPUT_PORTS_START( vt100 ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) // Always return 0x7f on last scan line INPUT_PORTS_END -UINT32 vt100_state::screen_update_vt100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vt100_state::screen_update_vt100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_crtc->video_update(bitmap, cliprect); return 0; @@ -337,7 +337,7 @@ UINT32 vt100_state::screen_update_vt100(screen_device &screen, bitmap_ind16 &bit // all other set to 1 IRQ_CALLBACK_MEMBER(vt100_state::vt100_irq_callback) { - UINT8 ret = 0xc7 | (m_keyboard_int << 3) | (m_receiver_int << 4) | (m_vertical_int << 5); + uint8_t ret = 0xc7 | (m_keyboard_int << 3) | (m_receiver_int << 4) | (m_vertical_int << 5); m_receiver_int = 0; return ret; } diff --git a/src/mame/drivers/vt220.cpp b/src/mame/drivers/vt220.cpp index bdb1ebd9a99..7076980954b 100644 --- a/src/mame/drivers/vt220.cpp +++ b/src/mame/drivers/vt220.cpp @@ -26,7 +26,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_vt220(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vt220(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_ram; }; @@ -52,7 +52,7 @@ void vt220_state::video_start() { } -UINT32 vt220_state::screen_update_vt220(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vt220_state::screen_update_vt220(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/vt240.cpp b/src/mame/drivers/vt240.cpp index 9bd72f279f8..9a60e923277 100644 --- a/src/mame/drivers/vt240.cpp +++ b/src/mame/drivers/vt240.cpp @@ -59,8 +59,8 @@ public: required_device m_bank; required_device m_nvram; required_device m_palette; - required_region_ptr m_rom; - required_shared_ptr m_video_ram; + required_region_ptr m_rom; + required_shared_ptr m_video_ram; required_ioport m_monitor; optional_device m_lk201; @@ -108,16 +108,16 @@ public: DECLARE_WRITE_LINE_MEMBER(irq9_w); DECLARE_WRITE_LINE_MEMBER(irq13_w); - UINT8 m_i8085_out, m_t11_out, m_i8085_rdy, m_t11; - UINT8 m_mem_map[16]; - UINT8 m_mem_map_sel; - UINT8 m_char_buf[16]; - UINT8 m_char_idx, m_mask, m_reg0, m_reg1, m_lu; - UINT8 m_vom[16]; - UINT8 m_vpat, m_patmult, m_patcnt, m_patidx; - UINT16 m_irqs; + uint8_t m_i8085_out, m_t11_out, m_i8085_rdy, m_t11; + uint8_t m_mem_map[16]; + uint8_t m_mem_map_sel; + uint8_t m_char_buf[16]; + uint8_t m_char_idx, m_mask, m_reg0, m_reg1, m_lu; + uint8_t m_vom[16]; + uint8_t m_vpat, m_patmult, m_patcnt, m_patidx; + uint16_t m_irqs; bool m_lb; - UINT16 m_scrl; + uint16_t m_scrl; }; void vt240_state::irq_encoder(int irq, int state) @@ -200,7 +200,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( vt240_state::hgdc_draw ) const rgb_t *palette = m_palette->palette()->entry_list_raw(); int xi, gfx1, gfx2; - UINT8 vom; + uint8_t vom; if(!BIT(m_reg0, 7)) { @@ -384,7 +384,7 @@ READ16_MEMBER(vt240_state::vram_r) WRITE16_MEMBER(vt240_state::vram_w) { - UINT8 *video_ram = (UINT8 *)(&m_video_ram[0]); + uint8_t *video_ram = (uint8_t *)(&m_video_ram[0]); offset <<= 1; offset = ((offset & 0x30000) >> 1) | (offset & 0x7fff); if(!BIT(m_reg0, 3)) @@ -400,7 +400,7 @@ WRITE16_MEMBER(vt240_state::vram_w) data &= 0xff; } offset &= 0xffff; - UINT8 chr = data; + uint8_t chr = data; if(BIT(m_reg0, 4)) { @@ -424,8 +424,8 @@ WRITE16_MEMBER(vt240_state::vram_w) { if(ps == 0) i++; - UINT8 mem = video_ram[(offset & 0x7fff) + (0x8000 * i)]; - UINT8 out = 0, ifore = BIT(m_lu, (i ? 5 : 4)), iback = BIT(m_lu, (i ? 3 : 2)); + uint8_t mem = video_ram[(offset & 0x7fff) + (0x8000 * i)]; + uint8_t out = 0, ifore = BIT(m_lu, (i ? 5 : 4)), iback = BIT(m_lu, (i ? 3 : 2)); for(int j = 0; j < 8; j++) out |= BIT(chr, j) ? (ifore << j) : (iback << j); switch(m_lu >> 6) @@ -448,7 +448,7 @@ WRITE16_MEMBER(vt240_state::vram_w) out = (out & data) | (mem & ~data); if(BIT(m_reg1, 3)) { - UINT8 out2 = out; + uint8_t out2 = out; if(BIT(m_reg1, 2)) { out = video_ram[((offset & 0x7ffe) | 0) + (0x8000 * i)]; @@ -473,7 +473,7 @@ WRITE16_MEMBER(vt240_state::vram_w) data = (chr & data) | (video_ram[offset] & ~data); if(BIT(m_reg1, 3)) { - UINT8 data2 = data; + uint8_t data2 = data; if(BIT(m_reg1, 2)) { data = video_ram[(offset & ~1) | 0]; diff --git a/src/mame/drivers/vt320.cpp b/src/mame/drivers/vt320.cpp index cb40407e0ac..f468ac7a2c1 100644 --- a/src/mame/drivers/vt320.cpp +++ b/src/mame/drivers/vt320.cpp @@ -23,7 +23,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_vt320(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vt320(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_ram; }; @@ -75,7 +75,7 @@ void vt320_state::video_start() { } -UINT32 vt320_state::screen_update_vt320(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vt320_state::screen_update_vt320(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/vt520.cpp b/src/mame/drivers/vt520.cpp index c9f88584245..a6a0af9c645 100644 --- a/src/mame/drivers/vt520.cpp +++ b/src/mame/drivers/vt520.cpp @@ -23,7 +23,7 @@ public: DECLARE_READ8_MEMBER(vt520_some_r); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_vt520(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vt520(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; @@ -58,7 +58,7 @@ INPUT_PORTS_END void vt520_state::machine_reset() { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); space.unmap_write(0x0000, 0xffff); membank("bank1")->set_base(rom + 0x70000); } @@ -67,7 +67,7 @@ void vt520_state::video_start() { } -UINT32 vt520_state::screen_update_vt520(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vt520_state::screen_update_vt520(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/vta2000.cpp b/src/mame/drivers/vta2000.cpp index c301e5bcd18..7f70b553a77 100644 --- a/src/mame/drivers/vta2000.cpp +++ b/src/mame/drivers/vta2000.cpp @@ -31,9 +31,9 @@ public: , m_maincpu(*this, "maincpu") { } - const UINT8 *m_p_chargen; - UINT32 screen_update_vta2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + uint32_t screen_update_vta2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; DECLARE_PALETTE_INIT(vta2000); private: virtual void machine_reset() override; @@ -67,12 +67,12 @@ void vta2000_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 vta2000_state::screen_update_vta2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vta2000_state::screen_update_vta2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) /* Cursor is missing. */ { - static UINT8 framecnt=0; - UINT8 y,ra,gfx,attr,fg,bg; - UINT16 sy=0,ma=0,x,xx=0,chr; + static uint8_t framecnt=0; + uint8_t y,ra,gfx,attr,fg,bg; + uint16_t sy=0,ma=0,x,xx=0,chr; framecnt++; @@ -80,7 +80,7 @@ UINT32 vta2000_state::screen_update_vta2000(screen_device &screen, bitmap_ind16 { for (ra = 0; ra < 12; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); xx = ma << 1; for (x = ma; x < ma + 80; x++) diff --git a/src/mame/drivers/vtech1.cpp b/src/mame/drivers/vtech1.cpp index fcd816afc55..84cf16cdaf3 100644 --- a/src/mame/drivers/vtech1.cpp +++ b/src/mame/drivers/vtech1.cpp @@ -85,10 +85,10 @@ public: DECLARE_SNAPSHOT_LOAD_MEMBER( vtech1 ); private: - static const UINT8 VZ_BASIC = 0xf0; - static const UINT8 VZ_MCODE = 0xf1; + static const uint8_t VZ_BASIC = 0xf0; + static const uint8_t VZ_MCODE = 0xf1; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_maincpu; required_device m_mc6847; @@ -106,7 +106,7 @@ private: SNAPSHOT_LOAD_MEMBER( vtech1_state, vtech1 ) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT8 header[24]; + uint8_t header[24]; char pgmname[18]; // get the header @@ -118,16 +118,16 @@ SNAPSHOT_LOAD_MEMBER( vtech1_state, vtech1 ) pgmname[16] = '\0'; // get start and end addresses - UINT16 start = pick_integer_le(header, 22, 2); - UINT16 end = start + snapshot_size - sizeof(header); - UINT16 size = end - start; + uint16_t start = pick_integer_le(header, 22, 2); + uint16_t end = start + snapshot_size - sizeof(header); + uint16_t size = end - start; // write it to ram - UINT8 *ptr = (UINT8 *)image.ptr() + sizeof(header); + uint8_t *ptr = (uint8_t *)image.ptr() + sizeof(header); - for (UINT16 addr = start; addr <= end; addr++, ptr++) + for (uint16_t addr = start; addr <= end; addr++, ptr++) { - UINT8 to_write = *ptr; + uint8_t to_write = *ptr; space.write_byte(addr, to_write); // verify @@ -184,7 +184,7 @@ READ8_MEMBER( vtech1_state::vtech1_lightpen_r ) READ8_MEMBER( vtech1_state::vtech1_keyboard_r ) { - UINT8 result = 0x3f; + uint8_t result = 0x3f; // bit 0 to 5, keyboard input if (!BIT(offset, 0)) result &= ioport("keyboard_0")->read(); @@ -412,7 +412,7 @@ INPUT_PORTS_END MACHINE DRIVERS ***************************************************************************/ -static const INT16 speaker_levels[] = {-32768, 0, 32767, 0}; +static const int16_t speaker_levels[] = {-32768, 0, 32767, 0}; static MACHINE_CONFIG_START( laser110, vtech1_state ) diff --git a/src/mame/drivers/wacky_gator.cpp b/src/mame/drivers/wacky_gator.cpp index 7f78aacf496..4a29a46eae1 100644 --- a/src/mame/drivers/wacky_gator.cpp +++ b/src/mame/drivers/wacky_gator.cpp @@ -57,13 +57,13 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(alligators_rear_sensors_r); DECLARE_CUSTOM_INPUT_MEMBER(alligators_front_sensors_r); - void set_lamps(int p, UINT8 value); + void set_lamps(int p, uint8_t value); DECLARE_WRITE8_MEMBER(status_lamps_w); DECLARE_WRITE8_MEMBER(timing_lamps_0_w) { set_lamps(8 , data); } DECLARE_WRITE8_MEMBER(timing_lamps_1_w) { set_lamps(16, data); } DECLARE_WRITE8_MEMBER(timing_lamps_2_w) { set_lamps(24, data); } - void set_digits(int p, UINT8 value); + void set_digits(int p, uint8_t value); DECLARE_WRITE8_MEMBER(disp0_w) { set_digits(0, data); } DECLARE_WRITE8_MEMBER(disp1_w) { set_digits(2, data); } DECLARE_WRITE8_MEMBER(disp2_w) { set_digits(4, data); } @@ -83,10 +83,10 @@ public: private: int m_adpcm_sel; - UINT16 m_adpcm_pos; - UINT8 m_adpcm_ctrl; + uint16_t m_adpcm_pos; + uint8_t m_adpcm_ctrl; - UINT8 m_alligators_ctrl; + uint8_t m_alligators_ctrl; int m_motors_pos[5]; }; @@ -187,14 +187,14 @@ void wackygtr_state::machine_reset() m_adpcm_ctrl = 0x80; } -void wackygtr_state::set_digits(int p, UINT8 value) +void wackygtr_state::set_digits(int p, uint8_t value) { - static UINT8 bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // not accurate + static uint8_t bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // not accurate output().set_digit_value(p + 0, bcd2hex[value & 0x0f]); output().set_digit_value(p + 1, bcd2hex[(value >> 4) & 0x0f]); } -void wackygtr_state::set_lamps(int p, UINT8 value) +void wackygtr_state::set_lamps(int p, uint8_t value) { for(int i=0; i<8; i++) output().set_lamp_value(p + i, BIT(value, i)); @@ -240,7 +240,7 @@ WRITE_LINE_MEMBER(wackygtr_state::adpcm_int) { if (!(m_adpcm_ctrl & 0x80)) { - UINT8 data = m_samples->base()[m_adpcm_pos & 0xffff]; + uint8_t data = m_samples->base()[m_adpcm_pos & 0xffff]; m_msm->data_w((m_adpcm_sel ? data : (data >> 4)) & 0x0f); m_adpcm_pos += m_adpcm_sel; m_adpcm_sel ^= 1; diff --git a/src/mame/drivers/wallc.cpp b/src/mame/drivers/wallc.cpp index a9182a87cd3..77a25599bc3 100644 --- a/src/mame/drivers/wallc.cpp +++ b/src/mame/drivers/wallc.cpp @@ -67,7 +67,7 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; @@ -79,7 +79,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(wallc); - UINT32 screen_update_wallc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wallc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -110,7 +110,7 @@ public: PALETTE_INIT_MEMBER(wallc_state, wallc) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; static const int resistances_rg[2] = { 330, 220 }; @@ -162,7 +162,7 @@ void wallc_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(wallc_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS_FLIP_Y, 8, 8, 32, 32); } -UINT32 wallc_state::screen_update_wallc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t wallc_state::screen_update_wallc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -267,10 +267,10 @@ GFXDECODE_END DRIVER_INIT_MEMBER(wallc_state,wallc) { - UINT8 c; - UINT32 i; + uint8_t c; + uint32_t i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i=0; i<0x2000*2; i++) { @@ -282,10 +282,10 @@ DRIVER_INIT_MEMBER(wallc_state,wallc) DRIVER_INIT_MEMBER(wallc_state,wallca) { - UINT8 c; - UINT32 i; + uint8_t c; + uint32_t i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (i=0; i<0x4000; i++) { @@ -445,10 +445,10 @@ ROM_END DRIVER_INIT_MEMBER(wallc_state,sidam) { - UINT8 c; - UINT32 i; + uint8_t c; + uint32_t i; - UINT8 *ROM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); int count = 0; for (i=0; i<0x2000; i++) diff --git a/src/mame/drivers/wangpc.cpp b/src/mame/drivers/wangpc.cpp index 7038ab7befd..dac18d5e700 100644 --- a/src/mame/drivers/wangpc.cpp +++ b/src/mame/drivers/wangpc.cpp @@ -189,7 +189,7 @@ public: image_init_result on_disk1_load(floppy_image_device *image); void on_disk1_unload(floppy_image_device *image); - UINT8 m_dma_page[4]; + uint8_t m_dma_page[4]; int m_dack; int m_timer2_irq; @@ -450,7 +450,7 @@ READ8_MEMBER( wangpc_state::status_r ) */ - UINT8 data = 0x03; + uint8_t data = 0x03; // floppy interrupts data |= m_fdc->get_irq() << 3; @@ -564,7 +564,7 @@ READ8_MEMBER( wangpc_state::uart_r ) check_level2_interrupts(); - UINT8 data = m_uart->read(space, 0); + uint8_t data = m_uart->read(space, 0); if (LOG) logerror("%s: UART read %02x\n", machine().describe_context(), data); @@ -709,7 +709,7 @@ READ8_MEMBER( wangpc_state::option_id_r ) */ - UINT8 data = 0; + uint8_t data = 0; // FDC interrupt data |= (m_fdc_dd0 || m_fdc_dd1 || (int) m_fdc->get_irq()) << 7; @@ -941,7 +941,7 @@ READ8_MEMBER( wangpc_state::ppi_pa_r ) */ - UINT8 data = 0x08 | 0x02 | 0x01; + uint8_t data = 0x08 | 0x02 | 0x01; data |= m_dav << 2; data |= m_centronics_busy << 4; @@ -969,7 +969,7 @@ READ8_MEMBER( wangpc_state::ppi_pb_r ) */ - UINT8 data = 0; + uint8_t data = 0; // timer 2 interrupt data |= m_timer2_irq; diff --git a/src/mame/drivers/warpsped.cpp b/src/mame/drivers/warpsped.cpp index b14a096f557..32b11714263 100644 --- a/src/mame/drivers/warpsped.cpp +++ b/src/mame/drivers/warpsped.cpp @@ -101,12 +101,12 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_videoram; - required_shared_ptr m_workram; + required_shared_ptr m_videoram; + required_shared_ptr m_workram; tilemap_t *m_text_tilemap; tilemap_t *m_starfield_tilemap; - UINT8 m_regs[0x28]; + uint8_t m_regs[0x28]; DECLARE_WRITE8_MEMBER(hardware_w); DECLARE_WRITE8_MEMBER(vidram_w); @@ -117,7 +117,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(warpspeed); - 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); void draw_circles(bitmap_ind16 &bitmap); }; @@ -128,13 +128,13 @@ WRITE8_MEMBER(warpspeed_state::hardware_w) TILE_GET_INFO_MEMBER(warpspeed_state::get_text_tile_info) { - UINT8 code = m_videoram[tile_index] & 0x3f; + uint8_t code = m_videoram[tile_index] & 0x3f; SET_TILE_INFO_MEMBER(0, code, 0, 0); } TILE_GET_INFO_MEMBER(warpspeed_state::get_starfield_tile_info) { - UINT8 code = 0x3f; + uint8_t code = 0x3f; if ( tile_index & 1 ) { code = memregion("starfield")->base()[tile_index >> 1] & 0x3f; @@ -162,7 +162,7 @@ static void draw_circle_line(bitmap_ind16 &bitmap, int x, int y, int l, int colo { if (y >= 0 && y <= bitmap.height() - 1) { - UINT16* pLine = &bitmap.pix16(y); + uint16_t* pLine = &bitmap.pix16(y); int h1 = x - l; int h2 = x + l; @@ -177,7 +177,7 @@ static void draw_circle_line(bitmap_ind16 &bitmap, int x, int y, int l, int colo } } -static void draw_circle(bitmap_ind16 &bitmap, INT16 cx, INT16 cy, UINT16 radius, UINT8 color ) +static void draw_circle(bitmap_ind16 &bitmap, int16_t cx, int16_t cy, uint16_t radius, uint8_t color ) { /* Bresenham's circle algorithm */ @@ -206,12 +206,12 @@ void warpspeed_state::draw_circles(bitmap_ind16 &bitmap) { for (int i = 0; i < 4; i++) { - UINT16 radius = m_regs[i*8] + m_regs[i*8 + 1]*256; + uint16_t radius = m_regs[i*8] + m_regs[i*8 + 1]*256; radius = 0xffff - radius; radius = sqrt((float)radius); - INT16 midx = m_regs[i*8 + 2] + m_regs[i*8 + 3]*256; + int16_t midx = m_regs[i*8 + 2] + m_regs[i*8 + 3]*256; midx -= 0xe70; - INT16 midy = m_regs[i*8 + 4] + m_regs[i*8 + 5]*256; + int16_t midy = m_regs[i*8 + 4] + m_regs[i*8 + 5]*256; midy -= 0xe70; if ( radius == 0 || radius == 0xffff ) { @@ -221,7 +221,7 @@ void warpspeed_state::draw_circles(bitmap_ind16 &bitmap) } } -UINT32 warpspeed_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t warpspeed_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_starfield_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_circles(bitmap); diff --git a/src/mame/drivers/wecleman.cpp b/src/mame/drivers/wecleman.cpp index 4f5bac41fc5..cd63386c90b 100644 --- a/src/mame/drivers/wecleman.cpp +++ b/src/mame/drivers/wecleman.cpp @@ -969,7 +969,7 @@ static const gfx_layout wecleman_bg_layout = 8*8 }; -static const UINT32 wecleman_road_layout_xoffset[64] = +static const uint32_t wecleman_road_layout_xoffset[64] = { 0,7,6,5,4,3,2,1, 8,15,14,13,12,11,10,9, @@ -1007,7 +1007,7 @@ GFXDECODE_END Hot Chase Graphics Layout ***************************************************************************/ -static const UINT32 hotchase_road_layout_xoffset[64] = +static const uint32_t hotchase_road_layout_xoffset[64] = { 0*4,0*4,1*4,1*4,2*4,2*4,3*4,3*4,4*4,4*4,5*4,5*4,6*4,6*4,7*4,7*4, 8*4,8*4,9*4,9*4,10*4,10*4,11*4,11*4,12*4,12*4,13*4,13*4,14*4,14*4,15*4,15*4, @@ -1361,22 +1361,22 @@ void wecleman_state::wecleman_unpack_sprites() { const char *region = "gfx1"; // sprites - const UINT32 len = memregion(region)->bytes(); - UINT8 *src = memregion(region)->base() + len / 2 - 1; - UINT8 *dst = memregion(region)->base() + len - 1; + const uint32_t len = memregion(region)->bytes(); + uint8_t *src = memregion(region)->base() + len / 2 - 1; + uint8_t *dst = memregion(region)->base() + len - 1; while(dst > src) { - UINT8 data = *src--; + uint8_t data = *src--; if( (data&0xf0) == 0xf0 ) data &= 0x0f; if( (data&0x0f) == 0x0f ) data &= 0xf0; *dst-- = data & 0xF; *dst-- = data >> 4; } } -void wecleman_state::bitswap(UINT8 *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0) +void wecleman_state::bitswap(uint8_t *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0) { - std::vector buffer(len); + std::vector buffer(len); int i; memcpy(&buffer[0],src,len); @@ -1391,8 +1391,8 @@ void wecleman_state::bitswap(UINT8 *src,size_t len,int _14,int _13,int _12,int _ DRIVER_INIT_MEMBER(wecleman_state,wecleman) { int i, len; - UINT8 *RAM; -// UINT16 *RAM1 = (UINT16 *) memregion("maincpu")->base(); /* Main CPU patches */ + uint8_t *RAM; +// uint16_t *RAM1 = (uint16_t *) memregion("maincpu")->base(); /* Main CPU patches */ // RAM1[0x08c2/2] = 0x601e; // faster self test /* Decode GFX Roms - Compensate for the address lines scrambling */ @@ -1651,20 +1651,20 @@ ROM_END void wecleman_state::hotchase_sprite_decode( int num16_banks, int bank_size ) { - UINT8 *base; + uint8_t *base; int i; base = memregion("gfx1")->base(); // sprites - std::vector temp( bank_size ); + std::vector temp( bank_size ); for( i = num16_banks; i >0; i-- ){ - UINT8 *finish = base + 2*bank_size*i; - UINT8 *dest = finish - 2*bank_size; + uint8_t *finish = base + 2*bank_size*i; + uint8_t *dest = finish - 2*bank_size; - UINT8 *p1 = &temp[0]; - UINT8 *p2 = &temp[bank_size/2]; + uint8_t *p1 = &temp[0]; + uint8_t *p2 = &temp[bank_size/2]; - UINT8 data; + uint8_t data; memcpy (&temp[0], base+bank_size*(i-1), bank_size); @@ -1698,7 +1698,7 @@ void wecleman_state::hotchase_sprite_decode( int num16_banks, int bank_size ) /* Unpack sprites data and do some patching */ DRIVER_INIT_MEMBER(wecleman_state,hotchase) { -// UINT16 *RAM1 = (UINT16) memregion("maincpu")->base(); /* Main CPU patches */ +// uint16_t *RAM1 = (uint16_t) memregion("maincpu")->base(); /* Main CPU patches */ // RAM[0x1140/2] = 0x0015; RAM[0x195c/2] = 0x601A; // faster self test /* Now we can unpack each nibble of the sprites into a pixel (one byte) */ diff --git a/src/mame/drivers/welltris.cpp b/src/mame/drivers/welltris.cpp index 15fa2cf250a..3890b725a77 100644 --- a/src/mame/drivers/welltris.cpp +++ b/src/mame/drivers/welltris.cpp @@ -674,7 +674,7 @@ DRIVER_INIT_MEMBER(welltris_state,welltris) { #if WELLTRIS_4P_HACK /* A Hack which shows 4 player mode in code which is disabled */ - UINT16 *RAM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *RAM = (uint16_t *)memregion("maincpu")->base(); RAM[0xB91C/2] = 0x4e71; RAM[0xB91E/2] = 0x4e71; #endif diff --git a/src/mame/drivers/wgp.cpp b/src/mame/drivers/wgp.cpp index a61cef74b61..0e8ae61a122 100644 --- a/src/mame/drivers/wgp.cpp +++ b/src/mame/drivers/wgp.cpp @@ -894,7 +894,7 @@ void wgp_state::machine_reset() m_piv_scrolly[i] = 0; } - memset(m_rotate_ctrl, 0, 8 * sizeof(UINT16)); + memset(m_rotate_ctrl, 0, 8 * sizeof(uint16_t)); } void wgp_state::machine_start() @@ -1183,7 +1183,7 @@ DRIVER_INIT_MEMBER(wgp_state,wgp) #if 0 /* Patch for coding error that causes corrupt data in sprite tilemapping area from $4083c0-847f */ - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); ROM[0x25dc / 2] = 0x0602; // faulty value is 0x0206 #endif } @@ -1191,7 +1191,7 @@ DRIVER_INIT_MEMBER(wgp_state,wgp) DRIVER_INIT_MEMBER(wgp_state,wgp2) { /* Code patches to prevent failure in memory checks */ - UINT16 *ROM = (UINT16 *)memregion("sub")->base(); + uint16_t *ROM = (uint16_t *)memregion("sub")->base(); ROM[0x8008 / 2] = 0x0; ROM[0x8010 / 2] = 0x0; } diff --git a/src/mame/drivers/wheelfir.cpp b/src/mame/drivers/wheelfir.cpp index 3f8dcc2c122..42822170f78 100644 --- a/src/mame/drivers/wheelfir.cpp +++ b/src/mame/drivers/wheelfir.cpp @@ -222,7 +222,7 @@ static const int NUM_COLORS=256; struct scroll_info { - INT32 x,y,unkbits; + int32_t x,y,unkbits; }; @@ -243,26 +243,26 @@ public: required_device m_screen; required_device m_palette; - std::unique_ptr m_zoom_table; - std::unique_ptr m_blitter_data; + std::unique_ptr m_zoom_table; + std::unique_ptr m_blitter_data; - std::unique_ptr m_palette_ptr; - INT32 m_palpos; + std::unique_ptr m_palette_ptr; + int32_t m_palpos; scroll_info *m_scanlines; - INT32 m_direct_write_x0; - INT32 m_direct_write_x1; - INT32 m_direct_write_y0; - INT32 m_direct_write_y1; - INT32 m_direct_write_idx; + int32_t m_direct_write_x0; + int32_t m_direct_write_x1; + int32_t m_direct_write_y0; + int32_t m_direct_write_y1; + int32_t m_direct_write_idx; - INT16 m_scanline_cnt; + int16_t m_scanline_cnt; std::unique_ptr m_tmp_bitmap[2]; - INT32 get_scale(INT32 index) + int32_t get_scale(int32_t index) { while(indexset_input_line(1, HOLD_LINE); { - UINT8 *rom = memregion("gfx1")->base(); + uint8_t *rom = memregion("gfx1")->base(); int width = m_screen->width(); int height = m_screen->height(); @@ -523,14 +523,14 @@ void wheelfir_state::video_start() m_tmp_bitmap[1] = std::make_unique(512, 512); } -UINT32 wheelfir_state::screen_update_wheelfir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t wheelfir_state::screen_update_wheelfir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); for(int y=cliprect.min_y; y < cliprect.max_y; y++) { - UINT16 *source = &m_tmp_bitmap[LAYER_BG]->pix16(( (m_scanlines[y].y)&511)); - UINT16 *dest = &bitmap.pix16(y); + uint16_t *source = &m_tmp_bitmap[LAYER_BG]->pix16(( (m_scanlines[y].y)&511)); + uint16_t *dest = &bitmap.pix16(y); for (int x = cliprect.min_x; x < cliprect.max_x; x++) { @@ -586,8 +586,8 @@ WRITE16_MEMBER(wheelfir_state::wheelfir_7c0000_w) { if (ACCESSING_BITS_8_15) { - //{UINT16 x = data & 0xf800; static int y = -1; if (x != y) { y = x; printf("%s wheelfir_7c0000_w %d%d%d%d%d\n", machine().describe_context(), BIT(data, 15), BIT(data, 14), BIT(data, 13), BIT(data, 12), BIT(data, 11)); }} - //{UINT16 x = data & 0x0700; static int y = -1; if (x != y) { y = x; printf("%s eeprom write %d%d%d\n", machine().describe_context(), BIT(data, 10), BIT(data, 9), BIT(data, 8)); }} + //{uint16_t x = data & 0xf800; static int y = -1; if (x != y) { y = x; printf("%s wheelfir_7c0000_w %d%d%d%d%d\n", machine().describe_context(), BIT(data, 15), BIT(data, 14), BIT(data, 13), BIT(data, 12), BIT(data, 11)); }} + //{uint16_t x = data & 0x0700; static int y = -1; if (x != y) { y = x; printf("%s eeprom write %d%d%d\n", machine().describe_context(), BIT(data, 10), BIT(data, 9), BIT(data, 8)); }} m_eeprom->di_write(BIT(data, 9)); m_eeprom->clk_write(BIT(data, 8)); m_eeprom->cs_write(BIT(data, 10)); @@ -603,7 +603,7 @@ WRITE16_MEMBER(wheelfir_state::wheelfir_7c0000_w) READ16_MEMBER(wheelfir_state::wheelfir_7c0000_r) { - UINT16 data = 0; + uint16_t data = 0; if (ACCESSING_BITS_8_15) { @@ -735,11 +735,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(wheelfir_state::scanline_timer_callback) void wheelfir_state::machine_start() { - m_zoom_table = std::make_unique(ZOOM_TABLE_SIZE); - m_blitter_data = std::make_unique(16); + m_zoom_table = std::make_unique(ZOOM_TABLE_SIZE); + m_blitter_data = std::make_unique(16); - m_scanlines = reinterpret_cast(auto_alloc_array(machine(), UINT8, sizeof(scroll_info)*(NUM_SCANLINES+NUM_VBLANK_LINES))); - m_palette_ptr = std::make_unique(NUM_COLORS*3); + m_scanlines = reinterpret_cast(auto_alloc_array(machine(), uint8_t, sizeof(scroll_info)*(NUM_SCANLINES+NUM_VBLANK_LINES))); + m_palette_ptr = std::make_unique(NUM_COLORS*3); for(int i=0;i<(ZOOM_TABLE_SIZE);++i) @@ -747,7 +747,7 @@ void wheelfir_state::machine_start() m_zoom_table[i]=-1; } - UINT16 *ROM = (UINT16 *)memregion("maincpu")->base(); + uint16_t *ROM = (uint16_t *)memregion("maincpu")->base(); for(int j=0;j<400;++j) { diff --git a/src/mame/drivers/whitestar.cpp b/src/mame/drivers/whitestar.cpp index ea79bbe92cd..592afc5ccd4 100644 --- a/src/mame/drivers/whitestar.cpp +++ b/src/mame/drivers/whitestar.cpp @@ -27,10 +27,10 @@ public: required_device m_decobsmt; required_device m_decodmd; - UINT8 m_dmd_latch; - UINT8 m_dmd_ctrl; - UINT8 m_dmd_status; - UINT8 m_dmd_busy; + uint8_t m_dmd_latch; + uint8_t m_dmd_ctrl; + uint8_t m_dmd_status; + uint8_t m_dmd_busy; DECLARE_WRITE8_MEMBER(bank_w); DECLARE_WRITE8_MEMBER(dmddata_w); diff --git a/src/mame/drivers/wicat.cpp b/src/mame/drivers/wicat.cpp index 207c048e7c8..eb38f24b0ce 100644 --- a/src/mame/drivers/wicat.cpp +++ b/src/mame/drivers/wicat.cpp @@ -97,7 +97,7 @@ public: DECLARE_WRITE_LINE_MEMBER(kb_data_ready); I8275_DRAW_CHARACTER_MEMBER(wicat_display_pixels); - required_shared_ptr m_vram; + required_shared_ptr m_vram; required_device m_maincpu; required_device m_rtc; required_device m_via; @@ -119,7 +119,7 @@ public: required_memory_region m_chargen; required_device m_fdc; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -129,7 +129,7 @@ private: virtual void driver_start() override; void poll_kb(); - void send_key(UINT8 val); + void send_key(uint8_t val); emu_timer* m_video_timer; emu_timer* m_kb_timer; @@ -138,15 +138,15 @@ private: static const device_timer_id KB_TIMER = 1; static const device_timer_id KB_SERIAL_TIMER = 2; - UINT8 m_portA; - UINT8 m_portB; + uint8_t m_portA; + uint8_t m_portB; bool m_video_timer_irq; bool m_video_kb_irq; - UINT8 m_nmi_enable; - UINT8 m_crtc_irq; - UINT16 m_kb_data; - UINT8 m_kb_bit; - UINT32 m_kb_keys[8]; + uint8_t m_nmi_enable; + uint8_t m_crtc_irq; + uint16_t m_kb_data; + uint8_t m_kb_bit; + uint32_t m_kb_keys[8]; }; @@ -337,10 +337,10 @@ void wicat_state::device_timer(emu_timer &timer, device_timer_id id, int param, void wicat_state::poll_kb() { - UINT8 line; - UINT8 val = 0; - UINT8 x; - UINT32 data; + uint8_t line; + uint8_t val = 0; + uint8_t x; + uint32_t data; char kbtag[8]; for(line=0;line<8;line++) @@ -361,7 +361,7 @@ void wicat_state::poll_kb() } } -void wicat_state::send_key(UINT8 val) +void wicat_state::send_key(uint8_t val) { // based on settings in the terminal NOVRAM, the keyboard is using 1200 baud, 7 bits, 2 stop bits logerror("Sending key %i\n",val); @@ -489,7 +489,7 @@ WRITE8_MEMBER(wicat_state::hdc_w) READ8_MEMBER(wicat_state::fdc_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; popmessage("FDC: read offset %02x",offset); switch(offset) @@ -600,25 +600,25 @@ WRITE8_MEMBER(wicat_state::video_dma_w) READ8_MEMBER(wicat_state::video_uart0_r) { - UINT16 noff = offset >> 1; + uint16_t noff = offset >> 1; return m_videouart0->read(space,noff); } WRITE8_MEMBER(wicat_state::video_uart0_w) { - UINT16 noff = offset >> 1; + uint16_t noff = offset >> 1; m_videouart0->write(space,noff,data); } READ8_MEMBER(wicat_state::video_uart1_r) { - UINT16 noff = offset >> 1; + uint16_t noff = offset >> 1; return m_videouart1->read(space,noff); } WRITE8_MEMBER(wicat_state::video_uart1_w) { - UINT16 noff = offset >> 1; + uint16_t noff = offset >> 1; m_videouart1->write(space,noff,data); } @@ -659,7 +659,7 @@ WRITE8_MEMBER(wicat_state::videosram_recall_w) READ8_MEMBER(wicat_state::video_timer_r) { - UINT8 ret = 0x00; + uint8_t ret = 0x00; if(offset == 0x00) { @@ -741,7 +741,7 @@ WRITE_LINE_MEMBER(wicat_state::crtc_cb) I8275_DRAW_CHARACTER_MEMBER(wicat_state::wicat_display_pixels) { - UINT8 romdata = m_chargen->base()[((charcode << 4) | linecount) + 1]; + uint8_t romdata = m_chargen->base()[((charcode << 4) | linecount) + 1]; const pen_t *pen = m_palette->pens(); for (int i = 0; i < 8; i++) diff --git a/src/mame/drivers/wico.cpp b/src/mame/drivers/wico.cpp index bd518a2f126..4c7663f0304 100644 --- a/src/mame/drivers/wico.cpp +++ b/src/mame/drivers/wico.cpp @@ -70,12 +70,12 @@ private: bool m_gten; bool m_disp_on; bool m_diag_on; - UINT8 m_firqtimer; - UINT8 m_diag_segments; + uint8_t m_firqtimer; + uint8_t m_diag_segments; virtual void machine_reset() override; required_device m_ccpu; required_device m_hcpu; - required_shared_ptr m_shared_ram; + required_shared_ptr m_shared_ram; }; // housekeeping cpu @@ -322,7 +322,7 @@ WRITE8_MEMBER( wico_state::msols_w ) // write to diagnostic display WRITE8_MEMBER( wico_state::muxen_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 }; // MC14495 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 }; // MC14495 m_diag_segments = patterns[data>>4]; @@ -358,7 +358,7 @@ READ8_MEMBER( wico_state::switch_r ) char kbdrow[8]; offset = m_shared_ram[0x95]; sprintf(kbdrow,"X%X",offset); - UINT8 data = ioport(kbdrow)->read(); + uint8_t data = ioport(kbdrow)->read(); // Reflex solenoids - operated directly by the switches without needing the cpu if ((offset==2) && (data & 15)) diff --git a/src/mame/drivers/wildpkr.cpp b/src/mame/drivers/wildpkr.cpp index 1e5ca947030..b7bfb266624 100644 --- a/src/mame/drivers/wildpkr.cpp +++ b/src/mame/drivers/wildpkr.cpp @@ -184,7 +184,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(wildpkr); - UINT32 screen_update_wildpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wildpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -196,7 +196,7 @@ void wildpkr_state::video_start() { } -UINT32 wildpkr_state::screen_update_wildpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t wildpkr_state::screen_update_wildpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/williams.cpp b/src/mame/drivers/williams.cpp index 2489ed1de5c..fcefa160755 100644 --- a/src/mame/drivers/williams.cpp +++ b/src/mame/drivers/williams.cpp @@ -2996,7 +2996,7 @@ DRIVER_INIT_MEMBER(williams_state,defender) DRIVER_INIT_MEMBER(williams_state,defndjeu) { - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); int i; CONFIGURE_BLITTER(WILLIAMS_BLITTER_NONE, 0x0000); diff --git a/src/mame/drivers/wink.cpp b/src/mame/drivers/wink.cpp index 44780a64522..3648378aa2a 100644 --- a/src/mame/drivers/wink.cpp +++ b/src/mame/drivers/wink.cpp @@ -33,11 +33,11 @@ public: required_device m_audiocpu; required_device m_gfxdecode; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; - UINT8 m_sound_flag; - UINT8 m_tile_bank; + uint8_t m_sound_flag; + uint8_t m_tile_bank; DECLARE_WRITE8_MEMBER(bgram_w); DECLARE_WRITE8_MEMBER(player_mux_w); @@ -57,7 +57,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_wink(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wink(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(wink_sound); }; @@ -65,7 +65,7 @@ public: TILE_GET_INFO_MEMBER(wink_state::get_bg_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int code = videoram[tile_index]; code |= 0x200 * m_tile_bank; @@ -83,7 +83,7 @@ void wink_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(wink_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 wink_state::screen_update_wink(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t wink_state::screen_update_wink(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -91,7 +91,7 @@ UINT32 wink_state::screen_update_wink(screen_device &screen, bitmap_ind16 &bitma WRITE8_MEMBER(wink_state::bgram_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); } @@ -426,9 +426,9 @@ ROM_END DRIVER_INIT_MEMBER(wink_state,wink) { - UINT32 i; - UINT8 *ROM = memregion("maincpu")->base(); - std::vector buffer(0x8000); + uint32_t i; + uint8_t *ROM = memregion("maincpu")->base(); + std::vector buffer(0x8000); // protection module reverse engineered by HIGHWAYMAN diff --git a/src/mame/drivers/witch.cpp b/src/mame/drivers/witch.cpp index c488382a987..d9b9054d903 100644 --- a/src/mame/drivers/witch.cpp +++ b/src/mame/drivers/witch.cpp @@ -262,19 +262,19 @@ public: required_device m_subcpu; required_device m_gfxdecode; - required_shared_ptr m_gfx0_vram; - required_shared_ptr m_gfx0_cram; - required_shared_ptr m_gfx1_vram; - required_shared_ptr m_gfx1_cram; - required_shared_ptr m_sprite_ram; + required_shared_ptr m_gfx0_vram; + required_shared_ptr m_gfx0_cram; + required_shared_ptr m_gfx1_vram; + required_shared_ptr m_gfx1_cram; + required_shared_ptr m_sprite_ram; required_device m_palette; required_device m_hopper; int m_scrollx; int m_scrolly; - UINT8 m_reg_a002; - UINT8 m_motor_active; + uint8_t m_reg_a002; + uint8_t m_motor_active; DECLARE_WRITE8_MEMBER(gfx0_vram_w); DECLARE_WRITE8_MEMBER(gfx0_cram_w); DECLARE_WRITE8_MEMBER(gfx1_vram_w); @@ -294,7 +294,7 @@ public: TILE_GET_INFO_MEMBER(get_gfx0a_tile_info); TILE_GET_INFO_MEMBER(get_gfx1_tile_info); virtual void video_start() override; - UINT32 screen_update_witch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_witch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void machine_reset() override; }; @@ -744,7 +744,7 @@ void witch_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) } -UINT32 witch_state::screen_update_witch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t witch_state::screen_update_witch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_gfx1_tilemap->set_scrollx(0, m_scrollx-7 ); //offset to have it aligned with the sprites m_gfx1_tilemap->set_scrolly(0, m_scrolly+8 ); diff --git a/src/mame/drivers/wiz.cpp b/src/mame/drivers/wiz.cpp index bef40970050..58176d6c474 100644 --- a/src/mame/drivers/wiz.cpp +++ b/src/mame/drivers/wiz.cpp @@ -1122,7 +1122,7 @@ ROM_END DRIVER_INIT_MEMBER(wiz_state,stinger) { - static const UINT8 swap_xor_table[4][4] = + static const uint8_t swap_xor_table[4][4] = { { 7,3,5, 0xa0 }, { 3,7,5, 0x88 }, @@ -1130,13 +1130,13 @@ DRIVER_INIT_MEMBER(wiz_state,stinger) { 5,7,3, 0x28 } }; - UINT8 *rom = memregion("maincpu")->base(); - const UINT8 *tbl; + uint8_t *rom = memregion("maincpu")->base(); + const uint8_t *tbl; for (int a = 0x0000; a < 0xc000; a++) { int row; - UINT8 src; + uint8_t src; if (a & 0x2040) { diff --git a/src/mame/drivers/wmg.cpp b/src/mame/drivers/wmg.cpp index ef0e3b3ca3a..8b0baba54f7 100644 --- a/src/mame/drivers/wmg.cpp +++ b/src/mame/drivers/wmg.cpp @@ -89,10 +89,10 @@ public: DECLARE_WRITE8_MEMBER(wmg_rombank_w); DECLARE_MACHINE_RESET(wmg); DECLARE_DRIVER_INIT(wmg); - UINT8 m_wmg_bank; - UINT8 m_wmg_def_bank; - UINT8 m_wmg_port_select; - UINT8 m_wmg_vram_bank; + uint8_t m_wmg_bank; + uint8_t m_wmg_def_bank; + uint8_t m_wmg_port_select; + uint8_t m_wmg_vram_bank; DECLARE_READ8_MEMBER(wmg_nvram_r); DECLARE_WRITE8_MEMBER(wmg_nvram_w); DECLARE_READ8_MEMBER(wmg_pia_0_r); @@ -102,7 +102,7 @@ public: DECLARE_WRITE8_MEMBER(wmg_vram_select_w); DECLARE_CUSTOM_INPUT_MEMBER(wmg_mux_r); void wmg_def_install_io_space(address_space &space); - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; }; @@ -133,7 +133,7 @@ WRITE8_MEMBER( wmg_state::wmg_nvram_w ) WRITE8_MEMBER( wmg_state::wmg_rombank_w ) { address_space &space1 = m_maincpu->space(AS_PROGRAM); - UINT8 *RAM = memregion("maincpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); data &= 7; @@ -265,7 +265,7 @@ READ8_MEMBER( wmg_state::wmg_pia_0_r ) address_space &space1 = m_maincpu->space(AS_PROGRAM); pia6821_device *pia_0 = space1.machine().device("pia_0"); - UINT8 data = pia_0->read(space1, offset); + uint8_t data = pia_0->read(space1, offset); if ((m_wmg_bank) && (!offset) && ((data & 0x30) == 0x30)) // P1 and P2 pressed { @@ -510,8 +510,8 @@ MACHINE_CONFIG_END *************************************/ DRIVER_INIT_MEMBER( wmg_state, wmg ) { - UINT8 *RAM = memregion("maincpu")->base(); - UINT8 *ROM = memregion("soundcpu")->base(); + uint8_t *RAM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("soundcpu")->base(); membank("bank5")->configure_entries(0, 8, &RAM[0x2d000], 0x10000); /* Code */ membank("bank6")->configure_entries(0, 8, &ROM[0x10000], 0x1000); /* Sound */ membank("bank7")->configure_entries(1, 4, &RAM[0x78000], 0x1000); /* Defender roms */ diff --git a/src/mame/drivers/wms.cpp b/src/mame/drivers/wms.cpp index 21f56ca3a3d..c196ba7559a 100644 --- a/src/mame/drivers/wms.cpp +++ b/src/mame/drivers/wms.cpp @@ -95,7 +95,7 @@ public: DECLARE_DRIVER_INIT(wms); DECLARE_READ8_MEMBER(test_r); - UINT32 screen_update_wms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: @@ -105,7 +105,7 @@ protected: private: }; -UINT32 wms_state::screen_update_wms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t wms_state::screen_update_wms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/wolfpack.cpp b/src/mame/drivers/wolfpack.cpp index 2f3eee098d8..dc6beaf56e0 100644 --- a/src/mame/drivers/wolfpack.cpp +++ b/src/mame/drivers/wolfpack.cpp @@ -55,7 +55,7 @@ CUSTOM_INPUT_MEMBER(wolfpack_state::wolfpack_dial_r) READ8_MEMBER(wolfpack_state::wolfpack_misc_r) { - UINT8 val = 0; + uint8_t val = 0; /* BIT0 => SPEECH BUSY */ /* BIT1 => COMP SIREN */ @@ -216,7 +216,7 @@ static const gfx_layout tile_layout = 0x80 }; -static const UINT32 ship_layout_xoffset[64] = +static const uint32_t ship_layout_xoffset[64] = { 0x04, 0x05, 0x06, 0x07, 0x0c, 0x0d, 0x0e, 0x0f, 0x14, 0x15, 0x16, 0x17, 0x1c, 0x1d, 0x1e, 0x1f, @@ -244,7 +244,7 @@ static const gfx_layout ship_layout = nullptr }; -static const UINT32 pt_layout_xoffset[64] = +static const uint32_t pt_layout_xoffset[64] = { 0x3f, 0x3f, 0x3e, 0x3e, 0x3d, 0x3d, 0x3c, 0x3c, 0x37, 0x37, 0x36, 0x36, 0x35, 0x35, 0x34, 0x34, diff --git a/src/mame/drivers/wpc_95.cpp b/src/mame/drivers/wpc_95.cpp index eb305804a4c..ed1014c5658 100644 --- a/src/mame/drivers/wpc_95.cpp +++ b/src/mame/drivers/wpc_95.cpp @@ -64,7 +64,7 @@ protected: required_device maincpu; required_device dcs; required_memory_bank rombank; - required_shared_ptr mainram; + required_shared_ptr mainram; required_device nvram; required_device pic; required_device lamp; @@ -104,15 +104,15 @@ private: static const char *const lamps_ttt[64]; static const char *const outputs_ttt[52]; - UINT8 firq_src, zc; - UINT16 rtc_base_day; + uint8_t firq_src, zc; + uint16_t rtc_base_day; bool serial_clock_state, serial_data1_state, serial_data2_state, serial_enable; int serial_clock_counter; - UINT32 serial_out1_state, serial_out2_state; + uint32_t serial_out1_state, serial_out2_state; bool afm_led_handler(int sid, bool state); - void sc_aux_lamps_handler_update(UINT32 &out, UINT32 mask, bool state, int id); + void sc_aux_lamps_handler_update(uint32_t &out, uint32_t mask, bool state, int id); bool sc_aux_lamps_handler(int sid, bool state); }; @@ -184,9 +184,9 @@ READ8_MEMBER(wpc_95_state::rtc_r) // This may get wonky if the game is running on year change. Find // something better to do at that time. - UINT8 day = (systime.local_time.day - rtc_base_day) & 31; - UINT8 hour = systime.local_time.hour; - UINT8 min = systime.local_time.minute; + uint8_t day = (systime.local_time.day - rtc_base_day) & 31; + uint8_t hour = systime.local_time.hour; + uint8_t min = systime.local_time.minute; switch(offset) { case 0: @@ -205,7 +205,7 @@ READ8_MEMBER(wpc_95_state::firq_src_r) READ8_MEMBER(wpc_95_state::zc_r) { - UINT8 res = zc; + uint8_t res = zc; zc &= 0x7f; return res; } @@ -258,7 +258,7 @@ void wpc_95_state::machine_reset() mainram[0x1804] = systime.local_time.weekday+1; mainram[0x1805] = 0; mainram[0x1806] = 1; - UINT16 checksum = 0; + uint16_t checksum = 0; for(int i=0x1800; i<=0x1806; i++) checksum += mainram[i]; checksum = ~checksum; @@ -297,7 +297,7 @@ bool wpc_95_state::afm_led_handler(int sid, bool state) switch(sid) { case 37: if(!serial_clock_state && state) { - UINT16 mask = 1 << serial_clock_counter; + uint16_t mask = 1 << serial_clock_counter; bool prev_state = serial_out1_state & mask; if(prev_state != serial_data1_state) { char buffer[32]; @@ -320,7 +320,7 @@ bool wpc_95_state::afm_led_handler(int sid, bool state) return false; } -void wpc_95_state::sc_aux_lamps_handler_update(UINT32 &out, UINT32 mask, bool state, int id) +void wpc_95_state::sc_aux_lamps_handler_update(uint32_t &out, uint32_t mask, bool state, int id) { bool prev_state = out & mask; if(prev_state != state) { @@ -344,7 +344,7 @@ bool wpc_95_state::sc_aux_lamps_handler(int sid, bool state) case 38: if(!serial_clock_state && state && !serial_enable) { - UINT32 mask = 1 << serial_clock_counter; + uint32_t mask = 1 << serial_clock_counter; sc_aux_lamps_handler_update(serial_out1_state, mask, serial_data1_state, serial_clock_counter); sc_aux_lamps_handler_update(serial_out2_state, mask, serial_data2_state, serial_clock_counter+24); serial_clock_counter++; diff --git a/src/mame/drivers/wpc_an.cpp b/src/mame/drivers/wpc_an.cpp index 2f10e967a4e..f584fd6ac50 100644 --- a/src/mame/drivers/wpc_an.cpp +++ b/src/mame/drivers/wpc_an.cpp @@ -54,10 +54,10 @@ public: DECLARE_WRITE8_MEMBER(wpc_sound_s11_w); DECLARE_WRITE8_MEMBER(wpc_rombank_w); private: - UINT16 m_vblank_count; - UINT32 m_irq_count; - UINT8 m_bankmask; - UINT8 m_ram[0x3000]; + uint16_t m_vblank_count; + uint32_t m_irq_count; + uint8_t m_bankmask; + uint8_t m_ram[0x3000]; emu_timer* m_vblank_timer; emu_timer* m_irq_timer; }; @@ -296,9 +296,9 @@ void wpc_an_state::machine_reset() DRIVER_INIT_MEMBER(wpc_an_state,wpc_an) { - UINT8 *ROM = memregion("maincpu")->base(); - UINT8 *fixed = memregion("fixed")->base(); - UINT32 codeoff = memregion("maincpu")->bytes() - 0x8000; + uint8_t *ROM = memregion("maincpu")->base(); + uint8_t *fixed = memregion("fixed")->base(); + uint32_t codeoff = memregion("maincpu")->bytes() - 0x8000; m_cpubank->configure_entries(0, 32, &ROM[0x10000], 0x4000); m_cpubank->set_entry(0); m_vblank_timer = timer_alloc(TIMER_VBLANK); diff --git a/src/mame/drivers/wpc_dcs.cpp b/src/mame/drivers/wpc_dcs.cpp index 1b7dff30a28..46956e32f69 100644 --- a/src/mame/drivers/wpc_dcs.cpp +++ b/src/mame/drivers/wpc_dcs.cpp @@ -57,7 +57,7 @@ protected: required_device maincpu; required_device dcs; required_memory_bank rombank; - required_shared_ptr mainram; + required_shared_ptr mainram; required_device nvram; required_device lamp; required_device out; @@ -67,8 +67,8 @@ protected: virtual void machine_reset() override; private: - UINT8 firq_src, zc, switch_col; - UINT16 rtc_base_day; + uint8_t firq_src, zc, switch_col; + uint16_t rtc_base_day; }; static ADDRESS_MAP_START( wpc_dcs_map, AS_PROGRAM, 8, wpc_dcs_state ) @@ -132,7 +132,7 @@ WRITE8_MEMBER(wpc_dcs_state::dcs_reset_w) READ8_MEMBER(wpc_dcs_state::switches_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; for(int i=0; i<8; i++) if(switch_col & (1 << i)) res &= swarray[i]->read(); @@ -152,9 +152,9 @@ READ8_MEMBER(wpc_dcs_state::rtc_r) // This may get wonky if the game is running on year change. Find // something better to do at that time. - UINT8 day = (systime.local_time.day - rtc_base_day) & 31; - UINT8 hour = systime.local_time.hour; - UINT8 min = systime.local_time.minute; + uint8_t day = (systime.local_time.day - rtc_base_day) & 31; + uint8_t hour = systime.local_time.hour; + uint8_t min = systime.local_time.minute; switch(offset) { case 0: @@ -173,7 +173,7 @@ READ8_MEMBER(wpc_dcs_state::firq_src_r) READ8_MEMBER(wpc_dcs_state::zc_r) { - UINT8 res = zc; + uint8_t res = zc; zc &= 0x7f; return res; } @@ -229,7 +229,7 @@ void wpc_dcs_state::machine_reset() mainram[0x1804] = systime.local_time.weekday+1; mainram[0x1805] = 0; mainram[0x1806] = 1; - UINT16 checksum = 0; + uint16_t checksum = 0; for(int i=0x1800; i<=0x1806; i++) checksum += mainram[i]; checksum = ~checksum; diff --git a/src/mame/drivers/wpc_dot.cpp b/src/mame/drivers/wpc_dot.cpp index 98b5833d08b..bb93c30936f 100644 --- a/src/mame/drivers/wpc_dot.cpp +++ b/src/mame/drivers/wpc_dot.cpp @@ -160,8 +160,8 @@ void wpc_dot_state::machine_reset() DRIVER_INIT_MEMBER(wpc_dot_state,wpc_dot) { - UINT8 *fixed = memregion("code")->base(); - UINT32 codeoff = memregion("code")->bytes() - 0x8000; + uint8_t *fixed = memregion("code")->base(); + uint32_t codeoff = memregion("code")->bytes() - 0x8000; m_cpubank->configure_entries(0, 64, &fixed[0], 0x4000); m_cpubank->set_entry(0); m_fixedbank->configure_entries(0, 1, &fixed[codeoff],0x8000); @@ -209,7 +209,7 @@ WRITE8_MEMBER(wpc_dot_state::wpc_rombank_w) WRITE8_MEMBER(wpc_dot_state::wpc_dmdbank_w) { - UINT8 page = offset >> 4; + uint8_t page = offset >> 4; switch(offset & 0x07) { @@ -273,11 +273,11 @@ WRITE8_MEMBER(wpc_dot_state::wpc_sound_data_w) m_wpcsnd->data_w(data); } -UINT32 wpc_dot_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t wpc_dot_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 x,y,bit; - UINT32 offset = (m_wpc->get_visible_page() * 0x200); - UINT32 col; + uint8_t x,y,bit; + uint32_t offset = (m_wpc->get_visible_page() * 0x200); + uint32_t col; for(y=0;y<32;y++) // scanline { diff --git a/src/mame/drivers/wpc_s.cpp b/src/mame/drivers/wpc_s.cpp index ce4126b6db1..40a2c9604ce 100644 --- a/src/mame/drivers/wpc_s.cpp +++ b/src/mame/drivers/wpc_s.cpp @@ -60,7 +60,7 @@ protected: required_device maincpu; required_device dcs; required_memory_bank rombank; - required_shared_ptr mainram; + required_shared_ptr mainram; required_device nvram; required_device pic; required_device lamp; @@ -94,8 +94,8 @@ private: static const char *const outputs_wd[54]; static const char *const lamps_wcs[64]; static const char *const outputs_wcs[54]; - UINT8 firq_src, zc; - UINT16 rtc_base_day; + uint8_t firq_src, zc; + uint16_t rtc_base_day; }; static ADDRESS_MAP_START( wpc_s_map, AS_PROGRAM, 8, wpc_s_state ) @@ -166,9 +166,9 @@ READ8_MEMBER(wpc_s_state::rtc_r) // This may get wonky if the game is running on year change. Find // something better to do at that time. - UINT8 day = (systime.local_time.day - rtc_base_day) & 31; - UINT8 hour = systime.local_time.hour; - UINT8 min = systime.local_time.minute; + uint8_t day = (systime.local_time.day - rtc_base_day) & 31; + uint8_t hour = systime.local_time.hour; + uint8_t min = systime.local_time.minute; switch(offset) { case 0: @@ -187,7 +187,7 @@ READ8_MEMBER(wpc_s_state::firq_src_r) READ8_MEMBER(wpc_s_state::zc_r) { - UINT8 res = zc; + uint8_t res = zc; zc &= 0x7f; return res; } @@ -242,7 +242,7 @@ void wpc_s_state::machine_reset() mainram[0x1804] = systime.local_time.weekday+1; mainram[0x1805] = 0; mainram[0x1806] = 1; - UINT16 checksum = 0; + uint16_t checksum = 0; for(int i=0x1800; i<=0x1806; i++) checksum += mainram[i]; checksum = ~checksum; diff --git a/src/mame/drivers/wrally.cpp b/src/mame/drivers/wrally.cpp index 09f236cded1..6281a5b1f32 100644 --- a/src/mame/drivers/wrally.cpp +++ b/src/mame/drivers/wrally.cpp @@ -133,14 +133,14 @@ ADDRESS_MAP_END READ8_MEMBER(wrally_state::dallas_share_r) { - UINT8 *shareram = (UINT8 *)m_shareram.target(); + uint8_t *shareram = (uint8_t *)m_shareram.target(); return shareram[BYTE_XOR_BE(offset)]; } WRITE8_MEMBER(wrally_state::dallas_share_w) { - UINT8 *shareram = (UINT8 *)m_shareram.target(); + uint8_t *shareram = (uint8_t *)m_shareram.target(); shareram[BYTE_XOR_BE(offset)] = data; } diff --git a/src/mame/drivers/wswan.cpp b/src/mame/drivers/wswan.cpp index 579b8b696d5..eefe1152eff 100644 --- a/src/mame/drivers/wswan.cpp +++ b/src/mame/drivers/wswan.cpp @@ -81,7 +81,7 @@ PALETTE_INIT_MEMBER(wswan_state, wswan) { for (int i = 0; i < 16; i++) { - UINT8 shade = i * (256 / 16); + uint8_t shade = i * (256 / 16); palette.set_pen_color(15 - i, shade, shade, shade); } } diff --git a/src/mame/drivers/wyvernf0.cpp b/src/mame/drivers/wyvernf0.cpp index 426ef90894b..9982bacc5bb 100644 --- a/src/mame/drivers/wyvernf0.cpp +++ b/src/mame/drivers/wyvernf0.cpp @@ -52,29 +52,29 @@ public: m_soundlatch(*this, "soundlatch") { } // memory pointers - required_shared_ptr m_bgram; - required_shared_ptr m_fgram; - required_shared_ptr m_scrollram; - required_shared_ptr m_spriteram; + required_shared_ptr m_bgram; + required_shared_ptr m_fgram; + required_shared_ptr m_scrollram; + required_shared_ptr m_spriteram; // video-related tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - std::unique_ptr m_objram; + std::unique_ptr m_objram; TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); DECLARE_WRITE8_MEMBER(bgram_w); DECLARE_WRITE8_MEMBER(fgram_w); DECLARE_VIDEO_START(wyvernf0); - UINT32 screen_update_wyvernf0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wyvernf0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, bool is_foreground ); // misc int m_sound_nmi_enable; int m_pending_nmi; - UINT8 m_rombank; - UINT8 m_rambank; + uint8_t m_rombank; + uint8_t m_rambank; DECLARE_WRITE8_MEMBER(rambank_w); DECLARE_WRITE8_MEMBER(rombank_w); @@ -86,7 +86,7 @@ public: TIMER_CALLBACK_MEMBER(nmi_callback); // MCU - UINT8 m_mcu_val, m_mcu_ready; + uint8_t m_mcu_val, m_mcu_ready; DECLARE_READ8_MEMBER(fake_mcu_r); DECLARE_WRITE8_MEMBER(fake_mcu_w); @@ -188,7 +188,7 @@ YY XX yyyyyyyy fccccccc x???pppp xxxxxxxx */ - UINT8 *sprram = &m_spriteram[ is_foreground ? m_spriteram.bytes()/2 : 0 ]; + uint8_t *sprram = &m_spriteram[ is_foreground ? m_spriteram.bytes()/2 : 0 ]; // sy = 0 -> on the left for (offs = 0; offs < m_spriteram.bytes() / 2; offs += 4) @@ -238,7 +238,7 @@ yyyyyyyy fccccccc x???pppp xxxxxxxx } } -UINT32 wyvernf0_state::screen_update_wyvernf0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t wyvernf0_state::screen_update_wyvernf0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = -1; @@ -602,11 +602,11 @@ GFXDECODE_END MACHINE_START_MEMBER(wyvernf0_state,wyvernf0) { - UINT8 *ROM = memregion("rombank")->base(); + uint8_t *ROM = memregion("rombank")->base(); membank("rombank")->configure_entries(0, 8, ROM, 0x2000); // sprite codes lookup in banked RAM - m_objram = std::make_unique(0x1000 * 2); + m_objram = std::make_unique(0x1000 * 2); save_pointer(NAME(m_objram.get()), 0x1000 * 2); membank("rambank")->configure_entries(0, 2, m_objram.get(), 0x1000); diff --git a/src/mame/drivers/x07.cpp b/src/mame/drivers/x07.cpp index 9181618dd37..e39d049a4f1 100644 --- a/src/mame/drivers/x07.cpp +++ b/src/mame/drivers/x07.cpp @@ -35,7 +35,7 @@ T6834 IMPLEMENTATION ***************************************************************************/ -void x07_state::t6834_cmd (UINT8 cmd) +void x07_state::t6834_cmd (uint8_t cmd) { switch (cmd) { @@ -59,7 +59,7 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x02: //STICK { - UINT8 data; + uint8_t data; switch (ioport("S1")->read() & 0x3c) { @@ -87,8 +87,8 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x05: //T6834 RAM read { - UINT16 address; - UINT8 data; + uint16_t address; + uint8_t data; address = m_in.data[m_in.read++]; address |= (m_in.data[m_in.read++] << 8); @@ -105,8 +105,8 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x06: //T6834 RAM write { - UINT16 address; - UINT8 data; + uint16_t address; + uint8_t data; data = m_in.data[m_in.read++]; address = m_in.data[m_in.read++]; address |= (m_in.data[m_in.read++] << 8); @@ -137,8 +137,8 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x09: //line clear { - UINT8 line = m_in.data[m_in.read++] & 3; - for(UINT8 l = line * 8; l < (line + 1) * 8; l++) + uint8_t line = m_in.data[m_in.read++] & 3; + for(uint8_t l = line * 8; l < (line + 1) * 8; l++) memset(&m_lcd_map[l][0], 0, 120); } break; @@ -167,7 +167,7 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x0f: //read LCD line { - UINT8 line = m_in.data[m_in.read++]; + uint8_t line = m_in.data[m_in.read++]; for(int i = 0; i < 120; i++) m_out.data[m_out.write++] = (line < 32) ? m_lcd_map[line][i] : 0; } @@ -175,8 +175,8 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x10: //read LCD point { - UINT8 x = m_in.data[m_in.read++]; - UINT8 y = m_in.data[m_in.read++]; + uint8_t x = m_in.data[m_in.read++]; + uint8_t y = m_in.data[m_in.read++]; if(x < 120 && y < 32) m_out.data[m_out.write++] = (m_lcd_map[y][x] ? 0xff : 0); else @@ -186,24 +186,24 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x11: //PSET { - UINT8 x = m_in.data[m_in.read++]; - UINT8 y = m_in.data[m_in.read++]; + uint8_t x = m_in.data[m_in.read++]; + uint8_t y = m_in.data[m_in.read++]; draw_point(x, y, 1); } break; case 0x12: //PRESET { - UINT8 x = m_in.data[m_in.read++]; - UINT8 y = m_in.data[m_in.read++]; + uint8_t x = m_in.data[m_in.read++]; + uint8_t y = m_in.data[m_in.read++]; draw_point(x, y, 0); } break; case 0x13: //PEOR { - UINT8 x = m_in.data[m_in.read++]; - UINT8 y = m_in.data[m_in.read++]; + uint8_t x = m_in.data[m_in.read++]; + uint8_t y = m_in.data[m_in.read++]; if(x < 120 && y < 32) m_lcd_map[y][x] = !m_lcd_map[y][x]; } @@ -211,8 +211,8 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x14: //Line { - UINT8 delta_x, delta_y, step_x, step_y, next_x, next_y, p1, p2, p3, p4; - INT16 frac; + uint8_t delta_x, delta_y, step_x, step_y, next_x, next_y, p1, p2, p3, p4; + int16_t frac; next_x = p1 = m_in.data[m_in.read++]; next_y = p2 = m_in.data[m_in.read++]; p3 = m_in.data[m_in.read++]; @@ -258,16 +258,16 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x15: //Circle { - UINT8 p1 = m_in.data[m_in.read++]; - UINT8 p2 = m_in.data[m_in.read++]; - UINT8 p3 = m_in.data[m_in.read++]; + uint8_t p1 = m_in.data[m_in.read++]; + uint8_t p2 = m_in.data[m_in.read++]; + uint8_t p3 = m_in.data[m_in.read++]; for(int x = 0, y = p3; x <= sqrt((double)(p3 * p3) / 2) ; x++) { /* * The old code produced results most likely not intended: - * UINT32 d1 = (x * x + y * y) - p3 * p3; - * UINT32 d2 = (x * x + (y - 1) * (y - 1)) - p3 * p3; + * uint32_t d1 = (x * x + y * y) - p3 * p3; + * uint32_t d2 = (x * x + (y - 1) * (y - 1)) - p3 * p3; * if(abs((double)d1) > abs((double)d2)) * * (double)(-1) = 4294967294.000000 @@ -275,8 +275,8 @@ void x07_state::t6834_cmd (UINT8 cmd) * * Therefore changed. */ - INT32 d1 = (x * x + y * y) - p3 * p3; - INT32 d2 = (x * x + (y - 1) * (y - 1)) - p3 * p3; + int32_t d1 = (x * x + y * y) - p3 * p3; + int32_t d2 = (x * x + (y - 1) * (y - 1)) - p3 * p3; if (abs(d1) > abs(d2)) y--; draw_point(x + p1, y + p2, 0x01); @@ -293,12 +293,12 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x16: //UDK write { - UINT8 pos = m_in.data[m_in.read++] - 1; - UINT8 udk_size = (pos != 5 && pos != 11) ? 0x2a : 0x2e; + uint8_t pos = m_in.data[m_in.read++] - 1; + uint8_t udk_size = (pos != 5 && pos != 11) ? 0x2a : 0x2e; for(int i = 0; i < udk_size; i++) { - UINT8 udk_char = m_in.data[m_in.read++]; + uint8_t udk_char = m_in.data[m_in.read++]; m_t6834_ram[udk_offset[pos] + i] = udk_char; if(!udk_char) break; } @@ -307,12 +307,12 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x17: //UDK read { - UINT8 pos = m_in.data[m_in.read++] - 1; - UINT8 udk_size = (pos != 5 && pos != 11) ? 0x2a : 0x2e; + uint8_t pos = m_in.data[m_in.read++] - 1; + uint8_t udk_size = (pos != 5 && pos != 11) ? 0x2a : 0x2e; for(int i = 0; i < udk_size; i++) { - UINT8 udk_char = m_t6834_ram[udk_offset[pos] + i]; + uint8_t udk_char = m_t6834_ram[udk_offset[pos] + i]; m_out.data[m_out.write++] = udk_char; if(!udk_char) break; } @@ -326,7 +326,7 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x1a: //UDC write { - UINT8 udc_code = m_in.data[m_in.read++]; + uint8_t udc_code = m_in.data[m_in.read++]; if(udc_code>=128 && udc_code<=159) for(int i = 0; i < 8; i++) @@ -339,15 +339,15 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x1b: //UDC read { - UINT16 address = m_in.data[m_in.read++] << 3; + uint16_t address = m_in.data[m_in.read++] << 3; for(int i = 0; i < 8; i++) m_out.data[m_out.write++] = get_char(address + i); } break; case 0x1c: //UDC Init { - memcpy(m_t6834_ram + 0x200, (UINT8*)memregion("gfx1")->base() + 0x400, 0x100); - memcpy(m_t6834_ram + 0x300, (UINT8*)memregion("gfx1")->base() + 0x700, 0x100); + memcpy(m_t6834_ram + 0x200, (uint8_t*)memregion("gfx1")->base() + 0x400, 0x100); + memcpy(m_t6834_ram + 0x300, (uint8_t*)memregion("gfx1")->base() + 0x700, 0x100); } break; @@ -355,7 +355,7 @@ void x07_state::t6834_cmd (UINT8 cmd) { for(int i = 0; i < 0x80; i++) { - UINT8 sp_char = m_in.data[m_in.read++]; + uint8_t sp_char = m_in.data[m_in.read++]; m_t6834_ram[0x500 + i] = sp_char; if (!sp_char) break; } @@ -366,7 +366,7 @@ void x07_state::t6834_cmd (UINT8 cmd) { for(int i = (int)strlen((char*)&m_t6834_ram[0x500]); i < 0x80; i++) { - UINT8 sp_char = m_in.data[m_in.read++]; + uint8_t sp_char = m_in.data[m_in.read++]; m_t6834_ram[0x500 + i] = sp_char; if (!sp_char) break; } @@ -382,7 +382,7 @@ void x07_state::t6834_cmd (UINT8 cmd) { for(int i = 0; i < 0x80; i++) { - UINT8 sp_data = m_t6834_ram[0x500 + i]; + uint8_t sp_data = m_t6834_ram[0x500 + i]; m_out.data[m_out.write++] = sp_data; if (!sp_data) break; } @@ -401,9 +401,9 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x24: //locate { - UINT8 x = m_in.data[m_in.read++]; - UINT8 y = m_in.data[m_in.read++]; - UINT8 char_code = m_in.data[m_in.read++]; + uint8_t x = m_in.data[m_in.read++]; + uint8_t y = m_in.data[m_in.read++]; + uint8_t char_code = m_in.data[m_in.read++]; m_locate.on = (m_locate.x != x || m_locate.y != y); m_locate.x = m_cursor.x = x; m_locate.y = m_cursor.y = y; @@ -421,8 +421,8 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x27: //test key { static const char *const lines[] = {"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "BZ", "A1"}; - UINT16 matrix; - UINT8 data = 0; + uint16_t matrix; + uint8_t data = 0; matrix = m_in.data[m_in.read++]; matrix |= (m_in.data[m_in.read++] << 8); @@ -436,7 +436,7 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x28: //test chr { - UINT8 idx = kb_get_index(m_in.data[m_in.read++]); + uint8_t idx = kb_get_index(m_in.data[m_in.read++]); m_out.data[m_out.write++] = (ioport(x07_keycodes[idx].tag)->read() & x07_keycodes[idx].mask) ? 0x00 : 0xff; } break; @@ -471,7 +471,7 @@ void x07_state::t6834_cmd (UINT8 cmd) if (m_draw_udk) draw_udk(); else - for(UINT8 l = 3 * 8; l < (3 + 1) * 8; l++) + for(uint8_t l = 3 * 8; l < (3 + 1) * 8; l++) memset(&m_lcd_map[l][0], 0, 120); } break; @@ -486,12 +486,12 @@ void x07_state::t6834_cmd (UINT8 cmd) case 0x35: //UDK cont write { - UINT8 pos = m_in.data[m_in.read++] - 1; - UINT8 udk_size = (pos != 5 && pos != 11) ? 0x2a : 0x2e; + uint8_t pos = m_in.data[m_in.read++] - 1; + uint8_t udk_size = (pos != 5 && pos != 11) ? 0x2a : 0x2e; for(int i = (int)strlen((char*)&m_t6834_ram[udk_offset[pos]]); i < udk_size; i++) { - UINT8 udk_char = m_in.data[m_in.read++]; + uint8_t udk_char = m_in.data[m_in.read++]; m_t6834_ram[udk_offset[pos] + i] = udk_char; if(!udk_char) break; } @@ -543,7 +543,7 @@ void x07_state::t6834_cmd (UINT8 cmd) { for(int cy = 0; cy < 8; cy++) { - UINT8 cl = m_in.data[m_in.read++]; + uint8_t cl = m_in.data[m_in.read++]; for(int cx = 0; cx < 6; cx++) m_lcd_map[m_cursor.y * 8 + cy][m_cursor.x * 6 + cx] = (cl & (0x80>>cx)) ? 1 : 0; @@ -555,7 +555,7 @@ void x07_state::t6834_cmd (UINT8 cmd) { for(int cy = 0; cy < 8; cy++) { - UINT8 cl = 0x00; + uint8_t cl = 0x00; for(int cx = 0; cx < 6; cx++) cl |= (m_lcd_map[m_cursor.y * 8 + cy][m_cursor.x * 6 + cx] != 0) ? (1<<(7-cx)) : 0; @@ -642,7 +642,7 @@ void x07_state::t6834_w () if (m_in.write) { - UINT8 cmd_len = t6834_cmd_len[m_in.data[m_in.read]]; + uint8_t cmd_len = t6834_cmd_len[m_in.data[m_in.read]]; if(cmd_len & 0x80) { if((cmd_len & 0x7f) < m_in.write && !m_regs_w[1]) @@ -827,9 +827,9 @@ void x07_state::receive_bit(int bit) ****************************************************/ void x07_state::printer_w() { - UINT16 char_pos = 0; -// UINT16 text_color = 0; -// UINT16 text_size = 1; + uint16_t char_pos = 0; +// uint16_t text_color = 0; +// uint16_t text_size = 1; if (m_regs_r[4] & 0x20) m_prn_char_code |= 1; @@ -886,18 +886,18 @@ void x07_state::printer_w() m_prn_char_code <<= 1; } -inline UINT8 x07_state::kb_get_index(UINT8 char_code) +inline uint8_t x07_state::kb_get_index(uint8_t char_code) { - for(UINT8 i=0 ; i< ARRAY_LENGTH(x07_keycodes); i++) + for(uint8_t i=0 ; i< ARRAY_LENGTH(x07_keycodes); i++) if (x07_keycodes[i].codes[0] == char_code) return i; return 0; } -inline UINT8 x07_state::get_char(UINT16 pos) +inline uint8_t x07_state::get_char(uint16_t pos) { - UINT8 code = pos>>3; + uint8_t code = pos>>3; if(code>=128 && code<=159) //UDC 0 { @@ -915,13 +915,13 @@ inline UINT8 x07_state::get_char(UINT16 pos) INPUT_CHANGED_MEMBER( x07_state::kb_func_keys ) { - UINT8 data = 0; - UINT8 idx = (UINT8)(uintptr_t)param; + uint8_t data = 0; + uint8_t idx = (uint8_t)(uintptr_t)param; if (m_kb_on && newval) { - UINT8 shift = (ioport("A1")->read() & 0x01); - UINT16 udk_s = udk_offset[(shift*6) + idx - 1]; + uint8_t shift = (ioport("A1")->read() & 0x01); + uint16_t udk_s = udk_offset[(shift*6) + idx - 1]; /* First 3 chars are used for description */ udk_s += 3; @@ -940,10 +940,10 @@ INPUT_CHANGED_MEMBER( x07_state::kb_func_keys ) INPUT_CHANGED_MEMBER( x07_state::kb_keys ) { - UINT8 modifier; - UINT8 a1 = ioport("A1")->read(); - UINT8 bz = ioport("BZ")->read(); - UINT8 keycode = (UINT8)(uintptr_t)param; + uint8_t modifier; + uint8_t a1 = ioport("A1")->read(); + uint8_t bz = ioport("BZ")->read(); + uint8_t keycode = (uint8_t)(uintptr_t)param; if (m_kb_on && !newval) { @@ -964,7 +964,7 @@ INPUT_CHANGED_MEMBER( x07_state::kb_keys ) if (m_kb_size < 0xff) { - UINT8 idx = kb_get_index(keycode); + uint8_t idx = kb_get_index(keycode); m_t6834_ram[0x400 + m_kb_size++] = x07_keycodes[idx].codes[modifier]; } @@ -1017,7 +1017,7 @@ void x07_state::kb_irq() Video ***************************************************************************/ -inline void x07_state::draw_char(UINT8 x, UINT8 y, UINT8 char_pos) +inline void x07_state::draw_char(uint8_t x, uint8_t y, uint8_t char_pos) { if(x < 20 && y < 4) for(int cy = 0; cy < 8; cy++) @@ -1026,7 +1026,7 @@ inline void x07_state::draw_char(UINT8 x, UINT8 y, UINT8 char_pos) } -inline void x07_state::draw_point(UINT8 x, UINT8 y, UINT8 color) +inline void x07_state::draw_point(uint8_t x, uint8_t y, uint8_t color) { if(x < 120 && y < 32) m_lcd_map[y][x] = color; @@ -1035,12 +1035,12 @@ inline void x07_state::draw_point(UINT8 x, UINT8 y, UINT8 color) inline void x07_state::draw_udk() { - UINT8 i, x, j; + uint8_t i, x, j; if (m_draw_udk) for(i = 0, x = 0; i < 5; i++) { - UINT16 ofs = udk_offset[i + ((ioport("A1")->read()&0x01) ? 6 : 0)]; + uint16_t ofs = udk_offset[i + ((ioport("A1")->read()&0x01) ? 6 : 0)]; draw_char(x++, 3, 0x83); for(j = 0; j < 3; j++) draw_char(x++, 3, m_t6834_ram[ofs++]); @@ -1049,7 +1049,7 @@ inline void x07_state::draw_udk() DEVICE_IMAGE_LOAD_MEMBER( x07_state, x07_card ) { - UINT32 size = m_card->common_get_size("rom"); + uint32_t size = m_card->common_get_size("rom"); // check card type if (image.software_entry() != nullptr) @@ -1078,7 +1078,7 @@ PALETTE_INIT_MEMBER(x07_state, x07) } -UINT32 x07_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t x07_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0); @@ -1105,7 +1105,7 @@ UINT32 x07_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con READ8_MEMBER( x07_state::x07_io_r ) { - UINT8 data = 0xff; + uint8_t data = 0xff; switch(offset) { @@ -1188,7 +1188,7 @@ WRITE8_MEMBER( x07_state::x07_io_w ) if((data & 0x0e) == 0x0e) { - UINT16 div = (m_regs_w[2] | m_regs_w[3] << 8) & 0x0fff; + uint16_t div = (m_regs_w[2] | m_regs_w[3] << 8) & 0x0fff; m_beep->set_clock((div == 0) ? 0 : 192000 / div); m_beep->set_state(1); @@ -1370,7 +1370,7 @@ GFXDECODE_END void x07_state::machine_start() { - UINT32 ram_size = m_ram->size(); + uint32_t ram_size = m_ram->size(); m_rsta_clear = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x07_state::rsta_clear),this)); m_rstb_clear = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x07_state::rstb_clear),this)); m_beep_stop = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(x07_state::beep_stop),this)); @@ -1550,8 +1550,8 @@ ROM_END DRIVER_INIT_MEMBER(x07_state, x07) { - UINT8 *RAM = memregion("default")->base(); - UINT8 *GFX = memregion("gfx1")->base(); + uint8_t *RAM = memregion("default")->base(); + uint8_t *GFX = memregion("gfx1")->base(); for (int i = 0; i < 12; i++) strcpy((char *)RAM + udk_offset[i], udk_ini[i]); diff --git a/src/mame/drivers/x1.cpp b/src/mame/drivers/x1.cpp index 67aabf6425d..741895f5a5b 100644 --- a/src/mame/drivers/x1.cpp +++ b/src/mame/drivers/x1.cpp @@ -225,14 +225,14 @@ VIDEO_START_MEMBER(x1_state,x1) { - m_avram = make_unique_clear(0x800); - m_tvram = make_unique_clear(0x800); - m_kvram = make_unique_clear(0x800); - m_gfx_bitmap_ram = make_unique_clear(0xc000*2); - m_pal_4096 = make_unique_clear(0x1000*3); + m_avram = make_unique_clear(0x800); + m_tvram = make_unique_clear(0x800); + m_kvram = make_unique_clear(0x800); + m_gfx_bitmap_ram = make_unique_clear(0xc000*2); + m_pal_4096 = make_unique_clear(0x1000*3); } -void x1_state::x1_draw_pixel(bitmap_rgb32 &bitmap,int y,int x,UINT16 pen,UINT8 width,UINT8 height) +void x1_state::x1_draw_pixel(bitmap_rgb32 &bitmap,int y,int x,uint16_t pen,uint8_t width,uint8_t height) { if(!machine().first_screen()->visible_area().contains(x, y)) return; @@ -277,12 +277,12 @@ void x1_state::x1_draw_pixel(bitmap_rgb32 &bitmap,int y,int x,UINT16 pen,UINT8 w /* adjust tile index when we are under double height condition */ -UINT8 x1_state::check_prev_height(int x,int y,int x_size) +uint8_t x1_state::check_prev_height(int x,int y,int x_size) { - UINT8 prev_tile = m_tvram[(x+((y-1)*x_size)+mc6845_start_addr) & 0x7ff]; - UINT8 cur_tile = m_tvram[(x+(y*x_size)+mc6845_start_addr) & 0x7ff]; - UINT8 prev_attr = m_avram[(x+((y-1)*x_size)+mc6845_start_addr) & 0x7ff]; - UINT8 cur_attr = m_avram[(x+(y*x_size)+mc6845_start_addr) & 0x7ff]; + uint8_t prev_tile = m_tvram[(x+((y-1)*x_size)+mc6845_start_addr) & 0x7ff]; + uint8_t cur_tile = m_tvram[(x+(y*x_size)+mc6845_start_addr) & 0x7ff]; + uint8_t prev_attr = m_avram[(x+((y-1)*x_size)+mc6845_start_addr) & 0x7ff]; + uint8_t cur_attr = m_avram[(x+(y*x_size)+mc6845_start_addr) & 0x7ff]; if(prev_tile == cur_tile && prev_attr == cur_attr) return 8; @@ -291,9 +291,9 @@ UINT8 x1_state::check_prev_height(int x,int y,int x_size) } /* Exoa II - Warroid: if double height isn't enabled on the first tile of the line then double height is disabled on everything else. */ -UINT8 x1_state::check_line_valid_height(int y,int x_size,int height) +uint8_t x1_state::check_line_valid_height(int y,int x_size,int height) { - UINT8 line_attr = m_avram[(0+(y*x_size)+mc6845_start_addr) & 0x7ff]; + uint8_t line_attr = m_avram[(0+(y*x_size)+mc6845_start_addr) & 0x7ff]; if((line_attr & 0x40) == 0) return 0; @@ -320,8 +320,8 @@ void x1_state::draw_fgtilemap(bitmap_rgb32 &bitmap,const rectangle &cliprect) */ int y,x,res_x,res_y; - UINT32 tile_offset; - UINT8 x_size,y_size; + uint32_t tile_offset; + uint8_t x_size,y_size; x_size = mc6845_h_display; y_size = mc6845_v_display; @@ -341,7 +341,7 @@ void x1_state::draw_fgtilemap(bitmap_rgb32 &bitmap,const rectangle &cliprect) int width = BIT(m_avram[((x+y*x_size)+mc6845_start_addr) & 0x7ff], 7); int height = BIT(m_avram[((x+y*x_size)+mc6845_start_addr) & 0x7ff], 6); int pcg_bank = BIT(m_avram[((x+y*x_size)+mc6845_start_addr) & 0x7ff], 5); - UINT8 *gfx_data = pcg_bank ? m_pcg_ram.get() : m_cg_rom; //machine.root_device().memregion(pcg_bank ? "pcg" : "cgrom")->base(); + uint8_t *gfx_data = pcg_bank ? m_pcg_ram.get() : m_cg_rom; //machine.root_device().memregion(pcg_bank ? "pcg" : "cgrom")->base(); int knj_enable = 0; int knj_side = 0; int knj_bank = 0; @@ -494,7 +494,7 @@ void x1_state::draw_gfxbitmap(bitmap_rgb32 &bitmap,const rectangle &cliprect, in int xi,yi,x,y; int pen_r,pen_g,pen_b,color; int pri_mask_val; - UINT8 x_size,y_size; + uint8_t x_size,y_size; int gfx_offset; x_size = mc6845_h_display; @@ -540,7 +540,7 @@ void x1_state::draw_gfxbitmap(bitmap_rgb32 &bitmap,const rectangle &cliprect, in } } -UINT32 x1_state::screen_update_x1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t x1_state::screen_update_x1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t(0xff,0x00,0x00,0x00), cliprect); @@ -565,13 +565,13 @@ UINT32 x1_state::screen_update_x1(screen_device &screen, bitmap_rgb32 &bitmap, c *************************************/ -UINT16 x1_state::check_keyboard_press() +uint16_t x1_state::check_keyboard_press() { static const char *const portnames[3] = { "key1","key2","key3" }; int i,port_i,scancode; - UINT8 keymod = ioport("key_modifiers")->read() & 0x1f; - UINT32 pad = ioport("tenkey")->read(); - UINT32 f_key = ioport("f_keys")->read(); + uint8_t keymod = ioport("key_modifiers")->read() & 0x1f; + uint32_t pad = ioport("tenkey")->read(); + uint32_t f_key = ioport("f_keys")->read(); scancode = 0; for(port_i=0;port_i<3;port_i++) @@ -629,9 +629,9 @@ UINT16 x1_state::check_keyboard_press() return 0; } -UINT8 x1_state::check_keyboard_shift() +uint8_t x1_state::check_keyboard_shift() { - UINT8 val = 0xe0; + uint8_t val = 0xe0; /* all of those are active low x--- ---- TEN: Numpad, Function key, special input key @@ -655,7 +655,7 @@ UINT8 x1_state::check_keyboard_shift() return val; } -UINT8 x1_state::get_game_key(UINT8 port) +uint8_t x1_state::get_game_key(uint8_t port) { // key status returned by sub CPU function 0xE3. // in order from bit 7 to 0: @@ -663,11 +663,11 @@ UINT8 x1_state::get_game_key(UINT8 port) // port 1: numpad 7,4,1,8,2,9,6,3 // port 2: ESC,1,[-],[+],[*],TAB,SPC,RET ([] = numpad) // bits are active high - UINT8 ret = 0; + uint8_t ret = 0; if (port == 0) { - UINT32 key3 = ioport("key3")->read(); + uint32_t key3 = ioport("key3")->read(); if(key3 & 0x00020000) ret |= 0x80; // Q if(key3 & 0x00800000) ret |= 0x40; // W if(key3 & 0x00000020) ret |= 0x20; // E @@ -680,7 +680,7 @@ UINT8 x1_state::get_game_key(UINT8 port) else if (port == 1) { - UINT32 pad = ioport("tenkey")->read(); + uint32_t pad = ioport("tenkey")->read(); if(pad & 0x00000080) ret |= 0x80; // Tenkey 7 if(pad & 0x00000010) ret |= 0x40; // Tenkey 4 if(pad & 0x00000002) ret |= 0x20; // Tenkey 1 @@ -693,9 +693,9 @@ UINT8 x1_state::get_game_key(UINT8 port) else if (port == 2) { - UINT32 key1 = ioport("key1")->read(); - UINT32 key2 = ioport("key2")->read(); - UINT32 pad = ioport("tenkey")->read(); + uint32_t key1 = ioport("key1")->read(); + uint32_t key2 = ioport("key2")->read(); + uint32_t pad = ioport("tenkey")->read(); if(key1 & 0x08000000) ret |= 0x80; // ESC if(key2 & 0x00020000) ret |= 0x40; // 1 if(pad & 0x00000400) ret |= 0x20; // Tenkey - @@ -711,7 +711,7 @@ UINT8 x1_state::get_game_key(UINT8 port) READ8_MEMBER( x1_state::x1_sub_io_r ) { - UINT8 ret,bus_res; + uint8_t ret,bus_res; /* Looks like that the HW retains the latest data putted on the bus here, behaviour confirmed by Rally-X */ if(m_sub_obf) @@ -745,7 +745,7 @@ READ8_MEMBER( x1_state::x1_sub_io_r ) return ret; } -void x1_state::cmt_command( UINT8 cmd ) +void x1_state::cmt_command( uint8_t cmd ) { // CMT deck control command (E9 xx) // E9 00 - Eject @@ -993,7 +993,7 @@ WRITE8_MEMBER( x1_state::x1_rom_bank_1_w ) READ8_MEMBER( x1_state::x1_fdc_r ) { - //UINT8 ret = 0; + //uint8_t ret = 0; switch(offset+0xff8) { @@ -1095,7 +1095,7 @@ WRITE_LINE_MEMBER(x1_state::hdl_w) * *************************************/ -UINT16 x1_state::check_pcg_addr() +uint16_t x1_state::check_pcg_addr() { if(m_avram[0x7ff] & 0x20) return 0x7ff; if(m_avram[0x3ff] & 0x20) return 0x3ff; @@ -1105,7 +1105,7 @@ UINT16 x1_state::check_pcg_addr() return 0x3ff; } -UINT16 x1_state::check_chr_addr() +uint16_t x1_state::check_chr_addr() { if(!(m_avram[0x7ff] & 0x20)) return 0x7ff; if(!(m_avram[0x3ff] & 0x20)) return 0x3ff; @@ -1115,11 +1115,11 @@ UINT16 x1_state::check_chr_addr() return 0x3ff; } -UINT16 x1_state::get_pcg_addr( UINT16 width, UINT8 y_char_size ) +uint16_t x1_state::get_pcg_addr( uint16_t width, uint8_t y_char_size ) { int hbeam = machine().first_screen()->hpos() >> 3; int vbeam = machine().first_screen()->vpos() / y_char_size; - UINT16 pcg_offset = ((hbeam + vbeam*width) + (((m_crtc_vreg[0x0c]<<8) & 0x3f00) | (m_crtc_vreg[0x0d] & 0xff))) & 0x7ff; + uint16_t pcg_offset = ((hbeam + vbeam*width) + (((m_crtc_vreg[0x0c]<<8) & 0x3f00) | (m_crtc_vreg[0x0d] & 0xff))) & 0x7ff; //printf("%08x %d %d %d %d\n",(hbeam+vbeam*width),hbeam,vbeam,machine.first_screen()->vpos() & 7,width); @@ -1130,8 +1130,8 @@ READ8_MEMBER( x1_state::x1_pcg_r ) { int addr; int pcg_offset; - UINT8 res; - UINT8 *gfx_data; + uint8_t res; + uint8_t *gfx_data; addr = (offset & 0x300) >> 8; @@ -1147,7 +1147,7 @@ READ8_MEMBER( x1_state::x1_pcg_r ) } else { - UINT8 y_char_size; + uint8_t y_char_size; /* addr == 0 reads from the ANK rom */ gfx_data = addr == 0 ? m_cg_rom : m_pcg_ram.get(); @@ -1188,7 +1188,7 @@ WRITE8_MEMBER( x1_state::x1_pcg_w ) } else // Compatible Mode { - UINT8 y_char_size; + uint8_t y_char_size; /* TODO: Brain Breaker doesn't work with this arrangement in high resolution mode, check out why */ y_char_size = (m_crtc_vreg[9]+1) > 8 ? (m_crtc_vreg[9]+1)-8 : m_crtc_vreg[9]+1; @@ -1215,7 +1215,7 @@ WRITE8_MEMBER( x1_state::x1_pcg_w ) /* for bitmap mode */ void x1_state::set_current_palette() { - UINT8 addr,r,g,b; + uint8_t addr,r,g,b; for(addr=0;addr<8;addr++) { @@ -1233,8 +1233,8 @@ void x1_state::set_current_palette() WRITE8_MEMBER( x1_state::x1turboz_4096_palette_w ) { - UINT32 pal_entry; - UINT8 r,g,b; + uint32_t pal_entry; + uint8_t r,g,b; pal_entry = ((offset & 0xff) << 4) | ((data & 0xf0) >> 4); @@ -1293,7 +1293,7 @@ WRITE8_MEMBER( x1_state::x1_pal_b_w ) WRITE8_MEMBER( x1_state::x1_ex_gfxram_w ) { - UINT8 ex_mask; + uint8_t ex_mask; if ( offset <= 0x3fff) { ex_mask = 7; } else if(offset >= 0x4000 && offset <= 0x7fff) { ex_mask = 6; } @@ -1431,7 +1431,7 @@ WRITE8_MEMBER( x1_state::x1turbo_gfxpal_w ) * FIXME: bit-wise this doesn't make any sense, I guess that it uses the lv 2 kanji roms * Test cases for this port so far are Hyper Olympics '84 disk version and Might & Magic. */ -UINT16 x1_state::jis_convert(int kanji_addr) +uint16_t x1_state::jis_convert(int kanji_addr) { if(kanji_addr >= 0x0e00 && kanji_addr <= 0x0e9f) { kanji_addr -= 0x0e00; kanji_addr &= 0x0ff; return ((0x0e0) + (kanji_addr >> 3)) << 4; } // numbers if(kanji_addr >= 0x0f00 && kanji_addr <= 0x109f) { kanji_addr -= 0x0f00; kanji_addr &= 0x1ff; return ((0x4c0) + (kanji_addr >> 3)) << 4; } // lower case chars @@ -1448,7 +1448,7 @@ UINT16 x1_state::jis_convert(int kanji_addr) READ8_MEMBER( x1_state::x1_kanji_r ) { - UINT8 res; + uint8_t res; res = m_kanji_rom[jis_convert(m_kanji_addr & 0xfff0)+(offset*0x10)+(m_kanji_addr & 0xf)]; @@ -1490,7 +1490,7 @@ WRITE8_MEMBER( x1_state::x1_kanji_w ) READ8_MEMBER( x1_state::x1_emm_r ) { - UINT8 res; + uint8_t res; if(offset & ~3) { @@ -1543,7 +1543,7 @@ READ8_MEMBER( x1_state::x1turbo_bank_r ) WRITE8_MEMBER( x1_state::x1turbo_bank_w ) { - //UINT8 *RAM = memregion("x1_cpu")->base(); + //uint8_t *RAM = memregion("x1_cpu")->base(); /* --x- ---- BML5: latch bit (doesn't have any real function) ---x ---- BMCS: select bank RAM, active low @@ -1809,7 +1809,7 @@ READ8_MEMBER( x1_state::x1_portb_r ) ---- --x- "cmt read" ---- ---x "cmt test" (active low) <- actually this is "Sub CPU detected BREAK" */ - UINT8 res = 0; + uint8_t res = 0; int vblank_line = m_crtc_vreg[6] * (m_crtc_vreg[9]+1); int vsync_line = m_crtc_vreg[7] * (m_crtc_vreg[9]+1); m_vdisp = (machine().first_screen()->vpos() < vblank_line) ? 0x80 : 0x00; @@ -2280,11 +2280,11 @@ IRQ_CALLBACK_MEMBER(x1_state::x1_irq_callback) TIMER_DEVICE_CALLBACK_MEMBER(x1_state::x1_keyboard_callback) { address_space &space = m_maincpu->space(AS_PROGRAM); - UINT32 key1 = ioport("key1")->read(); - UINT32 key2 = ioport("key2")->read(); - UINT32 key3 = ioport("key3")->read(); - UINT32 key4 = ioport("tenkey")->read(); - UINT32 f_key = ioport("f_keys")->read(); + uint32_t key1 = ioport("key1")->read(); + uint32_t key2 = ioport("key2")->read(); + uint32_t key3 = ioport("key3")->read(); + uint32_t key4 = ioport("tenkey")->read(); + uint32_t f_key = ioport("f_keys")->read(); if(m_key_irq_vector) { @@ -2309,7 +2309,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(x1_state::x1_keyboard_callback) TIMER_CALLBACK_MEMBER(x1_state::x1_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 }; m_rtc.sec++; @@ -2336,7 +2336,7 @@ TIMER_CALLBACK_MEMBER(x1_state::x1_rtc_increment) MACHINE_RESET_MEMBER(x1_state,x1) { - //UINT8 *ROM = memregion("x1_cpu")->base(); + //uint8_t *ROM = memregion("x1_cpu")->base(); int i; memset(m_gfx_bitmap_ram.get(),0x00,0xc000*2); @@ -2417,9 +2417,9 @@ MACHINE_START_MEMBER(x1_state,x1) } m_ipl_rom = memregion("ipl")->base(); - m_work_ram = make_unique_clear(0x10000*0x10); - m_emm_ram = make_unique_clear(0x1000000); - m_pcg_ram = make_unique_clear(0x1800); + m_work_ram = make_unique_clear(0x10000*0x10); + m_emm_ram = make_unique_clear(0x1000000); + m_pcg_ram = make_unique_clear(0x1800); m_cg_rom = memregion("cgrom")->base(); m_kanji_rom = memregion("kanji")->base(); @@ -2630,9 +2630,9 @@ ROM_END /* Convert the ROM interleaving into something usable by the write handlers */ DRIVER_INIT_MEMBER(x1_state,x1_kanji) { - UINT32 i,j,k,l; - UINT8 *kanji = memregion("kanji")->base(); - UINT8 *raw_kanji = memregion("raw_kanji")->base(); + uint32_t i,j,k,l; + uint8_t *kanji = memregion("kanji")->base(); + uint8_t *raw_kanji = memregion("raw_kanji")->base(); k = 0; for(l=0;l<2;l++) diff --git a/src/mame/drivers/x1twin.cpp b/src/mame/drivers/x1twin.cpp index c5d431da65a..d88cadb185f 100644 --- a/src/mame/drivers/x1twin.cpp +++ b/src/mame/drivers/x1twin.cpp @@ -28,7 +28,7 @@ class x1twin_state : public x1_state x1twin_state(const machine_config &mconfig, device_type type, const char *tag) : x1_state(mconfig, type, tag) { } - UINT32 screen_update_x1pce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_x1pce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_INPUT_CHANGED_MEMBER(ipl_reset); DECLARE_INPUT_CHANGED_MEMBER(nmi_reset); }; @@ -39,7 +39,7 @@ class x1twin_state : public x1_state #define MCU_CLOCK XTAL_6MHz #define PCE_MAIN_CLOCK VDP_CLOCK / 2 -UINT32 x1twin_state::screen_update_x1pce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t x1twin_state::screen_update_x1pce(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return 0; } diff --git a/src/mame/drivers/x68k.cpp b/src/mame/drivers/x68k.cpp index cb7ef3c61a1..18bf474249d 100644 --- a/src/mame/drivers/x68k.cpp +++ b/src/mame/drivers/x68k.cpp @@ -282,7 +282,7 @@ WRITE16_MEMBER(x68k_state::x68k_scc_w ) switch(offset) { case 0: - m_scc->reg_w(space, 0,(UINT8)data); + m_scc->reg_w(space, 0,(uint8_t)data); if((m_scc->get_reg_b(5) & 0x02) != m_scc_prev) { if(m_scc->get_reg_b(5) & 0x02) // Request to Send @@ -295,13 +295,13 @@ WRITE16_MEMBER(x68k_state::x68k_scc_w ) } break; case 1: - m_scc->reg_w(space, 2,(UINT8)data); + m_scc->reg_w(space, 2,(uint8_t)data); break; case 2: - m_scc->reg_w(space, 1,(UINT8)data); + m_scc->reg_w(space, 1,(uint8_t)data); break; case 3: - m_scc->reg_w(space, 3,(UINT8)data); + m_scc->reg_w(space, 3,(uint8_t)data); break; } m_scc_prev = m_scc->get_reg_b(5) & 0x02; @@ -333,7 +333,7 @@ TIMER_CALLBACK_MEMBER(x68k_state::x68k_scc_ack) void x68k_state::x68k_set_adpcm() { - UINT32 rate = 0; + uint32_t rate = 0; switch(m_adpcm.rate & 0x0c) { @@ -361,12 +361,12 @@ void x68k_state::x68k_set_adpcm() // Button inputs (Start, A, B and C) are read in bits 5 and 6 (rather than 4 // and 5 like on a Megadrive) -UINT8 x68k_state::md_3button_r(int port) +uint8_t x68k_state::md_3button_r(int port) { if(port == 1) { - UINT8 porta = m_md3b->read() & 0xff; - UINT8 portb = (m_md3b->read() >> 8) & 0xff; + uint8_t porta = m_md3b->read() & 0xff; + uint8_t portb = (m_md3b->read() >> 8) & 0xff; if(m_mdctrl.mux1 & 0x10) { return porta | 0x90; @@ -378,8 +378,8 @@ UINT8 x68k_state::md_3button_r(int port) } if(port == 2) { - UINT8 porta = (m_md3b->read() >> 16) & 0xff; - UINT8 portb = (m_md3b->read() >> 24) & 0xff; + uint8_t porta = (m_md3b->read() >> 16) & 0xff; + uint8_t portb = (m_md3b->read() >> 24) & 0xff; if(m_mdctrl.mux2 & 0x20) { return porta | 0x90; @@ -409,13 +409,13 @@ void x68k_state::md_6button_init() m_mdctrl.io_timeout2 = timer_alloc(TIMER_MD_6BUTTON_PORT2_TIMEOUT); } -UINT8 x68k_state::md_6button_r(int port) +uint8_t x68k_state::md_6button_r(int port) { if(port == 1) { - UINT8 porta = m_md6b->read() & 0xff; - UINT8 portb = (m_md6b->read() >> 8) & 0xff; - UINT8 extra = m_md6b_extra->read() & 0x0f; + uint8_t porta = m_md6b->read() & 0xff; + uint8_t portb = (m_md6b->read() >> 8) & 0xff; + uint8_t extra = m_md6b_extra->read() & 0x0f; switch(m_mdctrl.seq1) { @@ -451,9 +451,9 @@ UINT8 x68k_state::md_6button_r(int port) } if(port == 2) { - UINT8 porta = (m_md6b->read() >> 16) & 0xff; - UINT8 portb = (m_md6b->read() >> 24) & 0xff; - UINT8 extra = (m_md6b_extra->read() >> 4) & 0x0f; + uint8_t porta = (m_md6b->read() >> 16) & 0xff; + uint8_t portb = (m_md6b->read() >> 24) & 0xff; + uint8_t extra = (m_md6b_extra->read() >> 4) & 0x0f; switch(m_mdctrl.seq2) { @@ -497,12 +497,12 @@ UINT8 x68k_state::md_6button_r(int port) // Output is the same as for standard controllers, but when ctl is high, // the directions refer to the right D-pad, and when low, the left D-pad // The buttons are read the same as normal, regardless of ctl. -UINT8 x68k_state::xpd1lr_r(int port) +uint8_t x68k_state::xpd1lr_r(int port) { if(port == 1) { - UINT8 porta = m_xpd1lr->read() & 0xff; - UINT8 portb = (m_xpd1lr->read() >> 8) & 0xff; + uint8_t porta = m_xpd1lr->read() & 0xff; + uint8_t portb = (m_xpd1lr->read() >> 8) & 0xff; if(m_mdctrl.mux1 & 0x10) { return porta; @@ -514,8 +514,8 @@ UINT8 x68k_state::xpd1lr_r(int port) } if(port == 2) { - UINT8 porta = (m_xpd1lr->read() >> 16) & 0xff; - UINT8 portb = (m_xpd1lr->read() >> 24) & 0xff; + uint8_t porta = (m_xpd1lr->read() >> 16) & 0xff; + uint8_t portb = (m_xpd1lr->read() >> 24) & 0xff; if(m_mdctrl.mux2 & 0x20) { return porta; @@ -958,7 +958,7 @@ TIMER_CALLBACK_MEMBER(x68k_state::x68k_bus_error) m_bus_error = false; } -void x68k_state::set_bus_error(UINT32 address, bool write, UINT16 mem_mask) +void x68k_state::set_bus_error(uint32_t address, bool write, uint16_t mem_mask) { if(m_bus_error) return; @@ -1484,7 +1484,7 @@ MACHINE_RESET_MEMBER(x68k_state,x68000) more or less do the same job */ int drive; - UINT8* romdata = memregion("user2")->base(); + uint8_t* romdata = memregion("user2")->base(); attotime irq_time; memset(m_ram->pointer(),0,m_ram->size()); @@ -1545,7 +1545,7 @@ MACHINE_START_MEMBER(x68k_state,x68000) { address_space &space = m_maincpu->space(AS_PROGRAM); /* Install RAM handlers */ - m_spriteram = (UINT16*)(memregion("user1")->base()); + m_spriteram = (uint16_t*)(memregion("user1")->base()); space.install_readwrite_bank(0x000000,m_ram->size()-1,"bank1"); membank("bank1")->set_base(m_ram->pointer()); diff --git a/src/mame/drivers/xain.cpp b/src/mame/drivers/xain.cpp index 7f6bb5b2072..a219de314c5 100644 --- a/src/mame/drivers/xain.cpp +++ b/src/mame/drivers/xain.cpp @@ -356,7 +356,7 @@ WRITE8_MEMBER(xain_state::m68705_ddr_c_w) CUSTOM_INPUT_MEMBER(xain_state::mcu_status_r) { - UINT8 res = 0; + uint8_t res = 0; if (m_mcu != nullptr) { diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp index faa669cd547..b3bf1762f8f 100644 --- a/src/mame/drivers/xavix.cpp +++ b/src/mame/drivers/xavix.cpp @@ -32,7 +32,7 @@ public: required_device m_maincpu; // screen updates - 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: // driver_device overrides @@ -46,7 +46,7 @@ void xavix_state::video_start() { } -UINT32 xavix_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t xavix_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } diff --git a/src/mame/drivers/xbox.cpp b/src/mame/drivers/xbox.cpp index 51a927a335a..bcc5ffbdf46 100644 --- a/src/mame/drivers/xbox.cpp +++ b/src/mame/drivers/xbox.cpp @@ -147,7 +147,7 @@ void xbox_state::machine_reset() { ata_mass_storage_device *devh; atapi_cdrom_device *devc; - UINT16 *id; + uint16_t *id; // set some neede parameters devh = machine().device("ide:0:hdd"); diff --git a/src/mame/drivers/xerox820.cpp b/src/mame/drivers/xerox820.cpp index 855b7b4f034..770fe68cf51 100644 --- a/src/mame/drivers/xerox820.cpp +++ b/src/mame/drivers/xerox820.cpp @@ -54,7 +54,7 @@ void xerox820_state::bankswitch(int bank) { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); if (bank) { @@ -73,7 +73,7 @@ void xerox820_state::bankswitch(int bank) void xerox820ii_state::bankswitch(int bank) { address_space &program = m_maincpu->space(AS_PROGRAM); - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); if (bank) { @@ -234,7 +234,7 @@ READ8_MEMBER( xerox820_state::kbpio_pa_r ) */ - UINT8 data = 0; + uint8_t data = 0; // keyboard data |= m_kbpio->rdy_b() << 3; @@ -415,10 +415,10 @@ WRITE_LINE_MEMBER( xerox820_state::fr_w ) /* Video */ -UINT32 xerox820_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t xerox820_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=(m_scroll + 1) * 0x80,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=(m_scroll + 1) * 0x80,x; const pen_t *pen=m_palette->pens(); m_framecnt++; @@ -429,7 +429,7 @@ UINT32 xerox820_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap for (ra = 0; ra < 10; ra++) { - UINT32 *p = &bitmap.pix32(sy++); + uint32_t *p = &bitmap.pix32(sy++); for (x = ma; x < ma + 80; x++) { diff --git a/src/mame/drivers/xexex.cpp b/src/mame/drivers/xexex.cpp index bee2ffbc8af..6882a31f5fb 100644 --- a/src/mame/drivers/xexex.cpp +++ b/src/mame/drivers/xexex.cpp @@ -179,7 +179,7 @@ WRITE16_MEMBER(xexex_state::k053247_scattered_word_w) void xexex_state::xexex_objdma( int limiter ) { int counter, num_inactive; - UINT16 *src, *dst; + uint16_t *src, *dst; counter = m_frame; m_frame = m_screen->frame_number(); @@ -704,8 +704,8 @@ DRIVER_INIT_MEMBER(xexex_state,xexex) if (!strcmp(machine().system().name, "xexex")) { // Invulnerability -// *(UINT16 *)(memregion("maincpu")->base() + 0x648d4) = 0x4a79; -// *(UINT16 *)(memregion("maincpu")->base() + 0x00008) = 0x5500; +// *(uint16_t *)(memregion("maincpu")->base() + 0x648d4) = 0x4a79; +// *(uint16_t *)(memregion("maincpu")->base() + 0x00008) = 0x5500; m_strip_0x1a = 1; } } diff --git a/src/mame/drivers/xor100.cpp b/src/mame/drivers/xor100.cpp index 71e0a9d1407..8365b6a3b0c 100644 --- a/src/mame/drivers/xor100.cpp +++ b/src/mame/drivers/xor100.cpp @@ -403,7 +403,7 @@ READ8_MEMBER(xor100_state::i8255_pc_r) */ - UINT8 data = 0; + uint8_t data = 0; /* on line */ data |= m_centronics_select << 4; @@ -475,8 +475,8 @@ SLOT_INTERFACE_END void xor100_state::machine_start() { int banks = m_ram->size() / 0x10000; - UINT8 *ram = m_ram->pointer(); - UINT8 *rom = m_rom->base(); + uint8_t *ram = m_ram->pointer(); + uint8_t *rom = m_rom->base(); /* setup memory banking */ membank("bank1")->configure_entries(1, banks, ram, 0x10000); diff --git a/src/mame/drivers/xorworld.cpp b/src/mame/drivers/xorworld.cpp index ee8eff501d0..ccf8ae9d980 100644 --- a/src/mame/drivers/xorworld.cpp +++ b/src/mame/drivers/xorworld.cpp @@ -225,7 +225,7 @@ DRIVER_INIT_MEMBER(xorworld_state,xorworld) /* patch some strange protection (without this, strange characters appear after level 5 and some pieces don't rotate properly some times) */ - UINT16 *rom = (UINT16 *)(memregion("maincpu")->base() + 0x1390); + uint16_t *rom = (uint16_t *)(memregion("maincpu")->base() + 0x1390); PATCH(0x4239); PATCH(0x00ff); PATCH(0xe196); /* clr.b $ffe196 */ PATCH(0x4239); PATCH(0x00ff); PATCH(0xe197); /* clr.b $ffe197 */ diff --git a/src/mame/drivers/xtheball.cpp b/src/mame/drivers/xtheball.cpp index 1863a72a536..97718df2ca4 100644 --- a/src/mame/drivers/xtheball.cpp +++ b/src/mame/drivers/xtheball.cpp @@ -34,13 +34,13 @@ public: required_device m_watchdog; required_device m_tlc34076; - required_shared_ptr m_vram_bg; - required_shared_ptr m_vram_fg; + required_shared_ptr m_vram_bg; + required_shared_ptr m_vram_fg; required_ioport m_analog_x; required_ioport m_analog_y; - UINT8 m_bitvals[32]; + uint8_t m_bitvals[32]; DECLARE_WRITE16_MEMBER(bit_controls_w); DECLARE_READ16_MEMBER(analogx_r); @@ -67,8 +67,8 @@ void xtheball_state::machine_start() TMS340X0_SCANLINE_RGB32_CB_MEMBER(xtheball_state::scanline_update) { - UINT16 *srcbg = &m_vram_bg[(params->rowaddr << 8) & 0xff00]; - UINT32 *dest = &bitmap.pix32(scanline); + uint16_t *srcbg = &m_vram_bg[(params->rowaddr << 8) & 0xff00]; + uint32_t *dest = &bitmap.pix32(scanline); const rgb_t *pens = m_tlc34076->get_pens(); int coladdr = params->coladdr; int x; @@ -77,12 +77,12 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(xtheball_state::scanline_update) if (!m_bitvals[0x13]) { /* mode 0: foreground is the same as background */ - UINT16 *srcfg = &m_vram_fg[(params->rowaddr << 8) & 0xff00]; + uint16_t *srcfg = &m_vram_fg[(params->rowaddr << 8) & 0xff00]; for (x = params->heblnk; x < params->hsblnk; x += 2, coladdr++) { - UINT16 fgpix = srcfg[coladdr & 0xff]; - UINT16 bgpix = srcbg[coladdr & 0xff]; + uint16_t fgpix = srcfg[coladdr & 0xff]; + uint16_t bgpix = srcbg[coladdr & 0xff]; dest[x + 0] = pens[((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff)]; dest[x + 1] = pens[((fgpix & 0xff00) != 0) ? (fgpix >> 8) : (bgpix >> 8)]; @@ -92,12 +92,12 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(xtheball_state::scanline_update) { /* mode 1: foreground is half background resolution in */ /* X and supports two pages */ - UINT16 *srcfg = &m_vram_fg[(params->rowaddr << 7) & 0xff00]; + uint16_t *srcfg = &m_vram_fg[(params->rowaddr << 7) & 0xff00]; for (x = params->heblnk; x < params->hsblnk; x += 2, coladdr++) { - UINT16 fgpix = srcfg[(coladdr >> 1) & 0xff] >> (8 * (coladdr & 1)); - UINT16 bgpix = srcbg[coladdr & 0xff]; + uint16_t fgpix = srcfg[(coladdr >> 1) & 0xff] >> (8 * (coladdr & 1)); + uint16_t bgpix = srcbg[coladdr & 0xff]; dest[x + 0] = pens[((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix & 0xff)]; dest[x + 1] = pens[((fgpix & 0x00ff) != 0) ? (fgpix & 0xff) : (bgpix >> 8)]; @@ -145,7 +145,7 @@ TMS340X0_FROM_SHIFTREG_CB_MEMBER(xtheball_state::from_shiftreg) WRITE16_MEMBER(xtheball_state::bit_controls_w) { - UINT8 *bitvals = m_bitvals; + uint8_t *bitvals = m_bitvals; if (ACCESSING_BITS_0_7) { if (bitvals[offset] != (data & 1)) diff --git a/src/mame/drivers/xtom3d.cpp b/src/mame/drivers/xtom3d.cpp index c017d160442..5e725ea928f 100644 --- a/src/mame/drivers/xtom3d.cpp +++ b/src/mame/drivers/xtom3d.cpp @@ -56,15 +56,15 @@ public: : pcat_base_state(mconfig, type, tag) { } - std::unique_ptr m_bios_ram; - std::unique_ptr m_bios_ext1_ram; - std::unique_ptr m_bios_ext2_ram; - std::unique_ptr m_bios_ext3_ram; - std::unique_ptr m_bios_ext4_ram; - std::unique_ptr m_isa_ram1; - std::unique_ptr m_isa_ram2; - UINT8 m_mtxc_config_reg[256]; - UINT8 m_piix4_config_reg[4][256]; + std::unique_ptr m_bios_ram; + std::unique_ptr m_bios_ext1_ram; + std::unique_ptr m_bios_ext2_ram; + std::unique_ptr m_bios_ext3_ram; + std::unique_ptr m_bios_ext4_ram; + std::unique_ptr m_isa_ram1; + std::unique_ptr m_isa_ram2; + uint8_t m_mtxc_config_reg[256]; + uint8_t m_piix4_config_reg[4][256]; DECLARE_WRITE32_MEMBER( isa_ram1_w ); DECLARE_WRITE32_MEMBER( isa_ram2_w ); @@ -82,7 +82,7 @@ public: // Intel 82439TX System Controller (MTXC) -static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t mtxc_config_r(device_t *busdevice, device_t *device, int function, int reg) { xtom3d_state *state = busdevice->machine().driver_data(); // osd_printf_debug("MTXC: read %d, %02X\n", function, reg); @@ -90,7 +90,7 @@ static UINT8 mtxc_config_r(device_t *busdevice, device_t *device, int function, return state->m_mtxc_config_reg[reg]; } -static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void mtxc_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { xtom3d_state *state = busdevice->machine().driver_data(); printf("MTXC: write %d, %02X, %02X\n", function, reg, data); @@ -182,9 +182,9 @@ void xtom3d_state::intel82439tx_init() m_mtxc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= mtxc_config_r(busdevice, device, function, reg + 3) << 24; @@ -204,7 +204,7 @@ static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -226,23 +226,23 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) -static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) +static uint8_t piix4_config_r(device_t *busdevice, device_t *device, int function, int reg) { xtom3d_state *state = busdevice->machine().driver_data(); // osd_printf_debug("PIIX4: read %d, %02X\n", function, reg); return state->m_piix4_config_reg[function][reg]; } -static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data) +static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, uint8_t data) { xtom3d_state *state = busdevice->machine().driver_data(); // osd_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data); state->m_piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask) +static uint32_t intel82371ab_pci_r(device_t *busdevice, device_t *device, int function, int reg, uint32_t mem_mask) { - UINT32 r = 0; + uint32_t r = 0; if (ACCESSING_BITS_24_31) { r |= piix4_config_r(busdevice, device, function, reg + 3) << 24; @@ -262,7 +262,7 @@ static UINT32 intel82371ab_pci_r(device_t *busdevice, device_t *device, int func return r; } -static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) { @@ -372,13 +372,13 @@ ADDRESS_MAP_END void xtom3d_state::machine_start() { - m_bios_ram = std::make_unique(0x10000/4); - m_bios_ext1_ram = std::make_unique(0x4000/4); - m_bios_ext2_ram = std::make_unique(0x4000/4); - m_bios_ext3_ram = std::make_unique(0x4000/4); - m_bios_ext4_ram = std::make_unique(0x4000/4); - m_isa_ram1 = std::make_unique(0x4000/4); - m_isa_ram2 = std::make_unique(0x4000/4); + m_bios_ram = std::make_unique(0x10000/4); + m_bios_ext1_ram = std::make_unique(0x4000/4); + m_bios_ext2_ram = std::make_unique(0x4000/4); + m_bios_ext3_ram = std::make_unique(0x4000/4); + m_bios_ext4_ram = std::make_unique(0x4000/4); + m_isa_ram1 = std::make_unique(0x4000/4); + m_isa_ram2 = std::make_unique(0x4000/4); intel82439tx_init(); } diff --git a/src/mame/drivers/ymmu100.cpp b/src/mame/drivers/ymmu100.cpp index 6481a467be5..ccd087375b2 100644 --- a/src/mame/drivers/ymmu100.cpp +++ b/src/mame/drivers/ymmu100.cpp @@ -166,8 +166,8 @@ public: required_ioport m_ioport_p7; required_ioport m_ioport_p8; - UINT8 cur_p1, cur_p2, cur_p3, cur_p5, cur_p6, cur_pa, cur_pf, cur_pg; - UINT8 cur_ic32; + uint8_t cur_p1, cur_p2, cur_p3, cur_p5, cur_p6, cur_pa, cur_pf, cur_pg; + uint8_t cur_ic32; float contrast; DECLARE_READ16_MEMBER(adc0_r); @@ -191,8 +191,8 @@ public: DECLARE_READ16_MEMBER(snd_r); DECLARE_WRITE16_MEMBER(snd_w); - float lightlevel(const UINT8 *src, const UINT8 *render); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + float lightlevel(const uint8_t *src, const uint8_t *render); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void machine_start() override; }; @@ -213,9 +213,9 @@ void mu100_state::machine_start() contrast = 1.0; } -float mu100_state::lightlevel(const UINT8 *src, const UINT8 *render) +float mu100_state::lightlevel(const uint8_t *src, const uint8_t *render) { - UINT8 l = *src; + uint8_t l = *src; if(l == 0) return 1.0; int slot = (src[1] << 8) | src[2]; @@ -229,16 +229,16 @@ float mu100_state::lightlevel(const UINT8 *src, const UINT8 *render) return 0.95f; } -UINT32 mu100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t mu100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - const UINT8 *render = m_lcd->render(); - const UINT8 *src = ymmu100_bkg + 15; + const uint8_t *render = m_lcd->render(); + const uint8_t *src = ymmu100_bkg + 15; for(int y=0; y<241; y++) { - UINT32 *pix = reinterpret_cast(bitmap.raw_pixptr(y)); + uint32_t *pix = reinterpret_cast(bitmap.raw_pixptr(y)); for(int x=0; x<800; x++) { float light = lightlevel(src, render); - UINT32 col = (int(0xef*light) << 16) | (int(0xf5*light) << 8); + uint32_t col = (int(0xef*light) << 16) | (int(0xf5*light) << 8); *pix++ = col; src += 3; } @@ -252,7 +252,7 @@ UINT32 mu100_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c int y = 55 + 65*(i >> 1); for(int yy=-9; yy <= 9; yy++) { int dx = int(sqrt((float)(99-yy*yy))); - UINT32 *pix = reinterpret_cast(bitmap.raw_pixptr(y+yy)) + (x-dx); + uint32_t *pix = reinterpret_cast(bitmap.raw_pixptr(y+yy)) + (x-dx); for(int xx=0; xx<2*dx+1; xx++) *pix++ = 0x00ff00; } @@ -335,7 +335,7 @@ READ16_MEMBER(mu100_state::p1_r) } if(!(cur_pf & 0x02)) { - UINT8 val = 0xff; + uint8_t val = 0xff; if(!(cur_ic32 & 0x20)) val &= m_ioport_p7->read(); if(!(cur_ic32 & 0x40)) diff --git a/src/mame/drivers/z100.cpp b/src/mame/drivers/z100.cpp index e94fc57e98d..d4571f68526 100644 --- a/src/mame/drivers/z100.cpp +++ b/src/mame/drivers/z100.cpp @@ -198,15 +198,15 @@ public: DECLARE_WRITE8_MEMBER(video_pia_B_w); DECLARE_WRITE_LINE_MEMBER(video_pia_CA2_w); DECLARE_WRITE_LINE_MEMBER(video_pia_CB2_w); - std::unique_ptr m_gvram; - UINT8 m_keyb_press,m_keyb_status; - UINT8 m_vram_enable; - UINT8 m_gbank; - UINT8 m_display_mask; - UINT8 m_flash; - UINT8 m_clr_val; - UINT8 m_crtc_vreg[0x100],m_crtc_index; - UINT16 m_start_addr; + std::unique_ptr m_gvram; + uint8_t m_keyb_press,m_keyb_status; + uint8_t m_vram_enable; + uint8_t m_gbank; + uint8_t m_display_mask; + uint8_t m_flash; + uint8_t m_clr_val; + uint8_t m_crtc_vreg[0x100],m_crtc_index; + uint16_t m_start_addr; floppy_image_device *m_floppy; @@ -215,7 +215,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_z100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_z100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_INPUT_CHANGED_MEMBER(key_stroke); }; @@ -239,10 +239,10 @@ public: void z100_state::video_start() { - m_gvram = make_unique_clear(0x30000); + m_gvram = make_unique_clear(0x30000); } -UINT32 z100_state::screen_update_z100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t z100_state::screen_update_z100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,xi,yi; int dot; @@ -254,7 +254,7 @@ UINT32 z100_state::screen_update_z100(screen_device &screen, bitmap_ind16 &bitma { for(x=0;xbase(); + uint8_t *ROM = memregion("ipl")->base(); ROM[0xfc116 & 0x3fff] = 0x90; // patch parity IRQ check ROM[0xfc117 & 0x3fff] = 0x90; diff --git a/src/mame/drivers/z1013.cpp b/src/mame/drivers/z1013.cpp index 2fb8f850e85..6b230a8e226 100644 --- a/src/mame/drivers/z1013.cpp +++ b/src/mame/drivers/z1013.cpp @@ -72,13 +72,13 @@ public: DECLARE_READ8_MEMBER(port_b_r); DECLARE_WRITE8_MEMBER(port_b_w); DECLARE_READ8_MEMBER(k7659_port_b_r); - required_shared_ptr m_p_videoram; - const UINT8 *m_p_chargen; - UINT8 m_keyboard_line; + required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + uint8_t m_keyboard_line; bool m_keyboard_part; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_z1013(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_z1013(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_SNAPSHOT_LOAD_MEMBER( z1013 ); }; @@ -224,16 +224,16 @@ void z1013_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 z1013_state::screen_update_z1013(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t z1013_state::screen_update_z1013(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx; + uint16_t sy=0,ma=0,x; for (y = 0; y < 32; y++) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma+32; x++) { @@ -274,7 +274,7 @@ READ8_MEMBER( z1013_state::port_b_r ) { char kbdrow[6]; sprintf(kbdrow,"X%d", m_keyboard_line & 7); - UINT8 data = ioport(kbdrow)->read(); + uint8_t data = ioport(kbdrow)->read(); if (m_keyboard_part) data >>= 4; @@ -311,8 +311,8 @@ SNAPSHOT_LOAD_MEMBER( z1013_state, z1013 ) 0020 up - Program to load */ - UINT8* data= auto_alloc_array(machine(), UINT8, snapshot_size); - UINT16 startaddr,endaddr,runaddr; + uint8_t* data= auto_alloc_array(machine(), uint8_t, snapshot_size); + uint16_t startaddr,endaddr,runaddr; image.fread( data, snapshot_size); diff --git a/src/mame/drivers/z80dev.cpp b/src/mame/drivers/z80dev.cpp index b18d93529a8..ac72881f1d7 100644 --- a/src/mame/drivers/z80dev.cpp +++ b/src/mame/drivers/z80dev.cpp @@ -42,7 +42,7 @@ WRITE8_MEMBER( z80dev_state::display_w ) { // ---- xxxx digit // xxxx ---- ??? - static const UINT8 hex_7seg[] = {0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71}; + static const uint8_t hex_7seg[] = {0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71}; output().set_digit_value(offset, hex_7seg[data&0x0f]); } diff --git a/src/mame/drivers/z80ne.cpp b/src/mame/drivers/z80ne.cpp index 98d107c479f..1bb5233afd3 100644 --- a/src/mame/drivers/z80ne.cpp +++ b/src/mame/drivers/z80ne.cpp @@ -378,7 +378,7 @@ INPUT_PORTS_END Machine Drivers ******************************************************************************/ #if 0 -static const UINT32 lx388palette[] = +static const uint32_t lx388palette[] = { rgb_t(0x00, 0xff, 0x00), /* GREEN */ rgb_t(0x00, 0xff, 0x00), /* YELLOW in original, here GREEN */ diff --git a/src/mame/drivers/z88.cpp b/src/mame/drivers/z88.cpp index 7abcc157620..1f0abf2c8d7 100644 --- a/src/mame/drivers/z88.cpp +++ b/src/mame/drivers/z88.cpp @@ -549,8 +549,8 @@ INPUT_PORTS_END void z88_state::machine_start() { - m_bios = (UINT8*)memregion("bios")->base(); - m_ram_base = (UINT8*)m_ram->pointer(); + m_bios = (uint8_t*)memregion("bios")->base(); + m_ram_base = (uint8_t*)m_ram->pointer(); // configure the memory banks membank("bank1")->configure_entry(0, m_bios); @@ -576,7 +576,7 @@ void z88_state::machine_reset() READ8_MEMBER(z88_state::kb_r) { - UINT8 data = 0xff; + uint8_t data = 0xff; if (!(offset & 0x80)) data &= ioport("LINE7")->read(); diff --git a/src/mame/drivers/z9001.cpp b/src/mame/drivers/z9001.cpp index 939d2bc8cf7..7ce228bafd7 100644 --- a/src/mame/drivers/z9001.cpp +++ b/src/mame/drivers/z9001.cpp @@ -56,20 +56,20 @@ public: } required_device m_maincpu; - UINT8 m_framecnt; + uint8_t m_framecnt; required_device m_beeper; required_device m_cass; - required_shared_ptr m_p_colorram; - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_colorram; + required_shared_ptr m_p_videoram; DECLARE_WRITE8_MEMBER(kbd_put); DECLARE_WRITE8_MEMBER(port88_w); DECLARE_WRITE_LINE_MEMBER(cass_w); - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; bool m_cassbit; virtual void machine_reset() override; //virtual void machine_start(); virtual void video_start() override; - UINT32 screen_update_z9001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_z9001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(timer_callback); }; @@ -133,17 +133,17 @@ void z9001_state::video_start() m_p_chargen = memregion("chargen")->base(); } -UINT32 z9001_state::screen_update_z9001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t z9001_state::screen_update_z9001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT8 y,ra,chr,gfx,col,fg,bg; - UINT16 sy=0,ma=0,x; + uint8_t y,ra,chr,gfx,col,fg,bg; + uint16_t sy=0,ma=0,x; m_framecnt++; for(y = 0; y < 24; y++ ) { for (ra = 0; ra < 8; ra++) { - UINT16 *p = &bitmap.pix16(sy++); + uint16_t *p = &bitmap.pix16(sy++); for (x = ma; x < ma + 40; x++) { diff --git a/src/mame/drivers/zac_1.cpp b/src/mame/drivers/zac_1.cpp index 260a425e3c8..9844be6ef6e 100644 --- a/src/mame/drivers/zac_1.cpp +++ b/src/mame/drivers/zac_1.cpp @@ -55,14 +55,14 @@ protected: // devices required_device m_maincpu; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; // driver_device overrides virtual void machine_reset() override; private: - UINT8 m_t_c; - UINT8 m_out_offs; - UINT8 m_input_line; + uint8_t m_t_c; + uint8_t m_out_offs; + uint8_t m_input_line; }; @@ -196,7 +196,7 @@ void zac_1_state::machine_reset() else { m_p_ram[0xc0] = 3; // 3 balls - for (UINT8 i=0xc1; i < 0xd6; i++) + for (uint8_t i=0xc1; i < 0xd6; i++) m_p_ram[i] = 1; // enable match & coin slots m_p_ram[0xf7] = 5; m_p_ram[0xf8] = 0x0a; @@ -207,7 +207,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(zac_1_state::zac_1_inttimer) { if (m_t_c > 0x40) { - UINT8 vector = (ioport("TEST")->read() ) ? 0x10 : 0x18; + uint8_t vector = (ioport("TEST")->read() ) ? 0x10 : 0x18; m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, vector); } else @@ -219,13 +219,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(zac_1_state::zac_1_inttimer) 182E-183F is a storage area for inputs. */ TIMER_DEVICE_CALLBACK_MEMBER(zac_1_state::zac_1_outtimer) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 m_out_offs++; if (m_out_offs < 0x40) { - UINT8 display = (m_out_offs >> 3) & 7; - UINT8 digit = m_out_offs & 7; + uint8_t display = (m_out_offs >> 3) & 7; + uint8_t digit = m_out_offs & 7; output().set_digit_value(display * 10 + digit, patterns[m_p_ram[m_out_offs]&15]); } else diff --git a/src/mame/drivers/zac_2.cpp b/src/mame/drivers/zac_2.cpp index ad67ac6b774..aab15fc06ac 100644 --- a/src/mame/drivers/zac_2.cpp +++ b/src/mame/drivers/zac_2.cpp @@ -28,10 +28,10 @@ public: DECLARE_WRITE8_MEMBER(data_w); DECLARE_READ8_MEMBER(serial_r); DECLARE_WRITE_LINE_MEMBER(serial_w); - UINT8 m_t_c; - UINT8 m_out_offs; + uint8_t m_t_c; + uint8_t m_out_offs; required_device m_maincpu; - required_shared_ptr m_p_ram; + required_shared_ptr m_p_ram; required_ioport_array<6> m_row; TIMER_DEVICE_CALLBACK_MEMBER(zac_2_inttimer); TIMER_DEVICE_CALLBACK_MEMBER(zac_2_outtimer); @@ -42,7 +42,7 @@ protected: // driver_device overrides virtual void machine_reset() override; private: - UINT8 m_input_line; + uint8_t m_input_line; }; @@ -188,14 +188,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(zac_2_state::zac_2_inttimer) TIMER_DEVICE_CALLBACK_MEMBER(zac_2_state::zac_2_outtimer) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; m_out_offs++; // displays, solenoids, lamps if (m_out_offs < 0x40) { - UINT8 display = (m_out_offs >> 3) & 7; - UINT8 digit = m_out_offs & 7; + uint8_t display = (m_out_offs >> 3) & 7; + uint8_t digit = m_out_offs & 7; output().set_digit_value(display * 10 + digit, patterns[m_p_ram[m_out_offs]&15]); } } diff --git a/src/mame/drivers/zac_proto.cpp b/src/mame/drivers/zac_proto.cpp index d5bfea32659..093b5679e3b 100644 --- a/src/mame/drivers/zac_proto.cpp +++ b/src/mame/drivers/zac_proto.cpp @@ -187,7 +187,7 @@ INPUT_PORTS_END // solenoids (not knocker) WRITE8_MEMBER( zac_proto_state::out0_w ) { - UINT16 t = data | (offset << 8); + uint16_t t = data | (offset << 8); switch (t) { @@ -214,8 +214,8 @@ WRITE8_MEMBER( zac_proto_state::out1_w ) // need to implement blanking of leading zeroes WRITE8_MEMBER( zac_proto_state::digit_w ) { - static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 }; // 9368 (outputs 0-9,A-F) - static const UINT8 decimals[10] = { 0, 0, 0x80, 0, 0, 0x80, 0, 0, 0, 0 }; + static const uint8_t patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 }; // 9368 (outputs 0-9,A-F) + static const uint8_t decimals[10] = { 0, 0, 0x80, 0, 0, 0x80, 0, 0, 0, 0 }; offset<<=1; output().set_digit_value(offset, patterns[data&15] | decimals[offset]); offset++; diff --git a/src/mame/drivers/zapcomputer.cpp b/src/mame/drivers/zapcomputer.cpp index cde52d03539..4819ae7242a 100644 --- a/src/mame/drivers/zapcomputer.cpp +++ b/src/mame/drivers/zapcomputer.cpp @@ -43,18 +43,18 @@ public: DECLARE_WRITE8_MEMBER(display_7seg_w); private: - UINT8 decode7seg(UINT8 data); + uint8_t decode7seg(uint8_t data); virtual void machine_start() override; required_device m_maincpu; }; -UINT8 zapcomp_state::decode7seg(UINT8 data) +uint8_t zapcomp_state::decode7seg(uint8_t data) { //These are bit patterns representing the conversion of 4bit values //into the status of the segments of the 7 segment displays //controlled by a 82S23 PROM - UINT8 patterns[16] = { + uint8_t patterns[16] = { 0x77, 0x41, 0x6e, 0x6b, 0x59, 0x3b, 0x3f, 0x61, 0x7f, 0x79, 0x7d, 0x1f, @@ -88,9 +88,9 @@ WRITE8_MEMBER( zapcomp_state::display_7seg_w ) READ8_MEMBER( zapcomp_state::keyboard_r ) { - UINT8 retval = 0x00; - UINT8 special = ioport("X1")->read(); - UINT16 hex_keys = ioport("X0")->read(); + uint8_t retval = 0x00; + uint8_t special = ioport("X1")->read(); + uint16_t hex_keys = ioport("X0")->read(); if (BIT(special, 2)) /* "SHIFT" key is pressed */ retval |= 0x40; /* turn on the SHIFT bit but DO NOT turn on the strobe bit */ diff --git a/src/mame/drivers/zaurus.cpp b/src/mame/drivers/zaurus.cpp index cf19f15c8ff..2a069ab3117 100644 --- a/src/mame/drivers/zaurus.cpp +++ b/src/mame/drivers/zaurus.cpp @@ -1422,9 +1422,9 @@ public: // devices required_device m_maincpu; - required_shared_ptr m_ram; + required_shared_ptr m_ram; - UINT8 m_rtc_tick; + uint8_t m_rtc_tick; DECLARE_READ32_MEMBER(pxa255_ostimer_r); DECLARE_WRITE32_MEMBER(pxa255_ostimer_w); DECLARE_READ32_MEMBER(pxa255_rtc_r); @@ -1436,11 +1436,11 @@ public: void pxa255_ostimer_irq_check(); void pxa255_update_interrupts(); - void pxa255_set_irq_line(UINT32 line, int irq_state); + void pxa255_set_irq_line(uint32_t line, int irq_state); TIMER_DEVICE_CALLBACK_MEMBER(rtc_irq_callback); // screen updates - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: // driver_device overrides @@ -1471,7 +1471,7 @@ void zaurus_state::video_start() { } -UINT32 zaurus_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) +uint32_t zaurus_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) { return 0; } @@ -1486,7 +1486,7 @@ void zaurus_state::pxa255_update_interrupts() m_maincpu->set_input_line(ARM7_IRQ_LINE, intc_regs->icip ? ASSERT_LINE : CLEAR_LINE); } -void zaurus_state::pxa255_set_irq_line(UINT32 line, int irq_state) +void zaurus_state::pxa255_set_irq_line(uint32_t line, int irq_state) { PXA255_INTC_Regs *intc_regs = &m_intc_regs; diff --git a/src/mame/drivers/zaxxon.cpp b/src/mame/drivers/zaxxon.cpp index cfcf6844566..2a882a051fb 100644 --- a/src/mame/drivers/zaxxon.cpp +++ b/src/mame/drivers/zaxxon.cpp @@ -1506,13 +1506,13 @@ DRIVER_INIT_MEMBER(zaxxon_state,zaxxonj) (e.g. 0xc0 is XORed with H) therefore in the following tables we only keep track of A, B, C, D, E, F, G and H. */ - static const UINT8 data_xortable[2][8] = + static const uint8_t data_xortable[2][8] = { { 0x0a,0x0a,0x22,0x22,0xaa,0xaa,0x82,0x82 }, /* ...............0 */ { 0xa0,0xaa,0x28,0x22,0xa0,0xaa,0x28,0x22 }, /* ...............1 */ }; - static const UINT8 opcode_xortable[8][8] = + static const uint8_t opcode_xortable[8][8] = { { 0x8a,0x8a,0x02,0x02,0x8a,0x8a,0x02,0x02 }, /* .......0...0...0 */ { 0x80,0x80,0x08,0x08,0xa8,0xa8,0x20,0x20 }, /* .......0...0...1 */ @@ -1524,12 +1524,12 @@ DRIVER_INIT_MEMBER(zaxxon_state,zaxxonj) { 0x02,0x08,0x2a,0x20,0x20,0x2a,0x08,0x02 } /* .......1...1...1 */ }; - UINT8 *rom = memregion("maincpu")->base(); + uint8_t *rom = memregion("maincpu")->base(); for (int A = 0x0000; A < 0x6000; A++) { int i,j; - UINT8 src; + uint8_t src; src = rom[A]; diff --git a/src/mame/drivers/zexall.cpp b/src/mame/drivers/zexall.cpp index 4ca777e18dd..9c25629d73a 100644 --- a/src/mame/drivers/zexall.cpp +++ b/src/mame/drivers/zexall.cpp @@ -47,11 +47,11 @@ public: private: required_device m_maincpu; required_device m_terminal; - required_shared_ptr m_main_ram; - UINT8 m_out_data; // byte written to 0xFFFF - UINT8 m_out_req; // byte written to 0xFFFE - UINT8 m_out_req_last; // old value at 0xFFFE before the most recent write - UINT8 m_out_ack; // byte written to 0xFFFC + required_shared_ptr m_main_ram; + uint8_t m_out_data; // byte written to 0xFFFF + uint8_t m_out_req; // byte written to 0xFFFE + uint8_t m_out_req_last; // old value at 0xFFFE before the most recent write + uint8_t m_out_ack; // byte written to 0xFFFC virtual void machine_reset() override; }; @@ -66,8 +66,8 @@ DRIVER_INIT_MEMBER(zexall_state,zexall) void zexall_state::machine_reset() { // rom is self-modifying, so need to refresh it on each run - UINT8 *rom = memregion("romcode")->base(); - UINT8 *ram = m_main_ram; + uint8_t *rom = memregion("romcode")->base(); + uint8_t *ram = m_main_ram; /* fill main ram with zexall code */ memcpy(ram, rom, 0x228a); } diff --git a/src/mame/drivers/zn.cpp b/src/mame/drivers/zn.cpp index bcd027dd3e7..e292a603ecd 100644 --- a/src/mame/drivers/zn.cpp +++ b/src/mame/drivers/zn.cpp @@ -116,22 +116,22 @@ public: DECLARE_MACHINE_RESET(coh1002v); DECLARE_MACHINE_RESET(coh1002m); INTERRUPT_GEN_MEMBER(qsound_interrupt); - void atpsx_dma_read(UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ); - void atpsx_dma_write(UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ); + void atpsx_dma_read(uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); + void atpsx_dma_write(uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ); void jdredd_vblank(screen_device &screen, bool vblank_state); private: inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... ); - inline void psxwriteword( UINT32 *p_n_psxram, UINT32 n_address, UINT16 n_data ); + inline void psxwriteword( uint32_t *p_n_psxram, uint32_t n_address, uint16_t n_data ); - UINT8 m_n_znsecsel; + uint8_t m_n_znsecsel; - UINT16 m_bam2_mcu_command; + uint16_t m_bam2_mcu_command; int m_jdredd_gun_mux; - std::unique_ptr m_fx1b_fram; + std::unique_ptr m_fx1b_fram; - UINT16 m_vt83c461_latch; + uint16_t m_vt83c461_latch; required_device m_gpu; required_device m_gpu_screen; @@ -169,15 +169,15 @@ inline void ATTR_PRINTF(3,4) zn_state::verboselog( int n_level, const char *s_fm } #ifdef UNUSED_FUNCTION -inline UINT16 zn_state::psxreadword( UINT32 *p_n_psxram, UINT32 n_address ) +inline uint16_t zn_state::psxreadword( uint32_t *p_n_psxram, uint32_t n_address ) { - return *( (UINT16 *)( (UINT8 *)p_n_psxram + WORD_XOR_LE( n_address ) ) ); + return *( (uint16_t *)( (uint8_t *)p_n_psxram + WORD_XOR_LE( n_address ) ) ); } #endif -inline void zn_state::psxwriteword( UINT32 *p_n_psxram, UINT32 n_address, UINT16 n_data ) +inline void zn_state::psxwriteword( uint32_t *p_n_psxram, uint32_t n_address, uint16_t n_data ) { - *( (UINT16 *)( (UINT8 *)p_n_psxram + WORD_XOR_LE( n_address ) ) ) = n_data; + *( (uint16_t *)( (uint8_t *)p_n_psxram + WORD_XOR_LE( n_address ) ) ) = n_data; } READ8_MEMBER(zn_state::znsecsel_r) @@ -1042,7 +1042,7 @@ ADDRESS_MAP_END DRIVER_INIT_MEMBER(zn_state,coh1000tb) { - m_fx1b_fram = std::make_unique(0x200); + m_fx1b_fram = std::make_unique(0x200); machine().device("fm1208s")->set_base(m_fx1b_fram.get(), 0x200); } @@ -1208,7 +1208,7 @@ Notes: *2 - Unpopulated DIP28 socket */ -void zn_state::atpsx_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void zn_state::atpsx_dma_read( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { // logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address); @@ -1224,13 +1224,13 @@ void zn_state::atpsx_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_siz n_size <<= 1; while( n_size > 0 ) { - psxwriteword( p_n_psxram, n_address, m_vt83c461->read_cs0(space, (UINT32) 0, (UINT32) 0xffff) ); + psxwriteword( p_n_psxram, n_address, m_vt83c461->read_cs0(space, (uint32_t) 0, (uint32_t) 0xffff) ); n_address += 2; n_size--; } } -void zn_state::atpsx_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size ) +void zn_state::atpsx_dma_write( uint32_t *p_n_psxram, uint32_t n_address, int32_t n_size ) { logerror("DMA write from %08x for %d bytes\n", n_address, n_size<<2); } @@ -1245,11 +1245,11 @@ READ16_MEMBER(zn_state::vt83c461_16_r) } else if( offset >= 0x1f0 / 2 && offset < 0x1f8 / 2 ) { - return m_vt83c461->read_cs0( space, ( offset / 2 ) & 1, (UINT32) mem_mask << shift ) >> shift; + return m_vt83c461->read_cs0( space, ( offset / 2 ) & 1, (uint32_t) mem_mask << shift ) >> shift; } else if( offset >= 0x3f0 / 2 && offset < 0x3f8 / 2 ) { - return m_vt83c461->read_cs1( space, ( offset / 2 ) & 1, (UINT32) mem_mask << shift ) >> shift; + return m_vt83c461->read_cs1( space, ( offset / 2 ) & 1, (uint32_t) mem_mask << shift ) >> shift; } else { @@ -1268,11 +1268,11 @@ WRITE16_MEMBER(zn_state::vt83c461_16_w) } else if( offset >= 0x1f0 / 2 && offset < 0x1f8 / 2 ) { - m_vt83c461->write_cs0( space, ( offset / 2 ) & 1, (UINT32) data << shift, (UINT32) mem_mask << shift ); + m_vt83c461->write_cs0( space, ( offset / 2 ) & 1, (uint32_t) data << shift, (uint32_t) mem_mask << shift ); } else if( offset >= 0x3f0 / 2 && offset < 0x3f8 / 2 ) { - m_vt83c461->write_cs1( space, ( offset / 2 ) & 1, (UINT32) data << shift, (UINT32) mem_mask << shift ); + m_vt83c461->write_cs1( space, ( offset / 2 ) & 1, (uint32_t) data << shift, (uint32_t) mem_mask << shift ); } else { @@ -1284,7 +1284,7 @@ READ16_MEMBER(zn_state::vt83c461_32_r) { if( offset == 0x1f0/2 ) { - UINT32 data = m_vt83c461->read_cs0(space, 0, 0xffffffff); + uint32_t data = m_vt83c461->read_cs0(space, 0, 0xffffffff); m_vt83c461_latch = data >> 16; return data & 0xffff; } @@ -1853,7 +1853,7 @@ WRITE16_MEMBER(zn_state::acpsx_00_w) WRITE16_MEMBER(zn_state::nbajamex_bank_w) { - UINT32 newbank = 0; + uint32_t newbank = 0; verboselog(0, "nbajamex_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); @@ -1904,7 +1904,7 @@ WRITE16_MEMBER(zn_state::nbajamex_80_w) READ16_MEMBER(zn_state::nbajamex_08_r) { - UINT32 data = 0xffffffff; + uint32_t data = 0xffffffff; verboselog(0, "nbajamex_08_r( %08x, %08x, %08x )\n", offset, data, mem_mask ); return data; } @@ -1912,7 +1912,7 @@ READ16_MEMBER(zn_state::nbajamex_08_r) // possibly a readback from the external soundboard? READ16_MEMBER(zn_state::nbajamex_80_r) { - UINT32 data = 0xffffffff; + uint32_t data = 0xffffffff; verboselog(0, "nbajamex_80_r( %08x, %08x, %08x )\n", offset, data, mem_mask ); return data; } diff --git a/src/mame/drivers/zorba.cpp b/src/mame/drivers/zorba.cpp index c2275dcf454..1c2a1058bc1 100644 --- a/src/mame/drivers/zorba.cpp +++ b/src/mame/drivers/zorba.cpp @@ -67,7 +67,7 @@ public: {} public: - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; DECLARE_DRIVER_INIT(zorba); DECLARE_MACHINE_RESET(zorba); DECLARE_READ8_MEMBER(ram_r); @@ -90,8 +90,8 @@ public: required_device m_palette; private: - UINT8 m_term_data; - UINT8 m_fdc_rq; + uint8_t m_term_data; + uint8_t m_fdc_rq; required_device m_maincpu; required_device m_beep; required_device m_dma; @@ -205,7 +205,7 @@ INPUT_PORTS_END DRIVER_INIT_MEMBER( zorba_state, zorba ) { - UINT8 *main = memregion("maincpu")->base(); + uint8_t *main = memregion("maincpu")->base(); membank("bankr0")->configure_entry(0, &main[0x0000]); membank("bankr0")->configure_entry(1, &main[0x10000]); @@ -283,7 +283,7 @@ I8275_DRAW_CHARACTER_MEMBER( zorba_state::zorba_update_chr ) int i; const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 gfx = m_p_chargen[(linecount & 15) + (charcode << 4) + ((gpa & 1) << 11)]; + uint8_t gfx = m_p_chargen[(linecount & 15) + (charcode << 4) + ((gpa & 1) << 11)]; if (vsp) gfx = 0; @@ -331,7 +331,7 @@ READ8_MEMBER( zorba_state::keyboard_r ) if (offset) return (m_term_data) ? 0x87 : 0x85; - UINT8 data = m_term_data; + uint8_t data = m_term_data; m_term_data = 0; return data; } diff --git a/src/mame/drivers/zr107.cpp b/src/mame/drivers/zr107.cpp index 9396d1c0b70..5fea7a14e30 100644 --- a/src/mame/drivers/zr107.cpp +++ b/src/mame/drivers/zr107.cpp @@ -221,22 +221,22 @@ public: optional_device m_k001604; required_device m_k056800; optional_device m_k056832; - optional_shared_ptr m_workram; + optional_shared_ptr m_workram; required_ioport m_in0, m_in1, m_in2, m_in3, m_in4, m_out4, m_eepromout, m_analog1, m_analog2, m_analog3; required_device m_palette; optional_device m_k001005; optional_device m_k001006_1; optional_device m_k001006_2; - required_shared_ptr m_generic_paletteram_32; + required_shared_ptr m_generic_paletteram_32; required_device m_konppc; - std::unique_ptr m_sharc_dataram; - UINT8 m_led_reg0; - UINT8 m_led_reg1; + std::unique_ptr m_sharc_dataram; + uint8_t m_led_reg0; + uint8_t m_led_reg1; int m_ccu_vcth; int m_ccu_vctl; - UINT8 m_sound_ctrl; - UINT8 m_sound_intck; + uint8_t m_sound_ctrl; + uint8_t m_sound_intck; DECLARE_WRITE32_MEMBER(paletteram32_w); DECLARE_READ8_MEMBER(sysreg_r); @@ -253,8 +253,8 @@ public: DECLARE_DRIVER_INIT(jetwave); DECLARE_VIDEO_START(zr107); DECLARE_VIDEO_START(jetwave); - UINT32 screen_update_zr107(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_jetwave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_zr107(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jetwave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(zr107_vblank); WRITE_LINE_MEMBER(k054539_irq_gen); ADC083X_INPUT_CB(adc0838_callback); @@ -274,7 +274,7 @@ VIDEO_START_MEMBER(zr107_state,jetwave) } -UINT32 zr107_state::screen_update_jetwave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t zr107_state::screen_update_jetwave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->pen(0), cliprect); @@ -321,7 +321,7 @@ VIDEO_START_MEMBER(zr107_state,zr107) m_k056832->set_layer_offs(7, -29, -27); } -UINT32 zr107_state::screen_update_zr107(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t zr107_state::screen_update_zr107(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(m_palette->pen(0), cliprect); @@ -340,7 +340,7 @@ UINT32 zr107_state::screen_update_zr107(screen_device &screen, bitmap_rgb32 &bit READ8_MEMBER(zr107_state::sysreg_r) { - UINT32 r = 0; + uint32_t r = 0; switch (offset) { @@ -430,7 +430,7 @@ WRITE8_MEMBER(zr107_state::sysreg_w) READ32_MEMBER(zr107_state::ccu_r) { - UINT32 r = 0; + uint32_t r = 0; switch (offset) { case 0x1c/4: @@ -908,7 +908,7 @@ MACHINE_CONFIG_END DRIVER_INIT_MEMBER(zr107_state,common) { - m_sharc_dataram = std::make_unique(0x100000/4); + m_sharc_dataram = std::make_unique(0x100000/4); m_led_reg0 = m_led_reg1 = 0x7f; m_ccu_vcth = m_ccu_vctl = 0; diff --git a/src/mame/drivers/zrt80.cpp b/src/mame/drivers/zrt80.cpp index 4166113748e..a617d9e93e9 100644 --- a/src/mame/drivers/zrt80.cpp +++ b/src/mame/drivers/zrt80.cpp @@ -49,12 +49,12 @@ public: DECLARE_WRITE8_MEMBER(zrt80_38_w); DECLARE_WRITE8_MEMBER(kbd_put); MC6845_UPDATE_ROW(crtc_update_row); - const UINT8 *m_p_chargen; - required_shared_ptr m_p_videoram; + const uint8_t *m_p_chargen; + required_shared_ptr m_p_videoram; protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; virtual void video_start() override; required_device m_maincpu; @@ -68,7 +68,7 @@ public: READ8_MEMBER( zrt80_state::zrt80_10_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); return ret; } @@ -217,10 +217,10 @@ void zrt80_state::video_start() MC6845_UPDATE_ROW( zrt80_state::crtc_update_row ) { const rgb_t *palette = m_palette->palette()->entry_list_raw(); - UINT8 chr,gfx,inv; - UINT16 mem,x; - UINT32 *p = &bitmap.pix32(y); - UINT8 polarity = ioport("DIPSW1")->read() & 4 ? 0xff : 0; + uint8_t chr,gfx,inv; + uint16_t mem,x; + uint32_t *p = &bitmap.pix32(y); + uint8_t polarity = ioport("DIPSW1")->read() & 4 ? 0xff : 0; for (x = 0; x < x_count; x++) { diff --git a/src/mame/drivers/zsbc3.cpp b/src/mame/drivers/zsbc3.cpp index 9d4588785c7..caf00a0e7bb 100644 --- a/src/mame/drivers/zsbc3.cpp +++ b/src/mame/drivers/zsbc3.cpp @@ -54,7 +54,7 @@ public: DECLARE_READ8_MEMBER(zsbc3_2a_r); DECLARE_WRITE8_MEMBER(kbd_put); private: - UINT8 m_term_data; + uint8_t m_term_data; virtual void machine_reset() override; required_device m_maincpu; required_device m_terminal; @@ -63,7 +63,7 @@ private: READ8_MEMBER( zsbc3_state::zsbc3_28_r ) { - UINT8 ret = m_term_data; + uint8_t ret = m_term_data; m_term_data = 0; return ret; } diff --git a/src/mame/etc/fd1094dp.cpp b/src/mame/etc/fd1094dp.cpp index 1b8dbb0a3e8..34074d787e2 100644 --- a/src/mame/etc/fd1094dp.cpp +++ b/src/mame/etc/fd1094dp.cpp @@ -39,7 +39,7 @@ char srcpath[250],dstfilename[250]; (BIT(val, B1) << 1) | \ (BIT(val, B0) << 0)) -UINT16 buffer[0x2000]; +uint16_t buffer[0x2000]; int little_endian; int is_little_endian(void) @@ -489,7 +489,7 @@ void find_global_key(void) } -UINT8 mainkey[0x2000]; +uint8_t mainkey[0x2000]; void find_main_key(void) { diff --git a/src/mame/etc/jrcrypt.cpp b/src/mame/etc/jrcrypt.cpp index a689cf8c800..3c30605af18 100644 --- a/src/mame/etc/jrcrypt.cpp +++ b/src/mame/etc/jrcrypt.cpp @@ -20,16 +20,16 @@ static int irq_mask; -typedef UINT16 word; -typedef UINT8 byte; +typedef uint16_t word; +typedef uint8_t byte; #define PreDecryptedRoms #ifndef PreDecryptedRoms static int s0,s1,s2,s3; /* 1 bit registers inside decoder PAL */ -static UINT8 shadowROM[0xffff]; -static UINT8 used[0xFFFF]; -UINT32 numberUsed = 0; +static uint8_t shadowROM[0xffff]; +static uint8_t used[0xFFFF]; +uint32_t numberUsed = 0; #else struct { int count; @@ -457,7 +457,7 @@ the top of this file. It is included here for completeness. #include -typedef UINT8 byte; +typedef uint8_t byte; void CreateJrDecodeTable(byte *x, int length); void Load(char *name,byte *buffer,int from, int length); diff --git a/src/mame/etc/korgm1.cpp b/src/mame/etc/korgm1.cpp index 6714aaab7dc..f9dd829cfb8 100644 --- a/src/mame/etc/korgm1.cpp +++ b/src/mame/etc/korgm1.cpp @@ -30,7 +30,7 @@ public: required_device m_maincpu; // screen updates - 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: // driver_device overrides @@ -44,7 +44,7 @@ void korgm1_state::video_start() { } -UINT32 korgm1_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t korgm1_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } diff --git a/src/mame/etc/template_cpu.cpp b/src/mame/etc/template_cpu.cpp index 3ef47437be8..2989b384b2a 100644 --- a/src/mame/etc/template_cpu.cpp +++ b/src/mame/etc/template_cpu.cpp @@ -40,7 +40,7 @@ void xxx_cpu_device::xxx_illegal() /* Execute cycles */ void cp1610_cpu_device::execute_run() { - UINT16 opcode; + uint16_t opcode; do { @@ -100,7 +100,7 @@ void xxx_cpu_device::execute_set_input(int irqline, int state) } #endif -xxx_cpu_device::xxx_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +xxx_cpu_device::xxx_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, XXX, "XXX", tag, owner, clock, "xxx", __FILE__) , m_program_config("program", ENDIANNESS_BIG, 8, 32, -1) , m_data_config("data", ENDIANNESS_BIG, 8, 32, 0) @@ -123,7 +123,7 @@ void xxx_cpu_device::state_string_export(const device_state_entry &entry, std::s } -offs_t xxx_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT32 *oprom, const UINT32 *opram, UINT32 options) +offs_t xxx_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const uint32_t *oprom, const uint32_t *opram, uint32_t options) { extern CPU_DISASSEMBLE( xxx ); return CPU_DISASSEMBLE_NAME(xxx)(this, buffer, pc, oprom, opram, options); diff --git a/src/mame/etc/template_cpu.h b/src/mame/etc/template_cpu.h index ac877c5ef64..62af4185199 100644 --- a/src/mame/etc/template_cpu.h +++ b/src/mame/etc/template_cpu.h @@ -24,7 +24,7 @@ class xxx_cpu_device : public cpu_device { public: // construction/destruction - xxx_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); + xxx_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, uint32_t _clock); protected: // device-level overrides @@ -32,9 +32,9 @@ protected: virtual void device_reset() override; // device_execute_interface overrides - virtual UINT32 execute_min_cycles() const override { return 1; } - virtual UINT32 execute_max_cycles() const override { return 7; } - virtual UINT32 execute_input_lines() const override { return 0; } + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 7; } + virtual uint32_t execute_input_lines() const override { return 0; } virtual void execute_run() override; virtual void execute_set_input(int inputnum, int state) override; @@ -45,15 +45,15 @@ protected: virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; // device_disasm_interface overrides - virtual UINT32 disasm_min_opcode_bytes() const override { return 4; } - virtual UINT32 disasm_max_opcode_bytes() const override { return 4; } - virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) override; + virtual uint32_t disasm_min_opcode_bytes() const override { return 4; } + virtual uint32_t disasm_max_opcode_bytes() const override { return 4; } + virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override; private: address_space_config m_program_config; - UINT8 m_pc; /* registers */ - UINT8 m_flags; /* flags */ + uint8_t m_pc; /* registers */ + uint8_t m_flags; /* flags */ address_space *m_program; address_space *m_data; int m_icount; diff --git a/src/mame/etc/template_device.cpp b/src/mame/etc/template_device.cpp index 903a2c63c73..358938a5ee0 100644 --- a/src/mame/etc/template_device.cpp +++ b/src/mame/etc/template_device.cpp @@ -27,7 +27,7 @@ const device_type XXX = &device_creator; // xxx_device - constructor //------------------------------------------------- -xxx_device::xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +xxx_device::xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, XXX, "xxx_longname", tag, owner, clock, "xxx", __FILE__) { } diff --git a/src/mame/etc/template_device.h b/src/mame/etc/template_device.h index 748e7e34e46..d2687b33908 100644 --- a/src/mame/etc/template_device.h +++ b/src/mame/etc/template_device.h @@ -30,7 +30,7 @@ class xxx_device : public device_t { public: // construction/destruction - xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // I/O operations DECLARE_WRITE8_MEMBER( write ); diff --git a/src/mame/etc/template_driver.cpp b/src/mame/etc/template_driver.cpp index 27aa3c1fb1c..84ad22ddf2d 100644 --- a/src/mame/etc/template_driver.cpp +++ b/src/mame/etc/template_driver.cpp @@ -25,7 +25,7 @@ public: required_device m_maincpu; // screen updates - 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); DECLARE_PALETTE_INIT(xxx); protected: // driver_device overrides @@ -39,7 +39,7 @@ void xxx_state::video_start() { } -UINT32 xxx_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t xxx_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { return 0; } diff --git a/src/mame/includes/1942.h b/src/mame/includes/1942.h index ab920216af7..24152106bdd 100644 --- a/src/mame/includes/1942.h +++ b/src/mame/includes/1942.h @@ -24,16 +24,16 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; - optional_shared_ptr m_protopal; + required_shared_ptr m_spriteram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + optional_shared_ptr m_protopal; /* video-related */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; int m_palette_bank; - UINT8 m_scroll[2]; + uint8_t m_scroll[2]; void create_palette(); DECLARE_PALETTE_INIT(1942); DECLARE_PALETTE_INIT(1942p); @@ -56,8 +56,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; void video_start_c1942p(); - UINT32 screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_1942p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_1942p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(c1942_scanline); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_sprites_p( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/1943.h b/src/mame/includes/1943.h index 9e926cbf8b6..2ea1f3d22ea 100644 --- a/src/mame/includes/1943.h +++ b/src/mame/includes/1943.h @@ -24,12 +24,12 @@ public: /* devices / memory pointers */ required_device m_maincpu; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_scrollx; - required_shared_ptr m_scrolly; - required_shared_ptr m_bgscrollx; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_scrollx; + required_shared_ptr m_scrolly; + required_shared_ptr m_bgscrollx; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_palette; @@ -43,7 +43,7 @@ public: int m_bg2_on; /* protection */ - UINT8 m_prot_value; + uint8_t m_prot_value; DECLARE_WRITE8_MEMBER(c1943_protection_w); DECLARE_READ8_MEMBER(c1943_protection_r); DECLARE_READ8_MEMBER(_1943b_c007_r); @@ -61,6 +61,6 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(1943); - UINT32 screen_update_1943(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_1943(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); }; diff --git a/src/mame/includes/20pacgal.h b/src/mame/includes/20pacgal.h index f9561c57f3a..03e3fc39d7c 100644 --- a/src/mame/includes/20pacgal.h +++ b/src/mame/includes/20pacgal.h @@ -25,29 +25,29 @@ public: m_eeprom(*this, "eeprom") { } /* memory pointers */ - required_shared_ptr m_video_ram; - required_shared_ptr m_char_gfx_ram; - required_shared_ptr m_stars_seed; - required_shared_ptr m_stars_ctrl; - required_shared_ptr m_flip; + required_shared_ptr m_video_ram; + required_shared_ptr m_char_gfx_ram; + required_shared_ptr m_stars_seed; + required_shared_ptr m_stars_ctrl; + required_shared_ptr m_flip; /* machine state */ - UINT8 m_game_selected; /* 0 = Ms. Pac-Man, 1 = Galaga */ + uint8_t m_game_selected; /* 0 = Ms. Pac-Man, 1 = Galaga */ /* devices */ required_device m_maincpu; required_device m_eeprom; /* memory */ - UINT8 m_sprite_gfx_ram[0x2000]; - UINT8 m_sprite_ram[0x180]; - UINT8 m_sprite_color_lookup[0x100]; - UINT8 m_ram_48000[0x2000]; + uint8_t m_sprite_gfx_ram[0x2000]; + uint8_t m_sprite_ram[0x180]; + uint8_t m_sprite_color_lookup[0x100]; + uint8_t m_ram_48000[0x2000]; /* 25pacman and 20pacgal store the sprite palette at a different address, this is a hardware difference and confirmed NOT to be a register */ - UINT8 m_sprite_pal_base; + uint8_t m_sprite_pal_base; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(irqack_w); DECLARE_WRITE8_MEMBER(timer_pulse_w); DECLARE_WRITE8_MEMBER(_20pacgal_coin_counter_w); @@ -60,7 +60,7 @@ public: DECLARE_DRIVER_INIT(20pacgal); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_20pacgal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_20pacgal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void get_pens(pen_t *pens); void do_pen_lookup(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -68,7 +68,7 @@ public: void draw_chars(bitmap_rgb32 &bitmap); void draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect ); void draw_sprite(bitmap_rgb32 &bitmap, int y, int x, - UINT8 code, UINT8 color, int flip_y, int flip_x); + uint8_t code, uint8_t color, int flip_y, int flip_x); void common_save_state(); }; diff --git a/src/mame/includes/3do.h b/src/mame/includes/3do.h index c826052faa4..03401b01d2b 100644 --- a/src/mame/includes/3do.h +++ b/src/mame/includes/3do.h @@ -16,124 +16,124 @@ struct SLOW2 { /* 03180000 - 0318003f - configuration group */ /* 03180040 - 0318007f - diagnostic UART */ - UINT8 cg_r_count; - UINT8 cg_w_count; - UINT32 cg_input; - UINT32 cg_output; + uint8_t cg_r_count; + uint8_t cg_w_count; + uint32_t cg_input; + uint32_t cg_output; }; struct MADAM { - UINT32 revision; /* 03300000 */ - UINT32 msysbits; /* 03300004 */ - UINT32 mctl; /* 03300008 */ - UINT32 sltime; /* 0330000c */ - UINT32 abortbits; /* 03300020 */ - UINT32 privbits; /* 03300024 */ - UINT32 statbits; /* 03300028 */ - UINT32 diag; /* 03300040 */ - - UINT32 ccobctl0; /* 03300110 */ - UINT32 ppmpc; /* 03300120 */ - - UINT32 regctl0; /* 03300130 */ - UINT32 regctl1; /* 03300134 */ - UINT32 regctl2; /* 03300138 */ - UINT32 regctl3; /* 0330013c */ - UINT32 xyposh; /* 03300140 */ - UINT32 xyposl; /* 03300144 */ - UINT32 linedxyh; /* 03300148 */ - UINT32 linedxyl; /* 0330014c */ - UINT32 dxyh; /* 03300150 */ - UINT32 dxyl; /* 03300154 */ - UINT32 ddxyh; /* 03300158 */ - UINT32 ddxyl; /* 0330015c */ - - UINT32 pip[16]; /* 03300180-033001bc (W); 03300180-033001fc (R) */ - UINT32 fence[16]; /* 03300200-0330023c (W); 03300200-0330027c (R) */ - UINT32 mmu[64]; /* 03300300-033003fc */ - UINT32 dma[32][4]; /* 03300400-033005fc */ - UINT32 mult[40]; /* 03300600-0330069c */ - UINT32 mult_control; /* 033007f0-033007f4 */ - UINT32 mult_status; /* 033007f8 */ + uint32_t revision; /* 03300000 */ + uint32_t msysbits; /* 03300004 */ + uint32_t mctl; /* 03300008 */ + uint32_t sltime; /* 0330000c */ + uint32_t abortbits; /* 03300020 */ + uint32_t privbits; /* 03300024 */ + uint32_t statbits; /* 03300028 */ + uint32_t diag; /* 03300040 */ + + uint32_t ccobctl0; /* 03300110 */ + uint32_t ppmpc; /* 03300120 */ + + uint32_t regctl0; /* 03300130 */ + uint32_t regctl1; /* 03300134 */ + uint32_t regctl2; /* 03300138 */ + uint32_t regctl3; /* 0330013c */ + uint32_t xyposh; /* 03300140 */ + uint32_t xyposl; /* 03300144 */ + uint32_t linedxyh; /* 03300148 */ + uint32_t linedxyl; /* 0330014c */ + uint32_t dxyh; /* 03300150 */ + uint32_t dxyl; /* 03300154 */ + uint32_t ddxyh; /* 03300158 */ + uint32_t ddxyl; /* 0330015c */ + + uint32_t pip[16]; /* 03300180-033001bc (W); 03300180-033001fc (R) */ + uint32_t fence[16]; /* 03300200-0330023c (W); 03300200-0330027c (R) */ + uint32_t mmu[64]; /* 03300300-033003fc */ + uint32_t dma[32][4]; /* 03300400-033005fc */ + uint32_t mult[40]; /* 03300600-0330069c */ + uint32_t mult_control; /* 033007f0-033007f4 */ + uint32_t mult_status; /* 033007f8 */ }; struct CLIO { screen_device *screen; - UINT32 revision; /* 03400000 */ - UINT32 csysbits; /* 03400004 */ - UINT32 vint0; /* 03400008 */ - UINT32 vint1; /* 0340000c */ - UINT32 audin; /* 03400020 */ - UINT32 audout; /* 03400024 */ - UINT32 cstatbits; /* 03400028 */ - UINT32 wdog; /* 0340002c */ - UINT32 hcnt; /* 03400030 */ - UINT32 vcnt; /* 03400034 */ - UINT32 seed; /* 03400038 */ - UINT32 random; /* 0340004c */ - UINT32 irq0; /* 03400040 / 03400044 */ - UINT32 irq0_enable; /* 03400048 / 0340004c */ - UINT32 mode; /* 03400050 / 03400054 */ - UINT32 badbits; /* 03400058 */ - UINT32 spare; /* 0340005c */ - UINT32 irq1; /* 03400060 / 03400064 */ - UINT32 irq1_enable; /* 03400068 / 0340006c */ - UINT32 hdelay; /* 03400080 */ - UINT32 adbio; /* 03400084 */ - UINT32 adbctl; /* 03400088 */ + uint32_t revision; /* 03400000 */ + uint32_t csysbits; /* 03400004 */ + uint32_t vint0; /* 03400008 */ + uint32_t vint1; /* 0340000c */ + uint32_t audin; /* 03400020 */ + uint32_t audout; /* 03400024 */ + uint32_t cstatbits; /* 03400028 */ + uint32_t wdog; /* 0340002c */ + uint32_t hcnt; /* 03400030 */ + uint32_t vcnt; /* 03400034 */ + uint32_t seed; /* 03400038 */ + uint32_t random; /* 0340004c */ + uint32_t irq0; /* 03400040 / 03400044 */ + uint32_t irq0_enable; /* 03400048 / 0340004c */ + uint32_t mode; /* 03400050 / 03400054 */ + uint32_t badbits; /* 03400058 */ + uint32_t spare; /* 0340005c */ + uint32_t irq1; /* 03400060 / 03400064 */ + uint32_t irq1_enable; /* 03400068 / 0340006c */ + uint32_t hdelay; /* 03400080 */ + uint32_t adbio; /* 03400084 */ + uint32_t adbctl; /* 03400088 */ /* Timers */ - UINT32 timer_count[16];/* 034001** & 8 */ - UINT32 timer_backup[16]; /* 034001**+4 & 8 */ - UINT64 timer_ctrl; /* 03400200 */ - UINT32 slack; /* 03400220 */ + uint32_t timer_count[16];/* 034001** & 8 */ + uint32_t timer_backup[16]; /* 034001**+4 & 8 */ + uint64_t timer_ctrl; /* 03400200 */ + uint32_t slack; /* 03400220 */ /* DMA */ - UINT32 dmareqdis; /* 03400308 */ + uint32_t dmareqdis; /* 03400308 */ /* Expansion bus */ - UINT32 expctl; /* 03400400/03400404 */ - UINT32 type0_4; /* 03400408 */ - UINT32 dipir1; /* 03400410 */ - UINT32 dipir2; /* 03400414 */ + uint32_t expctl; /* 03400400/03400404 */ + uint32_t type0_4; /* 03400408 */ + uint32_t dipir1; /* 03400410 */ + uint32_t dipir2; /* 03400414 */ /* Bus signals */ - UINT32 sel; /* 03400500 - 0340053f */ - UINT32 poll; /* 03400540 - 0340057f */ - UINT32 cmdstat; /* 03400580 - 034005bf */ - UINT32 data; /* 034005c0 - 034005ff */ + uint32_t sel; /* 03400500 - 0340053f */ + uint32_t poll; /* 03400540 - 0340057f */ + uint32_t cmdstat; /* 03400580 - 034005bf */ + uint32_t data; /* 034005c0 - 034005ff */ /* DSPP */ - UINT32 semaphore; /* 034017d0 */ - UINT32 semaack; /* 034017d4 */ - UINT32 dsppdma; /* 034017e0 */ - UINT32 dspprst0; /* 034017e4 */ - UINT32 dspprst1; /* 034017e8 */ - UINT32 dspppc; /* 034017f4 */ - UINT32 dsppnr; /* 034017f8 */ - UINT32 dsppgw; /* 034017fc */ - UINT32 dsppn[0x400]; /* 03401800 - 03401bff DSPP N stack (32bit writes) */ + uint32_t semaphore; /* 034017d0 */ + uint32_t semaack; /* 034017d4 */ + uint32_t dsppdma; /* 034017e0 */ + uint32_t dspprst0; /* 034017e4 */ + uint32_t dspprst1; /* 034017e8 */ + uint32_t dspppc; /* 034017f4 */ + uint32_t dsppnr; /* 034017f8 */ + uint32_t dsppgw; /* 034017fc */ + uint32_t dsppn[0x400]; /* 03401800 - 03401bff DSPP N stack (32bit writes) */ /* 03402000 - 034027ff DSPP N stack (16bit writes) */ - UINT32 dsppei[0x100]; /* 03403000 - 034030ff DSPP EI stack (32bit writes) */ + uint32_t dsppei[0x100]; /* 03403000 - 034030ff DSPP EI stack (32bit writes) */ /* 03403400 - 034035ff DSPP EI stack (16bit writes) */ - UINT32 dsppeo[0x1f]; /* 03403800 - 0340381f DSPP EO stack (32bit reads) */ + uint32_t dsppeo[0x1f]; /* 03403800 - 0340381f DSPP EO stack (32bit reads) */ /* 03403c00 - 03403c3f DSPP EO stack (32bit reads) */ - UINT32 dsppclkreload; /* 034039dc / 03403fbc */ + uint32_t dsppclkreload; /* 034039dc / 03403fbc */ /* UNCLE */ - UINT32 unclerev; /* 0340c000 */ - UINT32 uncle_soft_rev; /* 0340c004 */ - UINT32 uncle_addr; /* 0340c008 */ - UINT32 uncle_rom; /* 0340c00c */ + uint32_t unclerev; /* 0340c000 */ + uint32_t uncle_soft_rev; /* 0340c004 */ + uint32_t uncle_addr; /* 0340c008 */ + uint32_t uncle_rom; /* 0340c00c */ }; struct SVF { - UINT32 sport[512]; - UINT32 color; + uint32_t sport[512]; + uint32_t color; }; struct DSPP { - std::unique_ptr N; - std::unique_ptr EI; - std::unique_ptr EO; + std::unique_ptr N; + std::unique_ptr EI; + std::unique_ptr EO; }; class _3do_state : public driver_device @@ -149,17 +149,17 @@ public: m_bank2(*this, "bank2") { } required_device m_maincpu; - required_shared_ptr m_dram; - required_shared_ptr m_vram; + required_shared_ptr m_dram; + required_shared_ptr m_vram; required_device m_nvram; SLOW2 m_slow2; MADAM m_madam; CLIO m_clio; SVF m_svf; DSPP m_dspp; - UINT8 m_nvmem[0x8000]; + uint8_t m_nvmem[0x8000]; -// UINT8 m_video_bits[512]; +// uint8_t m_video_bits[512]; DECLARE_READ8_MEMBER(_3do_nvarea_r); DECLARE_WRITE8_MEMBER(_3do_nvarea_w); DECLARE_READ32_MEMBER(_3do_slow2_r); @@ -173,7 +173,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_VIDEO_START(_3do); - UINT32 screen_update__3do(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update__3do(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER( timer_x16_cb ); @@ -186,7 +186,7 @@ private: void m_3do_madam_init( void ); void m_3do_clio_init( screen_device *screen ); - void m_3do_request_fiq(UINT32 irq_req, UINT8 type); + void m_3do_request_fiq(uint32_t irq_req, uint8_t type); }; /*----------- defined in machine/3do.c -----------*/ diff --git a/src/mame/includes/40love.h b/src/mame/includes/40love.h index 48da17e5960..0cd5f127251 100644 --- a/src/mame/includes/40love.h +++ b/src/mame/includes/40love.h @@ -26,22 +26,22 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_video_ctrl; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram2; - optional_shared_ptr m_mcu_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_video_ctrl; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram2; + optional_shared_ptr m_mcu_ram; /* video-related */ std::unique_ptr m_tmp_bitmap1; std::unique_ptr m_tmp_bitmap2; tilemap_t *m_bg_tilemap; - UINT8 m_flipscreen; - UINT8 m_pix_redraw; - UINT8 m_xoffset; - std::unique_ptr m_pixram1; - std::unique_ptr m_pixram2; + uint8_t m_flipscreen; + uint8_t m_pix_redraw; + uint8_t m_xoffset; + std::unique_ptr m_pixram1; + std::unique_ptr m_pixram2; bitmap_ind16 *m_pixel_bitmap1; bitmap_ind16 *m_pixel_bitmap2; int m_pixram_sel; @@ -53,24 +53,24 @@ public: int m_pending_nmi; /* fake mcu */ - UINT8 m_from_mcu; + uint8_t m_from_mcu; int m_mcu_sent; int m_main_sent; - UINT8 m_mcu_in[2][16]; - UINT8 m_mcu_out[2][16]; + uint8_t m_mcu_in[2][16]; + uint8_t m_mcu_out[2][16]; int m_mcu_cmd; /* misc */ int m_pix_color[4]; - UINT8 m_pix1; - UINT8 m_pix2[2]; - UINT8 m_snd_data; - UINT8 m_snd_flag; + uint8_t m_pix1; + uint8_t m_pix2[2]; + uint8_t m_snd_data; + uint8_t m_snd_flag; int m_vol_ctrl[16]; - UINT8 m_snd_ctrl0; - UINT8 m_snd_ctrl1; - UINT8 m_snd_ctrl2; - UINT8 m_snd_ctrl3; + uint8_t m_snd_ctrl0; + uint8_t m_snd_ctrl1; + uint8_t m_snd_ctrl2; + uint8_t m_snd_ctrl3; /* devices */ required_device m_audiocpu; @@ -118,7 +118,7 @@ public: DECLARE_MACHINE_RESET(undoukai); DECLARE_MACHINE_RESET(common); DECLARE_MACHINE_RESET(ta7630); - UINT32 screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void redraw_pixels(); void fortyl_set_scroll_x( int offset ); void fortyl_plot_pix( int offset ); diff --git a/src/mame/includes/4enraya.h b/src/mame/includes/4enraya.h index 8e15d04c7b9..9d2fcb0a6c0 100644 --- a/src/mame/includes/4enraya.h +++ b/src/mame/includes/4enraya.h @@ -28,17 +28,17 @@ public: required_device m_palette; /* memory pointers */ - UINT8 m_videoram[0x1000]; - UINT8 m_workram[0x1000]; + uint8_t m_videoram[0x1000]; + uint8_t m_workram[0x1000]; - optional_region_ptr m_prom; - optional_region_ptr m_rom; + optional_region_ptr m_prom; + optional_region_ptr m_rom; /* video-related */ tilemap_t *m_bg_tilemap; /* sound-related */ - UINT8 m_soundlatch; + uint8_t m_soundlatch; DECLARE_WRITE8_MEMBER(sound_data_w); DECLARE_READ8_MEMBER(fenraya_custom_map_r); @@ -47,7 +47,7 @@ public: DECLARE_WRITE8_MEMBER(sound_control_w); DECLARE_DRIVER_INIT(unkpacg); TILE_GET_INFO_MEMBER(get_tile_info); - UINT32 screen_update_4enraya(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_4enraya(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h index 2a1d59e8fbf..bf9764dd819 100644 --- a/src/mame/includes/8080bw.h +++ b/src/mame/includes/8080bw.h @@ -45,20 +45,20 @@ public: /* misc game specific */ optional_ioport m_gunx; optional_ioport m_guny; - UINT8 m_color_map; - UINT8 m_screen_red; - UINT8 m_fleet_step; + uint8_t m_color_map; + uint8_t m_screen_red; + uint8_t m_fleet_step; attotime m_schaser_effect_555_time_remain; - INT32 m_schaser_effect_555_time_remain_savable; + int32_t m_schaser_effect_555_time_remain_savable; int m_schaser_effect_555_is_low; int m_schaser_explosion; int m_schaser_last_effect; - UINT8 m_polaris_cloud_speed; - UINT8 m_polaris_cloud_pos; - UINT8 m_schaser_background_disable; - UINT8 m_schaser_background_select; - UINT16 m_claybust_gun_pos; + uint8_t m_polaris_cloud_speed; + uint8_t m_polaris_cloud_pos; + uint8_t m_schaser_background_disable; + uint8_t m_schaser_background_select; + uint16_t m_claybust_gun_pos; DECLARE_CUSTOM_INPUT_MEMBER(sflush_80_r); DECLARE_INPUT_CHANGED_MEMBER(claybust_gun_trigger); @@ -140,18 +140,18 @@ public: DECLARE_PALETTE_INIT(rollingc); DECLARE_PALETTE_INIT(sflush); - UINT32 screen_update_invadpt2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cosmo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_rollingc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_schaser(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_schasercv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sflush(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_indianbt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_lupin3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_polaris(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ballbomb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_shuttlei(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spacecom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_invadpt2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cosmo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rollingc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_schaser(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_schasercv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sflush(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_indianbt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lupin3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_polaris(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ballbomb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_shuttlei(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spacecom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(polaris_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(claybust_gun_callback); @@ -162,8 +162,8 @@ public: DECLARE_WRITE8_MEMBER(polaris_sh_port_3_w); void schaser_reinit_555_time_remain(); - inline void set_pixel( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, int color ); - inline void set_8_pixels( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, int fore_color, int back_color ); + inline void set_pixel( bitmap_rgb32 &bitmap, uint8_t y, uint8_t x, int color ); + inline void set_8_pixels( bitmap_rgb32 &bitmap, uint8_t y, uint8_t x, uint8_t data, int fore_color, int back_color ); void clear_extra_columns( bitmap_rgb32 &bitmap, int color ); }; diff --git a/src/mame/includes/88games.h b/src/mame/includes/88games.h index 892b05883df..6f2cc2a8e38 100644 --- a/src/mame/includes/88games.h +++ b/src/mame/includes/88games.h @@ -47,7 +47,7 @@ public: required_memory_bank m_bank1000; /* memory pointers */ - required_shared_ptr m_ram; + required_shared_ptr m_ram; DECLARE_READ8_MEMBER(bankedram_r); DECLARE_WRITE8_MEMBER(bankedram_w); @@ -59,7 +59,7 @@ public: DECLARE_WRITE8_MEMBER(k052109_051960_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_88games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_88games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(k88games_interrupt); K051316_CB_MEMBER(zoom_callback); K052109_CB_MEMBER(tile_callback); diff --git a/src/mame/includes/abc1600.h b/src/mame/includes/abc1600.h index 5269a352c47..de87b7dc048 100644 --- a/src/mame/includes/abc1600.h +++ b/src/mame/includes/abc1600.h @@ -135,13 +135,13 @@ public: int m_dmadis; int m_sysscc; int m_sysfs; - UINT8 m_cause; + uint8_t m_cause; int m_partst; // parity test // peripherals int m_cs7; // card select address bit 7 int m_bus0; // BUS 0 selected - UINT8 m_csb; // card select + uint8_t m_csb; // card select int m_atce; // V.24 channel A external clock enable int m_btce; // V.24 channel B external clock enable }; diff --git a/src/mame/includes/abc80.h b/src/mame/includes/abc80.h index 794ce95d141..38db71c8207 100644 --- a/src/mame/includes/abc80.h +++ b/src/mame/includes/abc80.h @@ -105,7 +105,7 @@ public: required_memory_region m_vsync_prom; required_memory_region m_line_prom; required_memory_region m_attr_prom; - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; enum { @@ -129,7 +129,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -161,7 +161,7 @@ public: int m_pio_astb; // video state - UINT8 m_latch; + uint8_t m_latch; int m_blink; // cassette state diff --git a/src/mame/includes/abc80x.h b/src/mame/includes/abc80x.h index f4235dd7864..25dae3c1ce1 100644 --- a/src/mame/includes/abc80x.h +++ b/src/mame/includes/abc80x.h @@ -97,8 +97,8 @@ public: optional_device m_cassette; required_device m_ram; required_memory_region m_rom; - optional_shared_ptr m_video_ram; - optional_shared_ptr m_char_ram; + optional_shared_ptr m_video_ram; + optional_shared_ptr m_char_ram; required_ioport m_io_sb; enum @@ -134,7 +134,7 @@ public: int m_pling; // serial state - UINT8 m_sb; + uint8_t m_sb; int m_ctc_z0; int m_sio_txcb; int m_sio_txdb; @@ -144,8 +144,8 @@ public: int m_tape_ctr; // video state - UINT8 m_hrs; // HR picture start scanline - UINT8 m_fgctl; // HR foreground control + uint8_t m_hrs; // HR picture start scanline + uint8_t m_fgctl; // HR foreground control // timers emu_timer *m_ctc_timer; @@ -173,7 +173,7 @@ public: DECLARE_DRIVER_INIT(driver_init); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -200,7 +200,7 @@ public: DECLARE_DRIVER_INIT(driver_init); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); offs_t translate_trom_offset(offs_t offset); void hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -234,7 +234,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void bankswitch(); @@ -277,14 +277,14 @@ public: required_memory_region m_rad_prom; required_memory_region m_hru2_prom; required_memory_region m_char_rom; - optional_shared_ptr m_attr_ram; + optional_shared_ptr m_attr_ram; DECLARE_DRIVER_INIT(driver_init); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void bankswitch(); void hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -311,19 +311,19 @@ public: // memory state int m_keydtr; // keyboard DTR int m_eme; // extended memory enable - UINT8 m_map[16]; // memory page register + uint8_t m_map[16]; // memory page register // video state int m_txoff; // text display enable int m_40; // 40/80 column mode int m_flshclk_ctr; // flash clock counter int m_flshclk; // flash clock - UINT8 m_attr_data; // attribute data latch - UINT8 m_hrc[16]; // HR palette - UINT8 m_sync; // line synchronization delay - UINT8 m_v50_addr; // vertical sync PROM address + uint8_t m_attr_data; // attribute data latch + uint8_t m_hrc[16]; // HR palette + uint8_t m_sync; // line synchronization delay + uint8_t m_v50_addr; // vertical sync PROM address int m_hru2_a8; // HRU II PROM address line 8 - UINT32 m_vsync_shift; // vertical sync shift register + uint32_t m_vsync_shift; // vertical sync shift register int m_vsync; // vertical sync int m_d_vsync; // delayed vertical sync }; diff --git a/src/mame/includes/ac1.h b/src/mame/includes/ac1.h index 2765876f5fe..842ebf30b14 100644 --- a/src/mame/includes/ac1.h +++ b/src/mame/includes/ac1.h @@ -27,8 +27,8 @@ public: DECLARE_DRIVER_INIT(ac1); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(ac1_port_b_r); DECLARE_READ8_MEMBER(ac1_port_a_r); DECLARE_WRITE8_MEMBER(ac1_port_a_w); diff --git a/src/mame/includes/actfancr.h b/src/mame/includes/actfancr.h index 7cec3db7a64..540334210ad 100644 --- a/src/mame/includes/actfancr.h +++ b/src/mame/includes/actfancr.h @@ -25,8 +25,8 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_main_ram; - UINT16 m_spriteram16[0x800/2]; // a 16-bit copy of spriteram for use with the MXC06 code + required_shared_ptr m_main_ram; + uint16_t m_spriteram16[0x800/2]; // a 16-bit copy of spriteram for use with the MXC06 code /* misc */ int m_trio_control_select; @@ -45,5 +45,5 @@ public: DECLARE_WRITE8_MEMBER(actfancr_buffer_spriteram_w); DECLARE_MACHINE_START(triothep); DECLARE_MACHINE_RESET(triothep); - UINT32 screen_update_actfancr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_actfancr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/adam.h b/src/mame/includes/adam.h index 604b14782d6..4d4e4643160 100644 --- a/src/mame/includes/adam.h +++ b/src/mame/includes/adam.h @@ -95,18 +95,18 @@ public: DECLARE_WRITE_LINE_MEMBER( joy2_irq_w ); // memory state - UINT8 m_mioc; + uint8_t m_mioc; int m_game; // ADAMnet state - UINT8 m_an; + uint8_t m_an; // DMA state - UINT16 m_ba; + uint16_t m_ba; int m_dma; int m_bwr; - UINT8 m_data_in; - UINT8 m_data_out; + uint8_t m_data_in; + uint8_t m_data_out; // paddle state int m_spindis; diff --git a/src/mame/includes/advision.h b/src/mame/includes/advision.h index 5912479f15c..093b6179336 100644 --- a/src/mame/includes/advision.h +++ b/src/mame/includes/advision.h @@ -43,7 +43,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); void update_dac(); void vh_write(int data); @@ -65,7 +65,7 @@ public: int m_ea_bank; /* external RAM state */ - std::vector m_ext_ram; + std::vector m_ext_ram; int m_rambank; /* video state */ @@ -74,8 +74,8 @@ public: int m_video_enable; int m_video_bank; int m_video_hpos; - UINT8 m_led_latch[8]; - std::vector m_display; + uint8_t m_led_latch[8]; + std::vector m_display; /* sound state */ int m_sound_cmd; diff --git a/src/mame/includes/aeroboto.h b/src/mame/includes/aeroboto.h index 81510561b29..d47bd1e555d 100644 --- a/src/mame/includes/aeroboto.h +++ b/src/mame/includes/aeroboto.h @@ -25,18 +25,18 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_mainram; - required_shared_ptr m_videoram; - required_shared_ptr m_hscroll; - required_shared_ptr m_tilecolor; - required_shared_ptr m_spriteram; - required_shared_ptr m_vscroll; - required_shared_ptr m_starx; - required_shared_ptr m_stary; - required_shared_ptr m_bgcolor; + required_shared_ptr m_mainram; + required_shared_ptr m_videoram; + required_shared_ptr m_hscroll; + required_shared_ptr m_tilecolor; + required_shared_ptr m_spriteram; + required_shared_ptr m_vscroll; + required_shared_ptr m_starx; + required_shared_ptr m_stary; + required_shared_ptr m_bgcolor; /* stars layout */ - UINT8 * m_stars_rom; + uint8_t * m_stars_rom; int m_stars_length; /* video-related */ @@ -45,8 +45,8 @@ public: int m_starsoff; int m_sx; int m_sy; - UINT8 m_ox; - UINT8 m_oy; + uint8_t m_ox; + uint8_t m_oy; /* misc */ int m_count; @@ -63,7 +63,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_aeroboto(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aeroboto(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(aeroboto_interrupt); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; diff --git a/src/mame/includes/aerofgt.h b/src/mame/includes/aerofgt.h index 85661959bdf..8a7b75f2f07 100644 --- a/src/mame/includes/aerofgt.h +++ b/src/mame/includes/aerofgt.h @@ -32,14 +32,14 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_bg1videoram; - optional_shared_ptr m_bg2videoram; - optional_shared_ptr m_rasterram; - optional_shared_ptr m_bitmapram; - optional_shared_ptr m_spriteram1; - optional_shared_ptr m_spriteram2; - required_shared_ptr m_spriteram3; - optional_shared_ptr m_tx_tilemap_ram; + required_shared_ptr m_bg1videoram; + optional_shared_ptr m_bg2videoram; + optional_shared_ptr m_rasterram; + optional_shared_ptr m_bitmapram; + optional_shared_ptr m_spriteram1; + optional_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram3; + optional_shared_ptr m_tx_tilemap_ram; /* devices referenced above */ required_device m_maincpu; @@ -58,21 +58,21 @@ public: /* video-related */ tilemap_t *m_bg1_tilemap; tilemap_t *m_bg2_tilemap; - UINT8 m_gfxbank[8]; - UINT16 m_bank[4]; - UINT16 m_bg1scrollx; - UINT16 m_bg1scrolly; - UINT16 m_bg2scrollx; - UINT16 m_bg2scrolly; - UINT16 m_wbbc97_bitmap_enable; + uint8_t m_gfxbank[8]; + uint16_t m_bank[4]; + uint16_t m_bg1scrollx; + uint16_t m_bg1scrolly; + uint16_t m_bg2scrollx; + uint16_t m_bg2scrolly; + uint16_t m_wbbc97_bitmap_enable; int m_charpalettebank; int m_spritepalettebank; int m_sprite_gfx; int m_spikes91_lookup; - UINT32 aerofgt_tile_callback( UINT32 code ); + uint32_t aerofgt_tile_callback( uint32_t code ); - UINT32 aerofgt_old_tile_callback( UINT32 code ); - UINT32 aerofgt_ol2_tile_callback( UINT32 code ); + uint32_t aerofgt_old_tile_callback( uint32_t code ); + uint32_t aerofgt_ol2_tile_callback( uint32_t code ); /* misc */ int m_pending_command; @@ -120,16 +120,16 @@ public: DECLARE_VIDEO_START(turbofrc); DECLARE_VIDEO_START(wbbc97); DECLARE_DRIVER_INIT(banked_oki); - UINT32 screen_update_pspikes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spikes91(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pspikesb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_karatblz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spinlbrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_turbofrc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_aerofgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_aerfboot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_aerfboo2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_wbbc97(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pspikes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spikes91(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pspikesb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_karatblz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spinlbrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_turbofrc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aerofgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aerfboot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aerfboo2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wbbc97(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void aerofgt_register_state_globals( ); void setbank( tilemap_t *tmap, int num, int bank ); void aerfboo2_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, int chip_disabled_pri ); diff --git a/src/mame/includes/aim65.h b/src/mame/includes/aim65.h index c85f3c6078e..0feabce17bd 100644 --- a/src/mame/includes/aim65.h +++ b/src/mame/includes/aim65.h @@ -58,10 +58,10 @@ public: DECLARE_WRITE8_MEMBER(aim65_riot_a_w); DECLARE_WRITE8_MEMBER(aim65_pb_w); DECLARE_READ8_MEMBER(aim65_pb_r); - UINT8 m_pia_a; - UINT8 m_pia_b; - UINT8 m_riot_port_a; - UINT8 m_pb_save; + uint8_t m_pia_a; + uint8_t m_pia_b; + uint8_t m_riot_port_a; + uint8_t m_pb_save; required_device m_maincpu; required_device m_cassette1; diff --git a/src/mame/includes/airbustr.h b/src/mame/includes/airbustr.h index aba98cff98c..abb96a868ed 100644 --- a/src/mame/includes/airbustr.h +++ b/src/mame/includes/airbustr.h @@ -33,11 +33,11 @@ public: { } /* memory pointers */ - required_shared_ptr m_devram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram2; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_devram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram2; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -87,7 +87,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - 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); void screen_eof(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(slave_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(airbustr_scanline); diff --git a/src/mame/includes/ajax.h b/src/mame/includes/ajax.h index 6c7abd7f54c..a0a36a5d444 100644 --- a/src/mame/includes/ajax.h +++ b/src/mame/includes/ajax.h @@ -27,7 +27,7 @@ public: m_soundlatch(*this, "soundlatch") { } /* video-related */ - UINT8 m_priority; + uint8_t m_priority; /* misc */ int m_firq_enable; @@ -54,7 +54,7 @@ public: DECLARE_WRITE8_MEMBER(k007232_extvol_w); virtual void machine_start() override; virtual void machine_reset() override; - 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); DECLARE_WRITE8_MEMBER(volume_callback0); DECLARE_WRITE8_MEMBER(volume_callback1); K051316_CB_MEMBER(zoom_callback); diff --git a/src/mame/includes/alesis.h b/src/mame/includes/alesis.h index 6fb23198755..47076f5cb0b 100644 --- a/src/mame/includes/alesis.h +++ b/src/mame/includes/alesis.h @@ -28,7 +28,7 @@ class alesis_dm3ag_device : public device_t { public: // construction/destruction - alesis_dm3ag_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + alesis_dm3ag_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; @@ -45,14 +45,14 @@ protected: private: static const device_timer_id TIMER_DAC_UPDATE = 1; required_device m_dac; - required_region_ptr m_samples; + required_region_ptr m_samples; emu_timer * m_dac_update_timer; bool m_output_active; int m_count; int m_shift; - UINT32 m_cur_sample; - UINT8 m_cmd[5]; + uint32_t m_cur_sample; + uint8_t m_cmd[5]; }; @@ -81,7 +81,7 @@ public: DECLARE_PALETTE_INIT(alesis); virtual void machine_reset() override; - void update_lcd_symbols(bitmap_ind16 &bitmap, UINT8 pos, UINT8 y, UINT8 x, int state); + void update_lcd_symbols(bitmap_ind16 &bitmap, uint8_t pos, uint8_t y, uint8_t x, int state); DECLARE_DRIVER_INIT(hr16); DECLARE_WRITE8_MEMBER( led_w ); DECLARE_WRITE8_MEMBER( mmt8_led_w ); @@ -97,9 +97,9 @@ public: HD44780_PIXEL_UPDATE(sr16_pixel_update); private: - UINT8 m_kb_matrix; - UINT8 m_leds; - UINT8 m_lcd_digits[5]; + uint8_t m_kb_matrix; + uint8_t m_leds; + uint8_t m_lcd_digits[5]; required_device m_maincpu; required_ioport m_col1; required_ioport m_col2; diff --git a/src/mame/includes/aliens.h b/src/mame/includes/aliens.h index bdbd010e6b0..058118838c6 100644 --- a/src/mame/includes/aliens.h +++ b/src/mame/includes/aliens.h @@ -43,7 +43,7 @@ public: DECLARE_WRITE8_MEMBER(aliens_snd_bankswitch_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_aliens(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aliens(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(volume_callback); K052109_CB_MEMBER(tile_callback); K051960_CB_MEMBER(sprite_callback); diff --git a/src/mame/includes/alpha68k.h b/src/mame/includes/alpha68k.h index 1f7be2884f0..15e1b5b85df 100644 --- a/src/mame/includes/alpha68k.h +++ b/src/mame/includes/alpha68k.h @@ -23,9 +23,9 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - optional_shared_ptr m_shared_ram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_videoram; + optional_shared_ptr m_shared_ram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_videoram; /* video-related */ tilemap_t *m_fix_tilemap; @@ -51,8 +51,8 @@ public: /* devices */ required_device m_audiocpu; - UINT8 m_sound_nmi_mask; - UINT8 m_sound_pa_latch; + uint8_t m_sound_nmi_mask; + uint8_t m_sound_pa_latch; DECLARE_WRITE16_MEMBER(tnextspc_coin_counters_w); DECLARE_WRITE16_MEMBER(tnextspc_unknown_w); DECLARE_WRITE16_MEMBER(alpha_microcontroller_w); @@ -105,12 +105,12 @@ public: DECLARE_VIDEO_START(alpha68k); DECLARE_MACHINE_START(alpha68k_V); DECLARE_MACHINE_RESET(alpha68k_V); - UINT32 screen_update_sstingry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kyros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_alpha68k_I(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_alpha68k_II(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_alpha68k_V(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_alpha68k_V_sb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sstingry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kyros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_alpha68k_I(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_alpha68k_II(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_alpha68k_V(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_alpha68k_V_sb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(alpha68k_sound_nmi); void alpha68k_flipscreen_w( int flip ); void alpha68k_V_video_bank_w( int bank ); diff --git a/src/mame/includes/ambush.h b/src/mame/includes/ambush.h index bb67a139dda..ed042b802f6 100644 --- a/src/mame/includes/ambush.h +++ b/src/mame/includes/ambush.h @@ -21,16 +21,16 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_scrollram; - required_shared_ptr m_colorbank; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_scrollram; + required_shared_ptr m_colorbank; DECLARE_WRITE8_MEMBER(ambush_coin_counter_w); DECLARE_WRITE8_MEMBER(flip_screen_w); DECLARE_PALETTE_INIT(ambush); - UINT32 screen_update_ambush(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ambush(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_chars( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h index fed46133824..25dc7431f21 100644 --- a/src/mame/includes/amiga.h +++ b/src/mame/includes/amiga.h @@ -40,8 +40,8 @@ Ernesto Corvi & Mariusz Wojcieszek /* registers in 32-bit natural order. This means we need to XOR the register */ /* address with 1 on little-endian systems. */ #define CUSTOM_REG(x) (state->m_custom_regs[BYTE_XOR_BE(x)]) -#define CUSTOM_REG_SIGNED(x) ((INT16)CUSTOM_REG(x)) -#define CUSTOM_REG_LONG(x) (*(UINT32 *)&state->m_custom_regs[x]) +#define CUSTOM_REG_SIGNED(x) ((int16_t)CUSTOM_REG(x)) +#define CUSTOM_REG_LONG(x) (*(uint32_t *)&state->m_custom_regs[x]) /* A = Angus @@ -374,32 +374,32 @@ public: { } /* chip RAM access */ - UINT16 chip_ram_r(offs_t byteoffs) + uint16_t chip_ram_r(offs_t byteoffs) { return EXPECTED(byteoffs < m_chip_ram.bytes()) ? m_chip_ram.read(byteoffs >> 1) : 0xffff; } - void chip_ram_w(offs_t byteoffs, UINT16 data) + void chip_ram_w(offs_t byteoffs, uint16_t data) { if (EXPECTED(byteoffs < m_chip_ram.bytes())) m_chip_ram.write(byteoffs >> 1, data); } /* sprite states */ - UINT8 m_sprite_comparitor_enable_mask; - UINT8 m_sprite_dma_reload_mask; - UINT8 m_sprite_dma_live_mask; - UINT8 m_sprite_ctl_written; - UINT32 m_sprite_shiftreg[8]; - UINT8 m_sprite_remain[8]; + uint8_t m_sprite_comparitor_enable_mask; + uint8_t m_sprite_dma_reload_mask; + uint8_t m_sprite_dma_live_mask; + uint8_t m_sprite_ctl_written; + uint32_t m_sprite_shiftreg[8]; + uint8_t m_sprite_remain[8]; /* copper states */ - UINT32 m_copper_pc; - UINT8 m_copper_waiting; - UINT8 m_copper_waitblit; - UINT16 m_copper_waitval; - UINT16 m_copper_waitmask; - UINT16 m_copper_pending_offset; - UINT16 m_copper_pending_data; + uint32_t m_copper_pc; + uint8_t m_copper_waiting; + uint8_t m_copper_waitblit; + uint16_t m_copper_waitval; + uint16_t m_copper_waitmask; + uint16_t m_copper_pending_offset; + uint16_t m_copper_pending_data; #if GUESS_COPPER_OFFSET int m_wait_offset; #endif @@ -409,17 +409,17 @@ public: rgb_t m_ham_color; /* misc states */ - UINT16 m_genlock_color; + uint16_t m_genlock_color; /* separate 6 in-order bitplanes into 2 x 3-bit bitplanes in two nibbles */ - UINT8 m_separate_bitplanes[2][64]; + uint8_t m_separate_bitplanes[2][64]; /* aga */ int m_aga_diwhigh_written; rgb_t m_aga_palette[256]; - UINT64 m_aga_bpldat[8]; - UINT16 m_aga_sprdata[8][4]; - UINT16 m_aga_sprdatb[8][4]; + uint64_t m_aga_bpldat[8]; + uint16_t m_aga_sprdata[8][4]; + uint16_t m_aga_sprdatb[8][4]; int m_aga_sprite_fetched_words; int m_aga_sprite_dma_used_words[8]; @@ -429,8 +429,8 @@ public: void render_scanline(bitmap_ind16 &bitmap, int scanline); void aga_render_scanline(bitmap_rgb32 &bitmap, int scanline); - UINT32 screen_update_amiga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_amiga_aga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_amiga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_amiga_aga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void update_screenmode(); TIMER_CALLBACK_MEMBER( scanline_callback ); @@ -494,12 +494,12 @@ public: emu_timer *m_blitter_timer; - UINT16 m_agnus_id; - UINT16 m_denise_id; + uint16_t m_agnus_id; + uint16_t m_denise_id; - UINT16 m_custom_regs[256]; + uint16_t m_custom_regs[256]; - void custom_chip_w(UINT16 offset, UINT16 data, UINT16 mem_mask = 0xffff) + void custom_chip_w(uint16_t offset, uint16_t data, uint16_t mem_mask = 0xffff) { custom_chip_w(m_maincpu->space(AS_PROGRAM), offset, data, mem_mask); } @@ -546,11 +546,11 @@ protected: virtual void vblank(); - virtual void potgo_w(UINT16 data) {}; + virtual void potgo_w(uint16_t data) {}; // joystick/mouse - virtual UINT16 joy0dat_r(); - virtual UINT16 joy1dat_r(); + virtual uint16_t joy0dat_r(); + virtual uint16_t joy1dat_r(); // serial virtual void rs232_tx(int state); @@ -583,7 +583,7 @@ protected: optional_ioport m_hvpos; memory_array m_chip_ram; - UINT32 m_chip_ram_mask; + uint32_t m_chip_ram_mask; int m_cia_0_irq; int m_cia_1_irq; @@ -625,8 +625,8 @@ private: // pot counters int m_pot0x, m_pot1x, m_pot0y, m_pot1y; - UINT16 m_pot0dat; - UINT16 m_pot1dat; + uint16_t m_pot0dat; + uint16_t m_pot1dat; int m_centronics_busy; int m_centronics_perror; @@ -646,8 +646,8 @@ private: bitmap_ind16 m_flickerfixer; bitmap_ind32 m_flickerfixer32; - UINT16 m_rx_shift; - UINT16 m_tx_shift; + uint16_t m_rx_shift; + uint16_t m_tx_shift; int m_rx_state; int m_tx_state; @@ -662,7 +662,7 @@ private: void serial_shift(); void rx_write(amiga_state *state, int level); - UINT32 amiga_gethvpos(); + uint32_t amiga_gethvpos(); }; @@ -673,12 +673,12 @@ extern const char *const amiga_custom_names[0x100]; /*----------- defined in video/amiga.c -----------*/ -extern const UINT16 amiga_expand_byte[256]; +extern const uint16_t amiga_expand_byte[256]; -void amiga_copper_setpc(running_machine &machine, UINT32 pc); +void amiga_copper_setpc(running_machine &machine, uint32_t pc); int amiga_copper_execute_next(running_machine &machine, int xpos); -void amiga_set_genlock_color(running_machine &machine, UINT16 color); +void amiga_set_genlock_color(running_machine &machine, uint16_t color); void amiga_sprite_dma_reset(running_machine &machine, int which); void amiga_sprite_enable_comparitor(running_machine &machine, int which, int enable); diff --git a/src/mame/includes/ampoker2.h b/src/mame/includes/ampoker2.h index 35e9008bcca..38f105f7b41 100644 --- a/src/mame/includes/ampoker2.h +++ b/src/mame/includes/ampoker2.h @@ -13,7 +13,7 @@ public: m_watchdog(*this, "watchdog"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(ampoker2_port30_w); DECLARE_WRITE8_MEMBER(ampoker2_port31_w); @@ -31,7 +31,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(ampoker2); DECLARE_VIDEO_START(sigma2k); - UINT32 screen_update_ampoker2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ampoker2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_watchdog; required_device m_gfxdecode; diff --git a/src/mame/includes/amspdwy.h b/src/mame/includes/amspdwy.h index f9691cc55f9..7ab95d63806 100644 --- a/src/mame/includes/amspdwy.h +++ b/src/mame/includes/amspdwy.h @@ -27,9 +27,9 @@ public: { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; /* devices */ required_device m_maincpu; @@ -45,8 +45,8 @@ public: int m_flipscreen; /* misc */ - UINT8 m_wheel_old[2]; - UINT8 m_wheel_return[2]; + uint8_t m_wheel_old[2]; + uint8_t m_wheel_return[2]; DECLARE_READ8_MEMBER(amspdwy_wheel_0_r); DECLARE_READ8_MEMBER(amspdwy_wheel_1_r); @@ -58,9 +58,9 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); TILEMAP_MAPPER_MEMBER(tilemap_scan_cols_back); - UINT32 screen_update_amspdwy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_amspdwy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - UINT8 amspdwy_wheel_r( int index ); + uint8_t amspdwy_wheel_r( int index ); virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/includes/amstrad.h b/src/mame/includes/amstrad.h index 92f2b4fe747..4546c2c4a92 100644 --- a/src/mame/includes/amstrad.h +++ b/src/mame/includes/amstrad.h @@ -51,10 +51,10 @@ struct gate_array_t { std::unique_ptr bitmap; /* The bitmap we work on */ - UINT8 pen_selected; /* Pen selection */ - UINT8 mrer; /* Mode and ROM Enable Register */ - UINT8 upper_bank; - UINT8 romdis; // ROMDIS signal from the expansion port + uint8_t pen_selected; /* Pen selection */ + uint8_t mrer; /* Mode and ROM Enable Register */ + uint8_t upper_bank; + uint8_t romdis; // ROMDIS signal from the expansion port /* input signals from CRTC */ int vsync; @@ -70,16 +70,16 @@ struct gate_array_t /* used for drawing the screen */ attotime last_draw_time; int y; - UINT16 *draw_p; /* Position in the bitmap where we are currently drawing */ - UINT16 colour; - UINT16 address; - UINT8 *mode_lookup; - UINT8 data; - UINT8 ticks; - UINT8 ticks_increment; - UINT16 line_ticks; - UINT8 colour_ticks; - UINT8 max_colour_ticks; + uint16_t *draw_p; /* Position in the bitmap where we are currently drawing */ + uint16_t colour; + uint16_t address; + uint8_t *mode_lookup; + uint8_t data; + uint8_t ticks; + uint8_t ticks_increment; + uint16_t line_ticks; + uint8_t colour_ticks; + uint8_t max_colour_ticks; }; /**************************** @@ -87,31 +87,31 @@ struct gate_array_t ****************************/ struct asic_t { - UINT8 *ram; /* pointer to RAM used for the CPC+ ASIC memory-mapped registers */ - UINT8 enabled; /* Are CPC plus features enabled/unlocked */ - UINT8 pri; /* Programmable raster interrupt */ - UINT8 seqptr; /* Current position in the ASIC unlocking sequence */ - UINT8 rmr2; /* ROM mapping register 2 */ - UINT16 split_ma_base; /* Used to handle split screen support */ - UINT16 split_ma_started; /* Used to handle split screen support */ - UINT16 vpos; /* Current logical scanline */ - UINT16 h_start; /* Position where DE became active */ - UINT16 h_end; /* Position where DE became inactive */ - UINT8 addr_6845; /* We need these to store a shadow copy of R1 of the mc6845 */ - UINT8 horiz_disp; - UINT8 hscroll; - UINT8 de_start; /* flag to check if DE is been enabled this frame yet */ + uint8_t *ram; /* pointer to RAM used for the CPC+ ASIC memory-mapped registers */ + uint8_t enabled; /* Are CPC plus features enabled/unlocked */ + uint8_t pri; /* Programmable raster interrupt */ + uint8_t seqptr; /* Current position in the ASIC unlocking sequence */ + uint8_t rmr2; /* ROM mapping register 2 */ + uint16_t split_ma_base; /* Used to handle split screen support */ + uint16_t split_ma_started; /* Used to handle split screen support */ + uint16_t vpos; /* Current logical scanline */ + uint16_t h_start; /* Position where DE became active */ + uint16_t h_end; /* Position where DE became inactive */ + uint8_t addr_6845; /* We need these to store a shadow copy of R1 of the mc6845 */ + uint8_t horiz_disp; + uint8_t hscroll; + uint8_t de_start; /* flag to check if DE is been enabled this frame yet */ bool hsync_first_tick; /* flag to check in first CRTC tick, used for knowing when to cover left side of screen to cover horizontal softscroll mess */ - UINT8 hsync_tick_count; + uint8_t hsync_tick_count; /* DMA */ - UINT8 dma_status; - UINT8 dma_clear; /* Set if DMA interrupts are to be cleared automatically */ - UINT8 dma_prescaler[3]; /* DMA channel prescaler */ - UINT16 dma_repeat[3]; /* Location of the DMA channel's last repeat */ - UINT16 dma_addr[3]; /* DMA channel address */ - UINT16 dma_loopcount[3]; /* Count loops taken on this channel */ - UINT16 dma_pause[3]; /* DMA pause count */ + uint8_t dma_status; + uint8_t dma_clear; /* Set if DMA interrupts are to be cleared automatically */ + uint8_t dma_prescaler[3]; /* DMA channel prescaler */ + uint16_t dma_repeat[3]; /* Location of the DMA channel's last repeat */ + uint16_t dma_addr[3]; /* DMA channel address */ + uint16_t dma_loopcount[3]; /* Count loops taken on this channel */ + uint16_t dma_pause[3]; /* DMA pause count */ }; @@ -180,7 +180,7 @@ public: optional_device m_rtc; // Aleste 520EX only int m_system_type; - UINT8 m_aleste_mode; + uint8_t m_aleste_mode; int m_plus_irq_cause; gate_array_t m_gate_array; asic_t m_asic; @@ -189,19 +189,19 @@ public: unsigned char *m_Aleste_RamBanks[4]; int m_aleste_active_page[4]; unsigned char *m_Amstrad_ROM_Table[256]; - UINT8 m_ppi_port_inputs[3]; - UINT8 m_ppi_port_outputs[3]; + uint8_t m_ppi_port_inputs[3]; + uint8_t m_ppi_port_outputs[3]; int m_aleste_rtc_function; int m_prev_reg; - UINT16 m_GateArray_render_colours[17]; - UINT8 m_mode0_lookup[256]; - UINT8 m_mode1_lookup[256]; - UINT8 m_mode2_lookup[256]; + uint16_t m_GateArray_render_colours[17]; + uint8_t m_mode0_lookup[256]; + uint8_t m_mode1_lookup[256]; + uint8_t m_mode2_lookup[256]; int m_prev_data; int m_printer_bit8_selected; unsigned char m_Psg_FunctionSelected; int m_previous_ppi_portc_w; - UINT8 m_amx_mouse_data; + uint8_t m_amx_mouse_data; DECLARE_WRITE8_MEMBER(amstrad_plus_asic_4000_w); DECLARE_WRITE8_MEMBER(amstrad_plus_asic_6000_w); DECLARE_READ8_MEMBER(amstrad_plus_asic_4000_r); @@ -227,7 +227,7 @@ public: DECLARE_MACHINE_START(aleste); DECLARE_MACHINE_RESET(aleste); DECLARE_PALETTE_INIT(aleste); - UINT32 screen_update_amstrad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_amstrad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_amstrad(screen_device &screen, bool state); DECLARE_INPUT_CHANGED_MEMBER(cpc_monitor_changed); TIMER_CALLBACK_MEMBER(amstrad_pc2_low); @@ -295,8 +295,8 @@ protected: void amstrad_vh_update_mode(); void amstrad_plus_dma_parse(int channel); void amstrad_plus_handle_dma(); - void amstrad_vh_update_colour(int PenIndex, UINT16 hw_colour_index); - void aleste_vh_update_colour(int PenIndex, UINT16 hw_colour_index); + void amstrad_vh_update_colour(int PenIndex, uint16_t hw_colour_index); + void aleste_vh_update_colour(int PenIndex, uint16_t hw_colour_index); void amstrad_gate_array_get_video_data(); void amstrad_update_video(); void amstrad_plus_gate_array_get_video_data(); @@ -306,7 +306,7 @@ protected: void amstrad_setUpperRom(); void AmstradCPC_GA_SetRamConfiguration(); void AmstradCPC_PALWrite(int data); - void amstrad_GateArray_write(UINT8 dataToGateArray); + void amstrad_GateArray_write(uint8_t dataToGateArray); void amstrad_reset_machine(); void kccomp_reset_machine(); void update_psg(); @@ -316,7 +316,7 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; int m_centronics_busy; - UINT8 m_last_write; + uint8_t m_last_write; }; diff --git a/src/mame/includes/angelkds.h b/src/mame/includes/angelkds.h index 0865c845c70..5eb278f9926 100644 --- a/src/mame/includes/angelkds.h +++ b/src/mame/includes/angelkds.h @@ -21,10 +21,10 @@ public: m_decrypted_opcodes(*this, "decrypted_opcodes") { } /* memory pointers */ - required_shared_ptr m_bgtopvideoram; - required_shared_ptr m_bgbotvideoram; - required_shared_ptr m_txvideoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_bgtopvideoram; + required_shared_ptr m_bgbotvideoram; + required_shared_ptr m_txvideoram; + required_shared_ptr m_spriteram; tilemap_t *m_tx_tilemap; tilemap_t *m_bgbot_tilemap; @@ -33,9 +33,9 @@ public: int m_bgbotbank; int m_bgtopbank; - UINT8 m_sound[4]; - UINT8 m_sound2[4]; - UINT8 m_layer_ctrl; + uint8_t m_sound[4]; + uint8_t m_sound2[4]; + uint8_t m_layer_ctrl; /* devices */ required_device m_subcpu; @@ -61,9 +61,9 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_angelkds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_angelkds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int enable_n); required_device m_maincpu; required_device m_gfxdecode; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; }; diff --git a/src/mame/includes/apollo.h b/src/mame/includes/apollo.h index a654c8e4644..8997bcc5721 100644 --- a/src/mame/includes/apollo.h +++ b/src/mame/includes/apollo.h @@ -78,15 +78,15 @@ int apollo_is_dn5500(void); int apollo_is_dsp3x00(void); // get the ram configuration byte -UINT8 apollo_get_ram_config_byte(void); +uint8_t apollo_get_ram_config_byte(void); //apollo_get_node_id - get the node id -UINT32 apollo_get_node_id(void); +uint32_t apollo_get_node_id(void); // should be called by the CPU core before executing each instruction int apollo_instruction_hook(m68000_base_device *device, offs_t curpc); -void apollo_set_cache_status_register(device_t *device,UINT8 mask, UINT8 data); +void apollo_set_cache_status_register(device_t *device,uint8_t mask, uint8_t data); /*----------- machine/apollo.c -----------*/ @@ -129,7 +129,7 @@ public: { } required_device m_maincpu; - required_shared_ptr m_messram_ptr; + required_shared_ptr m_messram_ptr; required_device m_dma8237_1; required_device m_dma8237_2; @@ -249,8 +249,8 @@ public: DECLARE_READ32_MEMBER(apollo_instruction_hook); private: - UINT32 ptm_counter; - UINT8 sio_output_data; + uint32_t ptm_counter; + uint8_t sio_output_data; int m_dma_channel; bool m_cur_eop; emu_timer *m_dn3000_timer; @@ -302,9 +302,9 @@ INPUT_PORTS_EXTERN(apollo_config); #define APOLLO_CSR_CR_FORCE_BAD_PARITY 0x0008 #define APOLLO_CSR_CR_PARITY_BYTE_MASK 0x00f0 -UINT16 apollo_csr_get_control_register(void); -UINT16 apollo_csr_get_status_register(void); -void apollo_csr_set_status_register(UINT16 mask, UINT16 data); +uint16_t apollo_csr_get_control_register(void); +uint16_t apollo_csr_get_status_register(void); +void apollo_csr_set_status_register(uint16_t mask, uint16_t data); /*----------- machine/apollo_sio.c -----------*/ @@ -327,7 +327,7 @@ class apollo_sio: public mc68681_device { public: apollo_sio(const machine_config &mconfig, const char *tag, - device_t *owner, UINT32 clock); + device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); @@ -336,8 +336,8 @@ protected: virtual void device_reset() override; private: - UINT8 m_csrb; - UINT8 m_ip6; + uint8_t m_csrb; + uint8_t m_ip6; }; extern const device_type APOLLO_SIO; @@ -353,7 +353,7 @@ class apollo_ni: public device_t, public device_image_interface { public: // construction/destruction - apollo_ni(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apollo_ni(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual ~apollo_ni(); virtual iodevice_t image_type() const override { return IO_ROM; } @@ -382,8 +382,8 @@ protected: virtual void device_reset() override; private: - void set_node_id(UINT32 node_id); - UINT32 m_node_id; + void set_node_id(uint32_t node_id); + uint32_t m_node_id; }; // device type definition @@ -396,11 +396,11 @@ extern const device_type APOLLO_NI; class apollo_graphics_15i : public device_t { public: - apollo_graphics_15i(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - apollo_graphics_15i(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, device_type type, const char *name, const char *shortname, const char *source); + apollo_graphics_15i(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + apollo_graphics_15i(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, device_type type, const char *name, const char *shortname, const char *source); ~apollo_graphics_15i(); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // monochrome control DECLARE_READ8_MEMBER( apollo_mcr_r ); @@ -433,100 +433,100 @@ protected: class lut_fifo; class bt458; - const char *cr_text(offs_t offset, UINT8 data, UINT8 rw); + const char *cr_text(offs_t offset, uint8_t data, uint8_t rw); void increment_h_clock(); void increment_v_clock(); void increment_p_clock(); void log_cr1(const char * text); - void set_cr1(UINT8 data); - void set_cr3a(UINT8 data); - void set_cr3b(UINT8 data); - void set_lut_cr(UINT8 data); + void set_cr1(uint8_t data); + void set_cr3a(uint8_t data); + void set_cr3b(uint8_t data); + void set_lut_cr(uint8_t data); void register_vblank_callback(); - UINT32 set_msb0(UINT32 value, UINT8 data) + uint32_t set_msb0(uint32_t value, uint8_t data) { return (value & 0xffffff00) | data; } - UINT32 set_lsb0(UINT32 value, UINT8 data) + uint32_t set_lsb0(uint32_t value, uint8_t data) { return (value & 0xffff00ff) | (data << 8); } - UINT32 set_msb1(UINT32 value, UINT8 data) + uint32_t set_msb1(uint32_t value, uint8_t data) { return (value & 0xff00ffff) | (data << 16); } - UINT32 set_lsb1(UINT32 value, UINT8 data) + uint32_t set_lsb1(uint32_t value, uint8_t data) { return (value & 0x00ffffff) | (data << 24); } - UINT8 get_msb1(UINT32 value) + uint8_t get_msb1(uint32_t value) { return (value >> 16) & 0xff; } - UINT8 get_lsb1(UINT32 value) + uint8_t get_lsb1(uint32_t value) { return (value >> 24) & 0xff; } void set_status_rmw(); - UINT16 rop(UINT16 dest_data, UINT16 src_data, UINT8 plane); - void set_source_data(UINT32 offset); - UINT32 get_source_data(UINT8 plane); - void blt(UINT32 dest_addr, UINT16 mem_mask); + uint16_t rop(uint16_t dest_data, uint16_t src_data, uint8_t plane); + void set_source_data(uint32_t offset); + uint32_t get_source_data(uint8_t plane); + void blt(uint32_t dest_addr, uint16_t mem_mask); - UINT8 get_pixel(UINT32 offset, UINT16 mask); - UINT8 c4p_read_adc(UINT8 data); - UINT8 c8p_read_adc(UINT8 data); + uint8_t get_pixel(uint32_t offset, uint16_t mask); + uint8_t c4p_read_adc(uint8_t data); + uint8_t c8p_read_adc(uint8_t data); void screen_update1(bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: - UINT16 m_n_planes; - UINT16 m_width; - UINT16 m_height; - UINT16 m_buffer_width; - UINT16 m_buffer_height; - - UINT8 m_sr; - UINT8 m_device_id; - UINT16 m_write_enable_register; - UINT32 m_rop_register; - UINT16 m_diag_mem_request; - UINT8 m_cr0; - UINT8 m_cr1; - UINT8 m_cr2; - UINT8 m_cr2b; - UINT8 m_cr2_s_data; - UINT8 m_cr2_s_plane; - UINT8 m_cr2_d_plane; - UINT8 m_cr3a; - UINT8 m_cr3b; - UINT8 m_ad_result; - UINT8 m_ad_pending; - - UINT8 m_lut_control; - UINT8 m_lut_data; - - UINT8 m_update_flag; - UINT8 m_update_pending; - - UINT8 m_blt_cycle_count; - UINT32 m_image_offset; - UINT32 m_guard_latch[8]; + uint16_t m_n_planes; + uint16_t m_width; + uint16_t m_height; + uint16_t m_buffer_width; + uint16_t m_buffer_height; + + uint8_t m_sr; + uint8_t m_device_id; + uint16_t m_write_enable_register; + uint32_t m_rop_register; + uint16_t m_diag_mem_request; + uint8_t m_cr0; + uint8_t m_cr1; + uint8_t m_cr2; + uint8_t m_cr2b; + uint8_t m_cr2_s_data; + uint8_t m_cr2_s_plane; + uint8_t m_cr2_d_plane; + uint8_t m_cr3a; + uint8_t m_cr3b; + uint8_t m_ad_result; + uint8_t m_ad_pending; + + uint8_t m_lut_control; + uint8_t m_lut_data; + + uint8_t m_update_flag; + uint8_t m_update_pending; + + uint8_t m_blt_cycle_count; + uint32_t m_image_offset; + uint32_t m_guard_latch[8]; int m_h_clock; int m_v_clock; int m_p_clock; int m_data_clock; - std::unique_ptr m_image_memory; + std::unique_ptr m_image_memory; int m_image_plane_size; int m_image_memory_size; - UINT32 m_color_lookup_table[16]; + uint32_t m_color_lookup_table[16]; lut_fifo *m_lut_fifo; bt458 *m_bt458; @@ -555,7 +555,7 @@ public: m_put_index = 0; } - void put(const UINT8 data) + void put(const uint8_t data) { if (!is_full()) { @@ -564,9 +564,9 @@ public: } } - UINT8 get() + uint8_t get() { - UINT8 data = is_empty() ? 0xff : m_data[m_get_index]; + uint8_t data = is_empty() ? 0xff : m_data[m_get_index]; m_get_index = (m_get_index + 1) % m_size; return data; } @@ -582,10 +582,10 @@ public: } private: - UINT16 m_size; - UINT16 m_get_index; - UINT16 m_put_index; - UINT8 m_data[LUT_FIFO_SIZE]; + uint16_t m_size; + uint16_t m_get_index; + uint16_t m_put_index; + uint8_t m_data[LUT_FIFO_SIZE]; }; //************************************************************************** @@ -598,9 +598,9 @@ public: bt458(running_machine &running_machine); void start(); void reset(); - UINT8 read(UINT8 c10); - void write(UINT8 data, UINT8 c10); - UINT32 get_rgb(UINT8 index); + uint8_t read(uint8_t c10); + void write(uint8_t data, uint8_t c10); + uint32_t get_rgb(uint8_t index); private: running_machine &machine() const @@ -609,17 +609,17 @@ private: return *m_machine; } - UINT8 m_color_counter; - UINT8 m_red; - UINT8 m_green; + uint8_t m_color_counter; + uint8_t m_red; + uint8_t m_green; - UINT8 m_address_register; - UINT32 m_color_palette_RAM[256]; - UINT32 m_overlay_color[4]; - UINT8 m_read_mask_register; - UINT8 m_blink_mask_register; - UINT8 m_command_register; - UINT8 m_control_test_register; + uint8_t m_address_register; + uint32_t m_color_palette_RAM[256]; + uint32_t m_overlay_color[4]; + uint8_t m_read_mask_register; + uint8_t m_blink_mask_register; + uint8_t m_command_register; + uint8_t m_control_test_register; running_machine *m_machine; }; @@ -635,7 +635,7 @@ MACHINE_CONFIG_EXTERN( apollo_graphics ); class apollo_graphics_19i : public apollo_graphics_15i { public: - apollo_graphics_19i(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + apollo_graphics_19i(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: // device-level overrides virtual void device_config_complete() override; @@ -675,7 +675,7 @@ class apollo_stdio_device: public device_t, public device_serial_interface public: // construction/destruction apollo_stdio_device(const machine_config &mconfig, const char *tag, - device_t *owner, UINT32 clock); + device_t *owner, uint32_t clock); template static devcb_base &set_tx_cb(device_t &device, _Object object) { @@ -696,11 +696,11 @@ private: virtual void tra_callback(); // Tx send bit TIMER_CALLBACK_MEMBER( poll_timer ); - void xmit_char(UINT8 data); + void xmit_char(uint8_t data); 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; diff --git a/src/mame/includes/apple2.h b/src/mame/includes/apple2.h index bc5979fb60e..7b51d874c48 100644 --- a/src/mame/includes/apple2.h +++ b/src/mame/includes/apple2.h @@ -101,9 +101,9 @@ enum bank_disposition_t struct apple2_meminfo { - UINT32 read_mem; + uint32_t read_mem; read8_delegate *read_handler; - UINT32 write_mem; + uint32_t write_mem; write8_delegate *write_handler; }; @@ -118,8 +118,8 @@ struct apple2_memmap_entry struct apple2_memmap_config { int first_bank; - UINT8 *auxmem; - UINT32 auxmem_length; + uint8_t *auxmem; + uint32_t auxmem_length; const apple2_memmap_entry *memmap; }; @@ -168,10 +168,10 @@ public: optional_device m_laserudc; optional_device m_iicpiwm; - UINT32 m_flags, m_flags_mask; - INT32 m_a2_cnxx_slot; - UINT32 m_a2_mask; - UINT32 m_a2_set; + uint32_t m_flags, m_flags_mask; + int32_t m_a2_cnxx_slot; + uint32_t m_a2_mask; + uint32_t m_a2_set; int m_a2_speaker_state; double m_joystick_x1_time; double m_joystick_y1_time; @@ -180,30 +180,30 @@ public: apple2_memmap_config m_mem_config; std::unique_ptr m_current_meminfo; int m_fdc_diskreg; - const UINT8 *m_a2_videoram, *m_a2_videoaux, *m_textgfx_data; - UINT32 m_a2_videomask, m_textgfx_datalen; - UINT32 m_old_a2; + const uint8_t *m_a2_videoram, *m_a2_videoaux, *m_textgfx_data; + uint32_t m_a2_videomask, m_textgfx_datalen; + uint32_t m_old_a2; int m_fgcolor; int m_bgcolor; int m_flash; int m_alt_charset_value; - std::unique_ptr m_hires_artifact_map; - std::unique_ptr m_dhires_artifact_map; + std::unique_ptr m_hires_artifact_map; + std::unique_ptr m_dhires_artifact_map; bool m_monochrome_dhr; int m_inh_slot; int m_reset_flag; - UINT8 *m_rambase; + uint8_t *m_rambase; - UINT8 *m_rom, *m_slot_ram; - UINT32 m_rom_length, m_slot_length; + uint8_t *m_rom, *m_slot_ram; + uint32_t m_rom_length, m_slot_length; machine_type_t m_machinetype; device_a2eauxslot_card_interface *m_auxslotdevice; - UINT16 m_lastchar, m_strobe; - UINT8 m_transchar; + uint16_t m_lastchar, m_strobe; + uint8_t m_transchar; READ8_MEMBER(apple2_c0xx_r); WRITE8_MEMBER(apple2_c0xx_w); @@ -285,7 +285,7 @@ public: WRITE8_MEMBER(apple2_cfff_w); void apple2_refresh_delegates(); - int apple2_pressed_specialkey(UINT8 key); + int apple2_pressed_specialkey(uint8_t key); read8_delegate read_delegates_master[4]; write8_delegate write_delegates_master[3]; @@ -335,7 +335,7 @@ public: DECLARE_VIDEO_START(apple2p); DECLARE_VIDEO_START(apple2e); DECLARE_VIDEO_START(apple2c); - UINT32 screen_update_apple2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_apple2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(apple2_interrupt); DECLARE_WRITE_LINE_MEMBER(a2bus_irq_w); DECLARE_WRITE_LINE_MEMBER(a2bus_nmi_w); @@ -348,31 +348,31 @@ public: virtual void machine_reset() override; void apple2_setup_memory(const apple2_memmap_config *config); void apple2_update_memory(); - inline UINT32 effective_a2(); - UINT32 compute_video_address(int col, int row); + inline uint32_t effective_a2(); + uint32_t compute_video_address(int col, int row); void adjust_begin_and_end_row(const rectangle &cliprect, int *beginrow, int *endrow); - inline void apple2_plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, - const UINT8 *textgfx_data, UINT32 textgfx_datalen, UINT32 my_a2); + inline void apple2_plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, uint32_t code, + const uint8_t *textgfx_data, uint32_t textgfx_datalen, uint32_t my_a2); void apple2_text_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int page, int beginrow, int endrow); void apple2_lores_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int page, int beginrow, int endrow); void apple2_hires_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int page, int beginrow, int endrow); - void apple2_video_start(const UINT8 *vram, const UINT8 *aux_vram, UINT32 ignored_softswitches, int hires_modulo); - void apple2_setvar(UINT32 val, UINT32 mask); - UINT8 apple2_getfloatingbusvalue(); + void apple2_video_start(const uint8_t *vram, const uint8_t *aux_vram, uint32_t ignored_softswitches, int hires_modulo); + void apple2_setvar(uint32_t val, uint32_t mask); + uint8_t apple2_getfloatingbusvalue(); int apple2_fdc_has_35(); int apple2_fdc_has_525(); - void apple2_iwm_setdiskreg(UINT8 data); + void apple2_iwm_setdiskreg(uint8_t data); void apple2_init_common(); void apple2eplus_init_common(void *apple2cp_ce00_ram); - INT8 apple2_slotram_r(address_space &space, int slotnum, int offset); + int8_t apple2_slotram_r(address_space &space, int slotnum, int offset); int a2_no_ctrl_reset(); private: // Laser 128EX2 slot 5 Apple Memory Expansion emulation vars - UINT8 m_exp_bankhior; + uint8_t m_exp_bankhior; int m_exp_addrmask; - UINT8 m_exp_regs[0x10]; - std::unique_ptr m_exp_ram; + uint8_t m_exp_regs[0x10]; + std::unique_ptr m_exp_ram; int m_exp_wptr, m_exp_liveptr; }; /*----------- defined in drivers/apple2.c -----------*/ diff --git a/src/mame/includes/apple2gs.h b/src/mame/includes/apple2gs.h index 6812cc2b466..b72dc4b08e6 100644 --- a/src/mame/includes/apple2gs.h +++ b/src/mame/includes/apple2gs.h @@ -84,8 +84,8 @@ enum adbstate_t #define IRQ_DOC 0x80 #define IRQ_SLOT 0x100 -void apple2gs_add_irq(running_machine &machine, UINT16 irq_mask); -void apple2gs_remove_irq(running_machine &machine, UINT16 irq_mask); +void apple2gs_add_irq(running_machine &machine, uint16_t irq_mask); +void apple2gs_remove_irq(running_machine &machine, uint16_t irq_mask); class apple2gs_state : public apple2_state { @@ -113,59 +113,59 @@ public: required_ioport m_adb_mousex, m_adb_mousey; required_device m_palette; - std::unique_ptr m_slowmem; - UINT8 m_newvideo; - UINT16 m_bordercolor; - UINT8 m_vgcint; - UINT8 m_langsel; - UINT8 m_sltromsel; - UINT8 m_cyareg; - UINT8 m_inten; - UINT8 m_intflag; - UINT8 m_shadow; - UINT16 m_pending_irqs; - UINT8 m_mouse_x; - UINT8 m_mouse_y; - INT8 m_mouse_dx; - INT8 m_mouse_dy; + std::unique_ptr m_slowmem; + uint8_t m_newvideo; + uint16_t m_bordercolor; + uint8_t m_vgcint; + uint8_t m_langsel; + uint8_t m_sltromsel; + uint8_t m_cyareg; + uint8_t m_inten; + uint8_t m_intflag; + uint8_t m_shadow; + uint16_t m_pending_irqs; + uint8_t m_mouse_x; + uint8_t m_mouse_y; + int8_t m_mouse_dx; + int8_t m_mouse_dy; device_t *m_cur_slot6_image; emu_timer *m_scanline_timer; emu_timer *m_clock_timer; emu_timer *m_qsecond_timer; - UINT8 m_clock_data; - UINT8 m_clock_control; - UINT8 m_clock_read; - UINT8 m_clock_reg1; + uint8_t m_clock_data; + uint8_t m_clock_control; + uint8_t m_clock_read; + uint8_t m_clock_reg1; apple2gs_clock_mode m_clock_mode; - UINT32 m_clock_curtime; + uint32_t m_clock_curtime; seconds_t m_clock_curtime_interval; - UINT8 m_clock_bram[256]; + uint8_t m_clock_bram[256]; #if !RUN_ADB_MICRO adbstate_t m_adb_state; - UINT8 m_adb_command; - UINT8 m_adb_mode; - UINT8 m_adb_kmstatus; - UINT8 m_adb_latent_result; - INT32 m_adb_command_length; - INT32 m_adb_command_pos; - UINT8 m_adb_command_bytes[8]; - UINT8 m_adb_response_bytes[8]; - UINT8 m_adb_response_length; - INT32 m_adb_response_pos; - UINT8 m_adb_memory[0x100]; + uint8_t m_adb_command; + uint8_t m_adb_mode; + uint8_t m_adb_kmstatus; + uint8_t m_adb_latent_result; + int32_t m_adb_command_length; + int32_t m_adb_command_pos; + uint8_t m_adb_command_bytes[8]; + uint8_t m_adb_response_bytes[8]; + uint8_t m_adb_response_length; + int32_t m_adb_response_pos; + uint8_t m_adb_memory[0x100]; int m_adb_address_keyboard; int m_adb_address_mouse; #endif - UINT8 m_sndglu_ctrl; + uint8_t m_sndglu_ctrl; int m_sndglu_addr; int m_sndglu_dummy_read; std::unique_ptr m_legacy_gfx; bool m_is_rom3; - UINT8 m_echo_bank; - UINT64 m_last_adb_time; + uint8_t m_echo_bank; + uint64_t m_last_adb_time; int m_adb_dtime; - UINT32 m_a2_palette[16]; - UINT32 m_shr_palette[256]; + uint32_t m_a2_palette[16]; + uint32_t m_shr_palette[256]; READ8_MEMBER( apple2gs_c0xx_r ); WRITE8_MEMBER( apple2gs_c0xx_w ); @@ -176,8 +176,8 @@ public: WRITE8_MEMBER( apple2gs_main4000_w ); WRITE8_MEMBER( apple2gs_aux4000_w ); - UINT8 adb_read_datareg(); - UINT8 adb_read_kmstatus(); + uint8_t adb_read_datareg(); + uint8_t adb_read_kmstatus(); void apple2gs_refresh_delegates(); @@ -190,7 +190,7 @@ public: DECLARE_PALETTE_INIT(apple2gs); DECLARE_MACHINE_START(apple2gsr1); DECLARE_MACHINE_START(apple2gscommon); - UINT32 screen_update_apple2gs(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_apple2gs(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(apple2gs_clock_tick); TIMER_CALLBACK_MEMBER(apple2gs_qsecond_tick); TIMER_CALLBACK_MEMBER(apple2gs_scanline_tick); @@ -201,13 +201,13 @@ public: // ADB MCU and ADB GLU stuff #if RUN_ADB_MICRO - UINT8 m_glu_regs[8], m_glu_bus, m_glu_sysstat; + uint8_t m_glu_regs[8], m_glu_bus, m_glu_sysstat; bool m_glu_mcu_read_kgs, m_glu_816_read_dstat, m_glu_mouse_read_stat, m_adb_line; - UINT8 keyglu_mcu_read(UINT8 offset); - void keyglu_mcu_write(UINT8 offset, UINT8 data); - UINT8 keyglu_816_read(UINT8 offset); - void keyglu_816_write(UINT8 offset, UINT8 data); + uint8_t keyglu_mcu_read(uint8_t offset); + void keyglu_mcu_write(uint8_t offset, uint8_t data); + uint8_t keyglu_816_read(uint8_t offset); + void keyglu_816_write(uint8_t offset, uint8_t data); DECLARE_READ8_MEMBER(adbmicro_p0_in); DECLARE_READ8_MEMBER(adbmicro_p1_in); @@ -219,27 +219,27 @@ public: DECLARE_WRITE8_MEMBER(adbmicro_p3_out); #endif void process_clock(); - const char *apple2gs_irq_name(UINT16 irq_mask); - void apple2gs_add_irq(UINT16 irq_mask); - void apple2gs_remove_irq(UINT16 irq_mask); - UINT8 adb_read_memory(UINT32 address); - void adb_write_memory(UINT32 address, UINT8 data); - void adb_set_mode(UINT8 mode); - void adb_set_config(UINT8 b1, UINT8 b2, UINT8 b3); - void adb_post_response(const UINT8 *bytes, size_t length); - void adb_post_response_1(UINT8 b); - void adb_post_response_2(UINT8 b1, UINT8 b2); + const char *apple2gs_irq_name(uint16_t irq_mask); + void apple2gs_add_irq(uint16_t irq_mask); + void apple2gs_remove_irq(uint16_t irq_mask); + uint8_t adb_read_memory(uint32_t address); + void adb_write_memory(uint32_t address, uint8_t data); + void adb_set_mode(uint8_t mode); + void adb_set_config(uint8_t b1, uint8_t b2, uint8_t b3); + void adb_post_response(const uint8_t *bytes, size_t length); + void adb_post_response_1(uint8_t b); + void adb_post_response_2(uint8_t b1, uint8_t b2); void adb_do_command(); - void adb_write_datareg(UINT8 data); - void adb_write_kmstatus(UINT8 data); - UINT8 adb_read_mousedata(); - INT8 seven_bit_diff(UINT8 v1, UINT8 v2); + void adb_write_datareg(uint8_t data); + void adb_write_kmstatus(uint8_t data); + uint8_t adb_read_mousedata(); + int8_t seven_bit_diff(uint8_t v1, uint8_t v2); void adb_check_mouse(); - void apple2gs_set_scanint(UINT8 data); + void apple2gs_set_scanint(uint8_t data); int apple2gs_get_vpos(); - UINT8 *apple2gs_getslotmem(offs_t address); - UINT8 apple2gs_xxCxxx_r(address_space &space, offs_t address); - void apple2gs_xxCxxx_w(address_space &space, offs_t address, UINT8 data); + uint8_t *apple2gs_getslotmem(offs_t address); + uint8_t apple2gs_xxCxxx_r(address_space &space, offs_t address); + void apple2gs_xxCxxx_w(address_space &space, offs_t address, uint8_t data); void apple2gs_setup_memory(); DECLARE_READ8_MEMBER( gssnd_r ); diff --git a/src/mame/includes/apple3.h b/src/mame/includes/apple3.h index 68ba39a40e2..43446b315fa 100644 --- a/src/mame/includes/apple3.h +++ b/src/mame/includes/apple3.h @@ -92,7 +92,7 @@ public: DECLARE_DRIVER_INIT(apple3); DECLARE_MACHINE_RESET(apple3); DECLARE_VIDEO_START(apple3); - UINT32 screen_update_apple3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_apple3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(apple3_interrupt); TIMER_CALLBACK_MEMBER(scanstart_cb); TIMER_CALLBACK_MEMBER(scanend_cb); @@ -110,11 +110,11 @@ public: void graphics_chgr(bitmap_ind16 &bitmap, const rectangle &cliprect); void graphics_shgr(bitmap_ind16 &bitmap, const rectangle &cliprect); void graphics_chires(bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT8 *apple3_bankaddr(UINT16 bank, offs_t offset); - UINT8 *apple3_get_zpa_addr(offs_t offset); + uint8_t *apple3_bankaddr(uint16_t bank, offs_t offset); + uint8_t *apple3_get_zpa_addr(offs_t offset); void apple3_update_memory(); - void apple3_via_out(UINT8 *var, UINT8 data); - UINT8 *apple3_get_indexed_addr(offs_t offset); + void apple3_via_out(uint8_t *var, uint8_t data); + uint8_t *apple3_get_indexed_addr(offs_t offset); TIMER_DEVICE_CALLBACK_MEMBER(apple3_c040_tick); DECLARE_PALETTE_INIT(apple3); void apple3_irq_update(); @@ -129,34 +129,34 @@ public: DECLARE_WRITE_LINE_MEMBER(a2bus_nmi_w); // these need to be public for now - UINT32 m_flags; + uint32_t m_flags; int m_enable_mask; private: int m_acia_irq; - UINT8 m_via_0_a; - UINT8 m_via_0_b; - UINT8 m_via_1_a; - UINT8 m_via_1_b; + uint8_t m_via_0_a; + uint8_t m_via_0_b; + uint8_t m_via_1_a; + uint8_t m_via_1_b; int m_via_0_irq; int m_via_1_irq; offs_t m_zpa; - UINT8 m_last_n; - UINT8 m_char_mem[0x800]; - std::unique_ptr m_hgr_map; + uint8_t m_last_n; + uint8_t m_char_mem[0x800]; + std::unique_ptr m_hgr_map; bool m_sync; bool m_rom_has_been_disabled; int m_cnxx_slot; - UINT8 m_indir_bank; + uint8_t m_indir_bank; - UINT8 *m_bank2, *m_bank3, *m_bank4, *m_bank5, *m_bank8, *m_bank9; - UINT8 *m_bank10, *m_bank11; - UINT8 *m_bank6, *m_bank7rd, *m_bank7wr; + uint8_t *m_bank2, *m_bank3, *m_bank4, *m_bank5, *m_bank8, *m_bank9; + uint8_t *m_bank10, *m_bank11; + uint8_t *m_bank6, *m_bank7rd, *m_bank7wr; int m_bell_state; int m_c040_time; - UINT16 m_lastchar, m_strobe; - UINT8 m_transchar; + uint16_t m_lastchar, m_strobe; + uint8_t m_transchar; emu_timer *m_scanstart, *m_scanend; diff --git a/src/mame/includes/appoooh.h b/src/mame/includes/appoooh.h index 94cbae0b9fb..1341db94218 100644 --- a/src/mame/includes/appoooh.h +++ b/src/mame/includes/appoooh.h @@ -20,13 +20,13 @@ public: m_msm(*this, "msm") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_fg_colorram; - required_shared_ptr m_spriteram_2; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_bg_colorram; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_spriteram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_fg_colorram; + required_shared_ptr m_spriteram_2; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_bg_colorram; + optional_shared_ptr m_decrypted_opcodes; /* video-related */ tilemap_t *m_fg_tilemap; @@ -35,8 +35,8 @@ public: int m_priority; /* sound-related */ - UINT32 m_adpcm_data; - UINT32 m_adpcm_address; + uint32_t m_adpcm_data; + uint32_t m_adpcm_address; /* devices */ required_device m_maincpu; @@ -44,7 +44,7 @@ public: required_device m_palette; required_device m_msm; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(adpcm_w); DECLARE_WRITE8_MEMBER(scroll_w); DECLARE_WRITE8_MEMBER(fg_videoram_w); @@ -60,11 +60,11 @@ public: DECLARE_VIDEO_START(appoooh); DECLARE_PALETTE_INIT(appoooh); DECLARE_PALETTE_INIT(robowres); - UINT32 screen_update_appoooh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_robowres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_appoooh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_robowres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); - void appoooh_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, UINT8 *sprite ); - void robowres_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, UINT8 *sprite ); + void appoooh_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, uint8_t *sprite ); + void robowres_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, uint8_t *sprite ); DECLARE_WRITE_LINE_MEMBER(adpcm_int); }; diff --git a/src/mame/includes/aquarium.h b/src/mame/includes/aquarium.h index 257a5721097..89dd5e2f0c8 100644 --- a/src/mame/includes/aquarium.h +++ b/src/mame/includes/aquarium.h @@ -25,10 +25,10 @@ public: { } /* memory pointers */ - required_shared_ptr m_mid_videoram; - required_shared_ptr m_bak_videoram; - required_shared_ptr m_txt_videoram; - required_shared_ptr m_scroll; + required_shared_ptr m_mid_videoram; + required_shared_ptr m_bak_videoram; + required_shared_ptr m_txt_videoram; + required_shared_ptr m_scroll; /* video-related */ tilemap_t *m_txt_tilemap; @@ -64,8 +64,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_aquarium(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT8 aquarium_snd_bitswap( UINT8 scrambled_data ); + uint32_t screen_update_aquarium(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint8_t aquarium_snd_bitswap( uint8_t scrambled_data ); void mix_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_mask, int priority_value); bitmap_ind16 m_temp_sprite_bitmap; }; diff --git a/src/mame/includes/aquarius.h b/src/mame/includes/aquarius.h index c9325f074b6..25adea20e3b 100644 --- a/src/mame/includes/aquarius.h +++ b/src/mame/includes/aquarius.h @@ -50,8 +50,8 @@ public: required_device m_speaker; required_device m_cart; required_device m_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; required_ioport m_y0; required_ioport m_y1; required_ioport m_y2; @@ -65,7 +65,7 @@ public: required_device m_tea1002; required_device m_palette; - UINT8 m_scrambler; + uint8_t m_scrambler; tilemap_t *m_tilemap; DECLARE_WRITE8_MEMBER(aquarius_videoram_w); @@ -83,7 +83,7 @@ public: TILE_GET_INFO_MEMBER(aquarius_gettileinfo); virtual void video_start() override; DECLARE_PALETTE_INIT(aquarius); - UINT32 screen_update_aquarius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aquarius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_INPUT_CHANGED_MEMBER(aquarius_reset); }; #endif /* AQUARIUS_H_ */ diff --git a/src/mame/includes/arabian.h b/src/mame/includes/arabian.h index 0dc5fc7fde2..4ff951bd724 100644 --- a/src/mame/includes/arabian.h +++ b/src/mame/includes/arabian.h @@ -20,20 +20,20 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_custom_cpu_ram; - required_shared_ptr m_blitter; + required_shared_ptr m_custom_cpu_ram; + required_shared_ptr m_blitter; - std::unique_ptr m_main_bitmap; - std::unique_ptr m_converted_gfx; + std::unique_ptr m_main_bitmap; + std::unique_ptr m_converted_gfx; /* video-related */ - UINT8 m_video_control; - UINT8 m_flip_screen; + uint8_t m_video_control; + uint8_t m_flip_screen; /* MCU */ - UINT8 m_mcu_port_o; - UINT8 m_mcu_port_p; - UINT8 m_mcu_port_r[4]; + uint8_t m_mcu_port_o; + uint8_t m_mcu_port_p; + uint8_t m_mcu_port_r[4]; DECLARE_READ8_MEMBER(mcu_port_r_r); DECLARE_WRITE8_MEMBER(mcu_port_r_w); DECLARE_READ8_MEMBER(mcu_portk_r); @@ -47,8 +47,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(arabian); - UINT32 screen_update_arabian(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void blit_area( UINT8 plane, UINT16 src, UINT8 x, UINT8 y, UINT8 sx, UINT8 sy ); + uint32_t screen_update_arabian(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void blit_area( uint8_t plane, uint16_t src, uint8_t x, uint8_t y, uint8_t sx, uint8_t sy ); required_device m_maincpu; required_device m_mcu; required_device m_palette; diff --git a/src/mame/includes/arcadecl.h b/src/mame/includes/arcadecl.h index 056875df906..748ad6a6a66 100644 --- a/src/mame/includes/arcadecl.h +++ b/src/mame/includes/arcadecl.h @@ -21,7 +21,7 @@ public: required_device m_oki; optional_device m_mob; - required_shared_ptr m_bitmap; + required_shared_ptr m_bitmap; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; @@ -30,7 +30,7 @@ public: DECLARE_MACHINE_START(arcadecl); DECLARE_MACHINE_RESET(arcadecl); DECLARE_VIDEO_START(arcadecl); - UINT32 screen_update_arcadecl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_arcadecl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void arcadecl_bitmap_render(bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; diff --git a/src/mame/includes/arcadia.h b/src/mame/includes/arcadia.h index 164c095852c..97e51c8b392 100644 --- a/src/mame/includes/arcadia.h +++ b/src/mame/includes/arcadia.h @@ -62,36 +62,36 @@ public: int m_lines26; int m_multicolor; struct { int x, y; } m_pos[4]; - UINT8 m_bg[262][16+2*XPOS/8]; - UINT8 m_rectangle[0x40][8]; - UINT8 m_chars[0x40][8]; + uint8_t m_bg[262][16+2*XPOS/8]; + uint8_t m_rectangle[0x40][8]; + uint8_t m_chars[0x40][8]; int m_breaker; union { - UINT8 data[0x400]; + uint8_t data[0x400]; struct { // 0x1800 - UINT8 chars1[13][16]; - UINT8 ram1[2][16]; - struct { UINT8 y,x; } pos[4]; - UINT8 ram2[4]; - UINT8 vpos; - UINT8 sound1, sound2; - UINT8 char_line; + uint8_t chars1[13][16]; + uint8_t ram1[2][16]; + struct { uint8_t y,x; } pos[4]; + uint8_t ram2[4]; + uint8_t vpos; + uint8_t sound1, sound2; + uint8_t char_line; // 0x1900 - UINT8 pad1a, pad1b, pad1c, pad1d; - UINT8 pad2a, pad2b, pad2c, pad2d; - UINT8 keys, unmapped3[0x80-9]; - UINT8 chars[8][8]; - UINT8 unknown[0x38]; - UINT8 pal[4]; - UINT8 collision_bg, + uint8_t pad1a, pad1b, pad1c, pad1d; + uint8_t pad2a, pad2b, pad2c, pad2d; + uint8_t keys, unmapped3[0x80-9]; + uint8_t chars[8][8]; + uint8_t unknown[0x38]; + uint8_t pal[4]; + uint8_t collision_bg, collision_sprite; - UINT8 ad[2]; + uint8_t ad[2]; // 0x1a00 - UINT8 chars2[13][16]; - UINT8 ram3[3][16]; + uint8_t chars2[13][16]; + uint8_t ram3[3][16]; } d; } m_reg; std::unique_ptr m_bitmap; @@ -99,7 +99,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(arcadia); - UINT32 screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(video_line); protected: @@ -115,8 +115,8 @@ protected: required_ioport m_controller2_extra; required_ioport m_joysticks; - void draw_char(UINT8 *ch, int charcode, int y, int x); - void vh_draw_line(int y, UINT8 chars1[16]); + void draw_char(uint8_t *ch, int charcode, int y, int x); + void vh_draw_line(int y, uint8_t chars1[16]); int sprite_collision(int n1, int n2); void draw_sprites(); required_device m_maincpu; diff --git a/src/mame/includes/archimds.h b/src/mame/includes/archimds.h index 8b818c27022..bea394da1f8 100644 --- a/src/mame/includes/archimds.h +++ b/src/mame/includes/archimds.h @@ -84,15 +84,15 @@ public: DECLARE_WRITE_LINE_MEMBER( a310_kart_rx_w ); DECLARE_WRITE_LINE_MEMBER( a310_kart_tx_w ); - UINT8 m_i2c_clk; - INT16 m_memc_pages[0x2000]; // the logical RAM area is 32 megs, and the smallest page size is 4k - UINT32 m_vidc_regs[256]; - UINT8 m_cursor_vram[0x200]; - UINT8 m_ioc_regs[0x80/4]; - UINT8 m_vidc_bpp_mode; - UINT8 m_vidc_interlace; - - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint8_t m_i2c_clk; + int16_t m_memc_pages[0x2000]; // the logical RAM area is 32 megs, and the smallest page size is 4k + uint32_t m_vidc_regs[256]; + uint8_t m_cursor_vram[0x200]; + uint8_t m_ioc_regs[0x80/4]; + uint8_t m_vidc_bpp_mode; + uint8_t m_vidc_interlace; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; protected: @@ -125,19 +125,19 @@ private: DECLARE_READ32_MEMBER(ioc_ctrl_r); DECLARE_WRITE32_MEMBER(ioc_ctrl_w); - UINT32 *m_archimedes_memc_physmem; - UINT32 m_memc_pagesize; + uint32_t *m_archimedes_memc_physmem; + uint32_t m_memc_pagesize; int m_memc_latchrom; - UINT32 m_ioc_timercnt[4], m_ioc_timerout[4]; - UINT32 m_vidc_vidstart, m_vidc_vidend, m_vidc_vidinit, m_vidc_vidcur,m_vidc_cinit; - UINT32 m_vidc_sndstart, m_vidc_sndend, m_vidc_sndcur; - UINT8 m_video_dma_on,m_audio_dma_on; - UINT8 m_vidc_pixel_clk; - UINT8 m_vidc_stereo_reg[8]; + uint32_t m_ioc_timercnt[4], m_ioc_timerout[4]; + uint32_t m_vidc_vidstart, m_vidc_vidend, m_vidc_vidinit, m_vidc_vidcur,m_vidc_cinit; + uint32_t m_vidc_sndstart, m_vidc_sndend, m_vidc_sndcur; + uint8_t m_video_dma_on,m_audio_dma_on; + uint8_t m_vidc_pixel_clk; + uint8_t m_vidc_stereo_reg[8]; bool m_cursor_enabled; emu_timer *m_timer[4], *m_snd_timer, *m_vid_timer; emu_timer *m_vbl_timer; - UINT8 m_floppy_select; + uint8_t m_floppy_select; bool check_floppy_ready(); }; diff --git a/src/mame/includes/argus.h b/src/mame/includes/argus.h index 1274f9a5d58..c3956a5e3f0 100644 --- a/src/mame/includes/argus.h +++ b/src/mame/includes/argus.h @@ -30,40 +30,40 @@ public: required_device m_palette; required_device m_blend; - optional_shared_ptr m_bg0_scrollx; - optional_shared_ptr m_bg0_scrolly; - required_shared_ptr m_bg1_scrollx; - required_shared_ptr m_bg1_scrolly; - required_shared_ptr m_paletteram; - optional_shared_ptr m_txram; - optional_shared_ptr m_bg1ram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_butasan_bg1ram; + optional_shared_ptr m_bg0_scrollx; + optional_shared_ptr m_bg0_scrolly; + required_shared_ptr m_bg1_scrollx; + required_shared_ptr m_bg1_scrolly; + required_shared_ptr m_paletteram; + optional_shared_ptr m_txram; + optional_shared_ptr m_bg1ram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_butasan_bg1ram; // common - UINT8 m_bg_status; - UINT8 m_flipscreen; - UINT16 m_palette_intensity; + uint8_t m_bg_status; + uint8_t m_flipscreen; + uint16_t m_palette_intensity; // argus specific - std::unique_ptr m_dummy_bg0ram; + std::unique_ptr m_dummy_bg0ram; int m_lowbitscroll; int m_prvscrollx; // butasan specific - UINT8 *m_butasan_txram; - UINT8 *m_butasan_bg0ram; - UINT8 *m_butasan_bg0backram; - UINT8 *m_butasan_txbackram; - std::unique_ptr m_butasan_pagedram[2]; - UINT8 m_butasan_page_latch; - UINT8 m_butasan_bg1_status; - UINT8 m_butasan_unknown; + uint8_t *m_butasan_txram; + uint8_t *m_butasan_bg0ram; + uint8_t *m_butasan_bg0backram; + uint8_t *m_butasan_txbackram; + std::unique_ptr m_butasan_pagedram[2]; + uint8_t m_butasan_page_latch; + uint8_t m_butasan_bg1_status; + uint8_t m_butasan_unknown; // valtric specific - UINT8 m_valtric_mosaic; + uint8_t m_valtric_mosaic; bitmap_rgb32 m_mosaicbitmap; - UINT8 m_valtric_unknown; + uint8_t m_valtric_unknown; int m_mosaic; tilemap_t *m_tx_tilemap; @@ -113,9 +113,9 @@ public: DECLARE_VIDEO_START(butasan); DECLARE_VIDEO_RESET(butasan); - UINT32 screen_update_argus(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_valtric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_butasan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_argus(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_valtric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_butasan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline); TIMER_DEVICE_CALLBACK_MEMBER(butasan_scanline); diff --git a/src/mame/includes/arkanoid.h b/src/mame/includes/arkanoid.h index 1a13a1b8fcf..9acc4a3ef89 100644 --- a/src/mame/includes/arkanoid.h +++ b/src/mame/includes/arkanoid.h @@ -31,42 +31,42 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_protram; + required_shared_ptr m_videoram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_protram; /* video-related */ tilemap_t *m_bg_tilemap; - UINT8 m_gfxbank; - UINT8 m_palettebank; + uint8_t m_gfxbank; + uint8_t m_palettebank; /* input-related */ - UINT8 m_paddle_select; // selected by d008 bit 2 + uint8_t m_paddle_select; // selected by d008 bit 2 /* bootleg related */ int m_bootleg_id; - UINT8 m_bootleg_cmd; + uint8_t m_bootleg_cmd; /* mcu interface related */ bool m_Z80HasWritten; // z80 has written to latch flag - UINT8 m_fromZ80; // byte latch for z80->68705 comms + uint8_t m_fromZ80; // byte latch for z80->68705 comms bool m_MCUHasWritten; // 68705 has written to latch flag - UINT8 m_fromMCU; // byte latch for 68705->z80 comms + uint8_t m_fromMCU; // byte latch for 68705->z80 comms /* mcu internal related */ - UINT8 m_portA_in; - UINT8 m_portA_out; - UINT8 m_ddrA; - UINT8 m_portC_internal; - UINT8 m_portC_out; - UINT8 m_ddrC; - UINT8 m_tdr; - UINT8 m_tcr; + uint8_t m_portA_in; + uint8_t m_portA_out; + uint8_t m_ddrA; + uint8_t m_portC_internal; + uint8_t m_portC_out; + uint8_t m_ddrC; + uint8_t m_tdr; + uint8_t m_tcr; emu_timer *m_68705_timer; /* hexaa */ - UINT8 m_hexaa_from_main; - UINT8 m_hexaa_from_sub; + uint8_t m_hexaa_from_main; + uint8_t m_hexaa_from_sub; /* devices */ required_device m_maincpu; @@ -116,8 +116,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_arkanoid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hexa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_arkanoid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hexa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(timer_68705_increment); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void arkanoid_bootleg_init( ); diff --git a/src/mame/includes/armedf.h b/src/mame/includes/armedf.h index 9ebc22e86e6..1f7ff9149ec 100644 --- a/src/mame/includes/armedf.h +++ b/src/mame/includes/armedf.h @@ -32,22 +32,22 @@ public: required_device m_soundlatch; /* memory pointers */ - std::unique_ptr m_text_videoram; - required_shared_ptr m_spr_pal_clut; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; - UINT16 m_legion_cmd[4]; // legionjb only! + std::unique_ptr m_text_videoram; + required_shared_ptr m_spr_pal_clut; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + uint16_t m_legion_cmd[4]; // legionjb only! /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; tilemap_t *m_tx_tilemap; - UINT16 m_scroll_msb; - UINT16 m_vreg; - UINT16 m_fg_scrollx; - UINT16 m_fg_scrolly; - UINT16 m_bg_scrollx; - UINT16 m_bg_scrolly; + uint16_t m_scroll_msb; + uint16_t m_vreg; + uint16_t m_fg_scrollx; + uint16_t m_fg_scrolly; + uint16_t m_bg_scrollx; + uint16_t m_bg_scrolly; int m_scroll_type; int m_sprite_offy; int m_old_mcu_mode; @@ -98,10 +98,10 @@ public: DECLARE_MACHINE_RESET(armedf); DECLARE_VIDEO_START(terraf); DECLARE_VIDEO_START(armedf); - UINT32 screen_update_armedf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_armedf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); void armedf_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip,gfx_element *gfx, - UINT32 code,UINT32 color, UINT32 clut,int flipx,int flipy,int offsx,int offsy, + uint32_t code,uint32_t color, uint32_t clut,int flipx,int flipy,int offsx,int offsy, int transparent_color); }; @@ -112,12 +112,12 @@ public: : armedf_state(mconfig, type, tag), m_sharedram(*this, "sharedram") { } - required_shared_ptr m_sharedram; + required_shared_ptr m_sharedram; /* misc */ int m_read_latch; - UINT8 m_mcu_input_snippet; - UINT8 m_mcu_jsr_snippet; + uint8_t m_mcu_input_snippet; + uint8_t m_mcu_jsr_snippet; DECLARE_READ16_MEMBER(latch_r); DECLARE_WRITE16_MEMBER(sharedram_w); diff --git a/src/mame/includes/artmagic.h b/src/mame/includes/artmagic.h index 50a7726a828..5a4332b3ae8 100644 --- a/src/mame/includes/artmagic.h +++ b/src/mame/includes/artmagic.h @@ -33,19 +33,19 @@ public: required_device m_tms; required_device m_tlc34076; - required_shared_ptr m_control; - required_shared_ptr m_vram0; - required_shared_ptr m_vram1; + required_shared_ptr m_control; + required_shared_ptr m_vram0; + required_shared_ptr m_vram1; - UINT8 m_tms_irq; - UINT8 m_hack_irq; - UINT8 m_prot_input[16]; - UINT8 m_prot_input_index; - UINT8 m_prot_output[16]; - UINT8 m_prot_output_index; - UINT8 m_prot_output_bit; - UINT8 m_prot_bit_index; - UINT16 m_prot_save; + uint8_t m_tms_irq; + uint8_t m_hack_irq; + uint8_t m_prot_input[16]; + uint8_t m_prot_input_index; + uint8_t m_prot_output[16]; + uint8_t m_prot_output_index; + uint8_t m_prot_output_bit; + uint8_t m_prot_bit_index; + uint16_t m_prot_save; typedef void (artmagic_state::*prot_func)(); prot_func m_protection_handler; void ultennis_protection(); @@ -54,10 +54,10 @@ public: int m_xor[16]; int m_is_stoneball; - UINT16 *m_blitter_base; - UINT32 m_blitter_mask; - UINT16 m_blitter_data[8]; - UINT8 m_blitter_page; + uint16_t *m_blitter_base; + uint32_t m_blitter_mask; + uint16_t m_blitter_data[8]; + uint8_t m_blitter_page; attotime m_blitter_busy_until; DECLARE_WRITE16_MEMBER(control_w); DECLARE_READ16_MEMBER(ultennis_hack_r); @@ -82,7 +82,7 @@ public: void decrypt_ultennis(); void execute_blit(); void update_irq_state(); - inline UINT16 *address_to_vram(offs_t *address); + inline uint16_t *address_to_vram(offs_t *address); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/ashnojoe.h b/src/mame/includes/ashnojoe.h index 76470f3e568..74dbac38522 100644 --- a/src/mame/includes/ashnojoe.h +++ b/src/mame/includes/ashnojoe.h @@ -30,15 +30,15 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - UINT16 * m_tileram_1; - required_shared_ptr m_tileram_3; - required_shared_ptr m_tileram_4; - required_shared_ptr m_tileram_5; - required_shared_ptr m_tileram_2; - required_shared_ptr m_tileram_6; - required_shared_ptr m_tileram_7; - required_shared_ptr m_tileram; - required_shared_ptr m_tilemap_reg; + uint16_t * m_tileram_1; + required_shared_ptr m_tileram_3; + required_shared_ptr m_tileram_4; + required_shared_ptr m_tileram_5; + required_shared_ptr m_tileram_2; + required_shared_ptr m_tileram_6; + required_shared_ptr m_tileram_7; + required_shared_ptr m_tileram; + required_shared_ptr m_tilemap_reg; /* video-related */ tilemap_t *m_joetilemap; @@ -50,7 +50,7 @@ public: tilemap_t *m_joetilemap7; /* sound-related */ - UINT8 m_adpcm_byte; + uint8_t m_adpcm_byte; int m_soundlatch_status; int m_msm5205_vclk_toggle; @@ -88,6 +88,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_ashnojoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ashnojoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(ashnojoe_vclk_cb); }; diff --git a/src/mame/includes/asterix.h b/src/mame/includes/asterix.h index 04a65a6aee3..3deb52af3d7 100644 --- a/src/mame/includes/asterix.h +++ b/src/mame/includes/asterix.h @@ -30,13 +30,13 @@ public: int m_sprite_colorbase; int m_layer_colorbase[4]; int m_layerpri[3]; - UINT16 m_spritebank; + uint16_t m_spritebank; int m_tilebanks[4]; int m_spritebanks[4]; /* misc */ - UINT8 m_cur_control2; - UINT16 m_prot[2]; + uint8_t m_cur_control2; + uint16_t m_prot[2]; /* devices */ required_device m_maincpu; @@ -52,7 +52,7 @@ public: DECLARE_DRIVER_INIT(asterix); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_asterix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_asterix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(asterix_interrupt); K05324X_CB_MEMBER(sprite_callback); K056832_CB_MEMBER(tile_callback); diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h index f2eb4d0a750..25b4861b32a 100644 --- a/src/mame/includes/astrocde.h +++ b/src/mame/includes/astrocde.h @@ -66,8 +66,8 @@ public: optional_device m_samples; optional_device m_votrax; optional_device m_astrocade_sound1; - optional_shared_ptr m_videoram; - optional_shared_ptr m_protected_ram; + optional_shared_ptr m_videoram; + optional_shared_ptr m_protected_ram; required_device m_screen; optional_device m_soundlatch; optional_device m_bank4000; @@ -87,53 +87,53 @@ public: optional_ioport_array<4> m_trackball; optional_ioport_array<2> m_joystick; - UINT8 m_video_config; - UINT8 m_sparkle[4]; + uint8_t m_video_config; + uint8_t m_sparkle[4]; char m_totalword[256]; char *m_totalword_ptr; char m_oldword[256]; int m_plural; - UINT8 m_port_1_last; - UINT8 m_port_2_last; - UINT8 m_ram_write_enable; - UINT8 m_input_select; - std::unique_ptr m_sparklestar; - UINT8 m_interrupt_enabl; - UINT8 m_interrupt_vector; - UINT8 m_interrupt_scanline; - UINT8 m_vertical_feedback; - UINT8 m_horizontal_feedback; + uint8_t m_port_1_last; + uint8_t m_port_2_last; + uint8_t m_ram_write_enable; + uint8_t m_input_select; + std::unique_ptr m_sparklestar; + uint8_t m_interrupt_enabl; + uint8_t m_interrupt_vector; + uint8_t m_interrupt_scanline; + uint8_t m_vertical_feedback; + uint8_t m_horizontal_feedback; emu_timer *m_scanline_timer; emu_timer *m_intoff_timer; - UINT8 m_colors[8]; - UINT8 m_colorsplit; - UINT8 m_bgdata; - UINT8 m_vblank; - UINT8 m_video_mode; - UINT8 m_funcgen_expand_color[2]; - UINT8 m_funcgen_control; - UINT8 m_funcgen_expand_count; - UINT8 m_funcgen_rotate_count; - UINT8 m_funcgen_rotate_data[4]; - UINT8 m_funcgen_shift_prev_data; - UINT8 m_funcgen_intercept; - UINT16 m_pattern_source; - UINT8 m_pattern_mode; - UINT16 m_pattern_dest; - UINT8 m_pattern_skip; - UINT8 m_pattern_width; - UINT8 m_pattern_height; - std::unique_ptr m_profpac_videoram; - UINT16 m_profpac_palette[16]; - UINT8 m_profpac_colormap[4]; - UINT8 m_profpac_intercept; - UINT8 m_profpac_vispage; - UINT8 m_profpac_readpage; - UINT8 m_profpac_readshift; - UINT8 m_profpac_writepage; - UINT8 m_profpac_writemode; - UINT16 m_profpac_writemask; - UINT8 m_profpac_vw; + uint8_t m_colors[8]; + uint8_t m_colorsplit; + uint8_t m_bgdata; + uint8_t m_vblank; + uint8_t m_video_mode; + uint8_t m_funcgen_expand_color[2]; + uint8_t m_funcgen_control; + uint8_t m_funcgen_expand_count; + uint8_t m_funcgen_rotate_count; + uint8_t m_funcgen_rotate_data[4]; + uint8_t m_funcgen_shift_prev_data; + uint8_t m_funcgen_intercept; + uint16_t m_pattern_source; + uint8_t m_pattern_mode; + uint16_t m_pattern_dest; + uint8_t m_pattern_skip; + uint8_t m_pattern_width; + uint8_t m_pattern_height; + std::unique_ptr m_profpac_videoram; + uint16_t m_profpac_palette[16]; + uint8_t m_profpac_colormap[4]; + uint8_t m_profpac_intercept; + uint8_t m_profpac_vispage; + uint8_t m_profpac_readpage; + uint8_t m_profpac_readshift; + uint8_t m_profpac_writepage; + uint8_t m_profpac_writemode; + uint16_t m_profpac_writemask; + uint8_t m_profpac_vw; DECLARE_WRITE8_MEMBER(protected_ram_enable_w); DECLARE_READ8_MEMBER(protected_ram_r); DECLARE_WRITE8_MEMBER(protected_ram_w); @@ -183,14 +183,14 @@ public: DECLARE_PALETTE_INIT(astrocde); DECLARE_VIDEO_START(profpac); DECLARE_PALETTE_INIT(profpac); - UINT32 screen_update_astrocde(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_profpac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_astrocde(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_profpac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(scanline_callback); inline int mame_vpos_to_astrocade_vpos(int scanline); void init_savestate(); - void astrocade_trigger_lightpen(UINT8 vfeedback, UINT8 hfeedback); - inline void increment_source(UINT8 curwidth, UINT8 *u13ff); - inline void increment_dest(UINT8 curwidth); + void astrocade_trigger_lightpen(uint8_t vfeedback, uint8_t hfeedback); + inline void increment_source(uint8_t curwidth, uint8_t *u13ff); + inline void increment_dest(uint8_t curwidth); void execute_blit(address_space &space); void init_sparklestar(); virtual void machine_start() override; diff --git a/src/mame/includes/astrof.h b/src/mame/includes/astrof.h index 86577547d25..cf2a5711bc9 100644 --- a/src/mame/includes/astrof.h +++ b/src/mame/includes/astrof.h @@ -24,25 +24,25 @@ public: m_screen(*this, "screen") { } /* video-related */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; - std::unique_ptr m_colorram; - required_shared_ptr m_astrof_color; - optional_shared_ptr m_tomahawk_protection; + std::unique_ptr m_colorram; + required_shared_ptr m_astrof_color; + optional_shared_ptr m_tomahawk_protection; optional_ioport m_fake_port; - UINT8 m_astrof_palette_bank; - UINT8 m_red_on; - UINT8 m_flipscreen; - UINT8 m_screen_off; - UINT16 m_abattle_count; + uint8_t m_astrof_palette_bank; + uint8_t m_red_on; + uint8_t m_flipscreen; + uint8_t m_screen_off; + uint16_t m_abattle_count; /* sound-related */ - UINT8 m_port_1_last; - UINT8 m_port_2_last; - UINT8 m_astrof_start_explosion; - UINT8 m_astrof_death_playing; - UINT8 m_astrof_bosskill_playing; + uint8_t m_port_1_last; + uint8_t m_port_2_last; + uint8_t m_astrof_start_explosion; + uint8_t m_astrof_death_playing; + uint8_t m_astrof_bosskill_playing; /* devices */ required_device m_maincpu; @@ -79,15 +79,15 @@ public: DECLARE_MACHINE_RESET(abattle); DECLARE_MACHINE_START(spfghmk2); DECLARE_MACHINE_START(tomahawk); - UINT32 screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(irq_callback); - rgb_t make_pen( UINT8 data ); + rgb_t make_pen( uint8_t data ); void astrof_get_pens( pen_t *pens ); void tomahawk_get_pens( pen_t *pens ); - void astrof_set_video_control_2( UINT8 data ); - void spfghmk2_set_video_control_2( UINT8 data ); - void tomahawk_set_video_control_2( UINT8 data ); + void astrof_set_video_control_2( uint8_t data ); + void spfghmk2_set_video_control_2( uint8_t data ); + void tomahawk_set_video_control_2( uint8_t data ); void video_update_common( bitmap_rgb32 &bitmap, const rectangle &cliprect, pen_t *pens, int num_pens ); }; diff --git a/src/mame/includes/asuka.h b/src/mame/includes/asuka.h index 35d2a21d1c2..e2503666fc1 100644 --- a/src/mame/includes/asuka.h +++ b/src/mame/includes/asuka.h @@ -32,22 +32,22 @@ public: m_tc0220ioc(*this, "tc0220ioc") { } /* video-related */ - UINT16 m_video_ctrl; - UINT16 m_video_mask; + uint16_t m_video_ctrl; + uint16_t m_video_mask; /* c-chip */ int m_current_round; int m_current_bank; - UINT8 m_cval[26]; - UINT8 m_cc_port; - UINT8 m_restart_status; + uint8_t m_cval[26]; + uint8_t m_cc_port; + uint8_t m_restart_status; /* misc */ int m_adpcm_pos; int m_adpcm_data; - optional_shared_ptr m_cadash_shared_ram; + optional_shared_ptr m_cadash_shared_ram; /* devices */ required_device m_maincpu; @@ -67,8 +67,8 @@ public: DECLARE_WRITE8_MEMBER(asuka_msm5205_stop_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_bonzeadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_asuka(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bonzeadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_asuka(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_asuka(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(cadash_interrupt); diff --git a/src/mame/includes/atarifb.h b/src/mame/includes/atarifb.h index 49fa450d7aa..78a459c0847 100644 --- a/src/mame/includes/atarifb.h +++ b/src/mame/includes/atarifb.h @@ -34,11 +34,11 @@ public: m_palette(*this, "palette"){ } /* video-related */ - required_shared_ptr m_alphap1_videoram; - required_shared_ptr m_alphap2_videoram; - required_shared_ptr m_field_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll_register; + required_shared_ptr m_alphap1_videoram; + required_shared_ptr m_alphap2_videoram; + required_shared_ptr m_field_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll_register; tilemap_t *m_alpha1_tilemap; tilemap_t *m_alpha2_tilemap; @@ -91,10 +91,10 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(atarifb); - UINT32 screen_update_atarifb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_abaseb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_soccer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void get_tile_info_common( tile_data &tileinfo, tilemap_memory_index tile_index, UINT8 *alpha_videoram ); + uint32_t screen_update_atarifb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_abaseb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_soccer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void get_tile_info_common( tile_data &tileinfo, tilemap_memory_index tile_index, uint8_t *alpha_videoram ); void draw_playfield_and_alpha( bitmap_ind16 &bitmap, const rectangle &cliprect, int playfield_x_offset, int playfield_y_offset ); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, int is_soccer ); }; diff --git a/src/mame/includes/atarig1.h b/src/mame/includes/atarig1.h index 01e9b3e9e82..5f5d32ec96c 100644 --- a/src/mame/includes/atarig1.h +++ b/src/mame/includes/atarig1.h @@ -30,19 +30,19 @@ public: bool m_is_pitfight; - UINT8 m_which_input; - required_shared_ptr m_mo_command; + uint8_t m_which_input; + required_shared_ptr m_mo_command; - UINT16 * m_bslapstic_base; - std::unique_ptr m_bslapstic_bank0; - UINT8 m_bslapstic_bank; + uint16_t * m_bslapstic_base; + std::unique_ptr m_bslapstic_bank0; + uint8_t m_bslapstic_bank; bool m_bslapstic_primed; int m_pfscroll_xoffset; - UINT16 m_current_control; - UINT8 m_playfield_tile_bank; - UINT16 m_playfield_xscroll; - UINT16 m_playfield_yscroll; + uint16_t m_current_control; + uint8_t m_playfield_tile_bank; + uint16_t m_playfield_xscroll; + uint16_t m_playfield_yscroll; virtual void device_post_load() override; virtual void update_interrupts() override; @@ -62,7 +62,7 @@ public: DECLARE_MACHINE_START(atarig1); DECLARE_MACHINE_RESET(atarig1); DECLARE_VIDEO_START(atarig1); - UINT32 screen_update_atarig1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_atarig1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: void pitfightb_cheap_slapstic_init(); }; diff --git a/src/mame/includes/atarig42.h b/src/mame/includes/atarig42.h index 776c669a9d6..94b39b7b788 100644 --- a/src/mame/includes/atarig42.h +++ b/src/mame/includes/atarig42.h @@ -32,24 +32,24 @@ public: required_device m_rle; required_device m_asic65; - UINT16 m_playfield_base; + uint16_t m_playfield_base; - UINT16 m_current_control; - UINT8 m_playfield_tile_bank; - UINT8 m_playfield_color_bank; - UINT16 m_playfield_xscroll; - UINT16 m_playfield_yscroll; + uint16_t m_current_control; + uint8_t m_playfield_tile_bank; + uint8_t m_playfield_color_bank; + uint16_t m_playfield_xscroll; + uint16_t m_playfield_yscroll; - UINT8 m_analog_data; - required_shared_ptr m_mo_command; + uint8_t m_analog_data; + required_shared_ptr m_mo_command; int m_sloop_bank; int m_sloop_next_bank; int m_sloop_offset; int m_sloop_state; - UINT16 * m_sloop_base; + uint16_t * m_sloop_base; - UINT32 m_last_accesses[8]; + uint32_t m_last_accesses[8]; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_READ16_MEMBER(special_port2_r); @@ -71,5 +71,5 @@ public: DECLARE_MACHINE_START(atarig42); DECLARE_MACHINE_RESET(atarig42); DECLARE_VIDEO_START(atarig42); - UINT32 screen_update_atarig42(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_atarig42(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/atarigt.h b/src/mame/includes/atarigt.h index b2bc558eb1f..e958683f36e 100644 --- a/src/mame/includes/atarigt.h +++ b/src/mame/includes/atarigt.h @@ -27,8 +27,8 @@ public: m_mo_command(*this, "mo_command"), m_cage(*this, "cage") { } - UINT8 m_is_primrage; - required_shared_ptr m_colorram; + uint8_t m_is_primrage; + required_shared_ptr m_colorram; required_device m_playfield_tilemap; required_device m_alpha_tilemap; @@ -37,26 +37,26 @@ public: bitmap_ind16 m_pf_bitmap; bitmap_ind16 m_an_bitmap; - UINT8 m_playfield_tile_bank; - UINT8 m_playfield_color_bank; - UINT16 m_playfield_xscroll; - UINT16 m_playfield_yscroll; + uint8_t m_playfield_tile_bank; + uint8_t m_playfield_color_bank; + uint16_t m_playfield_xscroll; + uint16_t m_playfield_yscroll; - UINT32 m_tram_checksum; + uint32_t m_tram_checksum; - UINT32 m_expanded_mram[MRAM_ENTRIES * 3]; + uint32_t m_expanded_mram[MRAM_ENTRIES * 3]; - required_shared_ptr m_mo_command; + required_shared_ptr m_mo_command; optional_device m_cage; - void (atarigt_state::*m_protection_w)(address_space &space, offs_t offset, UINT16 data); - void (atarigt_state::*m_protection_r)(address_space &space, offs_t offset, UINT16 *data); + void (atarigt_state::*m_protection_w)(address_space &space, offs_t offset, uint16_t data); + void (atarigt_state::*m_protection_r)(address_space &space, offs_t offset, uint16_t *data); bool m_ignore_writes; offs_t m_protaddr[ADDRSEQ_COUNT]; - UINT8 m_protmode; - UINT16 m_protresult; - UINT8 m_protdata[0x800]; + uint8_t m_protmode; + uint16_t m_protresult; + uint8_t m_protdata[0x800]; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; @@ -75,8 +75,8 @@ public: DECLARE_WRITE8_MEMBER(cage_irq_callback); - void atarigt_colorram_w(offs_t address, UINT16 data, UINT16 mem_mask); - UINT16 atarigt_colorram_r(offs_t address); + void atarigt_colorram_w(offs_t address, uint16_t data, uint16_t mem_mask); + uint16_t atarigt_colorram_r(offs_t address); DECLARE_DRIVER_INIT(primrage); DECLARE_DRIVER_INIT(tmek); TILE_GET_INFO_MEMBER(get_alpha_tile_info); @@ -85,13 +85,13 @@ public: DECLARE_MACHINE_START(atarigt); DECLARE_MACHINE_RESET(atarigt); DECLARE_VIDEO_START(atarigt); - UINT32 screen_update_atarigt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_atarigt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: void tmek_update_mode(offs_t offset); - void tmek_protection_w(address_space &space, offs_t offset, UINT16 data); - void tmek_protection_r(address_space &space, offs_t offset, UINT16 *data); + void tmek_protection_w(address_space &space, offs_t offset, uint16_t data); + void tmek_protection_r(address_space &space, offs_t offset, uint16_t *data); void primrage_update_mode(offs_t offset); - void primrage_protection_w(address_space &space, offs_t offset, UINT16 data); - void primrage_protection_r(address_space &space, offs_t offset, UINT16 *data); + void primrage_protection_w(address_space &space, offs_t offset, uint16_t data); + void primrage_protection_r(address_space &space, offs_t offset, uint16_t *data); void compute_fake_pots(int *pots); }; diff --git a/src/mame/includes/atarigx2.h b/src/mame/includes/atarigx2.h index 678b9c19b22..3b960e5ab51 100644 --- a/src/mame/includes/atarigx2.h +++ b/src/mame/includes/atarigx2.h @@ -24,27 +24,27 @@ public: m_rle(*this, "rle") { } - UINT16 m_playfield_base; + uint16_t m_playfield_base; required_device m_jsa; required_device m_xga; - required_shared_ptr m_mo_command; + required_shared_ptr m_mo_command; required_device m_playfield_tilemap; required_device m_alpha_tilemap; required_device m_rle; - UINT16 m_current_control; - UINT8 m_playfield_tile_bank; - UINT8 m_playfield_color_bank; - UINT16 m_playfield_xscroll; - UINT16 m_playfield_yscroll; + uint16_t m_current_control; + uint8_t m_playfield_tile_bank; + uint8_t m_playfield_color_bank; + uint16_t m_playfield_xscroll; + uint16_t m_playfield_yscroll; // LEGACY PROTECTION - UINT16 m_last_write; - UINT16 m_last_write_offset; - UINT32 m_protection_ram[0x1000]; + uint16_t m_last_write; + uint16_t m_last_write_offset; + uint32_t m_protection_ram[0x1000]; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; @@ -65,6 +65,6 @@ public: DECLARE_MACHINE_START(atarigx2); DECLARE_MACHINE_RESET(atarigx2); DECLARE_VIDEO_START(atarigx2); - UINT32 screen_update_atarigx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_atarigx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE16_MEMBER( atarigx2_mo_control_w ); }; diff --git a/src/mame/includes/atarist.h b/src/mame/includes/atarist.h index 34a6be7972e..bddb2781113 100644 --- a/src/mame/includes/atarist.h +++ b/src/mame/includes/atarist.h @@ -157,7 +157,7 @@ public: void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // video DECLARE_READ8_MEMBER( shifter_base_r ); @@ -206,8 +206,8 @@ public: void glue_tick(); void set_screen_parameters(); void blitter_source(); - UINT16 blitter_hop(); - void blitter_op(UINT16 s, UINT32 dstaddr, UINT16 mask); + uint16_t blitter_hop(); + void blitter_op(uint16_t s, uint32_t dstaddr, uint16_t mask); void blitter_tick(); // driver @@ -250,28 +250,28 @@ public: void state_save(); /* memory state */ - UINT8 m_mmu; + uint8_t m_mmu; /* keyboard state */ int m_acia_ikbd_irq; int m_acia_midi_irq; - UINT16 m_ikbd_keylatch; - UINT8 m_ikbd_mouse; - UINT8 m_ikbd_mouse_x; - UINT8 m_ikbd_mouse_y; - UINT8 m_ikbd_mouse_px; - UINT8 m_ikbd_mouse_py; - UINT8 m_ikbd_mouse_pc; + uint16_t m_ikbd_keylatch; + uint8_t m_ikbd_mouse; + uint8_t m_ikbd_mouse_x; + uint8_t m_ikbd_mouse_y; + uint8_t m_ikbd_mouse_px; + uint8_t m_ikbd_mouse_py; + uint8_t m_ikbd_mouse_pc; int m_ikbd_tx; int m_ikbd_joy; int m_midi_tx; /* floppy state */ - UINT32 m_dma_base; - UINT16 m_dma_error; - UINT16 m_fdc_mode; - UINT8 m_fdc_sectors; - UINT16 m_fdc_fifo[2][8]; + uint32_t m_dma_base; + uint16_t m_dma_error; + uint16_t m_fdc_mode; + uint8_t m_fdc_sectors; + uint16_t m_fdc_fifo[2][8]; int m_fdc_fifo_sel; int m_fdc_fifo_index; int m_fdc_fifo_msb; @@ -279,13 +279,13 @@ public: int m_fdc_dmabytes; /* shifter state */ - UINT32 m_shifter_base; - UINT32 m_shifter_ofs; - UINT8 m_shifter_sync; - UINT8 m_shifter_mode; - UINT16 m_shifter_palette[16]; - UINT16 m_shifter_rr[4]; - UINT16 m_shifter_ir[4]; + uint32_t m_shifter_base; + uint32_t m_shifter_ofs; + uint8_t m_shifter_sync; + uint8_t m_shifter_mode; + uint16_t m_shifter_palette[16]; + uint16_t m_shifter_rr[4]; + uint16_t m_shifter_ir[4]; int m_shifter_bitplane; int m_shifter_shift; int m_shifter_h; @@ -299,24 +299,24 @@ public: int m_shifter_vblank_start; /* blitter state */ - UINT16 m_blitter_halftone[16]; - INT16 m_blitter_src_inc_x; - INT16 m_blitter_src_inc_y; - INT16 m_blitter_dst_inc_x; - INT16 m_blitter_dst_inc_y; - UINT32 m_blitter_src; - UINT32 m_blitter_dst; - UINT16 m_blitter_endmask1; - UINT16 m_blitter_endmask2; - UINT16 m_blitter_endmask3; - UINT16 m_blitter_xcount; - UINT16 m_blitter_ycount; - UINT16 m_blitter_xcountl; - UINT8 m_blitter_hop; - UINT8 m_blitter_op; - UINT8 m_blitter_ctrl; - UINT8 m_blitter_skew; - UINT32 m_blitter_srcbuf; + uint16_t m_blitter_halftone[16]; + int16_t m_blitter_src_inc_x; + int16_t m_blitter_src_inc_y; + int16_t m_blitter_dst_inc_x; + int16_t m_blitter_dst_inc_y; + uint32_t m_blitter_src; + uint32_t m_blitter_dst; + uint16_t m_blitter_endmask1; + uint16_t m_blitter_endmask2; + uint16_t m_blitter_endmask3; + uint16_t m_blitter_xcount; + uint16_t m_blitter_ycount; + uint16_t m_blitter_xcountl; + uint8_t m_blitter_hop; + uint8_t m_blitter_op; + uint8_t m_blitter_ctrl; + uint8_t m_blitter_skew; + uint32_t m_blitter_srcbuf; /* timers */ emu_timer *m_mouse_timer; @@ -402,24 +402,24 @@ public: void state_save(); // shifter state - UINT8 m_shifter_lineofs; - UINT8 m_shifter_pixelofs; + uint8_t m_shifter_lineofs; + uint8_t m_shifter_pixelofs; /* microwire state */ - UINT16 m_mw_data; - UINT16 m_mw_mask; + uint16_t m_mw_data; + uint16_t m_mw_mask; int m_mw_shift; /* DMA sound state */ - UINT32 m_dmasnd_base; - UINT32 m_dmasnd_end; - UINT32 m_dmasnd_cntr; - UINT32 m_dmasnd_baselatch; - UINT32 m_dmasnd_endlatch; - UINT8 m_dmasnd_ctrl; - UINT8 m_dmasnd_mode; - UINT8 m_dmasnd_fifo[8]; - UINT8 m_dmasnd_samples; + uint32_t m_dmasnd_base; + uint32_t m_dmasnd_end; + uint32_t m_dmasnd_cntr; + uint32_t m_dmasnd_baselatch; + uint32_t m_dmasnd_endlatch; + uint8_t m_dmasnd_ctrl; + uint8_t m_dmasnd_mode; + uint8_t m_dmasnd_fifo[8]; + uint8_t m_dmasnd_samples; int m_dmasnd_active; // timers @@ -442,7 +442,7 @@ public: DECLARE_READ16_MEMBER( cache_r ); DECLARE_WRITE16_MEMBER( cache_w ); - UINT16 m_cache; + uint16_t m_cache; }; class stbook_state : public ste_state diff --git a/src/mame/includes/atarisy1.h b/src/mame/includes/atarisy1.h index 3c0c0d5e4ec..8cd6c99220f 100644 --- a/src/mame/includes/atarisy1.h +++ b/src/mame/includes/atarisy1.h @@ -30,23 +30,23 @@ public: required_device m_audiocpu; required_device m_soundcomm; - required_shared_ptr m_bankselect; + required_shared_ptr m_bankselect; required_device m_mob; - UINT8 m_joystick_type; - UINT8 m_trackball_type; + uint8_t m_joystick_type; + uint8_t m_trackball_type; required_device m_joystick_timer; - UINT8 m_joystick_int; - UINT8 m_joystick_int_enable; - UINT8 m_joystick_value; + uint8_t m_joystick_int; + uint8_t m_joystick_int_enable; + uint8_t m_joystick_value; /* playfield parameters */ required_device m_playfield_tilemap; required_device m_alpha_tilemap; - UINT16 m_playfield_lookup[256]; - UINT8 m_playfield_tile_bank; - UINT16 m_playfield_priority_pens; + uint16_t m_playfield_lookup[256]; + uint8_t m_playfield_tile_bank; + uint16_t m_playfield_priority_pens; required_device m_yscroll_reset_timer; /* INT3 tracking */ @@ -58,10 +58,10 @@ public: required_device m_tms; /* graphics bank tracking */ - UINT8 m_bank_gfx[3][8]; - UINT8 m_bank_color_shift[MAX_GFX_ELEMENTS]; + uint8_t m_bank_gfx[3][8]; + uint8_t m_bank_color_shift[MAX_GFX_ELEMENTS]; - UINT8 m_cur[2][2]; + uint8_t m_cur[2][2]; virtual void update_interrupts() override; DECLARE_READ16_MEMBER(joystick_r); DECLARE_WRITE16_MEMBER(joystick_w); @@ -82,14 +82,14 @@ public: DECLARE_MACHINE_START(atarisy1); DECLARE_MACHINE_RESET(atarisy1); DECLARE_VIDEO_START(atarisy1); - UINT32 screen_update_atarisy1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_atarisy1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(delayed_joystick_int); TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_reset_yscroll_callback); TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3off_callback); TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3_callback); void update_timers(int scanline); - void decode_gfx(UINT16 *pflookup, UINT16 *molookup); - int get_bank(UINT8 prom1, UINT8 prom2, int bpp); + void decode_gfx(uint16_t *pflookup, uint16_t *molookup); + int get_bank(uint8_t prom1, uint8_t prom2, int bpp); DECLARE_READ16_MEMBER( atarisy1_int3state_r ); DECLARE_WRITE16_MEMBER( atarisy1_spriteram_w ); DECLARE_WRITE16_MEMBER( atarisy1_bankselect_w ); diff --git a/src/mame/includes/atarisy2.h b/src/mame/includes/atarisy2.h index 4f995c554fc..c19f3928787 100644 --- a/src/mame/includes/atarisy2.h +++ b/src/mame/includes/atarisy2.h @@ -40,14 +40,14 @@ public: required_device m_maincpu; required_device m_audiocpu; required_device m_mob; - required_shared_ptr m_slapstic_base; + required_shared_ptr m_slapstic_base; - UINT8 m_interrupt_enable; + uint8_t m_interrupt_enable; required_device m_playfield_tilemap; required_device m_alpha_tilemap; - INT8 m_pedal_count; + int8_t m_pedal_count; required_device m_soundcomm; required_device m_ym2151; @@ -55,31 +55,31 @@ public: required_device m_pokey2; optional_device m_tms5220; - UINT8 m_which_adc; + uint8_t m_which_adc; - UINT8 m_p2portwr_state; - UINT8 m_p2portrd_state; + uint8_t m_p2portwr_state; + uint8_t m_p2portrd_state; required_memory_bank m_rombank1; required_memory_bank m_rombank2; required_device m_slapstic; - UINT8 m_sound_reset_state; + uint8_t m_sound_reset_state; emu_timer * m_yscroll_reset_timer; - UINT32 m_playfield_tile_bank[2]; - UINT32 m_videobank; + uint32_t m_playfield_tile_bank[2]; + uint32_t m_videobank; // 720 fake joystick double m_joy_last_angle; int m_joy_rotations; // 720 fake spinner - UINT32 m_spin_last_rotate_count; - INT32 m_spin_pos; /* track fake position of spinner */ - UINT32 m_spin_center_count; + uint32_t m_spin_last_rotate_count; + int32_t m_spin_pos; /* track fake position of spinner */ + uint32_t m_spin_center_count; - UINT16 m_vram[0x8000/2]; + uint16_t m_vram[0x8000/2]; virtual void device_post_load() override; @@ -113,7 +113,7 @@ public: DECLARE_MACHINE_START(atarisy2); DECLARE_MACHINE_RESET(atarisy2); DECLARE_VIDEO_START(atarisy2); - UINT32 screen_update_atarisy2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_atarisy2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_int); TIMER_CALLBACK_MEMBER(delayed_int_enable_w); TIMER_CALLBACK_MEMBER(reset_yscroll_callback); diff --git a/src/mame/includes/atetris.h b/src/mame/includes/atetris.h index e35b6b9e62c..cd2016288e1 100644 --- a/src/mame/includes/atetris.h +++ b/src/mame/includes/atetris.h @@ -26,13 +26,13 @@ public: required_device m_screen; optional_device m_slapstic_device; - required_shared_ptr m_nvram; - required_shared_ptr m_videoram; + required_shared_ptr m_nvram; + required_shared_ptr m_videoram; - UINT8 *m_slapstic_source; - UINT8 *m_slapstic_base; - UINT8 m_current_bank; - UINT8 m_nvram_write_enable; + uint8_t *m_slapstic_source; + uint8_t *m_slapstic_base; + uint8_t m_current_bank; + uint8_t m_nvram_write_enable; emu_timer *m_interrupt_timer; tilemap_t *m_bg_tilemap; @@ -47,7 +47,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - 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); TIMER_CALLBACK_MEMBER(interrupt_gen); void reset_bank(); }; diff --git a/src/mame/includes/atom.h b/src/mame/includes/atom.h index ce918299c71..28d85c967fc 100644 --- a/src/mame/includes/atom.h +++ b/src/mame/includes/atom.h @@ -97,7 +97,7 @@ public: DECLARE_WRITE_LINE_MEMBER( motor_w ); /* video state */ - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; /* keyboard state */ int m_keylatch; diff --git a/src/mame/includes/aussiebyte.h b/src/mame/includes/aussiebyte.h index d410d4502c7..39b92367cdc 100644 --- a/src/mame/includes/aussiebyte.h +++ b/src/mame/includes/aussiebyte.h @@ -93,22 +93,22 @@ public: required_device m_palette; private: - UINT8 crt8002(UINT8 ac_ra, UINT8 ac_chr, UINT8 ac_attr, UINT16 ac_cnt, bool ac_curs); + uint8_t crt8002(uint8_t ac_ra, uint8_t ac_chr, uint8_t ac_attr, uint16_t ac_cnt, bool ac_curs); bool m_port15; // rom switched in (0), out (1) - UINT8 m_port17; - UINT8 m_port17_rdy; - UINT8 m_port19; - UINT8 m_port1a; // bank to switch to when write to port 15 happens - UINT8 m_port28; - UINT8 m_port34; - UINT8 m_port35; // byte to be written to vram or aram - UINT8 m_video_index; - UINT16 m_cnt; - UINT8 *m_p_videoram; - UINT8 *m_p_attribram; - const UINT8 *m_p_chargen; - UINT16 m_alpha_address; - UINT16 m_graph_address; + uint8_t m_port17; + uint8_t m_port17_rdy; + uint8_t m_port19; + uint8_t m_port1a; // bank to switch to when write to port 15 happens + uint8_t m_port28; + uint8_t m_port34; + uint8_t m_port35; // byte to be written to vram or aram + uint8_t m_video_index; + uint16_t m_cnt; + uint8_t *m_p_videoram; + uint8_t *m_p_attribram; + const uint8_t *m_p_chargen; + uint16_t m_alpha_address; + uint16_t m_graph_address; required_device m_maincpu; required_device m_ctc; required_device m_dma; diff --git a/src/mame/includes/avalnche.h b/src/mame/includes/avalnche.h index e1884176ae1..6f61d5a6b38 100644 --- a/src/mame/includes/avalnche.h +++ b/src/mame/includes/avalnche.h @@ -18,10 +18,10 @@ public: m_discrete(*this, "discrete"), m_maincpu(*this, "maincpu") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; optional_device m_discrete; - UINT8 m_avalance_video_inverted; + uint8_t m_avalance_video_inverted; DECLARE_WRITE8_MEMBER(avalance_video_invert_w); DECLARE_WRITE8_MEMBER(catch_coin_counter_w); @@ -30,7 +30,7 @@ public: DECLARE_WRITE8_MEMBER(avalance_start_lamp_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_avalnche(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_avalnche(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(avalnche_noise_amplitude_w); DECLARE_WRITE8_MEMBER(avalnche_attract_enable_w); DECLARE_WRITE8_MEMBER(avalnche_audio_w); diff --git a/src/mame/includes/avigo.h b/src/mame/includes/avigo.h index b7556bb23d4..970ba107378 100644 --- a/src/mame/includes/avigo.h +++ b/src/mame/includes/avigo.h @@ -53,7 +53,7 @@ public: required_device m_bankdev1; required_device m_bankdev2; required_device m_flash1; - required_shared_ptr m_nvram; + required_shared_ptr m_nvram; // defined in drivers/avigo.c virtual void machine_start() override; @@ -86,23 +86,23 @@ public: // defined in video/avigo.c virtual void video_start() override; - 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); DECLARE_READ8_MEMBER(vid_memory_r); DECLARE_WRITE8_MEMBER(vid_memory_w); // driver state - UINT8 m_key_line; - UINT8 m_irq; - UINT8 m_port2; - UINT8 m_bank2_l; - UINT8 m_bank2_h; - UINT8 m_bank1_l; - UINT8 m_bank1_h; - UINT8 m_ad_control_status; - UINT16 m_ad_value; - UINT8 * m_video_memory; - UINT8 m_screen_column; - UINT8 m_warm_start; + uint8_t m_key_line; + uint8_t m_irq; + uint8_t m_port2; + uint8_t m_bank2_l; + uint8_t m_bank2_h; + uint8_t m_bank1_l; + uint8_t m_bank1_h; + uint8_t m_ad_control_status; + uint16_t m_ad_value; + uint8_t * m_video_memory; + uint8_t m_screen_column; + uint8_t m_warm_start; DECLARE_PALETTE_INIT(avigo); TIMER_DEVICE_CALLBACK_MEMBER(avigo_scan_timer); TIMER_DEVICE_CALLBACK_MEMBER(avigo_1hz_timer); diff --git a/src/mame/includes/aztarac.h b/src/mame/includes/aztarac.h index 2525c707f24..6f4afecfe32 100644 --- a/src/mame/includes/aztarac.h +++ b/src/mame/includes/aztarac.h @@ -28,8 +28,8 @@ public: required_device m_screen; required_device m_soundlatch; - required_shared_ptr m_nvram; - required_shared_ptr m_vectorram; + required_shared_ptr m_nvram; + required_shared_ptr m_vectorram; int m_sound_status; int m_xcenter; @@ -50,5 +50,5 @@ public: INTERRUPT_GEN_MEMBER(snd_timed_irq); IRQ_CALLBACK_MEMBER(irq_callback); - inline void read_vectorram(UINT16 *vectorram, int addr, int *x, int *y, int *c); + inline void read_vectorram(uint16_t *vectorram, int addr, int *x, int *y, int *c); }; diff --git a/src/mame/includes/b2m.h b/src/mame/includes/b2m.h index a267a2b7538..1b1378f97f8 100644 --- a/src/mame/includes/b2m.h +++ b/src/mame/includes/b2m.h @@ -28,20 +28,20 @@ public: m_ram(*this, RAM_TAG), m_palette(*this, "palette") { } - UINT8 m_b2m_8255_porta; - UINT8 m_b2m_video_scroll; - UINT8 m_b2m_8255_portc; + uint8_t m_b2m_8255_porta; + uint8_t m_b2m_video_scroll; + uint8_t m_b2m_8255_portc; - UINT8 m_b2m_video_page; - UINT8 m_b2m_drive; - UINT8 m_b2m_side; + uint8_t m_b2m_video_page; + uint8_t m_b2m_drive; + uint8_t m_b2m_side; - UINT8 m_b2m_romdisk_lsb; - UINT8 m_b2m_romdisk_msb; + uint8_t m_b2m_romdisk_lsb; + uint8_t m_b2m_romdisk_msb; - UINT8 m_b2m_color[4]; - UINT8 m_b2m_localmachine; - UINT8 m_vblank_state; + uint8_t m_b2m_color[4]; + uint8_t m_b2m_localmachine; + uint8_t m_vblank_state; required_device m_maincpu; required_device m_speaker; required_device m_pit; @@ -61,7 +61,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(b2m); - UINT32 screen_update_b2m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_b2m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(b2m_vblank_interrupt); DECLARE_WRITE_LINE_MEMBER(bm2_pit_out1); DECLARE_WRITE8_MEMBER(b2m_8255_porta_w); diff --git a/src/mame/includes/badlands.h b/src/mame/includes/badlands.h index fe4e9a68e6d..3e64a668b97 100644 --- a/src/mame/includes/badlands.h +++ b/src/mame/includes/badlands.h @@ -25,8 +25,8 @@ public: required_device m_playfield_tilemap; required_device m_mob; - UINT8 m_pedal_value[2]; - UINT8 m_playfield_tile_bank; + uint8_t m_pedal_value[2]; + uint8_t m_playfield_tile_bank; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; @@ -42,7 +42,7 @@ public: DECLARE_MACHINE_RESET(badlands); DECLARE_VIDEO_START(badlands); DECLARE_MACHINE_RESET(badlandsb); - UINT32 screen_update_badlands(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_badlands(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_int); DECLARE_WRITE16_MEMBER( badlands_pf_bank_w ); diff --git a/src/mame/includes/bagman.h b/src/mame/includes/bagman.h index f38bb7e361d..b7c640942de 100644 --- a/src/mame/includes/bagman.h +++ b/src/mame/includes/bagman.h @@ -21,26 +21,26 @@ public: required_device m_palette; optional_device m_tmsprom; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_video_enable; - required_shared_ptr m_spriteram; - - UINT8 m_irq_mask; - UINT8 m_ls259_buf[8]; - UINT8 m_p1_res; - UINT8 m_p1_old_val; - UINT8 m_p2_res; - UINT8 m_p2_old_val; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_video_enable; + required_shared_ptr m_spriteram; + + uint8_t m_irq_mask; + uint8_t m_ls259_buf[8]; + uint8_t m_p1_res; + uint8_t m_p1_old_val; + uint8_t m_p2_res; + uint8_t m_p2_old_val; /*table holds outputs of all ANDs (after AND map)*/ - UINT8 m_andmap[64]; + uint8_t m_andmap[64]; /*table holds inputs (ie. not x, x, not q, q) to the AND map*/ - UINT8 m_columnvalue[32]; + uint8_t m_columnvalue[32]; /*8 output pins (actually 6 output and 2 input/output)*/ - UINT8 m_outvalue[8]; + uint8_t m_outvalue[8]; tilemap_t *m_bg_tilemap; @@ -72,7 +72,7 @@ public: INTERRUPT_GEN_MEMBER(vblank_irq); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void update_pal(); }; diff --git a/src/mame/includes/balsente.h b/src/mame/includes/balsente.h index 60117d42369..3ddab9a1b76 100644 --- a/src/mame/includes/balsente.h +++ b/src/mame/includes/balsente.h @@ -55,60 +55,60 @@ public: required_device m_scanline_timer; /* global data */ - UINT8 m_shooter; - UINT8 m_shooter_x; - UINT8 m_shooter_y; - UINT8 m_adc_shift; + uint8_t m_shooter; + uint8_t m_shooter_x; + uint8_t m_shooter_y; + uint8_t m_adc_shift; /* 8253 counter state */ struct { timer_device *timer; - UINT8 timer_active; - INT32 initial; - INT32 count; - UINT8 gate; - UINT8 out; - UINT8 mode; - UINT8 readbyte; - UINT8 writebyte; + uint8_t timer_active; + int32_t initial; + int32_t count; + uint8_t gate; + uint8_t out; + uint8_t mode; + uint8_t readbyte; + uint8_t writebyte; } m_counter[3]; /* manually clocked counter 0 states */ - UINT8 m_counter_control; - UINT8 m_counter_0_ff; + uint8_t m_counter_control; + uint8_t m_counter_0_ff; required_device m_counter_0_timer; - UINT8 m_counter_0_timer_active; + uint8_t m_counter_0_timer_active; /* random number generator states */ - UINT8 m_poly17[POLY17_SIZE + 1]; - UINT8 m_rand17[POLY17_SIZE + 1]; + uint8_t m_poly17[POLY17_SIZE + 1]; + uint8_t m_rand17[POLY17_SIZE + 1]; /* ADC I/O states */ - INT8 m_analog_input_data[4]; - UINT8 m_adc_value; + int8_t m_analog_input_data[4]; + uint8_t m_adc_value; /* CEM3394 DAC control states */ - UINT16 m_dac_value; - UINT8 m_dac_register; - UINT8 m_chip_select; + uint16_t m_dac_value; + uint8_t m_dac_register; + uint8_t m_chip_select; /* main CPU 6850 states */ - UINT8 m_m6850_status; - UINT8 m_m6850_control; - UINT8 m_m6850_input; - UINT8 m_m6850_output; - UINT8 m_m6850_data_ready; + uint8_t m_m6850_status; + uint8_t m_m6850_control; + uint8_t m_m6850_input; + uint8_t m_m6850_output; + uint8_t m_m6850_data_ready; /* sound CPU 6850 states */ - UINT8 m_m6850_sound_status; - UINT8 m_m6850_sound_control; - UINT8 m_m6850_sound_input; - UINT8 m_m6850_sound_output; + uint8_t m_m6850_sound_status; + uint8_t m_m6850_sound_control; + uint8_t m_m6850_sound_input; + uint8_t m_m6850_sound_output; /* noise generator states */ - UINT32 m_noise_position[6]; + uint32_t m_noise_position[6]; required_device m_cem1; required_device m_cem2; required_device m_cem3; @@ -118,26 +118,26 @@ public: cem3394_device *m_cem_device[6]; /* game-specific states */ - UINT8 m_nstocker_bits; - UINT8 m_spiker_expand_color; - UINT8 m_spiker_expand_bgcolor; - UINT8 m_spiker_expand_bits; - UINT8 m_grudge_steering_result; - UINT8 m_grudge_last_steering[3]; - UINT8 m_teamht_input; + uint8_t m_nstocker_bits; + uint8_t m_spiker_expand_color; + uint8_t m_spiker_expand_bgcolor; + uint8_t m_spiker_expand_bits; + uint8_t m_grudge_steering_result; + uint8_t m_grudge_last_steering[3]; + uint8_t m_teamht_input; /* video data */ - UINT8 m_expanded_videoram[256*256]; - UINT8 *m_sprite_data; - UINT32 m_sprite_mask; - UINT8 *m_sprite_bank[2]; + uint8_t m_expanded_videoram[256*256]; + uint8_t *m_sprite_data; + uint32_t m_sprite_mask; + uint8_t *m_sprite_bank[2]; - UINT8 m_palettebank_vis; + uint8_t m_palettebank_vis; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - optional_shared_ptr m_shrike_io; - optional_shared_ptr m_shrike_shared; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + optional_shared_ptr m_shrike_io; + optional_shared_ptr m_shrike_shared; DECLARE_WRITE8_MEMBER(balsente_random_reset_w); DECLARE_READ8_MEMBER(balsente_random_num_r); @@ -205,7 +205,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_balsente(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_balsente(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(balsente_update_analog_inputs); TIMER_CALLBACK_MEMBER(irq_off); TIMER_CALLBACK_MEMBER(m6850_data_ready_callback); @@ -214,13 +214,13 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(balsente_interrupt_timer); TIMER_DEVICE_CALLBACK_MEMBER(balsente_counter_callback); TIMER_DEVICE_CALLBACK_MEMBER(balsente_clock_counter_0_ff); - void draw_one_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *sprite); + void draw_one_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *sprite); void poly17_init(); void m6850_update_io(); void set_counter_0_ff(timer_device &timer, int newstate); void update_grudge_steering(); - void expand_roms(UINT8 cd_rom_mask); - inline void config_shooter_adc(UINT8 shooter, UINT8 adc_shift); + void expand_roms(uint8_t cd_rom_mask); + inline void config_shooter_adc(uint8_t shooter, uint8_t adc_shift); inline void noise_gen_chip(int chip, int count, short *buffer); CEM3394_EXT_INPUT(noise_gen_0); CEM3394_EXT_INPUT(noise_gen_1); @@ -233,7 +233,7 @@ public: optional_device m_68k; required_device m_screen; required_device m_palette; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_generic_paletteram_8; }; diff --git a/src/mame/includes/banctec.h b/src/mame/includes/banctec.h index d41e87c777e..69817f04c45 100644 --- a/src/mame/includes/banctec.h +++ b/src/mame/includes/banctec.h @@ -24,11 +24,11 @@ public: MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_banctec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_banctec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; }; diff --git a/src/mame/includes/bankp.h b/src/mame/includes/bankp.h index 75d3038e3cf..285877fd484 100644 --- a/src/mame/includes/bankp.h +++ b/src/mame/includes/bankp.h @@ -20,10 +20,10 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram2; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram2; /* video-related */ tilemap_t *m_bg_tilemap; @@ -31,7 +31,7 @@ public: int m_scroll_x; int m_priority; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(scroll_w); DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_WRITE8_MEMBER(colorram_w); @@ -43,7 +43,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(bankp); - 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); INTERRUPT_GEN_MEMBER(vblank_irq); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/baraduke.h b/src/mame/includes/baraduke.h index fb468780ea9..87de2e9c1f1 100644 --- a/src/mame/includes/baraduke.h +++ b/src/mame/includes/baraduke.h @@ -17,9 +17,9 @@ public: int m_inputport_selected; int m_counter; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_textram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_textram; required_device m_maincpu; required_device m_cus30; required_device m_gfxdecode; @@ -50,7 +50,7 @@ public: TILE_GET_INFO_MEMBER(get_tile_info1); virtual void video_start() override; DECLARE_PALETTE_INIT(baraduke); - UINT32 screen_update_baraduke(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_baraduke(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_baraduke(screen_device &screen, bool state); void scroll_w(address_space &space, int layer, int offset, int data); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_priority); diff --git a/src/mame/includes/batman.h b/src/mame/includes/batman.h index f98632ee177..b388e97fe38 100644 --- a/src/mame/includes/batman.h +++ b/src/mame/includes/batman.h @@ -21,8 +21,8 @@ public: required_device m_jsa; required_device m_vad; - UINT16 m_latch_data; - UINT8 m_alpha_tile_bank; + uint16_t m_latch_data; + uint8_t m_alpha_tile_bank; virtual void update_interrupts() override; DECLARE_WRITE16_MEMBER(latch_w); @@ -33,7 +33,7 @@ public: DECLARE_MACHINE_START(batman); DECLARE_MACHINE_RESET(batman); DECLARE_VIDEO_START(batman); - UINT32 screen_update_batman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_batman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; }; diff --git a/src/mame/includes/battlane.h b/src/mame/includes/battlane.h index 1a6e6124a12..f84c01007df 100644 --- a/src/mame/includes/battlane.h +++ b/src/mame/includes/battlane.h @@ -19,8 +19,8 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_tileram; - required_shared_ptr m_spriteram; + required_shared_ptr m_tileram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -47,7 +47,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_battlane(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_battlane(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(battlane_cpu1_interrupt); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_fg_bitmap( bitmap_ind16 &bitmap ); diff --git a/src/mame/includes/battlera.h b/src/mame/includes/battlera.h index b7f72fd9ac6..59cb48a40b7 100644 --- a/src/mame/includes/battlera.h +++ b/src/mame/includes/battlera.h @@ -41,5 +41,5 @@ public: virtual void machine_start() override; - 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); }; diff --git a/src/mame/includes/battlex.h b/src/mame/includes/battlex.h index cf4ac5ead7f..32bab998242 100644 --- a/src/mame/includes/battlex.h +++ b/src/mame/includes/battlex.h @@ -17,17 +17,17 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_in0_b4; + uint8_t m_in0_b4; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; - UINT8 m_scroll_lsb; - UINT8 m_scroll_msb; - UINT8 m_starfield_enabled; + uint8_t m_scroll_lsb; + uint8_t m_scroll_msb; + uint8_t m_starfield_enabled; DECLARE_WRITE8_MEMBER(battlex_palette_w); DECLARE_WRITE8_MEMBER(battlex_scroll_x_lsb_w); DECLARE_WRITE8_MEMBER(battlex_scroll_x_msb_w); @@ -40,7 +40,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_battlex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_battlex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(battlex_interrupt); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; diff --git a/src/mame/includes/battlnts.h b/src/mame/includes/battlnts.h index b6eff358b79..7b6b2f896aa 100644 --- a/src/mame/includes/battlnts.h +++ b/src/mame/includes/battlnts.h @@ -37,7 +37,7 @@ public: DECLARE_WRITE8_MEMBER(battlnts_spritebank_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_battlnts(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_battlnts(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(battlnts_interrupt); K007342_CALLBACK_MEMBER(battlnts_tile_callback); K007420_CALLBACK_MEMBER(battlnts_sprite_callback); diff --git a/src/mame/includes/bbc.h b/src/mame/includes/bbc.h index 7e1cea6a026..5969e4c7e4b 100644 --- a/src/mame/includes/bbc.h +++ b/src/mame/includes/bbc.h @@ -195,8 +195,8 @@ public: UPD7002_GET_ANALOGUE(BBC_get_analogue_input); UPD7002_EOC(BBC_uPD7002_EOC); - void bbc_setup_banks(memory_bank *membank, int banks, UINT32 shift, UINT32 size); - void bbcm_setup_banks(memory_bank *membank, int banks, UINT32 shift, UINT32 size); + void bbc_setup_banks(memory_bank *membank, int banks, uint32_t shift, uint32_t size); + void bbcm_setup_banks(memory_bank *membank, int banks, uint32_t shift, uint32_t size); image_init_result bbc_load_rom(device_image_interface &image, generic_slot_device *slot); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp1_load) { return bbc_load_rom(image, m_exp1); } @@ -360,7 +360,7 @@ public: // HACK FOR MC6845 int m_len2; int m_len3; int m_mc6850_clock; - UINT8 m_serproc_data; + uint8_t m_serproc_data; int m_rxd_serial; int m_dcd_serial; int m_cts_serial; @@ -368,7 +368,7 @@ public: // HACK FOR MC6845 int m_rxd_cass; int m_cass_out_enabled; int m_txd; - UINT32 m_nr_high_tones; + uint32_t m_nr_high_tones; int m_cass_out_samples_to_go; int m_cass_out_bit; int m_cass_out_phase; @@ -401,9 +401,9 @@ public: // HACK FOR MC6845 unsigned char *m_BBC_Video_RAM; - UINT16 *m_BBC_display; - UINT16 *m_BBC_display_left; - UINT16 *m_BBC_display_right; + uint16_t *m_BBC_display; + uint16_t *m_BBC_display_left; + uint16_t *m_BBC_display_right; bitmap_ind16 *m_BBC_bitmap; int m_y_screen_pos; unsigned char m_pixel_bits[256]; diff --git a/src/mame/includes/bbusters.h b/src/mame/includes/bbusters.h index ed50f90ff56..c3100bf4ead 100644 --- a/src/mame/includes/bbusters.h +++ b/src/mame/includes/bbusters.h @@ -30,21 +30,21 @@ public: optional_device m_spriteram2; required_device m_soundlatch; - optional_shared_ptr m_eprom_data; - required_shared_ptr m_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_pf1_data; - required_shared_ptr m_pf2_data; - required_shared_ptr m_pf1_scroll_data; - required_shared_ptr m_pf2_scroll_data; + optional_shared_ptr m_eprom_data; + required_shared_ptr m_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_pf1_data; + required_shared_ptr m_pf2_data; + required_shared_ptr m_pf1_scroll_data; + required_shared_ptr m_pf2_scroll_data; int m_sound_status; int m_gun_select; tilemap_t *m_fix_tilemap; tilemap_t *m_pf1_tilemap; tilemap_t *m_pf2_tilemap; - const UINT8 *m_scale_table_ptr; - UINT8 m_scale_line_count; + const uint8_t *m_scale_table_ptr; + uint8_t m_scale_line_count; DECLARE_READ16_MEMBER(sound_status_r); DECLARE_WRITE8_MEMBER(sound_status_w); @@ -68,10 +68,10 @@ public: DECLARE_VIDEO_START(bbuster); DECLARE_VIDEO_START(mechatt); - UINT32 screen_update_bbuster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mechatt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bbuster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mechatt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_bbuster(screen_device &screen, bool state); - inline const UINT8 *get_source_ptr(gfx_element *gfx, UINT32 sprite, int dx, int dy, int block); - void draw_block(bitmap_ind16 &dest,int x,int y,int size,int flipx,int flipy,UINT32 sprite,int color,int bank,int block); - void draw_sprites(bitmap_ind16 &bitmap, const UINT16 *source, int bank, int colval, int colmask); + inline const uint8_t *get_source_ptr(gfx_element *gfx, uint32_t sprite, int dx, int dy, int block); + void draw_block(bitmap_ind16 &dest,int x,int y,int size,int flipx,int flipy,uint32_t sprite,int color,int bank,int block); + void draw_sprites(bitmap_ind16 &bitmap, const uint16_t *source, int bank, int colval, int colmask); }; diff --git a/src/mame/includes/beathead.h b/src/mame/includes/beathead.h index 5913cb4a997..d1fb985052c 100644 --- a/src/mame/includes/beathead.h +++ b/src/mame/includes/beathead.h @@ -28,38 +28,38 @@ public: virtual void video_start() override; - 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); required_device m_maincpu; required_device m_jsa; - required_shared_ptr m_nvram; + required_shared_ptr m_nvram; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; - required_shared_ptr m_vram_bulk_latch; - required_shared_ptr m_palette_select; + required_shared_ptr m_vram_bulk_latch; + required_shared_ptr m_palette_select; - UINT32 m_finescroll; + uint32_t m_finescroll; offs_t m_vram_latch_offset; offs_t m_hsyncram_offset; offs_t m_hsyncram_start; - UINT8 m_hsyncram[0x800]; + uint8_t m_hsyncram[0x800]; - required_shared_ptr m_ram_base; - required_shared_ptr m_rom_base; + required_shared_ptr m_ram_base; + required_shared_ptr m_rom_base; attotime m_hblank_offset; - UINT8 m_irq_line_state; - UINT8 m_irq_enable[3]; - UINT8 m_irq_state[3]; + uint8_t m_irq_line_state; + uint8_t m_irq_enable[3]; + uint8_t m_irq_state[3]; - UINT8 m_eeprom_enabled; + uint8_t m_eeprom_enabled; - UINT32 * m_speedup_data; - UINT32 * m_movie_speedup_data; + uint32_t * m_speedup_data; + uint32_t * m_movie_speedup_data; // in drivers/beathead.c virtual void update_interrupts() override; diff --git a/src/mame/includes/bebox.h b/src/mame/includes/bebox.h index 80ace184a53..65dfebd9895 100644 --- a/src/mame/includes/bebox.h +++ b/src/mame/includes/bebox.h @@ -61,13 +61,13 @@ public: required_device m_smc37c78; required_device m_flash; required_device m_pcibus; - UINT32 m_cpu_imask[2]; - UINT32 m_interrupts; - UINT32 m_crossproc_interrupts; + uint32_t m_cpu_imask[2]; + uint32_t m_interrupts; + uint32_t m_crossproc_interrupts; int m_dma_channel; - UINT16 m_dma_offset[2][4]; - UINT8 m_at_pages[0x10]; - UINT32 m_scsi53c810_data[0x100 / 4]; + uint16_t m_dma_offset[2][4]; + uint8_t m_at_pages[0x10]; + uint32_t m_scsi53c810_data[0x100 / 4]; DECLARE_DRIVER_INIT(bebox); virtual void machine_start() override; virtual void machine_reset() override; @@ -128,7 +128,7 @@ protected: /*----------- defined in machine/bebox.c -----------*/ -UINT32 scsi53c810_pci_read(device_t *busdevice, device_t *device, int function, int offset, UINT32 mem_mask); -void scsi53c810_pci_write(device_t *busdevice, device_t *device, int function, int offset, UINT32 data, UINT32 mem_mask); +uint32_t scsi53c810_pci_read(device_t *busdevice, device_t *device, int function, int offset, uint32_t mem_mask); +void scsi53c810_pci_write(device_t *busdevice, device_t *device, int function, int offset, uint32_t data, uint32_t mem_mask); #endif /* BEBOX_H_ */ diff --git a/src/mame/includes/beezer.h b/src/mame/includes/beezer.h index 27b26a9f4d1..4ed0eb337bf 100644 --- a/src/mame/includes/beezer.h +++ b/src/mame/includes/beezer.h @@ -19,7 +19,7 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; int m_pbus; int m_banklatch; @@ -35,7 +35,7 @@ public: DECLARE_READ8_MEMBER(beezer_line_r); DECLARE_DRIVER_INIT(beezer); virtual void machine_start() override; - UINT32 screen_update_beezer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_beezer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(beezer_interrupt); DECLARE_READ8_MEMBER(b_via_0_pa_r); DECLARE_READ8_MEMBER(b_via_0_pb_r); @@ -52,20 +52,20 @@ public: /* 6840 variables */ struct sh6840_timer_channel_beez { - UINT8 cr; - UINT8 state; - UINT8 leftovers; - UINT16 timer; - UINT32 clocks; - UINT8 int_flag; + uint8_t cr; + uint8_t state; + uint8_t leftovers; + uint16_t timer; + uint32_t clocks; + uint8_t int_flag; union { #ifdef LSB_FIRST - struct { UINT8 l, h; } b; + struct { uint8_t l, h; } b; #else - struct { UINT8 h, l; } b; + struct { uint8_t h, l; } b; #endif - UINT16 w; + uint16_t w; } counter; }; @@ -73,7 +73,7 @@ class beezer_sound_device : public device_t, public device_sound_interface { public: - beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~beezer_sound_device() {} DECLARE_READ8_MEMBER( sh6840_r ); @@ -97,21 +97,21 @@ private: cpu_device *m_maincpu; /* IRQ variable */ - //UINT8 m_ptm_irq_state; + //uint8_t m_ptm_irq_state; struct sh6840_timer_channel_beez m_sh6840_timer[3]; - UINT8 m_sh6840_volume[4]; - UINT8 m_sh6840_MSB_latch; - UINT8 m_sh6840_LSB_latch; - UINT32 m_sh6840_LFSR; - UINT32 m_sh6840_LFSR_clocks; - UINT32 m_sh6840_clocks_per_sample; - UINT32 m_sh6840_clock_count; - - UINT32 m_sh6840_latchwrite; - UINT32 m_sh6840_latchwriteold; - UINT32 m_sh6840_noiselatch1; - UINT32 m_sh6840_noiselatch3; + uint8_t m_sh6840_volume[4]; + uint8_t m_sh6840_MSB_latch; + uint8_t m_sh6840_LSB_latch; + uint32_t m_sh6840_LFSR; + uint32_t m_sh6840_LFSR_clocks; + uint32_t m_sh6840_clocks_per_sample; + uint32_t m_sh6840_clock_count; + + uint32_t m_sh6840_latchwrite; + uint32_t m_sh6840_latchwriteold; + uint32_t m_sh6840_noiselatch1; + uint32_t m_sh6840_noiselatch3; /* sound streaming variables */ sound_stream *m_stream; diff --git a/src/mame/includes/bfm_sc4.h b/src/mame/includes/bfm_sc4.h index b2867fd6be3..1933b6cdc92 100644 --- a/src/mame/includes/bfm_sc4.h +++ b/src/mame/includes/bfm_sc4.h @@ -59,7 +59,7 @@ #define SC45_BUTTON_MATRIX_20_0 IPT_SERVICE1 // green / test -static const UINT8 SEGMENT_34_ENCODING_LOOKUP[16] = +static const uint8_t SEGMENT_34_ENCODING_LOOKUP[16] = { 63, // 0 6, // 1 @@ -103,12 +103,12 @@ public: int vfd_enabled; bool vfd_old_clock; - UINT8 vfd_ser_value; + uint8_t vfd_ser_value; int vfd_ser_count; // 34 segment custom encoding used by some sc4/5 machines such as Box Clever, Break The Bank, The Big Deal, The Crazy Chair, The Perfect Game bool m_segment_34_encoding; - UINT8 m_segment_34_cache[32]; + uint8_t m_segment_34_cache[32]; DECLARE_WRITE8_MEMBER(mux_output_w); DECLARE_WRITE8_MEMBER(mux_output2_w); @@ -169,9 +169,9 @@ public: int m_chk41addr; bool m_dochk41; - UINT16 m_mainram[0x10000/2]; + uint16_t m_mainram[0x10000/2]; - UINT8 read_input_matrix(int row); + uint8_t read_input_matrix(int row); DECLARE_WRITE_LINE_MEMBER(bfmdm01_busy); @@ -608,14 +608,14 @@ public: DECLARE_MACHINE_RESET(sc4); - void bfm_sc4_68307_porta_w(address_space &space, bool dedicated, UINT8 data, UINT8 line_mask); + void bfm_sc4_68307_porta_w(address_space &space, bool dedicated, uint8_t data, uint8_t line_mask); DECLARE_WRITE8_MEMBER( bfm_sc4_reel3_w ); DECLARE_WRITE8_MEMBER( bfm_sc4_reel4_w ); - void bfm_sc4_68307_portb_w(address_space &space, bool dedicated, UINT16 data, UINT16 line_mask); - UINT8 bfm_sc4_68307_porta_r(address_space &space, bool dedicated, UINT8 line_mask); - UINT16 bfm_sc4_68307_portb_r(address_space &space, bool dedicated, UINT16 line_mask); + void bfm_sc4_68307_portb_w(address_space &space, bool dedicated, uint16_t data, uint16_t line_mask); + uint8_t bfm_sc4_68307_porta_r(address_space &space, bool dedicated, uint8_t line_mask); + uint16_t bfm_sc4_68307_portb_r(address_space &space, bool dedicated, uint16_t line_mask); - void find_mbus(UINT16* rom); + void find_mbus(uint16_t* rom); protected: @@ -630,8 +630,8 @@ public: m_adder4cpu(*this, "adder4") { } - UINT32* m_adder4cpuregion; - std::unique_ptr m_adder4ram; + uint32_t* m_adder4cpuregion; + std::unique_ptr m_adder4ram; DECLARE_READ32_MEMBER(adder4_mem_r); DECLARE_WRITE32_MEMBER(adder4_mem_w); diff --git a/src/mame/includes/bigevglf.h b/src/mame/includes/bigevglf.h index 39fd1c170ab..c450bf05c5d 100644 --- a/src/mame/includes/bigevglf.h +++ b/src/mame/includes/bigevglf.h @@ -19,43 +19,43 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_paletteram; - required_shared_ptr m_spriteram1; - required_shared_ptr m_spriteram2; + required_shared_ptr m_paletteram; + required_shared_ptr m_spriteram1; + required_shared_ptr m_spriteram2; /* video-related */ bitmap_ind16 m_tmp_bitmap[4]; - std::unique_ptr m_vidram; - UINT32 m_vidram_bank; - UINT32 m_plane_selected; - UINT32 m_plane_visible; + std::unique_ptr m_vidram; + uint32_t m_vidram_bank; + uint32_t m_plane_selected; + uint32_t m_plane_visible; /* sound-related */ int m_sound_nmi_enable; int m_pending_nmi; - UINT8 m_for_sound; - UINT8 m_from_sound; - UINT8 m_sound_state; + uint8_t m_for_sound; + uint8_t m_from_sound; + uint8_t m_sound_state; /* MCU related */ - UINT8 m_from_mcu; + uint8_t m_from_mcu; int m_mcu_sent; int m_main_sent; - 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_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; int m_mcu_coin_bit5; /* misc */ - UINT32 m_beg_bank; - UINT8 m_beg13_ls74[2]; - UINT8 m_port_select; /* for muxed controls */ + uint32_t m_beg_bank; + uint8_t m_beg13_ls74[2]; + uint8_t m_port_select; /* for muxed controls */ /* devices */ required_device m_audiocpu; @@ -99,7 +99,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_bigevglf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bigevglf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(from_sound_latch_callback); TIMER_CALLBACK_MEMBER(nmi_callback); TIMER_CALLBACK_MEMBER(deferred_ls74_w); diff --git a/src/mame/includes/bigstrkb.h b/src/mame/includes/bigstrkb.h index dd7bf0cb86c..2c33d7a1f07 100644 --- a/src/mame/includes/bigstrkb.h +++ b/src/mame/includes/bigstrkb.h @@ -19,12 +19,12 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram2; - required_shared_ptr m_videoram3; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_vidreg1; - required_shared_ptr m_vidreg2; + required_shared_ptr m_videoram2; + required_shared_ptr m_videoram3; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_vidreg1; + required_shared_ptr m_vidreg2; tilemap_t *m_tilemap; tilemap_t *m_tilemap2; @@ -41,6 +41,6 @@ public: virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/bionicc.h b/src/mame/includes/bionicc.h index 1c419b803bd..6b36e460a26 100644 --- a/src/mame/includes/bionicc.h +++ b/src/mame/includes/bionicc.h @@ -29,18 +29,18 @@ public: /* memory pointers */ required_device m_spriteram; - required_shared_ptr m_txvideoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; + required_shared_ptr m_txvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; /* video-related */ tilemap_t *m_tx_tilemap; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT16 m_scroll[4]; + uint16_t m_scroll[4]; - UINT16 m_inp[3]; - UINT16 m_soundcommand; + uint16_t m_inp[3]; + uint16_t m_soundcommand; DECLARE_WRITE16_MEMBER(hacked_controls_w); DECLARE_READ16_MEMBER(hacked_controls_r); @@ -59,7 +59,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_DECODER(RRRRGGGGBBBBIIII); - UINT32 screen_update_bionicc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bionicc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(bionicc_scanline); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/bishi.h b/src/mame/includes/bishi.h index f2421b3b3b9..57c921547fa 100644 --- a/src/mame/includes/bishi.h +++ b/src/mame/includes/bishi.h @@ -29,14 +29,14 @@ public: m_screen(*this, "screen") { } /* memory pointers */ - UINT8 * m_ram; + uint8_t * m_ram; /* video-related */ int m_layer_colorbase[4]; /* misc */ - UINT16 m_cur_control; - UINT16 m_cur_control2; + uint16_t m_cur_control; + uint16_t m_cur_control2; /* devices */ required_device m_maincpu; @@ -54,7 +54,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_bishi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bishi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(bishi_scanline); K056832_CB_MEMBER(tile_callback); }; diff --git a/src/mame/includes/bk.h b/src/mame/includes/bk.h index cd872bcaa88..0910fd45685 100644 --- a/src/mame/includes/bk.h +++ b/src/mame/includes/bk.h @@ -19,13 +19,13 @@ public: m_maincpu(*this, "maincpu"), m_cassette(*this, "cassette") { } - UINT16 m_scrool; - required_shared_ptr m_bk0010_video_ram; - UINT16 m_kbd_state; - UINT16 m_key_code; - UINT16 m_key_pressed; - UINT16 m_key_irq_vector; - UINT16 m_drive; + uint16_t m_scrool; + required_shared_ptr m_bk0010_video_ram; + uint16_t m_kbd_state; + uint16_t m_key_code; + uint16_t m_key_pressed; + uint16_t m_key_irq_vector; + uint16_t m_drive; DECLARE_READ16_MEMBER(bk_key_state_r); DECLARE_READ16_MEMBER(bk_key_code_r); DECLARE_READ16_MEMBER(bk_vid_scrool_r); @@ -40,7 +40,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_bk0010(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bk0010(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(keyboard_callback); IRQ_CALLBACK_MEMBER(bk0010_irq_callback); required_device m_maincpu; diff --git a/src/mame/includes/bking.h b/src/mame/includes/bking.h index 84303d17071..50b8e4467c2 100644 --- a/src/mame/includes/bking.h +++ b/src/mame/includes/bking.h @@ -19,7 +19,7 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_playfield_ram; + required_shared_ptr m_playfield_ram; /* video-related */ bitmap_ind16 m_colmap_bg; @@ -27,12 +27,12 @@ public: tilemap_t *m_bg_tilemap; int m_pc3259_output[4]; int m_pc3259_mask; - UINT8 m_xld1; - UINT8 m_xld2; - UINT8 m_xld3; - UINT8 m_yld1; - UINT8 m_yld2; - UINT8 m_yld3; + uint8_t m_xld1; + uint8_t m_xld2; + uint8_t m_xld3; + uint8_t m_yld1; + uint8_t m_yld2; + uint8_t m_yld3; int m_ball1_pic; int m_ball2_pic; int m_crow_pic; @@ -60,12 +60,12 @@ public: #if 0 /* 68705 */ - 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_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; #endif DECLARE_READ8_MEMBER(bking_sndnmi_disable_r); DECLARE_WRITE8_MEMBER(bking_sndnmi_enable_w); @@ -99,6 +99,6 @@ public: DECLARE_MACHINE_START(bking3); DECLARE_MACHINE_RESET(bking3); DECLARE_MACHINE_RESET(common); - UINT32 screen_update_bking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_bking(screen_device &screen, bool state); }; diff --git a/src/mame/includes/bladestl.h b/src/mame/includes/bladestl.h index 4d8f9d084f1..1db91fabf1d 100644 --- a/src/mame/includes/bladestl.h +++ b/src/mame/includes/bladestl.h @@ -63,7 +63,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(bladestl); - UINT32 screen_update_bladestl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bladestl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(bladestl_scanline); K007342_CALLBACK_MEMBER(bladestl_tile_callback); K007420_CALLBACK_MEMBER(bladestl_sprite_callback); diff --git a/src/mame/includes/blktiger.h b/src/mame/includes/blktiger.h index 8bec4aec309..a722c75be9f 100644 --- a/src/mame/includes/blktiger.h +++ b/src/mame/includes/blktiger.h @@ -23,24 +23,24 @@ public: /* memory pointers */ required_device m_spriteram; - required_shared_ptr m_txvideoram; + required_shared_ptr m_txvideoram; /* video-related */ tilemap_t *m_tx_tilemap; tilemap_t *m_bg_tilemap8x4; tilemap_t *m_bg_tilemap4x8; - UINT32 m_scroll_bank; - UINT8 m_scroll_x[2]; - UINT8 m_scroll_y[2]; - std::unique_ptr m_scroll_ram; - UINT8 m_screen_layout; - UINT8 m_chon; - UINT8 m_objon; - UINT8 m_bgon; + uint32_t m_scroll_bank; + uint8_t m_scroll_x[2]; + uint8_t m_scroll_y[2]; + std::unique_ptr m_scroll_ram; + uint8_t m_screen_layout; + uint8_t m_chon; + uint8_t m_objon; + uint8_t m_bgon; /* mcu-related */ - UINT8 m_z80_latch; - UINT8 m_i8751_latch; + uint8_t m_z80_latch; + uint8_t m_i8751_latch; /* devices */ optional_device m_mcu; @@ -67,7 +67,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_blktiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blktiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/blmbycar.h b/src/mame/includes/blmbycar.h index 4abc3c4f64c..35b672f494b 100644 --- a/src/mame/includes/blmbycar.h +++ b/src/mame/includes/blmbycar.h @@ -26,18 +26,18 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_vram_1; - required_shared_ptr m_vram_0; - required_shared_ptr m_scroll_1; - required_shared_ptr m_scroll_0; - required_shared_ptr m_spriteram; + required_shared_ptr m_vram_1; + required_shared_ptr m_vram_0; + required_shared_ptr m_scroll_1; + required_shared_ptr m_scroll_0; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_tilemap_0; tilemap_t *m_tilemap_1; /* input-related */ - UINT8 m_pot_wheel; // blmbycar + uint8_t m_pot_wheel; // blmbycar int m_old_val; // blmbycar int m_retvalue; // waterball @@ -65,6 +65,6 @@ public: DECLARE_MACHINE_START(watrball); DECLARE_MACHINE_RESET(watrball); - 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); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/blockade.h b/src/mame/includes/blockade.h index d0b40e1f628..356e9bbf098 100644 --- a/src/mame/includes/blockade.h +++ b/src/mame/includes/blockade.h @@ -15,14 +15,14 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_discrete; /* video-related */ tilemap_t *m_bg_tilemap; /* input-related */ - UINT8 m_coin_latch; /* Active Low */ - UINT8 m_just_been_reset; + uint8_t m_coin_latch; /* Active Low */ + uint8_t m_just_been_reset; DECLARE_READ8_MEMBER(blockade_input_port_0_r); DECLARE_WRITE8_MEMBER(blockade_coin_latch_w); DECLARE_WRITE8_MEMBER(blockade_videoram_w); @@ -32,7 +32,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_blockade(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blockade(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(blockade_interrupt); DECLARE_WRITE8_MEMBER(blockade_sound_freq_w); required_device m_maincpu; diff --git a/src/mame/includes/blockout.h b/src/mame/includes/blockout.h index 740c0f39a4f..a7aa2b9709e 100644 --- a/src/mame/includes/blockout.h +++ b/src/mame/includes/blockout.h @@ -24,13 +24,13 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_frontvideoram; - required_shared_ptr m_paletteram; + required_shared_ptr m_videoram; + required_shared_ptr m_frontvideoram; + required_shared_ptr m_paletteram; /* video-related */ bitmap_ind16 m_tmpbitmap; - UINT16 m_color; + uint16_t m_color; /* devices */ required_device m_maincpu; @@ -49,7 +49,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_blockout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blockout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(blockout_scanline); void setcolor( int color, int rgb ); void update_pixels( int x, int y ); diff --git a/src/mame/includes/bloodbro.h b/src/mame/includes/bloodbro.h index 4073e769fb4..2d1c188460e 100644 --- a/src/mame/includes/bloodbro.h +++ b/src/mame/includes/bloodbro.h @@ -23,13 +23,13 @@ public: required_device m_audiocpu; required_device m_seibu_sound; - required_shared_ptr m_spriteram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_txvideoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_txvideoram; - UINT16 m_scrollram[6]; - UINT16 m_layer_en; + uint16_t m_scrollram[6]; + uint16_t m_layer_en; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -49,9 +49,9 @@ public: virtual void video_start() override; - UINT32 screen_update_bloodbro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_weststry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_skysmash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bloodbro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_weststry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_skysmash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void bloodbro_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void weststry_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/blstroid.h b/src/mame/includes/blstroid.h index d1cedbeead6..980f005dad8 100644 --- a/src/mame/includes/blstroid.h +++ b/src/mame/includes/blstroid.h @@ -29,7 +29,7 @@ public: required_device m_playfield_tilemap; required_device m_jsa; required_device m_mob; - required_shared_ptr m_priorityram; + required_shared_ptr m_priorityram; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; @@ -39,7 +39,7 @@ public: DECLARE_MACHINE_START(blstroid); DECLARE_MACHINE_RESET(blstroid); DECLARE_VIDEO_START(blstroid); - UINT32 screen_update_blstroid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blstroid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; diff --git a/src/mame/includes/blueprnt.h b/src/mame/includes/blueprnt.h index 656e0ee6b08..4434b9c3b81 100644 --- a/src/mame/includes/blueprnt.h +++ b/src/mame/includes/blueprnt.h @@ -29,10 +29,10 @@ public: required_device m_gfxdecode; required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_videoram; - required_shared_ptr m_scrollram; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_scrollram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -54,6 +54,6 @@ public: virtual void machine_reset() override; DECLARE_VIDEO_START(blueprnt); DECLARE_PALETTE_INIT(blueprnt); - UINT32 screen_update_blueprnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blueprnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/bogeyman.h b/src/mame/includes/bogeyman.h index d5bd855fac3..0df196af73b 100644 --- a/src/mame/includes/bogeyman.h +++ b/src/mame/includes/bogeyman.h @@ -32,11 +32,11 @@ public: required_device m_ay2; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram; - required_shared_ptr m_colorram2; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram; + required_shared_ptr m_colorram2; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -63,6 +63,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(bogeyman); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/bombjack.h b/src/mame/includes/bombjack.h index db58222ccea..9432c5fd09a 100644 --- a/src/mame/includes/bombjack.h +++ b/src/mame/includes/bombjack.h @@ -19,19 +19,19 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT8 m_background_image; + uint8_t m_background_image; /* sound-related */ - UINT8 m_latch; + uint8_t m_latch; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(bombjack_soundlatch_w); DECLARE_READ8_MEMBER(bombjack_soundlatch_r); DECLARE_WRITE8_MEMBER(irq_mask_w); @@ -44,7 +44,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_bombjack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bombjack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); TIMER_CALLBACK_MEMBER(soundlatch_callback); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/boogwing.h b/src/mame/includes/boogwing.h index 9b28449b41b..c7537a83f76 100644 --- a/src/mame/includes/boogwing.h +++ b/src/mame/includes/boogwing.h @@ -51,19 +51,19 @@ public: required_device m_spriteram; required_device m_spriteram2; /* memory pointers */ - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; - required_shared_ptr m_pf3_rowscroll; - required_shared_ptr m_pf4_rowscroll; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_pf3_rowscroll; + required_shared_ptr m_pf4_rowscroll; required_device m_sprgen1; required_device m_sprgen2; required_device m_palette; - required_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_decrypted_opcodes; DECLARE_WRITE8_MEMBER(sound_bankswitch_w); DECLARE_DRIVER_INIT(boogwing); virtual void video_start() override; - UINT32 screen_update_boogwing(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_boogwing(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void mix_boogwing(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER( boogwing_protection_region_0_104_r ); DECLARE_WRITE16_MEMBER( boogwing_protection_region_0_104_w ); diff --git a/src/mame/includes/bosco.h b/src/mame/includes/bosco.h index 64bd73f7693..3d95c4322d0 100644 --- a/src/mame/includes/bosco.h +++ b/src/mame/includes/bosco.h @@ -10,24 +10,24 @@ public: m_bosco_starcontrol(*this, "starcontrol"), m_bosco_starblink(*this, "bosco_starblink") { } - required_shared_ptr m_bosco_radarattr; + required_shared_ptr m_bosco_radarattr; - required_shared_ptr m_bosco_starcontrol; - required_shared_ptr m_bosco_starblink; + required_shared_ptr m_bosco_starcontrol; + required_shared_ptr m_bosco_starblink; - UINT8 *m_bosco_radarx; - UINT8 *m_bosco_radary; + uint8_t *m_bosco_radarx; + uint8_t *m_bosco_radary; - UINT8 *m_spriteram; - UINT8 *m_spriteram2; - UINT32 m_spriteram_size; + uint8_t *m_spriteram; + uint8_t *m_spriteram2; + uint32_t m_spriteram_size; DECLARE_WRITE8_MEMBER(bosco_flip_screen_w); TILEMAP_MAPPER_MEMBER(fg_tilemap_scan); TILE_GET_INFO_MEMBER(bg_get_tile_info); TILE_GET_INFO_MEMBER(fg_get_tile_info); DECLARE_VIDEO_START(bosco); DECLARE_PALETTE_INIT(bosco); - UINT32 screen_update_bosco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bosco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_bosco(screen_device &screen, bool state); inline void get_tile_info_bosco(tile_data &tileinfo,int tile_index,int ram_offs); diff --git a/src/mame/includes/bottom9.h b/src/mame/includes/bottom9.h index cfaa72de2b0..4215e3e8508 100644 --- a/src/mame/includes/bottom9.h +++ b/src/mame/includes/bottom9.h @@ -53,7 +53,7 @@ public: DECLARE_WRITE8_MEMBER(sound_bank_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_bottom9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bottom9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(bottom9_interrupt); INTERRUPT_GEN_MEMBER(bottom9_sound_interrupt); DECLARE_WRITE8_MEMBER(volume_callback0); diff --git a/src/mame/includes/brkthru.h b/src/mame/includes/brkthru.h index 122844b9c01..09cbc2433f2 100644 --- a/src/mame/includes/brkthru.h +++ b/src/mame/includes/brkthru.h @@ -23,9 +23,9 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_fg_videoram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_fg_tilemap; @@ -33,7 +33,7 @@ public: int m_bgscroll; int m_bgbasecolor; int m_flipscreen; - //UINT8 *m_brkthru_nmi_enable; /* needs to be tracked down */ + //uint8_t *m_brkthru_nmi_enable; /* needs to be tracked down */ /* devices */ required_device m_maincpu; @@ -42,7 +42,7 @@ public: required_device m_palette; required_device m_soundlatch; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(brkthru_1803_w); DECLARE_WRITE8_MEMBER(darwin_0803_w); DECLARE_WRITE8_MEMBER(brkthru_soundlatch_w); @@ -57,7 +57,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(brkthru); - UINT32 screen_update_brkthru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_brkthru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int prio ); }; diff --git a/src/mame/includes/bsktball.h b/src/mame/includes/bsktball.h index 5ef6ba53321..d0e0206549b 100644 --- a/src/mame/includes/bsktball.h +++ b/src/mame/includes/bsktball.h @@ -28,15 +28,15 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_motion; + required_shared_ptr m_videoram; + required_shared_ptr m_motion; required_device m_discrete; /* video-related */ tilemap_t *m_bg_tilemap; /* misc */ - UINT32 m_nmi_on; + uint32_t m_nmi_on; // int m_i256v; /* input-related */ @@ -62,7 +62,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(bsktball); - UINT32 screen_update_bsktball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bsktball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(bsktball_scanline); DECLARE_WRITE8_MEMBER(bsktball_bounce_w); DECLARE_WRITE8_MEMBER(bsktball_note_w); diff --git a/src/mame/includes/btime.h b/src/mame/includes/btime.h index bd0fbaa92cd..4d4cef6df61 100644 --- a/src/mame/includes/btime.h +++ b/src/mame/includes/btime.h @@ -33,28 +33,28 @@ public: } /* memory pointers */ - optional_shared_ptr m_rambase; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - optional_shared_ptr m_bnj_backgroundram; - optional_shared_ptr m_zoar_scrollram; - optional_shared_ptr m_lnc_charbank; - optional_shared_ptr m_deco_charram; - optional_shared_ptr m_spriteram; // used by disco -// UINT8 * m_decrypted; - optional_shared_ptr m_audio_rambase; + optional_shared_ptr m_rambase; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + optional_shared_ptr m_bnj_backgroundram; + optional_shared_ptr m_zoar_scrollram; + optional_shared_ptr m_lnc_charbank; + optional_shared_ptr m_deco_charram; + optional_shared_ptr m_spriteram; // used by disco +// uint8_t * m_decrypted; + optional_shared_ptr m_audio_rambase; /* video-related */ std::unique_ptr m_background_bitmap; - UINT8 m_btime_palette; - UINT8 m_bnj_scroll1; - UINT8 m_bnj_scroll2; - UINT8 m_btime_tilemap[4]; + uint8_t m_btime_palette; + uint8_t m_bnj_scroll1; + uint8_t m_bnj_scroll2; + uint8_t m_btime_tilemap[4]; /* audio-related */ - UINT8 m_audio_nmi_enable_type; - UINT8 m_audio_nmi_enabled; - UINT8 m_audio_nmi_state; + uint8_t m_audio_nmi_enable_type; + uint8_t m_audio_nmi_enabled; + uint8_t m_audio_nmi_state; /* protection-related (for mmonkey) */ int m_protection_command; @@ -116,18 +116,18 @@ public: DECLARE_MACHINE_RESET(mmonkey); DECLARE_VIDEO_START(bnj); DECLARE_VIDEO_START(disco); - UINT32 screen_update_btime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cookrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_lnc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_eggs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bnj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_zoar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_disco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_btime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cookrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lnc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_eggs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bnj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_zoar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_disco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(audio_nmi_gen); - void draw_chars( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 transparency, UINT8 color, int priority ); - void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8* tmap, UINT8 color ); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 color, - UINT8 sprite_y_adjust, UINT8 sprite_y_adjust_flip_screen, - UINT8 *sprite_ram, offs_t interleave ); + void draw_chars( bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t transparency, uint8_t color, int priority ); + void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* tmap, uint8_t color ); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t color, + uint8_t sprite_y_adjust, uint8_t sprite_y_adjust_flip_screen, + uint8_t *sprite_ram, offs_t interleave ); }; diff --git a/src/mame/includes/btoads.h b/src/mame/includes/btoads.h index 065137c3262..1bddac79adf 100644 --- a/src/mame/includes/btoads.h +++ b/src/mame/includes/btoads.h @@ -60,7 +60,7 @@ public: DECLARE_WRITE16_MEMBER( vram_fg_draw_w ); DECLARE_READ16_MEMBER( vram_fg_display_r ); DECLARE_READ16_MEMBER( vram_fg_draw_r ); - void render_sprite_row(UINT16 *sprite_source, UINT32 address); + void render_sprite_row(uint16_t *sprite_source, uint32_t address); TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg); TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg); TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update); @@ -86,31 +86,31 @@ protected: required_device m_tlc34076; // shared pointers - required_shared_ptr m_vram_fg0; - required_shared_ptr m_vram_fg1; - required_shared_ptr m_vram_fg_data; - required_shared_ptr m_vram_bg0; - required_shared_ptr m_vram_bg1; - required_shared_ptr m_sprite_scale; - required_shared_ptr m_sprite_control; + required_shared_ptr m_vram_fg0; + required_shared_ptr m_vram_fg1; + required_shared_ptr m_vram_fg_data; + required_shared_ptr m_vram_bg0; + required_shared_ptr m_vram_bg1; + required_shared_ptr m_sprite_scale; + required_shared_ptr m_sprite_control; // state - UINT8 m_main_to_sound_data; - UINT8 m_main_to_sound_ready; - UINT8 m_sound_to_main_data; - UINT8 m_sound_to_main_ready; - UINT8 m_sound_int_state; - UINT8 *m_vram_fg_draw; - UINT8 *m_vram_fg_display; - INT32 m_xscroll0; - INT32 m_yscroll0; - INT32 m_xscroll1; - INT32 m_yscroll1; - UINT8 m_screen_control; - UINT16 m_sprite_source_offs; - UINT8 *m_sprite_dest_base; - UINT16 m_sprite_dest_offs; - UINT16 m_misc_control; + uint8_t m_main_to_sound_data; + uint8_t m_main_to_sound_ready; + uint8_t m_sound_to_main_data; + uint8_t m_sound_to_main_ready; + uint8_t m_sound_int_state; + uint8_t *m_vram_fg_draw; + uint8_t *m_vram_fg_display; + int32_t m_xscroll0; + int32_t m_yscroll0; + int32_t m_xscroll1; + int32_t m_yscroll1; + uint8_t m_screen_control; + uint16_t m_sprite_source_offs; + uint8_t *m_sprite_dest_base; + uint16_t m_sprite_dest_offs; + uint16_t m_misc_control; int m_xcount; required_device m_maincpu; required_device m_screen; diff --git a/src/mame/includes/bublbobl.h b/src/mame/includes/bublbobl.h index a638ce54b35..c380a5c1439 100644 --- a/src/mame/includes/bublbobl.h +++ b/src/mame/includes/bublbobl.h @@ -26,9 +26,9 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_objectram; - optional_shared_ptr m_mcu_sharedram; + required_shared_ptr m_videoram; + required_shared_ptr m_objectram; + optional_shared_ptr m_mcu_sharedram; /* video-related */ int m_video_enable; @@ -42,25 +42,25 @@ public: /* Tokio*/ int m_tokio_prot_count; /* Bubble Bobble MCU */ - UINT8 m_ddr1; - UINT8 m_ddr2; - UINT8 m_ddr3; - UINT8 m_ddr4; - UINT8 m_port1_in; - UINT8 m_port2_in; - UINT8 m_port3_in; - UINT8 m_port4_in; - UINT8 m_port1_out; - UINT8 m_port2_out; - UINT8 m_port3_out; - UINT8 m_port4_out; + uint8_t m_ddr1; + uint8_t m_ddr2; + uint8_t m_ddr3; + uint8_t m_ddr4; + uint8_t m_port1_in; + uint8_t m_port2_in; + uint8_t m_port3_in; + uint8_t m_port4_in; + uint8_t m_port1_out; + uint8_t m_port2_out; + uint8_t m_port3_out; + uint8_t m_port4_out; /* Bubble Bobble 68705 */ - 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_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; int m_address; int m_latch; /* Bobble Bobble */ @@ -128,7 +128,7 @@ public: DECLARE_MACHINE_RESET(bub68705); DECLARE_MACHINE_START(common); DECLARE_MACHINE_RESET(common); - UINT32 screen_update_bublbobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bublbobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(bublbobl_m68705_interrupt); void configure_banks( ); diff --git a/src/mame/includes/buggychl.h b/src/mame/includes/buggychl.h index 0e9fbc09b01..9f9b893bf7d 100644 --- a/src/mame/includes/buggychl.h +++ b/src/mame/includes/buggychl.h @@ -29,11 +29,11 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_charram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scrollv; - required_shared_ptr m_scrollh; + required_shared_ptr m_charram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scrollv; + required_shared_ptr m_scrollh; /* video-related */ bitmap_ind16 m_tmp_bitmap1; @@ -44,7 +44,7 @@ public: int m_sky_on; int m_sprite_color_base; int m_bg_scrollx; - UINT8 m_sprite_lookup[0x2000]; + uint8_t m_sprite_lookup[0x2000]; /* sound-related */ int m_sound_nmi_enable; @@ -79,7 +79,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(buggychl); - UINT32 screen_update_buggychl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_buggychl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(nmi_callback); void draw_sky( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_bg( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/bullet.h b/src/mame/includes/bullet.h index 206b5dac222..4b3c9b8f564 100644 --- a/src/mame/includes/bullet.h +++ b/src/mame/includes/bullet.h @@ -106,7 +106,7 @@ public: int m_brom; // DMA state - UINT8 m_exdma; + uint8_t m_exdma; int m_buf; bool m_fdrdy; int m_dartardy; @@ -170,8 +170,8 @@ public: void update_dma_rdy(); int m_rome; - UINT8 m_xdma0; - UINT8 m_mbank; + uint8_t m_xdma0; + uint8_t m_mbank; int m_wack; int m_wrdy; }; diff --git a/src/mame/includes/busicom.h b/src/mame/includes/busicom.h index d6a5423808f..8bb6e0faa63 100644 --- a/src/mame/includes/busicom.h +++ b/src/mame/includes/busicom.h @@ -19,12 +19,12 @@ public: m_maincpu(*this, "maincpu"), m_palette(*this, "palette") { } - UINT8 m_drum_index; - UINT16 m_keyboard_shifter; - UINT32 m_printer_shifter; - UINT8 m_timer; - UINT8 m_printer_line[11][17]; - UINT8 m_printer_line_color[11]; + uint8_t m_drum_index; + uint16_t m_keyboard_shifter; + uint32_t m_printer_shifter; + uint8_t m_timer; + uint8_t m_printer_line[11][17]; + uint8_t m_printer_line_color[11]; DECLARE_READ8_MEMBER(keyboard_r); DECLARE_READ8_MEMBER(printer_r); DECLARE_WRITE8_MEMBER(shifter_w); @@ -35,11 +35,11 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(busicom); - UINT32 screen_update_busicom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_busicom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(timer_callback); required_device m_maincpu; required_device m_palette; - UINT8 get_bit_selected(UINT32 val,int num); + uint8_t get_bit_selected(uint32_t val,int num); }; #endif /* BUSICOM_H_ */ diff --git a/src/mame/includes/bw12.h b/src/mame/includes/bw12.h index 24b6d39ce65..31a97242293 100644 --- a/src/mame/includes/bw12.h +++ b/src/mame/includes/bw12.h @@ -72,7 +72,7 @@ public: required_device m_floppy_timer; required_memory_region m_rom; required_memory_region m_char_rom; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; required_ioport m_modifiers; virtual void machine_start() override; diff --git a/src/mame/includes/bw2.h b/src/mame/includes/bw2.h index 2d0795f955e..22e5876ce7e 100644 --- a/src/mame/includes/bw2.h +++ b/src/mame/includes/bw2.h @@ -80,17 +80,17 @@ public: DECLARE_FLOPPY_FORMATS( floppy_formats ); // keyboard state - UINT8 m_kb; + uint8_t m_kb; // memory state - UINT8 m_bank; + uint8_t m_bank; // floppy state int m_mtron; int m_mfdbk; // video state - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; DECLARE_PALETTE_INIT(bw2); DECLARE_WRITE_LINE_MEMBER(write_centronics_busy); diff --git a/src/mame/includes/bwing.h b/src/mame/includes/bwing.h index e094da23dc7..5432ef0c883 100644 --- a/src/mame/includes/bwing.h +++ b/src/mame/includes/bwing.h @@ -40,12 +40,12 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_paletteram; - required_shared_ptr m_fgscrollram; - required_shared_ptr m_bgscrollram; - required_shared_ptr m_gfxram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_paletteram; + required_shared_ptr m_fgscrollram; + required_shared_ptr m_bgscrollram; + required_shared_ptr m_gfxram; /* video-related */ tilemap_t *m_charmap; @@ -85,8 +85,8 @@ public: virtual void video_start() override; void bwing_postload(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bmp, const rectangle &clip, UINT8 *ram, int pri ); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites( bitmap_ind16 &bmp, const rectangle &clip, uint8_t *ram, int pri ); INTERRUPT_GEN_MEMBER(bwp3_interrupt); }; diff --git a/src/mame/includes/bzone.h b/src/mame/includes/bzone.h index 98894644a3c..4a9bf9ec051 100644 --- a/src/mame/includes/bzone.h +++ b/src/mame/includes/bzone.h @@ -29,8 +29,8 @@ public: optional_device m_discrete; optional_device m_redbaronsound; - UINT8 m_analog_data; - UINT8 m_rb_input_select; + uint8_t m_analog_data; + uint8_t m_rb_input_select; DECLARE_WRITE8_MEMBER(bzone_coin_counter_w); DECLARE_READ8_MEMBER(analog_data_r); DECLARE_WRITE8_MEMBER(analog_select_w); diff --git a/src/mame/includes/cabal.h b/src/mame/includes/cabal.h index 6f5a3e71cfb..0642f53afbe 100644 --- a/src/mame/includes/cabal.h +++ b/src/mame/includes/cabal.h @@ -31,9 +31,9 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; tilemap_t *m_background_layer; tilemap_t *m_text_layer; @@ -70,6 +70,6 @@ public: TILE_GET_INFO_MEMBER(get_back_tile_info); TILE_GET_INFO_MEMBER(get_text_tile_info); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/calomega.h b/src/mame/includes/calomega.h index 8667ed87797..89a860513d5 100644 --- a/src/mame/includes/calomega.h +++ b/src/mame/includes/calomega.h @@ -51,7 +51,7 @@ public: DECLARE_DRIVER_INIT(s903mod); DECLARE_DRIVER_INIT(sys905); TILE_GET_INFO_MEMBER(get_bg_tile_info); - UINT32 screen_update_calomega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_calomega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_PALETTE_INIT(calomega); protected: @@ -64,8 +64,8 @@ private: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; optional_ioport m_in0; optional_ioport m_in0_0; @@ -75,7 +75,7 @@ private: optional_ioport m_frq; optional_ioport m_sw2; - UINT8 m_tx_line; + uint8_t m_tx_line; int m_s903_mux_data; int m_s905_mux_data; tilemap_t *m_bg_tilemap; diff --git a/src/mame/includes/canyon.h b/src/mame/includes/canyon.h index aa314ed166f..1bc774e35e2 100644 --- a/src/mame/includes/canyon.h +++ b/src/mame/includes/canyon.h @@ -33,7 +33,7 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_discrete; @@ -46,7 +46,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(canyon); - UINT32 screen_update_canyon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_canyon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(canyon_motor_w); DECLARE_WRITE8_MEMBER(canyon_explode_w); DECLARE_WRITE8_MEMBER(canyon_attract_w); diff --git a/src/mame/includes/capbowl.h b/src/mame/includes/capbowl.h index 25c645ef0e6..633e089c7b9 100644 --- a/src/mame/includes/capbowl.h +++ b/src/mame/includes/capbowl.h @@ -38,13 +38,13 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_rowaddress; + required_shared_ptr m_rowaddress; /* video-related */ offs_t m_blitter_addr; /* input-related */ - UINT8 m_last_trackball_val[2]; + uint8_t m_last_trackball_val[2]; emu_timer *m_update_timer; @@ -70,8 +70,8 @@ public: INTERRUPT_GEN_MEMBER(interrupt); TIMER_CALLBACK_MEMBER(update); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - inline rgb_t pen_for_pixel( UINT8 *src, UINT8 pix ); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + inline rgb_t pen_for_pixel( uint8_t *src, uint8_t pix ); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h index 62978cef335..bec5661a453 100644 --- a/src/mame/includes/carpolo.h +++ b/src/mame/includes/carpolo.h @@ -39,17 +39,17 @@ public: m_palette(*this, "palette") {} - required_shared_ptr m_alpharam; - required_shared_ptr m_spriteram; - UINT8 m_ball_screen_collision_cause; - UINT8 m_car_ball_collision_x; - UINT8 m_car_ball_collision_y; - UINT8 m_car_car_collision_cause; - UINT8 m_car_goal_collision_cause; - UINT8 m_car_ball_collision_cause; - UINT8 m_car_border_collision_cause; - UINT8 m_priority_0_extension; - UINT8 m_last_wheel_value[4]; + required_shared_ptr m_alpharam; + required_shared_ptr m_spriteram; + uint8_t m_ball_screen_collision_cause; + uint8_t m_car_ball_collision_x; + uint8_t m_car_ball_collision_y; + uint8_t m_car_car_collision_cause; + uint8_t m_car_goal_collision_cause; + uint8_t m_car_ball_collision_cause; + uint8_t m_car_border_collision_cause; + uint8_t m_priority_0_extension; + uint8_t m_last_wheel_value[4]; required_device m_maincpu; required_device m_ttl74148_3s; required_device m_ttl74153_1k; @@ -92,7 +92,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(carpolo); - UINT32 screen_update_carpolo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_carpolo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_carpolo(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(carpolo_timer_interrupt); DECLARE_WRITE_LINE_MEMBER(coin1_interrupt_clear_w); @@ -115,14 +115,14 @@ public: void normalize_coordinates(int *x1, int *y1, int *x2, int *y2); int check_sprite_left_goal_collision(int x1, int y1, int code1, int flipy1, int goalpost_only); int check_sprite_right_goal_collision(int x1, int y1, int code1, int flipy1, int goalpost_only); - int check_sprite_border_collision(UINT8 x1, UINT8 y1, int code1, int flipy1); - void carpolo_generate_ball_screen_interrupt(UINT8 cause); + int check_sprite_border_collision(uint8_t x1, uint8_t y1, int code1, int flipy1); + void carpolo_generate_ball_screen_interrupt(uint8_t cause); void carpolo_generate_car_car_interrupt(int car1, int car2); void carpolo_generate_car_goal_interrupt(int car, int right_goal); void carpolo_generate_car_ball_interrupt(int car, int car_x, int car_y); void carpolo_generate_car_border_interrupt(int car, int horizontal_border); void draw_alpha_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int alpha_line, int video_line); - void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 x, UINT8 y, int bank, int code, int col); + void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t x, uint8_t y, int bank, int code, int col); int check_sprite_sprite_collision(int x1, int y1, int code1, int flipy1, int x2, int y2, int code2, int flipy2, int *col_x, int *col_y); diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h index 680c1b7a6ea..55c4e0c803e 100644 --- a/src/mame/includes/cave.h +++ b/src/mame/includes/cave.h @@ -16,7 +16,7 @@ struct sprite_cave { int priority, flags; - const UINT8 *pen_data; /* points to top left corner of tile data */ + const uint8_t *pen_data; /* points to top left corner of tile data */ int line_offset; pen_t base_pen; @@ -53,12 +53,12 @@ public: , m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - optional_shared_ptr_array m_videoregs; - optional_shared_ptr_array m_vram; - optional_shared_ptr_array m_vctrl; - optional_shared_ptr_array m_spriteram; - optional_shared_ptr_array m_spriteram_2; - optional_shared_ptr_array m_paletteram; + optional_shared_ptr_array m_videoregs; + optional_shared_ptr_array m_vram; + optional_shared_ptr_array m_vctrl; + optional_shared_ptr_array m_spriteram; + optional_shared_ptr_array m_spriteram_2; + optional_shared_ptr_array m_paletteram; /* video-related */ struct sprite_cave *m_sprite[4]; @@ -67,9 +67,9 @@ public: struct { int clip_left, clip_right, clip_top, clip_bottom; - UINT8 *baseaddr; + uint8_t *baseaddr; int line_offset; - UINT8 *baseaddr_zbuf; + uint8_t *baseaddr_zbuf; int line_offset_zbuf; } m_blit; @@ -82,14 +82,14 @@ public: int m_old_tiledim[4]; bitmap_ind16 m_sprite_zbuf; - UINT16 m_sprite_zbuf_baseval; + uint16_t m_sprite_zbuf_baseval; int m_num_sprites[4]; int m_spriteram_bank[4]; int m_spriteram_bank_delay[4]; - std::unique_ptr m_palette_map[4]; + std::unique_ptr m_palette_map[4]; int m_layers_offs_x; int m_layers_offs_y; @@ -103,26 +103,26 @@ public: /* misc */ int m_time_vblank_irq; - UINT8 m_irq_level; - UINT8 m_vblank_irq; - UINT8 m_sound_irq; - UINT8 m_unknown_irq; - UINT8 m_agallet_vblank_irq; + uint8_t m_irq_level; + uint8_t m_vblank_irq; + uint8_t m_sound_irq; + uint8_t m_unknown_irq; + uint8_t m_agallet_vblank_irq; /* sound related */ int m_soundbuf_len; - UINT8 m_soundbuf_data[32]; - //UINT8 m_sound_flag1; - //UINT8 m_sound_flag2; + uint8_t m_soundbuf_data[32]; + //uint8_t m_sound_flag1; + //uint8_t m_sound_flag2; /* game specific */ // sailormn int m_sailormn_tilebank; // korokoro - UINT16 m_leds[2]; + uint16_t m_leds[2]; int m_hopper; // ppsatan - UINT16 m_ppsatan_io_mux; + uint16_t m_ppsatan_io_mux; /* devices */ required_device m_maincpu; @@ -190,7 +190,7 @@ public: DECLARE_READ16_MEMBER(ppsatan_touch1_r); DECLARE_READ16_MEMBER(ppsatan_touch2_r); DECLARE_WRITE16_MEMBER(ppsatan_out_w); - UINT16 ppsatan_touch_r(int player); + uint16_t ppsatan_touch_r(int player); DECLARE_DRIVER_INIT(uopoko); DECLARE_DRIVER_INIT(donpachi); DECLARE_DRIVER_INIT(mazinger); @@ -230,11 +230,11 @@ public: DECLARE_VIDEO_START(sailormn_3_layers); DECLARE_PALETTE_INIT(sailormn); DECLARE_PALETTE_INIT(ppsatan); - UINT32 screen_update_cave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ppsatan_core (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int chip); - UINT32 screen_update_ppsatan_top (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ppsatan_left (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ppsatan_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ppsatan_core (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int chip); + uint32_t screen_update_ppsatan_top (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ppsatan_left (screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ppsatan_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(cave_interrupt); INTERRUPT_GEN_MEMBER(cave_interrupt_ppsatan); TIMER_CALLBACK_MEMBER(cave_vblank_end); @@ -255,10 +255,10 @@ public: private: inline void get_tile_info( tile_data &tileinfo, int tile_index, int GFX ); - inline void tilemap_draw( int chip, screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 flags, UINT32 priority, UINT32 priority2, int GFX ); - inline void vram_w( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask, int GFX ); - inline void vram_8x8_w( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask, int GFX ); - inline void vctrl_w( address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int GFX ); + inline void tilemap_draw( int chip, screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, uint32_t flags, uint32_t priority, uint32_t priority2, int GFX ); + inline void vram_w( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint16_t data, ATTR_UNUSED uint16_t mem_mask, int GFX ); + inline void vram_8x8_w( address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED uint16_t data, ATTR_UNUSED uint16_t mem_mask, int GFX ); + inline void vctrl_w( address_space &space, offs_t offset, uint16_t data, uint16_t mem_mask, int GFX ); void set_pens(int chip); void cave_vh_start( int num ); void get_sprite_info_cave(int chip); diff --git a/src/mame/includes/cbasebal.h b/src/mame/includes/cbasebal.h index b64eb70e6f8..f062fc47fe6 100644 --- a/src/mame/includes/cbasebal.h +++ b/src/mame/includes/cbasebal.h @@ -17,16 +17,16 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - std::unique_ptr m_textram; - std::unique_ptr m_scrollram; - std::unique_ptr m_decoded; - UINT8 m_scroll_x[2]; - UINT8 m_scroll_y[2]; + std::unique_ptr m_textram; + std::unique_ptr m_scrollram; + std::unique_ptr m_decoded; + uint8_t m_scroll_x[2]; + uint8_t m_scroll_y[2]; int m_tilebank; int m_spritebank; int m_text_on; @@ -35,7 +35,7 @@ public: int m_flipscreen; /* misc */ - UINT8 m_rambank; + uint8_t m_rambank; DECLARE_WRITE8_MEMBER(cbasebal_bankswitch_w); DECLARE_READ8_MEMBER(bankedram_r); DECLARE_WRITE8_MEMBER(bankedram_w); @@ -53,7 +53,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cbasebal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cbasebal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/cbuster.h b/src/mame/includes/cbuster.h index 8e8ea97166f..e404f579121 100644 --- a/src/mame/includes/cbuster.h +++ b/src/mame/includes/cbuster.h @@ -31,18 +31,18 @@ public: { } /* memory pointers */ - required_shared_ptr m_ram; - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; - required_shared_ptr m_pf3_rowscroll; - required_shared_ptr m_pf4_rowscroll; - required_shared_ptr m_spriteram16; + required_shared_ptr m_ram; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_pf3_rowscroll; + required_shared_ptr m_pf4_rowscroll; + required_shared_ptr m_spriteram16; optional_device m_sprgen; - UINT16 m_spriteram16_buffer[0x400]; + uint16_t m_spriteram16_buffer[0x400]; /* misc */ - UINT16 m_prot; + uint16_t m_prot; int m_pri; /* devices */ @@ -59,6 +59,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_twocrude(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_twocrude(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECO16IC_BANK_CB_MEMBER(bank_callback); }; diff --git a/src/mame/includes/ccastles.h b/src/mame/includes/ccastles.h index 2a815cec48f..c1f2008935d 100644 --- a/src/mame/includes/ccastles.h +++ b/src/mame/includes/ccastles.h @@ -28,32 +28,32 @@ public: required_device m_nvram_4b; required_device m_nvram_4a; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; /* video-related */ - const UINT8 *m_syncprom; - const UINT8 *m_wpprom; - const UINT8 *m_priprom; + const uint8_t *m_syncprom; + const uint8_t *m_wpprom; + const uint8_t *m_priprom; bitmap_ind16 m_spritebitmap; double m_rweights[3]; double m_gweights[3]; double m_bweights[3]; - UINT8 m_video_control[8]; - UINT8 m_bitmode_addr[2]; - UINT8 m_hscroll; - UINT8 m_vscroll; + uint8_t m_video_control[8]; + uint8_t m_bitmode_addr[2]; + uint8_t m_hscroll; + uint8_t m_vscroll; /* misc */ int m_vblank_start; int m_vblank_end; emu_timer *m_irq_timer; - UINT8 m_irq_state; - UINT8 m_nvram_store[2]; + uint8_t m_irq_state; + uint8_t m_nvram_store[2]; DECLARE_WRITE8_MEMBER(irq_ack_w); DECLARE_WRITE8_MEMBER(led_w); @@ -76,9 +76,9 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_ccastles(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ccastles(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(clock_irq); - inline void ccastles_write_vram( UINT16 addr, UINT8 data, UINT8 bitmd, UINT8 pixba ); + inline void ccastles_write_vram( uint16_t addr, uint8_t data, uint8_t bitmd, uint8_t pixba ); inline void bitmode_autoinc( ); inline void schedule_next_irq( int curscanline ); }; diff --git a/src/mame/includes/cchasm.h b/src/mame/includes/cchasm.h index 7389a213521..cbbc8ecd310 100644 --- a/src/mame/includes/cchasm.h +++ b/src/mame/includes/cchasm.h @@ -47,7 +47,7 @@ public: required_device m_soundlatch3; required_device m_soundlatch4; - required_shared_ptr m_ram; + required_shared_ptr m_ram; int m_sound_flags; int m_coin_flag; diff --git a/src/mame/includes/cclimber.h b/src/mame/includes/cclimber.h index d9c8f77e551..30cf4b45d85 100644 --- a/src/mame/includes/cclimber.h +++ b/src/mame/includes/cclimber.h @@ -33,28 +33,28 @@ public: required_device m_palette; optional_device m_soundlatch; - required_shared_ptr m_bigsprite_videoram; - required_shared_ptr m_videoram; - optional_shared_ptr m_column_scroll; - required_shared_ptr m_spriteram; - required_shared_ptr m_bigsprite_control; - required_shared_ptr m_colorram; - required_shared_ptr m_flip_screen; - optional_shared_ptr m_swimmer_side_background_enabled; - optional_shared_ptr m_swimmer_palettebank; - optional_shared_ptr m_swimmer_background_color; - optional_shared_ptr m_toprollr_bg_videoram; - optional_shared_ptr m_toprollr_bg_coloram; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_bigsprite_videoram; + required_shared_ptr m_videoram; + optional_shared_ptr m_column_scroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_bigsprite_control; + required_shared_ptr m_colorram; + required_shared_ptr m_flip_screen; + optional_shared_ptr m_swimmer_side_background_enabled; + optional_shared_ptr m_swimmer_palettebank; + optional_shared_ptr m_swimmer_background_color; + optional_shared_ptr m_toprollr_bg_videoram; + optional_shared_ptr m_toprollr_bg_coloram; + optional_shared_ptr m_decrypted_opcodes; - UINT8 m_yamato_p0; - UINT8 m_yamato_p1; - UINT8 m_toprollr_rombank; - UINT8 m_nmi_mask; + uint8_t m_yamato_p0; + uint8_t m_yamato_p1; + uint8_t m_toprollr_rombank; + uint8_t m_nmi_mask; tilemap_t *m_pf_tilemap; tilemap_t *m_bs_tilemap; tilemap_t *m_toproller_bg_tilemap; - std::unique_ptr m_opcodes; + std::unique_ptr m_opcodes; DECLARE_WRITE8_MEMBER(swimmer_sh_soundlatch_w); DECLARE_WRITE8_MEMBER(yamato_p0_w); @@ -92,10 +92,10 @@ public: TILE_GET_INFO_MEMBER(toprollr_get_bs_tile_info); TILE_GET_INFO_MEMBER(toproller_get_bg_tile_info); - UINT32 screen_update_cclimber(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_swimmer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_yamato(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_toprollr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cclimber(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_swimmer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_yamato(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_toprollr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void swimmer_set_background_pen(); void draw_playfield(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void cclimber_draw_bigsprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -103,7 +103,7 @@ public: void cclimber_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx); void toprollr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx); void swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx); - void cclimber_decode(const UINT8 convtable[8][16]); + void cclimber_decode(const uint8_t convtable[8][16]); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(bagmanf_vblank_irq); diff --git a/src/mame/includes/cdi.h b/src/mame/includes/cdi.h index 2e7b13ada04..869f3c59355 100644 --- a/src/mame/includes/cdi.h +++ b/src/mame/includes/cdi.h @@ -72,8 +72,8 @@ public: }; required_device m_maincpu; - required_shared_ptr m_planea; - required_shared_ptr m_planeb; + required_shared_ptr m_planea; + required_shared_ptr m_planeb; optional_ioport m_input1; optional_ioport m_input2; required_ioport m_mousex; @@ -91,10 +91,10 @@ public: INTERRUPT_GEN_MEMBER( mcu_frame ); - UINT8 m_servo_io_regs[0x20]; - UINT8 m_slave_io_regs[0x20]; + uint8_t m_servo_io_regs[0x20]; + uint8_t m_slave_io_regs[0x20]; - UINT8 m_timer_set; + uint8_t m_timer_set; emu_timer *m_test_timer; bitmap_rgb32 m_lcdbitmap; @@ -121,8 +121,8 @@ public: DECLARE_READ8_MEMBER(slave_io_r); DECLARE_WRITE8_MEMBER(slave_io_w); - UINT32 screen_update_cdimono1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cdimono1_lcd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cdimono1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cdimono1_lcd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; /*----------- debug defines -----------*/ diff --git a/src/mame/includes/centiped.h b/src/mame/includes/centiped.h index 325b5fb0f6b..066f66c8159 100644 --- a/src/mame/includes/centiped.h +++ b/src/mame/includes/centiped.h @@ -26,11 +26,11 @@ public: m_palette(*this, "palette"), m_aysnd(*this, "aysnd") { } - optional_shared_ptr m_rambase; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_paletteram; - optional_shared_ptr m_bullsdrt_tiles_bankram; + optional_shared_ptr m_rambase; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_paletteram; + optional_shared_ptr m_bullsdrt_tiles_bankram; required_device m_maincpu; optional_device m_eeprom; @@ -39,15 +39,15 @@ public: required_device m_palette; optional_device m_aysnd; - UINT8 m_oldpos[4]; - UINT8 m_sign[4]; - UINT8 m_dsw_select; - UINT8 m_control_select; - UINT8 m_flipscreen; - UINT8 m_prg_bank; - UINT8 m_gfx_bank; - UINT8 m_bullsdrt_sprites_bank; - UINT8 m_penmask[64]; + uint8_t m_oldpos[4]; + uint8_t m_sign[4]; + uint8_t m_dsw_select; + uint8_t m_control_select; + uint8_t m_flipscreen; + uint8_t m_prg_bank; + uint8_t m_gfx_bank; + uint8_t m_bullsdrt_sprites_bank; + uint8_t m_penmask[64]; tilemap_t *m_bg_tilemap; // drivers/centiped.c @@ -94,13 +94,13 @@ public: DECLARE_VIDEO_START(milliped); DECLARE_VIDEO_START(warlords); DECLARE_PALETTE_INIT(warlords); - UINT32 screen_update_centiped(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bullsdrt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_milliped(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_warlords(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_centiped(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bullsdrt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_milliped(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_warlords(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(generate_interrupt); void init_penmask(); void init_common(); - void milliped_set_color(offs_t offset, UINT8 data); + void milliped_set_color(offs_t offset, uint8_t data); inline int read_trackball(int idx, int switch_port); }; diff --git a/src/mame/includes/cgc7900.h b/src/mame/includes/cgc7900.h index defea5ddad9..9d8b6420f2f 100644 --- a/src/mame/includes/cgc7900.h +++ b/src/mame/includes/cgc7900.h @@ -50,26 +50,26 @@ public: required_device m_maincpu; required_device m_palette; required_memory_region m_char_rom; - required_shared_ptr m_chrom_ram; - required_shared_ptr m_plane_ram; - required_shared_ptr m_clut_ram; - required_shared_ptr m_overlay_ram; - required_shared_ptr m_roll_bitmap; - required_shared_ptr m_pan_x; - required_shared_ptr m_pan_y; - required_shared_ptr m_zoom; - required_shared_ptr m_blink_select; - required_shared_ptr m_plane_select; - required_shared_ptr m_plane_switch; - required_shared_ptr m_color_status_fg; - required_shared_ptr m_color_status_bg; - required_shared_ptr m_roll_overlay; + required_shared_ptr m_chrom_ram; + required_shared_ptr m_plane_ram; + required_shared_ptr m_clut_ram; + required_shared_ptr m_overlay_ram; + required_shared_ptr m_roll_bitmap; + required_shared_ptr m_pan_x; + required_shared_ptr m_pan_y; + required_shared_ptr m_zoom; + required_shared_ptr m_blink_select; + required_shared_ptr m_plane_select; + required_shared_ptr m_plane_switch; + required_shared_ptr m_color_status_fg; + required_shared_ptr m_color_status_bg; + required_shared_ptr m_roll_overlay; virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(cgc7900); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER( keyboard_r ); DECLARE_WRITE16_MEMBER( keyboard_w ); @@ -88,7 +88,7 @@ public: void draw_overlay(screen_device *screen, bitmap_rgb32 &bitmap); /* interrupt state */ - UINT16 m_int_mask; + uint16_t m_int_mask; /* video state */ rgb_t m_clut[256]; diff --git a/src/mame/includes/chaknpop.h b/src/mame/includes/chaknpop.h index dc457388e66..3ae9cc5b31c 100644 --- a/src/mame/includes/chaknpop.h +++ b/src/mame/includes/chaknpop.h @@ -24,26 +24,26 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_mcu_ram; - required_shared_ptr m_tx_ram; - required_shared_ptr m_attr_ram; - required_shared_ptr m_spr_ram; + required_shared_ptr m_mcu_ram; + required_shared_ptr m_tx_ram; + required_shared_ptr m_attr_ram; + required_shared_ptr m_spr_ram; /* mcu-related */ - UINT8 m_mcu_seed; - UINT8 m_mcu_select; - UINT8 m_mcu_result; + uint8_t m_mcu_seed; + uint8_t m_mcu_select; + uint8_t m_mcu_result; /* video-related */ tilemap_t *m_tx_tilemap; - UINT8 *m_vram1; - UINT8 *m_vram2; - UINT8 *m_vram3; - UINT8 *m_vram4; - UINT8 m_gfxmode; - UINT8 m_flip_x; - UINT8 m_flip_y; + uint8_t *m_vram1; + uint8_t *m_vram2; + uint8_t *m_vram3; + uint8_t *m_vram4; + uint8_t m_gfxmode; + uint8_t m_flip_x; + uint8_t m_flip_y; DECLARE_WRITE8_MEMBER(coinlock_w); DECLARE_READ8_MEMBER(mcu_port_a_r); @@ -65,10 +65,10 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(chaknpop); - 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); void tx_tilemap_mark_all_dirty(); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); - void mcu_update_seed(UINT8 data); + void mcu_update_seed(uint8_t data); }; diff --git a/src/mame/includes/champbas.h b/src/mame/includes/champbas.h index ca82f5db17c..014b56e293c 100644 --- a/src/mame/includes/champbas.h +++ b/src/mame/includes/champbas.h @@ -35,16 +35,16 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_mainram; - required_shared_ptr m_vram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; + required_shared_ptr m_mainram; + required_shared_ptr m_vram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram2; // internal state - UINT8 m_irq_mask; + uint8_t m_irq_mask; tilemap_t *m_bg_tilemap; - UINT8 m_gfx_bank; - UINT8 m_palette_bank; + uint8_t m_gfx_bank; + uint8_t m_palette_bank; // handlers DECLARE_WRITE8_MEMBER(irq_enable_w); @@ -72,8 +72,8 @@ public: TILE_GET_INFO_MEMBER(champbas_get_bg_tile_info); TILE_GET_INFO_MEMBER(exctsccr_get_bg_tile_info); - UINT32 screen_update_champbas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_exctsccr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_champbas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_exctsccr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void champbas_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void exctsccr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/changela.h b/src/mame/includes/changela.h index 232e2e783ce..e35be8900cd 100644 --- a/src/mame/includes/changela.h +++ b/src/mame/includes/changela.h @@ -16,51 +16,51 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* video-related */ bitmap_ind16 m_obj0_bitmap; bitmap_ind16 m_river_bitmap; bitmap_ind16 m_tree0_bitmap; bitmap_ind16 m_tree1_bitmap; - std::unique_ptr m_tree_ram; - std::unique_ptr m_memory_devices; - UINT32 m_mem_dev_selected; /* an offset within memory_devices area */ - UINT32 m_slopeROM_bank; - UINT8 m_tree_en; - UINT8 m_horizon; - UINT8 m_v_count_river; - UINT8 m_v_count_tree; + std::unique_ptr m_tree_ram; + std::unique_ptr m_memory_devices; + uint32_t m_mem_dev_selected; /* an offset within memory_devices area */ + uint32_t m_slopeROM_bank; + uint8_t m_tree_en; + uint8_t m_horizon; + uint8_t m_v_count_river; + uint8_t m_v_count_tree; int m_tree_on[2]; emu_timer* m_scanline_timer; /* misc */ - UINT8 m_tree0_col; - UINT8 m_tree1_col; - UINT8 m_left_bank_col; - UINT8 m_right_bank_col; - UINT8 m_boat_shore_col; - UINT8 m_collision_reset; - UINT8 m_tree_collision_reset; - UINT8 m_prev_value_31; + uint8_t m_tree0_col; + uint8_t m_tree1_col; + uint8_t m_left_bank_col; + uint8_t m_right_bank_col; + uint8_t m_boat_shore_col; + uint8_t m_collision_reset; + uint8_t m_tree_collision_reset; + uint8_t m_prev_value_31; int m_dir_31; /* mcu-related */ - UINT8 m_port_a_in; - UINT8 m_port_a_out; - UINT8 m_ddr_a; - UINT8 m_port_b_out; - UINT8 m_ddr_b; - UINT8 m_port_c_in; - UINT8 m_port_c_out; - UINT8 m_ddr_c; + uint8_t m_port_a_in; + uint8_t m_port_a_out; + uint8_t m_ddr_a; + 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 m_mcu_out; - UINT8 m_mcu_in; - UINT8 m_mcu_pc_1; - UINT8 m_mcu_pc_0; + uint8_t m_mcu_out; + uint8_t m_mcu_in; + uint8_t m_mcu_pc_1; + uint8_t m_mcu_pc_0; /* devices */ optional_device m_mcu; @@ -94,7 +94,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_changela(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_changela(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(chl_mcu_irq); TIMER_CALLBACK_MEMBER(changela_scanline_callback); TIMER_DEVICE_CALLBACK_MEMBER(changela_scanline); diff --git a/src/mame/includes/channelf.h b/src/mame/includes/channelf.h index 41c7e70cd7e..5eef8bbb4e5 100644 --- a/src/mame/includes/channelf.h +++ b/src/mame/includes/channelf.h @@ -35,16 +35,16 @@ public: DECLARE_WRITE8_MEMBER(port_1_w); DECLARE_WRITE8_MEMBER(port_4_w); DECLARE_WRITE8_MEMBER(port_5_w); - UINT8 *m_p_videoram; - UINT8 m_latch[6]; - UINT8 m_val_reg; - UINT8 m_row_reg; - UINT8 m_col_reg; - UINT8 port_read_with_latch(UINT8 ext, UINT8 latch_state); + uint8_t *m_p_videoram; + uint8_t m_latch[6]; + uint8_t m_val_reg; + uint8_t m_row_reg; + uint8_t m_col_reg; + uint8_t port_read_with_latch(uint8_t ext, uint8_t latch_state); virtual void video_start() override; virtual void machine_start() override; DECLARE_PALETTE_INIT(channelf); - UINT32 screen_update_channelf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_channelf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_custom; required_device m_cart; diff --git a/src/mame/includes/cheekyms.h b/src/mame/includes/cheekyms.h index c413340d551..260b3548562 100644 --- a/src/mame/includes/cheekyms.h +++ b/src/mame/includes/cheekyms.h @@ -44,15 +44,15 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_port_80; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_port_80; /* video-related */ tilemap_t *m_cm_tilemap; std::unique_ptr m_bitmap_buffer; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(port_40_w); DECLARE_WRITE8_MEMBER(port_80_w); @@ -66,6 +66,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(cheekyms); - 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); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int flip ); }; diff --git a/src/mame/includes/chihiro.h b/src/mame/includes/chihiro.h index 1988d6e4c23..ada5eb240e4 100644 --- a/src/mame/includes/chihiro.h +++ b/src/mame/includes/chihiro.h @@ -63,7 +63,7 @@ public: struct vertex_nv { union { float fv[4]; - UINT32 iv[4]; + uint32_t iv[4]; } attribute[16]; }; @@ -434,23 +434,23 @@ public: DECLARE_READ32_MEMBER(geforce_r); DECLARE_WRITE32_MEMBER(geforce_w); void vblank_callback(screen_device &screen, bool state); - UINT32 screen_update_callback(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_callback(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); bool update_interrupts(); void set_interrupt_device(pic8259_device *device); - void render_texture_simple(INT32 scanline, const extent_t &extent, const nvidia_object_data &extradata, int threadid); - void render_color(INT32 scanline, const extent_t &extent, const nvidia_object_data &extradata, int threadid); - void render_register_combiners(INT32 scanline, const extent_t &extent, const nvidia_object_data &objectdata, int threadid); + void render_texture_simple(int32_t scanline, const extent_t &extent, const nvidia_object_data &extradata, int threadid); + void render_color(int32_t scanline, const extent_t &extent, const nvidia_object_data &extradata, int threadid); + void render_register_combiners(int32_t scanline, const extent_t &extent, const nvidia_object_data &objectdata, int threadid); - int geforce_commandkind(UINT32 word); - UINT32 geforce_object_offset(UINT32 handle); - void geforce_read_dma_object(UINT32 handle, UINT32 &offset, UINT32 &size); - void geforce_assign_object(address_space &space, UINT32 chanel, UINT32 subchannel, UINT32 address); - int geforce_exec_method(address_space &space, UINT32 channel, UINT32 subchannel, UINT32 method, UINT32 address, int &countlen); - UINT32 texture_get_texel(int number, int x, int y); - UINT8 *read_pixel(int x, int y, INT32 c[4]); - void write_pixel(int x, int y, UINT32 color, int depth); - void combiner_initialize_registers(UINT32 argb8[6]); + int geforce_commandkind(uint32_t word); + uint32_t geforce_object_offset(uint32_t handle); + void geforce_read_dma_object(uint32_t handle, uint32_t &offset, uint32_t &size); + void geforce_assign_object(address_space &space, uint32_t chanel, uint32_t subchannel, uint32_t address); + int geforce_exec_method(address_space &space, uint32_t channel, uint32_t subchannel, uint32_t method, uint32_t address, int &countlen); + uint32_t texture_get_texel(int number, int x, int y); + uint8_t *read_pixel(int x, int y, int32_t c[4]); + void write_pixel(int x, int y, uint32_t color, int depth); + void combiner_initialize_registers(uint32_t argb8[6]); void combiner_initialize_stage(int stage_number); void combiner_initialize_final(); void combiner_map_input(int stage_number); // map combiner registers to variables A..D @@ -470,56 +470,56 @@ public: void combiner_function_ABsumCD(float result[4]); void combiner_compute_rgb_outputs(int index); void combiner_compute_a_outputs(int index); - void combiner_argb8_float(UINT32 color, float reg[4]); - UINT32 combiner_float_argb8(float reg[4]); - UINT32 dilate0(UINT32 value, int bits); - UINT32 dilate1(UINT32 value, int bits); + void combiner_argb8_float(uint32_t color, float reg[4]); + uint32_t combiner_float_argb8(float reg[4]); + uint32_t dilate0(uint32_t value, int bits); + uint32_t dilate1(uint32_t value, int bits); void computedilated(void); int toggle_register_combiners_usage(); int toggle_wait_vblank_support(); void debug_grab_texture(int type, const char *filename); - void debug_grab_vertex_program_slot(int slot, UINT32 *instruction); + void debug_grab_vertex_program_slot(int slot, uint32_t *instruction); void start(address_space *cpu_space); void savestate_items(); void compute_supersample_factors(float &horizontal, float &vertical); - void compute_limits_rendertarget(UINT32 chanel, UINT32 subchannel); + void compute_limits_rendertarget(uint32_t chanel, uint32_t subchannel); void read_vertex(address_space & space, offs_t address, vertex_nv &vertex, int attrib); - int read_vertices_0x1800(address_space & space, vertex_nv *destination, UINT32 address, int limit); - int read_vertices_0x1808(address_space & space, vertex_nv *destination, UINT32 address, int limit); + int read_vertices_0x1800(address_space & space, vertex_nv *destination, uint32_t address, int limit); + int read_vertices_0x1808(address_space & space, vertex_nv *destination, uint32_t address, int limit); int read_vertices_0x1810(address_space & space, vertex_nv *destination, int offset, int limit); - int read_vertices_0x1818(address_space & space, vertex_nv *destination, UINT32 address, int limit); + int read_vertices_0x1818(address_space & space, vertex_nv *destination, uint32_t address, int limit); void convert_vertices_poly(vertex_nv *source, nv2avertex_t *destination, int count); void assemble_primitive(vertex_nv *source, int count, render_delegate &renderspans); - UINT32 render_triangle_clipping(const rectangle &cliprect, render_delegate callback, int paramcount, nv2avertex_t &_v1, nv2avertex_t &_v2, nv2avertex_t &_v3); - UINT32 render_triangle_culling(const rectangle &cliprect, render_delegate callback, int paramcount, nv2avertex_t &_v1, nv2avertex_t &_v2, nv2avertex_t &_v3); - void clear_render_target(int what, UINT32 value); - void clear_depth_buffer(int what, UINT32 value); - inline UINT8 *direct_access_ptr(offs_t address); + uint32_t render_triangle_clipping(const rectangle &cliprect, render_delegate callback, int paramcount, nv2avertex_t &_v1, nv2avertex_t &_v2, nv2avertex_t &_v3); + uint32_t render_triangle_culling(const rectangle &cliprect, render_delegate callback, int paramcount, nv2avertex_t &_v1, nv2avertex_t &_v2, nv2avertex_t &_v3); + void clear_render_target(int what, uint32_t value); + void clear_depth_buffer(int what, uint32_t value); + inline uint8_t *direct_access_ptr(offs_t address); TIMER_CALLBACK_MEMBER(puller_timer_work); struct { - UINT32 regs[0x80 / 4]; + uint32_t regs[0x80 / 4]; struct { - UINT32 objhandle; - UINT32 objclass; - UINT32 method[0x2000 / 4]; - // int execute_method(address_space & space, UINT32 method, UINT32 address, int &countlen); // for the future + uint32_t objhandle; + uint32_t objclass; + uint32_t method[0x2000 / 4]; + // int execute_method(address_space & space, uint32_t method, uint32_t address, int &countlen); // for the future } object; } channel[32][8]; - UINT32 pfifo[0x2000 / 4]; - UINT32 pcrtc[0x1000 / 4]; - UINT32 pmc[0x1000 / 4]; - UINT32 pgraph[0x2000 / 4]; - UINT32 ramin[0x100000 / 4]; - UINT32 dma_offset[2]; - UINT32 dma_size[2]; - UINT8 *basemempointer; - UINT8 *topmempointer; + uint32_t pfifo[0x2000 / 4]; + uint32_t pcrtc[0x1000 / 4]; + uint32_t pmc[0x1000 / 4]; + uint32_t pgraph[0x2000 / 4]; + uint32_t ramin[0x100000 / 4]; + uint32_t dma_offset[2]; + uint32_t dma_size[2]; + uint8_t *basemempointer; + uint8_t *topmempointer; pic8259_device *interruptdevice; rectangle clippingwindows[8]; rectangle limits_rendertarget; - UINT32 pitch_rendertarget; - UINT32 pitch_depthbuffer; + uint32_t pitch_rendertarget; + uint32_t pitch_depthbuffer; int log2height_rendertarget; int log2width_rendertarget; int dilate_rendertarget; @@ -529,13 +529,13 @@ public: NV2A_COLOR_FORMAT colorformat_rendertarget; int bytespixel_rendertarget; rectangle clear_rendertarget; - UINT32 antialias_control; + uint32_t antialias_control; float supersample_factor_x; float supersample_factor_y; - UINT32 *rendertarget; - UINT32 *depthbuffer; - UINT32 *displayedtarget; - UINT32 vertexbuffer_address[16]; + uint32_t *rendertarget; + uint32_t *depthbuffer; + uint32_t *displayedtarget; + uint32_t vertexbuffer_address[16]; int vertexbuffer_stride[16]; NV2A_VTXBUF_TYPE vertexbuffer_kind[16]; int vertexbuffer_size[16]; @@ -564,10 +564,10 @@ public: int rectwidth; } texture[4]; NV2A_BEGIN_END primitive_type; - UINT32 primitives_count; + uint32_t primitives_count; int indexesleft_count; int indexesleft_first; - UINT32 indexesleft[1024]; // vertex indices sent by the software to the 3d accelerator + uint32_t indexesleft[1024]; // vertex indices sent by the software to the 3d accelerator int vertex_count; unsigned int vertex_first; int vertex_accumulated; @@ -679,7 +679,7 @@ public: int used; std::mutex lock; } combiner; - UINT32 color_mask; + uint32_t color_mask; bool backface_culling_enabled; NV2A_GL_FRONT_FACE backface_culling_winding; NV2A_GL_CULL_FACE backface_culling_culled; @@ -700,7 +700,7 @@ public: NV2A_BLEND_EQUATION blend_equation; NV2A_BLEND_FACTOR blend_function_source; NV2A_BLEND_FACTOR blend_function_destination; - UINT32 blend_color; + uint32_t blend_color; bool logical_operation_enabled; NV2A_LOGIC_OP logical_operation; struct { @@ -727,8 +727,8 @@ public: emu_timer *puller_timer; int puller_waiting; address_space *puller_space; - UINT32 dilated0[16][2048]; - UINT32 dilated1[16][2048]; + uint32_t dilated0[16][2048]; + uint32_t dilated1[16][2048]; int dilatechose[256]; nvidia_object_data *objectdata; int debug_grab_texttype; diff --git a/src/mame/includes/chqflag.h b/src/mame/includes/chqflag.h index b590740eb4f..e750ec0d29e 100644 --- a/src/mame/includes/chqflag.h +++ b/src/mame/includes/chqflag.h @@ -63,7 +63,7 @@ public: DECLARE_WRITE8_MEMBER(k007232_extvolume_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(volume_callback0); DECLARE_WRITE8_MEMBER(volume_callback1); K051316_CB_MEMBER(zoom_callback_1); diff --git a/src/mame/includes/cidelsa.h b/src/mame/includes/cidelsa.h index a6f77e9eb2d..a881c31ca75 100644 --- a/src/mame/includes/cidelsa.h +++ b/src/mame/includes/cidelsa.h @@ -79,9 +79,9 @@ public: int m_cdp1802_q; int m_cdp1869_pcb; - UINT8 *m_pageram; - std::unique_ptr m_pcbram; - std::unique_ptr m_charram; + uint8_t *m_pageram; + std::unique_ptr m_pcbram; + std::unique_ptr m_charram; protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/cinemat.h b/src/mame/includes/cinemat.h index f6c986aa1f9..fa1e2680c72 100644 --- a/src/mame/includes/cinemat.h +++ b/src/mame/includes/cinemat.h @@ -29,35 +29,35 @@ public: optional_device m_samples; required_device m_vector; required_device m_screen; - optional_shared_ptr m_rambase; + optional_shared_ptr m_rambase; optional_ioport m_analog_x; optional_ioport m_analog_y; - typedef void (cinemat_state::*sound_func)(UINT8 sound_val, UINT8 bits_changed); + typedef void (cinemat_state::*sound_func)(uint8_t sound_val, uint8_t bits_changed); sound_func m_sound_handler; - UINT8 m_sound_control; - UINT32 m_current_shift; - UINT32 m_last_shift; - UINT32 m_last_shift2; - UINT32 m_current_pitch; - UINT32 m_last_frame; - UINT8 m_sound_fifo[16]; - UINT8 m_sound_fifo_in; - UINT8 m_sound_fifo_out; - UINT8 m_last_portb_write; + uint8_t m_sound_control; + uint32_t m_current_shift; + uint32_t m_last_shift; + uint32_t m_last_shift2; + uint32_t m_current_pitch; + uint32_t m_last_frame; + uint8_t m_sound_fifo[16]; + uint8_t m_sound_fifo_in; + uint8_t m_sound_fifo_out; + uint8_t m_last_portb_write; float m_target_volume; float m_current_volume; - UINT8 m_coin_detected; - UINT8 m_coin_last_reset; - UINT8 m_mux_select; + uint8_t m_coin_detected; + uint8_t m_coin_last_reset; + uint8_t m_mux_select; int m_gear; int m_color_mode; rgb_t m_vector_color; - INT16 m_lastx; - INT16 m_lasty; - UINT8 m_last_control; + int16_t m_lastx; + int16_t m_lasty; + uint8_t m_last_control; int m_qb3_lastx; int m_qb3_lasty; DECLARE_READ8_MEMBER(inputs_r); @@ -104,29 +104,29 @@ public: DECLARE_VIDEO_START(cinemat_64level); DECLARE_VIDEO_START(cinemat_color); DECLARE_VIDEO_START(cinemat_qb3color); - UINT32 screen_update_cinemat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spacewar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cinemat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spacewar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(sound_porta_r); DECLARE_READ8_MEMBER(sound_portb_r); DECLARE_WRITE8_MEMBER(sound_portb_w); DECLARE_WRITE8_MEMBER(sound_output_w); TIMER_CALLBACK_MEMBER(synced_sound_w); void generic_init(sound_func sound_handler); - void cinemat_vector_callback(INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift); - void spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed); - void barrier_sound_w(UINT8 sound_val, UINT8 bits_changed); - void speedfrk_sound_w(UINT8 sound_val, UINT8 bits_changed); - void starhawk_sound_w(UINT8 sound_val, UINT8 bits_changed); - void sundance_sound_w(UINT8 sound_val, UINT8 bits_changed); - void tailg_sound_w(UINT8 sound_val, UINT8 bits_changed); - void warrior_sound_w(UINT8 sound_val, UINT8 bits_changed); - void armora_sound_w(UINT8 sound_val, UINT8 bits_changed); - void ripoff_sound_w(UINT8 sound_val, UINT8 bits_changed); - void starcas_sound_w(UINT8 sound_val, UINT8 bits_changed); - void solarq_sound_w(UINT8 sound_val, UINT8 bits_changed); - void boxingb_sound_w(UINT8 sound_val, UINT8 bits_changed); - void wotw_sound_w(UINT8 sound_val, UINT8 bits_changed); - void demon_sound_w(UINT8 sound_val, UINT8 bits_changed); + void cinemat_vector_callback(int16_t sx, int16_t sy, int16_t ex, int16_t ey, uint8_t shift); + void spacewar_sound_w(uint8_t sound_val, uint8_t bits_changed); + void barrier_sound_w(uint8_t sound_val, uint8_t bits_changed); + void speedfrk_sound_w(uint8_t sound_val, uint8_t bits_changed); + void starhawk_sound_w(uint8_t sound_val, uint8_t bits_changed); + void sundance_sound_w(uint8_t sound_val, uint8_t bits_changed); + void tailg_sound_w(uint8_t sound_val, uint8_t bits_changed); + void warrior_sound_w(uint8_t sound_val, uint8_t bits_changed); + void armora_sound_w(uint8_t sound_val, uint8_t bits_changed); + void ripoff_sound_w(uint8_t sound_val, uint8_t bits_changed); + void starcas_sound_w(uint8_t sound_val, uint8_t bits_changed); + void solarq_sound_w(uint8_t sound_val, uint8_t bits_changed); + void boxingb_sound_w(uint8_t sound_val, uint8_t bits_changed); + void wotw_sound_w(uint8_t sound_val, uint8_t bits_changed); + void demon_sound_w(uint8_t sound_val, uint8_t bits_changed); }; /*----------- defined in audio/cinemat.c -----------*/ diff --git a/src/mame/includes/circus.h b/src/mame/includes/circus.h index d02896de619..9473b8ed5de 100644 --- a/src/mame/includes/circus.h +++ b/src/mame/includes/circus.h @@ -15,7 +15,7 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -45,10 +45,10 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_circus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_robotbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_crash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ripcord(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_circus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_robotbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_crash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ripcord(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(crash_scanline); void draw_line( bitmap_ind16 &bitmap, const rectangle &cliprect, int x1, int y1, int x2, int y2, int dotted ); void draw_sprite_collision( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/circusc.h b/src/mame/includes/circusc.h index 86ed08bc4bc..24f4c9bf54b 100644 --- a/src/mame/includes/circusc.h +++ b/src/mame/includes/circusc.h @@ -30,18 +30,18 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spritebank; - required_shared_ptr m_scroll; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram_2; - required_shared_ptr m_spriteram; + required_shared_ptr m_spritebank; + required_shared_ptr m_scroll; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram_2; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; /* sound-related */ - UINT8 m_sn_latch; + uint8_t m_sn_latch; /* devices */ required_device m_audiocpu; @@ -50,7 +50,7 @@ public: required_device m_dac; required_device m_discrete; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_READ8_MEMBER(circusc_sh_timer_r); DECLARE_WRITE8_MEMBER(circusc_sh_irqtrigger_w); DECLARE_WRITE8_MEMBER(circusc_coin_counter_w); @@ -65,7 +65,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(circusc); - UINT32 screen_update_circusc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_circusc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; diff --git a/src/mame/includes/cischeat.h b/src/mame/includes/cischeat.h index 23017d1d2c1..c30abf3864b 100644 --- a/src/mame/includes/cischeat.h +++ b/src/mame/includes/cischeat.h @@ -44,25 +44,25 @@ public: } optional_device_array m_tmap; - required_shared_ptr m_ram; - optional_shared_ptr_array m_roadram; - optional_shared_ptr m_f1gpstr2_ioready; + required_shared_ptr m_ram; + optional_shared_ptr_array m_roadram; + optional_shared_ptr m_f1gpstr2_ioready; - UINT16 *m_objectram; - UINT16 m_active_layers; + uint16_t *m_objectram; + uint16_t m_active_layers; int m_prev; int m_armold; - UINT16 m_scudhamm_motor_command; + uint16_t m_scudhamm_motor_command; int m_ip_select; - UINT16 m_wildplt_output; - UINT8 m_drawmode_table[16]; + uint16_t m_wildplt_output; + uint8_t m_drawmode_table[16]; int m_debugsprites; int m_show_unknown; - UINT16 *m_spriteram; + uint16_t *m_spriteram; - UINT8 m_motor_value; - UINT8 m_io_value; + uint8_t m_motor_value; + uint8_t m_io_value; DECLARE_WRITE16_MEMBER(scudhamm_motor_command_w); DECLARE_WRITE16_MEMBER(scudhamm_leds_w); @@ -104,10 +104,10 @@ public: DECLARE_DRIVER_INIT(bigrun); DECLARE_DRIVER_INIT(f1gpstar); virtual void video_start() override; - UINT32 screen_update_bigrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_scudhamm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cischeat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_f1gpstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bigrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_scudhamm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cischeat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_f1gpstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(bigrun_scanline); TIMER_DEVICE_CALLBACK_MEMBER(scudhamm_scanline); TIMER_DEVICE_CALLBACK_MEMBER(armchamp2_scanline); @@ -137,12 +137,12 @@ public: optional_device m_captflag_motor_left; optional_device m_captflag_motor_right; - UINT16 m_captflag_motor_command[2]; - UINT16 m_captflag_motor_pos[2]; + uint16_t m_captflag_motor_command[2]; + uint16_t m_captflag_motor_pos[2]; DECLARE_WRITE16_MEMBER(captflag_motor_command_right_w); DECLARE_WRITE16_MEMBER(captflag_motor_command_left_w); - void captflag_motor_move(int side, UINT16 data); + void captflag_motor_move(int side, uint16_t data); DECLARE_CUSTOM_INPUT_MEMBER(captflag_motor_busy_r); DECLARE_CUSTOM_INPUT_MEMBER(captflag_motor_pos_r); @@ -150,7 +150,7 @@ public: optional_memory_bank m_oki2_bank; DECLARE_WRITE16_MEMBER(captflag_oki_bank_w); - UINT16 m_captflag_leds; + uint16_t m_captflag_leds; DECLARE_WRITE16_MEMBER(captflag_leds_w); DECLARE_DRIVER_INIT(captflag); diff --git a/src/mame/includes/citycon.h b/src/mame/includes/citycon.h index bda3dd426cc..21085ae44ef 100644 --- a/src/mame/includes/citycon.h +++ b/src/mame/includes/citycon.h @@ -20,10 +20,10 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_linecolor; - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll; + required_shared_ptr m_videoram; + required_shared_ptr m_linecolor; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll; /* video-related */ tilemap_t *m_bg_tilemap; @@ -47,7 +47,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_citycon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_citycon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); inline void changecolor_RRRRGGGGBBBBxxxx( int color, int indx ); }; diff --git a/src/mame/includes/cloak.h b/src/mame/includes/cloak.h index c3f3c127b49..24c68e91257 100644 --- a/src/mame/includes/cloak.h +++ b/src/mame/includes/cloak.h @@ -19,17 +19,17 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; int m_nvram_enabled; - UINT8 m_bitmap_videoram_selected; - UINT8 m_bitmap_videoram_address_x; - UINT8 m_bitmap_videoram_address_y; - std::unique_ptr m_bitmap_videoram1; - std::unique_ptr m_bitmap_videoram2; - UINT8 *m_current_bitmap_videoram_accessed; - UINT8 *m_current_bitmap_videoram_displayed; - std::unique_ptr m_palette_ram; + uint8_t m_bitmap_videoram_selected; + uint8_t m_bitmap_videoram_address_x; + uint8_t m_bitmap_videoram_address_y; + std::unique_ptr m_bitmap_videoram1; + std::unique_ptr m_bitmap_videoram2; + uint8_t *m_current_bitmap_videoram_accessed; + uint8_t *m_current_bitmap_videoram_displayed; + std::unique_ptr m_palette_ram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(cloak_led_w); DECLARE_WRITE8_MEMBER(cloak_coin_counter_w); @@ -47,7 +47,7 @@ public: void adjust_xy(int offset); TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; - UINT32 screen_update_cloak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cloak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void set_pen(int i); void draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/cloud9.h b/src/mame/includes/cloud9.h index b1f4e70f12f..2c9da3929ff 100644 --- a/src/mame/includes/cloud9.h +++ b/src/mame/includes/cloud9.h @@ -26,30 +26,30 @@ public: required_device m_maincpu; required_device m_nvram; /* memory pointers */ - std::unique_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_paletteram; + std::unique_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_paletteram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; /* video-related */ - const UINT8 *m_syncprom; - const UINT8 *m_wpprom; - const UINT8 *m_priprom; + const uint8_t *m_syncprom; + const uint8_t *m_wpprom; + const uint8_t *m_priprom; bitmap_ind16 m_spritebitmap; double m_rweights[3]; double m_gweights[3]; double m_bweights[3]; - UINT8 m_video_control[8]; - UINT8 m_bitmode_addr[2]; + uint8_t m_video_control[8]; + uint8_t m_bitmode_addr[2]; /* misc */ int m_vblank_start; int m_vblank_end; emu_timer *m_irq_timer; - UINT8 m_irq_state; + uint8_t m_irq_state; DECLARE_WRITE8_MEMBER(irq_ack_w); DECLARE_WRITE8_MEMBER(cloud9_led_w); @@ -67,9 +67,9 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cloud9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cloud9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(clock_irq); - inline void cloud9_write_vram( UINT16 addr, UINT8 data, UINT8 bitmd, UINT8 pixba ); + inline void cloud9_write_vram( uint16_t addr, uint8_t data, uint8_t bitmd, uint8_t pixba ); inline void bitmode_autoinc( ); inline void schedule_next_irq(int curscanline); }; diff --git a/src/mame/includes/clshroad.h b/src/mame/includes/clshroad.h index 4f03741f5af..8b9cf1bf9fb 100644 --- a/src/mame/includes/clshroad.h +++ b/src/mame/includes/clshroad.h @@ -17,10 +17,10 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_vregs; + required_shared_ptr m_spriteram; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_vregs; tilemap_t *m_tilemap_0a; tilemap_t *m_tilemap_0b; @@ -44,6 +44,6 @@ public: DECLARE_PALETTE_INIT(firebatl); DECLARE_VIDEO_START(clshroad); DECLARE_PALETTE_INIT(clshroad); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/cninja.h b/src/mame/includes/cninja.h index 5cb058d27f4..0f460d290ac 100644 --- a/src/mame/includes/cninja.h +++ b/src/mame/includes/cninja.h @@ -66,11 +66,11 @@ public: optional_device m_spriteram2; /* memory pointers */ - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; - required_shared_ptr m_pf3_rowscroll; - required_shared_ptr m_pf4_rowscroll; - optional_shared_ptr m_ram; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_pf3_rowscroll; + required_shared_ptr m_pf4_rowscroll; + optional_shared_ptr m_ram; /* misc */ int m_scanline; @@ -91,12 +91,12 @@ public: virtual void machine_reset() override; DECLARE_VIDEO_START(stoneage); DECLARE_VIDEO_START(mutantf); - UINT32 screen_update_cninja(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cninjabl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cninjabl2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_edrandy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_robocop2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mutantf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cninja(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cninjabl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cninjabl2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_edrandy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_robocop2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mutantf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen); void cninjabl_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/coco.h b/src/mame/includes/coco.h index 41a05277905..c42cf56f0ed 100644 --- a/src/mame/includes/coco.h +++ b/src/mame/includes/coco.h @@ -141,7 +141,7 @@ public: DECLARE_WRITE_LINE_MEMBER( cart_w ) { cart_w((bool) state); } // disassembly override - offs_t dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); + offs_t dasm_override(device_t &device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options); protected: // device-level overrides @@ -156,13 +156,13 @@ protected: void recalculate_firq(void); // changed handlers - virtual void pia1_pa_changed(UINT8 data); - virtual void pia1_pb_changed(UINT8 data); + virtual void pia1_pa_changed(uint8_t data); + virtual void pia1_pb_changed(uint8_t data); // miscellaneous - virtual void update_keyboard_input(UINT8 value, UINT8 z); + virtual void update_keyboard_input(uint8_t value, uint8_t z); virtual void cart_w(bool state); - virtual void update_cart_base(UINT8 *cart_base) = 0; + virtual void update_cart_base(uint8_t *cart_base) = 0; private: // timer constants @@ -199,8 +199,8 @@ private: ioport_port *m_input[2][2]; ioport_port *m_buttons; - UINT8 input(int joystick, int axis) const { return m_input[joystick][axis] ? m_input[joystick][axis]->read() : 0x00; } - UINT8 buttons(void) const { return m_buttons ? m_buttons->read() : 0x00; } + uint8_t input(int joystick, int axis) const { return m_input[joystick][axis] ? m_input[joystick][axis]->read() : 0x00; } + uint8_t buttons(void) const { return m_buttons ? m_buttons->read() : 0x00; } }; void analog_port_start(analog_input_t *analog, const char *rx_tag, const char *ry_tag, const char *lx_tag, const char *ly_tag, const char *buttons_tag); @@ -212,7 +212,7 @@ private: soundmux_status_t soundmux_status(void); void update_sound(void); - void poll_joystick(bool *joyin, UINT8 *buttons); + void poll_joystick(bool *joyin, uint8_t *buttons); void poll_keyboard(void); void poll_hires_joystick(void); void update_cassout(int cassout); @@ -220,7 +220,7 @@ private: void diecom_lightgun_clock(void); // thin wrappers for PIA output - UINT8 dac_output(void) { return m_dac_output; } // PA drives the DAC + uint8_t dac_output(void) { return m_dac_output; } // PA drives the DAC bool sel1(void) { return m_pia_0->ca2_output() ? true : false; } bool sel2(void) { return m_pia_0->cb2_output() ? true : false; } bool snden(void) { return m_pia_1->cb2_output() ? true : false; } @@ -229,7 +229,7 @@ private: coco_vhd_image_device *current_vhd(void); // floating bus - UINT8 floating_bus_read(void); + uint8_t floating_bus_read(void); // input ports required_ioport_array<7> m_keyboard; @@ -240,11 +240,11 @@ private: analog_input_t m_diecom_lightgun; // DAC output - UINT8 m_dac_output; + uint8_t m_dac_output; // remember the last audio sample level from the analog sources (DAC, cart, cassette) so that we don't // introduce step changes when the audio output is enabled/disabled via PIA1 CB2 - UINT8 m_analog_audio_level; + uint8_t m_analog_audio_level; // hires interface emu_timer *m_hiresjoy_transition_timer[2]; @@ -253,13 +253,13 @@ private: // diecom lightgun emu_timer *m_diecom_lightgun_timer; bool m_dclg_previous_bit; - UINT8 m_dclg_output_h; - UINT8 m_dclg_output_v; - UINT8 m_dclg_state; - UINT16 m_dclg_timer; + uint8_t m_dclg_output_h; + uint8_t m_dclg_output_v; + uint8_t m_dclg_state; + uint16_t m_dclg_timer; // VHD selection - UINT8 m_vhd_select; + uint8_t m_vhd_select; // safety to prevent stack overflow when reading floating bus bool m_in_floating_bus_read; diff --git a/src/mame/includes/coco12.h b/src/mame/includes/coco12.h index bfc2149e4c2..7481954b608 100644 --- a/src/mame/includes/coco12.h +++ b/src/mame/includes/coco12.h @@ -53,10 +53,10 @@ public: DECLARE_WRITE_LINE_MEMBER( field_sync ); protected: virtual void device_start() override; - virtual void update_cart_base(UINT8 *cart_base) override; + virtual void update_cart_base(uint8_t *cart_base) override; /* PIA1 */ - virtual void pia1_pb_changed(UINT8 data) override; + virtual void pia1_pb_changed(uint8_t data) override; private: diff --git a/src/mame/includes/coco3.h b/src/mame/includes/coco3.h index 6439cefa4ec..af27b4a08e4 100644 --- a/src/mame/includes/coco3.h +++ b/src/mame/includes/coco3.h @@ -50,17 +50,17 @@ public: DECLARE_WRITE_LINE_MEMBER(gime_firq_w) { recalculate_firq(); } DECLARE_WRITE_LINE_MEMBER(gime_irq_w) { recalculate_irq(); } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: - virtual void update_cart_base(UINT8 *cart_base) override; + virtual void update_cart_base(uint8_t *cart_base) override; /* interrupts */ virtual bool firq_get_line(void) override; virtual bool irq_get_line(void) override; /* miscellaneous */ - virtual void update_keyboard_input(UINT8 value, UINT8 z) override; + virtual void update_keyboard_input(uint8_t value, uint8_t z) override; virtual void cart_w(bool line) override; }; diff --git a/src/mame/includes/coleco.h b/src/mame/includes/coleco.h index 2886f18b9a8..65117fc5660 100644 --- a/src/mame/includes/coleco.h +++ b/src/mame/includes/coleco.h @@ -56,13 +56,13 @@ public: DECLARE_WRITE_LINE_MEMBER(coleco_vdp_interrupt); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(czz50_cart); - UINT8 coleco_paddle_read(int port, int joy_mode, UINT8 joy_status); - UINT8 coleco_scan_paddles(UINT8 *joy_status0, UINT8 *joy_status1); + uint8_t coleco_paddle_read(int port, int joy_mode, uint8_t joy_status); + uint8_t coleco_scan_paddles(uint8_t *joy_status0, uint8_t *joy_status1); private: required_device m_maincpu; required_device m_cart; - required_shared_ptr m_ram; + required_shared_ptr m_ram; int m_joy_mode; int m_last_nmi_state; @@ -74,8 +74,8 @@ private: emu_timer *m_joy_d7_timer[2]; int m_joy_irq_state[2]; int m_joy_d7_state[2]; - UINT8 m_joy_analog_state[2]; - UINT8 m_joy_analog_reload[2]; + uint8_t m_joy_analog_state[2]; + uint8_t m_joy_analog_reload[2]; optional_ioport m_ctrlsel; required_ioport m_std_keypad1; diff --git a/src/mame/includes/combatsc.h b/src/mame/includes/combatsc.h index d1f4f7baa6c..9aef51765a0 100644 --- a/src/mame/includes/combatsc.h +++ b/src/mame/includes/combatsc.h @@ -31,26 +31,26 @@ public: } /* memory pointers */ - UINT8 * m_videoram; - UINT8 * m_scrollram; - UINT8 * m_io_ram; - std::unique_ptr m_spriteram[2]; + uint8_t * m_videoram; + uint8_t * m_scrollram; + uint8_t * m_io_ram; + std::unique_ptr m_spriteram[2]; /* video-related */ tilemap_t *m_bg_tilemap[2]; tilemap_t *m_textlayer; - UINT8 m_scrollram0[0x40]; - UINT8 m_scrollram1[0x40]; + uint8_t m_scrollram0[0x40]; + uint8_t m_scrollram1[0x40]; int m_priority; int m_vreg; int m_bank_select; /* 0x00..0x1f */ int m_video_circuit; /* 0 or 1 */ - UINT8 *m_page[2]; + uint8_t *m_page[2]; /* misc */ - UINT8 m_pos[4]; - UINT8 m_sign[4]; + uint8_t m_pos[4]; + uint8_t m_sign[4]; int m_prot[2]; int m_boost; emu_timer *m_interleave_timer; @@ -108,8 +108,8 @@ public: DECLARE_MACHINE_START(combatscb); DECLARE_VIDEO_START(combatscb); DECLARE_PALETTE_INIT(combatscb); - UINT32 screen_update_combatsc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_combatscb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *source, int circuit, bitmap_ind8 &priority_bitmap, UINT32 pri_mask ); - void bootleg_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *source, int circuit ); + uint32_t screen_update_combatsc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_combatscb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const uint8_t *source, int circuit, bitmap_ind8 &priority_bitmap, uint32_t pri_mask ); + void bootleg_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const uint8_t *source, int circuit ); }; diff --git a/src/mame/includes/commando.h b/src/mame/includes/commando.h index 6888a612a0a..95a2e1a009e 100644 --- a/src/mame/includes/commando.h +++ b/src/mame/includes/commando.h @@ -26,16 +26,16 @@ public: /* memory pointers */ required_device m_spriteram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram2; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram2; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_scroll_x[2]; - UINT8 m_scroll_y[2]; + uint8_t m_scroll_x[2]; + uint8_t m_scroll_y[2]; /* devices */ required_device m_audiocpu; @@ -53,11 +53,11 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_commando(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_commando(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(commando_interrupt); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; }; diff --git a/src/mame/includes/compgolf.h b/src/mame/includes/compgolf.h index bf7870e434f..a22e01f05bf 100644 --- a/src/mame/includes/compgolf.h +++ b/src/mame/includes/compgolf.h @@ -19,9 +19,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_bg_ram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_bg_ram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_text_tilemap; @@ -46,7 +46,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(compgolf); - UINT32 screen_update_compgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_compgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void compgolf_expand_bg(); required_device m_maincpu; diff --git a/src/mame/includes/comquest.h b/src/mame/includes/comquest.h index 32b6ef2c935..d6762bb6741 100644 --- a/src/mame/includes/comquest.h +++ b/src/mame/includes/comquest.h @@ -17,7 +17,7 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - UINT8 m_data[128][8]; + uint8_t m_data[128][8]; void *m_timer; int m_line; int m_dma_activ; @@ -25,7 +25,7 @@ public: int m_count; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_comquest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_comquest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; }; diff --git a/src/mame/includes/comx35.h b/src/mame/includes/comx35.h index b1dfa88abbe..3e80113f906 100644 --- a/src/mame/includes/comx35.h +++ b/src/mame/includes/comx35.h @@ -52,7 +52,7 @@ public: required_device m_ram; required_device m_exp; required_memory_region m_rom; - optional_shared_ptr m_char_ram; + optional_shared_ptr m_char_ram; required_ioport m_d6; required_ioport m_modifiers; @@ -83,7 +83,7 @@ public: DECLARE_WRITE_LINE_MEMBER( prd_w ); DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); DECLARE_QUICKLOAD_LOAD_MEMBER( comx35_comx ); - void image_fread_memory(device_image_interface &image, UINT16 addr, UINT32 count); + void image_fread_memory(device_image_interface &image, uint16_t addr, uint32_t count); CDP1869_CHAR_RAM_READ_MEMBER(comx35_charram_r); CDP1869_CHAR_RAM_WRITE_MEMBER(comx35_charram_w); CDP1869_PCB_READ_MEMBER(comx35_pcb_r); diff --git a/src/mame/includes/concept.h b/src/mame/includes/concept.h index d6b0c3cab04..28fe888b02f 100644 --- a/src/mame/includes/concept.h +++ b/src/mame/includes/concept.h @@ -47,17 +47,17 @@ public: required_device m_speaker; required_device m_mm58274; required_device m_a2bus; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; - UINT8 m_pending_interrupts; + uint8_t m_pending_interrupts; bool m_clock_enable; - UINT8 m_clock_address; + uint8_t m_clock_address; DECLARE_READ16_MEMBER(concept_io_r); DECLARE_WRITE16_MEMBER(concept_io_w); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_concept(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_concept(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(via_in_a); DECLARE_WRITE8_MEMBER(via_out_a); diff --git a/src/mame/includes/contra.h b/src/mame/includes/contra.h index 771fed9df0a..569d8ac48a5 100644 --- a/src/mame/includes/contra.h +++ b/src/mame/includes/contra.h @@ -29,15 +29,15 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - std::unique_ptr m_buffered_spriteram; - std::unique_ptr m_buffered_spriteram_2; - required_shared_ptr m_fg_cram; - required_shared_ptr m_fg_vram; - required_shared_ptr m_tx_cram; - required_shared_ptr m_tx_vram; - required_shared_ptr m_spriteram; - required_shared_ptr m_bg_cram; - required_shared_ptr m_bg_vram; + std::unique_ptr m_buffered_spriteram; + std::unique_ptr m_buffered_spriteram_2; + required_shared_ptr m_fg_cram; + required_shared_ptr m_fg_vram; + required_shared_ptr m_tx_cram; + required_shared_ptr m_tx_vram; + required_shared_ptr m_spriteram; + required_shared_ptr m_bg_cram; + required_shared_ptr m_bg_vram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -68,7 +68,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(contra); - UINT32 screen_update_contra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_contra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(contra_interrupt); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int bank ); required_device m_maincpu; diff --git a/src/mame/includes/coolpool.h b/src/mame/includes/coolpool.h index dc377c6c9eb..9b5f14f8545 100644 --- a/src/mame/includes/coolpool.h +++ b/src/mame/includes/coolpool.h @@ -21,28 +21,28 @@ public: required_device m_dsp; optional_device m_tlc34076; - required_shared_ptr m_vram_base; - required_shared_ptr m_nvram; + required_shared_ptr m_vram_base; + required_shared_ptr m_nvram; - UINT8 m_cmd_pending; - UINT16 m_iop_cmd; - UINT16 m_iop_answer; + uint8_t m_cmd_pending; + uint16_t m_iop_cmd; + uint16_t m_iop_answer; int m_iop_romaddr; - UINT8 m_newx[3]; - UINT8 m_newy[3]; - UINT8 m_oldx[3]; - UINT8 m_oldy[3]; + uint8_t m_newx[3]; + uint8_t m_newy[3]; + uint8_t m_oldx[3]; + uint8_t m_oldy[3]; int m_dx[3]; int m_dy[3]; - UINT16 m_result; - UINT16 m_lastresult; + uint16_t m_result; + uint16_t m_lastresult; - UINT16 m_nvram_write_seq[NVRAM_UNLOCK_SEQ_LEN]; - UINT8 m_nvram_write_enable; - UINT8 m_old_cmd; - UINT8 m_same_cmd_count; + uint16_t m_nvram_write_seq[NVRAM_UNLOCK_SEQ_LEN]; + uint8_t m_nvram_write_enable; + uint8_t m_old_cmd; + uint8_t m_same_cmd_count; DECLARE_WRITE16_MEMBER(nvram_thrash_w); DECLARE_WRITE16_MEMBER(nvram_data_w); DECLARE_WRITE16_MEMBER(nvram_thrash_data_w); diff --git a/src/mame/includes/cop01.h b/src/mame/includes/cop01.h index 124fed9005c..02ea5d72a4c 100644 --- a/src/mame/includes/cop01.h +++ b/src/mame/includes/cop01.h @@ -23,14 +23,14 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_bgvideoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_fgvideoram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_vreg[4]; + uint8_t m_vreg[4]; /* sound-related */ int m_pulse; @@ -59,6 +59,6 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(cop01); - UINT32 screen_update_cop01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cop01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/copsnrob.h b/src/mame/includes/copsnrob.h index 3030a7ed13e..3808233cbe4 100644 --- a/src/mame/includes/copsnrob.h +++ b/src/mame/includes/copsnrob.h @@ -27,22 +27,22 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_trucky; - required_shared_ptr m_truckram; - required_shared_ptr m_bulletsram; - required_shared_ptr m_carimage; - required_shared_ptr m_cary; - required_shared_ptr m_videoram; + required_shared_ptr m_trucky; + required_shared_ptr m_truckram; + required_shared_ptr m_bulletsram; + required_shared_ptr m_carimage; + required_shared_ptr m_cary; + required_shared_ptr m_videoram; required_device m_discrete; /* misc */ - UINT8 m_misc; - UINT8 m_ic_h3_data; + uint8_t m_misc; + uint8_t m_ic_h3_data; DECLARE_READ8_MEMBER(copsnrob_misc_r); DECLARE_WRITE8_MEMBER(copsnrob_misc2_w); DECLARE_WRITE8_MEMBER(copsnrob_misc_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_copsnrob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_copsnrob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_screen; diff --git a/src/mame/includes/cosmic.h b/src/mame/includes/cosmic.h index 7a17da42b7d..81b5bd93339 100644 --- a/src/mame/includes/cosmic.h +++ b/src/mame/includes/cosmic.h @@ -30,11 +30,11 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - optional_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + optional_shared_ptr m_spriteram; /* video-related */ - typedef pen_t (cosmic_state::*color_func)(UINT8 x, UINT8 y); + typedef pen_t (cosmic_state::*color_func)(uint8_t x, uint8_t y); color_func m_map_color; int m_color_registers[3]; int m_background_enable; @@ -47,7 +47,7 @@ public: int m_dive_bomb_b_select; /* misc */ - UINT32 m_pixel_clock; + uint32_t m_pixel_clock; int m_ic_state; // for 9980 optional_ioport_array<4> m_in_ports; optional_ioport m_dsw; @@ -90,20 +90,20 @@ public: DECLARE_PALETTE_INIT(cosmica); DECLARE_PALETTE_INIT(magspot); DECLARE_PALETTE_INIT(nomnlnd); - UINT32 screen_update_cosmicg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_panic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cosmica(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_magspot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_devzone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_nomnlnd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cosmicg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_panic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cosmica(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_magspot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_devzone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nomnlnd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(panic_scanline); void draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int color_mask, int extra_sprites); void cosmica_draw_starfield(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void devzone_draw_grid(bitmap_ind16 &bitmap, const rectangle &cliprect); void nomnlnd_draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - pen_t panic_map_color(UINT8 x, UINT8 y); - pen_t cosmica_map_color(UINT8 x, UINT8 y); - pen_t cosmicg_map_color(UINT8 x, UINT8 y); - pen_t magspot_map_color(UINT8 x, UINT8 y); + pen_t panic_map_color(uint8_t x, uint8_t y); + pen_t cosmica_map_color(uint8_t x, uint8_t y); + pen_t cosmicg_map_color(uint8_t x, uint8_t y); + pen_t magspot_map_color(uint8_t x, uint8_t y); }; diff --git a/src/mame/includes/cosmicos.h b/src/mame/includes/cosmicos.h index f6cd99d98f1..6b7a8c5015d 100644 --- a/src/mame/includes/cosmicos.h +++ b/src/mame/includes/cosmicos.h @@ -115,16 +115,16 @@ public: int m_sc1; /* memory state */ - UINT8 m_data; + uint8_t m_data; int m_boot; int m_ram_protect; int m_ram_disable; /* keyboard state */ - UINT8 m_keylatch; + uint8_t m_keylatch; /* display state */ - UINT8 m_segment; + uint8_t m_segment; int m_digit; int m_counter; int m_q; diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h index 3fe1856b4d1..2c6b443f99b 100644 --- a/src/mame/includes/cps1.h +++ b/src/mame/includes/cps1.h @@ -134,30 +134,30 @@ public: /* memory pointers */ // cps1 - optional_shared_ptr m_mainram; - required_shared_ptr m_gfxram; - required_shared_ptr m_cps_a_regs; - required_shared_ptr m_cps_b_regs; - UINT16 * m_scroll1; - UINT16 * m_scroll2; - UINT16 * m_scroll3; - UINT16 * m_obj; - UINT16 * m_other; - std::unique_ptr m_buffered_obj; - optional_shared_ptr m_qsound_sharedram1; - optional_shared_ptr m_qsound_sharedram2; - std::unique_ptr m_decrypt_kabuki; + optional_shared_ptr m_mainram; + required_shared_ptr m_gfxram; + required_shared_ptr m_cps_a_regs; + required_shared_ptr m_cps_b_regs; + uint16_t * m_scroll1; + uint16_t * m_scroll2; + uint16_t * m_scroll3; + uint16_t * m_obj; + uint16_t * m_other; + std::unique_ptr m_buffered_obj; + optional_shared_ptr m_qsound_sharedram1; + optional_shared_ptr m_qsound_sharedram2; + std::unique_ptr m_decrypt_kabuki; // cps2 - optional_shared_ptr m_objram1; - optional_shared_ptr m_objram2; - optional_shared_ptr m_output; + optional_shared_ptr m_objram1; + optional_shared_ptr m_objram2; + optional_shared_ptr m_output; optional_ioport m_io_in0; optional_ioport m_io_in1; - std::unique_ptr m_cps2_buffered_obj; + std::unique_ptr m_cps2_buffered_obj; // game-specific - std::unique_ptr m_gigaman2_dummyqsound_ram; - UINT16 sf2ceblp_prot; + std::unique_ptr m_gigaman2_dummyqsound_ram; + uint16_t sf2ceblp_prot; /* video-related */ tilemap_t *m_bg_tilemap[3]; @@ -211,20 +211,20 @@ public: int m_palette_align; int m_palette_size; int m_stars_rom_size; - UINT8 m_empty_tile[32*32]; + uint8_t m_empty_tile[32*32]; int m_cps_version; /* fcrash video config */ - UINT8 m_layer_enable_reg; - UINT8 m_layer_mask_reg[4]; + uint8_t m_layer_enable_reg; + uint8_t m_layer_mask_reg[4]; int m_layer_scroll1x_offset; int m_layer_scroll2x_offset; int m_layer_scroll3x_offset; int m_sprite_base; int m_sprite_list_end_marker; int m_sprite_x_offset; - std::unique_ptr m_bootleg_sprite_ram; - std::unique_ptr m_bootleg_work_ram; + std::unique_ptr m_bootleg_sprite_ram; + std::unique_ptr m_bootleg_work_ram; /* devices */ required_device m_maincpu; @@ -238,7 +238,7 @@ public: required_device m_palette; optional_device m_soundlatch; optional_device m_soundlatch2; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; optional_memory_region m_region_key; optional_memory_region m_region_stars; @@ -325,14 +325,14 @@ public: DECLARE_MACHINE_RESET(cps); DECLARE_VIDEO_START(cps); DECLARE_MACHINE_START(sf2m1); - UINT32 screen_update_cps1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cps1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_cps1(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(cps1_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(ganbare_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(cps2_interrupt); TIMER_CALLBACK_MEMBER(cps2_update_digital_volume); - void kabuki_setup(void (*decode)(UINT8 *src, UINT8 *dst)); + void kabuki_setup(void (*decode)(uint8_t *src, uint8_t *dst)); /* fcrash handlers */ DECLARE_DRIVER_INIT(kodb); @@ -373,7 +373,7 @@ public: DECLARE_WRITE8_MEMBER(fcrash_msm5205_0_data_w); DECLARE_WRITE8_MEMBER(fcrash_msm5205_1_data_w); DECLARE_WRITE16_MEMBER(varthb_layer_w); - UINT32 screen_update_fcrash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fcrash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void fcrash_update_transmasks(); void fcrash_render_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void fcrash_render_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int primask); @@ -382,13 +382,13 @@ public: /* cps video */ - inline UINT16 *cps1_base( int offset, int boundary ); + inline uint16_t *cps1_base( int offset, int boundary ); void cps1_get_video_base(); - void unshuffle(UINT64 *buf, int len); + void unshuffle(uint64_t *buf, int len); void cps2_gfx_decode(); int gfxrom_bank_mapper(int type, int code); void cps1_update_transmasks(); - void cps1_build_palette(const UINT16* const palette_base); + void cps1_build_palette(const uint16_t* const palette_base); void cps1_find_last_sprite(); void cps1_render_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void cps2_find_last_sprite(); @@ -398,7 +398,7 @@ public: void cps1_render_high_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer); void cps2_set_sprite_priorities(); void cps2_objram_latch(); - UINT16 *cps2_objbase(); + uint16_t *cps2_objbase(); /* cps2 driver */ diff --git a/src/mame/includes/cps3.h b/src/mame/includes/cps3.h index 2319f023245..7c2ead7ca3d 100644 --- a/src/mame/includes/cps3.h +++ b/src/mame/includes/cps3.h @@ -41,53 +41,53 @@ public: required_device m_palette; required_device m_cps3sound; - required_shared_ptr m_mainram; - required_shared_ptr m_spriteram; - required_shared_ptr m_colourram; - required_shared_ptr m_tilemap20_regs_base; - required_shared_ptr m_tilemap30_regs_base; - required_shared_ptr m_tilemap40_regs_base; - required_shared_ptr m_tilemap50_regs_base; - required_shared_ptr m_fullscreenzoom; - required_shared_ptr m_0xc0000000_ram; - required_shared_ptr m_decrypted_gamerom; - required_shared_ptr m_0xc0000000_ram_decrypted; + required_shared_ptr m_mainram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colourram; + required_shared_ptr m_tilemap20_regs_base; + required_shared_ptr m_tilemap30_regs_base; + required_shared_ptr m_tilemap40_regs_base; + required_shared_ptr m_tilemap50_regs_base; + required_shared_ptr m_fullscreenzoom; + required_shared_ptr m_0xc0000000_ram; + required_shared_ptr m_decrypted_gamerom; + required_shared_ptr m_0xc0000000_ram_decrypted; optional_memory_region m_user4_region; optional_memory_region m_user5_region; fujitsu_29f016a_device *m_simm[7][8]; - UINT32 m_cram_gfxflash_bank; - std::unique_ptr m_char_ram; - std::unique_ptr m_eeprom; - UINT32 m_ss_pal_base; - UINT32 m_unk_vidregs[0x20/4]; - UINT32 m_ss_bank_base; - UINT32 m_screenwidth; - std::unique_ptr m_mame_colours; + uint32_t m_cram_gfxflash_bank; + std::unique_ptr m_char_ram; + std::unique_ptr m_eeprom; + uint32_t m_ss_pal_base; + uint32_t m_unk_vidregs[0x20/4]; + uint32_t m_ss_bank_base; + uint32_t m_screenwidth; + std::unique_ptr m_mame_colours; bitmap_rgb32 m_renderbuffer_bitmap; rectangle m_renderbuffer_clip; - UINT8* m_user4; - UINT32 m_key1; - UINT32 m_key2; + uint8_t* m_user4; + uint32_t m_key1; + uint32_t m_key2; int m_altEncryption; - std::unique_ptr m_ss_ram; - UINT32 m_cram_bank; - UINT16 m_current_eeprom_read; - UINT32 m_paldma_source; - UINT32 m_paldma_realsource; - UINT32 m_paldma_dest; - UINT32 m_paldma_fade; - UINT32 m_paldma_other2; - UINT32 m_paldma_length; - UINT32 m_chardma_source; - UINT32 m_chardma_other; - UINT32 m_current_table_address; + std::unique_ptr m_ss_ram; + uint32_t m_cram_bank; + uint16_t m_current_eeprom_read; + uint32_t m_paldma_source; + uint32_t m_paldma_realsource; + uint32_t m_paldma_dest; + uint32_t m_paldma_fade; + uint32_t m_paldma_other2; + uint32_t m_paldma_length; + uint32_t m_chardma_source; + uint32_t m_chardma_other; + uint32_t m_current_table_address; int m_rle_length; int m_last_normal_byte; unsigned short m_lastb; unsigned short m_lastb2; - UINT8* m_user5; + uint8_t* m_user5; DECLARE_READ32_MEMBER(cps3_ssram_r); DECLARE_WRITE32_MEMBER(cps3_ssram_w); @@ -127,27 +127,27 @@ public: SH2_DMA_KLUDGE_CB(dma_callback); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(cps3_vbl_interrupt); INTERRUPT_GEN_MEMBER(cps3_other_interrupt); - UINT16 rotate_left(UINT16 value, int n); - UINT16 rotxor(UINT16 val, UINT16 xorval); - UINT32 cps3_mask(UINT32 address, UINT32 key1, UINT32 key2); + uint16_t rotate_left(uint16_t value, int n); + uint16_t rotxor(uint16_t val, uint16_t xorval); + uint32_t cps3_mask(uint32_t address, uint32_t key1, uint32_t key2); void cps3_decrypt_bios(); void init_common(void); - void init_crypt(UINT32 key1, UINT32 key2, int altEncryption); - void cps3_set_mame_colours(int colournum, UINT16 data, UINT32 fadeval); + void init_crypt(uint32_t key1, uint32_t key2, int altEncryption); + void cps3_set_mame_colours(int colournum, uint16_t data, uint32_t fadeval); void cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_rgb32 &bitmap, const rectangle &cliprect ); - UINT32 cps3_flashmain_r(address_space &space, int which, UINT32 offset, UINT32 mem_mask); - void cps3_flashmain_w(int which, UINT32 offset, UINT32 data, UINT32 mem_mask); - UINT32 process_byte( UINT8 real_byte, UINT32 destination, int max_length ); - void cps3_do_char_dma( UINT32 real_source, UINT32 real_destination, UINT32 real_length ); - UINT32 ProcessByte8(UINT8 b,UINT32 dst_offset); - void cps3_do_alt_char_dma( UINT32 src, UINT32 real_dest, UINT32 real_length ); - void cps3_process_character_dma(UINT32 address); + uint32_t cps3_flashmain_r(address_space &space, int which, uint32_t offset, uint32_t mem_mask); + void cps3_flashmain_w(int which, uint32_t offset, uint32_t data, uint32_t mem_mask); + uint32_t process_byte( uint8_t real_byte, uint32_t destination, int max_length ); + void cps3_do_char_dma( uint32_t real_source, uint32_t real_destination, uint32_t real_length ); + uint32_t ProcessByte8(uint8_t b,uint32_t dst_offset); + void cps3_do_alt_char_dma( uint32_t src, uint32_t real_dest, uint32_t real_length ); + void cps3_process_character_dma(uint32_t address); void copy_from_nvram(); inline void cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx, unsigned int code, unsigned int color, int flipx, int flipy, int sx, int sy, int transparency, int transparent_color, - int scalex, int scaley, bitmap_ind8 *pri_buffer, UINT32 pri_mask); + int scalex, int scaley, bitmap_ind8 *pri_buffer, uint32_t pri_mask); }; diff --git a/src/mame/includes/crbaloon.h b/src/mame/includes/crbaloon.h index a1cb75fe79a..d7cca7f735d 100644 --- a/src/mame/includes/crbaloon.h +++ b/src/mame/includes/crbaloon.h @@ -26,19 +26,19 @@ public: m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - required_shared_ptr m_pc3092_data; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_pc3092_data; required_device m_maincpu; required_device m_sn; required_device m_discrete; required_device m_gfxdecode; - UINT16 m_collision_address; - UINT8 m_collision_address_clear; + uint16_t m_collision_address; + uint8_t m_collision_address_clear; tilemap_t *m_bg_tilemap; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(pc3092_w); DECLARE_READ8_MEMBER(pc3259_r); DECLARE_WRITE8_MEMBER(port_sound_w); @@ -49,12 +49,12 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(crbaloon); - UINT32 screen_update_crbaloon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_crbaloon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); DECLARE_WRITE8_MEMBER(crbaloon_audio_set_music_freq); DECLARE_WRITE8_MEMBER(crbaloon_audio_set_music_enable); DECLARE_WRITE8_MEMBER(crbaloon_audio_set_laugh_enable); - UINT16 crbaloon_get_collision_address(); + uint16_t crbaloon_get_collision_address(); void crbaloon_set_clear_collision_address(int _crbaloon_collision_address_clear); void draw_sprite_and_check_collision(bitmap_ind16 &bitmap); void pc3092_reset(void); diff --git a/src/mame/includes/crgolf.h b/src/mame/includes/crgolf.h index f7d207c8fa2..cce3ea2f904 100644 --- a/src/mame/includes/crgolf.h +++ b/src/mame/includes/crgolf.h @@ -33,20 +33,20 @@ public: /* memory pointers */ - required_shared_ptr m_videoram_a; - required_shared_ptr m_videoram_b; + required_shared_ptr m_videoram_a; + required_shared_ptr m_videoram_b; - required_shared_ptr m_color_select; - required_shared_ptr m_screen_flip; - required_shared_ptr m_screenb_enable; - required_shared_ptr m_screena_enable; + required_shared_ptr m_color_select; + required_shared_ptr m_screen_flip; + required_shared_ptr m_screenb_enable; + required_shared_ptr m_screena_enable; /* misc */ - UINT8 m_port_select; - UINT8 m_main_to_sound_data; - UINT8 m_sound_to_main_data; - UINT16 m_sample_offset; - UINT8 m_sample_count; + uint8_t m_port_select; + uint8_t m_main_to_sound_data; + uint8_t m_sound_to_main_data; + uint16_t m_sample_offset; + uint8_t m_sample_count; /* devices */ required_device m_vrambank; @@ -74,7 +74,7 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(crgolf); DECLARE_PALETTE_INIT(mastrglf); - UINT32 screen_update_crgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_crgolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(main_to_sound_callback); TIMER_CALLBACK_MEMBER(sound_to_main_callback); void get_pens( pen_t *pens ); diff --git a/src/mame/includes/crimfght.h b/src/mame/includes/crimfght.h index c7d9b31a05b..02092d57f6d 100644 --- a/src/mame/includes/crimfght.h +++ b/src/mame/includes/crimfght.h @@ -45,7 +45,7 @@ public: IRQ_CALLBACK_MEMBER(audiocpu_irq_ack); DECLARE_WRITE8_MEMBER(ym2151_ct_w); virtual void machine_start() override; - UINT32 screen_update_crimfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_crimfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(volume_callback); K052109_CB_MEMBER(tile_callback); K051960_CB_MEMBER(sprite_callback); diff --git a/src/mame/includes/crospang.h b/src/mame/includes/crospang.h index 4a5058731e4..2a7b80e0059 100644 --- a/src/mame/includes/crospang.h +++ b/src/mame/includes/crospang.h @@ -23,9 +23,9 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_layer; @@ -56,6 +56,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_crospang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_crospang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void tumblepb_gfx1_rearrange(); }; diff --git a/src/mame/includes/crshrace.h b/src/mame/includes/crshrace.h index f8a2a58e0f6..36ef377e777 100644 --- a/src/mame/includes/crshrace.h +++ b/src/mame/includes/crshrace.h @@ -26,8 +26,8 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; + required_shared_ptr m_videoram1; + required_shared_ptr m_videoram2; required_memory_bank m_z80bank; @@ -47,7 +47,7 @@ public: int m_roz_bank; int m_gfxctrl; int m_flipscreen; - UINT32 crshrace_tile_callback( UINT32 code ); + uint32_t crshrace_tile_callback( uint32_t code ); /* misc */ int m_pending_command; @@ -68,7 +68,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_crshrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_crshrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_crshrace(screen_device &screen, bool state); void draw_bg( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/crvision.h b/src/mame/includes/crvision.h index 1ee6fbabab6..342ef6d34e5 100644 --- a/src/mame/includes/crvision.h +++ b/src/mame/includes/crvision.h @@ -58,8 +58,8 @@ public: optional_ioport_array<8> m_inp_pa2; optional_ioport_array<8> m_inp_pa3; - UINT8 m_keylatch; - UINT8 read_keyboard(int pa); + uint8_t m_keylatch; + uint8_t read_keyboard(int pa); DECLARE_WRITE8_MEMBER( pia_pa_w ); DECLARE_READ8_MEMBER( pia_pa_r ); @@ -92,7 +92,7 @@ public: required_ioport_array<8> m_inp_y; required_ioport_array<4> m_inp_joy; - UINT8 m_joylatch; + uint8_t m_joylatch; int m_centronics_busy; int m_psg_ready; diff --git a/src/mame/includes/cvs.h b/src/mame/includes/cvs.h index 7b22a12c1e6..556687d746a 100644 --- a/src/mame/includes/cvs.h +++ b/src/mame/includes/cvs.h @@ -46,11 +46,11 @@ public: } /* memory pointers */ - required_shared_ptr m_video_ram; - required_shared_ptr m_bullet_ram; - optional_shared_ptr m_cvs_4_bit_dac_data; - optional_shared_ptr m_tms5110_ctl_data; - optional_shared_ptr m_dac3_state; + required_shared_ptr m_video_ram; + required_shared_ptr m_bullet_ram; + optional_shared_ptr m_cvs_4_bit_dac_data; + optional_shared_ptr m_tms5110_ctl_data; + optional_shared_ptr m_dac3_state; /* video-related */ struct cvs_star m_stars[CVS_MAX_STARS]; @@ -60,17 +60,17 @@ public: int m_collision_register; int m_total_stars; int m_stars_on; - UINT8 m_scroll_reg; + uint8_t m_scroll_reg; int m_stars_scroll; /* misc */ int m_s2650_flag; emu_timer *m_cvs_393hz_timer; - UINT8 m_cvs_393hz_clock; + uint8_t m_cvs_393hz_clock; - UINT8 m_character_banking_mode; - UINT16 m_character_ram_page_start; - UINT16 m_speech_rom_bit_address; + uint8_t m_character_banking_mode; + uint16_t m_character_ram_page_start; + uint16_t m_speech_rom_bit_address; /* devices */ required_device m_maincpu; @@ -87,9 +87,9 @@ public: optional_device m_soundlatch; /* memory */ - UINT8 m_color_ram[0x400]; - UINT8 m_palette_ram[0x10]; - UINT8 m_character_ram[3 * 0x800]; /* only half is used, but + uint8_t m_color_ram[0x400]; + uint8_t m_palette_ram[0x10]; + uint8_t m_character_ram[3 * 0x800]; /* only half is used, but by allocating twice the amount, we can use the same gfx_layout */ DECLARE_READ_LINE_MEMBER(speech_rom_read_bit); @@ -128,7 +128,7 @@ public: DECLARE_MACHINE_RESET(cvs); DECLARE_VIDEO_START(cvs); DECLARE_PALETTE_INIT(cvs); - UINT32 screen_update_cvs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cvs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(cvs_main_cpu_interrupt); TIMER_CALLBACK_MEMBER(cvs_393hz_timer_cb); void set_pens( ); diff --git a/src/mame/includes/cxhumax.h b/src/mame/includes/cxhumax.h index dfa85b1720f..40a5121d0b3 100644 --- a/src/mame/includes/cxhumax.h +++ b/src/mame/includes/cxhumax.h @@ -13,17 +13,17 @@ struct cx_timer_t { - UINT32 value; - UINT32 limit; - UINT32 mode; - UINT32 timebase; + uint32_t value; + uint32_t limit; + uint32_t mode; + uint32_t timebase; emu_timer *timer; }; struct cx_timer_regs_t { cx_timer_t timer[MAX_CX_TIMERS]; - UINT32 timer_irq; + uint32_t timer_irq; }; #define TERMINAL_TAG "terminal" @@ -43,7 +43,7 @@ public: required_device m_maincpu; required_device m_flash; - required_shared_ptr m_ram; + required_shared_ptr m_ram; required_device m_terminal; DECLARE_WRITE32_MEMBER ( flash_w ); @@ -118,52 +118,52 @@ public: DECLARE_READ32_MEMBER ( dummy_flash_r ); - UINT32 m_romdescr_reg; - UINT32 m_isaromdescr_regs[0x0C/4]; - UINT32 m_isadescr_regs[0x10/4]; - UINT32 m_rommode_reg; - UINT32 m_xoemask_reg; - UINT32 m_pci_regs[0x08/4]; - UINT32 m_extdesc_regs[0x80/4]; + uint32_t m_romdescr_reg; + uint32_t m_isaromdescr_regs[0x0C/4]; + uint32_t m_isadescr_regs[0x10/4]; + uint32_t m_rommode_reg; + uint32_t m_xoemask_reg; + uint32_t m_pci_regs[0x08/4]; + uint32_t m_extdesc_regs[0x80/4]; - UINT32 m_scratch_reg; + uint32_t m_scratch_reg; cx_timer_regs_t m_timer_regs; - UINT32 m_uart2_regs[0x30/4]; + uint32_t m_uart2_regs[0x30/4]; - UINT32 m_pll_regs[0x14/4]; - UINT32 m_clkdiv_regs[0x18/4]; - UINT32 m_pllprescale_reg; + uint32_t m_pll_regs[0x14/4]; + uint32_t m_clkdiv_regs[0x18/4]; + uint32_t m_pllprescale_reg; - UINT32 m_intctrl_regs[0x38/4]; + uint32_t m_intctrl_regs[0x38/4]; - UINT32 m_ss_regs[0x18/4]; - UINT8 m_ss_tx_fifo[8]; // 8 entries (size hardcoded to 8 bits per entry - TODO) + uint32_t m_ss_regs[0x18/4]; + uint8_t m_ss_tx_fifo[8]; // 8 entries (size hardcoded to 8 bits per entry - TODO) - UINT32 m_i2c0_regs[0x20/4]; - UINT32 m_i2c1_regs[0x20/4]; + uint32_t m_i2c0_regs[0x20/4]; + uint32_t m_i2c1_regs[0x20/4]; required_device m_i2cmem; - UINT32 m_i2c2_regs[0x20/4]; + uint32_t m_i2c2_regs[0x20/4]; void i2cmem_start(); void i2cmem_stop(); - UINT8 i2cmem_read_byte(int last); - void i2cmem_write_byte(UINT8 data); + uint8_t i2cmem_read_byte(int last); + void i2cmem_write_byte(uint8_t data); - UINT32 m_mccfg_regs[0x0C/4]; + uint32_t m_mccfg_regs[0x0C/4]; - UINT32 m_chipcontrol_regs[0x74/4]; + uint32_t m_chipcontrol_regs[0x74/4]; - UINT32 m_drm0_regs[0xfc/4]; - UINT32 m_drm1_regs[0xfc/4]; + uint32_t m_drm0_regs[0xfc/4]; + uint32_t m_drm1_regs[0xfc/4]; - UINT32 m_hdmi_regs[0x400/4]; + uint32_t m_hdmi_regs[0x400/4]; - UINT32 m_gxa_cmd_regs[0x130/4]; + uint32_t m_gxa_cmd_regs[0x130/4]; virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_cxhumax(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cxhumax(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(timer_tick); }; diff --git a/src/mame/includes/cyberbal.h b/src/mame/includes/cyberbal.h index ff2ed22e5c1..397b31f0e35 100644 --- a/src/mame/includes/cyberbal.h +++ b/src/mame/includes/cyberbal.h @@ -52,17 +52,17 @@ public: optional_device m_lscreen; optional_device m_rscreen; - UINT16 m_current_slip[2]; - UINT8 m_playfield_palette_bank[2]; - UINT16 m_playfield_xscroll[2]; - UINT16 m_playfield_yscroll[2]; + uint16_t m_current_slip[2]; + uint8_t m_playfield_palette_bank[2]; + uint16_t m_playfield_xscroll[2]; + uint16_t m_playfield_yscroll[2]; - UINT8 m_fast_68k_int; - UINT8 m_io_68k_int; - UINT8 m_sound_data_from_68k; - UINT8 m_sound_data_from_6502; - UINT8 m_sound_data_from_68k_ready; - UINT8 m_sound_data_from_6502_ready; + uint8_t m_fast_68k_int; + uint8_t m_io_68k_int; + uint8_t m_sound_data_from_68k; + uint8_t m_sound_data_from_6502; + uint8_t m_sound_data_from_68k_ready; + uint8_t m_sound_data_from_6502_ready; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_READ16_MEMBER(sound_state_r); @@ -85,9 +85,9 @@ public: DECLARE_VIDEO_START(cyberbal); DECLARE_MACHINE_RESET(cyberbal2p); DECLARE_VIDEO_START(cyberbal2p); - UINT32 screen_update_cyberbal_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cyberbal_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cyberbal2p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cyberbal_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cyberbal_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cyberbal2p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sound_68k_irq_gen); static const atari_motion_objects_config s_mob_config; @@ -95,6 +95,6 @@ public: private: void video_start_common(int screens); void cyberbal_sound_reset(); - UINT32 update_one_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int index); + uint32_t update_one_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int index); void update_sound_68k_interrupts(); }; diff --git a/src/mame/includes/dai.h b/src/mame/includes/dai.h index dd05267a394..7b54b084902 100644 --- a/src/mame/includes/dai.h +++ b/src/mame/includes/dai.h @@ -46,10 +46,10 @@ public: required_device m_ram; required_device m_palette; - UINT8 m_paddle_select; - UINT8 m_paddle_enable; - UINT8 m_cassette_motor[2]; - UINT8 m_keyboard_scan_mask; + uint8_t m_paddle_select; + uint8_t m_paddle_enable; + uint8_t m_cassette_motor[2]; + uint8_t m_keyboard_scan_mask; unsigned short m_4_colours_palette[4]; DECLARE_WRITE8_MEMBER(dai_stack_interrupt_circuit_w); DECLARE_READ8_MEMBER(dai_io_discrete_devices_r); @@ -64,7 +64,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(dai); - UINT32 screen_update_dai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void dai_update_memory(int dai_rom_bank); IRQ_CALLBACK_MEMBER(int_ack); diff --git a/src/mame/includes/darius.h b/src/mame/includes/darius.h index 9283d55ca5f..0fe09acb4d7 100644 --- a/src/mame/includes/darius.h +++ b/src/mame/includes/darius.h @@ -50,20 +50,20 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_fg_ram; + required_shared_ptr m_spriteram; + required_shared_ptr m_fg_ram; /* video-related */ tilemap_t *m_fg_tilemap; /* misc */ - UINT16 m_cpua_ctrl; - UINT16 m_coin_word; - UINT8 m_adpcm_command; - UINT8 m_nmi_enable; - UINT32 m_def_vol[0x10]; - UINT8 m_vol[DARIUS_VOL_MAX]; - UINT8 m_pan[DARIUS_PAN_MAX]; + uint16_t m_cpua_ctrl; + uint16_t m_coin_word; + uint8_t m_adpcm_command; + uint8_t m_nmi_enable; + uint32_t m_def_vol[0x10]; + uint8_t m_vol[DARIUS_VOL_MAX]; + uint8_t m_pan[DARIUS_PAN_MAX]; /* devices */ required_device m_maincpu; @@ -120,12 +120,12 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_darius_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_darius_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_darius_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_darius_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_darius_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_darius_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void darius_postload(); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int primask, int x_offs, int y_offs ); - UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs); + uint32_t update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs); void parse_control( ) /* assumes Z80 sandwiched between 68Ks */; void update_fm0( ); void update_fm1( ); diff --git a/src/mame/includes/darkmist.h b/src/mame/includes/darkmist.h index c3804c97a26..874fa2e227c 100644 --- a/src/mame/includes/darkmist.h +++ b/src/mame/includes/darkmist.h @@ -23,12 +23,12 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spritebank; - required_shared_ptr m_scroll; - required_shared_ptr m_videoram; - required_shared_ptr m_workram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_spritebank; + required_shared_ptr m_scroll; + required_shared_ptr m_videoram; + required_shared_ptr m_workram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_decrypted_opcodes; int m_hw; tilemap_t *m_bgtilemap; @@ -46,8 +46,8 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(darkmist); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void decrypt_fgbgtiles(UINT8* rgn, int size); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void decrypt_fgbgtiles(uint8_t* rgn, int size); void decrypt_gfx(); void decrypt_snd(); diff --git a/src/mame/includes/darkseal.h b/src/mame/includes/darkseal.h index b3fe8d0dce8..a3115354669 100644 --- a/src/mame/includes/darkseal.h +++ b/src/mame/includes/darkseal.h @@ -34,13 +34,13 @@ public: required_device m_spriteram; required_device m_soundlatch; - required_shared_ptr m_ram; - required_shared_ptr m_pf1_rowscroll; - //UINT16 *m_pf2_rowscroll; - required_shared_ptr m_pf3_rowscroll; - //UINT16 *m_pf4_rowscroll; - required_shared_ptr m_generic_paletteram_16; - required_shared_ptr m_generic_paletteram2_16; + required_shared_ptr m_ram; + required_shared_ptr m_pf1_rowscroll; + //uint16_t *m_pf2_rowscroll; + required_shared_ptr m_pf3_rowscroll; + //uint16_t *m_pf4_rowscroll; + required_shared_ptr m_generic_paletteram_16; + required_shared_ptr m_generic_paletteram2_16; DECLARE_WRITE16_MEMBER(control_w); DECLARE_READ16_MEMBER(control_r); @@ -50,6 +50,6 @@ public: DECLARE_DRIVER_INIT(darkseal); virtual void video_start() override; - 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); void update_24bitcol(int offset); }; diff --git a/src/mame/includes/dassault.h b/src/mame/includes/dassault.h index aa8d5a5f4b8..3b2be883b28 100644 --- a/src/mame/includes/dassault.h +++ b/src/mame/includes/dassault.h @@ -55,11 +55,11 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_pf2_rowscroll; - required_shared_ptr m_pf4_rowscroll; - required_shared_ptr m_ram; - required_shared_ptr m_shared_ram; - required_shared_ptr m_ram2; + required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_pf4_rowscroll; + required_shared_ptr m_ram; + required_shared_ptr m_shared_ram; + required_shared_ptr m_ram2; DECLARE_READ16_MEMBER(dassault_control_r); DECLARE_WRITE16_MEMBER(dassault_control_w); @@ -73,7 +73,7 @@ public: DECLARE_DRIVER_INIT(thndzone); DECLARE_DRIVER_INIT(dassault); virtual void video_start() override; - UINT32 screen_update_dassault(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void mixdassaultlayer(bitmap_rgb32 &bitmap, bitmap_ind16* sprite_bitmap, const rectangle &cliprect, UINT16 pri, UINT16 primask, UINT16 penbase, UINT8 alpha); + uint32_t screen_update_dassault(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void mixdassaultlayer(bitmap_rgb32 &bitmap, bitmap_ind16* sprite_bitmap, const rectangle &cliprect, uint16_t pri, uint16_t primask, uint16_t penbase, uint8_t alpha); DECO16IC_BANK_CB_MEMBER(bank_callback); }; diff --git a/src/mame/includes/dbz.h b/src/mame/includes/dbz.h index e2feddb4275..cdb61cc0cad 100644 --- a/src/mame/includes/dbz.h +++ b/src/mame/includes/dbz.h @@ -33,8 +33,8 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_bg1_videoram; - required_shared_ptr m_bg2_videoram; + required_shared_ptr m_bg1_videoram; + required_shared_ptr m_bg2_videoram; /* video-related */ tilemap_t *m_bg1_tilemap; @@ -72,7 +72,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(dbz_scanline); K056832_CB_MEMBER(tile_callback); K053246_CB_MEMBER(sprite_callback); diff --git a/src/mame/includes/dc.h b/src/mame/includes/dc.h index ba48652fc88..0d4f86e300a 100644 --- a/src/mame/includes/dc.h +++ b/src/mame/includes/dc.h @@ -30,27 +30,27 @@ class dc_state : public driver_device m_naomig1(*this, "rom_board"), m_aica(*this, "aica") { } - required_shared_ptr dc_framebuffer_ram; // '32-bit access area' - required_shared_ptr dc_texture_ram; // '64-bit access area' + required_shared_ptr dc_framebuffer_ram; // '32-bit access area' + required_shared_ptr dc_texture_ram; // '64-bit access area' - required_shared_ptr dc_sound_ram; - required_shared_ptr dc_ram; + required_shared_ptr dc_sound_ram; + required_shared_ptr dc_ram; /* machine related */ - UINT32 dc_sysctrl_regs[0x200/4]; - UINT32 g1bus_regs[0x100/4]; // DC-only - UINT32 g2bus_regs[0x100/4]; - UINT8 m_armrst; + uint32_t dc_sysctrl_regs[0x200/4]; + uint32_t g1bus_regs[0x100/4]; // DC-only + uint32_t g2bus_regs[0x100/4]; + uint8_t m_armrst; struct { - UINT32 g2_addr; - UINT32 root_addr; - UINT32 size; - UINT8 dir; - UINT8 flag; - UINT8 indirect; - UINT8 start; - UINT8 sel; + uint32_t g2_addr; + uint32_t root_addr; + uint32_t size; + uint8_t dir; + uint8_t flag; + uint8_t indirect; + uint8_t start; + uint8_t sel; }m_g2_dma[4]; virtual void machine_start() override; @@ -62,11 +62,11 @@ class dc_state : public driver_device DECLARE_READ32_MEMBER(dc_arm_aica_r); DECLARE_WRITE32_MEMBER(dc_arm_aica_w); void g2_dma_execute(address_space &space, int channel); - inline int decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift); - inline int decode_reg3216_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift); + inline int decode_reg32_64(uint32_t offset, uint64_t mem_mask, uint64_t *shift); + inline int decode_reg3216_64(uint32_t offset, uint64_t mem_mask, uint64_t *shift); int dc_compute_interrupt_level(); void dc_update_interrupt_status(); - inline int decode_reg_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift); + inline int decode_reg_64(uint32_t offset, uint64_t mem_mask, uint64_t *shift); DECLARE_READ64_MEMBER( dc_sysctrl_r ); DECLARE_WRITE64_MEMBER( dc_sysctrl_w ); DECLARE_READ64_MEMBER( dc_gdrom_r ); @@ -85,7 +85,7 @@ class dc_state : public driver_device optional_device m_naomig1; required_device m_aica; - void generic_dma(UINT32 main_adr, void *dma_ptr, UINT32 length, UINT32 size, bool to_mainram); + void generic_dma(uint32_t main_adr, void *dma_ptr, uint32_t length, uint32_t size, bool to_mainram); TIMER_DEVICE_CALLBACK_MEMBER(dc_scanline); }; diff --git a/src/mame/includes/dccons.h b/src/mame/includes/dccons.h index 47b47d72f6c..8c7d3ba7bb6 100644 --- a/src/mame/includes/dccons.h +++ b/src/mame/includes/dccons.h @@ -42,7 +42,7 @@ public: // DECLARE_WRITE8_MEMBER( dc_flash_w ); private: - UINT64 PDTRA, PCTRA; + uint64_t PDTRA, PCTRA; emu_timer *atapi_timer; int atapi_xferlen, atapi_xferbase; }; diff --git a/src/mame/includes/dcheese.h b/src/mame/includes/dcheese.h index 981adefe6d6..396cd2fc0db 100644 --- a/src/mame/includes/dcheese.h +++ b/src/mame/includes/dcheese.h @@ -28,19 +28,19 @@ public: m_soundlatch(*this, "soundlatch") { } /* video-related */ - UINT16 m_blitter_color[2]; - UINT16 m_blitter_xparam[16]; - UINT16 m_blitter_yparam[16]; - UINT16 m_blitter_vidparam[32]; + uint16_t m_blitter_color[2]; + uint16_t m_blitter_xparam[16]; + uint16_t m_blitter_yparam[16]; + uint16_t m_blitter_vidparam[32]; std::unique_ptr m_dstbitmap; emu_timer *m_blitter_timer; /* misc */ - UINT8 m_irq_state[5]; - UINT8 m_soundlatch_full; - UINT8 m_sound_control; - UINT8 m_sound_msb_latch; + uint8_t m_irq_state[5]; + uint8_t m_soundlatch_full; + uint8_t m_sound_control; + uint8_t m_sound_msb_latch; /* devices */ required_device m_maincpu; @@ -65,7 +65,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(dcheese); - UINT32 screen_update_dcheese(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dcheese(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(dcheese_vblank); void dcheese_signal_irq(int which); void update_irq_state(); diff --git a/src/mame/includes/dcon.h b/src/mame/includes/dcon.h index ffff5c97c3e..6243dfccc9a 100644 --- a/src/mame/includes/dcon.h +++ b/src/mame/includes/dcon.h @@ -18,11 +18,11 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_back_data; - required_shared_ptr m_fore_data; - required_shared_ptr m_mid_data; - required_shared_ptr m_textram; - required_shared_ptr m_spriteram; + required_shared_ptr m_back_data; + required_shared_ptr m_fore_data; + required_shared_ptr m_mid_data; + required_shared_ptr m_textram; + required_shared_ptr m_spriteram; tilemap_t *m_background_layer; tilemap_t *m_foreground_layer; @@ -31,8 +31,8 @@ public: int m_gfx_bank_select; int m_last_gfx_bank; - UINT16 m_scroll_ram[6]; - UINT16 m_layer_en; + uint16_t m_scroll_ram[6]; + uint16_t m_layer_en; DECLARE_WRITE16_MEMBER(layer_en_w); DECLARE_WRITE16_MEMBER(layer_scroll_w); @@ -50,7 +50,7 @@ public: DECLARE_DRIVER_INIT(sdgndmps); virtual void video_start() override; - UINT32 screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sdgndmps(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sdgndmps(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect); }; diff --git a/src/mame/includes/dday.h b/src/mame/includes/dday.h index a6b1c498f1b..78bc9c5e769 100644 --- a/src/mame/includes/dday.h +++ b/src/mame/includes/dday.h @@ -22,10 +22,10 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_textvideoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_colorram; + required_shared_ptr m_textvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_fg_tilemap; @@ -56,7 +56,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(dday); - UINT32 screen_update_dday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(countdown_timer_callback); void start_countdown_timer(); required_device m_maincpu; diff --git a/src/mame/includes/ddragon.h b/src/mame/includes/ddragon.h index ca4547434a1..3737d035ac9 100644 --- a/src/mame/includes/ddragon.h +++ b/src/mame/includes/ddragon.h @@ -33,31 +33,31 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - optional_shared_ptr m_rambase; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_fgvideoram; - optional_shared_ptr m_comram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scrollx_lo; - required_shared_ptr m_scrolly_lo; - optional_shared_ptr m_darktowr_mcu_ports; + optional_shared_ptr m_rambase; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; + optional_shared_ptr m_comram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scrollx_lo; + required_shared_ptr m_scrolly_lo; + optional_shared_ptr m_darktowr_mcu_ports; /* video-related */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT8 m_technos_video_hw; - UINT8 m_scrollx_hi; - UINT8 m_scrolly_hi; + uint8_t m_technos_video_hw; + uint8_t m_scrollx_hi; + uint8_t m_scrolly_hi; /* misc */ - UINT8 m_ddragon_sub_port; - UINT8 m_sprite_irq; - UINT8 m_sound_irq; - UINT8 m_ym_irq; - UINT8 m_adpcm_sound_irq; - UINT32 m_adpcm_pos[2]; - UINT32 m_adpcm_end[2]; - UINT8 m_adpcm_idle[2]; + uint8_t m_ddragon_sub_port; + uint8_t m_sprite_irq; + uint8_t m_sound_irq; + uint8_t m_ym_irq; + uint8_t m_adpcm_sound_irq; + uint32_t m_adpcm_pos[2]; + uint32_t m_adpcm_end[2]; + uint8_t m_adpcm_idle[2]; int m_adpcm_data[2]; /* for Sai Yu Gou Ma Roku */ @@ -84,7 +84,7 @@ public: int scanline_to_vcount(int scanline); - void ddragon_interrupt_ack(address_space &space, offs_t offset, UINT8 data); + void ddragon_interrupt_ack(address_space &space, offs_t offset, uint8_t data); void dd_adpcm_int(msm5205_device *device, int chip); /* video/ddragon.c */ @@ -93,7 +93,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_fg_16color_tile_info); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); - UINT32 screen_update_ddragon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ddragon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_MACHINE_START(ddragon); DECLARE_MACHINE_RESET(ddragon); diff --git a/src/mame/includes/ddragon3.h b/src/mame/includes/ddragon3.h index dc7079000bf..a3015588a8e 100644 --- a/src/mame/includes/ddragon3.h +++ b/src/mame/includes/ddragon3.h @@ -33,28 +33,28 @@ public: } /* memory pointers */ - required_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; -// required_shared_ptr m_spriteram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; +// required_shared_ptr m_spriteram; required_device m_spriteram; /* video-related */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT16 m_vreg; - UINT16 m_bg_scrollx; - UINT16 m_bg_scrolly; - UINT16 m_fg_scrollx; - UINT16 m_fg_scrolly; - UINT16 m_bg_tilebase; + uint16_t m_vreg; + uint16_t m_bg_scrollx; + uint16_t m_bg_scrolly; + uint16_t m_fg_scrollx; + uint16_t m_fg_scrolly; + uint16_t m_bg_tilebase; - UINT16 m_sprite_xoff; - UINT16 m_bg0_dx; - UINT16 m_bg1_dx[2]; + uint16_t m_sprite_xoff; + uint16_t m_bg0_dx; + uint16_t m_bg1_dx[2]; /* misc */ - UINT16 m_io_reg[8]; - UINT8 m_pri; + uint16_t m_io_reg[8]; + uint8_t m_pri; /* devices */ required_device m_maincpu; @@ -76,8 +76,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_ddragon3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ctribe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ddragon3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ctribe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(ddragon3_scanline); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); @@ -99,8 +99,8 @@ public: } /* wwfwfest has an extra layer */ - required_shared_ptr m_fg0_videoram; - required_shared_ptr m_paletteram; + required_shared_ptr m_fg0_videoram; + required_shared_ptr m_paletteram; tilemap_t *m_fg0_tilemap; DECLARE_WRITE16_MEMBER(wwfwfest_fg0_videoram_w); @@ -119,6 +119,6 @@ public: virtual void video_start() override; DECLARE_VIDEO_START(wwfwfstb); - UINT32 screen_update_wwfwfest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wwfwfest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/ddribble.h b/src/mame/includes/ddribble.h index bb9a508717d..3f949aa48ad 100644 --- a/src/mame/includes/ddribble.h +++ b/src/mame/includes/ddribble.h @@ -28,12 +28,12 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_fg_videoram; - required_shared_ptr m_spriteram_1; - required_shared_ptr m_sharedram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_spriteram_2; - required_shared_ptr m_snd_sharedram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_spriteram_1; + required_shared_ptr m_sharedram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_spriteram_2; + required_shared_ptr m_snd_sharedram; /* video-related */ tilemap_t *m_fg_tilemap; @@ -72,8 +72,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(ddribble); - UINT32 screen_update_ddribble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ddribble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ddribble_interrupt_0); INTERRUPT_GEN_MEMBER(ddribble_interrupt_1); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8* source, int lenght, int gfxset, int flipscreen ); + void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* source, int lenght, int gfxset, int flipscreen ); }; diff --git a/src/mame/includes/deadang.h b/src/mame/includes/deadang.h index eb82b28ad15..0b279e536b1 100644 --- a/src/mame/includes/deadang.h +++ b/src/mame/includes/deadang.h @@ -27,10 +27,10 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_scroll_ram; - required_shared_ptr m_video_data; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_scroll_ram; + required_shared_ptr m_video_data; tilemap_t *m_pf3_layer; tilemap_t *m_pf2_layer; @@ -55,7 +55,7 @@ public: TILE_GET_INFO_MEMBER(get_pf1_tile_info); TILE_GET_INFO_MEMBER(get_text_tile_info); - 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); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(main_scanline); diff --git a/src/mame/includes/dec0.h b/src/mame/includes/dec0.h index b7884b4a540..b6fe6f88243 100644 --- a/src/mame/includes/dec0.h +++ b/src/mame/includes/dec0.h @@ -42,11 +42,11 @@ public: optional_device m_pfprotect; required_device m_soundlatch; - required_shared_ptr m_ram; - required_shared_ptr m_spriteram; - required_shared_ptr m_paletteram; - optional_shared_ptr m_robocop_shared_ram; - optional_shared_ptr m_hippodrm_shared_ram; + required_shared_ptr m_ram; + required_shared_ptr m_spriteram; + required_shared_ptr m_paletteram; + optional_shared_ptr m_robocop_shared_ram; + optional_shared_ptr m_hippodrm_shared_ram; int m_game; int m_i8751_return; @@ -54,9 +54,9 @@ public: int m_slyspy_state; int m_hippodrm_msb; int m_hippodrm_lsb; - UINT8 m_i8751_ports[4]; - UINT16 *m_buffered_spriteram; - UINT16 m_pri; + uint8_t m_i8751_ports[4]; + uint16_t *m_buffered_spriteram; + uint16_t m_pri; DECLARE_WRITE16_MEMBER(dec0_control_w); DECLARE_WRITE16_MEMBER(slyspy_control_w); @@ -95,13 +95,13 @@ public: DECLARE_VIDEO_START(dec0); DECLARE_VIDEO_START(dec0_nodma); - UINT32 screen_update_hbarrel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_baddudes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_birdtry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_robocop(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hippodrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_slyspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_midres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hbarrel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_baddudes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_birdtry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_robocop(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hippodrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_slyspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_midres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void baddudes_i8751_write(int data); void birdtry_i8751_write(int data); @@ -118,9 +118,9 @@ public: : dec0_state(mconfig, type, tag) { } - UINT8 m_automat_adpcm_byte; + uint8_t m_automat_adpcm_byte; int m_automat_msm5205_vclk_toggle; - UINT16 m_automat_scroll_regs[4]; + uint16_t m_automat_scroll_regs[4]; DECLARE_WRITE16_MEMBER(automat_control_w); DECLARE_WRITE8_MEMBER(automat_adpcm_w); @@ -134,6 +134,6 @@ public: virtual void machine_start() override; - UINT32 screen_update_automat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_secretab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_automat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_secretab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/dec8.h b/src/mame/includes/dec8.h index 92f0777ff7f..85a91294041 100644 --- a/src/mame/includes/dec8.h +++ b/src/mame/includes/dec8.h @@ -49,12 +49,12 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_videoram; - optional_shared_ptr m_bg_data; + required_shared_ptr m_videoram; + optional_shared_ptr m_bg_data; - UINT8 * m_pf1_data; - UINT8 * m_row; - UINT16 m_buffered_spriteram16[0x800/2]; // for the mxc06 sprite chip emulation (oscar, cobra) + uint8_t * m_pf1_data; + uint8_t * m_row; + uint16_t m_buffered_spriteram16[0x800/2]; // for the mxc06 sprite chip emulation (oscar, cobra) /* video-related */ tilemap_t *m_bg_tilemap; @@ -152,14 +152,14 @@ public: DECLARE_VIDEO_START(oscar); DECLARE_VIDEO_START(srdarwin); DECLARE_VIDEO_START(cobracom); - UINT32 screen_update_lastmisn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_shackled(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gondo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_garyoret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ghostb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_oscar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_srdarwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cobracom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lastmisn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_shackled(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gondo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_garyoret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ghostb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_oscar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_srdarwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cobracom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_dec8(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(gondo_interrupt); INTERRUPT_GEN_MEMBER(oscar_interrupt); diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h index dac1bb37bc8..0063c4d97ef 100644 --- a/src/mame/includes/deco32.h +++ b/src/mame/includes/deco32.h @@ -64,19 +64,19 @@ public: required_device m_palette; optional_device m_soundlatch; - required_shared_ptr m_ram; + required_shared_ptr m_ram; // we use the pointers below to store a 32-bit copy.. - required_shared_ptr m_pf1_rowscroll32; - required_shared_ptr m_pf2_rowscroll32; - required_shared_ptr m_pf3_rowscroll32; - required_shared_ptr m_pf4_rowscroll32; - required_shared_ptr m_generic_paletteram_32; - optional_shared_ptr m_ace_ram; + required_shared_ptr m_pf1_rowscroll32; + required_shared_ptr m_pf2_rowscroll32; + required_shared_ptr m_pf3_rowscroll32; + required_shared_ptr m_pf4_rowscroll32; + required_shared_ptr m_generic_paletteram_32; + optional_shared_ptr m_ace_ram; int m_raster_enable; // captaven, dragongun and lockload timer_device *m_raster_irq_timer; // captaven, dragongun and lockload - UINT8 m_nslasher_sound_irq; // nslasher and lockload - UINT8 m_irq_source; // captaven, dragongun and lockload + uint8_t m_nslasher_sound_irq; // nslasher and lockload + uint8_t m_irq_source; // captaven, dragongun and lockload int m_tattass_eprom_bit; // tattass int m_lastClock; // tattass char m_buffer[32]; // tattass @@ -86,17 +86,17 @@ public: int m_byteAddr; // tattass int m_ace_ram_dirty; // nslasher and tattass int m_has_ace_ram; // all - config - std::unique_ptr m_dirty_palette; // all but captaven + std::unique_ptr m_dirty_palette; // all but captaven int m_pri; // captaven, fghthist, nslasher and tattass std::unique_ptr m_tilemap_alpha_bitmap; // nslasher - UINT16 m_spriteram16[0x1000]; // captaven, fghthist, nslasher and tattass - UINT16 m_spriteram16_buffered[0x1000]; // captaven, fghthist, nslasher and tattass - UINT16 m_spriteram16_2[0x1000]; //nslasher and tattass - UINT16 m_spriteram16_2_buffered[0x1000]; //nslasher and tattass - UINT16 m_pf1_rowscroll[0x1000]; // common - UINT16 m_pf2_rowscroll[0x1000]; // common - UINT16 m_pf3_rowscroll[0x1000]; // common - UINT16 m_pf4_rowscroll[0x1000]; // common + uint16_t m_spriteram16[0x1000]; // captaven, fghthist, nslasher and tattass + uint16_t m_spriteram16_buffered[0x1000]; // captaven, fghthist, nslasher and tattass + uint16_t m_spriteram16_2[0x1000]; //nslasher and tattass + uint16_t m_spriteram16_2_buffered[0x1000]; //nslasher and tattass + uint16_t m_pf1_rowscroll[0x1000]; // common + uint16_t m_pf2_rowscroll[0x1000]; // common + uint16_t m_pf3_rowscroll[0x1000]; // common + uint16_t m_pf4_rowscroll[0x1000]; // common // common DECLARE_WRITE32_MEMBER(pf1_rowscroll_w); @@ -167,21 +167,21 @@ public: INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen); - UINT32 screen_update_captaven(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_fghthist(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_captaven(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fghthist(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void updateAceRam(); void mixDualAlphaSprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx0, gfx_element *gfx1, int mixAlphaTilemap); - UINT16 port_a_fghthist(int unused); - UINT16 port_b_fghthist(int unused); - UINT16 port_c_fghthist(int unused); - void deco32_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ); + uint16_t port_a_fghthist(int unused); + uint16_t port_b_fghthist(int unused); + uint16_t port_c_fghthist(int unused); + void deco32_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ); - UINT16 port_b_nslasher(int unused); - void nslasher_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ); - UINT16 port_b_tattass(int unused); - void tattass_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ); + uint16_t port_b_nslasher(int unused); + void nslasher_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ); + uint16_t port_b_tattass(int unused); + void tattass_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ); DECO16IC_BANK_CB_MEMBER(fghthist_bank_callback); DECO16IC_BANK_CB_MEMBER(captaven_bank_callback); @@ -200,12 +200,12 @@ public: m_sprite_lookup_1_ram(*this, "look1") { } - required_shared_ptr m_sprite_layout_0_ram; - required_shared_ptr m_sprite_layout_1_ram; - required_shared_ptr m_sprite_lookup_0_ram; - required_shared_ptr m_sprite_lookup_1_ram; + required_shared_ptr m_sprite_layout_0_ram; + required_shared_ptr m_sprite_layout_1_ram; + required_shared_ptr m_sprite_lookup_0_ram; + required_shared_ptr m_sprite_lookup_1_ram; - UINT32 m_sprite_ctrl; + uint32_t m_sprite_ctrl; int m_lightgun_port; bitmap_rgb32 m_temp_render_bitmap; @@ -229,7 +229,7 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(lockload_vbl_irq); - UINT32 screen_update_dragngun(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dragngun(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECO16IC_BANK_CB_MEMBER(bank_1_callback); DECO16IC_BANK_CB_MEMBER(bank_2_callback); diff --git a/src/mame/includes/deco_mlc.h b/src/mame/includes/deco_mlc.h index 481734e2f2c..2299e477953 100644 --- a/src/mame/includes/deco_mlc.h +++ b/src/mame/includes/deco_mlc.h @@ -26,22 +26,22 @@ public: { } optional_device m_deco146; - required_shared_ptr m_mlc_ram; - required_shared_ptr m_irq_ram; - required_shared_ptr m_mlc_clip_ram; - required_shared_ptr m_mlc_vram; + required_shared_ptr m_mlc_ram; + required_shared_ptr m_irq_ram; + required_shared_ptr m_mlc_clip_ram; + required_shared_ptr m_mlc_vram; timer_device *m_raster_irq_timer; int m_mainCpuIsArm; - UINT32 m_mlc_raster_table_1[4*256]; - UINT32 m_mlc_raster_table_2[4*256]; - UINT32 m_mlc_raster_table_3[4*256]; - UINT32 m_vbl_i; + uint32_t m_mlc_raster_table_1[4*256]; + uint32_t m_mlc_raster_table_2[4*256]; + uint32_t m_mlc_raster_table_3[4*256]; + uint32_t m_vbl_i; int m_lastScanline[9]; - UINT32 m_colour_mask; + uint32_t m_colour_mask; - std::unique_ptr m_mlc_spriteram; - std::unique_ptr m_mlc_spriteram_spare; - std::unique_ptr m_mlc_buffered_spriteram; + std::unique_ptr m_mlc_spriteram; + std::unique_ptr m_mlc_spriteram_spare; + std::unique_ptr m_mlc_buffered_spriteram; DECLARE_READ32_MEMBER(test2_r); DECLARE_READ32_MEMBER(mlc_440008_r); DECLARE_READ32_MEMBER(mlc_44001c_r); @@ -66,10 +66,10 @@ public: DECLARE_DRIVER_INIT(avengrgs); DECLARE_MACHINE_RESET(mlc); DECLARE_VIDEO_START(mlc); - UINT32 screen_update_mlc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mlc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_mlc(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen); - void draw_sprites( const rectangle &cliprect, int scanline, UINT32* dest); + void draw_sprites( const rectangle &cliprect, int scanline, uint32_t* dest); void descramble_sound( ); required_device m_maincpu; required_device m_eeprom; @@ -77,8 +77,8 @@ public: required_device m_gfxdecode; required_device m_screen; required_device m_palette; - required_shared_ptr m_generic_paletteram_32; - required_region_ptr m_gfx2; + required_shared_ptr m_generic_paletteram_32; + required_region_ptr m_gfx2; DECLARE_READ16_MEMBER( sh96_protection_region_0_146_r ); DECLARE_WRITE16_MEMBER( sh96_protection_region_0_146_w ); diff --git a/src/mame/includes/decocass.h b/src/mame/includes/decocass.h index 6402fb96840..9f8beb4163b 100644 --- a/src/mame/includes/decocass.h +++ b/src/mame/includes/decocass.h @@ -56,14 +56,14 @@ public: required_device m_soundlatch2; /* memory pointers */ - required_shared_ptr m_rambase; - required_shared_ptr m_charram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_colorram; - UINT8 * m_bgvideoram; /* shares bits D0-3 with tileram! */ - required_shared_ptr m_tileram; - required_shared_ptr m_objectram; - required_shared_ptr m_paletteram; + required_shared_ptr m_rambase; + required_shared_ptr m_charram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_colorram; + uint8_t * m_bgvideoram; /* shares bits D0-3 with tileram! */ + required_shared_ptr m_tileram; + required_shared_ptr m_objectram; + required_shared_ptr m_paletteram; size_t m_bgvideoram_size; @@ -71,38 +71,38 @@ public: tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap_l; tilemap_t *m_bg_tilemap_r; - UINT8 m_empty_tile[16*16]; - INT32 m_watchdog_count; - INT32 m_watchdog_flip; - INT32 m_color_missiles; - INT32 m_color_center_bot; - INT32 m_mode_set; - INT32 m_back_h_shift; - INT32 m_back_vl_shift; - INT32 m_back_vr_shift; - INT32 m_part_h_shift; - INT32 m_part_v_shift; - INT32 m_center_h_shift_space; - INT32 m_center_v_shift; + uint8_t m_empty_tile[16*16]; + int32_t m_watchdog_count; + int32_t m_watchdog_flip; + int32_t m_color_missiles; + int32_t m_color_center_bot; + int32_t m_mode_set; + int32_t m_back_h_shift; + int32_t m_back_vl_shift; + int32_t m_back_vr_shift; + int32_t m_part_h_shift; + int32_t m_part_v_shift; + int32_t m_center_h_shift_space; + int32_t m_center_v_shift; rectangle m_bg_tilemap_l_clip; rectangle m_bg_tilemap_r_clip; /* sound-related */ - UINT8 m_sound_ack; /* sound latches, ACK status bits and NMI timer */ - UINT8 m_audio_nmi_enabled; - UINT8 m_audio_nmi_state; + uint8_t m_sound_ack; /* sound latches, ACK status bits and NMI timer */ + uint8_t m_audio_nmi_enabled; + uint8_t m_audio_nmi_state; /* misc */ - INT32 m_firsttime; - UINT8 m_latch1; - UINT8 m_decocass_reset; - INT32 m_de0091_enable; /* DE-0091xx daughter board enable */ - UINT8 m_quadrature_decoder[4]; /* four inputs from the quadrature decoder (H1, V1, H2, V2) */ + int32_t m_firsttime; + uint8_t m_latch1; + uint8_t m_decocass_reset; + int32_t m_de0091_enable; /* DE-0091xx daughter board enable */ + uint8_t m_quadrature_decoder[4]; /* four inputs from the quadrature decoder (H1, V1, H2, V2) */ int m_showmsg; // for debugging purposes /* i8041 */ - UINT8 m_i8041_p1; - UINT8 m_i8041_p2; + uint8_t m_i8041_p1; + uint8_t m_i8041_p2; int m_i8041_p1_write_latch; int m_i8041_p1_read_latch; int m_i8041_p2_write_latch; @@ -113,29 +113,29 @@ public: write8_delegate m_dongle_w; /* dongle type #1 */ - UINT32 m_type1_inmap; - UINT32 m_type1_outmap; + uint32_t m_type1_inmap; + uint32_t m_type1_outmap; /* dongle type #2: status of the latches */ - INT32 m_type2_d2_latch; /* latched 8041-STATUS D2 value */ - INT32 m_type2_xx_latch; /* latched value (D7-4 == 0xc0) ? 1 : 0 */ - INT32 m_type2_promaddr; /* latched PROM address A0-A7 */ + int32_t m_type2_d2_latch; /* latched 8041-STATUS D2 value */ + int32_t m_type2_xx_latch; /* latched value (D7-4 == 0xc0) ? 1 : 0 */ + int32_t m_type2_promaddr; /* latched PROM address A0-A7 */ /* dongle type #3: status and patches */ - INT32 m_type3_ctrs; /* 12 bit counter stage */ - INT32 m_type3_d0_latch; /* latched 8041-D0 value */ - INT32 m_type3_pal_19; /* latched 1 for PAL input pin-19 */ - INT32 m_type3_swap; + int32_t m_type3_ctrs; /* 12 bit counter stage */ + int32_t m_type3_d0_latch; /* latched 8041-D0 value */ + int32_t m_type3_pal_19; /* latched 1 for PAL input pin-19 */ + int32_t m_type3_swap; /* dongle type #4: status */ - INT32 m_type4_ctrs; /* latched PROM address (E5x0 LSB, E5x1 MSB) */ - INT32 m_type4_latch; /* latched enable PROM (1100xxxx written to E5x1) */ + int32_t m_type4_ctrs; /* latched PROM address (E5x0 LSB, E5x1 MSB) */ + int32_t m_type4_latch; /* latched enable PROM (1100xxxx written to E5x1) */ /* dongle type #5: status */ - INT32 m_type5_latch; /* latched enable PROM (1100xxxx written to E5x1) */ + int32_t m_type5_latch; /* latched enable PROM (1100xxxx written to E5x1) */ /* DS Telejan */ - UINT8 m_mux_data; + uint8_t m_mux_data; DECLARE_DRIVER_INIT(decocass); DECLARE_DRIVER_INIT(decocrom); @@ -184,7 +184,7 @@ public: DECLARE_MACHINE_RESET(cflyball); DECLARE_MACHINE_RESET(cmanhat); DECLARE_MACHINE_RESET(cocean1a); /* 10 */ - UINT32 screen_update_decocass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_decocass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(decocass_coin_counter_w); DECLARE_WRITE8_MEMBER(decocass_sound_command_w); DECLARE_READ8_MEMBER( decocass_sound_command_main_r ); @@ -258,17 +258,17 @@ private: DECLARE_WRITE8_MEMBER(decocass_type5_w); DECLARE_READ8_MEMBER(decocass_nodong_r); - UINT8* m_type1_map; + uint8_t* m_type1_map; void draw_edge(bitmap_ind16 &bitmap, const rectangle &cliprect, int which, bool opaque); void draw_object(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_center(bitmap_ind16 &bitmap, const rectangle &cliprect); void mark_bg_tile_dirty(offs_t offset); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int color, int sprite_y_adjust, int sprite_y_adjust_flip_screen, - UINT8 *sprite_ram, int interleave); + uint8_t *sprite_ram, int interleave); void draw_missiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int missile_y_adjust, int missile_y_adjust_flip_screen, - UINT8 *missile_ram, int interleave); - void decocass_fno( offs_t offset, UINT8 data ); + uint8_t *missile_ram, int interleave); + void decocass_fno( offs_t offset, uint8_t data ); }; diff --git a/src/mame/includes/deniam.h b/src/mame/includes/deniam.h index 5beebbb7c37..a9922b81e82 100644 --- a/src/mame/includes/deniam.h +++ b/src/mame/includes/deniam.h @@ -27,10 +27,10 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_textram; - required_shared_ptr m_spriteram; - required_shared_ptr m_paletteram; + required_shared_ptr m_videoram; + required_shared_ptr m_textram; + required_shared_ptr m_spriteram; + required_shared_ptr m_paletteram; /* video-related */ tilemap_t *m_fg_tilemap; @@ -49,7 +49,7 @@ public: int m_fg_page_reg; int m_bg_page[4]; int m_fg_page[4]; - UINT16 m_coinctrl; + uint16_t m_coinctrl; /* devices */ DECLARE_WRITE16_MEMBER(sound_command_w); @@ -70,7 +70,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_deniam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_deniam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void deniam_common_init( ); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); void set_bg_page( int page, int value ); diff --git a/src/mame/includes/dgn_beta.h b/src/mame/includes/dgn_beta.h index ea49068a512..fb6dfefa5bb 100644 --- a/src/mame/includes/dgn_beta.h +++ b/src/mame/includes/dgn_beta.h @@ -74,7 +74,7 @@ enum BETA_VID_MODES struct PageReg { int value; /* Value of the page register */ - UINT8 *memory; /* The memory it actually points to */ + uint8_t *memory; /* The memory it actually points to */ }; @@ -97,9 +97,9 @@ public: DECLARE_FLOPPY_FORMATS(floppy_formats); required_device m_mc6845; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; - UINT8 *m_system_rom; + uint8_t *m_system_rom; int m_LogDatWrites; int m_Keyboard[NoKeyrows]; int m_RowShifter; @@ -221,7 +221,7 @@ public: required_device m_floppy3; required_device m_palette; - offs_t dgnbeta_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); + offs_t dgnbeta_dasm_override(device_t &device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options); private: void execute_beta_key_dump(int ref, int params, const char *param[]); diff --git a/src/mame/includes/dgnalpha.h b/src/mame/includes/dgnalpha.h index 220bc334137..9ea62d3aeef 100644 --- a/src/mame/includes/dgnalpha.h +++ b/src/mame/includes/dgnalpha.h @@ -87,11 +87,11 @@ protected: virtual DECLARE_WRITE8_MEMBER( ff20_write ) override; private: - UINT8 m_just_reset; + uint8_t m_just_reset; /* modem */ - UINT8 modem_r(offs_t offset); - void modem_w(offs_t offset, UINT8 data); + uint8_t modem_r(offs_t offset); + void modem_w(offs_t offset, uint8_t data); }; #endif /* __DGNALPHA__ */ diff --git a/src/mame/includes/dietgo.h b/src/mame/includes/dietgo.h index 71d9c2341f6..5f5c38fbec2 100644 --- a/src/mame/includes/dietgo.h +++ b/src/mame/includes/dietgo.h @@ -30,9 +30,9 @@ public: optional_device m_deco104; /* memory pointers */ - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; - required_shared_ptr m_spriteram; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_spriteram; optional_device m_sprgen; /* devices */ @@ -40,10 +40,10 @@ public: required_device m_audiocpu; required_device m_deco_tilegen1; required_device m_decocomn; - required_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_decrypted_opcodes; DECLARE_DRIVER_INIT(dietgo); virtual void machine_start() override; - UINT32 screen_update_dietgo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dietgo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECO16IC_BANK_CB_MEMBER(bank_callback); DECLARE_READ16_MEMBER( dietgo_protection_region_0_104_r ); diff --git a/src/mame/includes/digdug.h b/src/mame/includes/digdug.h index 97744fdd8fe..333188e31ea 100644 --- a/src/mame/includes/digdug.h +++ b/src/mame/includes/digdug.h @@ -10,21 +10,21 @@ public: m_digdug_posram(*this, "digdug_posram"), m_digdug_flpram(*this, "digdug_flpram") { } - required_shared_ptr m_digdug_objram; - required_shared_ptr m_digdug_posram; - required_shared_ptr m_digdug_flpram; + required_shared_ptr m_digdug_objram; + required_shared_ptr m_digdug_posram; + required_shared_ptr m_digdug_flpram; - UINT8 m_bg_select; - UINT8 m_tx_color_mode; - UINT8 m_bg_disable; - UINT8 m_bg_color_bank; + uint8_t m_bg_select; + uint8_t m_tx_color_mode; + uint8_t m_bg_disable; + uint8_t m_bg_color_bank; DECLARE_CUSTOM_INPUT_MEMBER(shifted_port_r); TILEMAP_MAPPER_MEMBER(tilemap_scan); TILE_GET_INFO_MEMBER(bg_get_tile_info); TILE_GET_INFO_MEMBER(tx_get_tile_info); DECLARE_VIDEO_START(digdug); DECLARE_PALETTE_INIT(digdug); - UINT32 screen_update_digdug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_digdug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER( digdug_videoram_w ); DECLARE_WRITE8_MEMBER( digdug_PORT_w ); diff --git a/src/mame/includes/divebomb.h b/src/mame/includes/divebomb.h index c79a3774093..61b5210296f 100644 --- a/src/mame/includes/divebomb.h +++ b/src/mame/includes/divebomb.h @@ -33,22 +33,22 @@ public: required_device m_fgcpu; required_device m_rozcpucpu; required_memory_bank m_bank1; - required_shared_ptr m_fgram; - required_shared_ptr m_spriteram; + required_shared_ptr m_fgram; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_palette; required_device m_k051316_1; required_device m_k051316_2; tilemap_t *m_fg_tilemap; - UINT8 to_spritecpu; - UINT8 to_rozcpu; - UINT8 from_sprite; - UINT8 from_roz; + uint8_t to_spritecpu; + uint8_t to_rozcpu; + uint8_t from_sprite; + uint8_t from_roz; bool has_fromsprite; bool has_fromroz; - UINT8 roz_pal; + uint8_t roz_pal; bool roz1_enable; bool roz2_enable; bool roz1_wrap; @@ -61,8 +61,8 @@ public: void update_irqs(); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void decode_proms(const UINT8* rgn, int size, int index, bool inv); - UINT32 screen_update_divebomb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void decode_proms(const uint8_t* rgn, int size, int index, bool inv); + uint32_t screen_update_divebomb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); K051316_CB_MEMBER(zoom_callback_1); K051316_CB_MEMBER(zoom_callback_2); diff --git a/src/mame/includes/djboy.h b/src/mame/includes/djboy.h index ef464bdda47..2795829b15a 100644 --- a/src/mame/includes/djboy.h +++ b/src/mame/includes/djboy.h @@ -29,28 +29,28 @@ public: { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_paletteram; + required_shared_ptr m_videoram; + required_shared_ptr m_paletteram; /* ROM banking */ - UINT8 m_bankxor; + uint8_t m_bankxor; /* video-related */ tilemap_t *m_background; - UINT8 m_videoreg; - UINT8 m_scrollx; - UINT8 m_scrolly; + uint8_t m_videoreg; + uint8_t m_scrollx; + uint8_t m_scrolly; /* Kaneko BEAST state */ - UINT8 m_data_to_beast; - UINT8 m_data_to_z80; - UINT8 m_beast_to_z80_full; - UINT8 m_z80_to_beast_full; - UINT8 m_beast_int0_l; - UINT8 m_beast_p0; - UINT8 m_beast_p1; - UINT8 m_beast_p2; - UINT8 m_beast_p3; + uint8_t m_data_to_beast; + uint8_t m_data_to_z80; + uint8_t m_beast_to_z80_full; + uint8_t m_z80_to_beast_full; + uint8_t m_beast_int0_l; + uint8_t m_beast_p0; + uint8_t m_beast_p1; + uint8_t m_beast_p2; + uint8_t m_beast_p3; /* devices */ required_device m_maincpu; @@ -89,7 +89,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_djboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_djboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_djboy(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(djboy_scanline); }; diff --git a/src/mame/includes/djmain.h b/src/mame/includes/djmain.h index 530a673bf95..5cbd75225ba 100644 --- a/src/mame/includes/djmain.h +++ b/src/mame/includes/djmain.h @@ -22,16 +22,16 @@ public: } int m_sndram_bank; - UINT8 *m_sndram; + uint8_t *m_sndram; int m_turntable_select; - UINT8 m_turntable_last_pos[2]; - UINT16 m_turntable_pos[2]; - UINT8 m_pending_vb_int; - UINT16 m_v_ctrl; - UINT32 m_obj_regs[0xa0/4]; - const UINT8 *m_ata_user_password; - const UINT8 *m_ata_master_password; - required_shared_ptr m_obj_ram; + uint8_t m_turntable_last_pos[2]; + uint16_t m_turntable_pos[2]; + uint8_t m_pending_vb_int; + uint16_t m_v_ctrl; + uint32_t m_obj_regs[0xa0/4]; + const uint8_t *m_ata_user_password; + const uint8_t *m_ata_master_password; + required_shared_ptr m_obj_ram; DECLARE_WRITE32_MEMBER(sndram_bank_w); DECLARE_READ32_MEMBER(sndram_r); DECLARE_WRITE32_MEMBER(sndram_w); @@ -64,7 +64,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_djmain(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_djmain(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vb_interrupt); DECLARE_WRITE_LINE_MEMBER(ide_interrupt); void sndram_set_bank(); diff --git a/src/mame/includes/dkong.h b/src/mame/includes/dkong.h index 61848bf7e7c..0bb1b607c84 100644 --- a/src/mame/includes/dkong.h +++ b/src/mame/includes/dkong.h @@ -135,58 +135,58 @@ public: optional_device m_discrete; /* memory pointers */ - required_shared_ptr m_video_ram; - required_shared_ptr m_sprite_ram; + required_shared_ptr m_video_ram; + required_shared_ptr m_sprite_ram; /* machine states */ - UINT8 m_hardware_type; - UINT8 m_nmi_mask; + uint8_t m_hardware_type; + uint8_t m_nmi_mask; - std::unique_ptr m_decrypted; + std::unique_ptr m_decrypted; /* sound state */ - optional_region_ptr m_snd_rom; + optional_region_ptr m_snd_rom; /* video state */ tilemap_t *m_bg_tilemap; bitmap_ind16 m_bg_bits; - const UINT8 * m_color_codes; + const uint8_t * m_color_codes; emu_timer * m_scanline_timer; - INT8 m_vidhw; /* Selected video hardware RS Conversion / TKG04 */ + int8_t m_vidhw; /* Selected video hardware RS Conversion / TKG04 */ /* radar scope */ - UINT8 * m_gfx4; - UINT8 * m_gfx3; + uint8_t * m_gfx4; + uint8_t * m_gfx3; int m_gfx3_len; - UINT8 m_sig30Hz; - UINT8 m_lfsr_5I; - UINT8 m_grid_sig; - UINT8 m_rflip_sig; - UINT8 m_star_ff; - UINT8 m_blue_level; + uint8_t m_sig30Hz; + uint8_t m_lfsr_5I; + uint8_t m_grid_sig; + uint8_t m_rflip_sig; + uint8_t m_star_ff; + uint8_t m_blue_level; double m_cd4049_a; double m_cd4049_b; /* Specific states */ - INT8 m_decrypt_counter; + int8_t m_decrypt_counter; /* 2650 protection */ - UINT8 m_protect_type; - UINT8 m_hunchloopback; - UINT8 m_prot_cnt; - UINT8 m_main_fo; + uint8_t m_protect_type; + uint8_t m_hunchloopback; + uint8_t m_prot_cnt; + uint8_t m_main_fo; /* Save state relevant */ - UINT8 m_gfx_bank; - UINT8 m_palette_bank; - UINT8 m_grid_on; - UINT16 m_grid_col; - UINT8 m_sprite_bank; - UINT8 m_dma_latch; - UINT8 m_flip; + uint8_t m_gfx_bank; + uint8_t m_palette_bank; + uint8_t m_grid_on; + uint16_t m_grid_col; + uint8_t m_sprite_bank; + uint8_t m_dma_latch; + uint8_t m_flip; /* radarscp_step */ double m_cv1; @@ -209,7 +209,7 @@ public: int m_counter; /* reverse address lookup map - hunchbkd */ - INT16 m_rev_map[0x200]; + int16_t m_rev_map[0x200]; DECLARE_READ8_MEMBER(hb_dma_read_byte); DECLARE_WRITE8_MEMBER(hb_dma_write_byte); DECLARE_WRITE8_MEMBER(dkong3_coin_counter_w); @@ -269,16 +269,16 @@ public: DECLARE_READ8_MEMBER(dkong_voice_status_r); DECLARE_READ8_MEMBER(dkong_tune_r); DECLARE_WRITE8_MEMBER(dkong_p1_w); - UINT32 screen_update_dkong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pestplce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spclforc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dkong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pestplce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spclforc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(s2650_interrupt); INTERRUPT_GEN_MEMBER(vblank_irq); TIMER_CALLBACK_MEMBER(scanline_callback); DECLARE_WRITE_LINE_MEMBER(busreq_w); - void braze_decrypt_rom(UINT8 *dest); - void drakton_decrypt_rom(UINT8 mod, int offs, int *bs); + void braze_decrypt_rom(uint8_t *dest); + void drakton_decrypt_rom(uint8_t mod, int offs, int *bs); DECLARE_READ8_MEMBER(memory_read_byte); DECLARE_WRITE8_MEMBER(memory_write_byte); double CD4049(double x); @@ -288,7 +288,7 @@ private: void radarscp_step(int line_cnt); void radarscp_scanline(int scanline); void check_palette(void); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 mask_bank, UINT32 shift_bits); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t mask_bank, uint32_t shift_bits); void radarscp_draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/dm7000.h b/src/mame/includes/dm7000.h index 4306f4619e4..97af2a1785a 100644 --- a/src/mame/includes/dm7000.h +++ b/src/mame/includes/dm7000.h @@ -30,9 +30,9 @@ public: DECLARE_WRITE8_MEMBER ( dm7000_scc0_w ); DECLARE_READ8_MEMBER ( dm7000_scc0_r ); DECLARE_WRITE8_MEMBER(kbd_put); - UINT8 m_scc0_lcr; - UINT8 m_scc0_lsr; - UINT8 m_term_data; + uint8_t m_scc0_lcr; + uint8_t m_scc0_lsr; + uint8_t m_term_data; DECLARE_WRITE8_MEMBER ( dm7000_gpio0_w ); @@ -48,12 +48,12 @@ public: DECLARE_WRITE32_MEMBER( dcr_w ); - UINT16 m_enet_regs[32]; + uint16_t m_enet_regs[32]; - UINT32 dcr[1024]; + uint32_t dcr[1024]; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_dm7000(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dm7000(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; /* */ diff --git a/src/mame/includes/docastle.h b/src/mame/includes/docastle.h index 13913392953..78afee5b4af 100644 --- a/src/mame/includes/docastle.h +++ b/src/mame/includes/docastle.h @@ -34,9 +34,9 @@ public: optional_device m_msm; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_palette; @@ -50,8 +50,8 @@ public: int m_adpcm_idle; int m_adpcm_data; int m_adpcm_status; - UINT8 m_buffer0[9]; - UINT8 m_buffer1[9]; + uint8_t m_buffer0[9]; + uint8_t m_buffer1[9]; DECLARE_READ8_MEMBER(docastle_shared0_r); DECLARE_READ8_MEMBER(docastle_shared1_r); @@ -70,8 +70,8 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(docastle); DECLARE_VIDEO_START(dorunrun); - UINT32 screen_update_docastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void video_start_common( UINT32 tile_transmask ); + uint32_t screen_update_docastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void video_start_common( uint32_t tile_transmask ); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); DECLARE_WRITE_LINE_MEMBER(docastle_tint); DECLARE_WRITE_LINE_MEMBER(idsoccer_adpcm_int); diff --git a/src/mame/includes/dogfgt.h b/src/mame/includes/dogfgt.h index c63ff99abc2..91f9213b953 100644 --- a/src/mame/includes/dogfgt.h +++ b/src/mame/includes/dogfgt.h @@ -20,14 +20,14 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_bgvideoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_sharedram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_sharedram; /* video-related */ bitmap_ind16 m_pixbitmap; tilemap_t *m_bg_tilemap; - std::unique_ptr m_bitmapram; + std::unique_ptr m_bitmapram; int m_bm_plane; int m_pixcolor; int m_scroll[4]; @@ -58,7 +58,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(dogfgt); - UINT32 screen_update_dogfgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dogfgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/dooyong.h b/src/mame/includes/dooyong.h index b272ae74afe..b1b30922fba 100644 --- a/src/mame/includes/dooyong.h +++ b/src/mame/includes/dooyong.h @@ -40,9 +40,9 @@ public: static void static_set_gfxdecode_tag(device_t &device, char const *tag); static void static_set_gfxnum(device_t &device, int gfxnum); - void draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, UINT32 flags, UINT8 priority); + void draw(screen_device &screen, bitmap_ind16 &dest, rectangle const &cliprect, uint32_t flags, uint8_t priority); - void set_palette_bank(UINT16 bank); + void set_palette_bank(uint16_t bank); protected: dooyong_tilemap_device_base( @@ -51,7 +51,7 @@ protected: char const *name, char const *tag, device_t *owner, - UINT32 clock, + uint32_t clock, char const *shortname, char const *source); @@ -61,13 +61,13 @@ protected: int m_gfxnum; tilemap_t *m_tilemap; - UINT16 m_palette_bank; + uint16_t m_palette_bank; }; class dooyong_rom_tilemap_device : public dooyong_tilemap_device_base { public: - dooyong_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); + dooyong_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); static void static_set_tilerom_tag(device_t &device, char const *tag); static void static_set_tilerom_offset(device_t &device, int offset); @@ -83,7 +83,7 @@ protected: char const *name, char const *tag, device_t *owner, - UINT32 clock, + uint32_t clock, char const *shortname, char const *source); @@ -97,20 +97,20 @@ protected: int m_rows; private: - required_region_ptr m_tilerom; + required_region_ptr m_tilerom; int m_tilerom_offset; unsigned m_transparent_pen; unsigned m_primella_code_mask; unsigned m_primella_color_mask; unsigned m_primella_color_shift; - UINT8 m_registers[0x10]; + uint8_t m_registers[0x10]; }; class rshark_rom_tilemap_device : public dooyong_rom_tilemap_device { public: - rshark_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); + rshark_rom_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); static void static_set_colorrom_tag(device_t &device, char const *tag); static void static_set_colorrom_offset(device_t &device, int offset); @@ -121,14 +121,14 @@ protected: virtual TILE_GET_INFO_MEMBER(tile_info) override; private: - required_region_ptr m_colorrom; + required_region_ptr m_colorrom; int m_colorrom_offset; }; class dooyong_ram_tilemap_device : public dooyong_tilemap_device_base { public: - dooyong_ram_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, UINT32 clock); + dooyong_ram_tilemap_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER(tileram_r) { return m_tileram[offset & ((64U * 32U) - 1)]; } DECLARE_WRITE16_MEMBER(tileram_w); @@ -140,7 +140,7 @@ protected: private: TILE_GET_INFO_MEMBER(tile_info); - std::unique_ptr m_tileram; + std::unique_ptr m_tileram; }; @@ -200,19 +200,19 @@ public: DECLARE_WRITE8_MEMBER(flytiger_ctrl_w); TILE_GET_INFO_MEMBER(get_tx_tile_info); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, unsigned extensions = 0); - UINT32 screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_MACHINE_START(cpu_z80); DECLARE_VIDEO_START(bluehawk); DECLARE_VIDEO_START(flytiger); DECLARE_VIDEO_START(primella); - std::unique_ptr m_paletteram_flytiger; - UINT8 m_sprites_disabled = 0; - UINT8 m_flytiger_pri = 0; - UINT8 m_tx_pri = 0; - UINT8 m_palette_bank = 0; + std::unique_ptr m_paletteram_flytiger; + uint8_t m_sprites_disabled = 0; + uint8_t m_flytiger_pri = 0; + uint8_t m_tx_pri = 0; + uint8_t m_palette_bank = 0; required_device m_tx; optional_device m_spriteram; @@ -232,9 +232,9 @@ public: DECLARE_WRITE_LINE_MEMBER(irqhandler_2203_2); DECLARE_READ8_MEMBER(unk_r); DECLARE_MACHINE_RESET(sound_ym2203); - UINT32 screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_VIDEO_START(lastday); DECLARE_VIDEO_START(gulfstrm); DECLARE_VIDEO_START(pollux); @@ -258,7 +258,7 @@ public: protected: void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT16 m_bg2_priority = 0; + uint16_t m_bg2_priority = 0; required_device m_spriteram; }; @@ -270,7 +270,7 @@ public: { } - UINT32 screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_VIDEO_START(rshark); }; @@ -285,7 +285,7 @@ public: { } - UINT32 screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_VIDEO_START(popbingo); protected: diff --git a/src/mame/includes/dragon.h b/src/mame/includes/dragon.h index 20a6877d6f5..450f09ffa57 100644 --- a/src/mame/includes/dragon.h +++ b/src/mame/includes/dragon.h @@ -45,7 +45,7 @@ public: required_device m_printer; protected: - virtual void pia1_pa_changed(UINT8 data) override; + virtual void pia1_pa_changed(uint8_t data) override; }; @@ -65,7 +65,7 @@ protected: virtual DECLARE_READ8_MEMBER( ff00_read ) override; virtual DECLARE_WRITE8_MEMBER( ff00_write ) override; - virtual void pia1_pb_changed(UINT8 data) override; + virtual void pia1_pb_changed(uint8_t data) override; void page_rom(bool romswitch); }; diff --git a/src/mame/includes/dragrace.h b/src/mame/includes/dragrace.h index ff2aa6671c2..3ac2799f2f1 100644 --- a/src/mame/includes/dragrace.h +++ b/src/mame/includes/dragrace.h @@ -39,8 +39,8 @@ public: m_screen(*this, "screen") { } /* memory pointers */ - required_shared_ptr m_playfield_ram; - required_shared_ptr m_position_ram; + required_shared_ptr m_playfield_ram; + required_shared_ptr m_position_ram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -66,7 +66,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(dragrace); - UINT32 screen_update_dragrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dragrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(dragrace_frame_callback); void dragrace_update_misc_flags( address_space &space ); }; diff --git a/src/mame/includes/drgnmst.h b/src/mame/includes/drgnmst.h index 5bd5f712888..af71630cdd3 100644 --- a/src/mame/includes/drgnmst.h +++ b/src/mame/includes/drgnmst.h @@ -24,13 +24,13 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_vidregs; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_md_videoram; - required_shared_ptr m_rowscrollram; - required_shared_ptr m_vidregs2; - required_shared_ptr m_spriteram; + required_shared_ptr m_vidregs; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_md_videoram; + required_shared_ptr m_rowscrollram; + required_shared_ptr m_vidregs2; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -38,13 +38,13 @@ public: tilemap_t *m_md_tilemap; /* misc */ - UINT16 m_snd_command; - UINT16 m_snd_flag; - UINT8 m_oki_control; - UINT8 m_oki_command; - UINT8 m_pic16c5x_port0; - UINT8 m_oki0_bank; - UINT8 m_oki1_bank; + uint16_t m_snd_command; + uint16_t m_snd_flag; + uint8_t m_oki_control; + uint8_t m_oki_command; + uint8_t m_pic16c5x_port0; + uint8_t m_oki0_bank; + uint8_t m_oki1_bank; /* devices */ required_device m_oki_1; @@ -72,9 +72,9 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_drgnmst(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_drgnmst(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); - UINT8 drgnmst_asciitohex( UINT8 data ); + uint8_t drgnmst_asciitohex( uint8_t data ); required_device m_maincpu; required_device m_audiocpu; required_device m_gfxdecode; diff --git a/src/mame/includes/dribling.h b/src/mame/includes/dribling.h index a8c03f671dd..613889c8bd6 100644 --- a/src/mame/includes/dribling.h +++ b/src/mame/includes/dribling.h @@ -27,16 +27,16 @@ public: optional_device m_ppi8255_0; optional_device m_ppi8255_1; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* misc */ - UINT8 m_abca; - UINT8 m_dr; - UINT8 m_ds; - UINT8 m_sh; - UINT8 m_input_mux; - UINT8 m_di; + uint8_t m_abca; + uint8_t m_dr; + uint8_t m_ds; + uint8_t m_sh; + uint8_t m_input_mux; + uint8_t m_di; DECLARE_READ8_MEMBER(ioread); DECLARE_WRITE8_MEMBER(iowrite); @@ -50,6 +50,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(dribling); - UINT32 screen_update_dribling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dribling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(dribling_irq_gen); }; diff --git a/src/mame/includes/drmicro.h b/src/mame/includes/drmicro.h index 2494ef9557a..33c0cba6522 100644 --- a/src/mame/includes/drmicro.h +++ b/src/mame/includes/drmicro.h @@ -18,7 +18,7 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - std::unique_ptr m_videoram; + std::unique_ptr m_videoram; /* video-related */ tilemap_t *m_bg1; @@ -40,7 +40,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(drmicro); - UINT32 screen_update_drmicro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_drmicro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(drmicro_interrupt); DECLARE_WRITE_LINE_MEMBER(pcm_w); required_device m_maincpu; diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h index 4ccfbb7bbab..a7f51f4c157 100644 --- a/src/mame/includes/dynax.h +++ b/src/mame/includes/dynax.h @@ -44,29 +44,29 @@ public: optional_device m_screen; required_device m_palette; optional_device m_rtc; - optional_region_ptr m_gfx_region1; - optional_region_ptr m_gfx_region2; - optional_region_ptr m_gfx_region3; - optional_region_ptr m_gfx_region4; - optional_region_ptr m_gfx_region5; - optional_region_ptr m_gfx_region6; - optional_region_ptr m_gfx_region7; - optional_region_ptr m_gfx_region8; + optional_region_ptr m_gfx_region1; + optional_region_ptr m_gfx_region2; + optional_region_ptr m_gfx_region3; + optional_region_ptr m_gfx_region4; + optional_region_ptr m_gfx_region5; + optional_region_ptr m_gfx_region6; + optional_region_ptr m_gfx_region7; + optional_region_ptr m_gfx_region8; memory_region * m_gfxregions[8]; // up to 8 layers, 2 images per layer (interleaved on screen) - std::unique_ptr m_pixmap[8][2]; + std::unique_ptr m_pixmap[8][2]; /* irq */ typedef void (dynax_state::*irq_func)(); // some games trigger IRQ at blitter end, some don't irq_func m_update_irq_func; - UINT8 m_sound_irq; - UINT8 m_vblank_irq; - UINT8 m_blitter_irq; - UINT8 m_blitter2_irq; - UINT8 m_soundlatch_irq; - UINT8 m_sound_vblank_irq; + uint8_t m_sound_irq; + uint8_t m_vblank_irq; + uint8_t m_blitter_irq; + uint8_t m_blitter2_irq; + uint8_t m_soundlatch_irq; + uint8_t m_sound_vblank_irq; /* blitters */ int m_blit_scroll_x; @@ -107,32 +107,32 @@ public: int m_hanamai_priority; /* input */ - UINT8 m_input_sel; - UINT8 m_dsw_sel; - UINT8 m_keyb; - UINT8 m_coins; - UINT8 m_hopper; + uint8_t m_input_sel; + uint8_t m_dsw_sel; + uint8_t m_keyb; + uint8_t m_coins; + uint8_t m_hopper; /* misc */ int m_hnoridur_bank; - UINT8 m_palette_ram[16*256*2]; + uint8_t m_palette_ram[16*256*2]; int m_palbank; int m_msm5205next; int m_resetkludge; int m_toggle; int m_toggle_cpu1; int m_yarunara_clk_toggle; - UINT8 m_soundlatch_ack; - UINT8 m_soundlatch_full; - UINT8 m_latch; + uint8_t m_soundlatch_ack; + uint8_t m_soundlatch_full; + uint8_t m_latch; int m_rombank; - UINT8 m_tenkai_p5_val; + uint8_t m_tenkai_p5_val; int m_tenkai_6c; int m_tenkai_70; - UINT8 m_gekisha_val[2]; - UINT8 m_gekisha_rom_enable; - UINT8 *m_romptr; - UINT8 *m_hnoridur_ptr; + uint8_t m_gekisha_val[2]; + uint8_t m_gekisha_rom_enable; + uint8_t *m_romptr; + uint8_t *m_hnoridur_ptr; DECLARE_WRITE8_MEMBER(dynax_vblank_ack_w); DECLARE_WRITE8_MEMBER(dynax_blitter_ack_w); @@ -160,7 +160,7 @@ public: DECLARE_WRITE8_MEMBER(hjingi_bank_w); DECLARE_WRITE8_MEMBER(hjingi_lockout_w); DECLARE_WRITE8_MEMBER(hjingi_hopper_w); - UINT8 hjingi_hopper_bit(); + uint8_t hjingi_hopper_bit(); DECLARE_READ8_MEMBER(hjingi_keyboard_0_r); DECLARE_READ8_MEMBER(hjingi_keyboard_1_r); DECLARE_WRITE8_MEMBER(yarunara_input_w); @@ -251,13 +251,13 @@ public: DECLARE_DRIVER_INIT(mayac); DECLARE_DRIVER_INIT(maya); - UINT32 screen_update_hanamai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hnoridur(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sprtmtch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mjdialq2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_jantouki_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_jantouki_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cdracula(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hanamai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hnoridur(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sprtmtch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mjdialq2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jantouki_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jantouki_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cdracula(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sprtmtch_vblank_interrupt); INTERRUPT_GEN_MEMBER(jantouki_vblank_interrupt); @@ -319,5 +319,5 @@ public: void neruton_update_irq(); void jantouki_sound_update_irq(); void tenkai_show_6c(); - void gekisha_set_rombank( UINT8 data ); + void gekisha_set_rombank( uint8_t data ); }; diff --git a/src/mame/includes/dynduke.h b/src/mame/includes/dynduke.h index dc5822346e9..d3558a73388 100644 --- a/src/mame/includes/dynduke.h +++ b/src/mame/includes/dynduke.h @@ -24,10 +24,10 @@ public: required_device m_palette; required_device m_spriteram; - required_shared_ptr m_scroll_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_back_data; - required_shared_ptr m_fore_data; + required_shared_ptr m_scroll_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_back_data; + required_shared_ptr m_fore_data; tilemap_t *m_bg_layer; tilemap_t *m_fg_layer; @@ -53,7 +53,7 @@ public: virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ); diff --git a/src/mame/includes/ec184x.h b/src/mame/includes/ec184x.h index 268fbeffe86..563161deb73 100644 --- a/src/mame/includes/ec184x.h +++ b/src/mame/includes/ec184x.h @@ -20,7 +20,7 @@ class ec1841_mb_device : public ibm5160_mb_device { public: // construction/destruction - ec1841_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ec1841_mb_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; diff --git a/src/mame/includes/einstein.h b/src/mame/includes/einstein.h index 027b2370ba3..437acdc689e 100644 --- a/src/mame/includes/einstein.h +++ b/src/mame/includes/einstein.h @@ -91,14 +91,14 @@ public: int m_ctc_trigger; /* keyboard */ - UINT8 m_keyboard_line; - UINT8 m_keyboard_data; + uint8_t m_keyboard_line; + uint8_t m_keyboard_data; /* 80 column device */ optional_device m_mc6845; optional_device m_crtc_screen; - std::unique_ptr m_crtc_ram; - UINT8 m_de; + std::unique_ptr m_crtc_ram; + uint8_t m_de; int m_centronics_busy; int m_centronics_perror; @@ -122,7 +122,7 @@ public: virtual void machine_reset() override; DECLARE_MACHINE_START(einstein2); DECLARE_MACHINE_RESET(einstein2); - UINT32 screen_update_einstein2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_einstein2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(einstein_keyboard_timer_callback); TIMER_DEVICE_CALLBACK_MEMBER(einstein_ctc_trigger_callback); DECLARE_WRITE_LINE_MEMBER(einstein_6845_de_changed); @@ -166,7 +166,7 @@ class einstein_keyboard_daisy_device : public device_t, { public: // construction/destruction - einstein_keyboard_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + einstein_keyboard_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); private: virtual void device_start() override; @@ -186,7 +186,7 @@ class einstein_adc_daisy_device : public device_t, { public: // construction/destruction - einstein_adc_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + einstein_adc_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); private: virtual void device_start() override; @@ -206,7 +206,7 @@ class einstein_fire_daisy_device : public device_t, { public: // construction/destruction - einstein_fire_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + einstein_fire_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); private: virtual void device_start() override; diff --git a/src/mame/includes/electron.h b/src/mame/includes/electron.h index 3d7ea163c42..3d2e7599cb8 100644 --- a/src/mame/includes/electron.h +++ b/src/mame/includes/electron.h @@ -34,14 +34,14 @@ struct ULA { - UINT8 interrupt_status; - UINT8 interrupt_control; - UINT8 rompage; - UINT16 screen_start; - UINT16 screen_base; + uint8_t interrupt_status; + uint8_t interrupt_control; + uint8_t rompage; + uint16_t screen_start; + uint16_t screen_base; int screen_size; - UINT16 screen_addr; - UINT8 *vram; + uint16_t screen_addr; + uint8_t *vram; int current_pal[16]; int communication_mode; int screen_mode; @@ -49,14 +49,14 @@ struct ULA int capslock_mode; // int scanline; /* tape reading related */ - UINT32 tape_value; + uint32_t tape_value; int tape_steps; int bit_count; int high_tone_set; int start_bit; int stop_bit; int tape_running; - UINT8 tape_byte; + uint8_t tape_byte; }; @@ -102,7 +102,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(electron); - UINT32 screen_update_electron(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_electron(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(electron_tape_timer_handler); TIMER_CALLBACK_MEMBER(setup_beep); TIMER_CALLBACK_MEMBER(electron_scanline_interrupt); @@ -113,8 +113,8 @@ public: required_ioport_array<14> m_keybd; required_device m_exp; required_device m_ram; - inline UINT8 read_vram( UINT16 addr ); - inline void electron_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color); + inline uint8_t read_vram( uint16_t addr ); + inline void electron_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color); void electron_interrupt_handler(int mode, int interrupt); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( electron_cart ); DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); diff --git a/src/mame/includes/elf.h b/src/mame/includes/elf.h index 750d63e7367..b75626f4ea8 100644 --- a/src/mame/includes/elf.h +++ b/src/mame/includes/elf.h @@ -64,7 +64,7 @@ public: DECLARE_QUICKLOAD_LOAD_MEMBER( elf ); // display state - UINT8 m_data; + uint8_t m_data; }; #endif diff --git a/src/mame/includes/eolith.h b/src/mame/includes/eolith.h index 3269f784949..90c44556ea0 100644 --- a/src/mame/includes/eolith.h +++ b/src/mame/includes/eolith.h @@ -41,9 +41,9 @@ public: int m_coin_counter_bit; int m_buffer; - std::unique_ptr m_vram; + std::unique_ptr m_vram; - UINT8 m_sound_data; + uint8_t m_sound_data; // speedups - see machine/eolithsp.c int m_speedup_address; @@ -79,7 +79,7 @@ public: DECLARE_MACHINE_RESET(eolith); DECLARE_VIDEO_START(eolith); - UINT32 screen_update_eolith(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_eolith(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(eolith_speedup); }; diff --git a/src/mame/includes/epos.h b/src/mame/includes/epos.h index 1f9d5ed9565..64b18788b0e 100644 --- a/src/mame/includes/epos.h +++ b/src/mame/includes/epos.h @@ -15,10 +15,10 @@ public: m_maincpu(*this, "maincpu") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* video-related */ - UINT8 m_palette; + uint8_t m_palette; /* misc */ int m_counter; @@ -30,7 +30,7 @@ public: virtual void machine_reset() override; DECLARE_MACHINE_START(epos); DECLARE_MACHINE_START(dealer); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void get_pens( pen_t *pens ); required_device m_maincpu; }; diff --git a/src/mame/includes/eprom.h b/src/mame/includes/eprom.h index 7d3cdad1aac..5798d11186c 100644 --- a/src/mame/includes/eprom.h +++ b/src/mame/includes/eprom.h @@ -28,7 +28,7 @@ public: required_device m_jsa; int m_screen_intensity; int m_video_disable; - UINT16 m_sync_data; + uint16_t m_sync_data; int m_last_offset; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; @@ -47,8 +47,8 @@ public: DECLARE_MACHINE_RESET(eprom); DECLARE_VIDEO_START(eprom); DECLARE_VIDEO_START(guts); - UINT32 screen_update_eprom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_guts(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_eprom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_guts(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void update_palette(); optional_device m_extra; required_device m_palette; diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h index e41bcb21f6e..e30699f0317 100644 --- a/src/mame/includes/equites.h +++ b/src/mame/includes/equites.h @@ -37,29 +37,29 @@ public: { } /* memory pointers */ - required_shared_ptr m_bg_videoram; - std::unique_ptr m_fg_videoram; // 8bits - required_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram_2; - optional_shared_ptr m_mcuram; + required_shared_ptr m_bg_videoram; + std::unique_ptr m_fg_videoram; // 8bits + required_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram_2; + optional_shared_ptr m_mcuram; /* video-related */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; int m_fg_char_bank; - UINT8 m_bgcolor; - UINT16 m_splndrbt_bg_scrollx; - UINT16 m_splndrbt_bg_scrolly; + uint8_t m_bgcolor; + uint16_t m_splndrbt_bg_scrollx; + uint16_t m_splndrbt_bg_scrolly; /* misc */ int m_sound_prom_address; - UINT8 m_dac_latch; - UINT8 m_eq8155_port_b; - UINT8 m_eq8155_port_a; - UINT8 m_eq8155_port_c; - UINT8 m_ay_port_a; - UINT8 m_ay_port_b; - UINT8 m_eq_cymbal_ctrl; + uint8_t m_dac_latch; + uint8_t m_eq8155_port_b; + uint8_t m_eq8155_port_a; + uint8_t m_eq8155_port_c; + uint8_t m_ay_port_a; + uint8_t m_ay_port_b; + uint8_t m_eq_cymbal_ctrl; emu_timer *m_nmi_timer; emu_timer *m_adjuster_timer; float m_cymvol; @@ -115,8 +115,8 @@ public: DECLARE_PALETTE_INIT(equites); DECLARE_VIDEO_START(splndrbt); DECLARE_PALETTE_INIT(splndrbt); - UINT32 screen_update_equites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_splndrbt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_equites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_splndrbt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(equites_nmi_callback); TIMER_CALLBACK_MEMBER(equites_frq_adjuster_callback); TIMER_DEVICE_CALLBACK_MEMBER(equites_scanline); diff --git a/src/mame/includes/esd16.h b/src/mame/includes/esd16.h index 5b381152e61..20751539fb7 100644 --- a/src/mame/includes/esd16.h +++ b/src/mame/includes/esd16.h @@ -32,14 +32,14 @@ public: {} /* memory pointers */ - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_scroll_0; - required_shared_ptr m_scroll_1; - required_shared_ptr m_spriteram; - required_shared_ptr m_head_layersize; - required_shared_ptr m_headpanic_platform_x; - required_shared_ptr m_headpanic_platform_y; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_scroll_0; + required_shared_ptr m_scroll_1; + required_shared_ptr m_spriteram; + required_shared_ptr m_head_layersize; + required_shared_ptr m_headpanic_platform_x; + required_shared_ptr m_headpanic_platform_y; /* video-related */ tilemap_t *m_tilemap_0_16x16; @@ -74,6 +74,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_hedpanic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hedpanic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECOSPR_PRIORITY_CB_MEMBER(hedpanic_pri_callback); }; diff --git a/src/mame/includes/espial.h b/src/mame/includes/espial.h index 3c12252827e..9f33c630861 100644 --- a/src/mame/includes/espial.h +++ b/src/mame/includes/espial.h @@ -27,13 +27,13 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_videoram; - required_shared_ptr m_attributeram; - required_shared_ptr m_scrollram; - required_shared_ptr m_spriteram_1; - required_shared_ptr m_spriteram_2; - required_shared_ptr m_spriteram_3; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_attributeram; + required_shared_ptr m_scrollram; + required_shared_ptr m_spriteram_1; + required_shared_ptr m_spriteram_2; + required_shared_ptr m_spriteram_3; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -41,8 +41,8 @@ public: int m_flipscreen; /* sound-related */ - UINT8 m_main_nmi_enabled; - UINT8 m_sound_nmi_enabled; + uint8_t m_main_nmi_enabled; + uint8_t m_sound_nmi_enabled; /* devices */ required_device m_maincpu; @@ -65,7 +65,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(espial); DECLARE_VIDEO_START(netwars); - UINT32 screen_update_espial(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_espial(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(espial_sound_nmi_gen); TIMER_DEVICE_CALLBACK_MEMBER(espial_scanline); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/esripsys.h b/src/mame/includes/esripsys.h index 9ff17ac03b4..f9cae07081e 100644 --- a/src/mame/includes/esripsys.h +++ b/src/mame/includes/esripsys.h @@ -25,13 +25,13 @@ #define ESRIPSYS_VBLANK_END (0) #define CMOS_RAM_SIZE (2048) -#define FDT_RAM_SIZE (2048 * sizeof(UINT16)) +#define FDT_RAM_SIZE (2048 * sizeof(uint16_t)) struct line_buffer_t { - std::unique_ptr colour_buf; - std::unique_ptr intensity_buf; - std::unique_ptr priority_buf; + std::unique_ptr colour_buf; + std::unique_ptr intensity_buf; + std::unique_ptr priority_buf; }; class esripsys_state : public driver_device @@ -54,40 +54,40 @@ public: required_device m_soundcpu; required_device m_tms; - UINT8 m_g_iodata; - UINT8 m_g_ioaddr; - UINT8 m_coin_latch; - UINT8 m_keypad_status; - UINT8 m_g_status; - UINT8 m_f_status; + uint8_t m_g_iodata; + uint8_t m_g_ioaddr; + uint8_t m_coin_latch; + uint8_t m_keypad_status; + uint8_t m_g_status; + uint8_t m_f_status; int m_io_firq_status; - UINT8 m_cmos_ram_a2_0; - UINT8 m_cmos_ram_a10_3; - std::unique_ptr m_cmos_ram; - UINT8 m_u56a; - UINT8 m_u56b; - UINT8 m_g_to_s_latch1; - UINT8 m_g_to_s_latch2; - UINT8 m_s_to_g_latch1; - UINT8 m_s_to_g_latch2; - UINT8 m_dac_msb; - UINT8 m_tms_data; - std::unique_ptr m_fdt_a; - std::unique_ptr m_fdt_b; + uint8_t m_cmos_ram_a2_0; + uint8_t m_cmos_ram_a10_3; + std::unique_ptr m_cmos_ram; + uint8_t m_u56a; + uint8_t m_u56b; + uint8_t m_g_to_s_latch1; + uint8_t m_g_to_s_latch2; + uint8_t m_s_to_g_latch1; + uint8_t m_s_to_g_latch2; + uint8_t m_dac_msb; + uint8_t m_tms_data; + std::unique_ptr m_fdt_a; + std::unique_ptr m_fdt_b; struct line_buffer_t m_line_buffer[2]; int m_fasel; int m_fbsel; int m_hblank; - required_shared_ptr m_pal_ram; + required_shared_ptr m_pal_ram; int m_frame_vbl; int m_12sel; int m_video_firq_en; emu_timer *m_hblank_end_timer; emu_timer *m_hblank_start_timer; - std::unique_ptr m_fig_scale_table; - std::unique_ptr m_scale_table; + std::unique_ptr m_fig_scale_table; + std::unique_ptr m_scale_table; int m_video_firq; - UINT8 m_bg_intensity; + uint8_t m_bg_intensity; DECLARE_WRITE8_MEMBER(uart_w); DECLARE_READ8_MEMBER(uart_r); DECLARE_READ8_MEMBER(g_status_r); @@ -117,7 +117,7 @@ public: DECLARE_WRITE8_MEMBER(esripsys_dac_w); DECLARE_DRIVER_INIT(esripsys); virtual void video_start() override; - UINT32 screen_update_esripsys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_esripsys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(esripsys_vblank_irq); TIMER_CALLBACK_MEMBER(delayed_bank_swap); TIMER_CALLBACK_MEMBER(hblank_start_callback); diff --git a/src/mame/includes/eti660.h b/src/mame/includes/eti660.h index ee2c660db4a..06bf77dbd4c 100644 --- a/src/mame/includes/eti660.h +++ b/src/mame/includes/eti660.h @@ -53,7 +53,7 @@ public: DECLARE_READ8_MEMBER( pia_pa_r ); DECLARE_WRITE8_MEMBER( pia_pa_w ); DECLARE_QUICKLOAD_LOAD_MEMBER( eti660 ); - required_shared_ptr m_p_videoram; + required_shared_ptr m_p_videoram; private: required_device m_maincpu; @@ -65,14 +65,14 @@ private: virtual void machine_start() override; virtual void machine_reset() override; - UINT16 m_resetcnt; + uint16_t m_resetcnt; /* keyboard state */ - UINT8 m_keylatch; + uint8_t m_keylatch; /* video state */ - UINT8 m_color_ram[0xc0]; - UINT8 m_color; + uint8_t m_color_ram[0xc0]; + uint8_t m_color; bool m_color_on; }; diff --git a/src/mame/includes/exedexes.h b/src/mame/includes/exedexes.h index 48d2c2cd65a..86002c6a703 100644 --- a/src/mame/includes/exedexes.h +++ b/src/mame/includes/exedexes.h @@ -25,11 +25,11 @@ public: /* memory pointers */ required_device m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_nbg_yscroll; - required_shared_ptr m_nbg_xscroll; - required_shared_ptr m_bg_scroll; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_nbg_yscroll; + required_shared_ptr m_nbg_xscroll; + required_shared_ptr m_bg_scroll; /* video-related */ tilemap_t *m_bg_tilemap; @@ -53,7 +53,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(exedexes); - UINT32 screen_update_exedexes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_exedexes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(exedexes_scanline); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); required_device m_maincpu; diff --git a/src/mame/includes/exerion.h b/src/mame/includes/exerion.h index 7bf606e2180..aab5368576f 100644 --- a/src/mame/includes/exerion.h +++ b/src/mame/includes/exerion.h @@ -34,22 +34,22 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_main_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_main_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; /* video-related */ - UINT8 m_cocktail_flip; - UINT8 m_char_palette; - UINT8 m_sprite_palette; - UINT8 m_char_bank; - std::unique_ptr m_background_gfx[4]; - UINT8 *m_background_mixer; - UINT8 m_background_latches[13]; + uint8_t m_cocktail_flip; + uint8_t m_char_palette; + uint8_t m_sprite_palette; + uint8_t m_char_bank; + std::unique_ptr m_background_gfx[4]; + uint8_t *m_background_mixer; + uint8_t m_background_latches[13]; /* protection? */ - UINT8 m_porta; - UINT8 m_portb; + uint8_t m_porta; + uint8_t m_portb; /* devices */ required_device m_maincpu; @@ -71,6 +71,6 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(exerion); - UINT32 screen_update_exerion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_exerion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/exidy.h b/src/mame/includes/exidy.h index 2f0afba69f7..fbc7037fb7b 100644 --- a/src/mame/includes/exidy.h +++ b/src/mame/includes/exidy.h @@ -58,21 +58,21 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_sprite1_xpos; - required_shared_ptr m_sprite1_ypos; - required_shared_ptr m_sprite2_xpos; - required_shared_ptr m_sprite2_ypos; - required_shared_ptr m_spriteno; - required_shared_ptr m_sprite_enable; - required_shared_ptr m_color_latch; - required_shared_ptr m_characterram; - - UINT8 m_last_dial; - UINT8 m_collision_mask; - UINT8 m_collision_invert; + required_shared_ptr m_videoram; + required_shared_ptr m_sprite1_xpos; + required_shared_ptr m_sprite1_ypos; + required_shared_ptr m_sprite2_xpos; + required_shared_ptr m_sprite2_ypos; + required_shared_ptr m_spriteno; + required_shared_ptr m_sprite_enable; + required_shared_ptr m_color_latch; + required_shared_ptr m_characterram; + + uint8_t m_last_dial; + uint8_t m_collision_mask; + uint8_t m_collision_invert; int m_is_2bpp; - UINT8 m_int_condition; + uint8_t m_int_condition; bitmap_ind16 m_background_bitmap; bitmap_ind16 m_motion_object_1_vid; bitmap_ind16 m_motion_object_2_vid; @@ -97,11 +97,11 @@ public: virtual void video_start() override; DECLARE_MACHINE_START(teetert); - UINT32 screen_update_exidy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_exidy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(exidy_vblank_interrupt); - void exidy_video_config(UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp); + void exidy_video_config(uint8_t _collision_mask, uint8_t _collision_invert, int _is_2bpp); inline void latch_condition(int collision); inline void set_1_color(int index, int which); void set_colors(); @@ -112,15 +112,15 @@ public: /* Targ and Spectar samples */ int m_max_freq; - UINT8 m_port_1_last; - UINT8 m_port_2_last; - UINT8 m_tone_freq; - UINT8 m_tone_active; - UINT8 m_tone_pointer; + uint8_t m_port_1_last; + uint8_t m_port_2_last; + uint8_t m_tone_freq; + uint8_t m_tone_active; + uint8_t m_tone_pointer; DECLARE_WRITE8_MEMBER(targ_audio_1_w); DECLARE_WRITE8_MEMBER(targ_audio_2_w); DECLARE_WRITE8_MEMBER(spectar_audio_2_w); - void adjust_sample(UINT8 freq); + void adjust_sample(uint8_t freq); void common_audio_start(int freq); SAMPLES_START_CB_MEMBER(spectar_audio_start); SAMPLES_START_CB_MEMBER(targ_audio_start); diff --git a/src/mame/includes/exidy440.h b/src/mame/includes/exidy440.h index bd14408d774..2bc62bdfbc0 100644 --- a/src/mame/includes/exidy440.h +++ b/src/mame/includes/exidy440.h @@ -24,29 +24,29 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_imageram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scanline; + required_shared_ptr m_imageram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scanline; required_device m_maincpu; required_device m_custom; required_device m_screen; required_device m_palette; - UINT8 m_bank; - const UINT8 *m_showdown_bank_data[2]; - INT8 m_showdown_bank_select; - UINT8 m_showdown_bank_offset; - UINT8 m_firq_vblank; - UINT8 m_firq_beam; - UINT8 m_topsecex_yscroll; - UINT8 m_latched_x; - std::unique_ptr m_local_videoram; - std::unique_ptr m_local_paletteram; - UINT8 m_firq_enable; - UINT8 m_firq_select; - UINT8 m_palettebank_io; - UINT8 m_palettebank_vis; + uint8_t m_bank; + const uint8_t *m_showdown_bank_data[2]; + int8_t m_showdown_bank_select; + uint8_t m_showdown_bank_offset; + uint8_t m_firq_vblank; + uint8_t m_firq_beam; + uint8_t m_topsecex_yscroll; + uint8_t m_latched_x; + std::unique_ptr m_local_videoram; + std::unique_ptr m_local_paletteram; + uint8_t m_firq_enable; + uint8_t m_firq_select; + uint8_t m_palettebank_io; + uint8_t m_palettebank_vis; DECLARE_WRITE8_MEMBER(bankram_w); DECLARE_READ8_MEMBER(exidy440_input_port_3_r); DECLARE_READ8_MEMBER(sound_command_ack_r); @@ -81,14 +81,14 @@ public: DECLARE_VIDEO_START(topsecex); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int scroll_offset, int check_collision); void update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int scroll_offset, int check_collision); - UINT32 screen_update_exidy440(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_topsecex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_exidy440(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_topsecex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(exidy440_vblank_interrupt); TIMER_CALLBACK_MEMBER(delayed_sound_command_w); TIMER_CALLBACK_MEMBER(beam_firq_callback); TIMER_CALLBACK_MEMBER(collide_firq_callback); void exidy440_update_firq(); - void exidy440_bank_select(UINT8 bank); + void exidy440_bank_select(uint8_t bank); }; /*----------- defined in video/exidy440.c -----------*/ diff --git a/src/mame/includes/exprraid.h b/src/mame/includes/exprraid.h index f75bec4b517..02d199df30c 100644 --- a/src/mame/includes/exprraid.h +++ b/src/mame/includes/exprraid.h @@ -31,13 +31,13 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_main_ram; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_main_ram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* protection */ - UINT8 m_prot_value; + uint8_t m_prot_value; /* video-related */ tilemap_t *m_bg_tilemap; @@ -73,7 +73,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); - UINT32 screen_update_exprraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_exprraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void exprraid_gfx_expand(); }; diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h index 8da912409cb..c1d8ab2944b 100644 --- a/src/mame/includes/exterm.h +++ b/src/mame/includes/exterm.h @@ -25,15 +25,15 @@ public: required_device m_audioslave; required_device m_slave; - required_shared_ptr m_master_videoram; - required_shared_ptr m_slave_videoram; + required_shared_ptr m_master_videoram; + required_shared_ptr m_slave_videoram; - UINT8 m_aimpos[2]; - UINT8 m_trackball_old[2]; - UINT8 m_master_sound_latch; - UINT8 m_slave_sound_latch; - UINT8 m_sound_control; - UINT16 m_last; + uint8_t m_aimpos[2]; + uint8_t m_trackball_old[2]; + uint8_t m_master_sound_latch; + uint8_t m_slave_sound_latch; + uint8_t m_sound_control; + uint16_t m_last; DECLARE_WRITE16_MEMBER(exterm_host_data_w); DECLARE_READ16_MEMBER(exterm_host_data_r); @@ -55,5 +55,5 @@ public: TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg_master); TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg_slave); TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg_slave); - UINT16 exterm_trackball_port_r(int which, UINT16 mem_mask); + uint16_t exterm_trackball_port_r(int which, uint16_t mem_mask); }; diff --git a/src/mame/includes/exzisus.h b/src/mame/includes/exzisus.h index 65a74141141..0f4841c23b7 100644 --- a/src/mame/includes/exzisus.h +++ b/src/mame/includes/exzisus.h @@ -19,12 +19,12 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_objectram1; - required_shared_ptr m_videoram1; - required_shared_ptr m_sharedram_ac; - required_shared_ptr m_sharedram_ab; - required_shared_ptr m_objectram0; - required_shared_ptr m_videoram0; + required_shared_ptr m_objectram1; + required_shared_ptr m_videoram1; + required_shared_ptr m_sharedram_ac; + required_shared_ptr m_sharedram_ab; + required_shared_ptr m_objectram0; + required_shared_ptr m_videoram0; DECLARE_WRITE8_MEMBER(cpua_bankswitch_w); DECLARE_WRITE8_MEMBER(cpub_bankswitch_w); @@ -33,5 +33,5 @@ public: virtual void machine_start() override; - 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); }; diff --git a/src/mame/includes/f1gp.h b/src/mame/includes/f1gp.h index 0158b778e7b..384b02b8b9f 100644 --- a/src/mame/includes/f1gp.h +++ b/src/mame/includes/f1gp.h @@ -35,22 +35,22 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_sharedram; - optional_shared_ptr m_spr1vram; - optional_shared_ptr m_spr2vram; - optional_shared_ptr m_spr1cgram; - optional_shared_ptr m_spr2cgram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_rozvideoram; - optional_shared_ptr m_sprcgram; - optional_shared_ptr m_spritelist; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_fgregs; - optional_shared_ptr m_rozregs; + required_shared_ptr m_sharedram; + optional_shared_ptr m_spr1vram; + optional_shared_ptr m_spr2vram; + optional_shared_ptr m_spr1cgram; + optional_shared_ptr m_spr2cgram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_rozvideoram; + optional_shared_ptr m_sprcgram; + optional_shared_ptr m_spritelist; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_fgregs; + optional_shared_ptr m_rozregs; optional_memory_bank m_z80bank; - UINT16 * m_zoomdata; + uint16_t * m_zoomdata; /* video-related */ tilemap_t *m_fg_tilemap; @@ -59,9 +59,9 @@ public: int m_flipscreen; int m_gfxctrl; int m_scroll[2]; - UINT32 f1gp2_tile_callback( UINT32 code ); - UINT32 f1gp_old_tile_callback( UINT32 code ); - UINT32 f1gp_ol2_tile_callback( UINT32 code ); + uint32_t f1gp2_tile_callback( uint32_t code ); + uint32_t f1gp_old_tile_callback( uint32_t code ); + uint32_t f1gp_ol2_tile_callback( uint32_t code ); /* misc */ int m_pending_command; @@ -99,8 +99,8 @@ public: DECLARE_MACHINE_START(f1gpb); DECLARE_VIDEO_START(f1gpb); DECLARE_VIDEO_START(f1gp2); - UINT32 screen_update_f1gp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_f1gpb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_f1gp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_f1gp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_f1gpb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_f1gp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void f1gpb_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect ); }; diff --git a/src/mame/includes/fantland.h b/src/mame/includes/fantland.h index c2ae4f464c8..bab9f3dc0d0 100644 --- a/src/mame/includes/fantland.h +++ b/src/mame/includes/fantland.h @@ -23,15 +23,15 @@ public: m_spriteram2(*this, "spriteram2", 0) { } /* memory pointers */ -// UINT8 * m_spriteram; // currently directly used in a 16bit map... -// UINT8 * m_spriteram_2; // currently directly used in a 16bit map... +// uint8_t * m_spriteram; // currently directly used in a 16bit map... +// uint8_t * m_spriteram_2; // currently directly used in a 16bit map... /* misc */ - UINT8 m_nmi_enable; + uint8_t m_nmi_enable; int m_old_x[2]; int m_old_y[2]; int m_old_f[2]; - UINT8 m_input_ret[2]; + uint8_t m_input_ret[2]; int m_adpcm_playing[4]; int m_adpcm_addr[2][4]; int m_adpcm_nibble[4]; @@ -48,8 +48,8 @@ public: optional_device m_msm3; optional_device m_msm4; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram2; DECLARE_WRITE_LINE_MEMBER(galaxygn_sound_irq); DECLARE_WRITE8_MEMBER(fantland_nmi_enable_w); DECLARE_WRITE16_MEMBER(fantland_nmi_enable_16_w); @@ -67,7 +67,7 @@ public: DECLARE_MACHINE_RESET(fantland); DECLARE_MACHINE_START(borntofi); DECLARE_MACHINE_RESET(borntofi); - UINT32 screen_update_fantland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fantland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(fantland_irq); INTERRUPT_GEN_MEMBER(fantland_sound_irq); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); diff --git a/src/mame/includes/fastfred.h b/src/mame/includes/fastfred.h index 4b7cdb4cbdc..a89a1a6b2ea 100644 --- a/src/mame/includes/fastfred.h +++ b/src/mame/includes/fastfred.h @@ -25,20 +25,20 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_attributesram; - optional_shared_ptr m_background_color; - optional_shared_ptr m_imago_fg_videoram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_attributesram; + optional_shared_ptr m_background_color; + optional_shared_ptr m_imago_fg_videoram; int m_hardware_type; - UINT16 m_charbank; - UINT8 m_colorbank; - UINT8 m_nmi_mask; - UINT8 m_sound_nmi_mask; - UINT8 m_imago_sprites[0x800*3]; - UINT16 m_imago_sprites_address; - UINT8 m_imago_sprites_bank; + uint16_t m_charbank; + uint8_t m_colorbank; + uint8_t m_nmi_mask; + uint8_t m_sound_nmi_mask; + uint8_t m_imago_sprites[0x800*3]; + uint16_t m_imago_sprites_address; + uint8_t m_imago_sprites_bank; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -88,7 +88,7 @@ public: DECLARE_VIDEO_START(fastfred); DECLARE_VIDEO_START(imago); - UINT32 screen_update_fastfred(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_imago(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fastfred(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_imago(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/fastlane.h b/src/mame/includes/fastlane.h index d6c7fe0ac79..ee381a61431 100644 --- a/src/mame/includes/fastlane.h +++ b/src/mame/includes/fastlane.h @@ -29,10 +29,10 @@ public: required_device m_maincpu; /* memory pointers */ - required_shared_ptr m_k007121_regs; - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; - required_shared_ptr m_spriteram; + required_shared_ptr m_k007121_regs; + required_shared_ptr m_videoram1; + required_shared_ptr m_videoram2; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_layer0; @@ -61,7 +61,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(fastlane); - UINT32 screen_update_fastlane(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fastlane(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(fastlane_scanline); DECLARE_WRITE8_MEMBER(volume_callback0); DECLARE_WRITE8_MEMBER(volume_callback1); diff --git a/src/mame/includes/fcombat.h b/src/mame/includes/fcombat.h index 53f1c49e5be..60fd8ddadf6 100644 --- a/src/mame/includes/fcombat.h +++ b/src/mame/includes/fcombat.h @@ -36,15 +36,15 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bgmap; - UINT8 m_cocktail_flip; - UINT8 m_char_palette; - UINT8 m_sprite_palette; - UINT8 m_char_bank; + uint8_t m_cocktail_flip; + uint8_t m_char_palette; + uint8_t m_sprite_palette; + uint8_t m_char_bank; /* misc */ int m_fcombat_sh; @@ -74,5 +74,5 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(fcombat); - UINT32 screen_update_fcombat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fcombat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/fgoal.h b/src/mame/includes/fgoal.h index 3271bc56f2d..427e281b05c 100644 --- a/src/mame/includes/fgoal.h +++ b/src/mame/includes/fgoal.h @@ -27,19 +27,19 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; /* video-related */ bitmap_ind16 m_bgbitmap; bitmap_ind16 m_fgbitmap; - UINT8 m_xpos; - UINT8 m_ypos; + uint8_t m_xpos; + uint8_t m_ypos; int m_current_color; /* misc */ int m_player; - UINT8 m_row; - UINT8 m_col; + uint8_t m_row; + uint8_t m_col; int m_prev_coin; emu_timer *m_interrupt_timer; @@ -68,7 +68,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(fgoal); - 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); int intensity(int bits); unsigned video_ram_address( ); diff --git a/src/mame/includes/fidelz80.h b/src/mame/includes/fidelz80.h index 6c540310715..5889c0f3b6d 100644 --- a/src/mame/includes/fidelz80.h +++ b/src/mame/includes/fidelz80.h @@ -34,19 +34,19 @@ public: required_device m_maincpu; optional_ioport_array<11> m_inp_matrix; // max 11 optional_device m_speech; - optional_region_ptr m_speech_rom; + optional_region_ptr m_speech_rom; optional_device m_dac; optional_device m_cart; // misc common - UINT16 m_inp_mux; // multiplexed keypad/leds mask - UINT16 m_led_select; - UINT16 m_7seg_data; // data for seg leds - UINT16 m_led_data; - UINT8 m_speech_data; - UINT8 m_speech_bank; // speech rom higher address bits + uint16_t m_inp_mux; // multiplexed keypad/leds mask + uint16_t m_led_select; + uint16_t m_7seg_data; // data for seg leds + uint16_t m_led_data; + uint8_t m_speech_data; + uint8_t m_speech_bank; // speech rom higher address bits - UINT16 read_inputs(int columns); + uint16_t read_inputs(int columns); DECLARE_DEVICE_IMAGE_LOAD_MEMBER(scc_cartridge); // display common @@ -54,16 +54,16 @@ public: int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 31 for now) - UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) + uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + uint32_t m_display_cache[0x20]; // (internal use) + uint8_t m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); void set_display_size(int maxx, int maxy); - void set_display_segmask(UINT32 digits, UINT32 mask); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true); + void set_display_segmask(uint32_t digits, uint32_t mask); + void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true); protected: virtual void machine_start() override; diff --git a/src/mame/includes/finalizr.h b/src/mame/includes/finalizr.h index 08d765c428e..533da2736a9 100644 --- a/src/mame/includes/finalizr.h +++ b/src/mame/includes/finalizr.h @@ -31,13 +31,13 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_scroll; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram2; - required_shared_ptr m_videoram2; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram_2; + required_shared_ptr m_scroll; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram2; + required_shared_ptr m_videoram2; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram_2; /* video-related */ tilemap_t *m_fg_tilemap; @@ -47,8 +47,8 @@ public: /* misc */ int m_T1_line; - UINT8 m_nmi_enable; - UINT8 m_irq_enable; + uint8_t m_nmi_enable; + uint8_t m_irq_enable; DECLARE_WRITE8_MEMBER(finalizr_coin_w); DECLARE_WRITE8_MEMBER(finalizr_flipscreen_w); @@ -64,6 +64,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(finalizr); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_finalizr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_finalizr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(finalizr_scanline); }; diff --git a/src/mame/includes/firetrap.h b/src/mame/includes/firetrap.h index 296825a3517..142caa1a2de 100644 --- a/src/mame/includes/firetrap.h +++ b/src/mame/includes/firetrap.h @@ -26,19 +26,19 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_bg1videoram; - required_shared_ptr m_bg2videoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_bg1videoram; + required_shared_ptr m_bg2videoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg1_tilemap; tilemap_t *m_bg2_tilemap; - UINT8 m_scroll1_x[2]; - UINT8 m_scroll1_y[2]; - UINT8 m_scroll2_x[2]; - UINT8 m_scroll2_y[2]; + uint8_t m_scroll1_x[2]; + uint8_t m_scroll1_y[2]; + uint8_t m_scroll2_x[2]; + uint8_t m_scroll2_y[2]; /* misc */ int m_sound_irq_enable; @@ -85,9 +85,9 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(firetrap); - UINT32 screen_update_firetrap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_firetrap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(firetrap_irq); - inline void get_bg_tile_info(tile_data &tileinfo, int tile_index, UINT8 *bgvideoram, int gfx_region); + inline void get_bg_tile_info(tile_data &tileinfo, int tile_index, uint8_t *bgvideoram, int gfx_region); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); DECLARE_WRITE_LINE_MEMBER(firetrap_adpcm_int); }; diff --git a/src/mame/includes/firetrk.h b/src/mame/includes/firetrk.h index 317f4648c77..27f6c20aaac 100644 --- a/src/mame/includes/firetrk.h +++ b/src/mame/includes/firetrk.h @@ -63,15 +63,15 @@ public: required_device m_maincpu; required_device m_watchdog; required_device m_discrete; - required_shared_ptr m_alpha_num_ram; - required_shared_ptr m_playfield_ram; - required_shared_ptr m_scroll_y; - required_shared_ptr m_scroll_x; - required_shared_ptr m_car_rot; - optional_shared_ptr m_blink; - optional_shared_ptr m_drone_x; - optional_shared_ptr m_drone_y; - optional_shared_ptr m_drone_rot; + required_shared_ptr m_alpha_num_ram; + required_shared_ptr m_playfield_ram; + required_shared_ptr m_scroll_y; + required_shared_ptr m_scroll_x; + required_shared_ptr m_car_rot; + optional_shared_ptr m_blink; + optional_shared_ptr m_drone_x; + optional_shared_ptr m_drone_y; + optional_shared_ptr m_drone_rot; required_device m_gfxdecode; required_device m_screen; required_device m_palette; @@ -82,19 +82,19 @@ public: required_ioport_array<2> m_dips; optional_ioport_array<2> m_steer; - UINT8 m_in_service_mode; - UINT32 m_dial[2]; - UINT8 m_steer_dir[2]; - UINT8 m_steer_flag[2]; - UINT8 m_gear; + uint8_t m_in_service_mode; + uint32_t m_dial[2]; + uint8_t m_steer_dir[2]; + uint8_t m_steer_flag[2]; + uint8_t m_gear; - UINT8 m_flash; - UINT8 m_crash[2]; - UINT8 m_skid[2]; + uint8_t m_flash; + uint8_t m_crash[2]; + uint8_t m_skid[2]; bitmap_ind16 m_helper1; bitmap_ind16 m_helper2; - UINT32 m_color1_mask; - UINT32 m_color2_mask; + uint32_t m_color1_mask; + uint32_t m_color2_mask; tilemap_t *m_tilemap1; tilemap_t *m_tilemap2; @@ -131,9 +131,9 @@ public: DECLARE_VIDEO_START(superbug); DECLARE_VIDEO_START(montecar); DECLARE_PALETTE_INIT(montecar); - UINT32 screen_update_firetrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_superbug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_montecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_firetrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_superbug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_montecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(firetrk_scanline); DECLARE_WRITE8_MEMBER(firetrk_skid_reset_w); DECLARE_WRITE8_MEMBER(montecar_skid_reset_w); @@ -142,13 +142,13 @@ public: DECLARE_WRITE8_MEMBER(firetrk_motor_snd_w); DECLARE_WRITE8_MEMBER(superbug_motor_snd_w); DECLARE_WRITE8_MEMBER(firetrk_xtndply_w); - void prom_to_palette(int number, UINT8 val); + void prom_to_palette(int number, uint8_t val); void firetrk_draw_car(bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int flash); void superbug_draw_car(bitmap_ind16 &bitmap, const rectangle &cliprect, int flash); void montecar_draw_car(bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int is_collision_detection); void check_collision(int which); void set_service_mode(int enable); - void draw_text(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *alpha_ram, int x, int count, int height); + void draw_text(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *alpha_ram, int x, int count, int height); }; diff --git a/src/mame/includes/fitfight.h b/src/mame/includes/fitfight.h index ccae2455504..827d90b3072 100644 --- a/src/mame/includes/fitfight.h +++ b/src/mame/includes/fitfight.h @@ -21,16 +21,16 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_fof_100000; - required_shared_ptr m_fof_600000; - required_shared_ptr m_fof_700000; - required_shared_ptr m_fof_800000; - required_shared_ptr m_fof_900000; - required_shared_ptr m_fof_a00000; - required_shared_ptr m_fof_bak_tileram; - required_shared_ptr m_fof_mid_tileram; - required_shared_ptr m_fof_txt_tileram; - required_shared_ptr m_spriteram; + required_shared_ptr m_fof_100000; + required_shared_ptr m_fof_600000; + required_shared_ptr m_fof_700000; + required_shared_ptr m_fof_800000; + required_shared_ptr m_fof_900000; + required_shared_ptr m_fof_a00000; + required_shared_ptr m_fof_bak_tileram; + required_shared_ptr m_fof_mid_tileram; + required_shared_ptr m_fof_txt_tileram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_fof_bak_tilemap; @@ -39,7 +39,7 @@ public: /* misc */ int m_bbprot_kludge; - UINT16 m_fof_700000_data; + uint16_t m_fof_700000_data; DECLARE_READ16_MEMBER(fitfight_700000_r); DECLARE_READ16_MEMBER(histryma_700000_r); DECLARE_READ16_MEMBER(bbprot_700000_r); @@ -65,7 +65,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_fitfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fitfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(snd_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer ); required_device m_maincpu; diff --git a/src/mame/includes/flkatck.h b/src/mame/includes/flkatck.h index 90f04e1334e..db23afff746 100644 --- a/src/mame/includes/flkatck.h +++ b/src/mame/includes/flkatck.h @@ -26,7 +26,7 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_k007121_ram; + required_shared_ptr m_k007121_ram; /* video-related */ tilemap_t *m_k007121_tilemap[2]; @@ -57,7 +57,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_flkatck(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_flkatck(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(flkatck_interrupt); DECLARE_WRITE8_MEMBER(volume_callback); }; diff --git a/src/mame/includes/flstory.h b/src/mame/includes/flstory.h index 7637e018390..a64e59db53d 100644 --- a/src/mame/includes/flstory.h +++ b/src/mame/includes/flstory.h @@ -22,44 +22,44 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scrlram; - optional_shared_ptr m_workram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scrlram; + optional_shared_ptr m_workram; /* video-related */ tilemap_t *m_bg_tilemap; - std::vector m_paletteram; - std::vector m_paletteram_ext; - UINT8 m_gfxctrl; - UINT8 m_char_bank; - UINT8 m_palette_bank; + std::vector m_paletteram; + std::vector m_paletteram_ext; + uint8_t m_gfxctrl; + uint8_t m_char_bank; + uint8_t m_palette_bank; /* sound-related */ - UINT8 m_snd_data; - UINT8 m_snd_flag; + uint8_t m_snd_data; + uint8_t m_snd_flag; int m_sound_nmi_enable; int m_pending_nmi; int m_vol_ctrl[16]; - UINT8 m_snd_ctrl0; - UINT8 m_snd_ctrl1; - UINT8 m_snd_ctrl2; - UINT8 m_snd_ctrl3; + uint8_t m_snd_ctrl0; + uint8_t m_snd_ctrl1; + uint8_t m_snd_ctrl2; + uint8_t m_snd_ctrl3; /* protection */ - UINT8 m_from_main; - UINT8 m_from_mcu; + uint8_t m_from_main; + uint8_t m_from_mcu; int m_mcu_sent; int m_main_sent; - 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_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; int m_mcu_select; /* devices */ @@ -72,15 +72,15 @@ public: required_device m_soundlatch; /* mcu */ - UINT8 m_mcu_cmd; - UINT8 m_mcu_counter; - UINT8 m_mcu_b4_cmd; - UINT8 m_mcu_param; - UINT8 m_mcu_b2_res; - UINT8 m_mcu_b1_res; - UINT8 m_mcu_bb_res; - UINT8 m_mcu_b5_res; - UINT8 m_mcu_b6_res; + uint8_t m_mcu_cmd; + uint8_t m_mcu_counter; + uint8_t m_mcu_b4_cmd; + uint8_t m_mcu_param; + uint8_t m_mcu_b2_res; + uint8_t m_mcu_b1_res; + uint8_t m_mcu_bb_res; + uint8_t m_mcu_b5_res; + uint8_t m_mcu_b6_res; DECLARE_READ8_MEMBER(from_snd_r); DECLARE_READ8_MEMBER(snd_flag_r); DECLARE_WRITE8_MEMBER(to_main_w); @@ -129,9 +129,9 @@ public: DECLARE_MACHINE_RESET(rumba); DECLARE_VIDEO_START(rumba); DECLARE_MACHINE_RESET(ta7630); - UINT32 screen_update_flstory(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_victnine(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_rumba(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_flstory(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_victnine(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rumba(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(nmi_callback); void flstory_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ); void victnine_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/fm7.h b/src/mame/includes/fm7.h index 929733ecce6..49631341e7e 100644 --- a/src/mame/includes/fm7.h +++ b/src/mame/includes/fm7.h @@ -42,66 +42,66 @@ struct fm7_encoder_t { - UINT8 buffer[12]; - UINT8 tx_count; - UINT8 rx_count; - UINT8 command_length; - UINT8 answer_length; - UINT8 latch; // 0=ready to receive - UINT8 ack; - UINT8 position; + uint8_t buffer[12]; + uint8_t tx_count; + uint8_t rx_count; + uint8_t command_length; + uint8_t answer_length; + uint8_t latch; // 0=ready to receive + uint8_t ack; + uint8_t position; }; struct fm7_mmr_t { - UINT8 bank_addr[8][16]; - UINT8 segment; - UINT8 window_offset; - UINT8 enabled; - UINT8 mode; + uint8_t bank_addr[8][16]; + uint8_t segment; + uint8_t window_offset; + uint8_t enabled; + uint8_t mode; }; struct fm7_video_t { - UINT8 sub_busy; - UINT8 sub_halt; - UINT8 sub_reset; // high if reset caused by subrom change - UINT8 attn_irq; - UINT8 vram_access; // VRAM access flag - UINT8 crt_enable; - UINT16 vram_offset; - UINT16 vram_offset2; - UINT8 fm7_pal[8]; - UINT16 fm77av_pal_selected; - UINT8 subrom; // currently active sub CPU ROM (AV only) - UINT8 cgrom; // currently active CGROM (AV only) - UINT8 modestatus; - UINT8 multi_page; - UINT8 fine_offset; - UINT8 nmi_mask; - UINT8 active_video_page; - UINT8 display_video_page; - UINT8 vsync_flag; + uint8_t sub_busy; + uint8_t sub_halt; + uint8_t sub_reset; // high if reset caused by subrom change + uint8_t attn_irq; + uint8_t vram_access; // VRAM access flag + uint8_t crt_enable; + uint16_t vram_offset; + uint16_t vram_offset2; + uint8_t fm7_pal[8]; + uint16_t fm77av_pal_selected; + uint8_t subrom; // currently active sub CPU ROM (AV only) + uint8_t cgrom; // currently active CGROM (AV only) + uint8_t modestatus; + uint8_t multi_page; + uint8_t fine_offset; + uint8_t nmi_mask; + uint8_t active_video_page; + uint8_t display_video_page; + uint8_t vsync_flag; }; struct fm7_alu_t { - UINT8 command; - UINT8 lcolour; - UINT8 mask; - UINT8 compare_data; - UINT8 compare[8]; - UINT8 bank_disable; - UINT8 tilepaint_b; - UINT8 tilepaint_r; - UINT8 tilepaint_g; - UINT16 addr_offset; - UINT16 line_style; - UINT16 x0; - UINT16 x1; - UINT16 y0; - UINT16 y1; - UINT8 busy; + uint8_t command; + uint8_t lcolour; + uint8_t mask; + uint8_t compare_data; + uint8_t compare[8]; + uint8_t bank_disable; + uint8_t tilepaint_b; + uint8_t tilepaint_r; + uint8_t tilepaint_g; + uint16_t addr_offset; + uint16_t line_style; + uint16_t x0; + uint16_t x1; + uint16_t y0; + uint16_t y1; + uint8_t busy; }; @@ -276,47 +276,47 @@ public: DECLARE_WRITE_LINE_MEMBER(write_centronics_ack); DECLARE_WRITE_LINE_MEMBER(write_centronics_perror); - UINT32 screen_update_fm7(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fm7(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); protected: - optional_shared_ptr m_shared_ram; - optional_shared_ptr m_boot_ram; + optional_shared_ptr m_shared_ram; + optional_shared_ptr m_boot_ram; - UINT8 m_irq_flags; - UINT8 m_irq_mask; + uint8_t m_irq_flags; + uint8_t m_irq_mask; emu_timer* m_timer; emu_timer* m_subtimer; emu_timer* m_keyboard_timer; - UINT8 m_basic_rom_en; - UINT8 m_init_rom_en; + uint8_t m_basic_rom_en; + uint8_t m_init_rom_en; unsigned int m_key_delay; unsigned int m_key_repeat; - UINT16 m_current_scancode; - UINT32 m_key_data[4]; - UINT32 m_mod_data; - UINT8 m_key_scan_mode; - UINT8 m_break_flag; + uint16_t m_current_scancode; + uint32_t m_key_data[4]; + uint32_t m_mod_data; + uint8_t m_key_scan_mode; + uint8_t m_break_flag; - UINT8 m_psg_regsel; - UINT8 m_psg_data; + uint8_t m_psg_regsel; + uint8_t m_psg_data; - UINT8 m_fdc_side; - UINT8 m_fdc_drive; - UINT8 m_fdc_irq_flag; - UINT8 m_fdc_drq_flag; + uint8_t m_fdc_side; + uint8_t m_fdc_drive; + uint8_t m_fdc_irq_flag; + uint8_t m_fdc_drq_flag; - UINT8 m_fm77av_ym_irq; - UINT8 m_speaker_active; + uint8_t m_fm77av_ym_irq; + uint8_t m_speaker_active; - UINT16 m_kanji_address; + uint16_t m_kanji_address; fm7_encoder_t m_encoder; fm7_mmr_t m_mmr; - UINT8 m_cp_prev; + uint8_t m_cp_prev; - std::unique_ptr m_video_ram; + std::unique_ptr m_video_ram; emu_timer* m_fm77av_vsync_timer; - UINT8 m_type; + uint8_t m_type; fm7_video_t m_video; fm7_alu_t m_alu; int m_sb_prev; @@ -347,28 +347,28 @@ protected: required_device m_floppy1; floppy_image_device *m_floppy; - optional_region_ptr m_ram_ptr; - optional_region_ptr m_rom_ptr; - optional_region_ptr m_basic_ptr; - - void fm7_alu_mask_write(UINT32 offset, int bank, UINT8 dat); - void fm7_alu_function_compare(UINT32 offset); - void fm7_alu_function_pset(UINT32 offset); - void fm7_alu_function_or(UINT32 offset); - void fm7_alu_function_and(UINT32 offset); - void fm7_alu_function_xor(UINT32 offset); - void fm7_alu_function_not(UINT32 offset); - void fm7_alu_function_invalid(UINT32 offset); - void fm7_alu_function_tilepaint(UINT32 offset); - void fm7_alu_function(UINT32 offset); - UINT32 fm7_line_set_pixel(int x, int y); + optional_region_ptr m_ram_ptr; + optional_region_ptr m_rom_ptr; + optional_region_ptr m_basic_ptr; + + void fm7_alu_mask_write(uint32_t offset, int bank, uint8_t dat); + void fm7_alu_function_compare(uint32_t offset); + void fm7_alu_function_pset(uint32_t offset); + void fm7_alu_function_or(uint32_t offset); + void fm7_alu_function_and(uint32_t offset); + void fm7_alu_function_xor(uint32_t offset); + void fm7_alu_function_not(uint32_t offset); + void fm7_alu_function_invalid(uint32_t offset); + void fm7_alu_function_tilepaint(uint32_t offset); + void fm7_alu_function(uint32_t offset); + uint32_t fm7_line_set_pixel(int x, int y); void fm77av_line_draw(); - void main_irq_set_flag(UINT8 flag); - void main_irq_clear_flag(UINT8 flag); + void main_irq_set_flag(uint8_t flag); + void main_irq_clear_flag(uint8_t flag); void fm7_update_psg(); - void fm7_update_bank(address_space & space, int bank, UINT8 physical); + void fm7_update_bank(address_space & space, int bank, uint8_t physical); void fm7_mmr_refresh(address_space& space); - void key_press(UINT16 scancode); + void key_press(uint16_t scancode); void fm7_keyboard_poll_scan(); int m_centronics_busy; diff --git a/src/mame/includes/fmtowns.h b/src/mame/includes/fmtowns.h index 37ef8f284ad..b973b9655e0 100644 --- a/src/mame/includes/fmtowns.h +++ b/src/mame/includes/fmtowns.h @@ -25,53 +25,53 @@ struct towns_cdrom_controller { - UINT8 command; - UINT8 status; - UINT8 cmd_status[4]; - UINT8 cmd_status_ptr; - UINT8 extra_status; - UINT8 parameter[8]; - UINT8 mpu_irq_enable; - UINT8 dma_irq_enable; - UINT8 buffer[2048]; - INT32 buffer_ptr; - UINT32 lba_current; - UINT32 lba_last; - UINT32 cdda_current; - UINT32 cdda_length; + uint8_t command; + uint8_t status; + uint8_t cmd_status[4]; + uint8_t cmd_status_ptr; + uint8_t extra_status; + uint8_t parameter[8]; + uint8_t mpu_irq_enable; + uint8_t dma_irq_enable; + uint8_t buffer[2048]; + int32_t buffer_ptr; + uint32_t lba_current; + uint32_t lba_last; + uint32_t cdda_current; + uint32_t cdda_length; bool software_tx; emu_timer* read_timer; }; struct towns_video_controller { - UINT8 towns_vram_wplane; - UINT8 towns_vram_rplane; - UINT8 towns_vram_page_sel; - UINT8 towns_palette_select; - UINT8 towns_palette_r[256]; - UINT8 towns_palette_g[256]; - UINT8 towns_palette_b[256]; - UINT8 towns_degipal[8]; - UINT8 towns_dpmd_flag; - UINT8 towns_crtc_mix; - UINT8 towns_crtc_sel; // selected CRTC register - UINT16 towns_crtc_reg[32]; - UINT8 towns_video_sel; // selected video register - UINT8 towns_video_reg[2]; - UINT8 towns_sprite_sel; // selected sprite register - UINT8 towns_sprite_reg[8]; - UINT8 towns_sprite_flag; // sprite drawing flag - UINT8 towns_sprite_page; // VRAM page (not layer) sprites are drawn to - UINT8 towns_tvram_enable; - UINT16 towns_kanji_offset; - UINT8 towns_kanji_code_h; - UINT8 towns_kanji_code_l; + uint8_t towns_vram_wplane; + uint8_t towns_vram_rplane; + uint8_t towns_vram_page_sel; + uint8_t towns_palette_select; + uint8_t towns_palette_r[256]; + uint8_t towns_palette_g[256]; + uint8_t towns_palette_b[256]; + uint8_t towns_degipal[8]; + uint8_t towns_dpmd_flag; + uint8_t towns_crtc_mix; + uint8_t towns_crtc_sel; // selected CRTC register + uint16_t towns_crtc_reg[32]; + uint8_t towns_video_sel; // selected video register + uint8_t towns_video_reg[2]; + uint8_t towns_sprite_sel; // selected sprite register + uint8_t towns_sprite_reg[8]; + uint8_t towns_sprite_flag; // sprite drawing flag + uint8_t towns_sprite_page; // VRAM page (not layer) sprites are drawn to + uint8_t towns_tvram_enable; + uint16_t towns_kanji_offset; + uint8_t towns_kanji_code_h; + uint8_t towns_kanji_code_l; rectangle towns_crtc_layerscr[2]; // each layer has independent sizes - UINT8 towns_display_plane; - UINT8 towns_display_page_sel; - UINT8 towns_vblank_flag; - UINT8 towns_layer_ctrl; + uint8_t towns_display_plane; + uint8_t towns_display_page_sel; + uint8_t towns_vblank_flag; + uint8_t towns_layer_ctrl; emu_timer* sprite_timer; }; @@ -129,59 +129,59 @@ class towns_state : public driver_device cdda_device* m_cdda; class fmscsi_device* m_scsi; - UINT16 m_ftimer; - UINT16 m_freerun_timer; + uint16_t m_ftimer; + uint16_t m_freerun_timer; emu_timer* m_towns_freerun_counter; - UINT16 m_intervaltimer2_period; - UINT8 m_intervaltimer2_irqmask; - UINT8 m_intervaltimer2_timeout_flag; - UINT8 m_intervaltimer2_timeout_flag2; + uint16_t m_intervaltimer2_period; + uint8_t m_intervaltimer2_irqmask; + uint8_t m_intervaltimer2_timeout_flag; + uint8_t m_intervaltimer2_timeout_flag2; emu_timer* m_towns_intervaltimer2; - UINT8 m_nmi_mask; - UINT8 m_compat_mode; - UINT8 m_towns_system_port; - UINT32 m_towns_ankcg_enable; - UINT32 m_towns_mainmem_enable; - UINT32 m_towns_ram_enable; - std::unique_ptr m_towns_vram; - std::unique_ptr m_towns_gfxvram; - std::unique_ptr m_towns_txtvram; + uint8_t m_nmi_mask; + uint8_t m_compat_mode; + uint8_t m_towns_system_port; + uint32_t m_towns_ankcg_enable; + uint32_t m_towns_mainmem_enable; + uint32_t m_towns_ram_enable; + std::unique_ptr m_towns_vram; + std::unique_ptr m_towns_gfxvram; + std::unique_ptr m_towns_txtvram; int m_towns_selected_drive; - UINT8 m_towns_fdc_irq6mask; - std::unique_ptr m_towns_serial_rom; + uint8_t m_towns_fdc_irq6mask; + std::unique_ptr m_towns_serial_rom; int m_towns_srom_position; - UINT8 m_towns_srom_clk; - UINT8 m_towns_srom_reset; - UINT8 m_towns_rtc_select; - UINT8 m_towns_rtc_data; - UINT8 m_towns_rtc_reg[16]; + uint8_t m_towns_srom_clk; + uint8_t m_towns_srom_reset; + uint8_t m_towns_rtc_select; + uint8_t m_towns_rtc_data; + uint8_t m_towns_rtc_reg[16]; emu_timer* m_towns_rtc_timer; - UINT8 m_towns_timer_mask; - UINT16 m_towns_machine_id; // default is 0x0101 - UINT8 m_towns_kb_status; - UINT8 m_towns_kb_irq1_enable; - UINT8 m_towns_kb_output; // key output - UINT8 m_towns_kb_extend; // extended key output + uint8_t m_towns_timer_mask; + uint16_t m_towns_machine_id; // default is 0x0101 + uint8_t m_towns_kb_status; + uint8_t m_towns_kb_irq1_enable; + uint8_t m_towns_kb_output; // key output + uint8_t m_towns_kb_extend; // extended key output emu_timer* m_towns_kb_timer; emu_timer* m_towns_mouse_timer; - UINT8 m_towns_fm_irq_flag; - UINT8 m_towns_pcm_irq_flag; - UINT8 m_towns_pcm_channel_flag; - UINT8 m_towns_pcm_channel_mask; - UINT8 m_towns_pad_mask; - UINT8 m_towns_mouse_output; - UINT8 m_towns_mouse_x; - UINT8 m_towns_mouse_y; - UINT8 m_towns_volume[8]; // volume ports - UINT8 m_towns_volume_select; - UINT8 m_towns_scsi_control; - UINT8 m_towns_scsi_status; - UINT8 m_towns_spkrdata; - UINT8 m_pit_out0; - UINT8 m_pit_out1; - UINT8 m_pit_out2; - UINT8 m_timer0; - UINT8 m_timer1; + uint8_t m_towns_fm_irq_flag; + uint8_t m_towns_pcm_irq_flag; + uint8_t m_towns_pcm_channel_flag; + uint8_t m_towns_pcm_channel_mask; + uint8_t m_towns_pad_mask; + uint8_t m_towns_mouse_output; + uint8_t m_towns_mouse_x; + uint8_t m_towns_mouse_y; + uint8_t m_towns_volume[8]; // volume ports + uint8_t m_towns_volume_select; + uint8_t m_towns_scsi_control; + uint8_t m_towns_scsi_status; + uint8_t m_towns_spkrdata; + uint8_t m_pit_out0; + uint8_t m_pit_out1; + uint8_t m_pit_out2; + uint8_t m_timer0; + uint8_t m_timer1; emu_timer* m_towns_wait_timer; emu_timer* m_towns_status_timer; @@ -189,19 +189,19 @@ class towns_state : public driver_device struct towns_cdrom_controller m_towns_cd; struct towns_video_controller m_video; - UINT32 m_kb_prev[4]; - UINT8 m_prev_pad_mask; - UINT8 m_prev_x; - UINT8 m_prev_y; + uint32_t m_kb_prev[4]; + uint8_t m_prev_pad_mask; + uint8_t m_prev_x; + uint8_t m_prev_y; - optional_shared_ptr m_nvram; - optional_shared_ptr m_nvram16; + optional_shared_ptr m_nvram; + optional_shared_ptr m_nvram16; virtual void driver_start() override; virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; DECLARE_READ8_MEMBER(towns_system_r); @@ -274,10 +274,10 @@ class towns_state : public driver_device void towns_update_video_banks(address_space&); void init_serial_rom(); void init_rtc(); - void kb_sendcode(UINT8 scancode, int release); - UINT8 speaker_get_spk(); - void speaker_set_spkrdata(UINT8 data); - UINT8 towns_cdrom_read_byte_software(); + void kb_sendcode(uint8_t scancode, int release); + uint8_t speaker_get_spk(); + void speaker_set_spkrdata(uint8_t data); + uint8_t towns_cdrom_read_byte_software(); required_ioport m_ctrltype; required_ioport_array<4> m_kb_ports; @@ -310,7 +310,7 @@ private: void poll_keyboard(); void mouse_timeout(); void wait_end(); - void towns_cd_set_status(UINT8 st0, UINT8 st1, UINT8 st2, UINT8 st3); + void towns_cd_set_status(uint8_t st0, uint8_t st1, uint8_t st2, uint8_t st3); void towns_cdrom_execute_command(cdrom_image_device* device); void towns_cdrom_play_cdda(cdrom_image_device* device); void towns_cdrom_read(cdrom_image_device* device); @@ -331,22 +331,22 @@ public: void towns_crtc_refresh_mode(); void towns_update_kanji_offset(); void towns_update_palette(); - void render_sprite_4(UINT32 poffset, UINT32 coffset, UINT16 x, UINT16 y, UINT16 xflip, UINT16 yflip, const rectangle* rect); - void render_sprite_16(UINT32 poffset, UINT16 x, UINT16 y, UINT16 xflip, UINT16 yflip, const rectangle* rect); + void render_sprite_4(uint32_t poffset, uint32_t coffset, uint16_t x, uint16_t y, uint16_t xflip, uint16_t yflip, const rectangle* rect); + void render_sprite_16(uint32_t poffset, uint16_t x, uint16_t y, uint16_t xflip, uint16_t yflip, const rectangle* rect); void draw_sprites(const rectangle* rect); void towns_crtc_draw_scan_layer_hicolour(bitmap_rgb32 &bitmap,const rectangle* rect,int layer,int line,int scanline); void towns_crtc_draw_scan_layer_256(bitmap_rgb32 &bitmap,const rectangle* rect,int layer,int line,int scanline); void towns_crtc_draw_scan_layer_16(bitmap_rgb32 &bitmap,const rectangle* rect,int layer,int line,int scanline); void towns_crtc_draw_layer(bitmap_rgb32 &bitmap,const rectangle* rect,int layer); - void render_text_char(UINT8 x, UINT8 y, UINT8 ascii, UINT16 jis, UINT8 attr); + void render_text_char(uint8_t x, uint8_t y, uint8_t ascii, uint16_t jis, uint8_t attr); void draw_text_layer(); - inline UINT8 byte_to_bcd(UINT8 val); - inline UINT8 bcd_to_byte(UINT8 val); - inline UINT32 msf_to_lbafm(UINT32 val); // because the CDROM core doesn't provide this; + inline uint8_t byte_to_bcd(uint8_t val); + inline uint8_t bcd_to_byte(uint8_t val); + inline uint32_t msf_to_lbafm(uint32_t val); // because the CDROM core doesn't provide this; DECLARE_READ16_MEMBER(towns_fdc_dma_r); DECLARE_WRITE16_MEMBER(towns_fdc_dma_w); void towns_cdrom_set_irq(int line,int state); - UINT8 towns_cd_get_track(); + uint8_t towns_cd_get_track(); DECLARE_READ16_MEMBER(towns_cdrom_dma_r); void rtc_hour(); void rtc_minute(); diff --git a/src/mame/includes/foodf.h b/src/mame/includes/foodf.h index 286427b43c8..4bf30770d7f 100644 --- a/src/mame/includes/foodf.h +++ b/src/mame/includes/foodf.h @@ -24,10 +24,10 @@ public: double m_rweights[3]; double m_gweights[3]; double m_bweights[2]; - UINT8 m_playfield_flip; + uint8_t m_playfield_flip; - UINT8 m_whichport; - required_shared_ptr m_spriteram; + uint8_t m_whichport; + required_shared_ptr m_spriteram; virtual void update_interrupts() override; DECLARE_WRITE16_MEMBER(nvram_recall_w); DECLARE_WRITE8_MEMBER(digital_w); @@ -40,6 +40,6 @@ public: DECLARE_MACHINE_START(foodf); DECLARE_MACHINE_RESET(foodf); DECLARE_VIDEO_START(foodf); - UINT32 screen_update_foodf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_foodf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline_update_timer); }; diff --git a/src/mame/includes/freekick.h b/src/mame/includes/freekick.h index d310cfc895f..c71635c923b 100644 --- a/src/mame/includes/freekick.h +++ b/src/mame/includes/freekick.h @@ -16,8 +16,8 @@ public: m_bank1d(*this, "bank1d") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_freek_tilemap; @@ -56,9 +56,9 @@ public: DECLARE_MACHINE_START(freekick); DECLARE_MACHINE_START(oigas); DECLARE_MACHINE_RESET(oigas); - UINT32 screen_update_pbillrd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_freekick(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gigas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pbillrd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_freekick(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gigas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(freekick_irqgen); void gigas_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void pbillrd_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/fromanc2.h b/src/mame/includes/fromanc2.h index 870a2404a2f..6e4c1e3c69e 100644 --- a/src/mame/includes/fromanc2.h +++ b/src/mame/includes/fromanc2.h @@ -20,8 +20,8 @@ public: m_soundlatch2(*this, "soundlatch2") { } /* memory pointers */ - std::unique_ptr m_videoram[2][4]; - std::unique_ptr m_bankedram; + std::unique_ptr m_videoram[2][4]; + std::unique_ptr m_bankedram; /* video-related */ tilemap_t *m_tilemap[2][4]; @@ -31,12 +31,12 @@ public: /* misc */ int m_portselect; - UINT8 m_subcpu_int_flag; - UINT8 m_subcpu_nmi_flag; - UINT8 m_sndcpu_nmi_flag; - UINT16 m_datalatch1; - UINT8 m_datalatch_2h; - UINT8 m_datalatch_2l; + uint8_t m_subcpu_int_flag; + uint8_t m_subcpu_nmi_flag; + uint8_t m_sndcpu_nmi_flag; + uint16_t m_datalatch1; + uint8_t m_datalatch_2h; + uint8_t m_datalatch_2l; /* devices */ required_device m_maincpu; @@ -108,13 +108,13 @@ public: DECLARE_VIDEO_START(fromancr); DECLARE_MACHINE_START(fromanc4); DECLARE_VIDEO_START(fromanc4); - UINT32 screen_update_fromanc2_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_fromanc2_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fromanc2_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fromanc2_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(fromanc2_interrupt); inline void fromanc2_get_tile_info( tile_data &tileinfo, int tile_index, int vram, int layer ); inline void fromancr_get_tile_info( tile_data &tileinfo, int tile_index, int vram, int layer ); - inline void fromanc2_dispvram_w( offs_t offset, UINT16 data, UINT16 mem_mask, int vram, int layer ); - inline void fromancr_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int layer ); + inline void fromanc2_dispvram_w( offs_t offset, uint16_t data, uint16_t mem_mask, int vram, int layer ); + inline void fromancr_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask, int layer ); void fromancr_gfxbank_w( int data ); - inline void fromanc4_vram_w( offs_t offset, UINT16 data, UINT16 mem_mask, int layer ); + inline void fromanc4_vram_w( offs_t offset, uint16_t data, uint16_t mem_mask, int layer ); }; diff --git a/src/mame/includes/fromance.h b/src/mame/includes/fromance.h index d8562d4deb9..0960aff05bb 100644 --- a/src/mame/includes/fromance.h +++ b/src/mame/includes/fromance.h @@ -27,39 +27,39 @@ public: m_palette(*this, "palette") { } /* memory pointers (used by pipedrm) */ - optional_shared_ptr m_videoram; - optional_shared_ptr m_spriteram; + optional_shared_ptr m_videoram; + optional_shared_ptr m_spriteram; optional_device m_spr_old; // only used by pipe dream, split this state up and clean things... /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - std::unique_ptr m_local_videoram[2]; - std::unique_ptr m_local_paletteram; - UINT8 m_selected_videoram; - UINT8 m_selected_paletteram; - UINT32 m_scrollx[2]; - UINT32 m_scrolly[2]; - UINT8 m_gfxreg; - UINT8 m_flipscreen; - UINT8 m_flipscreen_old; - UINT32 m_scrolly_ofs; - UINT32 m_scrollx_ofs; + std::unique_ptr m_local_videoram[2]; + std::unique_ptr m_local_paletteram; + uint8_t m_selected_videoram; + uint8_t m_selected_paletteram; + uint32_t m_scrollx[2]; + uint32_t m_scrolly[2]; + uint8_t m_gfxreg; + uint8_t m_flipscreen; + uint8_t m_flipscreen_old; + uint32_t m_scrolly_ofs; + uint32_t m_scrollx_ofs; - UINT8 m_crtc_register; - UINT8 m_crtc_data[0x10]; + uint8_t m_crtc_register; + uint8_t m_crtc_data[0x10]; emu_timer *m_crtc_timer; /* misc */ - UINT8 m_directionflag; - UINT8 m_commanddata; - UINT8 m_portselect; - UINT8 m_adpcm_reset; - UINT8 m_adpcm_data; - UINT8 m_vclk_left; - UINT8 m_pending_command; - UINT8 m_sound_command; + uint8_t m_directionflag; + uint8_t m_commanddata; + uint8_t m_portselect; + uint8_t m_adpcm_reset; + uint8_t m_adpcm_data; + uint8_t m_vclk_left; + uint8_t m_pending_command; + uint8_t m_sound_command; /* devices */ required_device m_subcpu; @@ -92,8 +92,8 @@ public: DECLARE_VIDEO_START(fromance); DECLARE_VIDEO_START(pipedrm); DECLARE_VIDEO_START(hatris); - UINT32 screen_update_fromance(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pipedrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fromance(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pipedrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(deferred_commanddata_w); TIMER_CALLBACK_MEMBER(crtc_interrupt_gen); inline void get_fromance_tile_info( tile_data &tileinfo, int tile_index, int layer ); diff --git a/src/mame/includes/funkybee.h b/src/mame/includes/funkybee.h index 74047db5211..169fc2a69fe 100644 --- a/src/mame/includes/funkybee.h +++ b/src/mame/includes/funkybee.h @@ -17,8 +17,8 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -36,7 +36,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(funkybee); - UINT32 screen_update_funkybee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_funkybee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_columns( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; diff --git a/src/mame/includes/funkyjet.h b/src/mame/includes/funkyjet.h index ce8c0294554..002cf05de61 100644 --- a/src/mame/includes/funkyjet.h +++ b/src/mame/includes/funkyjet.h @@ -27,10 +27,10 @@ public: { } /* memory pointers */ - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; optional_device m_deco146; - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; optional_device m_sprgen; /* devices */ @@ -39,7 +39,7 @@ public: required_device m_deco_tilegen1; DECLARE_DRIVER_INIT(funkyjet); virtual void machine_start() override; - UINT32 screen_update_funkyjet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_funkyjet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER( funkyjet_protection_region_0_146_r ); DECLARE_WRITE16_MEMBER( funkyjet_protection_region_0_146_w ); diff --git a/src/mame/includes/funworld.h b/src/mame/includes/funworld.h index ebc3c2df912..301b1eedeee 100644 --- a/src/mame/includes/funworld.h +++ b/src/mame/includes/funworld.h @@ -11,8 +11,8 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; DECLARE_READ8_MEMBER(questions_r); DECLARE_WRITE8_MEMBER(question_bank_w); @@ -43,7 +43,7 @@ public: DECLARE_VIDEO_START(chinatow); DECLARE_MACHINE_START(lunapark); DECLARE_MACHINE_RESET(lunapark); - UINT32 screen_update_funworld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_funworld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; diff --git a/src/mame/includes/funybubl.h b/src/mame/includes/funybubl.h index e073a69d688..09bf23d0cc1 100644 --- a/src/mame/includes/funybubl.h +++ b/src/mame/includes/funybubl.h @@ -18,7 +18,7 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_paletteram; + required_shared_ptr m_paletteram; /* devices */ required_device m_maincpu; @@ -29,7 +29,7 @@ public: required_device m_soundlatch; /* memory */ - UINT8 m_banked_vram[0x2000]; + uint8_t m_banked_vram[0x2000]; DECLARE_WRITE8_MEMBER(funybubl_vidram_bank_w); DECLARE_WRITE8_MEMBER(funybubl_cpurombank_w); DECLARE_WRITE8_MEMBER(funybubl_soundcommand_w); @@ -37,6 +37,6 @@ public: DECLARE_WRITE8_MEMBER(funybubl_oki_bank_sw); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_funybubl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_funybubl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/fuukifg2.h b/src/mame/includes/fuukifg2.h index 5a1a6ff9a02..daea6190458 100644 --- a/src/mame/includes/fuukifg2.h +++ b/src/mame/includes/fuukifg2.h @@ -42,10 +42,10 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr_array m_vram; - required_shared_ptr m_vregs; - required_shared_ptr m_unknown; - required_shared_ptr m_priority; + required_shared_ptr_array m_vram; + required_shared_ptr m_vregs; + required_shared_ptr m_unknown; + required_shared_ptr m_priority; /* video-related */ tilemap_t *m_tilemap[4]; @@ -73,9 +73,9 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); inline void get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_); - inline void vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _N_); + inline void vram_w(offs_t offset, uint16_t data, uint16_t mem_mask, int _N_); void draw_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri ); protected: diff --git a/src/mame/includes/fuukifg3.h b/src/mame/includes/fuukifg3.h index af16b939df4..206c61596b8 100644 --- a/src/mame/includes/fuukifg3.h +++ b/src/mame/includes/fuukifg3.h @@ -42,22 +42,22 @@ public: required_device m_fuukivid; /* memory pointers */ - required_shared_ptr_array m_vram; - required_shared_ptr m_vregs; - required_shared_ptr m_priority; - required_shared_ptr m_tilebank; - //UINT32 * m_buf_spriteram; - //UINT32 * m_buf_spriteram2; + required_shared_ptr_array m_vram; + required_shared_ptr m_vregs; + required_shared_ptr m_priority; + required_shared_ptr m_tilebank; + //uint32_t * m_buf_spriteram; + //uint32_t * m_buf_spriteram2; /* video-related */ tilemap_t *m_tilemap[4]; - UINT32 m_spr_buffered_tilebank[2]; + uint32_t m_spr_buffered_tilebank[2]; /* misc */ emu_timer *m_level_1_interrupt_timer; emu_timer *m_vblank_interrupt_timer; emu_timer *m_raster_interrupt_timer; - UINT8 m_shared_ram[16]; + uint8_t m_shared_ram[16]; DECLARE_READ32_MEMBER(snd_020_r); DECLARE_WRITE32_MEMBER(snd_020_w); @@ -80,11 +80,11 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); void screen_eof(screen_device &screen, bool state); inline void get_tile_info8bpp(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_); inline void get_tile_info4bpp(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_); - inline void vram_w(offs_t offset, UINT32 data, UINT32 mem_mask, int _N_); + inline void vram_w(offs_t offset, uint32_t data, uint32_t mem_mask, int _N_); void draw_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri ); protected: diff --git a/src/mame/includes/gaelco.h b/src/mame/includes/gaelco.h index 2bfd7d4829f..2f558fe82d3 100644 --- a/src/mame/includes/gaelco.h +++ b/src/mame/includes/gaelco.h @@ -31,10 +31,10 @@ public: optional_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_vregs; - required_shared_ptr m_spriteram; - optional_shared_ptr m_screenram; + required_shared_ptr m_videoram; + required_shared_ptr m_vregs; + required_shared_ptr m_spriteram; + optional_shared_ptr m_screenram; /* video-related */ tilemap_t *m_tilemap[2]; @@ -55,7 +55,7 @@ public: DECLARE_VIDEO_START(bigkarnk); DECLARE_VIDEO_START(maniacsq); - UINT32 screen_update_bigkarnk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_maniacsq(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bigkarnk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_maniacsq(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/gaelco2.h b/src/mame/includes/gaelco2.h index 5bd2e9a54cc..78e572cdd7f 100644 --- a/src/mame/includes/gaelco2.h +++ b/src/mame/includes/gaelco2.h @@ -22,20 +22,20 @@ public: required_device m_maincpu; required_device m_spriteram; - required_shared_ptr m_vregs; - optional_shared_ptr m_snowboar_protection; + required_shared_ptr m_vregs; + optional_shared_ptr m_snowboar_protection; optional_device m_eeprom; required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_generic_paletteram_16; - optional_shared_ptr m_shareram; + required_shared_ptr m_generic_paletteram_16; + optional_shared_ptr m_shareram; - UINT32 snowboard_latch; + uint32_t snowboard_latch; - UINT16 *m_videoram; + uint16_t *m_videoram; tilemap_t *m_pant[2]; int m_dual_monitor; @@ -60,14 +60,14 @@ public: TILE_GET_INFO_MEMBER(get_tile_info_gaelco2_screen1_dual); DECLARE_VIDEO_START(gaelco2); DECLARE_VIDEO_START(gaelco2_dual); - UINT32 screen_update_gaelco2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gaelco2_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gaelco2_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gaelco2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gaelco2_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gaelco2_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE16_MEMBER(gaelco2_eeprom_cs_w); DECLARE_WRITE16_MEMBER(gaelco2_eeprom_sk_w); DECLARE_WRITE16_MEMBER(gaelco2_eeprom_data_w); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int mask, int xoffs); - UINT32 dual_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int index); + uint32_t dual_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int index); void gaelco2_ROM16_split_gfx(const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2); }; @@ -112,7 +112,7 @@ public: required_ioport m_analog0; required_ioport m_analog1; - UINT8 m_analog_ports[2]; + uint8_t m_analog_ports[2]; DECLARE_WRITE16_MEMBER(wrally2_coin_w); DECLARE_WRITE16_MEMBER(wrally2_adc_clk); diff --git a/src/mame/includes/gaelco3d.h b/src/mame/includes/gaelco3d.h index 6d735bd96fc..a0ef4eb7a38 100644 --- a/src/mame/includes/gaelco3d.h +++ b/src/mame/includes/gaelco3d.h @@ -18,7 +18,7 @@ struct gaelco3d_object_data { - UINT32 tex, color; + uint32_t tex, color; float ooz_dx, ooz_dy, ooz_base; float uoz_dx, uoz_dy, uoz_base; float voz_dx, voz_dy, voz_base; @@ -33,23 +33,23 @@ public: gaelco3d_renderer(gaelco3d_state &state); bitmap_ind16 &screenbits() { return m_screenbits; } - UINT32 polygons() { UINT32 result = m_polygons; m_polygons = 0; return result; } + uint32_t polygons() { uint32_t result = m_polygons; m_polygons = 0; return result; } - void render_poly(screen_device &screen, UINT32 *polydata); + void render_poly(screen_device &screen, uint32_t *polydata); private: gaelco3d_state &m_state; bitmap_ind16 m_screenbits; bitmap_ind16 m_zbuffer; - UINT32 m_polygons; + uint32_t m_polygons; offs_t m_texture_size; offs_t m_texmask_size; - std::unique_ptr m_texture; - std::unique_ptr m_texmask; + std::unique_ptr m_texture; + std::unique_ptr m_texmask; - void render_noz_noperspective(INT32 scanline, const extent_t &extent, const gaelco3d_object_data &extra, int threadid); - void render_normal(INT32 scanline, const extent_t &extent, const gaelco3d_object_data &extra, int threadid); - void render_alphablend(INT32 scanline, const extent_t &extent, const gaelco3d_object_data &extra, int threadid); + void render_noz_noperspective(int32_t scanline, const extent_t &extent, const gaelco3d_object_data &extra, int threadid); + void render_normal(int32_t scanline, const extent_t &extent, const gaelco3d_object_data &extra, int threadid); + void render_alphablend(int32_t scanline, const extent_t &extent, const gaelco3d_object_data &extra, int threadid); }; class gaelco3d_state : public driver_device @@ -73,35 +73,35 @@ public: m_analog(*this, {"ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3"}) { } - required_shared_ptr m_adsp_ram_base; - required_shared_ptr m_m68k_ram_base; - required_shared_ptr m_tms_comm_base; - required_shared_ptr m_adsp_control_regs; - required_shared_ptr m_adsp_fastram_base; + required_shared_ptr m_adsp_ram_base; + required_shared_ptr m_m68k_ram_base; + required_shared_ptr m_tms_comm_base; + required_shared_ptr m_adsp_control_regs; + required_shared_ptr m_adsp_fastram_base; required_device m_maincpu; required_device m_adsp; required_device m_eeprom; required_device m_tms; required_device m_serial; required_device m_screen; - optional_shared_ptr m_paletteram16; - optional_shared_ptr m_paletteram32; + optional_shared_ptr m_paletteram16; + optional_shared_ptr m_paletteram32; optional_ioport_array<4> m_analog; - UINT16 m_sound_data; - UINT8 m_sound_status; + uint16_t m_sound_data; + uint8_t m_sound_status; offs_t m_tms_offset_xor; - UINT8 m_analog_ports[4]; - UINT8 m_framenum; + uint8_t m_analog_ports[4]; + uint8_t m_framenum; timer_device *m_adsp_autobuffer_timer; - UINT8 m_adsp_ireg; + uint8_t m_adsp_ireg; offs_t m_adsp_ireg_base; offs_t m_adsp_incs; offs_t m_adsp_size; dmadac_sound_device *m_dmadac[SOUND_CHANNELS]; std::unique_ptr m_palette; - std::unique_ptr m_polydata_buffer; - UINT32 m_polydata_count; + std::unique_ptr m_polydata_buffer; + uint32_t m_polydata_count; int m_lastscan; int m_video_changed; std::unique_ptr m_poly; @@ -141,7 +141,7 @@ public: virtual void video_start() override; DECLARE_MACHINE_RESET(gaelco3d2); DECLARE_MACHINE_RESET(common); - UINT32 screen_update_gaelco3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gaelco3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_gen); TIMER_CALLBACK_MEMBER(delayed_sound_w); TIMER_DEVICE_CALLBACK_MEMBER(adsp_autobuffer_irq); diff --git a/src/mame/includes/gaelcrpt.h b/src/mame/includes/gaelcrpt.h index 31fd467e1f2..50e39896a29 100644 --- a/src/mame/includes/gaelcrpt.h +++ b/src/mame/includes/gaelcrpt.h @@ -2,4 +2,4 @@ // copyright-holders:Manuel Abadia /*----------- defined in machine/gaelcrpt.c -----------*/ -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); diff --git a/src/mame/includes/gaiden.h b/src/mame/includes/gaiden.h index b9dffc53e7d..42f21e31e3a 100644 --- a/src/mame/includes/gaiden.h +++ b/src/mame/includes/gaiden.h @@ -31,10 +31,10 @@ public: { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_videoram3; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_videoram3; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_text_layer; @@ -43,16 +43,16 @@ public: bitmap_ind16 m_sprite_bitmap; bitmap_ind16 m_tile_bitmap_bg; bitmap_ind16 m_tile_bitmap_fg; - UINT16 m_tx_scroll_x; - UINT16 m_tx_scroll_y; - UINT16 m_bg_scroll_x; - UINT16 m_bg_scroll_y; - UINT16 m_fg_scroll_x; - UINT16 m_fg_scroll_y; - INT8 m_tx_offset_y; - INT8 m_bg_offset_y; - INT8 m_fg_offset_y; - INT8 m_spr_offset_y; + uint16_t m_tx_scroll_x; + uint16_t m_tx_scroll_y; + uint16_t m_bg_scroll_x; + uint16_t m_bg_scroll_y; + uint16_t m_fg_scroll_x; + uint16_t m_fg_scroll_y; + int8_t m_tx_offset_y; + int8_t m_bg_offset_y; + int8_t m_fg_offset_y; + int8_t m_spr_offset_y; /* misc */ int m_sprite_sizey; @@ -105,10 +105,10 @@ public: DECLARE_VIDEO_START(gaiden); DECLARE_VIDEO_START(drgnbowl); DECLARE_VIDEO_START(raiga); - UINT32 screen_update_gaiden(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_drgnbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_raiga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gaiden(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_drgnbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_raiga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void drgnbowl_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void descramble_drgnbowl(int descramble_cpu); - void descramble_mastninj_gfx(UINT8* src); + void descramble_mastninj_gfx(uint8_t* src); }; diff --git a/src/mame/includes/galaga.h b/src/mame/includes/galaga.h index 7c5f753ca84..c09789d229e 100644 --- a/src/mame/includes/galaga.h +++ b/src/mame/includes/galaga.h @@ -23,11 +23,11 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - optional_shared_ptr m_videoram; - optional_shared_ptr m_galaga_ram1; - optional_shared_ptr m_galaga_ram2; - optional_shared_ptr m_galaga_ram3; - optional_shared_ptr m_galaga_starcontrol; // 6 addresses + optional_shared_ptr m_videoram; + optional_shared_ptr m_galaga_ram1; + optional_shared_ptr m_galaga_ram2; + optional_shared_ptr m_galaga_ram3; + optional_shared_ptr m_galaga_starcontrol; // 6 addresses required_device m_maincpu; required_device m_subcpu; required_device m_subcpu2; @@ -36,13 +36,13 @@ public: required_device m_screen; required_device m_palette; emu_timer *m_cpu3_interrupt_timer; - UINT8 m_custom_mod; + uint8_t m_custom_mod; /* machine state */ - UINT32 m_stars_scrollx; - UINT32 m_stars_scrolly; + uint32_t m_stars_scrollx; + uint32_t m_stars_scrolly; - UINT32 m_galaga_gfxbank; // used by catsbee + uint32_t m_galaga_gfxbank; // used by catsbee /* devices */ @@ -52,9 +52,9 @@ public: tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT8 m_main_irq_mask; - UINT8 m_sub_irq_mask; - UINT8 m_sub2_nmi_mask; + uint8_t m_main_irq_mask; + uint8_t m_sub_irq_mask; + uint8_t m_sub2_nmi_mask; DECLARE_READ8_MEMBER(bosco_dsw_r); DECLARE_WRITE8_MEMBER(galaga_flip_screen_w); DECLARE_WRITE8_MEMBER(bosco_latch_w); @@ -73,7 +73,7 @@ public: DECLARE_MACHINE_RESET(galaga); DECLARE_VIDEO_START(galaga); DECLARE_PALETTE_INIT(galaga); - UINT32 screen_update_galaga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galaga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_galaga(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(main_vblank_irq); INTERRUPT_GEN_MEMBER(sub_vblank_irq); @@ -83,8 +83,8 @@ public: void bosco_latch_reset(); struct star { - UINT16 x,y; - UINT8 col,set; + uint16_t x,y; + uint8_t col,set; }; static struct star m_star_seed_tab[]; diff --git a/src/mame/includes/galastrm.h b/src/mame/includes/galastrm.h index d34e1c91ce9..2a19deee35b 100644 --- a/src/mame/includes/galastrm.h +++ b/src/mame/includes/galastrm.h @@ -20,7 +20,7 @@ class galastrm_renderer : public poly_manager public: galastrm_renderer(galastrm_state &state); - void tc0610_draw_scanline(INT32 scanline, const extent_t& extent, const gs_poly_data& object, int threadid); + void tc0610_draw_scanline(int32_t scanline, const extent_t& extent, const gs_poly_data& object, int threadid); void tc0610_rotate_draw(bitmap_ind16 &srcbitmap, const rectangle &clip); bitmap_ind16 &screenbits() { return m_screenbits; } @@ -62,8 +62,8 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_ram; - required_shared_ptr m_spriteram; + required_shared_ptr m_ram; + required_shared_ptr m_spriteram; required_device m_maincpu; required_device m_eeprom; @@ -74,13 +74,13 @@ public: required_device m_screen; required_device m_palette; - UINT16 m_coin_word; - UINT16 m_frame_counter; + uint16_t m_coin_word; + uint16_t m_frame_counter; int m_tc0110pcr_addr; int m_tc0610_0_addr; int m_tc0610_1_addr; - UINT32 m_mem[2]; - INT16 m_tc0610_ctrl_reg[2][8]; + uint32_t m_mem[2]; + int16_t m_tc0610_ctrl_reg[2][8]; std::unique_ptr m_spritelist; struct gs_tempsprite *m_sprite_ptr_pre; bitmap_ind16 m_tmpbitmaps; @@ -100,7 +100,7 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(frame_counter_r); DECLARE_CUSTOM_INPUT_MEMBER(coin_word_r); virtual void video_start() override; - UINT32 screen_update_galastrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galastrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(galastrm_interrupt); void draw_sprites_pre(int x_offs, int y_offs); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, const int *primasks, int priority); diff --git a/src/mame/includes/galaxia.h b/src/mame/includes/galaxia.h index a582157d5df..d5491c35547 100644 --- a/src/mame/includes/galaxia.h +++ b/src/mame/includes/galaxia.h @@ -29,8 +29,8 @@ public: DECLARE_PALETTE_INIT(galaxia); DECLARE_VIDEO_START(astrowar); DECLARE_PALETTE_INIT(astrowar); - UINT32 screen_update_galaxia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_astrowar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galaxia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_astrowar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(galaxia_interrupt); void init_common(); }; diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h index ee742054c19..4dfdc1ded65 100644 --- a/src/mame/includes/galaxian.h +++ b/src/mame/includes/galaxian.h @@ -81,34 +81,34 @@ public: optional_ioport m_fake_select; optional_ioport_array<10> m_tenspot_game_dsw; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + optional_shared_ptr m_decrypted_opcodes; int m_bullets_base; int m_sprites_base; int m_numspritegens; int m_counter_74ls161[2]; int m_direction[2]; - UINT8 m_gmgalax_selected_game; - UINT8 m_zigzag_ay8910_latch; - UINT8 m_kingball_speech_dip; - UINT8 m_kingball_sound; - UINT8 m_mshuttle_ay8910_cs; - UINT16 m_protection_state; - UINT8 m_protection_result; - UINT8 m_konami_sound_control; - UINT8 m_sfx_sample_control; - UINT8 m_moonwar_port_select; - UINT8 m_irq_enabled; + uint8_t m_gmgalax_selected_game; + uint8_t m_zigzag_ay8910_latch; + uint8_t m_kingball_speech_dip; + uint8_t m_kingball_sound; + uint8_t m_mshuttle_ay8910_cs; + uint16_t m_protection_state; + uint8_t m_protection_result; + uint8_t m_konami_sound_control; + uint8_t m_sfx_sample_control; + uint8_t m_moonwar_port_select; + uint8_t m_irq_enabled; int m_irq_line; int m_tenspot_current_game; - UINT8 m_frogger_adjust; - UINT8 m_sfx_tilemap; + uint8_t m_frogger_adjust; + uint8_t m_sfx_tilemap; /* video extension callbacks */ - typedef void (galaxian_state::*galaxian_extend_tile_info_func)(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - typedef void (galaxian_state::*galaxian_extend_sprite_info_func)(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); + typedef void (galaxian_state::*galaxian_extend_tile_info_func)(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + typedef void (galaxian_state::*galaxian_extend_sprite_info_func)(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); typedef void (galaxian_state::*galaxian_draw_bullet_func)(bitmap_rgb32 &bitmap, const rectangle &cliprect, int offs, int x, int y); typedef void (galaxian_state::*galaxian_draw_background_func)(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -118,20 +118,20 @@ public: galaxian_draw_background_func m_draw_background_ptr; tilemap_t *m_bg_tilemap; - UINT8 m_flipscreen_x; - UINT8 m_flipscreen_y; - UINT8 m_background_enable; - UINT8 m_background_red; - UINT8 m_background_green; - UINT8 m_background_blue; - UINT32 m_star_rng_origin; - UINT32 m_star_rng_origin_frame; + uint8_t m_flipscreen_x; + uint8_t m_flipscreen_y; + uint8_t m_background_enable; + uint8_t m_background_red; + uint8_t m_background_green; + uint8_t m_background_blue; + uint32_t m_star_rng_origin; + uint32_t m_star_rng_origin_frame; rgb_t m_star_color[64]; - std::unique_ptr m_stars; - UINT8 m_stars_enabled; - UINT8 m_stars_blink_state; + std::unique_ptr m_stars; + uint8_t m_stars_enabled; + uint8_t m_stars_blink_state; rgb_t m_bullet_color[8]; - UINT8 m_gfxbank[5]; + uint8_t m_gfxbank[5]; DECLARE_WRITE8_MEMBER(galaxian_videoram_w); DECLARE_WRITE8_MEMBER(galaxian_objram_w); DECLARE_WRITE8_MEMBER(galaxian_flip_screen_x_w); @@ -273,18 +273,18 @@ public: DECLARE_PALETTE_INIT(galaxian); DECLARE_PALETTE_INIT(moonwar); void tenspot_set_game_bank(int bank, int from_game); - UINT32 screen_update_galaxian(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galaxian(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(interrupt_gen); INTERRUPT_GEN_MEMBER(fakechange_interrupt_gen); TIMER_DEVICE_CALLBACK_MEMBER(checkmaj_irq0_gen); TIMER_DEVICE_CALLBACK_MEMBER(galaxian_stars_blink_timer); TIMER_DEVICE_CALLBACK_MEMBER(timefgtr_scanline); void state_save_register(); - void sprites_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, const UINT8 *spritebase); - void bullets_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, const UINT8 *base); + void sprites_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, const uint8_t *spritebase); + void bullets_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, const uint8_t *base); void stars_init(); void stars_update_origin(); - void stars_draw_row(bitmap_rgb32 &bitmap, int maxx, int y, UINT32 star_offs, UINT8 starmask); + void stars_draw_row(bitmap_rgb32 &bitmap, int maxx, int y, uint32_t star_offs, uint8_t starmask); void galaxian_draw_background(bitmap_rgb32 &bitmap, const rectangle &cliprect); void background_draw_colorsplit(bitmap_rgb32 &bitmap, const rectangle &cliprect, rgb_t color, int split, int split_flipped); void scramble_draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect, int maxx); @@ -299,26 +299,26 @@ public: void mshuttle_draw_bullet(bitmap_rgb32 &bitmap, const rectangle &cliprect, int offs, int x, int y); void scramble_draw_bullet(bitmap_rgb32 &bitmap, const rectangle &cliprect, int offs, int x, int y); void theend_draw_bullet(bitmap_rgb32 &bitmap, const rectangle &cliprect, int offs, int x, int y); - void upper_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - void upper_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); - void frogger_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - void frogger_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); - void gmgalax_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - void gmgalax_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); - void pisces_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - void pisces_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); - void batman2_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - void mooncrst_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - void mooncrst_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); - void moonqsr_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - void moonqsr_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); - void mshuttle_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - void mshuttle_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); - void calipso_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); - void jumpbug_extend_tile_info(UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); - void jumpbug_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); + void upper_extend_tile_info(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + void upper_extend_sprite_info(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); + void frogger_extend_tile_info(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + void frogger_extend_sprite_info(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); + void gmgalax_extend_tile_info(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + void gmgalax_extend_sprite_info(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); + void pisces_extend_tile_info(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + void pisces_extend_sprite_info(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); + void batman2_extend_tile_info(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + void mooncrst_extend_tile_info(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + void mooncrst_extend_sprite_info(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); + void moonqsr_extend_tile_info(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + void moonqsr_extend_sprite_info(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); + void mshuttle_extend_tile_info(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + void mshuttle_extend_sprite_info(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); + void calipso_extend_sprite_info(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); + void jumpbug_extend_tile_info(uint16_t *code, uint8_t *color, uint8_t attrib, uint8_t x); + void jumpbug_extend_sprite_info(const uint8_t *base, uint8_t *sx, uint8_t *sy, uint8_t *flipx, uint8_t *flipy, uint16_t *code, uint8_t *color); void monsterz_set_latch(); - void decode_mooncrst(int length, UINT8 *dest); + void decode_mooncrst(int length, uint8_t *dest); void decode_checkman(); void decode_dingoe(); void decode_frogger_sound(); @@ -328,7 +328,7 @@ public: void decode_losttomb_gfx(); void decode_superbon(); void unmap_galaxian_sound(offs_t base); - void mshuttle_decode(const UINT8 convtable[8][16]); + void mshuttle_decode(const uint8_t convtable[8][16]); void common_init(galaxian_draw_bullet_func draw_bullet,galaxian_draw_background_func draw_background, galaxian_extend_tile_info_func extend_tile_info,galaxian_extend_sprite_info_func extend_sprite_info); }; diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h index 6159915b451..392125396f4 100644 --- a/src/mame/includes/galaxold.h +++ b/src/mame/includes/galaxold.h @@ -57,43 +57,43 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; - required_shared_ptr m_attributesram; - optional_shared_ptr m_bulletsram; - optional_shared_ptr m_rockclim_videoram; - optional_shared_ptr m_racknrol_tiles_bank; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram2; + required_shared_ptr m_attributesram; + optional_shared_ptr m_bulletsram; + optional_shared_ptr m_rockclim_videoram; + optional_shared_ptr m_racknrol_tiles_bank; int m_irq_line; - UINT8 m__4in1_bank; + uint8_t m__4in1_bank; tilemap_t *m_bg_tilemap; tilemap_t *m_rockclim_tilemap; int m_spriteram2_present; - UINT8 m_gfxbank[5]; - UINT8 m_flipscreen_x; - UINT8 m_flipscreen_y; - UINT8 m_color_mask; + uint8_t m_gfxbank[5]; + uint8_t m_flipscreen_x; + uint8_t m_flipscreen_y; + uint8_t m_color_mask; tilemap_t *m_dambustr_tilemap2; - std::unique_ptr m_dambustr_videoram2; + std::unique_ptr m_dambustr_videoram2; int m_leftclip; - void (galaxold_state::*m_modify_charcode)(UINT16 *code, UINT8 x); /* function to call to do character banking */ - void (galaxold_state::*m_modify_spritecode)(UINT8 *spriteram, int*, int*, int*, int); /* function to call to do sprite banking */ - void (galaxold_state::*m_modify_color)(UINT8 *color); /* function to call to do modify how the color codes map to the PROM */ - void (galaxold_state::*m_modify_ypos)(UINT8*); /* function to call to do modify how vertical positioning bits are connected */ + void (galaxold_state::*m_modify_charcode)(uint16_t *code, uint8_t x); /* function to call to do character banking */ + void (galaxold_state::*m_modify_spritecode)(uint8_t *spriteram, int*, int*, int*, int); /* function to call to do sprite banking */ + void (galaxold_state::*m_modify_color)(uint8_t *color); /* function to call to do modify how the color codes map to the PROM */ + void (galaxold_state::*m_modify_ypos)(uint8_t*); /* function to call to do modify how vertical positioning bits are connected */ - UINT8 m_timer_adjusted; - UINT8 m_darkplnt_bullet_color; + uint8_t m_timer_adjusted; + uint8_t m_darkplnt_bullet_color; void (galaxold_state::*m_draw_bullets)(bitmap_ind16 &,const rectangle &, int, int, int); /* function to call to draw a bullet */ - UINT8 m_background_enable; - UINT8 m_background_red; - UINT8 m_background_green; - UINT8 m_background_blue; + uint8_t m_background_enable; + uint8_t m_background_red; + uint8_t m_background_green; + uint8_t m_background_blue; void (galaxold_state::*m_draw_background)(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); /* function to call to draw the background */ - UINT16 m_rockclim_v; - UINT16 m_rockclim_h; + uint16_t m_rockclim_v; + uint16_t m_rockclim_h; int m_dambustr_bg_split_line; int m_dambustr_bg_color_1; int m_dambustr_bg_color_2; @@ -103,9 +103,9 @@ public: void (galaxold_state::*m_draw_stars)(bitmap_ind16 &, const rectangle &); /* function to call to draw the star layer */ int m_stars_colors_start; - INT32 m_stars_scrollpos; - UINT8 m_stars_on; - UINT8 m_stars_blink_state; + int32_t m_stars_scrollpos; + uint8_t m_stars_on; + uint8_t m_stars_blink_state; emu_timer *m_stars_blink_timer; emu_timer *m_stars_scroll_timer; struct star_gold m_stars[STAR_COUNT]; @@ -209,8 +209,8 @@ public: DECLARE_VIDEO_START(harem); DECLARE_VIDEO_START(bagmanmc); - UINT32 screen_update_galaxold(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dambustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galaxold(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dambustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(hunchbks_vh_interrupt); TIMER_CALLBACK_MEMBER(stars_blink_callback); @@ -220,24 +220,24 @@ public: void state_save_register(); void video_start_common(); - void pisces_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void mooncrst_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void batman2_modify_charcode(UINT16 *code, UINT8 x); + void pisces_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void mooncrst_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void batman2_modify_charcode(uint16_t *code, uint8_t x); void rockclim_draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void rockclim_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void harem_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void mooncrst_modify_charcode(UINT16 *code, UINT8 x); - void pisces_modify_charcode(UINT16 *code, UINT8 x); - void mimonkey_modify_charcode(UINT16 *code, UINT8 x); - void mariner_modify_charcode(UINT16 *code, UINT8 x); - void dambustr_modify_charcode(UINT16 *code, UINT8 x); - void mshuttle_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void mimonkey_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void batman2_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void dkongjrm_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void ad2083_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void dambustr_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); - void drivfrcg_modify_color(UINT8 *color); + void rockclim_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void harem_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void mooncrst_modify_charcode(uint16_t *code, uint8_t x); + void pisces_modify_charcode(uint16_t *code, uint8_t x); + void mimonkey_modify_charcode(uint16_t *code, uint8_t x); + void mariner_modify_charcode(uint16_t *code, uint8_t x); + void dambustr_modify_charcode(uint16_t *code, uint8_t x); + void mshuttle_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void mimonkey_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void batman2_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void dkongjrm_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void ad2083_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void dambustr_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); + void drivfrcg_modify_color(uint8_t *color); void galaxold_draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect, int offs, int x, int y); void scrambold_draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect, int offs, int x, int y); void darkplnt_draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect, int offs, int x, int y); @@ -261,9 +261,9 @@ public: void start_stars_blink_timer(double ra, double rb, double c); void start_stars_scroll_timer(); void draw_bullets_common(bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, UINT8 *spriteram, size_t spriteram_size); - void bagmanmc_modify_charcode(UINT16 *code, UINT8 x); - void bagmanmc_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); + void draw_sprites(bitmap_ind16 &bitmap, uint8_t *spriteram, size_t spriteram_size); + void bagmanmc_modify_charcode(uint16_t *code, uint8_t x); + void bagmanmc_modify_spritecode(uint8_t *spriteram, int *code, int *flipx, int *flipy, int offs); void machine_reset_common(int line); }; diff --git a/src/mame/includes/galaxy.h b/src/mame/includes/galaxy.h index 1a0e27a4841..74da9f9b5d0 100644 --- a/src/mame/includes/galaxy.h +++ b/src/mame/includes/galaxy.h @@ -25,11 +25,11 @@ public: m_region_gfx1(*this, "gfx1") { } int m_interrupts_enabled; - UINT8 m_latch_value; - UINT32 m_gal_cnt; - UINT8 m_code; - UINT8 m_first; - UINT32 m_start_addr; + uint8_t m_latch_value; + uint32_t m_gal_cnt; + uint8_t m_code; + uint8_t m_first; + uint32_t m_start_addr; emu_timer *m_gal_video_timer; bitmap_ind16 m_bitmap; DECLARE_READ8_MEMBER(galaxy_keyboard_r); @@ -39,12 +39,12 @@ public: virtual void video_start() override; DECLARE_MACHINE_RESET(galaxy); DECLARE_MACHINE_RESET(galaxyp); - UINT32 screen_update_galaxy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galaxy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(galaxy_interrupt); TIMER_CALLBACK_MEMBER(gal_video); IRQ_CALLBACK_MEMBER(galaxy_irq_callback); void galaxy_set_timer(); - void galaxy_setup_snapshot (const UINT8 * data, UINT32 size); + void galaxy_setup_snapshot (const uint8_t * data, uint32_t size); required_device m_maincpu; DECLARE_SNAPSHOT_LOAD_MEMBER( galaxy ); protected: diff --git a/src/mame/includes/galeb.h b/src/mame/includes/galeb.h index 32ff8a45193..5d685e071c7 100644 --- a/src/mame/includes/galeb.h +++ b/src/mame/includes/galeb.h @@ -26,14 +26,14 @@ public: { } - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; DECLARE_WRITE8_MEMBER(dac_w); DECLARE_READ8_MEMBER(keyboard_r); DECLARE_READ8_MEMBER(tape_status_r); DECLARE_READ8_MEMBER(tape_data_r); DECLARE_WRITE8_MEMBER(tape_data_w); virtual void video_start() override; - UINT32 screen_update_galeb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galeb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; diff --git a/src/mame/includes/galivan.h b/src/mame/includes/galivan.h index feb92f13beb..4b50ee2de93 100644 --- a/src/mame/includes/galivan.h +++ b/src/mame/includes/galivan.h @@ -24,21 +24,21 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_tx_tilemap; - UINT16 m_scrollx; - UINT16 m_scrolly; - UINT8 m_galivan_scrollx[2],m_galivan_scrolly[2]; - UINT8 m_write_layers; - UINT8 m_layers; - UINT8 m_ninjemak_dispdisable; + uint16_t m_scrollx; + uint16_t m_scrolly; + uint8_t m_galivan_scrollx[2],m_galivan_scrolly[2]; + uint8_t m_write_layers; + uint8_t m_layers; + uint8_t m_ninjemak_dispdisable; - UINT8 m_shift_scroll; //youmab - UINT32 m_shift_val; + uint8_t m_shift_scroll; //youmab + uint32_t m_shift_val; DECLARE_WRITE8_MEMBER(galivan_sound_command_w); DECLARE_READ8_MEMBER(soundlatch_clear_r); DECLARE_READ8_MEMBER(IO_port_c0_r); @@ -65,8 +65,8 @@ public: DECLARE_MACHINE_START(ninjemak); DECLARE_MACHINE_RESET(ninjemak); DECLARE_VIDEO_START(ninjemak); - UINT32 screen_update_galivan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ninjemak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galivan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ninjemak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; optional_device m_nb1414m4; diff --git a/src/mame/includes/galpani2.h b/src/mame/includes/galpani2.h index 5ae94e9e026..fb812c9647b 100644 --- a/src/mame/includes/galpani2.h +++ b/src/mame/includes/galpani2.h @@ -36,18 +36,18 @@ public: required_device m_bg15palette; required_device m_bg8palette; - required_shared_ptr_array m_bg8; - optional_shared_ptr_array m_palette_val; - required_shared_ptr_array m_bg8_scrollx; - required_shared_ptr_array m_bg8_scrolly; - required_shared_ptr m_bg15; - required_shared_ptr m_ram; - required_shared_ptr m_ram2; - optional_shared_ptr m_spriteram; + required_shared_ptr_array m_bg8; + optional_shared_ptr_array m_palette_val; + required_shared_ptr_array m_bg8_scrollx; + required_shared_ptr_array m_bg8_scrolly; + required_shared_ptr m_bg15; + required_shared_ptr m_ram; + required_shared_ptr m_ram2; + optional_shared_ptr m_spriteram; - UINT16 m_eeprom_word; - UINT16 m_old_mcu_nmi1; - UINT16 m_old_mcu_nmi2; + uint16_t m_eeprom_word; + uint16_t m_old_mcu_nmi1; + uint16_t m_old_mcu_nmi2; DECLARE_WRITE8_MEMBER(galpani2_mcu_init_w); DECLARE_WRITE8_MEMBER(galpani2_mcu_nmi1_w); @@ -62,7 +62,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(galpani2); - UINT32 screen_update_galpani2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galpani2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void copybg8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int layer); void copybg15(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/galpanic.h b/src/mame/includes/galpanic.h index 0ab503e6742..a89502da913 100644 --- a/src/mame/includes/galpanic.h +++ b/src/mame/includes/galpanic.h @@ -17,8 +17,8 @@ public: { } required_device m_maincpu; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; @@ -34,7 +34,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(galpanic); - 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); void screen_eof(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(scanline); void draw_fgbitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/galspnbl.h b/src/mame/includes/galspnbl.h index 1fdf0aadbc6..8ff4e9f9aad 100644 --- a/src/mame/includes/galspnbl.h +++ b/src/mame/includes/galspnbl.h @@ -31,11 +31,11 @@ public: { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_scroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_scroll; /* devices */ required_device m_audiocpu; @@ -49,7 +49,7 @@ public: DECLARE_WRITE16_MEMBER(soundcommand_w); virtual void machine_start() override; DECLARE_PALETTE_INIT(galspnbl); - UINT32 screen_update_galspnbl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_galspnbl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect ); bitmap_ind16 m_sprite_bitmap; DECLARE_VIDEO_START(galspnbl); diff --git a/src/mame/includes/gamate.h b/src/mame/includes/gamate.h index 868df1157a6..9e387f8e7f0 100644 --- a/src/mame/includes/gamate.h +++ b/src/mame/includes/gamate.h @@ -19,7 +19,7 @@ class gamate_sound_device : public device_t, public device_sound_interface { public: - gamate_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gamate_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~gamate_sound_device() { } DECLARE_WRITE8_MEMBER( device_w ); @@ -92,7 +92,7 @@ private: double step, pos; } envelope; - UINT8 reg[14]; + uint8_t reg[14]; }; extern const device_type GAMATE_SND; diff --git a/src/mame/includes/gamecom.h b/src/mame/includes/gamecom.h index 2afe93a5546..430a76c33da 100644 --- a/src/mame/includes/gamecom.h +++ b/src/mame/includes/gamecom.h @@ -175,12 +175,12 @@ struct GAMECOM_DMA int state_count; int state_pixel; int state_limit; - UINT8 palette[4]; - UINT8 *source_bank; + uint8_t palette[4]; + uint8_t *source_bank; unsigned int source_current; unsigned int source_line; unsigned int source_mask; - UINT8 *dest_bank; + uint8_t *dest_bank; unsigned int dest_current; unsigned int dest_line; unsigned int dest_mask; @@ -196,16 +196,16 @@ struct GAMECOM_TIMER struct gamecom_sound_t { - UINT8 sgc; - UINT8 sg0l; - UINT8 sg1l; - UINT8 sg2l; - UINT16 sg0t; - UINT16 sg1t; - UINT16 sg2t; - UINT8 sgda; - UINT8 sg0w[16]; - UINT8 sg1w[16]; + uint8_t sgc; + uint8_t sg0l; + uint8_t sg1l; + uint8_t sg2l; + uint16_t sg0t; + uint16_t sg1t; + uint16_t sg2t; + uint8_t sgda; + uint8_t sg0w[16]; + uint8_t sg1w[16]; }; @@ -250,17 +250,17 @@ public: DECLARE_WRITE8_MEMBER( gamecom_update_timers ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( gamecom_cart1 ); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( gamecom_cart2 ); - 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); private: - UINT8 *m_p_ram; - UINT8 *m_cart_ptr; - UINT8 m_lcdc_reg; - UINT8 m_lch_reg; - UINT8 m_lcv_reg; - UINT8 m_sound0_cnt; - UINT8 m_sound1_cnt; - UINT16 m_scanline; - UINT16 m_base_address; + uint8_t *m_p_ram; + uint8_t *m_cart_ptr; + uint8_t m_lcdc_reg; + uint8_t m_lch_reg; + uint8_t m_lcv_reg; + uint8_t m_sound0_cnt; + uint8_t m_sound1_cnt; + uint16_t m_scanline; + uint16_t m_base_address; memory_region *m_cart1_rom; memory_region *m_cart2_rom; emu_timer *m_clock_timer; @@ -271,15 +271,15 @@ private: GAMECOM_TIMER m_timer[2]; gamecom_sound_t m_sound; bitmap_ind16 m_bitmap; - void gamecom_set_mmu(UINT8 mmu, UINT8 data); + void gamecom_set_mmu(uint8_t mmu, uint8_t data); void handle_stylus_press(int column); void recompute_lcd_params(); - void handle_input_press(UINT16 mux_data); + void handle_input_press(uint16_t mux_data); image_init_result common_load(device_image_interface &image, generic_slot_device *slot); virtual void machine_reset() override; virtual void video_start() override; - required_shared_ptr m_p_videoram; - required_shared_ptr m_p_nvram; + required_shared_ptr m_p_videoram; + required_shared_ptr m_p_nvram; required_device m_maincpu; required_device m_dac; required_device m_dac0; diff --git a/src/mame/includes/gameplan.h b/src/mame/includes/gameplan.h index b3968301d1e..daa9386df31 100644 --- a/src/mame/includes/gameplan.h +++ b/src/mame/includes/gameplan.h @@ -48,16 +48,16 @@ public: m_soundlatch(*this, "soundlatch") { } /* machine state */ - UINT8 m_current_port; - optional_shared_ptr m_trvquest_question; + uint8_t m_current_port; + optional_shared_ptr m_trvquest_question; /* video state */ - std::unique_ptr m_videoram; + std::unique_ptr m_videoram; size_t m_videoram_size; - UINT8 m_video_x; - UINT8 m_video_y; - UINT8 m_video_command; - UINT8 m_video_data; + uint8_t m_video_x; + uint8_t m_video_y; + uint8_t m_video_command; + uint8_t m_video_data; emu_timer *m_via_0_ca1_timer; /* devices */ @@ -88,8 +88,8 @@ public: DECLARE_VIDEO_START(leprechn); DECLARE_VIDEO_START(trvquest); DECLARE_VIDEO_START(common); - UINT32 screen_update_gameplan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_leprechn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gameplan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_leprechn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(trvquest_interrupt); TIMER_CALLBACK_MEMBER(clear_screen_done_callback); TIMER_CALLBACK_MEMBER(via_irq_delayed); diff --git a/src/mame/includes/gamepock.h b/src/mame/includes/gamepock.h index 9b842d6405a..77fe43e7924 100644 --- a/src/mame/includes/gamepock.h +++ b/src/mame/includes/gamepock.h @@ -6,11 +6,11 @@ #include "bus/generic/slot.h" struct HD44102CH { - UINT8 enabled; - UINT8 start_page; - UINT8 address; - UINT8 y_inc; - UINT8 ram[256]; /* There are actually 50 x 4 x 8 bits. This just makes addressing easier. */ + uint8_t enabled; + uint8_t start_page; + uint8_t address; + uint8_t y_inc; + uint8_t ram[256]; /* There are actually 50 x 4 x 8 bits. This just makes addressing easier. */ }; class gamepock_state : public driver_device @@ -25,11 +25,11 @@ public: virtual void machine_reset() override; - UINT8 m_port_a; - UINT8 m_port_b; + uint8_t m_port_a; + uint8_t m_port_b; HD44102CH m_hd44102ch[3]; - void hd44102ch_w( int which, int c_d, UINT8 data ); + void hd44102ch_w( int which, int c_d, uint8_t data ); void hd44102ch_init( int which ); void lcd_update(); @@ -37,7 +37,7 @@ public: DECLARE_READ8_MEMBER( port_b_r ); DECLARE_WRITE8_MEMBER( port_b_w ); DECLARE_READ8_MEMBER( port_c_r ); - UINT32 screen_update_gamepock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gamepock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_speaker; required_device m_cart; diff --git a/src/mame/includes/gaplus.h b/src/mame/includes/gaplus.h index 7f4e92a75f0..ba2924775a9 100644 --- a/src/mame/includes/gaplus.h +++ b/src/mame/includes/gaplus.h @@ -52,19 +52,19 @@ public: namco58xx_device *m_namco58xx; namco56xx_device *m_namco56xx; - required_shared_ptr m_customio_3; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_customio_3; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; int m_type; tilemap_t *m_bg_tilemap; - UINT8 m_starfield_control[4]; + uint8_t m_starfield_control[4]; int m_total_stars; struct star m_stars[MAX_STARS]; - UINT8 m_main_irq_mask; - UINT8 m_sub_irq_mask; - UINT8 m_sub2_irq_mask; + uint8_t m_main_irq_mask; + uint8_t m_sub_irq_mask; + uint8_t m_sub2_irq_mask; DECLARE_WRITE8_MEMBER(irq_1_ctrl_w); DECLARE_WRITE8_MEMBER(irq_2_ctrl_w); @@ -95,7 +95,7 @@ public: INTERRUPT_GEN_MEMBER(vblank_sub2_irq); TIMER_CALLBACK_MEMBER(namcoio_run); - 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); void screen_eof(screen_device &screen, bool state); void starfield_init(); void starfield_render(bitmap_ind16 &bitmap); diff --git a/src/mame/includes/gatron.h b/src/mame/includes/gatron.h index 4d1b8a73836..8faac6be6ac 100644 --- a/src/mame/includes/gatron.h +++ b/src/mame/includes/gatron.h @@ -9,7 +9,7 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(output_port_0_w); DECLARE_WRITE8_MEMBER(gat_videoram_w); @@ -17,7 +17,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(gatron); - UINT32 screen_update_gat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; diff --git a/src/mame/includes/gauntlet.h b/src/mame/includes/gauntlet.h index 142d995fa9f..c09432c4fdd 100644 --- a/src/mame/includes/gauntlet.h +++ b/src/mame/includes/gauntlet.h @@ -36,10 +36,10 @@ public: required_device m_alpha_tilemap; required_device m_mob; - UINT16 m_sound_reset_val; - UINT8 m_vindctr2_screen_refresh; - UINT8 m_playfield_tile_bank; - UINT8 m_playfield_color_bank; + uint16_t m_sound_reset_val; + uint8_t m_vindctr2_screen_refresh; + uint8_t m_playfield_tile_bank; + uint8_t m_playfield_color_bank; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_WRITE16_MEMBER(sound_reset_w); @@ -55,7 +55,7 @@ public: DECLARE_MACHINE_START(gauntlet); DECLARE_MACHINE_RESET(gauntlet); DECLARE_VIDEO_START(gauntlet); - UINT32 screen_update_gauntlet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gauntlet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE16_MEMBER( gauntlet_xscroll_w ); DECLARE_WRITE16_MEMBER( gauntlet_yscroll_w ); diff --git a/src/mame/includes/gb.h b/src/mame/includes/gb.h index bb5e0e66316..5a1e8666f72 100644 --- a/src/mame/includes/gb.h +++ b/src/mame/includes/gb.h @@ -31,33 +31,33 @@ public: m_ram(*this, RAM_TAG), m_ppu(*this, "ppu") { } - UINT8 m_gb_io[0x10]; + uint8_t m_gb_io[0x10]; /* Timer related */ - UINT16 m_divcount; - UINT8 m_shift; - UINT16 m_shift_cycles; - UINT8 m_triggering_irq; - UINT8 m_reloading; + uint16_t m_divcount; + uint8_t m_shift; + uint16_t m_shift_cycles; + uint8_t m_triggering_irq; + uint8_t m_reloading; /* Serial I/O related */ - UINT16 m_internal_serial_clock; - UINT16 m_internal_serial_frequency; - UINT32 m_sio_count; /* Serial I/O counter */ + uint16_t m_internal_serial_clock; + uint16_t m_internal_serial_frequency; + uint32_t m_sio_count; /* Serial I/O counter */ /* SGB variables */ - INT8 m_sgb_packets; - UINT8 m_sgb_bitcount; - UINT8 m_sgb_bytecount; - UINT8 m_sgb_start; - UINT8 m_sgb_rest; - UINT8 m_sgb_controller_no; - UINT8 m_sgb_controller_mode; - UINT8 m_sgb_data[0x100]; + int8_t m_sgb_packets; + uint8_t m_sgb_bitcount; + uint8_t m_sgb_bytecount; + uint8_t m_sgb_start; + uint8_t m_sgb_rest; + uint8_t m_sgb_controller_no; + uint8_t m_sgb_controller_mode; + uint8_t m_sgb_data[0x100]; /* CGB variables */ - UINT8 *m_gbc_rammap[8]; /* (CGB) Addresses of internal RAM banks */ - UINT8 m_gbc_rambank; /* (CGB) Current CGB RAM bank */ + uint8_t *m_gbc_rammap[8]; /* (CGB) Addresses of internal RAM banks */ + uint8_t m_gbc_rambank; /* (CGB) Current CGB RAM bank */ bool m_bios_disable; diff --git a/src/mame/includes/gba.h b/src/mame/includes/gba.h index 9f3446d3b86..bb6bc4d0643 100644 --- a/src/mame/includes/gba.h +++ b/src/mame/includes/gba.h @@ -35,20 +35,20 @@ public: required_device m_gbsound; required_device m_cart; - void request_irq(UINT32 int_type); + void request_irq(uint32_t int_type); void dma_exec(int ch); void audio_tick(int ref); // DMA emu_timer *m_dma_timer[4]; - UINT32 m_dma_src[4]; - UINT32 m_dma_dst[4]; - UINT16 m_dma_cnt[4]; + uint32_t m_dma_src[4]; + uint32_t m_dma_dst[4]; + uint16_t m_dma_cnt[4]; // Timers - UINT32 m_timer_regs[4]; - UINT16 m_timer_reload[4]; + uint32_t m_timer_regs[4]; + uint16_t m_timer_reload[4]; int m_timer_recalc[4]; emu_timer *m_tmr_timer[4], *m_irq_timer; @@ -59,10 +59,10 @@ public: int m_fifo_b_ptr; int m_fifo_a_in; int m_fifo_b_in; - UINT8 m_fifo_a[20]; - UINT8 m_fifo_b[20]; + uint8_t m_fifo_a[20]; + uint8_t m_fifo_b[20]; - UINT32 m_bios_last_address; + uint32_t m_bios_last_address; int m_bios_protected; DIRECT_UPDATE_MEMBER(gba_direct); @@ -83,7 +83,7 @@ public: TIMER_CALLBACK_MEMBER(handle_irq); protected: - required_region_ptr m_region_maincpu; + required_region_ptr m_region_maincpu; required_ioport m_io_inputs; required_ioport m_bios_hack; }; diff --git a/src/mame/includes/gberet.h b/src/mame/includes/gberet.h index 6911d47fc40..716fe007caf 100644 --- a/src/mame/includes/gberet.h +++ b/src/mame/includes/gberet.h @@ -25,23 +25,23 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - optional_shared_ptr m_spriteram2; - required_shared_ptr m_spriteram; - optional_shared_ptr m_scrollram; - optional_shared_ptr m_soundlatch; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + optional_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram; + optional_shared_ptr m_scrollram; + optional_shared_ptr m_soundlatch; /* devices */ required_device m_sn; /* video-related */ tilemap_t * m_bg_tilemap; - UINT8 m_spritebank; + uint8_t m_spritebank; /* misc */ - UINT8 m_interrupt_mask; - UINT8 m_interrupt_ticks; + uint8_t m_interrupt_mask; + uint8_t m_interrupt_ticks; DECLARE_WRITE8_MEMBER(gberet_coin_counter_w); DECLARE_WRITE8_MEMBER(mrgoemon_coin_counter_w); DECLARE_WRITE8_MEMBER(gberet_flipscreen_w); @@ -60,8 +60,8 @@ public: DECLARE_MACHINE_RESET(gberet); DECLARE_VIDEO_START(gberet); DECLARE_PALETTE_INIT(gberet); - UINT32 screen_update_gberet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gberetb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gberet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gberetb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(gberet_interrupt_tick); void gberet_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void gberetb_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/gcpinbal.h b/src/mame/includes/gcpinbal.h index fa32062eb1c..92346a6f767 100644 --- a/src/mame/includes/gcpinbal.h +++ b/src/mame/includes/gcpinbal.h @@ -32,31 +32,31 @@ public: required_device m_msm; /* memory pointers */ - required_shared_ptr m_tilemapram; - required_shared_ptr m_ioc_ram; + required_shared_ptr m_tilemapram; + required_shared_ptr m_ioc_ram; required_device m_gfxdecode; required_device m_palette; /* video-related */ tilemap_t *m_tilemap[3]; - UINT16 m_scrollx[3]; - UINT16 m_scrolly[3]; - UINT16 m_bg0_gfxset; - UINT16 m_bg1_gfxset; + uint16_t m_scrollx[3]; + uint16_t m_scrolly[3]; + uint16_t m_bg0_gfxset; + uint16_t m_bg1_gfxset; #ifdef MAME_DEBUG - UINT8 m_dislayer[4]; + uint8_t m_dislayer[4]; #endif /* sound-related */ - UINT32 m_msm_start; - UINT32 m_msm_end; - UINT32 m_msm_bank; - UINT32 m_adpcm_start; - UINT32 m_adpcm_end; - UINT32 m_adpcm_idle; - UINT8 m_adpcm_trigger; - UINT8 m_adpcm_data; + uint32_t m_msm_start; + uint32_t m_msm_end; + uint32_t m_msm_bank; + uint32_t m_adpcm_start; + uint32_t m_adpcm_end; + uint32_t m_adpcm_idle; + uint8_t m_adpcm_trigger; + uint8_t m_adpcm_data; DECLARE_READ16_MEMBER(ioc_r); DECLARE_WRITE16_MEMBER(ioc_w); @@ -68,7 +68,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_gcpinbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gcpinbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(gcpinbal_interrupt); void gcpinbal_core_vh_start( ); DECLARE_WRITE_LINE_MEMBER(gcp_adpcm_int); diff --git a/src/mame/includes/gijoe.h b/src/mame/includes/gijoe.h index 06d39d06619..f325e0a89ed 100644 --- a/src/mame/includes/gijoe.h +++ b/src/mame/includes/gijoe.h @@ -31,8 +31,8 @@ public: m_soundlatch2(*this, "soundlatch2") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_workram; + required_shared_ptr m_spriteram; + required_shared_ptr m_workram; /* video-related */ int m_avac_bits[4]; @@ -43,7 +43,7 @@ public: int m_sprite_colorbase; /* misc */ - UINT16 m_cur_control2; + uint16_t m_cur_control2; emu_timer *m_dmadelay_timer; /* devices */ @@ -65,7 +65,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_gijoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gijoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(gijoe_interrupt); TIMER_CALLBACK_MEMBER(dmaend_callback); void gijoe_objdma(); diff --git a/src/mame/includes/ginganin.h b/src/mame/includes/ginganin.h index ab4f2758ed9..ebc3e7a180c 100644 --- a/src/mame/includes/ginganin.h +++ b/src/mame/includes/ginganin.h @@ -24,10 +24,10 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_txtram; - required_shared_ptr m_spriteram; - required_shared_ptr m_vregs; - required_shared_ptr m_fgram; + required_shared_ptr m_txtram; + required_shared_ptr m_spriteram; + required_shared_ptr m_vregs; + required_shared_ptr m_fgram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -58,6 +58,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_ginganin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ginganin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); }; diff --git a/src/mame/includes/gladiatr.h b/src/mame/includes/gladiatr.h index 07097be9b01..1ed36a46947 100644 --- a/src/mame/includes/gladiatr.h +++ b/src/mame/includes/gladiatr.h @@ -31,12 +31,12 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_nvram; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_textram; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_nvram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_textram; + required_shared_ptr m_generic_paletteram_8; int m_data1; int m_data2; @@ -101,8 +101,8 @@ public: DECLARE_MACHINE_RESET(gladiator); DECLARE_VIDEO_START(gladiatr); - UINT32 screen_update_ppking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gladiatr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ppking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gladiatr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void swap_block(UINT8 *src1,UINT8 *src2,int len); + void swap_block(uint8_t *src1,uint8_t *src2,int len); }; diff --git a/src/mame/includes/glass.h b/src/mame/includes/glass.h index f00434e7201..a0af86de946 100644 --- a/src/mame/includes/glass.h +++ b/src/mame/includes/glass.h @@ -26,10 +26,10 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_vregs; - required_shared_ptr m_spriteram; - required_shared_ptr m_mainram; + required_shared_ptr m_videoram; + required_shared_ptr m_vregs; + required_shared_ptr m_spriteram; + required_shared_ptr m_mainram; /* video-related */ tilemap_t *m_pant[2]; @@ -57,7 +57,7 @@ public: TILE_GET_INFO_MEMBER(get_tile_info_screen0); TILE_GET_INFO_MEMBER(get_tile_info_screen1); - 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); INTERRUPT_GEN_MEMBER(interrupt); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void ROM16_split_gfx( const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 ); diff --git a/src/mame/includes/gng.h b/src/mame/includes/gng.h index 83a245748e0..8c76329ceac 100644 --- a/src/mame/includes/gng.h +++ b/src/mame/includes/gng.h @@ -22,14 +22,14 @@ public: /* memory pointers */ required_device m_spriteram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_scrollx[2]; - UINT8 m_scrolly[2]; + uint8_t m_scrollx[2]; + uint8_t m_scrolly[2]; DECLARE_WRITE8_MEMBER(gng_bankswitch_w); DECLARE_WRITE8_MEMBER(gng_coin_counter_w); @@ -45,7 +45,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_gng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/goal92.h b/src/mame/includes/goal92.h index 1df735acf23..e489371cf21 100644 --- a/src/mame/includes/goal92.h +++ b/src/mame/includes/goal92.h @@ -27,18 +27,18 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_bg_data; - required_shared_ptr m_fg_data; - required_shared_ptr m_tx_data; - required_shared_ptr m_spriteram; - required_shared_ptr m_scrollram; - std::unique_ptr m_buffered_spriteram; + required_shared_ptr m_bg_data; + required_shared_ptr m_fg_data; + required_shared_ptr m_tx_data; + required_shared_ptr m_spriteram; + required_shared_ptr m_scrollram; + std::unique_ptr m_buffered_spriteram; /* video-related */ tilemap_t *m_bg_layer; tilemap_t *m_fg_layer; tilemap_t *m_tx_layer; - UINT16 m_fg_bank; + uint16_t m_fg_bank; /* misc */ int m_msm5205next; @@ -67,7 +67,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_goal92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_goal92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_goal92(screen_device &screen, bool state); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ); DECLARE_WRITE_LINE_MEMBER(irqhandler); diff --git a/src/mame/includes/goindol.h b/src/mame/includes/goindol.h index a7ef567182a..0dcb070b6e3 100644 --- a/src/mame/includes/goindol.h +++ b/src/mame/includes/goindol.h @@ -23,18 +23,18 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_ram; - required_shared_ptr m_fg_scrolly; - required_shared_ptr m_fg_scrollx; - required_shared_ptr m_spriteram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_spriteram2; - required_shared_ptr m_fg_videoram; + required_shared_ptr m_ram; + required_shared_ptr m_fg_scrolly; + required_shared_ptr m_fg_scrollx; + required_shared_ptr m_spriteram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_fg_videoram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT16 m_char_bank; + uint16_t m_char_bank; /* misc */ int m_prot_toggle; @@ -52,8 +52,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_goindol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int gfxbank, UINT8 *sprite_ram ); + uint32_t screen_update_goindol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int gfxbank, uint8_t *sprite_ram ); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h index 2afad6503d4..28500b4cc33 100644 --- a/src/mame/includes/goldstar.h +++ b/src/mame/includes/goldstar.h @@ -50,8 +50,8 @@ public: DECLARE_VIDEO_START(cherrym); DECLARE_PALETTE_INIT(cmast91); DECLARE_PALETTE_INIT(lucky8); - UINT32 screen_update_goldstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cmast91(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_goldstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cmast91(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: TILE_GET_INFO_MEMBER(get_goldstar_fg_tile_info); @@ -62,19 +62,19 @@ protected: int m_dataoffset; - required_shared_ptr m_fg_vidram; - required_shared_ptr m_fg_atrram; + required_shared_ptr m_fg_vidram; + required_shared_ptr m_fg_atrram; - optional_shared_ptr m_bg_vidram; - optional_shared_ptr m_bg_atrram; + optional_shared_ptr m_bg_vidram; + optional_shared_ptr m_bg_atrram; - optional_shared_ptr m_reel1_ram; - optional_shared_ptr m_reel2_ram; - optional_shared_ptr m_reel3_ram; + optional_shared_ptr m_reel1_ram; + optional_shared_ptr m_reel2_ram; + optional_shared_ptr m_reel3_ram; - optional_shared_ptr m_reel1_scroll; - optional_shared_ptr m_reel2_scroll; - optional_shared_ptr m_reel3_scroll; + optional_shared_ptr m_reel1_scroll; + optional_shared_ptr m_reel2_scroll; + optional_shared_ptr m_reel3_scroll; tilemap_t *m_reel1_tilemap; tilemap_t *m_reel2_tilemap; @@ -83,10 +83,10 @@ protected: int m_bgcolor; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT8 m_cmaster_girl_num; - UINT8 m_cmaster_girl_pal; - UINT8 m_cm_enable_reg; - UINT8 m_cm_girl_scroll; + uint8_t m_cmaster_girl_num; + uint8_t m_cmaster_girl_pal; + uint8_t m_cm_enable_reg; + uint8_t m_cm_girl_scroll; required_device m_maincpu; required_device m_gfxdecode; @@ -125,7 +125,7 @@ public: DECLARE_DRIVER_INIT(rp36c3); DECLARE_DRIVER_INIT(rp96sub); - UINT32 screen_update_amcoe1a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_amcoe1a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: // installed by various driver init handlers to get stuff to work @@ -175,8 +175,8 @@ public: DECLARE_VIDEO_START(bingowng); DECLARE_VIDEO_START(magical); DECLARE_PALETTE_INIT(magodds); - UINT32 screen_update_bingowng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_magical(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bingowng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_magical(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(masked_irq); @@ -186,8 +186,8 @@ protected: private: optional_device m_fl7w4_id; - UINT8 m_nmi_enable; - UINT8 m_vidreg; + uint8_t m_nmi_enable; + uint8_t m_vidreg; int m_tile_bank; }; @@ -208,11 +208,11 @@ public: DECLARE_DRIVER_INIT(chry10); protected: - void do_blockswaps(UINT8* ROM); - void dump_to_file(UINT8* ROM); + void do_blockswaps(uint8_t* ROM); + void dump_to_file(uint8_t* ROM); - UINT8 cb3_decrypt(UINT8 cipherText, UINT16 address); - UINT8 chry10_decrypt(UINT8 cipherText); + uint8_t cb3_decrypt(uint8_t cipherText, uint16_t address); + uint8_t chry10_decrypt(uint8_t cipherText); }; @@ -239,7 +239,7 @@ public: DECLARE_WRITE8_MEMBER(reel3_attrram_w); DECLARE_VIDEO_START(sangho); - UINT32 screen_update_sangho(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sangho(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: TILE_GET_INFO_MEMBER(get_fg_tile_info); @@ -249,11 +249,11 @@ protected: TILE_GET_INFO_MEMBER(get_reel3_tile_info); private: - required_shared_ptr m_reel1_attrram; - required_shared_ptr m_reel2_attrram; - required_shared_ptr m_reel3_attrram; + required_shared_ptr m_reel1_attrram; + required_shared_ptr m_reel2_attrram; + required_shared_ptr m_reel3_attrram; - UINT8 m_enable_reg; + uint8_t m_enable_reg; }; @@ -282,7 +282,7 @@ public: DECLARE_DRIVER_INIT(unkch4); DECLARE_VIDEO_START(unkch); - UINT32 screen_update_unkch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_unkch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); @@ -292,12 +292,12 @@ protected: TILE_GET_INFO_MEMBER(get_reel3_tile_info); private: - required_shared_ptr m_reel1_attrram; - required_shared_ptr m_reel2_attrram; - required_shared_ptr m_reel3_attrram; + required_shared_ptr m_reel1_attrram; + required_shared_ptr m_reel2_attrram; + required_shared_ptr m_reel3_attrram; - UINT8 m_vblank_irq_enable; - UINT8 m_vidreg; + uint8_t m_vblank_irq_enable; + uint8_t m_vidreg; optional_device m_ticket_dispenser; }; diff --git a/src/mame/includes/gomoku.h b/src/mame/includes/gomoku.h index 9afc41cc347..0bbf5020616 100644 --- a/src/mame/includes/gomoku.h +++ b/src/mame/includes/gomoku.h @@ -14,9 +14,9 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen") { } - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_bgram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_bgram; int m_flipscreen; int m_bg_dispsw; tilemap_t *m_fg_tilemap; @@ -31,7 +31,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(gomoku); - UINT32 screen_update_gomoku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gomoku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_screen; @@ -70,7 +70,7 @@ class gomoku_sound_device : public device_t, public device_sound_interface { public: - gomoku_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gomoku_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~gomoku_sound_device() { } protected: @@ -93,19 +93,19 @@ private: gomoku_sound_channel *m_last_channel; /* global sound parameters */ - const UINT8 *m_sound_rom; + const uint8_t *m_sound_rom; int m_num_voices; int m_sound_enable; sound_stream *m_stream; /* mixer tables and internal buffers */ - std::unique_ptr m_mixer_table; - INT16 *m_mixer_lookup; + std::unique_ptr m_mixer_table; + int16_t *m_mixer_lookup; std::unique_ptr m_mixer_buffer; short *m_mixer_buffer_2; - UINT8 m_soundregs1[0x20]; - UINT8 m_soundregs2[0x20]; + uint8_t m_soundregs1[0x20]; + uint8_t m_soundregs2[0x20]; }; extern const device_type GOMOKU; diff --git a/src/mame/includes/gotcha.h b/src/mame/includes/gotcha.h index c053588e91c..dcaa00ae914 100644 --- a/src/mame/includes/gotcha.h +++ b/src/mame/includes/gotcha.h @@ -23,9 +23,9 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_spriteram; optional_device m_sprgen; /* video-related */ @@ -33,7 +33,7 @@ public: tilemap_t *m_fg_tilemap; int m_banksel; int m_gfxbank[4]; - UINT16 m_scroll[4]; + uint16_t m_scroll[4]; /* devices */ required_device m_audiocpu; @@ -50,8 +50,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_gotcha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - inline void get_tile_info( tile_data &tileinfo, int tile_index ,UINT16 *vram, int color_offs); + uint32_t screen_update_gotcha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + inline void get_tile_info( tile_data &tileinfo, int tile_index ,uint16_t *vram, int color_offs); required_device m_maincpu; required_device m_oki; required_device m_gfxdecode; diff --git a/src/mame/includes/gottlieb.h b/src/mame/includes/gottlieb.h index 9d6fbc364b8..f59b76fbd59 100644 --- a/src/mame/includes/gottlieb.h +++ b/src/mame/includes/gottlieb.h @@ -61,43 +61,43 @@ public: optional_device m_r2_sound; optional_device m_knocker_sample; - required_shared_ptr m_videoram; - required_shared_ptr m_charram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_charram; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_generic_paletteram_8; optional_ioport m_track_x; optional_ioport m_track_y; - UINT8 m_knocker_prev; - UINT8 m_joystick_select; - UINT8 m_track[2]; + uint8_t m_knocker_prev; + uint8_t m_joystick_select; + uint8_t m_track[2]; emu_timer *m_laserdisc_bit_timer; emu_timer *m_laserdisc_philips_timer; - UINT8 m_laserdisc_select; - UINT8 m_laserdisc_status; - UINT16 m_laserdisc_philips_code; - std::unique_ptr m_laserdisc_audio_buffer; - UINT16 m_laserdisc_audio_address; - INT16 m_laserdisc_last_samples[2]; + uint8_t m_laserdisc_select; + uint8_t m_laserdisc_status; + uint16_t m_laserdisc_philips_code; + std::unique_ptr m_laserdisc_audio_buffer; + uint16_t m_laserdisc_audio_address; + int16_t m_laserdisc_last_samples[2]; attotime m_laserdisc_last_time; attotime m_laserdisc_last_clock; - UINT8 m_laserdisc_zero_seen; - UINT8 m_laserdisc_audio_bits; - UINT8 m_laserdisc_audio_bit_count; - UINT8 m_gfxcharlo; - UINT8 m_gfxcharhi; - UINT8 m_background_priority; - UINT8 m_spritebank; - UINT8 m_transparent0; + uint8_t m_laserdisc_zero_seen; + uint8_t m_laserdisc_audio_bits; + uint8_t m_laserdisc_audio_bit_count; + uint8_t m_gfxcharlo; + uint8_t m_gfxcharhi; + uint8_t m_background_priority; + uint8_t m_spritebank; + uint8_t m_transparent0; tilemap_t *m_bg_tilemap; double m_weights[4]; - void qbert_knocker(UINT8 knock); + void qbert_knocker(uint8_t knock); DECLARE_WRITE8_MEMBER(gottlieb_analog_reset_w); DECLARE_WRITE8_MEMBER(general_output_w); @@ -129,7 +129,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_VIDEO_START(screwloo); - UINT32 screen_update_gottlieb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gottlieb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(gottlieb_interrupt); TIMER_CALLBACK_MEMBER(laserdisc_philips_callback); TIMER_CALLBACK_MEMBER(laserdisc_bit_off_callback); @@ -139,7 +139,7 @@ public: inline void audio_end_state(); void audio_process_clock(int logit); void audio_handle_zero_crossing(const attotime &zerotime, int logit); - void laserdisc_audio_process(laserdisc_device &device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1); + void laserdisc_audio_process(laserdisc_device &device, int samplerate, int samples, const int16_t *ch0, const int16_t *ch1); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/gotya.h b/src/mame/includes/gotya.h index 6ad087b0242..92c18b540af 100644 --- a/src/mame/includes/gotya.h +++ b/src/mame/includes/gotya.h @@ -18,11 +18,11 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_scroll; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram2; - required_shared_ptr m_spriteram; + required_shared_ptr m_scroll; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram2; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -43,7 +43,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(gotya); - UINT32 screen_update_gotya(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gotya(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_status_row( bitmap_ind16 &bitmap, const rectangle &cliprect, int sx, int col ); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_status( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/gp32.h b/src/mame/includes/gp32.h index 54dac50d19f..cfe14d5bd4d 100644 --- a/src/mame/includes/gp32.h +++ b/src/mame/includes/gp32.h @@ -43,14 +43,14 @@ struct s3c240x_lcd_t { - UINT32 vramaddr_cur; - UINT32 vramaddr_max; - UINT32 offsize; - UINT32 pagewidth_cur; - UINT32 pagewidth_max; - UINT32 bppmode; - UINT32 bswp, hwswp; - UINT32 hozval, lineval; + uint32_t vramaddr_cur; + uint32_t vramaddr_max; + uint32_t offsize; + uint32_t pagewidth_cur; + uint32_t pagewidth_max; + uint32_t bppmode; + uint32_t bswp, hwswp; + uint32_t hozval, lineval; int vpos, hpos; }; @@ -64,8 +64,8 @@ struct smc_t int read; int wp; int busy; - UINT8 datarx; - UINT8 datatx; + uint8_t datarx; + uint8_t datatx; }; struct i2s_t @@ -77,14 +77,14 @@ struct i2s_t struct s3c240x_iic_t { - UINT8 data[4]; + uint8_t data[4]; int data_index; - UINT16 address; + uint16_t address; }; struct s3c240x_iis_t { - UINT16 fifo[16/2]; + uint16_t fifo[16/2]; int fifo_index; }; @@ -106,37 +106,37 @@ public: virtual void video_start() override; - required_shared_ptr m_s3c240x_ram; - std::unique_ptr m_eeprom_data; - UINT32 m_s3c240x_lcd_regs[0x400/4]; + required_shared_ptr m_s3c240x_ram; + std::unique_ptr m_eeprom_data; + uint32_t m_s3c240x_lcd_regs[0x400/4]; emu_timer *m_s3c240x_lcd_timer; s3c240x_lcd_t m_s3c240x_lcd; - UINT32 m_s3c240x_lcd_palette[0x400/4]; - UINT32 m_s3c240x_clkpow_regs[0x18/4]; - UINT32 m_s3c240x_irq_regs[0x18/4]; + uint32_t m_s3c240x_lcd_palette[0x400/4]; + uint32_t m_s3c240x_clkpow_regs[0x18/4]; + uint32_t m_s3c240x_irq_regs[0x18/4]; emu_timer *m_s3c240x_pwm_timer[5]; - UINT32 m_s3c240x_pwm_regs[0x44/4]; + uint32_t m_s3c240x_pwm_regs[0x44/4]; emu_timer *m_s3c240x_dma_timer[4]; - UINT32 m_s3c240x_dma_regs[0x7c/4]; + uint32_t m_s3c240x_dma_regs[0x7c/4]; smc_t m_smc; i2s_t m_i2s; - UINT32 m_s3c240x_gpio[0x60/4]; - UINT32 m_s3c240x_memcon_regs[0x34/4]; - UINT32 m_s3c240x_usb_host_regs[0x5C/4]; - UINT32 m_s3c240x_uart_0_regs[0x2C/4]; - UINT32 m_s3c240x_uart_1_regs[0x2C/4]; - UINT32 m_s3c240x_usb_device_regs[0xBC/4]; - UINT32 m_s3c240x_watchdog_regs[0x0C/4]; + uint32_t m_s3c240x_gpio[0x60/4]; + uint32_t m_s3c240x_memcon_regs[0x34/4]; + uint32_t m_s3c240x_usb_host_regs[0x5C/4]; + uint32_t m_s3c240x_uart_0_regs[0x2C/4]; + uint32_t m_s3c240x_uart_1_regs[0x2C/4]; + uint32_t m_s3c240x_usb_device_regs[0xBC/4]; + uint32_t m_s3c240x_watchdog_regs[0x0C/4]; s3c240x_iic_t m_s3c240x_iic; emu_timer *m_s3c240x_iic_timer; - UINT32 m_s3c240x_iic_regs[0x10/4]; + uint32_t m_s3c240x_iic_regs[0x10/4]; s3c240x_iis_t m_s3c240x_iis; emu_timer *m_s3c240x_iis_timer; - UINT32 m_s3c240x_iis_regs[0x14/4]; - UINT32 m_s3c240x_rtc_regs[0x4C/4]; - UINT32 m_s3c240x_adc_regs[0x08/4]; - UINT32 m_s3c240x_spi_regs[0x18/4]; - UINT32 m_s3c240x_mmc_regs[0x40/4]; + uint32_t m_s3c240x_iis_regs[0x14/4]; + uint32_t m_s3c240x_rtc_regs[0x4C/4]; + uint32_t m_s3c240x_adc_regs[0x08/4]; + uint32_t m_s3c240x_spi_regs[0x18/4]; + uint32_t m_s3c240x_mmc_regs[0x40/4]; bitmap_rgb32 m_bitmap; DECLARE_READ32_MEMBER(s3c240x_lcd_r); DECLARE_WRITE32_MEMBER(s3c240x_lcd_w); @@ -178,7 +178,7 @@ public: DECLARE_WRITE32_MEMBER(s3c240x_mmc_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_gp32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gp32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(s3c240x_lcd_timer_exp); TIMER_CALLBACK_MEMBER(s3c240x_pwm_timer_exp); TIMER_CALLBACK_MEMBER(s3c240x_dma_timer_exp); @@ -194,9 +194,9 @@ protected: required_ioport m_io_in1; required_device m_palette; - UINT32 s3c240x_get_fclk(int reg); - UINT32 s3c240x_get_hclk(int reg); - UINT32 s3c240x_get_pclk(int reg); + uint32_t s3c240x_get_fclk(int reg); + uint32_t s3c240x_get_hclk(int reg); + uint32_t s3c240x_get_pclk(int reg); void s3c240x_lcd_dma_reload(); void s3c240x_lcd_dma_init(); void s3c240x_lcd_configure(); @@ -204,7 +204,7 @@ protected: void s3c240x_lcd_stop(); void s3c240x_lcd_recalc(); void s3c240x_check_pending_irq(); - void s3c240x_request_irq(UINT32 int_type); + void s3c240x_request_irq(uint32_t int_type); void s3c240x_dma_reload(int dma); void s3c240x_dma_trigger(int dma); void s3c240x_dma_request_iis(); @@ -220,21 +220,21 @@ protected: void s3c240x_iis_recalc(); void smc_reset(); void smc_init(); - UINT8 smc_read(); - void smc_write(UINT8 data); + uint8_t smc_read(); + void smc_write(uint8_t data); void smc_update(); void i2s_reset(); void i2s_init(); void i2s_write(int line, int data); - UINT8 eeprom_read(UINT16 address); - void eeprom_write(UINT16 address, UINT8 data); + uint8_t eeprom_read(uint16_t address); + void eeprom_write(uint16_t address, uint8_t data); void iic_start(); void iic_stop(); void iic_resume(); void s3c240x_machine_start(); void s3c240x_machine_reset(); - inline rgb_t s3c240x_get_color_5551( UINT16 data); - UINT32 s3c240x_lcd_dma_read( ); + inline rgb_t s3c240x_get_color_5551( uint16_t data); + uint32_t s3c240x_lcd_dma_read( ); void s3c240x_lcd_render_01( ); void s3c240x_lcd_render_02( ); void s3c240x_lcd_render_04( ); diff --git a/src/mame/includes/gradius3.h b/src/mame/includes/gradius3.h index 98061d26ece..26c1d632953 100644 --- a/src/mame/includes/gradius3.h +++ b/src/mame/includes/gradius3.h @@ -25,8 +25,8 @@ public: m_k051960(*this, "k051960") { } /* memory pointers */ - required_shared_ptr m_gfxram; - required_region_ptr m_gfxrom; + required_shared_ptr m_gfxram; + required_region_ptr m_gfxrom; /* misc */ int m_priority; @@ -57,7 +57,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_gradius3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gradius3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(cpuA_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(gradius3_sub_scanline); void gradius3_postload(); diff --git a/src/mame/includes/grchamp.h b/src/mame/includes/grchamp.h index af20e887316..129a12abfe3 100644 --- a/src/mame/includes/grchamp.h +++ b/src/mame/includes/grchamp.h @@ -41,25 +41,25 @@ public: required_device m_screen; required_device m_soundlatch; - required_shared_ptr m_radarram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_leftram; - required_shared_ptr m_rightram; - required_shared_ptr m_centerram; + required_shared_ptr m_radarram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_leftram; + required_shared_ptr m_rightram; + required_shared_ptr m_centerram; - UINT8 m_cpu0_out[16]; - UINT8 m_cpu1_out[16]; + uint8_t m_cpu0_out[16]; + uint8_t m_cpu1_out[16]; - UINT8 m_comm_latch; - UINT8 m_comm_latch2[4]; + uint8_t m_comm_latch; + uint8_t m_comm_latch2[4]; - UINT16 m_ledlatch; - UINT8 m_ledaddr; - UINT16 m_ledram[8]; + uint16_t m_ledlatch; + uint8_t m_ledaddr; + uint16_t m_ledram[8]; - UINT16 m_collide; - UINT8 m_collmode; + uint16_t m_collide; + uint8_t m_collmode; bitmap_ind16 m_work_bitmap; tilemap_t * m_text_tilemap; @@ -77,7 +77,7 @@ public: DECLARE_READ8_MEMBER(sub_to_main_comm_r); DECLARE_WRITE8_MEMBER(main_to_sub_comm_w); DECLARE_READ8_MEMBER(main_to_sub_comm_r); - UINT8 get_pc3259_bits(int offs); + uint8_t get_pc3259_bits(int offs); DECLARE_WRITE8_MEMBER(left_w); DECLARE_WRITE8_MEMBER(center_w); DECLARE_WRITE8_MEMBER(right_w); @@ -101,8 +101,8 @@ public: INTERRUPT_GEN_MEMBER(cpu1_interrupt); TIMER_CALLBACK_MEMBER(main_to_sub_comm_sync_w); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void draw_objects(int y, UINT8 *objdata); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void draw_objects(int y, uint8_t *objdata); }; /* Discrete Sound Input Nodes */ diff --git a/src/mame/includes/gridlee.h b/src/mame/includes/gridlee.h index 4aea8304969..cfe35ad79f2 100644 --- a/src/mame/includes/gridlee.h +++ b/src/mame/includes/gridlee.h @@ -33,23 +33,23 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; required_device m_maincpu; required_device m_screen; required_device m_palette; - UINT8 m_last_analog_input[2]; - UINT8 m_last_analog_output[2]; - std::unique_ptr m_poly17; - UINT8 *m_rand17; + uint8_t m_last_analog_input[2]; + uint8_t m_last_analog_output[2]; + std::unique_ptr m_poly17; + uint8_t *m_rand17; emu_timer *m_irq_off; emu_timer *m_irq_timer; emu_timer *m_firq_off; emu_timer *m_firq_timer; - UINT8 m_cocktail_flip; - std::unique_ptr m_local_videoram; - UINT8 m_palettebank_vis; + uint8_t m_cocktail_flip; + std::unique_ptr m_local_videoram; + uint8_t m_palettebank_vis; DECLARE_READ8_MEMBER(analog_port_r); DECLARE_READ8_MEMBER(random_num_r); @@ -63,7 +63,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(gridlee); - UINT32 screen_update_gridlee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gridlee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(irq_off_tick); TIMER_CALLBACK_MEMBER(irq_timer_tick); TIMER_CALLBACK_MEMBER(firq_off_tick); @@ -79,7 +79,7 @@ class gridlee_sound_device : public device_t, public device_sound_interface { public: - gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~gridlee_sound_device() { } protected: @@ -94,15 +94,15 @@ public: private: /* tone variables */ - UINT32 m_tone_step; - UINT32 m_tone_fraction; - UINT8 m_tone_volume; + uint32_t m_tone_step; + uint32_t m_tone_fraction; + uint8_t m_tone_volume; /* sound streaming variables */ sound_stream *m_stream; samples_device *m_samples; double m_freq_to_step; - UINT8 m_sound_data[24]; + uint8_t m_sound_data[24]; }; extern const device_type GRIDLEE; diff --git a/src/mame/includes/groundfx.h b/src/mame/includes/groundfx.h index c315be145e1..8784a9810ea 100644 --- a/src/mame/includes/groundfx.h +++ b/src/mame/includes/groundfx.h @@ -34,8 +34,8 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_ram; - required_shared_ptr m_spriteram; + required_shared_ptr m_ram; + required_shared_ptr m_spriteram; required_device m_maincpu; required_device m_watchdog; @@ -44,11 +44,11 @@ public: required_device m_gfxdecode; required_device m_palette; - UINT16 m_coin_word; - UINT16 m_frame_counter; - UINT16 m_port_sel; + uint16_t m_coin_word; + uint16_t m_frame_counter; + uint16_t m_port_sel; std::unique_ptr m_spritelist; - UINT16 m_rotate_ctrl[8]; + uint16_t m_rotate_ctrl[8]; rectangle m_hack_cliprect; DECLARE_WRITE32_MEMBER(groundfx_input_w); @@ -61,7 +61,7 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(coin_word_r); DECLARE_DRIVER_INIT(groundfx); virtual void video_start() override; - UINT32 screen_update_groundfx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_groundfx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(groundfx_interrupt); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,int do_hack,int x_offs,int y_offs); diff --git a/src/mame/includes/gstriker.h b/src/mame/includes/gstriker.h index 68e9bbdbc66..cbc07047908 100644 --- a/src/mame/includes/gstriker.h +++ b/src/mame/includes/gstriker.h @@ -41,16 +41,16 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_CG10103_m_vram; - required_shared_ptr m_work_ram; - required_shared_ptr m_mixerregs1; - required_shared_ptr m_mixerregs2; + required_shared_ptr m_CG10103_m_vram; + required_shared_ptr m_work_ram; + required_shared_ptr m_mixerregs1; + required_shared_ptr m_mixerregs2; - UINT16 m_dmmy_8f_ret; + uint16_t m_dmmy_8f_ret; int m_pending_command; int m_gametype; - UINT16 m_mcu_data; - UINT16 m_prot_reg[2]; + uint16_t m_mcu_data; + uint16_t m_prot_reg[2]; // common DECLARE_READ16_MEMBER(dmmy_8f); @@ -74,7 +74,7 @@ public: DECLARE_DRIVER_INIT(vgoalsoc); DECLARE_DRIVER_INIT(twrldc94); - 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); void mcu_init(); }; diff --git a/src/mame/includes/gsword.h b/src/mame/includes/gsword.h index c8caa962bfb..27496342010 100644 --- a/src/mame/includes/gsword.h +++ b/src/mame/includes/gsword.h @@ -35,11 +35,11 @@ public: required_device m_palette; optional_device m_soundlatch; // not josvolly - required_shared_ptr m_spritetile_ram; - required_shared_ptr m_spritexy_ram; - required_shared_ptr m_spriteattrib_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_cpu2_ram; + required_shared_ptr m_spritetile_ram; + required_shared_ptr m_spritexy_ram; + required_shared_ptr m_spriteattrib_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_cpu2_ram; int m_coins; //currently initialized but not used int m_fake8910_0; @@ -79,7 +79,7 @@ public: DECLARE_PALETTE_INIT(gsword); DECLARE_PALETTE_INIT(josvolly); - UINT32 screen_update_gsword(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gsword(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(gsword_snd_interrupt); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/gumbo.h b/src/mame/includes/gumbo.h index d95628aacfb..f09488d11ed 100644 --- a/src/mame/includes/gumbo.h +++ b/src/mame/includes/gumbo.h @@ -17,8 +17,8 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -28,7 +28,7 @@ public: TILE_GET_INFO_MEMBER(get_gumbo_bg_tile_info); TILE_GET_INFO_MEMBER(get_gumbo_fg_tile_info); virtual void video_start() override; - UINT32 screen_update_gumbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gumbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; diff --git a/src/mame/includes/gunbustr.h b/src/mame/includes/gunbustr.h index e1d43b5a29b..565cdec6120 100644 --- a/src/mame/includes/gunbustr.h +++ b/src/mame/includes/gunbustr.h @@ -39,16 +39,16 @@ public: required_device m_maincpu; required_device m_watchdog; required_device m_tc0480scp; - required_shared_ptr m_ram; - required_shared_ptr m_spriteram; + required_shared_ptr m_ram; + required_shared_ptr m_spriteram; required_device m_eeprom; required_device m_gfxdecode; required_device m_palette; bool m_coin_lockout; - UINT16 m_coin_word; + uint16_t m_coin_word; std::unique_ptr m_spritelist; - UINT32 m_mem[2]; + uint32_t m_mem[2]; DECLARE_WRITE32_MEMBER(gunbustr_input_w); DECLARE_WRITE32_MEMBER(motor_control_w); @@ -59,7 +59,7 @@ public: DECLARE_DRIVER_INIT(gunbustrj); DECLARE_DRIVER_INIT(gunbustr); virtual void video_start() override; - UINT32 screen_update_gunbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gunbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(gunbustr_interrupt); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs); diff --git a/src/mame/includes/gundealr.h b/src/mame/includes/gundealr.h index 5afbcf87317..dff065de3b2 100644 --- a/src/mame/includes/gundealr.h +++ b/src/mame/includes/gundealr.h @@ -20,16 +20,16 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_paletteram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_rambase; + required_shared_ptr m_paletteram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_rambase; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; int m_flipscreen; - UINT8 m_scroll[4]; + uint8_t m_scroll[4]; /* misc */ int m_input_ports_hack; @@ -46,7 +46,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_gundealr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gundealr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(gundealr_scanline); TIMER_DEVICE_CALLBACK_MEMBER(yamyam_mcu_sim); required_device m_maincpu; diff --git a/src/mame/includes/gunsmoke.h b/src/mame/includes/gunsmoke.h index 2c5d43e0446..d072ae0f825 100644 --- a/src/mame/includes/gunsmoke.h +++ b/src/mame/includes/gunsmoke.h @@ -21,19 +21,19 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_scrollx; - required_shared_ptr m_scrolly; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_scrollx; + required_shared_ptr m_scrolly; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_chon; - UINT8 m_objon; - UINT8 m_bgon; - UINT8 m_sprite3bank; + uint8_t m_chon; + uint8_t m_objon; + uint8_t m_bgon; + uint8_t m_sprite3bank; DECLARE_READ8_MEMBER(gunsmoke_protection_r); DECLARE_WRITE8_MEMBER(gunsmoke_videoram_w); DECLARE_WRITE8_MEMBER(gunsmoke_colorram_w); @@ -45,7 +45,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(gunsmoke); - UINT32 screen_update_gunsmoke(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gunsmoke(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/gyruss.h b/src/mame/includes/gyruss.h index 1c9bfd88e02..d4b9e9dfc8f 100644 --- a/src/mame/includes/gyruss.h +++ b/src/mame/includes/gyruss.h @@ -33,17 +33,17 @@ public: required_device m_audiocpu; required_device m_audiocpu_2; required_device m_discrete; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_flipscreen; - required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_flipscreen; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; tilemap_t *m_tilemap; - UINT8 m_master_nmi_mask; - UINT8 m_slave_irq_mask; + uint8_t m_master_nmi_mask; + uint8_t m_slave_irq_mask; DECLARE_WRITE8_MEMBER(gyruss_irq_clear_w); DECLARE_WRITE8_MEMBER(gyruss_sh_irqtrigger_w); @@ -61,7 +61,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(gyruss); - UINT32 screen_update_gyruss(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gyruss(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(master_vblank_irq); INTERRUPT_GEN_MEMBER(slave_vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/hanaawas.h b/src/mame/includes/hanaawas.h index c93da152942..2aa55582ee5 100644 --- a/src/mame/includes/hanaawas.h +++ b/src/mame/includes/hanaawas.h @@ -17,8 +17,8 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -35,7 +35,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(hanaawas); - UINT32 screen_update_hanaawas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hanaawas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(hanaawas_portB_w); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h index 1e0394d6e17..24797461b21 100644 --- a/src/mame/includes/harddriv.h +++ b/src/mame/includes/harddriv.h @@ -44,7 +44,7 @@ class harddriv_state : public device_t /* public device_video_interface */ { public: - harddriv_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + harddriv_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void init_strtdriv(void); @@ -264,55 +264,55 @@ protected: optional_device m_screen; optional_device m_duartn68681; - UINT8 m_hd34010_host_access; + uint8_t m_hd34010_host_access; - optional_shared_ptr m_msp_ram; + optional_shared_ptr m_msp_ram; - UINT16 * m_dsk_ram; - UINT16 * m_dsk_rom; + uint16_t * m_dsk_ram; + uint16_t * m_dsk_rom; optional_device m_dsk_10c; optional_device m_dsk_30c; - UINT8 m_dsk_pio_access; + uint8_t m_dsk_pio_access; - UINT16 * m_m68k_slapstic_base; - UINT16 * m_m68k_sloop_alt_base; + uint16_t * m_m68k_slapstic_base; + uint16_t * m_m68k_sloop_alt_base; required_device m_200e; required_device m_210e; - optional_shared_ptr m_adsp_data_memory; - optional_shared_ptr m_adsp_pgm_memory; + optional_shared_ptr m_adsp_data_memory; + optional_shared_ptr m_adsp_pgm_memory; - optional_shared_ptr m_ds3sdsp_data_memory; - optional_shared_ptr m_ds3sdsp_pgm_memory; - optional_shared_ptr m_ds3xdsp_pgm_memory; + optional_shared_ptr m_ds3sdsp_data_memory; + optional_shared_ptr m_ds3sdsp_pgm_memory; + optional_shared_ptr m_ds3xdsp_pgm_memory; - optional_shared_ptr m_dsp32_ram; + optional_shared_ptr m_dsp32_ram; - UINT16 * m_gsp_protection; + uint16_t * m_gsp_protection; - UINT16 * m_gsp_speedup_addr[2]; + uint16_t * m_gsp_speedup_addr[2]; offs_t m_gsp_speedup_pc; - UINT16 * m_msp_speedup_addr; + uint16_t * m_msp_speedup_addr; offs_t m_msp_speedup_pc; - UINT16 * m_ds3_speedup_addr; + uint16_t * m_ds3_speedup_addr; offs_t m_ds3_speedup_pc; offs_t m_ds3_transfer_pc; - UINT32 * m_rddsp32_sync[2]; + uint32_t * m_rddsp32_sync[2]; - UINT32 m_gsp_speedup_count[4]; - UINT32 m_msp_speedup_count[4]; - UINT32 m_adsp_speedup_count[4]; + uint32_t m_gsp_speedup_count[4]; + uint32_t m_msp_speedup_count[4]; + uint32_t m_adsp_speedup_count[4]; - UINT8 m_gsp_multisync; - optional_shared_ptr m_gsp_vram; - optional_shared_ptr m_gsp_control_lo; - optional_shared_ptr m_gsp_control_hi; - optional_shared_ptr m_gsp_paletteram_lo; - optional_shared_ptr m_gsp_paletteram_hi; + uint8_t m_gsp_multisync; + optional_shared_ptr m_gsp_vram; + optional_shared_ptr m_gsp_control_lo; + optional_shared_ptr m_gsp_control_hi; + optional_shared_ptr m_gsp_paletteram_lo; + optional_shared_ptr m_gsp_paletteram_hi; required_ioport m_in0; optional_ioport m_sw1; @@ -321,93 +321,93 @@ protected: optional_ioport_array<4> m_12badc; /* machine state */ - UINT8 m_irq_state; - UINT8 m_gsp_irq_state; - UINT8 m_msp_irq_state; - UINT8 m_adsp_irq_state; - UINT8 m_ds3sdsp_irq_state; - UINT8 m_duart_irq_state; - - UINT8 m_last_gsp_shiftreg; - - UINT8 m_m68k_zp1; - UINT8 m_m68k_zp2; - UINT8 m_m68k_adsp_buffer_bank; - - UINT8 m_adsp_halt; - UINT8 m_adsp_br; - UINT8 m_adsp_xflag; - UINT16 m_adsp_sim_address; - UINT16 m_adsp_som_address; - UINT32 m_adsp_eprom_base; - - required_region_ptr m_sim_memory; - UINT16 m_som_memory[0x8000/2]; - UINT16 * m_adsp_pgm_memory_word; - - optional_region_ptr m_ds3_sdata_memory; - UINT32 m_ds3_sdata_memory_size; - - UINT8 m_ds3_gcmd; - UINT8 m_ds3_gflag; - UINT8 m_ds3_g68irqs; - UINT8 m_ds3_gfirqs; - UINT8 m_ds3_g68flag; - UINT8 m_ds3_send; - UINT8 m_ds3_reset; - UINT16 m_ds3_gdata; - UINT16 m_ds3_g68data; - UINT32 m_ds3_sim_address; - - UINT8 m_ds3_scmd; - UINT8 m_ds3_sflag; - UINT8 m_ds3_s68irqs; - UINT8 m_ds3_sfirqs; - UINT8 m_ds3_s68flag; - UINT8 m_ds3_sreset; - UINT16 m_ds3_sdata; - UINT16 m_ds3_s68data; - UINT32 m_ds3_sdata_address; - UINT16 m_ds3sdsp_regs[32]; - UINT16 m_ds3sdsp_timer_en; - UINT16 m_ds3sdsp_sdata; + uint8_t m_irq_state; + uint8_t m_gsp_irq_state; + uint8_t m_msp_irq_state; + uint8_t m_adsp_irq_state; + uint8_t m_ds3sdsp_irq_state; + uint8_t m_duart_irq_state; + + uint8_t m_last_gsp_shiftreg; + + uint8_t m_m68k_zp1; + uint8_t m_m68k_zp2; + uint8_t m_m68k_adsp_buffer_bank; + + uint8_t m_adsp_halt; + uint8_t m_adsp_br; + uint8_t m_adsp_xflag; + uint16_t m_adsp_sim_address; + uint16_t m_adsp_som_address; + uint32_t m_adsp_eprom_base; + + required_region_ptr m_sim_memory; + uint16_t m_som_memory[0x8000/2]; + uint16_t * m_adsp_pgm_memory_word; + + optional_region_ptr m_ds3_sdata_memory; + uint32_t m_ds3_sdata_memory_size; + + uint8_t m_ds3_gcmd; + uint8_t m_ds3_gflag; + uint8_t m_ds3_g68irqs; + uint8_t m_ds3_gfirqs; + uint8_t m_ds3_g68flag; + uint8_t m_ds3_send; + uint8_t m_ds3_reset; + uint16_t m_ds3_gdata; + uint16_t m_ds3_g68data; + uint32_t m_ds3_sim_address; + + uint8_t m_ds3_scmd; + uint8_t m_ds3_sflag; + uint8_t m_ds3_s68irqs; + uint8_t m_ds3_sfirqs; + uint8_t m_ds3_s68flag; + uint8_t m_ds3_sreset; + uint16_t m_ds3_sdata; + uint16_t m_ds3_s68data; + uint32_t m_ds3_sdata_address; + uint16_t m_ds3sdsp_regs[32]; + uint16_t m_ds3sdsp_timer_en; + uint16_t m_ds3sdsp_sdata; optional_device m_ds3sdsp_internal_timer; - UINT16 m_ds3xdsp_regs[32]; - UINT16 m_ds3xdsp_timer_en; - UINT16 m_ds3xdsp_sdata; + uint16_t m_ds3xdsp_regs[32]; + uint16_t m_ds3xdsp_timer_en; + uint16_t m_ds3xdsp_sdata; optional_device m_ds3xdsp_internal_timer; - UINT16 m_adc_control; - UINT8 m_adc8_select; - UINT8 m_adc8_data; - UINT8 m_adc12_select; - UINT8 m_adc12_byte; - UINT16 m_adc12_data; + uint16_t m_adc_control; + uint8_t m_adc8_select; + uint8_t m_adc8_data; + uint8_t m_adc12_select; + uint8_t m_adc12_byte; + uint16_t m_adc12_data; - UINT16 m_hdc68k_last_wheel; - UINT16 m_hdc68k_last_port1; - UINT8 m_hdc68k_wheel_edge; - UINT8 m_hdc68k_shifter_state; + uint16_t m_hdc68k_last_wheel; + uint16_t m_hdc68k_last_port1; + uint8_t m_hdc68k_wheel_edge; + uint8_t m_hdc68k_shifter_state; - UINT8 m_st68k_sloop_bank; + uint8_t m_st68k_sloop_bank; offs_t m_st68k_last_alt_sloop_offset; #define MAX_MSP_SYNC 16 - UINT32 * m_dataptr[MAX_MSP_SYNC]; - UINT32 m_dataval[MAX_MSP_SYNC]; + uint32_t * m_dataptr[MAX_MSP_SYNC]; + uint32_t m_dataval[MAX_MSP_SYNC]; int m_next_msp_sync; /* video state */ offs_t m_vram_mask; - UINT8 m_shiftreg_enable; + uint8_t m_shiftreg_enable; - UINT32 m_mask_table[65536 * 4]; - UINT8 * m_gsp_shiftreg_source; + uint32_t m_mask_table[65536 * 4]; + uint8_t * m_gsp_shiftreg_source; - INT8 m_gfx_finescroll; - UINT8 m_gfx_palettebank; + int8_t m_gfx_finescroll; + uint8_t m_gfx_palettebank; virtual void update_interrupts(); void init_driver(); void init_multisync(int compact_inputs); @@ -440,8 +440,8 @@ protected: inline void gsp_palette_change(int offset); - UINT8 m_sound_int_state; - UINT8 m_video_int_state; + uint8_t m_sound_int_state; + uint8_t m_video_int_state; optional_device m_palette; int get_hblank(screen_device &screen) const { return (screen.hpos() > (screen.width() * 9 / 10)); } @@ -457,7 +457,7 @@ class harddriv_sound_board_device : public device_t { public: // construction/destruction - harddriv_sound_board_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + harddriv_sound_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~harddriv_sound_board_device() {} DECLARE_READ16_MEMBER(hd68k_snd_data_r); @@ -499,21 +499,21 @@ private: required_device m_soundcpu; required_device m_dac; required_device m_sounddsp; - required_shared_ptr m_sounddsp_ram; - required_region_ptr m_sound_rom; + required_shared_ptr m_sounddsp_ram; + required_region_ptr m_sound_rom; - UINT8 m_soundflag; - UINT8 m_mainflag; - UINT16 m_sounddata; - UINT16 m_maindata; + uint8_t m_soundflag; + uint8_t m_mainflag; + uint16_t m_sounddata; + uint16_t m_maindata; - UINT8 m_cramen; - UINT8 m_irq68k; + uint8_t m_cramen; + uint8_t m_irq68k; offs_t m_sound_rom_offs; - UINT16 m_comram[0x400/2]; - UINT64 m_last_bio_cycles; + uint16_t m_comram[0x400/2]; + uint64_t m_last_bio_cycles; void update_68k_interrupts(); TIMER_CALLBACK_MEMBER( delayed_68k_w ); @@ -524,7 +524,7 @@ private: class harddriv_board_device_state : public harddriv_state { public: - harddriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + harddriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -537,7 +537,7 @@ protected: class harddrivc_board_device_state : public harddriv_state { public: - harddrivc_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + harddrivc_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -550,7 +550,7 @@ protected: class racedriv_board_device_state : public harddriv_state { public: - racedriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + racedriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -561,7 +561,7 @@ protected: class racedrivb1_board_device_state : public racedriv_board_device_state { public: - racedrivb1_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + racedrivb1_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : racedriv_board_device_state(mconfig, tag, owner, clock) {}; @@ -574,7 +574,7 @@ protected: class racedrivc_board_device_state : public harddriv_state { public: - racedrivc_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + racedrivc_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -585,7 +585,7 @@ protected: class racedrivc1_board_device_state : public racedrivc_board_device_state { public: - racedrivc1_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + racedrivc1_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : racedrivc_board_device_state(mconfig, tag, owner, clock) {}; protected: @@ -595,7 +595,7 @@ protected: class racedrivc_panorama_side_board_device_state : public racedrivc_board_device_state { public: - racedrivc_panorama_side_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + racedrivc_panorama_side_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : racedrivc_board_device_state(mconfig, tag, owner, clock) {}; protected: @@ -609,7 +609,7 @@ protected: class stunrun_board_device_state : public harddriv_state { public: - stunrun_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + stunrun_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -622,7 +622,7 @@ protected: class steeltal_board_device_state : public harddriv_state { public: - steeltal_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + steeltal_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -633,7 +633,7 @@ protected: class steeltal1_board_device_state : public steeltal_board_device_state { public: - steeltal1_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + steeltal1_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : steeltal_board_device_state(mconfig, tag, owner, clock) {}; @@ -644,7 +644,7 @@ protected: class steeltalp_board_device_state : public steeltal_board_device_state { public: - steeltalp_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + steeltalp_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : steeltal_board_device_state(mconfig, tag, owner, clock) {}; @@ -659,7 +659,7 @@ protected: class strtdriv_board_device_state : public harddriv_state { public: - strtdriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + strtdriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -672,7 +672,7 @@ protected: class hdrivair_board_device_state : public harddriv_state { public: - hdrivair_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hdrivair_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -683,7 +683,7 @@ protected: class hdrivairp_board_device_state : public hdrivair_board_device_state { public: - hdrivairp_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + hdrivairp_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hdrivair_board_device_state(mconfig, tag, owner, clock) {}; diff --git a/src/mame/includes/hcastle.h b/src/mame/includes/hcastle.h index 12874f11e62..8764b45c24f 100644 --- a/src/mame/includes/hcastle.h +++ b/src/mame/includes/hcastle.h @@ -30,8 +30,8 @@ public: required_device m_spriteram; required_device m_spriteram2; /* memory pointers */ - required_shared_ptr m_pf1_videoram; - required_shared_ptr m_pf2_videoram; + required_shared_ptr m_pf1_videoram; + required_shared_ptr m_pf2_videoram; /* video-related */ tilemap_t *m_fg_tilemap; @@ -65,8 +65,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(hcastle); - UINT32 screen_update_hcastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT8 *sbank, int bank ); + uint32_t screen_update_hcastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint8_t *sbank, int bank ); DECLARE_WRITE8_MEMBER(volume_callback); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/hec2hrp.h b/src/mame/includes/hec2hrp.h index 7db213d0443..f4aae92e3ad 100644 --- a/src/mame/includes/hec2hrp.h +++ b/src/mame/includes/hec2hrp.h @@ -95,42 +95,42 @@ public: required_device m_cassette; required_device m_sn; required_device m_palette; - optional_shared_ptr m_videoram; - optional_shared_ptr m_hector_videoram; + optional_shared_ptr m_videoram; + optional_shared_ptr m_hector_videoram; required_ioport_array<9> m_keyboard; optional_device m_minidisc_fdc; optional_device m_floppy0; - UINT8 m_hector_flag_hr; - UINT8 m_hector_flag_80c; - UINT8 m_hector_color[4]; - UINT8 m_hector_disc2_data_r_ready; - UINT8 m_hector_disc2_data_w_ready; - UINT8 m_hector_disc2_data_read; - UINT8 m_hector_disc2_data_write; - UINT8 m_hector_disc2_RNMI; - UINT8 m_state3000; - UINT8 m_write_cassette; + uint8_t m_hector_flag_hr; + uint8_t m_hector_flag_80c; + uint8_t m_hector_color[4]; + uint8_t m_hector_disc2_data_r_ready; + uint8_t m_hector_disc2_data_w_ready; + uint8_t m_hector_disc2_data_read; + uint8_t m_hector_disc2_data_write; + uint8_t m_hector_disc2_RNMI; + uint8_t m_state3000; + uint8_t m_write_cassette; emu_timer *m_Cassette_timer; - UINT8 m_CK_signal ; - UINT8 m_flag_clk; + uint8_t m_CK_signal ; + uint8_t m_flag_clk; double m_Pin_Value[29][2]; int m_AU[17]; int m_ValMixer; int m_oldstate3000; int m_oldstate1000; - UINT8 m_pot0; - UINT8 m_pot1; - UINT8 m_actions; - UINT8 m_hector_port_a; - UINT8 m_hector_port_b; - UINT8 m_hector_port_c_h; - UINT8 m_hector_port_c_l; - UINT8 m_hector_port_cmd; - UINT8 m_cassette_bit; - UINT8 m_cassette_bit_mem; - UINT8 m_Data_K7; + uint8_t m_pot0; + uint8_t m_pot1; + uint8_t m_actions; + uint8_t m_hector_port_a; + uint8_t m_hector_port_b; + uint8_t m_hector_port_c_h; + uint8_t m_hector_port_c_l; + uint8_t m_hector_port_cmd; + uint8_t m_cassette_bit; + uint8_t m_cassette_bit_mem; + uint8_t m_Data_K7; int m_counter_write; int m_IRQ_current_state; int m_NMI_current_state; @@ -138,7 +138,7 @@ public: int m_hector_nb_cde; int m_hector_flag_result; int m_print; - UINT8 m_hector_videoram_hrx[0x04000]; + uint8_t m_hector_videoram_hrx[0x04000]; DECLARE_WRITE8_MEMBER(minidisc_control_w); @@ -162,7 +162,7 @@ public: DECLARE_MACHINE_RESET(hec2hrx); DECLARE_MACHINE_START(hec2mdhrx); DECLARE_MACHINE_RESET(hec2mdhrx); - UINT32 screen_update_hec2hrp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hec2hrp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(Callback_CK); DECLARE_WRITE_LINE_MEMBER( disc2_fdc_interrupt ); @@ -173,12 +173,12 @@ public: int isHectoreXtend(); void Mise_A_Jour_Etat(int Adresse, int Value ); void Init_Value_SN76477_Hector(); - void Update_Sound(address_space &space, UINT8 data); + void Update_Sound(address_space &space, uint8_t data); void hector_reset(int hr, int with_D2 ); void hector_init(); void Init_Hector_Palette(); - void hector_80c(bitmap_ind16 &bitmap, UINT8 *page, int ymax, int yram) ; - void hector_hr(bitmap_ind16 &bitmap, UINT8 *page, int ymax, int yram) ; + void hector_80c(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram) ; + void hector_hr(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram) ; /*----------- defined in machine/hecdisk2.c -----------*/ // disc2 handling diff --git a/src/mame/includes/hexion.h b/src/mame/includes/hexion.h index e341d1f7687..b20fcc02861 100644 --- a/src/mame/includes/hexion.h +++ b/src/mame/includes/hexion.h @@ -16,8 +16,8 @@ public: required_device m_k053252; required_device m_gfxdecode; - UINT8 *m_vram[2]; - UINT8 *m_unkram; + uint8_t *m_vram[2]; + uint8_t *m_unkram; int m_bankctrl; int m_rambank; int m_pmcbank; @@ -40,6 +40,6 @@ public: virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - inline void get_tile_info(tile_data &tileinfo,int tile_index,UINT8 *ram); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + inline void get_tile_info(tile_data &tileinfo,int tile_index,uint8_t *ram); }; diff --git a/src/mame/includes/hh_tms1k.h b/src/mame/includes/hh_tms1k.h index 96c26f4eac6..d08aa797a76 100644 --- a/src/mame/includes/hh_tms1k.h +++ b/src/mame/includes/hh_tms1k.h @@ -39,14 +39,14 @@ public: optional_device m_speaker; // misc common - UINT16 m_r; // MCU R-pins data - UINT16 m_o; // MCU O-pins data - UINT32 m_inp_mux; // multiplexed inputs mask + uint16_t m_r; // MCU R-pins data + uint16_t m_o; // MCU O-pins data + uint32_t m_inp_mux; // multiplexed inputs mask bool m_power_on; bool m_power_led; - UINT8 read_inputs(int columns); - UINT8 read_rotated_inputs(int columns, UINT8 rowmask = 0xf); + uint8_t read_inputs(int columns); + uint8_t read_rotated_inputs(int columns, uint8_t rowmask = 0xf); virtual DECLARE_INPUT_CHANGED_MEMBER(power_button); virtual DECLARE_WRITE_LINE_MEMBER(auto_power_off); @@ -55,19 +55,19 @@ public: int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 31 for now) - UINT32 m_grid; // VFD/LED current row data - UINT32 m_plate; // VFD/LED current column data + uint32_t m_grid; // VFD/LED current row data + uint32_t m_plate; // VFD/LED current column data - UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) + uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + uint32_t m_display_cache[0x20]; // (internal use) + uint8_t m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); void set_display_size(int maxx, int maxy); - void set_display_segmask(UINT32 digits, UINT32 mask); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true); + void set_display_segmask(uint32_t digits, uint32_t mask); + void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true); protected: virtual void machine_start() override; diff --git a/src/mame/includes/hh_ucom4.h b/src/mame/includes/hh_ucom4.h index 9779570f090..d71115e3fc4 100644 --- a/src/mame/includes/hh_ucom4.h +++ b/src/mame/includes/hh_ucom4.h @@ -35,11 +35,11 @@ public: optional_device m_speaker; // misc common - UINT8 m_port[9]; // MCU port A-I write data (optional) - UINT8 m_int; // MCU INT pin state - UINT16 m_inp_mux; // multiplexed inputs mask + uint8_t m_port[9]; // MCU port A-I write data (optional) + uint8_t m_int; // MCU INT pin state + uint16_t m_inp_mux; // multiplexed inputs mask - UINT8 read_inputs(int columns); + uint8_t read_inputs(int columns); void refresh_interrupts(void); void set_interrupt(int state); DECLARE_INPUT_CHANGED_MEMBER(single_interrupt_line); @@ -49,18 +49,18 @@ public: int m_display_maxy; // display matrix number of rows int m_display_maxx; // display matrix number of columns (max 31 for now) - UINT32 m_grid; // VFD current row data - UINT32 m_plate; // VFD current column data + uint32_t m_grid; // VFD current row data + uint32_t m_plate; // VFD current column data - UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) + uint32_t m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + uint16_t m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + uint32_t m_display_cache[0x20]; // (internal use) + uint8_t m_display_decay[0x20][0x20]; // (internal use) TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); void display_update(); void set_display_size(int maxx, int maxy); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true); + void display_matrix(int maxx, int maxy, uint32_t setx, uint32_t sety, bool update = true); protected: virtual void machine_start() override; diff --git a/src/mame/includes/higemaru.h b/src/mame/includes/higemaru.h index a39d0c5a251..7c7583ad35e 100644 --- a/src/mame/includes/higemaru.h +++ b/src/mame/includes/higemaru.h @@ -19,9 +19,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -31,7 +31,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(higemaru); - UINT32 screen_update_higemaru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_higemaru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(higemaru_scanline); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; diff --git a/src/mame/includes/himesiki.h b/src/mame/includes/himesiki.h index 4a5338cf56d..bca67b92f9f 100644 --- a/src/mame/includes/himesiki.h +++ b/src/mame/includes/himesiki.h @@ -24,9 +24,9 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_bg_ram; - required_shared_ptr m_spriteram_p103a; - required_shared_ptr m_spriteram; + required_shared_ptr m_bg_ram; + required_shared_ptr m_spriteram_p103a; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -51,6 +51,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_himesiki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_himesiki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void himesiki_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/hitme.h b/src/mame/includes/hitme.h index 4a2a4aa48a4..f0da17cd826 100644 --- a/src/mame/includes/hitme.h +++ b/src/mame/includes/hitme.h @@ -26,7 +26,7 @@ public: m_screen(*this, "screen") { } /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; /* video-related */ tilemap_t *m_tilemap; @@ -45,10 +45,10 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_VIDEO_START(barricad); - UINT32 screen_update_hitme(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_barricad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT8 read_port_and_t0( int port ); - UINT8 read_port_and_t0_and_hblank( int port ); + uint32_t screen_update_hitme(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_barricad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint8_t read_port_and_t0( int port ); + uint8_t read_port_and_t0_and_hblank( int port ); required_device m_maincpu; required_device m_discrete; required_device m_gfxdecode; diff --git a/src/mame/includes/hnayayoi.h b/src/mame/includes/hnayayoi.h index fa22619a317..4fd0b470379 100644 --- a/src/mame/includes/hnayayoi.h +++ b/src/mame/includes/hnayayoi.h @@ -16,12 +16,12 @@ public: m_msm(*this, "msm") { } /* video-related */ - UINT8 *m_pixmap[8]; + uint8_t *m_pixmap[8]; int m_palbank; int m_total_pixmaps; - UINT8 m_blit_layer; - UINT16 m_blit_dest; - UINT32 m_blit_src; + uint8_t m_blit_layer; + uint16_t m_blit_dest; + uint32_t m_blit_src; /* misc */ int m_keyb; @@ -41,7 +41,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_VIDEO_START(untoucha); - UINT32 screen_update_hnayayoi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hnayayoi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void common_vh_start( int num_pixmaps ); void copy_pixel( int x, int y, int pen ); void draw_layer_interleaved( bitmap_ind16 &bitmap, const rectangle &cliprect, int left_pixmap, int right_pixmap, int palbase, int transp ); diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h index 7da413bf645..5a914d5e5c7 100644 --- a/src/mame/includes/hng64.h +++ b/src/mame/includes/hng64.h @@ -26,10 +26,10 @@ struct blit_parameters { bitmap_rgb32 * bitmap; rectangle cliprect; - UINT32 tilemap_priority_code; - UINT8 mask; - UINT8 value; - UINT8 alpha; + uint32_t tilemap_priority_code; + uint8_t mask; + uint8_t value; + uint8_t alpha; hng64trans_t drawformat; }; @@ -60,16 +60,16 @@ struct polygon float faceNormal[4]; // Normal of the face overall - for calculating visibility and flat-shading... int visible; // Polygon visibility in scene - UINT8 texIndex; // Which texture to draw from (0x00-0x0f) - UINT8 texType; // How to index into the texture - UINT8 texPageSmall; // Does this polygon use 'small' texture pages? - UINT8 texPageHorizOffset; // If it does use small texture pages, how far is this page horizontally offset? - UINT8 texPageVertOffset; // If it does use small texture pages, how far is this page vertically offset? + uint8_t texIndex; // Which texture to draw from (0x00-0x0f) + uint8_t texType; // How to index into the texture + uint8_t texPageSmall; // Does this polygon use 'small' texture pages? + uint8_t texPageHorizOffset; // If it does use small texture pages, how far is this page horizontally offset? + uint8_t texPageVertOffset; // If it does use small texture pages, how far is this page vertically offset? - UINT32 palOffset; // The base offset where this object's palette starts. - UINT32 palPageSize; // The size of the palette page that is being pointed to. + uint32_t palOffset; // The base offset where this object's palette starts. + uint32_t palPageSize; // The size of the palette page that is being pointed to. - UINT32 debugColor; // Will go away someday. Used to explicitly color polygons for debugging. + uint32_t debugColor; // Will go away someday. Used to explicitly color polygons for debugging. }; @@ -96,11 +96,11 @@ typedef frustum_clip_vertex hng64_clip_vertex; struct hng64_poly_data { - UINT8 texType; - UINT8 texIndex; - UINT8 texPageSmall; - UINT8 texPageHorizOffset; - UINT8 texPageVertOffset; + uint8_t texType; + uint8_t texIndex; + uint8_t texPageSmall; + uint8_t texPageHorizOffset; + uint8_t texPageVertOffset; int palOffset; int palPageSize; int debugColor; @@ -114,7 +114,7 @@ public: hng64_poly_renderer(hng64_state& state); void drawShaded(polygon *p); - void render_scanline(INT32 scanline, const extent_t& extent, const hng64_poly_data& renderData, int threadid); + void render_scanline(int32_t scanline, const extent_t& extent, const hng64_poly_data& renderData, int threadid); hng64_state& state() { return m_state; } bitmap_rgb32& colorBuffer3d() { return m_colorBuffer3d; } @@ -163,24 +163,24 @@ public: required_device m_comm; required_device m_rtc; - required_shared_ptr m_mainram; - required_shared_ptr m_cart; - required_shared_ptr m_sysregs; - required_shared_ptr m_dualport; - required_shared_ptr m_rombase; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteregs; - required_shared_ptr m_videoram; - required_shared_ptr m_videoregs; - required_shared_ptr m_tcram; - - std::unique_ptr m_dl; - required_shared_ptr m_3dregs; - required_shared_ptr m_3d_1; - required_shared_ptr m_3d_2; - - required_shared_ptr m_com_ram; - //required_shared_ptr m_com_mmu_mem; + required_shared_ptr m_mainram; + required_shared_ptr m_cart; + required_shared_ptr m_sysregs; + required_shared_ptr m_dualport; + required_shared_ptr m_rombase; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteregs; + required_shared_ptr m_videoram; + required_shared_ptr m_videoregs; + required_shared_ptr m_tcram; + + std::unique_ptr m_dl; + required_shared_ptr m_3dregs; + required_shared_ptr m_3d_1; + required_shared_ptr m_3d_2; + + required_shared_ptr m_com_ram; + //required_shared_ptr m_com_mmu_mem; required_device m_gfxdecode; required_device m_screen; @@ -188,30 +188,30 @@ public: int m_mcu_type; - std::unique_ptr m_soundram; - std::unique_ptr m_soundram2; + std::unique_ptr m_soundram; + std::unique_ptr m_soundram2; /* Communications stuff */ - std::unique_ptr m_com_op_base; - std::unique_ptr m_com_virtual_mem; - UINT8 m_com_shared[8]; + std::unique_ptr m_com_op_base; + std::unique_ptr m_com_virtual_mem; + uint8_t m_com_shared[8]; - INT32 m_dma_start; - INT32 m_dma_dst; - INT32 m_dma_len; + int32_t m_dma_start; + int32_t m_dma_dst; + int32_t m_dma_len; - UINT32 m_mcu_fake_time; - UINT16 m_mcu_en; + uint32_t m_mcu_fake_time; + uint16_t m_mcu_en; - UINT32 m_activeDisplayList; - UINT32 m_no_machine_error_code; + uint32_t m_activeDisplayList; + uint32_t m_no_machine_error_code; - UINT32 m_unk_vreg_toggle; - UINT32 m_p1_trig; + uint32_t m_unk_vreg_toggle; + uint32_t m_p1_trig; - //UINT32 *q2; + //uint32_t *q2; - UINT8 m_screen_dis; + uint8_t m_screen_dis; struct hng64_tilemap { tilemap_t *m_tilemap_8x8; @@ -221,11 +221,11 @@ public: hng64_tilemap m_tilemap[4]; - UINT8 m_additive_tilemap_debug; + uint8_t m_additive_tilemap_debug; - UINT32 m_old_animmask; - UINT32 m_old_animbits; - UINT16 m_old_tileflags[4]; + uint32_t m_old_animmask; + uint32_t m_old_animbits; + uint16_t m_old_tileflags[4]; // 3d State int m_paletteState3d; @@ -287,15 +287,15 @@ public: DECLARE_DRIVER_INIT(hng64_fght); DECLARE_DRIVER_INIT(hng64_reorder_gfx); - void set_irq(UINT32 irq_vector); - UINT32 m_irq_pending; - UINT8 *m_comm_rom; - std::unique_ptr m_comm_ram; - UINT8 m_mmu_regs[8]; - UINT32 m_mmua[6]; - UINT16 m_mmub[6]; - UINT8 read_comm_data(UINT32 offset); - void write_comm_data(UINT32 offset,UINT8 data); + void set_irq(uint32_t irq_vector); + uint32_t m_irq_pending; + uint8_t *m_comm_rom; + std::unique_ptr m_comm_ram; + uint8_t m_mmu_regs[8]; + uint32_t m_mmua[6]; + uint16_t m_mmub[6]; + uint8_t read_comm_data(uint32_t offset); + void write_comm_data(uint32_t offset,uint8_t data); int m_irq_level; TILE_GET_INFO_MEMBER(get_hng64_tile0_8x8_info); TILE_GET_INFO_MEMBER(get_hng64_tile0_16x16_info); @@ -308,7 +308,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_hng64(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hng64(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_hng64(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(hng64_irq); void do_dma(address_space &space); @@ -318,15 +318,15 @@ public: void hng64_drawtilemap(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int tm); void hng64_tilemap_draw_roz_core(screen_device &screen, tilemap_t *tmap, const blit_parameters *blit, - UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound); + uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, int wraparound); void hng64_tilemap_draw_roz(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, tilemap_t *tmap, - UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, - int wraparound, UINT32 flags, UINT8 priority, hng64trans_t drawformat); + uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, + int wraparound, uint32_t flags, uint8_t priority, hng64trans_t drawformat); void hng64_tilemap_draw_roz_primask(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, tilemap_t *tmap, - UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, - int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask, hng64trans_t drawformat); + uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, + int wraparound, uint32_t flags, uint8_t priority, uint8_t priority_mask, hng64trans_t drawformat); @@ -339,22 +339,22 @@ public: TIMER_CALLBACK_MEMBER(hng64_3dfifo_processed); - UINT8 *m_texturerom; - UINT16* m_vertsrom; + uint8_t *m_texturerom; + uint16_t* m_vertsrom; int m_vertsrom_size; std::vector m_polys; // HNG64_MAX_POLYGONS void clear3d(); - void hng64_command3d(const UINT16* packet); + void hng64_command3d(const uint16_t* packet); void draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void transition_control(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void setCameraTransformation(const UINT16* packet); - void setLighting(const UINT16* packet); - void set3dFlags(const UINT16* packet); - void setCameraProjectionMatrix(const UINT16* packet); - void recoverPolygonBlock(const UINT16* packet, int& numPolys); - void printPacket(const UINT16* packet, int hex); - float uToF(UINT16 input); + void setCameraTransformation(const uint16_t* packet); + void setLighting(const uint16_t* packet); + void set3dFlags(const uint16_t* packet); + void setCameraProjectionMatrix(const uint16_t* packet); + void recoverPolygonBlock(const uint16_t* packet, int& numPolys); + void printPacket(const uint16_t* packet, int hex); + float uToF(uint16_t input); void matmul4(float *product, const float *a, const float *b); void vecmatmul4(float *product, const float *a, const float *b); float vecDotProduct(const float *a, const float *b); @@ -386,6 +386,6 @@ public: DECLARE_WRITE16_MEMBER(main_sound_comms_w); DECLARE_READ16_MEMBER(sound_comms_r); DECLARE_WRITE16_MEMBER(sound_comms_w); - UINT16 main_latch[2]; - UINT16 sound_latch[2]; + uint16_t main_latch[2]; + uint16_t sound_latch[2]; }; diff --git a/src/mame/includes/holeland.h b/src/mame/includes/holeland.h index 429351618ad..a85a89bbb14 100644 --- a/src/mame/includes/holeland.h +++ b/src/mame/includes/holeland.h @@ -25,9 +25,9 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -46,8 +46,8 @@ public: DECLARE_VIDEO_START(holeland); DECLARE_VIDEO_START(crzrally); - UINT32 screen_update_holeland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_crzrally(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_holeland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_crzrally(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void holeland_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void crzrally_draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); }; diff --git a/src/mame/includes/homedata.h b/src/mame/includes/homedata.h index f2062f7eda3..9803481fa4c 100644 --- a/src/mame/includes/homedata.h +++ b/src/mame/includes/homedata.h @@ -23,19 +23,19 @@ public: } /* memory pointers */ - optional_shared_ptr m_vreg; - required_shared_ptr m_videoram; + optional_shared_ptr m_vreg; + required_shared_ptr m_videoram; /* video-related */ tilemap_t *m_bg_tilemap[2][4]; int m_visible_page; int m_priority; - UINT8 m_reikaids_which; + uint8_t m_reikaids_which; int m_flipscreen; - UINT8 m_gfx_bank[2]; // pteacher only uses the first one - UINT8 m_blitter_bank; + uint8_t m_gfx_bank[2]; // pteacher only uses the first one + uint8_t m_blitter_bank; int m_blitter_param_count; - UINT8 m_blitter_param[4]; /* buffers last 4 writes to 0x8006 */ + uint8_t m_blitter_param[4]; /* buffers last 4 writes to 0x8006 */ /* misc */ @@ -57,7 +57,7 @@ public: optional_device m_soundlatch; // mrokumei optional_device m_sn; // mrokumei and pteacher - UINT8 m_prot_data; + uint8_t m_prot_data; DECLARE_READ8_MEMBER(mrokumei_keyboard_r); DECLARE_WRITE8_MEMBER(mrokumei_keyboard_select_w); DECLARE_READ8_MEMBER(mrokumei_sound_io_r); @@ -135,10 +135,10 @@ public: DECLARE_VIDEO_START(mirderby); DECLARE_PALETTE_INIT(mirderby); DECLARE_VIDEO_START(lemnangl); - UINT32 screen_update_mrokumei(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_reikaids(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pteacher(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mirderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mrokumei(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_reikaids(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pteacher(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mirderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_homedata(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(homedata_irq); INTERRUPT_GEN_MEMBER(upd7807_irq); diff --git a/src/mame/includes/homerun.h b/src/mame/includes/homerun.h index 14fc6659840..49d16b553a5 100644 --- a/src/mame/includes/homerun.h +++ b/src/mame/includes/homerun.h @@ -26,17 +26,17 @@ public: { } required_device m_maincpu; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; optional_device m_d7756; optional_device m_samples; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - UINT8 m_control; - UINT8 m_sample; + uint8_t m_control; + uint8_t m_sample; tilemap_t *m_tilemap; int m_gfx_ctrl; @@ -60,7 +60,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_homerun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_homerun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(homerun_banking_w); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/hp48.h b/src/mame/includes/hp48.h index f34746878ef..bb680395f51 100644 --- a/src/mame/includes/hp48.h +++ b/src/mame/includes/hp48.h @@ -23,7 +23,7 @@ typedef enum { typedef struct { /* static part */ - UINT32 off_mask; /* offset bit-mask, indicates the real size */ + uint32_t off_mask; /* offset bit-mask, indicates the real size */ read8_delegate read; const char *read_name; write8_delegate write; @@ -31,9 +31,9 @@ typedef struct int isnop; /* configurable part */ - UINT8 state; /* one of HP48_MODULE_ */ - UINT32 base; /* base address */ - UINT32 mask; /* often improperly called size, it is an address select mask */ + uint8_t state; /* one of HP48_MODULE_ */ + uint32_t base; /* base address */ + uint32_t mask; /* often improperly called size, it is an address select mask */ } hp48_module; @@ -50,35 +50,35 @@ public: m_dac(*this, "dac"), m_palette(*this, "palette") { } - UINT8 *m_videoram; - UINT8 m_io[64]; + uint8_t *m_videoram; + uint8_t m_io[64]; hp48_models m_model; /* OUT register from SATURN (actually 12-bit) */ - UINT16 m_out; + uint16_t m_out; /* keyboard interrupt */ - UINT8 m_kdn; + uint8_t m_kdn; /* from highest to lowest priority: HDW, NCE2, CE1, CE2, NCE3, NCE1 */ hp48_module m_modules[6]; - /* RAM/ROM extensions, GX/SX only (each UINT8 stores one nibble) + /* RAM/ROM extensions, GX/SX only (each uint8_t stores one nibble) port1: SX/GX: 32/128 KB port2: SX:32/128KB, GX:128/512/4096 KB */ - UINT32 m_port_size[2]; - UINT8 m_port_write[2]; - std::unique_ptr m_port_data[2]; - - UINT32 m_bank_switch; - UINT32 m_io_addr; - UINT16 m_crc; - UINT8 m_timer1; - UINT32 m_timer2; - UINT8 m_screens[ HP48_NB_SCREENS ][ 64 ][ 144 ]; + uint32_t m_port_size[2]; + uint8_t m_port_write[2]; + std::unique_ptr m_port_data[2]; + + uint32_t m_bank_switch; + uint32_t m_io_addr; + uint16_t m_crc; + uint8_t m_timer1; + uint32_t m_timer2; + uint8_t m_screens[ HP48_NB_SCREENS ][ 64 ][ 144 ]; int m_cur_screen; - UINT8* m_rom; + uint8_t* m_rom; DECLARE_DRIVER_INIT(hp48); virtual void machine_reset() override; @@ -89,7 +89,7 @@ public: DECLARE_MACHINE_START(hp48gp); DECLARE_MACHINE_START(hp48sx); DECLARE_MACHINE_START(hp48s); - UINT32 screen_update_hp48(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hp48(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void hp48_machine_start(hp48_models model); DECLARE_WRITE8_MEMBER(hp48_io_w); DECLARE_READ8_MEMBER(hp48_io_r); @@ -106,13 +106,13 @@ public: required_device m_dac; required_device m_palette; void hp48_pulse_irq( int irq_line); - void hp48_rs232_start_recv_byte( UINT8 data ); + void hp48_rs232_start_recv_byte( uint8_t data ); void hp48_rs232_send_byte( ); int hp48_get_in( ); void hp48_update_kdn( ); void hp48_reset_modules( ); - void hp48_decode_nibble( UINT8* dst, UINT8* src, int size ); - void hp48_encode_nibble( UINT8* dst, UINT8* src, int size ); + void hp48_decode_nibble( uint8_t* dst, uint8_t* src, int size ); + void hp48_encode_nibble( uint8_t* dst, uint8_t* src, int size ); /* memory controller */ DECLARE_WRITE_LINE_MEMBER( hp48_mem_reset ); @@ -173,7 +173,7 @@ class hp48_port_image_device : public device_t, { public: // construction/destruction - hp48_port_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + hp48_port_image_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static void set_port_config(device_t &device, int port, int module, int max_size) { diff --git a/src/mame/includes/hp9845.h b/src/mame/includes/hp9845.h index 999a4435264..d26fe8f0583 100644 --- a/src/mame/includes/hp9845.h +++ b/src/mame/includes/hp9845.h @@ -17,7 +17,7 @@ class hp9845b_state : public driver_device public: hp9845b_state(const machine_config &mconfig, device_type type, const char *tag); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void machine_start() override; virtual void machine_reset() override; @@ -37,11 +37,11 @@ public: IRQ_CALLBACK_MEMBER(irq_callback); void update_irq(void); - void irq_w(UINT8 sc , int state); + void irq_w(uint8_t sc , int state); void update_flg_sts(void); - void sts_w(UINT8 sc , int state); - void flg_w(UINT8 sc , int state); - void install_readwrite_handler(UINT8 sc , read16_delegate rhandler, write16_delegate whandler); + void sts_w(uint8_t sc , int state); + void flg_w(uint8_t sc , int state); + void install_readwrite_handler(uint8_t sc , read16_delegate rhandler, write16_delegate whandler); TIMER_DEVICE_CALLBACK_MEMBER(kb_scan); DECLARE_READ16_MEMBER(kb_scancode_r); @@ -70,31 +70,31 @@ private: required_device m_beep_timer; required_device m_io_slot0; - void set_video_mar(UINT16 mar); + void set_video_mar(uint16_t mar); void video_fill_buff(bool buff_idx); void video_render_buff(unsigned video_scanline , unsigned line_in_row, bool buff_idx); void graphic_video_render(unsigned video_scanline); // Character generator - const UINT8 *m_chargen; + const uint8_t *m_chargen; // Optional character generator - const UINT8 *m_optional_chargen; + const uint8_t *m_optional_chargen; // Text mode video I/F typedef struct { - UINT8 chars[ 80 ]; - UINT8 attrs[ 80 ]; + uint8_t chars[ 80 ]; + uint8_t attrs[ 80 ]; bool full; } video_buffer_t; bitmap_rgb32 m_bitmap; offs_t m_video_mar; - UINT16 m_video_word; + uint16_t m_video_word; bool m_video_load_mar; bool m_video_first_mar; bool m_video_byte_idx; - UINT8 m_video_attr; + uint8_t m_video_attr; bool m_video_buff_idx; bool m_video_blanked; video_buffer_t m_video_buff[ 2 ]; @@ -116,30 +116,30 @@ private: gv_fsm_state_t m_gv_fsm_state; bool m_gv_int_en; bool m_gv_dma_en; - UINT8 m_gv_cmd; // U65 (GC) - UINT16 m_gv_data_w; // U29, U45, U28 & U44 (GC) - UINT16 m_gv_data_r; // U59 & U60 (GC) - UINT16 m_gv_io_counter; // U1, U2, U14 & U15 (GC) - UINT16 m_gv_cursor_w; // U38 & U39 (GS) - UINT16 m_gv_cursor_x; // U31 & U23 (GS) - UINT16 m_gv_cursor_y; // U15 & U8 (GS) + uint8_t m_gv_cmd; // U65 (GC) + uint16_t m_gv_data_w; // U29, U45, U28 & U44 (GC) + uint16_t m_gv_data_r; // U59 & U60 (GC) + uint16_t m_gv_io_counter; // U1, U2, U14 & U15 (GC) + uint16_t m_gv_cursor_w; // U38 & U39 (GS) + uint16_t m_gv_cursor_x; // U31 & U23 (GS) + uint16_t m_gv_cursor_y; // U15 & U8 (GS) bool m_gv_cursor_gc; // U8 (GS) bool m_gv_cursor_fs; // U8 (GS) - std::vector m_graphic_mem; + std::vector m_graphic_mem; // Interrupt handling - UINT8 m_irl_pending; - UINT8 m_irh_pending; + uint8_t m_irl_pending; + uint8_t m_irh_pending; // FLG/STS handling - UINT8 m_pa; - UINT16 m_flg_status; - UINT16 m_sts_status; + uint8_t m_pa; + uint16_t m_flg_status; + uint16_t m_sts_status; // State of keyboard ioport_value m_kb_state[ 4 ]; - UINT8 m_kb_scancode; - UINT16 m_kb_status; + uint8_t m_kb_scancode; + uint16_t m_kb_status; }; #endif /* _HP9845_H_ */ diff --git a/src/mame/includes/huebler.h b/src/mame/includes/huebler.h index dcb8a05f3c3..a47ec0c30bc 100644 --- a/src/mame/includes/huebler.h +++ b/src/mame/includes/huebler.h @@ -42,13 +42,13 @@ public: required_device m_palette; required_memory_region m_kb_rom; required_memory_region m_char_rom; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; required_ioport_array<16> m_key_row; required_ioport m_special; virtual void machine_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( keyboard_r ); TIMER_DEVICE_CALLBACK_MEMBER( tape_tick ); diff --git a/src/mame/includes/hx20.h b/src/mame/includes/hx20.h index 8f7ab801e0d..ed2c9908a15 100644 --- a/src/mame/includes/hx20.h +++ b/src/mame/includes/hx20.h @@ -88,7 +88,7 @@ public: virtual void machine_start() override; DECLARE_PALETTE_INIT(hx20); - 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); DECLARE_WRITE8_MEMBER( ksc_w ); DECLARE_READ8_MEMBER( krtn07_r ); @@ -125,11 +125,11 @@ public: int m_rtc_irq; // keyboard state - UINT8 m_ksc; + uint8_t m_ksc; int m_kbrequest; // video state - UINT8 m_lcd_data; + uint8_t m_lcd_data; // sio state int m_sio_rx; diff --git a/src/mame/includes/hyhoo.h b/src/mame/includes/hyhoo.h index 4b0d2c520b9..db90ecb3da5 100644 --- a/src/mame/includes/hyhoo.h +++ b/src/mame/includes/hyhoo.h @@ -20,7 +20,7 @@ public: required_device m_maincpu; required_device m_nb1413m3; required_device m_screen; - required_shared_ptr m_clut; + required_shared_ptr m_clut; int m_blitter_destx; int m_blitter_desty; @@ -42,7 +42,7 @@ public: virtual void video_start() override; - UINT32 screen_update_hyhoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hyhoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void hyhoo_gfxdraw(); protected: diff --git a/src/mame/includes/hyperspt.h b/src/mame/includes/hyperspt.h index 0e4b848de5a..3826555785a 100644 --- a/src/mame/includes/hyperspt.h +++ b/src/mame/includes/hyperspt.h @@ -20,24 +20,24 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; optional_device m_sn; required_device m_maincpu; optional_device m_vlm; required_device m_gfxdecode; required_device m_palette; - UINT8 * m_scroll2; - UINT8 * m_spriteram2; + uint8_t * m_scroll2; + uint8_t * m_spriteram2; /* video-related */ tilemap_t *m_bg_tilemap; int m_sprites_gfx_banked; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(hyperspt_coin_counter_w); DECLARE_WRITE8_MEMBER(irq_mask_w); DECLARE_WRITE8_MEMBER(hyperspt_videoram_w); @@ -45,7 +45,7 @@ public: DECLARE_WRITE8_MEMBER(hyperspt_flipscreen_w); DECLARE_DRIVER_INIT(hyperspt); - UINT8 m_SN76496_latch; + uint8_t m_SN76496_latch; DECLARE_WRITE8_MEMBER( konami_SN76496_latch_w ) { m_SN76496_latch = data; }; DECLARE_WRITE8_MEMBER( konami_SN76496_w ) { m_sn->write(space, offset, m_SN76496_latch); }; TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -53,7 +53,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(hyperspt); DECLARE_VIDEO_START(roadf); - UINT32 screen_update_hyperspt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hyperspt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/hyprduel.h b/src/mame/includes/hyprduel.h index f037f61c555..cf12605adba 100644 --- a/src/mame/includes/hyprduel.h +++ b/src/mame/includes/hyprduel.h @@ -31,31 +31,31 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_vram_2; - required_shared_ptr m_paletteram; - required_shared_ptr m_spriteram; - required_shared_ptr m_tiletable; - required_shared_ptr m_blitter_regs; - required_shared_ptr m_window; - required_shared_ptr m_scroll; - required_shared_ptr m_irq_enable; - required_shared_ptr m_rombank; - required_shared_ptr m_screenctrl; - required_shared_ptr m_videoregs; - required_shared_ptr m_sharedram1; - required_shared_ptr m_sharedram3; - std::unique_ptr m_tiletable_old; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_vram_2; + required_shared_ptr m_paletteram; + required_shared_ptr m_spriteram; + required_shared_ptr m_tiletable; + required_shared_ptr m_blitter_regs; + required_shared_ptr m_window; + required_shared_ptr m_scroll; + required_shared_ptr m_irq_enable; + required_shared_ptr m_rombank; + required_shared_ptr m_screenctrl; + required_shared_ptr m_videoregs; + required_shared_ptr m_sharedram1; + required_shared_ptr m_sharedram3; + std::unique_ptr m_tiletable_old; /* video-related */ tilemap_t *m_bg_tilemap[3]; - std::unique_ptr m_empty_tiles; - std::unique_ptr m_dirtyindex; + std::unique_ptr m_empty_tiles; + std::unique_ptr m_dirtyindex; int m_sprite_xoffs; int m_sprite_yoffs; int m_sprite_yoffs_sub; - std::unique_ptr m_expanded_gfx1; + std::unique_ptr m_expanded_gfx1; /* misc */ emu_timer *m_magerror_irq_timer; @@ -88,7 +88,7 @@ public: DECLARE_WRITE16_MEMBER(hyprduel_window_w); DECLARE_WRITE16_MEMBER(hyprduel_scrollreg_w); DECLARE_WRITE16_MEMBER(hyprduel_scrollreg_init_w); - void blt_write( address_space &space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask ); + void blt_write( address_space &space, const int tmap, const offs_t offs, const uint16_t data, const uint16_t mask ); DECLARE_DRIVER_INIT(magerror); DECLARE_DRIVER_INIT(hyprduel); TILE_GET_INFO_MEMBER(get_tile_info_0_8bit); @@ -100,21 +100,21 @@ public: DECLARE_MACHINE_START(magerror); DECLARE_VIDEO_START(magerror_14220); DECLARE_VIDEO_START(common_14220); - UINT32 screen_update_hyprduel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hyprduel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(vblank_end_callback); TIMER_CALLBACK_MEMBER(magerror_irq_callback); TIMER_CALLBACK_MEMBER(hyprduel_blit_done); TIMER_DEVICE_CALLBACK_MEMBER(hyprduel_interrupt); void hyprduel_postload(); - inline void get_tile_info( tile_data &tileinfo, int tile_index, int layer, UINT16 *vram); - inline void get_tile_info_8bit( tile_data &tileinfo, int tile_index, int layer, UINT16 *vram ); - inline void get_tile_info_16x16_8bit( tile_data &tileinfo, int tile_index, int layer, UINT16 *vram ); - inline void hyprduel_vram_w( offs_t offset, UINT16 data, UINT16 mem_mask, int layer, UINT16 *vram ); + inline void get_tile_info( tile_data &tileinfo, int tile_index, int layer, uint16_t *vram); + inline void get_tile_info_8bit( tile_data &tileinfo, int tile_index, int layer, uint16_t *vram ); + inline void get_tile_info_16x16_8bit( tile_data &tileinfo, int tile_index, int layer, uint16_t *vram ); + inline void hyprduel_vram_w( offs_t offset, uint16_t data, uint16_t mem_mask, int layer, uint16_t *vram ); void alloc_empty_tiles( ); void expand_gfx1(hyprduel_state &state); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_layers( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int layers_ctrl ); - void dirty_tiles( int layer, UINT16 *vram ); + void dirty_tiles( int layer, uint16_t *vram ); void update_irq_state( ); - inline int blt_read( const UINT8 *ROM, const int offs ); + inline int blt_read( const uint8_t *ROM, const int offs ); }; diff --git a/src/mame/includes/ikki.h b/src/mame/includes/ikki.h index bfd7039db1a..20736d3b901 100644 --- a/src/mame/includes/ikki.h +++ b/src/mame/includes/ikki.h @@ -23,9 +23,9 @@ public: required_device m_maincpu; required_device m_subcpu; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_scroll; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_scroll; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_screen; @@ -33,9 +33,9 @@ public: /* video-related */ bitmap_ind16 m_sprite_bitmap; - UINT8 m_flipscreen; + uint8_t m_flipscreen; int m_punch_through_pen; - UINT8 m_irq_source; + uint8_t m_irq_source; DECLARE_READ8_MEMBER(ikki_e000_r); DECLARE_WRITE8_MEMBER(ikki_coin_counters); @@ -44,7 +44,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(ikki); - UINT32 screen_update_ikki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ikki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(ikki_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/imds2.h b/src/mame/includes/imds2.h index c5e93b4f9bd..2fe530afee0 100644 --- a/src/mame/includes/imds2.h +++ b/src/mame/includes/imds2.h @@ -104,7 +104,7 @@ class imds2_state : public driver_device required_ioport m_io_key7; required_ioport m_ioc_options; - std::vector m_ipc_ram; + std::vector m_ipc_ram; bool imds2_in_ipc_rom(offs_t offset) const; @@ -112,40 +112,40 @@ class imds2_state : public driver_device void imds2_update_printer(void); // IPC control port - UINT8 m_ipc_control; + uint8_t m_ipc_control; // IPC ROM content - const UINT8 *m_ipc_rom; + const uint8_t *m_ipc_rom; // Character generator - const UINT8 *m_chargen; + const uint8_t *m_chargen; // MISCOUT state - UINT8 m_miscout; + uint8_t m_miscout; // Beeper timer line int m_beeper_timer; // Keyboard state - UINT8 m_kb_p1; + uint8_t m_kb_p1; // IPC to IOC buffer - UINT8 m_ioc_ibf; + uint8_t m_ioc_ibf; // IOC to IPC buffer - UINT8 m_ioc_obf; + uint8_t m_ioc_obf; // IPC/IOC status - UINT8 m_ipc_ioc_status; + uint8_t m_ipc_ioc_status; // PIO port 1 - UINT8 m_pio_port1; + uint8_t m_pio_port1; // PIO port 2 - UINT8 m_pio_port2; + uint8_t m_pio_port2; // PIO device status byte - UINT8 m_device_status_byte; + uint8_t m_device_status_byte; }; #endif /* _IMDS2_H_ */ diff --git a/src/mame/includes/intv.h b/src/mame/includes/intv.h index 4155499db7d..0b5b9ffdbcd 100644 --- a/src/mame/includes/intv.h +++ b/src/mame/includes/intv.h @@ -55,8 +55,8 @@ public: required_device m_sound; required_device m_stic; optional_device m_cart; - optional_shared_ptr m_intvkbd_dualport_ram; - optional_shared_ptr m_videoram; + optional_shared_ptr m_intvkbd_dualport_ram; + optional_shared_ptr m_videoram; DECLARE_READ16_MEMBER(intv_stic_r); DECLARE_WRITE16_MEMBER(intv_stic_w); @@ -71,11 +71,11 @@ public: DECLARE_READ8_MEMBER(intv_right_control_r); DECLARE_READ8_MEMBER(intv_left_control_r); - UINT8 m_bus_copy_mode; - UINT8 m_backtab_row; - UINT16 m_ram16[0x160]; + uint8_t m_bus_copy_mode; + uint8_t m_backtab_row; + uint16_t m_ram16[0x160]; int m_sr1_int_pending; - UINT8 m_ram8[256]; + uint8_t m_ram8[256]; // Keyboard Component DECLARE_READ8_MEMBER(intvkbd_tms9927_r); @@ -86,10 +86,10 @@ public: DECLARE_READ8_MEMBER(intvkbd_dualport8_msb_r); DECLARE_WRITE8_MEMBER(intvkbd_dualport8_msb_w); - UINT8 m_tms9927_num_rows; - UINT8 m_tms9927_cursor_col; - UINT8 m_tms9927_cursor_row; - UINT8 m_tms9927_last_row; + uint8_t m_tms9927_num_rows; + uint8_t m_tms9927_cursor_col; + uint8_t m_tms9927_cursor_row; + uint8_t m_tms9927_last_row; int m_intvkbd_text_blanked; int m_intvkbd_keyboard_col; @@ -104,8 +104,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(intv); - UINT32 screen_update_intv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_intvkbd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_intv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_intvkbd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(intv_interrupt2); INTERRUPT_GEN_MEMBER(intv_interrupt); TIMER_CALLBACK_MEMBER(intv_interrupt2_complete); diff --git a/src/mame/includes/inufuku.h b/src/mame/includes/inufuku.h index 772d4a6754d..7be6de066a5 100644 --- a/src/mame/includes/inufuku.h +++ b/src/mame/includes/inufuku.h @@ -21,11 +21,11 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_bg_videoram; - required_shared_ptr m_bg_rasterram; - required_shared_ptr m_tx_videoram; - required_shared_ptr m_spriteram1; - required_shared_ptr m_spriteram2; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_bg_rasterram; + required_shared_ptr m_tx_videoram; + required_shared_ptr m_spriteram1; + required_shared_ptr m_spriteram2; /* video-related */ tilemap_t *m_bg_tilemap; @@ -37,11 +37,11 @@ public: int m_bg_raster; int m_bg_palettebank; int m_tx_palettebank; - std::unique_ptr m_spriteram1_old; - UINT32 inufuku_tile_callback( UINT32 code ); + std::unique_ptr m_spriteram1_old; + uint32_t inufuku_tile_callback( uint32_t code ); /* misc */ - UINT16 m_pending_command; + uint16_t m_pending_command; /* devices */ required_device m_maincpu; @@ -66,6 +66,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_inufuku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_inufuku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_inufuku(screen_device &screen, bool state); }; diff --git a/src/mame/includes/iqblock.h b/src/mame/includes/iqblock.h index be63ef229b1..5c75ee98446 100644 --- a/src/mame/includes/iqblock.h +++ b/src/mame/includes/iqblock.h @@ -14,9 +14,9 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_rambase; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_fgvideoram; + required_shared_ptr m_rambase; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; int m_videoenable; int m_video_type; @@ -40,5 +40,5 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); - 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); }; diff --git a/src/mame/includes/irobot.h b/src/mame/includes/irobot.h index a2fc05d6fea..2c599547cea 100644 --- a/src/mame/includes/irobot.h +++ b/src/mame/includes/irobot.h @@ -11,15 +11,15 @@ struct irmb_ops { const struct irmb_ops *nxtop; - UINT32 func; - UINT32 diradd; - UINT32 latchmask; - UINT32 *areg; - UINT32 *breg; - UINT8 cycles; - UINT8 diren; - UINT8 flags; - UINT8 ramsel; + uint32_t func; + uint32_t diradd; + uint32_t latchmask; + uint32_t *areg; + uint32_t *breg; + uint8_t cycles; + uint8_t diren; + uint8_t flags; + uint8_t ramsel; }; @@ -35,34 +35,34 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_nvram; - required_shared_ptr m_videoram; - UINT8 m_vg_clear; - UINT8 m_bufsel; - UINT8 m_alphamap; - UINT8 *m_combase; - UINT8 m_irvg_vblank; - UINT8 m_irvg_running; - UINT8 m_irmb_running; + required_shared_ptr m_nvram; + required_shared_ptr m_videoram; + uint8_t m_vg_clear; + uint8_t m_bufsel; + uint8_t m_alphamap; + uint8_t *m_combase; + uint8_t m_irvg_vblank; + uint8_t m_irvg_running; + uint8_t m_irmb_running; #if IR_TIMING timer_device *m_irvg_timer; timer_device *m_irmb_timer; #endif - UINT8 *m_comRAM[2]; - UINT8 *m_mbRAM; - UINT8 *m_mbROM; - UINT8 m_control_num; - UINT8 m_statwr; - UINT8 m_out0; - UINT8 m_outx; - UINT8 m_mpage; - UINT8 *m_combase_mb; + uint8_t *m_comRAM[2]; + uint8_t *m_mbRAM; + uint8_t *m_mbROM; + uint8_t m_control_num; + uint8_t m_statwr; + uint8_t m_out0; + uint8_t m_outx; + uint8_t m_mpage; + uint8_t *m_combase_mb; irmb_ops *m_mbops; const irmb_ops *m_irmb_stack[16]; - UINT32 m_irmb_regs[16]; - UINT32 m_irmb_latch; - std::unique_ptr m_polybitmap1; - std::unique_ptr m_polybitmap2; + uint32_t m_irmb_regs[16]; + uint32_t m_irmb_latch; + std::unique_ptr m_polybitmap1; + std::unique_ptr m_polybitmap2; int m_ir_xmin; int m_ir_ymin; int m_ir_xmax; @@ -85,16 +85,16 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(irobot); - UINT32 screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(scanline_callback); TIMER_DEVICE_CALLBACK_MEMBER(irobot_irvg_done_callback); TIMER_DEVICE_CALLBACK_MEMBER(irobot_irmb_done_callback); - void _irobot_poly_clear(UINT8 *bitmap_base); + void _irobot_poly_clear(uint8_t *bitmap_base); void irobot_poly_clear(); - void draw_line(UINT8 *polybitmap, int x1, int y1, int x2, int y2, int col); + void draw_line(uint8_t *polybitmap, int x1, int y1, int x2, int y2, int col); void irobot_run_video(); - UINT32 irmb_din(const irmb_ops *curop); - void irmb_dout(const irmb_ops *curop, UINT32 d); + uint32_t irmb_din(const irmb_ops *curop); + void irmb_dout(const irmb_ops *curop, uint32_t d); void load_oproms(); void irmb_run(); required_device m_maincpu; diff --git a/src/mame/includes/ironhors.h b/src/mame/includes/ironhors.h index 8a9c0f7c50d..13ff40a0128 100644 --- a/src/mame/includes/ironhors.h +++ b/src/mame/includes/ironhors.h @@ -33,12 +33,12 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_interrupt_enable; - required_shared_ptr m_scroll; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram2; - required_shared_ptr m_spriteram; + required_shared_ptr m_interrupt_enable; + required_shared_ptr m_scroll; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -64,8 +64,8 @@ public: DECLARE_PALETTE_INIT(ironhors); DECLARE_VIDEO_START(farwest); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_farwest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_farwest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void farwest_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/itech32.h b/src/mame/includes/itech32.h index 8f79ea81f6e..9fc8ceca0a3 100644 --- a/src/mame/includes/itech32.h +++ b/src/mame/includes/itech32.h @@ -44,26 +44,26 @@ public: required_device m_screen; required_device m_palette; - optional_shared_ptr m_main_ram; - optional_shared_ptr m_nvram; - optional_shared_ptr m_video; - optional_shared_ptr m_main_rom; - optional_shared_ptr m_drivedge_zbuf_control; - optional_shared_ptr m_tms1_boot; - optional_shared_ptr m_tms1_ram; - optional_shared_ptr m_tms2_ram; + optional_shared_ptr m_main_ram; + optional_shared_ptr m_nvram; + optional_shared_ptr m_video; + optional_shared_ptr m_main_rom; + optional_shared_ptr m_drivedge_zbuf_control; + optional_shared_ptr m_tms1_boot; + optional_shared_ptr m_tms1_ram; + optional_shared_ptr m_tms2_ram; void nvram_init(nvram_device &nvram, void *base, size_t length); - std::unique_ptr m_videoram; - UINT8 m_vint_state; - UINT8 m_xint_state; - UINT8 m_qint_state; - UINT8 m_sound_data; - UINT8 m_sound_return; - UINT8 m_sound_int_state; + std::unique_ptr m_videoram; + uint8_t m_vint_state; + uint8_t m_xint_state; + uint8_t m_qint_state; + uint8_t m_sound_data; + uint8_t m_sound_return; + uint8_t m_sound_int_state; offs_t m_itech020_prot_address; - UINT8 m_tms_spinning[2]; + uint8_t m_tms_spinning[2]; int m_special_result; int m_p1_effx; int m_p1_effy; @@ -73,30 +73,30 @@ public: int m_p2_effy; int m_p2_lastresult; attotime m_p2_lasttime; - UINT8 m_written[0x8000]; - UINT16 m_xfer_xcount; - UINT16 m_xfer_ycount; - UINT16 m_xfer_xcur; - UINT16 m_xfer_ycur; + uint8_t m_written[0x8000]; + uint16_t m_xfer_xcount; + uint16_t m_xfer_ycount; + uint16_t m_xfer_xcur; + uint16_t m_xfer_ycur; rectangle m_clip_rect; rectangle m_scaled_clip_rect; rectangle m_clip_save; emu_timer *m_scanline_timer; - UINT32 m_grom_bank; - UINT16 m_color_latch[2]; - UINT8 m_enable_latch[2]; - UINT16 *m_videoplane[2]; + uint32_t m_grom_bank; + uint16_t m_color_latch[2]; + uint8_t m_enable_latch[2]; + uint16_t *m_videoplane[2]; // configuration at init time int m_is_drivedge; - UINT8 m_planes; - UINT16 m_vram_height; - UINT32 m_vram_mask; - UINT32 m_vram_xmask; - UINT32 m_vram_ymask; - UINT8 *m_grom_base; - UINT32 m_grom_size; - UINT32 m_grom_bank_mask; + uint8_t m_planes; + uint16_t m_vram_height; + uint32_t m_vram_mask; + uint32_t m_vram_xmask; + uint32_t m_vram_ymask; + uint8_t *m_grom_base; + uint32_t m_grom_size; + uint32_t m_grom_bank_mask; DECLARE_WRITE16_MEMBER(int1_ack_w); DECLARE_READ16_MEMBER(trackball_r); @@ -179,7 +179,7 @@ public: void install_timekeeper(); void init_gt_common(); - UINT32 screen_update_itech32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_itech32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(generate_int1); TIMER_CALLBACK_MEMBER(delayed_sound_data_w); TIMER_CALLBACK_MEMBER(scanline_interrupt); @@ -188,13 +188,13 @@ public: inline void enable_clipping(); void logblit(const char *tag); void update_interrupts(int fast); - void draw_raw(UINT16 *base, UINT16 color); - void draw_raw_drivedge(UINT16 *base, UINT16 *zbase, UINT16 color); - inline void draw_rle_fast(UINT16 *base, UINT16 color); - inline void draw_rle_fast_xflip(UINT16 *base, UINT16 color); - inline void draw_rle_slow(UINT16 *base, UINT16 color); - void draw_rle(UINT16 *base, UINT16 color); - void shiftreg_clear(UINT16 *base, UINT16 *zbase); + void draw_raw(uint16_t *base, uint16_t color); + void draw_raw_drivedge(uint16_t *base, uint16_t *zbase, uint16_t color); + inline void draw_rle_fast(uint16_t *base, uint16_t color); + inline void draw_rle_fast_xflip(uint16_t *base, uint16_t color); + inline void draw_rle_slow(uint16_t *base, uint16_t color); + void draw_rle(uint16_t *base, uint16_t color); + void shiftreg_clear(uint16_t *base, uint16_t *zbase); void handle_video_command(); inline int determine_irq_state(int vint, int xint, int qint); void itech32_update_interrupts(int vint, int xint, int qint); diff --git a/src/mame/includes/itech8.h b/src/mame/includes/itech8.h index 6ef343869db..c0e687ae953 100644 --- a/src/mame/includes/itech8.h +++ b/src/mame/includes/itech8.h @@ -52,40 +52,40 @@ public: rectangle m_visarea; - UINT8 m_grom_bank; - UINT8 m_blitter_int; - UINT8 m_tms34061_int; - UINT8 m_periodic_int; - UINT8 m_sound_data; - UINT8 m_pia_porta_data; - UINT8 m_pia_portb_data; - UINT8 m_z80_ctrl; - UINT8 m_z80_port_val; - UINT8 m_z80_clear_to_send; - UINT16 m_sensor0; - UINT16 m_sensor1; - UINT16 m_sensor2; - UINT16 m_sensor3; - UINT8 m_curvx; - UINT8 m_curvy; - UINT8 m_curx; - INT8 m_xbuffer[YBUFFER_COUNT]; - INT8 m_ybuffer[YBUFFER_COUNT]; + uint8_t m_grom_bank; + uint8_t m_blitter_int; + uint8_t m_tms34061_int; + uint8_t m_periodic_int; + uint8_t m_sound_data; + uint8_t m_pia_porta_data; + uint8_t m_pia_portb_data; + uint8_t m_z80_ctrl; + uint8_t m_z80_port_val; + uint8_t m_z80_clear_to_send; + uint16_t m_sensor0; + uint16_t m_sensor1; + uint16_t m_sensor2; + uint16_t m_sensor3; + uint8_t m_curvx; + uint8_t m_curvy; + uint8_t m_curx; + int8_t m_xbuffer[YBUFFER_COUNT]; + int8_t m_ybuffer[YBUFFER_COUNT]; int m_ybuffer_next; int m_curxpos; int m_last_ytotal; - UINT8 m_crosshair_vis; - UINT8 m_blitter_data[16]; - UINT8 m_blit_in_progress; - UINT8 m_page_select; + uint8_t m_crosshair_vis; + uint8_t m_blitter_data[16]; + uint8_t m_blit_in_progress; + uint8_t m_page_select; offs_t m_fetch_offset; - UINT8 m_fetch_rle_count; - UINT8 m_fetch_rle_value; - UINT8 m_fetch_rle_literal; - UINT8 *m_grom_base; - UINT32 m_grom_size; - UINT8 m_grmatch_palcontrol; - UINT8 m_grmatch_xscroll; + uint8_t m_fetch_rle_count; + uint8_t m_fetch_rle_value; + uint8_t m_fetch_rle_literal; + uint8_t *m_grom_base; + uint32_t m_grom_size; + uint8_t m_grmatch_palcontrol; + uint8_t m_grmatch_xscroll; rgb_t m_grmatch_palette[2][16]; emu_timer *m_irq_off_timer; emu_timer *m_behind_beam_update_timer; @@ -134,11 +134,11 @@ public: DECLARE_VIDEO_START(slikshot); DECLARE_MACHINE_START(sstrike); - UINT32 screen_update_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_slikshot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_slikshot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(generate_nmi); TIMER_CALLBACK_MEMBER(irq_off); @@ -147,9 +147,9 @@ public: TIMER_CALLBACK_MEMBER(blitter_done); TIMER_DEVICE_CALLBACK_MEMBER(grmatch_palette_update); - inline UINT8 fetch_next_raw(); + inline uint8_t fetch_next_raw(); inline void consume_raw(int count); - inline UINT8 fetch_next_rle(); + inline uint8_t fetch_next_rle(); inline void consume_rle(int count); void perform_blit(address_space &space); void update_interrupts(int periodic, int tms34061, int blitter); @@ -163,15 +163,15 @@ public: DECLARE_READ8_MEMBER( slikshot_z80_control_r ); DECLARE_WRITE8_MEMBER( slikshot_z80_control_w ); - void inters_to_vels(UINT16 inter1, UINT16 inter2, UINT16 inter3, UINT8 beams, - UINT8 *xres, UINT8 *vxres, UINT8 *vyres); - void vels_to_inters(UINT8 x, UINT8 vx, UINT8 vy, - UINT16 *inter1, UINT16 *inter2, UINT16 *inter3, UINT8 *beams); - void inters_to_words(UINT16 inter1, UINT16 inter2, UINT16 inter3, UINT8 *beams, - UINT16 *word1, UINT16 *word2, UINT16 *word3); + void inters_to_vels(uint16_t inter1, uint16_t inter2, uint16_t inter3, uint8_t beams, + uint8_t *xres, uint8_t *vxres, uint8_t *vyres); + void vels_to_inters(uint8_t x, uint8_t vx, uint8_t vy, + uint16_t *inter1, uint16_t *inter2, uint16_t *inter3, uint8_t *beams); + void inters_to_words(uint16_t inter1, uint16_t inter2, uint16_t inter3, uint8_t *beams, + uint16_t *word1, uint16_t *word2, uint16_t *word3); - void words_to_sensors(UINT16 word1, UINT16 word2, UINT16 word3, UINT8 beams, - UINT16 *sens0, UINT16 *sens1, UINT16 *sens2, UINT16 *sens3); + void 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); void compute_sensors(); TIMER_CALLBACK_MEMBER( delayed_z80_control_w ); diff --git a/src/mame/includes/jack.h b/src/mame/includes/jack.h index b9bd2d5b2c5..738e52c9b33 100644 --- a/src/mame/includes/jack.h +++ b/src/mame/includes/jack.h @@ -29,22 +29,22 @@ public: /* device- and memory pointers */ required_device m_maincpu; required_device m_audiocpu; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_scrollram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_scrollram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; required_device m_gfxdecode; required_device m_palette; required_device m_soundlatch; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; /* video-related */ tilemap_t *m_bg_tilemap; /* misc */ int m_timer_rate; - UINT8 m_joinem_nmi_enable; - UINT8 m_joinem_palette_bank; + uint8_t m_joinem_nmi_enable; + uint8_t m_joinem_palette_bank; int m_question_address; int m_question_rom; int m_remap_address[16]; @@ -75,9 +75,9 @@ public: DECLARE_MACHINE_START(joinem); DECLARE_MACHINE_RESET(joinem); - UINT32 screen_update_jack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_striv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_joinem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_striv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_joinem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/includes/jackal.h b/src/mame/includes/jackal.h index eb220b2c496..028c80c62fe 100644 --- a/src/mame/includes/jackal.h +++ b/src/mame/includes/jackal.h @@ -20,16 +20,16 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoctrl; - UINT8 * m_scrollram; + required_shared_ptr m_videoctrl; + uint8_t * m_scrollram; /* video-related */ tilemap_t *m_bg_tilemap; /* misc */ int m_irq_enable; - UINT8 *m_rambank; - UINT8 *m_spritebank; + uint8_t *m_rambank; + uint8_t *m_spritebank; optional_ioport_array<2> m_dials; /* devices */ @@ -52,10 +52,10 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(jackal); - UINT32 screen_update_jackal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jackal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(jackal_interrupt); void jackal_mark_tile_dirty( int offset ); void draw_background( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); - void draw_sprites_region( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank ); + void draw_sprites_region( bitmap_ind16 &bitmap, const rectangle &cliprect, const uint8_t *sram, int length, int bank ); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/jaguar.h b/src/mame/includes/jaguar.h index 689e1e09b9b..0c3b7ace2e9 100644 --- a/src/mame/includes/jaguar.h +++ b/src/mame/includes/jaguar.h @@ -78,17 +78,17 @@ public: optional_device m_cdrom; // memory - optional_shared_ptr m_nvram; // not used on console - required_shared_ptr m_rom_base; - optional_shared_ptr m_cart_base; // not used in cojag - required_shared_ptr m_dsp_ram; - required_shared_ptr m_wave_rom; - required_shared_ptr m_shared_ram; - required_shared_ptr m_gpu_ram; - required_shared_ptr m_gpu_clut; + optional_shared_ptr m_nvram; // not used on console + required_shared_ptr m_rom_base; + optional_shared_ptr m_cart_base; // not used in cojag + required_shared_ptr m_dsp_ram; + required_shared_ptr m_wave_rom; + required_shared_ptr m_shared_ram; + required_shared_ptr m_gpu_ram; + required_shared_ptr m_gpu_clut; optional_memory_region m_romboard_region; - optional_shared_ptr m_mainram; - optional_shared_ptr m_mainram2; + optional_shared_ptr m_mainram; + optional_shared_ptr m_mainram2; // configuration bool m_is_r3000; @@ -98,49 +98,49 @@ public: bool m_using_cart; bool m_is_jagcd; - UINT32 m_misc_control_data; + uint32_t m_misc_control_data; bool m_eeprom_enable; - UINT32 *m_gpu_jump_address; + uint32_t *m_gpu_jump_address; bool m_gpu_command_pending; - UINT32 m_gpu_spin_pc; - UINT32 *m_main_speedup; + uint32_t m_gpu_spin_pc; + uint32_t *m_main_speedup; int m_main_speedup_hits; - UINT64 m_main_speedup_last_cycles; - UINT64 m_main_speedup_max_cycles; - UINT32 *m_main_gpu_wait; + uint64_t m_main_speedup_last_cycles; + uint64_t m_main_speedup_max_cycles; + uint32_t *m_main_gpu_wait; // driver data - UINT32 m_joystick_data; - UINT8 m_eeprom_bit_count; - UINT8 m_protection_check; /* 0 = check hasn't started yet; 1= check in progress; 2 = check is finished. */ + uint32_t m_joystick_data; + uint8_t m_eeprom_bit_count; + uint8_t m_protection_check; /* 0 = check hasn't started yet; 1= check in progress; 2 = check is finished. */ // audio data - UINT16 m_dsp_regs[0x40/2]; - UINT16 m_serial_frequency; - UINT8 m_gpu_irq_state; + uint16_t m_dsp_regs[0x40/2]; + uint16_t m_serial_frequency; + uint8_t m_gpu_irq_state; emu_timer *m_serial_timer; // blitter variables - UINT32 m_blitter_regs[40]; - UINT16 m_gpu_regs[0x100/2]; + uint32_t m_blitter_regs[40]; + uint16_t m_gpu_regs[0x100/2]; emu_timer *m_object_timer; - UINT8 m_cpu_irq_state; + uint8_t m_cpu_irq_state; bitmap_rgb32 m_screen_bitmap; - UINT8 m_blitter_status; + uint8_t m_blitter_status; pen_t m_pen_table[65536]; - UINT8 m_blend_y[65536]; - UINT8 m_blend_cc[65536]; - UINT32 m_butch_regs[0x40/4]; - UINT32 m_butch_cmd_response[0x102]; - UINT8 m_butch_cmd_index; - UINT8 m_butch_cmd_size; + uint8_t m_blend_y[65536]; + uint8_t m_blend_cc[65536]; + uint32_t m_butch_regs[0x40/4]; + uint32_t m_butch_cmd_response[0x102]; + uint8_t m_butch_cmd_index; + uint8_t m_butch_cmd_size; cdrom_file *m_cd_file; const cdrom_toc* m_toc; - static void (jaguar_state::*const bitmap4[8])(UINT16 *, INT32, INT32, UINT32 *, INT32, UINT16 *); - static void (jaguar_state::*const bitmap8[8])(UINT16 *, INT32, INT32, UINT32 *, INT32, UINT16 *); - static void (jaguar_state::*const bitmap16[8])(UINT16 *, INT32, INT32, UINT32 *, INT32); - static void (jaguar_state::*const bitmap32[8])(UINT16 *, INT32, INT32, UINT32 *, INT32); + static void (jaguar_state::*const bitmap4[8])(uint16_t *, int32_t, int32_t, uint32_t *, int32_t, uint16_t *); + static void (jaguar_state::*const bitmap8[8])(uint16_t *, int32_t, int32_t, uint32_t *, int32_t, uint16_t *); + static void (jaguar_state::*const bitmap16[8])(uint16_t *, int32_t, int32_t, uint32_t *, int32_t); + static void (jaguar_state::*const bitmap32[8])(uint16_t *, int32_t, int32_t, uint32_t *, int32_t); DECLARE_WRITE32_MEMBER(eeprom_w); DECLARE_READ32_MEMBER(eeprom_clk); @@ -237,7 +237,7 @@ public: DECLARE_READ16_MEMBER( tom_regs_r ); DECLARE_WRITE16_MEMBER( tom_regs_w ); DECLARE_READ32_MEMBER( cojag_gun_input_r ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER( gpu_cpu_int ); DECLARE_WRITE_LINE_MEMBER( dsp_cpu_int ); @@ -271,8 +271,8 @@ protected: void dsp_suspend() { m_dsp->suspend(SUSPEND_REASON_SPIN, 1); } void dsp_resume() { m_dsp->resume(SUSPEND_REASON_SPIN); } - void fix_endian( UINT32 addr, UINT32 size ); - void cojag_common_init(UINT16 gpu_jump_offs, UINT16 spin_pc); + void fix_endian( uint32_t addr, uint32_t size ); + void cojag_common_init(uint16_t gpu_jump_offs, uint16_t spin_pc); void init_freeze_common(offs_t main_speedup_addr); // from audio/jaguar.c @@ -284,64 +284,64 @@ protected: int effective_hvalue(int value); bool adjust_object_timer(int vc); void update_cpu_irq(); - UINT8 *memory_base(UINT32 offset) { return reinterpret_cast(m_gpu->space(AS_PROGRAM).get_read_ptr(offset)); } + uint8_t *memory_base(uint32_t offset) { return reinterpret_cast(m_gpu->space(AS_PROGRAM).get_read_ptr(offset)); } void blitter_run(); void scanline_update(int param); - void set_palette(UINT16 vmode); + void set_palette(uint16_t vmode); /* from jagobj.c */ void jagobj_init(); - UINT32 *process_bitmap(UINT16 *scanline, UINT32 *objdata, int vc, int logit); - UINT32 *process_scaled_bitmap(UINT16 *scanline, UINT32 *objdata, int vc, int logit); - UINT32 *process_branch(UINT32 *objdata, int vc, int logit); - void process_object_list(int vc, UINT16 *_scanline); - void bitmap_4_draw(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT8 flags, INT32 dxpos, UINT16 *clutbase); - void bitmap_4_0(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_4_1(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_4_2(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_4_3(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_4_4(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_4_5(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_4_6(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_4_7(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_8_draw(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT8 flags, INT32 dxpos, UINT16 *clutbase); - void bitmap_8_0(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_8_1(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_8_2(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_8_3(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_8_4(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_8_5(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_8_6(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_8_7(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT16 *clutbase); - void bitmap_16_draw(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT8 flags, INT32 dxpos); - void bitmap_16_0(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_16_1(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_16_2(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_16_3(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_16_4(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_16_5(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_16_6(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_16_7(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_32_draw(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos, UINT8 flags, INT32 dxpos); - void bitmap_32_0(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_32_1(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_32_2(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_32_3(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_32_4(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_32_5(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_32_6(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); - void bitmap_32_7(UINT16 *scanline, INT32 firstpix, INT32 iwidth, UINT32 *src, INT32 xpos); + uint32_t *process_bitmap(uint16_t *scanline, uint32_t *objdata, int vc, int logit); + uint32_t *process_scaled_bitmap(uint16_t *scanline, uint32_t *objdata, int vc, int logit); + uint32_t *process_branch(uint32_t *objdata, int vc, int logit); + void process_object_list(int vc, uint16_t *_scanline); + void bitmap_4_draw(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint8_t flags, int32_t dxpos, uint16_t *clutbase); + void bitmap_4_0(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_4_1(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_4_2(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_4_3(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_4_4(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_4_5(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_4_6(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_4_7(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_8_draw(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint8_t flags, int32_t dxpos, uint16_t *clutbase); + void bitmap_8_0(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_8_1(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_8_2(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_8_3(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_8_4(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_8_5(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_8_6(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_8_7(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint16_t *clutbase); + void bitmap_16_draw(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint8_t flags, int32_t dxpos); + void bitmap_16_0(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_16_1(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_16_2(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_16_3(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_16_4(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_16_5(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_16_6(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_16_7(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_32_draw(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos, uint8_t flags, int32_t dxpos); + void bitmap_32_0(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_32_1(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_32_2(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_32_3(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_32_4(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_32_5(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_32_6(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); + void bitmap_32_7(uint16_t *scanline, int32_t firstpix, int32_t iwidth, uint32_t *src, int32_t xpos); /* from jagblit.c */ - void generic_blitter(UINT32 command, UINT32 a1flags, UINT32 a2flags); - void blitter_09800001_010020_010020(UINT32 command, UINT32 a1flags, UINT32 a2flags); - void blitter_09800009_000020_000020(UINT32 command, UINT32 a1flags, UINT32 a2flags); - void blitter_01800009_000028_000028(UINT32 command, UINT32 a1flags, UINT32 a2flags); - void blitter_01800001_000018_000018(UINT32 command, UINT32 a1flags, UINT32 a2flags); - void blitter_01c00001_000018_000018(UINT32 command, UINT32 a1flags, UINT32 a2flags); - void blitter_00010000_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT32 a2flags); - void blitter_01800001_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT32 a2flags); - void blitter_x1800x01_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT32 a2flags); + void generic_blitter(uint32_t command, uint32_t a1flags, uint32_t a2flags); + void blitter_09800001_010020_010020(uint32_t command, uint32_t a1flags, uint32_t a2flags); + void blitter_09800009_000020_000020(uint32_t command, uint32_t a1flags, uint32_t a2flags); + void blitter_01800009_000028_000028(uint32_t command, uint32_t a1flags, uint32_t a2flags); + void blitter_01800001_000018_000018(uint32_t command, uint32_t a1flags, uint32_t a2flags); + void blitter_01c00001_000018_000018(uint32_t command, uint32_t a1flags, uint32_t a2flags); + void blitter_00010000_xxxxxx_xxxxxx(uint32_t command, uint32_t a1flags, uint32_t a2flags); + void blitter_01800001_xxxxxx_xxxxxx(uint32_t command, uint32_t a1flags, uint32_t a2flags); + void blitter_x1800x01_xxxxxx_xxxxxx(uint32_t command, uint32_t a1flags, uint32_t a2flags); optional_device m_eeprom; optional_device m_ide; diff --git a/src/mame/includes/jailbrek.h b/src/mame/includes/jailbrek.h index 01f5aef35d0..692a05d403e 100644 --- a/src/mame/includes/jailbrek.h +++ b/src/mame/includes/jailbrek.h @@ -27,11 +27,11 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll_x; - required_shared_ptr m_scroll_dir; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll_x; + required_shared_ptr m_scroll_dir; /* devices */ required_device m_maincpu; @@ -43,8 +43,8 @@ public: tilemap_t *m_bg_tilemap; /* misc */ - UINT8 m_irq_enable; - UINT8 m_nmi_enable; + uint8_t m_irq_enable; + uint8_t m_nmi_enable; DECLARE_WRITE8_MEMBER(ctrl_w); DECLARE_WRITE8_MEMBER(coin_w); DECLARE_WRITE8_MEMBER(videoram_w); @@ -56,7 +56,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(jailbrek); - 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); INTERRUPT_GEN_MEMBER(interrupt); INTERRUPT_GEN_MEMBER(interrupt_nmi); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/jedi.h b/src/mame/includes/jedi.h index a5f233a283c..05f17acad2c 100644 --- a/src/mame/includes/jedi.h +++ b/src/mame/includes/jedi.h @@ -35,30 +35,30 @@ public: m_audiocpu(*this, "audiocpu"), m_screen(*this, "screen") { } - required_shared_ptr m_nvram; + required_shared_ptr m_nvram; /* machine state */ - UINT8 m_a2d_select; - UINT8 m_nvram_enabled; + uint8_t m_a2d_select; + uint8_t m_nvram_enabled; emu_timer *m_interrupt_timer; /* video state */ - required_shared_ptr m_foreground_bank; - required_shared_ptr m_video_off; - required_shared_ptr m_backgroundram; - required_shared_ptr m_paletteram; - required_shared_ptr m_foregroundram; - required_shared_ptr m_spriteram; - required_shared_ptr m_smoothing_table; - UINT32 m_vscroll; - UINT32 m_hscroll; + required_shared_ptr m_foreground_bank; + required_shared_ptr m_video_off; + required_shared_ptr m_backgroundram; + required_shared_ptr m_paletteram; + required_shared_ptr m_foregroundram; + required_shared_ptr m_spriteram; + required_shared_ptr m_smoothing_table; + uint32_t m_vscroll; + uint32_t m_hscroll; /* audio state */ - UINT8 m_audio_latch; - UINT8 m_audio_ack_latch; - required_shared_ptr m_audio_comm_stat; - required_shared_ptr m_speech_data; - UINT8 m_speech_strobe_state; + uint8_t m_audio_latch; + uint8_t m_audio_ack_latch; + required_shared_ptr m_audio_comm_stat; + required_shared_ptr m_speech_data; + uint8_t m_speech_strobe_state; DECLARE_WRITE8_MEMBER(main_irq_ack_w); DECLARE_WRITE8_MEMBER(rom_banksel_w); DECLARE_READ8_MEMBER(a2d_data_r); @@ -83,7 +83,7 @@ public: virtual void sound_start() override; virtual void sound_reset() override; DECLARE_VIDEO_START(jedi); - UINT32 screen_update_jedi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jedi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(generate_interrupt); TIMER_CALLBACK_MEMBER(delayed_audio_latch_w); void get_pens(pen_t *pens); diff --git a/src/mame/includes/jpmimpct.h b/src/mame/includes/jpmimpct.h index 8be7a680e5a..39883a8afd4 100644 --- a/src/mame/includes/jpmimpct.h +++ b/src/mame/includes/jpmimpct.h @@ -13,46 +13,46 @@ struct duart_t { - UINT8 MR1A, MR2A; - UINT8 SRA, CSRA; - UINT8 CRA; - UINT8 RBA, TBA; + uint8_t MR1A, MR2A; + uint8_t SRA, CSRA; + uint8_t CRA; + uint8_t RBA, TBA; - UINT8 IPCR; - UINT8 ACR; - UINT8 ISR, IMR; + uint8_t IPCR; + uint8_t ACR; + uint8_t ISR, IMR; union { - UINT8 CUR, CLR; - UINT16 CR; + uint8_t CUR, CLR; + uint16_t CR; }; union { - UINT8 CTUR, CTLR; - UINT16 CT; + uint8_t CTUR, CTLR; + uint16_t CT; }; int tc; - UINT8 MR1B, MR2B; - UINT8 SRB, CSRB; - UINT8 CRB; - UINT8 RBB, TBB; + uint8_t MR1B, MR2B; + uint8_t SRB, CSRB; + uint8_t CRB; + uint8_t RBB, TBB; - UINT8 IVR; - UINT8 IP; - UINT8 OP; - UINT8 OPR; - UINT8 OPCR; + uint8_t IVR; + uint8_t IP; + uint8_t OP; + uint8_t OPR; + uint8_t OPCR; }; struct bt477_t { - UINT8 address; - UINT8 addr_cnt; - UINT8 pixmask; - UINT8 command; + uint8_t address; + uint8_t addr_cnt; + uint8_t pixmask; + uint8_t command; rgb_t color; }; @@ -76,13 +76,13 @@ public: m_meters(*this, "meters") { } - UINT8 m_tms_irq; - UINT8 m_duart_1_irq; + uint8_t m_tms_irq; + uint8_t m_duart_1_irq; struct duart_t m_duart_1; - UINT8 m_touch_cnt; - UINT8 m_touch_data[3]; + uint8_t m_touch_cnt; + uint8_t m_touch_data[3]; int m_lamp_strobe; - UINT8 m_Lamps[256]; + uint8_t m_Lamps[256]; int m_optic_pattern; DECLARE_WRITE_LINE_MEMBER(reel0_optic_cb) { if (state) m_optic_pattern |= 0x01; else m_optic_pattern &= ~0x01; } DECLARE_WRITE_LINE_MEMBER(reel1_optic_cb) { if (state) m_optic_pattern |= 0x02; else m_optic_pattern &= ~0x02; } @@ -97,7 +97,7 @@ public: int m_hopper[3]; int m_motor[3]; optional_device m_vfd; - optional_shared_ptr m_vram; + optional_shared_ptr m_vram; struct bt477_t m_bt477; DECLARE_READ16_MEMBER(duart_1_r); DECLARE_WRITE16_MEMBER(duart_1_w); diff --git a/src/mame/includes/jpmsys5.h b/src/mame/includes/jpmsys5.h index 1d3182aad92..a02b918f972 100644 --- a/src/mame/includes/jpmsys5.h +++ b/src/mame/includes/jpmsys5.h @@ -41,7 +41,7 @@ public: optional_device m_palette; optional_device m_meters; //jpmsys5v doesn't use this - UINT8 m_palette_val[16][3]; + uint8_t m_palette_val[16][3]; int m_pal_addr; int m_pal_idx; int m_touch_state; @@ -54,9 +54,9 @@ public: int m_muxram[255]; int m_alpha_clock; int m_chop; - UINT8 m_a0_data_out; - UINT8 m_a1_data_out; - UINT8 m_a2_data_out; + uint8_t m_a0_data_out; + uint8_t m_a1_data_out; + uint8_t m_a2_data_out; DECLARE_WRITE_LINE_MEMBER(generate_tms34061_interrupt); DECLARE_WRITE16_MEMBER(sys5_tms34061_w); DECLARE_READ16_MEMBER(sys5_tms34061_r); @@ -89,6 +89,6 @@ public: DECLARE_MACHINE_RESET(jpmsys5v); DECLARE_MACHINE_START(jpmsys5); DECLARE_MACHINE_RESET(jpmsys5); - UINT32 screen_update_jpmsys5v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jpmsys5v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(touch_cb); }; diff --git a/src/mame/includes/jupiter.h b/src/mame/includes/jupiter.h index ad89bc97a82..479e57f8807 100644 --- a/src/mame/includes/jupiter.h +++ b/src/mame/includes/jupiter.h @@ -43,15 +43,15 @@ public: DECLARE_READ8_MEMBER(status_r); DECLARE_READ8_MEMBER(key_r); DECLARE_READ8_MEMBER(ff_r); - UINT8 m_term_data; + uint8_t m_term_data; - required_shared_ptr m_p_videoram; - required_shared_ptr m_p_ram; - const UINT8 *m_p_chargen; + required_shared_ptr m_p_videoram; + required_shared_ptr m_p_ram; + const uint8_t *m_p_chargen; virtual void machine_reset() override; virtual void video_start() override; - 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); DECLARE_DRIVER_INIT(jupiter3); }; diff --git a/src/mame/includes/kaneko16.h b/src/mame/includes/kaneko16.h index f5912922a04..d0214282879 100644 --- a/src/mame/includes/kaneko16.h +++ b/src/mame/includes/kaneko16.h @@ -59,10 +59,10 @@ public: optional_device m_eeprom; optional_device m_soundlatch; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_mainram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_mainram; - UINT16 m_disp_enable; + uint16_t m_disp_enable; int m_VIEW2_2_pri; @@ -90,10 +90,10 @@ public: DECLARE_MACHINE_RESET(gtmr); DECLARE_VIDEO_START(kaneko16); DECLARE_MACHINE_RESET(mgcrystl); - UINT32 screen_update_kaneko16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kaneko16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); template - UINT32 screen_update_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect); + uint32_t screen_update_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(shogwarr_interrupt); @@ -143,9 +143,9 @@ public: { } - optional_shared_ptr m_bg15_select; - optional_shared_ptr m_bg15_scroll; - optional_shared_ptr m_bg15_bright; + optional_shared_ptr m_bg15_select; + optional_shared_ptr m_bg15_scroll; + optional_shared_ptr m_bg15_bright; required_device m_bgpalette; bitmap_ind16 m_bg15_bitmap[32]; @@ -166,7 +166,7 @@ public: DECLARE_DRIVER_INIT(berlwall); DECLARE_PALETTE_INIT(berlwall); DECLARE_VIDEO_START(berlwall); - UINT32 screen_update_berlwall(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_berlwall(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void kaneko16_render_15bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/kangaroo.h b/src/mame/includes/kangaroo.h index 2b73a14c28e..78492e23848 100644 --- a/src/mame/includes/kangaroo.h +++ b/src/mame/includes/kangaroo.h @@ -18,13 +18,13 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_video_control; + required_shared_ptr m_video_control; /* video-related */ - std::unique_ptr m_videoram; + std::unique_ptr m_videoram; /* misc */ - UINT8 m_mcu_clock; + uint8_t m_mcu_clock; DECLARE_READ8_MEMBER(mcu_sim_r); DECLARE_WRITE8_MEMBER(mcu_sim_w); DECLARE_WRITE8_MEMBER(kangaroo_coin_counter_w); @@ -34,8 +34,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_MACHINE_START(kangaroo_mcu); - UINT32 screen_update_kangaroo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void videoram_write( UINT16 offset, UINT8 data, UINT8 mask ); + uint32_t screen_update_kangaroo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void videoram_write( uint16_t offset, uint8_t data, uint8_t mask ); void blitter_execute( ); required_device m_maincpu; required_device m_palette; diff --git a/src/mame/includes/karnov.h b/src/mame/includes/karnov.h index c897355ffc2..9c11f22b015 100644 --- a/src/mame/includes/karnov.h +++ b/src/mame/includes/karnov.h @@ -36,21 +36,21 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_ram; - required_shared_ptr m_videoram; - required_shared_ptr m_pf_data; + required_shared_ptr m_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_pf_data; /* video-related */ std::unique_ptr m_bitmap_f; tilemap_t *m_fix_tilemap; int m_flipscreen; - UINT16 m_scroll[2]; + uint16_t m_scroll[2]; /* misc */ - UINT16 m_i8751_return; - UINT16 m_i8751_needs_ack; - UINT16 m_i8751_coin_pending; - UINT16 m_i8751_command_queue; + uint16_t m_i8751_return; + uint16_t m_i8751_needs_ack; + uint16_t m_i8751_coin_pending; + uint16_t m_i8751_command_queue; int m_i8751_level; // needed by chelnov int m_microcontroller_id; int m_coin_mask; @@ -72,7 +72,7 @@ public: DECLARE_PALETTE_INIT(karnov); DECLARE_VIDEO_START(karnov); DECLARE_VIDEO_START(wndrplnt); - UINT32 screen_update_karnov(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_karnov(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(karnov_interrupt); void karnov_flipscreen_w( int data ); void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/kaypro.h b/src/mame/includes/kaypro.h index 320d52aa3a1..93aa0c05638 100644 --- a/src/mame/includes/kaypro.h +++ b/src/mame/includes/kaypro.h @@ -62,34 +62,34 @@ public: DECLARE_DRIVER_INIT(kaypro); DECLARE_FLOPPY_FORMATS(kayproii_floppy_formats); DECLARE_FLOPPY_FORMATS(kaypro2x_floppy_formats); - UINT32 screen_update_kayproii(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kaypro2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_omni2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kayproii(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kaypro2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_omni2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(kay_kbd_interrupt); DECLARE_READ8_MEMBER(kaypro_sio_r); DECLARE_WRITE8_MEMBER(kaypro_sio_w); MC6845_UPDATE_ROW(kaypro2x_update_row); DECLARE_QUICKLOAD_LOAD_MEMBER(kaypro); - const UINT8 *m_p_chargen; - UINT8 m_mc6845_cursor[16]; - UINT8 m_mc6845_reg[32]; - UINT8 m_mc6845_ind; - UINT8 m_framecnt; - UINT8 *m_p_videoram; + const uint8_t *m_p_chargen; + uint8_t m_mc6845_cursor[16]; + uint8_t m_mc6845_reg[32]; + uint8_t m_mc6845_ind; + uint8_t m_framecnt; + uint8_t *m_p_videoram; kay_kbd_t *m_kbd; int m_centronics_busy; required_device m_palette; - void kay_kbd_in(UINT8 data ); - UINT8 kay_kbd_c_r(); - UINT8 kay_kbd_d_r(); + void kay_kbd_in(uint8_t data ); + uint8_t kay_kbd_c_r(); + uint8_t kay_kbd_d_r(); TIMER_CALLBACK_MEMBER( kay_kbd_beepoff ); - void kay_kbd_d_w( UINT8 data ); + void kay_kbd_d_w( uint8_t data ); private: bool m_is_motor_off; - UINT8 m_fdc_rq; - UINT8 m_system_port; - UINT16 m_mc6845_video_address; + uint8_t m_fdc_rq; + uint8_t m_system_port; + uint16_t m_mc6845_video_address; floppy_image_device *m_floppy; void mc6845_cursor_configure(); void mc6845_screen_configure(); diff --git a/src/mame/includes/kc.h b/src/mame/includes/kc.h index 65af7aeedb7..e994744ec89 100644 --- a/src/mame/includes/kc.h +++ b/src/mame/includes/kc.h @@ -123,21 +123,21 @@ public: // defined in video/kc.c virtual void video_start() override; - virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + virtual uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER( video_toggle_blink_state ); - void video_draw_8_pixels(bitmap_ind16 &bitmap, int x, int y, UINT8 colour_byte, UINT8 gfx_byte); + void video_draw_8_pixels(bitmap_ind16 &bitmap, int x, int y, uint8_t colour_byte, uint8_t gfx_byte); // driver state - UINT8 * m_ram_base; - UINT8 * m_video_ram; + uint8_t * m_ram_base; + uint8_t * m_video_ram; int m_pio_data[2]; int m_high_resolution; - UINT8 m_ardy; - UINT8 m_brdy; + uint8_t m_ardy; + uint8_t m_brdy; int m_kc85_blink_state; int m_k0_line; int m_k1_line; - UINT8 m_speaker_level; + uint8_t m_speaker_level; // cassette emu_timer * m_cassette_timer; @@ -176,13 +176,13 @@ public: // defined in video/kc.c virtual void video_start() override; - virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) override; + virtual uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) override; void video_control_w(int data); // driver state - UINT8 m_port_84_data; - UINT8 m_port_86_data; - UINT8 * m_display_video_ram; + uint8_t m_port_84_data; + uint8_t m_port_86_data; + uint8_t * m_display_video_ram; }; #endif /* KC_H_ */ diff --git a/src/mame/includes/kchamp.h b/src/mame/includes/kchamp.h index 4636290f1f4..cb1425ebd90 100644 --- a/src/mame/includes/kchamp.h +++ b/src/mame/includes/kchamp.h @@ -28,10 +28,10 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_decrypted_opcodes; /* video-related */ tilemap_t *m_bg_tilemap; @@ -70,8 +70,8 @@ public: DECLARE_PALETTE_INIT(kchamp); DECLARE_MACHINE_START(kchampvs); DECLARE_MACHINE_START(kchamp); - UINT32 screen_update_kchampvs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kchampvs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kchamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(kc_interrupt); INTERRUPT_GEN_MEMBER(sound_int); void kchamp_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/kickgoal.h b/src/mame/includes/kickgoal.h index 94ddc5d3bd9..2c40802b3fa 100644 --- a/src/mame/includes/kickgoal.h +++ b/src/mame/includes/kickgoal.h @@ -27,11 +27,11 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_fgram; - required_shared_ptr m_bgram; - required_shared_ptr m_bg2ram; - required_shared_ptr m_scrram; - required_shared_ptr m_spriteram; + required_shared_ptr m_fgram; + required_shared_ptr m_bgram; + required_shared_ptr m_bg2ram; + required_shared_ptr m_scrram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_fgtm; @@ -44,7 +44,7 @@ public: int m_snd_sam[4]; int m_m6295_comm; int m_m6295_bank; - UINT16 m_m6295_key_delay; + uint16_t m_m6295_key_delay; int m_fg_base; @@ -78,7 +78,7 @@ public: virtual void machine_reset() override; DECLARE_VIDEO_START(kickgoal); DECLARE_VIDEO_START(actionhw); - UINT32 screen_update_kickgoal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kickgoal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(kickgoal_interrupt); void kickgoal_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); required_device m_maincpu; diff --git a/src/mame/includes/kim1.h b/src/mame/includes/kim1.h index 2f777e9bfed..0f4d9b67a0e 100644 --- a/src/mame/includes/kim1.h +++ b/src/mame/includes/kim1.h @@ -43,10 +43,10 @@ public: DECLARE_WRITE8_MEMBER(kim1_u2_write_a); DECLARE_READ8_MEMBER(kim1_u2_read_b); DECLARE_WRITE8_MEMBER(kim1_u2_write_b); - UINT8 m_u2_port_b; - UINT8 m_311_output; - UINT32 m_cassette_high_count; - UINT8 m_led_time[6]; + uint8_t m_u2_port_b; + uint8_t m_311_output; + uint32_t m_cassette_high_count; + uint8_t m_led_time[6]; // device overrides virtual void machine_start() override; diff --git a/src/mame/includes/kingobox.h b/src/mame/includes/kingobox.h index dba03d9a9cf..0463af6291a 100644 --- a/src/mame/includes/kingobox.h +++ b/src/mame/includes/kingobox.h @@ -28,12 +28,12 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_scroll_y; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram2; - required_shared_ptr m_spriteram; + required_shared_ptr m_scroll_y; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram2; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -66,12 +66,12 @@ public: DECLARE_PALETTE_INIT(kingofb); DECLARE_VIDEO_START(ringking); DECLARE_PALETTE_INIT(ringking); - UINT32 screen_update_kingofb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ringking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kingofb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ringking(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(kingofb_interrupt); - void palette_init_common( palette_device &palette, const UINT8 *color_prom, void (kingofb_state::*get_rgb_data)(const UINT8 *, int, int *, int *, int *) ); - void kingofb_get_rgb_data( const UINT8 *color_prom, int i, int *r_data, int *g_data, int *b_data ); - void ringking_get_rgb_data( const UINT8 *color_prom, int i, int *r_data, int *g_data, int *b_data ); + void palette_init_common( palette_device &palette, const uint8_t *color_prom, void (kingofb_state::*get_rgb_data)(const uint8_t *, int, int *, int *, int *) ); + void kingofb_get_rgb_data( const uint8_t *color_prom, int i, int *r_data, int *g_data, int *b_data ); + void ringking_get_rgb_data( const uint8_t *color_prom, int i, int *r_data, int *g_data, int *b_data ); void kingofb_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void ringking_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; diff --git a/src/mame/includes/klax.h b/src/mame/includes/klax.h index cf7f0d8195e..4e3f122dca7 100644 --- a/src/mame/includes/klax.h +++ b/src/mame/includes/klax.h @@ -31,7 +31,7 @@ public: DECLARE_VIDEO_START(klax); TILE_GET_INFO_MEMBER(get_playfield_tile_info); - UINT32 screen_update_klax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_klax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; diff --git a/src/mame/includes/kncljoe.h b/src/mame/includes/kncljoe.h index 2bcf5405658..0e92c624323 100644 --- a/src/mame/includes/kncljoe.h +++ b/src/mame/includes/kncljoe.h @@ -26,9 +26,9 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_scrollregs; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_scrollregs; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -37,8 +37,8 @@ public: int m_flipscreen; /* misc */ - UINT8 m_port1; - UINT8 m_port2; + uint8_t m_port1; + uint8_t m_port2; /* devices */ required_device m_maincpu; @@ -64,7 +64,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(kncljoe); - UINT32 screen_update_kncljoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kncljoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sound_nmi); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h index fb5f54f28d5..466c0a2e79a 100644 --- a/src/mame/includes/konamigx.h +++ b/src/mame/includes/konamigx.h @@ -64,15 +64,15 @@ public: required_device m_screen; required_device m_palette; - optional_shared_ptr m_workram; - optional_shared_ptr m_psacram; - optional_shared_ptr m_subpaletteram32; - optional_shared_ptr m_k053936_0_ctrl; - optional_shared_ptr m_k053936_0_linectrl; - optional_shared_ptr m_k053936_0_ctrl_16; - optional_shared_ptr m_k053936_0_linectrl_16; - optional_shared_ptr m_konamigx_type3_psac2_bank; - optional_shared_ptr m_generic_paletteram_32; + optional_shared_ptr m_workram; + optional_shared_ptr m_psacram; + optional_shared_ptr m_subpaletteram32; + optional_shared_ptr m_k053936_0_ctrl; + optional_shared_ptr m_k053936_0_linectrl; + optional_shared_ptr m_k053936_0_ctrl_16; + optional_shared_ptr m_k053936_0_linectrl_16; + optional_shared_ptr m_konamigx_type3_psac2_bank; + optional_shared_ptr m_generic_paletteram_32; optional_ioport m_an0, m_an1, m_light0_x, m_light0_y, m_light1_x, m_light1_y, m_eepromout; @@ -119,9 +119,9 @@ public: DECLARE_VIDEO_START(konamigx_type4); DECLARE_VIDEO_START(konamigx_type4_vsn); DECLARE_VIDEO_START(konamigx_type4_sd2); - UINT32 screen_update_konamigx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_konamigx_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_konamigx_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_konamigx(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_konamigx_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_konamigx_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(konamigx_type2_vblank_irq); TIMER_DEVICE_CALLBACK_MEMBER(konamigx_type2_scanline); TIMER_DEVICE_CALLBACK_MEMBER(konamigx_type4_scanline); @@ -153,7 +153,7 @@ public: void gx_draw_basic_extended_tilemaps_1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int mixerflags, int code, tilemap_t *sub1, int sub1flags, int rushingheroes_hack, int offs); void gx_draw_basic_extended_tilemaps_2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int mixerflags, int code, tilemap_t *sub2, int sub2flags, bitmap_ind16 *extra_bitmap, int offs); - void konamigx_esc_alert(UINT32 *srcbase, int srcoffs, int count, int mode); + void konamigx_esc_alert(uint32_t *srcbase, int srcoffs, int count, int mode); void konamigx_precache_registers(void); void wipezbuf(int noshadow); @@ -162,29 +162,29 @@ public: void konamigx_mixer_init(screen_device &screen, int objdma); void konamigx_objdma(void); - void generate_sprites(address_space &space, UINT32 src, UINT32 spr, int count); + void generate_sprites(address_space &space, uint32_t src, uint32_t spr, int count); void fantjour_dma_install(); void konamigx_mixer_primode(int mode); - typedef void (konamigx_state::*esc_cb)(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4); + typedef void (konamigx_state::*esc_cb)(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4); - void tkmmpzdm_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4); - void dragoonj_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4); - void sal2_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4); - void sexyparo_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4); - void tbyahhoo_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4); - void daiskiss_esc(address_space &space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4); + void tkmmpzdm_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4); + void dragoonj_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4); + void sal2_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4); + void sexyparo_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4); + void tbyahhoo_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4); + void daiskiss_esc(address_space &space, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4); inline int K053247GX_combine_c18(int attrib); inline int K055555GX_decode_objcolor(int c18); inline int K055555GX_decode_inpri(int c18); int K055555GX_decode_vmixcolor(int layer, int *color); - UINT8 m_sound_ctrl; - UINT8 m_sound_intck; - UINT32 m_fantjour_dma[8]; + uint8_t m_sound_ctrl; + uint8_t m_sound_intck; + uint32_t m_fantjour_dma[8]; int m_konamigx_current_frame; int m_gx_objdma, m_gx_primode; emu_timer *m_dmadelay_timer; @@ -193,14 +193,14 @@ public: int m_gx_cfgport; int m_suspension_active, m_resume_trigger; int m_last_prot_op, m_last_prot_clk; - UINT8 m_prev_pixel_clock; + uint8_t m_prev_pixel_clock; - UINT8 m_esc_program[4096]; + uint8_t m_esc_program[4096]; esc_cb m_esc_cb; - UINT16 m_prot_data[0x20]; + uint16_t m_prot_data[0x20]; - UINT16 *m_gx_spriteram; + uint16_t *m_gx_spriteram; // mirrored K054338 settings int *m_K054338_shdRGB; @@ -212,14 +212,14 @@ public: int m_opri, m_oinprion; int m_vcblk[6], m_ocblk; int m_vinmix, m_vmixon, m_osinmix, m_osmixon; - UINT8 m_gx_wrport1_0, m_gx_wrport1_1; - UINT16 m_gx_wrport2; + uint8_t m_gx_wrport1_0, m_gx_wrport1_1; + uint16_t m_gx_wrport2; // 2nd-Tier GX/MW Graphics Variables - UINT8 *m_gx_objzbuf; - std::unique_ptr m_gx_shdzbuf; + uint8_t *m_gx_objzbuf; + std::unique_ptr m_gx_shdzbuf; int m_layer_colorbase[4]; - INT32 m_gx_tilebanks[8], m_gx_oldbanks[8]; + int32_t m_gx_tilebanks[8], m_gx_oldbanks[8]; int m_gx_tilemode, m_gx_rozenable, m_psac_colorbase, m_last_psac_colorbase; int m_gx_specialrozenable; // type 1 roz, with voxel height-map, rendered from 2 source tilemaps (which include height data) to temp bitmap for further processing int m_gx_rushingheroes_hack; diff --git a/src/mame/includes/kopunch.h b/src/mame/includes/kopunch.h index 3d0e6d0fce3..5078ce6d8fd 100644 --- a/src/mame/includes/kopunch.h +++ b/src/mame/includes/kopunch.h @@ -22,14 +22,14 @@ public: required_device m_gfxdecode; /* memory pointers */ - required_shared_ptr m_vram_fg; - required_shared_ptr m_vram_bg; + required_shared_ptr m_vram_fg; + required_shared_ptr m_vram_bg; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_gfxbank; - UINT8 m_scrollx; + uint8_t m_gfxbank; + uint8_t m_scrollx; DECLARE_READ8_MEMBER(sensors1_r); DECLARE_READ8_MEMBER(sensors2_r); @@ -48,7 +48,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); DECLARE_PALETTE_INIT(kopunch); - UINT32 screen_update_kopunch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kopunch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); virtual void machine_start() override; virtual void video_start() override; diff --git a/src/mame/includes/kramermc.h b/src/mame/includes/kramermc.h index 7a0dbd6020e..02e177cd0d1 100644 --- a/src/mame/includes/kramermc.h +++ b/src/mame/includes/kramermc.h @@ -20,11 +20,11 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_key_row; + uint8_t m_key_row; DECLARE_DRIVER_INIT(kramermc); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_kramermc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kramermc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(kramermc_port_a_r); DECLARE_READ8_MEMBER(kramermc_port_b_r); DECLARE_WRITE8_MEMBER(kramermc_port_a_w); diff --git a/src/mame/includes/ksayakyu.h b/src/mame/includes/ksayakyu.h index 1000b18628a..37cf048a7cd 100644 --- a/src/mame/includes/ksayakyu.h +++ b/src/mame/includes/ksayakyu.h @@ -22,8 +22,8 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_tilemap; @@ -48,7 +48,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(ksayakyu); - UINT32 screen_update_ksayakyu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ksayakyu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/kyocera.h b/src/mame/includes/kyocera.h index 1b3f792a5fa..60c9180dbb3 100644 --- a/src/mame/includes/kyocera.h +++ b/src/mame/includes/kyocera.h @@ -107,7 +107,7 @@ public: virtual void machine_start() override; memory_region *m_opt_region; - 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); DECLARE_READ8_MEMBER( uart_status_r ); DECLARE_WRITE8_MEMBER( uart_ctrl_w ); @@ -124,10 +124,10 @@ public: DECLARE_WRITE_LINE_MEMBER( write_centronics_select ); /* memory state */ - UINT8 m_bank; /* memory bank selection */ + uint8_t m_bank; /* memory bank selection */ /* keyboard state */ - UINT16 m_keylatch; /* keyboard latch */ + uint16_t m_keylatch; /* keyboard latch */ /* sound state */ int m_buzzer; /* buzzer select */ @@ -170,11 +170,11 @@ public: DECLARE_WRITE8_MEMBER( romam_w ); DECLARE_READ8_MEMBER( romrd_r ); - void bankswitch(UINT8 data); + void bankswitch(uint8_t data); // ROM cassette int m_rom_sel; - UINT32 m_rom_addr; + uint32_t m_rom_addr; /* peripheral state */ int m_iosel; /* serial interface select */ @@ -215,7 +215,7 @@ public: virtual void machine_start() override; memory_region *m_opt_region; - 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); DECLARE_READ8_MEMBER( bank_r ); DECLARE_WRITE8_MEMBER( bank_w ); @@ -234,13 +234,13 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(tandy200_tp_tick); - void bankswitch(UINT8 data); + void bankswitch(uint8_t data); /* memory state */ - UINT8 m_bank; /* memory bank selection */ + uint8_t m_bank; /* memory bank selection */ /* keyboard state */ - UINT16 m_keylatch; /* keyboard latch */ + uint16_t m_keylatch; /* keyboard latch */ int m_tp; /* timing pulse */ /* sound state */ diff --git a/src/mame/includes/kyugo.h b/src/mame/includes/kyugo.h index b45f4def599..71193f349f2 100644 --- a/src/mame/includes/kyugo.h +++ b/src/mame/includes/kyugo.h @@ -23,22 +23,22 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_bgattribram; - required_shared_ptr m_spriteram_1; - required_shared_ptr m_spriteram_2; - required_shared_ptr m_shared_ram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_bgattribram; + required_shared_ptr m_spriteram_1; + required_shared_ptr m_spriteram_2; + required_shared_ptr m_shared_ram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_scroll_x_lo; - UINT8 m_scroll_x_hi; - UINT8 m_scroll_y; + uint8_t m_scroll_x_lo; + uint8_t m_scroll_x_hi; + uint8_t m_scroll_y; int m_bgpalbank; int m_fgcolor; - const UINT8 *m_color_codes; + const uint8_t *m_color_codes; /* devices */ required_device m_maincpu; @@ -46,7 +46,7 @@ public: required_device m_gfxdecode; required_device m_palette; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(kyugo_nmi_mask_w); DECLARE_WRITE8_MEMBER(kyugo_sub_cpu_control_w); DECLARE_WRITE8_MEMBER(kyugo_coin_counter_w); @@ -64,7 +64,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_kyugo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kyugo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/labyrunr.h b/src/mame/includes/labyrunr.h index 092b28a7503..ffeae360ac5 100644 --- a/src/mame/includes/labyrunr.h +++ b/src/mame/includes/labyrunr.h @@ -29,10 +29,10 @@ public: required_device m_maincpu; /* memory pointers */ - required_shared_ptr m_scrollram; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; + required_shared_ptr m_scrollram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram1; + required_shared_ptr m_videoram2; required_device m_gfxdecode; required_device m_screen; @@ -52,7 +52,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(labyrunr); - UINT32 screen_update_labyrunr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_labyrunr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(labyrunr_vblank_interrupt); INTERRUPT_GEN_MEMBER(labyrunr_timer_interrupt); }; diff --git a/src/mame/includes/ladybug.h b/src/mame/includes/ladybug.h index 51d1cd92a6f..a3c5c03f87d 100644 --- a/src/mame/includes/ladybug.h +++ b/src/mame/includes/ladybug.h @@ -24,26 +24,26 @@ public: m_decrypted_opcodes(*this, "decrypted_opcodes") { } /* memory pointers */ - required_shared_ptr m_videoram; - optional_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_grid_data; + required_shared_ptr m_videoram; + optional_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_grid_data; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_grid_tilemap; // ladybug - UINT8 m_grid_color; + uint8_t m_grid_color; int m_star_speed; - UINT8 m_stars_enable; - UINT8 m_stars_speed; - UINT32 m_stars_state; - UINT16 m_stars_offset; - UINT8 m_stars_count; + uint8_t m_stars_enable; + uint8_t m_stars_speed; + uint32_t m_stars_state; + uint16_t m_stars_offset; + uint8_t m_stars_count; /* misc */ - UINT8 m_sound_low; - UINT8 m_sound_high; - UINT8 m_weird_value[8]; + uint8_t m_sound_low; + uint8_t m_sound_high; + uint8_t m_weird_value[8]; /* devices */ required_device m_maincpu; @@ -52,7 +52,7 @@ public: optional_ioport m_port_dsw0; optional_ioport m_p1_control; optional_ioport m_p2_control; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; DECLARE_WRITE8_MEMBER(ladybug_videoram_w); DECLARE_WRITE8_MEMBER(ladybug_colorram_w); @@ -67,9 +67,9 @@ public: DECLARE_MACHINE_START(ladybug); DECLARE_VIDEO_START(ladybug); DECLARE_PALETTE_INIT(ladybug); - UINT32 screen_update_ladybug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ladybug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void palette_init_common( palette_device &palette, const UINT8 *color_prom, + void palette_init_common( palette_device &palette, const uint8_t *color_prom, int r_bit0, int r_bit1, int g_bit0, int g_bit1, int b_bit0, int b_bit1 ); }; diff --git a/src/mame/includes/ladyfrog.h b/src/mame/includes/ladyfrog.h index e35efa73b13..736f63d13d3 100644 --- a/src/mame/includes/ladyfrog.h +++ b/src/mame/includes/ladyfrog.h @@ -24,11 +24,11 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - std::unique_ptr m_spriteram; - required_shared_ptr m_scrlram; - std::vector m_paletteram; - std::vector m_paletteram_ext; + required_shared_ptr m_videoram; + std::unique_ptr m_spriteram; + required_shared_ptr m_scrlram; + std::vector m_paletteram; + std::vector m_paletteram_ext; /* video-related */ tilemap_t *m_bg_tilemap; @@ -40,7 +40,7 @@ public: int m_sound_nmi_enable; int m_pending_nmi; int m_snd_flag; - UINT8 m_snd_data; + uint8_t m_snd_data; /* devices */ required_device m_maincpu; @@ -74,7 +74,7 @@ public: virtual void video_start() override; DECLARE_VIDEO_START(toucheme); DECLARE_VIDEO_START(ladyfrog_common); - UINT32 screen_update_ladyfrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ladyfrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(nmi_callback); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/laserbat.h b/src/mame/includes/laserbat.h index 73d5246b567..25e72f080c3 100644 --- a/src/mame/includes/laserbat.h +++ b/src/mame/includes/laserbat.h @@ -80,7 +80,7 @@ public: // running the video virtual void video_start() override; - UINT32 screen_update_laserbat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_laserbat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: enum { TIMER_SCANLINE }; @@ -110,16 +110,16 @@ protected: // stuff for rendering video emu_timer *m_scanline_timer; bitmap_ind16 m_bitmap; - UINT8 const *m_gfx1; - UINT8 const *m_gfx2; + uint8_t const *m_gfx1; + uint8_t const *m_gfx2; // control lines unsigned m_input_mux; bool m_mpx_p_1_2; // RAM used by TTL video hardware, writable by CPU - UINT8 m_bg_ram[0x400]; // background tilemap - UINT8 m_eff_ram[0x400]; // per-scanline effects (A8 not wired meaning only half is usable) + uint8_t m_bg_ram[0x400]; // background tilemap + uint8_t m_eff_ram[0x400]; // per-scanline effects (A8 not wired meaning only half is usable) bool m_mpx_bkeff; // select between writing background and effects memory // signals affecting the TTL-generated 32x32 sprite diff --git a/src/mame/includes/lasso.h b/src/mame/includes/lasso.h index fd241605c37..1e5c72d03e7 100644 --- a/src/mame/includes/lasso.h +++ b/src/mame/includes/lasso.h @@ -31,20 +31,20 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; - required_shared_ptr m_back_color; - optional_shared_ptr m_chip_data; - optional_shared_ptr m_bitmap_ram; /* 0x2000 bytes for a 256 x 256 x 1 bitmap */ - optional_shared_ptr m_last_colors; - optional_shared_ptr m_track_scroll; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; + required_shared_ptr m_back_color; + optional_shared_ptr m_chip_data; + optional_shared_ptr m_bitmap_ram; /* 0x2000 bytes for a 256 x 256 x 1 bitmap */ + optional_shared_ptr m_last_colors; + optional_shared_ptr m_track_scroll; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_track_tilemap; - UINT8 m_gfxbank; /* used by lasso, chameleo, wwjgtin and pinbo */ - UINT8 m_track_enable; /* used by wwjgtin */ + uint8_t m_gfxbank; /* used by lasso, chameleo, wwjgtin and pinbo */ + uint8_t m_track_enable; /* used by wwjgtin */ /* devices */ required_device m_maincpu; @@ -77,9 +77,9 @@ public: DECLARE_VIDEO_START(wwjgtin); DECLARE_PALETTE_INIT(wwjgtin); DECLARE_VIDEO_START(pinbo); - UINT32 screen_update_lasso(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_chameleo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_wwjgtin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lasso(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_chameleo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wwjgtin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); rgb_t get_color( int data ); void wwjgtin_set_last_four_colors(); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int reverse ); diff --git a/src/mame/includes/lastduel.h b/src/mame/includes/lastduel.h index 8d28eaf8762..f4a4a8732b7 100644 --- a/src/mame/includes/lastduel.h +++ b/src/mame/includes/lastduel.h @@ -34,16 +34,16 @@ public: /* memory pointers */ required_device m_spriteram; - required_shared_ptr m_vram; - required_shared_ptr m_scroll1; - required_shared_ptr m_scroll2; - required_shared_ptr m_paletteram; + required_shared_ptr m_vram; + required_shared_ptr m_scroll1; + required_shared_ptr m_scroll2; + required_shared_ptr m_paletteram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; tilemap_t *m_tx_tilemap; - UINT16 m_scroll[8]; + uint16_t m_scroll[8]; int m_sprite_flipy_mask; int m_sprite_pri_mask; int m_tilemap_priority; @@ -68,8 +68,8 @@ public: DECLARE_VIDEO_START(lastduel); DECLARE_MACHINE_START(madgear); DECLARE_VIDEO_START(madgear); - UINT32 screen_update_lastduel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_madgear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lastduel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_madgear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(lastduel_timer_cb); TIMER_DEVICE_CALLBACK_MEMBER(madgear_timer_cb); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ); diff --git a/src/mame/includes/lazercmd.h b/src/mame/includes/lazercmd.h index c34efcf8fef..64ca83f3f0e 100644 --- a/src/mame/includes/lazercmd.h +++ b/src/mame/includes/lazercmd.h @@ -44,19 +44,19 @@ public: required_device m_dac2; required_device m_dac3; /* memory pointers */ - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_gfxdecode; required_device m_palette; /* video-related */ - UINT8 m_marker_x; - UINT8 m_marker_y; + uint8_t m_marker_x; + uint8_t m_marker_y; /* misc */ int m_timer_count; - UINT8 m_sense_state; - UINT8 m_attract; + uint8_t m_sense_state; + uint8_t m_attract; DECLARE_WRITE8_MEMBER(lazercmd_ctrl_port_w); DECLARE_READ8_MEMBER(lazercmd_ctrl_port_r); @@ -70,7 +70,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(lazercmd); - UINT32 screen_update_lazercmd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lazercmd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(lazercmd_timer); TIMER_DEVICE_CALLBACK_MEMBER(bbonk_timer); int vert_scale(int data); diff --git a/src/mame/includes/lc80.h b/src/mame/includes/lc80.h index 36788b37f00..6671e3717d2 100644 --- a/src/mame/includes/lc80.h +++ b/src/mame/includes/lc80.h @@ -61,8 +61,8 @@ public: void update_display(); // display state - UINT8 m_digit; - UINT8 m_segment; + uint8_t m_digit; + uint8_t m_segment; }; #endif diff --git a/src/mame/includes/legionna.h b/src/mame/includes/legionna.h index 068571f2a72..77e7c39450f 100644 --- a/src/mame/includes/legionna.h +++ b/src/mame/includes/legionna.h @@ -21,17 +21,17 @@ public: m_palette(*this, "palette"), m_raiden2cop(*this, "raiden2cop") { - memset(scrollvals, 0, sizeof(UINT16)*6); + memset(scrollvals, 0, sizeof(uint16_t)*6); } - required_shared_ptr m_spriteram; - std::unique_ptr m_back_data; - std::unique_ptr m_fore_data; - std::unique_ptr m_mid_data; - std::unique_ptr m_textram; - std::unique_ptr m_scrollram16; - UINT16 m_layer_disable; - std::unique_ptr m_layer_config; + required_shared_ptr m_spriteram; + std::unique_ptr m_back_data; + std::unique_ptr m_fore_data; + std::unique_ptr m_mid_data; + std::unique_ptr m_textram; + std::unique_ptr m_scrollram16; + uint16_t m_layer_disable; + std::unique_ptr m_layer_config; int m_sprite_xoffs; int m_sprite_yoffs; tilemap_t *m_background_layer; @@ -40,11 +40,11 @@ public: tilemap_t *m_text_layer; int m_has_extended_banking; int m_has_extended_priority; - UINT16 m_sprite_pri_mask[4]; - UINT16 m_back_gfx_bank; - UINT16 m_fore_gfx_bank; - UINT16 m_mid_gfx_bank; - UINT16 scrollvals[6]; + uint16_t m_sprite_pri_mask[4]; + uint16_t m_back_gfx_bank; + uint16_t m_fore_gfx_bank; + uint16_t m_mid_gfx_bank; + uint16_t scrollvals[6]; DECLARE_WRITE16_MEMBER(tilemap_enable_w); DECLARE_WRITE16_MEMBER(tile_scroll_w); DECLARE_WRITE16_MEMBER(tile_scroll_base_w); @@ -80,12 +80,12 @@ public: DECLARE_VIDEO_START(denjinmk); DECLARE_VIDEO_START(grainbow); DECLARE_VIDEO_START(cupsoc); - UINT32 screen_update_legionna(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_heatbrl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_godzilla(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_grainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_legionna(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_heatbrl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_godzilla(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_grainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect); - void descramble_legionnaire_gfx(UINT8* src); + void descramble_legionnaire_gfx(uint8_t* src); void common_video_start(); void common_video_allocate_ptr(); required_device m_maincpu; diff --git a/src/mame/includes/leland.h b/src/mame/includes/leland.h index 1d79e064488..c4e46701071 100644 --- a/src/mame/includes/leland.h +++ b/src/mame/includes/leland.h @@ -19,8 +19,8 @@ struct vram_state_data { - UINT16 m_addr; - UINT8 m_latch[2]; + uint16_t m_addr; + uint8_t m_latch[2]; }; class leland_80186_sound_device; @@ -44,7 +44,7 @@ public: required_device m_master; required_device m_slave; - required_shared_ptr m_mainram; + required_shared_ptr m_mainram; required_device m_eeprom; optional_device m_sound; optional_device m_dac0; @@ -54,44 +54,44 @@ public: required_device m_screen; required_device m_palette; - UINT8 m_dac_control; - UINT8 *m_alleymas_kludge_mem; - std::unique_ptr m_ataxx_qram; - UINT8 m_gfx_control; - UINT8 m_wcol_enable; + uint8_t m_dac_control; + uint8_t *m_alleymas_kludge_mem; + std::unique_ptr m_ataxx_qram; + uint8_t m_gfx_control; + uint8_t m_wcol_enable; emu_timer *m_master_int_timer; - UINT8 *m_master_base; - UINT8 *m_slave_base; - UINT8 *m_xrom_base; - UINT32 m_master_length; - UINT32 m_slave_length; - UINT32 m_xrom_length; + uint8_t *m_master_base; + uint8_t *m_slave_base; + uint8_t *m_xrom_base; + uint32_t m_master_length; + uint32_t m_slave_length; + uint32_t m_xrom_length; int m_dangerz_x; int m_dangerz_y; - UINT8 m_analog_result; - UINT8 m_dial_last_input[4]; - UINT8 m_dial_last_result[4]; - UINT8 m_keycard_shift; - UINT8 m_keycard_bit; - UINT8 m_keycard_state; - UINT8 m_keycard_clock; - UINT8 m_keycard_command[3]; - UINT8 m_top_board_bank; - UINT8 m_sound_port_bank; - UINT8 m_alternate_bank; - UINT8 m_master_bank; + uint8_t m_analog_result; + uint8_t m_dial_last_input[4]; + uint8_t m_dial_last_result[4]; + uint8_t m_keycard_shift; + uint8_t m_keycard_bit; + uint8_t m_keycard_state; + uint8_t m_keycard_clock; + uint8_t m_keycard_command[3]; + uint8_t m_top_board_bank; + uint8_t m_sound_port_bank; + uint8_t m_alternate_bank; + uint8_t m_master_bank; void (leland_state::*m_update_master_bank)(); - UINT32 m_xrom1_addr; - UINT32 m_xrom2_addr; - UINT8 m_battery_ram_enable; - UINT8 *m_battery_ram; - std::unique_ptr m_extra_tram; - std::unique_ptr m_video_ram; + uint32_t m_xrom1_addr; + uint32_t m_xrom2_addr; + uint8_t m_battery_ram_enable; + uint8_t *m_battery_ram; + std::unique_ptr m_extra_tram; + std::unique_ptr m_video_ram; struct vram_state_data m_vram_state[2]; - UINT16 m_xscroll; - UINT16 m_yscroll; - UINT8 m_gfxbank; - UINT16 m_last_scanline; + uint16_t m_xscroll; + uint16_t m_yscroll; + uint8_t m_gfxbank; + uint16_t m_last_scanline; emu_timer *m_scanline_timer; DECLARE_READ8_MEMBER(cerberus_dial_1_r); DECLARE_READ8_MEMBER(cerberus_dial_2_r); @@ -171,8 +171,8 @@ public: DECLARE_VIDEO_START(leland); DECLARE_VIDEO_START(leland2); DECLARE_VIDEO_START(ataxx); - UINT32 screen_update_leland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ataxx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_leland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ataxx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(leland_master_interrupt); TIMER_CALLBACK_MEMBER(leland_interrupt_callback); TIMER_CALLBACK_MEMBER(ataxx_interrupt_callback); @@ -196,12 +196,12 @@ public: void viper_bankswitch(); void offroad_bankswitch(); void ataxx_bankswitch(); - void leland_init_eeprom(UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type); - void ataxx_init_eeprom(const UINT16 *data); + void leland_init_eeprom(uint8_t default_val, const uint16_t *data, uint8_t serial_offset, uint8_t serial_type); + void ataxx_init_eeprom(const uint16_t *data); int keycard_r(); void keycard_w(int data); void leland_rotate_memory(const char *cpuname); - void init_master_ports(UINT8 mvram_base, UINT8 io_base); + void init_master_ports(uint8_t mvram_base, uint8_t io_base); }; @@ -217,8 +217,8 @@ public: class leland_80186_sound_device : public device_t { public: - leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - leland_80186_sound_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); + leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + leland_80186_sound_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 machine_config_constructor device_mconfig_additions() const override; DECLARE_WRITE16_MEMBER(peripheral_ctrl); @@ -275,16 +275,16 @@ private: // internal state i80186_cpu_device *m_audiocpu; - UINT16 m_peripheral; - UINT8 m_last_control; - UINT8 m_clock_active; - UINT8 m_clock_tick; - UINT16 m_sound_command; - UINT16 m_sound_response; - UINT32 m_ext_start; - UINT32 m_ext_stop; - UINT8 m_ext_active; - UINT8* m_ext_base; + uint16_t m_peripheral; + uint8_t m_last_control; + uint8_t m_clock_active; + uint8_t m_clock_tick; + uint16_t m_sound_command; + uint16_t m_sound_response; + uint32_t m_ext_start; + uint32_t m_ext_stop; + uint8_t m_ext_active; + uint8_t* m_ext_base; required_device m_pit0; optional_device m_pit1; @@ -297,7 +297,7 @@ extern const device_type LELAND_80186; class redline_80186_sound_device : public leland_80186_sound_device { public: - redline_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + redline_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE16_MEMBER(redline_dac_w); virtual machine_config_constructor device_mconfig_additions() const override; }; @@ -307,7 +307,7 @@ extern const device_type REDLINE_80186; class ataxx_80186_sound_device : public leland_80186_sound_device { public: - ataxx_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ataxx_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; @@ -316,7 +316,7 @@ extern const device_type ATAXX_80186; class wsf_80186_sound_device : public leland_80186_sound_device { public: - wsf_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + wsf_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual machine_config_constructor device_mconfig_additions() const override; }; diff --git a/src/mame/includes/lemmings.h b/src/mame/includes/lemmings.h index 843489dd963..a6c5d094c89 100644 --- a/src/mame/includes/lemmings.h +++ b/src/mame/includes/lemmings.h @@ -29,9 +29,9 @@ public: /* video-related */ bitmap_ind16 m_bitmap0; tilemap_t *m_vram_tilemap; - UINT16 m_sprite_triple_buffer_0[0x800]; - UINT16 m_sprite_triple_buffer_1[0x800]; - UINT8 m_vram_buffer[2048 * 64]; // 64 bytes per VRAM character + uint16_t m_sprite_triple_buffer_0[0x800]; + uint16_t m_sprite_triple_buffer_1[0x800]; + uint8_t m_vram_buffer[2048 * 64]; // 64 bytes per VRAM character /* devices */ required_device m_maincpu; @@ -46,14 +46,14 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_control_data; - required_shared_ptr m_vram_data; - required_shared_ptr m_pixel_0_data; - required_shared_ptr m_pixel_1_data; + required_shared_ptr m_control_data; + required_shared_ptr m_vram_data; + required_shared_ptr m_pixel_0_data; + required_shared_ptr m_pixel_1_data; DECLARE_WRITE16_MEMBER(lemmings_control_w); DECLARE_READ16_MEMBER(lemmings_trackball_r); - void lemmings_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask ); + void lemmings_sound_cb( address_space &space, uint16_t data, uint16_t mem_mask ); DECLARE_WRITE8_MEMBER(lemmings_sound_ack_w); DECLARE_WRITE16_MEMBER(lemmings_pixel_0_w); DECLARE_WRITE16_MEMBER(lemmings_pixel_1_w); @@ -61,7 +61,7 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_lemmings(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lemmings(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_lemmings(screen_device &screen, bool state); void lemmings_copy_bitmap(bitmap_rgb32& bitmap, bitmap_ind16& srcbitmap, int* xscroll, int* yscroll, const rectangle& cliprect); diff --git a/src/mame/includes/lethal.h b/src/mame/includes/lethal.h index acac08d8610..4703c8003f7 100644 --- a/src/mame/includes/lethal.h +++ b/src/mame/includes/lethal.h @@ -31,7 +31,7 @@ public: int m_back_colorbase; /* misc */ - UINT8 m_cur_control2; + uint8_t m_cur_control2; /* devices */ required_device m_maincpu; @@ -51,7 +51,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_lethalen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lethalen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(lethalen_interrupt); K05324X_CB_MEMBER(sprite_callback); K056832_CB_MEMBER(tile_callback); diff --git a/src/mame/includes/lethalj.h b/src/mame/includes/lethalj.h index eb501e82122..38a1229ae1b 100644 --- a/src/mame/includes/lethalj.h +++ b/src/mame/includes/lethalj.h @@ -38,14 +38,14 @@ public: optional_ioport m_light1_x; optional_ioport m_light1_y; - UINT16 m_blitter_data[8]; - std::unique_ptr m_screenram; - UINT8 m_vispage; - UINT16 *m_blitter_base; + uint16_t m_blitter_data[8]; + std::unique_ptr m_screenram; + uint8_t m_vispage; + uint16_t *m_blitter_base; int m_blitter_rows; - UINT16 m_gunx; - UINT16 m_guny; - UINT8 m_blank_palette; + uint16_t m_gunx; + uint16_t m_guny; + uint8_t m_blank_palette; DECLARE_WRITE16_MEMBER(ripribit_control_w); DECLARE_WRITE16_MEMBER(cfarm_control_w); DECLARE_WRITE16_MEMBER(cclownz_control_w); diff --git a/src/mame/includes/liberate.h b/src/mame/includes/liberate.h index f28b2224143..3d01d41e0b6 100644 --- a/src/mame/includes/liberate.h +++ b/src/mame/includes/liberate.h @@ -20,20 +20,20 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - optional_shared_ptr m_bg_vram; /* prosport */ - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_scratchram; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_bg_vram; /* prosport */ + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_scratchram; + optional_shared_ptr m_decrypted_opcodes; - UINT8 *m_fg_gfx; /* prosoccr */ - std::unique_ptr m_charram; /* prosoccr */ - UINT8 m_io_ram[16]; + uint8_t *m_fg_gfx; /* prosoccr */ + std::unique_ptr m_charram; /* prosoccr */ + uint8_t m_io_ram[16]; int m_bank; int m_latch; - UINT8 m_gfx_rom_readback; + uint8_t m_gfx_rom_readback; int m_background_color; int m_background_disable; @@ -77,10 +77,10 @@ public: DECLARE_VIDEO_START(prosport); DECLARE_VIDEO_START(boomrang); DECLARE_VIDEO_START(prosoccr); - UINT32 screen_update_liberate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_prosport(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_boomrang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_prosoccr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_liberate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_prosport(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_boomrang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_prosoccr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(deco16_interrupt); void liberate_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void prosport_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/liberatr.h b/src/mame/includes/liberatr.h index e046fcb035b..54b8d91f59b 100644 --- a/src/mame/includes/liberatr.h +++ b/src/mame/includes/liberatr.h @@ -38,7 +38,7 @@ public: DECLARE_READ8_MEMBER( bitmap_xy_r ); DECLARE_WRITE8_MEMBER( bitmap_xy_w ); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // early raster EAROM interface DECLARE_READ8_MEMBER( earom_r ); @@ -52,28 +52,28 @@ protected: // vector and early raster EAROM interface required_device m_earom; - UINT8 m_earom_data; - UINT8 m_earom_control; + uint8_t m_earom_data; + uint8_t m_earom_control; struct planet; - void init_planet(planet &liberatr_planet, UINT8 *planet_rom); + void init_planet(planet &liberatr_planet, uint8_t *planet_rom); void get_pens(pen_t *pens); void draw_planet(bitmap_rgb32 &bitmap, pen_t *pens); void draw_bitmap(bitmap_rgb32 &bitmap, pen_t *pens); required_device m_screen; - required_shared_ptr m_base_ram; - required_shared_ptr m_planet_frame; - required_shared_ptr m_planet_select; - required_shared_ptr m_xcoord; - required_shared_ptr m_ycoord; - required_shared_ptr m_bitmapram; - required_shared_ptr m_colorram; - - UINT8 m_trackball_offset; - UINT8 m_ctrld; - UINT8 m_videoram[0x10000]; + required_shared_ptr m_base_ram; + required_shared_ptr m_planet_frame; + required_shared_ptr m_planet_select; + required_shared_ptr m_xcoord; + required_shared_ptr m_ycoord; + required_shared_ptr m_bitmapram; + required_shared_ptr m_colorram; + + uint8_t m_trackball_offset; + uint8_t m_ctrld; + uint8_t m_videoram[0x10000]; // The following structure describes the (up to 32) line segments // that make up one horizontal line (latitude) for one display frame of the planet. @@ -81,10 +81,10 @@ protected: // data before it is packed for actual use. struct planet_frame_line { - UINT8 segment_count; // the number of segments on this line - UINT8 max_x; // the maximum value of x_array for this line - UINT8 color_array[32]; // the color values - UINT8 x_array[32]; // and maximum x values for each segment + uint8_t segment_count; // the number of segments on this line + uint8_t max_x; // the maximum value of x_array for this line + uint8_t color_array[32]; // the color values + uint8_t x_array[32]; // and maximum x values for each segment }; // The following structure describes the lines (latitudes) @@ -103,7 +103,7 @@ protected: // for the 128 lines. struct planet { - UINT8 *frames[256]; + uint8_t *frames[256]; }; // The following array collects the 2 different planet diff --git a/src/mame/includes/lisa.h b/src/mame/includes/lisa.h index b3a32f84a21..1aee9e41553 100644 --- a/src/mame/includes/lisa.h +++ b/src/mame/includes/lisa.h @@ -27,8 +27,8 @@ /* lisa MMU segment regs */ struct real_mmu_entry { - UINT16 sorg; - UINT16 slim; + uint16_t sorg; + uint16_t slim; }; /* MMU regs translated into a more efficient format */ @@ -133,8 +133,8 @@ public: required_device m_speaker; required_device m_nvram; - required_shared_ptr m_fdc_rom; - required_shared_ptr m_fdc_ram; + required_shared_ptr m_fdc_rom; + required_shared_ptr m_fdc_ram; required_ioport m_io_line0; required_ioport m_io_line1; @@ -149,23 +149,23 @@ public: required_device m_palette; - UINT8 *m_ram_ptr; - UINT8 *m_rom_ptr; - UINT8 *m_videoROM_ptr; + uint8_t *m_ram_ptr; + uint8_t *m_rom_ptr; + uint8_t *m_videoROM_ptr; int m_setup; int m_seg; real_mmu_entry m_real_mmu_regs[4][128]; mmu_entry m_mmu_regs[4][128]; int m_diag2; int m_test_parity; - UINT16 m_mem_err_addr_latch; + uint16_t m_mem_err_addr_latch; int m_parity_error_pending; int m_bad_parity_count; - std::unique_ptr m_bad_parity_table; + std::unique_ptr m_bad_parity_table; int m_VTMSK; int m_VTIR; - UINT16 m_video_address_latch; - UINT16 *m_videoram_ptr; + uint16_t m_video_address_latch; + uint16_t *m_videoram_ptr; int m_KBIR; int m_FDIR; int m_DISK_DIAG; @@ -204,7 +204,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; void nvram_init(nvram_device &nvram, void *data, size_t size); - UINT32 screen_update_lisa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lisa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(lisa_interrupt); TIMER_CALLBACK_MEMBER(handle_mouse); TIMER_CALLBACK_MEMBER(read_COPS_command); @@ -222,7 +222,7 @@ public: void reset_COPS(); void lisa_fdc_ttl_glue_access(offs_t offset); void COPS_send_data_if_possible(); - void COPS_queue_data(const UINT8 *data, int len); + void COPS_queue_data(const uint8_t *data, int len); void COPS_via_irq_func(int val); void scan_keyboard(); void unplug_keyboard(); diff --git a/src/mame/includes/lkage.h b/src/mame/includes/lkage.h index b6d8fb3e84e..e524e974885 100644 --- a/src/mame/includes/lkage.h +++ b/src/mame/includes/lkage.h @@ -19,18 +19,18 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_vreg; - required_shared_ptr m_scroll; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; + required_shared_ptr m_vreg; + required_shared_ptr m_scroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; tilemap_t *m_tx_tilemap; - UINT8 m_bg_tile_bank; - UINT8 m_fg_tile_bank; - UINT8 m_tx_tile_bank; + uint8_t m_bg_tile_bank; + uint8_t m_fg_tile_bank; + uint8_t m_tx_tile_bank; int m_sprite_dx; @@ -39,22 +39,22 @@ public: int m_pending_nmi; /* mcu */ - UINT8 m_from_main; - UINT8 m_from_mcu; + uint8_t m_from_main; + uint8_t m_from_mcu; int m_mcu_sent; int m_main_sent; - 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_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; /* lkageb fake mcu */ - UINT8 m_mcu_val; + uint8_t m_mcu_val; int m_mcu_ready; /* cpu data/mcu ready status */ /* devices */ @@ -95,7 +95,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_lkage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lkage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(nmi_callback); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/llc.h b/src/mame/includes/llc.h index e74bf7f5acc..56637c0b71d 100644 --- a/src/mame/includes/llc.h +++ b/src/mame/includes/llc.h @@ -39,15 +39,15 @@ public: DECLARE_READ8_MEMBER(llc2_port1_b_r); DECLARE_READ8_MEMBER(llc2_port2_a_r); DECLARE_WRITE8_MEMBER(llc2_port1_b_w); - const UINT8 *m_p_chargen; + const uint8_t *m_p_chargen; optional_device m_speaker; - optional_shared_ptr m_p_videoram; + optional_shared_ptr m_p_videoram; bool m_rv; - UINT8 m_term_status; - UINT8 m_llc1_key; + uint8_t m_term_status; + uint8_t m_llc1_key; private: - UINT8 m_porta; - UINT8 m_term_data; + uint8_t m_porta; + uint8_t m_term_data; public: DECLARE_DRIVER_INIT(llc2); DECLARE_DRIVER_INIT(llc1); @@ -55,8 +55,8 @@ public: DECLARE_MACHINE_START(llc1); DECLARE_MACHINE_RESET(llc1); DECLARE_MACHINE_RESET(llc2); - UINT32 screen_update_llc1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_llc2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_llc1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_llc2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; optional_device m_ram; }; diff --git a/src/mame/includes/lockon.h b/src/mame/includes/lockon.h index da9b182e13a..8bf5b5c3c6c 100644 --- a/src/mame/includes/lockon.h +++ b/src/mame/includes/lockon.h @@ -46,41 +46,41 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_char_ram; - required_shared_ptr m_hud_ram; - required_shared_ptr m_scene_ram; - required_shared_ptr m_ground_ram; - required_shared_ptr m_object_ram; + required_shared_ptr m_char_ram; + required_shared_ptr m_hud_ram; + required_shared_ptr m_scene_ram; + required_shared_ptr m_ground_ram; + required_shared_ptr m_object_ram; /* video-related */ tilemap_t *m_tilemap; - UINT8 m_ground_ctrl; - UINT16 m_scroll_h; - UINT16 m_scroll_v; + uint8_t m_ground_ctrl; + uint16_t m_scroll_h; + uint16_t m_scroll_v; std::unique_ptr m_front_buffer; std::unique_ptr m_back_buffer; emu_timer *m_bufend_timer; emu_timer *m_cursor_timer; /* Rotation Control */ - UINT16 m_xsal; - UINT16 m_x0ll; - UINT16 m_dx0ll; - UINT16 m_dxll; - UINT16 m_ysal; - UINT16 m_y0ll; - UINT16 m_dy0ll; - UINT16 m_dyll; + uint16_t m_xsal; + uint16_t m_x0ll; + uint16_t m_dx0ll; + uint16_t m_dxll; + uint16_t m_ysal; + uint16_t m_y0ll; + uint16_t m_dy0ll; + uint16_t m_dyll; /* Object palette RAM control */ - UINT32 m_iden; - std::unique_ptr m_obj_pal_ram; - UINT32 m_obj_pal_latch; - UINT32 m_obj_pal_addr; + uint32_t m_iden; + std::unique_ptr m_obj_pal_ram; + uint32_t m_obj_pal_latch; + uint32_t m_obj_pal_addr; /* misc */ - UINT8 m_ctrl_reg; - UINT32 m_main_inten; + uint8_t m_ctrl_reg; + uint32_t m_main_inten; /* devices */ required_device m_maincpu; @@ -127,7 +127,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(lockon); - UINT32 screen_update_lockon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lockon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_lockon(screen_device &screen, bool state); TIMER_CALLBACK_MEMBER(cursor_callback); TIMER_CALLBACK_MEMBER(bufend_callback); diff --git a/src/mame/includes/lordgun.h b/src/mame/includes/lordgun.h index cd9f39f9a5a..f6223bfb467 100644 --- a/src/mame/includes/lordgun.h +++ b/src/mame/includes/lordgun.h @@ -12,7 +12,7 @@ struct lordgun_gun_data { int scr_x, scr_y; - UINT16 hw_x, hw_y; + uint16_t hw_x, hw_y; }; class lordgun_state : public driver_device @@ -47,23 +47,23 @@ public: required_device m_soundlatch; required_device m_soundlatch2; - required_shared_ptr m_generic_paletteram_16; - required_shared_ptr m_priority_ram; - required_shared_ptr m_scrollram; - required_shared_ptr m_spriteram; - required_shared_ptr_array m_vram; - required_shared_ptr_array m_scroll_x; - required_shared_ptr_array m_scroll_y; + required_shared_ptr m_generic_paletteram_16; + required_shared_ptr m_priority_ram; + required_shared_ptr m_scrollram; + required_shared_ptr m_spriteram; + required_shared_ptr_array m_vram; + required_shared_ptr_array m_scroll_x; + required_shared_ptr_array m_scroll_y; - UINT8 m_old; - UINT8 m_aliencha_dip_sel; - UINT16 m_priority; + uint8_t m_old; + uint8_t m_aliencha_dip_sel; + uint16_t m_priority; int m_whitescreen; lordgun_gun_data m_gun[2]; tilemap_t *m_tilemap[4]; std::unique_ptr m_bitmaps[5]; - UINT16 m_protection_data; + uint16_t m_protection_data; DECLARE_WRITE16_MEMBER(lordgun_protection_w); DECLARE_READ16_MEMBER(lordgun_protection_r); DECLARE_WRITE16_MEMBER(aliencha_protection_w); @@ -99,9 +99,9 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_lordgun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lordgun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); inline void get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_); - inline void lordgun_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _N_); + inline void lordgun_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask, int _N_); void lorddgun_calc_gun_scr(int i); void lordgun_update_gun(int i); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/lsasquad.h b/src/mame/includes/lsasquad.h index 6b18f73bcf4..f4b29428fc9 100644 --- a/src/mame/includes/lsasquad.h +++ b/src/mame/includes/lsasquad.h @@ -16,9 +16,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_scrollram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_scrollram; + required_shared_ptr m_spriteram; /* misc */ int m_sound_pending; @@ -28,16 +28,16 @@ public: int m_sound_result; /* mcu */ - UINT8 m_from_main; - UINT8 m_from_mcu; + uint8_t m_from_main; + uint8_t m_from_mcu; int m_mcu_sent; int m_main_sent; - 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_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; /* devices */ required_device m_maincpu; @@ -69,10 +69,10 @@ public: DECLARE_WRITE8_MEMBER(unk); DECLARE_MACHINE_START(lsasquad); DECLARE_MACHINE_RESET(lsasquad); - UINT32 screen_update_lsasquad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_daikaiju(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lsasquad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_daikaiju(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(nmi_callback); - void draw_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *scrollram ); + void draw_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *scrollram ); int draw_layer_daikaiju( bitmap_ind16 &bitmap, const rectangle &cliprect, int offs, int * previd, int type ); void drawbg( bitmap_ind16 &bitmap, const rectangle &cliprect, int type ); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/lucky74.h b/src/mame/includes/lucky74.h index 64f2e25322e..daa22f46bba 100644 --- a/src/mame/includes/lucky74.h +++ b/src/mame/includes/lucky74.h @@ -15,18 +15,18 @@ public: m_msm(*this, "msm"), m_gfxdecode(*this, "gfxdecode") { } - UINT8 m_ym2149_portb; - UINT8 m_usart_8251; - UINT8 m_copro_sm7831; + uint8_t m_ym2149_portb; + uint8_t m_usart_8251; + uint8_t m_copro_sm7831; int m_adpcm_pos; int m_adpcm_end; int m_adpcm_data; - UINT8 m_adpcm_reg[6]; - UINT8 m_adpcm_busy_line; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_fg_colorram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_bg_colorram; + uint8_t m_adpcm_reg[6]; + uint8_t m_adpcm_busy_line; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_fg_colorram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_bg_colorram; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; DECLARE_READ8_MEMBER(custom_09R81P_port_r); @@ -48,7 +48,7 @@ public: virtual void machine_reset() override; virtual void sound_start() override; DECLARE_PALETTE_INIT(lucky74); - UINT32 screen_update_lucky74(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lucky74(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(nmi_interrupt); DECLARE_WRITE_LINE_MEMBER(lucky74_adpcm_int); required_device m_maincpu; diff --git a/src/mame/includes/lvcards.h b/src/mame/includes/lvcards.h index 851559d18bb..418e6376923 100644 --- a/src/mame/includes/lvcards.h +++ b/src/mame/includes/lvcards.h @@ -10,11 +10,11 @@ public: m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode") { } - UINT8 m_payout; - UINT8 m_pulse; - UINT8 m_result; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + uint8_t m_payout; + uint8_t m_pulse; + uint8_t m_result; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(control_port_2_w); DECLARE_WRITE8_MEMBER(control_port_2a_w); @@ -27,7 +27,7 @@ public: DECLARE_MACHINE_START(lvpoker); DECLARE_MACHINE_RESET(lvpoker); DECLARE_PALETTE_INIT(ponttehk); - UINT32 screen_update_lvcards(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lvcards(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; diff --git a/src/mame/includes/lviv.h b/src/mame/includes/lviv.h index 728fc1d4236..d0df88e47e5 100644 --- a/src/mame/includes/lviv.h +++ b/src/mame/includes/lviv.h @@ -28,14 +28,14 @@ public: unsigned char * m_video_ram; unsigned short m_colortable[1][4]; - UINT8 m_ppi_port_outputs[2][3]; - UINT8 m_startup_mem_map; + uint8_t m_ppi_port_outputs[2][3]; + uint8_t m_startup_mem_map; DECLARE_READ8_MEMBER(lviv_io_r); DECLARE_WRITE8_MEMBER(lviv_io_w); virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(lviv); - UINT32 screen_update_lviv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lviv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(lviv_ppi_0_porta_r); DECLARE_READ8_MEMBER(lviv_ppi_0_portb_r); DECLARE_READ8_MEMBER(lviv_ppi_0_portc_r); @@ -53,11 +53,11 @@ public: required_device m_cassette; required_device m_ram; required_device m_palette; - void lviv_update_palette(UINT8 pal); + void lviv_update_palette(uint8_t pal); void lviv_update_memory (); - void lviv_setup_snapshot (UINT8 * data); + void lviv_setup_snapshot (uint8_t * data); void dump_registers(); - image_verify_result lviv_verify_snapshot(UINT8 * data, UINT32 size); + image_verify_result lviv_verify_snapshot(uint8_t * data, uint32_t size); DECLARE_SNAPSHOT_LOAD_MEMBER( lviv ); DECLARE_INPUT_CHANGED_MEMBER(lviv_reset); }; diff --git a/src/mame/includes/lwings.h b/src/mame/includes/lwings.h index 4455c7ccc61..e416eef4ad5 100644 --- a/src/mame/includes/lwings.h +++ b/src/mame/includes/lwings.h @@ -23,26 +23,26 @@ public: /* memory pointers */ required_device m_spriteram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bg1videoram; - optional_shared_ptr m_soundlatch2; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bg1videoram; + optional_shared_ptr m_soundlatch2; /* video-related */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg1_tilemap; tilemap_t *m_bg2_tilemap; - UINT8 m_bg2_image; + uint8_t m_bg2_image; int m_bg2_avenger_hw; int m_spr_avenger_hw; - UINT8 m_scroll_x[2]; - UINT8 m_scroll_y[2]; + uint8_t m_scroll_x[2]; + uint8_t m_scroll_y[2]; /* misc */ - UINT8 m_param[4]; + uint8_t m_param[4]; int m_palette_pen; - UINT8 m_soundstate; - UINT8 m_adpcm; - UINT8 m_nmi_mask; + uint8_t m_soundstate; + uint8_t m_adpcm; + uint8_t m_nmi_mask; int m_sprbank; DECLARE_WRITE8_MEMBER(avengers_adpcm_w); @@ -73,11 +73,11 @@ public: DECLARE_VIDEO_START(trojan); DECLARE_VIDEO_START(avengers); DECLARE_VIDEO_START(avengersb); - UINT32 screen_update_lwings(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_trojan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lwings(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_trojan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(lwings_interrupt); INTERRUPT_GEN_MEMBER(avengers_interrupt); - inline int is_sprite_on( UINT8 *buffered_spriteram, int offs ); + inline int is_sprite_on( uint8_t *buffered_spriteram, int offs ); void lwings_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void trojan_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); int avengers_fetch_paldata( ); diff --git a/src/mame/includes/lynx.h b/src/mame/includes/lynx.h index 890f9d0b1f2..e03c0cf0f35 100644 --- a/src/mame/includes/lynx.h +++ b/src/mame/includes/lynx.h @@ -21,33 +21,33 @@ struct BLITTER { // global - UINT16 screen; - UINT16 colbuf; - UINT16 colpos; // byte where value of collision is written - INT16 xoff, yoff; + uint16_t screen; + uint16_t colbuf; + uint16_t colpos; // byte where value of collision is written + int16_t xoff, yoff; // in command int mode; - UINT8 spr_coll; - UINT8 spritenr; - INT16 x_pos,y_pos; - UINT16 width, height; // uint16 important for blue lightning - INT16 tilt_accumulator; - UINT16 height_accumulator, width_accumulator; - UINT16 width_offset, height_offset; - INT16 stretch, tilt; - UINT8 color[16]; // or stored - UINT16 bitmap; + uint8_t spr_coll; + uint8_t spritenr; + int16_t x_pos,y_pos; + uint16_t width, height; // uint16 important for blue lightning + int16_t tilt_accumulator; + uint16_t height_accumulator, width_accumulator; + uint16_t width_offset, height_offset; + int16_t stretch, tilt; + uint8_t color[16]; // or stored + uint16_t bitmap; int use_rle; int line_color; - UINT8 spr_ctl0; - UINT8 spr_ctl1; - UINT16 scb; - UINT16 scb_next; - UINT8 sprite_collide; + uint8_t spr_ctl0; + uint8_t spr_ctl1; + uint16_t scb; + uint16_t scb_next; + uint8_t sprite_collide; int everon; - UINT8 fred; + uint8_t fred; int memory_accesses; attotime time; @@ -59,8 +59,8 @@ struct BLITTER struct UART { - UINT8 serctl; - UINT8 data_received, data_to_send, buffer; + uint8_t serctl; + uint8_t data_received, data_to_send, buffer; int received; int sending; int buffer_loaded; @@ -68,8 +68,8 @@ struct UART struct SUZY { - UINT8 data[0x100]; - UINT8 high; + uint8_t data[0x100]; + uint8_t high; int low; int signed_math; int accumulate; @@ -78,17 +78,17 @@ struct SUZY struct MIKEY { - UINT8 data[0x100]; - UINT16 disp_addr; - UINT8 vb_rest; + uint8_t data[0x100]; + uint16_t disp_addr; + uint8_t vb_rest; }; struct LYNX_TIMER { - UINT8 bakup; - UINT8 cntrl1; - UINT8 cntrl2; - UINT8 counter; + uint8_t bakup; + uint8_t cntrl1; + uint8_t cntrl2; + uint8_t counter; emu_timer *timer; int timer_active; }; @@ -120,23 +120,23 @@ public: virtual void video_start() override; - 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); - required_shared_ptr m_mem_0000; - required_shared_ptr m_mem_fc00; - required_shared_ptr m_mem_fd00; - required_shared_ptr m_mem_fe00; - required_shared_ptr m_mem_fffa; + required_shared_ptr m_mem_0000; + required_shared_ptr m_mem_fc00; + required_shared_ptr m_mem_fd00; + required_shared_ptr m_mem_fe00; + required_shared_ptr m_mem_fffa; required_device m_maincpu; required_device m_sound; required_device m_cart; required_device m_palette; - UINT16 m_granularity; + uint16_t m_granularity; int m_sign_AB; int m_sign_CD; - UINT32 m_lynx_palette[0x10]; + uint32_t m_lynx_palette[0x10]; int m_rotate; - UINT8 m_memory_config; + uint8_t m_memory_config; BLITTER m_blitter; SUZY m_suzy; @@ -156,8 +156,8 @@ public: DECLARE_WRITE8_MEMBER(lynx_memory_config_w); void lynx_divide(); void lynx_multiply(); - UINT8 lynx_timer_read(int which, int offset); - void lynx_timer_write(int which, int offset, UINT8 data); + uint8_t lynx_timer_read(int which, int offset); + void lynx_timer_write(int which, int offset, uint8_t data); virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(lynx); @@ -168,18 +168,18 @@ public: TIMER_CALLBACK_MEMBER(lynx_uart_timer); void lynx_postload(); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( lynx_cart ); - UINT8 lynx_read_ram(UINT16 address); - void lynx_write_ram(UINT16 address, UINT8 data); - inline void lynx_plot_pixel(const int mode, const INT16 x, const int y, const int color); + uint8_t lynx_read_ram(uint16_t address); + void lynx_write_ram(uint16_t address, uint8_t data); + inline void lynx_plot_pixel(const int mode, const int16_t x, const int y, const int color); void lynx_blit_do_work(const int y, const int xdir, const int bits_per_pixel, const int mask ); - void lynx_blit_rle_do_work( const INT16 y, const int xdir, const int bits_per_pixel, const int mask ); + void lynx_blit_rle_do_work( const int16_t y, const int xdir, const int bits_per_pixel, const int mask ); void lynx_blit_lines(); void lynx_blitter(); void lynx_draw_line(); void lynx_timer_init(int which); void lynx_timer_signal_irq(int which); void lynx_timer_count_down(int which); - UINT32 lynx_time_factor(int val); + uint32_t lynx_time_factor(int val); void lynx_uart_reset(); image_verify_result lynx_verify_cart(char *header, int kind); DECLARE_QUICKLOAD_LOAD_MEMBER( lynx ); diff --git a/src/mame/includes/m10.h b/src/mame/includes/m10.h index 7f9ff1a4557..68947e65a22 100644 --- a/src/mame/includes/m10.h +++ b/src/mame/includes/m10.h @@ -55,22 +55,22 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_memory; - required_shared_ptr m_rom; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_chargen; + required_shared_ptr m_memory; + required_shared_ptr m_rom; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_chargen; /* video-related */ tilemap_t * m_tx_tilemap; gfx_element * m_back_gfx; /* this is currently unused, because it is needed by gfx_layout (which has no machine) */ - UINT32 extyoffs[32 * 8]; + uint32_t extyoffs[32 * 8]; /* video state */ - UINT8 m_bottomline; - UINT8 m_flip; + uint8_t m_bottomline; + uint8_t m_flip; /* misc */ int m_last; @@ -105,8 +105,8 @@ public: DECLARE_VIDEO_START(m10); DECLARE_PALETTE_INIT(m10); DECLARE_VIDEO_START(m15); - UINT32 screen_update_m10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_m15(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m15(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(m15_interrupt); TIMER_CALLBACK_MEMBER(interrupt_callback); DECLARE_WRITE8_MEMBER(ic8j1_output_changed); diff --git a/src/mame/includes/m107.h b/src/mame/includes/m107.h index 0749d8c56cc..300122bc7c1 100644 --- a/src/mame/includes/m107.h +++ b/src/mame/includes/m107.h @@ -12,7 +12,7 @@ struct pf_layer_info { tilemap_t * tmap; - UINT16 vram_base; + uint16_t vram_base; }; class m107_state : public driver_device @@ -41,19 +41,19 @@ public: required_device m_upd71059c; required_device m_soundlatch; - required_shared_ptr m_spriteram; - required_shared_ptr m_vram_data; - optional_region_ptr m_user1_ptr; + required_shared_ptr m_spriteram; + required_shared_ptr m_vram_data; + optional_region_ptr m_user1_ptr; // driver init - UINT8 m_spritesystem; + uint8_t m_spritesystem; int m_sound_status; - UINT8 m_sprite_display; - UINT16 m_raster_irq_position; + uint8_t m_sprite_display; + uint16_t m_raster_irq_position; pf_layer_info m_pf_layer[4]; - UINT16 m_control[0x10]; - std::unique_ptr m_buffered_spriteram; + uint16_t m_control[0x10]; + std::unique_ptr m_buffered_spriteram; DECLARE_WRITE16_MEMBER(coincounter_w); DECLARE_WRITE16_MEMBER(bankswitch_w); @@ -78,7 +78,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void update_scroll_positions(); void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int laynum, int category,int opaque); diff --git a/src/mame/includes/m5.h b/src/mame/includes/m5.h index 16e346889e3..d4671e14211 100644 --- a/src/mame/includes/m5.h +++ b/src/mame/includes/m5.h @@ -93,14 +93,14 @@ public: DECLARE_WRITE8_MEMBER( mem64KBI_w ); DECLARE_WRITE8_MEMBER( mem64KBF_w ); DECLARE_WRITE8_MEMBER( mem64KRX_w ); - UINT8 m_ram_mode; - UINT8 m_ram_type; + uint8_t m_ram_mode; + uint8_t m_ram_type; memory_region *m_cart_rom; m5_cart_slot_device *m_cart_ram, *m_cart; // floppy state for fd5 - UINT8 m_fd5_data; - UINT8 m_fd5_com; + uint8_t m_fd5_data; + uint8_t m_fd5_com; int m_intra; int m_ibfa; int m_obfa; @@ -153,13 +153,13 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT8 m_rambank; // bank # - UINT8 m_ramcpu; //where Ramdisk bank is mapped + uint8_t m_rambank; // bank # + uint8_t m_ramcpu; //where Ramdisk bank is mapped bool m_romen; bool m_ramen; - UINT8 m_rammap[16]; // memory map + uint8_t m_rammap[16]; // memory map }; #endif diff --git a/src/mame/includes/m52.h b/src/mame/includes/m52.h index d1efe7dc698..40fdc64441e 100644 --- a/src/mame/includes/m52.h +++ b/src/mame/includes/m52.h @@ -14,17 +14,17 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - optional_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + optional_shared_ptr m_spriteram; /* video-related */ tilemap_t* m_bg_tilemap; - UINT8 m_bg1xpos; - UINT8 m_bg1ypos; - UINT8 m_bg2xpos; - UINT8 m_bg2ypos; - UINT8 m_bgcontrol; + uint8_t m_bg1xpos; + uint8_t m_bg1ypos; + uint8_t m_bg2xpos; + uint8_t m_bg2ypos; + uint8_t m_bgcontrol; DECLARE_WRITE8_MEMBER(m52_scroll_w); DECLARE_WRITE8_MEMBER(m52_videoram_w); DECLARE_WRITE8_MEMBER(m52_colorram_w); @@ -40,7 +40,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(m52); - UINT32 screen_update_m52(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m52(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect, int xpos, int ypos, int image); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/m57.h b/src/mame/includes/m57.h index c54442ee974..c240ca158d1 100644 --- a/src/mame/includes/m57.h +++ b/src/mame/includes/m57.h @@ -13,9 +13,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_scrollram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_scrollram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t* m_bg_tilemap; @@ -25,7 +25,7 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(m57); - UINT32 screen_update_m57(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m57(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; diff --git a/src/mame/includes/m58.h b/src/mame/includes/m58.h index 26af9956764..9ee93e40a6d 100644 --- a/src/mame/includes/m58.h +++ b/src/mame/includes/m58.h @@ -31,12 +31,12 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll_x_low; - required_shared_ptr m_scroll_x_high; - required_shared_ptr m_scroll_y_low; - required_shared_ptr m_score_panel_disabled; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll_x_low; + required_shared_ptr m_scroll_x_high; + required_shared_ptr m_scroll_y_low; + required_shared_ptr m_score_panel_disabled; /* video-related */ tilemap_t* m_bg_tilemap; @@ -52,7 +52,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); TILEMAP_MAPPER_MEMBER(tilemap_scan_rows); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_panel( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/m62.h b/src/mame/includes/m62.h index 40d09120cab..019ba4a4416 100644 --- a/src/mame/includes/m62.h +++ b/src/mame/includes/m62.h @@ -19,24 +19,24 @@ public: { } /* memory pointers */ - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; - required_shared_ptr m_m62_tileram; - optional_shared_ptr m_m62_textram; - optional_shared_ptr m_scrollram; + required_shared_ptr m_m62_tileram; + optional_shared_ptr m_m62_textram; + optional_shared_ptr m_scrollram; /* video-related */ tilemap_t* m_bg_tilemap; tilemap_t* m_fg_tilemap; int m_flipscreen; - const UINT8 *m_sprite_height_prom; - INT32 m_m62_background_hscroll; - INT32 m_m62_background_vscroll; - UINT8 m_kidniki_background_bank; - INT32 m_kidniki_text_vscroll; + const uint8_t *m_sprite_height_prom; + int32_t m_m62_background_hscroll; + int32_t m_m62_background_vscroll; + uint8_t m_kidniki_background_bank; + int32_t m_kidniki_text_vscroll; int m_ldrun3_topbottom_mask; - INT32 m_spelunkr_palbank; + int32_t m_spelunkr_palbank; /* misc */ int m_ldrun2_bankswap; //ldrun2 @@ -105,18 +105,18 @@ public: DECLARE_PALETTE_INIT(spelunk2); DECLARE_VIDEO_START(youjyudn); DECLARE_VIDEO_START(horizon); - UINT32 screen_update_ldrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kungfum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_battroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ldrun3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ldrun4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_lotlot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kidniki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spelunkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spelunk2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_youjyudn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_horizon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void m62_amplify_contrast(palette_t *palette, UINT32 numcolors); + uint32_t screen_update_ldrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kungfum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_battroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ldrun3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ldrun4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lotlot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kidniki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spelunkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spelunk2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_youjyudn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_horizon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void m62_amplify_contrast(palette_t *palette, uint32_t numcolors); void register_savestate( ); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int colormask, int prioritymask, int priority ); void m62_start( tilemap_get_info_delegate tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 ); diff --git a/src/mame/includes/m72.h b/src/mame/includes/m72.h index ef37ee67ac8..7743a15c0ab 100644 --- a/src/mame/includes/m72.h +++ b/src/mame/includes/m72.h @@ -59,30 +59,30 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; - optional_shared_ptr m_m82_rowscrollram; - optional_shared_ptr m_spriteram2; - optional_shared_ptr m_soundram; - required_shared_ptr m_generic_paletteram_16; - required_shared_ptr m_generic_paletteram2_16; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram1; + required_shared_ptr m_videoram2; + optional_shared_ptr m_m82_rowscrollram; + optional_shared_ptr m_spriteram2; + optional_shared_ptr m_soundram; + required_shared_ptr m_generic_paletteram_16; + required_shared_ptr m_generic_paletteram2_16; optional_device m_upd71059c; - std::unique_ptr m_protection_ram; + std::unique_ptr m_protection_ram; emu_timer *m_scanline_timer; - const UINT8 *m_protection_code; - const UINT8 *m_protection_crc; - UINT32 m_raster_irq_position; - std::unique_ptr m_buffered_spriteram; + const uint8_t *m_protection_code; + const uint8_t *m_protection_crc; + uint32_t m_raster_irq_position; + std::unique_ptr m_buffered_spriteram; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; tilemap_t *m_bg_tilemap_large; - INT32 m_scrollx1; - INT32 m_scrolly1; - INT32 m_scrollx2; - INT32 m_scrolly2; - INT32 m_video_off; + int32_t m_scrollx1; + int32_t m_scrolly1; + int32_t m_scrollx2; + int32_t m_scrolly2; + int32_t m_video_off; int m_fg_source; int m_bg_source; @@ -94,12 +94,12 @@ public: // majtitle specific int m_m82_rowscroll; - UINT16 m_m82_tmcontrol; + uint16_t m_m82_tmcontrol; // m72_i8751 specific - UINT8 m_mcu_snd_cmd_latch; - UINT8 m_mcu_sample_latch; - UINT32 m_mcu_sample_addr; + uint8_t m_mcu_snd_cmd_latch; + uint8_t m_mcu_sample_latch; + uint32_t m_mcu_sample_addr; // common DECLARE_READ16_MEMBER(palette1_r); @@ -185,15 +185,15 @@ public: TIMER_CALLBACK_MEMBER(delayed_ram16_w); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_m81(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_m82(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - inline void m72_m81_get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum); - inline void m82_m84_get_tile_info(tile_data &tileinfo,int tile_index,const UINT16 *vram,int gfxnum); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m81(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m82(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + inline void m72_m81_get_tile_info(tile_data &tileinfo,int tile_index,const uint16_t *vram,int gfxnum); + inline void m82_m84_get_tile_info(tile_data &tileinfo,int tile_index,const uint16_t *vram,int gfxnum); void register_savestate(); inline void changecolor(int color,int r,int g,int b); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void majtitle_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); - void copy_le(UINT16 *dest, const UINT8 *src, UINT8 bytes); - void install_protection_handler(const UINT8 *code,const UINT8 *crc); + void copy_le(uint16_t *dest, const uint8_t *src, uint8_t bytes); + void install_protection_handler(const uint8_t *code,const uint8_t *crc); }; diff --git a/src/mame/includes/m79amb.h b/src/mame/includes/m79amb.h index 22574023cf5..7b179fb1514 100644 --- a/src/mame/includes/m79amb.h +++ b/src/mame/includes/m79amb.h @@ -13,20 +13,20 @@ public: m_maincpu(*this, "maincpu") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_mask; + required_shared_ptr m_videoram; + required_shared_ptr m_mask; required_device m_discrete; /* misc */ - UINT8 m_lut_gun1[0x100]; - UINT8 m_lut_gun2[0x100]; + uint8_t m_lut_gun1[0x100]; + uint8_t m_lut_gun2[0x100]; DECLARE_WRITE8_MEMBER(ramtek_videoram_w); DECLARE_READ8_MEMBER(gray5bit_controller0_r); DECLARE_READ8_MEMBER(gray5bit_controller1_r); DECLARE_WRITE8_MEMBER(m79amb_8002_w); DECLARE_DRIVER_INIT(m79amb); - UINT32 screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(m79amb_interrupt); DECLARE_WRITE8_MEMBER(m79amb_8000_w); DECLARE_WRITE8_MEMBER(m79amb_8003_w); diff --git a/src/mame/includes/m90.h b/src/mame/includes/m90.h index b91715030db..35706a30e25 100644 --- a/src/mame/includes/m90.h +++ b/src/mame/includes/m90.h @@ -16,8 +16,8 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_video_data; - optional_shared_ptr m_spriteram; + required_shared_ptr m_video_data; + optional_shared_ptr m_spriteram; required_device m_maincpu; required_device m_soundcpu; @@ -26,13 +26,13 @@ public: required_device m_palette; required_device m_soundlatch; - UINT16 m_video_control_data[8]; + uint16_t m_video_control_data[8]; tilemap_t *m_pf1_layer; tilemap_t *m_pf2_layer; tilemap_t *m_pf1_wide_layer; tilemap_t *m_pf2_wide_layer; - UINT8 m_last_pf1; - UINT8 m_last_pf2; + uint8_t m_last_pf1; + uint8_t m_last_pf2; DECLARE_WRITE16_MEMBER(m90_coincounter_w); DECLARE_WRITE16_MEMBER(quizf1_bankswitch_w); DECLARE_WRITE16_MEMBER(dynablsb_sound_command_w); @@ -56,9 +56,9 @@ public: virtual void video_start() override; DECLARE_VIDEO_START(bomblord); DECLARE_VIDEO_START(dynablsb); - UINT32 screen_update_m90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bomblord(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dynablsb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bomblord(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dynablsb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(fake_nmi); INTERRUPT_GEN_MEMBER(bomblord_fake_nmi); INTERRUPT_GEN_MEMBER(m90_interrupt); diff --git a/src/mame/includes/m92.h b/src/mame/includes/m92.h index 14ace95757f..e2a07831ccd 100644 --- a/src/mame/includes/m92.h +++ b/src/mame/includes/m92.h @@ -15,8 +15,8 @@ struct M92_pf_layer_info { tilemap_t * tmap; tilemap_t * wide_tmap; - UINT16 vram_base; - UINT16 control[4]; + uint16_t vram_base; + uint16_t control[4]; }; class m92_state : public driver_device @@ -43,8 +43,8 @@ public: { } required_device m_spriteram; - required_shared_ptr m_vram_data; - required_shared_ptr m_spritecontrol; + required_shared_ptr m_vram_data; + required_shared_ptr m_spritecontrol; required_device m_maincpu; optional_device m_soundcpu; optional_device m_oki; @@ -54,16 +54,16 @@ public: required_device m_upd71059c; optional_device m_soundlatch; - UINT16 m_sound_status; - UINT32 m_raster_irq_position; - UINT16 m_videocontrol; - UINT8 m_sprite_buffer_busy; - UINT8 m_game_kludge; + uint16_t m_sound_status; + uint32_t m_raster_irq_position; + uint16_t m_videocontrol; + uint8_t m_sprite_buffer_busy; + uint8_t m_game_kludge; M92_pf_layer_info m_pf_layer[3]; - UINT16 m_pf_master_control[4]; - INT32 m_sprite_list; - UINT8 m_palette_bank; - std::vector m_paletteram; + uint16_t m_pf_master_control[4]; + int32_t m_sprite_list; + uint8_t m_palette_bank; + std::vector m_paletteram; DECLARE_READ16_MEMBER(m92_eeprom_r); DECLARE_WRITE16_MEMBER(m92_eeprom_w); @@ -96,8 +96,8 @@ public: DECLARE_MACHINE_RESET(m92); DECLARE_VIDEO_START(m92); DECLARE_VIDEO_START(ppan); - UINT32 screen_update_m92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ppan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_m92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ppan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(m92_scanline_interrupt); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void ppan_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/mac.h b/src/mame/includes/mac.h index 4d727427d2e..4ea560a6c10 100644 --- a/src/mame/includes/mac.h +++ b/src/mame/includes/mac.h @@ -206,13 +206,13 @@ public: model_t m_model; - UINT32 m_overlay; + uint32_t m_overlay; int m_drive_select; int m_scsiirq_enable; - UINT32 m_via2_vbl; - UINT32 m_se30_vbl_enable; - UINT8 m_nubus_irq_state; + uint32_t m_via2_vbl; + uint32_t m_se30_vbl_enable; + uint8_t m_nubus_irq_state; emu_timer *m_overlay_timeout; TIMER_CALLBACK_MEMBER(overlay_timeout_func); @@ -254,40 +254,40 @@ public: int irq_count, ca1_data, ca2_data; // Mac ADB state - INT32 m_adb_irq_pending, m_adb_waiting_cmd, m_adb_datasize, m_adb_buffer[257]; - INT32 m_adb_state, m_adb_command, m_adb_send, m_adb_timer_ticks, m_adb_extclock, m_adb_direction; - INT32 m_adb_listenreg, m_adb_listenaddr, m_adb_last_talk, m_adb_srq_switch; - INT32 m_adb_streaming, m_adb_stream_ptr; - INT32 m_adb_linestate; + int32_t m_adb_irq_pending, m_adb_waiting_cmd, m_adb_datasize, m_adb_buffer[257]; + int32_t m_adb_state, m_adb_command, m_adb_send, m_adb_timer_ticks, m_adb_extclock, m_adb_direction; + int32_t m_adb_listenreg, m_adb_listenaddr, m_adb_last_talk, m_adb_srq_switch; + int32_t m_adb_streaming, m_adb_stream_ptr; + int32_t m_adb_linestate; bool m_adb_srqflag; #define kADBKeyBufSize 32 - UINT8 m_adb_keybuf[kADBKeyBufSize]; - UINT8 m_adb_keybuf_start; - UINT8 m_adb_keybuf_end; + uint8_t m_adb_keybuf[kADBKeyBufSize]; + uint8_t m_adb_keybuf_start; + uint8_t m_adb_keybuf_end; // Portable/PB100 Power Manager IC comms (chapter 4, "Guide to the Macintosh Family Hardware", second edition) - UINT8 m_pm_data_send, m_pm_data_recv, m_pm_ack, m_pm_req, m_pm_cmd[32], m_pm_out[32], m_pm_dptr, m_pm_sptr, m_pm_slen, m_pm_state; - UINT8 m_pmu_int_status, m_pmu_last_adb_command, m_pmu_poll; + uint8_t m_pm_data_send, m_pm_data_recv, m_pm_ack, m_pm_req, m_pm_cmd[32], m_pm_out[32], m_pm_dptr, m_pm_sptr, m_pm_slen, m_pm_state; + uint8_t m_pmu_int_status, m_pmu_last_adb_command, m_pmu_poll; emu_timer *m_pmu_send_timer; // 60.15 Hz timer for RBV/V8/Sonora/Eagle/VASP/etc. emu_timer *m_6015_timer; // RBV and friends (V8, etc) - UINT8 m_rbv_regs[256], m_rbv_ier, m_rbv_ifr, m_rbv_type, m_rbv_montype, m_rbv_vbltime; - UINT32 m_rbv_colors[3], m_rbv_count, m_rbv_clutoffs, m_rbv_immed10wr; - UINT32 m_rbv_palette[256]; - UINT8 m_sonora_vctl[8]; + uint8_t m_rbv_regs[256], m_rbv_ier, m_rbv_ifr, m_rbv_type, m_rbv_montype, m_rbv_vbltime; + uint32_t m_rbv_colors[3], m_rbv_count, m_rbv_clutoffs, m_rbv_immed10wr; + uint32_t m_rbv_palette[256]; + uint8_t m_sonora_vctl[8]; emu_timer *m_vbl_timer, *m_cursor_timer; - UINT16 m_cursor_line; - UINT16 m_dafb_int_status; + uint16_t m_cursor_line; + uint16_t m_dafb_int_status; int m_dafb_scsi1_drq, m_dafb_scsi2_drq; - UINT8 m_dafb_mode; - UINT32 m_dafb_base, m_dafb_stride; + uint8_t m_dafb_mode; + uint32_t m_dafb_base, m_dafb_stride; // this is shared among all video setups with vram - optional_shared_ptr m_vram; - optional_shared_ptr m_vram16; + optional_shared_ptr m_vram; + optional_shared_ptr m_vram16; // interrupts int m_scc_interrupt, m_via_interrupt, m_via2_interrupt, m_scsi_interrupt, m_asc_interrupt, m_last_taken_interrupt; @@ -296,7 +296,7 @@ public: void v8_resize(); void set_memory_overlay(int overlay); void scc_mouse_irq( int x, int y ); - void nubus_slot_interrupt(UINT8 slot, UINT32 state); + void nubus_slot_interrupt(uint8_t slot, uint32_t state); DECLARE_WRITE_LINE_MEMBER(set_scc_interrupt); void set_via_interrupt(int value); void set_via2_interrupt(int value); @@ -391,9 +391,9 @@ private: void adb_vblank(); int adb_pollkbd(int update); int adb_pollmouse(); - void adb_accummouse( UINT8 *MouseX, UINT8 *MouseY ); - void pmu_one_byte_reply(UINT8 result); - void pmu_three_byte_reply(UINT8 result1, UINT8 result2, UINT8 result3); + void adb_accummouse( uint8_t *MouseX, uint8_t *MouseY ); + void pmu_one_byte_reply(uint8_t result); + void pmu_three_byte_reply(uint8_t result1, uint8_t result2, uint8_t result3); // wait states for accessing the VIA int m_via_cycles; @@ -407,15 +407,15 @@ private: int m_adb_keybinitialized, m_adb_currentkeys[2], m_adb_modifiers; // PRAM for ADB MCU HLEs (mostly unused now) - UINT8 m_adb_pram[256]; + uint8_t m_adb_pram[256]; - UINT8 m_oss_regs[0x400]; + uint8_t m_oss_regs[0x400]; // AMIC for x100 PowerMacs - UINT8 m_amic_regs[0x200]; + uint8_t m_amic_regs[0x200]; // HMC for x100 PowerMacs - UINT64 m_hmc_reg, m_hmc_shiftout; + uint64_t m_hmc_reg, m_hmc_shiftout; int m_via2_ca1_hack; optional_device m_screen; @@ -467,17 +467,17 @@ public: DECLARE_VIDEO_RESET(macsonora); DECLARE_VIDEO_RESET(maceagle); DECLARE_VIDEO_START(macrbv); - UINT32 screen_update_mac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macprtb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macse30(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macpb140(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macpb160(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macrbv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macdafb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macrbvvram(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macv8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macsonora(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macpbwd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macprtb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macse30(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macpb140(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macpb160(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macrbv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macdafb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macrbvvram(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macv8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macsonora(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macpbwd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mac_rbv_vbl); #ifndef MAC_USE_EMULATED_KBD TIMER_CALLBACK_MEMBER(kbd_clock); @@ -524,7 +524,7 @@ public: void mac_driver_init(model_t model); void mac_install_memory(offs_t memory_begin, offs_t memory_end, offs_t memory_size, void *memory_data, int is_rom, const char *bank); - offs_t mac_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); + offs_t mac_dasm_override(device_t &device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options); }; #endif /* MAC_H_ */ diff --git a/src/mame/includes/macpci.h b/src/mame/includes/macpci.h index 5494942a6d2..52ecba8773a 100644 --- a/src/mame/includes/macpci.h +++ b/src/mame/includes/macpci.h @@ -104,19 +104,19 @@ public: emu_timer *m_6015_timer; // RBV and friends (V8, etc) - UINT8 m_rbv_regs[256], m_rbv_ier, m_rbv_ifr, m_rbv_type, m_rbv_montype, m_rbv_vbltime; - UINT32 m_rbv_colors[3], m_rbv_count, m_rbv_clutoffs, m_rbv_immed10wr; - UINT32 m_rbv_palette[256]; - UINT8 m_sonora_vctl[8]; + uint8_t m_rbv_regs[256], m_rbv_ier, m_rbv_ifr, m_rbv_type, m_rbv_montype, m_rbv_vbltime; + uint32_t m_rbv_colors[3], m_rbv_count, m_rbv_clutoffs, m_rbv_immed10wr; + uint32_t m_rbv_palette[256]; + uint8_t m_sonora_vctl[8]; emu_timer *m_vbl_timer, *m_cursor_timer; - UINT16 m_cursor_line; - UINT16 m_dafb_int_status; + uint16_t m_cursor_line; + uint16_t m_dafb_int_status; int m_dafb_scsi1_drq, m_dafb_scsi2_drq; - UINT8 m_dafb_mode; - UINT32 m_dafb_base, m_dafb_stride; + uint8_t m_dafb_mode; + uint32_t m_dafb_base, m_dafb_stride; // this is shared among all video setups with vram - UINT32 *m_vram; + uint32_t *m_vram; DECLARE_READ16_MEMBER ( mac_via_r ); DECLARE_WRITE16_MEMBER ( mac_via_w ); @@ -145,11 +145,11 @@ private: int m_via_cycles; // hack - UINT16 m_unk1_test; + uint16_t m_unk1_test; public: emu_timer *m_scanline_timer; - UINT32 screen_update_pippin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pippin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(mac_6015_tick); DECLARE_READ8_MEMBER(mac_via_in_a); DECLARE_READ8_MEMBER(mac_via_in_b); diff --git a/src/mame/includes/macrossp.h b/src/mame/includes/macrossp.h index 09f651b2555..e2979d5210e 100644 --- a/src/mame/includes/macrossp.h +++ b/src/mame/includes/macrossp.h @@ -42,22 +42,22 @@ public: } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_scra_videoram; - required_shared_ptr m_scra_linezoom; - required_shared_ptr m_scra_videoregs; - required_shared_ptr m_scrb_videoram; - required_shared_ptr m_scrb_linezoom; - required_shared_ptr m_scrb_videoregs; - required_shared_ptr m_scrc_videoram; - required_shared_ptr m_scrc_linezoom; - required_shared_ptr m_scrc_videoregs; - required_shared_ptr m_text_videoram; - required_shared_ptr m_text_linezoom; - required_shared_ptr m_text_videoregs; - required_shared_ptr m_mainram; - std::unique_ptr m_spriteram_old; - std::unique_ptr m_spriteram_old2; + required_shared_ptr m_spriteram; + required_shared_ptr m_scra_videoram; + required_shared_ptr m_scra_linezoom; + required_shared_ptr m_scra_videoregs; + required_shared_ptr m_scrb_videoram; + required_shared_ptr m_scrb_linezoom; + required_shared_ptr m_scrb_videoregs; + required_shared_ptr m_scrc_videoram; + required_shared_ptr m_scrc_linezoom; + required_shared_ptr m_scrc_videoregs; + required_shared_ptr m_text_videoram; + required_shared_ptr m_text_linezoom; + required_shared_ptr m_text_videoregs; + required_shared_ptr m_mainram; + std::unique_ptr m_spriteram_old; + std::unique_ptr m_spriteram_old2; /* video-related */ tilemap_t *m_scra_tilemap; @@ -95,7 +95,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_macrossp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macrossp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_macrossp(screen_device &screen, bool state); void draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int layer, int linem, int pri); diff --git a/src/mame/includes/madalien.h b/src/mame/includes/madalien.h index 7be1ee11a81..c0527dc1db2 100644 --- a/src/mame/includes/madalien.h +++ b/src/mame/includes/madalien.h @@ -38,16 +38,16 @@ public: m_soundlatch(*this, "soundlatch"), m_soundlatch2(*this, "soundlatch2") { } - required_shared_ptr m_videoram; - required_shared_ptr m_charram; - required_shared_ptr m_video_control; - required_shared_ptr m_shift_hi; - required_shared_ptr m_shift_lo; - required_shared_ptr m_video_flags; - required_shared_ptr m_headlight_pos; - required_shared_ptr m_edge1_pos; - required_shared_ptr m_edge2_pos; - required_shared_ptr m_scroll; + required_shared_ptr m_videoram; + required_shared_ptr m_charram; + required_shared_ptr m_video_control; + required_shared_ptr m_shift_hi; + required_shared_ptr m_shift_lo; + required_shared_ptr m_video_flags; + required_shared_ptr m_headlight_pos; + required_shared_ptr m_edge1_pos; + required_shared_ptr m_edge2_pos; + required_shared_ptr m_scroll; tilemap_t *m_tilemap_fg; tilemap_t *m_tilemap_edge1[4]; @@ -72,12 +72,12 @@ public: TILE_GET_INFO_MEMBER(get_tile_info_FG); DECLARE_VIDEO_START(madalien); DECLARE_PALETTE_INIT(madalien); - UINT32 screen_update_madalien(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_madalien(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); inline int scan_helper(int col, int row, int section); void draw_edges(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flip, int scroll_mode); void draw_headlight(bitmap_ind16 &bitmap, const rectangle &cliprect, int flip); void draw_foreground(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flip); - inline UINT8 shift_common(UINT8 hi, UINT8 lo); + inline uint8_t shift_common(uint8_t hi, uint8_t lo); required_device m_maincpu; required_device m_audiocpu; required_device m_discrete; diff --git a/src/mame/includes/madmotor.h b/src/mame/includes/madmotor.h index 27089ace10b..35d39eed85e 100644 --- a/src/mame/includes/madmotor.h +++ b/src/mame/includes/madmotor.h @@ -25,7 +25,7 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; /* video-related */ int m_flipscreen; @@ -44,5 +44,5 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_madmotor(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_madmotor(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/magmax.h b/src/mame/includes/magmax.h index 36199b3c49c..fbc69168ace 100644 --- a/src/mame/includes/magmax.h +++ b/src/mame/includes/magmax.h @@ -16,19 +16,19 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_vreg; - required_shared_ptr m_scroll_x; - required_shared_ptr m_scroll_y; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_vreg; + required_shared_ptr m_scroll_x; + required_shared_ptr m_scroll_y; - UINT8 m_sound_latch; - UINT8 m_LS74_clr; - UINT8 m_LS74_q; - UINT8 m_gain_control; + uint8_t m_sound_latch; + uint8_t m_LS74_clr; + uint8_t m_LS74_q; + uint8_t m_gain_control; emu_timer *m_interrupt_timer; int m_flipscreen; - std::unique_ptr m_prom_tab; + std::unique_ptr m_prom_tab; bitmap_ind16 m_bitmap; DECLARE_WRITE16_MEMBER(magmax_sound_w); DECLARE_READ8_MEMBER(magmax_sound_irq_ack); @@ -40,7 +40,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(magmax); - UINT32 screen_update_magmax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_magmax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(scanline_callback); required_device m_maincpu; required_device m_audiocpu; diff --git a/src/mame/includes/mainevt.h b/src/mame/includes/mainevt.h index 32973d75bc7..7d14bd88333 100644 --- a/src/mame/includes/mainevt.h +++ b/src/mame/includes/mainevt.h @@ -27,7 +27,7 @@ public: /* misc */ int m_nmi_enable; - UINT8 m_sound_irq_mask; + uint8_t m_sound_irq_mask; /* devices */ required_device m_maincpu; @@ -52,8 +52,8 @@ public: DECLARE_WRITE8_MEMBER(dv_sh_bankswitch_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_mainevt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mainevt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mainevt_interrupt); INTERRUPT_GEN_MEMBER(dv_interrupt); INTERRUPT_GEN_MEMBER(mainevt_sound_timer_irq); diff --git a/src/mame/includes/mainsnk.h b/src/mame/includes/mainsnk.h index e6f183aef31..760115aba78 100644 --- a/src/mame/includes/mainsnk.h +++ b/src/mame/includes/mainsnk.h @@ -23,14 +23,14 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_bgram; - required_shared_ptr m_spriteram; - required_shared_ptr m_fgram; + required_shared_ptr m_bgram; + required_shared_ptr m_spriteram; + required_shared_ptr m_fgram; tilemap_t *m_tx_tilemap; tilemap_t *m_bg_tilemap; int m_sound_cpu_busy; - UINT32 m_bg_tile_offset; + uint32_t m_bg_tile_offset; DECLARE_WRITE8_MEMBER(sound_command_w); DECLARE_READ8_MEMBER(sound_ack_r); @@ -48,6 +48,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(mainsnk); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int scrollx, int scrolly ); }; diff --git a/src/mame/includes/malzak.h b/src/mame/includes/malzak.h index 00f4e3a2afb..2b3f2574865 100644 --- a/src/mame/includes/malzak.h +++ b/src/mame/includes/malzak.h @@ -27,7 +27,7 @@ public: required_device m_s2636_0; required_device m_s2636_1; required_device m_trom; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; @@ -53,5 +53,5 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(malzak); - UINT32 screen_update_malzak(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_malzak(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/mappy.h b/src/mame/includes/mappy.h index 15229332d96..ea1b92f7f1d 100644 --- a/src/mame/includes/mappy.h +++ b/src/mame/includes/mappy.h @@ -43,8 +43,8 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; required_device m_maincpu; required_device m_subcpu; @@ -67,14 +67,14 @@ public: tilemap_t *m_bg_tilemap; bitmap_ind16 m_sprite_bitmap; - UINT8 m_scroll; + uint8_t m_scroll; int m_mux; - UINT8 m_main_irq_mask; - UINT8 m_sub_irq_mask; - UINT8 m_sub2_irq_mask; + uint8_t m_main_irq_mask; + uint8_t m_sub_irq_mask; + uint8_t m_sub2_irq_mask; - void common_latch_w(UINT32 offset); + void common_latch_w(uint32_t offset); DECLARE_WRITE8_MEMBER(superpac_latch_w); DECLARE_WRITE8_MEMBER(phozon_latch_w); DECLARE_WRITE8_MEMBER(mappy_latch_w); @@ -104,9 +104,9 @@ public: DECLARE_MACHINE_RESET(mappy); DECLARE_VIDEO_START(mappy); DECLARE_PALETTE_INIT(mappy); - UINT32 screen_update_superpac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_phozon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mappy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_superpac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_phozon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mappy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(superpac_main_vblank_irq); INTERRUPT_GEN_MEMBER(pacnpal_main_vblank_irq); INTERRUPT_GEN_MEMBER(grobda_main_vblank_irq); @@ -131,8 +131,8 @@ public: DECLARE_DRIVER_INIT(druaga); DECLARE_DRIVER_INIT(digdug2); DECLARE_DRIVER_INIT(motos); - void mappy_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram_base); - void phozon_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram_base); + void mappy_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram_base); + void phozon_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram_base); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/marineb.h b/src/mame/includes/marineb.h index c96b4b91165..60324a8ec75 100644 --- a/src/mame/includes/marineb.h +++ b/src/mame/includes/marineb.h @@ -13,18 +13,18 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_palette_bank; - UINT8 m_column_scroll; - UINT8 m_flipscreen_x; - UINT8 m_flipscreen_y; - UINT8 m_marineb_active_low_flipscreen; + uint8_t m_palette_bank; + uint8_t m_column_scroll; + uint8_t m_flipscreen_x; + uint8_t m_flipscreen_y; + uint8_t m_marineb_active_low_flipscreen; /* devices */ required_device m_maincpu; @@ -32,7 +32,7 @@ public: required_device m_gfxdecode; required_device m_palette; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(irq_mask_w); DECLARE_WRITE8_MEMBER(marineb_videoram_w); DECLARE_WRITE8_MEMBER(marineb_colorram_w); @@ -47,11 +47,11 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(marineb); DECLARE_MACHINE_RESET(springer); - UINT32 screen_update_marineb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_changes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_springer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hoccer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hopprobo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_marineb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_changes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_springer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hoccer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hopprobo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(marineb_vblank_irq); INTERRUPT_GEN_MEMBER(wanted_vblank_irq); void set_tilemap_scrolly( int cols ); diff --git a/src/mame/includes/mario.h b/src/mame/includes/mario.h index df80da3d07d..2c9563e335e 100644 --- a/src/mame/includes/mario.h +++ b/src/mame/includes/mario.h @@ -87,23 +87,23 @@ public: #endif /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; /* sound state */ - UINT8 m_last; - UINT8 m_portT; + uint8_t m_last; + uint8_t m_portT; const char *m_eabank; /* video state */ - UINT8 m_gfx_bank; - UINT8 m_palette_bank; - UINT16 m_gfx_scroll; - UINT8 m_flip; + uint8_t m_gfx_bank; + uint8_t m_palette_bank; + uint16_t m_gfx_scroll; + uint8_t m_flip; tilemap_t *m_bg_tilemap; int m_monitor; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(nmi_mask_w); DECLARE_WRITE8_MEMBER(mario_videoram_w); DECLARE_WRITE8_MEMBER(mario_gfxbank_w); @@ -127,9 +127,9 @@ public: virtual void sound_start() override; virtual void sound_reset() override; DECLARE_PALETTE_INIT(mario); - UINT32 screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mario(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mariobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mario(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mariobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); DECLARE_WRITE8_MEMBER(mario_sh_sound_w); DECLARE_WRITE8_MEMBER(mario_sh1_w); diff --git a/src/mame/includes/markham.h b/src/mame/includes/markham.h index c64bfadd5da..fafe43d1f84 100644 --- a/src/mame/includes/markham.h +++ b/src/mame/includes/markham.h @@ -19,9 +19,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_xscroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_xscroll; /* video-related */ tilemap_t *m_bg_tilemap; @@ -31,7 +31,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(markham); - UINT32 screen_update_markham(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_markham(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/matmania.h b/src/mame/includes/matmania.h index f5d8c419b36..9ddecb93e1d 100644 --- a/src/mame/includes/matmania.h +++ b/src/mame/includes/matmania.h @@ -28,16 +28,16 @@ public: { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_videoram3; - required_shared_ptr m_colorram; - required_shared_ptr m_colorram2; - required_shared_ptr m_colorram3; - required_shared_ptr m_scroll; - required_shared_ptr m_pageselect; - required_shared_ptr m_spriteram; - required_shared_ptr m_paletteram; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_videoram3; + required_shared_ptr m_colorram; + required_shared_ptr m_colorram2; + required_shared_ptr m_colorram3; + required_shared_ptr m_scroll; + required_shared_ptr m_pageselect; + required_shared_ptr m_spriteram; + required_shared_ptr m_paletteram; /* devices */ required_device m_maincpu; @@ -53,17 +53,17 @@ public: std::unique_ptr m_tmpbitmap2; /* maniach 68705 protection */ - 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; @@ -87,6 +87,6 @@ public: DECLARE_PALETTE_INIT(matmania); DECLARE_MACHINE_START(maniach); DECLARE_MACHINE_RESET(maniach); - UINT32 screen_update_matmania(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_maniach(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_matmania(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_maniach(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/maygay1b.h b/src/mame/includes/maygay1b.h index 3f17990e5d2..bc5c31ef129 100644 --- a/src/mame/includes/maygay1b.h +++ b/src/mame/includes/maygay1b.h @@ -72,9 +72,9 @@ public: required_device m_reel4; required_device m_reel5; required_device m_meters; - optional_region_ptr m_oki_region; + optional_region_ptr m_oki_region; - UINT8 m_lamppos; + uint8_t m_lamppos; int m_lamp_strobe; int m_old_lamp_strobe; int m_lamp_strobe2; @@ -87,7 +87,7 @@ public: int m_NMIENABLE; int m_meter; TIMER_DEVICE_CALLBACK_MEMBER( maygay1b_nmitimer_callback ); - UINT8 m_Lamps[256]; + uint8_t m_Lamps[256]; int m_optic_pattern; DECLARE_WRITE_LINE_MEMBER(reel0_optic_cb) { if (state) m_optic_pattern |= 0x01; else m_optic_pattern &= ~0x01; } DECLARE_WRITE_LINE_MEMBER(reel1_optic_cb) { if (state) m_optic_pattern |= 0x02; else m_optic_pattern &= ~0x02; } @@ -131,7 +131,7 @@ public: DECLARE_WRITE8_MEMBER(main_to_mcu_0_w); DECLARE_WRITE8_MEMBER(main_to_mcu_1_w); - UINT8 m_main_to_mcu; + uint8_t m_main_to_mcu; DECLARE_DRIVER_INIT(m1); DECLARE_DRIVER_INIT(m1common); diff --git a/src/mame/includes/mbc55x.h b/src/mame/includes/mbc55x.h index 298c5236590..3948c7be120 100644 --- a/src/mame/includes/mbc55x.h +++ b/src/mame/includes/mbc55x.h @@ -79,10 +79,10 @@ struct keyboard_t { - UINT8 keyrows[MBC55X_KEYROWS]; + uint8_t keyrows[MBC55X_KEYROWS]; emu_timer *keyscan_timer; - UINT8 key_special; + uint8_t key_special; }; @@ -148,10 +148,10 @@ public: DECLARE_WRITE_LINE_MEMBER(vid_vsync_changed); DECLARE_WRITE_LINE_MEMBER(pit8253_t2); - UINT32 m_debug_machine; - UINT32 m_debug_video; - UINT8 m_video_mem[VIDEO_MEM_SIZE]; - UINT8 m_vram_page; + uint32_t m_debug_machine; + uint32_t m_debug_video; + uint8_t m_video_mem[VIDEO_MEM_SIZE]; + uint8_t m_vram_page; keyboard_t m_keyboard; DECLARE_READ8_MEMBER(mbcpic8259_r); diff --git a/src/mame/includes/mbee.h b/src/mame/includes/mbee.h index f92ee66477b..f23093fccca 100644 --- a/src/mame/includes/mbee.h +++ b/src/mame/includes/mbee.h @@ -105,7 +105,7 @@ public: DECLARE_MACHINE_RESET(mbee128); DECLARE_MACHINE_RESET(mbee256); DECLARE_MACHINE_RESET(mbeett); - UINT32 screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(timer_newkb); DECLARE_QUICKLOAD_LOAD_MEMBER(mbee); DECLARE_QUICKLOAD_LOAD_MEMBER(mbee_z80bin); @@ -117,33 +117,33 @@ public: required_device m_palette; private: - UINT8 *m_p_videoram; - UINT8 *m_p_gfxram; - UINT8 *m_p_colorram; - UINT8 *m_p_attribram; + uint8_t *m_p_videoram; + uint8_t *m_p_gfxram; + uint8_t *m_p_colorram; + uint8_t *m_p_attribram; bool m_is_premium; bool m_has_oldkb; size_t m_size; bool m_b7_rtc; bool m_b7_vs; bool m_b2; - UINT8 m_framecnt; - UINT8 m_08; - UINT8 m_0a; - UINT8 m_0b; - UINT8 m_1c; - UINT8 m_sy6545_cursor[16]; - UINT8 m_mbee256_was_pressed[15]; - UINT8 m_mbee256_q[20]; - UINT8 m_mbee256_q_pos; - UINT8 m_sy6545_reg[32]; - UINT8 m_sy6545_ind; - UINT8 m_fdc_rq; - UINT8 m_bank_array[33]; - void setup_banks(UINT8 data, bool first_time, UINT8 b_mask); + uint8_t m_framecnt; + uint8_t m_08; + uint8_t m_0a; + uint8_t m_0b; + uint8_t m_1c; + uint8_t m_sy6545_cursor[16]; + uint8_t m_mbee256_was_pressed[15]; + uint8_t m_mbee256_q[20]; + uint8_t m_mbee256_q_pos; + uint8_t m_sy6545_reg[32]; + uint8_t m_sy6545_ind; + uint8_t m_fdc_rq; + uint8_t m_bank_array[33]; + void setup_banks(uint8_t data, bool first_time, uint8_t b_mask); void sy6545_cursor_configure(); - void oldkb_scan(UINT16 param); - void oldkb_matrix_r(UINT16 offs); + void oldkb_scan(uint16_t param); + void oldkb_matrix_r(uint16_t offs); void machine_reset_common(); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; required_device m_maincpu; diff --git a/src/mame/includes/mc1502.h b/src/mame/includes/mc1502.h index 28b38aca85e..a177cd0f0e9 100644 --- a/src/mame/includes/mc1502.h +++ b/src/mame/includes/mc1502.h @@ -56,14 +56,14 @@ public: TIMER_CALLBACK_MEMBER(keyb_signal_callback); struct { - UINT8 pulsing; - UINT16 mask; /* input lines */ + uint8_t pulsing; + uint16_t mask; /* input lines */ emu_timer *keyb_signal_timer; } m_kbd; - UINT8 m_ppi_portb; - UINT8 m_ppi_portc; - UINT8 m_spkrdata; + uint8_t m_ppi_portb; + uint8_t m_ppi_portc; + uint8_t m_spkrdata; DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out1_changed); DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out2_changed); diff --git a/src/mame/includes/mc80.h b/src/mame/includes/mc80.h index 74699a2327c..2ce4e7fef6b 100644 --- a/src/mame/includes/mc80.h +++ b/src/mame/includes/mc80.h @@ -40,13 +40,13 @@ public: DECLARE_READ8_MEMBER(asp_port_b_r); DECLARE_WRITE8_MEMBER(asp_port_a_w); DECLARE_WRITE8_MEMBER(asp_port_b_w); - optional_shared_ptr m_p_videoram; + optional_shared_ptr m_p_videoram; DECLARE_MACHINE_RESET(mc8020); DECLARE_VIDEO_START(mc8020); DECLARE_MACHINE_RESET(mc8030); DECLARE_VIDEO_START(mc8030); - UINT32 screen_update_mc8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mc8030(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mc8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mc8030(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(mc8020_kbd); DECLARE_WRITE_LINE_MEMBER(ctc_z2_w); IRQ_CALLBACK_MEMBER(mc8020_irq_callback); diff --git a/src/mame/includes/mcatadv.h b/src/mame/includes/mcatadv.h index cda3058f832..5c779e02ed0 100644 --- a/src/mame/includes/mcatadv.h +++ b/src/mame/includes/mcatadv.h @@ -23,14 +23,14 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; - required_shared_ptr m_scroll1; - required_shared_ptr m_scroll2; - required_shared_ptr m_spriteram; - std::unique_ptr m_spriteram_old; - required_shared_ptr m_vidregs; - std::unique_ptr m_vidregs_old; + required_shared_ptr m_videoram1; + required_shared_ptr m_videoram2; + required_shared_ptr m_scroll1; + required_shared_ptr m_scroll2; + required_shared_ptr m_spriteram; + std::unique_ptr m_spriteram_old; + required_shared_ptr m_vidregs; + std::unique_ptr m_vidregs_old; /* video-related */ tilemap_t *m_tilemap1; @@ -55,8 +55,8 @@ public: TILE_GET_INFO_MEMBER(get_mcatadv_tile_info2); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_mcatadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mcatadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_mcatadv(screen_device &screen, bool state); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); - void mcatadv_draw_tilemap_part( screen_device &screen, UINT16* current_scroll, UINT16* current_videoram1, int i, tilemap_t* current_tilemap, bitmap_ind16 &bitmap, const rectangle &cliprect ); + void mcatadv_draw_tilemap_part( screen_device &screen, uint16_t* current_scroll, uint16_t* current_videoram1, int i, tilemap_t* current_tilemap, bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/mcr.h b/src/mame/includes/mcr.h index 46a6f7be17c..7ceb376c492 100644 --- a/src/mame/includes/mcr.h +++ b/src/mame/includes/mcr.h @@ -46,9 +46,9 @@ public: required_device m_maincpu; optional_device m_ipu; required_device m_watchdog; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_videoram; - optional_shared_ptr m_paletteram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_videoram; + optional_shared_ptr m_paletteram; optional_device m_sio; optional_device m_ssio; @@ -119,7 +119,7 @@ public: DECLARE_MACHINE_RESET(mcr); DECLARE_VIDEO_START(mcr); DECLARE_MACHINE_START(nflfoot); - UINT32 screen_update_mcr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mcr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(ipu_watchdog_reset); TIMER_DEVICE_CALLBACK_MEMBER(dpoker_hopper_callback); TIMER_DEVICE_CALLBACK_MEMBER(dpoker_coin_in_callback); @@ -138,15 +138,15 @@ public: extern const z80_daisy_config mcr_daisy_chain[]; extern const z80_daisy_config mcr_ipu_daisy_chain[]; -extern UINT8 mcr_cocktail_flip; +extern uint8_t mcr_cocktail_flip; extern const gfx_layout mcr_bg_layout; extern const gfx_layout mcr_sprite_layout; -extern UINT32 mcr_cpu_board; -extern UINT32 mcr_sprite_board; +extern uint32_t mcr_cpu_board; +extern uint32_t mcr_sprite_board; /*----------- defined in video/mcr.c -----------*/ -extern INT8 mcr12_sprite_xoffs; -extern INT8 mcr12_sprite_xoffs_flip; +extern int8_t mcr12_sprite_xoffs; +extern int8_t mcr12_sprite_xoffs_flip; diff --git a/src/mame/includes/mcr3.h b/src/mame/includes/mcr3.h index 18e2b688d09..c9b52a81b8f 100644 --- a/src/mame/includes/mcr3.h +++ b/src/mame/includes/mcr3.h @@ -15,21 +15,21 @@ public: m_screen(*this, "screen") { } - optional_shared_ptr m_spyhunt_alpharam; + optional_shared_ptr m_spyhunt_alpharam; required_device m_screen; - UINT8 m_input_mux; - UINT8 m_latched_input; - UINT8 m_last_op4; - UINT8 m_maxrpm_adc_control; - UINT8 m_maxrpm_adc_select; - UINT8 m_maxrpm_last_shift; - INT8 m_maxrpm_p1_shift; - INT8 m_maxrpm_p2_shift; - UINT8 m_spyhunt_sprite_color_mask; - INT16 m_spyhunt_scroll_offset; - INT16 m_spyhunt_scrollx; - INT16 m_spyhunt_scrolly; + uint8_t m_input_mux; + uint8_t m_latched_input; + uint8_t m_last_op4; + uint8_t m_maxrpm_adc_control; + uint8_t m_maxrpm_adc_select; + uint8_t m_maxrpm_last_shift; + int8_t m_maxrpm_p1_shift; + int8_t m_maxrpm_p2_shift; + uint8_t m_spyhunt_sprite_color_mask; + int16_t m_spyhunt_scroll_offset; + int16_t m_spyhunt_scrollx; + int16_t m_spyhunt_scrolly; tilemap_t *m_bg_tilemap; tilemap_t *m_alpha_tilemap; @@ -74,8 +74,8 @@ public: DECLARE_VIDEO_START(mcrmono); DECLARE_VIDEO_START(spyhunt); DECLARE_PALETTE_INIT(spyhunt); - UINT32 screen_update_mcr3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spyhunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mcr3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spyhunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void mcr3_update_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int color_mask, int code_xor, int dx, int dy, int interlaced); void mcr_common_init(); diff --git a/src/mame/includes/mcr68.h b/src/mame/includes/mcr68.h index 3d2714c63e1..a290a81ccdf 100644 --- a/src/mame/includes/mcr68.h +++ b/src/mame/includes/mcr68.h @@ -13,11 +13,11 @@ struct counter_state { - UINT8 control; - UINT16 latch; - UINT16 count; + uint8_t control; + uint16_t latch; + uint16_t count; emu_timer * timer; - UINT8 timer_active; + uint8_t timer_active; attotime period; }; @@ -44,24 +44,24 @@ public: optional_device m_turbo_chip_squeak; optional_device m_cvsd_sound; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - UINT16 m_control_word; - UINT8 m_protection_data[5]; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + uint16_t m_control_word; + uint8_t m_protection_data[5]; attotime m_timing_factor; - UINT8 m_sprite_clip; - INT8 m_sprite_xoffset; - UINT8 m_m6840_status; - UINT8 m_m6840_status_read_since_int; - UINT8 m_m6840_msb_buffer; - UINT8 m_m6840_lsb_buffer; - UINT8 m_m6840_irq_state; - UINT8 m_m6840_irq_vector; + uint8_t m_sprite_clip; + int8_t m_sprite_xoffset; + uint8_t m_m6840_status; + uint8_t m_m6840_status_read_since_int; + uint8_t m_m6840_msb_buffer; + uint8_t m_m6840_lsb_buffer; + uint8_t m_m6840_irq_state; + uint8_t m_m6840_irq_vector; struct counter_state m_m6840_state[3]; - UINT8 m_v493_irq_state; - UINT8 m_v493_irq_vector; + uint8_t m_v493_irq_state; + uint8_t m_v493_irq_vector; timer_expired_delegate m_v493_callback; - UINT8 m_zwackery_sound_data; + uint8_t m_zwackery_sound_data; attotime m_m6840_counter_periods[3]; attotime m_m6840_internal_counter_period; tilemap_t *m_bg_tilemap; @@ -86,7 +86,7 @@ public: DECLARE_WRITE8_MEMBER(mcr68_6840_w_common); DECLARE_READ16_MEMBER(mcr68_6840_r_common); void reload_count(int counter); - UINT16 compute_counter(int counter); + uint16_t compute_counter(int counter); DECLARE_WRITE16_MEMBER(mcr68_videoram_w); DECLARE_WRITE16_MEMBER(zwackery_videoram_w); DECLARE_WRITE16_MEMBER(zwackery_spriteram_w); @@ -110,8 +110,8 @@ public: DECLARE_MACHINE_START(mcr68); DECLARE_MACHINE_RESET(mcr68); DECLARE_VIDEO_START(mcr68); - UINT32 screen_update_zwackery(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mcr68(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_zwackery(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mcr68(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mcr68_interrupt); TIMER_CALLBACK_MEMBER(mcr68_493_off_callback); TIMER_CALLBACK_MEMBER(mcr68_493_callback); @@ -136,6 +136,6 @@ public: required_device m_gfxdecode; required_device m_screen; required_device m_palette; - std::unique_ptr m_srcdata0; - std::unique_ptr m_srcdata2; + std::unique_ptr m_srcdata0; + std::unique_ptr m_srcdata2; }; diff --git a/src/mame/includes/meadows.h b/src/mame/includes/meadows.h index c84b262c230..2425ac89a36 100644 --- a/src/mame/includes/meadows.h +++ b/src/mame/includes/meadows.h @@ -35,21 +35,21 @@ public: required_device m_screen; required_device m_palette; - optional_shared_ptr m_spriteram; - required_shared_ptr m_videoram; + optional_shared_ptr m_spriteram; + required_shared_ptr m_videoram; int m_channel; int m_freq1; int m_freq2; - UINT8 m_latched_0c01; - UINT8 m_latched_0c02; - UINT8 m_latched_0c03; - UINT8 m_main_sense_state; - UINT8 m_audio_sense_state; - UINT8 m_0c00; - UINT8 m_0c01; - UINT8 m_0c02; - UINT8 m_0c03; + uint8_t m_latched_0c01; + uint8_t m_latched_0c02; + uint8_t m_latched_0c03; + uint8_t m_main_sense_state; + uint8_t m_audio_sense_state; + uint8_t m_0c00; + uint8_t m_0c01; + uint8_t m_0c02; + uint8_t m_0c03; tilemap_t *m_bg_tilemap; DECLARE_READ8_MEMBER(hsync_chain_r); DECLARE_READ8_MEMBER(vsync_chain_hi_r); @@ -64,7 +64,7 @@ public: DECLARE_DRIVER_INIT(gypsyjug); TILE_GET_INFO_MEMBER(get_tile_info); virtual void video_start() override; - UINT32 screen_update_meadows(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_meadows(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(meadows_interrupt); INTERRUPT_GEN_MEMBER(minferno_interrupt); INTERRUPT_GEN_MEMBER(audio_interrupt); diff --git a/src/mame/includes/megadriv.h b/src/mame/includes/megadriv.h index e436c697476..4803db7fcb0 100644 --- a/src/mame/includes/megadriv.h +++ b/src/mame/includes/megadriv.h @@ -38,8 +38,8 @@ struct genesis_z80_vars { int z80_is_reset; int z80_has_bus; - UINT32 z80_bank_addr; - std::unique_ptr z80_prgram; + uint32_t z80_bank_addr; + std::unique_ptr z80_prgram; }; @@ -61,7 +61,7 @@ public: optional_device m_ymsnd; required_device m_vdp; required_device m_snsnd; - optional_shared_ptr m_megadrive_ram; + optional_shared_ptr m_megadrive_ram; optional_ioport m_io_reset; @@ -81,7 +81,7 @@ public: IRQ_CALLBACK_MEMBER(genesis_int_callback); void megadriv_init_common(); - void megadriv_z80_bank_w(UINT16 data); + void megadriv_z80_bank_w(uint16_t data); DECLARE_WRITE16_MEMBER( megadriv_68k_z80_bank_write ); DECLARE_WRITE8_MEMBER(megadriv_z80_z80_bank_w); DECLARE_READ16_MEMBER( megadriv_68k_io_read ); @@ -101,9 +101,9 @@ public: /* Megadrive / Genesis has 3 I/O ports */ emu_timer *m_io_timeout[3]; int m_io_stage[3]; - UINT8 m_megadrive_io_data_regs[3]; - UINT8 m_megadrive_io_ctrl_regs[3]; - UINT8 m_megadrive_io_tx_regs[3]; + uint8_t m_megadrive_io_data_regs[3]; + uint8_t m_megadrive_io_ctrl_regs[3]; + uint8_t m_megadrive_io_tx_regs[3]; read8_delegate m_megadrive_io_read_data_port_ptr; write16_delegate m_megadrive_io_write_data_port_ptr; @@ -115,24 +115,24 @@ public: void megadrive_reset_io(); DECLARE_READ8_MEMBER(megadrive_io_read_data_port_6button); DECLARE_READ8_MEMBER(megadrive_io_read_data_port_3button); - UINT8 megadrive_io_read_ctrl_port(int portnum); - UINT8 megadrive_io_read_tx_port(int portnum); - UINT8 megadrive_io_read_rx_port(int portnum); - UINT8 megadrive_io_read_sctrl_port(int portnum); + uint8_t megadrive_io_read_ctrl_port(int portnum); + uint8_t megadrive_io_read_tx_port(int portnum); + uint8_t megadrive_io_read_rx_port(int portnum); + uint8_t megadrive_io_read_sctrl_port(int portnum); DECLARE_WRITE16_MEMBER(megadrive_io_write_data_port_3button); DECLARE_WRITE16_MEMBER(megadrive_io_write_data_port_6button); - void megadrive_io_write_ctrl_port(int portnum, UINT16 data); - void megadrive_io_write_tx_port(int portnum, UINT16 data); - void megadrive_io_write_rx_port(int portnum, UINT16 data); - void megadrive_io_write_sctrl_port(int portnum, UINT16 data); + void megadrive_io_write_ctrl_port(int portnum, uint16_t data); + void megadrive_io_write_tx_port(int portnum, uint16_t data); + void megadrive_io_write_rx_port(int portnum, uint16_t data); + void megadrive_io_write_sctrl_port(int portnum, uint16_t data); void megadriv_stop_scanline_timer(); DECLARE_MACHINE_START( megadriv ); DECLARE_MACHINE_RESET( megadriv ); DECLARE_VIDEO_START( megadriv ); - UINT32 screen_update_megadriv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_megadriv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_megadriv(screen_device &screen, bool state); DECLARE_WRITE8_MEMBER(megadriv_tas_callback); @@ -156,7 +156,7 @@ public: optional_device m_32x; optional_device m_segacd; optional_device m_cart; - optional_region_ptr m_tmss; + optional_region_ptr m_tmss; DECLARE_DRIVER_INIT(mess_md_common); DECLARE_DRIVER_INIT(genesis); @@ -175,7 +175,7 @@ public: DECLARE_DEVICE_IMAGE_LOAD_MEMBER( _32x_cart ); - void _32x_scanline_callback(int x, UINT32 priority, UINT16 &lineptr); + void _32x_scanline_callback(int x, uint32_t priority, uint16_t &lineptr); void _32x_interrupt_callback(int scanline, int irq6); void _32x_scanline_helper_callback(int scanline); diff --git a/src/mame/includes/megasys1.h b/src/mame/includes/megasys1.h index bad057bb678..0e9b8d17dae 100644 --- a/src/mame/includes/megasys1.h +++ b/src/mame/includes/megasys1.h @@ -40,9 +40,9 @@ public: m_io_dsw2(*this, "DSW2") { } - required_shared_ptr m_objectram; + required_shared_ptr m_objectram; optional_device_array m_tmap; - required_shared_ptr m_ram; + required_shared_ptr m_ram; required_device m_maincpu; optional_device m_audiocpu; optional_device m_oki1; @@ -53,7 +53,7 @@ public: optional_device m_soundlatch; optional_device m_soundlatch2; optional_device m_soundlatch_z; - required_region_ptr m_rom_maincpu; + required_region_ptr m_rom_maincpu; required_ioport m_io_system; required_ioport m_io_p1; required_ioport m_io_p2; @@ -62,38 +62,38 @@ public: optional_ioport m_io_dsw2; // configuration - UINT16 m_ip_select_values[7]; // System B and C + uint16_t m_ip_select_values[7]; // System B and C int m_hardware_type_z; // System Z int m_layers_order[16]; - UINT8 m_ignore_oki_status; + uint8_t m_ignore_oki_status; // all bitmap_ind16 m_sprite_buffer_bitmap; - UINT16 m_screen_flag; - std::unique_ptr m_buffer_objectram; - std::unique_ptr m_buffer2_objectram; - std::unique_ptr m_buffer_spriteram16; - std::unique_ptr m_buffer2_spriteram16; + uint16_t m_screen_flag; + std::unique_ptr m_buffer_objectram; + std::unique_ptr m_buffer2_objectram; + std::unique_ptr m_buffer_spriteram16; + std::unique_ptr m_buffer2_spriteram16; // all but System Z - UINT16 m_active_layers; - UINT16 m_sprite_flag; + uint16_t m_active_layers; + uint16_t m_sprite_flag; // System B and C - UINT16 m_ip_latched; + uint16_t m_ip_latched; // System C - UINT16 m_sprite_bank; + uint16_t m_sprite_bank; // System A only int m_mcu_hs; - UINT16 m_mcu_hs_ram[0x10]; + uint16_t m_mcu_hs_ram[0x10]; // peekaboo - UINT16 m_protection_val; + uint16_t m_protection_val; // soldam - UINT16 *m_spriteram; + uint16_t *m_spriteram; DECLARE_WRITE_LINE_MEMBER(sound_irq); DECLARE_READ16_MEMBER(ip_select_r); @@ -155,7 +155,7 @@ public: DECLARE_PALETTE_INIT(megasys1); DECLARE_MACHINE_RESET(megasys1_hachoo); - 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); void screen_eof(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(megasys1D_irq); TIMER_DEVICE_CALLBACK_MEMBER(megasys1A_scanline); @@ -164,9 +164,9 @@ public: void priority_create(); void mix_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void partial_clear_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 param); + void partial_clear_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t param); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect); - inline void draw_16x16_priority_sprite(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, UINT8 mosaic, UINT8 mosaicsol, INT32 priority); + inline void draw_16x16_priority_sprite(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect, int32_t code, int32_t color, int32_t sx, int32_t sy, int32_t flipx, int32_t flipy, uint8_t mosaic, uint8_t mosaicsol, int32_t priority); void rodland_gfx_unmangle(const char *region); void jitsupro_gfx_unmangle(const char *region); void stdragona_gfx_unmangle(const char *region); diff --git a/src/mame/includes/megazone.h b/src/mame/includes/megazone.h index 3234ec35401..50e688340dd 100644 --- a/src/mame/includes/megazone.h +++ b/src/mame/includes/megazone.h @@ -25,13 +25,13 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_scrolly; - required_shared_ptr m_scrollx; - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram; - required_shared_ptr m_colorram2; - required_shared_ptr m_spriteram; + required_shared_ptr m_scrolly; + required_shared_ptr m_scrollx; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram; + required_shared_ptr m_colorram2; + required_shared_ptr m_spriteram; /* video-related */ std::unique_ptr m_tmpbitmap; @@ -47,7 +47,7 @@ public: required_device m_gfxdecode; required_device m_palette; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(megazone_i8039_irq_w); DECLARE_WRITE8_MEMBER(i8039_irqen_and_status_w); DECLARE_WRITE8_MEMBER(megazone_coin_counter_w); @@ -59,6 +59,6 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(megazone); - UINT32 screen_update_megazone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_megazone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); }; diff --git a/src/mame/includes/mermaid.h b/src/mame/includes/mermaid.h index bbe17d2e161..d0e56eb51e5 100644 --- a/src/mame/includes/mermaid.h +++ b/src/mame/includes/mermaid.h @@ -31,13 +31,13 @@ public: } /* memory pointers */ - required_shared_ptr m_videoram2; - required_shared_ptr m_videoram; - required_shared_ptr m_bg_scrollram; - required_shared_ptr m_fg_scrollram; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_ay8910_enable; + required_shared_ptr m_videoram2; + required_shared_ptr m_videoram; + required_shared_ptr m_bg_scrollram; + required_shared_ptr m_fg_scrollram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_ay8910_enable; /* video-related */ tilemap_t *m_bg_tilemap; @@ -53,13 +53,13 @@ public: int m_rougien_gfxbank2; /* sound-related */ - UINT32 m_adpcm_pos; - UINT32 m_adpcm_end; - UINT8 m_adpcm_idle; + uint32_t m_adpcm_pos; + uint32_t m_adpcm_end; + uint8_t m_adpcm_idle; int m_adpcm_data; - UINT8 m_adpcm_trigger; - UINT8 m_adpcm_rom_sel; - UINT8 m_adpcm_play_reg; + uint8_t m_adpcm_trigger; + uint8_t m_adpcm_rom_sel; + uint8_t m_adpcm_play_reg; /* devices */ required_device m_maincpu; @@ -70,7 +70,7 @@ public: required_device m_screen; required_device m_palette; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(mermaid_ay8910_write_port_w); DECLARE_WRITE8_MEMBER(mermaid_ay8910_control_port_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); @@ -94,10 +94,10 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(mermaid); DECLARE_PALETTE_INIT(rougien); - UINT32 screen_update_mermaid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mermaid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_mermaid(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - UINT8 collision_check( rectangle& rect ); + uint8_t collision_check( rectangle& rect ); DECLARE_WRITE_LINE_MEMBER(rougien_adpcm_int); }; diff --git a/src/mame/includes/metalmx.h b/src/mame/includes/metalmx.h index ee0514a329c..ecb536bd5fa 100644 --- a/src/mame/includes/metalmx.h +++ b/src/mame/includes/metalmx.h @@ -27,9 +27,9 @@ public: required_device m_dsp32c_2; required_device m_cage; - required_shared_ptr m_adsp_internal_program_ram; - required_shared_ptr m_gsp_dram; - required_shared_ptr m_gsp_vram; + required_shared_ptr m_adsp_internal_program_ram; + required_shared_ptr m_gsp_dram; + required_shared_ptr m_gsp_vram; DECLARE_READ32_MEMBER(unk_r); DECLARE_READ32_MEMBER(watchdog_r); @@ -53,5 +53,5 @@ public: DECLARE_WRITE8_MEMBER(cage_irq_callback); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_metalmx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_metalmx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/metlclsh.h b/src/mame/includes/metlclsh.h index b8783156faa..7acb8cf34c7 100644 --- a/src/mame/includes/metlclsh.h +++ b/src/mame/includes/metlclsh.h @@ -21,17 +21,17 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_fgram; - required_shared_ptr m_spriteram; - required_shared_ptr m_bgram; - required_shared_ptr m_scrollx; - std::unique_ptr m_otherram; + required_shared_ptr m_fgram; + required_shared_ptr m_spriteram; + required_shared_ptr m_bgram; + required_shared_ptr m_scrollx; + std::unique_ptr m_otherram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_write_mask; - UINT8 m_gfxbank; + uint8_t m_write_mask; + uint8_t m_gfxbank; /* devices */ required_device m_maincpu; @@ -56,6 +56,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_metlclsh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_metlclsh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h index 62d93568718..0cf865a564b 100644 --- a/src/mame/includes/metro.h +++ b/src/mame/includes/metro.h @@ -68,22 +68,22 @@ public: optional_device m_soundlatch; /* memory pointers */ - optional_shared_ptr m_vram_0; - optional_shared_ptr m_vram_1; - optional_shared_ptr m_vram_2; - required_shared_ptr m_spriteram; - optional_shared_ptr m_tiletable; - optional_shared_ptr m_blitter_regs; - optional_shared_ptr m_scroll; - optional_shared_ptr m_window; - optional_shared_ptr m_irq_enable; - optional_shared_ptr m_irq_levels; - optional_shared_ptr m_irq_vectors; - optional_shared_ptr m_rombank; - required_shared_ptr m_videoregs; - optional_shared_ptr m_screenctrl; - optional_shared_ptr m_input_sel; - optional_shared_ptr m_k053936_ram; + optional_shared_ptr m_vram_0; + optional_shared_ptr m_vram_1; + optional_shared_ptr m_vram_2; + required_shared_ptr m_spriteram; + optional_shared_ptr m_tiletable; + optional_shared_ptr m_blitter_regs; + optional_shared_ptr m_scroll; + optional_shared_ptr m_window; + optional_shared_ptr m_irq_enable; + optional_shared_ptr m_irq_levels; + optional_shared_ptr m_irq_vectors; + optional_shared_ptr m_rombank; + required_shared_ptr m_videoregs; + optional_shared_ptr m_screenctrl; + optional_shared_ptr m_input_sel; + optional_shared_ptr m_k053936_ram; int m_flip_screen; @@ -98,17 +98,17 @@ public: int m_sprite_yoffs; int m_sprite_xoffs_dx; - std::unique_ptr m_expanded_gfx1; + std::unique_ptr m_expanded_gfx1; /* irq_related */ int m_vblank_bit; int m_blitter_bit; int m_irq_line; - UINT8 m_requested_int[8]; + uint8_t m_requested_int[8]; emu_timer *m_mouja_irq_timer; /* sound related */ - UINT16 m_soundstatus; + uint16_t m_soundstatus; int m_porta; int m_portb; int m_busy_sndcpu; @@ -154,7 +154,7 @@ public: DECLARE_WRITE16_MEMBER(metro_vram_1_w); DECLARE_WRITE16_MEMBER(metro_vram_2_w); DECLARE_WRITE16_MEMBER(metro_window_w); - void blt_write( address_space &space, const int tmap, const offs_t offs, const UINT16 data, const UINT16 mask ); + void blt_write( address_space &space, const int tmap, const offs_t offs, const uint16_t data, const uint16_t mask ); DECLARE_CUSTOM_INPUT_MEMBER(custom_soundstatus_r); DECLARE_WRITE16_MEMBER(gakusai_oki_bank_hi_w); DECLARE_WRITE16_MEMBER(gakusai_oki_bank_lo_w); @@ -190,7 +190,7 @@ public: DECLARE_VIDEO_START(metro_i4300); DECLARE_VIDEO_START(blzntrnd); DECLARE_VIDEO_START(gstrik2); - UINT32 screen_update_metro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_metro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(metro_vblank_interrupt); INTERRUPT_GEN_MEMBER(metro_periodic_interrupt); INTERRUPT_GEN_MEMBER(karatour_interrupt); @@ -198,14 +198,14 @@ public: TIMER_CALLBACK_MEMBER(metro_blit_done); void update_irq_state(); IRQ_CALLBACK_MEMBER(metro_irq_callback); - inline UINT8 get_tile_pix( UINT16 code, UINT8 x, UINT8 y, int big, UINT16 *pix ); - inline void metro_vram_w( offs_t offset, UINT16 data, UINT16 mem_mask, int layer, UINT16 *vram ); + inline uint8_t get_tile_pix( uint16_t code, uint8_t x, uint8_t y, int big, uint16_t *pix ); + inline void metro_vram_w( offs_t offset, uint16_t data, uint16_t mem_mask, int layer, uint16_t *vram ); void metro_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_layers( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int layers_ctrl ); - inline int blt_read( const UINT8 *ROM, const int offs ); + inline int blt_read( const uint8_t *ROM, const int offs ); void metro_common( ); - void draw_tilemap( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 flags, UINT32 pcode, - int sx, int sy, int wx, int wy, int big, UINT16 *tilemapram, int layer ); + void draw_tilemap( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t flags, uint32_t pcode, + int sx, int sy, int wx, int wy, int big, uint16_t *tilemapram, int layer ); DECLARE_READ_LINE_MEMBER(metro_rxd_r); protected: diff --git a/src/mame/includes/mexico86.h b/src/mame/includes/mexico86.h index c9f14bda666..b1f31715935 100644 --- a/src/mame/includes/mexico86.h +++ b/src/mame/includes/mexico86.h @@ -21,28 +21,28 @@ public: } /* memory pointers */ - required_shared_ptr m_objectram; - required_shared_ptr m_protection_ram; - required_shared_ptr m_videoram; + required_shared_ptr m_objectram; + required_shared_ptr m_protection_ram; + required_shared_ptr m_videoram; /* video-related */ int m_charbank; /* mcu */ /* mexico86 68705 protection */ - 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_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; int m_address; int m_latch; /* kikikai mcu simulation */ int m_mcu_running; int m_mcu_initialised; bool m_coin_last[2]; - UINT8 m_coin_fract; + uint8_t m_coin_fract; /* devices */ required_device m_maincpu; @@ -54,7 +54,7 @@ public: required_device m_palette; /* queue */ - UINT8 m_queue[64]; + uint8_t m_queue[64]; int m_qfront; int m_qstate; DECLARE_WRITE8_MEMBER(mexico86_sub_output_w); @@ -69,8 +69,8 @@ public: DECLARE_READ8_MEMBER(kiki_ym2203_r); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_mexico86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kikikai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mexico86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kikikai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(kikikai_interrupt); INTERRUPT_GEN_MEMBER(mexico86_m68705_interrupt); void mcu_simulate( ); diff --git a/src/mame/includes/mhavoc.h b/src/mame/includes/mhavoc.h index 1758ebcd67b..711fbf746ff 100644 --- a/src/mame/includes/mhavoc.h +++ b/src/mame/includes/mhavoc.h @@ -27,22 +27,22 @@ public: m_alpha(*this, "alpha"), m_gamma(*this, "gamma"){ } - required_shared_ptr m_zram0; - required_shared_ptr m_zram1; + required_shared_ptr m_zram0; + required_shared_ptr m_zram1; required_device m_alpha; optional_device m_gamma; - UINT8 m_alpha_data; - UINT8 m_alpha_rcvd; - UINT8 m_alpha_xmtd; - UINT8 m_gamma_data; - UINT8 m_gamma_rcvd; - UINT8 m_gamma_xmtd; - UINT8 m_player_1; - UINT8 m_alpha_irq_clock; - UINT8 m_alpha_irq_clock_enable; - UINT8 m_gamma_irq_clock; - UINT8 m_has_gamma_cpu; - UINT8 m_speech_write_buffer; + uint8_t m_alpha_data; + uint8_t m_alpha_rcvd; + uint8_t m_alpha_xmtd; + uint8_t m_gamma_data; + uint8_t m_gamma_rcvd; + uint8_t m_gamma_xmtd; + uint8_t m_player_1; + uint8_t m_alpha_irq_clock; + uint8_t m_alpha_irq_clock_enable; + uint8_t m_gamma_irq_clock; + uint8_t m_has_gamma_cpu; + uint8_t m_speech_write_buffer; DECLARE_READ8_MEMBER(dual_pokey_r); DECLARE_WRITE8_MEMBER(dual_pokey_w); DECLARE_WRITE8_MEMBER(mhavoc_alpha_irq_ack_w); diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h index e6295b78ae0..37b7c942a1b 100644 --- a/src/mame/includes/micro3d.h +++ b/src/mame/includes/micro3d.h @@ -19,7 +19,7 @@ struct micro3d_vtx { - INT32 x, y, z; + int32_t x, y, z; }; enum planes @@ -88,57 +88,57 @@ public: optional_ioport m_joystick_y; optional_ioport m_throttle; - required_shared_ptr m_shared_ram; - UINT8 m_m68681_tx0; + required_shared_ptr m_shared_ram; + uint8_t m_m68681_tx0; /* Sound */ - UINT8 m_sound_port_latch[4]; - UINT8 m_dac_data; + uint8_t m_sound_port_latch[4]; + uint8_t m_dac_data; /* TI UART */ - UINT8 m_ti_uart[9]; + uint8_t m_ti_uart[9]; int m_ti_uart_mode_cycle; int m_ti_uart_sync_cycle; /* ADC */ - UINT8 m_adc_val; + uint8_t m_adc_val; /* Hardware version-check latch for BOTSS 1.1a */ - UINT8 m_botss_latch; + uint8_t m_botss_latch; /* MAC */ - required_shared_ptr m_mac_sram; - UINT32 m_sram_r_addr; - UINT32 m_sram_w_addr; - UINT32 m_vtx_addr; - UINT32 m_mrab11; - UINT32 m_mac_stat; - UINT32 m_mac_inst; + required_shared_ptr m_mac_sram; + uint32_t m_sram_r_addr; + uint32_t m_sram_w_addr; + uint32_t m_vtx_addr; + uint32_t m_mrab11; + uint32_t m_mac_stat; + uint32_t m_mac_inst; /* 2D video */ - required_shared_ptr m_sprite_vram; - UINT16 m_creg; - UINT16 m_xfer3dk; + required_shared_ptr m_sprite_vram; + uint16_t m_creg; + uint16_t m_xfer3dk; /* 3D pipeline */ - UINT32 m_pipe_data; - UINT32 m_pipeline_state; - INT32 m_vtx_fifo[512]; - UINT32 m_fifo_idx; - UINT32 m_draw_cmd; + uint32_t m_pipe_data; + uint32_t m_pipeline_state; + int32_t m_vtx_fifo[512]; + uint32_t m_fifo_idx; + uint32_t m_draw_cmd; int m_draw_state; - INT32 m_x_min; - INT32 m_x_max; - INT32 m_y_min; - INT32 m_y_max; - INT32 m_z_min; - INT32 m_z_max; - INT32 m_x_mid; - INT32 m_y_mid; + int32_t m_x_min; + int32_t m_x_max; + int32_t m_y_min; + int32_t m_y_max; + int32_t m_z_min; + int32_t m_z_max; + int32_t m_x_mid; + int32_t m_y_mid; int m_dpram_bank; - UINT32 m_draw_dpram[1024]; - std::unique_ptr m_frame_buffers[2]; - std::unique_ptr m_tmp_buffer; + uint32_t m_draw_dpram[1024]; + std::unique_ptr m_frame_buffers[2]; + std::unique_ptr m_tmp_buffer; int m_drawing_buffer; int m_display_buffer; @@ -192,11 +192,11 @@ public: /* 3D graphics */ int inside(micro3d_vtx *v, enum planes plane); micro3d_vtx intersect(micro3d_vtx *v1, micro3d_vtx *v2, enum planes plane); - inline void write_span(UINT32 y, UINT32 x); - void draw_line(UINT32 x1, UINT32 y1, UINT32 x2, UINT32 y2); - void rasterise_spans(UINT32 min_y, UINT32 max_y, UINT32 attr); + inline void write_span(uint32_t y, uint32_t x); + void draw_line(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2); + void rasterise_spans(uint32_t min_y, uint32_t max_y, uint32_t attr); int clip_triangle(micro3d_vtx *v, micro3d_vtx *vout, int num_vertices, enum planes plane); - void draw_triangles(UINT32 attr); + void draw_triangles(uint32_t attr); protected: @@ -229,10 +229,10 @@ class micro3d_sound_device : public device_t, public device_sound_interface { public: - micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~micro3d_sound_device() {} - void noise_sh_w(UINT8 data); + void noise_sh_w(uint8_t data); protected: // device-level overrides @@ -248,18 +248,18 @@ private: // { // struct // { -// UINT8 m_vcf; -// UINT8 m_vcq; -// UINT8 m_vca; -// UINT8 m_pan; +// uint8_t m_vcf; +// uint8_t m_vcq; +// uint8_t m_vca; +// uint8_t m_pan; // }; - UINT8 m_dac[4]; + uint8_t m_dac[4]; // }; float m_gain; - UINT32 m_noise_shift; - UINT8 m_noise_value; - UINT8 m_noise_subcount; + uint32_t m_noise_shift; + uint8_t m_noise_value; + uint8_t m_noise_subcount; m3d_filter_state m_noise_filters[4]; lp_filter m_filter; diff --git a/src/mame/includes/micronic.h b/src/mame/includes/micronic.h index 2284e875dbe..0b1ef8cda22 100644 --- a/src/mame/includes/micronic.h +++ b/src/mame/includes/micronic.h @@ -74,12 +74,12 @@ public: DECLARE_WRITE8_MEMBER( rtc_data_w ); DECLARE_WRITE_LINE_MEMBER( mc146818_irq ); - required_shared_ptr m_ram_base; - UINT8 m_banks_num; - UINT8 m_kp_matrix; - UINT8 m_lcd_contrast; + required_shared_ptr m_ram_base; + uint8_t m_banks_num; + uint8_t m_kp_matrix; + uint8_t m_lcd_contrast; int m_lcd_backlight; - UINT8 m_status_flag; + uint8_t m_status_flag; DECLARE_PALETTE_INIT(micronic); protected: diff --git a/src/mame/includes/microtan.h b/src/mame/includes/microtan.h index 7513cf42f75..37e957803d8 100644 --- a/src/mame/includes/microtan.h +++ b/src/mame/includes/microtan.h @@ -40,16 +40,16 @@ public: m_gfxdecode(*this, "gfxdecode") { } - required_shared_ptr m_videoram; - UINT8 m_chunky_graphics; - std::unique_ptr m_chunky_buffer; - UINT8 m_keypad_column; - UINT8 m_keyboard_ascii; + required_shared_ptr m_videoram; + uint8_t m_chunky_graphics; + std::unique_ptr m_chunky_buffer; + uint8_t m_keypad_column; + uint8_t m_keyboard_ascii; emu_timer *m_timer; int m_via_0_irq_line; int m_via_1_irq_line; int m_kbd_irq_line; - UINT8 m_keyrows[10]; + uint8_t m_keyrows[10]; int m_lastrow; int m_mask; int m_key; @@ -65,7 +65,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_microtan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_microtan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(microtan_interrupt); TIMER_CALLBACK_MEMBER(microtan_read_cassette); TIMER_CALLBACK_MEMBER(microtan_pulse_nmi); @@ -85,14 +85,14 @@ public: required_device m_via6522_0; required_device m_via6522_1; required_device m_gfxdecode; - UINT8 read_dsw(); + uint8_t read_dsw(); void microtan_set_irq_line(); void store_key(int key); - image_verify_result microtan_verify_snapshot(UINT8 *data, int size); - image_init_result parse_intel_hex(UINT8 *snapshot_buff, char *src); - image_init_result parse_zillion_hex(UINT8 *snapshot_buff, char *src); - void microtan_set_cpu_regs(const UINT8 *snapshot_buff, int base); - void microtan_snapshot_copy(UINT8 *snapshot_buff, int snapshot_size); + image_verify_result microtan_verify_snapshot(uint8_t *data, int size); + image_init_result parse_intel_hex(uint8_t *snapshot_buff, char *src); + image_init_result parse_zillion_hex(uint8_t *snapshot_buff, char *src); + void microtan_set_cpu_regs(const uint8_t *snapshot_buff, int base); + void microtan_snapshot_copy(uint8_t *snapshot_buff, int snapshot_size); DECLARE_SNAPSHOT_LOAD_MEMBER( microtan ); DECLARE_QUICKLOAD_LOAD_MEMBER( microtan ); diff --git a/src/mame/includes/midtunit.h b/src/mame/includes/midtunit.h index e64a7992611..904a3ae887d 100644 --- a/src/mame/includes/midtunit.h +++ b/src/mame/includes/midtunit.h @@ -34,7 +34,7 @@ public: optional_device m_cvsd_sound; optional_device m_adpcm_sound; - required_shared_ptr m_nvram; + required_shared_ptr m_nvram; required_memory_region m_gfxrom; @@ -90,25 +90,25 @@ public: void init_nbajam_common(int te_protection); /* CMOS-related variables */ - UINT8 m_cmos_write_enable; + uint8_t m_cmos_write_enable; /* sound-related variables */ - UINT8 m_chip_type; - UINT8 m_fake_sound_state; + uint8_t m_chip_type; + uint8_t m_fake_sound_state; /* protection */ - UINT8 m_mk_prot_index; - UINT16 m_mk2_prot_data; + uint8_t m_mk_prot_index; + uint16_t m_mk2_prot_data; - const UINT32 *m_nbajam_prot_table; - UINT16 m_nbajam_prot_queue[5]; - UINT8 m_nbajam_prot_index; + const uint32_t *m_nbajam_prot_table; + uint16_t m_nbajam_prot_queue[5]; + uint8_t m_nbajam_prot_index; - const UINT8 *m_jdredd_prot_table; - UINT8 m_jdredd_prot_index; - UINT8 m_jdredd_prot_max; + const uint8_t *m_jdredd_prot_table; + uint8_t m_jdredd_prot_index; + uint8_t m_jdredd_prot_max; - UINT8 m_gfx_rom_large; + uint8_t m_gfx_rom_large; protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/midvunit.h b/src/mame/includes/midvunit.h index fa06a050f63..5a8432c1bc1 100644 --- a/src/mame/includes/midvunit.h +++ b/src/mame/includes/midvunit.h @@ -15,10 +15,10 @@ struct midvunit_object_data { - UINT16 * destbase; - UINT8 * texbase; - UINT16 pixdata; - UINT8 dither; + uint16_t * destbase; + uint8_t * texbase; + uint16_t pixdata; + uint8_t dither; }; class midvunit_state; @@ -33,10 +33,10 @@ public: private: midvunit_state &m_state; - void render_flat(INT32 scanline, const extent_t &extent, const midvunit_object_data &extradata, int threadid); - void render_tex(INT32 scanline, const extent_t &extent, const midvunit_object_data &extradata, int threadid); - void render_textrans(INT32 scanline, const extent_t &extent, const midvunit_object_data &extradata, int threadid); - void render_textransmask(INT32 scanline, const extent_t &extent, const midvunit_object_data &extradata, int threadid); + void render_flat(int32_t scanline, const extent_t &extent, const midvunit_object_data &extradata, int threadid); + void render_tex(int32_t scanline, const extent_t &extent, const midvunit_object_data &extradata, int threadid); + void render_textrans(int32_t scanline, const extent_t &extent, const midvunit_object_data &extradata, int threadid); + void render_textransmask(int32_t scanline, const extent_t &extent, const midvunit_object_data &extradata, int threadid); }; class midvunit_state : public driver_device @@ -68,41 +68,41 @@ public: m_dcs(*this, "dcs"), m_generic_paletteram_32(*this, "paletteram") { } - optional_shared_ptr m_nvram; - required_shared_ptr m_ram_base; - optional_shared_ptr m_fastram_base; - required_shared_ptr m_tms32031_control; - optional_shared_ptr m_midvplus_misc; - required_shared_ptr m_videoram; - required_shared_ptr m_textureram; + optional_shared_ptr m_nvram; + required_shared_ptr m_ram_base; + optional_shared_ptr m_fastram_base; + required_shared_ptr m_tms32031_control; + optional_shared_ptr m_midvplus_misc; + required_shared_ptr m_videoram; + required_shared_ptr m_textureram; optional_ioport_array<3> m_adc_ports; - UINT8 m_cmos_protected; - UINT16 m_control_data; - UINT8 m_adc_data; - UINT8 m_adc_shift; - UINT16 m_last_port0; - UINT8 m_shifter_state; + uint8_t m_cmos_protected; + uint16_t m_control_data; + uint8_t m_adc_data; + uint8_t m_adc_shift; + uint16_t m_last_port0; + uint8_t m_shifter_state; timer_device *m_timer[2]; double m_timer_rate; - UINT16 m_bit_index; + uint16_t m_bit_index; int m_lastval; - UINT32 *m_generic_speedup; - UINT16 m_video_regs[16]; - UINT16 m_dma_data[16]; - UINT8 m_dma_data_index; - UINT16 m_page_control; - UINT8 m_video_changed; + uint32_t *m_generic_speedup; + uint16_t m_video_regs[16]; + uint16_t m_dma_data[16]; + uint8_t m_dma_data_index; + uint16_t m_page_control; + uint8_t m_video_changed; emu_timer *m_scanline_timer; std::unique_ptr m_poly; - UINT8 m_galil_input_index; - UINT8 m_galil_input_length; + uint8_t m_galil_input_index; + uint8_t m_galil_input_length; const char *m_galil_input; - UINT8 m_galil_output_index; + uint8_t m_galil_output_index; char m_galil_output[450]; - UINT32 m_output; - UINT8 m_output_mode; + uint32_t m_output; + uint8_t m_output_mode; DECLARE_WRITE32_MEMBER(midvunit_dma_queue_w); DECLARE_READ32_MEMBER(midvunit_dma_queue_entries_r); DECLARE_READ32_MEMBER(midvunit_dma_trigger_r); @@ -153,7 +153,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_MACHINE_RESET(midvplus); - UINT32 screen_update_midvunit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_midvunit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(scanline_timer_cb); required_device m_maincpu; required_device m_watchdog; @@ -163,7 +163,7 @@ public: optional_device m_midway_serial_pic2; optional_device m_midway_ioasic; required_device m_dcs; - required_shared_ptr m_generic_paletteram_32; + required_shared_ptr m_generic_paletteram_32; void postload(); protected: diff --git a/src/mame/includes/midwunit.h b/src/mame/includes/midwunit.h index 1b6c447227d..805f0fc0ddb 100644 --- a/src/mame/includes/midwunit.h +++ b/src/mame/includes/midwunit.h @@ -20,16 +20,16 @@ public: { } required_device m_midway_serial_pic; - required_shared_ptr m_nvram; - required_shared_ptr m_mainram; + required_shared_ptr m_nvram; + required_shared_ptr m_mainram; required_ioport_array<4> m_ports; - UINT8 m_cmos_write_enable; - UINT16 m_iodata[8]; - UINT8 m_ioshuffle[16]; - UINT8 m_uart[8]; - UINT8 m_security_bits; - UINT16 *m_umk3_palette; + uint8_t m_cmos_write_enable; + uint16_t m_iodata[8]; + uint8_t m_ioshuffle[16]; + uint8_t m_uart[8]; + uint8_t m_security_bits; + uint16_t *m_umk3_palette; DECLARE_WRITE16_MEMBER(midwunit_cmos_enable_w); DECLARE_WRITE16_MEMBER(midwunit_cmos_w); diff --git a/src/mame/includes/midxunit.h b/src/mame/includes/midxunit.h index 1f25950dc9f..d42f9e38683 100644 --- a/src/mame/includes/midxunit.h +++ b/src/mame/includes/midxunit.h @@ -16,14 +16,14 @@ public: m_nvram(*this, "nvram"), m_midway_serial_pic(*this, "serial_pic") { } - required_shared_ptr m_nvram; + required_shared_ptr m_nvram; required_device m_midway_serial_pic; - UINT8 m_cmos_write_enable; - UINT16 m_iodata[8]; - UINT8 m_ioshuffle[16]; - UINT8 m_analog_port; - UINT8 m_uart[8]; - UINT8 m_security_bits; + uint8_t m_cmos_write_enable; + uint16_t m_iodata[8]; + uint8_t m_ioshuffle[16]; + uint8_t m_analog_port; + uint8_t m_uart[8]; + uint8_t m_security_bits; DECLARE_READ16_MEMBER(midxunit_cmos_r); DECLARE_WRITE16_MEMBER(midxunit_cmos_w); DECLARE_WRITE16_MEMBER(midxunit_io_w); diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h index 14f49304044..f4a92955fcf 100644 --- a/src/mame/includes/midyunit.h +++ b/src/mame/includes/midyunit.h @@ -17,20 +17,20 @@ /* protection data types */ struct protection_data { - UINT16 reset_sequence[3]; - UINT16 data_sequence[100]; + uint16_t reset_sequence[3]; + uint16_t data_sequence[100]; }; struct dma_state_t { - UINT32 offset; /* source offset, in bits */ - INT32 rowbytes; /* source bytes to skip each row */ - INT32 xpos; /* x position, clipped */ - INT32 ypos; /* y position, clipped */ - INT32 width; /* horizontal pixel count */ - INT32 height; /* vertical pixel count */ - UINT16 palette; /* palette base */ - UINT16 color; /* current foreground color with palette */ + uint32_t offset; /* source offset, in bits */ + int32_t rowbytes; /* source bytes to skip each row */ + int32_t xpos; /* x position, clipped */ + int32_t ypos; /* y position, clipped */ + int32_t width; /* horizontal pixel count */ + int32_t height; /* vertical pixel count */ + uint16_t palette; /* palette base */ + uint16_t color; /* current foreground color with palette */ }; @@ -70,29 +70,29 @@ public: optional_device m_adpcm_sound; optional_device m_soundlatch; - required_shared_ptr m_generic_paletteram_16; - optional_shared_ptr m_gfx_rom; - required_shared_ptr m_mainram; + required_shared_ptr m_generic_paletteram_16; + optional_shared_ptr m_gfx_rom; + required_shared_ptr m_mainram; optional_ioport_array<6> m_ports; - std::unique_ptr m_cmos_ram; - UINT32 m_cmos_page; - UINT16 m_prot_result; - UINT16 m_prot_sequence[3]; - UINT8 m_prot_index; - UINT8 m_term2_analog_select; + std::unique_ptr m_cmos_ram; + uint32_t m_cmos_page; + uint16_t m_prot_result; + uint16_t m_prot_sequence[3]; + uint8_t m_prot_index; + uint8_t m_term2_analog_select; const struct protection_data *m_prot_data; - UINT8 m_cmos_w_enable; - UINT8 m_chip_type; - UINT16 *m_t2_hack_mem; - UINT8 *m_cvsd_protection_base; - UINT8 m_autoerase_enable; - UINT32 m_palette_mask; + uint8_t m_cmos_w_enable; + uint8_t m_chip_type; + uint16_t *m_t2_hack_mem; + uint8_t *m_cvsd_protection_base; + uint8_t m_autoerase_enable; + uint32_t m_palette_mask; std::unique_ptr m_pen_map; - std::unique_ptr m_local_videoram; - UINT8 m_videobank_select; - UINT8 m_yawdim_dma; - UINT16 m_dma_register[16]; + std::unique_ptr m_local_videoram; + uint8_t m_videobank_select; + uint8_t m_yawdim_dma; + uint16_t m_dma_register[16]; dma_state_t m_dma_state; DECLARE_WRITE16_MEMBER(midyunit_cmos_w); DECLARE_READ16_MEMBER(midyunit_cmos_r); @@ -147,7 +147,7 @@ public: protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - void dma_draw(UINT16 command); + void dma_draw(uint16_t command); void init_generic(int bpp, int sound, int prot_start, int prot_end); void term2_init_common(write16_delegate hack_w); }; diff --git a/src/mame/includes/midzeus.h b/src/mame/includes/midzeus.h index 7a38879e142..515325cc7f9 100644 --- a/src/mame/includes/midzeus.h +++ b/src/mame/includes/midzeus.h @@ -25,11 +25,11 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_nvram; - required_shared_ptr m_ram_base; - optional_shared_ptr m_linkram; - required_shared_ptr m_tms32031_control; - optional_shared_ptr m_zeusbase; + required_shared_ptr m_nvram; + required_shared_ptr m_ram_base; + optional_shared_ptr m_linkram; + required_shared_ptr m_tms32031_control; + optional_shared_ptr m_zeusbase; optional_device m_m48t35; required_device m_maincpu; required_device m_screen; @@ -67,20 +67,20 @@ public: DECLARE_MACHINE_START(midzeus); DECLARE_MACHINE_RESET(midzeus); DECLARE_VIDEO_START(midzeus); - UINT32 screen_update_midzeus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_midzeus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(display_irq); TIMER_CALLBACK_MEMBER(display_irq_off); TIMER_CALLBACK_MEMBER(invasn_gun_callback); private: void exit_handler(); - void zeus_pointer_w(UINT32 which, UINT32 data, int logit); - void zeus_register16_w(offs_t offset, UINT16 data, int logit); - void zeus_register32_w(offs_t offset, UINT32 data, int logit); + void zeus_pointer_w(uint32_t which, uint32_t data, int logit); + void zeus_register16_w(offs_t offset, uint16_t data, int logit); + void zeus_register32_w(offs_t offset, uint32_t data, int logit); void zeus_register_update(offs_t offset); - int zeus_fifo_process(const UINT32 *data, int numwords); - void zeus_draw_model(UINT32 texdata, int logit); + int zeus_fifo_process(const uint32_t *data, int numwords); + void zeus_draw_model(uint32_t texdata, int logit); - void log_fifo_command(const UINT32 *data, int numwords, const char *suffix); - void log_waveram(UINT32 length_and_base); + void log_fifo_command(const uint32_t *data, int numwords, const char *suffix); + void log_waveram(uint32_t length_and_base); void update_gun_irq(); }; diff --git a/src/mame/includes/midzeus2.h b/src/mame/includes/midzeus2.h index 2a3801a117f..f7cb4eb442b 100644 --- a/src/mame/includes/midzeus2.h +++ b/src/mame/includes/midzeus2.h @@ -16,16 +16,16 @@ public: DECLARE_WRITE_LINE_MEMBER(zeus_irq); DECLARE_VIDEO_START(midzeus2); - UINT32 screen_update_midzeus2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_midzeus2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ32_MEMBER( zeus2_r ); DECLARE_WRITE32_MEMBER( zeus2_w ); private: TIMER_CALLBACK_MEMBER(int_timer_callback); void exit_handler2(); - void zeus2_register32_w(offs_t offset, UINT32 data, int logit); - void zeus2_register_update(offs_t offset, UINT32 oldval, int logit); - int zeus2_fifo_process(const UINT32 *data, int numwords); - void zeus2_pointer_write(UINT8 which, UINT32 value); - void zeus2_draw_model(UINT32 baseaddr, UINT16 count, int logit); - void log_fifo_command(const UINT32 *data, int numwords, const char *suffix); + void zeus2_register32_w(offs_t offset, uint32_t data, int logit); + void zeus2_register_update(offs_t offset, uint32_t oldval, int logit); + int zeus2_fifo_process(const uint32_t *data, int numwords); + void zeus2_pointer_write(uint8_t which, uint32_t value); + void zeus2_draw_model(uint32_t baseaddr, uint16_t count, int logit); + void log_fifo_command(const uint32_t *data, int numwords, const char *suffix); }; diff --git a/src/mame/includes/mikie.h b/src/mame/includes/mikie.h index cdd6a8887bc..839060960c6 100644 --- a/src/mame/includes/mikie.h +++ b/src/mame/includes/mikie.h @@ -20,9 +20,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -37,7 +37,7 @@ public: required_device m_gfxdecode; required_device m_palette; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_READ8_MEMBER(mikie_sh_timer_r); DECLARE_WRITE8_MEMBER(mikie_sh_irqtrigger_w); DECLARE_WRITE8_MEMBER(mikie_coin_counter_w); @@ -51,7 +51,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(mikie); - UINT32 screen_update_mikie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mikie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/mikro80.h b/src/mame/includes/mikro80.h index 49b77a3044f..a69afdf4482 100644 --- a/src/mame/includes/mikro80.h +++ b/src/mame/includes/mikro80.h @@ -42,8 +42,8 @@ public: m_dac(*this, "dac"), m_maincpu(*this, "maincpu") { } - required_shared_ptr m_cursor_ram; - required_shared_ptr m_video_ram; + required_shared_ptr m_cursor_ram; + required_shared_ptr m_video_ram; int m_keyboard_mask; int m_key_mask; DECLARE_WRITE8_MEMBER(radio99_sound_w); @@ -59,7 +59,7 @@ public: DECLARE_DRIVER_INIT(mikro80); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mikro80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mikro80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/mikromik.h b/src/mame/includes/mikromik.h index fd87077d48c..ed7791840ea 100644 --- a/src/mame/includes/mikromik.h +++ b/src/mame/includes/mikromik.h @@ -81,12 +81,12 @@ public: required_memory_region m_rom; required_memory_region m_mmu_rom; required_memory_region m_char_rom; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); diff --git a/src/mame/includes/mitchell.h b/src/mame/includes/mitchell.h index 05b3637ab30..441b43ed009 100644 --- a/src/mame/includes/mitchell.h +++ b/src/mame/includes/mitchell.h @@ -44,19 +44,19 @@ public: optional_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; required_memory_bank m_bank1; optional_memory_bank m_bank0d; optional_memory_bank m_bank1d; /* video-related */ tilemap_t *m_bg_tilemap; - std::vector m_objram; /* Sprite RAM */ + std::vector m_objram; /* Sprite RAM */ int m_flipscreen; int m_video_bank; int m_paletteram_bank; - std::vector m_paletteram; + std::vector m_paletteram; /* sound-related */ int m_sample_buffer; @@ -68,9 +68,9 @@ public: int m_dial_selected; int m_dir[2]; int m_keymatrix; - UINT8 m_dummy_nvram; + uint8_t m_dummy_nvram; - UINT8 m_irq_source; + uint8_t m_irq_source; DECLARE_READ8_MEMBER(pang_port5_r); DECLARE_WRITE8_MEMBER(pang_bankswitch_w); DECLARE_READ8_MEMBER(block_input_r); @@ -122,10 +122,10 @@ public: DECLARE_MACHINE_START(mitchell); DECLARE_MACHINE_RESET(mitchell); DECLARE_VIDEO_START(pang); - UINT32 screen_update_pang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(mitchell_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void bootleg_decode(); - void configure_banks(void (*decode)(UINT8 *src, UINT8 *dst, int size)); + void configure_banks(void (*decode)(uint8_t *src, uint8_t *dst, int size)); DECLARE_WRITE_LINE_MEMBER(spangbl_adpcm_int); }; diff --git a/src/mame/includes/mjkjidai.h b/src/mame/includes/mjkjidai.h index feada46baa3..435d41f9f64 100644 --- a/src/mame/includes/mjkjidai.h +++ b/src/mame/includes/mjkjidai.h @@ -23,8 +23,8 @@ public: required_device m_gfxdecode; required_device m_palette; - required_region_ptr m_adpcmrom; - required_shared_ptr m_videoram; + required_region_ptr m_adpcmrom; + required_shared_ptr m_videoram; required_ioport_array<12> m_row; @@ -45,7 +45,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mjkjidai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mjkjidai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); }; diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h index 61ab172f4c7..04c8f9cca44 100644 --- a/src/mame/includes/model1.h +++ b/src/mame/includes/model1.h @@ -91,12 +91,12 @@ public: DECLARE_READ16_MEMBER(model1_listctl_r); DECLARE_WRITE16_MEMBER(model1_listctl_w); - UINT32 screen_update_model1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_model1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_model1(screen_device &screen, bool state); struct spoint_t { - INT32 x, y; + int32_t x, y; }; struct point_t @@ -183,39 +183,39 @@ private: optional_device m_tgp; required_device m_screen; - required_shared_ptr m_mr2; - required_shared_ptr m_mr; - required_shared_ptr m_display_list0; - required_shared_ptr m_display_list1; - required_shared_ptr m_color_xlat; + required_shared_ptr m_mr2; + required_shared_ptr m_mr; + required_shared_ptr m_display_list0; + required_shared_ptr m_display_list1; + required_shared_ptr m_color_xlat; // Sound int m_sound_irq; - UINT8 m_last_snd_cmd; + uint8_t m_last_snd_cmd; int m_snd_cmd_state; // TGP FIFO - UINT32 fifoout_pop(); - void fifoout_push(UINT32 data); + uint32_t fifoout_pop(); + void fifoout_push(uint32_t data); void fifoout_push_f(float data); - UINT32 fifoin_pop(); - void fifoin_push(UINT32 data); + uint32_t fifoin_pop(); + void fifoin_push(uint32_t data); float fifoin_pop_f(); - UINT16 ram_get_i(); + uint16_t ram_get_i(); float ram_get_f(); - void copro_fifoin_push(UINT32 data); - UINT32 copro_fifoout_pop(); + void copro_fifoin_push(uint32_t data); + uint32_t copro_fifoout_pop(); void next_fn(); - UINT32 m_copro_r; - UINT32 m_copro_w; + uint32_t m_copro_r; + uint32_t m_copro_w; int m_copro_fifoout_rpos; int m_copro_fifoout_wpos; - UINT32 m_copro_fifoout_data[FIFO_SIZE]; + uint32_t m_copro_fifoout_data[FIFO_SIZE]; int m_copro_fifoout_num; int m_copro_fifoin_rpos; int m_copro_fifoin_wpos; - UINT32 m_copro_fifoin_data[FIFO_SIZE]; + uint32_t m_copro_fifoin_data[FIFO_SIZE]; int m_copro_fifoin_num; // TGP @@ -348,7 +348,7 @@ private: offs_t m_pushpc; int m_fifoin_rpos; int m_fifoin_wpos; - UINT32 m_fifoin_data[FIFO_SIZE]; + uint32_t m_fifoin_data[FIFO_SIZE]; int m_fifoin_cbcount; typedef void (model1_state::*tgp_func)(); tgp_func m_fifoin_cb; @@ -361,14 +361,14 @@ private: static const struct function ftab_vf[]; static const struct function ftab_swa[]; - INT32 m_fifoout_rpos; - INT32 m_fifoout_wpos; - UINT32 m_fifoout_data[FIFO_SIZE]; - UINT32 m_list_length; + int32_t m_fifoout_rpos; + int32_t m_fifoout_wpos; + uint32_t m_fifoout_data[FIFO_SIZE]; + uint32_t m_list_length; float m_cmat[12]; float m_mat_stack[MAT_STACK_SIZE][12]; float m_mat_vector[21][12]; - INT32 m_mat_stack_pos; + int32_t m_mat_stack_pos; float m_acc; float m_tgp_vf_xmin; float m_tgp_vf_xmax; @@ -386,27 +386,27 @@ private: float m_tgp_int_px; float m_tgp_int_py; float m_tgp_int_pz; - UINT32 m_tgp_int_adr; - UINT16 m_ram_adr; - UINT16 m_ram_latch[2]; - UINT16 m_ram_scanadr; - std::unique_ptr m_ram_data; + uint32_t m_tgp_int_adr; + uint16_t m_ram_adr; + uint16_t m_ram_latch[2]; + uint16_t m_ram_scanadr; + std::unique_ptr m_ram_data; float m_tgp_vr_base[4]; int m_puuu; int m_ccount; - UINT32 m_vr_r; - UINT32 m_vr_w; - UINT16 m_listctl[2]; - UINT16 *m_glist; + uint32_t m_vr_r; + uint32_t m_vr_w; + uint16_t m_listctl[2]; + uint16_t *m_glist; bool m_render_done; - std::unique_ptr m_tgp_ram; - UINT32 *m_poly_rom; - std::unique_ptr m_poly_ram; + std::unique_ptr m_tgp_ram; + uint32_t *m_poly_rom; + std::unique_ptr m_poly_ram; // Rendering helper functions - UINT32 readi(int adr) const; - INT16 readi16(int adr) const; + uint32_t readi(int adr) const; + int16_t readi16(int adr) const; float readf(int adr) const; void cross_product(point_t* o, const point_t* p, const point_t* q) const; float view_determinant(const point_t *p1, const point_t *p2, const point_t *p3) const; @@ -430,8 +430,8 @@ private: static void recompute_frustum(view_t *view); static void draw_hline(bitmap_rgb32 &bitmap, int x1, int x2, int y, int color); static void draw_hline_moired(bitmap_rgb32 &bitmap, int x1, int x2, int y, int color); - static void fill_slope(bitmap_rgb32 &bitmap, view_t *view, int color, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2); - static void fill_line(bitmap_rgb32 &bitmap, view_t *view, int color, INT32 y, INT32 x1, INT32 x2); + static void fill_slope(bitmap_rgb32 &bitmap, view_t *view, int color, int32_t x1, int32_t x2, int32_t sl1, int32_t sl2, int32_t y1, int32_t y2, int32_t *nx1, int32_t *nx2); + static void fill_line(bitmap_rgb32 &bitmap, view_t *view, int color, int32_t y, int32_t x1, int32_t x2); void fill_quad(bitmap_rgb32 &bitmap, view_t *view, const quad_t& q) const; void fclip_push_quad_next(int level, quad_t& q, point_t *p1, point_t *p2, point_t *p3, point_t *p4); @@ -444,7 +444,7 @@ private: int push_direct(int list_offset); int draw_direct(bitmap_rgb32 &bitmap, const rectangle &cliprect, int list_offset); int skip_direct(int list_offset) const; - void push_object(UINT32 tex_adr, UINT32 poly_adr, UINT32 size); + void push_object(uint32_t tex_adr, uint32_t poly_adr, uint32_t size); void draw_objects(bitmap_rgb32 &bitmap, const rectangle &cliprect); void set_current_render_list(); @@ -454,14 +454,14 @@ private: clipper_t m_clipfn[4]; // run-time rendering - UINT16* m_display_list_current; + uint16_t* m_display_list_current; - optional_shared_ptr m_paletteram16; + optional_shared_ptr m_paletteram16; required_device m_palette; required_device m_tiles; // I/O related - UINT16 m_lamp_state; + uint16_t m_lamp_state; optional_ioport_array<8> m_analog_ports; required_ioport_array<3> m_digital_ports; diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h index bc89dbeab28..213b9097b42 100644 --- a/src/mame/includes/model2.h +++ b/src/mame/includes/model2.h @@ -49,16 +49,16 @@ public: m_lightgun_ports(*this, {"P1_Y", "P1_X", "P2_Y", "P2_X"}) { } - required_shared_ptr m_workram; - required_shared_ptr m_bufferram; - std::unique_ptr m_palram; - required_shared_ptr m_colorxlat; - required_shared_ptr m_textureram0; - required_shared_ptr m_textureram1; - required_shared_ptr m_lumaram; - optional_shared_ptr m_soundram; - optional_shared_ptr m_tgp_program; - optional_shared_ptr m_tgpx4_program; + required_shared_ptr m_workram; + required_shared_ptr m_bufferram; + std::unique_ptr m_palram; + required_shared_ptr m_colorxlat; + required_shared_ptr m_textureram0; + required_shared_ptr m_textureram1; + required_shared_ptr m_lumaram; + optional_shared_ptr m_soundram; + optional_shared_ptr m_tgp_program; + optional_shared_ptr m_tgpx4_program; required_device m_maincpu; optional_device m_dsbz80; // Z80-based MPEG Digital Sound Board @@ -81,14 +81,14 @@ public: optional_ioport_array<4> m_analog_ports; optional_ioport_array<4> m_lightgun_ports; - UINT32 m_intreq; - UINT32 m_intena; - UINT32 m_coproctl; - UINT32 m_coprocnt; - UINT32 m_geoctl; - UINT32 m_geocnt; - UINT32 m_timervals[4]; - UINT32 m_timerorig[4]; + uint32_t m_intreq; + uint32_t m_intena; + uint32_t m_coproctl; + uint32_t m_coprocnt; + uint32_t m_geoctl; + uint32_t m_geocnt; + uint32_t m_timervals[4]; + uint32_t m_timerorig[4]; int m_timerrun[4]; timer_device *m_timers[4]; int m_ctrlmode; @@ -96,33 +96,33 @@ public: int m_dsp_type; int m_copro_fifoin_rpos; int m_copro_fifoin_wpos; - std::unique_ptr m_copro_fifoin_data; + std::unique_ptr m_copro_fifoin_data; int m_copro_fifoin_num; int m_copro_fifoout_rpos; int m_copro_fifoout_wpos; - std::unique_ptr m_copro_fifoout_data; + std::unique_ptr m_copro_fifoout_data; int m_copro_fifoout_num; - UINT16 m_cmd_data; - UINT8 m_driveio_comm_data; + uint16_t m_cmd_data; + uint8_t m_driveio_comm_data; int m_iop_write_num; - UINT32 m_iop_data; + uint32_t m_iop_data; int m_geo_iop_write_num; - UINT32 m_geo_iop_data; + uint32_t m_geo_iop_data; int m_to_68k; int m_maxxstate; - UINT32 m_geo_read_start_address; - UINT32 m_geo_write_start_address; + uint32_t m_geo_read_start_address; + uint32_t m_geo_write_start_address; model2_renderer *m_poly; raster_state *m_raster; geo_state *m_geo; bitmap_rgb32 m_sys24_bitmap; - UINT32 m_videocontrol; - UINT32 m_soundack; + uint32_t m_videocontrol; + uint32_t m_soundack; void model2_check_irq_state(); - void model2_check_irqack_state(UINT32 data); - UINT8 m_gearsel; - UINT8 m_lightgun_mux; + void model2_check_irqack_state(uint32_t data); + uint8_t m_gearsel; + uint8_t m_lightgun_mux; DECLARE_CUSTOM_INPUT_MEMBER(_1c00000_r); DECLARE_CUSTOM_INPUT_MEMBER(_1c0001c_r); @@ -185,7 +185,7 @@ public: DECLARE_READ8_MEMBER(driveio_port_r); DECLARE_WRITE8_MEMBER(driveio_port_w); DECLARE_READ8_MEMBER(driveio_port_str_r); - void push_geo_data(UINT32 data); + void push_geo_data(uint32_t data); DECLARE_DRIVER_INIT(overrev); DECLARE_DRIVER_INIT(pltkids); DECLARE_DRIVER_INIT(rchase2); @@ -204,7 +204,7 @@ public: DECLARE_MACHINE_RESET(model2c); DECLARE_MACHINE_RESET(model2_common); DECLARE_MACHINE_RESET(model2_scsp); - UINT32 screen_update_model2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_model2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(model2_timer_cb); TIMER_DEVICE_CALLBACK_MEMBER(model2_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(model2c_interrupt); @@ -215,12 +215,12 @@ public: DECLARE_READ8_MEMBER(virtuacop_lightgun_r); DECLARE_READ8_MEMBER(virtuacop_lightgun_offscreen_r); - UINT16 crypt_read_callback(UINT32 addr); + uint16_t crypt_read_callback(uint32_t addr); - bool copro_fifoin_pop(device_t *device, UINT32 *result,UINT32 offset, UINT32 mem_mask); - void copro_fifoin_push(device_t *device, UINT32 data, UINT32 offset, UINT32 mem_mask); - UINT32 copro_fifoout_pop(address_space &space, UINT32 offset, UINT32 mem_mask); - void copro_fifoout_push(device_t *device, UINT32 data,UINT32 offset,UINT32 mem_mask); + bool copro_fifoin_pop(device_t *device, uint32_t *result,uint32_t offset, uint32_t mem_mask); + void copro_fifoin_push(device_t *device, uint32_t data, uint32_t offset, uint32_t mem_mask); + uint32_t copro_fifoout_pop(address_space &space, uint32_t offset, uint32_t mem_mask); + void copro_fifoout_push(device_t *device, uint32_t data,uint32_t offset,uint32_t mem_mask); void model2_3d_frame_end( bitmap_rgb32 &bitmap, const rectangle &cliprect ); }; @@ -235,23 +235,23 @@ public: struct m2_poly_extra_data { model2_state * state; - UINT32 lumabase; - UINT32 colorbase; - UINT32 * texsheet; - UINT32 texwidth; - UINT32 texheight; - UINT32 texx, texy; - UINT8 texmirrorx; - UINT8 texmirrory; + uint32_t lumabase; + uint32_t colorbase; + uint32_t * texsheet; + uint32_t texwidth; + uint32_t texheight; + uint32_t texx, texy; + uint8_t texmirrorx; + uint8_t texmirrory; }; -static inline UINT16 get_texel( UINT32 base_x, UINT32 base_y, int x, int y, UINT32 *sheet ) +static inline uint16_t get_texel( uint32_t base_x, uint32_t base_y, int x, int y, uint32_t *sheet ) { - UINT32 baseoffs = ((base_y/2)*512)+(base_x/2); - UINT32 texeloffs = ((y/2)*512)+(x/2); - UINT32 offset = baseoffs + texeloffs; - UINT32 texel = sheet[offset>>1]; + uint32_t baseoffs = ((base_y/2)*512)+(base_x/2); + uint32_t texeloffs = ((y/2)*512)+(x/2); + uint32_t offset = baseoffs + texeloffs; + uint32_t texel = sheet[offset>>1]; if ( offset & 1 ) texel >>= 16; @@ -270,7 +270,7 @@ struct triangle; class model2_renderer : public poly_manager { public: - typedef void (model2_renderer::*scanline_render_func)(INT32 scanline, const extent_t& extent, const m2_poly_extra_data& object, int threadid); + typedef void (model2_renderer::*scanline_render_func)(int32_t scanline, const extent_t& extent, const m2_poly_extra_data& object, int threadid); public: model2_renderer(model2_state& state) @@ -374,7 +374,7 @@ struct texture_parameter { float diffuse; float ambient; - UINT32 specular_control; + uint32_t specular_control; float specular_scale; }; @@ -382,22 +382,22 @@ struct triangle { void * next; poly_vertex v[3]; - UINT16 z; - UINT16 texheader[4]; - UINT8 luma; - INT16 viewport[4]; - INT16 center[2]; + uint16_t z; + uint16_t texheader[4]; + uint8_t luma; + int16_t viewport[4]; + int16_t center[2]; }; struct quad_m2 { poly_vertex v[4]; - UINT16 z; - UINT16 texheader[4]; - UINT8 luma; + uint16_t z; + uint16_t texheader[4]; + uint8_t luma; }; /*----------- defined in video/model2.c -----------*/ -void model2_3d_set_zclip( running_machine &machine, UINT8 clip ); +void model2_3d_set_zclip( running_machine &machine, uint8_t clip ); diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h index f61cee2c1f9..021583fb9a1 100644 --- a/src/mame/includes/model3.h +++ b/src/mame/includes/model3.h @@ -15,10 +15,10 @@ typedef float VECTOR3[3]; struct cached_texture { cached_texture *next; - UINT8 width; - UINT8 height; - UINT8 format; - UINT8 alpha; + uint8_t width; + uint8_t height; + uint8_t format; + uint8_t alpha; rgb_t data[1]; }; @@ -81,10 +81,10 @@ public: optional_ioport_array<8> m_adc_ports; - required_shared_ptr m_work_ram; - required_shared_ptr m_paletteram64; + required_shared_ptr m_work_ram; + required_shared_ptr m_paletteram64; optional_device m_dsbz80; // Z80-based MPEG Digital Sound Board - required_shared_ptr m_soundram; + required_shared_ptr m_soundram; required_device m_gfxdecode; required_device m_palette; @@ -96,67 +96,67 @@ public: int m_sound_irq_enable; emu_timer *m_sound_timer; emu_timer *m_real3d_dma_timer; - UINT8 m_irq_enable; - UINT8 m_irq_state; - UINT8 m_scsi_irq_state; + uint8_t m_irq_enable; + uint8_t m_irq_state; + uint8_t m_scsi_irq_state; int m_crom_bank; int m_controls_bank; bool m_step15_with_mpc106; bool m_step20_with_old_real3d; - UINT32 m_real3d_device_id; + uint32_t m_real3d_device_id; int m_pci_bus; int m_pci_device; int m_pci_function; int m_pci_reg; - UINT32 m_mpc105_regs[0x40]; - UINT32 m_mpc105_addr; - UINT32 m_mpc106_regs[0x40]; - UINT32 m_mpc106_addr; - UINT32 m_dma_data; - UINT32 m_dma_status; - UINT32 m_dma_source; - UINT32 m_dma_dest; - UINT32 m_dma_endian; - UINT32 m_dma_irq; - UINT32 m_dma_busy; - UINT64 m_controls_2; - UINT64 m_controls_3; - UINT8 m_serial_fifo1; - UINT8 m_serial_fifo2; + uint32_t m_mpc105_regs[0x40]; + uint32_t m_mpc105_addr; + uint32_t m_mpc106_regs[0x40]; + uint32_t m_mpc106_addr; + uint32_t m_dma_data; + uint32_t m_dma_status; + uint32_t m_dma_source; + uint32_t m_dma_dest; + uint32_t m_dma_endian; + uint32_t m_dma_irq; + uint32_t m_dma_busy; + uint64_t m_controls_2; + uint64_t m_controls_3; + uint8_t m_serial_fifo1; + uint8_t m_serial_fifo2; int m_lightgun_reg_sel; int m_adc_channel; - UINT64 m_real3d_status; + uint64_t m_real3d_status; int m_prot_data_ptr; - std::unique_ptr m_vrom; + std::unique_ptr m_vrom; int m_step; int m_m3_step; - INT32 m_tap_state; - UINT64 m_ir; - UINT8 m_id_data[32]; - INT32 m_id_size; + int32_t m_tap_state; + uint64_t m_ir; + uint8_t m_id_data[32]; + int32_t m_id_size; int m_tdo; - UINT16 m_layer_priority; - UINT32 m_layer_modulate_r; - UINT32 m_layer_modulate_g; - UINT32 m_layer_modulate_b; - UINT32 m_layer_modulate1; - UINT32 m_layer_modulate2; - UINT64 m_layer_scroll[2]; - std::unique_ptr m_m3_char_ram; - std::unique_ptr m_m3_tile_ram; - std::unique_ptr m_texture_fifo; + uint16_t m_layer_priority; + uint32_t m_layer_modulate_r; + uint32_t m_layer_modulate_g; + uint32_t m_layer_modulate_b; + uint32_t m_layer_modulate1; + uint32_t m_layer_modulate2; + uint64_t m_layer_scroll[2]; + std::unique_ptr m_m3_char_ram; + std::unique_ptr m_m3_tile_ram; + std::unique_ptr m_texture_fifo; int m_texture_fifo_pos; - std::unique_ptr m_texture_ram[2]; - std::unique_ptr m_display_list_ram; - std::unique_ptr m_culling_ram; - std::unique_ptr m_polygon_ram; + std::unique_ptr m_texture_ram[2]; + std::unique_ptr m_display_list_ram; + std::unique_ptr m_culling_ram; + std::unique_ptr m_polygon_ram; int m_real3d_display_list; rectangle m_clip3d; rectangle *m_screen_clip; VECTOR3 m_parallel_light; float m_parallel_light_intensity; float m_ambient_light_intensity; - UINT64 m_vid_reg0; + uint64_t m_vid_reg0; int m_matrix_stack_ptr; int m_list_depth; MATRIX *m_matrix_stack; @@ -168,7 +168,7 @@ public: float m_viewport_height; float m_viewport_near; float m_viewport_far; - UINT32 m_matrix_base_address; + uint32_t m_matrix_base_address; cached_texture *m_texcache[2][1024/32][2048/32]; model3_renderer *m_renderer; @@ -220,8 +220,8 @@ public: DECLARE_WRITE64_MEMBER(daytona2_rombank_w); DECLARE_WRITE16_MEMBER(model3snd_ctrl); - UINT32 pci_device_get_reg(); - void pci_device_set_reg(UINT32 value); + uint32_t pci_device_get_reg(); + void pci_device_set_reg(uint32_t value); DECLARE_DRIVER_INIT(genprot); DECLARE_DRIVER_INIT(lemans24); DECLARE_DRIVER_INIT(vs298); @@ -272,11 +272,11 @@ public: LSI53C810_FETCH_CB(scsi_fetch); LSI53C810_IRQ_CB(scsi_irq_callback); void update_irq_state(); - void set_irq_line(UINT8 bit, int line); + void set_irq_line(uint8_t bit, int line); void model3_init(int step); // video virtual void video_start() override; - UINT32 screen_update_model3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_model3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TILE_GET_INFO_MEMBER(tile_info_layer0_4bit); TILE_GET_INFO_MEMBER(tile_info_layer1_4bit); TILE_GET_INFO_MEMBER(tile_info_layer2_4bit); @@ -290,33 +290,33 @@ public: void draw_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, int layer, int sx, int sy, int prio); void invalidate_texture(int page, int texx, int texy, int texwidth, int texheight); cached_texture *get_texture(int page, int texx, int texy, int texwidth, int texheight, int format); - inline void write_texture16(int xpos, int ypos, int width, int height, int page, UINT16 *data); - inline void write_texture8(int xpos, int ypos, int width, int height, int page, int upper, int lower, UINT16 *data); - void real3d_upload_texture(UINT32 header, UINT32 *data); + inline void write_texture16(int xpos, int ypos, int width, int height, int page, uint16_t *data); + inline void write_texture8(int xpos, int ypos, int width, int height, int page, int upper, int lower, uint16_t *data); + void real3d_upload_texture(uint32_t header, uint32_t *data); void init_matrix_stack(); void get_top_matrix(MATRIX *out); void push_matrix_stack(); void pop_matrix_stack(); void multiply_matrix_stack(MATRIX matrix); void translate_matrix_stack(float x, float y, float z); - void draw_model(UINT32 addr); - UINT32 *get_memory_pointer(UINT32 address); + void draw_model(uint32_t addr); + uint32_t *get_memory_pointer(uint32_t address); void set_projection(float left, float right, float top, float bottom, float near, float far); void load_matrix(int matrix_num, MATRIX *out); - void traverse_list4(int lod_num, UINT32 address); - void traverse_list(UINT32 address); - inline void process_link(UINT32 address, UINT32 link); - void draw_block(UINT32 address); - void draw_viewport(int pri, UINT32 address); + void traverse_list4(int lod_num, uint32_t address); + void traverse_list(uint32_t address); + inline void process_link(uint32_t address, uint32_t link); + void draw_block(uint32_t address); + void draw_viewport(int pri, uint32_t address); void real3d_traverse_display_list(); void real3d_display_list_end(); - void real3d_display_list1_dma(UINT32 src, UINT32 dst, int length, int byteswap); - void real3d_display_list2_dma(UINT32 src, UINT32 dst, int length, int byteswap); - void real3d_vrom_texture_dma(UINT32 src, UINT32 dst, int length, int byteswap); - void real3d_texture_fifo_dma(UINT32 src, int length, int byteswap); - void real3d_polygon_ram_dma(UINT32 src, UINT32 dst, int length, int byteswap); + void real3d_display_list1_dma(uint32_t src, uint32_t dst, int length, int byteswap); + void real3d_display_list2_dma(uint32_t src, uint32_t dst, int length, int byteswap); + void real3d_vrom_texture_dma(uint32_t src, uint32_t dst, int length, int byteswap); + void real3d_texture_fifo_dma(uint32_t src, int length, int byteswap); + void real3d_polygon_ram_dma(uint32_t src, uint32_t dst, int length, int byteswap); // machine - void insert_id(UINT32 id, INT32 start_bit); + void insert_id(uint32_t id, int32_t start_bit); int tap_read(); void tap_write(int tck, int tms, int tdi, int trst); void tap_reset(); @@ -325,6 +325,6 @@ public: DECLARE_READ64_MEMBER(model3_5881prot_r); DECLARE_WRITE64_MEMBER(model3_5881prot_w); int first_read; - UINT16 crypt_read_callback(UINT32 addr); + uint16_t crypt_read_callback(uint32_t addr); }; diff --git a/src/mame/includes/momoko.h b/src/mame/includes/momoko.h index 51eb27a061b..45dc70621a6 100644 --- a/src/mame/includes/momoko.h +++ b/src/mame/includes/momoko.h @@ -20,22 +20,22 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_bg_scrolly; - required_shared_ptr m_bg_scrollx; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_bg_scrolly; + required_shared_ptr m_bg_scrollx; /* video-related */ - UINT8 m_fg_scrollx; - UINT8 m_fg_scrolly; - UINT8 m_fg_select; - UINT8 m_text_scrolly; - UINT8 m_text_mode; - UINT8 m_bg_select; - UINT8 m_bg_priority; - UINT8 m_bg_mask; - UINT8 m_fg_mask; - UINT8 m_flipscreen; + uint8_t m_fg_scrollx; + uint8_t m_fg_scrolly; + uint8_t m_fg_select; + uint8_t m_text_scrolly; + uint8_t m_text_mode; + uint8_t m_bg_select; + uint8_t m_bg_priority; + uint8_t m_bg_mask; + uint8_t m_fg_mask; + uint8_t m_flipscreen; DECLARE_WRITE8_MEMBER(momoko_bg_read_bank_w); DECLARE_WRITE8_MEMBER(momoko_fg_scrollx_w); DECLARE_WRITE8_MEMBER(momoko_fg_scrolly_w); @@ -49,7 +49,7 @@ public: DECLARE_WRITE8_MEMBER(momoko_flipscreen_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_momoko(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_momoko(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void momoko_draw_bg_pri( bitmap_ind16 &bitmap, int chr, int col, int flipx, int flipy, int x, int y, int pri ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/moo.h b/src/mame/includes/moo.h index 42bb1a0bc53..9e18e5abcc1 100644 --- a/src/mame/includes/moo.h +++ b/src/mame/includes/moo.h @@ -39,19 +39,19 @@ public: m_soundlatch3(*this, "soundlatch3") { } /* memory pointers */ - optional_shared_ptr m_workram; - required_shared_ptr m_spriteram; + optional_shared_ptr m_workram; + required_shared_ptr m_spriteram; /* video-related */ int m_sprite_colorbase; int m_layer_colorbase[4]; int m_layerpri[3]; int m_alpha_enabled; - UINT16 m_zmask; + uint16_t m_zmask; /* misc */ - UINT16 m_protram[16]; - UINT16 m_cur_control2; + uint16_t m_protram[16]; + uint16_t m_cur_control2; /* devices */ required_device m_maincpu; @@ -83,7 +83,7 @@ public: DECLARE_MACHINE_RESET(moo); DECLARE_VIDEO_START(moo); DECLARE_VIDEO_START(bucky); - UINT32 screen_update_moo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_moo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(moo_interrupt); INTERRUPT_GEN_MEMBER(moobl_interrupt); TIMER_CALLBACK_MEMBER(dmaend_callback); diff --git a/src/mame/includes/mosaic.h b/src/mame/includes/mosaic.h index 53deb5cf82f..c5e90219aff 100644 --- a/src/mame/includes/mosaic.h +++ b/src/mame/includes/mosaic.h @@ -21,8 +21,8 @@ public: required_device m_gfxdecode; /* memory pointers */ - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -45,5 +45,5 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); }; diff --git a/src/mame/includes/mouser.h b/src/mame/includes/mouser.h index 8e23e7d80b1..c9daccdea1c 100644 --- a/src/mame/includes/mouser.h +++ b/src/mame/includes/mouser.h @@ -21,20 +21,20 @@ public: m_decrypted_opcodes(*this, "decrypted_opcodes") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; /* misc */ - UINT8 m_sound_byte; - UINT8 m_nmi_enable; + uint8_t m_sound_byte; + uint8_t m_nmi_enable; /* devices */ required_device m_maincpu; required_device m_audiocpu; required_device m_gfxdecode; required_device m_palette; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; DECLARE_WRITE8_MEMBER(mouser_nmi_enable_w); DECLARE_WRITE8_MEMBER(mouser_sound_interrupt_w); @@ -46,7 +46,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(mouser); - UINT32 screen_update_mouser(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mouser(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mouser_nmi_interrupt); INTERRUPT_GEN_MEMBER(mouser_sound_nmi_assert); }; diff --git a/src/mame/includes/mpf1.h b/src/mame/includes/mpf1.h index 603dd68f838..5db907ce6d8 100644 --- a/src/mame/includes/mpf1.h +++ b/src/mame/includes/mpf1.h @@ -67,7 +67,7 @@ public: int m_break; int m_m1; - UINT8 m_lednum; + uint8_t m_lednum; emu_timer *m_led_refresh_timer; DECLARE_DRIVER_INIT(mpf1); diff --git a/src/mame/includes/mpu4.h b/src/mame/includes/mpu4.h index 176c0f99392..0b9e55a0ef3 100644 --- a/src/mame/includes/mpu4.h +++ b/src/mame/includes/mpu4.h @@ -46,10 +46,10 @@ -static const UINT8 reel_mux_table[8]= {0,4,2,6,1,5,3,7};//include 7, although I don't think it's used, this is basically a wire swap -static const UINT8 reel_mux_table7[8]= {3,1,5,6,4,2,0,7}; +static const uint8_t reel_mux_table[8]= {0,4,2,6,1,5,3,7};//include 7, although I don't think it's used, this is basically a wire swap +static const uint8_t reel_mux_table7[8]= {3,1,5,6,4,2,0,7}; -static const UINT8 bwb_chr_table_common[10]= {0x00,0x04,0x04,0x0c,0x0c,0x1c,0x14,0x2c,0x5c,0x2c}; +static const uint8_t bwb_chr_table_common[10]= {0x00,0x04,0x04,0x0c,0x0c,0x1c,0x14,0x2c,0x5c,0x2c}; //reel info #define STANDARD_REEL 0 // As originally designed 3/4 reels @@ -85,13 +85,13 @@ static const UINT8 bwb_chr_table_common[10]= {0x00,0x04,0x04,0x0c,0x0c,0x1c,0x14 struct mpu4_chr_table { - UINT8 call; - UINT8 response; + uint8_t call; + uint8_t response; }; struct bwb_chr_table//dynamically populated table for BwB protection { - UINT8 response; + uint8_t response; }; @@ -126,7 +126,7 @@ public: m_meters(*this, "meters") {} - 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) { return 0; } @@ -333,12 +333,12 @@ protected: int m_expansion_latch; int m_global_volume; int m_input_strobe; - UINT8 m_lamp_strobe; - UINT8 m_lamp_strobe2; - UINT8 m_lamp_strobe_ext; - UINT8 m_lamp_strobe_ext_persistence; - UINT8 m_led_strobe; - UINT8 m_ay_data; + uint8_t m_lamp_strobe; + uint8_t m_lamp_strobe2; + uint8_t m_lamp_strobe_ext; + uint8_t m_lamp_strobe_ext_persistence; + uint8_t m_led_strobe; + uint8_t m_ay_data; int m_optic_pattern; int m_active_reel; @@ -363,7 +363,7 @@ protected: int m_t1; int m_t3l; int m_t3h; - UINT8 m_numbanks; + uint8_t m_numbanks; mpu4_chr_table* m_current_chr_table; const bwb_chr_table* m_bwb_chr_table1; }; diff --git a/src/mame/includes/mpz80.h b/src/mame/includes/mpz80.h index 5477c9c156c..0d4c778d74b 100644 --- a/src/mame/includes/mpz80.h +++ b/src/mame/includes/mpz80.h @@ -41,7 +41,7 @@ public: required_device m_ram; required_device m_s100; required_memory_region m_rom; - optional_shared_ptr m_map_ram; + optional_shared_ptr m_map_ram; required_ioport m_16c; virtual void machine_start() override; @@ -70,9 +70,9 @@ public: DECLARE_DIRECT_UPDATE_MEMBER(mpz80_direct_update_handler); // memory state - UINT32 m_addr; - UINT8 m_task; - UINT8 m_mask; + uint32_t m_addr; + uint8_t m_task; + uint8_t m_mask; // interrupt state int m_nmi; @@ -80,10 +80,10 @@ public: int m_int_pend; // trap state - UINT8 m_pretrap_addr; - UINT8 m_trap_addr; - UINT8 m_status; - UINT16 m_trap_start; + uint8_t m_pretrap_addr; + uint8_t m_trap_addr; + uint8_t m_status; + uint16_t m_trap_start; int m_pretrap; int m_trap; int m_trap_reset; diff --git a/src/mame/includes/mrdo.h b/src/mame/includes/mrdo.h index 0a83c779498..4c8e502f3ec 100644 --- a/src/mame/includes/mrdo.h +++ b/src/mame/includes/mrdo.h @@ -19,9 +19,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_bgvideoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -37,7 +37,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(mrdo); - UINT32 screen_update_mrdo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mrdo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/mrflea.h b/src/mame/includes/mrflea.h index 89a139fabcf..99868cfa785 100644 --- a/src/mame/includes/mrflea.h +++ b/src/mame/includes/mrflea.h @@ -20,8 +20,8 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; /* video-related */ int m_gfx_bank; @@ -54,7 +54,7 @@ public: DECLARE_WRITE8_MEMBER(mrflea_spriteram_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_mrflea(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mrflea(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(mrflea_slave_interrupt); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/mrjong.h b/src/mame/includes/mrjong.h index ba39ef942a6..8d6e0b2474d 100644 --- a/src/mame/includes/mrjong.h +++ b/src/mame/includes/mrjong.h @@ -18,8 +18,8 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -30,7 +30,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(mrjong); - UINT32 screen_update_mrjong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mrjong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/ms32.h b/src/mame/includes/ms32.h index dc8e4f4ff7f..3a83a9f1a6c 100644 --- a/src/mame/includes/ms32.h +++ b/src/mame/includes/ms32.h @@ -28,34 +28,34 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - optional_shared_ptr m_mainram; - optional_shared_ptr m_roz_ctrl; - optional_shared_ptr m_tx_scroll; - optional_shared_ptr m_bg_scroll; - optional_shared_ptr m_mahjong_input_select; - optional_shared_ptr m_priram; - optional_shared_ptr m_palram; - optional_shared_ptr m_rozram; - optional_shared_ptr m_lineram; - optional_shared_ptr m_sprram; - optional_shared_ptr m_txram; - optional_shared_ptr m_bgram; - optional_shared_ptr m_f1superb_extraram; - std::unique_ptr m_nvram_8; - UINT32 m_to_main; - UINT16 m_irqreq; + optional_shared_ptr m_mainram; + optional_shared_ptr m_roz_ctrl; + optional_shared_ptr m_tx_scroll; + optional_shared_ptr m_bg_scroll; + optional_shared_ptr m_mahjong_input_select; + optional_shared_ptr m_priram; + optional_shared_ptr m_palram; + optional_shared_ptr m_rozram; + optional_shared_ptr m_lineram; + optional_shared_ptr m_sprram; + optional_shared_ptr m_txram; + optional_shared_ptr m_bgram; + optional_shared_ptr m_f1superb_extraram; + std::unique_ptr m_nvram_8; + uint32_t m_to_main; + uint16_t m_irqreq; tilemap_t *m_tx_tilemap; tilemap_t *m_roz_tilemap; tilemap_t *m_bg_tilemap; tilemap_t *m_bg_tilemap_alt; - UINT32 m_tilemaplayoutcontrol; + uint32_t m_tilemaplayoutcontrol; tilemap_t* m_extra_tilemap; bitmap_ind16 m_temp_bitmap_tilemaps; bitmap_ind16 m_temp_bitmap_sprites; bitmap_ind8 m_temp_bitmap_sprites_pri; int m_reverse_sprite_order; int m_flipscreen; - UINT32 m_brt[4]; + uint32_t m_brt[4]; int m_brt_r; int m_brt_g; int m_brt_b; @@ -106,13 +106,13 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_VIDEO_START(f1superb); - UINT32 screen_update_ms32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ms32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(ms32_interrupt); IRQ_CALLBACK_MEMBER(irq_callback); void irq_init(); void irq_raise(int level); void update_color(int color); - void draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_pri, const rectangle &cliprect, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int reverseorder); + void draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_pri, const rectangle &cliprect, uint16_t *sprram_top, size_t sprram_size, int gfxnum, int reverseorder); void draw_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect,int priority); void configure_banks(); required_device m_maincpu; diff --git a/src/mame/includes/msisaac.h b/src/mame/includes/msisaac.h index 513948fa1df..2aff0d207a2 100644 --- a/src/mame/includes/msisaac.h +++ b/src/mame/includes/msisaac.h @@ -26,10 +26,10 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_videoram3; - required_shared_ptr m_videoram2; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram3; + required_shared_ptr m_videoram2; /* video-related */ bitmap_ind16 *m_tmp_bitmap1; @@ -45,15 +45,15 @@ public: /* fake mcu (in msisaac.c) */ #ifndef USE_MCU - UINT8 m_mcu_val; - UINT8 m_direction; + uint8_t m_mcu_val; + uint8_t m_direction; #endif int m_vol_ctrl[16]; - UINT8 m_snd_ctrl0; - UINT8 m_snd_ctrl1; - UINT8 m_snd_ctrl2; - UINT8 m_snd_ctrl3; + uint8_t m_snd_ctrl0; + uint8_t m_snd_ctrl1; + uint8_t m_snd_ctrl2; + uint8_t m_snd_ctrl3; /* devices */ required_device m_audiocpu; @@ -90,7 +90,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_MACHINE_RESET(ta7630); - UINT32 screen_update_msisaac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_msisaac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(nmi_callback); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/msx.h b/src/mame/includes/msx.h index 0e6d35b3287..e64a21687bf 100644 --- a/src/mame/includes/msx.h +++ b/src/mame/includes/msx.h @@ -161,7 +161,7 @@ public: } // static configuration helpers - static void install_slot_pages(device_t &owner, UINT8 prim, UINT8 sec, UINT8 page, UINT8 numpages, device_t *device); + static void install_slot_pages(device_t &owner, uint8_t prim, uint8_t sec, uint8_t page, uint8_t numpages, device_t *device); virtual void driver_start() override; virtual void machine_start() override; @@ -185,7 +185,7 @@ public: DECLARE_WRITE_LINE_MEMBER(turbo_w); void msx_memory_map_all(); - void msx_memory_map_page(UINT8 page); + void msx_memory_map_page(uint8_t page); void msx_memory_reset(); DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -228,7 +228,7 @@ private: /* PSG */ int m_psg_b; /* mouse */ - UINT16 m_mouse[2]; + uint16_t m_mouse[2]; int m_mouse_stat[2]; /* rtc */ int m_rtc_latch; @@ -239,11 +239,11 @@ private: msx_internal_slot_interface *m_all_slots[4][4][4]; msx_internal_slot_interface *m_current_page[4]; bool m_slot_expanded[4]; - UINT8 m_primary_slot; - UINT8 m_secondary_slot[4]; + uint8_t m_primary_slot; + uint8_t m_secondary_slot[4]; int m_port_c_old; int m_keylatch; - UINT8 m_current_switched_device; + uint8_t m_current_switched_device; int m_irq_state[4]; diff --git a/src/mame/includes/mtx.h b/src/mame/includes/mtx.h index 5558e1fcd15..a9d5ca88fad 100644 --- a/src/mame/includes/mtx.h +++ b/src/mame/includes/mtx.h @@ -50,14 +50,14 @@ public: required_device m_ram; /* keyboard state */ - UINT8 m_key_sense; + uint8_t m_key_sense; /* video state */ - UINT8 *m_video_ram; - UINT8 *m_attr_ram; + uint8_t *m_video_ram; + uint8_t *m_attr_ram; /* sound state */ - UINT8 m_sound_latch; + uint8_t m_sound_latch; /* timers */ device_t *m_cassette_timer; @@ -92,7 +92,7 @@ public: DECLARE_WRITE_LINE_MEMBER(write_centronics_fault); DECLARE_WRITE_LINE_MEMBER(write_centronics_perror); DECLARE_WRITE_LINE_MEMBER(write_centronics_select); - void bankswitch(UINT8 data); + void bankswitch(uint8_t data); DECLARE_SNAPSHOT_LOAD_MEMBER( mtx ); }; diff --git a/src/mame/includes/mugsmash.h b/src/mame/includes/mugsmash.h index 93cc654fc81..ea2991d7c9f 100644 --- a/src/mame/includes/mugsmash.h +++ b/src/mame/includes/mugsmash.h @@ -19,11 +19,11 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; - required_shared_ptr m_regs1; - required_shared_ptr m_regs2; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram1; + required_shared_ptr m_videoram2; + required_shared_ptr m_regs1; + required_shared_ptr m_regs2; + required_shared_ptr m_spriteram; tilemap_t *m_tilemap1; tilemap_t *m_tilemap2; @@ -42,6 +42,6 @@ public: TILE_GET_INFO_MEMBER(get_mugsmash_tile_info2); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_mugsmash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mugsmash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/multfish.h b/src/mame/includes/multfish.h index 4de7337b769..101ebdf1fef 100644 --- a/src/mame/includes/multfish.h +++ b/src/mame/includes/multfish.h @@ -36,12 +36,12 @@ public: /* Misc related */ - UINT8 m_rambk; + uint8_t m_rambk; - UINT8 m_hopper_motor; - UINT8 m_hopper; + uint8_t m_hopper_motor; + uint8_t m_hopper; - UINT8 m_vid[igrosoft_gamble_VIDRAM_SIZE]; + uint8_t m_vid[igrosoft_gamble_VIDRAM_SIZE]; DECLARE_WRITE8_MEMBER(igrosoft_gamble_vid_w); DECLARE_WRITE8_MEMBER(igrosoft_gamble_bank_w); DECLARE_READ8_MEMBER(bankedram_r); @@ -86,7 +86,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_igrosoft_gamble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_igrosoft_gamble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_m48t35; required_device m_gfxdecode; diff --git a/src/mame/includes/munchmo.h b/src/mame/includes/munchmo.h index a0ae8bb3b18..5206eee1786 100644 --- a/src/mame/includes/munchmo.h +++ b/src/mame/includes/munchmo.h @@ -26,12 +26,12 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_sprite_xpos; - required_shared_ptr m_sprite_tile; - required_shared_ptr m_sprite_attr; - required_shared_ptr m_videoram; - required_shared_ptr m_status_vram; - required_shared_ptr m_vreg; + required_shared_ptr m_sprite_xpos; + required_shared_ptr m_sprite_tile; + required_shared_ptr m_sprite_attr; + required_shared_ptr m_videoram; + required_shared_ptr m_status_vram; + required_shared_ptr m_vreg; /* video-related */ std::unique_ptr m_tmpbitmap; @@ -59,7 +59,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(munchmo); - UINT32 screen_update_mnchmobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mnchmobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mnchmobl_vblank_irq); INTERRUPT_GEN_MEMBER(mnchmobl_sound_irq); void draw_status( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/mustache.h b/src/mame/includes/mustache.h index 160f2398d16..6e56298a981 100644 --- a/src/mame/includes/mustache.h +++ b/src/mame/includes/mustache.h @@ -20,9 +20,9 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_decrypted_opcodes; tilemap_t *m_bg_tilemap; int m_control_byte; @@ -37,7 +37,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(mustache); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); TIMER_DEVICE_CALLBACK_MEMBER(scanline); diff --git a/src/mame/includes/mw8080bw.h b/src/mame/includes/mw8080bw.h index cba4f5307d8..53fbdbc5190 100644 --- a/src/mame/includes/mw8080bw.h +++ b/src/mame/includes/mw8080bw.h @@ -61,35 +61,35 @@ public: required_device m_maincpu; optional_device m_mb14241; optional_device m_watchdog; - required_shared_ptr m_main_ram; - optional_shared_ptr m_colorram; - optional_shared_ptr m_colorram2; + required_shared_ptr m_main_ram; + optional_shared_ptr m_colorram; + optional_shared_ptr m_colorram2; optional_device m_discrete; /* sound-related */ - UINT8 m_port_1_last; - UINT8 m_port_2_last; - UINT8 m_port_1_last_extra; - UINT8 m_port_2_last_extra; - UINT8 m_port_3_last_extra; + uint8_t m_port_1_last; + uint8_t m_port_2_last; + uint8_t m_port_1_last_extra; + uint8_t m_port_2_last_extra; + uint8_t m_port_3_last_extra; /* misc game specific */ - UINT16 m_phantom2_cloud_counter; - UINT8 m_flip_screen; - UINT8 m_rev_shift_res; - UINT8 m_maze_tone_timing_state; /* output of IC C1, pin 5 */ - UINT8 m_desertgun_controller_select; - UINT8 m_clowns_controller_select; - - UINT8 m_spcenctr_strobe_state; - UINT8 m_spcenctr_trench_width; - UINT8 m_spcenctr_trench_center; - UINT8 m_spcenctr_trench_slope[16]; /* 16x4 bit RAM */ - UINT8 m_spcenctr_bright_control; - UINT8 m_spcenctr_brightness; - - std::unique_ptr m_scattered_colorram; - std::unique_ptr m_scattered_colorram2; + uint16_t m_phantom2_cloud_counter; + uint8_t m_flip_screen; + uint8_t m_rev_shift_res; + uint8_t m_maze_tone_timing_state; /* output of IC C1, pin 5 */ + uint8_t m_desertgun_controller_select; + uint8_t m_clowns_controller_select; + + uint8_t m_spcenctr_strobe_state; + uint8_t m_spcenctr_trench_width; + uint8_t m_spcenctr_trench_center; + uint8_t m_spcenctr_trench_slope[16]; /* 16x4 bit RAM */ + uint8_t m_spcenctr_bright_control; + uint8_t m_spcenctr_brightness; + + std::unique_ptr m_scattered_colorram; + std::unique_ptr m_scattered_colorram2; /* timer */ emu_timer *m_interrupt_timer; @@ -164,10 +164,10 @@ public: DECLARE_MACHINE_START(phantom2); DECLARE_MACHINE_START(invaders); DECLARE_SOUND_START(samples); - UINT32 screen_update_mw8080bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spcenctr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_phantom2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_invaders(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mw8080bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spcenctr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_phantom2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_invaders(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_phantom2(screen_device &screen, bool state); TIMER_CALLBACK_MEMBER(maze_tone_timing_timer_callback); TIMER_CALLBACK_MEMBER(mw8080bw_interrupt_callback); @@ -198,12 +198,12 @@ public: DECLARE_WRITE8_MEMBER(invad2ct_audio_3_w); DECLARE_WRITE8_MEMBER(invad2ct_audio_4_w); void maze_update_discrete(); - void maze_write_discrete(UINT8 maze_tone_timing_state); - UINT8 vpos_to_vysnc_chain_counter( int vpos ); - int vysnc_chain_counter_to_vpos( UINT8 counter, int vblank ); + void maze_write_discrete(uint8_t maze_tone_timing_state); + uint8_t vpos_to_vysnc_chain_counter( int vpos ); + int vysnc_chain_counter_to_vpos( uint8_t counter, int vblank ); void mw8080bw_create_interrupt_timer( ); void mw8080bw_start_interrupt_timer( ); - UINT8 tornbase_get_cabinet_type(); + uint8_t tornbase_get_cabinet_type(); int invaders_is_cabinet_cocktail(); }; diff --git a/src/mame/includes/mystston.h b/src/mame/includes/mystston.h index 6e311814bba..53b38aca1bb 100644 --- a/src/mame/includes/mystston.h +++ b/src/mame/includes/mystston.h @@ -31,19 +31,19 @@ public: m_palette(*this, "palette") { } /* machine state */ - required_shared_ptr m_ay8910_data; - required_shared_ptr m_ay8910_select; + required_shared_ptr m_ay8910_data; + required_shared_ptr m_ay8910_select; /* video state */ tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; emu_timer *m_interrupt_timer; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_paletteram; - required_shared_ptr m_scroll; - required_shared_ptr m_video_control; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_paletteram; + required_shared_ptr m_scroll; + required_shared_ptr m_video_control; DECLARE_WRITE8_MEMBER(irq_clear_w); DECLARE_WRITE8_MEMBER(mystston_ay8910_select_w); DECLARE_WRITE8_MEMBER(mystston_video_control_w); @@ -52,7 +52,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); DECLARE_VIDEO_START(mystston); DECLARE_VIDEO_RESET(mystston); - UINT32 screen_update_mystston(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mystston(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(interrupt_callback); void set_palette(); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int flip); diff --git a/src/mame/includes/mystwarr.h b/src/mame/includes/mystwarr.h index c0e35e0b61b..8a8b2b83d60 100644 --- a/src/mame/includes/mystwarr.h +++ b/src/mame/includes/mystwarr.h @@ -31,11 +31,11 @@ public: required_device m_soundlatch; required_device m_soundlatch2; required_device m_soundlatch3; - required_shared_ptr m_gx_workram; - optional_shared_ptr m_spriteram; - std::unique_ptr m_decoded; + required_shared_ptr m_gx_workram; + optional_shared_ptr m_spriteram; + std::unique_ptr m_decoded; - UINT8 m_mw_irq_control; + uint8_t m_mw_irq_control; int m_cur_sound_region; int m_layer_colorbase[6]; int m_oinprion; @@ -47,10 +47,10 @@ public: int m_roz_enable; int m_roz_rombank; tilemap_t *m_ult_936_tilemap; - UINT16 m_clip; + uint16_t m_clip; - UINT8 m_sound_ctrl; - UINT8 m_sound_nmi_clk; + uint8_t m_sound_ctrl; + uint8_t m_sound_nmi_clk; DECLARE_READ16_MEMBER(eeprom_r); DECLARE_WRITE16_MEMBER(mweeprom_w); @@ -94,10 +94,10 @@ public: DECLARE_VIDEO_START(gaiapols); DECLARE_MACHINE_RESET(martchmp); DECLARE_VIDEO_START(martchmp); - UINT32 screen_update_mystwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_metamrph(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dadandrn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_martchmp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mystwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_metamrph(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dadandrn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_martchmp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ddd_interrupt); DECLARE_WRITE_LINE_MEMBER(k054539_nmi_gen); TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_interrupt); diff --git a/src/mame/includes/mz700.h b/src/mame/includes/mz700.h index 552dd9a20c0..e4bfa2425fc 100644 --- a/src/mame/includes/mz700.h +++ b/src/mame/includes/mz700.h @@ -63,8 +63,8 @@ public: DECLARE_MACHINE_RESET(mz700); DECLARE_MACHINE_RESET(mz800); virtual void machine_start() override; - UINT32 screen_update_mz700(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mz800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mz700(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mz800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(ne556_cursor_callback); TIMER_DEVICE_CALLBACK_MEMBER(ne556_other_callback); DECLARE_WRITE_LINE_MEMBER(pit_out0_changed); @@ -91,8 +91,8 @@ private: int m_mz700_ram_vram; /* 1 if vram is banked in */ /* mz800 specific */ - std::unique_ptr m_cgram; - UINT8 *m_p_chargen; + std::unique_ptr m_cgram; + uint8_t *m_p_chargen; int m_mz700_mode; /* 1 if in mz700 mode */ int m_mz800_ram_lock; /* 1 if lock is active */ @@ -104,13 +104,13 @@ private: int m_centronics_busy; int m_centronics_perror; - UINT8 *m_colorram; - std::unique_ptr m_videoram; - UINT8 m_speaker_level; - UINT8 m_prev_state; - UINT16 m_mz800_ramaddr; - UINT8 m_mz800_palette[4]; - UINT8 m_mz800_palette_bank; + uint8_t *m_colorram; + std::unique_ptr m_videoram; + uint8_t m_speaker_level; + uint8_t m_prev_state; + uint16_t m_mz800_ramaddr; + uint8_t m_mz800_palette[4]; + uint8_t m_mz800_palette_bank; required_device m_maincpu; required_device m_speaker; diff --git a/src/mame/includes/mz80.h b/src/mame/includes/mz80.h index 93dd6c09b9d..3d18ca66c14 100644 --- a/src/mame/includes/mz80.h +++ b/src/mame/includes/mz80.h @@ -45,19 +45,19 @@ public: DECLARE_WRITE_LINE_MEMBER(pit_out2_changed); bool m_mz80k_vertical; bool m_mz80k_tempo_strobe; - UINT8 m_speaker_level; + uint8_t m_speaker_level; bool m_prev_state; - UINT8 m_mz80k_cursor_cnt; - UINT8 m_mz80k_keyboard_line; - required_shared_ptr m_p_ram; - const UINT8 *m_p_chargen; - required_shared_ptr m_p_videoram; + uint8_t m_mz80k_cursor_cnt; + uint8_t m_mz80k_keyboard_line; + required_shared_ptr m_p_ram; + const uint8_t *m_p_chargen; + required_shared_ptr m_p_videoram; DECLARE_DRIVER_INIT(mz80k); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_mz80k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mz80kj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mz80a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mz80k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mz80kj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mz80a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(ne555_tempo_callback); }; diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h index 09f2e5de511..c06938ad3a7 100644 --- a/src/mame/includes/n64.h +++ b/src/mame/includes/n64.h @@ -30,24 +30,24 @@ public: virtual void video_start() override; void n64_machine_stop(); - UINT32 screen_update_n64(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_n64(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_n64(screen_device &screen, bool state); // Getters n64_rdp* rdp() { return m_rdp; } - UINT32* rdram() { return m_rdram; } - UINT32* sram() { return m_sram; } - UINT32* rsp_imem() { return m_rsp_imem; } - UINT32* rsp_dmem() { return m_rsp_dmem; } + uint32_t* rdram() { return m_rdram; } + uint32_t* sram() { return m_sram; } + uint32_t* rsp_imem() { return m_rsp_imem; } + uint32_t* rsp_dmem() { return m_rsp_dmem; } protected: required_device m_vr4300; required_device m_rsp; - optional_shared_ptr m_sram; - required_shared_ptr m_rdram; - required_shared_ptr m_rsp_imem; - required_shared_ptr m_rsp_dmem; + optional_shared_ptr m_sram; + required_shared_ptr m_rdram; + required_shared_ptr m_rsp_imem; + required_shared_ptr m_rsp_dmem; /* video-related */ n64_rdp *m_rdp; @@ -62,9 +62,9 @@ protected: struct n64_savable_data_t { - UINT8 sram[0x20000]; - UINT8 eeprom[2048]; - UINT8 mempak[2][0x8000]; + uint8_t sram[0x20000]; + uint8_t eeprom[2048]; + uint8_t mempak[2][0x8000]; }; class n64_periphs : public device_t, @@ -73,13 +73,13 @@ class n64_periphs : public device_t, private: struct AUDIO_DMA { - UINT32 address; - UINT32 length; + uint32_t address; + uint32_t length; }; public: // construction/destruction - n64_periphs(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + n64_periphs(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ32_MEMBER( is64_r ); DECLARE_WRITE32_MEMBER( is64_w ); @@ -123,28 +123,28 @@ public: void video_update(bitmap_rgb32 &bitmap); // Video Interface (VI) registers - UINT32 vi_width; - UINT32 vi_origin; - UINT32 vi_control; - UINT32 vi_blank; - UINT32 vi_hstart; - UINT32 vi_vstart; - UINT32 vi_xscale; - UINT32 vi_yscale; - UINT32 vi_burst; - UINT32 vi_vsync; - UINT32 vi_hsync; - UINT32 vi_leap; - UINT32 vi_intr; - UINT32 vi_vburst; - UINT8 field; + uint32_t vi_width; + uint32_t vi_origin; + uint32_t vi_control; + uint32_t vi_blank; + uint32_t vi_hstart; + uint32_t vi_vstart; + uint32_t vi_xscale; + uint32_t vi_yscale; + uint32_t vi_burst; + uint32_t vi_vsync; + uint32_t vi_hsync; + uint32_t vi_leap; + uint32_t vi_intr; + uint32_t vi_vburst; + uint8_t field; /* nvram-specific for MESS */ device_t *m_nvram_image; n64_savable_data_t m_save_data; - UINT32 cart_length; + uint32_t cart_length; bool dd_present; bool disk_present; @@ -156,7 +156,7 @@ public: void poll_reset_button(bool button); - UINT32 dp_clock; + uint32_t dp_clock; protected: // device-level overrides @@ -169,17 +169,17 @@ private: mips3_device *m_vr4300; rsp_device *m_rsp; - UINT32 *m_rdram; - UINT32 *m_sram; - UINT32 *m_rsp_imem; - UINT32 *m_rsp_dmem; + uint32_t *m_rdram; + uint32_t *m_sram; + uint32_t *m_rsp_imem; + uint32_t *m_rsp_dmem; void clear_rcp_interrupt(int interrupt); bool reset_held; emu_timer *reset_timer; - UINT8 is64_buffer[0x10000]; + uint8_t is64_buffer[0x10000]; // Video interface (VI) registers and functions emu_timer *vi_scanline_timer; @@ -187,16 +187,16 @@ private: // Audio Interface (AI) registers and functions void ai_dma(); AUDIO_DMA *ai_fifo_get_top(); - void ai_fifo_push(UINT32 address, UINT32 length); + void ai_fifo_push(uint32_t address, uint32_t length); void ai_fifo_pop(); dmadac_sound_device *ai_dac[2]; - UINT32 ai_dram_addr; - UINT32 ai_len; - UINT32 ai_control; + uint32_t ai_dram_addr; + uint32_t ai_len; + uint32_t ai_control; int ai_dacrate; int ai_bitrate; - UINT32 ai_status; + uint32_t ai_status; emu_timer *ai_timer; @@ -206,24 +206,24 @@ private: int ai_fifo_num; // Memory Interface (MI) registers - UINT32 mi_version; - UINT32 mi_interrupt; - UINT32 mi_intr_mask; - UINT32 mi_mode; + uint32_t mi_version; + uint32_t mi_interrupt; + uint32_t mi_intr_mask; + uint32_t mi_mode; // RDRAM Interface (RI) registers - UINT32 rdram_regs[10]; - UINT32 ri_regs[8]; + uint32_t rdram_regs[10]; + uint32_t ri_regs[8]; // RSP Interface (SP) registers void sp_dma(int direction); - UINT32 sp_mem_addr; - UINT32 sp_dram_addr; + uint32_t sp_mem_addr; + uint32_t sp_dram_addr; int sp_dma_length; int sp_dma_count; int sp_dma_skip; - UINT32 sp_semaphore; + uint32_t sp_semaphore; // Disk Drive (DD) registers and functions void dd_set_zone_and_track_offset(); @@ -231,61 +231,61 @@ private: void dd_write_sector(); void dd_read_sector(); void dd_read_C2(); - UINT32 dd_buffer[256]; - UINT32 dd_sector_data[64]; - UINT32 dd_ram_seq_data[16]; - UINT32 dd_data_reg; - UINT32 dd_status_reg; - UINT32 dd_track_reg; - UINT32 dd_buf_status_reg; - UINT32 dd_sector_err_reg; - UINT32 dd_seq_status_reg; - UINT32 dd_seq_ctrl_reg; - UINT32 dd_sector_reg; - UINT32 dd_reset_reg; - UINT32 dd_current_reg; + uint32_t dd_buffer[256]; + uint32_t dd_sector_data[64]; + uint32_t dd_ram_seq_data[16]; + uint32_t dd_data_reg; + uint32_t dd_status_reg; + uint32_t dd_track_reg; + uint32_t dd_buf_status_reg; + uint32_t dd_sector_err_reg; + uint32_t dd_seq_status_reg; + uint32_t dd_seq_ctrl_reg; + uint32_t dd_sector_reg; + uint32_t dd_reset_reg; + uint32_t dd_current_reg; bool dd_bm_reset_held; bool dd_write; - UINT8 dd_int; - UINT8 dd_start_block; - UINT8 dd_start_sector; - UINT8 dd_sectors_per_block; - UINT8 dd_sector_size; - UINT8 dd_zone; - UINT32 dd_track_offset; + uint8_t dd_int; + uint8_t dd_start_block; + uint8_t dd_start_sector; + uint8_t dd_sectors_per_block; + uint8_t dd_sector_size; + uint8_t dd_zone; + uint32_t dd_track_offset; // Peripheral Interface (PI) registers and functions emu_timer *pi_dma_timer; - UINT32 pi_dram_addr; - UINT32 pi_cart_addr; - UINT32 pi_rd_len; - UINT32 pi_wr_len; - UINT32 pi_status; - UINT32 pi_bsd_dom1_lat; - UINT32 pi_bsd_dom1_pwd; - UINT32 pi_bsd_dom1_pgs; - UINT32 pi_bsd_dom1_rls; - UINT32 pi_bsd_dom2_lat; - UINT32 pi_bsd_dom2_pwd; - UINT32 pi_bsd_dom2_pgs; - UINT32 pi_bsd_dom2_rls; - UINT32 pi_dma_dir; + uint32_t pi_dram_addr; + uint32_t pi_cart_addr; + uint32_t pi_rd_len; + uint32_t pi_wr_len; + uint32_t pi_status; + uint32_t pi_bsd_dom1_lat; + uint32_t pi_bsd_dom1_pwd; + uint32_t pi_bsd_dom1_pgs; + uint32_t pi_bsd_dom1_rls; + uint32_t pi_bsd_dom2_lat; + uint32_t pi_bsd_dom2_pwd; + uint32_t pi_bsd_dom2_pgs; + uint32_t pi_bsd_dom2_rls; + uint32_t pi_dma_dir; // Serial Interface (SI) registers and functions emu_timer *si_dma_timer; void pif_dma(int direction); void handle_pif(); - int pif_channel_handle_command(int channel, int slength, UINT8 *sdata, int rlength, UINT8 *rdata); - UINT8 calc_mempak_crc(UINT8 *buffer, int length); - UINT8 pif_ram[0x40]; - UINT8 pif_cmd[0x40]; - UINT32 si_dram_addr; - UINT32 si_pif_addr; - UINT32 si_pif_addr_rd64b; - UINT32 si_pif_addr_wr64b; - UINT32 si_status_val; - UINT32 si_dma_dir; - UINT32 cic_status; + int pif_channel_handle_command(int channel, int slength, uint8_t *sdata, int rlength, uint8_t *rdata); + uint8_t calc_mempak_crc(uint8_t *buffer, int length); + uint8_t pif_ram[0x40]; + uint8_t pif_cmd[0x40]; + uint32_t si_dram_addr; + uint32_t si_pif_addr; + uint32_t si_pif_addr_rd64b; + uint32_t si_pif_addr_wr64b; + uint32_t si_status_val; + uint32_t si_dma_dir; + uint32_t cic_status; int cic_type; n64_savable_data_t savable_data; @@ -294,11 +294,11 @@ private: void vi_recalculate_resolution(); void video_update16(bitmap_rgb32 &bitmap); void video_update32(bitmap_rgb32 &bitmap); - UINT8 random_seed; // %HACK%, adds 19 each time it's read and is more or less random - UINT8 get_random() { return random_seed += 0x13; } + uint8_t random_seed; // %HACK%, adds 19 each time it's read and is more or less random + uint8_t get_random() { return random_seed += 0x13; } - INT32 m_gamma_table[256]; - INT32 m_gamma_dither_table[0x4000]; + int32_t m_gamma_table[256]; + int32_t m_gamma_dither_table[0x4000]; }; diff --git a/src/mame/includes/n8080.h b/src/mame/includes/n8080.h index 1af5effdb0b..c2c9c4469a2 100644 --- a/src/mame/includes/n8080.h +++ b/src/mame/includes/n8080.h @@ -20,8 +20,8 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - optional_shared_ptr m_colorram; // for helifire + required_shared_ptr m_videoram; + optional_shared_ptr m_colorram; // for helifire /* video-related */ emu_timer* m_cannon_timer; @@ -30,7 +30,7 @@ public: int m_sheriff_color_mode; int m_sheriff_color_data; int m_helifire_flash; - UINT8 m_helifire_LSFR[63]; + uint8_t m_helifire_LSFR[63]; unsigned m_helifire_mv; unsigned m_helifire_sc; /* IC56 */ @@ -40,10 +40,10 @@ public: int m_helifire_dac_phase; double m_helifire_dac_volume; double m_helifire_dac_timing; - UINT16 m_prev_sound_pins; - UINT16 m_curr_sound_pins; + uint16_t m_prev_sound_pins; + uint16_t m_curr_sound_pins; int m_mono_flop[3]; - UINT8 m_prev_snd_data; + uint8_t m_prev_snd_data; /* other */ unsigned m_shift_data; @@ -93,9 +93,9 @@ public: DECLARE_SOUND_RESET(helifire); DECLARE_MACHINE_START(n8080); DECLARE_MACHINE_RESET(n8080); - UINT32 screen_update_spacefev(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sheriff(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_helifire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spacefev(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sheriff(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_helifire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_helifire(screen_device &screen, bool state); TIMER_CALLBACK_MEMBER(spacefev_stop_red_cannon); TIMER_DEVICE_CALLBACK_MEMBER(rst1_tick); diff --git a/src/mame/includes/namcofl.h b/src/mame/includes/namcofl.h index e0a49e4712a..e60366963ce 100644 --- a/src/mame/includes/namcofl.h +++ b/src/mame/includes/namcofl.h @@ -46,10 +46,10 @@ public: optional_ioport m_brake; optional_ioport m_wheel; emu_timer *m_raster_interrupt_timer; - std::unique_ptr m_workram; - required_shared_ptr m_shareram; - UINT8 m_mcu_port6; - UINT32 m_sprbank; + std::unique_ptr m_workram; + required_shared_ptr m_shareram; + uint8_t m_mcu_port6; + uint32_t m_sprbank; DECLARE_READ32_MEMBER(fl_unk1_r); DECLARE_READ32_MEMBER(fl_network_r); @@ -76,7 +76,7 @@ public: DECLARE_MACHINE_START(namcofl); DECLARE_MACHINE_RESET(namcofl); DECLARE_VIDEO_START(namcofl); - UINT32 screen_update_namcofl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_namcofl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(network_interrupt_callback); TIMER_CALLBACK_MEMBER(vblank_interrupt_callback); TIMER_CALLBACK_MEMBER(raster_interrupt_callback); diff --git a/src/mame/includes/namcona1.h b/src/mame/includes/namcona1.h index 23f411a7914..3b7ab520d3f 100644 --- a/src/mame/includes/namcona1.h +++ b/src/mame/includes/namcona1.h @@ -57,28 +57,28 @@ public: required_ioport_array<4> m_muxed_inputs; required_ioport m_io_p3; - required_shared_ptr m_workram; - required_shared_ptr m_vreg; - required_shared_ptr m_paletteram; - required_shared_ptr m_cgram; - required_shared_ptr m_videoram; - required_shared_ptr m_scroll; - required_shared_ptr m_spriteram; - - // this has to be UINT8 to be in the right byte order for the tilemap system - std::vector m_shaperam; - - UINT16 *m_prgrom; - UINT16 *m_maskrom; + required_shared_ptr m_workram; + required_shared_ptr m_vreg; + required_shared_ptr m_paletteram; + required_shared_ptr m_cgram; + required_shared_ptr m_videoram; + required_shared_ptr m_scroll; + required_shared_ptr m_spriteram; + + // this has to be uint8_t to be in the right byte order for the tilemap system + std::vector m_shaperam; + + uint16_t *m_prgrom; + uint16_t *m_maskrom; int m_mEnableInterrupts; int m_gametype; - UINT16 m_count; - UINT32 m_keyval; - UINT16 m_mcu_mailbox[8]; - UINT8 m_mcu_port4; - UINT8 m_mcu_port5; - UINT8 m_mcu_port6; - UINT8 m_mcu_port8; + uint16_t m_count; + uint32_t m_keyval; + uint16_t m_mcu_mailbox[8]; + uint8_t m_mcu_port4; + uint8_t m_mcu_port5; + uint8_t m_mcu_port6; + uint8_t m_mcu_port8; tilemap_t *m_bg_tilemap[4+1]; int m_palette_is_dirty; @@ -103,14 +103,14 @@ public: DECLARE_READ8_MEMBER(portana_r); void simulate_mcu(); void write_version_info(); - int transfer_dword(UINT32 dest, UINT32 source); + int transfer_dword(uint32_t dest, uint32_t source); void blit(); void UpdatePalette(int offset); DECLARE_WRITE16_MEMBER(videoram_w); DECLARE_WRITE16_MEMBER(paletteram_w); DECLARE_READ16_MEMBER(gfxram_r); DECLARE_WRITE16_MEMBER(gfxram_w); - void pdraw_tile( screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, UINT32 code, int color, + void pdraw_tile( screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, uint32_t code, int color, int sx, int sy, int flipx, int flipy, int priority, int bShadow, int bOpaque, int gfx_region ); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int primask ); @@ -139,11 +139,11 @@ public: TILE_GET_INFO_MEMBER(tilemap_get_info3); TILE_GET_INFO_MEMBER(roz_get_info); - 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); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); void postload(); private: - void tilemap_get_info(tile_data &tileinfo, int tile_index, const UINT16 *tilemap_videoram, bool use_4bpp_gfx); + void tilemap_get_info(tile_data &tileinfo, int tile_index, const uint16_t *tilemap_videoram, bool use_4bpp_gfx); }; diff --git a/src/mame/includes/namconb1.h b/src/mame/includes/namconb1.h index 2cd73c8a659..e348f079a74 100644 --- a/src/mame/includes/namconb1.h +++ b/src/mame/includes/namconb1.h @@ -60,16 +60,16 @@ public: optional_ioport m_light0_y; optional_ioport m_light1_x; optional_ioport m_light1_y; - required_shared_ptr m_spritebank32; - optional_shared_ptr m_tilebank32; - required_shared_ptr m_namconb_shareram; + required_shared_ptr m_spritebank32; + optional_shared_ptr m_tilebank32; + required_shared_ptr m_namconb_shareram; - UINT8 m_vbl_irq_level; - UINT8 m_pos_irq_level; - UINT8 m_unk_irq_level; - UINT16 m_count; - UINT8 m_port6; - UINT32 m_tilemap_tile_bank[4]; + uint8_t m_vbl_irq_level; + uint8_t m_pos_irq_level; + uint8_t m_unk_irq_level; + uint16_t m_count; + uint8_t m_port6; + uint32_t m_tilemap_tile_bank[4]; DECLARE_READ32_MEMBER(randgen_r); DECLARE_WRITE32_MEMBER(srand_w); @@ -109,8 +109,8 @@ public: DECLARE_VIDEO_START(namconb1); DECLARE_VIDEO_START(namconb2); void video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bROZ); - UINT32 screen_update_namconb1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_namconb2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_namconb1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_namconb2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scantimer); TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq0_cb); diff --git a/src/mame/includes/namcond1.h b/src/mame/includes/namcond1.h index 979bf93bf05..0ff24757fc0 100644 --- a/src/mame/includes/namcond1.h +++ b/src/mame/includes/namcond1.h @@ -24,9 +24,9 @@ public: required_device m_mcu; required_device m_ygv608; - required_shared_ptr m_shared_ram; + required_shared_ptr m_shared_ram; - UINT8 m_h8_irq5_enabled; + uint8_t m_h8_irq5_enabled; int m_p8; DECLARE_READ16_MEMBER(mcu_p7_read); diff --git a/src/mame/includes/namcos1.h b/src/mame/includes/namcos1.h index a9c4722cc32..ceb5034f539 100644 --- a/src/mame/includes/namcos1.h +++ b/src/mame/includes/namcos1.h @@ -40,11 +40,11 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_playfield_control; - required_shared_ptr m_triram; - required_region_ptr m_rom; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_playfield_control; + required_shared_ptr m_triram; + required_region_ptr m_rom; required_memory_bank m_soundbank; required_memory_bank m_mcubank; @@ -61,7 +61,7 @@ public: unsigned int m_key_quotient; unsigned int m_key_reminder; unsigned int m_key_numerator_high_word; - UINT8 m_key[8]; + uint8_t m_key[8]; int m_mcu_patch_data; int m_reset; int m_input_count; @@ -69,9 +69,9 @@ public: int m_strobe_count; int m_stored_input[2]; tilemap_t *m_bg_tilemap[6]; - UINT8 *m_tilemap_maskdata; + uint8_t *m_tilemap_maskdata; int m_copy_sprites; - UINT8 m_drawmode_table[16]; + uint8_t m_drawmode_table[16]; DECLARE_WRITE_LINE_MEMBER(subres_w); DECLARE_WRITE8_MEMBER(irq_ack_w); @@ -132,9 +132,9 @@ public: TILE_GET_INFO_MEMBER(fg_get_info5); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - 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); void screen_eof(screen_device &screen, bool state); private: - inline void get_tile_info(tile_data &tileinfo,int tile_index,UINT8 *info_vram); + inline void get_tile_info(tile_data &tileinfo,int tile_index,uint8_t *info_vram); }; diff --git a/src/mame/includes/namcos2.h b/src/mame/includes/namcos2.h index 63dc47c0de2..2221ac52119 100644 --- a/src/mame/includes/namcos2.h +++ b/src/mame/includes/namcos2.h @@ -129,10 +129,10 @@ public: int m_mcu_analog_ctrl; int m_mcu_analog_data; int m_mcu_analog_complete; - std::unique_ptr m_eeprom; - UINT16 m_68k_master_C148[0x20]; - UINT16 m_68k_slave_C148[0x20]; - UINT16 m_68k_gpu_C148[0x20]; + std::unique_ptr m_eeprom; + uint16_t m_68k_master_C148[0x20]; + uint16_t m_68k_slave_C148[0x20]; + uint16_t m_68k_gpu_C148[0x20]; // C123 Tilemap Emulation // TODO: merge with namcos1.cpp implementation and convert to device @@ -147,7 +147,7 @@ public: TILE_GET_INFO_MEMBER( get_tile_info3 ); TILE_GET_INFO_MEMBER( get_tile_info4 ); TILE_GET_INFO_MEMBER( get_tile_info5 ); - void namco_tilemap_init(int gfxbank, void *pMaskROM, void (*cb)( running_machine &machine, UINT16 code, int *gfx, int *mask) ); + void namco_tilemap_init(int gfxbank, void *pMaskROM, void (*cb)( running_machine &machine, uint16_t code, int *gfx, int *mask) ); // C169 ROZ Layer Emulation public: @@ -163,12 +163,12 @@ public: protected: struct roz_parameters { - UINT32 left, top, size; - UINT32 startx, starty; + uint32_t left, top, size; + uint32_t startx, starty; int incxx, incxy, incyx, incyy; int color, priority; }; - void c169_roz_unpack_params(const UINT16 *source, roz_parameters ¶ms); + void c169_roz_unpack_params(const uint16_t *source, roz_parameters ¶ms); void c169_roz_draw_helper(screen_device &screen, bitmap_ind16 &bitmap, tilemap_t &tmap, const rectangle &clip, const roz_parameters ¶ms); void c169_roz_draw_scanline(screen_device &screen, bitmap_ind16 &bitmap, int line, int which, int pri, const rectangle &cliprect); void c169_roz_get_info(tile_data &tileinfo, int tile_index, int which); @@ -178,11 +178,11 @@ protected: static const int ROZ_TILEMAP_COUNT = 2; tilemap_t *m_c169_roz_tilemap[ROZ_TILEMAP_COUNT]; - UINT16 m_c169_roz_bank[0x10/2]; - UINT16 m_c169_roz_control[0x20/2]; - optional_shared_ptr m_c169_roz_videoram; + uint16_t m_c169_roz_bank[0x10/2]; + uint16_t m_c169_roz_control[0x20/2]; + optional_shared_ptr m_c169_roz_videoram; int m_c169_roz_gfxbank; - UINT8 *m_c169_roz_mask; + uint8_t *m_c169_roz_mask; // C355 Motion Object Emulation public: @@ -201,23 +201,23 @@ public: protected: // C355 Motion Object internals template - void c355_obj_draw_sprite(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, const UINT16 *pSource, int pri, int zpos); + void c355_obj_draw_sprite(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, const uint16_t *pSource, int pri, int zpos); template - void c355_obj_draw_list(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri, const UINT16 *pSpriteList16, const UINT16 *pSpriteTable); + void c355_obj_draw_list(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int pri, const uint16_t *pSpriteList16, const uint16_t *pSpriteTable); c355_obj_code2tile_delegate m_c355_obj_code2tile; int m_c355_obj_gfxbank; int m_c355_obj_palxor; - UINT16 m_c355_obj_position[4]; - UINT16 m_c355_obj_ram[0x20000/2]; + uint16_t m_c355_obj_position[4]; + uint16_t m_c355_obj_ram[0x20000/2]; - UINT8 m_player_mux; - inline void namcoic_get_tile_info(tile_data &tileinfo,int tile_index,UINT16 *vram); + uint8_t m_player_mux; + inline void namcoic_get_tile_info(tile_data &tileinfo,int tile_index,uint16_t *vram); public: // general - void 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, int scalex, int scaley, int zpos); - void 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, int scalex, int scaley, int zpos); + void zdrawgfxzoom(screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos); + void zdrawgfxzoom(screen_device &screen, bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos); INTERRUPT_GEN_MEMBER(namcos2_68k_master_vblank); INTERRUPT_GEN_MEMBER(namcos2_68k_slave_vblank); INTERRUPT_GEN_MEMBER(namcos2_68k_gpu_vblank); @@ -225,7 +225,7 @@ public: void adjust_posirq_timer( int scanline ); void init_c148(); void reset_all_subcpus(int state); - UINT16 readwrite_c148( address_space &space, offs_t offset, UINT16 data, int bWrite ); + uint16_t readwrite_c148( address_space &space, offs_t offset, uint16_t data, int bWrite ); int get_posirq_scanline(); DECLARE_WRITE8_MEMBER( namcos2_68k_eeprom_w ); @@ -318,11 +318,11 @@ public: void video_start_metlhawk(); void video_start_sgunner(); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_finallap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_luckywld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_metlhawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sgunner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_finallap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_luckywld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_metlhawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sgunner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TILE_GET_INFO_MEMBER( roz_tile_info ); @@ -342,19 +342,19 @@ public: void draw_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int control ); void draw_sprites_metalhawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ); - UINT16 get_palette_register( int which ); + uint16_t get_palette_register( int which ); int get_pos_irq_scanline() { return (get_palette_register(5) - 32) & 0xff; } - required_shared_ptr m_dpram; /* 2Kx8 */ - required_shared_ptr m_paletteram; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_serial_comms_ram; - optional_shared_ptr m_rozram; - optional_shared_ptr m_roz_ctrl; + required_shared_ptr m_dpram; /* 2Kx8 */ + required_shared_ptr m_paletteram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_serial_comms_ram; + optional_shared_ptr m_rozram; + optional_shared_ptr m_roz_ctrl; tilemap_t *m_tilemap_roz; - UINT16 m_gfx_ctrl; - UINT16 m_serial_comms_ctrl[0x8]; + uint16_t m_gfx_ctrl; + uint16_t m_serial_comms_ctrl[0x8]; unsigned m_finallap_prot_count; int m_sendval; diff --git a/src/mame/includes/namcos21.h b/src/mame/includes/namcos21.h index 1578ab84b09..0076926c123 100644 --- a/src/mame/includes/namcos21.h +++ b/src/mame/includes/namcos21.h @@ -15,13 +15,13 @@ struct dsp_state { unsigned masterSourceAddr; - UINT16 slaveInputBuffer[DSP_BUF_MAX]; + uint16_t slaveInputBuffer[DSP_BUF_MAX]; unsigned slaveBytesAvailable; unsigned slaveBytesAdvertised; unsigned slaveInputStart; - UINT16 slaveOutputBuffer[DSP_BUF_MAX]; + uint16_t slaveOutputBuffer[DSP_BUF_MAX]; unsigned slaveOutputSize; - UINT16 masterDirectDrawBuffer[256]; + uint16_t masterDirectDrawBuffer[256]; unsigned masterDirectDrawSize; int masterFinished; int slaveActive; @@ -54,41 +54,41 @@ public: m_ptrom16(*this,"point16"), m_dsp(*this, "dsp") { } - optional_shared_ptr m_winrun_dspbios; - optional_shared_ptr m_winrun_polydata; - optional_shared_ptr m_dspram16; - required_shared_ptr m_mpDualPortRAM; - optional_shared_ptr m_master_dsp_code; + optional_shared_ptr m_winrun_dspbios; + optional_shared_ptr m_winrun_polydata; + optional_shared_ptr m_dspram16; + required_shared_ptr m_mpDualPortRAM; + optional_shared_ptr m_master_dsp_code; - optional_region_ptr m_ptrom24; - optional_region_ptr m_ptrom16; + optional_region_ptr m_ptrom24; + optional_region_ptr m_ptrom16; optional_device m_dsp; - std::unique_ptr m_videoram; - std::unique_ptr m_winrun_dspcomram; - UINT16 m_winrun_poly_buf[WINRUN_MAX_POLY_PARAM]; + std::unique_ptr m_videoram; + std::unique_ptr m_winrun_dspcomram; + uint16_t m_winrun_poly_buf[WINRUN_MAX_POLY_PARAM]; int m_winrun_poly_index; - UINT32 m_winrun_pointrom_addr; + uint32_t m_winrun_pointrom_addr; int m_winrun_dsp_alive; - UINT16 m_winrun_dspcomram_control[8]; - UINT16 m_video_enable; - std::unique_ptr m_pointram; + uint16_t m_winrun_dspcomram_control[8]; + uint16_t m_video_enable; + std::unique_ptr m_pointram; int m_pointram_idx; - UINT16 m_pointram_control; + uint16_t m_pointram_control; std::unique_ptr m_mpDspState; int m_mbNeedsKickstart; - UINT32 m_pointrom_idx; - UINT8 m_mPointRomMSB; + uint32_t m_pointrom_idx; + uint8_t m_mPointRomMSB; int m_mbPointRomDataAvailable; int m_irq_enable; - UINT8 m_depthcue[2][0x400]; - std::unique_ptr m_mpPolyFrameBufferPens; - std::unique_ptr m_mpPolyFrameBufferZ; - std::unique_ptr m_mpPolyFrameBufferPens2; - std::unique_ptr m_mpPolyFrameBufferZ2; - UINT16 m_winrun_color; - UINT16 m_winrun_gpu_register[0x10/2]; + uint8_t m_depthcue[2][0x400]; + std::unique_ptr m_mpPolyFrameBufferPens; + std::unique_ptr m_mpPolyFrameBufferZ; + std::unique_ptr m_mpPolyFrameBufferPens2; + std::unique_ptr m_mpPolyFrameBufferZ2; + uint16_t m_winrun_color; + uint16_t m_winrun_gpu_register[0x10/2]; DECLARE_READ16_MEMBER(namcos21_video_enable_r); DECLARE_WRITE16_MEMBER(namcos21_video_enable_w); DECLARE_WRITE16_MEMBER(dspcuskey_w); @@ -164,20 +164,20 @@ public: DECLARE_DRIVER_INIT(aircomb); DECLARE_MACHINE_START(namcos21); DECLARE_VIDEO_START(namcos21); - UINT32 screen_update_namcos21(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_namcos21(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void allocate_poly_framebuffer(); void clear_poly_framebuffer(); void copy_visible_poly_framebuffer(bitmap_ind16 &bitmap, const rectangle &clip, int zlo, int zhi); void renderscanline_flat(const edge *e1, const edge *e2, int sy, unsigned color, int depthcueenable); void rendertri(const n21_vertex *v0, const n21_vertex *v1, const n21_vertex *v2, unsigned color, int depthcueenable); void draw_quad(int sx[4], int sy[4], int zcode[4], int color); - INT32 read_pointrom_data(unsigned offset); - void transmit_word_to_slave(UINT16 data); + int32_t read_pointrom_data(unsigned offset); + void transmit_word_to_slave(uint16_t data); void transfer_dsp_data(); - UINT16 read_word_from_slave_input(); - UINT16 get_input_bytes_advertised_for_slave(); + uint16_t read_word_from_slave_input(); + uint16_t get_input_bytes_advertised_for_slave(); int init_dsp(); - void render_slave_output(UINT16 data); + void render_slave_output(uint16_t data); void winrun_flush_poly(); void init(int game_type); }; diff --git a/src/mame/includes/namcos22.h b/src/mame/includes/namcos22.h index a42e31bf5eb..3e9c8fc7ea6 100644 --- a/src/mame/includes/namcos22.h +++ b/src/mame/includes/namcos22.h @@ -109,10 +109,10 @@ struct namcos22_object_data int zfog_enabled; int cz_adjust; int cz_sdelta; - const UINT8 *czram; + const uint8_t *czram; /* sprites */ - const UINT8 *source; + const uint8_t *source; int alpha; int line_modulo; int flipx; @@ -128,7 +128,7 @@ public: namcos22_renderer(namcos22_state &state); void render_scene(screen_device &screen, bitmap_rgb32 &bitmap); - struct namcos22_scenenode *new_scenenode(running_machine &machine, UINT32 zsort, namcos22_scenenode_type type); + struct namcos22_scenenode *new_scenenode(running_machine &machine, uint32_t zsort, namcos22_scenenode_type type); void reset(); @@ -142,19 +142,19 @@ private: int m_clipy; rectangle m_cliprect; - inline UINT8 nthbyte(const UINT32 *src, int n) { return (src[n / 4] << ((n & 3) * 8)) >> 24; } - inline UINT16 nthword(const UINT32 *src, int n) { return (src[n / 2] << ((n & 1) * 16)) >> 16; } + inline uint8_t nthbyte(const uint32_t *src, int n) { return (src[n / 4] << ((n & 3) * 8)) >> 24; } + inline uint16_t nthword(const uint32_t *src, int n) { return (src[n / 2] << ((n & 1) * 16)) >> 16; } void render_scene_nodes(screen_device &screen, bitmap_rgb32 &bitmap, struct namcos22_scenenode *node); void render_sprite(screen_device &screen, bitmap_rgb32 &bitmap, struct namcos22_scenenode *node); void poly3d_drawquad(screen_device &screen, bitmap_rgb32 &bitmap, struct namcos22_scenenode *node); - void poly3d_drawsprite(screen_device &screen, bitmap_rgb32 &dest_bmp, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int cz_factor, int prioverchar, int alpha); + void poly3d_drawsprite(screen_device &screen, bitmap_rgb32 &dest_bmp, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int cz_factor, int prioverchar, int alpha); void free_scenenode(struct namcos22_scenenode *node); struct namcos22_scenenode *alloc_scenenode(running_machine &machine, struct namcos22_scenenode *node); - void renderscanline_uvi_full(INT32 scanline, const extent_t &extent, const namcos22_object_data &extra, int threadid); - void renderscanline_sprite(INT32 scanline, const extent_t &extent, const namcos22_object_data &extra, int threadid); + void renderscanline_uvi_full(int32_t scanline, const extent_t &extent, const namcos22_object_data &extra, int threadid); + void renderscanline_sprite(int32_t scanline, const extent_t &extent, const namcos22_object_data &extra, int threadid); }; @@ -211,22 +211,22 @@ public: required_device m_slave; required_device m_mcu; optional_device m_iomcu; - optional_shared_ptr m_spriteram; - required_shared_ptr m_shareram; + optional_shared_ptr m_spriteram; + required_shared_ptr m_shareram; required_device m_eeprom; - required_shared_ptr m_pSlaveExternalRAM; - required_shared_ptr m_pMasterExternalRAM; - required_shared_ptr m_paletteram; - required_shared_ptr m_cgram; - required_shared_ptr m_textram; - required_shared_ptr m_polygonram; - required_shared_ptr m_mixer; - optional_region_ptr m_gamma_proms; - optional_shared_ptr m_vics_data; - optional_shared_ptr m_vics_control; - optional_shared_ptr m_czattr; - required_shared_ptr m_tilemapattr; - optional_shared_ptr m_czram; + required_shared_ptr m_pSlaveExternalRAM; + required_shared_ptr m_pMasterExternalRAM; + required_shared_ptr m_paletteram; + required_shared_ptr m_cgram; + required_shared_ptr m_textram; + required_shared_ptr m_polygonram; + required_shared_ptr m_mixer; + optional_region_ptr m_gamma_proms; + optional_shared_ptr m_vics_data; + optional_shared_ptr m_vics_control; + optional_shared_ptr m_czattr; + required_shared_ptr m_tilemapattr; + optional_shared_ptr m_czram; optional_device m_motor_timer; optional_device m_pc_pedal_interrupt; required_device m_gfxdecode; @@ -238,60 +238,60 @@ public: optional_ioport m_mcup5a; optional_ioport m_mcup5b; - UINT8 m_syscontrol[0x20]; + uint8_t m_syscontrol[0x20]; bool m_dsp_irq_enabled; emu_timer *m_ar_tb_interrupt[2]; - UINT16 m_dsp_master_bioz; - std::unique_ptr m_pointram; - UINT32 m_old_coin_state; - UINT32 m_credits1; - UINT32 m_credits2; - UINT32 m_point_address; - UINT32 m_point_data; - UINT16 m_SerialDataSlaveToMasterNext; - UINT16 m_SerialDataSlaveToMasterCurrent; + uint16_t m_dsp_master_bioz; + std::unique_ptr m_pointram; + uint32_t m_old_coin_state; + uint32_t m_credits1; + uint32_t m_credits2; + uint32_t m_point_address; + uint32_t m_point_data; + uint16_t m_SerialDataSlaveToMasterNext; + uint16_t m_SerialDataSlaveToMasterCurrent; int m_RenderBufSize; - UINT16 m_RenderBufData[NAMCOS22_MAX_RENDER_CMD_SEQ]; - UINT16 m_portbits[2]; + uint16_t m_RenderBufData[NAMCOS22_MAX_RENDER_CMD_SEQ]; + uint16_t m_portbits[2]; int m_irq_state; namcos22_dsp_upload_state m_dsp_upload_state; int m_UploadDestIdx; - UINT32 m_alpinesa_protection; + uint32_t m_alpinesa_protection; int m_motor_status; int m_p4; - UINT16 m_su_82; - UINT16 m_keycus_id; - UINT16 m_keycus_rng; + uint16_t m_su_82; + uint16_t m_keycus_id; + uint16_t m_keycus_rng; int m_gametype; int m_is_ss22; int m_chipselect; int m_spot_enable; int m_spot_read_address; int m_spot_write_address; - std::unique_ptr m_spotram; - std::unique_ptr m_banked_czram[4]; - std::unique_ptr m_recalc_czram[4]; - UINT32 m_cz_was_written[4]; + std::unique_ptr m_spotram; + std::unique_ptr m_banked_czram[4]; + std::unique_ptr m_recalc_czram[4]; + uint32_t m_cz_was_written[4]; int m_cz_adjust; namcos22_renderer *m_poly; - UINT16 *m_texture_tilemap; - std::unique_ptr m_texture_tileattr; - UINT8 *m_texture_tiledata; - std::unique_ptr m_texture_ayx_to_pixel; - UINT16 m_dspram_bank; - UINT16 m_dspram16_latch; + uint16_t *m_texture_tilemap; + std::unique_ptr m_texture_tileattr; + uint8_t *m_texture_tiledata; + std::unique_ptr m_texture_ayx_to_pixel; + uint16_t m_dspram_bank; + uint16_t m_dspram16_latch; bool m_slave_simulation_active; - INT32 m_absolute_priority; - INT32 m_objectshift; - UINT16 m_PrimitiveID; + int32_t m_absolute_priority; + int32_t m_objectshift; + uint16_t m_PrimitiveID; float m_viewmatrix[4][4]; - UINT8 m_LitSurfaceInfo[NAMCOS22_MAX_LIT_SURFACES]; - INT32 m_SurfaceNormalFormat; + uint8_t m_LitSurfaceInfo[NAMCOS22_MAX_LIT_SURFACES]; + int32_t m_SurfaceNormalFormat; unsigned m_LitSurfaceCount; unsigned m_LitSurfaceIndex; int m_pointrom_size; - INT32 *m_pointrom; - std::unique_ptr m_dirtypal; + int32_t *m_pointrom; + std::unique_ptr m_dirtypal; std::unique_ptr m_mix_bitmap; tilemap_t *m_bgtilemap; @@ -302,7 +302,7 @@ public: int m_fog_r_per_cztype[4]; int m_fog_g_per_cztype[4]; int m_fog_b_per_cztype[4]; - UINT32 m_fog_colormask; + uint32_t m_fog_colormask; int m_poly_fade_r; int m_poly_fade_g; int m_poly_fade_b; @@ -412,21 +412,21 @@ public: DECLARE_READ16_MEMBER(mcu130_speedup_r); DECLARE_READ16_MEMBER(mcuc74_speedup_r); - inline UINT8 nthbyte(const UINT32 *src, int n) { return (src[n / 4] << ((n & 3) * 8)) >> 24; } - inline UINT16 nthword(const UINT32 *src, int n) { return (src[n / 2] << ((n & 1) * 16)) >> 16; } + inline uint8_t nthbyte(const uint32_t *src, int n) { return (src[n / 4] << ((n & 3) * 8)) >> 24; } + inline uint16_t nthword(const uint32_t *src, int n) { return (src[n / 2] << ((n & 1) * 16)) >> 16; } - inline INT32 signed18(INT32 val) { return (val & 0x00020000) ? (INT32)(val | 0xfffc0000) : val & 0x0001ffff; } - inline INT32 signed24(INT32 val) { return (val & 0x00800000) ? (INT32)(val | 0xff000000) : val & 0x007fffff; } + inline int32_t signed18(int32_t val) { return (val & 0x00020000) ? (int32_t)(val | 0xfffc0000) : val & 0x0001ffff; } + inline int32_t signed24(int32_t val) { return (val & 0x00800000) ? (int32_t)(val | 0xff000000) : val & 0x007fffff; } - inline float dspfixed_to_nativefloat(INT16 val) { return val / (float)0x7fff; } - float dspfloat_to_nativefloat(UINT32 val); + inline float dspfixed_to_nativefloat(int16_t val) { return val / (float)0x7fff; } + float dspfloat_to_nativefloat(uint32_t val); void handle_driving_io(); void handle_coinage(int slots, int address_is_odd); void handle_cybrcomm_io(); - UINT32 pdp_polygonram_read(offs_t offs); - void pdp_polygonram_write(offs_t offs, UINT32 data); - void point_write(offs_t offs, UINT32 data); + uint32_t pdp_polygonram_read(offs_t offs); + void pdp_polygonram_write(offs_t offs, uint32_t data); + void point_write(offs_t offs, uint32_t data); void slave_halt(); void slave_enable(); void enable_slave_simulation(bool enable); @@ -435,27 +435,27 @@ public: void matrix3d_identity(float m[4][4]); void transform_point(float *vx, float *vy, float *vz, float m[4][4]); void transform_normal(float *nx, float *ny, float *nz, float m[4][4]); - void register_normals(INT32 addr, float m[4][4]); + void register_normals(int32_t addr, float m[4][4]); - void blit_single_quad(bitmap_rgb32 &bitmap, UINT32 color, UINT32 addr, float m[4][4], INT32 polyshift, int flags, int packetformat); - void blit_quads(bitmap_rgb32 &bitmap, INT32 addr, float m[4][4], INT32 base); + void blit_single_quad(bitmap_rgb32 &bitmap, uint32_t color, uint32_t addr, float m[4][4], int32_t polyshift, int flags, int packetformat); + void blit_quads(bitmap_rgb32 &bitmap, int32_t addr, float m[4][4], int32_t base); void blit_polyobject(bitmap_rgb32 &bitmap, int code, float m[4][4]); - void slavesim_handle_bb0003(const INT32 *src); - void slavesim_handle_200002(bitmap_rgb32 &bitmap, const INT32 *src); - void slavesim_handle_300000(const INT32 *src); - void slavesim_handle_233002(const INT32 *src); + void slavesim_handle_bb0003(const int32_t *src); + void slavesim_handle_200002(bitmap_rgb32 &bitmap, const int32_t *src); + void slavesim_handle_300000(const int32_t *src); + void slavesim_handle_233002(const int32_t *src); void simulate_slavedsp(bitmap_rgb32 &bitmap); - INT32 point_read(INT32 addr); + int32_t point_read(int32_t addr); void init_tables(); void update_mixer(); void update_palette(); void recalc_czram(); - void draw_direct_poly(const UINT16 *src); + void draw_direct_poly(const uint16_t *src); void draw_polygons(bitmap_rgb32 &bitmap); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void draw_sprite_group(bitmap_rgb32 &bitmap, const rectangle &cliprect, const UINT32 *src, const UINT32 *attr, int num_sprites, int deltax, int deltay, int y_lowres); + void draw_sprite_group(bitmap_rgb32 &bitmap, const rectangle &cliprect, const uint32_t *src, const uint32_t *attr, int num_sprites, int deltax, int deltay, int y_lowres); void draw_text_layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void namcos22s_mix_text_layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int prival); void namcos22_mix_text_layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -488,8 +488,8 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_MACHINE_START(adillor); - UINT32 screen_update_namcos22s(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_namcos22(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_namcos22s(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_namcos22(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(namcos22s_interrupt); INTERRUPT_GEN_MEMBER(namcos22_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(adillor_trackball_update); diff --git a/src/mame/includes/namcos86.h b/src/mame/includes/namcos86.h index 306146fa375..deebc374de6 100644 --- a/src/mame/includes/namcos86.h +++ b/src/mame/includes/namcos86.h @@ -27,19 +27,19 @@ public: required_device m_cus30; required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_rthunder_videoram1; - required_shared_ptr m_rthunder_videoram2; - required_shared_ptr m_rthunder_spriteram; - optional_region_ptr m_user1_ptr; + required_shared_ptr m_rthunder_videoram1; + required_shared_ptr m_rthunder_videoram2; + required_shared_ptr m_rthunder_spriteram; + optional_region_ptr m_user1_ptr; - UINT8 *m_spriteram; + uint8_t *m_spriteram; int m_wdog; int m_tilebank; int m_xscroll[4]; int m_yscroll[4]; tilemap_t *m_bg_tilemap[4]; int m_backcolor; - const UINT8 *m_tile_address_prom; + const uint8_t *m_tile_address_prom; int m_copy_sprites; DECLARE_WRITE8_MEMBER(bankswitch1_w); @@ -75,12 +75,12 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(namcos86); - 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); void screen_eof(screen_device &screen, bool state); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void scroll_w(address_space &space, int offset, int data, int layer); private: - inline void get_tile_info(tile_data &tileinfo,int tile_index,int layer,UINT8 *vram); + inline void get_tile_info(tile_data &tileinfo,int tile_index,int layer,uint8_t *vram); void set_scroll(int layer); }; diff --git a/src/mame/includes/naomi.h b/src/mame/includes/naomi.h index a6e62e00a5d..c9f1b7ba16d 100644 --- a/src/mame/includes/naomi.h +++ b/src/mame/includes/naomi.h @@ -47,9 +47,9 @@ class naomi_state : public dc_state m_eeprom(*this, "main_eeprom") { } /* Naomi 2 specific (To be moved) */ - optional_shared_ptr pvr2_texture_ram; - optional_shared_ptr pvr2_framebuffer_ram; - optional_shared_ptr elan_ram; + optional_shared_ptr pvr2_texture_ram; + optional_shared_ptr pvr2_framebuffer_ram; + optional_shared_ptr elan_ram; optional_device m_awflash; optional_device m_eeprom; @@ -80,15 +80,15 @@ class naomi_state : public dc_state DECLARE_READ64_MEMBER( aw_modem_r ); DECLARE_WRITE64_MEMBER( aw_modem_w ); - UINT8 m_mp_mux; + uint8_t m_mp_mux; DECLARE_CUSTOM_INPUT_MEMBER(naomi_mp_r); DECLARE_INPUT_CHANGED_MEMBER(naomi_mp_w); - inline int decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift); + inline int decode_reg32_64(uint32_t offset, uint64_t mem_mask, uint64_t *shift); - UINT8 aw_ctrl_type; + uint8_t aw_ctrl_type; - UINT8 asciihex_to_dec(UINT8 in); + uint8_t asciihex_to_dec(uint8_t in); void create_pic_from_retdat(); DECLARE_READ64_MEMBER( naomi_biose_idle_skip_r ); diff --git a/src/mame/includes/naughtyb.h b/src/mame/includes/naughtyb.h index 5e0075719b0..8f5cee055d3 100644 --- a/src/mame/includes/naughtyb.h +++ b/src/mame/includes/naughtyb.h @@ -24,16 +24,16 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_scrollreg; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_scrollreg; - UINT8 m_popflame_prot_seed; + uint8_t m_popflame_prot_seed; int m_r_index; int m_prot_count; int m_question_offset; int m_cocktail; - UINT8 m_palreg; + uint8_t m_palreg; int m_bankreg; bitmap_ind16 m_tmpbitmap; @@ -53,5 +53,5 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(naughtyb); - 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); }; diff --git a/src/mame/includes/nb1413m3.h b/src/mame/includes/nb1413m3.h index 0408c2009cc..6135130b5b6 100644 --- a/src/mame/includes/nb1413m3.h +++ b/src/mame/includes/nb1413m3.h @@ -126,7 +126,7 @@ enum { class nb1413m3_device : public device_t { public: - nb1413m3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nb1413m3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~nb1413m3_device() {} // (static) configuration helpers diff --git a/src/mame/includes/nb1414m4.h b/src/mame/includes/nb1414m4.h index 2832d6a38b2..4a3718baa33 100644 --- a/src/mame/includes/nb1414m4.h +++ b/src/mame/includes/nb1414m4.h @@ -4,10 +4,10 @@ class nb1414m4_device : public device_t, public device_video_interface { public: - nb1414m4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + nb1414m4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~nb1414m4_device() {} - void exec(UINT16 mcu_cmd, UINT8 *vram, UINT16 &scrollx, UINT16 &scrolly, tilemap_t *tilemap); + void exec(uint16_t mcu_cmd, uint8_t *vram, uint16_t &scrollx, uint16_t &scrolly, tilemap_t *tilemap); protected: // device-level overrides @@ -15,16 +15,16 @@ protected: virtual void device_reset() override; private: - void dma(UINT16 src, UINT16 dst, UINT16 size, UINT8 condition, UINT8 *vram); - void fill(UINT16 dst, UINT8 tile, UINT8 pal, UINT8 *vram); - void insert_coin_msg(UINT8 *vram); - void credit_msg(UINT8 *vram); - void kozure_score_msg(UINT16 dst, UINT8 src_base, UINT8 *vram); - void _0200(UINT16 mcu_cmd, UINT8 *vram); - void _0600(UINT8 is2p, UINT8 *vram); - void _0e00(UINT16 mcu_cmd, UINT8 *vram); + void dma(uint16_t src, uint16_t dst, uint16_t size, uint8_t condition, uint8_t *vram); + void fill(uint16_t dst, uint8_t tile, uint8_t pal, uint8_t *vram); + void insert_coin_msg(uint8_t *vram); + void credit_msg(uint8_t *vram); + void kozure_score_msg(uint16_t dst, uint8_t src_base, uint8_t *vram); + void _0200(uint16_t mcu_cmd, uint8_t *vram); + void _0600(uint8_t is2p, uint8_t *vram); + void _0e00(uint16_t mcu_cmd, uint8_t *vram); - required_region_ptr m_data; + required_region_ptr m_data; }; diff --git a/src/mame/includes/nbmj8688.h b/src/mame/includes/nbmj8688.h index c08991c7f7c..659eb7db745 100644 --- a/src/mame/includes/nbmj8688.h +++ b/src/mame/includes/nbmj8688.h @@ -42,8 +42,8 @@ public: int m_flipscreen; int m_screen_refresh; std::unique_ptr m_tmpbitmap; - std::unique_ptr m_videoram; - std::unique_ptr m_clut; + std::unique_ptr m_videoram; + std::unique_ptr m_clut; int m_flipscreen_old; emu_timer *m_blitter_timer; @@ -84,7 +84,7 @@ public: DECLARE_VIDEO_START(mbmj8688_hybrid_12bit); DECLARE_VIDEO_START(mbmj8688_pure_16bit); - 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); void vramflip(); void update_pixel(int x, int y); void writeram_low(int x, int y, int color); diff --git a/src/mame/includes/nbmj8891.h b/src/mame/includes/nbmj8891.h index fcb9f08542b..ea5c5fd1f6d 100644 --- a/src/mame/includes/nbmj8891.h +++ b/src/mame/includes/nbmj8891.h @@ -25,7 +25,7 @@ public: required_device m_nb1413m3; required_device m_screen; required_device m_palette; - optional_region_ptr m_clut_ptr; + optional_region_ptr m_clut_ptr; int m_scrolly; int m_blitter_destx; @@ -44,10 +44,10 @@ public: int m_gfxdraw_mode; bitmap_ind16 m_tmpbitmap0; bitmap_ind16 m_tmpbitmap1; - std::unique_ptr m_videoram0; - std::unique_ptr m_videoram1; - std::unique_ptr m_palette_ptr; - std::unique_ptr m_clut; + std::unique_ptr m_videoram0; + std::unique_ptr m_videoram1; + std::unique_ptr m_palette_ptr; + std::unique_ptr m_clut; int m_param_old[0x10]; int m_param_cnt; int m_flipscreen_old; @@ -89,7 +89,7 @@ public: virtual void video_start() override; DECLARE_VIDEO_START(_1layer); - 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); void vramflip(int vram); void update_pixel0(int x, int y); void update_pixel1(int x, int y); diff --git a/src/mame/includes/nbmj8900.h b/src/mame/includes/nbmj8900.h index 2a51f2ae112..d907a078475 100644 --- a/src/mame/includes/nbmj8900.h +++ b/src/mame/includes/nbmj8900.h @@ -41,10 +41,10 @@ public: int m_screen_width; bitmap_ind16 m_tmpbitmap0; bitmap_ind16 m_tmpbitmap1; - std::unique_ptr m_videoram0; - std::unique_ptr m_videoram1; - std::unique_ptr m_palette_ptr; - std::unique_ptr m_clut; + std::unique_ptr m_videoram0; + std::unique_ptr m_videoram1; + std::unique_ptr m_palette_ptr; + std::unique_ptr m_clut; int m_flipscreen_old; emu_timer *m_blitter_timer; @@ -62,7 +62,7 @@ public: DECLARE_DRIVER_INIT(ohpaipee); virtual void video_start() override; - 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); void vramflip(int vram); void update_pixel0(int x, int y); void update_pixel1(int x, int y); diff --git a/src/mame/includes/nbmj8991.h b/src/mame/includes/nbmj8991.h index 9142e9a94ef..aa173f13e78 100644 --- a/src/mame/includes/nbmj8991.h +++ b/src/mame/includes/nbmj8991.h @@ -24,7 +24,7 @@ public: required_device m_palette; optional_device m_soundlatch; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_generic_paletteram_8; enum { @@ -46,8 +46,8 @@ public: int m_clutsel; int m_screen_refresh; bitmap_ind16 m_tmpbitmap; - std::unique_ptr m_videoram; - std::unique_ptr m_clut; + std::unique_ptr m_videoram; + std::unique_ptr m_clut; int m_flipscreen_old; emu_timer *m_blitter_timer; @@ -67,8 +67,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void vramflip(); void update_pixel(int x, int y); void gfxdraw(); diff --git a/src/mame/includes/nbmj9195.h b/src/mame/includes/nbmj9195.h index ff7a918224c..c1c1b925714 100644 --- a/src/mame/includes/nbmj9195.h +++ b/src/mame/includes/nbmj9195.h @@ -37,7 +37,7 @@ public: required_device m_palette; required_device m_soundlatch; - optional_shared_ptr m_palette_ptr; //shabdama doesn't use it at least for now + optional_shared_ptr m_palette_ptr; //shabdama doesn't use it at least for now int m_inputport; int m_dipswbitsel; @@ -65,9 +65,9 @@ public: int m_nb19010_busyctr; int m_nb19010_busyflag; bitmap_ind16 m_tmpbitmap[VRAM_MAX]; - std::unique_ptr m_videoram[VRAM_MAX]; - std::unique_ptr m_videoworkram[VRAM_MAX]; - std::unique_ptr m_clut[VRAM_MAX]; + std::unique_ptr m_videoram[VRAM_MAX]; + std::unique_ptr m_videoworkram[VRAM_MAX]; + std::unique_ptr m_clut[VRAM_MAX]; int m_flipscreen_old[VRAM_MAX]; emu_timer *m_blitter_timer; @@ -104,7 +104,7 @@ public: INTERRUPT_GEN_MEMBER(ctc0_trg1); - 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); int blitter_r(int offset, int vram); void blitter_w(int offset, int data, int vram); void clut_w(int offset, int data, int vram); diff --git a/src/mame/includes/nc.h b/src/mame/includes/nc.h index 76652a70c61..1d362bcb1d2 100644 --- a/src/mame/includes/nc.h +++ b/src/mame/includes/nc.h @@ -75,7 +75,7 @@ public: DECLARE_PALETTE_INIT(nc); DECLARE_MACHINE_START(nc200); DECLARE_MACHINE_RESET(nc200); - UINT32 screen_update_nc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(nc_keyboard_timer_callback); TIMER_DEVICE_CALLBACK_MEMBER(dummy_timer_callback); DECLARE_WRITE_LINE_MEMBER(nc100_tc8521_alarm_callback); @@ -124,7 +124,7 @@ public: // HACK FOR MC6845 emu_timer *m_keyboard_timer; int m_membank_rom_mask; int m_membank_internal_ram_mask; - UINT8 m_poweroff_control; + uint8_t m_poweroff_control; int m_card_status; unsigned char m_uart_control; int m_irq_mask; @@ -134,12 +134,12 @@ public: // HACK FOR MC6845 int m_sound_channel_periods[2]; int m_previous_inputport_10_state; int m_previous_alarm_state; - UINT8 m_nc200_uart_interrupt_irq; + uint8_t m_nc200_uart_interrupt_irq; memory_region *m_card_ram; int m_membank_card_ram_mask; int m_card_size; unsigned long m_display_memory_start; - UINT8 m_type; + uint8_t m_type; int m_nc200_backlight; int m_centronics_ack; diff --git a/src/mame/includes/nemesis.h b/src/mame/includes/nemesis.h index c6f37219a07..9a9b2f51aa5 100644 --- a/src/mame/includes/nemesis.h +++ b/src/mame/includes/nemesis.h @@ -36,18 +36,18 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_charram; - required_shared_ptr m_xscroll1; - required_shared_ptr m_xscroll2; - required_shared_ptr m_yscroll2; - required_shared_ptr m_yscroll1; - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram1; - required_shared_ptr m_colorram2; - required_shared_ptr m_spriteram; - optional_shared_ptr m_paletteram; - optional_shared_ptr m_gx400_shared_ram; + required_shared_ptr m_charram; + required_shared_ptr m_xscroll1; + required_shared_ptr m_xscroll2; + required_shared_ptr m_yscroll2; + required_shared_ptr m_yscroll1; + required_shared_ptr m_videoram1; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram1; + required_shared_ptr m_colorram2; + required_shared_ptr m_spriteram; + optional_shared_ptr m_paletteram; + optional_shared_ptr m_gx400_shared_ram; /* video-related */ tilemap_t *m_background; @@ -55,18 +55,18 @@ public: int m_spriteram_words; int m_tilemap_flip; int m_flipscreen; - UINT8 m_irq_port_last; - UINT8 m_blank_tile[8*8]; - UINT8 m_palette_lookup[32]; + uint8_t m_irq_port_last; + uint8_t m_blank_tile[8*8]; + uint8_t m_palette_lookup[32]; /* misc */ int m_irq_on; int m_irq1_on; int m_irq2_on; int m_irq4_on; - UINT16 m_selected_ip; /* Copied from WEC Le Mans 24 driver, explicity needed for Hyper Crash */ + uint16_t m_selected_ip; /* Copied from WEC Le Mans 24 driver, explicity needed for Hyper Crash */ int m_gx400_irq1_cnt; - UINT8 m_frame_counter; + uint8_t m_frame_counter; /* devices */ required_device m_maincpu; @@ -113,7 +113,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_nemesis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nemesis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(nemesis_interrupt); INTERRUPT_GEN_MEMBER(blkpnthr_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(konamigt_interrupt); diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index 77f692d2740..cc64d8105d1 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -90,7 +90,7 @@ public: DECLARE_WRITE16_MEMBER(save_ram_w); DECLARE_CUSTOM_INPUT_MEMBER(kizuna4p_start_r); - UINT32 screen_update_neogeo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_neogeo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(io_control_w); DECLARE_WRITE8_MEMBER(system_control_w); @@ -123,7 +123,7 @@ protected: optional_device m_upd4990a; optional_device m_ym; required_device m_sprgen; - optional_shared_ptr m_save_ram; + optional_shared_ptr m_save_ram; required_device m_screen; optional_device m_palette; @@ -159,8 +159,8 @@ protected: virtual void video_reset() override; const pen_t *m_bg_pen; - UINT8 m_vblank_level; - UINT8 m_raster_level; + uint8_t m_vblank_level; + uint8_t m_raster_level; int m_use_cart_vectors; int m_use_cart_audio; @@ -173,7 +173,7 @@ protected: void init_ym(); void init_sprites(); // temporary helper to restore memory banking while bankswitch is handled in the driver... - UINT32 m_bank_base; + uint32_t m_bank_base; optional_device m_slot1; optional_device m_slot2; @@ -189,13 +189,13 @@ private: void update_interrupts(); void create_interrupt_timers(); void start_interrupt_timers(); - void acknowledge_interrupt(UINT16 data); + void acknowledge_interrupt(uint16_t data); void adjust_display_position_interrupt_timer(); - void set_display_position_interrupt_control(UINT16 data); - void set_display_counter_msb(UINT16 data); - void set_display_counter_lsb(UINT16 data); - void set_video_control(UINT16 data); + void set_display_position_interrupt_control(uint16_t data); + void set_display_counter_msb(uint16_t data); + void set_display_counter_lsb(uint16_t data); + void set_video_control(uint16_t data); void create_rgb_lookups(); void set_pens(); @@ -203,9 +203,9 @@ private: void set_palette_bank(int data); void audio_cpu_check_nmi(); - void set_save_ram_unlock(UINT8 data); - void set_output_latch(UINT8 data); - void set_output_data(UINT8 data); + void set_save_ram_unlock(uint8_t data); + void set_output_latch(uint8_t data); + void set_output_data(uint8_t data); // internal state bool m_recurse; @@ -213,27 +213,27 @@ private: bool m_audio_cpu_nmi_pending; // MVS-specific state - UINT8 m_save_ram_unlocked; - UINT8 m_output_data; - UINT8 m_output_latch; - UINT8 m_el_value; - UINT8 m_led1_value; - UINT8 m_led2_value; + uint8_t m_save_ram_unlocked; + uint8_t m_output_data; + uint8_t m_output_latch; + uint8_t m_el_value; + uint8_t m_led1_value; + uint8_t m_led2_value; emu_timer *m_display_position_interrupt_timer; emu_timer *m_display_position_vblank_timer; emu_timer *m_vblank_interrupt_timer; - UINT32 m_display_counter; - UINT8 m_vblank_interrupt_pending; - UINT8 m_display_position_interrupt_pending; - UINT8 m_irq3_pending; - UINT8 m_display_position_interrupt_control; + uint32_t m_display_counter; + uint8_t m_vblank_interrupt_pending; + uint8_t m_display_position_interrupt_pending; + uint8_t m_irq3_pending; + uint8_t m_display_position_interrupt_control; - UINT16 get_video_control(); + uint16_t get_video_control(); // color/palette related - std::vector m_paletteram; - UINT8 m_palette_lookup[32][4]; + std::vector m_paletteram; + uint8_t m_palette_lookup[32][4]; int m_screen_shadow; int m_palette_bank; }; diff --git a/src/mame/includes/nes.h b/src/mame/includes/nes.h index b3ba8450829..d6ce3d7761f 100644 --- a/src/mame/includes/nes.h +++ b/src/mame/includes/nes.h @@ -69,8 +69,8 @@ public: /* misc */ ioport_port *m_io_disksel; - UINT8 *m_vram; - std::unique_ptr m_ciram; //PPU nametable RAM - external to PPU! + uint8_t *m_vram; + std::unique_ptr m_ciram; //PPU nametable RAM - external to PPU! required_device m_maincpu; required_device m_ppu; @@ -95,7 +95,7 @@ public: virtual void video_start() override; virtual void video_reset() override; DECLARE_PALETTE_INIT(nes); - UINT32 screen_update_nes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); NESCTRL_BRIGHTPIXEL_CB(bright_pixel); DECLARE_DRIVER_INIT(famicom); diff --git a/src/mame/includes/newbrain.h b/src/mame/includes/newbrain.h index c3a4cef333e..d876ceb270a 100644 --- a/src/mame/includes/newbrain.h +++ b/src/mame/includes/newbrain.h @@ -50,7 +50,7 @@ public: { } - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( mreq_r ); DECLARE_WRITE8_MEMBER( mreq_w ); @@ -94,7 +94,7 @@ protected: int get_pwrup_t(); void screen_update(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void tvl(UINT8 data, int a6); + void tvl(uint8_t data, int a6); required_device m_maincpu; required_device m_cop; @@ -124,14 +124,14 @@ protected: int m_keylatch; int m_keydata; - UINT16 m_segment_data; + uint16_t m_segment_data; int m_rv; int m_fs; int m_32_40; int m_ucr; int m_80l; - UINT16 m_tvl; + uint16_t m_tvl; }; diff --git a/src/mame/includes/news.h b/src/mame/includes/news.h index e2d380a7cd3..235d3574331 100644 --- a/src/mame/includes/news.h +++ b/src/mame/includes/news.h @@ -12,8 +12,8 @@ public: m_gfxdecode(*this, "gfxdecode") { } /* memory pointers */ - required_shared_ptr m_bgram; - required_shared_ptr m_fgram; + required_shared_ptr m_bgram; + required_shared_ptr m_fgram; /* video-related */ tilemap_t *m_fg_tilemap; @@ -27,7 +27,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_news(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_news(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; diff --git a/src/mame/includes/next.h b/src/mame/includes/next.h index 09e221be65f..2ec74741a0e 100644 --- a/src/mame/includes/next.h +++ b/src/mame/includes/next.h @@ -45,9 +45,9 @@ public: required_device mo; optional_device fdc; // 040 only - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void setup(UINT32 scr1, int size_x, int size_y, int skip, bool color); + void setup(uint32_t scr1, int size_x, int size_y, int skip, bool color); DECLARE_READ8_MEMBER( io_r ); DECLARE_WRITE8_MEMBER( io_w ); @@ -76,23 +76,23 @@ public: DECLARE_WRITE32_MEMBER( timer_ctrl_w ); DECLARE_WRITE8_MEMBER( ramdac_w ); - UINT32 scr1; - UINT32 scr2; - UINT32 irq_status; - UINT32 irq_mask; + uint32_t scr1; + uint32_t scr2; + uint32_t irq_status; + uint32_t irq_mask; int irq_level; - required_shared_ptr vram; - UINT8 scsictrl, scsistat; + required_shared_ptr vram; + uint8_t scsictrl, scsistat; - UINT32 phy[2]; + uint32_t phy[2]; attotime timer_tbase; - UINT16 timer_vbase; - UINT32 timer_data, timer_next_data; - UINT32 timer_ctrl; + uint16_t timer_vbase; + uint32_t timer_data, timer_next_data; + uint32_t timer_ctrl; emu_timer *timer_tm; - UINT32 eventc_latch; + uint32_t eventc_latch; DECLARE_WRITE_LINE_MEMBER(scc_irq); DECLARE_WRITE_LINE_MEMBER(keyboard_irq); @@ -118,8 +118,8 @@ public: protected: struct dma_slot { - UINT32 start, limit, chain_start, chain_limit, current; - UINT8 state; + uint32_t start, limit, chain_start, chain_limit, current; + uint8_t state; bool supdate, restart, drq; }; @@ -147,7 +147,7 @@ protected: static const int scsi_clocks[4]; dma_slot dma_slots[0x20]; - UINT32 esp; + uint32_t esp; int screen_sx, screen_sy, screen_skip; bool screen_color; @@ -163,10 +163,10 @@ protected: void irq_set(int id, bool raise); void irq_check(); const char *dma_name(int slot); - void dma_do_ctrl_w(int slot, UINT8 data); + void dma_do_ctrl_w(int slot, uint8_t data); void dma_drq_w(int slot, bool state); - void dma_read(int slot, UINT8 &val, bool &eof, bool &err); - void dma_write(int slot, UINT8 val, bool eof, bool &err); + void dma_read(int slot, uint8_t &val, bool &eof, bool &err); + void dma_write(int slot, uint8_t val, bool eof, bool &err); void dma_check_update(int slot); void dma_check_end(int slot, bool eof); void dma_end(int slot); diff --git a/src/mame/includes/ninjakd2.h b/src/mame/includes/ninjakd2.h index a4317a54e26..0e0600d4f37 100644 --- a/src/mame/includes/ninjakd2.h +++ b/src/mame/includes/ninjakd2.h @@ -30,20 +30,20 @@ public: required_device m_soundcpu; optional_device m_pcm; optional_memory_region m_pcm_region; - optional_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_spriteram; + optional_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; - const INT16* m_sampledata; - UINT8 m_omegaf_io_protection[3]; - UINT8 m_omegaf_io_protection_input; + const int16_t* m_sampledata; + uint8_t m_omegaf_io_protection[3]; + uint8_t m_omegaf_io_protection_input; int m_omegaf_io_protection_tic; int m_next_sprite_overdraw_enabled; - int (*m_stencil_compare_function) (UINT16 pal); + int (*m_stencil_compare_function) (uint16_t pal); int m_sprites_updated; bitmap_ind16 m_sprites_bitmap; int m_robokid_sprites; @@ -52,19 +52,19 @@ public: tilemap_t* m_bg0_tilemap; tilemap_t* m_bg1_tilemap; tilemap_t* m_bg2_tilemap; - UINT8 m_vram_bank_mask; - UINT8 m_robokid_bg0_bank; - UINT8 m_robokid_bg1_bank; - UINT8 m_robokid_bg2_bank; - std::unique_ptr m_robokid_bg0_videoram; - std::unique_ptr m_robokid_bg1_videoram; - std::unique_ptr m_robokid_bg2_videoram; - UINT8 m_rom_bank_mask; + uint8_t m_vram_bank_mask; + uint8_t m_robokid_bg0_bank; + uint8_t m_robokid_bg1_bank; + uint8_t m_robokid_bg2_bank; + std::unique_ptr m_robokid_bg0_videoram; + std::unique_ptr m_robokid_bg1_videoram; + std::unique_ptr m_robokid_bg2_videoram; + uint8_t m_rom_bank_mask; void omegaf_io_protection_start(); void omegaf_io_protection_reset(); - void robokid_motion_error_kludge(UINT16 offset); - void video_init_common(UINT32 vram_alloc_size); + void robokid_motion_error_kludge(uint16_t offset); + void video_init_common(uint32_t vram_alloc_size); DECLARE_WRITE8_MEMBER(ninjakd2_bankselect_w); DECLARE_WRITE8_MEMBER(ninjakd2_soundreset_w); @@ -111,12 +111,12 @@ public: DECLARE_MACHINE_START(omegaf); DECLARE_MACHINE_RESET(omegaf); DECLARE_VIDEO_START(omegaf); - UINT32 screen_update_ninjakd2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_robokid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_omegaf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ninjakd2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_robokid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_omegaf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_ninjakd2(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(ninjakd2_interrupt); - void robokid_get_bg_tile_info( tile_data& tileinfo, tilemap_memory_index const tile_index, int const gfxnum, const UINT8* const videoram); + void robokid_get_bg_tile_info( tile_data& tileinfo, tilemap_memory_index const tile_index, int const gfxnum, const uint8_t* const videoram); void bg_ctrl(int offset, int data, tilemap_t* tilemap); void draw_sprites( bitmap_ind16 &bitmap); void erase_sprites( bitmap_ind16 &bitmap); diff --git a/src/mame/includes/ninjaw.h b/src/mame/includes/ninjaw.h index 2c1dc94e902..74d6ee715e7 100644 --- a/src/mame/includes/ninjaw.h +++ b/src/mame/includes/ninjaw.h @@ -55,10 +55,10 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; /* misc */ - UINT16 m_cpua_ctrl; + uint16_t m_cpua_ctrl; int m_pandata[4]; DECLARE_WRITE16_MEMBER(cpua_ctrl_w); @@ -71,11 +71,11 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void postload(); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int primask, int x_offs, int y_offs ); void parse_control( ); - UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs, tc0100scn_device *tc0100scn); + uint32_t update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs, tc0100scn_device *tc0100scn); }; diff --git a/src/mame/includes/nitedrvr.h b/src/mame/includes/nitedrvr.h index 7084c08c077..d4b2e9aa5fd 100644 --- a/src/mame/includes/nitedrvr.h +++ b/src/mame/includes/nitedrvr.h @@ -30,22 +30,22 @@ public: m_palette(*this, "palette"){ } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_hvc; + required_shared_ptr m_videoram; + required_shared_ptr m_hvc; /* video-related */ tilemap_t *m_bg_tilemap; /* input */ - UINT8 m_gear; - UINT8 m_track; - INT32 m_steering_buf; - INT32 m_steering_val; - UINT8 m_crash_en; - UINT8 m_crash_data; - UINT8 m_crash_data_en; // IC D8 - UINT8 m_ac_line; - INT32 m_last_steering_val; + uint8_t m_gear; + uint8_t m_track; + int32_t m_steering_buf; + int32_t m_steering_val; + uint8_t m_crash_en; + uint8_t m_crash_data; + uint8_t m_crash_data_en; // IC D8 + uint8_t m_ac_line; + int32_t m_last_steering_val; /* devices */ required_device m_maincpu; @@ -64,7 +64,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_nitedrvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nitedrvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(nitedrvr_crash_toggle_callback); void draw_box(bitmap_ind16 &bitmap, const rectangle &cliprect, int bx, int by, int ex, int ey); void draw_roadway(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/niyanpai.h b/src/mame/includes/niyanpai.h index 46fe555a6e8..8284f247264 100644 --- a/src/mame/includes/niyanpai.h +++ b/src/mame/includes/niyanpai.h @@ -47,17 +47,17 @@ public: int m_nb19010_busyctr; int m_nb19010_busyflag; bitmap_ind16 m_tmpbitmap[VRAM_MAX]; - std::unique_ptr m_videoram[VRAM_MAX]; - std::unique_ptr m_videoworkram[VRAM_MAX]; - std::unique_ptr m_palette_ptr; - std::unique_ptr m_clut[VRAM_MAX]; + std::unique_ptr m_videoram[VRAM_MAX]; + std::unique_ptr m_videoworkram[VRAM_MAX]; + std::unique_ptr m_palette_ptr; + std::unique_ptr m_clut[VRAM_MAX]; int m_flipscreen_old[VRAM_MAX]; emu_timer *m_blitter_timer; // musobana and derived machine configs int m_musobana_inputport; int m_musobana_outcoin_flag; - UINT8 m_motor_on; + uint8_t m_motor_on; // common DECLARE_WRITE8_MEMBER(soundbank_w); @@ -89,11 +89,11 @@ public: virtual void video_start() override; DECLARE_MACHINE_START(musobana); - 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); int blitter_r(int vram, int offset); - void blitter_w(int vram, int offset, UINT8 data); - void clutsel_w(int vram, UINT8 data); - void clut_w(int vram, int offset, UINT8 data); + void blitter_w(int vram, int offset, uint8_t data); + void clutsel_w(int vram, uint8_t data); + void clut_w(int vram, int offset, uint8_t data); void vramflip(int vram); void update_pixel(int vram, int x, int y); void gfxdraw(int vram); diff --git a/src/mame/includes/nmk16.h b/src/mame/includes/nmk16.h index 91fd9563305..982192ba741 100644 --- a/src/mame/includes/nmk16.h +++ b/src/mame/includes/nmk16.h @@ -44,30 +44,30 @@ public: optional_device m_nmk004; optional_device m_soundlatch; - required_shared_ptr m_nmk_bgvideoram0; - optional_shared_ptr m_nmk_txvideoram; - required_shared_ptr m_mainram; - optional_shared_ptr m_gunnail_scrollram; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_nmk_fgvideoram; - optional_shared_ptr m_gunnail_scrollramy; - optional_shared_ptr m_nmk_bgvideoram1; - optional_shared_ptr m_nmk_bgvideoram2; - optional_shared_ptr m_nmk_bgvideoram3; - optional_shared_ptr m_afega_scroll_0; - optional_shared_ptr m_afega_scroll_1; + required_shared_ptr m_nmk_bgvideoram0; + optional_shared_ptr m_nmk_txvideoram; + required_shared_ptr m_mainram; + optional_shared_ptr m_gunnail_scrollram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_nmk_fgvideoram; + optional_shared_ptr m_gunnail_scrollramy; + optional_shared_ptr m_nmk_bgvideoram1; + optional_shared_ptr m_nmk_bgvideoram2; + optional_shared_ptr m_nmk_bgvideoram3; + optional_shared_ptr m_afega_scroll_0; + optional_shared_ptr m_afega_scroll_1; int m_sprdma_base; int mask[4*2]; int m_simple_scroll; int m_redraw_bitmap; - std::unique_ptr m_spriteram_old; - std::unique_ptr m_spriteram_old2; + std::unique_ptr m_spriteram_old; + std::unique_ptr m_spriteram_old2; int m_bgbank; int m_videoshift; int m_bioship_background_bank; - UINT8 m_bioship_scroll[4]; + uint8_t m_bioship_scroll[4]; tilemap_t *m_bg_tilemap0; tilemap_t *m_bg_tilemap1; tilemap_t *m_bg_tilemap2; @@ -76,14 +76,14 @@ public: tilemap_t *m_fg_tilemap; std::unique_ptr m_background_bitmap; int m_mustang_bg_xscroll; - UINT8 m_scroll[4]; - UINT8 m_scroll_2[4]; - UINT16 m_vscroll[4]; + uint8_t m_scroll[4]; + uint8_t m_scroll_2[4]; + uint16_t m_vscroll[4]; int m_prot_count; - UINT8 m_input_pressed; - UINT8 m_start_helper; - UINT8 m_coin_count[2]; - UINT8 m_coin_count_frac[2]; + uint8_t m_input_pressed; + uint8_t m_start_helper; + uint8_t m_coin_count[2]; + uint8_t m_coin_count_frac[2]; DECLARE_WRITE16_MEMBER(nmk16_mainram_strange_w); DECLARE_WRITE16_MEMBER(ssmissin_sound_w); DECLARE_WRITE8_MEMBER(ssmissin_soundbank_w); @@ -158,26 +158,26 @@ public: DECLARE_VIDEO_START(afega); DECLARE_VIDEO_START(firehawk); DECLARE_VIDEO_START(grdnstrm); - UINT32 screen_update_tharrier(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_manybloc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_macross(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bioship(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_strahl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gunnail(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tdragon2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bjtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_afega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_firehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_redhawki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_redhawkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tharrier(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_manybloc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_macross(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bioship(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_strahl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gunnail(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tdragon2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bjtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_afega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_firehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_redhawki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_redhawkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(tdragon_mcu_sim); TIMER_DEVICE_CALLBACK_MEMBER(hachamf_mcu_sim); TIMER_DEVICE_CALLBACK_MEMBER(nmk16_scanline); TIMER_DEVICE_CALLBACK_MEMBER(manybloc_scanline); void nmk16_video_init(); - inline void nmk16_draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *spr); - inline void nmk16_draw_sprite_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *spr); + inline void nmk16_draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *spr); + inline void nmk16_draw_sprite_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *spr); void nmk16_draw_sprites_swap(bitmap_ind16 &bitmap, const rectangle &cliprect, int *bittbl); void nmk16_draw_sprites_swap_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, int *bittbl); void nmk16_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -192,11 +192,11 @@ public: int nmk16_complexbg_sprswap_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bittbl[8]); void video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect,int dsw_flipscreen,int xoffset, int yoffset,int attr_mask); void redhawki_video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); - void mcu_run(UINT8 dsw_setting); - UINT8 decode_byte(UINT8 src, const UINT8 *bitp); - UINT32 bjtwin_address_map_bg0(UINT32 addr); - UINT16 decode_word(UINT16 src, const UINT8 *bitp); - UINT32 bjtwin_address_map_sprites(UINT32 addr); + void mcu_run(uint8_t dsw_setting); + uint8_t decode_byte(uint8_t src, const uint8_t *bitp); + uint32_t bjtwin_address_map_bg0(uint32_t addr); + uint16_t decode_word(uint16_t src, const uint8_t *bitp); + uint32_t bjtwin_address_map_sprites(uint32_t addr); void decode_gfx(); void decode_tdragonb(); void decode_ssmissin(); diff --git a/src/mame/includes/norautp.h b/src/mame/includes/norautp.h index 0053087ec91..02d95c3e0c1 100644 --- a/src/mame/includes/norautp.h +++ b/src/mame/includes/norautp.h @@ -18,8 +18,8 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - std::unique_ptr m_np_vram; - UINT16 m_np_addr; + std::unique_ptr m_np_vram; + uint16_t m_np_addr; DECLARE_READ8_MEMBER(test_r); DECLARE_READ8_MEMBER(vram_data_r); DECLARE_WRITE8_MEMBER(vram_data_w); @@ -33,7 +33,7 @@ public: DECLARE_DRIVER_INIT(deb); virtual void video_start() override; DECLARE_PALETTE_INIT(norautp); - UINT32 screen_update_norautp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_norautp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_discrete; required_device m_gfxdecode; diff --git a/src/mame/includes/nova2001.h b/src/mame/includes/nova2001.h index fc430e8aaac..7a994cd41a7 100644 --- a/src/mame/includes/nova2001.h +++ b/src/mame/includes/nova2001.h @@ -16,11 +16,11 @@ public: required_device m_gfxdecode; required_device m_palette; - optional_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; - optional_shared_ptr m_spriteram; + optional_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + optional_shared_ptr m_spriteram; - UINT8 m_ninjakun_io_a002_ctrl; + uint8_t m_ninjakun_io_a002_ctrl; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -56,10 +56,10 @@ public: TILE_GET_INFO_MEMBER(raiders5_get_bg_tile_info); TILE_GET_INFO_MEMBER(raiders5_get_fg_tile_info); - UINT32 screen_update_nova2001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ninjakun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pkunwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_raiders5(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nova2001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ninjakun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pkunwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_raiders5(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void nova2001_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); void pkunwar_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); void lineswap_gfx_roms(const char *region, const int bit); diff --git a/src/mame/includes/nycaptor.h b/src/mame/includes/nycaptor.h index cd6e03f18b3..87f30a9459b 100644 --- a/src/mame/includes/nycaptor.h +++ b/src/mame/includes/nycaptor.h @@ -23,39 +23,39 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_scrlram; - required_shared_ptr m_sharedram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_scrlram; + required_shared_ptr m_sharedram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; - std::vector m_paletteram; - std::vector m_paletteram_ext; - UINT8 m_gfxctrl; - UINT8 m_char_bank; - UINT8 m_palette_bank; + std::vector m_paletteram; + std::vector m_paletteram_ext; + uint8_t m_gfxctrl; + uint8_t m_char_bank; + uint8_t m_palette_bank; /* mcu */ - UINT8 m_from_main; - UINT8 m_from_mcu; + uint8_t m_from_main; + uint8_t m_from_mcu; int m_mcu_sent; int m_main_sent; - 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_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; /* misc */ int m_generic_control_reg; int m_sound_nmi_enable; int m_pending_nmi; - UINT8 m_snd_data; + uint8_t m_snd_data; int m_vol_ctrl[16]; int m_gametype; int m_mask; @@ -117,7 +117,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_MACHINE_RESET(ta7630); - UINT32 screen_update_nycaptor(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nycaptor(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(nmi_callback); int nycaptor_spot( ); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ); diff --git a/src/mame/includes/offtwall.h b/src/mame/includes/offtwall.h index cc10b135c80..ee7cda3599b 100644 --- a/src/mame/includes/offtwall.h +++ b/src/mame/includes/offtwall.h @@ -22,14 +22,14 @@ public: required_device m_jsa; required_device m_vad; - required_shared_ptr m_mainram; + required_shared_ptr m_mainram; - UINT16 *m_bankswitch_base; - required_shared_ptr m_bankrom_base; - UINT32 m_bank_offset; + uint16_t *m_bankswitch_base; + required_shared_ptr m_bankrom_base; + uint32_t m_bank_offset; - UINT16 *m_spritecache_count; - UINT16 *m_unknown_verify_base; + uint16_t *m_spritecache_count; + uint16_t *m_unknown_verify_base; virtual void update_interrupts() override; DECLARE_WRITE16_MEMBER(io_latch_w); DECLARE_READ16_MEMBER(bankswitch_r); @@ -42,7 +42,7 @@ public: DECLARE_MACHINE_START(offtwall); DECLARE_MACHINE_RESET(offtwall); DECLARE_VIDEO_START(offtwall); - UINT32 screen_update_offtwall(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_offtwall(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; }; diff --git a/src/mame/includes/ohmygod.h b/src/mame/includes/ohmygod.h index 86986de1b99..0ce18c4c42a 100644 --- a/src/mame/includes/ohmygod.h +++ b/src/mame/includes/ohmygod.h @@ -19,14 +19,14 @@ public: /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; int m_spritebank; - UINT16 m_scrollx; - UINT16 m_scrolly; + uint16_t m_scrollx; + uint16_t m_scrolly; /* misc */ int m_adpcm_bank_shift; @@ -42,7 +42,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_ohmygod(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ohmygod(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/ojankohs.h b/src/mame/includes/ojankohs.h index 65c7e36bd9c..b9b516b0982 100644 --- a/src/mame/includes/ojankohs.h +++ b/src/mame/includes/ojankohs.h @@ -22,9 +22,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - optional_shared_ptr m_videoram; - optional_shared_ptr m_colorram; - optional_shared_ptr m_paletteram; + optional_shared_ptr m_videoram; + optional_shared_ptr m_colorram; + optional_shared_ptr m_paletteram; /* video-related */ tilemap_t *m_tilemap; @@ -82,8 +82,8 @@ public: DECLARE_MACHINE_START(ojankoc); DECLARE_VIDEO_START(ojankoc); DECLARE_MACHINE_START(common); - UINT32 screen_update_ojankohs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ojankoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ojankohs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ojankoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void ojankoc_flipscreen( address_space &space, int data ); DECLARE_WRITE_LINE_MEMBER(ojankohs_adpcm_int); }; diff --git a/src/mame/includes/ondra.h b/src/mame/includes/ondra.h index 9277b907e4f..4fc82d2d68e 100644 --- a/src/mame/includes/ondra.h +++ b/src/mame/includes/ondra.h @@ -36,9 +36,9 @@ public: m_line9(*this, "LINE9"), m_nmi(*this, "NMI") { } - UINT8 m_video_enable; - UINT8 m_bank1_status; - UINT8 m_bank2_status; + uint8_t m_video_enable; + uint8_t m_bank1_status; + uint8_t m_bank2_status; DECLARE_READ8_MEMBER(ondra_keyboard_r); DECLARE_WRITE8_MEMBER(ondra_port_03_w); DECLARE_WRITE8_MEMBER(ondra_port_09_w); @@ -46,7 +46,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_ondra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ondra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ondra_interrupt); TIMER_CALLBACK_MEMBER(nmi_check_callback); diff --git a/src/mame/includes/oneshot.h b/src/mame/includes/oneshot.h index c7f854e6a09..2927aadb924 100644 --- a/src/mame/includes/oneshot.h +++ b/src/mame/includes/oneshot.h @@ -18,11 +18,11 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_sprites; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_mid_videoram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_scroll; + required_shared_ptr m_sprites; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_mid_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_scroll; /* video-related */ tilemap_t *m_bg_tilemap; @@ -55,8 +55,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_oneshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_maddonna(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_oneshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_maddonna(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_crosshairs( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_oki; diff --git a/src/mame/includes/opwolf.h b/src/mame/includes/opwolf.h index 7af0612212b..886518bbddb 100644 --- a/src/mame/includes/opwolf.h +++ b/src/mame/includes/opwolf.h @@ -29,17 +29,17 @@ public: m_msm2(*this, "msm2") { } /* memory pointers */ - optional_shared_ptr m_cchip_ram; + optional_shared_ptr m_cchip_ram; /* video-related */ - UINT16 m_sprite_ctrl; - UINT16 m_sprites_flipscreen; + uint16_t m_sprite_ctrl; + uint16_t m_sprites_flipscreen; /* misc */ - UINT8 m_adpcm_b[0x08]; - UINT8 m_adpcm_c[0x08]; - UINT32 m_adpcm_pos[2]; - UINT32 m_adpcm_end[2]; + uint8_t m_adpcm_b[0x08]; + uint8_t m_adpcm_c[0x08]; + uint32_t m_adpcm_pos[2]; + uint32_t m_adpcm_end[2]; int m_adpcm_data[2]; int m_opwolf_gun_xoffs; @@ -50,28 +50,28 @@ public: int m_opwolf_region; - UINT8 m_current_bank; - UINT8 m_current_cmd; - UINT8 m_cchip_last_7a; - UINT8 m_cchip_last_04; - UINT8 m_cchip_last_05; - UINT8 m_cchip_coins_for_credit[2]; - UINT8 m_cchip_credits_for_coin[2]; - UINT8 m_cchip_coins[2]; - UINT8 m_c588; - UINT8 m_c589; - UINT8 m_c58a; // These variables derived from the bootleg - UINT8 m_triggeredLevel1b; // These variables derived from comparison to unprotection version - UINT8 m_triggeredLevel2; - UINT8 m_triggeredLevel2b; - UINT8 m_triggeredLevel2c; - UINT8 m_triggeredLevel3b; - UINT8 m_triggeredLevel13b; - UINT8 m_triggeredLevel4; - UINT8 m_triggeredLevel5; - UINT8 m_triggeredLevel7; - UINT8 m_triggeredLevel8; - UINT8 m_triggeredLevel9; + uint8_t m_current_bank; + uint8_t m_current_cmd; + uint8_t m_cchip_last_7a; + uint8_t m_cchip_last_04; + uint8_t m_cchip_last_05; + uint8_t m_cchip_coins_for_credit[2]; + uint8_t m_cchip_credits_for_coin[2]; + uint8_t m_cchip_coins[2]; + uint8_t m_c588; + uint8_t m_c589; + uint8_t m_c58a; // These variables derived from the bootleg + uint8_t m_triggeredLevel1b; // These variables derived from comparison to unprotection version + uint8_t m_triggeredLevel2; + uint8_t m_triggeredLevel2b; + uint8_t m_triggeredLevel2c; + uint8_t m_triggeredLevel3b; + uint8_t m_triggeredLevel13b; + uint8_t m_triggeredLevel4; + uint8_t m_triggeredLevel5; + uint8_t m_triggeredLevel7; + uint8_t m_triggeredLevel8; + uint8_t m_triggeredLevel9; /* devices */ required_device m_maincpu; @@ -109,7 +109,7 @@ public: virtual void machine_start() override; DECLARE_MACHINE_RESET(opwolf); - UINT32 screen_update_opwolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_opwolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(opwolf_timer_callback); TIMER_CALLBACK_MEMBER(cchip_timer); void updateDifficulty( int mode ); diff --git a/src/mame/includes/orao.h b/src/mame/includes/orao.h index 3fbb3ea2d81..32162df0a4f 100644 --- a/src/mame/includes/orao.h +++ b/src/mame/includes/orao.h @@ -31,16 +31,16 @@ public: DECLARE_DRIVER_INIT(orao103); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_orao(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_orao(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); private: - required_shared_ptr m_memory; - required_shared_ptr m_video_ram; + required_shared_ptr m_memory; + required_shared_ptr m_video_ram; required_device m_maincpu; required_device m_speaker; required_device m_cassette; required_ioport_array<20> m_line; - UINT8 m_beep; + uint8_t m_beep; }; #endif /* ORAO_H_ */ diff --git a/src/mame/includes/orbit.h b/src/mame/includes/orbit.h index 1095f531f04..603f7cfdee9 100644 --- a/src/mame/includes/orbit.h +++ b/src/mame/includes/orbit.h @@ -31,8 +31,8 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_playfield_ram; - required_shared_ptr m_sprite_ram; + required_shared_ptr m_playfield_ram; + required_shared_ptr m_sprite_ram; required_device m_discrete; @@ -41,7 +41,7 @@ public: int m_flip_screen; /* misc */ - UINT8 m_misc_flags; + uint8_t m_misc_flags; /* devices */ required_device m_maincpu; @@ -55,7 +55,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_orbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_orbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(orbit_interrupt); TIMER_CALLBACK_MEMBER(irq_off); TIMER_DEVICE_CALLBACK_MEMBER(nmi_32v); @@ -64,7 +64,7 @@ public: DECLARE_WRITE8_MEMBER(orbit_noise_amp_w); DECLARE_WRITE8_MEMBER(orbit_noise_rst_w); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void update_misc_flags(address_space &space, UINT8 val); + void update_misc_flags(address_space &space, uint8_t val); }; /*----------- defined in audio/orbit.c -----------*/ diff --git a/src/mame/includes/orion.h b/src/mame/includes/orion.h index 5d6a57058be..6dbd390b2b1 100644 --- a/src/mame/includes/orion.h +++ b/src/mame/includes/orion.h @@ -44,24 +44,24 @@ public: , m_bank8(*this, "bank8") { } - UINT8 m_orion128_video_mode; - UINT8 m_orion128_video_page; - UINT8 m_orion128_video_width; - UINT8 m_video_mode_mask; - UINT8 m_orionpro_pseudo_color; - UINT8 m_romdisk_lsb; - UINT8 m_romdisk_msb; - UINT8 m_orion128_memory_page; - UINT8 m_orionz80_memory_page; - UINT8 m_orionz80_dispatcher; - UINT8 m_speaker_data; - UINT8 m_orionpro_ram0_segment; - UINT8 m_orionpro_ram1_segment; - UINT8 m_orionpro_ram2_segment; - UINT8 m_orionpro_page; - UINT8 m_orionpro_128_page; - UINT8 m_orionpro_rom2_segment; - UINT8 m_orionpro_dispatcher; + uint8_t m_orion128_video_mode; + uint8_t m_orion128_video_page; + uint8_t m_orion128_video_width; + uint8_t m_video_mode_mask; + uint8_t m_orionpro_pseudo_color; + uint8_t m_romdisk_lsb; + uint8_t m_romdisk_msb; + uint8_t m_orion128_memory_page; + uint8_t m_orionz80_memory_page; + uint8_t m_orionz80_dispatcher; + uint8_t m_speaker_data; + uint8_t m_orionpro_ram0_segment; + uint8_t m_orionpro_ram1_segment; + uint8_t m_orionpro_ram2_segment; + uint8_t m_orionpro_page; + uint8_t m_orionpro_128_page; + uint8_t m_orionpro_rom2_segment; + uint8_t m_orionpro_dispatcher; required_device m_fdc; @@ -93,7 +93,7 @@ public: DECLARE_MACHINE_START(orionz80); DECLARE_MACHINE_RESET(orionz80); DECLARE_MACHINE_RESET(orionpro); - UINT32 screen_update_orion128(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_orion128(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(orionz80_interrupt); DECLARE_READ8_MEMBER(orion_romdisk_porta_r); DECLARE_WRITE8_MEMBER(orion_romdisk_portb_w); diff --git a/src/mame/includes/osborne1.h b/src/mame/includes/osborne1.h index 6414cfa84c8..bbe12f9efcb 100644 --- a/src/mame/includes/osborne1.h +++ b/src/mame/includes/osborne1.h @@ -84,7 +84,7 @@ public: DECLARE_DRIVER_INIT(osborne1); virtual void machine_reset() override; virtual void video_start() override; - 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); required_device m_maincpu; required_device m_gfxdecode; @@ -104,8 +104,8 @@ protected: TILE_GET_INFO_MEMBER(get_tile_info); - bool set_rom_mode(UINT8 value); - bool set_bit_9(UINT8 value); + bool set_rom_mode(uint8_t value); + bool set_bit_9(uint8_t value); void update_irq(); void update_acia_rxc_txc(); @@ -130,33 +130,33 @@ protected: required_memory_bank m_bank_fxxx; // configuration (reloaded on reset) - UINT8 m_screen_pac; - UINT8 m_acia_rxc_txc_div; - UINT8 m_acia_rxc_txc_p_low; - UINT8 m_acia_rxc_txc_p_high; + uint8_t m_screen_pac; + uint8_t m_acia_rxc_txc_div; + uint8_t m_acia_rxc_txc_p_low; + uint8_t m_acia_rxc_txc_p_high; // bank switch control bits - UINT8 m_ub4a_q; - UINT8 m_ub6a_q; - UINT8 m_rom_mode; - UINT8 m_bit_9; + uint8_t m_ub4a_q; + uint8_t m_ub6a_q; + uint8_t m_rom_mode; + uint8_t m_bit_9; // onboard video state - UINT8 m_scroll_x; - UINT8 m_scroll_y; - UINT8 m_beep_state; + uint8_t m_scroll_x; + uint8_t m_scroll_y; + uint8_t m_beep_state; emu_timer *m_video_timer; bitmap_ind16 m_bitmap; - UINT8 *m_p_chargen; + uint8_t *m_p_chargen; tilemap_t *m_tilemap; // SCREEN-PAC registers - UINT8 m_resolution; - UINT8 m_hc_left; + uint8_t m_resolution; + uint8_t m_hc_left; // serial state - UINT8 m_acia_irq_state; - UINT8 m_acia_rxc_txc_state; + uint8_t m_acia_irq_state; + uint8_t m_acia_rxc_txc_state; emu_timer *m_acia_rxc_txc_timer; }; diff --git a/src/mame/includes/osi.h b/src/mame/includes/osi.h index 43485a7a5f4..783159cd634 100644 --- a/src/mame/includes/osi.h +++ b/src/mame/includes/osi.h @@ -53,7 +53,7 @@ public: { } - 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); DECLARE_READ8_MEMBER( keyboard_r ); DECLARE_WRITE8_MEMBER( keyboard_w ); DECLARE_WRITE8_MEMBER( ctrl_w ); @@ -79,8 +79,8 @@ protected: required_device m_cassette; optional_device m_discrete; required_device m_ram; - required_shared_ptr m_video_ram; - optional_shared_ptr m_color_ram; + required_shared_ptr m_video_ram; + optional_shared_ptr m_color_ram; required_ioport m_io_row0; required_ioport m_io_row1; required_ioport m_io_row2; @@ -97,12 +97,12 @@ protected: int m_fdc_index; /* keyboard state */ - UINT8 m_keylatch; + uint8_t m_keylatch; /* video state */ int m_32; int m_coloren; - UINT8 *m_p_chargen; + uint8_t *m_p_chargen; }; class c1p_state : public sb2m600_state @@ -153,7 +153,7 @@ public: { } - 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); DECLARE_WRITE8_MEMBER( keyboard_w ); }; diff --git a/src/mame/includes/othunder.h b/src/mame/includes/othunder.h index 85bd575a0de..78e285c3d76 100644 --- a/src/mame/includes/othunder.h +++ b/src/mame/includes/othunder.h @@ -53,7 +53,7 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; /* video-related */ std::unique_ptr m_spritelist; @@ -92,7 +92,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_othunder(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_othunder(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_interrupt); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, const int *primasks, int y_offs ); void update_irq(); diff --git a/src/mame/includes/overdriv.h b/src/mame/includes/overdriv.h index dcace237863..df834582529 100644 --- a/src/mame/includes/overdriv.h +++ b/src/mame/includes/overdriv.h @@ -33,7 +33,7 @@ public: int m_sprite_colorbase; /* misc */ - UINT16 m_cpuB_ctrl; + uint16_t m_cpuB_ctrl; /* devices */ required_device m_maincpu; @@ -58,7 +58,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_overdriv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_overdriv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); //INTERRUPT_GEN_MEMBER(cpuB_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(overdriv_cpuA_scanline); int m_fake_timer; diff --git a/src/mame/includes/p2000t.h b/src/mame/includes/p2000t.h index c2a04d3e1aa..7b8a895d343 100644 --- a/src/mame/includes/p2000t.h +++ b/src/mame/includes/p2000t.h @@ -33,7 +33,7 @@ public: required_device m_speaker; optional_device m_gfxdecode; optional_device m_palette; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; required_ioport_array<10> m_keyboard; DECLARE_READ8_MEMBER(p2000t_port_000f_r); DECLARE_READ8_MEMBER(p2000t_port_202f_r); @@ -45,14 +45,14 @@ public: DECLARE_WRITE8_MEMBER(p2000t_port_8c90_w); DECLARE_WRITE8_MEMBER(p2000t_port_9494_w); DECLARE_READ8_MEMBER(videoram_r); - UINT8 m_port_101f; - UINT8 m_port_202f; - UINT8 m_port_303f; - UINT8 m_port_707f; - INT8 m_frame_count; + uint8_t m_port_101f; + uint8_t m_port_202f; + uint8_t m_port_303f; + uint8_t m_port_707f; + int8_t m_frame_count; DECLARE_VIDEO_START(p2000m); DECLARE_PALETTE_INIT(p2000m); - UINT32 screen_update_p2000m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_p2000m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(p2000_interrupt); }; diff --git a/src/mame/includes/pacland.h b/src/mame/includes/pacland.h index 9c4eee41deb..5748c13a002 100644 --- a/src/mame/includes/pacland.h +++ b/src/mame/includes/pacland.h @@ -24,20 +24,20 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_spriteram; - UINT8 m_palette_bank; - const UINT8 *m_color_prom; + uint8_t m_palette_bank; + const uint8_t *m_color_prom; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; bitmap_ind16 m_fg_bitmap; - std::unique_ptr m_transmask[3]; - UINT16 m_scroll0; - UINT16 m_scroll1; - UINT8 m_main_irq_mask; - UINT8 m_mcu_irq_mask; + std::unique_ptr m_transmask[3]; + uint16_t m_scroll0; + uint16_t m_scroll1; + uint8_t m_main_irq_mask; + uint8_t m_mcu_irq_mask; DECLARE_WRITE8_MEMBER(subreset_w); DECLARE_WRITE8_MEMBER(flipscreen_w); @@ -63,7 +63,7 @@ public: INTERRUPT_GEN_MEMBER(main_vblank_irq); INTERRUPT_GEN_MEMBER(mcu_vblank_irq); - 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); void switch_palette(); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flip, int whichmask); void draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); diff --git a/src/mame/includes/pacman.h b/src/mame/includes/pacman.h index d62272914f5..e9e15c4b938 100644 --- a/src/mame/includes/pacman.h +++ b/src/mame/includes/pacman.h @@ -29,32 +29,32 @@ public: required_device m_maincpu; optional_device m_namco_sound; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; - optional_shared_ptr m_s2650_spriteram; - required_shared_ptr m_videoram; - optional_shared_ptr m_colorram; - optional_shared_ptr m_s2650games_tileram; - optional_shared_ptr m_rocktrv2_prot_data; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram2; + optional_shared_ptr m_s2650_spriteram; + required_shared_ptr m_videoram; + optional_shared_ptr m_colorram; + optional_shared_ptr m_s2650games_tileram; + optional_shared_ptr m_rocktrv2_prot_data; required_device m_gfxdecode; required_device m_palette; - optional_shared_ptr m_patched_opcodes; + optional_shared_ptr m_patched_opcodes; - UINT8 m_cannonb_bit_to_read; + uint8_t m_cannonb_bit_to_read; int m_mystery; - UINT8 m_counter; + uint8_t m_counter; int m_bigbucks_bank; - UINT8 m_rocktrv2_question_bank; + uint8_t m_rocktrv2_question_bank; tilemap_t *m_bg_tilemap; - UINT8 m_charbank; - UINT8 m_spritebank; - UINT8 m_palettebank; - UINT8 m_colortablebank; - UINT8 m_flipscreen; - UINT8 m_bgpriority; + uint8_t m_charbank; + uint8_t m_spritebank; + uint8_t m_palettebank; + uint8_t m_colortablebank; + uint8_t m_flipscreen; + uint8_t m_bgpriority; int m_xoffsethack; - UINT8 m_inv_spr; - UINT8 m_irq_mask; + uint8_t m_inv_spr; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(pacman_interrupt_vector_w); DECLARE_WRITE8_MEMBER(piranha_interrupt_vector_w); @@ -143,8 +143,8 @@ public: DECLARE_MACHINE_RESET(superabc); DECLARE_VIDEO_START(pengo); DECLARE_VIDEO_START(jrpacman); - UINT32 screen_update_pacman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_s2650games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pacman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_s2650games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(vblank_nmi); INTERRUPT_GEN_MEMBER(s2650_interrupt); @@ -152,8 +152,8 @@ public: void jrpacman_mark_tile_dirty( int offset ); void maketrax_rom_decode(); void korosuke_rom_decode(); - void eyes_decode(UINT8 *data); - void mspacman_install_patches(UINT8 *ROM); + void eyes_decode(uint8_t *data); + void mspacman_install_patches(uint8_t *ROM); // theglopb.c void theglobp_decrypt_rom_8(); @@ -165,11 +165,11 @@ public: DECLARE_MACHINE_RESET(theglobp); // pacplus.c - UINT8 pacplus_decrypt(int addr, UINT8 e); + uint8_t pacplus_decrypt(int addr, uint8_t e); void pacplus_decode(); // jumpshot.c - UINT8 jumpshot_decrypt(int addr, UINT8 e); + uint8_t jumpshot_decrypt(int addr, uint8_t e); void jumpshot_decode(); // acitya.c diff --git a/src/mame/includes/pandoras.h b/src/mame/includes/pandoras.h index 8fb440f473f..40bdc82a29f 100644 --- a/src/mame/includes/pandoras.h +++ b/src/mame/includes/pandoras.h @@ -22,9 +22,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; /* video-related */ tilemap_t *m_layer0; @@ -61,8 +61,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(pandoras); - UINT32 screen_update_pandoras(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pandoras(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pandoras_master_interrupt); INTERRUPT_GEN_MEMBER(pandoras_slave_interrupt); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8* sr ); + void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* sr ); }; diff --git a/src/mame/includes/paradise.h b/src/mame/includes/paradise.h index 0d63f4f3ee0..8558f817ebd 100644 --- a/src/mame/includes/paradise.h +++ b/src/mame/includes/paradise.h @@ -27,12 +27,12 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_vram_2; - required_shared_ptr m_videoram; - required_shared_ptr m_paletteram; - required_shared_ptr m_spriteram; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_vram_2; + required_shared_ptr m_videoram; + required_shared_ptr m_paletteram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_tilemap_0; @@ -40,9 +40,9 @@ public: tilemap_t *m_tilemap_2; bitmap_ind16 m_tmpbitmap; - UINT8 m_palbank; - UINT8 m_priority; - UINT8 m_pixbank; + uint8_t m_palbank; + uint8_t m_priority; + uint8_t m_pixbank; int m_sprite_inc; int m_irq_count; @@ -78,9 +78,9 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_paradise(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_torus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_madball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_paradise(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_torus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_madball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(irq); diff --git a/src/mame/includes/parodius.h b/src/mame/includes/parodius.h index e9fa82faa35..040966a723e 100644 --- a/src/mame/includes/parodius.h +++ b/src/mame/includes/parodius.h @@ -52,7 +52,7 @@ public: DECLARE_WRITE8_MEMBER(sound_arm_nmi_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_parodius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_parodius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(parodius_interrupt); K05324X_CB_MEMBER(sprite_callback); K052109_CB_MEMBER(tile_callback); diff --git a/src/mame/includes/partner.h b/src/mame/includes/partner.h index f5eba1168f8..fbe703bac26 100644 --- a/src/mame/includes/partner.h +++ b/src/mame/includes/partner.h @@ -21,8 +21,8 @@ public: m_ram(*this, RAM_TAG), m_fdc(*this, "wd1793") { } - UINT8 m_mem_page; - UINT8 m_win_mem_page; + uint8_t m_mem_page; + uint8_t m_win_mem_page; DECLARE_READ8_MEMBER(partner_floppy_r); DECLARE_WRITE8_MEMBER(partner_floppy_w); DECLARE_WRITE8_MEMBER(partner_win_memory_page_w); @@ -32,9 +32,9 @@ public: DECLARE_MACHINE_RESET(partner); I8275_DRAW_CHARACTER_MEMBER(display_pixels); - void partner_window_1(UINT8 bank_num, UINT16 offset,UINT8 *rom); - void partner_window_2(UINT8 bank_num, UINT16 offset,UINT8 *rom); - void partner_iomap_bank(UINT8 *rom); + void partner_window_1(uint8_t bank_num, uint16_t offset,uint8_t *rom); + void partner_window_2(uint8_t bank_num, uint16_t offset,uint8_t *rom); + void partner_iomap_bank(uint8_t *rom); void partner_bank_switch(); required_device m_ram; required_device m_fdc; diff --git a/src/mame/includes/pass.h b/src/mame/includes/pass.h index e54f385787c..4ba284f63de 100644 --- a/src/mame/includes/pass.h +++ b/src/mame/includes/pass.h @@ -13,14 +13,14 @@ public: tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; DECLARE_WRITE16_MEMBER(pass_bg_videoram_w); DECLARE_WRITE16_MEMBER(pass_fg_videoram_w); TILE_GET_INFO_MEMBER(get_pass_bg_tile_info); TILE_GET_INFO_MEMBER(get_pass_fg_tile_info); virtual void video_start() override; - UINT32 screen_update_pass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; diff --git a/src/mame/includes/pastelg.h b/src/mame/includes/pastelg.h index af0d87dc1f6..149ec503d99 100644 --- a/src/mame/includes/pastelg.h +++ b/src/mame/includes/pastelg.h @@ -20,9 +20,9 @@ public: required_device m_maincpu; required_device m_nb1413m3; required_device m_screen; - required_shared_ptr m_clut; + required_shared_ptr m_clut; - UINT8 m_mux_data; + uint8_t m_mux_data; int m_blitter_destx; int m_blitter_desty; int m_blitter_sizex; @@ -34,7 +34,7 @@ public: int m_blitter_direction_x; int m_blitter_direction_y; int m_palbank; - std::unique_ptr m_videoram; + std::unique_ptr m_videoram; int m_flipscreen_old; DECLARE_READ8_MEMBER(pastelg_sndrom_r); @@ -55,7 +55,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(pastelg); - UINT32 screen_update_pastelg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pastelg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); int pastelg_blitter_src_addr_r(); void pastelg_vramflip(); void pastelg_gfxdraw(); diff --git a/src/mame/includes/patinhofeio.h b/src/mame/includes/patinhofeio.h index c2b5693a8a9..e9e5d7f586b 100644 --- a/src/mame/includes/patinhofeio.h +++ b/src/mame/includes/patinhofeio.h @@ -26,25 +26,25 @@ public: DECLARE_DEVICE_IMAGE_LOAD_MEMBER( patinho_tape ); void load_tape(const char* name); void load_raw_data(const char* name, unsigned int start_address, unsigned int data_length); - void update_panel(UINT8 ACC, UINT8 opcode, UINT8 mem_data, UINT16 mem_addr, UINT16 PC, UINT8 FLAGS, UINT16 RC, UINT8 mode); + void update_panel(uint8_t ACC, uint8_t opcode, uint8_t mem_data, uint16_t mem_addr, uint16_t PC, uint8_t FLAGS, uint16_t RC, uint8_t mode); virtual void machine_start() override; required_device m_maincpu; required_device m_decwriter; required_device m_tty; private: - UINT8* paper_tape_data; - UINT32 paper_tape_length; - UINT32 paper_tape_address; + uint8_t* paper_tape_data; + uint32_t paper_tape_length; + uint32_t paper_tape_address; emu_timer *m_decwriter_timer; emu_timer *m_teletype_timer; output_manager *m_out; - UINT8 m_prev_ACC; - UINT8 m_prev_opcode; - UINT8 m_prev_mem_data; - UINT16 m_prev_mem_addr; - UINT16 m_prev_PC; - UINT8 m_prev_FLAGS; - UINT16 m_prev_RC; + uint8_t m_prev_ACC; + uint8_t m_prev_opcode; + uint8_t m_prev_mem_data; + uint16_t m_prev_mem_addr; + uint16_t m_prev_PC; + uint8_t m_prev_FLAGS; + uint16_t m_prev_RC; }; diff --git a/src/mame/includes/pbaction.h b/src/mame/includes/pbaction.h index 26887d301ee..9ebb0ef2f44 100644 --- a/src/mame/includes/pbaction.h +++ b/src/mame/includes/pbaction.h @@ -27,12 +27,12 @@ public: m_decrypted_opcodes(*this, "decrypted_opcodes") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram; - required_shared_ptr m_colorram2; - required_shared_ptr m_work_ram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram; + required_shared_ptr m_colorram2; + required_shared_ptr m_work_ram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -45,9 +45,9 @@ public: required_device m_gfxdecode; required_device m_palette; required_device m_soundlatch; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(pbaction_sh_command_w); DECLARE_WRITE8_MEMBER(nmi_mask_w); DECLARE_READ8_MEMBER(pbactio3_prot_kludge_r); @@ -63,7 +63,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_pbaction(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pbaction(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pbaction_interrupt); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/pc1251.h b/src/mame/includes/pc1251.h index 653342b6d17..a6e84e0b16c 100644 --- a/src/mame/includes/pc1251.h +++ b/src/mame/includes/pc1251.h @@ -32,13 +32,13 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_outa; - UINT8 m_outb; + uint8_t m_outa; + uint8_t m_outb; int m_power; - UINT8 m_reg[0x100]; + uint8_t m_reg[0x100]; DECLARE_DRIVER_INIT(pc1251); - UINT32 screen_update_pc1251(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pc1251(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(pc1251_outa); DECLARE_WRITE8_MEMBER(pc1251_outb); DECLARE_WRITE8_MEMBER(pc1251_outc); diff --git a/src/mame/includes/pc1350.h b/src/mame/includes/pc1350.h index b52b8a53304..58cc23a1aff 100644 --- a/src/mame/includes/pc1350.h +++ b/src/mame/includes/pc1350.h @@ -32,11 +32,11 @@ public: m_maincpu(*this, "maincpu"), m_ram(*this, RAM_TAG) { } - UINT8 m_outa; - UINT8 m_outb; + uint8_t m_outa; + uint8_t m_outb; int m_power; - UINT8 m_reg[0x1000]; - UINT32 screen_update_pc1350(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint8_t m_reg[0x1000]; + uint32_t screen_update_pc1350(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(pc1350_outa); DECLARE_WRITE8_MEMBER(pc1350_outb); diff --git a/src/mame/includes/pc1401.h b/src/mame/includes/pc1401.h index 0ce077476ad..1c76287a808 100644 --- a/src/mame/includes/pc1401.h +++ b/src/mame/includes/pc1401.h @@ -32,13 +32,13 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_portc; - UINT8 m_outa; - UINT8 m_outb; + uint8_t m_portc; + uint8_t m_outa; + uint8_t m_outb; int m_power; - UINT8 m_reg[0x100]; + uint8_t m_reg[0x100]; DECLARE_DRIVER_INIT(pc1401); - UINT32 screen_update_pc1401(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pc1401(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ_LINE_MEMBER(pc1401_reset); DECLARE_READ_LINE_MEMBER(pc1401_brk); DECLARE_WRITE8_MEMBER(pc1401_outa); diff --git a/src/mame/includes/pc1403.h b/src/mame/includes/pc1403.h index c5bdf2f943f..7566ccbee6d 100644 --- a/src/mame/includes/pc1403.h +++ b/src/mame/includes/pc1403.h @@ -32,16 +32,16 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_portc; - UINT8 m_outa; + uint8_t m_portc; + uint8_t m_outa; int m_power; - UINT8 m_asic[4]; + uint8_t m_asic[4]; int m_DOWN; int m_RIGHT; - UINT8 m_reg[0x100]; + uint8_t m_reg[0x100]; DECLARE_DRIVER_INIT(pc1403); - UINT32 screen_update_pc1403(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pc1403(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ_LINE_MEMBER(pc1403_reset); DECLARE_READ_LINE_MEMBER(pc1403_brk); DECLARE_WRITE8_MEMBER(pc1403_outa); diff --git a/src/mame/includes/pc1512.h b/src/mame/includes/pc1512.h index 071d2dee28f..dd8f5fcb213 100644 --- a/src/mame/includes/pc1512.h +++ b/src/mame/includes/pc1512.h @@ -103,7 +103,7 @@ public: optional_device m_floppy1; required_device m_bus; optional_memory_region m_char_rom; - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; required_ioport m_lk; virtual void machine_start() override; @@ -111,16 +111,16 @@ public: virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void update_speaker(); void update_fdc_int(); void update_fdc_drq(); void update_fdc_tc(); void update_ack(); - int get_display_mode(UINT8 mode); + int get_display_mode(uint8_t mode); offs_t get_char_rom_offset(); - int get_color(UINT8 data); + int get_color(uint8_t data); MC6845_UPDATE_ROW(draw_alpha); MC6845_UPDATE_ROW(draw_graphics_1); MC6845_UPDATE_ROW(draw_graphics_2); @@ -171,27 +171,27 @@ public: // system status register int m_pit1; int m_pit2; - UINT8 m_status1; - UINT8 m_status2; - UINT8 m_port61; + uint8_t m_status1; + uint8_t m_status2; + uint8_t m_port61; // interrupt state int m_nmi_enable; // keyboard state - UINT8 m_kbd; + uint8_t m_kbd; int m_kb_bits; int m_kbclk; int m_kbdata; // mouse state - UINT8 m_mouse_x_old; - UINT8 m_mouse_y_old; - UINT8 m_mouse_x; - UINT8 m_mouse_y; + uint8_t m_mouse_x_old; + uint8_t m_mouse_y_old; + uint8_t m_mouse_x; + uint8_t m_mouse_y; // DMA state - UINT8 m_dma_page[4]; + uint8_t m_dma_page[4]; int m_dma_channel; int m_dreq0; @@ -199,7 +199,7 @@ public: int m_nden; int m_dint; int m_ddrq; - UINT8 m_fdc_dsr; + uint8_t m_fdc_dsr; int m_neop; // printer state @@ -209,8 +209,8 @@ public: int m_centronics_perror; int m_centronics_select; int m_centronics_fault; - UINT8 m_printer_data; - UINT8 m_printer_control; + uint8_t m_printer_data; + uint8_t m_printer_control; // video state int m_toggle; @@ -218,11 +218,11 @@ public: int m_blink; int m_cursor; int m_blink_ctr; - UINT8 m_vdu_mode; - UINT8 m_vdu_color; - UINT8 m_vdu_plane; - UINT8 m_vdu_rdsel; - UINT8 m_vdu_border; + uint8_t m_vdu_mode; + uint8_t m_vdu_color; + uint8_t m_vdu_plane; + uint8_t m_vdu_rdsel; + uint8_t m_vdu_border; // sound state int m_speaker_drive; diff --git a/src/mame/includes/pc4.h b/src/mame/includes/pc4.h index f2d6a8519b9..0050f7f9133 100644 --- a/src/mame/includes/pc4.h +++ b/src/mame/includes/pc4.h @@ -27,7 +27,7 @@ public: required_device m_maincpu; required_device m_beep; - 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); virtual void machine_start() override; DECLARE_WRITE8_MEMBER( beep_w ); @@ -36,7 +36,7 @@ public: //LCD controller void update_ac(void); - void set_busy_flag(UINT16 usec); + void set_busy_flag(uint16_t usec); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; DECLARE_WRITE8_MEMBER(lcd_control_w); @@ -51,20 +51,20 @@ public: emu_timer *m_blink_timer; emu_timer *m_busy_timer; - UINT8 m_busy_flag; - UINT8 m_ddram[0xa0]; - UINT8 m_cgram[0x40]; - INT16 m_ac; - UINT8 m_ac_mode; - UINT8 m_data_bus_flag; - INT16 m_cursor_pos; - UINT8 m_display_on; - UINT8 m_cursor_on; - UINT8 m_blink_on; - UINT8 m_shift_on; - INT8 m_disp_shift; - INT8 m_direction; - UINT8 m_blink; + uint8_t m_busy_flag; + uint8_t m_ddram[0xa0]; + uint8_t m_cgram[0x40]; + int16_t m_ac; + uint8_t m_ac_mode; + uint8_t m_data_bus_flag; + int16_t m_cursor_pos; + uint8_t m_display_on; + uint8_t m_cursor_on; + uint8_t m_blink_on; + uint8_t m_shift_on; + int8_t m_disp_shift; + int8_t m_direction; + uint8_t m_blink; DECLARE_PALETTE_INIT(pc4); protected: diff --git a/src/mame/includes/pc8401a.h b/src/mame/includes/pc8401a.h index 4bc7f9aa5ba..2d3fd53dfd8 100644 --- a/src/mame/includes/pc8401a.h +++ b/src/mame/includes/pc8401a.h @@ -59,7 +59,7 @@ public: required_device m_io_cart; required_device m_ram; required_memory_region m_rom; - optional_shared_ptr m_crt_ram; + optional_shared_ptr m_crt_ram; required_ioport_array<10> m_io_y; memory_region *m_cart_rom; @@ -83,16 +83,16 @@ public: DECLARE_PALETTE_INIT(pc8401a); void scan_keyboard(); - void bankswitch(UINT8 data); + void bankswitch(uint8_t data); // keyboard state int m_key_strobe; // key pressed // memory state - UINT8 m_mmr; // memory mapping register - UINT32 m_io_addr; // I/O ROM address counter + uint8_t m_mmr; // memory mapping register + uint32_t m_io_addr; // I/O ROM address counter - UINT8 m_key_latch; + uint8_t m_key_latch; TIMER_DEVICE_CALLBACK_MEMBER(pc8401a_keyboard_tick); }; @@ -104,7 +104,7 @@ public: { } virtual void video_start() override; - 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); }; // ---------- defined in video/pc8401a.c ---------- diff --git a/src/mame/includes/pce.h b/src/mame/includes/pce.h index 424e6a21135..9c07e62f602 100644 --- a/src/mame/includes/pce.h +++ b/src/mame/includes/pce.h @@ -48,8 +48,8 @@ public: { } required_device m_maincpu; - required_shared_ptr m_cd_ram; - required_shared_ptr m_user_ram; + required_shared_ptr m_cd_ram; + required_shared_ptr m_user_ram; optional_device m_huc6260; required_device m_cartslot; optional_device m_cd; @@ -58,12 +58,12 @@ public: required_ioport m_joy_type; required_ioport m_a_card; - UINT8 m_io_port_options; - UINT8 m_sys3_card; - UINT8 m_acard; + uint8_t m_io_port_options; + uint8_t m_sys3_card; + uint8_t m_acard; int m_joystick_port_select; int m_joystick_data_select; - UINT8 m_joy_6b_packet[5]; + uint8_t m_joy_6b_packet[5]; DECLARE_WRITE8_MEMBER(mess_pce_joystick_w); DECLARE_READ8_MEMBER(mess_pce_joystick_r); DECLARE_WRITE8_MEMBER(pce_cd_intf_w); @@ -73,7 +73,7 @@ public: DECLARE_DRIVER_INIT(sgx); DECLARE_DRIVER_INIT(tg16); DECLARE_DRIVER_INIT(mess_pce); - 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); DECLARE_MACHINE_START(pce); DECLARE_MACHINE_RESET(mess_pce); }; diff --git a/src/mame/includes/pcktgal.h b/src/mame/includes/pcktgal.h index bfb3db2b39a..2e7a76d7d38 100644 --- a/src/mame/includes/pcktgal.h +++ b/src/mame/includes/pcktgal.h @@ -27,7 +27,7 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; int m_msm5205next; int m_toggle; @@ -43,7 +43,7 @@ public: DECLARE_PALETTE_INIT(pcktgal); virtual void machine_start() override; - UINT32 screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/pcw.h b/src/mame/includes/pcw.h index fb9b35b96e9..96b235c4260 100644 --- a/src/mame/includes/pcw.h +++ b/src/mame/includes/pcw.h @@ -42,34 +42,34 @@ public: int m_system_status; int m_fdc_interrupt_code; int m_interrupt_counter; - UINT8 m_banks[4]; + uint8_t m_banks[4]; unsigned char m_bank_force; - UINT8 m_timer_irq_flag; - UINT8 m_nmi_flag; - UINT8 m_printer_command; - UINT8 m_printer_data; - UINT8 m_printer_status; - INT16 m_printer_headpos; - UINT16 m_kb_scan_row; - UINT8 m_mcu_keyboard_data[16]; - UINT8 m_mcu_transmit_reset_seq; - UINT8 m_mcu_transmit_count; - UINT8 m_mcu_selected; - UINT8 m_mcu_buffer; - UINT8 m_mcu_prev; + uint8_t m_timer_irq_flag; + uint8_t m_nmi_flag; + uint8_t m_printer_command; + uint8_t m_printer_data; + uint8_t m_printer_status; + int16_t m_printer_headpos; + uint16_t m_kb_scan_row; + uint8_t m_mcu_keyboard_data[16]; + uint8_t m_mcu_transmit_reset_seq; + uint8_t m_mcu_transmit_count; + uint8_t m_mcu_selected; + uint8_t m_mcu_buffer; + uint8_t m_mcu_prev; unsigned int m_roller_ram_addr; unsigned short m_roller_ram_offset; unsigned char m_vdu_video_control_register; - UINT8 m_printer_serial; // value if shift/store data pin - UINT8 m_printer_shift; // state of shift register - UINT8 m_printer_shift_output; // output presented to the paper feed motor and print head motor - UINT8 m_head_motor_state; - UINT8 m_linefeed_motor_state; - UINT16 m_printer_pins; - UINT8 m_printer_p2; // MCU port P2 state - UINT32 m_paper_feed; // amount of paper fed through printer, by n/360 inches. One line feed is 61/360in (from the linefeed command in CP/M;s ptr menu) + uint8_t m_printer_serial; // value if shift/store data pin + uint8_t m_printer_shift; // state of shift register + uint8_t m_printer_shift_output; // output presented to the paper feed motor and print head motor + uint8_t m_head_motor_state; + uint8_t m_linefeed_motor_state; + uint16_t m_printer_pins; + uint8_t m_printer_p2; // MCU port P2 state + uint32_t m_paper_feed; // amount of paper fed through printer, by n/360 inches. One line feed is 61/360in (from the linefeed command in CP/M;s ptr menu) std::unique_ptr m_prn_output; - UINT8 m_printer_p2_prev; + uint8_t m_printer_p2_prev; emu_timer* m_prn_stepper; emu_timer* m_prn_pins; DECLARE_READ8_MEMBER(pcw_keyboard_r); @@ -103,14 +103,14 @@ public: DECLARE_READ8_MEMBER(mcu_kb_t0_r); DECLARE_READ8_MEMBER(pcw9512_parallel_r); DECLARE_WRITE8_MEMBER(pcw9512_parallel_w); - void mcu_transmit_serial(UINT8 bit); + void mcu_transmit_serial(uint8_t bit); DECLARE_DRIVER_INIT(pcw); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(pcw); - UINT32 screen_update_pcw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pcw_printer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pcw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pcw_printer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(pcw_timer_pulse); TIMER_CALLBACK_MEMBER(pcw_stepper_callback); TIMER_CALLBACK_MEMBER(pcw_pins_callback); @@ -127,14 +127,14 @@ public: required_device m_screen; required_device m_palette; - inline void pcw_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color); + inline void pcw_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color); void pcw_update_interrupt_counter(); void pcw_update_irqs(); void pcw_update_read_memory_block(int block, int bank); void pcw_update_write_memory_block(int block, int bank); void pcw_update_mem(int block, int data); int pcw_get_sys_status(); - void pcw_printer_fire_pins(UINT16 pins); + void pcw_printer_fire_pins(uint16_t pins); }; #endif /* PCW_H_ */ diff --git a/src/mame/includes/pcw16.h b/src/mame/includes/pcw16.h index 3f611f878d5..ca70412feea 100644 --- a/src/mame/includes/pcw16.h +++ b/src/mame/includes/pcw16.h @@ -119,15 +119,15 @@ public: void pcw16_keyboard_signal_byte_received(int data); void pcw16_refresh_ints(); void rtc_setup_max_days(); - UINT8 pcw16_read_mem(UINT8 bank, UINT16 offset); - void pcw16_write_mem(UINT8 bank, UINT16 offset, UINT8 data); - UINT8 read_bank_data(UINT8 type, UINT16 offset); - void write_bank_data(UINT8 type, UINT16 offset, UINT8 data); + uint8_t pcw16_read_mem(uint8_t bank, uint16_t offset); + void pcw16_write_mem(uint8_t bank, uint16_t offset, uint8_t data); + uint8_t read_bank_data(uint8_t type, uint16_t offset); + void write_bank_data(uint8_t type, uint16_t offset, uint8_t data); virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(pcw16); - UINT32 screen_update_pcw16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pcw16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(pcw16_timer_callback); TIMER_DEVICE_CALLBACK_MEMBER(rtc_timer_callback); DECLARE_WRITE_LINE_MEMBER(pcw16_com_interrupt_1); @@ -137,7 +137,7 @@ public: void trigger_fdc_int(); DECLARE_WRITE_LINE_MEMBER( fdc_interrupt ); DECLARE_FLOPPY_FORMATS( floppy_formats ); - inline void pcw16_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color); + inline void pcw16_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color); void pcw16_vh_decode_mode0(bitmap_ind16 &bitmap, int x, int y, unsigned char byte); void pcw16_vh_decode_mode1(bitmap_ind16 &bitmap, int x, int y, unsigned char byte); void pcw16_vh_decode_mode2(bitmap_ind16 &bitmap, int x, int y, unsigned char byte); diff --git a/src/mame/includes/pdp1.h b/src/mame/includes/pdp1.h index ec8367108fa..4eccc98f69f 100644 --- a/src/mame/includes/pdp1.h +++ b/src/mame/includes/pdp1.h @@ -267,7 +267,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(pdp1); - UINT32 screen_update_pdp1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pdp1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_pdp1(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(pdp1_interrupt); TIMER_CALLBACK_MEMBER(reader_callback); @@ -275,7 +275,7 @@ public: TIMER_CALLBACK_MEMBER(tyo_callback); TIMER_CALLBACK_MEMBER(dpy_callback); void pdp1_machine_stop(); - inline void pdp1_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color); + inline void pdp1_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color); void pdp1_plot(int x, int y); void pdp1_draw_led(bitmap_ind16 &bitmap, int x, int y, int state); void pdp1_draw_multipleled(bitmap_ind16 &bitmap, int x, int y, int value, int nb_bits); @@ -291,13 +291,13 @@ public: void pdp1_draw_circle(bitmap_ind16 &bitmap, int x, int y, int radius, int color_); void pdp1_erase_lightpen(bitmap_ind16 &bitmap); void pdp1_draw_lightpen(bitmap_ind16 &bitmap); - int tape_read(UINT8 *reply); + int tape_read(uint8_t *reply); void begin_tape_read(int binary, int nac); - void tape_write(UINT8 data); - void typewriter_out(UINT8 data); + void tape_write(uint8_t data); + void typewriter_out(uint8_t data); void parallel_drum_set_il(int il); - UINT32 drum_read(int field, int position); - void drum_write(int field, int position, UINT32 data); + uint32_t drum_read(int field, int position); + void drum_write(int field, int position, uint32_t data); void pdp1_keyboard(); void pdp1_lightpen(); int read_spacewar() { return m_spacewar->read(); } diff --git a/src/mame/includes/pecom.h b/src/mame/includes/pecom.h index c8b9768bb31..8320079d2e1 100644 --- a/src/mame/includes/pecom.h +++ b/src/mame/includes/pecom.h @@ -31,7 +31,7 @@ public: required_device m_cdp1802; required_device m_cdp1869; - std::unique_ptr m_charram; /* character generator ROM */ + std::unique_ptr m_charram; /* character generator ROM */ int m_reset; /* CPU mode */ int m_dma; /* memory refresh DMA */ diff --git a/src/mame/includes/pes.h b/src/mame/includes/pes.h index 16bc674754e..4ca2766f8f4 100644 --- a/src/mame/includes/pes.h +++ b/src/mame/includes/pes.h @@ -32,12 +32,12 @@ public: required_device m_terminal; required_device m_speech; - UINT8 m_wsstate; // /WS - UINT8 m_rsstate; // /RS - UINT8 m_port3_state; // Port3 state as last written - UINT8 m_infifo[32]; // input fifo - UINT8 m_infifo_tail_ptr; // " tail - UINT8 m_infifo_head_ptr; // " head + uint8_t m_wsstate; // /WS + uint8_t m_rsstate; // /RS + uint8_t m_port3_state; // Port3 state as last written + uint8_t m_infifo[32]; // input fifo + uint8_t m_infifo_tail_ptr; // " tail + uint8_t m_infifo_head_ptr; // " head virtual void machine_reset() override; DECLARE_WRITE8_MEMBER(rsws_w); diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h index dd0660aa8c3..9ae5e0ba24c 100644 --- a/src/mame/includes/pgm.h +++ b/src/mame/includes/pgm.h @@ -36,21 +36,21 @@ public: } /* memory pointers */ - required_shared_ptr m_videoregs; - required_shared_ptr m_videoram; - required_shared_ptr m_z80_mainram; - required_shared_ptr m_mainram; - UINT16 * m_bg_videoram; - UINT16 * m_tx_videoram; - UINT16 * m_rowscrollram; - std::unique_ptr m_sprite_a_region; + required_shared_ptr m_videoregs; + required_shared_ptr m_videoram; + required_shared_ptr m_z80_mainram; + required_shared_ptr m_mainram; + uint16_t * m_bg_videoram; + uint16_t * m_tx_videoram; + uint16_t * m_rowscrollram; + std::unique_ptr m_sprite_a_region; size_t m_sprite_a_region_size; - std::unique_ptr m_spritebufferram; // buffered spriteram + std::unique_ptr m_spritebufferram; // buffered spriteram /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_tx_tilemap; - UINT16 *m_sprite_temp_render; + uint16_t *m_sprite_temp_render; bitmap_rgb32 m_tmppgmbitmap; /* devices */ @@ -63,7 +63,7 @@ public: device_t *m_ics; /* used by rendering */ - UINT8 *m_bdata; + uint8_t *m_bdata; size_t m_bdatasize; int m_aoffset; int m_boffset; @@ -72,10 +72,10 @@ public: int m_irq4_disabled; /* calendar */ - UINT8 m_cal_val; - UINT8 m_cal_mask; - UINT8 m_cal_com; - UINT8 m_cal_cnt; + uint8_t m_cal_val; + uint8_t m_cal_mask; + uint8_t m_cal_com; + uint8_t m_cal_cnt; system_time m_systime; DECLARE_READ16_MEMBER(pgm_videoram_r); @@ -97,18 +97,18 @@ public: DECLARE_VIDEO_START(pgm); DECLARE_MACHINE_START(pgm); DECLARE_MACHINE_RESET(pgm); - UINT32 screen_update_pgm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pgm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_pgm(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(pgm_interrupt); - inline void pgm_draw_pix( int xdrawpos, int pri, UINT16* dest, UINT8* destpri, UINT16 srcdat); - inline void pgm_draw_pix_nopri( int xdrawpos, UINT16* dest, UINT8* destpri, UINT16 srcdat); - inline void pgm_draw_pix_pri( int xdrawpos, UINT16* dest, UINT8* destpri, UINT16 srcdat); - void draw_sprite_line( int wide, UINT16* dest, UINT8* destpri, int xzoom, int xgrow, int flip, int xpos, int pri, int realxsize, int palt, int draw ); - void draw_sprite_new_zoomed( int wide, int high, int xpos, int ypos, int palt, int flip, bitmap_ind16 &bitmap, bitmap_ind8 &priority_bitmap, UINT32 xzoom, int xgrow, UINT32 yzoom, int ygrow, int pri ); - void draw_sprite_line_basic( int wide, UINT16* dest, UINT8* destpri, int flip, int xpos, int pri, int realxsize, int palt, int draw ); + inline void pgm_draw_pix( int xdrawpos, int pri, uint16_t* dest, uint8_t* destpri, uint16_t srcdat); + inline void pgm_draw_pix_nopri( int xdrawpos, uint16_t* dest, uint8_t* destpri, uint16_t srcdat); + inline void pgm_draw_pix_pri( int xdrawpos, uint16_t* dest, uint8_t* destpri, uint16_t srcdat); + void draw_sprite_line( int wide, uint16_t* dest, uint8_t* destpri, int xzoom, int xgrow, int flip, int xpos, int pri, int realxsize, int palt, int draw ); + void draw_sprite_new_zoomed( int wide, int high, int xpos, int ypos, int palt, int flip, bitmap_ind16 &bitmap, bitmap_ind8 &priority_bitmap, uint32_t xzoom, int xgrow, uint32_t yzoom, int ygrow, int pri ); + void draw_sprite_line_basic( int wide, uint16_t* dest, uint8_t* destpri, int flip, int xpos, int pri, int realxsize, int palt, int draw ); void draw_sprite_new_basic( int wide, int high, int xpos, int ypos, int palt, int flip, bitmap_ind16 &bitmap, bitmap_ind8 &priority_bitmap, int pri ); - void draw_sprites( bitmap_ind16& spritebitmap, UINT16 *sprite_source, bitmap_ind8& priority_bitmap ); + void draw_sprites( bitmap_ind16& spritebitmap, uint16_t *sprite_source, bitmap_ind8& priority_bitmap ); void expand_colourdata(); void pgm_basic_init( bool set_bank = true); }; diff --git a/src/mame/includes/phc25.h b/src/mame/includes/phc25.h index 635e7cbeb70..a33d2c2d911 100644 --- a/src/mame/includes/phc25.h +++ b/src/mame/includes/phc25.h @@ -46,9 +46,9 @@ public: private: virtual void video_start() override; - UINT8 *m_char_rom; - UINT8 m_port40; - required_shared_ptr m_video_ram; + uint8_t *m_char_rom; + uint8_t m_port40; + required_shared_ptr m_video_ram; required_device m_maincpu; required_device m_vdg; required_device m_centronics; diff --git a/src/mame/includes/phoenix.h b/src/mame/includes/phoenix.h index 2ceca77c4f6..2752c64e36a 100644 --- a/src/mame/includes/phoenix.h +++ b/src/mame/includes/phoenix.h @@ -16,17 +16,17 @@ public: required_device m_maincpu; optional_device m_pleiads_custom; required_device m_gfxdecode; - std::unique_ptr m_videoram_pg[2]; - UINT8 m_videoram_pg_index; - UINT8 m_palette_bank; - UINT8 m_cocktail_mode; - UINT8 m_pleiads_protection_question; - UINT8 m_survival_protection_value; + std::unique_ptr m_videoram_pg[2]; + uint8_t m_videoram_pg_index; + uint8_t m_palette_bank; + uint8_t m_cocktail_mode; + uint8_t m_pleiads_protection_question; + uint8_t m_survival_protection_value; int m_survival_sid_value; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT8 m_survival_input_latches[2]; - UINT8 m_survival_input_readc; + uint8_t m_survival_input_latches[2]; + uint8_t m_survival_input_readc; DECLARE_WRITE8_MEMBER(phoenix_videoram_w); DECLARE_WRITE8_MEMBER(phoenix_videoreg_w); DECLARE_WRITE8_MEMBER(pleiads_videoreg_w); @@ -43,7 +43,7 @@ public: DECLARE_PALETTE_INIT(phoenix); DECLARE_PALETTE_INIT(survival); DECLARE_PALETTE_INIT(pleiads); - UINT32 screen_update_phoenix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_phoenix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER(survival_protection_r); DECLARE_READ_LINE_MEMBER(survival_sid_callback); }; @@ -66,24 +66,24 @@ public: struct c_state { - INT32 counter; - INT32 level; + int32_t counter; + int32_t level; }; struct n_state { - INT32 counter; - INT32 polyoffs; - INT32 polybit; - INT32 lowpass_counter; - INT32 lowpass_polybit; + int32_t counter; + int32_t polyoffs; + int32_t polybit; + int32_t lowpass_counter; + int32_t lowpass_polybit; }; class phoenix_sound_device : public device_t, public device_sound_interface { public: - phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~phoenix_sound_device() {} DECLARE_WRITE8_MEMBER( control_a_w ); @@ -101,9 +101,9 @@ private: struct c_state m_c24_state; struct c_state m_c25_state; struct n_state m_noise_state; - UINT8 m_sound_latch_a; + uint8_t m_sound_latch_a; sound_stream * m_channel; - std::unique_ptr m_poly18; + std::unique_ptr m_poly18; discrete_device *m_discrete; tms36xx_device *m_tms; diff --git a/src/mame/includes/pingpong.h b/src/mame/includes/pingpong.h index afc47ef6ccc..bac709a81fd 100644 --- a/src/mame/includes/pingpong.h +++ b/src/mame/includes/pingpong.h @@ -15,9 +15,9 @@ public: int m_intenable; int m_question_addr_high; required_device m_maincpu; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_palette; tilemap_t *m_bg_tilemap; @@ -32,7 +32,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(pingpong); - UINT32 screen_update_pingpong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pingpong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(pingpong_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(merlinmm_interrupt); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/pirates.h b/src/mame/includes/pirates.h index 20486d5b541..2f8f9eb7c15 100644 --- a/src/mame/includes/pirates.h +++ b/src/mame/includes/pirates.h @@ -25,11 +25,11 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll; - required_shared_ptr m_tx_tileram; - required_shared_ptr m_fg_tileram; - required_shared_ptr m_bg_tileram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll; + required_shared_ptr m_tx_tileram; + required_shared_ptr m_fg_tileram; + required_shared_ptr m_bg_tileram; tilemap_t *m_tx_tilemap; tilemap_t *m_fg_tilemap; @@ -52,7 +52,7 @@ public: virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void decrypt_68k(); diff --git a/src/mame/includes/pitnrun.h b/src/mame/includes/pitnrun.h index 91dadd7172e..0e352c99023 100644 --- a/src/mame/includes/pitnrun.h +++ b/src/mame/includes/pitnrun.h @@ -18,17 +18,17 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_spriteram; int m_nmi; - UINT8 m_fromz80; - UINT8 m_toz80; + uint8_t m_fromz80; + uint8_t m_toz80; int m_zaccept; int m_zready; - UINT8 m_portA_in; - UINT8 m_portA_out; + uint8_t m_portA_in; + uint8_t m_portA_out; int m_address; int m_h_heed; int m_v_heed; @@ -74,7 +74,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(pitnrun); - 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); void spotlights(); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/pk8000.h b/src/mame/includes/pk8000.h index ad895850537..39d49bdcaef 100644 --- a/src/mame/includes/pk8000.h +++ b/src/mame/includes/pk8000.h @@ -25,16 +25,16 @@ public: DECLARE_PALETTE_INIT(pk8000); - UINT32 pk8000_video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *videomem); + uint32_t pk8000_video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *videomem); protected: - UINT8 m_pk8000_text_start; - UINT8 m_pk8000_chargen_start; - UINT8 m_pk8000_video_start; - UINT8 m_pk8000_color_start; + uint8_t m_pk8000_text_start; + uint8_t m_pk8000_chargen_start; + uint8_t m_pk8000_video_start; + uint8_t m_pk8000_color_start; - UINT8 m_pk8000_video_mode; - UINT8 m_pk8000_video_color; - UINT8 m_pk8000_color[32]; - UINT8 m_pk8000_video_enable; + uint8_t m_pk8000_video_mode; + uint8_t m_pk8000_video_color; + uint8_t m_pk8000_color[32]; + uint8_t m_pk8000_video_enable; required_device m_maincpu; }; diff --git a/src/mame/includes/pk8020.h b/src/mame/includes/pk8020.h index d8de9284db6..c9f296e0dca 100644 --- a/src/mame/includes/pk8020.h +++ b/src/mame/includes/pk8020.h @@ -46,17 +46,17 @@ public: DECLARE_FLOPPY_FORMATS(floppy_formats); - UINT8 m_color; - UINT8 m_video_page; - UINT8 m_wide; - UINT8 m_font; - UINT8 m_attr; - UINT8 m_text_attr; - UINT8 m_takt; - UINT8 m_video_page_access; - UINT8 m_portc_data; - UINT8 m_sound_gate; - UINT8 m_sound_level; + uint8_t m_color; + uint8_t m_video_page; + uint8_t m_wide; + uint8_t m_font; + uint8_t m_attr; + uint8_t m_text_attr; + uint8_t m_takt; + uint8_t m_video_page_access; + uint8_t m_portc_data; + uint8_t m_sound_gate; + uint8_t m_sound_level; DECLARE_READ8_MEMBER(keyboard_r); DECLARE_READ8_MEMBER(sysreg_r); DECLARE_WRITE8_MEMBER(sysreg_w); @@ -70,7 +70,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(pk8020); - UINT32 screen_update_pk8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pk8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(pk8020_interrupt); DECLARE_READ8_MEMBER(pk8020_porta_r); DECLARE_WRITE8_MEMBER(pk8020_portc_w); @@ -100,7 +100,7 @@ protected: required_memory_region m_region_gfx1; ioport_port *m_io_port[16]; required_device m_palette; - void pk8020_set_bank(UINT8 data); + void pk8020_set_bank(uint8_t data); }; #endif /* pk8020_H_ */ diff --git a/src/mame/includes/pktgaldx.h b/src/mame/includes/pktgaldx.h index 5f0b0e76b94..1f4344d0458 100644 --- a/src/mame/includes/pktgaldx.h +++ b/src/mame/includes/pktgaldx.h @@ -34,11 +34,11 @@ public: optional_device m_deco104; /* memory pointers */ - optional_shared_ptr m_pf1_rowscroll; - optional_shared_ptr m_pf2_rowscroll; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_pktgaldb_fgram; - optional_shared_ptr m_pktgaldb_sprites; + optional_shared_ptr m_pf1_rowscroll; + optional_shared_ptr m_pf2_rowscroll; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_pktgaldb_fgram; + optional_shared_ptr m_pktgaldb_sprites; optional_device m_sprgen; /* devices */ @@ -48,15 +48,15 @@ public: optional_device m_decocomn; required_device m_gfxdecode; required_device m_palette; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; DECLARE_READ16_MEMBER(pckgaldx_unknown_r); DECLARE_READ16_MEMBER(pckgaldx_protection_r); DECLARE_WRITE16_MEMBER(pktgaldx_oki_bank_w); DECLARE_DRIVER_INIT(pktgaldx); virtual void machine_start() override; - UINT32 screen_update_pktgaldx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pktgaldb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pktgaldx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pktgaldb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); READ16_MEMBER( pktgaldx_protection_region_f_104_r ); WRITE16_MEMBER( pktgaldx_protection_region_f_104_w ); diff --git a/src/mame/includes/playch10.h b/src/mame/includes/playch10.h index 7878803b073..1cf8a7d85e1 100644 --- a/src/mame/includes/playch10.h +++ b/src/mame/includes/playch10.h @@ -6,7 +6,7 @@ struct chr_bank { int writable; // 1 for RAM, 0 for ROM - UINT8* chr; // direct access to the memory + uint8_t* chr; // direct access to the memory }; class playch10_state : public driver_device @@ -30,10 +30,10 @@ public: required_device m_ppu; optional_device m_rp5h01; - required_shared_ptr m_ram_8w; - required_shared_ptr m_videoram; - required_shared_ptr m_timedata; - required_shared_ptr m_work_ram; + required_shared_ptr m_ram_8w; + required_shared_ptr m_videoram; + required_shared_ptr m_timedata; + required_shared_ptr m_work_ram; required_device m_gfxdecode; optional_memory_region m_vrom_region; @@ -53,10 +53,10 @@ public: int m_mirroring; int m_MMC2_bank[4]; int m_MMC2_bank_latch[2]; - UINT8* m_vrom; - std::unique_ptr m_vram; - UINT8* m_nametable[4]; - std::unique_ptr m_nt_ram; + uint8_t* m_vrom; + std::unique_ptr m_vram; + uint8_t* m_nametable[4]; + std::unique_ptr m_nt_ram; chr_bank m_chr_page[8]; int m_mmc1_shiftreg; int m_mmc1_shiftcount; @@ -68,7 +68,7 @@ public: int m_gboard_last_bank; int m_gboard_command; int m_IRQ_count; - UINT8 m_IRQ_count_latch; + uint8_t m_IRQ_count_latch; int m_IRQ_enable; int m_pc10_bios; tilemap_t *m_bg_tilemap; @@ -133,9 +133,9 @@ public: DECLARE_PALETTE_INIT(playch10); DECLARE_MACHINE_START(playch10_hboard); DECLARE_VIDEO_START(playch10_hboard); - UINT32 screen_update_playch10_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_playch10_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_playch10_single(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_playch10_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_playch10_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_playch10_single(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(playch10_interrupt); void pc10_set_videorom_bank( int first, int count, int bank, int size ); void set_videoram_bank( int first, int count, int bank, int size ); diff --git a/src/mame/includes/playmark.h b/src/mame/includes/playmark.h index 2d609ea518f..8ac6c84c139 100644 --- a/src/mame/includes/playmark.h +++ b/src/mame/includes/playmark.h @@ -23,12 +23,12 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - optional_shared_ptr m_bgvideoram; - required_shared_ptr m_videoram1; - optional_shared_ptr m_videoram2; - optional_shared_ptr m_videoram3; - required_shared_ptr m_spriteram; - optional_shared_ptr m_rowscroll; + optional_shared_ptr m_bgvideoram; + required_shared_ptr m_videoram1; + optional_shared_ptr m_videoram2; + optional_shared_ptr m_videoram3; + required_shared_ptr m_spriteram; + optional_shared_ptr m_rowscroll; /* video-related */ tilemap_t *m_tx_tilemap; @@ -44,15 +44,15 @@ public: int m_xoffset; int m_yoffset; int m_pri_masks[3]; - UINT16 m_scroll[7]; + uint16_t m_scroll[7]; /* misc */ - UINT16 m_snd_command; - UINT16 m_snd_flag; - UINT8 m_oki_control; - UINT8 m_oki_command; + uint16_t m_snd_command; + uint16_t m_snd_flag; + uint8_t m_oki_control; + uint8_t m_oki_command; int m_old_oki_bank; - UINT8 m_dispenser_latch; + uint8_t m_dispenser_latch; /* devices */ required_device m_oki; @@ -100,15 +100,15 @@ public: DECLARE_VIDEO_START(hrdtimes); DECLARE_VIDEO_START(luckboomh); TILEMAP_MAPPER_MEMBER(playmark_tilemap_scan_pages); - UINT32 screen_update_bigtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bigtwinb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_wbeachvl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_excelsr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hrdtimes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bigtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bigtwinb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wbeachvl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_excelsr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hrdtimes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int codeshift ); void bigtwinb_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int codeshift ); void draw_bitmap( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); - UINT8 playmark_asciitohex(UINT8 data); + uint8_t playmark_asciitohex(uint8_t data); void playmark_decode_pic_hex_dump(void); required_device m_maincpu; optional_device m_audiocpu; diff --git a/src/mame/includes/plygonet.h b/src/mame/includes/plygonet.h index 020cbe7621b..2a741b265ea 100644 --- a/src/mame/includes/plygonet.h +++ b/src/mame/includes/plygonet.h @@ -7,11 +7,11 @@ #include "cpu/dsp56k/dsp56k.h" -static const UINT16 dsp56k_bank00_size = 0x1000; -static const UINT16 dsp56k_bank01_size = 0x1000; -static const UINT16 dsp56k_bank02_size = 0x4000; -static const UINT16 dsp56k_shared_ram_16_size = 0x2000; -static const UINT16 dsp56k_bank04_size = 0x1fc0; +static const uint16_t dsp56k_bank00_size = 0x1000; +static const uint16_t dsp56k_bank01_size = 0x1000; +static const uint16_t dsp56k_bank02_size = 0x4000; +static const uint16_t dsp56k_shared_ram_16_size = 0x2000; +static const uint16_t dsp56k_bank04_size = 0x1fc0; class polygonet_state : public driver_device { @@ -45,32 +45,32 @@ public: required_device m_soundlatch3; /* 68k-side shared ram */ - required_shared_ptr m_shared_ram; + required_shared_ptr m_shared_ram; - required_shared_ptr m_dsp56k_p_mirror; - required_shared_ptr m_dsp56k_p_8000; + required_shared_ptr m_dsp56k_p_mirror; + required_shared_ptr m_dsp56k_p_8000; ioport_port *m_inputs[4]; - UINT8 m_sys0; - UINT8 m_sys1; + uint8_t m_sys0; + uint8_t m_sys1; /* TTL text plane stuff */ int m_ttl_gfx_index; tilemap_t *m_ttl_tilemap; tilemap_t *m_roz_tilemap; - UINT16 m_ttl_vram[0x800]; - UINT16 m_roz_vram[0x800]; + uint16_t m_ttl_vram[0x800]; + uint16_t m_roz_vram[0x800]; /* sound */ - UINT8 m_sound_ctrl; - UINT8 m_sound_intck; + uint8_t m_sound_ctrl; + uint8_t m_sound_intck; /* memory buffers */ - UINT16 m_dsp56k_bank00_ram[2 * 8 * dsp56k_bank00_size]; /* 2 bank sets, 8 potential banks each */ - UINT16 m_dsp56k_bank01_ram[2 * 8 * dsp56k_bank01_size]; - UINT16 m_dsp56k_bank02_ram[2 * 8 * dsp56k_bank02_size]; - UINT16 m_dsp56k_shared_ram_16[2 * 8 * dsp56k_shared_ram_16_size]; - UINT16 m_dsp56k_bank04_ram[2 * 8 * dsp56k_bank04_size]; + uint16_t m_dsp56k_bank00_ram[2 * 8 * dsp56k_bank00_size]; /* 2 bank sets, 8 potential banks each */ + uint16_t m_dsp56k_bank01_ram[2 * 8 * dsp56k_bank01_size]; + uint16_t m_dsp56k_bank02_ram[2 * 8 * dsp56k_bank02_size]; + uint16_t m_dsp56k_shared_ram_16[2 * 8 * dsp56k_shared_ram_16_size]; + uint16_t m_dsp56k_bank04_ram[2 * 8 * dsp56k_bank04_size]; DECLARE_WRITE8_MEMBER(polygonet_sys_w); DECLARE_READ8_MEMBER(polygonet_inputs_r); @@ -106,7 +106,7 @@ public: virtual void machine_reset() override; virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_polygonet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_polygonet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(polygonet_interrupt); DECLARE_WRITE_LINE_MEMBER(k054539_nmi_gen); }; diff --git a/src/mame/includes/pmd85.h b/src/mame/includes/pmd85.h index 691b382a478..a876f1d9281 100644 --- a/src/mame/includes/pmd85.h +++ b/src/mame/includes/pmd85.h @@ -55,14 +55,14 @@ public: m_io_dsw0(*this, "DSW0"), m_palette(*this, "palette") { } - UINT8 m_rom_module_present; - UINT8 m_ppi_port_outputs[4][3]; - UINT8 m_startup_mem_map; - UINT8 m_pmd853_memory_mapping; + uint8_t m_rom_module_present; + uint8_t m_ppi_port_outputs[4][3]; + uint8_t m_startup_mem_map; + uint8_t m_pmd853_memory_mapping; int m_previous_level; int m_clk_level; int m_clk_level_tape; - UINT8 m_model; + uint8_t m_model; emu_timer * m_cassette_timer; void (pmd85_state::*update_memory)(); DECLARE_READ8_MEMBER(pmd85_io_r); @@ -76,7 +76,7 @@ public: DECLARE_DRIVER_INIT(alfa); DECLARE_DRIVER_INIT(c2717); virtual void machine_reset() override; - UINT32 screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(pmd85_cassette_timer_callback); DECLARE_WRITE_LINE_MEMBER(write_cas_tx); DECLARE_READ8_MEMBER(pmd85_ppi_0_porta_r); diff --git a/src/mame/includes/pokechmp.h b/src/mame/includes/pokechmp.h index 1dca3ae166a..c871713bd98 100644 --- a/src/mame/includes/pokechmp.h +++ b/src/mame/includes/pokechmp.h @@ -16,9 +16,9 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; DECLARE_WRITE8_MEMBER(pokechmp_bank_w); DECLARE_WRITE8_MEMBER(pokechmp_sound_bank_w); DECLARE_WRITE8_MEMBER(pokechmp_sound_w); @@ -27,7 +27,7 @@ public: DECLARE_DRIVER_INIT(pokechmp); TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; - UINT32 screen_update_pokechmp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pokechmp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_audiocpu; diff --git a/src/mame/includes/polepos.h b/src/mame/includes/polepos.h index dfbad5505ec..3cb277b0a29 100644 --- a/src/mame/includes/polepos.h +++ b/src/mame/includes/polepos.h @@ -56,30 +56,30 @@ public: required_device m_subcpu2; optional_device m_namco_sound; optional_device m_tms; - UINT8 m_steer_last; - UINT8 m_steer_delta; - INT16 m_steer_accum; - INT16 m_last_result; - INT8 m_last_signed; - UINT8 m_last_unsigned; + uint8_t m_steer_last; + uint8_t m_steer_delta; + int16_t m_steer_accum; + int16_t m_last_result; + int8_t m_last_signed; + uint8_t m_last_unsigned; int m_adc_input; int m_auto_start_mask; - required_shared_ptr m_sprite16_memory; - required_shared_ptr m_road16_memory; - required_shared_ptr m_alpha16_memory; - required_shared_ptr m_view16_memory; + required_shared_ptr m_sprite16_memory; + required_shared_ptr m_road16_memory; + required_shared_ptr m_alpha16_memory; + required_shared_ptr m_view16_memory; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - UINT16 m_vertical_position_modifier[256]; - UINT16 m_road16_vscroll; + uint16_t m_vertical_position_modifier[256]; + uint16_t m_road16_vscroll; tilemap_t *m_bg_tilemap; tilemap_t *m_tx_tilemap; int m_chacl; - UINT16 m_scroll; - UINT8 m_main_irq_mask; - UINT8 m_sub_irq_mask; + uint16_t m_scroll; + uint8_t m_main_irq_mask; + uint8_t m_sub_irq_mask; DECLARE_READ16_MEMBER(polepos2_ic25_r); DECLARE_READ8_MEMBER(polepos_adc_r); DECLARE_READ8_MEMBER(polepos_ready_r); @@ -121,11 +121,11 @@ public: DECLARE_MACHINE_RESET(polepos); DECLARE_VIDEO_START(polepos); DECLARE_PALETTE_INIT(polepos); - UINT32 screen_update_polepos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_polepos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(polepos_scanline); void draw_road(bitmap_ind16 &bitmap); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); - void zoom_sprite(bitmap_ind16 &bitmap,int big,UINT32 code,UINT32 color,int flipx,int sx,int sy,int sizex,int sizey); + void zoom_sprite(bitmap_ind16 &bitmap,int big,uint32_t code,uint32_t color,int flipx,int sx,int sy,int sizex,int sizey); }; @@ -135,7 +135,7 @@ class polepos_sound_device : public device_t, public device_sound_interface { public: - polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~polepos_sound_device() { } protected: @@ -151,7 +151,7 @@ public: DECLARE_WRITE8_MEMBER( polepos_engine_sound_msb_w ); private: - UINT32 m_current_position; + uint32_t m_current_position; int m_sample_msb; int m_sample_lsb; int m_sample_enable; diff --git a/src/mame/includes/policetr.h b/src/mame/includes/policetr.h index 9525c9a21a7..986ebfba0f5 100644 --- a/src/mame/includes/policetr.h +++ b/src/mame/includes/policetr.h @@ -22,26 +22,26 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - UINT32 m_control_data; - UINT32 m_bsmt_data_bank; - UINT32 m_bsmt_data_offset; - UINT32 *m_speedup_data; - UINT64 m_last_cycles; - UINT32 m_loop_count; + uint32_t m_control_data; + uint32_t m_bsmt_data_bank; + uint32_t m_bsmt_data_offset; + uint32_t *m_speedup_data; + uint64_t m_last_cycles; + uint32_t m_loop_count; offs_t m_speedup_pc; - required_shared_ptr m_rambase; - UINT32 m_palette_offset; - UINT8 m_palette_index; - UINT8 m_palette_data[3]; + required_shared_ptr m_rambase; + uint32_t m_palette_offset; + uint8_t m_palette_index; + uint8_t m_palette_data[3]; rectangle m_render_clip; - UINT8 *m_srcbitmap; - std::unique_ptr m_dstbitmap; - UINT16 m_src_xoffs; - UINT16 m_src_yoffs; - UINT16 m_dst_xoffs; - UINT16 m_dst_yoffs; - UINT8 m_video_latch; - UINT32 m_srcbitmap_height_mask; + uint8_t *m_srcbitmap; + std::unique_ptr m_dstbitmap; + uint16_t m_src_xoffs; + uint16_t m_src_yoffs; + uint16_t m_dst_xoffs; + uint16_t m_dst_yoffs; + uint8_t m_video_latch; + uint32_t m_srcbitmap_height_mask; DECLARE_WRITE32_MEMBER(control_w); DECLARE_WRITE32_MEMBER(policetr_bsmt2000_reg_w); DECLARE_WRITE32_MEMBER(policetr_bsmt2000_data_w); @@ -57,7 +57,7 @@ public: DECLARE_DRIVER_INIT(sshooter); DECLARE_DRIVER_INIT(plctr13b); virtual void video_start() override; - UINT32 screen_update_policetr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_policetr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(irq4_gen); void render_display_list(offs_t offset); required_device m_maincpu; diff --git a/src/mame/includes/poly88.h b/src/mame/includes/poly88.h index 9a3dc93f135..24e402dd069 100644 --- a/src/mame/includes/poly88.h +++ b/src/mame/includes/poly88.h @@ -38,11 +38,11 @@ public: m_line5(*this, "LINE5"), m_line6(*this, "LINE6") { } - required_shared_ptr m_video_ram; - UINT8 *m_FNT; - UINT8 m_intr; - UINT8 m_last_code; - UINT8 m_int_vector; + required_shared_ptr m_video_ram; + uint8_t *m_FNT; + uint8_t m_intr; + uint8_t m_last_code; + uint8_t m_int_vector; emu_timer * m_cassette_timer; emu_timer * m_usart_timer; int m_previous_level; @@ -54,7 +54,7 @@ public: DECLARE_DRIVER_INIT(poly88); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_poly88(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_poly88(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(poly88_interrupt); TIMER_CALLBACK_MEMBER(poly88_usart_timer_callback); TIMER_CALLBACK_MEMBER(keyboard_callback); @@ -76,7 +76,7 @@ protected: required_ioport m_line4; required_ioport m_line5; required_ioport m_line6; - UINT8 row_number(UINT8 code); + uint8_t row_number(uint8_t code); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; int m_cas_tx; diff --git a/src/mame/includes/poly880.h b/src/mame/includes/poly880.h index 6245a728a9c..71b7f1bb60b 100644 --- a/src/mame/includes/poly880.h +++ b/src/mame/includes/poly880.h @@ -52,8 +52,8 @@ public: void update_display(); /* display state */ - UINT8 m_digit; - UINT8 m_segment; + uint8_t m_digit; + uint8_t m_segment; }; #endif diff --git a/src/mame/includes/polyplay.h b/src/mame/includes/polyplay.h index cc0b31abb6f..983f98c8098 100644 --- a/src/mame/includes/polyplay.h +++ b/src/mame/includes/polyplay.h @@ -16,8 +16,8 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; - required_shared_ptr m_characterram; + required_shared_ptr m_videoram; + required_shared_ptr m_characterram; required_device m_maincpu; required_device m_samples; @@ -28,7 +28,7 @@ public: int m_freq2; int m_channel_playing1; int m_channel_playing2; - INT16 m_backgroundwave[SAMPLE_LENGTH]; + int16_t m_backgroundwave[SAMPLE_LENGTH]; int m_prescale1; int m_prescale2; int m_channel1_active; @@ -50,7 +50,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(polyplay); - UINT32 screen_update_polyplay(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_polyplay(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(periodic_interrupt); INTERRUPT_GEN_MEMBER(coin_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(polyplay_timer_callback); diff --git a/src/mame/includes/poolshrk.h b/src/mame/includes/poolshrk.h index ee10110e0ba..865eeebbdff 100644 --- a/src/mame/includes/poolshrk.h +++ b/src/mame/includes/poolshrk.h @@ -31,9 +31,9 @@ public: required_device m_palette; required_device m_discrete; - required_shared_ptr m_playfield_ram; - required_shared_ptr m_hpos_ram; - required_shared_ptr m_vpos_ram; + required_shared_ptr m_playfield_ram; + required_shared_ptr m_hpos_ram; + required_shared_ptr m_vpos_ram; tilemap_t* m_bg_tilemap; int m_da_latch; @@ -54,7 +54,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(poolshrk); - 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); }; diff --git a/src/mame/includes/pooyan.h b/src/mame/includes/pooyan.h index 3eb5fb91808..763c88bacf7 100644 --- a/src/mame/includes/pooyan.h +++ b/src/mame/includes/pooyan.h @@ -19,16 +19,16 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; /* video-related */ tilemap_t *m_bg_tilemap; /* misc */ - UINT8 m_irq_enable; + uint8_t m_irq_enable; DECLARE_WRITE8_MEMBER(irq_enable_w); DECLARE_WRITE8_MEMBER(videoram_w); @@ -42,7 +42,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(pooyan); - 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); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); INTERRUPT_GEN_MEMBER(interrupt); diff --git a/src/mame/includes/popeye.h b/src/mame/includes/popeye.h index e0a9bb310d8..062e9511bab 100644 --- a/src/mame/includes/popeye.h +++ b/src/mame/includes/popeye.h @@ -17,24 +17,24 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_prot0; - UINT8 m_prot1; - UINT8 m_prot_shift; - UINT8 m_dswbit; - required_shared_ptr m_background_pos; - required_shared_ptr m_palettebank; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_region_ptr m_color_prom; - required_region_ptr m_color_prom_spr; + uint8_t m_prot0; + uint8_t m_prot1; + uint8_t m_prot_shift; + uint8_t m_dswbit; + required_shared_ptr m_background_pos; + required_shared_ptr m_palettebank; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_region_ptr m_color_prom; + required_region_ptr m_color_prom_spr; - std::unique_ptr m_bitmapram; + std::unique_ptr m_bitmapram; std::unique_ptr m_tmpbitmap2; - UINT8 m_invertmask; - UINT8 m_bitmap_type; + uint8_t m_invertmask; + uint8_t m_bitmap_type; tilemap_t *m_fg_tilemap; - UINT8 m_lastflip; + uint8_t m_lastflip; int m_field; DECLARE_READ8_MEMBER(protection_r); @@ -53,10 +53,10 @@ public: DECLARE_VIDEO_START(popeye); DECLARE_PALETTE_INIT(popeyebl); DECLARE_PALETTE_INIT(skyskipr); - UINT32 screen_update_popeye(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_popeye(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(popeye_interrupt); DECLARE_CUSTOM_INPUT_MEMBER( pop_field_r ); - void convert_color_prom(const UINT8 *color_prom); + void convert_color_prom(const uint8_t *color_prom); void set_background_palette(int bank); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/portrait.h b/src/mame/includes/portrait.h index 6d978f630fd..643b2c0847a 100644 --- a/src/mame/includes/portrait.h +++ b/src/mame/includes/portrait.h @@ -20,9 +20,9 @@ public: required_device m_palette; required_device m_tms; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_spriteram; int m_scroll; tilemap_t *m_foreground; @@ -40,7 +40,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(portrait); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - inline void get_tile_info( tile_data &tileinfo, int tile_index, const UINT8 *source ); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + inline void get_tile_info( tile_data &tileinfo, int tile_index, const uint8_t *source ); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/powerins.h b/src/mame/includes/powerins.h index 1b6e5a65f99..37e36c29099 100644 --- a/src/mame/includes/powerins.h +++ b/src/mame/includes/powerins.h @@ -22,10 +22,10 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_vctrl_0; - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_spriteram; + required_shared_ptr m_vctrl_0; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_spriteram; tilemap_t *m_tilemap_0; tilemap_t *m_tilemap_1; @@ -46,6 +46,6 @@ public: virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); }; diff --git a/src/mame/includes/pp01.h b/src/mame/includes/pp01.h index e8e15fce57e..055f0b3bd0b 100644 --- a/src/mame/includes/pp01.h +++ b/src/mame/includes/pp01.h @@ -33,10 +33,10 @@ public: required_device m_pit; required_device m_speaker; required_device m_ram; - UINT8 m_video_scroll; - UINT8 m_memory_block[16]; - UINT8 m_video_write_mode; - UINT8 m_key_line; + uint8_t m_video_scroll; + uint8_t m_memory_block[16]; + uint8_t m_video_write_mode; + uint8_t m_key_line; DECLARE_WRITE8_MEMBER(pp01_video_write_mode_w); DECLARE_WRITE8_MEMBER(pp01_video_r_1_w); DECLARE_WRITE8_MEMBER(pp01_video_g_1_w); @@ -50,7 +50,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(pp01); - UINT32 screen_update_pp01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pp01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(pp01_pit_out0); DECLARE_WRITE_LINE_MEMBER(pp01_pit_out1); DECLARE_READ8_MEMBER(pp01_8255_porta_r); @@ -59,8 +59,8 @@ public: DECLARE_WRITE8_MEMBER(pp01_8255_portb_w); DECLARE_WRITE8_MEMBER(pp01_8255_portc_w); DECLARE_READ8_MEMBER(pp01_8255_portc_r); - void pp01_video_w(UINT8 block,UINT16 offset,UINT8 data,UINT8 part); - void pp01_set_memory(UINT8 block, UINT8 data); + void pp01_video_w(uint8_t block,uint16_t offset,uint8_t data,uint8_t part); + void pp01_set_memory(uint8_t block, uint8_t data); }; #endif diff --git a/src/mame/includes/prehisle.h b/src/mame/includes/prehisle.h index b8d3eb22e64..e943f7f1697 100644 --- a/src/mame/includes/prehisle.h +++ b/src/mame/includes/prehisle.h @@ -21,11 +21,11 @@ public: m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_tx_vram; - required_shared_ptr m_spriteram; - required_shared_ptr m_fg_vram; - required_region_ptr m_tilemap_rom; - UINT16 m_invert_controls; + required_shared_ptr m_tx_vram; + required_shared_ptr m_spriteram; + required_shared_ptr m_fg_vram; + required_region_ptr m_tilemap_rom; + uint16_t m_invert_controls; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -42,7 +42,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_tx_tile_info); virtual void video_start() override; - UINT32 screen_update_prehisle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_prehisle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; diff --git a/src/mame/includes/primo.h b/src/mame/includes/primo.h index ee12938af28..6714cb77130 100644 --- a/src/mame/includes/primo.h +++ b/src/mame/includes/primo.h @@ -40,8 +40,8 @@ public: memory_region *m_cart1_rom; memory_region *m_cart2_rom; - UINT16 m_video_memory_base; - UINT8 m_port_FD; + uint16_t m_video_memory_base; + uint8_t m_port_FD; int m_nmi; DECLARE_READ8_MEMBER(primo_be_1_r); DECLARE_READ8_MEMBER(primo_be_2_r); @@ -54,14 +54,14 @@ public: virtual void machine_reset() override; virtual void machine_start() override; DECLARE_MACHINE_RESET(primob); - UINT32 screen_update_primo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_primo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(primo_vblank_interrupt); void primo_draw_scanline(bitmap_ind16 &bitmap, int primo_scanline); void primo_update_memory(); void primo_common_driver_init (primo_state *state); void primo_common_machine_init (); - void primo_setup_pss (UINT8* snapshot_data, UINT32 snapshot_size); - void primo_setup_pp (UINT8* quickload_data, UINT32 quickload_size); + void primo_setup_pss (uint8_t* snapshot_data, uint32_t snapshot_size); + void primo_setup_pp (uint8_t* quickload_data, uint32_t quickload_size); DECLARE_SNAPSHOT_LOAD_MEMBER( primo ); DECLARE_QUICKLOAD_LOAD_MEMBER( primo ); }; diff --git a/src/mame/includes/prof180x.h b/src/mame/includes/prof180x.h index 7caadfc1345..5b60c13e536 100644 --- a/src/mame/includes/prof180x.h +++ b/src/mame/includes/prof180x.h @@ -36,7 +36,7 @@ public: void ls259_w(int flag, int value); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); int m_c0; int m_c1; diff --git a/src/mame/includes/psikyo.h b/src/mame/includes/psikyo.h index 9d0f2f6b69e..7e7ff2a47f8 100644 --- a/src/mame/includes/psikyo.h +++ b/src/mame/includes/psikyo.h @@ -25,13 +25,13 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_vregs; - optional_shared_ptr m_bootleg_spritebuffer; - std::unique_ptr m_spritebuf1; - std::unique_ptr m_spritebuf2; + required_shared_ptr m_spriteram; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_vregs; + optional_shared_ptr m_bootleg_spritebuffer; + std::unique_ptr m_spritebuf1; + std::unique_ptr m_spritebuf2; /* video-related */ tilemap_t *m_tilemap_0_size0; @@ -47,7 +47,7 @@ public: int m_ka302c_banking; /* misc */ - UINT8 m_soundlatch; + uint8_t m_soundlatch; int m_z80_nmi; int m_mcu_status; @@ -56,16 +56,16 @@ public: /* game-specific */ // 1945 MCU - UINT8 m_s1945_mcu_direction; - UINT8 m_s1945_mcu_latch1; - UINT8 m_s1945_mcu_latch2; - UINT8 m_s1945_mcu_inlatch; - UINT8 m_s1945_mcu_index; - UINT8 m_s1945_mcu_latching; - UINT8 m_s1945_mcu_mode; - UINT8 m_s1945_mcu_control; - UINT8 m_s1945_mcu_bctrl; - const UINT8 *m_s1945_mcu_table; + uint8_t m_s1945_mcu_direction; + uint8_t m_s1945_mcu_latch1; + uint8_t m_s1945_mcu_latch2; + uint8_t m_s1945_mcu_inlatch; + uint8_t m_s1945_mcu_index; + uint8_t m_s1945_mcu_latching; + uint8_t m_s1945_mcu_mode; + uint8_t m_s1945_mcu_control; + uint8_t m_s1945_mcu_bctrl; + const uint8_t *m_s1945_mcu_table; DECLARE_READ32_MEMBER(sngkace_input_r); DECLARE_READ32_MEMBER(gunbird_input_r); DECLARE_WRITE32_MEMBER(psikyo_soundlatch_w); @@ -97,8 +97,8 @@ public: virtual void machine_reset() override; DECLARE_VIDEO_START(sngkace); DECLARE_VIDEO_START(psikyo); - UINT32 screen_update_psikyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_psikyo_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_psikyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_psikyo_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_psikyo(screen_device &screen, bool state); TIMER_CALLBACK_MEMBER(psikyo_soundlatch_callback); void psikyo_switch_banks( int tmap, int bank ); diff --git a/src/mame/includes/psikyo4.h b/src/mame/includes/psikyo4.h index 2ab63aaf69a..4ebf652ca96 100644 --- a/src/mame/includes/psikyo4.h +++ b/src/mame/includes/psikyo4.h @@ -34,15 +34,15 @@ public: { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_vidregs; - required_shared_ptr m_bgpen_1; - required_shared_ptr m_bgpen_2; - required_shared_ptr m_paletteram; + required_shared_ptr m_spriteram; + required_shared_ptr m_vidregs; + required_shared_ptr m_bgpen_1; + required_shared_ptr m_bgpen_2; + required_shared_ptr m_paletteram; memory_bank *m_ymf_bank[4]; - UINT8 m_ymf_max_bank; - UINT8 m_io_select; + uint8_t m_ymf_max_bank; + uint8_t m_io_select; /* video-related */ double m_oldbrt1; @@ -71,8 +71,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_psikyo4_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_psikyo4_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_psikyo4_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_psikyo4_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(psikyosh_interrupt); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 scr); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t scr); }; diff --git a/src/mame/includes/psikyosh.h b/src/mame/includes/psikyosh.h index 4332eb98ab6..c40b37ec0ad 100644 --- a/src/mame/includes/psikyosh.h +++ b/src/mame/includes/psikyosh.h @@ -40,17 +40,17 @@ public: /* memory pointers */ required_device m_spriteram; - required_shared_ptr m_bgram; - required_shared_ptr m_zoomram; - required_shared_ptr m_vidregs; - required_shared_ptr m_ram; + required_shared_ptr m_bgram; + required_shared_ptr m_zoomram; + required_shared_ptr m_vidregs; + required_shared_ptr m_ram; /* video-related */ bitmap_ind8 m_zoom_bitmap; bitmap_ind16 m_z_bitmap; bitmap_rgb32 m_bg_bitmap; - std::unique_ptr m_bg_zoom; - UINT8 m_alphatable[256]; + std::unique_ptr m_bg_zoom; + uint8_t m_alphatable[256]; /* devices */ required_device m_maincpu; @@ -69,19 +69,19 @@ public: DECLARE_DRIVER_INIT(mjgtaste); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_psikyosh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_psikyosh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(psikyosh_interrupt); - void draw_scanline32_alpha(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT32 *srcptr, int alpha); - void draw_scanline32_argb(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT32 *srcptr); - void draw_scanline32_transpen(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT32 *srcptr); - void draw_bglayer( int layer, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 req_pri ); + void draw_scanline32_alpha(bitmap_rgb32 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint32_t *srcptr, int alpha); + void draw_scanline32_argb(bitmap_rgb32 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint32_t *srcptr); + void draw_scanline32_transpen(bitmap_rgb32 &bitmap, int32_t destx, int32_t desty, int32_t length, const uint32_t *srcptr); + void draw_bglayer( int layer, bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t req_pri ); void cache_bitmap(int scanline, gfx_element *gfx, int size, int tilebank, int alpha, int *last_bank); - void draw_bglayerscroll( int layer, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 req_pri ); - void draw_background( bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 req_pri ); - void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 req_pri); + void draw_bglayerscroll( int layer, bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t req_pri ); + void draw_background( bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t req_pri ); + void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t req_pri); void psikyosh_prelineblend( bitmap_rgb32 &bitmap, const rectangle &cliprect ); - void psikyosh_postlineblend( bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 req_pri ); + void psikyosh_postlineblend( bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t req_pri ); void psikyosh_drawgfxzoom( bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, - UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, - int alpha, int zoomx, int zoomy, int wide, int high, UINT32 z); + uint32_t code,uint32_t color,int flipx,int flipy,int offsx,int offsy, + int alpha, int zoomx, int zoomy, int wide, int high, uint32_t z); }; diff --git a/src/mame/includes/psion.h b/src/mame/includes/psion.h index e13bfbce8dd..3c623b33b0c 100644 --- a/src/mame/includes/psion.h +++ b/src/mame/includes/psion.h @@ -46,35 +46,35 @@ public: required_device m_nvram2; optional_device m_nvram3; - UINT16 m_kb_counter; - UINT8 m_enable_nmi; - optional_shared_ptr m_sys_register; - UINT8 m_tcsr_value; - UINT8 m_stby_pwr; - UINT8 m_pulse; - - UINT8 m_port2_ddr; // datapack i/o ddr - UINT8 m_port2; // datapack i/o data bus - UINT8 m_port6_ddr; // datapack control lines ddr - UINT8 m_port6; // datapack control lines + uint16_t m_kb_counter; + uint8_t m_enable_nmi; + optional_shared_ptr m_sys_register; + uint8_t m_tcsr_value; + uint8_t m_stby_pwr; + uint8_t m_pulse; + + uint8_t m_port2_ddr; // datapack i/o ddr + uint8_t m_port2; // datapack i/o data bus + uint8_t m_port6_ddr; // datapack control lines ddr + uint8_t m_port6; // datapack control lines // RAM/ROM banks - required_shared_ptr m_ram; - std::unique_ptr m_paged_ram; - UINT8 m_rom_bank; - UINT8 m_ram_bank; - UINT8 m_ram_bank_count; - UINT8 m_rom_bank_count; + required_shared_ptr m_ram; + std::unique_ptr m_paged_ram; + uint8_t m_rom_bank; + uint8_t m_ram_bank; + uint8_t m_ram_bank_count; + uint8_t m_rom_bank_count; virtual void machine_start() override; virtual void machine_reset() override; void nvram_init(nvram_device &nvram, void *data, size_t size); - UINT8 kb_read(); + uint8_t kb_read(); void update_banks(); DECLARE_WRITE8_MEMBER( hd63701_int_reg_w ); DECLARE_READ8_MEMBER( hd63701_int_reg_r ); - void io_rw(address_space &space, UINT16 offset); + void io_rw(address_space &space, uint16_t offset); DECLARE_WRITE8_MEMBER( io_w ); DECLARE_READ8_MEMBER( io_r ); DECLARE_PALETTE_INIT(psion); diff --git a/src/mame/includes/psychic5.h b/src/mame/includes/psychic5.h index 3430fb2d3aa..768ce2088e3 100644 --- a/src/mame/includes/psychic5.h +++ b/src/mame/includes/psychic5.h @@ -31,22 +31,22 @@ public: optional_device m_vrambank; optional_device m_blend; - required_shared_ptr m_spriteram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_bg_control; - required_shared_ptr m_ps5_palette_ram_bg; - required_shared_ptr m_ps5_palette_ram_sp; - required_shared_ptr m_ps5_palette_ram_tx; + required_shared_ptr m_spriteram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_bg_control; + required_shared_ptr m_ps5_palette_ram_bg; + required_shared_ptr m_ps5_palette_ram_sp; + required_shared_ptr m_ps5_palette_ram_tx; - UINT8 m_bank_latch; - UINT8 m_ps5_vram_page; - UINT8 m_bg_clip_mode; - UINT8 m_title_screen; + uint8_t m_bank_latch; + uint8_t m_ps5_vram_page; + uint8_t m_bg_clip_mode; + uint8_t m_title_screen; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT16 m_palette_intensity; - UINT8 m_bombsa_unknown; + uint16_t m_palette_intensity; + uint8_t m_bombsa_unknown; int m_sx1; int m_sy1; int m_sy2; @@ -83,9 +83,9 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(scanline); - UINT32 screen_update_psychic5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bombsa(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void change_palette(int offset, UINT8* palram, int palbase); + uint32_t screen_update_psychic5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bombsa(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void change_palette(int offset, uint8_t* palram, int palbase); void change_bg_palette(int color, int lo_offs, int hi_offs); void set_background_palette_intensity(); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/punchout.h b/src/mame/includes/punchout.h index 874b31678d1..93f562ce3b1 100644 --- a/src/mame/includes/punchout.h +++ b/src/mame/includes/punchout.h @@ -40,14 +40,14 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_bg_top_videoram; - required_shared_ptr m_spr1_ctrlram; - required_shared_ptr m_spr2_ctrlram; - required_shared_ptr m_palettebank; - required_shared_ptr m_spr1_videoram; - required_shared_ptr m_spr2_videoram; - required_shared_ptr m_bg_bot_videoram; - optional_shared_ptr m_armwrest_fg_videoram; + required_shared_ptr m_bg_top_videoram; + required_shared_ptr m_spr1_ctrlram; + required_shared_ptr m_spr2_ctrlram; + required_shared_ptr m_palettebank; + required_shared_ptr m_spr1_videoram; + required_shared_ptr m_spr2_videoram; + required_shared_ptr m_bg_bot_videoram; + optional_shared_ptr m_armwrest_fg_videoram; tilemap_t *m_bg_top_tilemap; tilemap_t *m_bg_bot_tilemap; @@ -56,7 +56,7 @@ public: tilemap_t *m_spr1_tilemap_flipx; tilemap_t *m_spr2_tilemap; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(punchout_2a03_reset_w); DECLARE_READ8_MEMBER(spunchout_exp_r); DECLARE_WRITE8_MEMBER(spunchout_exp_w); @@ -83,10 +83,10 @@ public: virtual void video_start() override; DECLARE_VIDEO_START(armwrest); DECLARE_MACHINE_RESET(spnchout); - UINT32 screen_update_punchout_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_punchout_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_armwrest_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_armwrest_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_punchout_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_punchout_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_armwrest_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_armwrest_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_big_sprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palette); void armwrest_draw_big_sprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int palette); diff --git a/src/mame/includes/px8.h b/src/mame/includes/px8.h index 8ce81932b28..9eeef2c41f9 100644 --- a/src/mame/includes/px8.h +++ b/src/mame/includes/px8.h @@ -42,12 +42,12 @@ public: required_device m_cassette; required_device m_ram; /* video state */ - required_shared_ptr m_video_ram; /* LCD video RAM */ + required_shared_ptr m_video_ram; /* LCD video RAM */ virtual void machine_start() override; virtual void machine_reset() override; - 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); DECLARE_READ8_MEMBER( gah40m_r ); DECLARE_WRITE8_MEMBER( gah40m_w ); @@ -59,21 +59,21 @@ public: DECLARE_WRITE8_MEMBER( ksc_w ); void bankswitch(); - UINT8 krtn_read(); + uint8_t krtn_read(); /* GAH40M state */ - UINT16 m_icr; /* input capture register */ - UINT16 m_frc; /* free running counter */ - UINT8 m_ier; /* interrupt acknowledge register */ - UINT8 m_isr; /* interrupt status register */ - UINT8 m_sio; /* serial I/O register */ + uint16_t m_icr; /* input capture register */ + uint16_t m_frc; /* free running counter */ + uint8_t m_ier; /* interrupt acknowledge register */ + uint8_t m_isr; /* interrupt status register */ + uint8_t m_sio; /* serial I/O register */ int m_bank0; /* */ /* GAH40S state */ - UINT16 m_cnt; /* microcassette tape counter */ + uint16_t m_cnt; /* microcassette tape counter */ int m_swpr; /* P-ROM power switch */ - UINT16 m_pra; /* P-ROM address */ - UINT8 m_prd; /* P-ROM data */ + uint16_t m_pra; /* P-ROM address */ + uint8_t m_prd; /* P-ROM data */ /* memory state */ int m_bk2; /* */ diff --git a/src/mame/includes/qdrmfgp.h b/src/mame/includes/qdrmfgp.h index 565b507933b..c7e0e2ab8ac 100644 --- a/src/mame/includes/qdrmfgp.h +++ b/src/mame/includes/qdrmfgp.h @@ -25,8 +25,8 @@ public: } required_device m_maincpu; - required_shared_ptr m_nvram; - required_shared_ptr m_workram; + required_shared_ptr m_nvram; + required_shared_ptr m_workram; required_device m_k056832; required_device m_k054539; required_device m_k053252; @@ -35,10 +35,10 @@ public: required_ioport m_dsw_port; required_device m_palette; - UINT8 *m_sndram; - UINT16 m_control; - INT32 m_gp2_irq_control; - INT32 m_pal; + uint8_t *m_sndram; + uint16_t m_control; + int32_t m_gp2_irq_control; + int32_t m_pal; DECLARE_WRITE16_MEMBER(gp_control_w); DECLARE_WRITE16_MEMBER(gp2_control_w); @@ -59,7 +59,7 @@ public: DECLARE_VIDEO_START(qdrmfgp); DECLARE_MACHINE_START(qdrmfgp2); DECLARE_VIDEO_START(qdrmfgp2); - UINT32 screen_update_qdrmfgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_qdrmfgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(qdrmfgp2_interrupt); TIMER_CALLBACK_MEMBER(gp2_timer_callback); TIMER_DEVICE_CALLBACK_MEMBER(qdrmfgp_interrupt); diff --git a/src/mame/includes/qix.h b/src/mame/includes/qix.h index 0372610aec1..3f4cbbc06a8 100644 --- a/src/mame/includes/qix.h +++ b/src/mame/includes/qix.h @@ -67,20 +67,20 @@ public: optional_device m_discrete; /* machine state */ - optional_shared_ptr m_68705_port_out; - optional_shared_ptr m_68705_ddr; - UINT8 m_68705_port_in[3]; - UINT8 m_coinctrl; + optional_shared_ptr m_68705_port_out; + optional_shared_ptr m_68705_ddr; + uint8_t m_68705_port_in[3]; + uint8_t m_coinctrl; /* video state */ - required_shared_ptr m_paletteram; - optional_shared_ptr m_videoram; - required_shared_ptr m_videoram_address; - optional_shared_ptr m_videoram_mask; - required_shared_ptr m_scanline_latch; - UINT8 m_flip; - UINT8 m_palette_bank; - UINT8 m_leds; + required_shared_ptr m_paletteram; + optional_shared_ptr m_videoram; + required_shared_ptr m_videoram_address; + optional_shared_ptr m_videoram_mask; + required_shared_ptr m_scanline_latch; + uint8_t m_flip; + uint8_t m_palette_bank; + uint8_t m_leds; optional_memory_bank m_bank0; optional_memory_bank m_bank1; @@ -141,7 +141,7 @@ public: MC6845_UPDATE_ROW(crtc_update_row); void set_pen(int offs); int kram3_permut1(int idx, int value); - int kram3_permut2(int tbl_index, int idx, const UINT8 *xor_table); + int kram3_permut2(int tbl_index, int idx, const uint8_t *xor_table); int kram3_decrypt(int address, int value); DECLARE_WRITE_LINE_MEMBER(kram3_lic_maincpu_changed); DECLARE_WRITE_LINE_MEMBER(kram3_lic_videocpu_changed); diff --git a/src/mame/includes/quasar.h b/src/mame/includes/quasar.h index 3c8569c4626..77827a677ea 100644 --- a/src/mame/includes/quasar.h +++ b/src/mame/includes/quasar.h @@ -14,10 +14,10 @@ public: quasar_state(const machine_config &mconfig, device_type type, const char *tag) : cvs_state(mconfig, type, tag) { } - std::unique_ptr m_effectram; - UINT8 m_effectcontrol; - UINT8 m_page; - UINT8 m_io_page; + std::unique_ptr m_effectram; + uint8_t m_effectcontrol; + uint8_t m_page; + uint8_t m_io_page; DECLARE_WRITE8_MEMBER(video_page_select_w); DECLARE_WRITE8_MEMBER(io_page_select_w); DECLARE_WRITE8_MEMBER(quasar_video_w); @@ -30,6 +30,6 @@ public: DECLARE_MACHINE_RESET(quasar); DECLARE_VIDEO_START(quasar); DECLARE_PALETTE_INIT(quasar); - UINT32 screen_update_quasar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_quasar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(quasar_interrupt); }; diff --git a/src/mame/includes/quizdna.h b/src/mame/includes/quizdna.h index 7d4bf69ac9c..d5b8d45f988 100644 --- a/src/mame/includes/quizdna.h +++ b/src/mame/includes/quizdna.h @@ -15,14 +15,14 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_spriteram; + required_shared_ptr m_generic_paletteram_8; - std::unique_ptr m_bg_ram; - std::unique_ptr m_fg_ram; + std::unique_ptr m_bg_ram; + std::unique_ptr m_fg_ram; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_bg_xscroll[2]; + uint8_t m_bg_xscroll[2]; int m_flipscreen; int m_video_enable; @@ -44,6 +44,6 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/quizpani.h b/src/mame/includes/quizpani.h index 12ae17965d1..7031cadd85d 100644 --- a/src/mame/includes/quizpani.h +++ b/src/mame/includes/quizpani.h @@ -16,9 +16,9 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_scrollreg; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_txt_videoram; + required_shared_ptr m_scrollreg; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_txt_videoram; tilemap_t *m_bg_tilemap; tilemap_t *m_txt_tilemap; @@ -35,5 +35,5 @@ public: virtual void video_start() override; - 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); }; diff --git a/src/mame/includes/radio86.h b/src/mame/includes/radio86.h index 8985e1692f6..21bb9f774fe 100644 --- a/src/mame/includes/radio86.h +++ b/src/mame/includes/radio86.h @@ -56,14 +56,14 @@ public: virtual void video_start() override; - UINT8 m_tape_value; - UINT8 m_mikrosha_font_page; + uint8_t m_tape_value; + uint8_t m_mikrosha_font_page; int m_keyboard_mask; - std::unique_ptr m_radio_ram_disk; - UINT8 m_romdisk_lsb; - UINT8 m_romdisk_msb; - UINT8 m_disk_sel; - const UINT8 *m_charmap; + std::unique_ptr m_radio_ram_disk; + uint8_t m_romdisk_lsb; + uint8_t m_romdisk_msb; + uint8_t m_disk_sel; + const uint8_t *m_charmap; DECLARE_READ8_MEMBER(radio_cpu_state_r); DECLARE_READ8_MEMBER(radio_io_r); DECLARE_WRITE8_MEMBER(radio_io_w); diff --git a/src/mame/includes/raiden.h b/src/mame/includes/raiden.h index ab809bc8552..77b3a88af4d 100644 --- a/src/mame/includes/raiden.h +++ b/src/mame/includes/raiden.h @@ -32,21 +32,21 @@ public: required_device m_palette; required_device m_spriteram; - required_shared_ptr m_shared_ram; - required_shared_ptr m_videoram; - optional_shared_ptr m_scroll_ram; - required_shared_ptr m_back_data; - required_shared_ptr m_fore_data; + required_shared_ptr m_shared_ram; + required_shared_ptr m_videoram; + optional_shared_ptr m_scroll_ram; + required_shared_ptr m_back_data; + required_shared_ptr m_fore_data; tilemap_t *m_bg_layer; tilemap_t *m_fg_layer; tilemap_t *m_tx_layer; - UINT8 m_bg_layer_enabled; - UINT8 m_fg_layer_enabled; - UINT8 m_tx_layer_enabled; - UINT8 m_sp_layer_enabled; - UINT8 m_flipscreen; - UINT16 m_raidenb_scroll_ram[6]; + uint8_t m_bg_layer_enabled; + uint8_t m_fg_layer_enabled; + uint8_t m_tx_layer_enabled; + uint8_t m_sp_layer_enabled; + uint8_t m_flipscreen; + uint16_t m_raidenb_scroll_ram[6]; DECLARE_WRITE16_MEMBER(raiden_background_w); DECLARE_WRITE16_MEMBER(raiden_foreground_w); @@ -66,9 +66,9 @@ public: virtual void video_start() override; DECLARE_VIDEO_START(raidenb); - UINT32 screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *scrollregs); - UINT32 screen_update_raiden(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_raidenb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *scrollregs); + uint32_t screen_update_raiden(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_raidenb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(raiden_interrupt); diff --git a/src/mame/includes/raiden2.h b/src/mame/includes/raiden2.h index c8bae63738a..52adc726ed8 100644 --- a/src/mame/includes/raiden2.h +++ b/src/mame/includes/raiden2.h @@ -39,16 +39,16 @@ public: sprite_buffer(320, 256), m_raiden2cop(*this, "raiden2cop") { - memset(scrollvals, 0, sizeof(UINT16)*6); - memset(sprite_prot_src_addr, 0, sizeof(UINT16)*2); + memset(scrollvals, 0, sizeof(uint16_t)*6); + memset(sprite_prot_src_addr, 0, sizeof(uint16_t)*2); } - std::unique_ptr back_data; - std::unique_ptr fore_data; - std::unique_ptr mid_data; - std::unique_ptr text_data; // private buffers, allocated in init - required_shared_ptr sprites; + std::unique_ptr back_data; + std::unique_ptr fore_data; + std::unique_ptr mid_data; + std::unique_ptr text_data; // private buffers, allocated in init + required_shared_ptr sprites; required_device m_maincpu; optional_device m_seibu_sound; required_device m_gfxdecode; @@ -85,9 +85,9 @@ public: void common_reset(); - static UINT16 const raiden_blended_colors[]; - static UINT16 const xsedae_blended_colors[]; - static UINT16 const zeroteam_blended_colors[]; + static uint16_t const raiden_blended_colors[]; + static uint16_t const xsedae_blended_colors[]; + static uint16_t const zeroteam_blended_colors[]; bool blend_active[0x800]; // cfg @@ -95,11 +95,11 @@ public: int bg_bank, fg_bank, mid_bank, tx_bank; - UINT16 raiden2_tilemap_enable; - UINT8 prg_bank; - UINT16 cop_bank; + uint16_t raiden2_tilemap_enable; + uint8_t prg_bank; + uint16_t cop_bank; - UINT16 scrollvals[6]; + uint16_t scrollvals[6]; @@ -116,8 +116,8 @@ public: DECLARE_WRITE16_MEMBER( sprite_prot_maxx_w ); DECLARE_WRITE16_MEMBER( sprite_prot_off_w ); - UINT16 sprite_prot_x,sprite_prot_y,dst1,cop_spr_maxx,cop_spr_off; - UINT16 sprite_prot_src_addr[2]; + uint16_t sprite_prot_x,sprite_prot_y,dst1,cop_spr_maxx,cop_spr_off; + uint16_t sprite_prot_src_addr[2]; @@ -140,15 +140,15 @@ public: DECLARE_MACHINE_RESET(zeroteam); DECLARE_MACHINE_RESET(xsedae); DECLARE_MACHINE_RESET(raidendx); - UINT32 screen_update_raiden2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_raiden2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(raiden2_interrupt); - void combine32(UINT32 *val, int offset, UINT16 data, UINT16 mem_mask); + void combine32(uint32_t *val, int offset, uint16_t data, uint16_t mem_mask); void sprcpt_init(void); void blend_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind16 &source, int layer); void tilemap_draw_and_blend(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *tilemap); - void init_blending(const UINT16 *table); + void init_blending(const uint16_t *table); bitmap_ind16 tile_buffer, sprite_buffer; optional_device m_raiden2cop; diff --git a/src/mame/includes/rallyx.h b/src/mame/includes/rallyx.h index cf56d22ef3a..4a30ca2e129 100644 --- a/src/mame/includes/rallyx.h +++ b/src/mame/includes/rallyx.h @@ -26,12 +26,12 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_radarattr; - UINT8 * m_spriteram; - UINT8 * m_spriteram2; - UINT8 * m_radarx; - UINT8 * m_radary; + required_shared_ptr m_videoram; + required_shared_ptr m_radarattr; + uint8_t * m_spriteram; + uint8_t * m_spriteram2; + uint8_t * m_radarx; + uint8_t * m_radary; /* video-related */ tilemap_t *m_bg_tilemap; @@ -42,7 +42,7 @@ public: int m_spriteram_base; int m_stars_enable; int m_total_stars; - UINT8 m_drawmode_table[4]; + uint8_t m_drawmode_table[4]; struct jungler_star m_stars[JUNGLER_MAX_STARS]; /* devices */ @@ -53,7 +53,7 @@ public: required_device m_gfxdecode; required_device m_palette; - UINT8 m_main_irq_mask; + uint8_t m_main_irq_mask; DECLARE_WRITE8_MEMBER(rallyx_interrupt_vector_w); DECLARE_WRITE8_MEMBER(rallyx_bang_w); DECLARE_WRITE8_MEMBER(rallyx_latch_w); @@ -75,9 +75,9 @@ public: DECLARE_PALETTE_INIT(jungler); DECLARE_VIDEO_START(locomotn); DECLARE_VIDEO_START(commsega); - UINT32 screen_update_rallyx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_jungler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_locomotn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rallyx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jungler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_locomotn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(rallyx_vblank_irq); INTERRUPT_GEN_MEMBER(jungler_vblank_irq); inline void rallyx_get_tile_info( tile_data &tileinfo, int tile_index, int ram_offs); diff --git a/src/mame/includes/rampart.h b/src/mame/includes/rampart.h index 854398a3da3..9ac21bea826 100644 --- a/src/mame/includes/rampart.h +++ b/src/mame/includes/rampart.h @@ -25,7 +25,7 @@ public: required_device m_oki; required_device m_ym2413; - required_shared_ptr m_bitmap; + required_shared_ptr m_bitmap; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; @@ -34,7 +34,7 @@ public: DECLARE_MACHINE_START(rampart); DECLARE_MACHINE_RESET(rampart); DECLARE_VIDEO_START(rampart); - UINT32 screen_update_rampart(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rampart(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void rampart_bitmap_render(bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; diff --git a/src/mame/includes/rastan.h b/src/mame/includes/rastan.h index 177579c0ef2..393a213d56c 100644 --- a/src/mame/includes/rastan.h +++ b/src/mame/includes/rastan.h @@ -21,8 +21,8 @@ public: m_pc090oj(*this, "pc090oj") { } /* video-related */ - UINT16 m_sprite_ctrl; - UINT16 m_sprites_flipscreen; + uint16_t m_sprite_ctrl; + uint16_t m_sprites_flipscreen; /* misc */ int m_adpcm_pos; @@ -41,6 +41,6 @@ public: DECLARE_WRITE8_MEMBER(rastan_msm5205_stop_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_rastan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rastan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(rastan_msm5205_vck); }; diff --git a/src/mame/includes/rbisland.h b/src/mame/includes/rbisland.h index 0fa8a251740..54900b51f01 100644 --- a/src/mame/includes/rbisland.h +++ b/src/mame/includes/rbisland.h @@ -23,19 +23,19 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - optional_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram; /* video-related */ - UINT16 m_sprite_ctrl; - UINT16 m_sprites_flipscreen; + uint16_t m_sprite_ctrl; + uint16_t m_sprites_flipscreen; /* misc */ - UINT8 m_jumping_latch; + uint8_t m_jumping_latch; /* c-chip */ - std::unique_ptr m_CRAM[8]; + std::unique_ptr m_CRAM[8]; int m_extra_version; - UINT8 m_current_bank; + uint8_t m_current_bank; /* devices */ required_device m_maincpu; @@ -60,8 +60,8 @@ public: DECLARE_DRIVER_INIT(rbisland); virtual void machine_start() override; DECLARE_VIDEO_START(jumping); - UINT32 screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_jumping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jumping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(cchip_timer); void request_round_data( ); void request_world_data( ); diff --git a/src/mame/includes/realbrk.h b/src/mame/includes/realbrk.h index 4b3c3d9689a..941649e7f4d 100644 --- a/src/mame/includes/realbrk.h +++ b/src/mame/includes/realbrk.h @@ -28,15 +28,15 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_vram_2; - required_shared_ptr m_vregs; - optional_shared_ptr m_dsw_select; - optional_shared_ptr m_backup_ram; - optional_shared_ptr m_vram_0ras; - optional_shared_ptr m_vram_1ras; + required_shared_ptr m_spriteram; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_vram_2; + required_shared_ptr m_vregs; + optional_shared_ptr m_dsw_select; + optional_shared_ptr m_backup_ram; + optional_shared_ptr m_vram_0ras; + optional_shared_ptr m_vram_1ras; std::unique_ptr m_tmpbitmap0; std::unique_ptr m_tmpbitmap1; @@ -69,8 +69,8 @@ public: virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dai2kaku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dai2kaku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int layer); diff --git a/src/mame/includes/redalert.h b/src/mame/includes/redalert.h index 1d3bb0df315..51cf5974ac4 100644 --- a/src/mame/includes/redalert.h +++ b/src/mame/includes/redalert.h @@ -28,13 +28,13 @@ public: m_soundlatch(*this, "soundlatch"), m_soundlatch2(*this, "soundlatch2") { } - UINT8 m_ay8910_latch_1; - UINT8 m_ay8910_latch_2; + uint8_t m_ay8910_latch_1; + uint8_t m_ay8910_latch_2; - required_shared_ptr m_bitmap_videoram; - required_shared_ptr m_charmap_videoram; - required_shared_ptr m_video_control; - required_shared_ptr m_bitmap_color; + required_shared_ptr m_bitmap_videoram; + required_shared_ptr m_charmap_videoram; + required_shared_ptr m_video_control; + required_shared_ptr m_bitmap_color; required_device m_maincpu; required_device m_audiocpu; @@ -43,8 +43,8 @@ public: required_device m_soundlatch; optional_device m_soundlatch2; - std::unique_ptr m_bitmap_colorram; - UINT8 m_control_xor; + std::unique_ptr m_bitmap_colorram; + uint8_t m_control_xor; DECLARE_READ8_MEMBER(redalert_interrupt_clear_r); DECLARE_WRITE8_MEMBER(redalert_interrupt_clear_w); DECLARE_READ8_MEMBER(panther_interrupt_clear_r); @@ -59,9 +59,9 @@ public: DECLARE_VIDEO_START(ww3); DECLARE_SOUND_START(redalert); DECLARE_SOUND_START(demoneye); - UINT32 screen_update_redalert(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_demoneye(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_panther(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_redalert(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_demoneye(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_panther(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(redalert_vblank_interrupt); DECLARE_WRITE8_MEMBER(redalert_analog_w); DECLARE_WRITE8_MEMBER(redalert_AY8910_w); diff --git a/src/mame/includes/redclash.h b/src/mame/includes/redclash.h index b0875b10260..bb492439122 100644 --- a/src/mame/includes/redclash.h +++ b/src/mame/includes/redclash.h @@ -18,8 +18,8 @@ public: int m_gfxbank; // redclash only /* misc */ - UINT8 m_sraider_0x30; - UINT8 m_sraider_0x38; + uint8_t m_sraider_0x30; + uint8_t m_sraider_0x38; DECLARE_READ8_MEMBER(sraider_sound_low_r); DECLARE_READ8_MEMBER(sraider_sound_high_r); @@ -39,8 +39,8 @@ public: DECLARE_MACHINE_RESET(redclash); DECLARE_VIDEO_START(redclash); DECLARE_PALETTE_INIT(redclash); - UINT32 screen_update_sraider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_redclash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sraider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_redclash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_sraider(screen_device &screen, bool state); void screen_eof_redclash(screen_device &screen, bool state); DECLARE_WRITE8_MEMBER( redclash_videoram_w ); @@ -55,10 +55,10 @@ public: DECLARE_WRITE8_MEMBER( irqack_w ); /* sraider uses the zerohour star generator board */ - void redclash_set_stars_enable(UINT8 on); + void redclash_set_stars_enable(uint8_t on); void redclash_update_stars_state(); - void redclash_set_stars_speed(UINT8 speed); - void redclash_draw_stars(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx); + void redclash_set_stars_speed(uint8_t speed); + void redclash_draw_stars(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t palette_offset, uint8_t sraider, uint8_t firstx, uint8_t lastx); void redclash_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void redclash_draw_bullets( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/relief.h b/src/mame/includes/relief.h index 32ed98cfadd..3f470ea33b4 100644 --- a/src/mame/includes/relief.h +++ b/src/mame/includes/relief.h @@ -27,9 +27,9 @@ public: required_device m_ym2413; required_memory_bank m_okibank; - UINT8 m_ym2413_volume; - UINT8 m_overall_volume; - UINT8 m_adpcm_bank; + uint8_t m_ym2413_volume; + uint8_t m_overall_volume; + uint8_t m_adpcm_bank; virtual void update_interrupts() override; DECLARE_READ16_MEMBER(special_port2_r); DECLARE_WRITE16_MEMBER(audio_control_w); @@ -40,7 +40,7 @@ public: DECLARE_MACHINE_START(relief); DECLARE_MACHINE_RESET(relief); DECLARE_VIDEO_START(relief); - UINT32 screen_update_relief(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_relief(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; }; diff --git a/src/mame/includes/renegade.h b/src/mame/includes/renegade.h index c3c109e0103..445de87e666 100644 --- a/src/mame/includes/renegade.h +++ b/src/mame/includes/renegade.h @@ -30,16 +30,16 @@ public: required_device m_gfxdecode; required_device m_soundlatch; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_spriteram; required_memory_bank m_rombank; - required_region_ptr m_adpcmrom; + required_region_ptr m_adpcmrom; - UINT32 m_adpcm_pos; - UINT32 m_adpcm_end; + uint32_t m_adpcm_pos; + uint32_t m_adpcm_end; bool m_adpcm_playing; bool m_mcu_sim; @@ -47,23 +47,23 @@ public: int m_from_mcu; int m_main_sent; int m_mcu_sent; - UINT8 m_ddr_a; - UINT8 m_ddr_b; - UINT8 m_ddr_c; - UINT8 m_port_a_out; - UINT8 m_port_b_out; - UINT8 m_port_c_out; - UINT8 m_port_a_in; - UINT8 m_port_b_in; - UINT8 m_port_c_in; - UINT8 m_mcu_buffer[MCU_BUFFER_MAX]; - UINT8 m_mcu_input_size; - UINT8 m_mcu_output_byte; - INT8 m_mcu_key; + uint8_t m_ddr_a; + uint8_t m_ddr_b; + uint8_t m_ddr_c; + uint8_t m_port_a_out; + uint8_t m_port_b_out; + uint8_t m_port_c_out; + uint8_t m_port_a_in; + uint8_t m_port_b_in; + uint8_t m_port_c_in; + uint8_t m_mcu_buffer[MCU_BUFFER_MAX]; + uint8_t m_mcu_input_size; + uint8_t m_mcu_output_byte; + int8_t m_mcu_key; int m_mcu_checksum; - const UINT8 *m_mcu_encrypt_table; + const uint8_t *m_mcu_encrypt_table; int m_mcu_encrypt_table_len; - INT32 m_scrollx; + int32_t m_scrollx; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -106,6 +106,6 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/retofinv.h b/src/mame/includes/retofinv.h index bc7e91c825f..6ff49e40255 100644 --- a/src/mame/includes/retofinv.h +++ b/src/mame/includes/retofinv.h @@ -27,26 +27,26 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_sharedram; - required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_sharedram; + required_shared_ptr m_bg_videoram; - UINT8 m_main_irq_mask; - UINT8 m_sub_irq_mask; - UINT8 m_cpu2_m6000; - UINT8 m_from_main; - UINT8 m_from_mcu; + uint8_t m_main_irq_mask; + uint8_t m_sub_irq_mask; + uint8_t m_cpu2_m6000; + uint8_t m_from_main; + uint8_t m_from_mcu; int m_mcu_sent; int m_main_sent; - UINT8 m_portA_in; - UINT8 m_portA_out; - UINT8 m_ddrA; - UINT8 m_portB_in; - UINT8 m_portB_out; - UINT8 m_ddrB; - UINT8 m_portC_in; - UINT8 m_portC_out; - UINT8 m_ddrC; + uint8_t m_portA_in; + uint8_t m_portA_out; + uint8_t m_ddrA; + uint8_t m_portB_in; + uint8_t m_portB_out; + uint8_t m_ddrB; + uint8_t m_portC_in; + uint8_t m_portC_out; + uint8_t m_ddrC; int m_fg_bank; int m_bg_bank; tilemap_t *m_bg_tilemap; @@ -86,7 +86,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(retofinv); - 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); void draw_sprites(bitmap_ind16 &bitmap); INTERRUPT_GEN_MEMBER(main_vblank_irq); diff --git a/src/mame/includes/rltennis.h b/src/mame/includes/rltennis.h index f62b5011c34..986244bcc45 100644 --- a/src/mame/includes/rltennis.h +++ b/src/mame/includes/rltennis.h @@ -21,18 +21,18 @@ public: required_device m_dac1; required_device m_dac2; - UINT16 m_blitter[RLT_NUM_BLITTER_REGS]; - INT32 m_data760000; - INT32 m_data740000; - INT32 m_dac_counter; - INT32 m_sample_rom_offset_1; - INT32 m_sample_rom_offset_2; - INT32 m_offset_shift; - INT32 m_unk_counter; + uint16_t m_blitter[RLT_NUM_BLITTER_REGS]; + int32_t m_data760000; + int32_t m_data740000; + int32_t m_dac_counter; + int32_t m_sample_rom_offset_1; + int32_t m_sample_rom_offset_2; + int32_t m_offset_shift; + int32_t m_unk_counter; std::unique_ptr m_tmp_bitmap[RLT_NUM_BITMAPS]; - UINT8 *m_samples_1; - UINT8 *m_samples_2; - UINT8 *m_gfx; + uint8_t *m_samples_1; + uint8_t *m_samples_2; + uint8_t *m_gfx; emu_timer *m_timer; DECLARE_READ16_MEMBER(io_r); @@ -44,7 +44,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); INTERRUPT_GEN_MEMBER(interrupt); TIMER_CALLBACK_MEMBER(sample_player); diff --git a/src/mame/includes/rm380z.h b/src/mame/includes/rm380z.h index 616dbb06da9..4923fefb018 100644 --- a/src/mame/includes/rm380z.h +++ b/src/mame/includes/rm380z.h @@ -52,7 +52,7 @@ private: void init_graphic_chars(); void putChar(int charnum,int attribs,int x,int y,bitmap_ind16 &bitmap,unsigned char* chsb,int vmode); - void decode_videoram_char(int pos,UINT8& chr,UINT8& attrib); + void decode_videoram_char(int pos,uint8_t& chr,uint8_t& attrib); void scroll_videoram(); void config_videomode(); void check_scroll_register(); @@ -65,18 +65,18 @@ protected: public: - UINT8 m_port0; - UINT8 m_port0_kbd; - UINT8 m_port1; - UINT8 m_fbfd; - UINT8 m_fbfe; + uint8_t m_port0; + uint8_t m_port0_kbd; + uint8_t m_port1; + uint8_t m_fbfd; + uint8_t m_fbfe; - UINT8 m_graphic_chars[0x80][(RM380Z_CHDIMX+1)*(RM380Z_CHDIMY+1)]; + uint8_t m_graphic_chars[0x80][(RM380Z_CHDIMX+1)*(RM380Z_CHDIMY+1)]; - UINT8 m_mainVideoram[RM380Z_VIDEORAM_SIZE]; - UINT8 m_vramchars[RM380Z_SCREENSIZE]; - UINT8 m_vramattribs[RM380Z_SCREENSIZE]; - UINT8 m_vram[RM380Z_SCREENSIZE]; + uint8_t m_mainVideoram[RM380Z_VIDEORAM_SIZE]; + uint8_t m_vramchars[RM380Z_SCREENSIZE]; + uint8_t m_vramattribs[RM380Z_SCREENSIZE]; + uint8_t m_vram[RM380Z_SCREENSIZE]; int m_rasterlineCtr; emu_timer* m_vblankTimer; @@ -111,7 +111,7 @@ public: DECLARE_READ8_MEMBER( videoram_read ); DECLARE_WRITE8_MEMBER( videoram_write ); - UINT8 hiram[0x1000]; + uint8_t hiram[0x1000]; DECLARE_READ8_MEMBER( hiram_read ); DECLARE_WRITE8_MEMBER( hiram_write ); @@ -126,7 +126,7 @@ public: void config_memory_map(); void update_screen(bitmap_ind16 &bitmap); - UINT32 screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(static_vblank_timer); }; diff --git a/src/mame/includes/rmnimbus.h b/src/mame/includes/rmnimbus.h index 73d2f6047d6..79004424e7c 100644 --- a/src/mame/includes/rmnimbus.h +++ b/src/mame/includes/rmnimbus.h @@ -97,17 +97,17 @@ public: bitmap_ind16 m_video_mem; - UINT32 m_debug_machine; - UINT8 m_mcu_reg080; - UINT8 m_iou_reg092; - UINT8 m_last_playmode; - UINT8 m_ay8910_a; - UINT16 m_x, m_y, m_yline; - UINT8 m_colours, m_mode, m_op; - UINT32 m_debug_video; - UINT8 m_vector; - UINT8 m_eeprom_bits; - UINT8 m_eeprom_state; + uint32_t m_debug_machine; + uint8_t m_mcu_reg080; + uint8_t m_iou_reg092; + uint8_t m_last_playmode; + uint8_t m_ay8910_a; + uint16_t m_x, m_y, m_yline; + uint8_t m_colours, m_mode, m_op; + uint32_t m_debug_video; + uint8_t m_vector; + uint8_t m_eeprom_bits; + uint8_t m_eeprom_state; DECLARE_READ8_MEMBER(nimbus_mcu_r); DECLARE_WRITE8_MEMBER(nimbus_mcu_w); @@ -132,7 +132,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; virtual void video_reset() override; - UINT32 screen_update_nimbus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nimbus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(sio_interrupt); DECLARE_WRITE_LINE_MEMBER(nimbus_fdc_intrq_w); DECLARE_WRITE_LINE_MEMBER(nimbus_fdc_drq_w); @@ -145,21 +145,21 @@ public: DECLARE_WRITE_LINE_MEMBER(nimbus_msm5205_vck); DECLARE_WRITE_LINE_MEMBER(write_scsi_iena); - UINT8 get_pixel(UINT16 x, UINT16 y); - UINT16 read_pixel_line(UINT16 x, UINT16 y, UINT8 pixels, UINT8 bpp); - UINT16 read_pixel_data(UINT16 x, UINT16 y); - void set_pixel(UINT16 x, UINT16 y, UINT8 colour); - void set_pixel40(UINT16 x, UINT16 y, UINT8 colour); - void write_pixel_line(UINT16 x, UINT16 y, UINT16, UINT8 pixels, UINT8 bpp); - void move_pixel_line(UINT16 x, UINT16 y, UINT8 width); - void write_pixel_data(UINT16 x, UINT16 y, UINT16 data); - void change_palette(UINT8 bank, UINT16 colours); - void external_int(UINT8 vector, bool state); + uint8_t get_pixel(uint16_t x, uint16_t y); + uint16_t read_pixel_line(uint16_t x, uint16_t y, uint8_t pixels, uint8_t bpp); + uint16_t read_pixel_data(uint16_t x, uint16_t y); + void set_pixel(uint16_t x, uint16_t y, uint8_t colour); + void set_pixel40(uint16_t x, uint16_t y, uint8_t colour); + void write_pixel_line(uint16_t x, uint16_t y, uint16_t, uint8_t pixels, uint8_t bpp); + void move_pixel_line(uint16_t x, uint16_t y, uint8_t width); + void write_pixel_data(uint16_t x, uint16_t y, uint16_t data); + void change_palette(uint8_t bank, uint16_t colours); + void external_int(uint8_t vector, bool state); DECLARE_READ8_MEMBER(cascade_callback); void nimbus_bank_memory(); void memory_reset(); void fdc_reset(); - UINT8 fdc_driveno(UINT8 drivesel); + uint8_t fdc_driveno(uint8_t drivesel); void hdc_reset(); void hdc_post_rw(); void hdc_drq(bool state); @@ -187,34 +187,34 @@ public: // Static data related to Floppy and SCSI hard disks struct { - UINT8 reg400; + uint8_t reg400; } m_nimbus_drives; /* 8031 Peripheral controller */ struct { - UINT8 ipc_in; - UINT8 ipc_out; - UINT8 status_in; - UINT8 status_out; + uint8_t ipc_in; + uint8_t ipc_out; + uint8_t status_in; + uint8_t status_out; } m_ipc_interface; /* Mouse/Joystick */ struct { - UINT8 m_mouse_px; - UINT8 m_mouse_py; + uint8_t m_mouse_px; + uint8_t m_mouse_py; - UINT8 m_mouse_x; - UINT8 m_mouse_y; - UINT8 m_mouse_pc; - UINT8 m_mouse_pcx; - UINT8 m_mouse_pcy; + uint8_t m_mouse_x; + uint8_t m_mouse_y; + uint8_t m_mouse_pc; + uint8_t m_mouse_pcx; + uint8_t m_mouse_pcy; - UINT8 m_intstate_x; - UINT8 m_intstate_y; + uint8_t m_intstate_x; + uint8_t m_intstate_y; - UINT8 m_reg0a4; + uint8_t m_reg0a4; emu_timer *m_mouse_timer; } m_nimbus_mouse; diff --git a/src/mame/includes/rockrage.h b/src/mame/includes/rockrage.h index 123358fc083..78da46f78f5 100644 --- a/src/mame/includes/rockrage.h +++ b/src/mame/includes/rockrage.h @@ -50,7 +50,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(rockrage); - UINT32 screen_update_rockrage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rockrage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(rockrage_interrupt); K007342_CALLBACK_MEMBER(rockrage_tile_callback); K007420_CALLBACK_MEMBER(rockrage_sprite_callback); diff --git a/src/mame/includes/rocnrope.h b/src/mame/includes/rocnrope.h index db48d923c8f..10cd5b6bb50 100644 --- a/src/mame/includes/rocnrope.h +++ b/src/mame/includes/rocnrope.h @@ -20,13 +20,13 @@ public: required_device m_palette; // memory pointers - required_shared_ptr m_spriteram2; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; tilemap_t *m_bg_tilemap; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(rocnrope_interrupt_vector_w); DECLARE_WRITE8_MEMBER(irq_mask_w); @@ -38,7 +38,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(rocnrope); - UINT32 screen_update_rocnrope(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rocnrope(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/rohga.h b/src/mame/includes/rohga.h index 6861c53fff2..1b36e212313 100644 --- a/src/mame/includes/rohga.h +++ b/src/mame/includes/rohga.h @@ -53,10 +53,10 @@ public: optional_device m_spriteram2; /* memory pointers */ - optional_shared_ptr m_pf1_rowscroll; - optional_shared_ptr m_pf2_rowscroll; - required_shared_ptr m_pf3_rowscroll; - required_shared_ptr m_pf4_rowscroll; + optional_shared_ptr m_pf1_rowscroll; + optional_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_pf3_rowscroll; + required_shared_ptr m_pf4_rowscroll; optional_device m_sprgen1; optional_device m_sprgen2; @@ -72,10 +72,10 @@ public: DECLARE_DRIVER_INIT(schmeisr); DECLARE_DRIVER_INIT(rohga); DECLARE_VIDEO_START(wizdfire); - UINT32 screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_wizdfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_nitrobal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void mixwizdfirelayer(bitmap_rgb32 &bitmap, const rectangle &cliprect, int gfxregion, UINT16 pri, UINT16 primask); + uint32_t screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wizdfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_nitrobal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void mixwizdfirelayer(bitmap_rgb32 &bitmap, const rectangle &cliprect, int gfxregion, uint16_t pri, uint16_t primask); DECO16IC_BANK_CB_MEMBER(bank_callback); DECOSPR_PRIORITY_CB_MEMBER(rohga_pri_callback); DECOSPR_COLOUR_CB_MEMBER(rohga_col_callback); diff --git a/src/mame/includes/rollerg.h b/src/mame/includes/rollerg.h index edaba1ab1cc..ed7d4f53576 100644 --- a/src/mame/includes/rollerg.h +++ b/src/mame/includes/rollerg.h @@ -44,7 +44,7 @@ public: DECLARE_WRITE_LINE_MEMBER(rollerg_irq_ack_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); K05324X_CB_MEMBER(sprite_callback); K051316_CB_MEMBER(zoom_callback); DECLARE_WRITE8_MEMBER(banking_callback); diff --git a/src/mame/includes/rollrace.h b/src/mame/includes/rollrace.h index e18dfbf5e21..1c95eea6331 100644 --- a/src/mame/includes/rollrace.h +++ b/src/mame/includes/rollrace.h @@ -15,9 +15,9 @@ public: required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; tilemap_t *m_fg_tilemap; int m_charbank[2]; @@ -30,8 +30,8 @@ public: int m_flipx; int m_spritebank; - UINT8 m_nmi_mask; - UINT8 m_sound_nmi_mask; + uint8_t m_nmi_mask; + uint8_t m_sound_nmi_mask; DECLARE_READ8_MEMBER(fake_d800_r); DECLARE_WRITE8_MEMBER(fake_d800_w); @@ -54,7 +54,7 @@ public: virtual void video_start() override; - 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); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(sound_timer_irq); diff --git a/src/mame/includes/route16.h b/src/mame/includes/route16.h index 32eb59800b6..93dcccbb0af 100644 --- a/src/mame/includes/route16.h +++ b/src/mame/includes/route16.h @@ -15,16 +15,16 @@ public: optional_device m_sn; - required_shared_ptr m_sharedram; - required_shared_ptr m_videoram1; - required_shared_ptr m_videoram2; + required_shared_ptr m_sharedram; + required_shared_ptr m_videoram1; + required_shared_ptr m_videoram2; required_device m_palette; - UINT8 m_ttmahjng_port_select; + uint8_t m_ttmahjng_port_select; int m_speakres_vrx; - UINT8 m_flipscreen; - UINT8 m_palette_1; - UINT8 m_palette_2; + uint8_t m_flipscreen; + uint8_t m_palette_1; + uint8_t m_palette_2; DECLARE_WRITE8_MEMBER(out0_w); DECLARE_WRITE8_MEMBER(out1_w); @@ -43,6 +43,6 @@ public: DECLARE_MACHINE_START(ttmahjng); virtual void video_start() override; - UINT32 screen_update_route16(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_route16(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/rpunch.h b/src/mame/includes/rpunch.h index e71ad1c73b4..80f90f2a6c4 100644 --- a/src/mame/includes/rpunch.h +++ b/src/mame/includes/rpunch.h @@ -24,20 +24,20 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_bitmapram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_bitmapram; + required_shared_ptr m_spriteram; - UINT8 m_sound_data; - UINT8 m_sound_busy; - UINT8 m_ym2151_irq; - UINT8 m_upd_rom_bank; + uint8_t m_sound_data; + uint8_t m_sound_busy; + uint8_t m_ym2151_irq; + uint8_t m_upd_rom_bank; int m_sprite_palette; int m_sprite_xoffs; - UINT16 m_videoflags; - UINT8 m_crtc_register; - UINT8 m_bins; - UINT8 m_gins; + uint16_t m_videoflags; + uint8_t m_crtc_register; + uint8_t m_bins; + uint8_t m_gins; tilemap_t *m_background[2]; emu_timer *m_crtc_timer; DECLARE_WRITE_LINE_MEMBER(ym2151_irq_gen); @@ -64,7 +64,7 @@ public: DECLARE_VIDEO_START(svolley); - UINT32 screen_update_rpunch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rpunch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(sound_command_w_callback); TIMER_CALLBACK_MEMBER(crtc_interrupt_gen); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int stop); diff --git a/src/mame/includes/runaway.h b/src/mame/includes/runaway.h index ae07cd6a322..57184c63074 100644 --- a/src/mame/includes/runaway.h +++ b/src/mame/includes/runaway.h @@ -13,8 +13,8 @@ public: m_palette(*this, "palette") { } emu_timer *m_interrupt_timer; - required_shared_ptr m_video_ram; - required_shared_ptr m_sprite_ram; + required_shared_ptr m_video_ram; + required_shared_ptr m_sprite_ram; tilemap_t *m_bg_tilemap; int m_tile_bank; DECLARE_READ8_MEMBER(runaway_input_r); @@ -30,8 +30,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_VIDEO_START(qwak); - UINT32 screen_update_runaway(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_qwak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_runaway(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_qwak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(interrupt_callback); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/rungun.h b/src/mame/includes/rungun.h index ef414292353..36f25737279 100644 --- a/src/mame/includes/rungun.h +++ b/src/mame/includes/rungun.h @@ -50,30 +50,30 @@ public: required_device m_soundlatch2; /* memory pointers */ - required_shared_ptr m_sysreg; + required_shared_ptr m_sysreg; /* video-related */ tilemap_t *m_ttl_tilemap[2]; tilemap_t *m_936_tilemap[2]; - std::unique_ptr m_psac2_vram; - std::unique_ptr m_ttl_vram; - std::unique_ptr m_pal_ram; - UINT8 m_current_display_bank; + std::unique_ptr m_psac2_vram; + std::unique_ptr m_ttl_vram; + std::unique_ptr m_pal_ram; + uint8_t m_current_display_bank; int m_ttl_gfx_index; int m_sprite_colorbase; - UINT8 *m_roz_rom; - UINT8 m_roz_rombase; + uint8_t *m_roz_rom; + uint8_t m_roz_rombase; /* sound */ - UINT8 m_sound_ctrl; - UINT8 m_sound_status; - UINT8 m_sound_nmi_clk; + uint8_t m_sound_ctrl; + uint8_t m_sound_status; + uint8_t m_sound_nmi_clk; bool m_video_priority_mode; - std::unique_ptr m_banked_ram; + std::unique_ptr m_banked_ram; bool m_single_screen_mode; - UINT8 m_video_mux_bank; + uint8_t m_video_mux_bank; DECLARE_READ16_MEMBER(rng_sysregs_r); DECLARE_WRITE16_MEMBER(rng_sysregs_w); @@ -100,10 +100,10 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_rng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rng(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_rng_dual_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_rng_dual_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rng_dual_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rng_dual_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); bitmap_ind16 m_rng_dual_demultiplex_left_temp; bitmap_ind16 m_rng_dual_demultiplex_right_temp; void sprite_dma_trigger(void); diff --git a/src/mame/includes/s11.h b/src/mame/includes/s11.h index 009ea8edf44..3f5e1bf0a1a 100644 --- a/src/mame/includes/s11.h +++ b/src/mame/includes/s11.h @@ -98,25 +98,25 @@ protected: optional_device m_bg; // getters/setters - UINT8 get_strobe() { return m_strobe; } - void set_strobe(UINT8 s) { m_strobe = s; } - UINT8 get_diag() { return m_diag; } - void set_diag(UINT8 d) { m_diag = d; } - UINT32 get_segment1() { return m_segment1; } - void set_segment1(UINT32 s) { m_segment1 = s; } - UINT32 get_segment2() { return m_segment2; } - void set_segment2(UINT32 s) { m_segment2 = s; } + uint8_t get_strobe() { return m_strobe; } + void set_strobe(uint8_t s) { m_strobe = s; } + uint8_t get_diag() { return m_diag; } + void set_diag(uint8_t d) { m_diag = d; } + uint32_t get_segment1() { return m_segment1; } + void set_segment1(uint32_t s) { m_segment1 = s; } + uint32_t get_segment2() { return m_segment2; } + void set_segment2(uint32_t s) { m_segment2 = s; } void set_timer(emu_timer* t) { m_irq_timer = t; } virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; static const device_timer_id TIMER_IRQ = 0; private: - UINT8 m_sound_data; - UINT8 m_strobe; - UINT8 m_kbdrow; - UINT8 m_diag; - UINT32 m_segment1; - UINT32 m_segment2; + uint8_t m_sound_data; + uint8_t m_strobe; + uint8_t m_kbdrow; + uint8_t m_diag; + uint32_t m_segment1; + uint32_t m_segment2; emu_timer* m_irq_timer; bool m_irq_active; }; diff --git a/src/mame/includes/sage2.h b/src/mame/includes/sage2.h index 2a80606aa20..6d3c2b25e8a 100644 --- a/src/mame/includes/sage2.h +++ b/src/mame/includes/sage2.h @@ -76,7 +76,7 @@ public: DECLARE_WRITE_LINE_MEMBER( fdc_irq ); - const UINT8 *m_rom; + const uint8_t *m_rom; int m_reset; // floppy state diff --git a/src/mame/includes/samcoupe.h b/src/mame/includes/samcoupe.h index 201754c993d..7f038413e61 100644 --- a/src/mame/includes/samcoupe.h +++ b/src/mame/includes/samcoupe.h @@ -89,28 +89,28 @@ public: virtual void video_start() override; - 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); bitmap_ind16 m_bitmap; emu_timer *m_video_update_timer; - UINT8 m_lmpr, m_hmpr, m_vmpr; /* memory pages */ - UINT8 m_lext, m_hext; /* extended memory page */ - UINT8 m_border; /* border */ - UINT8 m_clut[16]; /* color lookup table, 16 entries */ - UINT8 m_line_int; /* line interrupt */ - UINT8 m_status; /* status register */ + uint8_t m_lmpr, m_hmpr, m_vmpr; /* memory pages */ + uint8_t m_lext, m_hext; /* extended memory page */ + uint8_t m_border; /* border */ + uint8_t m_clut[16]; /* color lookup table, 16 entries */ + uint8_t m_line_int; /* line interrupt */ + uint8_t m_status; /* status register */ /* attribute */ - UINT8 m_attribute; + uint8_t m_attribute; /* mouse */ int m_mouse_index; emu_timer *m_mouse_reset; - UINT8 m_mouse_data[9]; + uint8_t m_mouse_data[9]; int m_mouse_x, m_mouse_y; - UINT8 *m_videoram; + uint8_t *m_videoram; DECLARE_WRITE8_MEMBER(samcoupe_ext_mem_w); DECLARE_READ8_MEMBER(samcoupe_disk_r); DECLARE_WRITE8_MEMBER(samcoupe_disk_w); @@ -152,8 +152,8 @@ public: DECLARE_READ8_MEMBER(sam_bank4_r); DECLARE_WRITE8_MEMBER(sam_bank4_w); - UINT8* sam_bank_read_ptr[4]; - UINT8* sam_bank_write_ptr[4]; + uint8_t* sam_bank_read_ptr[4]; + uint8_t* sam_bank_write_ptr[4]; DECLARE_FLOPPY_FORMATS( floppy_formats ); required_device m_maincpu; required_device m_speaker; @@ -182,14 +182,14 @@ public: void draw_mode4_line(int y, int hpos); void draw_mode3_line(int y, int hpos); - void draw_mode12_block(bitmap_ind16 &bitmap, int vpos, int hpos, UINT8 mask); + void draw_mode12_block(bitmap_ind16 &bitmap, int vpos, int hpos, uint8_t mask); void draw_mode2_line(int y, int hpos); void draw_mode1_line(int y, int hpos); - void samcoupe_update_bank(address_space &space, int bank_num, UINT8 *memory, int is_readonly); + void samcoupe_update_bank(address_space &space, int bank_num, uint8_t *memory, int is_readonly); void samcoupe_install_ext_mem(address_space &space); void samcoupe_update_memory(address_space &space); - UINT8 samcoupe_mouse_r(); - void samcoupe_irq(UINT8 src); + uint8_t samcoupe_mouse_r(); + void samcoupe_irq(uint8_t src); DECLARE_WRITE_LINE_MEMBER(write_lpt1_busy); DECLARE_WRITE_LINE_MEMBER(write_lpt2_busy); diff --git a/src/mame/includes/saturn.h b/src/mame/includes/saturn.h index ab7e88bf9ad..3f945afd979 100644 --- a/src/mame/includes/saturn.h +++ b/src/mame/includes/saturn.h @@ -50,39 +50,39 @@ public: { } - required_shared_ptr m_rom; - required_shared_ptr m_workram_l; - required_shared_ptr m_workram_h; - required_shared_ptr m_sound_ram; + required_shared_ptr m_rom; + required_shared_ptr m_workram_l; + required_shared_ptr m_workram_h; + required_shared_ptr m_sound_ram; optional_ioport m_fake_comms; memory_region *m_cart_reg[4]; - std::unique_ptr m_backupram; - std::unique_ptr m_scu_regs; - std::unique_ptr m_scsp_regs; - std::unique_ptr m_vdp2_regs; - std::unique_ptr m_vdp2_vram; - std::unique_ptr m_vdp2_cram; - std::unique_ptr m_vdp1_vram; - std::unique_ptr m_vdp1_regs; + std::unique_ptr m_backupram; + std::unique_ptr m_scu_regs; + std::unique_ptr m_scsp_regs; + std::unique_ptr m_vdp2_regs; + std::unique_ptr m_vdp2_vram; + std::unique_ptr m_vdp2_cram; + std::unique_ptr m_vdp1_vram; + std::unique_ptr m_vdp1_regs; - UINT8 m_NMI_reset; - UINT8 m_en_68k; + uint8_t m_NMI_reset; + uint8_t m_en_68k; struct { - UINT32 src[3]; /* Source DMA lv n address*/ - UINT32 dst[3]; /* Destination DMA lv n address*/ - UINT32 src_add[3]; /* Source Addition for DMA lv n*/ - UINT32 dst_add[3]; /* Destination Addition for DMA lv n*/ - UINT32 size[3]; /* Transfer DMA size lv n*/ - UINT32 index[3]; + uint32_t src[3]; /* Source DMA lv n address*/ + uint32_t dst[3]; /* Destination DMA lv n address*/ + uint32_t src_add[3]; /* Source Addition for DMA lv n*/ + uint32_t dst_add[3]; /* Destination Addition for DMA lv n*/ + uint32_t size[3]; /* Transfer DMA size lv n*/ + uint32_t index[3]; int start_factor[3]; - UINT8 enable_mask[3]; - UINT32 ist; - UINT32 ism; - UINT32 illegal_factor[3]; - UINT32 status; + uint8_t enable_mask[3]; + uint32_t ist; + uint32_t ism; + uint32_t illegal_factor[3]; + uint32_t status; }m_scu; void scu_reset(void); @@ -93,7 +93,7 @@ public: attotime m_sinit_boost_timeslice; struct { - UINT16 **framebuffer_display_lines; + uint16_t **framebuffer_display_lines; int framebuffer_mode; int framebuffer_double_interlace; int fbcr_accessed; @@ -104,64 +104,64 @@ public: int framebuffer_clear_on_next_frame; rectangle system_cliprect; rectangle user_cliprect; - std::unique_ptr framebuffer[2]; - UINT16 **framebuffer_draw_lines; - std::unique_ptr gfx_decode; - UINT16 lopr; - UINT16 copr; - UINT16 ewdr; + std::unique_ptr framebuffer[2]; + uint16_t **framebuffer_draw_lines; + std::unique_ptr gfx_decode; + uint16_t lopr; + uint16_t copr; + uint16_t ewdr; int local_x; int local_y; }m_vdp1; struct { - std::unique_ptr gfx_decode; + std::unique_ptr gfx_decode; bitmap_rgb32 roz_bitmap[2]; - UINT8 dotsel; - UINT8 pal; - UINT16 h_count; - UINT16 v_count; - UINT8 exltfg; - UINT8 exsyfg; + uint8_t dotsel; + uint8_t pal; + uint16_t h_count; + uint16_t v_count; + uint8_t exltfg; + uint8_t exsyfg; int old_crmd; int old_tvmd; }m_vdp2; struct { - UINT8 IOSEL1; - UINT8 IOSEL2; - UINT8 EXLE1; - UINT8 EXLE2; - UINT8 PDR1; - UINT8 PDR2; - UINT8 DDR1; - UINT8 DDR2; - UINT8 SF; - UINT8 SR; - UINT8 IREG[7]; - UINT8 intback_buf[7]; - UINT8 OREG[32]; + uint8_t IOSEL1; + uint8_t IOSEL2; + uint8_t EXLE1; + uint8_t EXLE2; + uint8_t PDR1; + uint8_t PDR2; + uint8_t DDR1; + uint8_t DDR2; + uint8_t SF; + uint8_t SR; + uint8_t IREG[7]; + uint8_t intback_buf[7]; + uint8_t OREG[32]; int intback_stage; int pmode; - UINT8 SMEM[4]; - UINT8 intback; - UINT8 rtc_data[7]; - UINT8 slave_on; + uint8_t SMEM[4]; + uint8_t intback; + uint8_t rtc_data[7]; + uint8_t slave_on; }m_smpc; /* Saturn specific*/ int m_saturn_region; - UINT8 m_cart_type; - UINT32 *m_cart_dram; + uint8_t m_cart_type; + uint32_t *m_cart_dram; /* ST-V specific */ - UINT8 m_stv_multi_bank; - UINT8 m_prev_bankswitch; + uint8_t m_stv_multi_bank; + uint8_t m_prev_bankswitch; emu_timer *m_stv_rtc_timer; - UINT8 m_port_sel,m_mux_data; - UINT8 m_system_output; - UINT16 m_serial_tx; + uint8_t m_port_sel,m_mux_data; + uint8_t m_system_output; + uint16_t m_serial_tx; required_device m_maincpu; required_device m_slave; @@ -179,11 +179,11 @@ public: bitmap_rgb32 m_tmpbitmap; DECLARE_VIDEO_START(stv_vdp2); - UINT32 screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_stv_vdp2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(saturn_scanline); TIMER_DEVICE_CALLBACK_MEMBER(saturn_slave_scanline); - void scu_do_transfer(UINT8 event); + void scu_do_transfer(uint8_t event); void scu_test_pending_irq(); DECLARE_READ32_MEMBER(saturn_scu_r); DECLARE_WRITE32_MEMBER(saturn_scu_w); @@ -191,9 +191,9 @@ public: TIMER_CALLBACK_MEMBER(dma_lv1_ended); TIMER_CALLBACK_MEMBER(dma_lv2_ended); TIMER_CALLBACK_MEMBER(vdp1_draw_end); - void scu_single_transfer(address_space &space, UINT32 src, UINT32 dst,UINT8 *src_shift); - void scu_dma_direct(address_space &space, UINT8 dma_ch); - void scu_dma_indirect(address_space &space,UINT8 dma_ch); + void scu_single_transfer(address_space &space, uint32_t src, uint32_t dst,uint8_t *src_shift); + void scu_dma_direct(address_space &space, uint8_t dma_ch); + void scu_dma_indirect(address_space &space,uint8_t dma_ch); DECLARE_WRITE16_MEMBER(saturn_soundram_w); DECLARE_READ16_MEMBER(saturn_soundram_r); DECLARE_WRITE32_MEMBER(minit_w); @@ -207,8 +207,8 @@ public: DECLARE_WRITE8_MEMBER(scsp_irq); int m_scsp_last_line; - UINT8 smpc_direct_mode(UINT8 pad_n); - UINT8 smpc_th_control_mode(UINT8 pad_n); + uint8_t smpc_direct_mode(uint8_t pad_n); + uint8_t smpc_th_control_mode(uint8_t pad_n); TIMER_CALLBACK_MEMBER( smpc_audio_reset_line_pulse ); DECLARE_READ8_MEMBER( saturn_SMPC_r ); DECLARE_WRITE8_MEMBER( saturn_SMPC_w ); @@ -246,7 +246,7 @@ public: int x2s(int v); int y2s(int v); void vdp1_fill_quad(const rectangle &cliprect, int patterndata, int xsize, const struct spoint *q); - void vdp1_fill_line(const rectangle &cliprect, int patterndata, int xsize, INT32 y, INT32 x1, INT32 x2, INT32 u1, INT32 u2, INT32 v1, INT32 v2); + void vdp1_fill_line(const rectangle &cliprect, int patterndata, int xsize, int32_t y, int32_t x1, int32_t x2, int32_t u1, int32_t u2, int32_t v1, int32_t v2); void (saturn_state::*drawpixel)(int x, int y, int patterndata, int offsetcnt); void drawpixel_poly(int x, int y, int patterndata, int offsetcnt); void drawpixel_8bpp_trans(int x, int y, int patterndata, int offsetcnt); @@ -254,22 +254,22 @@ public: void drawpixel_4bpp_trans(int x, int y, int patterndata, int offsetcnt); void drawpixel_generic(int x, int y, int patterndata, int offsetcnt); void vdp1_fill_slope(const rectangle &cliprect, int patterndata, int xsize, - INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 *nx1, INT32 *nx2, - INT32 u1, INT32 u2, INT32 slu1, INT32 slu2, INT32 *nu1, INT32 *nu2, - INT32 v1, INT32 v2, INT32 slv1, INT32 slv2, INT32 *nv1, INT32 *nv2, - INT32 _y1, INT32 y2); - void stv_vdp1_setup_shading_for_line(INT32 y, INT32 x1, INT32 x2, - INT32 r1, INT32 g1, INT32 b1, - INT32 r2, INT32 g2, INT32 b2); + int32_t x1, int32_t x2, int32_t sl1, int32_t sl2, int32_t *nx1, int32_t *nx2, + int32_t u1, int32_t u2, int32_t slu1, int32_t slu2, int32_t *nu1, int32_t *nu2, + int32_t v1, int32_t v2, int32_t slv1, int32_t slv2, int32_t *nv1, int32_t *nv2, + int32_t _y1, int32_t y2); + void stv_vdp1_setup_shading_for_line(int32_t y, int32_t x1, int32_t x2, + int32_t r1, int32_t g1, int32_t b1, + int32_t r2, int32_t g2, int32_t b2); void stv_vdp1_setup_shading_for_slope( - INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 *nx1, INT32 *nx2, - INT32 r1, INT32 r2, INT32 slr1, INT32 slr2, INT32 *nr1, INT32 *nr2, - INT32 g1, INT32 g2, INT32 slg1, INT32 slg2, INT32 *ng1, INT32 *ng2, - INT32 b1, INT32 b2, INT32 slb1, INT32 slb2, INT32 *nb1, INT32 *nb2, - INT32 _y1, INT32 y2); - UINT16 stv_vdp1_apply_gouraud_shading( int x, int y, UINT16 pix ); + int32_t x1, int32_t x2, int32_t sl1, int32_t sl2, int32_t *nx1, int32_t *nx2, + int32_t r1, int32_t r2, int32_t slr1, int32_t slr2, int32_t *nr1, int32_t *nr2, + int32_t g1, int32_t g2, int32_t slg1, int32_t slg2, int32_t *ng1, int32_t *ng2, + int32_t b1, int32_t b2, int32_t slb1, int32_t slb2, int32_t *nb1, int32_t *nb2, + int32_t _y1, int32_t y2); + uint16_t stv_vdp1_apply_gouraud_shading( int x, int y, uint16_t pix ); void stv_vdp1_setup_shading(const struct spoint* q, const rectangle &cliprect); - UINT8 stv_read_gouraud_table( void ); + uint8_t stv_read_gouraud_table( void ); void stv_clear_gouraud_shading(void); void stv_clear_framebuffer( int which_framebuffer ); @@ -278,18 +278,18 @@ public: struct stv_vdp1_poly_scanline { - INT32 x[2]; - INT32 b[2]; - INT32 g[2]; - INT32 r[2]; - INT32 db; - INT32 dg; - INT32 dr; + int32_t x[2]; + int32_t b[2]; + int32_t g[2]; + int32_t r[2]; + int32_t db; + int32_t dg; + int32_t dr; }; struct stv_vdp1_poly_scanline_data { - INT32 sy, ey; + int32_t sy, ey; struct stv_vdp1_poly_scanline scanline[512]; }; @@ -312,30 +312,30 @@ public: struct _stv_gouraud_shading { /* Gouraud shading table */ - UINT16 GA; - UINT16 GB; - UINT16 GC; - UINT16 GD; + uint16_t GA; + uint16_t GB; + uint16_t GC; + uint16_t GD; } stv_gouraud_shading; - UINT16 m_sprite_colorbank; + uint16_t m_sprite_colorbank; /* VDP1 Framebuffer handling */ int stv_sprite_priorities_used[8]; int stv_sprite_priorities_usage_valid; - UINT8 stv_sprite_priorities_in_fb_line[512][8]; + uint8_t stv_sprite_priorities_in_fb_line[512][8]; /* VDP2 */ - UINT8 get_vblank( void ); - UINT8 get_hblank( void ); + uint8_t get_vblank( void ); + uint8_t get_hblank( void ); int get_hcounter( void ); int get_vcounter( void ); int get_vblank_duration( void ); int get_hblank_duration( void ); int get_pixel_clock( void ); - UINT8 get_odd_bit( void ); + uint8_t get_odd_bit( void ); void stv_vdp2_dynamic_res_change( void ); int get_vblank_start_position( void ); int get_ystep_count( void ); @@ -344,7 +344,7 @@ public: inline int stv_vdp2_window_process(int x,int y); void stv_vdp2_get_window0_coordinates(int *s_x, int *e_x, int *s_y, int *e_y); void stv_vdp2_get_window1_coordinates(int *s_x, int *e_x, int *s_y, int *e_y); - int get_window_pixel(int s_x,int e_x,int s_y,int e_y,int x, int y,UINT8 win_num); + int get_window_pixel(int s_x,int e_x,int s_y,int e_y,int x, int y,uint8_t win_num); int stv_vdp2_apply_window_on_layer(rectangle &cliprect); void stv_vdp2_draw_basic_tilemap(bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -355,26 +355,26 @@ public: void draw_rgb15_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_rgb32_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void stv_vdp2_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,int transparency,int transparent_color,int scalex, int scaley,int sprite_screen_width, int sprite_screen_height, int alpha); - void stv_vdp2_drawgfxzoom_rgb555(bitmap_rgb32 &dest_bmp,const rectangle &clip,UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,int transparency,int transparent_color,int scalex, int scaley,int sprite_screen_width, int sprite_screen_height, int alpha); - void stv_vdp2_drawgfx_rgb555( bitmap_rgb32 &dest_bmp, const rectangle &clip, UINT32 code, int flipx, int flipy, int sx, int sy, int transparency, int alpha); - void stv_vdp2_drawgfx_rgb888( bitmap_rgb32 &dest_bmp, const rectangle &clip, UINT32 code, int flipx, int flipy, int sx, int sy, int transparency, int alpha); + void stv_vdp2_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy,int transparency,int transparent_color,int scalex, int scaley,int sprite_screen_width, int sprite_screen_height, int alpha); + void stv_vdp2_drawgfxzoom_rgb555(bitmap_rgb32 &dest_bmp,const rectangle &clip,uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy,int transparency,int transparent_color,int scalex, int scaley,int sprite_screen_width, int sprite_screen_height, int alpha); + void stv_vdp2_drawgfx_rgb555( bitmap_rgb32 &dest_bmp, const rectangle &clip, uint32_t code, int flipx, int flipy, int sx, int sy, int transparency, int alpha); + void stv_vdp2_drawgfx_rgb888( bitmap_rgb32 &dest_bmp, const rectangle &clip, uint32_t code, int flipx, int flipy, int sx, int sy, int transparency, int alpha); - void stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, UINT32 code,UINT32 color, int flipx,int flipy,int offsx,int offsy, int transparent_color, int alpha); - void stv_vdp2_drawgfx_transpen(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, UINT32 code,UINT32 color, int flipx,int flipy,int offsx,int offsy, int transparent_color); + void stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, uint32_t code,uint32_t color, int flipx,int flipy,int offsx,int offsy, int transparent_color, int alpha); + void stv_vdp2_drawgfx_transpen(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, uint32_t code,uint32_t color, int flipx,int flipy,int offsx,int offsy, int transparent_color); void stv_vdp2_draw_rotation_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect, int iRP); void stv_vdp2_check_tilemap_with_linescroll(bitmap_rgb32 &bitmap, const rectangle &cliprect); void stv_vdp2_check_tilemap(bitmap_rgb32 &bitmap, const rectangle &cliprect); void stv_vdp2_copy_roz_bitmap(bitmap_rgb32 &bitmap, bitmap_rgb32 &roz_bitmap, const rectangle &cliprect, int iRP, int planesizex, int planesizey, int planerenderedsizex, int planerenderedsizey); - void stv_vdp2_fill_rotation_parameter_table( UINT8 rot_parameter ); - UINT8 stv_vdp2_check_vram_cycle_pattern_registers( UINT8 access_command_pnmdr, UINT8 access_command_cpdr, UINT8 bitmap_enable ); - UINT8 stv_vdp2_is_rotation_applied(void); - UINT8 stv_vdp2_are_map_registers_equal(void); + void stv_vdp2_fill_rotation_parameter_table( uint8_t rot_parameter ); + uint8_t stv_vdp2_check_vram_cycle_pattern_registers( uint8_t access_command_pnmdr, uint8_t access_command_cpdr, uint8_t bitmap_enable ); + uint8_t stv_vdp2_is_rotation_applied(void); + uint8_t stv_vdp2_are_map_registers_equal(void); void stv_vdp2_get_map_page( int x, int y, int *_map, int *_page ); - void stv_vdp2_draw_mosaic(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 is_roz); + void stv_vdp2_draw_mosaic(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t is_roz); void stv_vdp2_fade_effects( void ); void stv_vdp2_compute_color_offset( int *r, int *g, int *b, int cor ); void stv_vdp2_compute_color_offset_UINT32(rgb_t *rgb, int cor); @@ -387,110 +387,110 @@ public: void stv_vdp2_draw_NBG2(bitmap_rgb32 &bitmap, const rectangle &cliprect); void stv_vdp2_draw_NBG3(bitmap_rgb32 &bitmap, const rectangle &cliprect); void stv_vdp2_draw_RBG0(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 pri); + void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t pri); int true_vcount[263][4]; void stv_vdp2_state_save_postload( void ); void stv_vdp2_exit ( void ); int stv_vdp2_start ( void ); - UINT8 m_vdpdebug_roz; + uint8_t m_vdpdebug_roz; struct stv_vdp2_tilemap_capabilities { - UINT8 enabled; - UINT8 transparency; - UINT8 colour_calculation_enabled; - UINT8 colour_depth; - UINT8 alpha; - UINT8 tile_size; - UINT8 bitmap_enable; - UINT8 bitmap_size; - UINT8 bitmap_palette_number; - UINT8 bitmap_map; - UINT16 map_offset[16]; - UINT8 map_count; - - UINT8 pattern_data_size; - UINT8 character_number_supplement; - UINT8 special_priority_register; - UINT8 special_colour_control_register; - UINT8 supplementary_palette_bits; - UINT8 supplementary_character_bits; - - INT16 scrollx; - INT16 scrolly; - UINT32 incx, incy; - - UINT8 linescroll_enable; - UINT8 linescroll_interval; - UINT32 linescroll_table_address; - UINT8 vertical_linescroll_enable; - UINT8 linezoom_enable; - - UINT8 plane_size; - UINT8 colour_ram_address_offset; - UINT8 fade_control; + uint8_t enabled; + uint8_t transparency; + uint8_t colour_calculation_enabled; + uint8_t colour_depth; + uint8_t alpha; + uint8_t tile_size; + uint8_t bitmap_enable; + uint8_t bitmap_size; + uint8_t bitmap_palette_number; + uint8_t bitmap_map; + uint16_t map_offset[16]; + uint8_t map_count; + + uint8_t pattern_data_size; + uint8_t character_number_supplement; + uint8_t special_priority_register; + uint8_t special_colour_control_register; + uint8_t supplementary_palette_bits; + uint8_t supplementary_character_bits; + + int16_t scrollx; + int16_t scrolly; + uint32_t incx, incy; + + uint8_t linescroll_enable; + uint8_t linescroll_interval; + uint32_t linescroll_table_address; + uint8_t vertical_linescroll_enable; + uint8_t linezoom_enable; + + uint8_t plane_size; + uint8_t colour_ram_address_offset; + uint8_t fade_control; struct{ - UINT8 logic; - UINT8 enabled[2]; - UINT8 area[2]; + uint8_t logic; + uint8_t enabled[2]; + uint8_t area[2]; }window_control; - UINT8 line_screen_enabled; - UINT8 mosaic_screen_enabled; + uint8_t line_screen_enabled; + uint8_t mosaic_screen_enabled; int layer_name; /* just to keep track */ } stv2_current_tilemap; struct rotation_table { - INT32 xst; - INT32 yst; - INT32 zst; - INT32 dxst; - INT32 dyst; - INT32 dx; - INT32 dy; - INT32 A; - INT32 B; - INT32 C; - INT32 D; - INT32 E; - INT32 F; - INT32 px; - INT32 py; - INT32 pz; - INT32 cx; - INT32 cy; - INT32 cz; - INT32 mx; - INT32 my; - INT32 kx; - INT32 ky; - UINT32 kast; - INT32 dkast; - INT32 dkax; + int32_t xst; + int32_t yst; + int32_t zst; + int32_t dxst; + int32_t dyst; + int32_t dx; + int32_t dy; + int32_t A; + int32_t B; + int32_t C; + int32_t D; + int32_t E; + int32_t F; + int32_t px; + int32_t py; + int32_t pz; + int32_t cx; + int32_t cy; + int32_t cz; + int32_t mx; + int32_t my; + int32_t kx; + int32_t ky; + uint32_t kast; + int32_t dkast; + int32_t dkax; } stv_current_rotation_parameter_table; struct _stv_vdp2_layer_data_placement { - UINT32 map_offset_min; - UINT32 map_offset_max; - UINT32 tile_offset_min; - UINT32 tile_offset_max; + uint32_t map_offset_min; + uint32_t map_offset_max; + uint32_t tile_offset_min; + uint32_t tile_offset_max; } stv_vdp2_layer_data_placement; struct _stv_rbg_cache_data { - UINT8 watch_vdp2_vram_writes; - UINT8 is_cache_dirty; + uint8_t watch_vdp2_vram_writes; + uint8_t is_cache_dirty; - UINT32 map_offset_min[2]; - UINT32 map_offset_max[2]; - UINT32 tile_offset_min[2]; - UINT32 tile_offset_max[2]; + uint32_t map_offset_min[2]; + uint32_t map_offset_max[2]; + uint32_t tile_offset_min[2]; + uint32_t tile_offset_max[2]; struct stv_vdp2_tilemap_capabilities layer_data[2]; @@ -505,56 +505,56 @@ public: struct direntryT { - UINT8 record_size; - UINT8 xa_record_size; - UINT32 firstfad; // first sector of file - UINT32 length; // length of file - UINT8 year; - UINT8 month; - UINT8 day; - UINT8 hour; - UINT8 minute; - UINT8 second; - UINT8 gmt_offset; - UINT8 flags; // iso9660 flags - UINT8 file_unit_size; - UINT8 interleave_gap_size; - UINT16 volume_sequencer_number; - UINT8 name[128]; + uint8_t record_size; + uint8_t xa_record_size; + uint32_t firstfad; // first sector of file + uint32_t length; // length of file + uint8_t year; + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t minute; + uint8_t second; + uint8_t gmt_offset; + uint8_t flags; // iso9660 flags + uint8_t file_unit_size; + uint8_t interleave_gap_size; + uint16_t volume_sequencer_number; + uint8_t name[128]; }; struct filterT { - UINT8 mode; - UINT8 chan; - UINT8 smmask; - UINT8 cimask; - UINT8 fid; - UINT8 smval; - UINT8 cival; - UINT8 condtrue; - UINT8 condfalse; - UINT32 fad; - UINT32 range; + uint8_t mode; + uint8_t chan; + uint8_t smmask; + uint8_t cimask; + uint8_t fid; + uint8_t smval; + uint8_t cival; + uint8_t condtrue; + uint8_t condfalse; + uint32_t fad; + uint32_t range; }; struct blockT { - INT32 size; // size of block - INT32 FAD; // FAD on disc - UINT8 data[CD_MAX_SECTOR_DATA]; - UINT8 chan; // channel - UINT8 fnum; // file number - UINT8 subm; // subchannel mode - UINT8 cinf; // coding information + int32_t size; // size of block + int32_t FAD; // FAD on disc + uint8_t data[CD_MAX_SECTOR_DATA]; + uint8_t chan; // channel + uint8_t fnum; // file number + uint8_t subm; // subchannel mode + uint8_t cinf; // coding information }; struct partitionT { - INT32 size; + int32_t size; blockT *blocks[MAX_BLOCKS]; - UINT8 bnum[MAX_BLOCKS]; - UINT8 numblks; + uint8_t bnum[MAX_BLOCKS]; + uint8_t numblks; }; // 16-bit transfer types @@ -584,30 +584,30 @@ public: void stvcd_set_tray_open(void); void stvcd_set_tray_close(void); - int get_track_index(UINT32 fad); + int get_track_index(uint32_t fad); int sega_cdrom_get_adr_control(cdrom_file *file, int track); - void cr_standard_return(UINT16 cur_status); + void cr_standard_return(uint16_t cur_status); void cd_free_block(blockT *blktofree); void cd_defragblocks(partitionT *part); - void cd_getsectoroffsetnum(UINT32 bufnum, UINT32 *sectoffs, UINT32 *sectnum); + void cd_getsectoroffsetnum(uint32_t bufnum, uint32_t *sectoffs, uint32_t *sectnum); - UINT16 cd_readWord(UINT32 addr); - void cd_writeWord(UINT32 addr, UINT16 data); - UINT32 cd_readLong(UINT32 addr); - void cd_writeLong(UINT32 addr, UINT32 data); + uint16_t cd_readWord(uint32_t addr); + void cd_writeWord(uint32_t addr, uint16_t data); + uint32_t cd_readLong(uint32_t addr); + void cd_writeLong(uint32_t addr, uint32_t data); void cd_readTOC(void); - void cd_readblock(UINT32 fad, UINT8 *dat); + void cd_readblock(uint32_t fad, uint8_t *dat); void cd_playdata(void); void cd_exec_command( void ); // iso9660 utilities - void make_dir_current(UINT32 fad); - void read_new_dir(UINT32 fileno); + void make_dir_current(uint32_t fad); + void read_new_dir(uint32_t fileno); - blockT *cd_alloc_block(UINT8 *blknum); - partitionT *cd_filterdata(filterT *flt, int trktype, UINT8 *p_ok); - partitionT *cd_read_filtered_sector(INT32 fad, UINT8 *p_ok); + blockT *cd_alloc_block(uint8_t *blknum); + partitionT *cd_filterdata(filterT *flt, int trktype, uint8_t *p_ok); + partitionT *cd_read_filtered_sector(int32_t fad, uint8_t *p_ok); cdrom_file *cdrom;// = (cdrom_file *)nullptr; @@ -620,41 +620,41 @@ public: blockT blocks[MAX_BLOCKS]; blockT curblock; - UINT8 tocbuf[102*4]; - UINT8 subqbuf[5*2]; - UINT8 subrwbuf[12*2]; - UINT8 finfbuf[256]; + uint8_t tocbuf[102*4]; + uint8_t subqbuf[5*2]; + uint8_t subrwbuf[12*2]; + uint8_t finfbuf[256]; - INT32 sectlenin, sectlenout; + int32_t sectlenin, sectlenout; - UINT8 lastbuf, playtype; + uint8_t lastbuf, playtype; transT xfertype; trans32T xfertype32; - UINT32 xfercount, calcsize; - UINT32 xferoffs, xfersect, xfersectpos, xfersectnum, xferdnum; + uint32_t xfercount, calcsize; + uint32_t xferoffs, xfersect, xfersectpos, xfersectnum, xferdnum; filterT filters[MAX_FILTERS]; filterT *cddevice; int cddevicenum; - UINT16 cr1, cr2, cr3, cr4; - UINT16 prev_cr1, prev_cr2, prev_cr3, prev_cr4; - UINT8 status_type; - UINT16 hirqmask, hirqreg; - UINT16 cd_stat; - UINT32 cd_curfad;// = 0; - UINT32 cd_fad_seek; - UINT32 fadstoplay;// = 0; - UINT32 in_buffer;// = 0; // amount of data in the buffer + uint16_t cr1, cr2, cr3, cr4; + uint16_t prev_cr1, prev_cr2, prev_cr3, prev_cr4; + uint8_t status_type; + uint16_t hirqmask, hirqreg; + uint16_t cd_stat; + uint32_t cd_curfad;// = 0; + uint32_t cd_fad_seek; + uint32_t fadstoplay;// = 0; + uint32_t in_buffer;// = 0; // amount of data in the buffer int oddframe;// = 0; int buffull, sectorstore, freeblocks; int cur_track; - UINT8 cmd_pending; - UINT8 cd_speed; - UINT8 cdda_maxrepeat; - UINT8 cdda_repeat_count; - UINT8 tray_is_closed; + uint8_t cmd_pending; + uint8_t cd_speed; + uint8_t cdda_maxrepeat; + uint8_t cdda_repeat_count; + uint8_t tray_is_closed; int get_timing_command( void ); direntryT curroot; // root entry of current filesystem @@ -685,7 +685,7 @@ public: void smpc_memory_setting(); void smpc_nmi_req(); TIMER_CALLBACK_MEMBER( smpc_nmi_set ); - void smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_stv); + void smpc_comreg_exec(address_space &space, uint8_t data, uint8_t is_stv); DECLARE_READ8_MEMBER( stv_SMPC_r ); DECLARE_WRITE8_MEMBER( stv_SMPC_w ); diff --git a/src/mame/includes/sauro.h b/src/mame/includes/sauro.h index ab0a7e79e42..7c4457d8561 100644 --- a/src/mame/includes/sauro.h +++ b/src/mame/includes/sauro.h @@ -27,15 +27,15 @@ public: optional_device m_sp0256; optional_device m_soundlatch; // sauro only - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - optional_shared_ptr m_videoram2; - optional_shared_ptr m_colorram2; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + optional_shared_ptr m_videoram2; + optional_shared_ptr m_colorram2; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_palette_bank; + uint8_t m_palette_bank; // common DECLARE_WRITE8_MEMBER(coin1_w); @@ -61,8 +61,8 @@ public: DECLARE_VIDEO_START(trckydoc); DECLARE_VIDEO_START(sauro); - UINT32 screen_update_trckydoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sauro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_trckydoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sauro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void sauro_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void trckydoc_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/sbasketb.h b/src/mame/includes/sbasketb.h index f1a7db9b7b0..f9c9ee1f1ec 100644 --- a/src/mame/includes/sbasketb.h +++ b/src/mame/includes/sbasketb.h @@ -23,12 +23,12 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_palettebank; - required_shared_ptr m_spriteram_select; - required_shared_ptr m_scroll; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_palettebank; + required_shared_ptr m_spriteram_select; + required_shared_ptr m_scroll; /* devices */ required_device m_maincpu; @@ -41,7 +41,7 @@ public: /* video-related */ tilemap_t *m_bg_tilemap; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(sbasketb_sh_irqtrigger_w); DECLARE_WRITE8_MEMBER(sbasketb_coin_counter_w); DECLARE_WRITE8_MEMBER(irq_mask_w); @@ -50,13 +50,13 @@ public: DECLARE_WRITE8_MEMBER(sbasketb_flipscreen_w); DECLARE_DRIVER_INIT(sbasketb); - UINT8 m_SN76496_latch; + uint8_t m_SN76496_latch; DECLARE_WRITE8_MEMBER( konami_SN76496_latch_w ) { m_SN76496_latch = data; }; DECLARE_WRITE8_MEMBER( konami_SN76496_w ) { m_sn->write(space, offset, m_SN76496_latch); }; TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(sbasketb); - UINT32 screen_update_sbasketb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sbasketb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/sbugger.h b/src/mame/includes/sbugger.h index 9df4807e9be..d9a29404f49 100644 --- a/src/mame/includes/sbugger.h +++ b/src/mame/includes/sbugger.h @@ -13,8 +13,8 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_videoram_attr; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram_attr; + required_shared_ptr m_videoram; tilemap_t *m_tilemap; @@ -26,5 +26,5 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(sbugger); - 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); }; diff --git a/src/mame/includes/scotrsht.h b/src/mame/includes/scotrsht.h index 3b2470d30d9..6bf1442832a 100644 --- a/src/mame/includes/scotrsht.h +++ b/src/mame/includes/scotrsht.h @@ -24,10 +24,10 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll; tilemap_t *m_bg_tilemap; @@ -49,6 +49,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(scotrsht); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/scramble.h b/src/mame/includes/scramble.h index 8cef5bc67a7..50ebe4a204c 100644 --- a/src/mame/includes/scramble.h +++ b/src/mame/includes/scramble.h @@ -26,19 +26,19 @@ public: optional_device m_ppi8255_0; optional_device m_ppi8255_1; optional_device m_tmsprom; - optional_shared_ptr m_soundram; + optional_shared_ptr m_soundram; optional_device m_digitalker; required_device m_soundlatch; - UINT8 m_cavelon_bank; + uint8_t m_cavelon_bank; // harem - UINT8 m_harem_decrypt_mode; - UINT8 m_harem_decrypt_bit; - UINT8 m_harem_decrypt_clk; - UINT8 m_harem_decrypt_count; - std::unique_ptr m_harem_decrypted_data; - std::unique_ptr m_harem_decrypted_opcodes; + uint8_t m_harem_decrypt_mode; + uint8_t m_harem_decrypt_bit; + uint8_t m_harem_decrypt_clk; + uint8_t m_harem_decrypt_count; + std::unique_ptr m_harem_decrypted_data; + std::unique_ptr m_harem_decrypted_opcodes; DECLARE_CUSTOM_INPUT_MEMBER(darkplnt_custom_r); DECLARE_CUSTOM_INPUT_MEMBER(ckongs_coinage_r); diff --git a/src/mame/includes/sderby.h b/src/mame/includes/sderby.h index 0261ea14a7a..3d227e2aebd 100644 --- a/src/mame/includes/sderby.h +++ b/src/mame/includes/sderby.h @@ -13,16 +13,16 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; - required_shared_ptr m_md_videoram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_md_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_spriteram; tilemap_t *m_tilemap; tilemap_t *m_md_tilemap; tilemap_t *m_fg_tilemap; - UINT16 m_scroll[6]; + uint16_t m_scroll[6]; DECLARE_READ16_MEMBER(sderby_input_r); DECLARE_READ16_MEMBER(sderbya_input_r); DECLARE_READ16_MEMBER(roulette_input_r); @@ -39,8 +39,8 @@ public: TILE_GET_INFO_MEMBER(get_sderby_md_tile_info); TILE_GET_INFO_MEMBER(get_sderby_fg_tile_info); virtual void video_start() override; - UINT32 screen_update_sderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pmroulet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pmroulet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int codeshift); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/segag80r.h b/src/mame/includes/segag80r.h index 687a34d649c..5921a22f9ae 100644 --- a/src/mame/includes/segag80r.h +++ b/src/mame/includes/segag80r.h @@ -40,8 +40,8 @@ public: m_soundlatch(*this, "soundlatch"), m_decrypted_opcodes(*this, "decrypted_opcodes") { } - required_shared_ptr m_mainram; - required_shared_ptr m_videoram; + required_shared_ptr m_mainram; + required_shared_ptr m_videoram; optional_device m_sn1; optional_device m_sn2; @@ -55,39 +55,39 @@ public: required_device m_screen; required_device m_palette; optional_device m_soundlatch; - optional_shared_ptr m_decrypted_opcodes; - - std::vector m_paletteram; - - UINT8 m_sound_state[2]; - UINT8 m_sound_rate; - UINT16 m_sound_addr; - UINT8 m_sound_data; - UINT8 m_square_state; - UINT8 m_square_count; - UINT8 m_n7751_command; - UINT8 m_n7751_busy; + optional_shared_ptr m_decrypted_opcodes; + + std::vector m_paletteram; + + uint8_t m_sound_state[2]; + uint8_t m_sound_rate; + uint16_t m_sound_addr; + uint8_t m_sound_data; + uint8_t m_square_state; + uint8_t m_square_count; + uint8_t m_n7751_command; + uint8_t m_n7751_busy; segag80_decrypt_func m_decrypt; - UINT8 m_background_pcb; + uint8_t m_background_pcb; double m_rweights[3]; double m_gweights[3]; double m_bweights[2]; - UINT8 m_video_control; - UINT8 m_video_flip; - UINT8 m_vblank_latch; + uint8_t m_video_control; + uint8_t m_video_flip; + uint8_t m_vblank_latch; tilemap_t *m_spaceod_bg_htilemap; tilemap_t *m_spaceod_bg_vtilemap; - UINT16 m_spaceod_hcounter; - UINT16 m_spaceod_vcounter; - UINT8 m_spaceod_fixed_color; - UINT8 m_spaceod_bg_control; - UINT8 m_spaceod_bg_detect; + uint16_t m_spaceod_hcounter; + uint16_t m_spaceod_vcounter; + uint8_t m_spaceod_fixed_color; + uint8_t m_spaceod_bg_control; + uint8_t m_spaceod_bg_detect; tilemap_t *m_bg_tilemap; - UINT8 m_bg_enable; - UINT8 m_bg_char_bank; - UINT16 m_bg_scrollx; - UINT16 m_bg_scrolly; - UINT8 m_pignewt_bg_color_offset; + uint8_t m_bg_enable; + uint8_t m_bg_char_bank; + uint16_t m_bg_scrollx; + uint16_t m_bg_scrolly; + uint8_t m_pignewt_bg_color_offset; DECLARE_WRITE8_MEMBER(mainram_w); DECLARE_WRITE8_MEMBER(vidram_w); DECLARE_WRITE8_MEMBER(monsterb_vidram_w); @@ -132,7 +132,7 @@ public: TILE_GET_INFO_MEMBER(bg_get_tile_info); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_segag80r(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_segag80r(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(segag80r_vblank_start); INTERRUPT_GEN_MEMBER(sindbadm_vblank_start); DECLARE_WRITE8_MEMBER(sega005_sound_a_w); @@ -145,14 +145,14 @@ public: DECLARE_WRITE8_MEMBER(n7751_rom_control_w); DECLARE_WRITE8_MEMBER(n7751_p2_w); void vblank_latch_set(); - void g80_set_palette_entry(int entry, UINT8 data); + void g80_set_palette_entry(int entry, uint8_t data); void spaceod_bg_init_palette(); - void draw_videoram(bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *transparent_pens); + void draw_videoram(bitmap_ind16 &bitmap, const rectangle &cliprect, const uint8_t *transparent_pens); void draw_background_spaceod(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_background_page_scroll(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_background_full_scroll(bitmap_ind16 &bitmap, const rectangle &cliprect); offs_t decrypt_offset(address_space &space, offs_t offset); - inline UINT8 demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0); + inline uint8_t demangle(uint8_t d7d6, uint8_t d5d4, uint8_t d3d2, uint8_t d1d0); void monsterb_expand_gfx(const char *region); protected: @@ -167,7 +167,7 @@ class sega005_sound_device : public device_t, public device_sound_interface { public: - sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); emu_timer *m_sega005_sound_timer; sound_stream *m_sega005_stream; diff --git a/src/mame/includes/segag80v.h b/src/mame/includes/segag80v.h index b9c74242fbd..b7b507421d7 100644 --- a/src/mame/includes/segag80v.h +++ b/src/mame/includes/segag80v.h @@ -24,8 +24,8 @@ public: m_vector(*this, "vector"), m_screen(*this, "screen"){ } - required_shared_ptr m_mainram; - required_shared_ptr m_vectorram; + required_shared_ptr m_mainram; + required_shared_ptr m_vectorram; required_device m_maincpu; optional_device m_samples; @@ -35,11 +35,11 @@ public: required_device m_screen; - UINT8 m_mult_data[2]; - UINT16 m_mult_result; - UINT8 m_spinner_select; - UINT8 m_spinner_sign; - UINT8 m_spinner_count; + uint8_t m_mult_data[2]; + uint16_t m_mult_result; + uint8_t m_spinner_select; + uint8_t m_spinner_sign; + uint8_t m_spinner_count; segag80_decrypt_func m_decrypt; int m_min_x; int m_min_y; @@ -70,9 +70,9 @@ public: DECLARE_DRIVER_INIT(spacfury); virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_segag80v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_segag80v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); inline int adjust_xy(int rawx, int rawy, int *outx, int *outy); void sega_generate_vector_list(); offs_t decrypt_offset(address_space &space, offs_t offset); - inline UINT8 demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0); + inline uint8_t demangle(uint8_t d7d6, uint8_t d5d4, uint8_t d3d2, uint8_t d1d0); }; diff --git a/src/mame/includes/segahang.h b/src/mame/includes/segahang.h index ee17b9e6f27..81a1c0b8e4b 100644 --- a/src/mame/includes/segahang.h +++ b/src/mame/includes/segahang.h @@ -68,7 +68,7 @@ public: DECLARE_DRIVER_INIT(endurob2); // video updates - 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: // internal types @@ -102,15 +102,15 @@ protected: required_device m_soundlatch; // memory pointers - required_shared_ptr m_workram; + required_shared_ptr m_workram; // configuration bool m_sharrier_video; i8751_sim_delegate m_i8751_vblank_hook; // internal state - UINT8 m_adc_select; + uint8_t m_adc_select; optional_ioport_array<4> m_adc_ports; bool m_shadow; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; }; diff --git a/src/mame/includes/segaorun.h b/src/mame/includes/segaorun.h index 55881c35bf8..d4c580fb2d0 100644 --- a/src/mame/includes/segaorun.h +++ b/src/mame/includes/segaorun.h @@ -62,9 +62,9 @@ public: DECLARE_WRITE8_MEMBER( bankmotor_control_w ); // memory mapping - void memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index); - UINT8 mapper_sound_r(); - void mapper_sound_w(UINT8 data); + void memory_mapper(sega_315_5195_mapper_device &mapper, uint8_t index); + uint8_t mapper_sound_r(); + void mapper_sound_w(uint8_t data); // main CPU read/write handlers DECLARE_READ16_MEMBER( misc_io_r ); @@ -81,8 +81,8 @@ public: DECLARE_DRIVER_INIT(shangon); // video updates - UINT32 screen_update_outrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_shangon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_outrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_shangon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE16_MEMBER( tileram_w ) { m_segaic16vid->tileram_w(space,offset,data,mem_mask); }; DECLARE_WRITE16_MEMBER( textram_w ) { m_segaic16vid->textram_w(space,offset,data,mem_mask); }; @@ -135,19 +135,19 @@ protected: optional_ioport_array<8> m_adc_ports; // memory - required_shared_ptr m_workram; + required_shared_ptr m_workram; // configuration read16_delegate m_custom_io_r; write16_delegate m_custom_io_w; - const UINT8 * m_custom_map; + const uint8_t * m_custom_map; bool m_shangon_video; // internal state emu_timer * m_scanline_timer; - UINT8 m_irq2_state; - UINT8 m_adc_select; - UINT8 m_vblank_irq_state; + uint8_t m_irq2_state; + uint8_t m_adc_select; + uint8_t m_vblank_irq_state; int m_bankmotor_pos; int m_bankmotor_delta; }; diff --git a/src/mame/includes/segas16a.h b/src/mame/includes/segas16a.h index fb9c0a7e762..4c83c52941a 100644 --- a/src/mame/includes/segas16a.h +++ b/src/mame/includes/segas16a.h @@ -97,12 +97,12 @@ public: DECLARE_DRIVER_INIT(sdi); // video updates - 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: // internal types typedef delegate i8751_sim_delegate; - typedef delegate lamp_changed_delegate; + typedef delegate lamp_changed_delegate; // timer IDs enum @@ -126,7 +126,7 @@ protected: DECLARE_READ16_MEMBER( passsht16a_custom_io_r ); DECLARE_READ16_MEMBER( sdi_custom_io_r ); DECLARE_READ16_MEMBER( sjryuko_custom_io_r ); - void sjryuko_lamp_changed_w(UINT8 changed, UINT8 newval); + void sjryuko_lamp_changed_w(uint8_t changed, uint8_t newval); // devices required_device m_maincpu; @@ -143,8 +143,8 @@ protected: required_device m_sprites; // memory pointers - required_shared_ptr m_workram; - optional_shared_ptr m_sound_decrypted_opcodes; + required_shared_ptr m_workram; + optional_shared_ptr m_sound_decrypted_opcodes; // configuration read16_delegate m_custom_io_r; @@ -153,13 +153,13 @@ protected: lamp_changed_delegate m_lamp_changed_w; // internal state - UINT8 m_video_control; - UINT8 m_mcu_control; - UINT8 m_n7751_command; - UINT32 m_n7751_rom_address; - UINT8 m_last_buttons1; - UINT8 m_last_buttons2; - UINT8 m_read_port; - UINT8 m_mj_input_num; + uint8_t m_video_control; + uint8_t m_mcu_control; + uint8_t m_n7751_command; + uint32_t m_n7751_rom_address; + uint8_t m_last_buttons1; + uint8_t m_last_buttons2; + uint8_t m_read_port; + uint8_t m_mj_input_num; optional_ioport_array<6> m_mj_inputs; }; diff --git a/src/mame/includes/segas16b.h b/src/mame/includes/segas16b.h index a16efee0cac..bdc6521c56f 100644 --- a/src/mame/includes/segas16b.h +++ b/src/mame/includes/segas16b.h @@ -64,9 +64,9 @@ public: { } // memory mapping - void memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index); - UINT8 mapper_sound_r(); - void mapper_sound_w(UINT8 data); + void memory_mapper(sega_315_5195_mapper_device &mapper, uint8_t index); + uint8_t mapper_sound_r(); + void mapper_sound_w(uint8_t data); // main CPU read/write handlers DECLARE_WRITE16_MEMBER( rom_5704_bank_w ); @@ -128,13 +128,13 @@ public: DECLARE_DRIVER_INIT(aliensyn7_5358_small); // video updates - 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); DECLARE_WRITE16_MEMBER( tileram_w ) { m_segaic16vid->tileram_w(space,offset,data,mem_mask); }; DECLARE_WRITE16_MEMBER( textram_w ) { m_segaic16vid->textram_w(space,offset,data,mem_mask); }; // bootleg stuff - void tilemap_16b_fpointbl_fill_latch(int i, UINT16* latched_pageselect, UINT16* latched_yscroll, UINT16* latched_xscroll, UINT16* textram); + void tilemap_16b_fpointbl_fill_latch(int i, uint16_t* latched_pageselect, uint16_t* latched_yscroll, uint16_t* latched_xscroll, uint16_t* textram); protected: // internal types @@ -205,7 +205,7 @@ protected: optional_device m_soundlatch; // not for atomicp // memory pointers - required_shared_ptr m_workram; + required_shared_ptr m_workram; // configuration segas16b_rom_board m_romboard; @@ -213,26 +213,26 @@ protected: read16_delegate m_custom_io_r; write16_delegate m_custom_io_w; bool m_disable_screen_blanking; - const UINT8 * m_i8751_initial_config; + const uint8_t * m_i8751_initial_config; i8751_sim_delegate m_i8751_vblank_hook; - UINT8 m_atomicp_sound_divisor; + uint8_t m_atomicp_sound_divisor; // game-specific state - UINT8 m_atomicp_sound_count; - UINT8 m_hwc_input_value; + uint8_t m_atomicp_sound_count; + uint8_t m_hwc_input_value; optional_ioport m_hwc_monitor; optional_ioport m_hwc_left; optional_ioport m_hwc_right; - UINT8 m_mj_input_num; - UINT8 m_mj_last_val; + uint8_t m_mj_input_num; + uint8_t m_mj_last_val; optional_ioport_array<6> m_mj_inputs; int m_spritepalbase; required_device m_gfxdecode; - optional_shared_ptr m_sound_decrypted_opcodes; - optional_shared_ptr m_decrypted_opcodes; - optional_shared_ptr m_bootleg_scroll; - optional_shared_ptr m_bootleg_page; + optional_shared_ptr m_sound_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_bootleg_scroll; + optional_shared_ptr m_bootleg_page; }; @@ -282,29 +282,29 @@ public: DECLARE_WRITE16_MEMBER( main_bank_change_w ); // security callbacks - UINT32 shinfz_security(UINT32 input); - UINT32 tetrbx_security(UINT32 input); + uint32_t shinfz_security(uint32_t input); + uint32_t tetrbx_security(uint32_t input); //protected: // driver overrides virtual void machine_reset() override; // configuration - UINT8 m_read_xor; - typedef delegate security_callback_delegate; + uint8_t m_read_xor; + typedef delegate security_callback_delegate; security_callback_delegate m_security_callback; // internal state - UINT16 m_cart_addrlatch; - UINT32 m_cart_addr; - UINT8 m_data_type; - UINT32 m_data_addr; - UINT8 m_data_mode; - UINT16 m_addr_latch; - UINT32 m_security_value; - UINT16 m_security_latch; - UINT8 m_rle_control_position; - UINT8 m_rle_control_byte; + uint16_t m_cart_addrlatch; + uint32_t m_cart_addr; + uint8_t m_data_type; + uint32_t m_data_addr; + uint8_t m_data_mode; + uint16_t m_addr_latch; + uint32_t m_security_value; + uint16_t m_security_latch; + uint8_t m_rle_control_position; + uint8_t m_rle_control_byte; bool m_rle_latched; - UINT8 m_rle_byte; + uint8_t m_rle_byte; }; diff --git a/src/mame/includes/segas18.h b/src/mame/includes/segas18.h index c8b9ad67268..49c48b78956 100644 --- a/src/mame/includes/segas18.h +++ b/src/mame/includes/segas18.h @@ -61,9 +61,9 @@ public: DECLARE_DRIVER_INIT(hamaway); // memory mapping - void memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 index); - UINT8 mapper_sound_r(); - void mapper_sound_w(UINT8 data); + void memory_mapper(sega_315_5195_mapper_device &mapper, uint8_t index); + uint8_t mapper_sound_r(); + void mapper_sound_w(uint8_t data); // read/write handlers DECLARE_WRITE8_MEMBER( rom_5874_bank_w ); @@ -86,7 +86,7 @@ public: DECLARE_WRITE16_MEMBER( wwally_custom_io_w ); // video rendering - 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); DECLARE_WRITE_LINE_MEMBER(vdp_sndirqline_callback_s18); DECLARE_WRITE_LINE_MEMBER(vdp_lv6irqline_callback_s18); @@ -125,7 +125,7 @@ protected: // internal helpers void init_generic(segas18_rom_board rom_board); - void set_vdp_mixing(UINT8 mixing); + void set_vdp_mixing(uint8_t mixing); void draw_vdp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); // devices @@ -143,7 +143,7 @@ protected: required_device m_soundlatch; // memory pointers - required_shared_ptr m_workram; + required_shared_ptr m_workram; // configuration segas18_rom_board m_romboard; @@ -153,13 +153,13 @@ protected: // internal state int m_grayscale_enable; int m_vdp_enable; - UINT8 m_vdp_mixing; + uint8_t m_vdp_mixing; bitmap_ind16 m_temp_bitmap; - UINT8 m_mcu_data; + uint8_t m_mcu_data; // game-specific state - UINT8 m_wwally_last_x[3]; - UINT8 m_wwally_last_y[3]; - UINT8 m_lghost_value; - UINT8 m_lghost_select; + uint8_t m_wwally_last_x[3]; + uint8_t m_wwally_last_y[3]; + uint8_t m_lghost_value; + uint8_t m_lghost_select; }; diff --git a/src/mame/includes/segas24.h b/src/mame/includes/segas24.h index 957c40f9b5d..4857cfa7504 100644 --- a/src/mame/includes/segas24.h +++ b/src/mame/includes/segas24.h @@ -39,16 +39,16 @@ public: required_device m_dac; required_device m_screen; required_device m_palette; - required_shared_ptr m_generic_paletteram_16; + required_shared_ptr m_generic_paletteram_16; optional_memory_region m_romboard; - static const UINT8 mahmajn_mlt[8]; - static const UINT8 mahmajn2_mlt[8]; - static const UINT8 qgh_mlt[8]; - static const UINT8 bnzabros_mlt[8]; - static const UINT8 qrouka_mlt[8]; - static const UINT8 quizmeku_mlt[8]; - static const UINT8 dcclub_mlt[8]; + static const uint8_t mahmajn_mlt[8]; + static const uint8_t mahmajn2_mlt[8]; + static const uint8_t qgh_mlt[8]; + static const uint8_t bnzabros_mlt[8]; + static const uint8_t qrouka_mlt[8]; + static const uint8_t quizmeku_mlt[8]; + static const uint8_t dcclub_mlt[8]; int fdc_status; int fdc_track; @@ -59,18 +59,18 @@ public: int fdc_drq; int fdc_span; int fdc_index_count; - UINT8 *fdc_pt; + uint8_t *fdc_pt; int track_size; int cur_input_line; - UINT8 hotrod_ctrl_cur; - UINT8 resetcontrol; - UINT8 prev_resetcontrol; - UINT8 curbank; - UINT8 mlatch; - const UINT8 *mlatch_table; + uint8_t hotrod_ctrl_cur; + uint8_t resetcontrol; + uint8_t prev_resetcontrol; + uint8_t curbank; + uint8_t mlatch; + const uint8_t *mlatch_table; - UINT16 irq_tdata, irq_tval; - UINT8 irq_tmode, irq_allow0, irq_allow1; + uint16_t irq_tdata, irq_tval; + uint8_t irq_tmode, irq_allow0, irq_allow1; int irq_timer_pend0; int irq_timer_pend1; int irq_yms; @@ -81,12 +81,12 @@ public: timer_device *irq_timer_clear; //timer_device *irq_frc; timer_device *frc_cnt_timer; - UINT8 frc_mode; + uint8_t frc_mode; - UINT16 *shared_ram; - UINT8 (segas24_state::*io_r)(UINT8 port); - void (segas24_state::*io_w)(UINT8 port, UINT8 data); - UINT8 io_cnt, io_dir; + uint16_t *shared_ram; + uint8_t (segas24_state::*io_r)(uint8_t port); + void (segas24_state::*io_w)(uint8_t port, uint8_t data); + uint8_t io_cnt, io_dir; segas24_tile *vtile; segas24_sprite *vsprite; @@ -116,12 +116,12 @@ public: DECLARE_READ16_MEMBER ( sys16_io_r ); DECLARE_WRITE16_MEMBER( sys16_io_w ); - UINT8 hotrod_io_r(UINT8 port); - UINT8 dcclub_io_r(UINT8 port); - UINT8 mahmajn_io_r(UINT8 port); + uint8_t hotrod_io_r(uint8_t port); + uint8_t dcclub_io_r(uint8_t port); + uint8_t mahmajn_io_r(uint8_t port); - void hotrod_io_w(UINT8 port, UINT8 data); - void mahmajn_io_w(UINT8 port, UINT8 data); + void hotrod_io_w(uint8_t port, uint8_t data); + void mahmajn_io_w(uint8_t port, uint8_t data); void fdc_init(); void reset_reset(); @@ -129,7 +129,7 @@ public: void irq_init(); void irq_timer_sync(); void irq_timer_start(int old_tmode); - void reset_control_w(UINT8 data); + void reset_control_w(uint8_t data); DECLARE_DRIVER_INIT(crkdown); DECLARE_DRIVER_INIT(quizmeku); DECLARE_DRIVER_INIT(qrouka); @@ -148,7 +148,7 @@ public: DECLARE_DRIVER_INIT(sgmast); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_system24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_system24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(irq_timer_cb); TIMER_DEVICE_CALLBACK_MEMBER(irq_timer_clear_cb); TIMER_DEVICE_CALLBACK_MEMBER(irq_frc_cb); diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h index 0bd010089c8..afbda1fb0ad 100644 --- a/src/mame/includes/segas32.h +++ b/src/mame/includes/segas32.h @@ -16,14 +16,14 @@ class segas32_state : public device_t { public: - segas32_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segas32_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - required_shared_ptr m_z80_shared_ram; - optional_shared_ptr m_ga2_dpram; - optional_shared_ptr m_system32_workram; - required_shared_ptr m_system32_videoram; - required_shared_ptr m_system32_spriteram; - optional_shared_ptr_array m_system32_paletteram; + required_shared_ptr m_z80_shared_ram; + optional_shared_ptr m_ga2_dpram; + optional_shared_ptr m_system32_workram; + required_shared_ptr m_system32_videoram; + required_shared_ptr m_system32_spriteram; + optional_shared_ptr_array m_system32_paletteram; optional_ioport_array<8> m_ports_a; optional_ioport_array<8> m_ports_b; @@ -43,18 +43,18 @@ public: required_device m_irq_timer_1; optional_device m_s32comm; - typedef void (segas32_state::*sys32_output_callback)(int which, UINT16 data); + typedef void (segas32_state::*sys32_output_callback)(int which, uint16_t data); struct layer_info { bitmap_ind16 *bitmap; - UINT8* transparent; + uint8_t* transparent; }; struct extents_list { - UINT8 scan_extent[256]; - UINT16 extent[32][16]; + uint8_t scan_extent[256]; + uint16_t extent[32][16]; }; @@ -62,39 +62,39 @@ public: { struct cache_entry * next; tilemap_t * tmap; - UINT8 page; - UINT8 bank; + uint8_t page; + uint8_t bank; }; - UINT8 m_v60_irq_control[0x10]; + uint8_t m_v60_irq_control[0x10]; timer_device *m_v60_irq_timer[2]; - UINT8 m_sound_irq_control[4]; - UINT8 m_sound_irq_input; - UINT8 m_sound_dummy_value; - UINT16 m_sound_bank; - UINT8 m_misc_io_data[2][0x10]; + uint8_t m_sound_irq_control[4]; + uint8_t m_sound_irq_input; + uint8_t m_sound_dummy_value; + uint16_t m_sound_bank; + uint8_t m_misc_io_data[2][0x10]; read16_delegate m_custom_io_r[2]; write16_delegate m_custom_io_w[2]; - UINT8 m_analog_bank; - UINT8 m_analog_value[4]; - UINT8 m_sonic_last[6]; + uint8_t m_analog_bank; + uint8_t m_analog_value[4]; + uint8_t m_sonic_last[6]; sys32_output_callback m_sw1_output; sys32_output_callback m_sw2_output; sys32_output_callback m_sw3_output; - std::unique_ptr m_system32_protram; - UINT16 m_system32_displayenable[2]; - UINT16 m_system32_tilebank_external; - UINT16 m_arescue_dsp_io[6]; - UINT8 m_is_multi32; + std::unique_ptr m_system32_protram; + uint16_t m_system32_displayenable[2]; + uint16_t m_system32_tilebank_external; + uint16_t m_arescue_dsp_io[6]; + uint8_t m_is_multi32; struct cache_entry *m_cache_head; struct layer_info m_layer_data[11]; - UINT16 m_mixer_control[2][0x40]; - std::unique_ptr m_solid_0000; - std::unique_ptr m_solid_ffff; - UINT8 m_sprite_render_count; - UINT8 m_sprite_control_latched[8]; - UINT8 m_sprite_control[8]; - std::unique_ptr m_spriteram_32bit; + uint16_t m_mixer_control[2][0x40]; + std::unique_ptr m_solid_0000; + std::unique_ptr m_solid_ffff; + uint8_t m_sprite_render_count; + uint8_t m_sprite_control_latched[8]; + uint8_t m_sprite_control[8]; + std::unique_ptr m_spriteram_32bit; typedef void (segas32_state::*prot_vblank_func)(); prot_vblank_func m_system32_prot_vblank; int m_print_count; @@ -176,57 +176,57 @@ public: DECLARE_WRITE8_MEMBER(scross_bank_w); TILE_GET_INFO_MEMBER(get_tile_info); - UINT32 screen_update_system32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_multi32_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_multi32_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_system32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_multi32_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_multi32_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(start_of_vblank_int); TIMER_CALLBACK_MEMBER(end_of_vblank_int); TIMER_CALLBACK_MEMBER(update_sprites); TIMER_DEVICE_CALLBACK_MEMBER(signal_v60_irq_callback); void common_start(int multi32); void system32_set_vblank(int state); - inline UINT16 xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(UINT16 value); - inline UINT16 xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(UINT16 value); - inline void update_color(int offset, UINT16 data); - inline UINT16 common_paletteram_r(address_space &space, int which, offs_t offset); - void common_paletteram_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask); + inline uint16_t xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(uint16_t value); + inline uint16_t xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(uint16_t value); + inline void update_color(int offset, uint16_t data); + inline uint16_t common_paletteram_r(address_space &space, int which, offs_t offset); + void common_paletteram_w(address_space &space, int which, offs_t offset, uint16_t data, uint16_t mem_mask); tilemap_t *find_cache_entry(int page, int bank); inline void get_tilemaps(int bgnum, tilemap_t **tilemaps); - UINT8 update_tilemaps(screen_device &screen, const rectangle &cliprect); + uint8_t update_tilemaps(screen_device &screen, const rectangle &cliprect); void sprite_erase_buffer(); void sprite_swap_buffers(); - int draw_one_sprite(UINT16 *data, int xoffs, int yoffs, const rectangle &clipin, const rectangle &clipout); + int draw_one_sprite(uint16_t *data, int xoffs, int yoffs, const rectangle &clipin, const rectangle &clipout); void sprite_render_list(); - inline UINT8 compute_color_offsets(int which, int layerbit, int layerflag); - inline UINT16 compute_sprite_blend(UINT8 encoding); - inline UINT16 *get_layer_scanline(int layer, int scanline); - void mix_all_layers(int which, int xoffs, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 enablemask); + inline uint8_t compute_color_offsets(int which, int layerbit, int layerflag); + inline uint16_t compute_sprite_blend(uint8_t encoding); + inline uint16_t *get_layer_scanline(int layer, int scanline); + void mix_all_layers(int which, int xoffs, bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t enablemask); void print_mixer_data(int which); - UINT32 multi32_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index); + uint32_t multi32_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index); void decrypt_ga2_protrom(); void update_irq_state(); void signal_v60_irq(int which); - void int_control_w(address_space &space, int offset, UINT8 data); - UINT16 common_io_chip_r(address_space &space, int which, offs_t offset, UINT16 mem_mask); - void common_io_chip_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask); + void int_control_w(address_space &space, int offset, uint8_t data); + uint16_t common_io_chip_r(address_space &space, int which, offs_t offset, uint16_t mem_mask); + void common_io_chip_w(address_space &space, int which, offs_t offset, uint16_t data, uint16_t mem_mask); void update_sound_irq_state(); void segas32_common_init(read16_delegate custom_r, write16_delegate custom_w); - void radm_sw1_output( int which, UINT16 data ); - void radm_sw2_output( int which, UINT16 data ); - void radr_sw2_output( int which, UINT16 data ); - void alien3_sw1_output( int which, UINT16 data ); - void arescue_sw1_output( int which, UINT16 data ); - void f1lap_sw1_output( int which, UINT16 data ); - void jpark_sw1_output( int which, UINT16 data ); - void orunners_sw1_output( int which, UINT16 data ); - void orunners_sw2_output( int which, UINT16 data ); - void harddunk_sw1_output( int which, UINT16 data ); - void harddunk_sw2_output( int which, UINT16 data ); - void harddunk_sw3_output( int which, UINT16 data ); - void titlef_sw1_output( int which, UINT16 data ); - void titlef_sw2_output( int which, UINT16 data ); - void scross_sw1_output( int which, UINT16 data ); - void scross_sw2_output( int which, UINT16 data ); + void radm_sw1_output( int which, uint16_t data ); + void radm_sw2_output( int which, uint16_t data ); + void radr_sw2_output( int which, uint16_t data ); + void alien3_sw1_output( int which, uint16_t data ); + void arescue_sw1_output( int which, uint16_t data ); + void f1lap_sw1_output( int which, uint16_t data ); + void jpark_sw1_output( int which, uint16_t data ); + void orunners_sw1_output( int which, uint16_t data ); + void orunners_sw2_output( int which, uint16_t data ); + void harddunk_sw1_output( int which, uint16_t data ); + void harddunk_sw2_output( int which, uint16_t data ); + void harddunk_sw3_output( int which, uint16_t data ); + void titlef_sw1_output( int which, uint16_t data ); + void titlef_sw2_output( int which, uint16_t data ); + void scross_sw1_output( int which, uint16_t data ); + void scross_sw2_output( int which, uint16_t data ); int compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle &cliprect, struct extents_list *list); void compute_tilemap_flips(int bgnum, int &flipx, int &flipy); void update_tilemap_zoom(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum); @@ -272,7 +272,7 @@ protected: class segas32_regular_state : public segas32_state { public: - segas32_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segas32_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -283,7 +283,7 @@ protected: class segas32_v25_state : public segas32_state { public: - segas32_v25_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segas32_v25_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -294,7 +294,7 @@ protected: class sega_multi32_state : public segas32_state { public: - sega_multi32_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + sega_multi32_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -303,6 +303,6 @@ protected: }; /*----------- defined in machine/segas32.c -----------*/ -extern const UINT8 ga2_v25_opcode_table[]; +extern const uint8_t ga2_v25_opcode_table[]; extern const device_type SEGA_S32_PCB; diff --git a/src/mame/includes/segasp.h b/src/mame/includes/segasp.h index ee952a7dcd9..fe1ac92bead 100644 --- a/src/mame/includes/segasp.h +++ b/src/mame/includes/segasp.h @@ -25,7 +25,7 @@ public: DECLARE_WRITE64_MEMBER(sn_93c46a_w); DECLARE_READ64_MEMBER(sp_bank_r); DECLARE_WRITE64_MEMBER(sp_bank_w); - UINT16 m_sp_bank; + uint16_t m_sp_bank; protected: }; diff --git a/src/mame/includes/segaxbd.h b/src/mame/includes/segaxbd.h index cf05812e036..915143c0f35 100644 --- a/src/mame/includes/segaxbd.h +++ b/src/mame/includes/segaxbd.h @@ -24,16 +24,16 @@ class segaxbd_state : public device_t { public: // construction/destruction - segaxbd_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segaxbd_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // compare/timer chip callbacks void timer_ack_callback(); - void sound_data_w(UINT8 data); + void sound_data_w(uint8_t data); // main CPU read/write handlers DECLARE_READ16_MEMBER( adc_r ); DECLARE_WRITE16_MEMBER( adc_w ); - UINT16 iochip_r(int which, int port, int inputval); + uint16_t iochip_r(int which, int port, int inputval); DECLARE_READ16_MEMBER( iochip_0_r ); DECLARE_WRITE16_MEMBER( iochip_0_w ); DECLARE_READ16_MEMBER( iochip_1_r ); @@ -52,7 +52,7 @@ public: // video updates - 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); // palette helpers DECLARE_WRITE16_MEMBER( paletteram_w ); @@ -65,8 +65,8 @@ public: protected: // internal types - typedef delegate ioread_delegate; - typedef delegate iowrite_delegate; + typedef delegate ioread_delegate; + typedef delegate iowrite_delegate; // timer IDs enum @@ -86,13 +86,13 @@ protected: DECLARE_WRITE_LINE_MEMBER(m68k_reset_callback); // custom I/O - void generic_iochip0_lamps_w(UINT8 data); - UINT8 aburner2_iochip0_motor_r(UINT8 data); - void aburner2_iochip0_motor_w(UINT8 data); - UINT8 smgp_iochip0_motor_r(UINT8 data); - void smgp_iochip0_motor_w(UINT8 data); - UINT8 lastsurv_iochip1_port_r(UINT8 data); - void lastsurv_iochip0_muxer_w(UINT8 data); + void generic_iochip0_lamps_w(uint8_t data); + uint8_t aburner2_iochip0_motor_r(uint8_t data); + void aburner2_iochip0_motor_w(uint8_t data); + uint8_t smgp_iochip0_motor_r(uint8_t data); + void smgp_iochip0_motor_w(uint8_t data); + uint8_t lastsurv_iochip1_port_r(uint8_t data); + void lastsurv_iochip0_muxer_w(uint8_t data); // devices public: @@ -108,34 +108,34 @@ protected: required_device m_segaic16vid; required_device m_segaic16road; required_device m_soundlatch; - required_shared_ptr m_subram0; + required_shared_ptr m_subram0; // configuration bool m_adc_reverse[8]; ioread_delegate m_iochip_custom_io_r[2][8]; iowrite_delegate m_iochip_custom_io_w[2][8]; - UINT8 m_road_priority; + uint8_t m_road_priority; // internal state emu_timer * m_scanline_timer; - UINT8 m_timer_irq_state; - UINT8 m_vblank_irq_state; - UINT8 m_iochip_regs[2][8]; + uint8_t m_timer_irq_state; + uint8_t m_vblank_irq_state; + uint8_t m_iochip_regs[2][8]; // game-specific state - UINT16 * m_loffire_sync; - UINT8 m_lastsurv_mux; + uint16_t * m_loffire_sync; + uint8_t m_lastsurv_mux; public: // -- stupid system16.c // memory pointers - required_shared_ptr m_paletteram; + required_shared_ptr m_paletteram; bool m_gprider_hack; protected: void palette_init(); - 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; optional_ioport_array<8> m_adc_ports; @@ -150,7 +150,7 @@ protected: class segaxbd_regular_state : public segaxbd_state { public: - segaxbd_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segaxbd_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -163,7 +163,7 @@ protected: class segaxbd_fd1094_state : public segaxbd_state { public: - segaxbd_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segaxbd_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -174,7 +174,7 @@ protected: class segaxbd_lastsurv_fd1094_state : public segaxbd_state { public: - segaxbd_lastsurv_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segaxbd_lastsurv_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -185,7 +185,7 @@ protected: class segaxbd_lastsurv_state : public segaxbd_state { public: - segaxbd_lastsurv_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segaxbd_lastsurv_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -197,7 +197,7 @@ protected: class segaxbd_smgp_fd1094_state : public segaxbd_state { public: - segaxbd_smgp_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segaxbd_smgp_fd1094_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -209,7 +209,7 @@ protected: class segaxbd_smgp_state : public segaxbd_state { public: - segaxbd_smgp_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segaxbd_smgp_state(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -221,7 +221,7 @@ protected: class segaxbd_rascot_state : public segaxbd_state { public: - segaxbd_rascot_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + segaxbd_rascot_state(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/includes/segaybd.h b/src/mame/includes/segaybd.h index 90b6a2e2777..c9cfff6ef98 100644 --- a/src/mame/includes/segaybd.h +++ b/src/mame/includes/segaybd.h @@ -65,14 +65,14 @@ public: // DECLARE_READ8_MEMBER( link_portc0_r ); // game-specific output handlers - void gforce2_output_cb1(UINT16 data); - void gforce2_output_cb2(UINT16 data); - void gloc_output_cb1(UINT16 data); - void gloc_output_cb2(UINT16 data); - void r360_output_cb2(UINT16 data); - void pdrift_output_cb1(UINT16 data); - void pdrift_output_cb2(UINT16 data); - void rchase_output_cb2(UINT16 data); + void gforce2_output_cb1(uint16_t data); + void gforce2_output_cb2(uint16_t data); + void gloc_output_cb1(uint16_t data); + void gloc_output_cb2(uint16_t data); + void r360_output_cb2(uint16_t data); + void pdrift_output_cb1(uint16_t data); + void pdrift_output_cb2(uint16_t data); + void rchase_output_cb2(uint16_t data); // game-specific driver init DECLARE_DRIVER_INIT(generic); @@ -83,11 +83,11 @@ public: DECLARE_DRIVER_INIT(gloc); // video updates - 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: // internal types - typedef delegate output_delegate; + typedef delegate output_delegate; // timer IDs enum @@ -125,12 +125,12 @@ protected: output_delegate m_output_cb2; // internal state - UINT16 m_pdrift_bank; + uint16_t m_pdrift_bank; emu_timer * m_scanline_timer; - UINT8 m_analog_data[4]; + uint8_t m_analog_data[4]; int m_irq2_scanline; - UINT8 m_timer_irq_state; - UINT8 m_vblank_irq_state; - UINT8 m_misc_io_data[0x10]; + uint8_t m_timer_irq_state; + uint8_t m_vblank_irq_state; + uint8_t m_misc_io_data[0x10]; bitmap_ind16 m_tmp_bitmap; }; diff --git a/src/mame/includes/seibuspi.h b/src/mame/includes/seibuspi.h index ace6f82982f..1e47875ade0 100644 --- a/src/mame/includes/seibuspi.h +++ b/src/mame/includes/seibuspi.h @@ -35,7 +35,7 @@ public: required_device m_maincpu; optional_device m_audiocpu; - required_shared_ptr m_mainram; + required_shared_ptr m_mainram; optional_memory_region m_z80_rom; optional_device m_eeprom; optional_device m_soundflash1; @@ -52,18 +52,18 @@ public: int m_z80_prg_transfer_pos; int m_z80_lastbank; - UINT8 m_sb_coin_latch; - UINT8 m_ejsakura_input_port; + uint8_t m_sb_coin_latch; + uint8_t m_ejsakura_input_port; tilemap_t *m_text_layer; tilemap_t *m_back_layer; tilemap_t *m_midl_layer; tilemap_t *m_fore_layer; - UINT32 m_video_dma_length; - UINT32 m_video_dma_address; - UINT16 m_layer_enable; - UINT16 m_layer_bank; - UINT8 m_rf2_layer_bank; - UINT16 m_scrollram[6]; + uint32_t m_video_dma_length; + uint32_t m_video_dma_address; + uint16_t m_layer_enable; + uint16_t m_layer_bank; + uint8_t m_rf2_layer_bank; + uint16_t m_scrollram[6]; int m_rowscroll_enable; int m_midl_layer_offset; int m_fore_layer_offset; @@ -72,14 +72,14 @@ public: int m_back_layer_d14; int m_midl_layer_d14; int m_fore_layer_d14; - std::unique_ptr m_tilemap_ram; - std::unique_ptr m_palette_ram; - std::unique_ptr m_sprite_ram; - UINT32 m_tilemap_ram_size; - UINT32 m_palette_ram_size; - UINT32 m_sprite_ram_size; - UINT32 m_bg_fore_layer_position; - UINT8 m_alpha_table[0x2000]; + std::unique_ptr m_tilemap_ram; + std::unique_ptr m_palette_ram; + std::unique_ptr m_sprite_ram; + uint32_t m_tilemap_ram_size; + uint32_t m_palette_ram_size; + uint32_t m_sprite_ram_size; + uint32_t m_bg_fore_layer_position; + uint8_t m_alpha_table[0x2000]; int m_sprite_bpp; DECLARE_WRITE16_MEMBER(tile_decrypt_key_w); @@ -125,9 +125,9 @@ public: INTERRUPT_GEN_MEMBER(spi_interrupt); void set_layer_offsets(); - void drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, bitmap_ind8 &primap, int primask); + void drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, bitmap_ind8 &primap, int primask); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &primap, int priority); - void combine_tilemap(bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *tile, int sx, int sy, int opaque, INT16 *rowscroll); + void combine_tilemap(bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *tile, int sx, int sy, int opaque, int16_t *rowscroll); virtual void machine_start() override; virtual void video_start() override; @@ -139,8 +139,8 @@ public: TILE_GET_INFO_MEMBER(get_back_tile_info); TILE_GET_INFO_MEMBER(get_midl_tile_info); TILE_GET_INFO_MEMBER(get_fore_tile_info); - UINT32 screen_update_spi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sys386f(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sys386f(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void register_video_state(); void init_spi_common(); @@ -156,12 +156,12 @@ public: DECLARE_DRIVER_INIT(ejanhs); DECLARE_DRIVER_INIT(sys386f); - void text_decrypt(UINT8 *rom); - void bg_decrypt(UINT8 *rom, int size); + void text_decrypt(uint8_t *rom); + void bg_decrypt(uint8_t *rom, int size); - void rdft2_text_decrypt(UINT8 *rom); - void rdft2_bg_decrypt(UINT8 *rom, int size); + void rdft2_text_decrypt(uint8_t *rom); + void rdft2_bg_decrypt(uint8_t *rom, int size); - void rfjet_text_decrypt(UINT8 *rom); - void rfjet_bg_decrypt(UINT8 *rom, int size); + void rfjet_text_decrypt(uint8_t *rom); + void rfjet_bg_decrypt(uint8_t *rom, int size); }; diff --git a/src/mame/includes/seicross.h b/src/mame/includes/seicross.h index d887816380b..0cfffd270c3 100644 --- a/src/mame/includes/seicross.h +++ b/src/mame/includes/seicross.h @@ -31,16 +31,16 @@ public: optional_ioport m_debug_port; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_row_scroll; - required_shared_ptr m_spriteram2; - required_shared_ptr m_colorram; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_row_scroll; + required_shared_ptr m_spriteram2; + required_shared_ptr m_colorram; + optional_shared_ptr m_decrypted_opcodes; - UINT8 m_portb; + uint8_t m_portb; tilemap_t *m_bg_tilemap; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_WRITE8_MEMBER(colorram_w); @@ -57,7 +57,7 @@ public: DECLARE_PALETTE_INIT(seicross); DECLARE_DRIVER_INIT(friskytb); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); void nvram_init(nvram_device &nvram, void *data, size_t size); diff --git a/src/mame/includes/senjyo.h b/src/mame/includes/senjyo.h index 18d399c10d6..ba37e65a45d 100644 --- a/src/mame/includes/senjyo.h +++ b/src/mame/includes/senjyo.h @@ -42,28 +42,28 @@ public: required_device m_radar_palette; /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_fgscroll; - required_shared_ptr m_scrollx1; - required_shared_ptr m_scrolly1; - required_shared_ptr m_scrollx2; - required_shared_ptr m_scrolly2; - required_shared_ptr m_scrollx3; - required_shared_ptr m_scrolly3; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_fgcolorram; - required_shared_ptr m_bg1videoram; - required_shared_ptr m_bg2videoram; - required_shared_ptr m_bg3videoram; - required_shared_ptr m_radarram; - required_shared_ptr m_bgstripesram; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_spriteram; + required_shared_ptr m_fgscroll; + required_shared_ptr m_scrollx1; + required_shared_ptr m_scrolly1; + required_shared_ptr m_scrollx2; + required_shared_ptr m_scrolly2; + required_shared_ptr m_scrollx3; + required_shared_ptr m_scrolly3; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_fgcolorram; + required_shared_ptr m_bg1videoram; + required_shared_ptr m_bg2videoram; + required_shared_ptr m_bg3videoram; + required_shared_ptr m_radarram; + required_shared_ptr m_bgstripesram; + optional_shared_ptr m_decrypted_opcodes; // game specific initialization int m_is_senjyo; int m_scrollhack; - UINT8 m_sound_cmd; + uint8_t m_sound_cmd; int m_single_volume; int m_sound_state; int m_bgstripes; @@ -103,7 +103,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_bgbitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_radar(bitmap_rgb32 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect,int priority); diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h index 53f8b8142de..e7d0c7f58dd 100644 --- a/src/mame/includes/seta.h +++ b/src/mame/includes/seta.h @@ -16,9 +16,9 @@ struct uPD71054_state { emu_timer *timer[3]; // Timer - UINT16 max[3]; // Max counter - UINT16 write_select; // Max counter write select - UINT8 reg[4]; // + uint16_t max[3]; // Max counter + uint16_t write_select; // Max counter write select + uint8_t reg[4]; // }; struct game_offset @@ -91,18 +91,18 @@ public: optional_ioport m_dsw2_3; optional_ioport_array<5> m_bet; - optional_shared_ptr m_sharedram; - optional_shared_ptr m_workram; - optional_shared_ptr m_vregs; - optional_shared_ptr m_vram_0; - optional_shared_ptr m_vctrl_0; - optional_shared_ptr m_vram_2; - optional_shared_ptr m_vctrl_2; - optional_shared_ptr m_paletteram; - optional_shared_ptr m_paletteram2; - optional_shared_ptr m_kiwame_nvram; - optional_shared_ptr m_inttoote_key_select; - optional_shared_ptr m_inttoote_700000; + optional_shared_ptr m_sharedram; + optional_shared_ptr m_workram; + optional_shared_ptr m_vregs; + optional_shared_ptr m_vram_0; + optional_shared_ptr m_vctrl_0; + optional_shared_ptr m_vram_2; + optional_shared_ptr m_vctrl_2; + optional_shared_ptr m_paletteram; + optional_shared_ptr m_paletteram2; + optional_shared_ptr m_kiwame_nvram; + optional_shared_ptr m_inttoote_key_select; + optional_shared_ptr m_inttoote_700000; required_device m_gfxdecode; required_device m_palette; @@ -130,22 +130,22 @@ public: int m_gun_bit_count; int m_gun_old_clock; - UINT8 m_usclssic_port_select; + uint8_t m_usclssic_port_select; int m_keroppi_prize_hop; int m_keroppi_protection_count; int m_wiggie_soundlatch; - UINT8 m_jockeyc_key_select; + uint8_t m_jockeyc_key_select; - UINT8 m_twineagl_xram[8]; + uint8_t m_twineagl_xram[8]; int m_twineagl_tilebank[4]; - UINT16 m_magspeed_lights[3]; + uint16_t m_magspeed_lights[3]; - UINT16 m_pairslove_protram[0x200]; - UINT16 m_pairslove_protram_old[0x200]; - UINT16 m_downtown_protection[0x200/2]; + uint16_t m_pairslove_protram[0x200]; + uint16_t m_pairslove_protram_old[0x200]; + uint16_t m_downtown_protection[0x200/2]; DECLARE_WRITE16_MEMBER(seta_vregs_w); DECLARE_WRITE16_MEMBER(seta_vram_0_w); @@ -242,12 +242,12 @@ public: DECLARE_MACHINE_START(keroppi); DECLARE_VIDEO_START(oisipuzl_2_layers); DECLARE_PALETTE_INIT(inttoote); - UINT32 screen_update_seta_no_layers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_seta(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_usclssic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_setaroul(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_inttoote(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_seta_layers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_seta_no_layers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_seta(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_usclssic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_setaroul(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_inttoote(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_seta_layers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_seta_buffer_sprites(screen_device &screen, bool state); void screen_eof_setaroul(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(wrofaero_interrupt); diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h index 6c0228f4c1e..43c3fc4f4b1 100644 --- a/src/mame/includes/seta2.h +++ b/src/mame/includes/seta2.h @@ -41,23 +41,23 @@ public: required_device m_screen; required_device m_palette; - optional_shared_ptr m_nvram; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_tileram; - optional_shared_ptr m_rgbram; - optional_shared_ptr m_vregs; - optional_shared_ptr m_funcube_outputs; - optional_shared_ptr m_funcube_leds; + optional_shared_ptr m_nvram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_tileram; + optional_shared_ptr m_rgbram; + optional_shared_ptr m_vregs; + optional_shared_ptr m_funcube_outputs; + optional_shared_ptr m_funcube_leds; int m_xoffset; int m_yoffset; int m_keyboard_row; - std::unique_ptr m_buffered_spriteram; + std::unique_ptr m_buffered_spriteram; - UINT64 m_funcube_coin_start_cycles; - UINT8 m_funcube_hopper_motor; + uint64_t m_funcube_coin_start_cycles; + uint8_t m_funcube_hopper_motor; - UINT16 m_lamps1, m_lamps2, m_cam; + uint16_t m_lamps1, m_lamps2, m_cam; DECLARE_WRITE16_MEMBER(spriteram16_word_w); DECLARE_READ16_MEMBER(spriteram16_word_r); @@ -112,8 +112,8 @@ public: DECLARE_VIDEO_START(yoffset); DECLARE_VIDEO_START(xoffset); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 staraudi_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t staraudi_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof(screen_device &screen, bool state); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void draw_rgbram(bitmap_ind16 &bitmap); diff --git a/src/mame/includes/sf.h b/src/mame/includes/sf.h index 0a0de45c937..eacba4ef146 100644 --- a/src/mame/includes/sf.h +++ b/src/mame/includes/sf.h @@ -35,16 +35,16 @@ public: required_device m_soundlatch; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_objectram; + required_shared_ptr m_videoram; + required_shared_ptr m_objectram; /* video-related */ tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; tilemap_t *m_tx_tilemap; int m_active; - UINT16 m_bgscroll; - UINT16 m_fgscroll; + uint16_t m_bgscroll; + uint16_t m_fgscroll; DECLARE_WRITE8_MEMBER(coin_w); DECLARE_WRITE8_MEMBER(soundcmd_w); @@ -62,8 +62,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - 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); inline int invert( int nb ); void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); - void write_dword( address_space &space, offs_t offset, UINT32 data ); + void write_dword( address_space &space, offs_t offset, uint32_t data ); }; diff --git a/src/mame/includes/shadfrce.h b/src/mame/includes/shadfrce.h index 05aeb736d67..f13e135b948 100644 --- a/src/mame/includes/shadfrce.h +++ b/src/mame/includes/shadfrce.h @@ -46,12 +46,12 @@ public: required_ioport m_io_misc; required_ioport m_io_system; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bg0videoram; - required_shared_ptr m_bg1videoram; - required_shared_ptr m_spvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bg0videoram; + required_shared_ptr m_bg1videoram; + required_shared_ptr m_spvideoram; - std::unique_ptr m_spvideoram_old; + std::unique_ptr m_spvideoram_old; tilemap_t *m_fgtilemap; tilemap_t *m_bg0tilemap; tilemap_t *m_bg1tilemap; @@ -85,7 +85,7 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(scanline); - 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); void screen_eof(screen_device &screen, bool state); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/shangha3.h b/src/mame/includes/shangha3.h index deaf039aa8e..98239f9d2ab 100644 --- a/src/mame/includes/shangha3.h +++ b/src/mame/includes/shangha3.h @@ -26,14 +26,14 @@ public: required_device m_palette; optional_device m_soundlatch; - required_shared_ptr m_ram; + required_shared_ptr m_ram; // driver init configuration int m_do_shadows; - UINT8 m_drawmode_table[16]; + uint8_t m_drawmode_table[16]; int m_prot_count; - UINT16 m_gfxlist_addr; + uint16_t m_gfxlist_addr; bitmap_ind16 m_rawbitmap; // common @@ -58,5 +58,5 @@ public: DECLARE_DRIVER_INIT(heberpop); virtual void video_start() override; - 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); }; diff --git a/src/mame/includes/shangkid.h b/src/mame/includes/shangkid.h index 6680c6c1748..795f9db3d7c 100644 --- a/src/mame/includes/shangkid.h +++ b/src/mame/includes/shangkid.h @@ -20,12 +20,12 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_videoreg; + required_shared_ptr m_videoram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_videoreg; - UINT8 m_bbx_sound_enable; - UINT8 m_sound_latch; + uint8_t m_bbx_sound_enable; + uint8_t m_sound_latch; int m_gfx_type; tilemap_t *m_background; @@ -51,9 +51,9 @@ public: DECLARE_PALETTE_INIT(dynamski); DECLARE_MACHINE_RESET(shangkid); - UINT32 screen_update_shangkid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dynamski(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprite(const UINT8 *source, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_shangkid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dynamski(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprite(const uint8_t *source, bitmap_ind16 &bitmap, const rectangle &cliprect); void shangkid_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void dynamski_draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ); void dynamski_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/shaolins.h b/src/mame/includes/shaolins.h index 06c7a60df76..0efe76a3b71 100644 --- a/src/mame/includes/shaolins.h +++ b/src/mame/includes/shaolins.h @@ -16,13 +16,13 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; int m_palettebank; tilemap_t *m_bg_tilemap; - UINT8 m_nmi_enable; + uint8_t m_nmi_enable; DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_WRITE8_MEMBER(colorram_w); @@ -35,7 +35,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(shaolins); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); diff --git a/src/mame/includes/shisen.h b/src/mame/includes/shisen.h index a77429e2798..29b16e26359 100644 --- a/src/mame/includes/shisen.h +++ b/src/mame/includes/shisen.h @@ -19,8 +19,8 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_paletteram; - required_shared_ptr m_videoram; + required_shared_ptr m_paletteram; + required_shared_ptr m_videoram; int m_gfxbank; tilemap_t *m_bg_tilemap; @@ -35,5 +35,5 @@ public: virtual void video_start() override; - 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); }; diff --git a/src/mame/includes/shootout.h b/src/mame/includes/shootout.h index 7cd63947e87..fc1486b03fb 100644 --- a/src/mame/includes/shootout.h +++ b/src/mame/includes/shootout.h @@ -23,9 +23,9 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_spriteram; - required_shared_ptr m_textram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_textram; + required_shared_ptr m_videoram; tilemap_t *m_background; tilemap_t *m_foreground; @@ -47,7 +47,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); - UINT32 screen_update_shootout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_shootouj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_shootout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_shootouj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits ); }; diff --git a/src/mame/includes/shuuz.h b/src/mame/includes/shuuz.h index 8f0e20ac876..84cfc76c159 100644 --- a/src/mame/includes/shuuz.h +++ b/src/mame/includes/shuuz.h @@ -30,7 +30,7 @@ public: TILE_GET_INFO_MEMBER(get_playfield_tile_info); - 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); static const atari_motion_objects_config s_mob_config; }; diff --git a/src/mame/includes/sidearms.h b/src/mame/includes/sidearms.h index cbf6dbd9fee..ba74d5089b1 100644 --- a/src/mame/includes/sidearms.h +++ b/src/mame/includes/sidearms.h @@ -26,16 +26,16 @@ public: required_device m_palette; required_device m_spriteram; - required_shared_ptr m_bg_scrollx; - required_shared_ptr m_bg_scrolly; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_bg_scrollx; + required_shared_ptr m_bg_scrolly; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; optional_ioport_array<5> m_ports; int m_gameid; - UINT8 *m_tilerom; + uint8_t *m_tilerom; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -45,10 +45,10 @@ public: int m_charon; int m_flipon; - UINT32 m_hflop_74a_n; - UINT32 m_hcount_191; - UINT32 m_vcount_191; - UINT32 m_latch_374; + uint32_t m_hflop_74a_n; + uint32_t m_hcount_191; + uint32_t m_vcount_191; + uint32_t m_latch_374; DECLARE_WRITE8_MEMBER(bankswitch_w); DECLARE_WRITE8_MEMBER(videoram_w); @@ -74,7 +74,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); TILEMAP_MAPPER_MEMBER(tilemap_scan); - 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); void draw_sprites_region(bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset, int end_offset ); void draw_starfield( bitmap_ind16 &bitmap ); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/sidepckt.h b/src/mame/includes/sidepckt.h index 09e011f6973..ec6cb6d5229 100644 --- a/src/mame/includes/sidepckt.h +++ b/src/mame/includes/sidepckt.h @@ -29,17 +29,17 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; tilemap_t *m_bg_tilemap; - const UINT8* m_prot_table[3]; - UINT8 m_i8751_return; - UINT8 m_current_ptr; - UINT8 m_current_table; - UINT8 m_in_math; - UINT8 m_math_param; + const uint8_t* m_prot_table[3]; + uint8_t m_i8751_return; + uint8_t m_current_ptr; + uint8_t m_current_table; + uint8_t m_in_math; + uint8_t m_math_param; DECLARE_WRITE8_MEMBER(sound_cpu_command_w); DECLARE_READ8_MEMBER(i8751_r); @@ -57,6 +57,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(sidepckt); - 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); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); }; diff --git a/src/mame/includes/silkroad.h b/src/mame/includes/silkroad.h index 12fee36f2e0..24fa1f73b16 100644 --- a/src/mame/includes/silkroad.h +++ b/src/mame/includes/silkroad.h @@ -23,12 +23,12 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_generic_paletteram_32; - required_shared_ptr m_vidram; - required_shared_ptr m_vidram2; - required_shared_ptr m_vidram3; - required_shared_ptr m_sprram; - required_shared_ptr m_regs; + required_shared_ptr m_generic_paletteram_32; + required_shared_ptr m_vidram; + required_shared_ptr m_vidram2; + required_shared_ptr m_vidram3; + required_shared_ptr m_sprram; + required_shared_ptr m_regs; tilemap_t *m_fg_tilemap; tilemap_t *m_fg2_tilemap; @@ -47,6 +47,6 @@ public: virtual void video_start() override; - UINT32 screen_update_silkroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_silkroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/simpl156.h b/src/mame/includes/simpl156.h index 7fc91654160..8a85b6c117c 100644 --- a/src/mame/includes/simpl156.h +++ b/src/mame/includes/simpl156.h @@ -31,13 +31,13 @@ public: required_device m_eeprom; required_device m_okimusic; /* memory pointers */ - std::unique_ptr m_pf1_rowscroll; - std::unique_ptr m_pf2_rowscroll; - required_shared_ptr m_mainram; - required_shared_ptr m_systemram; + std::unique_ptr m_pf1_rowscroll; + std::unique_ptr m_pf2_rowscroll; + required_shared_ptr m_mainram; + required_shared_ptr m_systemram; optional_device m_sprgen; required_device m_palette; - std::unique_ptr m_spriteram; + std::unique_ptr m_spriteram; size_t m_spriteram_size; DECO16IC_BANK_CB_MEMBER(bank_callback); DECOSPR_PRIORITY_CB_MEMBER(pri_callback); @@ -63,6 +63,6 @@ public: DECLARE_DRIVER_INIT(osman); DECLARE_DRIVER_INIT(chainrec); virtual void video_start() override; - UINT32 screen_update_simpl156(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_simpl156(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(simpl156_vbl_interrupt); }; diff --git a/src/mame/includes/simple_st0016.h b/src/mame/includes/simple_st0016.h index e2f8f7bf61d..9b535c80d53 100644 --- a/src/mame/includes/simple_st0016.h +++ b/src/mame/includes/simple_st0016.h @@ -14,7 +14,7 @@ public: { } int mux_port; - // UINT32 m_st0016_rom_bank; + // uint32_t m_st0016_rom_bank; optional_device m_maincpu; DECLARE_READ8_MEMBER(mux_r); @@ -31,7 +31,7 @@ public: DECLARE_DRIVER_INIT(renju); virtual void machine_start() override; DECLARE_VIDEO_START(st0016); - UINT32 screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(st0016_int); optional_device m_subcpu; required_device m_screen; diff --git a/src/mame/includes/simpsons.h b/src/mame/includes/simpsons.h index 2762f4da138..4ac43b05977 100644 --- a/src/mame/includes/simpsons.h +++ b/src/mame/includes/simpsons.h @@ -26,7 +26,7 @@ public: m_k053251(*this, "k053251") { } /* memory pointers */ - std::unique_ptr m_spriteram; + std::unique_ptr m_spriteram; /* video-related */ int m_sprite_colorbase; @@ -56,7 +56,7 @@ public: DECLARE_WRITE8_MEMBER(simpsons_k053247_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_simpsons(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_simpsons(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(simpsons_irq); void simpsons_video_banking(int bank); void simpsons_objdma(); diff --git a/src/mame/includes/skullxbo.h b/src/mame/includes/skullxbo.h index 4cabfa061aa..489207fe3b0 100644 --- a/src/mame/includes/skullxbo.h +++ b/src/mame/includes/skullxbo.h @@ -41,7 +41,7 @@ public: DECLARE_MACHINE_START(skullxbo); DECLARE_MACHINE_RESET(skullxbo); DECLARE_VIDEO_START(skullxbo); - UINT32 screen_update_skullxbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_skullxbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(scanline_timer); void skullxbo_scanline_update(int scanline); DECLARE_WRITE16_MEMBER( skullxbo_xscroll_w ); diff --git a/src/mame/includes/skydiver.h b/src/mame/includes/skydiver.h index aeb7f0c95ad..2c7daceedc6 100644 --- a/src/mame/includes/skydiver.h +++ b/src/mame/includes/skydiver.h @@ -40,7 +40,7 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; int m_nmion; tilemap_t *m_bg_tilemap; @@ -68,7 +68,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(skydiver); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(interrupt); diff --git a/src/mame/includes/skyfox.h b/src/mame/includes/skyfox.h index 8df505646f6..807f353f71b 100644 --- a/src/mame/includes/skyfox.h +++ b/src/mame/includes/skyfox.h @@ -29,7 +29,7 @@ public: required_device m_screen; required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; int m_bg_pos; int m_bg_ctrl; @@ -40,7 +40,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_PALETTE_INIT(skyfox); - UINT32 screen_update_skyfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_skyfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(skyfox_interrupt); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/skykid.h b/src/mame/includes/skykid.h index 929298e2ea6..3f894b5696f 100644 --- a/src/mame/includes/skykid.h +++ b/src/mame/includes/skykid.h @@ -16,10 +16,10 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_inputport_selected; - required_shared_ptr m_videoram; - required_shared_ptr m_textram; - required_shared_ptr m_spriteram; + uint8_t m_inputport_selected; + required_shared_ptr m_videoram; + required_shared_ptr m_textram; + required_shared_ptr m_spriteram; required_device m_maincpu; required_device m_mcu; required_device m_cus30; @@ -27,11 +27,11 @@ public: required_device m_palette; tilemap_t *m_bg_tilemap; tilemap_t *m_tx_tilemap; - UINT8 m_priority; - UINT16 m_scroll_x; - UINT16 m_scroll_y; - UINT8 m_main_irq_mask; - UINT8 m_mcu_irq_mask; + uint8_t m_priority; + uint16_t m_scroll_x; + uint16_t m_scroll_y; + uint8_t m_main_irq_mask; + uint8_t m_mcu_irq_mask; DECLARE_WRITE8_MEMBER(inputport_select_w); DECLARE_READ8_MEMBER(inputport_r); DECLARE_WRITE8_MEMBER(skykid_led_w); @@ -54,7 +54,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(skykid); - UINT32 screen_update_skykid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_skykid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(main_vblank_irq); INTERRUPT_GEN_MEMBER(mcu_vblank_irq); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); diff --git a/src/mame/includes/skyraid.h b/src/mame/includes/skyraid.h index b4258ad37ef..eebc5827791 100644 --- a/src/mame/includes/skyraid.h +++ b/src/mame/includes/skyraid.h @@ -20,9 +20,9 @@ public: int m_scroll; - required_shared_ptr m_pos_ram; - required_shared_ptr m_alpha_num_ram; - required_shared_ptr m_obj_ram; + required_shared_ptr m_pos_ram; + required_shared_ptr m_alpha_num_ram; + required_shared_ptr m_obj_ram; required_device m_discrete; bitmap_ind16 m_helper; DECLARE_READ8_MEMBER(skyraid_port_0_r); @@ -31,7 +31,7 @@ public: DECLARE_WRITE8_MEMBER(skyraid_scroll_w); virtual void video_start() override; DECLARE_PALETTE_INIT(skyraid); - UINT32 screen_update_skyraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_skyraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(skyraid_sound_w); void draw_text(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_terrain(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/slapfght.h b/src/mame/includes/slapfght.h index f5b93dd73c6..7b2f019ac4b 100644 --- a/src/mame/includes/slapfght.h +++ b/src/mame/includes/slapfght.h @@ -37,10 +37,10 @@ public: required_device m_palette; required_device m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - optional_shared_ptr m_fixvideoram; - optional_shared_ptr m_fixcolorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + optional_shared_ptr m_fixvideoram; + optional_shared_ptr m_fixcolorram; /* This it the best way to allow game specific kludges until the system is fully understood */ enum getstar_id @@ -54,35 +54,35 @@ public: tilemap_t *m_pf1_tilemap; tilemap_t *m_fix_tilemap; - UINT8 m_palette_bank; - UINT8 m_scrollx_lo; - UINT8 m_scrollx_hi; - UINT8 m_scrolly; + uint8_t m_palette_bank; + uint8_t m_scrollx_lo; + uint8_t m_scrollx_hi; + uint8_t m_scrolly; bool m_main_irq_enabled; bool m_sound_nmi_enabled; bool m_mcu_sent; bool m_main_sent; - UINT8 m_from_main; - UINT8 m_from_mcu; - UINT8 m_portA_in; - UINT8 m_portA_out; - UINT8 m_ddrA; - UINT8 m_portB_in; - UINT8 m_portB_out; - UINT8 m_ddrB; - UINT8 m_portC_in; - UINT8 m_portC_out; - UINT8 m_ddrC; + uint8_t m_from_main; + uint8_t m_from_mcu; + uint8_t m_portA_in; + uint8_t m_portA_out; + uint8_t m_ddrA; + uint8_t m_portB_in; + uint8_t m_portB_out; + uint8_t m_ddrB; + uint8_t m_portC_in; + uint8_t m_portC_out; + uint8_t m_ddrC; int m_getstar_status; int m_getstar_sequence_index; int m_getstar_status_state; - UINT8 m_getstar_cmd; - UINT8 m_gs_a; - UINT8 m_gs_d; - UINT8 m_gs_e; - UINT8 m_tigerhb_cmd; + uint8_t m_getstar_cmd; + uint8_t m_gs_a; + uint8_t m_gs_d; + uint8_t m_gs_e; + uint8_t m_tigerhb_cmd; DECLARE_WRITE8_MEMBER(sound_reset_w); DECLARE_WRITE8_MEMBER(irq_enable_w); @@ -148,8 +148,8 @@ public: void draw_perfrman_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer); void draw_slapfight_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_perfrman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_slapfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_perfrman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_slapfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(sound_nmi); diff --git a/src/mame/includes/slapshot.h b/src/mame/includes/slapshot.h index 6a200b524ab..6488a4feea0 100644 --- a/src/mame/includes/slapshot.h +++ b/src/mame/includes/slapshot.h @@ -51,17 +51,17 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteext; - std::unique_ptr m_spriteram_buffered; - std::unique_ptr m_spriteram_delayed; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteext; + std::unique_ptr m_spriteram_buffered; + std::unique_ptr m_spriteram_delayed; /* video-related */ struct slapshot_tempsprite *m_spritelist; - INT32 m_sprites_disabled; - INT32 m_sprites_active_area; - INT32 m_sprites_master_scrollx; - INT32 m_sprites_master_scrolly; + int32_t m_sprites_disabled; + int32_t m_sprites_active_area; + int32_t m_sprites_master_scrollx; + int32_t m_sprites_master_scrolly; int m_sprites_flipscreen; int m_prepare_sprites; int m_dislayer[5]; @@ -82,7 +82,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); void screen_eof_taito_no_buffer(screen_device &screen, bool state); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int y_offset ); void taito_handle_sprite_buffering( ); diff --git a/src/mame/includes/slapstic.h b/src/mame/includes/slapstic.h index 27328fc4c04..58cae0cc752 100644 --- a/src/mame/includes/slapstic.h +++ b/src/mame/includes/slapstic.h @@ -136,7 +136,7 @@ class atari_slapstic_device : public device_t { public: // construction/destruction - atari_slapstic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + atari_slapstic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void slapstic_init(); void slapstic_reset(); @@ -160,14 +160,14 @@ public: int m_chipnum; - UINT8 state; - UINT8 current_bank; + uint8_t state; + uint8_t current_bank; int access_68k; - UINT8 alt_bank; - UINT8 bit_bank; - UINT8 add_bank; - UINT8 bit_xor; + uint8_t alt_bank; + uint8_t bit_bank; + uint8_t add_bank; + uint8_t bit_xor; struct slapstic_data slapstic; diff --git a/src/mame/includes/sms.h b/src/mame/includes/sms.h index 2d16c1f9a2c..24ad1ca07ed 100644 --- a/src/mame/includes/sms.h +++ b/src/mame/includes/sms.h @@ -85,8 +85,8 @@ public: required_memory_region m_region_maincpu; address_space *m_space; - std::unique_ptr m_mainram; - UINT8 *m_BIOS; + std::unique_ptr m_mainram; + uint8_t *m_BIOS; // for 3D glass binocular hack device_t *m_left_lcd; @@ -105,48 +105,48 @@ public: std::unique_ptr m_line_buffer; // model identifiers - UINT8 m_is_gamegear; - UINT8 m_is_smsj; - UINT8 m_is_mark_iii; - UINT8 m_is_sdisp; - UINT8 m_ioctrl_region_is_japan; - UINT8 m_has_bios_0400; - UINT8 m_has_bios_2000; - UINT8 m_has_bios_full; - UINT8 m_has_jpn_sms_cart_slot; + uint8_t m_is_gamegear; + uint8_t m_is_smsj; + uint8_t m_is_mark_iii; + uint8_t m_is_sdisp; + uint8_t m_ioctrl_region_is_japan; + uint8_t m_has_bios_0400; + uint8_t m_has_bios_2000; + uint8_t m_has_bios_full; + uint8_t m_has_jpn_sms_cart_slot; // [0] for 0x400-0x3fff, [1] for 0x4000-0x7fff, [2] for 0x8000-0xffff, [3] for 0x0000-0x0400 - UINT8 m_bios_page[4]; - - UINT8 m_bios_page_count; - UINT8 m_mapper[4]; - UINT8 m_io_ctrl_reg; - UINT8 m_mem_ctrl_reg; - UINT8 m_mem_device_enabled; - UINT8 m_smsj_audio_control; - UINT8 m_port_dc_reg; - UINT8 m_port_dd_reg; - UINT8 m_gg_sio[5]; + uint8_t m_bios_page[4]; + + uint8_t m_bios_page_count; + uint8_t m_mapper[4]; + uint8_t m_io_ctrl_reg; + uint8_t m_mem_ctrl_reg; + uint8_t m_mem_device_enabled; + uint8_t m_smsj_audio_control; + uint8_t m_port_dc_reg; + uint8_t m_port_dd_reg; + uint8_t m_gg_sio[5]; int m_paused; - UINT8 m_ctrl1_th_state; - UINT8 m_ctrl2_th_state; - UINT8 m_ctrl1_th_latch; - UINT8 m_ctrl2_th_latch; + uint8_t m_ctrl1_th_state; + uint8_t m_ctrl2_th_state; + uint8_t m_ctrl1_th_latch; + uint8_t m_ctrl2_th_latch; // Data needed for Light Phaser int m_lphaser_x_offs; /* Needed to 'calibrate' lphaser; set at cart loading */ // Data needed for SegaScope (3D glasses) - UINT8 m_sscope_state; - UINT8 m_frame_sscope_state; + uint8_t m_sscope_state; + uint8_t m_frame_sscope_state; // Data needed for Rapid button (smsj, sms1kr, sms1krfm) - UINT16 m_csync_counter; - UINT8 m_rapid_mode; - UINT8 m_rapid_read_state; - UINT8 m_rapid_last_dc; - UINT8 m_rapid_last_dd; + uint16_t m_csync_counter; + uint8_t m_rapid_mode; + uint8_t m_rapid_read_state; + uint8_t m_rapid_last_dc; + uint8_t m_rapid_last_dd; // slot devices sega8_cart_slot_device *m_cartslot; @@ -157,10 +157,10 @@ public: // these are only used by the Store Display unit, but we keep them here temporarily to avoid the need of separate start/reset sega8_cart_slot_device *m_slots[16]; sega8_card_slot_device *m_cards[16]; - UINT8 m_store_control; - UINT8 m_store_cart_selection_data; + uint8_t m_store_control; + uint8_t m_store_cart_selection_data; void store_post_load(); - void store_select_cart(UINT8 data); + void store_select_cart(uint8_t data); DECLARE_READ8_MEMBER(read_0000); DECLARE_READ8_MEMBER(read_4000); @@ -214,14 +214,14 @@ public: DECLARE_VIDEO_START(sms1); DECLARE_VIDEO_RESET(sms1); - UINT32 screen_update_sms(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sms1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gamegear(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sms(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sms1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gamegear(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_vblank_sms1(screen_device &screen, bool state); protected: - UINT8 read_bus(address_space &space, unsigned int bank, UINT16 base_addr, UINT16 offset); + uint8_t read_bus(address_space &space, unsigned int bank, uint16_t base_addr, uint16_t offset); void setup_bios(); void setup_media_slots(); void setup_enabled_slots(); diff --git a/src/mame/includes/snes.h b/src/mame/includes/snes.h index c25379a4537..6bd8c95872a 100644 --- a/src/mame/includes/snes.h +++ b/src/mame/includes/snes.h @@ -284,14 +284,14 @@ struct snes_cart_info { - UINT8 *m_rom; - UINT32 m_rom_size; - std::unique_ptr m_nvram; - UINT32 m_nvram_size; - UINT8 mode; /* ROM memory mode */ - UINT32 sram_max; /* Maximum amount sram in cart (based on ROM mode) */ + uint8_t *m_rom; + uint32_t m_rom_size; + std::unique_ptr m_nvram; + uint32_t m_nvram_size; + uint8_t mode; /* ROM memory mode */ + uint32_t sram_max; /* Maximum amount sram in cart (based on ROM mode) */ int slot_in_use; /* this is needed by Sufami Turbo slots (to check if SRAM has to be saved) */ - UINT8 rom_bank_map[0x100]; + uint8_t rom_bank_map[0x100]; }; class snes_state : public driver_device @@ -318,18 +318,18 @@ public: m_screen(*this, "screen") { } /* misc */ - UINT16 m_hblank_offset; - UINT32 m_wram_address; - UINT16 m_htime; - UINT16 m_vtime; + uint16_t m_hblank_offset; + uint32_t m_wram_address; + uint16_t m_htime; + uint16_t m_vtime; bool m_is_pal; /* non-SNES HW-specific flags / variables */ - UINT8 m_is_nss; - UINT8 m_input_disabled; - UINT8 m_game_over_flag; - UINT8 m_joy_flag; - UINT8 m_is_sfcbox; + uint8_t m_is_nss; + uint8_t m_input_disabled; + uint8_t m_game_over_flag; + uint8_t m_joy_flag; + uint8_t m_is_sfcbox; /* timers */ emu_timer *m_scanline_timer; @@ -343,36 +343,36 @@ public: /* DMA/HDMA-related */ struct { - UINT8 dmap; - UINT8 dest_addr; - UINT16 src_addr; - UINT16 trans_size; - UINT8 bank; - UINT8 ibank; - UINT16 hdma_addr; - UINT16 hdma_iaddr; - UINT8 hdma_line_counter; - UINT8 unk; + uint8_t dmap; + uint8_t dest_addr; + uint16_t src_addr; + uint16_t trans_size; + uint8_t bank; + uint8_t ibank; + uint16_t hdma_addr; + uint16_t hdma_iaddr; + uint8_t hdma_line_counter; + uint8_t unk; int do_transfer; int dma_disabled; // used to stop DMA if HDMA is enabled (currently not implemented, see machine/snes.c) } m_dma_channel[8]; - UINT8 m_hdmaen; /* channels enabled for HDMA */ - UINT8 m_dma_regs[0x80]; - UINT8 m_cpu_regs[0x20]; - UINT8 m_oldjoy1_latch; + uint8_t m_hdmaen; /* channels enabled for HDMA */ + uint8_t m_dma_regs[0x80]; + uint8_t m_cpu_regs[0x20]; + uint8_t m_oldjoy1_latch; /* input-related */ - UINT16 m_data1[4]; // JOY1/JOY2 + 3rd & 4th only used by multitap (hacky support) - UINT16 m_data2[4]; // JOY3/JOY4 + 3rd & 4th only used by multitap (hacky support) - UINT8 m_read_idx[4]; // 3rd & 4th only used by multitap (hacky support) + uint16_t m_data1[4]; // JOY1/JOY2 + 3rd & 4th only used by multitap (hacky support) + uint16_t m_data2[4]; // JOY3/JOY4 + 3rd & 4th only used by multitap (hacky support) + uint8_t m_read_idx[4]; // 3rd & 4th only used by multitap (hacky support) /* cart related */ snes_cart_info m_cart; // used by NSS/SFCBox only! to be moved in a derived class! - void rom_map_setup(UINT32 size); + void rom_map_setup(uint32_t size); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); /* devices */ required_device<_5a22_device> m_maincpu; @@ -387,27 +387,27 @@ public: DECLARE_DRIVER_INIT(snes_mess); DECLARE_DRIVER_INIT(snesst); - inline int dma_abus_valid(UINT32 address); - inline UINT8 abus_read(address_space &space, UINT32 abus); - inline void dma_transfer(address_space &space, UINT8 dma, UINT32 abus, UINT16 bbus); + inline int dma_abus_valid(uint32_t address); + inline uint8_t abus_read(address_space &space, uint32_t abus); + inline void dma_transfer(address_space &space, uint8_t dma, uint32_t abus, uint16_t bbus); inline int is_last_active_channel(int dma); - inline UINT32 get_hdma_addr(int dma); - inline UINT32 get_hdma_iaddr(int dma); - void dma(address_space &space, UINT8 channels); + inline uint32_t get_hdma_addr(int dma); + inline uint32_t get_hdma_iaddr(int dma); + void dma(address_space &space, uint8_t channels); void hdma(address_space &space); void hdma_init(address_space &space); void hdma_update(address_space &space, int dma); void hirq_tick(); - virtual void write_joy_latch(UINT8 data); - virtual void wrio_write(UINT8 data); - inline UINT8 snes_rom_access(UINT32 offset); + virtual void write_joy_latch(uint8_t data); + virtual void wrio_write(uint8_t data); + inline uint8_t snes_rom_access(uint32_t offset); void snes_init_ram(); // input related virtual DECLARE_WRITE8_MEMBER(io_read); - virtual UINT8 oldjoy1_read(int latched); - virtual UINT8 oldjoy2_read(int latched); + virtual uint8_t oldjoy1_read(int latched); + virtual uint8_t oldjoy2_read(int latched); DECLARE_READ8_MEMBER(snes_r_io); DECLARE_WRITE8_MEMBER(snes_w_io); diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h index 1810707bf33..4d358f2e52e 100644 --- a/src/mame/includes/snk.h +++ b/src/mame/includes/snk.h @@ -35,10 +35,10 @@ public: required_device m_palette; optional_device m_soundlatch; - required_shared_ptr m_spriteram; - optional_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_tx_videoram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_tx_videoram; int m_countryc_trackball; int m_last_value[2]; @@ -59,15 +59,15 @@ public: int m_sp16_scrolly; int m_sp32_scrollx; int m_sp32_scrolly; - UINT8 m_sprite_split_point; + uint8_t m_sprite_split_point; int m_num_sprites; int m_yscroll_mask; - UINT32 m_bg_tile_offset; - UINT32 m_tx_tile_offset; + uint32_t m_bg_tile_offset; + uint32_t m_tx_tile_offset; int m_is_psychos; - UINT8 m_drawmode_table[16]; - UINT8 m_empty_tile[16*16]; + uint8_t m_drawmode_table[16]; + uint8_t m_empty_tile[16*16]; int m_hf_posy; int m_hf_posx; int m_tc16_posy; @@ -185,19 +185,19 @@ public: DECLARE_VIDEO_START(psychos); DECLARE_VIDEO_START(snk_3bpp_shadow); DECLARE_VIDEO_START(snk_4bpp_shadow); - UINT32 screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tnk3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_fitegolf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tnk3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fitegolf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(sgladiat_sndirq_update_callback); TIMER_CALLBACK_MEMBER(sndirq_update_callback); DECLARE_WRITE_LINE_MEMBER(ymirq_callback_2); void marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to); void tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll); - void ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum ); - void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to); + void ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum ); + void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum, const int hw_xflip, const int from, const int to); int hardflags_check(int num); int hardflags_check8(int num); int turbofront_check(int small, int num); diff --git a/src/mame/includes/snk6502.h b/src/mame/includes/snk6502.h index 2c66853510d..955a5b4902d 100644 --- a/src/mame/includes/snk6502.h +++ b/src/mame/includes/snk6502.h @@ -31,18 +31,18 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram; - required_shared_ptr m_charram; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram; + required_shared_ptr m_charram; - UINT8 m_sasuke_counter; + uint8_t m_sasuke_counter; int m_charbank; int m_backcolor; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; rgb_t m_palette_val[64]; - UINT8 m_irq_mask; + uint8_t m_irq_mask; // common DECLARE_WRITE8_MEMBER(videoram_w); @@ -76,7 +76,7 @@ public: DECLARE_MACHINE_RESET(pballoon); DECLARE_VIDEO_START(pballoon); - 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); INTERRUPT_GEN_MEMBER(satansat_interrupt); INTERRUPT_GEN_MEMBER(snk6502_interrupt); @@ -97,17 +97,17 @@ struct TONE int offset; int base; int mask; - INT32 sample_rate; - INT32 sample_step; - INT32 sample_cur; - INT16 form[16]; + int32_t sample_rate; + int32_t sample_step; + int32_t sample_cur; + int16_t form[16]; }; class snk6502_sound_device : public device_t, public device_sound_interface { public: - snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~snk6502_sound_device() {} DECLARE_WRITE8_MEMBER( sasuke_sound_w ); @@ -131,17 +131,17 @@ protected: private: // internal state TONE m_tone_channels[CHANNELS]; - INT32 m_tone_clock_expire; - INT32 m_tone_clock; + int32_t m_tone_clock_expire; + int32_t m_tone_clock; sound_stream * m_tone_stream; optional_device m_samples; - UINT8 *m_ROM; + uint8_t *m_ROM; int m_Sound0StopOnRollover; - UINT8 m_LastPort1; + uint8_t m_LastPort1; int m_hd38880_cmd; - UINT32 m_hd38880_addr; + uint32_t m_hd38880_addr; int m_hd38880_data_bytes; double m_hd38880_speed; @@ -149,7 +149,7 @@ private: void sasuke_build_waveform(int mask); void satansat_build_waveform(int mask); void build_waveform(int channel, int mask); - void speech_w(UINT8 data, const UINT16 *table, int start); + void speech_w(uint8_t data, const uint16_t *table, int start); }; extern const device_type SNK6502; diff --git a/src/mame/includes/snk68.h b/src/mame/includes/snk68.h index e79febfe760..4d87fd0e0ef 100644 --- a/src/mame/includes/snk68.h +++ b/src/mame/includes/snk68.h @@ -29,13 +29,13 @@ public: required_device m_sprites; required_device m_soundlatch; - required_shared_ptr m_pow_fg_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_pow_fg_videoram; + required_shared_ptr m_spriteram; - UINT8 m_invert_controls; + uint8_t m_invert_controls; bool m_sprite_flip_axis; tilemap_t *m_fg_tilemap; - UINT32 m_fg_tile_offset; + uint32_t m_fg_tile_offset; // common DECLARE_WRITE16_MEMBER(sound_w); @@ -65,7 +65,7 @@ public: DECLARE_VIDEO_START(searchar); void common_video_start(); - 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); void tile_callback_pow(int &tile, int& fx, int& fy, int& region); void tile_callback_notpow(int &tile, int& fx, int& fy, int& region); diff --git a/src/mame/includes/snookr10.h b/src/mame/includes/snookr10.h index b15623e61d0..7cfc83df454 100644 --- a/src/mame/includes/snookr10.h +++ b/src/mame/includes/snookr10.h @@ -18,8 +18,8 @@ public: int m_bit3; int m_bit4; int m_bit5; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; DECLARE_READ8_MEMBER(dsw_port_1_r); DECLARE_READ8_MEMBER(port2000_8_r); @@ -36,7 +36,7 @@ public: DECLARE_VIDEO_START(crystalc); DECLARE_PALETTE_INIT(apple10); DECLARE_PALETTE_INIT(crystalc); - UINT32 screen_update_snookr10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_snookr10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; }; diff --git a/src/mame/includes/snowbros.h b/src/mame/includes/snowbros.h index cc9b26a9109..c5b7f7efff3 100644 --- a/src/mame/includes/snowbros.h +++ b/src/mame/includes/snowbros.h @@ -29,12 +29,12 @@ public: optional_device m_soundlatch; // not snowbro3 optional_device m_pandora; - optional_shared_ptr m_hyperpac_ram; - optional_shared_ptr m_bootleg_spriteram16; + optional_shared_ptr m_hyperpac_ram; + optional_shared_ptr m_bootleg_spriteram16; int m_sb3_music_is_playing; int m_sb3_music; - UINT8 m_semicom_prot_offset; + uint8_t m_semicom_prot_offset; DECLARE_WRITE16_MEMBER(snowbros_flipscreen_w); DECLARE_WRITE16_MEMBER(snowbros_irq4_ack_w); @@ -66,11 +66,11 @@ public: DECLARE_MACHINE_RESET(semiprot); DECLARE_MACHINE_RESET(finalttr); - UINT32 screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_honeydol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_twinadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_snowbro3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_wintbob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_honeydol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_twinadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_snowbro3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wintbob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_snowbros(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(snowbros_irq); diff --git a/src/mame/includes/solomon.h b/src/mame/includes/solomon.h index 0e2edd9983b..a7cc9b06ba8 100644 --- a/src/mame/includes/solomon.h +++ b/src/mame/includes/solomon.h @@ -19,16 +19,16 @@ public: m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram2; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram2; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(solomon_sh_command_w); DECLARE_READ8_MEMBER(solomon_0xe603_r); DECLARE_WRITE8_MEMBER(nmi_mask_w); @@ -40,7 +40,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); virtual void video_start() override; - UINT32 screen_update_solomon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_solomon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; diff --git a/src/mame/includes/sonson.h b/src/mame/includes/sonson.h index 343ae432944..e63d705938d 100644 --- a/src/mame/includes/sonson.h +++ b/src/mame/includes/sonson.h @@ -20,9 +20,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t *m_bg_tilemap; @@ -44,7 +44,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(sonson); - UINT32 screen_update_sonson(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sonson(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); required_device m_maincpu; required_device m_gfxdecode; diff --git a/src/mame/includes/sorcerer.h b/src/mame/includes/sorcerer.h index 1c463a966ac..825bc18802e 100644 --- a/src/mame/includes/sorcerer.h +++ b/src/mame/includes/sorcerer.h @@ -83,11 +83,11 @@ public: TIMER_CALLBACK_MEMBER(sorcerer_reset); DECLARE_SNAPSHOT_LOAD_MEMBER( sorcerer ); DECLARE_QUICKLOAD_LOAD_MEMBER( sorcerer); - 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); private: - UINT8 m_fe; - UINT8 m_keyboard_line; - const UINT8 *m_p_videoram; + uint8_t m_fe; + uint8_t m_keyboard_line; + const uint8_t *m_p_videoram; emu_timer *m_serial_timer; emu_timer *m_cassette_timer; cass_data_t m_cass_data; diff --git a/src/mame/includes/spacefb.h b/src/mame/includes/spacefb.h index 4bd39f33338..68bc3255dce 100644 --- a/src/mame/includes/spacefb.h +++ b/src/mame/includes/spacefb.h @@ -42,14 +42,14 @@ public: required_device m_samples; required_device m_screen; - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; - UINT8 m_sound_latch; + uint8_t m_sound_latch; emu_timer *m_interrupt_timer; - std::unique_ptr m_object_present_map; - UINT8 m_port_0; - UINT8 m_port_2; - UINT32 m_star_shift_reg; + std::unique_ptr m_object_present_map; + uint8_t m_port_0; + uint8_t m_port_2; + uint32_t m_star_shift_reg; double m_color_weights_rg[3]; double m_color_weights_b[2]; @@ -67,7 +67,7 @@ public: TIMER_CALLBACK_MEMBER(interrupt_callback); void start_interrupt_timer(); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); inline void shift_star_generator(); void get_starfield_pens(pen_t *pens); void draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/spbactn.h b/src/mame/includes/spbactn.h index ded656e40b9..8f259e48279 100644 --- a/src/mame/includes/spbactn.h +++ b/src/mame/includes/spbactn.h @@ -34,11 +34,11 @@ public: required_device m_mixer; required_device m_soundlatch; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_spvideoram; - optional_shared_ptr m_extraram; - optional_shared_ptr m_extraram2; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_spvideoram; + optional_shared_ptr m_extraram; + optional_shared_ptr m_extraram2; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -76,8 +76,8 @@ public: //virtual void video_start(); - UINT32 screen_update_spbactn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spbactn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spbactnp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); int draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites); // temp hack diff --git a/src/mame/includes/spcforce.h b/src/mame/includes/spcforce.h index fc572a6dbfa..f74a480d4c1 100644 --- a/src/mame/includes/spcforce.h +++ b/src/mame/includes/spcforce.h @@ -26,16 +26,16 @@ public: required_device m_sn2; required_device m_sn3; - required_shared_ptr m_scrollram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_scrollram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; int m_sn76496_latch; int m_sn76496_select; int m_sn1_ready; int m_sn2_ready; int m_sn3_ready; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(SN76496_latch_w); DECLARE_READ8_MEMBER(SN76496_select_r); @@ -51,7 +51,7 @@ public: virtual void machine_start() override; DECLARE_PALETTE_INIT(spcforce); - 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); INTERRUPT_GEN_MEMBER(vblank_irq); }; diff --git a/src/mame/includes/spdodgeb.h b/src/mame/includes/spdodgeb.h index 5fd53a68353..5fcc53a4d33 100644 --- a/src/mame/includes/spdodgeb.h +++ b/src/mame/includes/spdodgeb.h @@ -34,8 +34,8 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; int m_toggle; int m_adpcm_pos[2]; @@ -44,9 +44,9 @@ public: int m_adpcm_data[2]; int m_mcu63701_command; int m_inputs[4]; - UINT8 m_tapc[4]; - UINT8 m_last_port[2]; - UINT8 m_last_dash[2]; + uint8_t m_tapc[4]; + uint8_t m_last_port[2]; + uint8_t m_last_dash[2]; #if 0 int m_running[2]; int m_jumped[2]; @@ -78,7 +78,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(spdodgeb); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); diff --git a/src/mame/includes/special.h b/src/mame/includes/special.h index b3fb51a421e..aa2808959d3 100644 --- a/src/mame/includes/special.h +++ b/src/mame/includes/special.h @@ -84,18 +84,18 @@ public: DECLARE_WRITE8_MEMBER(specialist_8255_porta_w); DECLARE_WRITE8_MEMBER(specialist_8255_portb_w); DECLARE_WRITE8_MEMBER(specialist_8255_portc_w); - void specimx_set_bank(offs_t i, UINT8 data); + void specimx_set_bank(offs_t i, uint8_t data); void erik_set_bank(); - std::unique_ptr m_specimx_colorram; - UINT8 m_erik_color_1; - UINT8 m_erik_color_2; - UINT8 m_erik_background; - UINT8 m_specimx_color; + std::unique_ptr m_specimx_colorram; + uint8_t m_erik_color_1; + uint8_t m_erik_color_2; + uint8_t m_erik_background; + uint8_t m_specimx_color; int m_specialist_8255_porta; int m_specialist_8255_portb; int m_specialist_8255_portc; - UINT8 m_RR_register; - UINT8 m_RC_register; + uint8_t m_RR_register; + uint8_t m_RC_register; required_device m_maincpu; optional_device m_ppi; optional_device m_fdc; @@ -103,7 +103,7 @@ public: optional_device m_pit; optional_device m_cassette; optional_device m_ram; - optional_shared_ptr m_p_videoram; + optional_shared_ptr m_p_videoram; int m_drive; DECLARE_DRIVER_INIT(erik); DECLARE_DRIVER_INIT(special); @@ -117,10 +117,10 @@ public: DECLARE_MACHINE_RESET(specimx); DECLARE_VIDEO_START(specimx); DECLARE_PALETTE_INIT(specimx); - UINT32 screen_update_special(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_erik(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_specialp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_specimx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_special(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_erik(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_specialp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_specimx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(fdc_drq); DECLARE_FLOPPY_FORMATS( specimx_floppy_formats ); diff --git a/src/mame/includes/spectrum.h b/src/mame/includes/spectrum.h index 38baeea3a5b..8b8bd9ce059 100644 --- a/src/mame/includes/spectrum.h +++ b/src/mame/includes/spectrum.h @@ -103,8 +103,8 @@ public: int m_frame_invert_count; int m_frame_number; /* Used for handling FLASH 1 */ int m_flash_invert; - optional_shared_ptr m_video_ram; - UINT8 *m_screen_location; + optional_shared_ptr m_video_ram; + uint8_t *m_screen_location; int m_ROMSelection; @@ -116,8 +116,8 @@ public: int m_LastFrameStartTime; int m_CyclesPerFrame; - UINT8 *m_ram_0000; - UINT8 m_ram_disabled_by_beta; + uint8_t *m_ram_0000; + uint8_t m_ram_disabled_by_beta; DECLARE_WRITE8_MEMBER(spectrum_port_fe_w); DECLARE_READ8_MEMBER(spectrum_port_fe_r); DECLARE_READ8_MEMBER(spectrum_port_1f_r); @@ -152,9 +152,9 @@ public: DECLARE_MACHINE_RESET(spectrum_plus3); DECLARE_MACHINE_RESET(ts2068); DECLARE_VIDEO_START(ts2068); - UINT32 screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tc2048(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ts2068(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tc2048(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ts2068(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_spectrum(screen_device &screen, bool state); void screen_eof_timex(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(spec_interrupt); @@ -215,7 +215,7 @@ protected: void spectrum_UpdateBorderBitmap(); void spectrum_UpdateScreenBitmap(bool eof = false); inline unsigned char get_display_color(unsigned char color, int invert); - inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color); + inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color); void ts2068_hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines); void ts2068_64col_scanline(bitmap_ind16 &bitmap, int y, int borderlines, unsigned short inkcolor); void ts2068_lores_scanline(bitmap_ind16 &bitmap, int y, int borderlines, int screen); diff --git a/src/mame/includes/speedatk.h b/src/mame/includes/speedatk.h index d0ed37db6da..7882fa1e7b9 100644 --- a/src/mame/includes/speedatk.h +++ b/src/mame/includes/speedatk.h @@ -19,16 +19,16 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; - UINT8 m_crtc_vreg[0x100]; - UINT8 m_crtc_index; - UINT8 m_flip_scr; - UINT8 m_mux_data; - UINT8 m_km_status; - UINT8 m_coin_settings; - UINT8 m_coin_impulse; + uint8_t m_crtc_vreg[0x100]; + uint8_t m_crtc_index; + uint8_t m_flip_scr; + uint8_t m_mux_data; + uint8_t m_km_status; + uint8_t m_coin_settings; + uint8_t m_coin_impulse; DECLARE_READ8_MEMBER(key_matrix_r); DECLARE_WRITE8_MEMBER(key_matrix_w); @@ -41,7 +41,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(speedatk); - 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); - UINT8 iox_key_matrix_calc(UINT8 p_side); + uint8_t iox_key_matrix_calc(uint8_t p_side); }; diff --git a/src/mame/includes/speedbal.h b/src/mame/includes/speedbal.h index c6cc7e5e4f9..089bbfd6288 100644 --- a/src/mame/includes/speedbal.h +++ b/src/mame/includes/speedbal.h @@ -17,12 +17,12 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_background_videoram; - required_shared_ptr m_foreground_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_background_videoram; + required_shared_ptr m_foreground_videoram; bool m_leds_start; - UINT32 m_leds_shiftreg; + uint32_t m_leds_shiftreg; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -42,6 +42,6 @@ public: TILE_GET_INFO_MEMBER(get_tile_info_bg); TILE_GET_INFO_MEMBER(get_tile_info_fg); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/speedspn.h b/src/mame/includes/speedspn.h index 19f3f8bd1ae..f829ff4095b 100644 --- a/src/mame/includes/speedspn.h +++ b/src/mame/includes/speedspn.h @@ -28,12 +28,12 @@ public: required_memory_bank m_prgbank; required_memory_bank m_okibank; - required_shared_ptr m_attram; + required_shared_ptr m_attram; tilemap_t *m_tilemap; bool m_display_disable; - UINT32 m_bank_vidram; - std::vector m_vidram; + uint32_t m_bank_vidram; + std::vector m_vidram; DECLARE_READ8_MEMBER(irq_ack_r); DECLARE_WRITE8_MEMBER(rombank_w); DECLARE_WRITE8_MEMBER(sound_w); @@ -46,6 +46,6 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); virtual void machine_start() override; virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/spiders.h b/src/mame/includes/spiders.h index 6c49f6ceeba..e6f188aa64d 100644 --- a/src/mame/includes/spiders.h +++ b/src/mame/includes/spiders.h @@ -19,13 +19,13 @@ public: m_palette(*this, "palette"), m_audiocpu(*this, "audiocpu") { } - required_shared_ptr m_ram; + required_shared_ptr m_ram; required_device m_discrete; - UINT8 m_flipscreen; - UINT16 m_gfx_rom_address; - UINT8 m_gfx_rom_ctrl_mode; - UINT8 m_gfx_rom_ctrl_latch; - UINT8 m_gfx_rom_ctrl_data; + uint8_t m_flipscreen; + uint16_t m_gfx_rom_address; + uint8_t m_gfx_rom_ctrl_mode; + uint8_t m_gfx_rom_ctrl_latch; + uint8_t m_gfx_rom_ctrl_data; DECLARE_WRITE_LINE_MEMBER(main_cpu_irq); DECLARE_WRITE_LINE_MEMBER(flipscreen_w); diff --git a/src/mame/includes/splash.h b/src/mame/includes/splash.h index 60da6faa8a8..662c51e1aca 100644 --- a/src/mame/includes/splash.h +++ b/src/mame/includes/splash.h @@ -38,12 +38,12 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_pixelram; - required_shared_ptr m_videoram; - required_shared_ptr m_vregs; - required_shared_ptr m_spriteram; - optional_shared_ptr m_protdata; - optional_shared_ptr m_bitmap_mode; + required_shared_ptr m_pixelram; + required_shared_ptr m_videoram; + required_shared_ptr m_vregs; + required_shared_ptr m_spriteram; + optional_shared_ptr m_protdata; + optional_shared_ptr m_bitmap_mode; // driver init configuration int m_bitmap_type; @@ -60,9 +60,9 @@ public: int m_sound_irq; // funystrp specific - UINT8 m_funystrp_val; - UINT8 m_funystrp_ff3cc7_val; - UINT8 m_funystrp_ff3cc8_val; + uint8_t m_funystrp_val; + uint8_t m_funystrp_ff3cc7_val; + uint8_t m_funystrp_ff3cc8_val; int m_msm_data1; int m_msm_data2; int m_msm_toggle1; @@ -119,8 +119,8 @@ public: TILE_GET_INFO_MEMBER(get_tile_info_tilemap0); TILE_GET_INFO_MEMBER(get_tile_info_tilemap1); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_funystrp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_funystrp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void funystrp_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); diff --git a/src/mame/includes/sprint2.h b/src/mame/includes/sprint2.h index 181d374a82b..83e4634643b 100644 --- a/src/mame/includes/sprint2.h +++ b/src/mame/includes/sprint2.h @@ -41,8 +41,8 @@ public: int m_steering[2]; int m_gear[2]; int m_game; - UINT8 m_dial[2]; - required_shared_ptr m_video_ram; + uint8_t m_dial[2]; + required_shared_ptr m_video_ram; tilemap_t* m_bg_tilemap; bitmap_ind16 m_helper; int m_collision[2]; @@ -76,13 +76,13 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(sprint2); - UINT32 screen_update_sprint2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sprint2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_sprint2(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(sprint2); - UINT8 collision_check(rectangle& rect); - inline int get_sprite_code(UINT8 *video_ram, int n); - inline int get_sprite_x(UINT8 *video_ram, int n); - inline int get_sprite_y(UINT8 *video_ram, int n); + uint8_t collision_check(rectangle& rect); + inline int get_sprite_code(uint8_t *video_ram, int n); + inline int get_sprite_x(uint8_t *video_ram, int n); + inline int get_sprite_y(uint8_t *video_ram, int n); int service_mode(); required_device m_maincpu; required_device m_watchdog; diff --git a/src/mame/includes/sprint4.h b/src/mame/includes/sprint4.h index d020d1f2aff..a7e725e474c 100644 --- a/src/mame/includes/sprint4.h +++ b/src/mame/includes/sprint4.h @@ -21,12 +21,12 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; int m_da_latch; int m_steer_FF1[4]; int m_steer_FF2[4]; int m_gear[4]; - UINT8 m_last_wheel[4]; + uint8_t m_last_wheel[4]; int m_collision[4]; tilemap_t* m_playfield; bitmap_ind16 m_helper; @@ -53,7 +53,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(sprint4); - UINT32 screen_update_sprint4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sprint4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_sprint4(screen_device &screen, bool state); TIMER_CALLBACK_MEMBER(nmi_callback); required_device m_maincpu; diff --git a/src/mame/includes/sprint8.h b/src/mame/includes/sprint8.h index 4db1fca0fa2..d70052f6200 100644 --- a/src/mame/includes/sprint8.h +++ b/src/mame/includes/sprint8.h @@ -22,12 +22,12 @@ public: int m_steer_flag[8]; int m_collision_reset; int m_collision_index; - UINT8 m_dial[8]; - required_shared_ptr m_video_ram; - required_shared_ptr m_pos_h_ram; - required_shared_ptr m_pos_v_ram; - required_shared_ptr m_pos_d_ram; - required_shared_ptr m_team; + uint8_t m_dial[8]; + required_shared_ptr m_video_ram; + required_shared_ptr m_pos_h_ram; + required_shared_ptr m_pos_v_ram; + required_shared_ptr m_pos_d_ram; + required_shared_ptr m_team; required_device m_discrete; tilemap_t* m_tilemap1; tilemap_t* m_tilemap2; @@ -43,7 +43,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(sprint8); - UINT32 screen_update_sprint8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sprint8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_sprint8(screen_device &screen, bool state); TIMER_CALLBACK_MEMBER(sprint8_collision_callback); TIMER_DEVICE_CALLBACK_MEMBER(input_callback); diff --git a/src/mame/includes/spy.h b/src/mame/includes/spy.h index a77b8669af6..6c919f6b77e 100644 --- a/src/mame/includes/spy.h +++ b/src/mame/includes/spy.h @@ -25,9 +25,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_ram; - UINT8 m_pmcram[0x800]; - std::vector m_paletteram; + required_shared_ptr m_ram; + uint8_t m_pmcram[0x800]; + std::vector m_paletteram; /* misc */ int m_rambank; @@ -53,7 +53,7 @@ public: DECLARE_WRITE8_MEMBER(k052109_051960_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_spy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(spy_interrupt); void spy_collision( ); DECLARE_WRITE8_MEMBER(volume_callback0); diff --git a/src/mame/includes/srmp2.h b/src/mame/includes/srmp2.h index d0cab87ce67..f05170a6c39 100644 --- a/src/mame/includes/srmp2.h +++ b/src/mame/includes/srmp2.h @@ -6,9 +6,9 @@ struct iox_t { int reset,ff_event,ff_1,protcheck[4],protlatch[4]; - UINT8 data; - UINT8 mux; - UINT8 ff; + uint8_t data; + uint8_t mux; + uint8_t ff; }; class srmp2_state : public driver_device @@ -28,8 +28,8 @@ public: int m_gfx_bank; int m_adpcm_bank; int m_adpcm_data; - UINT32 m_adpcm_sptr; - UINT32 m_adpcm_eptr; + uint32_t m_adpcm_sptr; + uint32_t m_adpcm_eptr; iox_t m_iox; // common @@ -69,10 +69,10 @@ public: DECLARE_MACHINE_START(rmgoldyh); DECLARE_MACHINE_START(mjyuugi); - UINT32 screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); SETA001_SPRITE_GFXBANK_CB_MEMBER(srmp3_gfxbank_callback); - UINT8 iox_key_matrix_calc(UINT8 p_side); + uint8_t iox_key_matrix_calc(uint8_t p_side); }; diff --git a/src/mame/includes/srumbler.h b/src/mame/includes/srumbler.h index 0e6b320fcfc..43728d45292 100644 --- a/src/mame/includes/srumbler.h +++ b/src/mame/includes/srumbler.h @@ -19,8 +19,8 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_backgroundram; - required_shared_ptr m_foregroundram; + required_shared_ptr m_backgroundram; + required_shared_ptr m_foregroundram; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -38,7 +38,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); diff --git a/src/mame/includes/sshangha.h b/src/mame/includes/sshangha.h index 768f5c0fd5f..9bc1ca6f3ae 100644 --- a/src/mame/includes/sshangha.h +++ b/src/mame/includes/sshangha.h @@ -29,19 +29,19 @@ public: optional_device m_deco146; required_device m_deco_tilegen1; - required_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram2; - required_shared_ptr m_sound_shared_ram; - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_sound_shared_ram; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; - required_shared_ptr m_sprite_paletteram; - required_shared_ptr m_tile_paletteram2; - required_shared_ptr m_sprite_paletteram2; - required_shared_ptr m_tile_paletteram1; + required_shared_ptr m_sprite_paletteram; + required_shared_ptr m_tile_paletteram2; + required_shared_ptr m_sprite_paletteram2; + required_shared_ptr m_tile_paletteram1; - optional_shared_ptr m_prot_data; + optional_shared_ptr m_prot_data; optional_device m_sprgen1; optional_device m_sprgen2; @@ -67,8 +67,8 @@ public: DECLARE_DRIVER_INIT(sshangha); virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_sshangha(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - inline void sshangha_set_color_888(pen_t color, int rshift, int gshift, int bshift, UINT32 data); + uint32_t screen_update_sshangha(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + inline void sshangha_set_color_888(pen_t color, int rshift, int gshift, int bshift, uint32_t data); required_device m_maincpu; required_device m_audiocpu; required_device m_palette; diff --git a/src/mame/includes/sslam.h b/src/mame/includes/sslam.h index ba28d2227c1..adf63c4d2e2 100644 --- a/src/mame/includes/sslam.h +++ b/src/mame/includes/sslam.h @@ -29,11 +29,11 @@ public: required_device m_palette; optional_device m_soundlatch; - required_shared_ptr m_bg_tileram; - optional_shared_ptr m_md_tileram; - optional_shared_ptr m_tx_tileram; - required_shared_ptr m_regs; - required_shared_ptr m_spriteram; + required_shared_ptr m_bg_tileram; + optional_shared_ptr m_md_tileram; + optional_shared_ptr m_tx_tileram; + required_shared_ptr m_regs; + required_shared_ptr m_spriteram; emu_timer *m_music_timer; @@ -43,9 +43,9 @@ public: int m_track; int m_snd_bank; - UINT8 m_oki_control; - UINT8 m_oki_command; - UINT8 m_oki_bank; + uint8_t m_oki_control; + uint8_t m_oki_command; + uint8_t m_oki_bank; tilemap_t *m_bg_tilemap; tilemap_t *m_tx_tilemap; @@ -69,8 +69,8 @@ public: TILE_GET_INFO_MEMBER(get_powerbls_bg_tile_info); DECLARE_VIDEO_START(sslam); DECLARE_VIDEO_START(powerbls); - UINT32 screen_update_sslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_powerbls(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_powerbls(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(music_playback); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void sslam_play(int track, int data); diff --git a/src/mame/includes/ssozumo.h b/src/mame/includes/ssozumo.h index 86b61f8f2df..759698d84a3 100644 --- a/src/mame/includes/ssozumo.h +++ b/src/mame/includes/ssozumo.h @@ -26,16 +26,16 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_spriteram; - required_shared_ptr m_paletteram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram2; + required_shared_ptr m_spriteram; + required_shared_ptr m_paletteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram2; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_sound_nmi_mask; + uint8_t m_sound_nmi_mask; DECLARE_WRITE8_MEMBER(sh_command_w); DECLARE_WRITE8_MEMBER(sound_nmi_mask_w); @@ -58,6 +58,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(ssozumo); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/sspeedr.h b/src/mame/includes/sspeedr.h index 54978416da1..af08e28c3fe 100644 --- a/src/mame/includes/sspeedr.h +++ b/src/mame/includes/sspeedr.h @@ -9,8 +9,8 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_led_TIME[2]; - UINT8 m_led_SCORE[24]; + uint8_t m_led_TIME[2]; + uint8_t m_led_SCORE[24]; int m_toggle; unsigned m_driver_horz; unsigned m_driver_vert; @@ -40,7 +40,7 @@ public: DECLARE_WRITE8_MEMBER(sspeedr_track_ice_w); virtual void video_start() override; DECLARE_PALETTE_INIT(sspeedr); - UINT32 screen_update_sspeedr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sspeedr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_sspeedr(screen_device &screen, bool state); void draw_track(bitmap_ind16 &bitmap); void draw_drones(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/ssrj.h b/src/mame/includes/ssrj.h index f17223aca95..52bc1529c6b 100644 --- a/src/mame/includes/ssrj.h +++ b/src/mame/includes/ssrj.h @@ -18,17 +18,17 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_vram1; - required_shared_ptr m_vram2; - required_shared_ptr m_vram3; - required_shared_ptr m_vram4; - required_shared_ptr m_scrollram; + required_shared_ptr m_vram1; + required_shared_ptr m_vram2; + required_shared_ptr m_vram3; + required_shared_ptr m_vram4; + required_shared_ptr m_scrollram; int m_oldport; tilemap_t *m_tilemap1; tilemap_t *m_tilemap2; tilemap_t *m_tilemap4; - std::unique_ptr m_buffer_spriteram; + std::unique_ptr m_buffer_spriteram; DECLARE_READ8_MEMBER(wheel_r); DECLARE_WRITE8_MEMBER(vram1_w); @@ -44,7 +44,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(ssrj); - 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); void screen_eof(screen_device &screen, bool state); void draw_objects(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/ssv.h b/src/mame/includes/ssv.h index f9ad2d40728..12aea45bff8 100644 --- a/src/mame/includes/ssv.h +++ b/src/mame/includes/ssv.h @@ -41,30 +41,30 @@ public: optional_device m_eeprom; optional_device m_dsp; - required_shared_ptr m_mainram; - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll; - required_shared_ptr m_irq_vectors; - optional_shared_ptr m_gdfs_tmapram; - optional_shared_ptr m_gdfs_tmapscroll; + required_shared_ptr m_mainram; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll; + required_shared_ptr m_irq_vectors; + optional_shared_ptr m_gdfs_tmapram; + optional_shared_ptr m_gdfs_tmapscroll; optional_device m_gdfs_st0020; - optional_shared_ptr m_input_sel; + optional_shared_ptr m_input_sel; int m_tile_code[16]; int m_enable_video; int m_shadow_pen_mask; int m_shadow_pen_shift; - UINT8 m_requested_int; - UINT16 m_irq_enable; - std::unique_ptr m_eaglshot_gfxram; + uint8_t m_requested_int; + uint16_t m_irq_enable; + std::unique_ptr m_eaglshot_gfxram; tilemap_t *m_gdfs_tmap; int m_interrupt_ultrax; int m_gdfs_lightgun_select; - UINT16 m_sxyreact_serial; + uint16_t m_sxyreact_serial; int m_sxyreact_dial; - UINT16 m_gdfs_eeprom_old; - UINT32 m_latches[8]; - UINT8 m_trackball_select; + uint16_t m_gdfs_eeprom_old; + uint32_t m_latches[8]; + uint8_t m_trackball_select; DECLARE_WRITE16_MEMBER(irq_ack_w); DECLARE_WRITE16_MEMBER(irq_enable_w); @@ -130,16 +130,16 @@ public: DECLARE_VIDEO_START(gdfs); DECLARE_VIDEO_START(eaglshot); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); TIMER_DEVICE_CALLBACK_MEMBER(gdfs_interrupt); void update_irq_state(); IRQ_CALLBACK_MEMBER(irq_callback); - void drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx,UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0,int shadow); + void drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx,uint32_t code,uint32_t color,int flipx,int flipy,int x0,int y0,int shadow); void draw_row(bitmap_ind16 &bitmap, const rectangle &cliprect, int sx, int sy, int scroll); void draw_layer(bitmap_ind16 &bitmap, const rectangle &cliprect, int nr); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/ssystem3.h b/src/mame/includes/ssystem3.h index 63eb87cff8d..035028677cc 100644 --- a/src/mame/includes/ssystem3.h +++ b/src/mame/includes/ssystem3.h @@ -18,21 +18,21 @@ struct playfield_t // int on; int count, bit, started; - UINT8 data; + uint8_t data; attotime time, high_time, low_time; union { struct { - UINT8 header[7]; - UINT8 field[8][8/2]; - UINT8 unknown[5]; + uint8_t header[7]; + uint8_t field[8][8/2]; + uint8_t unknown[5]; } s; - UINT8 data[7+8*8/2+5]; + uint8_t data[7+8*8/2+5]; } u; }; struct lcd_t { - UINT8 data[5]; + uint8_t data[5]; int clock; int count; }; @@ -53,7 +53,7 @@ public: DECLARE_DRIVER_INIT(ssystem3); virtual void video_start() override; DECLARE_PALETTE_INIT(ssystem3); - UINT32 screen_update_ssystem3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ssystem3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER(ssystem3_via_write_a); DECLARE_READ8_MEMBER(ssystem3_via_read_a); DECLARE_READ8_MEMBER(ssystem3_via_read_b); @@ -61,15 +61,15 @@ public: void ssystem3_lcd_reset(); void ssystem3_lcd_write(int clock, int data); void ssystem3_draw_7segment(bitmap_ind16 &bitmap,int value, int x, int y); - void ssystem3_draw_led(bitmap_ind16 &bitmap,INT16 color, int x, int y, int ch); + void ssystem3_draw_led(bitmap_ind16 &bitmap,int16_t color, int x, int y, int ch); void ssystem3_playfield_getfigure(int x, int y, int *figure, int *black); void ssystem3_playfield_reset(); void ssystem3_playfield_write(int reset, int signal); void ssystem3_playfield_read(int *on, int *ready); private: - UINT8 m_porta; - std::unique_ptr m_videoram; + uint8_t m_porta; + std::unique_ptr m_videoram; playfield_t m_playfield; lcd_t m_lcd; diff --git a/src/mame/includes/stactics.h b/src/mame/includes/stactics.h index 989f7f262fc..664ea623e1d 100644 --- a/src/mame/includes/stactics.h +++ b/src/mame/includes/stactics.h @@ -26,29 +26,29 @@ public: required_device m_maincpu; - required_shared_ptr m_palette_val; - required_shared_ptr m_motor_on; - required_shared_ptr m_lamps; - required_shared_ptr m_display_buffer; - required_shared_ptr m_videoram_b; - required_shared_ptr m_videoram_d; - required_shared_ptr m_videoram_e; - required_shared_ptr m_videoram_f; + required_shared_ptr m_palette_val; + required_shared_ptr m_motor_on; + required_shared_ptr m_lamps; + required_shared_ptr m_display_buffer; + required_shared_ptr m_videoram_b; + required_shared_ptr m_videoram_d; + required_shared_ptr m_videoram_e; + required_shared_ptr m_videoram_f; /* machine state */ int m_vert_pos; int m_horiz_pos; /* video state */ - UINT8 m_y_scroll_d; - UINT8 m_y_scroll_e; - UINT8 m_y_scroll_f; - UINT8 m_frame_count; - UINT8 m_shot_standby; - UINT8 m_shot_arrive; - UINT16 m_beam_state; - UINT16 m_old_beam_state; - UINT16 m_beam_states_per_frame; + uint8_t m_y_scroll_d; + uint8_t m_y_scroll_e; + uint8_t m_y_scroll_f; + uint8_t m_frame_count; + uint8_t m_shot_standby; + uint8_t m_shot_arrive; + uint16_t m_beam_state; + uint16_t m_old_beam_state; + uint16_t m_beam_states_per_frame; DECLARE_READ8_MEMBER(vert_pos_r); DECLARE_READ8_MEMBER(horiz_pos_r); @@ -69,9 +69,9 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(stactics); - 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); void update_beam(); - inline int get_pixel_on_plane(UINT8 *videoram, UINT8 y, UINT8 x, UINT8 y_scroll); + inline int get_pixel_on_plane(uint8_t *videoram, uint8_t y, uint8_t x, uint8_t y_scroll); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); void set_indicator_leds(int data, const char *output_name, int base_index); void update_artwork(); diff --git a/src/mame/includes/stadhero.h b/src/mame/includes/stadhero.h index a484da15f18..e4285fa2a11 100644 --- a/src/mame/includes/stadhero.h +++ b/src/mame/includes/stadhero.h @@ -26,8 +26,8 @@ public: required_device m_gfxdecode; required_device m_soundlatch; - required_shared_ptr m_spriteram; - required_shared_ptr m_pf1_data; + required_shared_ptr m_spriteram; + required_shared_ptr m_pf1_data; tilemap_t *m_pf1_tilemap; @@ -37,5 +37,5 @@ public: virtual void video_start() override; TILE_GET_INFO_MEMBER(get_pf1_tile_info); - UINT32 screen_update_stadhero(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_stadhero(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/starcrus.h b/src/mame/includes/starcrus.h index 3de1b75301f..443fea52f4d 100644 --- a/src/mame/includes/starcrus.h +++ b/src/mame/includes/starcrus.h @@ -65,7 +65,7 @@ public: virtual void video_start() override; - 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); int collision_check_s1s2(); int collision_check_p1p2(); int collision_check_s1p1p2(); diff --git a/src/mame/includes/starfire.h b/src/mame/includes/starfire.h index a270cc8a29e..6208c768720 100644 --- a/src/mame/includes/starfire.h +++ b/src/mame/includes/starfire.h @@ -33,18 +33,18 @@ public: m_maincpu(*this, "maincpu"), m_screen(*this, "screen") { } - required_shared_ptr m_starfire_colorram; - required_shared_ptr m_starfire_videoram; + required_shared_ptr m_starfire_colorram; + required_shared_ptr m_starfire_videoram; optional_device m_samples; optional_ioport m_nmi; - UINT8 m_prev_sound; - UINT8 m_fireone_select; + uint8_t m_prev_sound; + uint8_t m_fireone_select; - UINT8 m_starfire_vidctrl; - UINT8 m_starfire_vidctrl1; - UINT8 m_starfire_color; - UINT16 m_starfire_colors[STARFIRE_NUM_PENS]; + uint8_t m_starfire_vidctrl; + uint8_t m_starfire_vidctrl1; + uint8_t m_starfire_color; + uint16_t m_starfire_colors[STARFIRE_NUM_PENS]; read8_delegate m_input_read; write8_delegate m_io2_write; @@ -64,7 +64,7 @@ public: DECLARE_DRIVER_INIT(starfire); DECLARE_DRIVER_INIT(fireone); virtual void video_start() override; - UINT32 screen_update_starfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_starfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(starfire_scanline_callback); INTERRUPT_GEN_MEMBER(vblank_int); void get_pens(pen_t *pens); diff --git a/src/mame/includes/starshp1.h b/src/mame/includes/starshp1.h index b4fa955bc80..35687540f87 100644 --- a/src/mame/includes/starshp1.h +++ b/src/mame/includes/starshp1.h @@ -49,10 +49,10 @@ public: int m_analog_in_select; int m_attract; - required_shared_ptr m_playfield_ram; - required_shared_ptr m_hpos_ram; - required_shared_ptr m_vpos_ram; - required_shared_ptr m_obj_ram; + required_shared_ptr m_playfield_ram; + required_shared_ptr m_hpos_ram; + required_shared_ptr m_vpos_ram; + required_shared_ptr m_obj_ram; int m_ship_explode; int m_ship_picture; int m_ship_hoffset; @@ -68,7 +68,7 @@ public: int m_starfield_kill; int m_mux; int m_inverse; - std::unique_ptr m_LSFR; + std::unique_ptr m_LSFR; bitmap_ind16 m_helper; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(starshp1_collision_reset_w); @@ -85,7 +85,7 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(starshp1); - UINT32 screen_update_starshp1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_starshp1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_starshp1(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(starshp1_interrupt); void set_pens(); diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h index 5782a873cb3..006e232d6e2 100644 --- a/src/mame/includes/starwars.h +++ b/src/mame/includes/starwars.h @@ -22,30 +22,30 @@ public: m_slapstic_device(*this, "slapstic") { } - UINT8 m_sound_data; - UINT8 m_main_data; + uint8_t m_sound_data; + uint8_t m_main_data; required_device m_riot; - UINT8 *m_slapstic_source; - UINT8 *m_slapstic_base; - UINT8 m_slapstic_current_bank; - UINT8 m_is_esb; - required_shared_ptr m_mathram; - UINT8 m_control_num; + uint8_t *m_slapstic_source; + uint8_t *m_slapstic_base; + uint8_t m_slapstic_current_bank; + uint8_t m_is_esb; + required_shared_ptr m_mathram; + uint8_t m_control_num; int m_MPA; int m_BIC; - UINT16 m_dvd_shift; - UINT16 m_quotient_shift; - UINT16 m_divisor; - UINT16 m_dividend; - std::unique_ptr m_PROM_STR; - std::unique_ptr m_PROM_MAS; - std::unique_ptr m_PROM_AM; + uint16_t m_dvd_shift; + uint16_t m_quotient_shift; + uint16_t m_divisor; + uint16_t m_dividend; + std::unique_ptr m_PROM_STR; + std::unique_ptr m_PROM_MAS; + std::unique_ptr m_PROM_AM; int m_math_run; emu_timer *m_math_timer; - INT16 m_A; - INT16 m_B; - INT16 m_C; - INT32 m_ACC; + int16_t m_A; + int16_t m_B; + int16_t m_C; + int32_t m_ACC; DECLARE_WRITE8_MEMBER(irq_ack_w); DECLARE_READ8_MEMBER(esb_slapstic_r); DECLARE_WRITE8_MEMBER(esb_slapstic_w); diff --git a/src/mame/includes/stfight.h b/src/mame/includes/stfight.h index 064ae984979..0f64afbe489 100644 --- a/src/mame/includes/stfight.h +++ b/src/mame/includes/stfight.h @@ -30,20 +30,20 @@ public: required_device m_msm; required_device m_palette; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; optional_device m_stfight_video; optional_device m_airraid_video; - UINT8 *m_decrypt; - UINT8 m_fm_data; - UINT8 m_cpu_to_mcu_data; - UINT8 m_cpu_to_mcu_empty; + uint8_t *m_decrypt; + uint8_t m_fm_data; + uint8_t m_cpu_to_mcu_data; + uint8_t m_cpu_to_mcu_empty; - UINT16 m_adpcm_data_offs; - UINT8 m_adpcm_nibble; - UINT8 m_adpcm_reset; + uint16_t m_adpcm_data_offs; + uint8_t m_adpcm_nibble; + uint8_t m_adpcm_reset; - UINT8 m_coin_state; + uint8_t m_coin_state; DECLARE_WRITE_LINE_MEMBER(stfight_adpcm_int); @@ -83,10 +83,10 @@ public: DECLARE_WRITE8_MEMBER(stfight_68705_ddr_b_w); DECLARE_WRITE8_MEMBER(stfight_68705_ddr_c_w); - UINT8 m_portA_out, m_portA_in; - UINT8 m_portB_out, m_portB_in; - UINT8 m_portC_out, m_portC_in; - UINT8 m_ddrA, m_ddrB, m_ddrC; + uint8_t m_portA_out, m_portA_in; + uint8_t m_portB_out, m_portB_in; + uint8_t m_portC_out, m_portC_in; + uint8_t m_ddrA, m_ddrB, m_ddrC; protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/stlforce.h b/src/mame/includes/stlforce.h index 7c43ad56e93..bec81c82259 100644 --- a/src/mame/includes/stlforce.h +++ b/src/mame/includes/stlforce.h @@ -29,15 +29,15 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_mlow_videoram; - required_shared_ptr m_mhigh_videoram; - required_shared_ptr m_tx_videoram; - required_shared_ptr m_bg_scrollram; - required_shared_ptr m_mlow_scrollram; - required_shared_ptr m_mhigh_scrollram; - required_shared_ptr m_vidattrram; - required_shared_ptr m_spriteram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_mlow_videoram; + required_shared_ptr m_mhigh_videoram; + required_shared_ptr m_tx_videoram; + required_shared_ptr m_bg_scrollram; + required_shared_ptr m_mlow_scrollram; + required_shared_ptr m_mhigh_scrollram; + required_shared_ptr m_vidattrram; + required_shared_ptr m_spriteram; tilemap_t *m_bg_tilemap; tilemap_t *m_mlow_tilemap; @@ -62,6 +62,6 @@ public: TILE_GET_INFO_MEMBER(get_stlforce_tx_tile_info); virtual void video_start() override; - UINT32 screen_update_stlforce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_stlforce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/strnskil.h b/src/mame/includes/strnskil.h index 7f0e4699cad..0b594da9120 100644 --- a/src/mame/includes/strnskil.h +++ b/src/mame/includes/strnskil.h @@ -18,13 +18,13 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_xscroll; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_xscroll; + required_shared_ptr m_spriteram; - UINT8 m_scrl_ctrl; + uint8_t m_scrl_ctrl; tilemap_t *m_bg_tilemap; - UINT8 m_irq_source; + uint8_t m_irq_source; TIMER_DEVICE_CALLBACK_MEMBER(strnskil_irq); @@ -43,6 +43,6 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(strnskil); - UINT32 screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/stv.h b/src/mame/includes/stv.h index befa2c7a569..7f52a22d59b 100644 --- a/src/mame/includes/stv.h +++ b/src/mame/includes/stv.h @@ -93,14 +93,14 @@ public: /* Batman Forever specifics */ optional_device m_adsp; - optional_shared_ptr m_adsp_pram; + optional_shared_ptr m_adsp_pram; struct { - UINT16 bdma_internal_addr; - UINT16 bdma_external_addr; - UINT16 bdma_control; - UINT16 bdma_word_count; + uint16_t bdma_internal_addr; + uint16_t bdma_external_addr; + uint16_t bdma_control; + uint16_t bdma_word_count; } m_adsp_regs; DECLARE_MACHINE_RESET(batmanfr); @@ -109,10 +109,10 @@ public: DECLARE_WRITE32_MEMBER(batmanfr_sound_comms_w); // protection specific variables and functions (see machine/stvprot.c) - UINT32 m_abus_protenable; - UINT32 m_abus_protkey; + uint32_t m_abus_protenable; + uint32_t m_abus_protkey; - UINT32 m_a_bus[4]; + uint32_t m_a_bus[4]; DECLARE_READ32_MEMBER( common_prot_r ); DECLARE_WRITE32_MEMBER( common_prot_w ); @@ -125,9 +125,9 @@ public: optional_device m_cryptdevice; optional_device m_5838crypt; optional_device m_soundlatch; // batmanfr - UINT16 crypt_read_callback(UINT32 addr); - UINT16 crypt_read_callback_ch1(UINT32 addr); - UINT16 crypt_read_callback_ch2(UINT32 addr); + uint16_t crypt_read_callback(uint32_t addr); + uint16_t crypt_read_callback_ch1(uint32_t addr); + uint16_t crypt_read_callback_ch2(uint32_t addr); }; diff --git a/src/mame/includes/subs.h b/src/mame/includes/subs.h index 853cb24d1e8..2594e515095 100644 --- a/src/mame/includes/subs.h +++ b/src/mame/includes/subs.h @@ -35,8 +35,8 @@ public: required_device m_palette; required_device m_discrete; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; int m_steering_buf1; int m_steering_buf2; @@ -63,8 +63,8 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(subs); - UINT32 screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(interrupt); diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h index a458c06f914..e3fb7be1561 100644 --- a/src/mame/includes/suna16.h +++ b/src/mame/includes/suna16.h @@ -27,16 +27,16 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram2; optional_memory_bank m_bank1; optional_memory_bank m_bank2; - std::unique_ptr m_paletteram; + std::unique_ptr m_paletteram; int m_color_bank; - UINT8 m_prot; + uint8_t m_prot; // common DECLARE_WRITE16_MEMBER(soundlatch_w); @@ -71,7 +71,7 @@ public: DECLARE_MACHINE_START(uballoon); DECLARE_MACHINE_RESET(uballoon); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bestbest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bestbest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *sprites, int gfx); }; diff --git a/src/mame/includes/suna8.h b/src/mame/includes/suna8.h index 6c7f039017e..ab6954c4602 100644 --- a/src/mame/includes/suna8.h +++ b/src/mame/includes/suna8.h @@ -31,10 +31,10 @@ public: { } required_device m_maincpu; - optional_shared_ptr m_hardhead_ip; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_wram; - optional_shared_ptr m_banked_paletteram; + optional_shared_ptr m_hardhead_ip; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_wram; + optional_shared_ptr m_banked_paletteram; required_device m_audiocpu; optional_device m_samples; required_device m_gfxdecode; @@ -46,21 +46,21 @@ public: required_memory_bank m_bank1; optional_memory_bank m_bank1d; - UINT8 m_rombank; - UINT8 m_rombank_latch; - UINT8 m_spritebank; - UINT8 m_palettebank; - UINT8 m_paletteram_enab; - UINT8 m_prot2; - UINT8 m_prot2_prev; - - UINT8 m_protection_val; - UINT8 m_nmi_enable; - UINT8 m_spritebank_latch; - UINT8 m_write_disable; - UINT8 m_prot_opcode_toggle; - UINT8 m_remap_sound; - UINT8* m_decrypt; + uint8_t m_rombank; + uint8_t m_rombank_latch; + uint8_t m_spritebank; + uint8_t m_palettebank; + uint8_t m_paletteram_enab; + uint8_t m_prot2; + uint8_t m_prot2_prev; + + uint8_t m_protection_val; + uint8_t m_nmi_enable; + uint8_t m_spritebank_latch; + uint8_t m_write_disable; + uint8_t m_prot_opcode_toggle; + uint8_t m_remap_sound; + uint8_t* m_decrypt; enum GFXBANK_TYPE_T { @@ -68,12 +68,12 @@ public: GFXBANK_TYPE_BRICKZN, GFXBANK_TYPE_STARFIGH } m_gfxbank_type; - UINT8 m_gfxbank; + uint8_t m_gfxbank; bool m_has_text; // has text sprites (older games) // samples - std::unique_ptr m_samplebuf; + std::unique_ptr m_samplebuf; int m_sample, m_play; int m_numsamples; @@ -162,7 +162,7 @@ public: DECLARE_MACHINE_RESET(brickzn); DECLARE_MACHINE_RESET(hardhea2); - UINT32 screen_update_suna8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_suna8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(hardhea2_interrupt); // samples @@ -174,5 +174,5 @@ public: void draw_sprites (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int which); void draw_text_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int ypos, bool write_mask); - UINT8 *brickzn_decrypt(); + uint8_t *brickzn_decrypt(); }; diff --git a/src/mame/includes/supbtime.h b/src/mame/includes/supbtime.h index 05057aca224..93a34603a9a 100644 --- a/src/mame/includes/supbtime.h +++ b/src/mame/includes/supbtime.h @@ -26,9 +26,9 @@ public: { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; /* devices */ required_device m_maincpu; @@ -40,5 +40,5 @@ public: DECLARE_READ16_MEMBER(supbtime_controls_r); DECLARE_WRITE16_MEMBER(sound_w); virtual void machine_start() override; - UINT32 screen_update_supbtime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_supbtime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/super6.h b/src/mame/includes/super6.h index 6edce116cb4..64f09aef418 100644 --- a/src/mame/includes/super6.h +++ b/src/mame/includes/super6.h @@ -56,7 +56,7 @@ public: required_device m_ram; required_device m_floppy0; required_device m_floppy1; - required_region_ptr m_rom; + required_region_ptr m_rom; required_ioport m_j7; virtual void machine_start() override; @@ -75,9 +75,9 @@ public: void bankswitch(); // memory state - UINT8 m_s100; - UINT8 m_bank0; - UINT8 m_bank1; + uint8_t m_s100; + uint8_t m_bank0; + uint8_t m_bank1; TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick); DECLARE_READ8_MEMBER(memory_read_byte); DECLARE_WRITE8_MEMBER(memory_write_byte); diff --git a/src/mame/includes/super80.h b/src/mame/includes/super80.h index 3c5f3ad4be6..da9eead1427 100644 --- a/src/mame/includes/super80.h +++ b/src/mame/includes/super80.h @@ -75,36 +75,36 @@ public: DECLARE_PALETTE_INIT(super80m); DECLARE_QUICKLOAD_LOAD_MEMBER(super80); MC6845_UPDATE_ROW(crtc_update_row); - UINT32 screen_update_super80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_super80v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_super80d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_super80e(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_super80m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_super80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_super80v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_super80d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_super80e(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_super80m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_super80m(screen_device &screen, bool state); TIMER_CALLBACK_MEMBER(super80_reset); TIMER_DEVICE_CALLBACK_MEMBER(timer_h); TIMER_DEVICE_CALLBACK_MEMBER(timer_k); TIMER_DEVICE_CALLBACK_MEMBER(timer_p); - UINT8 m_s_options; - UINT8 m_portf0; - UINT8 *m_p_videoram; - UINT8 *m_p_colorram; - UINT8 *m_p_pcgram; - UINT8 m_mc6845_cursor[16]; - UINT8 m_palette_index; + uint8_t m_s_options; + uint8_t m_portf0; + uint8_t *m_p_videoram; + uint8_t *m_p_colorram; + uint8_t *m_p_pcgram; + uint8_t m_mc6845_cursor[16]; + uint8_t m_palette_index; required_device m_palette; private: - UINT8 m_keylatch; - UINT8 m_cass_data[4]; - UINT8 m_int_sw; - UINT8 m_last_data; - UINT8 m_key_pressed; - UINT16 m_vidpg; - UINT8 m_current_charset; - const UINT8 *m_p_chargen; - UINT8 m_mc6845_reg[32]; - UINT8 m_mc6845_ind; - UINT8 *m_p_ram; + uint8_t m_keylatch; + uint8_t m_cass_data[4]; + uint8_t m_int_sw; + uint8_t m_last_data; + uint8_t m_key_pressed; + uint16_t m_vidpg; + uint8_t m_current_charset; + const uint8_t *m_p_chargen; + uint8_t m_mc6845_reg[32]; + uint8_t m_mc6845_ind; + uint8_t *m_p_ram; void mc6845_cursor_configure(); void super80_cassette_motor(bool data); required_device m_maincpu; diff --git a/src/mame/includes/superchs.h b/src/mame/includes/superchs.h index 663e336ef17..97d7b62a773 100644 --- a/src/mame/includes/superchs.h +++ b/src/mame/includes/superchs.h @@ -31,13 +31,13 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT16 m_coin_word; - required_shared_ptr m_ram; - required_shared_ptr m_spriteram; - required_shared_ptr m_shared_ram; + uint16_t m_coin_word; + required_shared_ptr m_ram; + required_shared_ptr m_spriteram; + required_shared_ptr m_shared_ram; std::unique_ptr m_spritelist; - UINT32 m_mem[2]; + uint32_t m_mem[2]; DECLARE_READ16_MEMBER(shared_ram_r); DECLARE_WRITE16_MEMBER(shared_ram_w); @@ -50,7 +50,7 @@ public: DECLARE_READ16_MEMBER(sub_cycle_r); DECLARE_DRIVER_INIT(superchs); virtual void video_start() override; - UINT32 screen_update_superchs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_superchs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs); required_device m_maincpu; required_device m_subcpu; diff --git a/src/mame/includes/superqix.h b/src/mame/includes/superqix.h index 28377347a5c..7952eea44df 100644 --- a/src/mame/includes/superqix.h +++ b/src/mame/includes/superqix.h @@ -25,43 +25,43 @@ public: required_device m_maincpu; optional_device m_mcu; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - optional_shared_ptr m_bitmapram; - optional_shared_ptr m_bitmapram2; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + optional_shared_ptr m_bitmapram; + optional_shared_ptr m_bitmapram2; optional_device m_samples; required_device m_gfxdecode; required_device m_palette; - std::unique_ptr m_samplebuf; + std::unique_ptr m_samplebuf; // MCU HLE and/or 8751 related - UINT8 m_port1; // HLE-related for superqix - UINT8 m_port2; // HLE-related for superqix - UINT8 m_port3; // HLE-related for superqix - UINT8 m_port3_latch; // HLE-related for superqix - UINT8 m_fromZ80pending; // HLE-related for superqix, to add a delay to z80->mcu comms + uint8_t m_port1; // HLE-related for superqix + uint8_t m_port2; // HLE-related for superqix + uint8_t m_port3; // HLE-related for superqix + uint8_t m_port3_latch; // HLE-related for superqix + uint8_t m_fromZ80pending; // HLE-related for superqix, to add a delay to z80->mcu comms int m_curr_player; // HLE-related for prebillian // commmon 68705/8751/HLE - UINT8 m_fromMCU; // byte latch for 68705/8751->z80 comms - UINT8 m_fromZ80; // byte latch for z80->68705/8751 comms + uint8_t m_fromMCU; // byte latch for 68705/8751->z80 comms + uint8_t m_fromZ80; // byte latch for z80->68705/8751 comms bool m_Z80HasWritten; // z80 has written to latch flag bool m_MCUHasWritten; // 68705/8751 has written to latch flag // 68705 related - UINT8 m_portA_in; // actual input to pins - //UINT8 m_portB_in; // - //UINT8 m_portC_in; // - //UINT8 m_portA_out; // actual output on pins (post ddr) - UINT8 m_portB_out; // - UINT8 m_portC_out; // + uint8_t m_portA_in; // actual input to pins + //uint8_t m_portB_in; // + //uint8_t m_portC_in; // + //uint8_t m_portA_out; // actual output on pins (post ddr) + uint8_t m_portB_out; // + uint8_t m_portC_out; // - //UINT8 m_portA_internal;// output before applying ddr - UINT8 m_portB_internal;// - UINT8 m_portC_internal;// - UINT8 m_ddrA; - UINT8 m_ddrB; - UINT8 m_ddrC; + //uint8_t m_portA_internal;// output before applying ddr + uint8_t m_portB_internal;// + uint8_t m_portC_internal;// + uint8_t m_ddrA; + uint8_t m_ddrB; + uint8_t m_ddrC; //general machine stuff bool m_invert_coin_lockout; @@ -123,8 +123,8 @@ public: DECLARE_MACHINE_START(superqix); DECLARE_VIDEO_START(superqix); DECLARE_PALETTE_DECODER(BBGGRRII); - UINT32 screen_update_pbillian(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_superqix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pbillian(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_superqix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(sqix_timer_irq); TIMER_CALLBACK_MEMBER(mcu_acknowledge_callback); diff --git a/src/mame/includes/superslave.h b/src/mame/includes/superslave.h index ef84899e5c4..42420960a21 100644 --- a/src/mame/includes/superslave.h +++ b/src/mame/includes/superslave.h @@ -68,8 +68,8 @@ public: DECLARE_WRITE_LINE_MEMBER( fr_w ); DECLARE_WRITE_LINE_MEMBER( ft_w ); - UINT8 m_memctrl; - UINT8 m_cmd; + uint8_t m_memctrl; + uint8_t m_cmd; }; #endif diff --git a/src/mame/includes/suprloco.h b/src/mame/includes/suprloco.h index 9aa77824569..1f1c1a6c40d 100644 --- a/src/mame/includes/suprloco.h +++ b/src/mame/includes/suprloco.h @@ -22,10 +22,10 @@ public: required_device m_gfxdecode; required_device m_soundlatch; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_scrollram; - required_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_scrollram; + required_shared_ptr m_decrypted_opcodes; tilemap_t *m_bg_tilemap; int m_control; @@ -42,7 +42,7 @@ public: DECLARE_PALETTE_INIT(suprloco); DECLARE_DRIVER_INIT(suprloco); - 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); inline void draw_pixel(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip); void draw_sprite(bitmap_ind16 &bitmap,const rectangle &cliprect,int spr_number); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/suprnova.h b/src/mame/includes/suprnova.h index a9eddacfe30..625f1888ea8 100644 --- a/src/mame/includes/suprnova.h +++ b/src/mame/includes/suprnova.h @@ -6,17 +6,17 @@ struct hit_t { - UINT16 x1p, y1p, z1p, x1s, y1s, z1s; - UINT16 x2p, y2p, z2p, x2s, y2s, z2s; - UINT16 org; + uint16_t x1p, y1p, z1p, x1s, y1s, z1s; + uint16_t x2p, y2p, z2p, x2s, y2s, z2s; + uint16_t org; - UINT16 x1_p1, x1_p2, y1_p1, y1_p2, z1_p1, z1_p2; - UINT16 x2_p1, x2_p2, y2_p1, y2_p2, z2_p1, z2_p2; - UINT16 x1tox2, y1toy2, z1toz2; - INT16 x_in, y_in, z_in; - UINT16 flag; + uint16_t x1_p1, x1_p2, y1_p1, y1_p2, z1_p1, z1_p2; + uint16_t x2_p1, x2_p2, y2_p1, y2_p2, z2_p1, z2_p2; + uint16_t x1tox2, y1toy2, z1toz2; + int16_t x_in, y_in, z_in; + uint16_t flag; - UINT8 disconnect; + uint8_t disconnect; }; @@ -46,17 +46,17 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_spriteram; - required_shared_ptr m_spc_regs; - required_shared_ptr m_v3_regs; - required_shared_ptr m_tilemapA_ram; - required_shared_ptr m_tilemapB_ram; - required_shared_ptr m_v3slc_ram; - required_shared_ptr m_pal_regs; - required_shared_ptr m_palette_ram; - required_shared_ptr m_v3t_ram; - required_shared_ptr m_main_ram; - required_shared_ptr m_cache_ram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spc_regs; + required_shared_ptr m_v3_regs; + required_shared_ptr m_tilemapA_ram; + required_shared_ptr m_tilemapB_ram; + required_shared_ptr m_v3slc_ram; + required_shared_ptr m_pal_regs; + required_shared_ptr m_palette_ram; + required_shared_ptr m_v3t_ram; + required_shared_ptr m_main_ram; + required_shared_ptr m_cache_ram; hit_t m_hit; bitmap_ind16 m_sprite_bitmap; @@ -68,18 +68,18 @@ public: int m_depthB; int m_use_spc_bright; int m_use_v3_bright; - UINT8 m_bright_spc_b; - UINT8 m_bright_spc_g; - UINT8 m_bright_spc_r; - UINT8 m_bright_spc_b_trans; - UINT8 m_bright_spc_g_trans; - UINT8 m_bright_spc_r_trans; - UINT8 m_bright_v3_b; - UINT8 m_bright_v3_g; - UINT8 m_bright_v3_r; - UINT8 m_bright_v3_b_trans; - UINT8 m_bright_v3_g_trans; - UINT8 m_bright_v3_r_trans; + uint8_t m_bright_spc_b; + uint8_t m_bright_spc_g; + uint8_t m_bright_spc_r; + uint8_t m_bright_spc_b_trans; + uint8_t m_bright_spc_g_trans; + uint8_t m_bright_spc_r_trans; + uint8_t m_bright_v3_b; + uint8_t m_bright_v3_g; + uint8_t m_bright_v3_r; + uint8_t m_bright_v3_b_trans; + uint8_t m_bright_v3_g_trans; + uint8_t m_bright_v3_r_trans; int m_spc_changed; int m_v3_changed; int m_palette_updated; @@ -87,8 +87,8 @@ public: int m_alt_enable_sprites; tilemap_t *m_tilemap_A; tilemap_t *m_tilemap_B; - UINT8 *m_btiles; - UINT8 m_region; + uint8_t *m_btiles; + uint8_t m_region; DECLARE_WRITE32_MEMBER(hit_w); DECLARE_WRITE32_MEMBER(hit2_w); @@ -150,15 +150,15 @@ public: TILE_GET_INFO_MEMBER(get_tilemap_A_tile_info); TILE_GET_INFO_MEMBER(get_tilemap_B_tile_info); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(interrupt_callback); TIMER_DEVICE_CALLBACK_MEMBER(irq); - void draw_roz(bitmap_ind16 &bitmap, bitmap_ind8& bitmapflags, const rectangle &cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound, int columnscroll, UINT32* scrollram); - void palette_set_rgb_brightness (int offset, UINT8 brightness_r, UINT8 brightness_g, UINT8 brightness_b); + void draw_roz(bitmap_ind16 &bitmap, bitmap_ind8& bitmapflags, const rectangle &cliprect, tilemap_t *tmap, uint32_t startx, uint32_t starty, int incxx, int incxy, int incyx, int incyy, int wraparound, int columnscroll, uint32_t* scrollram); + void palette_set_rgb_brightness (int offset, uint8_t brightness_r, uint8_t brightness_g, uint8_t brightness_b); void palette_update(); void draw_a( bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const rectangle &cliprect, int tran ); void draw_b( bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const rectangle &cliprect, int tran ); void hit_recalc(); void init_drc(); - void set_drc_pcflush(UINT32 addr); + void set_drc_pcflush(uint32_t addr); }; diff --git a/src/mame/includes/suprridr.h b/src/mame/includes/suprridr.h index 74a32a47f07..3bdf99fa460 100644 --- a/src/mame/includes/suprridr.h +++ b/src/mame/includes/suprridr.h @@ -24,17 +24,17 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_fgram; - required_shared_ptr m_bgram; - required_shared_ptr m_spriteram; + required_shared_ptr m_fgram; + required_shared_ptr m_bgram; + required_shared_ptr m_spriteram; - UINT8 m_nmi_enable; - UINT8 m_sound_data; + uint8_t m_nmi_enable; + uint8_t m_sound_data; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; tilemap_t *m_bg_tilemap_noscroll; - UINT8 m_flipx; - UINT8 m_flipy; + uint8_t m_flipx; + uint8_t m_flipy; DECLARE_WRITE8_MEMBER(nmi_enable_w); DECLARE_WRITE8_MEMBER(sound_data_w); @@ -61,6 +61,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(suprridr); - 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); int is_screen_flipped(); }; diff --git a/src/mame/includes/suprslam.h b/src/mame/includes/suprslam.h index 54bfb91c663..8f9a664ffcc 100644 --- a/src/mame/includes/suprslam.h +++ b/src/mame/includes/suprslam.h @@ -29,19 +29,19 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_screen_videoram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_sp_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_spr_ctrl; - required_shared_ptr m_screen_vregs; + required_shared_ptr m_screen_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_sp_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spr_ctrl; + required_shared_ptr m_screen_vregs; /* video-related */ tilemap_t *m_screen_tilemap; tilemap_t *m_bg_tilemap; - UINT16 m_screen_bank; - UINT16 m_bg_bank; - UINT32 suprslam_tile_callback( UINT32 code ); + uint16_t m_screen_bank; + uint16_t m_bg_bank; + uint32_t suprslam_tile_callback( uint32_t code ); /* misc */ int m_pending_command; @@ -66,5 +66,5 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_suprslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_suprslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/surpratk.h b/src/mame/includes/surpratk.h index 021fa7bbd09..b6c780730c0 100644 --- a/src/mame/includes/surpratk.h +++ b/src/mame/includes/surpratk.h @@ -41,7 +41,7 @@ public: DECLARE_WRITE8_MEMBER(surpratk_5fc0_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_surpratk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_surpratk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(surpratk_interrupt); K05324X_CB_MEMBER(sprite_callback); diff --git a/src/mame/includes/svision.h b/src/mame/includes/svision.h index 43292b36702..4e98c277c37 100644 --- a/src/mame/includes/svision.h +++ b/src/mame/includes/svision.h @@ -24,13 +24,13 @@ struct svision_pet_t { int state; int on, clock, data; - UINT8 input; + uint8_t input; emu_timer *timer; }; struct tvlink_t { - UINT32 palette[4/*0x40?*/]; /* rgb8 */ + uint32_t palette[4/*0x40?*/]; /* rgb8 */ int palette_on; }; @@ -65,8 +65,8 @@ public: DECLARE_PALETTE_INIT(svisionp); DECLARE_PALETTE_INIT(svisionn); DECLARE_MACHINE_RESET(tvlink); - UINT32 screen_update_svision(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tvlink(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_svision(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tvlink(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(svision_frame_int); TIMER_CALLBACK_MEMBER(svision_pet_timer); TIMER_CALLBACK_MEMBER(svision_timer); @@ -78,8 +78,8 @@ protected: required_device m_maincpu; required_device m_sound; required_device m_cart; - required_shared_ptr m_reg; - required_shared_ptr m_videoram; + required_shared_ptr m_reg; + required_shared_ptr m_videoram; required_ioport m_joy; optional_ioport m_joy2; required_device m_palette; diff --git a/src/mame/includes/swtpc09.h b/src/mame/includes/swtpc09.h index ec71f4190b8..23f0906d4fc 100644 --- a/src/mame/includes/swtpc09.h +++ b/src/mame/includes/swtpc09.h @@ -106,19 +106,19 @@ public: DECLARE_DRIVER_INIT( swtpc09d3 ); void swtpc09_fdc_dma_transfer(); - void swtpc09_irq_handler(UINT8 peripheral, UINT8 state); + void swtpc09_irq_handler(uint8_t peripheral, uint8_t state); - UINT8 m_term_data; // terminal keyboard value - UINT8 m_pia_counter; // this is the counter on pia porta - UINT8 m_fdc_dma_address_reg; // dmf2 or dmf3 dma extended address reg - UINT8 m_system_type; // flag to indicate hw and rom combination - UINT8 m_fdc_status; // for floppy controller - UINT8 m_via_ca1_input; // dmf3 fdc interupt is connected here - UINT8 m_dmf3_via_porta; - UINT8 m_piaide_porta; - UINT8 m_piaide_portb; - UINT8 m_active_interrupt; - UINT8 m_interrupt; + uint8_t m_term_data; // terminal keyboard value + uint8_t m_pia_counter; // this is the counter on pia porta + uint8_t m_fdc_dma_address_reg; // dmf2 or dmf3 dma extended address reg + uint8_t m_system_type; // flag to indicate hw and rom combination + uint8_t m_fdc_status; // for floppy controller + uint8_t m_via_ca1_input; // dmf3 fdc interupt is connected here + uint8_t m_dmf3_via_porta; + uint8_t m_piaide_porta; + uint8_t m_piaide_portb; + uint8_t m_active_interrupt; + uint8_t m_interrupt; // TODO: move this in proper device @@ -129,16 +129,16 @@ public: int active; int address; int counter; - UINT8 control; + uint8_t control; int start_address; int start_counter; } m6844_channel_data; /* 6844 description */ m6844_channel_data m_m6844_channel[4]; - UINT8 m_m6844_priority; - UINT8 m_m6844_interrupt; - UINT8 m_m6844_chain; + uint8_t m_m6844_priority; + uint8_t m_m6844_interrupt; + uint8_t m_m6844_chain; DECLARE_READ8_MEMBER ( m6844_r ); DECLARE_WRITE8_MEMBER ( m6844_w ); diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h index 5449cdfbaad..14326294c91 100644 --- a/src/mame/includes/system1.h +++ b/src/mame/includes/system1.h @@ -35,29 +35,29 @@ public: { } optional_device m_ppi8255; - required_shared_ptr m_ram; - required_shared_ptr m_spriteram; - optional_shared_ptr m_nob_mcu_latch; - optional_shared_ptr m_nob_mcu_status; - required_shared_ptr m_paletteram; + required_shared_ptr m_ram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_nob_mcu_latch; + optional_shared_ptr m_nob_mcu_status; + required_shared_ptr m_paletteram; - std::unique_ptr m_videoram; - void (system1_state::*m_videomode_custom)(UINT8 data, UINT8 prevdata); - UINT8 m_mute_xor; - UINT8 m_dakkochn_mux_data; - UINT8 m_videomode_prev; - UINT8 m_mcu_control; - UINT8 m_nob_maincpu_latch; + std::unique_ptr m_videoram; + void (system1_state::*m_videomode_custom)(uint8_t data, uint8_t prevdata); + uint8_t m_mute_xor; + uint8_t m_dakkochn_mux_data; + uint8_t m_videomode_prev; + uint8_t m_mcu_control; + uint8_t m_nob_maincpu_latch; int m_nobb_inport23_step; - std::unique_ptr m_mix_collide; - UINT8 m_mix_collide_summary; - std::unique_ptr m_sprite_collide; - UINT8 m_sprite_collide_summary; + std::unique_ptr m_mix_collide; + uint8_t m_mix_collide_summary; + std::unique_ptr m_sprite_collide; + uint8_t m_sprite_collide_summary; bitmap_ind16 m_sprite_bitmap; - UINT8 m_video_mode; - UINT8 m_videoram_bank; + uint8_t m_video_mode; + uint8_t m_videoram_bank; tilemap_t *m_tilemap_page[8]; - UINT8 m_tilemap_pages; + uint8_t m_tilemap_pages; DECLARE_WRITE8_MEMBER(videomode_w); DECLARE_READ8_MEMBER(sound_data_r); @@ -113,9 +113,9 @@ public: DECLARE_MACHINE_START(system2); DECLARE_VIDEO_START(system2); DECLARE_MACHINE_START(myherok); - UINT32 screen_update_system1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_system2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_system2_rowscroll(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_system1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_system2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_system2_rowscroll(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(mcu_irq_assert); TIMER_DEVICE_CALLBACK_MEMBER(soundirq_gen); TIMER_DEVICE_CALLBACK_MEMBER(mcu_t0_callback); @@ -124,9 +124,9 @@ public: inline void videoram_wait_states(cpu_device *cpu); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset); void video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &fgpixmap, bitmap_ind16 **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs); - void bank44_custom_w(UINT8 data, UINT8 prevdata); - void bank0c_custom_w(UINT8 data, UINT8 prevdata); - void dakkochn_custom_w(UINT8 data, UINT8 prevdata); + void bank44_custom_w(uint8_t data, uint8_t prevdata); + void bank0c_custom_w(uint8_t data, uint8_t prevdata); + void dakkochn_custom_w(uint8_t data, uint8_t prevdata); required_device m_maincpu; required_device m_soundcpu; optional_device m_mcu; @@ -134,12 +134,12 @@ public: required_device m_screen; required_device m_palette; required_device m_soundlatch; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; required_memory_region m_maincpu_region; - optional_region_ptr m_color_prom; + optional_region_ptr m_color_prom; required_memory_bank m_bank1; optional_memory_bank m_bank0d; optional_memory_bank m_bank1d; - std::unique_ptr m_banked_decrypted_opcodes; + std::unique_ptr m_banked_decrypted_opcodes; }; diff --git a/src/mame/includes/system16.h b/src/mame/includes/system16.h index 762b62b8de4..cd297a863ff 100644 --- a/src/mame/includes/system16.h +++ b/src/mame/includes/system16.h @@ -27,16 +27,16 @@ public: m_soundlatch(*this, "soundlatch"), m_decrypted_opcodes(*this, "decrypted_opcodes") { } - required_shared_ptr m_textram; - optional_shared_ptr m_bg0_tileram; - optional_shared_ptr m_bg1_tileram; - optional_shared_ptr m_tileram; - optional_shared_ptr m_goldnaxeb2_bgpage; - optional_shared_ptr m_goldnaxeb2_fgpage; + required_shared_ptr m_textram; + optional_shared_ptr m_bg0_tileram; + optional_shared_ptr m_bg1_tileram; + optional_shared_ptr m_tileram; + optional_shared_ptr m_goldnaxeb2_bgpage; + optional_shared_ptr m_goldnaxeb2_fgpage; required_device m_sprites; - UINT16 m_coinctrl; + uint16_t m_coinctrl; /* game specific */ int m_passht4b_io1_val; @@ -72,7 +72,7 @@ public: int m_bg_page[4]; int m_fg_page[4]; - UINT16 m_datsu_page[4]; + uint16_t m_datsu_page[4]; int m_bg2_page[4]; int m_fg2_page[4]; @@ -88,7 +88,7 @@ public: int m_bg_scrolly; int m_fg_scrollx; int m_fg_scrolly; - UINT16 m_tilemapselect; + uint16_t m_tilemapselect; int m_textlayer_lo_min; int m_textlayer_lo_max; @@ -102,19 +102,19 @@ public: int m_sample_buffer; int m_sample_select; - UINT8 *m_soundbank_ptr; /* Pointer to currently selected portion of ROM */ + uint8_t *m_soundbank_ptr; /* Pointer to currently selected portion of ROM */ /* sys18 */ - UINT8 *m_sound_bank; - UINT16 *m_splittab_bg_x; - UINT16 *m_splittab_bg_y; - UINT16 *m_splittab_fg_x; - UINT16 *m_splittab_fg_y; + uint8_t *m_sound_bank; + uint16_t *m_splittab_bg_x; + uint16_t *m_splittab_bg_y; + uint16_t *m_splittab_fg_x; + uint16_t *m_splittab_fg_y; int m_sound_info[4*2]; int m_refreshenable; int m_system18; - UINT8 *m_decrypted_region; // goldnaxeb1 & bayrouteb1 + uint8_t *m_decrypted_region; // goldnaxeb1 & bayrouteb1 /* devices */ required_device m_maincpu; @@ -123,7 +123,7 @@ public: optional_device m_upd7759; required_device m_gfxdecode; optional_device m_soundlatch; - optional_shared_ptr m_decrypted_opcodes; + optional_shared_ptr m_decrypted_opcodes; DECLARE_WRITE16_MEMBER(sound_command_nmi_w); DECLARE_WRITE16_MEMBER(sound_command_irq_w); @@ -207,10 +207,10 @@ public: DECLARE_VIDEO_START(s16a_bootleg_passsht); DECLARE_VIDEO_START(s16a_bootleg_wb3bl); DECLARE_VIDEO_START(s16a_bootleg); - UINT32 screen_update_system16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_system18old(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_s16a_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_s16a_bootleg_passht4b(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_system16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_system18old(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_s16a_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_s16a_bootleg_passht4b(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void setup_system16_bootleg_spritebanking( ); void update_page( ); void set_tile_bank( int data ); diff --git a/src/mame/includes/tagteam.h b/src/mame/includes/tagteam.h index b74f9cc2179..c45fef5705a 100644 --- a/src/mame/includes/tagteam.h +++ b/src/mame/includes/tagteam.h @@ -22,12 +22,12 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; int m_palettebank; tilemap_t *m_bg_tilemap; - UINT8 m_sound_nmi_mask; + uint8_t m_sound_nmi_mask; DECLARE_WRITE8_MEMBER(sound_command_w); DECLARE_WRITE8_MEMBER(irq_clear_w); @@ -50,6 +50,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(tagteam); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/tail2nos.h b/src/mame/includes/tail2nos.h index 048ec3f2eb4..e9aa92d5205 100644 --- a/src/mame/includes/tail2nos.h +++ b/src/mame/includes/tail2nos.h @@ -25,9 +25,9 @@ public: m_soundlatch(*this, "soundlatch") { } /* memory pointers */ - required_shared_ptr m_txvideoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_zoomram; + required_shared_ptr m_txvideoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_zoomram; /* video-related */ tilemap_t *m_tx_tilemap; @@ -52,7 +52,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_tail2nos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tail2nos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void tail2nos_postload(); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); K051316_CB_MEMBER(zoom_callback); diff --git a/src/mame/includes/taito_b.h b/src/mame/includes/taito_b.h index 569f797c8bc..84c424886fc 100644 --- a/src/mame/includes/taito_b.h +++ b/src/mame/includes/taito_b.h @@ -40,8 +40,8 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - optional_shared_ptr m_pixelram; + required_shared_ptr m_spriteram; + optional_shared_ptr m_pixelram; /* video-related */ /* framebuffer is a raw bitmap, remapped as a last step */ @@ -49,16 +49,16 @@ public: std::unique_ptr m_pixel_bitmap; std::unique_ptr m_realpunc_bitmap; - UINT16 m_pixel_scroll[2]; + uint16_t m_pixel_scroll[2]; int m_b_fg_color_base; int m_b_sp_color_base; /* misc */ - UINT16 m_eep_latch; - UINT16 m_coin_word; + uint16_t m_eep_latch; + uint16_t m_coin_word; - UINT16 m_realpunc_video_ctrl; + uint16_t m_realpunc_video_ctrl; /* devices */ required_device m_maincpu; @@ -108,8 +108,8 @@ public: DECLARE_VIDEO_RESET(hitice); DECLARE_VIDEO_START(realpunc); DECLARE_VIDEO_START(taitob_core); - UINT32 screen_update_taitob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_realpunc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_realpunc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_taitob(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(rastansaga2_interrupt); INTERRUPT_GEN_MEMBER(crimec_interrupt); diff --git a/src/mame/includes/taito_f2.h b/src/mame/includes/taito_f2.h index d417a7655e2..fa6f34f6638 100644 --- a/src/mame/includes/taito_f2.h +++ b/src/mame/includes/taito_f2.h @@ -48,52 +48,52 @@ public: { } /* memory pointers */ - optional_shared_ptr m_sprite_extension; - required_shared_ptr m_spriteram; - std::unique_ptr m_spriteram_buffered; - std::unique_ptr m_spriteram_delayed; - optional_shared_ptr m_cchip2_ram; // for megablst only + optional_shared_ptr m_sprite_extension; + required_shared_ptr m_spriteram; + std::unique_ptr m_spriteram_buffered; + std::unique_ptr m_spriteram_delayed; + optional_shared_ptr m_cchip2_ram; // for megablst only /* video-related */ std::unique_ptr m_spritelist; int m_sprite_type; - UINT16 m_spritebank[8]; -// UINT16 m_spritebank_eof[8]; - UINT16 m_spritebank_buffered[8]; + uint16_t m_spritebank[8]; +// uint16_t m_spritebank_eof[8]; + uint16_t m_spritebank_buffered[8]; - INT32 m_sprites_disabled; - INT32 m_sprites_active_area; - INT32 m_sprites_master_scrollx; - INT32 m_sprites_master_scrolly; + int32_t m_sprites_disabled; + int32_t m_sprites_active_area; + int32_t m_sprites_master_scrollx; + int32_t m_sprites_master_scrolly; /* remember flip status over frames because driftout can fail to set it */ - INT32 m_sprites_flipscreen; + int32_t m_sprites_flipscreen; /* On the left hand screen edge (assuming horiz screen, no screenflip: in screenflip it is the right hand edge etc.) there may be 0-3 unwanted pixels in both tilemaps *and* sprites. To erase this we use f2_hide_pixels (0 to +3). */ - INT32 m_hide_pixels; - INT32 m_flip_hide_pixels; /* Different in some games */ + int32_t m_hide_pixels; + int32_t m_flip_hide_pixels; /* Different in some games */ - INT32 m_pivot_xdisp; /* Needed in games with a pivot layer */ - INT32 m_pivot_ydisp; + int32_t m_pivot_xdisp; /* Needed in games with a pivot layer */ + int32_t m_pivot_ydisp; - INT32 m_game; + int32_t m_game; - UINT8 m_tilepri[6]; // todo - move into taitoic.c - UINT8 m_spritepri[6]; // todo - move into taitoic.c - UINT8 m_spriteblendmode; // todo - move into taitoic.c + uint8_t m_tilepri[6]; // todo - move into taitoic.c + uint8_t m_spritepri[6]; // todo - move into taitoic.c + uint8_t m_spriteblendmode; // todo - move into taitoic.c int m_prepare_sprites; /* misc */ - INT32 m_mjnquest_input; + int32_t m_mjnquest_input; int m_last[2]; int m_nibble; - INT32 m_driveout_sound_latch; - INT32 m_oki_bank; + int32_t m_driveout_sound_latch; + int32_t m_oki_bank; emu_timer *m_int6_timer; /* devices */ @@ -161,14 +161,14 @@ public: DECLARE_VIDEO_START(taitof2_deadconxj); DECLARE_VIDEO_START(taitof2_dinorex); DECLARE_VIDEO_START(taitof2_quiz); - UINT32 screen_update_taitof2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_taitof2_pri_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_taitof2_pri(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_taitof2_thundfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_taitof2_ssi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_taitof2_deadconx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_taitof2_yesnoj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_taitof2_metalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitof2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitof2_pri_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitof2_pri(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitof2_thundfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitof2_ssi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitof2_deadconx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitof2_yesnoj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitof2_metalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_taitof2_no_buffer(screen_device &screen, bool state); void screen_eof_taitof2_partial_buffer_delayed(screen_device &screen, bool state); void screen_eof_taitof2_partial_buffer_delayed_thundfox(screen_device &screen, bool state); @@ -181,9 +181,9 @@ public: void update_spritebanks( ); void taitof2_handle_sprite_buffering( ); void taitof2_update_sprites_active_area( ); - void draw_roz_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 priority); + void draw_roz_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t priority); void taito_f2_tc360_spritemixdraw(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, int scalex, int scaley ); + uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley ); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; diff --git a/src/mame/includes/taito_f3.h b/src/mame/includes/taito_f3.h index 7c4f2afe9bf..9c09448cfad 100644 --- a/src/mame/includes/taito_f3.h +++ b/src/mame/includes/taito_f3.h @@ -78,21 +78,21 @@ public: required_device m_screen; required_device m_palette; - optional_shared_ptr m_f3_ram; - optional_shared_ptr m_paletteram32; + optional_shared_ptr m_f3_ram; + optional_shared_ptr m_paletteram32; optional_ioport_array<6> m_input; optional_ioport_array<2> m_dial; optional_ioport m_eepromin; - std::unique_ptr m_videoram; - std::unique_ptr m_spriteram; - std::unique_ptr m_f3_vram; - std::unique_ptr m_f3_line_ram; - std::unique_ptr m_f3_pf_data; - std::unique_ptr m_f3_pivot_ram; + std::unique_ptr m_videoram; + std::unique_ptr m_spriteram; + std::unique_ptr m_f3_vram; + std::unique_ptr m_f3_line_ram; + std::unique_ptr m_f3_pf_data; + std::unique_ptr m_f3_pivot_ram; - UINT32 m_coin_word[2]; + uint32_t m_coin_word[2]; int m_f3_game; tilemap_t *m_pf1_tilemap; tilemap_t *m_pf2_tilemap; @@ -104,23 +104,23 @@ public: tilemap_t *m_pf8_tilemap; tilemap_t *m_pixel_layer; tilemap_t *m_vram_layer; - std::unique_ptr m_spriteram16_buffered; - UINT16 m_f3_control_0[8]; - UINT16 m_f3_control_1[8]; + std::unique_ptr m_spriteram16_buffered; + uint16_t m_f3_control_0[8]; + uint16_t m_f3_control_1[8]; int m_flipscreen; - UINT8 m_sprite_extra_planes; - UINT8 m_sprite_pen_mask; - UINT16 *m_f3_pf_data_1; - UINT16 *m_f3_pf_data_2; - UINT16 *m_f3_pf_data_3; - UINT16 *m_f3_pf_data_4; - UINT16 *m_f3_pf_data_5; - UINT16 *m_f3_pf_data_6; - UINT16 *m_f3_pf_data_7; - UINT16 *m_f3_pf_data_8; + uint8_t m_sprite_extra_planes; + uint8_t m_sprite_pen_mask; + uint16_t *m_f3_pf_data_1; + uint16_t *m_f3_pf_data_2; + uint16_t *m_f3_pf_data_3; + uint16_t *m_f3_pf_data_4; + uint16_t *m_f3_pf_data_5; + uint16_t *m_f3_pf_data_6; + uint16_t *m_f3_pf_data_7; + uint16_t *m_f3_pf_data_8; int m_f3_skip_this_frame; int m_sprite_lag; - UINT8 m_sprite_pri_usage; + uint8_t m_sprite_pri_usage; bitmap_ind8 m_pri_alp_bitmap; int m_f3_alpha_level_2as; int m_f3_alpha_level_2ad; @@ -134,9 +134,9 @@ public: int m_width_mask; int m_twidth_mask; int m_twidth_mask_bit; - std::unique_ptr m_tile_opaque_sp; - std::unique_ptr m_tile_opaque_pf[8]; - UINT8 m_add_sat[256][256]; + std::unique_ptr m_tile_opaque_sp; + std::unique_ptr m_tile_opaque_pf[8]; + uint8_t m_add_sat[256][256]; int m_alpha_s_1_1; int m_alpha_s_1_2; int m_alpha_s_1_4; @@ -157,80 +157,80 @@ public: int m_alpha_s_3b_0; int m_alpha_s_3b_1; int m_alpha_s_3b_2; - UINT32 m_dval; - UINT8 m_pval; - UINT8 m_tval; - UINT8 m_pdest_2a; - UINT8 m_pdest_2b; + uint32_t m_dval; + uint8_t m_pval; + uint8_t m_tval; + uint8_t m_pdest_2a; + uint8_t m_pdest_2b; int m_tr_2a; int m_tr_2b; - UINT8 m_pdest_3a; - UINT8 m_pdest_3b; + uint8_t m_pdest_3a; + uint8_t m_pdest_3b; int m_tr_3a; int m_tr_3b; - UINT16 *m_src0; - UINT16 *m_src_s0; - UINT16 *m_src_e0; - UINT16 m_clip_al0; - UINT16 m_clip_ar0; - UINT16 m_clip_bl0; - UINT16 m_clip_br0; - UINT8 *m_tsrc0; - UINT8 *m_tsrc_s0; - UINT32 m_x_count0; - UINT32 m_x_zoom0; - UINT16 *m_src1; - UINT16 *m_src_s1; - UINT16 *m_src_e1; - UINT16 m_clip_al1; - UINT16 m_clip_ar1; - UINT16 m_clip_bl1; - UINT16 m_clip_br1; - UINT8 *m_tsrc1; - UINT8 *m_tsrc_s1; - UINT32 m_x_count1; - UINT32 m_x_zoom1; - UINT16 *m_src2; - UINT16 *m_src_s2; - UINT16 *m_src_e2; - UINT16 m_clip_al2; - UINT16 m_clip_ar2; - UINT16 m_clip_bl2; - UINT16 m_clip_br2; - UINT8 *m_tsrc2; - UINT8 *m_tsrc_s2; - UINT32 m_x_count2; - UINT32 m_x_zoom2; - UINT16 *m_src3; - UINT16 *m_src_s3; - UINT16 *m_src_e3; - UINT16 m_clip_al3; - UINT16 m_clip_ar3; - UINT16 m_clip_bl3; - UINT16 m_clip_br3; - UINT8 *m_tsrc3; - UINT8 *m_tsrc_s3; - UINT32 m_x_count3; - UINT32 m_x_zoom3; - UINT16 *m_src4; - UINT16 *m_src_s4; - UINT16 *m_src_e4; - UINT16 m_clip_al4; - UINT16 m_clip_ar4; - UINT16 m_clip_bl4; - UINT16 m_clip_br4; - UINT8 *m_tsrc4; - UINT8 *m_tsrc_s4; - UINT32 m_x_count4; - UINT32 m_x_zoom4; + uint16_t *m_src0; + uint16_t *m_src_s0; + uint16_t *m_src_e0; + uint16_t m_clip_al0; + uint16_t m_clip_ar0; + uint16_t m_clip_bl0; + uint16_t m_clip_br0; + uint8_t *m_tsrc0; + uint8_t *m_tsrc_s0; + uint32_t m_x_count0; + uint32_t m_x_zoom0; + uint16_t *m_src1; + uint16_t *m_src_s1; + uint16_t *m_src_e1; + uint16_t m_clip_al1; + uint16_t m_clip_ar1; + uint16_t m_clip_bl1; + uint16_t m_clip_br1; + uint8_t *m_tsrc1; + uint8_t *m_tsrc_s1; + uint32_t m_x_count1; + uint32_t m_x_zoom1; + uint16_t *m_src2; + uint16_t *m_src_s2; + uint16_t *m_src_e2; + uint16_t m_clip_al2; + uint16_t m_clip_ar2; + uint16_t m_clip_bl2; + uint16_t m_clip_br2; + uint8_t *m_tsrc2; + uint8_t *m_tsrc_s2; + uint32_t m_x_count2; + uint32_t m_x_zoom2; + uint16_t *m_src3; + uint16_t *m_src_s3; + uint16_t *m_src_e3; + uint16_t m_clip_al3; + uint16_t m_clip_ar3; + uint16_t m_clip_bl3; + uint16_t m_clip_br3; + uint8_t *m_tsrc3; + uint8_t *m_tsrc_s3; + uint32_t m_x_count3; + uint32_t m_x_zoom3; + uint16_t *m_src4; + uint16_t *m_src_s4; + uint16_t *m_src_e4; + uint16_t m_clip_al4; + uint16_t m_clip_ar4; + uint16_t m_clip_bl4; + uint16_t m_clip_br4; + uint8_t *m_tsrc4; + uint8_t *m_tsrc_s4; + uint32_t m_x_count4; + uint32_t m_x_zoom4; struct tempsprite *m_spritelist; const struct tempsprite *m_sprite_end; struct f3_playfield_line_inf *m_pf_line_inf; struct f3_spritealpha_line_inf *m_sa_line_inf; const struct F3config *m_f3_game_config; - int (taito_f3_state::*m_dpix_n[8][16])(UINT32 s_pix); - int (taito_f3_state::**m_dpix_lp[5])(UINT32 s_pix); - int (taito_f3_state::**m_dpix_sp[9])(UINT32 s_pix); + int (taito_f3_state::*m_dpix_n[8][16])(uint32_t s_pix); + int (taito_f3_state::**m_dpix_lp[5])(uint32_t s_pix); + int (taito_f3_state::**m_dpix_sp[9])(uint32_t s_pix); DECLARE_READ32_MEMBER(f3_control_r); DECLARE_WRITE32_MEMBER(f3_control_w); @@ -309,7 +309,7 @@ public: DECLARE_MACHINE_START(f3); DECLARE_MACHINE_RESET(f3); DECLARE_VIDEO_START(f3); - UINT32 screen_update_f3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_f3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void screen_eof_f3(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(f3_interrupt2); @@ -317,72 +317,72 @@ protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - inline void get_tile_info(tile_data &tileinfo, int tile_index, UINT16 *gfx_base); - inline void f3_drawgfx(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,int code,int color,int flipx,int flipy,int sx,int sy,UINT8 pri_dst); - inline void f3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,int code,int color,int flipx,int flipy,int sx,int sy,int scalex,int scaley,UINT8 pri_dst); + inline void get_tile_info(tile_data &tileinfo, int tile_index, uint16_t *gfx_base); + inline void f3_drawgfx(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,int code,int color,int flipx,int flipy,int sx,int sy,uint8_t pri_dst); + inline void f3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,int code,int color,int flipx,int flipy,int sx,int sy,int scalex,int scaley,uint8_t pri_dst); void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); - void get_sprite_info(const UINT16 *spriteram16_ptr); + void get_sprite_info(const uint16_t *spriteram16_ptr); void print_debug_info(bitmap_rgb32 &bitmap); inline void f3_alpha_set_level(); - inline void f3_alpha_blend32_s(int alphas, UINT32 s); - inline void f3_alpha_blend32_d(int alphas, UINT32 s); - inline void f3_alpha_blend_1_1(UINT32 s); - inline void f3_alpha_blend_1_2(UINT32 s); - inline void f3_alpha_blend_1_4(UINT32 s); - inline void f3_alpha_blend_1_5(UINT32 s); - inline void f3_alpha_blend_1_6(UINT32 s); - inline void f3_alpha_blend_1_8(UINT32 s); - inline void f3_alpha_blend_1_9(UINT32 s); - inline void f3_alpha_blend_1_a(UINT32 s); - inline void f3_alpha_blend_2a_0(UINT32 s); - inline void f3_alpha_blend_2a_4(UINT32 s); - inline void f3_alpha_blend_2a_8(UINT32 s); - inline void f3_alpha_blend_2b_0(UINT32 s); - inline void f3_alpha_blend_2b_4(UINT32 s); - inline void f3_alpha_blend_2b_8(UINT32 s); - inline void f3_alpha_blend_3a_0(UINT32 s); - inline void f3_alpha_blend_3a_1(UINT32 s); - inline void f3_alpha_blend_3a_2(UINT32 s); - inline void f3_alpha_blend_3b_0(UINT32 s); - inline void f3_alpha_blend_3b_1(UINT32 s); - inline void f3_alpha_blend_3b_2(UINT32 s); - int dpix_1_noalpha(UINT32 s_pix); - int dpix_ret1(UINT32 s_pix); - int dpix_ret0(UINT32 s_pix); - int dpix_1_1(UINT32 s_pix); - int dpix_1_2(UINT32 s_pix); - int dpix_1_4(UINT32 s_pix); - int dpix_1_5(UINT32 s_pix); - int dpix_1_6(UINT32 s_pix); - int dpix_1_8(UINT32 s_pix); - int dpix_1_9(UINT32 s_pix); - int dpix_1_a(UINT32 s_pix); - int dpix_2a_0(UINT32 s_pix); - int dpix_2a_4(UINT32 s_pix); - int dpix_2a_8(UINT32 s_pix); - int dpix_3a_0(UINT32 s_pix); - int dpix_3a_1(UINT32 s_pix); - int dpix_3a_2(UINT32 s_pix); - int dpix_2b_0(UINT32 s_pix); - int dpix_2b_4(UINT32 s_pix); - int dpix_2b_8(UINT32 s_pix); - int dpix_3b_0(UINT32 s_pix); - int dpix_3b_1(UINT32 s_pix); - int dpix_3b_2(UINT32 s_pix); - int dpix_2_0(UINT32 s_pix); - int dpix_2_4(UINT32 s_pix); - int dpix_2_8(UINT32 s_pix); - int dpix_3_0(UINT32 s_pix); - int dpix_3_1(UINT32 s_pix); - int dpix_3_2(UINT32 s_pix); - inline void dpix_1_sprite(UINT32 s_pix); - inline void dpix_bg(UINT32 bgcolor); + inline void f3_alpha_blend32_s(int alphas, uint32_t s); + inline void f3_alpha_blend32_d(int alphas, uint32_t s); + inline void f3_alpha_blend_1_1(uint32_t s); + inline void f3_alpha_blend_1_2(uint32_t s); + inline void f3_alpha_blend_1_4(uint32_t s); + inline void f3_alpha_blend_1_5(uint32_t s); + inline void f3_alpha_blend_1_6(uint32_t s); + inline void f3_alpha_blend_1_8(uint32_t s); + inline void f3_alpha_blend_1_9(uint32_t s); + inline void f3_alpha_blend_1_a(uint32_t s); + inline void f3_alpha_blend_2a_0(uint32_t s); + inline void f3_alpha_blend_2a_4(uint32_t s); + inline void f3_alpha_blend_2a_8(uint32_t s); + inline void f3_alpha_blend_2b_0(uint32_t s); + inline void f3_alpha_blend_2b_4(uint32_t s); + inline void f3_alpha_blend_2b_8(uint32_t s); + inline void f3_alpha_blend_3a_0(uint32_t s); + inline void f3_alpha_blend_3a_1(uint32_t s); + inline void f3_alpha_blend_3a_2(uint32_t s); + inline void f3_alpha_blend_3b_0(uint32_t s); + inline void f3_alpha_blend_3b_1(uint32_t s); + inline void f3_alpha_blend_3b_2(uint32_t s); + int dpix_1_noalpha(uint32_t s_pix); + int dpix_ret1(uint32_t s_pix); + int dpix_ret0(uint32_t s_pix); + int dpix_1_1(uint32_t s_pix); + int dpix_1_2(uint32_t s_pix); + int dpix_1_4(uint32_t s_pix); + int dpix_1_5(uint32_t s_pix); + int dpix_1_6(uint32_t s_pix); + int dpix_1_8(uint32_t s_pix); + int dpix_1_9(uint32_t s_pix); + int dpix_1_a(uint32_t s_pix); + int dpix_2a_0(uint32_t s_pix); + int dpix_2a_4(uint32_t s_pix); + int dpix_2a_8(uint32_t s_pix); + int dpix_3a_0(uint32_t s_pix); + int dpix_3a_1(uint32_t s_pix); + int dpix_3a_2(uint32_t s_pix); + int dpix_2b_0(uint32_t s_pix); + int dpix_2b_4(uint32_t s_pix); + int dpix_2b_8(uint32_t s_pix); + int dpix_3b_0(uint32_t s_pix); + int dpix_3b_1(uint32_t s_pix); + int dpix_3b_2(uint32_t s_pix); + int dpix_2_0(uint32_t s_pix); + int dpix_2_4(uint32_t s_pix); + int dpix_2_8(uint32_t s_pix); + int dpix_3_0(uint32_t s_pix); + int dpix_3_1(uint32_t s_pix); + int dpix_3_2(uint32_t s_pix); + inline void dpix_1_sprite(uint32_t s_pix); + inline void dpix_bg(uint32_t bgcolor); void init_alpha_blend_func(); - inline void draw_scanlines(bitmap_rgb32 &bitmap, int xsize, INT16 *draw_line_num, const struct f3_playfield_line_inf **line_t, const int *sprite, UINT32 orient, int skip_layer_num); - void visible_tile_check(struct f3_playfield_line_inf *line_t, int line, UINT32 x_index_fx,UINT32 y_index, UINT16 *f3_pf_data_n); - void calculate_clip(int y, UINT16 pri, UINT32* clip0, UINT32* clip1, int* line_enable); + inline void draw_scanlines(bitmap_rgb32 &bitmap, int xsize, int16_t *draw_line_num, const struct f3_playfield_line_inf **line_t, const int *sprite, uint32_t orient, int skip_layer_num); + void visible_tile_check(struct f3_playfield_line_inf *line_t, int line, uint32_t x_index_fx,uint32_t y_index, uint16_t *f3_pf_data_n); + void calculate_clip(int y, uint16_t pri, uint32_t* clip0, uint32_t* clip1, int* line_enable); void get_spritealphaclip_info(); - void get_line_ram_info(tilemap_t *tmap, int sx, int sy, int pos, UINT16 *f3_pf_data_n); + void get_line_ram_info(tilemap_t *tmap, int sx, int sy, int pos, uint16_t *f3_pf_data_n); void get_vram_info(tilemap_t *vram_tilemap, tilemap_t *pixel_tilemap, int sx, int sy); void scanline_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/taito_h.h b/src/mame/includes/taito_h.h index 48eccf26833..8d78f43dca0 100644 --- a/src/mame/includes/taito_h.h +++ b/src/mame/includes/taito_h.h @@ -23,7 +23,7 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_m68000_mainram; + required_shared_ptr m_m68000_mainram; /* devices */ required_device m_maincpu; @@ -37,9 +37,9 @@ public: DECLARE_WRITE8_MEMBER(sound_bankswitch_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_syvalion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_recordbr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dleague(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_syvalion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_recordbr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dleague(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void syvalion_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void recordbr_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); void dleague_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); diff --git a/src/mame/includes/taito_l.h b/src/mame/includes/taito_l.h index 34e43bbeaf5..883cb85bc03 100644 --- a/src/mame/includes/taito_l.h +++ b/src/mame/includes/taito_l.h @@ -19,13 +19,13 @@ public: } /* memory pointers */ - UINT8 * m_shared_ram; + uint8_t * m_shared_ram; /* video-related */ tilemap_t *m_bg18_tilemap; tilemap_t *m_bg19_tilemap; tilemap_t *m_ch1a_tilemap; - UINT8 m_buff_spriteram[TAITOL_SPRITERAM_SIZE]; + uint8_t m_buff_spriteram[TAITOL_SPRITERAM_SIZE]; int m_cur_ctrl; int m_horshoes_gfxbank; int m_bankc[4]; @@ -33,7 +33,7 @@ public: /* misc */ void (taitol_state::*m_current_notifier[4])(int); - UINT8 *m_current_base[4]; + uint8_t *m_current_base[4]; int m_cur_rombank; int m_cur_rombank2; @@ -53,7 +53,7 @@ public: int m_last_data; int m_cur_bank; - const UINT8 *m_mcu_reply; + const uint8_t *m_mcu_reply; int m_mcu_pos; int m_mcu_reply_len; @@ -70,9 +70,9 @@ public: required_device m_palette; /* memory buffers */ - UINT8 m_rambanks[0x1000 * 12]; - UINT8 m_palette_ram[0x1000]; - UINT8 m_empty_ram[0x1000]; + uint8_t m_rambanks[0x1000 * 12]; + uint8_t m_palette_ram[0x1000]; + uint8_t m_empty_ram[0x1000]; DECLARE_WRITE8_MEMBER(irq_adr_w); DECLARE_READ8_MEMBER(irq_adr_r); DECLARE_WRITE8_MEMBER(irq_enable_w); @@ -132,7 +132,7 @@ public: DECLARE_MACHINE_RESET(horshoes); DECLARE_MACHINE_RESET(palamed); DECLARE_MACHINE_RESET(cachat); - UINT32 screen_update_taitol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_taitol(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(vbl_interrupt); IRQ_CALLBACK_MEMBER(irq_callback); @@ -152,6 +152,6 @@ public: void palette_notifier(int addr); void state_register( ); void taito_machine_reset(); - void bank_w(address_space &space, offs_t offset, UINT8 data, int banknum ); + void bank_w(address_space &space, offs_t offset, uint8_t data, int banknum ); DECLARE_WRITE_LINE_MEMBER(champwr_msm5205_vck); }; diff --git a/src/mame/includes/taito_o.h b/src/mame/includes/taito_o.h index 5f0b4a9011e..a3ae26b3e5e 100644 --- a/src/mame/includes/taito_o.h +++ b/src/mame/includes/taito_o.h @@ -30,7 +30,7 @@ public: DECLARE_WRITE16_MEMBER(io_w); DECLARE_READ16_MEMBER(io_r); virtual void machine_start() override; - UINT32 screen_update_parentj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_parentj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(parentj_interrupt); void parentj_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); }; diff --git a/src/mame/includes/taito_x.h b/src/mame/includes/taito_x.h index 700eb457b30..9c9453d1f63 100644 --- a/src/mame/includes/taito_x.h +++ b/src/mame/includes/taito_x.h @@ -19,8 +19,8 @@ public: DECLARE_MACHINE_START(superman); // superman c-chip - UINT16 m_current_bank; - UINT8 m_cc_port; + uint16_t m_current_bank; + uint8_t m_cc_port; DECLARE_READ16_MEMBER( cchip1_ctrl_r ); DECLARE_READ16_MEMBER( cchip1_ram_r ); DECLARE_WRITE16_MEMBER( cchip1_ctrl_w ); diff --git a/src/mame/includes/taito_z.h b/src/mame/includes/taito_z.h index a10f8f12c0f..0433a0fadd1 100644 --- a/src/mame/includes/taito_z.h +++ b/src/mame/includes/taito_z.h @@ -43,17 +43,17 @@ public: m_steer(*this, "STEER") { } /* memory pointers */ - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; /* video-related */ int m_sci_spriteframe; int m_road_palbank; /* misc */ - UINT16 m_cpua_ctrl; - INT32 m_sci_int6; - INT32 m_ioc220_port; - UINT16 m_eep_latch; + uint16_t m_cpua_ctrl; + int32_t m_sci_int6; + int32_t m_ioc220_port; + uint16_t m_eep_latch; /* devices */ required_device m_maincpu; @@ -104,14 +104,14 @@ public: DECLARE_MACHINE_RESET(taitoz); DECLARE_VIDEO_START(taitoz); DECLARE_MACHINE_START(bshark); - UINT32 screen_update_contcirc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_chasehq(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sci(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_aquajack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_spacegun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dblaxle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_racingb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_contcirc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_chasehq(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sci(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_aquajack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_spacegun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dblaxle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_racingb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sci_interrupt); void contcirc_draw_sprites_16x8( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs ); void chasehq_draw_sprites_16x16( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs ); diff --git a/src/mame/includes/taitoair.h b/src/mame/includes/taitoair.h index f244d4dd4a2..13277cf57cf 100644 --- a/src/mame/includes/taitoair.h +++ b/src/mame/includes/taitoair.h @@ -12,13 +12,13 @@ enum { TAITOAIR_FRAC_SHIFT = 16, TAITOAIR_POLY_MAX_PT = 16 }; struct taitoair_spoint { - INT32 x, y; + int32_t x, y; }; struct taitoair_poly { struct taitoair_spoint p[TAITOAIR_POLY_MAX_PT]; int pcount; - UINT16 header; + uint16_t header; }; @@ -44,12 +44,12 @@ public: { } /* memory pointers */ - required_shared_ptr m_m68000_mainram; - required_shared_ptr m_line_ram; - required_shared_ptr m_dsp_ram; // Shared 68000/TMS32025 RAM - required_shared_ptr m_paletteram; - required_shared_ptr m_gradram; - required_shared_ptr m_tc0430grw; + required_shared_ptr m_m68000_mainram; + required_shared_ptr m_line_ram; + required_shared_ptr m_dsp_ram; // Shared 68000/TMS32025 RAM + required_shared_ptr m_paletteram; + required_shared_ptr m_gradram; + required_shared_ptr m_tc0430grw; /* video-related */ taitoair_poly m_q; @@ -70,15 +70,15 @@ public: std::unique_ptr m_framebuffer[2]; /* 3d info */ - INT16 m_frustumLeft; - INT16 m_frustumBottom; - INT16 m_eyecoordBuffer[4]; /* homogeneous */ + int16_t m_frustumLeft; + int16_t m_frustumBottom; + int16_t m_eyecoordBuffer[4]; /* homogeneous */ bool m_gradbank; - UINT16 m_dsp_test_object_type; - INT16 m_dsp_test_or_clip, m_dsp_test_and_clip; - INT16 m_dsp_test_x, m_dsp_test_y, m_dsp_test_z; + uint16_t m_dsp_test_object_type; + int16_t m_dsp_test_or_clip, m_dsp_test_and_clip; + int16_t m_dsp_test_x, m_dsp_test_y, m_dsp_test_z; DECLARE_WRITE16_MEMBER(dsp_test_start_w); DECLARE_WRITE16_MEMBER(dsp_test_x_w); @@ -88,14 +88,14 @@ public: DECLARE_READ16_MEMBER(dsp_test_or_clip_r); DECLARE_READ16_MEMBER(dsp_test_and_clip_r); - INT16 m_dsp_muldiv_a_1, m_dsp_muldiv_b_1, m_dsp_muldiv_c_1; + int16_t m_dsp_muldiv_a_1, m_dsp_muldiv_b_1, m_dsp_muldiv_c_1; DECLARE_WRITE16_MEMBER(dsp_muldiv_a_1_w); DECLARE_WRITE16_MEMBER(dsp_muldiv_b_1_w); DECLARE_WRITE16_MEMBER(dsp_muldiv_c_1_w); DECLARE_READ16_MEMBER(dsp_muldiv_1_r); - INT16 m_dsp_muldiv_a_2, m_dsp_muldiv_b_2, m_dsp_muldiv_c_2; + int16_t m_dsp_muldiv_a_2, m_dsp_muldiv_b_2, m_dsp_muldiv_c_2; DECLARE_WRITE16_MEMBER(dsp_muldiv_a_2_w); DECLARE_WRITE16_MEMBER(dsp_muldiv_b_2_w); @@ -121,13 +121,13 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_taitoair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitoair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); int draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); int draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset ); void fb_copy_op(void); void fb_fill_op(void); void fb_erase_op(void); - void fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 header, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2 ); + void fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t header, int32_t x1, int32_t x2, int32_t sl1, int32_t sl2, int32_t y1, int32_t y2, int32_t *nx1, int32_t *nx2 ); void fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect, const struct taitoair_poly *q ); }; diff --git a/src/mame/includes/taitojc.h b/src/mame/includes/taitojc.h index 6164f2d6f64..5c43f2174e3 100644 --- a/src/mame/includes/taitojc.h +++ b/src/mame/includes/taitojc.h @@ -41,12 +41,12 @@ public: required_device m_tc0640fio; required_memory_region m_gfx2; - required_shared_ptr m_vram; - required_shared_ptr m_objlist; - required_shared_ptr m_snd_shared_ram; - required_shared_ptr m_main_ram; - required_shared_ptr m_dsp_shared_ram; - required_shared_ptr m_palette_ram; + required_shared_ptr m_vram; + required_shared_ptr m_objlist; + required_shared_ptr m_snd_shared_ram; + required_shared_ptr m_main_ram; + required_shared_ptr m_dsp_shared_ram; + required_shared_ptr m_palette_ram; required_device m_gfxdecode; required_device m_screen; @@ -55,26 +55,26 @@ public: required_device m_tc0780fpa; - UINT32 m_dsp_rom_pos; + uint32_t m_dsp_rom_pos; int m_first_dsp_reset; - INT16 m_viewport_data[3]; - INT16 m_projection_data[3]; - INT16 m_intersection_data[3]; + int16_t m_viewport_data[3]; + int16_t m_projection_data[3]; + int16_t m_intersection_data[3]; int m_gfx_index; - std::unique_ptr m_char_ram; - std::unique_ptr m_tile_ram; + std::unique_ptr m_char_ram; + std::unique_ptr m_tile_ram; tilemap_t *m_tilemap; - UINT8 m_mcu_comm_main; - UINT8 m_mcu_comm_hc11; - UINT8 m_mcu_data_main; - UINT8 m_mcu_data_hc11; - UINT8 m_mcu_output; + uint8_t m_mcu_comm_main; + uint8_t m_mcu_comm_hc11; + uint8_t m_mcu_data_main; + uint8_t m_mcu_data_hc11; + uint8_t m_mcu_output; - UINT8 m_has_dsp_hack; + uint8_t m_has_dsp_hack; int m_speed_meter; int m_brake_meter; @@ -131,9 +131,9 @@ public: virtual void machine_reset() override; virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update_taitojc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dendego(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitojc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dendego(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(taitojc_vblank); - void draw_object(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 w1, UINT32 w2, UINT8 bank_type); - void draw_object_bank(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 bank_type, UINT8 pri); + void draw_object(bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t w1, uint32_t w2, uint8_t bank_type); + void draw_object_bank(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t bank_type, uint8_t pri); }; diff --git a/src/mame/includes/taitosj.h b/src/mame/includes/taitosj.h index c5fd9f30ca8..26aecd35e43 100644 --- a/src/mame/includes/taitosj.h +++ b/src/mame/includes/taitosj.h @@ -41,32 +41,32 @@ public: typedef void (taitosj_state::*copy_layer_func_t)(bitmap_ind16 &, const rectangle &, int, int *, rectangle *); - UINT8 m_input_port_4_f0; - UINT8 m_kikstart_gears[2]; - required_shared_ptr m_videoram_1; - required_shared_ptr m_videoram_2; - required_shared_ptr m_videoram_3; - required_shared_ptr m_spriteram; - required_shared_ptr m_paletteram; - required_shared_ptr m_characterram; - required_shared_ptr m_scroll; - required_shared_ptr m_colscrolly; - required_shared_ptr m_gfxpointer; - required_shared_ptr m_colorbank; - required_shared_ptr m_video_mode; - required_shared_ptr m_video_priority; - required_shared_ptr m_collision_reg; - optional_shared_ptr m_kikstart_scrollram; - UINT8 m_fromz80; - UINT8 m_toz80; - UINT8 m_zaccept; - UINT8 m_zready; - UINT8 m_busreq; - UINT8 m_portA_in; - UINT8 m_portA_out; - UINT8 m_spacecr_prot_value; - UINT8 m_protection_value; - UINT32 m_address; + uint8_t m_input_port_4_f0; + uint8_t m_kikstart_gears[2]; + required_shared_ptr m_videoram_1; + required_shared_ptr m_videoram_2; + required_shared_ptr m_videoram_3; + required_shared_ptr m_spriteram; + required_shared_ptr m_paletteram; + required_shared_ptr m_characterram; + required_shared_ptr m_scroll; + required_shared_ptr m_colscrolly; + required_shared_ptr m_gfxpointer; + required_shared_ptr m_colorbank; + required_shared_ptr m_video_mode; + required_shared_ptr m_video_priority; + required_shared_ptr m_collision_reg; + optional_shared_ptr m_kikstart_scrollram; + uint8_t m_fromz80; + uint8_t m_toz80; + uint8_t m_zaccept; + uint8_t m_zready; + uint8_t m_busreq; + uint8_t m_portA_in; + uint8_t m_portA_out; + uint8_t m_spacecr_prot_value; + uint8_t m_protection_value; + uint32_t m_address; bool m_sndnmi_disable; // AKA "CIOB0" on schematic, bit 0 of AY-3-8910 @ IC50 Port B bool m_sound_cmd_written; // 74ls74 1/2 @ GAME BOARD IC42 bool m_sound_semaphore; // 74ls74 2/2 @ GAME BOARD IC42 @@ -115,8 +115,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_taitosj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kikstart(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_taitosj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kikstart(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(taitosj_mcu_real_data_w); TIMER_CALLBACK_MEMBER(taitosj_mcu_data_real_r); TIMER_CALLBACK_MEMBER(taitosj_mcu_status_real_w); @@ -124,8 +124,8 @@ public: void reset_common(); void set_pens(); void compute_draw_order(); - inline int get_sprite_xy(UINT8 which, UINT8* sx, UINT8* sy); - inline gfx_element *get_sprite_gfx_element(UINT8 which); + inline int get_sprite_xy(uint8_t which, uint8_t* sx, uint8_t* sy); + inline gfx_element *get_sprite_gfx_element(uint8_t which); void check_sprite_sprite_collision(); void calculate_sprite_areas(int *sprites_on, rectangle *sprite_areas); int check_sprite_layer_bitpattern(int which, rectangle *sprite_areas); diff --git a/src/mame/includes/tandy2k.h b/src/mame/includes/tandy2k.h index 57a96efd607..07be28a202d 100644 --- a/src/mame/includes/tandy2k.h +++ b/src/mame/includes/tandy2k.h @@ -122,13 +122,13 @@ public: required_device m_floppy1; required_device m_rs232; required_device m_kb; - required_shared_ptr m_hires_ram; - optional_shared_ptr m_char_ram; + required_shared_ptr m_hires_ram; + optional_shared_ptr m_char_ram; virtual void machine_start() override; virtual void device_reset_after_children() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void update_drq(); void dma_request(int line, int state); @@ -183,13 +183,13 @@ public: }; /* DMA state */ - UINT8 m_dma_mux; + uint8_t m_dma_mux; int m_busdmarq[4]; /* keyboard state */ int m_kbdclk; int m_kbddat; - UINT8 m_kbdin; + uint8_t m_kbdin; /* serial state */ int m_extclk; @@ -200,20 +200,20 @@ public: int m_pb_sel; /* video state */ - UINT8 m_vram_base; + uint8_t m_vram_base; int m_vidouts; int m_clkspd; int m_clkcnt; int m_blc; int m_bkc; int m_cblank; - UINT8 m_dblc; - UINT8 m_dbkc; - UINT8 m_dblank; + uint8_t m_dblc; + uint8_t m_dbkc; + uint8_t m_dblank; int m_slg; int m_sld; - UINT8 m_cgra; - UINT8 m_vidla; + uint8_t m_cgra; + uint8_t m_vidla; /* sound state */ int m_outspkr; diff --git a/src/mame/includes/tank8.h b/src/mame/includes/tank8.h index 2f9eac715c4..1598b308e8e 100644 --- a/src/mame/includes/tank8.h +++ b/src/mame/includes/tank8.h @@ -52,11 +52,11 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_video_ram; - required_shared_ptr m_pos_h_ram; - required_shared_ptr m_pos_v_ram; - required_shared_ptr m_pos_d_ram; - required_shared_ptr m_team; + required_shared_ptr m_video_ram; + required_shared_ptr m_pos_h_ram; + required_shared_ptr m_pos_v_ram; + required_shared_ptr m_pos_d_ram; + required_shared_ptr m_team; int m_collision_index; tilemap_t *m_tilemap; @@ -83,7 +83,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(tank8); - 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); void screen_eof(screen_device &screen, bool state); void set_pens(); inline int get_x_pos(int n); diff --git a/src/mame/includes/tankbatt.h b/src/mame/includes/tankbatt.h index 2359153c3e6..083cd7813a9 100644 --- a/src/mame/includes/tankbatt.h +++ b/src/mame/includes/tankbatt.h @@ -18,8 +18,8 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_bulletsram; - required_shared_ptr m_videoram; + required_shared_ptr m_bulletsram; + required_shared_ptr m_videoram; int m_nmi_enable; int m_sound_enable; @@ -49,6 +49,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(tankbatt); - 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); void draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/tankbust.h b/src/mame/includes/tankbust.h index 1eeda476258..96c9e294c45 100644 --- a/src/mame/includes/tankbust.h +++ b/src/mame/includes/tankbust.h @@ -19,20 +19,20 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_txtram; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_txtram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; int m_latch; - UINT32 m_timer1; + uint32_t m_timer1; int m_e0xx_data[8]; - UINT8 m_variable_data; + uint8_t m_variable_data; tilemap_t *m_bg_tilemap; tilemap_t *m_txt_tilemap; - UINT8 m_xscroll[2]; - UINT8 m_yscroll[2]; - UINT8 m_irq_mask; + uint8_t m_xscroll[2]; + uint8_t m_yscroll[2]; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(soundlatch_w); DECLARE_WRITE8_MEMBER(e0xx_w); @@ -54,7 +54,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(tankbust); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); diff --git a/src/mame/includes/taotaido.h b/src/mame/includes/taotaido.h index 1fdb80c3103..7a8bc27df55 100644 --- a/src/mame/includes/taotaido.h +++ b/src/mame/includes/taotaido.h @@ -24,19 +24,19 @@ public: required_device m_spr; required_device m_soundlatch; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; - required_shared_ptr m_scrollram; - required_shared_ptr m_bgram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_scrollram; + required_shared_ptr m_bgram; int m_pending_command; - UINT16 m_sprite_character_bank_select[8]; - UINT16 m_video_bank_select[8]; + uint16_t m_sprite_character_bank_select[8]; + uint16_t m_video_bank_select[8]; tilemap_t *m_bg_tilemap; - std::unique_ptr m_spriteram_old; - std::unique_ptr m_spriteram_older; - std::unique_ptr m_spriteram2_old; - std::unique_ptr m_spriteram2_older; + std::unique_ptr m_spriteram_old; + std::unique_ptr m_spriteram_older; + std::unique_ptr m_spriteram2_old; + std::unique_ptr m_spriteram2_older; DECLARE_READ16_MEMBER(pending_command_r); DECLARE_WRITE16_MEMBER(sound_command_w); @@ -52,7 +52,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); void screen_eof(screen_device &screen, bool state); - UINT32 tile_callback( UINT32 code ); + uint32_t tile_callback( uint32_t code ); }; diff --git a/src/mame/includes/targeth.h b/src/mame/includes/targeth.h index 9bdeebbadf5..c2c5231100f 100644 --- a/src/mame/includes/targeth.h +++ b/src/mame/includes/targeth.h @@ -16,9 +16,9 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_vregs; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_vregs; + required_shared_ptr m_spriteram; tilemap_t *m_pant[2]; @@ -33,6 +33,6 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(interrupt); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h index 14475645a44..9bd6d882ea0 100644 --- a/src/mame/includes/tatsumi.h +++ b/src/mame/includes/tatsumi.h @@ -46,36 +46,36 @@ public: required_device m_palette; optional_device m_soundlatch; - optional_shared_ptr m_videoram; - optional_shared_ptr m_cyclwarr_cpua_ram; - optional_shared_ptr m_cyclwarr_cpub_ram; - optional_shared_ptr m_apache3_g_ram; - optional_shared_ptr m_roundup5_d0000_ram; - optional_shared_ptr m_roundup5_e0000_ram; - optional_shared_ptr m_roundup5_unknown0; - optional_shared_ptr m_roundup5_unknown1; - optional_shared_ptr m_roundup5_unknown2; - optional_shared_ptr m_68k_ram; - optional_shared_ptr m_apache3_z80_ram; - required_shared_ptr m_sprite_control_ram; - optional_shared_ptr m_cyclwarr_videoram0; - optional_shared_ptr m_cyclwarr_videoram1; - optional_shared_ptr m_roundup_r_ram; - optional_shared_ptr m_roundup_p_ram; - optional_shared_ptr m_roundup_l_ram; - required_shared_ptr m_spriteram; + optional_shared_ptr m_videoram; + optional_shared_ptr m_cyclwarr_cpua_ram; + optional_shared_ptr m_cyclwarr_cpub_ram; + optional_shared_ptr m_apache3_g_ram; + optional_shared_ptr m_roundup5_d0000_ram; + optional_shared_ptr m_roundup5_e0000_ram; + optional_shared_ptr m_roundup5_unknown0; + optional_shared_ptr m_roundup5_unknown1; + optional_shared_ptr m_roundup5_unknown2; + optional_shared_ptr m_68k_ram; + optional_shared_ptr m_apache3_z80_ram; + required_shared_ptr m_sprite_control_ram; + optional_shared_ptr m_cyclwarr_videoram0; + optional_shared_ptr m_cyclwarr_videoram1; + optional_shared_ptr m_roundup_r_ram; + optional_shared_ptr m_roundup_p_ram; + optional_shared_ptr m_roundup_l_ram; + required_shared_ptr m_spriteram; - UINT16 m_bigfight_a20000[8]; - UINT16 m_bigfight_a60000[2]; - UINT16 m_bigfight_a40000[2]; - UINT8 *m_rom_sprite_lookup1; - UINT8 *m_rom_sprite_lookup2; - UINT8 *m_rom_clut0; - UINT8 *m_rom_clut1; - UINT16 m_control_word; - UINT16 m_apache3_rotate_ctrl[12]; - UINT16 m_last_control; - UINT8 m_apache3_adc; + uint16_t m_bigfight_a20000[8]; + uint16_t m_bigfight_a60000[2]; + uint16_t m_bigfight_a40000[2]; + uint8_t *m_rom_sprite_lookup1; + uint8_t *m_rom_sprite_lookup2; + uint8_t *m_rom_clut0; + uint8_t *m_rom_clut1; + uint16_t m_control_word; + uint16_t m_apache3_rotate_ctrl[12]; + uint16_t m_last_control; + uint8_t m_apache3_adc; int m_apache3_rot_idx; tilemap_t *m_tx_layer; tilemap_t *m_layer0; @@ -83,14 +83,14 @@ public: tilemap_t *m_layer2; tilemap_t *m_layer3; bitmap_rgb32 m_temp_bitmap; - std::unique_ptr m_apache3_road_x_ram; - UINT8 m_apache3_road_z; - std::unique_ptr m_roundup5_vram; - UINT16 m_bigfight_bank; - UINT16 m_bigfight_last_bank; - UINT8 m_roundupt_crt_selected_reg; - UINT8 m_roundupt_crt_reg[64]; - std::unique_ptr m_shadow_pen_array; + std::unique_ptr m_apache3_road_x_ram; + uint8_t m_apache3_road_z; + std::unique_ptr m_roundup5_vram; + uint16_t m_bigfight_bank; + uint16_t m_bigfight_last_bank; + uint8_t m_roundupt_crt_selected_reg; + uint8_t m_roundupt_crt_reg[64]; + std::unique_ptr m_shadow_pen_array; DECLARE_READ16_MEMBER(cyclwarr_sprite_r); DECLARE_WRITE16_MEMBER(cyclwarr_sprite_w); DECLARE_WRITE16_MEMBER(bigfight_a20000_w); @@ -138,10 +138,10 @@ public: DECLARE_VIDEO_START(roundup5); DECLARE_VIDEO_START(cyclwarr); DECLARE_VIDEO_START(bigfight); - UINT32 screen_update_apache3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_roundup5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cyclwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bigfight(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_apache3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_roundup5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cyclwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bigfight(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(roundup5_interrupt); DECLARE_READ8_MEMBER(tatsumi_hack_ym2151_r); DECLARE_READ8_MEMBER(tatsumi_hack_oki_r); diff --git a/src/mame/includes/taxidriv.h b/src/mame/includes/taxidriv.h index 2884053df30..7a73c1cf083 100644 --- a/src/mame/includes/taxidriv.h +++ b/src/mame/includes/taxidriv.h @@ -22,15 +22,15 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_vram0; - required_shared_ptr m_vram1; - required_shared_ptr m_vram2; - required_shared_ptr m_vram3; - required_shared_ptr m_vram4; - required_shared_ptr m_vram5; - required_shared_ptr m_vram6; - required_shared_ptr m_vram7; - required_shared_ptr m_scroll; + required_shared_ptr m_vram0; + required_shared_ptr m_vram1; + required_shared_ptr m_vram2; + required_shared_ptr m_vram3; + required_shared_ptr m_vram4; + required_shared_ptr m_vram5; + required_shared_ptr m_vram6; + required_shared_ptr m_vram7; + required_shared_ptr m_scroll; int m_s1; int m_s2; @@ -66,5 +66,5 @@ public: virtual void machine_start() override; DECLARE_PALETTE_INIT(taxidriv); - 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); }; diff --git a/src/mame/includes/tbowl.h b/src/mame/includes/tbowl.h index 087bc5130a7..71159afebf5 100644 --- a/src/mame/includes/tbowl.h +++ b/src/mame/includes/tbowl.h @@ -33,18 +33,18 @@ public: required_device m_sprgen; required_device m_soundlatch; - required_shared_ptr m_txvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_bg2videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_txvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_bg2videoram; + required_shared_ptr m_spriteram; tilemap_t *m_tx_tilemap; tilemap_t *m_bg_tilemap; tilemap_t *m_bg2_tilemap; - UINT16 m_xscroll; - UINT16 m_yscroll; - UINT16 m_bg2xscroll; - UINT16 m_bg2yscroll; + uint16_t m_xscroll; + uint16_t m_yscroll; + uint16_t m_bg2xscroll; + uint16_t m_bg2yscroll; int m_adpcm_pos[2]; int m_adpcm_end[2]; int m_adpcm_data[2]; @@ -77,8 +77,8 @@ public: virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void adpcm_int(msm5205_device *device, int chip); DECLARE_WRITE_LINE_MEMBER(adpcm_int_1); diff --git a/src/mame/includes/tceptor.h b/src/mame/includes/tceptor.h index 26f5a122dc3..d88ffc34e6c 100644 --- a/src/mame/includes/tceptor.h +++ b/src/mame/includes/tceptor.h @@ -20,30 +20,30 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 m_m6809_irq_enable; - UINT8 m_m68k_irq_enable; - UINT8 m_mcu_irq_enable; + uint8_t m_m6809_irq_enable; + uint8_t m_m68k_irq_enable; + uint8_t m_mcu_irq_enable; required_device m_maincpu; required_device m_cus30; - required_shared_ptr m_tile_ram; - required_shared_ptr m_tile_attr; - required_shared_ptr m_bg_ram; - required_shared_ptr m_m68k_shared_ram; - required_shared_ptr m_sprite_ram; + required_shared_ptr m_tile_ram; + required_shared_ptr m_tile_attr; + required_shared_ptr m_bg_ram; + required_shared_ptr m_m68k_shared_ram; + required_shared_ptr m_sprite_ram; int m_sprite16; int m_sprite32; int m_bg; tilemap_t *m_tx_tilemap; tilemap_t *m_bg1_tilemap; tilemap_t *m_bg2_tilemap; - INT32 m_bg1_scroll_x; - INT32 m_bg1_scroll_y; - INT32 m_bg2_scroll_x; - INT32 m_bg2_scroll_y; + int32_t m_bg1_scroll_x; + int32_t m_bg1_scroll_y; + int32_t m_bg2_scroll_x; + int32_t m_bg2_scroll_y; bitmap_ind16 m_temp_bitmap; - std::unique_ptr m_sprite_ram_buffered; - std::unique_ptr m_decoded_16; - std::unique_ptr m_decoded_32; + std::unique_ptr m_sprite_ram_buffered; + std::unique_ptr m_decoded_16; + std::unique_ptr m_decoded_32; int m_is_mask_spr[1024/16]; DECLARE_READ8_MEMBER(m68k_shared_r); DECLARE_WRITE8_MEMBER(m68k_shared_w); @@ -75,9 +75,9 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(tceptor); - UINT32 screen_update_tceptor_2d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tceptor_3d_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tceptor_3d_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tceptor_2d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tceptor_3d_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tceptor_3d_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_tceptor(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(m6809_vb_interrupt); INTERRUPT_GEN_MEMBER(m68k_vb_interrupt); @@ -88,6 +88,6 @@ public: void decode_sprite16(const char * region); void decode_sprite32(const char * region); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_priority); - inline UINT8 fix_input0(UINT8 in1, UINT8 in2); - inline UINT8 fix_input1(UINT8 in1, UINT8 in2); + inline uint8_t fix_input0(uint8_t in1, uint8_t in2); + inline uint8_t fix_input1(uint8_t in1, uint8_t in2); }; diff --git a/src/mame/includes/tdv2324.h b/src/mame/includes/tdv2324.h index 8e4ad412197..b1f5bdff5ab 100644 --- a/src/mame/includes/tdv2324.h +++ b/src/mame/includes/tdv2324.h @@ -70,17 +70,17 @@ public: required_device m_tms; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( tdv2324_main_io_30 ); DECLARE_READ8_MEMBER( tdv2324_main_io_e6 ); DECLARE_WRITE8_MEMBER( tdv2324_main_io_e2 ); - UINT8 m_sub_status; - UINT8 m_sub_data; + uint8_t m_sub_status; + uint8_t m_sub_data; // video state - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; }; diff --git a/src/mame/includes/tecmo.h b/src/mame/includes/tecmo.h index 75b9f2ec57e..7ba16367294 100644 --- a/src/mame/includes/tecmo.h +++ b/src/mame/includes/tecmo.h @@ -32,16 +32,16 @@ public: required_device m_sprgen; required_device m_soundlatch; - required_shared_ptr m_txvideoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_txvideoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_spriteram; tilemap_t *m_tx_tilemap; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT8 m_fgscroll[3]; - UINT8 m_bgscroll[3]; + uint8_t m_fgscroll[3]; + uint8_t m_bgscroll[3]; int m_adpcm_pos; int m_adpcm_end; int m_adpcm_data; @@ -80,5 +80,5 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); }; diff --git a/src/mame/includes/tecmo16.h b/src/mame/includes/tecmo16.h index 7017d4f7f3e..f15916ebd38 100644 --- a/src/mame/includes/tecmo16.h +++ b/src/mame/includes/tecmo16.h @@ -35,12 +35,12 @@ public: required_device m_mixer; required_device m_soundlatch; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram2; - required_shared_ptr m_charram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram2; + required_shared_ptr m_charram; + required_shared_ptr m_spriteram; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; @@ -50,12 +50,12 @@ public: bitmap_ind16 m_tile_bitmap_fg; int m_flipscreen; int m_game_is_riot; - UINT16 m_scroll_x_w; - UINT16 m_scroll_y_w; - UINT16 m_scroll2_x_w; - UINT16 m_scroll2_y_w; - UINT16 m_scroll_char_x_w; - UINT16 m_scroll_char_y_w; + uint16_t m_scroll_x_w; + uint16_t m_scroll_y_w; + uint16_t m_scroll2_x_w; + uint16_t m_scroll2_y_w; + uint16_t m_scroll_char_x_w; + uint16_t m_scroll_char_y_w; DECLARE_WRITE16_MEMBER(sound_command_w); DECLARE_WRITE16_MEMBER(videoram_w); @@ -79,7 +79,7 @@ public: DECLARE_VIDEO_START(ginkun); DECLARE_VIDEO_START(riot); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void save_state(); }; diff --git a/src/mame/includes/tecmosys.h b/src/mame/includes/tecmosys.h index 17b082c86cf..96548cc076f 100644 --- a/src/mame/includes/tecmosys.h +++ b/src/mame/includes/tecmosys.h @@ -49,20 +49,20 @@ public: required_device m_soundlatch; required_device m_soundlatch2; - required_shared_ptr m_spriteram; - required_shared_ptr m_tilemap_paletteram16; - required_shared_ptr m_bg2tilemap_ram; - required_shared_ptr m_bg1tilemap_ram; - required_shared_ptr m_bg0tilemap_ram; - required_shared_ptr m_fgtilemap_ram; - required_shared_ptr m_bg0tilemap_lineram; - required_shared_ptr m_bg1tilemap_lineram; - required_shared_ptr m_bg2tilemap_lineram; - required_shared_ptr m_a80000regs; - required_shared_ptr m_b00000regs; - required_shared_ptr m_c00000regs; - required_shared_ptr m_c80000regs; - required_shared_ptr m_880000regs; + required_shared_ptr m_spriteram; + required_shared_ptr m_tilemap_paletteram16; + required_shared_ptr m_bg2tilemap_ram; + required_shared_ptr m_bg1tilemap_ram; + required_shared_ptr m_bg0tilemap_ram; + required_shared_ptr m_fgtilemap_ram; + required_shared_ptr m_bg0tilemap_lineram; + required_shared_ptr m_bg1tilemap_lineram; + required_shared_ptr m_bg2tilemap_lineram; + required_shared_ptr m_a80000regs; + required_shared_ptr m_b00000regs; + required_shared_ptr m_c00000regs; + required_shared_ptr m_c80000regs; + required_shared_ptr m_880000regs; int m_spritelist; bitmap_ind16 m_sprite_bitmap; @@ -72,10 +72,10 @@ public: tilemap_t *m_bg1tilemap; tilemap_t *m_bg2tilemap; tilemap_t *m_txt_tilemap; - UINT8 m_device_read_ptr; - UINT8 m_device_status; + uint8_t m_device_read_ptr; + uint8_t m_device_status; const struct prot_data* m_device_data; - UINT8 m_device_value; + uint8_t m_device_value; DECLARE_READ16_MEMBER(sound_r); DECLARE_WRITE16_MEMBER(sound_w); @@ -109,12 +109,12 @@ public: TILE_GET_INFO_MEMBER(get_bg2tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void prot_init(int which); void prot_reset(); - inline void set_color_555(pen_t color, int rshift, int gshift, int bshift, UINT16 data); - void render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray ); - void tilemap_copy_to_compose(UINT16 pri); + inline void set_color_555(pen_t color, int rshift, int gshift, int bshift, uint16_t data); + void render_sprites_to_bitmap(bitmap_rgb32 &bitmap, uint16_t extrax, uint16_t extray ); + void tilemap_copy_to_compose(uint16_t pri); void do_final_mix(bitmap_rgb32 &bitmap); void descramble(); }; diff --git a/src/mame/includes/tehkanwc.h b/src/mame/includes/tehkanwc.h index 3202531818e..a4d5b229dae 100644 --- a/src/mame/includes/tehkanwc.h +++ b/src/mame/includes/tehkanwc.h @@ -36,18 +36,18 @@ public: required_device m_soundlatch; required_device m_soundlatch2; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_videoram2; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram2; + required_shared_ptr m_spriteram; int m_track0[2]; int m_track1[2]; int m_msm_data_offs; int m_toggle; - UINT8 m_scroll_x[2]; - UINT8 m_led0; - UINT8 m_led1; + uint8_t m_scroll_x[2]; + uint8_t m_led0; + uint8_t m_led1; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -81,8 +81,8 @@ public: virtual void machine_start() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void gridiron_draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void gridiron_draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t led,int player); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); protected: diff --git a/src/mame/includes/tek405x.h b/src/mame/includes/tek405x.h index 018c3835c65..d248d9734d4 100644 --- a/src/mame/includes/tek405x.h +++ b/src/mame/includes/tek405x.h @@ -68,7 +68,7 @@ public: virtual void video_start() override; - void bankswitch(UINT8 data); + void bankswitch(uint8_t data); void update_irq(); void update_nmi(); void scan_keyboard(); diff --git a/src/mame/includes/terracre.h b/src/mame/includes/terracre.h index ba82b080442..e7e5cf20177 100644 --- a/src/mame/includes/terracre.h +++ b/src/mame/includes/terracre.h @@ -23,14 +23,14 @@ public: required_device m_spriteram; required_device m_soundlatch; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; - const UINT16 *m_mpProtData; - UINT8 m_mAmazonProtCmd; - UINT8 m_mAmazonProtReg[6]; - UINT16 m_xscroll; - UINT16 m_yscroll; + const uint16_t *m_mpProtData; + uint8_t m_mAmazonProtCmd; + uint8_t m_mAmazonProtReg[6]; + uint16_t m_xscroll; + uint16_t m_yscroll; tilemap_t *m_background; tilemap_t *m_foreground; DECLARE_WRITE16_MEMBER(amazon_sound_w); @@ -50,6 +50,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(terracre); DECLARE_MACHINE_START(amazon); - UINT32 screen_update_amazon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_amazon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/tetrisp2.h b/src/mame/includes/tetrisp2.h index 8bf7d2b03c4..de7a53b891f 100644 --- a/src/mame/includes/tetrisp2.h +++ b/src/mame/includes/tetrisp2.h @@ -37,42 +37,42 @@ public: required_device m_maincpu; optional_device m_subcpu; - required_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram; + optional_shared_ptr m_spriteram2; - UINT16 m_systemregs[0x10]; - required_shared_ptr m_vram_fg; - required_shared_ptr m_vram_bg; - required_shared_ptr m_vram_rot; - required_shared_ptr m_nvram; - required_shared_ptr m_scroll_fg; - required_shared_ptr m_scroll_bg; - required_shared_ptr m_rotregs; - std::unique_ptr m_priority; - optional_shared_ptr m_rocknms_sub_priority; - optional_shared_ptr m_rocknms_sub_vram_rot; - optional_shared_ptr m_rocknms_sub_vram_fg; - optional_shared_ptr m_rocknms_sub_vram_bg; - optional_shared_ptr m_rocknms_sub_scroll_fg; - optional_shared_ptr m_rocknms_sub_scroll_bg; - optional_shared_ptr m_rocknms_sub_rotregs; + uint16_t m_systemregs[0x10]; + required_shared_ptr m_vram_fg; + required_shared_ptr m_vram_bg; + required_shared_ptr m_vram_rot; + required_shared_ptr m_nvram; + required_shared_ptr m_scroll_fg; + required_shared_ptr m_scroll_bg; + required_shared_ptr m_rotregs; + std::unique_ptr m_priority; + optional_shared_ptr m_rocknms_sub_priority; + optional_shared_ptr m_rocknms_sub_vram_rot; + optional_shared_ptr m_rocknms_sub_vram_fg; + optional_shared_ptr m_rocknms_sub_vram_bg; + optional_shared_ptr m_rocknms_sub_scroll_fg; + optional_shared_ptr m_rocknms_sub_scroll_bg; + optional_shared_ptr m_rocknms_sub_rotregs; required_device m_gfxdecode; optional_device m_sub_gfxdecode; required_device m_palette; optional_device m_sub_palette; - required_shared_ptr m_paletteram; - optional_shared_ptr m_sub_paletteram; + required_shared_ptr m_paletteram; + optional_shared_ptr m_sub_paletteram; - UINT16 m_rocknms_sub_systemregs[0x10]; - UINT16 m_rockn_protectdata; - UINT16 m_rockn_adpcmbank; - UINT16 m_rockn_soundvolume; + uint16_t m_rocknms_sub_systemregs[0x10]; + uint16_t m_rockn_protectdata; + uint16_t m_rockn_adpcmbank; + uint16_t m_rockn_soundvolume; emu_timer *m_rockn_timer_l4; emu_timer *m_rockn_timer_sub_l4; int m_bank_lo; int m_bank_hi; - UINT16 m_rocknms_main2sub; - UINT16 m_rocknms_sub2main; + uint16_t m_rocknms_main2sub; + uint16_t m_rocknms_sub2main; int m_flipscreen_old; tilemap_t *m_tilemap_bg; tilemap_t *m_tilemap_fg; @@ -127,10 +127,10 @@ public: DECLARE_VIDEO_START(nndmseal); DECLARE_VIDEO_START(rockntread); DECLARE_VIDEO_START(rocknms); - UINT32 screen_update_tetrisp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_rockntread(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_rocknms_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_rocknms_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tetrisp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rockntread(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rocknms_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rocknms_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(rockn_timer_level4_callback); TIMER_CALLBACK_MEMBER(rockn_timer_sub_level4_callback); TIMER_CALLBACK_MEMBER(rockn_timer_level1_callback); @@ -146,7 +146,7 @@ public: m_spriteram3(*this, "spriteram3"), m_soundlatch(*this, "soundlatch") { } - required_shared_ptr m_spriteram3; + required_shared_ptr m_spriteram3; required_device m_soundlatch; DECLARE_READ16_MEMBER(stepstag_coins_r); DECLARE_READ16_MEMBER(unknown_read_0xc00000); @@ -157,8 +157,8 @@ public: DECLARE_WRITE16_MEMBER( stepstag_palette_w ); DECLARE_DRIVER_INIT(stepstag); DECLARE_VIDEO_START(stepstag); - UINT32 screen_update_stepstag_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_stepstag_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_stepstag_mid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_stepstag_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_stepstag_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_stepstag_mid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); inline int mypal(int x); }; diff --git a/src/mame/includes/thedeep.h b/src/mame/includes/thedeep.h index 341efdb0b3b..1a80666308b 100644 --- a/src/mame/includes/thedeep.h +++ b/src/mame/includes/thedeep.h @@ -32,20 +32,20 @@ public: required_device m_spritegen; required_device m_soundlatch; - required_shared_ptr m_spriteram; - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_scroll; - required_shared_ptr m_scroll2; + required_shared_ptr m_spriteram; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_scroll; + required_shared_ptr m_scroll2; int m_nmi_enable; - UINT8 m_protection_command; - UINT8 m_protection_data; + uint8_t m_protection_command; + uint8_t m_protection_data; int m_protection_index; int m_protection_irq; tilemap_t *m_tilemap_0; tilemap_t *m_tilemap_1; - UINT8 m_mcu_p3_reg; + uint8_t m_mcu_p3_reg; DECLARE_WRITE8_MEMBER(nmi_w); DECLARE_WRITE8_MEMBER(sound_w); @@ -70,7 +70,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(thedeep); - 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); INTERRUPT_GEN_MEMBER(mcu_irq); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); diff --git a/src/mame/includes/thepit.h b/src/mame/includes/thepit.h index 11852faab9e..5ed5d9242f9 100644 --- a/src/mame/includes/thepit.h +++ b/src/mame/includes/thepit.h @@ -17,18 +17,18 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_attributesram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_attributesram; + required_shared_ptr m_spriteram; - UINT8 m_graphics_bank; - UINT8 m_flip_x; - UINT8 m_flip_y; + uint8_t m_graphics_bank; + uint8_t m_flip_x; + uint8_t m_flip_y; tilemap_t *m_solid_tilemap; tilemap_t *m_tilemap; - std::unique_ptr m_dummy_tile; - UINT8 m_nmi_mask; + std::unique_ptr m_dummy_tile; + uint8_t m_nmi_mask; int m_question_address; int m_question_rom; @@ -56,8 +56,8 @@ public: DECLARE_PALETTE_INIT(thepit); DECLARE_PALETTE_INIT(suprmous); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_desertdan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_desertdan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_draw); INTERRUPT_GEN_MEMBER(vblank_irq); diff --git a/src/mame/includes/thief.h b/src/mame/includes/thief.h index bc1d57ae8a8..c30ba655a5c 100644 --- a/src/mame/includes/thief.h +++ b/src/mame/includes/thief.h @@ -4,10 +4,10 @@ #include "video/tms9927.h" struct coprocessor_t { - std::unique_ptr context_ram; - UINT8 bank; - std::unique_ptr image_ram; - UINT8 param[0x9]; + std::unique_ptr context_ram; + uint8_t bank; + std::unique_ptr image_ram; + uint8_t param[0x9]; }; class thief_state : public driver_device @@ -20,11 +20,11 @@ public: m_tms(*this, "tms"), m_palette(*this, "palette") { } - std::unique_ptr m_videoram; - UINT8 m_input_select; - UINT8 m_read_mask; - UINT8 m_write_mask; - UINT8 m_video_control; + std::unique_ptr m_videoram; + uint8_t m_input_select; + uint8_t m_read_mask; + uint8_t m_write_mask; + uint8_t m_video_control; coprocessor_t m_coprocessor; DECLARE_WRITE8_MEMBER(thief_input_select_w); DECLARE_READ8_MEMBER(thief_io_r); @@ -42,9 +42,9 @@ public: DECLARE_WRITE8_MEMBER(tape_control_w); DECLARE_DRIVER_INIT(thief); virtual void video_start() override; - UINT32 screen_update_thief(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_thief(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(thief_interrupt); - UINT16 fetch_image_addr( coprocessor_t &thief_coprocessor ); + uint16_t fetch_image_addr( coprocessor_t &thief_coprocessor ); void tape_set_audio( int track, int bOn ); void tape_set_motor( int bOn ); required_device m_maincpu; diff --git a/src/mame/includes/thomson.h b/src/mame/includes/thomson.h index fdc51b12489..0ac25c6a9d3 100644 --- a/src/mame/includes/thomson.h +++ b/src/mame/includes/thomson.h @@ -271,7 +271,7 @@ public: TIMER_CALLBACK_MEMBER( thom_lightpen_step ); TIMER_CALLBACK_MEMBER( thom_scanline_start ); - UINT32 screen_update_thom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_thom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER( to7_vram_w ); DECLARE_WRITE8_MEMBER( to770_vram_w ); DECLARE_WRITE8_MEMBER( to8_sys_lo_w ); @@ -282,36 +282,36 @@ public: DECLARE_WRITE8_MEMBER( mo6_vcart_lo_w ); DECLARE_WRITE8_MEMBER( mo6_vcart_hi_w ); TIMER_CALLBACK_MEMBER( thom_set_init ); - void to770_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void mo5_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void mo5alt_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void to9_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void bitmap4_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void bitmap4alt_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void bitmap4althalf_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void bitmap16_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void mode80_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void mode80_to9_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void page1_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void page2_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void overlay_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void overlayhalf_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void overlay3_scandraw_16( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void to770_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void mo5_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void mo5alt_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void to9_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void bitmap4_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void bitmap4alt_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void bitmap4althalf_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void bitmap16_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void mode80_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void mode80_to9_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void page1_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void page2_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void overlay_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void overlayhalf_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); - void overlay3_scandraw_8( UINT8* vram, UINT16* dst, UINT16* pal, int org, int len ); + void to770_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void mo5_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void mo5alt_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void to9_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void bitmap4_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void bitmap4alt_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void bitmap4althalf_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void bitmap16_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void mode80_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void mode80_to9_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void page1_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void page2_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void overlay_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void overlayhalf_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void overlay3_scandraw_16( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void to770_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void mo5_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void mo5alt_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void to9_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void bitmap4_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void bitmap4alt_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void bitmap4althalf_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void bitmap16_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void mode80_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void mode80_to9_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void page1_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void page2_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void overlay_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void overlayhalf_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); + void overlay3_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); void thom_vblank( screen_device &screen, bool state ); DECLARE_VIDEO_START( thom ); @@ -398,72 +398,72 @@ protected: int m_old_ram_bank; int m_old_floppy_bank; /* buffer storing demodulated bits, only for k7 and with speed hack */ - UINT32 m_to7_k7_bitsize; - UINT8* m_to7_k7_bits; + uint32_t m_to7_k7_bitsize; + uint8_t* m_to7_k7_bits; /* several devices on the same irqs */ - UINT8 m_thom_irq; - UINT8 m_thom_firq; + uint8_t m_thom_irq; + uint8_t m_thom_firq; /* ------------ cartridge ------------ */ - UINT8 m_thom_cart_nb_banks; /* number of 16 KB banks (up to 4) */ - UINT8 m_thom_cart_bank; /* current bank */ - UINT8 m_to7_lightpen_step; - UINT8 m_to7_lightpen; - UINT8 m_to7_modem_tx; + uint8_t m_thom_cart_nb_banks; /* number of 16 KB banks (up to 4) */ + uint8_t m_thom_cart_bank; /* current bank */ + uint8_t m_to7_lightpen_step; + uint8_t m_to7_lightpen; + uint8_t m_to7_modem_tx; /* calls to7_game_update_cb periodically */ emu_timer* m_to7_game_timer; - UINT8 m_to7_game_sound; - UINT8 m_to7_game_mute; + uint8_t m_to7_game_sound; + uint8_t m_to7_game_mute; emu_timer* m_mo5_periodic_timer; - UINT8 m_mo5_reg_cart; /* 0xa7cb bank switch */ - UINT8 m_to9_palette_data[32]; - UINT8 m_to9_palette_idx; - UINT8 m_to9_soft_bank; - UINT8 m_to9_kbd_parity; /* 0=even, 1=odd, 2=no parity */ - UINT8 m_to9_kbd_intr; /* interrupt mode */ - UINT8 m_to9_kbd_in; /* data from keyboard */ - UINT8 m_to9_kbd_status; /* status */ - UINT8 m_to9_kbd_overrun; /* character lost */ - UINT8 m_to9_kbd_periph; /* peripherial mode */ - UINT8 m_to9_kbd_byte_count; /* byte-count in peripherial mode */ - UINT16 m_to9_mouse_x; - UINT16 m_to9_mouse_y; - UINT8 m_to9_kbd_last_key; /* for key repetition */ - UINT16 m_to9_kbd_key_count; - UINT8 m_to9_kbd_caps; /* caps-lock */ - UINT8 m_to9_kbd_pad; /* keypad outputs special codes */ + uint8_t m_mo5_reg_cart; /* 0xa7cb bank switch */ + uint8_t m_to9_palette_data[32]; + uint8_t m_to9_palette_idx; + uint8_t m_to9_soft_bank; + uint8_t m_to9_kbd_parity; /* 0=even, 1=odd, 2=no parity */ + uint8_t m_to9_kbd_intr; /* interrupt mode */ + uint8_t m_to9_kbd_in; /* data from keyboard */ + uint8_t m_to9_kbd_status; /* status */ + uint8_t m_to9_kbd_overrun; /* character lost */ + uint8_t m_to9_kbd_periph; /* peripherial mode */ + uint8_t m_to9_kbd_byte_count; /* byte-count in peripherial mode */ + uint16_t m_to9_mouse_x; + uint16_t m_to9_mouse_y; + uint8_t m_to9_kbd_last_key; /* for key repetition */ + uint16_t m_to9_kbd_key_count; + uint8_t m_to9_kbd_caps; /* caps-lock */ + uint8_t m_to9_kbd_pad; /* keypad outputs special codes */ emu_timer* m_to9_kbd_timer; - UINT8 m_to8_kbd_ack; /* 1 = cpu inits / accepts transfers */ - UINT16 m_to8_kbd_data; /* data to transmit */ - UINT16 m_to8_kbd_step; /* transmission automaton state */ - UINT8 m_to8_kbd_last_key; /* last key (for repetition) */ - UINT32 m_to8_kbd_key_count; /* keypress time (for repetition) */ - UINT8 m_to8_kbd_caps; /* caps lock */ + uint8_t m_to8_kbd_ack; /* 1 = cpu inits / accepts transfers */ + uint16_t m_to8_kbd_data; /* data to transmit */ + uint16_t m_to8_kbd_step; /* transmission automaton state */ + uint8_t m_to8_kbd_last_key; /* last key (for repetition) */ + uint32_t m_to8_kbd_key_count; /* keypress time (for repetition) */ + uint8_t m_to8_kbd_caps; /* caps lock */ emu_timer* m_to8_kbd_timer; /* bit-send */ emu_timer* m_to8_kbd_signal; /* signal from CPU */ - UINT8 m_to8_data_vpage; - UINT8 m_to8_cart_vpage; - UINT8 m_to8_reg_ram; - UINT8 m_to8_reg_cart; - UINT8 m_to8_reg_sys1; - UINT8 m_to8_reg_sys2; - UINT8 m_to8_lightpen_intr; - UINT8 m_to8_soft_select; - UINT8 m_to8_soft_bank; - UINT8 m_to8_bios_bank; + uint8_t m_to8_data_vpage; + uint8_t m_to8_cart_vpage; + uint8_t m_to8_reg_ram; + uint8_t m_to8_reg_cart; + uint8_t m_to8_reg_sys1; + uint8_t m_to8_reg_sys2; + uint8_t m_to8_lightpen_intr; + uint8_t m_to8_soft_select; + uint8_t m_to8_soft_bank; + uint8_t m_to8_bios_bank; /* We allow choosing dynamically: - the border size - whether we use 640 pixels or 320 pixels in an active row (now this is automatically choosen by default for each frame) */ - UINT16 m_thom_bwidth; - UINT16 m_thom_bheight; + uint16_t m_thom_bwidth; + uint16_t m_thom_bheight; /* border size */ - UINT8 m_thom_hires; + uint8_t m_thom_hires; /* 0 = low res: 320x200 active area (faster) 1 = hi res: 640x200 active area (can represent all video modes) */ - UINT8 m_thom_hires_better; + uint8_t m_thom_hires_better; /* 1 = a 640 mode was used in the last frame */ /* we use our own video timing to precisely cope with VBLANK and HBLANK */ emu_timer* m_thom_video_timer; /* time elapsed from beginning of frame */ @@ -473,37 +473,37 @@ protected: emu_timer *m_thom_lightpen_timer; /* lightpen callback function to call from timer */ void (thomson_state::*m_thom_lightpen_cb)(int step); - UINT8* m_thom_vram; /* pointer to video memory */ + uint8_t* m_thom_vram; /* pointer to video memory */ emu_timer* m_thom_scanline_timer; /* scan-line udpate */ - UINT16 m_thom_last_pal[16]; /* palette at last scanline start */ - UINT16 m_thom_pal[16]; /* current palette */ - UINT8 m_thom_pal_changed; /* whether pal != old_pal */ - UINT8 m_thom_border_index; /* current border color index */ + uint16_t m_thom_last_pal[16]; /* palette at last scanline start */ + uint16_t m_thom_pal[16]; /* current palette */ + uint8_t m_thom_pal_changed; /* whether pal != old_pal */ + uint8_t m_thom_border_index; /* current border color index */ /* the left and right border color for each row (including top and bottom border rows); -1 means unchanged wrt last scanline */ - INT16 m_thom_border_l[THOM_TOTAL_HEIGHT+1]; - INT16 m_thom_border_r[THOM_TOTAL_HEIGHT+1]; + int16_t m_thom_border_l[THOM_TOTAL_HEIGHT+1]; + int16_t m_thom_border_r[THOM_TOTAL_HEIGHT+1]; /* active area, updated one scan-line at a time every 64us, then blitted in screen_update */ - UINT16 m_thom_vbody[640*200]; - UINT8 m_thom_vmode; /* current vide mode */ - UINT8 m_thom_vpage; /* current video page */ + uint16_t m_thom_vbody[640*200]; + uint8_t m_thom_vmode; /* current vide mode */ + uint8_t m_thom_vpage; /* current video page */ /* this stores the video mode & page at each GPL in the current line (-1 means unchanged) */ - INT16 m_thom_vmodepage[41]; - UINT8 m_thom_vmodepage_changed; + int16_t m_thom_vmodepage[41]; + uint8_t m_thom_vmodepage_changed; /* one dirty flag for each video memory line */ - UINT8 m_thom_vmem_dirty[205]; + uint8_t m_thom_vmem_dirty[205]; /* set to 1 if undirty scanlines need to be redrawn due to other video state changes */ - UINT8 m_thom_vstate_dirty; - UINT8 m_thom_vstate_last_dirty; - UINT32 m_thom_mode_point; - UINT32 m_thom_floppy_wcount; - UINT32 m_thom_floppy_rcount; + uint8_t m_thom_vstate_dirty; + uint8_t m_thom_vstate_last_dirty; + uint32_t m_thom_mode_point; + uint32_t m_thom_floppy_wcount; + uint32_t m_thom_floppy_rcount; emu_timer *m_thom_init_timer; void (thomson_state::*m_thom_init_cb)( int init ); @@ -523,7 +523,7 @@ protected: void to7_set_init( int init ); void to7_modem_reset(); void to7_modem_init(); - UINT8 to7_get_mouse_signal(); + uint8_t to7_get_mouse_signal(); void to7_game_sound_update(); void to7_game_init(); void to7_game_reset(); @@ -532,13 +532,13 @@ protected: void to770_update_ram_bank(); void mo5_init_timer(); void mo5_update_cart_bank(); - void to9_set_video_mode( UINT8 data, int style ); + void to9_set_video_mode( uint8_t data, int style ); void to9_palette_init(); void to9_update_cart_bank(); void to9_update_ram_bank(); int to9_kbd_ktest(); void to9_kbd_update_irq(); - void to9_kbd_send( UINT8 data, int parity ); + void to9_kbd_send( uint8_t data, int parity ); int to9_kbd_get_key(); void to9_kbd_reset(); void to9_kbd_init(); @@ -570,20 +570,20 @@ protected: void thom_border_changed(); void thom_gplinfo_changed(); void thom_set_border_color( unsigned index ); - void thom_set_palette( unsigned index, UINT16 color ); + void thom_set_palette( unsigned index, uint16_t color ); void thom_set_video_mode( unsigned mode ); void thom_set_video_page( unsigned page ); void thom_set_mode_point( int point ); void thom_floppy_active( int write ); unsigned to7_lightpen_gpl( int decx, int decy ); - void thom_configure_palette( double gamma, const UINT16* pal, palette_device& palette ); - - int thom_floppy_make_addr( chrn_id id, UINT8* dst, int sector_size ); - int thom_floppy_make_sector( legacy_floppy_image_device* img, chrn_id id, UINT8* dst, int sector_size ); - int thom_floppy_make_track( legacy_floppy_image_device* img, UINT8* dst, int sector_size, int side ); - int thom_qdd_make_addr( int sector, UINT8* dst ); - int thom_qdd_make_sector( legacy_floppy_image_device* img, int sector, UINT8* dst ); - int thom_qdd_make_disk ( legacy_floppy_image_device* img, UINT8* dst ); + void thom_configure_palette( double gamma, const uint16_t* pal, palette_device& palette ); + + int thom_floppy_make_addr( chrn_id id, uint8_t* dst, int sector_size ); + int thom_floppy_make_sector( legacy_floppy_image_device* img, chrn_id id, uint8_t* dst, int sector_size ); + int thom_floppy_make_track( legacy_floppy_image_device* img, uint8_t* dst, int sector_size, int side ); + int thom_qdd_make_addr( int sector, uint8_t* dst ); + int thom_qdd_make_sector( legacy_floppy_image_device* img, int sector, uint8_t* dst ); + int thom_qdd_make_disk ( legacy_floppy_image_device* img, uint8_t* dst ); void to7_5p14_reset(); void to7_5p14_init(); void to7_5p14_index_pulse_callback( device_t *controller,legacy_floppy_image_device *image, int state ); @@ -592,8 +592,8 @@ protected: void to7_qdd_index_pulse_cb( device_t *controller,legacy_floppy_image_device *image, int state ); legacy_floppy_image_device * to7_qdd_image(); void to7_qdd_stat_update(); - UINT8 to7_qdd_read_byte(); - void to7_qdd_write_byte( UINT8 data ); + uint8_t to7_qdd_read_byte(); + void to7_qdd_write_byte( uint8_t data ); void to7_qdd_reset(); void to7_qdd_init(); legacy_floppy_image_device * thmfc_floppy_image(); @@ -601,11 +601,11 @@ protected: void thmfc_floppy_index_pulse_cb( device_t *controller,legacy_floppy_image_device *image, int state ); int thmfc_floppy_find_sector( chrn_id* dst ); void thmfc_floppy_cmd_complete(); - UINT8 thmfc_floppy_read_byte(); - UINT8 thmfc_floppy_raw_read_byte(); - void thmfc_floppy_qdd_write_byte( UINT8 data ); - void thmfc_floppy_write_byte( UINT8 data ); - void thmfc_floppy_format_byte( UINT8 data ); + uint8_t thmfc_floppy_read_byte(); + uint8_t thmfc_floppy_raw_read_byte(); + void thmfc_floppy_qdd_write_byte( uint8_t data ); + void thmfc_floppy_write_byte( uint8_t data ); + void thmfc_floppy_format_byte( uint8_t data ); void thmfc_floppy_reset(); void thmfc_floppy_init(); void to7_network_init(); @@ -668,7 +668,7 @@ class to7_io_line_device : public device_t { public: // construction/destruction - to7_io_line_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + to7_io_line_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); /* read data register */ DECLARE_READ8_MEMBER(porta_in); diff --git a/src/mame/includes/thoop2.h b/src/mame/includes/thoop2.h index 5ff44c9c3b6..5fe75e84493 100644 --- a/src/mame/includes/thoop2.h +++ b/src/mame/includes/thoop2.h @@ -16,9 +16,9 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_vregs; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_vregs; + required_shared_ptr m_spriteram; int m_sprite_count[5]; std::unique_ptr m_sprite_table[5]; @@ -34,7 +34,7 @@ public: TILE_GET_INFO_MEMBER(get_tile_info_screen0); TILE_GET_INFO_MEMBER(get_tile_info_screen1); - 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); void sort_sprites(); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri); }; diff --git a/src/mame/includes/thunderj.h b/src/mame/includes/thunderj.h index ebcaff632ed..9fbd6c5df11 100644 --- a/src/mame/includes/thunderj.h +++ b/src/mame/includes/thunderj.h @@ -23,7 +23,7 @@ public: required_device m_vad; required_device m_extra; - UINT8 m_alpha_tile_bank; + uint8_t m_alpha_tile_bank; virtual void update_interrupts() override; DECLARE_READ16_MEMBER(special_port2_r); DECLARE_WRITE16_MEMBER(latch_w); @@ -34,7 +34,7 @@ public: DECLARE_MACHINE_START(thunderj); DECLARE_MACHINE_RESET(thunderj); DECLARE_VIDEO_START(thunderj); - UINT32 screen_update_thunderj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_thunderj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; }; diff --git a/src/mame/includes/thunderx.h b/src/mame/includes/thunderx.h index 2ea60729e11..e9ee6df35c1 100644 --- a/src/mame/includes/thunderx.h +++ b/src/mame/includes/thunderx.h @@ -43,11 +43,11 @@ public: /* memory */ required_memory_bank m_rombank; - optional_shared_ptr m_pmcram; + optional_shared_ptr m_pmcram; /* misc */ int m_priority; - UINT8 m_1f98_latch; + uint8_t m_1f98_latch; DECLARE_WRITE8_MEMBER(scontra_bankswitch_w); DECLARE_WRITE8_MEMBER(thunderx_videobank_w); @@ -66,7 +66,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); INTERRUPT_GEN_MEMBER(vblank_interrupt); void run_collisions( int s0, int e0, int s1, int e1, int cm, int hm ); void calculate_collisions( ); diff --git a/src/mame/includes/ti85.h b/src/mame/includes/ti85.h index 4eff29fff9b..94e542c6859 100644 --- a/src/mame/includes/ti85.h +++ b/src/mame/includes/ti85.h @@ -33,12 +33,12 @@ enum ti85_model { typedef struct { - UINT8 loop; - UINT8 setup; + uint8_t loop; + uint8_t setup; float divsor; bool interrupt; - UINT8 max; - UINT8 count; + uint8_t max; + uint8_t count; } ti83pse_timer; typedef enum TI83PSE_CTIMER @@ -69,7 +69,7 @@ public: required_device m_maincpu; optional_device m_speaker; //optional_device<> m_serial; - optional_shared_ptr m_nvram; + optional_shared_ptr m_nvram; optional_device m_flash; optional_device m_membank1; optional_device m_membank2; @@ -78,41 +78,41 @@ public: ti85_model m_model; - UINT8 m_LCD_memory_base; - UINT8 m_LCD_contrast; - UINT8 m_LCD_status; - UINT8 m_timer_interrupt_mask; - UINT8 m_timer_interrupt_status; - UINT8 m_ctimer_interrupt_status; - UINT8 m_ON_interrupt_mask; - UINT8 m_ON_interrupt_status; - UINT8 m_ON_pressed; - UINT8 m_flash_unlocked; - UINT8 m_ti8x_memory_page_1; - UINT8 m_ti8x_memory_page_2; - UINT8 m_ti8x_memory_page_3; + uint8_t m_LCD_memory_base; + uint8_t m_LCD_contrast; + uint8_t m_LCD_status; + uint8_t m_timer_interrupt_mask; + uint8_t m_timer_interrupt_status; + uint8_t m_ctimer_interrupt_status; + uint8_t m_ON_interrupt_mask; + uint8_t m_ON_interrupt_status; + uint8_t m_ON_pressed; + uint8_t m_flash_unlocked; + uint8_t m_ti8x_memory_page_1; + uint8_t m_ti8x_memory_page_2; + uint8_t m_ti8x_memory_page_3; bool m_booting; - UINT8 m_LCD_mask; - UINT8 m_power_mode; - UINT8 m_cpu_speed; - UINT8 m_keypad_mask; - UINT8 m_video_buffer_width; - UINT8 m_interrupt_speed; - UINT8 m_port4_bit0; - UINT8 m_ti81_port_7_data; - std::unique_ptr m_ti8x_ram; - UINT8 m_PCR; - UINT8 m_red_out; - UINT8 m_white_out; - UINT8 m_ti8x_port2; - UINT8 m_ti83p_port4; - UINT8 m_ti83pse_port21; + uint8_t m_LCD_mask; + uint8_t m_power_mode; + uint8_t m_cpu_speed; + uint8_t m_keypad_mask; + uint8_t m_video_buffer_width; + uint8_t m_interrupt_speed; + uint8_t m_port4_bit0; + uint8_t m_ti81_port_7_data; + std::unique_ptr m_ti8x_ram; + uint8_t m_PCR; + uint8_t m_red_out; + uint8_t m_white_out; + uint8_t m_ti8x_port2; + uint8_t m_ti83p_port4; + uint8_t m_ti83pse_port21; int m_ti_video_memory_size; int m_ti_screen_x_size; int m_ti_screen_y_size; int m_ti_number_of_frames; - std::unique_ptr m_frames; - UINT8 * m_bios; + std::unique_ptr m_frames; + uint8_t * m_bios; DECLARE_READ8_MEMBER(ti85_port_0000_r); DECLARE_READ8_MEMBER(ti8x_keypad_r); DECLARE_READ8_MEMBER(ti85_port_0006_r); @@ -179,14 +179,14 @@ public: DECLARE_MACHINE_START(ti84p); void ti8xpse_init_common(); - UINT32 screen_update_ti85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ti85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(ti85_timer_callback); TIMER_CALLBACK_MEMBER(ti83_timer1_callback); TIMER_CALLBACK_MEMBER(ti83_timer2_callback); //crystal timers virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - void ti83pse_count( UINT8 timer, UINT8 data); + void ti83pse_count( uint8_t timer, uint8_t data); emu_timer *m_crystal_timer1; emu_timer *m_crystal_timer2; @@ -215,9 +215,9 @@ public: void update_ti83p_memory (); void update_ti83pse_memory (); void update_ti86_memory (); - void ti8x_snapshot_setup_registers (UINT8 * data); - void ti85_setup_snapshot (UINT8 * data); - void ti86_setup_snapshot (UINT8 * data); + void ti8x_snapshot_setup_registers (uint8_t * data); + void ti85_setup_snapshot (uint8_t * data); + void ti86_setup_snapshot (uint8_t * data); DECLARE_SNAPSHOT_LOAD_MEMBER( ti8x ); DECLARE_DIRECT_UPDATE_MEMBER( ti83p_direct_update_handler ); diff --git a/src/mame/includes/ti89.h b/src/mame/includes/ti89.h index 67b1707e8bc..7c6b8f56d48 100644 --- a/src/mame/includes/ti89.h +++ b/src/mame/includes/ti89.h @@ -31,7 +31,7 @@ public: required_device m_maincpu; required_device m_flash; - required_region_ptr m_rom_base; + required_region_ptr m_rom_base; required_ioport m_io_bit0; required_ioport m_io_bit1; required_ioport m_io_bit2; @@ -45,42 +45,42 @@ public: enum { HW1=1, HW2, HW3, HW4 }; // HW specifications - UINT8 m_hw_version; + uint8_t m_hw_version; bool m_flash_mem; - UINT32 m_initial_pc; + uint32_t m_initial_pc; // keyboard - UINT16 m_kb_mask; - UINT8 m_on_key; + uint16_t m_kb_mask; + uint8_t m_on_key; // LCD - UINT8 m_lcd_on; - UINT32 m_lcd_base; - UINT16 m_lcd_width; - UINT16 m_lcd_height; - UINT16 m_lcd_contrast; + uint8_t m_lcd_on; + uint32_t m_lcd_base; + uint16_t m_lcd_width; + uint16_t m_lcd_height; + uint16_t m_lcd_contrast; // I/O - UINT16 m_io_hw1[0x10]; - UINT16 m_io_hw2[0x80]; + uint16_t m_io_hw1[0x10]; + uint16_t m_io_hw2[0x80]; // Timer - UINT8 m_timer_on; - UINT8 m_timer_val; - UINT16 m_timer_mask; + uint8_t m_timer_on; + uint8_t m_timer_val; + uint16_t m_timer_mask; virtual void machine_start() override; virtual void machine_reset() override; - 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); - UINT8 keypad_r(); + uint8_t keypad_r(); DECLARE_WRITE16_MEMBER ( ti68k_io_w ); DECLARE_READ16_MEMBER ( ti68k_io_r ); DECLARE_WRITE16_MEMBER ( ti68k_io2_w ); DECLARE_READ16_MEMBER ( ti68k_io2_r ); DECLARE_WRITE16_MEMBER ( flash_w ); DECLARE_READ16_MEMBER ( flash_r ); - UINT64 m_timer; + uint64_t m_timer; DECLARE_PALETTE_INIT(ti68k); DECLARE_INPUT_CHANGED_MEMBER(ti68k_on_key); TIMER_DEVICE_CALLBACK_MEMBER(ti68k_timer_callback); diff --git a/src/mame/includes/tiamc1.h b/src/mame/includes/tiamc1.h index 513f7c1df5f..6252caced5b 100644 --- a/src/mame/includes/tiamc1.h +++ b/src/mame/includes/tiamc1.h @@ -15,18 +15,18 @@ public: m_speaker(*this, "speaker") { } - std::unique_ptr m_videoram; - UINT8 *m_tileram; - UINT8 *m_charram; - UINT8 *m_spriteram_x; - UINT8 *m_spriteram_y; - UINT8 *m_spriteram_a; - UINT8 *m_spriteram_n; - UINT8 *m_paletteram; - UINT8 m_layers_ctrl; - UINT8 m_bg_vshift; - UINT8 m_bg_hshift; - UINT8 m_bg_bplctrl; + std::unique_ptr m_videoram; + uint8_t *m_tileram; + uint8_t *m_charram; + uint8_t *m_spriteram_x; + uint8_t *m_spriteram_y; + uint8_t *m_spriteram_a; + uint8_t *m_spriteram_n; + uint8_t *m_paletteram; + uint8_t m_layers_ctrl; + uint8_t m_bg_vshift; + uint8_t m_bg_hshift; + uint8_t m_bg_bplctrl; tilemap_t *m_bg_tilemap1; tilemap_t *m_bg_tilemap2; std::unique_ptr m_palette_ptr; @@ -51,8 +51,8 @@ public: virtual void video_start() override; DECLARE_VIDEO_START(kot); DECLARE_PALETTE_INIT(tiamc1); - UINT32 screen_update_tiamc1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tiamc1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; @@ -83,15 +83,15 @@ struct timer8253chan enable(0) {} - UINT16 count; - UINT16 cnval; - UINT8 bcdMode; - UINT8 cntMode; - UINT8 valMode; - UINT8 gate; - UINT8 output; - UINT8 loadCnt; - UINT8 enable; + uint16_t count; + uint16_t cnval; + uint8_t bcdMode; + uint8_t cntMode; + uint8_t valMode; + uint8_t gate; + uint8_t output; + uint8_t loadCnt; + uint8_t enable; }; struct timer8253struct @@ -106,7 +106,7 @@ class tiamc1_sound_device : public device_t, public device_sound_interface { public: - tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~tiamc1_sound_device() { } protected: @@ -124,9 +124,9 @@ public: private: void timer8253_reset(struct timer8253struct *t); void timer8253_tick(struct timer8253struct *t,int chn); - void timer8253_wr(struct timer8253struct *t, int reg, UINT8 val); + void timer8253_wr(struct timer8253struct *t, int reg, uint8_t val); char timer8253_get_output(struct timer8253struct *t, int chn); - void timer8253_set_gate(struct timer8253struct *t, int chn, UINT8 gate); + void timer8253_set_gate(struct timer8253struct *t, int chn, uint8_t gate); private: sound_stream *m_channel; diff --git a/src/mame/includes/tigeroad.h b/src/mame/includes/tigeroad.h index 0dbe96a99b5..13a6e6a692a 100644 --- a/src/mame/includes/tigeroad.h +++ b/src/mame/includes/tigeroad.h @@ -31,8 +31,8 @@ public: { } required_device m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_ram16; + required_shared_ptr m_videoram; + required_shared_ptr m_ram16; int m_bgcharbank; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; @@ -49,7 +49,7 @@ public: TILE_GET_INFO_MEMBER(get_fg_tile_info); TILEMAP_MAPPER_MEMBER(tigeroad_tilemap_scan); virtual void video_start() override; - UINT32 screen_update_tigeroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tigeroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void f1dream_protection_w(address_space &space); required_device m_maincpu; required_device m_audiocpu; @@ -60,12 +60,12 @@ public: required_device m_spritegen; required_device m_soundlatch; - UINT16 m_control[2]; + uint16_t m_control[2]; /* misc */ - UINT8 m_shared_ram[8]; - UINT16 m_latch; - UINT16 m_new_latch; + uint8_t m_shared_ram[8]; + uint16_t m_latch; + uint16_t m_new_latch; int m_has_coinlock; /* protection handling */ diff --git a/src/mame/includes/tiki100.h b/src/mame/includes/tiki100.h index c0fd0c2addf..0cd8c7b1ae5 100644 --- a/src/mame/includes/tiki100.h +++ b/src/mame/includes/tiki100.h @@ -80,7 +80,7 @@ public: required_device m_exp; required_memory_region m_rom; required_memory_region m_prom; - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; required_ioport_array<12> m_y; required_ioport m_st_io; required_device m_palette; @@ -88,7 +88,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( mrq_r ); DECLARE_WRITE8_MEMBER( mrq_w ); @@ -131,9 +131,9 @@ public: bool m_vire; // video state - UINT8 m_scroll; - UINT8 m_mode; - UINT8 m_palette_val; + uint8_t m_scroll; + uint8_t m_mode; + uint8_t m_palette_val; // keyboard state int m_keylatch; diff --git a/src/mame/includes/timelimt.h b/src/mame/includes/timelimt.h index 0b8da8c3398..69a07aecae2 100644 --- a/src/mame/includes/timelimt.h +++ b/src/mame/includes/timelimt.h @@ -19,9 +19,9 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_spriteram; int m_nmi_enabled; int m_scrollx; @@ -45,7 +45,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(timelimt); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(irq); diff --git a/src/mame/includes/timeplt.h b/src/mame/includes/timeplt.h index 3a9de0d64c1..5574f4b23ce 100644 --- a/src/mame/includes/timeplt.h +++ b/src/mame/includes/timeplt.h @@ -31,16 +31,16 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_colorram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; + required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; /* video-related */ tilemap_t *m_bg_tilemap; /* misc */ - UINT8 m_nmi_enable; + uint8_t m_nmi_enable; bool m_video_enable; /* common */ @@ -71,7 +71,7 @@ public: DECLARE_VIDEO_START(chkun); DECLARE_VIDEO_START(psurge); - 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); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); INTERRUPT_GEN_MEMBER(interrupt); diff --git a/src/mame/includes/tmc1800.h b/src/mame/includes/tmc1800.h index f34b0e8fe1a..89d9dce03f0 100644 --- a/src/mame/includes/tmc1800.h +++ b/src/mame/includes/tmc1800.h @@ -92,7 +92,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE8_MEMBER( keylatch_w ); DECLARE_READ_LINE_MEMBER( clear_r ); @@ -115,7 +115,7 @@ public: { } required_device m_cti; - optional_shared_ptr m_colorram; + optional_shared_ptr m_colorram; required_ioport_array<8> m_key_row; virtual void machine_start() override; @@ -140,7 +140,7 @@ public: int m_roc; /* video state */ - UINT8 m_color; + uint8_t m_color; /* keyboard state */ int m_keylatch; diff --git a/src/mame/includes/tmc2000e.h b/src/mame/includes/tmc2000e.h index 25d74ea3d22..c79c16b2380 100644 --- a/src/mame/includes/tmc2000e.h +++ b/src/mame/includes/tmc2000e.h @@ -35,7 +35,7 @@ public: required_device m_maincpu; required_device m_cti; required_device m_cassette; - required_shared_ptr m_colorram; + required_shared_ptr m_colorram; required_ioport_array<8> m_key_row; required_ioport m_run; @@ -62,7 +62,7 @@ public: /* video state */ int m_cdp1864_efx; /* EFx */ - UINT8 m_color; + uint8_t m_color; /* keyboard state */ int m_keylatch; /* key latch */ diff --git a/src/mame/includes/tmc600.h b/src/mame/includes/tmc600.h index 0a6056529c8..8d36e3c8b38 100644 --- a/src/mame/includes/tmc600.h +++ b/src/mame/includes/tmc600.h @@ -44,9 +44,9 @@ public: required_device m_cassette; required_device m_centronics; required_device m_ram; - required_region_ptr m_char_rom; - required_shared_ptr m_page_ram; - optional_shared_ptr m_color_ram; + required_region_ptr m_char_rom; + required_shared_ptr m_page_ram; + optional_shared_ptr m_color_ram; required_ioport m_run; required_ioport_array<8> m_key_row; @@ -63,7 +63,7 @@ public: DECLARE_READ_LINE_MEMBER( ef3_r ); DECLARE_WRITE_LINE_MEMBER( q_w ); - UINT8 get_color(UINT16 pma); + uint8_t get_color(uint16_t pma); // video state int m_vismac_reg_latch; // video register latch diff --git a/src/mame/includes/tmnt.h b/src/mame/includes/tmnt.h index 8b6d18a7c78..fed21e7685c 100644 --- a/src/mame/includes/tmnt.h +++ b/src/mame/includes/tmnt.h @@ -44,10 +44,10 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - optional_shared_ptr m_spriteram; - optional_shared_ptr m_tmnt2_rom; - optional_shared_ptr m_sunset_104000; - optional_shared_ptr m_tmnt2_1c0800; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_tmnt2_rom; + optional_shared_ptr m_sunset_104000; + optional_shared_ptr m_tmnt2_1c0800; /* video-related */ int m_layer_colorbase[3]; @@ -72,7 +72,7 @@ public: int m_tmnt_soundlatch; int m_toggle; int m_last; - UINT16 m_cuebrick_nvram[0x400 * 0x20 / 2]; // 32k paged in a 1k window + uint16_t m_cuebrick_nvram[0x400 * 0x20 / 2]; // 32k paged in a 1k window /* devices */ required_device m_maincpu; @@ -92,9 +92,9 @@ public: required_device m_palette; /* memory buffers */ - INT16 m_sampledata[0x40000]; + int16_t m_sampledata[0x40000]; - UINT8 m_irq5_mask; + uint8_t m_irq5_mask; DECLARE_READ16_MEMBER(k052109_word_noA12_r); DECLARE_WRITE16_MEMBER(k052109_word_noA12_w); DECLARE_WRITE16_MEMBER(punkshot_k052109_word_w); @@ -155,19 +155,19 @@ public: DECLARE_VIDEO_START(glfgreat); DECLARE_MACHINE_START(prmrsocr); DECLARE_VIDEO_START(prmrsocr); - UINT32 screen_update_mia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tmnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_punkshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_lgtnfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_glfgreat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tmnt2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_thndrx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_mia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tmnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_punkshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lgtnfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_glfgreat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tmnt2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_thndrx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_blswhstl(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(tmnt_interrupt); INTERRUPT_GEN_MEMBER(punkshot_interrupt); INTERRUPT_GEN_MEMBER(lgtnfght_interrupt); - inline UINT32 tmnt2_get_word( UINT32 addr ); - void tmnt2_put_word( address_space &space, UINT32 addr, UINT16 data ); + inline uint32_t tmnt2_get_word( uint32_t addr ); + void tmnt2_put_word( address_space &space, uint32_t addr, uint16_t data ); DECLARE_WRITE8_MEMBER(volume_callback); K051960_CB_MEMBER(mia_sprite_callback); K051960_CB_MEMBER(tmnt_sprite_callback); diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h index 64864f79c27..6e57dc0ff6c 100644 --- a/src/mame/includes/tnzs.h +++ b/src/mame/includes/tnzs.h @@ -74,7 +74,7 @@ public: optional_ioport m_an2; /* sound-related */ - std::unique_ptr m_sampledata[MAX_SAMPLES]; + std::unique_ptr m_sampledata[MAX_SAMPLES]; int m_samplesize[MAX_SAMPLES]; /* misc / mcu */ @@ -87,10 +87,10 @@ public: int m_mcu_readcredits; int m_mcu_reportcoin; int m_insertcoin; - UINT8 m_mcu_coinage[4]; - UINT8 m_mcu_coins_a; - UINT8 m_mcu_coins_b; - UINT8 m_mcu_credits; + uint8_t m_mcu_coinage[4]; + uint8_t m_mcu_coins_a; + uint8_t m_mcu_coins_b; + uint8_t m_mcu_credits; int m_bank2; DECLARE_WRITE8_MEMBER(tnzsb_sound_command_w); @@ -132,7 +132,7 @@ public: DECLARE_MACHINE_START(tnzs_common); DECLARE_MACHINE_RESET(jpopnics); - UINT32 screen_update_tnzs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tnzs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_tnzs(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(arknoid2_interrupt); diff --git a/src/mame/includes/toaplan1.h b/src/mame/includes/toaplan1.h index e5366a7d123..ff437df03dc 100644 --- a/src/mame/includes/toaplan1.h +++ b/src/mame/includes/toaplan1.h @@ -24,10 +24,10 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_bgpaletteram; - required_shared_ptr m_fgpaletteram; + required_shared_ptr m_bgpaletteram; + required_shared_ptr m_fgpaletteram; - optional_shared_ptr m_sharedram; + optional_shared_ptr m_sharedram; int m_coin_count; /* coin count increments on startup ? , so don't count it */ int m_intenable; @@ -36,37 +36,37 @@ public: int m_dsp_on; int m_dsp_BIO; int m_dsp_execute; - UINT32 m_dsp_addr_w; - UINT32 m_main_ram_seg; - - UINT8 m_vimana_coins[2]; - UINT8 m_vimana_credits; - UINT8 m_vimana_latch; - - std::unique_ptr m_pf4_tilevram16; /* || Drawn in this order */ - std::unique_ptr m_pf3_tilevram16; /* || */ - std::unique_ptr m_pf2_tilevram16; /* \||/ */ - std::unique_ptr m_pf1_tilevram16; /* \/ */ - - optional_shared_ptr m_spriteram; - std::unique_ptr m_buffered_spriteram; - std::unique_ptr m_spritesizeram16; - std::unique_ptr m_buffered_spritesizeram16; - - INT32 m_bcu_flipscreen; /* Tile controller flip flag */ - INT32 m_fcu_flipscreen; /* Sprite controller flip flag */ - - INT32 m_pf_voffs; - INT32 m_spriteram_offs; - - INT32 m_pf1_scrollx; - INT32 m_pf1_scrolly; - INT32 m_pf2_scrollx; - INT32 m_pf2_scrolly; - INT32 m_pf3_scrollx; - INT32 m_pf3_scrolly; - INT32 m_pf4_scrollx; - INT32 m_pf4_scrolly; + uint32_t m_dsp_addr_w; + uint32_t m_main_ram_seg; + + uint8_t m_vimana_coins[2]; + uint8_t m_vimana_credits; + uint8_t m_vimana_latch; + + std::unique_ptr m_pf4_tilevram16; /* || Drawn in this order */ + std::unique_ptr m_pf3_tilevram16; /* || */ + std::unique_ptr m_pf2_tilevram16; /* \||/ */ + std::unique_ptr m_pf1_tilevram16; /* \/ */ + + optional_shared_ptr m_spriteram; + std::unique_ptr m_buffered_spriteram; + std::unique_ptr m_spritesizeram16; + std::unique_ptr m_buffered_spritesizeram16; + + int32_t m_bcu_flipscreen; /* Tile controller flip flag */ + int32_t m_fcu_flipscreen; /* Sprite controller flip flag */ + + int32_t m_pf_voffs; + int32_t m_spriteram_offs; + + int32_t m_pf1_scrollx; + int32_t m_pf1_scrolly; + int32_t m_pf2_scrollx; + int32_t m_pf2_scrolly; + int32_t m_pf3_scrollx; + int32_t m_pf3_scrolly; + int32_t m_pf4_scrollx; + int32_t m_pf4_scrolly; #ifdef MAME_DEBUG int m_display_pf1; @@ -76,8 +76,8 @@ public: int m_displog; #endif - INT32 m_tiles_offsetx; - INT32 m_tiles_offsety; + int32_t m_tiles_offsetx; + int32_t m_tiles_offsety; tilemap_t *m_pf1_tilemap; tilemap_t *m_pf2_tilemap; @@ -133,7 +133,7 @@ public: DECLARE_MACHINE_RESET(zerowing); DECLARE_MACHINE_RESET(demonwld); DECLARE_MACHINE_RESET(vimana); - UINT32 screen_update_toaplan1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_toaplan1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_toaplan1(screen_device &screen, bool state); void screen_eof_samesame(screen_device &screen, bool state); @@ -173,7 +173,7 @@ public: DECLARE_WRITE8_MEMBER(rallybik_coin_w); DECLARE_READ16_MEMBER(rallybik_tileram16_r); DECLARE_VIDEO_START(rallybik); - UINT32 screen_update_rallybik(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rallybik(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_rallybik(screen_device &screen, bool state); required_device m_spritegen; diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h index a4fbde58e80..6d75f4781c5 100644 --- a/src/mame/includes/toaplan2.h +++ b/src/mame/includes/toaplan2.h @@ -51,14 +51,14 @@ public: m_soundlatch2(*this, "soundlatch2"), m_hopper(*this, "hopper") { } - optional_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU - optional_shared_ptr m_shared_ram16; // Really 8 bit RAM connected to Z180 - optional_shared_ptr m_paletteram; - optional_shared_ptr m_tx_videoram; - optional_shared_ptr m_tx_lineselect; - optional_shared_ptr m_tx_linescroll; - optional_shared_ptr m_tx_gfxram16; - optional_shared_ptr m_mainram16; + optional_shared_ptr m_shared_ram; // 8 bit RAM shared between 68K and sound CPU + optional_shared_ptr m_shared_ram16; // Really 8 bit RAM connected to Z180 + optional_shared_ptr m_paletteram; + optional_shared_ptr m_tx_videoram; + optional_shared_ptr m_tx_lineselect; + optional_shared_ptr m_tx_linescroll; + optional_shared_ptr m_tx_gfxram16; + optional_shared_ptr m_mainram16; required_device m_maincpu; optional_device m_audiocpu; @@ -76,12 +76,12 @@ public: optional_device m_soundlatch2; optional_device m_hopper; - UINT16 m_mcu_data; - INT8 m_old_p1_paddle_h; /* For Ghox */ - INT8 m_old_p2_paddle_h; - UINT8 m_v25_reset_line; /* 0x20 for dogyuun/batsugun, 0x10 for vfive, 0x08 for fixeight */ - UINT8 m_sndirq_line; /* IRQ4 for batrider, IRQ2 for bbakraid */ - UINT8 m_z80_busreq; + uint16_t m_mcu_data; + int8_t m_old_p1_paddle_h; /* For Ghox */ + int8_t m_old_p2_paddle_h; + uint8_t m_v25_reset_line; /* 0x20 for dogyuun/batsugun, 0x10 for vfive, 0x08 for fixeight */ + uint8_t m_sndirq_line; /* IRQ4 for batrider, IRQ2 for bbakraid */ + uint8_t m_z80_busreq; bitmap_ind8 m_custom_priority_bitmap; bitmap_ind16 m_secondary_render_bitmap; @@ -147,11 +147,11 @@ public: DECLARE_VIDEO_START(bgaregga); DECLARE_VIDEO_START(bgareggabl); DECLARE_VIDEO_START(batrider); - UINT32 screen_update_toaplan2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_dogyuun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_truxton2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_toaplan2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dogyuun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_truxton2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_toaplan2(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(toaplan2_vblank_irq1); INTERRUPT_GEN_MEMBER(toaplan2_vblank_irq2); diff --git a/src/mame/includes/toki.h b/src/mame/includes/toki.h index ca8af3876ee..e9f64c98aa2 100644 --- a/src/mame/includes/toki.h +++ b/src/mame/includes/toki.h @@ -35,10 +35,10 @@ public: optional_device m_soundlatch; // tokib required_device m_spriteram; - required_shared_ptr m_background1_videoram; - required_shared_ptr m_background2_videoram; - required_shared_ptr m_videoram; - required_shared_ptr m_scrollram; + required_shared_ptr m_background1_videoram; + required_shared_ptr m_background2_videoram; + required_shared_ptr m_videoram; + required_shared_ptr m_scrollram; int m_msm5205next; int m_toggle; @@ -67,8 +67,8 @@ public: virtual void video_start() override; - UINT32 screen_update_toki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tokib(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_toki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tokib(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void toki_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); void tokib_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); }; diff --git a/src/mame/includes/toobin.h b/src/mame/includes/toobin.h index 38d50d41c60..a8dbbc7fe56 100644 --- a/src/mame/includes/toobin.h +++ b/src/mame/includes/toobin.h @@ -26,7 +26,7 @@ public: required_device m_alpha_tilemap; required_device m_mob; - required_shared_ptr m_interrupt_scan; + required_shared_ptr m_interrupt_scan; double m_brightness; bitmap_ind16 m_pfbitmap; @@ -47,7 +47,7 @@ public: DECLARE_MACHINE_RESET(toobin); DECLARE_VIDEO_START(toobin); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; }; diff --git a/src/mame/includes/topspeed.h b/src/mame/includes/topspeed.h index 9e8ed3f394d..0c6823ec19b 100644 --- a/src/mame/includes/topspeed.h +++ b/src/mame/includes/topspeed.h @@ -35,10 +35,10 @@ public: m_gfxdecode(*this, "gfxdecode"), m_steer(*this, "STEER") { } - required_shared_ptr m_spritemap; - required_shared_ptr m_raster_ctrl; - required_shared_ptr m_spriteram; - required_shared_ptr m_sharedram; + required_shared_ptr m_spritemap; + required_shared_ptr m_raster_ctrl; + required_shared_ptr m_spriteram; + required_shared_ptr m_sharedram; required_device m_maincpu; required_device m_audiocpu; @@ -56,19 +56,19 @@ public: required_ioport m_steer; // Misc - UINT16 m_cpua_ctrl; - INT32 m_ioc220_port; + uint16_t m_cpua_ctrl; + int32_t m_ioc220_port; // ADPCM - UINT8 *m_msm_rom[2]; - UINT16 m_msm_pos[2]; - UINT8 m_msm_reset[2]; - UINT8 m_msm_nibble[2]; - UINT8 m_msm2_vck; - UINT8 m_msm2_vck2; + uint8_t *m_msm_rom[2]; + uint16_t m_msm_pos[2]; + uint8_t m_msm_reset[2]; + uint8_t m_msm_nibble[2]; + uint8_t m_msm2_vck; + uint8_t m_msm2_vck2; #ifdef MAME_DEBUG - UINT8 m_dislayer[5]; + uint8_t m_dislayer[5]; #endif // drivers/topspeed.c @@ -91,5 +91,5 @@ public: // video/topspeed.c void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_topspeed(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_topspeed(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/tp84.h b/src/mame/includes/tp84.h index 282f8287290..625aac625d8 100644 --- a/src/mame/includes/tp84.h +++ b/src/mame/includes/tp84.h @@ -21,23 +21,23 @@ public: m_palette(*this, "palette") { } required_device m_audiocpu; - required_shared_ptr m_palette_bank; - required_shared_ptr m_flipscreen_x; - required_shared_ptr m_flipscreen_y; - required_shared_ptr m_scroll_x; - required_shared_ptr m_scroll_y; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_colorram; - required_shared_ptr m_fg_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_palette_bank; + required_shared_ptr m_flipscreen_x; + required_shared_ptr m_flipscreen_y; + required_shared_ptr m_scroll_x; + required_shared_ptr m_scroll_y; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_colorram; + required_shared_ptr m_fg_colorram; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_screen; required_device m_palette; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_sub_irq_mask; + uint8_t m_sub_irq_mask; DECLARE_READ8_MEMBER(tp84_sh_timer_r); DECLARE_WRITE8_MEMBER(tp84_filter_w); DECLARE_WRITE8_MEMBER(tp84_sh_irqtrigger_w); @@ -49,7 +49,7 @@ public: virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(tp84); - UINT32 screen_update_tp84(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tp84(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sub_vblank_irq); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/trackfld.h b/src/mame/includes/trackfld.h index bac83ad0c3e..32886c2f751 100644 --- a/src/mame/includes/trackfld.h +++ b/src/mame/includes/trackfld.h @@ -27,12 +27,12 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram2; - required_shared_ptr m_scroll; - required_shared_ptr m_spriteram; - required_shared_ptr m_scroll2; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_scroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_scroll2; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; /* devices */ required_device m_maincpu; @@ -49,8 +49,8 @@ public: int m_old_gfx_bank; // needed by atlantol int m_sprites_gfx_banked; - UINT8 m_irq_mask; - UINT8 m_yieartf_nmi_mask; + uint8_t m_irq_mask; + uint8_t m_yieartf_nmi_mask; DECLARE_WRITE8_MEMBER(coin_w); DECLARE_WRITE8_MEMBER(questions_bank_w); DECLARE_WRITE8_MEMBER(irq_mask_w); @@ -69,7 +69,7 @@ public: DECLARE_DRIVER_INIT(mastkin); DECLARE_DRIVER_INIT(trackfldnz); - UINT8 m_SN76496_latch; + uint8_t m_SN76496_latch; DECLARE_WRITE8_MEMBER( konami_SN76496_latch_w ) { m_SN76496_latch = data; }; DECLARE_WRITE8_MEMBER( konami_SN76496_w ) { m_sn->write(space, offset, m_SN76496_latch); }; TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -78,7 +78,7 @@ public: DECLARE_VIDEO_START(trackfld); DECLARE_PALETTE_INIT(trackfld); DECLARE_VIDEO_START(atlantol); - UINT32 screen_update_trackfld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_trackfld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(vblank_nmi); INTERRUPT_GEN_MEMBER(yieartf_timer_irq); diff --git a/src/mame/includes/tranz330.h b/src/mame/includes/tranz330.h index 2421e3a80ed..a01b292630e 100644 --- a/src/mame/includes/tranz330.h +++ b/src/mame/includes/tranz330.h @@ -67,7 +67,7 @@ private: required_device m_speaker; required_ioport_array<4> m_keypad; - UINT8 m_keypad_col_mask; + uint8_t m_keypad_col_mask; }; #endif // VERIFONE_TRANZ330_H diff --git a/src/mame/includes/travrusa.h b/src/mame/includes/travrusa.h index 58f36622450..d3d0ed0c9b8 100644 --- a/src/mame/includes/travrusa.h +++ b/src/mame/includes/travrusa.h @@ -13,8 +13,8 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; /* video-related */ tilemap_t* m_bg_tilemap; @@ -32,7 +32,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(travrusa); DECLARE_PALETTE_INIT(shtrider); - UINT32 screen_update_travrusa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_travrusa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void set_scroll( ); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); required_device m_maincpu; diff --git a/src/mame/includes/triplhnt.h b/src/mame/includes/triplhnt.h index 9e98da96c11..c8d99f3962d 100644 --- a/src/mame/includes/triplhnt.h +++ b/src/mame/includes/triplhnt.h @@ -42,16 +42,16 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - UINT8 m_cmos[16]; - UINT8 m_da_latch; - UINT8 m_misc_flags; - UINT8 m_cmos_latch; - UINT8 m_hit_code; - required_shared_ptr m_playfield_ram; - required_shared_ptr m_vpos_ram; - required_shared_ptr m_hpos_ram; - required_shared_ptr m_orga_ram; - required_shared_ptr m_code_ram; + uint8_t m_cmos[16]; + uint8_t m_da_latch; + uint8_t m_misc_flags; + uint8_t m_cmos_latch; + uint8_t m_hit_code; + required_shared_ptr m_playfield_ram; + required_shared_ptr m_vpos_ram; + required_shared_ptr m_hpos_ram; + required_shared_ptr m_orga_ram; + required_shared_ptr m_code_ram; int m_sprite_zoom; int m_sprite_bank; bitmap_ind16 m_helper; @@ -65,7 +65,7 @@ public: TILE_GET_INFO_MEMBER(get_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(triplhnt); - UINT32 screen_update_triplhnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_triplhnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void triplhnt_set_collision(int code); void triplhnt_update_misc(address_space &space, int offset); diff --git a/src/mame/includes/trs80.h b/src/mame/includes/trs80.h index d6868eb2fca..013d4037d13 100644 --- a/src/mame/includes/trs80.h +++ b/src/mame/includes/trs80.h @@ -122,31 +122,31 @@ public: DECLARE_READ8_MEMBER( trs80_gfxram_r ); DECLARE_WRITE8_MEMBER( trs80_gfxram_w ); DECLARE_READ8_MEMBER (trs80_wd179x_r); - const UINT8 *m_p_chargen; - optional_shared_ptr m_p_videoram; - UINT8 *m_p_gfxram; - UINT8 m_model4; - UINT8 m_mode; - UINT8 m_irq; - UINT8 m_mask; - UINT8 m_nmi_mask; - UINT8 m_port_ec; - UINT8 m_tape_unit; - UINT8 m_reg_load; - UINT8 m_nmi_data; + const uint8_t *m_p_chargen; + optional_shared_ptr m_p_videoram; + uint8_t *m_p_gfxram; + uint8_t m_model4; + uint8_t m_mode; + uint8_t m_irq; + uint8_t m_mask; + uint8_t m_nmi_mask; + uint8_t m_port_ec; + uint8_t m_tape_unit; + uint8_t m_reg_load; + uint8_t m_nmi_data; #ifdef USE_TRACK - UINT8 m_track[4]; + uint8_t m_track[4]; #endif - UINT8 m_head; + uint8_t m_head; #ifdef USE_SECTOR - UINT8 m_sector[4]; + uint8_t m_sector[4]; #endif - UINT8 m_cassette_data; + uint8_t m_cassette_data; emu_timer *m_cassette_data_timer; double m_old_cassette_val; - UINT16 m_start_address; - UINT8 m_crtc_reg; - UINT8 m_size_store; + uint16_t m_start_address; + uint8_t m_crtc_reg; + uint8_t m_size_store; DECLARE_DRIVER_INIT(trs80m4); DECLARE_DRIVER_INIT(trs80l2); DECLARE_DRIVER_INIT(trs80m4p); @@ -158,12 +158,12 @@ public: DECLARE_MACHINE_RESET(trs80m4); DECLARE_MACHINE_RESET(lnw80); DECLARE_PALETTE_INIT(lnw80); - UINT32 screen_update_trs80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_trs80m4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_ht1080z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_lnw80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_radionic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_meritum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_trs80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_trs80m4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ht1080z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_lnw80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_radionic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_meritum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(trs80_rtc_interrupt); INTERRUPT_GEN_MEMBER(trs80_fdc_interrupt); TIMER_CALLBACK_MEMBER(cassette_data_callback); diff --git a/src/mame/includes/trs80m2.h b/src/mame/includes/trs80m2.h index 305fd2bab49..55809a5f9ca 100644 --- a/src/mame/includes/trs80m2.h +++ b/src/mame/includes/trs80m2.h @@ -78,13 +78,13 @@ public: required_device m_kb; required_memory_region m_rom; required_memory_region m_char_rom; - optional_shared_ptr m_video_ram; + optional_shared_ptr m_video_ram; virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); @@ -112,8 +112,8 @@ public: int m_msel; // keyboard state - UINT8 m_key_latch; - UINT8 m_key_data; + uint8_t m_key_latch; + uint8_t m_key_data; int m_key_bit; int m_kbclk; int m_kbdata; @@ -156,9 +156,9 @@ public: DECLARE_WRITE8_MEMBER( ual_w ); DECLARE_WRITE8_MEMBER( tcl_w ); - UINT16 m_ual; - UINT8 m_limit[2]; - UINT8 m_offset[2]; + uint16_t m_ual; + uint8_t m_limit[2]; + uint8_t m_offset[2]; }; #endif diff --git a/src/mame/includes/truco.h b/src/mame/includes/truco.h index 627514b74f9..6396900cc53 100644 --- a/src/mame/includes/truco.h +++ b/src/mame/includes/truco.h @@ -19,8 +19,8 @@ public: required_device m_watchdog; required_device m_dac; - required_shared_ptr m_videoram; - required_shared_ptr m_battery_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_battery_ram; int m_trigger; @@ -34,7 +34,7 @@ public: virtual void machine_reset() override; DECLARE_PALETTE_INIT(truco); - 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); INTERRUPT_GEN_MEMBER(interrupt); }; diff --git a/src/mame/includes/trucocl.h b/src/mame/includes/trucocl.h index 3a72c8f9697..96e91d58038 100644 --- a/src/mame/includes/trucocl.h +++ b/src/mame/includes/trucocl.h @@ -20,11 +20,11 @@ public: int m_cur_dac_address; int m_cur_dac_address_index; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; tilemap_t *m_bg_tilemap; - UINT8 m_irq_mask; + uint8_t m_irq_mask; DECLARE_WRITE8_MEMBER(irq_enable_w); DECLARE_WRITE8_MEMBER(trucocl_videoram_w); DECLARE_WRITE8_MEMBER(trucocl_colorram_w); @@ -33,7 +33,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(trucocl); - UINT32 screen_update_trucocl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_trucocl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(trucocl_interrupt); required_device m_maincpu; required_device m_dac; diff --git a/src/mame/includes/tryout.h b/src/mame/includes/tryout.h index 58bf9f4e09c..a8f00617d60 100644 --- a/src/mame/includes/tryout.h +++ b/src/mame/includes/tryout.h @@ -24,16 +24,16 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; - required_shared_ptr m_gfx_control; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_gfx_control; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; - UINT8 m_vram_bank; - std::unique_ptr m_vram; - std::unique_ptr m_vram_gfx; + uint8_t m_vram_bank; + std::unique_ptr m_vram; + std::unique_ptr m_vram_gfx; DECLARE_WRITE8_MEMBER(nmi_ack_w); DECLARE_WRITE8_MEMBER(sound_w); @@ -56,6 +56,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(tryout); - 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); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); }; diff --git a/src/mame/includes/tsamurai.h b/src/mame/includes/tsamurai.h index 5d29d9e4d27..aa0c024e940 100644 --- a/src/mame/includes/tsamurai.h +++ b/src/mame/includes/tsamurai.h @@ -28,10 +28,10 @@ public: required_device m_palette; optional_device m_soundlatch; // vsgongf only - required_shared_ptr m_videoram; - optional_shared_ptr m_colorram; - optional_shared_ptr m_bg_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + optional_shared_ptr m_colorram; + optional_shared_ptr m_bg_videoram; + required_shared_ptr m_spriteram; tilemap_t *m_background; tilemap_t *m_foreground; @@ -105,8 +105,8 @@ public: DECLARE_VIDEO_START(tsamurai); DECLARE_VIDEO_START(vsgongf); - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_vsgongf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vsgongf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); INTERRUPT_GEN_MEMBER(interrupt); diff --git a/src/mame/includes/tsispch.h b/src/mame/includes/tsispch.h index 797eca02687..6b3db7d4f25 100644 --- a/src/mame/includes/tsispch.h +++ b/src/mame/includes/tsispch.h @@ -36,7 +36,7 @@ public: required_device m_uart; required_device m_pic; - UINT8 m_paramReg; // status leds and resets and etc + uint8_t m_paramReg; // status leds and resets and etc virtual void machine_reset() override; DECLARE_WRITE8_MEMBER(i8251_rxd); diff --git a/src/mame/includes/tubep.h b/src/mame/includes/tubep.h index 9494d3c9299..ddf2c2c4c7e 100644 --- a/src/mame/includes/tubep.h +++ b/src/mame/includes/tubep.h @@ -25,38 +25,38 @@ public: m_msm(*this, "msm"), m_screen(*this, "screen") { } - UINT8 m_sound_latch; - UINT8 m_ls74; - UINT8 m_ls377; + uint8_t m_sound_latch; + uint8_t m_ls74; + uint8_t m_ls377; emu_timer *m_interrupt_timer; int m_curr_scanline; - required_shared_ptr m_textram; - optional_shared_ptr m_backgroundram; - required_shared_ptr m_sprite_colorsharedram; - optional_shared_ptr m_rjammer_backgroundram; - std::unique_ptr m_spritemap; - UINT8 m_prom2[32]; - UINT32 m_romD_addr; - UINT32 m_romEF_addr; - UINT32 m_E16_add_b; - UINT32 m_HINV; - UINT32 m_VINV; - UINT32 m_XSize; - UINT32 m_YSize; - UINT32 m_mark_1; - UINT32 m_mark_2; - UINT32 m_colorram_addr_hi; - UINT32 m_ls273_g6; - UINT32 m_ls273_j6; - UINT32 m_romHI_addr_mid; - UINT32 m_romHI_addr_msb; - UINT8 m_DISP; - UINT8 m_background_romsel; - UINT8 m_color_A4; - UINT8 m_ls175_b7; - UINT8 m_ls175_e8; - UINT8 m_ls377_data; - UINT32 m_page; + required_shared_ptr m_textram; + optional_shared_ptr m_backgroundram; + required_shared_ptr m_sprite_colorsharedram; + optional_shared_ptr m_rjammer_backgroundram; + std::unique_ptr m_spritemap; + uint8_t m_prom2[32]; + uint32_t m_romD_addr; + uint32_t m_romEF_addr; + uint32_t m_E16_add_b; + uint32_t m_HINV; + uint32_t m_VINV; + uint32_t m_XSize; + uint32_t m_YSize; + uint32_t m_mark_1; + uint32_t m_mark_2; + uint32_t m_colorram_addr_hi; + uint32_t m_ls273_g6; + uint32_t m_ls273_j6; + uint32_t m_romHI_addr_mid; + uint32_t m_romHI_addr_msb; + uint8_t m_DISP; + uint8_t m_background_romsel; + uint8_t m_color_A4; + uint8_t m_ls175_b7; + uint8_t m_ls175_e8; + uint8_t m_ls377_data; + uint32_t m_page; DECLARE_WRITE8_MEMBER(tubep_LS259_w); DECLARE_WRITE8_MEMBER(main_cpu_irq_line_clear_w); DECLARE_WRITE8_MEMBER(tubep_soundlatch_w); @@ -93,8 +93,8 @@ public: DECLARE_MACHINE_START(rjammer); DECLARE_MACHINE_RESET(rjammer); DECLARE_PALETTE_INIT(rjammer); - UINT32 screen_update_tubep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_rjammer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tubep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rjammer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(tubep_scanline_callback); TIMER_CALLBACK_MEMBER(rjammer_scanline_callback); void draw_sprite(); diff --git a/src/mame/includes/tumbleb.h b/src/mame/includes/tumbleb.h index 6d6fa8d1352..ee4c2a86d17 100644 --- a/src/mame/includes/tumbleb.h +++ b/src/mame/includes/tumbleb.h @@ -25,11 +25,11 @@ public: { } /* memory pointers */ - optional_shared_ptr m_mainram; - required_shared_ptr m_spriteram; - required_shared_ptr m_pf1_data; - required_shared_ptr m_pf2_data; - optional_shared_ptr m_control; + optional_shared_ptr m_mainram; + required_shared_ptr m_spriteram; + required_shared_ptr m_pf1_data; + required_shared_ptr m_pf2_data; + optional_shared_ptr m_control; /* misc */ int m_music_command; @@ -41,8 +41,8 @@ public: tilemap_t *m_pf1_alt_tilemap; tilemap_t *m_pf2_tilemap; tilemap_t *m_pf2_alt_tilemap; - UINT16 m_control_0[8]; - UINT16 m_tilebank; + uint16_t m_control_0[8]; + uint16_t m_tilebank; /* devices */ required_device m_maincpu; @@ -53,8 +53,8 @@ public: optional_device m_sprgen; optional_device m_soundlatch; - UINT8 m_semicom_prot_offset; - UINT16 m_protbase; + uint8_t m_semicom_prot_offset; + uint16_t m_protbase; DECLARE_WRITE16_MEMBER(tumblepb_oki_w); DECLARE_READ16_MEMBER(tumblepb_prot_r); DECLARE_READ16_MEMBER(tumblepopb_controls_r); @@ -109,22 +109,22 @@ public: DECLARE_VIDEO_START(suprtrio); DECLARE_VIDEO_START(pangpang); DECLARE_VIDEO_START(sdfight); - UINT32 screen_update_tumblepb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_jumpkids(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_fncywld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_semicom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_suprtrio(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_pangpang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_semicom_altoffsets(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bcstory(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_semibase(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_sdfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tumblepb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_jumpkids(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_fncywld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_semicom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_suprtrio(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pangpang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_semicom_altoffsets(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bcstory(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_semibase(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_sdfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(tumbleb2_interrupt); void tumbleb_tilemap_redraw(); - inline void get_bg_tile_info( tile_data &tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base); - inline void get_fncywld_bg_tile_info( tile_data &tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base); - inline void pangpang_get_bg_tile_info( tile_data &tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base ); - inline void pangpang_get_bg2x_tile_info( tile_data &tileinfo, int tile_index, int gfx_bank, UINT16 *gfx_base ); + inline void get_bg_tile_info( tile_data &tileinfo, int tile_index, int gfx_bank, uint16_t *gfx_base); + inline void get_fncywld_bg_tile_info( tile_data &tileinfo, int tile_index, int gfx_bank, uint16_t *gfx_base); + inline void pangpang_get_bg_tile_info( tile_data &tileinfo, int tile_index, int gfx_bank, uint16_t *gfx_base ); + inline void pangpang_get_bg2x_tile_info( tile_data &tileinfo, int tile_index, int gfx_bank, uint16_t *gfx_base ); void tumbleb_draw_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pf1x_offs, int pf1y_offs, int pf2x_offs, int pf2y_offs); void tumbleb2_set_music_bank( int bank ); void tumbleb2_play_sound( okim6295_device *oki, int data ); diff --git a/src/mame/includes/tumblep.h b/src/mame/includes/tumblep.h index 7ce833f9d85..7c719701a49 100644 --- a/src/mame/includes/tumblep.h +++ b/src/mame/includes/tumblep.h @@ -26,9 +26,9 @@ public: { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_pf1_rowscroll; - required_shared_ptr m_pf2_rowscroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_pf1_rowscroll; + required_shared_ptr m_pf2_rowscroll; /* devices */ required_device m_maincpu; @@ -41,5 +41,5 @@ public: DECLARE_READ16_MEMBER(tumblepop_controls_r); DECLARE_DRIVER_INIT(tumblep); virtual void machine_start() override; - UINT32 screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tumblep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/tunhunt.h b/src/mame/includes/tunhunt.h index 5ac558adead..3fb59553d6e 100644 --- a/src/mame/includes/tunhunt.h +++ b/src/mame/includes/tunhunt.h @@ -19,12 +19,12 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_workram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_workram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_generic_paletteram_8; - UINT8 m_control; + uint8_t m_control; tilemap_t *m_fg_tilemap; bitmap_ind16 m_tmpbitmap; @@ -42,7 +42,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(tunhunt); - 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); void set_pens(); void draw_motion_object(bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_box(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/turbo.h b/src/mame/includes/turbo.h index 0ac958c6cca..c22ae420c36 100644 --- a/src/mame/includes/turbo.h +++ b/src/mame/includes/turbo.h @@ -48,79 +48,79 @@ public: optional_device m_i8255_2; optional_device m_i8255_3; - required_region_ptr m_spriteroms; - required_region_ptr m_proms; - optional_region_ptr m_roadroms; - optional_region_ptr m_bgcolorrom; + required_region_ptr m_spriteroms; + required_region_ptr m_proms; + optional_region_ptr m_roadroms; + optional_region_ptr m_bgcolorrom; - required_shared_ptr m_videoram; - optional_shared_ptr m_spriteram; - required_shared_ptr m_sprite_position; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_videoram; + optional_shared_ptr m_spriteram; + required_shared_ptr m_sprite_position; + optional_shared_ptr m_decrypted_opcodes; required_device m_samples; required_device m_gfxdecode; required_device m_screen; - std::unique_ptr m_buckrog_bitmap_ram; + std::unique_ptr m_buckrog_bitmap_ram; /* machine states */ - UINT8 m_i8279_scanlines; - UINT8 m_alt_spriteram[0x80]; + uint8_t m_i8279_scanlines; + uint8_t m_alt_spriteram[0x80]; /* sound state */ - UINT8 m_turbo_osel; - UINT8 m_turbo_bsel; - UINT8 m_sound_state[3]; + uint8_t m_turbo_osel; + uint8_t m_turbo_bsel; + uint8_t m_sound_state[3]; /* video state */ tilemap_t * m_fg_tilemap; /* Turbo-specific states */ - UINT8 m_turbo_opa; - UINT8 m_turbo_opb; - UINT8 m_turbo_opc; - UINT8 m_turbo_ipa; - UINT8 m_turbo_ipb; - UINT8 m_turbo_ipc; - UINT8 m_turbo_fbpla; - UINT8 m_turbo_fbcol; - UINT8 m_turbo_speed; - UINT8 m_turbo_collision; - UINT8 m_turbo_last_analog; - UINT8 m_turbo_accel; + uint8_t m_turbo_opa; + uint8_t m_turbo_opb; + uint8_t m_turbo_opc; + uint8_t m_turbo_ipa; + uint8_t m_turbo_ipb; + uint8_t m_turbo_ipc; + uint8_t m_turbo_fbpla; + uint8_t m_turbo_fbcol; + uint8_t m_turbo_speed; + uint8_t m_turbo_collision; + uint8_t m_turbo_last_analog; + uint8_t m_turbo_accel; /* Subroc-specific states */ - UINT8 m_subroc3d_col; - UINT8 m_subroc3d_ply; - UINT8 m_subroc3d_flip; - UINT8 m_subroc3d_mdis; - UINT8 m_subroc3d_mdir; - UINT8 m_subroc3d_tdis; - UINT8 m_subroc3d_tdir; - UINT8 m_subroc3d_fdis; - UINT8 m_subroc3d_fdir; - UINT8 m_subroc3d_hdis; - UINT8 m_subroc3d_hdir; + uint8_t m_subroc3d_col; + uint8_t m_subroc3d_ply; + uint8_t m_subroc3d_flip; + uint8_t m_subroc3d_mdis; + uint8_t m_subroc3d_mdir; + uint8_t m_subroc3d_tdis; + uint8_t m_subroc3d_tdir; + uint8_t m_subroc3d_fdis; + uint8_t m_subroc3d_fdir; + uint8_t m_subroc3d_hdis; + uint8_t m_subroc3d_hdir; /* Buck Rogers-specific states */ - UINT8 m_buckrog_fchg; - UINT8 m_buckrog_mov; - UINT8 m_buckrog_obch; - UINT8 m_buckrog_command; - UINT8 m_buckrog_myship; + uint8_t m_buckrog_fchg; + uint8_t m_buckrog_mov; + uint8_t m_buckrog_obch; + uint8_t m_buckrog_command; + uint8_t m_buckrog_myship; int m_last_sound_a; struct sprite_info { - UINT16 ve; /* VE0-15 signals for this row */ - UINT8 lst; /* LST0-7 signals for this row */ - UINT32 latched[8]; /* latched pixel data */ - UINT8 plb[8]; /* latched PLB state */ - UINT32 offset[8]; /* current offset for this row */ - UINT32 frac[8]; /* leftover fraction */ - UINT32 step[8]; /* stepping value */ + uint16_t ve; /* VE0-15 signals for this row */ + uint8_t lst; /* LST0-7 signals for this row */ + uint32_t latched[8]; /* latched pixel data */ + uint8_t plb[8]; /* latched PLB state */ + uint32_t offset[8]; /* current offset for this row */ + uint32_t frac[8]; /* leftover fraction */ + uint32_t step[8]; /* stepping value */ }; DECLARE_WRITE8_MEMBER(scanlines_w); @@ -161,9 +161,9 @@ public: DECLARE_MACHINE_RESET(buckrog); DECLARE_VIDEO_START(buckrog); DECLARE_PALETTE_INIT(buckrog); - UINT32 screen_update_turbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_subroc3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_buckrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_turbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_subroc3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_buckrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(delayed_i8255_w); DECLARE_WRITE8_MEMBER(turbo_sound_a_w); DECLARE_WRITE8_MEMBER(turbo_sound_b_w); @@ -173,16 +173,16 @@ public: DECLARE_WRITE8_MEMBER(subroc3d_sound_c_w); DECLARE_WRITE8_MEMBER(buckrog_sound_a_w); DECLARE_WRITE8_MEMBER(buckrog_sound_b_w); - inline UINT32 sprite_xscale(UINT8 dacinput, double vr1, double vr2, double cext); - void turbo_prepare_sprites(UINT8 y, sprite_info *info); - UINT32 turbo_get_sprite_bits(UINT8 road, sprite_info *sprinfo); - void subroc3d_prepare_sprites(UINT8 y, sprite_info *info); - UINT32 subroc3d_get_sprite_bits(sprite_info *sprinfo, UINT8 *plb); - void buckrog_prepare_sprites(UINT8 y, sprite_info *info); - UINT32 buckrog_get_sprite_bits(sprite_info *sprinfo, UINT8 *plb); + inline uint32_t sprite_xscale(uint8_t dacinput, double vr1, double vr2, double cext); + void turbo_prepare_sprites(uint8_t y, sprite_info *info); + uint32_t turbo_get_sprite_bits(uint8_t road, sprite_info *sprinfo); + void subroc3d_prepare_sprites(uint8_t y, sprite_info *info); + uint32_t subroc3d_get_sprite_bits(sprite_info *sprinfo, uint8_t *plb); + void buckrog_prepare_sprites(uint8_t y, sprite_info *info); + uint32_t buckrog_get_sprite_bits(sprite_info *sprinfo, uint8_t *plb); void turbo_rom_decode(); void turbo_update_samples(); - inline void subroc3d_update_volume(int leftchan, UINT8 dis, UINT8 dir); + inline void subroc3d_update_volume(int leftchan, uint8_t dis, uint8_t dir); void buckrog_update_samples(); }; diff --git a/src/mame/includes/turrett.h b/src/mame/includes/turrett.h index f883913f695..9ad1c3596af 100644 --- a/src/mame/includes/turrett.h +++ b/src/mame/includes/turrett.h @@ -21,17 +21,17 @@ public: m_screen(*this, "screen") {} // constants - static const UINT32 X_VISIBLE = 336; - static const UINT32 Y_VISIBLE = 244; - static const UINT32 DIMM_BANK_WORDS = 128 * 1024 * 1024 / 2; - static const UINT32 DIMM_BANK_MASK = DIMM_BANK_WORDS - 1; - static const UINT32 VRAM_BANK_WORDS = 256 * 1024; + static const uint32_t X_VISIBLE = 336; + static const uint32_t Y_VISIBLE = 244; + static const uint32_t DIMM_BANK_WORDS = 128 * 1024 * 1024 / 2; + static const uint32_t DIMM_BANK_MASK = DIMM_BANK_WORDS - 1; + static const uint32_t VRAM_BANK_WORDS = 256 * 1024; // devices required_device m_maincpu; required_device m_ata; - required_shared_ptr m_bank_a; - required_shared_ptr m_bank_b; + required_shared_ptr m_bank_a; + required_shared_ptr m_bank_b; required_device m_screen; // handlers @@ -49,35 +49,35 @@ public: INTERRUPT_GEN_MEMBER(adc); // functions - UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 write_video_ram(UINT16 data); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t write_video_ram(uint16_t data); void update_video_addr(void); - UINT32 update_inputs(void); + uint32_t update_inputs(void); // members emu_timer *m_dma_timer; - UINT32 m_inputs_active; - std::unique_ptr m_video_ram[2]; - UINT16 m_last_pixel; - INT32 m_video_ctrl; - UINT16 m_video_fade; - INT16 m_x_pos; - INT16 m_x_start; - INT16 m_x_mod; - INT16 m_dx; - INT16 m_y_pos; - INT16 m_scale_cnt_y; - INT16 m_scale_cnt_x; + uint32_t m_inputs_active; + std::unique_ptr m_video_ram[2]; + uint16_t m_last_pixel; + int32_t m_video_ctrl; + uint16_t m_video_fade; + int16_t m_x_pos; + int16_t m_x_start; + int16_t m_x_mod; + int16_t m_dx; + int16_t m_y_pos; + int16_t m_scale_cnt_y; + int16_t m_scale_cnt_x; bool m_skip_x; bool m_skip_y; - INT16 m_scale; - INT16 m_hotspot_x; - INT16 m_hotspot_y; + int16_t m_scale; + int16_t m_hotspot_x; + int16_t m_hotspot_y; bool m_dma_idle; - UINT32 m_dma_addr[2]; - UINT32 m_ipt_val; - UINT8 m_frame; - UINT8 m_adc; + uint32_t m_dma_addr[2]; + uint32_t m_ipt_val; + uint8_t m_frame; + uint8_t m_adc; protected: // driver_device overrides @@ -90,11 +90,11 @@ class turrett_device : public device_t, public device_sound_interface, public device_memory_interface { - static const UINT32 SOUND_CHANNELS = 32; + static const uint32_t SOUND_CHANNELS = 32; public: // construction/destruction - turrett_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + turrett_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ32_MEMBER(read); DECLARE_WRITE32_MEMBER(write); @@ -118,12 +118,12 @@ private: struct { - UINT32 m_address; - UINT32 m_volume; + uint32_t m_address; + uint32_t m_volume; bool m_playing; } m_channels[SOUND_CHANNELS]; - INT32 m_volume_table[0x50]; + int32_t m_volume_table[0x50]; }; // device type definition diff --git a/src/mame/includes/tutankhm.h b/src/mame/includes/tutankhm.h index b5748db47b0..d7ac01137db 100644 --- a/src/mame/includes/tutankhm.h +++ b/src/mame/includes/tutankhm.h @@ -11,17 +11,17 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_scroll; + required_shared_ptr m_videoram; + required_shared_ptr m_scroll; /* video-related */ tilemap_t *m_bg_tilemap; - UINT8 m_flip_x; - UINT8 m_flip_y; + uint8_t m_flip_x; + uint8_t m_flip_y; /* misc */ - UINT8 m_irq_toggle; - UINT8 m_irq_enable; + uint8_t m_irq_toggle; + uint8_t m_irq_enable; /* devices */ required_device m_maincpu; @@ -34,6 +34,6 @@ public: DECLARE_WRITE8_MEMBER(tutankhm_flip_screen_y_w); DECLARE_MACHINE_START(tutankhm); DECLARE_MACHINE_RESET(tutankhm); - UINT32 screen_update_tutankhm(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tutankhm(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(tutankhm_interrupt); }; diff --git a/src/mame/includes/twin16.h b/src/mame/includes/twin16.h index 12cc3ba158e..c150f291711 100644 --- a/src/mame/includes/twin16.h +++ b/src/mame/includes/twin16.h @@ -35,22 +35,22 @@ public: required_device m_palette; required_device m_spriteram; optional_memory_bank m_gfxrombank; - required_shared_ptr m_fixram; - required_shared_ptr_array m_videoram; - optional_shared_ptr m_zipram; - optional_shared_ptr m_sprite_gfx_ram; - required_region_ptr m_gfxrom; - - UINT16 m_CPUA_register; - UINT16 m_CPUB_register; + required_shared_ptr m_fixram; + required_shared_ptr_array m_videoram; + optional_shared_ptr m_zipram; + optional_shared_ptr m_sprite_gfx_ram; + required_region_ptr m_gfxrom; + + uint16_t m_CPUA_register; + uint16_t m_CPUB_register; bool m_is_fround; - UINT16 m_sprite_buffer[0x800]; + uint16_t m_sprite_buffer[0x800]; emu_timer *m_sprite_timer; int m_sprite_busy; int m_need_process_spriteram; - UINT16 m_scrollx[3]; - UINT16 m_scrolly[3]; - UINT16 m_video_register; + uint16_t m_scrollx[3]; + uint16_t m_scrolly[3]; + uint16_t m_video_register; tilemap_t *m_fixed_tmap; tilemap_t *m_scroll_tmap[2]; @@ -74,7 +74,7 @@ public: TILE_GET_INFO_MEMBER(layer0_tile_info); TILE_GET_INFO_MEMBER(layer1_tile_info); - UINT32 screen_update_twin16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_twin16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_twin16(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(CPUA_interrupt); INTERRUPT_GEN_MEMBER(CPUB_interrupt); @@ -85,7 +85,7 @@ protected: virtual void machine_reset() override; virtual void video_start() override; - virtual void tile_get_info(tile_data &tileinfo, UINT16 data, int color_base); + virtual void tile_get_info(tile_data &tileinfo, uint16_t data, int color_base); private: int set_sprite_timer(); void spriteram_process(); @@ -107,10 +107,10 @@ public: protected: virtual void video_start() override; - virtual void tile_get_info(tile_data &tileinfo, UINT16 data, int color_base) override; + virtual void tile_get_info(tile_data &tileinfo, uint16_t data, int color_base) override; private: - UINT8 m_gfx_bank[4]; + uint8_t m_gfx_bank[4]; }; class cuebrickj_state : public twin16_state @@ -124,5 +124,5 @@ public: DECLARE_DRIVER_INIT(cuebrickj); private: - UINT16 m_nvram[0x400 * 0x20 / 2]; + uint16_t m_nvram[0x400 * 0x20 / 2]; }; diff --git a/src/mame/includes/twincobr.h b/src/mame/includes/twincobr.h index d6b7af85e9e..4d3a5024cc2 100644 --- a/src/mame/includes/twincobr.h +++ b/src/mame/includes/twincobr.h @@ -25,36 +25,36 @@ public: m_palette(*this, "palette") { } - optional_shared_ptr m_sharedram; + optional_shared_ptr m_sharedram; optional_device m_spriteram8; optional_device m_spriteram16; int m_toaplan_main_cpu; - INT32 m_fg_rom_bank; - INT32 m_bg_ram_bank; + int32_t m_fg_rom_bank; + int32_t m_bg_ram_bank; int m_intenable; int m_dsp_on; int m_dsp_BIO; int m_fsharkbt_8741; int m_dsp_execute; - UINT32 m_dsp_addr_w; - UINT32 m_main_ram_seg; - std::unique_ptr m_bgvideoram16; - std::unique_ptr m_fgvideoram16; - std::unique_ptr m_txvideoram16; + uint32_t m_dsp_addr_w; + uint32_t m_main_ram_seg; + std::unique_ptr m_bgvideoram16; + std::unique_ptr m_fgvideoram16; + std::unique_ptr m_txvideoram16; size_t m_bgvideoram_size; size_t m_fgvideoram_size; size_t m_txvideoram_size; - INT32 m_txscrollx; - INT32 m_txscrolly; - INT32 m_fgscrollx; - INT32 m_fgscrolly; - INT32 m_bgscrollx; - INT32 m_bgscrolly; - INT32 m_txoffs; - INT32 m_fgoffs; - INT32 m_bgoffs; - INT32 m_display_on; + int32_t m_txscrollx; + int32_t m_txscrolly; + int32_t m_fgscrollx; + int32_t m_fgscrolly; + int32_t m_bgscrollx; + int32_t m_bgscrolly; + int32_t m_txoffs; + int32_t m_fgoffs; + int32_t m_bgoffs; + int32_t m_display_on; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; tilemap_t *m_tx_tilemap; @@ -106,7 +106,7 @@ public: TILE_GET_INFO_MEMBER(get_tx_tile_info); DECLARE_MACHINE_RESET(twincobr); DECLARE_VIDEO_START(toaplan0); - UINT32 screen_update_toaplan0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_toaplan0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(twincobr_interrupt); INTERRUPT_GEN_MEMBER(wardner_interrupt); void twincobr_restore_dsp(); diff --git a/src/mame/includes/tx0.h b/src/mame/includes/tx0.h index 0295f3250df..cdd436ee467 100644 --- a/src/mame/includes/tx0.h +++ b/src/mame/includes/tx0.h @@ -161,7 +161,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(tx0); - UINT32 screen_update_tx0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tx0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_tx0(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(tx0_interrupt); TIMER_CALLBACK_MEMBER(reader_callback); @@ -170,7 +170,7 @@ public: TIMER_CALLBACK_MEMBER(dis_callback); void tx0_machine_stop(); required_device m_maincpu; - inline void tx0_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color); + inline void tx0_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color); void tx0_plot(int x, int y); void tx0_draw_led(bitmap_ind16 &bitmap, int x, int y, int state); void tx0_draw_multipleled(bitmap_ind16 &bitmap, int x, int y, int value, int nb_bits); @@ -183,10 +183,10 @@ public: void tx0_draw_panel(bitmap_ind16 &bitmap); void tx0_typewriter_linefeed(); void tx0_typewriter_drawchar(int character); - int tape_read(UINT8 *reply); - void tape_write(UINT8 data); + int tape_read(uint8_t *reply); + void tape_write(uint8_t data); void begin_tape_read(int binary); - void typewriter_out(UINT8 data); + void typewriter_out(uint8_t data); void schedule_select(); void schedule_unselect(); void tx0_keyboard(); diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h index 68f9a37739d..2c0e0b8bb00 100644 --- a/src/mame/includes/tx1.h +++ b/src/mame/includes/tx1.h @@ -33,14 +33,14 @@ struct math_t { - UINT16 cpulatch; - UINT16 promaddr; - UINT16 inslatch; - UINT32 mux; - UINT16 ppshift; - UINT32 i0ff; - UINT16 retval; - UINT16 muxlatch; // TX-1 + uint16_t cpulatch; + uint16_t promaddr; + uint16_t inslatch; + uint32_t mux; + uint16_t ppshift; + uint32_t i0ff; + uint16_t retval; + uint16_t muxlatch; // TX-1 int dbgaddr; int dbgpc; }; @@ -50,17 +50,17 @@ struct math_t */ struct sn74s516_t { - INT16 X; - INT16 Y; + int16_t X; + int16_t Y; union { #ifdef LSB_FIRST - struct { UINT16 W; INT16 Z; } as16bit; + struct { uint16_t W; int16_t Z; } as16bit; #else - struct { INT16 Z; UINT16 W; } as16bit; + struct { int16_t Z; uint16_t W; } as16bit; #endif - INT32 ZW32; + int32_t ZW32; } ZW; int code; @@ -70,29 +70,29 @@ struct sn74s516_t struct vregs_t { - UINT16 scol; /* Road colours */ - UINT32 slock; /* Scroll lock */ - UINT8 flags; /* Road flags */ + uint16_t scol; /* Road colours */ + uint32_t slock; /* Scroll lock */ + uint8_t flags; /* Road flags */ - UINT32 ba_val; /* Accumulator */ - UINT32 ba_inc; - UINT32 bank_mode; + uint32_t ba_val; /* Accumulator */ + uint32_t ba_inc; + uint32_t bank_mode; - UINT16 h_val; /* Accumulator */ - UINT16 h_inc; - UINT16 h_init; + uint16_t h_val; /* Accumulator */ + uint16_t h_inc; + uint16_t h_init; - UINT8 slin_val; /* Accumulator */ - UINT8 slin_inc; + uint8_t slin_val; /* Accumulator */ + uint8_t slin_inc; /* Buggyboy only */ - UINT8 wa8; - UINT8 wa4; + uint8_t wa8; + uint8_t wa4; - UINT16 wave_lfsr; - UINT8 sky; - UINT16 gas; - UINT8 shift; + uint16_t wave_lfsr; + uint8_t sky; + uint16_t gas; + uint8_t shift; }; @@ -120,35 +120,35 @@ public: required_device m_maincpu; required_device m_mathcpu; required_device m_audiocpu; - required_shared_ptr m_math_ram; - required_shared_ptr m_vram; - required_shared_ptr m_objram; - required_shared_ptr m_rcram; - required_shared_ptr m_z80_ram; - - required_region_ptr m_char_tiles; - required_region_ptr m_obj_tiles; - required_region_ptr m_road_rom; - required_region_ptr m_obj_map; - required_region_ptr m_obj_luts; - required_region_ptr m_proms; + required_shared_ptr m_math_ram; + required_shared_ptr m_vram; + required_shared_ptr m_objram; + required_shared_ptr m_rcram; + required_shared_ptr m_z80_ram; + + required_region_ptr m_char_tiles; + required_region_ptr m_obj_tiles; + required_region_ptr m_road_rom; + required_region_ptr m_obj_map; + required_region_ptr m_obj_luts; + required_region_ptr m_proms; required_device m_screen; emu_timer *m_interrupt_timer; - UINT8 m_ppi_latch_a; - UINT8 m_ppi_latch_b; - UINT32 m_ts; + uint8_t m_ppi_latch_a; + uint8_t m_ppi_latch_b; + uint32_t m_ts; math_t m_math; sn74s516_t m_sn74s516; vregs_t m_vregs; - std::unique_ptr m_chr_bmp; - std::unique_ptr m_obj_bmp; - std::unique_ptr m_rod_bmp; + std::unique_ptr m_chr_bmp; + std::unique_ptr m_obj_bmp; + std::unique_ptr m_rod_bmp; std::unique_ptr m_bitmap; bool m_needs_update; @@ -197,32 +197,32 @@ public: DECLARE_PALETTE_INIT(buggyboy); DECLARE_VIDEO_START(buggybjr); - void tx1_draw_char(UINT8 *bitmap); - void tx1_draw_road_pixel(int screen, UINT8 *bmpaddr, - UINT8 apix[3], UINT8 bpix[3], UINT32 pixnuma, UINT32 pixnumb, - UINT8 stl, UINT8 sld, UINT8 selb, - UINT8 bnk, UINT8 rorev, UINT8 eb, UINT8 r, UINT8 delr); - void tx1_draw_road(UINT8 *bitmap); - void tx1_draw_objects(UINT8 *bitmap); + void tx1_draw_char(uint8_t *bitmap); + void tx1_draw_road_pixel(int screen, uint8_t *bmpaddr, + uint8_t apix[3], uint8_t bpix[3], uint32_t pixnuma, uint32_t pixnumb, + uint8_t stl, uint8_t sld, uint8_t selb, + uint8_t bnk, uint8_t rorev, uint8_t eb, uint8_t r, uint8_t delr); + void tx1_draw_road(uint8_t *bitmap); + void tx1_draw_objects(uint8_t *bitmap); void tx1_update_layers(); void tx1_combine_layers(bitmap_ind16 &bitmap, int screen); - void buggyboy_draw_char(UINT8 *bitmap, bool wide); - void buggyboy_get_roadpix(int screen, int ls161, UINT8 rva0_6, UINT8 sld, UINT32 *_rorev, - UINT8 *rc0, UINT8 *rc1, UINT8 *rc2, UINT8 *rc3); - void buggyboy_draw_road(UINT8 *bitmap); - void buggybjr_draw_road(UINT8 *bitmap); - void buggyboy_draw_objs(UINT8 *bitmap, bool wide); + void buggyboy_draw_char(uint8_t *bitmap, bool wide); + void buggyboy_get_roadpix(int screen, int ls161, uint8_t rva0_6, uint8_t sld, uint32_t *_rorev, + uint8_t *rc0, uint8_t *rc1, uint8_t *rc2, uint8_t *rc3); + void buggyboy_draw_road(uint8_t *bitmap); + void buggybjr_draw_road(uint8_t *bitmap); + void buggyboy_draw_objs(uint8_t *bitmap, bool wide); void bb_combine_layers(bitmap_ind16 &bitmap, int screen); void bb_update_layers(); - UINT32 screen_update_tx1_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tx1_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tx1_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_buggyboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_buggyboy_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_buggyboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_buggybjr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tx1_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tx1_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tx1_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_buggyboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_buggyboy_middle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_buggyboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_buggybjr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_tx1(screen_device &screen, bool state); void screen_eof_buggyboy(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(z80_irq); @@ -241,11 +241,11 @@ struct pit8253_state union { #ifdef LSB_FIRST - struct { UINT8 LSB; UINT8 MSB; } as8bit; + struct { uint8_t LSB; uint8_t MSB; } as8bit; #else - struct { UINT8 MSB; UINT8 LSB; } as8bit; + struct { uint8_t MSB; uint8_t LSB; } as8bit; #endif - UINT16 val; + uint16_t val; } counts[3]; int idx[3]; @@ -255,8 +255,8 @@ class tx1_sound_device : public device_t, public device_sound_interface { public: - tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tx1_sound_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); + tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tx1_sound_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); ~tx1_sound_device() {} DECLARE_READ8_MEMBER( pit8253_r ); @@ -275,15 +275,15 @@ protected: // internal state sound_stream *m_stream; - UINT32 m_freq_to_step; - UINT32 m_step0; - UINT32 m_step1; - UINT32 m_step2; + uint32_t m_freq_to_step; + uint32_t m_step0; + uint32_t m_step1; + uint32_t m_step2; pit8253_state m_pit8253; - UINT8 m_ay_outputa; - UINT8 m_ay_outputb; + uint8_t m_ay_outputa; + uint8_t m_ay_outputb; stream_sample_t m_pit0; stream_sample_t m_pit1; @@ -301,10 +301,10 @@ protected: int m_noise_lfsrc; int m_noise_lfsrd; int m_noise_counter; - UINT8 m_ym1_outputa; - UINT8 m_ym2_outputa; - UINT8 m_ym2_outputb; - UINT16 m_eng_voltages[16]; + uint8_t m_ym1_outputa; + uint8_t m_ym2_outputa; + uint8_t m_ym2_outputb; + uint16_t m_eng_voltages[16]; }; extern const device_type TX1; @@ -312,7 +312,7 @@ extern const device_type TX1; class buggyboy_sound_device : public tx1_sound_device { public: - buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( ym1_a_w ); DECLARE_WRITE8_MEMBER( ym2_a_w ); diff --git a/src/mame/includes/ultraman.h b/src/mame/includes/ultraman.h index c0873b8efb3..4ad0d2a89df 100644 --- a/src/mame/includes/ultraman.h +++ b/src/mame/includes/ultraman.h @@ -42,7 +42,7 @@ public: DECLARE_WRITE16_MEMBER(ultraman_gfxctrl_w); virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_ultraman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ultraman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); K051316_CB_MEMBER(zoom_callback_1); K051316_CB_MEMBER(zoom_callback_2); K051316_CB_MEMBER(zoom_callback_3); diff --git a/src/mame/includes/ultratnk.h b/src/mame/includes/ultratnk.h index af7920cf6c2..f93ecbfc5f0 100644 --- a/src/mame/includes/ultratnk.h +++ b/src/mame/includes/ultratnk.h @@ -27,7 +27,7 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette") { } - required_shared_ptr m_videoram; + required_shared_ptr m_videoram; int m_da_latch; int m_collision[4]; tilemap_t* m_playfield; @@ -54,7 +54,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(ultratnk); - UINT32 screen_update_ultratnk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ultratnk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_ultratnk(screen_device &screen, bool state); TIMER_CALLBACK_MEMBER(nmi_callback); required_device m_maincpu; diff --git a/src/mame/includes/undrfire.h b/src/mame/includes/undrfire.h index e746a414dc0..53cffbe88d5 100644 --- a/src/mame/includes/undrfire.h +++ b/src/mame/includes/undrfire.h @@ -44,15 +44,15 @@ public: required_device m_tc0480scp; required_device m_eeprom; required_device m_watchdog; - optional_shared_ptr m_ram; - optional_shared_ptr m_shared_ram; - UINT16 m_coin_word; - UINT16 m_port_sel; + optional_shared_ptr m_ram; + optional_shared_ptr m_shared_ram; + uint16_t m_coin_word; + uint16_t m_port_sel; int m_frame_counter; std::unique_ptr m_spritelist; - UINT16 m_rotate_ctrl[8]; - UINT8 m_dislayer[6]; - required_shared_ptr m_spriteram; + uint16_t m_rotate_ctrl[8]; + uint8_t m_dislayer[6]; + required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_palette; @@ -72,8 +72,8 @@ public: DECLARE_DRIVER_INIT(undrfire); DECLARE_DRIVER_INIT(cbombers); virtual void video_start() override; - UINT32 screen_update_undrfire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_cbombers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_undrfire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_cbombers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(undrfire_interrupt); void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs); void draw_sprites_cbombers(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs); diff --git a/src/mame/includes/unico.h b/src/mame/includes/unico.h index 26ac4e35f26..c050abd3706 100644 --- a/src/mame/includes/unico.h +++ b/src/mame/includes/unico.h @@ -17,12 +17,12 @@ public: m_generic_paletteram_16(*this, "paletteram"), m_generic_paletteram_32(*this, "paletteram") { } - std::unique_ptr m_vram; - std::unique_ptr m_scroll; + std::unique_ptr m_vram; + std::unique_ptr m_scroll; tilemap_t *m_tilemap[3]; int m_sprites_scrolldx; int m_sprites_scrolldy; - std::unique_ptr m_spriteram; + std::unique_ptr m_spriteram; DECLARE_WRITE16_MEMBER(zeropnt_sound_bank_w); DECLARE_READ16_MEMBER(unico_gunx_0_msb_r); DECLARE_READ16_MEMBER(unico_guny_0_msb_r); @@ -49,7 +49,7 @@ public: DECLARE_MACHINE_RESET(unico); DECLARE_VIDEO_START(unico); DECLARE_MACHINE_RESET(zeropt); - UINT32 screen_update_unico(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_unico(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void unico_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect); required_device m_maincpu; optional_device m_oki; @@ -57,6 +57,6 @@ public: required_device m_gfxdecode; required_device m_screen; required_device m_palette; - optional_shared_ptr m_generic_paletteram_16; - optional_shared_ptr m_generic_paletteram_32; + optional_shared_ptr m_generic_paletteram_16; + optional_shared_ptr m_generic_paletteram_32; }; diff --git a/src/mame/includes/usgames.h b/src/mame/includes/usgames.h index 1de018636cc..0b3dfd7dc8f 100644 --- a/src/mame/includes/usgames.h +++ b/src/mame/includes/usgames.h @@ -13,8 +13,8 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_videoram; - required_shared_ptr m_charram; + required_shared_ptr m_videoram; + required_shared_ptr m_charram; tilemap_t *m_tilemap; @@ -30,5 +30,5 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(usgames); - 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); }; diff --git a/src/mame/includes/ut88.h b/src/mame/includes/ut88.h index f71c43552a6..1cf0c5cc179 100644 --- a/src/mame/includes/ut88.h +++ b/src/mame/includes/ut88.h @@ -60,7 +60,7 @@ public: DECLARE_READ8_MEMBER(ut88_8255_portb_r); DECLARE_READ8_MEMBER(ut88_8255_portc_r); DECLARE_WRITE8_MEMBER(ut88_8255_porta_w); - optional_shared_ptr m_p_videoram; + optional_shared_ptr m_p_videoram; int m_keyboard_mask; int m_lcd_digit[6]; DECLARE_DRIVER_INIT(ut88); @@ -69,7 +69,7 @@ public: DECLARE_VIDEO_START(ut88); DECLARE_MACHINE_START(ut88mini); DECLARE_MACHINE_RESET(ut88mini); - UINT32 screen_update_ut88(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_ut88(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: required_memory_region m_region_maincpu; diff --git a/src/mame/includes/v1050.h b/src/mame/includes/v1050.h index bfb2f82ba82..839a1afc80b 100644 --- a/src/mame/includes/v1050.h +++ b/src/mame/includes/v1050.h @@ -189,19 +189,19 @@ public: // HACK for MC6845 required_device m_sasi_data_in; required_device m_sasi_ctrl_in; required_memory_region m_rom; - required_shared_ptr m_video_ram; - optional_shared_ptr m_attr_ram; + required_shared_ptr m_video_ram; + optional_shared_ptr m_attr_ram; // interrupt state - UINT8 m_int_mask; // interrupt mask - UINT8 m_int_state; + uint8_t m_int_mask; // interrupt mask + uint8_t m_int_state; int m_f_int_enb; // floppy interrupt enable bool m_fdc_irq; bool m_fdc_drq; // keyboard state - UINT8 m_keylatch; // keyboard row select - UINT8 m_keydata; + uint8_t m_keylatch; // keyboard row select + uint8_t m_keydata; int m_keyavail; // serial state @@ -210,17 +210,17 @@ public: // HACK for MC6845 int m_baud_sel; // baud select // memory state - UINT8 m_bank; // bank register + uint8_t m_bank; // bank register // video state - UINT8 m_attr; // attribute latch + uint8_t m_attr; // attribute latch // sasi state - UINT8 m_sasi_data; + uint8_t m_sasi_data; int m_sasi_data_enable; - UINT8 m_rtc_ppi_pa; - UINT8 m_rtc_ppi_pc; + uint8_t m_rtc_ppi_pa; + uint8_t m_rtc_ppi_pc; int m_centronics_busy; int m_centronics_perror; diff --git a/src/mame/includes/vaportra.h b/src/mame/includes/vaportra.h index a04da263168..ddd827cf152 100644 --- a/src/mame/includes/vaportra.h +++ b/src/mame/includes/vaportra.h @@ -37,11 +37,11 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_generic_paletteram_16; - required_shared_ptr m_generic_paletteram2_16; + required_shared_ptr m_generic_paletteram_16; + required_shared_ptr m_generic_paletteram2_16; /* misc */ - UINT16 m_priority[2]; + uint16_t m_priority[2]; DECLARE_WRITE16_MEMBER(vaportra_sound_w); DECLARE_READ16_MEMBER(vaportra_control_r); @@ -54,7 +54,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_vaportra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vaportra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void update_24bitcol( int offset ); DECO16IC_BANK_CB_MEMBER(bank_callback); diff --git a/src/mame/includes/vastar.h b/src/mame/includes/vastar.h index b12600180b6..f5d024931dd 100644 --- a/src/mame/includes/vastar.h +++ b/src/mame/includes/vastar.h @@ -20,23 +20,23 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_bg1videoram; - required_shared_ptr m_bg2videoram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_sprite_priority; - required_shared_ptr m_sharedram; + required_shared_ptr m_bg1videoram; + required_shared_ptr m_bg2videoram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_sprite_priority; + required_shared_ptr m_sharedram; // these are pointers into m_fgvideoram - UINT8* m_bg1_scroll; - UINT8* m_bg2_scroll; - UINT8* m_spriteram1; - UINT8* m_spriteram2; - UINT8* m_spriteram3; + uint8_t* m_bg1_scroll; + uint8_t* m_bg2_scroll; + uint8_t* m_spriteram1; + uint8_t* m_spriteram2; + uint8_t* m_spriteram3; tilemap_t *m_fg_tilemap; tilemap_t *m_bg1_tilemap; tilemap_t *m_bg2_tilemap; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; DECLARE_WRITE8_MEMBER(hold_cpu2_w); DECLARE_WRITE8_MEMBER(flip_screen_w); @@ -53,7 +53,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); diff --git a/src/mame/includes/vball.h b/src/mame/includes/vball.h index 65613c99715..b9a1faaa6b4 100644 --- a/src/mame/includes/vball.h +++ b/src/mame/includes/vball.h @@ -26,10 +26,10 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_attribram; - required_shared_ptr m_videoram; - required_shared_ptr m_scrolly_lo; - required_shared_ptr m_spriteram; + required_shared_ptr m_attribram; + required_shared_ptr m_videoram; + required_shared_ptr m_scrolly_lo; + required_shared_ptr m_spriteram; int m_scrollx_hi; int m_scrolly_hi; @@ -54,7 +54,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); TIMER_DEVICE_CALLBACK_MEMBER(vball_scanline); void bgprombank_w(int bank); void spprombank_w(int bank); diff --git a/src/mame/includes/vc4000.h b/src/mame/includes/vc4000.h index 36ce2c0d37b..e5d19193633 100644 --- a/src/mame/includes/vc4000.h +++ b/src/mame/includes/vc4000.h @@ -27,7 +27,7 @@ struct SPRITE_HELPER { - UINT8 bitmap[10],x1,x2,y1,y2, res1, res2; + uint8_t bitmap[10],x1,x2,y1,y2, res1, res2; }; struct SPRITE @@ -38,7 +38,7 @@ struct SPRITE int delay; int size; int y; - UINT8 scolor; + uint8_t scolor; int finished; int finished_now; }; @@ -47,29 +47,29 @@ struct vc4000_video_t { SPRITE sprites[4]; int line; - UINT8 sprite_collision; - UINT8 background_collision; + uint8_t sprite_collision; + uint8_t background_collision; union { - UINT8 data[0x100]; + uint8_t data[0x100]; struct { SPRITE_HELPER sprites[3]; - UINT8 res[0x10]; + uint8_t res[0x10]; SPRITE_HELPER sprite4; - UINT8 res2[0x30]; - UINT8 grid[20][2]; - UINT8 grid_control[5]; - UINT8 res3[0x13]; - UINT8 sprite_sizes; - UINT8 sprite_colors[2]; - UINT8 score_control; - UINT8 res4[2]; - UINT8 background; - UINT8 sound; - UINT8 bcd[2]; - UINT8 background_collision; - UINT8 sprite_collision; + uint8_t res2[0x30]; + uint8_t grid[20][2]; + uint8_t grid_control[5]; + uint8_t res3[0x13]; + uint8_t sprite_sizes; + uint8_t sprite_colors[2]; + uint8_t score_control; + uint8_t res4[2]; + uint8_t background; + uint8_t sound; + uint8_t bcd[2]; + uint8_t background_collision; + uint8_t sprite_collision; } d; } reg; } ; @@ -110,19 +110,19 @@ public: DECLARE_READ8_MEMBER(elektor_cass_r); DECLARE_WRITE8_MEMBER(elektor_cass_w); vc4000_video_t m_video; - UINT8 m_sprite_collision[0x20]; - UINT8 m_background_collision[0x20]; - UINT8 m_joy1_x; - UINT8 m_joy1_y; - UINT8 m_joy2_x; - UINT8 m_joy2_y; - UINT8 m_objects[512]; - UINT8 m_irq_pause; + uint8_t m_sprite_collision[0x20]; + uint8_t m_background_collision[0x20]; + uint8_t m_joy1_x; + uint8_t m_joy1_y; + uint8_t m_joy2_x; + uint8_t m_joy2_y; + uint8_t m_objects[512]; + uint8_t m_irq_pause; std::unique_ptr m_bitmap; virtual void machine_start() override; virtual void video_start() override; DECLARE_PALETTE_INIT(vc4000); - UINT32 screen_update_vc4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vc4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vc4000_video_line); DECLARE_QUICKLOAD_LOAD_MEMBER(vc4000); @@ -148,11 +148,11 @@ protected: required_ioport m_joys; required_ioport m_config; #endif - inline UINT8 vc4000_joystick_return_to_centre(UINT8 joy); + inline uint8_t vc4000_joystick_return_to_centre(uint8_t joy); void vc4000_draw_digit(bitmap_ind16 &bitmap, int x, int y, int d, int line); - inline void vc4000_collision_plot(UINT8 *collision, UINT8 data, UINT8 color, int scale); - void vc4000_sprite_update(bitmap_ind16 &bitmap, UINT8 *collision, SPRITE *This); - inline void vc4000_draw_grid(UINT8 *collision); + inline void vc4000_collision_plot(uint8_t *collision, uint8_t data, uint8_t color, int scale); + void vc4000_sprite_update(bitmap_ind16 &bitmap, uint8_t *collision, SPRITE *This); + inline void vc4000_draw_grid(uint8_t *collision); }; #endif /* VC4000_H_ */ diff --git a/src/mame/includes/vector06.h b/src/mame/includes/vector06.h index 3d1730b26a6..423f1f4b519 100644 --- a/src/mame/includes/vector06.h +++ b/src/mame/includes/vector06.h @@ -77,7 +77,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(vector06); - UINT32 screen_update_vector06(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vector06(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vector06_interrupt); TIMER_CALLBACK_MEMBER(reset_check_callback); IRQ_CALLBACK_MEMBER(vector06_irq_callback); @@ -103,14 +103,14 @@ private: required_ioport_array<9> m_line; required_ioport m_reset; - UINT8 m_keyboard_mask; - UINT8 m_color_index; - UINT8 m_video_mode; - UINT8 m_romdisk_msb; - UINT8 m_romdisk_lsb; - UINT8 m_vblank_state; - UINT8 m_rambank; - UINT8 m_aylatch; + uint8_t m_keyboard_mask; + uint8_t m_color_index; + uint8_t m_video_mode; + uint8_t m_romdisk_msb; + uint8_t m_romdisk_lsb; + uint8_t m_vblank_state; + uint8_t m_rambank; + uint8_t m_aylatch; bool m_stack_state; bool m_romen; diff --git a/src/mame/includes/vectrex.h b/src/mame/includes/vectrex.h index b76cdd6cdd4..61ceaa45c51 100644 --- a/src/mame/includes/vectrex.h +++ b/src/mame/includes/vectrex.h @@ -59,9 +59,9 @@ public: m_screen(*this, "screen") { } - required_shared_ptr m_gce_vectorram; + required_shared_ptr m_gce_vectorram; int m_imager_status; - UINT32 m_beam_color; + uint32_t m_beam_color; unsigned char m_via_out[2]; double m_imager_freq; emu_timer *m_imager_timer; @@ -84,16 +84,16 @@ public: int m_pen_y; emu_timer *m_lp_t; emu_timer *m_refresh; - UINT8 m_blank; - UINT8 m_ramp; - INT8 m_analog[5]; + uint8_t m_blank; + uint8_t m_ramp; + int8_t m_analog[5]; int m_point_index; int m_display_start; int m_display_end; vectrex_point m_points[NVECT]; - UINT16 m_via_timer2; + uint16_t m_via_timer2; attotime m_vector_start_time; - UINT8 m_cb2; + uint8_t m_cb2; void (vectrex_state::*vector_add_point_function)(int, int, rgb_t, int); DECLARE_WRITE8_MEMBER(vectrex_psg_port_w); DECLARE_READ8_MEMBER(vectrex_via_r); @@ -103,7 +103,7 @@ public: virtual void video_start() override; virtual void machine_start() override; DECLARE_VIDEO_START(raaspec); - UINT32 screen_update_vectrex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vectrex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(vectrex_imager_change_color); TIMER_CALLBACK_MEMBER(update_level); TIMER_CALLBACK_MEMBER(vectrex_imager_eye); diff --git a/src/mame/includes/vendetta.h b/src/mame/includes/vendetta.h index b68c15c214b..d7754a44908 100644 --- a/src/mame/includes/vendetta.h +++ b/src/mame/includes/vendetta.h @@ -67,7 +67,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - 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); INTERRUPT_GEN_MEMBER(irq); diff --git a/src/mame/includes/vertigo.h b/src/mame/includes/vertigo.h index 25d88a6ce72..9d5d67c9fa4 100644 --- a/src/mame/includes/vertigo.h +++ b/src/mame/includes/vertigo.h @@ -21,63 +21,63 @@ struct am2901 { - UINT32 ram[16]; /* internal ram */ - UINT32 d; /* direct data D input */ - UINT32 q; /* Q register */ - UINT32 f; /* F ALU result */ - UINT32 y; /* Y output */ + uint32_t ram[16]; /* internal ram */ + uint32_t d; /* direct data D input */ + uint32_t q; /* Q register */ + uint32_t f; /* F ALU result */ + uint32_t y; /* Y output */ }; class vector_generator { public: - UINT32 sreg; /* shift register */ - UINT32 l1; /* latch 1 adder operand only */ - UINT32 l2; /* latch 2 adder operand only */ - UINT32 c_v; /* vertical position counter */ - UINT32 c_h; /* horizontal position counter */ - UINT32 c_l; /* length counter */ - UINT32 adder_s; /* slope generator result and B input */ - UINT32 adder_a; /* slope generator A input */ - UINT32 color; /* color */ - UINT32 intensity; /* intensity */ - UINT32 brez; /* h/v-counters enable */ - UINT32 vfin; /* drawing yes/no */ - UINT32 hud1; /* h-counter up or down (stored in L1) */ - UINT32 hud2; /* h-counter up or down (stored in L2) */ - UINT32 vud1; /* v-counter up or down (stored in L1) */ - UINT32 vud2; /* v-counter up or down (stored in L2) */ - UINT32 hc1; /* use h- or v-counter in L1 mode */ - UINT32 ven; /* vector intensity enable */ + uint32_t sreg; /* shift register */ + uint32_t l1; /* latch 1 adder operand only */ + uint32_t l2; /* latch 2 adder operand only */ + uint32_t c_v; /* vertical position counter */ + uint32_t c_h; /* horizontal position counter */ + uint32_t c_l; /* length counter */ + uint32_t adder_s; /* slope generator result and B input */ + uint32_t adder_a; /* slope generator A input */ + uint32_t color; /* color */ + uint32_t intensity; /* intensity */ + uint32_t brez; /* h/v-counters enable */ + uint32_t vfin; /* drawing yes/no */ + uint32_t hud1; /* h-counter up or down (stored in L1) */ + uint32_t hud2; /* h-counter up or down (stored in L2) */ + uint32_t vud1; /* v-counter up or down (stored in L1) */ + uint32_t vud2; /* v-counter up or down (stored in L2) */ + uint32_t hc1; /* use h- or v-counter in L1 mode */ + uint32_t ven; /* vector intensity enable */ }; struct microcode { - UINT32 x; - UINT32 a; - UINT32 b; - UINT32 inst; - UINT32 dest; - UINT32 cn; - UINT32 mreq; - UINT32 rsel; - UINT32 rwrite; - UINT32 of; - UINT32 iif; - UINT32 oa; - UINT32 jpos; - UINT32 jmp; - UINT32 jcon; - UINT32 ma; + uint32_t x; + uint32_t a; + uint32_t b; + uint32_t inst; + uint32_t dest; + uint32_t cn; + uint32_t mreq; + uint32_t rsel; + uint32_t rwrite; + uint32_t of; + uint32_t iif; + uint32_t oa; + uint32_t jpos; + uint32_t jmp; + uint32_t jcon; + uint32_t ma; }; struct vproc { - UINT16 sram[64]; /* external sram */ - UINT16 ramlatch; /* latch between 2901 and sram */ - UINT16 rom_adr; /* vector ROM/RAM address latch */ - UINT32 pc; /* program counter */ - UINT32 ret; /* return address */ + uint16_t sram[64]; /* external sram */ + uint16_t ramlatch; /* latch between 2901 and sram */ + uint16_t rom_adr; /* vector ROM/RAM address latch */ + uint32_t pc; /* program counter */ + uint32_t ret; /* return address */ }; @@ -102,14 +102,14 @@ public: required_device m_custom; required_device m_ttl74148; required_device m_vector; - required_shared_ptr m_vectorram; + required_shared_ptr m_vectorram; attotime m_irq4_time; - UINT8 m_irq_state; - UINT8 m_adc_result; + uint8_t m_irq_state; + uint8_t m_adc_result; vproc m_vs; am2901 m_bsp; vector_generator m_vgen; - UINT16 *m_vectorrom; + uint16_t *m_vectorrom; microcode m_mc[MC_LENGTH]; DECLARE_READ16_MEMBER(vertigo_io_convert); DECLARE_READ16_MEMBER(vertigo_io_adc); diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h index 544d98a94c8..75062f2886b 100644 --- a/src/mame/includes/vicdual.h +++ b/src/mame/includes/vicdual.h @@ -45,8 +45,8 @@ public: required_device m_screen; optional_memory_region m_proms; - required_shared_ptr m_videoram; - required_shared_ptr m_characterram; + required_shared_ptr m_videoram; + required_shared_ptr m_characterram; required_ioport m_in0; required_ioport m_in1; @@ -55,9 +55,9 @@ public: optional_ioport m_color_bw; optional_ioport_array<2> m_fake_lives; - UINT8 m_coin_status; - UINT8 m_palette_bank; - UINT8 m_samurai_protection_data; + uint8_t m_coin_status; + uint8_t m_palette_bank; + uint8_t m_samurai_protection_data; int m_nsub_coin_counter; int m_nsub_play_counter; int m_port1State; @@ -149,9 +149,9 @@ public: virtual void machine_start() override; - UINT32 screen_update_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); int get_vcounter(); int is_cabinet_color(); }; diff --git a/src/mame/includes/victory.h b/src/mame/includes/victory.h index 499432ec87f..2255c7b38a6 100644 --- a/src/mame/includes/victory.h +++ b/src/mame/includes/victory.h @@ -21,13 +21,13 @@ /* microcode state */ struct micro_t { - UINT16 i; - UINT16 pc; - UINT8 r,g,b; - UINT8 xp,yp; - UINT8 cmd,cmdlo; + uint16_t i; + uint16_t pc; + uint8_t r,g,b; + uint8_t xp,yp; + uint8_t cmd,cmdlo; emu_timer * timer; - UINT8 timer_active; + uint8_t timer_active; attotime endtime; }; @@ -46,25 +46,25 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_charram; - - UINT16 m_paletteram[0x40]; - std::unique_ptr m_bgbitmap; - std::unique_ptr m_fgbitmap; - std::unique_ptr m_rram; - std::unique_ptr m_gram; - std::unique_ptr m_bram; - UINT8 m_vblank_irq; - UINT8 m_fgcoll; - UINT8 m_fgcollx; - UINT8 m_fgcolly; - UINT8 m_bgcoll; - UINT8 m_bgcollx; - UINT8 m_bgcolly; - UINT8 m_scrollx; - UINT8 m_scrolly; - UINT8 m_video_control; + required_shared_ptr m_videoram; + required_shared_ptr m_charram; + + uint16_t m_paletteram[0x40]; + std::unique_ptr m_bgbitmap; + std::unique_ptr m_fgbitmap; + std::unique_ptr m_rram; + std::unique_ptr m_gram; + std::unique_ptr m_bram; + uint8_t m_vblank_irq; + uint8_t m_fgcoll; + uint8_t m_fgcollx; + uint8_t m_fgcolly; + uint8_t m_bgcoll; + uint8_t m_bgcollx; + uint8_t m_bgcolly; + uint8_t m_scrollx; + uint8_t m_scrolly; + uint8_t m_video_control; struct micro_t m_micro; DECLARE_WRITE8_MEMBER(lamp_control_w); @@ -74,7 +74,7 @@ public: virtual void video_start() override; - 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); INTERRUPT_GEN_MEMBER(vblank_interrupt); TIMER_CALLBACK_MEMBER(bgcoll_irq_callback); diff --git a/src/mame/includes/vidbrain.h b/src/mame/includes/vidbrain.h index 7ff38b6b57a..ba9b082bd7d 100644 --- a/src/mame/includes/vidbrain.h +++ b/src/mame/includes/vidbrain.h @@ -84,13 +84,13 @@ public: void interrupt_check(); // F3853 SMI state - UINT16 m_vector; + uint16_t m_vector; int m_int_enable; int m_ext_int_latch; int m_timer_int_latch; // keyboard state - UINT8 m_keylatch; + uint8_t m_keylatch; int m_joy_enable; // sound state diff --git a/src/mame/includes/videopin.h b/src/mame/includes/videopin.h index 93831beddad..083d094e227 100644 --- a/src/mame/includes/videopin.h +++ b/src/mame/includes/videopin.h @@ -40,12 +40,12 @@ public: required_device m_screen; required_device m_palette; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; attotime m_time_pushed; attotime m_time_released; - UINT8 m_prev; - UINT8 m_mask; + uint8_t m_prev; + uint8_t m_mask; int m_ball_x; int m_ball_y; tilemap_t* m_bg_tilemap; @@ -66,7 +66,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); TIMER_CALLBACK_MEMBER(interrupt_callback); void update_plunger(); diff --git a/src/mame/includes/vigilant.h b/src/mame/includes/vigilant.h index a83bea427eb..f2cf295ea81 100644 --- a/src/mame/includes/vigilant.h +++ b/src/mame/includes/vigilant.h @@ -19,10 +19,10 @@ public: required_device m_audio; required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_generic_paletteram_8; + required_shared_ptr m_generic_paletteram_8; - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; int m_horiz_scroll_low; int m_horiz_scroll_high; @@ -50,8 +50,8 @@ public: virtual void video_start() override; virtual void video_reset() override; - UINT32 screen_update_vigilant(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kikcubic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vigilant(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kikcubic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void update_background(); void draw_foreground(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int opaque ); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/vindictr.h b/src/mame/includes/vindictr.h index 1a12da72cce..019c443004b 100644 --- a/src/mame/includes/vindictr.h +++ b/src/mame/includes/vindictr.h @@ -24,9 +24,9 @@ public: required_device m_alpha_tilemap; required_device m_mob; required_device m_jsa; - UINT8 m_playfield_tile_bank; - UINT16 m_playfield_xscroll; - UINT16 m_playfield_yscroll; + uint8_t m_playfield_tile_bank; + uint16_t m_playfield_xscroll; + uint16_t m_playfield_yscroll; virtual void update_interrupts() override; virtual void scanline_update(screen_device &screen, int scanline) override; DECLARE_READ16_MEMBER(port1_r); @@ -36,7 +36,7 @@ public: DECLARE_MACHINE_START(vindictr); DECLARE_MACHINE_RESET(vindictr); DECLARE_VIDEO_START(vindictr); - UINT32 screen_update_vindictr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vindictr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_WRITE16_MEMBER( vindictr_paletteram_w ); static const atari_motion_objects_config s_mob_config; diff --git a/src/mame/includes/vip.h b/src/mame/includes/vip.h index eed5c690285..fe576620ee5 100644 --- a/src/mame/includes/vip.h +++ b/src/mame/includes/vip.h @@ -70,7 +70,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void update_interrupts(); @@ -123,7 +123,7 @@ public: int m_keylatch; // expansion state - UINT8 m_byteio_data; + uint8_t m_byteio_data; }; #endif diff --git a/src/mame/includes/vixen.h b/src/mame/includes/vixen.h index 48834ef315c..60e75070ba2 100644 --- a/src/mame/includes/vixen.h +++ b/src/mame/includes/vixen.h @@ -73,7 +73,7 @@ public: IRQ_CALLBACK_MEMBER(vixen_int_ack); DECLARE_READ8_MEMBER(opram_r); DECLARE_READ8_MEMBER(oprom_r); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: required_device m_maincpu; @@ -87,10 +87,10 @@ private: required_device m_floppy0; required_device m_floppy1; required_device m_rs232; - required_region_ptr m_rom; - required_region_ptr m_sync_rom; - required_region_ptr m_char_rom; - required_shared_ptr m_video_ram; + required_region_ptr m_rom; + required_region_ptr m_sync_rom; + required_region_ptr m_char_rom; + required_shared_ptr m_video_ram; required_ioport_array<8> m_key; address_space *m_program; @@ -103,7 +103,7 @@ private: void update_interrupt(); // keyboard state - UINT8 m_col; + uint8_t m_col; // interrupt state int m_cmd_d0; diff --git a/src/mame/includes/volfied.h b/src/mame/includes/volfied.h index f9e256e489a..711f643ef34 100644 --- a/src/mame/includes/volfied.h +++ b/src/mame/includes/volfied.h @@ -24,18 +24,18 @@ public: m_screen(*this, "screen") { } /* memory pointers */ - std::unique_ptr m_video_ram; - std::unique_ptr m_cchip_ram; + std::unique_ptr m_video_ram; + std::unique_ptr m_cchip_ram; /* video-related */ - UINT16 m_video_ctrl; - UINT16 m_video_mask; + uint16_t m_video_ctrl; + uint16_t m_video_mask; /* c-chip */ - UINT8 m_current_bank; - UINT8 m_current_flag; - UINT8 m_cc_port; - UINT8 m_current_cmd; + uint8_t m_current_bank; + uint8_t m_current_flag; + uint8_t m_cc_port; + uint8_t m_current_cmd; /* devices */ required_device m_maincpu; @@ -57,7 +57,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_volfied(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_volfied(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(volfied_timer_callback); void refresh_pixel_layer( bitmap_ind16 &bitmap ); void volfied_cchip_init(); diff --git a/src/mame/includes/vsnes.h b/src/mame/includes/vsnes.h index 08ecb2927aa..00149dc35df 100644 --- a/src/mame/includes/vsnes.h +++ b/src/mame/includes/vsnes.h @@ -23,8 +23,8 @@ public: required_device m_ppu1; optional_device m_ppu2; - required_shared_ptr m_work_ram; - optional_shared_ptr m_work_ram_1; + required_shared_ptr m_work_ram; + optional_shared_ptr m_work_ram_1; required_device m_palette; optional_memory_region m_gfx1_rom; @@ -33,12 +33,12 @@ public: int m_do_vrom_bank; int m_input_latch[4]; int m_sound_fix; - UINT8 m_last_bank; - std::unique_ptr m_vram; - UINT8* m_vrom[2]; - std::unique_ptr m_nt_ram[2]; - UINT8* m_nt_page[2][4]; - UINT32 m_vrom_size[2]; + uint8_t m_last_bank; + std::unique_ptr m_vram; + uint8_t* m_vrom[2]; + std::unique_ptr m_nt_ram[2]; + uint8_t* m_nt_page[2][4]; + uint32_t m_vrom_size[2]; int m_vrom_banks; int m_zapstore; int m_old_bank; @@ -116,8 +116,8 @@ public: DECLARE_MACHINE_RESET(vsdual); DECLARE_VIDEO_START(vsdual); DECLARE_PALETTE_INIT(vsdual); - UINT32 screen_update_vsnes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_vsnes_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vsnes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_vsnes_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void v_set_videorom_bank( int start, int count, int vrom_start_bank ); void mapper4_set_prg( ); void mapper4_set_chr( ); @@ -129,7 +129,7 @@ public: DECLARE_WRITE8_MEMBER(bootleg_sound_write); DECLARE_READ8_MEMBER(vsnes_bootleg_z80_data_r); DECLARE_READ8_MEMBER(vsnes_bootleg_z80_address_r); - UINT8 m_bootleg_sound_offset; - UINT8 m_bootleg_sound_data; + uint8_t m_bootleg_sound_offset; + uint8_t m_bootleg_sound_data; }; diff --git a/src/mame/includes/vtech2.h b/src/mame/includes/vtech2.h index abec6288158..498d0560bf1 100644 --- a/src/mame/includes/vtech2.h +++ b/src/mame/includes/vtech2.h @@ -27,17 +27,17 @@ public: m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } - UINT8 *m_videoram; + uint8_t *m_videoram; int m_laser_latch; char m_laser_frame_message[64+1]; int m_laser_frame_time; - UINT8 *m_mem; + uint8_t *m_mem; int m_laser_bank_mask; int m_laser_bank[4]; int m_laser_video_bank; - UINT8 m_laser_track_x2[2]; - UINT8 m_laser_fdc_status; - UINT8 m_laser_fdc_data[TRKSIZE_FM]; + uint8_t m_laser_track_x2[2]; + uint8_t m_laser_fdc_status; + uint8_t m_laser_fdc_data[TRKSIZE_FM]; int m_laser_data; int m_laser_fdc_edge; int m_laser_fdc_bits; @@ -65,7 +65,7 @@ public: DECLARE_PALETTE_INIT(vtech2); DECLARE_MACHINE_RESET(laser500); DECLARE_MACHINE_RESET(laser700); - UINT32 screen_update_laser(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_laser(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vtech2_interrupt); int mra_bank(int bank, int offs); diff --git a/src/mame/includes/vulgus.h b/src/mame/includes/vulgus.h index a6152923ec7..1ced01169c0 100644 --- a/src/mame/includes/vulgus.h +++ b/src/mame/includes/vulgus.h @@ -27,11 +27,11 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_scroll_low; - required_shared_ptr m_scroll_high; - required_shared_ptr m_spriteram; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; + required_shared_ptr m_scroll_low; + required_shared_ptr m_scroll_high; + required_shared_ptr m_spriteram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; int m_palette_bank; tilemap_t *m_fg_tilemap; @@ -48,7 +48,7 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(vulgus); - 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); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); diff --git a/src/mame/includes/warpwarp.h b/src/mame/includes/warpwarp.h index ca798ea698c..92ff10e8264 100644 --- a/src/mame/includes/warpwarp.h +++ b/src/mame/includes/warpwarp.h @@ -31,8 +31,8 @@ public: required_device m_gfxdecode; optional_device m_warpwarp_sound; optional_device m_geebee_sound; - optional_shared_ptr m_geebee_videoram; - optional_shared_ptr m_videoram; + optional_shared_ptr m_geebee_videoram; + optional_shared_ptr m_videoram; optional_ioport m_in0; optional_ioport m_in1; optional_ioport m_in2; @@ -85,7 +85,7 @@ public: TILE_GET_INFO_MEMBER(navarone_get_tile_info); TILE_GET_INFO_MEMBER(warpwarp_get_tile_info); - 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); inline void plot(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, pen_t pen); void draw_ball(bitmap_ind16 &bitmap, const rectangle &cliprect,pen_t pen); diff --git a/src/mame/includes/warriorb.h b/src/mame/includes/warriorb.h index aedbd75704b..1afa732cc2a 100644 --- a/src/mame/includes/warriorb.h +++ b/src/mame/includes/warriorb.h @@ -51,7 +51,7 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram; /* misc */ int m_pandata[4]; @@ -65,8 +65,8 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int x_offs, int y_offs ); - UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs, tc0100scn_device *tc0100scn); + uint32_t update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs, tc0100scn_device *tc0100scn); }; diff --git a/src/mame/includes/wc90.h b/src/mame/includes/wc90.h index 0fafbf92886..01c1ed3eeae 100644 --- a/src/mame/includes/wc90.h +++ b/src/mame/includes/wc90.h @@ -41,22 +41,22 @@ public: required_device m_sprgen; required_device m_soundlatch; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_txvideoram; - required_shared_ptr m_scroll0xlo; - required_shared_ptr m_scroll0xhi; - required_shared_ptr m_scroll1xlo; - required_shared_ptr m_scroll1xhi; - required_shared_ptr m_scroll2xlo; - required_shared_ptr m_scroll2xhi; - required_shared_ptr m_scroll0ylo; - required_shared_ptr m_scroll0yhi; - required_shared_ptr m_scroll1ylo; - required_shared_ptr m_scroll1yhi; - required_shared_ptr m_scroll2ylo; - required_shared_ptr m_scroll2yhi; - required_shared_ptr m_spriteram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_txvideoram; + required_shared_ptr m_scroll0xlo; + required_shared_ptr m_scroll0xhi; + required_shared_ptr m_scroll1xlo; + required_shared_ptr m_scroll1xhi; + required_shared_ptr m_scroll2xlo; + required_shared_ptr m_scroll2xhi; + required_shared_ptr m_scroll0ylo; + required_shared_ptr m_scroll0yhi; + required_shared_ptr m_scroll1ylo; + required_shared_ptr m_scroll1yhi; + required_shared_ptr m_scroll2ylo; + required_shared_ptr m_scroll2yhi; + required_shared_ptr m_spriteram; tilemap_t *m_tx_tilemap; tilemap_t *m_fg_tilemap; @@ -79,5 +79,5 @@ public: virtual void video_start() override; DECLARE_VIDEO_START(wc90t); - 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); }; diff --git a/src/mame/includes/wc90b.h b/src/mame/includes/wc90b.h index b7f6891915b..bcf6d22e333 100644 --- a/src/mame/includes/wc90b.h +++ b/src/mame/includes/wc90b.h @@ -34,15 +34,15 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_fgvideoram; - required_shared_ptr m_bgvideoram; - required_shared_ptr m_txvideoram; - required_shared_ptr m_scroll1x; - required_shared_ptr m_scroll2x; - required_shared_ptr m_scroll1y; - required_shared_ptr m_scroll2y; - required_shared_ptr m_scroll_x_lo; - required_shared_ptr m_spriteram; + required_shared_ptr m_fgvideoram; + required_shared_ptr m_bgvideoram; + required_shared_ptr m_txvideoram; + required_shared_ptr m_scroll1x; + required_shared_ptr m_scroll2x; + required_shared_ptr m_scroll1y; + required_shared_ptr m_scroll2y; + required_shared_ptr m_scroll_x_lo; + required_shared_ptr m_spriteram; tilemap_t *m_tx_tilemap; tilemap_t *m_fg_tilemap; @@ -69,6 +69,6 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); }; diff --git a/src/mame/includes/wecleman.h b/src/mame/includes/wecleman.h index e04d775c096..45535f70885 100644 --- a/src/mame/includes/wecleman.h +++ b/src/mame/includes/wecleman.h @@ -32,14 +32,14 @@ public: m_screen(*this, "screen"), m_soundlatch(*this, "soundlatch") { } - optional_shared_ptr m_videostatus; - optional_shared_ptr m_protection_ram; - required_shared_ptr m_blitter_regs; - optional_shared_ptr m_pageram; - optional_shared_ptr m_txtram; - required_shared_ptr m_spriteram; - required_shared_ptr m_roadram; - required_shared_ptr m_generic_paletteram_16; + optional_shared_ptr m_videostatus; + optional_shared_ptr m_protection_ram; + required_shared_ptr m_blitter_regs; + optional_shared_ptr m_pageram; + optional_shared_ptr m_txtram; + required_shared_ptr m_spriteram; + required_shared_ptr m_roadram; + required_shared_ptr m_generic_paletteram_16; int m_multiply_reg[2]; int m_spr_color_offs; @@ -59,7 +59,7 @@ public: int m_spr_offsx; int m_spr_offsy; int m_spr_count; - UINT16 *m_rgb_half; + uint16_t *m_rgb_half; int m_cloud_blend; int m_cloud_ds; int m_cloud_visible; @@ -101,14 +101,14 @@ public: DECLARE_VIDEO_START(wecleman); DECLARE_MACHINE_RESET(hotchase); DECLARE_VIDEO_START(hotchase); - UINT32 screen_update_wecleman(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - UINT32 screen_update_hotchase(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wecleman(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_hotchase(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(hotchase_sound_timer); TIMER_DEVICE_CALLBACK_MEMBER(wecleman_scanline); TIMER_DEVICE_CALLBACK_MEMBER(hotchase_scanline); - void draw_cloud(bitmap_rgb32 &bitmap,gfx_element *gfx,UINT16 *tm_base,int x0,int y0,int xcount,int ycount,int scrollx,int scrolly,int tmw_l2,int tmh_l2,int alpha,int pal_offset); + void draw_cloud(bitmap_rgb32 &bitmap,gfx_element *gfx,uint16_t *tm_base,int x0,int y0,int xcount,int ycount,int scrollx,int scrolly,int tmw_l2,int tmh_l2,int alpha,int pal_offset); void wecleman_unpack_sprites(); - void bitswap(UINT8 *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0); + void bitswap(uint8_t *src,size_t len,int _14,int _13,int _12,int _11,int _10,int _f,int _e,int _d,int _c,int _b,int _a,int _9,int _8,int _7,int _6,int _5,int _4,int _3,int _2,int _1,int _0); void hotchase_sprite_decode( int num16_banks, int bank_size ); void get_sprite_info(); void sortsprite(int *idx_array, int *key_array, int size); diff --git a/src/mame/includes/welltris.h b/src/mame/includes/welltris.h index aac5479d961..5fcefddd80a 100644 --- a/src/mame/includes/welltris.h +++ b/src/mame/includes/welltris.h @@ -25,16 +25,16 @@ public: required_device m_gfxdecode; required_device m_soundlatch; - required_shared_ptr m_spriteram; - required_shared_ptr m_pixelram; - required_shared_ptr m_charvideoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_pixelram; + required_shared_ptr m_charvideoram; tilemap_t *m_char_tilemap; int m_pending_command; - UINT8 m_gfxbank[2]; - UINT16 m_charpalettebank; - UINT16 m_spritepalettebank; - UINT16 m_pixelpalettebank; + uint8_t m_gfxbank[2]; + uint16_t m_charpalettebank; + uint16_t m_spritepalettebank; + uint16_t m_pixelpalettebank; int m_scrollx; int m_scrolly; @@ -54,7 +54,7 @@ public: virtual void video_start() override; TILE_GET_INFO_MEMBER(get_tile_info); - 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); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); void setbank(int num, int bank); }; diff --git a/src/mame/includes/wgp.h b/src/mame/includes/wgp.h index 1b0842552a3..8ea9f3dec10 100644 --- a/src/mame/includes/wgp.h +++ b/src/mame/includes/wgp.h @@ -42,25 +42,25 @@ public: { } /* memory pointers */ - required_shared_ptr m_spritemap; - required_shared_ptr m_spriteram; - required_shared_ptr m_pivram; - required_shared_ptr m_piv_ctrlram; + required_shared_ptr m_spritemap; + required_shared_ptr m_spriteram; + required_shared_ptr m_pivram; + required_shared_ptr m_piv_ctrlram; /* video-related */ tilemap_t *m_piv_tilemap[3]; - UINT16 m_piv_ctrl_reg; - UINT16 m_piv_zoom[3]; - UINT16 m_piv_scrollx[3]; - UINT16 m_piv_scrolly[3]; - UINT16 m_rotate_ctrl[8]; + uint16_t m_piv_ctrl_reg; + uint16_t m_piv_zoom[3]; + uint16_t m_piv_scrollx[3]; + uint16_t m_piv_scrolly[3]; + uint16_t m_rotate_ctrl[8]; int m_piv_xoffs; int m_piv_yoffs; - UINT8 m_dislayer[4]; + uint8_t m_dislayer[4]; /* misc */ - UINT16 m_cpua_ctrl; - UINT16 m_port_sel; + uint16_t m_cpua_ctrl; + uint16_t m_port_sel; /* devices */ required_device m_maincpu; @@ -97,13 +97,13 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_VIDEO_START(wgp2); - UINT32 screen_update_wgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(wgp_cpub_interrupt); void wgp_postload(); inline void common_get_piv_tile_info( tile_data &tileinfo, int tile_index, int num ); void wgp_core_vh_start( int piv_xoffs, int piv_yoffs ); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs ); - void wgp_piv_layer_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ); + void wgp_piv_layer_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, uint32_t priority ); void parse_control(); protected: diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h index b7320461784..60526017e3c 100644 --- a/src/mame/includes/williams.h +++ b/src/mame/includes/williams.h @@ -44,20 +44,20 @@ public: WMS_BLITTER_CONTROLBYTE_SRC_STRIDE_256 = 0x01 }; - required_shared_ptr m_nvram; - required_shared_ptr m_videoram; - UINT8 *m_mayday_protection; - UINT8 m_blitter_config; - UINT16 m_blitter_clip_address; - UINT8 m_blitter_window_enable; - UINT8 m_cocktail; - UINT8 m_port_select; + required_shared_ptr m_nvram; + required_shared_ptr m_videoram; + uint8_t *m_mayday_protection; + uint8_t m_blitter_config; + uint16_t m_blitter_clip_address; + uint8_t m_blitter_window_enable; + uint8_t m_cocktail; + uint8_t m_port_select; std::unique_ptr m_palette_lookup; - UINT8 m_blitterram[8]; - UINT8 m_blitter_xor; - UINT8 m_blitter_remap_index; - const UINT8 *m_blitter_remap; - std::unique_ptr m_blitter_remap_lookup; + uint8_t m_blitterram[8]; + uint8_t m_blitter_xor; + uint8_t m_blitter_remap_index; + const uint8_t *m_blitter_remap; + std::unique_ptr m_blitter_remap_lookup; DECLARE_WRITE8_MEMBER(williams_vram_select_w); DECLARE_WRITE8_MEMBER(williams_cmos_w); DECLARE_WRITE8_MEMBER(bubbles_cmos_w); @@ -90,7 +90,7 @@ public: DECLARE_MACHINE_RESET(williams); DECLARE_MACHINE_START(williams_common); DECLARE_MACHINE_RESET(williams_common); - UINT32 screen_update_williams(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_williams(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(williams_count240_off_callback); TIMER_CALLBACK_MEMBER(williams_deferred_snd_cmd_w); TIMER_DEVICE_CALLBACK_MEMBER(williams_va11_callback); @@ -104,7 +104,7 @@ public: void state_save_register(); void create_palette_lookup(); - void blitter_init(int blitter_config, const UINT8 *remap_prom); + void blitter_init(int blitter_config, const uint8_t *remap_prom); inline void blit_pixel(address_space &space, int dstaddr, int srcdata, int controlbyte); int blitter_core(address_space &space, int sstart, int dstart, int w, int h, int data); @@ -118,7 +118,7 @@ public: required_device m_watchdog; required_device m_screen; optional_device m_palette; - optional_shared_ptr m_generic_paletteram_8; + optional_shared_ptr m_generic_paletteram_8; }; @@ -132,13 +132,13 @@ public: m_blaster_scanline_control(*this, "blaster_scan") { } optional_device m_soundcpu_b; - required_shared_ptr m_blaster_palette_0; - required_shared_ptr m_blaster_scanline_control; + required_shared_ptr m_blaster_palette_0; + required_shared_ptr m_blaster_scanline_control; rgb_t m_blaster_color0; - UINT8 m_blaster_video_control; - UINT8 m_vram_bank; - UINT8 m_rom_bank; + uint8_t m_blaster_video_control; + uint8_t m_vram_bank; + uint8_t m_rom_bank; DECLARE_WRITE8_MEMBER(blaster_vram_select_w); DECLARE_WRITE8_MEMBER(blaster_bank_select_w); @@ -152,7 +152,7 @@ public: DECLARE_MACHINE_START(blaster); DECLARE_MACHINE_RESET(blaster); DECLARE_VIDEO_START(blaster); - UINT32 screen_update_blaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_blaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); inline void update_blaster_banking(); }; @@ -169,12 +169,12 @@ public: required_device m_bank8000; required_device m_gfxdecode; - required_shared_ptr m_williams2_tileram; + required_shared_ptr m_williams2_tileram; tilemap_t *m_bg_tilemap; - UINT16 m_tilemap_xscroll; - UINT8 m_williams2_fg_color; - UINT8 m_williams2_tilemap_config; + uint16_t m_tilemap_xscroll; + uint8_t m_williams2_fg_color; + uint8_t m_williams2_tilemap_config; TILE_GET_INFO_MEMBER(get_tile_info); DECLARE_WRITE8_MEMBER(williams2_bank_select_w); @@ -204,7 +204,7 @@ public: DECLARE_MACHINE_START(williams2); DECLARE_MACHINE_RESET(williams2); DECLARE_VIDEO_START(williams2); - UINT32 screen_update_williams2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_williams2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; @@ -216,7 +216,7 @@ public: m_cvsd_sound(*this, "cvsd") { } required_device m_cvsd_sound; - UINT16 m_joust2_current_sound_data; + uint16_t m_joust2_current_sound_data; DECLARE_DRIVER_INIT(joust2); DECLARE_MACHINE_START(joust2); diff --git a/src/mame/includes/wiping.h b/src/mame/includes/wiping.h index 59cabdcf27d..0728804e624 100644 --- a/src/mame/includes/wiping.h +++ b/src/mame/includes/wiping.h @@ -18,14 +18,14 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_spriteram; int m_flipscreen; - UINT8 *m_soundregs; // if 0-ed - UINT8 m_main_irq_mask; - UINT8 m_sound_irq_mask; + uint8_t *m_soundregs; // if 0-ed + uint8_t m_main_irq_mask; + uint8_t m_sound_irq_mask; DECLARE_READ8_MEMBER(ports_r); DECLARE_WRITE8_MEMBER(subcpu_reset_w); @@ -36,7 +36,7 @@ public: DECLARE_PALETTE_INIT(wiping); virtual void machine_start() override; - 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); INTERRUPT_GEN_MEMBER(vblank_irq); INTERRUPT_GEN_MEMBER(sound_timer_irq); diff --git a/src/mame/includes/wiz.h b/src/mame/includes/wiz.h index d4cb1f39f36..001b9db0c44 100644 --- a/src/mame/includes/wiz.h +++ b/src/mame/includes/wiz.h @@ -35,24 +35,24 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_videoram2; - required_shared_ptr m_colorram; - required_shared_ptr m_colorram2; - required_shared_ptr m_attrram; - required_shared_ptr m_attrram2; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram2; + required_shared_ptr m_colorram; + required_shared_ptr m_colorram2; + required_shared_ptr m_attrram; + required_shared_ptr m_attrram2; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; + optional_shared_ptr m_decrypted_opcodes; - INT32 m_flipx; - INT32 m_flipy; - INT32 m_bgcolor; - UINT8 m_charbank[2]; - UINT8 m_palbank[2]; - UINT8 m_main_nmi_mask; - UINT8 m_sound_nmi_mask; - UINT8 m_sprite_bank; + int32_t m_flipx; + int32_t m_flipy; + int32_t m_bgcolor; + uint8_t m_charbank[2]; + uint8_t m_palbank[2]; + uint8_t m_main_nmi_mask; + uint8_t m_sound_nmi_mask; + uint8_t m_sprite_bank; int m_dsc0; int m_dsc1; @@ -75,9 +75,9 @@ public: virtual void machine_reset() override; virtual void machine_start() override; DECLARE_PALETTE_INIT(wiz); - UINT32 screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_stinger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wiz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_stinger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_kungfut(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(wiz_vblank_interrupt); INTERRUPT_GEN_MEMBER(wiz_sound_interrupt); void draw_tiles(bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int charbank, int colortype); diff --git a/src/mame/includes/wolfpack.h b/src/mame/includes/wolfpack.h index e1d4628eb86..1f7e8ac7baa 100644 --- a/src/mame/includes/wolfpack.h +++ b/src/mame/includes/wolfpack.h @@ -27,7 +27,7 @@ public: { } // devices, pointers - required_shared_ptr m_alpha_num_ram; + required_shared_ptr m_alpha_num_ram; required_device m_maincpu; required_device m_s14001a; required_device m_gfxdecode; @@ -36,19 +36,19 @@ public: int m_collision; unsigned m_current_index; - UINT8 m_video_invert; - UINT8 m_ship_reflect; - UINT8 m_pt_pos_select; - UINT8 m_pt_horz; - UINT8 m_pt_pic; - UINT8 m_ship_h; - UINT8 m_torpedo_pic; - UINT8 m_ship_size; - UINT8 m_ship_h_precess; - UINT8 m_ship_pic; - UINT8 m_torpedo_h; - UINT8 m_torpedo_v; - std::unique_ptr m_LFSR; + uint8_t m_video_invert; + uint8_t m_ship_reflect; + uint8_t m_pt_pos_select; + uint8_t m_pt_horz; + uint8_t m_pt_pic; + uint8_t m_ship_h; + uint8_t m_torpedo_pic; + uint8_t m_ship_size; + uint8_t m_ship_h_precess; + uint8_t m_ship_pic; + uint8_t m_torpedo_h; + uint8_t m_torpedo_v; + std::unique_ptr m_LFSR; bitmap_ind16 m_helper; DECLARE_READ8_MEMBER(wolfpack_misc_r); DECLARE_WRITE8_MEMBER(wolfpack_high_explo_w); @@ -82,7 +82,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(wolfpack); - UINT32 screen_update_wolfpack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_wolfpack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_wolfpack(screen_device &screen, bool state); TIMER_CALLBACK_MEMBER(periodic_callback); void draw_ship(bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/wpc_dot.h b/src/mame/includes/wpc_dot.h index b86fdf88db5..54473262f12 100644 --- a/src/mame/includes/wpc_dot.h +++ b/src/mame/includes/wpc_dot.h @@ -69,14 +69,14 @@ public: DECLARE_WRITE8_MEMBER(wpc_rombank_w); DECLARE_WRITE8_MEMBER(wpc_dmdbank_w); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: - UINT16 m_vblank_count; - UINT32 m_irq_count; - UINT8 m_bankmask; - UINT8 m_ram[0x3000]; - UINT8 m_dmdram[0x2000]; + uint16_t m_vblank_count; + uint32_t m_irq_count; + uint8_t m_bankmask; + uint8_t m_ram[0x3000]; + uint8_t m_dmdram[0x2000]; emu_timer* m_vblank_timer; emu_timer* m_irq_timer; }; diff --git a/src/mame/includes/wrally.h b/src/mame/includes/wrally.h index 8af45e6d46f..4281264cce7 100644 --- a/src/mame/includes/wrally.h +++ b/src/mame/includes/wrally.h @@ -17,10 +17,10 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_vregs; - required_shared_ptr m_spriteram; - required_shared_ptr m_shareram; + required_shared_ptr m_videoram; + required_shared_ptr m_vregs; + required_shared_ptr m_spriteram; + required_shared_ptr m_shareram; tilemap_t *m_pant[2]; @@ -38,6 +38,6 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); }; diff --git a/src/mame/includes/wswan.h b/src/mame/includes/wswan.h index ec620cf39d0..0b37017b21b 100644 --- a/src/mame/includes/wswan.h +++ b/src/mame/includes/wswan.h @@ -25,9 +25,9 @@ struct SoundDMA { - UINT32 source; /* Source address */ - UINT16 size; /* Size */ - UINT8 enable; /* Enabled */ + uint32_t source; /* Source address */ + uint16_t size; /* Size */ + uint8_t enable; /* Enabled */ }; @@ -53,13 +53,13 @@ public: DECLARE_READ8_MEMBER(port_r); DECLARE_WRITE8_MEMBER(port_w); - UINT8 m_ws_portram[256]; - UINT8 m_internal_eeprom[INTERNAL_EEPROM_SIZE]; - UINT8 m_system_type; + uint8_t m_ws_portram[256]; + uint8_t m_internal_eeprom[INTERNAL_EEPROM_SIZE]; + uint8_t m_system_type; SoundDMA m_sound_dma; - std::unique_ptr m_ws_bios_bank; - UINT8 m_bios_disabled; - UINT8 m_rotate; + std::unique_ptr m_ws_bios_bank; + uint8_t m_bios_disabled; + uint8_t m_rotate; void set_irq_line(int irq); void dma_sound_cb(); @@ -72,24 +72,24 @@ public: protected: /* Interrupt flags */ - static const UINT8 WSWAN_IFLAG_STX = 0x01; - static const UINT8 WSWAN_IFLAG_KEY = 0x02; - static const UINT8 WSWAN_IFLAG_RTC = 0x04; - static const UINT8 WSWAN_IFLAG_SRX = 0x08; - static const UINT8 WSWAN_IFLAG_LCMP = 0x10; - static const UINT8 WSWAN_IFLAG_VBLTMR = 0x20; - static const UINT8 WSWAN_IFLAG_VBL = 0x40; - static const UINT8 WSWAN_IFLAG_HBLTMR = 0x80; + static const uint8_t WSWAN_IFLAG_STX = 0x01; + static const uint8_t WSWAN_IFLAG_KEY = 0x02; + static const uint8_t WSWAN_IFLAG_RTC = 0x04; + static const uint8_t WSWAN_IFLAG_SRX = 0x08; + static const uint8_t WSWAN_IFLAG_LCMP = 0x10; + static const uint8_t WSWAN_IFLAG_VBLTMR = 0x20; + static const uint8_t WSWAN_IFLAG_VBL = 0x40; + static const uint8_t WSWAN_IFLAG_HBLTMR = 0x80; /* Interrupts */ - static const UINT8 WSWAN_INT_STX = 0; - static const UINT8 WSWAN_INT_KEY = 1; - static const UINT8 WSWAN_INT_RTC = 2; - static const UINT8 WSWAN_INT_SRX = 3; - static const UINT8 WSWAN_INT_LCMP = 4; - static const UINT8 WSWAN_INT_VBLTMR = 5; - static const UINT8 WSWAN_INT_VBL = 6; - static const UINT8 WSWAN_INT_HBLTMR = 7; + static const uint8_t WSWAN_INT_STX = 0; + static const uint8_t WSWAN_INT_KEY = 1; + static const uint8_t WSWAN_INT_RTC = 2; + static const uint8_t WSWAN_INT_SRX = 3; + static const uint8_t WSWAN_INT_LCMP = 4; + static const uint8_t WSWAN_INT_VBLTMR = 5; + static const uint8_t WSWAN_INT_VBL = 6; + static const uint8_t WSWAN_INT_HBLTMR = 7; required_ioport m_cursx; required_ioport m_cursy; diff --git a/src/mame/includes/wwfsstar.h b/src/mame/includes/wwfsstar.h index da7d6cfc0ff..5337dac34d4 100644 --- a/src/mame/includes/wwfsstar.h +++ b/src/mame/includes/wwfsstar.h @@ -25,9 +25,9 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_spriteram; - required_shared_ptr m_fg0_videoram; - required_shared_ptr m_bg0_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_fg0_videoram; + required_shared_ptr m_bg0_videoram; int m_vblank; int m_scrollx; @@ -52,6 +52,6 @@ public: virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/x07.h b/src/mame/includes/x07.h index acea6f55260..f7a50e012f8 100644 --- a/src/mame/includes/x07.h +++ b/src/mame/includes/x07.h @@ -35,13 +35,13 @@ static const char *const udk_ini[12] = { "" }; -static const UINT16 udk_offset[12] = +static const uint16_t udk_offset[12] = { 0x0000, 0x002a, 0x0054, 0x007e, 0x00a8, 0x00d2, 0x0100, 0x012a, 0x0154, 0x017e, 0x01a8, 0x01d2 }; -static const UINT8 printer_charcode[256] = +static const uint8_t printer_charcode[256] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f, @@ -77,7 +77,7 @@ static const UINT8 printer_charcode[256] = 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00 }; -static const UINT8 t6834_cmd_len[0x47] = +static const uint8_t t6834_cmd_len[0x47] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x04, 0x03, 0x01, 0x02, 0x09, 0x01, 0x09, 0x01, 0x01, 0x02, @@ -93,8 +93,8 @@ static const UINT8 t6834_cmd_len[0x47] = struct x07_kb { const char *tag; //input port tag - UINT8 mask; //bit mask - UINT8 codes[7]; //port codes + uint8_t mask; //bit mask + uint8_t codes[7]; //port codes }; static const x07_kb x07_keycodes[56] = @@ -184,7 +184,7 @@ public: void machine_start() override; void machine_reset() override; - 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); DECLARE_READ8_MEMBER( x07_io_r ); DECLARE_WRITE8_MEMBER( x07_io_w ); @@ -196,7 +196,7 @@ public: DECLARE_DRIVER_INIT(x07); void nvram_init(nvram_device &nvram, void *data, size_t size); - void t6834_cmd(UINT8 cmd); + void t6834_cmd(uint8_t cmd); void t6834_r(); void t6834_w(); void cassette_w(); @@ -207,74 +207,74 @@ public: void cassette_save(); void receive_bit(int bit); - inline UINT8 get_char(UINT16 pos); - inline UINT8 kb_get_index(UINT8 char_code); - inline void draw_char(UINT8 x, UINT8 y, UINT8 char_pos); - inline void draw_point(UINT8 x, UINT8 y, UINT8 color); + inline uint8_t get_char(uint16_t pos); + inline uint8_t kb_get_index(uint8_t char_code); + inline void draw_char(uint8_t x, uint8_t y, uint8_t char_pos); + inline void draw_point(uint8_t x, uint8_t y, uint8_t color); inline void draw_udk(); DECLARE_DEVICE_IMAGE_LOAD_MEMBER( x07_card ); /* general */ - UINT8 m_sleep; - UINT8 m_warm_start; - UINT8 m_t6834_ram[0x800]; - UINT8 m_regs_r[8]; - UINT8 m_regs_w[8]; - UINT8 m_alarm[8]; + uint8_t m_sleep; + uint8_t m_warm_start; + uint8_t m_t6834_ram[0x800]; + uint8_t m_regs_r[8]; + uint8_t m_regs_w[8]; + uint8_t m_alarm[8]; struct fifo_buffer { - UINT8 data[0x100]; - UINT8 read; - UINT8 write; + uint8_t data[0x100]; + uint8_t read; + uint8_t write; }; fifo_buffer m_in; fifo_buffer m_out; - UINT8 m_udk_on; - UINT8 m_draw_udk; - UINT8 m_sp_on; - UINT8 m_font_code; + uint8_t m_udk_on; + uint8_t m_draw_udk; + uint8_t m_sp_on; + uint8_t m_font_code; emu_timer *m_rsta_clear; emu_timer *m_rstb_clear; emu_timer *m_beep_stop; /* LCD */ - UINT8 m_lcd_on; - UINT8 m_lcd_map[32][120]; - UINT8 m_scroll_min; - UINT8 m_scroll_max; - UINT8 m_blink; + uint8_t m_lcd_on; + uint8_t m_lcd_map[32][120]; + uint8_t m_scroll_min; + uint8_t m_scroll_max; + uint8_t m_blink; struct lcd_position { - UINT8 x; - UINT8 y; - UINT8 on; + uint8_t x; + uint8_t y; + uint8_t on; }; lcd_position m_locate; lcd_position m_cursor; /* keyboard */ - UINT8 m_kb_on; - UINT8 m_repeat_key; //not supported - UINT8 m_kb_size; + uint8_t m_kb_on; + uint8_t m_repeat_key; //not supported + uint8_t m_kb_size; /* cassette */ - UINT8 m_cass_motor; - UINT8 m_cass_data; - UINT32 m_cass_clk; - UINT8 m_bit_count; + uint8_t m_cass_motor; + uint8_t m_cass_data; + uint32_t m_cass_clk; + uint8_t m_bit_count; int m_cass_state; emu_timer *m_cass_poll; emu_timer *m_cass_tick; /* printer */ - UINT8 m_prn_sendbit; - UINT8 m_prn_char_code; - UINT8 m_prn_buffer[0x100]; - UINT8 m_prn_size; + uint8_t m_prn_sendbit; + uint8_t m_prn_char_code; + uint8_t m_prn_buffer[0x100]; + uint8_t m_prn_size; DECLARE_PALETTE_INIT(x07); TIMER_CALLBACK_MEMBER(cassette_tick); TIMER_CALLBACK_MEMBER(cassette_poll); diff --git a/src/mame/includes/x1.h b/src/mame/includes/x1.h index f2a4e4e9420..528a9657fc2 100644 --- a/src/mame/includes/x1.h +++ b/src/mame/includes/x1.h @@ -35,7 +35,7 @@ class x1_keyboard_device : public device_t, { public: // construction/destruction - x1_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + x1_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); private: virtual void device_start() override; @@ -47,27 +47,27 @@ private: struct scrn_reg_t { - UINT8 gfx_bank; - UINT8 disp_bank; - UINT8 pcg_mode; - UINT8 v400_mode; - UINT8 ank_sel; + uint8_t gfx_bank; + uint8_t disp_bank; + uint8_t pcg_mode; + uint8_t v400_mode; + uint8_t ank_sel; - UINT8 pri; - UINT8 blackclip; // x1 turbo specific + uint8_t pri; + uint8_t blackclip; // x1 turbo specific }; struct turbo_reg_t { - UINT8 pal; - UINT8 gfx_pal; - UINT8 txt_pal[8]; - UINT8 txt_disp; + uint8_t pal; + uint8_t gfx_pal; + uint8_t txt_pal[8]; + uint8_t txt_disp; }; struct x1_rtc_t { - UINT8 sec, min, hour, day, wday, month, year; + uint8_t sec, min, hour, day, wday, month, year; }; @@ -104,64 +104,64 @@ public: required_device m_crtc; required_device m_ctc; - std::unique_ptr m_tvram; /**< Pointer for Text Video RAM */ - std::unique_ptr m_avram; /**< Pointer for Attribute Video RAM */ - std::unique_ptr m_kvram; /**< Pointer for Extended Kanji Video RAM (X1 Turbo) */ - UINT8 *m_ipl_rom; /**< Pointer for IPL ROM */ - std::unique_ptr m_work_ram; /**< Pointer for base work RAM */ - std::unique_ptr m_emm_ram; /**< Pointer for EMM RAM */ - std::unique_ptr m_pcg_ram; /**< Pointer for PCG GFX RAM */ - UINT8 *m_cg_rom; /**< Pointer for GFX ROM */ - UINT8 *m_kanji_rom; /**< Pointer for Kanji ROMs */ + std::unique_ptr m_tvram; /**< Pointer for Text Video RAM */ + std::unique_ptr m_avram; /**< Pointer for Attribute Video RAM */ + std::unique_ptr m_kvram; /**< Pointer for Extended Kanji Video RAM (X1 Turbo) */ + uint8_t *m_ipl_rom; /**< Pointer for IPL ROM */ + std::unique_ptr m_work_ram; /**< Pointer for base work RAM */ + std::unique_ptr m_emm_ram; /**< Pointer for EMM RAM */ + std::unique_ptr m_pcg_ram; /**< Pointer for PCG GFX RAM */ + uint8_t *m_cg_rom; /**< Pointer for GFX ROM */ + uint8_t *m_kanji_rom; /**< Pointer for Kanji ROMs */ int m_xstart, /**< Start X offset for screen drawing. */ m_ystart; /**< Start Y offset for screen drawing. */ - UINT8 m_hres_320; /**< Pixel clock divider setting: (1) 48 (0) 24 */ - UINT8 m_io_switch; /**< Enable access for special bitmap RMW phase in isolated i/o. */ - UINT8 m_io_sys; /**< Read-back for PPI port C */ - UINT8 m_vsync; /**< Screen V-Sync bit, active low */ - UINT8 m_vdisp; /**< Screen V-Disp bit, active high */ - UINT8 m_io_bank_mode; /**< Helper for special bitmap RMW phase. */ - std::unique_ptr m_gfx_bitmap_ram; /**< Pointer for bitmap layer RAM. */ - UINT8 m_pcg_reset; /**< @todo Unused variable. */ - UINT8 m_sub_obf; /**< MCU side: OBF flag active low, indicates that there are parameters in comm buffer. */ - UINT8 m_ctc_irq_flag; /**< @todo Unused variable. */ + uint8_t m_hres_320; /**< Pixel clock divider setting: (1) 48 (0) 24 */ + uint8_t m_io_switch; /**< Enable access for special bitmap RMW phase in isolated i/o. */ + uint8_t m_io_sys; /**< Read-back for PPI port C */ + uint8_t m_vsync; /**< Screen V-Sync bit, active low */ + uint8_t m_vdisp; /**< Screen V-Disp bit, active high */ + uint8_t m_io_bank_mode; /**< Helper for special bitmap RMW phase. */ + std::unique_ptr m_gfx_bitmap_ram; /**< Pointer for bitmap layer RAM. */ + uint8_t m_pcg_reset; /**< @todo Unused variable. */ + uint8_t m_sub_obf; /**< MCU side: OBF flag active low, indicates that there are parameters in comm buffer. */ + uint8_t m_ctc_irq_flag; /**< @todo Unused variable. */ scrn_reg_t m_scrn_reg; /**< Base Video Registers. */ turbo_reg_t m_turbo_reg; /**< Turbo Z Video Registers. */ x1_rtc_t m_rtc; /**< Struct for RTC related variables */ emu_timer *m_rtc_timer; /**< Pointer for RTC timer. */ - UINT8 m_pcg_write_addr; /**< @todo Unused variable. */ - UINT8 m_sub_cmd; /**< MCU side: current command issued from Main to Sub. */ - UINT8 m_sub_cmd_length; /**< MCU side: number of parameters, in bytes. */ - UINT8 m_sub_val[8]; /**< MCU side: parameters buffer. */ + uint8_t m_pcg_write_addr; /**< @todo Unused variable. */ + uint8_t m_sub_cmd; /**< MCU side: current command issued from Main to Sub. */ + uint8_t m_sub_cmd_length; /**< MCU side: number of parameters, in bytes. */ + uint8_t m_sub_val[8]; /**< MCU side: parameters buffer. */ int m_sub_val_ptr; /**< MCU side: index for parameter read-back */ int m_key_i; /**< MCU side: index for keyboard read-back during OBF phase. */ - UINT8 m_irq_vector; /**< @todo Unused variable. */ - UINT8 m_cmt_current_cmd; /**< MCU side: CMT command issued. */ - UINT8 m_cmt_test; /**< MCU side: Tape BREAK status bit. */ - UINT8 m_rom_index[3]; /**< Current ROM address. */ - UINT32 m_kanji_offset; /**< @todo Unused variable. */ - UINT8 m_bios_offset; /**< @todo Unused variable. */ - UINT8 m_x_b; /**< Palette Register for Blue Gun */ - UINT8 m_x_g; /**< Palette Register for Green Gun */ - UINT8 m_x_r; /**< Palette Register for Red Gun */ - UINT16 m_kanji_addr_latch; /**< Internal Kanji ROM address. */ - UINT32 m_kanji_addr; /**< Latched Kanji ROM address. */ - UINT8 m_kanji_eksel; /**< Kanji ROM register bit for latch phase. */ - UINT8 m_pcg_reset_occurred; /**< @todo Unused variable. */ - UINT32 m_old_key1; /**< Keyboard read buffer for i/o port "key1" */ - UINT32 m_old_key2; /**< Keyboard read buffer for i/o port "key2" */ - UINT32 m_old_key3; /**< Keyboard read buffer for i/o port "key3" */ - UINT32 m_old_key4; /**< Keyboard read buffer for i/o port "tenkey" */ - UINT32 m_old_fkey; /**< Keyboard read buffer for i/o port "f_keys" */ - UINT8 m_key_irq_flag; /**< Keyboard IRQ pending. */ - UINT8 m_key_irq_vector; /**< Keyboard IRQ vector. */ - UINT32 m_emm_addr; /**< EMM RAM current address */ - std::unique_ptr m_pal_4096; /**< X1 Turbo Z: pointer for 4096 palette entries */ - UINT8 m_crtc_vreg[0x100], /**< CRTC register buffer. */ + uint8_t m_irq_vector; /**< @todo Unused variable. */ + uint8_t m_cmt_current_cmd; /**< MCU side: CMT command issued. */ + uint8_t m_cmt_test; /**< MCU side: Tape BREAK status bit. */ + uint8_t m_rom_index[3]; /**< Current ROM address. */ + uint32_t m_kanji_offset; /**< @todo Unused variable. */ + uint8_t m_bios_offset; /**< @todo Unused variable. */ + uint8_t m_x_b; /**< Palette Register for Blue Gun */ + uint8_t m_x_g; /**< Palette Register for Green Gun */ + uint8_t m_x_r; /**< Palette Register for Red Gun */ + uint16_t m_kanji_addr_latch; /**< Internal Kanji ROM address. */ + uint32_t m_kanji_addr; /**< Latched Kanji ROM address. */ + uint8_t m_kanji_eksel; /**< Kanji ROM register bit for latch phase. */ + uint8_t m_pcg_reset_occurred; /**< @todo Unused variable. */ + uint32_t m_old_key1; /**< Keyboard read buffer for i/o port "key1" */ + uint32_t m_old_key2; /**< Keyboard read buffer for i/o port "key2" */ + uint32_t m_old_key3; /**< Keyboard read buffer for i/o port "key3" */ + uint32_t m_old_key4; /**< Keyboard read buffer for i/o port "tenkey" */ + uint32_t m_old_fkey; /**< Keyboard read buffer for i/o port "f_keys" */ + uint8_t m_key_irq_flag; /**< Keyboard IRQ pending. */ + uint8_t m_key_irq_vector; /**< Keyboard IRQ vector. */ + uint32_t m_emm_addr; /**< EMM RAM current address */ + std::unique_ptr m_pal_4096; /**< X1 Turbo Z: pointer for 4096 palette entries */ + uint8_t m_crtc_vreg[0x100], /**< CRTC register buffer. */ m_crtc_index; /**< CRTC register index. */ - UINT8 m_is_turbo; /**< Machine type: (0) X1 Vanilla, (1) X1 Turbo */ - UINT8 m_ex_bank; /**< X1 Turbo Z: RAM bank register */ - UINT8 m_ram_bank; /**< Regular RAM bank for 0x0000-0x7fff memory window: (0) ROM/IPL (1) RAM */ + uint8_t m_is_turbo; /**< Machine type: (0) X1 Vanilla, (1) X1 Turbo */ + uint8_t m_ex_bank; /**< X1 Turbo Z: RAM bank register */ + uint8_t m_ram_bank; /**< Regular RAM bank for 0x0000-0x7fff memory window: (0) ROM/IPL (1) RAM */ /** @brief Refresh current bitmap palette. */ @@ -173,26 +173,26 @@ public: @param y_char_size Number of scanlines per character. @return Destination PCG address. */ - UINT16 get_pcg_addr(UINT16 width, UINT8 y_char_size); + uint16_t get_pcg_addr(uint16_t width, uint8_t y_char_size); /** @brief X1 Turbo: Retrieves the current CHR ROM address in Hi-Speed Mode. @return Destination CHR address. */ - UINT16 check_chr_addr(); + uint16_t check_chr_addr(); /** @brief X1 Turbo: Retrieves the current PCG ROM address in Hi-Speed Mode. @return Destination CHR address. */ - UINT16 check_pcg_addr(); + uint16_t check_pcg_addr(); /** @brief MCU side: retrieve keycode to game key conversion. @param port Address to convert. @return The converted game key buffer */ - UINT8 get_game_key(UINT8 port); + uint8_t get_game_key(uint8_t port); /** @brief MCU side: retrieve keyboard special key register. @@ -206,14 +206,14 @@ public: ---- --x- SHIFT ON ---- ---x CTRL ON */ - UINT8 check_keyboard_shift(); + uint8_t check_keyboard_shift(); /** @brief convert MAME input to raw scancode for keyboard. @return the converted scancode @todo Unoptimized. */ - UINT16 check_keyboard_press(); + uint16_t check_keyboard_press(); DECLARE_READ8_MEMBER(x1_mem_r); DECLARE_WRITE8_MEMBER(x1_mem_w); @@ -269,7 +269,7 @@ public: DECLARE_VIDEO_START(x1); DECLARE_PALETTE_INIT(x1); DECLARE_MACHINE_RESET(x1turbo); - UINT32 screen_update_x1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_x1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_INPUT_CHANGED_MEMBER(ipl_reset); DECLARE_INPUT_CHANGED_MEMBER(nmi_reset); TIMER_CALLBACK_MEMBER(x1_rtc_increment); @@ -277,17 +277,17 @@ public: TIMER_DEVICE_CALLBACK_MEMBER(x1_keyboard_callback); DECLARE_WRITE_LINE_MEMBER(fdc_drq_w); DECLARE_WRITE_LINE_MEMBER(hdl_w); - UINT8 m_fdc_ctrl; + uint8_t m_fdc_ctrl; - void x1_draw_pixel(bitmap_rgb32 &bitmap,int y,int x,UINT16 pen,UINT8 width,UINT8 height); + void x1_draw_pixel(bitmap_rgb32 &bitmap,int y,int x,uint16_t pen,uint8_t width,uint8_t height); void draw_fgtilemap(bitmap_rgb32 &bitmap,const rectangle &cliprect); void draw_gfxbitmap(bitmap_rgb32 &bitmap,const rectangle &cliprect, int plane,int pri); - UINT8 check_prev_height(int x,int y,int x_size); - UINT8 check_line_valid_height(int y,int x_size,int height); + uint8_t check_prev_height(int x,int y,int x_size); + uint8_t check_line_valid_height(int y,int x_size,int height); int priority_mixer_pri(int color); - void cmt_command( UINT8 cmd ); - UINT16 jis_convert(int kanji_addr); + void cmt_command( uint8_t cmd ); + uint16_t jis_convert(int kanji_addr); DECLARE_READ8_MEMBER(memory_read_byte); DECLARE_WRITE8_MEMBER(memory_write_byte); diff --git a/src/mame/includes/x68k.h b/src/mame/includes/x68k.h index 70273daf938..1450d3694f5 100644 --- a/src/mame/includes/x68k.h +++ b/src/mame/includes/x68k.h @@ -75,10 +75,10 @@ public: m_md3b(*this, "md3b"), m_md6b(*this, "md6b"), m_md6b_extra(*this, "md6b_extra"), - m_nvram(0x4000/sizeof(UINT16)), - m_tvram(0x80000/sizeof(UINT16)), - m_gvram(0x80000/sizeof(UINT16)), - m_spritereg(0x8000/sizeof(UINT16), 0) + m_nvram(0x4000/sizeof(uint16_t)), + m_tvram(0x80000/sizeof(uint16_t)), + m_gvram(0x80000/sizeof(uint16_t)), + m_spritereg(0x8000/sizeof(uint16_t), 0) { } required_device m_maincpu; @@ -108,10 +108,10 @@ public: required_ioport m_md6b; required_ioport m_md6b_extra; - std::vector m_nvram; - std::vector m_tvram; - std::vector m_gvram; - std::vector m_spritereg; + std::vector m_nvram; + std::vector m_tvram; + std::vector m_gvram; + std::vector m_spritereg; bitmap_ind16 m_pcgbitmap; bitmap_ind16 m_gfxbitmap; @@ -128,7 +128,7 @@ public: int monitor; int contrast; int keyctrl; - UINT16 cputype; + uint16_t cputype; } m_sysport; struct { @@ -223,16 +223,16 @@ public: int seq2; // part of 6-button input sequence. emu_timer* io_timeout2; } m_mdctrl; - UINT8 m_ppi_port[3]; + uint8_t m_ppi_port[3]; int m_current_vector[8]; - UINT8 m_current_irq_line; + uint8_t m_current_irq_line; unsigned int m_scanline; int m_led_state; emu_timer* m_mouse_timer; emu_timer* m_led_timer; emu_timer* m_net_timer; unsigned char m_scc_prev; - UINT16 m_ppi_prev; + uint16_t m_ppi_prev; int m_mfp_prev; emu_timer* m_scanline_timer; emu_timer* m_raster_irq; @@ -240,7 +240,7 @@ public: emu_timer* m_fdc_tc; emu_timer* m_adpcm_timer; emu_timer* m_bus_error_timer; - UINT16* m_spriteram; + uint16_t* m_spriteram; tilemap_t* m_bg0_8; tilemap_t* m_bg1_8; tilemap_t* m_bg0_16; @@ -260,7 +260,7 @@ public: DECLARE_MACHINE_START(x68000); DECLARE_VIDEO_START(x68000); DECLARE_PALETTE_INIT(x68000); - UINT32 screen_update_x68000(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_x68000(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(x68k_led_callback); TIMER_CALLBACK_MEMBER(x68k_scc_ack); TIMER_CALLBACK_MEMBER(md_6button_port1_timeout); @@ -290,10 +290,10 @@ public: int x68k_read_mouse(); void x68k_set_adpcm(); - UINT8 md_3button_r(int port); + uint8_t md_3button_r(int port); void md_6button_init(); - UINT8 md_6button_r(int port); - UINT8 xpd1lr_r(int port); + uint8_t md_6button_r(int port); + uint8_t xpd1lr_r(int port); DECLARE_WRITE_LINE_MEMBER(x68k_fm_irq); DECLARE_WRITE_LINE_MEMBER(x68k_irq2_line); @@ -335,11 +335,11 @@ public: IRQ_CALLBACK_MEMBER(x68k_int_ack); private: - inline void x68k_plot_pixel(bitmap_rgb32 &bitmap, int x, int y, UINT32 color); - void x68k_crtc_text_copy(int src, int dest, UINT8 planes); + inline void x68k_plot_pixel(bitmap_rgb32 &bitmap, int x, int y, uint32_t color); + void x68k_crtc_text_copy(int src, int dest, uint8_t planes); void x68k_crtc_refresh_mode(); void x68k_draw_text(bitmap_rgb32 &bitmap, int xscr, int yscr, rectangle rect); - bool x68k_draw_gfx_scanline(bitmap_ind16 &bitmap, rectangle cliprect, UINT8 priority); + bool x68k_draw_gfx_scanline(bitmap_ind16 &bitmap, rectangle cliprect, uint8_t priority); void x68k_draw_gfx(bitmap_rgb32 &bitmap,rectangle cliprect); void x68k_draw_sprites(bitmap_ind16 &bitmap, int priority, rectangle cliprect); @@ -348,7 +348,7 @@ public: protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - void set_bus_error(UINT32 address, bool write, UINT16 mem_mask); + void set_bus_error(uint32_t address, bool write, uint16_t mem_mask); bool m_bus_error; }; diff --git a/src/mame/includes/xain.h b/src/mame/includes/xain.h index db61f38e425..a47a9b8128f 100644 --- a/src/mame/includes/xain.h +++ b/src/mame/includes/xain.h @@ -30,33 +30,33 @@ public: required_device m_palette; required_device m_soundlatch; - required_shared_ptr m_charram; - required_shared_ptr m_bgram0; - required_shared_ptr m_bgram1; - required_shared_ptr m_spriteram; + required_shared_ptr m_charram; + required_shared_ptr m_bgram0; + required_shared_ptr m_bgram1; + required_shared_ptr m_spriteram; int m_vblank; int m_from_main; int m_from_mcu; - UINT8 m_ddr_a; - UINT8 m_ddr_b; - UINT8 m_ddr_c; - UINT8 m_port_a_out; - UINT8 m_port_b_out; - UINT8 m_port_c_out; - UINT8 m_port_a_in; - UINT8 m_port_b_in; - UINT8 m_port_c_in; + uint8_t m_ddr_a; + uint8_t m_ddr_b; + uint8_t m_ddr_c; + uint8_t m_port_a_out; + uint8_t m_port_b_out; + uint8_t m_port_c_out; + uint8_t m_port_a_in; + uint8_t m_port_b_in; + uint8_t m_port_c_in; int m_mcu_ready; int m_mcu_accept; - UINT8 m_pri; + uint8_t m_pri; tilemap_t *m_char_tilemap; tilemap_t *m_bgram0_tilemap; tilemap_t *m_bgram1_tilemap; - UINT8 m_scrollxP0[2]; - UINT8 m_scrollyP0[2]; - UINT8 m_scrollxP1[2]; - UINT8 m_scrollyP1[2]; + uint8_t m_scrollxP0[2]; + uint8_t m_scrollyP0[2]; + uint8_t m_scrollxP1[2]; + uint8_t m_scrollyP1[2]; DECLARE_WRITE8_MEMBER(cpuA_bankswitch_w); DECLARE_WRITE8_MEMBER(cpuB_bankswitch_w); @@ -96,7 +96,7 @@ public: virtual void machine_start() override; virtual void video_start() override; - 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); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); inline int scanline_to_vcount(int scanline); diff --git a/src/mame/includes/xbox.h b/src/mame/includes/xbox.h index 784c2501232..141b2bea1ca 100644 --- a/src/mame/includes/xbox.h +++ b/src/mame/includes/xbox.h @@ -50,7 +50,7 @@ public: virtual void hack_usb() {}; void vblank_callback(screen_device &screen, bool state); - UINT32 screen_update_callback(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_callback(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); virtual void machine_start() override; DECLARE_WRITE_LINE_MEMBER(xbox_pic8259_1_set_int_line); @@ -74,21 +74,21 @@ public: int command; int rw; int(*devices[128])(xbox_base_state &chs, int command, int rw, int data); - UINT32 words[256 / 4]; + uint32_t words[256 / 4]; } smbusst; struct apu_state { - UINT32 memory[0x60000 / 4]; - UINT32 gpdsp_sgaddress; // global processor scatter-gather - UINT32 gpdsp_sgblocks; - UINT32 gpdsp_address; - UINT32 epdsp_sgaddress; // encoder processor scatter-gather - UINT32 epdsp_sgblocks; - UINT32 unknown_sgaddress; - UINT32 unknown_sgblocks; + uint32_t memory[0x60000 / 4]; + uint32_t gpdsp_sgaddress; // global processor scatter-gather + uint32_t gpdsp_sgblocks; + uint32_t gpdsp_address; + uint32_t epdsp_sgaddress; // encoder processor scatter-gather + uint32_t epdsp_sgblocks; + uint32_t unknown_sgaddress; + uint32_t unknown_sgblocks; int voice_number; - UINT32 voices_heap_blockaddr[1024]; - UINT64 voices_active[4]; //one bit for each voice: 1 playing 0 not - UINT32 voicedata_address; + uint32_t voices_heap_blockaddr[1024]; + uint64_t voices_active[4]; //one bit for each voice: 1 playing 0 not + uint32_t voicedata_address; int voices_frequency[256]; // sample rate int voices_position[256]; // position in samples * 1000 int voices_position_start[256]; // position in samples * 1000 @@ -98,17 +98,17 @@ public: address_space *space; } apust; struct ac97_state { - UINT32 mixer_regs[0x80 / 4]; - UINT32 controller_regs[0x38 / 4]; + uint32_t mixer_regs[0x80 / 4]; + uint32_t controller_regs[0x38 / 4]; } ac97st; struct superio_state { bool configuration_mode; int index; int selected; - UINT8 registers[16][256]; // 256 registers for up to 16 devices, registers 0-0x2f common to all + uint8_t registers[16][256]; // 256 registers for up to 16 devices, registers 0-0x2f common to all } superiost; - UINT8 pic16lc_buffer[0xff]; + uint8_t pic16lc_buffer[0xff]; std::unique_ptr nvidia_nv2a; bool debug_irq_active; int debug_irq_number; diff --git a/src/mame/includes/xbox_usb.h b/src/mame/includes/xbox_usb.h index b95bb3001c9..bab0689e46d 100644 --- a/src/mame/includes/xbox_usb.h +++ b/src/mame/includes/xbox_usb.h @@ -13,12 +13,12 @@ struct OHCIEndpointDescriptor { int d; // Direction int en; // EndpointNumber int fa; // FunctionAddress - UINT32 tailp; // TDQueueTailPointer - UINT32 headp; // TDQueueHeadPointer - UINT32 nexted; // NextED + uint32_t tailp; // TDQueueTailPointer + uint32_t headp; // TDQueueHeadPointer + uint32_t nexted; // NextED int c; // toggleCarry int h; // Halted - UINT32 word0; + uint32_t word0; }; struct OHCITransferDescriptor { @@ -28,10 +28,10 @@ struct OHCITransferDescriptor { int di; // DelayInterrupt int dp; // Direction/PID int r; // bufferRounding - UINT32 cbp; // CurrentBufferPointer - UINT32 nexttd; // NextTD - UINT32 be; // BufferEnd - UINT32 word0; + uint32_t cbp; // CurrentBufferPointer + uint32_t nexttd; // NextTD + uint32_t be; // BufferEnd + uint32_t word0; }; struct OHCIIsochronousTransferDescriptor { @@ -39,12 +39,12 @@ struct OHCIIsochronousTransferDescriptor { int fc; // FrameCount int di; // DelayInterrupt int sf; // StartingFrame - UINT32 bp0; // BufferPage0 - UINT32 nexttd; // NextTD - UINT32 be; // BufferEnd - UINT32 offset[8]; // Offset/PacketStatusWord - UINT32 word0; - UINT32 word1; + uint32_t bp0; // BufferPage0 + uint32_t nexttd; // NextTD + uint32_t be; // BufferEnd + uint32_t offset[8]; // Offset/PacketStatusWord + uint32_t word0; + uint32_t word1; }; enum OHCIRegisters { @@ -187,60 +187,60 @@ enum OHCICompletionCode { }; struct USBSetupPacket { - UINT8 bmRequestType; - UINT8 bRequest; - UINT16 wValue; - UINT16 wIndex; - UINT16 wLength; + uint8_t bmRequestType; + uint8_t bRequest; + uint16_t wValue; + uint16_t wIndex; + uint16_t wLength; }; struct USBStandardDeviceDescriptor { - UINT8 bLength; - UINT8 bDescriptorType; - UINT16 bcdUSB; - UINT8 bDeviceClass; - UINT8 bDeviceSubClass; - UINT8 bDeviceProtocol; - UINT8 bMaxPacketSize0; - UINT16 idVendor; - UINT16 idProduct; - UINT16 bcdDevice; - UINT8 iManufacturer; - UINT8 iProduct; - UINT8 iSerialNumber; - UINT8 bNumConfigurations; + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t bcdUSB; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + uint16_t idVendor; + uint16_t idProduct; + uint16_t bcdDevice; + uint8_t iManufacturer; + uint8_t iProduct; + uint8_t iSerialNumber; + uint8_t bNumConfigurations; }; struct USBStandardConfigurationDescriptor { - UINT8 bLength; - UINT8 bDescriptorType; - UINT16 wTotalLength; - UINT8 bNumInterfaces; - UINT8 bConfigurationValue; - UINT8 iConfiguration; - UINT8 bmAttributes; - UINT8 MaxPower; + uint8_t bLength; + uint8_t bDescriptorType; + uint16_t wTotalLength; + uint8_t bNumInterfaces; + uint8_t bConfigurationValue; + uint8_t iConfiguration; + uint8_t bmAttributes; + uint8_t MaxPower; }; struct USBStandardInterfaceDescriptor { - UINT8 bLength; - UINT8 bDescriptorType; - UINT8 bInterfaceNumber; - UINT8 bAlternateSetting; - UINT8 bNumEndpoints; - UINT8 bInterfaceClass; - UINT8 bInterfaceSubClass; - UINT8 bInterfaceProtocol; - UINT8 iInterface; + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t bNumEndpoints; + uint8_t bInterfaceClass; + uint8_t bInterfaceSubClass; + uint8_t bInterfaceProtocol; + uint8_t iInterface; }; struct USBStandardEndpointDescriptor { - UINT8 bLength; - UINT8 bDescriptorType; - UINT8 bEndpointAddress; - UINT8 bmAttributes; - UINT16 wMaxPacketSize; - UINT8 bInterval; + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bEndpointAddress; + uint8_t bmAttributes; + uint16_t wMaxPacketSize; + uint8_t bInterval; }; enum USBPid { @@ -310,13 +310,13 @@ enum USBEndpointType struct usb_device_string { - UINT8 *position; + uint8_t *position; int size; }; struct usb_device_interface_alternate { - UINT8 *position; + uint8_t *position; int size; USBStandardInterfaceDescriptor interface_descriptor; std::forward_list endpoint_descriptors; @@ -324,7 +324,7 @@ struct usb_device_interface_alternate struct usb_device_interface { - UINT8 *position; + uint8_t *position; int size; std::forward_list alternate_settings; int selected_alternate; @@ -333,7 +333,7 @@ struct usb_device_interface struct usb_device_configuration { USBStandardConfigurationDescriptor configuration_descriptor; - UINT8 *position; + uint8_t *position; int size; std::forward_list interfaces; }; @@ -343,7 +343,7 @@ class ohci_function_device; // forward declaration class ohci_usb_controller : public device_t { public: - ohci_usb_controller(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ohci_usb_controller(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); ~ohci_usb_controller() {} void usb_ohci_plug(int port, ohci_function_device *function); void usb_ohci_device_address_changed(int old_address, int new_address); @@ -361,16 +361,16 @@ protected: private: void usb_ohci_interrupts(); - void usb_ohci_read_endpoint_descriptor(UINT32 address); - void usb_ohci_writeback_endpoint_descriptor(UINT32 address); - void usb_ohci_read_transfer_descriptor(UINT32 address); - void usb_ohci_writeback_transfer_descriptor(UINT32 address); - void usb_ohci_read_isochronous_transfer_descriptor(UINT32 address); - void usb_ohci_writeback_isochronous_transfer_descriptor(UINT32 address); + void usb_ohci_read_endpoint_descriptor(uint32_t address); + void usb_ohci_writeback_endpoint_descriptor(uint32_t address); + void usb_ohci_read_transfer_descriptor(uint32_t address); + void usb_ohci_writeback_transfer_descriptor(uint32_t address); + void usb_ohci_read_isochronous_transfer_descriptor(uint32_t address); + void usb_ohci_writeback_isochronous_transfer_descriptor(uint32_t address); cpu_device *m_maincpu; //required_device pic8259_1; struct { - UINT32 hc_regs[256]; + uint32_t hc_regs[256]; struct { ohci_function_device *function; int address; @@ -383,13 +383,13 @@ private: } address[256]; emu_timer *timer; int state; - UINT32 framenumber; - UINT32 nextinterupted; - UINT32 nextbulked; + uint32_t framenumber; + uint32_t nextinterupted; + uint32_t nextbulked; int interruptbulkratio; int writebackdonehadcounter; address_space *space; - UINT8 buffer[1024]; + uint8_t buffer[1024]; OHCIEndpointDescriptor endpoint_descriptor; OHCITransferDescriptor transfer_descriptor; OHCIIsochronousTransferDescriptor isochronous_transfer_descriptor; @@ -411,7 +411,7 @@ public: virtual void execute_reset(); virtual void execute_connect() {}; virtual void execute_disconnect() {}; - int execute_transfer(int endpoint, int pid, UINT8 *buffer, int size); + int execute_transfer(int endpoint, int pid, uint8_t *buffer, int size); protected: virtual int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) { return -1; }; virtual int handle_get_status_request(int endpoint, USBSetupPacket *setup) { return 0; }; @@ -420,21 +420,21 @@ protected: virtual int handle_set_descriptor_request(int endpoint, USBSetupPacket *setup) { return 0; }; virtual int handle_synch_frame_request(int endpoint, USBSetupPacket *setup) { return 0; }; virtual void handle_status_stage(int endpoint) { return; }; - virtual int handle_bulk_pid(int endpoint, int pid, UINT8 *buffer, int size) { return 0; }; - virtual int handle_interrupt_pid(int endpoint, int pid, UINT8 *buffer, int size) { return 0; }; - virtual int handle_isochronous_pid(int endpoint, int pid, UINT8 *buffer, int size) { return 0; }; + virtual int handle_bulk_pid(int endpoint, int pid, uint8_t *buffer, int size) { return 0; }; + virtual int handle_interrupt_pid(int endpoint, int pid, uint8_t *buffer, int size) { return 0; }; + virtual int handle_isochronous_pid(int endpoint, int pid, uint8_t *buffer, int size) { return 0; }; void add_device_descriptor(const USBStandardDeviceDescriptor &descriptor); void add_configuration_descriptor(const USBStandardConfigurationDescriptor &descriptor); void add_interface_descriptor(const USBStandardInterfaceDescriptor &descriptor); void add_endpoint_descriptor(const USBStandardEndpointDescriptor &descriptor); - void add_string_descriptor(const UINT8 *descriptor); + void add_string_descriptor(const uint8_t *descriptor); void select_configuration(int index); void select_alternate(int interfacei, int index); int find_alternate(int interfacei); - UINT8 *position_device_descriptor(int &size); - UINT8 *position_configuration_descriptor(int index, int &size); - UINT8 *position_string_descriptor(int index, int &size); + uint8_t *position_device_descriptor(int &size); + uint8_t *position_configuration_descriptor(int index, int &size); + uint8_t *position_string_descriptor(int index, int &size); ohci_usb_controller *busmanager; struct { int type; @@ -442,15 +442,15 @@ protected: int controltype; int controlrecipient; int remain; - UINT8 *position; - UINT8 buffer[128]; + uint8_t *position; + uint8_t buffer[128]; } endpoints[256]; int state; bool settingaddress; int newaddress; int address; int configurationvalue; - UINT8 *descriptors; + uint8_t *descriptors; int descriptors_pos; bool wantstatuscallback; USBStandardDeviceDescriptor device_descriptor; @@ -466,10 +466,10 @@ extern const device_type OHCI_GAME_CONTROLLER; class ohci_game_controller_device : public device_t, public ohci_function_device { public: - ohci_game_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + ohci_game_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void initialize(running_machine &machine, ohci_usb_controller *usb_bus_manager) override; int handle_nonstandard_request(int endpoint, USBSetupPacket *setup) override; - int handle_interrupt_pid(int endpoint, int pid, UINT8 *buffer, int size) override; + int handle_interrupt_pid(int endpoint, int pid, uint8_t *buffer, int size) override; protected: virtual void device_start() override; diff --git a/src/mame/includes/xerox820.h b/src/mame/includes/xerox820.h index cbac30d79da..55f36d2d005 100644 --- a/src/mame/includes/xerox820.h +++ b/src/mame/includes/xerox820.h @@ -68,7 +68,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_kbpio; @@ -82,7 +82,7 @@ public: required_device m_kb; required_memory_region m_rom; required_memory_region m_char_rom; - required_shared_ptr m_video_ram; + required_shared_ptr m_video_ram; DECLARE_READ8_MEMBER( fdc_r ); DECLARE_WRITE8_MEMBER( fdc_w ); @@ -99,8 +99,8 @@ public: void update_nmi(); /* video state */ - UINT8 m_scroll; /* vertical scroll */ - UINT8 m_framecnt; + uint8_t m_scroll; /* vertical scroll */ + uint8_t m_framecnt; int m_ncset2; /* national character set */ int m_vatt; /* X120 video attribute */ int m_lowlite; /* low light attribute */ diff --git a/src/mame/includes/xevious.h b/src/mame/includes/xevious.h index fb091348559..77ae17f926a 100644 --- a/src/mame/includes/xevious.h +++ b/src/mame/includes/xevious.h @@ -16,16 +16,16 @@ public: m_samples(*this, "samples"), m_subcpu3(*this, "sub3") { } - required_shared_ptr m_xevious_sr1; - required_shared_ptr m_xevious_sr2; - required_shared_ptr m_xevious_sr3; - required_shared_ptr m_xevious_fg_colorram; - required_shared_ptr m_xevious_bg_colorram; - required_shared_ptr m_xevious_fg_videoram; - required_shared_ptr m_xevious_bg_videoram; + required_shared_ptr m_xevious_sr1; + required_shared_ptr m_xevious_sr2; + required_shared_ptr m_xevious_sr3; + required_shared_ptr m_xevious_fg_colorram; + required_shared_ptr m_xevious_bg_colorram; + required_shared_ptr m_xevious_fg_videoram; + required_shared_ptr m_xevious_bg_videoram; optional_device m_samples; - INT32 m_xevious_bs[2]; + int32_t m_xevious_bs[2]; DECLARE_DRIVER_INIT(xevious); DECLARE_DRIVER_INIT(xevios); DECLARE_DRIVER_INIT(battles); @@ -35,7 +35,7 @@ public: DECLARE_PALETTE_INIT(xevious); DECLARE_MACHINE_RESET(xevios); DECLARE_MACHINE_RESET(battles); - UINT32 screen_update_xevious(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_xevious(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(battles_interrupt_4); TIMER_DEVICE_CALLBACK_MEMBER(battles_nmi_generate); void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); @@ -63,7 +63,7 @@ public: DECLARE_WRITE8_MEMBER( battles_CPU4_coin_w ); DECLARE_WRITE8_MEMBER( battles_noise_sound_w ); - UINT8 m_customio[16]; + uint8_t m_customio[16]; char m_battles_customio_command; char m_battles_customio_prev_command; char m_battles_customio_command_count; diff --git a/src/mame/includes/xexex.h b/src/mame/includes/xexex.h index fd196ab3fa7..31a97364a31 100644 --- a/src/mame/includes/xexex.h +++ b/src/mame/includes/xexex.h @@ -44,8 +44,8 @@ public: m_soundlatch3(*this, "soundlatch3") { } /* memory pointers */ - required_shared_ptr m_workram; - required_shared_ptr m_spriteram; + required_shared_ptr m_workram; + required_shared_ptr m_spriteram; /* video-related */ int m_layer_colorbase[4]; @@ -54,8 +54,8 @@ public: int m_cur_alpha; /* misc */ - UINT16 m_cur_control2; - INT32 m_strip_0x1a; + uint16_t m_cur_control2; + int32_t m_strip_0x1a; int m_suspension_active; int m_resume_trigger; emu_timer *m_dmadelay_timer; @@ -95,7 +95,7 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_xexex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_xexex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(dmaend_callback); TIMER_DEVICE_CALLBACK_MEMBER(xexex_interrupt); void xexex_postload(); diff --git a/src/mame/includes/xmen.h b/src/mame/includes/xmen.h index 927ad17a462..ddce4d15aa2 100644 --- a/src/mame/includes/xmen.h +++ b/src/mame/includes/xmen.h @@ -36,14 +36,14 @@ public: /* for xmen6p */ std::unique_ptr m_screen_right; std::unique_ptr m_screen_left; - optional_shared_ptr m_xmen6p_spriteramleft; - optional_shared_ptr m_xmen6p_spriteramright; - optional_shared_ptr m_xmen6p_tilemapleft; - optional_shared_ptr m_xmen6p_tilemapright; - UINT16 * m_k053247_ram; + optional_shared_ptr m_xmen6p_spriteramleft; + optional_shared_ptr m_xmen6p_spriteramright; + optional_shared_ptr m_xmen6p_tilemapleft; + optional_shared_ptr m_xmen6p_tilemapright; + uint16_t * m_k053247_ram; /* misc */ - UINT8 m_vblank_irq_mask; + uint8_t m_vblank_irq_mask; /* devices */ required_device m_maincpu; @@ -67,9 +67,9 @@ public: virtual void machine_start() override; virtual void machine_reset() override; DECLARE_VIDEO_START(xmen6p); - UINT32 screen_update_xmen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_xmen6p_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_xmen6p_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_xmen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_xmen6p_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_xmen6p_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_xmen6p(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(xmen_scanline); K052109_CB_MEMBER(tile_callback); diff --git a/src/mame/includes/xorworld.h b/src/mame/includes/xorworld.h index bccde997aeb..1f073192f93 100644 --- a/src/mame/includes/xorworld.h +++ b/src/mame/includes/xorworld.h @@ -19,8 +19,8 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; tilemap_t *m_bg_tilemap; @@ -37,6 +37,6 @@ public: virtual void video_start() override; DECLARE_PALETTE_INIT(xorworld); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/xxmissio.h b/src/mame/includes/xxmissio.h index 0ef1763792e..4a2f32fa11b 100644 --- a/src/mame/includes/xxmissio.h +++ b/src/mame/includes/xxmissio.h @@ -18,16 +18,16 @@ public: required_device m_gfxdecode; required_device m_palette; - required_shared_ptr m_bgram; - required_shared_ptr m_fgram; - required_shared_ptr m_spriteram; + required_shared_ptr m_bgram; + required_shared_ptr m_fgram; + required_shared_ptr m_spriteram; tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_status; - UINT8 m_xscroll; - UINT8 m_yscroll; - UINT8 m_flipscreen; + uint8_t m_status; + uint8_t m_xscroll; + uint8_t m_yscroll; + uint8_t m_flipscreen; DECLARE_WRITE8_MEMBER(bank_sel_w); DECLARE_WRITE8_MEMBER(status_m_w); @@ -51,6 +51,6 @@ public: DECLARE_PALETTE_DECODER(BBGGRRII); - 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); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx); }; diff --git a/src/mame/includes/xybots.h b/src/mame/includes/xybots.h index 7a039c8805d..19b46fcc310 100644 --- a/src/mame/includes/xybots.h +++ b/src/mame/includes/xybots.h @@ -25,7 +25,7 @@ public: required_device m_alpha_tilemap; required_device m_mob; - UINT16 m_h256; + uint16_t m_h256; virtual void update_interrupts() override; DECLARE_READ16_MEMBER(special_port1_r); DECLARE_DRIVER_INIT(xybots); @@ -34,7 +34,7 @@ public: DECLARE_MACHINE_START(xybots); DECLARE_MACHINE_RESET(xybots); DECLARE_VIDEO_START(xybots); - UINT32 screen_update_xybots(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_xybots(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); static const atari_motion_objects_config s_mob_config; }; diff --git a/src/mame/includes/xyonix.h b/src/mame/includes/xyonix.h index 595e2585bf9..3fb92317de0 100644 --- a/src/mame/includes/xyonix.h +++ b/src/mame/includes/xyonix.h @@ -12,7 +12,7 @@ public: required_device m_maincpu; required_device m_gfxdecode; - required_shared_ptr m_vidram; + required_shared_ptr m_vidram; tilemap_t *m_tilemap; @@ -30,7 +30,7 @@ public: virtual void video_start() override; TILE_GET_INFO_MEMBER(get_tile_info); DECLARE_PALETTE_INIT(xyonix); - 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); void handle_coins(int coin); }; diff --git a/src/mame/includes/yiear.h b/src/mame/includes/yiear.h index 92e2c6950d9..c4100259f57 100644 --- a/src/mame/includes/yiear.h +++ b/src/mame/includes/yiear.h @@ -19,9 +19,9 @@ public: m_palette(*this, "palette") { } /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; - required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; + required_shared_ptr m_videoram; /* devices */ required_device m_maincpu; @@ -33,14 +33,14 @@ public: /* video-related */ tilemap_t *m_bg_tilemap; - UINT8 m_yiear_nmi_enable; - UINT8 m_yiear_irq_enable; + uint8_t m_yiear_nmi_enable; + uint8_t m_yiear_irq_enable; DECLARE_WRITE8_MEMBER(yiear_videoram_w); DECLARE_WRITE8_MEMBER(yiear_control_w); DECLARE_READ8_MEMBER(yiear_speech_r); DECLARE_WRITE8_MEMBER(yiear_VLM5030_control_w); - UINT8 m_SN76496_latch; + uint8_t m_SN76496_latch; DECLARE_WRITE8_MEMBER( konami_SN76496_latch_w ) { m_SN76496_latch = data; }; DECLARE_WRITE8_MEMBER( konami_SN76496_w ) { m_sn->write(space, offset, m_SN76496_latch); }; TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -48,7 +48,7 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(yiear); - UINT32 screen_update_yiear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_yiear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(yiear_vblank_interrupt); INTERRUPT_GEN_MEMBER(yiear_nmi_interrupt); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); diff --git a/src/mame/includes/yunsun16.h b/src/mame/includes/yunsun16.h index 90c20686d8f..a1208108cf1 100644 --- a/src/mame/includes/yunsun16.h +++ b/src/mame/includes/yunsun16.h @@ -36,12 +36,12 @@ public: optional_device m_soundlatch; // not shocking /* memory pointers */ - required_shared_ptr m_vram_0; - required_shared_ptr m_vram_1; - required_shared_ptr m_scrollram_0; - required_shared_ptr m_scrollram_1; - required_shared_ptr m_priorityram; - required_shared_ptr m_spriteram; + required_shared_ptr m_vram_0; + required_shared_ptr m_vram_1; + required_shared_ptr m_scrollram_0; + required_shared_ptr m_scrollram_1; + required_shared_ptr m_priorityram; + required_shared_ptr m_spriteram; /* other video-related elements */ tilemap_t *m_tilemap_0; @@ -62,6 +62,6 @@ public: virtual void machine_start() override; virtual void machine_reset() override; virtual void video_start() override; - UINT32 screen_update_yunsun16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_yunsun16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); }; diff --git a/src/mame/includes/yunsung8.h b/src/mame/includes/yunsung8.h index 0a6f90c6528..68f292cb457 100644 --- a/src/mame/includes/yunsung8.h +++ b/src/mame/includes/yunsung8.h @@ -22,8 +22,8 @@ public: /* video-related */ tilemap_t *m_tilemap_0; tilemap_t *m_tilemap_1; - UINT8 *m_videoram_0; - UINT8 *m_videoram_1; + uint8_t *m_videoram_0; + uint8_t *m_videoram_1; int m_layers_ctrl; int m_videobank; @@ -39,7 +39,7 @@ public: required_device m_palette; /* memory */ - UINT8 m_videoram[0x4000]; + uint8_t m_videoram[0x4000]; DECLARE_WRITE8_MEMBER(bankswitch_w); DECLARE_WRITE8_MEMBER(adpcm_w); @@ -57,5 +57,5 @@ public: virtual void machine_reset() override; virtual void video_start() override; - 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); }; diff --git a/src/mame/includes/z80ne.h b/src/mame/includes/z80ne.h index b6d77971981..77b4bb3b893 100644 --- a/src/mame/includes/z80ne.h +++ b/src/mame/includes/z80ne.h @@ -59,8 +59,8 @@ struct z80ne_cass_data_t { struct wd17xx_state_t { int drq; int intrq; - UINT8 drive; /* current drive */ - UINT8 head; /* current head */ + uint8_t drive; /* current drive */ + uint8_t head; /* current head */ }; @@ -106,15 +106,15 @@ public: DECLARE_FLOPPY_FORMATS(floppy_formats); optional_device m_vdg; - optional_shared_ptr m_videoram; + optional_shared_ptr m_videoram; required_device m_ay31015; optional_device m_lx388_kr2376; - UINT8 m_lx383_scan_counter; - UINT8 m_lx383_key[LX383_KEYS]; + uint8_t m_lx383_scan_counter; + uint8_t m_lx383_key[LX383_KEYS]; int m_lx383_downsampler; int m_nmi_delay_counter; int m_reset_delay_counter; - UINT8 m_lx385_ctrl; + uint8_t m_lx385_ctrl; emu_timer *m_cassette_timer; z80ne_cass_data_t m_cass_data; wd17xx_state_t m_wd17xx_state; diff --git a/src/mame/includes/z88.h b/src/mame/includes/z88.h index 7ce8cbd7e75..c982b59181f 100644 --- a/src/mame/includes/z88.h +++ b/src/mame/includes/z88.h @@ -73,21 +73,21 @@ public: DECLARE_WRITE8_MEMBER(bank3_cart_w); // defined in video/z88.c - inline void plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT16 color); - inline UINT8* convert_address(UINT32 offset); - void vh_render_8x8(bitmap_ind16 &bitmap, int x, int y, UINT16 pen0, UINT16 pen1, UINT8 *gfx); - void vh_render_6x8(bitmap_ind16 &bitmap, int x, int y, UINT16 pen0, UINT16 pen1, UINT8 *gfx); - void vh_render_line(bitmap_ind16 &bitmap, int x, int y, UINT16 pen); + inline void plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint16_t color); + inline uint8_t* convert_address(uint32_t offset); + void vh_render_8x8(bitmap_ind16 &bitmap, int x, int y, uint16_t pen0, uint16_t pen1, uint8_t *gfx); + void vh_render_6x8(bitmap_ind16 &bitmap, int x, int y, uint16_t pen0, uint16_t pen1, uint8_t *gfx); + void vh_render_line(bitmap_ind16 &bitmap, int x, int y, uint16_t pen); struct { - UINT8 slot; - UINT8 page; + uint8_t slot; + uint8_t page; } m_bank[4]; int m_bank_type[4]; - UINT8 * m_bios; - UINT8 * m_ram_base; + uint8_t * m_bios; + uint8_t * m_ram_base; z88cart_slot_device * m_carts[4]; DECLARE_PALETTE_INIT(z88); }; diff --git a/src/mame/includes/zac2650.h b/src/mame/includes/zac2650.h index e4d91c83f90..8f3338ff4ee 100644 --- a/src/mame/includes/zac2650.h +++ b/src/mame/includes/zac2650.h @@ -23,8 +23,8 @@ public: required_device m_palette; /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_s2636_0_ram; + required_shared_ptr m_videoram; + required_shared_ptr m_s2636_0_ram; bitmap_ind16 m_bitmap; bitmap_ind16 m_spritebitmap; @@ -40,7 +40,7 @@ public: TILE_GET_INFO_MEMBER(get_bg_tile_info); virtual void video_start() override; DECLARE_PALETTE_INIT(zac2650); - UINT32 screen_update_tinvader(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tinvader(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); int SpriteCollision(int first,int second); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/zaccaria.h b/src/mame/includes/zaccaria.h index 0e30444b671..aa15339b8eb 100644 --- a/src/mame/includes/zaccaria.h +++ b/src/mame/includes/zaccaria.h @@ -35,9 +35,9 @@ public: virtual void machine_reset() override; virtual void video_start() override; DECLARE_PALETTE_INIT(zaccaria); - 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); INTERRUPT_GEN_MEMBER(vblank_irq); - void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,UINT8 *spriteram,int color,int section); + void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,uint8_t *spriteram,int color,int section); protected: required_device m_maincpu; @@ -45,14 +45,14 @@ protected: required_device m_palette; required_device m_audiopcb; - required_shared_ptr m_videoram; - required_shared_ptr m_attributesram; - required_shared_ptr m_spriteram; - required_shared_ptr m_spriteram2; + required_shared_ptr m_videoram; + required_shared_ptr m_attributesram; + required_shared_ptr m_spriteram; + required_shared_ptr m_spriteram2; required_ioport_array<3> m_dsw_port; int m_dsw_sel; tilemap_t *m_bg_tilemap; - UINT8 m_nmi_mask; + uint8_t m_nmi_mask; }; diff --git a/src/mame/includes/zaxxon.h b/src/mame/includes/zaxxon.h index a16373d38ba..223d45a332d 100644 --- a/src/mame/includes/zaxxon.h +++ b/src/mame/includes/zaxxon.h @@ -29,29 +29,29 @@ public: optional_ioport_array<2> m_dials; - required_shared_ptr m_videoram; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_colorram; - optional_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_videoram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_colorram; + optional_shared_ptr m_decrypted_opcodes; - UINT8 m_int_enabled; - UINT8 m_coin_status[3]; - UINT8 m_coin_enable[3]; + uint8_t m_int_enabled; + uint8_t m_coin_status[3]; + uint8_t m_coin_enable[3]; - UINT8 m_razmataz_dial_pos[2]; - UINT16 m_razmataz_counter; + uint8_t m_razmataz_dial_pos[2]; + uint16_t m_razmataz_counter; - UINT8 m_sound_state[3]; - UINT8 m_bg_enable; - UINT8 m_bg_color; - UINT16 m_bg_position; - UINT8 m_fg_color; + uint8_t m_sound_state[3]; + uint8_t m_bg_enable; + uint8_t m_bg_color; + uint16_t m_bg_position; + uint8_t m_fg_color; - UINT8 m_congo_fg_bank; - UINT8 m_congo_color_bank; - UINT8 m_congo_custom[4]; + uint8_t m_congo_fg_bank; + uint8_t m_congo_color_bank; + uint8_t m_congo_custom[4]; - const UINT8 *m_color_codes; + const uint8_t *m_color_codes; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; DECLARE_WRITE8_MEMBER(int_enable_w); @@ -83,10 +83,10 @@ public: DECLARE_PALETTE_INIT(zaxxon); DECLARE_VIDEO_START(razmataz); DECLARE_VIDEO_START(congo); - UINT32 screen_update_zaxxon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_futspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_razmataz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_congo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_zaxxon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_futspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_razmataz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_congo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_int); DECLARE_WRITE8_MEMBER(zaxxon_sound_a_w); DECLARE_WRITE8_MEMBER(zaxxon_sound_b_w); @@ -95,9 +95,9 @@ public: DECLARE_WRITE8_MEMBER(congo_sound_c_w); void video_start_common(tilemap_get_info_delegate fg_tile_info); void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect, int skew); - inline int find_minimum_y(UINT8 value, int flip); - inline int find_minimum_x(UINT8 value, int flip); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 flipxmask, UINT16 flipymask); + inline int find_minimum_y(uint8_t value, int flip); + inline int find_minimum_x(uint8_t value, int flip); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t flipxmask, uint16_t flipymask); }; diff --git a/src/mame/includes/zerozone.h b/src/mame/includes/zerozone.h index 38ca0b89a4d..8935e86e9c7 100644 --- a/src/mame/includes/zerozone.h +++ b/src/mame/includes/zerozone.h @@ -35,16 +35,16 @@ public: required_device m_soundlatch; // shared pointers - required_shared_ptr m_vram; + required_shared_ptr m_vram; // currently this driver uses generic palette handling required_device m_gfxdecode; // state // video-related - UINT16 m_tilebank; + uint16_t m_tilebank; tilemap_t *m_zz_tilemap; - 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: diff --git a/src/mame/includes/zodiack.h b/src/mame/includes/zodiack.h index 064db79a60c..44552ba365a 100644 --- a/src/mame/includes/zodiack.h +++ b/src/mame/includes/zodiack.h @@ -45,20 +45,20 @@ public: required_device m_soundlatch; // shared pointers - required_shared_ptr m_videoram; - required_shared_ptr m_videoram_2; - required_shared_ptr m_attributeram; - required_shared_ptr m_spriteram; - required_shared_ptr m_bulletsram; + required_shared_ptr m_videoram; + required_shared_ptr m_videoram_2; + required_shared_ptr m_attributeram; + required_shared_ptr m_spriteram; + required_shared_ptr m_bulletsram; // state tilemap_t *m_bg_tilemap; tilemap_t *m_fg_tilemap; - UINT8 m_main_nmi_enabled; - UINT8 m_sound_nmi_enabled; + uint8_t m_main_nmi_enabled; + uint8_t m_sound_nmi_enabled; bool m_percuss_hardware; - 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); virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/includes/zx.h b/src/mame/includes/zx.h index 20ccaa5d1c6..d8717e0371c 100644 --- a/src/mame/includes/zx.h +++ b/src/mame/includes/zx.h @@ -40,7 +40,7 @@ public: m_io_config(*this, "CONFIG"), m_screen(*this, "screen") { } - 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); DECLARE_READ8_MEMBER(ula_high_r); DECLARE_READ8_MEMBER(ula_low_r); @@ -87,16 +87,16 @@ protected: emu_timer *m_tape_input, *m_ula_hsync; bool m_vsync_active, m_hsync_active, m_nmi_on, m_nmi_generator_active; - UINT64 m_base_vsync_clock, m_vsync_start_time; - UINT32 m_ypos; + uint64_t m_base_vsync_clock, m_vsync_start_time; + uint32_t m_ypos; - UINT8 m_prev_refresh; - UINT8 m_speaker_state; + uint8_t m_prev_refresh; + uint8_t m_speaker_state; std::unique_ptr m_bitmap_render; std::unique_ptr m_bitmap_buffer; - UINT16 m_ula_char_buffer; + uint16_t m_ula_char_buffer; double m_cassette_cur_level; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; 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 diff --git a/src/mame/video/1942.cpp b/src/mame/video/1942.cpp index 08d4ffb2b2c..1eb28456e3c 100644 --- a/src/mame/video/1942.cpp +++ b/src/mame/video/1942.cpp @@ -28,7 +28,7 @@ void _1942_state::create_palette() { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < 256; i++) @@ -62,7 +62,7 @@ PALETTE_INIT_MEMBER(_1942_state,1942) { create_palette(); - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i, colorbase; color_prom += 3 * 256; /* color_prom now points to the beginning of the lookup table */ @@ -99,7 +99,7 @@ PALETTE_INIT_MEMBER(_1942_state,1942p) palette.set_pen_indirect(i, i); } - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); for (int i = 0; i < 0x100; i++) { palette.set_pen_indirect(i+0x400, color_prom[i]| 0x240); @@ -259,7 +259,7 @@ void _1942_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect } -UINT32 _1942_state::screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t _1942_state::screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); @@ -318,7 +318,7 @@ void _1942_state::draw_sprites_p( bitmap_ind16 &bitmap, const rectangle &cliprec } -UINT32 _1942_state::screen_update_1942p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t _1942_state::screen_update_1942p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites_p(bitmap, cliprect); diff --git a/src/mame/video/1943.cpp b/src/mame/video/1943.cpp index 9469e6fc7a7..1138368d52f 100644 --- a/src/mame/video/1943.cpp +++ b/src/mame/video/1943.cpp @@ -49,7 +49,7 @@ other 2 bits (output & 0x0c) unknown PALETTE_INIT_MEMBER(_1943_state,1943) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < 0x100; i++) @@ -87,14 +87,14 @@ PALETTE_INIT_MEMBER(_1943_state,1943) /* characters use colors 0x40-0x4f */ for (i = 0x00; i < 0x80; i++) { - UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x40; + uint8_t ctabentry = (color_prom[i] & 0x0f) | 0x40; palette.set_pen_indirect(i, ctabentry); } /* foreground tiles use colors 0x00-0x3f */ for (i = 0x80; i < 0x180; i++) { - UINT8 ctabentry = ((color_prom[0x200 + (i - 0x080)] & 0x03) << 4) | + uint8_t ctabentry = ((color_prom[0x200 + (i - 0x080)] & 0x03) << 4) | ((color_prom[0x100 + (i - 0x080)] & 0x0f) << 0); palette.set_pen_indirect(i, ctabentry); } @@ -102,7 +102,7 @@ PALETTE_INIT_MEMBER(_1943_state,1943) /* background tiles also use colors 0x00-0x3f */ for (i = 0x180; i < 0x280; i++) { - UINT8 ctabentry = ((color_prom[0x400 + (i - 0x180)] & 0x03) << 4) | + uint8_t ctabentry = ((color_prom[0x400 + (i - 0x180)] & 0x03) << 4) | ((color_prom[0x300 + (i - 0x180)] & 0x0f) << 0); palette.set_pen_indirect(i, ctabentry); } @@ -112,7 +112,7 @@ PALETTE_INIT_MEMBER(_1943_state,1943) but we handle it differently for speed reasons */ for (i = 0x280; i < 0x380; i++) { - UINT8 ctabentry = ((color_prom[0x600 + (i - 0x280)] & 0x07) << 4) | + uint8_t ctabentry = ((color_prom[0x600 + (i - 0x280)] & 0x07) << 4) | ((color_prom[0x500 + (i - 0x280)] & 0x0f) << 0) | 0x80; palette.set_pen_indirect(i, ctabentry); } @@ -162,7 +162,7 @@ WRITE8_MEMBER(_1943_state::c1943_d806_w) TILE_GET_INFO_MEMBER(_1943_state::c1943_get_bg2_tile_info) { - UINT8 *tilerom = memregion("gfx5")->base() + 0x8000; + uint8_t *tilerom = memregion("gfx5")->base() + 0x8000; int offs = tile_index * 2; int attr = tilerom[offs + 1]; @@ -175,7 +175,7 @@ TILE_GET_INFO_MEMBER(_1943_state::c1943_get_bg2_tile_info) TILE_GET_INFO_MEMBER(_1943_state::c1943_get_bg_tile_info) { - UINT8 *tilerom = memregion("gfx5")->base(); + uint8_t *tilerom = memregion("gfx5")->base(); int offs = tile_index * 2; int attr = tilerom[offs + 1]; @@ -243,7 +243,7 @@ void _1943_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, } } -UINT32 _1943_state::screen_update_1943(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t _1943_state::screen_update_1943(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg2_tilemap->set_scrollx(0, m_bgscrollx[0] + 256 * m_bgscrollx[1]); m_bg_tilemap->set_scrollx(0, m_scrollx[0] + 256 * m_scrollx[1]); diff --git a/src/mame/video/20pacgal.cpp b/src/mame/video/20pacgal.cpp index acc12f25895..6026245223b 100644 --- a/src/mame/video/20pacgal.cpp +++ b/src/mame/video/20pacgal.cpp @@ -27,7 +27,7 @@ void _20pacgal_state::get_pens(pen_t *pens) { offs_t offs; - UINT8 *color_prom = memregion("proms")->base() + (NUM_PENS * m_game_selected); + uint8_t *color_prom = memregion("proms")->base() + (NUM_PENS * m_game_selected); for (offs = 0; offs < NUM_PENS ;offs++) { @@ -96,7 +96,7 @@ void _20pacgal_state::do_pen_lookup(bitmap_rgb32 &bitmap, const rectangle &clipr *************************************/ void _20pacgal_state::draw_sprite(bitmap_rgb32 &bitmap, int y, int x, - UINT8 code, UINT8 color, int flip_y, int flip_x) + uint8_t code, uint8_t color, int flip_y, int flip_x) { int sy; @@ -117,7 +117,7 @@ void _20pacgal_state::draw_sprite(bitmap_rgb32 &bitmap, int y, int x, if ((y >= 0) && (y < SCREEN_HEIGHT)) { int sx; - UINT32 data; + uint32_t data; offs_t gfx_offs = ((code & 0x7f) << 6) | (sy << 2); @@ -135,7 +135,7 @@ void _20pacgal_state::draw_sprite(bitmap_rgb32 &bitmap, int y, int x, if ((x >= 0) && (x < SCREEN_WIDTH)) { offs_t pen = (data & 0xc0000000) >> 30; - UINT8 col; + uint8_t col; col = m_sprite_color_lookup[pen_base | pen] & 0x0f; @@ -178,8 +178,8 @@ void _20pacgal_state::draw_sprites(bitmap_rgb32 &bitmap) }; int x, y; - UINT8 code = m_sprite_ram[offs + 0x000]; - UINT8 color = m_sprite_ram[offs + 0x001]; + uint8_t code = m_sprite_ram[offs + 0x000]; + uint8_t color = m_sprite_ram[offs + 0x001]; int sx = m_sprite_ram[offs + 0x081] - 41 + 0x100*(m_sprite_ram[offs + 0x101] & 3); int sy = 256 - m_sprite_ram[offs + 0x080] + 1; @@ -229,8 +229,8 @@ void _20pacgal_state::draw_chars(bitmap_rgb32 &bitmap) int sy; int y, x; - UINT8 *gfx = &m_char_gfx_ram.target()[m_video_ram[0x0000 | offs] << 4]; - UINT32 color_base = (m_video_ram[0x0400 | offs] & 0x3f) << 2; + uint8_t *gfx = &m_char_gfx_ram.target()[m_video_ram[0x0000 | offs] << 4]; + uint32_t color_base = (m_video_ram[0x0400 | offs] & 0x3f) << 2; /* map the offset to (x, y) character coordinates */ if ((offs & 0x03c0) == 0) @@ -267,12 +267,12 @@ void _20pacgal_state::draw_chars(bitmap_rgb32 &bitmap) int sx; int x_sav = x; - UINT16 data = (gfx[8] << 8) | gfx[0]; + uint16_t data = (gfx[8] << 8) | gfx[0]; /* for each pixel in the row */ for (sx = 0; sx < 8; sx++) { - UINT32 col = ((data & 0x8000) >> 14) | ((data & 0x0800) >> 11); + uint32_t col = ((data & 0x8000) >> 14) | ((data & 0x0800) >> 11); /* pen bits A4-A11 */ if ( col != 0 ) @@ -356,10 +356,10 @@ void _20pacgal_state::draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect if ( (m_stars_ctrl[0] >> 5) & 1 ) { int clock; - UINT16 lfsr = m_stars_seed[0] + m_stars_seed[1]*256; - UINT8 feedback = (m_stars_ctrl[0] >> 6) & 1; - UINT16 star_seta = (m_stars_ctrl[0] >> 3) & 0x01; - UINT16 star_setb = (m_stars_ctrl[0] >> 3) & 0x02; + uint16_t lfsr = m_stars_seed[0] + m_stars_seed[1]*256; + uint8_t feedback = (m_stars_ctrl[0] >> 6) & 1; + uint16_t star_seta = (m_stars_ctrl[0] >> 3) & 0x01; + uint16_t star_setb = (m_stars_ctrl[0] >> 3) & 0x02; int cnt = 0; /* This is a guess based on galaga star sets */ @@ -408,7 +408,7 @@ void _20pacgal_state::draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect * *************************************/ -UINT32 _20pacgal_state::screen_update_20pacgal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _20pacgal_state::screen_update_20pacgal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(0, cliprect); draw_stars(bitmap,cliprect); diff --git a/src/mame/video/40love.cpp b/src/mame/video/40love.cpp index 8d8fe438d6e..046f162668a 100644 --- a/src/mame/video/40love.cpp +++ b/src/mame/video/40love.cpp @@ -14,7 +14,7 @@ PALETTE_INIT_MEMBER(fortyl_state, fortyl) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < palette.entries(); i++) @@ -103,8 +103,8 @@ void fortyl_state::redraw_pixels() void fortyl_state::video_start() { - m_pixram1 = make_unique_clear(0x4000); - m_pixram2 = make_unique_clear(0x4000); + m_pixram1 = make_unique_clear(0x4000); + m_pixram2 = make_unique_clear(0x4000); m_tmp_bitmap1 = std::make_unique(256, 256); m_tmp_bitmap2 = std::make_unique(256, 256); @@ -285,8 +285,8 @@ spriteram format (4 bytes per sprite): void fortyl_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) { - UINT8 *spriteram = m_spriteram; - UINT8 *spriteram_2 = m_spriteram2; + uint8_t *spriteram = m_spriteram; + uint8_t *spriteram_2 = m_spriteram2; int offs; /* spriteram #1 */ @@ -365,7 +365,7 @@ void fortyl_state::draw_pixram( bitmap_ind16 &bitmap, const rectangle &cliprect copybitmap(bitmap, *m_tmp_bitmap2, f, f, m_xoffset, 0, cliprect); } -UINT32 fortyl_state::screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t fortyl_state::screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if(m_screen_disable == true) { diff --git a/src/mame/video/4enraya.cpp b/src/mame/video/4enraya.cpp index 1c7eadfbacb..ca22f8cc518 100644 --- a/src/mame/video/4enraya.cpp +++ b/src/mame/video/4enraya.cpp @@ -29,7 +29,7 @@ void _4enraya_state::video_start() m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(_4enraya_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); } -UINT32 _4enraya_state::screen_update_4enraya(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t _4enraya_state::screen_update_4enraya(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/733_asr.cpp b/src/mame/video/733_asr.cpp index 0194a1316fc..a1b1a596f8b 100644 --- a/src/mame/video/733_asr.cpp +++ b/src/mame/video/733_asr.cpp @@ -80,7 +80,7 @@ PALETTE_INIT_MEMBER(asr733_device, asr733) const device_type ASR733 = &device_creator; -asr733_device::asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +asr733_device::asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ASR733, "733 ASR", tag, owner, clock, "asr733", __FILE__), device_gfx_interface(mconfig, *this, GFXDECODE_NAME(asr733), "palette"), m_keyint_line(*this), @@ -109,7 +109,7 @@ void asr733_device::device_start() m_line_timer = timer_alloc(0); - UINT8 *dst; + uint8_t *dst; static const unsigned char fontdata6x8[asrfontdata_size] = { /* ASCII characters */ @@ -205,7 +205,7 @@ void asr733_device::draw_char(int character, int x, int y, int color) void asr733_device::linefeed() { - UINT8 buf[asr_window_width]; + uint8_t buf[asr_window_width]; for (int y=asr_window_offset_y; yfill(0, asr_scroll_clear_window); } -void asr733_device::transmit(UINT8 data) +void asr733_device::transmit(uint8_t data) { switch (data) { @@ -608,8 +608,8 @@ void asr733_device::check_keyboard() enum { repeat_delay = 5 /* approx. 1/10s */ }; - //UINT16 key_buf[6]; - UINT16 key_buf[4]; + //uint16_t key_buf[6]; + uint16_t key_buf[4]; int i, j; modifier_state_t modifier_state; int repeat_mode; @@ -703,7 +703,7 @@ void asr733_device::check_keyboard() } } -UINT32 asr733_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t asr733_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { refresh(bitmap, 0, 0); return 0; diff --git a/src/mame/video/733_asr.h b/src/mame/video/733_asr.h index d5b48eebc9e..4f14ededda4 100644 --- a/src/mame/video/733_asr.h +++ b/src/mame/video/733_asr.h @@ -13,7 +13,7 @@ enum class asr733_device : public device_t, public device_gfx_interface { public: - asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_PALETTE_INIT(asr733); @@ -29,7 +29,7 @@ public: return downcast(device).m_lineint_line.set_callback(object); } - 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 @@ -42,7 +42,7 @@ protected: private: // internal state #if 0 - UINT8 m_OutQueue[ASROutQueueSize]; + uint8_t m_OutQueue[ASROutQueueSize]; int m_OutQueueHead; int m_OutQueueLen; #endif @@ -53,16 +53,16 @@ private: void set_interrupt_line(); void draw_char(int character, int x, int y, int color); void linefeed(); - void transmit(UINT8 data); + void transmit(uint8_t data); emu_timer *m_line_timer; // screen line timer - UINT8 m_recv_buf; - UINT8 m_xmit_buf; + uint8_t m_recv_buf; + uint8_t m_xmit_buf; - UINT8 m_status; - UINT8 m_mode; - UINT8 m_last_key_pressed; + uint8_t m_status; + uint8_t m_mode; + uint8_t m_last_key_pressed; int m_last_modifier_state; unsigned char m_repeat_timer; diff --git a/src/mame/video/8080bw.cpp b/src/mame/video/8080bw.cpp index cce25bf803a..ae063eb69fc 100644 --- a/src/mame/video/8080bw.cpp +++ b/src/mame/video/8080bw.cpp @@ -52,7 +52,7 @@ PALETTE_INIT_MEMBER( _8080bw_state, sflush ) } -inline void _8080bw_state::set_pixel( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, int color ) +inline void _8080bw_state::set_pixel( bitmap_rgb32 &bitmap, uint8_t y, uint8_t x, int color ) { if (y >= MW8080BW_VCOUNTER_START_NO_VBLANK) { @@ -64,7 +64,7 @@ inline void _8080bw_state::set_pixel( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, in } -inline void _8080bw_state::set_8_pixels( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, int fore_color, int back_color ) +inline void _8080bw_state::set_8_pixels( bitmap_rgb32 &bitmap, uint8_t y, uint8_t x, uint8_t data, int fore_color, int back_color ) { int i; @@ -81,11 +81,11 @@ inline void _8080bw_state::set_8_pixels( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, /* this is needed as this driver doesn't emulate the shift register like mw8080bw does */ void _8080bw_state::clear_extra_columns( bitmap_rgb32 &bitmap, int color ) { - UINT8 x; + uint8_t x; for (x = 0; x < 4; x++) { - UINT8 y; + uint8_t y; for (y = MW8080BW_VCOUNTER_START_NO_VBLANK; y != 0; y++) { @@ -98,20 +98,20 @@ void _8080bw_state::clear_extra_columns( bitmap_rgb32 &bitmap, int color ) } -UINT32 _8080bw_state::screen_update_invadpt2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_invadpt2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 *prom = memregion("proms")->base(); - UINT8 *color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000]; + uint8_t *prom = memregion("proms")->base(); + uint8_t *color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000]; for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; offs_t color_address = (offs >> 8 << 5) | (offs & 0x1f); - UINT8 data = m_main_ram[offs]; - UINT8 fore_color = m_screen_red ? 1 : color_map_base[color_address] & 0x07; + uint8_t data = m_main_ram[offs]; + uint8_t fore_color = m_screen_red ? 1 : color_map_base[color_address] & 0x07; set_8_pixels(bitmap, y, x, data, fore_color, 0); } @@ -122,20 +122,20 @@ UINT32 _8080bw_state::screen_update_invadpt2(screen_device &screen, bitmap_rgb32 } -UINT32 _8080bw_state::screen_update_ballbomb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_ballbomb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 *prom = memregion("proms")->base(); - UINT8 *color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000]; + uint8_t *prom = memregion("proms")->base(); + uint8_t *color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000]; for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; offs_t color_address = (offs >> 8 << 5) | (offs & 0x1f); - UINT8 data = m_main_ram[offs]; - UINT8 fore_color = m_screen_red ? 1 : color_map_base[color_address] & 0x07; + uint8_t data = m_main_ram[offs]; + uint8_t fore_color = m_screen_red ? 1 : color_map_base[color_address] & 0x07; /* blue background */ set_8_pixels(bitmap, y, x, data, fore_color, 2); @@ -147,25 +147,25 @@ UINT32 _8080bw_state::screen_update_ballbomb(screen_device &screen, bitmap_rgb32 } -UINT32 _8080bw_state::screen_update_schaser(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_schaser(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 *background_map_base = memregion("proms")->base(); + uint8_t *background_map_base = memregion("proms")->base(); for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 back_color = 0; + uint8_t back_color = 0; - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; - UINT8 data = m_main_ram[offs]; - UINT8 fore_color = m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; + uint8_t data = m_main_ram[offs]; + uint8_t fore_color = m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; if (!m_schaser_background_disable) { offs_t back_address = (offs >> 8 << 5) | (offs & 0x1f); - UINT8 back_data = background_map_base[back_address]; + uint8_t back_data = background_map_base[back_address]; /* the equations derived from the schematics don't appear to produce the right colors, but this one does, at least for this PROM */ @@ -181,15 +181,15 @@ UINT32 _8080bw_state::screen_update_schaser(screen_device &screen, bitmap_rgb32 } -UINT32 _8080bw_state::screen_update_schasercv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_schasercv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; - UINT8 data = m_main_ram[offs]; - UINT8 fore_color = m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; + uint8_t data = m_main_ram[offs]; + uint8_t fore_color = m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; /* blue background */ set_8_pixels(bitmap, y, x, data, fore_color, 2); @@ -201,16 +201,16 @@ UINT32 _8080bw_state::screen_update_schasercv(screen_device &screen, bitmap_rgb3 } -UINT32 _8080bw_state::screen_update_rollingc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_rollingc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; - UINT8 data = m_main_ram[offs]; - UINT8 fore_color = m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f00) >> 3)] & 0x0f; - UINT8 back_color = m_scattered_colorram2[(offs & 0x1f) | ((offs & 0x1f00) >> 3)] & 0x0f; + uint8_t data = m_main_ram[offs]; + uint8_t fore_color = m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f00) >> 3)] & 0x0f; + uint8_t back_color = m_scattered_colorram2[(offs & 0x1f) | ((offs & 0x1f00) >> 3)] & 0x0f; set_8_pixels(bitmap, y, x, data, fore_color, back_color); } @@ -221,17 +221,17 @@ UINT32 _8080bw_state::screen_update_rollingc(screen_device &screen, bitmap_rgb32 } -UINT32 _8080bw_state::screen_update_polaris(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_polaris(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 *color_map_base = memregion("proms")->base(); - UINT8 *cloud_gfx = memregion("user1")->base(); + uint8_t *color_map_base = memregion("proms")->base(); + uint8_t *cloud_gfx = memregion("user1")->base(); for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; - UINT8 data = m_main_ram[offs]; + uint8_t data = m_main_ram[offs]; offs_t color_address = (offs >> 8 << 5) | (offs & 0x1f); @@ -241,10 +241,10 @@ UINT32 _8080bw_state::screen_update_polaris(screen_device &screen, bitmap_rgb32 by screenshots. Bit 3 is connected to cloud enable, while bits 1 and 2 are marked 'not use' (sic) */ - UINT8 back_color = (color_map_base[color_address] & 0x01) ? 6 : 2; - UINT8 fore_color = ~m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; + uint8_t back_color = (color_map_base[color_address] & 0x01) ? 6 : 2; + uint8_t fore_color = ~m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; - UINT8 cloud_y = y - m_polaris_cloud_pos; + uint8_t cloud_y = y - m_polaris_cloud_pos; if ((color_map_base[color_address] & 0x08) || (cloud_y >= 64)) { @@ -257,7 +257,7 @@ UINT32 _8080bw_state::screen_update_polaris(screen_device &screen, bitmap_rgb32 for (i = 0; i < 8; i++) { - UINT8 color; + uint8_t color; if (data & 0x01) { @@ -285,15 +285,15 @@ UINT32 _8080bw_state::screen_update_polaris(screen_device &screen, bitmap_rgb32 } -UINT32 _8080bw_state::screen_update_lupin3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_lupin3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; - UINT8 data = m_main_ram[offs]; - UINT8 fore_color = ~m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; + uint8_t data = m_main_ram[offs]; + uint8_t fore_color = ~m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; set_8_pixels(bitmap, y, x, data, fore_color, 0); } @@ -304,17 +304,17 @@ UINT32 _8080bw_state::screen_update_lupin3(screen_device &screen, bitmap_rgb32 & } -UINT32 _8080bw_state::screen_update_cosmo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_cosmo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; offs_t color_address = (offs >> 8 << 5) | (offs & 0x1f); - UINT8 data = m_main_ram[offs]; - UINT8 fore_color = m_colorram[color_address] & 0x07; + uint8_t data = m_main_ram[offs]; + uint8_t fore_color = m_colorram[color_address] & 0x07; set_8_pixels(bitmap, y, x, data, fore_color, 0); } @@ -325,20 +325,20 @@ UINT32 _8080bw_state::screen_update_cosmo(screen_device &screen, bitmap_rgb32 &b } -UINT32 _8080bw_state::screen_update_indianbt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_indianbt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 *prom = memregion("proms")->base(); - UINT8 *color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000]; + uint8_t *prom = memregion("proms")->base(); + uint8_t *color_map_base = m_color_map ? &prom[0x0400] : &prom[0x0000]; for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; offs_t color_address = (offs >> 8 << 5) | (offs & 0x1f); - UINT8 data = m_main_ram[offs]; - UINT8 fore_color = color_map_base[color_address] & 0x07; + uint8_t data = m_main_ram[offs]; + uint8_t fore_color = color_map_base[color_address] & 0x07; set_8_pixels(bitmap, y, x, data, fore_color, 0); } @@ -349,15 +349,15 @@ UINT32 _8080bw_state::screen_update_indianbt(screen_device &screen, bitmap_rgb32 } -UINT32 _8080bw_state::screen_update_sflush(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_sflush(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; - UINT8 data = m_main_ram[offs]; - UINT8 fore_color = m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; + uint8_t data = m_main_ram[offs]; + uint8_t fore_color = m_scattered_colorram[(offs & 0x1f) | ((offs & 0x1f80) >> 2)] & 0x07; set_8_pixels(bitmap, y, x, data, fore_color, 0); } @@ -368,14 +368,14 @@ UINT32 _8080bw_state::screen_update_sflush(screen_device &screen, bitmap_rgb32 & } -UINT32 _8080bw_state::screen_update_shuttlei(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_shuttlei(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (offs_t offs = 0; offs < m_main_ram.bytes(); offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; - UINT8 data = m_main_ram[offs]; + uint8_t data = m_main_ram[offs]; for (int i = 0; i < 8; i++) { @@ -391,15 +391,15 @@ UINT32 _8080bw_state::screen_update_shuttlei(screen_device &screen, bitmap_rgb32 } -UINT32 _8080bw_state::screen_update_spacecom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t _8080bw_state::screen_update_spacecom(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { for (offs_t offs = 0; offs < 0x1c00; offs++) { - UINT8 y = offs >> 5; - UINT8 x = offs << 3; - UINT8 flipx = m_flip_screen ? 7 : 0; + uint8_t y = offs >> 5; + uint8_t x = offs << 3; + uint8_t flipx = m_flip_screen ? 7 : 0; - UINT8 data = m_main_ram[offs+0x400]; + uint8_t data = m_main_ram[offs+0x400]; for (int i = 0; i < 8; i++) { diff --git a/src/mame/video/88games.cpp b/src/mame/video/88games.cpp index 70c1206b44c..4d9c43b29c4 100644 --- a/src/mame/video/88games.cpp +++ b/src/mame/video/88games.cpp @@ -55,7 +55,7 @@ K051316_CB_MEMBER(_88games_state::zoom_callback) ***************************************************************************/ -UINT32 _88games_state::screen_update_88games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t _88games_state::screen_update_88games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_k052109->tilemap_update(); diff --git a/src/mame/video/911_chr.h b/src/mame/video/911_chr.h index 6d24b5d0415..074b485f57c 100644 --- a/src/mame/video/911_chr.h +++ b/src/mame/video/911_chr.h @@ -151,7 +151,7 @@ static const char_override_t frenchWP_overrides[9] = /* char_defs array: character matrices for each character */ -static const UINT8 char_defs[char_defs_count][10] = +static const uint8_t char_defs[char_defs_count][10] = { /* US character set: 128 7*10 character matrix */ { /* 0x00 */ diff --git a/src/mame/video/911_vdt.cpp b/src/mame/video/911_vdt.cpp index 098bf1f6cb4..0f2fa8ad020 100644 --- a/src/mame/video/911_vdt.cpp +++ b/src/mame/video/911_vdt.cpp @@ -103,7 +103,7 @@ static const unsigned short vdt911_palette[] = */ PALETTE_INIT_MEMBER(vdt911_device, vdt911) { - UINT8 i, r, g, b; + uint8_t i, r, g, b; for ( i = 0; i < 3; i++ ) { @@ -118,7 +118,7 @@ PALETTE_INIT_MEMBER(vdt911_device, vdt911) /* Copy a character bitmap array to another location in memory */ -static void copy_character_matrix_array(const UINT8 char_array[128][10], UINT8 *dest) +static void copy_character_matrix_array(const uint8_t char_array[128][10], uint8_t *dest) { int i, j; @@ -130,7 +130,7 @@ static void copy_character_matrix_array(const UINT8 char_array[128][10], UINT8 * /* Patch a character bitmap array according to an array of char_override_t */ -static void apply_char_overrides(int nb_char_overrides, const char_override_t char_overrides[], UINT8 *dest) +static void apply_char_overrides(int nb_char_overrides, const char_override_t char_overrides[], uint8_t *dest) { int i, j; @@ -143,7 +143,7 @@ static void apply_char_overrides(int nb_char_overrides, const char_override_t ch const device_type VDT911 = &device_creator; -vdt911_device::vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +vdt911_device::vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VDT911, "911 VDT", tag, owner, clock, "vdt911", __FILE__), device_gfx_interface(mconfig, *this, GFXDECODE_NAME(vdt911), "palette"), m_beeper(*this, "beeper"), @@ -183,8 +183,8 @@ void vdt911_device::device_start() m_blink_timer->adjust(attotime::from_msec(0), 0, attotime::from_msec(250)); - UINT8 *base; - UINT8 *chr = machine().root_device().memregion(vdt911_chr_region)->base(); + uint8_t *base; + uint8_t *chr = machine().root_device().memregion(vdt911_chr_region)->base(); /* set up US character definitions */ base = chr+vdt911_US_chr_offset; @@ -541,7 +541,7 @@ void vdt911_device::check_keyboard() static unsigned char repeat_timer; enum { repeat_delay = 5 /* approx. 1/10s */ }; - UINT16 key_buf[6]; + uint16_t key_buf[6]; int i, j; modifier_state_t modifier_state; int repeat_mode; @@ -666,7 +666,7 @@ int vdt911_device::get_refresh_rate() return ((m_model == vdt911_model_US) || (m_model == vdt911_model_Japanese))? 60 : 50; } -UINT32 vdt911_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t vdt911_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { refresh(bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/911_vdt.h b/src/mame/video/911_vdt.h index 7d90d549d50..519d49cf357 100644 --- a/src/mame/video/911_vdt.h +++ b/src/mame/video/911_vdt.h @@ -37,7 +37,7 @@ enum vdt911_model_t class vdt911_device : public device_t, public device_gfx_interface { public: - vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(cru_r); DECLARE_WRITE8_MEMBER(cru_w); @@ -54,7 +54,7 @@ public: return downcast(device).m_lineint_line.set_callback(object); } - 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 @@ -74,8 +74,8 @@ private: vdt911_screen_size_t m_screen_size; // char_960 for 960-char, 12-line model; char_1920 for 1920-char, 24-line model vdt911_model_t m_model; // country code - UINT8 m_data_reg; // dt911 write buffer - UINT8 m_display_RAM[2048]; // vdt911 char buffer (1kbyte for 960-char model, 2kbytes for 1920-char model) + uint8_t m_data_reg; // dt911 write buffer + uint8_t m_display_RAM[2048]; // vdt911 char buffer (1kbyte for 960-char model, 2kbytes for 1920-char model) unsigned int m_cursor_address; // current cursor address (controlled by the computer, affects both display and I/O protocol) unsigned int m_cursor_address_mask; // 1023 for 960-char model, 2047 for 1920-char model @@ -84,7 +84,7 @@ private: emu_timer *m_blink_timer; // cursor blink clock emu_timer *m_line_timer; // screen line timer - UINT8 m_keyboard_data; // last code pressed on keyboard + uint8_t m_keyboard_data; // last code pressed on keyboard bool m_keyboard_data_ready; // true if there is a new code in keyboard_data bool m_keyboard_interrupt_enable; // true when keybord interrupts are enabled @@ -97,7 +97,7 @@ private: bool m_word_select; // CRU interface mode bool m_previous_word_select; // value of word_select is saved here - UINT8 m_last_key_pressed; + uint8_t m_last_key_pressed; int m_last_modifier_state; char m_foreign_mode; diff --git a/src/mame/video/abc1600.cpp b/src/mame/video/abc1600.cpp index 8450c153fd7..60a46e6a4e1 100644 --- a/src/mame/video/abc1600.cpp +++ b/src/mame/video/abc1600.cpp @@ -125,7 +125,7 @@ const tiny_rom_entry *abc1600_mover_device::device_rom_region() const // mc6845 //------------------------------------------------- -inline UINT16 abc1600_mover_device::get_crtca(UINT16 ma, UINT8 ra, UINT8 column) +inline uint16_t abc1600_mover_device::get_crtca(uint16_t ma, uint8_t ra, uint8_t column) { /* @@ -150,8 +150,8 @@ inline UINT16 abc1600_mover_device::get_crtca(UINT16 ma, UINT8 ra, UINT8 column) */ - UINT8 cc = (ma & 0xff) + column; - UINT8 cr = ma >> 8; + uint8_t cc = (ma & 0xff) + column; + uint8_t cr = ma >> 8; return (cr << 10) | ((ra & 0x0f) << 6) | ((cc << 1) & 0x3c); } @@ -163,12 +163,12 @@ MC6845_UPDATE_ROW(abc1600_mover_device::crtc_update_row) for (int column = 0; column < x_count; column += 2) { - UINT16 dma = get_crtca(ma, ra, column); + uint16_t dma = get_crtca(ma, ra, column); // data is read out of video RAM in nibble mode by strobing CAS 4 times for (int cas = 0; cas < 4; cas++) { - UINT16 data = read_videoram(dma + cas); + uint16_t data = read_videoram(dma + cas); for (int bit = 0; bit < 16; bit++) { @@ -227,7 +227,7 @@ machine_config_constructor abc1600_mover_device::device_mconfig_additions() cons // abc1600_mover_device - constructor //------------------------------------------------- -abc1600_mover_device::abc1600_mover_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +abc1600_mover_device::abc1600_mover_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ABC1600_MOVER, "ABC 1600 Mover", tag, owner, clock, "abc1600mover", __FILE__), device_memory_interface(mconfig, *this), m_space_config("vram", ENDIANNESS_BIG, 16, 18, -1, *ADDRESS_MAP_NAME(mover_map)), @@ -301,7 +301,7 @@ const address_space_config *abc1600_mover_device::memory_space_config(address_sp // read_videoram - //------------------------------------------------- -inline UINT16 abc1600_mover_device::read_videoram(offs_t offset) +inline uint16_t abc1600_mover_device::read_videoram(offs_t offset) { return space().read_word((offset & VIDEORAM16_MASK) << 1); } @@ -311,9 +311,9 @@ inline UINT16 abc1600_mover_device::read_videoram(offs_t offset) // write_videoram - //------------------------------------------------- -inline void abc1600_mover_device::write_videoram(offs_t offset, UINT16 data, UINT16 mask) +inline void abc1600_mover_device::write_videoram(offs_t offset, uint16_t data, uint16_t mask) { - UINT16 old_data = read_videoram(offset); + uint16_t old_data = read_videoram(offset); space().write_word((offset & VIDEORAM16_MASK) << 1, (data & mask) | (old_data & (mask ^ 0xffff))); } @@ -326,7 +326,7 @@ inline void abc1600_mover_device::write_videoram(offs_t offset, UINT16 data, UIN READ8_MEMBER( abc1600_mover_device::video_ram_r ) { offs_t addr = (offset & VIDEORAM8_MASK) >> 1; - UINT8 data = 0; + uint8_t data = 0; if (offset & 0x01) { @@ -411,7 +411,7 @@ READ8_MEMBER( abc1600_mover_device::iord0_r ) */ - UINT8 data = 0; + uint8_t data = 0; // monitor orientation (portrait/landscape) data |= machine().render().first_target()->view() << 1; @@ -924,8 +924,8 @@ WRITE8_MEMBER( abc1600_mover_device::endisp_w ) inline void abc1600_mover_device::clock_mfa_x() { - UINT16 mfa_y = m_mfa >> 6; - UINT8 mfa_x = m_mfa & 0x3f; + uint16_t mfa_y = m_mfa >> 6; + uint8_t mfa_x = m_mfa & 0x3f; if (!HOLD_FX) { @@ -943,8 +943,8 @@ inline void abc1600_mover_device::clock_mfa_x() inline void abc1600_mover_device::clock_mfa_y() { - UINT16 mfa_y = m_mfa >> 6; - UINT8 mfa_x = m_mfa & 0x3f; + uint16_t mfa_y = m_mfa >> 6; + uint8_t mfa_x = m_mfa & 0x3f; if (!HOLD_FY) { @@ -962,8 +962,8 @@ inline void abc1600_mover_device::clock_mfa_y() inline void abc1600_mover_device::clock_mta_x() { - UINT16 mta_y = m_mta >> 6; - UINT8 mta_x = m_mta & 0x3f; + uint16_t mta_y = m_mta >> 6; + uint8_t mta_x = m_mta & 0x3f; mta_x += m_udx ? 1 : -1; mta_x &= 0x3f; @@ -978,8 +978,8 @@ inline void abc1600_mover_device::clock_mta_x() inline void abc1600_mover_device::clock_mta_y() { - UINT16 mta_y = m_mta >> 6; - UINT8 mta_x = m_mta & 0x3f; + uint16_t mta_y = m_mta >> 6; + uint8_t mta_x = m_mta & 0x3f; mta_y += m_udy ? 1 : -1; mta_y &= 0xfff; @@ -994,8 +994,8 @@ inline void abc1600_mover_device::clock_mta_y() inline void abc1600_mover_device::load_mfa_x() { - UINT16 mfa_y = m_mfa >> 6; - UINT8 mfa_x = m_xfrom >> 4; + uint16_t mfa_y = m_mfa >> 6; + uint8_t mfa_x = m_xfrom >> 4; m_mfa = (mfa_y << 6) | mfa_x; } @@ -1007,8 +1007,8 @@ inline void abc1600_mover_device::load_mfa_x() inline void abc1600_mover_device::load_mta_x() { - UINT16 mta_y = m_mta >> 6; - UINT8 mta_x = m_xto >> 4; + uint16_t mta_y = m_mta >> 6; + uint8_t mta_x = m_xto >> 4; m_mta = (mta_y << 6) | mta_x; } @@ -1022,7 +1022,7 @@ inline void abc1600_mover_device::load_xy_reg() { if (L_P) return; - UINT16 sum = m_xto + m_xsize; + uint16_t sum = m_xto + m_xsize; m_xto = sum & 0x3ff; m_yto = m_ty & 0xfff; @@ -1036,8 +1036,8 @@ inline void abc1600_mover_device::load_xy_reg() inline void abc1600_mover_device::compare_mta_x() { - UINT8 mta_x_end = ((m_xto + m_xsize) >> 4) & 0x3f; - UINT8 mta_x = m_mta & 0x3f; + uint8_t mta_x_end = ((m_xto + m_xsize) >> 4) & 0x3f; + uint8_t mta_x = m_mta & 0x3f; if (mta_x == mta_x_end) { @@ -1055,7 +1055,7 @@ inline void abc1600_mover_device::compare_mta_x() inline void abc1600_mover_device::compare_mta_y() { int mta_y_end = (m_yto + m_ysize) & 0xfff; - UINT16 mta_y = m_mta >> 6; + uint16_t mta_y = m_mta >> 6; if (mta_y == mta_y_end) { @@ -1086,8 +1086,8 @@ inline void abc1600_mover_device::get_shinf() */ - UINT16 shinf_addr = (m_udx << 8) | ((m_xto & 0x0f) << 4) | (m_xfrom & 0x0f); - UINT8 shinf = m_shinf_rom[shinf_addr]; + uint16_t shinf_addr = (m_udx << 8) | ((m_xto & 0x0f) << 4) | (m_xfrom & 0x0f); + uint8_t shinf = m_shinf_rom[shinf_addr]; m_sh = shinf & 0x0f; m_hold_1w_cyk = BIT(shinf, 5); @@ -1098,7 +1098,7 @@ inline void abc1600_mover_device::get_shinf() // get_drmsk - //------------------------------------------------- -inline UINT16 abc1600_mover_device::get_drmsk() +inline uint16_t abc1600_mover_device::get_drmsk() { /* @@ -1112,7 +1112,7 @@ inline UINT16 abc1600_mover_device::get_drmsk() */ - UINT16 drmsk_addr = (m_udx << 4) | (m_sh & 0x0f); + uint16_t drmsk_addr = (m_udx << 4) | (m_sh & 0x0f); return m_drmsk_rom[drmsk_addr]; } @@ -1121,7 +1121,7 @@ inline UINT16 abc1600_mover_device::get_drmsk() // get_wrmsk - get mover write mask //------------------------------------------------- -inline UINT16 abc1600_mover_device::get_wrmsk() +inline uint16_t abc1600_mover_device::get_wrmsk() { /* @@ -1142,7 +1142,7 @@ inline UINT16 abc1600_mover_device::get_wrmsk() */ - UINT16 wrmsk_addr = (m_wrms1 << 11) | (m_wrms0 << 10) | ((!m_wrms1 && !m_wrms0) << 9) | (m_udx << 8) | ((m_xsize & 0x0f) << 4) | (m_xto & 0x0f); + uint16_t wrmsk_addr = (m_wrms1 << 11) | (m_wrms0 << 10) | ((!m_wrms1 && !m_wrms0) << 9) | (m_udx << 8) | ((m_xsize & 0x0f) << 4) | (m_xto & 0x0f); return m_wrmsk_rom[wrmsk_addr] ^ 0xffff; } @@ -1151,9 +1151,9 @@ inline UINT16 abc1600_mover_device::get_wrmsk() // barrel_shift - //------------------------------------------------- -inline UINT16 abc1600_mover_device::barrel_shift(UINT16 gmdr) +inline uint16_t abc1600_mover_device::barrel_shift(uint16_t gmdr) { - UINT16 rot = gmdr; + uint16_t rot = gmdr; for (int sh = 0; sh < m_sh; sh++) { @@ -1170,10 +1170,10 @@ inline UINT16 abc1600_mover_device::barrel_shift(UINT16 gmdr) // word_mixer - //------------------------------------------------- -inline UINT16 abc1600_mover_device::word_mixer(UINT16 rot) +inline uint16_t abc1600_mover_device::word_mixer(uint16_t rot) { - UINT16 drmsk = get_drmsk(); - UINT16 gmdi = (rot & drmsk) | (m_mdor & (drmsk ^ 0xffff)); + uint16_t drmsk = get_drmsk(); + uint16_t gmdi = (rot & drmsk) | (m_mdor & (drmsk ^ 0xffff)); if (COMP_MOVE) { @@ -1211,8 +1211,8 @@ void abc1600_mover_device::mover() if (m_hold_1w_cyk) { // read one word in advance - UINT16 gmdr = read_videoram(m_mfa); - UINT16 rot = barrel_shift(gmdr); + uint16_t gmdr = read_videoram(m_mfa); + uint16_t rot = barrel_shift(gmdr); word_mixer(rot); clock_mfa_x(); @@ -1222,10 +1222,10 @@ void abc1600_mover_device::mover() { compare_mta_x(); - UINT16 gmdr = read_videoram(m_mfa); - UINT16 rot = barrel_shift(gmdr); - UINT16 gmdi = word_mixer(rot); - UINT16 mask = get_wrmsk(); + uint16_t gmdr = read_videoram(m_mfa); + uint16_t rot = barrel_shift(gmdr); + uint16_t gmdi = word_mixer(rot); + uint16_t mask = get_wrmsk(); write_videoram(m_mta, gmdi, mask); @@ -1246,7 +1246,7 @@ void abc1600_mover_device::mover() m_amm = 0; } -UINT32 abc1600_mover_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t abc1600_mover_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (m_endisp) { diff --git a/src/mame/video/abc1600.h b/src/mame/video/abc1600.h index 497ec12c890..128da856d93 100644 --- a/src/mame/video/abc1600.h +++ b/src/mame/video/abc1600.h @@ -39,7 +39,7 @@ class abc1600_mover_device : public device_t, { public: // construction/destruction - abc1600_mover_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + abc1600_mover_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; @@ -51,7 +51,7 @@ public: virtual DECLARE_ADDRESS_MAP(iowr1_map, 8); virtual DECLARE_ADDRESS_MAP(iowr2_map, 8); - UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); MC6845_UPDATE_ROW(crtc_update_row); MC6845_ON_UPDATE_ADDR_CHANGED(crtc_update); @@ -65,11 +65,11 @@ protected: virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override; private: - inline UINT16 get_drmsk(); + inline uint16_t get_drmsk(); inline void get_shinf(); - inline UINT16 get_wrmsk(); - inline UINT16 barrel_shift(UINT16 gmdr); - inline UINT16 word_mixer(UINT16 rot); + inline uint16_t get_wrmsk(); + inline uint16_t barrel_shift(uint16_t gmdr); + inline uint16_t word_mixer(uint16_t rot); inline void clock_mfa_x(); inline void clock_mfa_y(); inline void clock_mta_x(); @@ -105,37 +105,37 @@ private: DECLARE_WRITE8_MEMBER( flag_strobe_w ); DECLARE_WRITE8_MEMBER( endisp_w ); - inline UINT16 read_videoram(offs_t offset); - inline void write_videoram(offs_t offset, UINT16 data, UINT16 mask); - inline UINT16 get_crtca(UINT16 ma, UINT8 ra, UINT8 column); + inline uint16_t read_videoram(offs_t offset); + inline void write_videoram(offs_t offset, uint16_t data, uint16_t mask); + inline uint16_t get_crtca(uint16_t ma, uint8_t ra, uint8_t column); const address_space_config m_space_config; required_device m_crtc; required_device m_palette; - required_region_ptr m_wrmsk_rom; - required_region_ptr m_shinf_rom; - required_region_ptr m_drmsk_rom; + required_region_ptr m_wrmsk_rom; + required_region_ptr m_shinf_rom; + required_region_ptr m_drmsk_rom; int m_endisp; // enable display int m_clocks_disabled; // clocks disabled - UINT16 m_gmdi; // video RAM data latch - UINT16 m_wrm; // write mask latch - UINT8 m_ms[16]; // mover sequence control - UINT8 m_ds[16]; // display sequence control - UINT8 m_flag; // flags - UINT16 m_xsize; // X size - UINT16 m_ysize; // Y size + uint16_t m_gmdi; // video RAM data latch + uint16_t m_wrm; // write mask latch + uint8_t m_ms[16]; // mover sequence control + uint8_t m_ds[16]; // display sequence control + uint8_t m_flag; // flags + uint16_t m_xsize; // X size + uint16_t m_ysize; // Y size int m_udx; // up/down X int m_udy; // up/down Y - UINT16 m_xfrom; // X from - UINT16 m_xto; // X to - UINT16 m_yto; // Y to - UINT16 m_ty; // to Y - UINT32 m_mfa; // mover from address - UINT32 m_mta; // mover to address - UINT8 m_sh; // - UINT16 m_mdor; // + uint16_t m_xfrom; // X from + uint16_t m_xto; // X to + uint16_t m_yto; // Y to + uint16_t m_ty; // to Y + uint32_t m_mfa; // mover from address + uint32_t m_mta; // mover to address + uint8_t m_sh; // + uint16_t m_mdor; // int m_hold_1w_cyk; // int m_wrms0; // int m_wrms1; // diff --git a/src/mame/video/abc80.cpp b/src/mame/video/abc80.cpp index a267538093d..5808e89729a 100644 --- a/src/mame/video/abc80.cpp +++ b/src/mame/video/abc80.cpp @@ -49,8 +49,8 @@ void abc80_state::update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) for (int y = 0; y < 312; y++) { - UINT8 vsync_data = m_vsync_prom->base()[y]; - UINT8 l = m_line_prom->base()[y]; + uint8_t vsync_data = m_vsync_prom->base()[y]; + uint8_t l = m_line_prom->base()[y]; int dv = (vsync_data & ABC80_K2_DV) ? 1 : 0; if (!(vsync_data & ABC80_K2_FRAME_RESET)) @@ -61,9 +61,9 @@ void abc80_state::update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) for (int sx = 0; sx < 64; sx++) { - UINT8 hsync_data = m_hsync_prom->base()[sx]; + uint8_t hsync_data = m_hsync_prom->base()[sx]; int dh = (hsync_data & ABC80_K5_DH) ? 1 : 0; - UINT8 data = 0; + uint8_t data = 0; if (hsync_data & ABC80_K5_LINE_END) { @@ -88,10 +88,10 @@ void abc80_state::update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) int a = (c >> 3) & 0x07; int b = ((r >> 1) & 0x0c) | ((r >> 3) & 0x03); int s = (a + b) & 0x0f; - UINT16 videoram_addr = ((r & 0x07) << 7) | (s << 3) | (c & 0x07); - UINT8 videoram_data = m_latch; - UINT8 attr_addr = ((dh & dv) << 7) | (videoram_data & 0x7f); - UINT8 attr_data = m_attr_prom->base()[attr_addr]; + uint16_t videoram_addr = ((r & 0x07) << 7) | (s << 3) | (c & 0x07); + uint8_t videoram_data = m_latch; + uint8_t attr_addr = ((dh & dv) << 7) | (videoram_data & 0x7f); + uint8_t attr_data = m_attr_prom->base()[attr_addr]; int blank = (attr_data & ABC80_J3_BLANK) ? 1 : 0; int j = (attr_data & ABC80_J3_TEXT) ? 1 : 0; @@ -123,7 +123,7 @@ void abc80_state::update_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect) else { // text mode - UINT16 chargen_addr = ((videoram_data & 0x7f) * 10) + l; + uint16_t chargen_addr = ((videoram_data & 0x7f) * 10) + l; data = m_char_rom->base()[chargen_addr]; } @@ -182,7 +182,7 @@ void abc80_state::video_start() } -UINT32 abc80_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t abc80_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { update_screen(bitmap, cliprect); diff --git a/src/mame/video/abc800.cpp b/src/mame/video/abc800.cpp index 6be1813928b..9a0bfe681fe 100644 --- a/src/mame/video/abc800.cpp +++ b/src/mame/video/abc800.cpp @@ -72,7 +72,7 @@ void abc800c_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) { const pen_t *pen = m_palette->pens(); - UINT16 addr = 0; + uint16_t addr = 0; for (int y = m_hrs; y < std::min(cliprect.max_y + 1, m_hrs + 480); y += 2) { @@ -80,12 +80,12 @@ void abc800c_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) for (int sx = 0; sx < 64; sx++) { - UINT8 data = m_video_ram[addr++]; + uint8_t data = m_video_ram[addr++]; for (int dot = 0; dot < 4; dot++) { - UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03); - UINT8 fgctl = m_fgctl_prom->base()[fgctl_addr]; + uint16_t fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03); + uint8_t fgctl = m_fgctl_prom->base()[fgctl_addr]; int color = fgctl & 0x07; if (color) @@ -123,7 +123,7 @@ void abc800_state::video_start() // SCREEN_UPDATE( abc800c ) //------------------------------------------------- -UINT32 abc800c_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t abc800c_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // clear screen bitmap.fill(rgb_t::black, cliprect); @@ -200,7 +200,7 @@ MACHINE_CONFIG_END void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT16 addr = 0; + uint16_t addr = 0; const pen_t *pen = m_palette->pens(); @@ -210,11 +210,11 @@ void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) for (int sx = 0; sx < 64; sx++) { - UINT8 data = m_video_ram[addr++]; + uint8_t data = m_video_ram[addr++]; for (int dot = 0; dot < 4; dot++) { - UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03); + uint16_t fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03); int color = (m_fgctl_prom->base()[fgctl_addr] & 0x07) ? 1 : 0; bitmap.pix32(y, x++) = pen[color]; @@ -242,8 +242,8 @@ MC6845_UPDATE_ROW( abc800m_state::abc800m_update_row ) { int bit; - UINT16 address = (m_char_ram[(ma + column) & 0x7ff] << 4) | (ra & 0x0f); - UINT8 data = (m_char_rom->base()[address & 0x7ff] & 0x3f); + uint16_t address = (m_char_ram[(ma + column) & 0x7ff] << 4) | (ra & 0x0f); + uint8_t data = (m_char_rom->base()[address & 0x7ff] & 0x3f); if (column == cursor_x) { @@ -271,7 +271,7 @@ MC6845_UPDATE_ROW( abc800m_state::abc800m_update_row ) // SCREEN_UPDATE( abc800m ) //------------------------------------------------- -UINT32 abc800m_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t abc800m_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // clear screen bitmap.fill(rgb_t::black, cliprect); diff --git a/src/mame/video/abc802.cpp b/src/mame/video/abc802.cpp index 579a0240f5a..4c917ea6477 100644 --- a/src/mame/video/abc802.cpp +++ b/src/mame/video/abc802.cpp @@ -63,10 +63,10 @@ MC6845_UPDATE_ROW( abc802_state::abc802_update_row ) for (int column = 0; column < x_count; column++) { - UINT8 code = m_char_ram[(ma + column) & 0x7ff]; - UINT16 address = code << 4; - UINT8 ra_latch = ra; - UINT8 data; + uint8_t code = m_char_ram[(ma + column) & 0x7ff]; + uint16_t address = code << 4; + uint8_t ra_latch = ra; + uint8_t data; int ri = (code & ABC802_INV) ? 1 : 0; @@ -188,7 +188,7 @@ void abc802_state::video_start() // SCREEN_UPDATE( abc802 ) //------------------------------------------------- -UINT32 abc802_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t abc802_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // draw text m_crtc->screen_update(screen, bitmap, cliprect); diff --git a/src/mame/video/abc806.cpp b/src/mame/video/abc806.cpp index 7eceef51096..115f526f46e 100644 --- a/src/mame/video/abc806.cpp +++ b/src/mame/video/abc806.cpp @@ -117,8 +117,8 @@ READ8_MEMBER( abc806_state::cli_r ) */ - UINT16 hru2_addr = (m_hru2_a8 << 8) | (offset >> 8); - UINT8 data = m_hru2_prom->base()[hru2_addr] & 0x0f; + uint16_t hru2_addr = (m_hru2_a8 << 8) | (offset >> 8); + uint8_t data = m_hru2_prom->base()[hru2_addr] & 0x0f; logerror("HRU II %03x : %01x\n", hru2_addr, data); @@ -228,9 +228,9 @@ MC6845_UPDATE_ROW( abc806_state::abc806_update_row ) for (int column = 0; column < x_count; column++) { - UINT8 data = m_char_ram[(ma + column) & 0x7ff]; - UINT8 attr = m_attr_ram[(ma + column) & 0x7ff]; - UINT8 rad_data; + uint8_t data = m_char_ram[(ma + column) & 0x7ff]; + uint8_t attr = m_attr_ram[(ma + column) & 0x7ff]; + uint8_t rad_data; if ((attr & 0x07) == ((attr >> 3) & 0x07)) { @@ -288,12 +288,12 @@ MC6845_UPDATE_ROW( abc806_state::abc806_update_row ) } else { - UINT16 rad_addr = (e6 << 8) | (e5 << 7) | (flash << 6) | (underline << 4) | (m_flshclk << 5) | (ra & 0x0f); + uint16_t rad_addr = (e6 << 8) | (e5 << 7) | (flash << 6) | (underline << 4) | (m_flshclk << 5) | (ra & 0x0f); rad_data = m_rad_prom->base()[rad_addr] & 0x0f; } - UINT16 chargen_addr = (th << 12) | (data << 4) | rad_data; - UINT8 chargen_data = m_char_rom->base()[chargen_addr & 0xfff] << 2; + uint16_t chargen_addr = (th << 12) | (data << 4) | rad_data; + uint8_t chargen_data = m_char_rom->base()[chargen_addr & 0xfff] << 2; int x = hbp + (column + 4) * ABC800_CHAR_WIDTH; for (int bit = 0; bit < ABC800_CHAR_WIDTH; bit++) @@ -385,14 +385,14 @@ void abc806_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect) { const pen_t *pen = m_palette->pens(); - UINT32 addr = (m_hrs & 0x0f) << 15; + uint32_t addr = (m_hrs & 0x0f) << 15; for (int y = m_sync + VERTICAL_PORCH_HACK; y < std::min(cliprect.max_y + 1, m_sync + VERTICAL_PORCH_HACK + 240); y++) { for (int sx = 0; sx < 128; sx++) { - UINT8 data = m_video_ram[addr++]; - UINT16 dot = (m_hrc[data >> 4] << 8) | m_hrc[data & 0x0f]; + uint8_t data = m_video_ram[addr++]; + uint16_t dot = (m_hrc[data >> 4] << 8) | m_hrc[data & 0x0f]; for (int pixel = 0; pixel < 4; pixel++) { @@ -448,7 +448,7 @@ void abc806_state::video_start() // SCREEN_UPDATE( abc806 ) //------------------------------------------------- -UINT32 abc806_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t abc806_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // clear screen bitmap.fill(rgb_t::black, cliprect); diff --git a/src/mame/video/ac1.cpp b/src/mame/video/ac1.cpp index 8af6b695baa..09c3d515998 100644 --- a/src/mame/video/ac1.cpp +++ b/src/mame/video/ac1.cpp @@ -28,7 +28,7 @@ void ac1_state::video_start() { } -UINT32 ac1_state::screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ac1_state::screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; address_space &space = m_maincpu->space(AS_PROGRAM); @@ -44,7 +44,7 @@ UINT32 ac1_state::screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, return 0; } -UINT32 ac1_state::screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ac1_state::screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; address_space &space = m_maincpu->space(AS_PROGRAM); diff --git a/src/mame/video/actfancr.cpp b/src/mame/video/actfancr.cpp index 5f478fbd05f..dd8f4204e1b 100644 --- a/src/mame/video/actfancr.cpp +++ b/src/mame/video/actfancr.cpp @@ -11,7 +11,7 @@ /******************************************************************************/ -UINT32 actfancr_state::screen_update_actfancr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t actfancr_state::screen_update_actfancr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* Draw playfield */ flip_screen_set(m_tilegen2->get_flip_state()); diff --git a/src/mame/video/advision.cpp b/src/mame/video/advision.cpp index 086f61c6175..2cb6a3e2ba5 100644 --- a/src/mame/video/advision.cpp +++ b/src/mame/video/advision.cpp @@ -60,11 +60,11 @@ void advision_state::vh_write(int data) void advision_state::vh_update(int x) { - UINT8 *dst = &m_display[x]; + uint8_t *dst = &m_display[x]; for (int y = 0; y < 8; y++) { - UINT8 data = m_led_latch[7 - y]; + uint8_t data = m_led_latch[7 - y]; for (int i = 0; i < 8; i++) { @@ -84,7 +84,7 @@ void advision_state::vh_update(int x) ***************************************************************************/ -UINT32 advision_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t advision_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if ((m_frame_count++ % 4) == 0) { @@ -94,7 +94,7 @@ UINT32 advision_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap for (int x = 0; x < 150; x++) { - UINT8 *led = &m_display[x]; + uint8_t *led = &m_display[x]; for (int y = 0; y < 128; y+=2) { diff --git a/src/mame/video/aeroboto.cpp b/src/mame/video/aeroboto.cpp index 88b62582929..6718bf0a875 100644 --- a/src/mame/video/aeroboto.cpp +++ b/src/mame/video/aeroboto.cpp @@ -25,7 +25,7 @@ TILE_GET_INFO_MEMBER(aeroboto_state::get_tile_info) { - UINT8 code = m_videoram[tile_index]; + uint8_t code = m_videoram[tile_index]; SET_TILE_INFO_MEMBER(0, code + (m_charbank << 8), m_tilecolor[code], @@ -57,7 +57,7 @@ void aeroboto_state::video_start() { int i; - std::vector temp(m_stars_length); + std::vector temp(m_stars_length); memcpy(&temp[0], m_stars_rom, m_stars_length); for (i = 0; i < m_stars_length; i++) @@ -142,11 +142,11 @@ void aeroboto_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre } -UINT32 aeroboto_state::screen_update_aeroboto(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aeroboto_state::screen_update_aeroboto(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { const rectangle splitrect1(0, 255, 0, 39); const rectangle splitrect2(0, 255, 40, 255); - UINT8 *src_base, *src_colptr, *src_rowptr; + uint8_t *src_base, *src_colptr, *src_rowptr; int src_offsx, src_colmask, sky_color, star_color, x, y, i, j, pen; sky_color = star_color = *m_bgcolor << 2; diff --git a/src/mame/video/aerofgt.cpp b/src/mame/video/aerofgt.cpp index 7353c2d4f11..2495eb13481 100644 --- a/src/mame/video/aerofgt.cpp +++ b/src/mame/video/aerofgt.cpp @@ -11,7 +11,7 @@ TILE_GET_INFO_MEMBER(aerofgt_state::get_pspikes_tile_info) { - UINT16 code = m_bg1videoram[tile_index]; + uint16_t code = m_bg1videoram[tile_index]; int bank = (code & 0x1000) >> 12; SET_TILE_INFO_MEMBER(0, (code & 0x0fff) + (m_gfxbank[bank] << 12), @@ -21,7 +21,7 @@ TILE_GET_INFO_MEMBER(aerofgt_state::get_pspikes_tile_info) TILE_GET_INFO_MEMBER(aerofgt_state::karatblz_bg1_tile_info) { - UINT16 code = m_bg1videoram[tile_index]; + uint16_t code = m_bg1videoram[tile_index]; SET_TILE_INFO_MEMBER(0, (code & 0x1fff) + (m_gfxbank[0] << 13), (code & 0xe000) >> 13, @@ -31,7 +31,7 @@ TILE_GET_INFO_MEMBER(aerofgt_state::karatblz_bg1_tile_info) /* also spinlbrk */ TILE_GET_INFO_MEMBER(aerofgt_state::karatblz_bg2_tile_info) { - UINT16 code = m_bg2videoram[tile_index]; + uint16_t code = m_bg2videoram[tile_index]; SET_TILE_INFO_MEMBER(1, (code & 0x1fff) + (m_gfxbank[1] << 13), (code & 0xe000) >> 13, @@ -40,7 +40,7 @@ TILE_GET_INFO_MEMBER(aerofgt_state::karatblz_bg2_tile_info) TILE_GET_INFO_MEMBER(aerofgt_state::spinlbrk_bg1_tile_info) { - UINT16 code = m_bg1videoram[tile_index]; + uint16_t code = m_bg1videoram[tile_index]; SET_TILE_INFO_MEMBER(0, (code & 0x0fff) + (m_gfxbank[0] << 12), (code & 0xf000) >> 12, @@ -49,7 +49,7 @@ TILE_GET_INFO_MEMBER(aerofgt_state::spinlbrk_bg1_tile_info) TILE_GET_INFO_MEMBER(aerofgt_state::get_bg1_tile_info) { - UINT16 code = m_bg1videoram[tile_index]; + uint16_t code = m_bg1videoram[tile_index]; int bank = (code & 0x1800) >> 11; SET_TILE_INFO_MEMBER(0, (code & 0x07ff) + (m_gfxbank[bank] << 11), @@ -59,7 +59,7 @@ TILE_GET_INFO_MEMBER(aerofgt_state::get_bg1_tile_info) TILE_GET_INFO_MEMBER(aerofgt_state::get_bg2_tile_info) { - UINT16 code = m_bg2videoram[tile_index]; + uint16_t code = m_bg2videoram[tile_index]; int bank = 4 + ((code & 0x1800) >> 11); SET_TILE_INFO_MEMBER(1, (code & 0x07ff) + (m_gfxbank[bank] << 11), @@ -125,7 +125,7 @@ VIDEO_START_MEMBER(aerofgt_state,spinlbrk) /* sprite maps are hardcoded in this game */ /* enemy sprites use ROM instead of RAM */ - m_spriteram2.set_target(reinterpret_cast(memregion("gfx5")->base()), 0x20000); + m_spriteram2.set_target(reinterpret_cast(memregion("gfx5")->base()), 0x20000); aerofgt_register_state_globals(); } @@ -145,7 +145,7 @@ VIDEO_START_MEMBER(aerofgt_state,turbofrc) /* new hw type */ -UINT32 aerofgt_state::aerofgt_tile_callback( UINT32 code ) +uint32_t aerofgt_state::aerofgt_tile_callback( uint32_t code ) { return m_spriteram1[code&0x7fff]; } @@ -154,12 +154,12 @@ UINT32 aerofgt_state::aerofgt_tile_callback( UINT32 code ) /* old hw type */ -UINT32 aerofgt_state::aerofgt_old_tile_callback( UINT32 code ) +uint32_t aerofgt_state::aerofgt_old_tile_callback( uint32_t code ) { return m_spriteram1[code % (m_spriteram1.bytes()/2)]; } -UINT32 aerofgt_state::aerofgt_ol2_tile_callback( UINT32 code ) +uint32_t aerofgt_state::aerofgt_ol2_tile_callback( uint32_t code ) { return m_spriteram2[code % (m_spriteram2.bytes()/2)]; } @@ -285,7 +285,7 @@ WRITE16_MEMBER(aerofgt_state::pspikes_palette_bank_w) ***************************************************************************/ -UINT32 aerofgt_state::screen_update_pspikes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_pspikes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, scrolly; @@ -304,7 +304,7 @@ UINT32 aerofgt_state::screen_update_pspikes(screen_device &screen, bitmap_ind16 } -UINT32 aerofgt_state::screen_update_karatblz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_karatblz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg1_tilemap->set_scrollx(0, m_bg1scrollx - 8); m_bg1_tilemap->set_scrolly(0, m_bg1scrolly); @@ -325,7 +325,7 @@ UINT32 aerofgt_state::screen_update_karatblz(screen_device &screen, bitmap_ind16 return 0; } -UINT32 aerofgt_state::screen_update_spinlbrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_spinlbrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, scrolly; @@ -351,7 +351,7 @@ UINT32 aerofgt_state::screen_update_spinlbrk(screen_device &screen, bitmap_ind16 return 0; } -UINT32 aerofgt_state::screen_update_turbofrc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_turbofrc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, scrolly; @@ -378,7 +378,7 @@ UINT32 aerofgt_state::screen_update_turbofrc(screen_device &screen, bitmap_ind16 return 0; } -UINT32 aerofgt_state::screen_update_aerofgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_aerofgt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg1_tilemap->set_scrollx(0, m_rasterram[0x0000] - 18); m_bg1_tilemap->set_scrolly(0, m_bg1scrolly); @@ -566,7 +566,7 @@ void aerofgt_state::pspikesb_draw_sprites( screen_device &screen, bitmap_ind16 & void aerofgt_state::spikes91_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) { int i; - UINT8 *lookup; + uint8_t *lookup; lookup = memregion("user1")->base(); m_spritepalettebank = 1; @@ -707,7 +707,7 @@ void aerofgt_state::wbbc97_draw_bitmap( bitmap_rgb32 &bitmap ) } // BOOTLEG -UINT32 aerofgt_state::screen_update_pspikesb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_pspikesb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, scrolly; @@ -723,7 +723,7 @@ UINT32 aerofgt_state::screen_update_pspikesb(screen_device &screen, bitmap_ind16 } // BOOTLEG -UINT32 aerofgt_state::screen_update_spikes91(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_spikes91(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, scrolly; int y, x; @@ -746,8 +746,8 @@ UINT32 aerofgt_state::screen_update_spikes91(screen_device &screen, bitmap_ind16 { for (x = 0; x < 64; x++) { - UINT16 tileno = m_tx_tilemap_ram[count] & 0x1fff; - UINT16 colour = m_tx_tilemap_ram[count] & 0xe000; + uint16_t tileno = m_tx_tilemap_ram[count] & 0x1fff; + uint16_t colour = m_tx_tilemap_ram[count] & 0xe000; gfx->transpen(bitmap,cliprect, tileno, colour>>13, @@ -764,7 +764,7 @@ UINT32 aerofgt_state::screen_update_spikes91(screen_device &screen, bitmap_ind16 } // BOOTLEG -UINT32 aerofgt_state::screen_update_aerfboot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_aerfboot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, scrolly; @@ -787,7 +787,7 @@ UINT32 aerofgt_state::screen_update_aerfboot(screen_device &screen, bitmap_ind16 } // BOOTLEG -UINT32 aerofgt_state::screen_update_aerfboo2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_aerfboo2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int i, scrolly; @@ -814,7 +814,7 @@ UINT32 aerofgt_state::screen_update_aerfboo2(screen_device &screen, bitmap_ind16 } // BOOTLEG (still uses original sprite type) -UINT32 aerofgt_state::screen_update_wbbc97(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t aerofgt_state::screen_update_wbbc97(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int i, scrolly; diff --git a/src/mame/video/airbustr.cpp b/src/mame/video/airbustr.cpp index e330cd90f4d..233695e39d7 100644 --- a/src/mame/video/airbustr.cpp +++ b/src/mame/video/airbustr.cpp @@ -125,7 +125,7 @@ void airbustr_state::video_start() } -UINT32 airbustr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t airbustr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/video/airraid_dev.cpp b/src/mame/video/airraid_dev.cpp index b9bcf61f875..7308785da62 100644 --- a/src/mame/video/airraid_dev.cpp +++ b/src/mame/video/airraid_dev.cpp @@ -11,7 +11,7 @@ extern const device_type AIRRAID_VIDEO = &device_creator; -airraid_video_device::airraid_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +airraid_video_device::airraid_video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AIRRAID_VIDEO, "Seibu Air Raid Video", tag, owner, clock, "airraid_vid", __FILE__), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "^palette"), @@ -160,10 +160,10 @@ void airraid_video_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &c if (m_sprite_ram[i+1]&0x80) continue; - UINT16 tile = (m_sprite_ram[i]); + uint16_t tile = (m_sprite_ram[i]); tile |= (m_sprite_ram[i + 1] & 0x70) << 4; - UINT16 col = (m_sprite_ram[i+1] & 0x0f); + uint16_t col = (m_sprite_ram[i+1] & 0x0f); //col |= (m_sprite_ram[i+1] & 0x80)<<3; m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, tile,col, 0, 0, m_sprite_ram[i+3],m_sprite_ram[i+2],0); @@ -177,16 +177,16 @@ void airraid_video_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &c #define DISPLAY_TXT 8 #define DM_GETSCROLL(n) (((m_vregs[(n)]<<1)&0xff) + ((m_vregs[(n)]&0x80)?1:0) +( ((m_vregs[(n)-1]<<4) | (m_vregs[(n)-1]<<12) )&0xff00)) -void airraid_video_device::mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8* clut, int base) +void airraid_video_device::mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* clut, int base) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - UINT16 *dest = &bitmap.pix16(y); - UINT16 *src = &m_temp_bitmap.pix16(y); + uint16_t *dest = &bitmap.pix16(y); + uint16_t *src = &m_temp_bitmap.pix16(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - UINT8 pix = src[x] & 0xff; - UINT8 real = clut[pix]; + uint8_t pix = src[x] & 0xff; + uint8_t real = clut[pix]; if (!(real & 0x40)) { @@ -197,9 +197,9 @@ void airraid_video_device::mix_layer(screen_device &screen, bitmap_ind16 &bitmap } -UINT32 airraid_video_device::screen_update_airraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t airraid_video_device::screen_update_airraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 bgscrolly = DM_GETSCROLL(0x6); + uint16_t bgscrolly = DM_GETSCROLL(0x6); // this is more likely to be 'bank' than scroll, like NMK16 bgscrolly += ((m_hw & 0xc0) >> 6) * 256; @@ -258,7 +258,7 @@ WRITE8_MEMBER(airraid_video_device::vregs_w) printf("vregs_w %02x: %02x\n", offset, data); } -void airraid_video_device::layer_enable_w(UINT8 enable) +void airraid_video_device::layer_enable_w(uint8_t enable) { m_hw = enable; } diff --git a/src/mame/video/airraid_dev.h b/src/mame/video/airraid_dev.h index 5034d7e4d6e..be7fa1ffa53 100644 --- a/src/mame/video/airraid_dev.h +++ b/src/mame/video/airraid_dev.h @@ -19,13 +19,13 @@ class airraid_video_device : public device_t { public: // construction/destruction - airraid_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + airraid_video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER(txram_w); DECLARE_WRITE8_MEMBER(vregs_w); - void layer_enable_w(UINT8 enable); + void layer_enable_w(uint8_t enable); - UINT32 screen_update_airraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_airraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: virtual machine_config_constructor device_mconfig_additions() const override; @@ -39,17 +39,17 @@ private: required_device m_screen; // region pointers - required_region_ptr m_tx_clut; - required_region_ptr m_fg_clut; - required_region_ptr m_bg_clut; - required_region_ptr m_spr_clut; - required_region_ptr m_fgmap; - required_region_ptr m_bgmap; + required_region_ptr m_tx_clut; + required_region_ptr m_fg_clut; + required_region_ptr m_bg_clut; + required_region_ptr m_spr_clut; + required_region_ptr m_fgmap; + required_region_ptr m_bgmap; // memory pointers - required_shared_ptr m_sprite_ram; - required_shared_ptr m_txram; - required_shared_ptr m_vregs; + required_shared_ptr m_sprite_ram; + required_shared_ptr m_txram; + required_shared_ptr m_vregs; // tilemaps tilemap_t *m_bg_tilemap; @@ -64,12 +64,12 @@ private: TILE_GET_INFO_MEMBER(get_cstx_tile_info); // internal variables - UINT16 m_hw; + uint16_t m_hw; // rendering / mixing bitmap_ind16 m_temp_bitmap; void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8* clut, int base); + void mix_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t* clut, int base); }; #endif diff --git a/src/mame/video/ajax.cpp b/src/mame/video/ajax.cpp index 6185728851d..e0eae9fbe3a 100644 --- a/src/mame/video/ajax.cpp +++ b/src/mame/video/ajax.cpp @@ -72,7 +72,7 @@ K051316_CB_MEMBER(ajax_state::zoom_callback) ***************************************************************************/ -UINT32 ajax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ajax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_k052109->tilemap_update(); diff --git a/src/mame/video/alesis.cpp b/src/mame/video/alesis.cpp index cccd8a30f1b..20bdc480b4a 100644 --- a/src/mame/video/alesis.cpp +++ b/src/mame/video/alesis.cpp @@ -10,7 +10,7 @@ #include "includes/alesis.h" -void alesis_state::update_lcd_symbols(bitmap_ind16 &bitmap, UINT8 pos, UINT8 y, UINT8 x, int state) +void alesis_state::update_lcd_symbols(bitmap_ind16 &bitmap, uint8_t pos, uint8_t y, uint8_t x, int state) { if (pos == 6) { diff --git a/src/mame/video/aliens.cpp b/src/mame/video/aliens.cpp index 39489d27faa..1b931864cf2 100644 --- a/src/mame/video/aliens.cpp +++ b/src/mame/video/aliens.cpp @@ -51,7 +51,7 @@ K051960_CB_MEMBER(aliens_state::sprite_callback) ***************************************************************************/ -UINT32 aliens_state::screen_update_aliens(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t aliens_state::screen_update_aliens(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_k052109->tilemap_update(); diff --git a/src/mame/video/alpha68k.cpp b/src/mame/video/alpha68k.cpp index 6d0d7768c5e..5d5c5f6ee55 100644 --- a/src/mame/video/alpha68k.cpp +++ b/src/mame/video/alpha68k.cpp @@ -51,7 +51,7 @@ VIDEO_START_MEMBER(alpha68k_state,alpha68k) //AT void alpha68k_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int j, int s, int e ) { - UINT16 *spriteram = m_spriteram; + uint16_t *spriteram = m_spriteram; int offs, mx, my, color, tile, fx, fy, i; for (offs = s; offs < e; offs += 0x40) @@ -101,7 +101,7 @@ void alpha68k_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre /******************************************************************************/ -UINT32 alpha68k_state::screen_update_alpha68k_II(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t alpha68k_state::screen_update_alpha68k_II(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_last_bank != m_bank_base) machine().tilemap().mark_all_dirty(); @@ -193,7 +193,7 @@ WRITE16_MEMBER(alpha68k_state::alpha68k_V_video_control_w) void alpha68k_state::draw_sprites_V( bitmap_ind16 &bitmap, const rectangle &cliprect, int j, int s, int e, int fx_mask, int fy_mask, int sprite_mask ) { - UINT16 *spriteram = m_spriteram; + uint16_t *spriteram = m_spriteram; int offs, mx, my, color, tile, fx, fy, i; for (offs = s; offs < e; offs += 0x40) @@ -244,9 +244,9 @@ void alpha68k_state::draw_sprites_V( bitmap_ind16 &bitmap, const rectangle &clip } } -UINT32 alpha68k_state::screen_update_alpha68k_V(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t alpha68k_state::screen_update_alpha68k_V(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - UINT16 *spriteram = m_spriteram; + uint16_t *spriteram = m_spriteram; if (m_last_bank != m_bank_base) machine().tilemap().mark_all_dirty(); @@ -284,7 +284,7 @@ UINT32 alpha68k_state::screen_update_alpha68k_V(screen_device &screen, bitmap_in return 0; } -UINT32 alpha68k_state::screen_update_alpha68k_V_sb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t alpha68k_state::screen_update_alpha68k_V_sb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { if (m_last_bank != m_bank_base) machine().tilemap().mark_all_dirty(); @@ -308,9 +308,9 @@ UINT32 alpha68k_state::screen_update_alpha68k_V_sb(screen_device &screen, bitmap //AT void alpha68k_state::draw_sprites_I( bitmap_ind16 &bitmap, const rectangle &cliprect, int c, int d, int yshift ) { - UINT16 *spriteram = m_spriteram; + uint16_t *spriteram = m_spriteram; int data, offs, mx, my, tile, color, fy, i; - UINT8 *color_prom = memregion("user1")->base(); + uint8_t *color_prom = memregion("user1")->base(); gfx_element *gfx = m_gfxdecode->gfx(0); for (offs = 0; offs < 0x400; offs += 0x20) @@ -333,7 +333,7 @@ void alpha68k_state::draw_sprites_I( bitmap_ind16 &bitmap, const rectangle &clip } } -UINT32 alpha68k_state::screen_update_alpha68k_I(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t alpha68k_state::screen_update_alpha68k_I(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int yshift = (m_microcontroller_id == 0x890a) ? 1 : 0; // The Next Space is 1 pixel off @@ -350,7 +350,7 @@ UINT32 alpha68k_state::screen_update_alpha68k_I(screen_device &screen, bitmap_in PALETTE_INIT_MEMBER(alpha68k_state,kyros) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; /* create a lookup table for the palette */ @@ -368,14 +368,14 @@ PALETTE_INIT_MEMBER(alpha68k_state,kyros) for (i = 0; i < 0x100; i++) { - UINT8 ctabentry = ((color_prom[i] & 0x0f) << 4) | (color_prom[i + 0x100] & 0x0f); + uint8_t ctabentry = ((color_prom[i] & 0x0f) << 4) | (color_prom[i + 0x100] & 0x0f); palette.set_pen_indirect(i, ctabentry); } } PALETTE_INIT_MEMBER(alpha68k_state,paddlem) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; /* create a lookup table for the palette */ @@ -393,7 +393,7 @@ PALETTE_INIT_MEMBER(alpha68k_state,paddlem) for (i = 0; i < 0x400; i++) { - UINT8 ctabentry = ((color_prom[i + 0x400] & 0x0f) << 4) | (color_prom[i] & 0x0f); + uint8_t ctabentry = ((color_prom[i + 0x400] & 0x0f) << 4) | (color_prom[i] & 0x0f); palette.set_pen_indirect(i, ctabentry); } } @@ -410,10 +410,10 @@ void alpha68k_state::jongbou_video_banking(int *bank, int data) void alpha68k_state::kyros_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int c, int d ) { - UINT16 *spriteram = m_spriteram; + uint16_t *spriteram = m_spriteram; int offs, mx, my, color, tile, i, bank, fy, fx; int data; - UINT8 *color_prom = memregion("user1")->base(); + uint8_t *color_prom = memregion("user1")->base(); //AT for (offs = 0; offs < 0x400; offs += 0x20) @@ -460,7 +460,7 @@ void alpha68k_state::kyros_draw_sprites( bitmap_ind16 &bitmap, const rectangle & } } -UINT32 alpha68k_state::screen_update_kyros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t alpha68k_state::screen_update_kyros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_palette->set_pen_indirect(0x100, *m_videoram & 0xff); bitmap.fill(0x100, cliprect); //AT @@ -476,7 +476,7 @@ UINT32 alpha68k_state::screen_update_kyros(screen_device &screen, bitmap_ind16 & void alpha68k_state::sstingry_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int c, int d ) { //AT - UINT16 *spriteram = m_spriteram; + uint16_t *spriteram = m_spriteram; int data, offs, mx, my, color, tile, i, bank, fy, fx; for (offs = 0; offs < 0x400; offs += 0x20) @@ -518,7 +518,7 @@ void alpha68k_state::sstingry_draw_sprites( bitmap_ind16 &bitmap, const rectangl } } -UINT32 alpha68k_state::screen_update_sstingry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t alpha68k_state::screen_update_sstingry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_palette->set_pen_indirect(0x100, *m_videoram & 0xff); bitmap.fill(0x100, cliprect); //AT diff --git a/src/mame/video/ambush.cpp b/src/mame/video/ambush.cpp index 85ab981d86b..15e50cd27cd 100644 --- a/src/mame/video/ambush.cpp +++ b/src/mame/video/ambush.cpp @@ -22,7 +22,7 @@ PALETTE_INIT_MEMBER(ambush_state, ambush) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; for (i = 0; i < palette.entries(); i++) @@ -59,7 +59,7 @@ void ambush_state::draw_chars( bitmap_ind16 &bitmap, const rectangle &cliprect, for (offs = 0; offs < m_videoram.bytes(); offs++) { int code, sx, sy, col; - UINT8 scroll; + uint8_t scroll; sy = (offs / 32); sx = (offs % 32); @@ -89,7 +89,7 @@ void ambush_state::draw_chars( bitmap_ind16 &bitmap, const rectangle &cliprect, } -UINT32 ambush_state::screen_update_ambush(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ambush_state::screen_update_ambush(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int offs; diff --git a/src/mame/video/amiga.cpp b/src/mame/video/amiga.cpp index c12716afe7c..153915e9a58 100644 --- a/src/mame/video/amiga.cpp +++ b/src/mame/video/amiga.cpp @@ -30,7 +30,7 @@ *************************************/ /* expand an 8-bit bit pattern into 16 bits, every other bit */ -const UINT16 amiga_expand_byte[256] = +const uint16_t amiga_expand_byte[256] = { 0x0000, 0x0001, 0x0004, 0x0005, 0x0010, 0x0011, 0x0014, 0x0015, 0x0040, 0x0041, 0x0044, 0x0045, 0x0050, 0x0051, 0x0054, 0x0055, @@ -67,7 +67,7 @@ const UINT16 amiga_expand_byte[256] = 0x5540, 0x5541, 0x5544, 0x5545, 0x5550, 0x5551, 0x5554, 0x5555 }; -const UINT16 delay[256] = +const uint16_t delay[256] = { 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* 0x000 - 0x03e */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x040 - 0x05e */ @@ -146,11 +146,11 @@ VIDEO_START_MEMBER( amiga_state, amiga ) * *************************************/ -UINT32 amiga_state::amiga_gethvpos() +uint32_t amiga_state::amiga_gethvpos() { amiga_state *state = this; - UINT32 hvpos = (m_last_scanline << 8) | (m_screen->hpos() >> 2); - UINT32 latchedpos = m_hvpos.read_safe(0); + uint32_t hvpos = (m_last_scanline << 8) | (m_screen->hpos() >> 2); + uint32_t latchedpos = m_hvpos.read_safe(0); /* if there's no latched position, or if we are in the active display area */ /* but before the latching point, return the live HV position */ @@ -169,7 +169,7 @@ UINT32 amiga_state::amiga_gethvpos() * *************************************/ -void amiga_set_genlock_color(running_machine &machine, UINT16 color) +void amiga_set_genlock_color(running_machine &machine, uint16_t color) { amiga_state *state = machine.driver_data(); @@ -184,7 +184,7 @@ void amiga_set_genlock_color(running_machine &machine, UINT16 color) * *************************************/ -void amiga_copper_setpc(running_machine &machine, UINT32 pc) +void amiga_copper_setpc(running_machine &machine, uint32_t pc) { amiga_state *state = machine.driver_data(); @@ -199,7 +199,7 @@ void amiga_copper_setpc(running_machine &machine, UINT32 pc) int amiga_copper_execute_next(running_machine &machine, int xpos) { amiga_state *state = machine.driver_data(); - UINT8 ypos = state->m_last_scanline & 0xff; + uint8_t ypos = state->m_last_scanline & 0xff; int word0, word1; /* bail if not enabled */ @@ -457,7 +457,7 @@ static void update_sprite_dma(amiga_state *state, int scanline) * *************************************/ -static inline UINT32 interleave_sprite_data(UINT16 lobits, UINT16 hibits) +static inline uint32_t interleave_sprite_data(uint16_t lobits, uint16_t hibits) { return (amiga_expand_byte[lobits & 0xff] << 0) | (amiga_expand_byte[lobits >> 8] << 16) | (amiga_expand_byte[hibits & 0xff] << 1) | (amiga_expand_byte[hibits >> 8] << 17); @@ -496,12 +496,12 @@ static int get_sprite_pixel(amiga_state *state, int x) /* if we have pixels, determine the actual color and get out */ if (pixels) { - static const UINT16 ormask[16] = + static const uint16_t ormask[16] = { 0x0000, 0x000c, 0x00c0, 0x00cc, 0x0c00, 0x0c0c, 0x0cc0, 0x0ccc, 0xc000, 0xc00c, 0xc0c0, 0xc0cc, 0xcc00, 0xcc0c, 0xccc0, 0xcccc }; - static const UINT16 spritecollide[16] = + static const uint16_t spritecollide[16] = { 0x0000, 0x0000, 0x0000, 0x0200, 0x0000, 0x0400, 0x1000, 0x1600, 0x0000, 0x0800, 0x2000, 0x2a00, 0x4000, 0x4c00, 0x7000, 0x7e00 @@ -530,7 +530,7 @@ static int get_sprite_pixel(amiga_state *state, int x) sprite present bitmask in bits 6-9 topmost sprite pair index in bits 10-11 */ - UINT32 result = (collide << 6) | (pair << 10); + uint32_t result = (collide << 6) | (pair << 10); /* attached case */ if (CUSTOM_REG(REG_SPR1CTL + 8 * pair) & 0x0080) @@ -557,9 +557,9 @@ static int get_sprite_pixel(amiga_state *state, int x) * *************************************/ -static inline UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs) +static inline uint8_t assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs) { - UINT8 pix = (CUSTOM_REG(REG_BPL1DAT) >> obitoffs) & 1; + uint8_t pix = (CUSTOM_REG(REG_BPL1DAT) >> obitoffs) & 1; if (planes >= 3) { pix |= ((CUSTOM_REG(REG_BPL3DAT) >> obitoffs) & 1) << 2; @@ -570,9 +570,9 @@ static inline UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int o } -static inline UINT8 assemble_even_bitplanes(amiga_state *state, int planes, int ebitoffs) +static inline uint8_t assemble_even_bitplanes(amiga_state *state, int planes, int ebitoffs) { - UINT8 pix = 0; + uint8_t pix = 0; if (planes >= 2) { pix |= ((CUSTOM_REG(REG_BPL2DAT) >> ebitoffs) & 1) << 1; @@ -668,13 +668,13 @@ void amiga_state::update_display_window() void amiga_state::render_scanline(bitmap_ind16 &bitmap, int scanline) { amiga_state *state = this; - UINT16 save_color0 = CUSTOM_REG(REG_COLOR00); + uint16_t save_color0 = CUSTOM_REG(REG_COLOR00); int ddf_start_pixel = 0, ddf_stop_pixel = 0; int hires = 0, dualpf = 0, ham = 0; int pf1pri = 0, pf2pri = 0; int planes = 0; - UINT16 *dst = nullptr; + uint16_t *dst = nullptr; int ebitoffs = 0, obitoffs = 0; int ecolmask = 0, ocolmask = 0; int edelay = 0, odelay = 0; @@ -1049,7 +1049,7 @@ void amiga_state::render_scanline(bitmap_ind16 &bitmap, int scanline) *************************************/ /* TODO: alg.c requires that this uses RGB32 */ -UINT32 amiga_state::screen_update_amiga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t amiga_state::screen_update_amiga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // sometimes the core tells us to render a bunch of lines to keep up (resolution change, for example) // this causes trouble for us since it can happen at any time diff --git a/src/mame/video/amigaaga.cpp b/src/mame/video/amigaaga.cpp index 88dac2caf91..cff74a74625 100644 --- a/src/mame/video/amigaaga.cpp +++ b/src/mame/video/amigaaga.cpp @@ -36,7 +36,7 @@ To do: * *************************************/ -void amiga_aga_palette_write(running_machine &machine, int color_reg, UINT16 data) +void amiga_aga_palette_write(running_machine &machine, int color_reg, uint16_t data) { amiga_state *state = machine.driver_data(); rgb_t *aga_palette = state->m_aga_palette; @@ -217,7 +217,7 @@ static void update_sprite_dma(amiga_state *state, int scanline) * *************************************/ -static inline UINT32 interleave_sprite_data(UINT16 lobits, UINT16 hibits) +static inline uint32_t interleave_sprite_data(uint16_t lobits, uint16_t hibits) { return (amiga_expand_byte[lobits & 0xff] << 0) | (amiga_expand_byte[lobits >> 8] << 16) | (amiga_expand_byte[hibits & 0xff] << 1) | (amiga_expand_byte[hibits >> 8] << 17); @@ -268,12 +268,12 @@ static int get_sprite_pixel(amiga_state *state, int x) /* if we have pixels, determine the actual color and get out */ if (pixels) { - static const UINT16 ormask[16] = + static const uint16_t ormask[16] = { 0x0000, 0x000c, 0x00c0, 0x00cc, 0x0c00, 0x0c0c, 0x0cc0, 0x0ccc, 0xc000, 0xc00c, 0xc0c0, 0xc0cc, 0xcc00, 0xcc0c, 0xccc0, 0xcccc }; - static const UINT16 spritecollide[16] = + static const uint16_t spritecollide[16] = { 0x0000, 0x0000, 0x0000, 0x0200, 0x0000, 0x0400, 0x1000, 0x1600, 0x0000, 0x0800, 0x2000, 0x2a00, 0x4000, 0x4c00, 0x7000, 0x7e00 @@ -305,7 +305,7 @@ static int get_sprite_pixel(amiga_state *state, int x) sprite present bitmask in bits 8-9 topmost sprite pair index in bits 12-13 */ - UINT32 result = (collide << 8) | (pair << 12); + uint32_t result = (collide << 8) | (pair << 12); /* attached case */ if (CUSTOM_REG(REG_SPR1CTL + 8 * pair) & 0x0080) @@ -332,10 +332,10 @@ static int get_sprite_pixel(amiga_state *state, int x) * *************************************/ -static inline UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs) +static inline uint8_t assemble_odd_bitplanes(amiga_state *state, int planes, int obitoffs) { - UINT64 *aga_bpldat = state->m_aga_bpldat; - UINT8 pix = (aga_bpldat[0] >> obitoffs) & 1; + uint64_t *aga_bpldat = state->m_aga_bpldat; + uint8_t pix = (aga_bpldat[0] >> obitoffs) & 1; if (planes >= 3) { pix |= ((aga_bpldat[2] >> obitoffs) & 1) << 2; @@ -350,12 +350,12 @@ static inline UINT8 assemble_odd_bitplanes(amiga_state *state, int planes, int o } -static inline UINT8 assemble_even_bitplanes(amiga_state *state, int planes, int ebitoffs) +static inline uint8_t assemble_even_bitplanes(amiga_state *state, int planes, int ebitoffs) { - UINT8 pix = 0; + uint8_t pix = 0; if (planes >= 2) { - UINT64 *aga_bpldat = state->m_aga_bpldat; + uint64_t *aga_bpldat = state->m_aga_bpldat; pix |= ((aga_bpldat[1] >> ebitoffs) & 1) << 1; if (planes >= 4) { @@ -373,29 +373,29 @@ static inline UINT8 assemble_even_bitplanes(amiga_state *state, int planes, int static inline void fetch_bitplane_data(amiga_state *state, int plane) { - UINT64 *aga_bpldat = state->m_aga_bpldat; + uint64_t *aga_bpldat = state->m_aga_bpldat; switch (CUSTOM_REG(REG_FMODE) & 0x03) { case 0: - aga_bpldat[plane] = (UINT64)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2)); + aga_bpldat[plane] = (uint64_t)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2)); CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2) += 2; break; case 1: case 2: - aga_bpldat[plane] = (UINT64)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2)) << 16; + aga_bpldat[plane] = (uint64_t)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2)) << 16; CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2) += 2; - aga_bpldat[plane] |= ((UINT64)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2))); + aga_bpldat[plane] |= ((uint64_t)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2))); CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2) += 2; break; case 3: - aga_bpldat[plane] = (UINT64)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2)) << 48; + aga_bpldat[plane] = (uint64_t)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2)) << 48; CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2) += 2; - aga_bpldat[plane] |= ((UINT64)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2))) << 32; + aga_bpldat[plane] |= ((uint64_t)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2))) << 32; CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2) += 2; - aga_bpldat[plane] |= ((UINT64)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2))) << 16; + aga_bpldat[plane] |= ((uint64_t)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2))) << 16; CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2) += 2; - aga_bpldat[plane] |= (UINT64)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2)); + aga_bpldat[plane] |= (uint64_t)state->chip_ram_r(CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2)); CUSTOM_REG_LONG(REG_BPL1PTH + plane * 2) += 2; break; } @@ -443,13 +443,13 @@ static inline rgb_t update_ham(amiga_state *state, int newpix) void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) { amiga_state *state = this; - UINT16 save_color0 = CUSTOM_REG(REG_COLOR00); + uint16_t save_color0 = CUSTOM_REG(REG_COLOR00); int ddf_start_pixel = 0, ddf_stop_pixel = 0; int hires = 0, dualpf = 0, ham = 0; int pf1pri = 0, pf2pri = 0; int planes = 0; - UINT32 *dst = nullptr; + uint32_t *dst = nullptr; int ebitoffs = 0, obitoffs = 0; int ecolmask = 0, ocolmask = 0; int edelay = 0, odelay = 0; @@ -856,7 +856,7 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline) * *************************************/ -UINT32 amiga_state::screen_update_amiga_aga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t amiga_state::screen_update_amiga_aga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { if (cliprect.min_y != cliprect.max_y) return 0; diff --git a/src/mame/video/amigaaga.h b/src/mame/video/amigaaga.h index e2c4b887bdc..3d99cc47a21 100644 --- a/src/mame/video/amigaaga.h +++ b/src/mame/video/amigaaga.h @@ -4,6 +4,6 @@ #ifndef __AMIGAAGA_H__ #define __AMIGAAGA_H__ -void amiga_aga_palette_write(running_machine &machine, int color_reg, UINT16 data); +void amiga_aga_palette_write(running_machine &machine, int color_reg, uint16_t data); #endif /* __AMIGA_H__ */ diff --git a/src/mame/video/ampoker2.cpp b/src/mame/video/ampoker2.cpp index 73ff44b0b0b..686e3618715 100644 --- a/src/mame/video/ampoker2.cpp +++ b/src/mame/video/ampoker2.cpp @@ -75,7 +75,7 @@ PALETTE_INIT_MEMBER(ampoker2_state, ampoker2) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); /* - bits - 76543210 RRRGGGBB @@ -116,14 +116,14 @@ PALETTE_INIT_MEMBER(ampoker2_state, ampoker2) WRITE8_MEMBER(ampoker2_state::ampoker2_videoram_w) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset / 2); } TILE_GET_INFO_MEMBER(ampoker2_state::get_bg_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int offs = tile_index * 2; int attr = videoram[offs + 1]; int code = videoram[offs]; @@ -136,7 +136,7 @@ TILE_GET_INFO_MEMBER(ampoker2_state::get_bg_tile_info) TILE_GET_INFO_MEMBER(ampoker2_state::s2k_get_bg_tile_info) { - UINT8 *videoram = m_videoram; + uint8_t *videoram = m_videoram; int offs = tile_index * 2; int attr = videoram[offs + 1]; int code = videoram[offs]; @@ -159,7 +159,7 @@ VIDEO_START_MEMBER(ampoker2_state,sigma2k) 8, 8, 64, 32); } -UINT32 ampoker2_state::screen_update_ampoker2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ampoker2_state::screen_update_ampoker2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/amspdwy.cpp b/src/mame/video/amspdwy.cpp index fe068665935..28c757f3ae0 100644 --- a/src/mame/video/amspdwy.cpp +++ b/src/mame/video/amspdwy.cpp @@ -39,8 +39,8 @@ WRITE8_MEMBER(amspdwy_state::amspdwy_flipscreen_w) TILE_GET_INFO_MEMBER(amspdwy_state::get_tile_info) { - UINT8 code = m_videoram[tile_index]; - UINT8 color = m_colorram[tile_index]; + uint8_t code = m_videoram[tile_index]; + uint8_t color = m_colorram[tile_index]; SET_TILE_INFO_MEMBER(0, code + ((color & 0x18)<<5), color & 0x07, @@ -94,7 +94,7 @@ Offset: Format: Value: void amspdwy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) { - UINT8 *spriteram = m_spriteram; + uint8_t *spriteram = m_spriteram; int i; int max_x = m_screen->width() - 1; int max_y = m_screen->height() - 1; @@ -134,7 +134,7 @@ void amspdwy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprec ***************************************************************************/ -UINT32 amspdwy_state::screen_update_amspdwy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t amspdwy_state::screen_update_amspdwy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); diff --git a/src/mame/video/angelkds.cpp b/src/mame/video/angelkds.cpp index fd91de83006..bcd83e5cc2b 100644 --- a/src/mame/video/angelkds.cpp +++ b/src/mame/video/angelkds.cpp @@ -123,8 +123,8 @@ a split down the middle of the screen void angelkds_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int enable_n) { - const UINT8 *source = m_spriteram + 0x100 - 4; - const UINT8 *finish = m_spriteram; + const uint8_t *source = m_spriteram + 0x100 - 4; + const uint8_t *finish = m_spriteram; gfx_element *gfx = m_gfxdecode->gfx(3); while (source >= finish) @@ -145,16 +145,16 @@ void angelkds_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec x = X position */ - UINT16 tile_no = source[0]; - UINT8 attr = source[1]; - UINT8 ypos = source[2]; - UINT8 xpos = source[3]; + uint16_t tile_no = source[0]; + uint8_t attr = source[1]; + uint8_t ypos = source[2]; + uint8_t xpos = source[3]; - UINT8 enable = attr & 0xc0; - UINT8 flipx = (attr & 0x10) >> 4; - UINT8 flipy = (attr & 0x20) >> 5; - UINT8 bank = attr & 0x08; - UINT8 color = attr & 0x03; + uint8_t enable = attr & 0xc0; + uint8_t flipx = (attr & 0x10) >> 4; + uint8_t flipy = (attr & 0x20) >> 5; + uint8_t bank = attr & 0x08; + uint8_t color = attr & 0x03; if (bank) tile_no += 0x100; @@ -231,7 +231,7 @@ void angelkds_state::video_start() /* enable bits are uncertain */ -UINT32 angelkds_state::screen_update_angelkds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t angelkds_state::screen_update_angelkds(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { const rectangle &visarea = screen.visible_area(); rectangle clip; diff --git a/src/mame/video/antic.cpp b/src/mame/video/antic.cpp index c474674f6e3..9cf5ec3619e 100644 --- a/src/mame/video/antic.cpp +++ b/src/mame/video/antic.cpp @@ -25,7 +25,7 @@ const device_type ATARI_ANTIC = &device_creator; // antic_device - constructor //------------------------------------------------- -antic_device::antic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +antic_device::antic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ATARI_ANTIC, "Atari ANTIC", tag, owner, clock, "antic", __FILE__), device_video_interface(mconfig, *this), m_gtia_tag(nullptr), @@ -67,7 +67,7 @@ void antic_device::device_start() m_bitmap = std::make_unique(m_screen->width(), m_screen->height()); - m_cclk_expand = make_unique_clear(21 * 256); + m_cclk_expand = make_unique_clear(21 * 256); m_pf_21 = &m_cclk_expand[ 0 * 256]; m_pf_x10b = &m_cclk_expand[ 1 * 256]; @@ -79,9 +79,9 @@ void antic_device::device_start() m_pf_gtia2 = &m_cclk_expand[19 * 256]; m_pf_gtia3 = &m_cclk_expand[20 * 256]; - m_used_colors = std::make_unique(21 * 256); + m_used_colors = std::make_unique(21 * 256); - memset(m_used_colors.get(), 0, 21 * 256 * sizeof(UINT8)); + memset(m_used_colors.get(), 0, 21 * 256 * sizeof(uint8_t)); m_uc_21 = &m_used_colors[ 0 * 256]; m_uc_x10b = &m_used_colors[ 1 * 256]; @@ -97,7 +97,7 @@ void antic_device::device_start() cclk_init(); for (auto & elem : m_prio_table) - elem = make_unique_clear(8*256); + elem = make_unique_clear(8*256); LOG(("atari prio_init\n")); prio_init(); @@ -106,8 +106,8 @@ void antic_device::device_start() m_video[i] = auto_alloc_clear(machine(),